From 02a2b9df24f6d8ad3d56655ff7da35118e3b5898 Mon Sep 17 00:00:00 2001 From: support Date: Sat, 9 Jul 2022 07:35:03 +0000 Subject: [PATCH] Built motion from commit eddce310.|2.6.12 --- apidoc/api_project.js | 4 +- apidoc/api_project.json | 4 +- npm-shrinkwrap.json | 2 +- package.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/contacts/index.js | 2 +- server/components/contacts/sql-utils.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.js | 2 +- server/components/realtime/queues.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/migrations/2.6.12.js | 169 ++++++++++++++++++++ server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/models/action.js | 2 +- server/services/ami/dialer/models/agentComplete.js | 2 +- server/services/ami/dialer/models/final.js | 2 +- server/services/ami/dialer/models/hangup.js | 2 +- server/services/ami/dialer/models/history.js | 2 +- .../ami/dialer/models/queueCallerAbandon.js | 2 +- server/services/ami/dialer/utils/hopper.js | 2 +- server/services/ami/dialer/utils/index.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/voiceQueueSummary.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/realtime/utils.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/interval.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/iftime.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- server/utils/update-app-config.js | 2 +- 1206 files changed, 1376 insertions(+), 1207 deletions(-) create mode 100644 server/migrations/2.6.12.js diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 2904d62..265c6fc 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1,6 +1,6 @@ define({ "name": "xCALLY Motion API", - "version": "2.6.11", + "version": "2.6.12", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-07-01T14:56:47.029Z", + "time": "2022-07-09T07:28:00.568Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index da3fb82..da79061 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1,6 +1,6 @@ { "name": "xCALLY Motion API", - "version": "2.6.11", + "version": "2.6.12", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-07-01T14:56:47.029Z", + "time": "2022-07-09T07:28:00.568Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 224f778..cdc4ad1 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.11", + "version": "2.6.12", "dependencies": { "@swc/helpers": { "version": "0.3.17", diff --git a/package.json b/package.json index 2465c10..14ecdfd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.11", + "version": "2.6.12", "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.", "main": "server/app.js", "engines": { diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 83904e5..5e64db3 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 _0x7d8b=['motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','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]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d8b,0x1c1));var _0xb7d8=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0x7d8b[_0x3cbe1c];return _0x5ee08b;};'use strict';var Sequelize=require('sequelize');module[_0xb7d8('0x0')]={'name':{'type':Sequelize[_0xb7d8('0x1')],'get':function(_0x28f7a5){return this[_0xb7d8('0x2')](_0xb7d8('0x3'));}},'action':{'type':Sequelize[_0xb7d8('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb7d8('0x5'),_0xb7d8('0x6'),_0xb7d8('0x7'),_0xb7d8('0x8'),_0xb7d8('0x9'),_0xb7d8('0xa'),_0xb7d8('0xb'),_0xb7d8('0xc')]],'msg':_0xb7d8('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xb7d8('0xe')},'data3':{'type':Sequelize[_0xb7d8('0x4')](0x1000),'comment':_0xb7d8('0xf')},'data4':{'type':Sequelize[_0xb7d8('0x4')](0x1000),'comments':_0xb7d8('0x10')},'data5':{'type':Sequelize[_0xb7d8('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xb7d8('0x11')],'comments':_0xb7d8('0x12')}}; \ No newline at end of file +var _0xa22a=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x19b932,_0x4f05e8){var _0x3dae68=function(_0x329ae9){while(--_0x329ae9){_0x19b932['push'](_0x19b932['shift']());}};_0x3dae68(++_0x4f05e8);}(_0xa22a,0xe0));var _0xaa22=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa22a[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0xaa22('0x0')]={'name':{'type':Sequelize[_0xaa22('0x1')],'get':function(_0x5d58a8){return this[_0xaa22('0x2')](_0xaa22('0x3'));}},'action':{'type':Sequelize[_0xaa22('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xaa22('0x5'),_0xaa22('0x6'),_0xaa22('0x7'),_0xaa22('0x8'),_0xaa22('0x9'),_0xaa22('0xa'),'bot',_0xaa22('0xb')]],'msg':_0xaa22('0xc')}},'comment':_0xaa22('0xc')},'data1':{'type':Sequelize[_0xaa22('0x4')](0x1000),'comment':_0xaa22('0xd')},'data2':{'type':Sequelize[_0xaa22('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xaa22('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xaa22('0xe')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xaa22('0xf')],'comments':_0xaa22('0x10')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 2b283ad..3fe102e 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 _0x1560=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','catch','params','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto'];(function(_0x28ba8d,_0x52a4f3){var _0x472f3b=function(_0x4c5ef3){while(--_0x4c5ef3){_0x28ba8d['push'](_0x28ba8d['shift']());}};_0x472f3b(++_0x52a4f3);}(_0x1560,0x155));var _0x0156=function(_0x455243,_0x524470){_0x455243=_0x455243-0x0;var _0x3bfc83=_0x1560[_0x455243];return _0x3bfc83;};'use strict';var emlformat=require(_0x0156('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0156('0x1'));var rp=require(_0x0156('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0156('0x3'));var util=require(_0x0156('0x4'));var path=require(_0x0156('0x5'));var sox=require(_0x0156('0x6'));var csv=require(_0x0156('0x7'));var ejs=require(_0x0156('0x8'));var fs=require('fs');var fs_extra=require(_0x0156('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0156('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0156('0xb'));var Redis=require('ioredis');var authService=require(_0x0156('0xc'));var qs=require(_0x0156('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0156('0xe'));var logger=require(_0x0156('0xf'))(_0x0156('0x10'));var utils=require('../../config/utils');var config=require(_0x0156('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x0156('0x12'))['db'];function respondWithStatusCode(_0x11c9f4,_0x1664e9){_0x1664e9=_0x1664e9||0xcc;return function(_0x195c19){if(_0x195c19){return _0x11c9f4[_0x0156('0x13')](_0x1664e9);}return _0x11c9f4[_0x0156('0x14')](_0x1664e9)[_0x0156('0x15')]();};}function respondWithResult(_0x9f5380,_0xc04800){_0xc04800=_0xc04800||0xc8;return function(_0x27c7a8){if(_0x27c7a8){return _0x9f5380[_0x0156('0x14')](_0xc04800)[_0x0156('0x16')](_0x27c7a8);}};}function respondWithFilteredResult(_0x31e5e8,_0x3ac20b){return function(_0x65c5bb){if(_0x65c5bb){var _0x868bb2=typeof _0x3ac20b[_0x0156('0x17')]===_0x0156('0x18')&&typeof _0x3ac20b[_0x0156('0x19')]===_0x0156('0x18');var _0x4975be=_0x65c5bb[_0x0156('0x1a')];var _0x448cd6=_0x868bb2?0x0:_0x3ac20b[_0x0156('0x17')];var _0x3f2faf=_0x868bb2?_0x65c5bb[_0x0156('0x1a')]:_0x3ac20b[_0x0156('0x17')]+_0x3ac20b[_0x0156('0x19')];var _0x20cc76;if(_0x3f2faf>=_0x4975be){_0x3f2faf=_0x4975be;_0x20cc76=0xc8;}else{_0x20cc76=0xce;}_0x31e5e8[_0x0156('0x14')](_0x20cc76);return _0x31e5e8[_0x0156('0x1b')](_0x0156('0x1c'),_0x448cd6+'-'+_0x3f2faf+'/'+_0x4975be)[_0x0156('0x16')](_0x65c5bb);}return null;};}function patchUpdates(_0x2786e3){return function(_0x266b00){try{jsonpatch[_0x0156('0x1d')](_0x266b00,_0x2786e3,!![]);}catch(_0x55a0a4){return BPromise[_0x0156('0x1e')](_0x55a0a4);}return _0x266b00[_0x0156('0x1f')]();};}function saveUpdates(_0x2dd30d,_0x29b0b5){return function(_0x268bd1){if(_0x268bd1){return _0x268bd1[_0x0156('0x20')](_0x2dd30d)[_0x0156('0x21')](function(_0x135c5b){return _0x135c5b;});}return null;};}function removeEntity(_0xd4a0d5,_0x41da50){return function(_0x5d3a24){if(_0x5d3a24){return _0x5d3a24[_0x0156('0x22')]()[_0x0156('0x21')](function(){_0xd4a0d5[_0x0156('0x14')](0xcc)[_0x0156('0x15')]();});}};}function handleEntityNotFound(_0x5ade66,_0x19fa93){return function(_0x281dbb){if(!_0x281dbb){_0x5ade66[_0x0156('0x13')](0x194);}return _0x281dbb;};}function handleError(_0x4b82c1,_0x27cca2){_0x27cca2=_0x27cca2||0x1f4;return function(_0x2b70d1){logger[_0x0156('0x23')](_0x2b70d1[_0x0156('0x24')]);if(_0x2b70d1['name']){delete _0x2b70d1[_0x0156('0x25')];}_0x4b82c1[_0x0156('0x14')](_0x27cca2)[_0x0156('0x26')](_0x2b70d1);};}exports[_0x0156('0x20')]=function(_0x53b818,_0x10636c){if(_0x53b818[_0x0156('0x27')]['id']){delete _0x53b818[_0x0156('0x27')]['id'];}return db[_0x0156('0x28')][_0x0156('0x29')]({'where':{'id':_0x53b818['params']['id']}})[_0x0156('0x21')](handleEntityNotFound(_0x10636c,null))[_0x0156('0x21')](saveUpdates(_0x53b818[_0x0156('0x27')],null))['then'](respondWithResult(_0x10636c,null))[_0x0156('0x2a')](handleError(_0x10636c,null));};exports[_0x0156('0x22')]=function(_0x1759b1,_0x41cac6){return db[_0x0156('0x28')][_0x0156('0x29')]({'where':{'id':_0x1759b1[_0x0156('0x2b')]['id']}})[_0x0156('0x21')](handleEntityNotFound(_0x41cac6,null))['then'](removeEntity(_0x41cac6,null))['catch'](handleError(_0x41cac6,null));}; \ No newline at end of file +var _0xc1b9=['params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','update','then','destroy','stack','name','send','body','Action','find'];(function(_0x4467b7,_0xc7abf4){var _0x2cb475=function(_0x424ccc){while(--_0x424ccc){_0x4467b7['push'](_0x4467b7['shift']());}};_0x2cb475(++_0xc7abf4);}(_0xc1b9,0xed));var _0x9c1b=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0xc1b9[_0x8b8564];return _0x360c61;};'use strict';var emlformat=require(_0x9c1b('0x0'));var rimraf=require(_0x9c1b('0x1'));var zipdir=require(_0x9c1b('0x2'));var jsonpatch=require(_0x9c1b('0x3'));var rp=require(_0x9c1b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9c1b('0x5'));var util=require('util');var path=require(_0x9c1b('0x6'));var sox=require(_0x9c1b('0x7'));var csv=require(_0x9c1b('0x8'));var ejs=require(_0x9c1b('0x9'));var fs=require('fs');var fs_extra=require(_0x9c1b('0xa'));var _=require('lodash');var squel=require(_0x9c1b('0xb'));var crypto=require(_0x9c1b('0xc'));var jsforce=require(_0x9c1b('0xd'));var deskjs=require(_0x9c1b('0xe'));var toCsv=require(_0x9c1b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9c1b('0xf'));var authService=require(_0x9c1b('0x10'));var qs=require(_0x9c1b('0x11'));var as=require(_0x9c1b('0x12'));var hardwareService=require(_0x9c1b('0x13'));var logger=require(_0x9c1b('0x14'))(_0x9c1b('0x15'));var utils=require(_0x9c1b('0x16'));var config=require(_0x9c1b('0x17'));var licenseUtil=require(_0x9c1b('0x18'));var db=require(_0x9c1b('0x19'))['db'];function respondWithStatusCode(_0x5f3892,_0x54a6c3){_0x54a6c3=_0x54a6c3||0xcc;return function(_0xb102b7){if(_0xb102b7){return _0x5f3892[_0x9c1b('0x1a')](_0x54a6c3);}return _0x5f3892[_0x9c1b('0x1b')](_0x54a6c3)[_0x9c1b('0x1c')]();};}function respondWithResult(_0x3abecc,_0x5d504a){_0x5d504a=_0x5d504a||0xc8;return function(_0x13df65){if(_0x13df65){return _0x3abecc[_0x9c1b('0x1b')](_0x5d504a)[_0x9c1b('0x1d')](_0x13df65);}};}function respondWithFilteredResult(_0x39e558,_0x579712){return function(_0x1c8b0d){if(_0x1c8b0d){var _0x5a433c=typeof _0x579712['offset']==='undefined'&&typeof _0x579712[_0x9c1b('0x1e')]===_0x9c1b('0x1f');var _0x159bcd=_0x1c8b0d[_0x9c1b('0x20')];var _0x357956=_0x5a433c?0x0:_0x579712['offset'];var _0x519e4e=_0x5a433c?_0x1c8b0d[_0x9c1b('0x20')]:_0x579712[_0x9c1b('0x21')]+_0x579712[_0x9c1b('0x1e')];var _0x470351;if(_0x519e4e>=_0x159bcd){_0x519e4e=_0x159bcd;_0x470351=0xc8;}else{_0x470351=0xce;}_0x39e558['status'](_0x470351);return _0x39e558[_0x9c1b('0x22')]('Content-Range',_0x357956+'-'+_0x519e4e+'/'+_0x159bcd)[_0x9c1b('0x1d')](_0x1c8b0d);}return null;};}function patchUpdates(_0x860638){return function(_0x15451e){try{jsonpatch[_0x9c1b('0x23')](_0x15451e,_0x860638,!![]);}catch(_0x257158){return BPromise['reject'](_0x257158);}return _0x15451e['save']();};}function saveUpdates(_0x4fc580,_0x37d58c){return function(_0x490b5c){if(_0x490b5c){return _0x490b5c[_0x9c1b('0x24')](_0x4fc580)[_0x9c1b('0x25')](function(_0x48afa9){return _0x48afa9;});}return null;};}function removeEntity(_0x4c2df5,_0x41c8e8){return function(_0x3e1613){if(_0x3e1613){return _0x3e1613[_0x9c1b('0x26')]()['then'](function(){_0x4c2df5[_0x9c1b('0x1b')](0xcc)[_0x9c1b('0x1c')]();});}};}function handleEntityNotFound(_0x486dc3,_0x4b6838){return function(_0x9afd06){if(!_0x9afd06){_0x486dc3[_0x9c1b('0x1a')](0x194);}return _0x9afd06;};}function handleError(_0x2acef3,_0x17859f){_0x17859f=_0x17859f||0x1f4;return function(_0xa61e8d){logger['error'](_0xa61e8d[_0x9c1b('0x27')]);if(_0xa61e8d['name']){delete _0xa61e8d[_0x9c1b('0x28')];}_0x2acef3[_0x9c1b('0x1b')](_0x17859f)[_0x9c1b('0x29')](_0xa61e8d);};}exports['update']=function(_0x30c153,_0x155cdc){if(_0x30c153[_0x9c1b('0x2a')]['id']){delete _0x30c153[_0x9c1b('0x2a')]['id'];}return db[_0x9c1b('0x2b')][_0x9c1b('0x2c')]({'where':{'id':_0x30c153[_0x9c1b('0x2d')]['id']}})[_0x9c1b('0x25')](handleEntityNotFound(_0x155cdc,null))[_0x9c1b('0x25')](saveUpdates(_0x30c153['body'],null))[_0x9c1b('0x25')](respondWithResult(_0x155cdc,null))[_0x9c1b('0x2e')](handleError(_0x155cdc,null));};exports[_0x9c1b('0x26')]=function(_0xb3de96,_0x500fa0){return db[_0x9c1b('0x2b')][_0x9c1b('0x2c')]({'where':{'id':_0xb3de96[_0x9c1b('0x2d')]['id']}})[_0x9c1b('0x25')](handleEntityNotFound(_0x500fa0,null))[_0x9c1b('0x25')](removeEntity(_0x500fa0,null))[_0x9c1b('0x2e')](handleError(_0x500fa0,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 39b66d0..b69b864 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 _0x6002=['Action','tools_actions','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./action.attributes','define'];(function(_0x57564c,_0x1845cf){var _0x5702ed=function(_0x30d8b6){while(--_0x30d8b6){_0x57564c['push'](_0x57564c['shift']());}};_0x5702ed(++_0x1845cf);}(_0x6002,0xfe));var _0x2600=function(_0x1917e1,_0x4857ac){_0x1917e1=_0x1917e1-0x0;var _0x3bf42c=_0x6002[_0x1917e1];return _0x3bf42c;};'use strict';var _=require(_0x2600('0x0'));var util=require(_0x2600('0x1'));var logger=require(_0x2600('0x2'))(_0x2600('0x3'));var moment=require(_0x2600('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2600('0x5'));var rimraf=require(_0x2600('0x6'));var config=require(_0x2600('0x7'));var attributes=require(_0x2600('0x8'));module['exports']=function(_0x549603,_0x24fbb8){return _0x549603[_0x2600('0x9')](_0x2600('0xa'),attributes,{'tableName':_0x2600('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb05=['path','rimraf','../../config/environment','./action.attributes','Action','util','../../config/logger','api','bluebird','request-promise'];(function(_0x9224ef,_0x45b213){var _0x5cda26=function(_0x5d48d1){while(--_0x5d48d1){_0x9224ef['push'](_0x9224ef['shift']());}};_0x5cda26(++_0x45b213);}(_0xbb05,0xa5));var _0x5bb0=function(_0x401805,_0x5127ae){_0x401805=_0x401805-0x0;var _0x170646=_0xbb05[_0x401805];return _0x170646;};'use strict';var _=require('lodash');var util=require(_0x5bb0('0x0'));var logger=require(_0x5bb0('0x1'))(_0x5bb0('0x2'));var moment=require('moment');var BPromise=require(_0x5bb0('0x3'));var rp=require(_0x5bb0('0x4'));var fs=require('fs');var path=require(_0x5bb0('0x5'));var rimraf=require(_0x5bb0('0x6'));var config=require(_0x5bb0('0x7'));var attributes=require(_0x5bb0('0x8'));module['exports']=function(_0x4c9c9d,_0x18b345){return _0x4c9c9d['define'](_0x5bb0('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index aab5ae4..e8b7ba8 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(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x814b,0x1a2));var _0xb814=function(_0x170f4c,_0x4a4c80){_0x170f4c=_0x170f4c-0x0;var _0x52eedd=_0x814b[_0x170f4c];return _0x52eedd;};'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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x213a70,_0x3e7e1a){var _0xdf4aa4=function(_0x56049b){while(--_0x56049b){_0x213a70['push'](_0x213a70['shift']());}};_0xdf4aa4(++_0x3e7e1a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0x5fc3[_0x2bf466];return _0x856885;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index cbd3fce..ef981f8 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 _0x53ce=['fs-extra','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','delete','exports','multer','util','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53ce,0x1f4));var _0xe53c=function(_0x2b4f06,_0x103e99){_0x2b4f06=_0x2b4f06-0x0;var _0x5cc9bb=_0x53ce[_0x2b4f06];return _0x5cc9bb;};'use strict';var multer=require(_0xe53c('0x0'));var util=require(_0xe53c('0x1'));var path=require('path');var timeout=require(_0xe53c('0x2'));var express=require(_0xe53c('0x3'));var router=express['Router']();var fs_extra=require(_0xe53c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe53c('0x5'));var config=require(_0xe53c('0x6'));var controller=require(_0xe53c('0x7'));router['put'](_0xe53c('0x8'),auth[_0xe53c('0x9')](),controller['update']);router[_0xe53c('0xa')](_0xe53c('0x8'),auth[_0xe53c('0x9')](),controller['destroy']);module[_0xe53c('0xb')]=router; \ No newline at end of file +var _0x087a=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','update','delete'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x087a,0x1f2));var _0xa087=function(_0x48c3d5,_0x2dcdb4){_0x48c3d5=_0x48c3d5-0x0;var _0x4f79d3=_0x087a[_0x48c3d5];return _0x4f79d3;};'use strict';var multer=require(_0xa087('0x0'));var util=require(_0xa087('0x1'));var path=require(_0xa087('0x2'));var timeout=require(_0xa087('0x3'));var express=require(_0xa087('0x4'));var router=express[_0xa087('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa087('0x6'));var interaction=require(_0xa087('0x7'));var config=require('../../config/environment');var controller=require(_0xa087('0x8'));router[_0xa087('0x9')](_0xa087('0xa'),auth[_0xa087('0xb')](),controller[_0xa087('0xc')]);router[_0xa087('0xd')](_0xa087('0xa'),auth[_0xa087('0xb')](),controller[_0xa087('0xe')]);module[_0xa087('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index ecacfde..65b250e 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 _0x24ca=['sequelize','STRING','TEXT'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x24ca,0x1bc));var _0xa24c=function(_0x72a33d,_0x5691da){_0x72a33d=_0x72a33d-0x0;var _0x2621d5=_0x24ca[_0x72a33d];return _0x2621d5;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file +var _0x425d=['sequelize','STRING','TEXT'];(function(_0x176e5d,_0x17ac69){var _0x3842ed=function(_0x125112){while(--_0x125112){_0x176e5d['push'](_0x176e5d['shift']());}};_0x3842ed(++_0x17ac69);}(_0x425d,0x1e0));var _0xd425=function(_0x4ea9a4,_0x344f3e){_0x4ea9a4=_0x4ea9a4-0x0;var _0x30fddb=_0x425d[_0x4ea9a4];return _0x30fddb;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index dc4497b..e080f67 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 _0x2c5b=['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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','table','MetricId','metric','function','replace','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20EMPTY','from','output','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','debug','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','get','CustomReports','UserProfileResource','error','stack','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','rows','catch','show','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','destroy','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)'];(function(_0x93046d,_0x2f007c){var _0x260519=function(_0x11eb0e){while(--_0x11eb0e){_0x93046d['push'](_0x93046d['shift']());}};_0x260519(++_0x2f007c);}(_0x2c5b,0x193));var _0xb2c5=function(_0x48dea1,_0x1baaa6){_0x48dea1=_0x48dea1-0x0;var _0x598d7c=_0x2c5b[_0x48dea1];return _0x598d7c;};'use strict';var emlformat=require(_0xb2c5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb2c5('0x1'));var jsonpatch=require(_0xb2c5('0x2'));var rp=require(_0xb2c5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb2c5('0x4'));var util=require(_0xb2c5('0x5'));var path=require(_0xb2c5('0x6'));var sox=require(_0xb2c5('0x7'));var csv=require('to-csv');var ejs=require(_0xb2c5('0x8'));var fs=require('fs');var fs_extra=require(_0xb2c5('0x9'));var _=require(_0xb2c5('0xa'));var squel=require(_0xb2c5('0xb'));var crypto=require(_0xb2c5('0xc'));var jsforce=require(_0xb2c5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb2c5('0xe'));var Papa=require(_0xb2c5('0xf'));var Redis=require(_0xb2c5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb2c5('0x11'));var as=require(_0xb2c5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb2c5('0x13'));var utils=require(_0xb2c5('0x14'));var config=require(_0xb2c5('0x15'));var licenseUtil=require(_0xb2c5('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xb2c5('0x17'))[_0xb2c5('0x18')];function respondWithStatusCode(_0x250f0d,_0x17de7b){_0x17de7b=_0x17de7b||0xcc;return function(_0x49dc99){if(_0x49dc99){return _0x250f0d['sendStatus'](_0x17de7b);}return _0x250f0d[_0xb2c5('0x19')](_0x17de7b)[_0xb2c5('0x1a')]();};}function respondWithResult(_0x409398,_0xd516b8){_0xd516b8=_0xd516b8||0xc8;return function(_0xf88cde){if(_0xf88cde){return _0x409398[_0xb2c5('0x19')](_0xd516b8)[_0xb2c5('0x1b')](_0xf88cde);}};}function respondWithFilteredResult(_0x1fffa7,_0x6ede6){return function(_0x53e60b){if(_0x53e60b){var _0xb6a3ea=typeof _0x6ede6[_0xb2c5('0x1c')]===_0xb2c5('0x1d')&&typeof _0x6ede6['limit']===_0xb2c5('0x1d');var _0x5f061d=_0x53e60b[_0xb2c5('0x1e')];var _0x47f579=_0xb6a3ea?0x0:_0x6ede6['offset'];var _0x1978f6=_0xb6a3ea?_0x53e60b[_0xb2c5('0x1e')]:_0x6ede6[_0xb2c5('0x1c')]+_0x6ede6[_0xb2c5('0x1f')];var _0x24f752;if(_0x1978f6>=_0x5f061d){_0x1978f6=_0x5f061d;_0x24f752=0xc8;}else{_0x24f752=0xce;}_0x1fffa7[_0xb2c5('0x19')](_0x24f752);return _0x1fffa7[_0xb2c5('0x20')](_0xb2c5('0x21'),_0x47f579+'-'+_0x1978f6+'/'+_0x5f061d)[_0xb2c5('0x1b')](_0x53e60b);}return null;};}function patchUpdates(_0xcb297b){return function(_0x2d3aea){try{jsonpatch['apply'](_0x2d3aea,_0xcb297b,!![]);}catch(_0x14b490){return BPromise[_0xb2c5('0x22')](_0x14b490);}return _0x2d3aea[_0xb2c5('0x23')]();};}function saveUpdates(_0x50cc75,_0xddc170){return function(_0x27e1d6){if(_0x27e1d6){return _0x27e1d6['update'](_0x50cc75)[_0xb2c5('0x24')](function(_0x290a0b){return _0x290a0b;});}return null;};}function removeEntity(_0x7e3814,_0x48d61d){return function(_0x817101){if(_0x817101){return _0x817101['destroy']()[_0xb2c5('0x24')](function(){var _0x45f38e=_0x817101[_0xb2c5('0x25')]({'plain':!![]});var _0x123b7c=_0xb2c5('0x26');return db[_0xb2c5('0x27')]['destroy']({'where':{'type':_0x123b7c,'resourceId':_0x45f38e['id']}})[_0xb2c5('0x24')](function(){return _0x817101;});})[_0xb2c5('0x24')](function(){_0x7e3814['status'](0xcc)[_0xb2c5('0x1a')]();});}};}function handleEntityNotFound(_0x5799fe,_0x5bd7e2){return function(_0x5cfacc){if(!_0x5cfacc){_0x5799fe['sendStatus'](0x194);}return _0x5cfacc;};}function handleError(_0xe69b01,_0x19d5b9){_0x19d5b9=_0x19d5b9||0x1f4;return function(_0x4f0f0f){logger[_0xb2c5('0x28')](_0x4f0f0f[_0xb2c5('0x29')]);if(_0x4f0f0f['name']){delete _0x4f0f0f['name'];}_0xe69b01[_0xb2c5('0x19')](_0x19d5b9)[_0xb2c5('0x2a')](_0x4f0f0f);};}exports[_0xb2c5('0x2b')]=function(_0x3efc71,_0x524c93){var _0x5ce606={},_0x1ea585={},_0x31e695={'count':0x0,'rows':[]};var _0x35c365=_[_0xb2c5('0x2c')](db[_0xb2c5('0x2d')][_0xb2c5('0x2e')],function(_0xa3de3f){return{'name':_0xa3de3f[_0xb2c5('0x2f')],'type':_0xa3de3f['type'][_0xb2c5('0x30')]};});_0x1ea585[_0xb2c5('0x31')]=_['map'](_0x35c365,_0xb2c5('0x32'));_0x1ea585[_0xb2c5('0x33')]=_[_0xb2c5('0x34')](_0x3efc71[_0xb2c5('0x33')]);_0x1ea585[_0xb2c5('0x35')]=_['intersection'](_0x1ea585['model'],_0x1ea585['query']);_0x5ce606[_0xb2c5('0x36')]=_[_0xb2c5('0x37')](_0x1ea585[_0xb2c5('0x31')],qs[_0xb2c5('0x38')](_0x3efc71['query'][_0xb2c5('0x38')]));_0x5ce606[_0xb2c5('0x36')]=_0x5ce606[_0xb2c5('0x36')][_0xb2c5('0x39')]?_0x5ce606[_0xb2c5('0x36')]:_0x1ea585['model'];if(!_0x3efc71[_0xb2c5('0x33')][_0xb2c5('0x3a')](_0xb2c5('0x3b'))){_0x5ce606[_0xb2c5('0x1f')]=qs['limit'](_0x3efc71[_0xb2c5('0x33')][_0xb2c5('0x1f')]);_0x5ce606[_0xb2c5('0x1c')]=qs[_0xb2c5('0x1c')](_0x3efc71[_0xb2c5('0x33')][_0xb2c5('0x1c')]);}_0x5ce606[_0xb2c5('0x3c')]=qs['sort'](_0x3efc71[_0xb2c5('0x33')][_0xb2c5('0x3d')]);_0x5ce606['where']=qs['filters'](_['pick'](_0x3efc71[_0xb2c5('0x33')],_0x1ea585[_0xb2c5('0x35')]),_0x35c365);if(_0x3efc71[_0xb2c5('0x33')]['filter']){_0x5ce606[_0xb2c5('0x3e')]=_[_0xb2c5('0x3f')](_0x5ce606['where'],{'$or':_[_0xb2c5('0x2c')](_0x35c365,function(_0x3ac325){if(_0x3ac325[_0xb2c5('0x40')]!==_0xb2c5('0x41')){var _0x592ae6={};_0x592ae6[_0x3ac325['name']]={'$like':'%'+_0x3efc71['query']['filter']+'%'};return _0x592ae6;}})});}_0x5ce606=_['merge']({},_0x5ce606,_0x3efc71[_0xb2c5('0x42')]);var _0x3b7098={'where':_0x5ce606[_0xb2c5('0x3e')]};return db[_0xb2c5('0x2d')][_0xb2c5('0x1e')](_0x3b7098)['then'](function(_0x186203){_0x31e695[_0xb2c5('0x1e')]=_0x186203;if(_0x3efc71[_0xb2c5('0x33')]['includeAll']){_0x5ce606['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x5ce606);})[_0xb2c5('0x24')](function(_0x1eab78){_0x31e695[_0xb2c5('0x43')]=_0x1eab78;return _0x31e695;})[_0xb2c5('0x24')](respondWithFilteredResult(_0x524c93,_0x5ce606))[_0xb2c5('0x44')](handleError(_0x524c93,null));};exports[_0xb2c5('0x45')]=function(_0x48f87e,_0x25e75b){var _0x22ea24={'raw':![],'where':{'id':_0x48f87e['params']['id']}},_0x4892ca={};_0x4892ca[_0xb2c5('0x31')]=_['keys'](db[_0xb2c5('0x2d')][_0xb2c5('0x2e')]);_0x4892ca[_0xb2c5('0x33')]=_[_0xb2c5('0x34')](_0x48f87e['query']);_0x4892ca[_0xb2c5('0x35')]=_[_0xb2c5('0x37')](_0x4892ca['model'],_0x4892ca[_0xb2c5('0x33')]);_0x22ea24[_0xb2c5('0x36')]=_[_0xb2c5('0x37')](_0x4892ca[_0xb2c5('0x31')],qs[_0xb2c5('0x38')](_0x48f87e[_0xb2c5('0x33')]['fields']));_0x22ea24[_0xb2c5('0x36')]=_0x22ea24[_0xb2c5('0x36')][_0xb2c5('0x39')]?_0x22ea24['attributes']:_0x4892ca[_0xb2c5('0x31')];if(_0x48f87e[_0xb2c5('0x33')][_0xb2c5('0x46')]){_0x22ea24['include']=[{'all':!![]}];}_0x22ea24=_[_0xb2c5('0x3f')]({},_0x22ea24,_0x48f87e[_0xb2c5('0x42')]);return db['AnalyticCustomReport'][_0xb2c5('0x47')](_0x22ea24)[_0xb2c5('0x24')](handleEntityNotFound(_0x25e75b,null))[_0xb2c5('0x24')](respondWithResult(_0x25e75b,null))[_0xb2c5('0x44')](handleError(_0x25e75b,null));};exports[_0xb2c5('0x48')]=function(_0x4edf93,_0x2dce2d){return db['AnalyticCustomReport']['create'](_0x4edf93['body'],{})[_0xb2c5('0x24')](function(_0x1ac9be){var _0x246122=_0x4edf93['user'][_0xb2c5('0x25')]({'plain':!![]});if(!_0x246122)throw new Error(_0xb2c5('0x49'));if(_0x246122[_0xb2c5('0x4a')]===_0xb2c5('0x4b')){var _0xcee529=_0x1ac9be[_0xb2c5('0x25')]({'plain':!![]});var _0x3f750f='Reports';return db[_0xb2c5('0x4c')][_0xb2c5('0x47')]({'where':{'name':_0x3f750f,'userProfileId':_0x246122[_0xb2c5('0x4d')]},'raw':!![]})[_0xb2c5('0x24')](function(_0x360ec1){if(_0x360ec1&&_0x360ec1[_0xb2c5('0x4e')]===0x0){return db[_0xb2c5('0x27')][_0xb2c5('0x48')]({'name':_0xcee529['name'],'resourceId':_0xcee529['id'],'type':_0xb2c5('0x26'),'sectionId':_0x360ec1['id']},{})[_0xb2c5('0x24')](function(){return _0x1ac9be;});}else{return _0x1ac9be;}})[_0xb2c5('0x44')](function(_0x47ea0e){logger['error'](_0xb2c5('0x4f'),_0x47ea0e);throw _0x47ea0e;});}return _0x1ac9be;})[_0xb2c5('0x24')](respondWithResult(_0x2dce2d,0xc9))['catch'](handleError(_0x2dce2d,null));};exports[_0xb2c5('0x50')]=function(_0x4ce871,_0x24f21c){if(_0x4ce871[_0xb2c5('0x51')]['id']){delete _0x4ce871[_0xb2c5('0x51')]['id'];}return db[_0xb2c5('0x2d')][_0xb2c5('0x47')]({'where':{'id':_0x4ce871[_0xb2c5('0x52')]['id']}})[_0xb2c5('0x24')](handleEntityNotFound(_0x24f21c,null))['then'](saveUpdates(_0x4ce871[_0xb2c5('0x51')],null))['then'](respondWithResult(_0x24f21c,null))['catch'](handleError(_0x24f21c,null));};exports[_0xb2c5('0x53')]=function(_0x3fe8f5,_0xf3e328){return db[_0xb2c5('0x2d')][_0xb2c5('0x47')]({'where':{'id':_0x3fe8f5[_0xb2c5('0x52')]['id']}})[_0xb2c5('0x24')](handleEntityNotFound(_0xf3e328,null))['then'](removeEntity(_0xf3e328,null))[_0xb2c5('0x44')](handleError(_0xf3e328,null));};exports[_0xb2c5('0x54')]=function(_0x593a0d,_0x4a6708){var _0x423366=0xa;var _0x20df40=[_0xb2c5('0x55'),_0xb2c5('0x56'),_0xb2c5('0x57'),_0xb2c5('0x58')];var _0x43aa27={'SUM':'SUM(%s)','COUNT':_0xb2c5('0x59'),'COUNT DISTINCT':_0xb2c5('0x5a'),'MAX':_0xb2c5('0x5b'),'MIN':_0xb2c5('0x5c'),'AVG':_0xb2c5('0x5d'),'GROUP_CONCAT':_0xb2c5('0x5e'),'GROUP_CONCAT ASC':_0xb2c5('0x5f'),'GROUP_CONCAT DESC':_0xb2c5('0x60')};var _0x7ed7c={'SEC_TO_TIME':_0xb2c5('0x61'),'DATE':_0xb2c5('0x62'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb2c5('0x63')};var _0x2a4680=function(_0x411835){return!_[_0xb2c5('0x64')]([_0xb2c5('0x65'),_0xb2c5('0x66'),_0xb2c5('0x67'),'IS\x20NOT\x20EMPTY'],_0x411835);};var _0x54127a=function(_0x4bc5ed){if(!_0x4bc5ed||!_0x4bc5ed[_0xb2c5('0x68')][_0xb2c5('0x39')]){return'';}for(var _0x3a959e='(',_0x9da6c9=0x0;_0x9da6c9<_0x4bc5ed[_0xb2c5('0x68')]['length'];_0x9da6c9+=0x1){_0x9da6c9>0x0&&(_0x3a959e+='\x20'+_0x4bc5ed[_0xb2c5('0x69')]+'\x20');_0x3a959e+=_0x4bc5ed[_0xb2c5('0x68')][_0x9da6c9]['group']?_0x54127a(_0x4bc5ed[_0xb2c5('0x68')][_0x9da6c9][_0xb2c5('0x6a')]):_0x4bc5ed[_0xb2c5('0x68')][_0x9da6c9][_0xb2c5('0x6b')]+'\x20'+_0x4bc5ed[_0xb2c5('0x68')][_0x9da6c9][_0xb2c5('0x6c')]+(_0x2a4680(_0x4bc5ed['rules'][_0x9da6c9][_0xb2c5('0x6c')])?'\x20'+_0x4bc5ed[_0xb2c5('0x68')][_0x9da6c9][_0xb2c5('0x6d')]:'');}return _0x3a959e+')';};var _0x16274c={'where':{'id':_0x593a0d[_0xb2c5('0x52')]['id']}},_0x1da677,_0x22a9d4,_0x2aa318,_0x349a97,_0x57a818;_0x16274c=_[_0xb2c5('0x3f')]({},_0x16274c,_0x593a0d[_0xb2c5('0x42')]);return db[_0xb2c5('0x2d')][_0xb2c5('0x47')](_0x16274c)[_0xb2c5('0x24')](function(_0x1fc07c){if(_0x1fc07c){_0x1da677=_0x1fc07c;return _0x1fc07c[_0xb2c5('0x6e')]();}return null;})[_0xb2c5('0x24')](function(_0x22f39f){if(_0x22f39f){if(!_0x22f39f['length']){throw new db[(_0xb2c5('0x6f'))][(_0xb2c5('0x70'))](_0xb2c5('0x71'),0x193);}_0x22a9d4=_0x22f39f;return db[_0xb2c5('0x72')][_0xb2c5('0x73')]({'raw':!![]});}return null;})[_0xb2c5('0x24')](function(_0x32e631){if(_0x32e631){_0x2aa318=_[_0xb2c5('0x74')](_0x32e631,'id');var _0x32201a;var _0x253776=squel[_0xb2c5('0x75')]();_0x253776['from'](_0x1da677[_0xb2c5('0x76')]);for(var _0x1a09c4=0x0;_0x1a09c4<_0x22a9d4[_0xb2c5('0x39')];_0x1a09c4+=0x1){_0x32201a=_0x22a9d4[_0x1a09c4][_0xb2c5('0x77')]?_0x2aa318[_0x22a9d4[_0x1a09c4][_0xb2c5('0x77')]][_0xb2c5('0x78')]:_0x22a9d4[_0x1a09c4]['field'];_0x32201a=_0x22a9d4[_0x1a09c4][_0xb2c5('0x79')]?_[_0xb2c5('0x7a')](_0x43aa27[_0x22a9d4[_0x1a09c4]['function']],'%s',_0x32201a):_0x32201a;_0x32201a=_0x22a9d4[_0x1a09c4]['format']?_[_0xb2c5('0x7a')](_0x7ed7c[_0x22a9d4[_0x1a09c4]['format']],'%s',_0x32201a):_0x32201a;if(_0x22a9d4[_0x1a09c4][_0xb2c5('0x7b')]){_0x253776[_0xb2c5('0x6a')](_0x32201a);}_0x22a9d4[_0x1a09c4][_0xb2c5('0x7c')]&&_0x253776[_0xb2c5('0x3c')](_0x32201a,_0x22a9d4[_0x1a09c4][_0xb2c5('0x7c')]===_0xb2c5('0x7d')?![]:!![]);_0x253776[_0xb2c5('0x6b')](_0x32201a,_0x22a9d4[_0x1a09c4][_0xb2c5('0x7e')]||_0x32201a);}if(_0x1da677[_0xb2c5('0x7f')]){_0x1da677[_0xb2c5('0x7f')]=JSON['parse'](_0x1da677['joins']);for(var _0x6c21f7=0x0;_0x6c21f7<_0x1da677[_0xb2c5('0x7f')][_0xb2c5('0x39')];_0x6c21f7+=0x1){if(_0x1da677[_0xb2c5('0x7f')][_0x6c21f7]['type']&&_['includes'](_0x20df40,_0x1da677['joins'][_0x6c21f7]['type'])&&_0x1da677[_0xb2c5('0x7f')][_0x6c21f7][_0xb2c5('0x80')]&&_0x1da677[_0xb2c5('0x7f')][_0x6c21f7][_0xb2c5('0x81')]&&_0x1da677[_0xb2c5('0x7f')][_0x6c21f7][_0xb2c5('0x82')]){_0x253776[_0x1da677[_0xb2c5('0x7f')][_0x6c21f7][_0xb2c5('0x40')]](_0x1da677[_0xb2c5('0x7f')][_0x6c21f7][_0xb2c5('0x81')],null,util[_0xb2c5('0x83')](_0xb2c5('0x84'),_0x1da677[_0xb2c5('0x76')],_0x1da677[_0xb2c5('0x7f')][_0x6c21f7][_0xb2c5('0x80')],_0x1da677['joins'][_0x6c21f7]['foreignTable'],_0x1da677['joins'][_0x6c21f7][_0xb2c5('0x82')]));}}}if(_0x1da677[_0xb2c5('0x85')]){_0x1da677[_0xb2c5('0x85')]=JSON[_0xb2c5('0x86')](_0x1da677[_0xb2c5('0x85')]);_0x253776[_0xb2c5('0x3e')](_0x54127a(_0x1da677[_0xb2c5('0x85')]['group']));}_0x57a818=_0x253776['clone']();_0x253776['limit'](_0x423366);_0x253776['offset'](0x0);logger['debug'](_0xb2c5('0x87'),_0x253776[_0xb2c5('0x88')]());return dbH[_0xb2c5('0x89')][_0xb2c5('0x33')](_0x253776[_0xb2c5('0x88')](),{'type':dbH[_0xb2c5('0x89')][_0xb2c5('0x8a')][_0xb2c5('0x8b')]});}})[_0xb2c5('0x24')](respondWithResult(_0x4a6708,null))[_0xb2c5('0x44')](handleError(_0x4a6708,null));};function runReport(_0x500943,_0x5e7ab9,_0x1a13cd){var _0xe4ff7=_0x5e7ab9[_0xb2c5('0x32')];var _0x4148b5=0xa;var _0x2b0af1=['join',_0xb2c5('0x56'),_0xb2c5('0x57'),_0xb2c5('0x58')];var _0x46f1cc={'SUM':_0xb2c5('0x8c'),'COUNT':_0xb2c5('0x59'),'COUNT DISTINCT':_0xb2c5('0x5a'),'MAX':_0xb2c5('0x5b'),'MIN':_0xb2c5('0x5c'),'AVG':_0xb2c5('0x5d'),'GROUP_CONCAT':_0xb2c5('0x5e'),'GROUP_CONCAT ASC':_0xb2c5('0x5f'),'GROUP_CONCAT DESC':_0xb2c5('0x60')};var _0x52aaba={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb2c5('0x62'),'HOUR':_0xb2c5('0x8d'),'ROUND':_0xb2c5('0x8e'),'UNIX_TIMESTAMP':_0xb2c5('0x63')};var _0x151db1=function(_0x37a375){return!_[_0xb2c5('0x64')]([_0xb2c5('0x65'),'IS\x20NOT\x20NULL',_0xb2c5('0x67'),_0xb2c5('0x8f')],_0x37a375);};var _0x2c02dd=function(_0x39e01b){if(!_0x39e01b||!_0x39e01b[_0xb2c5('0x68')][_0xb2c5('0x39')]){return'';}for(var _0x43486e='(',_0xf30dfc=0x0;_0xf30dfc<_0x39e01b['rules'][_0xb2c5('0x39')];_0xf30dfc+=0x1){_0xf30dfc>0x0&&(_0x43486e+='\x20'+_0x39e01b['operator']+'\x20');_0x43486e+=_0x39e01b[_0xb2c5('0x68')][_0xf30dfc][_0xb2c5('0x6a')]?_0x2c02dd(_0x39e01b['rules'][_0xf30dfc][_0xb2c5('0x6a')]):_0x39e01b[_0xb2c5('0x68')][_0xf30dfc]['field']+'\x20'+_0x39e01b['rules'][_0xf30dfc][_0xb2c5('0x6c')]+(_0x151db1(_0x39e01b[_0xb2c5('0x68')][_0xf30dfc][_0xb2c5('0x6c')])?'\x20'+_0x39e01b['rules'][_0xf30dfc][_0xb2c5('0x6d')]:'');}return _0x43486e+')';};var _0x296317={'where':{'id':_0x500943['id']}},_0x3bf846,_0x304954,_0x477923,_0x433b29,_0x51bd7c;_0x296317=_['merge']({},_0x296317,_0x1a13cd);return db['AnalyticCustomReport']['find'](_0x296317)[_0xb2c5('0x24')](function(_0x3732c5){if(_0x3732c5){_0x3bf846=_0x3732c5;return _0x3732c5[_0xb2c5('0x6e')]();}return null;})['then'](function(_0x2dbc7e){if(_0x2dbc7e){if(!_0x2dbc7e[_0xb2c5('0x39')]){throw new db[(_0xb2c5('0x6f'))][(_0xb2c5('0x70'))](_0xb2c5('0x71'),0x193);}_0x304954=_0x2dbc7e;return db['AnalyticMetric'][_0xb2c5('0x73')]({'raw':!![]});}return null;})[_0xb2c5('0x24')](function(_0x4bddaf){if(_0x4bddaf){_0x477923=_['keyBy'](_0x4bddaf,'id');var _0x57c1b5;var _0x5c4f4a=squel[_0xb2c5('0x75')]();_0x5c4f4a[_0xb2c5('0x90')](_0x3bf846[_0xb2c5('0x76')]);for(var _0x282207=0x0;_0x282207<_0x304954[_0xb2c5('0x39')];_0x282207+=0x1){_0x57c1b5=_0x304954[_0x282207][_0xb2c5('0x77')]?_0x477923[_0x304954[_0x282207][_0xb2c5('0x77')]][_0xb2c5('0x78')]:_0x304954[_0x282207][_0xb2c5('0x6b')];_0x57c1b5=_0x304954[_0x282207][_0xb2c5('0x79')]?_[_0xb2c5('0x7a')](_0x46f1cc[_0x304954[_0x282207][_0xb2c5('0x79')]],'%s',_0x57c1b5):_0x57c1b5;_0x57c1b5=_0x304954[_0x282207][_0xb2c5('0x83')]?_['replace'](_0x52aaba[_0x304954[_0x282207][_0xb2c5('0x83')]],'%s',_0x57c1b5):_0x57c1b5;if(_0x304954[_0x282207]['groupBy']){_0x5c4f4a[_0xb2c5('0x6a')](_0x57c1b5);}_0x304954[_0x282207][_0xb2c5('0x7c')]&&_0x5c4f4a[_0xb2c5('0x3c')](_0x57c1b5,_0x304954[_0x282207][_0xb2c5('0x7c')]===_0xb2c5('0x7d')?![]:!![]);_0x5c4f4a[_0xb2c5('0x6b')](_0x57c1b5,_0x304954[_0x282207][_0xb2c5('0x7e')]||_0x57c1b5);}if(_0x3bf846[_0xb2c5('0x7f')]){_0x3bf846[_0xb2c5('0x7f')]=JSON[_0xb2c5('0x86')](_0x3bf846[_0xb2c5('0x7f')]);for(var _0x1bdf0c=0x0;_0x1bdf0c<_0x3bf846['joins'][_0xb2c5('0x39')];_0x1bdf0c+=0x1){if(_0x3bf846[_0xb2c5('0x7f')][_0x1bdf0c][_0xb2c5('0x40')]&&_[_0xb2c5('0x64')](_0x2b0af1,_0x3bf846[_0xb2c5('0x7f')][_0x1bdf0c][_0xb2c5('0x40')])&&_0x3bf846[_0xb2c5('0x7f')][_0x1bdf0c]['parentKey']&&_0x3bf846[_0xb2c5('0x7f')][_0x1bdf0c]['foreignTable']&&_0x3bf846['joins'][_0x1bdf0c]['foreignKey']){_0x5c4f4a[_0x3bf846[_0xb2c5('0x7f')][_0x1bdf0c]['type']](_0x3bf846[_0xb2c5('0x7f')][_0x1bdf0c][_0xb2c5('0x81')],null,util[_0xb2c5('0x83')](_0xb2c5('0x84'),_0x3bf846['table'],_0x3bf846[_0xb2c5('0x7f')][_0x1bdf0c][_0xb2c5('0x80')],_0x3bf846['joins'][_0x1bdf0c][_0xb2c5('0x81')],_0x3bf846[_0xb2c5('0x7f')][_0x1bdf0c]['foreignKey']));}}}if(_0x3bf846[_0xb2c5('0x85')]){_0x3bf846[_0xb2c5('0x85')]=JSON[_0xb2c5('0x86')](_0x3bf846[_0xb2c5('0x85')]);_0x5c4f4a['where'](_0x2c02dd(_0x3bf846[_0xb2c5('0x85')]['group']));}_0x51bd7c=_0x5c4f4a['clone']();_0x5c4f4a['limit'](_0x4148b5);_0x5c4f4a[_0xb2c5('0x1c')](0x0);return;}})['then'](function(){if(_0x5e7ab9[_0xb2c5('0x91')]==='web'){return null;}var _0x2ec915=_[_0xb2c5('0x3f')](_0x5e7ab9,{'name':_0x5e7ab9[_0xb2c5('0x92')]||_0x5e7ab9[_0xb2c5('0x32')]||_0x3bf846['name'],'basename':_0xe4ff7,'savename':util[_0xb2c5('0x83')]('%s-%s.%s',_0x5e7ab9[_0xb2c5('0x32')]||_0x3bf846[_0xb2c5('0x32')],require(_0xb2c5('0x93'))[_0xb2c5('0x94')](0x4),_0x5e7ab9[_0xb2c5('0x91')]||_0xb2c5('0x95')),'reportId':_0x3bf846['id'],'reportType':_0xb2c5('0x96')});return db[_0xb2c5('0x97')][_0xb2c5('0x48')](_0x2ec915,{'raw':!![]});})['then'](function(_0x53506a){if(_0x3bf846['table']==='cdr'){_0x51bd7c[_0xb2c5('0x3e')](_0x3bf846[_0xb2c5('0x76')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5e7ab9[_0xb2c5('0x98')],_0x5e7ab9[_0xb2c5('0x99')]);}else{_0x51bd7c[_0xb2c5('0x3e')](_0x3bf846[_0xb2c5('0x76')]+_0xb2c5('0x9a'),_0x5e7ab9['startDate'],_0x5e7ab9[_0xb2c5('0x99')]);}if(_0x53506a){logger['info'](_0xb2c5('0x9b'),_0x51bd7c[_0xb2c5('0x88')]());require(_0xb2c5('0x9c'))[_0xb2c5('0x9d')](path[_0xb2c5('0x55')](__dirname,_0xb2c5('0x9e'),_0x53506a[_0xb2c5('0x91')]),[_0x53506a['id'],_0x51bd7c[_0xb2c5('0x88')](),path[_0xb2c5('0x55')](__dirname,_0xb2c5('0x9f'),_0x53506a[_0xb2c5('0xa0')]),_0xe4ff7]);return _0x53506a;}else{var _0x27a963=squel[_0xb2c5('0x75')]();_0x27a963[_0xb2c5('0x90')]('('+_0x51bd7c[_0xb2c5('0x88')]()+')',_0xb2c5('0xa1'));_0x27a963['field']('COUNT(*)',_0xb2c5('0x1e'));_0x51bd7c[_0xb2c5('0x1f')](_0x5e7ab9[_0xb2c5('0x1f')]||_0x4148b5);_0x51bd7c[_0xb2c5('0x1c')](_0x5e7ab9[_0xb2c5('0x1c')]||0x0);return dbH['sequelize'][_0xb2c5('0x33')](_0x27a963['toString'](),{'type':dbH[_0xb2c5('0x89')]['QueryTypes'][_0xb2c5('0x8b')]})[_0xb2c5('0x24')](function(_0x48bb68){if(!_0x48bb68['length']){_0x433b29=0x0;}else{_0x433b29=_0x48bb68[0x0][_0xb2c5('0x1e')]||0x0;}return dbH[_0xb2c5('0x89')]['query'](_0x51bd7c[_0xb2c5('0x88')](),{'type':dbH[_0xb2c5('0x89')]['QueryTypes']['SELECT']});})['then'](function(_0x26f378){return{'rows':_0x26f378||[],'count':_0x433b29};});}});}exports[_0xb2c5('0xa2')]=function(_0x510532,_0x3fd535){return runReport(_0x510532['params'],_0x510532[_0xb2c5('0x33')],_0x510532[_0xb2c5('0x42')])['then'](respondWithResult(_0x3fd535,null))[_0xb2c5('0x44')](handleError(_0x3fd535,null));};exports[_0xb2c5('0xa3')]=runReport;exports[_0xb2c5('0x33')]=function(_0xef84f,_0x2ff106){var _0x1dab71=0xa;var _0x2fed42=['join',_0xb2c5('0x56'),_0xb2c5('0x57'),'cross_join'];var _0x1dddaa={'SUM':_0xb2c5('0x8c'),'COUNT':_0xb2c5('0x59'),'COUNT DISTINCT':_0xb2c5('0x5a'),'MAX':_0xb2c5('0x5b'),'MIN':_0xb2c5('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb2c5('0x5f'),'GROUP_CONCAT DESC':_0xb2c5('0x60')};var _0x5e15a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xb2c5('0x8d'),'ROUND':_0xb2c5('0x8e'),'UNIX_TIMESTAMP':_0xb2c5('0x63')};var _0x27ab96=function(_0x407329){return!_[_0xb2c5('0x64')](['IS\x20NULL',_0xb2c5('0x66'),'IS\x20EMPTY',_0xb2c5('0x8f')],_0x407329);};var _0xc00f66=function(_0x35449e){if(!_0x35449e||!_0x35449e[_0xb2c5('0x68')][_0xb2c5('0x39')]){return'';}for(var _0x350c99='(',_0x2f2847=0x0;_0x2f2847<_0x35449e[_0xb2c5('0x68')][_0xb2c5('0x39')];_0x2f2847+=0x1){_0x2f2847>0x0&&(_0x350c99+='\x20'+_0x35449e['operator']+'\x20');_0x350c99+=_0x35449e[_0xb2c5('0x68')][_0x2f2847][_0xb2c5('0x6a')]?_0xc00f66(_0x35449e[_0xb2c5('0x68')][_0x2f2847][_0xb2c5('0x6a')]):_0x35449e[_0xb2c5('0x68')][_0x2f2847][_0xb2c5('0x6b')]+'\x20'+_0x35449e['rules'][_0x2f2847][_0xb2c5('0x6c')]+(_0x27ab96(_0x35449e[_0xb2c5('0x68')][_0x2f2847][_0xb2c5('0x6c')])?'\x20'+_0x35449e['rules'][_0x2f2847]['value']:'');}return _0x350c99+')';};var _0x4a0592={'where':{'id':_0xef84f[_0xb2c5('0x52')]['id']}},_0x14f532,_0x3f9216,_0x455441,_0x47dec0,_0x3d306a;_0x4a0592=_[_0xb2c5('0x3f')]({},_0x4a0592,_0xef84f[_0xb2c5('0x42')]);return db[_0xb2c5('0x2d')][_0xb2c5('0x47')](_0x4a0592)[_0xb2c5('0x24')](function(_0x133da9){if(_0x133da9){_0x14f532=_0x133da9;return _0x133da9[_0xb2c5('0x6e')]();}return null;})['then'](function(_0x1a343f){if(_0x1a343f){if(!_0x1a343f['length']){throw new db[(_0xb2c5('0x6f'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3f9216=_0x1a343f;return db[_0xb2c5('0x72')]['findAll']({'raw':!![]});}return null;})[_0xb2c5('0x24')](function(_0x21c111){if(_0x21c111){_0x455441=_[_0xb2c5('0x74')](_0x21c111,'id');var _0x18b26d;var _0x1254dc=squel[_0xb2c5('0x75')]();_0x1254dc[_0xb2c5('0x90')](_0x14f532['table']);for(var _0x2beb91=0x0;_0x2beb91<_0x3f9216[_0xb2c5('0x39')];_0x2beb91+=0x1){_0x18b26d=_0x3f9216[_0x2beb91]['MetricId']?_0x455441[_0x3f9216[_0x2beb91][_0xb2c5('0x77')]]['metric']:_0x3f9216[_0x2beb91][_0xb2c5('0x6b')];_0x18b26d=_0x3f9216[_0x2beb91][_0xb2c5('0x79')]?_[_0xb2c5('0x7a')](_0x1dddaa[_0x3f9216[_0x2beb91][_0xb2c5('0x79')]],'%s',_0x18b26d):_0x18b26d;_0x18b26d=_0x3f9216[_0x2beb91][_0xb2c5('0x83')]?_[_0xb2c5('0x7a')](_0x5e15a1[_0x3f9216[_0x2beb91][_0xb2c5('0x83')]],'%s',_0x18b26d):_0x18b26d;if(_0x3f9216[_0x2beb91][_0xb2c5('0x7b')]){_0x1254dc[_0xb2c5('0x6a')](_0x18b26d);}_0x3f9216[_0x2beb91]['orderBy']&&_0x1254dc[_0xb2c5('0x3c')](_0x18b26d,_0x3f9216[_0x2beb91][_0xb2c5('0x7c')]===_0xb2c5('0x7d')?![]:!![]);_0x1254dc['field'](_0x18b26d,_0x3f9216[_0x2beb91][_0xb2c5('0x7e')]||_0x18b26d);}if(_0x14f532['joins']){_0x14f532[_0xb2c5('0x7f')]=JSON['parse'](_0x14f532[_0xb2c5('0x7f')]);for(var _0x2d4bcb=0x0;_0x2d4bcb<_0x14f532['joins'][_0xb2c5('0x39')];_0x2d4bcb+=0x1){if(_0x14f532[_0xb2c5('0x7f')][_0x2d4bcb]['type']&&_[_0xb2c5('0x64')](_0x2fed42,_0x14f532[_0xb2c5('0x7f')][_0x2d4bcb][_0xb2c5('0x40')])&&_0x14f532[_0xb2c5('0x7f')][_0x2d4bcb]['parentKey']&&_0x14f532[_0xb2c5('0x7f')][_0x2d4bcb][_0xb2c5('0x81')]&&_0x14f532['joins'][_0x2d4bcb][_0xb2c5('0x82')]){_0x1254dc[_0x14f532[_0xb2c5('0x7f')][_0x2d4bcb][_0xb2c5('0x40')]](_0x14f532[_0xb2c5('0x7f')][_0x2d4bcb][_0xb2c5('0x81')],null,util[_0xb2c5('0x83')](_0xb2c5('0x84'),_0x14f532[_0xb2c5('0x76')],_0x14f532[_0xb2c5('0x7f')][_0x2d4bcb][_0xb2c5('0x80')],_0x14f532[_0xb2c5('0x7f')][_0x2d4bcb]['foreignTable'],_0x14f532[_0xb2c5('0x7f')][_0x2d4bcb][_0xb2c5('0x82')]));}}}if(_0x14f532[_0xb2c5('0x85')]){_0x14f532['conditions']=JSON[_0xb2c5('0x86')](_0x14f532['conditions']);_0x1254dc[_0xb2c5('0x3e')](_0xc00f66(_0x14f532[_0xb2c5('0x85')][_0xb2c5('0x6a')]));}_0x3d306a=_0x1254dc['clone']();_0x1254dc[_0xb2c5('0x1f')](_0x1dab71);_0x1254dc[_0xb2c5('0x1c')](0x0);logger[_0xb2c5('0xa4')](_0xb2c5('0x87'),_0x1254dc[_0xb2c5('0x88')]());return dbH[_0xb2c5('0x89')][_0xb2c5('0x33')](_0x1254dc[_0xb2c5('0x88')](),{'type':dbH[_0xb2c5('0x89')][_0xb2c5('0x8a')][_0xb2c5('0x8b')]});}})[_0xb2c5('0x24')](function(){return{'sql':_0x3d306a[_0xb2c5('0x88')]()};})['then'](respondWithResult(_0x2ff106,null))[_0xb2c5('0x44')](handleError(_0x2ff106,null));}; \ No newline at end of file +var _0x5fcc=['cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','Content-Range','save','then','destroy','get','CustomReports','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','findAll','rows','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','includes','getFields','parse','%s-%s.%s','randomstring','output','csv','custom','AnalyticExtractedReport'];(function(_0x96a2cb,_0x51f751){var _0x4bccfa=function(_0x175691){while(--_0x175691){_0x96a2cb['push'](_0x96a2cb['shift']());}};_0x4bccfa(++_0x51f751);}(_0x5fcc,0x161));var _0xc5fc=function(_0x243394,_0x1437c1){_0x243394=_0x243394-0x0;var _0x3c2306=_0x5fcc[_0x243394];return _0x3c2306;};'use strict';var emlformat=require(_0xc5fc('0x0'));var rimraf=require(_0xc5fc('0x1'));var zipdir=require(_0xc5fc('0x2'));var jsonpatch=require(_0xc5fc('0x3'));var rp=require(_0xc5fc('0x4'));var moment=require('moment');var BPromise=require(_0xc5fc('0x5'));var Mustache=require(_0xc5fc('0x6'));var util=require('util');var path=require(_0xc5fc('0x7'));var sox=require(_0xc5fc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc5fc('0x9'));var _=require(_0xc5fc('0xa'));var squel=require(_0xc5fc('0xb'));var crypto=require('crypto');var jsforce=require(_0xc5fc('0xc'));var deskjs=require(_0xc5fc('0xd'));var toCsv=require(_0xc5fc('0xe'));var querystring=require('querystring');var Papa=require(_0xc5fc('0xf'));var Redis=require(_0xc5fc('0x10'));var authService=require(_0xc5fc('0x11'));var qs=require(_0xc5fc('0x12'));var as=require(_0xc5fc('0x13'));var hardwareService=require(_0xc5fc('0x14'));var logger=require(_0xc5fc('0x15'))(_0xc5fc('0x16'));var utils=require(_0xc5fc('0x17'));var config=require(_0xc5fc('0x18'));var licenseUtil=require(_0xc5fc('0x19'));var db=require('../../mysqldb')['db'];var dbH=require(_0xc5fc('0x1a'))[_0xc5fc('0x1b')];function respondWithStatusCode(_0x38236d,_0x13824c){_0x13824c=_0x13824c||0xcc;return function(_0x20e196){if(_0x20e196){return _0x38236d['sendStatus'](_0x13824c);}return _0x38236d[_0xc5fc('0x1c')](_0x13824c)[_0xc5fc('0x1d')]();};}function respondWithResult(_0x5a3cdd,_0x33eb26){_0x33eb26=_0x33eb26||0xc8;return function(_0x41a630){if(_0x41a630){return _0x5a3cdd['status'](_0x33eb26)[_0xc5fc('0x1e')](_0x41a630);}};}function respondWithFilteredResult(_0xef1f2e,_0x28d5f7){return function(_0xc996b8){if(_0xc996b8){var _0x5a2299=typeof _0x28d5f7[_0xc5fc('0x1f')]===_0xc5fc('0x20')&&typeof _0x28d5f7[_0xc5fc('0x21')]===_0xc5fc('0x20');var _0xe7b3f3=_0xc996b8[_0xc5fc('0x22')];var _0x1c58b3=_0x5a2299?0x0:_0x28d5f7[_0xc5fc('0x1f')];var _0x501b95=_0x5a2299?_0xc996b8[_0xc5fc('0x22')]:_0x28d5f7[_0xc5fc('0x1f')]+_0x28d5f7[_0xc5fc('0x21')];var _0x2db80d;if(_0x501b95>=_0xe7b3f3){_0x501b95=_0xe7b3f3;_0x2db80d=0xc8;}else{_0x2db80d=0xce;}_0xef1f2e[_0xc5fc('0x1c')](_0x2db80d);return _0xef1f2e['set'](_0xc5fc('0x23'),_0x1c58b3+'-'+_0x501b95+'/'+_0xe7b3f3)[_0xc5fc('0x1e')](_0xc996b8);}return null;};}function patchUpdates(_0x2d88ac){return function(_0x53007b){try{jsonpatch['apply'](_0x53007b,_0x2d88ac,!![]);}catch(_0x2bdbbc){return BPromise['reject'](_0x2bdbbc);}return _0x53007b[_0xc5fc('0x24')]();};}function saveUpdates(_0xd32eb1,_0x3d0147){return function(_0x4a26d1){if(_0x4a26d1){return _0x4a26d1['update'](_0xd32eb1)[_0xc5fc('0x25')](function(_0x20322e){return _0x20322e;});}return null;};}function removeEntity(_0x2b0e4b,_0x54bed1){return function(_0xb290ea){if(_0xb290ea){return _0xb290ea[_0xc5fc('0x26')]()[_0xc5fc('0x25')](function(){var _0x532b2d=_0xb290ea[_0xc5fc('0x27')]({'plain':!![]});var _0x11760e=_0xc5fc('0x28');return db['UserProfileResource'][_0xc5fc('0x26')]({'where':{'type':_0x11760e,'resourceId':_0x532b2d['id']}})['then'](function(){return _0xb290ea;});})[_0xc5fc('0x25')](function(){_0x2b0e4b[_0xc5fc('0x1c')](0xcc)[_0xc5fc('0x1d')]();});}};}function handleEntityNotFound(_0x254d4f,_0x1b7f9e){return function(_0x4bcd0c){if(!_0x4bcd0c){_0x254d4f[_0xc5fc('0x29')](0x194);}return _0x4bcd0c;};}function handleError(_0x31696b,_0x139284){_0x139284=_0x139284||0x1f4;return function(_0x2d373f){logger['error'](_0x2d373f[_0xc5fc('0x2a')]);if(_0x2d373f[_0xc5fc('0x2b')]){delete _0x2d373f[_0xc5fc('0x2b')];}_0x31696b[_0xc5fc('0x1c')](_0x139284)[_0xc5fc('0x2c')](_0x2d373f);};}exports[_0xc5fc('0x2d')]=function(_0x3e4f00,_0x3b4307){var _0x1770c1={},_0x41decb={},_0x48724f={'count':0x0,'rows':[]};var _0x43d6e3=_['map'](db['AnalyticCustomReport'][_0xc5fc('0x2e')],function(_0x22caa4){return{'name':_0x22caa4[_0xc5fc('0x2f')],'type':_0x22caa4[_0xc5fc('0x30')]['key']};});_0x41decb[_0xc5fc('0x31')]=_[_0xc5fc('0x32')](_0x43d6e3,'name');_0x41decb[_0xc5fc('0x33')]=_[_0xc5fc('0x34')](_0x3e4f00[_0xc5fc('0x33')]);_0x41decb[_0xc5fc('0x35')]=_[_0xc5fc('0x36')](_0x41decb[_0xc5fc('0x31')],_0x41decb['query']);_0x1770c1[_0xc5fc('0x37')]=_[_0xc5fc('0x36')](_0x41decb['model'],qs[_0xc5fc('0x38')](_0x3e4f00[_0xc5fc('0x33')][_0xc5fc('0x38')]));_0x1770c1[_0xc5fc('0x37')]=_0x1770c1[_0xc5fc('0x37')][_0xc5fc('0x39')]?_0x1770c1[_0xc5fc('0x37')]:_0x41decb[_0xc5fc('0x31')];if(!_0x3e4f00[_0xc5fc('0x33')][_0xc5fc('0x3a')](_0xc5fc('0x3b'))){_0x1770c1['limit']=qs['limit'](_0x3e4f00[_0xc5fc('0x33')][_0xc5fc('0x21')]);_0x1770c1['offset']=qs['offset'](_0x3e4f00[_0xc5fc('0x33')][_0xc5fc('0x1f')]);}_0x1770c1[_0xc5fc('0x3c')]=qs['sort'](_0x3e4f00['query']['sort']);_0x1770c1[_0xc5fc('0x3d')]=qs[_0xc5fc('0x35')](_[_0xc5fc('0x3e')](_0x3e4f00[_0xc5fc('0x33')],_0x41decb[_0xc5fc('0x35')]),_0x43d6e3);if(_0x3e4f00[_0xc5fc('0x33')][_0xc5fc('0x3f')]){_0x1770c1[_0xc5fc('0x3d')]=_[_0xc5fc('0x40')](_0x1770c1[_0xc5fc('0x3d')],{'$or':_[_0xc5fc('0x32')](_0x43d6e3,function(_0xaedd30){if(_0xaedd30['type']!==_0xc5fc('0x41')){var _0x52bf37={};_0x52bf37[_0xaedd30[_0xc5fc('0x2b')]]={'$like':'%'+_0x3e4f00[_0xc5fc('0x33')][_0xc5fc('0x3f')]+'%'};return _0x52bf37;}})});}_0x1770c1=_[_0xc5fc('0x40')]({},_0x1770c1,_0x3e4f00[_0xc5fc('0x42')]);var _0x5235fd={'where':_0x1770c1[_0xc5fc('0x3d')]};return db[_0xc5fc('0x43')][_0xc5fc('0x22')](_0x5235fd)['then'](function(_0x2a2b08){_0x48724f[_0xc5fc('0x22')]=_0x2a2b08;if(_0x3e4f00[_0xc5fc('0x33')][_0xc5fc('0x44')]){_0x1770c1['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xc5fc('0x45')](_0x1770c1);})[_0xc5fc('0x25')](function(_0x387fd7){_0x48724f[_0xc5fc('0x46')]=_0x387fd7;return _0x48724f;})[_0xc5fc('0x25')](respondWithFilteredResult(_0x3b4307,_0x1770c1))[_0xc5fc('0x47')](handleError(_0x3b4307,null));};exports['show']=function(_0x22771d,_0x3b757b){var _0x1d3230={'raw':![],'where':{'id':_0x22771d[_0xc5fc('0x48')]['id']}},_0x2fd2bc={};_0x2fd2bc['model']=_[_0xc5fc('0x34')](db[_0xc5fc('0x43')][_0xc5fc('0x2e')]);_0x2fd2bc[_0xc5fc('0x33')]=_[_0xc5fc('0x34')](_0x22771d[_0xc5fc('0x33')]);_0x2fd2bc[_0xc5fc('0x35')]=_[_0xc5fc('0x36')](_0x2fd2bc[_0xc5fc('0x31')],_0x2fd2bc[_0xc5fc('0x33')]);_0x1d3230[_0xc5fc('0x37')]=_['intersection'](_0x2fd2bc[_0xc5fc('0x31')],qs[_0xc5fc('0x38')](_0x22771d[_0xc5fc('0x33')]['fields']));_0x1d3230[_0xc5fc('0x37')]=_0x1d3230[_0xc5fc('0x37')][_0xc5fc('0x39')]?_0x1d3230[_0xc5fc('0x37')]:_0x2fd2bc[_0xc5fc('0x31')];if(_0x22771d[_0xc5fc('0x33')]['includeAll']){_0x1d3230[_0xc5fc('0x49')]=[{'all':!![]}];}_0x1d3230=_[_0xc5fc('0x40')]({},_0x1d3230,_0x22771d['options']);return db['AnalyticCustomReport'][_0xc5fc('0x4a')](_0x1d3230)[_0xc5fc('0x25')](handleEntityNotFound(_0x3b757b,null))[_0xc5fc('0x25')](respondWithResult(_0x3b757b,null))[_0xc5fc('0x47')](handleError(_0x3b757b,null));};exports[_0xc5fc('0x4b')]=function(_0x2134dd,_0x116dd5){return db[_0xc5fc('0x43')][_0xc5fc('0x4b')](_0x2134dd[_0xc5fc('0x4c')],{})[_0xc5fc('0x25')](function(_0x5a30d0){var _0x5a6b62=_0x2134dd[_0xc5fc('0x4d')][_0xc5fc('0x27')]({'plain':!![]});if(!_0x5a6b62)throw new Error(_0xc5fc('0x4e'));if(_0x5a6b62[_0xc5fc('0x4f')]===_0xc5fc('0x4d')){var _0x5ef055=_0x5a30d0[_0xc5fc('0x27')]({'plain':!![]});var _0x5e2613=_0xc5fc('0x50');return db[_0xc5fc('0x51')][_0xc5fc('0x4a')]({'where':{'name':_0x5e2613,'userProfileId':_0x5a6b62[_0xc5fc('0x52')]},'raw':!![]})['then'](function(_0x2f87ba){if(_0x2f87ba&&_0x2f87ba['autoAssociation']===0x0){return db['UserProfileResource'][_0xc5fc('0x4b')]({'name':_0x5ef055[_0xc5fc('0x2b')],'resourceId':_0x5ef055['id'],'type':_0xc5fc('0x28'),'sectionId':_0x2f87ba['id']},{})[_0xc5fc('0x25')](function(){return _0x5a30d0;});}else{return _0x5a30d0;}})['catch'](function(_0x46b533){logger['error'](_0xc5fc('0x53'),_0x46b533);throw _0x46b533;});}return _0x5a30d0;})['then'](respondWithResult(_0x116dd5,0xc9))[_0xc5fc('0x47')](handleError(_0x116dd5,null));};exports[_0xc5fc('0x54')]=function(_0x3834a0,_0x6d0793){if(_0x3834a0['body']['id']){delete _0x3834a0[_0xc5fc('0x4c')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x3834a0[_0xc5fc('0x48')]['id']}})[_0xc5fc('0x25')](handleEntityNotFound(_0x6d0793,null))[_0xc5fc('0x25')](saveUpdates(_0x3834a0[_0xc5fc('0x4c')],null))['then'](respondWithResult(_0x6d0793,null))['catch'](handleError(_0x6d0793,null));};exports[_0xc5fc('0x26')]=function(_0x3fa26c,_0x51df8d){return db[_0xc5fc('0x43')][_0xc5fc('0x4a')]({'where':{'id':_0x3fa26c['params']['id']}})[_0xc5fc('0x25')](handleEntityNotFound(_0x51df8d,null))[_0xc5fc('0x25')](removeEntity(_0x51df8d,null))['catch'](handleError(_0x51df8d,null));};exports[_0xc5fc('0x55')]=function(_0x4ba291,_0x567f0a){var _0x4a7891=0xa;var _0x3b3896=[_0xc5fc('0x56'),_0xc5fc('0x57'),_0xc5fc('0x58'),_0xc5fc('0x59')];var _0x11a127={'SUM':_0xc5fc('0x5a'),'COUNT':_0xc5fc('0x5b'),'COUNT DISTINCT':_0xc5fc('0x5c'),'MAX':_0xc5fc('0x5d'),'MIN':_0xc5fc('0x5e'),'AVG':_0xc5fc('0x5f'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc5fc('0x60')};var _0x5a8bb8={'SEC_TO_TIME':_0xc5fc('0x61'),'DATE':_0xc5fc('0x62'),'HOUR':'HOUR(%s)','ROUND':_0xc5fc('0x63'),'UNIX_TIMESTAMP':_0xc5fc('0x64')};var _0x53f654=function(_0x1500c5){return!_['includes']([_0xc5fc('0x65'),_0xc5fc('0x66'),_0xc5fc('0x67'),_0xc5fc('0x68')],_0x1500c5);};var _0x2f5fe7=function(_0x300ee6){if(!_0x300ee6||!_0x300ee6[_0xc5fc('0x69')][_0xc5fc('0x39')]){return'';}for(var _0x5e9903='(',_0x135e08=0x0;_0x135e08<_0x300ee6[_0xc5fc('0x69')]['length'];_0x135e08+=0x1){_0x135e08>0x0&&(_0x5e9903+='\x20'+_0x300ee6[_0xc5fc('0x6a')]+'\x20');_0x5e9903+=_0x300ee6[_0xc5fc('0x69')][_0x135e08][_0xc5fc('0x6b')]?_0x2f5fe7(_0x300ee6[_0xc5fc('0x69')][_0x135e08][_0xc5fc('0x6b')]):_0x300ee6['rules'][_0x135e08][_0xc5fc('0x6c')]+'\x20'+_0x300ee6[_0xc5fc('0x69')][_0x135e08]['condition']+(_0x53f654(_0x300ee6[_0xc5fc('0x69')][_0x135e08][_0xc5fc('0x6d')])?'\x20'+_0x300ee6['rules'][_0x135e08][_0xc5fc('0x6e')]:'');}return _0x5e9903+')';};var _0x1884c6={'where':{'id':_0x4ba291[_0xc5fc('0x48')]['id']}},_0x460d85,_0x2aeaed,_0x21404e,_0x38fa5c,_0x30a81f;_0x1884c6=_[_0xc5fc('0x40')]({},_0x1884c6,_0x4ba291[_0xc5fc('0x42')]);return db['AnalyticCustomReport'][_0xc5fc('0x4a')](_0x1884c6)[_0xc5fc('0x25')](function(_0x2544fa){if(_0x2544fa){_0x460d85=_0x2544fa;return _0x2544fa['getFields']();}return null;})[_0xc5fc('0x25')](function(_0x2c396b){if(_0x2c396b){if(!_0x2c396b[_0xc5fc('0x39')]){throw new db[(_0xc5fc('0x6f'))][(_0xc5fc('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2aeaed=_0x2c396b;return db[_0xc5fc('0x71')][_0xc5fc('0x45')]({'raw':!![]});}return null;})['then'](function(_0x498a1e){if(_0x498a1e){_0x21404e=_[_0xc5fc('0x72')](_0x498a1e,'id');var _0x2461ff;var _0x128afe=squel[_0xc5fc('0x73')]();_0x128afe[_0xc5fc('0x74')](_0x460d85[_0xc5fc('0x75')]);for(var _0x28dd79=0x0;_0x28dd79<_0x2aeaed[_0xc5fc('0x39')];_0x28dd79+=0x1){_0x2461ff=_0x2aeaed[_0x28dd79][_0xc5fc('0x76')]?_0x21404e[_0x2aeaed[_0x28dd79]['MetricId']][_0xc5fc('0x77')]:_0x2aeaed[_0x28dd79]['field'];_0x2461ff=_0x2aeaed[_0x28dd79][_0xc5fc('0x78')]?_['replace'](_0x11a127[_0x2aeaed[_0x28dd79][_0xc5fc('0x78')]],'%s',_0x2461ff):_0x2461ff;_0x2461ff=_0x2aeaed[_0x28dd79][_0xc5fc('0x79')]?_[_0xc5fc('0x7a')](_0x5a8bb8[_0x2aeaed[_0x28dd79]['format']],'%s',_0x2461ff):_0x2461ff;if(_0x2aeaed[_0x28dd79][_0xc5fc('0x7b')]){_0x128afe[_0xc5fc('0x6b')](_0x2461ff);}_0x2aeaed[_0x28dd79]['orderBy']&&_0x128afe[_0xc5fc('0x3c')](_0x2461ff,_0x2aeaed[_0x28dd79][_0xc5fc('0x7c')]===_0xc5fc('0x7d')?![]:!![]);_0x128afe[_0xc5fc('0x6c')](_0x2461ff,_0x2aeaed[_0x28dd79][_0xc5fc('0x7e')]||_0x2461ff);}if(_0x460d85[_0xc5fc('0x7f')]){_0x460d85['joins']=JSON['parse'](_0x460d85[_0xc5fc('0x7f')]);for(var _0x2bdc48=0x0;_0x2bdc48<_0x460d85[_0xc5fc('0x7f')]['length'];_0x2bdc48+=0x1){if(_0x460d85[_0xc5fc('0x7f')][_0x2bdc48]['type']&&_['includes'](_0x3b3896,_0x460d85[_0xc5fc('0x7f')][_0x2bdc48][_0xc5fc('0x30')])&&_0x460d85[_0xc5fc('0x7f')][_0x2bdc48][_0xc5fc('0x80')]&&_0x460d85[_0xc5fc('0x7f')][_0x2bdc48][_0xc5fc('0x81')]&&_0x460d85['joins'][_0x2bdc48][_0xc5fc('0x82')]){_0x128afe[_0x460d85['joins'][_0x2bdc48][_0xc5fc('0x30')]](_0x460d85[_0xc5fc('0x7f')][_0x2bdc48][_0xc5fc('0x81')],null,util[_0xc5fc('0x79')](_0xc5fc('0x83'),_0x460d85[_0xc5fc('0x75')],_0x460d85[_0xc5fc('0x7f')][_0x2bdc48][_0xc5fc('0x80')],_0x460d85['joins'][_0x2bdc48][_0xc5fc('0x81')],_0x460d85['joins'][_0x2bdc48][_0xc5fc('0x82')]));}}}if(_0x460d85[_0xc5fc('0x84')]){_0x460d85[_0xc5fc('0x84')]=JSON['parse'](_0x460d85[_0xc5fc('0x84')]);_0x128afe[_0xc5fc('0x3d')](_0x2f5fe7(_0x460d85[_0xc5fc('0x84')][_0xc5fc('0x6b')]));}_0x30a81f=_0x128afe[_0xc5fc('0x85')]();_0x128afe[_0xc5fc('0x21')](_0x4a7891);_0x128afe['offset'](0x0);logger[_0xc5fc('0x86')](_0xc5fc('0x87'),_0x128afe[_0xc5fc('0x88')]());return dbH[_0xc5fc('0x89')][_0xc5fc('0x33')](_0x128afe[_0xc5fc('0x88')](),{'type':dbH[_0xc5fc('0x89')][_0xc5fc('0x8a')]['SELECT']});}})[_0xc5fc('0x25')](respondWithResult(_0x567f0a,null))[_0xc5fc('0x47')](handleError(_0x567f0a,null));};function runReport(_0x1105b8,_0x4458a7,_0x3e8f0c){var _0x13976f=_0x4458a7[_0xc5fc('0x2b')];var _0x10b251=0xa;var _0x14d244=[_0xc5fc('0x56'),_0xc5fc('0x57'),'right_join',_0xc5fc('0x59')];var _0x24312f={'SUM':_0xc5fc('0x5a'),'COUNT':_0xc5fc('0x5b'),'COUNT DISTINCT':_0xc5fc('0x5c'),'MAX':_0xc5fc('0x5d'),'MIN':_0xc5fc('0x5e'),'AVG':_0xc5fc('0x5f'),'GROUP_CONCAT':_0xc5fc('0x8b'),'GROUP_CONCAT ASC':_0xc5fc('0x8c'),'GROUP_CONCAT DESC':_0xc5fc('0x60')};var _0x2311a8={'SEC_TO_TIME':_0xc5fc('0x61'),'DATE':_0xc5fc('0x62'),'HOUR':_0xc5fc('0x8d'),'ROUND':_0xc5fc('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3a46df=function(_0x445fee){return!_[_0xc5fc('0x8e')]([_0xc5fc('0x65'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xc5fc('0x68')],_0x445fee);};var _0x4c9f7d=function(_0x2f5e5c){if(!_0x2f5e5c||!_0x2f5e5c[_0xc5fc('0x69')][_0xc5fc('0x39')]){return'';}for(var _0x56fa49='(',_0x1d0a6b=0x0;_0x1d0a6b<_0x2f5e5c[_0xc5fc('0x69')][_0xc5fc('0x39')];_0x1d0a6b+=0x1){_0x1d0a6b>0x0&&(_0x56fa49+='\x20'+_0x2f5e5c['operator']+'\x20');_0x56fa49+=_0x2f5e5c[_0xc5fc('0x69')][_0x1d0a6b]['group']?_0x4c9f7d(_0x2f5e5c['rules'][_0x1d0a6b][_0xc5fc('0x6b')]):_0x2f5e5c[_0xc5fc('0x69')][_0x1d0a6b][_0xc5fc('0x6c')]+'\x20'+_0x2f5e5c[_0xc5fc('0x69')][_0x1d0a6b][_0xc5fc('0x6d')]+(_0x3a46df(_0x2f5e5c[_0xc5fc('0x69')][_0x1d0a6b][_0xc5fc('0x6d')])?'\x20'+_0x2f5e5c[_0xc5fc('0x69')][_0x1d0a6b][_0xc5fc('0x6e')]:'');}return _0x56fa49+')';};var _0x450b91={'where':{'id':_0x1105b8['id']}},_0x2204e5,_0xda0547,_0x279de0,_0x165808,_0x5ed3ef;_0x450b91=_['merge']({},_0x450b91,_0x3e8f0c);return db['AnalyticCustomReport'][_0xc5fc('0x4a')](_0x450b91)[_0xc5fc('0x25')](function(_0x2189ff){if(_0x2189ff){_0x2204e5=_0x2189ff;return _0x2189ff[_0xc5fc('0x8f')]();}return null;})[_0xc5fc('0x25')](function(_0xa74c4f){if(_0xa74c4f){if(!_0xa74c4f[_0xc5fc('0x39')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xda0547=_0xa74c4f;return db[_0xc5fc('0x71')][_0xc5fc('0x45')]({'raw':!![]});}return null;})[_0xc5fc('0x25')](function(_0x1cca90){if(_0x1cca90){_0x279de0=_[_0xc5fc('0x72')](_0x1cca90,'id');var _0x48b7cd;var _0x497ef1=squel[_0xc5fc('0x73')]();_0x497ef1[_0xc5fc('0x74')](_0x2204e5[_0xc5fc('0x75')]);for(var _0x4aa7de=0x0;_0x4aa7de<_0xda0547['length'];_0x4aa7de+=0x1){_0x48b7cd=_0xda0547[_0x4aa7de]['MetricId']?_0x279de0[_0xda0547[_0x4aa7de]['MetricId']][_0xc5fc('0x77')]:_0xda0547[_0x4aa7de][_0xc5fc('0x6c')];_0x48b7cd=_0xda0547[_0x4aa7de][_0xc5fc('0x78')]?_['replace'](_0x24312f[_0xda0547[_0x4aa7de][_0xc5fc('0x78')]],'%s',_0x48b7cd):_0x48b7cd;_0x48b7cd=_0xda0547[_0x4aa7de]['format']?_[_0xc5fc('0x7a')](_0x2311a8[_0xda0547[_0x4aa7de][_0xc5fc('0x79')]],'%s',_0x48b7cd):_0x48b7cd;if(_0xda0547[_0x4aa7de]['groupBy']){_0x497ef1[_0xc5fc('0x6b')](_0x48b7cd);}_0xda0547[_0x4aa7de]['orderBy']&&_0x497ef1['order'](_0x48b7cd,_0xda0547[_0x4aa7de][_0xc5fc('0x7c')]===_0xc5fc('0x7d')?![]:!![]);_0x497ef1[_0xc5fc('0x6c')](_0x48b7cd,_0xda0547[_0x4aa7de][_0xc5fc('0x7e')]||_0x48b7cd);}if(_0x2204e5[_0xc5fc('0x7f')]){_0x2204e5[_0xc5fc('0x7f')]=JSON[_0xc5fc('0x90')](_0x2204e5[_0xc5fc('0x7f')]);for(var _0x40ccbf=0x0;_0x40ccbf<_0x2204e5[_0xc5fc('0x7f')][_0xc5fc('0x39')];_0x40ccbf+=0x1){if(_0x2204e5[_0xc5fc('0x7f')][_0x40ccbf]['type']&&_[_0xc5fc('0x8e')](_0x14d244,_0x2204e5[_0xc5fc('0x7f')][_0x40ccbf]['type'])&&_0x2204e5[_0xc5fc('0x7f')][_0x40ccbf]['parentKey']&&_0x2204e5[_0xc5fc('0x7f')][_0x40ccbf][_0xc5fc('0x81')]&&_0x2204e5['joins'][_0x40ccbf]['foreignKey']){_0x497ef1[_0x2204e5[_0xc5fc('0x7f')][_0x40ccbf][_0xc5fc('0x30')]](_0x2204e5[_0xc5fc('0x7f')][_0x40ccbf]['foreignTable'],null,util[_0xc5fc('0x79')](_0xc5fc('0x83'),_0x2204e5[_0xc5fc('0x75')],_0x2204e5['joins'][_0x40ccbf][_0xc5fc('0x80')],_0x2204e5[_0xc5fc('0x7f')][_0x40ccbf][_0xc5fc('0x81')],_0x2204e5['joins'][_0x40ccbf]['foreignKey']));}}}if(_0x2204e5[_0xc5fc('0x84')]){_0x2204e5[_0xc5fc('0x84')]=JSON['parse'](_0x2204e5[_0xc5fc('0x84')]);_0x497ef1['where'](_0x4c9f7d(_0x2204e5[_0xc5fc('0x84')]['group']));}_0x5ed3ef=_0x497ef1['clone']();_0x497ef1[_0xc5fc('0x21')](_0x10b251);_0x497ef1[_0xc5fc('0x1f')](0x0);return;}})[_0xc5fc('0x25')](function(){if(_0x4458a7['output']==='web'){return null;}var _0x52fa6b=_[_0xc5fc('0x40')](_0x4458a7,{'name':_0x4458a7['fullPath']||_0x4458a7['name']||_0x2204e5[_0xc5fc('0x2b')],'basename':_0x13976f,'savename':util['format'](_0xc5fc('0x91'),_0x4458a7['name']||_0x2204e5[_0xc5fc('0x2b')],require(_0xc5fc('0x92'))['generate'](0x4),_0x4458a7[_0xc5fc('0x93')]||_0xc5fc('0x94')),'reportId':_0x2204e5['id'],'reportType':_0xc5fc('0x95')});return db[_0xc5fc('0x96')][_0xc5fc('0x4b')](_0x52fa6b,{'raw':!![]});})[_0xc5fc('0x25')](function(_0x1975b7){if(_0x2204e5[_0xc5fc('0x75')]===_0xc5fc('0x97')){_0x5ed3ef[_0xc5fc('0x3d')](_0x2204e5[_0xc5fc('0x75')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4458a7[_0xc5fc('0x98')],_0x4458a7[_0xc5fc('0x99')]);}else{_0x5ed3ef[_0xc5fc('0x3d')](_0x2204e5['table']+_0xc5fc('0x9a'),_0x4458a7[_0xc5fc('0x98')],_0x4458a7[_0xc5fc('0x99')]);}if(_0x1975b7){logger[_0xc5fc('0x9b')](_0xc5fc('0x9c'),_0x5ed3ef[_0xc5fc('0x88')]());require(_0xc5fc('0x9d'))[_0xc5fc('0x9e')](path[_0xc5fc('0x56')](__dirname,_0xc5fc('0x9f'),_0x1975b7['output']),[_0x1975b7['id'],_0x5ed3ef[_0xc5fc('0x88')](),path[_0xc5fc('0x56')](__dirname,_0xc5fc('0xa0'),_0x1975b7[_0xc5fc('0xa1')]),_0x13976f]);return _0x1975b7;}else{var _0x1971b5=squel[_0xc5fc('0x73')]();_0x1971b5[_0xc5fc('0x74')]('('+_0x5ed3ef[_0xc5fc('0x88')]()+')',_0xc5fc('0xa2'));_0x1971b5['field'](_0xc5fc('0xa3'),_0xc5fc('0x22'));_0x5ed3ef['limit'](_0x4458a7['limit']||_0x10b251);_0x5ed3ef['offset'](_0x4458a7['offset']||0x0);return dbH[_0xc5fc('0x89')][_0xc5fc('0x33')](_0x1971b5[_0xc5fc('0x88')](),{'type':dbH[_0xc5fc('0x89')][_0xc5fc('0x8a')][_0xc5fc('0xa4')]})[_0xc5fc('0x25')](function(_0x1094ab){if(!_0x1094ab['length']){_0x165808=0x0;}else{_0x165808=_0x1094ab[0x0][_0xc5fc('0x22')]||0x0;}return dbH['sequelize'][_0xc5fc('0x33')](_0x5ed3ef[_0xc5fc('0x88')](),{'type':dbH[_0xc5fc('0x89')][_0xc5fc('0x8a')][_0xc5fc('0xa4')]});})[_0xc5fc('0x25')](function(_0x4add6b){return{'rows':_0x4add6b||[],'count':_0x165808};});}});}exports[_0xc5fc('0xa5')]=function(_0x3e350b,_0x38f4f0){return runReport(_0x3e350b[_0xc5fc('0x48')],_0x3e350b[_0xc5fc('0x33')],_0x3e350b[_0xc5fc('0x42')])[_0xc5fc('0x25')](respondWithResult(_0x38f4f0,null))['catch'](handleError(_0x38f4f0,null));};exports[_0xc5fc('0xa6')]=runReport;exports['query']=function(_0x309bfc,_0x5b05b4){var _0x32475d=0xa;var _0x26a667=[_0xc5fc('0x56'),_0xc5fc('0x57'),'right_join',_0xc5fc('0x59')];var _0x22e4d2={'SUM':_0xc5fc('0x5a'),'COUNT':_0xc5fc('0x5b'),'COUNT DISTINCT':_0xc5fc('0x5c'),'MAX':'MAX(%s)','MIN':_0xc5fc('0x5e'),'AVG':_0xc5fc('0x5f'),'GROUP_CONCAT':_0xc5fc('0x8b'),'GROUP_CONCAT ASC':_0xc5fc('0x8c'),'GROUP_CONCAT DESC':_0xc5fc('0x60')};var _0x581567={'SEC_TO_TIME':_0xc5fc('0x61'),'DATE':_0xc5fc('0x62'),'HOUR':_0xc5fc('0x8d'),'ROUND':_0xc5fc('0x63'),'UNIX_TIMESTAMP':_0xc5fc('0x64')};var _0x5cae48=function(_0x2796b2){return!_[_0xc5fc('0x8e')]([_0xc5fc('0x65'),'IS\x20NOT\x20NULL',_0xc5fc('0x67'),_0xc5fc('0x68')],_0x2796b2);};var _0x5f3781=function(_0x57cd02){if(!_0x57cd02||!_0x57cd02[_0xc5fc('0x69')]['length']){return'';}for(var _0x1682e0='(',_0x10045c=0x0;_0x10045c<_0x57cd02['rules']['length'];_0x10045c+=0x1){_0x10045c>0x0&&(_0x1682e0+='\x20'+_0x57cd02['operator']+'\x20');_0x1682e0+=_0x57cd02[_0xc5fc('0x69')][_0x10045c][_0xc5fc('0x6b')]?_0x5f3781(_0x57cd02[_0xc5fc('0x69')][_0x10045c][_0xc5fc('0x6b')]):_0x57cd02['rules'][_0x10045c][_0xc5fc('0x6c')]+'\x20'+_0x57cd02[_0xc5fc('0x69')][_0x10045c][_0xc5fc('0x6d')]+(_0x5cae48(_0x57cd02[_0xc5fc('0x69')][_0x10045c][_0xc5fc('0x6d')])?'\x20'+_0x57cd02['rules'][_0x10045c][_0xc5fc('0x6e')]:'');}return _0x1682e0+')';};var _0x1a88b8={'where':{'id':_0x309bfc[_0xc5fc('0x48')]['id']}},_0x26996d,_0x1a1f81,_0x2f094d,_0x267c1b,_0x43dc1e;_0x1a88b8=_['merge']({},_0x1a88b8,_0x309bfc['options']);return db['AnalyticCustomReport']['find'](_0x1a88b8)[_0xc5fc('0x25')](function(_0x402dbd){if(_0x402dbd){_0x26996d=_0x402dbd;return _0x402dbd['getFields']();}return null;})['then'](function(_0x2f3942){if(_0x2f3942){if(!_0x2f3942[_0xc5fc('0x39')]){throw new db[(_0xc5fc('0x6f'))][(_0xc5fc('0x70'))](_0xc5fc('0xa7'),0x193);}_0x1a1f81=_0x2f3942;return db[_0xc5fc('0x71')][_0xc5fc('0x45')]({'raw':!![]});}return null;})[_0xc5fc('0x25')](function(_0x39580c){if(_0x39580c){_0x2f094d=_['keyBy'](_0x39580c,'id');var _0x40230e;var _0x805882=squel[_0xc5fc('0x73')]();_0x805882[_0xc5fc('0x74')](_0x26996d['table']);for(var _0x4f87f5=0x0;_0x4f87f5<_0x1a1f81['length'];_0x4f87f5+=0x1){_0x40230e=_0x1a1f81[_0x4f87f5][_0xc5fc('0x76')]?_0x2f094d[_0x1a1f81[_0x4f87f5][_0xc5fc('0x76')]][_0xc5fc('0x77')]:_0x1a1f81[_0x4f87f5][_0xc5fc('0x6c')];_0x40230e=_0x1a1f81[_0x4f87f5][_0xc5fc('0x78')]?_[_0xc5fc('0x7a')](_0x22e4d2[_0x1a1f81[_0x4f87f5][_0xc5fc('0x78')]],'%s',_0x40230e):_0x40230e;_0x40230e=_0x1a1f81[_0x4f87f5]['format']?_[_0xc5fc('0x7a')](_0x581567[_0x1a1f81[_0x4f87f5]['format']],'%s',_0x40230e):_0x40230e;if(_0x1a1f81[_0x4f87f5][_0xc5fc('0x7b')]){_0x805882[_0xc5fc('0x6b')](_0x40230e);}_0x1a1f81[_0x4f87f5][_0xc5fc('0x7c')]&&_0x805882[_0xc5fc('0x3c')](_0x40230e,_0x1a1f81[_0x4f87f5][_0xc5fc('0x7c')]==='DESC'?![]:!![]);_0x805882['field'](_0x40230e,_0x1a1f81[_0x4f87f5][_0xc5fc('0x7e')]||_0x40230e);}if(_0x26996d[_0xc5fc('0x7f')]){_0x26996d['joins']=JSON[_0xc5fc('0x90')](_0x26996d[_0xc5fc('0x7f')]);for(var _0x407708=0x0;_0x407708<_0x26996d['joins'][_0xc5fc('0x39')];_0x407708+=0x1){if(_0x26996d[_0xc5fc('0x7f')][_0x407708][_0xc5fc('0x30')]&&_['includes'](_0x26a667,_0x26996d[_0xc5fc('0x7f')][_0x407708][_0xc5fc('0x30')])&&_0x26996d[_0xc5fc('0x7f')][_0x407708]['parentKey']&&_0x26996d[_0xc5fc('0x7f')][_0x407708][_0xc5fc('0x81')]&&_0x26996d['joins'][_0x407708][_0xc5fc('0x82')]){_0x805882[_0x26996d[_0xc5fc('0x7f')][_0x407708]['type']](_0x26996d['joins'][_0x407708][_0xc5fc('0x81')],null,util[_0xc5fc('0x79')](_0xc5fc('0x83'),_0x26996d['table'],_0x26996d[_0xc5fc('0x7f')][_0x407708][_0xc5fc('0x80')],_0x26996d['joins'][_0x407708]['foreignTable'],_0x26996d[_0xc5fc('0x7f')][_0x407708][_0xc5fc('0x82')]));}}}if(_0x26996d[_0xc5fc('0x84')]){_0x26996d['conditions']=JSON[_0xc5fc('0x90')](_0x26996d[_0xc5fc('0x84')]);_0x805882[_0xc5fc('0x3d')](_0x5f3781(_0x26996d['conditions'][_0xc5fc('0x6b')]));}_0x43dc1e=_0x805882[_0xc5fc('0x85')]();_0x805882[_0xc5fc('0x21')](_0x32475d);_0x805882['offset'](0x0);logger[_0xc5fc('0x86')]('Limited\x20Query:',_0x805882[_0xc5fc('0x88')]());return dbH[_0xc5fc('0x89')][_0xc5fc('0x33')](_0x805882[_0xc5fc('0x88')](),{'type':dbH[_0xc5fc('0x89')]['QueryTypes'][_0xc5fc('0xa4')]});}})[_0xc5fc('0x25')](function(){return{'sql':_0x43dc1e[_0xc5fc('0x88')]()};})[_0xc5fc('0x25')](respondWithResult(_0x5b05b4,null))[_0xc5fc('0x47')](handleError(_0x5b05b4,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 32fb7ea..533be9c 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 _0x7f6c=['rimraf','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x457d6e,_0x43301e){var _0x458c12=function(_0x4214ee){while(--_0x4214ee){_0x457d6e['push'](_0x457d6e['shift']());}};_0x458c12(++_0x43301e);}(_0x7f6c,0x19d));var _0xc7f6=function(_0x5c2fb5,_0x198761){_0x5c2fb5=_0x5c2fb5-0x0;var _0x307b61=_0x7f6c[_0x5c2fb5];return _0x307b61;};'use strict';var _=require(_0xc7f6('0x0'));var util=require(_0xc7f6('0x1'));var logger=require(_0xc7f6('0x2'))('api');var moment=require(_0xc7f6('0x3'));var BPromise=require(_0xc7f6('0x4'));var rp=require(_0xc7f6('0x5'));var fs=require('fs');var path=require(_0xc7f6('0x6'));var rimraf=require(_0xc7f6('0x7'));var config=require('../../config/environment');var attributes=require(_0xc7f6('0x8'));module[_0xc7f6('0x9')]=function(_0x1bb4fb,_0x31e753){return _0x1bb4fb['define'](_0xc7f6('0xa'),attributes,{'tableName':_0xc7f6('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42a8=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','lodash','util'];(function(_0x383f90,_0x42edf5){var _0x101752=function(_0x2669c9){while(--_0x2669c9){_0x383f90['push'](_0x383f90['shift']());}};_0x101752(++_0x42edf5);}(_0x42a8,0x18a));var _0x842a=function(_0x434849,_0x27a13a){_0x434849=_0x434849-0x0;var _0x265681=_0x42a8[_0x434849];return _0x265681;};'use strict';var _=require(_0x842a('0x0'));var util=require(_0x842a('0x1'));var logger=require(_0x842a('0x2'))(_0x842a('0x3'));var moment=require(_0x842a('0x4'));var BPromise=require('bluebird');var rp=require(_0x842a('0x5'));var fs=require('fs');var path=require(_0x842a('0x6'));var rimraf=require(_0x842a('0x7'));var config=require(_0x842a('0x8'));var attributes=require(_0x842a('0x9'));module[_0x842a('0xa')]=function(_0x368210,_0x219baf){return _0x368210['define'](_0x842a('0xb'),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 5d01e7e..240fdc9 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 _0xeec9=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','info','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x224ad8,_0x17dc8d){var _0x5d12d1=function(_0x515965){while(--_0x515965){_0x224ad8['push'](_0x224ad8['shift']());}};_0x5d12d1(++_0x17dc8d);}(_0xeec9,0x1db));var _0x9eec=function(_0x27857b,_0xde3537){_0x27857b=_0x27857b-0x0;var _0x1796db=_0xeec9[_0x27857b];return _0x1796db;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9eec('0x0'));var BPromise=require(_0x9eec('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9eec('0x2'));var db=require(_0x9eec('0x3'))['db'];var utils=require(_0x9eec('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9eec('0x5'));var client=jayson[_0x9eec('0x6')][_0x9eec('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43a5bb,_0x131544,_0x271e9f){return new BPromise(function(_0x195d05,_0x2b9bd1){return client[_0x9eec('0x8')](_0x43a5bb,_0x271e9f)[_0x9eec('0x9')](function(_0x17a794){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x131544,_0x9eec('0xa'));logger['debug'](_0x9eec('0xb'),_0x131544,_0x9eec('0xa'),JSON[_0x9eec('0xc')](_0x17a794));if(_0x17a794[_0x9eec('0xd')]){if(_0x17a794['error']['code']===0x1f4){logger[_0x9eec('0xd')](_0x9eec('0xe'),_0x131544,_0x17a794[_0x9eec('0xd')][_0x9eec('0xf')]);return _0x2b9bd1(_0x17a794[_0x9eec('0xd')]['message']);}logger['error'](_0x9eec('0xe'),_0x131544,_0x17a794[_0x9eec('0xd')][_0x9eec('0xf')]);return _0x195d05(_0x17a794[_0x9eec('0xd')][_0x9eec('0xf')]);}else{logger[_0x9eec('0x10')](_0x9eec('0xe'),_0x131544,_0x9eec('0xa'));_0x195d05(_0x17a794[_0x9eec('0x11')][_0x9eec('0xf')]);}})['catch'](function(_0x3283d7){logger[_0x9eec('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x131544,_0x3283d7);_0x2b9bd1(_0x3283d7);});});} \ No newline at end of file +var _0x3640=['client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x1d070d,_0x44b1dc){var _0x150d9f=function(_0x378b25){while(--_0x378b25){_0x1d070d['push'](_0x1d070d['shift']());}};_0x150d9f(++_0x44b1dc);}(_0x3640,0xf4));var _0x0364=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x3640[_0x424a9a];return _0xa7831c;};'use strict';var _=require(_0x0364('0x0'));var util=require(_0x0364('0x1'));var moment=require(_0x0364('0x2'));var BPromise=require(_0x0364('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0364('0x4'));var db=require(_0x0364('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0364('0x6'))(_0x0364('0x7'));var config=require('../../config/environment');var jayson=require(_0x0364('0x8'));var client=jayson[_0x0364('0x9')][_0x0364('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14cd84,_0x5c1d64,_0x5c2cd6){return new BPromise(function(_0x5a6130,_0x104223){return client[_0x0364('0xb')](_0x14cd84,_0x5c2cd6)[_0x0364('0xc')](function(_0x2d1808){logger[_0x0364('0xd')](_0x0364('0xe'),_0x5c1d64,_0x0364('0xf'));logger[_0x0364('0x10')](_0x0364('0x11'),_0x5c1d64,_0x0364('0xf'),JSON[_0x0364('0x12')](_0x2d1808));if(_0x2d1808[_0x0364('0x13')]){if(_0x2d1808[_0x0364('0x13')][_0x0364('0x14')]===0x1f4){logger[_0x0364('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5c1d64,_0x2d1808[_0x0364('0x13')][_0x0364('0x15')]);return _0x104223(_0x2d1808[_0x0364('0x13')][_0x0364('0x15')]);}logger[_0x0364('0x13')](_0x0364('0xe'),_0x5c1d64,_0x2d1808['error']['message']);return _0x5a6130(_0x2d1808['error'][_0x0364('0x15')]);}else{logger[_0x0364('0xd')](_0x0364('0xe'),_0x5c1d64,'request\x20sent');_0x5a6130(_0x2d1808[_0x0364('0x16')][_0x0364('0x15')]);}})['catch'](function(_0x47f7dc){logger[_0x0364('0x13')](_0x0364('0xe'),_0x5c1d64,_0x47f7dc);_0x104223(_0x47f7dc);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 682e7cd..e60898d 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 _0x87fd=['../../config/environment','isAuthenticated','index','get','/:id','/:id/preview','preview','/:id/run','/:id/query','query','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3a67e5,_0x1c5897){var _0x3ee071=function(_0x5bf909){while(--_0x5bf909){_0x3a67e5['push'](_0x3a67e5['shift']());}};_0x3ee071(++_0x1c5897);}(_0x87fd,0x118));var _0xd87f=function(_0x4ea2f7,_0xb6fba2){_0x4ea2f7=_0x4ea2f7-0x0;var _0x29bb40=_0x87fd[_0x4ea2f7];return _0x29bb40;};'use strict';var multer=require('multer');var util=require(_0xd87f('0x0'));var path=require(_0xd87f('0x1'));var timeout=require(_0xd87f('0x2'));var express=require(_0xd87f('0x3'));var router=express[_0xd87f('0x4')]();var fs_extra=require(_0xd87f('0x5'));var auth=require(_0xd87f('0x6'));var interaction=require(_0xd87f('0x7'));var config=require(_0xd87f('0x8'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0xd87f('0x9')](),controller[_0xd87f('0xa')]);router[_0xd87f('0xb')](_0xd87f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd87f('0xb')](_0xd87f('0xd'),auth['isAuthenticated'](),controller[_0xd87f('0xe')]);router[_0xd87f('0xb')](_0xd87f('0xf'),auth[_0xd87f('0x9')](),controller['run']);router[_0xd87f('0xb')](_0xd87f('0x10'),auth[_0xd87f('0x9')](),controller[_0xd87f('0x11')]);router[_0xd87f('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd87f('0x13')](_0xd87f('0xc'),auth[_0xd87f('0x9')](),controller[_0xd87f('0x14')]);router[_0xd87f('0x15')]('/:id',auth[_0xd87f('0x9')](),controller[_0xd87f('0x16')]);module[_0xd87f('0x17')]=router; \ No newline at end of file +var _0x314b=['preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','/:id','get','/:id/preview'];(function(_0x47c596,_0x10f1d8){var _0x214b1a=function(_0x2462ee){while(--_0x2462ee){_0x47c596['push'](_0x47c596['shift']());}};_0x214b1a(++_0x10f1d8);}(_0x314b,0x1ad));var _0xb314=function(_0x285a14,_0x394a27){_0x285a14=_0x285a14-0x0;var _0x3430cc=_0x314b[_0x285a14];return _0x3430cc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb314('0x0'));var timeout=require(_0xb314('0x1'));var express=require('express');var router=express[_0xb314('0x2')]();var fs_extra=require(_0xb314('0x3'));var auth=require(_0xb314('0x4'));var interaction=require(_0xb314('0x5'));var config=require('../../config/environment');var controller=require(_0xb314('0x6'));router['get']('/',auth[_0xb314('0x7')](),controller['index']);router['get'](_0xb314('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xb314('0x9')](_0xb314('0xa'),auth[_0xb314('0x7')](),controller[_0xb314('0xb')]);router[_0xb314('0x9')](_0xb314('0xc'),auth[_0xb314('0x7')](),controller[_0xb314('0xd')]);router['get'](_0xb314('0xe'),auth[_0xb314('0x7')](),controller[_0xb314('0xf')]);router[_0xb314('0x10')]('/',auth[_0xb314('0x7')](),controller[_0xb314('0x11')]);router[_0xb314('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb314('0x13')]);router['delete'](_0xb314('0x8'),auth['isAuthenticated'](),controller[_0xb314('0x14')]);module[_0xb314('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 9a4af3e..6324545 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 _0xae24=['sequelize','STRING'];(function(_0x153532,_0x37bb41){var _0x186890=function(_0x294791){while(--_0x294791){_0x153532['push'](_0x153532['shift']());}};_0x186890(++_0x37bb41);}(_0xae24,0x182));var _0x4ae2=function(_0x3ee62e,_0x244fc4){_0x3ee62e=_0x3ee62e-0x0;var _0x50b333=_0xae24[_0x3ee62e];return _0x50b333;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb138=['TEXT','sequelize','exports','STRING'];(function(_0xe21e0a,_0x5c6a09){var _0x532010=function(_0x13fa36){while(--_0x13fa36){_0xe21e0a['push'](_0xe21e0a['shift']());}};_0x532010(++_0x5c6a09);}(_0xb138,0x1dd));var _0x8b13=function(_0x434143,_0x29153d){_0x434143=_0x434143-0x0;var _0x1725b1=_0xb138[_0x434143];return _0x1725b1;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'name':{'type':Sequelize[_0x8b13('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8b13('0x2')]},'parent':{'type':Sequelize[_0x8b13('0x2')]},'table':{'type':Sequelize[_0x8b13('0x2')]},'conditions':{'type':Sequelize[_0x8b13('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 67a43f8..29aefdd 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 _0x0295=['default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','SELECT','run','runReport','MAX(%s)','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','getFields','findAll','select','replace','output','web','%s-%s.%s','randomstring','generate','csv'];(function(_0x7544c5,_0x5532e0){var _0x3d9472=function(_0xeeb971){while(--_0xeeb971){_0x7544c5['push'](_0x7544c5['shift']());}};_0x3d9472(++_0x5532e0);}(_0x0295,0x1f0));var _0x5029=function(_0x1e9d6a,_0x3e5cab){_0x1e9d6a=_0x1e9d6a-0x0;var _0x222bd1=_0x0295[_0x1e9d6a];return _0x222bd1;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];var dbH=require(_0x5029('0x14'))['dbH'];function respondWithStatusCode(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xcc;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x15')](_0x49f836);}return _0x4fa22d[_0x5029('0x16')](_0x49f836)[_0x5029('0x17')]();};}function respondWithResult(_0x434630,_0x2c0b33){_0x2c0b33=_0x2c0b33||0xc8;return function(_0x11c24b){if(_0x11c24b){return _0x434630[_0x5029('0x16')](_0x2c0b33)[_0x5029('0x18')](_0x11c24b);}};}function respondWithFilteredResult(_0x10bf55,_0x326923){return function(_0x457c73){if(_0x457c73){var _0x353cba=typeof _0x326923[_0x5029('0x19')]===_0x5029('0x1a')&&typeof _0x326923[_0x5029('0x1b')]==='undefined';var _0x1ed567=_0x457c73[_0x5029('0x1c')];var _0x35de81=_0x353cba?0x0:_0x326923[_0x5029('0x19')];var _0x8cea01=_0x353cba?_0x457c73[_0x5029('0x1c')]:_0x326923[_0x5029('0x19')]+_0x326923['limit'];var _0x226a5c;if(_0x8cea01>=_0x1ed567){_0x8cea01=_0x1ed567;_0x226a5c=0xc8;}else{_0x226a5c=0xce;}_0x10bf55['status'](_0x226a5c);return _0x10bf55[_0x5029('0x1d')](_0x5029('0x1e'),_0x35de81+'-'+_0x8cea01+'/'+_0x1ed567)[_0x5029('0x18')](_0x457c73);}return null;};}function patchUpdates(_0x3cf0fb){return function(_0x4b5854){try{jsonpatch['apply'](_0x4b5854,_0x3cf0fb,!![]);}catch(_0x4c9184){return BPromise['reject'](_0x4c9184);}return _0x4b5854[_0x5029('0x1f')]();};}function saveUpdates(_0x853a34,_0x1eb228){return function(_0x2bbbcb){if(_0x2bbbcb){return _0x2bbbcb[_0x5029('0x20')](_0x853a34)[_0x5029('0x21')](function(_0x125c26){return _0x125c26;});}return null;};}function removeEntity(_0x356dac,_0x3e857d){return function(_0x4ceaae){if(_0x4ceaae){return _0x4ceaae['destroy']()['then'](function(){var _0x588d90=_0x4ceaae[_0x5029('0x22')]({'plain':!![]});var _0x51093c='DefaultReports';return db[_0x5029('0x23')][_0x5029('0x24')]({'where':{'type':_0x51093c,'resourceId':_0x588d90['id']}})[_0x5029('0x21')](function(){return _0x4ceaae;});})['then'](function(){_0x356dac[_0x5029('0x16')](0xcc)[_0x5029('0x17')]();});}};}function handleEntityNotFound(_0x5e45c4,_0x2b6d99){return function(_0x31f0a0){if(!_0x31f0a0){_0x5e45c4[_0x5029('0x15')](0x194);}return _0x31f0a0;};}function handleError(_0x4a24b9,_0x32da06){_0x32da06=_0x32da06||0x1f4;return function(_0x251f99){logger[_0x5029('0x25')](_0x251f99['stack']);if(_0x251f99[_0x5029('0x26')]){delete _0x251f99[_0x5029('0x26')];}_0x4a24b9['status'](_0x32da06)[_0x5029('0x27')](_0x251f99);};}exports[_0x5029('0x28')]=function(_0x4434ff,_0x1c3dd9){var _0x196830={},_0x2a1ed6={},_0x44255a={'count':0x0,'rows':[]};var _0x465153=_[_0x5029('0x29')](db[_0x5029('0x2a')][_0x5029('0x2b')],function(_0x4519c8){return{'name':_0x4519c8['fieldName'],'type':_0x4519c8[_0x5029('0x2c')]['key']};});_0x2a1ed6[_0x5029('0x2d')]=_['map'](_0x465153,'name');_0x2a1ed6[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x4434ff[_0x5029('0x2e')]);_0x2a1ed6['filters']=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],_0x2a1ed6[_0x5029('0x2e')]);_0x196830[_0x5029('0x31')]=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x32')]));_0x196830['attributes']=_0x196830[_0x5029('0x31')][_0x5029('0x33')]?_0x196830[_0x5029('0x31')]:_0x2a1ed6[_0x5029('0x2d')];if(!_0x4434ff['query'][_0x5029('0x34')](_0x5029('0x35'))){_0x196830[_0x5029('0x1b')]=qs['limit'](_0x4434ff['query'][_0x5029('0x1b')]);_0x196830[_0x5029('0x19')]=qs['offset'](_0x4434ff['query'][_0x5029('0x19')]);}_0x196830[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x37')]);_0x196830[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x3a')](_0x4434ff[_0x5029('0x2e')],_0x2a1ed6[_0x5029('0x39')]),_0x465153);if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3b')]){_0x196830[_0x5029('0x38')]=_[_0x5029('0x3c')](_0x196830['where'],{'$or':_['map'](_0x465153,function(_0x73797c){if(_0x73797c[_0x5029('0x2c')]!==_0x5029('0x3d')){var _0x48c9eb={};_0x48c9eb[_0x73797c[_0x5029('0x26')]]={'$like':'%'+_0x4434ff[_0x5029('0x2e')]['filter']+'%'};return _0x48c9eb;}})});}_0x196830=_[_0x5029('0x3c')]({},_0x196830,_0x4434ff['options']);var _0x506f0d={'where':_0x196830['where']};return db[_0x5029('0x2a')][_0x5029('0x1c')](_0x506f0d)[_0x5029('0x21')](function(_0x78768){_0x44255a[_0x5029('0x1c')]=_0x78768;if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3e')]){_0x196830[_0x5029('0x3f')]=[{'all':!![]}];}return db[_0x5029('0x2a')]['findAll'](_0x196830);})[_0x5029('0x21')](function(_0x236455){_0x44255a[_0x5029('0x40')]=_0x236455;return _0x44255a;})[_0x5029('0x21')](respondWithFilteredResult(_0x1c3dd9,_0x196830))[_0x5029('0x41')](handleError(_0x1c3dd9,null));};exports[_0x5029('0x42')]=function(_0x5658a7,_0x259db8){var _0xa1580a={'raw':!![],'where':{'id':_0x5658a7[_0x5029('0x43')]['id']}},_0x9434ed={};_0x9434ed[_0x5029('0x2d')]=_['keys'](db[_0x5029('0x2a')][_0x5029('0x2b')]);_0x9434ed[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x5658a7[_0x5029('0x2e')]);_0x9434ed[_0x5029('0x39')]=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],_0x9434ed[_0x5029('0x2e')]);_0xa1580a['attributes']=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x5658a7[_0x5029('0x2e')]['fields']));_0xa1580a['attributes']=_0xa1580a[_0x5029('0x31')][_0x5029('0x33')]?_0xa1580a[_0x5029('0x31')]:_0x9434ed[_0x5029('0x2d')];if(_0x5658a7[_0x5029('0x2e')][_0x5029('0x3e')]){_0xa1580a[_0x5029('0x3f')]=[{'all':!![]}];}_0xa1580a=_[_0x5029('0x3c')]({},_0xa1580a,_0x5658a7[_0x5029('0x44')]);return db[_0x5029('0x2a')][_0x5029('0x45')](_0xa1580a)[_0x5029('0x21')](handleEntityNotFound(_0x259db8,null))[_0x5029('0x21')](respondWithResult(_0x259db8,null))[_0x5029('0x41')](handleError(_0x259db8,null));};exports[_0x5029('0x46')]=function(_0x175cc0,_0x10fc07){return db[_0x5029('0x2a')][_0x5029('0x46')](_0x175cc0[_0x5029('0x47')],{})[_0x5029('0x21')](function(_0x489457){var _0x1069c4=_0x175cc0['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x1069c4)throw new Error(_0x5029('0x48'));if(_0x1069c4['role']==='user'){var _0x319bff=_0x489457['get']({'plain':!![]});var _0x4aaa43=_0x5029('0x49');return db[_0x5029('0x4a')][_0x5029('0x45')]({'where':{'name':_0x4aaa43,'userProfileId':_0x1069c4['userProfileId']},'raw':!![]})['then'](function(_0x1510bb){if(_0x1510bb&&_0x1510bb[_0x5029('0x4b')]===0x0){return db['UserProfileResource'][_0x5029('0x46')]({'name':_0x319bff['name'],'resourceId':_0x319bff['id'],'type':_0x5029('0x4c'),'sectionId':_0x1510bb['id']},{})['then'](function(){return _0x489457;});}else{return _0x489457;}})[_0x5029('0x41')](function(_0x27e1c0){logger[_0x5029('0x25')](_0x5029('0x4d'),_0x27e1c0);throw _0x27e1c0;});}return _0x489457;})[_0x5029('0x21')](respondWithResult(_0x10fc07,0xc9))[_0x5029('0x41')](handleError(_0x10fc07,null));};exports[_0x5029('0x20')]=function(_0xa25013,_0x586936){if(_0xa25013[_0x5029('0x47')]['id']){delete _0xa25013['body']['id'];}return db[_0x5029('0x2a')][_0x5029('0x45')]({'where':{'id':_0xa25013['params']['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x586936,null))['then'](saveUpdates(_0xa25013['body'],null))['then'](respondWithResult(_0x586936,null))[_0x5029('0x41')](handleError(_0x586936,null));};exports['destroy']=function(_0x49d1db,_0x353ae4){return db[_0x5029('0x2a')]['find']({'where':{'id':_0x49d1db[_0x5029('0x43')]['id']}})['then'](handleEntityNotFound(_0x353ae4,null))['then'](removeEntity(_0x353ae4,null))[_0x5029('0x41')](handleError(_0x353ae4,null));};exports[_0x5029('0x4e')]=function(_0x81e39c,_0x448273){var _0x164179=0xa;var _0x4e8d9f=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x4dca54={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4208ab={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x59a718=function(_0x560324){return!_[_0x5029('0x5e')]([_0x5029('0x5f'),_0x5029('0x60'),'IS\x20EMPTY',_0x5029('0x61')],_0x560324);};var _0x2d439a=function(_0x105638){if(!_0x105638||!_0x105638[_0x5029('0x62')][_0x5029('0x33')]){return'';}for(var _0x5264c6='(',_0x2ec5d0=0x0;_0x2ec5d0<_0x105638[_0x5029('0x62')][_0x5029('0x33')];_0x2ec5d0+=0x1){_0x2ec5d0>0x0&&(_0x5264c6+='\x20'+_0x105638['operator']+'\x20');_0x5264c6+=_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']?_0x2d439a(_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']):_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x63')]+'\x20'+_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')]+(_0x59a718(_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')])?'\x20'+_0x105638['rules'][_0x2ec5d0][_0x5029('0x65')]:'');}return _0x5264c6+')';};var _0x19220d={'where':{'id':_0x81e39c['params']['id']}},_0x1ff8df,_0x151562,_0x389700,_0x506f74,_0x13ca47;_0x19220d=_[_0x5029('0x3c')]({},_0x19220d,_0x81e39c['options']);return db[_0x5029('0x2a')]['find'](_0x19220d)[_0x5029('0x21')](function(_0x54daf9){if(_0x54daf9){_0x1ff8df=_0x54daf9;return _0x54daf9['getFields']();}return null;})[_0x5029('0x21')](function(_0x575f09){if(_0x575f09){if(!_0x575f09[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x151562=_0x575f09;return db[_0x5029('0x68')]['findAll']({'raw':!![]});}return null;})[_0x5029('0x21')](function(_0x255dfb){if(_0x255dfb){_0x389700=_[_0x5029('0x69')](_0x255dfb,'id');var _0x1cca02;var _0x1deed7=squel['select']();_0x1deed7[_0x5029('0x6a')](_0x1ff8df[_0x5029('0x6b')]);for(var _0x5890ac=0x0;_0x5890ac<_0x151562[_0x5029('0x33')];_0x5890ac+=0x1){_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6c')]?_0x389700[_0x151562[_0x5890ac][_0x5029('0x6c')]][_0x5029('0x6d')]:_0x151562[_0x5890ac][_0x5029('0x63')];_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6e')]?_['replace'](_0x4dca54[_0x151562[_0x5890ac]['function']],'%s',_0x1cca02):_0x1cca02;_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6f')]?_['replace'](_0x4208ab[_0x151562[_0x5890ac][_0x5029('0x6f')]],'%s',_0x1cca02):_0x1cca02;if(_0x151562[_0x5890ac][_0x5029('0x70')]){_0x1deed7['group'](_0x1cca02);}_0x151562[_0x5890ac][_0x5029('0x71')]&&_0x1deed7['order'](_0x1cca02,_0x151562[_0x5890ac]['orderBy']===_0x5029('0x72')?![]:!![]);_0x1deed7[_0x5029('0x63')](_0x1cca02,_0x151562[_0x5890ac][_0x5029('0x73')]||_0x1cca02);}if(_0x1ff8df[_0x5029('0x74')]){_0x1ff8df['joins']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x74')]);for(var _0x4a2ce8=0x0;_0x4a2ce8<_0x1ff8df[_0x5029('0x74')][_0x5029('0x33')];_0x4a2ce8+=0x1){if(_0x1ff8df['joins'][_0x4a2ce8]['type']&&_['includes'](_0x4e8d9f,_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x2c')])&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x77')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]){_0x1deed7[_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['type']](_0x1ff8df['joins'][_0x4a2ce8][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x1ff8df[_0x5029('0x6b')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['foreignTable'],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]));}}}if(_0x1ff8df[_0x5029('0x7a')]){_0x1ff8df['conditions']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x7a')]);_0x1deed7[_0x5029('0x38')](_0x2d439a(_0x1ff8df['conditions'][_0x5029('0x7b')]));}_0x13ca47=_0x1deed7[_0x5029('0x7c')]();_0x1deed7[_0x5029('0x1b')](_0x164179);_0x1deed7['offset'](0x0);logger[_0x5029('0x7d')](_0x5029('0x7e'),_0x1deed7['toString']());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1deed7[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')]['SELECT']});}})[_0x5029('0x21')](respondWithResult(_0x448273,null))[_0x5029('0x41')](handleError(_0x448273,null));};function runReport(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50=_0xe6ac28[_0x5029('0x26')];var _0x202c51=0xa;var _0x344203=['join',_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x3e47bd={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x4c40d1={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x41e2d8=function(_0x51098a){return!_['includes'](['IS\x20NULL',_0x5029('0x60'),_0x5029('0x84'),_0x5029('0x61')],_0x51098a);};var _0x4007c8=function(_0x3dc05a){if(!_0x3dc05a||!_0x3dc05a['rules'][_0x5029('0x33')]){return'';}for(var _0x2e4782='(',_0x2c0540=0x0;_0x2c0540<_0x3dc05a['rules']['length'];_0x2c0540+=0x1){_0x2c0540>0x0&&(_0x2e4782+='\x20'+_0x3dc05a[_0x5029('0x85')]+'\x20');_0x2e4782+=_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x7b')]?_0x4007c8(_0x3dc05a[_0x5029('0x62')][_0x2c0540]['group']):_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x63')]+'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')]+(_0x41e2d8(_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')])?'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x65')]:'');}return _0x2e4782+')';};var _0x5aecc2={'where':{'id':_0x426d70['id']}},_0x159450,_0x556c7a,_0x48bbe2,_0x3e3150,_0x533ee2;_0x5aecc2=_[_0x5029('0x3c')]({},_0x5aecc2,_0x153cdc);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x5aecc2)[_0x5029('0x21')](function(_0x1b6f4c){if(_0x1b6f4c){_0x159450=_0x1b6f4c;return _0x1b6f4c[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x1d6092){if(_0x1d6092){if(!_0x1d6092['length']){throw new db['Sequelize'][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x556c7a=_0x1d6092;return db['AnalyticMetric'][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x4b25ed){if(_0x4b25ed){_0x48bbe2=_[_0x5029('0x69')](_0x4b25ed,'id');var _0xb8da0b;var _0x13e07e=squel[_0x5029('0x88')]();_0x13e07e[_0x5029('0x6a')](_0x159450['table']);for(var _0x38c02a=0x0;_0x38c02a<_0x556c7a[_0x5029('0x33')];_0x38c02a+=0x1){_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6c')]?_0x48bbe2[_0x556c7a[_0x38c02a]['MetricId']][_0x5029('0x6d')]:_0x556c7a[_0x38c02a][_0x5029('0x63')];_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x3e47bd[_0x556c7a[_0x38c02a][_0x5029('0x6e')]],'%s',_0xb8da0b):_0xb8da0b;_0xb8da0b=_0x556c7a[_0x38c02a]['format']?_['replace'](_0x4c40d1[_0x556c7a[_0x38c02a][_0x5029('0x6f')]],'%s',_0xb8da0b):_0xb8da0b;if(_0x556c7a[_0x38c02a][_0x5029('0x70')]){_0x13e07e['group'](_0xb8da0b);}_0x556c7a[_0x38c02a][_0x5029('0x71')]&&_0x13e07e[_0x5029('0x36')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x13e07e[_0x5029('0x63')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x73')]||_0xb8da0b);}if(_0x159450[_0x5029('0x74')]){_0x159450[_0x5029('0x74')]=JSON['parse'](_0x159450['joins']);for(var _0x4243c3=0x0;_0x4243c3<_0x159450['joins'][_0x5029('0x33')];_0x4243c3+=0x1){if(_0x159450['joins'][_0x4243c3][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x344203,_0x159450[_0x5029('0x74')][_0x4243c3]['type'])&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')]&&_0x159450[_0x5029('0x74')][_0x4243c3]['foreignTable']&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]){_0x13e07e[_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x2c')]](_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x159450[_0x5029('0x6b')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]));}}}if(_0x159450[_0x5029('0x7a')]){_0x159450[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x159450['conditions']);_0x13e07e[_0x5029('0x38')](_0x4007c8(_0x159450[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x533ee2=_0x13e07e[_0x5029('0x7c')]();_0x13e07e[_0x5029('0x1b')](_0x202c51);_0x13e07e['offset'](0x0);return;}})[_0x5029('0x21')](function(){if(_0xe6ac28[_0x5029('0x8a')]===_0x5029('0x8b')){return null;}var _0xf7729c=_[_0x5029('0x3c')](_0xe6ac28,{'name':_0xe6ac28['fullPath']||_0xe6ac28[_0x5029('0x26')]||_0x159450[_0x5029('0x26')],'basename':_0x5e7f50,'savename':util[_0x5029('0x6f')](_0x5029('0x8c'),_0xe6ac28[_0x5029('0x26')]||_0x159450['name'],require(_0x5029('0x8d'))[_0x5029('0x8e')](0x4),_0xe6ac28[_0x5029('0x8a')]||_0x5029('0x8f')),'reportId':_0x159450['id'],'reportType':_0x5029('0x90')});return db[_0x5029('0x91')][_0x5029('0x46')](_0xf7729c,{'raw':!![]});})[_0x5029('0x21')](function(_0x4a7535){if(_0x159450['table']===_0x5029('0x92')){_0x533ee2[_0x5029('0x38')](_0x159450[_0x5029('0x6b')]+_0x5029('0x93'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28['endDate']);}else{_0x533ee2[_0x5029('0x38')](_0x159450['table']+_0x5029('0x95'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28[_0x5029('0x96')]);}if(_0x4a7535){logger[_0x5029('0x97')](_0x5029('0x98'),_0x533ee2[_0x5029('0x80')]());require('child_process')[_0x5029('0x99')](path[_0x5029('0x4f')](__dirname,'../../components/export/',_0x4a7535[_0x5029('0x8a')]),[_0x4a7535['id'],_0x533ee2[_0x5029('0x80')](),path['join'](__dirname,_0x5029('0x9a'),_0x4a7535['savename']),_0x5e7f50]);return _0x4a7535;}else{var _0x54c0f3=squel['select']();_0x54c0f3['from']('('+_0x533ee2[_0x5029('0x80')]()+')','countTable');_0x54c0f3[_0x5029('0x63')](_0x5029('0x9b'),'count');_0x533ee2[_0x5029('0x1b')](_0xe6ac28[_0x5029('0x1b')]||_0x202c51);_0x533ee2['offset'](_0xe6ac28[_0x5029('0x19')]||0x0);return dbH[_0x5029('0x7f')]['query'](_0x54c0f3[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')]['QueryTypes'][_0x5029('0x9c')]})[_0x5029('0x21')](function(_0x17c755){if(!_0x17c755[_0x5029('0x33')]){_0x3e3150=0x0;}else{_0x3e3150=_0x17c755[0x0][_0x5029('0x1c')]||0x0;}return dbH[_0x5029('0x7f')]['query'](_0x533ee2[_0x5029('0x80')](),{'type':dbH['sequelize'][_0x5029('0x81')][_0x5029('0x9c')]});})[_0x5029('0x21')](function(_0x3ebe00){return{'rows':_0x3ebe00||[],'count':_0x3e3150};});}});}exports[_0x5029('0x9d')]=function(_0x2138cc,_0x331af8){return runReport(_0x2138cc[_0x5029('0x43')],_0x2138cc[_0x5029('0x2e')],_0x2138cc[_0x5029('0x44')])[_0x5029('0x21')](respondWithResult(_0x331af8,null))[_0x5029('0x41')](handleError(_0x331af8,null));};exports[_0x5029('0x9e')]=runReport;exports[_0x5029('0x2e')]=function(_0x9de076,_0x2ac88e){var _0x55ee4f=0xa;var _0x1fa9eb=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x405d47={'SUM':'SUM(%s)','COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':_0x5029('0x9f'),'MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x29c3a2={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0xb39e9d=function(_0x124c5e){return!_['includes']([_0x5029('0x5f'),'IS\x20NOT\x20NULL',_0x5029('0x84'),_0x5029('0x61')],_0x124c5e);};var _0x120acc=function(_0x21bb22){if(!_0x21bb22||!_0x21bb22['rules'][_0x5029('0x33')]){return'';}for(var _0x339112='(',_0x5d7c1a=0x0;_0x5d7c1a<_0x21bb22[_0x5029('0x62')][_0x5029('0x33')];_0x5d7c1a+=0x1){_0x5d7c1a>0x0&&(_0x339112+='\x20'+_0x21bb22['operator']+'\x20');_0x339112+=_0x21bb22[_0x5029('0x62')][_0x5d7c1a][_0x5029('0x7b')]?_0x120acc(_0x21bb22['rules'][_0x5d7c1a]['group']):_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['field']+'\x20'+_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')]+(_0xb39e9d(_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')])?'\x20'+_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['value']:'');}return _0x339112+')';};var _0x327299={'where':{'id':_0x9de076['params']['id']}},_0x3463cc,_0x590cc2,_0x3ac39a,_0x37c47b,_0x62e4af;_0x327299=_[_0x5029('0x3c')]({},_0x327299,_0x9de076['options']);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x327299)[_0x5029('0x21')](function(_0x5e7ec8){if(_0x5e7ec8){_0x3463cc=_0x5e7ec8;return _0x5e7ec8[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x5aa480){if(_0x5aa480){if(!_0x5aa480[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590cc2=_0x5aa480;return db[_0x5029('0x68')][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x5842a5){if(_0x5842a5){_0x3ac39a=_['keyBy'](_0x5842a5,'id');var _0x313bdb;var _0x1d38e0=squel[_0x5029('0x88')]();_0x1d38e0['from'](_0x3463cc[_0x5029('0x6b')]);for(var _0x581237=0x0;_0x581237<_0x590cc2[_0x5029('0x33')];_0x581237+=0x1){_0x313bdb=_0x590cc2[_0x581237]['MetricId']?_0x3ac39a[_0x590cc2[_0x581237]['MetricId']]['metric']:_0x590cc2[_0x581237]['field'];_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x405d47[_0x590cc2[_0x581237][_0x5029('0x6e')]],'%s',_0x313bdb):_0x313bdb;_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6f')]?_[_0x5029('0x89')](_0x29c3a2[_0x590cc2[_0x581237]['format']],'%s',_0x313bdb):_0x313bdb;if(_0x590cc2[_0x581237][_0x5029('0x70')]){_0x1d38e0[_0x5029('0x7b')](_0x313bdb);}_0x590cc2[_0x581237][_0x5029('0x71')]&&_0x1d38e0[_0x5029('0x36')](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x1d38e0['field'](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x73')]||_0x313bdb);}if(_0x3463cc[_0x5029('0x74')]){_0x3463cc[_0x5029('0x74')]=JSON['parse'](_0x3463cc['joins']);for(var _0xd05bc9=0x0;_0xd05bc9<_0x3463cc[_0x5029('0x74')][_0x5029('0x33')];_0xd05bc9+=0x1){if(_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x1fa9eb,_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')])&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x76')]&&_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')]&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]){_0x1d38e0[_0x3463cc['joins'][_0xd05bc9][_0x5029('0x2c')]](_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x3463cc[_0x5029('0x6b')],_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x76')],_0x3463cc['joins'][_0xd05bc9]['foreignTable'],_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]));}}}if(_0x3463cc[_0x5029('0x7a')]){_0x3463cc[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x3463cc[_0x5029('0x7a')]);_0x1d38e0['where'](_0x120acc(_0x3463cc[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x62e4af=_0x1d38e0[_0x5029('0x7c')]();_0x1d38e0[_0x5029('0x1b')](_0x55ee4f);_0x1d38e0[_0x5029('0x19')](0x0);logger['debug'](_0x5029('0x7e'),_0x1d38e0[_0x5029('0x80')]());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1d38e0[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')][_0x5029('0x9c')]});}})[_0x5029('0x21')](function(){return{'sql':_0x62e4af[_0x5029('0x80')]()};})[_0x5029('0x21')](respondWithResult(_0x2ac88e,null))[_0x5029('0x41')](handleError(_0x2ac88e,null));}; \ No newline at end of file +var _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x306c0c,_0x184d7f){var _0x118365=function(_0x1fece1){while(--_0x1fece1){_0x306c0c['push'](_0x306c0c['shift']());}};_0x118365(++_0x184d7f);}(_0xf494,0x1c6));var _0x4f49=function(_0x1602c2,_0x47b449){_0x1602c2=_0x1602c2-0x0;var _0x182f40=_0xf494[_0x1602c2];return _0x182f40;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 798a1b4..f6403cc 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 _0x758d=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','define','AnalyticDefaultReport','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x758d,0x1ad));var _0xd758=function(_0x4ab4ea,_0x5f11cc){_0x4ab4ea=_0x4ab4ea-0x0;var _0x57931d=_0x758d[_0x4ab4ea];return _0x57931d;};'use strict';var _=require(_0xd758('0x0'));var util=require(_0xd758('0x1'));var logger=require(_0xd758('0x2'))(_0xd758('0x3'));var moment=require('moment');var BPromise=require(_0xd758('0x4'));var rp=require(_0xd758('0x5'));var fs=require('fs');var path=require(_0xd758('0x6'));var rimraf=require(_0xd758('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x3bf2bc,_0x17efc5){return _0x3bf2bc[_0xd758('0x8')](_0xd758('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc164=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc164,0x149));var _0x4c16=function(_0x34f1b3,_0x55df5d){_0x34f1b3=_0x34f1b3-0x0;var _0x1732da=_0xc164[_0x34f1b3];return _0x1732da;};'use strict';var _=require(_0x4c16('0x0'));var util=require(_0x4c16('0x1'));var logger=require(_0x4c16('0x2'))(_0x4c16('0x3'));var moment=require(_0x4c16('0x4'));var BPromise=require('bluebird');var rp=require(_0x4c16('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c16('0x6'));var config=require(_0x4c16('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x4c16('0x8')]=function(_0x2e5ee5,_0x13d307){return _0x2e5ee5['define'](_0x4c16('0x9'),attributes,{'tableName':_0x4c16('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 6f3938f..de25cb6 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 _0x062c=['moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x1f022d,_0x523b77){var _0x1fc652=function(_0x1cf4a5){while(--_0x1cf4a5){_0x1f022d['push'](_0x1f022d['shift']());}};_0x1fc652(++_0x523b77);}(_0x062c,0x174));var _0xc062=function(_0x1ac6bd,_0x17303f){_0x1ac6bd=_0x1ac6bd-0x0;var _0x9be794=_0x062c[_0x1ac6bd];return _0x9be794;};'use strict';var _=require(_0xc062('0x0'));var util=require(_0xc062('0x1'));var moment=require(_0xc062('0x2'));var BPromise=require(_0xc062('0x3'));var rs=require(_0xc062('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc062('0x5'))(_0xc062('0x6'));var config=require('../../config/environment');var jayson=require(_0xc062('0x7'));var client=jayson[_0xc062('0x8')][_0xc062('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4568e9,_0x3eff53,_0x4336e1){return new BPromise(function(_0x17bc43,_0x2b75a5){return client['request'](_0x4568e9,_0x4336e1)[_0xc062('0xa')](function(_0x12397f){logger[_0xc062('0xb')](_0xc062('0xc'),_0x3eff53,_0xc062('0xd'));logger[_0xc062('0xe')](_0xc062('0xf'),_0x3eff53,'request\x20sent',JSON[_0xc062('0x10')](_0x12397f));if(_0x12397f[_0xc062('0x11')]){if(_0x12397f[_0xc062('0x11')][_0xc062('0x12')]===0x1f4){logger[_0xc062('0x11')](_0xc062('0xc'),_0x3eff53,_0x12397f[_0xc062('0x11')]['message']);return _0x2b75a5(_0x12397f[_0xc062('0x11')][_0xc062('0x13')]);}logger[_0xc062('0x11')](_0xc062('0xc'),_0x3eff53,_0x12397f['error'][_0xc062('0x13')]);return _0x17bc43(_0x12397f[_0xc062('0x11')][_0xc062('0x13')]);}else{logger['info'](_0xc062('0xc'),_0x3eff53,_0xc062('0xd'));_0x17bc43(_0x12397f[_0xc062('0x14')][_0xc062('0x13')]);}})[_0xc062('0x15')](function(_0x43c0da){logger[_0xc062('0x11')](_0xc062('0xc'),_0x3eff53,_0x43c0da);_0x2b75a5(_0x43c0da);});});} \ No newline at end of file +var _0x247c=['request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x247c,0xbf));var _0xc247=function(_0x3f2b05,_0x53adad){_0x3f2b05=_0x3f2b05-0x0;var _0x3061a9=_0x247c[_0x3f2b05];return _0x3061a9;};'use strict';var _=require(_0xc247('0x0'));var util=require(_0xc247('0x1'));var moment=require(_0xc247('0x2'));var BPromise=require(_0xc247('0x3'));var rs=require(_0xc247('0x4'));var fs=require('fs');var Redis=require(_0xc247('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc247('0x6'));var logger=require(_0xc247('0x7'))(_0xc247('0x8'));var config=require(_0xc247('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc247('0xa')][_0xc247('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbfb70f,_0x2826dd,_0x1db307){return new BPromise(function(_0x58608a,_0x39d6c4){return client[_0xc247('0xc')](_0xbfb70f,_0x1db307)[_0xc247('0xd')](function(_0x339de3){logger[_0xc247('0xe')](_0xc247('0xf'),_0x2826dd,_0xc247('0x10'));logger[_0xc247('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2826dd,'request\x20sent',JSON[_0xc247('0x12')](_0x339de3));if(_0x339de3['error']){if(_0x339de3[_0xc247('0x13')][_0xc247('0x14')]===0x1f4){logger[_0xc247('0x13')](_0xc247('0xf'),_0x2826dd,_0x339de3[_0xc247('0x13')]['message']);return _0x39d6c4(_0x339de3[_0xc247('0x13')][_0xc247('0x15')]);}logger[_0xc247('0x13')](_0xc247('0xf'),_0x2826dd,_0x339de3[_0xc247('0x13')][_0xc247('0x15')]);return _0x58608a(_0x339de3[_0xc247('0x13')][_0xc247('0x15')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2826dd,'request\x20sent');_0x58608a(_0x339de3[_0xc247('0x16')]['message']);}})['catch'](function(_0x49f1d7){logger['error'](_0xc247('0xf'),_0x2826dd,_0x49f1d7);_0x39d6c4(_0x49f1d7);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 445e642..e079c95 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 _0xf0e6=['show','/:id/preview','preview','/:id/run','run','/:id/query','post','put','/:id','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','isAuthenticated'];(function(_0x1fd126,_0x459737){var _0x148f27=function(_0x1df963){while(--_0x1df963){_0x1fd126['push'](_0x1fd126['shift']());}};_0x148f27(++_0x459737);}(_0xf0e6,0x95));var _0x6f0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf0e6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x6f0e('0x0'));var path=require(_0x6f0e('0x1'));var timeout=require(_0x6f0e('0x2'));var express=require(_0x6f0e('0x3'));var router=express[_0x6f0e('0x4')]();var fs_extra=require(_0x6f0e('0x5'));var auth=require(_0x6f0e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6f0e('0x7'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6f0e('0x8')]);router[_0x6f0e('0x9')]('/:id',auth[_0x6f0e('0xa')](),controller[_0x6f0e('0xb')]);router[_0x6f0e('0x9')](_0x6f0e('0xc'),auth[_0x6f0e('0xa')](),controller[_0x6f0e('0xd')]);router[_0x6f0e('0x9')](_0x6f0e('0xe'),auth['isAuthenticated'](),controller[_0x6f0e('0xf')]);router[_0x6f0e('0x9')](_0x6f0e('0x10'),auth[_0x6f0e('0xa')](),controller['query']);router[_0x6f0e('0x11')]('/',auth[_0x6f0e('0xa')](),controller['create']);router[_0x6f0e('0x12')](_0x6f0e('0x13'),auth[_0x6f0e('0xa')](),controller['update']);router['delete'](_0x6f0e('0x13'),auth[_0x6f0e('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa2ef=['../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','get','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x2332af,_0x18426d){var _0x368455=function(_0x30c66a){while(--_0x30c66a){_0x2332af['push'](_0x2332af['shift']());}};_0x368455(++_0x18426d);}(_0xa2ef,0x119));var _0xfa2e=function(_0x5a727d,_0x1b4ff6){_0x5a727d=_0x5a727d-0x0;var _0x3d870b=_0xa2ef[_0x5a727d];return _0x3d870b;};'use strict';var multer=require(_0xfa2e('0x0'));var util=require(_0xfa2e('0x1'));var path=require(_0xfa2e('0x2'));var timeout=require(_0xfa2e('0x3'));var express=require(_0xfa2e('0x4'));var router=express['Router']();var fs_extra=require(_0xfa2e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfa2e('0x6'));var config=require(_0xfa2e('0x7'));var controller=require(_0xfa2e('0x8'));router['get']('/',auth[_0xfa2e('0x9')](),controller[_0xfa2e('0xa')]);router['get'](_0xfa2e('0xb'),auth[_0xfa2e('0x9')](),controller['show']);router[_0xfa2e('0xc')](_0xfa2e('0xd'),auth['isAuthenticated'](),controller[_0xfa2e('0xe')]);router[_0xfa2e('0xc')](_0xfa2e('0xf'),auth[_0xfa2e('0x9')](),controller[_0xfa2e('0x10')]);router['get'](_0xfa2e('0x11'),auth[_0xfa2e('0x9')](),controller['query']);router[_0xfa2e('0x12')]('/',auth[_0xfa2e('0x9')](),controller[_0xfa2e('0x13')]);router[_0xfa2e('0x14')](_0xfa2e('0xb'),auth[_0xfa2e('0x9')](),controller[_0xfa2e('0x15')]);router['delete'](_0xfa2e('0xb'),auth[_0xfa2e('0x9')](),controller[_0xfa2e('0x16')]);module[_0xfa2e('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index a1a59eb..9790801 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 _0x5670=['pdf','xlsx','DATE','Loading','ENUM','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','csv'];(function(_0x40627e,_0x2a619d){var _0x584a0d=function(_0x32693a){while(--_0x32693a){_0x40627e['push'](_0x40627e['shift']());}};_0x584a0d(++_0x2a619d);}(_0x5670,0x1e9));var _0x0567=function(_0x20732f,_0x147fbc){_0x20732f=_0x20732f-0x0;var _0x5c3d7b=_0x5670[_0x20732f];return _0x5c3d7b;};'use strict';var Sequelize=require(_0x0567('0x0'));var moment=require(_0x0567('0x1'));module[_0x0567('0x2')]={'name':{'type':Sequelize[_0x0567('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x0567('0x4'),_0x0567('0x5'),_0x0567('0x6')),'allowNull':![],'defaultValue':_0x0567('0x4')},'savename':{'type':Sequelize[_0x0567('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0567('0x7')]},'endDate':{'type':Sequelize[_0x0567('0x7')]},'status':{'type':Sequelize[_0x0567('0x3')],'defaultValue':_0x0567('0x8')},'type':{'type':Sequelize[_0x0567('0x9')](_0x0567('0xa'),_0x0567('0xb')),'allowNull':![],'defaultValue':_0x0567('0xa')},'reportId':{'type':Sequelize[_0x0567('0xc')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x0567('0x3')]}}; \ No newline at end of file +var _0x3998=['STRING','ENUM','pdf','xlsx','csv','DATE','Loading','manual','scheduled','UNSIGNED','sequelize','moment','exports'];(function(_0x16423d,_0x41225b){var _0x481382=function(_0x4cdcc5){while(--_0x4cdcc5){_0x16423d['push'](_0x16423d['shift']());}};_0x481382(++_0x41225b);}(_0x3998,0xe7));var _0x8399=function(_0x3f93f9,_0x576976){_0x3f93f9=_0x3f93f9-0x0;var _0x9dcb67=_0x3998[_0x3f93f9];return _0x9dcb67;};'use strict';var Sequelize=require(_0x8399('0x0'));var moment=require(_0x8399('0x1'));module[_0x8399('0x2')]={'name':{'type':Sequelize[_0x8399('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x8399('0x4')]('csv',_0x8399('0x5'),_0x8399('0x6')),'allowNull':![],'defaultValue':_0x8399('0x7')},'savename':{'type':Sequelize[_0x8399('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8399('0x8')]},'endDate':{'type':Sequelize[_0x8399('0x8')]},'status':{'type':Sequelize[_0x8399('0x3')],'defaultValue':_0x8399('0x9')},'type':{'type':Sequelize['ENUM'](_0x8399('0xa'),_0x8399('0xb')),'allowNull':![],'defaultValue':_0x8399('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8399('0xc')]},'reportType':{'type':Sequelize[_0x8399('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 1d1cdb0..dc49553 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 _0xe34e=['nolimit','order','sort','pick','filter','where','merge','VIRTUAL','findAll','rows','catch','params','includeAll','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','savename','format','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','reject','save','then','get','ExtractedReports','UserProfileResource','destroy','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty'];(function(_0x2adcab,_0x473cb6){var _0x5731e8=function(_0x8b96c1){while(--_0x8b96c1){_0x2adcab['push'](_0x2adcab['shift']());}};_0x5731e8(++_0x473cb6);}(_0xe34e,0x82));var _0xee34=function(_0xab73a9,_0x2fb83f){_0xab73a9=_0xab73a9-0x0;var _0x48c80e=_0xe34e[_0xab73a9];return _0x48c80e;};'use strict';var emlformat=require(_0xee34('0x0'));var rimraf=require(_0xee34('0x1'));var zipdir=require(_0xee34('0x2'));var jsonpatch=require(_0xee34('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xee34('0x4'));var Mustache=require(_0xee34('0x5'));var util=require(_0xee34('0x6'));var path=require(_0xee34('0x7'));var sox=require(_0xee34('0x8'));var csv=require(_0xee34('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee34('0xa'));var _=require(_0xee34('0xb'));var squel=require(_0xee34('0xc'));var crypto=require('crypto');var jsforce=require(_0xee34('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xee34('0x9'));var querystring=require(_0xee34('0xe'));var Papa=require(_0xee34('0xf'));var Redis=require(_0xee34('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xee34('0x11'));var as=require(_0xee34('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee34('0x13'))(_0xee34('0x14'));var utils=require(_0xee34('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xee34('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f3200,_0x5a193c){_0x5a193c=_0x5a193c||0xcc;return function(_0x1ff4fd){if(_0x1ff4fd){return _0x2f3200[_0xee34('0x17')](_0x5a193c);}return _0x2f3200[_0xee34('0x18')](_0x5a193c)[_0xee34('0x19')]();};}function respondWithResult(_0x2351f1,_0x40a23c){_0x40a23c=_0x40a23c||0xc8;return function(_0x5b84a0){if(_0x5b84a0){return _0x2351f1[_0xee34('0x18')](_0x40a23c)[_0xee34('0x1a')](_0x5b84a0);}};}function respondWithFilteredResult(_0x406727,_0x313102){return function(_0x37e15d){if(_0x37e15d){var _0xcbc420=typeof _0x313102[_0xee34('0x1b')]==='undefined'&&typeof _0x313102['limit']==='undefined';var _0x38b9dc=_0x37e15d[_0xee34('0x1c')];var _0x5db919=_0xcbc420?0x0:_0x313102['offset'];var _0xdbca13=_0xcbc420?_0x37e15d[_0xee34('0x1c')]:_0x313102[_0xee34('0x1b')]+_0x313102[_0xee34('0x1d')];var _0x1698f1;if(_0xdbca13>=_0x38b9dc){_0xdbca13=_0x38b9dc;_0x1698f1=0xc8;}else{_0x1698f1=0xce;}_0x406727['status'](_0x1698f1);return _0x406727[_0xee34('0x1e')](_0xee34('0x1f'),_0x5db919+'-'+_0xdbca13+'/'+_0x38b9dc)[_0xee34('0x1a')](_0x37e15d);}return null;};}function patchUpdates(_0x39d05f){return function(_0x541d69){try{jsonpatch['apply'](_0x541d69,_0x39d05f,!![]);}catch(_0x23453a){return BPromise[_0xee34('0x20')](_0x23453a);}return _0x541d69[_0xee34('0x21')]();};}function saveUpdates(_0x1d69c7,_0x4d522d){return function(_0x4e0d22){if(_0x4e0d22){return _0x4e0d22['update'](_0x1d69c7)[_0xee34('0x22')](function(_0x424f86){return _0x424f86;});}return null;};}function removeEntity(_0x202ceb,_0x53449b){return function(_0x11ba0f){if(_0x11ba0f){return _0x11ba0f['destroy']()[_0xee34('0x22')](function(){var _0x31291e=_0x11ba0f[_0xee34('0x23')]({'plain':!![]});var _0x17bb20=_0xee34('0x24');return db[_0xee34('0x25')][_0xee34('0x26')]({'where':{'type':_0x17bb20,'resourceId':_0x31291e['id']}})[_0xee34('0x22')](function(){return _0x11ba0f;});})[_0xee34('0x22')](function(){_0x202ceb[_0xee34('0x18')](0xcc)[_0xee34('0x19')]();});}};}function handleEntityNotFound(_0x2d4148,_0x3d16e2){return function(_0x39ab7a){if(!_0x39ab7a){_0x2d4148[_0xee34('0x17')](0x194);}return _0x39ab7a;};}function handleError(_0x318889,_0x5e459d){_0x5e459d=_0x5e459d||0x1f4;return function(_0x3a18e3){logger['error'](_0x3a18e3[_0xee34('0x27')]);if(_0x3a18e3[_0xee34('0x28')]){delete _0x3a18e3[_0xee34('0x28')];}_0x318889[_0xee34('0x18')](_0x5e459d)[_0xee34('0x29')](_0x3a18e3);};}exports[_0xee34('0x2a')]=function(_0x58a8f7,_0x4cb798){var _0x366f55={},_0x4f7379={},_0x462be1={'count':0x0,'rows':[]};var _0xf7e635=_[_0xee34('0x2b')](db[_0xee34('0x2c')][_0xee34('0x2d')],function(_0x457990){return{'name':_0x457990['fieldName'],'type':_0x457990[_0xee34('0x2e')]['key']};});_0x4f7379[_0xee34('0x2f')]=_[_0xee34('0x2b')](_0xf7e635,'name');_0x4f7379['query']=_[_0xee34('0x30')](_0x58a8f7['query']);_0x4f7379[_0xee34('0x31')]=_[_0xee34('0x32')](_0x4f7379[_0xee34('0x2f')],_0x4f7379['query']);_0x366f55['attributes']=_[_0xee34('0x32')](_0x4f7379['model'],qs[_0xee34('0x33')](_0x58a8f7[_0xee34('0x34')]['fields']));_0x366f55[_0xee34('0x35')]=_0x366f55[_0xee34('0x35')][_0xee34('0x36')]?_0x366f55[_0xee34('0x35')]:_0x4f7379['model'];if(!_0x58a8f7[_0xee34('0x34')][_0xee34('0x37')](_0xee34('0x38'))){_0x366f55[_0xee34('0x1d')]=qs[_0xee34('0x1d')](_0x58a8f7[_0xee34('0x34')][_0xee34('0x1d')]);_0x366f55[_0xee34('0x1b')]=qs['offset'](_0x58a8f7[_0xee34('0x34')][_0xee34('0x1b')]);}_0x366f55[_0xee34('0x39')]=qs[_0xee34('0x3a')](_0x58a8f7[_0xee34('0x34')][_0xee34('0x3a')]);_0x366f55['where']=qs[_0xee34('0x31')](_[_0xee34('0x3b')](_0x58a8f7[_0xee34('0x34')],_0x4f7379['filters']),_0xf7e635);if(_0x58a8f7['query'][_0xee34('0x3c')]){_0x366f55[_0xee34('0x3d')]=_[_0xee34('0x3e')](_0x366f55[_0xee34('0x3d')],{'$or':_[_0xee34('0x2b')](_0xf7e635,function(_0x859b26){if(_0x859b26[_0xee34('0x2e')]!==_0xee34('0x3f')){var _0x285c4d={};_0x285c4d[_0x859b26[_0xee34('0x28')]]={'$like':'%'+_0x58a8f7['query'][_0xee34('0x3c')]+'%'};return _0x285c4d;}})});}_0x366f55=_[_0xee34('0x3e')]({},_0x366f55,_0x58a8f7['options']);var _0x13509d={'where':_0x366f55['where']};return db[_0xee34('0x2c')][_0xee34('0x1c')](_0x13509d)[_0xee34('0x22')](function(_0x29badd){_0x462be1['count']=_0x29badd;if(_0x58a8f7[_0xee34('0x34')]['includeAll']){_0x366f55['include']=[{'all':!![]}];}return db[_0xee34('0x2c')][_0xee34('0x40')](_0x366f55);})[_0xee34('0x22')](function(_0x2c110f){_0x462be1[_0xee34('0x41')]=_0x2c110f;return _0x462be1;})['then'](respondWithFilteredResult(_0x4cb798,_0x366f55))[_0xee34('0x42')](handleError(_0x4cb798,null));};exports['show']=function(_0x13584d,_0x5411dc){var _0x4272b4={'raw':!![],'where':{'id':_0x13584d[_0xee34('0x43')]['id']}},_0x42d5e7={};_0x42d5e7[_0xee34('0x2f')]=_[_0xee34('0x30')](db[_0xee34('0x2c')]['rawAttributes']);_0x42d5e7[_0xee34('0x34')]=_[_0xee34('0x30')](_0x13584d[_0xee34('0x34')]);_0x42d5e7[_0xee34('0x31')]=_[_0xee34('0x32')](_0x42d5e7[_0xee34('0x2f')],_0x42d5e7[_0xee34('0x34')]);_0x4272b4['attributes']=_[_0xee34('0x32')](_0x42d5e7[_0xee34('0x2f')],qs[_0xee34('0x33')](_0x13584d[_0xee34('0x34')]['fields']));_0x4272b4[_0xee34('0x35')]=_0x4272b4[_0xee34('0x35')][_0xee34('0x36')]?_0x4272b4[_0xee34('0x35')]:_0x42d5e7[_0xee34('0x2f')];if(_0x13584d[_0xee34('0x34')][_0xee34('0x44')]){_0x4272b4[_0xee34('0x45')]=[{'all':!![]}];}_0x4272b4=_[_0xee34('0x3e')]({},_0x4272b4,_0x13584d[_0xee34('0x46')]);return db[_0xee34('0x2c')]['find'](_0x4272b4)[_0xee34('0x22')](handleEntityNotFound(_0x5411dc,null))[_0xee34('0x22')](respondWithResult(_0x5411dc,null))['catch'](handleError(_0x5411dc,null));};exports['create']=function(_0x25bd43,_0x30110f){return db[_0xee34('0x2c')][_0xee34('0x47')](_0x25bd43[_0xee34('0x48')],{})[_0xee34('0x22')](function(_0x56166b){var _0x2da614=_0x25bd43[_0xee34('0x49')][_0xee34('0x23')]({'plain':!![]});if(!_0x2da614)throw new Error(_0xee34('0x4a'));if(_0x2da614[_0xee34('0x4b')]==='user'){var _0x4fba18=_0x56166b[_0xee34('0x23')]({'plain':!![]});var _0x274916=_0xee34('0x24');return db[_0xee34('0x4c')][_0xee34('0x4d')]({'where':{'name':_0x274916,'userProfileId':_0x2da614['userProfileId']},'raw':!![]})[_0xee34('0x22')](function(_0x57258c){if(_0x57258c&&_0x57258c[_0xee34('0x4e')]===0x0){return db[_0xee34('0x25')][_0xee34('0x47')]({'name':_0x4fba18[_0xee34('0x28')],'resourceId':_0x4fba18['id'],'type':_0x57258c[_0xee34('0x28')],'sectionId':_0x57258c['id']},{})['then'](function(){return _0x56166b;});}else{return _0x56166b;}})[_0xee34('0x42')](function(_0x38419f){logger[_0xee34('0x4f')](_0xee34('0x50'),_0x38419f);throw _0x38419f;});}return _0x56166b;})[_0xee34('0x22')](respondWithResult(_0x30110f,0xc9))[_0xee34('0x42')](handleError(_0x30110f,null));};exports['update']=function(_0x34869f,_0x3247ed){if(_0x34869f[_0xee34('0x48')]['id']){delete _0x34869f[_0xee34('0x48')]['id'];}return db[_0xee34('0x2c')][_0xee34('0x4d')]({'where':{'id':_0x34869f[_0xee34('0x43')]['id']}})['then'](handleEntityNotFound(_0x3247ed,null))[_0xee34('0x22')](saveUpdates(_0x34869f['body'],null))[_0xee34('0x22')](respondWithResult(_0x3247ed,null))[_0xee34('0x42')](handleError(_0x3247ed,null));};exports['destroy']=function(_0x2e2660,_0xdb199){return db[_0xee34('0x2c')][_0xee34('0x4d')]({'where':{'id':_0x2e2660[_0xee34('0x43')]['id']}})['then'](handleEntityNotFound(_0xdb199,null))[_0xee34('0x22')](removeEntity(_0xdb199,null))[_0xee34('0x42')](handleError(_0xdb199,null));};exports['download']=function(_0x1e09b7,_0x3a32cb,_0x44c528){return db['AnalyticExtractedReport'][_0xee34('0x4d')]({'where':{'id':_0x1e09b7[_0xee34('0x43')]['id']},'attributes':[_0xee34('0x28'),_0xee34('0x51'),'savename',_0xee34('0x52')],'raw':!![]})[_0xee34('0x22')](handleEntityNotFound(_0x3a32cb,null))[_0xee34('0x22')](function(_0x42a60d){if(_0x42a60d){if(!fs[_0xee34('0x53')](path[_0xee34('0x54')](config[_0xee34('0x55')],_0xee34('0x56'),_0x42a60d['savename']))){throw new db[(_0xee34('0x57'))][(_0xee34('0x58'))](_0xee34('0x59'));}if(_0x1e09b7[_0xee34('0x34')][_0xee34('0x5a')]){return _0x3a32cb[_0xee34('0x17')](0xc8);}return _0x3a32cb['download'](path[_0xee34('0x54')](config[_0xee34('0x55')],'server/files/reports',_0x42a60d[_0xee34('0x5b')]),util[_0xee34('0x5c')]('%s.%s',_0x42a60d[_0xee34('0x51')]||_0x42a60d[_0xee34('0x28')],_0x42a60d[_0xee34('0x52')]['toLowerCase']()));}})['catch'](handleError(_0x3a32cb,null));}; \ No newline at end of file +var _0xaf6f=['then','ExtractedReports','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','show','params','fields','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','download','basename','savename','output','join','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','toLowerCase','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xaf6f,0xf0));var _0xfaf6=function(_0x167d8a,_0xaa5f76){_0x167d8a=_0x167d8a-0x0;var _0x4966bd=_0xaf6f[_0x167d8a];return _0x4966bd;};'use strict';var emlformat=require(_0xfaf6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfaf6('0x1'));var rp=require(_0xfaf6('0x2'));var moment=require(_0xfaf6('0x3'));var BPromise=require(_0xfaf6('0x4'));var Mustache=require(_0xfaf6('0x5'));var util=require(_0xfaf6('0x6'));var path=require(_0xfaf6('0x7'));var sox=require(_0xfaf6('0x8'));var csv=require('to-csv');var ejs=require(_0xfaf6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfaf6('0xa'));var crypto=require('crypto');var jsforce=require(_0xfaf6('0xb'));var deskjs=require(_0xfaf6('0xc'));var toCsv=require(_0xfaf6('0xd'));var querystring=require(_0xfaf6('0xe'));var Papa=require(_0xfaf6('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfaf6('0x10'));var as=require(_0xfaf6('0x11'));var hardwareService=require(_0xfaf6('0x12'));var logger=require(_0xfaf6('0x13'))(_0xfaf6('0x14'));var utils=require('../../config/utils');var config=require(_0xfaf6('0x15'));var licenseUtil=require(_0xfaf6('0x16'));var db=require(_0xfaf6('0x17'))['db'];function respondWithStatusCode(_0x20505d,_0x453f5d){_0x453f5d=_0x453f5d||0xcc;return function(_0x53518e){if(_0x53518e){return _0x20505d['sendStatus'](_0x453f5d);}return _0x20505d[_0xfaf6('0x18')](_0x453f5d)[_0xfaf6('0x19')]();};}function respondWithResult(_0x16f43d,_0x13f4a7){_0x13f4a7=_0x13f4a7||0xc8;return function(_0x399a46){if(_0x399a46){return _0x16f43d['status'](_0x13f4a7)[_0xfaf6('0x1a')](_0x399a46);}};}function respondWithFilteredResult(_0x5265c8,_0x32d6cf){return function(_0x29d5dc){if(_0x29d5dc){var _0x4a6647=typeof _0x32d6cf[_0xfaf6('0x1b')]===_0xfaf6('0x1c')&&typeof _0x32d6cf[_0xfaf6('0x1d')]===_0xfaf6('0x1c');var _0x15f692=_0x29d5dc['count'];var _0x2529bc=_0x4a6647?0x0:_0x32d6cf['offset'];var _0xa0930b=_0x4a6647?_0x29d5dc[_0xfaf6('0x1e')]:_0x32d6cf[_0xfaf6('0x1b')]+_0x32d6cf['limit'];var _0xcaaaa;if(_0xa0930b>=_0x15f692){_0xa0930b=_0x15f692;_0xcaaaa=0xc8;}else{_0xcaaaa=0xce;}_0x5265c8[_0xfaf6('0x18')](_0xcaaaa);return _0x5265c8['set'](_0xfaf6('0x1f'),_0x2529bc+'-'+_0xa0930b+'/'+_0x15f692)[_0xfaf6('0x1a')](_0x29d5dc);}return null;};}function patchUpdates(_0x2081d8){return function(_0x3b4149){try{jsonpatch[_0xfaf6('0x20')](_0x3b4149,_0x2081d8,!![]);}catch(_0xd5be6){return BPromise[_0xfaf6('0x21')](_0xd5be6);}return _0x3b4149[_0xfaf6('0x22')]();};}function saveUpdates(_0x3b8be0,_0x17057b){return function(_0xf18018){if(_0xf18018){return _0xf18018[_0xfaf6('0x23')](_0x3b8be0)[_0xfaf6('0x24')](function(_0x179305){return _0x179305;});}return null;};}function removeEntity(_0x573538,_0x332a7d){return function(_0x410087){if(_0x410087){return _0x410087['destroy']()[_0xfaf6('0x24')](function(){var _0x2f2ed=_0x410087['get']({'plain':!![]});var _0x3c20e5=_0xfaf6('0x25');return db[_0xfaf6('0x26')][_0xfaf6('0x27')]({'where':{'type':_0x3c20e5,'resourceId':_0x2f2ed['id']}})[_0xfaf6('0x24')](function(){return _0x410087;});})[_0xfaf6('0x24')](function(){_0x573538[_0xfaf6('0x18')](0xcc)[_0xfaf6('0x19')]();});}};}function handleEntityNotFound(_0x3c768b,_0xef7b51){return function(_0xd95bb7){if(!_0xd95bb7){_0x3c768b[_0xfaf6('0x28')](0x194);}return _0xd95bb7;};}function handleError(_0x42aff1,_0x5a2a23){_0x5a2a23=_0x5a2a23||0x1f4;return function(_0x19f6fb){logger['error'](_0x19f6fb[_0xfaf6('0x29')]);if(_0x19f6fb[_0xfaf6('0x2a')]){delete _0x19f6fb[_0xfaf6('0x2a')];}_0x42aff1[_0xfaf6('0x18')](_0x5a2a23)[_0xfaf6('0x2b')](_0x19f6fb);};}exports[_0xfaf6('0x2c')]=function(_0xd6b0f5,_0x1a1522){var _0x373349={},_0x2f1fee={},_0x3bf05e={'count':0x0,'rows':[]};var _0x2065fb=_[_0xfaf6('0x2d')](db[_0xfaf6('0x2e')][_0xfaf6('0x2f')],function(_0x537971){return{'name':_0x537971[_0xfaf6('0x30')],'type':_0x537971[_0xfaf6('0x31')]['key']};});_0x2f1fee[_0xfaf6('0x32')]=_[_0xfaf6('0x2d')](_0x2065fb,_0xfaf6('0x2a'));_0x2f1fee[_0xfaf6('0x33')]=_[_0xfaf6('0x34')](_0xd6b0f5[_0xfaf6('0x33')]);_0x2f1fee['filters']=_[_0xfaf6('0x35')](_0x2f1fee['model'],_0x2f1fee[_0xfaf6('0x33')]);_0x373349[_0xfaf6('0x36')]=_[_0xfaf6('0x35')](_0x2f1fee[_0xfaf6('0x32')],qs['fields'](_0xd6b0f5['query']['fields']));_0x373349[_0xfaf6('0x36')]=_0x373349['attributes']['length']?_0x373349[_0xfaf6('0x36')]:_0x2f1fee[_0xfaf6('0x32')];if(!_0xd6b0f5[_0xfaf6('0x33')][_0xfaf6('0x37')](_0xfaf6('0x38'))){_0x373349[_0xfaf6('0x1d')]=qs[_0xfaf6('0x1d')](_0xd6b0f5['query'][_0xfaf6('0x1d')]);_0x373349[_0xfaf6('0x1b')]=qs[_0xfaf6('0x1b')](_0xd6b0f5[_0xfaf6('0x33')][_0xfaf6('0x1b')]);}_0x373349[_0xfaf6('0x39')]=qs['sort'](_0xd6b0f5[_0xfaf6('0x33')][_0xfaf6('0x3a')]);_0x373349[_0xfaf6('0x3b')]=qs[_0xfaf6('0x3c')](_['pick'](_0xd6b0f5[_0xfaf6('0x33')],_0x2f1fee[_0xfaf6('0x3c')]),_0x2065fb);if(_0xd6b0f5['query'][_0xfaf6('0x3d')]){_0x373349['where']=_[_0xfaf6('0x3e')](_0x373349[_0xfaf6('0x3b')],{'$or':_['map'](_0x2065fb,function(_0x588b01){if(_0x588b01[_0xfaf6('0x31')]!==_0xfaf6('0x3f')){var _0x14a805={};_0x14a805[_0x588b01[_0xfaf6('0x2a')]]={'$like':'%'+_0xd6b0f5[_0xfaf6('0x33')][_0xfaf6('0x3d')]+'%'};return _0x14a805;}})});}_0x373349=_['merge']({},_0x373349,_0xd6b0f5[_0xfaf6('0x40')]);var _0x381a27={'where':_0x373349[_0xfaf6('0x3b')]};return db[_0xfaf6('0x2e')][_0xfaf6('0x1e')](_0x381a27)[_0xfaf6('0x24')](function(_0x1e8988){_0x3bf05e[_0xfaf6('0x1e')]=_0x1e8988;if(_0xd6b0f5[_0xfaf6('0x33')][_0xfaf6('0x41')]){_0x373349[_0xfaf6('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x373349);})[_0xfaf6('0x24')](function(_0x4db32b){_0x3bf05e['rows']=_0x4db32b;return _0x3bf05e;})[_0xfaf6('0x24')](respondWithFilteredResult(_0x1a1522,_0x373349))['catch'](handleError(_0x1a1522,null));};exports[_0xfaf6('0x43')]=function(_0x3e1442,_0x2266e9){var _0x1c6862={'raw':!![],'where':{'id':_0x3e1442[_0xfaf6('0x44')]['id']}},_0x3034c6={};_0x3034c6[_0xfaf6('0x32')]=_[_0xfaf6('0x34')](db[_0xfaf6('0x2e')][_0xfaf6('0x2f')]);_0x3034c6['query']=_[_0xfaf6('0x34')](_0x3e1442[_0xfaf6('0x33')]);_0x3034c6[_0xfaf6('0x3c')]=_[_0xfaf6('0x35')](_0x3034c6[_0xfaf6('0x32')],_0x3034c6[_0xfaf6('0x33')]);_0x1c6862[_0xfaf6('0x36')]=_[_0xfaf6('0x35')](_0x3034c6[_0xfaf6('0x32')],qs[_0xfaf6('0x45')](_0x3e1442['query'][_0xfaf6('0x45')]));_0x1c6862[_0xfaf6('0x36')]=_0x1c6862[_0xfaf6('0x36')]['length']?_0x1c6862[_0xfaf6('0x36')]:_0x3034c6[_0xfaf6('0x32')];if(_0x3e1442[_0xfaf6('0x33')][_0xfaf6('0x41')]){_0x1c6862['include']=[{'all':!![]}];}_0x1c6862=_['merge']({},_0x1c6862,_0x3e1442[_0xfaf6('0x40')]);return db['AnalyticExtractedReport']['find'](_0x1c6862)[_0xfaf6('0x24')](handleEntityNotFound(_0x2266e9,null))[_0xfaf6('0x24')](respondWithResult(_0x2266e9,null))[_0xfaf6('0x46')](handleError(_0x2266e9,null));};exports['create']=function(_0xbb7979,_0x2b2c44){return db[_0xfaf6('0x2e')][_0xfaf6('0x47')](_0xbb7979[_0xfaf6('0x48')],{})[_0xfaf6('0x24')](function(_0x5b64fd){var _0x3d01bf=_0xbb7979[_0xfaf6('0x49')][_0xfaf6('0x4a')]({'plain':!![]});if(!_0x3d01bf)throw new Error(_0xfaf6('0x4b'));if(_0x3d01bf[_0xfaf6('0x4c')]===_0xfaf6('0x49')){var _0x38606d=_0x5b64fd[_0xfaf6('0x4a')]({'plain':!![]});var _0xf1c8f5=_0xfaf6('0x25');return db[_0xfaf6('0x4d')][_0xfaf6('0x4e')]({'where':{'name':_0xf1c8f5,'userProfileId':_0x3d01bf[_0xfaf6('0x4f')]},'raw':!![]})['then'](function(_0x3c29d2){if(_0x3c29d2&&_0x3c29d2['autoAssociation']===0x0){return db[_0xfaf6('0x26')][_0xfaf6('0x47')]({'name':_0x38606d[_0xfaf6('0x2a')],'resourceId':_0x38606d['id'],'type':_0x3c29d2[_0xfaf6('0x2a')],'sectionId':_0x3c29d2['id']},{})[_0xfaf6('0x24')](function(){return _0x5b64fd;});}else{return _0x5b64fd;}})[_0xfaf6('0x46')](function(_0x439ac4){logger[_0xfaf6('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x439ac4);throw _0x439ac4;});}return _0x5b64fd;})[_0xfaf6('0x24')](respondWithResult(_0x2b2c44,0xc9))['catch'](handleError(_0x2b2c44,null));};exports['update']=function(_0x13cef8,_0x4dc5ff){if(_0x13cef8[_0xfaf6('0x48')]['id']){delete _0x13cef8[_0xfaf6('0x48')]['id'];}return db[_0xfaf6('0x2e')]['find']({'where':{'id':_0x13cef8[_0xfaf6('0x44')]['id']}})[_0xfaf6('0x24')](handleEntityNotFound(_0x4dc5ff,null))[_0xfaf6('0x24')](saveUpdates(_0x13cef8[_0xfaf6('0x48')],null))[_0xfaf6('0x24')](respondWithResult(_0x4dc5ff,null))['catch'](handleError(_0x4dc5ff,null));};exports[_0xfaf6('0x27')]=function(_0x64b922,_0x1163f2){return db[_0xfaf6('0x2e')]['find']({'where':{'id':_0x64b922[_0xfaf6('0x44')]['id']}})[_0xfaf6('0x24')](handleEntityNotFound(_0x1163f2,null))['then'](removeEntity(_0x1163f2,null))[_0xfaf6('0x46')](handleError(_0x1163f2,null));};exports[_0xfaf6('0x51')]=function(_0x599a8a,_0x4ab925,_0x4e58d1){return db[_0xfaf6('0x2e')]['find']({'where':{'id':_0x599a8a[_0xfaf6('0x44')]['id']},'attributes':[_0xfaf6('0x2a'),_0xfaf6('0x52'),_0xfaf6('0x53'),_0xfaf6('0x54')],'raw':!![]})[_0xfaf6('0x24')](handleEntityNotFound(_0x4ab925,null))['then'](function(_0x21cf61){if(_0x21cf61){if(!fs['existsSync'](path[_0xfaf6('0x55')](config['root'],_0xfaf6('0x56'),_0x21cf61['savename']))){throw new db['Sequelize'][(_0xfaf6('0x57'))](_0xfaf6('0x58'));}if(_0x599a8a[_0xfaf6('0x33')][_0xfaf6('0x59')]){return _0x4ab925[_0xfaf6('0x28')](0xc8);}return _0x4ab925[_0xfaf6('0x51')](path[_0xfaf6('0x55')](config[_0xfaf6('0x5a')],_0xfaf6('0x56'),_0x21cf61[_0xfaf6('0x53')]),util['format']('%s.%s',_0x21cf61['basename']||_0x21cf61[_0xfaf6('0x2a')],_0x21cf61[_0xfaf6('0x54')][_0xfaf6('0x5b')]()));}})['catch'](handleError(_0x4ab925,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 21ea3b5..4cb9a74 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 _0x2abe=['request-promise','path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger','moment'];(function(_0x4b64fe,_0x71b2a4){var _0x288459=function(_0x3674ed){while(--_0x3674ed){_0x4b64fe['push'](_0x4b64fe['shift']());}};_0x288459(++_0x71b2a4);}(_0x2abe,0x1de));var _0xe2ab=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x2abe[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe2ab('0x0'))('api');var moment=require(_0xe2ab('0x1'));var BPromise=require('bluebird');var rp=require(_0xe2ab('0x2'));var fs=require('fs');var path=require(_0xe2ab('0x3'));var rimraf=require(_0xe2ab('0x4'));var config=require(_0xe2ab('0x5'));var attributes=require('./analyticExtractedReport.attributes');module[_0xe2ab('0x6')]=function(_0x51213c,_0x50a737){return _0x51213c[_0xe2ab('0x7')](_0xe2ab('0x8'),attributes,{'tableName':_0xe2ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ca0=['lodash','util','path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x1ed9be,_0x151e74){var _0x2a2d3e=function(_0x5bd462){while(--_0x5bd462){_0x1ed9be['push'](_0x1ed9be['shift']());}};_0x2a2d3e(++_0x151e74);}(_0x3ca0,0x1d4));var _0x03ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ca0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x03ca('0x0'));var util=require(_0x03ca('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x03ca('0x2'));var rimraf=require(_0x03ca('0x3'));var config=require(_0x03ca('0x4'));var attributes=require('./analyticExtractedReport.attributes');module[_0x03ca('0x5')]=function(_0x2719e1,_0x5ccb5e){return _0x2719e1[_0x03ca('0x6')](_0x03ca('0x7'),attributes,{'tableName':_0x03ca('0x8'),'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 9611335..d107028 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 _0xff3c=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','lodash'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0xff3c,0x1a3));var _0xcff3=function(_0x16e5d2,_0x177de9){_0x16e5d2=_0x16e5d2-0x0;var _0x442a3b=_0xff3c[_0x16e5d2];return _0x442a3b;};'use strict';var _=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var moment=require(_0xcff3('0x2'));var BPromise=require('bluebird');var rs=require(_0xcff3('0x3'));var fs=require('fs');var Redis=require(_0xcff3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcff3('0x5'));var logger=require(_0xcff3('0x6'))(_0xcff3('0x7'));var config=require(_0xcff3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcff3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a8f9e,_0x4c2ba5,_0x1e290a){return new BPromise(function(_0x335e62,_0x14aa53){return client['request'](_0x2a8f9e,_0x1e290a)['then'](function(_0x483b81){logger[_0xcff3('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4c2ba5,_0xcff3('0xb'));logger[_0xcff3('0xc')](_0xcff3('0xd'),_0x4c2ba5,_0xcff3('0xb'),JSON[_0xcff3('0xe')](_0x483b81));if(_0x483b81['error']){if(_0x483b81[_0xcff3('0xf')][_0xcff3('0x10')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4c2ba5,_0x483b81[_0xcff3('0xf')][_0xcff3('0x11')]);return _0x14aa53(_0x483b81[_0xcff3('0xf')][_0xcff3('0x11')]);}logger['error'](_0xcff3('0x12'),_0x4c2ba5,_0x483b81[_0xcff3('0xf')]['message']);return _0x335e62(_0x483b81[_0xcff3('0xf')][_0xcff3('0x11')]);}else{logger[_0xcff3('0xa')](_0xcff3('0x12'),_0x4c2ba5,_0xcff3('0xb'));_0x335e62(_0x483b81[_0xcff3('0x13')]['message']);}})[_0xcff3('0x14')](function(_0x419f08){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4c2ba5,_0x419f08);_0x14aa53(_0x419f08);});});} \ No newline at end of file +var _0x8a85=['then','info','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x27e8ef,_0x42221b){var _0xff983=function(_0xa982ab){while(--_0xa982ab){_0x27e8ef['push'](_0x27e8ef['shift']());}};_0xff983(++_0x42221b);}(_0x8a85,0x64));var _0x58a8=function(_0x34f637,_0x2c9398){_0x34f637=_0x34f637-0x0;var _0x290fb3=_0x8a85[_0x34f637];return _0x290fb3;};'use strict';var _=require('lodash');var util=require(_0x58a8('0x0'));var moment=require('moment');var BPromise=require(_0x58a8('0x1'));var rs=require(_0x58a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x58a8('0x3'));var logger=require(_0x58a8('0x4'))(_0x58a8('0x5'));var config=require(_0x58a8('0x6'));var jayson=require(_0x58a8('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b35d4,_0x17824c,_0x32f0d3){return new BPromise(function(_0x474aac,_0x1aceb1){return client['request'](_0x2b35d4,_0x32f0d3)[_0x58a8('0x8')](function(_0x427f42){logger[_0x58a8('0x9')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x17824c,'request\x20sent');logger['debug'](_0x58a8('0xa'),_0x17824c,_0x58a8('0xb'),JSON[_0x58a8('0xc')](_0x427f42));if(_0x427f42[_0x58a8('0xd')]){if(_0x427f42[_0x58a8('0xd')][_0x58a8('0xe')]===0x1f4){logger[_0x58a8('0xd')](_0x58a8('0xf'),_0x17824c,_0x427f42['error'][_0x58a8('0x10')]);return _0x1aceb1(_0x427f42[_0x58a8('0xd')][_0x58a8('0x10')]);}logger[_0x58a8('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x17824c,_0x427f42[_0x58a8('0xd')][_0x58a8('0x10')]);return _0x474aac(_0x427f42[_0x58a8('0xd')]['message']);}else{logger[_0x58a8('0x9')](_0x58a8('0xf'),_0x17824c,_0x58a8('0xb'));_0x474aac(_0x427f42[_0x58a8('0x11')][_0x58a8('0x10')]);}})['catch'](function(_0x1e45cf){logger['error'](_0x58a8('0xf'),_0x17824c,_0x1e45cf);_0x1aceb1(_0x1e45cf);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index c731513..7599882 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 _0x6eee=['fs-extra','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','create','/:id','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x35dd10,_0x1520b3){var _0xd5ea91=function(_0x35d9df){while(--_0x35d9df){_0x35dd10['push'](_0x35dd10['shift']());}};_0xd5ea91(++_0x1520b3);}(_0x6eee,0x161));var _0xe6ee=function(_0x2fbd1b,_0x248293){_0x2fbd1b=_0x2fbd1b-0x0;var _0x46b33f=_0x6eee[_0x2fbd1b];return _0x46b33f;};'use strict';var multer=require('multer');var util=require(_0xe6ee('0x0'));var path=require(_0xe6ee('0x1'));var timeout=require(_0xe6ee('0x2'));var express=require(_0xe6ee('0x3'));var router=express['Router']();var fs_extra=require(_0xe6ee('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe6ee('0x5'));var config=require('../../config/environment');var controller=require(_0xe6ee('0x6'));router[_0xe6ee('0x7')]('/',auth[_0xe6ee('0x8')](),controller[_0xe6ee('0x9')]);router[_0xe6ee('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xe6ee('0xa')]);router[_0xe6ee('0x7')](_0xe6ee('0xb'),auth[_0xe6ee('0x8')](),controller['download']);router['post']('/',auth[_0xe6ee('0x8')](),controller[_0xe6ee('0xc')]);router['put'](_0xe6ee('0xd'),auth[_0xe6ee('0x8')](),controller[_0xe6ee('0xe')]);router[_0xe6ee('0xf')](_0xe6ee('0xd'),auth['isAuthenticated'](),controller[_0xe6ee('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0dc2=['isAuthenticated','/:id','show','/:id/download','download','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticExtractedReport.controller','get'];(function(_0x3672b5,_0x3940bc){var _0x1679b5=function(_0xf609b6){while(--_0xf609b6){_0x3672b5['push'](_0x3672b5['shift']());}};_0x1679b5(++_0x3940bc);}(_0x0dc2,0x1d6));var _0x20dc=function(_0x566a51,_0x49f056){_0x566a51=_0x566a51-0x0;var _0x20f290=_0x0dc2[_0x566a51];return _0x20f290;};'use strict';var multer=require(_0x20dc('0x0'));var util=require(_0x20dc('0x1'));var path=require(_0x20dc('0x2'));var timeout=require(_0x20dc('0x3'));var express=require(_0x20dc('0x4'));var router=express[_0x20dc('0x5')]();var fs_extra=require(_0x20dc('0x6'));var auth=require(_0x20dc('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x20dc('0x8'));router[_0x20dc('0x9')]('/',auth[_0x20dc('0xa')](),controller['index']);router[_0x20dc('0x9')](_0x20dc('0xb'),auth[_0x20dc('0xa')](),controller[_0x20dc('0xc')]);router['get'](_0x20dc('0xd'),auth[_0x20dc('0xa')](),controller[_0x20dc('0xe')]);router['post']('/',auth[_0x20dc('0xa')](),controller[_0x20dc('0xf')]);router[_0x20dc('0x10')](_0x20dc('0xb'),auth[_0x20dc('0xa')](),controller[_0x20dc('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x20dc('0x12')]);module[_0x20dc('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 80d19f5..e5790ee 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 _0xbdba=['BOOLEAN','exports','STRING'];(function(_0x3ccc8b,_0x527f6e){var _0x457724=function(_0x324bab){while(--_0x324bab){_0x3ccc8b['push'](_0x3ccc8b['shift']());}};_0x457724(++_0x527f6e);}(_0xbdba,0x1ed));var _0xabdb=function(_0x4362c1,_0x32be76){_0x4362c1=_0x4362c1-0x0;var _0x5bf01c=_0xbdba[_0x4362c1];return _0x5bf01c;};'use strict';var Sequelize=require('sequelize');module[_0xabdb('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xabdb('0x1')]},'function':{'type':Sequelize[_0xabdb('0x1')]},'format':{'type':Sequelize[_0xabdb('0x1')]},'groupBy':{'type':Sequelize[_0xabdb('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xabdb('0x1')]},'custom':{'type':Sequelize[_0xabdb('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x2adc=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x2a1754,_0x1da35c){var _0x69221a=function(_0x20f852){while(--_0x20f852){_0x2a1754['push'](_0x2a1754['shift']());}};_0x69221a(++_0x1da35c);}(_0x2adc,0xac));var _0xc2ad=function(_0x80bece,_0x4189de){_0x80bece=_0x80bece-0x0;var _0x543bfe=_0x2adc[_0x80bece];return _0x543bfe;};'use strict';var Sequelize=require(_0xc2ad('0x0'));module[_0xc2ad('0x1')]={'field':{'type':Sequelize[_0xc2ad('0x2')]},'alias':{'type':Sequelize[_0xc2ad('0x3')]},'function':{'type':Sequelize[_0xc2ad('0x3')]},'format':{'type':Sequelize[_0xc2ad('0x3')]},'groupBy':{'type':Sequelize[_0xc2ad('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xc2ad('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 5d80edc..4234b14 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 _0x9370=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','options','where','includeAll','include','rows','catch','show','AnalyticFieldReport','fields','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','params','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2e8272,_0x1642ae){var _0x485393=function(_0x116f72){while(--_0x116f72){_0x2e8272['push'](_0x2e8272['shift']());}};_0x485393(++_0x1642ae);}(_0x9370,0x19d));var _0x0937=function(_0x385856,_0x4a2cb6){_0x385856=_0x385856-0x0;var _0x4e9864=_0x9370[_0x385856];return _0x4e9864;};'use strict';var emlformat=require(_0x0937('0x0'));var rimraf=require(_0x0937('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0937('0x2'));var rp=require(_0x0937('0x3'));var moment=require(_0x0937('0x4'));var BPromise=require(_0x0937('0x5'));var Mustache=require(_0x0937('0x6'));var util=require(_0x0937('0x7'));var path=require(_0x0937('0x8'));var sox=require(_0x0937('0x9'));var csv=require('to-csv');var ejs=require(_0x0937('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0937('0xb'));var squel=require(_0x0937('0xc'));var crypto=require(_0x0937('0xd'));var jsforce=require(_0x0937('0xe'));var deskjs=require(_0x0937('0xf'));var toCsv=require(_0x0937('0x10'));var querystring=require(_0x0937('0x11'));var Papa=require(_0x0937('0x12'));var Redis=require(_0x0937('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0937('0x14'));var as=require(_0x0937('0x15'));var hardwareService=require(_0x0937('0x16'));var logger=require('../../config/logger')(_0x0937('0x17'));var utils=require(_0x0937('0x18'));var config=require(_0x0937('0x19'));var licenseUtil=require(_0x0937('0x1a'));var db=require(_0x0937('0x1b'))['db'];function respondWithStatusCode(_0x260eda,_0x2937b4){_0x2937b4=_0x2937b4||0xcc;return function(_0x1c9015){if(_0x1c9015){return _0x260eda[_0x0937('0x1c')](_0x2937b4);}return _0x260eda['status'](_0x2937b4)['end']();};}function respondWithResult(_0x42478d,_0x42159a){_0x42159a=_0x42159a||0xc8;return function(_0x1bba78){if(_0x1bba78){return _0x42478d[_0x0937('0x1d')](_0x42159a)[_0x0937('0x1e')](_0x1bba78);}};}function respondWithFilteredResult(_0x4e6ed7,_0x560f54){return function(_0x270f38){if(_0x270f38){var _0x4bd15c=typeof _0x560f54[_0x0937('0x1f')]===_0x0937('0x20')&&typeof _0x560f54[_0x0937('0x21')]===_0x0937('0x20');var _0x22ba3a=_0x270f38[_0x0937('0x22')];var _0x1d9d45=_0x4bd15c?0x0:_0x560f54[_0x0937('0x1f')];var _0x562d64=_0x4bd15c?_0x270f38[_0x0937('0x22')]:_0x560f54[_0x0937('0x1f')]+_0x560f54[_0x0937('0x21')];var _0x1c7ed8;if(_0x562d64>=_0x22ba3a){_0x562d64=_0x22ba3a;_0x1c7ed8=0xc8;}else{_0x1c7ed8=0xce;}_0x4e6ed7['status'](_0x1c7ed8);return _0x4e6ed7['set'](_0x0937('0x23'),_0x1d9d45+'-'+_0x562d64+'/'+_0x22ba3a)[_0x0937('0x1e')](_0x270f38);}return null;};}function patchUpdates(_0xa5f73){return function(_0x45535f){try{jsonpatch[_0x0937('0x24')](_0x45535f,_0xa5f73,!![]);}catch(_0x337010){return BPromise[_0x0937('0x25')](_0x337010);}return _0x45535f['save']();};}function saveUpdates(_0x46dbf3,_0x33a1de){return function(_0x28b18f){if(_0x28b18f){return _0x28b18f[_0x0937('0x26')](_0x46dbf3)[_0x0937('0x27')](function(_0x1000b9){return _0x1000b9;});}return null;};}function removeEntity(_0x5a1f34,_0x29f5ab){return function(_0x2f321a){if(_0x2f321a){return _0x2f321a[_0x0937('0x28')]()[_0x0937('0x27')](function(){_0x5a1f34[_0x0937('0x1d')](0xcc)[_0x0937('0x29')]();});}};}function handleEntityNotFound(_0x22df0b,_0x261b70){return function(_0x14411b){if(!_0x14411b){_0x22df0b[_0x0937('0x1c')](0x194);}return _0x14411b;};}function handleError(_0x45cfac,_0x5b7206){_0x5b7206=_0x5b7206||0x1f4;return function(_0x2a4a09){logger[_0x0937('0x2a')](_0x2a4a09[_0x0937('0x2b')]);if(_0x2a4a09['name']){delete _0x2a4a09[_0x0937('0x2c')];}_0x45cfac['status'](_0x5b7206)[_0x0937('0x2d')](_0x2a4a09);};}exports[_0x0937('0x2e')]=function(_0x4e573b,_0x4d5272){var _0x2d7af7={},_0x18e153={},_0x135da9={'count':0x0,'rows':[]};var _0x2b1232=_[_0x0937('0x2f')](db['AnalyticFieldReport'][_0x0937('0x30')],function(_0x242925){return{'name':_0x242925[_0x0937('0x31')],'type':_0x242925[_0x0937('0x32')][_0x0937('0x33')]};});_0x18e153[_0x0937('0x34')]=_[_0x0937('0x2f')](_0x2b1232,_0x0937('0x2c'));_0x18e153[_0x0937('0x35')]=_[_0x0937('0x36')](_0x4e573b[_0x0937('0x35')]);_0x18e153['filters']=_[_0x0937('0x37')](_0x18e153[_0x0937('0x34')],_0x18e153[_0x0937('0x35')]);_0x2d7af7[_0x0937('0x38')]=_[_0x0937('0x37')](_0x18e153['model'],qs['fields'](_0x4e573b[_0x0937('0x35')]['fields']));_0x2d7af7[_0x0937('0x38')]=_0x2d7af7[_0x0937('0x38')][_0x0937('0x39')]?_0x2d7af7['attributes']:_0x18e153[_0x0937('0x34')];if(!_0x4e573b[_0x0937('0x35')][_0x0937('0x3a')](_0x0937('0x3b'))){_0x2d7af7[_0x0937('0x21')]=qs[_0x0937('0x21')](_0x4e573b[_0x0937('0x35')][_0x0937('0x21')]);_0x2d7af7['offset']=qs['offset'](_0x4e573b['query'][_0x0937('0x1f')]);}_0x2d7af7[_0x0937('0x3c')]=qs[_0x0937('0x3d')](_0x4e573b[_0x0937('0x35')][_0x0937('0x3d')]);_0x2d7af7['where']=qs[_0x0937('0x3e')](_[_0x0937('0x3f')](_0x4e573b[_0x0937('0x35')],_0x18e153[_0x0937('0x3e')]),_0x2b1232);if(_0x4e573b[_0x0937('0x35')][_0x0937('0x40')]){_0x2d7af7['where']=_[_0x0937('0x41')](_0x2d7af7['where'],{'$or':_[_0x0937('0x2f')](_0x2b1232,function(_0x378a7a){if(_0x378a7a[_0x0937('0x32')]!=='VIRTUAL'){var _0x167c98={};_0x167c98[_0x378a7a[_0x0937('0x2c')]]={'$like':'%'+_0x4e573b[_0x0937('0x35')][_0x0937('0x40')]+'%'};return _0x167c98;}})});}_0x2d7af7=_['merge']({},_0x2d7af7,_0x4e573b[_0x0937('0x42')]);var _0x473d1e={'where':_0x2d7af7[_0x0937('0x43')]};return db['AnalyticFieldReport'][_0x0937('0x22')](_0x473d1e)['then'](function(_0x1f0347){_0x135da9['count']=_0x1f0347;if(_0x4e573b[_0x0937('0x35')][_0x0937('0x44')]){_0x2d7af7[_0x0937('0x45')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x2d7af7);})[_0x0937('0x27')](function(_0x20d3af){_0x135da9[_0x0937('0x46')]=_0x20d3af;return _0x135da9;})[_0x0937('0x27')](respondWithFilteredResult(_0x4d5272,_0x2d7af7))[_0x0937('0x47')](handleError(_0x4d5272,null));};exports[_0x0937('0x48')]=function(_0x3a7e06,_0x3f18d2){var _0x57d1b8={'raw':![],'where':{'id':_0x3a7e06['params']['id']}},_0x2c8af8={};_0x2c8af8[_0x0937('0x34')]=_[_0x0937('0x36')](db[_0x0937('0x49')][_0x0937('0x30')]);_0x2c8af8[_0x0937('0x35')]=_['keys'](_0x3a7e06['query']);_0x2c8af8['filters']=_[_0x0937('0x37')](_0x2c8af8[_0x0937('0x34')],_0x2c8af8[_0x0937('0x35')]);_0x57d1b8[_0x0937('0x38')]=_[_0x0937('0x37')](_0x2c8af8[_0x0937('0x34')],qs['fields'](_0x3a7e06[_0x0937('0x35')][_0x0937('0x4a')]));_0x57d1b8[_0x0937('0x38')]=_0x57d1b8['attributes'][_0x0937('0x39')]?_0x57d1b8['attributes']:_0x2c8af8[_0x0937('0x34')];if(_0x3a7e06[_0x0937('0x35')][_0x0937('0x44')]){_0x57d1b8[_0x0937('0x45')]=[{'all':!![]}];}_0x57d1b8=_[_0x0937('0x41')]({},_0x57d1b8,_0x3a7e06[_0x0937('0x42')]);return db[_0x0937('0x49')][_0x0937('0x4b')](_0x57d1b8)[_0x0937('0x27')](handleEntityNotFound(_0x3f18d2,null))[_0x0937('0x27')](respondWithResult(_0x3f18d2,null))[_0x0937('0x47')](handleError(_0x3f18d2,null));};exports[_0x0937('0x4c')]=function(_0x2bfc88,_0x40a50d){return db['AnalyticFieldReport'][_0x0937('0x4c')](_0x2bfc88[_0x0937('0x4d')],{})[_0x0937('0x27')](respondWithResult(_0x40a50d,0xc9))['catch'](handleError(_0x40a50d,null));};exports[_0x0937('0x4e')]=function(_0x91cbe0,_0x4898f7){return db[_0x0937('0x49')]['bulkCreate'](_0x91cbe0[_0x0937('0x4d')],{'raw':![],'individualHooks':!![]})[_0x0937('0x27')](respondWithResult(_0x4898f7,0xc9))['catch'](handleError(_0x4898f7,null));};exports['update']=function(_0x3ab997,_0x2ccec0){if(_0x3ab997[_0x0937('0x4d')]['id']){delete _0x3ab997[_0x0937('0x4d')]['id'];}return db[_0x0937('0x49')][_0x0937('0x4b')]({'where':{'id':_0x3ab997['params']['id']}})['then'](handleEntityNotFound(_0x2ccec0,null))['then'](saveUpdates(_0x3ab997[_0x0937('0x4d')],null))[_0x0937('0x27')](respondWithResult(_0x2ccec0,null))[_0x0937('0x47')](handleError(_0x2ccec0,null));};exports['destroy']=function(_0x52716c,_0x5cd929){return db[_0x0937('0x49')][_0x0937('0x4b')]({'where':{'id':_0x52716c['params']['id']}})[_0x0937('0x27')](handleEntityNotFound(_0x5cd929,null))[_0x0937('0x27')](removeEntity(_0x5cd929,null))[_0x0937('0x47')](handleError(_0x5cd929,null));};exports[_0x0937('0x4f')]=function(_0x40765e,_0xcb3c05){return db[_0x0937('0x49')]['destroy']({'where':{'id':_0x40765e[_0x0937('0x35')][_0x0937('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0x0937('0x27')](respondWithResult(_0xcb3c05,0xcc))['catch'](handleError(_0xcb3c05,null));};exports[_0x0937('0x51')]=function(_0x11f96e,_0x3966f2,_0x536385){return db[_0x0937('0x52')]['findOne']({'where':{'id':_0x11f96e[_0x0937('0x53')]['id']}})[_0x0937('0x27')](handleEntityNotFound(_0x3966f2,null))[_0x0937('0x27')](function(_0x4002f4){if(_0x4002f4){return db[_0x0937('0x54')][_0x0937('0x55')](function(_0x5377e5){return db[_0x0937('0x49')][_0x0937('0x28')]({'where':{'CustomReportId':_0x11f96e[_0x0937('0x53')]['id']},'transaction':_0x5377e5})['then'](function(_0x571e02){var _0x5674f0=_[_0x0937('0x2f')](_0x11f96e[_0x0937('0x4d')],function(_0xcbc48){delete _0xcbc48['id'];_0xcbc48[_0x0937('0x56')]=_0x11f96e['params']['id'];return _0xcbc48;});return db[_0x0937('0x49')][_0x0937('0x4e')](_0x5674f0,{'transaction':_0x5377e5});});})['then'](function(){return db[_0x0937('0x49')][_0x0937('0x57')]({'where':{'CustomReportId':_0x11f96e[_0x0937('0x53')]['id']}});});}})['then'](respondWithResult(_0x3966f2,null))[_0x0937('0x47')](handleError(_0x3966f2,null));}; \ No newline at end of file +var _0x0633=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','end','error','stack','name','map','AnalyticFieldReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','bulkCreate','update','params','destroy','bulkDestroy','ids','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x4d0fdc,_0x3c4278){var _0x50015a=function(_0x3f97ac){while(--_0x3f97ac){_0x4d0fdc['push'](_0x4d0fdc['shift']());}};_0x50015a(++_0x3c4278);}(_0x0633,0x188));var _0x3063=function(_0x1767ac,_0x9d099c){_0x1767ac=_0x1767ac-0x0;var _0x24986c=_0x0633[_0x1767ac];return _0x24986c;};'use strict';var emlformat=require(_0x3063('0x0'));var rimraf=require(_0x3063('0x1'));var zipdir=require(_0x3063('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3063('0x3'));var BPromise=require(_0x3063('0x4'));var Mustache=require(_0x3063('0x5'));var util=require(_0x3063('0x6'));var path=require(_0x3063('0x7'));var sox=require(_0x3063('0x8'));var csv=require(_0x3063('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3063('0xa'));var _=require('lodash');var squel=require(_0x3063('0xb'));var crypto=require('crypto');var jsforce=require(_0x3063('0xc'));var deskjs=require(_0x3063('0xd'));var toCsv=require(_0x3063('0x9'));var querystring=require(_0x3063('0xe'));var Papa=require(_0x3063('0xf'));var Redis=require('ioredis');var authService=require(_0x3063('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3063('0x11'));var hardwareService=require(_0x3063('0x12'));var logger=require(_0x3063('0x13'))(_0x3063('0x14'));var utils=require(_0x3063('0x15'));var config=require(_0x3063('0x16'));var licenseUtil=require(_0x3063('0x17'));var db=require(_0x3063('0x18'))['db'];function respondWithStatusCode(_0x108f1e,_0x3234ea){_0x3234ea=_0x3234ea||0xcc;return function(_0x497925){if(_0x497925){return _0x108f1e[_0x3063('0x19')](_0x3234ea);}return _0x108f1e['status'](_0x3234ea)['end']();};}function respondWithResult(_0x419970,_0x1f7cab){_0x1f7cab=_0x1f7cab||0xc8;return function(_0xc0999a){if(_0xc0999a){return _0x419970[_0x3063('0x1a')](_0x1f7cab)[_0x3063('0x1b')](_0xc0999a);}};}function respondWithFilteredResult(_0x15d514,_0x446aaa){return function(_0x24348c){if(_0x24348c){var _0x2b86c3=typeof _0x446aaa[_0x3063('0x1c')]===_0x3063('0x1d')&&typeof _0x446aaa[_0x3063('0x1e')]===_0x3063('0x1d');var _0xa91a96=_0x24348c[_0x3063('0x1f')];var _0x550caa=_0x2b86c3?0x0:_0x446aaa[_0x3063('0x1c')];var _0x4f70ce=_0x2b86c3?_0x24348c[_0x3063('0x1f')]:_0x446aaa[_0x3063('0x1c')]+_0x446aaa['limit'];var _0x2d1f84;if(_0x4f70ce>=_0xa91a96){_0x4f70ce=_0xa91a96;_0x2d1f84=0xc8;}else{_0x2d1f84=0xce;}_0x15d514[_0x3063('0x1a')](_0x2d1f84);return _0x15d514[_0x3063('0x20')](_0x3063('0x21'),_0x550caa+'-'+_0x4f70ce+'/'+_0xa91a96)[_0x3063('0x1b')](_0x24348c);}return null;};}function patchUpdates(_0x195802){return function(_0x100669){try{jsonpatch[_0x3063('0x22')](_0x100669,_0x195802,!![]);}catch(_0x5d442f){return BPromise[_0x3063('0x23')](_0x5d442f);}return _0x100669['save']();};}function saveUpdates(_0x46fcae,_0x591870){return function(_0x522629){if(_0x522629){return _0x522629['update'](_0x46fcae)[_0x3063('0x24')](function(_0x428745){return _0x428745;});}return null;};}function removeEntity(_0xa23657,_0x48044a){return function(_0x5af250){if(_0x5af250){return _0x5af250['destroy']()[_0x3063('0x24')](function(){_0xa23657[_0x3063('0x1a')](0xcc)[_0x3063('0x25')]();});}};}function handleEntityNotFound(_0x4a8594,_0x550f10){return function(_0x4c0b9e){if(!_0x4c0b9e){_0x4a8594['sendStatus'](0x194);}return _0x4c0b9e;};}function handleError(_0x3ed4be,_0x5f0427){_0x5f0427=_0x5f0427||0x1f4;return function(_0x47c210){logger[_0x3063('0x26')](_0x47c210[_0x3063('0x27')]);if(_0x47c210['name']){delete _0x47c210[_0x3063('0x28')];}_0x3ed4be[_0x3063('0x1a')](_0x5f0427)['send'](_0x47c210);};}exports['index']=function(_0xa1d6ae,_0x540c78){var _0x2d6a18={},_0x18f800={},_0x3e5f1f={'count':0x0,'rows':[]};var _0x3a88b9=_[_0x3063('0x29')](db[_0x3063('0x2a')]['rawAttributes'],function(_0x1de5db){return{'name':_0x1de5db[_0x3063('0x2b')],'type':_0x1de5db[_0x3063('0x2c')][_0x3063('0x2d')]};});_0x18f800[_0x3063('0x2e')]=_[_0x3063('0x29')](_0x3a88b9,_0x3063('0x28'));_0x18f800['query']=_[_0x3063('0x2f')](_0xa1d6ae[_0x3063('0x30')]);_0x18f800[_0x3063('0x31')]=_[_0x3063('0x32')](_0x18f800[_0x3063('0x2e')],_0x18f800['query']);_0x2d6a18[_0x3063('0x33')]=_[_0x3063('0x32')](_0x18f800[_0x3063('0x2e')],qs[_0x3063('0x34')](_0xa1d6ae[_0x3063('0x30')][_0x3063('0x34')]));_0x2d6a18[_0x3063('0x33')]=_0x2d6a18[_0x3063('0x33')]['length']?_0x2d6a18['attributes']:_0x18f800['model'];if(!_0xa1d6ae[_0x3063('0x30')][_0x3063('0x35')](_0x3063('0x36'))){_0x2d6a18[_0x3063('0x1e')]=qs[_0x3063('0x1e')](_0xa1d6ae['query']['limit']);_0x2d6a18['offset']=qs[_0x3063('0x1c')](_0xa1d6ae[_0x3063('0x30')][_0x3063('0x1c')]);}_0x2d6a18[_0x3063('0x37')]=qs[_0x3063('0x38')](_0xa1d6ae[_0x3063('0x30')][_0x3063('0x38')]);_0x2d6a18[_0x3063('0x39')]=qs[_0x3063('0x31')](_[_0x3063('0x3a')](_0xa1d6ae[_0x3063('0x30')],_0x18f800['filters']),_0x3a88b9);if(_0xa1d6ae['query']['filter']){_0x2d6a18[_0x3063('0x39')]=_['merge'](_0x2d6a18['where'],{'$or':_[_0x3063('0x29')](_0x3a88b9,function(_0x23a821){if(_0x23a821[_0x3063('0x2c')]!==_0x3063('0x3b')){var _0x92b081={};_0x92b081[_0x23a821[_0x3063('0x28')]]={'$like':'%'+_0xa1d6ae[_0x3063('0x30')]['filter']+'%'};return _0x92b081;}})});}_0x2d6a18=_[_0x3063('0x3c')]({},_0x2d6a18,_0xa1d6ae[_0x3063('0x3d')]);var _0x9267bf={'where':_0x2d6a18[_0x3063('0x39')]};return db[_0x3063('0x2a')][_0x3063('0x1f')](_0x9267bf)[_0x3063('0x24')](function(_0x194600){_0x3e5f1f[_0x3063('0x1f')]=_0x194600;if(_0xa1d6ae[_0x3063('0x30')][_0x3063('0x3e')]){_0x2d6a18[_0x3063('0x3f')]=[{'all':!![]}];}return db[_0x3063('0x2a')][_0x3063('0x40')](_0x2d6a18);})[_0x3063('0x24')](function(_0x144288){_0x3e5f1f[_0x3063('0x41')]=_0x144288;return _0x3e5f1f;})[_0x3063('0x24')](respondWithFilteredResult(_0x540c78,_0x2d6a18))[_0x3063('0x42')](handleError(_0x540c78,null));};exports[_0x3063('0x43')]=function(_0x33722b,_0x5e8683){var _0x51e79d={'raw':![],'where':{'id':_0x33722b['params']['id']}},_0xbe5341={};_0xbe5341[_0x3063('0x2e')]=_[_0x3063('0x2f')](db['AnalyticFieldReport']['rawAttributes']);_0xbe5341['query']=_['keys'](_0x33722b[_0x3063('0x30')]);_0xbe5341[_0x3063('0x31')]=_[_0x3063('0x32')](_0xbe5341[_0x3063('0x2e')],_0xbe5341[_0x3063('0x30')]);_0x51e79d[_0x3063('0x33')]=_['intersection'](_0xbe5341[_0x3063('0x2e')],qs[_0x3063('0x34')](_0x33722b['query'][_0x3063('0x34')]));_0x51e79d['attributes']=_0x51e79d[_0x3063('0x33')][_0x3063('0x44')]?_0x51e79d[_0x3063('0x33')]:_0xbe5341[_0x3063('0x2e')];if(_0x33722b['query'][_0x3063('0x3e')]){_0x51e79d[_0x3063('0x3f')]=[{'all':!![]}];}_0x51e79d=_[_0x3063('0x3c')]({},_0x51e79d,_0x33722b[_0x3063('0x3d')]);return db[_0x3063('0x2a')][_0x3063('0x45')](_0x51e79d)['then'](handleEntityNotFound(_0x5e8683,null))['then'](respondWithResult(_0x5e8683,null))[_0x3063('0x42')](handleError(_0x5e8683,null));};exports[_0x3063('0x46')]=function(_0x2c0c03,_0x4ce1a6){return db[_0x3063('0x2a')][_0x3063('0x46')](_0x2c0c03[_0x3063('0x47')],{})['then'](respondWithResult(_0x4ce1a6,0xc9))[_0x3063('0x42')](handleError(_0x4ce1a6,null));};exports['bulkCreate']=function(_0x264e61,_0x463bf0){return db['AnalyticFieldReport'][_0x3063('0x48')](_0x264e61['body'],{'raw':![],'individualHooks':!![]})[_0x3063('0x24')](respondWithResult(_0x463bf0,0xc9))[_0x3063('0x42')](handleError(_0x463bf0,null));};exports[_0x3063('0x49')]=function(_0x5ddb6d,_0x505a45){if(_0x5ddb6d['body']['id']){delete _0x5ddb6d['body']['id'];}return db['AnalyticFieldReport'][_0x3063('0x45')]({'where':{'id':_0x5ddb6d[_0x3063('0x4a')]['id']}})[_0x3063('0x24')](handleEntityNotFound(_0x505a45,null))['then'](saveUpdates(_0x5ddb6d['body'],null))[_0x3063('0x24')](respondWithResult(_0x505a45,null))[_0x3063('0x42')](handleError(_0x505a45,null));};exports[_0x3063('0x4b')]=function(_0x117361,_0x47902b){return db[_0x3063('0x2a')]['find']({'where':{'id':_0x117361[_0x3063('0x4a')]['id']}})[_0x3063('0x24')](handleEntityNotFound(_0x47902b,null))[_0x3063('0x24')](removeEntity(_0x47902b,null))['catch'](handleError(_0x47902b,null));};exports[_0x3063('0x4c')]=function(_0x2777bd,_0x4964e9){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x2777bd[_0x3063('0x30')][_0x3063('0x4d')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4964e9,0xcc))[_0x3063('0x42')](handleError(_0x4964e9,null));};exports['addFields']=function(_0x1234dc,_0x39946a,_0x5440b5){return db['AnalyticCustomReport'][_0x3063('0x4e')]({'where':{'id':_0x1234dc[_0x3063('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39946a,null))[_0x3063('0x24')](function(_0x379348){if(_0x379348){return db[_0x3063('0x4f')][_0x3063('0x50')](function(_0x3127f8){return db[_0x3063('0x2a')][_0x3063('0x4b')]({'where':{'CustomReportId':_0x1234dc['params']['id']},'transaction':_0x3127f8})[_0x3063('0x24')](function(_0x20bfd0){var _0x145dd5=_[_0x3063('0x29')](_0x1234dc[_0x3063('0x47')],function(_0x4aae99){delete _0x4aae99['id'];_0x4aae99[_0x3063('0x51')]=_0x1234dc[_0x3063('0x4a')]['id'];return _0x4aae99;});return db[_0x3063('0x2a')][_0x3063('0x48')](_0x145dd5,{'transaction':_0x3127f8});});})[_0x3063('0x24')](function(){return db['AnalyticFieldReport'][_0x3063('0x40')]({'where':{'CustomReportId':_0x1234dc[_0x3063('0x4a')]['id']}});});}})[_0x3063('0x24')](respondWithResult(_0x39946a,null))[_0x3063('0x42')](handleError(_0x39946a,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 545e3bc..1792e36 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 _0x91d3=['moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x5d349e,_0x1a5bca){var _0x4eddbb=function(_0x4dc55e){while(--_0x4dc55e){_0x5d349e['push'](_0x5d349e['shift']());}};_0x4eddbb(++_0x1a5bca);}(_0x91d3,0x128));var _0x391d=function(_0x66583d,_0x1f0b9f){_0x66583d=_0x66583d-0x0;var _0x59938f=_0x91d3[_0x66583d];return _0x59938f;};'use strict';var _=require(_0x391d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x391d('0x1'));var BPromise=require('bluebird');var rp=require(_0x391d('0x2'));var fs=require('fs');var path=require(_0x391d('0x3'));var rimraf=require(_0x391d('0x4'));var config=require(_0x391d('0x5'));var attributes=require(_0x391d('0x6'));module[_0x391d('0x7')]=function(_0xb8728a,_0x34e353){return _0xb8728a[_0x391d('0x8')](_0x391d('0x9'),attributes,{'tableName':_0x391d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d3b=['define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0xcf4569,_0x1ce755){var _0x7fef=function(_0x374ab8){while(--_0x374ab8){_0xcf4569['push'](_0xcf4569['shift']());}};_0x7fef(++_0x1ce755);}(_0x1d3b,0x161));var _0xb1d3=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x1d3b[_0x166d93];return _0xba708;};'use strict';var _=require(_0xb1d3('0x0'));var util=require('util');var logger=require(_0xb1d3('0x1'))(_0xb1d3('0x2'));var moment=require(_0xb1d3('0x3'));var BPromise=require(_0xb1d3('0x4'));var rp=require(_0xb1d3('0x5'));var fs=require('fs');var path=require(_0xb1d3('0x6'));var rimraf=require(_0xb1d3('0x7'));var config=require(_0xb1d3('0x8'));var attributes=require(_0xb1d3('0x9'));module[_0xb1d3('0xa')]=function(_0x2ef466,_0x522a6a){return _0x2ef466[_0xb1d3('0xb')](_0xb1d3('0xc'),attributes,{'tableName':_0xb1d3('0xd'),'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 fb2e566..d972501 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 _0x7802=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x2bb540,_0x22b447){var _0x43b9fe=function(_0x21c0cd){while(--_0x21c0cd){_0x2bb540['push'](_0x2bb540['shift']());}};_0x43b9fe(++_0x22b447);}(_0x7802,0x104));var _0x2780=function(_0x28c870,_0x1bf349){_0x28c870=_0x28c870-0x0;var _0x5e4de6=_0x7802[_0x28c870];return _0x5e4de6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2780('0x0'));var BPromise=require(_0x2780('0x1'));var rs=require(_0x2780('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2780('0x3'));var logger=require(_0x2780('0x4'))(_0x2780('0x5'));var config=require('../../config/environment');var jayson=require(_0x2780('0x6'));var client=jayson[_0x2780('0x7')][_0x2780('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42cd4d,_0x29205c,_0x41f8dc){return new BPromise(function(_0x4339b6,_0x5b1238){return client[_0x2780('0x9')](_0x42cd4d,_0x41f8dc)[_0x2780('0xa')](function(_0x305757){logger[_0x2780('0xb')](_0x2780('0xc'),_0x29205c,'request\x20sent');logger[_0x2780('0xd')](_0x2780('0xe'),_0x29205c,_0x2780('0xf'),JSON[_0x2780('0x10')](_0x305757));if(_0x305757[_0x2780('0x11')]){if(_0x305757[_0x2780('0x11')][_0x2780('0x12')]===0x1f4){logger[_0x2780('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x29205c,_0x305757[_0x2780('0x11')][_0x2780('0x13')]);return _0x5b1238(_0x305757['error'][_0x2780('0x13')]);}logger[_0x2780('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x29205c,_0x305757[_0x2780('0x11')]['message']);return _0x4339b6(_0x305757[_0x2780('0x11')]['message']);}else{logger[_0x2780('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x29205c,'request\x20sent');_0x4339b6(_0x305757[_0x2780('0x14')]['message']);}})[_0x2780('0x15')](function(_0x349386){logger[_0x2780('0x11')](_0x2780('0xc'),_0x29205c,_0x349386);_0x5b1238(_0x349386);});});} \ No newline at end of file +var _0x5813=['jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x5813,0x15e));var _0x3581=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5813[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x3581('0x0'));var util=require(_0x3581('0x1'));var moment=require(_0x3581('0x2'));var BPromise=require(_0x3581('0x3'));var rs=require(_0x3581('0x4'));var fs=require('fs');var Redis=require(_0x3581('0x5'));var db=require(_0x3581('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3581('0x7'))(_0x3581('0x8'));var config=require(_0x3581('0x9'));var jayson=require(_0x3581('0xa'));var client=jayson[_0x3581('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d1e99,_0x5dbb5d,_0x60883a){return new BPromise(function(_0x4a51f7,_0x195cb3){return client[_0x3581('0xc')](_0x5d1e99,_0x60883a)[_0x3581('0xd')](function(_0x53c3dc){logger[_0x3581('0xe')](_0x3581('0xf'),_0x5dbb5d,_0x3581('0x10'));logger[_0x3581('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5dbb5d,_0x3581('0x10'),JSON[_0x3581('0x12')](_0x53c3dc));if(_0x53c3dc[_0x3581('0x13')]){if(_0x53c3dc[_0x3581('0x13')][_0x3581('0x14')]===0x1f4){logger[_0x3581('0x13')](_0x3581('0xf'),_0x5dbb5d,_0x53c3dc['error'][_0x3581('0x15')]);return _0x195cb3(_0x53c3dc[_0x3581('0x13')]['message']);}logger[_0x3581('0x13')](_0x3581('0xf'),_0x5dbb5d,_0x53c3dc[_0x3581('0x13')][_0x3581('0x15')]);return _0x4a51f7(_0x53c3dc['error'][_0x3581('0x15')]);}else{logger['info'](_0x3581('0xf'),_0x5dbb5d,_0x3581('0x10'));_0x4a51f7(_0x53c3dc[_0x3581('0x16')]['message']);}})[_0x3581('0x17')](function(_0x1cfe82){logger[_0x3581('0x13')](_0x3581('0xf'),_0x5dbb5d,_0x1cfe82);_0x195cb3(_0x1cfe82);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index a93e420..198afb7 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(_0x11d5e2,_0x35997c){var _0x2823c7=function(_0x15402e){while(--_0x15402e){_0x11d5e2['push'](_0x11d5e2['shift']());}};_0x2823c7(++_0x35997c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x261696,_0x3b983f){var _0x212c87=function(_0x4c1354){while(--_0x4c1354){_0x261696['push'](_0x261696['shift']());}};_0x212c87(++_0x3b983f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 f3d33c8..a8dec3e 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 _0x7229=['STRING','name','sequelize','exports'];(function(_0x4b075e,_0x57874c){var _0x31385c=function(_0x3ab6ef){while(--_0x3ab6ef){_0x4b075e['push'](_0x4b075e['shift']());}};_0x31385c(++_0x57874c);}(_0x7229,0x76));var _0x9722=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x7229[_0x5783f4];return _0x28e380;};'use strict';var Sequelize=require(_0x9722('0x0'));module[_0x9722('0x1')]={'name':{'type':Sequelize[_0x9722('0x2')],'allowNull':![],'unique':_0x9722('0x3')},'table':{'type':Sequelize[_0x9722('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa4db=['TEXT','name','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa4db,0x139));var _0xba4d=function(_0x3e7332,_0x1c312c){_0x3e7332=_0x3e7332-0x0;var _0x3c9a8e=_0xa4db[_0x3e7332];return _0x3c9a8e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xba4d('0x0')},'table':{'type':Sequelize[_0xba4d('0x1')]},'metric':{'type':Sequelize[_0xba4d('0x2')]},'description':{'type':Sequelize[_0xba4d('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 86b3b96..3caae16 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 _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x4ff0b3,_0x34cc15){var _0x430487=function(_0x684f7){while(--_0x684f7){_0x4ff0b3['push'](_0x4ff0b3['shift']());}};_0x430487(++_0x34cc15);}(_0x81bd,0x7c));var _0xd81b=function(_0x19635f,_0x564859){_0x19635f=_0x19635f-0x0;var _0x482132=_0x81bd[_0x19635f];return _0x482132;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));}; \ No newline at end of file +var _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x330664,_0x352e40){var _0x398793=function(_0x441a1c){while(--_0x441a1c){_0x330664['push'](_0x330664['shift']());}};_0x398793(++_0x352e40);}(_0x8ef6,0xf2));var _0x68ef=function(_0x35c1b1,_0x5a85d6){_0x35c1b1=_0x35c1b1-0x0;var _0x4a3cf6=_0x8ef6[_0x35c1b1];return _0x4a3cf6;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 2365351..c50db35 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 _0xf2e0=['util','api','moment','request-promise','path','rimraf','./analyticMetric.attributes','exports','AnalyticMetric','lodash'];(function(_0x5bce14,_0x46fd0b){var _0x276eff=function(_0x467001){while(--_0x467001){_0x5bce14['push'](_0x5bce14['shift']());}};_0x276eff(++_0x46fd0b);}(_0xf2e0,0xc7));var _0x0f2e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xf2e0[_0x411add];return _0x238242;};'use strict';var _=require(_0x0f2e('0x0'));var util=require(_0x0f2e('0x1'));var logger=require('../../config/logger')(_0x0f2e('0x2'));var moment=require(_0x0f2e('0x3'));var BPromise=require('bluebird');var rp=require(_0x0f2e('0x4'));var fs=require('fs');var path=require(_0x0f2e('0x5'));var rimraf=require(_0x0f2e('0x6'));var config=require('../../config/environment');var attributes=require(_0x0f2e('0x7'));module[_0x0f2e('0x8')]=function(_0x256aba,_0x47c448){return _0x256aba['define'](_0x0f2e('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8403=['rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x8403,0x1a5));var _0x3840=function(_0xd22c68,_0x479348){_0xd22c68=_0xd22c68-0x0;var _0xfbbb42=_0x8403[_0xd22c68];return _0xfbbb42;};'use strict';var _=require(_0x3840('0x0'));var util=require(_0x3840('0x1'));var logger=require(_0x3840('0x2'))(_0x3840('0x3'));var moment=require(_0x3840('0x4'));var BPromise=require(_0x3840('0x5'));var rp=require(_0x3840('0x6'));var fs=require('fs');var path=require(_0x3840('0x7'));var rimraf=require(_0x3840('0x8'));var config=require('../../config/environment');var attributes=require(_0x3840('0x9'));module[_0x3840('0xa')]=function(_0x1cd658,_0x233be3){return _0x1cd658[_0x3840('0xb')](_0x3840('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index b80b0ab..8e7d78f 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 _0xfcd6=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch'];(function(_0x4d87cf,_0x59f8fb){var _0x3816f1=function(_0x52aced){while(--_0x52aced){_0x4d87cf['push'](_0x4d87cf['shift']());}};_0x3816f1(++_0x59f8fb);}(_0xfcd6,0x187));var _0x6fcd=function(_0x3bda86,_0x3c45e5){_0x3bda86=_0x3bda86-0x0;var _0x4d7ffa=_0xfcd6[_0x3bda86];return _0x4d7ffa;};'use strict';var _=require(_0x6fcd('0x0'));var util=require(_0x6fcd('0x1'));var moment=require('moment');var BPromise=require(_0x6fcd('0x2'));var rs=require(_0x6fcd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6fcd('0x4'))['db'];var utils=require(_0x6fcd('0x5'));var logger=require(_0x6fcd('0x6'))(_0x6fcd('0x7'));var config=require('../../config/environment');var jayson=require(_0x6fcd('0x8'));var client=jayson[_0x6fcd('0x9')][_0x6fcd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46d64f,_0x41fc75,_0x3162d2){return new BPromise(function(_0x2e975b,_0x339be6){return client[_0x6fcd('0xb')](_0x46d64f,_0x3162d2)[_0x6fcd('0xc')](function(_0x55b9d9){logger[_0x6fcd('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x41fc75,_0x6fcd('0xe'));logger[_0x6fcd('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x41fc75,'request\x20sent',JSON[_0x6fcd('0x10')](_0x55b9d9));if(_0x55b9d9['error']){if(_0x55b9d9[_0x6fcd('0x11')][_0x6fcd('0x12')]===0x1f4){logger[_0x6fcd('0x11')](_0x6fcd('0x13'),_0x41fc75,_0x55b9d9[_0x6fcd('0x11')][_0x6fcd('0x14')]);return _0x339be6(_0x55b9d9['error']['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x41fc75,_0x55b9d9[_0x6fcd('0x11')][_0x6fcd('0x14')]);return _0x2e975b(_0x55b9d9['error']['message']);}else{logger[_0x6fcd('0xd')](_0x6fcd('0x13'),_0x41fc75,_0x6fcd('0xe'));_0x2e975b(_0x55b9d9[_0x6fcd('0x15')][_0x6fcd('0x14')]);}})[_0x6fcd('0x16')](function(_0x222717){logger[_0x6fcd('0x11')](_0x6fcd('0x13'),_0x41fc75,_0x222717);_0x339be6(_0x222717);});});} \ No newline at end of file +var _0xcaa1=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcaa1,0x100));var _0x1caa=function(_0x3e55a9,_0x1fa422){_0x3e55a9=_0x3e55a9-0x0;var _0x51cc42=_0xcaa1[_0x3e55a9];return _0x51cc42;};'use strict';var _=require(_0x1caa('0x0'));var util=require(_0x1caa('0x1'));var moment=require(_0x1caa('0x2'));var BPromise=require(_0x1caa('0x3'));var rs=require(_0x1caa('0x4'));var fs=require('fs');var Redis=require(_0x1caa('0x5'));var db=require(_0x1caa('0x6'))['db'];var utils=require(_0x1caa('0x7'));var logger=require(_0x1caa('0x8'))('rpc');var config=require(_0x1caa('0x9'));var jayson=require(_0x1caa('0xa'));var client=jayson[_0x1caa('0xb')][_0x1caa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d6272,_0x2b1ce3,_0x196a63){return new BPromise(function(_0x2f0f1e,_0x24f034){return client[_0x1caa('0xd')](_0x5d6272,_0x196a63)[_0x1caa('0xe')](function(_0x466ae2){logger[_0x1caa('0xf')](_0x1caa('0x10'),_0x2b1ce3,'request\x20sent');logger[_0x1caa('0x11')](_0x1caa('0x12'),_0x2b1ce3,_0x1caa('0x13'),JSON['stringify'](_0x466ae2));if(_0x466ae2[_0x1caa('0x14')]){if(_0x466ae2[_0x1caa('0x14')][_0x1caa('0x15')]===0x1f4){logger[_0x1caa('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x2b1ce3,_0x466ae2[_0x1caa('0x14')]['message']);return _0x24f034(_0x466ae2['error'][_0x1caa('0x16')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x2b1ce3,_0x466ae2[_0x1caa('0x14')]['message']);return _0x2f0f1e(_0x466ae2[_0x1caa('0x14')][_0x1caa('0x16')]);}else{logger[_0x1caa('0xf')](_0x1caa('0x10'),_0x2b1ce3,_0x1caa('0x13'));_0x2f0f1e(_0x466ae2[_0x1caa('0x17')]['message']);}})['catch'](function(_0x429c4c){logger['error'](_0x1caa('0x10'),_0x2b1ce3,_0x429c4c);_0x24f034(_0x429c4c);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 4d3582b..d5d0add 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 _0x8efc=['put','destroy','exports','path','express','fs-extra','../../components/auth/service','./analyticMetric.controller','isAuthenticated','index','get','/:id','post','create'];(function(_0x50bfa7,_0x1ee681){var _0x104342=function(_0x2d0139){while(--_0x2d0139){_0x50bfa7['push'](_0x50bfa7['shift']());}};_0x104342(++_0x1ee681);}(_0x8efc,0x8f));var _0xc8ef=function(_0x4f1b87,_0x260834){_0x4f1b87=_0x4f1b87-0x0;var _0x74718e=_0x8efc[_0x4f1b87];return _0x74718e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc8ef('0x0'));var timeout=require('connect-timeout');var express=require(_0xc8ef('0x1'));var router=express['Router']();var fs_extra=require(_0xc8ef('0x2'));var auth=require(_0xc8ef('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc8ef('0x4'));router['get']('/',auth[_0xc8ef('0x5')](),controller[_0xc8ef('0x6')]);router[_0xc8ef('0x7')](_0xc8ef('0x8'),auth[_0xc8ef('0x5')](),controller['show']);router[_0xc8ef('0x9')]('/',auth['isAuthenticated'](),controller[_0xc8ef('0xa')]);router[_0xc8ef('0xb')](_0xc8ef('0x8'),auth[_0xc8ef('0x5')](),controller['update']);router['delete']('/:id',auth[_0xc8ef('0x5')](),controller[_0xc8ef('0xc')]);module[_0xc8ef('0xd')]=router; \ No newline at end of file +var _0xd206=['isAuthenticated','/:id','post','create','put','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x3d5783,_0x5e0999){var _0x369a1a=function(_0x2b0613){while(--_0x2b0613){_0x3d5783['push'](_0x3d5783['shift']());}};_0x369a1a(++_0x5e0999);}(_0xd206,0x107));var _0x6d20=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xd206[_0x26f702];return _0x11417d;};'use strict';var multer=require(_0x6d20('0x0'));var util=require(_0x6d20('0x1'));var path=require('path');var timeout=require(_0x6d20('0x2'));var express=require(_0x6d20('0x3'));var router=express[_0x6d20('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6d20('0x5'));var interaction=require(_0x6d20('0x6'));var config=require(_0x6d20('0x7'));var controller=require(_0x6d20('0x8'));router['get']('/',auth[_0x6d20('0x9')](),controller['index']);router['get'](_0x6d20('0xa'),auth[_0x6d20('0x9')](),controller['show']);router[_0x6d20('0xb')]('/',auth['isAuthenticated'](),controller[_0x6d20('0xc')]);router[_0x6d20('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6d20('0xe')](_0x6d20('0xa'),auth['isAuthenticated'](),controller[_0x6d20('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index bb37f1e..80d97ae 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 _0xf55c=['TEXT','exports'];(function(_0x40ee2c,_0x4e13bf){var _0x587b92=function(_0x13eb75){while(--_0x13eb75){_0x40ee2c['push'](_0x40ee2c['shift']());}};_0x587b92(++_0x4e13bf);}(_0xf55c,0x65));var _0xcf55=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xf55c[_0x387777];return _0x3f84c0;};'use strict';var Sequelize=require('sequelize');module[_0xcf55('0x0')]={'tree':{'type':Sequelize[_0xcf55('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x067b=['exports','TEXT','sequelize'];(function(_0x56eb70,_0x2bd75c){var _0x47f1fe=function(_0x1fbb17){while(--_0x1fbb17){_0x56eb70['push'](_0x56eb70['shift']());}};_0x47f1fe(++_0x2bd75c);}(_0x067b,0x179));var _0xb067=function(_0x3cc7b8,_0x1c1f80){_0x3cc7b8=_0x3cc7b8-0x0;var _0x4de389=_0x067b[_0x3cc7b8];return _0x4de389;};'use strict';var Sequelize=require(_0xb067('0x0'));module[_0xb067('0x1')]={'tree':{'type':Sequelize[_0xb067('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index a120862..e9ed92b 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 _0xb832=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','show','options','find','catch','create','body','params','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5e1805,_0x21e5af){var _0x5b0f50=function(_0x493f77){while(--_0x493f77){_0x5e1805['push'](_0x5e1805['shift']());}};_0x5b0f50(++_0x21e5af);}(_0xb832,0x1ec));var _0x2b83=function(_0x199663,_0x45ce76){_0x199663=_0x199663-0x0;var _0x44165b=_0xb832[_0x199663];return _0x44165b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2b83('0x0'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2b83('0x1'));var sox=require(_0x2b83('0x2'));var csv=require(_0x2b83('0x3'));var ejs=require(_0x2b83('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2b83('0x5'));var crypto=require('crypto');var jsforce=require(_0x2b83('0x6'));var deskjs=require(_0x2b83('0x7'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2b83('0x8'));var Redis=require('ioredis');var authService=require(_0x2b83('0x9'));var qs=require(_0x2b83('0xa'));var as=require(_0x2b83('0xb'));var hardwareService=require(_0x2b83('0xc'));var logger=require(_0x2b83('0xd'))(_0x2b83('0xe'));var utils=require(_0x2b83('0xf'));var config=require(_0x2b83('0x10'));var licenseUtil=require(_0x2b83('0x11'));var db=require(_0x2b83('0x12'))['db'];function respondWithStatusCode(_0x395030,_0x2801bc){_0x2801bc=_0x2801bc||0xcc;return function(_0x1f1099){if(_0x1f1099){return _0x395030[_0x2b83('0x13')](_0x2801bc);}return _0x395030[_0x2b83('0x14')](_0x2801bc)['end']();};}function respondWithResult(_0x60b0da,_0x3da8f2){_0x3da8f2=_0x3da8f2||0xc8;return function(_0x23394a){if(_0x23394a){return _0x60b0da[_0x2b83('0x14')](_0x3da8f2)[_0x2b83('0x15')](_0x23394a);}};}function respondWithFilteredResult(_0x4eba61,_0x5f0669){return function(_0x36cf4d){if(_0x36cf4d){var _0x27ac63=typeof _0x5f0669[_0x2b83('0x16')]===_0x2b83('0x17')&&typeof _0x5f0669[_0x2b83('0x18')]===_0x2b83('0x17');var _0x9cb2e8=_0x36cf4d[_0x2b83('0x19')];var _0x2969ed=_0x27ac63?0x0:_0x5f0669['offset'];var _0x2748f1=_0x27ac63?_0x36cf4d[_0x2b83('0x19')]:_0x5f0669[_0x2b83('0x16')]+_0x5f0669[_0x2b83('0x18')];var _0x38e834;if(_0x2748f1>=_0x9cb2e8){_0x2748f1=_0x9cb2e8;_0x38e834=0xc8;}else{_0x38e834=0xce;}_0x4eba61[_0x2b83('0x14')](_0x38e834);return _0x4eba61[_0x2b83('0x1a')](_0x2b83('0x1b'),_0x2969ed+'-'+_0x2748f1+'/'+_0x9cb2e8)[_0x2b83('0x15')](_0x36cf4d);}return null;};}function patchUpdates(_0x107a64){return function(_0x181e60){try{jsonpatch[_0x2b83('0x1c')](_0x181e60,_0x107a64,!![]);}catch(_0xacc48a){return BPromise[_0x2b83('0x1d')](_0xacc48a);}return _0x181e60[_0x2b83('0x1e')]();};}function saveUpdates(_0x3b19d1,_0x3aab08){return function(_0x2f7f4f){if(_0x2f7f4f){return _0x2f7f4f[_0x2b83('0x1f')](_0x3b19d1)[_0x2b83('0x20')](function(_0x49b1fb){return _0x49b1fb;});}return null;};}function removeEntity(_0x1e4e45,_0x36eb07){return function(_0x13e174){if(_0x13e174){return _0x13e174[_0x2b83('0x21')]()[_0x2b83('0x20')](function(){_0x1e4e45[_0x2b83('0x14')](0xcc)[_0x2b83('0x22')]();});}};}function handleEntityNotFound(_0x1641b9,_0x5322ca){return function(_0x262142){if(!_0x262142){_0x1641b9[_0x2b83('0x13')](0x194);}return _0x262142;};}function handleError(_0x3aab59,_0x4e9b7d){_0x4e9b7d=_0x4e9b7d||0x1f4;return function(_0x15ccb9){logger['error'](_0x15ccb9[_0x2b83('0x23')]);if(_0x15ccb9[_0x2b83('0x24')]){delete _0x15ccb9[_0x2b83('0x24')];}_0x3aab59[_0x2b83('0x14')](_0x4e9b7d)[_0x2b83('0x25')](_0x15ccb9);};}exports[_0x2b83('0x26')]=function(_0x59d5e6,_0xccba9e){var _0x4f672d={},_0x5190c0={},_0x1d5bde={'count':0x0,'rows':[]};var _0x4ce674=_[_0x2b83('0x27')](db[_0x2b83('0x28')][_0x2b83('0x29')],function(_0x5be7c2){return{'name':_0x5be7c2[_0x2b83('0x2a')],'type':_0x5be7c2['type'][_0x2b83('0x2b')]};});_0x5190c0[_0x2b83('0x2c')]=_[_0x2b83('0x27')](_0x4ce674,'name');_0x5190c0[_0x2b83('0x2d')]=_[_0x2b83('0x2e')](_0x59d5e6[_0x2b83('0x2d')]);_0x5190c0[_0x2b83('0x2f')]=_[_0x2b83('0x30')](_0x5190c0[_0x2b83('0x2c')],_0x5190c0['query']);_0x4f672d[_0x2b83('0x31')]=_[_0x2b83('0x30')](_0x5190c0[_0x2b83('0x2c')],qs[_0x2b83('0x32')](_0x59d5e6[_0x2b83('0x2d')][_0x2b83('0x32')]));_0x4f672d[_0x2b83('0x31')]=_0x4f672d[_0x2b83('0x31')][_0x2b83('0x33')]?_0x4f672d[_0x2b83('0x31')]:_0x5190c0['model'];if(!_0x59d5e6['query'][_0x2b83('0x34')]('nolimit')){_0x4f672d[_0x2b83('0x18')]=qs[_0x2b83('0x18')](_0x59d5e6[_0x2b83('0x2d')][_0x2b83('0x18')]);_0x4f672d[_0x2b83('0x16')]=qs[_0x2b83('0x16')](_0x59d5e6['query']['offset']);}_0x4f672d[_0x2b83('0x35')]=qs[_0x2b83('0x36')](_0x59d5e6['query']['sort']);_0x4f672d[_0x2b83('0x37')]=qs[_0x2b83('0x2f')](_[_0x2b83('0x38')](_0x59d5e6[_0x2b83('0x2d')],_0x5190c0[_0x2b83('0x2f')]),_0x4ce674);if(_0x59d5e6[_0x2b83('0x2d')]['filter']){_0x4f672d[_0x2b83('0x37')]=_[_0x2b83('0x39')](_0x4f672d[_0x2b83('0x37')],{'$or':_[_0x2b83('0x27')](_0x4ce674,function(_0x83b857){if(_0x83b857[_0x2b83('0x3a')]!==_0x2b83('0x3b')){var _0x1bd6fd={};_0x1bd6fd[_0x83b857['name']]={'$like':'%'+_0x59d5e6[_0x2b83('0x2d')][_0x2b83('0x3c')]+'%'};return _0x1bd6fd;}})});}_0x4f672d=_[_0x2b83('0x39')]({},_0x4f672d,_0x59d5e6['options']);var _0x4479c3={'where':_0x4f672d[_0x2b83('0x37')]};return db['AnalyticTreeReport'][_0x2b83('0x19')](_0x4479c3)[_0x2b83('0x20')](function(_0x1fedaf){_0x1d5bde['count']=_0x1fedaf;if(_0x59d5e6['query'][_0x2b83('0x3d')]){_0x4f672d[_0x2b83('0x3e')]=[{'all':!![]}];}return db[_0x2b83('0x28')][_0x2b83('0x3f')](_0x4f672d);})['then'](function(_0x296340){_0x1d5bde[_0x2b83('0x40')]=_0x296340;return _0x1d5bde;})[_0x2b83('0x20')](respondWithFilteredResult(_0xccba9e,_0x4f672d))['catch'](handleError(_0xccba9e,null));};exports[_0x2b83('0x41')]=function(_0x272c77,_0x5a3eb2){var _0x4ecb03={'raw':!![],'where':{'id':_0x272c77['params']['id']}},_0x3934bc={};_0x3934bc[_0x2b83('0x2c')]=_[_0x2b83('0x2e')](db[_0x2b83('0x28')][_0x2b83('0x29')]);_0x3934bc[_0x2b83('0x2d')]=_[_0x2b83('0x2e')](_0x272c77['query']);_0x3934bc[_0x2b83('0x2f')]=_[_0x2b83('0x30')](_0x3934bc[_0x2b83('0x2c')],_0x3934bc[_0x2b83('0x2d')]);_0x4ecb03['attributes']=_[_0x2b83('0x30')](_0x3934bc[_0x2b83('0x2c')],qs[_0x2b83('0x32')](_0x272c77[_0x2b83('0x2d')][_0x2b83('0x32')]));_0x4ecb03[_0x2b83('0x31')]=_0x4ecb03[_0x2b83('0x31')]['length']?_0x4ecb03['attributes']:_0x3934bc[_0x2b83('0x2c')];if(_0x272c77[_0x2b83('0x2d')][_0x2b83('0x3d')]){_0x4ecb03['include']=[{'all':!![]}];}_0x4ecb03=_['merge']({},_0x4ecb03,_0x272c77[_0x2b83('0x42')]);return db['AnalyticTreeReport'][_0x2b83('0x43')](_0x4ecb03)[_0x2b83('0x20')](handleEntityNotFound(_0x5a3eb2,null))[_0x2b83('0x20')](respondWithResult(_0x5a3eb2,null))[_0x2b83('0x44')](handleError(_0x5a3eb2,null));};exports[_0x2b83('0x45')]=function(_0xbca470,_0x5d4839){return db[_0x2b83('0x28')]['create'](_0xbca470[_0x2b83('0x46')],{})[_0x2b83('0x20')](respondWithResult(_0x5d4839,0xc9))[_0x2b83('0x44')](handleError(_0x5d4839,null));};exports['update']=function(_0x4e20ad,_0x49e101){if(_0x4e20ad[_0x2b83('0x46')]['id']){delete _0x4e20ad[_0x2b83('0x46')]['id'];}return db[_0x2b83('0x28')][_0x2b83('0x43')]({'where':{'id':_0x4e20ad[_0x2b83('0x47')]['id']}})[_0x2b83('0x20')](handleEntityNotFound(_0x49e101,null))[_0x2b83('0x20')](saveUpdates(_0x4e20ad[_0x2b83('0x46')],null))[_0x2b83('0x20')](respondWithResult(_0x49e101,null))['catch'](handleError(_0x49e101,null));};exports[_0x2b83('0x21')]=function(_0x24ba27,_0x1814b1){return db[_0x2b83('0x28')]['find']({'where':{'id':_0x24ba27[_0x2b83('0x47')]['id']}})[_0x2b83('0x20')](handleEntityNotFound(_0x1814b1,null))[_0x2b83('0x20')](removeEntity(_0x1814b1,null))[_0x2b83('0x44')](handleError(_0x1814b1,null));}; \ No newline at end of file +var _0x6b36=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','count','offset','limit','Content-Range','json','update','destroy','then','error','stack','name','map','rawAttributes','key','query','keys','filters','intersection','model'];(function(_0x27e087,_0x178f90){var _0x2ac501=function(_0x58a288){while(--_0x58a288){_0x27e087['push'](_0x27e087['shift']());}};_0x2ac501(++_0x178f90);}(_0x6b36,0x1b5));var _0x66b3=function(_0x44f6f5,_0x137926){_0x44f6f5=_0x44f6f5-0x0;var _0x4bdb61=_0x6b36[_0x44f6f5];return _0x4bdb61;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x66b3('0x0'));var jsonpatch=require(_0x66b3('0x1'));var rp=require(_0x66b3('0x2'));var moment=require('moment');var BPromise=require(_0x66b3('0x3'));var Mustache=require(_0x66b3('0x4'));var util=require(_0x66b3('0x5'));var path=require('path');var sox=require(_0x66b3('0x6'));var csv=require(_0x66b3('0x7'));var ejs=require(_0x66b3('0x8'));var fs=require('fs');var fs_extra=require(_0x66b3('0x9'));var _=require('lodash');var squel=require(_0x66b3('0xa'));var crypto=require(_0x66b3('0xb'));var jsforce=require(_0x66b3('0xc'));var deskjs=require(_0x66b3('0xd'));var toCsv=require(_0x66b3('0x7'));var querystring=require(_0x66b3('0xe'));var Papa=require(_0x66b3('0xf'));var Redis=require(_0x66b3('0x10'));var authService=require(_0x66b3('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66b3('0x12'));var logger=require('../../config/logger')(_0x66b3('0x13'));var utils=require(_0x66b3('0x14'));var config=require(_0x66b3('0x15'));var licenseUtil=require(_0x66b3('0x16'));var db=require(_0x66b3('0x17'))['db'];function respondWithStatusCode(_0x5c106d,_0x5d8b2d){_0x5d8b2d=_0x5d8b2d||0xcc;return function(_0x536f88){if(_0x536f88){return _0x5c106d[_0x66b3('0x18')](_0x5d8b2d);}return _0x5c106d['status'](_0x5d8b2d)[_0x66b3('0x19')]();};}function respondWithResult(_0x30ddf4,_0x4fbb69){_0x4fbb69=_0x4fbb69||0xc8;return function(_0x247fbe){if(_0x247fbe){return _0x30ddf4[_0x66b3('0x1a')](_0x4fbb69)['json'](_0x247fbe);}};}function respondWithFilteredResult(_0x2c0498,_0x41cf50){return function(_0x40cb17){if(_0x40cb17){var _0x50fe57=typeof _0x41cf50['offset']==='undefined'&&typeof _0x41cf50['limit']==='undefined';var _0x1611b5=_0x40cb17[_0x66b3('0x1b')];var _0x3b54a7=_0x50fe57?0x0:_0x41cf50[_0x66b3('0x1c')];var _0x527b65=_0x50fe57?_0x40cb17[_0x66b3('0x1b')]:_0x41cf50[_0x66b3('0x1c')]+_0x41cf50[_0x66b3('0x1d')];var _0x3f6a3;if(_0x527b65>=_0x1611b5){_0x527b65=_0x1611b5;_0x3f6a3=0xc8;}else{_0x3f6a3=0xce;}_0x2c0498[_0x66b3('0x1a')](_0x3f6a3);return _0x2c0498['set'](_0x66b3('0x1e'),_0x3b54a7+'-'+_0x527b65+'/'+_0x1611b5)[_0x66b3('0x1f')](_0x40cb17);}return null;};}function patchUpdates(_0x328110){return function(_0x25464c){try{jsonpatch['apply'](_0x25464c,_0x328110,!![]);}catch(_0x2fa278){return BPromise['reject'](_0x2fa278);}return _0x25464c['save']();};}function saveUpdates(_0x37e420,_0x6aaf01){return function(_0x33092d){if(_0x33092d){return _0x33092d[_0x66b3('0x20')](_0x37e420)['then'](function(_0x3c4cd5){return _0x3c4cd5;});}return null;};}function removeEntity(_0x4b4ffb,_0x440be8){return function(_0x28b987){if(_0x28b987){return _0x28b987[_0x66b3('0x21')]()[_0x66b3('0x22')](function(){_0x4b4ffb[_0x66b3('0x1a')](0xcc)[_0x66b3('0x19')]();});}};}function handleEntityNotFound(_0x2d4e3c,_0x46a39e){return function(_0x1da60e){if(!_0x1da60e){_0x2d4e3c[_0x66b3('0x18')](0x194);}return _0x1da60e;};}function handleError(_0x2e196d,_0xdcc1db){_0xdcc1db=_0xdcc1db||0x1f4;return function(_0x1f81f2){logger[_0x66b3('0x23')](_0x1f81f2[_0x66b3('0x24')]);if(_0x1f81f2[_0x66b3('0x25')]){delete _0x1f81f2[_0x66b3('0x25')];}_0x2e196d['status'](_0xdcc1db)['send'](_0x1f81f2);};}exports['index']=function(_0x5767c6,_0x83b75d){var _0x3c815b={},_0x316539={},_0x500ce3={'count':0x0,'rows':[]};var _0x4b645d=_[_0x66b3('0x26')](db['AnalyticTreeReport'][_0x66b3('0x27')],function(_0x4f5aac){return{'name':_0x4f5aac['fieldName'],'type':_0x4f5aac['type'][_0x66b3('0x28')]};});_0x316539['model']=_[_0x66b3('0x26')](_0x4b645d,_0x66b3('0x25'));_0x316539[_0x66b3('0x29')]=_[_0x66b3('0x2a')](_0x5767c6[_0x66b3('0x29')]);_0x316539[_0x66b3('0x2b')]=_[_0x66b3('0x2c')](_0x316539[_0x66b3('0x2d')],_0x316539['query']);_0x3c815b[_0x66b3('0x2e')]=_[_0x66b3('0x2c')](_0x316539['model'],qs[_0x66b3('0x2f')](_0x5767c6['query'][_0x66b3('0x2f')]));_0x3c815b[_0x66b3('0x2e')]=_0x3c815b[_0x66b3('0x2e')][_0x66b3('0x30')]?_0x3c815b[_0x66b3('0x2e')]:_0x316539['model'];if(!_0x5767c6[_0x66b3('0x29')][_0x66b3('0x31')](_0x66b3('0x32'))){_0x3c815b[_0x66b3('0x1d')]=qs[_0x66b3('0x1d')](_0x5767c6[_0x66b3('0x29')][_0x66b3('0x1d')]);_0x3c815b['offset']=qs[_0x66b3('0x1c')](_0x5767c6[_0x66b3('0x29')][_0x66b3('0x1c')]);}_0x3c815b[_0x66b3('0x33')]=qs[_0x66b3('0x34')](_0x5767c6[_0x66b3('0x29')][_0x66b3('0x34')]);_0x3c815b['where']=qs[_0x66b3('0x2b')](_[_0x66b3('0x35')](_0x5767c6[_0x66b3('0x29')],_0x316539[_0x66b3('0x2b')]),_0x4b645d);if(_0x5767c6[_0x66b3('0x29')][_0x66b3('0x36')]){_0x3c815b[_0x66b3('0x37')]=_[_0x66b3('0x38')](_0x3c815b[_0x66b3('0x37')],{'$or':_[_0x66b3('0x26')](_0x4b645d,function(_0x4c142c){if(_0x4c142c[_0x66b3('0x39')]!=='VIRTUAL'){var _0x2faa21={};_0x2faa21[_0x4c142c['name']]={'$like':'%'+_0x5767c6[_0x66b3('0x29')][_0x66b3('0x36')]+'%'};return _0x2faa21;}})});}_0x3c815b=_[_0x66b3('0x38')]({},_0x3c815b,_0x5767c6[_0x66b3('0x3a')]);var _0x3fb754={'where':_0x3c815b[_0x66b3('0x37')]};return db[_0x66b3('0x3b')][_0x66b3('0x1b')](_0x3fb754)[_0x66b3('0x22')](function(_0x5aedab){_0x500ce3[_0x66b3('0x1b')]=_0x5aedab;if(_0x5767c6[_0x66b3('0x29')][_0x66b3('0x3c')]){_0x3c815b['include']=[{'all':!![]}];}return db[_0x66b3('0x3b')][_0x66b3('0x3d')](_0x3c815b);})[_0x66b3('0x22')](function(_0x2003c3){_0x500ce3[_0x66b3('0x3e')]=_0x2003c3;return _0x500ce3;})[_0x66b3('0x22')](respondWithFilteredResult(_0x83b75d,_0x3c815b))[_0x66b3('0x3f')](handleError(_0x83b75d,null));};exports[_0x66b3('0x40')]=function(_0x48c707,_0x531f59){var _0x1a7c59={'raw':!![],'where':{'id':_0x48c707[_0x66b3('0x41')]['id']}},_0x519ee0={};_0x519ee0[_0x66b3('0x2d')]=_[_0x66b3('0x2a')](db[_0x66b3('0x3b')][_0x66b3('0x27')]);_0x519ee0['query']=_[_0x66b3('0x2a')](_0x48c707['query']);_0x519ee0[_0x66b3('0x2b')]=_[_0x66b3('0x2c')](_0x519ee0[_0x66b3('0x2d')],_0x519ee0[_0x66b3('0x29')]);_0x1a7c59[_0x66b3('0x2e')]=_[_0x66b3('0x2c')](_0x519ee0[_0x66b3('0x2d')],qs[_0x66b3('0x2f')](_0x48c707[_0x66b3('0x29')]['fields']));_0x1a7c59[_0x66b3('0x2e')]=_0x1a7c59[_0x66b3('0x2e')][_0x66b3('0x30')]?_0x1a7c59[_0x66b3('0x2e')]:_0x519ee0[_0x66b3('0x2d')];if(_0x48c707[_0x66b3('0x29')][_0x66b3('0x3c')]){_0x1a7c59['include']=[{'all':!![]}];}_0x1a7c59=_['merge']({},_0x1a7c59,_0x48c707[_0x66b3('0x3a')]);return db[_0x66b3('0x3b')][_0x66b3('0x42')](_0x1a7c59)[_0x66b3('0x22')](handleEntityNotFound(_0x531f59,null))[_0x66b3('0x22')](respondWithResult(_0x531f59,null))[_0x66b3('0x3f')](handleError(_0x531f59,null));};exports[_0x66b3('0x43')]=function(_0x576a40,_0x21e051){return db[_0x66b3('0x3b')]['create'](_0x576a40[_0x66b3('0x44')],{})[_0x66b3('0x22')](respondWithResult(_0x21e051,0xc9))[_0x66b3('0x3f')](handleError(_0x21e051,null));};exports[_0x66b3('0x20')]=function(_0x3ab59c,_0x2fd816){if(_0x3ab59c[_0x66b3('0x44')]['id']){delete _0x3ab59c['body']['id'];}return db[_0x66b3('0x3b')][_0x66b3('0x42')]({'where':{'id':_0x3ab59c['params']['id']}})[_0x66b3('0x22')](handleEntityNotFound(_0x2fd816,null))[_0x66b3('0x22')](saveUpdates(_0x3ab59c[_0x66b3('0x44')],null))[_0x66b3('0x22')](respondWithResult(_0x2fd816,null))['catch'](handleError(_0x2fd816,null));};exports['destroy']=function(_0xa87c68,_0xed1282){return db[_0x66b3('0x3b')][_0x66b3('0x42')]({'where':{'id':_0xa87c68['params']['id']}})[_0x66b3('0x22')](handleEntityNotFound(_0xed1282,null))[_0x66b3('0x22')](removeEntity(_0xed1282,null))[_0x66b3('0x3f')](handleError(_0xed1282,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 4d12109..c10c64a 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 _0xfd5e=['../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','lodash','../../config/logger','request-promise','path'];(function(_0x6e0bc7,_0x9b200){var _0x213ae6=function(_0x473672){while(--_0x473672){_0x6e0bc7['push'](_0x6e0bc7['shift']());}};_0x213ae6(++_0x9b200);}(_0xfd5e,0xdc));var _0xefd5=function(_0x400f2a,_0x52a559){_0x400f2a=_0x400f2a-0x0;var _0x3dd8d1=_0xfd5e[_0x400f2a];return _0x3dd8d1;};'use strict';var _=require(_0xefd5('0x0'));var util=require('util');var logger=require(_0xefd5('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xefd5('0x2'));var fs=require('fs');var path=require(_0xefd5('0x3'));var rimraf=require('rimraf');var config=require(_0xefd5('0x4'));var attributes=require(_0xefd5('0x5'));module[_0xefd5('0x6')]=function(_0x23eeef,_0x1d2707){return _0x23eeef['define'](_0xefd5('0x7'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2159=['lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define'];(function(_0x4f11cb,_0x14e174){var _0x491488=function(_0x2904a9){while(--_0x2904a9){_0x4f11cb['push'](_0x4f11cb['shift']());}};_0x491488(++_0x14e174);}(_0x2159,0x15f));var _0x9215=function(_0x5e26e9,_0x467282){_0x5e26e9=_0x5e26e9-0x0;var _0x5c3807=_0x2159[_0x5e26e9];return _0x5c3807;};'use strict';var _=require(_0x9215('0x0'));var util=require(_0x9215('0x1'));var logger=require(_0x9215('0x2'))(_0x9215('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9215('0x4'));var rimraf=require(_0x9215('0x5'));var config=require(_0x9215('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0x9215('0x7')]=function(_0x7d0499,_0x25b383){return _0x7d0499[_0x9215('0x8')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','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 3ea3a2d..4e5a511 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5359ee,_0x4a94ba){var _0x3d3918=function(_0x4149f9){while(--_0x4149f9){_0x5359ee['push'](_0x5359ee['shift']());}};_0x3d3918(++_0x4a94ba);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc4aa[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x3ae62c,_0x1bf459){var _0x385835=function(_0x36f85f){while(--_0x36f85f){_0x3ae62c['push'](_0x3ae62c['shift']());}};_0x385835(++_0x1bf459);}(_0x1261,0x144));var _0x1126=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x1261[_0x486f4a];return _0x135d99;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 268a098..2d10aae 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 _0xf80d=['util','path','express','Router','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0xf80d,0x154));var _0xdf80=function(_0x43444b,_0x8cf95b){_0x43444b=_0x43444b-0x0;var _0x392fe5=_0xf80d[_0x43444b];return _0x392fe5;};'use strict';var multer=require('multer');var util=require(_0xdf80('0x0'));var path=require(_0xdf80('0x1'));var timeout=require('connect-timeout');var express=require(_0xdf80('0x2'));var router=express[_0xdf80('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdf80('0x4'));var controller=require(_0xdf80('0x5'));router[_0xdf80('0x6')]('/',auth[_0xdf80('0x7')](),controller[_0xdf80('0x8')]);router[_0xdf80('0x6')](_0xdf80('0x9'),auth['isAuthenticated'](),controller[_0xdf80('0xa')]);router[_0xdf80('0xb')]('/',auth[_0xdf80('0x7')](),controller[_0xdf80('0xc')]);router[_0xdf80('0xd')](_0xdf80('0x9'),auth[_0xdf80('0x7')](),controller['update']);router[_0xdf80('0xe')]('/:id',auth[_0xdf80('0x7')](),controller[_0xdf80('0xf')]);module[_0xdf80('0x10')]=router; \ No newline at end of file +var _0xcf73=['/:id','show','post','create','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get'];(function(_0x1d0fa7,_0x1ad70f){var _0x5b2d91=function(_0x4ff922){while(--_0x4ff922){_0x1d0fa7['push'](_0x1d0fa7['shift']());}};_0x5b2d91(++_0x1ad70f);}(_0xcf73,0x1e3));var _0x3cf7=function(_0x31d2be,_0x4c2477){_0x31d2be=_0x31d2be-0x0;var _0x4746b9=_0xcf73[_0x31d2be];return _0x4746b9;};'use strict';var multer=require(_0x3cf7('0x0'));var util=require(_0x3cf7('0x1'));var path=require('path');var timeout=require(_0x3cf7('0x2'));var express=require(_0x3cf7('0x3'));var router=express[_0x3cf7('0x4')]();var fs_extra=require(_0x3cf7('0x5'));var auth=require(_0x3cf7('0x6'));var interaction=require(_0x3cf7('0x7'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x3cf7('0x8')](),controller['index']);router[_0x3cf7('0x9')](_0x3cf7('0xa'),auth[_0x3cf7('0x8')](),controller[_0x3cf7('0xb')]);router[_0x3cf7('0xc')]('/',auth[_0x3cf7('0x8')](),controller[_0x3cf7('0xd')]);router[_0x3cf7('0xe')](_0x3cf7('0xa'),auth[_0x3cf7('0x8')](),controller[_0x3cf7('0xf')]);router['delete'](_0x3cf7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x3cf7('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 9109175..b3037f2 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 _0x8e0d=['sequelize','STRING'];(function(_0x36a575,_0x39ba06){var _0x36f50c=function(_0x3bb2f5){while(--_0x3bb2f5){_0x36a575['push'](_0x36a575['shift']());}};_0x36f50c(++_0x39ba06);}(_0x8e0d,0x82));var _0xd8e0=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0x8e0d[_0x1b64dd];return _0xeb464c;};'use strict';var Sequelize=require(_0xd8e0('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xd8e0('0x1')]},'type':{'type':Sequelize[_0xd8e0('0x1')]}}; \ No newline at end of file +var _0xf9bb=['sequelize','exports','STRING'];(function(_0x360f7b,_0x584a6e){var _0x47d2dd=function(_0x1c2d2e){while(--_0x1c2d2e){_0x360f7b['push'](_0x360f7b['shift']());}};_0x47d2dd(++_0x584a6e);}(_0xf9bb,0x14d));var _0xbf9b=function(_0x54be7c,_0x149e75){_0x54be7c=_0x54be7c-0x0;var _0x46d170=_0xf9bb[_0x54be7c];return _0x46d170;};'use strict';var Sequelize=require(_0xbf9b('0x0'));module[_0xbf9b('0x1')]={'name':{'type':Sequelize[_0xbf9b('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbf9b('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 149e9f8..fc5874a 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 _0x7050=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','show','params','keys','options','find','catch','clone','get','omit','updatedAt','body','create','originalname','file','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','query'];(function(_0x31c133,_0x3075f7){var _0x596121=function(_0xcb270e){while(--_0xcb270e){_0x31c133['push'](_0x31c133['shift']());}};_0x596121(++_0x3075f7);}(_0x7050,0x133));var _0x0705=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0x7050[_0xce6f11];return _0x35b709;};'use strict';var emlformat=require(_0x0705('0x0'));var rimraf=require(_0x0705('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0705('0x2'));var rp=require(_0x0705('0x3'));var moment=require('moment');var BPromise=require(_0x0705('0x4'));var Mustache=require(_0x0705('0x5'));var util=require('util');var path=require('path');var sox=require(_0x0705('0x6'));var csv=require(_0x0705('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0705('0x8'));var _=require(_0x0705('0x9'));var squel=require(_0x0705('0xa'));var crypto=require(_0x0705('0xb'));var jsforce=require(_0x0705('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0705('0x7'));var querystring=require(_0x0705('0xd'));var Papa=require(_0x0705('0xe'));var Redis=require(_0x0705('0xf'));var authService=require(_0x0705('0x10'));var qs=require(_0x0705('0x11'));var as=require(_0x0705('0x12'));var hardwareService=require(_0x0705('0x13'));var logger=require(_0x0705('0x14'))(_0x0705('0x15'));var utils=require(_0x0705('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0705('0x17'));var db=require(_0x0705('0x18'))['db'];function respondWithStatusCode(_0x28fe3f,_0xad5331){_0xad5331=_0xad5331||0xcc;return function(_0x22bbf8){if(_0x22bbf8){return _0x28fe3f[_0x0705('0x19')](_0xad5331);}return _0x28fe3f[_0x0705('0x1a')](_0xad5331)[_0x0705('0x1b')]();};}function respondWithResult(_0x132ccc,_0x389264){_0x389264=_0x389264||0xc8;return function(_0x587e38){if(_0x587e38){return _0x132ccc['status'](_0x389264)[_0x0705('0x1c')](_0x587e38);}};}function respondWithFilteredResult(_0x33a818,_0x1ecb94){return function(_0x2a9615){if(_0x2a9615){var _0x1bd6d4=typeof _0x1ecb94[_0x0705('0x1d')]===_0x0705('0x1e')&&typeof _0x1ecb94[_0x0705('0x1f')]===_0x0705('0x1e');var _0x394eb2=_0x2a9615['count'];var _0x150c90=_0x1bd6d4?0x0:_0x1ecb94['offset'];var _0x1e93ed=_0x1bd6d4?_0x2a9615[_0x0705('0x20')]:_0x1ecb94['offset']+_0x1ecb94['limit'];var _0x1409e1;if(_0x1e93ed>=_0x394eb2){_0x1e93ed=_0x394eb2;_0x1409e1=0xc8;}else{_0x1409e1=0xce;}_0x33a818[_0x0705('0x1a')](_0x1409e1);return _0x33a818['set']('Content-Range',_0x150c90+'-'+_0x1e93ed+'/'+_0x394eb2)['json'](_0x2a9615);}return null;};}function patchUpdates(_0x410cc8){return function(_0x52357f){try{jsonpatch[_0x0705('0x21')](_0x52357f,_0x410cc8,!![]);}catch(_0x17f62d){return BPromise[_0x0705('0x22')](_0x17f62d);}return _0x52357f[_0x0705('0x23')]();};}function saveUpdates(_0x38820e,_0x4eb750){return function(_0x11e545){if(_0x11e545){return _0x11e545[_0x0705('0x24')](_0x38820e)[_0x0705('0x25')](function(_0x127862){return _0x127862;});}return null;};}function removeEntity(_0x1676ce,_0x46ff09){return function(_0x2fc9c5){if(_0x2fc9c5){return _0x2fc9c5[_0x0705('0x26')]()[_0x0705('0x25')](function(){_0x1676ce[_0x0705('0x1a')](0xcc)[_0x0705('0x1b')]();});}};}function handleEntityNotFound(_0x165aeb,_0x59c838){return function(_0x1c9af7){if(!_0x1c9af7){_0x165aeb['sendStatus'](0x194);}return _0x1c9af7;};}function handleError(_0x126625,_0x3580ef){_0x3580ef=_0x3580ef||0x1f4;return function(_0x16f031){logger[_0x0705('0x27')](_0x16f031[_0x0705('0x28')]);if(_0x16f031[_0x0705('0x29')]){delete _0x16f031[_0x0705('0x29')];}_0x126625[_0x0705('0x1a')](_0x3580ef)[_0x0705('0x2a')](_0x16f031);};}exports[_0x0705('0x2b')]=function(_0x39b10b,_0xe9179c){var _0x107291={},_0x5da229={},_0x5dda14={'count':0x0,'rows':[]};var _0x3df7a1=_[_0x0705('0x2c')](db[_0x0705('0x2d')][_0x0705('0x2e')],function(_0xe70f83){return{'name':_0xe70f83[_0x0705('0x2f')],'type':_0xe70f83['type']['key']};});_0x5da229['model']=_[_0x0705('0x2c')](_0x3df7a1,'name');_0x5da229['query']=_['keys'](_0x39b10b[_0x0705('0x30')]);_0x5da229[_0x0705('0x31')]=_[_0x0705('0x32')](_0x5da229[_0x0705('0x33')],_0x5da229[_0x0705('0x30')]);_0x107291[_0x0705('0x34')]=_[_0x0705('0x32')](_0x5da229[_0x0705('0x33')],qs[_0x0705('0x35')](_0x39b10b[_0x0705('0x30')][_0x0705('0x35')]));_0x107291[_0x0705('0x34')]=_0x107291[_0x0705('0x34')][_0x0705('0x36')]?_0x107291[_0x0705('0x34')]:_0x5da229[_0x0705('0x33')];if(!_0x39b10b['query'][_0x0705('0x37')](_0x0705('0x38'))){_0x107291[_0x0705('0x1f')]=qs[_0x0705('0x1f')](_0x39b10b[_0x0705('0x30')][_0x0705('0x1f')]);_0x107291[_0x0705('0x1d')]=qs[_0x0705('0x1d')](_0x39b10b[_0x0705('0x30')][_0x0705('0x1d')]);}_0x107291[_0x0705('0x39')]=qs[_0x0705('0x3a')](_0x39b10b[_0x0705('0x30')][_0x0705('0x3a')]);_0x107291[_0x0705('0x3b')]=qs[_0x0705('0x31')](_[_0x0705('0x3c')](_0x39b10b[_0x0705('0x30')],_0x5da229['filters']),_0x3df7a1);if(_0x39b10b[_0x0705('0x30')][_0x0705('0x3d')]){_0x107291['where']=_[_0x0705('0x3e')](_0x107291[_0x0705('0x3b')],{'$or':_['map'](_0x3df7a1,function(_0x3abc7b){if(_0x3abc7b[_0x0705('0x3f')]!==_0x0705('0x40')){var _0x236525={};_0x236525[_0x3abc7b[_0x0705('0x29')]]={'$like':'%'+_0x39b10b[_0x0705('0x30')][_0x0705('0x3d')]+'%'};return _0x236525;}})});}_0x107291=_['merge']({},_0x107291,_0x39b10b['options']);var _0x5a8dc6={'where':_0x107291[_0x0705('0x3b')]};return db['Attachment'][_0x0705('0x20')](_0x5a8dc6)[_0x0705('0x25')](function(_0x30fbb1){_0x5dda14[_0x0705('0x20')]=_0x30fbb1;if(_0x39b10b[_0x0705('0x30')][_0x0705('0x41')]){_0x107291[_0x0705('0x42')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x107291);})[_0x0705('0x25')](function(_0x2ee0c0){_0x5dda14[_0x0705('0x43')]=_0x2ee0c0;return _0x5dda14;})[_0x0705('0x25')](respondWithFilteredResult(_0xe9179c,_0x107291))['catch'](handleError(_0xe9179c,null));};exports[_0x0705('0x44')]=function(_0xeba155,_0x30198e){var _0x130b70={'raw':!![],'where':{'id':_0xeba155[_0x0705('0x45')]['id']}},_0x10e079={};_0x10e079['model']=_[_0x0705('0x46')](db[_0x0705('0x2d')][_0x0705('0x2e')]);_0x10e079['query']=_['keys'](_0xeba155[_0x0705('0x30')]);_0x10e079[_0x0705('0x31')]=_['intersection'](_0x10e079[_0x0705('0x33')],_0x10e079[_0x0705('0x30')]);_0x130b70[_0x0705('0x34')]=_['intersection'](_0x10e079[_0x0705('0x33')],qs[_0x0705('0x35')](_0xeba155['query'][_0x0705('0x35')]));_0x130b70[_0x0705('0x34')]=_0x130b70[_0x0705('0x34')][_0x0705('0x36')]?_0x130b70[_0x0705('0x34')]:_0x10e079[_0x0705('0x33')];if(_0xeba155[_0x0705('0x30')][_0x0705('0x41')]){_0x130b70['include']=[{'all':!![]}];}_0x130b70=_['merge']({},_0x130b70,_0xeba155[_0x0705('0x47')]);return db[_0x0705('0x2d')][_0x0705('0x48')](_0x130b70)[_0x0705('0x25')](handleEntityNotFound(_0x30198e,null))['then'](respondWithResult(_0x30198e,null))[_0x0705('0x49')](handleError(_0x30198e,null));};exports[_0x0705('0x4a')]=function(_0x158494,_0x22f131){var _0x5e2d4d={'where':{'id':_0x158494[_0x0705('0x45')]['id']}},_0x1c0faf={};_0x1c0faf[_0x0705('0x33')]=_[_0x0705('0x46')](db[_0x0705('0x2d')]['rawAttributes']);_0x5e2d4d['attributes']=_[_0x0705('0x32')](_0x1c0faf[_0x0705('0x33')],qs[_0x0705('0x35')](_0x158494[_0x0705('0x30')][_0x0705('0x35')]));_0x5e2d4d['attributes']=_0x5e2d4d[_0x0705('0x34')][_0x0705('0x36')]?_0x5e2d4d[_0x0705('0x34')]:_0x1c0faf['model'];if(_0x158494[_0x0705('0x30')][_0x0705('0x41')]){_0x5e2d4d[_0x0705('0x42')]=[{'all':!![]}];}_0x5e2d4d=_[_0x0705('0x3e')]({},_0x5e2d4d,_0x158494[_0x0705('0x47')]);return db[_0x0705('0x2d')][_0x0705('0x48')](_0x5e2d4d)[_0x0705('0x25')](handleEntityNotFound(_0x22f131,null))['then'](function(_0x1b87e2){if(_0x1b87e2){var _0x1266d5=_0x1b87e2[_0x0705('0x4b')]({'plain':!![]});_0x1266d5=qs[_0x0705('0x4c')](_0x1266d5,['id','createdAt',_0x0705('0x4d')]);_0x158494[_0x0705('0x4e')]=_['omit'](_0x158494[_0x0705('0x4e')],['id','createdAt','updatedAt']);return db[_0x0705('0x2d')][_0x0705('0x4f')](_[_0x0705('0x3e')](_0x1266d5,_0x158494[_0x0705('0x4e')]),{'include':_0x158494[_0x0705('0x30')][_0x0705('0x41')]?[{'all':!![]}]:undefined});}})[_0x0705('0x25')](respondWithResult(_0x22f131,0xc9))[_0x0705('0x49')](handleError(_0x22f131,null));};exports[_0x0705('0x24')]=function(_0xd9892d,_0x551e6f){if(_0xd9892d['body']['id']){delete _0xd9892d[_0x0705('0x4e')]['id'];}return db[_0x0705('0x2d')][_0x0705('0x48')]({'where':{'id':_0xd9892d['params']['id']}})[_0x0705('0x25')](handleEntityNotFound(_0x551e6f,null))[_0x0705('0x25')](saveUpdates(_0xd9892d[_0x0705('0x4e')],null))[_0x0705('0x25')](respondWithResult(_0x551e6f,null))[_0x0705('0x49')](handleError(_0x551e6f,null));};exports[_0x0705('0x26')]=function(_0x44ae2f,_0x1f690d){return db[_0x0705('0x2d')]['find']({'where':{'id':_0x44ae2f['params']['id']}})[_0x0705('0x25')](handleEntityNotFound(_0x1f690d,null))[_0x0705('0x25')](removeEntity(_0x1f690d,null))['catch'](handleError(_0x1f690d,null));};exports[_0x0705('0x4f')]=function(_0x5b6b4c,_0x371509,_0x59bc38){_0x5b6b4c[_0x0705('0x4e')][_0x0705('0x29')]=_0x5b6b4c['file'][_0x0705('0x50')];_0x5b6b4c[_0x0705('0x4e')]['basename']=_0x5b6b4c[_0x0705('0x51')]['filename'];_0x5b6b4c[_0x0705('0x4e')]['type']=_0x5b6b4c[_0x0705('0x51')][_0x0705('0x52')];return db[_0x0705('0x2d')][_0x0705('0x4f')](_0x5b6b4c['body'])[_0x0705('0x25')](respondWithResult(_0x371509,0xc9))[_0x0705('0x49')](handleError(_0x371509,null));};exports['download']=function(_0x165ac6,_0xa7f3bf,_0xb81750){return db[_0x0705('0x2d')][_0x0705('0x53')]({'where':{'id':_0x165ac6['params']['id']},'raw':!![]})[_0x0705('0x25')](handleEntityNotFound(_0xa7f3bf,null))['then'](function(_0x2e1536){if(_0x2e1536){var _0xd6c419=_0x2e1536[_0x0705('0x54')]!==null;var _0x2fd615=path[_0x0705('0x55')](config[_0x0705('0x56')],_0x0705('0x57'));if(_0xd6c419){_0x2fd615=path[_0x0705('0x55')](_0x2fd615,_0x0705('0x58'));}var _0x1f1046=path[_0x0705('0x55')](_0x2fd615,_0x2e1536['basename']);return _0xa7f3bf['download'](_0x1f1046);}})[_0x0705('0x49')](handleError(_0xa7f3bf,null));}; \ No newline at end of file +var _0x49b3=['set','apply','reject','then','destroy','error','stack','name','send','map','Attachment','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','get','omit','createdAt','body','updatedAt','create','file','originalname','basename','filename','mimetype','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x5dc03e,_0x54e60c){var _0x466a07=function(_0x2ce0cd){while(--_0x2ce0cd){_0x5dc03e['push'](_0x5dc03e['shift']());}};_0x466a07(++_0x54e60c);}(_0x49b3,0x8b));var _0x349b=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x49b3[_0x40bffc];return _0x3007e9;};'use strict';var emlformat=require(_0x349b('0x0'));var rimraf=require(_0x349b('0x1'));var zipdir=require(_0x349b('0x2'));var jsonpatch=require(_0x349b('0x3'));var rp=require(_0x349b('0x4'));var moment=require(_0x349b('0x5'));var BPromise=require(_0x349b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x349b('0x7'));var sox=require(_0x349b('0x8'));var csv=require('to-csv');var ejs=require(_0x349b('0x9'));var fs=require('fs');var fs_extra=require(_0x349b('0xa'));var _=require('lodash');var squel=require(_0x349b('0xb'));var crypto=require(_0x349b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x349b('0xd'));var toCsv=require(_0x349b('0xe'));var querystring=require(_0x349b('0xf'));var Papa=require('papaparse');var Redis=require(_0x349b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x349b('0x11'));var hardwareService=require(_0x349b('0x12'));var logger=require(_0x349b('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x349b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x133d89,_0x23f0a7){_0x23f0a7=_0x23f0a7||0xcc;return function(_0x4b1757){if(_0x4b1757){return _0x133d89[_0x349b('0x15')](_0x23f0a7);}return _0x133d89[_0x349b('0x16')](_0x23f0a7)[_0x349b('0x17')]();};}function respondWithResult(_0x46f18b,_0x111803){_0x111803=_0x111803||0xc8;return function(_0x7f69d0){if(_0x7f69d0){return _0x46f18b[_0x349b('0x16')](_0x111803)[_0x349b('0x18')](_0x7f69d0);}};}function respondWithFilteredResult(_0x324e8a,_0x71af83){return function(_0x3b11c0){if(_0x3b11c0){var _0x2261aa=typeof _0x71af83[_0x349b('0x19')]===_0x349b('0x1a')&&typeof _0x71af83[_0x349b('0x1b')]===_0x349b('0x1a');var _0x1d0474=_0x3b11c0[_0x349b('0x1c')];var _0x13060e=_0x2261aa?0x0:_0x71af83['offset'];var _0x58e69a=_0x2261aa?_0x3b11c0[_0x349b('0x1c')]:_0x71af83['offset']+_0x71af83[_0x349b('0x1b')];var _0xf672f;if(_0x58e69a>=_0x1d0474){_0x58e69a=_0x1d0474;_0xf672f=0xc8;}else{_0xf672f=0xce;}_0x324e8a[_0x349b('0x16')](_0xf672f);return _0x324e8a[_0x349b('0x1d')]('Content-Range',_0x13060e+'-'+_0x58e69a+'/'+_0x1d0474)[_0x349b('0x18')](_0x3b11c0);}return null;};}function patchUpdates(_0x2a8b3c){return function(_0x39838d){try{jsonpatch[_0x349b('0x1e')](_0x39838d,_0x2a8b3c,!![]);}catch(_0x193b6e){return BPromise[_0x349b('0x1f')](_0x193b6e);}return _0x39838d['save']();};}function saveUpdates(_0x17b538,_0x3b032c){return function(_0x2e0b1e){if(_0x2e0b1e){return _0x2e0b1e['update'](_0x17b538)[_0x349b('0x20')](function(_0x291eb5){return _0x291eb5;});}return null;};}function removeEntity(_0x7be0aa,_0xda9e4e){return function(_0x4c152e){if(_0x4c152e){return _0x4c152e[_0x349b('0x21')]()['then'](function(){_0x7be0aa[_0x349b('0x16')](0xcc)[_0x349b('0x17')]();});}};}function handleEntityNotFound(_0x3e405f,_0x1f4af6){return function(_0x219c52){if(!_0x219c52){_0x3e405f[_0x349b('0x15')](0x194);}return _0x219c52;};}function handleError(_0x588987,_0x294972){_0x294972=_0x294972||0x1f4;return function(_0x256788){logger[_0x349b('0x22')](_0x256788[_0x349b('0x23')]);if(_0x256788[_0x349b('0x24')]){delete _0x256788[_0x349b('0x24')];}_0x588987['status'](_0x294972)[_0x349b('0x25')](_0x256788);};}exports['index']=function(_0x31cf7a,_0x3cf614){var _0x5c16b7={},_0x1dbdb6={},_0x3648c6={'count':0x0,'rows':[]};var _0x32958a=_[_0x349b('0x26')](db[_0x349b('0x27')]['rawAttributes'],function(_0x3c590a){return{'name':_0x3c590a['fieldName'],'type':_0x3c590a[_0x349b('0x28')][_0x349b('0x29')]};});_0x1dbdb6['model']=_[_0x349b('0x26')](_0x32958a,_0x349b('0x24'));_0x1dbdb6[_0x349b('0x2a')]=_[_0x349b('0x2b')](_0x31cf7a[_0x349b('0x2a')]);_0x1dbdb6[_0x349b('0x2c')]=_[_0x349b('0x2d')](_0x1dbdb6[_0x349b('0x2e')],_0x1dbdb6[_0x349b('0x2a')]);_0x5c16b7[_0x349b('0x2f')]=_[_0x349b('0x2d')](_0x1dbdb6[_0x349b('0x2e')],qs[_0x349b('0x30')](_0x31cf7a['query']['fields']));_0x5c16b7[_0x349b('0x2f')]=_0x5c16b7[_0x349b('0x2f')][_0x349b('0x31')]?_0x5c16b7[_0x349b('0x2f')]:_0x1dbdb6[_0x349b('0x2e')];if(!_0x31cf7a[_0x349b('0x2a')][_0x349b('0x32')](_0x349b('0x33'))){_0x5c16b7[_0x349b('0x1b')]=qs[_0x349b('0x1b')](_0x31cf7a[_0x349b('0x2a')][_0x349b('0x1b')]);_0x5c16b7[_0x349b('0x19')]=qs[_0x349b('0x19')](_0x31cf7a[_0x349b('0x2a')]['offset']);}_0x5c16b7[_0x349b('0x34')]=qs[_0x349b('0x35')](_0x31cf7a['query'][_0x349b('0x35')]);_0x5c16b7[_0x349b('0x36')]=qs['filters'](_[_0x349b('0x37')](_0x31cf7a['query'],_0x1dbdb6[_0x349b('0x2c')]),_0x32958a);if(_0x31cf7a[_0x349b('0x2a')][_0x349b('0x38')]){_0x5c16b7['where']=_[_0x349b('0x39')](_0x5c16b7[_0x349b('0x36')],{'$or':_[_0x349b('0x26')](_0x32958a,function(_0x3c32c9){if(_0x3c32c9[_0x349b('0x28')]!=='VIRTUAL'){var _0xe74641={};_0xe74641[_0x3c32c9['name']]={'$like':'%'+_0x31cf7a[_0x349b('0x2a')]['filter']+'%'};return _0xe74641;}})});}_0x5c16b7=_['merge']({},_0x5c16b7,_0x31cf7a['options']);var _0x565bfb={'where':_0x5c16b7[_0x349b('0x36')]};return db[_0x349b('0x27')][_0x349b('0x1c')](_0x565bfb)['then'](function(_0x4bd8f4){_0x3648c6['count']=_0x4bd8f4;if(_0x31cf7a[_0x349b('0x2a')][_0x349b('0x3a')]){_0x5c16b7[_0x349b('0x3b')]=[{'all':!![]}];}return db[_0x349b('0x27')][_0x349b('0x3c')](_0x5c16b7);})[_0x349b('0x20')](function(_0x45b6b1){_0x3648c6[_0x349b('0x3d')]=_0x45b6b1;return _0x3648c6;})[_0x349b('0x20')](respondWithFilteredResult(_0x3cf614,_0x5c16b7))[_0x349b('0x3e')](handleError(_0x3cf614,null));};exports[_0x349b('0x3f')]=function(_0x17b582,_0x41dcb7){var _0x2e1345={'raw':!![],'where':{'id':_0x17b582[_0x349b('0x40')]['id']}},_0xa053ad={};_0xa053ad[_0x349b('0x2e')]=_[_0x349b('0x2b')](db[_0x349b('0x27')][_0x349b('0x41')]);_0xa053ad[_0x349b('0x2a')]=_[_0x349b('0x2b')](_0x17b582[_0x349b('0x2a')]);_0xa053ad[_0x349b('0x2c')]=_[_0x349b('0x2d')](_0xa053ad[_0x349b('0x2e')],_0xa053ad['query']);_0x2e1345[_0x349b('0x2f')]=_['intersection'](_0xa053ad[_0x349b('0x2e')],qs[_0x349b('0x30')](_0x17b582[_0x349b('0x2a')][_0x349b('0x30')]));_0x2e1345[_0x349b('0x2f')]=_0x2e1345['attributes'][_0x349b('0x31')]?_0x2e1345[_0x349b('0x2f')]:_0xa053ad['model'];if(_0x17b582[_0x349b('0x2a')][_0x349b('0x3a')]){_0x2e1345[_0x349b('0x3b')]=[{'all':!![]}];}_0x2e1345=_[_0x349b('0x39')]({},_0x2e1345,_0x17b582[_0x349b('0x42')]);return db[_0x349b('0x27')][_0x349b('0x43')](_0x2e1345)['then'](handleEntityNotFound(_0x41dcb7,null))[_0x349b('0x20')](respondWithResult(_0x41dcb7,null))['catch'](handleError(_0x41dcb7,null));};exports['clone']=function(_0x2a73e6,_0x3cc9fc){var _0x348067={'where':{'id':_0x2a73e6[_0x349b('0x40')]['id']}},_0x4cf231={};_0x4cf231[_0x349b('0x2e')]=_[_0x349b('0x2b')](db[_0x349b('0x27')][_0x349b('0x41')]);_0x348067[_0x349b('0x2f')]=_[_0x349b('0x2d')](_0x4cf231['model'],qs[_0x349b('0x30')](_0x2a73e6[_0x349b('0x2a')][_0x349b('0x30')]));_0x348067[_0x349b('0x2f')]=_0x348067[_0x349b('0x2f')]['length']?_0x348067[_0x349b('0x2f')]:_0x4cf231[_0x349b('0x2e')];if(_0x2a73e6[_0x349b('0x2a')]['includeAll']){_0x348067['include']=[{'all':!![]}];}_0x348067=_['merge']({},_0x348067,_0x2a73e6[_0x349b('0x42')]);return db[_0x349b('0x27')][_0x349b('0x43')](_0x348067)[_0x349b('0x20')](handleEntityNotFound(_0x3cc9fc,null))[_0x349b('0x20')](function(_0x7a6b4d){if(_0x7a6b4d){var _0x2b3550=_0x7a6b4d[_0x349b('0x44')]({'plain':!![]});_0x2b3550=qs[_0x349b('0x45')](_0x2b3550,['id',_0x349b('0x46'),'updatedAt']);_0x2a73e6[_0x349b('0x47')]=_[_0x349b('0x45')](_0x2a73e6['body'],['id','createdAt',_0x349b('0x48')]);return db[_0x349b('0x27')]['create'](_[_0x349b('0x39')](_0x2b3550,_0x2a73e6[_0x349b('0x47')]),{'include':_0x2a73e6[_0x349b('0x2a')][_0x349b('0x3a')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3cc9fc,0xc9))['catch'](handleError(_0x3cc9fc,null));};exports['update']=function(_0x37354d,_0x307a5b){if(_0x37354d[_0x349b('0x47')]['id']){delete _0x37354d[_0x349b('0x47')]['id'];}return db['Attachment'][_0x349b('0x43')]({'where':{'id':_0x37354d[_0x349b('0x40')]['id']}})[_0x349b('0x20')](handleEntityNotFound(_0x307a5b,null))[_0x349b('0x20')](saveUpdates(_0x37354d[_0x349b('0x47')],null))[_0x349b('0x20')](respondWithResult(_0x307a5b,null))[_0x349b('0x3e')](handleError(_0x307a5b,null));};exports['destroy']=function(_0x2a0b5c,_0x4f2cb3){return db['Attachment'][_0x349b('0x43')]({'where':{'id':_0x2a0b5c[_0x349b('0x40')]['id']}})[_0x349b('0x20')](handleEntityNotFound(_0x4f2cb3,null))[_0x349b('0x20')](removeEntity(_0x4f2cb3,null))['catch'](handleError(_0x4f2cb3,null));};exports[_0x349b('0x49')]=function(_0x44af3b,_0x482113,_0x5f1a1c){_0x44af3b[_0x349b('0x47')]['name']=_0x44af3b[_0x349b('0x4a')][_0x349b('0x4b')];_0x44af3b[_0x349b('0x47')][_0x349b('0x4c')]=_0x44af3b[_0x349b('0x4a')][_0x349b('0x4d')];_0x44af3b[_0x349b('0x47')][_0x349b('0x28')]=_0x44af3b['file'][_0x349b('0x4e')];return db[_0x349b('0x27')][_0x349b('0x49')](_0x44af3b[_0x349b('0x47')])[_0x349b('0x20')](respondWithResult(_0x482113,0xc9))[_0x349b('0x3e')](handleError(_0x482113,null));};exports['download']=function(_0x166b62,_0x301a2c,_0x218c7f){return db[_0x349b('0x27')]['findOne']({'where':{'id':_0x166b62['params']['id']},'raw':!![]})[_0x349b('0x20')](handleEntityNotFound(_0x301a2c,null))['then'](function(_0x2b83b0){if(_0x2b83b0){var _0x190f4a=_0x2b83b0[_0x349b('0x4f')]!==null;var _0xfc2698=path[_0x349b('0x50')](config['root'],_0x349b('0x51'));if(_0x190f4a){_0xfc2698=path[_0x349b('0x50')](_0xfc2698,_0x349b('0x52'));}var _0x2c84ac=path[_0x349b('0x50')](_0xfc2698,_0x2b83b0['basename']);return _0x301a2c[_0x349b('0x53')](_0x2c84ac);}})[_0x349b('0x3e')](handleError(_0x301a2c,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index d64c4eb..9d8c7c7 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 _0x5cc4=['../../config/logger','moment','request-promise','path','../../config/environment','./attachment.attributes','exports','Attachment','attachments'];(function(_0x33115f,_0x3bef4c){var _0xcdaa15=function(_0x245569){while(--_0x245569){_0x33115f['push'](_0x33115f['shift']());}};_0xcdaa15(++_0x3bef4c);}(_0x5cc4,0x18c));var _0x45cc=function(_0x4429e0,_0xee6f1f){_0x4429e0=_0x4429e0-0x0;var _0x51a5b3=_0x5cc4[_0x4429e0];return _0x51a5b3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x45cc('0x0'))('api');var moment=require(_0x45cc('0x1'));var BPromise=require('bluebird');var rp=require(_0x45cc('0x2'));var fs=require('fs');var path=require(_0x45cc('0x3'));var rimraf=require('rimraf');var config=require(_0x45cc('0x4'));var attributes=require(_0x45cc('0x5'));module[_0x45cc('0x6')]=function(_0x2209ef,_0x54f310){return _0x2209ef['define'](_0x45cc('0x7'),attributes,{'tableName':_0x45cc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa547=['attachments','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x2b3bb9,_0x1556ce){var _0x5d3da5=function(_0x10e14d){while(--_0x10e14d){_0x2b3bb9['push'](_0x2b3bb9['shift']());}};_0x5d3da5(++_0x1556ce);}(_0xa547,0x1c9));var _0x7a54=function(_0x16491a,_0x54405e){_0x16491a=_0x16491a-0x0;var _0x1c8afb=_0xa547[_0x16491a];return _0x1c8afb;};'use strict';var _=require('lodash');var util=require(_0x7a54('0x0'));var logger=require(_0x7a54('0x1'))(_0x7a54('0x2'));var moment=require(_0x7a54('0x3'));var BPromise=require(_0x7a54('0x4'));var rp=require(_0x7a54('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a54('0x6'));var config=require(_0x7a54('0x7'));var attributes=require(_0x7a54('0x8'));module[_0x7a54('0x9')]=function(_0x500462,_0x47aa86){return _0x500462[_0x7a54('0xa')]('Attachment',attributes,{'tableName':_0x7a54('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 75a46a1..6e8d7a9 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 _0x2bdb=['error','code','message','result','CreateAttachment','Attachment','create','options','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4ccc7c,_0x35e855){var _0x5921f9=function(_0x944e4d){while(--_0x944e4d){_0x4ccc7c['push'](_0x4ccc7c['shift']());}};_0x5921f9(++_0x35e855);}(_0x2bdb,0x105));var _0xb2bd=function(_0x51ad81,_0xf21e4b){_0x51ad81=_0x51ad81-0x0;var _0x181ecf=_0x2bdb[_0x51ad81];return _0x181ecf;};'use strict';var _=require(_0xb2bd('0x0'));var util=require('util');var moment=require(_0xb2bd('0x1'));var BPromise=require('bluebird');var rs=require(_0xb2bd('0x2'));var fs=require('fs');var Redis=require(_0xb2bd('0x3'));var db=require(_0xb2bd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2bd('0x5'))(_0xb2bd('0x6'));var config=require(_0xb2bd('0x7'));var jayson=require(_0xb2bd('0x8'));var client=jayson[_0xb2bd('0x9')][_0xb2bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bff5b,_0x5bae78,_0x21462b){return new BPromise(function(_0x4d9d3f,_0x181f5a){return client[_0xb2bd('0xb')](_0x3bff5b,_0x21462b)[_0xb2bd('0xc')](function(_0xeaa2b7){logger[_0xb2bd('0xd')](_0xb2bd('0xe'),_0x5bae78,_0xb2bd('0xf'));logger[_0xb2bd('0x10')](_0xb2bd('0x11'),_0x5bae78,'request\x20sent',JSON[_0xb2bd('0x12')](_0xeaa2b7));if(_0xeaa2b7[_0xb2bd('0x13')]){if(_0xeaa2b7[_0xb2bd('0x13')][_0xb2bd('0x14')]===0x1f4){logger[_0xb2bd('0x13')](_0xb2bd('0xe'),_0x5bae78,_0xeaa2b7[_0xb2bd('0x13')][_0xb2bd('0x15')]);return _0x181f5a(_0xeaa2b7['error'][_0xb2bd('0x15')]);}logger['error'](_0xb2bd('0xe'),_0x5bae78,_0xeaa2b7[_0xb2bd('0x13')][_0xb2bd('0x15')]);return _0x4d9d3f(_0xeaa2b7[_0xb2bd('0x13')][_0xb2bd('0x15')]);}else{logger['info'](_0xb2bd('0xe'),_0x5bae78,_0xb2bd('0xf'));_0x4d9d3f(_0xeaa2b7[_0xb2bd('0x16')][_0xb2bd('0x15')]);}})['catch'](function(_0x14950f){logger[_0xb2bd('0x13')]('Attachment,\x20%s,\x20%s',_0x5bae78,_0x14950f);_0x181f5a(_0x14950f);});});}exports[_0xb2bd('0x17')]=function(_0x380089){var _0x387897=this;return new Promise(function(_0x315815,_0x5d848d){return db[_0xb2bd('0x18')][_0xb2bd('0x19')](_0x380089['body'],{'raw':_0x380089[_0xb2bd('0x1a')]?_0x380089[_0xb2bd('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x51c595){logger[_0xb2bd('0xd')]('CreateAttachment',_0x380089);logger[_0xb2bd('0x10')]('CreateAttachment',_0x380089,JSON[_0xb2bd('0x12')](_0x51c595));_0x315815(_0x51c595);})[_0xb2bd('0x1b')](function(_0x505c35){logger[_0xb2bd('0x13')]('CreateAttachment',_0x505c35[_0xb2bd('0x15')],_0x380089);_0x5d848d(_0x387897[_0xb2bd('0x13')](0x1f4,_0x505c35[_0xb2bd('0x15')]));});});}; \ No newline at end of file +var _0xc3fe=['options','raw','CreateAttachment','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','Attachment','body'];(function(_0x552114,_0x28d38f){var _0x23c2d7=function(_0x2bb911){while(--_0x2bb911){_0x552114['push'](_0x552114['shift']());}};_0x23c2d7(++_0x28d38f);}(_0xc3fe,0xff));var _0xec3f=function(_0x13c737,_0xc1ab62){_0x13c737=_0x13c737-0x0;var _0x34e425=_0xc3fe[_0x13c737];return _0x34e425;};'use strict';var _=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var moment=require(_0xec3f('0x2'));var BPromise=require('bluebird');var rs=require(_0xec3f('0x3'));var fs=require('fs');var Redis=require(_0xec3f('0x4'));var db=require(_0xec3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec3f('0x6'))(_0xec3f('0x7'));var config=require(_0xec3f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b0b84,_0x526183,_0x503775){return new BPromise(function(_0xcb8557,_0x5df7fc){return client[_0xec3f('0xa')](_0x3b0b84,_0x503775)[_0xec3f('0xb')](function(_0x12a7c5){logger[_0xec3f('0xc')]('Attachment,\x20%s,\x20%s',_0x526183,_0xec3f('0xd'));logger[_0xec3f('0xe')](_0xec3f('0xf'),_0x526183,_0xec3f('0xd'),JSON[_0xec3f('0x10')](_0x12a7c5));if(_0x12a7c5[_0xec3f('0x11')]){if(_0x12a7c5['error'][_0xec3f('0x12')]===0x1f4){logger[_0xec3f('0x11')](_0xec3f('0x13'),_0x526183,_0x12a7c5['error']['message']);return _0x5df7fc(_0x12a7c5[_0xec3f('0x11')]['message']);}logger['error'](_0xec3f('0x13'),_0x526183,_0x12a7c5[_0xec3f('0x11')][_0xec3f('0x14')]);return _0xcb8557(_0x12a7c5['error']['message']);}else{logger[_0xec3f('0xc')]('Attachment,\x20%s,\x20%s',_0x526183,_0xec3f('0xd'));_0xcb8557(_0x12a7c5[_0xec3f('0x15')]['message']);}})[_0xec3f('0x16')](function(_0xb8ee6f){logger[_0xec3f('0x11')](_0xec3f('0x13'),_0x526183,_0xb8ee6f);_0x5df7fc(_0xb8ee6f);});});}exports['CreateAttachment']=function(_0x7805c){var _0xc04d54=this;return new Promise(function(_0x2d338,_0xbd6461){return db[_0xec3f('0x17')]['create'](_0x7805c[_0xec3f('0x18')],{'raw':_0x7805c['options']?_0x7805c[_0xec3f('0x19')][_0xec3f('0x1a')]===undefined?!![]:![]:!![]})[_0xec3f('0xb')](function(_0x47b6f9){logger[_0xec3f('0xc')](_0xec3f('0x1b'),_0x7805c);logger['debug'](_0xec3f('0x1b'),_0x7805c,JSON[_0xec3f('0x10')](_0x47b6f9));_0x2d338(_0x47b6f9);})[_0xec3f('0x16')](function(_0x395b9a){logger['error'](_0xec3f('0x1b'),_0x395b9a[_0xec3f('0x14')],_0x7805c);_0xbd6461(_0xc04d54[_0xec3f('0x11')](0x1f4,_0x395b9a['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 9a27697..fdf50f7 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x1b3585,_0x2ea8d8){_0x1b3585=_0x1b3585-0x0;var _0x3827fe=_0xdb28[_0x1b3585];return _0x3827fe;};'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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x3bbf50,_0x3b1665){var _0x232a94=function(_0x574d30){while(--_0x574d30){_0x3bbf50['push'](_0x3bbf50['shift']());}};_0x232a94(++_0x3b1665);}(_0xb10b,0x12a));var _0xbb10=function(_0x55fa5c,_0x30bd41){_0x55fa5c=_0x55fa5c-0x0;var _0xea802f=_0xb10b[_0x55fa5c];return _0xea802f;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index f9254ea..92dfe39 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 _0x51b7=['Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined','activedirectory','baseDN','url','domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blocked','online','user','agent','then','blockedAt','add','minutes','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','use','passport','passport-local'];(function(_0x1f175e,_0x25487c){var _0x4ab74c=function(_0x301e14){while(--_0x301e14){_0x1f175e['push'](_0x1f175e['shift']());}};_0x4ab74c(++_0x25487c);}(_0x51b7,0x19e));var _0x751b=function(_0x197551,_0x2955b0){_0x197551=_0x197551-0x0;var _0x55d8b2=_0x51b7[_0x197551];return _0x55d8b2;};'use strict';var passport=require(_0x751b('0x0'));var LocalStrategy=require(_0x751b('0x1'))[_0x751b('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x751b('0x3'));var BPromise=require(_0x751b('0x4'));var util=require(_0x751b('0x5'));var db=require(_0x751b('0x6'))['db'];var authService=require(_0x751b('0x7'));var utils=require(_0x751b('0x8'));var config=require(_0x751b('0x9'));var logger=require(_0x751b('0xa'))(_0x751b('0xb'));function isActiveDirectoryConfigured(_0x278252){var _0x47dc20=![];if(typeof _0x278252['activedirectory']!==_0x751b('0xc')){_0x47dc20=_0x278252[_0x751b('0xd')][_0x751b('0xe')]&&_0x278252[_0x751b('0xd')][_0x751b('0xf')]&&_0x278252[_0x751b('0xd')][_0x751b('0x10')];}return _0x47dc20;}function adAuthenticate(_0x23f679,_0x64ad5c,_0x33b62d){return new BPromise(function(_0x230e0c,_0x27b8e6){try{var _0x3a0eaf=new ActiveDirectory(_0x23f679);_0x3a0eaf[_0x751b('0x11')](_0x64ad5c,_0x33b62d,function(_0x1d23fa,_0x383401){if(_0x1d23fa){logger[_0x751b('0x12')]('Error\x20authenticate\x20%s:\x20%s',_0x64ad5c,util[_0x751b('0x13')](_0x1d23fa,{'showHidden':![],'depth':null}));_0x27b8e6(_0x751b('0x14'));}else if(!_0x383401){logger[_0x751b('0x12')](_0x751b('0x15'),_0x64ad5c);_0x27b8e6(_0x751b('0x14'));}else{_0x230e0c(_0x383401);}});}catch(_0x2f050e){_0x27b8e6(_0x2f050e);}});}function ActiveDirectoryAuthenticate(_0x3a3a99,_0x540186,_0x5beb43,_0x13b293){var _0x3bda04,_0x2f3b41;if(!isActiveDirectoryConfigured(config)){logger[_0x751b('0x12')](_0x751b('0x16'),_0x540186);return _0x13b293(null,![],{'message':_0x751b('0x14')});}return db[_0x751b('0x17')][_0x751b('0x18')]({'where':{'id':0x1},'attributes':[_0x751b('0x19'),_0x751b('0x1a')],'raw':!![]})['then'](function(_0x4cbe77){_0x3bda04=_0x4cbe77;if(!_0x3bda04[_0x751b('0x19')]){logger[_0x751b('0x12')](_0x751b('0x1b'),_0x540186);throw new Error(_0x751b('0x14'));}return _0x3a3a99[_0x751b('0x18')]({'attributes':['id',_0x751b('0x1c'),_0x751b('0x1d'),_0x751b('0x1e'),'role',_0x751b('0x1f'),_0x751b('0x20'),'blockedAt',_0x751b('0x21')],'where':{'name':_0x540186,'role':{'$or':['admin',_0x751b('0x22'),_0x751b('0x23')]},'adSsoEnabled':!![]}});})['then'](function(_0x56d32e){if(!_0x56d32e||_0x56d32e&&_0x56d32e[_0x751b('0x1c')]!==_0x540186){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x2f3b41=_0x56d32e;var _0x4fe256=_0x2f3b41[_0x751b('0x1c')]+'@'+config['activedirectory'][_0x751b('0x10')];return adAuthenticate(config[_0x751b('0xd')],_0x4fe256,_0x5beb43);})[_0x751b('0x24')](function(_0x131098){if(_0x2f3b41[_0x751b('0x1f')]){throw new Error(_0x751b('0x14'));}if(_0x3bda04[_0x751b('0x1a')]>0x0){if(_0x2f3b41['blocked']){if(moment(_0x2f3b41[_0x751b('0x25')])[_0x751b('0x26')](_0x3bda04['blockDuration'],_0x751b('0x27'))>moment()){throw new Error(_0x751b('0x14'));}return utils['clearBlockUser'](_0x2f3b41,0x0,![],null)['then'](function(){return utils[_0x751b('0x28')](_0x2f3b41);})['then'](function(){return _0x13b293(null,_0x2f3b41);});}else{return utils[_0x751b('0x28')](_0x2f3b41)[_0x751b('0x24')](function(){return _0x13b293(null,_0x2f3b41);});}}else{return utils[_0x751b('0x28')](_0x2f3b41)[_0x751b('0x24')](function(){return _0x13b293(null,_0x2f3b41);});}})[_0x751b('0x29')](function(_0x30ed93){return _0x13b293(null,![],_0x30ed93);});}function handleError(_0xce7a1e,_0x6105e2,_0x1429e1){return _0xce7a1e[_0x751b('0x2a')](_0x6105e2||0x1f4)[_0x751b('0x2b')]({'message':_0x1429e1?_0x1429e1[_0x751b('0x2c')]||_0x1429e1:''});}exports[_0x751b('0x2d')]=function(_0x1ccc83,_0x4640bd,_0x49d1de){passport[_0x751b('0x11')](_0x751b('0x2e'),function(_0x2815dc,_0x2fb851,_0x1e786f){var _0x827599=_0x2815dc||_0x1e786f;if(_0x827599){return handleError(_0x4640bd,0x191,_0x827599);}if(!_0x2fb851){return handleError(_0x4640bd,0x194,{'message':_0x751b('0x2f')});}else{var _0x4dedef={'payload':{'id':_0x2fb851['id'],'role':_0x2fb851[_0x751b('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0x751b('0x31')](_0x4dedef)[_0x751b('0x24')](function(_0x42d7f5){_0x4640bd[_0x751b('0x32')]({'id':_0x2fb851['id'],'token':_0x42d7f5,'statusCall':'','isAlreadyLogged':_0x2fb851[_0x751b('0x21')]});});}})(_0x1ccc83,_0x4640bd,_0x49d1de);};passport[_0x751b('0x33')](_0x751b('0x2e'),new LocalStrategy({'usernameField':_0x751b('0x1c'),'passwordField':_0x751b('0x1d')},function(_0x1133e4,_0x1eba16,_0x1c0236){return ActiveDirectoryAuthenticate(db['User'],_0x1133e4,_0x1eba16,_0x1c0236);})); \ No newline at end of file +var _0xa91c=['online','admin','user','agent','then','clearBlockUser','getLicense','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','passport','Strategy','activedirectory2','util','../../mysqldb','../../config/environment','../../config/logger','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','name','password','salt','role','disabled','blocked','blockedAt'];(function(_0x153adf,_0x52f1ce){var _0x2a6479=function(_0x43e1ee){while(--_0x43e1ee){_0x153adf['push'](_0x153adf['shift']());}};_0x2a6479(++_0x52f1ce);}(_0xa91c,0x17f));var _0xca91=function(_0x1e5acf,_0x2c9c90){_0x1e5acf=_0x1e5acf-0x0;var _0x4df4ac=_0xa91c[_0x1e5acf];return _0x4df4ac;};'use strict';var passport=require(_0xca91('0x0'));var LocalStrategy=require('passport-local')[_0xca91('0x1')];var moment=require('moment');var ActiveDirectory=require(_0xca91('0x2'));var BPromise=require('bluebird');var util=require(_0xca91('0x3'));var db=require(_0xca91('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require(_0xca91('0x5'));var logger=require(_0xca91('0x6'))('api');function isActiveDirectoryConfigured(_0x26b62b){var _0x8f8120=![];if(typeof _0x26b62b[_0xca91('0x7')]!=='undefined'){_0x8f8120=_0x26b62b['activedirectory'][_0xca91('0x8')]&&_0x26b62b[_0xca91('0x7')][_0xca91('0x9')]&&_0x26b62b[_0xca91('0x7')][_0xca91('0xa')];}return _0x8f8120;}function adAuthenticate(_0x41ced5,_0x157836,_0x41673a){return new BPromise(function(_0x9a2242,_0x1b3949){try{var _0x32cf44=new ActiveDirectory(_0x41ced5);_0x32cf44[_0xca91('0xb')](_0x157836,_0x41673a,function(_0x1eeb3f,_0x104f03){if(_0x1eeb3f){logger[_0xca91('0xc')](_0xca91('0xd'),_0x157836,util['inspect'](_0x1eeb3f,{'showHidden':![],'depth':null}));_0x1b3949(_0xca91('0xe'));}else if(!_0x104f03){logger[_0xca91('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x157836);_0x1b3949(_0xca91('0xe'));}else{_0x9a2242(_0x104f03);}});}catch(_0x2bac72){_0x1b3949(_0x2bac72);}});}function ActiveDirectoryAuthenticate(_0x3db9f2,_0x4c19ee,_0x4c6335,_0x2ae7bc){var _0xdaa45c,_0xcd8c0a;if(!isActiveDirectoryConfigured(config)){logger[_0xca91('0xc')](_0xca91('0xf'),_0x4c19ee);return _0x2ae7bc(null,![],{'message':_0xca91('0xe')});}return db[_0xca91('0x10')][_0xca91('0x11')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xca91('0x12')],'raw':!![]})['then'](function(_0x235192){_0xdaa45c=_0x235192;if(!_0xdaa45c[_0xca91('0x13')]){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x4c19ee);throw new Error(_0xca91('0xe'));}return _0x3db9f2['findOne']({'attributes':['id',_0xca91('0x14'),_0xca91('0x15'),_0xca91('0x16'),_0xca91('0x17'),_0xca91('0x18'),_0xca91('0x19'),_0xca91('0x1a'),_0xca91('0x1b')],'where':{'name':_0x4c19ee,'role':{'$or':[_0xca91('0x1c'),_0xca91('0x1d'),_0xca91('0x1e')]},'adSsoEnabled':!![]}});})[_0xca91('0x1f')](function(_0x5473cd){if(!_0x5473cd||_0x5473cd&&_0x5473cd[_0xca91('0x14')]!==_0x4c19ee){throw new Error(_0xca91('0xe'));}_0xcd8c0a=_0x5473cd;var _0x3223af=_0xcd8c0a[_0xca91('0x14')]+'@'+config['activedirectory'][_0xca91('0xa')];return adAuthenticate(config[_0xca91('0x7')],_0x3223af,_0x4c6335);})[_0xca91('0x1f')](function(_0x233eef){if(_0xcd8c0a[_0xca91('0x18')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0xdaa45c['blockDuration']>0x0){if(_0xcd8c0a[_0xca91('0x19')]){if(moment(_0xcd8c0a[_0xca91('0x1a')])['add'](_0xdaa45c[_0xca91('0x12')],'minutes')>moment()){throw new Error(_0xca91('0xe'));}return utils[_0xca91('0x20')](_0xcd8c0a,0x0,![],null)[_0xca91('0x1f')](function(){return utils['getLicense'](_0xcd8c0a);})[_0xca91('0x1f')](function(){return _0x2ae7bc(null,_0xcd8c0a);});}else{return utils['getLicense'](_0xcd8c0a)['then'](function(){return _0x2ae7bc(null,_0xcd8c0a);});}}else{return utils[_0xca91('0x21')](_0xcd8c0a)[_0xca91('0x1f')](function(){return _0x2ae7bc(null,_0xcd8c0a);});}})['catch'](function(_0xf398de){return _0x2ae7bc(null,![],_0xf398de);});}function handleError(_0x23c8da,_0x33a30e,_0x4185f9){return _0x23c8da[_0xca91('0x22')](_0x33a30e||0x1f4)[_0xca91('0x23')]({'message':_0x4185f9?_0x4185f9[_0xca91('0x24')]||_0x4185f9:''});}exports['login']=function(_0x255daa,_0x50cd64,_0x5a2657){passport['authenticate'](_0xca91('0x25'),function(_0x253afd,_0x14461e,_0x249abf){var _0x1d2ef1=_0x253afd||_0x249abf;if(_0x1d2ef1){return handleError(_0x50cd64,0x191,_0x1d2ef1);}if(!_0x14461e){return handleError(_0x50cd64,0x194,{'message':_0xca91('0x26')});}else{var _0x46250c={'payload':{'id':_0x14461e['id'],'role':_0x14461e[_0xca91('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0xca91('0x27')](_0x46250c)['then'](function(_0x41cf38){_0x50cd64['json']({'id':_0x14461e['id'],'token':_0x41cf38,'statusCall':'','isAlreadyLogged':_0x14461e[_0xca91('0x1b')]});});}})(_0x255daa,_0x50cd64,_0x5a2657);};passport[_0xca91('0x28')]('ad-login',new LocalStrategy({'usernameField':_0xca91('0x14'),'passwordField':_0xca91('0x15')},function(_0x41a91a,_0x27f9d7,_0x571608){return ActiveDirectoryAuthenticate(db['User'],_0x41a91a,_0x27f9d7,_0x571608);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 38cbb90..8ffcac9 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 _0x1f81=['exports','express','Router','post','login'];(function(_0x3e05a2,_0x2fd92d){var _0x54d611=function(_0x1c04b7){while(--_0x1c04b7){_0x3e05a2['push'](_0x3e05a2['shift']());}};_0x54d611(++_0x2fd92d);}(_0x1f81,0xc4));var _0x11f8=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x1f81[_0x2fc012];return _0x2891f9;};'use strict';var express=require(_0x11f8('0x0'));var router=express[_0x11f8('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x11f8('0x2')]('/',controller[_0x11f8('0x3')]);module[_0x11f8('0x4')]=router; \ No newline at end of file +var _0xa01e=['exports','Router','login'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa01e,0x1ae));var _0xea01=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa01e[_0x4b7b62];return _0x2280df;};'use strict';var express=require('express');var router=express[_0xea01('0x0')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0xea01('0x1')]);module[_0xea01('0x2')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index cd860f7..a9892f8 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(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x7a54,0x106));var _0x47a5=function(_0x4e246f,_0x1fea4d){_0x4e246f=_0x4e246f-0x0;var _0x171bc6=_0x7a54[_0x4e246f];return _0x171bc6;};'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(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x7a54,0x106));var _0x47a5=function(_0x2909b4,_0x144cf9){_0x2909b4=_0x2909b4-0x0;var _0x15b928=_0x7a54[_0x2909b4];return _0x15b928;};'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 99a3f05..bfb5e25 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 _0x88ce=['exports','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie'];(function(_0x22a9b7,_0x58e5d4){var _0x8a8568=function(_0x271479){while(--_0x271479){_0x22a9b7['push'](_0x22a9b7['shift']());}};_0x8a8568(++_0x58e5d4);}(_0x88ce,0xab));var _0xe88c=function(_0x190c2d,_0x2c9528){_0x190c2d=_0x190c2d-0x0;var _0x19f5d3=_0x88ce[_0x190c2d];return _0x19f5d3;};'use strict';var express=require('express');var passport=require(_0xe88c('0x0'));var router=express['Router']();var controller=require(_0xe88c('0x1'));var userController=require(_0xe88c('0x2'));var authService=require(_0xe88c('0x3'));router[_0xe88c('0x4')]('/',controller[_0xe88c('0x5')]);router[_0xe88c('0x4')]('/callback',controller[_0xe88c('0x6')],authService[_0xe88c('0x7')],userController[_0xe88c('0x5')],authService[_0xe88c('0x8')]);module[_0xe88c('0x9')]=router; \ No newline at end of file +var _0xbc8d=['../user/user.controller.js','../../components/auth/service','login','get','/callback','isMiddleware','setTokenCookie','express','Router','./authGoogle.controller'];(function(_0x3f0c5d,_0x1f390a){var _0x172300=function(_0x238f98){while(--_0x238f98){_0x3f0c5d['push'](_0x3f0c5d['shift']());}};_0x172300(++_0x1f390a);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xdbc8('0x0'));var passport=require('passport');var router=express[_0xdbc8('0x1')]();var controller=require(_0xdbc8('0x2'));var userController=require(_0xdbc8('0x3'));var authService=require(_0xdbc8('0x4'));router['get']('/',controller[_0xdbc8('0x5')]);router[_0xdbc8('0x6')](_0xdbc8('0x7'),controller['callback'],authService[_0xdbc8('0x8')],userController[_0xdbc8('0x5')],authService[_0xdbc8('0x9')]);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 3f77fb9..52e33a2 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 _0x850d=['add','getLicense','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','/reset/','Reset\x20Email\x20sent!','catch','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','password','resetPasswordToken','Password\x20reset!','use','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','minutes','clearBlockUser'];(function(_0x1fe28d,_0x65a199){var _0x304897=function(_0x476c63){while(--_0x476c63){_0x1fe28d['push'](_0x1fe28d['shift']());}};_0x304897(++_0x65a199);}(_0x850d,0xda));var _0xd850=function(_0x34bbe3,_0x28d122){_0x34bbe3=_0x34bbe3-0x0;var _0x4301aa=_0x850d[_0x34bbe3];return _0x4301aa;};'use strict';var util=require('util');var passport=require(_0xd850('0x0'));var LocalStrategy=require(_0xd850('0x1'))['Strategy'];var jayson=require(_0xd850('0x2'));var _=require(_0xd850('0x3'));var rs=require(_0xd850('0x4'));var moment=require(_0xd850('0x5'));var db=require(_0xd850('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xd850('0x7'));var client=jayson[_0xd850('0x8')][_0xd850('0x9')]({'port':0x232b});function localAuthenticate(_0x5c4a49,_0x7c4aea,_0x26ab23,_0x5c06b3){var _0xefb31b,_0x18e768;return db[_0xd850('0xa')][_0xd850('0xb')]({'where':{'id':0x1},'attributes':[_0xd850('0xc'),_0xd850('0xd')],'raw':!![]})[_0xd850('0xe')](function(_0x4ac337){_0xefb31b=_0x4ac337;return _0x5c4a49['findOne']({'attributes':['id',_0xd850('0xf'),'password',_0xd850('0x10'),_0xd850('0x11'),_0xd850('0x12'),_0xd850('0x13'),_0xd850('0x14'),'loginAttempts'],'where':{'name':_0x7c4aea,'role':{'$or':[_0xd850('0x15'),_0xd850('0x16'),_0xd850('0x17')]}}});})[_0xd850('0xe')](function(_0x3913e3){if(!_0x3913e3||_0x3913e3&&_0x3913e3['name']!==_0x7c4aea){throw new Error(_0xd850('0x18'));}else{_0x18e768=_0x3913e3;return _0x18e768;}})[_0xd850('0xe')](function(){_0x18e768['authenticate'](_0x26ab23,function(_0x1c7094,_0x4ac1c9){var _0x8835a8=_0x18e768[_0xd850('0x19')]+0x1;if(_0x1c7094){return _0x5c06b3(_0x1c7094);}else if(!_0x4ac1c9){if(_0x18e768[_0xd850('0x12')]){return _0x5c06b3(null,![],{'message':_0xd850('0x18')});}else if(_0xefb31b[_0xd850('0xc')]>0x0){if(_0x18e768['blocked']){if(_0xefb31b[_0xd850('0xd')]>0x0){if(moment(_0x18e768['blockedAt'])['add'](_0xefb31b[_0xd850('0xd')],_0xd850('0x1a'))>moment()){return _0x5c06b3(null,![],{'message':_0xd850('0x18')});}else{return utils['clearBlockUser'](_0x18e768,_0x8835a8,![],null)[_0xd850('0xe')](function(){return _0x5c06b3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5c06b3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x8835a8>=_0xefb31b[_0xd850('0xc')]){return utils[_0xd850('0x1b')](_0x18e768,0x0,!![],moment())[_0xd850('0xe')](function(){return _0x5c06b3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xd850('0x1b')](_0x18e768,_0x8835a8,![],null)[_0xd850('0xe')](function(){return _0x5c06b3(null,![],{'message':_0xd850('0x18')});});}}}else{return _0x5c06b3(null,![],{'message':_0xd850('0x18')});}}else{if(_0x18e768[_0xd850('0x12')]){return _0x5c06b3(null,![],{'message':_0xd850('0x18')});}else if(_0xefb31b['allowedLoginAttempts']>0x0){if(_0x18e768[_0xd850('0x13')]){if(_0xefb31b[_0xd850('0xd')]>0x0){if(moment(_0x18e768[_0xd850('0x14')])[_0xd850('0x1c')](_0xefb31b['blockDuration'],_0xd850('0x1a'))>moment()){return _0x5c06b3(null,![],{'message':_0xd850('0x18')});}else{return utils[_0xd850('0x1b')](_0x18e768,0x0,![],null)['then'](function(){return utils[_0xd850('0x1d')](_0x18e768);})[_0xd850('0xe')](function(){return _0x5c06b3(null,_0x18e768);});}}else{return _0x5c06b3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xd850('0x1b')](_0x18e768,0x0,![],null)[_0xd850('0xe')](function(){return utils[_0xd850('0x1d')](_0x18e768);})['then'](function(){return _0x5c06b3(null,_0x18e768);})['catch'](function(_0x1a074f){return _0x5c06b3(null,![],_0x1a074f);});}}else{if(_0x18e768[_0xd850('0x13')]){return _0x5c06b3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x18e768)['then'](function(){return _0x5c06b3(null,_0x18e768);});}}}});})['catch'](function(_0x17d6f1){return _0x5c06b3(null,![],_0x17d6f1);});}function sendServiceMail(_0x2506dc){return db[_0xd850('0x1e')][_0xd850('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xd850('0xf'),_0xd850('0x20')],'include':[{'model':db[_0xd850('0x21')],'as':_0xd850('0x22'),'include':[{'model':db[_0xd850('0x23')],'as':_0xd850('0x23')}]}]})[_0xd850('0xe')](function(_0x11b666){if(!_0x11b666){throw new Error(_0xd850('0x24'));}var _0x186c2f=_0x11b666['getSmtpOptions']();var _0x4e1bd4={'account':_0x186c2f,'message':_[_0xd850('0x25')]({'from':util[_0xd850('0x26')]('\x22%s\x22\x20<%s>',_0x11b666[_0xd850('0xf')],_0x11b666['email']||_0x11b666[_0xd850('0x22')][_0xd850('0x16')])},_0x2506dc)};return client[_0xd850('0x27')](_0xd850('0x28'),_0x4e1bd4);})['then'](function(_0x1fe30f){if(_0x1fe30f[_0xd850('0x29')]){throw new Error(util[_0xd850('0x26')](_0xd850('0x2a'),_0x1fe30f[_0xd850('0x29')][_0xd850('0x2b')]||JSON['stringify'](_0x1fe30f[_0xd850('0x29')])));}return!![];});}function handleError(_0x9ed981,_0x61bf2f,_0xd592ef){return _0x9ed981[_0xd850('0x2c')](_0x61bf2f||0x1f4)[_0xd850('0x2d')]({'message':_0xd592ef?_0xd592ef[_0xd850('0x2b')]||_0xd592ef:''});}exports['login']=function(_0x40626e,_0x3e44d5,_0x3b8178){passport[_0xd850('0x2e')](_0xd850('0x2f'),function(_0x129f87,_0x3bfc8a,_0x367d9e){var _0x294eae=_0x129f87||_0x367d9e;if(_0x294eae){return handleError(_0x3e44d5,0x191,_0x294eae);}if(!_0x3bfc8a){return handleError(_0x3e44d5,0x194,{'message':_0xd850('0x30')});}else{var _0x23270d={'payload':{'id':_0x3bfc8a['id'],'role':_0x3bfc8a[_0xd850('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xd850('0x31')](_0x23270d)['then'](function(_0x5c6317){_0x3e44d5[_0xd850('0x32')]({'id':_0x3bfc8a['id'],'token':_0x5c6317,'statusCall':'','isAlreadyLogged':_0x3bfc8a['online']});});}})(_0x40626e,_0x3e44d5,_0x3b8178);};exports[_0xd850('0x33')]=function(_0x1682b7,_0x2f66f9){if(!_0x1682b7[_0xd850('0x34')][_0xd850('0x20')]){return handleError(_0x2f66f9,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x259006=rs[_0xd850('0x35')]();_0x1682b7[_0xd850('0x34')][_0xd850('0x20')]=_0x1682b7[_0xd850('0x34')][_0xd850('0x20')][_0xd850('0x36')]()[_0xd850('0x37')]();var _0xf0a816;return db['Setting'][_0xd850('0xb')]({'where':{'id':0x1},'attributes':[_0xd850('0xc'),_0xd850('0xd')],'raw':!![]})['then'](function(_0x4541dd){_0xf0a816=_0x4541dd;return db[_0xd850('0x38')][_0xd850('0x1f')]({'where':{'email':_0x1682b7[_0xd850('0x34')][_0xd850('0x20')]}});})[_0xd850('0xe')](function(_0x9432c0){if(!_0x9432c0){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x9432c0[_0xd850('0x12')]){throw new Error(_0xd850('0x39'));}if(_0x9432c0[_0xd850('0x13')]){if(moment(_0x9432c0['blockedAt'])[_0xd850('0x1c')](_0xf0a816['blockDuration'],_0xd850('0x1a'))>moment()){throw new Error(_0xd850('0x3a'));}else{_0x9432c0['blocked']=![];_0x9432c0[_0xd850('0x14')]=null;}}_0x9432c0['resetPasswordToken']=_0x259006;_0x9432c0[_0xd850('0x3b')]=Date[_0xd850('0x3c')]()+0x36ee80;return _0x9432c0[_0xd850('0x3d')]();})['then'](function(){return sendServiceMail({'to':_0x1682b7[_0xd850('0x34')][_0xd850('0x20')],'subject':_0xd850('0x3e'),'text':_0xd850('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xd850('0x40')+_0x1682b7[_0xd850('0x41')][_0xd850('0x42')]+_0xd850('0x43')+_0x259006+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xd850('0xe')](function(){_0x2f66f9[_0xd850('0x2c')](0xc8)[_0xd850('0x2d')]({'message':_0xd850('0x44')});})[_0xd850('0x45')](function(_0x6a6767){return handleError(_0x2f66f9,0x1f4,_0x6a6767);});};exports[_0xd850('0x46')]=function(_0x41ab96,_0x3d18ec){return db[_0xd850('0x38')][_0xd850('0x1f')]({'where':{'resetPasswordToken':_0x41ab96['params'][_0xd850('0x47')],'resetPasswordExpires':{'$gt':Date[_0xd850('0x3c')]()}}})['then'](function(_0x45d65e){if(!_0x45d65e){throw new Error(_0xd850('0x48'));}return db[_0xd850('0xa')][_0xd850('0xb')]({'attributes':['id',_0xd850('0x49'),_0xd850('0x4a'),'passwordHistoryLimit']})[_0xd850('0xe')](function(_0x3739a1){if(_0x3739a1[_0xd850('0x49')])authService[_0xd850('0x4b')](_0x41ab96[_0xd850('0x34')]['password']);if(!_0x3739a1[_0xd850('0x4a')]||!_0x45d65e[_0xd850('0x4c')])return _0x45d65e;authService[_0xd850('0x4d')](_0x41ab96[_0xd850('0x34')]['password'],_0x45d65e[_0xd850('0x4c')],_0x3739a1['passwordHistoryLimit']);return _0x45d65e;})[_0xd850('0xe')](function(){_0x45d65e['password']=_0x41ab96[_0xd850('0x34')][_0xd850('0x4e')];_0x45d65e[_0xd850('0x4f')]=null;_0x45d65e[_0xd850('0x3b')]=null;return _0x45d65e[_0xd850('0x3d')]();});})['then'](function(){_0x3d18ec[_0xd850('0x2c')](0xc8)[_0xd850('0x2d')]({'message':_0xd850('0x50')});})['catch'](function(_0x1511d1){return handleError(_0x3d18ec,0x1f4,_0x1511d1);});};passport[_0xd850('0x51')](_0xd850('0x2f'),new LocalStrategy({'usernameField':_0xd850('0xf'),'passwordField':'password'},function(_0x34cd70,_0x416602,_0x1d89b7){return localAuthenticate(db['User'],_0x34cd70,_0x416602,_0x1d89b7);})); \ No newline at end of file +var _0xc4fe=['/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','Password\x20reset!','use','util','passport','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../config/utils','Setting','findOne','blockDuration','password','role','disabled','blockedAt','admin','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','allowedLoginAttempts','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','email','user','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','local-login','signToken','json','forgot','body','generate','trim','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','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','host'];(function(_0x39448d,_0x51984e){var _0x3d5932=function(_0x1799bf){while(--_0x1799bf){_0x39448d['push'](_0x39448d['shift']());}};_0x3d5932(++_0x51984e);}(_0xc4fe,0x184));var _0xec4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4fe[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xec4f('0x0'));var passport=require(_0xec4f('0x1'));var LocalStrategy=require('passport-local')[_0xec4f('0x2')];var jayson=require(_0xec4f('0x3'));var _=require('lodash');var rs=require(_0xec4f('0x4'));var moment=require(_0xec4f('0x5'));var db=require(_0xec4f('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xec4f('0x7'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x2570ff,_0x2bebc5,_0x443e77,_0x293083){var _0x15a763,_0x4d8c16;return db[_0xec4f('0x8')][_0xec4f('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xec4f('0xa')],'raw':!![]})['then'](function(_0x275b16){_0x15a763=_0x275b16;return _0x2570ff[_0xec4f('0x9')]({'attributes':['id','name',_0xec4f('0xb'),'salt',_0xec4f('0xc'),_0xec4f('0xd'),'blocked',_0xec4f('0xe'),'loginAttempts'],'where':{'name':_0x2bebc5,'role':{'$or':[_0xec4f('0xf'),'user',_0xec4f('0x10')]}}});})[_0xec4f('0x11')](function(_0x2e55af){if(!_0x2e55af||_0x2e55af&&_0x2e55af[_0xec4f('0x12')]!==_0x2bebc5){throw new Error(_0xec4f('0x13'));}else{_0x4d8c16=_0x2e55af;return _0x4d8c16;}})[_0xec4f('0x11')](function(){_0x4d8c16[_0xec4f('0x14')](_0x443e77,function(_0xe99ab1,_0x521313){var _0x38134f=_0x4d8c16[_0xec4f('0x15')]+0x1;if(_0xe99ab1){return _0x293083(_0xe99ab1);}else if(!_0x521313){if(_0x4d8c16[_0xec4f('0xd')]){return _0x293083(null,![],{'message':_0xec4f('0x13')});}else if(_0x15a763[_0xec4f('0x16')]>0x0){if(_0x4d8c16[_0xec4f('0x17')]){if(_0x15a763[_0xec4f('0xa')]>0x0){if(moment(_0x4d8c16[_0xec4f('0xe')])[_0xec4f('0x18')](_0x15a763['blockDuration'],_0xec4f('0x19'))>moment()){return _0x293083(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x4d8c16,_0x38134f,![],null)[_0xec4f('0x11')](function(){return _0x293083(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x293083(null,![],{'message':_0xec4f('0x13')});}}else{if(_0x38134f>=_0x15a763[_0xec4f('0x16')]){return utils[_0xec4f('0x1a')](_0x4d8c16,0x0,!![],moment())[_0xec4f('0x11')](function(){return _0x293083(null,![],{'message':_0xec4f('0x13')});});}else{return utils[_0xec4f('0x1a')](_0x4d8c16,_0x38134f,![],null)[_0xec4f('0x11')](function(){return _0x293083(null,![],{'message':_0xec4f('0x13')});});}}}else{return _0x293083(null,![],{'message':_0xec4f('0x13')});}}else{if(_0x4d8c16[_0xec4f('0xd')]){return _0x293083(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x15a763[_0xec4f('0x16')]>0x0){if(_0x4d8c16[_0xec4f('0x17')]){if(_0x15a763[_0xec4f('0xa')]>0x0){if(moment(_0x4d8c16[_0xec4f('0xe')])[_0xec4f('0x18')](_0x15a763[_0xec4f('0xa')],_0xec4f('0x19'))>moment()){return _0x293083(null,![],{'message':_0xec4f('0x13')});}else{return utils['clearBlockUser'](_0x4d8c16,0x0,![],null)[_0xec4f('0x11')](function(){return utils[_0xec4f('0x1b')](_0x4d8c16);})[_0xec4f('0x11')](function(){return _0x293083(null,_0x4d8c16);});}}else{return _0x293083(null,![],{'message':_0xec4f('0x13')});}}else{return utils['clearBlockUser'](_0x4d8c16,0x0,![],null)['then'](function(){return utils[_0xec4f('0x1b')](_0x4d8c16);})[_0xec4f('0x11')](function(){return _0x293083(null,_0x4d8c16);})['catch'](function(_0x53d1a9){return _0x293083(null,![],_0x53d1a9);});}}else{if(_0x4d8c16[_0xec4f('0x17')]){return _0x293083(null,![],{'message':_0xec4f('0x13')});}else{return utils['getLicense'](_0x4d8c16)['then'](function(){return _0x293083(null,_0x4d8c16);});}}}});})[_0xec4f('0x1c')](function(_0x4d48a0){return _0x293083(null,![],_0x4d48a0);});}function sendServiceMail(_0x1605bc){return db[_0xec4f('0x1d')]['find']({'where':{'service':!![]},'attributes':['id',_0xec4f('0x12'),'email'],'include':[{'model':db[_0xec4f('0x1e')],'as':_0xec4f('0x1f'),'include':[{'model':db[_0xec4f('0x20')],'as':_0xec4f('0x20')}]}]})[_0xec4f('0x11')](function(_0x4f7c62){if(!_0x4f7c62){throw new Error(_0xec4f('0x21'));}var _0x5b5a3d=_0x4f7c62[_0xec4f('0x22')]();var _0x4740c8={'account':_0x5b5a3d,'message':_['merge']({'from':util[_0xec4f('0x23')]('\x22%s\x22\x20<%s>',_0x4f7c62[_0xec4f('0x12')],_0x4f7c62[_0xec4f('0x24')]||_0x4f7c62['Smtp'][_0xec4f('0x25')])},_0x1605bc)};return client[_0xec4f('0x26')]('SendMail',_0x4740c8);})[_0xec4f('0x11')](function(_0x1eac14){if(_0x1eac14[_0xec4f('0x27')]){throw new Error(util['format'](_0xec4f('0x28'),_0x1eac14[_0xec4f('0x27')][_0xec4f('0x29')]||JSON['stringify'](_0x1eac14[_0xec4f('0x27')])));}return!![];});}function handleError(_0x5db9ae,_0x26fd78,_0x5868b1){return _0x5db9ae[_0xec4f('0x2a')](_0x26fd78||0x1f4)[_0xec4f('0x2b')]({'message':_0x5868b1?_0x5868b1[_0xec4f('0x29')]||_0x5868b1:''});}exports['login']=function(_0x13af70,_0x49e2d5,_0x25e503){passport['authenticate'](_0xec4f('0x2c'),function(_0x4095c3,_0x478b92,_0x3bd112){var _0x451825=_0x4095c3||_0x3bd112;if(_0x451825){return handleError(_0x49e2d5,0x191,_0x451825);}if(!_0x478b92){return handleError(_0x49e2d5,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x5a0389={'payload':{'id':_0x478b92['id'],'role':_0x478b92['role']},'options':{'expiresIn':0x15180}};return authService[_0xec4f('0x2d')](_0x5a0389)[_0xec4f('0x11')](function(_0x1461d5){_0x49e2d5[_0xec4f('0x2e')]({'id':_0x478b92['id'],'token':_0x1461d5,'statusCall':'','isAlreadyLogged':_0x478b92['online']});});}})(_0x13af70,_0x49e2d5,_0x25e503);};exports[_0xec4f('0x2f')]=function(_0x3bafec,_0x29ecf1){if(!_0x3bafec[_0xec4f('0x30')]['email']){return handleError(_0x29ecf1,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x18dd60=rs[_0xec4f('0x31')]();_0x3bafec[_0xec4f('0x30')]['email']=_0x3bafec[_0xec4f('0x30')][_0xec4f('0x24')][_0xec4f('0x32')]()['toLowerCase']();var _0x4df2cb;return db['Setting'][_0xec4f('0x9')]({'where':{'id':0x1},'attributes':[_0xec4f('0x16'),'blockDuration'],'raw':!![]})[_0xec4f('0x11')](function(_0x21cc43){_0x4df2cb=_0x21cc43;return db[_0xec4f('0x33')][_0xec4f('0x34')]({'where':{'email':_0x3bafec[_0xec4f('0x30')][_0xec4f('0x24')]}});})[_0xec4f('0x11')](function(_0x4d483b){if(!_0x4d483b){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x4d483b[_0xec4f('0xd')]){throw new Error(_0xec4f('0x35'));}if(_0x4d483b[_0xec4f('0x17')]){if(moment(_0x4d483b[_0xec4f('0xe')])[_0xec4f('0x18')](_0x4df2cb[_0xec4f('0xa')],_0xec4f('0x19'))>moment()){throw new Error(_0xec4f('0x36'));}else{_0x4d483b[_0xec4f('0x17')]=![];_0x4d483b[_0xec4f('0xe')]=null;}}_0x4d483b[_0xec4f('0x37')]=_0x18dd60;_0x4d483b[_0xec4f('0x38')]=Date[_0xec4f('0x39')]()+0x36ee80;return _0x4d483b[_0xec4f('0x3a')]();})[_0xec4f('0x11')](function(){return sendServiceMail({'to':_0x3bafec[_0xec4f('0x30')][_0xec4f('0x24')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xec4f('0x3b')+_0xec4f('0x3c')+'https://'+_0x3bafec['headers'][_0xec4f('0x3d')]+_0xec4f('0x3e')+_0x18dd60+'\x0a\x0a'+_0xec4f('0x3f')});})[_0xec4f('0x11')](function(){_0x29ecf1['status'](0xc8)['send']({'message':_0xec4f('0x40')});})['catch'](function(_0x28972c){return handleError(_0x29ecf1,0x1f4,_0x28972c);});};exports[_0xec4f('0x41')]=function(_0x2e599b,_0x11baf5){return db[_0xec4f('0x33')]['find']({'where':{'resetPasswordToken':_0x2e599b[_0xec4f('0x42')][_0xec4f('0x43')],'resetPasswordExpires':{'$gt':Date[_0xec4f('0x39')]()}}})[_0xec4f('0x11')](function(_0x4002bd){if(!_0x4002bd){throw new Error(_0xec4f('0x44'));}return db[_0xec4f('0x8')][_0xec4f('0x9')]({'attributes':['id','securePassword',_0xec4f('0x45'),_0xec4f('0x46')]})[_0xec4f('0x11')](function(_0x4ba688){if(_0x4ba688['securePassword'])authService[_0xec4f('0x47')](_0x2e599b[_0xec4f('0x30')][_0xec4f('0xb')]);if(!_0x4ba688[_0xec4f('0x45')]||!_0x4002bd['previousPasswords'])return _0x4002bd;authService[_0xec4f('0x48')](_0x2e599b[_0xec4f('0x30')]['password'],_0x4002bd['previousPasswords'],_0x4ba688[_0xec4f('0x46')]);return _0x4002bd;})[_0xec4f('0x11')](function(){_0x4002bd[_0xec4f('0xb')]=_0x2e599b['body'][_0xec4f('0xb')];_0x4002bd['resetPasswordToken']=null;_0x4002bd[_0xec4f('0x38')]=null;return _0x4002bd[_0xec4f('0x3a')]();});})['then'](function(){_0x11baf5[_0xec4f('0x2a')](0xc8)[_0xec4f('0x2b')]({'message':_0xec4f('0x49')});})[_0xec4f('0x1c')](function(_0xe0585f){return handleError(_0x11baf5,0x1f4,_0xe0585f);});};passport[_0xec4f('0x4a')](_0xec4f('0x2c'),new LocalStrategy({'usernameField':_0xec4f('0x12'),'passwordField':_0xec4f('0xb')},function(_0x203986,_0x2ecf7d,_0x40a4b1){return localAuthenticate(db[_0xec4f('0x33')],_0x203986,_0x2ecf7d,_0x40a4b1);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 18905b3..d0e0531 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 _0xa2d9=['post','login','/forgot','forgot','/reset/:token','Router','./authLocal.controller'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0xa2d9,0x1cc));var _0x9a2d=function(_0x2a1f67,_0x5aa54a){_0x2a1f67=_0x2a1f67-0x0;var _0x9c73b=_0xa2d9[_0x2a1f67];return _0x9c73b;};'use strict';var express=require('express');var router=express[_0x9a2d('0x0')]();var controller=require(_0x9a2d('0x1'));router[_0x9a2d('0x2')]('/',controller[_0x9a2d('0x3')]);router[_0x9a2d('0x2')](_0x9a2d('0x4'),controller[_0x9a2d('0x5')]);router[_0x9a2d('0x2')](_0x9a2d('0x6'),controller['reset']);module['exports']=router; \ No newline at end of file +var _0x269d=['express','./authLocal.controller','post','login','forgot','/reset/:token','reset','exports'];(function(_0x329146,_0x45d0d1){var _0x3d6cee=function(_0x1315c6){while(--_0x1315c6){_0x329146['push'](_0x329146['shift']());}};_0x3d6cee(++_0x45d0d1);}(_0x269d,0x168));var _0xd269=function(_0x202e9c,_0x265718){_0x202e9c=_0x202e9c-0x0;var _0x24041a=_0x269d[_0x202e9c];return _0x24041a;};'use strict';var express=require(_0xd269('0x0'));var router=express['Router']();var controller=require(_0xd269('0x1'));router[_0xd269('0x2')]('/',controller[_0xd269('0x3')]);router[_0xd269('0x2')]('/forgot',controller[_0xd269('0x4')]);router[_0xd269('0x2')](_0xd269('0x5'),controller[_0xd269('0x6')]);module[_0xd269('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index c8e45a7..8384a94 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 _0xa599=['BOOLEAN','sequelize','exports'];(function(_0x34311c,_0x52a317){var _0x4b8b35=function(_0x16888a){while(--_0x16888a){_0x34311c['push'](_0x34311c['shift']());}};_0x4b8b35(++_0x52a317);}(_0xa599,0x139));var _0x9a59=function(_0x8a4f3c,_0x38bfe0){_0x8a4f3c=_0x8a4f3c-0x0;var _0x4859f5=_0xa599[_0x8a4f3c];return _0x4859f5;};'use strict';var Sequelize=require(_0x9a59('0x0'));module[_0x9a59('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x9a59('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0xf11c=['INTEGER','sequelize'];(function(_0x48e93b,_0x4e3c59){var _0x4fe518=function(_0x377621){while(--_0x377621){_0x48e93b['push'](_0x48e93b['shift']());}};_0x4fe518(++_0x4e3c59);}(_0xf11c,0x1a1));var _0xcf11=function(_0x169b09,_0x3a59d2){_0x169b09=_0x169b09-0x0;var _0x5ce9a5=_0xf11c[_0x169b09];return _0x5ce9a5;};'use strict';var Sequelize=require(_0xcf11('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xcf11('0x1')],'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 94b8c51..d976afa 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 _0x59e6=['status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','map','Automation','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','where','type','VIRTUAL','filter','options','count','findAll','rows','catch','show','params','include','merge','find','create','body','Condition','addConditions','omit','ids','findOne','order','getConditions','addActions','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0xea35d1,_0x302471){var _0x1d7a7c=function(_0x1bc101){while(--_0x1bc101){_0xea35d1['push'](_0xea35d1['shift']());}};_0x1d7a7c(++_0x302471);}(_0x59e6,0xea));var _0x659e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x59e6[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x659e('0x0'));var rimraf=require(_0x659e('0x1'));var zipdir=require(_0x659e('0x2'));var jsonpatch=require(_0x659e('0x3'));var rp=require(_0x659e('0x4'));var moment=require(_0x659e('0x5'));var BPromise=require(_0x659e('0x6'));var Mustache=require('mustache');var util=require(_0x659e('0x7'));var path=require('path');var sox=require(_0x659e('0x8'));var csv=require(_0x659e('0x9'));var ejs=require(_0x659e('0xa'));var fs=require('fs');var fs_extra=require(_0x659e('0xb'));var _=require(_0x659e('0xc'));var squel=require(_0x659e('0xd'));var crypto=require(_0x659e('0xe'));var jsforce=require(_0x659e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x659e('0x9'));var querystring=require(_0x659e('0x10'));var Papa=require(_0x659e('0x11'));var Redis=require(_0x659e('0x12'));var authService=require(_0x659e('0x13'));var qs=require(_0x659e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x659e('0x15'));var logger=require('../../config/logger')(_0x659e('0x16'));var utils=require(_0x659e('0x17'));var config=require(_0x659e('0x18'));var licenseUtil=require(_0x659e('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c6c6c,_0x584e94){_0x584e94=_0x584e94||0xcc;return function(_0x4f84c8){if(_0x4f84c8){return _0x2c6c6c[_0x659e('0x1a')](_0x584e94);}return _0x2c6c6c[_0x659e('0x1b')](_0x584e94)[_0x659e('0x1c')]();};}function respondWithResult(_0x100d76,_0x5aa51b){_0x5aa51b=_0x5aa51b||0xc8;return function(_0x3a4d1f){if(_0x3a4d1f){return _0x100d76[_0x659e('0x1b')](_0x5aa51b)[_0x659e('0x1d')](_0x3a4d1f);}};}function respondWithFilteredResult(_0x3775d3,_0x17bb05){return function(_0x564ee5){if(_0x564ee5){var _0x363e11=typeof _0x17bb05[_0x659e('0x1e')]===_0x659e('0x1f')&&typeof _0x17bb05[_0x659e('0x20')]==='undefined';var _0x42fbe8=_0x564ee5['count'];var _0x15a36b=_0x363e11?0x0:_0x17bb05['offset'];var _0x135392=_0x363e11?_0x564ee5['count']:_0x17bb05[_0x659e('0x1e')]+_0x17bb05[_0x659e('0x20')];var _0x23064a;if(_0x135392>=_0x42fbe8){_0x135392=_0x42fbe8;_0x23064a=0xc8;}else{_0x23064a=0xce;}_0x3775d3[_0x659e('0x1b')](_0x23064a);return _0x3775d3[_0x659e('0x21')](_0x659e('0x22'),_0x15a36b+'-'+_0x135392+'/'+_0x42fbe8)['json'](_0x564ee5);}return null;};}function patchUpdates(_0x179955){return function(_0x3bd0cc){try{jsonpatch[_0x659e('0x23')](_0x3bd0cc,_0x179955,!![]);}catch(_0x52e0c4){return BPromise['reject'](_0x52e0c4);}return _0x3bd0cc[_0x659e('0x24')]();};}function saveUpdates(_0xf180d0,_0xeda85e){return function(_0x4fe1d4){if(_0x4fe1d4){return _0x4fe1d4[_0x659e('0x25')](_0xf180d0)['then'](function(_0x45076f){return _0x45076f;});}return null;};}function removeEntity(_0x54995b,_0xaf8511){return function(_0x512962){if(_0x512962){return _0x512962[_0x659e('0x26')]()[_0x659e('0x27')](function(){_0x54995b[_0x659e('0x1b')](0xcc)[_0x659e('0x1c')]();});}};}function handleEntityNotFound(_0x2d43ce,_0xb42893){return function(_0x137fdd){if(!_0x137fdd){_0x2d43ce['sendStatus'](0x194);}return _0x137fdd;};}function handleError(_0x3ec86b,_0x219f9c){_0x219f9c=_0x219f9c||0x1f4;return function(_0x361279){logger[_0x659e('0x28')](_0x361279[_0x659e('0x29')]);if(_0x361279[_0x659e('0x2a')]){delete _0x361279[_0x659e('0x2a')];}_0x3ec86b['status'](_0x219f9c)[_0x659e('0x2b')](_0x361279);};}exports['index']=function(_0x208e18,_0x19b5d0){var _0x314778={},_0x2db182={},_0x2ad152={'count':0x0,'rows':[]};var _0x329acc=_[_0x659e('0x2c')](db[_0x659e('0x2d')][_0x659e('0x2e')],function(_0x56c10a){return{'name':_0x56c10a[_0x659e('0x2f')],'type':_0x56c10a['type'][_0x659e('0x30')]};});_0x2db182['model']=_['map'](_0x329acc,_0x659e('0x2a'));_0x2db182[_0x659e('0x31')]=_[_0x659e('0x32')](_0x208e18[_0x659e('0x31')]);_0x2db182[_0x659e('0x33')]=_['intersection'](_0x2db182[_0x659e('0x34')],_0x2db182['query']);_0x314778[_0x659e('0x35')]=_[_0x659e('0x36')](_0x2db182[_0x659e('0x34')],qs[_0x659e('0x37')](_0x208e18[_0x659e('0x31')][_0x659e('0x37')]));_0x314778[_0x659e('0x35')]=_0x314778[_0x659e('0x35')][_0x659e('0x38')]?_0x314778[_0x659e('0x35')]:_0x2db182[_0x659e('0x34')];if(!_0x208e18['query'][_0x659e('0x39')](_0x659e('0x3a'))){_0x314778['limit']=qs[_0x659e('0x20')](_0x208e18[_0x659e('0x31')]['limit']);_0x314778[_0x659e('0x1e')]=qs[_0x659e('0x1e')](_0x208e18['query']['offset']);}_0x314778['order']=qs[_0x659e('0x3b')](_0x208e18[_0x659e('0x31')][_0x659e('0x3b')]);_0x314778['where']=qs[_0x659e('0x33')](_[_0x659e('0x3c')](_0x208e18['query'],_0x2db182[_0x659e('0x33')]),_0x329acc);if(_0x208e18[_0x659e('0x31')]['filter']){_0x314778[_0x659e('0x3d')]=_['merge'](_0x314778[_0x659e('0x3d')],{'$or':_[_0x659e('0x2c')](_0x329acc,function(_0x5b3a00){if(_0x5b3a00[_0x659e('0x3e')]!==_0x659e('0x3f')){var _0x2ea6e9={};_0x2ea6e9[_0x5b3a00[_0x659e('0x2a')]]={'$like':'%'+_0x208e18[_0x659e('0x31')][_0x659e('0x40')]+'%'};return _0x2ea6e9;}})});}_0x314778=_['merge']({},_0x314778,_0x208e18[_0x659e('0x41')]);var _0xff54a3={'where':_0x314778['where']};return db['Automation'][_0x659e('0x42')](_0xff54a3)[_0x659e('0x27')](function(_0x4fcef0){_0x2ad152[_0x659e('0x42')]=_0x4fcef0;if(_0x208e18[_0x659e('0x31')]['includeAll']){_0x314778['include']=[{'all':!![]}];}return db[_0x659e('0x2d')][_0x659e('0x43')](_0x314778);})[_0x659e('0x27')](function(_0x16a5d3){_0x2ad152[_0x659e('0x44')]=_0x16a5d3;return _0x2ad152;})[_0x659e('0x27')](respondWithFilteredResult(_0x19b5d0,_0x314778))[_0x659e('0x45')](handleError(_0x19b5d0,null));};exports[_0x659e('0x46')]=function(_0x27860b,_0xa053c){var _0x24789f={'raw':![],'where':{'id':_0x27860b[_0x659e('0x47')]['id']}},_0x5caf47={};_0x5caf47[_0x659e('0x34')]=_['keys'](db['Automation'][_0x659e('0x2e')]);_0x5caf47[_0x659e('0x31')]=_[_0x659e('0x32')](_0x27860b[_0x659e('0x31')]);_0x5caf47[_0x659e('0x33')]=_[_0x659e('0x36')](_0x5caf47['model'],_0x5caf47['query']);_0x24789f[_0x659e('0x35')]=_['intersection'](_0x5caf47[_0x659e('0x34')],qs[_0x659e('0x37')](_0x27860b[_0x659e('0x31')]['fields']));_0x24789f['attributes']=_0x24789f[_0x659e('0x35')][_0x659e('0x38')]?_0x24789f[_0x659e('0x35')]:_0x5caf47[_0x659e('0x34')];if(_0x27860b[_0x659e('0x31')]['includeAll']){_0x24789f[_0x659e('0x48')]=[{'all':!![]}];}_0x24789f=_[_0x659e('0x49')]({},_0x24789f,_0x27860b[_0x659e('0x41')]);return db[_0x659e('0x2d')][_0x659e('0x4a')](_0x24789f)[_0x659e('0x27')](handleEntityNotFound(_0xa053c,null))[_0x659e('0x27')](respondWithResult(_0xa053c,null))[_0x659e('0x45')](handleError(_0xa053c,null));};exports['create']=function(_0x1a2d93,_0x38b093){return db['Automation'][_0x659e('0x4b')](_0x1a2d93[_0x659e('0x4c')],{})[_0x659e('0x27')](respondWithResult(_0x38b093,0xc9))[_0x659e('0x45')](handleError(_0x38b093,null));};exports[_0x659e('0x25')]=function(_0x2a9d44,_0x271391){if(_0x2a9d44[_0x659e('0x4c')]['id']){delete _0x2a9d44[_0x659e('0x4c')]['id'];}return db[_0x659e('0x2d')]['find']({'where':{'id':_0x2a9d44[_0x659e('0x47')]['id']}})[_0x659e('0x27')](handleEntityNotFound(_0x271391,null))[_0x659e('0x27')](saveUpdates(_0x2a9d44[_0x659e('0x4c')],null))['then'](respondWithResult(_0x271391,null))['catch'](handleError(_0x271391,null));};exports[_0x659e('0x26')]=function(_0x278603,_0x56b1c9){return db[_0x659e('0x2d')][_0x659e('0x4a')]({'where':{'id':_0x278603[_0x659e('0x47')]['id']}})[_0x659e('0x27')](handleEntityNotFound(_0x56b1c9,null))[_0x659e('0x27')](removeEntity(_0x56b1c9,null))[_0x659e('0x45')](handleError(_0x56b1c9,null));};exports['addConditions']=function(_0x561cd8,_0x138672,_0x352e30){return db[_0x659e('0x4d')][_0x659e('0x4a')]({'where':{'id':_0x561cd8[_0x659e('0x47')]['id']}})[_0x659e('0x27')](handleEntityNotFound(_0x138672,null))[_0x659e('0x27')](function(_0x5e06ef){if(_0x5e06ef){return _0x5e06ef[_0x659e('0x4e')](_0x561cd8[_0x659e('0x4c')]['ids'],_[_0x659e('0x4f')](_0x561cd8[_0x659e('0x4c')],[_0x659e('0x50'),'id'])||{});}})[_0x659e('0x27')](respondWithResult(_0x138672,null))[_0x659e('0x45')](handleError(_0x138672,null));};exports['getConditions']=function(_0x139f5c,_0x1e8633,_0x4d5aca){var _0x34bbe9={};var _0x41036d={};var _0x4f4c70;var _0x597848;return db[_0x659e('0x2d')][_0x659e('0x51')]({'where':{'id':_0x139f5c[_0x659e('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e8633,null))[_0x659e('0x27')](function(_0x35a570){if(_0x35a570){_0x4f4c70=_0x35a570;_0x41036d['model']=_[_0x659e('0x32')](db[_0x659e('0x4d')][_0x659e('0x2e')]);_0x41036d[_0x659e('0x31')]=_[_0x659e('0x32')](_0x139f5c['query']);_0x41036d['filters']=_[_0x659e('0x36')](_0x41036d['model'],_0x41036d['query']);_0x34bbe9[_0x659e('0x35')]=_[_0x659e('0x36')](_0x41036d['model'],qs[_0x659e('0x37')](_0x139f5c[_0x659e('0x31')][_0x659e('0x37')]));_0x34bbe9[_0x659e('0x35')]=_0x34bbe9[_0x659e('0x35')][_0x659e('0x38')]?_0x34bbe9[_0x659e('0x35')]:_0x41036d['model'];_0x34bbe9[_0x659e('0x52')]=qs[_0x659e('0x3b')](_0x139f5c['query'][_0x659e('0x3b')]);_0x34bbe9[_0x659e('0x3d')]=qs[_0x659e('0x33')](_[_0x659e('0x3c')](_0x139f5c[_0x659e('0x31')],_0x41036d[_0x659e('0x33')]));if(_0x139f5c[_0x659e('0x31')][_0x659e('0x40')]){_0x34bbe9[_0x659e('0x3d')]=_['merge'](_0x34bbe9['where'],{'$or':_[_0x659e('0x2c')](_0x34bbe9[_0x659e('0x35')],function(_0x19a050){var _0x3e1025={};_0x3e1025[_0x19a050]={'$like':'%'+_0x139f5c[_0x659e('0x31')][_0x659e('0x40')]+'%'};return _0x3e1025;})});}_0x34bbe9=_['merge']({},_0x34bbe9,_0x139f5c[_0x659e('0x41')]);return _0x4f4c70[_0x659e('0x53')](_0x34bbe9);}})[_0x659e('0x27')](function(_0x58b133){if(_0x58b133){_0x597848=_0x58b133[_0x659e('0x38')];if(!_0x139f5c[_0x659e('0x31')]['hasOwnProperty']('nolimit')){_0x34bbe9[_0x659e('0x20')]=qs[_0x659e('0x20')](_0x139f5c[_0x659e('0x31')][_0x659e('0x20')]);_0x34bbe9[_0x659e('0x1e')]=qs[_0x659e('0x1e')](_0x139f5c[_0x659e('0x31')]['offset']);}return _0x4f4c70[_0x659e('0x53')](_0x34bbe9);}})[_0x659e('0x27')](function(_0x276df8){if(_0x276df8){return _0x276df8?{'count':_0x597848,'rows':_0x276df8}:null;}})['then'](respondWithResult(_0x1e8633,null))[_0x659e('0x45')](handleError(_0x1e8633,null));};exports[_0x659e('0x54')]=function(_0x99cef2,_0x3635a4,_0xa34faf){return db['Action'][_0x659e('0x4a')]({'where':{'id':_0x99cef2[_0x659e('0x47')]['id']}})[_0x659e('0x27')](handleEntityNotFound(_0x3635a4,null))[_0x659e('0x27')](function(_0x184270){if(_0x184270){return _0x184270[_0x659e('0x54')](_0x99cef2['body'][_0x659e('0x50')],_[_0x659e('0x4f')](_0x99cef2[_0x659e('0x4c')],[_0x659e('0x50'),'id'])||{});}})['then'](respondWithResult(_0x3635a4,null))[_0x659e('0x45')](handleError(_0x3635a4,null));};exports[_0x659e('0x55')]=function(_0x28cf91,_0x51cae7,_0x44d5a0){var _0x23017d={};var _0x53e632={};var _0x153b34;var _0xe1b80;return db['Automation'][_0x659e('0x51')]({'where':{'id':_0x28cf91[_0x659e('0x47')]['id']}})[_0x659e('0x27')](handleEntityNotFound(_0x51cae7,null))[_0x659e('0x27')](function(_0x2d9ce2){if(_0x2d9ce2){_0x153b34=_0x2d9ce2;_0x53e632[_0x659e('0x34')]=_[_0x659e('0x32')](db[_0x659e('0x56')][_0x659e('0x2e')]);_0x53e632[_0x659e('0x31')]=_[_0x659e('0x32')](_0x28cf91[_0x659e('0x31')]);_0x53e632[_0x659e('0x33')]=_[_0x659e('0x36')](_0x53e632[_0x659e('0x34')],_0x53e632[_0x659e('0x31')]);_0x23017d[_0x659e('0x35')]=_[_0x659e('0x36')](_0x53e632[_0x659e('0x34')],qs['fields'](_0x28cf91['query'][_0x659e('0x37')]));_0x23017d[_0x659e('0x35')]=_0x23017d[_0x659e('0x35')]['length']?_0x23017d[_0x659e('0x35')]:_0x53e632[_0x659e('0x34')];_0x23017d[_0x659e('0x52')]=qs[_0x659e('0x3b')](_0x28cf91[_0x659e('0x31')]['sort']);_0x23017d['where']=qs[_0x659e('0x33')](_[_0x659e('0x3c')](_0x28cf91[_0x659e('0x31')],_0x53e632[_0x659e('0x33')]));if(_0x28cf91[_0x659e('0x31')][_0x659e('0x40')]){_0x23017d[_0x659e('0x3d')]=_[_0x659e('0x49')](_0x23017d[_0x659e('0x3d')],{'$or':_[_0x659e('0x2c')](_0x23017d[_0x659e('0x35')],function(_0x9471b4){var _0x25841c={};_0x25841c[_0x9471b4]={'$like':'%'+_0x28cf91['query'][_0x659e('0x40')]+'%'};return _0x25841c;})});}_0x23017d=_['merge']({},_0x23017d,_0x28cf91[_0x659e('0x41')]);return _0x153b34[_0x659e('0x55')](_0x23017d);}})[_0x659e('0x27')](function(_0x538a27){if(_0x538a27){_0xe1b80=_0x538a27[_0x659e('0x38')];if(!_0x28cf91[_0x659e('0x31')][_0x659e('0x39')]('nolimit')){_0x23017d['limit']=qs[_0x659e('0x20')](_0x28cf91[_0x659e('0x31')][_0x659e('0x20')]);_0x23017d['offset']=qs[_0x659e('0x1e')](_0x28cf91['query'][_0x659e('0x1e')]);}return _0x153b34[_0x659e('0x55')](_0x23017d);}})[_0x659e('0x27')](function(_0xd34ca6){if(_0xd34ca6){return _0xd34ca6?{'count':_0xe1b80,'rows':_0xd34ca6}:null;}})[_0x659e('0x27')](respondWithResult(_0x51cae7,null))[_0x659e('0x45')](handleError(_0x51cae7,null));}; \ No newline at end of file +var _0x4e5e=['limit','count','set','Content-Range','apply','save','update','then','destroy','status','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','Automation','include','findAll','rows','show','options','find','catch','create','body','params','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','eml-format','rimraf','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined'];(function(_0x4517f9,_0x3f3600){var _0x3e3f10=function(_0x1aafd3){while(--_0x1aafd3){_0x4517f9['push'](_0x4517f9['shift']());}};_0x3e3f10(++_0x3f3600);}(_0x4e5e,0x12e));var _0xe4e5=function(_0x5c9eb6,_0x59d1be){_0x5c9eb6=_0x5c9eb6-0x0;var _0x20c495=_0x4e5e[_0x5c9eb6];return _0x20c495;};'use strict';var emlformat=require(_0xe4e5('0x0'));var rimraf=require(_0xe4e5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe4e5('0x2'));var BPromise=require(_0xe4e5('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe4e5('0x4'));var sox=require(_0xe4e5('0x5'));var csv=require(_0xe4e5('0x6'));var ejs=require(_0xe4e5('0x7'));var fs=require('fs');var fs_extra=require(_0xe4e5('0x8'));var _=require(_0xe4e5('0x9'));var squel=require(_0xe4e5('0xa'));var crypto=require(_0xe4e5('0xb'));var jsforce=require(_0xe4e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe4e5('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe4e5('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4e5('0xe'));var logger=require(_0xe4e5('0xf'))(_0xe4e5('0x10'));var utils=require(_0xe4e5('0x11'));var config=require(_0xe4e5('0x12'));var licenseUtil=require(_0xe4e5('0x13'));var db=require(_0xe4e5('0x14'))['db'];function respondWithStatusCode(_0x54d574,_0x31cdf3){_0x31cdf3=_0x31cdf3||0xcc;return function(_0xcc1160){if(_0xcc1160){return _0x54d574[_0xe4e5('0x15')](_0x31cdf3);}return _0x54d574['status'](_0x31cdf3)[_0xe4e5('0x16')]();};}function respondWithResult(_0x501545,_0x12a10b){_0x12a10b=_0x12a10b||0xc8;return function(_0x34e3f5){if(_0x34e3f5){return _0x501545['status'](_0x12a10b)[_0xe4e5('0x17')](_0x34e3f5);}};}function respondWithFilteredResult(_0x58e1af,_0x3f70e1){return function(_0x1a0675){if(_0x1a0675){var _0x18b285=typeof _0x3f70e1[_0xe4e5('0x18')]===_0xe4e5('0x19')&&typeof _0x3f70e1[_0xe4e5('0x1a')]===_0xe4e5('0x19');var _0x114c31=_0x1a0675[_0xe4e5('0x1b')];var _0x1dca5d=_0x18b285?0x0:_0x3f70e1['offset'];var _0x83bfa6=_0x18b285?_0x1a0675[_0xe4e5('0x1b')]:_0x3f70e1['offset']+_0x3f70e1[_0xe4e5('0x1a')];var _0x2d0b10;if(_0x83bfa6>=_0x114c31){_0x83bfa6=_0x114c31;_0x2d0b10=0xc8;}else{_0x2d0b10=0xce;}_0x58e1af['status'](_0x2d0b10);return _0x58e1af[_0xe4e5('0x1c')](_0xe4e5('0x1d'),_0x1dca5d+'-'+_0x83bfa6+'/'+_0x114c31)['json'](_0x1a0675);}return null;};}function patchUpdates(_0x33ded4){return function(_0x167f18){try{jsonpatch[_0xe4e5('0x1e')](_0x167f18,_0x33ded4,!![]);}catch(_0x56c7c1){return BPromise['reject'](_0x56c7c1);}return _0x167f18[_0xe4e5('0x1f')]();};}function saveUpdates(_0x418460,_0x9eb83d){return function(_0x4a245c){if(_0x4a245c){return _0x4a245c[_0xe4e5('0x20')](_0x418460)[_0xe4e5('0x21')](function(_0x279154){return _0x279154;});}return null;};}function removeEntity(_0x53cdf3,_0x24a9b0){return function(_0x43140e){if(_0x43140e){return _0x43140e[_0xe4e5('0x22')]()[_0xe4e5('0x21')](function(){_0x53cdf3[_0xe4e5('0x23')](0xcc)[_0xe4e5('0x16')]();});}};}function handleEntityNotFound(_0x2fd965,_0x862f4){return function(_0x144008){if(!_0x144008){_0x2fd965[_0xe4e5('0x15')](0x194);}return _0x144008;};}function handleError(_0x4b1650,_0x29319e){_0x29319e=_0x29319e||0x1f4;return function(_0x338ff2){logger[_0xe4e5('0x24')](_0x338ff2[_0xe4e5('0x25')]);if(_0x338ff2['name']){delete _0x338ff2[_0xe4e5('0x26')];}_0x4b1650[_0xe4e5('0x23')](_0x29319e)[_0xe4e5('0x27')](_0x338ff2);};}exports[_0xe4e5('0x28')]=function(_0x279479,_0x287018){var _0x276a9b={},_0x1fd7ba={},_0x3f37c8={'count':0x0,'rows':[]};var _0x518209=_[_0xe4e5('0x29')](db['Automation'][_0xe4e5('0x2a')],function(_0x12a5dd){return{'name':_0x12a5dd[_0xe4e5('0x2b')],'type':_0x12a5dd[_0xe4e5('0x2c')]['key']};});_0x1fd7ba['model']=_['map'](_0x518209,_0xe4e5('0x26'));_0x1fd7ba[_0xe4e5('0x2d')]=_[_0xe4e5('0x2e')](_0x279479[_0xe4e5('0x2d')]);_0x1fd7ba[_0xe4e5('0x2f')]=_[_0xe4e5('0x30')](_0x1fd7ba[_0xe4e5('0x31')],_0x1fd7ba[_0xe4e5('0x2d')]);_0x276a9b[_0xe4e5('0x32')]=_[_0xe4e5('0x30')](_0x1fd7ba[_0xe4e5('0x31')],qs[_0xe4e5('0x33')](_0x279479['query'][_0xe4e5('0x33')]));_0x276a9b[_0xe4e5('0x32')]=_0x276a9b['attributes'][_0xe4e5('0x34')]?_0x276a9b['attributes']:_0x1fd7ba[_0xe4e5('0x31')];if(!_0x279479['query'][_0xe4e5('0x35')]('nolimit')){_0x276a9b[_0xe4e5('0x1a')]=qs[_0xe4e5('0x1a')](_0x279479[_0xe4e5('0x2d')][_0xe4e5('0x1a')]);_0x276a9b[_0xe4e5('0x18')]=qs[_0xe4e5('0x18')](_0x279479['query'][_0xe4e5('0x18')]);}_0x276a9b[_0xe4e5('0x36')]=qs[_0xe4e5('0x37')](_0x279479[_0xe4e5('0x2d')]['sort']);_0x276a9b[_0xe4e5('0x38')]=qs[_0xe4e5('0x2f')](_[_0xe4e5('0x39')](_0x279479[_0xe4e5('0x2d')],_0x1fd7ba[_0xe4e5('0x2f')]),_0x518209);if(_0x279479[_0xe4e5('0x2d')][_0xe4e5('0x3a')]){_0x276a9b['where']=_['merge'](_0x276a9b['where'],{'$or':_[_0xe4e5('0x29')](_0x518209,function(_0x1b30f8){if(_0x1b30f8[_0xe4e5('0x2c')]!==_0xe4e5('0x3b')){var _0x579bb4={};_0x579bb4[_0x1b30f8['name']]={'$like':'%'+_0x279479[_0xe4e5('0x2d')][_0xe4e5('0x3a')]+'%'};return _0x579bb4;}})});}_0x276a9b=_[_0xe4e5('0x3c')]({},_0x276a9b,_0x279479['options']);var _0x4871e5={'where':_0x276a9b['where']};return db[_0xe4e5('0x3d')][_0xe4e5('0x1b')](_0x4871e5)[_0xe4e5('0x21')](function(_0x608a0d){_0x3f37c8[_0xe4e5('0x1b')]=_0x608a0d;if(_0x279479[_0xe4e5('0x2d')]['includeAll']){_0x276a9b[_0xe4e5('0x3e')]=[{'all':!![]}];}return db[_0xe4e5('0x3d')][_0xe4e5('0x3f')](_0x276a9b);})['then'](function(_0x4ec9cd){_0x3f37c8[_0xe4e5('0x40')]=_0x4ec9cd;return _0x3f37c8;})[_0xe4e5('0x21')](respondWithFilteredResult(_0x287018,_0x276a9b))['catch'](handleError(_0x287018,null));};exports[_0xe4e5('0x41')]=function(_0x36ce36,_0x62c2ee){var _0x2d1d27={'raw':![],'where':{'id':_0x36ce36['params']['id']}},_0x45de56={};_0x45de56[_0xe4e5('0x31')]=_[_0xe4e5('0x2e')](db[_0xe4e5('0x3d')][_0xe4e5('0x2a')]);_0x45de56[_0xe4e5('0x2d')]=_[_0xe4e5('0x2e')](_0x36ce36['query']);_0x45de56[_0xe4e5('0x2f')]=_[_0xe4e5('0x30')](_0x45de56['model'],_0x45de56['query']);_0x2d1d27[_0xe4e5('0x32')]=_['intersection'](_0x45de56['model'],qs['fields'](_0x36ce36[_0xe4e5('0x2d')]['fields']));_0x2d1d27[_0xe4e5('0x32')]=_0x2d1d27[_0xe4e5('0x32')]['length']?_0x2d1d27['attributes']:_0x45de56[_0xe4e5('0x31')];if(_0x36ce36[_0xe4e5('0x2d')]['includeAll']){_0x2d1d27[_0xe4e5('0x3e')]=[{'all':!![]}];}_0x2d1d27=_[_0xe4e5('0x3c')]({},_0x2d1d27,_0x36ce36[_0xe4e5('0x42')]);return db[_0xe4e5('0x3d')][_0xe4e5('0x43')](_0x2d1d27)[_0xe4e5('0x21')](handleEntityNotFound(_0x62c2ee,null))[_0xe4e5('0x21')](respondWithResult(_0x62c2ee,null))[_0xe4e5('0x44')](handleError(_0x62c2ee,null));};exports[_0xe4e5('0x45')]=function(_0x5118c7,_0x1a0738){return db[_0xe4e5('0x3d')][_0xe4e5('0x45')](_0x5118c7['body'],{})['then'](respondWithResult(_0x1a0738,0xc9))['catch'](handleError(_0x1a0738,null));};exports[_0xe4e5('0x20')]=function(_0x49b07f,_0x2be538){if(_0x49b07f[_0xe4e5('0x46')]['id']){delete _0x49b07f[_0xe4e5('0x46')]['id'];}return db[_0xe4e5('0x3d')][_0xe4e5('0x43')]({'where':{'id':_0x49b07f[_0xe4e5('0x47')]['id']}})[_0xe4e5('0x21')](handleEntityNotFound(_0x2be538,null))[_0xe4e5('0x21')](saveUpdates(_0x49b07f[_0xe4e5('0x46')],null))[_0xe4e5('0x21')](respondWithResult(_0x2be538,null))[_0xe4e5('0x44')](handleError(_0x2be538,null));};exports[_0xe4e5('0x22')]=function(_0x594544,_0x25348c){return db['Automation'][_0xe4e5('0x43')]({'where':{'id':_0x594544[_0xe4e5('0x47')]['id']}})['then'](handleEntityNotFound(_0x25348c,null))[_0xe4e5('0x21')](removeEntity(_0x25348c,null))[_0xe4e5('0x44')](handleError(_0x25348c,null));};exports[_0xe4e5('0x48')]=function(_0x1bfd18,_0x4ca2c4,_0x2f101a){return db[_0xe4e5('0x49')][_0xe4e5('0x43')]({'where':{'id':_0x1bfd18[_0xe4e5('0x47')]['id']}})[_0xe4e5('0x21')](handleEntityNotFound(_0x4ca2c4,null))[_0xe4e5('0x21')](function(_0xf9d6e1){if(_0xf9d6e1){return _0xf9d6e1[_0xe4e5('0x48')](_0x1bfd18[_0xe4e5('0x46')][_0xe4e5('0x4a')],_[_0xe4e5('0x4b')](_0x1bfd18[_0xe4e5('0x46')],['ids','id'])||{});}})[_0xe4e5('0x21')](respondWithResult(_0x4ca2c4,null))['catch'](handleError(_0x4ca2c4,null));};exports[_0xe4e5('0x4c')]=function(_0x3d7c44,_0x150170,_0xb4ae13){var _0x530be1={};var _0x5956fb={};var _0x507b0c;var _0x1f4164;return db['Automation'][_0xe4e5('0x4d')]({'where':{'id':_0x3d7c44[_0xe4e5('0x47')]['id']}})[_0xe4e5('0x21')](handleEntityNotFound(_0x150170,null))[_0xe4e5('0x21')](function(_0x10ebe0){if(_0x10ebe0){_0x507b0c=_0x10ebe0;_0x5956fb[_0xe4e5('0x31')]=_[_0xe4e5('0x2e')](db[_0xe4e5('0x49')][_0xe4e5('0x2a')]);_0x5956fb['query']=_['keys'](_0x3d7c44[_0xe4e5('0x2d')]);_0x5956fb[_0xe4e5('0x2f')]=_[_0xe4e5('0x30')](_0x5956fb[_0xe4e5('0x31')],_0x5956fb['query']);_0x530be1[_0xe4e5('0x32')]=_[_0xe4e5('0x30')](_0x5956fb[_0xe4e5('0x31')],qs[_0xe4e5('0x33')](_0x3d7c44[_0xe4e5('0x2d')]['fields']));_0x530be1[_0xe4e5('0x32')]=_0x530be1['attributes']['length']?_0x530be1[_0xe4e5('0x32')]:_0x5956fb[_0xe4e5('0x31')];_0x530be1[_0xe4e5('0x36')]=qs[_0xe4e5('0x37')](_0x3d7c44[_0xe4e5('0x2d')][_0xe4e5('0x37')]);_0x530be1[_0xe4e5('0x38')]=qs[_0xe4e5('0x2f')](_[_0xe4e5('0x39')](_0x3d7c44['query'],_0x5956fb[_0xe4e5('0x2f')]));if(_0x3d7c44[_0xe4e5('0x2d')][_0xe4e5('0x3a')]){_0x530be1[_0xe4e5('0x38')]=_[_0xe4e5('0x3c')](_0x530be1[_0xe4e5('0x38')],{'$or':_['map'](_0x530be1[_0xe4e5('0x32')],function(_0x3dd92d){var _0x4fa37d={};_0x4fa37d[_0x3dd92d]={'$like':'%'+_0x3d7c44[_0xe4e5('0x2d')][_0xe4e5('0x3a')]+'%'};return _0x4fa37d;})});}_0x530be1=_[_0xe4e5('0x3c')]({},_0x530be1,_0x3d7c44[_0xe4e5('0x42')]);return _0x507b0c['getConditions'](_0x530be1);}})[_0xe4e5('0x21')](function(_0x54f6ea){if(_0x54f6ea){_0x1f4164=_0x54f6ea[_0xe4e5('0x34')];if(!_0x3d7c44['query'][_0xe4e5('0x35')](_0xe4e5('0x4e'))){_0x530be1['limit']=qs[_0xe4e5('0x1a')](_0x3d7c44[_0xe4e5('0x2d')][_0xe4e5('0x1a')]);_0x530be1[_0xe4e5('0x18')]=qs['offset'](_0x3d7c44['query']['offset']);}return _0x507b0c[_0xe4e5('0x4c')](_0x530be1);}})[_0xe4e5('0x21')](function(_0x694c8e){if(_0x694c8e){return _0x694c8e?{'count':_0x1f4164,'rows':_0x694c8e}:null;}})[_0xe4e5('0x21')](respondWithResult(_0x150170,null))[_0xe4e5('0x44')](handleError(_0x150170,null));};exports[_0xe4e5('0x4f')]=function(_0xd9448b,_0x3f9003,_0x5ce33d){return db[_0xe4e5('0x50')][_0xe4e5('0x43')]({'where':{'id':_0xd9448b[_0xe4e5('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f9003,null))[_0xe4e5('0x21')](function(_0x5d5dde){if(_0x5d5dde){return _0x5d5dde[_0xe4e5('0x4f')](_0xd9448b['body'][_0xe4e5('0x4a')],_[_0xe4e5('0x4b')](_0xd9448b['body'],[_0xe4e5('0x4a'),'id'])||{});}})[_0xe4e5('0x21')](respondWithResult(_0x3f9003,null))['catch'](handleError(_0x3f9003,null));};exports[_0xe4e5('0x51')]=function(_0x112a4d,_0x2bd591,_0x4eb297){var _0xfc104b={};var _0xeacecb={};var _0x3b5be;var _0x25a6e4;return db['Automation'][_0xe4e5('0x4d')]({'where':{'id':_0x112a4d[_0xe4e5('0x47')]['id']}})[_0xe4e5('0x21')](handleEntityNotFound(_0x2bd591,null))[_0xe4e5('0x21')](function(_0xd64430){if(_0xd64430){_0x3b5be=_0xd64430;_0xeacecb[_0xe4e5('0x31')]=_[_0xe4e5('0x2e')](db[_0xe4e5('0x50')][_0xe4e5('0x2a')]);_0xeacecb[_0xe4e5('0x2d')]=_[_0xe4e5('0x2e')](_0x112a4d[_0xe4e5('0x2d')]);_0xeacecb['filters']=_[_0xe4e5('0x30')](_0xeacecb[_0xe4e5('0x31')],_0xeacecb[_0xe4e5('0x2d')]);_0xfc104b[_0xe4e5('0x32')]=_[_0xe4e5('0x30')](_0xeacecb[_0xe4e5('0x31')],qs[_0xe4e5('0x33')](_0x112a4d['query'][_0xe4e5('0x33')]));_0xfc104b[_0xe4e5('0x32')]=_0xfc104b['attributes']['length']?_0xfc104b[_0xe4e5('0x32')]:_0xeacecb['model'];_0xfc104b[_0xe4e5('0x36')]=qs[_0xe4e5('0x37')](_0x112a4d[_0xe4e5('0x2d')][_0xe4e5('0x37')]);_0xfc104b['where']=qs[_0xe4e5('0x2f')](_['pick'](_0x112a4d['query'],_0xeacecb[_0xe4e5('0x2f')]));if(_0x112a4d[_0xe4e5('0x2d')][_0xe4e5('0x3a')]){_0xfc104b['where']=_['merge'](_0xfc104b[_0xe4e5('0x38')],{'$or':_[_0xe4e5('0x29')](_0xfc104b['attributes'],function(_0x343a9a){var _0x375db3={};_0x375db3[_0x343a9a]={'$like':'%'+_0x112a4d[_0xe4e5('0x2d')][_0xe4e5('0x3a')]+'%'};return _0x375db3;})});}_0xfc104b=_[_0xe4e5('0x3c')]({},_0xfc104b,_0x112a4d[_0xe4e5('0x42')]);return _0x3b5be['getActions'](_0xfc104b);}})[_0xe4e5('0x21')](function(_0x23dd0c){if(_0x23dd0c){_0x25a6e4=_0x23dd0c['length'];if(!_0x112a4d[_0xe4e5('0x2d')][_0xe4e5('0x35')](_0xe4e5('0x4e'))){_0xfc104b[_0xe4e5('0x1a')]=qs[_0xe4e5('0x1a')](_0x112a4d[_0xe4e5('0x2d')]['limit']);_0xfc104b[_0xe4e5('0x18')]=qs[_0xe4e5('0x18')](_0x112a4d[_0xe4e5('0x2d')][_0xe4e5('0x18')]);}return _0x3b5be['getActions'](_0xfc104b);}})[_0xe4e5('0x21')](function(_0x219462){if(_0x219462){return _0x219462?{'count':_0x25a6e4,'rows':_0x219462}:null;}})['then'](respondWithResult(_0x2bd591,null))['catch'](handleError(_0x2bd591,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index f131fff..690c6df 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 _0x7991=['tools_automations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','Automation'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7991,0xf1));var _0x1799=function(_0x190404,_0x594195){_0x190404=_0x190404-0x0;var _0x7b180c=_0x7991[_0x190404];return _0x7b180c;};'use strict';var _=require('lodash');var util=require(_0x1799('0x0'));var logger=require(_0x1799('0x1'))(_0x1799('0x2'));var moment=require(_0x1799('0x3'));var BPromise=require(_0x1799('0x4'));var rp=require(_0x1799('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1799('0x6'));var config=require(_0x1799('0x7'));var attributes=require(_0x1799('0x8'));module[_0x1799('0x9')]=function(_0x171393,_0x5f0773){return _0x171393['define'](_0x1799('0xa'),attributes,{'tableName':_0x1799('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f53=['bluebird','rimraf','../../config/environment','exports','define','Automation','tools_automations','api','moment'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0x3f53,0x1d2));var _0x33f5=function(_0x45d349,_0x9fc6b4){_0x45d349=_0x45d349-0x0;var _0x17ddfb=_0x3f53[_0x45d349];return _0x17ddfb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x33f5('0x0'));var moment=require(_0x33f5('0x1'));var BPromise=require(_0x33f5('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x33f5('0x3'));var config=require(_0x33f5('0x4'));var attributes=require('./automation.attributes');module[_0x33f5('0x5')]=function(_0x386a9a,_0x5449d5){return _0x386a9a[_0x33f5('0x6')](_0x33f5('0x7'),attributes,{'tableName':_0x33f5('0x8'),'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 98770d1..f981d73 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 _0xcbde=['http','request','then','Automation,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x1de840,_0x3fd7f3){var _0x39ba35=function(_0x5a30c5){while(--_0x5a30c5){_0x1de840['push'](_0x1de840['shift']());}};_0x39ba35(++_0x3fd7f3);}(_0xcbde,0x141));var _0xecbd=function(_0x2af375,_0x349c0a){_0x2af375=_0x2af375-0x0;var _0xc641c2=_0xcbde[_0x2af375];return _0xc641c2;};'use strict';var _=require(_0xecbd('0x0'));var util=require('util');var moment=require(_0xecbd('0x1'));var BPromise=require(_0xecbd('0x2'));var rs=require(_0xecbd('0x3'));var fs=require('fs');var Redis=require(_0xecbd('0x4'));var db=require(_0xecbd('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xecbd('0x6'));var config=require(_0xecbd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xecbd('0x8')][_0xecbd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x545ca6,_0x5d1ba5,_0x2947a0){return new BPromise(function(_0x3e9e7a,_0x2f3b03){return client[_0xecbd('0xa')](_0x545ca6,_0x2947a0)[_0xecbd('0xb')](function(_0x43a04e){logger['info'](_0xecbd('0xc'),_0x5d1ba5,'request\x20sent');logger[_0xecbd('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x5d1ba5,'request\x20sent',JSON[_0xecbd('0xe')](_0x43a04e));if(_0x43a04e['error']){if(_0x43a04e[_0xecbd('0xf')][_0xecbd('0x10')]===0x1f4){logger['error'](_0xecbd('0xc'),_0x5d1ba5,_0x43a04e[_0xecbd('0xf')][_0xecbd('0x11')]);return _0x2f3b03(_0x43a04e[_0xecbd('0xf')][_0xecbd('0x11')]);}logger[_0xecbd('0xf')](_0xecbd('0xc'),_0x5d1ba5,_0x43a04e[_0xecbd('0xf')][_0xecbd('0x11')]);return _0x3e9e7a(_0x43a04e['error'][_0xecbd('0x11')]);}else{logger[_0xecbd('0x12')](_0xecbd('0xc'),_0x5d1ba5,_0xecbd('0x13'));_0x3e9e7a(_0x43a04e[_0xecbd('0x14')][_0xecbd('0x11')]);}})[_0xecbd('0x15')](function(_0x1af064){logger[_0xecbd('0xf')](_0xecbd('0xc'),_0x5d1ba5,_0x1af064);_0x2f3b03(_0x1af064);});});} \ No newline at end of file +var _0xb79a=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x23a395,_0x325e07){var _0x137d17=function(_0x457017){while(--_0x457017){_0x23a395['push'](_0x23a395['shift']());}};_0x137d17(++_0x325e07);}(_0xb79a,0x18e));var _0xab79=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb79a[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xab79('0x0'));var util=require(_0xab79('0x1'));var moment=require('moment');var BPromise=require(_0xab79('0x2'));var rs=require(_0xab79('0x3'));var fs=require('fs');var Redis=require(_0xab79('0x4'));var db=require(_0xab79('0x5'))['db'];var utils=require(_0xab79('0x6'));var logger=require(_0xab79('0x7'))(_0xab79('0x8'));var config=require(_0xab79('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xab79('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe8ba5a,_0x10d402,_0x11ceb3){return new BPromise(function(_0x7eabd1,_0x4585fe){return client[_0xab79('0xb')](_0xe8ba5a,_0x11ceb3)[_0xab79('0xc')](function(_0x426cb9){logger[_0xab79('0xd')](_0xab79('0xe'),_0x10d402,_0xab79('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x10d402,_0xab79('0xf'),JSON[_0xab79('0x10')](_0x426cb9));if(_0x426cb9[_0xab79('0x11')]){if(_0x426cb9[_0xab79('0x11')][_0xab79('0x12')]===0x1f4){logger[_0xab79('0x11')]('Automation,\x20%s,\x20%s',_0x10d402,_0x426cb9['error'][_0xab79('0x13')]);return _0x4585fe(_0x426cb9['error'][_0xab79('0x13')]);}logger[_0xab79('0x11')](_0xab79('0xe'),_0x10d402,_0x426cb9['error']['message']);return _0x7eabd1(_0x426cb9['error']['message']);}else{logger[_0xab79('0xd')](_0xab79('0xe'),_0x10d402,'request\x20sent');_0x7eabd1(_0x426cb9['result']['message']);}})[_0xab79('0x14')](function(_0xc9650d){logger['error'](_0xab79('0xe'),_0x10d402,_0xc9650d);_0x4585fe(_0xc9650d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 43c45bf..d2e6ff2 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 _0x202c=['isAuthenticated','index','/:id','show','get','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller'];(function(_0x3b5894,_0x23f484){var _0x358d4c=function(_0x3ed01e){while(--_0x3ed01e){_0x3b5894['push'](_0x3b5894['shift']());}};_0x358d4c(++_0x23f484);}(_0x202c,0x178));var _0xc202=function(_0x25057a,_0x43a0fd){_0x25057a=_0x25057a-0x0;var _0x408369=_0x202c[_0x25057a];return _0x408369;};'use strict';var multer=require(_0xc202('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc202('0x1'));var express=require(_0xc202('0x2'));var router=express[_0xc202('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc202('0x4'));var interaction=require(_0xc202('0x5'));var config=require(_0xc202('0x6'));var controller=require(_0xc202('0x7'));router['get']('/',auth[_0xc202('0x8')](),controller[_0xc202('0x9')]);router['get'](_0xc202('0xa'),auth['isAuthenticated'](),controller[_0xc202('0xb')]);router[_0xc202('0xc')](_0xc202('0xd'),auth[_0xc202('0x8')](),controller[_0xc202('0xe')]);router[_0xc202('0xc')](_0xc202('0xf'),auth[_0xc202('0x8')](),controller[_0xc202('0x10')]);router[_0xc202('0x11')]('/',auth[_0xc202('0x8')](),controller[_0xc202('0x12')]);router[_0xc202('0x11')]('/:id/conditions',auth[_0xc202('0x8')](),controller[_0xc202('0x13')]);router[_0xc202('0x11')](_0xc202('0xf'),auth[_0xc202('0x8')](),controller[_0xc202('0x14')]);router[_0xc202('0x15')]('/:id',auth[_0xc202('0x8')](),controller[_0xc202('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc202('0x17')]);module['exports']=router; \ No newline at end of file +var _0x351d=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./automation.controller','isAuthenticated','get','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','exports','multer'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0x351d,0x137));var _0xd351=function(_0x209b07,_0x33f1a9){_0x209b07=_0x209b07-0x0;var _0x5511aa=_0x351d[_0x209b07];return _0x5511aa;};'use strict';var multer=require(_0xd351('0x0'));var util=require(_0xd351('0x1'));var path=require(_0xd351('0x2'));var timeout=require(_0xd351('0x3'));var express=require(_0xd351('0x4'));var router=express[_0xd351('0x5')]();var fs_extra=require(_0xd351('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd351('0x7'));var config=require('../../config/environment');var controller=require(_0xd351('0x8'));router['get']('/',auth[_0xd351('0x9')](),controller['index']);router[_0xd351('0xa')](_0xd351('0xb'),auth[_0xd351('0x9')](),controller[_0xd351('0xc')]);router[_0xd351('0xa')](_0xd351('0xd'),auth[_0xd351('0x9')](),controller[_0xd351('0xe')]);router[_0xd351('0xa')](_0xd351('0xf'),auth['isAuthenticated'](),controller[_0xd351('0x10')]);router[_0xd351('0x11')]('/',auth[_0xd351('0x9')](),controller[_0xd351('0x12')]);router[_0xd351('0x11')](_0xd351('0xd'),auth[_0xd351('0x9')](),controller[_0xd351('0x13')]);router[_0xd351('0x11')](_0xd351('0xf'),auth[_0xd351('0x9')](),controller[_0xd351('0x14')]);router[_0xd351('0x15')]('/:id',auth[_0xd351('0x9')](),controller[_0xd351('0x16')]);router[_0xd351('0x17')](_0xd351('0xb'),auth['isAuthenticated'](),controller[_0xd351('0x18')]);module[_0xd351('0x19')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 6ed9b58..c1acf4a 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 _0x0cdd=['#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x455d76,_0x41b9dc){var _0x2bd1fe=function(_0x5e3ae9){while(--_0x5e3ae9){_0x455d76['push'](_0x455d76['shift']());}};_0x2bd1fe(++_0x41b9dc);}(_0x0cdd,0x184));var _0xd0cd=function(_0x29d518,_0x3900d4){_0x29d518=_0x29d518-0x0;var _0xf74a70=_0x0cdd[_0x29d518];return _0xf74a70;};'use strict';var Sequelize=require(_0xd0cd('0x0'));module[_0xd0cd('0x1')]={'name':{'type':Sequelize[_0xd0cd('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd0cd('0x3')](_0xd0cd('0x4')),'allowNull':![],'defaultValue':_0xd0cd('0x4')},'description':{'type':Sequelize[_0xd0cd('0x2')]},'active':{'type':Sequelize[_0xd0cd('0x5')],'defaultValue':0x0,'comment':_0xd0cd('0x6')},'limitCalls':{'type':Sequelize[_0xd0cd('0x7')](0x4)[_0xd0cd('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd0cd('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd0cd('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd0cd('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xd0cd('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd0cd('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd0cd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd0cd('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd0cd('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xd0cd('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd0cd('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd0cd('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd0cd('0x7')](0x5)[_0xd0cd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd0cd('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd0cd('0xe')},'dialTimezone':{'type':Sequelize[_0xd0cd('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd0cd('0x2')],'defaultValue':_0xd0cd('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xd0cd('0x3')](_0xd0cd('0x10'),_0xd0cd('0x11'),'onlyIfOpen'),'defaultValue':_0xd0cd('0x10')},'dialAMDActive':{'type':Sequelize[_0xd0cd('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd0cd('0x7')](0x9)[_0xd0cd('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd0cd('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xd0cd('0x7')](0x9)[_0xd0cd('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd0cd('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd0cd('0x7')](0x9)[_0xd0cd('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd0cd('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd0cd('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd0cd('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xd0cd('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd0cd('0x7')](0x9)[_0xd0cd('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd0cd('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xd0cd('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd0cd('0x7')](0x5)[_0xd0cd('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd0cd('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xd0cd('0x3')](_0xd0cd('0x18'),_0xd0cd('0x19')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xd0cd('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd0cd('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd0cd('0x1a')},'dialCutDigit':{'type':Sequelize[_0xd0cd('0x7')](0x3)[_0xd0cd('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd0cd('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd0cd('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd0cd('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd0cd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd0cd('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0xd0cd('0x7')](0x3)[_0xd0cd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd0cd('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xd0cd('0x7')](0x5)[_0xd0cd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd0cd('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd0cd('0x7')](0x3)[_0xd0cd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd0cd('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd0cd('0x7')](0x5)[_0xd0cd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd0cd('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xd0cd('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd0cd('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xd0cd('0x7')](0x5)[_0xd0cd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd0cd('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd0cd('0x7')](0x3)[_0xd0cd('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd0cd('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd0cd('0x7')](0x5)[_0xd0cd('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd0cd('0x25')}}; \ No newline at end of file +var _0xb215=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x5a9dc5,_0x4d8b55){var _0x120e31=function(_0x9a8ec6){while(--_0x9a8ec6){_0x5a9dc5['push'](_0x5a9dc5['shift']());}};_0x120e31(++_0x4d8b55);}(_0xb215,0xa7));var _0x5b21=function(_0x490701,_0x393e83){_0x490701=_0x490701-0x0;var _0x4f2da7=_0xb215[_0x490701];return _0x4f2da7;};'use strict';var Sequelize=require(_0x5b21('0x0'));module['exports']={'name':{'type':Sequelize[_0x5b21('0x1')],'unique':_0x5b21('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5b21('0x3')](_0x5b21('0x4')),'allowNull':![],'defaultValue':_0x5b21('0x4')},'description':{'type':Sequelize[_0x5b21('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x5b21('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5b21('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5b21('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5b21('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x5b21('0x7')](0x3)[_0x5b21('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5b21('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5b21('0x7')](0x3)[_0x5b21('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x5b21('0x7')](0x3)[_0x5b21('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5b21('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5b21('0x7')](0x5)[_0x5b21('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b21('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5b21('0x7')](0x3)[_0x5b21('0x5')],'defaultValue':0x3,'comment':_0x5b21('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5b21('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b21('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5b21('0x7')](0x3)[_0x5b21('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5b21('0x1')],'defaultValue':_0x5b21('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x5b21('0x3')](_0x5b21('0xe'),_0x5b21('0xf'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x5b21('0x10')],'defaultValue':0x0,'comment':_0x5b21('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x5b21('0x7')](0x9)[_0x5b21('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5b21('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x5b21('0x7')](0x9)[_0x5b21('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5b21('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5b21('0x7')](0x9)[_0x5b21('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5b21('0x7')](0x9)[_0x5b21('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5b21('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x5b21('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5b21('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5b21('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5b21('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5b21('0x7')](0x9)[_0x5b21('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5b21('0x7')](0x5)[_0x5b21('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5b21('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5b21('0x7')](0x9)[_0x5b21('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5b21('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5b21('0x3')](_0x5b21('0x19'),_0x5b21('0x1a')),'defaultValue':_0x5b21('0x19')},'dialPrefix':{'type':Sequelize[_0x5b21('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5b21('0x7')](0x3)[_0x5b21('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5b21('0x1b')},'dialCutDigit':{'type':Sequelize[_0x5b21('0x7')](0x3)[_0x5b21('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5b21('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5b21('0x7')](0x3)[_0x5b21('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5b21('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5b21('0x7')](0x5)[_0x5b21('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b21('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x5b21('0x7')](0x3)[_0x5b21('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5b21('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x5b21('0x7')](0x5)[_0x5b21('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b21('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5b21('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5b21('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5b21('0x7')](0x5)[_0x5b21('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x5b21('0x7')](0x3)[_0x5b21('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5b21('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5b21('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b21('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5b21('0x7')](0x3)[_0x5b21('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5b21('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b21('0x25')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 605d553..3641080 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 _0x9990=['get','IvrCampaigns','UserProfileResource','error','name','send','index','map','Campaign','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','params','rawAttributes','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','destroy','findOne','nolimit','CampaignId','CmHopper','rows','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','ContactId','ListId','select','field','phone','NOW()','scheduledAt','CmListId','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','COALESCE(phone,\x27\x27)','onlyIfOpen','CampaignId\x20=\x20?','cmHopperId','ci.item','ci.OrderBY','OrderBy','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then'];(function(_0x1c67b6,_0x565aa8){var _0x426895=function(_0x40ebd5){while(--_0x40ebd5){_0x1c67b6['push'](_0x1c67b6['shift']());}};_0x426895(++_0x565aa8);}(_0x9990,0xf6));var _0x0999=function(_0x5ed8f8,_0x245c75){_0x5ed8f8=_0x5ed8f8-0x0;var _0x1eddd2=_0x9990[_0x5ed8f8];return _0x1eddd2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0999('0x0'));var zipdir=require(_0x0999('0x1'));var jsonpatch=require(_0x0999('0x2'));var rp=require(_0x0999('0x3'));var moment=require(_0x0999('0x4'));var BPromise=require(_0x0999('0x5'));var Mustache=require(_0x0999('0x6'));var util=require(_0x0999('0x7'));var path=require('path');var sox=require(_0x0999('0x8'));var csv=require(_0x0999('0x9'));var ejs=require(_0x0999('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0999('0xb'));var squel=require(_0x0999('0xc'));var crypto=require(_0x0999('0xd'));var jsforce=require(_0x0999('0xe'));var deskjs=require(_0x0999('0xf'));var toCsv=require(_0x0999('0x9'));var querystring=require(_0x0999('0x10'));var Papa=require('papaparse');var Redis=require(_0x0999('0x11'));var authService=require(_0x0999('0x12'));var qs=require(_0x0999('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0999('0x14'));var logger=require(_0x0999('0x15'))(_0x0999('0x16'));var utils=require('../../config/utils');var config=require(_0x0999('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0999('0x18'))['db'];function respondWithStatusCode(_0x36133e,_0x2ea251){_0x2ea251=_0x2ea251||0xcc;return function(_0x428b59){if(_0x428b59){return _0x36133e[_0x0999('0x19')](_0x2ea251);}return _0x36133e['status'](_0x2ea251)[_0x0999('0x1a')]();};}function respondWithResult(_0x2fa8e0,_0x39cba9){_0x39cba9=_0x39cba9||0xc8;return function(_0x4011bf){if(_0x4011bf){return _0x2fa8e0[_0x0999('0x1b')](_0x39cba9)['json'](_0x4011bf);}};}function respondWithFilteredResult(_0x137083,_0x3757ae){return function(_0x6bf882){if(_0x6bf882){var _0x4e4e53=typeof _0x3757ae[_0x0999('0x1c')]===_0x0999('0x1d')&&typeof _0x3757ae[_0x0999('0x1e')]==='undefined';var _0xa82828=_0x6bf882[_0x0999('0x1f')];var _0x4f6440=_0x4e4e53?0x0:_0x3757ae[_0x0999('0x1c')];var _0x5b14a3=_0x4e4e53?_0x6bf882['count']:_0x3757ae[_0x0999('0x1c')]+_0x3757ae[_0x0999('0x1e')];var _0x220cc3;if(_0x5b14a3>=_0xa82828){_0x5b14a3=_0xa82828;_0x220cc3=0xc8;}else{_0x220cc3=0xce;}_0x137083[_0x0999('0x1b')](_0x220cc3);return _0x137083[_0x0999('0x20')](_0x0999('0x21'),_0x4f6440+'-'+_0x5b14a3+'/'+_0xa82828)[_0x0999('0x22')](_0x6bf882);}return null;};}function patchUpdates(_0x113017){return function(_0x8a5ef6){try{jsonpatch['apply'](_0x8a5ef6,_0x113017,!![]);}catch(_0xe118ec){return BPromise[_0x0999('0x23')](_0xe118ec);}return _0x8a5ef6['save']();};}function saveUpdates(_0x505372,_0x19ddc0){return function(_0xf2820c){if(_0xf2820c){return _0xf2820c[_0x0999('0x24')](_0x505372)[_0x0999('0x25')](function(_0x6c9bd9){return _0x6c9bd9;});}return null;};}function removeEntity(_0x15a7e8,_0x4d4f38){return function(_0x20ba88){if(_0x20ba88){return _0x20ba88['destroy']()[_0x0999('0x25')](function(){var _0x5618b3=_0x20ba88[_0x0999('0x26')]({'plain':!![]});var _0x106669=_0x0999('0x27');return db[_0x0999('0x28')]['destroy']({'where':{'type':_0x106669,'resourceId':_0x5618b3['id']}})['then'](function(){return _0x20ba88;});})[_0x0999('0x25')](function(){_0x15a7e8['status'](0xcc)[_0x0999('0x1a')]();});}};}function handleEntityNotFound(_0x4ba497,_0x2273ad){return function(_0x85cd84){if(!_0x85cd84){_0x4ba497[_0x0999('0x19')](0x194);}return _0x85cd84;};}function handleError(_0xf63dc7,_0x358f45){_0x358f45=_0x358f45||0x1f4;return function(_0x155d79){logger[_0x0999('0x29')](_0x155d79['stack']);if(_0x155d79[_0x0999('0x2a')]){delete _0x155d79[_0x0999('0x2a')];}_0xf63dc7[_0x0999('0x1b')](_0x358f45)[_0x0999('0x2b')](_0x155d79);};}exports[_0x0999('0x2c')]=function(_0x552f69,_0x106bf9){var _0x1cc07f={},_0x11c884={},_0x50f12d={'count':0x0,'rows':[]};var _0x586644=_[_0x0999('0x2d')](db[_0x0999('0x2e')]['rawAttributes'],function(_0xdf8b8b){return{'name':_0xdf8b8b[_0x0999('0x2f')],'type':_0xdf8b8b[_0x0999('0x30')]['key']};});_0x11c884[_0x0999('0x31')]=_['map'](_0x586644,_0x0999('0x2a'));_0x11c884[_0x0999('0x32')]=_[_0x0999('0x33')](_0x552f69[_0x0999('0x32')]);_0x11c884[_0x0999('0x34')]=_['intersection'](_0x11c884['model'],_0x11c884[_0x0999('0x32')]);_0x1cc07f[_0x0999('0x35')]=_[_0x0999('0x36')](_0x11c884[_0x0999('0x31')],qs['fields'](_0x552f69[_0x0999('0x32')][_0x0999('0x37')]));_0x1cc07f['attributes']=_0x1cc07f[_0x0999('0x35')][_0x0999('0x38')]?_0x1cc07f[_0x0999('0x35')]:_0x11c884[_0x0999('0x31')];if(!_0x552f69[_0x0999('0x32')][_0x0999('0x39')]('nolimit')){_0x1cc07f[_0x0999('0x1e')]=qs['limit'](_0x552f69[_0x0999('0x32')][_0x0999('0x1e')]);_0x1cc07f[_0x0999('0x1c')]=qs['offset'](_0x552f69[_0x0999('0x32')][_0x0999('0x1c')]);}_0x1cc07f[_0x0999('0x3a')]=qs[_0x0999('0x3b')](_0x552f69[_0x0999('0x32')][_0x0999('0x3b')]);_0x1cc07f[_0x0999('0x3c')]=qs[_0x0999('0x34')](_[_0x0999('0x3d')](_0x552f69[_0x0999('0x32')],_0x11c884['filters']),_0x586644);if(_0x552f69[_0x0999('0x32')][_0x0999('0x3e')]){_0x1cc07f['where']=_[_0x0999('0x3f')](_0x1cc07f[_0x0999('0x3c')],{'$or':_[_0x0999('0x2d')](_0x586644,function(_0xb96f4a){if(_0xb96f4a[_0x0999('0x30')]!=='VIRTUAL'){var _0x16820b={};_0x16820b[_0xb96f4a[_0x0999('0x2a')]]={'$like':'%'+_0x552f69[_0x0999('0x32')]['filter']+'%'};return _0x16820b;}})});}_0x1cc07f=_[_0x0999('0x3f')]({},_0x1cc07f,_0x552f69[_0x0999('0x40')]);var _0x2600e1={'where':_0x1cc07f[_0x0999('0x3c')]};return db[_0x0999('0x2e')][_0x0999('0x1f')](_0x2600e1)[_0x0999('0x25')](function(_0x315ca3){_0x50f12d[_0x0999('0x1f')]=_0x315ca3;if(_0x552f69[_0x0999('0x32')][_0x0999('0x41')]){_0x1cc07f[_0x0999('0x42')]=[{'all':!![]}];}return db['Campaign'][_0x0999('0x43')](_0x1cc07f);})[_0x0999('0x25')](function(_0x47edb3){_0x50f12d['rows']=_0x47edb3;return _0x50f12d;})[_0x0999('0x25')](respondWithFilteredResult(_0x106bf9,_0x1cc07f))['catch'](handleError(_0x106bf9,null));};exports['show']=function(_0x119722,_0x5e6bdf){var _0x144507={'raw':![],'where':{'id':_0x119722[_0x0999('0x44')]['id']}},_0xdf9219={};_0xdf9219[_0x0999('0x31')]=_[_0x0999('0x33')](db[_0x0999('0x2e')][_0x0999('0x45')]);_0xdf9219[_0x0999('0x32')]=_[_0x0999('0x33')](_0x119722['query']);_0xdf9219['filters']=_[_0x0999('0x36')](_0xdf9219[_0x0999('0x31')],_0xdf9219[_0x0999('0x32')]);_0x144507[_0x0999('0x35')]=_[_0x0999('0x36')](_0xdf9219[_0x0999('0x31')],qs[_0x0999('0x37')](_0x119722[_0x0999('0x32')]['fields']));_0x144507['attributes']=_0x144507[_0x0999('0x35')][_0x0999('0x38')]?_0x144507['attributes']:_0xdf9219[_0x0999('0x31')];if(_0x119722['query']['includeAll']){_0x144507[_0x0999('0x42')]=[{'all':!![]}];}_0x144507=_[_0x0999('0x3f')]({},_0x144507,_0x119722[_0x0999('0x40')]);return db[_0x0999('0x2e')][_0x0999('0x46')](_0x144507)[_0x0999('0x25')](handleEntityNotFound(_0x5e6bdf,null))[_0x0999('0x25')](respondWithResult(_0x5e6bdf,null))[_0x0999('0x47')](handleError(_0x5e6bdf,null));};exports[_0x0999('0x48')]=function(_0x508e42,_0x2ee544){return db[_0x0999('0x2e')][_0x0999('0x48')](_0x508e42[_0x0999('0x49')],{})[_0x0999('0x25')](function(_0x2e0e6b){var _0x3a51d1=_0x508e42[_0x0999('0x4a')][_0x0999('0x26')]({'plain':!![]});if(!_0x3a51d1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a51d1[_0x0999('0x4b')]==='user'){var _0x28924a=_0x2e0e6b[_0x0999('0x26')]({'plain':!![]});var _0x318345=_0x0999('0x27');return db[_0x0999('0x4c')]['find']({'where':{'name':_0x318345,'userProfileId':_0x3a51d1[_0x0999('0x4d')]},'raw':!![]})[_0x0999('0x25')](function(_0x3de0bf){if(_0x3de0bf&&_0x3de0bf[_0x0999('0x4e')]===0x0){return db[_0x0999('0x28')][_0x0999('0x48')]({'name':_0x28924a['name'],'resourceId':_0x28924a['id'],'type':_0x3de0bf[_0x0999('0x2a')],'sectionId':_0x3de0bf['id']},{})[_0x0999('0x25')](function(){return _0x2e0e6b;});}else{return _0x2e0e6b;}})[_0x0999('0x47')](function(_0x2113e8){logger[_0x0999('0x29')](_0x0999('0x4f'),_0x2113e8);throw _0x2113e8;});}return _0x2e0e6b;})[_0x0999('0x25')](respondWithResult(_0x2ee544,0xc9))['catch'](handleError(_0x2ee544,null));};exports[_0x0999('0x50')]=function(_0x1df925,_0x7039aa){var _0x18c346={'where':{'id':_0x1df925[_0x0999('0x44')]['id']}},_0x49fdef={};_0x49fdef[_0x0999('0x31')]=_[_0x0999('0x33')](db['Campaign'][_0x0999('0x45')]);_0x18c346[_0x0999('0x35')]=_[_0x0999('0x36')](_0x49fdef['model'],qs[_0x0999('0x37')](_0x1df925[_0x0999('0x32')][_0x0999('0x37')]));_0x18c346[_0x0999('0x35')]=_0x18c346[_0x0999('0x35')][_0x0999('0x38')]?_0x18c346[_0x0999('0x35')]:_0x49fdef[_0x0999('0x31')];if(_0x1df925[_0x0999('0x32')]['includeAll']){_0x18c346[_0x0999('0x42')]=[{'all':!![]}];}_0x18c346=_[_0x0999('0x3f')]({},_0x18c346,_0x1df925[_0x0999('0x40')]);return db[_0x0999('0x2e')][_0x0999('0x46')](_0x18c346)['then'](handleEntityNotFound(_0x7039aa,null))['then'](function(_0x295376){if(_0x295376){var _0x194a81=_0x295376['get']({'plain':!![]});_0x194a81=qs['omit'](_0x194a81,['id','createdAt',_0x0999('0x51')]);_0x1df925[_0x0999('0x49')]=_[_0x0999('0x52')](_0x1df925[_0x0999('0x49')],['id',_0x0999('0x53'),_0x0999('0x51')]);return db[_0x0999('0x2e')][_0x0999('0x48')](_[_0x0999('0x3f')](_0x194a81,_0x1df925['body']),{'include':_0x1df925[_0x0999('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x0999('0x25')](function(_0x13f9c4){var _0x466a10=_0x1df925[_0x0999('0x4a')][_0x0999('0x26')]({'plain':!![]});if(!_0x466a10)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x466a10['role']===_0x0999('0x4a')){var _0xfebea3=_0x13f9c4[_0x0999('0x26')]({'plain':!![]});var _0x23e16b=_0x0999('0x27');return db['UserProfileSection'][_0x0999('0x46')]({'where':{'name':_0x23e16b,'userProfileId':_0x466a10[_0x0999('0x4d')]},'raw':!![]})[_0x0999('0x25')](function(_0x27a4ae){if(_0x27a4ae&&_0x27a4ae[_0x0999('0x4e')]===0x0){return db[_0x0999('0x28')][_0x0999('0x48')]({'name':_0xfebea3[_0x0999('0x2a')],'resourceId':_0xfebea3['id'],'type':_0x27a4ae[_0x0999('0x2a')],'sectionId':_0x27a4ae['id']},{})[_0x0999('0x25')](function(){return _0x13f9c4;});}else{return _0x13f9c4;}})['catch'](function(_0x182d8b){logger[_0x0999('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x182d8b);throw _0x182d8b;});}return _0x13f9c4;});}})[_0x0999('0x25')](respondWithResult(_0x7039aa,0xc9))[_0x0999('0x47')](handleError(_0x7039aa,null));};exports[_0x0999('0x24')]=function(_0xb953f2,_0x5be19c){if(_0xb953f2[_0x0999('0x49')]['id']){delete _0xb953f2[_0x0999('0x49')]['id'];}return db[_0x0999('0x2e')]['find']({'where':{'id':_0xb953f2['params']['id']}})[_0x0999('0x25')](handleEntityNotFound(_0x5be19c,null))[_0x0999('0x25')](saveUpdates(_0xb953f2[_0x0999('0x49')],null))['then'](respondWithResult(_0x5be19c,null))[_0x0999('0x47')](handleError(_0x5be19c,null));};exports[_0x0999('0x54')]=function(_0x353a8f,_0x49a856){return db['Campaign'][_0x0999('0x46')]({'where':{'id':_0x353a8f[_0x0999('0x44')]['id']}})[_0x0999('0x25')](handleEntityNotFound(_0x49a856,null))[_0x0999('0x25')](removeEntity(_0x49a856,null))[_0x0999('0x47')](handleError(_0x49a856,null));};exports['getHoppers']=function(_0x511941,_0x4953dc,_0x279204){var _0xf80a13={'raw':!![],'where':{}};var _0x32b038={};var _0x4b9c7e={'count':0x0,'rows':[]};return db[_0x0999('0x2e')][_0x0999('0x55')]({'where':{'id':_0x511941[_0x0999('0x44')]['id']}})['then'](handleEntityNotFound(_0x4953dc,null))[_0x0999('0x25')](function(_0x11b119){if(_0x11b119){_0x32b038[_0x0999('0x31')]=_['keys'](db['CmHopper'][_0x0999('0x45')]);_0x32b038['query']=_[_0x0999('0x33')](_0x511941['query']);_0x32b038[_0x0999('0x34')]=_[_0x0999('0x36')](_0x32b038[_0x0999('0x31')],_0x32b038['query']);_0xf80a13[_0x0999('0x35')]=_['intersection'](_0x32b038[_0x0999('0x31')],qs[_0x0999('0x37')](_0x511941[_0x0999('0x32')][_0x0999('0x37')]));_0xf80a13[_0x0999('0x35')]=_0xf80a13[_0x0999('0x35')][_0x0999('0x38')]?_0xf80a13[_0x0999('0x35')]:_0x32b038[_0x0999('0x31')];if(!_0x511941[_0x0999('0x32')][_0x0999('0x39')](_0x0999('0x56'))){_0xf80a13['limit']=qs[_0x0999('0x1e')](_0x511941[_0x0999('0x32')]['limit']);_0xf80a13[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x511941[_0x0999('0x32')][_0x0999('0x1c')]);}_0xf80a13[_0x0999('0x3a')]=qs[_0x0999('0x3b')](_0x511941[_0x0999('0x32')][_0x0999('0x3b')]);_0xf80a13[_0x0999('0x3c')]=qs['filters'](_[_0x0999('0x3d')](_0x511941['query'],_0x32b038[_0x0999('0x34')]));_0xf80a13[_0x0999('0x3c')][_0x0999('0x57')]=_0x11b119['id'];if(_0x511941[_0x0999('0x32')][_0x0999('0x3e')]){_0xf80a13['where']=_[_0x0999('0x3f')](_0xf80a13['where'],{'$or':_[_0x0999('0x2d')](_0xf80a13[_0x0999('0x35')],function(_0x26b778){var _0x46fabd={};_0x46fabd[_0x26b778]={'$like':'%'+_0x511941[_0x0999('0x32')][_0x0999('0x3e')]+'%'};return _0x46fabd;})});}_0xf80a13=_['merge']({},_0xf80a13,_0x511941['options']);return db[_0x0999('0x58')][_0x0999('0x1f')]({'where':_0xf80a13['where']})[_0x0999('0x25')](function(_0x1d7821){_0x4b9c7e[_0x0999('0x1f')]=_0x1d7821;if(_0x511941['query'][_0x0999('0x41')]){_0xf80a13[_0x0999('0x42')]=[{'all':!![]}];}return db['CmHopper'][_0x0999('0x43')](_0xf80a13);})[_0x0999('0x25')](function(_0x55c64e){_0x4b9c7e[_0x0999('0x59')]=_0x55c64e;return _0x4b9c7e;});}})[_0x0999('0x25')](respondWithFilteredResult(_0x4953dc,_0xf80a13))[_0x0999('0x47')](handleError(_0x4953dc,null));};exports['getHopperHistories']=function(_0x198620,_0x4e8b45,_0x57086c){var _0x3b0a34={'raw':!![],'where':{}};var _0x5daaab={};var _0x108973={'count':0x0,'rows':[]};return db[_0x0999('0x2e')][_0x0999('0x55')]({'where':{'id':_0x198620[_0x0999('0x44')]['id']}})[_0x0999('0x25')](handleEntityNotFound(_0x4e8b45,null))[_0x0999('0x25')](function(_0x776b81){if(_0x776b81){_0x5daaab['model']=_[_0x0999('0x33')](db['CmHopperHistory']['rawAttributes']);_0x5daaab[_0x0999('0x32')]=_[_0x0999('0x33')](_0x198620[_0x0999('0x32')]);_0x5daaab['filters']=_['intersection'](_0x5daaab['model'],_0x5daaab['query']);_0x3b0a34[_0x0999('0x35')]=_[_0x0999('0x36')](_0x5daaab[_0x0999('0x31')],qs['fields'](_0x198620[_0x0999('0x32')][_0x0999('0x37')]));_0x3b0a34[_0x0999('0x35')]=_0x3b0a34[_0x0999('0x35')][_0x0999('0x38')]?_0x3b0a34['attributes']:_0x5daaab[_0x0999('0x31')];if(!_0x198620['query'][_0x0999('0x39')](_0x0999('0x56'))){_0x3b0a34[_0x0999('0x1e')]=qs[_0x0999('0x1e')](_0x198620[_0x0999('0x32')][_0x0999('0x1e')]);_0x3b0a34[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x198620[_0x0999('0x32')][_0x0999('0x1c')]);}_0x3b0a34['order']=qs[_0x0999('0x3b')](_0x198620[_0x0999('0x32')][_0x0999('0x3b')]);_0x3b0a34[_0x0999('0x3c')]=qs[_0x0999('0x34')](_[_0x0999('0x3d')](_0x198620[_0x0999('0x32')],_0x5daaab[_0x0999('0x34')]));_0x3b0a34[_0x0999('0x3c')][_0x0999('0x57')]=_0x776b81['id'];if(_0x198620[_0x0999('0x32')][_0x0999('0x3e')]){_0x3b0a34[_0x0999('0x3c')]=_[_0x0999('0x3f')](_0x3b0a34[_0x0999('0x3c')],{'$or':_['map'](_0x3b0a34[_0x0999('0x35')],function(_0x247221){var _0x489189={};_0x489189[_0x247221]={'$like':'%'+_0x198620[_0x0999('0x32')][_0x0999('0x3e')]+'%'};return _0x489189;})});}_0x3b0a34=_[_0x0999('0x3f')]({},_0x3b0a34,_0x198620[_0x0999('0x40')]);return db[_0x0999('0x5a')][_0x0999('0x1f')]({'where':_0x3b0a34[_0x0999('0x3c')]})[_0x0999('0x25')](function(_0x555745){_0x108973[_0x0999('0x1f')]=_0x555745;if(_0x198620['query'][_0x0999('0x41')]){_0x3b0a34['include']=[{'all':!![]}];}return db[_0x0999('0x5a')][_0x0999('0x43')](_0x3b0a34);})[_0x0999('0x25')](function(_0x14bf9c){_0x108973[_0x0999('0x59')]=_0x14bf9c;return _0x108973;});}})[_0x0999('0x25')](respondWithFilteredResult(_0x4e8b45,_0x3b0a34))[_0x0999('0x47')](handleError(_0x4e8b45,null));};exports['getHopperFinals']=function(_0x25c8e6,_0x18b1e3,_0x2db077){var _0x2e2b27={'raw':!![],'where':{}};var _0x546896={};var _0x37a5a6={'count':0x0,'rows':[]};return db['Campaign'][_0x0999('0x55')]({'where':{'id':_0x25c8e6[_0x0999('0x44')]['id']}})[_0x0999('0x25')](handleEntityNotFound(_0x18b1e3,null))['then'](function(_0x28fed5){if(_0x28fed5){_0x546896[_0x0999('0x31')]=_[_0x0999('0x33')](db['CmHopperFinal'][_0x0999('0x45')]);_0x546896[_0x0999('0x32')]=_[_0x0999('0x33')](_0x25c8e6[_0x0999('0x32')]);_0x546896['filters']=_[_0x0999('0x36')](_0x546896[_0x0999('0x31')],_0x546896[_0x0999('0x32')]);_0x2e2b27['attributes']=_[_0x0999('0x36')](_0x546896['model'],qs['fields'](_0x25c8e6[_0x0999('0x32')][_0x0999('0x37')]));_0x2e2b27[_0x0999('0x35')]=_0x2e2b27[_0x0999('0x35')][_0x0999('0x38')]?_0x2e2b27['attributes']:_0x546896[_0x0999('0x31')];if(!_0x25c8e6[_0x0999('0x32')][_0x0999('0x39')](_0x0999('0x56'))){_0x2e2b27[_0x0999('0x1e')]=qs['limit'](_0x25c8e6[_0x0999('0x32')][_0x0999('0x1e')]);_0x2e2b27['offset']=qs['offset'](_0x25c8e6[_0x0999('0x32')]['offset']);}_0x2e2b27['order']=qs[_0x0999('0x3b')](_0x25c8e6['query'][_0x0999('0x3b')]);_0x2e2b27[_0x0999('0x3c')]=qs[_0x0999('0x34')](_[_0x0999('0x3d')](_0x25c8e6['query'],_0x546896[_0x0999('0x34')]));_0x2e2b27[_0x0999('0x3c')]['CampaignId']=_0x28fed5['id'];if(_0x25c8e6[_0x0999('0x32')]['filter']){_0x2e2b27['where']=_[_0x0999('0x3f')](_0x2e2b27[_0x0999('0x3c')],{'$or':_[_0x0999('0x2d')](_0x2e2b27[_0x0999('0x35')],function(_0x4218a2){var _0x1df3da={};_0x1df3da[_0x4218a2]={'$like':'%'+_0x25c8e6[_0x0999('0x32')][_0x0999('0x3e')]+'%'};return _0x1df3da;})});}_0x2e2b27=_[_0x0999('0x3f')]({},_0x2e2b27,_0x25c8e6['options']);return db[_0x0999('0x5b')]['count']({'where':_0x2e2b27[_0x0999('0x3c')]})['then'](function(_0x55b105){_0x37a5a6[_0x0999('0x1f')]=_0x55b105;if(_0x25c8e6['query'][_0x0999('0x41')]){_0x2e2b27[_0x0999('0x42')]=[{'all':!![]}];}return db[_0x0999('0x5b')][_0x0999('0x43')](_0x2e2b27);})[_0x0999('0x25')](function(_0x2dc875){_0x37a5a6[_0x0999('0x59')]=_0x2dc875;return _0x37a5a6;});}})[_0x0999('0x25')](respondWithFilteredResult(_0x18b1e3,_0x2e2b27))[_0x0999('0x47')](handleError(_0x18b1e3,null));};exports[_0x0999('0x5c')]=function(_0x32fdf9,_0xcc3b62,_0x24f851){var _0x29488d={'raw':!![],'where':{}};var _0x1fb3bb={};var _0x403461={'count':0x0,'rows':[]};return db[_0x0999('0x2e')][_0x0999('0x55')]({'where':{'id':_0x32fdf9[_0x0999('0x44')]['id']}})[_0x0999('0x25')](handleEntityNotFound(_0xcc3b62,null))[_0x0999('0x25')](function(_0x32ec9a){if(_0x32ec9a){_0x1fb3bb[_0x0999('0x31')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x1fb3bb['query']=_[_0x0999('0x33')](_0x32fdf9[_0x0999('0x32')]);_0x1fb3bb[_0x0999('0x34')]=_[_0x0999('0x36')](_0x1fb3bb['model'],_0x1fb3bb[_0x0999('0x32')]);_0x29488d[_0x0999('0x35')]=_['intersection'](_0x1fb3bb['model'],qs[_0x0999('0x37')](_0x32fdf9['query'][_0x0999('0x37')]));_0x29488d[_0x0999('0x35')]=_0x29488d[_0x0999('0x35')][_0x0999('0x38')]?_0x29488d['attributes']:_0x1fb3bb[_0x0999('0x31')];if(!_0x32fdf9[_0x0999('0x32')]['hasOwnProperty'](_0x0999('0x56'))){_0x29488d[_0x0999('0x1e')]=qs[_0x0999('0x1e')](_0x32fdf9[_0x0999('0x32')][_0x0999('0x1e')]);_0x29488d[_0x0999('0x1c')]=qs['offset'](_0x32fdf9[_0x0999('0x32')][_0x0999('0x1c')]);}_0x29488d[_0x0999('0x3a')]=qs[_0x0999('0x3b')](_0x32fdf9[_0x0999('0x32')][_0x0999('0x3b')]);_0x29488d[_0x0999('0x3c')]=qs[_0x0999('0x34')](_[_0x0999('0x3d')](_0x32fdf9[_0x0999('0x32')],_0x1fb3bb[_0x0999('0x34')]));_0x29488d[_0x0999('0x3c')][_0x0999('0x57')]=_0x32ec9a['id'];if(_0x32fdf9[_0x0999('0x32')][_0x0999('0x3e')]){_0x29488d['where']=_[_0x0999('0x3f')](_0x29488d['where'],{'$or':_[_0x0999('0x2d')](_0x29488d[_0x0999('0x35')],function(_0x374d62){var _0x40e402={};_0x40e402[_0x374d62]={'$like':'%'+_0x32fdf9[_0x0999('0x32')][_0x0999('0x3e')]+'%'};return _0x40e402;})});}_0x29488d=_[_0x0999('0x3f')]({},_0x29488d,_0x32fdf9[_0x0999('0x40')]);return db[_0x0999('0x5d')][_0x0999('0x1f')]({'where':_0x29488d['where']})[_0x0999('0x25')](function(_0x34eb2a){_0x403461[_0x0999('0x1f')]=_0x34eb2a;if(_0x32fdf9[_0x0999('0x32')][_0x0999('0x41')]){_0x29488d[_0x0999('0x42')]=[{'all':!![]}];}return db[_0x0999('0x5d')][_0x0999('0x43')](_0x29488d);})[_0x0999('0x25')](function(_0x4605dc){_0x403461[_0x0999('0x59')]=_0x4605dc;return _0x403461;});}})[_0x0999('0x25')](respondWithFilteredResult(_0xcc3b62,_0x29488d))[_0x0999('0x47')](handleError(_0xcc3b62,null));};exports[_0x0999('0x5e')]=function(_0x38e78c,_0xc1961c,_0x36aa38){var _0x49e845={};var _0x37ec1f={};var _0x21021b;var _0x2f5841;return db['Campaign']['findOne']({'where':{'id':_0x38e78c[_0x0999('0x44')]['id']}})[_0x0999('0x25')](handleEntityNotFound(_0xc1961c,null))[_0x0999('0x25')](function(_0x27adfb){if(_0x27adfb){_0x21021b=_0x27adfb;_0x37ec1f[_0x0999('0x31')]=_['keys'](db[_0x0999('0x5f')][_0x0999('0x45')]);_0x37ec1f['query']=_['keys'](_0x38e78c['query']);_0x37ec1f['filters']=_[_0x0999('0x36')](_0x37ec1f['model'],_0x37ec1f['query']);_0x49e845[_0x0999('0x35')]=_[_0x0999('0x36')](_0x37ec1f[_0x0999('0x31')],qs['fields'](_0x38e78c[_0x0999('0x32')][_0x0999('0x37')]));_0x49e845['attributes']=_0x49e845[_0x0999('0x35')][_0x0999('0x38')]?_0x49e845['attributes']:_0x37ec1f[_0x0999('0x31')];_0x49e845['order']=qs[_0x0999('0x3b')](_0x38e78c[_0x0999('0x32')]['sort']);_0x49e845[_0x0999('0x3c')]=qs[_0x0999('0x34')](_[_0x0999('0x3d')](_0x38e78c[_0x0999('0x32')],_0x37ec1f[_0x0999('0x34')]));if(_0x38e78c[_0x0999('0x32')][_0x0999('0x3e')]){_0x49e845[_0x0999('0x3c')]=_['merge'](_0x49e845[_0x0999('0x3c')],{'$or':_['map'](_0x49e845[_0x0999('0x35')],function(_0x52a54f){var _0x3c84dc={};_0x3c84dc[_0x52a54f]={'$like':'%'+_0x38e78c[_0x0999('0x32')][_0x0999('0x3e')]+'%'};return _0x3c84dc;})});}_0x49e845=_[_0x0999('0x3f')]({},_0x49e845,_0x38e78c[_0x0999('0x40')]);return _0x21021b['getLists'](_0x49e845);}})['then'](function(_0x4dcafa){if(_0x4dcafa){_0x2f5841=_0x4dcafa[_0x0999('0x38')];if(!_0x38e78c[_0x0999('0x32')]['hasOwnProperty']('nolimit')){_0x49e845[_0x0999('0x1e')]=qs[_0x0999('0x1e')](_0x38e78c[_0x0999('0x32')][_0x0999('0x1e')]);_0x49e845[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x38e78c[_0x0999('0x32')][_0x0999('0x1c')]);}return _0x21021b[_0x0999('0x5e')](_0x49e845);}})[_0x0999('0x25')](function(_0x4e5dff){if(_0x4e5dff){return _0x4e5dff?{'count':_0x2f5841,'rows':_0x4e5dff}:null;}})[_0x0999('0x25')](respondWithResult(_0xc1961c,null))[_0x0999('0x47')](handleError(_0xc1961c,null));};exports[_0x0999('0x60')]=function(_0x1b6b6d,_0x3ff8c7,_0x37a697){var _0x5513b6,_0x2f9f90;var _0xbdd061=[];var _0x3ddfaa=moment()['format'](_0x0999('0x61'));return db[_0x0999('0x2e')][_0x0999('0x46')]({'where':{'id':_0x1b6b6d[_0x0999('0x44')]['id']}})[_0x0999('0x25')](handleEntityNotFound(_0x3ff8c7,null))[_0x0999('0x25')](function(_0x2aa3b3){if(_0x2aa3b3){_0x2f9f90=_0x2aa3b3;return _0x2aa3b3['addLists'](_0x1b6b6d[_0x0999('0x49')][_0x0999('0x62')],_[_0x0999('0x52')](_0x1b6b6d[_0x0999('0x49')],['ids','id'])||{});}return null;})[_0x0999('0x63')](function(_0x1e1cde){var _0x5be633;var _0x1c7e6b;_0x5513b6=_0x1e1cde||[];var _0x146c6e=[];if(_0x1e1cde){for(var _0x2cc9f7=0x0;_0x2cc9f7<_0x1e1cde[_0x0999('0x38')];_0x2cc9f7+=0x1){var _0x4d8b43=_0x1e1cde[_0x2cc9f7]['get']({'plain':!![]});_0x2f9f90[_0x0999('0x64')]=_0x1b6b6d[_0x0999('0x49')][_0x0999('0x64')]?_0x1b6b6d[_0x0999('0x49')][_0x0999('0x64')]:_0x2f9f90[_0x0999('0x64')];switch(_0x2f9f90[_0x0999('0x64')]){case'always':_0x5be633=squel[_0x0999('0x65')]()[_0x0999('0x66')](_0x0999('0x67'))[_0x0999('0x68')](['phone','scheduledAt',_0x0999('0x69'),_0x0999('0x6a'),_0x0999('0x57'),'createdAt','updatedAt'],squel[_0x0999('0x6b')]()[_0x0999('0x6c')](_0x0999('0x6d'),'phone')[_0x0999('0x6c')](_0x0999('0x6e'),_0x0999('0x6f'))['field']('id','ContactId')['field'](_0x4d8b43[_0x0999('0x70')][_0x0999('0x71')](),_0x0999('0x6a'))['field'](_0x1b6b6d[_0x0999('0x44')]['id'][_0x0999('0x71')](),_0x0999('0x57'))[_0x0999('0x6c')]('\x27'+_0x3ddfaa+'\x27',_0x0999('0x53'))[_0x0999('0x6c')]('\x27'+_0x3ddfaa+'\x27','updatedAt')[_0x0999('0x72')](_0x0999('0x73'))[_0x0999('0x3c')](_0x0999('0x74'))['where'](_0x0999('0x75'),_0x4d8b43['CmListId']['toString']())[_0x0999('0x3c')](_0x0999('0x76'))[_0x0999('0x3c')](_0x0999('0x77'),squel[_0x0999('0x6b')]()[_0x0999('0x6c')](_0x0999('0x78'))[_0x0999('0x72')](_0x0999('0x79'))[_0x0999('0x3c')]('CampaignId\x20=\x20?',_0x1b6b6d['params']['id'][_0x0999('0x71')]()))[_0x0999('0x3c')](_0x0999('0x77'),squel[_0x0999('0x6b')]()['field'](_0x0999('0x7a'))[_0x0999('0x72')](_0x0999('0x67'))['where']('CampaignId\x20=\x20?',_0x1b6b6d[_0x0999('0x44')]['id'][_0x0999('0x71')]())))[_0x0999('0x71')]();break;case _0x0999('0x7b'):_0x5be633=squel['insert']()[_0x0999('0x66')](_0x0999('0x67'))['fromQuery']([_0x0999('0x6d'),_0x0999('0x6f'),'ContactId',_0x0999('0x6a'),'CampaignId',_0x0999('0x53'),_0x0999('0x51')],squel['select']()[_0x0999('0x6c')](_0x0999('0x6d'),_0x0999('0x6d'))[_0x0999('0x6c')](_0x0999('0x6e'),_0x0999('0x6f'))[_0x0999('0x6c')]('id',_0x0999('0x69'))[_0x0999('0x6c')](_0x4d8b43[_0x0999('0x70')]['toString'](),_0x0999('0x6a'))['field'](_0x1b6b6d['params']['id'][_0x0999('0x71')](),_0x0999('0x57'))[_0x0999('0x6c')]('\x27'+_0x3ddfaa+'\x27','createdAt')[_0x0999('0x6c')]('\x27'+_0x3ddfaa+'\x27',_0x0999('0x51'))['from']('cm_contacts')[_0x0999('0x3c')](_0x0999('0x74'))[_0x0999('0x3c')](_0x0999('0x75'),_0x4d8b43[_0x0999('0x70')][_0x0999('0x71')]())[_0x0999('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x0999('0x3c')](_0x0999('0x77'),squel[_0x0999('0x6b')]()['field'](_0x0999('0x7a'))[_0x0999('0x72')]('cm_hopper')[_0x0999('0x3c')](_0x0999('0x7c'),_0x1b6b6d[_0x0999('0x44')]['id'][_0x0999('0x71')]())))[_0x0999('0x71')]();break;default:_0x5be633=squel[_0x0999('0x65')]()[_0x0999('0x66')]('cm_hopper')[_0x0999('0x68')]([_0x0999('0x6d'),_0x0999('0x6f'),'ContactId',_0x0999('0x6a'),'CampaignId',_0x0999('0x53'),_0x0999('0x51')],squel[_0x0999('0x6b')]()[_0x0999('0x6c')](_0x0999('0x6d'),'phone')['field'](_0x0999('0x6e'),'scheduledAt')['field']('id','ContactId')[_0x0999('0x6c')](_0x4d8b43[_0x0999('0x70')][_0x0999('0x71')](),_0x0999('0x6a'))[_0x0999('0x6c')](_0x1b6b6d['params']['id'][_0x0999('0x71')](),_0x0999('0x57'))[_0x0999('0x6c')]('\x27'+_0x3ddfaa+'\x27',_0x0999('0x53'))['field']('\x27'+_0x3ddfaa+'\x27','updatedAt')['from'](_0x0999('0x73'))[_0x0999('0x3c')](_0x0999('0x74'))[_0x0999('0x3c')](_0x0999('0x75'),_0x4d8b43['CmListId'][_0x0999('0x71')]())[_0x0999('0x3c')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x1c7e6b=squel[_0x0999('0x65')]()[_0x0999('0x66')]('cm_hopper_additional_phones')['fromQuery']([_0x0999('0x7d'),_0x0999('0x6f'),_0x0999('0x6d'),'OrderBy','createdAt','updatedAt'],squel[_0x0999('0x6b')]()[_0x0999('0x6c')]('h.id','id')[_0x0999('0x6c')]('NOW()','scheduledAt')['field'](_0x0999('0x7e'),_0x0999('0x6d'))[_0x0999('0x6c')](_0x0999('0x7f'),_0x0999('0x80'))['field']('\x27'+_0x3ddfaa+'\x27',_0x0999('0x53'))['field']('\x27'+_0x3ddfaa+'\x27',_0x0999('0x51'))[_0x0999('0x72')]('cm_contact_has_items','ci')[_0x0999('0x81')](_0x0999('0x67'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x0999('0x82'),_0x4d8b43[_0x0999('0x70')][_0x0999('0x71')]())[_0x0999('0x3c')](_0x0999('0x83'),_0x1b6b6d[_0x0999('0x44')]['id'][_0x0999('0x71')]())[_0x0999('0x3c')](_0x0999('0x84'),_0x3ddfaa))[_0x0999('0x71')]();_0x146c6e[_0x0999('0x85')](db[_0x0999('0x86')][_0x0999('0x32')](_0x5be633));_0xbdd061['push'](db[_0x0999('0x86')][_0x0999('0x32')](_0x1c7e6b));}return BPromise[_0x0999('0x87')](_0x146c6e);}})[_0x0999('0x25')](function(){return BPromise[_0x0999('0x87')](_0xbdd061);})[_0x0999('0x25')](function(){return _0x5513b6;})[_0x0999('0x25')](respondWithResult(_0x3ff8c7,null))[_0x0999('0x47')](handleError(_0x3ff8c7,null));};exports['removeLists']=function(_0x3195d8,_0x2ca285,_0x20df10){return db['Campaign'][_0x0999('0x46')]({'where':{'id':_0x3195d8[_0x0999('0x44')]['id']}})[_0x0999('0x25')](handleEntityNotFound(_0x2ca285,null))[_0x0999('0x25')](function(_0x241535){if(_0x241535){return _0x241535[_0x0999('0x88')](_0x3195d8['query'][_0x0999('0x62')]);}})['then'](function(_0xe82bd4){if(_0xe82bd4){return db[_0x0999('0x58')][_0x0999('0x54')]({'where':{'ListId':_0x3195d8[_0x0999('0x32')][_0x0999('0x62')],'CampaignId':_0x3195d8['params']['id']}})[_0x0999('0x25')](function(){return _0xe82bd4;});}})[_0x0999('0x25')](respondWithStatusCode(_0x2ca285,null))[_0x0999('0x47')](handleError(_0x2ca285,null));};exports[_0x0999('0x89')]=function(_0x3f1a54,_0x1c0056,_0x2e1e9c){var _0x5581de={};var _0x56d410={};var _0x111160;var _0x473eb8;return db[_0x0999('0x2e')][_0x0999('0x55')]({'where':{'id':_0x3f1a54['params']['id']}})['then'](handleEntityNotFound(_0x1c0056,null))[_0x0999('0x25')](function(_0x3d28bd){if(_0x3d28bd){_0x111160=_0x3d28bd;_0x56d410[_0x0999('0x31')]=_[_0x0999('0x33')](db[_0x0999('0x5f')][_0x0999('0x45')]);_0x56d410[_0x0999('0x32')]=_['keys'](_0x3f1a54[_0x0999('0x32')]);_0x56d410[_0x0999('0x34')]=_[_0x0999('0x36')](_0x56d410[_0x0999('0x31')],_0x56d410['query']);_0x5581de[_0x0999('0x35')]=_[_0x0999('0x36')](_0x56d410['model'],qs['fields'](_0x3f1a54[_0x0999('0x32')][_0x0999('0x37')]));_0x5581de[_0x0999('0x35')]=_0x5581de[_0x0999('0x35')]['length']?_0x5581de[_0x0999('0x35')]:_0x56d410[_0x0999('0x31')];_0x5581de[_0x0999('0x3a')]=qs['sort'](_0x3f1a54['query'][_0x0999('0x3b')]);_0x5581de[_0x0999('0x3c')]=qs[_0x0999('0x34')](_[_0x0999('0x3d')](_0x3f1a54[_0x0999('0x32')],_0x56d410[_0x0999('0x34')]));if(_0x3f1a54[_0x0999('0x32')][_0x0999('0x3e')]){_0x5581de[_0x0999('0x3c')]=_[_0x0999('0x3f')](_0x5581de[_0x0999('0x3c')],{'$or':_[_0x0999('0x2d')](_0x5581de[_0x0999('0x35')],function(_0x4e8cc3){var _0x1f43db={};_0x1f43db[_0x4e8cc3]={'$like':'%'+_0x3f1a54[_0x0999('0x32')][_0x0999('0x3e')]+'%'};return _0x1f43db;})});}_0x5581de=_[_0x0999('0x3f')]({},_0x5581de,_0x3f1a54[_0x0999('0x40')]);return _0x111160['getBlackLists'](_0x5581de);}})['then'](function(_0x2a3a44){if(_0x2a3a44){_0x473eb8=_0x2a3a44[_0x0999('0x38')];if(!_0x3f1a54[_0x0999('0x32')]['hasOwnProperty'](_0x0999('0x56'))){_0x5581de[_0x0999('0x1e')]=qs[_0x0999('0x1e')](_0x3f1a54[_0x0999('0x32')][_0x0999('0x1e')]);_0x5581de[_0x0999('0x1c')]=qs[_0x0999('0x1c')](_0x3f1a54[_0x0999('0x32')][_0x0999('0x1c')]);}return _0x111160[_0x0999('0x89')](_0x5581de);}})[_0x0999('0x25')](function(_0x585ff7){if(_0x585ff7){return _0x585ff7?{'count':_0x473eb8,'rows':_0x585ff7}:null;}})['then'](respondWithResult(_0x1c0056,null))[_0x0999('0x47')](handleError(_0x1c0056,null));};exports[_0x0999('0x8a')]=function(_0x60edb0,_0x1d9c9f,_0x4232ea){var _0x525242,_0x5c97eb;var _0x516016=[];var _0x942884=moment()[_0x0999('0x8b')](_0x0999('0x61'));return db[_0x0999('0x2e')]['find']({'where':{'id':_0x60edb0[_0x0999('0x44')]['id']}})[_0x0999('0x25')](handleEntityNotFound(_0x1d9c9f,null))[_0x0999('0x25')](function(_0x4b3e3b){if(_0x4b3e3b){_0x5c97eb=_0x4b3e3b;return _0x4b3e3b[_0x0999('0x8a')](_0x60edb0[_0x0999('0x49')][_0x0999('0x62')],_[_0x0999('0x52')](_0x60edb0[_0x0999('0x49')],[_0x0999('0x62'),'id'])||{});}return null;})[_0x0999('0x63')](function(_0xfdf58f){var _0x55ca8b;var _0x16541a;_0x525242=_0xfdf58f||[];var _0x2fea0f=[];if(_0xfdf58f){for(var _0x15401a=0x0;_0x15401a<_0xfdf58f['length'];_0x15401a+=0x1){var _0xab16b9=_0xfdf58f[_0x15401a]['get']({'plain':!![]});_0x55ca8b=squel['insert']()[_0x0999('0x66')](_0x0999('0x8c'))[_0x0999('0x68')]([_0x0999('0x6d'),_0x0999('0x69'),_0x0999('0x6a'),'CampaignId','createdAt',_0x0999('0x51')],squel['select']()[_0x0999('0x6c')](_0x0999('0x6d'),'phone')[_0x0999('0x6c')]('id',_0x0999('0x69'))['field'](_0xab16b9['CmListId']['toString'](),_0x0999('0x6a'))[_0x0999('0x6c')](_0x60edb0[_0x0999('0x44')]['id'][_0x0999('0x71')](),'CampaignId')[_0x0999('0x6c')]('NOW()',_0x0999('0x53'))['field'](_0x0999('0x6e'),'updatedAt')[_0x0999('0x72')](_0x0999('0x73'))['where'](_0x0999('0x74'))[_0x0999('0x3c')](_0x0999('0x75'),_0xab16b9[_0x0999('0x70')][_0x0999('0x71')]())[_0x0999('0x3c')](_0x0999('0x76')))[_0x0999('0x71')]();_0x2fea0f[_0x0999('0x85')](db[_0x0999('0x86')][_0x0999('0x32')](_0x55ca8b));}return BPromise['all'](_0x2fea0f);}})[_0x0999('0x25')](function(){return _0x525242;})[_0x0999('0x25')](respondWithResult(_0x1d9c9f,null))[_0x0999('0x47')](handleError(_0x1d9c9f,null));};exports[_0x0999('0x8d')]=function(_0x269752,_0x48289,_0x71211a){return db['Campaign'][_0x0999('0x46')]({'where':{'id':_0x269752[_0x0999('0x44')]['id']}})[_0x0999('0x25')](handleEntityNotFound(_0x48289,null))[_0x0999('0x25')](function(_0x2bdfb4){if(_0x2bdfb4){return _0x2bdfb4[_0x0999('0x8d')](_0x269752[_0x0999('0x32')]['ids']);}})[_0x0999('0x25')](function(_0x272ec2){if(_0x272ec2){return db[_0x0999('0x5d')][_0x0999('0x54')]({'where':{'ListId':_0x269752[_0x0999('0x32')][_0x0999('0x62')],'CampaignId':_0x269752[_0x0999('0x44')]['id']}})['then'](function(){return _0x272ec2;});}})[_0x0999('0x25')](respondWithStatusCode(_0x48289,null))[_0x0999('0x47')](handleError(_0x48289,null));}; \ No newline at end of file +var _0x3e40=['filters','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','role','userProfileId','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','findAll','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','scheduledAt','ContactId','ListId','field','phone','NOW()','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','cm_hopper_additional_phones','OrderBy','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?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0xacb1e2,_0x55e0ab){var _0x463815=function(_0x413c3b){while(--_0x413c3b){_0xacb1e2['push'](_0xacb1e2['shift']());}};_0x463815(++_0x55e0ab);}(_0x3e40,0xef));var _0x03e4=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x3e40[_0x34bf97];return _0x292719;};'use strict';var emlformat=require(_0x03e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03e4('0x1'));var jsonpatch=require(_0x03e4('0x2'));var rp=require(_0x03e4('0x3'));var moment=require(_0x03e4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x03e4('0x5'));var util=require(_0x03e4('0x6'));var path=require('path');var sox=require(_0x03e4('0x7'));var csv=require(_0x03e4('0x8'));var ejs=require(_0x03e4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03e4('0xa'));var squel=require(_0x03e4('0xb'));var crypto=require(_0x03e4('0xc'));var jsforce=require(_0x03e4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x03e4('0x8'));var querystring=require(_0x03e4('0xe'));var Papa=require(_0x03e4('0xf'));var Redis=require(_0x03e4('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x03e4('0x11'));var hardwareService=require(_0x03e4('0x12'));var logger=require(_0x03e4('0x13'))('api');var utils=require(_0x03e4('0x14'));var config=require(_0x03e4('0x15'));var licenseUtil=require(_0x03e4('0x16'));var db=require(_0x03e4('0x17'))['db'];function respondWithStatusCode(_0x2109cd,_0x170daf){_0x170daf=_0x170daf||0xcc;return function(_0x5d3cc6){if(_0x5d3cc6){return _0x2109cd[_0x03e4('0x18')](_0x170daf);}return _0x2109cd[_0x03e4('0x19')](_0x170daf)[_0x03e4('0x1a')]();};}function respondWithResult(_0x43c40f,_0x1a1203){_0x1a1203=_0x1a1203||0xc8;return function(_0x4f1ead){if(_0x4f1ead){return _0x43c40f[_0x03e4('0x19')](_0x1a1203)[_0x03e4('0x1b')](_0x4f1ead);}};}function respondWithFilteredResult(_0x5c3f8f,_0x521ef6){return function(_0x4d5c70){if(_0x4d5c70){var _0x32c51c=typeof _0x521ef6[_0x03e4('0x1c')]===_0x03e4('0x1d')&&typeof _0x521ef6[_0x03e4('0x1e')]===_0x03e4('0x1d');var _0x1bb524=_0x4d5c70['count'];var _0x4c28ed=_0x32c51c?0x0:_0x521ef6[_0x03e4('0x1c')];var _0x414978=_0x32c51c?_0x4d5c70[_0x03e4('0x1f')]:_0x521ef6[_0x03e4('0x1c')]+_0x521ef6['limit'];var _0x66844b;if(_0x414978>=_0x1bb524){_0x414978=_0x1bb524;_0x66844b=0xc8;}else{_0x66844b=0xce;}_0x5c3f8f['status'](_0x66844b);return _0x5c3f8f[_0x03e4('0x20')](_0x03e4('0x21'),_0x4c28ed+'-'+_0x414978+'/'+_0x1bb524)['json'](_0x4d5c70);}return null;};}function patchUpdates(_0x5a85f2){return function(_0x21c828){try{jsonpatch[_0x03e4('0x22')](_0x21c828,_0x5a85f2,!![]);}catch(_0x90355e){return BPromise[_0x03e4('0x23')](_0x90355e);}return _0x21c828[_0x03e4('0x24')]();};}function saveUpdates(_0x18ecaa,_0x4ac38c){return function(_0x2dd6d7){if(_0x2dd6d7){return _0x2dd6d7[_0x03e4('0x25')](_0x18ecaa)['then'](function(_0x268ee8){return _0x268ee8;});}return null;};}function removeEntity(_0x1abdf7,_0x2e5cd3){return function(_0x4d0ef9){if(_0x4d0ef9){return _0x4d0ef9[_0x03e4('0x26')]()[_0x03e4('0x27')](function(){var _0x231f13=_0x4d0ef9[_0x03e4('0x28')]({'plain':!![]});var _0x1cfc95='IvrCampaigns';return db[_0x03e4('0x29')][_0x03e4('0x26')]({'where':{'type':_0x1cfc95,'resourceId':_0x231f13['id']}})[_0x03e4('0x27')](function(){return _0x4d0ef9;});})[_0x03e4('0x27')](function(){_0x1abdf7[_0x03e4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5031b1,_0x1666a1){return function(_0x2b95f2){if(!_0x2b95f2){_0x5031b1['sendStatus'](0x194);}return _0x2b95f2;};}function handleError(_0x44cbfd,_0x26cf1d){_0x26cf1d=_0x26cf1d||0x1f4;return function(_0x20c2d0){logger['error'](_0x20c2d0[_0x03e4('0x2a')]);if(_0x20c2d0[_0x03e4('0x2b')]){delete _0x20c2d0[_0x03e4('0x2b')];}_0x44cbfd[_0x03e4('0x19')](_0x26cf1d)['send'](_0x20c2d0);};}exports[_0x03e4('0x2c')]=function(_0x84fe53,_0x2695d6){var _0x137e54={},_0x489982={},_0x4d5210={'count':0x0,'rows':[]};var _0x17c245=_[_0x03e4('0x2d')](db[_0x03e4('0x2e')][_0x03e4('0x2f')],function(_0x3ea009){return{'name':_0x3ea009[_0x03e4('0x30')],'type':_0x3ea009[_0x03e4('0x31')][_0x03e4('0x32')]};});_0x489982[_0x03e4('0x33')]=_[_0x03e4('0x2d')](_0x17c245,_0x03e4('0x2b'));_0x489982[_0x03e4('0x34')]=_[_0x03e4('0x35')](_0x84fe53[_0x03e4('0x34')]);_0x489982['filters']=_[_0x03e4('0x36')](_0x489982[_0x03e4('0x33')],_0x489982['query']);_0x137e54['attributes']=_[_0x03e4('0x36')](_0x489982['model'],qs[_0x03e4('0x37')](_0x84fe53[_0x03e4('0x34')][_0x03e4('0x37')]));_0x137e54[_0x03e4('0x38')]=_0x137e54['attributes'][_0x03e4('0x39')]?_0x137e54[_0x03e4('0x38')]:_0x489982[_0x03e4('0x33')];if(!_0x84fe53[_0x03e4('0x34')][_0x03e4('0x3a')](_0x03e4('0x3b'))){_0x137e54['limit']=qs[_0x03e4('0x1e')](_0x84fe53[_0x03e4('0x34')][_0x03e4('0x1e')]);_0x137e54[_0x03e4('0x1c')]=qs[_0x03e4('0x1c')](_0x84fe53[_0x03e4('0x34')][_0x03e4('0x1c')]);}_0x137e54[_0x03e4('0x3c')]=qs['sort'](_0x84fe53[_0x03e4('0x34')][_0x03e4('0x3d')]);_0x137e54[_0x03e4('0x3e')]=qs[_0x03e4('0x3f')](_['pick'](_0x84fe53['query'],_0x489982[_0x03e4('0x3f')]),_0x17c245);if(_0x84fe53[_0x03e4('0x34')]['filter']){_0x137e54['where']=_[_0x03e4('0x40')](_0x137e54[_0x03e4('0x3e')],{'$or':_[_0x03e4('0x2d')](_0x17c245,function(_0x4a5d31){if(_0x4a5d31[_0x03e4('0x31')]!==_0x03e4('0x41')){var _0xbd5442={};_0xbd5442[_0x4a5d31[_0x03e4('0x2b')]]={'$like':'%'+_0x84fe53[_0x03e4('0x34')][_0x03e4('0x42')]+'%'};return _0xbd5442;}})});}_0x137e54=_['merge']({},_0x137e54,_0x84fe53[_0x03e4('0x43')]);var _0x43bbb0={'where':_0x137e54[_0x03e4('0x3e')]};return db[_0x03e4('0x2e')][_0x03e4('0x1f')](_0x43bbb0)['then'](function(_0x5595ca){_0x4d5210[_0x03e4('0x1f')]=_0x5595ca;if(_0x84fe53[_0x03e4('0x34')][_0x03e4('0x44')]){_0x137e54[_0x03e4('0x45')]=[{'all':!![]}];}return db[_0x03e4('0x2e')]['findAll'](_0x137e54);})[_0x03e4('0x27')](function(_0xacdf3a){_0x4d5210[_0x03e4('0x46')]=_0xacdf3a;return _0x4d5210;})['then'](respondWithFilteredResult(_0x2695d6,_0x137e54))[_0x03e4('0x47')](handleError(_0x2695d6,null));};exports[_0x03e4('0x48')]=function(_0x17a69c,_0xec59a5){var _0x15037c={'raw':![],'where':{'id':_0x17a69c[_0x03e4('0x49')]['id']}},_0x2df559={};_0x2df559['model']=_[_0x03e4('0x35')](db['Campaign'][_0x03e4('0x2f')]);_0x2df559[_0x03e4('0x34')]=_[_0x03e4('0x35')](_0x17a69c['query']);_0x2df559['filters']=_['intersection'](_0x2df559[_0x03e4('0x33')],_0x2df559[_0x03e4('0x34')]);_0x15037c[_0x03e4('0x38')]=_['intersection'](_0x2df559[_0x03e4('0x33')],qs[_0x03e4('0x37')](_0x17a69c['query'][_0x03e4('0x37')]));_0x15037c[_0x03e4('0x38')]=_0x15037c['attributes'][_0x03e4('0x39')]?_0x15037c[_0x03e4('0x38')]:_0x2df559['model'];if(_0x17a69c[_0x03e4('0x34')][_0x03e4('0x44')]){_0x15037c[_0x03e4('0x45')]=[{'all':!![]}];}_0x15037c=_[_0x03e4('0x40')]({},_0x15037c,_0x17a69c['options']);return db[_0x03e4('0x2e')][_0x03e4('0x4a')](_0x15037c)[_0x03e4('0x27')](handleEntityNotFound(_0xec59a5,null))[_0x03e4('0x27')](respondWithResult(_0xec59a5,null))[_0x03e4('0x47')](handleError(_0xec59a5,null));};exports[_0x03e4('0x4b')]=function(_0x20c77a,_0x138b70){return db[_0x03e4('0x2e')]['create'](_0x20c77a[_0x03e4('0x4c')],{})['then'](function(_0x3c2596){var _0x45d49f=_0x20c77a[_0x03e4('0x4d')][_0x03e4('0x28')]({'plain':!![]});if(!_0x45d49f)throw new Error(_0x03e4('0x4e'));if(_0x45d49f['role']===_0x03e4('0x4d')){var _0x5bcded=_0x3c2596['get']({'plain':!![]});var _0x5cccbc=_0x03e4('0x4f');return db[_0x03e4('0x50')]['find']({'where':{'name':_0x5cccbc,'userProfileId':_0x45d49f['userProfileId']},'raw':!![]})[_0x03e4('0x27')](function(_0x141e35){if(_0x141e35&&_0x141e35[_0x03e4('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x5bcded['name'],'resourceId':_0x5bcded['id'],'type':_0x141e35[_0x03e4('0x2b')],'sectionId':_0x141e35['id']},{})[_0x03e4('0x27')](function(){return _0x3c2596;});}else{return _0x3c2596;}})[_0x03e4('0x47')](function(_0x1264b9){logger[_0x03e4('0x52')](_0x03e4('0x53'),_0x1264b9);throw _0x1264b9;});}return _0x3c2596;})[_0x03e4('0x27')](respondWithResult(_0x138b70,0xc9))[_0x03e4('0x47')](handleError(_0x138b70,null));};exports['clone']=function(_0x70d74a,_0x154335){var _0x3cc8ae={'where':{'id':_0x70d74a[_0x03e4('0x49')]['id']}},_0x5c3b33={};_0x5c3b33[_0x03e4('0x33')]=_[_0x03e4('0x35')](db[_0x03e4('0x2e')][_0x03e4('0x2f')]);_0x3cc8ae[_0x03e4('0x38')]=_[_0x03e4('0x36')](_0x5c3b33[_0x03e4('0x33')],qs[_0x03e4('0x37')](_0x70d74a[_0x03e4('0x34')][_0x03e4('0x37')]));_0x3cc8ae[_0x03e4('0x38')]=_0x3cc8ae[_0x03e4('0x38')][_0x03e4('0x39')]?_0x3cc8ae[_0x03e4('0x38')]:_0x5c3b33['model'];if(_0x70d74a[_0x03e4('0x34')][_0x03e4('0x44')]){_0x3cc8ae[_0x03e4('0x45')]=[{'all':!![]}];}_0x3cc8ae=_[_0x03e4('0x40')]({},_0x3cc8ae,_0x70d74a[_0x03e4('0x43')]);return db[_0x03e4('0x2e')][_0x03e4('0x4a')](_0x3cc8ae)[_0x03e4('0x27')](handleEntityNotFound(_0x154335,null))[_0x03e4('0x27')](function(_0x168ee1){if(_0x168ee1){var _0x3b3e10=_0x168ee1[_0x03e4('0x28')]({'plain':!![]});_0x3b3e10=qs[_0x03e4('0x54')](_0x3b3e10,['id',_0x03e4('0x55'),'updatedAt']);_0x70d74a[_0x03e4('0x4c')]=_[_0x03e4('0x54')](_0x70d74a[_0x03e4('0x4c')],['id',_0x03e4('0x55'),_0x03e4('0x56')]);return db['Campaign'][_0x03e4('0x4b')](_[_0x03e4('0x40')](_0x3b3e10,_0x70d74a[_0x03e4('0x4c')]),{'include':_0x70d74a[_0x03e4('0x34')][_0x03e4('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x3b5997){var _0x3f6e23=_0x70d74a[_0x03e4('0x4d')][_0x03e4('0x28')]({'plain':!![]});if(!_0x3f6e23)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f6e23[_0x03e4('0x57')]===_0x03e4('0x4d')){var _0xcdd070=_0x3b5997[_0x03e4('0x28')]({'plain':!![]});var _0x5a7050='IvrCampaigns';return db[_0x03e4('0x50')]['find']({'where':{'name':_0x5a7050,'userProfileId':_0x3f6e23[_0x03e4('0x58')]},'raw':!![]})['then'](function(_0x445435){if(_0x445435&&_0x445435[_0x03e4('0x51')]===0x0){return db[_0x03e4('0x29')][_0x03e4('0x4b')]({'name':_0xcdd070[_0x03e4('0x2b')],'resourceId':_0xcdd070['id'],'type':_0x445435['name'],'sectionId':_0x445435['id']},{})['then'](function(){return _0x3b5997;});}else{return _0x3b5997;}})[_0x03e4('0x47')](function(_0x41b5f0){logger[_0x03e4('0x52')](_0x03e4('0x53'),_0x41b5f0);throw _0x41b5f0;});}return _0x3b5997;});}})['then'](respondWithResult(_0x154335,0xc9))[_0x03e4('0x47')](handleError(_0x154335,null));};exports['update']=function(_0x2911c7,_0x524923){if(_0x2911c7[_0x03e4('0x4c')]['id']){delete _0x2911c7[_0x03e4('0x4c')]['id'];}return db[_0x03e4('0x2e')][_0x03e4('0x4a')]({'where':{'id':_0x2911c7[_0x03e4('0x49')]['id']}})[_0x03e4('0x27')](handleEntityNotFound(_0x524923,null))[_0x03e4('0x27')](saveUpdates(_0x2911c7[_0x03e4('0x4c')],null))[_0x03e4('0x27')](respondWithResult(_0x524923,null))['catch'](handleError(_0x524923,null));};exports['destroy']=function(_0x46a25c,_0x32a04e){return db[_0x03e4('0x2e')][_0x03e4('0x4a')]({'where':{'id':_0x46a25c[_0x03e4('0x49')]['id']}})[_0x03e4('0x27')](handleEntityNotFound(_0x32a04e,null))[_0x03e4('0x27')](removeEntity(_0x32a04e,null))['catch'](handleError(_0x32a04e,null));};exports['getHoppers']=function(_0x41b6df,_0x573857,_0x129768){var _0x264d81={'raw':!![],'where':{}};var _0x4b1150={};var _0x31ca39={'count':0x0,'rows':[]};return db[_0x03e4('0x2e')][_0x03e4('0x59')]({'where':{'id':_0x41b6df[_0x03e4('0x49')]['id']}})[_0x03e4('0x27')](handleEntityNotFound(_0x573857,null))[_0x03e4('0x27')](function(_0x2d9f06){if(_0x2d9f06){_0x4b1150[_0x03e4('0x33')]=_[_0x03e4('0x35')](db[_0x03e4('0x5a')]['rawAttributes']);_0x4b1150['query']=_[_0x03e4('0x35')](_0x41b6df['query']);_0x4b1150['filters']=_[_0x03e4('0x36')](_0x4b1150[_0x03e4('0x33')],_0x4b1150[_0x03e4('0x34')]);_0x264d81[_0x03e4('0x38')]=_[_0x03e4('0x36')](_0x4b1150[_0x03e4('0x33')],qs[_0x03e4('0x37')](_0x41b6df[_0x03e4('0x34')]['fields']));_0x264d81[_0x03e4('0x38')]=_0x264d81[_0x03e4('0x38')][_0x03e4('0x39')]?_0x264d81[_0x03e4('0x38')]:_0x4b1150[_0x03e4('0x33')];if(!_0x41b6df[_0x03e4('0x34')][_0x03e4('0x3a')](_0x03e4('0x3b'))){_0x264d81[_0x03e4('0x1e')]=qs['limit'](_0x41b6df['query'][_0x03e4('0x1e')]);_0x264d81[_0x03e4('0x1c')]=qs[_0x03e4('0x1c')](_0x41b6df[_0x03e4('0x34')][_0x03e4('0x1c')]);}_0x264d81[_0x03e4('0x3c')]=qs[_0x03e4('0x3d')](_0x41b6df['query'][_0x03e4('0x3d')]);_0x264d81[_0x03e4('0x3e')]=qs[_0x03e4('0x3f')](_['pick'](_0x41b6df['query'],_0x4b1150['filters']));_0x264d81[_0x03e4('0x3e')][_0x03e4('0x5b')]=_0x2d9f06['id'];if(_0x41b6df[_0x03e4('0x34')][_0x03e4('0x42')]){_0x264d81['where']=_['merge'](_0x264d81[_0x03e4('0x3e')],{'$or':_[_0x03e4('0x2d')](_0x264d81['attributes'],function(_0x3d3874){var _0x4c04a1={};_0x4c04a1[_0x3d3874]={'$like':'%'+_0x41b6df[_0x03e4('0x34')][_0x03e4('0x42')]+'%'};return _0x4c04a1;})});}_0x264d81=_[_0x03e4('0x40')]({},_0x264d81,_0x41b6df['options']);return db[_0x03e4('0x5a')][_0x03e4('0x1f')]({'where':_0x264d81[_0x03e4('0x3e')]})[_0x03e4('0x27')](function(_0x49c969){_0x31ca39['count']=_0x49c969;if(_0x41b6df[_0x03e4('0x34')][_0x03e4('0x44')]){_0x264d81['include']=[{'all':!![]}];}return db[_0x03e4('0x5a')]['findAll'](_0x264d81);})[_0x03e4('0x27')](function(_0x376bae){_0x31ca39['rows']=_0x376bae;return _0x31ca39;});}})['then'](respondWithFilteredResult(_0x573857,_0x264d81))[_0x03e4('0x47')](handleError(_0x573857,null));};exports[_0x03e4('0x5c')]=function(_0x17e165,_0x57cf9a,_0x1dc34b){var _0x1907e3={'raw':!![],'where':{}};var _0x37a860={};var _0xa4b21d={'count':0x0,'rows':[]};return db[_0x03e4('0x2e')][_0x03e4('0x59')]({'where':{'id':_0x17e165[_0x03e4('0x49')]['id']}})['then'](handleEntityNotFound(_0x57cf9a,null))['then'](function(_0x5b24e2){if(_0x5b24e2){_0x37a860[_0x03e4('0x33')]=_[_0x03e4('0x35')](db[_0x03e4('0x5d')][_0x03e4('0x2f')]);_0x37a860['query']=_[_0x03e4('0x35')](_0x17e165['query']);_0x37a860[_0x03e4('0x3f')]=_[_0x03e4('0x36')](_0x37a860[_0x03e4('0x33')],_0x37a860[_0x03e4('0x34')]);_0x1907e3[_0x03e4('0x38')]=_[_0x03e4('0x36')](_0x37a860[_0x03e4('0x33')],qs[_0x03e4('0x37')](_0x17e165['query'][_0x03e4('0x37')]));_0x1907e3['attributes']=_0x1907e3[_0x03e4('0x38')][_0x03e4('0x39')]?_0x1907e3[_0x03e4('0x38')]:_0x37a860['model'];if(!_0x17e165[_0x03e4('0x34')][_0x03e4('0x3a')]('nolimit')){_0x1907e3['limit']=qs['limit'](_0x17e165['query'][_0x03e4('0x1e')]);_0x1907e3[_0x03e4('0x1c')]=qs[_0x03e4('0x1c')](_0x17e165[_0x03e4('0x34')][_0x03e4('0x1c')]);}_0x1907e3[_0x03e4('0x3c')]=qs[_0x03e4('0x3d')](_0x17e165[_0x03e4('0x34')][_0x03e4('0x3d')]);_0x1907e3[_0x03e4('0x3e')]=qs[_0x03e4('0x3f')](_[_0x03e4('0x5e')](_0x17e165[_0x03e4('0x34')],_0x37a860[_0x03e4('0x3f')]));_0x1907e3['where'][_0x03e4('0x5b')]=_0x5b24e2['id'];if(_0x17e165[_0x03e4('0x34')][_0x03e4('0x42')]){_0x1907e3[_0x03e4('0x3e')]=_[_0x03e4('0x40')](_0x1907e3[_0x03e4('0x3e')],{'$or':_[_0x03e4('0x2d')](_0x1907e3[_0x03e4('0x38')],function(_0x432836){var _0x50ce7e={};_0x50ce7e[_0x432836]={'$like':'%'+_0x17e165['query'][_0x03e4('0x42')]+'%'};return _0x50ce7e;})});}_0x1907e3=_[_0x03e4('0x40')]({},_0x1907e3,_0x17e165['options']);return db['CmHopperHistory'][_0x03e4('0x1f')]({'where':_0x1907e3[_0x03e4('0x3e')]})[_0x03e4('0x27')](function(_0x217d31){_0xa4b21d[_0x03e4('0x1f')]=_0x217d31;if(_0x17e165[_0x03e4('0x34')]['includeAll']){_0x1907e3[_0x03e4('0x45')]=[{'all':!![]}];}return db[_0x03e4('0x5d')]['findAll'](_0x1907e3);})[_0x03e4('0x27')](function(_0x59e7ea){_0xa4b21d[_0x03e4('0x46')]=_0x59e7ea;return _0xa4b21d;});}})[_0x03e4('0x27')](respondWithFilteredResult(_0x57cf9a,_0x1907e3))[_0x03e4('0x47')](handleError(_0x57cf9a,null));};exports[_0x03e4('0x5f')]=function(_0x25e0c9,_0x5e60c9,_0x2b05bd){var _0x5c7583={'raw':!![],'where':{}};var _0x53f40a={};var _0x2b60af={'count':0x0,'rows':[]};return db['Campaign'][_0x03e4('0x59')]({'where':{'id':_0x25e0c9['params']['id']}})[_0x03e4('0x27')](handleEntityNotFound(_0x5e60c9,null))['then'](function(_0x17a050){if(_0x17a050){_0x53f40a[_0x03e4('0x33')]=_[_0x03e4('0x35')](db[_0x03e4('0x60')][_0x03e4('0x2f')]);_0x53f40a[_0x03e4('0x34')]=_[_0x03e4('0x35')](_0x25e0c9[_0x03e4('0x34')]);_0x53f40a[_0x03e4('0x3f')]=_[_0x03e4('0x36')](_0x53f40a['model'],_0x53f40a[_0x03e4('0x34')]);_0x5c7583['attributes']=_[_0x03e4('0x36')](_0x53f40a[_0x03e4('0x33')],qs[_0x03e4('0x37')](_0x25e0c9['query']['fields']));_0x5c7583[_0x03e4('0x38')]=_0x5c7583[_0x03e4('0x38')][_0x03e4('0x39')]?_0x5c7583[_0x03e4('0x38')]:_0x53f40a[_0x03e4('0x33')];if(!_0x25e0c9['query'][_0x03e4('0x3a')]('nolimit')){_0x5c7583[_0x03e4('0x1e')]=qs[_0x03e4('0x1e')](_0x25e0c9[_0x03e4('0x34')][_0x03e4('0x1e')]);_0x5c7583[_0x03e4('0x1c')]=qs['offset'](_0x25e0c9[_0x03e4('0x34')]['offset']);}_0x5c7583['order']=qs[_0x03e4('0x3d')](_0x25e0c9['query']['sort']);_0x5c7583[_0x03e4('0x3e')]=qs[_0x03e4('0x3f')](_[_0x03e4('0x5e')](_0x25e0c9[_0x03e4('0x34')],_0x53f40a[_0x03e4('0x3f')]));_0x5c7583['where'][_0x03e4('0x5b')]=_0x17a050['id'];if(_0x25e0c9[_0x03e4('0x34')][_0x03e4('0x42')]){_0x5c7583[_0x03e4('0x3e')]=_[_0x03e4('0x40')](_0x5c7583[_0x03e4('0x3e')],{'$or':_[_0x03e4('0x2d')](_0x5c7583[_0x03e4('0x38')],function(_0x3cf49a){var _0x14cf5b={};_0x14cf5b[_0x3cf49a]={'$like':'%'+_0x25e0c9[_0x03e4('0x34')][_0x03e4('0x42')]+'%'};return _0x14cf5b;})});}_0x5c7583=_[_0x03e4('0x40')]({},_0x5c7583,_0x25e0c9['options']);return db['CmHopperFinal'][_0x03e4('0x1f')]({'where':_0x5c7583[_0x03e4('0x3e')]})[_0x03e4('0x27')](function(_0x48de35){_0x2b60af[_0x03e4('0x1f')]=_0x48de35;if(_0x25e0c9[_0x03e4('0x34')][_0x03e4('0x44')]){_0x5c7583['include']=[{'all':!![]}];}return db[_0x03e4('0x60')]['findAll'](_0x5c7583);})[_0x03e4('0x27')](function(_0x2d7882){_0x2b60af[_0x03e4('0x46')]=_0x2d7882;return _0x2b60af;});}})['then'](respondWithFilteredResult(_0x5e60c9,_0x5c7583))[_0x03e4('0x47')](handleError(_0x5e60c9,null));};exports[_0x03e4('0x61')]=function(_0x328061,_0xa279f4,_0x3e07a2){var _0xf7f0ce={'raw':!![],'where':{}};var _0xa69e0c={};var _0x4c1f47={'count':0x0,'rows':[]};return db[_0x03e4('0x2e')][_0x03e4('0x59')]({'where':{'id':_0x328061[_0x03e4('0x49')]['id']}})[_0x03e4('0x27')](handleEntityNotFound(_0xa279f4,null))['then'](function(_0x51860e){if(_0x51860e){_0xa69e0c[_0x03e4('0x33')]=_[_0x03e4('0x35')](db[_0x03e4('0x62')]['rawAttributes']);_0xa69e0c['query']=_[_0x03e4('0x35')](_0x328061[_0x03e4('0x34')]);_0xa69e0c['filters']=_[_0x03e4('0x36')](_0xa69e0c[_0x03e4('0x33')],_0xa69e0c[_0x03e4('0x34')]);_0xf7f0ce[_0x03e4('0x38')]=_['intersection'](_0xa69e0c[_0x03e4('0x33')],qs[_0x03e4('0x37')](_0x328061['query']['fields']));_0xf7f0ce[_0x03e4('0x38')]=_0xf7f0ce[_0x03e4('0x38')][_0x03e4('0x39')]?_0xf7f0ce[_0x03e4('0x38')]:_0xa69e0c['model'];if(!_0x328061[_0x03e4('0x34')]['hasOwnProperty'](_0x03e4('0x3b'))){_0xf7f0ce[_0x03e4('0x1e')]=qs[_0x03e4('0x1e')](_0x328061[_0x03e4('0x34')][_0x03e4('0x1e')]);_0xf7f0ce[_0x03e4('0x1c')]=qs[_0x03e4('0x1c')](_0x328061[_0x03e4('0x34')]['offset']);}_0xf7f0ce[_0x03e4('0x3c')]=qs[_0x03e4('0x3d')](_0x328061['query'][_0x03e4('0x3d')]);_0xf7f0ce['where']=qs[_0x03e4('0x3f')](_[_0x03e4('0x5e')](_0x328061['query'],_0xa69e0c[_0x03e4('0x3f')]));_0xf7f0ce['where'][_0x03e4('0x5b')]=_0x51860e['id'];if(_0x328061[_0x03e4('0x34')]['filter']){_0xf7f0ce['where']=_[_0x03e4('0x40')](_0xf7f0ce[_0x03e4('0x3e')],{'$or':_[_0x03e4('0x2d')](_0xf7f0ce[_0x03e4('0x38')],function(_0x27a04c){var _0x361434={};_0x361434[_0x27a04c]={'$like':'%'+_0x328061['query'][_0x03e4('0x42')]+'%'};return _0x361434;})});}_0xf7f0ce=_[_0x03e4('0x40')]({},_0xf7f0ce,_0x328061[_0x03e4('0x43')]);return db[_0x03e4('0x62')][_0x03e4('0x1f')]({'where':_0xf7f0ce[_0x03e4('0x3e')]})[_0x03e4('0x27')](function(_0x5d39d4){_0x4c1f47[_0x03e4('0x1f')]=_0x5d39d4;if(_0x328061[_0x03e4('0x34')]['includeAll']){_0xf7f0ce['include']=[{'all':!![]}];}return db[_0x03e4('0x62')][_0x03e4('0x63')](_0xf7f0ce);})[_0x03e4('0x27')](function(_0x336520){_0x4c1f47[_0x03e4('0x46')]=_0x336520;return _0x4c1f47;});}})[_0x03e4('0x27')](respondWithFilteredResult(_0xa279f4,_0xf7f0ce))[_0x03e4('0x47')](handleError(_0xa279f4,null));};exports[_0x03e4('0x64')]=function(_0x3b8945,_0x3a7736,_0x453b33){var _0x13aa54={};var _0x205492={};var _0x284c2a;var _0x27316d;return db[_0x03e4('0x2e')][_0x03e4('0x59')]({'where':{'id':_0x3b8945[_0x03e4('0x49')]['id']}})[_0x03e4('0x27')](handleEntityNotFound(_0x3a7736,null))[_0x03e4('0x27')](function(_0x425701){if(_0x425701){_0x284c2a=_0x425701;_0x205492[_0x03e4('0x33')]=_[_0x03e4('0x35')](db[_0x03e4('0x65')][_0x03e4('0x2f')]);_0x205492[_0x03e4('0x34')]=_[_0x03e4('0x35')](_0x3b8945[_0x03e4('0x34')]);_0x205492[_0x03e4('0x3f')]=_['intersection'](_0x205492['model'],_0x205492[_0x03e4('0x34')]);_0x13aa54['attributes']=_[_0x03e4('0x36')](_0x205492[_0x03e4('0x33')],qs[_0x03e4('0x37')](_0x3b8945['query']['fields']));_0x13aa54[_0x03e4('0x38')]=_0x13aa54[_0x03e4('0x38')]['length']?_0x13aa54['attributes']:_0x205492[_0x03e4('0x33')];_0x13aa54[_0x03e4('0x3c')]=qs['sort'](_0x3b8945[_0x03e4('0x34')][_0x03e4('0x3d')]);_0x13aa54[_0x03e4('0x3e')]=qs['filters'](_['pick'](_0x3b8945['query'],_0x205492[_0x03e4('0x3f')]));if(_0x3b8945[_0x03e4('0x34')][_0x03e4('0x42')]){_0x13aa54['where']=_[_0x03e4('0x40')](_0x13aa54['where'],{'$or':_[_0x03e4('0x2d')](_0x13aa54[_0x03e4('0x38')],function(_0x79a864){var _0x4444fe={};_0x4444fe[_0x79a864]={'$like':'%'+_0x3b8945[_0x03e4('0x34')][_0x03e4('0x42')]+'%'};return _0x4444fe;})});}_0x13aa54=_[_0x03e4('0x40')]({},_0x13aa54,_0x3b8945[_0x03e4('0x43')]);return _0x284c2a[_0x03e4('0x64')](_0x13aa54);}})['then'](function(_0x141014){if(_0x141014){_0x27316d=_0x141014[_0x03e4('0x39')];if(!_0x3b8945[_0x03e4('0x34')]['hasOwnProperty'](_0x03e4('0x3b'))){_0x13aa54[_0x03e4('0x1e')]=qs[_0x03e4('0x1e')](_0x3b8945[_0x03e4('0x34')][_0x03e4('0x1e')]);_0x13aa54[_0x03e4('0x1c')]=qs['offset'](_0x3b8945[_0x03e4('0x34')][_0x03e4('0x1c')]);}return _0x284c2a[_0x03e4('0x64')](_0x13aa54);}})['then'](function(_0x4ebc6a){if(_0x4ebc6a){return _0x4ebc6a?{'count':_0x27316d,'rows':_0x4ebc6a}:null;}})[_0x03e4('0x27')](respondWithResult(_0x3a7736,null))[_0x03e4('0x47')](handleError(_0x3a7736,null));};exports[_0x03e4('0x66')]=function(_0x537596,_0x36a380,_0x3dbebe){var _0x68b374,_0x4fd128;var _0x111efb=[];var _0x1d8d44=moment()[_0x03e4('0x67')](_0x03e4('0x68'));return db['Campaign'][_0x03e4('0x4a')]({'where':{'id':_0x537596[_0x03e4('0x49')]['id']}})[_0x03e4('0x27')](handleEntityNotFound(_0x36a380,null))[_0x03e4('0x27')](function(_0x369011){if(_0x369011){_0x4fd128=_0x369011;return _0x369011[_0x03e4('0x66')](_0x537596['body'][_0x03e4('0x69')],_[_0x03e4('0x54')](_0x537596['body'],[_0x03e4('0x69'),'id'])||{});}return null;})[_0x03e4('0x6a')](function(_0x56c5cd){var _0x39faba;var _0x1728a2;_0x68b374=_0x56c5cd||[];var _0x31b148=[];if(_0x56c5cd){for(var _0x5c1dbd=0x0;_0x5c1dbd<_0x56c5cd['length'];_0x5c1dbd+=0x1){var _0x5d95c6=_0x56c5cd[_0x5c1dbd][_0x03e4('0x28')]({'plain':!![]});_0x4fd128[_0x03e4('0x6b')]=_0x537596[_0x03e4('0x4c')][_0x03e4('0x6b')]?_0x537596[_0x03e4('0x4c')][_0x03e4('0x6b')]:_0x4fd128[_0x03e4('0x6b')];switch(_0x4fd128[_0x03e4('0x6b')]){case _0x03e4('0x6c'):_0x39faba=squel[_0x03e4('0x6d')]()[_0x03e4('0x6e')](_0x03e4('0x6f'))['fromQuery'](['phone',_0x03e4('0x70'),_0x03e4('0x71'),_0x03e4('0x72'),_0x03e4('0x5b'),_0x03e4('0x55'),_0x03e4('0x56')],squel['select']()[_0x03e4('0x73')](_0x03e4('0x74'),_0x03e4('0x74'))[_0x03e4('0x73')](_0x03e4('0x75'),_0x03e4('0x70'))[_0x03e4('0x73')]('id',_0x03e4('0x71'))['field'](_0x5d95c6[_0x03e4('0x76')]['toString'](),_0x03e4('0x72'))[_0x03e4('0x73')](_0x537596[_0x03e4('0x49')]['id']['toString'](),'CampaignId')[_0x03e4('0x73')]('\x27'+_0x1d8d44+'\x27',_0x03e4('0x55'))[_0x03e4('0x73')]('\x27'+_0x1d8d44+'\x27','updatedAt')[_0x03e4('0x77')](_0x03e4('0x78'))[_0x03e4('0x3e')](_0x03e4('0x79'))[_0x03e4('0x3e')](_0x03e4('0x7a'),_0x5d95c6[_0x03e4('0x76')][_0x03e4('0x7b')]())[_0x03e4('0x3e')](_0x03e4('0x7c'))[_0x03e4('0x3e')](_0x03e4('0x7d'),squel[_0x03e4('0x7e')]()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0x03e4('0x7f'))[_0x03e4('0x3e')](_0x03e4('0x80'),_0x537596['params']['id'][_0x03e4('0x7b')]()))[_0x03e4('0x3e')](_0x03e4('0x7d'),squel[_0x03e4('0x7e')]()[_0x03e4('0x73')](_0x03e4('0x81'))[_0x03e4('0x77')](_0x03e4('0x6f'))[_0x03e4('0x3e')](_0x03e4('0x80'),_0x537596[_0x03e4('0x49')]['id'][_0x03e4('0x7b')]())))[_0x03e4('0x7b')]();break;case _0x03e4('0x82'):_0x39faba=squel[_0x03e4('0x6d')]()[_0x03e4('0x6e')]('cm_hopper')[_0x03e4('0x83')]([_0x03e4('0x74'),_0x03e4('0x70'),_0x03e4('0x71'),_0x03e4('0x72'),_0x03e4('0x5b'),_0x03e4('0x55'),_0x03e4('0x56')],squel[_0x03e4('0x7e')]()[_0x03e4('0x73')](_0x03e4('0x74'),_0x03e4('0x74'))[_0x03e4('0x73')](_0x03e4('0x75'),_0x03e4('0x70'))[_0x03e4('0x73')]('id',_0x03e4('0x71'))[_0x03e4('0x73')](_0x5d95c6[_0x03e4('0x76')][_0x03e4('0x7b')](),_0x03e4('0x72'))[_0x03e4('0x73')](_0x537596[_0x03e4('0x49')]['id']['toString'](),_0x03e4('0x5b'))[_0x03e4('0x73')]('\x27'+_0x1d8d44+'\x27',_0x03e4('0x55'))[_0x03e4('0x73')]('\x27'+_0x1d8d44+'\x27',_0x03e4('0x56'))[_0x03e4('0x77')](_0x03e4('0x78'))['where'](_0x03e4('0x79'))['where'](_0x03e4('0x7a'),_0x5d95c6[_0x03e4('0x76')][_0x03e4('0x7b')]())[_0x03e4('0x3e')](_0x03e4('0x7c'))[_0x03e4('0x3e')](_0x03e4('0x7d'),squel[_0x03e4('0x7e')]()[_0x03e4('0x73')]('COALESCE(phone,\x27\x27)')[_0x03e4('0x77')]('cm_hopper')[_0x03e4('0x3e')](_0x03e4('0x80'),_0x537596[_0x03e4('0x49')]['id']['toString']())))[_0x03e4('0x7b')]();break;default:_0x39faba=squel[_0x03e4('0x6d')]()[_0x03e4('0x6e')](_0x03e4('0x6f'))[_0x03e4('0x83')](['phone','scheduledAt',_0x03e4('0x71'),_0x03e4('0x72'),_0x03e4('0x5b'),'createdAt',_0x03e4('0x56')],squel['select']()[_0x03e4('0x73')](_0x03e4('0x74'),_0x03e4('0x74'))['field'](_0x03e4('0x75'),'scheduledAt')[_0x03e4('0x73')]('id',_0x03e4('0x71'))[_0x03e4('0x73')](_0x5d95c6[_0x03e4('0x76')][_0x03e4('0x7b')](),_0x03e4('0x72'))['field'](_0x537596['params']['id'][_0x03e4('0x7b')](),_0x03e4('0x5b'))['field']('\x27'+_0x1d8d44+'\x27',_0x03e4('0x55'))['field']('\x27'+_0x1d8d44+'\x27',_0x03e4('0x56'))[_0x03e4('0x77')]('cm_contacts')['where'](_0x03e4('0x79'))[_0x03e4('0x3e')](_0x03e4('0x7a'),_0x5d95c6[_0x03e4('0x76')][_0x03e4('0x7b')]())[_0x03e4('0x3e')](_0x03e4('0x7c')))['toString']();}_0x1728a2=squel['insert']()[_0x03e4('0x6e')](_0x03e4('0x84'))['fromQuery'](['cmHopperId',_0x03e4('0x70'),'phone',_0x03e4('0x85'),_0x03e4('0x55'),_0x03e4('0x56')],squel[_0x03e4('0x7e')]()[_0x03e4('0x73')](_0x03e4('0x86'),'id')[_0x03e4('0x73')](_0x03e4('0x75'),'scheduledAt')[_0x03e4('0x73')](_0x03e4('0x87'),_0x03e4('0x74'))[_0x03e4('0x73')](_0x03e4('0x88'),_0x03e4('0x85'))[_0x03e4('0x73')]('\x27'+_0x1d8d44+'\x27','createdAt')[_0x03e4('0x73')]('\x27'+_0x1d8d44+'\x27',_0x03e4('0x56'))[_0x03e4('0x77')](_0x03e4('0x89'),'ci')[_0x03e4('0x8a')](_0x03e4('0x6f'),'h',_0x03e4('0x8b'))[_0x03e4('0x3e')](_0x03e4('0x8c'),_0x5d95c6['CmListId'][_0x03e4('0x7b')]())[_0x03e4('0x3e')](_0x03e4('0x8d'),_0x537596[_0x03e4('0x49')]['id'][_0x03e4('0x7b')]())[_0x03e4('0x3e')](_0x03e4('0x8e'),_0x1d8d44))[_0x03e4('0x7b')]();_0x31b148['push'](db[_0x03e4('0x8f')][_0x03e4('0x34')](_0x39faba));_0x111efb[_0x03e4('0x90')](db[_0x03e4('0x8f')]['query'](_0x1728a2));}return BPromise['all'](_0x31b148);}})[_0x03e4('0x27')](function(){return BPromise[_0x03e4('0x91')](_0x111efb);})['then'](function(){return _0x68b374;})[_0x03e4('0x27')](respondWithResult(_0x36a380,null))[_0x03e4('0x47')](handleError(_0x36a380,null));};exports['removeLists']=function(_0x16e799,_0x259a72,_0x2b12c1){return db[_0x03e4('0x2e')][_0x03e4('0x4a')]({'where':{'id':_0x16e799[_0x03e4('0x49')]['id']}})[_0x03e4('0x27')](handleEntityNotFound(_0x259a72,null))[_0x03e4('0x27')](function(_0x18ea73){if(_0x18ea73){return _0x18ea73[_0x03e4('0x92')](_0x16e799[_0x03e4('0x34')][_0x03e4('0x69')]);}})['then'](function(_0x1bd386){if(_0x1bd386){return db[_0x03e4('0x5a')][_0x03e4('0x26')]({'where':{'ListId':_0x16e799[_0x03e4('0x34')]['ids'],'CampaignId':_0x16e799[_0x03e4('0x49')]['id']}})[_0x03e4('0x27')](function(){return _0x1bd386;});}})[_0x03e4('0x27')](respondWithStatusCode(_0x259a72,null))[_0x03e4('0x47')](handleError(_0x259a72,null));};exports[_0x03e4('0x93')]=function(_0xe6b747,_0xa6eef4,_0x4d8899){var _0x592999={};var _0x1a89d6={};var _0x137d3a;var _0x55ea76;return db[_0x03e4('0x2e')][_0x03e4('0x59')]({'where':{'id':_0xe6b747[_0x03e4('0x49')]['id']}})[_0x03e4('0x27')](handleEntityNotFound(_0xa6eef4,null))[_0x03e4('0x27')](function(_0x2de76b){if(_0x2de76b){_0x137d3a=_0x2de76b;_0x1a89d6[_0x03e4('0x33')]=_['keys'](db[_0x03e4('0x65')][_0x03e4('0x2f')]);_0x1a89d6[_0x03e4('0x34')]=_[_0x03e4('0x35')](_0xe6b747[_0x03e4('0x34')]);_0x1a89d6[_0x03e4('0x3f')]=_[_0x03e4('0x36')](_0x1a89d6[_0x03e4('0x33')],_0x1a89d6[_0x03e4('0x34')]);_0x592999[_0x03e4('0x38')]=_[_0x03e4('0x36')](_0x1a89d6[_0x03e4('0x33')],qs[_0x03e4('0x37')](_0xe6b747[_0x03e4('0x34')][_0x03e4('0x37')]));_0x592999[_0x03e4('0x38')]=_0x592999[_0x03e4('0x38')][_0x03e4('0x39')]?_0x592999[_0x03e4('0x38')]:_0x1a89d6[_0x03e4('0x33')];_0x592999[_0x03e4('0x3c')]=qs[_0x03e4('0x3d')](_0xe6b747[_0x03e4('0x34')][_0x03e4('0x3d')]);_0x592999[_0x03e4('0x3e')]=qs[_0x03e4('0x3f')](_[_0x03e4('0x5e')](_0xe6b747[_0x03e4('0x34')],_0x1a89d6[_0x03e4('0x3f')]));if(_0xe6b747[_0x03e4('0x34')][_0x03e4('0x42')]){_0x592999[_0x03e4('0x3e')]=_['merge'](_0x592999[_0x03e4('0x3e')],{'$or':_[_0x03e4('0x2d')](_0x592999['attributes'],function(_0x3320a6){var _0x4b8ca6={};_0x4b8ca6[_0x3320a6]={'$like':'%'+_0xe6b747[_0x03e4('0x34')][_0x03e4('0x42')]+'%'};return _0x4b8ca6;})});}_0x592999=_[_0x03e4('0x40')]({},_0x592999,_0xe6b747['options']);return _0x137d3a[_0x03e4('0x93')](_0x592999);}})[_0x03e4('0x27')](function(_0x4f8350){if(_0x4f8350){_0x55ea76=_0x4f8350[_0x03e4('0x39')];if(!_0xe6b747[_0x03e4('0x34')][_0x03e4('0x3a')](_0x03e4('0x3b'))){_0x592999[_0x03e4('0x1e')]=qs['limit'](_0xe6b747[_0x03e4('0x34')][_0x03e4('0x1e')]);_0x592999[_0x03e4('0x1c')]=qs[_0x03e4('0x1c')](_0xe6b747['query'][_0x03e4('0x1c')]);}return _0x137d3a[_0x03e4('0x93')](_0x592999);}})[_0x03e4('0x27')](function(_0x324ea0){if(_0x324ea0){return _0x324ea0?{'count':_0x55ea76,'rows':_0x324ea0}:null;}})[_0x03e4('0x27')](respondWithResult(_0xa6eef4,null))[_0x03e4('0x47')](handleError(_0xa6eef4,null));};exports[_0x03e4('0x94')]=function(_0x428992,_0x897f35,_0x24fff5){var _0x587dbf,_0x645fa2;var _0x4c978f=[];var _0x25b7f4=moment()[_0x03e4('0x67')](_0x03e4('0x68'));return db[_0x03e4('0x2e')][_0x03e4('0x4a')]({'where':{'id':_0x428992['params']['id']}})[_0x03e4('0x27')](handleEntityNotFound(_0x897f35,null))[_0x03e4('0x27')](function(_0x13d75a){if(_0x13d75a){_0x645fa2=_0x13d75a;return _0x13d75a[_0x03e4('0x94')](_0x428992[_0x03e4('0x4c')][_0x03e4('0x69')],_[_0x03e4('0x54')](_0x428992['body'],['ids','id'])||{});}return null;})[_0x03e4('0x6a')](function(_0x482341){var _0x133616;var _0x271c40;_0x587dbf=_0x482341||[];var _0x5186e0=[];if(_0x482341){for(var _0x53713d=0x0;_0x53713d<_0x482341['length'];_0x53713d+=0x1){var _0x5e619f=_0x482341[_0x53713d][_0x03e4('0x28')]({'plain':!![]});_0x133616=squel['insert']()['into'](_0x03e4('0x95'))[_0x03e4('0x83')]([_0x03e4('0x74'),_0x03e4('0x71'),'ListId',_0x03e4('0x5b'),'createdAt',_0x03e4('0x56')],squel[_0x03e4('0x7e')]()[_0x03e4('0x73')](_0x03e4('0x74'),'phone')[_0x03e4('0x73')]('id',_0x03e4('0x71'))[_0x03e4('0x73')](_0x5e619f[_0x03e4('0x76')][_0x03e4('0x7b')](),'ListId')['field'](_0x428992[_0x03e4('0x49')]['id'][_0x03e4('0x7b')](),'CampaignId')[_0x03e4('0x73')](_0x03e4('0x75'),'createdAt')[_0x03e4('0x73')](_0x03e4('0x75'),_0x03e4('0x56'))[_0x03e4('0x77')](_0x03e4('0x78'))[_0x03e4('0x3e')](_0x03e4('0x79'))['where'](_0x03e4('0x7a'),_0x5e619f['CmListId'][_0x03e4('0x7b')]())[_0x03e4('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0x03e4('0x7b')]();_0x5186e0[_0x03e4('0x90')](db['sequelize'][_0x03e4('0x34')](_0x133616));}return BPromise[_0x03e4('0x91')](_0x5186e0);}})[_0x03e4('0x27')](function(){return _0x587dbf;})[_0x03e4('0x27')](respondWithResult(_0x897f35,null))[_0x03e4('0x47')](handleError(_0x897f35,null));};exports[_0x03e4('0x96')]=function(_0x4b5ddd,_0x2358ed,_0x2b94ec){return db[_0x03e4('0x2e')][_0x03e4('0x4a')]({'where':{'id':_0x4b5ddd[_0x03e4('0x49')]['id']}})['then'](handleEntityNotFound(_0x2358ed,null))['then'](function(_0x161a75){if(_0x161a75){return _0x161a75[_0x03e4('0x96')](_0x4b5ddd[_0x03e4('0x34')][_0x03e4('0x69')]);}})[_0x03e4('0x27')](function(_0x2d1ad9){if(_0x2d1ad9){return db[_0x03e4('0x62')][_0x03e4('0x26')]({'where':{'ListId':_0x4b5ddd[_0x03e4('0x34')][_0x03e4('0x69')],'CampaignId':_0x4b5ddd[_0x03e4('0x49')]['id']}})[_0x03e4('0x27')](function(){return _0x2d1ad9;});}})[_0x03e4('0x27')](respondWithStatusCode(_0x2358ed,null))[_0x03e4('0x47')](handleError(_0x2358ed,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 46dfef5..9b1c805 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(_0x2eec7e,_0x8c4a6a){var _0x266083=function(_0x372bc7){while(--_0x372bc7){_0x2eec7e['push'](_0x2eec7e['shift']());}};_0x266083(++_0x8c4a6a);}(_0x7a54,0x106));var _0x47a5=function(_0x441569,_0x39d4d7){_0x441569=_0x441569-0x0;var _0x35d2db=_0x7a54[_0x441569];return _0x35d2db;};'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(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 3f07f1c..6fc96b9 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 _0x63eb=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','catch','GetCampaign','findAll','raw','options','where','attributes','limit','include','model','map'];(function(_0x4d9225,_0x923a5b){var _0x234ebb=function(_0x35e1ce){while(--_0x35e1ce){_0x4d9225['push'](_0x4d9225['shift']());}};_0x234ebb(++_0x923a5b);}(_0x63eb,0x90));var _0xb63e=function(_0x40622e,_0x1d071b){_0x40622e=_0x40622e-0x0;var _0x1a0072=_0x63eb[_0x40622e];return _0x1a0072;};'use strict';var _=require(_0xb63e('0x0'));var util=require(_0xb63e('0x1'));var moment=require(_0xb63e('0x2'));var BPromise=require(_0xb63e('0x3'));var rs=require(_0xb63e('0x4'));var fs=require('fs');var Redis=require(_0xb63e('0x5'));var db=require(_0xb63e('0x6'))['db'];var utils=require(_0xb63e('0x7'));var logger=require(_0xb63e('0x8'))(_0xb63e('0x9'));var config=require(_0xb63e('0xa'));var jayson=require(_0xb63e('0xb'));var client=jayson[_0xb63e('0xc')][_0xb63e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x456ca3,_0xeb9650,_0x2f1729){return new BPromise(function(_0xe4f423,_0x199b7b){return client[_0xb63e('0xe')](_0x456ca3,_0x2f1729)[_0xb63e('0xf')](function(_0x4c22a2){logger[_0xb63e('0x10')]('Campaign,\x20%s,\x20%s',_0xeb9650,_0xb63e('0x11'));logger[_0xb63e('0x12')](_0xb63e('0x13'),_0xeb9650,'request\x20sent',JSON[_0xb63e('0x14')](_0x4c22a2));if(_0x4c22a2[_0xb63e('0x15')]){if(_0x4c22a2[_0xb63e('0x15')][_0xb63e('0x16')]===0x1f4){logger['error'](_0xb63e('0x17'),_0xeb9650,_0x4c22a2[_0xb63e('0x15')][_0xb63e('0x18')]);return _0x199b7b(_0x4c22a2['error'][_0xb63e('0x18')]);}logger[_0xb63e('0x15')](_0xb63e('0x17'),_0xeb9650,_0x4c22a2[_0xb63e('0x15')]['message']);return _0xe4f423(_0x4c22a2[_0xb63e('0x15')][_0xb63e('0x18')]);}else{logger[_0xb63e('0x10')](_0xb63e('0x17'),_0xeb9650,_0xb63e('0x11'));_0xe4f423(_0x4c22a2['result'][_0xb63e('0x18')]);}})[_0xb63e('0x19')](function(_0x2221d9){logger[_0xb63e('0x15')](_0xb63e('0x17'),_0xeb9650,_0x2221d9);_0x199b7b(_0x2221d9);});});}exports[_0xb63e('0x1a')]=function(_0x4a1385){var _0x11363d=this;return new Promise(function(_0x1673d5,_0x4713dd){return db['Campaign'][_0xb63e('0x1b')]({'raw':_0x4a1385['options']?_0x4a1385['options'][_0xb63e('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a1385['options']?_0x4a1385[_0xb63e('0x1d')][_0xb63e('0x1e')]||null:null,'attributes':_0x4a1385[_0xb63e('0x1d')]?_0x4a1385['options'][_0xb63e('0x1f')]||null:null,'limit':_0x4a1385[_0xb63e('0x1d')]?_0x4a1385[_0xb63e('0x1d')][_0xb63e('0x20')]||null:null,'include':_0x4a1385[_0xb63e('0x1d')]?_0x4a1385['options'][_0xb63e('0x21')]?_['map'](_0x4a1385['options'][_0xb63e('0x21')],function(_0x3b4483){return{'model':db[_0x3b4483[_0xb63e('0x22')]],'as':_0x3b4483['as'],'attributes':_0x3b4483[_0xb63e('0x1f')],'include':_0x3b4483['include']?_[_0xb63e('0x23')](_0x3b4483['include'],function(_0x5abd5a){return{'model':db[_0x5abd5a[_0xb63e('0x22')]],'as':_0x5abd5a['as'],'attributes':_0x5abd5a['attributes'],'include':_0x5abd5a[_0xb63e('0x21')]?_[_0xb63e('0x23')](_0x5abd5a['include'],function(_0x2df49d){return{'model':db[_0x2df49d[_0xb63e('0x22')]],'as':_0x2df49d['as'],'attributes':_0x2df49d[_0xb63e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb63e('0xf')](function(_0x493f9e){logger['info'](_0xb63e('0x1a'),_0x4a1385);logger['debug'](_0xb63e('0x1a'),_0x4a1385,JSON[_0xb63e('0x14')](_0x493f9e));_0x1673d5(_0x493f9e);})['catch'](function(_0x46cc15){logger[_0xb63e('0x15')]('GetCampaign',_0x46cc15[_0xb63e('0x18')],_0x4a1385);_0x4713dd(_0x11363d[_0xb63e('0x15')](0x1f4,_0x46cc15[_0xb63e('0x18')]));});});}; \ No newline at end of file +var _0xee24=['info','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','include','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message'];(function(_0x21c7e,_0x3f1f10){var _0x3eedf3=function(_0x586d49){while(--_0x586d49){_0x21c7e['push'](_0x21c7e['shift']());}};_0x3eedf3(++_0x3f1f10);}(_0xee24,0x1a6));var _0x4ee2=function(_0x5ea952,_0xc78c71){_0x5ea952=_0x5ea952-0x0;var _0x45d14e=_0xee24[_0x5ea952];return _0x45d14e;};'use strict';var _=require('lodash');var util=require(_0x4ee2('0x0'));var moment=require(_0x4ee2('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ee2('0x2'));var fs=require('fs');var Redis=require(_0x4ee2('0x3'));var db=require(_0x4ee2('0x4'))['db'];var utils=require(_0x4ee2('0x5'));var logger=require('../../config/logger')(_0x4ee2('0x6'));var config=require(_0x4ee2('0x7'));var jayson=require(_0x4ee2('0x8'));var client=jayson[_0x4ee2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e6e11,_0x319d9d,_0xe966eb){return new BPromise(function(_0x9a963c,_0x8d7266){return client[_0x4ee2('0xa')](_0x2e6e11,_0xe966eb)[_0x4ee2('0xb')](function(_0x3b6028){logger['info']('Campaign,\x20%s,\x20%s',_0x319d9d,_0x4ee2('0xc'));logger[_0x4ee2('0xd')](_0x4ee2('0xe'),_0x319d9d,_0x4ee2('0xc'),JSON[_0x4ee2('0xf')](_0x3b6028));if(_0x3b6028['error']){if(_0x3b6028[_0x4ee2('0x10')][_0x4ee2('0x11')]===0x1f4){logger[_0x4ee2('0x10')](_0x4ee2('0x12'),_0x319d9d,_0x3b6028['error'][_0x4ee2('0x13')]);return _0x8d7266(_0x3b6028[_0x4ee2('0x10')][_0x4ee2('0x13')]);}logger[_0x4ee2('0x10')]('Campaign,\x20%s,\x20%s',_0x319d9d,_0x3b6028['error'][_0x4ee2('0x13')]);return _0x9a963c(_0x3b6028[_0x4ee2('0x10')]['message']);}else{logger[_0x4ee2('0x14')](_0x4ee2('0x12'),_0x319d9d,_0x4ee2('0xc'));_0x9a963c(_0x3b6028[_0x4ee2('0x15')][_0x4ee2('0x13')]);}})[_0x4ee2('0x16')](function(_0x5e19f8){logger[_0x4ee2('0x10')](_0x4ee2('0x12'),_0x319d9d,_0x5e19f8);_0x8d7266(_0x5e19f8);});});}exports[_0x4ee2('0x17')]=function(_0x4aba2b){var _0x23df00=this;return new Promise(function(_0xb8e027,_0x3ba412){return db[_0x4ee2('0x18')][_0x4ee2('0x19')]({'raw':_0x4aba2b[_0x4ee2('0x1a')]?_0x4aba2b[_0x4ee2('0x1a')][_0x4ee2('0x1b')]===undefined?!![]:![]:!![],'where':_0x4aba2b['options']?_0x4aba2b['options'][_0x4ee2('0x1c')]||null:null,'attributes':_0x4aba2b['options']?_0x4aba2b[_0x4ee2('0x1a')][_0x4ee2('0x1d')]||null:null,'limit':_0x4aba2b[_0x4ee2('0x1a')]?_0x4aba2b[_0x4ee2('0x1a')][_0x4ee2('0x1e')]||null:null,'include':_0x4aba2b['options']?_0x4aba2b[_0x4ee2('0x1a')]['include']?_[_0x4ee2('0x1f')](_0x4aba2b[_0x4ee2('0x1a')][_0x4ee2('0x20')],function(_0x1f4f90){return{'model':db[_0x1f4f90[_0x4ee2('0x21')]],'as':_0x1f4f90['as'],'attributes':_0x1f4f90[_0x4ee2('0x1d')],'include':_0x1f4f90[_0x4ee2('0x20')]?_['map'](_0x1f4f90[_0x4ee2('0x20')],function(_0x5127b8){return{'model':db[_0x5127b8['model']],'as':_0x5127b8['as'],'attributes':_0x5127b8[_0x4ee2('0x1d')],'include':_0x5127b8[_0x4ee2('0x20')]?_[_0x4ee2('0x1f')](_0x5127b8[_0x4ee2('0x20')],function(_0x17119){return{'model':db[_0x17119['model']],'as':_0x17119['as'],'attributes':_0x17119['attributes']};}):[]};}):[]};}):[]:[]})[_0x4ee2('0xb')](function(_0x2a078f){logger['info'](_0x4ee2('0x17'),_0x4aba2b);logger['debug']('GetCampaign',_0x4aba2b,JSON['stringify'](_0x2a078f));_0xb8e027(_0x2a078f);})[_0x4ee2('0x16')](function(_0x970fa6){logger['error'](_0x4ee2('0x17'),_0x970fa6[_0x4ee2('0x13')],_0x4aba2b);_0x3ba412(_0x23df00['error'](0x1f4,_0x970fa6[_0x4ee2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 4e85da8..3611026 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 _0x2c46=['destroy','removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','post','clone','/:id/lists','addLists','addBlackLists','put','update','delete'];(function(_0x86f30d,_0x4097ee){var _0x40fa40=function(_0x3afed2){while(--_0x3afed2){_0x86f30d['push'](_0x86f30d['shift']());}};_0x40fa40(++_0x4097ee);}(_0x2c46,0x6f));var _0x62c4=function(_0x535c32,_0x1474c8){_0x535c32=_0x535c32-0x0;var _0x478b3b=_0x2c46[_0x535c32];return _0x478b3b;};'use strict';var multer=require('multer');var util=require(_0x62c4('0x0'));var path=require(_0x62c4('0x1'));var timeout=require(_0x62c4('0x2'));var express=require(_0x62c4('0x3'));var router=express[_0x62c4('0x4')]();var fs_extra=require(_0x62c4('0x5'));var auth=require(_0x62c4('0x6'));var interaction=require(_0x62c4('0x7'));var config=require(_0x62c4('0x8'));var controller=require(_0x62c4('0x9'));router[_0x62c4('0xa')]('/',auth[_0x62c4('0xb')](),controller[_0x62c4('0xc')]);router[_0x62c4('0xa')](_0x62c4('0xd'),auth[_0x62c4('0xb')](),controller[_0x62c4('0xe')]);router['get'](_0x62c4('0xf'),auth['isAuthenticated'](),controller[_0x62c4('0x10')]);router['get'](_0x62c4('0x11'),auth[_0x62c4('0xb')](),controller[_0x62c4('0x12')]);router[_0x62c4('0xa')](_0x62c4('0x13'),auth[_0x62c4('0xb')](),controller[_0x62c4('0x14')]);router[_0x62c4('0xa')](_0x62c4('0x15'),auth[_0x62c4('0xb')](),controller[_0x62c4('0x16')]);router[_0x62c4('0xa')]('/:id/lists',auth['isAuthenticated'](),controller[_0x62c4('0x17')]);router[_0x62c4('0xa')](_0x62c4('0x18'),auth[_0x62c4('0xb')](),controller['getBlackLists']);router[_0x62c4('0x19')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x62c4('0x1a')]);router[_0x62c4('0x19')](_0x62c4('0x1b'),auth[_0x62c4('0xb')](),controller[_0x62c4('0x1c')]);router[_0x62c4('0x19')](_0x62c4('0x18'),auth[_0x62c4('0xb')](),controller[_0x62c4('0x1d')]);router[_0x62c4('0x1e')](_0x62c4('0xd'),auth[_0x62c4('0xb')](),controller[_0x62c4('0x1f')]);router[_0x62c4('0x20')](_0x62c4('0xd'),auth[_0x62c4('0xb')](),controller[_0x62c4('0x21')]);router[_0x62c4('0x20')]('/:id/lists',auth[_0x62c4('0xb')](),controller['removeLists']);router[_0x62c4('0x20')](_0x62c4('0x18'),auth[_0x62c4('0xb')](),controller[_0x62c4('0x22')]);module[_0x62c4('0x23')]=router; \ No newline at end of file +var _0xe284=['/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','update','delete','destroy','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black'];(function(_0x5419ad,_0x484ae6){var _0x456a4b=function(_0x52b4ba){while(--_0x52b4ba){_0x5419ad['push'](_0x5419ad['shift']());}};_0x456a4b(++_0x484ae6);}(_0xe284,0x1c8));var _0x4e28=function(_0x331298,_0x12341a){_0x331298=_0x331298-0x0;var _0x3824bc=_0xe284[_0x331298];return _0x3824bc;};'use strict';var multer=require(_0x4e28('0x0'));var util=require(_0x4e28('0x1'));var path=require(_0x4e28('0x2'));var timeout=require(_0x4e28('0x3'));var express=require(_0x4e28('0x4'));var router=express[_0x4e28('0x5')]();var fs_extra=require(_0x4e28('0x6'));var auth=require(_0x4e28('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4e28('0x8'));var controller=require(_0x4e28('0x9'));router[_0x4e28('0xa')]('/',auth[_0x4e28('0xb')](),controller[_0x4e28('0xc')]);router[_0x4e28('0xa')](_0x4e28('0xd'),auth[_0x4e28('0xb')](),controller[_0x4e28('0xe')]);router[_0x4e28('0xa')]('/:id/hoppers',auth[_0x4e28('0xb')](),controller[_0x4e28('0xf')]);router[_0x4e28('0xa')]('/:id/hopper_histories',auth[_0x4e28('0xb')](),controller[_0x4e28('0x10')]);router[_0x4e28('0xa')](_0x4e28('0x11'),auth[_0x4e28('0xb')](),controller[_0x4e28('0x12')]);router[_0x4e28('0xa')](_0x4e28('0x13'),auth[_0x4e28('0xb')](),controller['getHopperBlacks']);router[_0x4e28('0xa')](_0x4e28('0x14'),auth[_0x4e28('0xb')](),controller[_0x4e28('0x15')]);router[_0x4e28('0xa')](_0x4e28('0x16'),auth[_0x4e28('0xb')](),controller[_0x4e28('0x17')]);router[_0x4e28('0x18')]('/',auth[_0x4e28('0xb')](),controller[_0x4e28('0x19')]);router[_0x4e28('0x18')](_0x4e28('0x1a'),auth[_0x4e28('0xb')](),controller['clone']);router[_0x4e28('0x18')](_0x4e28('0x14'),auth[_0x4e28('0xb')](),controller[_0x4e28('0x1b')]);router[_0x4e28('0x18')](_0x4e28('0x16'),auth['isAuthenticated'](),controller[_0x4e28('0x1c')]);router['put'](_0x4e28('0xd'),auth['isAuthenticated'](),controller[_0x4e28('0x1d')]);router[_0x4e28('0x1e')](_0x4e28('0xd'),auth[_0x4e28('0xb')](),controller[_0x4e28('0x1f')]);router[_0x4e28('0x1e')](_0x4e28('0x14'),auth['isAuthenticated'](),controller[_0x4e28('0x20')]);router['delete'](_0x4e28('0x16'),auth[_0x4e28('0xb')](),controller['removeBlackLists']);module[_0x4e28('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 8919c26..d18eea6 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 _0xcd0e=['STRING','VIRTUAL','getDataValue','key','sequelize','exports','TEXT'];(function(_0x187aa5,_0x24d071){var _0x32ec1a=function(_0x3129d7){while(--_0x3129d7){_0x187aa5['push'](_0x187aa5['shift']());}};_0x32ec1a(++_0x24d071);}(_0xcd0e,0x13f));var _0xecd0=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0xcd0e[_0x4bb581];return _0x316bf5;};'use strict';var Sequelize=require(_0xecd0('0x0'));module[_0xecd0('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xecd0('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xecd0('0x3')]},'name':{'type':Sequelize[_0xecd0('0x4')],'get':function(){return this[_0xecd0('0x5')](_0xecd0('0x6'));}}}; \ No newline at end of file +var _0x1ed0=['exports','STRING','VIRTUAL','getDataValue','sequelize'];(function(_0x4ebabc,_0x172a8c){var _0x3fbb0e=function(_0x1274fa){while(--_0x1274fa){_0x4ebabc['push'](_0x4ebabc['shift']());}};_0x3fbb0e(++_0x172a8c);}(_0x1ed0,0x72));var _0x01ed=function(_0x5e848d,_0x1dbd20){_0x5e848d=_0x5e848d-0x0;var _0x3785e5=_0x1ed0[_0x5e848d];return _0x3785e5;};'use strict';var Sequelize=require(_0x01ed('0x0'));module[_0x01ed('0x1')]={'key':{'type':Sequelize[_0x01ed('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x01ed('0x2')]},'name':{'type':Sequelize[_0x01ed('0x3')],'get':function(){return this[_0x01ed('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 24784a3..2843115 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 _0xb4b7=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','name','send','CannedAnswer','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','rawAttributes','include','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','role','user','autoAssociation','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xb4b7,0xa4));var _0x7b4b=function(_0x1f22d2,_0x53380b){_0x1f22d2=_0x1f22d2-0x0;var _0x472af7=_0xb4b7[_0x1f22d2];return _0x472af7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7b4b('0x0'));var jsonpatch=require(_0x7b4b('0x1'));var rp=require(_0x7b4b('0x2'));var moment=require(_0x7b4b('0x3'));var BPromise=require(_0x7b4b('0x4'));var Mustache=require(_0x7b4b('0x5'));var util=require(_0x7b4b('0x6'));var path=require(_0x7b4b('0x7'));var sox=require(_0x7b4b('0x8'));var csv=require(_0x7b4b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b4b('0xa'));var _=require(_0x7b4b('0xb'));var squel=require(_0x7b4b('0xc'));var crypto=require(_0x7b4b('0xd'));var jsforce=require(_0x7b4b('0xe'));var deskjs=require(_0x7b4b('0xf'));var toCsv=require(_0x7b4b('0x9'));var querystring=require(_0x7b4b('0x10'));var Papa=require(_0x7b4b('0x11'));var Redis=require(_0x7b4b('0x12'));var authService=require(_0x7b4b('0x13'));var qs=require(_0x7b4b('0x14'));var as=require(_0x7b4b('0x15'));var hardwareService=require(_0x7b4b('0x16'));var logger=require('../../config/logger')(_0x7b4b('0x17'));var utils=require(_0x7b4b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7b4b('0x19'));var db=require(_0x7b4b('0x1a'))['db'];function respondWithStatusCode(_0x3d86a1,_0x9b930b){_0x9b930b=_0x9b930b||0xcc;return function(_0x1352f1){if(_0x1352f1){return _0x3d86a1['sendStatus'](_0x9b930b);}return _0x3d86a1[_0x7b4b('0x1b')](_0x9b930b)[_0x7b4b('0x1c')]();};}function respondWithResult(_0x5d403a,_0x2bd6fe){_0x2bd6fe=_0x2bd6fe||0xc8;return function(_0x26c994){if(_0x26c994){return _0x5d403a['status'](_0x2bd6fe)[_0x7b4b('0x1d')](_0x26c994);}};}function respondWithFilteredResult(_0x12fc19,_0x7da94a){return function(_0x2234e6){if(_0x2234e6){var _0x54fb4a=typeof _0x7da94a[_0x7b4b('0x1e')]===_0x7b4b('0x1f')&&typeof _0x7da94a[_0x7b4b('0x20')]===_0x7b4b('0x1f');var _0x5e844d=_0x2234e6[_0x7b4b('0x21')];var _0x412cbf=_0x54fb4a?0x0:_0x7da94a[_0x7b4b('0x1e')];var _0x149772=_0x54fb4a?_0x2234e6[_0x7b4b('0x21')]:_0x7da94a[_0x7b4b('0x1e')]+_0x7da94a[_0x7b4b('0x20')];var _0x325fee;if(_0x149772>=_0x5e844d){_0x149772=_0x5e844d;_0x325fee=0xc8;}else{_0x325fee=0xce;}_0x12fc19[_0x7b4b('0x1b')](_0x325fee);return _0x12fc19[_0x7b4b('0x22')]('Content-Range',_0x412cbf+'-'+_0x149772+'/'+_0x5e844d)[_0x7b4b('0x1d')](_0x2234e6);}return null;};}function patchUpdates(_0x19a2d4){return function(_0x14ecee){try{jsonpatch['apply'](_0x14ecee,_0x19a2d4,!![]);}catch(_0x5b144d){return BPromise[_0x7b4b('0x23')](_0x5b144d);}return _0x14ecee['save']();};}function saveUpdates(_0x351e71,_0x357a4d){return function(_0x42543b){if(_0x42543b){return _0x42543b[_0x7b4b('0x24')](_0x351e71)[_0x7b4b('0x25')](function(_0x4e4b7c){return _0x4e4b7c;});}return null;};}function removeEntity(_0x48a1c6,_0x5a28d0){return function(_0x573844){if(_0x573844){return _0x573844[_0x7b4b('0x26')]()['then'](function(){var _0x11aee7=_0x573844[_0x7b4b('0x27')]({'plain':!![]});var _0x591113=_0x7b4b('0x28');return db[_0x7b4b('0x29')][_0x7b4b('0x26')]({'where':{'type':_0x591113,'resourceId':_0x11aee7['id']}})[_0x7b4b('0x25')](function(){return _0x573844;});})['then'](function(){_0x48a1c6['status'](0xcc)[_0x7b4b('0x1c')]();});}};}function handleEntityNotFound(_0xee4a0a,_0x85d4b4){return function(_0x55c977){if(!_0x55c977){_0xee4a0a[_0x7b4b('0x2a')](0x194);}return _0x55c977;};}function handleError(_0x8ae7a7,_0xe206e4){_0xe206e4=_0xe206e4||0x1f4;return function(_0x45ad1d){logger[_0x7b4b('0x2b')](_0x45ad1d['stack']);if(_0x45ad1d[_0x7b4b('0x2c')]){delete _0x45ad1d[_0x7b4b('0x2c')];}_0x8ae7a7[_0x7b4b('0x1b')](_0xe206e4)[_0x7b4b('0x2d')](_0x45ad1d);};}exports['index']=function(_0x5bd577,_0x7c3156){var _0x3cba81={},_0x53bebe={},_0x223b76={'count':0x0,'rows':[]};var _0x294e41=_['map'](db[_0x7b4b('0x2e')]['rawAttributes'],function(_0x37aa84){return{'name':_0x37aa84[_0x7b4b('0x2f')],'type':_0x37aa84[_0x7b4b('0x30')][_0x7b4b('0x31')]};});_0x53bebe[_0x7b4b('0x32')]=_['map'](_0x294e41,_0x7b4b('0x2c'));_0x53bebe['query']=_[_0x7b4b('0x33')](_0x5bd577[_0x7b4b('0x34')]);_0x53bebe[_0x7b4b('0x35')]=_['intersection'](_0x53bebe[_0x7b4b('0x32')],_0x53bebe['query']);_0x3cba81[_0x7b4b('0x36')]=_[_0x7b4b('0x37')](_0x53bebe[_0x7b4b('0x32')],qs[_0x7b4b('0x38')](_0x5bd577[_0x7b4b('0x34')]['fields']));_0x3cba81[_0x7b4b('0x36')]=_0x3cba81[_0x7b4b('0x36')][_0x7b4b('0x39')]?_0x3cba81['attributes']:_0x53bebe[_0x7b4b('0x32')];if(!_0x5bd577[_0x7b4b('0x34')][_0x7b4b('0x3a')](_0x7b4b('0x3b'))){_0x3cba81[_0x7b4b('0x20')]=qs[_0x7b4b('0x20')](_0x5bd577[_0x7b4b('0x34')][_0x7b4b('0x20')]);_0x3cba81[_0x7b4b('0x1e')]=qs[_0x7b4b('0x1e')](_0x5bd577['query']['offset']);}_0x3cba81['order']=qs['sort'](_0x5bd577[_0x7b4b('0x34')][_0x7b4b('0x3c')]);_0x3cba81[_0x7b4b('0x3d')]=qs['filters'](_[_0x7b4b('0x3e')](_0x5bd577[_0x7b4b('0x34')],_0x53bebe['filters']),_0x294e41);if(_0x5bd577[_0x7b4b('0x34')][_0x7b4b('0x3f')]){_0x3cba81['where']=_['merge'](_0x3cba81[_0x7b4b('0x3d')],{'$or':[{'key':{'$like':'%'+_0x5bd577[_0x7b4b('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0x5bd577[_0x7b4b('0x34')][_0x7b4b('0x3f')]+'%'}}]});}_0x3cba81=_[_0x7b4b('0x40')]({},_0x3cba81,_0x5bd577[_0x7b4b('0x41')]);var _0x2bf5c1={'where':_0x3cba81[_0x7b4b('0x3d')]};return db['CannedAnswer'][_0x7b4b('0x21')](_0x2bf5c1)[_0x7b4b('0x25')](function(_0xa5d700){_0x223b76[_0x7b4b('0x21')]=_0xa5d700;if(_0x5bd577[_0x7b4b('0x34')][_0x7b4b('0x42')]){_0x3cba81['include']=[{'all':!![]}];}return db[_0x7b4b('0x2e')]['findAll'](_0x3cba81);})[_0x7b4b('0x25')](function(_0x29cd02){_0x223b76[_0x7b4b('0x43')]=_0x29cd02;return _0x223b76;})[_0x7b4b('0x25')](respondWithFilteredResult(_0x7c3156,_0x3cba81))[_0x7b4b('0x44')](handleError(_0x7c3156,null));};exports[_0x7b4b('0x45')]=function(_0x375e65,_0x297e20){var _0x101dda={'raw':!![],'where':{'id':_0x375e65[_0x7b4b('0x46')]['id']}},_0x38f444={};_0x38f444['model']=_[_0x7b4b('0x33')](db[_0x7b4b('0x2e')][_0x7b4b('0x47')]);_0x38f444[_0x7b4b('0x34')]=_[_0x7b4b('0x33')](_0x375e65['query']);_0x38f444['filters']=_[_0x7b4b('0x37')](_0x38f444[_0x7b4b('0x32')],_0x38f444[_0x7b4b('0x34')]);_0x101dda['attributes']=_['intersection'](_0x38f444[_0x7b4b('0x32')],qs[_0x7b4b('0x38')](_0x375e65[_0x7b4b('0x34')][_0x7b4b('0x38')]));_0x101dda['attributes']=_0x101dda[_0x7b4b('0x36')][_0x7b4b('0x39')]?_0x101dda['attributes']:_0x38f444[_0x7b4b('0x32')];if(_0x375e65[_0x7b4b('0x34')]['includeAll']){_0x101dda[_0x7b4b('0x48')]=[{'all':!![]}];}_0x101dda=_['merge']({},_0x101dda,_0x375e65[_0x7b4b('0x41')]);return db[_0x7b4b('0x2e')][_0x7b4b('0x49')](_0x101dda)[_0x7b4b('0x25')](handleEntityNotFound(_0x297e20,null))['then'](respondWithResult(_0x297e20,null))[_0x7b4b('0x44')](handleError(_0x297e20,null));};exports[_0x7b4b('0x24')]=function(_0x1c9d88,_0xedf837){if(_0x1c9d88['body']['id']){delete _0x1c9d88[_0x7b4b('0x4a')]['id'];}return db[_0x7b4b('0x2e')]['find']({'where':{'id':_0x1c9d88[_0x7b4b('0x46')]['id']}})[_0x7b4b('0x25')](handleEntityNotFound(_0xedf837,null))[_0x7b4b('0x25')](saveUpdates(_0x1c9d88['body'],null))['then'](respondWithResult(_0xedf837,null))[_0x7b4b('0x44')](handleError(_0xedf837,null));};exports['destroy']=function(_0x21eb1a,_0x1df73f){return db[_0x7b4b('0x2e')][_0x7b4b('0x49')]({'where':{'id':_0x21eb1a[_0x7b4b('0x46')]['id']}})[_0x7b4b('0x25')](handleEntityNotFound(_0x1df73f,null))[_0x7b4b('0x25')](removeEntity(_0x1df73f,null))['catch'](handleError(_0x1df73f,null));};exports['create']=function(_0x487691,_0x1d0760){var _0x591cc6={'key':_0x487691[_0x7b4b('0x4a')][_0x7b4b('0x31')]};if(_0x487691['body'][_0x7b4b('0x4b')]){_0x591cc6[_0x7b4b('0x4b')]=_0x487691[_0x7b4b('0x4a')][_0x7b4b('0x4b')];}else if(_0x487691[_0x7b4b('0x4a')][_0x7b4b('0x4c')]){_0x591cc6[_0x7b4b('0x4c')]=_0x487691[_0x7b4b('0x4a')][_0x7b4b('0x4c')];}else if(_0x487691[_0x7b4b('0x4a')][_0x7b4b('0x4d')]){_0x591cc6[_0x7b4b('0x4d')]=_0x487691['body'][_0x7b4b('0x4d')];}else if(_0x487691[_0x7b4b('0x4a')]['ChatWebsiteId']){_0x591cc6[_0x7b4b('0x4e')]=_0x487691['body'][_0x7b4b('0x4e')];}return db[_0x7b4b('0x2e')][_0x7b4b('0x49')]({'where':_0x591cc6})[_0x7b4b('0x25')](function(_0x460868){if(_0x460868){throw new db[(_0x7b4b('0x4f'))][(_0x7b4b('0x50'))](_0x7b4b('0x51'));}return db['CannedAnswer'][_0x7b4b('0x52')](_0x487691['body']);})[_0x7b4b('0x25')](function(_0x4a7692){var _0x4ea10b=_0x487691['user'][_0x7b4b('0x27')]({'plain':!![]});if(!_0x4ea10b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea10b[_0x7b4b('0x53')]===_0x7b4b('0x54')){var _0x48afff=_0x4a7692['get']({'plain':!![]});return db['UserProfileSection'][_0x7b4b('0x49')]({'where':{'name':_0x7b4b('0x28'),'userProfileId':_0x4ea10b['userProfileId']},'raw':!![]})[_0x7b4b('0x25')](function(_0x4abbf2){if(_0x4abbf2&&_0x4abbf2[_0x7b4b('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x48afff['name'],'resourceId':_0x48afff['id'],'type':_0x4abbf2['name'],'sectionId':_0x4abbf2['id']},{})[_0x7b4b('0x25')](function(){return _0x4a7692;});}else{return _0x4a7692;}})[_0x7b4b('0x44')](function(_0x24c87c){logger[_0x7b4b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24c87c);throw _0x24c87c;});}return _0x4a7692;})[_0x7b4b('0x25')](respondWithResult(_0x1d0760,0xc9))[_0x7b4b('0x44')](handleError(_0x1d0760,null));}; \ No newline at end of file +var _0xb9ff=['path','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','index','map','CannedAnswer','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','rows','catch','show','params','rawAttributes','length','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','role','UserProfileSection','CannedAnswers','userProfileId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util'];(function(_0x277fa3,_0x3b2dde){var _0x2e4520=function(_0x209eab){while(--_0x209eab){_0x277fa3['push'](_0x277fa3['shift']());}};_0x2e4520(++_0x3b2dde);}(_0xb9ff,0xa5));var _0xfb9f=function(_0x4eb4e1,_0x1b3caa){_0x4eb4e1=_0x4eb4e1-0x0;var _0x116b49=_0xb9ff[_0x4eb4e1];return _0x116b49;};'use strict';var emlformat=require(_0xfb9f('0x0'));var rimraf=require(_0xfb9f('0x1'));var zipdir=require(_0xfb9f('0x2'));var jsonpatch=require(_0xfb9f('0x3'));var rp=require(_0xfb9f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfb9f('0x5'));var util=require(_0xfb9f('0x6'));var path=require(_0xfb9f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb9f('0x8'));var _=require(_0xfb9f('0x9'));var squel=require(_0xfb9f('0xa'));var crypto=require(_0xfb9f('0xb'));var jsforce=require(_0xfb9f('0xc'));var deskjs=require(_0xfb9f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfb9f('0xe'));var Papa=require('papaparse');var Redis=require(_0xfb9f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfb9f('0x10'));var as=require(_0xfb9f('0x11'));var hardwareService=require(_0xfb9f('0x12'));var logger=require(_0xfb9f('0x13'))(_0xfb9f('0x14'));var utils=require(_0xfb9f('0x15'));var config=require(_0xfb9f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfb9f('0x17'))['db'];function respondWithStatusCode(_0x1d10ea,_0x44b23e){_0x44b23e=_0x44b23e||0xcc;return function(_0x3214e1){if(_0x3214e1){return _0x1d10ea[_0xfb9f('0x18')](_0x44b23e);}return _0x1d10ea[_0xfb9f('0x19')](_0x44b23e)[_0xfb9f('0x1a')]();};}function respondWithResult(_0x2a988c,_0x2e1ac4){_0x2e1ac4=_0x2e1ac4||0xc8;return function(_0x42b03c){if(_0x42b03c){return _0x2a988c[_0xfb9f('0x19')](_0x2e1ac4)[_0xfb9f('0x1b')](_0x42b03c);}};}function respondWithFilteredResult(_0x5b90ae,_0x235726){return function(_0xce55c5){if(_0xce55c5){var _0x2a8060=typeof _0x235726[_0xfb9f('0x1c')]===_0xfb9f('0x1d')&&typeof _0x235726[_0xfb9f('0x1e')]===_0xfb9f('0x1d');var _0xb09ac0=_0xce55c5[_0xfb9f('0x1f')];var _0x2fb696=_0x2a8060?0x0:_0x235726[_0xfb9f('0x1c')];var _0x1449e4=_0x2a8060?_0xce55c5[_0xfb9f('0x1f')]:_0x235726[_0xfb9f('0x1c')]+_0x235726[_0xfb9f('0x1e')];var _0x23d1f0;if(_0x1449e4>=_0xb09ac0){_0x1449e4=_0xb09ac0;_0x23d1f0=0xc8;}else{_0x23d1f0=0xce;}_0x5b90ae[_0xfb9f('0x19')](_0x23d1f0);return _0x5b90ae[_0xfb9f('0x20')]('Content-Range',_0x2fb696+'-'+_0x1449e4+'/'+_0xb09ac0)[_0xfb9f('0x1b')](_0xce55c5);}return null;};}function patchUpdates(_0x429bd0){return function(_0x24c00f){try{jsonpatch[_0xfb9f('0x21')](_0x24c00f,_0x429bd0,!![]);}catch(_0x45f08d){return BPromise[_0xfb9f('0x22')](_0x45f08d);}return _0x24c00f[_0xfb9f('0x23')]();};}function saveUpdates(_0x5b95bf,_0x5c1af7){return function(_0x303d48){if(_0x303d48){return _0x303d48[_0xfb9f('0x24')](_0x5b95bf)[_0xfb9f('0x25')](function(_0x6c732e){return _0x6c732e;});}return null;};}function removeEntity(_0x5bb2d1,_0x3f5755){return function(_0x38dce1){if(_0x38dce1){return _0x38dce1[_0xfb9f('0x26')]()[_0xfb9f('0x25')](function(){var _0x4162f1=_0x38dce1['get']({'plain':!![]});var _0x53e20c='CannedAnswers';return db[_0xfb9f('0x27')][_0xfb9f('0x26')]({'where':{'type':_0x53e20c,'resourceId':_0x4162f1['id']}})['then'](function(){return _0x38dce1;});})[_0xfb9f('0x25')](function(){_0x5bb2d1[_0xfb9f('0x19')](0xcc)[_0xfb9f('0x1a')]();});}};}function handleEntityNotFound(_0x11b7f2,_0x51afcc){return function(_0x1a453b){if(!_0x1a453b){_0x11b7f2['sendStatus'](0x194);}return _0x1a453b;};}function handleError(_0x1c70b6,_0x50f0b7){_0x50f0b7=_0x50f0b7||0x1f4;return function(_0x4fb9f6){logger[_0xfb9f('0x28')](_0x4fb9f6[_0xfb9f('0x29')]);if(_0x4fb9f6['name']){delete _0x4fb9f6[_0xfb9f('0x2a')];}_0x1c70b6[_0xfb9f('0x19')](_0x50f0b7)['send'](_0x4fb9f6);};}exports[_0xfb9f('0x2b')]=function(_0x46d35b,_0xabb1a4){var _0x21cda9={},_0x4c1878={},_0xfdafe2={'count':0x0,'rows':[]};var _0x42ea86=_[_0xfb9f('0x2c')](db[_0xfb9f('0x2d')]['rawAttributes'],function(_0x13b56d){return{'name':_0x13b56d[_0xfb9f('0x2e')],'type':_0x13b56d[_0xfb9f('0x2f')][_0xfb9f('0x30')]};});_0x4c1878[_0xfb9f('0x31')]=_[_0xfb9f('0x2c')](_0x42ea86,_0xfb9f('0x2a'));_0x4c1878['query']=_[_0xfb9f('0x32')](_0x46d35b[_0xfb9f('0x33')]);_0x4c1878[_0xfb9f('0x34')]=_[_0xfb9f('0x35')](_0x4c1878[_0xfb9f('0x31')],_0x4c1878[_0xfb9f('0x33')]);_0x21cda9[_0xfb9f('0x36')]=_['intersection'](_0x4c1878[_0xfb9f('0x31')],qs[_0xfb9f('0x37')](_0x46d35b[_0xfb9f('0x33')]['fields']));_0x21cda9['attributes']=_0x21cda9[_0xfb9f('0x36')]['length']?_0x21cda9[_0xfb9f('0x36')]:_0x4c1878[_0xfb9f('0x31')];if(!_0x46d35b[_0xfb9f('0x33')][_0xfb9f('0x38')](_0xfb9f('0x39'))){_0x21cda9[_0xfb9f('0x1e')]=qs[_0xfb9f('0x1e')](_0x46d35b[_0xfb9f('0x33')][_0xfb9f('0x1e')]);_0x21cda9[_0xfb9f('0x1c')]=qs[_0xfb9f('0x1c')](_0x46d35b[_0xfb9f('0x33')][_0xfb9f('0x1c')]);}_0x21cda9[_0xfb9f('0x3a')]=qs['sort'](_0x46d35b[_0xfb9f('0x33')][_0xfb9f('0x3b')]);_0x21cda9[_0xfb9f('0x3c')]=qs['filters'](_['pick'](_0x46d35b['query'],_0x4c1878['filters']),_0x42ea86);if(_0x46d35b[_0xfb9f('0x33')][_0xfb9f('0x3d')]){_0x21cda9[_0xfb9f('0x3c')]=_[_0xfb9f('0x3e')](_0x21cda9[_0xfb9f('0x3c')],{'$or':[{'key':{'$like':'%'+_0x46d35b[_0xfb9f('0x33')][_0xfb9f('0x3d')]+'%'}},{'value':{'$like':'%'+_0x46d35b['query']['filter']+'%'}}]});}_0x21cda9=_[_0xfb9f('0x3e')]({},_0x21cda9,_0x46d35b[_0xfb9f('0x3f')]);var _0x66ef94={'where':_0x21cda9[_0xfb9f('0x3c')]};return db[_0xfb9f('0x2d')]['count'](_0x66ef94)[_0xfb9f('0x25')](function(_0x4230cd){_0xfdafe2[_0xfb9f('0x1f')]=_0x4230cd;if(_0x46d35b[_0xfb9f('0x33')]['includeAll']){_0x21cda9[_0xfb9f('0x40')]=[{'all':!![]}];}return db[_0xfb9f('0x2d')]['findAll'](_0x21cda9);})[_0xfb9f('0x25')](function(_0x5355f5){_0xfdafe2[_0xfb9f('0x41')]=_0x5355f5;return _0xfdafe2;})[_0xfb9f('0x25')](respondWithFilteredResult(_0xabb1a4,_0x21cda9))[_0xfb9f('0x42')](handleError(_0xabb1a4,null));};exports[_0xfb9f('0x43')]=function(_0x4afd50,_0x40ce1d){var _0x2c3987={'raw':!![],'where':{'id':_0x4afd50[_0xfb9f('0x44')]['id']}},_0x2eba96={};_0x2eba96[_0xfb9f('0x31')]=_[_0xfb9f('0x32')](db[_0xfb9f('0x2d')][_0xfb9f('0x45')]);_0x2eba96['query']=_['keys'](_0x4afd50['query']);_0x2eba96[_0xfb9f('0x34')]=_[_0xfb9f('0x35')](_0x2eba96['model'],_0x2eba96['query']);_0x2c3987['attributes']=_['intersection'](_0x2eba96[_0xfb9f('0x31')],qs[_0xfb9f('0x37')](_0x4afd50[_0xfb9f('0x33')][_0xfb9f('0x37')]));_0x2c3987[_0xfb9f('0x36')]=_0x2c3987[_0xfb9f('0x36')][_0xfb9f('0x46')]?_0x2c3987[_0xfb9f('0x36')]:_0x2eba96['model'];if(_0x4afd50['query']['includeAll']){_0x2c3987[_0xfb9f('0x40')]=[{'all':!![]}];}_0x2c3987=_[_0xfb9f('0x3e')]({},_0x2c3987,_0x4afd50[_0xfb9f('0x3f')]);return db[_0xfb9f('0x2d')][_0xfb9f('0x47')](_0x2c3987)[_0xfb9f('0x25')](handleEntityNotFound(_0x40ce1d,null))[_0xfb9f('0x25')](respondWithResult(_0x40ce1d,null))[_0xfb9f('0x42')](handleError(_0x40ce1d,null));};exports['update']=function(_0x1082c8,_0x50c188){if(_0x1082c8[_0xfb9f('0x48')]['id']){delete _0x1082c8[_0xfb9f('0x48')]['id'];}return db[_0xfb9f('0x2d')][_0xfb9f('0x47')]({'where':{'id':_0x1082c8[_0xfb9f('0x44')]['id']}})[_0xfb9f('0x25')](handleEntityNotFound(_0x50c188,null))['then'](saveUpdates(_0x1082c8['body'],null))[_0xfb9f('0x25')](respondWithResult(_0x50c188,null))[_0xfb9f('0x42')](handleError(_0x50c188,null));};exports[_0xfb9f('0x26')]=function(_0x5e5084,_0x197bcd){return db[_0xfb9f('0x2d')][_0xfb9f('0x47')]({'where':{'id':_0x5e5084['params']['id']}})[_0xfb9f('0x25')](handleEntityNotFound(_0x197bcd,null))[_0xfb9f('0x25')](removeEntity(_0x197bcd,null))[_0xfb9f('0x42')](handleError(_0x197bcd,null));};exports['create']=function(_0x2d9467,_0x3b60f0){var _0x44f680={'key':_0x2d9467[_0xfb9f('0x48')][_0xfb9f('0x30')]};if(_0x2d9467[_0xfb9f('0x48')][_0xfb9f('0x49')]){_0x44f680['MailAccountId']=_0x2d9467[_0xfb9f('0x48')][_0xfb9f('0x49')];}else if(_0x2d9467[_0xfb9f('0x48')][_0xfb9f('0x4a')]){_0x44f680[_0xfb9f('0x4a')]=_0x2d9467[_0xfb9f('0x48')][_0xfb9f('0x4a')];}else if(_0x2d9467[_0xfb9f('0x48')][_0xfb9f('0x4b')]){_0x44f680[_0xfb9f('0x4b')]=_0x2d9467[_0xfb9f('0x48')][_0xfb9f('0x4b')];}else if(_0x2d9467[_0xfb9f('0x48')][_0xfb9f('0x4c')]){_0x44f680[_0xfb9f('0x4c')]=_0x2d9467[_0xfb9f('0x48')]['ChatWebsiteId'];}return db[_0xfb9f('0x2d')]['find']({'where':_0x44f680})[_0xfb9f('0x25')](function(_0x411e1a){if(_0x411e1a){throw new db[(_0xfb9f('0x4d'))][(_0xfb9f('0x4e'))](_0xfb9f('0x4f'));}return db['CannedAnswer'][_0xfb9f('0x50')](_0x2d9467['body']);})['then'](function(_0x3d616c){var _0x26ab4d=_0x2d9467[_0xfb9f('0x51')]['get']({'plain':!![]});if(!_0x26ab4d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26ab4d[_0xfb9f('0x52')]===_0xfb9f('0x51')){var _0xdc906=_0x3d616c['get']({'plain':!![]});return db[_0xfb9f('0x53')][_0xfb9f('0x47')]({'where':{'name':_0xfb9f('0x54'),'userProfileId':_0x26ab4d[_0xfb9f('0x55')]},'raw':!![]})[_0xfb9f('0x25')](function(_0x435fcf){if(_0x435fcf&&_0x435fcf['autoAssociation']===0x0){return db[_0xfb9f('0x27')][_0xfb9f('0x50')]({'name':_0xdc906[_0xfb9f('0x2a')],'resourceId':_0xdc906['id'],'type':_0x435fcf[_0xfb9f('0x2a')],'sectionId':_0x435fcf['id']},{})[_0xfb9f('0x25')](function(){return _0x3d616c;});}else{return _0x3d616c;}})[_0xfb9f('0x42')](function(_0x3d06cf){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d06cf);throw _0x3d06cf;});}return _0x3d616c;})[_0xfb9f('0x25')](respondWithResult(_0x3b60f0,0xc9))[_0xfb9f('0x42')](handleError(_0x3b60f0,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 2d147a6..c087944 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 _0xdafd=['exports','utf8mb4','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x39bc44,_0x1d4373){var _0x2916d8=function(_0x1767ac){while(--_0x1767ac){_0x39bc44['push'](_0x39bc44['shift']());}};_0x2916d8(++_0x1d4373);}(_0xdafd,0x146));var _0xddaf=function(_0x5df885,_0x336e62){_0x5df885=_0x5df885-0x0;var _0xb858a7=_0xdafd[_0x5df885];return _0xb858a7;};'use strict';var _=require(_0xddaf('0x0'));var util=require(_0xddaf('0x1'));var logger=require(_0xddaf('0x2'))('api');var moment=require(_0xddaf('0x3'));var BPromise=require(_0xddaf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xddaf('0x5'));var rimraf=require('rimraf');var config=require(_0xddaf('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0xddaf('0x7')]=function(_0x1cbe9c,_0x33cadd){return _0x1cbe9c['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xddaf('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf47a=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0xf47a,0x11a));var _0xaf47=function(_0x3103d2,_0x17f4b4){_0x3103d2=_0x3103d2-0x0;var _0x301015=_0xf47a[_0x3103d2];return _0x301015;};'use strict';var _=require(_0xaf47('0x0'));var util=require(_0xaf47('0x1'));var logger=require(_0xaf47('0x2'))('api');var moment=require(_0xaf47('0x3'));var BPromise=require(_0xaf47('0x4'));var rp=require(_0xaf47('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaf47('0x6'));var attributes=require(_0xaf47('0x7'));module[_0xaf47('0x8')]=function(_0x3430f5,_0x12cb46){return _0x3430f5[_0xaf47('0x9')](_0xaf47('0xa'),attributes,{'tableName':_0xaf47('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf47('0xc'),'collate':_0xaf47('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index aa92134..4120f55 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(_0x23128a,_0x4b8571){var _0x5ac511=function(_0x146aa8){while(--_0x146aa8){_0x23128a['push'](_0x23128a['shift']());}};_0x5ac511(++_0x4b8571);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x5dc4c9,_0x4ea148){var _0x3ac12b=function(_0x32a7e2){while(--_0x32a7e2){_0x5dc4c9['push'](_0x5dc4c9['shift']());}};_0x3ac12b(++_0x4ea148);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 72ea397..1d48d95 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 _0x3eaf=['index','show','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x3ff2f9,_0x544ba1){var _0x3b0913=function(_0x554288){while(--_0x554288){_0x3ff2f9['push'](_0x3ff2f9['shift']());}};_0x3b0913(++_0x544ba1);}(_0x3eaf,0xc6));var _0xf3ea=function(_0x254bfa,_0x5628e3){_0x254bfa=_0x254bfa-0x0;var _0x32c0da=_0x3eaf[_0x254bfa];return _0x32c0da;};'use strict';var multer=require(_0xf3ea('0x0'));var util=require('util');var path=require(_0xf3ea('0x1'));var timeout=require(_0xf3ea('0x2'));var express=require(_0xf3ea('0x3'));var router=express['Router']();var fs_extra=require(_0xf3ea('0x4'));var auth=require(_0xf3ea('0x5'));var interaction=require(_0xf3ea('0x6'));var config=require(_0xf3ea('0x7'));var controller=require(_0xf3ea('0x8'));router[_0xf3ea('0x9')]('/',auth[_0xf3ea('0xa')](),controller[_0xf3ea('0xb')]);router[_0xf3ea('0x9')]('/:id',auth[_0xf3ea('0xa')](),controller[_0xf3ea('0xc')]);router['post']('/',auth[_0xf3ea('0xa')](),controller[_0xf3ea('0xd')]);router[_0xf3ea('0xe')](_0xf3ea('0xf'),auth['isAuthenticated'](),controller[_0xf3ea('0x10')]);router[_0xf3ea('0x11')](_0xf3ea('0xf'),auth['isAuthenticated'](),controller[_0xf3ea('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8be4=['multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports'];(function(_0x193f59,_0x368e59){var _0x1c5dd3=function(_0x2c77e5){while(--_0x2c77e5){_0x193f59['push'](_0x193f59['shift']());}};_0x1c5dd3(++_0x368e59);}(_0x8be4,0x187));var _0x48be=function(_0x4322c6,_0x28f126){_0x4322c6=_0x4322c6-0x0;var _0x4e7537=_0x8be4[_0x4322c6];return _0x4e7537;};'use strict';var multer=require(_0x48be('0x0'));var util=require('util');var path=require(_0x48be('0x1'));var timeout=require('connect-timeout');var express=require(_0x48be('0x2'));var router=express['Router']();var fs_extra=require(_0x48be('0x3'));var auth=require(_0x48be('0x4'));var interaction=require(_0x48be('0x5'));var config=require(_0x48be('0x6'));var controller=require(_0x48be('0x7'));router['get']('/',auth[_0x48be('0x8')](),controller[_0x48be('0x9')]);router['get'](_0x48be('0xa'),auth[_0x48be('0x8')](),controller[_0x48be('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x48be('0xc')]);router[_0x48be('0xd')]('/:id',auth[_0x48be('0x8')](),controller['update']);router[_0x48be('0xe')](_0x48be('0xa'),auth['isAuthenticated'](),controller[_0x48be('0xf')]);module[_0x48be('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 9bcf596..f676b6d 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 _0x1094=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x57b5e1,_0x3c3ed2){var _0x18dec6=function(_0x949450){while(--_0x949450){_0x57b5e1['push'](_0x57b5e1['shift']());}};_0x18dec6(++_0x3c3ed2);}(_0x1094,0x143));var _0x4109=function(_0x25483f,_0x43852f){_0x25483f=_0x25483f-0x0;var _0x220d13=_0x1094[_0x25483f];return _0x220d13;};'use strict';var Sequelize=require(_0x4109('0x0'));module[_0x4109('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x4109('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x4109('0x3')]},'dst':{'type':Sequelize[_0x4109('0x3')]},'dcontext':{'type':Sequelize[_0x4109('0x3')]},'channel':{'type':Sequelize[_0x4109('0x3')]},'dstchannel':{'type':Sequelize[_0x4109('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x4109('0x3')]},'duration':{'type':Sequelize[_0x4109('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4109('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4109('0x3')]},'amaflags':{'type':Sequelize[_0x4109('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4109('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4109('0x3')]},'linkedid':{'type':Sequelize[_0x4109('0x3')]},'sequence':{'type':Sequelize[_0x4109('0x3')]},'peeraccount':{'type':Sequelize[_0x4109('0x3')]},'type':{'type':Sequelize[_0x4109('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa198=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0xa7d77f,_0x34bc29){var _0x4351bf=function(_0x9ba889){while(--_0x9ba889){_0xa7d77f['push'](_0xa7d77f['shift']());}};_0x4351bf(++_0x34bc29);}(_0xa198,0x7f));var _0x8a19=function(_0x2cc2b5,_0x34f825){_0x2cc2b5=_0x2cc2b5-0x0;var _0x46e656=_0xa198[_0x2cc2b5];return _0x46e656;};'use strict';var Sequelize=require(_0x8a19('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x8a19('0x1')},'clid':{'type':Sequelize[_0x8a19('0x2')]},'src':{'type':Sequelize[_0x8a19('0x2')]},'dst':{'type':Sequelize[_0x8a19('0x2')]},'dcontext':{'type':Sequelize[_0x8a19('0x2')]},'channel':{'type':Sequelize[_0x8a19('0x2')]},'dstchannel':{'type':Sequelize[_0x8a19('0x2')]},'lastapp':{'type':Sequelize[_0x8a19('0x2')]},'lastdata':{'type':Sequelize[_0x8a19('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8a19('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x8a19('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8a19('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8a19('0x2')]},'linkedid':{'type':Sequelize[_0x8a19('0x2')]},'sequence':{'type':Sequelize[_0x8a19('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8a19('0x2')]},'tag':{'type':Sequelize[_0x8a19('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 30436a1..de24bbd 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 _0x9fd4=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','Cdr','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','include','findAll','rows','catch','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0x9fd4,0x16c));var _0x49fd=function(_0x4c3a36,_0xdba60f){_0x4c3a36=_0x4c3a36-0x0;var _0x40f945=_0x9fd4[_0x4c3a36];return _0x40f945;};'use strict';var emlformat=require(_0x49fd('0x0'));var rimraf=require(_0x49fd('0x1'));var zipdir=require(_0x49fd('0x2'));var jsonpatch=require(_0x49fd('0x3'));var rp=require(_0x49fd('0x4'));var moment=require(_0x49fd('0x5'));var BPromise=require(_0x49fd('0x6'));var Mustache=require(_0x49fd('0x7'));var util=require(_0x49fd('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x49fd('0x9'));var ejs=require(_0x49fd('0xa'));var fs=require('fs');var fs_extra=require(_0x49fd('0xb'));var _=require(_0x49fd('0xc'));var squel=require('squel');var crypto=require(_0x49fd('0xd'));var jsforce=require(_0x49fd('0xe'));var deskjs=require(_0x49fd('0xf'));var toCsv=require(_0x49fd('0x9'));var querystring=require(_0x49fd('0x10'));var Papa=require('papaparse');var Redis=require(_0x49fd('0x11'));var authService=require(_0x49fd('0x12'));var qs=require(_0x49fd('0x13'));var as=require(_0x49fd('0x14'));var hardwareService=require(_0x49fd('0x15'));var logger=require(_0x49fd('0x16'))(_0x49fd('0x17'));var utils=require('../../config/utils');var config=require(_0x49fd('0x18'));var licenseUtil=require(_0x49fd('0x19'));var db=require(_0x49fd('0x1a'))['db'];function respondWithStatusCode(_0x40d1b0,_0x15dabd){_0x15dabd=_0x15dabd||0xcc;return function(_0x206bd8){if(_0x206bd8){return _0x40d1b0[_0x49fd('0x1b')](_0x15dabd);}return _0x40d1b0[_0x49fd('0x1c')](_0x15dabd)[_0x49fd('0x1d')]();};}function respondWithResult(_0x652890,_0x157b09){_0x157b09=_0x157b09||0xc8;return function(_0x44c18c){if(_0x44c18c){return _0x652890[_0x49fd('0x1c')](_0x157b09)[_0x49fd('0x1e')](_0x44c18c);}};}function respondWithFilteredResult(_0x264ab1,_0x201109){return function(_0x2859f2){if(_0x2859f2){var _0x3ca675=typeof _0x201109[_0x49fd('0x1f')]===_0x49fd('0x20')&&typeof _0x201109[_0x49fd('0x21')]===_0x49fd('0x20');var _0x320fe5=_0x2859f2[_0x49fd('0x22')];var _0xb55d24=_0x3ca675?0x0:_0x201109[_0x49fd('0x1f')];var _0x598793=_0x3ca675?_0x2859f2[_0x49fd('0x22')]:_0x201109[_0x49fd('0x1f')]+_0x201109['limit'];var _0x5c323a;if(_0x598793>=_0x320fe5){_0x598793=_0x320fe5;_0x5c323a=0xc8;}else{_0x5c323a=0xce;}_0x264ab1[_0x49fd('0x1c')](_0x5c323a);return _0x264ab1['set'](_0x49fd('0x23'),_0xb55d24+'-'+_0x598793+'/'+_0x320fe5)[_0x49fd('0x1e')](_0x2859f2);}return null;};}function patchUpdates(_0x599315){return function(_0xf7efcf){try{jsonpatch[_0x49fd('0x24')](_0xf7efcf,_0x599315,!![]);}catch(_0x5ae3bc){return BPromise[_0x49fd('0x25')](_0x5ae3bc);}return _0xf7efcf[_0x49fd('0x26')]();};}function saveUpdates(_0x2e1c40,_0x290f59){return function(_0x20fa0d){if(_0x20fa0d){return _0x20fa0d[_0x49fd('0x27')](_0x2e1c40)['then'](function(_0x46019d){return _0x46019d;});}return null;};}function removeEntity(_0xd43815,_0x8f202b){return function(_0x4bf811){if(_0x4bf811){return _0x4bf811[_0x49fd('0x28')]()[_0x49fd('0x29')](function(){_0xd43815[_0x49fd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x597161,_0x497469){return function(_0x13c5a8){if(!_0x13c5a8){_0x597161[_0x49fd('0x1b')](0x194);}return _0x13c5a8;};}function handleError(_0x4ec190,_0x302ab2){_0x302ab2=_0x302ab2||0x1f4;return function(_0x9587b9){logger[_0x49fd('0x2a')](_0x9587b9[_0x49fd('0x2b')]);if(_0x9587b9[_0x49fd('0x2c')]){delete _0x9587b9['name'];}_0x4ec190[_0x49fd('0x1c')](_0x302ab2)['send'](_0x9587b9);};}exports[_0x49fd('0x2d')]=function(_0x89badc,_0x54acb5){var _0x203038={},_0x2c8568={},_0x23374c={'count':0x0,'rows':[]};var _0x43826f=_[_0x49fd('0x2e')](db[_0x49fd('0x2f')][_0x49fd('0x30')],function(_0x242203){return{'name':_0x242203['fieldName'],'type':_0x242203[_0x49fd('0x31')]['key']};});_0x2c8568[_0x49fd('0x32')]=_['map'](_0x43826f,_0x49fd('0x2c'));_0x2c8568[_0x49fd('0x33')]=_[_0x49fd('0x34')](_0x89badc['query']);_0x2c8568['filters']=_['intersection'](_0x2c8568[_0x49fd('0x32')],_0x2c8568[_0x49fd('0x33')]);_0x203038['attributes']=_[_0x49fd('0x35')](_0x2c8568['model'],qs['fields'](_0x89badc[_0x49fd('0x33')][_0x49fd('0x36')]));_0x203038[_0x49fd('0x37')]=_0x203038[_0x49fd('0x37')][_0x49fd('0x38')]?_0x203038['attributes']:_0x2c8568['model'];if(!_0x89badc[_0x49fd('0x33')][_0x49fd('0x39')](_0x49fd('0x3a'))){_0x203038[_0x49fd('0x21')]=qs['limit'](_0x89badc[_0x49fd('0x33')][_0x49fd('0x21')]);_0x203038[_0x49fd('0x1f')]=qs[_0x49fd('0x1f')](_0x89badc[_0x49fd('0x33')][_0x49fd('0x1f')]);}_0x203038[_0x49fd('0x3b')]=qs[_0x49fd('0x3c')](_0x89badc[_0x49fd('0x33')][_0x49fd('0x3c')]);_0x203038[_0x49fd('0x3d')]=qs['filters'](_[_0x49fd('0x3e')](_0x89badc[_0x49fd('0x33')],_0x2c8568[_0x49fd('0x3f')]),_0x43826f);if(_0x89badc[_0x49fd('0x33')][_0x49fd('0x40')]){_0x203038[_0x49fd('0x3d')]=_[_0x49fd('0x41')](_0x203038[_0x49fd('0x3d')],{'$or':_[_0x49fd('0x2e')](_0x43826f,function(_0x4a1856){if(_0x4a1856[_0x49fd('0x31')]!=='VIRTUAL'){var _0x46e84c={};_0x46e84c[_0x4a1856[_0x49fd('0x2c')]]={'$like':'%'+_0x89badc['query'][_0x49fd('0x40')]+'%'};return _0x46e84c;}})});}_0x203038=_[_0x49fd('0x41')]({},_0x203038,_0x89badc['options']);var _0x1f9a65={'where':_0x203038['where']};return db['Cdr']['count'](_0x1f9a65)[_0x49fd('0x29')](function(_0x32982e){_0x23374c[_0x49fd('0x22')]=_0x32982e;if(_0x89badc[_0x49fd('0x33')]['includeAll']){_0x203038[_0x49fd('0x42')]=[{'all':!![]}];}return db[_0x49fd('0x2f')][_0x49fd('0x43')](_0x203038);})[_0x49fd('0x29')](function(_0x115c5a){_0x23374c[_0x49fd('0x44')]=_0x115c5a;return _0x23374c;})[_0x49fd('0x29')](respondWithFilteredResult(_0x54acb5,_0x203038))[_0x49fd('0x45')](handleError(_0x54acb5,null));};exports['show']=function(_0x255a73,_0x2c8ab1){var _0x4dce94={'raw':!![],'where':{'id':_0x255a73[_0x49fd('0x46')]['id']}},_0x3be41b={};_0x3be41b['model']=_[_0x49fd('0x34')](db['Cdr'][_0x49fd('0x30')]);_0x3be41b[_0x49fd('0x33')]=_[_0x49fd('0x34')](_0x255a73[_0x49fd('0x33')]);_0x3be41b['filters']=_['intersection'](_0x3be41b[_0x49fd('0x32')],_0x3be41b['query']);_0x4dce94[_0x49fd('0x37')]=_[_0x49fd('0x35')](_0x3be41b[_0x49fd('0x32')],qs[_0x49fd('0x36')](_0x255a73['query'][_0x49fd('0x36')]));_0x4dce94[_0x49fd('0x37')]=_0x4dce94[_0x49fd('0x37')][_0x49fd('0x38')]?_0x4dce94[_0x49fd('0x37')]:_0x3be41b[_0x49fd('0x32')];if(_0x255a73[_0x49fd('0x33')][_0x49fd('0x47')]){_0x4dce94[_0x49fd('0x42')]=[{'all':!![]}];}_0x4dce94=_[_0x49fd('0x41')]({},_0x4dce94,_0x255a73[_0x49fd('0x48')]);return db[_0x49fd('0x2f')][_0x49fd('0x49')](_0x4dce94)[_0x49fd('0x29')](handleEntityNotFound(_0x2c8ab1,null))['then'](respondWithResult(_0x2c8ab1,null))['catch'](handleError(_0x2c8ab1,null));};exports[_0x49fd('0x4a')]=function(_0xa3518f,_0x42287e){return db[_0x49fd('0x2f')]['create'](_0xa3518f[_0x49fd('0x4b')],{})[_0x49fd('0x29')](respondWithResult(_0x42287e,0xc9))['catch'](handleError(_0x42287e,null));};exports[_0x49fd('0x27')]=function(_0x270360,_0xaac56f){if(_0x270360[_0x49fd('0x4b')]['id']){delete _0x270360[_0x49fd('0x4b')]['id'];}return db[_0x49fd('0x2f')][_0x49fd('0x49')]({'where':{'id':_0x270360[_0x49fd('0x46')]['id']}})[_0x49fd('0x29')](handleEntityNotFound(_0xaac56f,null))[_0x49fd('0x29')](saveUpdates(_0x270360[_0x49fd('0x4b')],null))['then'](respondWithResult(_0xaac56f,null))[_0x49fd('0x45')](handleError(_0xaac56f,null));};exports[_0x49fd('0x28')]=function(_0x32694b,_0x263cf3){return db[_0x49fd('0x2f')][_0x49fd('0x49')]({'where':{'id':_0x32694b['params']['id']}})['then'](handleEntityNotFound(_0x263cf3,null))[_0x49fd('0x29')](removeEntity(_0x263cf3,null))[_0x49fd('0x45')](handleError(_0x263cf3,null));};exports[_0x49fd('0x4c')]=function(_0x5c34c0,_0x31783f){return db[_0x49fd('0x2f')]['describe']()['then'](respondWithResult(_0x31783f,null))['catch'](handleError(_0x31783f,null));}; \ No newline at end of file +var _0xa3e6=['offset','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Cdr','fieldName','type','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','include','findAll','catch','params','rawAttributes','includeAll','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x5508e5,_0x22e83c){var _0xd1815d=function(_0x3a6bbb){while(--_0x3a6bbb){_0x5508e5['push'](_0x5508e5['shift']());}};_0xd1815d(++_0x22e83c);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x4bc34f,_0x4d3f92){_0x4bc34f=_0x4bc34f-0x0;var _0x4484f1=_0xa3e6[_0x4bc34f];return _0x4484f1;};'use strict';var emlformat=require(_0x6a3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6a3e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a3e('0x2'));var moment=require(_0x6a3e('0x3'));var BPromise=require(_0x6a3e('0x4'));var Mustache=require('mustache');var util=require(_0x6a3e('0x5'));var path=require('path');var sox=require(_0x6a3e('0x6'));var csv=require(_0x6a3e('0x7'));var ejs=require(_0x6a3e('0x8'));var fs=require('fs');var fs_extra=require(_0x6a3e('0x9'));var _=require(_0x6a3e('0xa'));var squel=require('squel');var crypto=require(_0x6a3e('0xb'));var jsforce=require(_0x6a3e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a3e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6a3e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6a3e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a3e('0x10'))(_0x6a3e('0x11'));var utils=require(_0x6a3e('0x12'));var config=require(_0x6a3e('0x13'));var licenseUtil=require(_0x6a3e('0x14'));var db=require(_0x6a3e('0x15'))['db'];function respondWithStatusCode(_0x4a3a97,_0x27e169){_0x27e169=_0x27e169||0xcc;return function(_0x385c29){if(_0x385c29){return _0x4a3a97[_0x6a3e('0x16')](_0x27e169);}return _0x4a3a97[_0x6a3e('0x17')](_0x27e169)[_0x6a3e('0x18')]();};}function respondWithResult(_0x31aefa,_0x222f7c){_0x222f7c=_0x222f7c||0xc8;return function(_0x4bd05f){if(_0x4bd05f){return _0x31aefa[_0x6a3e('0x17')](_0x222f7c)[_0x6a3e('0x19')](_0x4bd05f);}};}function respondWithFilteredResult(_0x8ed74b,_0x2a62a8){return function(_0x500ccd){if(_0x500ccd){var _0x462b8d=typeof _0x2a62a8[_0x6a3e('0x1a')]==='undefined'&&typeof _0x2a62a8['limit']==='undefined';var _0x58b221=_0x500ccd['count'];var _0x3693a2=_0x462b8d?0x0:_0x2a62a8[_0x6a3e('0x1a')];var _0x31a190=_0x462b8d?_0x500ccd[_0x6a3e('0x1b')]:_0x2a62a8[_0x6a3e('0x1a')]+_0x2a62a8[_0x6a3e('0x1c')];var _0x1d6ccc;if(_0x31a190>=_0x58b221){_0x31a190=_0x58b221;_0x1d6ccc=0xc8;}else{_0x1d6ccc=0xce;}_0x8ed74b[_0x6a3e('0x17')](_0x1d6ccc);return _0x8ed74b['set'](_0x6a3e('0x1d'),_0x3693a2+'-'+_0x31a190+'/'+_0x58b221)['json'](_0x500ccd);}return null;};}function patchUpdates(_0xc0452f){return function(_0x5ae73b){try{jsonpatch[_0x6a3e('0x1e')](_0x5ae73b,_0xc0452f,!![]);}catch(_0x131d80){return BPromise[_0x6a3e('0x1f')](_0x131d80);}return _0x5ae73b[_0x6a3e('0x20')]();};}function saveUpdates(_0x58721c,_0x4f7507){return function(_0x215ac1){if(_0x215ac1){return _0x215ac1[_0x6a3e('0x21')](_0x58721c)[_0x6a3e('0x22')](function(_0x4687d0){return _0x4687d0;});}return null;};}function removeEntity(_0x4e5a25,_0x1ae966){return function(_0x21b5aa){if(_0x21b5aa){return _0x21b5aa[_0x6a3e('0x23')]()[_0x6a3e('0x22')](function(){_0x4e5a25[_0x6a3e('0x17')](0xcc)[_0x6a3e('0x18')]();});}};}function handleEntityNotFound(_0x359460,_0x83e681){return function(_0x25fc14){if(!_0x25fc14){_0x359460[_0x6a3e('0x16')](0x194);}return _0x25fc14;};}function handleError(_0x5b1ed9,_0x4ec834){_0x4ec834=_0x4ec834||0x1f4;return function(_0x150992){logger[_0x6a3e('0x24')](_0x150992[_0x6a3e('0x25')]);if(_0x150992[_0x6a3e('0x26')]){delete _0x150992[_0x6a3e('0x26')];}_0x5b1ed9[_0x6a3e('0x17')](_0x4ec834)[_0x6a3e('0x27')](_0x150992);};}exports[_0x6a3e('0x28')]=function(_0xd87198,_0x436169){var _0x3a831b={},_0x508a55={},_0x4eec67={'count':0x0,'rows':[]};var _0x2a2b2a=_['map'](db[_0x6a3e('0x29')]['rawAttributes'],function(_0x553fc5){return{'name':_0x553fc5[_0x6a3e('0x2a')],'type':_0x553fc5[_0x6a3e('0x2b')]['key']};});_0x508a55['model']=_[_0x6a3e('0x2c')](_0x2a2b2a,_0x6a3e('0x26'));_0x508a55[_0x6a3e('0x2d')]=_[_0x6a3e('0x2e')](_0xd87198['query']);_0x508a55['filters']=_[_0x6a3e('0x2f')](_0x508a55[_0x6a3e('0x30')],_0x508a55[_0x6a3e('0x2d')]);_0x3a831b[_0x6a3e('0x31')]=_['intersection'](_0x508a55[_0x6a3e('0x30')],qs[_0x6a3e('0x32')](_0xd87198['query']['fields']));_0x3a831b['attributes']=_0x3a831b[_0x6a3e('0x31')][_0x6a3e('0x33')]?_0x3a831b[_0x6a3e('0x31')]:_0x508a55[_0x6a3e('0x30')];if(!_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x34')](_0x6a3e('0x35'))){_0x3a831b[_0x6a3e('0x1c')]=qs[_0x6a3e('0x1c')](_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x1c')]);_0x3a831b[_0x6a3e('0x1a')]=qs[_0x6a3e('0x1a')](_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x1a')]);}_0x3a831b['order']=qs[_0x6a3e('0x36')](_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x36')]);_0x3a831b['where']=qs[_0x6a3e('0x37')](_[_0x6a3e('0x38')](_0xd87198['query'],_0x508a55[_0x6a3e('0x37')]),_0x2a2b2a);if(_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x39')]){_0x3a831b['where']=_[_0x6a3e('0x3a')](_0x3a831b[_0x6a3e('0x3b')],{'$or':_[_0x6a3e('0x2c')](_0x2a2b2a,function(_0x3e604c){if(_0x3e604c[_0x6a3e('0x2b')]!==_0x6a3e('0x3c')){var _0x5f4ff5={};_0x5f4ff5[_0x3e604c[_0x6a3e('0x26')]]={'$like':'%'+_0xd87198['query']['filter']+'%'};return _0x5f4ff5;}})});}_0x3a831b=_['merge']({},_0x3a831b,_0xd87198[_0x6a3e('0x3d')]);var _0x4bb1ba={'where':_0x3a831b[_0x6a3e('0x3b')]};return db[_0x6a3e('0x29')][_0x6a3e('0x1b')](_0x4bb1ba)[_0x6a3e('0x22')](function(_0xca83d2){_0x4eec67[_0x6a3e('0x1b')]=_0xca83d2;if(_0xd87198['query']['includeAll']){_0x3a831b[_0x6a3e('0x3e')]=[{'all':!![]}];}return db[_0x6a3e('0x29')][_0x6a3e('0x3f')](_0x3a831b);})[_0x6a3e('0x22')](function(_0x1dd524){_0x4eec67['rows']=_0x1dd524;return _0x4eec67;})[_0x6a3e('0x22')](respondWithFilteredResult(_0x436169,_0x3a831b))[_0x6a3e('0x40')](handleError(_0x436169,null));};exports['show']=function(_0x35c927,_0x417f8a){var _0x35c836={'raw':!![],'where':{'id':_0x35c927[_0x6a3e('0x41')]['id']}},_0x53ad48={};_0x53ad48[_0x6a3e('0x30')]=_[_0x6a3e('0x2e')](db[_0x6a3e('0x29')][_0x6a3e('0x42')]);_0x53ad48[_0x6a3e('0x2d')]=_['keys'](_0x35c927[_0x6a3e('0x2d')]);_0x53ad48[_0x6a3e('0x37')]=_[_0x6a3e('0x2f')](_0x53ad48['model'],_0x53ad48[_0x6a3e('0x2d')]);_0x35c836['attributes']=_['intersection'](_0x53ad48[_0x6a3e('0x30')],qs[_0x6a3e('0x32')](_0x35c927[_0x6a3e('0x2d')]['fields']));_0x35c836['attributes']=_0x35c836[_0x6a3e('0x31')][_0x6a3e('0x33')]?_0x35c836[_0x6a3e('0x31')]:_0x53ad48[_0x6a3e('0x30')];if(_0x35c927[_0x6a3e('0x2d')][_0x6a3e('0x43')]){_0x35c836['include']=[{'all':!![]}];}_0x35c836=_[_0x6a3e('0x3a')]({},_0x35c836,_0x35c927[_0x6a3e('0x3d')]);return db[_0x6a3e('0x29')][_0x6a3e('0x44')](_0x35c836)[_0x6a3e('0x22')](handleEntityNotFound(_0x417f8a,null))[_0x6a3e('0x22')](respondWithResult(_0x417f8a,null))[_0x6a3e('0x40')](handleError(_0x417f8a,null));};exports[_0x6a3e('0x45')]=function(_0x2d0685,_0x4d36e2){return db[_0x6a3e('0x29')][_0x6a3e('0x45')](_0x2d0685['body'],{})[_0x6a3e('0x22')](respondWithResult(_0x4d36e2,0xc9))['catch'](handleError(_0x4d36e2,null));};exports[_0x6a3e('0x21')]=function(_0x10cd8e,_0x28a3e9){if(_0x10cd8e['body']['id']){delete _0x10cd8e[_0x6a3e('0x46')]['id'];}return db[_0x6a3e('0x29')]['find']({'where':{'id':_0x10cd8e['params']['id']}})['then'](handleEntityNotFound(_0x28a3e9,null))[_0x6a3e('0x22')](saveUpdates(_0x10cd8e[_0x6a3e('0x46')],null))[_0x6a3e('0x22')](respondWithResult(_0x28a3e9,null))[_0x6a3e('0x40')](handleError(_0x28a3e9,null));};exports[_0x6a3e('0x23')]=function(_0x448e46,_0x404473){return db[_0x6a3e('0x29')][_0x6a3e('0x44')]({'where':{'id':_0x448e46[_0x6a3e('0x41')]['id']}})[_0x6a3e('0x22')](handleEntityNotFound(_0x404473,null))['then'](removeEntity(_0x404473,null))[_0x6a3e('0x40')](handleError(_0x404473,null));};exports[_0x6a3e('0x47')]=function(_0x3fabf8,_0x21ba7b){return db[_0x6a3e('0x29')]['describe']()[_0x6a3e('0x22')](respondWithResult(_0x21ba7b,null))['catch'](handleError(_0x21ba7b,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 074b59b..9eb0a0a 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(_0x4dae60,_0x59c31f){var _0x52165e=function(_0x1c5c43){while(--_0x1c5c43){_0x4dae60['push'](_0x4dae60['shift']());}};_0x52165e(++_0x59c31f);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x493765,_0x44f6d6){var _0x220718=function(_0x3083d5){while(--_0x3083d5){_0x493765['push'](_0x493765['shift']());}};_0x220718(++_0x44f6d6);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index d1dab48..2e4913e 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 _0xd118=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x1b8cbd,_0x4e7763){var _0x2cc9b0=function(_0xc05ced){while(--_0xc05ced){_0x1b8cbd['push'](_0x1b8cbd['shift']());}};_0x2cc9b0(++_0x4e7763);}(_0xd118,0x162));var _0x8d11=function(_0x5a3b19,_0x424b2e){_0x5a3b19=_0x5a3b19-0x0;var _0x238440=_0xd118[_0x5a3b19];return _0x238440;};'use strict';var _=require(_0x8d11('0x0'));var util=require(_0x8d11('0x1'));var moment=require(_0x8d11('0x2'));var BPromise=require(_0x8d11('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d11('0x4'));var db=require(_0x8d11('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d11('0x6'))(_0x8d11('0x7'));var config=require('../../config/environment');var jayson=require(_0x8d11('0x8'));var client=jayson[_0x8d11('0x9')][_0x8d11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x519bfa,_0x2b884c,_0x57311a){return new BPromise(function(_0x29308c,_0x4bb82e){return client[_0x8d11('0xb')](_0x519bfa,_0x57311a)[_0x8d11('0xc')](function(_0x52afdb){logger[_0x8d11('0xd')]('Cdr,\x20%s,\x20%s',_0x2b884c,'request\x20sent');logger[_0x8d11('0xe')](_0x8d11('0xf'),_0x2b884c,_0x8d11('0x10'),JSON[_0x8d11('0x11')](_0x52afdb));if(_0x52afdb[_0x8d11('0x12')]){if(_0x52afdb[_0x8d11('0x12')][_0x8d11('0x13')]===0x1f4){logger['error'](_0x8d11('0x14'),_0x2b884c,_0x52afdb['error'][_0x8d11('0x15')]);return _0x4bb82e(_0x52afdb[_0x8d11('0x12')][_0x8d11('0x15')]);}logger['error'](_0x8d11('0x14'),_0x2b884c,_0x52afdb[_0x8d11('0x12')][_0x8d11('0x15')]);return _0x29308c(_0x52afdb[_0x8d11('0x12')][_0x8d11('0x15')]);}else{logger[_0x8d11('0xd')](_0x8d11('0x14'),_0x2b884c,_0x8d11('0x10'));_0x29308c(_0x52afdb[_0x8d11('0x16')][_0x8d11('0x15')]);}})[_0x8d11('0x17')](function(_0x3dc661){logger[_0x8d11('0x12')](_0x8d11('0x14'),_0x2b884c,_0x3dc661);_0x4bb82e(_0x3dc661);});});} \ No newline at end of file +var _0xee1b=['http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xf7d7ba,_0x4c4d0d){var _0x4ce3bd=function(_0x5253c3){while(--_0x5253c3){_0xf7d7ba['push'](_0xf7d7ba['shift']());}};_0x4ce3bd(++_0x4c4d0d);}(_0xee1b,0x123));var _0xbee1=function(_0x1f7f06,_0x39a42e){_0x1f7f06=_0x1f7f06-0x0;var _0x4b3cdb=_0xee1b[_0x1f7f06];return _0x4b3cdb;};'use strict';var _=require(_0xbee1('0x0'));var util=require(_0xbee1('0x1'));var moment=require('moment');var BPromise=require(_0xbee1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbee1('0x3'));var logger=require(_0xbee1('0x4'))(_0xbee1('0x5'));var config=require(_0xbee1('0x6'));var jayson=require(_0xbee1('0x7'));var client=jayson[_0xbee1('0x8')][_0xbee1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34938b,_0x4a9f8a,_0x4a8fb6){return new BPromise(function(_0x4a2dc7,_0xc6cd98){return client[_0xbee1('0xa')](_0x34938b,_0x4a8fb6)[_0xbee1('0xb')](function(_0x4447bb){logger['info'](_0xbee1('0xc'),_0x4a9f8a,_0xbee1('0xd'));logger[_0xbee1('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x4a9f8a,_0xbee1('0xd'),JSON[_0xbee1('0xf')](_0x4447bb));if(_0x4447bb[_0xbee1('0x10')]){if(_0x4447bb[_0xbee1('0x10')][_0xbee1('0x11')]===0x1f4){logger['error'](_0xbee1('0xc'),_0x4a9f8a,_0x4447bb[_0xbee1('0x10')][_0xbee1('0x12')]);return _0xc6cd98(_0x4447bb['error'][_0xbee1('0x12')]);}logger[_0xbee1('0x10')](_0xbee1('0xc'),_0x4a9f8a,_0x4447bb[_0xbee1('0x10')][_0xbee1('0x12')]);return _0x4a2dc7(_0x4447bb['error'][_0xbee1('0x12')]);}else{logger[_0xbee1('0x13')](_0xbee1('0xc'),_0x4a9f8a,'request\x20sent');_0x4a2dc7(_0x4447bb['result']['message']);}})['catch'](function(_0x1affa3){logger[_0xbee1('0x10')](_0xbee1('0xc'),_0x4a9f8a,_0x1affa3);_0xc6cd98(_0x1affa3);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index e8030e6..025c7b9 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(_0x4df5d3,_0x522c48){var _0x34a8d=function(_0x52f363){while(--_0x52f363){_0x4df5d3['push'](_0x4df5d3['shift']());}};_0x34a8d(++_0x522c48);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x27097a,_0x1b7f8b){var _0x26378b=function(_0x39f8f8){while(--_0x39f8f8){_0x27097a['push'](_0x27097a['shift']());}};_0x26378b(++_0x1b7f8b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 959f2f9..abed3ea 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 _0x73d6=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x4aed46,_0x3ebe95){var _0x31cee3=function(_0x3a68c9){while(--_0x3a68c9){_0x4aed46['push'](_0x4aed46['shift']());}};_0x31cee3(++_0x3ebe95);}(_0x73d6,0xfa));var _0x673d=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0x73d6[_0x1e05c1];return _0x15f1ca;};'use strict';var Sequelize=require(_0x673d('0x0'));module[_0x673d('0x1')]={'priority':{'type':Sequelize[_0x673d('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x673d('0x3')},'appdata':{'type':Sequelize[_0x673d('0x4')]()},'description':{'type':Sequelize[_0x673d('0x5')]},'interval':{'type':Sequelize[_0x673d('0x5')],'defaultValue':_0x673d('0x6')}}; \ No newline at end of file +var _0x8032=['*,*,*,*','sequelize','exports','INTEGER','TEXT','STRING'];(function(_0x5a1c73,_0x3fc603){var _0x4bc4fa=function(_0x1dc816){while(--_0x1dc816){_0x5a1c73['push'](_0x5a1c73['shift']());}};_0x4bc4fa(++_0x3fc603);}(_0x8032,0xd9));var _0x2803=function(_0x421c11,_0xcf7560){_0x421c11=_0x421c11-0x0;var _0x317709=_0x8032[_0x421c11];return _0x317709;};'use strict';var Sequelize=require(_0x2803('0x0'));module[_0x2803('0x1')]={'priority':{'type':Sequelize[_0x2803('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2803('0x3')]()},'description':{'type':Sequelize[_0x2803('0x4')]},'interval':{'type':Sequelize[_0x2803('0x4')],'defaultValue':_0x2803('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index c1e8498..529ac8e 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 _0xab3a=['find','catch','body','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','count','offset','limit','Content-Range','json','apply','update','then','destroy','sendStatus','stack','name','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0xab3a,0x1d3));var _0xaab3=function(_0x41e81d,_0x2be61e){_0x41e81d=_0x41e81d-0x0;var _0x40292d=_0xab3a[_0x41e81d];return _0x40292d;};'use strict';var emlformat=require(_0xaab3('0x0'));var rimraf=require(_0xaab3('0x1'));var zipdir=require(_0xaab3('0x2'));var jsonpatch=require(_0xaab3('0x3'));var rp=require(_0xaab3('0x4'));var moment=require(_0xaab3('0x5'));var BPromise=require(_0xaab3('0x6'));var Mustache=require(_0xaab3('0x7'));var util=require(_0xaab3('0x8'));var path=require(_0xaab3('0x9'));var sox=require(_0xaab3('0xa'));var csv=require(_0xaab3('0xb'));var ejs=require(_0xaab3('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaab3('0xd'));var crypto=require(_0xaab3('0xe'));var jsforce=require(_0xaab3('0xf'));var deskjs=require(_0xaab3('0x10'));var toCsv=require(_0xaab3('0xb'));var querystring=require(_0xaab3('0x11'));var Papa=require(_0xaab3('0x12'));var Redis=require(_0xaab3('0x13'));var authService=require(_0xaab3('0x14'));var qs=require(_0xaab3('0x15'));var as=require(_0xaab3('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaab3('0x17'));var utils=require(_0xaab3('0x18'));var config=require(_0xaab3('0x19'));var licenseUtil=require(_0xaab3('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9bab,_0x536fd2){_0x536fd2=_0x536fd2||0xcc;return function(_0x1be7b2){if(_0x1be7b2){return _0x2c9bab['sendStatus'](_0x536fd2);}return _0x2c9bab[_0xaab3('0x1b')](_0x536fd2)[_0xaab3('0x1c')]();};}function respondWithResult(_0x4ccbf5,_0x553449){_0x553449=_0x553449||0xc8;return function(_0x43ca09){if(_0x43ca09){return _0x4ccbf5[_0xaab3('0x1b')](_0x553449)['json'](_0x43ca09);}};}function respondWithFilteredResult(_0x2d215e,_0xcc28ed){return function(_0x2aea7a){if(_0x2aea7a){var _0x5dbe3e=typeof _0xcc28ed['offset']==='undefined'&&typeof _0xcc28ed['limit']===_0xaab3('0x1d');var _0x3c5d63=_0x2aea7a[_0xaab3('0x1e')];var _0x5a3ecc=_0x5dbe3e?0x0:_0xcc28ed[_0xaab3('0x1f')];var _0x46aefc=_0x5dbe3e?_0x2aea7a[_0xaab3('0x1e')]:_0xcc28ed[_0xaab3('0x1f')]+_0xcc28ed[_0xaab3('0x20')];var _0x4c0d11;if(_0x46aefc>=_0x3c5d63){_0x46aefc=_0x3c5d63;_0x4c0d11=0xc8;}else{_0x4c0d11=0xce;}_0x2d215e[_0xaab3('0x1b')](_0x4c0d11);return _0x2d215e['set'](_0xaab3('0x21'),_0x5a3ecc+'-'+_0x46aefc+'/'+_0x3c5d63)[_0xaab3('0x22')](_0x2aea7a);}return null;};}function patchUpdates(_0x43a8d4){return function(_0x3588a9){try{jsonpatch[_0xaab3('0x23')](_0x3588a9,_0x43a8d4,!![]);}catch(_0x537701){return BPromise['reject'](_0x537701);}return _0x3588a9['save']();};}function saveUpdates(_0x5c5d8b,_0x5d7bf6){return function(_0x1fa934){if(_0x1fa934){return _0x1fa934[_0xaab3('0x24')](_0x5c5d8b)[_0xaab3('0x25')](function(_0x3a3000){return _0x3a3000;});}return null;};}function removeEntity(_0xaebe3e,_0x1816ab){return function(_0x3c552f){if(_0x3c552f){return _0x3c552f[_0xaab3('0x26')]()[_0xaab3('0x25')](function(){_0xaebe3e[_0xaab3('0x1b')](0xcc)[_0xaab3('0x1c')]();});}};}function handleEntityNotFound(_0x3097ec,_0x1199c1){return function(_0x4dd8fe){if(!_0x4dd8fe){_0x3097ec[_0xaab3('0x27')](0x194);}return _0x4dd8fe;};}function handleError(_0x599316,_0x28eaff){_0x28eaff=_0x28eaff||0x1f4;return function(_0x2904f8){logger['error'](_0x2904f8[_0xaab3('0x28')]);if(_0x2904f8[_0xaab3('0x29')]){delete _0x2904f8[_0xaab3('0x29')];}_0x599316['status'](_0x28eaff)['send'](_0x2904f8);};}exports[_0xaab3('0x2a')]=function(_0x205996,_0x2738ea){var _0x4a7558={'raw':!![],'where':{'id':_0x205996[_0xaab3('0x2b')]['id']}},_0x168eb0={};_0x168eb0[_0xaab3('0x2c')]=_[_0xaab3('0x2d')](db[_0xaab3('0x2e')][_0xaab3('0x2f')]);_0x168eb0[_0xaab3('0x30')]=_[_0xaab3('0x2d')](_0x205996[_0xaab3('0x30')]);_0x168eb0[_0xaab3('0x31')]=_[_0xaab3('0x32')](_0x168eb0[_0xaab3('0x2c')],_0x168eb0[_0xaab3('0x30')]);_0x4a7558[_0xaab3('0x33')]=_['intersection'](_0x168eb0[_0xaab3('0x2c')],qs[_0xaab3('0x34')](_0x205996[_0xaab3('0x30')][_0xaab3('0x34')]));_0x4a7558[_0xaab3('0x33')]=_0x4a7558[_0xaab3('0x33')]['length']?_0x4a7558[_0xaab3('0x33')]:_0x168eb0['model'];if(_0x205996['query'][_0xaab3('0x35')]){_0x4a7558[_0xaab3('0x36')]=[{'all':!![]}];}_0x4a7558=_['merge']({},_0x4a7558,_0x205996['options']);return db[_0xaab3('0x2e')][_0xaab3('0x37')](_0x4a7558)[_0xaab3('0x25')](handleEntityNotFound(_0x2738ea,null))['then'](respondWithResult(_0x2738ea,null))[_0xaab3('0x38')](handleError(_0x2738ea,null));};exports[_0xaab3('0x24')]=function(_0x1092b0,_0x5a7f3f){if(_0x1092b0['body']['id']){delete _0x1092b0[_0xaab3('0x39')]['id'];}return db[_0xaab3('0x2e')][_0xaab3('0x37')]({'where':{'id':_0x1092b0[_0xaab3('0x2b')]['id']}})[_0xaab3('0x25')](handleEntityNotFound(_0x5a7f3f,null))[_0xaab3('0x25')](saveUpdates(_0x1092b0['body'],null))[_0xaab3('0x25')](respondWithResult(_0x5a7f3f,null))[_0xaab3('0x38')](handleError(_0x5a7f3f,null));};exports[_0xaab3('0x26')]=function(_0x4f0aa3,_0x2fa351){return db[_0xaab3('0x2e')][_0xaab3('0x37')]({'where':{'id':_0x4f0aa3[_0xaab3('0x2b')]['id']}})[_0xaab3('0x25')](handleEntityNotFound(_0x2fa351,null))[_0xaab3('0x25')](removeEntity(_0x2fa351,null))['catch'](handleError(_0x2fa351,null));}; \ No newline at end of file +var _0x38d0=['bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','error','stack','name','send','model','keys','query','filters','attributes','intersection','fields','length','includeAll','merge','options','ChatApplication','find','catch','update','body','params','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x4342f0,_0x3009c8){var _0x5ce9f0=function(_0x576eed){while(--_0x576eed){_0x4342f0['push'](_0x4342f0['shift']());}};_0x5ce9f0(++_0x3009c8);}(_0x38d0,0x123));var _0x038d=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x38d0[_0x17b6e3];return _0x3906f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x038d('0x0'));var zipdir=require(_0x038d('0x1'));var jsonpatch=require(_0x038d('0x2'));var rp=require('request-promise');var moment=require(_0x038d('0x3'));var BPromise=require(_0x038d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x038d('0x5'));var sox=require('sox');var csv=require(_0x038d('0x6'));var ejs=require(_0x038d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x038d('0x8'));var squel=require(_0x038d('0x9'));var crypto=require(_0x038d('0xa'));var jsforce=require(_0x038d('0xb'));var deskjs=require(_0x038d('0xc'));var toCsv=require(_0x038d('0x6'));var querystring=require(_0x038d('0xd'));var Papa=require(_0x038d('0xe'));var Redis=require(_0x038d('0xf'));var authService=require(_0x038d('0x10'));var qs=require(_0x038d('0x11'));var as=require(_0x038d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x038d('0x13'))(_0x038d('0x14'));var utils=require(_0x038d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x038d('0x16'));var db=require(_0x038d('0x17'))['db'];function respondWithStatusCode(_0x1be329,_0x225683){_0x225683=_0x225683||0xcc;return function(_0x12c34d){if(_0x12c34d){return _0x1be329[_0x038d('0x18')](_0x225683);}return _0x1be329[_0x038d('0x19')](_0x225683)[_0x038d('0x1a')]();};}function respondWithResult(_0x4311b8,_0x4e78d3){_0x4e78d3=_0x4e78d3||0xc8;return function(_0x5adcd5){if(_0x5adcd5){return _0x4311b8['status'](_0x4e78d3)[_0x038d('0x1b')](_0x5adcd5);}};}function respondWithFilteredResult(_0x3ab49a,_0x4c36ee){return function(_0x4b7bfb){if(_0x4b7bfb){var _0x4e4960=typeof _0x4c36ee['offset']===_0x038d('0x1c')&&typeof _0x4c36ee[_0x038d('0x1d')]===_0x038d('0x1c');var _0x2b5feb=_0x4b7bfb[_0x038d('0x1e')];var _0x42c17f=_0x4e4960?0x0:_0x4c36ee[_0x038d('0x1f')];var _0x40c307=_0x4e4960?_0x4b7bfb[_0x038d('0x1e')]:_0x4c36ee[_0x038d('0x1f')]+_0x4c36ee[_0x038d('0x1d')];var _0x21773e;if(_0x40c307>=_0x2b5feb){_0x40c307=_0x2b5feb;_0x21773e=0xc8;}else{_0x21773e=0xce;}_0x3ab49a[_0x038d('0x19')](_0x21773e);return _0x3ab49a[_0x038d('0x20')]('Content-Range',_0x42c17f+'-'+_0x40c307+'/'+_0x2b5feb)['json'](_0x4b7bfb);}return null;};}function patchUpdates(_0x42b6af){return function(_0x42ab21){try{jsonpatch[_0x038d('0x21')](_0x42ab21,_0x42b6af,!![]);}catch(_0x1a8efc){return BPromise[_0x038d('0x22')](_0x1a8efc);}return _0x42ab21[_0x038d('0x23')]();};}function saveUpdates(_0x40586e,_0x4eb93e){return function(_0x89c6f1){if(_0x89c6f1){return _0x89c6f1['update'](_0x40586e)[_0x038d('0x24')](function(_0x4eaaff){return _0x4eaaff;});}return null;};}function removeEntity(_0x5ea43b,_0x19e932){return function(_0x3611ff){if(_0x3611ff){return _0x3611ff[_0x038d('0x25')]()[_0x038d('0x24')](function(){_0x5ea43b[_0x038d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x107d51,_0x3e1286){return function(_0x1dc3f3){if(!_0x1dc3f3){_0x107d51['sendStatus'](0x194);}return _0x1dc3f3;};}function handleError(_0x593d4a,_0x525908){_0x525908=_0x525908||0x1f4;return function(_0x4379d9){logger[_0x038d('0x26')](_0x4379d9[_0x038d('0x27')]);if(_0x4379d9[_0x038d('0x28')]){delete _0x4379d9[_0x038d('0x28')];}_0x593d4a[_0x038d('0x19')](_0x525908)[_0x038d('0x29')](_0x4379d9);};}exports['show']=function(_0x5044db,_0x2c0b46){var _0x1f7cdb={'raw':!![],'where':{'id':_0x5044db['params']['id']}},_0x33fa99={};_0x33fa99[_0x038d('0x2a')]=_[_0x038d('0x2b')](db['ChatApplication']['rawAttributes']);_0x33fa99[_0x038d('0x2c')]=_[_0x038d('0x2b')](_0x5044db[_0x038d('0x2c')]);_0x33fa99[_0x038d('0x2d')]=_['intersection'](_0x33fa99[_0x038d('0x2a')],_0x33fa99['query']);_0x1f7cdb[_0x038d('0x2e')]=_[_0x038d('0x2f')](_0x33fa99['model'],qs[_0x038d('0x30')](_0x5044db[_0x038d('0x2c')][_0x038d('0x30')]));_0x1f7cdb['attributes']=_0x1f7cdb[_0x038d('0x2e')][_0x038d('0x31')]?_0x1f7cdb['attributes']:_0x33fa99[_0x038d('0x2a')];if(_0x5044db[_0x038d('0x2c')][_0x038d('0x32')]){_0x1f7cdb['include']=[{'all':!![]}];}_0x1f7cdb=_[_0x038d('0x33')]({},_0x1f7cdb,_0x5044db[_0x038d('0x34')]);return db[_0x038d('0x35')][_0x038d('0x36')](_0x1f7cdb)['then'](handleEntityNotFound(_0x2c0b46,null))[_0x038d('0x24')](respondWithResult(_0x2c0b46,null))[_0x038d('0x37')](handleError(_0x2c0b46,null));};exports[_0x038d('0x38')]=function(_0x38dafe,_0x27da2b){if(_0x38dafe['body']['id']){delete _0x38dafe[_0x038d('0x39')]['id'];}return db[_0x038d('0x35')][_0x038d('0x36')]({'where':{'id':_0x38dafe[_0x038d('0x3a')]['id']}})['then'](handleEntityNotFound(_0x27da2b,null))[_0x038d('0x24')](saveUpdates(_0x38dafe[_0x038d('0x39')],null))[_0x038d('0x24')](respondWithResult(_0x27da2b,null))[_0x038d('0x37')](handleError(_0x27da2b,null));};exports['destroy']=function(_0x2cf043,_0x37f749){return db['ChatApplication'][_0x038d('0x36')]({'where':{'id':_0x2cf043['params']['id']}})[_0x038d('0x24')](handleEntityNotFound(_0x37f749,null))[_0x038d('0x24')](removeEntity(_0x37f749,null))['catch'](handleError(_0x37f749,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index ea8c505..e93449a 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 _0x1784=['api','moment','bluebird','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1784,0x1ec));var _0x4178=function(_0x11d830,_0x116d43){_0x11d830=_0x11d830-0x0;var _0x4868e7=_0x1784[_0x11d830];return _0x4868e7;};'use strict';var _=require(_0x4178('0x0'));var util=require('util');var logger=require(_0x4178('0x1'))(_0x4178('0x2'));var moment=require(_0x4178('0x3'));var BPromise=require(_0x4178('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4178('0x5'));var rimraf=require('rimraf');var config=require(_0x4178('0x6'));var attributes=require(_0x4178('0x7'));module[_0x4178('0x8')]=function(_0x267e40,_0x336182){return _0x267e40[_0x4178('0x9')](_0x4178('0xa'),attributes,{'tableName':_0x4178('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4178('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9d92=['chat_applications','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication'];(function(_0x4605c6,_0x2f14a8){var _0x802e63=function(_0x37a91d){while(--_0x37a91d){_0x4605c6['push'](_0x4605c6['shift']());}};_0x802e63(++_0x2f14a8);}(_0x9d92,0xdf));var _0x29d9=function(_0x286726,_0x20a337){_0x286726=_0x286726-0x0;var _0xcd4fe9=_0x9d92[_0x286726];return _0xcd4fe9;};'use strict';var _=require(_0x29d9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x29d9('0x1'));var moment=require(_0x29d9('0x2'));var BPromise=require('bluebird');var rp=require(_0x29d9('0x3'));var fs=require('fs');var path=require(_0x29d9('0x4'));var rimraf=require(_0x29d9('0x5'));var config=require(_0x29d9('0x6'));var attributes=require(_0x29d9('0x7'));module[_0x29d9('0x8')]=function(_0x27d032,_0x52932b){return _0x27d032[_0x29d9('0x9')](_0x29d9('0xa'),attributes,{'tableName':_0x29d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x29d9('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 5bb1c7e..556326e 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 _0x6557=['ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code','message','result','catch','error','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x6557,0x77));var _0x7655=function(_0x28ae4f,_0x895596){_0x28ae4f=_0x28ae4f-0x0;var _0x535310=_0x6557[_0x28ae4f];return _0x535310;};'use strict';var _=require(_0x7655('0x0'));var util=require('util');var moment=require(_0x7655('0x1'));var BPromise=require(_0x7655('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7655('0x3'));var db=require(_0x7655('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7655('0x5'));var config=require(_0x7655('0x6'));var jayson=require(_0x7655('0x7'));var client=jayson[_0x7655('0x8')][_0x7655('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3788af,_0x292a4b,_0x2a1537){return new BPromise(function(_0xae6ac,_0x1fdad4){return client[_0x7655('0xa')](_0x3788af,_0x2a1537)[_0x7655('0xb')](function(_0xe643d6){logger[_0x7655('0xc')](_0x7655('0xd'),_0x292a4b,_0x7655('0xe'));logger['debug'](_0x7655('0xf'),_0x292a4b,_0x7655('0xe'),JSON[_0x7655('0x10')](_0xe643d6));if(_0xe643d6['error']){if(_0xe643d6['error'][_0x7655('0x11')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x292a4b,_0xe643d6['error'][_0x7655('0x12')]);return _0x1fdad4(_0xe643d6['error'][_0x7655('0x12')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x292a4b,_0xe643d6['error'][_0x7655('0x12')]);return _0xae6ac(_0xe643d6['error']['message']);}else{logger[_0x7655('0xc')](_0x7655('0xd'),_0x292a4b,_0x7655('0xe'));_0xae6ac(_0xe643d6[_0x7655('0x13')][_0x7655('0x12')]);}})[_0x7655('0x14')](function(_0x4ca5f6){logger[_0x7655('0x15')](_0x7655('0xd'),_0x292a4b,_0x4ca5f6);_0x1fdad4(_0x4ca5f6);});});} \ No newline at end of file +var _0x106e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x1fd1af,_0x341040){var _0xd5c2c4=function(_0x3c4d75){while(--_0x3c4d75){_0x1fd1af['push'](_0x1fd1af['shift']());}};_0xd5c2c4(++_0x341040);}(_0x106e,0x1c8));var _0xe106=function(_0x35ab5f,_0x3032d1){_0x35ab5f=_0x35ab5f-0x0;var _0x240cf5=_0x106e[_0x35ab5f];return _0x240cf5;};'use strict';var _=require(_0xe106('0x0'));var util=require(_0xe106('0x1'));var moment=require(_0xe106('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe106('0x3'));var db=require(_0xe106('0x4'))['db'];var utils=require(_0xe106('0x5'));var logger=require(_0xe106('0x6'))(_0xe106('0x7'));var config=require(_0xe106('0x8'));var jayson=require(_0xe106('0x9'));var client=jayson[_0xe106('0xa')][_0xe106('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a395f,_0x4fcc9a,_0x4d51d7){return new BPromise(function(_0x1e52a3,_0x1f1070){return client['request'](_0x1a395f,_0x4d51d7)['then'](function(_0x4ed57c){logger[_0xe106('0xc')]('ChatApplication,\x20%s,\x20%s',_0x4fcc9a,_0xe106('0xd'));logger[_0xe106('0xe')](_0xe106('0xf'),_0x4fcc9a,_0xe106('0xd'),JSON[_0xe106('0x10')](_0x4ed57c));if(_0x4ed57c[_0xe106('0x11')]){if(_0x4ed57c['error']['code']===0x1f4){logger[_0xe106('0x11')](_0xe106('0x12'),_0x4fcc9a,_0x4ed57c[_0xe106('0x11')]['message']);return _0x1f1070(_0x4ed57c[_0xe106('0x11')][_0xe106('0x13')]);}logger[_0xe106('0x11')](_0xe106('0x12'),_0x4fcc9a,_0x4ed57c[_0xe106('0x11')]['message']);return _0x1e52a3(_0x4ed57c['error'][_0xe106('0x13')]);}else{logger['info'](_0xe106('0x12'),_0x4fcc9a,_0xe106('0xd'));_0x1e52a3(_0x4ed57c['result']['message']);}})[_0xe106('0x14')](function(_0x336899){logger[_0xe106('0x11')](_0xe106('0x12'),_0x4fcc9a,_0x336899);_0x1f1070(_0x336899);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index f5f5979..7f62270 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 _0x9ddd=['show','put','update','delete','destroy','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x59f1e6,_0xda13c5){var _0x2aada5=function(_0x5bf12c){while(--_0x5bf12c){_0x59f1e6['push'](_0x59f1e6['shift']());}};_0x2aada5(++_0xda13c5);}(_0x9ddd,0x67));var _0xd9dd=function(_0x4baac3,_0x13160f){_0x4baac3=_0x4baac3-0x0;var _0x36b864=_0x9ddd[_0x4baac3];return _0x36b864;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd9dd('0x0'));var timeout=require('connect-timeout');var express=require(_0xd9dd('0x1'));var router=express['Router']();var fs_extra=require(_0xd9dd('0x2'));var auth=require(_0xd9dd('0x3'));var interaction=require(_0xd9dd('0x4'));var config=require('../../config/environment');var controller=require(_0xd9dd('0x5'));router[_0xd9dd('0x6')](_0xd9dd('0x7'),auth[_0xd9dd('0x8')](),controller[_0xd9dd('0x9')]);router[_0xd9dd('0xa')](_0xd9dd('0x7'),auth[_0xd9dd('0x8')](),controller[_0xd9dd('0xb')]);router[_0xd9dd('0xc')]('/:id',auth[_0xd9dd('0x8')](),controller[_0xd9dd('0xd')]);module['exports']=router; \ No newline at end of file +var _0x8ef7=['put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show'];(function(_0x5bb018,_0xba9622){var _0x3ff29a=function(_0x57ad1e){while(--_0x57ad1e){_0x5bb018['push'](_0x5bb018['shift']());}};_0x3ff29a(++_0xba9622);}(_0x8ef7,0x1a3));var _0x78ef=function(_0x3666e6,_0x48a90b){_0x3666e6=_0x3666e6-0x0;var _0xf99c95=_0x8ef7[_0x3666e6];return _0xf99c95;};'use strict';var multer=require(_0x78ef('0x0'));var util=require(_0x78ef('0x1'));var path=require(_0x78ef('0x2'));var timeout=require(_0x78ef('0x3'));var express=require(_0x78ef('0x4'));var router=express[_0x78ef('0x5')]();var fs_extra=require(_0x78ef('0x6'));var auth=require(_0x78ef('0x7'));var interaction=require(_0x78ef('0x8'));var config=require(_0x78ef('0x9'));var controller=require('./chatApplication.controller');router[_0x78ef('0xa')](_0x78ef('0xb'),auth['isAuthenticated'](),controller[_0x78ef('0xc')]);router[_0x78ef('0xd')](_0x78ef('0xb'),auth[_0x78ef('0xe')](),controller[_0x78ef('0xf')]);router[_0x78ef('0x10')](_0x78ef('0xb'),auth['isAuthenticated'](),controller[_0x78ef('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 6209067..150c27c 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 _0xd0bd=['exports','STRING','sequelize'];(function(_0x4b14a1,_0x495496){var _0x310078=function(_0x304d74){while(--_0x304d74){_0x4b14a1['push'](_0x4b14a1['shift']());}};_0x310078(++_0x495496);}(_0xd0bd,0x191));var _0xdd0b=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0xd0bd[_0x513047];return _0x15b779;};'use strict';var Sequelize=require(_0xdd0b('0x0'));module[_0xdd0b('0x1')]={'name':{'type':Sequelize[_0xdd0b('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xaa38=['STRING','BOOLEAN'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0xaa38,0x150));var _0x8aa3=function(_0x117e6f,_0x1d2e57){_0x117e6f=_0x117e6f-0x0;var _0x5c3606=_0xaa38[_0x117e6f];return _0x5c3606;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8aa3('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x8aa3('0x0')]},'write':{'type':Sequelize[_0x8aa3('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 6188d6f..a0dd68c 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 _0x1107=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','ChatGroup','rawAttributes','fieldName','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','getMembers','findOne','User','order','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x1107,0x1d6));var _0x7110=function(_0xe7d655,_0x184955){_0xe7d655=_0xe7d655-0x0;var _0x3e4804=_0x1107[_0xe7d655];return _0x3e4804;};'use strict';var emlformat=require(_0x7110('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7110('0x1'));var jsonpatch=require(_0x7110('0x2'));var rp=require(_0x7110('0x3'));var moment=require(_0x7110('0x4'));var BPromise=require(_0x7110('0x5'));var Mustache=require(_0x7110('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7110('0x7'));var fs=require('fs');var fs_extra=require(_0x7110('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7110('0x9'));var jsforce=require(_0x7110('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7110('0xb'));var querystring=require('querystring');var Papa=require(_0x7110('0xc'));var Redis=require(_0x7110('0xd'));var authService=require(_0x7110('0xe'));var qs=require(_0x7110('0xf'));var as=require(_0x7110('0x10'));var hardwareService=require(_0x7110('0x11'));var logger=require(_0x7110('0x12'))(_0x7110('0x13'));var utils=require(_0x7110('0x14'));var config=require(_0x7110('0x15'));var licenseUtil=require(_0x7110('0x16'));var db=require(_0x7110('0x17'))['db'];config['redis']=_['defaults'](config[_0x7110('0x18')],{'host':_0x7110('0x19'),'port':0x18eb});var socket=require(_0x7110('0x1a'))(new Redis(config[_0x7110('0x18')]));require(_0x7110('0x1b'))[_0x7110('0x1c')](socket);function respondWithStatusCode(_0x5acab1,_0x13cb37){_0x13cb37=_0x13cb37||0xcc;return function(_0x53a557){if(_0x53a557){return _0x5acab1[_0x7110('0x1d')](_0x13cb37);}return _0x5acab1[_0x7110('0x1e')](_0x13cb37)[_0x7110('0x1f')]();};}function respondWithResult(_0x27f143,_0x5a5fd6){_0x5a5fd6=_0x5a5fd6||0xc8;return function(_0xfb75a4){if(_0xfb75a4){return _0x27f143[_0x7110('0x1e')](_0x5a5fd6)['json'](_0xfb75a4);}};}function respondWithFilteredResult(_0x1763e1,_0x32df84){return function(_0x354740){if(_0x354740){var _0x3139c0=typeof _0x32df84['offset']===_0x7110('0x20')&&typeof _0x32df84[_0x7110('0x21')]===_0x7110('0x20');var _0x48c78c=_0x354740['count'];var _0x1adf1b=_0x3139c0?0x0:_0x32df84[_0x7110('0x22')];var _0x19741a=_0x3139c0?_0x354740[_0x7110('0x23')]:_0x32df84[_0x7110('0x22')]+_0x32df84[_0x7110('0x21')];var _0x5cbe64;if(_0x19741a>=_0x48c78c){_0x19741a=_0x48c78c;_0x5cbe64=0xc8;}else{_0x5cbe64=0xce;}_0x1763e1['status'](_0x5cbe64);return _0x1763e1[_0x7110('0x24')](_0x7110('0x25'),_0x1adf1b+'-'+_0x19741a+'/'+_0x48c78c)[_0x7110('0x26')](_0x354740);}return null;};}function patchUpdates(_0x242177){return function(_0x34759b){try{jsonpatch[_0x7110('0x27')](_0x34759b,_0x242177,!![]);}catch(_0x4011e3){return BPromise[_0x7110('0x28')](_0x4011e3);}return _0x34759b[_0x7110('0x29')]();};}function saveUpdates(_0x4de02a,_0x9442a7){return function(_0x43897d){if(_0x43897d){return _0x43897d[_0x7110('0x2a')](_0x4de02a)[_0x7110('0x2b')](function(_0x4b670){return _0x4b670;});}return null;};}function removeEntity(_0x3786e5,_0x330b21){return function(_0x1e1768){if(_0x1e1768){return _0x1e1768[_0x7110('0x2c')]()[_0x7110('0x2b')](function(){_0x3786e5[_0x7110('0x1e')](0xcc)[_0x7110('0x1f')]();});}};}function handleEntityNotFound(_0xe513e1,_0x36f347){return function(_0xc144f9){if(!_0xc144f9){_0xe513e1[_0x7110('0x1d')](0x194);}return _0xc144f9;};}function handleError(_0x22a107,_0x35aa60){_0x35aa60=_0x35aa60||0x1f4;return function(_0x491fe7){logger['error'](_0x491fe7[_0x7110('0x2d')]);if(_0x491fe7[_0x7110('0x2e')]){delete _0x491fe7[_0x7110('0x2e')];}_0x22a107[_0x7110('0x1e')](_0x35aa60)[_0x7110('0x2f')](_0x491fe7);};}exports['index']=function(_0x20d8a6,_0x1618e8){var _0x5bc6b3={},_0x4c3a8e={},_0x9a71b9={'count':0x0,'rows':[]};var _0x453f04=_['map'](db[_0x7110('0x30')][_0x7110('0x31')],function(_0x57da63){return{'name':_0x57da63[_0x7110('0x32')],'type':_0x57da63['type']['key']};});_0x4c3a8e['model']=_['map'](_0x453f04,_0x7110('0x2e'));_0x4c3a8e['query']=_['keys'](_0x20d8a6[_0x7110('0x33')]);_0x4c3a8e['filters']=_[_0x7110('0x34')](_0x4c3a8e[_0x7110('0x35')],_0x4c3a8e[_0x7110('0x33')]);_0x5bc6b3[_0x7110('0x36')]=_[_0x7110('0x34')](_0x4c3a8e[_0x7110('0x35')],qs[_0x7110('0x37')](_0x20d8a6[_0x7110('0x33')][_0x7110('0x37')]));_0x5bc6b3[_0x7110('0x36')]=_0x5bc6b3[_0x7110('0x36')][_0x7110('0x38')]?_0x5bc6b3[_0x7110('0x36')]:_0x4c3a8e['model'];if(!_0x20d8a6[_0x7110('0x33')][_0x7110('0x39')](_0x7110('0x3a'))){_0x5bc6b3[_0x7110('0x21')]=qs[_0x7110('0x21')](_0x20d8a6[_0x7110('0x33')][_0x7110('0x21')]);_0x5bc6b3['offset']=qs[_0x7110('0x22')](_0x20d8a6[_0x7110('0x33')]['offset']);}_0x5bc6b3['order']=qs[_0x7110('0x3b')](_0x20d8a6[_0x7110('0x33')][_0x7110('0x3b')]);_0x5bc6b3[_0x7110('0x3c')]=qs[_0x7110('0x3d')](_[_0x7110('0x3e')](_0x20d8a6['query'],_0x4c3a8e[_0x7110('0x3d')]),_0x453f04);if(_0x20d8a6['query'][_0x7110('0x3f')]){_0x5bc6b3[_0x7110('0x3c')]=_[_0x7110('0x40')](_0x5bc6b3['where'],{'$or':_[_0x7110('0x41')](_0x453f04,function(_0x2ffea5){if(_0x2ffea5['type']!==_0x7110('0x42')){var _0x3b352f={};_0x3b352f[_0x2ffea5[_0x7110('0x2e')]]={'$like':'%'+_0x20d8a6[_0x7110('0x33')]['filter']+'%'};return _0x3b352f;}})});}_0x5bc6b3=_[_0x7110('0x40')]({},_0x5bc6b3,_0x20d8a6[_0x7110('0x43')]);var _0x5a35c0={'where':_0x5bc6b3[_0x7110('0x3c')]};return db[_0x7110('0x30')][_0x7110('0x23')](_0x5a35c0)[_0x7110('0x2b')](function(_0x4aad69){_0x9a71b9[_0x7110('0x23')]=_0x4aad69;if(_0x20d8a6['query'][_0x7110('0x44')]){_0x5bc6b3['include']=[{'all':!![]}];}return db[_0x7110('0x30')][_0x7110('0x45')](_0x5bc6b3);})[_0x7110('0x2b')](function(_0x375d23){_0x9a71b9[_0x7110('0x46')]=_0x375d23;return _0x9a71b9;})[_0x7110('0x2b')](respondWithFilteredResult(_0x1618e8,_0x5bc6b3))[_0x7110('0x47')](handleError(_0x1618e8,null));};exports[_0x7110('0x48')]=function(_0xa935ec,_0x5cc83b){var _0x3b6a5b={'raw':!![],'where':{'id':_0xa935ec[_0x7110('0x49')]['id']}},_0x3ffd15={};_0x3ffd15[_0x7110('0x35')]=_[_0x7110('0x4a')](db[_0x7110('0x30')][_0x7110('0x31')]);_0x3ffd15['query']=_['keys'](_0xa935ec[_0x7110('0x33')]);_0x3ffd15[_0x7110('0x3d')]=_[_0x7110('0x34')](_0x3ffd15[_0x7110('0x35')],_0x3ffd15[_0x7110('0x33')]);_0x3b6a5b['attributes']=_[_0x7110('0x34')](_0x3ffd15[_0x7110('0x35')],qs[_0x7110('0x37')](_0xa935ec[_0x7110('0x33')][_0x7110('0x37')]));_0x3b6a5b['attributes']=_0x3b6a5b[_0x7110('0x36')][_0x7110('0x38')]?_0x3b6a5b[_0x7110('0x36')]:_0x3ffd15[_0x7110('0x35')];if(_0xa935ec[_0x7110('0x33')][_0x7110('0x44')]){_0x3b6a5b[_0x7110('0x4b')]=[{'all':!![]}];}_0x3b6a5b=_[_0x7110('0x40')]({},_0x3b6a5b,_0xa935ec[_0x7110('0x43')]);return db['ChatGroup'][_0x7110('0x4c')](_0x3b6a5b)[_0x7110('0x2b')](handleEntityNotFound(_0x5cc83b,null))[_0x7110('0x2b')](respondWithResult(_0x5cc83b,null))['catch'](handleError(_0x5cc83b,null));};exports[_0x7110('0x4d')]=function(_0x57eaa4,_0x457aba){return db[_0x7110('0x30')][_0x7110('0x4d')](_0x57eaa4[_0x7110('0x4e')],{})['then'](respondWithResult(_0x457aba,0xc9))[_0x7110('0x47')](handleError(_0x457aba,null));};exports[_0x7110('0x2a')]=function(_0x4e8be0,_0x239a71){if(_0x4e8be0[_0x7110('0x4e')]['id']){delete _0x4e8be0['body']['id'];}return db[_0x7110('0x30')][_0x7110('0x4c')]({'where':{'id':_0x4e8be0[_0x7110('0x49')]['id']}})[_0x7110('0x2b')](handleEntityNotFound(_0x239a71,null))[_0x7110('0x2b')](saveUpdates(_0x4e8be0[_0x7110('0x4e')],null))[_0x7110('0x2b')](respondWithResult(_0x239a71,null))['catch'](handleError(_0x239a71,null));};exports[_0x7110('0x2c')]=function(_0x2e6aa0,_0x4ee6b8){return db[_0x7110('0x30')][_0x7110('0x4c')]({'where':{'id':_0x2e6aa0[_0x7110('0x49')]['id']}})['then'](handleEntityNotFound(_0x4ee6b8,null))['then'](removeEntity(_0x4ee6b8,null))[_0x7110('0x47')](handleError(_0x4ee6b8,null));};exports[_0x7110('0x4f')]=function(_0x2128db,_0x580d9a){return db['ChatGroup'][_0x7110('0x4f')]()[_0x7110('0x2b')](respondWithResult(_0x580d9a,null))[_0x7110('0x47')](handleError(_0x580d9a,null));};exports[_0x7110('0x50')]=function(_0x15c63b,_0x3f6bc6,_0x2a442b){return db[_0x7110('0x51')][_0x7110('0x23')]({'where':{'ChatGroupId':_0x15c63b[_0x7110('0x49')]['id'],'ToId':_0x15c63b[_0x7110('0x52')]['id'],'read':![]}})[_0x7110('0x2b')](function(_0x312d03){return{'id':_[_0x7110('0x53')](_0x15c63b[_0x7110('0x49')]['id']),'count':_0x312d03};})[_0x7110('0x2b')](respondWithResult(_0x3f6bc6,null))[_0x7110('0x47')](handleError(_0x3f6bc6,null));};exports[_0x7110('0x54')]=function(_0xe4e967,_0x3cab2f,_0x249809){return db[_0x7110('0x30')][_0x7110('0x4c')]({'where':{'id':_0xe4e967[_0x7110('0x49')]['id']}})[_0x7110('0x2b')](handleEntityNotFound(_0x3cab2f,null))['then'](function(_0x1630d9){if(_0x1630d9){return _0x1630d9[_0x7110('0x54')](_0xe4e967['body']['ids'],_['omit'](_0xe4e967[_0x7110('0x4e')],['ids','id'])||{});}})[_0x7110('0x2b')](respondWithResult(_0x3cab2f,null))[_0x7110('0x47')](handleError(_0x3cab2f,null));};exports[_0x7110('0x55')]=function(_0x52c311,_0x33e009,_0x590bdc){var _0xdf044f={};var _0x48c9d0={};var _0x3292f4;var _0x4d49cc;return db[_0x7110('0x30')][_0x7110('0x56')]({'where':{'id':_0x52c311[_0x7110('0x49')]['id']}})[_0x7110('0x2b')](handleEntityNotFound(_0x33e009,null))[_0x7110('0x2b')](function(_0x3bd3ca){if(_0x3bd3ca){_0x3292f4=_0x3bd3ca;_0x48c9d0['model']=_[_0x7110('0x4a')](db[_0x7110('0x57')][_0x7110('0x31')]);_0x48c9d0[_0x7110('0x33')]=_[_0x7110('0x4a')](_0x52c311[_0x7110('0x33')]);_0x48c9d0['filters']=_[_0x7110('0x34')](_0x48c9d0[_0x7110('0x35')],_0x48c9d0['query']);_0xdf044f[_0x7110('0x36')]=_[_0x7110('0x34')](_0x48c9d0['model'],qs[_0x7110('0x37')](_0x52c311[_0x7110('0x33')][_0x7110('0x37')]));_0xdf044f['attributes']=_0xdf044f[_0x7110('0x36')][_0x7110('0x38')]?_0xdf044f[_0x7110('0x36')]:_0x48c9d0[_0x7110('0x35')];_0xdf044f[_0x7110('0x58')]=qs['sort'](_0x52c311[_0x7110('0x33')][_0x7110('0x3b')]);_0xdf044f[_0x7110('0x3c')]=qs['filters'](_['pick'](_0x52c311[_0x7110('0x33')],_0x48c9d0[_0x7110('0x3d')]));if(_0x52c311['query'][_0x7110('0x3f')]){_0xdf044f[_0x7110('0x3c')]=_[_0x7110('0x40')](_0xdf044f[_0x7110('0x3c')],{'$or':_[_0x7110('0x41')](_0xdf044f[_0x7110('0x36')],function(_0x46c2d6){var _0x2e5699={};_0x2e5699[_0x46c2d6]={'$like':'%'+_0x52c311['query']['filter']+'%'};return _0x2e5699;})});}_0xdf044f=_[_0x7110('0x40')]({},_0xdf044f,_0x52c311[_0x7110('0x43')]);return _0x3292f4[_0x7110('0x55')](_0xdf044f);}})[_0x7110('0x2b')](function(_0x77e1fa){if(_0x77e1fa){_0x4d49cc=_0x77e1fa['length'];if(!_0x52c311[_0x7110('0x33')][_0x7110('0x39')](_0x7110('0x3a'))){_0xdf044f['limit']=qs[_0x7110('0x21')](_0x52c311['query']['limit']);_0xdf044f[_0x7110('0x22')]=qs[_0x7110('0x22')](_0x52c311['query'][_0x7110('0x22')]);}return _0x3292f4['getMembers'](_0xdf044f);}})[_0x7110('0x2b')](function(_0xfaca7a){if(_0xfaca7a){return _0xfaca7a?{'count':_0x4d49cc,'rows':_0xfaca7a}:null;}})[_0x7110('0x2b')](respondWithResult(_0x33e009,null))[_0x7110('0x47')](handleError(_0x33e009,null));};exports[_0x7110('0x59')]=function(_0x11c9e8,_0x56a27a,_0x576c5a){return db[_0x7110('0x30')][_0x7110('0x4c')]({'where':{'id':_0x11c9e8[_0x7110('0x49')]['id']}})[_0x7110('0x2b')](handleEntityNotFound(_0x56a27a,null))[_0x7110('0x2b')](function(_0x11e791){if(_0x11e791){return _0x11e791['removeMembers'](_0x11c9e8[_0x7110('0x33')][_0x7110('0x5a')]);}})[_0x7110('0x2b')](respondWithStatusCode(_0x56a27a,null))['catch'](handleError(_0x56a27a,null));};exports[_0x7110('0x5b')]=function(_0xaa0696,_0x4f02a3,_0x593ef9){if(_0xaa0696[_0x7110('0x4e')]['id']){delete _0xaa0696[_0x7110('0x4e')]['id'];}return db[_0x7110('0x30')]['find']({'where':{'id':_0xaa0696['params']['id']}})[_0x7110('0x2b')](handleEntityNotFound(_0x4f02a3,null))['then'](function(_0x5dbabf){if(_0x5dbabf){_0xaa0696[_0x7110('0x4e')][_0x7110('0x5c')]=_0x5dbabf['id'];return db[_0x7110('0x51')][_0x7110('0x4d')](_0xaa0696[_0x7110('0x4e')]);}})[_0x7110('0x2b')](respondWithResult(_0x4f02a3,null))[_0x7110('0x47')](handleError(_0x4f02a3,null));};exports[_0x7110('0x5d')]=function(_0x43aa3a,_0x4a28c6,_0x356596){var _0x35e860={};var _0x3a4adf={};var _0x40d657;var _0x30d69e;return db[_0x7110('0x30')][_0x7110('0x56')]({'where':{'id':_0x43aa3a['params']['id']}})[_0x7110('0x2b')](handleEntityNotFound(_0x4a28c6,null))['then'](function(_0x445cb5){if(_0x445cb5){_0x40d657=_0x445cb5;_0x3a4adf[_0x7110('0x35')]=_['keys'](db['ChatInternalMessage'][_0x7110('0x31')]);_0x3a4adf[_0x7110('0x33')]=_[_0x7110('0x4a')](_0x43aa3a[_0x7110('0x33')]);_0x3a4adf[_0x7110('0x3d')]=_[_0x7110('0x34')](_0x3a4adf[_0x7110('0x35')],_0x3a4adf[_0x7110('0x33')]);_0x35e860[_0x7110('0x36')]=_[_0x7110('0x34')](_0x3a4adf[_0x7110('0x35')],qs[_0x7110('0x37')](_0x43aa3a[_0x7110('0x33')][_0x7110('0x37')]));_0x35e860[_0x7110('0x36')]=_0x35e860[_0x7110('0x36')][_0x7110('0x38')]?_0x35e860[_0x7110('0x36')]:_0x3a4adf[_0x7110('0x35')];_0x35e860[_0x7110('0x58')]=qs[_0x7110('0x3b')](_0x43aa3a['query']['sort']);_0x35e860[_0x7110('0x3c')]=qs[_0x7110('0x3d')](_[_0x7110('0x3e')](_0x43aa3a[_0x7110('0x33')],_0x3a4adf['filters']));if(_0x43aa3a['query'][_0x7110('0x3f')]){_0x35e860[_0x7110('0x3c')]=_[_0x7110('0x40')](_0x35e860[_0x7110('0x3c')],{'$or':_[_0x7110('0x41')](_0x35e860['attributes'],function(_0x258e6c){var _0x310513={};_0x310513[_0x258e6c]={'$like':'%'+_0x43aa3a[_0x7110('0x33')][_0x7110('0x3f')]+'%'};return _0x310513;})});}if(_0x43aa3a['query'][_0x7110('0x5e')]){var _0x5e0e42=_0x43aa3a[_0x7110('0x33')]['$gte'][_0x7110('0x5f')](',');var _0x40065e={};_0x40065e[_0x5e0e42[0x0]]={'$gte':moment(_0x5e0e42[0x1])[_0x7110('0x60')](_0x7110('0x61'))};_0x35e860['where']=_['merge'](_0x35e860[_0x7110('0x3c')],_0x40065e);}_0x35e860=_[_0x7110('0x40')]({},_0x35e860,_0x43aa3a[_0x7110('0x43')]);return _0x40d657[_0x7110('0x5d')](_0x35e860);}})[_0x7110('0x2b')](function(_0x265954){if(_0x265954){_0x30d69e=_0x265954[_0x7110('0x38')];if(!_0x43aa3a[_0x7110('0x33')]['hasOwnProperty']('nolimit')){_0x35e860[_0x7110('0x21')]=qs['limit'](_0x43aa3a['query'][_0x7110('0x21')]);_0x35e860[_0x7110('0x22')]=qs['offset'](_0x43aa3a[_0x7110('0x33')]['offset']);}return _0x40d657['getMessages'](_0x35e860);}})[_0x7110('0x2b')](function(_0x3e4299){if(_0x3e4299){return _0x3e4299?{'count':_0x30d69e,'rows':_0x3e4299}:null;}})[_0x7110('0x2b')](respondWithResult(_0x4a28c6,null))[_0x7110('0x47')](handleError(_0x4a28c6,null));}; \ No newline at end of file +var _0x2561=['type','key','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','hasOwnProperty','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x2561,0x162));var _0x1256=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x2561[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x1256('0x0'));var rimraf=require(_0x1256('0x1'));var zipdir=require(_0x1256('0x2'));var jsonpatch=require(_0x1256('0x3'));var rp=require(_0x1256('0x4'));var moment=require('moment');var BPromise=require(_0x1256('0x5'));var Mustache=require(_0x1256('0x6'));var util=require(_0x1256('0x7'));var path=require(_0x1256('0x8'));var sox=require(_0x1256('0x9'));var csv=require(_0x1256('0xa'));var ejs=require(_0x1256('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1256('0xc'));var jsforce=require(_0x1256('0xd'));var deskjs=require(_0x1256('0xe'));var toCsv=require(_0x1256('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1256('0xf'));var authService=require(_0x1256('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1256('0x11'));var hardwareService=require(_0x1256('0x12'));var logger=require(_0x1256('0x13'))('api');var utils=require(_0x1256('0x14'));var config=require(_0x1256('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1256('0x16'))['db'];config[_0x1256('0x17')]=_[_0x1256('0x18')](config[_0x1256('0x17')],{'host':_0x1256('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1256('0x1a'))[_0x1256('0x1b')](socket);function respondWithStatusCode(_0x25ae2e,_0x31e19f){_0x31e19f=_0x31e19f||0xcc;return function(_0x34df37){if(_0x34df37){return _0x25ae2e[_0x1256('0x1c')](_0x31e19f);}return _0x25ae2e[_0x1256('0x1d')](_0x31e19f)[_0x1256('0x1e')]();};}function respondWithResult(_0x2b43a8,_0x53382b){_0x53382b=_0x53382b||0xc8;return function(_0x3c5f58){if(_0x3c5f58){return _0x2b43a8[_0x1256('0x1d')](_0x53382b)[_0x1256('0x1f')](_0x3c5f58);}};}function respondWithFilteredResult(_0x3b9b99,_0x375c3a){return function(_0x2f6ae2){if(_0x2f6ae2){var _0x2dc1fa=typeof _0x375c3a[_0x1256('0x20')]===_0x1256('0x21')&&typeof _0x375c3a[_0x1256('0x22')]===_0x1256('0x21');var _0x1ca75e=_0x2f6ae2[_0x1256('0x23')];var _0x91d0ba=_0x2dc1fa?0x0:_0x375c3a[_0x1256('0x20')];var _0x115948=_0x2dc1fa?_0x2f6ae2['count']:_0x375c3a['offset']+_0x375c3a[_0x1256('0x22')];var _0x47e493;if(_0x115948>=_0x1ca75e){_0x115948=_0x1ca75e;_0x47e493=0xc8;}else{_0x47e493=0xce;}_0x3b9b99[_0x1256('0x1d')](_0x47e493);return _0x3b9b99[_0x1256('0x24')](_0x1256('0x25'),_0x91d0ba+'-'+_0x115948+'/'+_0x1ca75e)[_0x1256('0x1f')](_0x2f6ae2);}return null;};}function patchUpdates(_0x8799dd){return function(_0x47bdff){try{jsonpatch['apply'](_0x47bdff,_0x8799dd,!![]);}catch(_0x3b2284){return BPromise[_0x1256('0x26')](_0x3b2284);}return _0x47bdff[_0x1256('0x27')]();};}function saveUpdates(_0x56d141,_0x23caab){return function(_0x4a99df){if(_0x4a99df){return _0x4a99df[_0x1256('0x28')](_0x56d141)[_0x1256('0x29')](function(_0x1b7fed){return _0x1b7fed;});}return null;};}function removeEntity(_0x23601c,_0x51349d){return function(_0x46a45e){if(_0x46a45e){return _0x46a45e[_0x1256('0x2a')]()['then'](function(){_0x23601c['status'](0xcc)[_0x1256('0x1e')]();});}};}function handleEntityNotFound(_0x381c50,_0x466979){return function(_0x1b13af){if(!_0x1b13af){_0x381c50[_0x1256('0x1c')](0x194);}return _0x1b13af;};}function handleError(_0x5273d7,_0x5dbedc){_0x5dbedc=_0x5dbedc||0x1f4;return function(_0x539fdf){logger[_0x1256('0x2b')](_0x539fdf[_0x1256('0x2c')]);if(_0x539fdf[_0x1256('0x2d')]){delete _0x539fdf[_0x1256('0x2d')];}_0x5273d7['status'](_0x5dbedc)[_0x1256('0x2e')](_0x539fdf);};}exports[_0x1256('0x2f')]=function(_0x19a6ed,_0x3506ff){var _0x48e518={},_0x376f4e={},_0x31104e={'count':0x0,'rows':[]};var _0x36230b=_['map'](db['ChatGroup'][_0x1256('0x30')],function(_0x4e2fe5){return{'name':_0x4e2fe5[_0x1256('0x31')],'type':_0x4e2fe5[_0x1256('0x32')][_0x1256('0x33')]};});_0x376f4e[_0x1256('0x34')]=_[_0x1256('0x35')](_0x36230b,_0x1256('0x2d'));_0x376f4e[_0x1256('0x36')]=_['keys'](_0x19a6ed[_0x1256('0x36')]);_0x376f4e[_0x1256('0x37')]=_[_0x1256('0x38')](_0x376f4e[_0x1256('0x34')],_0x376f4e[_0x1256('0x36')]);_0x48e518[_0x1256('0x39')]=_[_0x1256('0x38')](_0x376f4e[_0x1256('0x34')],qs['fields'](_0x19a6ed['query'][_0x1256('0x3a')]));_0x48e518['attributes']=_0x48e518['attributes'][_0x1256('0x3b')]?_0x48e518[_0x1256('0x39')]:_0x376f4e[_0x1256('0x34')];if(!_0x19a6ed['query']['hasOwnProperty']('nolimit')){_0x48e518[_0x1256('0x22')]=qs['limit'](_0x19a6ed[_0x1256('0x36')][_0x1256('0x22')]);_0x48e518[_0x1256('0x20')]=qs[_0x1256('0x20')](_0x19a6ed[_0x1256('0x36')][_0x1256('0x20')]);}_0x48e518[_0x1256('0x3c')]=qs[_0x1256('0x3d')](_0x19a6ed[_0x1256('0x36')]['sort']);_0x48e518[_0x1256('0x3e')]=qs[_0x1256('0x37')](_[_0x1256('0x3f')](_0x19a6ed[_0x1256('0x36')],_0x376f4e['filters']),_0x36230b);if(_0x19a6ed[_0x1256('0x36')][_0x1256('0x40')]){_0x48e518[_0x1256('0x3e')]=_[_0x1256('0x41')](_0x48e518[_0x1256('0x3e')],{'$or':_[_0x1256('0x35')](_0x36230b,function(_0x5eba1c){if(_0x5eba1c[_0x1256('0x32')]!==_0x1256('0x42')){var _0x34392d={};_0x34392d[_0x5eba1c[_0x1256('0x2d')]]={'$like':'%'+_0x19a6ed['query'][_0x1256('0x40')]+'%'};return _0x34392d;}})});}_0x48e518=_[_0x1256('0x41')]({},_0x48e518,_0x19a6ed[_0x1256('0x43')]);var _0x873166={'where':_0x48e518[_0x1256('0x3e')]};return db[_0x1256('0x44')][_0x1256('0x23')](_0x873166)[_0x1256('0x29')](function(_0x5a8aa0){_0x31104e[_0x1256('0x23')]=_0x5a8aa0;if(_0x19a6ed[_0x1256('0x36')]['includeAll']){_0x48e518[_0x1256('0x45')]=[{'all':!![]}];}return db[_0x1256('0x44')][_0x1256('0x46')](_0x48e518);})[_0x1256('0x29')](function(_0x18da0a){_0x31104e[_0x1256('0x47')]=_0x18da0a;return _0x31104e;})['then'](respondWithFilteredResult(_0x3506ff,_0x48e518))[_0x1256('0x48')](handleError(_0x3506ff,null));};exports[_0x1256('0x49')]=function(_0x4ac584,_0x3c967a){var _0x5e5b83={'raw':!![],'where':{'id':_0x4ac584[_0x1256('0x4a')]['id']}},_0x1384df={};_0x1384df[_0x1256('0x34')]=_[_0x1256('0x4b')](db['ChatGroup'][_0x1256('0x30')]);_0x1384df[_0x1256('0x36')]=_['keys'](_0x4ac584[_0x1256('0x36')]);_0x1384df[_0x1256('0x37')]=_[_0x1256('0x38')](_0x1384df['model'],_0x1384df[_0x1256('0x36')]);_0x5e5b83[_0x1256('0x39')]=_[_0x1256('0x38')](_0x1384df[_0x1256('0x34')],qs[_0x1256('0x3a')](_0x4ac584[_0x1256('0x36')][_0x1256('0x3a')]));_0x5e5b83[_0x1256('0x39')]=_0x5e5b83[_0x1256('0x39')][_0x1256('0x3b')]?_0x5e5b83[_0x1256('0x39')]:_0x1384df['model'];if(_0x4ac584[_0x1256('0x36')][_0x1256('0x4c')]){_0x5e5b83[_0x1256('0x45')]=[{'all':!![]}];}_0x5e5b83=_[_0x1256('0x41')]({},_0x5e5b83,_0x4ac584[_0x1256('0x43')]);return db[_0x1256('0x44')][_0x1256('0x4d')](_0x5e5b83)[_0x1256('0x29')](handleEntityNotFound(_0x3c967a,null))[_0x1256('0x29')](respondWithResult(_0x3c967a,null))[_0x1256('0x48')](handleError(_0x3c967a,null));};exports[_0x1256('0x4e')]=function(_0xb8258f,_0x4f5ab7){return db[_0x1256('0x44')][_0x1256('0x4e')](_0xb8258f[_0x1256('0x4f')],{})[_0x1256('0x29')](respondWithResult(_0x4f5ab7,0xc9))[_0x1256('0x48')](handleError(_0x4f5ab7,null));};exports[_0x1256('0x28')]=function(_0x25d9f1,_0x1a8b37){if(_0x25d9f1[_0x1256('0x4f')]['id']){delete _0x25d9f1['body']['id'];}return db[_0x1256('0x44')]['find']({'where':{'id':_0x25d9f1[_0x1256('0x4a')]['id']}})[_0x1256('0x29')](handleEntityNotFound(_0x1a8b37,null))[_0x1256('0x29')](saveUpdates(_0x25d9f1[_0x1256('0x4f')],null))['then'](respondWithResult(_0x1a8b37,null))['catch'](handleError(_0x1a8b37,null));};exports['destroy']=function(_0x26243f,_0x5df63a){return db[_0x1256('0x44')][_0x1256('0x4d')]({'where':{'id':_0x26243f[_0x1256('0x4a')]['id']}})[_0x1256('0x29')](handleEntityNotFound(_0x5df63a,null))[_0x1256('0x29')](removeEntity(_0x5df63a,null))[_0x1256('0x48')](handleError(_0x5df63a,null));};exports[_0x1256('0x50')]=function(_0x30842a,_0x259661){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x259661,null))['catch'](handleError(_0x259661,null));};exports[_0x1256('0x51')]=function(_0xdd557f,_0x38a9c3,_0x32a1de){return db[_0x1256('0x52')]['count']({'where':{'ChatGroupId':_0xdd557f['params']['id'],'ToId':_0xdd557f[_0x1256('0x53')]['id'],'read':![]}})[_0x1256('0x29')](function(_0x3b2dfa){return{'id':_[_0x1256('0x54')](_0xdd557f[_0x1256('0x4a')]['id']),'count':_0x3b2dfa};})[_0x1256('0x29')](respondWithResult(_0x38a9c3,null))[_0x1256('0x48')](handleError(_0x38a9c3,null));};exports['addMembers']=function(_0x417f2b,_0x596b48,_0x3d41e0){return db[_0x1256('0x44')][_0x1256('0x4d')]({'where':{'id':_0x417f2b[_0x1256('0x4a')]['id']}})[_0x1256('0x29')](handleEntityNotFound(_0x596b48,null))[_0x1256('0x29')](function(_0x1a4cb1){if(_0x1a4cb1){return _0x1a4cb1[_0x1256('0x55')](_0x417f2b['body'][_0x1256('0x56')],_[_0x1256('0x57')](_0x417f2b['body'],[_0x1256('0x56'),'id'])||{});}})[_0x1256('0x29')](respondWithResult(_0x596b48,null))[_0x1256('0x48')](handleError(_0x596b48,null));};exports[_0x1256('0x58')]=function(_0x12a575,_0xa2e52,_0x345536){var _0x1158ac={};var _0x51593c={};var _0x2aa906;var _0x4e9141;return db[_0x1256('0x44')][_0x1256('0x59')]({'where':{'id':_0x12a575[_0x1256('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa2e52,null))[_0x1256('0x29')](function(_0xe91879){if(_0xe91879){_0x2aa906=_0xe91879;_0x51593c[_0x1256('0x34')]=_[_0x1256('0x4b')](db[_0x1256('0x5a')]['rawAttributes']);_0x51593c[_0x1256('0x36')]=_['keys'](_0x12a575[_0x1256('0x36')]);_0x51593c['filters']=_['intersection'](_0x51593c[_0x1256('0x34')],_0x51593c[_0x1256('0x36')]);_0x1158ac[_0x1256('0x39')]=_[_0x1256('0x38')](_0x51593c[_0x1256('0x34')],qs[_0x1256('0x3a')](_0x12a575[_0x1256('0x36')][_0x1256('0x3a')]));_0x1158ac[_0x1256('0x39')]=_0x1158ac[_0x1256('0x39')][_0x1256('0x3b')]?_0x1158ac['attributes']:_0x51593c[_0x1256('0x34')];_0x1158ac[_0x1256('0x3c')]=qs[_0x1256('0x3d')](_0x12a575[_0x1256('0x36')][_0x1256('0x3d')]);_0x1158ac[_0x1256('0x3e')]=qs[_0x1256('0x37')](_['pick'](_0x12a575[_0x1256('0x36')],_0x51593c[_0x1256('0x37')]));if(_0x12a575[_0x1256('0x36')][_0x1256('0x40')]){_0x1158ac[_0x1256('0x3e')]=_[_0x1256('0x41')](_0x1158ac[_0x1256('0x3e')],{'$or':_['map'](_0x1158ac['attributes'],function(_0x57c08a){var _0x21dcea={};_0x21dcea[_0x57c08a]={'$like':'%'+_0x12a575[_0x1256('0x36')]['filter']+'%'};return _0x21dcea;})});}_0x1158ac=_['merge']({},_0x1158ac,_0x12a575[_0x1256('0x43')]);return _0x2aa906[_0x1256('0x58')](_0x1158ac);}})[_0x1256('0x29')](function(_0x4f207e){if(_0x4f207e){_0x4e9141=_0x4f207e[_0x1256('0x3b')];if(!_0x12a575['query'][_0x1256('0x5b')](_0x1256('0x5c'))){_0x1158ac[_0x1256('0x22')]=qs['limit'](_0x12a575[_0x1256('0x36')][_0x1256('0x22')]);_0x1158ac[_0x1256('0x20')]=qs[_0x1256('0x20')](_0x12a575[_0x1256('0x36')][_0x1256('0x20')]);}return _0x2aa906[_0x1256('0x58')](_0x1158ac);}})[_0x1256('0x29')](function(_0xef3a0b){if(_0xef3a0b){return _0xef3a0b?{'count':_0x4e9141,'rows':_0xef3a0b}:null;}})[_0x1256('0x29')](respondWithResult(_0xa2e52,null))[_0x1256('0x48')](handleError(_0xa2e52,null));};exports[_0x1256('0x5d')]=function(_0x4c7c7f,_0x1db50f,_0x4738cd){return db['ChatGroup'][_0x1256('0x4d')]({'where':{'id':_0x4c7c7f['params']['id']}})[_0x1256('0x29')](handleEntityNotFound(_0x1db50f,null))[_0x1256('0x29')](function(_0x4d9c83){if(_0x4d9c83){return _0x4d9c83[_0x1256('0x5d')](_0x4c7c7f[_0x1256('0x36')][_0x1256('0x56')]);}})['then'](respondWithStatusCode(_0x1db50f,null))['catch'](handleError(_0x1db50f,null));};exports[_0x1256('0x5e')]=function(_0x2ad6be,_0x532bb6,_0x2d8f43){if(_0x2ad6be[_0x1256('0x4f')]['id']){delete _0x2ad6be['body']['id'];}return db[_0x1256('0x44')]['find']({'where':{'id':_0x2ad6be['params']['id']}})[_0x1256('0x29')](handleEntityNotFound(_0x532bb6,null))[_0x1256('0x29')](function(_0x4b964b){if(_0x4b964b){_0x2ad6be[_0x1256('0x4f')][_0x1256('0x5f')]=_0x4b964b['id'];return db[_0x1256('0x52')][_0x1256('0x4e')](_0x2ad6be[_0x1256('0x4f')]);}})[_0x1256('0x29')](respondWithResult(_0x532bb6,null))[_0x1256('0x48')](handleError(_0x532bb6,null));};exports[_0x1256('0x60')]=function(_0x229eb3,_0x1a5a18,_0x381585){var _0xdf705e={};var _0x1898b9={};var _0x64df6e;var _0x1396d8;return db[_0x1256('0x44')][_0x1256('0x59')]({'where':{'id':_0x229eb3[_0x1256('0x4a')]['id']}})[_0x1256('0x29')](handleEntityNotFound(_0x1a5a18,null))[_0x1256('0x29')](function(_0x569e1b){if(_0x569e1b){_0x64df6e=_0x569e1b;_0x1898b9['model']=_[_0x1256('0x4b')](db[_0x1256('0x52')][_0x1256('0x30')]);_0x1898b9[_0x1256('0x36')]=_[_0x1256('0x4b')](_0x229eb3[_0x1256('0x36')]);_0x1898b9[_0x1256('0x37')]=_[_0x1256('0x38')](_0x1898b9[_0x1256('0x34')],_0x1898b9[_0x1256('0x36')]);_0xdf705e['attributes']=_[_0x1256('0x38')](_0x1898b9['model'],qs['fields'](_0x229eb3[_0x1256('0x36')][_0x1256('0x3a')]));_0xdf705e[_0x1256('0x39')]=_0xdf705e[_0x1256('0x39')]['length']?_0xdf705e[_0x1256('0x39')]:_0x1898b9['model'];_0xdf705e[_0x1256('0x3c')]=qs[_0x1256('0x3d')](_0x229eb3[_0x1256('0x36')][_0x1256('0x3d')]);_0xdf705e['where']=qs[_0x1256('0x37')](_[_0x1256('0x3f')](_0x229eb3[_0x1256('0x36')],_0x1898b9[_0x1256('0x37')]));if(_0x229eb3['query'][_0x1256('0x40')]){_0xdf705e['where']=_[_0x1256('0x41')](_0xdf705e['where'],{'$or':_[_0x1256('0x35')](_0xdf705e[_0x1256('0x39')],function(_0x3a5412){var _0x3728f6={};_0x3728f6[_0x3a5412]={'$like':'%'+_0x229eb3[_0x1256('0x36')]['filter']+'%'};return _0x3728f6;})});}if(_0x229eb3[_0x1256('0x36')][_0x1256('0x61')]){var _0x393a51=_0x229eb3['query']['$gte'][_0x1256('0x62')](',');var _0x158768={};_0x158768[_0x393a51[0x0]]={'$gte':moment(_0x393a51[0x1])[_0x1256('0x63')](_0x1256('0x64'))};_0xdf705e['where']=_[_0x1256('0x41')](_0xdf705e['where'],_0x158768);}_0xdf705e=_[_0x1256('0x41')]({},_0xdf705e,_0x229eb3[_0x1256('0x43')]);return _0x64df6e[_0x1256('0x60')](_0xdf705e);}})[_0x1256('0x29')](function(_0x4852bf){if(_0x4852bf){_0x1396d8=_0x4852bf[_0x1256('0x3b')];if(!_0x229eb3[_0x1256('0x36')]['hasOwnProperty'](_0x1256('0x5c'))){_0xdf705e[_0x1256('0x22')]=qs[_0x1256('0x22')](_0x229eb3[_0x1256('0x36')][_0x1256('0x22')]);_0xdf705e[_0x1256('0x20')]=qs[_0x1256('0x20')](_0x229eb3[_0x1256('0x36')][_0x1256('0x20')]);}return _0x64df6e[_0x1256('0x60')](_0xdf705e);}})[_0x1256('0x29')](function(_0x3dec0c){if(_0x3dec0c){return _0x3dec0c?{'count':_0x1396d8,'rows':_0x3dec0c}:null;}})[_0x1256('0x29')](respondWithResult(_0x1a5a18,null))[_0x1256('0x48')](handleError(_0x1a5a18,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index dca47c1..0804062 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 _0xeff9=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x287dd6,_0x3fd577){var _0x4d945f=function(_0x20458c){while(--_0x20458c){_0x287dd6['push'](_0x287dd6['shift']());}};_0x4d945f(++_0x3fd577);}(_0xeff9,0x15d));var _0x9eff=function(_0xfb53e8,_0x32b734){_0xfb53e8=_0xfb53e8-0x0;var _0x22e5e9=_0xeff9[_0xfb53e8];return _0x22e5e9;};'use strict';var EventEmitter=require(_0x9eff('0x0'));var ChatGroup=require(_0x9eff('0x1'))['db'][_0x9eff('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9eff('0x3')](0x0);var events={'afterCreate':_0x9eff('0x4'),'afterUpdate':_0x9eff('0x5'),'afterDestroy':_0x9eff('0x6')};function emitEvent(_0xbcb8f7){return function(_0x5503c8,_0x532ced,_0x585495){ChatGroupEvents[_0x9eff('0x7')](_0xbcb8f7+':'+_0x5503c8['id'],_0x5503c8);ChatGroupEvents['emit'](_0xbcb8f7,_0x5503c8);_0x585495(null);};}for(var e in events){if(events[_0x9eff('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x9eff('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0xa772=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove'];(function(_0x3f848a,_0x57e33f){var _0x504c7b=function(_0x4157e9){while(--_0x4157e9){_0x3f848a['push'](_0x3f848a['shift']());}};_0x504c7b(++_0x57e33f);}(_0xa772,0x1b2));var _0x2a77=function(_0x3dedad,_0x435b1f){_0x3dedad=_0x3dedad-0x0;var _0x5470ba=_0xa772[_0x3dedad];return _0x5470ba;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2a77('0x0'))['db'][_0x2a77('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2a77('0x2')](0x0);var events={'afterCreate':_0x2a77('0x3'),'afterUpdate':_0x2a77('0x4'),'afterDestroy':_0x2a77('0x5')};function emitEvent(_0x2bab03){return function(_0x5c241d,_0x303d56,_0x2053f8){ChatGroupEvents[_0x2a77('0x6')](_0x2bab03+':'+_0x5c241d['id'],_0x5c241d);ChatGroupEvents['emit'](_0x2bab03,_0x5c241d);_0x2053f8(null);};}for(var e in events){if(events[_0x2a77('0x7')](e)){var event=events[e];ChatGroup[_0x2a77('0x8')](e,emitEvent(event));}}module[_0x2a77('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 157ebd9..b150ede 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 _0x16c2=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util'];(function(_0x24e178,_0xcdea47){var _0x536faa=function(_0x4df126){while(--_0x4df126){_0x24e178['push'](_0x24e178['shift']());}};_0x536faa(++_0xcdea47);}(_0x16c2,0x1b0));var _0x216c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16c2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x216c('0x0'));var util=require(_0x216c('0x1'));var logger=require(_0x216c('0x2'))(_0x216c('0x3'));var moment=require(_0x216c('0x4'));var BPromise=require(_0x216c('0x5'));var rp=require(_0x216c('0x6'));var fs=require('fs');var path=require(_0x216c('0x7'));var rimraf=require(_0x216c('0x8'));var config=require('../../config/environment');var attributes=require(_0x216c('0x9'));module[_0x216c('0xa')]=function(_0x4d2866,_0x409ae2){return _0x4d2866[_0x216c('0xb')](_0x216c('0xc'),attributes,{'tableName':_0x216c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd268=['ChatGroup','chat_groups','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x3e4a5f,_0x757e33){var _0x511daa=function(_0x4d006c){while(--_0x4d006c){_0x3e4a5f['push'](_0x3e4a5f['shift']());}};_0x511daa(++_0x757e33);}(_0xd268,0x8e));var _0x8d26=function(_0x41b831,_0x4f9759){_0x41b831=_0x41b831-0x0;var _0x160440=_0xd268[_0x41b831];return _0x160440;};'use strict';var _=require(_0x8d26('0x0'));var util=require(_0x8d26('0x1'));var logger=require(_0x8d26('0x2'))('api');var moment=require(_0x8d26('0x3'));var BPromise=require(_0x8d26('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8d26('0x5'));var config=require(_0x8d26('0x6'));var attributes=require('./chatGroup.attributes');module[_0x8d26('0x7')]=function(_0x5d2573,_0xf1b0f){return _0x5d2573['define'](_0x8d26('0x8'),attributes,{'tableName':_0x8d26('0x9'),'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 7fb3dd8..1edb5d1 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 _0xe0ae=['request\x20sent','stringify','code','error','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','socket.io-emitter','register','then','info','ChatGroup,\x20%s,\x20%s','debug'];(function(_0xa191b8,_0x35c3a7){var _0x305fcd=function(_0x1e512f){while(--_0x1e512f){_0xa191b8['push'](_0xa191b8['shift']());}};_0x305fcd(++_0x35c3a7);}(_0xe0ae,0xa1));var _0xee0a=function(_0x56e32e,_0x9eb2f6){_0x56e32e=_0x56e32e-0x0;var _0x2a757b=_0xe0ae[_0x56e32e];return _0x2a757b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee0a('0x0'));var BPromise=require(_0xee0a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee0a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xee0a('0x3'));var logger=require(_0xee0a('0x4'))('rpc');var config=require(_0xee0a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xee0a('0x6')]({'port':0x232a});config[_0xee0a('0x7')]=_[_0xee0a('0x8')](config[_0xee0a('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xee0a('0x9'))(new Redis(config['redis']));require('./chatGroup.socket')[_0xee0a('0xa')](socket);function respondWithRpcPromise(_0x3d0b3f,_0xbd4483,_0x57d190){return new BPromise(function(_0x3bc0cf,_0x1a953e){return client['request'](_0x3d0b3f,_0x57d190)[_0xee0a('0xb')](function(_0x4b3e49){logger[_0xee0a('0xc')](_0xee0a('0xd'),_0xbd4483,'request\x20sent');logger[_0xee0a('0xe')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0xbd4483,_0xee0a('0xf'),JSON[_0xee0a('0x10')](_0x4b3e49));if(_0x4b3e49['error']){if(_0x4b3e49['error'][_0xee0a('0x11')]===0x1f4){logger[_0xee0a('0x12')](_0xee0a('0xd'),_0xbd4483,_0x4b3e49[_0xee0a('0x12')][_0xee0a('0x13')]);return _0x1a953e(_0x4b3e49['error'][_0xee0a('0x13')]);}logger[_0xee0a('0x12')]('ChatGroup,\x20%s,\x20%s',_0xbd4483,_0x4b3e49[_0xee0a('0x12')][_0xee0a('0x13')]);return _0x3bc0cf(_0x4b3e49[_0xee0a('0x12')][_0xee0a('0x13')]);}else{logger['info'](_0xee0a('0xd'),_0xbd4483,_0xee0a('0xf'));_0x3bc0cf(_0x4b3e49[_0xee0a('0x14')]['message']);}})[_0xee0a('0x15')](function(_0x1ffdb5){logger[_0xee0a('0x12')](_0xee0a('0xd'),_0xbd4483,_0x1ffdb5);_0x1a953e(_0x1ffdb5);});});} \ No newline at end of file +var _0x0ab2=['request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','moment','randomstring','ioredis','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info'];(function(_0x3fbfd8,_0x50fd0f){var _0x2fe839=function(_0x4634d5){while(--_0x4634d5){_0x3fbfd8['push'](_0x3fbfd8['shift']());}};_0x2fe839(++_0x50fd0f);}(_0x0ab2,0x92));var _0x20ab=function(_0x135573,_0x479526){_0x135573=_0x135573-0x0;var _0x13ea56=_0x0ab2[_0x135573];return _0x13ea56;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x20ab('0x0'));var BPromise=require('bluebird');var rs=require(_0x20ab('0x1'));var fs=require('fs');var Redis=require(_0x20ab('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x20ab('0x3'))('rpc');var config=require(_0x20ab('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x20ab('0x5')][_0x20ab('0x6')]({'port':0x232a});config[_0x20ab('0x7')]=_[_0x20ab('0x8')](config[_0x20ab('0x7')],{'host':_0x20ab('0x9'),'port':0x18eb});var socket=require(_0x20ab('0xa'))(new Redis(config[_0x20ab('0x7')]));require(_0x20ab('0xb'))['register'](socket);function respondWithRpcPromise(_0x591cc3,_0x5dfdc2,_0x5690c2){return new BPromise(function(_0x33bcd7,_0x3ad331){return client[_0x20ab('0xc')](_0x591cc3,_0x5690c2)[_0x20ab('0xd')](function(_0x4c9cf6){logger[_0x20ab('0xe')]('ChatGroup,\x20%s,\x20%s',_0x5dfdc2,_0x20ab('0xf'));logger['debug'](_0x20ab('0x10'),_0x5dfdc2,'request\x20sent',JSON[_0x20ab('0x11')](_0x4c9cf6));if(_0x4c9cf6[_0x20ab('0x12')]){if(_0x4c9cf6[_0x20ab('0x12')][_0x20ab('0x13')]===0x1f4){logger['error'](_0x20ab('0x14'),_0x5dfdc2,_0x4c9cf6[_0x20ab('0x12')][_0x20ab('0x15')]);return _0x3ad331(_0x4c9cf6[_0x20ab('0x12')]['message']);}logger[_0x20ab('0x12')](_0x20ab('0x14'),_0x5dfdc2,_0x4c9cf6[_0x20ab('0x12')][_0x20ab('0x15')]);return _0x33bcd7(_0x4c9cf6['error'][_0x20ab('0x15')]);}else{logger[_0x20ab('0xe')](_0x20ab('0x14'),_0x5dfdc2,_0x20ab('0xf'));_0x33bcd7(_0x4c9cf6[_0x20ab('0x16')][_0x20ab('0x15')]);}})['catch'](function(_0x545d14){logger[_0x20ab('0x12')](_0x20ab('0x14'),_0x5dfdc2,_0x545d14);_0x3ad331(_0x545d14);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 40d9c93..b706cd6 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 _0x6f66=['length','./chatGroup.events','save','remove','update','emit','register'];(function(_0x31061a,_0x5ab647){var _0x48d92a=function(_0x421130){while(--_0x421130){_0x31061a['push'](_0x31061a['shift']());}};_0x48d92a(++_0x5ab647);}(_0x6f66,0x94));var _0x66f6=function(_0x2534cf,_0x545be6){_0x2534cf=_0x2534cf-0x0;var _0x221461=_0x6f66[_0x2534cf];return _0x221461;};'use strict';var ChatGroupEvents=require(_0x66f6('0x0'));var events=[_0x66f6('0x1'),_0x66f6('0x2'),_0x66f6('0x3')];function createListener(_0x1661e2,_0x59c479){return function(_0x131305){_0x59c479[_0x66f6('0x4')](_0x1661e2,_0x131305);};}function removeListener(_0x266d88,_0x2847af){return function(){ChatGroupEvents['removeListener'](_0x266d88,_0x2847af);};}exports[_0x66f6('0x5')]=function(_0x590b34){for(var _0x23eb8d=0x0,_0x37afa3=events[_0x66f6('0x6')];_0x23eb8d<_0x37afa3;_0x23eb8d++){var _0x2342c5=events[_0x23eb8d];var _0x1e5880=createListener('chatGroup:'+_0x2342c5,_0x590b34);ChatGroupEvents['on'](_0x2342c5,_0x1e5880);}}; \ No newline at end of file +var _0x1a3c=['removeListener','register','chatGroup:','./chatGroup.events','save','update','emit'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0x1a3c,0x8f));var _0xc1a3=function(_0x3c3729,_0x260fbd){_0x3c3729=_0x3c3729-0x0;var _0x10464a=_0x1a3c[_0x3c3729];return _0x10464a;};'use strict';var ChatGroupEvents=require(_0xc1a3('0x0'));var events=[_0xc1a3('0x1'),'remove',_0xc1a3('0x2')];function createListener(_0x3afc29,_0xd63990){return function(_0x141dae){_0xd63990[_0xc1a3('0x3')](_0x3afc29,_0x141dae);};}function removeListener(_0x344029,_0x2649e7){return function(){ChatGroupEvents[_0xc1a3('0x4')](_0x344029,_0x2649e7);};}exports[_0xc1a3('0x5')]=function(_0x9a49b){for(var _0x1b8d43=0x0,_0x416f55=events['length'];_0x1b8d43<_0x416f55;_0x1b8d43++){var _0x267b51=events[_0x1b8d43];var _0x3e7684=createListener(_0xc1a3('0x6')+_0x267b51,_0x9a49b);ChatGroupEvents['on'](_0x267b51,_0x3e7684);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index bb053b2..cb1ee25 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 _0xdd0e=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/unread','/:id/members','getMessages','post','create','addMembers','/:id/messages','put','update','destroy','removeMembers','exports','multer'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xdd0e,0x12b));var _0xedd0=function(_0x5c526f,_0x48b882){_0x5c526f=_0x5c526f-0x0;var _0x4b7c62=_0xdd0e[_0x5c526f];return _0x4b7c62;};'use strict';var multer=require(_0xedd0('0x0'));var util=require(_0xedd0('0x1'));var path=require(_0xedd0('0x2'));var timeout=require(_0xedd0('0x3'));var express=require(_0xedd0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xedd0('0x5'));var config=require(_0xedd0('0x6'));var controller=require('./chatGroup.controller');router[_0xedd0('0x7')]('/',auth[_0xedd0('0x8')](),controller[_0xedd0('0x9')]);router[_0xedd0('0x7')]('/describe',auth[_0xedd0('0x8')](),controller[_0xedd0('0xa')]);router['get'](_0xedd0('0xb'),auth[_0xedd0('0x8')](),controller[_0xedd0('0xc')]);router[_0xedd0('0x7')](_0xedd0('0xd'),auth[_0xedd0('0x8')](),controller['getUnread']);router[_0xedd0('0x7')](_0xedd0('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0xedd0('0x7')]('/:id/messages',auth[_0xedd0('0x8')](),controller[_0xedd0('0xf')]);router[_0xedd0('0x10')]('/',auth[_0xedd0('0x8')](),controller[_0xedd0('0x11')]);router['post'](_0xedd0('0xe'),auth[_0xedd0('0x8')](),controller[_0xedd0('0x12')]);router[_0xedd0('0x10')](_0xedd0('0x13'),auth['isAuthenticated'](),controller['addMessage']);router[_0xedd0('0x14')](_0xedd0('0xb'),auth[_0xedd0('0x8')](),controller[_0xedd0('0x15')]);router['delete'](_0xedd0('0xb'),auth[_0xedd0('0x8')](),controller[_0xedd0('0x16')]);router['delete'](_0xedd0('0xe'),auth[_0xedd0('0x8')](),controller[_0xedd0('0x17')]);module[_0xedd0('0x18')]=router; \ No newline at end of file +var _0x06cd=['getUnread','/:id/members','getMembers','/:id/messages','post','create','addMessage','put','update','delete','/:id','destroy','removeMembers','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','show','/:id/unread'];(function(_0x3ff1b8,_0x2a889b){var _0x45103c=function(_0x19ddb6){while(--_0x19ddb6){_0x3ff1b8['push'](_0x3ff1b8['shift']());}};_0x45103c(++_0x2a889b);}(_0x06cd,0x1dd));var _0xd06c=function(_0x4f84ea,_0x2c7318){_0x4f84ea=_0x4f84ea-0x0;var _0x5222cc=_0x06cd[_0x4f84ea];return _0x5222cc;};'use strict';var multer=require(_0xd06c('0x0'));var util=require(_0xd06c('0x1'));var path=require(_0xd06c('0x2'));var timeout=require(_0xd06c('0x3'));var express=require('express');var router=express[_0xd06c('0x4')]();var fs_extra=require(_0xd06c('0x5'));var auth=require(_0xd06c('0x6'));var interaction=require(_0xd06c('0x7'));var config=require(_0xd06c('0x8'));var controller=require(_0xd06c('0x9'));router[_0xd06c('0xa')]('/',auth[_0xd06c('0xb')](),controller['index']);router[_0xd06c('0xa')](_0xd06c('0xc'),auth[_0xd06c('0xb')](),controller[_0xd06c('0xd')]);router['get']('/:id',auth[_0xd06c('0xb')](),controller[_0xd06c('0xe')]);router[_0xd06c('0xa')](_0xd06c('0xf'),auth['isAuthenticated'](),controller[_0xd06c('0x10')]);router['get'](_0xd06c('0x11'),auth[_0xd06c('0xb')](),controller[_0xd06c('0x12')]);router['get'](_0xd06c('0x13'),auth[_0xd06c('0xb')](),controller['getMessages']);router[_0xd06c('0x14')]('/',auth[_0xd06c('0xb')](),controller[_0xd06c('0x15')]);router[_0xd06c('0x14')](_0xd06c('0x11'),auth['isAuthenticated'](),controller['addMembers']);router[_0xd06c('0x14')](_0xd06c('0x13'),auth[_0xd06c('0xb')](),controller[_0xd06c('0x16')]);router[_0xd06c('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xd06c('0x18')]);router[_0xd06c('0x19')](_0xd06c('0x1a'),auth[_0xd06c('0xb')](),controller[_0xd06c('0x1b')]);router[_0xd06c('0x19')](_0xd06c('0x11'),auth[_0xd06c('0xb')](),controller[_0xd06c('0x1c')]);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 a20514e..0609e01 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 _0x34b7=['thumb','STRING','DATE','TEXT','long','out','BOOLEAN','INTEGER','ENUM','star'];(function(_0x3c0980,_0x1b9c71){var _0x2d6937=function(_0x28b790){while(--_0x28b790){_0x3c0980['push'](_0x3c0980['shift']());}};_0x2d6937(++_0x1b9c71);}(_0x34b7,0x196));var _0x734b=function(_0xbce261,_0x5bf87e){_0xbce261=_0xbce261-0x0;var _0x23848f=_0x34b7[_0xbce261];return _0x23848f;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x734b('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x734b('0x1')]},'ratingType':{'type':Sequelize[_0x734b('0x2')](_0x734b('0x3'),_0x734b('0x4')),'defaultValue':_0x734b('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x734b('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x734b('0x6')]},'disposition':{'type':Sequelize[_0x734b('0x5')]},'secondDisposition':{'type':Sequelize[_0x734b('0x5')]},'thirdDisposition':{'type':Sequelize[_0x734b('0x5')]},'note':{'type':Sequelize[_0x734b('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x734b('0x5')]},'osName':{'type':Sequelize[_0x734b('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x734b('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x734b('0x5')]},'formData':{'type':Sequelize[_0x734b('0x7')](_0x734b('0x8'))},'read1stAt':{'type':Sequelize[_0x734b('0x6')]},'lastMsgAt':{'type':Sequelize[_0x734b('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x734b('0x2')]('in',_0x734b('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x734b('0x5')]},'customerPort':{'type':Sequelize[_0x734b('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x734b('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x734b('0x0')],'defaultValue':![]}}; \ No newline at end of file +var _0xfd7b=['STRING','DATE','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0xfd7b,0xd1));var _0xbfd7=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xfd7b[_0x1b828b];return _0x98da1a;};'use strict';var Sequelize=require(_0xbfd7('0x0'));module[_0xbfd7('0x1')]={'closed':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xbfd7('0x3')](_0xbfd7('0x4'),_0xbfd7('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xbfd7('0x6')]},'pathTranscript':{'type':Sequelize[_0xbfd7('0x6')]},'mailTranscript':{'type':Sequelize[_0xbfd7('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xbfd7('0x7')]},'secondDisposition':{'type':Sequelize[_0xbfd7('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbfd7('0x7')]},'browserName':{'type':Sequelize[_0xbfd7('0x7')]},'browserVersion':{'type':Sequelize[_0xbfd7('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xbfd7('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xbfd7('0x7')]},'referer':{'type':Sequelize[_0xbfd7('0x6')]},'customerIp':{'type':Sequelize[_0xbfd7('0x7')]},'formData':{'type':Sequelize[_0xbfd7('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xbfd7('0x8')]},'lastMsgAt':{'type':Sequelize[_0xbfd7('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xbfd7('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xbfd7('0x7')]},'customerPort':{'type':Sequelize[_0xbfd7('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 20d75a3..b46e9ef 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 _0x5316=['updateAttributes','customUpdate','CmContact','abandon','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','basename','filename','file','mimetype','Attachment','attachId','join','offline-chat/','download','close','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsite','ContactId','length','System','customer','Visitor','agentIdentifier','website_alias','%s%d','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','order','sort','where','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','include','rows','getMyMessages','pick','ChatInteractionId','includeAgent','push','addTags','setTags','omit','Tag','color','emit','removeTags','toString','server','tmp','files','attachments','transcript-%d-%s.zip','Contact','firstName','Account','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','osName','customerPort','tail','createWriteStream','lastName','value','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','request-promise','bluebird','mustache','util','path','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','info','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','sendStatus','stack','name','merge','body','contact','agent','interaction','account','map','ChatInteraction','type','findAll','chat','query','show','model','rawAttributes','keys','filters','intersection','fields','attributes','includeAll','options','find','create','update','params','describe','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooMetadata','user','fullname','https://api-vidaoo.xcally.com/api/v1/meetings','email','vidaooNote','follow','isNull','parse','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session'];(function(_0x4716ad,_0x43e86a){var _0x5f50ba=function(_0x107e7f){while(--_0x107e7f){_0x4716ad['push'](_0x4716ad['shift']());}};_0x5f50ba(++_0x43e86a);}(_0x5316,0x6c));var _0x6531=function(_0xdb47d8,_0x933e5b){_0xdb47d8=_0xdb47d8-0x0;var _0x5cdfd9=_0x5316[_0xdb47d8];return _0x5cdfd9;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x6531('0x0'));var rp=require(_0x6531('0x1'));var moment=require('moment');var BPromise=require(_0x6531('0x2'));var Mustache=require(_0x6531('0x3'));var util=require(_0x6531('0x4'));var path=require(_0x6531('0x5'));var ejs=require(_0x6531('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x6531('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x6531('0x8'));var pdf=require(_0x6531('0x9'));var logger=require(_0x6531('0xa'))('api');var config=require(_0x6531('0xb'));var db=require('../../mysqldb')['db'];config[_0x6531('0xc')]=_['defaults'](config[_0x6531('0xc')],{'host':_0x6531('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6531('0xc')]));require(_0x6531('0xe'))[_0x6531('0xf')](socket);var jayson=require(_0x6531('0x10'));var client=jayson[_0x6531('0x11')][_0x6531('0x12')]({'port':0x232b});var client9004=jayson[_0x6531('0x11')][_0x6531('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x4ef17b,_0x5994c5,_0x4ce8dc,_0x4f3d96){return new BPromise(function(_0x15694c,_0x47d6dc){var _0x330754=_0x4f3d96||client;return _0x330754[_0x6531('0x13')](_0x4ef17b,_0x4ce8dc)[_0x6531('0x14')](function(_0x2859af){logger['info'](_0x6531('0x15'),_0x5994c5,_0x6531('0x16'));logger[_0x6531('0x17')](_0x6531('0x18'),_0x5994c5,'request\x20sent',JSON[_0x6531('0x19')](_0x2859af));if(_0x2859af[_0x6531('0x1a')]){if(_0x2859af[_0x6531('0x1a')][_0x6531('0x1b')]===0x1f4){logger['error'](_0x6531('0x15'),_0x5994c5,_0x2859af[_0x6531('0x1a')]['message']);return _0x47d6dc(_0x2859af['error']['message']);}logger['error'](_0x6531('0x15'),_0x5994c5,_0x2859af[_0x6531('0x1a')]['message']);return _0x15694c(_0x2859af[_0x6531('0x1a')]['message']);}else{logger[_0x6531('0x1c')](_0x6531('0x15'),_0x5994c5,'request\x20sent');_0x15694c(_0x2859af['result'][_0x6531('0x1d')]);}})[_0x6531('0x1e')](function(_0x4049fc){logger[_0x6531('0x1a')](_0x6531('0x15'),_0x5994c5,_0x4049fc);_0x47d6dc(_0x4049fc);});});}function respondWithStatusCode(_0x282af1,_0xef9308){_0xef9308=_0xef9308||0xcc;return function(_0xe5c47c){if(_0xe5c47c){return _0x282af1['sendStatus'](_0xef9308);}return _0x282af1[_0x6531('0x1f')](_0xef9308)['end']();};}function respondWithResult(_0x34184a,_0xf9dab9){_0xf9dab9=_0xf9dab9||0xc8;return function(_0x322a97){if(_0x322a97){return _0x34184a[_0x6531('0x1f')](_0xf9dab9)[_0x6531('0x20')](_0x322a97);}};}function respondWithFilteredResult(_0x3e9c40,_0x43eed9){return function(_0x5a3767){if(_0x5a3767){var _0x347950=typeof _0x43eed9[_0x6531('0x21')]===_0x6531('0x22')&&typeof _0x43eed9[_0x6531('0x23')]===_0x6531('0x22');var _0x317652=_0x5a3767['count'];var _0x417368=_0x347950?0x0:_0x43eed9[_0x6531('0x21')];var _0x2056e2=_0x347950?_0x5a3767[_0x6531('0x24')]:_0x43eed9['offset']+_0x43eed9['limit'];var _0x1415d0;if(_0x2056e2>=_0x317652){_0x2056e2=_0x317652;_0x1415d0=0xc8;}else{_0x1415d0=0xce;}_0x3e9c40['status'](_0x1415d0);return _0x3e9c40[_0x6531('0x25')](_0x6531('0x26'),_0x417368+'-'+_0x2056e2+'/'+_0x317652)[_0x6531('0x20')](_0x5a3767);}return null;};}function saveUpdates(_0x55951e){return function(_0x40d72f){if(_0x40d72f){return _0x40d72f['update'](_0x55951e)[_0x6531('0x14')](function(_0x1659d5){return _0x1659d5;});}return null;};}function removeEntity(_0x59bdaa){return function(_0x3d7c86){if(_0x3d7c86){return _0x3d7c86[_0x6531('0x27')]()[_0x6531('0x14')](function(){_0x59bdaa[_0x6531('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bec87){return function(_0x3a8097){if(!_0x3a8097){_0x2bec87[_0x6531('0x28')](0x194);}return _0x3a8097;};}function handleError(_0x8713ee,_0x4127c1){_0x4127c1=_0x4127c1||0x1f4;return function(_0x16d7ab){logger['error'](_0x16d7ab[_0x6531('0x29')]);if(_0x16d7ab['name']){delete _0x16d7ab[_0x6531('0x2a')];}_0x8713ee[_0x6531('0x1f')](_0x4127c1)['send'](_0x16d7ab);};}function getMustacheRender(_0x41e0a3,_0x67ed4){return Mustache['render'](_0x41e0a3,_[_0x6531('0x2b')](_0x67ed4[_0x6531('0x2c')],{'contact':_0x67ed4[_0x6531('0x2d')],'message':_0x67ed4[_0x6531('0x1d')],'agent':_0x67ed4[_0x6531('0x2e')],'interaction':_0x67ed4[_0x6531('0x2f')],'account':_0x67ed4[_0x6531('0x30')]}))||'';}exports['index']=function(_0x42a8e2,_0x40627d){var _0x5b1959={};var _0x36089e=_[_0x6531('0x31')](db[_0x6531('0x32')]['rawAttributes'],function(_0x3a81cc){return{'name':_0x3a81cc['fieldName'],'type':_0x3a81cc[_0x6531('0x33')]['key']};});_0x5b1959=qs['getOptions'](_0x36089e,_0x42a8e2);return interaction[_0x6531('0x34')](_0x6531('0x35'),_0x42a8e2[_0x6531('0x36')],_0x42a8e2['user'],_0x5b1959,_0x36089e)['then'](respondWithFilteredResult(_0x40627d,_0x5b1959))[_0x6531('0x1e')](handleError(_0x40627d,null));};exports[_0x6531('0x37')]=function(_0x4fcb7a,_0x4eb7fd){var _0x2d3db4={'raw':![],'where':{'id':_0x4fcb7a['params']['id']}},_0x2e8058={};_0x2e8058[_0x6531('0x38')]=_['keys'](db[_0x6531('0x32')][_0x6531('0x39')]);_0x2e8058[_0x6531('0x36')]=_[_0x6531('0x3a')](_0x4fcb7a[_0x6531('0x36')]);_0x2e8058[_0x6531('0x3b')]=_[_0x6531('0x3c')](_0x2e8058[_0x6531('0x38')],_0x2e8058['query']);_0x2d3db4['attributes']=_[_0x6531('0x3c')](_0x2e8058[_0x6531('0x38')],qs[_0x6531('0x3d')](_0x4fcb7a[_0x6531('0x36')][_0x6531('0x3d')]));_0x2d3db4['attributes']=_0x2d3db4[_0x6531('0x3e')]['length']?_0x2d3db4[_0x6531('0x3e')]:_0x2e8058[_0x6531('0x38')];if(_0x4fcb7a['query'][_0x6531('0x3f')]){_0x2d3db4['include']=[{'all':!![]}];}_0x2d3db4=_[_0x6531('0x2b')]({},_0x2d3db4,_0x4fcb7a[_0x6531('0x40')]);return db[_0x6531('0x32')][_0x6531('0x41')](_0x2d3db4)['then'](handleEntityNotFound(_0x4eb7fd,null))[_0x6531('0x14')](respondWithResult(_0x4eb7fd,null))['catch'](handleError(_0x4eb7fd,null));};exports[_0x6531('0x42')]=function(_0xa5ab28,_0x2139b5){return db[_0x6531('0x32')][_0x6531('0x42')](_0xa5ab28[_0x6531('0x2c')],{})[_0x6531('0x14')](respondWithResult(_0x2139b5,0xc9))['catch'](handleError(_0x2139b5,null));};exports[_0x6531('0x43')]=function(_0x1799c1,_0x270687){if(_0x1799c1[_0x6531('0x2c')]['id']){delete _0x1799c1['body']['id'];}return db['ChatInteraction'][_0x6531('0x41')]({'where':{'id':_0x1799c1['params']['id']}})[_0x6531('0x14')](handleEntityNotFound(_0x270687,null))['then'](saveUpdates(_0x1799c1[_0x6531('0x2c')],null))['then'](respondWithResult(_0x270687,null))[_0x6531('0x1e')](handleError(_0x270687,null));};exports['destroy']=function(_0x39c149,_0x3f38ae){return db['ChatInteraction']['find']({'where':{'id':_0x39c149[_0x6531('0x44')]['id']}})[_0x6531('0x14')](handleEntityNotFound(_0x3f38ae,null))[_0x6531('0x14')](removeEntity(_0x3f38ae,null))[_0x6531('0x1e')](handleError(_0x3f38ae,null));};exports[_0x6531('0x45')]=function(_0x51045b,_0x18e720){return db[_0x6531('0x32')]['describe']()['then'](respondWithResult(_0x18e720,null))[_0x6531('0x1e')](handleError(_0x18e720,null));};exports['createVidaooSession']=function(_0x1b54df,_0x4613e0){var _0x569a75=_0x1b54df['params']['id'];var _0x14b874;var _0x1133d7;var _0x280546;return db['ChatInteraction'][_0x6531('0x46')]({'where':{'id':_0x569a75}})[_0x6531('0x14')](function(_0x53908d){_0x14b874=_0x53908d;return db['ChatWebsite']['findOne']({'where':{'id':_0x53908d[_0x6531('0x47')]},'attributes':['id',_0x6531('0x48'),_0x6531('0x49'),'vidaooTopic','vidaooNote',_0x6531('0x4a')],'raw':!![]});})[_0x6531('0x14')](function(_0x5320f3){if(_0x5320f3&&_0x5320f3[_0x6531('0x48')]&&_0x5320f3['vidaooEscalation']){_0x1133d7=_0x5320f3;var _0x1ed396={'interaction':{'id':_0x569a75},'agent':{'id':_0x1b54df[_0x6531('0x4b')]['id'],'name':_0x1b54df[_0x6531('0x4b')]['name'],'fullname':_0x1b54df[_0x6531('0x4b')][_0x6531('0x4c')],'email':_0x1b54df['user']['email']},'contact':_0x1b54df[_0x6531('0x2c')][_0x6531('0x2d')],'account':_0x1b54df[_0x6531('0x2c')]['account']};var _0x1e3d5d={'rejectUnauthorized':![],'method':'POST','url':_0x6531('0x4d'),'headers':{'X-APIKEY':_0x5320f3[_0x6531('0x48')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1b54df[_0x6531('0x4b')][_0x6531('0x4e')]],'buttons':null,'topic':_0x1133d7['vidaooTopic'],'note':_['isNull'](_0x1133d7[_0x6531('0x4f')])?null:getMustacheRender(_0x1133d7[_0x6531('0x4f')],_0x1ed396),'metadata':null},'redirect':_0x6531('0x50'),'json':!![]};try{if(!_[_0x6531('0x51')](_0x1133d7[_0x6531('0x4a')])){var _0x4e675a=getMustacheRender(_0x1133d7[_0x6531('0x4a')],_0x1ed396);var _0x2a3f15=JSON[_0x6531('0x52')](_0x4e675a);_0x1e3d5d[_0x6531('0x2c')]['metadata']=_0x2a3f15;}}catch(_0x4aa15b){throw new db[(_0x6531('0x53'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x1e3d5d);}else{throw new db[(_0x6531('0x53'))]['ValidationError'](_0x6531('0x54'));}})[_0x6531('0x14')](function(_0xd365d7){_0x280546=_0xd365d7;if(_0x280546['id']){var _0x59e605={'body':_0x280546[_0x6531('0x55')],'ChatWebsiteId':_0x1133d7['id'],'ChatInteractionId':_0x14b874['id'],'direction':_0x6531('0x56'),'UserId':_0x1b54df[_0x6531('0x4b')]['id']};return db[_0x6531('0x57')][_0x6531('0x42')](_0x59e605,{});}else{throw new db['Sequelize'][(_0x6531('0x58'))](_0x6531('0x59'));}})[_0x6531('0x14')](function(){return _0x14b874[_0x6531('0x5a')]({'vidaooSessionId':_0x280546['id']});})[_0x6531('0x14')](respondWithResult(_0x4613e0,null))[_0x6531('0x1e')](handleError(_0x4613e0,null));};exports[_0x6531('0x5b')]=function(_0x167f7d,_0x35b530){if(_0x167f7d[_0x6531('0x2c')]['id']){delete _0x167f7d[_0x6531('0x2c')]['id'];}return db[_0x6531('0x32')][_0x6531('0x41')]({'where':{'id':_0x167f7d[_0x6531('0x44')]['id']},'include':[{'model':db[_0x6531('0x5c')],'as':'Contact'}]})[_0x6531('0x14')](handleEntityNotFound(_0x35b530,null))[_0x6531('0x14')](saveUpdates(_0x167f7d[_0x6531('0x2c')],null))[_0x6531('0x14')](respondWithResult(_0x35b530,null))[_0x6531('0x1e')](handleError(_0x35b530,null));};exports[_0x6531('0x5d')]=function(_0x378d11,_0xd9e9d9){if(_0x378d11[_0x6531('0x2c')]['id']){delete _0x378d11[_0x6531('0x2c')]['id'];}return db[_0x6531('0x32')][_0x6531('0x41')]({'where':{'id':_0x378d11['params']['id']}})[_0x6531('0x14')](function(_0x281fa4){if(!_0x281fa4){logger[_0x6531('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x6531('0x5d'),0x194,'entity\x20not\x20found');_0xd9e9d9[_0x6531('0x28')](0x194);}else{if(_0x281fa4[_0x6531('0x5e')]){throw new db[(_0x6531('0x53'))][(_0x6531('0x58'))](_0x6531('0x5f'));}}return _0x281fa4;})[_0x6531('0x14')](function(_0x2ea28e){if(_0x2ea28e){return _0x2ea28e[_0x6531('0x43')]({'closed':_0x378d11[_0x6531('0x2c')][_0x6531('0x60')],'disposition':_0x378d11[_0x6531('0x2c')][_0x6531('0x61')]})[_0x6531('0x14')](function(_0x10b046){return _0x10b046;});}})[_0x6531('0x14')](function(){return respondWithRpcPromise(_0x6531('0x62'),'abandon',_0x378d11[_0x6531('0x2c')],client9004);})[_0x6531('0x14')](respondWithResult(_0xd9e9d9,null))[_0x6531('0x1e')](handleError(_0xd9e9d9,null));};exports['attachmentUpload']=function(_0x512fc4,_0x13450d){_0x512fc4[_0x6531('0x2c')][_0x6531('0x2a')]=_0x512fc4['file']['originalname'];_0x512fc4['body'][_0x6531('0x63')]=_0x512fc4['file'][_0x6531('0x64')];_0x512fc4[_0x6531('0x2c')][_0x6531('0x33')]=_0x512fc4[_0x6531('0x65')][_0x6531('0x66')];return db[_0x6531('0x67')]['create'](_0x512fc4[_0x6531('0x2c')])['then'](respondWithResult(_0x13450d,0xc9))[_0x6531('0x1e')](handleError(_0x13450d,null));};exports['attachmentDownload']=function(_0x17b5ff,_0x2544c7){return db[_0x6531('0x32')][_0x6531('0x46')]({'where':{'id':_0x17b5ff[_0x6531('0x44')]['id']},'raw':!![]})[_0x6531('0x14')](handleEntityNotFound(_0x2544c7,null))[_0x6531('0x14')](function(_0x3ad9a7){if(_0x3ad9a7){if(_0x3ad9a7['closed']){return _0x2544c7[_0x6531('0x1f')](0x193)[_0x6531('0x20')]({'status':0x193,'message':'Unauthorized'});}return db[_0x6531('0x67')][_0x6531('0x46')]({'where':{'id':_0x17b5ff[_0x6531('0x36')][_0x6531('0x68')]},'raw':!![]})['then'](handleEntityNotFound(_0x2544c7,null));}})[_0x6531('0x14')](function(_0x29de44){if(_0x29de44){var _0x2d717c=_0x29de44['ChatOfflineMessageId']!==null;var _0x529826=path[_0x6531('0x69')](config['root'],'server/files/attachments/');if(_0x2d717c){_0x529826=path['join'](_0x529826,_0x6531('0x6a'));}var _0x5b769d=path[_0x6531('0x69')](_0x529826,_0x29de44[_0x6531('0x63')]);return _0x2544c7[_0x6531('0x6b')](_0x5b769d);}})[_0x6531('0x1e')](handleError(_0x2544c7,null));};exports[_0x6531('0x6c')]=function(_0x2abb1c,_0x3125ba){var _0x522967=null;var _0xba7c11=null;var _0x2c6b75=null;if(_0x2abb1c[_0x6531('0x2c')]['id']){delete _0x2abb1c[_0x6531('0x2c')]['id'];}if(_0x2abb1c[_0x6531('0x2c')]['mailTranscript']){_0x2c6b75=path[_0x6531('0x69')](config[_0x6531('0x6d')],_0x6531('0x6e'),util[_0x6531('0x6f')](_0x6531('0x70'),Date[_0x6531('0x71')]()));_0x2abb1c[_0x6531('0x2c')][_0x6531('0x72')]=_0x2c6b75;}return db[_0x6531('0x32')][_0x6531('0x41')]({'where':{'id':_0x2abb1c[_0x6531('0x44')]['id']},'include':[{'model':db[_0x6531('0x57')],'as':_0x6531('0x73'),'include':[{'model':db[_0x6531('0x74')],'as':'User'}]}]})[_0x6531('0x14')](handleEntityNotFound(_0x3125ba,null))['then'](saveUpdates(_0x2abb1c[_0x6531('0x2c')],null))[_0x6531('0x14')](function(_0x3f7ad2){if(_0x3f7ad2){_0x522967=_0x3f7ad2;return db[_0x6531('0x75')][_0x6531('0x41')]({'where':{'id':_0x522967[_0x6531('0x47')]}});}})['then'](function(_0x1b0ec7){if(_0x1b0ec7){_0xba7c11=_0x1b0ec7;return db['CmContact'][_0x6531('0x41')]({'where':{'id':_0x522967[_0x6531('0x76')]}});}})[_0x6531('0x14')](function(_0x5e7c2c){if(_0x5e7c2c){if(_0x2c6b75){var _0x3dc904=null;for(var _0xb2e2e8=0x1;_0xb2e2e8<_0x522967['Messages'][_0x6531('0x77')];++_0xb2e2e8){_0x3dc904=_0x522967['Messages'][_0xb2e2e8];var _0x5c4fa3=_0x3dc904[_0x6531('0x5e')]?util[_0x6531('0x6f')]('%s%d',_0xba7c11['agentAlias'],_0x3dc904['UserId']):_0x6531('0x78');var _0x25c9b1=_0x2abb1c[_0x6531('0x2c')][_0x6531('0x79')]||util['format']('%s%d',_0x6531('0x7a'),_0x3dc904[_0x6531('0x76')]);switch(_0xba7c11[_0x6531('0x7b')]){case _0x6531('0x7c'):_0x5c4fa3=_0x3dc904['UserId']?util[_0x6531('0x6f')](_0x6531('0x7d'),_0xba7c11[_0x6531('0x7e')],_0x3dc904[_0x6531('0x5e')]):_0x6531('0x78');break;case _0x6531('0x7f'):_0x5c4fa3=_0x3dc904[_0x6531('0x5e')]?_0x3dc904[_0x6531('0x74')][_0x6531('0x80')]||_0x3dc904[_0x6531('0x74')][_0x6531('0x4c')]:'System';break;case _0x6531('0x81'):_0x5c4fa3=_0x3dc904['UserId']?_0x3dc904[_0x6531('0x74')][_0x6531('0x4c')]:_0x6531('0x78');break;default:_0x5c4fa3=_0x3dc904['UserId']?util[_0x6531('0x6f')](_0x6531('0x7d'),_0xba7c11[_0x6531('0x7e')],_0x3dc904[_0x6531('0x5e')]):'System';}var _0xfe2a7f=util[_0x6531('0x6f')](_0x6531('0x82'),moment(_0x3dc904[_0x6531('0x83')])[_0x6531('0x6f')](_0x6531('0x84')),_0x3dc904[_0x6531('0x85')]==='in'?_0x25c9b1:_0x5c4fa3,_0x3dc904[_0x6531('0x2c')]);if(!_0x3dc904[_0x6531('0x86')]){fs[_0x6531('0x87')](_0x2c6b75,_0xfe2a7f);}}return db[_0x6531('0x88')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x6531('0x89')],'as':_0x6531('0x8a'),'raw':!![],'include':[{'model':db[_0x6531('0x8b')],'as':_0x6531('0x8b'),'raw':!![]}]}]});}}})[_0x6531('0x14')](function(_0x107c18){if(!_0x107c18||!_0x107c18[_0x6531('0x8a')]||!_0x2abb1c[_0x6531('0x2c')])return _0x522967;var _0x47c286=_0x107c18[_0x6531('0x8c')]();return respondWithRpcPromise(_0x6531('0x8d'),_0x6531('0x8e'),{'account':_0x47c286,'message':{'from':util[_0x6531('0x6f')](_0x6531('0x8f'),_0x107c18[_0x6531('0x2a')],_0x107c18[_0x6531('0x4e')]||_0x107c18[_0x6531('0x8a')]['user']),'to':_0x2abb1c[_0x6531('0x2c')][_0x6531('0x90')],'subject':_0x6531('0x91'),'text':util[_0x6531('0x6f')](_0x6531('0x92'),_0x2abb1c['body']['mailTranscript']),'attachments':[{'path':_0x2c6b75}]}})[_0x6531('0x14')](function(){return _0x522967;})[_0x6531('0x1e')](function(_0x48a0b5){logger[_0x6531('0x1a')](_0x48a0b5);});})[_0x6531('0x14')](respondWithStatusCode(_0x3125ba,0xc8))[_0x6531('0x1e')](handleError(_0x3125ba,null));};exports[_0x6531('0x93')]=function(_0x64e56e,_0x321ea0){return db['ChatMessage'][_0x6531('0x41')]({'where':{'id':_0x64e56e[_0x6531('0x44')]['id']}})[_0x6531('0x14')](handleEntityNotFound(_0x321ea0,null))['then'](function(_0x184e7f){if(_0x184e7f){return _0x184e7f['addMessage'](_0x64e56e['body'][_0x6531('0x94')],_['omit'](_0x64e56e[_0x6531('0x2c')],[_0x6531('0x94'),'id'])||{});}})[_0x6531('0x14')](respondWithResult(_0x321ea0,null))[_0x6531('0x1e')](handleError(_0x321ea0,null));};exports[_0x6531('0x95')]=function(_0x549459,_0x35c7cd){var _0x1db446={'raw':![],'where':{}};var _0x2c5d23={};var _0x819075={'count':0x0,'rows':[]};return db[_0x6531('0x32')][_0x6531('0x46')]({'where':{'id':_0x549459[_0x6531('0x44')]['id']}})[_0x6531('0x14')](handleEntityNotFound(_0x35c7cd,null))[_0x6531('0x14')](function(_0x543a92){if(_0x543a92){_0x2c5d23[_0x6531('0x38')]=_[_0x6531('0x3a')](db[_0x6531('0x57')][_0x6531('0x39')]);_0x2c5d23['query']=_['keys'](_0x549459[_0x6531('0x36')]);_0x2c5d23['filters']=_[_0x6531('0x3c')](_0x2c5d23['model'],_0x2c5d23[_0x6531('0x36')]);_0x1db446[_0x6531('0x3e')]=_[_0x6531('0x3c')](_0x2c5d23[_0x6531('0x38')],qs[_0x6531('0x3d')](_0x549459[_0x6531('0x36')][_0x6531('0x3d')]));_0x1db446['attributes']=_0x1db446[_0x6531('0x3e')]['length']?_0x1db446[_0x6531('0x3e')]:_0x2c5d23[_0x6531('0x38')];if(!_0x549459[_0x6531('0x36')]['hasOwnProperty'](_0x6531('0x96'))){_0x1db446['limit']=qs[_0x6531('0x23')](_0x549459[_0x6531('0x36')][_0x6531('0x23')]);_0x1db446[_0x6531('0x21')]=qs[_0x6531('0x21')](_0x549459[_0x6531('0x36')]['offset']);}_0x1db446[_0x6531('0x97')]=qs[_0x6531('0x98')](_0x549459[_0x6531('0x36')]['sort']);_0x1db446[_0x6531('0x99')]=qs[_0x6531('0x3b')](_['pick'](_0x549459[_0x6531('0x36')],_0x2c5d23['filters']));_0x1db446['where']['ChatInteractionId']=_0x543a92['id'];if(_0x549459[_0x6531('0x36')][_0x6531('0x9a')]){_0x1db446['where']=_[_0x6531('0x2b')](_0x1db446['where'],{'$or':_[_0x6531('0x31')](_0x1db446['attributes'],function(_0x384a4e){var _0x4df2f1={};_0x4df2f1[_0x384a4e]={'$like':'%'+_0x549459[_0x6531('0x36')][_0x6531('0x9a')]+'%'};return _0x4df2f1;})});}if(_0x549459['query'][_0x6531('0x9b')]){var _0x2af11a=_0x549459[_0x6531('0x36')][_0x6531('0x9b')]['split'](',');var _0x396b88={};_0x396b88[_0x2af11a[0x0]]={'$gte':moment(_0x2af11a[0x1])[_0x6531('0x6f')](_0x6531('0x9c'))};_0x1db446[_0x6531('0x99')]=_['merge'](_0x1db446['where'],_0x396b88);}_0x1db446=_[_0x6531('0x2b')]({},_0x1db446,_0x549459[_0x6531('0x40')]);return db[_0x6531('0x57')][_0x6531('0x24')]({'where':_0x1db446[_0x6531('0x99')]})[_0x6531('0x14')](function(_0x109c5b){_0x819075[_0x6531('0x24')]=_0x109c5b;if(_0x549459[_0x6531('0x36')]['includeAll']){_0x1db446[_0x6531('0x9d')]=[{'all':!![]}];}return db[_0x6531('0x57')][_0x6531('0x34')](_0x1db446);})[_0x6531('0x14')](function(_0x1e4b23){_0x819075[_0x6531('0x9e')]=_0x1e4b23;return _0x819075;});}})[_0x6531('0x14')](respondWithFilteredResult(_0x35c7cd,_0x1db446))[_0x6531('0x1e')](handleError(_0x35c7cd,null));};exports[_0x6531('0x9f')]=function(_0x3c88a4,_0x298b44){var _0x251d8d={'where':{}},_0x4b068d={},_0x339496={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x6531('0x46')]({'where':{'id':_0x3c88a4[_0x6531('0x44')]['id']}})[_0x6531('0x14')](handleEntityNotFound(_0x298b44,null))[_0x6531('0x14')](function(_0x514024){if(_0x514024){_0x4b068d[_0x6531('0x38')]=_['keys'](db[_0x6531('0x57')][_0x6531('0x39')]);_0x4b068d['query']=_[_0x6531('0x3a')](_0x3c88a4[_0x6531('0x36')]);_0x4b068d[_0x6531('0x3b')]=_['intersection'](_0x4b068d[_0x6531('0x38')],_0x4b068d['query']);_0x251d8d[_0x6531('0x3e')]=_[_0x6531('0x3c')](_0x4b068d[_0x6531('0x38')],qs[_0x6531('0x3d')](_0x3c88a4[_0x6531('0x36')][_0x6531('0x3d')]));_0x251d8d[_0x6531('0x3e')]=_0x251d8d[_0x6531('0x3e')][_0x6531('0x77')]?_0x251d8d[_0x6531('0x3e')]:_0x4b068d['model'];if(!_0x3c88a4['query']['hasOwnProperty'](_0x6531('0x96'))){_0x251d8d[_0x6531('0x23')]=qs[_0x6531('0x23')](_0x3c88a4[_0x6531('0x36')]['limit']);_0x251d8d[_0x6531('0x21')]=qs[_0x6531('0x21')](_0x3c88a4['query'][_0x6531('0x21')]);}_0x251d8d[_0x6531('0x97')]=qs[_0x6531('0x98')](_0x3c88a4[_0x6531('0x36')][_0x6531('0x98')]);_0x251d8d['where']=qs['filters'](_[_0x6531('0xa0')](_0x3c88a4[_0x6531('0x36')],_0x4b068d[_0x6531('0x3b')]));_0x251d8d[_0x6531('0x99')][_0x6531('0xa1')]=_0x514024['id'];if(_0x3c88a4[_0x6531('0x36')][_0x6531('0x9a')]){_0x251d8d[_0x6531('0x99')]=_[_0x6531('0x2b')](_0x251d8d[_0x6531('0x99')],{'$or':_[_0x6531('0x31')](_0x251d8d[_0x6531('0x3e')],function(_0x2fb1c8){var _0x5c8501={};_0x5c8501[_0x2fb1c8]={'$like':'%'+_0x3c88a4['query']['filter']+'%'};return _0x5c8501;})});}_0x251d8d[_0x6531('0x99')][_0x6531('0x86')]=![];if(_0x3c88a4['query']['id']){_0x251d8d['where']['id']={'$gt':_0x3c88a4[_0x6531('0x36')]['id']};}_0x251d8d=_[_0x6531('0x2b')]({},_0x251d8d,_0x3c88a4['options']);return db[_0x6531('0x57')][_0x6531('0x24')]({'where':_0x251d8d['where']})[_0x6531('0x14')](function(_0x1098b4){_0x339496[_0x6531('0x24')]=_0x1098b4;_0x251d8d[_0x6531('0x9d')]=[];if(_0x3c88a4[_0x6531('0x36')][_0x6531('0xa2')]){_0x251d8d['include'][_0x6531('0xa3')]({'model':db[_0x6531('0x74')],'as':_0x6531('0x74'),'attributes':['id',_0x6531('0x4c'),'alias']});}if(_0x3c88a4['query'][_0x6531('0x3f')]){_0x251d8d[_0x6531('0x9d')]=[{'all':!![]}];}return db[_0x6531('0x57')][_0x6531('0x34')](_0x251d8d);})[_0x6531('0x14')](function(_0xe46052){_0x339496[_0x6531('0x9e')]=_0xe46052;return _0x339496;});}})['then'](respondWithFilteredResult(_0x298b44,_0x251d8d))['catch'](handleError(_0x298b44,null));};exports[_0x6531('0xa4')]=function(_0xddfa5e,_0x468725){return db[_0x6531('0x32')][_0x6531('0x41')]({'where':{'id':_0xddfa5e['params']['id']}})['then'](handleEntityNotFound(_0x468725,null))[_0x6531('0x14')](function(_0x417e3e){if(_0x417e3e){return _0x417e3e[_0x6531('0xa5')](_0xddfa5e['body'][_0x6531('0x94')],_[_0x6531('0xa6')](_0xddfa5e[_0x6531('0x2c')],[_0x6531('0x94'),'id'])||{})['spread'](function(){return db[_0x6531('0xa7')][_0x6531('0x34')]({'attributes':['id','name',_0x6531('0xa8')],'where':{'id':_0xddfa5e[_0x6531('0x2c')][_0x6531('0x94')]}});})[_0x6531('0x14')](function(_0x1249c1){socket[_0x6531('0xa9')]('chatInteractionTags:save',{'id':Number(_0xddfa5e[_0x6531('0x44')]['id']),'tags':_0x1249c1||[]});return{'id':Number(_0xddfa5e[_0x6531('0x44')]['id']),'tags':_0x1249c1||[]};});}})[_0x6531('0x14')](respondWithResult(_0x468725,null))['catch'](handleError(_0x468725,null));};exports[_0x6531('0xaa')]=function(_0x1b1ffb,_0x301e13){return db['ChatInteraction'][_0x6531('0x41')]({'where':{'id':_0x1b1ffb[_0x6531('0x44')]['id']}})[_0x6531('0x14')](handleEntityNotFound(_0x301e13,null))['then'](function(_0x424d07){if(_0x424d07){return _0x424d07[_0x6531('0xaa')](_0x1b1ffb[_0x6531('0x36')][_0x6531('0x94')]);}})[_0x6531('0x14')](respondWithStatusCode(_0x301e13,null))[_0x6531('0x1e')](handleError(_0x301e13,null));};exports[_0x6531('0x6b')]=function(_0x27d245,_0x1119b8){var _0x46a656=moment()['unix']()[_0x6531('0xab')]();var _0x577378=path[_0x6531('0x69')](config['root'],_0x6531('0xac'),'files',_0x6531('0xad'));var _0x54990a=path[_0x6531('0x69')](config['root'],_0x6531('0xac'),_0x6531('0xae'),_0x6531('0xaf'));var _0x392deb=path[_0x6531('0x69')](_0x577378,_0x46a656);var _0x1cc140=util['format'](_0x6531('0xb0'),_0x27d245[_0x6531('0x44')]['id'],_0x46a656);var _0x3b8843=path[_0x6531('0x69')](_0x577378,_0x1cc140);var _0x5afa77=[];_0x5afa77[_0x6531('0xa3')]({'model':db[_0x6531('0x74')],'as':_0x6531('0x74'),'attributes':['id',_0x6531('0x4c')],'raw':!![]});_0x5afa77[_0x6531('0xa3')]({'model':db['CmContact'],'as':_0x6531('0xb1'),'attributes':['id',_0x6531('0xb2'),'lastName'],'raw':!![]});if(_0x27d245[_0x6531('0x36')][_0x6531('0xaf')]){_0x5afa77[_0x6531('0xa3')]({'model':db[_0x6531('0x67')],'as':'Attachment','raw':!![]});}var _0x276c0c=[{'model':db[_0x6531('0x57')],'as':_0x6531('0x73'),'attributes':['id',_0x6531('0x2c'),_0x6531('0x83'),'direction',_0x6531('0x86'),'read'],'include':_0x5afa77}];_0x276c0c[_0x6531('0xa3')]({'model':db[_0x6531('0x75')],'as':_0x6531('0xb3'),'attributes':['id',_0x6531('0x2a')]});_0x276c0c[_0x6531('0xa3')]({'model':db[_0x6531('0x74')],'as':'Owner','attributes':['id',_0x6531('0x4c')]});return db[_0x6531('0x32')][_0x6531('0x41')]({'where':{'id':_0x27d245[_0x6531('0x44')]['id']},'include':_0x276c0c})[_0x6531('0x14')](handleEntityNotFound(_0x1119b8,null))[_0x6531('0x14')](function(_0x4cd39b){if(_0x4cd39b){var _0x317531=_0x4cd39b['get']({'plain':!![]});fs[_0x6531('0xb4')](_0x392deb);var _0x3ca22a={'channel':_0x6531('0xb5'),'account':_0x317531[_0x6531('0xb3')][_0x6531('0x2a')],'agent':_0x317531[_0x6531('0xb6')]?_0x317531[_0x6531('0xb6')][_0x6531('0x4c')]:_0x6531('0xb7'),'createdAt':moment(_0x317531[_0x6531('0x83')])[_0x6531('0x6f')](_0x6531('0x9c'))[_0x6531('0xab')](),'closedAt':_0x317531[_0x6531('0x60')]?moment(_0x317531[_0x6531('0xb8')])['format'](_0x6531('0x9c'))[_0x6531('0xab')]():'','disposition':_0x317531[_0x6531('0x61')],'chatInfo':{'browser':_0x317531[_0x6531('0xb9')],'os':_0x317531[_0x6531('0xba')],'referer':_0x317531['referer'],'customerIp':_0x317531['customerIp'],'customerPort':_0x317531[_0x6531('0xbb')]?_0x317531[_0x6531('0xbb')]:_0x6531('0xb7')},'messages':_(_0x317531[_0x6531('0x73')])[_0x6531('0xbc')]()['filter']({'secret':![]})[_0x6531('0x31')](function(_0x5e3222){if(_0x5e3222[_0x6531('0x67')]){var _0x7f302c=path[_0x6531('0x69')](_0x54990a,_0x5e3222[_0x6531('0x67')][_0x6531('0x63')]);if(fs['existsSync'](_0x7f302c)){fs['createReadStream'](_0x7f302c)['pipe'](fs[_0x6531('0xbd')](path[_0x6531('0x69')](_0x392deb,_0x5e3222[_0x6531('0x67')][_0x6531('0x63')])));}}return{'date':moment(_0x5e3222['createdAt'])[_0x6531('0x6f')](_0x6531('0x9c'))[_0x6531('0xab')](),'sender':_0x5e3222[_0x6531('0x85')]===_0x6531('0x56')?_0x5e3222[_0x6531('0x74')]?_0x5e3222[_0x6531('0x74')][_0x6531('0x4c')]:_0x6531('0x78'):_0x5e3222[_0x6531('0xb1')][_0x6531('0xb2')]+(_0x5e3222[_0x6531('0xb1')][_0x6531('0xbe')]?'\x20'+_0x5e3222['Contact'][_0x6531('0xbe')]:''),'body':_0x5e3222[_0x6531('0x67')]?_0x5e3222['Attachment'][_0x6531('0x63')]:_0x5e3222[_0x6531('0x2c')],'direction':_0x5e3222[_0x6531('0x85')]===_0x6531('0x56')?'A':'C','secret':_0x5e3222[_0x6531('0x86')],'read':_0x5e3222['read'],'attachment':_0x5e3222[_0x6531('0x67')]};})[_0x6531('0xbf')]()};return ejs['renderFile'](path[_0x6531('0x69')](config[_0x6531('0x6d')],'server',_0x6531('0xc0'),_0x6531('0xc1')),{'interaction':_0x3ca22a})[_0x6531('0x14')](function(_0x5be33c){var _0x455b14=path[_0x6531('0x69')](_0x392deb,'transcript-'+_0x317531['id']+'-'+_0x46a656+_0x6531('0xc2'));var _0x10f816={'path':_0x455b14,'channel':_0x6531('0xb5'),'interactionId':_0x317531['id']};return pdf[_0x6531('0xc3')](_0x5be33c,_0x10f816);})[_0x6531('0x14')](function(){return new Promise(function(_0x29499d,_0x411eeb){zipdir(_0x392deb,{'saveTo':_0x3b8843},function(_0x540f18,_0x2e5711){if(_0x540f18)return _0x411eeb(_0x540f18);return _0x29499d(_0x2e5711);});})[_0x6531('0x14')](function(){return new BPromise(function(_0x24ab58,_0x1824c0){rimraf(_0x392deb,function(_0x228245){if(_0x228245)_0x1824c0(_0x228245);return _0x24ab58();});});})[_0x6531('0x14')](function(){return _0x1119b8[_0x6531('0x6b')](_0x3b8843,_0x1cc140,function(_0x484369){if(_0x484369){logger[_0x6531('0x1a')](_0x6531('0xc4'),_0x484369);}else{fs[_0x6531('0xc5')](_0x3b8843);}});});});}else{return _0x1119b8['sendStatus'](0xc8);}})[_0x6531('0x1e')](handleError(_0x1119b8,null));}; \ No newline at end of file +var _0xc7d6=['http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','stack','name','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','getOptions','findAll','chat','user','show','params','keys','query','model','attributes','intersection','fields','length','includeAll','include','find','create','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','fullname','email','POST','isNull','vidaooMetadata','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','AbandonInteraction','attachmentUpload','file','basename','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','format','transcript-%s.txt','Messages','User','ContactId','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','System','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ChatMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','includeAgent','push','addTags','setTags','spread','Tag','color','removeTags','unix','toString','files','tmp','server','firstName','lastName','attachments','read','Owner','mkdirSync','Chat','Account','N.A.','closedAt','disposition','referer','customerPort','tail','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client'];(function(_0x88c32c,_0x58bd6e){var _0x5d5ede=function(_0x32504e){while(--_0x32504e){_0x88c32c['push'](_0x88c32c['shift']());}};_0x5d5ede(++_0x58bd6e);}(_0xc7d6,0xb2));var _0x6c7d=function(_0x58ed06,_0x5211ee){_0x58ed06=_0x58ed06-0x0;var _0x5a4847=_0xc7d6[_0x58ed06];return _0x5a4847;};'use strict';var rimraf=require(_0x6c7d('0x0'));var zipdir=require('zip-dir');var rp=require(_0x6c7d('0x1'));var moment=require(_0x6c7d('0x2'));var BPromise=require(_0x6c7d('0x3'));var Mustache=require(_0x6c7d('0x4'));var util=require('util');var path=require(_0x6c7d('0x5'));var ejs=require(_0x6c7d('0x6'));var fs=require('fs');var _=require(_0x6c7d('0x7'));var Redis=require(_0x6c7d('0x8'));var interaction=require(_0x6c7d('0x9'));var qs=require(_0x6c7d('0xa'));var pdf=require(_0x6c7d('0xb'));var logger=require(_0x6c7d('0xc'))('api');var config=require(_0x6c7d('0xd'));var db=require(_0x6c7d('0xe'))['db'];config[_0x6c7d('0xf')]=_['defaults'](config[_0x6c7d('0xf')],{'host':_0x6c7d('0x10'),'port':0x18eb});var socket=require(_0x6c7d('0x11'))(new Redis(config[_0x6c7d('0xf')]));require('./chatInteraction.socket')[_0x6c7d('0x12')](socket);var jayson=require(_0x6c7d('0x13'));var client=jayson[_0x6c7d('0x14')]['http']({'port':0x232b});var client9004=jayson[_0x6c7d('0x14')][_0x6c7d('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x4b8fcc,_0x50f2ba,_0x162ac5,_0x4bc5f6){return new BPromise(function(_0x1ade8f,_0x1eab3e){var _0x35f57c=_0x4bc5f6||client;return _0x35f57c['request'](_0x4b8fcc,_0x162ac5)[_0x6c7d('0x16')](function(_0xf536a6){logger[_0x6c7d('0x17')](_0x6c7d('0x18'),_0x50f2ba,_0x6c7d('0x19'));logger[_0x6c7d('0x1a')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x50f2ba,_0x6c7d('0x19'),JSON[_0x6c7d('0x1b')](_0xf536a6));if(_0xf536a6[_0x6c7d('0x1c')]){if(_0xf536a6[_0x6c7d('0x1c')][_0x6c7d('0x1d')]===0x1f4){logger[_0x6c7d('0x1c')](_0x6c7d('0x18'),_0x50f2ba,_0xf536a6[_0x6c7d('0x1c')][_0x6c7d('0x1e')]);return _0x1eab3e(_0xf536a6[_0x6c7d('0x1c')][_0x6c7d('0x1e')]);}logger[_0x6c7d('0x1c')](_0x6c7d('0x18'),_0x50f2ba,_0xf536a6[_0x6c7d('0x1c')][_0x6c7d('0x1e')]);return _0x1ade8f(_0xf536a6['error'][_0x6c7d('0x1e')]);}else{logger[_0x6c7d('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x50f2ba,_0x6c7d('0x19'));_0x1ade8f(_0xf536a6[_0x6c7d('0x1f')]['message']);}})[_0x6c7d('0x20')](function(_0x59a6dd){logger[_0x6c7d('0x1c')](_0x6c7d('0x18'),_0x50f2ba,_0x59a6dd);_0x1eab3e(_0x59a6dd);});});}function respondWithStatusCode(_0x20ed49,_0x160abd){_0x160abd=_0x160abd||0xcc;return function(_0x5a773b){if(_0x5a773b){return _0x20ed49[_0x6c7d('0x21')](_0x160abd);}return _0x20ed49[_0x6c7d('0x22')](_0x160abd)[_0x6c7d('0x23')]();};}function respondWithResult(_0xe6f51e,_0x4df99e){_0x4df99e=_0x4df99e||0xc8;return function(_0x219663){if(_0x219663){return _0xe6f51e[_0x6c7d('0x22')](_0x4df99e)[_0x6c7d('0x24')](_0x219663);}};}function respondWithFilteredResult(_0x2b3c59,_0x82fc05){return function(_0x926fd3){if(_0x926fd3){var _0x3882a0=typeof _0x82fc05[_0x6c7d('0x25')]===_0x6c7d('0x26')&&typeof _0x82fc05[_0x6c7d('0x27')]==='undefined';var _0x9edee=_0x926fd3['count'];var _0x374977=_0x3882a0?0x0:_0x82fc05[_0x6c7d('0x25')];var _0x7620dd=_0x3882a0?_0x926fd3[_0x6c7d('0x28')]:_0x82fc05[_0x6c7d('0x25')]+_0x82fc05[_0x6c7d('0x27')];var _0x2ec108;if(_0x7620dd>=_0x9edee){_0x7620dd=_0x9edee;_0x2ec108=0xc8;}else{_0x2ec108=0xce;}_0x2b3c59[_0x6c7d('0x22')](_0x2ec108);return _0x2b3c59['set'](_0x6c7d('0x29'),_0x374977+'-'+_0x7620dd+'/'+_0x9edee)[_0x6c7d('0x24')](_0x926fd3);}return null;};}function saveUpdates(_0x2188dd){return function(_0x3cad25){if(_0x3cad25){return _0x3cad25[_0x6c7d('0x2a')](_0x2188dd)[_0x6c7d('0x16')](function(_0x412ec8){return _0x412ec8;});}return null;};}function removeEntity(_0x520607){return function(_0xa55e2c){if(_0xa55e2c){return _0xa55e2c['destroy']()[_0x6c7d('0x16')](function(){_0x520607['status'](0xcc)[_0x6c7d('0x23')]();});}};}function handleEntityNotFound(_0x924202){return function(_0x13e105){if(!_0x13e105){_0x924202[_0x6c7d('0x21')](0x194);}return _0x13e105;};}function handleError(_0x3ad548,_0x4907f2){_0x4907f2=_0x4907f2||0x1f4;return function(_0x551139){logger[_0x6c7d('0x1c')](_0x551139[_0x6c7d('0x2b')]);if(_0x551139[_0x6c7d('0x2c')]){delete _0x551139[_0x6c7d('0x2c')];}_0x3ad548[_0x6c7d('0x22')](_0x4907f2)['send'](_0x551139);};}function getMustacheRender(_0x4ea9e4,_0x34bb58){return Mustache[_0x6c7d('0x2d')](_0x4ea9e4,_[_0x6c7d('0x2e')](_0x34bb58[_0x6c7d('0x2f')],{'contact':_0x34bb58[_0x6c7d('0x30')],'message':_0x34bb58[_0x6c7d('0x1e')],'agent':_0x34bb58[_0x6c7d('0x31')],'interaction':_0x34bb58[_0x6c7d('0x32')],'account':_0x34bb58[_0x6c7d('0x33')]}))||'';}exports[_0x6c7d('0x34')]=function(_0x4746cd,_0x4fa762){var _0xe48ed0={};var _0x2337f7=_[_0x6c7d('0x35')](db[_0x6c7d('0x36')][_0x6c7d('0x37')],function(_0x1d09b2){return{'name':_0x1d09b2[_0x6c7d('0x38')],'type':_0x1d09b2[_0x6c7d('0x39')]['key']};});_0xe48ed0=qs[_0x6c7d('0x3a')](_0x2337f7,_0x4746cd);return interaction[_0x6c7d('0x3b')](_0x6c7d('0x3c'),_0x4746cd['query'],_0x4746cd[_0x6c7d('0x3d')],_0xe48ed0,_0x2337f7)[_0x6c7d('0x16')](respondWithFilteredResult(_0x4fa762,_0xe48ed0))[_0x6c7d('0x20')](handleError(_0x4fa762,null));};exports[_0x6c7d('0x3e')]=function(_0x6f4bf6,_0x16fbf9){var _0x575669={'raw':![],'where':{'id':_0x6f4bf6[_0x6c7d('0x3f')]['id']}},_0x1fbf26={};_0x1fbf26['model']=_[_0x6c7d('0x40')](db[_0x6c7d('0x36')][_0x6c7d('0x37')]);_0x1fbf26[_0x6c7d('0x41')]=_['keys'](_0x6f4bf6[_0x6c7d('0x41')]);_0x1fbf26['filters']=_['intersection'](_0x1fbf26[_0x6c7d('0x42')],_0x1fbf26[_0x6c7d('0x41')]);_0x575669[_0x6c7d('0x43')]=_[_0x6c7d('0x44')](_0x1fbf26[_0x6c7d('0x42')],qs[_0x6c7d('0x45')](_0x6f4bf6[_0x6c7d('0x41')][_0x6c7d('0x45')]));_0x575669[_0x6c7d('0x43')]=_0x575669['attributes'][_0x6c7d('0x46')]?_0x575669[_0x6c7d('0x43')]:_0x1fbf26[_0x6c7d('0x42')];if(_0x6f4bf6[_0x6c7d('0x41')][_0x6c7d('0x47')]){_0x575669[_0x6c7d('0x48')]=[{'all':!![]}];}_0x575669=_['merge']({},_0x575669,_0x6f4bf6['options']);return db[_0x6c7d('0x36')][_0x6c7d('0x49')](_0x575669)['then'](handleEntityNotFound(_0x16fbf9,null))[_0x6c7d('0x16')](respondWithResult(_0x16fbf9,null))['catch'](handleError(_0x16fbf9,null));};exports[_0x6c7d('0x4a')]=function(_0x3ddcf9,_0x1e263b){return db[_0x6c7d('0x36')][_0x6c7d('0x4a')](_0x3ddcf9[_0x6c7d('0x2f')],{})[_0x6c7d('0x16')](respondWithResult(_0x1e263b,0xc9))[_0x6c7d('0x20')](handleError(_0x1e263b,null));};exports['update']=function(_0x51c506,_0x15977c){if(_0x51c506[_0x6c7d('0x2f')]['id']){delete _0x51c506[_0x6c7d('0x2f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x51c506['params']['id']}})['then'](handleEntityNotFound(_0x15977c,null))[_0x6c7d('0x16')](saveUpdates(_0x51c506[_0x6c7d('0x2f')],null))[_0x6c7d('0x16')](respondWithResult(_0x15977c,null))[_0x6c7d('0x20')](handleError(_0x15977c,null));};exports[_0x6c7d('0x4b')]=function(_0x20264c,_0x1ad3f3){return db[_0x6c7d('0x36')]['find']({'where':{'id':_0x20264c[_0x6c7d('0x3f')]['id']}})[_0x6c7d('0x16')](handleEntityNotFound(_0x1ad3f3,null))['then'](removeEntity(_0x1ad3f3,null))[_0x6c7d('0x20')](handleError(_0x1ad3f3,null));};exports[_0x6c7d('0x4c')]=function(_0x57bf82,_0x373db4){return db[_0x6c7d('0x36')][_0x6c7d('0x4c')]()['then'](respondWithResult(_0x373db4,null))['catch'](handleError(_0x373db4,null));};exports[_0x6c7d('0x4d')]=function(_0x254481,_0xad49cd){var _0x2260b6=_0x254481[_0x6c7d('0x3f')]['id'];var _0x3454dc;var _0x504da7;var _0x2ac95f;return db['ChatInteraction'][_0x6c7d('0x4e')]({'where':{'id':_0x2260b6}})[_0x6c7d('0x16')](function(_0x25053e){_0x3454dc=_0x25053e;return db[_0x6c7d('0x4f')][_0x6c7d('0x4e')]({'where':{'id':_0x25053e[_0x6c7d('0x50')]},'attributes':['id','vidaooApiKey',_0x6c7d('0x51'),_0x6c7d('0x52'),_0x6c7d('0x53'),'vidaooMetadata'],'raw':!![]});})[_0x6c7d('0x16')](function(_0x56d4bf){if(_0x56d4bf&&_0x56d4bf[_0x6c7d('0x54')]&&_0x56d4bf[_0x6c7d('0x51')]){_0x504da7=_0x56d4bf;var _0x25377e={'interaction':{'id':_0x2260b6},'agent':{'id':_0x254481[_0x6c7d('0x3d')]['id'],'name':_0x254481[_0x6c7d('0x3d')][_0x6c7d('0x2c')],'fullname':_0x254481[_0x6c7d('0x3d')][_0x6c7d('0x55')],'email':_0x254481[_0x6c7d('0x3d')][_0x6c7d('0x56')]},'contact':_0x254481['body'][_0x6c7d('0x30')],'account':_0x254481['body'][_0x6c7d('0x33')]};var _0x42b763={'rejectUnauthorized':![],'method':_0x6c7d('0x57'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x56d4bf[_0x6c7d('0x54')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x254481[_0x6c7d('0x3d')][_0x6c7d('0x56')]],'buttons':null,'topic':_0x504da7[_0x6c7d('0x52')],'note':_['isNull'](_0x504da7['vidaooNote'])?null:getMustacheRender(_0x504da7['vidaooNote'],_0x25377e),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x6c7d('0x58')](_0x504da7[_0x6c7d('0x59')])){var _0x177335=getMustacheRender(_0x504da7[_0x6c7d('0x59')],_0x25377e);var _0x47bf11=JSON[_0x6c7d('0x5a')](_0x177335);_0x42b763[_0x6c7d('0x2f')]['metadata']=_0x47bf11;}}catch(_0x46fa44){throw new db[(_0x6c7d('0x5b'))][(_0x6c7d('0x5c'))](_0x6c7d('0x5d'));}return rp(_0x42b763);}else{throw new db[(_0x6c7d('0x5b'))][(_0x6c7d('0x5c'))](_0x6c7d('0x5e'));}})[_0x6c7d('0x16')](function(_0x128563){_0x2ac95f=_0x128563;if(_0x2ac95f['id']){var _0x221854={'body':_0x2ac95f[_0x6c7d('0x5f')],'ChatWebsiteId':_0x504da7['id'],'ChatInteractionId':_0x3454dc['id'],'direction':_0x6c7d('0x60'),'UserId':_0x254481['user']['id']};return db['ChatMessage']['create'](_0x221854,{});}else{throw new db['Sequelize'][(_0x6c7d('0x5c'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x6c7d('0x16')](function(){return _0x3454dc['updateAttributes']({'vidaooSessionId':_0x2ac95f['id']});})[_0x6c7d('0x16')](respondWithResult(_0xad49cd,null))['catch'](handleError(_0xad49cd,null));};exports[_0x6c7d('0x61')]=function(_0x3d1723,_0xafedaf){if(_0x3d1723[_0x6c7d('0x2f')]['id']){delete _0x3d1723[_0x6c7d('0x2f')]['id'];}return db[_0x6c7d('0x36')][_0x6c7d('0x49')]({'where':{'id':_0x3d1723[_0x6c7d('0x3f')]['id']},'include':[{'model':db[_0x6c7d('0x62')],'as':_0x6c7d('0x63')}]})[_0x6c7d('0x16')](handleEntityNotFound(_0xafedaf,null))[_0x6c7d('0x16')](saveUpdates(_0x3d1723[_0x6c7d('0x2f')],null))[_0x6c7d('0x16')](respondWithResult(_0xafedaf,null))[_0x6c7d('0x20')](handleError(_0xafedaf,null));};exports[_0x6c7d('0x64')]=function(_0x4ff600,_0x34a3d3){if(_0x4ff600['body']['id']){delete _0x4ff600[_0x6c7d('0x2f')]['id'];}return db[_0x6c7d('0x36')]['find']({'where':{'id':_0x4ff600[_0x6c7d('0x3f')]['id']}})[_0x6c7d('0x16')](function(_0x1bfd5e){if(!_0x1bfd5e){logger[_0x6c7d('0x1c')](_0x6c7d('0x65'),_0x6c7d('0x64'),0x194,_0x6c7d('0x66'));_0x34a3d3['sendStatus'](0x194);}else{if(_0x1bfd5e[_0x6c7d('0x67')]){throw new db[(_0x6c7d('0x5b'))][(_0x6c7d('0x5c'))]('Interaction\x20already\x20assigned');}}return _0x1bfd5e;})['then'](function(_0x416311){if(_0x416311){return _0x416311['update']({'closed':_0x4ff600[_0x6c7d('0x2f')][_0x6c7d('0x68')],'disposition':_0x4ff600['body']['disposition']})['then'](function(_0x44c80a){return _0x44c80a;});}})[_0x6c7d('0x16')](function(){return respondWithRpcPromise(_0x6c7d('0x69'),_0x6c7d('0x64'),_0x4ff600['body'],client9004);})[_0x6c7d('0x16')](respondWithResult(_0x34a3d3,null))[_0x6c7d('0x20')](handleError(_0x34a3d3,null));};exports[_0x6c7d('0x6a')]=function(_0xfbc3eb,_0x572d48){_0xfbc3eb[_0x6c7d('0x2f')]['name']=_0xfbc3eb[_0x6c7d('0x6b')]['originalname'];_0xfbc3eb[_0x6c7d('0x2f')][_0x6c7d('0x6c')]=_0xfbc3eb[_0x6c7d('0x6b')][_0x6c7d('0x6d')];_0xfbc3eb[_0x6c7d('0x2f')][_0x6c7d('0x39')]=_0xfbc3eb[_0x6c7d('0x6b')]['mimetype'];return db[_0x6c7d('0x6e')]['create'](_0xfbc3eb['body'])[_0x6c7d('0x16')](respondWithResult(_0x572d48,0xc9))['catch'](handleError(_0x572d48,null));};exports[_0x6c7d('0x6f')]=function(_0x417b03,_0x6469d4){return db[_0x6c7d('0x36')][_0x6c7d('0x4e')]({'where':{'id':_0x417b03['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x6469d4,null))[_0x6c7d('0x16')](function(_0x960ad9){if(_0x960ad9){if(_0x960ad9[_0x6c7d('0x68')]){return _0x6469d4['status'](0x193)[_0x6c7d('0x24')]({'status':0x193,'message':_0x6c7d('0x70')});}return db[_0x6c7d('0x6e')][_0x6c7d('0x4e')]({'where':{'id':_0x417b03[_0x6c7d('0x41')][_0x6c7d('0x71')]},'raw':!![]})[_0x6c7d('0x16')](handleEntityNotFound(_0x6469d4,null));}})[_0x6c7d('0x16')](function(_0x589c50){if(_0x589c50){var _0x476c2f=_0x589c50[_0x6c7d('0x72')]!==null;var _0x38291d=path[_0x6c7d('0x73')](config[_0x6c7d('0x74')],_0x6c7d('0x75'));if(_0x476c2f){_0x38291d=path[_0x6c7d('0x73')](_0x38291d,_0x6c7d('0x76'));}var _0xc5c87=path['join'](_0x38291d,_0x589c50['basename']);return _0x6469d4[_0x6c7d('0x77')](_0xc5c87);}})['catch'](handleError(_0x6469d4,null));};exports['close']=function(_0x2ad0da,_0x3ef974){var _0x493bba=null;var _0xb77029=null;var _0x2f1136=null;if(_0x2ad0da[_0x6c7d('0x2f')]['id']){delete _0x2ad0da[_0x6c7d('0x2f')]['id'];}if(_0x2ad0da['body'][_0x6c7d('0x78')]){_0x2f1136=path[_0x6c7d('0x73')](config[_0x6c7d('0x74')],'server/files/chat/upload/',util[_0x6c7d('0x79')](_0x6c7d('0x7a'),Date['now']()));_0x2ad0da[_0x6c7d('0x2f')]['pathTranscript']=_0x2f1136;}return db[_0x6c7d('0x36')][_0x6c7d('0x49')]({'where':{'id':_0x2ad0da['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x6c7d('0x7b'),'include':[{'model':db[_0x6c7d('0x7c')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x3ef974,null))[_0x6c7d('0x16')](saveUpdates(_0x2ad0da['body'],null))[_0x6c7d('0x16')](function(_0x4398fe){if(_0x4398fe){_0x493bba=_0x4398fe;return db[_0x6c7d('0x4f')]['find']({'where':{'id':_0x493bba[_0x6c7d('0x50')]}});}})[_0x6c7d('0x16')](function(_0x251826){if(_0x251826){_0xb77029=_0x251826;return db[_0x6c7d('0x62')][_0x6c7d('0x49')]({'where':{'id':_0x493bba[_0x6c7d('0x7d')]}});}})['then'](function(_0x2e0ff1){if(_0x2e0ff1){if(_0x2f1136){var _0x4baf51=null;for(var _0x9baf88=0x1;_0x9baf88<_0x493bba[_0x6c7d('0x7b')][_0x6c7d('0x46')];++_0x9baf88){_0x4baf51=_0x493bba[_0x6c7d('0x7b')][_0x9baf88];var _0x3fc977=_0x4baf51['UserId']?util[_0x6c7d('0x79')](_0x6c7d('0x7e'),_0xb77029[_0x6c7d('0x7f')],_0x4baf51[_0x6c7d('0x67')]):'System';var _0x3a2afc=_0x2ad0da[_0x6c7d('0x2f')][_0x6c7d('0x80')]||util[_0x6c7d('0x79')](_0x6c7d('0x7e'),_0x6c7d('0x81'),_0x4baf51[_0x6c7d('0x7d')]);switch(_0xb77029[_0x6c7d('0x82')]){case _0x6c7d('0x83'):_0x3fc977=_0x4baf51[_0x6c7d('0x67')]?util[_0x6c7d('0x79')]('%s%d',_0xb77029[_0x6c7d('0x7f')],_0x4baf51[_0x6c7d('0x67')]):'System';break;case _0x6c7d('0x84'):_0x3fc977=_0x4baf51[_0x6c7d('0x67')]?_0x4baf51['User'][_0x6c7d('0x85')]||_0x4baf51[_0x6c7d('0x7c')][_0x6c7d('0x55')]:_0x6c7d('0x86');break;case'agent_fullname':_0x3fc977=_0x4baf51[_0x6c7d('0x67')]?_0x4baf51[_0x6c7d('0x7c')]['fullname']:_0x6c7d('0x86');break;default:_0x3fc977=_0x4baf51[_0x6c7d('0x67')]?util[_0x6c7d('0x79')](_0x6c7d('0x7e'),_0xb77029['agentAlias'],_0x4baf51[_0x6c7d('0x67')]):_0x6c7d('0x86');}var _0x2b60f6=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x4baf51[_0x6c7d('0x87')])['format'](_0x6c7d('0x88')),_0x4baf51[_0x6c7d('0x89')]==='in'?_0x3a2afc:_0x3fc977,_0x4baf51[_0x6c7d('0x2f')]);if(!_0x4baf51[_0x6c7d('0x8a')]){fs[_0x6c7d('0x8b')](_0x2f1136,_0x2b60f6);}}return db[_0x6c7d('0x8c')][_0x6c7d('0x4e')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x6c7d('0x8d'),'raw':!![],'include':[{'model':db[_0x6c7d('0x8e')],'as':_0x6c7d('0x8e'),'raw':!![]}]}]});}}})[_0x6c7d('0x16')](function(_0x1d4804){if(!_0x1d4804||!_0x1d4804['Smtp']||!_0x2ad0da[_0x6c7d('0x2f')])return _0x493bba;var _0x1e46a8=_0x1d4804['getSmtpOptions']();return respondWithRpcPromise(_0x6c7d('0x8f'),'sendMail',{'account':_0x1e46a8,'message':{'from':util[_0x6c7d('0x79')](_0x6c7d('0x90'),_0x1d4804[_0x6c7d('0x2c')],_0x1d4804[_0x6c7d('0x56')]||_0x1d4804[_0x6c7d('0x8d')][_0x6c7d('0x3d')]),'to':_0x2ad0da[_0x6c7d('0x2f')][_0x6c7d('0x78')],'subject':_0x6c7d('0x91'),'text':util[_0x6c7d('0x79')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x2ad0da['body'][_0x6c7d('0x78')]),'attachments':[{'path':_0x2f1136}]}})['then'](function(){return _0x493bba;})[_0x6c7d('0x20')](function(_0x22b83e){logger[_0x6c7d('0x1c')](_0x22b83e);});})[_0x6c7d('0x16')](respondWithStatusCode(_0x3ef974,0xc8))[_0x6c7d('0x20')](handleError(_0x3ef974,null));};exports[_0x6c7d('0x92')]=function(_0x501fe7,_0x340bc0){return db[_0x6c7d('0x93')][_0x6c7d('0x49')]({'where':{'id':_0x501fe7[_0x6c7d('0x3f')]['id']}})[_0x6c7d('0x16')](handleEntityNotFound(_0x340bc0,null))[_0x6c7d('0x16')](function(_0x15137c){if(_0x15137c){return _0x15137c[_0x6c7d('0x92')](_0x501fe7[_0x6c7d('0x2f')][_0x6c7d('0x94')],_[_0x6c7d('0x95')](_0x501fe7['body'],['ids','id'])||{});}})[_0x6c7d('0x16')](respondWithResult(_0x340bc0,null))[_0x6c7d('0x20')](handleError(_0x340bc0,null));};exports[_0x6c7d('0x96')]=function(_0x12c9e6,_0x1c10af){var _0x326255={'raw':![],'where':{}};var _0x4d8315={};var _0xd62a40={'count':0x0,'rows':[]};return db[_0x6c7d('0x36')][_0x6c7d('0x4e')]({'where':{'id':_0x12c9e6['params']['id']}})[_0x6c7d('0x16')](handleEntityNotFound(_0x1c10af,null))['then'](function(_0x324513){if(_0x324513){_0x4d8315[_0x6c7d('0x42')]=_['keys'](db[_0x6c7d('0x93')][_0x6c7d('0x37')]);_0x4d8315[_0x6c7d('0x41')]=_[_0x6c7d('0x40')](_0x12c9e6[_0x6c7d('0x41')]);_0x4d8315['filters']=_['intersection'](_0x4d8315[_0x6c7d('0x42')],_0x4d8315[_0x6c7d('0x41')]);_0x326255['attributes']=_['intersection'](_0x4d8315[_0x6c7d('0x42')],qs[_0x6c7d('0x45')](_0x12c9e6['query'][_0x6c7d('0x45')]));_0x326255[_0x6c7d('0x43')]=_0x326255[_0x6c7d('0x43')][_0x6c7d('0x46')]?_0x326255['attributes']:_0x4d8315[_0x6c7d('0x42')];if(!_0x12c9e6[_0x6c7d('0x41')][_0x6c7d('0x97')](_0x6c7d('0x98'))){_0x326255['limit']=qs[_0x6c7d('0x27')](_0x12c9e6['query'][_0x6c7d('0x27')]);_0x326255[_0x6c7d('0x25')]=qs[_0x6c7d('0x25')](_0x12c9e6[_0x6c7d('0x41')][_0x6c7d('0x25')]);}_0x326255[_0x6c7d('0x99')]=qs[_0x6c7d('0x9a')](_0x12c9e6['query'][_0x6c7d('0x9a')]);_0x326255[_0x6c7d('0x9b')]=qs[_0x6c7d('0x9c')](_[_0x6c7d('0x9d')](_0x12c9e6[_0x6c7d('0x41')],_0x4d8315['filters']));_0x326255['where']['ChatInteractionId']=_0x324513['id'];if(_0x12c9e6[_0x6c7d('0x41')][_0x6c7d('0x9e')]){_0x326255[_0x6c7d('0x9b')]=_[_0x6c7d('0x2e')](_0x326255[_0x6c7d('0x9b')],{'$or':_[_0x6c7d('0x35')](_0x326255['attributes'],function(_0x5a1aa5){var _0x129a83={};_0x129a83[_0x5a1aa5]={'$like':'%'+_0x12c9e6[_0x6c7d('0x41')]['filter']+'%'};return _0x129a83;})});}if(_0x12c9e6[_0x6c7d('0x41')][_0x6c7d('0x9f')]){var _0x225188=_0x12c9e6[_0x6c7d('0x41')][_0x6c7d('0x9f')][_0x6c7d('0xa0')](',');var _0x202f99={};_0x202f99[_0x225188[0x0]]={'$gte':moment(_0x225188[0x1])[_0x6c7d('0x79')](_0x6c7d('0xa1'))};_0x326255[_0x6c7d('0x9b')]=_[_0x6c7d('0x2e')](_0x326255[_0x6c7d('0x9b')],_0x202f99);}_0x326255=_[_0x6c7d('0x2e')]({},_0x326255,_0x12c9e6[_0x6c7d('0xa2')]);return db[_0x6c7d('0x93')][_0x6c7d('0x28')]({'where':_0x326255['where']})[_0x6c7d('0x16')](function(_0x2a5bc4){_0xd62a40[_0x6c7d('0x28')]=_0x2a5bc4;if(_0x12c9e6[_0x6c7d('0x41')]['includeAll']){_0x326255[_0x6c7d('0x48')]=[{'all':!![]}];}return db['ChatMessage'][_0x6c7d('0x3b')](_0x326255);})[_0x6c7d('0x16')](function(_0x14cf1f){_0xd62a40[_0x6c7d('0xa3')]=_0x14cf1f;return _0xd62a40;});}})[_0x6c7d('0x16')](respondWithFilteredResult(_0x1c10af,_0x326255))[_0x6c7d('0x20')](handleError(_0x1c10af,null));};exports['getMyMessages']=function(_0x3d7664,_0x4b0805){var _0x2a091b={'where':{}},_0x345546={},_0x31e9bf={'count':0x0,'rows':[]};return db[_0x6c7d('0x36')][_0x6c7d('0x4e')]({'where':{'id':_0x3d7664[_0x6c7d('0x3f')]['id']}})[_0x6c7d('0x16')](handleEntityNotFound(_0x4b0805,null))[_0x6c7d('0x16')](function(_0x5a5173){if(_0x5a5173){_0x345546[_0x6c7d('0x42')]=_[_0x6c7d('0x40')](db['ChatMessage']['rawAttributes']);_0x345546['query']=_[_0x6c7d('0x40')](_0x3d7664['query']);_0x345546[_0x6c7d('0x9c')]=_[_0x6c7d('0x44')](_0x345546[_0x6c7d('0x42')],_0x345546['query']);_0x2a091b['attributes']=_['intersection'](_0x345546['model'],qs['fields'](_0x3d7664['query'][_0x6c7d('0x45')]));_0x2a091b[_0x6c7d('0x43')]=_0x2a091b[_0x6c7d('0x43')][_0x6c7d('0x46')]?_0x2a091b['attributes']:_0x345546['model'];if(!_0x3d7664[_0x6c7d('0x41')][_0x6c7d('0x97')]('nolimit')){_0x2a091b['limit']=qs[_0x6c7d('0x27')](_0x3d7664[_0x6c7d('0x41')][_0x6c7d('0x27')]);_0x2a091b[_0x6c7d('0x25')]=qs[_0x6c7d('0x25')](_0x3d7664[_0x6c7d('0x41')]['offset']);}_0x2a091b[_0x6c7d('0x99')]=qs[_0x6c7d('0x9a')](_0x3d7664['query'][_0x6c7d('0x9a')]);_0x2a091b['where']=qs[_0x6c7d('0x9c')](_['pick'](_0x3d7664['query'],_0x345546[_0x6c7d('0x9c')]));_0x2a091b['where']['ChatInteractionId']=_0x5a5173['id'];if(_0x3d7664[_0x6c7d('0x41')][_0x6c7d('0x9e')]){_0x2a091b['where']=_['merge'](_0x2a091b[_0x6c7d('0x9b')],{'$or':_[_0x6c7d('0x35')](_0x2a091b[_0x6c7d('0x43')],function(_0x2c1e1d){var _0x3fc3d7={};_0x3fc3d7[_0x2c1e1d]={'$like':'%'+_0x3d7664[_0x6c7d('0x41')][_0x6c7d('0x9e')]+'%'};return _0x3fc3d7;})});}_0x2a091b['where']['secret']=![];if(_0x3d7664[_0x6c7d('0x41')]['id']){_0x2a091b[_0x6c7d('0x9b')]['id']={'$gt':_0x3d7664[_0x6c7d('0x41')]['id']};}_0x2a091b=_[_0x6c7d('0x2e')]({},_0x2a091b,_0x3d7664[_0x6c7d('0xa2')]);return db[_0x6c7d('0x93')][_0x6c7d('0x28')]({'where':_0x2a091b['where']})[_0x6c7d('0x16')](function(_0x2ae8f3){_0x31e9bf[_0x6c7d('0x28')]=_0x2ae8f3;_0x2a091b['include']=[];if(_0x3d7664[_0x6c7d('0x41')][_0x6c7d('0xa4')]){_0x2a091b['include'][_0x6c7d('0xa5')]({'model':db[_0x6c7d('0x7c')],'as':'User','attributes':['id','fullname','alias']});}if(_0x3d7664[_0x6c7d('0x41')][_0x6c7d('0x47')]){_0x2a091b[_0x6c7d('0x48')]=[{'all':!![]}];}return db[_0x6c7d('0x93')][_0x6c7d('0x3b')](_0x2a091b);})[_0x6c7d('0x16')](function(_0x527f8f){_0x31e9bf[_0x6c7d('0xa3')]=_0x527f8f;return _0x31e9bf;});}})[_0x6c7d('0x16')](respondWithFilteredResult(_0x4b0805,_0x2a091b))[_0x6c7d('0x20')](handleError(_0x4b0805,null));};exports[_0x6c7d('0xa6')]=function(_0x1dd395,_0x1cb779){return db['ChatInteraction'][_0x6c7d('0x49')]({'where':{'id':_0x1dd395[_0x6c7d('0x3f')]['id']}})[_0x6c7d('0x16')](handleEntityNotFound(_0x1cb779,null))[_0x6c7d('0x16')](function(_0x441029){if(_0x441029){return _0x441029[_0x6c7d('0xa7')](_0x1dd395['body'][_0x6c7d('0x94')],_['omit'](_0x1dd395[_0x6c7d('0x2f')],[_0x6c7d('0x94'),'id'])||{})[_0x6c7d('0xa8')](function(){return db[_0x6c7d('0xa9')]['findAll']({'attributes':['id',_0x6c7d('0x2c'),_0x6c7d('0xaa')],'where':{'id':_0x1dd395['body'][_0x6c7d('0x94')]}});})['then'](function(_0x3d68af){socket['emit']('chatInteractionTags:save',{'id':Number(_0x1dd395[_0x6c7d('0x3f')]['id']),'tags':_0x3d68af||[]});return{'id':Number(_0x1dd395[_0x6c7d('0x3f')]['id']),'tags':_0x3d68af||[]};});}})[_0x6c7d('0x16')](respondWithResult(_0x1cb779,null))['catch'](handleError(_0x1cb779,null));};exports[_0x6c7d('0xab')]=function(_0x4f74a2,_0x34c6fd){return db[_0x6c7d('0x36')][_0x6c7d('0x49')]({'where':{'id':_0x4f74a2[_0x6c7d('0x3f')]['id']}})['then'](handleEntityNotFound(_0x34c6fd,null))['then'](function(_0x30f34c){if(_0x30f34c){return _0x30f34c[_0x6c7d('0xab')](_0x4f74a2[_0x6c7d('0x41')][_0x6c7d('0x94')]);}})[_0x6c7d('0x16')](respondWithStatusCode(_0x34c6fd,null))[_0x6c7d('0x20')](handleError(_0x34c6fd,null));};exports[_0x6c7d('0x77')]=function(_0x1363d5,_0x5068f0){var _0x1cf8c7=moment()[_0x6c7d('0xac')]()[_0x6c7d('0xad')]();var _0x2c7025=path[_0x6c7d('0x73')](config[_0x6c7d('0x74')],'server',_0x6c7d('0xae'),_0x6c7d('0xaf'));var _0x26c2ca=path[_0x6c7d('0x73')](config[_0x6c7d('0x74')],_0x6c7d('0xb0'),_0x6c7d('0xae'),'attachments');var _0x3d45fd=path[_0x6c7d('0x73')](_0x2c7025,_0x1cf8c7);var _0x3f4cfd=util[_0x6c7d('0x79')]('transcript-%d-%s.zip',_0x1363d5[_0x6c7d('0x3f')]['id'],_0x1cf8c7);var _0x3b17ff=path[_0x6c7d('0x73')](_0x2c7025,_0x3f4cfd);var _0x542c50=[];_0x542c50[_0x6c7d('0xa5')]({'model':db[_0x6c7d('0x7c')],'as':_0x6c7d('0x7c'),'attributes':['id','fullname'],'raw':!![]});_0x542c50[_0x6c7d('0xa5')]({'model':db[_0x6c7d('0x62')],'as':_0x6c7d('0x63'),'attributes':['id',_0x6c7d('0xb1'),_0x6c7d('0xb2')],'raw':!![]});if(_0x1363d5[_0x6c7d('0x41')][_0x6c7d('0xb3')]){_0x542c50['push']({'model':db['Attachment'],'as':_0x6c7d('0x6e'),'raw':!![]});}var _0x8087cb=[{'model':db['ChatMessage'],'as':_0x6c7d('0x7b'),'attributes':['id',_0x6c7d('0x2f'),_0x6c7d('0x87'),_0x6c7d('0x89'),_0x6c7d('0x8a'),_0x6c7d('0xb4')],'include':_0x542c50}];_0x8087cb[_0x6c7d('0xa5')]({'model':db[_0x6c7d('0x4f')],'as':'Account','attributes':['id',_0x6c7d('0x2c')]});_0x8087cb[_0x6c7d('0xa5')]({'model':db[_0x6c7d('0x7c')],'as':_0x6c7d('0xb5'),'attributes':['id',_0x6c7d('0x55')]});return db['ChatInteraction'][_0x6c7d('0x49')]({'where':{'id':_0x1363d5['params']['id']},'include':_0x8087cb})[_0x6c7d('0x16')](handleEntityNotFound(_0x5068f0,null))[_0x6c7d('0x16')](function(_0x3748cd){if(_0x3748cd){var _0x25341d=_0x3748cd['get']({'plain':!![]});fs[_0x6c7d('0xb6')](_0x3d45fd);var _0x56e340={'channel':_0x6c7d('0xb7'),'account':_0x25341d[_0x6c7d('0xb8')][_0x6c7d('0x2c')],'agent':_0x25341d[_0x6c7d('0xb5')]?_0x25341d[_0x6c7d('0xb5')][_0x6c7d('0x55')]:_0x6c7d('0xb9'),'createdAt':moment(_0x25341d[_0x6c7d('0x87')])[_0x6c7d('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6c7d('0xad')](),'closedAt':_0x25341d['closed']?moment(_0x25341d[_0x6c7d('0xba')])[_0x6c7d('0x79')](_0x6c7d('0xa1'))[_0x6c7d('0xad')]():'','disposition':_0x25341d[_0x6c7d('0xbb')],'chatInfo':{'browser':_0x25341d['browserName'],'os':_0x25341d['osName'],'referer':_0x25341d[_0x6c7d('0xbc')],'customerIp':_0x25341d['customerIp'],'customerPort':_0x25341d[_0x6c7d('0xbd')]?_0x25341d[_0x6c7d('0xbd')]:_0x6c7d('0xb9')},'messages':_(_0x25341d[_0x6c7d('0x7b')])[_0x6c7d('0xbe')]()['filter']({'secret':![]})[_0x6c7d('0x35')](function(_0x195319){if(_0x195319[_0x6c7d('0x6e')]){var _0x503f50=path[_0x6c7d('0x73')](_0x26c2ca,_0x195319['Attachment'][_0x6c7d('0x6c')]);if(fs['existsSync'](_0x503f50)){fs['createReadStream'](_0x503f50)[_0x6c7d('0xbf')](fs[_0x6c7d('0xc0')](path[_0x6c7d('0x73')](_0x3d45fd,_0x195319[_0x6c7d('0x6e')][_0x6c7d('0x6c')])));}}return{'date':moment(_0x195319[_0x6c7d('0x87')])[_0x6c7d('0x79')](_0x6c7d('0xa1'))[_0x6c7d('0xad')](),'sender':_0x195319[_0x6c7d('0x89')]===_0x6c7d('0x60')?_0x195319[_0x6c7d('0x7c')]?_0x195319[_0x6c7d('0x7c')][_0x6c7d('0x55')]:_0x6c7d('0x86'):_0x195319[_0x6c7d('0x63')][_0x6c7d('0xb1')]+(_0x195319[_0x6c7d('0x63')][_0x6c7d('0xb2')]?'\x20'+_0x195319[_0x6c7d('0x63')][_0x6c7d('0xb2')]:''),'body':_0x195319['Attachment']?_0x195319[_0x6c7d('0x6e')][_0x6c7d('0x6c')]:_0x195319['body'],'direction':_0x195319[_0x6c7d('0x89')]===_0x6c7d('0x60')?'A':'C','secret':_0x195319[_0x6c7d('0x8a')],'read':_0x195319[_0x6c7d('0xb4')],'attachment':_0x195319[_0x6c7d('0x6e')]};})['value']()};return ejs[_0x6c7d('0xc1')](path[_0x6c7d('0x73')](config[_0x6c7d('0x74')],_0x6c7d('0xb0'),_0x6c7d('0xc2'),_0x6c7d('0xc3')),{'interaction':_0x56e340})[_0x6c7d('0x16')](function(_0x973c7f){var _0x15e636=path[_0x6c7d('0x73')](_0x3d45fd,_0x6c7d('0xc4')+_0x25341d['id']+'-'+_0x1cf8c7+'.pdf');var _0x5c5d38={'path':_0x15e636,'channel':_0x6c7d('0xb7'),'interactionId':_0x25341d['id']};return pdf['createPdfFromHTML'](_0x973c7f,_0x5c5d38);})[_0x6c7d('0x16')](function(){return new Promise(function(_0x24bf21,_0x5abd8e){zipdir(_0x3d45fd,{'saveTo':_0x3b17ff},function(_0x21714a,_0x39910e){if(_0x21714a)return _0x5abd8e(_0x21714a);return _0x24bf21(_0x39910e);});})[_0x6c7d('0x16')](function(){return new BPromise(function(_0x7785b6,_0x3744a8){rimraf(_0x3d45fd,function(_0x51d96c){if(_0x51d96c)_0x3744a8(_0x51d96c);return _0x7785b6();});});})[_0x6c7d('0x16')](function(){return _0x5068f0[_0x6c7d('0x77')](_0x3b17ff,_0x3f4cfd,function(_0x3129e5){if(_0x3129e5){logger[_0x6c7d('0x1c')](_0x6c7d('0xc5'),_0x3129e5);}else{fs[_0x6c7d('0xc6')](_0x3b17ff);}});});});}else{return _0x5068f0['sendStatus'](0xc8);}})['catch'](handleError(_0x5068f0,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 2b99d5b..f6ba3aa 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 _0xd973=['emit','catch','hook','events','../../mysqldb','save','update','remove','then','Users','map','findAll','unreadMessages','length'];(function(_0x4ebaed,_0x497196){var _0x6b531f=function(_0x29f64d){while(--_0x29f64d){_0x4ebaed['push'](_0x4ebaed['shift']());}};_0x6b531f(++_0x497196);}(_0xd973,0x1df));var _0x3d97=function(_0x53fa61,_0x43221a){_0x53fa61=_0x53fa61-0x0;var _0x38d317=_0xd973[_0x53fa61];return _0x38d317;};'use strict';var EventEmitter=require(_0x3d97('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x3d97('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3d97('0x2'),'afterUpdate':_0x3d97('0x3'),'afterDestroy':_0x3d97('0x4')};function emitEvent(_0x338798){return function(_0x14f5fd,_0x1a2611,_0x1cc64b){_0x14f5fd['getUsers']({'attributes':['id'],'raw':!![]})[_0x3d97('0x5')](function(_0x2abd85){_0x14f5fd['setDataValue'](_0x3d97('0x6'),_0x2abd85[_0x3d97('0x7')](function(_0x9dbcf3){return{'id':_0x9dbcf3['id']};}));return ChatMessage[_0x3d97('0x8')]({'where':{'ChatInteractionId':_0x14f5fd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3d97('0x5')](function(_0xeeea48){_0x14f5fd['setDataValue'](_0x3d97('0x9'),_0xeeea48[_0x3d97('0xa')]);ChatInteractionEvents[_0x3d97('0xb')](_0x338798+':'+_0x14f5fd['id'],_0x14f5fd);ChatInteractionEvents[_0x3d97('0xb')](_0x338798,_0x14f5fd);_0x1cc64b(null);})[_0x3d97('0xc')](_0x1cc64b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x3d97('0xd')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x346f=['then','setDataValue','map','findAll','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','getUsers'];(function(_0x520993,_0x2873b1){var _0x36a97e=function(_0xa26f71){while(--_0xa26f71){_0x520993['push'](_0x520993['shift']());}};_0x36a97e(++_0x2873b1);}(_0x346f,0x119));var _0xf346=function(_0x372eca,_0x2ee16d){_0x372eca=_0x372eca-0x0;var _0x17dd36=_0x346f[_0x372eca];return _0x17dd36;};'use strict';var EventEmitter=require(_0xf346('0x0'));var ChatInteraction=require(_0xf346('0x1'))['db'][_0xf346('0x2')];var ChatMessage=require(_0xf346('0x1'))['db'][_0xf346('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf346('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf346('0x5'),'afterDestroy':_0xf346('0x6')};function emitEvent(_0x1dde5d){return function(_0x622c34,_0xebe7e9,_0x58c94e){_0x622c34[_0xf346('0x7')]({'attributes':['id'],'raw':!![]})[_0xf346('0x8')](function(_0x51153d){_0x622c34[_0xf346('0x9')]('Users',_0x51153d[_0xf346('0xa')](function(_0x2cf587){return{'id':_0x2cf587['id']};}));return ChatMessage[_0xf346('0xb')]({'where':{'ChatInteractionId':_0x622c34['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf346('0x8')](function(_0x5cd01e){_0x622c34[_0xf346('0x9')]('unreadMessages',_0x5cd01e[_0xf346('0xc')]);ChatInteractionEvents['emit'](_0x1dde5d+':'+_0x622c34['id'],_0x622c34);ChatInteractionEvents[_0xf346('0xd')](_0x1dde5d,_0x622c34);_0x58c94e(null);})[_0xf346('0xe')](_0x58c94e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xf346('0xf')](e,emitEvent(event));}}module[_0xf346('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 3ae69a2..a0eff80 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 _0x05ee=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','changed','closed','closedAt','format','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x22f4e1,_0x18c57c){var _0x49498f=function(_0x331331){while(--_0x331331){_0x22f4e1['push'](_0x22f4e1['shift']());}};_0x49498f(++_0x18c57c);}(_0x05ee,0x1bb));var _0xe05e=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x05ee[_0x26b80e];return _0x84a8a8;};'use strict';var _=require(_0xe05e('0x0'));var util=require(_0xe05e('0x1'));var logger=require(_0xe05e('0x2'))(_0xe05e('0x3'));var moment=require(_0xe05e('0x4'));var BPromise=require('bluebird');var rp=require(_0xe05e('0x5'));var fs=require('fs');var path=require(_0xe05e('0x6'));var rimraf=require(_0xe05e('0x7'));var config=require(_0xe05e('0x8'));var attributes=require(_0xe05e('0x9'));module[_0xe05e('0xa')]=function(_0x2ab159,_0x23e4a4){return _0x2ab159['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a54f4,_0x187bc8,_0x5608cf){if(_0x1a54f4[_0xe05e('0xb')](_0xe05e('0xc'))){_0x1a54f4[_0xe05e('0xd')]=moment()[_0xe05e('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5608cf(null,_0x1a54f4);}},'charset':_0xe05e('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf75b=['rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0xf75b,0x13a));var _0xbf75=function(_0x21719a,_0x6e279){_0x21719a=_0x21719a-0x0;var _0x379194=_0xf75b[_0x21719a];return _0x379194;};'use strict';var _=require(_0xbf75('0x0'));var util=require(_0xbf75('0x1'));var logger=require(_0xbf75('0x2'))(_0xbf75('0x3'));var moment=require(_0xbf75('0x4'));var BPromise=require('bluebird');var rp=require(_0xbf75('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf75('0x6'));var config=require(_0xbf75('0x7'));var attributes=require(_0xbf75('0x8'));module['exports']=function(_0x38c632,_0x2b333c){return _0x38c632[_0xbf75('0x9')](_0xbf75('0xa'),attributes,{'tableName':_0xbf75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xa483b5,_0x4acd75,_0x23d833){if(_0xa483b5['changed'](_0xbf75('0xc'))){_0xa483b5[_0xbf75('0xd')]=moment()[_0xbf75('0xe')](_0xbf75('0xf'));}_0x23d833(null,_0xa483b5);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 5410c71..c5f2c1a 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 _0x76a9=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','then','AddTagsToChatInteraction','find','addTags','ids','spread','AddTags','util'];(function(_0x5616a5,_0x878439){var _0x522972=function(_0x43b296){while(--_0x43b296){_0x5616a5['push'](_0x5616a5['shift']());}};_0x522972(++_0x878439);}(_0x76a9,0x12f));var _0x976a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x76a9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x976a('0x0'));var moment=require(_0x976a('0x1'));var BPromise=require(_0x976a('0x2'));var rs=require(_0x976a('0x3'));var fs=require('fs');var Redis=require(_0x976a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x976a('0x5'));var logger=require('../../config/logger')(_0x976a('0x6'));var config=require('../../config/environment');var jayson=require(_0x976a('0x7'));var client=jayson[_0x976a('0x8')][_0x976a('0x9')]({'port':0x232a});config[_0x976a('0xa')]=_[_0x976a('0xb')](config[_0x976a('0xa')],{'host':_0x976a('0xc'),'port':0x18eb});var socket=require(_0x976a('0xd'))(new Redis(config[_0x976a('0xa')]));require('./chatInteraction.socket')[_0x976a('0xe')](socket);function respondWithRpcPromise(_0xbf6ef7,_0x157b29,_0x49c02b){return new BPromise(function(_0x13aed2,_0x382c41){return client['request'](_0xbf6ef7,_0x49c02b)['then'](function(_0x5e5e24){logger[_0x976a('0xf')](_0x976a('0x10'),_0x157b29,_0x976a('0x11'));logger[_0x976a('0x12')](_0x976a('0x13'),_0x157b29,'request\x20sent',JSON[_0x976a('0x14')](_0x5e5e24));if(_0x5e5e24[_0x976a('0x15')]){if(_0x5e5e24[_0x976a('0x15')]['code']===0x1f4){logger[_0x976a('0x15')](_0x976a('0x10'),_0x157b29,_0x5e5e24[_0x976a('0x15')][_0x976a('0x16')]);return _0x382c41(_0x5e5e24[_0x976a('0x15')][_0x976a('0x16')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x157b29,_0x5e5e24[_0x976a('0x15')]['message']);return _0x13aed2(_0x5e5e24[_0x976a('0x15')]['message']);}else{logger[_0x976a('0xf')](_0x976a('0x10'),_0x157b29,'request\x20sent');_0x13aed2(_0x5e5e24[_0x976a('0x17')]['message']);}})[_0x976a('0x18')](function(_0x4fb011){logger[_0x976a('0x15')](_0x976a('0x10'),_0x157b29,_0x4fb011);_0x382c41(_0x4fb011);});});}exports[_0x976a('0x19')]=function(_0xa78513){var _0x11928b=this;return new Promise(function(_0x272680,_0x5ad1ea){return db[_0x976a('0x1a')]['update'](_0xa78513[_0x976a('0x1b')],{'raw':_0xa78513[_0x976a('0x1c')]?_0xa78513['options'][_0x976a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa78513['options']?_0xa78513[_0x976a('0x1c')][_0x976a('0x1e')]||null:null,'attributes':_0xa78513[_0x976a('0x1c')]?_0xa78513['options']['attributes']||null:null,'limit':_0xa78513[_0x976a('0x1c')]?_0xa78513[_0x976a('0x1c')]['limit']||null:null})[_0x976a('0x1f')](function(_0x459d2d){logger[_0x976a('0xf')](_0x976a('0x19'),_0xa78513);logger[_0x976a('0x12')](_0x976a('0x19'),_0xa78513,JSON[_0x976a('0x14')](_0x459d2d));_0x272680(_0x459d2d);})[_0x976a('0x18')](function(_0x50e1b3){logger[_0x976a('0x15')]('UpdateChatInteraction',_0x50e1b3['message'],_0xa78513);_0x5ad1ea(_0x11928b[_0x976a('0x15')](0x1f4,_0x50e1b3[_0x976a('0x16')]));});});};exports[_0x976a('0x20')]=function(_0x1a356b){return new Promise(function(_0x22947d,_0x38f490){return db['ChatInteraction'][_0x976a('0x21')]({'where':_0x1a356b[_0x976a('0x1c')]?_0x1a356b[_0x976a('0x1c')]['where']||null:null})[_0x976a('0x1f')](function(_0xd67198){if(_0xd67198){return _0xd67198[_0x976a('0x22')](_0x1a356b['body'][_0x976a('0x23')],_['omit'](_0x1a356b['body'],[_0x976a('0x23'),'id'])||{});}})[_0x976a('0x24')](function(_0x519a5b){logger[_0x976a('0xf')](_0x976a('0x25'),_0x1a356b);logger[_0x976a('0x12')](_0x976a('0x25'),_0x1a356b,JSON[_0x976a('0x14')](_0x519a5b));_0x22947d(_0x519a5b);})['catch'](function(_0x540167){logger[_0x976a('0x15')]('AddTags',_0x540167[_0x976a('0x16')],_0x1a356b);_0x38f490(_this['error'](0x1f4,_0x540167[_0x976a('0x16')]));});});}; \ No newline at end of file +var _0x2e5a=['raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','addTags','ids','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','update','body','options'];(function(_0x56b291,_0x3b277f){var _0x5fd2db=function(_0x2e1ae9){while(--_0x2e1ae9){_0x56b291['push'](_0x56b291['shift']());}};_0x5fd2db(++_0x3b277f);}(_0x2e5a,0xb5));var _0xa2e5=function(_0x19e09d,_0x1819cf){_0x19e09d=_0x19e09d-0x0;var _0x2aa480=_0x2e5a[_0x19e09d];return _0x2aa480;};'use strict';var _=require(_0xa2e5('0x0'));var util=require(_0xa2e5('0x1'));var moment=require(_0xa2e5('0x2'));var BPromise=require(_0xa2e5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2e5('0x4'));var db=require(_0xa2e5('0x5'))['db'];var utils=require(_0xa2e5('0x6'));var logger=require(_0xa2e5('0x7'))(_0xa2e5('0x8'));var config=require(_0xa2e5('0x9'));var jayson=require(_0xa2e5('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xa2e5('0xb')]=_[_0xa2e5('0xc')](config[_0xa2e5('0xb')],{'host':_0xa2e5('0xd'),'port':0x18eb});var socket=require(_0xa2e5('0xe'))(new Redis(config[_0xa2e5('0xb')]));require(_0xa2e5('0xf'))[_0xa2e5('0x10')](socket);function respondWithRpcPromise(_0x551bed,_0x4c89f2,_0x338815){return new BPromise(function(_0x34f1b0,_0x263a61){return client[_0xa2e5('0x11')](_0x551bed,_0x338815)[_0xa2e5('0x12')](function(_0x51b332){logger[_0xa2e5('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x4c89f2,_0xa2e5('0x14'));logger[_0xa2e5('0x15')](_0xa2e5('0x16'),_0x4c89f2,_0xa2e5('0x14'),JSON[_0xa2e5('0x17')](_0x51b332));if(_0x51b332[_0xa2e5('0x18')]){if(_0x51b332['error'][_0xa2e5('0x19')]===0x1f4){logger[_0xa2e5('0x18')](_0xa2e5('0x1a'),_0x4c89f2,_0x51b332[_0xa2e5('0x18')]['message']);return _0x263a61(_0x51b332['error'][_0xa2e5('0x1b')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4c89f2,_0x51b332[_0xa2e5('0x18')][_0xa2e5('0x1b')]);return _0x34f1b0(_0x51b332[_0xa2e5('0x18')][_0xa2e5('0x1b')]);}else{logger[_0xa2e5('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x4c89f2,_0xa2e5('0x14'));_0x34f1b0(_0x51b332[_0xa2e5('0x1c')]['message']);}})[_0xa2e5('0x1d')](function(_0x1d2fa8){logger[_0xa2e5('0x18')](_0xa2e5('0x1a'),_0x4c89f2,_0x1d2fa8);_0x263a61(_0x1d2fa8);});});}exports['UpdateChatInteraction']=function(_0x3e81ba){var _0xd7f41d=this;return new Promise(function(_0xf060eb,_0x4feff8){return db[_0xa2e5('0x1e')][_0xa2e5('0x1f')](_0x3e81ba[_0xa2e5('0x20')],{'raw':_0x3e81ba[_0xa2e5('0x21')]?_0x3e81ba[_0xa2e5('0x21')][_0xa2e5('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e81ba[_0xa2e5('0x21')]?_0x3e81ba['options'][_0xa2e5('0x23')]||null:null,'attributes':_0x3e81ba[_0xa2e5('0x21')]?_0x3e81ba[_0xa2e5('0x21')][_0xa2e5('0x24')]||null:null,'limit':_0x3e81ba[_0xa2e5('0x21')]?_0x3e81ba[_0xa2e5('0x21')][_0xa2e5('0x25')]||null:null})[_0xa2e5('0x12')](function(_0x35bc9f){logger[_0xa2e5('0x13')](_0xa2e5('0x26'),_0x3e81ba);logger['debug']('UpdateChatInteraction',_0x3e81ba,JSON['stringify'](_0x35bc9f));_0xf060eb(_0x35bc9f);})[_0xa2e5('0x1d')](function(_0x31fc43){logger['error'](_0xa2e5('0x26'),_0x31fc43[_0xa2e5('0x1b')],_0x3e81ba);_0x4feff8(_0xd7f41d[_0xa2e5('0x18')](0x1f4,_0x31fc43[_0xa2e5('0x1b')]));});});};exports[_0xa2e5('0x27')]=function(_0x1a97c7){return new Promise(function(_0x198897,_0x5f301c){return db[_0xa2e5('0x1e')]['find']({'where':_0x1a97c7[_0xa2e5('0x21')]?_0x1a97c7[_0xa2e5('0x21')][_0xa2e5('0x23')]||null:null})['then'](function(_0x3c68bf){if(_0x3c68bf){return _0x3c68bf[_0xa2e5('0x28')](_0x1a97c7[_0xa2e5('0x20')][_0xa2e5('0x29')],_['omit'](_0x1a97c7[_0xa2e5('0x20')],['ids','id'])||{});}})['spread'](function(_0x5c12a3){logger[_0xa2e5('0x13')](_0xa2e5('0x2a'),_0x1a97c7);logger[_0xa2e5('0x15')](_0xa2e5('0x2a'),_0x1a97c7,JSON['stringify'](_0x5c12a3));_0x198897(_0x5c12a3);})[_0xa2e5('0x1d')](function(_0x1df97a){logger['error'](_0xa2e5('0x2a'),_0x1df97a[_0xa2e5('0x1b')],_0x1a97c7);_0x5f301c(_this[_0xa2e5('0x18')](0x1f4,_0x1df97a[_0xa2e5('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 3c22d02..7f5c60b 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 _0x0328=['save','remove','update','removeListener','length','chatInteraction:','./chatInteraction.events'];(function(_0xae72fb,_0x4f52ed){var _0x40df1d=function(_0x2c391b){while(--_0x2c391b){_0xae72fb['push'](_0xae72fb['shift']());}};_0x40df1d(++_0x4f52ed);}(_0x0328,0x172));var _0x8032=function(_0x116693,_0x2d27b5){_0x116693=_0x116693-0x0;var _0x3380ba=_0x0328[_0x116693];return _0x3380ba;};'use strict';var ChatInteractionEvents=require(_0x8032('0x0'));var events=[_0x8032('0x1'),_0x8032('0x2'),_0x8032('0x3')];function createListener(_0x354a24,_0x3d9fab){return function(_0x20bec4){_0x3d9fab['emit'](_0x354a24,_0x20bec4);};}function removeListener(_0x92dbf0,_0x11cbbc){return function(){ChatInteractionEvents[_0x8032('0x4')](_0x92dbf0,_0x11cbbc);};}exports['register']=function(_0x7ccda3){for(var _0x553c90=0x0,_0x4e2641=events[_0x8032('0x5')];_0x553c90<_0x4e2641;_0x553c90++){var _0x1e7e46=events[_0x553c90];var _0x5951b1=createListener(_0x8032('0x6')+_0x1e7e46,_0x7ccda3);ChatInteractionEvents['on'](_0x1e7e46,_0x5951b1);}}; \ No newline at end of file +var _0x4667=['save','remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x43859f,_0x4bb17f){var _0x385292=function(_0x143403){while(--_0x143403){_0x43859f['push'](_0x43859f['shift']());}};_0x385292(++_0x4bb17f);}(_0x4667,0x179));var _0x7466=function(_0x8cfd08,_0x656b39){_0x8cfd08=_0x8cfd08-0x0;var _0x1c6452=_0x4667[_0x8cfd08];return _0x1c6452;};'use strict';var ChatInteractionEvents=require(_0x7466('0x0'));var events=[_0x7466('0x1'),_0x7466('0x2'),_0x7466('0x3')];function createListener(_0xdabb36,_0xc3c1f0){return function(_0x5a02a8){_0xc3c1f0[_0x7466('0x4')](_0xdabb36,_0x5a02a8);};}function removeListener(_0x5c7f21,_0xf39399){return function(){ChatInteractionEvents[_0x7466('0x5')](_0x5c7f21,_0xf39399);};}exports[_0x7466('0x6')]=function(_0x12f158){for(var _0x7732d1=0x0,_0x136b5a=events[_0x7466('0x7')];_0x7732d1<_0x136b5a;_0x7732d1++){var _0x4e6c6f=events[_0x7732d1];var _0x28618c=createListener(_0x7466('0x8')+_0x4e6c6f,_0x12f158);ChatInteractionEvents['on'](_0x4e6c6f,_0x28618c);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 58a208f..e75af2c 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 _0x54fa=['getMessages','/:id/my_messages','getMyMessages','post','create','/:id/vidaoo','diskStorage','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chatinteraction:addtags','put','chat','chatinteraction:update','update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages'];(function(_0x419ced,_0x323203){var _0x2e9049=function(_0xca2607){while(--_0xca2607){_0x419ced['push'](_0x419ced['shift']());}};_0x2e9049(++_0x323203);}(_0x54fa,0x1c1));var _0xa54f=function(_0x254076,_0x5e7b8d){_0x254076=_0x254076-0x0;var _0x21a93e=_0x54fa[_0x254076];return _0x21a93e;};'use strict';var multer=require('multer');var util=require(_0xa54f('0x0'));var path=require(_0xa54f('0x1'));var timeout=require(_0xa54f('0x2'));var express=require(_0xa54f('0x3'));var router=express[_0xa54f('0x4')]();var fs_extra=require(_0xa54f('0x5'));var auth=require(_0xa54f('0x6'));var interaction=require(_0xa54f('0x7'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0xa54f('0x8')]('/',auth[_0xa54f('0x9')](),controller[_0xa54f('0xa')]);router[_0xa54f('0x8')](_0xa54f('0xb'),auth[_0xa54f('0x9')](),controller[_0xa54f('0xc')]);router[_0xa54f('0x8')](_0xa54f('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xa54f('0xe')]);router[_0xa54f('0x8')](_0xa54f('0xf'),auth[_0xa54f('0x10')](),controller[_0xa54f('0x11')]);router[_0xa54f('0x8')](_0xa54f('0x12'),auth[_0xa54f('0x9')](),controller[_0xa54f('0x13')]);router['get'](_0xa54f('0x14'),auth[_0xa54f('0x10')](),controller[_0xa54f('0x15')]);router[_0xa54f('0x8')]('/:id/download',auth[_0xa54f('0x9')](),controller['download']);router[_0xa54f('0x16')]('/',auth['isAuthenticated'](),controller[_0xa54f('0x17')]);router[_0xa54f('0x16')](_0xa54f('0x18'),auth[_0xa54f('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xa54f('0x19')]({'destination':function(_0x3d13c8,_0x5522d6,_0xc5a1d2){_0xc5a1d2(null,path['join'](config[_0xa54f('0x1a')],_0xa54f('0x1b')));},'filename':function(_0x46c4b4,_0x2b7670,_0x27e70f){_0x27e70f(null,util['format'](_0xa54f('0x1c'),Date[_0xa54f('0x1d')](),_0x2b7670[_0xa54f('0x1e')][_0xa54f('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa54f('0x16')](_0xa54f('0x20'),upload[_0xa54f('0x21')](_0xa54f('0x22')),controller[_0xa54f('0x23')]);router[_0xa54f('0x16')](_0xa54f('0x12'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0xa54f('0x16')](_0xa54f('0x24'),auth[_0xa54f('0x9')](),interaction[_0xa54f('0x25')]('chat',_0xa54f('0x26')),controller['addTags']);router[_0xa54f('0x27')](_0xa54f('0xd'),auth[_0xa54f('0x9')](),interaction[_0xa54f('0x25')](_0xa54f('0x28'),_0xa54f('0x29')),controller[_0xa54f('0x2a')]);router['put']('/:id/custom_update',controller[_0xa54f('0x2b')]);router[_0xa54f('0x27')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xa54f('0x2c')]);router[_0xa54f('0x27')](_0xa54f('0x2d'),controller[_0xa54f('0x2e')]);router[_0xa54f('0x2f')](_0xa54f('0xd'),auth[_0xa54f('0x9')](),interaction[_0xa54f('0x25')](_0xa54f('0x28'),_0xa54f('0x30')),controller[_0xa54f('0x31')]);router['delete'](_0xa54f('0x24'),auth[_0xa54f('0x9')](),controller[_0xa54f('0x32')]);module[_0xa54f('0x33')]=router; \ No newline at end of file +var _0x4245=['exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','now','/:id/attachment_upload','file','attachmentUpload','addMessage','tracked','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','/:id/abandon','/:id/close','delete','destroy','/:id/tags','removeTags'];(function(_0x58718e,_0x430586){var _0x5a729e=function(_0x145d7d){while(--_0x145d7d){_0x58718e['push'](_0x58718e['shift']());}};_0x5a729e(++_0x430586);}(_0x4245,0xf1));var _0x5424=function(_0x2c3040,_0x353891){_0x2c3040=_0x2c3040-0x0;var _0x129b2e=_0x4245[_0x2c3040];return _0x129b2e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5424('0x0'));var timeout=require(_0x5424('0x1'));var express=require(_0x5424('0x2'));var router=express[_0x5424('0x3')]();var fs_extra=require(_0x5424('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5424('0x5'));var config=require(_0x5424('0x6'));var controller=require(_0x5424('0x7'));router[_0x5424('0x8')]('/',auth[_0x5424('0x9')](),controller[_0x5424('0xa')]);router[_0x5424('0x8')](_0x5424('0xb'),auth[_0x5424('0x9')](),controller[_0x5424('0xc')]);router['get'](_0x5424('0xd'),auth[_0x5424('0xe')](),controller[_0x5424('0xf')]);router['get'](_0x5424('0x10'),auth[_0x5424('0xe')](),controller['attachmentDownload']);router[_0x5424('0x8')](_0x5424('0x11'),auth['isAuthenticated'](),controller[_0x5424('0x12')]);router['get'](_0x5424('0x13'),auth[_0x5424('0xe')](),controller[_0x5424('0x14')]);router[_0x5424('0x8')]('/:id/download',auth[_0x5424('0x9')](),controller['download']);router[_0x5424('0x15')]('/',auth[_0x5424('0x9')](),controller[_0x5424('0x16')]);router['post'](_0x5424('0x17'),auth[_0x5424('0x9')](),controller[_0x5424('0x18')]);var upload=multer({'storage':multer[_0x5424('0x19')]({'destination':function(_0x2f48ce,_0x14162b,_0x836f83){_0x836f83(null,path['join'](config[_0x5424('0x1a')],_0x5424('0x1b')));},'filename':function(_0x248cea,_0x232c2b,_0x2fe3cb){_0x2fe3cb(null,util[_0x5424('0x1c')]('%s-%s',Date[_0x5424('0x1d')](),_0x232c2b['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5424('0x15')](_0x5424('0x1e'),upload['single'](_0x5424('0x1f')),controller[_0x5424('0x20')]);router['post'](_0x5424('0x11'),auth[_0x5424('0xe')](),controller[_0x5424('0x21')]);router[_0x5424('0x15')]('/:id/tags',auth[_0x5424('0x9')](),interaction[_0x5424('0x22')]('chat','chatinteraction:addtags'),controller[_0x5424('0x23')]);router[_0x5424('0x24')]('/:id',auth['isAuthenticated'](),interaction[_0x5424('0x22')](_0x5424('0x25'),_0x5424('0x26')),controller[_0x5424('0x27')]);router[_0x5424('0x24')](_0x5424('0x28'),controller['customUpdate']);router['put'](_0x5424('0x29'),auth[_0x5424('0xe')](),controller['abandon']);router[_0x5424('0x24')](_0x5424('0x2a'),controller['close']);router[_0x5424('0x2b')]('/:id',auth[_0x5424('0x9')](),interaction[_0x5424('0x22')](_0x5424('0x25'),'chatinteraction:destroy'),controller[_0x5424('0x2c')]);router[_0x5424('0x2b')](_0x5424('0x2d'),auth[_0x5424('0x9')](),controller[_0x5424('0x2e')]);module[_0x5424('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 cd8a195..6697c6c 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 _0xb3f3=['TEXT','medium','BOOLEAN','INTEGER','exports'];(function(_0x543026,_0x2ed354){var _0x182174=function(_0x57d1bf){while(--_0x57d1bf){_0x543026['push'](_0x543026['shift']());}};_0x182174(++_0x2ed354);}(_0xb3f3,0x185));var _0x3b3f=function(_0x2d3711,_0x43d60d){_0x2d3711=_0x2d3711-0x0;var _0x477858=_0xb3f3[_0x2d3711];return _0x477858;};'use strict';var Sequelize=require('sequelize');module[_0x3b3f('0x0')]={'body':{'type':Sequelize[_0x3b3f('0x1')](_0x3b3f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3b3f('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3b3f('0x4')]}}; \ No newline at end of file +var _0x1ef1=['medium','BOOLEAN','INTEGER','exports'];(function(_0x23592b,_0x70ad58){var _0x41d8ae=function(_0x3f8e97){while(--_0x3f8e97){_0x23592b['push'](_0x23592b['shift']());}};_0x41d8ae(++_0x70ad58);}(_0x1ef1,0x9b));var _0x11ef=function(_0x325de5,_0x29c9a4){_0x325de5=_0x325de5-0x0;var _0x60a09e=_0x1ef1[_0x325de5];return _0x60a09e;};'use strict';var Sequelize=require('sequelize');module[_0x11ef('0x0')]={'body':{'type':Sequelize['TEXT'](_0x11ef('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x11ef('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x11ef('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 89efe5d..be4ea37 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 _0xa404=['all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','merge','find','create','body','describe','messages','createdAt','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','findAll','agent','admin','user','userpic','internal','lastLoginAt','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','role','resourceId','push','FromId','ToId','read'];(function(_0x2a5262,_0x578588){var _0x483802=function(_0x53c24c){while(--_0x53c24c){_0x2a5262['push'](_0x2a5262['shift']());}};_0x483802(++_0x578588);}(_0xa404,0xeb));var _0x4a40=function(_0x588766,_0x1f11a4){_0x588766=_0x588766-0x0;var _0x23c271=_0xa404[_0x588766];return _0x23c271;};'use strict';var emlformat=require(_0x4a40('0x0'));var rimraf=require(_0x4a40('0x1'));var zipdir=require(_0x4a40('0x2'));var jsonpatch=require(_0x4a40('0x3'));var rp=require(_0x4a40('0x4'));var moment=require(_0x4a40('0x5'));var BPromise=require(_0x4a40('0x6'));var Mustache=require(_0x4a40('0x7'));var util=require(_0x4a40('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x4a40('0x9'));var ejs=require(_0x4a40('0xa'));var fs=require('fs');var fs_extra=require(_0x4a40('0xb'));var _=require(_0x4a40('0xc'));var squel=require(_0x4a40('0xd'));var crypto=require(_0x4a40('0xe'));var jsforce=require(_0x4a40('0xf'));var deskjs=require(_0x4a40('0x10'));var toCsv=require(_0x4a40('0x9'));var querystring=require(_0x4a40('0x11'));var Papa=require(_0x4a40('0x12'));var Redis=require(_0x4a40('0x13'));var authService=require(_0x4a40('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x4a40('0x15'));var hardwareService=require(_0x4a40('0x16'));var logger=require(_0x4a40('0x17'))('api');var utils=require(_0x4a40('0x18'));var config=require(_0x4a40('0x19'));var licenseUtil=require(_0x4a40('0x1a'));var db=require(_0x4a40('0x1b'))['db'];config[_0x4a40('0x1c')]=_[_0x4a40('0x1d')](config['redis'],{'host':_0x4a40('0x1e'),'port':0x18eb});var socket=require(_0x4a40('0x1f'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x4a40('0x20')](socket);function respondWithStatusCode(_0xac645c,_0x39f3a0){_0x39f3a0=_0x39f3a0||0xcc;return function(_0x89667b){if(_0x89667b){return _0xac645c[_0x4a40('0x21')](_0x39f3a0);}return _0xac645c[_0x4a40('0x22')](_0x39f3a0)[_0x4a40('0x23')]();};}function respondWithResult(_0xd534a0,_0x5e3450){_0x5e3450=_0x5e3450||0xc8;return function(_0x13feae){if(_0x13feae){return _0xd534a0[_0x4a40('0x22')](_0x5e3450)[_0x4a40('0x24')](_0x13feae);}};}function respondWithFilteredResult(_0x3654cb,_0x9f2894){return function(_0x11edcb){if(_0x11edcb){var _0x750880=typeof _0x9f2894[_0x4a40('0x25')]==='undefined'&&typeof _0x9f2894[_0x4a40('0x26')]===_0x4a40('0x27');var _0x773bed=_0x11edcb[_0x4a40('0x28')];var _0x46d21a=_0x750880?0x0:_0x9f2894[_0x4a40('0x25')];var _0x1a9673=_0x750880?_0x11edcb[_0x4a40('0x28')]:_0x9f2894[_0x4a40('0x25')]+_0x9f2894[_0x4a40('0x26')];var _0x3638f3;if(_0x1a9673>=_0x773bed){_0x1a9673=_0x773bed;_0x3638f3=0xc8;}else{_0x3638f3=0xce;}_0x3654cb[_0x4a40('0x22')](_0x3638f3);return _0x3654cb[_0x4a40('0x29')](_0x4a40('0x2a'),_0x46d21a+'-'+_0x1a9673+'/'+_0x773bed)[_0x4a40('0x24')](_0x11edcb);}return null;};}function patchUpdates(_0x2cd1cc){return function(_0x3eba0b){try{jsonpatch[_0x4a40('0x2b')](_0x3eba0b,_0x2cd1cc,!![]);}catch(_0x1daa53){return BPromise[_0x4a40('0x2c')](_0x1daa53);}return _0x3eba0b[_0x4a40('0x2d')]();};}function saveUpdates(_0x459979,_0x496dd3){return function(_0x309de5){if(_0x309de5){return _0x309de5[_0x4a40('0x2e')](_0x459979)[_0x4a40('0x2f')](function(_0x485146){return _0x485146;});}return null;};}function removeEntity(_0x2044c1,_0x6a57bc){return function(_0x366921){if(_0x366921){return _0x366921[_0x4a40('0x30')]()[_0x4a40('0x2f')](function(){_0x2044c1[_0x4a40('0x22')](0xcc)[_0x4a40('0x23')]();});}};}function handleEntityNotFound(_0x281908,_0x92b94c){return function(_0x5c5dcc){if(!_0x5c5dcc){_0x281908['sendStatus'](0x194);}return _0x5c5dcc;};}function handleError(_0x18966f,_0x494296){_0x494296=_0x494296||0x1f4;return function(_0x459941){logger[_0x4a40('0x31')](_0x459941[_0x4a40('0x32')]);if(_0x459941[_0x4a40('0x33')]){delete _0x459941[_0x4a40('0x33')];}_0x18966f[_0x4a40('0x22')](_0x494296)[_0x4a40('0x34')](_0x459941);};}exports[_0x4a40('0x35')]=function(_0x4bee48,_0x4f6421){var _0x322f47={},_0x4e32bb={},_0x1d7628={'count':0x0,'rows':[]};var _0x98d004=_[_0x4a40('0x36')](db[_0x4a40('0x37')][_0x4a40('0x38')],function(_0x4e034d){return{'name':_0x4e034d[_0x4a40('0x39')],'type':_0x4e034d[_0x4a40('0x3a')][_0x4a40('0x3b')]};});_0x4e32bb[_0x4a40('0x3c')]=_[_0x4a40('0x36')](_0x98d004,_0x4a40('0x33'));_0x4e32bb[_0x4a40('0x3d')]=_[_0x4a40('0x3e')](_0x4bee48[_0x4a40('0x3d')]);_0x4e32bb['filters']=_['intersection'](_0x4e32bb[_0x4a40('0x3c')],_0x4e32bb['query']);_0x322f47[_0x4a40('0x3f')]=_[_0x4a40('0x40')](_0x4e32bb['model'],qs[_0x4a40('0x41')](_0x4bee48[_0x4a40('0x3d')][_0x4a40('0x41')]));_0x322f47['attributes']=_0x322f47['attributes']['length']?_0x322f47[_0x4a40('0x3f')]:_0x4e32bb['model'];if(!_0x4bee48[_0x4a40('0x3d')][_0x4a40('0x42')]('nolimit')){_0x322f47[_0x4a40('0x26')]=qs[_0x4a40('0x26')](_0x4bee48[_0x4a40('0x3d')]['limit']);_0x322f47[_0x4a40('0x25')]=qs[_0x4a40('0x25')](_0x4bee48[_0x4a40('0x3d')][_0x4a40('0x25')]);}_0x322f47[_0x4a40('0x43')]=qs[_0x4a40('0x44')](_0x4bee48[_0x4a40('0x3d')][_0x4a40('0x44')]);_0x322f47[_0x4a40('0x45')]=qs[_0x4a40('0x46')](_[_0x4a40('0x47')](_0x4bee48[_0x4a40('0x3d')],_0x4e32bb[_0x4a40('0x46')]),_0x98d004);if(_0x4bee48['query'][_0x4a40('0x48')]){_0x322f47[_0x4a40('0x45')]=_['merge'](_0x322f47[_0x4a40('0x45')],{'$or':_[_0x4a40('0x36')](_0x98d004,function(_0x857afb){if(_0x857afb['type']!==_0x4a40('0x49')){var _0x33c421={};_0x33c421[_0x857afb[_0x4a40('0x33')]]={'$like':'%'+_0x4bee48[_0x4a40('0x3d')][_0x4a40('0x48')]+'%'};return _0x33c421;}})});}_0x322f47=_['merge']({},_0x322f47,_0x4bee48[_0x4a40('0x4a')]);var _0x38a36e={'where':_0x322f47[_0x4a40('0x45')]};return db[_0x4a40('0x37')]['count'](_0x38a36e)[_0x4a40('0x2f')](function(_0x3532ee){_0x1d7628[_0x4a40('0x28')]=_0x3532ee;if(_0x4bee48[_0x4a40('0x3d')][_0x4a40('0x4b')]){_0x322f47[_0x4a40('0x4c')]=[{'all':!![]}];}return db[_0x4a40('0x37')]['findAll'](_0x322f47);})[_0x4a40('0x2f')](function(_0x2bd312){_0x1d7628[_0x4a40('0x4d')]=_0x2bd312;return _0x1d7628;})[_0x4a40('0x2f')](respondWithFilteredResult(_0x4f6421,_0x322f47))[_0x4a40('0x4e')](handleError(_0x4f6421,null));};exports[_0x4a40('0x4f')]=function(_0x573892,_0x2d42a3){var _0x2d29aa={'raw':!![],'where':{'id':_0x573892[_0x4a40('0x50')]['id']}},_0x2fcdf3={};_0x2fcdf3[_0x4a40('0x3c')]=_[_0x4a40('0x3e')](db[_0x4a40('0x37')]['rawAttributes']);_0x2fcdf3[_0x4a40('0x3d')]=_[_0x4a40('0x3e')](_0x573892[_0x4a40('0x3d')]);_0x2fcdf3[_0x4a40('0x46')]=_[_0x4a40('0x40')](_0x2fcdf3[_0x4a40('0x3c')],_0x2fcdf3['query']);_0x2d29aa['attributes']=_[_0x4a40('0x40')](_0x2fcdf3['model'],qs['fields'](_0x573892[_0x4a40('0x3d')]['fields']));_0x2d29aa['attributes']=_0x2d29aa[_0x4a40('0x3f')][_0x4a40('0x51')]?_0x2d29aa[_0x4a40('0x3f')]:_0x2fcdf3['model'];if(_0x573892[_0x4a40('0x3d')][_0x4a40('0x4b')]){_0x2d29aa[_0x4a40('0x4c')]=[{'all':!![]}];}_0x2d29aa=_[_0x4a40('0x52')]({},_0x2d29aa,_0x573892['options']);return db['ChatInternalMessage'][_0x4a40('0x53')](_0x2d29aa)['then'](handleEntityNotFound(_0x2d42a3,null))[_0x4a40('0x2f')](respondWithResult(_0x2d42a3,null))['catch'](handleError(_0x2d42a3,null));};exports[_0x4a40('0x54')]=function(_0x3fe573,_0x5655c9){return db[_0x4a40('0x37')]['create'](_0x3fe573[_0x4a40('0x55')],{})['then'](respondWithResult(_0x5655c9,0xc9))['catch'](handleError(_0x5655c9,null));};exports['update']=function(_0x220845,_0x177bdf){if(_0x220845[_0x4a40('0x55')]['id']){delete _0x220845[_0x4a40('0x55')]['id'];}return db[_0x4a40('0x37')]['find']({'where':{'id':_0x220845[_0x4a40('0x50')]['id']}})['then'](handleEntityNotFound(_0x177bdf,null))[_0x4a40('0x2f')](saveUpdates(_0x220845[_0x4a40('0x55')],null))['then'](respondWithResult(_0x177bdf,null))[_0x4a40('0x4e')](handleError(_0x177bdf,null));};exports[_0x4a40('0x30')]=function(_0x291c1d,_0x242955){return db[_0x4a40('0x37')][_0x4a40('0x53')]({'where':{'id':_0x291c1d[_0x4a40('0x50')]['id']}})[_0x4a40('0x2f')](handleEntityNotFound(_0x242955,null))['then'](removeEntity(_0x242955,null))['catch'](handleError(_0x242955,null));};exports['describe']=function(_0x582c87,_0x35cf52){return db['ChatInternalMessage'][_0x4a40('0x56')]()[_0x4a40('0x2f')](respondWithResult(_0x35cf52,null))['catch'](handleError(_0x35cf52,null));};function wrapUser(_0x5c912f){return function(_0x532c12){var _0x5070b8=_0x5c912f['get']({'plain':!![]});_0x5070b8[_0x4a40('0x57')]=[];if(_0x532c12){_0x5070b8['lastMessageAt']=_0x532c12[_0x4a40('0x58')];_0x5070b8['lastMessage']=_0x532c12;}else{_0x5070b8[_0x4a40('0x59')]=moment(0x0)[_0x4a40('0x5a')](_0x4a40('0x5b'));_0x5070b8[_0x4a40('0x5c')]={};}return _0x5070b8;};}exports[_0x4a40('0x5d')]=function(_0x282683,_0x4fbb50,_0x4b00ab){var _0x5897f4=[];return db[_0x4a40('0x5e')][_0x4a40('0x5f')]({'where':{'role':[_0x4a40('0x60'),_0x4a40('0x61'),_0x4a40('0x62')]},'attributes':['id','fullname',_0x4a40('0x33'),'role',_0x4a40('0x63'),_0x4a40('0x64'),'online',_0x4a40('0x65'),'allowmessenger','showWebBar'],'order':qs[_0x4a40('0x44')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x4a40('0x66'),'attributes':['id',_0x4a40('0x33'),_0x4a40('0x3a')],'through':{'attributes':[]}}]})[_0x4a40('0x2f')](function(_0x280aff){if(_0x280aff){var _0x3d2773=_0x282683[_0x4a40('0x62')][_0x4a40('0x67')]({'plain':!![]});if(!_0x3d2773)throw new Error(_0x4a40('0x68'));if(_0x3d2773['role']===_0x4a40('0x62')){return db[_0x4a40('0x69')][_0x4a40('0x53')]({'where':{'name':_0x4a40('0x6a'),'userProfileId':_0x3d2773[_0x4a40('0x6b')]},'raw':!![]})['then'](function(_0x4a7d29){if(_0x4a7d29){if(_0x4a7d29['autoAssociation']===0x0){return db[_0x4a40('0x6c')][_0x4a40('0x5f')]({'where':{'sectionId':_0x4a7d29['id']},'raw':!![]})[_0x4a40('0x2f')](function(_0x55cf17){var _0x564015=[];if(_[_0x4a40('0x6d')](_0x55cf17)){_0x564015=_[_0x4a40('0x48')](_0x280aff,function(_0x5a3090){if(_0x5a3090[_0x4a40('0x6e')]!==_0x4a40('0x60')){return _0x5a3090;}});return _0x564015;}else{for(var _0x646b6e=0x0;_0x646b6e<_0x280aff[_0x4a40('0x51')];_0x646b6e++){var _0x28bbf8=_0x280aff[_0x646b6e];if(_0x28bbf8[_0x4a40('0x6e')]===_0x4a40('0x60')){var _0xad829f=_[_0x4a40('0x53')](_0x55cf17,function(_0x44c001){return _0x44c001[_0x4a40('0x6f')]===_0x28bbf8['id'];});if(_0xad829f)_0x564015[_0x4a40('0x70')](_0x28bbf8);}else{_0x564015[_0x4a40('0x70')](_0x28bbf8);}}return _0x564015;}});}else{return _0x280aff;}}else{var _0x17bbc1=_['filter'](_0x280aff,function(_0x40d2f2){if(_0x40d2f2[_0x4a40('0x6e')]!==_0x4a40('0x60')){return _0x40d2f2;}});return _0x17bbc1;}});}else{return _0x280aff;}}})[_0x4a40('0x2f')](function(_0x401f08){var _0xe10c13=[];if(_0x401f08){_0x5897f4=_0x401f08;for(var _0x157f99=0x0;_0x157f99<_0x401f08['length'];_0x157f99+=0x1){_0x5897f4[_0x157f99][_0x4a40('0x57')]=[];_0xe10c13['push'](db[_0x4a40('0x37')][_0x4a40('0x53')]({'where':{'FromId':[_0x282683['user']['id'],_0x401f08[_0x157f99]['id']],'ToId':[_0x282683['user']['id'],_0x401f08[_0x157f99]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x4a40('0x71'),_0x4a40('0x72'),_0x4a40('0x73'),_0x4a40('0x55')],'order':qs[_0x4a40('0x44')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x401f08[_0x157f99])));}return BPromise[_0x4a40('0x74')](_0xe10c13);}return[];})[_0x4a40('0x2f')](function(_0x59cc84){return{'rows':_0x59cc84,'count':_0x59cc84[_0x4a40('0x51')]};})[_0x4a40('0x2f')](respondWithResult(_0x4fbb50,null))[_0x4a40('0x4e')](handleError(_0x4fbb50,null));}; \ No newline at end of file +var _0x13d5=['UserProfileResource','isEmpty','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','name','send','map','ChatInternalMessage','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','then','include','findAll','rows','catch','includeAll','create','body','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x261ea0,_0x43b1d4){var _0x3b811a=function(_0xa02903){while(--_0xa02903){_0x261ea0['push'](_0x261ea0['shift']());}};_0x3b811a(++_0x43b1d4);}(_0x13d5,0x1af));var _0x513d=function(_0x3a960c,_0xcceb09){_0x3a960c=_0x3a960c-0x0;var _0x525483=_0x13d5[_0x3a960c];return _0x525483;};'use strict';var emlformat=require(_0x513d('0x0'));var rimraf=require(_0x513d('0x1'));var zipdir=require(_0x513d('0x2'));var jsonpatch=require(_0x513d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x513d('0x4'));var Mustache=require(_0x513d('0x5'));var util=require(_0x513d('0x6'));var path=require(_0x513d('0x7'));var sox=require(_0x513d('0x8'));var csv=require('to-csv');var ejs=require(_0x513d('0x9'));var fs=require('fs');var fs_extra=require(_0x513d('0xa'));var _=require(_0x513d('0xb'));var squel=require(_0x513d('0xc'));var crypto=require(_0x513d('0xd'));var jsforce=require(_0x513d('0xe'));var deskjs=require(_0x513d('0xf'));var toCsv=require(_0x513d('0x10'));var querystring=require(_0x513d('0x11'));var Papa=require(_0x513d('0x12'));var Redis=require(_0x513d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x513d('0x14'));var as=require(_0x513d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x513d('0x16'))(_0x513d('0x17'));var utils=require(_0x513d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x513d('0x19'));var db=require(_0x513d('0x1a'))['db'];config[_0x513d('0x1b')]=_['defaults'](config['redis'],{'host':_0x513d('0x1c'),'port':0x18eb});var socket=require(_0x513d('0x1d'))(new Redis(config[_0x513d('0x1b')]));require(_0x513d('0x1e'))['register'](socket);function respondWithStatusCode(_0x474e29,_0x2fb5d3){_0x2fb5d3=_0x2fb5d3||0xcc;return function(_0x1140fd){if(_0x1140fd){return _0x474e29['sendStatus'](_0x2fb5d3);}return _0x474e29[_0x513d('0x1f')](_0x2fb5d3)['end']();};}function respondWithResult(_0x444527,_0x265f3e){_0x265f3e=_0x265f3e||0xc8;return function(_0x395bc1){if(_0x395bc1){return _0x444527['status'](_0x265f3e)[_0x513d('0x20')](_0x395bc1);}};}function respondWithFilteredResult(_0x503cef,_0x4a20f5){return function(_0x16397f){if(_0x16397f){var _0x53da2d=typeof _0x4a20f5[_0x513d('0x21')]===_0x513d('0x22')&&typeof _0x4a20f5[_0x513d('0x23')]==='undefined';var _0x4fff39=_0x16397f[_0x513d('0x24')];var _0x5bdda2=_0x53da2d?0x0:_0x4a20f5[_0x513d('0x21')];var _0x5c302b=_0x53da2d?_0x16397f['count']:_0x4a20f5[_0x513d('0x21')]+_0x4a20f5[_0x513d('0x23')];var _0x472a1c;if(_0x5c302b>=_0x4fff39){_0x5c302b=_0x4fff39;_0x472a1c=0xc8;}else{_0x472a1c=0xce;}_0x503cef[_0x513d('0x1f')](_0x472a1c);return _0x503cef[_0x513d('0x25')]('Content-Range',_0x5bdda2+'-'+_0x5c302b+'/'+_0x4fff39)['json'](_0x16397f);}return null;};}function patchUpdates(_0x1738c5){return function(_0x21d951){try{jsonpatch[_0x513d('0x26')](_0x21d951,_0x1738c5,!![]);}catch(_0xc1382f){return BPromise[_0x513d('0x27')](_0xc1382f);}return _0x21d951[_0x513d('0x28')]();};}function saveUpdates(_0x34f99c,_0x2042f8){return function(_0x57bd3c){if(_0x57bd3c){return _0x57bd3c[_0x513d('0x29')](_0x34f99c)['then'](function(_0xa13e5f){return _0xa13e5f;});}return null;};}function removeEntity(_0x43f86c,_0x1d724e){return function(_0xed13e0){if(_0xed13e0){return _0xed13e0[_0x513d('0x2a')]()['then'](function(){_0x43f86c[_0x513d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58e6e9,_0x439772){return function(_0x17670c){if(!_0x17670c){_0x58e6e9['sendStatus'](0x194);}return _0x17670c;};}function handleError(_0x3caaca,_0x1fecf8){_0x1fecf8=_0x1fecf8||0x1f4;return function(_0x582190){logger['error'](_0x582190['stack']);if(_0x582190[_0x513d('0x2b')]){delete _0x582190[_0x513d('0x2b')];}_0x3caaca['status'](_0x1fecf8)[_0x513d('0x2c')](_0x582190);};}exports['index']=function(_0x574303,_0x509106){var _0x4b9537={},_0x4ecae9={},_0x5a6610={'count':0x0,'rows':[]};var _0x42ddbb=_[_0x513d('0x2d')](db[_0x513d('0x2e')]['rawAttributes'],function(_0x107ea7){return{'name':_0x107ea7[_0x513d('0x2f')],'type':_0x107ea7[_0x513d('0x30')][_0x513d('0x31')]};});_0x4ecae9['model']=_[_0x513d('0x2d')](_0x42ddbb,_0x513d('0x2b'));_0x4ecae9[_0x513d('0x32')]=_[_0x513d('0x33')](_0x574303['query']);_0x4ecae9[_0x513d('0x34')]=_[_0x513d('0x35')](_0x4ecae9[_0x513d('0x36')],_0x4ecae9[_0x513d('0x32')]);_0x4b9537[_0x513d('0x37')]=_['intersection'](_0x4ecae9[_0x513d('0x36')],qs[_0x513d('0x38')](_0x574303[_0x513d('0x32')][_0x513d('0x38')]));_0x4b9537[_0x513d('0x37')]=_0x4b9537[_0x513d('0x37')][_0x513d('0x39')]?_0x4b9537['attributes']:_0x4ecae9[_0x513d('0x36')];if(!_0x574303['query']['hasOwnProperty']('nolimit')){_0x4b9537[_0x513d('0x23')]=qs[_0x513d('0x23')](_0x574303[_0x513d('0x32')][_0x513d('0x23')]);_0x4b9537[_0x513d('0x21')]=qs[_0x513d('0x21')](_0x574303[_0x513d('0x32')][_0x513d('0x21')]);}_0x4b9537[_0x513d('0x3a')]=qs[_0x513d('0x3b')](_0x574303[_0x513d('0x32')]['sort']);_0x4b9537[_0x513d('0x3c')]=qs[_0x513d('0x34')](_['pick'](_0x574303[_0x513d('0x32')],_0x4ecae9[_0x513d('0x34')]),_0x42ddbb);if(_0x574303[_0x513d('0x32')]['filter']){_0x4b9537[_0x513d('0x3c')]=_[_0x513d('0x3d')](_0x4b9537[_0x513d('0x3c')],{'$or':_[_0x513d('0x2d')](_0x42ddbb,function(_0x23e24b){if(_0x23e24b[_0x513d('0x30')]!==_0x513d('0x3e')){var _0x185063={};_0x185063[_0x23e24b[_0x513d('0x2b')]]={'$like':'%'+_0x574303[_0x513d('0x32')][_0x513d('0x3f')]+'%'};return _0x185063;}})});}_0x4b9537=_[_0x513d('0x3d')]({},_0x4b9537,_0x574303[_0x513d('0x40')]);var _0x3cceef={'where':_0x4b9537[_0x513d('0x3c')]};return db[_0x513d('0x2e')][_0x513d('0x24')](_0x3cceef)[_0x513d('0x41')](function(_0x44e1b9){_0x5a6610[_0x513d('0x24')]=_0x44e1b9;if(_0x574303[_0x513d('0x32')]['includeAll']){_0x4b9537[_0x513d('0x42')]=[{'all':!![]}];}return db[_0x513d('0x2e')][_0x513d('0x43')](_0x4b9537);})[_0x513d('0x41')](function(_0x30bcd8){_0x5a6610[_0x513d('0x44')]=_0x30bcd8;return _0x5a6610;})[_0x513d('0x41')](respondWithFilteredResult(_0x509106,_0x4b9537))[_0x513d('0x45')](handleError(_0x509106,null));};exports['show']=function(_0x15a2d0,_0x44845a){var _0x3b494f={'raw':!![],'where':{'id':_0x15a2d0['params']['id']}},_0x4990e7={};_0x4990e7[_0x513d('0x36')]=_[_0x513d('0x33')](db[_0x513d('0x2e')]['rawAttributes']);_0x4990e7[_0x513d('0x32')]=_[_0x513d('0x33')](_0x15a2d0['query']);_0x4990e7[_0x513d('0x34')]=_[_0x513d('0x35')](_0x4990e7['model'],_0x4990e7[_0x513d('0x32')]);_0x3b494f['attributes']=_[_0x513d('0x35')](_0x4990e7['model'],qs[_0x513d('0x38')](_0x15a2d0['query'][_0x513d('0x38')]));_0x3b494f[_0x513d('0x37')]=_0x3b494f[_0x513d('0x37')][_0x513d('0x39')]?_0x3b494f['attributes']:_0x4990e7[_0x513d('0x36')];if(_0x15a2d0[_0x513d('0x32')][_0x513d('0x46')]){_0x3b494f[_0x513d('0x42')]=[{'all':!![]}];}_0x3b494f=_[_0x513d('0x3d')]({},_0x3b494f,_0x15a2d0[_0x513d('0x40')]);return db[_0x513d('0x2e')]['find'](_0x3b494f)[_0x513d('0x41')](handleEntityNotFound(_0x44845a,null))[_0x513d('0x41')](respondWithResult(_0x44845a,null))[_0x513d('0x45')](handleError(_0x44845a,null));};exports[_0x513d('0x47')]=function(_0x402d60,_0x13f303){return db[_0x513d('0x2e')][_0x513d('0x47')](_0x402d60[_0x513d('0x48')],{})[_0x513d('0x41')](respondWithResult(_0x13f303,0xc9))[_0x513d('0x45')](handleError(_0x13f303,null));};exports['update']=function(_0x306107,_0x1e9218){if(_0x306107[_0x513d('0x48')]['id']){delete _0x306107['body']['id'];}return db[_0x513d('0x2e')][_0x513d('0x49')]({'where':{'id':_0x306107['params']['id']}})[_0x513d('0x41')](handleEntityNotFound(_0x1e9218,null))[_0x513d('0x41')](saveUpdates(_0x306107[_0x513d('0x48')],null))['then'](respondWithResult(_0x1e9218,null))[_0x513d('0x45')](handleError(_0x1e9218,null));};exports[_0x513d('0x2a')]=function(_0x4b3f28,_0x3cd489){return db[_0x513d('0x2e')][_0x513d('0x49')]({'where':{'id':_0x4b3f28['params']['id']}})[_0x513d('0x41')](handleEntityNotFound(_0x3cd489,null))[_0x513d('0x41')](removeEntity(_0x3cd489,null))[_0x513d('0x45')](handleError(_0x3cd489,null));};exports[_0x513d('0x4a')]=function(_0x530cef,_0x21a98e){return db[_0x513d('0x2e')][_0x513d('0x4a')]()[_0x513d('0x41')](respondWithResult(_0x21a98e,null))[_0x513d('0x45')](handleError(_0x21a98e,null));};function wrapUser(_0x3a7a68){return function(_0x1d9670){var _0x5d7bed=_0x3a7a68[_0x513d('0x4b')]({'plain':!![]});_0x5d7bed[_0x513d('0x4c')]=[];if(_0x1d9670){_0x5d7bed[_0x513d('0x4d')]=_0x1d9670[_0x513d('0x4e')];_0x5d7bed[_0x513d('0x4f')]=_0x1d9670;}else{_0x5d7bed[_0x513d('0x4d')]=moment(0x0)[_0x513d('0x50')](_0x513d('0x51'));_0x5d7bed['lastMessage']={};}return _0x5d7bed;};}exports[_0x513d('0x52')]=function(_0x5a87e1,_0x21b43f,_0x46aca4){var _0x303f51=[];return db[_0x513d('0x53')][_0x513d('0x43')]({'where':{'role':[_0x513d('0x54'),_0x513d('0x55'),_0x513d('0x56')]},'attributes':['id',_0x513d('0x57'),_0x513d('0x2b'),_0x513d('0x58'),'userpic','internal',_0x513d('0x59'),_0x513d('0x5a'),_0x513d('0x5b'),_0x513d('0x5c')],'order':qs[_0x513d('0x3b')](_0x513d('0x5d')),'include':[{'model':db[_0x513d('0x5e')],'as':'VoiceQueues','attributes':['id',_0x513d('0x2b'),_0x513d('0x30')],'through':{'attributes':[]}}]})[_0x513d('0x41')](function(_0x4e9762){if(_0x4e9762){var _0x22a129=_0x5a87e1['user'][_0x513d('0x4b')]({'plain':!![]});if(!_0x22a129)throw new Error(_0x513d('0x5f'));if(_0x22a129[_0x513d('0x58')]==='user'){return db[_0x513d('0x60')]['find']({'where':{'name':'Agents','userProfileId':_0x22a129[_0x513d('0x61')]},'raw':!![]})[_0x513d('0x41')](function(_0x182edc){if(_0x182edc){if(_0x182edc[_0x513d('0x62')]===0x0){return db[_0x513d('0x63')][_0x513d('0x43')]({'where':{'sectionId':_0x182edc['id']},'raw':!![]})[_0x513d('0x41')](function(_0x1ca6fd){var _0x1978a5=[];if(_[_0x513d('0x64')](_0x1ca6fd)){_0x1978a5=_[_0x513d('0x3f')](_0x4e9762,function(_0x314426){if(_0x314426['role']!==_0x513d('0x54')){return _0x314426;}});return _0x1978a5;}else{for(var _0x205678=0x0;_0x205678<_0x4e9762['length'];_0x205678++){var _0x405335=_0x4e9762[_0x205678];if(_0x405335[_0x513d('0x58')]===_0x513d('0x54')){var _0x1e80ba=_[_0x513d('0x49')](_0x1ca6fd,function(_0x528a38){return _0x528a38['resourceId']===_0x405335['id'];});if(_0x1e80ba)_0x1978a5[_0x513d('0x65')](_0x405335);}else{_0x1978a5[_0x513d('0x65')](_0x405335);}}return _0x1978a5;}});}else{return _0x4e9762;}}else{var _0x264f3c=_['filter'](_0x4e9762,function(_0x593441){if(_0x593441['role']!=='agent'){return _0x593441;}});return _0x264f3c;}});}else{return _0x4e9762;}}})[_0x513d('0x41')](function(_0x502797){var _0x27bcb1=[];if(_0x502797){_0x303f51=_0x502797;for(var _0xde6aaa=0x0;_0xde6aaa<_0x502797['length'];_0xde6aaa+=0x1){_0x303f51[_0xde6aaa][_0x513d('0x4c')]=[];_0x27bcb1[_0x513d('0x65')](db[_0x513d('0x2e')][_0x513d('0x49')]({'where':{'FromId':[_0x5a87e1[_0x513d('0x56')]['id'],_0x502797[_0xde6aaa]['id']],'ToId':[_0x5a87e1[_0x513d('0x56')]['id'],_0x502797[_0xde6aaa]['id']],'ChatGroupId':null},'attributes':['id',_0x513d('0x4e'),_0x513d('0x66'),_0x513d('0x67'),_0x513d('0x68'),_0x513d('0x48')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x513d('0x41')](wrapUser(_0x502797[_0xde6aaa])));}return BPromise[_0x513d('0x69')](_0x27bcb1);}return[];})[_0x513d('0x41')](function(_0x5b6cd8){return{'rows':_0x5b6cd8,'count':_0x5b6cd8[_0x513d('0x39')]};})[_0x513d('0x41')](respondWithResult(_0x21b43f,null))[_0x513d('0x45')](handleError(_0x21b43f,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index db6721f..535a242 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 _0xfb96=['update','remove','emit','hasOwnProperty','hook','exports','ChatInternalMessage','setMaxListeners'];(function(_0x5257b7,_0x4f42d6){var _0x5a8139=function(_0x4adfe2){while(--_0x4adfe2){_0x5257b7['push'](_0x5257b7['shift']());}};_0x5a8139(++_0x4f42d6);}(_0xfb96,0x17e));var _0x6fb9=function(_0x23d970,_0x469b14){_0x23d970=_0x23d970-0x0;var _0x178ccb=_0xfb96[_0x23d970];return _0x178ccb;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x6fb9('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6fb9('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6fb9('0x2'),'afterDestroy':_0x6fb9('0x3')};function emitEvent(_0x481f51){return function(_0x27169e,_0x2e29b8,_0x146ed6){ChatInternalMessageEvents[_0x6fb9('0x4')](_0x481f51+':'+_0x27169e['id'],_0x27169e);ChatInternalMessageEvents['emit'](_0x481f51,_0x27169e);_0x146ed6(null);};}for(var e in events){if(events[_0x6fb9('0x5')](e)){var event=events[e];ChatInternalMessage[_0x6fb9('0x6')](e,emitEvent(event));}}module[_0x6fb9('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x3312=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x2b8253,_0x2bde88){var _0x386987=function(_0x429903){while(--_0x429903){_0x2b8253['push'](_0x2b8253['shift']());}};_0x386987(++_0x2bde88);}(_0x3312,0x1d7));var _0x2331=function(_0x5a8c87,_0x37c83c){_0x5a8c87=_0x5a8c87-0x0;var _0x523da9=_0x3312[_0x5a8c87];return _0x523da9;};'use strict';var EventEmitter=require(_0x2331('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2331('0x1')](0x0);var events={'afterCreate':_0x2331('0x2'),'afterUpdate':_0x2331('0x3'),'afterDestroy':_0x2331('0x4')};function emitEvent(_0x32dbf5){return function(_0x1bcf80,_0x26e76e,_0x554c2f){ChatInternalMessageEvents[_0x2331('0x5')](_0x32dbf5+':'+_0x1bcf80['id'],_0x1bcf80);ChatInternalMessageEvents['emit'](_0x32dbf5,_0x1bcf80);_0x554c2f(null);};}for(var e in events){if(events[_0x2331('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x2331('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 934d9ed..b05aeab 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 _0xe1af=['moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x941ba5,_0x9a095){var _0x3a681f=function(_0x16ae63){while(--_0x16ae63){_0x941ba5['push'](_0x941ba5['shift']());}};_0x3a681f(++_0x9a095);}(_0xe1af,0x192));var _0xfe1a=function(_0x3fb25d,_0x38f493){_0x3fb25d=_0x3fb25d-0x0;var _0x1d896b=_0xe1af[_0x3fb25d];return _0x1d896b;};'use strict';var _=require(_0xfe1a('0x0'));var util=require(_0xfe1a('0x1'));var logger=require('../../config/logger')(_0xfe1a('0x2'));var moment=require(_0xfe1a('0x3'));var BPromise=require('bluebird');var rp=require(_0xfe1a('0x4'));var fs=require('fs');var path=require(_0xfe1a('0x5'));var rimraf=require(_0xfe1a('0x6'));var config=require(_0xfe1a('0x7'));var attributes=require(_0xfe1a('0x8'));module[_0xfe1a('0x9')]=function(_0x20feb6,_0xb2d33a){return _0x20feb6[_0xfe1a('0xa')](_0xfe1a('0xb'),attributes,{'tableName':_0xfe1a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfe1a('0xd'),'collate':_0xfe1a('0xe')});}; \ No newline at end of file +var _0x55d4=['util','../../config/logger','api','request-promise','path','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci'];(function(_0x7a3ade,_0x4fe458){var _0x394283=function(_0x3acd03){while(--_0x3acd03){_0x7a3ade['push'](_0x7a3ade['shift']());}};_0x394283(++_0x4fe458);}(_0x55d4,0xf2));var _0x455d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x55d4[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x455d('0x0'));var logger=require(_0x455d('0x1'))(_0x455d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x455d('0x3'));var fs=require('fs');var path=require(_0x455d('0x4'));var rimraf=require('rimraf');var config=require(_0x455d('0x5'));var attributes=require(_0x455d('0x6'));module['exports']=function(_0x55e45d,_0x479023){return _0x55e45d[_0x455d('0x7')](_0x455d('0x8'),attributes,{'tableName':_0x455d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x455d('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index f179000..3291a58 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 _0x0665=['socket.io-emitter','register','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x49d9db,_0x41347b){var _0x5f049d=function(_0x2fb1ac){while(--_0x2fb1ac){_0x49d9db['push'](_0x49d9db['shift']());}};_0x5f049d(++_0x41347b);}(_0x0665,0x1e7));var _0x5066=function(_0x5ed65f,_0x23d121){_0x5ed65f=_0x5ed65f-0x0;var _0x1f43ae=_0x0665[_0x5ed65f];return _0x1f43ae;};'use strict';var _=require(_0x5066('0x0'));var util=require(_0x5066('0x1'));var moment=require(_0x5066('0x2'));var BPromise=require('bluebird');var rs=require(_0x5066('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5066('0x4'))['db'];var utils=require(_0x5066('0x5'));var logger=require(_0x5066('0x6'))('rpc');var config=require(_0x5066('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5066('0x8')][_0x5066('0x9')]({'port':0x232a});config[_0x5066('0xa')]=_[_0x5066('0xb')](config[_0x5066('0xa')],{'host':_0x5066('0xc'),'port':0x18eb});var socket=require(_0x5066('0xd'))(new Redis(config[_0x5066('0xa')]));require('./chatInternalMessage.socket')[_0x5066('0xe')](socket);function respondWithRpcPromise(_0x290a0f,_0x445e25,_0x373808){return new BPromise(function(_0x39ec9e,_0x1bc504){return client[_0x5066('0xf')](_0x290a0f,_0x373808)['then'](function(_0x3a07ae){logger['info'](_0x5066('0x10'),_0x445e25,_0x5066('0x11'));logger[_0x5066('0x12')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x445e25,'request\x20sent',JSON[_0x5066('0x13')](_0x3a07ae));if(_0x3a07ae[_0x5066('0x14')]){if(_0x3a07ae['error']['code']===0x1f4){logger[_0x5066('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x445e25,_0x3a07ae['error'][_0x5066('0x15')]);return _0x1bc504(_0x3a07ae[_0x5066('0x14')]['message']);}logger[_0x5066('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x445e25,_0x3a07ae[_0x5066('0x14')][_0x5066('0x15')]);return _0x39ec9e(_0x3a07ae[_0x5066('0x14')][_0x5066('0x15')]);}else{logger[_0x5066('0x16')](_0x5066('0x10'),_0x445e25,'request\x20sent');_0x39ec9e(_0x3a07ae[_0x5066('0x17')]['message']);}})[_0x5066('0x18')](function(_0xb47496){logger[_0x5066('0x14')](_0x5066('0x10'),_0x445e25,_0xb47496);_0x1bc504(_0xb47496);});});} \ No newline at end of file +var _0xf977=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5aa1cc,_0x2f4191){var _0x30eeb7=function(_0x53930a){while(--_0x53930a){_0x5aa1cc['push'](_0x5aa1cc['shift']());}};_0x30eeb7(++_0x2f4191);}(_0xf977,0x161));var _0x7f97=function(_0x169836,_0x4f1deb){_0x169836=_0x169836-0x0;var _0x364653=_0xf977[_0x169836];return _0x364653;};'use strict';var _=require(_0x7f97('0x0'));var util=require(_0x7f97('0x1'));var moment=require(_0x7f97('0x2'));var BPromise=require(_0x7f97('0x3'));var rs=require(_0x7f97('0x4'));var fs=require('fs');var Redis=require(_0x7f97('0x5'));var db=require(_0x7f97('0x6'))['db'];var utils=require(_0x7f97('0x7'));var logger=require(_0x7f97('0x8'))(_0x7f97('0x9'));var config=require(_0x7f97('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x7f97('0xb')]=_['defaults'](config[_0x7f97('0xb')],{'host':_0x7f97('0xc'),'port':0x18eb});var socket=require(_0x7f97('0xd'))(new Redis(config[_0x7f97('0xb')]));require(_0x7f97('0xe'))['register'](socket);function respondWithRpcPromise(_0x28de16,_0x35f2d7,_0x2e340b){return new BPromise(function(_0x3ea6f8,_0x179713){return client['request'](_0x28de16,_0x2e340b)[_0x7f97('0xf')](function(_0x35762f){logger[_0x7f97('0x10')](_0x7f97('0x11'),_0x35f2d7,_0x7f97('0x12'));logger['debug'](_0x7f97('0x13'),_0x35f2d7,_0x7f97('0x12'),JSON[_0x7f97('0x14')](_0x35762f));if(_0x35762f[_0x7f97('0x15')]){if(_0x35762f[_0x7f97('0x15')][_0x7f97('0x16')]===0x1f4){logger[_0x7f97('0x15')](_0x7f97('0x11'),_0x35f2d7,_0x35762f['error'][_0x7f97('0x17')]);return _0x179713(_0x35762f[_0x7f97('0x15')][_0x7f97('0x17')]);}logger[_0x7f97('0x15')](_0x7f97('0x11'),_0x35f2d7,_0x35762f['error']['message']);return _0x3ea6f8(_0x35762f[_0x7f97('0x15')][_0x7f97('0x17')]);}else{logger[_0x7f97('0x10')](_0x7f97('0x11'),_0x35f2d7,'request\x20sent');_0x3ea6f8(_0x35762f['result'][_0x7f97('0x17')]);}})[_0x7f97('0x18')](function(_0x393eb9){logger[_0x7f97('0x15')](_0x7f97('0x11'),_0x35f2d7,_0x393eb9);_0x179713(_0x393eb9);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index aed27bb..db7f227 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 _0x2a8e=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x29573e,_0x4c5cc8){var _0x1b8444=function(_0x21a965){while(--_0x21a965){_0x29573e['push'](_0x29573e['shift']());}};_0x1b8444(++_0x4c5cc8);}(_0x2a8e,0xa7));var _0xe2a8=function(_0x1d930a,_0x362822){_0x1d930a=_0x1d930a-0x0;var _0x4f57d8=_0x2a8e[_0x1d930a];return _0x4f57d8;};'use strict';var ChatInternalMessageEvents=require(_0xe2a8('0x0'));var events=[_0xe2a8('0x1'),_0xe2a8('0x2'),_0xe2a8('0x3')];function createListener(_0x160df6,_0x3bb854){return function(_0x32f9ce){_0x3bb854[_0xe2a8('0x4')](_0x160df6,_0x32f9ce);};}function removeListener(_0xe844a0,_0x2c92c6){return function(){ChatInternalMessageEvents[_0xe2a8('0x5')](_0xe844a0,_0x2c92c6);};}exports[_0xe2a8('0x6')]=function(_0x406ee1){for(var _0xc967af=0x0,_0x8d87=events[_0xe2a8('0x7')];_0xc967af<_0x8d87;_0xc967af++){var _0x5bb2f5=events[_0xc967af];var _0x51ae44=createListener(_0xe2a8('0x8')+_0x5bb2f5,_0x406ee1);ChatInternalMessageEvents['on'](_0x5bb2f5,_0x51ae44);}}; \ No newline at end of file +var _0xd68c=['./chatInternalMessage.events','save','removeListener','register','chatInternalMessage:'];(function(_0x5cb48f,_0x5c3815){var _0x3f52a7=function(_0x43dbbd){while(--_0x43dbbd){_0x5cb48f['push'](_0x5cb48f['shift']());}};_0x3f52a7(++_0x5c3815);}(_0xd68c,0x1ea));var _0xcd68=function(_0x3b8363,_0x17bc8){_0x3b8363=_0x3b8363-0x0;var _0x4d8289=_0xd68c[_0x3b8363];return _0x4d8289;};'use strict';var ChatInternalMessageEvents=require(_0xcd68('0x0'));var events=[_0xcd68('0x1'),'remove','update'];function createListener(_0x3d87df,_0x4ced1f){return function(_0xcfa38d){_0x4ced1f['emit'](_0x3d87df,_0xcfa38d);};}function removeListener(_0x31a4f0,_0x110443){return function(){ChatInternalMessageEvents[_0xcd68('0x2')](_0x31a4f0,_0x110443);};}exports[_0xcd68('0x3')]=function(_0x241495){for(var _0x4307e6=0x0,_0x411fb9=events['length'];_0x4307e6<_0x411fb9;_0x4307e6++){var _0x367ff5=events[_0x4307e6];var _0x5d9b6e=createListener(_0xcd68('0x4')+_0x367ff5,_0x241495);ChatInternalMessageEvents['on'](_0x367ff5,_0x5d9b6e);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index cbe988a..cb36a30 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 _0x21e5=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/users','show','post','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x928b87,_0x53480a){var _0x1e7638=function(_0x1e2184){while(--_0x1e2184){_0x928b87['push'](_0x928b87['shift']());}};_0x1e7638(++_0x53480a);}(_0x21e5,0xa6));var _0x521e=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x21e5[_0x3e961c];return _0x474f9c;};'use strict';var multer=require(_0x521e('0x0'));var util=require(_0x521e('0x1'));var path=require(_0x521e('0x2'));var timeout=require(_0x521e('0x3'));var express=require(_0x521e('0x4'));var router=express[_0x521e('0x5')]();var fs_extra=require(_0x521e('0x6'));var auth=require(_0x521e('0x7'));var interaction=require(_0x521e('0x8'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x521e('0x9')]('/',auth[_0x521e('0xa')](),controller[_0x521e('0xb')]);router[_0x521e('0x9')](_0x521e('0xc'),auth[_0x521e('0xa')](),controller[_0x521e('0xd')]);router[_0x521e('0x9')](_0x521e('0xe'),auth[_0x521e('0xa')](),controller['getUsers']);router[_0x521e('0x9')]('/:id',auth[_0x521e('0xa')](),controller[_0x521e('0xf')]);router[_0x521e('0x10')]('/',auth['isAuthenticated'](),controller[_0x521e('0x11')]);router[_0x521e('0x12')](_0x521e('0x13'),controller[_0x521e('0x14')]);router[_0x521e('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x521e('0x16')]);module[_0x521e('0x17')]=router; \ No newline at end of file +var _0x92e8=['../../config/environment','./chatInternalMessage.controller','isAuthenticated','get','/users','/:id','show','post','create','put','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4885e9,_0x4aec32){var _0x566027=function(_0x27c393){while(--_0x27c393){_0x4885e9['push'](_0x4885e9['shift']());}};_0x566027(++_0x4aec32);}(_0x92e8,0x7f));var _0x892e=function(_0x3825a8,_0x2ce1a2){_0x3825a8=_0x3825a8-0x0;var _0xabc9bc=_0x92e8[_0x3825a8];return _0xabc9bc;};'use strict';var multer=require(_0x892e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x892e('0x1'));var express=require('express');var router=express[_0x892e('0x2')]();var fs_extra=require(_0x892e('0x3'));var auth=require(_0x892e('0x4'));var interaction=require(_0x892e('0x5'));var config=require(_0x892e('0x6'));var controller=require(_0x892e('0x7'));router['get']('/',auth[_0x892e('0x8')](),controller['index']);router[_0x892e('0x9')]('/describe',auth[_0x892e('0x8')](),controller['describe']);router[_0x892e('0x9')](_0x892e('0xa'),auth[_0x892e('0x8')](),controller['getUsers']);router[_0x892e('0x9')](_0x892e('0xb'),auth[_0x892e('0x8')](),controller[_0x892e('0xc')]);router[_0x892e('0xd')]('/',auth['isAuthenticated'](),controller[_0x892e('0xe')]);router[_0x892e('0xf')](_0x892e('0xb'),controller['update']);router[_0x892e('0x10')]('/:id',auth[_0x892e('0x8')](),controller[_0x892e('0x11')]);module[_0x892e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 3b4938a..63a5f06 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 _0x1619=['ENUM','out','STRING','TEXT','BOOLEAN'];(function(_0x2e0c7f,_0x594ed8){var _0x49d09c=function(_0x5e840a){while(--_0x5e840a){_0x2e0c7f['push'](_0x2e0c7f['shift']());}};_0x49d09c(++_0x594ed8);}(_0x1619,0x189));var _0x9161=function(_0x35768b,_0x561d27){_0x35768b=_0x35768b-0x0;var _0x2429d7=_0x1619[_0x35768b];return _0x2429d7;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x9161('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9161('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9161('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9161('0x2')]('in','out'),'defaultValue':_0x9161('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x9161('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xc224=['exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x1636c1,_0x1103dd){var _0x1371a7=function(_0x10bd32){while(--_0x10bd32){_0x1636c1['push'](_0x1636c1['shift']());}};_0x1371a7(++_0x1103dd);}(_0xc224,0x1af));var _0x4c22=function(_0x3863dd,_0x271aaf){_0x3863dd=_0x3863dd-0x0;var _0x10c603=_0xc224[_0x3863dd];return _0x10c603;};'use strict';var Sequelize=require(_0x4c22('0x0'));module[_0x4c22('0x1')]={'body':{'type':Sequelize[_0x4c22('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4c22('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4c22('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4c22('0x4')]('in',_0x4c22('0x5')),'defaultValue':_0x4c22('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4c22('0x6')]},'providerName':{'type':Sequelize[_0x4c22('0x7')]},'providerResponse':{'type':Sequelize[_0x4c22('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 670ac2c..4f824f2 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 _0x36e9=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','VIRTUAL','options','ChatMessage','includeAll','findAll','rows','show','params','include','merge','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','agent','fullname','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','internal','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','undefined','limit','offset','count','set','apply','reject','update','destroy','sendStatus','stack','name','send','index','rawAttributes','type','model','query','keys','filters','attributes','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36e9,0x1d6));var _0x936e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x36e9[_0x18a79d];return _0x4f8848;};'use strict';var emlformat=require(_0x936e('0x0'));var rimraf=require(_0x936e('0x1'));var zipdir=require(_0x936e('0x2'));var jsonpatch=require(_0x936e('0x3'));var rp=require('request-promise');var moment=require(_0x936e('0x4'));var BPromise=require(_0x936e('0x5'));var Mustache=require(_0x936e('0x6'));var util=require(_0x936e('0x7'));var path=require(_0x936e('0x8'));var sox=require('sox');var csv=require(_0x936e('0x9'));var ejs=require(_0x936e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x936e('0xb'));var squel=require(_0x936e('0xc'));var crypto=require(_0x936e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x936e('0xe'));var toCsv=require(_0x936e('0x9'));var querystring=require(_0x936e('0xf'));var Papa=require(_0x936e('0x10'));var Redis=require(_0x936e('0x11'));var authService=require(_0x936e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x936e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x936e('0x14'))('api');var utils=require(_0x936e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x936e('0x16'));var db=require(_0x936e('0x17'))['db'];config[_0x936e('0x18')]=_[_0x936e('0x19')](config['redis'],{'host':_0x936e('0x1a'),'port':0x18eb});var socket=require(_0x936e('0x1b'))(new Redis(config[_0x936e('0x18')]));require(_0x936e('0x1c'))['register'](socket);var jayson=require(_0x936e('0x1d'));var client=jayson[_0x936e('0x1e')][_0x936e('0x1f')]({'port':0x232c});var client9002=jayson[_0x936e('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x364b56,_0x4367da,_0x5c647c,_0x3f5ad0){return new BPromise(function(_0x4f5d06,_0x423657){var _0x165f98=_0x3f5ad0||client;return _0x165f98[_0x936e('0x20')](_0x364b56,_0x5c647c)[_0x936e('0x21')](function(_0x5d142c){logger[_0x936e('0x22')](_0x936e('0x23'),_0x4367da,_0x936e('0x24'));logger[_0x936e('0x25')](_0x936e('0x26'),_0x4367da,_0x936e('0x24'),JSON[_0x936e('0x27')](_0x5d142c));if(_0x5d142c['error']){if(_0x5d142c[_0x936e('0x28')][_0x936e('0x29')]===0x1f4){logger['error'](_0x936e('0x23'),_0x4367da,_0x5d142c['error'][_0x936e('0x2a')]);return _0x423657(_0x5d142c[_0x936e('0x28')][_0x936e('0x2a')]);}logger['error'](_0x936e('0x23'),_0x4367da,_0x5d142c[_0x936e('0x28')]['message']);return _0x4f5d06(_0x5d142c[_0x936e('0x28')][_0x936e('0x2a')]);}else{logger['info'](_0x936e('0x23'),_0x4367da,_0x936e('0x24'));_0x4f5d06(_0x5d142c[_0x936e('0x2b')][_0x936e('0x2a')]);}})[_0x936e('0x2c')](function(_0x4d8c12){logger[_0x936e('0x28')](_0x936e('0x23'),_0x4367da,_0x4d8c12);_0x423657(_0x4d8c12);});});}function respondWithStatusCode(_0x3132d7,_0x51bdb6){_0x51bdb6=_0x51bdb6||0xcc;return function(_0xef1c0b){if(_0xef1c0b){return _0x3132d7['sendStatus'](_0x51bdb6);}return _0x3132d7['status'](_0x51bdb6)[_0x936e('0x2d')]();};}function respondWithResult(_0x31e95c,_0x50f800){_0x50f800=_0x50f800||0xc8;return function(_0x205fdf){if(_0x205fdf){return _0x31e95c[_0x936e('0x2e')](_0x50f800)[_0x936e('0x2f')](_0x205fdf);}};}function respondWithFilteredResult(_0x3ff553,_0xfc00ab){return function(_0x31e859){if(_0x31e859){var _0x16a78a=typeof _0xfc00ab['offset']===_0x936e('0x30')&&typeof _0xfc00ab[_0x936e('0x31')]==='undefined';var _0x9f1ba8=_0x31e859['count'];var _0x15be44=_0x16a78a?0x0:_0xfc00ab[_0x936e('0x32')];var _0x43af15=_0x16a78a?_0x31e859[_0x936e('0x33')]:_0xfc00ab[_0x936e('0x32')]+_0xfc00ab[_0x936e('0x31')];var _0x3ee94e;if(_0x43af15>=_0x9f1ba8){_0x43af15=_0x9f1ba8;_0x3ee94e=0xc8;}else{_0x3ee94e=0xce;}_0x3ff553[_0x936e('0x2e')](_0x3ee94e);return _0x3ff553[_0x936e('0x34')]('Content-Range',_0x15be44+'-'+_0x43af15+'/'+_0x9f1ba8)[_0x936e('0x2f')](_0x31e859);}return null;};}function patchUpdates(_0x2fd3e2){return function(_0x51638c){try{jsonpatch[_0x936e('0x35')](_0x51638c,_0x2fd3e2,!![]);}catch(_0x86ed55){return BPromise[_0x936e('0x36')](_0x86ed55);}return _0x51638c['save']();};}function saveUpdates(_0x4e38cb,_0x2ccb01){return function(_0x58b12e){if(_0x58b12e){return _0x58b12e[_0x936e('0x37')](_0x4e38cb)[_0x936e('0x21')](function(_0x1b640f){return _0x1b640f;});}return null;};}function removeEntity(_0x14ea4d,_0xba8722){return function(_0x594943){if(_0x594943){return _0x594943[_0x936e('0x38')]()[_0x936e('0x21')](function(){_0x14ea4d[_0x936e('0x2e')](0xcc)[_0x936e('0x2d')]();});}};}function handleEntityNotFound(_0x3a57ca,_0x1da0db){return function(_0x147645){if(!_0x147645){_0x3a57ca[_0x936e('0x39')](0x194);}return _0x147645;};}function handleError(_0x406211,_0x2999a4){_0x2999a4=_0x2999a4||0x1f4;return function(_0x6f45){logger['error'](_0x6f45[_0x936e('0x3a')]);if(_0x6f45[_0x936e('0x3b')]){delete _0x6f45['name'];}_0x406211['status'](_0x2999a4)[_0x936e('0x3c')](_0x6f45);};}exports[_0x936e('0x3d')]=function(_0x20cb64,_0xf7292c){var _0x1baf79={},_0x2b7a41={},_0x3983bd={'count':0x0,'rows':[]};var _0x29e830=_['map'](db['ChatMessage'][_0x936e('0x3e')],function(_0x329e04){return{'name':_0x329e04['fieldName'],'type':_0x329e04[_0x936e('0x3f')]['key']};});_0x2b7a41[_0x936e('0x40')]=_['map'](_0x29e830,'name');_0x2b7a41[_0x936e('0x41')]=_[_0x936e('0x42')](_0x20cb64[_0x936e('0x41')]);_0x2b7a41[_0x936e('0x43')]=_['intersection'](_0x2b7a41[_0x936e('0x40')],_0x2b7a41[_0x936e('0x41')]);_0x1baf79[_0x936e('0x44')]=_[_0x936e('0x45')](_0x2b7a41[_0x936e('0x40')],qs[_0x936e('0x46')](_0x20cb64[_0x936e('0x41')][_0x936e('0x46')]));_0x1baf79['attributes']=_0x1baf79[_0x936e('0x44')][_0x936e('0x47')]?_0x1baf79['attributes']:_0x2b7a41[_0x936e('0x40')];if(!_0x20cb64[_0x936e('0x41')][_0x936e('0x48')](_0x936e('0x49'))){_0x1baf79['limit']=qs['limit'](_0x20cb64['query']['limit']);_0x1baf79[_0x936e('0x32')]=qs[_0x936e('0x32')](_0x20cb64[_0x936e('0x41')]['offset']);}_0x1baf79[_0x936e('0x4a')]=qs[_0x936e('0x4b')](_0x20cb64[_0x936e('0x41')]['sort']);_0x1baf79['where']=qs[_0x936e('0x43')](_[_0x936e('0x4c')](_0x20cb64[_0x936e('0x41')],_0x2b7a41['filters']),_0x29e830);if(_0x20cb64['query'][_0x936e('0x4d')]){_0x1baf79[_0x936e('0x4e')]=_['merge'](_0x1baf79[_0x936e('0x4e')],{'$or':_[_0x936e('0x4f')](_0x29e830,function(_0x45232a){if(_0x45232a[_0x936e('0x3f')]!==_0x936e('0x50')){var _0x29c89f={};_0x29c89f[_0x45232a[_0x936e('0x3b')]]={'$like':'%'+_0x20cb64['query'][_0x936e('0x4d')]+'%'};return _0x29c89f;}})});}_0x1baf79=_['merge']({},_0x1baf79,_0x20cb64[_0x936e('0x51')]);var _0x5ab4bd={'where':_0x1baf79[_0x936e('0x4e')]};return db[_0x936e('0x52')][_0x936e('0x33')](_0x5ab4bd)[_0x936e('0x21')](function(_0x4273e1){_0x3983bd[_0x936e('0x33')]=_0x4273e1;if(_0x20cb64['query'][_0x936e('0x53')]){_0x1baf79['include']=[{'all':!![]}];}return db[_0x936e('0x52')][_0x936e('0x54')](_0x1baf79);})[_0x936e('0x21')](function(_0x51c738){_0x3983bd[_0x936e('0x55')]=_0x51c738;return _0x3983bd;})[_0x936e('0x21')](respondWithFilteredResult(_0xf7292c,_0x1baf79))[_0x936e('0x2c')](handleError(_0xf7292c,null));};exports[_0x936e('0x56')]=function(_0x4128b9,_0x4d8e30){var _0x32b8a8={'raw':!![],'where':{'id':_0x4128b9[_0x936e('0x57')]['id']}},_0x4d915e={};_0x4d915e[_0x936e('0x40')]=_[_0x936e('0x42')](db[_0x936e('0x52')][_0x936e('0x3e')]);_0x4d915e['query']=_['keys'](_0x4128b9['query']);_0x4d915e[_0x936e('0x43')]=_[_0x936e('0x45')](_0x4d915e[_0x936e('0x40')],_0x4d915e[_0x936e('0x41')]);_0x32b8a8[_0x936e('0x44')]=_['intersection'](_0x4d915e['model'],qs['fields'](_0x4128b9[_0x936e('0x41')]['fields']));_0x32b8a8[_0x936e('0x44')]=_0x32b8a8[_0x936e('0x44')]['length']?_0x32b8a8[_0x936e('0x44')]:_0x4d915e['model'];if(_0x4128b9[_0x936e('0x41')]['includeAll']){_0x32b8a8[_0x936e('0x58')]=[{'all':!![]}];}_0x32b8a8=_[_0x936e('0x59')]({},_0x32b8a8,_0x4128b9[_0x936e('0x51')]);return db[_0x936e('0x52')][_0x936e('0x5a')](_0x32b8a8)['then'](handleEntityNotFound(_0x4d8e30,null))[_0x936e('0x21')](respondWithResult(_0x4d8e30,null))['catch'](handleError(_0x4d8e30,null));};exports[_0x936e('0x5b')]=function(_0x4dae32,_0x114e8a){return db['ChatMessage'][_0x936e('0x5b')](_0x4dae32[_0x936e('0x5c')],{})['then'](respondWithResult(_0x114e8a,0xc9))[_0x936e('0x2c')](handleError(_0x114e8a,null));};exports['update']=function(_0x3e4e2f,_0x12be22){if(_0x3e4e2f[_0x936e('0x5c')]['id']){delete _0x3e4e2f['body']['id'];}return db[_0x936e('0x52')][_0x936e('0x5a')]({'where':{'id':_0x3e4e2f['params']['id']}})[_0x936e('0x21')](handleEntityNotFound(_0x12be22,null))[_0x936e('0x21')](saveUpdates(_0x3e4e2f['body'],null))[_0x936e('0x21')](respondWithResult(_0x12be22,null))['catch'](handleError(_0x12be22,null));};exports['destroy']=function(_0xb635af,_0x4d04fe){return db[_0x936e('0x52')][_0x936e('0x5a')]({'where':{'id':_0xb635af[_0x936e('0x57')]['id']}})[_0x936e('0x21')](handleEntityNotFound(_0x4d04fe,null))[_0x936e('0x21')](removeEntity(_0x4d04fe,null))[_0x936e('0x2c')](handleError(_0x4d04fe,null));};exports[_0x936e('0x5d')]=function(_0x421442,_0x38834a){return db[_0x936e('0x52')][_0x936e('0x5d')]()[_0x936e('0x21')](respondWithResult(_0x38834a,null))[_0x936e('0x2c')](handleError(_0x38834a,null));};var interaction_log=require('../../config/logger')(_0x936e('0x5e'));exports[_0x936e('0x5f')]=function(_0x3cb4b1,_0x52a499,_0x26cf97){var _0x2cf7ac={'agent':{},'channel':_0x936e('0x60')};if(_0x3cb4b1[_0x936e('0x5c')]['id']){delete _0x3cb4b1[_0x936e('0x5c')]['id'];}_0x3cb4b1[_0x936e('0x5c')][_0x936e('0x61')]=!![];_0x3cb4b1[_0x936e('0x5c')]['readAt']=moment()[_0x936e('0x62')](_0x936e('0x63'));_0x3cb4b1[_0x936e('0x5c')][_0x936e('0x64')]=_0x3cb4b1[_0x936e('0x5c')][_0x936e('0x64')]||_0x3cb4b1['user']['id'];_0x2cf7ac['agent']['id']=_0x3cb4b1[_0x936e('0x5c')][_0x936e('0x64')];return db['ChatMessage'][_0x936e('0x5a')]({'where':{'id':_0x3cb4b1[_0x936e('0x57')]['id'],'UserId':null}})[_0x936e('0x21')](handleEntityNotFound(_0x52a499,null))[_0x936e('0x21')](saveUpdates(_0x3cb4b1[_0x936e('0x5c')],null))[_0x936e('0x21')](function(_0x40a2bb){if(_0x40a2bb){_0x2cf7ac[_0x936e('0x2a')]=_0x40a2bb[_0x936e('0x65')]({'plain':!![]});return db[_0x936e('0x66')][_0x936e('0x5a')]({'where':{'id':_0x40a2bb['ChatInteractionId']}});}return null;})[_0x936e('0x21')](handleEntityNotFound(_0x52a499,null))['then'](function(_0x59c770){if(_0x59c770){return _0x59c770['update']({'UserId':_0x3cb4b1[_0x936e('0x5c')][_0x936e('0x64')],'read1stAt':_['isNil'](_0x59c770[_0x936e('0x67')])?moment()['format'](_0x936e('0x63')):undefined});}return null;})[_0x936e('0x21')](function(_0x594ac4){if(_0x594ac4){_0x2cf7ac[_0x936e('0x68')]=_0x594ac4[_0x936e('0x65')]({'plain':!![]});interaction_log[_0x936e('0x22')](_0x936e('0x69'),_0x3cb4b1[_0x936e('0x6a')]['id'],_0x3cb4b1[_0x936e('0x6a')][_0x936e('0x3b')],_0x3cb4b1[_0x936e('0x6a')]['role'],_0x2cf7ac['interaction']['id'],_0x3cb4b1[_0x936e('0x5c')]?JSON[_0x936e('0x27')](_0x3cb4b1[_0x936e('0x5c')]):_0x936e('0x6b'));return respondWithRpcPromise(_0x936e('0x6c'),_0x936e('0x6d'),_0x2cf7ac);}return null;})['then'](function(_0x164c26){var _0x3df05f=_0x936e('0x6e')+_0x164c26['message'][_0x936e('0x6f')];return db['sequelize'][_0x936e('0x41')](_0x3df05f,{'type':db[_0x936e('0x70')][_0x936e('0x71')]['SELECT'],'raw':!![]})[_0x936e('0x21')](function(_0x21700a){return _0x21700a;});})[_0x936e('0x21')](function(_0x2af762){if(_0x2af762){_0x2cf7ac[_0x936e('0x2a')][_0x936e('0x72')]=_0x2af762[0x0];if(!_0x3cb4b1[_0x936e('0x5c')][_0x936e('0x64')])return;return db[_0x936e('0x73')][_0x936e('0x5a')]({'where':{'id':_0x3cb4b1[_0x936e('0x5c')]['UserId'],'role':_0x936e('0x74')},'attributes':['id',_0x936e('0x3b'),_0x936e('0x75'),_0x936e('0x76'),'internal'],'raw':!![]});}return null;})[_0x936e('0x21')](function(_0x1935be){if(!_0x1935be)return null;_0x2cf7ac[_0x936e('0x2a')]['agent']=_0x1935be;return _0x2cf7ac;})[_0x936e('0x21')](function(_0x157be4){if(_0x157be4){if(_0x3cb4b1[_0x936e('0x5c')][_0x936e('0x77')]){_0x2cf7ac['message'][_0x936e('0x78')]=util[_0x936e('0x62')]('SIP/%s',_0x3cb4b1['user'][_0x936e('0x3b')]);_0x2cf7ac[_0x936e('0x2a')][_0x936e('0x79')]=_0x2cf7ac[_0x936e('0x79')];_0x2cf7ac['message'][_0x936e('0x7a')]=_0x2cf7ac[_0x936e('0x79')];_0x2cf7ac[_0x936e('0x2a')][_0x936e('0x7b')]=_0x936e('0x5f');return respondWithRpcPromise(_0x936e('0x7c'),_0x936e('0x7c'),{'event':_0x936e('0x7d'),'message':_[_0x936e('0x59')](_0x2cf7ac[_0x936e('0x2a')],JSON[_0x936e('0x7e')](_0x2cf7ac['interaction'][_0x936e('0x7f')]))},client9002)['then'](function(){return _0x2cf7ac;});}return _0x2cf7ac;}return null;})[_0x936e('0x21')](respondWithResult(_0x52a499,null))[_0x936e('0x2c')](handleError(_0x52a499,null));};var interaction_log=require(_0x936e('0x14'))('chat-interactions');exports['reject']=function(_0x161379,_0x554813,_0x137c9b){var _0x2c7441={'agent':{},'channel':_0x936e('0x60')};if(_0x161379[_0x936e('0x5c')]['id']){delete _0x161379[_0x936e('0x5c')]['id'];}_0x161379[_0x936e('0x5c')]['UserId']=_0x161379[_0x936e('0x5c')]['UserId']||_0x161379[_0x936e('0x6a')]['id'];_0x2c7441[_0x936e('0x74')]['id']=_0x161379[_0x936e('0x5c')][_0x936e('0x64')];return db[_0x936e('0x52')][_0x936e('0x5a')]({'where':{'id':_0x161379['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x554813,null))[_0x936e('0x21')](function(_0xa83cb6){if(_0xa83cb6){_0x2c7441['message']=_0xa83cb6[_0x936e('0x65')]({'plain':!![]});return db['ChatInteraction'][_0x936e('0x5a')]({'where':{'id':_0xa83cb6[_0x936e('0x80')]}});}return null;})[_0x936e('0x21')](handleEntityNotFound(_0x554813,null))[_0x936e('0x21')](function(_0x396695){if(_0x396695){_0x2c7441[_0x936e('0x68')]=_0x396695['get']({'plain':!![]});interaction_log[_0x936e('0x22')](_0x936e('0x81'),_0x161379[_0x936e('0x6a')]['id'],_0x161379[_0x936e('0x6a')][_0x936e('0x3b')],_0x161379['user']['role'],_0x2c7441[_0x936e('0x68')]['id'],_0x161379['body']?JSON['stringify'](_0x161379[_0x936e('0x5c')]):_0x936e('0x6b'));return respondWithRpcPromise(_0x936e('0x82'),_0x936e('0x83'),_0x2c7441);}return null;})[_0x936e('0x21')](function(_0x322061){var _0x41423d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x322061[_0x936e('0x2a')][_0x936e('0x6f')];return db[_0x936e('0x84')][_0x936e('0x41')](_0x41423d,{'type':db[_0x936e('0x70')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x943018){return _0x943018;});})[_0x936e('0x21')](function(_0x598d77){if(_0x598d77){_0x2c7441[_0x936e('0x2a')][_0x936e('0x72')]=_0x598d77[0x0];if(!_0x161379[_0x936e('0x5c')][_0x936e('0x64')])return;return db[_0x936e('0x73')][_0x936e('0x5a')]({'where':{'id':_0x161379[_0x936e('0x5c')][_0x936e('0x64')],'role':_0x936e('0x74')},'attributes':['id',_0x936e('0x3b'),_0x936e('0x75'),_0x936e('0x76'),_0x936e('0x85')],'raw':!![]});}return null;})[_0x936e('0x21')](function(_0x25de0c){if(!_0x25de0c)return null;_0x2c7441[_0x936e('0x2a')][_0x936e('0x74')]=_0x25de0c;return _0x2c7441;})[_0x936e('0x21')](function(_0x14baff){if(_0x14baff){_0x14baff[_0x936e('0x2a')]['interface']=util['format']('SIP/%s',_0x161379[_0x936e('0x6a')][_0x936e('0x3b')]);_0x14baff[_0x936e('0x2a')][_0x936e('0x79')]=_0x2c7441['channel'];_0x14baff['message']['motionChannel']=_0x2c7441[_0x936e('0x79')];_0x14baff[_0x936e('0x2a')][_0x936e('0x7b')]=_0x936e('0x36');respondWithRpcPromise(_0x936e('0x7c'),_0x936e('0x7c'),{'event':_0x936e('0x86'),'message':_['merge'](_0x2c7441[_0x936e('0x2a')],JSON[_0x936e('0x7e')](_0x2c7441[_0x936e('0x68')][_0x936e('0x7f')]))},client9002);return _0x2c7441;}return null;})[_0x936e('0x21')](respondWithResult(_0x554813,null))[_0x936e('0x2c')](handleError(_0x554813,null));}; \ No newline at end of file +var _0xf92c=['destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','show','params','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','event','EventManager','parse','formData','null','RejectMessage','rejectMessage','ContactId','SIP/%s','motionChannel','reject','rejectmessage','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','json','save','update','then'];(function(_0x17effe,_0x19ece3){var _0x12ff05=function(_0x2c1231){while(--_0x2c1231){_0x17effe['push'](_0x17effe['shift']());}};_0x12ff05(++_0x19ece3);}(_0xf92c,0xd8));var _0xcf92=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xf92c[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require(_0xcf92('0x0'));var rimraf=require(_0xcf92('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcf92('0x2'));var rp=require('request-promise');var moment=require(_0xcf92('0x3'));var BPromise=require(_0xcf92('0x4'));var Mustache=require(_0xcf92('0x5'));var util=require(_0xcf92('0x6'));var path=require(_0xcf92('0x7'));var sox=require(_0xcf92('0x8'));var csv=require(_0xcf92('0x9'));var ejs=require(_0xcf92('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcf92('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcf92('0xc'));var toCsv=require(_0xcf92('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcf92('0xd'));var authService=require(_0xcf92('0xe'));var qs=require(_0xcf92('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf92('0x10'));var logger=require(_0xcf92('0x11'))(_0xcf92('0x12'));var utils=require(_0xcf92('0x13'));var config=require(_0xcf92('0x14'));var licenseUtil=require(_0xcf92('0x15'));var db=require(_0xcf92('0x16'))['db'];config['redis']=_[_0xcf92('0x17')](config[_0xcf92('0x18')],{'host':_0xcf92('0x19'),'port':0x18eb});var socket=require(_0xcf92('0x1a'))(new Redis(config[_0xcf92('0x18')]));require(_0xcf92('0x1b'))['register'](socket);var jayson=require(_0xcf92('0x1c'));var client=jayson[_0xcf92('0x1d')][_0xcf92('0x1e')]({'port':0x232c});var client9002=jayson[_0xcf92('0x1d')][_0xcf92('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x239f49,_0x86d34e,_0x177751,_0x34b0fd){return new BPromise(function(_0x2819eb,_0x5312a3){var _0x1c7a28=_0x34b0fd||client;return _0x1c7a28[_0xcf92('0x1f')](_0x239f49,_0x177751)['then'](function(_0x51b954){logger[_0xcf92('0x20')](_0xcf92('0x21'),_0x86d34e,'request\x20sent');logger[_0xcf92('0x22')](_0xcf92('0x23'),_0x86d34e,_0xcf92('0x24'),JSON[_0xcf92('0x25')](_0x51b954));if(_0x51b954[_0xcf92('0x26')]){if(_0x51b954[_0xcf92('0x26')][_0xcf92('0x27')]===0x1f4){logger['error'](_0xcf92('0x21'),_0x86d34e,_0x51b954[_0xcf92('0x26')][_0xcf92('0x28')]);return _0x5312a3(_0x51b954['error'][_0xcf92('0x28')]);}logger[_0xcf92('0x26')](_0xcf92('0x21'),_0x86d34e,_0x51b954[_0xcf92('0x26')][_0xcf92('0x28')]);return _0x2819eb(_0x51b954[_0xcf92('0x26')][_0xcf92('0x28')]);}else{logger[_0xcf92('0x20')](_0xcf92('0x21'),_0x86d34e,_0xcf92('0x24'));_0x2819eb(_0x51b954[_0xcf92('0x29')]['message']);}})[_0xcf92('0x2a')](function(_0xb83ab2){logger['error'](_0xcf92('0x21'),_0x86d34e,_0xb83ab2);_0x5312a3(_0xb83ab2);});});}function respondWithStatusCode(_0x220698,_0x3b09ad){_0x3b09ad=_0x3b09ad||0xcc;return function(_0x27a79e){if(_0x27a79e){return _0x220698[_0xcf92('0x2b')](_0x3b09ad);}return _0x220698[_0xcf92('0x2c')](_0x3b09ad)[_0xcf92('0x2d')]();};}function respondWithResult(_0x3b36d3,_0x52fbfa){_0x52fbfa=_0x52fbfa||0xc8;return function(_0x161caf){if(_0x161caf){return _0x3b36d3['status'](_0x52fbfa)['json'](_0x161caf);}};}function respondWithFilteredResult(_0x4b7f8b,_0x3de2ec){return function(_0x5c2be4){if(_0x5c2be4){var _0x1b2731=typeof _0x3de2ec[_0xcf92('0x2e')]===_0xcf92('0x2f')&&typeof _0x3de2ec[_0xcf92('0x30')]===_0xcf92('0x2f');var _0x11e851=_0x5c2be4[_0xcf92('0x31')];var _0x398b2a=_0x1b2731?0x0:_0x3de2ec['offset'];var _0x43fb28=_0x1b2731?_0x5c2be4[_0xcf92('0x31')]:_0x3de2ec[_0xcf92('0x2e')]+_0x3de2ec[_0xcf92('0x30')];var _0x26e5fa;if(_0x43fb28>=_0x11e851){_0x43fb28=_0x11e851;_0x26e5fa=0xc8;}else{_0x26e5fa=0xce;}_0x4b7f8b['status'](_0x26e5fa);return _0x4b7f8b['set']('Content-Range',_0x398b2a+'-'+_0x43fb28+'/'+_0x11e851)[_0xcf92('0x32')](_0x5c2be4);}return null;};}function patchUpdates(_0x2caccc){return function(_0x3df8e7){try{jsonpatch['apply'](_0x3df8e7,_0x2caccc,!![]);}catch(_0x17f51e){return BPromise['reject'](_0x17f51e);}return _0x3df8e7[_0xcf92('0x33')]();};}function saveUpdates(_0x2ff39d,_0x23fb07){return function(_0x488f0e){if(_0x488f0e){return _0x488f0e[_0xcf92('0x34')](_0x2ff39d)[_0xcf92('0x35')](function(_0xb30017){return _0xb30017;});}return null;};}function removeEntity(_0x13ebe4,_0x28d568){return function(_0x2d1a70){if(_0x2d1a70){return _0x2d1a70[_0xcf92('0x36')]()[_0xcf92('0x35')](function(){_0x13ebe4['status'](0xcc)[_0xcf92('0x2d')]();});}};}function handleEntityNotFound(_0x43811d,_0x1d1550){return function(_0x5ce307){if(!_0x5ce307){_0x43811d[_0xcf92('0x2b')](0x194);}return _0x5ce307;};}function handleError(_0xde6585,_0x478a73){_0x478a73=_0x478a73||0x1f4;return function(_0x307d2d){logger[_0xcf92('0x26')](_0x307d2d[_0xcf92('0x37')]);if(_0x307d2d[_0xcf92('0x38')]){delete _0x307d2d[_0xcf92('0x38')];}_0xde6585[_0xcf92('0x2c')](_0x478a73)[_0xcf92('0x39')](_0x307d2d);};}exports[_0xcf92('0x3a')]=function(_0x1aa2bf,_0x575711){var _0x3e8fdc={},_0x1d112f={},_0xe31d96={'count':0x0,'rows':[]};var _0x11e3b4=_['map'](db[_0xcf92('0x3b')][_0xcf92('0x3c')],function(_0x4cc317){return{'name':_0x4cc317[_0xcf92('0x3d')],'type':_0x4cc317[_0xcf92('0x3e')][_0xcf92('0x3f')]};});_0x1d112f['model']=_[_0xcf92('0x40')](_0x11e3b4,_0xcf92('0x38'));_0x1d112f[_0xcf92('0x41')]=_[_0xcf92('0x42')](_0x1aa2bf[_0xcf92('0x41')]);_0x1d112f[_0xcf92('0x43')]=_[_0xcf92('0x44')](_0x1d112f['model'],_0x1d112f[_0xcf92('0x41')]);_0x3e8fdc[_0xcf92('0x45')]=_['intersection'](_0x1d112f[_0xcf92('0x46')],qs['fields'](_0x1aa2bf[_0xcf92('0x41')][_0xcf92('0x47')]));_0x3e8fdc[_0xcf92('0x45')]=_0x3e8fdc[_0xcf92('0x45')][_0xcf92('0x48')]?_0x3e8fdc[_0xcf92('0x45')]:_0x1d112f['model'];if(!_0x1aa2bf[_0xcf92('0x41')][_0xcf92('0x49')](_0xcf92('0x4a'))){_0x3e8fdc['limit']=qs[_0xcf92('0x30')](_0x1aa2bf[_0xcf92('0x41')][_0xcf92('0x30')]);_0x3e8fdc[_0xcf92('0x2e')]=qs[_0xcf92('0x2e')](_0x1aa2bf['query'][_0xcf92('0x2e')]);}_0x3e8fdc[_0xcf92('0x4b')]=qs[_0xcf92('0x4c')](_0x1aa2bf[_0xcf92('0x41')][_0xcf92('0x4c')]);_0x3e8fdc['where']=qs['filters'](_[_0xcf92('0x4d')](_0x1aa2bf[_0xcf92('0x41')],_0x1d112f[_0xcf92('0x43')]),_0x11e3b4);if(_0x1aa2bf['query'][_0xcf92('0x4e')]){_0x3e8fdc['where']=_[_0xcf92('0x4f')](_0x3e8fdc['where'],{'$or':_[_0xcf92('0x40')](_0x11e3b4,function(_0x1f543b){if(_0x1f543b[_0xcf92('0x3e')]!==_0xcf92('0x50')){var _0x3a2189={};_0x3a2189[_0x1f543b[_0xcf92('0x38')]]={'$like':'%'+_0x1aa2bf['query'][_0xcf92('0x4e')]+'%'};return _0x3a2189;}})});}_0x3e8fdc=_[_0xcf92('0x4f')]({},_0x3e8fdc,_0x1aa2bf[_0xcf92('0x51')]);var _0x4aad08={'where':_0x3e8fdc[_0xcf92('0x52')]};return db[_0xcf92('0x3b')][_0xcf92('0x31')](_0x4aad08)[_0xcf92('0x35')](function(_0x5ac9dc){_0xe31d96[_0xcf92('0x31')]=_0x5ac9dc;if(_0x1aa2bf['query'][_0xcf92('0x53')]){_0x3e8fdc[_0xcf92('0x54')]=[{'all':!![]}];}return db[_0xcf92('0x3b')][_0xcf92('0x55')](_0x3e8fdc);})[_0xcf92('0x35')](function(_0x4213f3){_0xe31d96[_0xcf92('0x56')]=_0x4213f3;return _0xe31d96;})[_0xcf92('0x35')](respondWithFilteredResult(_0x575711,_0x3e8fdc))[_0xcf92('0x2a')](handleError(_0x575711,null));};exports[_0xcf92('0x57')]=function(_0x4cf6f9,_0x183486){var _0x3f405f={'raw':!![],'where':{'id':_0x4cf6f9[_0xcf92('0x58')]['id']}},_0x799e86={};_0x799e86[_0xcf92('0x46')]=_[_0xcf92('0x42')](db[_0xcf92('0x3b')][_0xcf92('0x3c')]);_0x799e86[_0xcf92('0x41')]=_['keys'](_0x4cf6f9[_0xcf92('0x41')]);_0x799e86[_0xcf92('0x43')]=_['intersection'](_0x799e86[_0xcf92('0x46')],_0x799e86[_0xcf92('0x41')]);_0x3f405f[_0xcf92('0x45')]=_['intersection'](_0x799e86[_0xcf92('0x46')],qs[_0xcf92('0x47')](_0x4cf6f9[_0xcf92('0x41')][_0xcf92('0x47')]));_0x3f405f[_0xcf92('0x45')]=_0x3f405f['attributes'][_0xcf92('0x48')]?_0x3f405f[_0xcf92('0x45')]:_0x799e86[_0xcf92('0x46')];if(_0x4cf6f9['query'][_0xcf92('0x53')]){_0x3f405f['include']=[{'all':!![]}];}_0x3f405f=_[_0xcf92('0x4f')]({},_0x3f405f,_0x4cf6f9['options']);return db[_0xcf92('0x3b')][_0xcf92('0x59')](_0x3f405f)[_0xcf92('0x35')](handleEntityNotFound(_0x183486,null))[_0xcf92('0x35')](respondWithResult(_0x183486,null))['catch'](handleError(_0x183486,null));};exports[_0xcf92('0x5a')]=function(_0x47492d,_0x443a64){return db['ChatMessage']['create'](_0x47492d['body'],{})[_0xcf92('0x35')](respondWithResult(_0x443a64,0xc9))[_0xcf92('0x2a')](handleError(_0x443a64,null));};exports[_0xcf92('0x34')]=function(_0x3b7f20,_0x530e8b){if(_0x3b7f20[_0xcf92('0x5b')]['id']){delete _0x3b7f20[_0xcf92('0x5b')]['id'];}return db['ChatMessage'][_0xcf92('0x59')]({'where':{'id':_0x3b7f20[_0xcf92('0x58')]['id']}})[_0xcf92('0x35')](handleEntityNotFound(_0x530e8b,null))[_0xcf92('0x35')](saveUpdates(_0x3b7f20['body'],null))[_0xcf92('0x35')](respondWithResult(_0x530e8b,null))[_0xcf92('0x2a')](handleError(_0x530e8b,null));};exports[_0xcf92('0x36')]=function(_0x4e3168,_0x47ed4c){return db[_0xcf92('0x3b')][_0xcf92('0x59')]({'where':{'id':_0x4e3168[_0xcf92('0x58')]['id']}})['then'](handleEntityNotFound(_0x47ed4c,null))[_0xcf92('0x35')](removeEntity(_0x47ed4c,null))['catch'](handleError(_0x47ed4c,null));};exports[_0xcf92('0x5c')]=function(_0x285396,_0x575de0){return db['ChatMessage'][_0xcf92('0x5c')]()[_0xcf92('0x35')](respondWithResult(_0x575de0,null))[_0xcf92('0x2a')](handleError(_0x575de0,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xcf92('0x5d')]=function(_0x164cfc,_0x27718d,_0x14b406){var _0x14873d={'agent':{},'channel':'chat'};if(_0x164cfc[_0xcf92('0x5b')]['id']){delete _0x164cfc[_0xcf92('0x5b')]['id'];}_0x164cfc[_0xcf92('0x5b')][_0xcf92('0x5e')]=!![];_0x164cfc[_0xcf92('0x5b')][_0xcf92('0x5f')]=moment()[_0xcf92('0x60')](_0xcf92('0x61'));_0x164cfc[_0xcf92('0x5b')][_0xcf92('0x62')]=_0x164cfc[_0xcf92('0x5b')][_0xcf92('0x62')]||_0x164cfc[_0xcf92('0x63')]['id'];_0x14873d[_0xcf92('0x64')]['id']=_0x164cfc[_0xcf92('0x5b')][_0xcf92('0x62')];return db['ChatMessage']['find']({'where':{'id':_0x164cfc[_0xcf92('0x58')]['id'],'UserId':null}})[_0xcf92('0x35')](handleEntityNotFound(_0x27718d,null))[_0xcf92('0x35')](saveUpdates(_0x164cfc[_0xcf92('0x5b')],null))['then'](function(_0x3ff512){if(_0x3ff512){_0x14873d[_0xcf92('0x28')]=_0x3ff512['get']({'plain':!![]});return db[_0xcf92('0x65')][_0xcf92('0x59')]({'where':{'id':_0x3ff512[_0xcf92('0x66')]}});}return null;})[_0xcf92('0x35')](handleEntityNotFound(_0x27718d,null))[_0xcf92('0x35')](function(_0x2fbd6d){if(_0x2fbd6d){return _0x2fbd6d['update']({'UserId':_0x164cfc['body']['UserId'],'read1stAt':_['isNil'](_0x2fbd6d[_0xcf92('0x67')])?moment()[_0xcf92('0x60')](_0xcf92('0x61')):undefined});}return null;})[_0xcf92('0x35')](function(_0x269038){if(_0x269038){_0x14873d[_0xcf92('0x68')]=_0x269038[_0xcf92('0x69')]({'plain':!![]});interaction_log[_0xcf92('0x20')](_0xcf92('0x6a'),_0x164cfc[_0xcf92('0x63')]['id'],_0x164cfc[_0xcf92('0x63')]['name'],_0x164cfc[_0xcf92('0x63')][_0xcf92('0x6b')],_0x14873d['interaction']['id'],_0x164cfc[_0xcf92('0x5b')]?JSON['stringify'](_0x164cfc[_0xcf92('0x5b')]):'null');return respondWithRpcPromise(_0xcf92('0x6c'),_0xcf92('0x6d'),_0x14873d);}return null;})[_0xcf92('0x35')](function(_0x46f0e8){var _0x4196e2=_0xcf92('0x6e')+_0x46f0e8['message']['ContactId'];return db[_0xcf92('0x6f')][_0xcf92('0x41')](_0x4196e2,{'type':db[_0xcf92('0x70')][_0xcf92('0x71')][_0xcf92('0x72')],'raw':!![]})['then'](function(_0x43dcc4){return _0x43dcc4;});})[_0xcf92('0x35')](function(_0xde28c4){if(_0xde28c4){_0x14873d[_0xcf92('0x28')][_0xcf92('0x73')]=_0xde28c4[0x0];if(!_0x164cfc[_0xcf92('0x5b')]['UserId'])return;return db[_0xcf92('0x74')][_0xcf92('0x59')]({'where':{'id':_0x164cfc[_0xcf92('0x5b')]['UserId'],'role':_0xcf92('0x64')},'attributes':['id',_0xcf92('0x38'),_0xcf92('0x75'),_0xcf92('0x76'),_0xcf92('0x77')],'raw':!![]});}return null;})[_0xcf92('0x35')](function(_0x282082){if(!_0x282082)return null;_0x14873d[_0xcf92('0x28')][_0xcf92('0x64')]=_0x282082;return _0x14873d;})['then'](function(_0x3fe557){if(_0x3fe557){if(_0x164cfc[_0xcf92('0x5b')][_0xcf92('0x78')]){_0x14873d[_0xcf92('0x28')][_0xcf92('0x79')]=util['format']('SIP/%s',_0x164cfc[_0xcf92('0x63')][_0xcf92('0x38')]);_0x14873d[_0xcf92('0x28')][_0xcf92('0x7a')]=_0x14873d[_0xcf92('0x7a')];_0x14873d['message']['motionChannel']=_0x14873d[_0xcf92('0x7a')];_0x14873d[_0xcf92('0x28')][_0xcf92('0x7b')]=_0xcf92('0x5d');return respondWithRpcPromise('EventManager',_0xcf92('0x7c'),{'event':'acceptmessage','message':_[_0xcf92('0x4f')](_0x14873d['message'],JSON[_0xcf92('0x7d')](_0x14873d[_0xcf92('0x68')][_0xcf92('0x7e')]))},client9002)[_0xcf92('0x35')](function(){return _0x14873d;});}return _0x14873d;}return null;})[_0xcf92('0x35')](respondWithResult(_0x27718d,null))[_0xcf92('0x2a')](handleError(_0x27718d,null));};var interaction_log=require(_0xcf92('0x11'))('chat-interactions');exports['reject']=function(_0x4cde9a,_0x4fd6cc,_0x18912d){var _0x1300b9={'agent':{},'channel':'chat'};if(_0x4cde9a[_0xcf92('0x5b')]['id']){delete _0x4cde9a[_0xcf92('0x5b')]['id'];}_0x4cde9a[_0xcf92('0x5b')]['UserId']=_0x4cde9a[_0xcf92('0x5b')]['UserId']||_0x4cde9a[_0xcf92('0x63')]['id'];_0x1300b9['agent']['id']=_0x4cde9a[_0xcf92('0x5b')]['UserId'];return db[_0xcf92('0x3b')]['find']({'where':{'id':_0x4cde9a[_0xcf92('0x58')]['id'],'UserId':null}})[_0xcf92('0x35')](handleEntityNotFound(_0x4fd6cc,null))[_0xcf92('0x35')](function(_0x37afcd){if(_0x37afcd){_0x1300b9[_0xcf92('0x28')]=_0x37afcd[_0xcf92('0x69')]({'plain':!![]});return db[_0xcf92('0x65')][_0xcf92('0x59')]({'where':{'id':_0x37afcd[_0xcf92('0x66')]}});}return null;})[_0xcf92('0x35')](handleEntityNotFound(_0x4fd6cc,null))[_0xcf92('0x35')](function(_0x136f7d){if(_0x136f7d){_0x1300b9[_0xcf92('0x68')]=_0x136f7d[_0xcf92('0x69')]({'plain':!![]});interaction_log[_0xcf92('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4cde9a[_0xcf92('0x63')]['id'],_0x4cde9a[_0xcf92('0x63')][_0xcf92('0x38')],_0x4cde9a[_0xcf92('0x63')][_0xcf92('0x6b')],_0x1300b9[_0xcf92('0x68')]['id'],_0x4cde9a[_0xcf92('0x5b')]?JSON[_0xcf92('0x25')](_0x4cde9a[_0xcf92('0x5b')]):_0xcf92('0x7f'));return respondWithRpcPromise(_0xcf92('0x80'),_0xcf92('0x81'),_0x1300b9);}return null;})['then'](function(_0x5abe67){var _0x2e34e1=_0xcf92('0x6e')+_0x5abe67[_0xcf92('0x28')][_0xcf92('0x82')];return db[_0xcf92('0x6f')]['query'](_0x2e34e1,{'type':db[_0xcf92('0x70')][_0xcf92('0x71')][_0xcf92('0x72')],'raw':!![]})[_0xcf92('0x35')](function(_0x4a3711){return _0x4a3711;});})[_0xcf92('0x35')](function(_0x11d061){if(_0x11d061){_0x1300b9[_0xcf92('0x28')][_0xcf92('0x73')]=_0x11d061[0x0];if(!_0x4cde9a[_0xcf92('0x5b')]['UserId'])return;return db['User'][_0xcf92('0x59')]({'where':{'id':_0x4cde9a['body'][_0xcf92('0x62')],'role':'agent'},'attributes':['id','name','fullname',_0xcf92('0x76'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4fff6a){if(!_0x4fff6a)return null;_0x1300b9[_0xcf92('0x28')][_0xcf92('0x64')]=_0x4fff6a;return _0x1300b9;})[_0xcf92('0x35')](function(_0x161da3){if(_0x161da3){_0x161da3['message'][_0xcf92('0x79')]=util[_0xcf92('0x60')](_0xcf92('0x83'),_0x4cde9a[_0xcf92('0x63')][_0xcf92('0x38')]);_0x161da3[_0xcf92('0x28')][_0xcf92('0x7a')]=_0x1300b9[_0xcf92('0x7a')];_0x161da3[_0xcf92('0x28')][_0xcf92('0x84')]=_0x1300b9[_0xcf92('0x7a')];_0x161da3['message']['event']=_0xcf92('0x85');respondWithRpcPromise(_0xcf92('0x7c'),_0xcf92('0x7c'),{'event':_0xcf92('0x86'),'message':_['merge'](_0x1300b9[_0xcf92('0x28')],JSON[_0xcf92('0x7d')](_0x1300b9[_0xcf92('0x68')][_0xcf92('0x7e')]))},client9002);return _0x1300b9;}return null;})[_0xcf92('0x35')](respondWithResult(_0x4fd6cc,null))[_0xcf92('0x2a')](handleError(_0x4fd6cc,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index ed49fc9..9f6fd72 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 _0xd0fb=['save','emit','hasOwnProperty','hook','events','../../mysqldb','ChatMessage'];(function(_0x561a36,_0x4226d4){var _0x44353b=function(_0x5308b3){while(--_0x5308b3){_0x561a36['push'](_0x561a36['shift']());}};_0x44353b(++_0x4226d4);}(_0xd0fb,0xf2));var _0xbd0f=function(_0x5266fb,_0x5b4af0){_0x5266fb=_0x5266fb-0x0;var _0x6722a6=_0xd0fb[_0x5266fb];return _0x6722a6;};'use strict';var EventEmitter=require(_0xbd0f('0x0'));var ChatMessage=require(_0xbd0f('0x1'))['db'][_0xbd0f('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbd0f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x449255){return function(_0x68b4d0,_0x16e24e,_0x5a9511){ChatMessageEvents[_0xbd0f('0x4')](_0x449255+':'+_0x68b4d0['id'],_0x68b4d0);ChatMessageEvents['emit'](_0x449255,_0x68b4d0);_0x5a9511(null);};}for(var e in events){if(events[_0xbd0f('0x5')](e)){var event=events[e];ChatMessage[_0xbd0f('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x8337=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','save','update'];(function(_0xc258ac,_0x148417){var _0x4d5e9b=function(_0x4a3c36){while(--_0x4a3c36){_0xc258ac['push'](_0xc258ac['shift']());}};_0x4d5e9b(++_0x148417);}(_0x8337,0x164));var _0x7833=function(_0xc350c4,_0x3d3e2d){_0xc350c4=_0xc350c4-0x0;var _0x48a1b5=_0x8337[_0xc350c4];return _0x48a1b5;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x7833('0x0'))['db'][_0x7833('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7833('0x2'),'afterUpdate':_0x7833('0x3'),'afterDestroy':_0x7833('0x4')};function emitEvent(_0x17cf12){return function(_0x2ba8cb,_0x45d507,_0xcce1cc){ChatMessageEvents[_0x7833('0x5')](_0x17cf12+':'+_0x2ba8cb['id'],_0x2ba8cb);ChatMessageEvents[_0x7833('0x5')](_0x17cf12,_0x2ba8cb);_0xcce1cc(null);};}for(var e in events){if(events[_0x7833('0x6')](e)){var event=events[e];ChatMessage[_0x7833('0x7')](e,emitEvent(event));}}module[_0x7833('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index e777e97..3446d6d 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 _0xb1c2=['bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','utf8mb4','util','../../config/logger','moment'];(function(_0x24ef77,_0x6ba836){var _0x7f7945=function(_0xcdff9c){while(--_0xcdff9c){_0x24ef77['push'](_0x24ef77['shift']());}};_0x7f7945(++_0x6ba836);}(_0xb1c2,0x1ce));var _0x2b1c=function(_0x37862a,_0x2bc98e){_0x37862a=_0x37862a-0x0;var _0x5b0104=_0xb1c2[_0x37862a];return _0x5b0104;};'use strict';var _=require('lodash');var util=require(_0x2b1c('0x0'));var logger=require(_0x2b1c('0x1'))('api');var moment=require(_0x2b1c('0x2'));var BPromise=require(_0x2b1c('0x3'));var rp=require(_0x2b1c('0x4'));var fs=require('fs');var path=require(_0x2b1c('0x5'));var rimraf=require(_0x2b1c('0x6'));var config=require(_0x2b1c('0x7'));var attributes=require(_0x2b1c('0x8'));module[_0x2b1c('0x9')]=function(_0x531473,_0x4dc6dd){return _0x531473[_0x2b1c('0xa')](_0x2b1c('0xb'),attributes,{'tableName':_0x2b1c('0xc'),'paranoid':![],'indexes':[{'name':_0x2b1c('0xd'),'fields':[_0x2b1c('0xe')],'type':_0x2b1c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x430a7f,_0x109c67,_0x5016b1){var _0x26ddcd=_0x531473[_0x2b1c('0x10')];var _0x203538=_0x430a7f[_0x2b1c('0x11')]({'plain':!![]});if(_0x203538[_0x2b1c('0x12')][_0x2b1c('0x13')]()==='in'||_0x203538[_0x2b1c('0x12')]['toLowerCase']()===_0x2b1c('0x14')&&!_0x203538[_0x2b1c('0x15')]&&!_[_0x2b1c('0x16')](_0x203538[_0x2b1c('0x17')])){_0x26ddcd[_0x2b1c('0x18')][_0x2b1c('0x19')]({'where':{'id':_0x203538[_0x2b1c('0x1a')]}})[_0x2b1c('0x1b')](function(_0x4dd521){if(_0x4dd521){_0x4dd521['update']({'lastMsgAt':_0x203538[_0x2b1c('0x1c')],'lastMsgDirection':_0x203538['direction']['toLowerCase']()});}})[_0x2b1c('0x1d')](function(_0x486273){console['error'](_0x486273);});}_0x5016b1();}},'charset':_0x2b1c('0x1e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf51e=['then','update','createdAt','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId'];(function(_0x2d1b29,_0xab7afe){var _0x285792=function(_0x1e4bf4){while(--_0x1e4bf4){_0x2d1b29['push'](_0x2d1b29['shift']());}};_0x285792(++_0xab7afe);}(_0xf51e,0x9a));var _0xef51=function(_0x35358a,_0x49ba11){_0x35358a=_0x35358a-0x0;var _0x2c50e4=_0xf51e[_0x35358a];return _0x2c50e4;};'use strict';var _=require('lodash');var util=require(_0xef51('0x0'));var logger=require(_0xef51('0x1'))(_0xef51('0x2'));var moment=require(_0xef51('0x3'));var BPromise=require(_0xef51('0x4'));var rp=require(_0xef51('0x5'));var fs=require('fs');var path=require(_0xef51('0x6'));var rimraf=require('rimraf');var config=require(_0xef51('0x7'));var attributes=require(_0xef51('0x8'));module[_0xef51('0x9')]=function(_0x1f13f0,_0x4b159f){return _0x1f13f0[_0xef51('0xa')](_0xef51('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xef51('0xc'),'fields':[_0xef51('0xd')],'type':_0xef51('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x371a77,_0x9b44d,_0x5a0922){var _0x18abee=_0x1f13f0[_0xef51('0xf')];var _0x42d01e=_0x371a77[_0xef51('0x10')]({'plain':!![]});if(_0x42d01e[_0xef51('0x11')][_0xef51('0x12')]()==='in'||_0x42d01e['direction']['toLowerCase']()===_0xef51('0x13')&&!_0x42d01e[_0xef51('0x14')]&&!_[_0xef51('0x15')](_0x42d01e[_0xef51('0x16')])){_0x18abee[_0xef51('0x17')][_0xef51('0x18')]({'where':{'id':_0x42d01e[_0xef51('0x19')]}})[_0xef51('0x1a')](function(_0x9efe16){if(_0x9efe16){_0x9efe16[_0xef51('0x1b')]({'lastMsgAt':_0x42d01e[_0xef51('0x1c')],'lastMsgDirection':_0x42d01e[_0xef51('0x11')][_0xef51('0x12')]()});}})['catch'](function(_0x5a10f5){console['error'](_0x5a10f5);});}_0x5a0922();}},'charset':'utf8mb4','collate':_0xef51('0x1d')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index ca40e63..3ad9f71 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 _0xbf07=['socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','CreateChatMessage','ChatMessage','body','options','raw','stringify','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xbf07,0x17a));var _0x7bf0=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0xbf07[_0x4164f2];return _0x2575c7;};'use strict';var _=require(_0x7bf0('0x0'));var util=require('util');var moment=require(_0x7bf0('0x1'));var BPromise=require(_0x7bf0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bf0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bf0('0x4'));var logger=require('../../config/logger')(_0x7bf0('0x5'));var config=require(_0x7bf0('0x6'));var jayson=require(_0x7bf0('0x7'));var client=jayson['client'][_0x7bf0('0x8')]({'port':0x232a});config[_0x7bf0('0x9')]=_[_0x7bf0('0xa')](config[_0x7bf0('0x9')],{'host':_0x7bf0('0xb'),'port':0x18eb});var socket=require(_0x7bf0('0xc'))(new Redis(config[_0x7bf0('0x9')]));require(_0x7bf0('0xd'))[_0x7bf0('0xe')](socket);function respondWithRpcPromise(_0x59cdc1,_0x378337,_0xd7288c){return new BPromise(function(_0x2afd55,_0x450cd0){return client[_0x7bf0('0xf')](_0x59cdc1,_0xd7288c)[_0x7bf0('0x10')](function(_0x11bada){logger[_0x7bf0('0x11')](_0x7bf0('0x12'),_0x378337,'request\x20sent');logger[_0x7bf0('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x378337,_0x7bf0('0x14'),JSON['stringify'](_0x11bada));if(_0x11bada[_0x7bf0('0x15')]){if(_0x11bada[_0x7bf0('0x15')]['code']===0x1f4){logger[_0x7bf0('0x15')]('ChatMessage,\x20%s,\x20%s',_0x378337,_0x11bada[_0x7bf0('0x15')]['message']);return _0x450cd0(_0x11bada[_0x7bf0('0x15')][_0x7bf0('0x16')]);}logger[_0x7bf0('0x15')](_0x7bf0('0x12'),_0x378337,_0x11bada[_0x7bf0('0x15')][_0x7bf0('0x16')]);return _0x2afd55(_0x11bada[_0x7bf0('0x15')][_0x7bf0('0x16')]);}else{logger[_0x7bf0('0x11')](_0x7bf0('0x12'),_0x378337,_0x7bf0('0x14'));_0x2afd55(_0x11bada['result']['message']);}})[_0x7bf0('0x17')](function(_0x713bdc){logger[_0x7bf0('0x15')](_0x7bf0('0x12'),_0x378337,_0x713bdc);_0x450cd0(_0x713bdc);});});}exports[_0x7bf0('0x18')]=function(_0x34475e){var _0x1fe1f3=this;return new Promise(function(_0x1cf2db,_0x1c650f){return db[_0x7bf0('0x19')]['create'](_0x34475e[_0x7bf0('0x1a')],{'raw':_0x34475e['options']?_0x34475e[_0x7bf0('0x1b')][_0x7bf0('0x1c')]===undefined?!![]:![]:!![]})[_0x7bf0('0x10')](function(_0x2278dd){logger[_0x7bf0('0x11')](_0x7bf0('0x18'),_0x34475e);logger[_0x7bf0('0x13')](_0x7bf0('0x18'),_0x34475e,JSON[_0x7bf0('0x1d')](_0x2278dd));_0x1cf2db(_0x2278dd);})[_0x7bf0('0x17')](function(_0x1b3680){logger[_0x7bf0('0x15')](_0x7bf0('0x18'),_0x1b3680[_0x7bf0('0x16')],_0x34475e);_0x1c650f(_0x1fe1f3['error'](0x1f4,_0x1b3680[_0x7bf0('0x16')]));});});}; \ No newline at end of file +var _0x9af9=['code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','bluebird','ioredis','../../config/logger','jayson/promise','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x45a5a3,_0x4bbd82){var _0x5ba07c=function(_0xaedf7f){while(--_0xaedf7f){_0x45a5a3['push'](_0x45a5a3['shift']());}};_0x5ba07c(++_0x4bbd82);}(_0x9af9,0x7a));var _0x99af=function(_0x49bdd6,_0x217dec){_0x49bdd6=_0x49bdd6-0x0;var _0x19079d=_0x9af9[_0x49bdd6];return _0x19079d;};'use strict';var _=require(_0x99af('0x0'));var util=require(_0x99af('0x1'));var moment=require('moment');var BPromise=require(_0x99af('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99af('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x99af('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x99af('0x5'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x99af('0x6')](config['redis'],{'host':_0x99af('0x7'),'port':0x18eb});var socket=require(_0x99af('0x8'))(new Redis(config[_0x99af('0x9')]));require(_0x99af('0xa'))[_0x99af('0xb')](socket);function respondWithRpcPromise(_0x1cbf0f,_0x39f486,_0x2b0bd6){return new BPromise(function(_0x2c1e12,_0x256865){return client['request'](_0x1cbf0f,_0x2b0bd6)[_0x99af('0xc')](function(_0x1dd9a9){logger[_0x99af('0xd')](_0x99af('0xe'),_0x39f486,_0x99af('0xf'));logger[_0x99af('0x10')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x39f486,'request\x20sent',JSON['stringify'](_0x1dd9a9));if(_0x1dd9a9['error']){if(_0x1dd9a9[_0x99af('0x11')][_0x99af('0x12')]===0x1f4){logger[_0x99af('0x11')](_0x99af('0xe'),_0x39f486,_0x1dd9a9[_0x99af('0x11')]['message']);return _0x256865(_0x1dd9a9[_0x99af('0x11')][_0x99af('0x13')]);}logger[_0x99af('0x11')](_0x99af('0xe'),_0x39f486,_0x1dd9a9[_0x99af('0x11')]['message']);return _0x2c1e12(_0x1dd9a9[_0x99af('0x11')][_0x99af('0x13')]);}else{logger[_0x99af('0xd')](_0x99af('0xe'),_0x39f486,_0x99af('0xf'));_0x2c1e12(_0x1dd9a9[_0x99af('0x14')][_0x99af('0x13')]);}})[_0x99af('0x15')](function(_0x4dae2b){logger['error'](_0x99af('0xe'),_0x39f486,_0x4dae2b);_0x256865(_0x4dae2b);});});}exports[_0x99af('0x16')]=function(_0x2d2928){var _0x1b0899=this;return new Promise(function(_0x3af828,_0x4df1fe){return db[_0x99af('0x17')][_0x99af('0x18')](_0x2d2928[_0x99af('0x19')],{'raw':_0x2d2928['options']?_0x2d2928[_0x99af('0x1a')][_0x99af('0x1b')]===undefined?!![]:![]:!![]})[_0x99af('0xc')](function(_0x3fcfbe){logger[_0x99af('0xd')]('CreateChatMessage',_0x2d2928);logger[_0x99af('0x10')](_0x99af('0x16'),_0x2d2928,JSON['stringify'](_0x3fcfbe));_0x3af828(_0x3fcfbe);})[_0x99af('0x15')](function(_0x573e51){logger[_0x99af('0x11')](_0x99af('0x16'),_0x573e51[_0x99af('0x13')],_0x2d2928);_0x4df1fe(_0x1b0899['error'](0x1f4,_0x573e51[_0x99af('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 3d7a597..8a992b6 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 _0x34aa=['update','emit','removeListener','register','length','./chatMessage.events','remove'];(function(_0x347c9c,_0x1de684){var _0x17f605=function(_0x46575d){while(--_0x46575d){_0x347c9c['push'](_0x347c9c['shift']());}};_0x17f605(++_0x1de684);}(_0x34aa,0x171));var _0xa34a=function(_0x42bb6d,_0x412255){_0x42bb6d=_0x42bb6d-0x0;var _0x1db89b=_0x34aa[_0x42bb6d];return _0x1db89b;};'use strict';var ChatMessageEvents=require(_0xa34a('0x0'));var events=['save',_0xa34a('0x1'),_0xa34a('0x2')];function createListener(_0xbb3857,_0x1fc924){return function(_0x496e55){_0x1fc924[_0xa34a('0x3')](_0xbb3857,_0x496e55);};}function removeListener(_0x30f3a2,_0x284561){return function(){ChatMessageEvents[_0xa34a('0x4')](_0x30f3a2,_0x284561);};}exports[_0xa34a('0x5')]=function(_0x475f8f){for(var _0x27349c=0x0,_0x43f9ea=events[_0xa34a('0x6')];_0x27349c<_0x43f9ea;_0x27349c++){var _0x45f2b4=events[_0x27349c];var _0x467864=createListener('chatMessage:'+_0x45f2b4,_0x475f8f);ChatMessageEvents['on'](_0x45f2b4,_0x467864);}}; \ No newline at end of file +var _0xdd0c=['save','remove','update','emit','removeListener','register','length'];(function(_0x2a83cb,_0x41bc82){var _0x140f0a=function(_0xc642dd){while(--_0xc642dd){_0x2a83cb['push'](_0x2a83cb['shift']());}};_0x140f0a(++_0x41bc82);}(_0xdd0c,0x165));var _0xcdd0=function(_0x145111,_0x2742cc){_0x145111=_0x145111-0x0;var _0x38b69e=_0xdd0c[_0x145111];return _0x38b69e;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xcdd0('0x0'),_0xcdd0('0x1'),_0xcdd0('0x2')];function createListener(_0x5e3ada,_0xe8ed9){return function(_0x5b86cb){_0xe8ed9[_0xcdd0('0x3')](_0x5e3ada,_0x5b86cb);};}function removeListener(_0x159e38,_0x432716){return function(){ChatMessageEvents[_0xcdd0('0x4')](_0x159e38,_0x432716);};}exports[_0xcdd0('0x5')]=function(_0x5ae472){for(var _0x2b33fc=0x0,_0x1b6f5d=events[_0xcdd0('0x6')];_0x2b33fc<_0x1b6f5d;_0x2b33fc++){var _0x15c402=events[_0x2b33fc];var _0x337496=createListener('chatMessage:'+_0x15c402,_0x5ae472);ChatMessageEvents['on'](_0x15c402,_0x337496);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index f98c7f0..6ac9849 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 _0x5627=['put','/:id/accept','accept','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','/describe','isAuthenticated','/:id','post','chat','chatmessage:create','create','update'];(function(_0x4c7b63,_0x121f0d){var _0x5c9f8b=function(_0x4d2f3e){while(--_0x4d2f3e){_0x4c7b63['push'](_0x4c7b63['shift']());}};_0x5c9f8b(++_0x121f0d);}(_0x5627,0x6a));var _0x7562=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5627[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x7562('0x0'));var util=require(_0x7562('0x1'));var path=require(_0x7562('0x2'));var timeout=require(_0x7562('0x3'));var express=require(_0x7562('0x4'));var router=express[_0x7562('0x5')]();var fs_extra=require(_0x7562('0x6'));var auth=require(_0x7562('0x7'));var interaction=require(_0x7562('0x8'));var config=require('../../config/environment');var controller=require(_0x7562('0x9'));router[_0x7562('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7562('0xa')](_0x7562('0xb'),auth[_0x7562('0xc')](),controller['describe']);router[_0x7562('0xa')](_0x7562('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x7562('0xe')]('/',auth[_0x7562('0xc')](),interaction['tracked'](_0x7562('0xf'),_0x7562('0x10')),controller[_0x7562('0x11')]);router['put']('/:id',controller[_0x7562('0x12')]);router[_0x7562('0x13')](_0x7562('0x14'),auth[_0x7562('0xc')](),controller[_0x7562('0x15')]);router[_0x7562('0x13')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x7562('0x16')](_0x7562('0xd'),auth['isAuthenticated'](),controller[_0x7562('0x17')]);module[_0x7562('0x18')]=router; \ No newline at end of file +var _0xfebd=['index','get','/describe','describe','/:id','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./chatMessage.controller','isAuthenticated'];(function(_0x464360,_0x35ee85){var _0x40223b=function(_0x52a41b){while(--_0x52a41b){_0x464360['push'](_0x464360['shift']());}};_0x40223b(++_0x35ee85);}(_0xfebd,0x99));var _0xdfeb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfebd[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xdfeb('0x0'));var util=require(_0xdfeb('0x1'));var path=require(_0xdfeb('0x2'));var timeout=require('connect-timeout');var express=require(_0xdfeb('0x3'));var router=express[_0xdfeb('0x4')]();var fs_extra=require(_0xdfeb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdfeb('0x6'));var config=require('../../config/environment');var controller=require(_0xdfeb('0x7'));router['get']('/',auth[_0xdfeb('0x8')](),controller[_0xdfeb('0x9')]);router[_0xdfeb('0xa')](_0xdfeb('0xb'),auth[_0xdfeb('0x8')](),controller[_0xdfeb('0xc')]);router[_0xdfeb('0xa')](_0xdfeb('0xd'),auth[_0xdfeb('0x8')](),controller['show']);router[_0xdfeb('0xe')]('/',auth[_0xdfeb('0x8')](),interaction[_0xdfeb('0xf')](_0xdfeb('0x10'),_0xdfeb('0x11')),controller[_0xdfeb('0x12')]);router[_0xdfeb('0x13')](_0xdfeb('0xd'),controller[_0xdfeb('0x14')]);router[_0xdfeb('0x13')](_0xdfeb('0x15'),auth['isAuthenticated'](),controller[_0xdfeb('0x16')]);router[_0xdfeb('0x13')](_0xdfeb('0x17'),auth['isAuthenticated'](),controller[_0xdfeb('0x18')]);router[_0xdfeb('0x19')](_0xdfeb('0xd'),auth[_0xdfeb('0x8')](),controller[_0xdfeb('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 84016c9..c5d43fd 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 _0x757a=['exports','TEXT'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x757a,0xde));var _0xa757=function(_0x2cbd26,_0x436187){_0x2cbd26=_0x2cbd26-0x0;var _0x2ccf6f=_0x757a[_0x2cbd26];return _0x2ccf6f;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x5f66=['medium','TEXT','exports'];(function(_0x54457f,_0x2847ea){var _0x58e2aa=function(_0x56502a){while(--_0x56502a){_0x54457f['push'](_0x54457f['shift']());}};_0x58e2aa(++_0x2847ea);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 788e185..41b97c1 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x7a54,0x106));var _0x47a5=function(_0x52a38e,_0x1bd592){_0x52a38e=_0x52a38e-0x0;var _0x5700e7=_0x7a54[_0x52a38e];return _0x5700e7;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5ca0e6,_0x2a6319){var _0x4e7b11=function(_0x575823){while(--_0x575823){_0x5ca0e6['push'](_0x5ca0e6['shift']());}};_0x4e7b11(++_0x2a6319);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){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 0b25f77..0d61b2f 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 _0x7b92=['events','ChatOfflineMessage','setMaxListeners','remove','emit','hasOwnProperty','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7b92,0x1e3));var _0x27b9=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0x7b92[_0xce6f11];return _0x35b709;};'use strict';var EventEmitter=require(_0x27b9('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x27b9('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x27b9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x27b9('0x3')};function emitEvent(_0x4e0521){return function(_0x4927e6,_0x1a09ed,_0x3ef9d8){ChatOfflineMessageEvents['emit'](_0x4e0521+':'+_0x4927e6['id'],_0x4927e6);ChatOfflineMessageEvents[_0x27b9('0x4')](_0x4e0521,_0x4927e6);_0x3ef9d8(null);};}for(var e in events){if(events[_0x27b9('0x5')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x27b9('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x6af6=['emit','hasOwnProperty','hook','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove'];(function(_0x3477bd,_0x375c25){var _0x162c05=function(_0x2a7dd3){while(--_0x2a7dd3){_0x3477bd['push'](_0x3477bd['shift']());}};_0x162c05(++_0x375c25);}(_0x6af6,0x1ce));var _0x66af=function(_0x49d6cf,_0x402000){_0x49d6cf=_0x49d6cf-0x0;var _0x56242a=_0x6af6[_0x49d6cf];return _0x56242a;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x66af('0x0'))['db'][_0x66af('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x66af('0x2')](0x0);var events={'afterCreate':_0x66af('0x3'),'afterUpdate':_0x66af('0x4'),'afterDestroy':_0x66af('0x5')};function emitEvent(_0x5a53a1){return function(_0x3a5b1e,_0x15563d,_0x5f23c9){ChatOfflineMessageEvents['emit'](_0x5a53a1+':'+_0x3a5b1e['id'],_0x3a5b1e);ChatOfflineMessageEvents[_0x66af('0x6')](_0x5a53a1,_0x3a5b1e);_0x5f23c9(null);};}for(var e in events){if(events[_0x66af('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x66af('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 85e33cd..c3a5f16 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 _0x1520=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x44ad4e,_0x2fb054){var _0x17c695=function(_0xc38e15){while(--_0xc38e15){_0x44ad4e['push'](_0x44ad4e['shift']());}};_0x17c695(++_0x2fb054);}(_0x1520,0xaa));var _0x0152=function(_0x38e9a0,_0xed3405){_0x38e9a0=_0x38e9a0-0x0;var _0x5c4f27=_0x1520[_0x38e9a0];return _0x5c4f27;};'use strict';var attributes=require(_0x0152('0x0'));module[_0x0152('0x1')]=function(_0x39d6ec){return _0x39d6ec[_0x0152('0x2')](_0x0152('0x3'),attributes,{'tableName':_0x0152('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0152('0x5'),'collate':_0x0152('0x6')});}; \ No newline at end of file +var _0x50db=['./chatOfflineMessage.attributes','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4bf153,_0x1b34af){var _0x18cb8c=function(_0x6b773b){while(--_0x6b773b){_0x4bf153['push'](_0x4bf153['shift']());}};_0x18cb8c(++_0x1b34af);}(_0x50db,0x19c));var _0xb50d=function(_0x2453a5,_0x14e51e){_0x2453a5=_0x2453a5-0x0;var _0x4bc425=_0x50db[_0x2453a5];return _0x4bc425;};'use strict';var attributes=require(_0xb50d('0x0'));module['exports']=function(_0x595716){return _0x595716['define']('ChatOfflineMessage',attributes,{'tableName':_0xb50d('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb50d('0x2'),'collate':_0xb50d('0x3')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index f808ce4..d86dcb3 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 _0x920e=['request','then','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x2531f7,_0x746c05){var _0x2ee3b6=function(_0x3ed856){while(--_0x3ed856){_0x2531f7['push'](_0x2531f7['shift']());}};_0x2ee3b6(++_0x746c05);}(_0x920e,0xc7));var _0xe920=function(_0x24ebb3,_0x158ba6){_0x24ebb3=_0x24ebb3-0x0;var _0x5f48ba=_0x920e[_0x24ebb3];return _0x5f48ba;};'use strict';var _=require('lodash');var util=require(_0xe920('0x0'));var moment=require(_0xe920('0x1'));var BPromise=require(_0xe920('0x2'));var rs=require(_0xe920('0x3'));var fs=require('fs');var Redis=require(_0xe920('0x4'));var db=require(_0xe920('0x5'))['db'];var utils=require(_0xe920('0x6'));var logger=require(_0xe920('0x7'))('rpc');var config=require(_0xe920('0x8'));var jayson=require(_0xe920('0x9'));var client=jayson['client'][_0xe920('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x100438,_0x427118,_0x2ca58d){return new BPromise(function(_0x56a01d,_0x451d1f){return client[_0xe920('0xb')](_0x100438,_0x2ca58d)[_0xe920('0xc')](function(_0xa49478){logger[_0xe920('0xd')](_0xe920('0xe'),_0x427118,'request\x20sent');logger['debug'](_0xe920('0xf'),_0x427118,_0xe920('0x10'),JSON['stringify'](_0xa49478));if(_0xa49478[_0xe920('0x11')]){if(_0xa49478['error'][_0xe920('0x12')]===0x1f4){logger[_0xe920('0x11')](_0xe920('0xe'),_0x427118,_0xa49478[_0xe920('0x11')]['message']);return _0x451d1f(_0xa49478['error'][_0xe920('0x13')]);}logger[_0xe920('0x11')](_0xe920('0xe'),_0x427118,_0xa49478[_0xe920('0x11')][_0xe920('0x13')]);return _0x56a01d(_0xa49478[_0xe920('0x11')][_0xe920('0x13')]);}else{logger[_0xe920('0xd')](_0xe920('0xe'),_0x427118,_0xe920('0x10'));_0x56a01d(_0xa49478[_0xe920('0x14')][_0xe920('0x13')]);}})['catch'](function(_0x34ee96){logger[_0xe920('0x11')](_0xe920('0xe'),_0x427118,_0x34ee96);_0x451d1f(_0x34ee96);});});} \ No newline at end of file +var _0xb63f=['request\x20sent','debug','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3f1fff,_0x2fcc2c){var _0x3708b0=function(_0x243f85){while(--_0x243f85){_0x3f1fff['push'](_0x3f1fff['shift']());}};_0x3708b0(++_0x2fcc2c);}(_0xb63f,0x193));var _0xfb63=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0xb63f[_0x10791d];return _0x1b4f9c;};'use strict';var _=require(_0xfb63('0x0'));var util=require(_0xfb63('0x1'));var moment=require('moment');var BPromise=require(_0xfb63('0x2'));var rs=require(_0xfb63('0x3'));var fs=require('fs');var Redis=require(_0xfb63('0x4'));var db=require(_0xfb63('0x5'))['db'];var utils=require(_0xfb63('0x6'));var logger=require(_0xfb63('0x7'))('rpc');var config=require(_0xfb63('0x8'));var jayson=require(_0xfb63('0x9'));var client=jayson[_0xfb63('0xa')][_0xfb63('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3717b3,_0x3da7b5,_0x137236){return new BPromise(function(_0xb94f21,_0x42e901){return client[_0xfb63('0xc')](_0x3717b3,_0x137236)[_0xfb63('0xd')](function(_0x1507ab){logger[_0xfb63('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3da7b5,_0xfb63('0xf'));logger[_0xfb63('0x10')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x3da7b5,_0xfb63('0xf'),JSON['stringify'](_0x1507ab));if(_0x1507ab[_0xfb63('0x11')]){if(_0x1507ab['error'][_0xfb63('0x12')]===0x1f4){logger[_0xfb63('0x11')](_0xfb63('0x13'),_0x3da7b5,_0x1507ab['error'][_0xfb63('0x14')]);return _0x42e901(_0x1507ab[_0xfb63('0x11')][_0xfb63('0x14')]);}logger[_0xfb63('0x11')](_0xfb63('0x13'),_0x3da7b5,_0x1507ab[_0xfb63('0x11')]['message']);return _0xb94f21(_0x1507ab[_0xfb63('0x11')]['message']);}else{logger[_0xfb63('0xe')](_0xfb63('0x13'),_0x3da7b5,_0xfb63('0xf'));_0xb94f21(_0x1507ab['result'][_0xfb63('0x14')]);}})[_0xfb63('0x15')](function(_0x562bec){logger[_0xfb63('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3da7b5,_0x562bec);_0x42e901(_0x562bec);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 528f9eb..9bf1d37 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 _0x7136=['/describe','describe','/:id','isAuthenticated','show','post','create','update','delete','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index'];(function(_0x140776,_0x49f0dd){var _0x1da67b=function(_0xbe16dd){while(--_0xbe16dd){_0x140776['push'](_0x140776['shift']());}};_0x1da67b(++_0x49f0dd);}(_0x7136,0x113));var _0x6713=function(_0x121f61,_0x5174fc){_0x121f61=_0x121f61-0x0;var _0x393306=_0x7136[_0x121f61];return _0x393306;};'use strict';var multer=require('multer');var util=require(_0x6713('0x0'));var path=require(_0x6713('0x1'));var timeout=require(_0x6713('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6713('0x3'));var auth=require(_0x6713('0x4'));var interaction=require(_0x6713('0x5'));var config=require(_0x6713('0x6'));var controller=require(_0x6713('0x7'));router[_0x6713('0x8')]('/',auth['isAuthenticated'](),controller[_0x6713('0x9')]);router['get'](_0x6713('0xa'),auth['isAuthenticated'](),controller[_0x6713('0xb')]);router['get'](_0x6713('0xc'),auth[_0x6713('0xd')](),controller[_0x6713('0xe')]);router[_0x6713('0xf')]('/',auth[_0x6713('0xd')](),controller[_0x6713('0x10')]);router['put'](_0x6713('0xc'),auth[_0x6713('0xd')](),controller[_0x6713('0x11')]);router[_0x6713('0x12')](_0x6713('0xc'),auth[_0x6713('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x38f8=['Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xd79d06,_0x758dc0){var _0x55375d=function(_0xae2aee){while(--_0xae2aee){_0xd79d06['push'](_0xd79d06['shift']());}};_0x55375d(++_0x758dc0);}(_0x38f8,0x164));var _0x838f=function(_0xccde3c,_0x3b962c){_0xccde3c=_0xccde3c-0x0;var _0x1a3ed5=_0x38f8[_0xccde3c];return _0x1a3ed5;};'use strict';var multer=require(_0x838f('0x0'));var util=require(_0x838f('0x1'));var path=require(_0x838f('0x2'));var timeout=require(_0x838f('0x3'));var express=require(_0x838f('0x4'));var router=express[_0x838f('0x5')]();var fs_extra=require(_0x838f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x838f('0x7'));var config=require(_0x838f('0x8'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x838f('0x9')](),controller[_0x838f('0xa')]);router[_0x838f('0xb')](_0x838f('0xc'),auth[_0x838f('0x9')](),controller['describe']);router[_0x838f('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x838f('0xd')]('/',auth['isAuthenticated'](),controller[_0x838f('0xe')]);router[_0x838f('0xf')](_0x838f('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x838f('0x10'),auth['isAuthenticated'](),controller[_0x838f('0x11')]);module[_0x838f('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index e1ab15b..6837677 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 _0x6437=['INTEGER','sequelize','STRING','ENUM','mouseOver','timeout'];(function(_0x3c50cf,_0x98e708){var _0x10214a=function(_0x530aac){while(--_0x530aac){_0x3c50cf['push'](_0x3c50cf['shift']());}};_0x10214a(++_0x98e708);}(_0x6437,0x19f));var _0x7643=function(_0x77a1ff,_0xab2cbd){_0x77a1ff=_0x77a1ff-0x0;var _0x51c44f=_0x6437[_0x77a1ff];return _0x51c44f;};'use strict';var Sequelize=require(_0x7643('0x0'));module['exports']={'name':{'type':Sequelize[_0x7643('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7643('0x2')](_0x7643('0x3'),_0x7643('0x4')),'defaultValue':_0x7643('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7643('0x5')]}}; \ No newline at end of file +var _0x5ea9=['mouseOver','STRING','ENUM'];(function(_0x2af268,_0x39cec3){var _0x2e2a01=function(_0x303a9b){while(--_0x303a9b){_0x2af268['push'](_0x2af268['shift']());}};_0x2e2a01(++_0x39cec3);}(_0x5ea9,0x1cd));var _0x95ea=function(_0x266df3,_0x310f44){_0x266df3=_0x266df3-0x0;var _0x36684b=_0x5ea9[_0x266df3];return _0x36684b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x95ea('0x0')](_0x95ea('0x1'),'timeout'),'defaultValue':_0x95ea('0x1')},'selector':{'type':Sequelize[_0x95ea('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 818f139..1d405aa 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 _0x7a08=['jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','error','stack','name','send','show','params','keys','ChatProactiveAction','query','intersection','model','attributes','fields','length','includeAll','include','find','catch','create','body','update','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0xdf1858,_0x5692d0){var _0x3e64f0=function(_0x6a8e44){while(--_0x6a8e44){_0xdf1858['push'](_0xdf1858['shift']());}};_0x3e64f0(++_0x5692d0);}(_0x7a08,0x11e));var _0x87a0=function(_0x57ee1d,_0x54111b){_0x57ee1d=_0x57ee1d-0x0;var _0x12a933=_0x7a08[_0x57ee1d];return _0x12a933;};'use strict';var emlformat=require(_0x87a0('0x0'));var rimraf=require(_0x87a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x87a0('0x2'));var moment=require(_0x87a0('0x3'));var BPromise=require(_0x87a0('0x4'));var Mustache=require(_0x87a0('0x5'));var util=require(_0x87a0('0x6'));var path=require(_0x87a0('0x7'));var sox=require(_0x87a0('0x8'));var csv=require(_0x87a0('0x9'));var ejs=require(_0x87a0('0xa'));var fs=require('fs');var fs_extra=require(_0x87a0('0xb'));var _=require(_0x87a0('0xc'));var squel=require('squel');var crypto=require(_0x87a0('0xd'));var jsforce=require(_0x87a0('0xe'));var deskjs=require(_0x87a0('0xf'));var toCsv=require(_0x87a0('0x9'));var querystring=require(_0x87a0('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x87a0('0x11'));var qs=require(_0x87a0('0x12'));var as=require(_0x87a0('0x13'));var hardwareService=require(_0x87a0('0x14'));var logger=require(_0x87a0('0x15'))('api');var utils=require(_0x87a0('0x16'));var config=require(_0x87a0('0x17'));var licenseUtil=require(_0x87a0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54cdf,_0x2bd845){_0x2bd845=_0x2bd845||0xcc;return function(_0x12e8c7){if(_0x12e8c7){return _0x54cdf[_0x87a0('0x19')](_0x2bd845);}return _0x54cdf['status'](_0x2bd845)[_0x87a0('0x1a')]();};}function respondWithResult(_0x288747,_0x290a29){_0x290a29=_0x290a29||0xc8;return function(_0x583bdd){if(_0x583bdd){return _0x288747[_0x87a0('0x1b')](_0x290a29)[_0x87a0('0x1c')](_0x583bdd);}};}function respondWithFilteredResult(_0x3f69f3,_0x35f9a8){return function(_0x4acba8){if(_0x4acba8){var _0x394291=typeof _0x35f9a8['offset']===_0x87a0('0x1d')&&typeof _0x35f9a8[_0x87a0('0x1e')]===_0x87a0('0x1d');var _0x26a72e=_0x4acba8[_0x87a0('0x1f')];var _0x4f695b=_0x394291?0x0:_0x35f9a8[_0x87a0('0x20')];var _0x57bf72=_0x394291?_0x4acba8['count']:_0x35f9a8[_0x87a0('0x20')]+_0x35f9a8[_0x87a0('0x1e')];var _0x2a42ea;if(_0x57bf72>=_0x26a72e){_0x57bf72=_0x26a72e;_0x2a42ea=0xc8;}else{_0x2a42ea=0xce;}_0x3f69f3['status'](_0x2a42ea);return _0x3f69f3[_0x87a0('0x21')]('Content-Range',_0x4f695b+'-'+_0x57bf72+'/'+_0x26a72e)['json'](_0x4acba8);}return null;};}function patchUpdates(_0x1c3b20){return function(_0x237192){try{jsonpatch[_0x87a0('0x22')](_0x237192,_0x1c3b20,!![]);}catch(_0x390bb2){return BPromise[_0x87a0('0x23')](_0x390bb2);}return _0x237192[_0x87a0('0x24')]();};}function saveUpdates(_0x59e839,_0x25ed19){return function(_0x1f59f7){if(_0x1f59f7){return _0x1f59f7['update'](_0x59e839)[_0x87a0('0x25')](function(_0x1cd50c){return _0x1cd50c;});}return null;};}function removeEntity(_0x48dfe2,_0x373507){return function(_0x4fb8d8){if(_0x4fb8d8){return _0x4fb8d8[_0x87a0('0x26')]()[_0x87a0('0x25')](function(){_0x48dfe2[_0x87a0('0x1b')](0xcc)[_0x87a0('0x1a')]();});}};}function handleEntityNotFound(_0x3bb9c0,_0x3f282d){return function(_0x3ae0c0){if(!_0x3ae0c0){_0x3bb9c0[_0x87a0('0x19')](0x194);}return _0x3ae0c0;};}function handleError(_0xae4ee9,_0x3c0a46){_0x3c0a46=_0x3c0a46||0x1f4;return function(_0x51313f){logger[_0x87a0('0x27')](_0x51313f[_0x87a0('0x28')]);if(_0x51313f[_0x87a0('0x29')]){delete _0x51313f[_0x87a0('0x29')];}_0xae4ee9[_0x87a0('0x1b')](_0x3c0a46)[_0x87a0('0x2a')](_0x51313f);};}exports[_0x87a0('0x2b')]=function(_0x55dbf7,_0x27ce99){var _0x24f8c0={'raw':!![],'where':{'id':_0x55dbf7[_0x87a0('0x2c')]['id']}},_0x712a00={};_0x712a00['model']=_[_0x87a0('0x2d')](db[_0x87a0('0x2e')]['rawAttributes']);_0x712a00[_0x87a0('0x2f')]=_[_0x87a0('0x2d')](_0x55dbf7[_0x87a0('0x2f')]);_0x712a00['filters']=_[_0x87a0('0x30')](_0x712a00[_0x87a0('0x31')],_0x712a00[_0x87a0('0x2f')]);_0x24f8c0[_0x87a0('0x32')]=_[_0x87a0('0x30')](_0x712a00['model'],qs[_0x87a0('0x33')](_0x55dbf7[_0x87a0('0x2f')][_0x87a0('0x33')]));_0x24f8c0[_0x87a0('0x32')]=_0x24f8c0[_0x87a0('0x32')][_0x87a0('0x34')]?_0x24f8c0[_0x87a0('0x32')]:_0x712a00[_0x87a0('0x31')];if(_0x55dbf7['query'][_0x87a0('0x35')]){_0x24f8c0[_0x87a0('0x36')]=[{'all':!![]}];}_0x24f8c0=_['merge']({},_0x24f8c0,_0x55dbf7['options']);return db['ChatProactiveAction'][_0x87a0('0x37')](_0x24f8c0)[_0x87a0('0x25')](handleEntityNotFound(_0x27ce99,null))['then'](respondWithResult(_0x27ce99,null))[_0x87a0('0x38')](handleError(_0x27ce99,null));};exports[_0x87a0('0x39')]=function(_0x105250,_0x1fbc53){return db[_0x87a0('0x2e')][_0x87a0('0x39')](_0x105250[_0x87a0('0x3a')],{})[_0x87a0('0x25')](respondWithResult(_0x1fbc53,0xc9))[_0x87a0('0x38')](handleError(_0x1fbc53,null));};exports[_0x87a0('0x3b')]=function(_0x166dec,_0x581b11){if(_0x166dec[_0x87a0('0x3a')]['id']){delete _0x166dec[_0x87a0('0x3a')]['id'];}return db[_0x87a0('0x2e')][_0x87a0('0x37')]({'where':{'id':_0x166dec[_0x87a0('0x2c')]['id']}})[_0x87a0('0x25')](handleEntityNotFound(_0x581b11,null))[_0x87a0('0x25')](saveUpdates(_0x166dec[_0x87a0('0x3a')],null))[_0x87a0('0x25')](respondWithResult(_0x581b11,null))[_0x87a0('0x38')](handleError(_0x581b11,null));};exports[_0x87a0('0x26')]=function(_0x181345,_0x1f11d1){return db['ChatProactiveAction'][_0x87a0('0x37')]({'where':{'id':_0x181345[_0x87a0('0x2c')]['id']}})[_0x87a0('0x25')](handleEntityNotFound(_0x1f11d1,null))[_0x87a0('0x25')](removeEntity(_0x1f11d1,null))['catch'](handleError(_0x1f11d1,null));}; \ No newline at end of file +var _0x2208=['lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','catch','create','body','find','destroy','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x2208,0x11e));var _0x8220=function(_0x29ae84,_0x2a26e0){_0x29ae84=_0x29ae84-0x0;var _0x526794=_0x2208[_0x29ae84];return _0x526794;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8220('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8220('0x1'));var rp=require('request-promise');var moment=require(_0x8220('0x2'));var BPromise=require(_0x8220('0x3'));var Mustache=require(_0x8220('0x4'));var util=require(_0x8220('0x5'));var path=require(_0x8220('0x6'));var sox=require(_0x8220('0x7'));var csv=require('to-csv');var ejs=require(_0x8220('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8220('0x9'));var squel=require(_0x8220('0xa'));var crypto=require(_0x8220('0xb'));var jsforce=require(_0x8220('0xc'));var deskjs=require(_0x8220('0xd'));var toCsv=require(_0x8220('0xe'));var querystring=require('querystring');var Papa=require(_0x8220('0xf'));var Redis=require(_0x8220('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8220('0x11'));var as=require(_0x8220('0x12'));var hardwareService=require(_0x8220('0x13'));var logger=require(_0x8220('0x14'))(_0x8220('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8220('0x16'));var db=require(_0x8220('0x17'))['db'];function respondWithStatusCode(_0x37f444,_0xae543b){_0xae543b=_0xae543b||0xcc;return function(_0x1aed01){if(_0x1aed01){return _0x37f444[_0x8220('0x18')](_0xae543b);}return _0x37f444[_0x8220('0x19')](_0xae543b)[_0x8220('0x1a')]();};}function respondWithResult(_0x241c30,_0x5b19d4){_0x5b19d4=_0x5b19d4||0xc8;return function(_0x81c6de){if(_0x81c6de){return _0x241c30[_0x8220('0x19')](_0x5b19d4)[_0x8220('0x1b')](_0x81c6de);}};}function respondWithFilteredResult(_0x4c8182,_0x594df9){return function(_0x2408e2){if(_0x2408e2){var _0x1fb3d1=typeof _0x594df9[_0x8220('0x1c')]===_0x8220('0x1d')&&typeof _0x594df9[_0x8220('0x1e')]===_0x8220('0x1d');var _0x2a5124=_0x2408e2[_0x8220('0x1f')];var _0x3fe87d=_0x1fb3d1?0x0:_0x594df9['offset'];var _0x7fd695=_0x1fb3d1?_0x2408e2[_0x8220('0x1f')]:_0x594df9['offset']+_0x594df9[_0x8220('0x1e')];var _0x49f5d4;if(_0x7fd695>=_0x2a5124){_0x7fd695=_0x2a5124;_0x49f5d4=0xc8;}else{_0x49f5d4=0xce;}_0x4c8182['status'](_0x49f5d4);return _0x4c8182[_0x8220('0x20')]('Content-Range',_0x3fe87d+'-'+_0x7fd695+'/'+_0x2a5124)[_0x8220('0x1b')](_0x2408e2);}return null;};}function patchUpdates(_0x1bac0c){return function(_0x3886b4){try{jsonpatch[_0x8220('0x21')](_0x3886b4,_0x1bac0c,!![]);}catch(_0x9ef529){return BPromise['reject'](_0x9ef529);}return _0x3886b4['save']();};}function saveUpdates(_0x8efe59,_0x21dd97){return function(_0x15988d){if(_0x15988d){return _0x15988d[_0x8220('0x22')](_0x8efe59)[_0x8220('0x23')](function(_0x2c4183){return _0x2c4183;});}return null;};}function removeEntity(_0x22e848,_0x561c5f){return function(_0x382ece){if(_0x382ece){return _0x382ece['destroy']()[_0x8220('0x23')](function(){_0x22e848[_0x8220('0x19')](0xcc)[_0x8220('0x1a')]();});}};}function handleEntityNotFound(_0x4fc3cc,_0x1f0d1a){return function(_0x3902c8){if(!_0x3902c8){_0x4fc3cc[_0x8220('0x18')](0x194);}return _0x3902c8;};}function handleError(_0x39a033,_0x4a0dec){_0x4a0dec=_0x4a0dec||0x1f4;return function(_0x2b31c2){logger[_0x8220('0x24')](_0x2b31c2[_0x8220('0x25')]);if(_0x2b31c2['name']){delete _0x2b31c2[_0x8220('0x26')];}_0x39a033[_0x8220('0x19')](_0x4a0dec)[_0x8220('0x27')](_0x2b31c2);};}exports[_0x8220('0x28')]=function(_0x154e8c,_0x5f4ccf){var _0x254c7a={'raw':!![],'where':{'id':_0x154e8c[_0x8220('0x29')]['id']}},_0xd56a27={};_0xd56a27[_0x8220('0x2a')]=_[_0x8220('0x2b')](db[_0x8220('0x2c')][_0x8220('0x2d')]);_0xd56a27[_0x8220('0x2e')]=_[_0x8220('0x2b')](_0x154e8c['query']);_0xd56a27[_0x8220('0x2f')]=_['intersection'](_0xd56a27[_0x8220('0x2a')],_0xd56a27[_0x8220('0x2e')]);_0x254c7a['attributes']=_[_0x8220('0x30')](_0xd56a27[_0x8220('0x2a')],qs[_0x8220('0x31')](_0x154e8c[_0x8220('0x2e')][_0x8220('0x31')]));_0x254c7a[_0x8220('0x32')]=_0x254c7a[_0x8220('0x32')][_0x8220('0x33')]?_0x254c7a['attributes']:_0xd56a27[_0x8220('0x2a')];if(_0x154e8c[_0x8220('0x2e')]['includeAll']){_0x254c7a['include']=[{'all':!![]}];}_0x254c7a=_[_0x8220('0x34')]({},_0x254c7a,_0x154e8c[_0x8220('0x35')]);return db[_0x8220('0x2c')]['find'](_0x254c7a)['then'](handleEntityNotFound(_0x5f4ccf,null))[_0x8220('0x23')](respondWithResult(_0x5f4ccf,null))[_0x8220('0x36')](handleError(_0x5f4ccf,null));};exports[_0x8220('0x37')]=function(_0x299966,_0x4a0e86){return db[_0x8220('0x2c')][_0x8220('0x37')](_0x299966['body'],{})[_0x8220('0x23')](respondWithResult(_0x4a0e86,0xc9))[_0x8220('0x36')](handleError(_0x4a0e86,null));};exports['update']=function(_0xa2972a,_0x17143c){if(_0xa2972a[_0x8220('0x38')]['id']){delete _0xa2972a[_0x8220('0x38')]['id'];}return db[_0x8220('0x2c')][_0x8220('0x39')]({'where':{'id':_0xa2972a['params']['id']}})['then'](handleEntityNotFound(_0x17143c,null))[_0x8220('0x23')](saveUpdates(_0xa2972a[_0x8220('0x38')],null))[_0x8220('0x23')](respondWithResult(_0x17143c,null))[_0x8220('0x36')](handleError(_0x17143c,null));};exports[_0x8220('0x3a')]=function(_0x221fca,_0x1076cc){return db['ChatProactiveAction'][_0x8220('0x39')]({'where':{'id':_0x221fca[_0x8220('0x29')]['id']}})[_0x8220('0x23')](handleEntityNotFound(_0x1076cc,null))['then'](removeEntity(_0x1076cc,null))[_0x8220('0x36')](handleError(_0x1076cc,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 4355859..bd60d44 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 _0x393b=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x50daa4,_0x3c336d){var _0x389935=function(_0x292d12){while(--_0x292d12){_0x50daa4['push'](_0x50daa4['shift']());}};_0x389935(++_0x3c336d);}(_0x393b,0x126));var _0xb393=function(_0x2f54b6,_0x3cc6cb){_0x2f54b6=_0x2f54b6-0x0;var _0x169f21=_0x393b[_0x2f54b6];return _0x169f21;};'use strict';var _=require(_0xb393('0x0'));var util=require('util');var logger=require(_0xb393('0x1'))('api');var moment=require(_0xb393('0x2'));var BPromise=require(_0xb393('0x3'));var rp=require(_0xb393('0x4'));var fs=require('fs');var path=require(_0xb393('0x5'));var rimraf=require(_0xb393('0x6'));var config=require(_0xb393('0x7'));var attributes=require(_0xb393('0x8'));module[_0xb393('0x9')]=function(_0xc5a7fb,_0x126b14){return _0xc5a7fb['define'](_0xb393('0xa'),attributes,{'tableName':_0xb393('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd613=['bluebird','path','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0xe5bc7f,_0x4408e3){var _0x241371=function(_0x2f57e0){while(--_0x2f57e0){_0xe5bc7f['push'](_0xe5bc7f['shift']());}};_0x241371(++_0x4408e3);}(_0xd613,0x16f));var _0x3d61=function(_0x241c52,_0x3f3acf){_0x241c52=_0x241c52-0x0;var _0x466a4d=_0xd613[_0x241c52];return _0x466a4d;};'use strict';var _=require(_0x3d61('0x0'));var util=require(_0x3d61('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3d61('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d61('0x3'));var rimraf=require('rimraf');var config=require(_0x3d61('0x4'));var attributes=require('./chatProactiveAction.attributes');module[_0x3d61('0x5')]=function(_0x3d15db,_0x41544f){return _0x3d15db[_0x3d61('0x6')](_0x3d61('0x7'),attributes,{'tableName':_0x3d61('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 37358c8..85050ff 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 _0x7f39=['error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1c32ae,_0x2321a0){var _0x233e0a=function(_0x72eb40){while(--_0x72eb40){_0x1c32ae['push'](_0x1c32ae['shift']());}};_0x233e0a(++_0x2321a0);}(_0x7f39,0x131));var _0x97f3=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x7f39[_0x44946b];return _0x249bc4;};'use strict';var _=require('lodash');var util=require(_0x97f3('0x0'));var moment=require(_0x97f3('0x1'));var BPromise=require(_0x97f3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x97f3('0x3'))['db'];var utils=require(_0x97f3('0x4'));var logger=require(_0x97f3('0x5'))(_0x97f3('0x6'));var config=require(_0x97f3('0x7'));var jayson=require(_0x97f3('0x8'));var client=jayson['client'][_0x97f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bf85,_0x25a63b,_0x90366e){return new BPromise(function(_0x2a44f2,_0x31866f){return client[_0x97f3('0xa')](_0x1bf85,_0x90366e)['then'](function(_0x5c9711){logger[_0x97f3('0xb')](_0x97f3('0xc'),_0x25a63b,_0x97f3('0xd'));logger[_0x97f3('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x25a63b,'request\x20sent',JSON['stringify'](_0x5c9711));if(_0x5c9711[_0x97f3('0xf')]){if(_0x5c9711[_0x97f3('0xf')][_0x97f3('0x10')]===0x1f4){logger[_0x97f3('0xf')](_0x97f3('0xc'),_0x25a63b,_0x5c9711[_0x97f3('0xf')][_0x97f3('0x11')]);return _0x31866f(_0x5c9711['error'][_0x97f3('0x11')]);}logger[_0x97f3('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x25a63b,_0x5c9711[_0x97f3('0xf')][_0x97f3('0x11')]);return _0x2a44f2(_0x5c9711['error'][_0x97f3('0x11')]);}else{logger[_0x97f3('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x25a63b,_0x97f3('0xd'));_0x2a44f2(_0x5c9711[_0x97f3('0x12')][_0x97f3('0x11')]);}})[_0x97f3('0x13')](function(_0x509439){logger[_0x97f3('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x25a63b,_0x509439);_0x31866f(_0x509439);});});} \ No newline at end of file +var _0xa368=['result','catch','lodash','moment','../../config/utils','../../config/logger','rpc','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x273774,_0xd450d3){var _0x65cc66=function(_0x3ff5d8){while(--_0x3ff5d8){_0x273774['push'](_0x273774['shift']());}};_0x65cc66(++_0xd450d3);}(_0xa368,0xe6));var _0x8a36=function(_0x1cc8e9,_0x4f0f81){_0x1cc8e9=_0x1cc8e9-0x0;var _0x3c91f6=_0xa368[_0x1cc8e9];return _0x3c91f6;};'use strict';var _=require(_0x8a36('0x0'));var util=require('util');var moment=require(_0x8a36('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8a36('0x2'));var logger=require(_0x8a36('0x3'))(_0x8a36('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8a36('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x31fbde,_0x4bf3c2,_0x265580){return new BPromise(function(_0x159c8a,_0x29982d){return client[_0x8a36('0x6')](_0x31fbde,_0x265580)[_0x8a36('0x7')](function(_0x1a2602){logger[_0x8a36('0x8')](_0x8a36('0x9'),_0x4bf3c2,'request\x20sent');logger[_0x8a36('0xa')](_0x8a36('0xb'),_0x4bf3c2,_0x8a36('0xc'),JSON[_0x8a36('0xd')](_0x1a2602));if(_0x1a2602['error']){if(_0x1a2602[_0x8a36('0xe')][_0x8a36('0xf')]===0x1f4){logger[_0x8a36('0xe')](_0x8a36('0x9'),_0x4bf3c2,_0x1a2602[_0x8a36('0xe')]['message']);return _0x29982d(_0x1a2602[_0x8a36('0xe')][_0x8a36('0x10')]);}logger['error'](_0x8a36('0x9'),_0x4bf3c2,_0x1a2602[_0x8a36('0xe')][_0x8a36('0x10')]);return _0x159c8a(_0x1a2602[_0x8a36('0xe')][_0x8a36('0x10')]);}else{logger[_0x8a36('0x8')](_0x8a36('0x9'),_0x4bf3c2,_0x8a36('0xc'));_0x159c8a(_0x1a2602[_0x8a36('0x11')][_0x8a36('0x10')]);}})[_0x8a36('0x12')](function(_0xebab4e){logger[_0x8a36('0xe')](_0x8a36('0x9'),_0x4bf3c2,_0xebab4e);_0x29982d(_0xebab4e);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 9cd9b52..4cede59 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 _0x5fc3=['create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','show','isAuthenticated'];(function(_0x3f1074,_0x2b5f64){var _0xb67381=function(_0x1e7a60){while(--_0x1e7a60){_0x3f1074['push'](_0x3f1074['shift']());}};_0xb67381(++_0x2b5f64);}(_0x5fc3,0xa8));var _0x35fc=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x5fc3[_0x264545];return _0x114d10;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x35fc('0xa')]);router['post']('/',auth[_0x35fc('0xb')](),controller[_0x35fc('0xc')]);router[_0x35fc('0xd')](_0x35fc('0xe'),auth[_0x35fc('0xb')](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xb')](),controller[_0x35fc('0x11')]);module['exports']=router; \ No newline at end of file +var _0x98a8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x7b5cdd,_0x8c88d8){var _0x3a29ae=function(_0x17859a){while(--_0x17859a){_0x7b5cdd['push'](_0x7b5cdd['shift']());}};_0x3a29ae(++_0x8c88d8);}(_0x98a8,0x12c));var _0x898a=function(_0xa969cd,_0x176f99){_0xa969cd=_0xa969cd-0x0;var _0x396de4=_0x98a8[_0xa969cd];return _0x396de4;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var fs_extra=require(_0x898a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var controller=require(_0x898a('0x9'));router[_0x898a('0xa')](_0x898a('0xb'),auth['isAuthenticated'](),controller[_0x898a('0xc')]);router['post']('/',auth[_0x898a('0xd')](),controller['create']);router[_0x898a('0xe')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0xf')]);router[_0x898a('0x10')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0x11')]);module[_0x898a('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index b40169b..be4e0b3 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 _0x8ba3=['ENUM','rrmemory','beepall','roundrobin','STRING','INTEGER'];(function(_0xeebcf3,_0x119794){var _0x2dda52=function(_0x4046ea){while(--_0x4046ea){_0xeebcf3['push'](_0xeebcf3['shift']());}};_0x2dda52(++_0x119794);}(_0x8ba3,0x64));var _0x38ba=function(_0x2e686b,_0x1cc985){_0x2e686b=_0x2e686b-0x0;var _0x156e75=_0x8ba3[_0x2e686b];return _0x156e75;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x38ba('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x38ba('0x0')]},'timeout':{'type':Sequelize[_0x38ba('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x38ba('0x2')](_0x38ba('0x3'),_0x38ba('0x4'),_0x38ba('0x5'))}}; \ No newline at end of file +var _0x737c=['sequelize','exports','STRING','INTEGER','rrmemory'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0x737c,0x64));var _0xc737=function(_0x464e1f,_0x2aa86f){_0x464e1f=_0x464e1f-0x0;var _0x1c1ce2=_0x737c[_0x464e1f];return _0x1c1ce2;};'use strict';var Sequelize=require(_0xc737('0x0'));module[_0xc737('0x1')]={'name':{'type':Sequelize[_0xc737('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc737('0x2')]},'timeout':{'type':Sequelize[_0xc737('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc737('0x4'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 5ac7667..d55b804 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 _0xbd4a=['find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','hasOwnProperty','nolimit','ChatQueueId','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','addTeams','User','Agents','voicePause','interface','flatMap','sequelize','transaction','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','all','union','compact','value','ids','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','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','./chatQueue.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','UserProfileResource','destroy','name','send','ChatQueue','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params'];(function(_0x15e341,_0x192f44){var _0x291d32=function(_0x2e50b7){while(--_0x2e50b7){_0x15e341['push'](_0x15e341['shift']());}};_0x291d32(++_0x192f44);}(_0xbd4a,0x16d));var _0xabd4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbd4a[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xabd4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabd4('0x1'));var jsonpatch=require(_0xabd4('0x2'));var rp=require('request-promise');var moment=require(_0xabd4('0x3'));var BPromise=require(_0xabd4('0x4'));var Mustache=require(_0xabd4('0x5'));var util=require(_0xabd4('0x6'));var path=require(_0xabd4('0x7'));var sox=require('sox');var csv=require(_0xabd4('0x8'));var ejs=require(_0xabd4('0x9'));var fs=require('fs');var fs_extra=require(_0xabd4('0xa'));var _=require(_0xabd4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xabd4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xabd4('0x8'));var querystring=require(_0xabd4('0xd'));var Papa=require(_0xabd4('0xe'));var Redis=require(_0xabd4('0xf'));var authService=require(_0xabd4('0x10'));var qs=require(_0xabd4('0x11'));var as=require(_0xabd4('0x12'));var hardwareService=require(_0xabd4('0x13'));var logger=require(_0xabd4('0x14'))('api');var utils=require(_0xabd4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xabd4('0x16'));var db=require(_0xabd4('0x17'))['db'];config[_0xabd4('0x18')]=_[_0xabd4('0x19')](config[_0xabd4('0x18')],{'host':_0xabd4('0x1a'),'port':0x18eb});var socket=require(_0xabd4('0x1b'))(new Redis(config[_0xabd4('0x18')]));require(_0xabd4('0x1c'))['register'](socket);var jayson=require(_0xabd4('0x1d'));var client=jayson[_0xabd4('0x1e')][_0xabd4('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x9e9e90,_0x43468f,_0x1c78db,_0x343451){return new BPromise(function(_0x53534f,_0x519c9f){var _0x1e916a=_0x343451||client;return _0x1e916a[_0xabd4('0x20')](_0x9e9e90,_0x1c78db)[_0xabd4('0x21')](function(_0x5d2821){logger[_0xabd4('0x22')]('ChatQueue,\x20%s,\x20%s',_0x43468f,_0xabd4('0x23'));logger[_0xabd4('0x24')](_0xabd4('0x25'),_0x43468f,_0xabd4('0x23'),JSON[_0xabd4('0x26')](_0x5d2821));if(_0x5d2821[_0xabd4('0x27')]){if(_0x5d2821[_0xabd4('0x27')][_0xabd4('0x28')]===0x1f4){logger[_0xabd4('0x27')](_0xabd4('0x29'),_0x43468f,_0x5d2821[_0xabd4('0x27')][_0xabd4('0x2a')]);return _0x519c9f(_0x5d2821['error'][_0xabd4('0x2a')]);}logger[_0xabd4('0x27')]('ChatQueue,\x20%s,\x20%s',_0x43468f,_0x5d2821[_0xabd4('0x27')]['message']);return _0x53534f(_0x5d2821[_0xabd4('0x27')]['message']);}else{logger['info'](_0xabd4('0x29'),_0x43468f,'request\x20sent');_0x53534f(_0x5d2821[_0xabd4('0x2b')][_0xabd4('0x2a')]);}})['catch'](function(_0x4c8694){logger[_0xabd4('0x27')]('ChatQueue,\x20%s,\x20%s',_0x43468f,_0x4c8694);_0x519c9f(_0x4c8694);});});}function respondWithStatusCode(_0x36e797,_0x2ae7c7){_0x2ae7c7=_0x2ae7c7||0xcc;return function(_0x302ab4){if(_0x302ab4){return _0x36e797[_0xabd4('0x2c')](_0x2ae7c7);}return _0x36e797[_0xabd4('0x2d')](_0x2ae7c7)[_0xabd4('0x2e')]();};}function respondWithResult(_0x3465a1,_0x44f3fe){_0x44f3fe=_0x44f3fe||0xc8;return function(_0x1e44ef){if(_0x1e44ef){return _0x3465a1[_0xabd4('0x2d')](_0x44f3fe)[_0xabd4('0x2f')](_0x1e44ef);}};}function respondWithFilteredResult(_0x2df87d,_0x3e8d83){return function(_0x205e1d){if(_0x205e1d){var _0x599b35=typeof _0x3e8d83[_0xabd4('0x30')]===_0xabd4('0x31')&&typeof _0x3e8d83['limit']===_0xabd4('0x31');var _0x11e771=_0x205e1d['count'];var _0x6b273b=_0x599b35?0x0:_0x3e8d83[_0xabd4('0x30')];var _0x41f29d=_0x599b35?_0x205e1d[_0xabd4('0x32')]:_0x3e8d83[_0xabd4('0x30')]+_0x3e8d83['limit'];var _0x201537;if(_0x41f29d>=_0x11e771){_0x41f29d=_0x11e771;_0x201537=0xc8;}else{_0x201537=0xce;}_0x2df87d[_0xabd4('0x2d')](_0x201537);return _0x2df87d[_0xabd4('0x33')](_0xabd4('0x34'),_0x6b273b+'-'+_0x41f29d+'/'+_0x11e771)[_0xabd4('0x2f')](_0x205e1d);}return null;};}function patchUpdates(_0x3baf6e){return function(_0xda0ff3){try{jsonpatch[_0xabd4('0x35')](_0xda0ff3,_0x3baf6e,!![]);}catch(_0x5d7ef5){return BPromise[_0xabd4('0x36')](_0x5d7ef5);}return _0xda0ff3[_0xabd4('0x37')]();};}function saveUpdates(_0x43a479,_0x2f887c){return function(_0x12be02){if(_0x12be02){return _0x12be02[_0xabd4('0x38')](_0x43a479)[_0xabd4('0x21')](function(_0x32aeea){return _0x32aeea;});}return null;};}function removeEntity(_0x4aa4d0,_0x4d0150){return function(_0x204218){if(_0x204218){return _0x204218['destroy']()[_0xabd4('0x21')](function(){var _0x1a0f84=_0x204218['get']({'plain':!![]});var _0xf794a9='ChatQueues';return db[_0xabd4('0x39')][_0xabd4('0x3a')]({'where':{'type':_0xf794a9,'resourceId':_0x1a0f84['id']}})[_0xabd4('0x21')](function(){return _0x204218;});})[_0xabd4('0x21')](function(){_0x4aa4d0['status'](0xcc)[_0xabd4('0x2e')]();});}};}function handleEntityNotFound(_0x277473,_0x210088){return function(_0x39f473){if(!_0x39f473){_0x277473[_0xabd4('0x2c')](0x194);}return _0x39f473;};}function handleError(_0x4be5d7,_0x59e570){_0x59e570=_0x59e570||0x1f4;return function(_0x1310d4){logger[_0xabd4('0x27')](_0x1310d4['stack']);if(_0x1310d4[_0xabd4('0x3b')]){delete _0x1310d4[_0xabd4('0x3b')];}_0x4be5d7[_0xabd4('0x2d')](_0x59e570)[_0xabd4('0x3c')](_0x1310d4);};}exports['index']=function(_0x2b12aa,_0x329f40){var _0x20046d={},_0x55b7c0={},_0x21e5b0={'count':0x0,'rows':[]};var _0x4a2b91=_['map'](db[_0xabd4('0x3d')][_0xabd4('0x3e')],function(_0x21c121){return{'name':_0x21c121['fieldName'],'type':_0x21c121[_0xabd4('0x3f')][_0xabd4('0x40')]};});_0x55b7c0[_0xabd4('0x41')]=_[_0xabd4('0x42')](_0x4a2b91,_0xabd4('0x3b'));_0x55b7c0[_0xabd4('0x43')]=_[_0xabd4('0x44')](_0x2b12aa[_0xabd4('0x43')]);_0x55b7c0[_0xabd4('0x45')]=_[_0xabd4('0x46')](_0x55b7c0['model'],_0x55b7c0['query']);_0x20046d[_0xabd4('0x47')]=_[_0xabd4('0x46')](_0x55b7c0[_0xabd4('0x41')],qs[_0xabd4('0x48')](_0x2b12aa['query'][_0xabd4('0x48')]));_0x20046d['attributes']=_0x20046d[_0xabd4('0x47')][_0xabd4('0x49')]?_0x20046d[_0xabd4('0x47')]:_0x55b7c0[_0xabd4('0x41')];if(!_0x2b12aa['query']['hasOwnProperty']('nolimit')){_0x20046d[_0xabd4('0x4a')]=qs['limit'](_0x2b12aa[_0xabd4('0x43')][_0xabd4('0x4a')]);_0x20046d['offset']=qs['offset'](_0x2b12aa[_0xabd4('0x43')][_0xabd4('0x30')]);}_0x20046d[_0xabd4('0x4b')]=qs[_0xabd4('0x4c')](_0x2b12aa[_0xabd4('0x43')]['sort']);_0x20046d[_0xabd4('0x4d')]=qs[_0xabd4('0x45')](_[_0xabd4('0x4e')](_0x2b12aa[_0xabd4('0x43')],_0x55b7c0[_0xabd4('0x45')]),_0x4a2b91);if(_0x2b12aa[_0xabd4('0x43')][_0xabd4('0x4f')]){_0x20046d[_0xabd4('0x4d')]=_['merge'](_0x20046d['where'],{'$or':_[_0xabd4('0x42')](_0x4a2b91,function(_0x145cd0){if(_0x145cd0[_0xabd4('0x3f')]!=='VIRTUAL'){var _0x1f49ac={};_0x1f49ac[_0x145cd0['name']]={'$like':'%'+_0x2b12aa[_0xabd4('0x43')][_0xabd4('0x4f')]+'%'};return _0x1f49ac;}})});}_0x20046d=_[_0xabd4('0x50')]({},_0x20046d,_0x2b12aa[_0xabd4('0x51')]);var _0x58018a={'where':_0x20046d[_0xabd4('0x4d')]};return db[_0xabd4('0x3d')][_0xabd4('0x32')](_0x58018a)['then'](function(_0x5aac7e){_0x21e5b0[_0xabd4('0x32')]=_0x5aac7e;if(_0x2b12aa[_0xabd4('0x43')][_0xabd4('0x52')]){_0x20046d[_0xabd4('0x53')]=[{'all':!![]}];}return db[_0xabd4('0x3d')][_0xabd4('0x54')](_0x20046d);})['then'](function(_0x573c0e){_0x21e5b0[_0xabd4('0x55')]=_0x573c0e;return _0x21e5b0;})[_0xabd4('0x21')](respondWithFilteredResult(_0x329f40,_0x20046d))[_0xabd4('0x56')](handleError(_0x329f40,null));};exports['show']=function(_0x2cbe5f,_0x400403){var _0x111126={'raw':!![],'where':{'id':_0x2cbe5f[_0xabd4('0x57')]['id']}},_0x4ffdfe={};_0x4ffdfe[_0xabd4('0x41')]=_[_0xabd4('0x44')](db['ChatQueue'][_0xabd4('0x3e')]);_0x4ffdfe[_0xabd4('0x43')]=_[_0xabd4('0x44')](_0x2cbe5f['query']);_0x4ffdfe[_0xabd4('0x45')]=_[_0xabd4('0x46')](_0x4ffdfe[_0xabd4('0x41')],_0x4ffdfe[_0xabd4('0x43')]);_0x111126[_0xabd4('0x47')]=_[_0xabd4('0x46')](_0x4ffdfe[_0xabd4('0x41')],qs['fields'](_0x2cbe5f[_0xabd4('0x43')]['fields']));_0x111126['attributes']=_0x111126['attributes'][_0xabd4('0x49')]?_0x111126[_0xabd4('0x47')]:_0x4ffdfe[_0xabd4('0x41')];if(_0x2cbe5f[_0xabd4('0x43')][_0xabd4('0x52')]){_0x111126[_0xabd4('0x53')]=[{'all':!![]}];}_0x111126=_[_0xabd4('0x50')]({},_0x111126,_0x2cbe5f[_0xabd4('0x51')]);return db[_0xabd4('0x3d')][_0xabd4('0x58')](_0x111126)[_0xabd4('0x21')](handleEntityNotFound(_0x400403,null))['then'](respondWithResult(_0x400403,null))[_0xabd4('0x56')](handleError(_0x400403,null));};exports['create']=function(_0x3b36fb,_0x497d2f){return db[_0xabd4('0x3d')][_0xabd4('0x59')](_0x3b36fb[_0xabd4('0x5a')],{})[_0xabd4('0x21')](function(_0x526ae3){var _0x19015a=_0x3b36fb[_0xabd4('0x5b')][_0xabd4('0x5c')]({'plain':!![]});if(!_0x19015a)throw new Error(_0xabd4('0x5d'));if(_0x19015a[_0xabd4('0x5e')]===_0xabd4('0x5b')){var _0x25b5a6=_0x526ae3[_0xabd4('0x5c')]({'plain':!![]});var _0x178a3d=_0xabd4('0x5f');return db[_0xabd4('0x60')][_0xabd4('0x58')]({'where':{'name':_0x178a3d,'userProfileId':_0x19015a['userProfileId']},'raw':!![]})[_0xabd4('0x21')](function(_0x19e912){if(_0x19e912&&_0x19e912[_0xabd4('0x61')]===0x0){return db[_0xabd4('0x39')]['create']({'name':_0x25b5a6['name'],'resourceId':_0x25b5a6['id'],'type':_0x19e912[_0xabd4('0x3b')],'sectionId':_0x19e912['id']},{})[_0xabd4('0x21')](function(){return _0x526ae3;});}else{return _0x526ae3;}})[_0xabd4('0x56')](function(_0x492ae4){logger['error'](_0xabd4('0x62'),_0x492ae4);throw _0x492ae4;});}return _0x526ae3;})[_0xabd4('0x21')](respondWithResult(_0x497d2f,0xc9))[_0xabd4('0x56')](handleError(_0x497d2f,null));};exports[_0xabd4('0x38')]=function(_0x429f5c,_0x3b634b){if(_0x429f5c[_0xabd4('0x5a')]['id']){delete _0x429f5c[_0xabd4('0x5a')]['id'];}return db[_0xabd4('0x3d')][_0xabd4('0x58')]({'where':{'id':_0x429f5c[_0xabd4('0x57')]['id']}})[_0xabd4('0x21')](handleEntityNotFound(_0x3b634b,null))[_0xabd4('0x21')](saveUpdates(_0x429f5c['body'],null))['then'](respondWithResult(_0x3b634b,null))[_0xabd4('0x56')](handleError(_0x3b634b,null));};exports['destroy']=function(_0x5375d5,_0xe453d4){return db[_0xabd4('0x3d')][_0xabd4('0x58')]({'where':{'id':_0x5375d5[_0xabd4('0x57')]['id']}})['then'](handleEntityNotFound(_0xe453d4,null))[_0xabd4('0x21')](removeEntity(_0xe453d4,null))['catch'](handleError(_0xe453d4,null));};exports['describe']=function(_0x3ef3b9,_0x330821){return db[_0xabd4('0x3d')][_0xabd4('0x63')]()[_0xabd4('0x21')](respondWithResult(_0x330821,null))[_0xabd4('0x56')](handleError(_0x330821,null));};exports['getMembers']=function(_0x47fb99,_0x1c32ad,_0x570a95){var _0x52f2b3={'raw':!![],'where':{}},_0x51cd6c={},_0x51b233;return db[_0xabd4('0x3d')]['findOne']({'where':{'id':_0x47fb99[_0xabd4('0x57')]['id']}})[_0xabd4('0x21')](handleEntityNotFound(_0x1c32ad,null))['then'](function(_0x34cdd3){if(_0x34cdd3){_0x51b233=_0x34cdd3[_0xabd4('0x5c')]({'plain':!![]});_0x51cd6c['model']=_[_0xabd4('0x44')](db['UserChatQueue'][_0xabd4('0x3e')]);_0x51cd6c[_0xabd4('0x43')]=_['keys'](_0x47fb99[_0xabd4('0x43')]);_0x51cd6c['filters']=_['intersection'](_0x51cd6c[_0xabd4('0x41')],_0x51cd6c['query']);_0x52f2b3[_0xabd4('0x47')]=_['intersection'](_0x51cd6c[_0xabd4('0x41')],qs[_0xabd4('0x48')](_0x47fb99['query'][_0xabd4('0x48')]));_0x52f2b3['attributes']=_0x52f2b3[_0xabd4('0x47')][_0xabd4('0x49')]?_0x52f2b3['attributes']:_0x51cd6c[_0xabd4('0x41')];if(!_0x47fb99['query'][_0xabd4('0x64')](_0xabd4('0x65'))){_0x52f2b3[_0xabd4('0x4a')]=qs['limit'](_0x47fb99['query'][_0xabd4('0x4a')]);_0x52f2b3[_0xabd4('0x30')]=qs[_0xabd4('0x30')](_0x47fb99['query'][_0xabd4('0x30')]);}_0x52f2b3[_0xabd4('0x4b')]=qs[_0xabd4('0x4c')](_0x47fb99[_0xabd4('0x43')][_0xabd4('0x4c')]);_0x52f2b3[_0xabd4('0x4d')]=qs[_0xabd4('0x45')](_['pick'](_0x47fb99[_0xabd4('0x43')],_0x51cd6c['filters']));_0x52f2b3[_0xabd4('0x4d')][_0xabd4('0x66')]=_0x34cdd3['id'];if(_0x47fb99[_0xabd4('0x43')][_0xabd4('0x4f')]){_0x52f2b3['where']=_[_0xabd4('0x50')](_0x52f2b3[_0xabd4('0x4d')],{'$or':_[_0xabd4('0x42')](_0x52f2b3[_0xabd4('0x47')],function(_0x7760a8){var _0x1cec0f={};_0x1cec0f[_0x7760a8]={'$like':'%'+_0x47fb99[_0xabd4('0x43')][_0xabd4('0x4f')]+'%'};return _0x1cec0f;})});}_0x52f2b3=_[_0xabd4('0x50')]({},_0x52f2b3,_0x47fb99[_0xabd4('0x51')]);return db['UserChatQueue'][_0xabd4('0x54')](_0x52f2b3);}})[_0xabd4('0x21')](function(_0x362f31){if(_0x362f31){return db['User'][_0xabd4('0x67')]({'where':{'id':_['map'](_0x362f31,'UserId'),'role':_0xabd4('0x68')},'attributes':['id',_0xabd4('0x3b'),_0xabd4('0x69'),_0xabd4('0x6a'),_0xabd4('0x6b')]});}})[_0xabd4('0x21')](function(_0x2f9108){if(_0x2f9108){return{'count':_0x2f9108[_0xabd4('0x32')],'rows':_['map'](_0x2f9108[_0xabd4('0x55')],function(_0x3ca40b){return{'membername':_0x3ca40b[_0xabd4('0x3b')],'UserId':_0x3ca40b['id'],'queue_name':_0x51b233[_0xabd4('0x3b')],'ChatQueueId':_0x51b233['id'],'interface':util[_0xabd4('0x6c')]('%s/%s',_0xabd4('0x6d'),_0x3ca40b[_0xabd4('0x3b')]),'penalty':0x0,'paused':_0x3ca40b[_0xabd4('0x69')],'createdAt':_0x3ca40b[_0xabd4('0x6b')],'updatedAt':_0x3ca40b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xabd4('0x21')](respondWithFilteredResult(_0x1c32ad,_0x52f2b3))[_0xabd4('0x56')](handleError(_0x1c32ad,null));};exports[_0xabd4('0x6e')]=function(_0x158547,_0x24ed66,_0x5aaf14){var _0x294f80={};var _0xa618fb={};var _0x4bfb85;var _0x226aa6;return db[_0xabd4('0x3d')][_0xabd4('0x6f')]({'where':{'id':_0x158547[_0xabd4('0x57')]['id']}})[_0xabd4('0x21')](handleEntityNotFound(_0x24ed66,null))['then'](function(_0x58bfc1){if(_0x58bfc1){_0x4bfb85=_0x58bfc1;_0xa618fb[_0xabd4('0x41')]=_[_0xabd4('0x44')](db[_0xabd4('0x70')][_0xabd4('0x3e')]);_0xa618fb[_0xabd4('0x43')]=_[_0xabd4('0x44')](_0x158547[_0xabd4('0x43')]);_0xa618fb[_0xabd4('0x45')]=_['intersection'](_0xa618fb[_0xabd4('0x41')],_0xa618fb['query']);_0x294f80[_0xabd4('0x47')]=_[_0xabd4('0x46')](_0xa618fb[_0xabd4('0x41')],qs[_0xabd4('0x48')](_0x158547['query']['fields']));_0x294f80[_0xabd4('0x47')]=_0x294f80[_0xabd4('0x47')][_0xabd4('0x49')]?_0x294f80[_0xabd4('0x47')]:_0xa618fb[_0xabd4('0x41')];_0x294f80['order']=qs[_0xabd4('0x4c')](_0x158547[_0xabd4('0x43')][_0xabd4('0x4c')]);_0x294f80['where']=qs['filters'](_[_0xabd4('0x4e')](_0x158547[_0xabd4('0x43')],_0xa618fb['filters']));if(_0x158547[_0xabd4('0x43')][_0xabd4('0x4f')]){_0x294f80[_0xabd4('0x4d')]=_['merge'](_0x294f80[_0xabd4('0x4d')],{'$or':_[_0xabd4('0x42')](_0x294f80['attributes'],function(_0x190fdc){var _0x17356b={};_0x17356b[_0x190fdc]={'$like':'%'+_0x158547[_0xabd4('0x43')][_0xabd4('0x4f')]+'%'};return _0x17356b;})});}_0x294f80=_['merge']({},_0x294f80,_0x158547[_0xabd4('0x51')]);return _0x4bfb85[_0xabd4('0x6e')](_0x294f80);}})[_0xabd4('0x21')](function(_0x30a145){if(_0x30a145){_0x226aa6=_0x30a145[_0xabd4('0x49')];if(!_0x158547[_0xabd4('0x43')][_0xabd4('0x64')](_0xabd4('0x65'))){_0x294f80[_0xabd4('0x4a')]=qs['limit'](_0x158547[_0xabd4('0x43')][_0xabd4('0x4a')]);_0x294f80[_0xabd4('0x30')]=qs['offset'](_0x158547[_0xabd4('0x43')][_0xabd4('0x30')]);}return _0x4bfb85[_0xabd4('0x6e')](_0x294f80);}})[_0xabd4('0x21')](function(_0xca6d93){if(_0xca6d93){return _0xca6d93?{'count':_0x226aa6,'rows':_0xca6d93}:null;}})['then'](respondWithResult(_0x24ed66,null))[_0xabd4('0x56')](handleError(_0x24ed66,null));};exports[_0xabd4('0x71')]=function(_0x542221,_0x3ac110,_0x4e52a1){var _0x49e0c3=_0x542221[_0xabd4('0x5a')]['ids'];return db[_0xabd4('0x70')][_0xabd4('0x54')]({'where':{'id':_0x49e0c3},'attributes':['id'],'include':[{'model':db[_0xabd4('0x72')],'as':_0xabd4('0x73'),'attributes':['id',_0xabd4('0x3b'),'online',_0xabd4('0x74'),_0xabd4('0x75')],'raw':!![]}]})[_0xabd4('0x21')](function(_0x4dc621){if(_0x4dc621){var _0x157c5c=_[_0xabd4('0x76')](_0x4dc621,function(_0x3f0ebd){var _0x3784cb=_0x3f0ebd['get']({'plain':!![]});return _0x3784cb['Agents'];});return db[_0xabd4('0x3d')][_0xabd4('0x58')]({'where':{'id':_0x542221['params']['id']}})[_0xabd4('0x21')](function(_0x228aec){return db[_0xabd4('0x77')][_0xabd4('0x78')](function(_0x585c63){return _0x228aec[_0xabd4('0x71')](_0x49e0c3,{'transaction':_0x585c63})[_0xabd4('0x21')](function(){return BPromise['each'](_0x157c5c,function(_0x110301){return db[_0xabd4('0x79')][_0xabd4('0x7a')]({'where':{'UserId':_0x110301['id'],'ChatQueueId':_0x542221[_0xabd4('0x57')]['id']},'transaction':_0x585c63});});})['then'](function(){_0x157c5c[_0xabd4('0x7b')](function(_0x379148){socket[_0xabd4('0x7c')](_0xabd4('0x7d'),{'UserId':_0x379148['id'],'ChatQueueId':_0x228aec['id']});});});});});}})[_0xabd4('0x21')](respondWithStatusCode(_0x3ac110,null))[_0xabd4('0x56')](handleError(_0x3ac110,null));};exports[_0xabd4('0x7e')]=function(_0x3a57bc,_0x3cefff,_0x11a4af){return db[_0xabd4('0x70')]['findAll']({'where':{'id':_0x3a57bc[_0xabd4('0x43')]['ids']},'attributes':['id'],'include':[{'model':db[_0xabd4('0x72')],'as':_0xabd4('0x73'),'attributes':['id'],'raw':!![]}]})[_0xabd4('0x21')](handleEntityNotFound(_0x3cefff,null))[_0xabd4('0x21')](function(_0xd975f1){var _0x5d8045=_[_0xabd4('0x42')](_0xd975f1,'id');var _0x2abc8c=[];var _0x39ffcd=[];var _0x1125bf=squel[_0xabd4('0x7f')]();_0x1125bf[_0xabd4('0x80')](_0xabd4('0x81'))[_0xabd4('0x82')](_0xabd4('0x83'),'tq')['join'](_0xabd4('0x84'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xabd4('0x4d')]('ChatQueueId\x20=\x20?',_0x3a57bc['params']['id']);for(var _0x3f8251=0x0;_0x3f8251<_0xd975f1['length'];_0x3f8251+=0x1){let _0xe2a66d=_0xd975f1[_0x3f8251];for(var _0x5d303c=0x0;_0x5d303c<_0xe2a66d[_0xabd4('0x73')][_0xabd4('0x49')];_0x5d303c+=0x1){let _0x270018=_0xe2a66d[_0xabd4('0x73')][_0x5d303c];var _0x48761d=_0x1125bf[_0xabd4('0x85')]();_0x48761d[_0xabd4('0x4d')](_0xabd4('0x86'),_0x270018['id']);_0x39ffcd['push'](db[_0xabd4('0x77')][_0xabd4('0x43')](_0x48761d[_0xabd4('0x87')](),{'type':db[_0xabd4('0x77')][_0xabd4('0x88')]['SELECT']})[_0xabd4('0x21')](function(_0x76a159){if(_0x76a159[_0xabd4('0x49')]===0x1){return _0x270018['id'];}else{var _0x3266de=_['every'](_['map'](_0x76a159,_0xabd4('0x89')),function(_0x2eb29e){return _[_0xabd4('0x8a')](_0x5d8045,_0x2eb29e);});if(_0x3266de){return _0x270018['id'];}}}));}}return BPromise[_0xabd4('0x8b')](_0x39ffcd)[_0xabd4('0x21')](function(_0x25d417){_0x2abc8c=_(_0x2abc8c)[_0xabd4('0x8c')](_0x25d417)[_0xabd4('0x8d')]()[_0xabd4('0x8e')]();return db[_0xabd4('0x3d')][_0xabd4('0x58')]({'where':{'id':_0x3a57bc[_0xabd4('0x57')]['id']}})[_0xabd4('0x21')](function(_0x29642d){return db[_0xabd4('0x77')][_0xabd4('0x78')](function(_0x551eec){return _0x29642d['removeTeams'](_0x3a57bc['query'][_0xabd4('0x8f')],{'transaction':_0x551eec})[_0xabd4('0x21')](function(){if(!_['isEmpty'](_0x2abc8c)){return _0x29642d[_0xabd4('0x90')](_0x2abc8c,{'transaction':_0x551eec});}})[_0xabd4('0x21')](function(){_0x2abc8c[_0xabd4('0x7b')](function(_0x5bfcc8){socket[_0xabd4('0x7c')](_0xabd4('0x91'),{'UserId':_0x5bfcc8,'ChatQueueId':_0x29642d['id']});});});});});});})['then'](respondWithStatusCode(_0x3cefff,null))['catch'](handleError(_0x3cefff,null));};exports[_0xabd4('0x92')]=function(_0x2f5c6d,_0x58f236,_0x3a8e64){return db['ChatQueue'][_0xabd4('0x58')]({'where':{'id':_0x2f5c6d[_0xabd4('0x57')]['id']}})[_0xabd4('0x21')](handleEntityNotFound(_0x58f236,null))[_0xabd4('0x21')](function(_0x420c96){if(_0x420c96){return _0x420c96[_0xabd4('0x92')](_0x2f5c6d[_0xabd4('0x5a')][_0xabd4('0x8f')],_[_0xabd4('0x93')](_0x2f5c6d['body'],['ids','id'])||{})[_0xabd4('0x94')](function(_0x50c9aa){for(var _0x1e02d7=0x0;_0x1e02d7<_0x2f5c6d[_0xabd4('0x5a')]['ids'][_0xabd4('0x49')];_0x1e02d7+=0x1){socket[_0xabd4('0x7c')](_0xabd4('0x7d'),{'UserId':Number(_0x2f5c6d[_0xabd4('0x5a')]['ids'][_0x1e02d7]),'ChatQueueId':Number(_0x2f5c6d[_0xabd4('0x57')]['id'])});}return _0x50c9aa;});}})[_0xabd4('0x21')](respondWithResult(_0x58f236,null))[_0xabd4('0x56')](handleError(_0x58f236,null));};exports[_0xabd4('0x90')]=function(_0x472590,_0x3fdb28,_0x93ca2c){return db[_0xabd4('0x3d')]['find']({'where':{'id':_0x472590[_0xabd4('0x57')]['id']}})[_0xabd4('0x21')](handleEntityNotFound(_0x3fdb28,null))['then'](function(_0x1238cf){if(_0x1238cf){return _0x1238cf[_0xabd4('0x90')](_0x472590['query'][_0xabd4('0x8f')])[_0xabd4('0x21')](function(){if(_[_0xabd4('0x95')](_0x472590[_0xabd4('0x43')][_0xabd4('0x8f')])){for(var _0x24c49b=0x0;_0x24c49b<_0x472590[_0xabd4('0x43')][_0xabd4('0x8f')][_0xabd4('0x49')];_0x24c49b+=0x1){socket[_0xabd4('0x7c')](_0xabd4('0x91'),{'UserId':Number(_0x472590[_0xabd4('0x43')]['ids'][_0x24c49b]),'ChatQueueId':Number(_0x472590[_0xabd4('0x57')]['id'])});}}else{socket[_0xabd4('0x7c')](_0xabd4('0x91'),{'UserId':Number(_0x472590[_0xabd4('0x43')][_0xabd4('0x8f')]),'ChatQueueId':Number(_0x472590[_0xabd4('0x57')]['id'])});}});}})[_0xabd4('0x21')](respondWithStatusCode(_0x3fdb28,null))[_0xabd4('0x56')](handleError(_0x3fdb28,null));};exports['getAgents']=function(_0xc95219,_0x38e758,_0x156bc8){var _0x1f7f81={};var _0x12cf0c={};var _0x126beb;var _0x1c8801;return db[_0xabd4('0x3d')][_0xabd4('0x6f')]({'where':{'id':_0xc95219[_0xabd4('0x57')]['id']}})[_0xabd4('0x21')](handleEntityNotFound(_0x38e758,null))['then'](function(_0xd617e1){if(_0xd617e1){_0x126beb=_0xd617e1;_0x12cf0c[_0xabd4('0x41')]=_[_0xabd4('0x44')](db[_0xabd4('0x72')][_0xabd4('0x3e')]);_0x12cf0c[_0xabd4('0x43')]=_[_0xabd4('0x44')](_0xc95219[_0xabd4('0x43')]);_0x12cf0c['filters']=_[_0xabd4('0x46')](_0x12cf0c[_0xabd4('0x41')],_0x12cf0c['query']);_0x1f7f81[_0xabd4('0x47')]=_['intersection'](_0x12cf0c['model'],qs[_0xabd4('0x48')](_0xc95219[_0xabd4('0x43')]['fields']));_0x1f7f81[_0xabd4('0x47')]=_0x1f7f81[_0xabd4('0x47')][_0xabd4('0x49')]?_0x1f7f81[_0xabd4('0x47')]:_0x12cf0c[_0xabd4('0x41')];_0x1f7f81[_0xabd4('0x4b')]=qs[_0xabd4('0x4c')](_0xc95219['query']['sort']);_0x1f7f81['where']=qs[_0xabd4('0x45')](_[_0xabd4('0x4e')](_0xc95219[_0xabd4('0x43')],_0x12cf0c[_0xabd4('0x45')]));if(_0xc95219['query'][_0xabd4('0x4f')]){_0x1f7f81[_0xabd4('0x4d')]=_[_0xabd4('0x50')](_0x1f7f81['where'],{'$or':_[_0xabd4('0x42')](_0x1f7f81['attributes'],function(_0x492cd4){var _0xd2d572={};_0xd2d572[_0x492cd4]={'$like':'%'+_0xc95219[_0xabd4('0x43')][_0xabd4('0x4f')]+'%'};return _0xd2d572;})});}_0x1f7f81=_[_0xabd4('0x50')]({},_0x1f7f81,_0xc95219['options']);return _0x126beb[_0xabd4('0x96')](_0x1f7f81);}})[_0xabd4('0x21')](function(_0x3059a8){if(_0x3059a8){_0x1c8801=_0x3059a8[_0xabd4('0x49')];if(!_0xc95219[_0xabd4('0x43')][_0xabd4('0x64')](_0xabd4('0x65'))){_0x1f7f81[_0xabd4('0x4a')]=qs[_0xabd4('0x4a')](_0xc95219[_0xabd4('0x43')]['limit']);_0x1f7f81[_0xabd4('0x30')]=qs['offset'](_0xc95219[_0xabd4('0x43')][_0xabd4('0x30')]);}return _0x126beb[_0xabd4('0x96')](_0x1f7f81);}})[_0xabd4('0x21')](function(_0x528eef){if(_0x528eef){return _0x528eef?{'count':_0x1c8801,'rows':_0x528eef}:null;}})['then'](respondWithResult(_0x38e758,null))['catch'](handleError(_0x38e758,null));}; \ No newline at end of file +var _0x916d=['jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','destroy','get','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserChatQueue','limit','order','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','Team','getTeams','ids','online','voicePause','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','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','redis','defaults','localhost','./chatQueue.socket','register'];(function(_0xb85321,_0x11566c){var _0x495df4=function(_0x535574){while(--_0x535574){_0xb85321['push'](_0xb85321['shift']());}};_0x495df4(++_0x11566c);}(_0x916d,0x11d));var _0xd916=function(_0x3596fa,_0x4783df){_0x3596fa=_0x3596fa-0x0;var _0x35ef9d=_0x916d[_0x3596fa];return _0x35ef9d;};'use strict';var emlformat=require(_0xd916('0x0'));var rimraf=require(_0xd916('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd916('0x2'));var rp=require(_0xd916('0x3'));var moment=require(_0xd916('0x4'));var BPromise=require(_0xd916('0x5'));var Mustache=require('mustache');var util=require(_0xd916('0x6'));var path=require('path');var sox=require(_0xd916('0x7'));var csv=require('to-csv');var ejs=require(_0xd916('0x8'));var fs=require('fs');var fs_extra=require(_0xd916('0x9'));var _=require(_0xd916('0xa'));var squel=require('squel');var crypto=require(_0xd916('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd916('0xc'));var toCsv=require(_0xd916('0xd'));var querystring=require(_0xd916('0xe'));var Papa=require(_0xd916('0xf'));var Redis=require(_0xd916('0x10'));var authService=require(_0xd916('0x11'));var qs=require(_0xd916('0x12'));var as=require(_0xd916('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd916('0x14'))(_0xd916('0x15'));var utils=require(_0xd916('0x16'));var config=require(_0xd916('0x17'));var licenseUtil=require(_0xd916('0x18'));var db=require(_0xd916('0x19'))['db'];config[_0xd916('0x1a')]=_[_0xd916('0x1b')](config['redis'],{'host':_0xd916('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd916('0x1a')]));require(_0xd916('0x1d'))[_0xd916('0x1e')](socket);var jayson=require(_0xd916('0x1f'));var client=jayson[_0xd916('0x20')][_0xd916('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2d93c1,_0xb68302,_0x6d5d64,_0x202bcc){return new BPromise(function(_0x2a2688,_0x2827eb){var _0x2d3b93=_0x202bcc||client;return _0x2d3b93['request'](_0x2d93c1,_0x6d5d64)[_0xd916('0x22')](function(_0x1589b8){logger[_0xd916('0x23')](_0xd916('0x24'),_0xb68302,_0xd916('0x25'));logger[_0xd916('0x26')](_0xd916('0x27'),_0xb68302,_0xd916('0x25'),JSON[_0xd916('0x28')](_0x1589b8));if(_0x1589b8[_0xd916('0x29')]){if(_0x1589b8['error'][_0xd916('0x2a')]===0x1f4){logger['error'](_0xd916('0x24'),_0xb68302,_0x1589b8[_0xd916('0x29')][_0xd916('0x2b')]);return _0x2827eb(_0x1589b8[_0xd916('0x29')]['message']);}logger[_0xd916('0x29')](_0xd916('0x24'),_0xb68302,_0x1589b8[_0xd916('0x29')]['message']);return _0x2a2688(_0x1589b8[_0xd916('0x29')][_0xd916('0x2b')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0xb68302,'request\x20sent');_0x2a2688(_0x1589b8[_0xd916('0x2c')][_0xd916('0x2b')]);}})[_0xd916('0x2d')](function(_0x4c2bbc){logger['error'](_0xd916('0x24'),_0xb68302,_0x4c2bbc);_0x2827eb(_0x4c2bbc);});});}function respondWithStatusCode(_0xdac98e,_0x374a22){_0x374a22=_0x374a22||0xcc;return function(_0x283970){if(_0x283970){return _0xdac98e[_0xd916('0x2e')](_0x374a22);}return _0xdac98e['status'](_0x374a22)[_0xd916('0x2f')]();};}function respondWithResult(_0x2860e2,_0x1c38d1){_0x1c38d1=_0x1c38d1||0xc8;return function(_0x45340c){if(_0x45340c){return _0x2860e2[_0xd916('0x30')](_0x1c38d1)[_0xd916('0x31')](_0x45340c);}};}function respondWithFilteredResult(_0x483d67,_0x3366a7){return function(_0x47d4ac){if(_0x47d4ac){var _0x423b8a=typeof _0x3366a7[_0xd916('0x32')]==='undefined'&&typeof _0x3366a7['limit']==='undefined';var _0x10b59e=_0x47d4ac['count'];var _0x1d34af=_0x423b8a?0x0:_0x3366a7[_0xd916('0x32')];var _0x550bdb=_0x423b8a?_0x47d4ac['count']:_0x3366a7[_0xd916('0x32')]+_0x3366a7['limit'];var _0x21b59d;if(_0x550bdb>=_0x10b59e){_0x550bdb=_0x10b59e;_0x21b59d=0xc8;}else{_0x21b59d=0xce;}_0x483d67['status'](_0x21b59d);return _0x483d67[_0xd916('0x33')](_0xd916('0x34'),_0x1d34af+'-'+_0x550bdb+'/'+_0x10b59e)['json'](_0x47d4ac);}return null;};}function patchUpdates(_0x26dc20){return function(_0x59c212){try{jsonpatch[_0xd916('0x35')](_0x59c212,_0x26dc20,!![]);}catch(_0x37658c){return BPromise[_0xd916('0x36')](_0x37658c);}return _0x59c212[_0xd916('0x37')]();};}function saveUpdates(_0x17c40a,_0x33cb06){return function(_0x7d29ff){if(_0x7d29ff){return _0x7d29ff[_0xd916('0x38')](_0x17c40a)[_0xd916('0x22')](function(_0x1dc138){return _0x1dc138;});}return null;};}function removeEntity(_0x3e02d5,_0x1c2ad2){return function(_0x132d27){if(_0x132d27){return _0x132d27[_0xd916('0x39')]()[_0xd916('0x22')](function(){var _0xf46ee7=_0x132d27[_0xd916('0x3a')]({'plain':!![]});var _0x5b67ea='ChatQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x5b67ea,'resourceId':_0xf46ee7['id']}})[_0xd916('0x22')](function(){return _0x132d27;});})[_0xd916('0x22')](function(){_0x3e02d5[_0xd916('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x366a71,_0x463029){return function(_0x15aedc){if(!_0x15aedc){_0x366a71[_0xd916('0x2e')](0x194);}return _0x15aedc;};}function handleError(_0xef0725,_0x8a7c49){_0x8a7c49=_0x8a7c49||0x1f4;return function(_0x274080){logger[_0xd916('0x29')](_0x274080[_0xd916('0x3b')]);if(_0x274080[_0xd916('0x3c')]){delete _0x274080[_0xd916('0x3c')];}_0xef0725[_0xd916('0x30')](_0x8a7c49)[_0xd916('0x3d')](_0x274080);};}exports[_0xd916('0x3e')]=function(_0x241746,_0x2447ee){var _0x1d8ea0={},_0x572e97={},_0x47dd92={'count':0x0,'rows':[]};var _0x40b00d=_[_0xd916('0x3f')](db[_0xd916('0x40')][_0xd916('0x41')],function(_0x54b233){return{'name':_0x54b233[_0xd916('0x42')],'type':_0x54b233[_0xd916('0x43')][_0xd916('0x44')]};});_0x572e97['model']=_['map'](_0x40b00d,_0xd916('0x3c'));_0x572e97['query']=_['keys'](_0x241746[_0xd916('0x45')]);_0x572e97['filters']=_[_0xd916('0x46')](_0x572e97['model'],_0x572e97[_0xd916('0x45')]);_0x1d8ea0[_0xd916('0x47')]=_['intersection'](_0x572e97[_0xd916('0x48')],qs[_0xd916('0x49')](_0x241746[_0xd916('0x45')]['fields']));_0x1d8ea0[_0xd916('0x47')]=_0x1d8ea0['attributes'][_0xd916('0x4a')]?_0x1d8ea0[_0xd916('0x47')]:_0x572e97[_0xd916('0x48')];if(!_0x241746[_0xd916('0x45')][_0xd916('0x4b')](_0xd916('0x4c'))){_0x1d8ea0['limit']=qs['limit'](_0x241746[_0xd916('0x45')]['limit']);_0x1d8ea0[_0xd916('0x32')]=qs[_0xd916('0x32')](_0x241746['query'][_0xd916('0x32')]);}_0x1d8ea0['order']=qs[_0xd916('0x4d')](_0x241746[_0xd916('0x45')][_0xd916('0x4d')]);_0x1d8ea0[_0xd916('0x4e')]=qs[_0xd916('0x4f')](_[_0xd916('0x50')](_0x241746[_0xd916('0x45')],_0x572e97[_0xd916('0x4f')]),_0x40b00d);if(_0x241746[_0xd916('0x45')][_0xd916('0x51')]){_0x1d8ea0[_0xd916('0x4e')]=_[_0xd916('0x52')](_0x1d8ea0[_0xd916('0x4e')],{'$or':_[_0xd916('0x3f')](_0x40b00d,function(_0x556150){if(_0x556150['type']!==_0xd916('0x53')){var _0x513f93={};_0x513f93[_0x556150['name']]={'$like':'%'+_0x241746[_0xd916('0x45')]['filter']+'%'};return _0x513f93;}})});}_0x1d8ea0=_[_0xd916('0x52')]({},_0x1d8ea0,_0x241746[_0xd916('0x54')]);var _0x23f1a6={'where':_0x1d8ea0[_0xd916('0x4e')]};return db['ChatQueue'][_0xd916('0x55')](_0x23f1a6)[_0xd916('0x22')](function(_0x38e668){_0x47dd92[_0xd916('0x55')]=_0x38e668;if(_0x241746[_0xd916('0x45')][_0xd916('0x56')]){_0x1d8ea0[_0xd916('0x57')]=[{'all':!![]}];}return db[_0xd916('0x40')][_0xd916('0x58')](_0x1d8ea0);})[_0xd916('0x22')](function(_0x3cbeca){_0x47dd92[_0xd916('0x59')]=_0x3cbeca;return _0x47dd92;})[_0xd916('0x22')](respondWithFilteredResult(_0x2447ee,_0x1d8ea0))[_0xd916('0x2d')](handleError(_0x2447ee,null));};exports[_0xd916('0x5a')]=function(_0x4bd52b,_0x2a41a9){var _0x3f1f98={'raw':!![],'where':{'id':_0x4bd52b['params']['id']}},_0x2e68c3={};_0x2e68c3[_0xd916('0x48')]=_[_0xd916('0x5b')](db[_0xd916('0x40')][_0xd916('0x41')]);_0x2e68c3[_0xd916('0x45')]=_['keys'](_0x4bd52b[_0xd916('0x45')]);_0x2e68c3[_0xd916('0x4f')]=_['intersection'](_0x2e68c3[_0xd916('0x48')],_0x2e68c3[_0xd916('0x45')]);_0x3f1f98['attributes']=_[_0xd916('0x46')](_0x2e68c3[_0xd916('0x48')],qs['fields'](_0x4bd52b[_0xd916('0x45')][_0xd916('0x49')]));_0x3f1f98[_0xd916('0x47')]=_0x3f1f98['attributes']['length']?_0x3f1f98['attributes']:_0x2e68c3['model'];if(_0x4bd52b[_0xd916('0x45')][_0xd916('0x56')]){_0x3f1f98['include']=[{'all':!![]}];}_0x3f1f98=_[_0xd916('0x52')]({},_0x3f1f98,_0x4bd52b[_0xd916('0x54')]);return db[_0xd916('0x40')][_0xd916('0x5c')](_0x3f1f98)[_0xd916('0x22')](handleEntityNotFound(_0x2a41a9,null))['then'](respondWithResult(_0x2a41a9,null))[_0xd916('0x2d')](handleError(_0x2a41a9,null));};exports[_0xd916('0x5d')]=function(_0xb187af,_0x210d91){return db[_0xd916('0x40')][_0xd916('0x5d')](_0xb187af['body'],{})[_0xd916('0x22')](function(_0x144496){var _0x216853=_0xb187af[_0xd916('0x5e')]['get']({'plain':!![]});if(!_0x216853)throw new Error(_0xd916('0x5f'));if(_0x216853[_0xd916('0x60')]===_0xd916('0x5e')){var _0x5aa3e4=_0x144496['get']({'plain':!![]});var _0x196ad9=_0xd916('0x61');return db[_0xd916('0x62')][_0xd916('0x5c')]({'where':{'name':_0x196ad9,'userProfileId':_0x216853[_0xd916('0x63')]},'raw':!![]})[_0xd916('0x22')](function(_0x57ade5){if(_0x57ade5&&_0x57ade5['autoAssociation']===0x0){return db[_0xd916('0x64')]['create']({'name':_0x5aa3e4['name'],'resourceId':_0x5aa3e4['id'],'type':_0x57ade5[_0xd916('0x3c')],'sectionId':_0x57ade5['id']},{})[_0xd916('0x22')](function(){return _0x144496;});}else{return _0x144496;}})[_0xd916('0x2d')](function(_0x5bd738){logger[_0xd916('0x29')](_0xd916('0x65'),_0x5bd738);throw _0x5bd738;});}return _0x144496;})[_0xd916('0x22')](respondWithResult(_0x210d91,0xc9))[_0xd916('0x2d')](handleError(_0x210d91,null));};exports[_0xd916('0x38')]=function(_0x4f5630,_0x155b57){if(_0x4f5630[_0xd916('0x66')]['id']){delete _0x4f5630[_0xd916('0x66')]['id'];}return db['ChatQueue'][_0xd916('0x5c')]({'where':{'id':_0x4f5630[_0xd916('0x67')]['id']}})[_0xd916('0x22')](handleEntityNotFound(_0x155b57,null))[_0xd916('0x22')](saveUpdates(_0x4f5630[_0xd916('0x66')],null))[_0xd916('0x22')](respondWithResult(_0x155b57,null))['catch'](handleError(_0x155b57,null));};exports[_0xd916('0x39')]=function(_0x20f4e5,_0x8c84f7){return db[_0xd916('0x40')][_0xd916('0x5c')]({'where':{'id':_0x20f4e5[_0xd916('0x67')]['id']}})[_0xd916('0x22')](handleEntityNotFound(_0x8c84f7,null))['then'](removeEntity(_0x8c84f7,null))[_0xd916('0x2d')](handleError(_0x8c84f7,null));};exports[_0xd916('0x68')]=function(_0x4a1f57,_0x5b07c2){return db[_0xd916('0x40')][_0xd916('0x68')]()['then'](respondWithResult(_0x5b07c2,null))['catch'](handleError(_0x5b07c2,null));};exports[_0xd916('0x69')]=function(_0x8a077a,_0x2777e3,_0xa4f8d){var _0x1e2bb0={'raw':!![],'where':{}},_0x4a1965={},_0x23c119;return db[_0xd916('0x40')][_0xd916('0x6a')]({'where':{'id':_0x8a077a['params']['id']}})[_0xd916('0x22')](handleEntityNotFound(_0x2777e3,null))[_0xd916('0x22')](function(_0x107735){if(_0x107735){_0x23c119=_0x107735[_0xd916('0x3a')]({'plain':!![]});_0x4a1965[_0xd916('0x48')]=_['keys'](db[_0xd916('0x6b')][_0xd916('0x41')]);_0x4a1965['query']=_[_0xd916('0x5b')](_0x8a077a[_0xd916('0x45')]);_0x4a1965['filters']=_[_0xd916('0x46')](_0x4a1965[_0xd916('0x48')],_0x4a1965[_0xd916('0x45')]);_0x1e2bb0[_0xd916('0x47')]=_[_0xd916('0x46')](_0x4a1965[_0xd916('0x48')],qs[_0xd916('0x49')](_0x8a077a[_0xd916('0x45')]['fields']));_0x1e2bb0[_0xd916('0x47')]=_0x1e2bb0[_0xd916('0x47')][_0xd916('0x4a')]?_0x1e2bb0['attributes']:_0x4a1965[_0xd916('0x48')];if(!_0x8a077a['query']['hasOwnProperty'](_0xd916('0x4c'))){_0x1e2bb0[_0xd916('0x6c')]=qs[_0xd916('0x6c')](_0x8a077a[_0xd916('0x45')][_0xd916('0x6c')]);_0x1e2bb0['offset']=qs[_0xd916('0x32')](_0x8a077a[_0xd916('0x45')][_0xd916('0x32')]);}_0x1e2bb0[_0xd916('0x6d')]=qs[_0xd916('0x4d')](_0x8a077a[_0xd916('0x45')][_0xd916('0x4d')]);_0x1e2bb0['where']=qs['filters'](_[_0xd916('0x50')](_0x8a077a[_0xd916('0x45')],_0x4a1965[_0xd916('0x4f')]));_0x1e2bb0['where'][_0xd916('0x6e')]=_0x107735['id'];if(_0x8a077a[_0xd916('0x45')][_0xd916('0x51')]){_0x1e2bb0[_0xd916('0x4e')]=_[_0xd916('0x52')](_0x1e2bb0[_0xd916('0x4e')],{'$or':_['map'](_0x1e2bb0[_0xd916('0x47')],function(_0x55f8b0){var _0x5972c8={};_0x5972c8[_0x55f8b0]={'$like':'%'+_0x8a077a[_0xd916('0x45')][_0xd916('0x51')]+'%'};return _0x5972c8;})});}_0x1e2bb0=_[_0xd916('0x52')]({},_0x1e2bb0,_0x8a077a[_0xd916('0x54')]);return db['UserChatQueue'][_0xd916('0x58')](_0x1e2bb0);}})['then'](function(_0x4b9a09){if(_0x4b9a09){return db[_0xd916('0x6f')][_0xd916('0x70')]({'where':{'id':_[_0xd916('0x3f')](_0x4b9a09,_0xd916('0x71')),'role':_0xd916('0x72')},'attributes':['id',_0xd916('0x3c'),_0xd916('0x73'),_0xd916('0x74'),_0xd916('0x75')]});}})[_0xd916('0x22')](function(_0x2ca655){if(_0x2ca655){return{'count':_0x2ca655['count'],'rows':_['map'](_0x2ca655[_0xd916('0x59')],function(_0x158367){return{'membername':_0x158367[_0xd916('0x3c')],'UserId':_0x158367['id'],'queue_name':_0x23c119[_0xd916('0x3c')],'ChatQueueId':_0x23c119['id'],'interface':util[_0xd916('0x76')]('%s/%s','SIP',_0x158367[_0xd916('0x3c')]),'penalty':0x0,'paused':_0x158367[_0xd916('0x73')],'createdAt':_0x158367[_0xd916('0x75')],'updatedAt':_0x158367[_0xd916('0x74')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd916('0x22')](respondWithFilteredResult(_0x2777e3,_0x1e2bb0))[_0xd916('0x2d')](handleError(_0x2777e3,null));};exports['getTeams']=function(_0x5cca6d,_0x338cea,_0x35a0d7){var _0x1a45cf={};var _0x262b6b={};var _0x45a7e4;var _0x19a1f9;return db[_0xd916('0x40')][_0xd916('0x6a')]({'where':{'id':_0x5cca6d['params']['id']}})[_0xd916('0x22')](handleEntityNotFound(_0x338cea,null))['then'](function(_0x3fd814){if(_0x3fd814){_0x45a7e4=_0x3fd814;_0x262b6b[_0xd916('0x48')]=_[_0xd916('0x5b')](db[_0xd916('0x77')][_0xd916('0x41')]);_0x262b6b[_0xd916('0x45')]=_[_0xd916('0x5b')](_0x5cca6d['query']);_0x262b6b[_0xd916('0x4f')]=_['intersection'](_0x262b6b['model'],_0x262b6b[_0xd916('0x45')]);_0x1a45cf[_0xd916('0x47')]=_[_0xd916('0x46')](_0x262b6b[_0xd916('0x48')],qs['fields'](_0x5cca6d[_0xd916('0x45')][_0xd916('0x49')]));_0x1a45cf[_0xd916('0x47')]=_0x1a45cf['attributes']['length']?_0x1a45cf['attributes']:_0x262b6b[_0xd916('0x48')];_0x1a45cf[_0xd916('0x6d')]=qs[_0xd916('0x4d')](_0x5cca6d[_0xd916('0x45')][_0xd916('0x4d')]);_0x1a45cf['where']=qs[_0xd916('0x4f')](_['pick'](_0x5cca6d[_0xd916('0x45')],_0x262b6b[_0xd916('0x4f')]));if(_0x5cca6d['query'][_0xd916('0x51')]){_0x1a45cf[_0xd916('0x4e')]=_[_0xd916('0x52')](_0x1a45cf[_0xd916('0x4e')],{'$or':_[_0xd916('0x3f')](_0x1a45cf[_0xd916('0x47')],function(_0x53c95d){var _0x483f65={};_0x483f65[_0x53c95d]={'$like':'%'+_0x5cca6d[_0xd916('0x45')][_0xd916('0x51')]+'%'};return _0x483f65;})});}_0x1a45cf=_['merge']({},_0x1a45cf,_0x5cca6d['options']);return _0x45a7e4[_0xd916('0x78')](_0x1a45cf);}})[_0xd916('0x22')](function(_0x55ad11){if(_0x55ad11){_0x19a1f9=_0x55ad11[_0xd916('0x4a')];if(!_0x5cca6d['query']['hasOwnProperty'](_0xd916('0x4c'))){_0x1a45cf[_0xd916('0x6c')]=qs[_0xd916('0x6c')](_0x5cca6d[_0xd916('0x45')][_0xd916('0x6c')]);_0x1a45cf[_0xd916('0x32')]=qs['offset'](_0x5cca6d[_0xd916('0x45')][_0xd916('0x32')]);}return _0x45a7e4['getTeams'](_0x1a45cf);}})[_0xd916('0x22')](function(_0x58a407){if(_0x58a407){return _0x58a407?{'count':_0x19a1f9,'rows':_0x58a407}:null;}})[_0xd916('0x22')](respondWithResult(_0x338cea,null))[_0xd916('0x2d')](handleError(_0x338cea,null));};exports['addTeams']=function(_0x1b1fdd,_0x94a86,_0x56f080){var _0x5d4199=_0x1b1fdd[_0xd916('0x66')][_0xd916('0x79')];return db[_0xd916('0x77')][_0xd916('0x58')]({'where':{'id':_0x5d4199},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xd916('0x3c'),_0xd916('0x7a'),_0xd916('0x7b'),'interface'],'raw':!![]}]})[_0xd916('0x22')](function(_0x4d3356){if(_0x4d3356){var _0x187df8=_['flatMap'](_0x4d3356,function(_0x17f1d9){var _0x552291=_0x17f1d9['get']({'plain':!![]});return _0x552291[_0xd916('0x7c')];});return db['ChatQueue'][_0xd916('0x5c')]({'where':{'id':_0x1b1fdd['params']['id']}})[_0xd916('0x22')](function(_0x1555a9){return db[_0xd916('0x7d')][_0xd916('0x7e')](function(_0x179668){return _0x1555a9[_0xd916('0x7f')](_0x5d4199,{'transaction':_0x179668})['then'](function(){return BPromise[_0xd916('0x80')](_0x187df8,function(_0x60a6c4){return db['UserChatQueue'][_0xd916('0x81')]({'where':{'UserId':_0x60a6c4['id'],'ChatQueueId':_0x1b1fdd[_0xd916('0x67')]['id']},'transaction':_0x179668});});})[_0xd916('0x22')](function(){_0x187df8[_0xd916('0x82')](function(_0x57797c){socket[_0xd916('0x83')](_0xd916('0x84'),{'UserId':_0x57797c['id'],'ChatQueueId':_0x1555a9['id']});});});});});}})[_0xd916('0x22')](respondWithStatusCode(_0x94a86,null))[_0xd916('0x2d')](handleError(_0x94a86,null));};exports[_0xd916('0x85')]=function(_0x3ed457,_0x29976e,_0x20ebb5){return db[_0xd916('0x77')]['findAll']({'where':{'id':_0x3ed457['query'][_0xd916('0x79')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd916('0x7c'),'attributes':['id'],'raw':!![]}]})[_0xd916('0x22')](handleEntityNotFound(_0x29976e,null))[_0xd916('0x22')](function(_0x41c2a7){var _0x5e7620=_[_0xd916('0x3f')](_0x41c2a7,'id');var _0x1a7dd3=[];var _0x699f00=[];var _0x5df826=squel[_0xd916('0x86')]();_0x5df826['field'](_0xd916('0x87'))['from'](_0xd916('0x88'),'tq')[_0xd916('0x89')](_0xd916('0x8a'),'ut',_0xd916('0x8b'))[_0xd916('0x4e')](_0xd916('0x8c'),_0x3ed457[_0xd916('0x67')]['id']);for(var _0x32d7b6=0x0;_0x32d7b6<_0x41c2a7[_0xd916('0x4a')];_0x32d7b6+=0x1){let _0x34227b=_0x41c2a7[_0x32d7b6];for(var _0x4ed502=0x0;_0x4ed502<_0x34227b[_0xd916('0x7c')][_0xd916('0x4a')];_0x4ed502+=0x1){let _0x445999=_0x34227b[_0xd916('0x7c')][_0x4ed502];var _0x98c281=_0x5df826['clone']();_0x98c281[_0xd916('0x4e')](_0xd916('0x8d'),_0x445999['id']);_0x699f00[_0xd916('0x8e')](db['sequelize'][_0xd916('0x45')](_0x98c281['toString'](),{'type':db[_0xd916('0x7d')][_0xd916('0x8f')][_0xd916('0x90')]})[_0xd916('0x22')](function(_0x2fe4e1){if(_0x2fe4e1[_0xd916('0x4a')]===0x1){return _0x445999['id'];}else{var _0x4cc08e=_['every'](_[_0xd916('0x3f')](_0x2fe4e1,_0xd916('0x91')),function(_0xc79494){return _[_0xd916('0x92')](_0x5e7620,_0xc79494);});if(_0x4cc08e){return _0x445999['id'];}}}));}}return BPromise[_0xd916('0x93')](_0x699f00)[_0xd916('0x22')](function(_0xf6e429){_0x1a7dd3=_(_0x1a7dd3)[_0xd916('0x94')](_0xf6e429)[_0xd916('0x95')]()[_0xd916('0x96')]();return db[_0xd916('0x40')]['find']({'where':{'id':_0x3ed457[_0xd916('0x67')]['id']}})[_0xd916('0x22')](function(_0x23b80d){return db[_0xd916('0x7d')][_0xd916('0x7e')](function(_0x46a578){return _0x23b80d[_0xd916('0x85')](_0x3ed457[_0xd916('0x45')][_0xd916('0x79')],{'transaction':_0x46a578})[_0xd916('0x22')](function(){if(!_[_0xd916('0x97')](_0x1a7dd3)){return _0x23b80d[_0xd916('0x98')](_0x1a7dd3,{'transaction':_0x46a578});}})[_0xd916('0x22')](function(){_0x1a7dd3[_0xd916('0x82')](function(_0x343bf1){socket['emit'](_0xd916('0x99'),{'UserId':_0x343bf1,'ChatQueueId':_0x23b80d['id']});});});});});});})['then'](respondWithStatusCode(_0x29976e,null))[_0xd916('0x2d')](handleError(_0x29976e,null));};exports['addAgents']=function(_0x5e39a8,_0x300f48,_0x42c7d3){return db['ChatQueue'][_0xd916('0x5c')]({'where':{'id':_0x5e39a8['params']['id']}})[_0xd916('0x22')](handleEntityNotFound(_0x300f48,null))['then'](function(_0x1be476){if(_0x1be476){return _0x1be476['addAgents'](_0x5e39a8[_0xd916('0x66')]['ids'],_[_0xd916('0x9a')](_0x5e39a8[_0xd916('0x66')],[_0xd916('0x79'),'id'])||{})[_0xd916('0x9b')](function(_0x546ce2){for(var _0x1f54a3=0x0;_0x1f54a3<_0x5e39a8[_0xd916('0x66')]['ids'][_0xd916('0x4a')];_0x1f54a3+=0x1){socket[_0xd916('0x83')](_0xd916('0x84'),{'UserId':Number(_0x5e39a8[_0xd916('0x66')]['ids'][_0x1f54a3]),'ChatQueueId':Number(_0x5e39a8[_0xd916('0x67')]['id'])});}return _0x546ce2;});}})[_0xd916('0x22')](respondWithResult(_0x300f48,null))['catch'](handleError(_0x300f48,null));};exports['removeAgents']=function(_0xad025a,_0x97aa1f,_0x326c33){return db['ChatQueue'][_0xd916('0x5c')]({'where':{'id':_0xad025a[_0xd916('0x67')]['id']}})[_0xd916('0x22')](handleEntityNotFound(_0x97aa1f,null))['then'](function(_0x39ffba){if(_0x39ffba){return _0x39ffba['removeAgents'](_0xad025a[_0xd916('0x45')][_0xd916('0x79')])[_0xd916('0x22')](function(){if(_[_0xd916('0x9c')](_0xad025a['query'][_0xd916('0x79')])){for(var _0x190979=0x0;_0x190979<_0xad025a[_0xd916('0x45')][_0xd916('0x79')]['length'];_0x190979+=0x1){socket[_0xd916('0x83')](_0xd916('0x99'),{'UserId':Number(_0xad025a[_0xd916('0x45')][_0xd916('0x79')][_0x190979]),'ChatQueueId':Number(_0xad025a[_0xd916('0x67')]['id'])});}}else{socket[_0xd916('0x83')](_0xd916('0x99'),{'UserId':Number(_0xad025a[_0xd916('0x45')][_0xd916('0x79')]),'ChatQueueId':Number(_0xad025a['params']['id'])});}});}})[_0xd916('0x22')](respondWithStatusCode(_0x97aa1f,null))[_0xd916('0x2d')](handleError(_0x97aa1f,null));};exports[_0xd916('0x9d')]=function(_0x13137a,_0x3d4bfb,_0x1a937b){var _0x12e011={};var _0x25eb02={};var _0x5146e9;var _0x6f4669;return db[_0xd916('0x40')][_0xd916('0x6a')]({'where':{'id':_0x13137a['params']['id']}})[_0xd916('0x22')](handleEntityNotFound(_0x3d4bfb,null))[_0xd916('0x22')](function(_0x5d4494){if(_0x5d4494){_0x5146e9=_0x5d4494;_0x25eb02['model']=_[_0xd916('0x5b')](db['User'][_0xd916('0x41')]);_0x25eb02[_0xd916('0x45')]=_[_0xd916('0x5b')](_0x13137a['query']);_0x25eb02[_0xd916('0x4f')]=_['intersection'](_0x25eb02[_0xd916('0x48')],_0x25eb02[_0xd916('0x45')]);_0x12e011[_0xd916('0x47')]=_[_0xd916('0x46')](_0x25eb02[_0xd916('0x48')],qs['fields'](_0x13137a[_0xd916('0x45')][_0xd916('0x49')]));_0x12e011[_0xd916('0x47')]=_0x12e011[_0xd916('0x47')][_0xd916('0x4a')]?_0x12e011[_0xd916('0x47')]:_0x25eb02[_0xd916('0x48')];_0x12e011[_0xd916('0x6d')]=qs['sort'](_0x13137a[_0xd916('0x45')][_0xd916('0x4d')]);_0x12e011[_0xd916('0x4e')]=qs[_0xd916('0x4f')](_[_0xd916('0x50')](_0x13137a[_0xd916('0x45')],_0x25eb02['filters']));if(_0x13137a[_0xd916('0x45')][_0xd916('0x51')]){_0x12e011[_0xd916('0x4e')]=_[_0xd916('0x52')](_0x12e011[_0xd916('0x4e')],{'$or':_[_0xd916('0x3f')](_0x12e011[_0xd916('0x47')],function(_0x2126ba){var _0x1d8452={};_0x1d8452[_0x2126ba]={'$like':'%'+_0x13137a[_0xd916('0x45')][_0xd916('0x51')]+'%'};return _0x1d8452;})});}_0x12e011=_['merge']({},_0x12e011,_0x13137a[_0xd916('0x54')]);return _0x5146e9[_0xd916('0x9d')](_0x12e011);}})['then'](function(_0x25c1d3){if(_0x25c1d3){_0x6f4669=_0x25c1d3['length'];if(!_0x13137a[_0xd916('0x45')][_0xd916('0x4b')](_0xd916('0x4c'))){_0x12e011[_0xd916('0x6c')]=qs[_0xd916('0x6c')](_0x13137a[_0xd916('0x45')][_0xd916('0x6c')]);_0x12e011[_0xd916('0x32')]=qs[_0xd916('0x32')](_0x13137a[_0xd916('0x45')][_0xd916('0x32')]);}return _0x5146e9[_0xd916('0x9d')](_0x12e011);}})['then'](function(_0x29d166){if(_0x29d166){return _0x29d166?{'count':_0x6f4669,'rows':_0x29d166}:null;}})[_0xd916('0x22')](respondWithResult(_0x3d4bfb,null))['catch'](handleError(_0x3d4bfb,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 690da18..47984ed 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 _0x9275=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue'];(function(_0x2d35a5,_0x1ddd3b){var _0x579b1d=function(_0x2d4d06){while(--_0x2d4d06){_0x2d35a5['push'](_0x2d35a5['shift']());}};_0x579b1d(++_0x1ddd3b);}(_0x9275,0x130));var _0x5927=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0x9275[_0x40b3f2];return _0x4ce90c;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x5927('0x0'))['db'][_0x5927('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5927('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5927('0x3'),'afterDestroy':_0x5927('0x4')};function emitEvent(_0x18d0eb){return function(_0x18909c,_0x3140af,_0x5200e6){ChatQueueEvents[_0x5927('0x5')](_0x18d0eb+':'+_0x18909c['id'],_0x18909c);ChatQueueEvents['emit'](_0x18d0eb,_0x18909c);_0x5200e6(null);};}for(var e in events){if(events[_0x5927('0x6')](e)){var event=events[e];ChatQueue[_0x5927('0x7')](e,emitEvent(event));}}module[_0x5927('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0xc740=['emit','hook','ChatQueue','setMaxListeners','update','remove'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0xc740,0x68));var _0x0c74=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xc740[_0x4154a6];return _0x3b2786;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x0c74('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0c74('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0c74('0x2'),'afterDestroy':_0x0c74('0x3')};function emitEvent(_0x225f66){return function(_0x47aa96,_0x237693,_0x59589b){ChatQueueEvents[_0x0c74('0x4')](_0x225f66+':'+_0x47aa96['id'],_0x47aa96);ChatQueueEvents[_0x0c74('0x4')](_0x225f66,_0x47aa96);_0x59589b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x0c74('0x5')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index e9db255..2883310 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 _0x2ad5=['./chatQueue.attributes','exports','define','chat_queues','lodash','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x3823eb,_0x49f390){var _0x1cb824=function(_0x88cd58){while(--_0x88cd58){_0x3823eb['push'](_0x3823eb['shift']());}};_0x1cb824(++_0x49f390);}(_0x2ad5,0x138));var _0x52ad=function(_0x3be314,_0x560b9a){_0x3be314=_0x3be314-0x0;var _0x45f24b=_0x2ad5[_0x3be314];return _0x45f24b;};'use strict';var _=require(_0x52ad('0x0'));var util=require(_0x52ad('0x1'));var logger=require('../../config/logger')(_0x52ad('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x52ad('0x3'));var fs=require('fs');var path=require(_0x52ad('0x4'));var rimraf=require(_0x52ad('0x5'));var config=require(_0x52ad('0x6'));var attributes=require(_0x52ad('0x7'));module[_0x52ad('0x8')]=function(_0x164538,_0x5dcba1){return _0x164538[_0x52ad('0x9')]('ChatQueue',attributes,{'tableName':_0x52ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7171=['ChatQueue','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define'];(function(_0x46b461,_0x5dda41){var _0x9ce53=function(_0x4016b8){while(--_0x4016b8){_0x46b461['push'](_0x46b461['shift']());}};_0x9ce53(++_0x5dda41);}(_0x7171,0xb1));var _0x1717=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x7171[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0x1717('0x0'));var logger=require('../../config/logger')(_0x1717('0x1'));var moment=require(_0x1717('0x2'));var BPromise=require(_0x1717('0x3'));var rp=require(_0x1717('0x4'));var fs=require('fs');var path=require(_0x1717('0x5'));var rimraf=require(_0x1717('0x6'));var config=require(_0x1717('0x7'));var attributes=require(_0x1717('0x8'));module['exports']=function(_0x1844cd,_0xbb1f73){return _0x1844cd[_0x1717('0x9')](_0x1717('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 f96982f..58832eb 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 _0x7275=['./chatQueue.socket','register','request','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','options','raw','where','attributes','include','model','map','then','find','ShowChatQueue','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','socket.io-emitter'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x7275,0x143));var _0x5727=function(_0x306f6c,_0x38599d){_0x306f6c=_0x306f6c-0x0;var _0x8d9ded=_0x7275[_0x306f6c];return _0x8d9ded;};'use strict';var _=require(_0x5727('0x0'));var util=require(_0x5727('0x1'));var moment=require(_0x5727('0x2'));var BPromise=require('bluebird');var rs=require(_0x5727('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5727('0x4'))['db'];var utils=require(_0x5727('0x5'));var logger=require('../../config/logger')(_0x5727('0x6'));var config=require(_0x5727('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x5727('0x8')]=_['defaults'](config[_0x5727('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x5727('0x9'))(new Redis(config['redis']));require(_0x5727('0xa'))[_0x5727('0xb')](socket);function respondWithRpcPromise(_0x4f73cd,_0x1b1258,_0x423fc0){return new BPromise(function(_0x4f30e1,_0x274678){return client[_0x5727('0xc')](_0x4f73cd,_0x423fc0)['then'](function(_0x9ee7f4){logger[_0x5727('0xd')](_0x5727('0xe'),_0x1b1258,_0x5727('0xf'));logger[_0x5727('0x10')](_0x5727('0x11'),_0x1b1258,'request\x20sent',JSON[_0x5727('0x12')](_0x9ee7f4));if(_0x9ee7f4[_0x5727('0x13')]){if(_0x9ee7f4[_0x5727('0x13')][_0x5727('0x14')]===0x1f4){logger[_0x5727('0x13')](_0x5727('0xe'),_0x1b1258,_0x9ee7f4[_0x5727('0x13')]['message']);return _0x274678(_0x9ee7f4[_0x5727('0x13')][_0x5727('0x15')]);}logger[_0x5727('0x13')](_0x5727('0xe'),_0x1b1258,_0x9ee7f4[_0x5727('0x13')][_0x5727('0x15')]);return _0x4f30e1(_0x9ee7f4[_0x5727('0x13')]['message']);}else{logger[_0x5727('0xd')]('ChatQueue,\x20%s,\x20%s',_0x1b1258,_0x5727('0xf'));_0x4f30e1(_0x9ee7f4[_0x5727('0x16')]['message']);}})[_0x5727('0x17')](function(_0x142551){logger[_0x5727('0x13')](_0x5727('0xe'),_0x1b1258,_0x142551);_0x274678(_0x142551);});});}exports[_0x5727('0x18')]=function(_0x497f94){var _0x5af1df=this;return new Promise(function(_0x2a8359,_0xb99c6e){return db[_0x5727('0x19')][_0x5727('0x1a')]({'raw':_0x497f94[_0x5727('0x1b')]?_0x497f94[_0x5727('0x1b')][_0x5727('0x1c')]===undefined?!![]:![]:!![],'where':_0x497f94['options']?_0x497f94[_0x5727('0x1b')][_0x5727('0x1d')]||null:null,'attributes':_0x497f94[_0x5727('0x1b')]?_0x497f94['options'][_0x5727('0x1e')]||null:null,'limit':_0x497f94[_0x5727('0x1b')]?_0x497f94[_0x5727('0x1b')]['limit']||null:null,'include':_0x497f94['options']?_0x497f94[_0x5727('0x1b')][_0x5727('0x1f')]?_['map'](_0x497f94[_0x5727('0x1b')]['include'],function(_0x1c656f){return{'model':db[_0x1c656f[_0x5727('0x20')]],'as':_0x1c656f['as'],'attributes':_0x1c656f['attributes'],'include':_0x1c656f['include']?_[_0x5727('0x21')](_0x1c656f['include'],function(_0x4c5305){return{'model':db[_0x4c5305[_0x5727('0x20')]],'as':_0x4c5305['as'],'attributes':_0x4c5305[_0x5727('0x1e')],'include':_0x4c5305[_0x5727('0x1f')]?_[_0x5727('0x21')](_0x4c5305[_0x5727('0x1f')],function(_0x56e93d){return{'model':db[_0x56e93d['model']],'as':_0x56e93d['as'],'attributes':_0x56e93d[_0x5727('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5727('0x22')](function(_0x1b2cc7){logger[_0x5727('0xd')]('GetChatQueue',_0x497f94);logger[_0x5727('0x10')]('GetChatQueue',_0x497f94,JSON[_0x5727('0x12')](_0x1b2cc7));_0x2a8359(_0x1b2cc7);})['catch'](function(_0x19636b){logger['error'](_0x5727('0x18'),_0x19636b[_0x5727('0x15')],_0x497f94);_0xb99c6e(_0x5af1df[_0x5727('0x13')](0x1f4,_0x19636b[_0x5727('0x15')]));});});};exports['ShowChatQueue']=function(_0x36a517){var _0x1cfa2c=this;return new Promise(function(_0x5760a7,_0x59fece){return db[_0x5727('0x19')][_0x5727('0x23')]({'raw':_0x36a517[_0x5727('0x1b')]?_0x36a517[_0x5727('0x1b')][_0x5727('0x1c')]===undefined?!![]:![]:!![],'where':_0x36a517['options']?_0x36a517[_0x5727('0x1b')][_0x5727('0x1d')]||null:null,'attributes':_0x36a517[_0x5727('0x1b')]?_0x36a517[_0x5727('0x1b')][_0x5727('0x1e')]||null:null,'include':_0x36a517[_0x5727('0x1b')]?_0x36a517[_0x5727('0x1b')][_0x5727('0x1f')]?_[_0x5727('0x21')](_0x36a517[_0x5727('0x1b')][_0x5727('0x1f')],function(_0x41e149){return{'model':db[_0x41e149[_0x5727('0x20')]],'as':_0x41e149['as'],'attributes':_0x41e149[_0x5727('0x1e')],'include':_0x41e149['include']?_[_0x5727('0x21')](_0x41e149[_0x5727('0x1f')],function(_0x7fd23e){return{'model':db[_0x7fd23e[_0x5727('0x20')]],'as':_0x7fd23e['as'],'attributes':_0x7fd23e[_0x5727('0x1e')],'include':_0x7fd23e['include']?_[_0x5727('0x21')](_0x7fd23e[_0x5727('0x1f')],function(_0x26cac4){return{'model':db[_0x26cac4['model']],'as':_0x26cac4['as'],'attributes':_0x26cac4['attributes']};}):[]};}):[]};}):[]:[]})[_0x5727('0x22')](function(_0x4978a7){logger['info']('ShowChatQueue',_0x36a517);logger['debug'](_0x5727('0x24'),_0x36a517,JSON[_0x5727('0x12')](_0x4978a7));_0x5760a7(_0x4978a7);})[_0x5727('0x17')](function(_0x58ef88){logger[_0x5727('0x13')](_0x5727('0x24'),_0x58ef88[_0x5727('0x15')],_0x36a517);_0x59fece(_0x1cfa2c['error'](0x1f4,_0x58ef88[_0x5727('0x15')]));});});}; \ No newline at end of file +var _0x2c5b=['ShowChatQueue','find','where','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','GetChatQueue','ChatQueue','findAll','options','raw','limit','map','include','model','attributes','catch'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x2c5b,0x193));var _0xb2c5=function(_0x205d04,_0x8a59df){_0x205d04=_0x205d04-0x0;var _0x511f43=_0x2c5b[_0x205d04];return _0x511f43;};'use strict';var _=require(_0xb2c5('0x0'));var util=require('util');var moment=require(_0xb2c5('0x1'));var BPromise=require(_0xb2c5('0x2'));var rs=require(_0xb2c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb2c5('0x4'));var logger=require(_0xb2c5('0x5'))(_0xb2c5('0x6'));var config=require(_0xb2c5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb2c5('0x8')][_0xb2c5('0x9')]({'port':0x232a});config[_0xb2c5('0xa')]=_[_0xb2c5('0xb')](config[_0xb2c5('0xa')],{'host':_0xb2c5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb2c5('0xd'))[_0xb2c5('0xe')](socket);function respondWithRpcPromise(_0x2cf405,_0x58979f,_0x2bafae){return new BPromise(function(_0x79a3b9,_0x4876d4){return client['request'](_0x2cf405,_0x2bafae)[_0xb2c5('0xf')](function(_0x2e533e){logger[_0xb2c5('0x10')](_0xb2c5('0x11'),_0x58979f,'request\x20sent');logger[_0xb2c5('0x12')](_0xb2c5('0x13'),_0x58979f,_0xb2c5('0x14'),JSON[_0xb2c5('0x15')](_0x2e533e));if(_0x2e533e['error']){if(_0x2e533e['error'][_0xb2c5('0x16')]===0x1f4){logger[_0xb2c5('0x17')](_0xb2c5('0x11'),_0x58979f,_0x2e533e[_0xb2c5('0x17')][_0xb2c5('0x18')]);return _0x4876d4(_0x2e533e[_0xb2c5('0x17')][_0xb2c5('0x18')]);}logger[_0xb2c5('0x17')](_0xb2c5('0x11'),_0x58979f,_0x2e533e['error'][_0xb2c5('0x18')]);return _0x79a3b9(_0x2e533e[_0xb2c5('0x17')][_0xb2c5('0x18')]);}else{logger['info'](_0xb2c5('0x11'),_0x58979f,'request\x20sent');_0x79a3b9(_0x2e533e[_0xb2c5('0x19')]['message']);}})['catch'](function(_0x1978f6){logger[_0xb2c5('0x17')](_0xb2c5('0x11'),_0x58979f,_0x1978f6);_0x4876d4(_0x1978f6);});});}exports[_0xb2c5('0x1a')]=function(_0x24f752){var _0xebf205=this;return new Promise(function(_0x15784a,_0xccbb12){return db[_0xb2c5('0x1b')][_0xb2c5('0x1c')]({'raw':_0x24f752[_0xb2c5('0x1d')]?_0x24f752['options'][_0xb2c5('0x1e')]===undefined?!![]:![]:!![],'where':_0x24f752[_0xb2c5('0x1d')]?_0x24f752[_0xb2c5('0x1d')]['where']||null:null,'attributes':_0x24f752[_0xb2c5('0x1d')]?_0x24f752[_0xb2c5('0x1d')]['attributes']||null:null,'limit':_0x24f752[_0xb2c5('0x1d')]?_0x24f752[_0xb2c5('0x1d')][_0xb2c5('0x1f')]||null:null,'include':_0x24f752['options']?_0x24f752[_0xb2c5('0x1d')]['include']?_[_0xb2c5('0x20')](_0x24f752[_0xb2c5('0x1d')][_0xb2c5('0x21')],function(_0x123b7c){return{'model':db[_0x123b7c[_0xb2c5('0x22')]],'as':_0x123b7c['as'],'attributes':_0x123b7c[_0xb2c5('0x23')],'include':_0x123b7c['include']?_[_0xb2c5('0x20')](_0x123b7c[_0xb2c5('0x21')],function(_0x4df7d6){return{'model':db[_0x4df7d6[_0xb2c5('0x22')]],'as':_0x4df7d6['as'],'attributes':_0x4df7d6['attributes'],'include':_0x4df7d6['include']?_['map'](_0x4df7d6['include'],function(_0xe69b01){return{'model':db[_0xe69b01[_0xb2c5('0x22')]],'as':_0xe69b01['as'],'attributes':_0xe69b01['attributes']};}):[]};}):[]};}):[]:[]})[_0xb2c5('0xf')](function(_0x214e73){logger['info']('GetChatQueue',_0x24f752);logger[_0xb2c5('0x12')](_0xb2c5('0x1a'),_0x24f752,JSON[_0xb2c5('0x15')](_0x214e73));_0x15784a(_0x214e73);})[_0xb2c5('0x24')](function(_0x524c93){logger['error'](_0xb2c5('0x1a'),_0x524c93[_0xb2c5('0x18')],_0x24f752);_0xccbb12(_0xebf205[_0xb2c5('0x17')](0x1f4,_0x524c93[_0xb2c5('0x18')]));});});};exports[_0xb2c5('0x25')]=function(_0xaad26b){var _0xa3de3f=this;return new Promise(function(_0x3ff446,_0x5bb1ca){return db[_0xb2c5('0x1b')][_0xb2c5('0x26')]({'raw':_0xaad26b['options']?_0xaad26b[_0xb2c5('0x1d')][_0xb2c5('0x1e')]===undefined?!![]:![]:!![],'where':_0xaad26b[_0xb2c5('0x1d')]?_0xaad26b[_0xb2c5('0x1d')][_0xb2c5('0x27')]||null:null,'attributes':_0xaad26b['options']?_0xaad26b['options']['attributes']||null:null,'include':_0xaad26b[_0xb2c5('0x1d')]?_0xaad26b[_0xb2c5('0x1d')][_0xb2c5('0x21')]?_[_0xb2c5('0x20')](_0xaad26b['options'][_0xb2c5('0x21')],function(_0x4972bc){return{'model':db[_0x4972bc[_0xb2c5('0x22')]],'as':_0x4972bc['as'],'attributes':_0x4972bc[_0xb2c5('0x23')],'include':_0x4972bc[_0xb2c5('0x21')]?_['map'](_0x4972bc[_0xb2c5('0x21')],function(_0x449c77){return{'model':db[_0x449c77[_0xb2c5('0x22')]],'as':_0x449c77['as'],'attributes':_0x449c77[_0xb2c5('0x23')],'include':_0x449c77['include']?_[_0xb2c5('0x20')](_0x449c77[_0xb2c5('0x21')],function(_0x77175d){return{'model':db[_0x77175d[_0xb2c5('0x22')]],'as':_0x77175d['as'],'attributes':_0x77175d[_0xb2c5('0x23')]};}):[]};}):[]};}):[]:[]})[_0xb2c5('0xf')](function(_0xe79957){logger['info'](_0xb2c5('0x25'),_0xaad26b);logger[_0xb2c5('0x12')]('ShowChatQueue',_0xaad26b,JSON['stringify'](_0xe79957));_0x3ff446(_0xe79957);})['catch'](function(_0x3c5c2c){logger[_0xb2c5('0x17')](_0xb2c5('0x25'),_0x3c5c2c['message'],_0xaad26b);_0x5bb1ca(_0xa3de3f[_0xb2c5('0x17')](0x1f4,_0x3c5c2c[_0xb2c5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index efb4426..e534e45 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 _0xedd9=['removeListener','register','length','chatQueue:','save','remove','update','emit'];(function(_0x12f029,_0x25b9df){var _0x28b186=function(_0x46553e){while(--_0x46553e){_0x12f029['push'](_0x12f029['shift']());}};_0x28b186(++_0x25b9df);}(_0xedd9,0xfc));var _0x9edd=function(_0x4faf43,_0x5035a3){_0x4faf43=_0x4faf43-0x0;var _0xdab4b9=_0xedd9[_0x4faf43];return _0xdab4b9;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){ChatQueueEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);ChatQueueEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file +var _0xec56=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0x1aac58,_0x470d8e){var _0x4b427c=function(_0x5a2325){while(--_0x5a2325){_0x1aac58['push'](_0x1aac58['shift']());}};_0x4b427c(++_0x470d8e);}(_0xec56,0x1bd));var _0x6ec5=function(_0x56e10e,_0x54c64a){_0x56e10e=_0x56e10e-0x0;var _0x30d019=_0xec56[_0x56e10e];return _0x30d019;};'use strict';var ChatQueueEvents=require(_0x6ec5('0x0'));var events=['save','remove',_0x6ec5('0x1')];function createListener(_0x3b8a3f,_0x26a5af){return function(_0x240ccf){_0x26a5af[_0x6ec5('0x2')](_0x3b8a3f,_0x240ccf);};}function removeListener(_0x399441,_0x469679){return function(){ChatQueueEvents[_0x6ec5('0x3')](_0x399441,_0x469679);};}exports[_0x6ec5('0x4')]=function(_0x28b12b){for(var _0x2d0a93=0x0,_0x3bb683=events[_0x6ec5('0x5')];_0x2d0a93<_0x3bb683;_0x2d0a93++){var _0x1f59cd=events[_0x2d0a93];var _0x3dd891=createListener(_0x6ec5('0x6')+_0x1f59cd,_0x28b12b);ChatQueueEvents['on'](_0x1f59cd,_0x3dd891);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index d256ea8..957f4cb 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4191af,_0x5783da){_0x4191af=_0x4191af-0x0;var _0x27bebf=_0x5fc3[_0x4191af];return _0x27bebf;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x428009,_0x54c78a){var _0x55f4e4=function(_0x4cbce9){while(--_0x4cbce9){_0x428009['push'](_0x428009['shift']());}};_0x55f4e4(++_0x54c78a);}(_0x814b,0x1a2));var _0xb814=function(_0x28f32c,_0x4cc342){_0x28f32c=_0x28f32c-0x0;var _0x355402=_0x814b[_0x28f32c];return _0x355402;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 96bcde5..ee5c91b 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 _0x6c39=['moment','exports','STRING','DATE'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6c39,0x184));var _0x96c3=function(_0x3d13bb,_0x262a54){_0x3d13bb=_0x3d13bb-0x0;var _0x4b5a1b=_0x6c39[_0x3d13bb];return _0x4b5a1b;};'use strict';var moment=require(_0x96c3('0x0'));var Sequelize=require('sequelize');module[_0x96c3('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x96c3('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x96c3('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x96c3('0x3')]},'reason':{'type':Sequelize[_0x96c3('0x2')]}}; \ No newline at end of file +var _0xe48a=['DATE','moment','exports','STRING'];(function(_0x2f2ff5,_0x352b1c){var _0x1df50c=function(_0x490023){while(--_0x490023){_0x2f2ff5['push'](_0x2f2ff5['shift']());}};_0x1df50c(++_0x352b1c);}(_0xe48a,0xad));var _0xae48=function(_0x24cdd5,_0x4232a0){_0x24cdd5=_0x24cdd5-0x0;var _0x52a09e=_0xe48a[_0x24cdd5];return _0x52a09e;};'use strict';var moment=require(_0xae48('0x0'));var Sequelize=require('sequelize');module[_0xae48('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xae48('0x2')]},'joinAt':{'type':Sequelize[_0xae48('0x3')]},'leaveAt':{'type':Sequelize[_0xae48('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xae48('0x3')]},'reason':{'type':Sequelize[_0xae48('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 606d11e..3442a2d 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 _0xe714=['mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueueReport','include','findAll','catch','show','params','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1b68a7,_0x16f189){var _0x364333=function(_0x38654d){while(--_0x38654d){_0x1b68a7['push'](_0x1b68a7['shift']());}};_0x364333(++_0x16f189);}(_0xe714,0xe2));var _0x4e71=function(_0x5c7815,_0x2cf31f){_0x5c7815=_0x5c7815-0x0;var _0x3cb2f4=_0xe714[_0x5c7815];return _0x3cb2f4;};'use strict';var emlformat=require(_0x4e71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e71('0x1'));var jsonpatch=require(_0x4e71('0x2'));var rp=require(_0x4e71('0x3'));var moment=require(_0x4e71('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4e71('0x5'));var util=require('util');var path=require(_0x4e71('0x6'));var sox=require(_0x4e71('0x7'));var csv=require(_0x4e71('0x8'));var ejs=require(_0x4e71('0x9'));var fs=require('fs');var fs_extra=require(_0x4e71('0xa'));var _=require(_0x4e71('0xb'));var squel=require('squel');var crypto=require(_0x4e71('0xc'));var jsforce=require(_0x4e71('0xd'));var deskjs=require(_0x4e71('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4e71('0xf'));var Papa=require('papaparse');var Redis=require(_0x4e71('0x10'));var authService=require(_0x4e71('0x11'));var qs=require(_0x4e71('0x12'));var as=require(_0x4e71('0x13'));var hardwareService=require(_0x4e71('0x14'));var logger=require(_0x4e71('0x15'))(_0x4e71('0x16'));var utils=require(_0x4e71('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4e71('0x18'));var db=require(_0x4e71('0x19'))['db'];function respondWithStatusCode(_0x585acd,_0x3bd53c){_0x3bd53c=_0x3bd53c||0xcc;return function(_0x311b12){if(_0x311b12){return _0x585acd['sendStatus'](_0x3bd53c);}return _0x585acd[_0x4e71('0x1a')](_0x3bd53c)[_0x4e71('0x1b')]();};}function respondWithResult(_0x5a3d88,_0x5ad00a){_0x5ad00a=_0x5ad00a||0xc8;return function(_0x25c229){if(_0x25c229){return _0x5a3d88['status'](_0x5ad00a)['json'](_0x25c229);}};}function respondWithFilteredResult(_0x5afe50,_0x244272){return function(_0x4617d2){if(_0x4617d2){var _0x52ef52=typeof _0x244272['offset']===_0x4e71('0x1c')&&typeof _0x244272[_0x4e71('0x1d')]===_0x4e71('0x1c');var _0xef8e0d=_0x4617d2[_0x4e71('0x1e')];var _0x281a2b=_0x52ef52?0x0:_0x244272['offset'];var _0x18b745=_0x52ef52?_0x4617d2[_0x4e71('0x1e')]:_0x244272['offset']+_0x244272[_0x4e71('0x1d')];var _0x20b3ef;if(_0x18b745>=_0xef8e0d){_0x18b745=_0xef8e0d;_0x20b3ef=0xc8;}else{_0x20b3ef=0xce;}_0x5afe50['status'](_0x20b3ef);return _0x5afe50['set']('Content-Range',_0x281a2b+'-'+_0x18b745+'/'+_0xef8e0d)[_0x4e71('0x1f')](_0x4617d2);}return null;};}function patchUpdates(_0x1708fe){return function(_0x476b59){try{jsonpatch[_0x4e71('0x20')](_0x476b59,_0x1708fe,!![]);}catch(_0x44a6e5){return BPromise[_0x4e71('0x21')](_0x44a6e5);}return _0x476b59[_0x4e71('0x22')]();};}function saveUpdates(_0x2c22f0,_0x3bd6fc){return function(_0x335956){if(_0x335956){return _0x335956[_0x4e71('0x23')](_0x2c22f0)[_0x4e71('0x24')](function(_0x5e90f0){return _0x5e90f0;});}return null;};}function removeEntity(_0x5aa6b8,_0x56dd25){return function(_0x5b6584){if(_0x5b6584){return _0x5b6584[_0x4e71('0x25')]()[_0x4e71('0x24')](function(){_0x5aa6b8[_0x4e71('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35f181,_0x237057){return function(_0x564afb){if(!_0x564afb){_0x35f181[_0x4e71('0x26')](0x194);}return _0x564afb;};}function handleError(_0x40bb91,_0x2c9abf){_0x2c9abf=_0x2c9abf||0x1f4;return function(_0x53b08a){logger['error'](_0x53b08a[_0x4e71('0x27')]);if(_0x53b08a[_0x4e71('0x28')]){delete _0x53b08a[_0x4e71('0x28')];}_0x40bb91[_0x4e71('0x1a')](_0x2c9abf)[_0x4e71('0x29')](_0x53b08a);};}exports[_0x4e71('0x2a')]=function(_0x507639,_0x5ac921){var _0x51e9ea={},_0x2a7ce3={},_0xe33409={'count':0x0,'rows':[]};var _0x5a58b0=_[_0x4e71('0x2b')](db['ChatQueueReport'][_0x4e71('0x2c')],function(_0x4326cd){return{'name':_0x4326cd[_0x4e71('0x2d')],'type':_0x4326cd[_0x4e71('0x2e')][_0x4e71('0x2f')]};});_0x2a7ce3['model']=_[_0x4e71('0x2b')](_0x5a58b0,'name');_0x2a7ce3[_0x4e71('0x30')]=_[_0x4e71('0x31')](_0x507639[_0x4e71('0x30')]);_0x2a7ce3[_0x4e71('0x32')]=_[_0x4e71('0x33')](_0x2a7ce3['model'],_0x2a7ce3['query']);_0x51e9ea['attributes']=_[_0x4e71('0x33')](_0x2a7ce3[_0x4e71('0x34')],qs['fields'](_0x507639[_0x4e71('0x30')][_0x4e71('0x35')]));_0x51e9ea['attributes']=_0x51e9ea['attributes'][_0x4e71('0x36')]?_0x51e9ea[_0x4e71('0x37')]:_0x2a7ce3['model'];if(!_0x507639[_0x4e71('0x30')][_0x4e71('0x38')]('nolimit')){_0x51e9ea[_0x4e71('0x1d')]=qs[_0x4e71('0x1d')](_0x507639[_0x4e71('0x30')]['limit']);_0x51e9ea[_0x4e71('0x39')]=qs[_0x4e71('0x39')](_0x507639[_0x4e71('0x30')][_0x4e71('0x39')]);}_0x51e9ea[_0x4e71('0x3a')]=qs['sort'](_0x507639[_0x4e71('0x30')][_0x4e71('0x3b')]);_0x51e9ea[_0x4e71('0x3c')]=qs[_0x4e71('0x32')](_[_0x4e71('0x3d')](_0x507639['query'],_0x2a7ce3['filters']),_0x5a58b0);if(_0x507639[_0x4e71('0x30')][_0x4e71('0x3e')]){_0x51e9ea[_0x4e71('0x3c')]=_[_0x4e71('0x3f')](_0x51e9ea[_0x4e71('0x3c')],{'$or':_['map'](_0x5a58b0,function(_0x16dba2){if(_0x16dba2['type']!==_0x4e71('0x40')){var _0x4edcf0={};_0x4edcf0[_0x16dba2[_0x4e71('0x28')]]={'$like':'%'+_0x507639[_0x4e71('0x30')]['filter']+'%'};return _0x4edcf0;}})});}_0x51e9ea=_[_0x4e71('0x3f')]({},_0x51e9ea,_0x507639[_0x4e71('0x41')]);var _0x66a95c={'where':_0x51e9ea[_0x4e71('0x3c')]};return db[_0x4e71('0x42')][_0x4e71('0x1e')](_0x66a95c)[_0x4e71('0x24')](function(_0x2bae8a){_0xe33409[_0x4e71('0x1e')]=_0x2bae8a;if(_0x507639['query']['includeAll']){_0x51e9ea[_0x4e71('0x43')]=[{'all':!![]}];}return db[_0x4e71('0x42')][_0x4e71('0x44')](_0x51e9ea);})[_0x4e71('0x24')](function(_0x4fac41){_0xe33409['rows']=_0x4fac41;return _0xe33409;})[_0x4e71('0x24')](respondWithFilteredResult(_0x5ac921,_0x51e9ea))[_0x4e71('0x45')](handleError(_0x5ac921,null));};exports[_0x4e71('0x46')]=function(_0x5c64e2,_0x46963b){var _0x117877={'raw':!![],'where':{'id':_0x5c64e2[_0x4e71('0x47')]['id']}},_0x42df32={};_0x42df32[_0x4e71('0x34')]=_[_0x4e71('0x31')](db[_0x4e71('0x42')][_0x4e71('0x2c')]);_0x42df32['query']=_[_0x4e71('0x31')](_0x5c64e2[_0x4e71('0x30')]);_0x42df32[_0x4e71('0x32')]=_['intersection'](_0x42df32['model'],_0x42df32['query']);_0x117877['attributes']=_[_0x4e71('0x33')](_0x42df32[_0x4e71('0x34')],qs['fields'](_0x5c64e2['query']['fields']));_0x117877[_0x4e71('0x37')]=_0x117877[_0x4e71('0x37')][_0x4e71('0x36')]?_0x117877[_0x4e71('0x37')]:_0x42df32[_0x4e71('0x34')];if(_0x5c64e2[_0x4e71('0x30')][_0x4e71('0x48')]){_0x117877[_0x4e71('0x43')]=[{'all':!![]}];}_0x117877=_[_0x4e71('0x3f')]({},_0x117877,_0x5c64e2[_0x4e71('0x41')]);return db['ChatQueueReport'][_0x4e71('0x49')](_0x117877)[_0x4e71('0x24')](handleEntityNotFound(_0x46963b,null))['then'](respondWithResult(_0x46963b,null))[_0x4e71('0x45')](handleError(_0x46963b,null));};exports[_0x4e71('0x4a')]=function(_0x5a7a22,_0x1f16f5){return db[_0x4e71('0x42')][_0x4e71('0x4a')](_0x5a7a22[_0x4e71('0x4b')],{})['then'](respondWithResult(_0x1f16f5,0xc9))[_0x4e71('0x45')](handleError(_0x1f16f5,null));};exports['update']=function(_0x597f67,_0x2af74c){if(_0x597f67[_0x4e71('0x4b')]['id']){delete _0x597f67[_0x4e71('0x4b')]['id'];}return db[_0x4e71('0x42')][_0x4e71('0x49')]({'where':{'id':_0x597f67[_0x4e71('0x47')]['id']}})['then'](handleEntityNotFound(_0x2af74c,null))[_0x4e71('0x24')](saveUpdates(_0x597f67[_0x4e71('0x4b')],null))[_0x4e71('0x24')](respondWithResult(_0x2af74c,null))[_0x4e71('0x45')](handleError(_0x2af74c,null));};exports[_0x4e71('0x25')]=function(_0x52f274,_0x55432e){return db[_0x4e71('0x42')][_0x4e71('0x49')]({'where':{'id':_0x52f274[_0x4e71('0x47')]['id']}})[_0x4e71('0x24')](handleEntityNotFound(_0x55432e,null))[_0x4e71('0x24')](removeEntity(_0x55432e,null))[_0x4e71('0x45')](handleError(_0x55432e,null));};exports[_0x4e71('0x4c')]=function(_0x9b5268,_0x3da3a3){return db[_0x4e71('0x42')]['describe']()[_0x4e71('0x24')](respondWithResult(_0x3da3a3,null))[_0x4e71('0x45')](handleError(_0x3da3a3,null));}; \ No newline at end of file +var _0x99a0=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','apply','reject','save','then','destroy','error','name','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','fields','includeAll','find','body','update','describe','eml-format','rimraf','bluebird','mustache','path','sox','to-csv'];(function(_0x1dce8f,_0x292ab0){var _0x2107e1=function(_0x2ba53a){while(--_0x2ba53a){_0x1dce8f['push'](_0x1dce8f['shift']());}};_0x2107e1(++_0x292ab0);}(_0x99a0,0x121));var _0x099a=function(_0x47da47,_0x2e2deb){_0x47da47=_0x47da47-0x0;var _0x1efd3b=_0x99a0[_0x47da47];return _0x1efd3b;};'use strict';var emlformat=require(_0x099a('0x0'));var rimraf=require(_0x099a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x099a('0x2'));var Mustache=require(_0x099a('0x3'));var util=require('util');var path=require(_0x099a('0x4'));var sox=require(_0x099a('0x5'));var csv=require(_0x099a('0x6'));var ejs=require(_0x099a('0x7'));var fs=require('fs');var fs_extra=require(_0x099a('0x8'));var _=require(_0x099a('0x9'));var squel=require('squel');var crypto=require(_0x099a('0xa'));var jsforce=require(_0x099a('0xb'));var deskjs=require(_0x099a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x099a('0xd'));var Papa=require(_0x099a('0xe'));var Redis=require(_0x099a('0xf'));var authService=require(_0x099a('0x10'));var qs=require(_0x099a('0x11'));var as=require(_0x099a('0x12'));var hardwareService=require(_0x099a('0x13'));var logger=require(_0x099a('0x14'))(_0x099a('0x15'));var utils=require(_0x099a('0x16'));var config=require(_0x099a('0x17'));var licenseUtil=require(_0x099a('0x18'));var db=require(_0x099a('0x19'))['db'];function respondWithStatusCode(_0x1e9dc1,_0x2e8afc){_0x2e8afc=_0x2e8afc||0xcc;return function(_0x4bd3ee){if(_0x4bd3ee){return _0x1e9dc1[_0x099a('0x1a')](_0x2e8afc);}return _0x1e9dc1['status'](_0x2e8afc)[_0x099a('0x1b')]();};}function respondWithResult(_0x4f2dbe,_0x249392){_0x249392=_0x249392||0xc8;return function(_0x3a134e){if(_0x3a134e){return _0x4f2dbe[_0x099a('0x1c')](_0x249392)[_0x099a('0x1d')](_0x3a134e);}};}function respondWithFilteredResult(_0x23a5fd,_0x3b4bdf){return function(_0x5086d8){if(_0x5086d8){var _0x443eea=typeof _0x3b4bdf[_0x099a('0x1e')]===_0x099a('0x1f')&&typeof _0x3b4bdf[_0x099a('0x20')]==='undefined';var _0x2831a2=_0x5086d8['count'];var _0x1d3924=_0x443eea?0x0:_0x3b4bdf[_0x099a('0x1e')];var _0x295e92=_0x443eea?_0x5086d8['count']:_0x3b4bdf[_0x099a('0x1e')]+_0x3b4bdf[_0x099a('0x20')];var _0x1c5314;if(_0x295e92>=_0x2831a2){_0x295e92=_0x2831a2;_0x1c5314=0xc8;}else{_0x1c5314=0xce;}_0x23a5fd[_0x099a('0x1c')](_0x1c5314);return _0x23a5fd[_0x099a('0x21')]('Content-Range',_0x1d3924+'-'+_0x295e92+'/'+_0x2831a2)['json'](_0x5086d8);}return null;};}function patchUpdates(_0x2ec23b){return function(_0x851d2){try{jsonpatch[_0x099a('0x22')](_0x851d2,_0x2ec23b,!![]);}catch(_0x470df6){return BPromise[_0x099a('0x23')](_0x470df6);}return _0x851d2[_0x099a('0x24')]();};}function saveUpdates(_0x2b2b9b,_0x23558b){return function(_0x545830){if(_0x545830){return _0x545830['update'](_0x2b2b9b)[_0x099a('0x25')](function(_0x38dd6a){return _0x38dd6a;});}return null;};}function removeEntity(_0x2c9033,_0x7cd361){return function(_0x1d1e5f){if(_0x1d1e5f){return _0x1d1e5f[_0x099a('0x26')]()[_0x099a('0x25')](function(){_0x2c9033[_0x099a('0x1c')](0xcc)[_0x099a('0x1b')]();});}};}function handleEntityNotFound(_0x42ee18,_0x21a937){return function(_0x4d63d5){if(!_0x4d63d5){_0x42ee18[_0x099a('0x1a')](0x194);}return _0x4d63d5;};}function handleError(_0x5e316b,_0x2a5417){_0x2a5417=_0x2a5417||0x1f4;return function(_0x39f520){logger[_0x099a('0x27')](_0x39f520['stack']);if(_0x39f520[_0x099a('0x28')]){delete _0x39f520[_0x099a('0x28')];}_0x5e316b[_0x099a('0x1c')](_0x2a5417)['send'](_0x39f520);};}exports['index']=function(_0x560fdb,_0x2b1597){var _0x1938d0={},_0x4a1663={},_0x2ab9a5={'count':0x0,'rows':[]};var _0x2e403e=_[_0x099a('0x29')](db[_0x099a('0x2a')][_0x099a('0x2b')],function(_0x36c1b4){return{'name':_0x36c1b4['fieldName'],'type':_0x36c1b4[_0x099a('0x2c')][_0x099a('0x2d')]};});_0x4a1663[_0x099a('0x2e')]=_[_0x099a('0x29')](_0x2e403e,_0x099a('0x28'));_0x4a1663[_0x099a('0x2f')]=_[_0x099a('0x30')](_0x560fdb[_0x099a('0x2f')]);_0x4a1663['filters']=_[_0x099a('0x31')](_0x4a1663[_0x099a('0x2e')],_0x4a1663[_0x099a('0x2f')]);_0x1938d0[_0x099a('0x32')]=_[_0x099a('0x31')](_0x4a1663[_0x099a('0x2e')],qs['fields'](_0x560fdb[_0x099a('0x2f')]['fields']));_0x1938d0[_0x099a('0x32')]=_0x1938d0[_0x099a('0x32')]['length']?_0x1938d0[_0x099a('0x32')]:_0x4a1663[_0x099a('0x2e')];if(!_0x560fdb[_0x099a('0x2f')][_0x099a('0x33')](_0x099a('0x34'))){_0x1938d0['limit']=qs[_0x099a('0x20')](_0x560fdb[_0x099a('0x2f')]['limit']);_0x1938d0[_0x099a('0x1e')]=qs[_0x099a('0x1e')](_0x560fdb[_0x099a('0x2f')]['offset']);}_0x1938d0[_0x099a('0x35')]=qs[_0x099a('0x36')](_0x560fdb[_0x099a('0x2f')][_0x099a('0x36')]);_0x1938d0[_0x099a('0x37')]=qs[_0x099a('0x38')](_['pick'](_0x560fdb[_0x099a('0x2f')],_0x4a1663['filters']),_0x2e403e);if(_0x560fdb[_0x099a('0x2f')][_0x099a('0x39')]){_0x1938d0['where']=_[_0x099a('0x3a')](_0x1938d0[_0x099a('0x37')],{'$or':_[_0x099a('0x29')](_0x2e403e,function(_0x434cee){if(_0x434cee[_0x099a('0x2c')]!==_0x099a('0x3b')){var _0x1386cb={};_0x1386cb[_0x434cee[_0x099a('0x28')]]={'$like':'%'+_0x560fdb[_0x099a('0x2f')]['filter']+'%'};return _0x1386cb;}})});}_0x1938d0=_[_0x099a('0x3a')]({},_0x1938d0,_0x560fdb[_0x099a('0x3c')]);var _0x2efb31={'where':_0x1938d0[_0x099a('0x37')]};return db[_0x099a('0x2a')][_0x099a('0x3d')](_0x2efb31)['then'](function(_0x482e9e){_0x2ab9a5[_0x099a('0x3d')]=_0x482e9e;if(_0x560fdb[_0x099a('0x2f')]['includeAll']){_0x1938d0[_0x099a('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x099a('0x3f')](_0x1938d0);})[_0x099a('0x25')](function(_0x13070f){_0x2ab9a5[_0x099a('0x40')]=_0x13070f;return _0x2ab9a5;})[_0x099a('0x25')](respondWithFilteredResult(_0x2b1597,_0x1938d0))[_0x099a('0x41')](handleError(_0x2b1597,null));};exports[_0x099a('0x42')]=function(_0x430e12,_0x49fc09){var _0x2640da={'raw':!![],'where':{'id':_0x430e12[_0x099a('0x43')]['id']}},_0x4a4a76={};_0x4a4a76['model']=_[_0x099a('0x30')](db[_0x099a('0x2a')][_0x099a('0x2b')]);_0x4a4a76[_0x099a('0x2f')]=_['keys'](_0x430e12[_0x099a('0x2f')]);_0x4a4a76[_0x099a('0x38')]=_['intersection'](_0x4a4a76[_0x099a('0x2e')],_0x4a4a76['query']);_0x2640da[_0x099a('0x32')]=_[_0x099a('0x31')](_0x4a4a76[_0x099a('0x2e')],qs[_0x099a('0x44')](_0x430e12[_0x099a('0x2f')][_0x099a('0x44')]));_0x2640da[_0x099a('0x32')]=_0x2640da[_0x099a('0x32')]['length']?_0x2640da[_0x099a('0x32')]:_0x4a4a76['model'];if(_0x430e12[_0x099a('0x2f')][_0x099a('0x45')]){_0x2640da[_0x099a('0x3e')]=[{'all':!![]}];}_0x2640da=_[_0x099a('0x3a')]({},_0x2640da,_0x430e12[_0x099a('0x3c')]);return db[_0x099a('0x2a')][_0x099a('0x46')](_0x2640da)['then'](handleEntityNotFound(_0x49fc09,null))[_0x099a('0x25')](respondWithResult(_0x49fc09,null))[_0x099a('0x41')](handleError(_0x49fc09,null));};exports['create']=function(_0x1c31ff,_0x213c03){return db[_0x099a('0x2a')]['create'](_0x1c31ff[_0x099a('0x47')],{})[_0x099a('0x25')](respondWithResult(_0x213c03,0xc9))[_0x099a('0x41')](handleError(_0x213c03,null));};exports[_0x099a('0x48')]=function(_0x503d44,_0x288ed9){if(_0x503d44['body']['id']){delete _0x503d44[_0x099a('0x47')]['id'];}return db[_0x099a('0x2a')]['find']({'where':{'id':_0x503d44['params']['id']}})[_0x099a('0x25')](handleEntityNotFound(_0x288ed9,null))[_0x099a('0x25')](saveUpdates(_0x503d44[_0x099a('0x47')],null))['then'](respondWithResult(_0x288ed9,null))[_0x099a('0x41')](handleError(_0x288ed9,null));};exports[_0x099a('0x26')]=function(_0x2b956d,_0x56b1e0){return db[_0x099a('0x2a')]['find']({'where':{'id':_0x2b956d['params']['id']}})[_0x099a('0x25')](handleEntityNotFound(_0x56b1e0,null))['then'](removeEntity(_0x56b1e0,null))['catch'](handleError(_0x56b1e0,null));};exports[_0x099a('0x49')]=function(_0x3fb887,_0x4c24b0){return db[_0x099a('0x2a')][_0x099a('0x49')]()[_0x099a('0x25')](respondWithResult(_0x4c24b0,null))['catch'](handleError(_0x4c24b0,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index e1919b4..2b1e505 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x104877,_0x48fb27){var _0x27203e=function(_0x3aedd1){while(--_0x3aedd1){_0x104877['push'](_0x104877['shift']());}};_0x27203e(++_0x48fb27);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index d9f3d46..9f4517e 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 _0x032e=['create','body','options','raw','debug','stringify','UpdateChatQueueReport','update','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x032e,0x6d));var _0xe032=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x032e[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe032('0x0'));var BPromise=require(_0xe032('0x1'));var rs=require(_0xe032('0x2'));var fs=require('fs');var Redis=require(_0xe032('0x3'));var db=require(_0xe032('0x4'))['db'];var utils=require(_0xe032('0x5'));var logger=require(_0xe032('0x6'))(_0xe032('0x7'));var config=require('../../config/environment');var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c14ac,_0x2ee0a6,_0x333b82){return new BPromise(function(_0x2d70fa,_0x341efc){return client[_0xe032('0xb')](_0x3c14ac,_0x333b82)[_0xe032('0xc')](function(_0x516e42){logger['info'](_0xe032('0xd'),_0x2ee0a6,_0xe032('0xe'));logger['debug'](_0xe032('0xf'),_0x2ee0a6,_0xe032('0xe'),JSON['stringify'](_0x516e42));if(_0x516e42[_0xe032('0x10')]){if(_0x516e42[_0xe032('0x10')]['code']===0x1f4){logger['error'](_0xe032('0xd'),_0x2ee0a6,_0x516e42[_0xe032('0x10')][_0xe032('0x11')]);return _0x341efc(_0x516e42[_0xe032('0x10')][_0xe032('0x11')]);}logger[_0xe032('0x10')](_0xe032('0xd'),_0x2ee0a6,_0x516e42[_0xe032('0x10')][_0xe032('0x11')]);return _0x2d70fa(_0x516e42[_0xe032('0x10')]['message']);}else{logger[_0xe032('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x2ee0a6,_0xe032('0xe'));_0x2d70fa(_0x516e42[_0xe032('0x13')][_0xe032('0x11')]);}})[_0xe032('0x14')](function(_0x4e0bd4){logger[_0xe032('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x2ee0a6,_0x4e0bd4);_0x341efc(_0x4e0bd4);});});}exports[_0xe032('0x15')]=function(_0x1c003b){var _0x354b7c=this;return new Promise(function(_0x4d43eb,_0x3bb7b8){return db[_0xe032('0x16')][_0xe032('0x17')](_0x1c003b[_0xe032('0x18')],{'raw':_0x1c003b[_0xe032('0x19')]?_0x1c003b['options'][_0xe032('0x1a')]===undefined?!![]:![]:!![]})[_0xe032('0xc')](function(_0x5ac89b){logger[_0xe032('0x12')](_0xe032('0x15'),_0x1c003b);logger[_0xe032('0x1b')](_0xe032('0x15'),_0x1c003b,JSON[_0xe032('0x1c')](_0x5ac89b));_0x4d43eb(_0x5ac89b);})['catch'](function(_0x34c0d1){logger[_0xe032('0x10')](_0xe032('0x15'),_0x34c0d1[_0xe032('0x11')],_0x1c003b);_0x3bb7b8(_0x354b7c['error'](0x1f4,_0x34c0d1[_0xe032('0x11')]));});});};exports[_0xe032('0x1d')]=function(_0x1305ed){var _0x220254=this;return new Promise(function(_0x1eb7c2,_0x5b4afd){return db[_0xe032('0x16')][_0xe032('0x1e')](_0x1305ed[_0xe032('0x18')],{'raw':_0x1305ed[_0xe032('0x19')]?_0x1305ed[_0xe032('0x19')][_0xe032('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1305ed[_0xe032('0x19')]?_0x1305ed[_0xe032('0x19')]['where']||null:null,'attributes':_0x1305ed[_0xe032('0x19')]?_0x1305ed['options'][_0xe032('0x1f')]||null:null,'limit':_0x1305ed[_0xe032('0x19')]?_0x1305ed[_0xe032('0x19')][_0xe032('0x20')]||null:null})[_0xe032('0xc')](function(_0xf61e91){logger[_0xe032('0x12')](_0xe032('0x1d'),_0x1305ed);logger['debug'](_0xe032('0x1d'),_0x1305ed,JSON['stringify'](_0xf61e91));_0x1eb7c2(_0xf61e91);})[_0xe032('0x14')](function(_0x5cdb70){logger[_0xe032('0x10')](_0xe032('0x1d'),_0x5cdb70[_0xe032('0x11')],_0x1305ed);_0x5b4afd(_0x220254[_0xe032('0x10')](0x1f4,_0x5cdb70[_0xe032('0x11')]));});});}; \ No newline at end of file +var _0x88ac=['options','attributes','limit','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','raw','UpdateChatQueueReport'];(function(_0x4905a2,_0x359ab2){var _0x1c288b=function(_0x32c4a0){while(--_0x32c4a0){_0x4905a2['push'](_0x4905a2['shift']());}};_0x1c288b(++_0x359ab2);}(_0x88ac,0x124));var _0xc88a=function(_0x2388be,_0x43ebae){_0x2388be=_0x2388be-0x0;var _0x13ac52=_0x88ac[_0x2388be];return _0x13ac52;};'use strict';var _=require(_0xc88a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc88a('0x1'));var fs=require('fs');var Redis=require(_0xc88a('0x2'));var db=require(_0xc88a('0x3'))['db'];var utils=require(_0xc88a('0x4'));var logger=require(_0xc88a('0x5'))('rpc');var config=require(_0xc88a('0x6'));var jayson=require(_0xc88a('0x7'));var client=jayson[_0xc88a('0x8')][_0xc88a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23b3a7,_0x44a753,_0x2b5bc7){return new BPromise(function(_0x26f1a1,_0x842a2f){return client[_0xc88a('0xa')](_0x23b3a7,_0x2b5bc7)[_0xc88a('0xb')](function(_0x20bb2e){logger[_0xc88a('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x44a753,_0xc88a('0xd'));logger['debug'](_0xc88a('0xe'),_0x44a753,_0xc88a('0xd'),JSON[_0xc88a('0xf')](_0x20bb2e));if(_0x20bb2e[_0xc88a('0x10')]){if(_0x20bb2e[_0xc88a('0x10')][_0xc88a('0x11')]===0x1f4){logger[_0xc88a('0x10')](_0xc88a('0x12'),_0x44a753,_0x20bb2e[_0xc88a('0x10')][_0xc88a('0x13')]);return _0x842a2f(_0x20bb2e['error']['message']);}logger[_0xc88a('0x10')](_0xc88a('0x12'),_0x44a753,_0x20bb2e[_0xc88a('0x10')]['message']);return _0x26f1a1(_0x20bb2e[_0xc88a('0x10')][_0xc88a('0x13')]);}else{logger[_0xc88a('0xc')](_0xc88a('0x12'),_0x44a753,'request\x20sent');_0x26f1a1(_0x20bb2e[_0xc88a('0x14')][_0xc88a('0x13')]);}})[_0xc88a('0x15')](function(_0x19fdc4){logger[_0xc88a('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x44a753,_0x19fdc4);_0x842a2f(_0x19fdc4);});});}exports[_0xc88a('0x16')]=function(_0x1d5f29){var _0x4795d0=this;return new Promise(function(_0x54948c,_0x4fb656){return db[_0xc88a('0x17')][_0xc88a('0x18')](_0x1d5f29[_0xc88a('0x19')],{'raw':_0x1d5f29['options']?_0x1d5f29['options'][_0xc88a('0x1a')]===undefined?!![]:![]:!![]})[_0xc88a('0xb')](function(_0xecd6d3){logger['info'](_0xc88a('0x16'),_0x1d5f29);logger['debug'](_0xc88a('0x16'),_0x1d5f29,JSON['stringify'](_0xecd6d3));_0x54948c(_0xecd6d3);})['catch'](function(_0x371a4e){logger[_0xc88a('0x10')](_0xc88a('0x16'),_0x371a4e[_0xc88a('0x13')],_0x1d5f29);_0x4fb656(_0x4795d0['error'](0x1f4,_0x371a4e[_0xc88a('0x13')]));});});};exports[_0xc88a('0x1b')]=function(_0x558978){var _0x1cd4ed=this;return new Promise(function(_0x129132,_0xcf46ce){return db[_0xc88a('0x17')]['update'](_0x558978['body'],{'raw':_0x558978[_0xc88a('0x1c')]?_0x558978[_0xc88a('0x1c')][_0xc88a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x558978['options']?_0x558978[_0xc88a('0x1c')]['where']||null:null,'attributes':_0x558978[_0xc88a('0x1c')]?_0x558978[_0xc88a('0x1c')][_0xc88a('0x1d')]||null:null,'limit':_0x558978[_0xc88a('0x1c')]?_0x558978[_0xc88a('0x1c')][_0xc88a('0x1e')]||null:null})['then'](function(_0x2565a7){logger[_0xc88a('0xc')]('UpdateChatQueueReport',_0x558978);logger[_0xc88a('0x1f')](_0xc88a('0x1b'),_0x558978,JSON['stringify'](_0x2565a7));_0x129132(_0x2565a7);})[_0xc88a('0x15')](function(_0x388090){logger[_0xc88a('0x10')](_0xc88a('0x1b'),_0x388090[_0xc88a('0x13')],_0x558978);_0xcf46ce(_0x1cd4ed[_0xc88a('0x10')](0x1f4,_0x388090[_0xc88a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 8b7d50f..c3a4aff 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 _0x50e7=['post','destroy','util','path','connect-timeout','Router','fs-extra','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x50e7,0xd4));var _0x750e=function(_0x25a245,_0x4d270e){_0x25a245=_0x25a245-0x0;var _0x5c4eee=_0x50e7[_0x25a245];return _0x5c4eee;};'use strict';var multer=require('multer');var util=require(_0x750e('0x0'));var path=require(_0x750e('0x1'));var timeout=require(_0x750e('0x2'));var express=require('express');var router=express[_0x750e('0x3')]();var fs_extra=require(_0x750e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x750e('0x5'));router[_0x750e('0x6')]('/',auth['isAuthenticated'](),controller[_0x750e('0x7')]);router[_0x750e('0x6')](_0x750e('0x8'),auth[_0x750e('0x9')](),controller[_0x750e('0xa')]);router[_0x750e('0x6')]('/:id',auth[_0x750e('0x9')](),controller[_0x750e('0xb')]);router[_0x750e('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x750e('0x9')](),controller[_0x750e('0xd')]);module['exports']=router; \ No newline at end of file +var _0x5c31=['post','create','put','update','/:id','destroy','exports','multer','util','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','describe','isAuthenticated'];(function(_0x194b83,_0x1143cd){var _0x1a59dc=function(_0x5e91a4){while(--_0x5e91a4){_0x194b83['push'](_0x194b83['shift']());}};_0x1a59dc(++_0x1143cd);}(_0x5c31,0x1a5));var _0x15c3=function(_0x1deefa,_0x862114){_0x1deefa=_0x1deefa-0x0;var _0x4fbdb6=_0x5c31[_0x1deefa];return _0x4fbdb6;};'use strict';var multer=require(_0x15c3('0x0'));var util=require(_0x15c3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x15c3('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x15c3('0x3'));var config=require(_0x15c3('0x4'));var controller=require(_0x15c3('0x5'));router[_0x15c3('0x6')]('/',auth['isAuthenticated'](),controller[_0x15c3('0x7')]);router['get'](_0x15c3('0x8'),auth['isAuthenticated'](),controller[_0x15c3('0x9')]);router['get']('/:id',auth[_0x15c3('0xa')](),controller['show']);router[_0x15c3('0xb')]('/',auth[_0x15c3('0xa')](),controller[_0x15c3('0xc')]);router[_0x15c3('0xd')]('/:id',auth[_0x15c3('0xa')](),controller[_0x15c3('0xe')]);router['delete'](_0x15c3('0xf'),auth[_0x15c3('0xa')](),controller[_0x15c3('0x10')]);module[_0x15c3('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 86809ed..f682517 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x43d6dd,_0x1c2138){var _0x4e1ff2=function(_0x50174e){while(--_0x50174e){_0x43d6dd['push'](_0x43d6dd['shift']());}};_0x4e1ff2(++_0x1c2138);}(_0x70e0,0x17b));var _0x070e=function(_0x27c984,_0x4d8452){_0x27c984=_0x27c984-0x0;var _0x1411f3=_0x70e0[_0x27c984];return _0x1411f3;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xe07834,_0x450d4a){var _0x30a058=function(_0x16203c){while(--_0x16203c){_0xe07834['push'](_0xe07834['shift']());}};_0x30a058(++_0x450d4a);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3818c0,_0x542521){_0x3818c0=_0x3818c0-0x0;var _0x55ec33=_0xf3cd[_0x3818c0];return _0x55ec33;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 19884aa..f766096 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 _0x988a=['offset','limit','status','set','json','reject','save','then','destroy','sendStatus','name','send','map','ChatTransferReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count'];(function(_0x431ae1,_0x385f06){var _0x27fcbd=function(_0x16e71f){while(--_0x16e71f){_0x431ae1['push'](_0x431ae1['shift']());}};_0x27fcbd(++_0x385f06);}(_0x988a,0x14c));var _0xa988=function(_0x244dd7,_0x2c3f28){_0x244dd7=_0x244dd7-0x0;var _0xa2432c=_0x988a[_0x244dd7];return _0xa2432c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa988('0x0'));var zipdir=require(_0xa988('0x1'));var jsonpatch=require(_0xa988('0x2'));var rp=require(_0xa988('0x3'));var moment=require('moment');var BPromise=require(_0xa988('0x4'));var Mustache=require('mustache');var util=require(_0xa988('0x5'));var path=require(_0xa988('0x6'));var sox=require(_0xa988('0x7'));var csv=require(_0xa988('0x8'));var ejs=require(_0xa988('0x9'));var fs=require('fs');var fs_extra=require(_0xa988('0xa'));var _=require(_0xa988('0xb'));var squel=require(_0xa988('0xc'));var crypto=require('crypto');var jsforce=require(_0xa988('0xd'));var deskjs=require(_0xa988('0xe'));var toCsv=require(_0xa988('0x8'));var querystring=require(_0xa988('0xf'));var Papa=require(_0xa988('0x10'));var Redis=require(_0xa988('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa988('0x12'));var hardwareService=require(_0xa988('0x13'));var logger=require(_0xa988('0x14'))(_0xa988('0x15'));var utils=require(_0xa988('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa988('0x17'));var db=require(_0xa988('0x18'))['db'];function respondWithStatusCode(_0x4d2079,_0x3e8f62){_0x3e8f62=_0x3e8f62||0xcc;return function(_0x4b9d51){if(_0x4b9d51){return _0x4d2079['sendStatus'](_0x3e8f62);}return _0x4d2079['status'](_0x3e8f62)[_0xa988('0x19')]();};}function respondWithResult(_0x283071,_0x13b430){_0x13b430=_0x13b430||0xc8;return function(_0x531bae){if(_0x531bae){return _0x283071['status'](_0x13b430)['json'](_0x531bae);}};}function respondWithFilteredResult(_0x554e0c,_0x3fce85){return function(_0x5770da){if(_0x5770da){var _0x2f1c5d=typeof _0x3fce85['offset']===_0xa988('0x1a')&&typeof _0x3fce85['limit']===_0xa988('0x1a');var _0x51e067=_0x5770da[_0xa988('0x1b')];var _0x111ceb=_0x2f1c5d?0x0:_0x3fce85[_0xa988('0x1c')];var _0x4e760f=_0x2f1c5d?_0x5770da[_0xa988('0x1b')]:_0x3fce85[_0xa988('0x1c')]+_0x3fce85[_0xa988('0x1d')];var _0x33c21d;if(_0x4e760f>=_0x51e067){_0x4e760f=_0x51e067;_0x33c21d=0xc8;}else{_0x33c21d=0xce;}_0x554e0c[_0xa988('0x1e')](_0x33c21d);return _0x554e0c[_0xa988('0x1f')]('Content-Range',_0x111ceb+'-'+_0x4e760f+'/'+_0x51e067)[_0xa988('0x20')](_0x5770da);}return null;};}function patchUpdates(_0x4cae59){return function(_0xda34f){try{jsonpatch['apply'](_0xda34f,_0x4cae59,!![]);}catch(_0x5c8543){return BPromise[_0xa988('0x21')](_0x5c8543);}return _0xda34f[_0xa988('0x22')]();};}function saveUpdates(_0x44ad56,_0x187b3c){return function(_0x3d2c6f){if(_0x3d2c6f){return _0x3d2c6f['update'](_0x44ad56)[_0xa988('0x23')](function(_0x10b786){return _0x10b786;});}return null;};}function removeEntity(_0x5c336c,_0x5e04e9){return function(_0x4a3ecd){if(_0x4a3ecd){return _0x4a3ecd[_0xa988('0x24')]()['then'](function(){_0x5c336c['status'](0xcc)[_0xa988('0x19')]();});}};}function handleEntityNotFound(_0x28755e,_0x1858c2){return function(_0x57b5ab){if(!_0x57b5ab){_0x28755e[_0xa988('0x25')](0x194);}return _0x57b5ab;};}function handleError(_0x1082e8,_0x3dd3b5){_0x3dd3b5=_0x3dd3b5||0x1f4;return function(_0x3114e6){logger['error'](_0x3114e6['stack']);if(_0x3114e6[_0xa988('0x26')]){delete _0x3114e6[_0xa988('0x26')];}_0x1082e8[_0xa988('0x1e')](_0x3dd3b5)[_0xa988('0x27')](_0x3114e6);};}exports['index']=function(_0x13f104,_0x4a2c4c){var _0x3e44ed={},_0x1f85c7={},_0x35a02c={'count':0x0,'rows':[]};var _0x29e594=_[_0xa988('0x28')](db[_0xa988('0x29')]['rawAttributes'],function(_0x46152b){return{'name':_0x46152b['fieldName'],'type':_0x46152b[_0xa988('0x2a')][_0xa988('0x2b')]};});_0x1f85c7[_0xa988('0x2c')]=_[_0xa988('0x28')](_0x29e594,_0xa988('0x26'));_0x1f85c7[_0xa988('0x2d')]=_[_0xa988('0x2e')](_0x13f104['query']);_0x1f85c7[_0xa988('0x2f')]=_[_0xa988('0x30')](_0x1f85c7[_0xa988('0x2c')],_0x1f85c7['query']);_0x3e44ed[_0xa988('0x31')]=_['intersection'](_0x1f85c7[_0xa988('0x2c')],qs[_0xa988('0x32')](_0x13f104['query']['fields']));_0x3e44ed[_0xa988('0x31')]=_0x3e44ed[_0xa988('0x31')]['length']?_0x3e44ed[_0xa988('0x31')]:_0x1f85c7['model'];if(!_0x13f104[_0xa988('0x2d')][_0xa988('0x33')]('nolimit')){_0x3e44ed[_0xa988('0x1d')]=qs[_0xa988('0x1d')](_0x13f104['query'][_0xa988('0x1d')]);_0x3e44ed[_0xa988('0x1c')]=qs[_0xa988('0x1c')](_0x13f104[_0xa988('0x2d')][_0xa988('0x1c')]);}_0x3e44ed[_0xa988('0x34')]=qs['sort'](_0x13f104[_0xa988('0x2d')][_0xa988('0x35')]);_0x3e44ed[_0xa988('0x36')]=qs['filters'](_[_0xa988('0x37')](_0x13f104[_0xa988('0x2d')],_0x1f85c7[_0xa988('0x2f')]),_0x29e594);if(_0x13f104[_0xa988('0x2d')][_0xa988('0x38')]){_0x3e44ed[_0xa988('0x36')]=_[_0xa988('0x39')](_0x3e44ed[_0xa988('0x36')],{'$or':_[_0xa988('0x28')](_0x29e594,function(_0x2075b3){if(_0x2075b3[_0xa988('0x2a')]!==_0xa988('0x3a')){var _0x12f287={};_0x12f287[_0x2075b3[_0xa988('0x26')]]={'$like':'%'+_0x13f104[_0xa988('0x2d')]['filter']+'%'};return _0x12f287;}})});}_0x3e44ed=_['merge']({},_0x3e44ed,_0x13f104['options']);var _0x1bee4f={'where':_0x3e44ed['where']};return db[_0xa988('0x29')][_0xa988('0x1b')](_0x1bee4f)['then'](function(_0x13140){_0x35a02c[_0xa988('0x1b')]=_0x13140;if(_0x13f104[_0xa988('0x2d')][_0xa988('0x3b')]){_0x3e44ed[_0xa988('0x3c')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xa988('0x3d')](_0x3e44ed);})[_0xa988('0x23')](function(_0x48e9e6){_0x35a02c[_0xa988('0x3e')]=_0x48e9e6;return _0x35a02c;})[_0xa988('0x23')](respondWithFilteredResult(_0x4a2c4c,_0x3e44ed))[_0xa988('0x3f')](handleError(_0x4a2c4c,null));};exports[_0xa988('0x40')]=function(_0x46f945,_0x3824a0){var _0x3859db={'raw':!![],'where':{'id':_0x46f945[_0xa988('0x41')]['id']}},_0x1c0275={};_0x1c0275[_0xa988('0x2c')]=_[_0xa988('0x2e')](db['ChatTransferReport'][_0xa988('0x42')]);_0x1c0275[_0xa988('0x2d')]=_[_0xa988('0x2e')](_0x46f945[_0xa988('0x2d')]);_0x1c0275['filters']=_['intersection'](_0x1c0275[_0xa988('0x2c')],_0x1c0275['query']);_0x3859db[_0xa988('0x31')]=_[_0xa988('0x30')](_0x1c0275['model'],qs[_0xa988('0x32')](_0x46f945['query']['fields']));_0x3859db['attributes']=_0x3859db[_0xa988('0x31')][_0xa988('0x43')]?_0x3859db['attributes']:_0x1c0275[_0xa988('0x2c')];if(_0x46f945[_0xa988('0x2d')][_0xa988('0x3b')]){_0x3859db[_0xa988('0x3c')]=[{'all':!![]}];}_0x3859db=_[_0xa988('0x39')]({},_0x3859db,_0x46f945['options']);return db['ChatTransferReport'][_0xa988('0x44')](_0x3859db)['then'](handleEntityNotFound(_0x3824a0,null))[_0xa988('0x23')](respondWithResult(_0x3824a0,null))[_0xa988('0x3f')](handleError(_0x3824a0,null));};exports['create']=function(_0x190cf6,_0x2d90c2){return db[_0xa988('0x29')]['create'](_0x190cf6[_0xa988('0x45')],{})[_0xa988('0x23')](respondWithResult(_0x2d90c2,0xc9))[_0xa988('0x3f')](handleError(_0x2d90c2,null));};exports[_0xa988('0x46')]=function(_0xb5d29f,_0x17b3a3){if(_0xb5d29f[_0xa988('0x45')]['id']){delete _0xb5d29f['body']['id'];}return db['ChatTransferReport'][_0xa988('0x44')]({'where':{'id':_0xb5d29f[_0xa988('0x41')]['id']}})[_0xa988('0x23')](handleEntityNotFound(_0x17b3a3,null))[_0xa988('0x23')](saveUpdates(_0xb5d29f[_0xa988('0x45')],null))['then'](respondWithResult(_0x17b3a3,null))[_0xa988('0x3f')](handleError(_0x17b3a3,null));};exports[_0xa988('0x24')]=function(_0x525b8e,_0x308bbc){return db['ChatTransferReport'][_0xa988('0x44')]({'where':{'id':_0x525b8e[_0xa988('0x41')]['id']}})[_0xa988('0x23')](handleEntityNotFound(_0x308bbc,null))[_0xa988('0x23')](removeEntity(_0x308bbc,null))['catch'](handleError(_0x308bbc,null));};exports[_0xa988('0x47')]=function(_0x5fd77f,_0xcc8fb){return db[_0xa988('0x29')][_0xa988('0x47')]()['then'](respondWithResult(_0xcc8fb,null))[_0xa988('0x3f')](handleError(_0xcc8fb,null));}; \ No newline at end of file +var _0xc8b4=['name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','attributes','model','hasOwnProperty','sort','where','pick','filter','merge','options','ChatTransferReport','include','findAll','rows','catch','show','intersection','fields','includeAll','create','body','find','params','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','to-csv','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','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','end','error','stack'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc8b4,0xfe));var _0x4c8b=function(_0x1e812c,_0x4b6727){_0x1e812c=_0x1e812c-0x0;var _0xac472=_0xc8b4[_0x1e812c];return _0xac472;};'use strict';var emlformat=require(_0x4c8b('0x0'));var rimraf=require(_0x4c8b('0x1'));var zipdir=require(_0x4c8b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c8b('0x3'));var moment=require('moment');var BPromise=require(_0x4c8b('0x4'));var Mustache=require('mustache');var util=require(_0x4c8b('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x4c8b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c8b('0x7'));var _=require(_0x4c8b('0x8'));var squel=require(_0x4c8b('0x9'));var crypto=require(_0x4c8b('0xa'));var jsforce=require(_0x4c8b('0xb'));var deskjs=require(_0x4c8b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4c8b('0xd'));var Papa=require(_0x4c8b('0xe'));var Redis=require(_0x4c8b('0xf'));var authService=require(_0x4c8b('0x10'));var qs=require(_0x4c8b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c8b('0x12'));var logger=require('../../config/logger')(_0x4c8b('0x13'));var utils=require(_0x4c8b('0x14'));var config=require(_0x4c8b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c8b('0x16'))['db'];function respondWithStatusCode(_0x20cf8e,_0x4a09b4){_0x4a09b4=_0x4a09b4||0xcc;return function(_0x3bf072){if(_0x3bf072){return _0x20cf8e[_0x4c8b('0x17')](_0x4a09b4);}return _0x20cf8e[_0x4c8b('0x18')](_0x4a09b4)['end']();};}function respondWithResult(_0xa4a7d,_0x537942){_0x537942=_0x537942||0xc8;return function(_0x4fcd15){if(_0x4fcd15){return _0xa4a7d[_0x4c8b('0x18')](_0x537942)[_0x4c8b('0x19')](_0x4fcd15);}};}function respondWithFilteredResult(_0x3f4935,_0x39a4eb){return function(_0x3a78fc){if(_0x3a78fc){var _0xc8088d=typeof _0x39a4eb['offset']==='undefined'&&typeof _0x39a4eb['limit']==='undefined';var _0x127b4c=_0x3a78fc[_0x4c8b('0x1a')];var _0x102c62=_0xc8088d?0x0:_0x39a4eb['offset'];var _0x111850=_0xc8088d?_0x3a78fc[_0x4c8b('0x1a')]:_0x39a4eb[_0x4c8b('0x1b')]+_0x39a4eb[_0x4c8b('0x1c')];var _0x598172;if(_0x111850>=_0x127b4c){_0x111850=_0x127b4c;_0x598172=0xc8;}else{_0x598172=0xce;}_0x3f4935['status'](_0x598172);return _0x3f4935[_0x4c8b('0x1d')](_0x4c8b('0x1e'),_0x102c62+'-'+_0x111850+'/'+_0x127b4c)[_0x4c8b('0x19')](_0x3a78fc);}return null;};}function patchUpdates(_0xae9a7c){return function(_0x316c73){try{jsonpatch[_0x4c8b('0x1f')](_0x316c73,_0xae9a7c,!![]);}catch(_0x4544d9){return BPromise['reject'](_0x4544d9);}return _0x316c73[_0x4c8b('0x20')]();};}function saveUpdates(_0x5cf61e,_0x2aec26){return function(_0x68893f){if(_0x68893f){return _0x68893f[_0x4c8b('0x21')](_0x5cf61e)[_0x4c8b('0x22')](function(_0x3a3387){return _0x3a3387;});}return null;};}function removeEntity(_0x213e2d,_0x520886){return function(_0x207dc6){if(_0x207dc6){return _0x207dc6['destroy']()[_0x4c8b('0x22')](function(){_0x213e2d[_0x4c8b('0x18')](0xcc)[_0x4c8b('0x23')]();});}};}function handleEntityNotFound(_0xa6f6bc,_0x119a9d){return function(_0x551906){if(!_0x551906){_0xa6f6bc[_0x4c8b('0x17')](0x194);}return _0x551906;};}function handleError(_0xb1bf5f,_0xadc052){_0xadc052=_0xadc052||0x1f4;return function(_0x1ac5cf){logger[_0x4c8b('0x24')](_0x1ac5cf[_0x4c8b('0x25')]);if(_0x1ac5cf[_0x4c8b('0x26')]){delete _0x1ac5cf[_0x4c8b('0x26')];}_0xb1bf5f[_0x4c8b('0x18')](_0xadc052)[_0x4c8b('0x27')](_0x1ac5cf);};}exports[_0x4c8b('0x28')]=function(_0x54d9f6,_0x58a252){var _0x4324eb={},_0x2e9423={},_0x1219cb={'count':0x0,'rows':[]};var _0x246a87=_[_0x4c8b('0x29')](db['ChatTransferReport'][_0x4c8b('0x2a')],function(_0x48ccd1){return{'name':_0x48ccd1[_0x4c8b('0x2b')],'type':_0x48ccd1[_0x4c8b('0x2c')][_0x4c8b('0x2d')]};});_0x2e9423['model']=_[_0x4c8b('0x29')](_0x246a87,_0x4c8b('0x26'));_0x2e9423['query']=_[_0x4c8b('0x2e')](_0x54d9f6[_0x4c8b('0x2f')]);_0x2e9423[_0x4c8b('0x30')]=_['intersection'](_0x2e9423['model'],_0x2e9423[_0x4c8b('0x2f')]);_0x4324eb[_0x4c8b('0x31')]=_['intersection'](_0x2e9423['model'],qs['fields'](_0x54d9f6[_0x4c8b('0x2f')]['fields']));_0x4324eb[_0x4c8b('0x31')]=_0x4324eb[_0x4c8b('0x31')]['length']?_0x4324eb['attributes']:_0x2e9423[_0x4c8b('0x32')];if(!_0x54d9f6[_0x4c8b('0x2f')][_0x4c8b('0x33')]('nolimit')){_0x4324eb[_0x4c8b('0x1c')]=qs[_0x4c8b('0x1c')](_0x54d9f6['query'][_0x4c8b('0x1c')]);_0x4324eb['offset']=qs['offset'](_0x54d9f6[_0x4c8b('0x2f')][_0x4c8b('0x1b')]);}_0x4324eb['order']=qs[_0x4c8b('0x34')](_0x54d9f6['query'][_0x4c8b('0x34')]);_0x4324eb[_0x4c8b('0x35')]=qs[_0x4c8b('0x30')](_[_0x4c8b('0x36')](_0x54d9f6['query'],_0x2e9423['filters']),_0x246a87);if(_0x54d9f6[_0x4c8b('0x2f')][_0x4c8b('0x37')]){_0x4324eb[_0x4c8b('0x35')]=_[_0x4c8b('0x38')](_0x4324eb['where'],{'$or':_[_0x4c8b('0x29')](_0x246a87,function(_0x1d8cb4){if(_0x1d8cb4['type']!=='VIRTUAL'){var _0x3e7b3b={};_0x3e7b3b[_0x1d8cb4[_0x4c8b('0x26')]]={'$like':'%'+_0x54d9f6[_0x4c8b('0x2f')][_0x4c8b('0x37')]+'%'};return _0x3e7b3b;}})});}_0x4324eb=_[_0x4c8b('0x38')]({},_0x4324eb,_0x54d9f6[_0x4c8b('0x39')]);var _0x9dd830={'where':_0x4324eb[_0x4c8b('0x35')]};return db[_0x4c8b('0x3a')][_0x4c8b('0x1a')](_0x9dd830)[_0x4c8b('0x22')](function(_0x50f7ca){_0x1219cb['count']=_0x50f7ca;if(_0x54d9f6['query']['includeAll']){_0x4324eb[_0x4c8b('0x3b')]=[{'all':!![]}];}return db[_0x4c8b('0x3a')][_0x4c8b('0x3c')](_0x4324eb);})['then'](function(_0x198e83){_0x1219cb[_0x4c8b('0x3d')]=_0x198e83;return _0x1219cb;})[_0x4c8b('0x22')](respondWithFilteredResult(_0x58a252,_0x4324eb))[_0x4c8b('0x3e')](handleError(_0x58a252,null));};exports[_0x4c8b('0x3f')]=function(_0x3a7fad,_0x3a272a){var _0x659bbc={'raw':!![],'where':{'id':_0x3a7fad['params']['id']}},_0x5c487c={};_0x5c487c['model']=_[_0x4c8b('0x2e')](db['ChatTransferReport'][_0x4c8b('0x2a')]);_0x5c487c[_0x4c8b('0x2f')]=_[_0x4c8b('0x2e')](_0x3a7fad[_0x4c8b('0x2f')]);_0x5c487c[_0x4c8b('0x30')]=_[_0x4c8b('0x40')](_0x5c487c[_0x4c8b('0x32')],_0x5c487c['query']);_0x659bbc[_0x4c8b('0x31')]=_[_0x4c8b('0x40')](_0x5c487c[_0x4c8b('0x32')],qs[_0x4c8b('0x41')](_0x3a7fad[_0x4c8b('0x2f')][_0x4c8b('0x41')]));_0x659bbc['attributes']=_0x659bbc[_0x4c8b('0x31')]['length']?_0x659bbc[_0x4c8b('0x31')]:_0x5c487c[_0x4c8b('0x32')];if(_0x3a7fad[_0x4c8b('0x2f')][_0x4c8b('0x42')]){_0x659bbc['include']=[{'all':!![]}];}_0x659bbc=_[_0x4c8b('0x38')]({},_0x659bbc,_0x3a7fad[_0x4c8b('0x39')]);return db[_0x4c8b('0x3a')]['find'](_0x659bbc)['then'](handleEntityNotFound(_0x3a272a,null))['then'](respondWithResult(_0x3a272a,null))[_0x4c8b('0x3e')](handleError(_0x3a272a,null));};exports[_0x4c8b('0x43')]=function(_0x55af91,_0x21a0eb){return db[_0x4c8b('0x3a')]['create'](_0x55af91['body'],{})[_0x4c8b('0x22')](respondWithResult(_0x21a0eb,0xc9))['catch'](handleError(_0x21a0eb,null));};exports['update']=function(_0xfc96ad,_0x2e5382){if(_0xfc96ad[_0x4c8b('0x44')]['id']){delete _0xfc96ad[_0x4c8b('0x44')]['id'];}return db[_0x4c8b('0x3a')][_0x4c8b('0x45')]({'where':{'id':_0xfc96ad[_0x4c8b('0x46')]['id']}})[_0x4c8b('0x22')](handleEntityNotFound(_0x2e5382,null))[_0x4c8b('0x22')](saveUpdates(_0xfc96ad[_0x4c8b('0x44')],null))['then'](respondWithResult(_0x2e5382,null))[_0x4c8b('0x3e')](handleError(_0x2e5382,null));};exports[_0x4c8b('0x47')]=function(_0x435146,_0x535a61){return db[_0x4c8b('0x3a')][_0x4c8b('0x45')]({'where':{'id':_0x435146[_0x4c8b('0x46')]['id']}})['then'](handleEntityNotFound(_0x535a61,null))[_0x4c8b('0x22')](removeEntity(_0x535a61,null))[_0x4c8b('0x3e')](handleError(_0x535a61,null));};exports[_0x4c8b('0x48')]=function(_0x6a7335,_0x5020b1){return db[_0x4c8b('0x3a')]['describe']()[_0x4c8b('0x22')](respondWithResult(_0x5020b1,null))['catch'](handleError(_0x5020b1,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 88a5d1a..6d29494 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 _0x48af=['../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x388063,_0x24b2b2){var _0x314290=function(_0x1d1a52){while(--_0x1d1a52){_0x388063['push'](_0x388063['shift']());}};_0x314290(++_0x24b2b2);}(_0x48af,0x110));var _0xf48a=function(_0x16b672,_0x29071e){_0x16b672=_0x16b672-0x0;var _0x2d69d2=_0x48af[_0x16b672];return _0x2d69d2;};'use strict';var _=require(_0xf48a('0x0'));var util=require(_0xf48a('0x1'));var logger=require(_0xf48a('0x2'))(_0xf48a('0x3'));var moment=require(_0xf48a('0x4'));var BPromise=require(_0xf48a('0x5'));var rp=require(_0xf48a('0x6'));var fs=require('fs');var path=require(_0xf48a('0x7'));var rimraf=require('rimraf');var config=require(_0xf48a('0x8'));var attributes=require(_0xf48a('0x9'));module[_0xf48a('0xa')]=function(_0x3a2eb9,_0x47424b){return _0x3a2eb9['define'](_0xf48a('0xb'),attributes,{'tableName':_0xf48a('0xc'),'paranoid':![],'indexes':[{'name':_0xf48a('0xd'),'fields':[_0xf48a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6007=['api','moment','path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x228acb,_0x3d4196){var _0x294939=function(_0x2673fc){while(--_0x2673fc){_0x228acb['push'](_0x228acb['shift']());}};_0x294939(++_0x3d4196);}(_0x6007,0xcd));var _0x7600=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0x6007[_0x4b7b69];return _0x173b4c;};'use strict';var _=require(_0x7600('0x0'));var util=require(_0x7600('0x1'));var logger=require(_0x7600('0x2'))(_0x7600('0x3'));var moment=require(_0x7600('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7600('0x5'));var rimraf=require('rimraf');var config=require(_0x7600('0x6'));var attributes=require(_0x7600('0x7'));module[_0x7600('0x8')]=function(_0x4e2d7b,_0x458315){return _0x4e2d7b[_0x7600('0x9')](_0x7600('0xa'),attributes,{'tableName':_0x7600('0xb'),'paranoid':![],'indexes':[{'name':_0x7600('0xc'),'fields':[_0x7600('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 a06917e..2a88cc4 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 _0x60d1=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1cd234,_0x12db2f){var _0x130802=function(_0x22d630){while(--_0x22d630){_0x1cd234['push'](_0x1cd234['shift']());}};_0x130802(++_0x12db2f);}(_0x60d1,0x80));var _0x160d=function(_0x1b46b2,_0x4a9b91){_0x1b46b2=_0x1b46b2-0x0;var _0xc4dec7=_0x60d1[_0x1b46b2];return _0xc4dec7;};'use strict';var _=require('lodash');var util=require(_0x160d('0x0'));var moment=require('moment');var BPromise=require(_0x160d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x160d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x160d('0x3'));var logger=require(_0x160d('0x4'))(_0x160d('0x5'));var config=require(_0x160d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x160d('0x7')][_0x160d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xab6797,_0x2d55b2,_0x5101e6){return new BPromise(function(_0x5417d0,_0x1aa4b0){return client['request'](_0xab6797,_0x5101e6)['then'](function(_0x4d986c){logger[_0x160d('0x9')](_0x160d('0xa'),_0x2d55b2,_0x160d('0xb'));logger[_0x160d('0xc')](_0x160d('0xd'),_0x2d55b2,'request\x20sent',JSON[_0x160d('0xe')](_0x4d986c));if(_0x4d986c['error']){if(_0x4d986c[_0x160d('0xf')][_0x160d('0x10')]===0x1f4){logger[_0x160d('0xf')](_0x160d('0xa'),_0x2d55b2,_0x4d986c[_0x160d('0xf')][_0x160d('0x11')]);return _0x1aa4b0(_0x4d986c[_0x160d('0xf')]['message']);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2d55b2,_0x4d986c[_0x160d('0xf')][_0x160d('0x11')]);return _0x5417d0(_0x4d986c[_0x160d('0xf')][_0x160d('0x11')]);}else{logger['info'](_0x160d('0xa'),_0x2d55b2,_0x160d('0xb'));_0x5417d0(_0x4d986c[_0x160d('0x12')][_0x160d('0x11')]);}})[_0x160d('0x13')](function(_0x4a6222){logger[_0x160d('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x2d55b2,_0x4a6222);_0x1aa4b0(_0x4a6222);});});} \ No newline at end of file +var _0x19fc=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch'];(function(_0x1f5849,_0x59deb6){var _0x5bf165=function(_0x2ce300){while(--_0x2ce300){_0x1f5849['push'](_0x1f5849['shift']());}};_0x5bf165(++_0x59deb6);}(_0x19fc,0xe7));var _0xc19f=function(_0x1af1e1,_0x37bc24){_0x1af1e1=_0x1af1e1-0x0;var _0x5f3450=_0x19fc[_0x1af1e1];return _0x5f3450;};'use strict';var _=require(_0xc19f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc19f('0x1'));var rs=require(_0xc19f('0x2'));var fs=require('fs');var Redis=require(_0xc19f('0x3'));var db=require(_0xc19f('0x4'))['db'];var utils=require(_0xc19f('0x5'));var logger=require(_0xc19f('0x6'))('rpc');var config=require(_0xc19f('0x7'));var jayson=require(_0xc19f('0x8'));var client=jayson['client'][_0xc19f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ee52e,_0x32e333,_0xdfda83){return new BPromise(function(_0x5b1d3b,_0x12ab30){return client[_0xc19f('0xa')](_0x5ee52e,_0xdfda83)[_0xc19f('0xb')](function(_0x2b0062){logger['info'](_0xc19f('0xc'),_0x32e333,_0xc19f('0xd'));logger[_0xc19f('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x32e333,'request\x20sent',JSON['stringify'](_0x2b0062));if(_0x2b0062[_0xc19f('0xf')]){if(_0x2b0062[_0xc19f('0xf')][_0xc19f('0x10')]===0x1f4){logger[_0xc19f('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x32e333,_0x2b0062[_0xc19f('0xf')][_0xc19f('0x11')]);return _0x12ab30(_0x2b0062[_0xc19f('0xf')]['message']);}logger[_0xc19f('0xf')](_0xc19f('0xc'),_0x32e333,_0x2b0062[_0xc19f('0xf')][_0xc19f('0x11')]);return _0x5b1d3b(_0x2b0062['error'][_0xc19f('0x11')]);}else{logger[_0xc19f('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x32e333,_0xc19f('0xd'));_0x5b1d3b(_0x2b0062[_0xc19f('0x13')][_0xc19f('0x11')]);}})[_0xc19f('0x14')](function(_0x594332){logger[_0xc19f('0xf')](_0xc19f('0xc'),_0x32e333,_0x594332);_0x12ab30(_0x594332);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index ca62b3c..62643e0 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 _0xba47=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x8a5bf,_0x32cbce){var _0x531724=function(_0x161d3e){while(--_0x161d3e){_0x8a5bf['push'](_0x8a5bf['shift']());}};_0x531724(++_0x32cbce);}(_0xba47,0x13b));var _0x7ba4=function(_0x49510d,_0x1827a1){_0x49510d=_0x49510d-0x0;var _0x5f5beb=_0xba47[_0x49510d];return _0x5f5beb;};'use strict';var multer=require(_0x7ba4('0x0'));var util=require(_0x7ba4('0x1'));var path=require(_0x7ba4('0x2'));var timeout=require(_0x7ba4('0x3'));var express=require(_0x7ba4('0x4'));var router=express[_0x7ba4('0x5')]();var fs_extra=require(_0x7ba4('0x6'));var auth=require(_0x7ba4('0x7'));var interaction=require(_0x7ba4('0x8'));var config=require(_0x7ba4('0x9'));var controller=require(_0x7ba4('0xa'));router[_0x7ba4('0xb')]('/',auth[_0x7ba4('0xc')](),controller[_0x7ba4('0xd')]);router['get'](_0x7ba4('0xe'),auth[_0x7ba4('0xc')](),controller['describe']);router['get'](_0x7ba4('0xf'),auth[_0x7ba4('0xc')](),controller[_0x7ba4('0x10')]);router['post']('/',auth[_0x7ba4('0xc')](),controller[_0x7ba4('0x11')]);router[_0x7ba4('0x12')](_0x7ba4('0xf'),auth[_0x7ba4('0xc')](),controller[_0x7ba4('0x13')]);router[_0x7ba4('0x14')](_0x7ba4('0xf'),auth['isAuthenticated'](),controller[_0x7ba4('0x15')]);module[_0x7ba4('0x16')]=router; \ No newline at end of file +var _0x9bf8=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x1158d5,_0x4e7ee8){var _0x3e9d61=function(_0x182cc7){while(--_0x182cc7){_0x1158d5['push'](_0x1158d5['shift']());}};_0x3e9d61(++_0x4e7ee8);}(_0x9bf8,0x7f));var _0x89bf=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9bf8[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x89bf('0x0'));var util=require(_0x89bf('0x1'));var path=require(_0x89bf('0x2'));var timeout=require(_0x89bf('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x89bf('0x4'));var auth=require(_0x89bf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x89bf('0x6'));var controller=require('./chatTransferReport.controller');router[_0x89bf('0x7')]('/',auth['isAuthenticated'](),controller[_0x89bf('0x8')]);router[_0x89bf('0x7')](_0x89bf('0x9'),auth['isAuthenticated'](),controller[_0x89bf('0xa')]);router[_0x89bf('0x7')](_0x89bf('0xb'),auth[_0x89bf('0xc')](),controller[_0x89bf('0xd')]);router[_0x89bf('0xe')]('/',auth[_0x89bf('0xc')](),controller[_0x89bf('0xf')]);router[_0x89bf('0x10')](_0x89bf('0xb'),auth[_0x89bf('0xc')](),controller[_0x89bf('0x11')]);router[_0x89bf('0x12')](_0x89bf('0xb'),auth[_0x89bf('0xc')](),controller[_0x89bf('0x13')]);module[_0x89bf('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index ac6f330..366dcb5 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 _0xb821=['All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','address','email','STRING','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','text','name','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','parse','generate'];(function(_0x556bbf,_0x167a87){var _0x3dfe5c=function(_0x112afd){while(--_0x112afd){_0x556bbf['push'](_0x556bbf['shift']());}};_0x3dfe5c(++_0x167a87);}(_0xb821,0xa7));var _0x1b82=function(_0x4590bf,_0x597026){_0x4590bf=_0x4590bf-0x0;var _0x5498c3=_0xb821[_0x4590bf];return _0x5498c3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x1b82('0x0'));module[_0x1b82('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1b82('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x3')},'mapKeyOffline':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x3')},'key':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x5')},'customerAlias':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1b82('0x4')]},'animation':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1b82('0xa')](_0x1b82('0xb'),_0x1b82('0xc')),'defaultValue':_0x1b82('0xb')},'header_online':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0xd')},'offline_chat_button':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1b82('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x12')},'placeholderMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0xe')},'skipMessageButton':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0x1b82('0x16'),_0x1b82('0x17')),'defaultValue':_0x1b82('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':function(){return JSON[_0x1b82('0x18')]({'items':[{'type':_0x1b82('0x19'),'variable':null,'config':{'placeholder':'name','type':_0x1b82('0x1a'),'required':!![]},'props':{'title':_0x1b82('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0x1b82('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1b82('0x3'),'type':_0x1b82('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x1b82('0x1c'))?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0xf2e556){return this[_0x1b82('0x1d')](_0x1b82('0x1c'),JSON[_0x1b82('0x18')](_0xf2e556));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1b82('0x18')]({'items':[{'type':_0x1b82('0x19'),'props':{'title':_0x1b82('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1b82('0x3'),'type':_0x1b82('0x3')},'variable':null},{'type':_0x1b82('0x1e'),'config':{'placeholder':_0x1b82('0x1f')},'props':{'title':_0x1b82('0x1f'),'helpText':_0x1b82('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x1b82('0x21')](_0x1b82('0x22'))?JSON[_0x1b82('0x23')](this[_0x1b82('0x21')]('offlineForm')):{};},'set':function(_0x17b3aa){return this[_0x1b82('0x1d')](_0x1b82('0x22'),JSON[_0x1b82('0x18')](_0x17b3aa));}},'token':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':function(){return rs[_0x1b82('0x24')]();}},'autoclose':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1b82('0x4')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1b82('0x4')]},'waitingTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x25')},'waitingMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x14')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1b82('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1b82('0x4')]},'notificationTemplate':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':function(){return _0x1b82('0x28');}},'notificationSound':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2b')},'messagesAlignment':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2c')},'defaultTitle':{'type':Sequelize[_0x1b82('0x4')]},'customerAvatar':{'type':Sequelize[_0x1b82('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2d')},'systemAvatar':{'type':Sequelize[_0x1b82('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1b82('0x8')],'comment':_0x1b82('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x17d214){if(!_0x17d214)this['setDataValue'](_0x1b82('0x2f'),null);this['setDataValue'](_0x1b82('0x30'),_0x17d214);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x31')},'vidaooNote':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':function(){return _0x1b82('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1b82('0x10')]}}; \ No newline at end of file +var _0xf109=['#011F6A','#ffffff','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','INTEGER','stringify','input','name','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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.','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','Agent'];(function(_0x2ec917,_0x136567){var _0x581a17=function(_0x209da3){while(--_0x209da3){_0x2ec917['push'](_0x2ec917['shift']());}};_0x581a17(++_0x136567);}(_0xf109,0xce));var _0x9f10=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xf109[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require(_0x9f10('0x0'));var rs=require(_0x9f10('0x1'));module[_0x9f10('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x9f10('0x3')]},'mapKey':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x4')},'mapKeyOffline':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x4')},'key':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x5')},'customerAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9f10('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9f10('0x3')]},'animation':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9f10('0x9')]('rounded','squared'),'defaultValue':_0x9f10('0xa')},'header_online':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xc')},'offline_chat_button':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xe')},'download_transcript':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x12')},'noteTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x16')},'ratingType':{'type':Sequelize[_0x9f10('0x9')](_0x9f10('0x17'),_0x9f10('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x9f10('0x1a')]({'items':[{'type':_0x9f10('0x1b'),'variable':null,'config':{'placeholder':_0x9f10('0x1c'),'type':'text','required':!![]},'props':{'title':_0x9f10('0x1c'),'helpText':''}},{'type':_0x9f10('0x1b'),'props':{'title':_0x9f10('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x9f10('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9f10('0x1d')](_0x9f10('0x1e'))?JSON['parse'](this[_0x9f10('0x1d')](_0x9f10('0x1e'))):{};},'set':function(_0x11cae7){return this[_0x9f10('0x1f')]('onlineForm',JSON['stringify'](_0x11cae7));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x9f10('0x1a')]({'items':[{'type':'input','props':{'title':_0x9f10('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9f10('0x4'),'type':_0x9f10('0x4')},'variable':null},{'type':_0x9f10('0x20'),'config':{'placeholder':_0x9f10('0x21')},'props':{'title':'Comments','helpText':_0x9f10('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x9f10('0x1d')](_0x9f10('0x23'))?JSON[_0x9f10('0x24')](this[_0x9f10('0x1d')](_0x9f10('0x23'))):{};},'set':function(_0x581b1d){return this[_0x9f10('0x1f')](_0x9f10('0x23'),JSON[_0x9f10('0x1a')](_0x581b1d));}},'token':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x25')},'waitingMessage':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x26')},'offlineMessageBody':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x15')},'sendUnmanaged':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9f10('0x29')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9f10('0x3')]},'notificationTemplate':{'type':Sequelize[_0x9f10('0x29')],'defaultValue':function(){return _0x9f10('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2c')},'verticalAlignment':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2d')},'messagesAlignment':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2e')},'defaultTitle':{'type':Sequelize[_0x9f10('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9f10('0x19')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9f10('0x19')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x9f10('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![],'comment':_0x9f10('0x31'),'set':function(_0x433e70){if(!_0x433e70)this[_0x9f10('0x1f')](_0x9f10('0x32'),null);this[_0x9f10('0x1f')](_0x9f10('0x33'),_0x433e70);}},'vidaooEscalation':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9f10('0x3')]},'vidaooTopic':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index ee5f837..195de71 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 _0xc3e5=['mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','Applications','account','applications','orderBy','priority','asc','defaults','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','unknown','%s\x20%s','device','format','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','URL','address','remote','x-real-ip','connection','remoteAddress','replace','render','verticalAlignment','textColor','textButtonColor','backgroundColor','addApplications','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','url','../../mysqldb','localhost','register','html-to-text','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','ChatWebsites','UserProfileResource','stack','name','send','index','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','Pause','mandatoryDispositionPause','find','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','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','filename','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','ValidationError'];(function(_0x30ddfe,_0x24b125){var _0x5c2d5a=function(_0x229de4){while(--_0x229de4){_0x30ddfe['push'](_0x30ddfe['shift']());}};_0x5c2d5a(++_0x24b125);}(_0xc3e5,0x1c7));var _0x5c3e=function(_0x4ac8ff,_0x41ad3c){_0x4ac8ff=_0x4ac8ff-0x0;var _0x43d0a1=_0xc3e5[_0x4ac8ff];return _0x43d0a1;};'use strict';var BPromise=require(_0x5c3e('0x0'));var Mustache=require(_0x5c3e('0x1'));var util=require(_0x5c3e('0x2'));var path=require(_0x5c3e('0x3'));var ejs=require(_0x5c3e('0x4'));var fs=require('fs');var fs_extra=require(_0x5c3e('0x5'));var _=require('lodash');var querystring=require(_0x5c3e('0x6'));var Redis=require(_0x5c3e('0x7'));var qs=require(_0x5c3e('0x8'));var logger=require(_0x5c3e('0x9'))('api');var config=require(_0x5c3e('0xa'));var url=require(_0x5c3e('0xb'));var db=require(_0x5c3e('0xc'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x5c3e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x5c3e('0xe')](socket);var htmlToText=require(_0x5c3e('0xf'));var jayson=require('jayson/promise');var client=jayson[_0x5c3e('0x10')]['http']({'port':0x232c});var client9002=jayson[_0x5c3e('0x10')]['http']({'port':0x232a});var client9003=jayson[_0x5c3e('0x10')][_0x5c3e('0x11')]({'port':0x232b});var client9001=jayson[_0x5c3e('0x10')][_0x5c3e('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x4c0b7c,_0x28fdfc,_0x474815,_0x4f4de4){return new BPromise(function(_0xff4d6d,_0x45e5eb){var _0x4205f5=_0x4f4de4||client;return _0x4205f5[_0x5c3e('0x12')](_0x4c0b7c,_0x474815)[_0x5c3e('0x13')](function(_0x1fd7a5){logger[_0x5c3e('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x28fdfc,_0x5c3e('0x15'));logger[_0x5c3e('0x16')](_0x5c3e('0x17'),_0x28fdfc,_0x5c3e('0x15'),JSON[_0x5c3e('0x18')](_0x1fd7a5));if(_0x1fd7a5[_0x5c3e('0x19')]){if(_0x1fd7a5[_0x5c3e('0x19')][_0x5c3e('0x1a')]===0x1f4){logger[_0x5c3e('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x28fdfc,_0x1fd7a5[_0x5c3e('0x19')][_0x5c3e('0x1b')]);return _0x45e5eb(_0x1fd7a5['error'][_0x5c3e('0x1b')]);}logger[_0x5c3e('0x19')](_0x5c3e('0x1c'),_0x28fdfc,_0x1fd7a5[_0x5c3e('0x19')][_0x5c3e('0x1b')]);return _0xff4d6d(_0x1fd7a5[_0x5c3e('0x19')][_0x5c3e('0x1b')]);}else{logger[_0x5c3e('0x14')](_0x5c3e('0x1c'),_0x28fdfc,'request\x20sent');_0xff4d6d(_0x1fd7a5['result']['message']);}})[_0x5c3e('0x1d')](function(_0x3f1143){logger[_0x5c3e('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x28fdfc,_0x3f1143);_0x45e5eb(_0x3f1143);});});}function respondWithStatusCode(_0x3326da,_0x455ef3){_0x455ef3=_0x455ef3||0xcc;return function(_0x5c0cde){if(_0x5c0cde){return _0x3326da[_0x5c3e('0x1e')](_0x455ef3);}return _0x3326da[_0x5c3e('0x1f')](_0x455ef3)[_0x5c3e('0x20')]();};}function respondWithResult(_0x1e1451,_0x3fd33e){_0x3fd33e=_0x3fd33e||0xc8;return function(_0x34be76){if(_0x34be76){return _0x1e1451['status'](_0x3fd33e)[_0x5c3e('0x21')](_0x34be76);}};}function respondWithFilteredResult(_0x1babed,_0x461ce2){return function(_0x2f6425){if(_0x2f6425){var _0x118b02=typeof _0x461ce2[_0x5c3e('0x22')]===_0x5c3e('0x23')&&typeof _0x461ce2['limit']===_0x5c3e('0x23');var _0x35bc61=_0x2f6425[_0x5c3e('0x24')];var _0x56332c=_0x118b02?0x0:_0x461ce2[_0x5c3e('0x22')];var _0x3d8362=_0x118b02?_0x2f6425[_0x5c3e('0x24')]:_0x461ce2[_0x5c3e('0x22')]+_0x461ce2[_0x5c3e('0x25')];var _0x13fc49;if(_0x3d8362>=_0x35bc61){_0x3d8362=_0x35bc61;_0x13fc49=0xc8;}else{_0x13fc49=0xce;}_0x1babed['status'](_0x13fc49);return _0x1babed[_0x5c3e('0x26')](_0x5c3e('0x27'),_0x56332c+'-'+_0x3d8362+'/'+_0x35bc61)['json'](_0x2f6425);}return null;};}function saveUpdates(_0x22f958){return function(_0x7c3275){if(_0x7c3275){return _0x7c3275[_0x5c3e('0x28')](_0x22f958)[_0x5c3e('0x13')](function(_0x41d343){return _0x41d343;});}return null;};}function removeEntity(_0x40016a){return function(_0x29232b){if(_0x29232b){return _0x29232b[_0x5c3e('0x29')]()[_0x5c3e('0x13')](function(){var _0x2c9fa2=_0x29232b['get']({'plain':!![]});var _0x47fb25=_0x5c3e('0x2a');return db[_0x5c3e('0x2b')][_0x5c3e('0x29')]({'where':{'type':_0x47fb25,'resourceId':_0x2c9fa2['id']}})[_0x5c3e('0x13')](function(){return _0x29232b;});})[_0x5c3e('0x13')](function(){_0x40016a[_0x5c3e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa5cbe5){return function(_0x443236){if(!_0x443236){_0xa5cbe5['sendStatus'](0x194);}return _0x443236;};}function handleError(_0x38d2db,_0x46e679){_0x46e679=_0x46e679||0x1f4;return function(_0x5d7912){logger[_0x5c3e('0x19')](_0x5d7912[_0x5c3e('0x2c')]);if(_0x5d7912[_0x5c3e('0x2d')]){delete _0x5d7912[_0x5c3e('0x2d')];}_0x38d2db[_0x5c3e('0x1f')](_0x46e679)[_0x5c3e('0x2e')](_0x5d7912);};}exports[_0x5c3e('0x2f')]=function(_0x3e79d1,_0x115ae9){var _0x5daf16={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x59fd64={},_0x431060={'count':0x0,'rows':[]};var _0x125fac=_[_0x5c3e('0x30')](db[_0x5c3e('0x31')][_0x5c3e('0x32')],function(_0x874e66){return{'name':_0x874e66[_0x5c3e('0x33')],'type':_0x874e66[_0x5c3e('0x34')][_0x5c3e('0x35')]};});_0x59fd64[_0x5c3e('0x36')]=_[_0x5c3e('0x30')](_0x125fac,_0x5c3e('0x2d'));_0x59fd64[_0x5c3e('0x37')]=_[_0x5c3e('0x38')](_0x3e79d1[_0x5c3e('0x37')]);_0x59fd64[_0x5c3e('0x39')]=_[_0x5c3e('0x3a')](_0x59fd64[_0x5c3e('0x36')],_0x59fd64[_0x5c3e('0x37')]);_0x5daf16['attributes']=_[_0x5c3e('0x3a')](_0x59fd64[_0x5c3e('0x36')],qs[_0x5c3e('0x3b')](_0x3e79d1['query']['fields']));_0x5daf16['attributes']=_0x5daf16[_0x5c3e('0x3c')][_0x5c3e('0x3d')]?_0x5daf16[_0x5c3e('0x3c')]:_0x59fd64[_0x5c3e('0x36')];if(!_0x3e79d1[_0x5c3e('0x37')][_0x5c3e('0x3e')](_0x5c3e('0x3f'))){_0x5daf16['limit']=qs[_0x5c3e('0x25')](_0x3e79d1['query'][_0x5c3e('0x25')]);_0x5daf16[_0x5c3e('0x22')]=qs[_0x5c3e('0x22')](_0x3e79d1[_0x5c3e('0x37')]['offset']);}_0x5daf16[_0x5c3e('0x40')]=qs[_0x5c3e('0x41')](_0x3e79d1[_0x5c3e('0x37')][_0x5c3e('0x41')]);_0x5daf16[_0x5c3e('0x42')]=qs[_0x5c3e('0x39')](_[_0x5c3e('0x43')](_0x3e79d1[_0x5c3e('0x37')],_0x59fd64[_0x5c3e('0x39')]),_0x125fac);if(_0x3e79d1[_0x5c3e('0x37')][_0x5c3e('0x44')]){_0x5daf16[_0x5c3e('0x42')]=_['merge'](_0x5daf16[_0x5c3e('0x42')],{'$or':_['map'](_0x125fac,function(_0x5da4a7){if(_0x5da4a7[_0x5c3e('0x34')]!=='VIRTUAL'){var _0x26f749={};_0x26f749[_0x5da4a7['name']]={'$like':'%'+_0x3e79d1[_0x5c3e('0x37')][_0x5c3e('0x44')]+'%'};return _0x26f749;}})});}_0x5daf16=_[_0x5c3e('0x45')]({},_0x5daf16,_0x3e79d1[_0x5c3e('0x46')]);var _0x5206e8={'where':_0x5daf16[_0x5c3e('0x42')]};return db[_0x5c3e('0x31')][_0x5c3e('0x24')](_0x5206e8)[_0x5c3e('0x13')](function(_0x2ef306){_0x431060[_0x5c3e('0x24')]=_0x2ef306;if(_0x3e79d1[_0x5c3e('0x37')][_0x5c3e('0x47')]){_0x5daf16[_0x5c3e('0x48')]=[{'all':!![]}];}return db['ChatWebsite'][_0x5c3e('0x49')](_0x5daf16);})['then'](function(_0x1381b5){_0x431060[_0x5c3e('0x4a')]=_0x1381b5;return _0x431060;})[_0x5c3e('0x13')](respondWithFilteredResult(_0x115ae9,_0x5daf16))[_0x5c3e('0x1d')](handleError(_0x115ae9,null));};exports[_0x5c3e('0x4b')]=function(_0x310774,_0x168123){var _0xe460d0={'raw':![],'where':{'id':_0x310774[_0x5c3e('0x4c')]['id']},'include':[{'model':db[_0x5c3e('0x4d')],'as':_0x5c3e('0x4e')}]},_0x32ba8f={};_0x32ba8f[_0x5c3e('0x36')]=_['keys'](db['ChatWebsite'][_0x5c3e('0x32')]);_0x32ba8f[_0x5c3e('0x37')]=_[_0x5c3e('0x38')](_0x310774[_0x5c3e('0x37')]);_0x32ba8f[_0x5c3e('0x39')]=_[_0x5c3e('0x3a')](_0x32ba8f[_0x5c3e('0x36')],_0x32ba8f['query']);_0xe460d0['attributes']=_[_0x5c3e('0x3a')](_0x32ba8f['model'],qs['fields'](_0x310774[_0x5c3e('0x37')][_0x5c3e('0x3b')]));_0xe460d0['attributes']=_0xe460d0[_0x5c3e('0x3c')][_0x5c3e('0x3d')]?_0xe460d0['attributes']:_0x32ba8f[_0x5c3e('0x36')];if(_0x310774['query'][_0x5c3e('0x47')]){_0xe460d0[_0x5c3e('0x48')]=[{'all':!![]}];}_0xe460d0=_['merge']({},_0xe460d0,_0x310774[_0x5c3e('0x46')]);return db[_0x5c3e('0x31')][_0x5c3e('0x4f')](_0xe460d0)[_0x5c3e('0x13')](handleEntityNotFound(_0x168123,null))[_0x5c3e('0x13')](respondWithResult(_0x168123,null))['catch'](handleError(_0x168123,null));};exports['create']=function(_0x26ee1f,_0xdc4200){return db[_0x5c3e('0x31')][_0x5c3e('0x50')](_0x26ee1f[_0x5c3e('0x51')],{})[_0x5c3e('0x13')](function(_0x3281bd){var _0x3dd858=_0x26ee1f['user'][_0x5c3e('0x52')]({'plain':!![]});if(!_0x3dd858)throw new Error(_0x5c3e('0x53'));if(_0x3dd858[_0x5c3e('0x54')]===_0x5c3e('0x55')){var _0x224c74=_0x3281bd['get']({'plain':!![]});var _0x26ffa7='ChatWebsites';return db[_0x5c3e('0x56')]['find']({'where':{'name':_0x26ffa7,'userProfileId':_0x3dd858[_0x5c3e('0x57')]},'raw':!![]})['then'](function(_0x56834b){if(_0x56834b&&_0x56834b[_0x5c3e('0x58')]===0x0){return db[_0x5c3e('0x2b')][_0x5c3e('0x50')]({'name':_0x224c74[_0x5c3e('0x2d')],'resourceId':_0x224c74['id'],'type':_0x56834b['name'],'sectionId':_0x56834b['id']},{})['then'](function(){return _0x3281bd;});}else{return _0x3281bd;}})['catch'](function(_0x32eea8){logger[_0x5c3e('0x19')](_0x5c3e('0x59'),_0x32eea8);throw _0x32eea8;});}return _0x3281bd;})[_0x5c3e('0x13')](respondWithResult(_0xdc4200,0xc9))['catch'](handleError(_0xdc4200,null));};exports[_0x5c3e('0x28')]=function(_0x5576cb,_0x4c5fa2){if(_0x5576cb[_0x5c3e('0x51')]['id']){delete _0x5576cb[_0x5c3e('0x51')]['id'];}return db[_0x5c3e('0x31')][_0x5c3e('0x4f')]({'where':{'id':_0x5576cb[_0x5c3e('0x4c')]['id']},'include':[{'model':db[_0x5c3e('0x4d')],'as':_0x5c3e('0x4e')}]})['then'](handleEntityNotFound(_0x4c5fa2,null))[_0x5c3e('0x13')](saveUpdates(_0x5576cb[_0x5c3e('0x51')],null))[_0x5c3e('0x13')](respondWithResult(_0x4c5fa2,null))[_0x5c3e('0x1d')](handleError(_0x4c5fa2,null));};exports[_0x5c3e('0x29')]=function(_0x324d5f,_0x3a1cef){return db[_0x5c3e('0x31')][_0x5c3e('0x4f')]({'where':{'id':_0x324d5f[_0x5c3e('0x4c')]['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x3a1cef,null))[_0x5c3e('0x13')](removeEntity(_0x3a1cef,null))[_0x5c3e('0x1d')](handleError(_0x3a1cef,null));};exports['describe']=function(_0x5bb2d2,_0x184638){return db[_0x5c3e('0x31')][_0x5c3e('0x5a')]()['then'](respondWithResult(_0x184638,null))[_0x5c3e('0x1d')](handleError(_0x184638,null));};exports[_0x5c3e('0x5b')]=function(_0x31b18e,_0x3f6a71){if(_0x31b18e['body']['id']){delete _0x31b18e[_0x5c3e('0x51')]['id'];}return db[_0x5c3e('0x31')][_0x5c3e('0x4f')]({'where':{'id':_0x31b18e['params']['id']}})['then'](handleEntityNotFound(_0x3f6a71,null))[_0x5c3e('0x13')](function(_0x1431d0){if(_0x1431d0){_0x31b18e[_0x5c3e('0x51')][_0x5c3e('0x5c')]=_0x1431d0['id'];return db[_0x5c3e('0x5d')][_0x5c3e('0x50')](_0x31b18e[_0x5c3e('0x51')]);}})[_0x5c3e('0x13')](respondWithResult(_0x3f6a71,null))[_0x5c3e('0x1d')](handleError(_0x3f6a71,null));};exports[_0x5c3e('0x5e')]=function(_0x581fe1,_0x5e91ed){var _0x47a87d={'raw':![],'where':{}};var _0x49cd31={};var _0x322536={'count':0x0,'rows':[]};return db[_0x5c3e('0x31')][_0x5c3e('0x5f')]({'where':{'id':_0x581fe1[_0x5c3e('0x4c')]['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x5e91ed,null))[_0x5c3e('0x13')](function(_0x27beed){if(_0x27beed){_0x49cd31[_0x5c3e('0x36')]=_['keys'](db['Disposition']['rawAttributes']);_0x49cd31[_0x5c3e('0x37')]=_['keys'](_0x581fe1[_0x5c3e('0x37')]);_0x49cd31[_0x5c3e('0x39')]=_['intersection'](_0x49cd31[_0x5c3e('0x36')],_0x49cd31[_0x5c3e('0x37')]);_0x47a87d[_0x5c3e('0x3c')]=_[_0x5c3e('0x3a')](_0x49cd31[_0x5c3e('0x36')],qs[_0x5c3e('0x3b')](_0x581fe1[_0x5c3e('0x37')][_0x5c3e('0x3b')]));_0x47a87d['attributes']=_0x47a87d[_0x5c3e('0x3c')][_0x5c3e('0x3d')]?_0x47a87d['attributes']:_0x49cd31[_0x5c3e('0x36')];if(!_0x581fe1[_0x5c3e('0x37')][_0x5c3e('0x3e')](_0x5c3e('0x3f'))){_0x47a87d[_0x5c3e('0x25')]=qs[_0x5c3e('0x25')](_0x581fe1[_0x5c3e('0x37')][_0x5c3e('0x25')]);_0x47a87d[_0x5c3e('0x22')]=qs[_0x5c3e('0x22')](_0x581fe1[_0x5c3e('0x37')][_0x5c3e('0x22')]);}_0x47a87d[_0x5c3e('0x40')]=qs[_0x5c3e('0x41')](_0x581fe1['query'][_0x5c3e('0x41')]);_0x47a87d['where']=qs[_0x5c3e('0x39')](_['pick'](_0x581fe1[_0x5c3e('0x37')],_0x49cd31[_0x5c3e('0x39')]));_0x47a87d['where']['ChatWebsiteId']=_0x27beed['id'];if(_0x581fe1[_0x5c3e('0x37')][_0x5c3e('0x44')]){_0x47a87d[_0x5c3e('0x42')]=_[_0x5c3e('0x45')](_0x47a87d[_0x5c3e('0x42')],{'$or':_['map'](_0x47a87d[_0x5c3e('0x3c')],function(_0x386a8d){var _0x542c72={};_0x542c72[_0x386a8d]={'$like':'%'+_0x581fe1[_0x5c3e('0x37')][_0x5c3e('0x44')]+'%'};return _0x542c72;})});}_0x47a87d=_[_0x5c3e('0x45')]({},_0x47a87d,_0x581fe1[_0x5c3e('0x46')]);return db[_0x5c3e('0x5d')][_0x5c3e('0x24')]({'where':_0x47a87d[_0x5c3e('0x42')]})[_0x5c3e('0x13')](function(_0x56b23f){_0x322536[_0x5c3e('0x24')]=_0x56b23f;if(_0x581fe1[_0x5c3e('0x37')][_0x5c3e('0x47')]){_0x47a87d[_0x5c3e('0x48')]=[{'all':!![]}];}return db[_0x5c3e('0x5d')]['findAll'](_0x47a87d);})[_0x5c3e('0x13')](function(_0x63e0a7){_0x322536[_0x5c3e('0x4a')]=_0x63e0a7;return _0x322536;});}})[_0x5c3e('0x13')](respondWithFilteredResult(_0x5e91ed,_0x47a87d))['catch'](handleError(_0x5e91ed,null));};exports[_0x5c3e('0x60')]=function(_0xb09865,_0x4779ed){return db[_0x5c3e('0x31')]['find']({'where':{'id':_0xb09865[_0x5c3e('0x4c')]['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x4779ed,null))[_0x5c3e('0x13')](function(_0x39d3e6){if(_0x39d3e6){return _0x39d3e6[_0x5c3e('0x60')](_0xb09865[_0x5c3e('0x37')][_0x5c3e('0x61')]);}})['then'](respondWithStatusCode(_0x4779ed,null))['catch'](handleError(_0x4779ed,null));};exports['addAnswer']=function(_0x17019f,_0x31f073){if(_0x17019f[_0x5c3e('0x51')]['id']){delete _0x17019f[_0x5c3e('0x51')]['id'];}return db[_0x5c3e('0x31')][_0x5c3e('0x4f')]({'where':{'id':_0x17019f[_0x5c3e('0x4c')]['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x31f073,null))[_0x5c3e('0x13')](function(_0x3b0009){if(_0x3b0009){_0x17019f[_0x5c3e('0x51')][_0x5c3e('0x5c')]=_0x3b0009['id'];return db['CannedAnswer'][_0x5c3e('0x50')](_0x17019f['body']);}})['then'](respondWithResult(_0x31f073,null))[_0x5c3e('0x1d')](handleError(_0x31f073,null));};exports['getAnswers']=function(_0x4d58c8,_0x107163){var _0x2776e1={'raw':![],'where':{}};var _0x538bc8={};var _0x5625f0={'count':0x0,'rows':[]};return db[_0x5c3e('0x31')]['findOne']({'where':{'id':_0x4d58c8['params']['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x107163,null))['then'](function(_0x172e62){if(_0x172e62){_0x538bc8[_0x5c3e('0x36')]=_[_0x5c3e('0x38')](db[_0x5c3e('0x62')]['rawAttributes']);_0x538bc8[_0x5c3e('0x37')]=_[_0x5c3e('0x38')](_0x4d58c8[_0x5c3e('0x37')]);_0x538bc8[_0x5c3e('0x39')]=_['intersection'](_0x538bc8['model'],_0x538bc8[_0x5c3e('0x37')]);_0x2776e1[_0x5c3e('0x3c')]=_['intersection'](_0x538bc8['model'],qs['fields'](_0x4d58c8['query'][_0x5c3e('0x3b')]));_0x2776e1[_0x5c3e('0x3c')]=_0x2776e1[_0x5c3e('0x3c')][_0x5c3e('0x3d')]?_0x2776e1[_0x5c3e('0x3c')]:_0x538bc8[_0x5c3e('0x36')];if(!_0x4d58c8[_0x5c3e('0x37')]['hasOwnProperty']('nolimit')){_0x2776e1[_0x5c3e('0x25')]=qs['limit'](_0x4d58c8[_0x5c3e('0x37')]['limit']);_0x2776e1[_0x5c3e('0x22')]=qs[_0x5c3e('0x22')](_0x4d58c8['query'][_0x5c3e('0x22')]);}_0x2776e1[_0x5c3e('0x40')]=qs['sort'](_0x4d58c8['query'][_0x5c3e('0x41')]);_0x2776e1['where']=qs[_0x5c3e('0x39')](_[_0x5c3e('0x43')](_0x4d58c8[_0x5c3e('0x37')],_0x538bc8[_0x5c3e('0x39')]));_0x2776e1[_0x5c3e('0x42')]['ChatWebsiteId']=_0x172e62['id'];if(_0x4d58c8[_0x5c3e('0x37')][_0x5c3e('0x44')]){_0x2776e1[_0x5c3e('0x42')]=_['merge'](_0x2776e1['where'],{'$or':_[_0x5c3e('0x30')](_0x2776e1[_0x5c3e('0x3c')],function(_0xd51b0a){var _0x4300f0={};_0x4300f0[_0xd51b0a]={'$like':'%'+_0x4d58c8[_0x5c3e('0x37')][_0x5c3e('0x44')]+'%'};return _0x4300f0;})});}_0x2776e1=_[_0x5c3e('0x45')]({},_0x2776e1,_0x4d58c8[_0x5c3e('0x46')]);return db[_0x5c3e('0x62')][_0x5c3e('0x24')]({'where':_0x2776e1[_0x5c3e('0x42')]})[_0x5c3e('0x13')](function(_0x755343){_0x5625f0[_0x5c3e('0x24')]=_0x755343;if(_0x4d58c8['query'][_0x5c3e('0x47')]){_0x2776e1['include']=[{'all':!![]}];}return db[_0x5c3e('0x62')][_0x5c3e('0x49')](_0x2776e1);})[_0x5c3e('0x13')](function(_0x45f961){_0x5625f0[_0x5c3e('0x4a')]=_0x45f961;return _0x5625f0;});}})[_0x5c3e('0x13')](respondWithFilteredResult(_0x107163,_0x2776e1))['catch'](handleError(_0x107163,null));};exports['removeAnswers']=function(_0x20f45c,_0x195d23){return db['ChatWebsite'][_0x5c3e('0x4f')]({'where':{'id':_0x20f45c['params']['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x195d23,null))['then'](function(_0x977ce8){if(_0x977ce8){return _0x977ce8[_0x5c3e('0x63')](_0x20f45c[_0x5c3e('0x37')][_0x5c3e('0x61')]);}})[_0x5c3e('0x13')](respondWithStatusCode(_0x195d23,null))[_0x5c3e('0x1d')](handleError(_0x195d23,null));};exports[_0x5c3e('0x64')]=function(_0x46369f,_0x14c40e){_0x46369f[_0x5c3e('0x51')][_0x5c3e('0x65')]=_0x46369f['file']['filename'];return db[_0x5c3e('0x31')][_0x5c3e('0x4f')]({'where':{'id':_0x46369f[_0x5c3e('0x4c')]['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x14c40e,null))['then'](saveUpdates(_0x46369f[_0x5c3e('0x51')],null))[_0x5c3e('0x13')](respondWithResult(_0x14c40e,null))[_0x5c3e('0x1d')](handleError(_0x14c40e,null));};exports[_0x5c3e('0x66')]=function(_0x519215,_0x5144dc){_0x519215['body'][_0x5c3e('0x67')]=_0x519215['file']['filename'];return db[_0x5c3e('0x31')][_0x5c3e('0x4f')]({'where':{'id':_0x519215[_0x5c3e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5144dc,null))['then'](saveUpdates(_0x519215[_0x5c3e('0x51')],null))[_0x5c3e('0x13')](respondWithResult(_0x5144dc,null))[_0x5c3e('0x1d')](handleError(_0x5144dc,null));};exports['addCustomerAvatar']=function(_0x1a88e9,_0x1c1178){_0x1a88e9[_0x5c3e('0x51')]['customerAvatar']=_0x1a88e9[_0x5c3e('0x68')][_0x5c3e('0x69')];return db[_0x5c3e('0x31')][_0x5c3e('0x4f')]({'where':{'id':_0x1a88e9[_0x5c3e('0x4c')]['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x1c1178,null))[_0x5c3e('0x13')](saveUpdates(_0x1a88e9[_0x5c3e('0x51')],null))['then'](respondWithResult(_0x1c1178,null))[_0x5c3e('0x1d')](handleError(_0x1c1178,null));};exports[_0x5c3e('0x6a')]=function(_0x102edd,_0x4c7149){_0x102edd['body'][_0x5c3e('0x6b')]=_0x102edd[_0x5c3e('0x68')]['filename'];return db[_0x5c3e('0x31')][_0x5c3e('0x4f')]({'where':{'id':_0x102edd[_0x5c3e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4c7149,null))[_0x5c3e('0x13')](saveUpdates(_0x102edd['body'],null))['then'](respondWithResult(_0x4c7149,null))[_0x5c3e('0x1d')](handleError(_0x4c7149,null));};exports[_0x5c3e('0x6c')]=function(_0x62062f,_0x13a177){var _0x121efb=path[_0x5c3e('0x6d')](config[_0x5c3e('0x6e')],_0x5c3e('0x6f'));var _0x35116f={'where':{'id':_0x62062f[_0x5c3e('0x4c')]['id']},'attributes':['id',_0x5c3e('0x65')],'raw':!![]};var _0x11ebf2=![];return require(_0x5c3e('0x70'))['getLicense']()[_0x5c3e('0x13')](function(_0x3b1773){if(_0x3b1773){_0x11ebf2=_0x3b1773[_0x5c3e('0x71')];}})[_0x5c3e('0x13')](function(){return db[_0x5c3e('0x31')][_0x5c3e('0x4f')](_0x35116f);})['then'](handleEntityNotFound(_0x13a177,null))[_0x5c3e('0x13')](function(_0x386548){if(_0x386548){if(!_[_0x5c3e('0x72')](_0x386548[_0x5c3e('0x65')])){if(fs[_0x5c3e('0x73')](path[_0x5c3e('0x6d')](config[_0x5c3e('0x6e')],_0x5c3e('0x74'),_0x386548[_0x5c3e('0x65')]))&&_0x11ebf2){_0x121efb=path['join'](config['root'],_0x5c3e('0x74'),_0x386548[_0x5c3e('0x65')]);}}return _0x13a177[_0x5c3e('0x75')](_0x121efb);}})[_0x5c3e('0x1d')](handleError(_0x13a177,null));};exports['getAvatar']=function(_0x270683,_0x32e16e){var _0x1c8e29=path['join'](config[_0x5c3e('0x6e')],_0x5c3e('0x76'));var _0x1eab61={'where':{'id':_0x270683['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0x5c3e('0x4f')](_0x1eab61)['then'](handleEntityNotFound(_0x32e16e,null))[_0x5c3e('0x13')](function(_0x2c502d){if(_0x2c502d){if(!_['isNil'](_0x2c502d[_0x5c3e('0x67')])){if(fs[_0x5c3e('0x73')](path[_0x5c3e('0x6d')](config['root'],_0x5c3e('0x77'),_0x2c502d['agentAvatar']))){_0x1c8e29=path['join'](config[_0x5c3e('0x6e')],_0x5c3e('0x77'),_0x2c502d[_0x5c3e('0x67')]);}}return _0x32e16e[_0x5c3e('0x75')](_0x1c8e29);}})[_0x5c3e('0x1d')](handleError(_0x32e16e,null));};exports[_0x5c3e('0x78')]=function(_0x1683e9,_0x480837){var _0x56c625=path[_0x5c3e('0x6d')](config[_0x5c3e('0x6e')],_0x5c3e('0x79'));var _0x56e55d={'where':{'id':_0x1683e9[_0x5c3e('0x4c')]['id']},'attributes':['id',_0x5c3e('0x7a'),_0x5c3e('0x7b')],'raw':!![]};return db['ChatWebsite'][_0x5c3e('0x4f')](_0x56e55d)[_0x5c3e('0x13')](handleEntityNotFound(_0x480837,null))[_0x5c3e('0x13')](function(_0x26048a){if(_0x26048a){if(!_['isNil'](_0x26048a[_0x5c3e('0x7a')])){if(fs[_0x5c3e('0x73')](path[_0x5c3e('0x6d')](config[_0x5c3e('0x6e')],'server/files/images/avatars/',_0x26048a[_0x5c3e('0x7a')]))&&_0x26048a[_0x5c3e('0x7b')]){_0x56c625=path['join'](config[_0x5c3e('0x6e')],_0x5c3e('0x77'),_0x26048a[_0x5c3e('0x7a')]);}}return _0x480837['download'](_0x56c625);}})[_0x5c3e('0x1d')](handleError(_0x480837,null));};exports['getSystemAvatar']=function(_0x4d5f4b,_0x56d08b){var _0x1af2d7=path[_0x5c3e('0x6d')](config[_0x5c3e('0x6e')],'server/files/images/avatars/system_avatar.png');var _0x112124={'where':{'id':_0x4d5f4b[_0x5c3e('0x4c')]['id']},'attributes':['id',_0x5c3e('0x6b')],'raw':!![]};return db[_0x5c3e('0x31')]['find'](_0x112124)[_0x5c3e('0x13')](handleEntityNotFound(_0x56d08b,null))[_0x5c3e('0x13')](function(_0x1241ce){if(_0x1241ce){if(!_[_0x5c3e('0x72')](_0x1241ce[_0x5c3e('0x6b')])){if(fs[_0x5c3e('0x73')](path[_0x5c3e('0x6d')](config[_0x5c3e('0x6e')],_0x5c3e('0x77'),_0x1241ce[_0x5c3e('0x6b')]))){_0x1af2d7=path[_0x5c3e('0x6d')](config[_0x5c3e('0x6e')],_0x5c3e('0x77'),_0x1241ce[_0x5c3e('0x6b')]);}}return _0x56d08b[_0x5c3e('0x75')](_0x1af2d7);}})['catch'](handleError(_0x56d08b,null));};exports[_0x5c3e('0x7c')]=function(_0x384f9d,_0x109971){var _0x446fea=require(_0x5c3e('0x7d'));var _0x25f526=new _0x446fea();var _0x433338=_0x25f526[_0x5c3e('0x7e')](_0x384f9d[_0x5c3e('0x7f')][_0x5c3e('0x80')])['getResult']();var _0x418560={'body':_0x384f9d['body'],'channel':_0x5c3e('0x81')};var _0x19274c=[];var _0x2f17b9=[];var _0x229ab5={};var _0x12d753=![];return db['CmContact']['describe']()[_0x5c3e('0x13')](function(_0x118e60){if(!_0x118e60){throw new db[(_0x5c3e('0x82'))]['ValidationError'](_0x5c3e('0x83'));}_0x19274c=_[_0x5c3e('0x84')](_[_0x5c3e('0x38')](_0x118e60),[_0x5c3e('0x85'),_0x5c3e('0x86')]);_0x2f17b9=_['difference'](_[_0x5c3e('0x38')](_0x118e60),[_0x5c3e('0x85'),_0x5c3e('0x86'),'CompanyId',_0x5c3e('0x87')]);if(_0x384f9d['body']['id']){delete _0x384f9d[_0x5c3e('0x51')]['id'];}if(_['isNil'](_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0x88')])){throw new db[(_0x5c3e('0x82'))]['ValidationError'](_0x5c3e('0x89'));}if(_['isNil'](_0x384f9d[_0x5c3e('0x51')]['body'])||_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0x51')]===''){throw new db['Sequelize']['ValidationError'](_0x5c3e('0x8a'));}if(_[_0x5c3e('0x72')](_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0x8b')])){throw new db[(_0x5c3e('0x82'))][(_0x5c3e('0x8c'))](_0x5c3e('0x8d')+_0x2f17b9);}if(!_['includes'](_0x2f17b9,_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0x8b')])){throw new db['Sequelize'][(_0x5c3e('0x8c'))](_0x5c3e('0x8e')+_0x2f17b9);}_0x229ab5[_0x384f9d['body'][_0x5c3e('0x8b')]]=_0x384f9d[_0x5c3e('0x51')]['from'];})[_0x5c3e('0x13')](function(){return db[_0x5c3e('0x31')][_0x5c3e('0x4f')]({'where':{'id':_0x384f9d[_0x5c3e('0x4c')]['id']},'include':[{'model':db[_0x5c3e('0x8f')],'as':_0x5c3e('0x90'),'include':[{'model':db[_0x5c3e('0x91')],'as':_0x5c3e('0x92'),'where':_0x229ab5,'limit':0x1,'order':[[_0x5c3e('0x86'),_0x5c3e('0x93')]]}]},{'model':db['ChatApplication'],'as':_0x5c3e('0x94')}]});})[_0x5c3e('0x13')](handleEntityNotFound(_0x109971,null))[_0x5c3e('0x13')](function(_0x24c1b9){if(_0x24c1b9&&_0x24c1b9[_0x5c3e('0x90')]){_0x418560[_0x5c3e('0x95')]=_0x24c1b9;_0x418560[_0x5c3e('0x96')]=_0x24c1b9['Applications'];_0x418560['list']=_0x24c1b9['List'];_0x418560['applications']=_[_0x5c3e('0x97')](_0x418560[_0x5c3e('0x96')],[_0x5c3e('0x98')],[_0x5c3e('0x99')]);if(_0x418560['account'][_0x5c3e('0x94')]){delete _0x418560['account'][_0x5c3e('0x94')];}if(_0x418560['account'][_0x5c3e('0x90')]&&_0x418560['account'][_0x5c3e('0x90')]['Contacts']['length']){return _0x418560[_0x5c3e('0x95')][_0x5c3e('0x90')][_0x5c3e('0x92')][0x0];}var _0x4b7621=_[_0x5c3e('0x9a')](_0x384f9d['body'],{'firstName':_0x384f9d[_0x5c3e('0x51')]['from'],'ListId':_0x24c1b9[_0x5c3e('0x87')]});_0x4b7621[_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0x8b')]]=_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0x88')];return db[_0x5c3e('0x91')][_0x5c3e('0x50')](_0x4b7621,{'fields':_0x19274c,'raw':!![]});}})[_0x5c3e('0x13')](handleEntityNotFound(_0x109971,null))[_0x5c3e('0x13')](function(_0x1280bd){_0x418560['contact']=_0x1280bd;var _0x243dea=_0x384f9d[_0x5c3e('0x51')]['customerIp'];if(_0x384f9d[_0x5c3e('0x7f')][_0x5c3e('0x9b')]){_0x243dea=_0x384f9d[_0x5c3e('0x7f')][_0x5c3e('0x9b')];}else if(_0x384f9d['headers'][_0x5c3e('0x9c')]){_0x243dea=_['first'](_0x384f9d['headers'][_0x5c3e('0x9c')][_0x5c3e('0x9d')](','));}if(_0x1280bd){var _0x19880c={'ContactId':_0x1280bd['id'],'ChatWebsiteId':_0x384f9d[_0x5c3e('0x4c')]['id'],'from':(_0x1280bd[_0x5c3e('0x9e')]||'')+'\x20'+(_0x1280bd[_0x5c3e('0x9f')]||''),'customerIp':_0x243dea,'customerPort':_0x384f9d[_0x5c3e('0x7f')][_0x5c3e('0xa0')]?_0x384f9d[_0x5c3e('0x7f')]['x-real-port']:null,'referer':_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0xa1')],'browserName':_0x433338['browser']['name']&&_0x433338[_0x5c3e('0xa2')][_0x5c3e('0xa3')]?util['format']('%s\x20%s',_0x433338[_0x5c3e('0xa2')][_0x5c3e('0x2d')],_0x433338[_0x5c3e('0xa2')][_0x5c3e('0xa3')]):_0x5c3e('0xa4'),'browserVersion':_0x433338['browser'][_0x5c3e('0xa3')]||'unknown','osName':util['format'](_0x5c3e('0xa5'),_0x433338['os'][_0x5c3e('0x2d')],_0x433338['os'][_0x5c3e('0xa3')]),'osVersion':_0x433338['os'][_0x5c3e('0xa3')],'deviceModel':_0x433338[_0x5c3e('0xa6')][_0x5c3e('0x36')]&&_0x433338['device']['vendor']?util[_0x5c3e('0xa7')](_0x5c3e('0xa8'),_0x433338['device'][_0x5c3e('0x36')],_0x433338[_0x5c3e('0xa6')][_0x5c3e('0xa9')],_0x433338['device'][_0x5c3e('0x34')]):null,'deviceVendor':_0x433338['device'][_0x5c3e('0xa9')],'deviceType':_0x433338[_0x5c3e('0xa6')]['type'],'formData':JSON['stringify'](_0x384f9d[_0x5c3e('0x51')])};var _0x282584={'ChatWebsiteId':_0x384f9d['params']['id'],'closed':![]};if(_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0xaa')]){_0x282584[_0x5c3e('0xaa')]=_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0xaa')];return db[_0x5c3e('0xab')][_0x5c3e('0x4f')]({'where':_0x282584})[_0x5c3e('0x13')](function(_0x4e04f8){if(_0x4e04f8){return[_0x4e04f8,![]];}_0x19880c[_0x5c3e('0xaa')]=_0x384f9d['body']['threadId'];_0x19880c['externalUrl']=_0x384f9d['body'][_0x5c3e('0xac')];return db[_0x5c3e('0xab')][_0x5c3e('0x50')](_0x19880c)[_0x5c3e('0x13')](function(_0x41fc26){return[_0x41fc26,!![]];});});}_0x282584[_0x5c3e('0xad')]=_0x1280bd['id'];if(_0x384f9d[_0x5c3e('0x51')]['interaction']&&_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0xae')]['id']){_0x282584['id']=_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0xae')]['id'];return db[_0x5c3e('0xab')][_0x5c3e('0x4f')]({'where':_0x282584})[_0x5c3e('0x13')](function(_0x3fa1ce){if(_0x3fa1ce){return[_0x3fa1ce,![]];}return db[_0x5c3e('0xab')][_0x5c3e('0x50')](_0x19880c)[_0x5c3e('0x13')](function(_0x21a659){return[_0x21a659,!![]];});});}return db[_0x5c3e('0xab')]['create'](_0x19880c)[_0x5c3e('0x13')](function(_0x2c2b7c){return[_0x2c2b7c,!![]];});}})[_0x5c3e('0xaf')](function(_0x11c703,_0x4bd923){if(_0x11c703){_0x12d753=_0x4bd923;if(!_0x4bd923){var _0x1e38a9={'from':(_0x418560['contact']['firstName']||'')+'\x20'+(_0x418560[_0x5c3e('0xb0')][_0x5c3e('0x9f')]||'')};if(_0x384f9d['body'][_0x5c3e('0xaa')]&&_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0xb1')]&&_0x384f9d['body'][_0x5c3e('0xaa')]!=_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0xb1')]){_0x1e38a9[_0x5c3e('0xaa')]=_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0xb1')];}return _0x11c703[_0x5c3e('0x28')](_0x1e38a9);}else{return _0x11c703;}}})[_0x5c3e('0x13')](function(_0x40261b){_0x418560[_0x5c3e('0xae')]=_0x40261b[_0x5c3e('0x52')]({'plain':!![]});_0x418560[_0x5c3e('0xae')][_0x5c3e('0xb2')]=_0x12d753;if(_0x418560[_0x5c3e('0xae')][_0x5c3e('0xb2')]){if(_0x418560['account'][_0x5c3e('0xb3')]){_0x418560[_0x5c3e('0x96')][_0x5c3e('0xb4')]({'id':0x0,'priority':_0x418560['applications'][_0x5c3e('0x3d')]+0x1,'app':_0x5c3e('0xb5'),'appdata':_0x5c3e('0xb6'),'interval':_0x5c3e('0xb7')});}}return db[_0x5c3e('0xb8')][_0x5c3e('0x50')]({'body':_0x384f9d[_0x5c3e('0x51')]['body'],'ChatWebsiteId':_0x384f9d[_0x5c3e('0x4c')]['id'],'ChatInteractionId':_0x40261b['id'],'direction':'in','ContactId':_0x418560['contact']['id'],'AttachmentId':_0x384f9d[_0x5c3e('0x51')][_0x5c3e('0xb9')]});})[_0x5c3e('0x13')](function(_0x2b2ee6){_0x418560['message']=_0x2b2ee6;if(_0x418560[_0x5c3e('0xae')][_0x5c3e('0xba')]){return db[_0x5c3e('0xbb')][_0x5c3e('0x4f')]({'attributes':['id','name'],'where':{'id':_0x418560[_0x5c3e('0xae')]['UserId']}})[_0x5c3e('0x13')](function(_0x4f1930){if(_0x4f1930){_0x418560[_0x5c3e('0x96')][_0x5c3e('0xbc')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4f1930[_0x5c3e('0x2d')]+','+(_0x418560['account'][_0x5c3e('0xbd')]||0xa),'interval':'*,*,*,*'});_0x418560[_0x5c3e('0xbe')]=!![];}return respondWithRpcPromise(_0x5c3e('0xbf'),_0x5c3e('0xc0'),_0x418560);});}return respondWithRpcPromise('Start',_0x5c3e('0xc0'),_0x418560);})['then'](function(_0x4663cd){respondWithRpcPromise(_0x5c3e('0xc1'),_0x5c3e('0xc1'),{'event':'notify','message':_0x4663cd},client9002);return _0x4663cd;})[_0x5c3e('0x13')](respondWithResult(_0x109971,null))[_0x5c3e('0x1d')](handleError(_0x109971,null));};exports[_0x5c3e('0xc2')]=function(_0x18793e,_0x33d5e9){var _0x27f99f,_0xaf1e2e,_0x2fd511;var _0x5767d7=[];var _0x529067={};var _0x30fa81=_0x18793e[_0x5c3e('0xc3')]||[];var _0x36ecc3=[];var _0x5d3489;return db[_0x5c3e('0x91')][_0x5c3e('0x5a')]()[_0x5c3e('0x13')](function(_0x857358){if(!_0x857358){throw new db['Sequelize']['ValidationError'](_0x5c3e('0x83'));}_0x5767d7=_[_0x5c3e('0x84')](_[_0x5c3e('0x38')](_0x857358),[_0x5c3e('0x85'),_0x5c3e('0x86'),_0x5c3e('0xc4'),_0x5c3e('0x87')]);if(_0x18793e['body']['id']){delete _0x18793e[_0x5c3e('0x51')]['id'];}if(_[_0x5c3e('0x72')](_0x18793e[_0x5c3e('0x51')]['from'])){throw _0x33d5e9[_0x5c3e('0x1f')](0x1f4)['send'](new db['Sequelize']['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x5c3e('0x72')](_0x18793e[_0x5c3e('0x51')]['body'])||_0x18793e['body'][_0x5c3e('0x51')]===''){throw _0x33d5e9[_0x5c3e('0x1f')](0x1f4)[_0x5c3e('0x2e')](new db[(_0x5c3e('0x82'))]['ValidationError'](_0x5c3e('0x8a')));}if(_[_0x5c3e('0x72')](_0x18793e['body'][_0x5c3e('0xc5')])){throw _0x33d5e9[_0x5c3e('0x1f')](0x1f4)[_0x5c3e('0x2e')](new db[(_0x5c3e('0x82'))][(_0x5c3e('0x8c'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5767d7));}if(!_[_0x5c3e('0xc6')](_0x5767d7,_0x18793e[_0x5c3e('0x51')][_0x5c3e('0xc5')])){throw _0x33d5e9[_0x5c3e('0x1f')](0x1f4)[_0x5c3e('0x2e')](new db['Sequelize']['ValidationError'](_0x5c3e('0xc7')+_0x5767d7));}_0x529067[_0x18793e[_0x5c3e('0x51')][_0x5c3e('0xc5')]]=_0x18793e[_0x5c3e('0x51')][_0x5c3e('0x88')];})[_0x5c3e('0x13')](function(){return db[_0x5c3e('0x31')][_0x5c3e('0x4f')]({'where':{'id':_0x18793e[_0x5c3e('0x4c')]['id']},'include':[{'model':db[_0x5c3e('0x8f')],'as':_0x5c3e('0x90')},{'model':db[_0x5c3e('0xc8')],'as':'MailAccount'}]});})[_0x5c3e('0x13')](handleEntityNotFound(_0x33d5e9,null))[_0x5c3e('0x13')](function(_0x3da15e){if(_0x3da15e&&_0x3da15e[_0x5c3e('0x90')]){_0xaf1e2e=_0x3da15e;var _0x3d55f2=_[_0x5c3e('0x9a')](_0x18793e[_0x5c3e('0x51')],{'firstName':_0x18793e[_0x5c3e('0x51')][_0x5c3e('0x88')],'phone':_0x18793e[_0x5c3e('0x51')][_0x5c3e('0x88')],'ListId':_0x3da15e[_0x5c3e('0x87')]});_0x3d55f2[_0x18793e['body'][_0x5c3e('0xc5')]]=_0x18793e['body']['from'];return db[_0x5c3e('0x91')][_0x5c3e('0xc9')]({'where':_0x529067,'defaults':_0x3d55f2});}})[_0x5c3e('0xaf')](function(_0x1257cb){if(_0x1257cb){_0x2fd511=_0x1257cb;var _0x2793ac=fs[_0x5c3e('0xca')](path[_0x5c3e('0x6d')](config[_0x5c3e('0x6e')],_0x5c3e('0xcb')),_0x5c3e('0xcc'));var _0xa3642f=ejs['render'](_0x2793ac,{'body':_[_0x5c3e('0xcd')](_0x18793e['body']['body']),'bodyTitle':_0xaf1e2e[_0x5c3e('0xce')]});return db[_0x5c3e('0xcf')][_0x5c3e('0x50')]({'body':_0xa3642f,'plainBody':htmlToText[_0x5c3e('0xd0')](_0xa3642f),'ContactId':_0x1257cb['id'],'ChatWebsiteId':_0xaf1e2e['id']});}})[_0x5c3e('0x13')](function(_0x5775ad){_0x5d3489=_0x5775ad;if(_0x30fa81[_0x5c3e('0x3d')]){var _0x2973f1=_0x30fa81['map'](function(_0x212014){return{'name':_0x212014[_0x5c3e('0xd1')],'basename':_0x212014[_0x5c3e('0x69')],'type':_0x212014['mimetype'],'ChatOfflineMessageId':_0x5775ad['id']};});_0x36ecc3=_0x2973f1[_0x5c3e('0x30')](_0x3fd905=>{var _0x2ab448={'filename':_0x3fd905[_0x5c3e('0x2d')],'path':path[_0x5c3e('0x6d')](config[_0x5c3e('0x6e')],'server',_0x5c3e('0xc3'),_0x5c3e('0xd2'),_0x5c3e('0xd3'),_0x3fd905['basename'])};return _0x2ab448;});if(!_0xaf1e2e[_0x5c3e('0xd4')]){return db[_0x5c3e('0xd5')][_0x5c3e('0xd6')](function(_0x49d48a){return db[_0x5c3e('0xd7')][_0x5c3e('0xd8')](_0x2973f1,{'transaction':_0x49d48a});});}}})[_0x5c3e('0x13')](function(){if(_0x5d3489){_0x27f99f=_0x5d3489;return db[_0x5c3e('0xc8')][_0x5c3e('0x5f')]({'where':{'service':!![]},'include':[{'model':db[_0x5c3e('0xd9')],'as':_0x5c3e('0xda'),'raw':!![],'include':[{'model':db[_0x5c3e('0xdb')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x5c3e('0x13')](function(_0x5557cb){if(_0x5557cb&&_0x5557cb[_0x5c3e('0xda')]&&_0xaf1e2e['forwardOffline']&&_0xaf1e2e['forwardOfflineAddress']){var _0x1489db=_0x5557cb[_0x5c3e('0xdc')]();return respondWithRpcPromise(_0x5c3e('0xdd'),_0x5c3e('0xde'),{'account':_0x1489db,'message':{'from':util[_0x5c3e('0xa7')]('\x22%s\x22\x20<%s>',_0x5557cb[_0x5c3e('0x2d')],_0x5557cb[_0x5c3e('0xdf')]||_0x5557cb[_0x5c3e('0xda')]['user']),'to':_0xaf1e2e['forwardOfflineAddress'],'subject':_0xaf1e2e[_0x5c3e('0xe0')],'html':_0x27f99f[_0x5c3e('0x51')],'attachments':_0x36ecc3}},client9003)['then'](function(){return _0x27f99f;})[_0x5c3e('0x1d')](function(_0x9b16b8){logger['error'](_0x9b16b8);});}})['then'](function(){if(_0xaf1e2e&&_0xaf1e2e['openNewInteraction']&&_0xaf1e2e[_0x5c3e('0xe1')]){var _0x3720fd=[];if(_0x30fa81['length']){_0x3720fd=_0x30fa81[_0x5c3e('0x30')](function(_0x5c57da){return{'name':_0x5c57da[_0x5c3e('0xd1')],'basename':_0x5c57da[_0x5c3e('0x69')],'type':_0x5c57da[_0x5c3e('0xe2')],'ChatOfflineMessageId':_0x5d3489['id']};});}var _0x1f9d86;if(!_[_0x5c3e('0x72')](_0xaf1e2e[_0x5c3e('0xe3')])){var _0x1c7c53=_['map'](_0x18793e[_0x5c3e('0x51')],function(_0x2f527b){return _0x2f527b;});var _0x24d5ce=_['toPairsIn'](_0x1c7c53)[0x0];var _0x8218b1=_['mapValues'](_0x24d5ce,function(_0x3bb113){return _0x3bb113;});_0x1f9d86=_0x8218b1[0x1][_0xaf1e2e[_0x5c3e('0xe3')]];}var _0x10e472={'from':_0x2fd511[_0x5c3e('0xdf')],'firstName':_0x2fd511[_0x5c3e('0x9e')],'lastName':_0x2fd511[_0x5c3e('0x9f')],'mapKey':_0x5c3e('0xdf'),'message':{'from':_0x2fd511['email'],'to':_0xaf1e2e['MailAccount'][_0x5c3e('0xdf')],'cc':'','subject':_[_0x5c3e('0x72')](_0x1f9d86)?_0xaf1e2e[_0x5c3e('0xe0')]:_0x1f9d86,'messageId':'','sentAt':new Date(),'attach':_0x3720fd[_0x5c3e('0x3d')],'attachments':_0x3720fd,'originChannel':_0x5c3e('0xe4'),'ChatWebsiteId':_0xaf1e2e['id'],'ChatOfflineMessageId':_0x27f99f['id'],'originTo':_0xaf1e2e[_0x5c3e('0xc8')][_0x5c3e('0xdf')]},'body':_0x27f99f['body']};var _0x2732bc={'account':{'id':_0xaf1e2e[_0x5c3e('0xe1')]},'body':_0x10e472,'log':_0x5c3e('0xe5')};return respondWithRpcPromise(_0x5c3e('0xe5'),_0x5c3e('0xe6'),_0x2732bc,client9001)[_0x5c3e('0x13')](function(){return _0x27f99f;})['catch'](function(_0x45cebf){logger[_0x5c3e('0x19')](_0x45cebf);});}return;})[_0x5c3e('0x13')](function(){if(_0x27f99f){return _0x27f99f;}})[_0x5c3e('0x13')](respondWithResult(_0x33d5e9,null))['catch'](function(_0x417eac){logger[_0x5c3e('0x19')](_0x5c3e('0x1d'),_0x417eac);for(var _0x23ae11 of _0x30fa81){var _0xc59fdc=path['join'](config['root'],_0x5c3e('0xe7'),'files',_0x5c3e('0xd2'),_0x5c3e('0xd3'),_0x23ae11[_0x5c3e('0x69')]);fs_extra[_0x5c3e('0xe8')](_0xc59fdc)[_0x5c3e('0x1d')](function(_0x48f5d8){logger[_0x5c3e('0x19')](_0x5c3e('0xe9'),_0xc59fdc,_0x48f5d8);});}});};exports[_0x5c3e('0xea')]=function(_0x4a9e3f,_0x52968a){return db['ChatInteraction'][_0x5c3e('0x4f')]({'where':{'id':_0x4a9e3f[_0x5c3e('0x4c')]['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x52968a,null))[_0x5c3e('0x13')](function(_0x25cce7){if(_0x25cce7){return _0x25cce7[_0x5c3e('0xea')](_0x4a9e3f[_0x5c3e('0x51')][_0x5c3e('0x61')],_[_0x5c3e('0xeb')](_0x4a9e3f[_0x5c3e('0x51')],[_0x5c3e('0x61'),'id'])||{});}})[_0x5c3e('0x13')](respondWithResult(_0x52968a,null))[_0x5c3e('0x1d')](handleError(_0x52968a,null));};exports['getInteractions']=function(_0xc34e2e,_0x39aae0){var _0x3a12ac={'raw':![],'where':{}};var _0x6d5a80={};var _0x579e26={'count':0x0,'rows':[]};return db[_0x5c3e('0x31')][_0x5c3e('0x5f')]({'where':{'id':_0xc34e2e[_0x5c3e('0x4c')]['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x39aae0,null))[_0x5c3e('0x13')](function(_0x26b70a){if(_0x26b70a){_0x6d5a80[_0x5c3e('0x36')]=_[_0x5c3e('0x38')](db[_0x5c3e('0xab')][_0x5c3e('0x32')]);_0x6d5a80[_0x5c3e('0x37')]=_[_0x5c3e('0x38')](_0xc34e2e[_0x5c3e('0x37')]);_0x6d5a80[_0x5c3e('0x39')]=_['intersection'](_0x6d5a80[_0x5c3e('0x36')],_0x6d5a80[_0x5c3e('0x37')]);_0x3a12ac['attributes']=_[_0x5c3e('0x3a')](_0x6d5a80['model'],qs[_0x5c3e('0x3b')](_0xc34e2e['query']['fields']));_0x3a12ac[_0x5c3e('0x3c')]=_0x3a12ac[_0x5c3e('0x3c')][_0x5c3e('0x3d')]?_0x3a12ac[_0x5c3e('0x3c')]:_0x6d5a80[_0x5c3e('0x36')];if(!_0xc34e2e[_0x5c3e('0x37')][_0x5c3e('0x3e')](_0x5c3e('0x3f'))){_0x3a12ac[_0x5c3e('0x25')]=qs[_0x5c3e('0x25')](_0xc34e2e[_0x5c3e('0x37')]['limit']);_0x3a12ac[_0x5c3e('0x22')]=qs['offset'](_0xc34e2e[_0x5c3e('0x37')][_0x5c3e('0x22')]);}_0x3a12ac[_0x5c3e('0x40')]=qs[_0x5c3e('0x41')](_0xc34e2e[_0x5c3e('0x37')][_0x5c3e('0x41')]);_0x3a12ac[_0x5c3e('0x42')]=qs[_0x5c3e('0x39')](_['pick'](_0xc34e2e[_0x5c3e('0x37')],_0x6d5a80[_0x5c3e('0x39')]));_0x3a12ac['where'][_0x5c3e('0x5c')]=_0x26b70a['id'];if(_0xc34e2e[_0x5c3e('0x37')][_0x5c3e('0x44')]){_0x3a12ac[_0x5c3e('0x42')]=_[_0x5c3e('0x45')](_0x3a12ac['where'],{'$or':_[_0x5c3e('0x30')](_0x3a12ac[_0x5c3e('0x3c')],function(_0x1e517a){var _0x363fda={};_0x363fda[_0x1e517a]={'$like':'%'+_0xc34e2e['query'][_0x5c3e('0x44')]+'%'};return _0x363fda;})});}_0x3a12ac=_['merge']({},_0x3a12ac,_0xc34e2e[_0x5c3e('0x46')]);return db[_0x5c3e('0xab')][_0x5c3e('0x24')]({'where':_0x3a12ac[_0x5c3e('0x42')]})[_0x5c3e('0x13')](function(_0x26823a){_0x579e26['count']=_0x26823a;if(_0xc34e2e['query'][_0x5c3e('0x47')]){_0x3a12ac['include']=[{'model':db[_0x5c3e('0x91')],'as':_0x5c3e('0xec'),'required':![]},{'model':db[_0x5c3e('0xbb')],'as':_0x5c3e('0xed'),'attributes':[_0x5c3e('0x2d'),_0x5c3e('0xee'),_0x5c3e('0xef')],'required':![]},{'model':db[_0x5c3e('0xf0')],'as':'Tags','attributes':['id',_0x5c3e('0x2d'),_0x5c3e('0xf1')],'where':_0xc34e2e[_0x5c3e('0x37')][_0x5c3e('0xf2')]?{'id':_0xc34e2e[_0x5c3e('0x37')]['tag']}:undefined,'required':_0xc34e2e['query'][_0x5c3e('0xf2')]?!![]:![]}];}return db['ChatInteraction'][_0x5c3e('0x49')](_0x3a12ac);})[_0x5c3e('0x13')](function(_0x5f199e){_0x579e26[_0x5c3e('0x4a')]=_0x5f199e;return _0x579e26;});}})[_0x5c3e('0x13')](respondWithFilteredResult(_0x39aae0,_0x3a12ac))[_0x5c3e('0x1d')](handleError(_0x39aae0,null));};function iftimePromise(_0x4ee1c4,_0x1824e1){return respondWithRpcPromise(_0x5c3e('0xf3'),_0x5c3e('0xf4'),{'command':_0x1824e1[_0x5c3e('0xf5')]?util[_0x5c3e('0xa7')](_0x5c3e('0xf6'),_0x4ee1c4['interval'],_0x1824e1['timezone']):util[_0x5c3e('0xa7')](_0x5c3e('0xf7'),_0x4ee1c4[_0x5c3e('0xf8')])},client9002)[_0x5c3e('0x13')](function(_0x4bff6a){var _0x294b85=_0x4bff6a&&_0x4bff6a[_0x5c3e('0xf9')](_0x5c3e('0xfa'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1824e1['id'],_0x4ee1c4['id'],_0x4ee1c4['interval'],_0x294b85?_0x5c3e('0xfb'):_0x5c3e('0xfc'),_0x1824e1['timezone']?_0x1824e1[_0x5c3e('0xf5')]:'No\x20timezone');return _0x294b85;})[_0x5c3e('0x1d')](function(_0x4b1dce){logger[_0x5c3e('0x19')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1824e1['id'],_0x4ee1c4['id'],_0x4ee1c4[_0x5c3e('0xf8')],util[_0x5c3e('0xfd')](_0x4b1dce,{'showHidden':![],'depth':null}),_0x1824e1[_0x5c3e('0xf5')]?_0x1824e1[_0x5c3e('0xf5')]:_0x5c3e('0xfe'));return![];});}exports['getSnippet']=function(_0x4d02bc,_0x20c878){var _0x75af26=0x0;var _0x49f71a=0x0;var _0xaed9a2=![];var _0x37cc8c;var _0x286666;return db[_0x5c3e('0x31')][_0x5c3e('0x4f')]({'where':{'id':_0x4d02bc[_0x5c3e('0x4c')]['id']},'include':[{'model':db[_0x5c3e('0xff')],'as':_0x5c3e('0xff'),'include':[{'model':db['Interval'],'as':_0x5c3e('0x100'),'attributes':['id',_0x5c3e('0xf8')],'raw':!![]}]}]})[_0x5c3e('0x13')](handleEntityNotFound(_0x20c878,null))[_0x5c3e('0x13')](function(_0x98324a){if(_0x98324a){_0x37cc8c=_0x98324a;return _0x98324a[_0x5c3e('0x101')]({'raw':!![]});}})[_0x5c3e('0x13')](function(_0x4f9e3f){if(_0x37cc8c){if(_0x4f9e3f){_0x286666=_0x4f9e3f;}}return require(_0x5c3e('0x70'))['getLicense']();})[_0x5c3e('0x13')](function(_0x4457b6){if(_0x4457b6){_0x49f71a=_0x4457b6[_0x5c3e('0x102')];_0xaed9a2=_0x4457b6[_0x5c3e('0x71')];}})[_0x5c3e('0x13')](function(){return db[_0x5c3e('0xab')][_0x5c3e('0x24')]({'where':{'closed':![]}});})[_0x5c3e('0x13')](function(_0x2336ff){_0x75af26=_0x2336ff;if(_0x49f71a&&_0x2336ff>_0x49f71a){return db[_0x5c3e('0x103')][_0x5c3e('0x5f')]({'where':{'id':0x1}})['then'](function(_0x209064){if(_0x209064){_0x209064[_0x5c3e('0x104')](_0x5c3e('0x105'));}});}})[_0x5c3e('0x13')](function(){if(_0x37cc8c[_0x5c3e('0xff')]&&_0x37cc8c['Interval']['Intervals']){var _0x36d48b=[];for(var _0x5c6bc1=0x0;_0x5c6bc1<_0x37cc8c[_0x5c3e('0xff')][_0x5c3e('0x100')][_0x5c3e('0x3d')];_0x5c6bc1++){var _0x70769a=_0x37cc8c[_0x5c3e('0xff')][_0x5c3e('0x100')][_0x5c6bc1][_0x5c3e('0x52')]({'plain':!![]});_0x36d48b[_0x5c3e('0xb4')](iftimePromise(_0x70769a,_0x37cc8c));}return BPromise[_0x5c3e('0x106')](_0x36d48b)[_0x5c3e('0x13')](function(_0x378591){return _['some'](_0x378591);});}else{return!![];}})[_0x5c3e('0x13')](function(_0x47afdd){var _0x52c888=fs[_0x5c3e('0xca')](path['join'](config[_0x5c3e('0x6e')],_0x5c3e('0x107')),_0x5c3e('0xcc'));var _0x19f1ca=new url[(_0x5c3e('0x108'))](_0x37cc8c[_0x5c3e('0x109')])['origin'];var _0x3932e9='3.1.0';var _0x1b82f0=![];var _0x25f317={'chatVersion':_0x3932e9,'chatWebsiteAddressOrigin':_0x19f1ca,'remote':_0x37cc8c[_0x5c3e('0x10a')],'query':querystring[_0x5c3e('0x18')](_['merge'](_0x37cc8c[_0x5c3e('0x52')]({'plain':!![]}),{'customerIp':_0x4d02bc[_0x5c3e('0x7f')][_0x5c3e('0x9c')]||_0x4d02bc[_0x5c3e('0x7f')][_0x5c3e('0x10b')]||_0x4d02bc[_0x5c3e('0x10c')][_0x5c3e('0x10d')]||_0x4d02bc['ip'],'referer':_0x4d02bc[_0x5c3e('0x7f')][_0x5c3e('0xa1')],'openedInteractions':_0x75af26,'maxInteractions':_0x49f71a,'virtual':_0xaed9a2[_0x5c3e('0x102')],'online':_0x47afdd,'custom':_0xaed9a2}))[_0x5c3e('0x10e')](/'/g,'\x5c\x27')};_0x20c878[_0x5c3e('0x2e')](ejs[_0x5c3e('0x10f')](Mustache[_0x5c3e('0x10f')](_0x52c888,_0x25f317),{'proactiveActions':_0x286666,'alignment':_0x37cc8c['alignment'],'verticalAlignment':_0x37cc8c[_0x5c3e('0x110')],'div_color':_0x37cc8c[_0x5c3e('0xf1')],'labelText':_0x37cc8c['labelText'],'text_color':_0x37cc8c[_0x5c3e('0x111')],'text_button_color':_0x37cc8c[_0x5c3e('0x112')],'button_color':_0x37cc8c['color_button'],'background_color':_0x37cc8c[_0x5c3e('0x113')],'hideWhenOffline':_0x37cc8c['hideWhenOffline'],'intervalId':_0x37cc8c['IntervalId'],'isDevelopment':_0x1b82f0,'chatVersion':_0x3932e9}));})['catch'](handleError(_0x20c878,null));};exports[_0x5c3e('0x114')]=function(_0x5e3d33,_0x165fbc){var _0x52fa60=_0x5e3d33[_0x5c3e('0x4c')]['id'];var _0x9d5b40=_0x5e3d33['body'];var _0x4e1338=0xc8;var _0x2d36f8=null;return db[_0x5c3e('0xd5')][_0x5c3e('0xd6')]({'isolationLevel':db[_0x5c3e('0xd5')]['Transaction'][_0x5c3e('0x115')][_0x5c3e('0x116')]},function(_0x1af382){return db[_0x5c3e('0x31')][_0x5c3e('0x5f')]({'where':{'id':_0x52fa60},'transaction':_0x1af382})[_0x5c3e('0x13')](function(_0xf90479){if(_0xf90479){return db['ChatApplication'][_0x5c3e('0x29')]({'where':{'ChatWebsiteId':_0x52fa60},'transaction':_0x1af382})[_0x5c3e('0x13')](function(){var _0x301040=_[_0x5c3e('0x30')](_0x9d5b40,function(_0x1b9e21){_0x1b9e21[_0x5c3e('0x5c')]=_0x52fa60;return _0x1b9e21;});return db[_0x5c3e('0x117')][_0x5c3e('0xd8')](_0x301040,{'transaction':_0x1af382});});}else{_0x4e1338=0x194;_0x2d36f8=[];}});})[_0x5c3e('0x13')](function(){if(_0x4e1338!==0x194){return db[_0x5c3e('0x117')][_0x5c3e('0x118')]({'where':{'ChatWebsiteId':_0x52fa60},'order':'priority'})[_0x5c3e('0x13')](function(_0x28d73b){_0x2d36f8=_0x28d73b;});}})[_0x5c3e('0x1d')](function(_0x38ea80){_0x4e1338=0x1f4;logger[_0x5c3e('0x19')](_0x38ea80[_0x5c3e('0x2c')]);if(_0x38ea80[_0x5c3e('0x2d')]){delete _0x38ea80[_0x5c3e('0x2d')];}_0x2d36f8=_0x38ea80;})[_0x5c3e('0x119')](function(){if(_0x2d36f8===null){_0x165fbc[_0x5c3e('0x1e')](_0x4e1338);}else{if(_0x4e1338===0x1f4){_0x165fbc['status'](_0x4e1338)['send'](_0x2d36f8);}else{_0x165fbc[_0x5c3e('0x1f')](_0x4e1338)[_0x5c3e('0x21')](_0x2d36f8);}}});};exports[_0x5c3e('0x11a')]=function(_0xe1b363,_0xe36b7b){var _0x557f64={};var _0x5a1127={};var _0x232611;var _0x5bba91;return db[_0x5c3e('0x31')][_0x5c3e('0x5f')]({'where':{'id':_0xe1b363[_0x5c3e('0x4c')]['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0xe36b7b,null))[_0x5c3e('0x13')](function(_0x446cc7){if(_0x446cc7){_0x232611=_0x446cc7;_0x5a1127['model']=_[_0x5c3e('0x38')](db[_0x5c3e('0x117')][_0x5c3e('0x32')]);_0x5a1127[_0x5c3e('0x37')]=_[_0x5c3e('0x38')](_0xe1b363[_0x5c3e('0x37')]);_0x5a1127[_0x5c3e('0x39')]=_[_0x5c3e('0x3a')](_0x5a1127[_0x5c3e('0x36')],_0x5a1127['query']);_0x557f64[_0x5c3e('0x3c')]=_[_0x5c3e('0x3a')](_0x5a1127[_0x5c3e('0x36')],qs['fields'](_0xe1b363[_0x5c3e('0x37')][_0x5c3e('0x3b')]));_0x557f64['attributes']=_0x557f64['attributes'][_0x5c3e('0x3d')]?_0x557f64[_0x5c3e('0x3c')]:_0x5a1127['model'];_0x557f64['order']=qs[_0x5c3e('0x41')](_0xe1b363[_0x5c3e('0x37')][_0x5c3e('0x41')]);_0x557f64[_0x5c3e('0x42')]=qs[_0x5c3e('0x39')](_[_0x5c3e('0x43')](_0xe1b363[_0x5c3e('0x37')],_0x5a1127[_0x5c3e('0x39')]));if(_0xe1b363[_0x5c3e('0x37')][_0x5c3e('0x44')]){_0x557f64[_0x5c3e('0x42')]=_[_0x5c3e('0x45')](_0x557f64[_0x5c3e('0x42')],{'$or':_[_0x5c3e('0x30')](_0x557f64[_0x5c3e('0x3c')],function(_0x4c9b0c){var _0x4fe89d={};_0x4fe89d[_0x4c9b0c]={'$like':'%'+_0xe1b363[_0x5c3e('0x37')][_0x5c3e('0x44')]+'%'};return _0x4fe89d;})});}_0x557f64=_[_0x5c3e('0x45')]({},_0x557f64,_0xe1b363['options']);return _0x232611[_0x5c3e('0x11a')](_0x557f64);}})['then'](function(_0x165742){if(_0x165742){_0x5bba91=_0x165742['length'];if(!_0xe1b363[_0x5c3e('0x37')][_0x5c3e('0x3e')](_0x5c3e('0x3f'))){_0x557f64[_0x5c3e('0x25')]=qs['limit'](_0xe1b363[_0x5c3e('0x37')]['limit']);_0x557f64[_0x5c3e('0x22')]=qs[_0x5c3e('0x22')](_0xe1b363[_0x5c3e('0x37')][_0x5c3e('0x22')]);}return _0x232611['getApplications'](_0x557f64);}})[_0x5c3e('0x13')](function(_0x13741f){if(_0x13741f){return _0x13741f?{'count':_0x5bba91,'rows':_0x13741f}:null;}})['then'](respondWithResult(_0xe36b7b,null))['catch'](handleError(_0xe36b7b,null));};exports['addProactiveActions']=function(_0x4bb751,_0x183f3f){return db[_0x5c3e('0x11b')][_0x5c3e('0x4f')]({'where':{'id':_0x4bb751['params']['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x183f3f,null))['then'](function(_0x3abd4e){if(_0x3abd4e){return _0x3abd4e[_0x5c3e('0x11c')](_0x4bb751[_0x5c3e('0x51')][_0x5c3e('0x61')],_[_0x5c3e('0xeb')](_0x4bb751['body'],[_0x5c3e('0x61'),'id'])||{});}})[_0x5c3e('0x13')](respondWithResult(_0x183f3f,null))[_0x5c3e('0x1d')](handleError(_0x183f3f,null));};exports[_0x5c3e('0x101')]=function(_0x5b8697,_0x38a947){var _0x57f4ff={};var _0x1602e0={};var _0x465491;var _0x41f6ca;return db[_0x5c3e('0x31')][_0x5c3e('0x5f')]({'where':{'id':_0x5b8697[_0x5c3e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x38a947,null))['then'](function(_0x3afde9){if(_0x3afde9){_0x465491=_0x3afde9;_0x1602e0['model']=_[_0x5c3e('0x38')](db['ChatProactiveAction']['rawAttributes']);_0x1602e0[_0x5c3e('0x37')]=_[_0x5c3e('0x38')](_0x5b8697['query']);_0x1602e0['filters']=_['intersection'](_0x1602e0[_0x5c3e('0x36')],_0x1602e0[_0x5c3e('0x37')]);_0x57f4ff[_0x5c3e('0x3c')]=_[_0x5c3e('0x3a')](_0x1602e0[_0x5c3e('0x36')],qs[_0x5c3e('0x3b')](_0x5b8697[_0x5c3e('0x37')][_0x5c3e('0x3b')]));_0x57f4ff[_0x5c3e('0x3c')]=_0x57f4ff['attributes'][_0x5c3e('0x3d')]?_0x57f4ff[_0x5c3e('0x3c')]:_0x1602e0[_0x5c3e('0x36')];_0x57f4ff[_0x5c3e('0x40')]=qs['sort'](_0x5b8697[_0x5c3e('0x37')][_0x5c3e('0x41')]);_0x57f4ff[_0x5c3e('0x42')]=qs['filters'](_['pick'](_0x5b8697[_0x5c3e('0x37')],_0x1602e0['filters']));if(_0x5b8697[_0x5c3e('0x37')][_0x5c3e('0x44')]){_0x57f4ff[_0x5c3e('0x42')]=_[_0x5c3e('0x45')](_0x57f4ff[_0x5c3e('0x42')],{'$or':_['map'](_0x57f4ff[_0x5c3e('0x3c')],function(_0x1ef930){var _0x5951ab={};_0x5951ab[_0x1ef930]={'$like':'%'+_0x5b8697[_0x5c3e('0x37')][_0x5c3e('0x44')]+'%'};return _0x5951ab;})});}_0x57f4ff=_['merge']({},_0x57f4ff,_0x5b8697[_0x5c3e('0x46')]);return _0x465491[_0x5c3e('0x101')](_0x57f4ff);}})[_0x5c3e('0x13')](function(_0x2ef511){if(_0x2ef511){_0x41f6ca=_0x2ef511['length'];if(!_0x5b8697['query']['hasOwnProperty'](_0x5c3e('0x3f'))){_0x57f4ff[_0x5c3e('0x25')]=qs[_0x5c3e('0x25')](_0x5b8697[_0x5c3e('0x37')][_0x5c3e('0x25')]);_0x57f4ff['offset']=qs[_0x5c3e('0x22')](_0x5b8697[_0x5c3e('0x37')]['offset']);}return _0x465491[_0x5c3e('0x101')](_0x57f4ff);}})[_0x5c3e('0x13')](function(_0x77af0f){if(_0x77af0f){return _0x77af0f?{'count':_0x41f6ca,'rows':_0x77af0f}:null;}})[_0x5c3e('0x13')](respondWithResult(_0x38a947,null))[_0x5c3e('0x1d')](handleError(_0x38a947,null));};exports[_0x5c3e('0x11d')]=function(_0xe367ce,_0x5b88cc){var _0x1b0c4e=_0xe367ce[_0x5c3e('0x37')]['online']===_0x5c3e('0x11e')?_0x5c3e('0x11f'):_0x5c3e('0x120');return db[_0x5c3e('0x31')]['find']({'attributes':['id',_0x1b0c4e],'where':{'id':_0xe367ce['params']['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x5b88cc,null))[_0x5c3e('0x13')](function(_0x450b02){if(_0x450b02){var _0x3808fe=_0x450b02[_0x1b0c4e];var _0x1e9f2b=_0x3808fe&&_0x3808fe[_0x5c3e('0x121')]?_0x3808fe[_0x5c3e('0x121')]:[];_0x5b88cc[_0x5c3e('0x2e')]({'fromKey':_[_0x5c3e('0x72')](_0x3808fe[_0x5c3e('0x122')])?undefined:_0x3808fe['fromKey'],'count':_0x1e9f2b[_0x5c3e('0x3d')],'rows':_0x1e9f2b});}})[_0x5c3e('0x1d')](handleError(_0x5b88cc,null));};exports[_0x5c3e('0x123')]=function(_0x2dc360,_0x14af41){var _0x146995={'raw':![],'where':{}};var _0x2b57c2={};var _0x11bc96={'count':0x0,'rows':[]};return db[_0x5c3e('0x31')][_0x5c3e('0x5f')]({'where':{'id':_0x2dc360[_0x5c3e('0x4c')]['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x14af41,null))[_0x5c3e('0x13')](function(_0x5b1bdb){if(_0x5b1bdb){_0x2b57c2[_0x5c3e('0x36')]=_[_0x5c3e('0x38')](db[_0x5c3e('0xcf')][_0x5c3e('0x32')]);_0x2b57c2['query']=_[_0x5c3e('0x38')](_0x2dc360[_0x5c3e('0x37')]);_0x2b57c2['filters']=_['intersection'](_0x2b57c2['model'],_0x2b57c2[_0x5c3e('0x37')]);_0x146995[_0x5c3e('0x3c')]=_[_0x5c3e('0x3a')](_0x2b57c2[_0x5c3e('0x36')],qs[_0x5c3e('0x3b')](_0x2dc360[_0x5c3e('0x37')][_0x5c3e('0x3b')]));_0x146995[_0x5c3e('0x3c')]=_0x146995[_0x5c3e('0x3c')][_0x5c3e('0x3d')]?_0x146995[_0x5c3e('0x3c')]:_0x2b57c2[_0x5c3e('0x36')];if(!_0x2dc360[_0x5c3e('0x37')][_0x5c3e('0x3e')](_0x5c3e('0x3f'))){_0x146995[_0x5c3e('0x25')]=qs[_0x5c3e('0x25')](_0x2dc360[_0x5c3e('0x37')][_0x5c3e('0x25')]);_0x146995[_0x5c3e('0x22')]=qs[_0x5c3e('0x22')](_0x2dc360[_0x5c3e('0x37')][_0x5c3e('0x22')]);}_0x146995['order']=qs['sort'](_0x2dc360[_0x5c3e('0x37')][_0x5c3e('0x41')]);_0x146995[_0x5c3e('0x42')]=qs['filters'](_['pick'](_0x2dc360[_0x5c3e('0x37')],_0x2b57c2['filters']));_0x146995['where'][_0x5c3e('0x5c')]=_0x5b1bdb['id'];if(_0x2dc360[_0x5c3e('0x37')][_0x5c3e('0x44')]){_0x146995[_0x5c3e('0x42')]=_[_0x5c3e('0x45')](_0x146995['where'],{'$or':_['map'](_0x146995[_0x5c3e('0x3c')],function(_0x4fecff){var _0x55d65a={};_0x55d65a[_0x4fecff]={'$like':'%'+_0x2dc360[_0x5c3e('0x37')][_0x5c3e('0x44')]+'%'};return _0x55d65a;})});}_0x146995=_[_0x5c3e('0x45')]({},_0x146995,_0x2dc360[_0x5c3e('0x46')]);return db[_0x5c3e('0xcf')][_0x5c3e('0x24')]({'where':_0x146995[_0x5c3e('0x42')]})[_0x5c3e('0x13')](function(_0x3b6d94){_0x11bc96['count']=_0x3b6d94;if(_0x2dc360[_0x5c3e('0x37')][_0x5c3e('0x47')]){_0x146995['include']=[{'all':!![]}];}else{_0x146995[_0x5c3e('0x48')]=[{'model':db[_0x5c3e('0x91')],'as':_0x5c3e('0xec'),'required':![]},{'model':db[_0x5c3e('0xd7')],'as':_0x5c3e('0x124'),'required':![]}];}return db[_0x5c3e('0xcf')][_0x5c3e('0x49')](_0x146995);})[_0x5c3e('0x13')](function(_0x125889){_0x11bc96[_0x5c3e('0x4a')]=_0x125889;return _0x11bc96;});}})[_0x5c3e('0x13')](respondWithFilteredResult(_0x14af41,_0x146995))[_0x5c3e('0x1d')](handleError(_0x14af41,null));};exports[_0x5c3e('0x125')]=function(_0x204761,_0x313b87){return db[_0x5c3e('0x31')][_0x5c3e('0x4f')]({'where':{'id':_0x204761[_0x5c3e('0x4c')]['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x313b87,null))[_0x5c3e('0x13')](function(_0x3c593d){if(_0x3c593d){return _0x3c593d[_0x5c3e('0x125')](_0x204761['body'][_0x5c3e('0x61')],_[_0x5c3e('0xeb')](_0x204761[_0x5c3e('0x51')],['ids','id'])||{})[_0x5c3e('0xaf')](function(_0x5c6096){for(var _0x3dfce0=0x0;_0x3dfce0<_0x204761['body']['ids'][_0x5c3e('0x3d')];_0x3dfce0+=0x1){socket[_0x5c3e('0x126')]('userChatWebsite:save',{'UserId':Number(_0x204761[_0x5c3e('0x51')][_0x5c3e('0x61')][_0x3dfce0]),'ChatWebsiteId':Number(_0x204761[_0x5c3e('0x4c')]['id'])});}return _0x5c6096;});}})[_0x5c3e('0x13')](respondWithResult(_0x313b87,null))[_0x5c3e('0x1d')](handleError(_0x313b87,null));};exports[_0x5c3e('0x127')]=function(_0x1fe75f,_0x29b5d6){return db[_0x5c3e('0x31')][_0x5c3e('0x4f')]({'where':{'id':_0x1fe75f[_0x5c3e('0x4c')]['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x29b5d6,null))['then'](function(_0x4e4132){if(_0x4e4132){return _0x4e4132[_0x5c3e('0x127')](_0x1fe75f['query']['ids'])[_0x5c3e('0x13')](function(){if(_['isArray'](_0x1fe75f[_0x5c3e('0x37')]['ids'])){for(var _0x57d2a4=0x0;_0x57d2a4<_0x1fe75f['query'][_0x5c3e('0x61')][_0x5c3e('0x3d')];_0x57d2a4+=0x1){socket[_0x5c3e('0x126')]('userChatWebsite:remove',{'UserId':Number(_0x1fe75f[_0x5c3e('0x37')][_0x5c3e('0x61')][_0x57d2a4]),'ChatWebsiteId':Number(_0x1fe75f['params']['id'])});}}else{socket[_0x5c3e('0x126')](_0x5c3e('0x128'),{'UserId':Number(_0x1fe75f[_0x5c3e('0x37')][_0x5c3e('0x61')]),'ChatWebsiteId':Number(_0x1fe75f[_0x5c3e('0x4c')]['id'])});}});}})[_0x5c3e('0x13')](respondWithStatusCode(_0x29b5d6,null))[_0x5c3e('0x1d')](handleError(_0x29b5d6,null));};exports[_0x5c3e('0x129')]=function(_0x3d2669,_0x5b1438){var _0x42ed6e={};var _0x49ceb6={};var _0x454012;var _0x1d342a;return db[_0x5c3e('0x31')]['findOne']({'where':{'id':_0x3d2669[_0x5c3e('0x4c')]['id']}})[_0x5c3e('0x13')](handleEntityNotFound(_0x5b1438,null))[_0x5c3e('0x13')](function(_0x26df4e){if(_0x26df4e){_0x454012=_0x26df4e;_0x49ceb6['model']=_[_0x5c3e('0x38')](db[_0x5c3e('0xbb')][_0x5c3e('0x32')]);_0x49ceb6['query']=_[_0x5c3e('0x38')](_0x3d2669['query']);_0x49ceb6[_0x5c3e('0x39')]=_['intersection'](_0x49ceb6[_0x5c3e('0x36')],_0x49ceb6[_0x5c3e('0x37')]);_0x42ed6e[_0x5c3e('0x3c')]=_['intersection'](_0x49ceb6[_0x5c3e('0x36')],qs['fields'](_0x3d2669['query'][_0x5c3e('0x3b')]));_0x42ed6e[_0x5c3e('0x3c')]=_0x42ed6e[_0x5c3e('0x3c')][_0x5c3e('0x3d')]?_0x42ed6e[_0x5c3e('0x3c')]:_0x49ceb6[_0x5c3e('0x36')];_0x42ed6e['order']=qs[_0x5c3e('0x41')](_0x3d2669[_0x5c3e('0x37')][_0x5c3e('0x41')]);_0x42ed6e[_0x5c3e('0x42')]=qs[_0x5c3e('0x39')](_[_0x5c3e('0x43')](_0x3d2669['query'],_0x49ceb6[_0x5c3e('0x39')]));if(_0x3d2669['query']['filter']){_0x42ed6e[_0x5c3e('0x42')]=_[_0x5c3e('0x45')](_0x42ed6e[_0x5c3e('0x42')],{'$or':_[_0x5c3e('0x30')](_0x42ed6e[_0x5c3e('0x3c')],function(_0x513ed7){var _0xa1d79c={};_0xa1d79c[_0x513ed7]={'$like':'%'+_0x3d2669[_0x5c3e('0x37')][_0x5c3e('0x44')]+'%'};return _0xa1d79c;})});}_0x42ed6e=_[_0x5c3e('0x45')]({},_0x42ed6e,_0x3d2669[_0x5c3e('0x46')]);return _0x454012[_0x5c3e('0x129')](_0x42ed6e);}})[_0x5c3e('0x13')](function(_0x1be364){if(_0x1be364){_0x1d342a=_0x1be364[_0x5c3e('0x3d')];if(!_0x3d2669[_0x5c3e('0x37')]['hasOwnProperty'](_0x5c3e('0x3f'))){_0x42ed6e['limit']=qs[_0x5c3e('0x25')](_0x3d2669[_0x5c3e('0x37')]['limit']);_0x42ed6e[_0x5c3e('0x22')]=qs[_0x5c3e('0x22')](_0x3d2669[_0x5c3e('0x37')][_0x5c3e('0x22')]);}return _0x454012[_0x5c3e('0x129')](_0x42ed6e);}})[_0x5c3e('0x13')](function(_0x5196e7){if(_0x5196e7){return _0x5196e7?{'count':_0x1d342a,'rows':_0x5196e7}:null;}})[_0x5c3e('0x13')](respondWithResult(_0x5b1438,null))[_0x5c3e('0x1d')](handleError(_0x5b1438,null));}; \ No newline at end of file +var _0x60ee=['unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','interaction','spread','contact','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','difference','mapKeyOffline','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','offline-chat','openNewInteraction','sequelize','Attachment','bulkCreate','MailAccount','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','User','Owner','fullname','internal','Tag','tag','Command','getSnippet','timezone','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','../../config/license/util','virtual','License','increment','Intervals','push','all','some','server/files/chat/iframe.ejs','utf8','URL','address','origin','3.1.0','x-real-ip','connection','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','false','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','sort','pick','filter','merge','where','options','include','rows','show','params','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','getDispositions','findOne','Disposition','hasOwnProperty','nolimit','order','includeAll','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','create','getAnswers','findAll','removeAnswers','addLogo','filename','addAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','isNil','join','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','systemAvatar','notify','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','List','customerIp','cf-connecting-ip','first','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version'];(function(_0x48dbed,_0xd45564){var _0x163148=function(_0x2824b6){while(--_0x2824b6){_0x48dbed['push'](_0x48dbed['shift']());}};_0x163148(++_0xd45564);}(_0x60ee,0x86));var _0xe60e=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0x60ee[_0x5eef05];return _0x56d4b8;};'use strict';var BPromise=require(_0xe60e('0x0'));var Mustache=require(_0xe60e('0x1'));var util=require(_0xe60e('0x2'));var path=require(_0xe60e('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe60e('0x4'));var _=require(_0xe60e('0x5'));var querystring=require(_0xe60e('0x6'));var Redis=require(_0xe60e('0x7'));var qs=require(_0xe60e('0x8'));var logger=require(_0xe60e('0x9'))(_0xe60e('0xa'));var config=require(_0xe60e('0xb'));var url=require(_0xe60e('0xc'));var db=require('../../mysqldb')['db'];config[_0xe60e('0xd')]=_[_0xe60e('0xe')](config[_0xe60e('0xd')],{'host':_0xe60e('0xf'),'port':0x18eb});var socket=require(_0xe60e('0x10'))(new Redis(config[_0xe60e('0xd')]));require(_0xe60e('0x11'))[_0xe60e('0x12')](socket);var htmlToText=require(_0xe60e('0x13'));var jayson=require('jayson/promise');var client=jayson[_0xe60e('0x14')]['http']({'port':0x232c});var client9002=jayson[_0xe60e('0x14')]['http']({'port':0x232a});var client9003=jayson[_0xe60e('0x14')][_0xe60e('0x15')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x15bd32,_0x1588c0,_0xacb7b9,_0x1a1db3){return new BPromise(function(_0x47aa64,_0x2d0a48){var _0x59c4fe=_0x1a1db3||client;return _0x59c4fe[_0xe60e('0x16')](_0x15bd32,_0xacb7b9)[_0xe60e('0x17')](function(_0x17415b){logger[_0xe60e('0x18')](_0xe60e('0x19'),_0x1588c0,'request\x20sent');logger[_0xe60e('0x1a')](_0xe60e('0x1b'),_0x1588c0,_0xe60e('0x1c'),JSON['stringify'](_0x17415b));if(_0x17415b[_0xe60e('0x1d')]){if(_0x17415b[_0xe60e('0x1d')][_0xe60e('0x1e')]===0x1f4){logger[_0xe60e('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x1588c0,_0x17415b['error']['message']);return _0x2d0a48(_0x17415b[_0xe60e('0x1d')]['message']);}logger[_0xe60e('0x1d')](_0xe60e('0x19'),_0x1588c0,_0x17415b[_0xe60e('0x1d')][_0xe60e('0x1f')]);return _0x47aa64(_0x17415b[_0xe60e('0x1d')][_0xe60e('0x1f')]);}else{logger['info'](_0xe60e('0x19'),_0x1588c0,_0xe60e('0x1c'));_0x47aa64(_0x17415b[_0xe60e('0x20')]['message']);}})[_0xe60e('0x21')](function(_0xcdc2c7){logger[_0xe60e('0x1d')](_0xe60e('0x19'),_0x1588c0,_0xcdc2c7);_0x2d0a48(_0xcdc2c7);});});}function respondWithStatusCode(_0x365725,_0x2b4102){_0x2b4102=_0x2b4102||0xcc;return function(_0x263e81){if(_0x263e81){return _0x365725[_0xe60e('0x22')](_0x2b4102);}return _0x365725[_0xe60e('0x23')](_0x2b4102)[_0xe60e('0x24')]();};}function respondWithResult(_0x914c1,_0x10000b){_0x10000b=_0x10000b||0xc8;return function(_0x2de7fa){if(_0x2de7fa){return _0x914c1[_0xe60e('0x23')](_0x10000b)[_0xe60e('0x25')](_0x2de7fa);}};}function respondWithFilteredResult(_0x2636d2,_0x5d07fc){return function(_0x1cf74e){if(_0x1cf74e){var _0x4c81e5=typeof _0x5d07fc[_0xe60e('0x26')]===_0xe60e('0x27')&&typeof _0x5d07fc[_0xe60e('0x28')]===_0xe60e('0x27');var _0x594925=_0x1cf74e['count'];var _0x1720b4=_0x4c81e5?0x0:_0x5d07fc[_0xe60e('0x26')];var _0x14d523=_0x4c81e5?_0x1cf74e[_0xe60e('0x29')]:_0x5d07fc['offset']+_0x5d07fc[_0xe60e('0x28')];var _0x121e50;if(_0x14d523>=_0x594925){_0x14d523=_0x594925;_0x121e50=0xc8;}else{_0x121e50=0xce;}_0x2636d2[_0xe60e('0x23')](_0x121e50);return _0x2636d2[_0xe60e('0x2a')](_0xe60e('0x2b'),_0x1720b4+'-'+_0x14d523+'/'+_0x594925)[_0xe60e('0x25')](_0x1cf74e);}return null;};}function saveUpdates(_0xd4b4ee){return function(_0x324ec0){if(_0x324ec0){return _0x324ec0[_0xe60e('0x2c')](_0xd4b4ee)[_0xe60e('0x17')](function(_0x552b1e){return _0x552b1e;});}return null;};}function removeEntity(_0xa34916){return function(_0x1fc3b9){if(_0x1fc3b9){return _0x1fc3b9[_0xe60e('0x2d')]()['then'](function(){var _0x5dfae9=_0x1fc3b9[_0xe60e('0x2e')]({'plain':!![]});var _0x38d81e=_0xe60e('0x2f');return db[_0xe60e('0x30')][_0xe60e('0x2d')]({'where':{'type':_0x38d81e,'resourceId':_0x5dfae9['id']}})[_0xe60e('0x17')](function(){return _0x1fc3b9;});})[_0xe60e('0x17')](function(){_0xa34916[_0xe60e('0x23')](0xcc)[_0xe60e('0x24')]();});}};}function handleEntityNotFound(_0xb1a49f){return function(_0x569c5f){if(!_0x569c5f){_0xb1a49f[_0xe60e('0x22')](0x194);}return _0x569c5f;};}function handleError(_0x1079e1,_0x1aa549){_0x1aa549=_0x1aa549||0x1f4;return function(_0x7364d1){logger[_0xe60e('0x1d')](_0x7364d1[_0xe60e('0x31')]);if(_0x7364d1[_0xe60e('0x32')]){delete _0x7364d1['name'];}_0x1079e1[_0xe60e('0x23')](_0x1aa549)[_0xe60e('0x33')](_0x7364d1);};}exports[_0xe60e('0x34')]=function(_0x49da63,_0x277abf){var _0x14d72d={'include':[{'model':db[_0xe60e('0x35')],'as':_0xe60e('0x36')}]},_0x3e77f2={},_0x39566c={'count':0x0,'rows':[]};var _0x42081f=_[_0xe60e('0x37')](db[_0xe60e('0x38')][_0xe60e('0x39')],function(_0x5e6641){return{'name':_0x5e6641[_0xe60e('0x3a')],'type':_0x5e6641[_0xe60e('0x3b')][_0xe60e('0x3c')]};});_0x3e77f2[_0xe60e('0x3d')]=_[_0xe60e('0x37')](_0x42081f,'name');_0x3e77f2['query']=_[_0xe60e('0x3e')](_0x49da63[_0xe60e('0x3f')]);_0x3e77f2[_0xe60e('0x40')]=_[_0xe60e('0x41')](_0x3e77f2[_0xe60e('0x3d')],_0x3e77f2['query']);_0x14d72d[_0xe60e('0x42')]=_[_0xe60e('0x41')](_0x3e77f2[_0xe60e('0x3d')],qs['fields'](_0x49da63[_0xe60e('0x3f')][_0xe60e('0x43')]));_0x14d72d['attributes']=_0x14d72d[_0xe60e('0x42')][_0xe60e('0x44')]?_0x14d72d[_0xe60e('0x42')]:_0x3e77f2[_0xe60e('0x3d')];if(!_0x49da63[_0xe60e('0x3f')]['hasOwnProperty']('nolimit')){_0x14d72d[_0xe60e('0x28')]=qs[_0xe60e('0x28')](_0x49da63['query'][_0xe60e('0x28')]);_0x14d72d[_0xe60e('0x26')]=qs[_0xe60e('0x26')](_0x49da63[_0xe60e('0x3f')][_0xe60e('0x26')]);}_0x14d72d['order']=qs[_0xe60e('0x45')](_0x49da63[_0xe60e('0x3f')]['sort']);_0x14d72d['where']=qs[_0xe60e('0x40')](_[_0xe60e('0x46')](_0x49da63[_0xe60e('0x3f')],_0x3e77f2[_0xe60e('0x40')]),_0x42081f);if(_0x49da63[_0xe60e('0x3f')][_0xe60e('0x47')]){_0x14d72d['where']=_[_0xe60e('0x48')](_0x14d72d[_0xe60e('0x49')],{'$or':_[_0xe60e('0x37')](_0x42081f,function(_0x342c4c){if(_0x342c4c[_0xe60e('0x3b')]!=='VIRTUAL'){var _0x42e0d2={};_0x42e0d2[_0x342c4c[_0xe60e('0x32')]]={'$like':'%'+_0x49da63[_0xe60e('0x3f')]['filter']+'%'};return _0x42e0d2;}})});}_0x14d72d=_[_0xe60e('0x48')]({},_0x14d72d,_0x49da63[_0xe60e('0x4a')]);var _0x55138d={'where':_0x14d72d['where']};return db[_0xe60e('0x38')][_0xe60e('0x29')](_0x55138d)[_0xe60e('0x17')](function(_0x45d12b){_0x39566c[_0xe60e('0x29')]=_0x45d12b;if(_0x49da63[_0xe60e('0x3f')]['includeAll']){_0x14d72d[_0xe60e('0x4b')]=[{'all':!![]}];}return db[_0xe60e('0x38')]['findAll'](_0x14d72d);})['then'](function(_0x355a06){_0x39566c[_0xe60e('0x4c')]=_0x355a06;return _0x39566c;})[_0xe60e('0x17')](respondWithFilteredResult(_0x277abf,_0x14d72d))[_0xe60e('0x21')](handleError(_0x277abf,null));};exports[_0xe60e('0x4d')]=function(_0x2c19f,_0x5a8a06){var _0x4841c1={'raw':![],'where':{'id':_0x2c19f[_0xe60e('0x4e')]['id']},'include':[{'model':db[_0xe60e('0x35')],'as':_0xe60e('0x36')}]},_0x3bcd7b={};_0x3bcd7b['model']=_[_0xe60e('0x3e')](db[_0xe60e('0x38')]['rawAttributes']);_0x3bcd7b[_0xe60e('0x3f')]=_[_0xe60e('0x3e')](_0x2c19f[_0xe60e('0x3f')]);_0x3bcd7b['filters']=_[_0xe60e('0x41')](_0x3bcd7b[_0xe60e('0x3d')],_0x3bcd7b['query']);_0x4841c1[_0xe60e('0x42')]=_[_0xe60e('0x41')](_0x3bcd7b[_0xe60e('0x3d')],qs[_0xe60e('0x43')](_0x2c19f[_0xe60e('0x3f')][_0xe60e('0x43')]));_0x4841c1[_0xe60e('0x42')]=_0x4841c1[_0xe60e('0x42')]['length']?_0x4841c1[_0xe60e('0x42')]:_0x3bcd7b['model'];if(_0x2c19f[_0xe60e('0x3f')]['includeAll']){_0x4841c1[_0xe60e('0x4b')]=[{'all':!![]}];}_0x4841c1=_[_0xe60e('0x48')]({},_0x4841c1,_0x2c19f['options']);return db['ChatWebsite'][_0xe60e('0x4f')](_0x4841c1)[_0xe60e('0x17')](handleEntityNotFound(_0x5a8a06,null))[_0xe60e('0x17')](respondWithResult(_0x5a8a06,null))['catch'](handleError(_0x5a8a06,null));};exports['create']=function(_0x54dd4a,_0xcfba85){return db[_0xe60e('0x38')]['create'](_0x54dd4a['body'],{})[_0xe60e('0x17')](function(_0x36350f){var _0x2dc902=_0x54dd4a[_0xe60e('0x50')][_0xe60e('0x2e')]({'plain':!![]});if(!_0x2dc902)throw new Error(_0xe60e('0x51'));if(_0x2dc902[_0xe60e('0x52')]===_0xe60e('0x50')){var _0x45715a=_0x36350f[_0xe60e('0x2e')]({'plain':!![]});var _0x57cda7=_0xe60e('0x2f');return db[_0xe60e('0x53')]['find']({'where':{'name':_0x57cda7,'userProfileId':_0x2dc902[_0xe60e('0x54')]},'raw':!![]})[_0xe60e('0x17')](function(_0x12be6d){if(_0x12be6d&&_0x12be6d[_0xe60e('0x55')]===0x0){return db[_0xe60e('0x30')]['create']({'name':_0x45715a['name'],'resourceId':_0x45715a['id'],'type':_0x12be6d[_0xe60e('0x32')],'sectionId':_0x12be6d['id']},{})[_0xe60e('0x17')](function(){return _0x36350f;});}else{return _0x36350f;}})[_0xe60e('0x21')](function(_0x5d0907){logger['error'](_0xe60e('0x56'),_0x5d0907);throw _0x5d0907;});}return _0x36350f;})[_0xe60e('0x17')](respondWithResult(_0xcfba85,0xc9))[_0xe60e('0x21')](handleError(_0xcfba85,null));};exports[_0xe60e('0x2c')]=function(_0x291003,_0x3aa216){if(_0x291003[_0xe60e('0x57')]['id']){delete _0x291003['body']['id'];}return db['ChatWebsite'][_0xe60e('0x4f')]({'where':{'id':_0x291003[_0xe60e('0x4e')]['id']},'include':[{'model':db[_0xe60e('0x35')],'as':_0xe60e('0x36')}]})[_0xe60e('0x17')](handleEntityNotFound(_0x3aa216,null))['then'](saveUpdates(_0x291003[_0xe60e('0x57')],null))['then'](respondWithResult(_0x3aa216,null))[_0xe60e('0x21')](handleError(_0x3aa216,null));};exports['destroy']=function(_0x28c162,_0x1aec28){return db[_0xe60e('0x38')][_0xe60e('0x4f')]({'where':{'id':_0x28c162[_0xe60e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1aec28,null))[_0xe60e('0x17')](removeEntity(_0x1aec28,null))[_0xe60e('0x21')](handleError(_0x1aec28,null));};exports['describe']=function(_0x134650,_0x2f6b75){return db[_0xe60e('0x38')][_0xe60e('0x58')]()[_0xe60e('0x17')](respondWithResult(_0x2f6b75,null))[_0xe60e('0x21')](handleError(_0x2f6b75,null));};exports[_0xe60e('0x59')]=function(_0x4410de,_0x32097a){if(_0x4410de[_0xe60e('0x57')]['id']){delete _0x4410de[_0xe60e('0x57')]['id'];}return db['ChatWebsite'][_0xe60e('0x4f')]({'where':{'id':_0x4410de[_0xe60e('0x4e')]['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0x32097a,null))[_0xe60e('0x17')](function(_0x2b2b93){if(_0x2b2b93){_0x4410de[_0xe60e('0x57')]['ChatWebsiteId']=_0x2b2b93['id'];return db['Disposition']['create'](_0x4410de['body']);}})[_0xe60e('0x17')](respondWithResult(_0x32097a,null))[_0xe60e('0x21')](handleError(_0x32097a,null));};exports[_0xe60e('0x5a')]=function(_0x5aa9a2,_0x24fd33){var _0x416f3a={'raw':![],'where':{}};var _0xf0d348={};var _0x15e364={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe60e('0x5b')]({'where':{'id':_0x5aa9a2['params']['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0x24fd33,null))[_0xe60e('0x17')](function(_0x51ed50){if(_0x51ed50){_0xf0d348['model']=_[_0xe60e('0x3e')](db[_0xe60e('0x5c')]['rawAttributes']);_0xf0d348['query']=_[_0xe60e('0x3e')](_0x5aa9a2[_0xe60e('0x3f')]);_0xf0d348[_0xe60e('0x40')]=_[_0xe60e('0x41')](_0xf0d348[_0xe60e('0x3d')],_0xf0d348['query']);_0x416f3a['attributes']=_['intersection'](_0xf0d348['model'],qs[_0xe60e('0x43')](_0x5aa9a2[_0xe60e('0x3f')][_0xe60e('0x43')]));_0x416f3a['attributes']=_0x416f3a['attributes']['length']?_0x416f3a[_0xe60e('0x42')]:_0xf0d348[_0xe60e('0x3d')];if(!_0x5aa9a2[_0xe60e('0x3f')][_0xe60e('0x5d')](_0xe60e('0x5e'))){_0x416f3a['limit']=qs['limit'](_0x5aa9a2[_0xe60e('0x3f')][_0xe60e('0x28')]);_0x416f3a[_0xe60e('0x26')]=qs[_0xe60e('0x26')](_0x5aa9a2[_0xe60e('0x3f')][_0xe60e('0x26')]);}_0x416f3a[_0xe60e('0x5f')]=qs['sort'](_0x5aa9a2[_0xe60e('0x3f')][_0xe60e('0x45')]);_0x416f3a[_0xe60e('0x49')]=qs[_0xe60e('0x40')](_['pick'](_0x5aa9a2[_0xe60e('0x3f')],_0xf0d348['filters']));_0x416f3a[_0xe60e('0x49')]['ChatWebsiteId']=_0x51ed50['id'];if(_0x5aa9a2[_0xe60e('0x3f')][_0xe60e('0x47')]){_0x416f3a[_0xe60e('0x49')]=_[_0xe60e('0x48')](_0x416f3a[_0xe60e('0x49')],{'$or':_[_0xe60e('0x37')](_0x416f3a[_0xe60e('0x42')],function(_0x41aab8){var _0x43615a={};_0x43615a[_0x41aab8]={'$like':'%'+_0x5aa9a2[_0xe60e('0x3f')][_0xe60e('0x47')]+'%'};return _0x43615a;})});}_0x416f3a=_['merge']({},_0x416f3a,_0x5aa9a2['options']);return db[_0xe60e('0x5c')][_0xe60e('0x29')]({'where':_0x416f3a['where']})[_0xe60e('0x17')](function(_0x10e158){_0x15e364[_0xe60e('0x29')]=_0x10e158;if(_0x5aa9a2[_0xe60e('0x3f')][_0xe60e('0x60')]){_0x416f3a[_0xe60e('0x4b')]=[{'all':!![]}];}return db[_0xe60e('0x5c')]['findAll'](_0x416f3a);})['then'](function(_0x2fe403){_0x15e364['rows']=_0x2fe403;return _0x15e364;});}})['then'](respondWithFilteredResult(_0x24fd33,_0x416f3a))[_0xe60e('0x21')](handleError(_0x24fd33,null));};exports[_0xe60e('0x61')]=function(_0x23f95c,_0x5314e2){return db[_0xe60e('0x38')]['find']({'where':{'id':_0x23f95c[_0xe60e('0x4e')]['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0x5314e2,null))[_0xe60e('0x17')](function(_0x335ecb){if(_0x335ecb){return _0x335ecb['removeDispositions'](_0x23f95c['query'][_0xe60e('0x62')]);}})[_0xe60e('0x17')](respondWithStatusCode(_0x5314e2,null))[_0xe60e('0x21')](handleError(_0x5314e2,null));};exports[_0xe60e('0x63')]=function(_0x18106b,_0x40cb64){if(_0x18106b[_0xe60e('0x57')]['id']){delete _0x18106b['body']['id'];}return db[_0xe60e('0x38')]['find']({'where':{'id':_0x18106b[_0xe60e('0x4e')]['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0x40cb64,null))[_0xe60e('0x17')](function(_0x477ba0){if(_0x477ba0){_0x18106b['body'][_0xe60e('0x64')]=_0x477ba0['id'];return db[_0xe60e('0x65')][_0xe60e('0x66')](_0x18106b[_0xe60e('0x57')]);}})[_0xe60e('0x17')](respondWithResult(_0x40cb64,null))[_0xe60e('0x21')](handleError(_0x40cb64,null));};exports[_0xe60e('0x67')]=function(_0x4b967d,_0xe678de){var _0x4b0e3d={'raw':![],'where':{}};var _0x5f5b60={};var _0x31d583={'count':0x0,'rows':[]};return db[_0xe60e('0x38')][_0xe60e('0x5b')]({'where':{'id':_0x4b967d[_0xe60e('0x4e')]['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0xe678de,null))['then'](function(_0x49b7fd){if(_0x49b7fd){_0x5f5b60[_0xe60e('0x3d')]=_['keys'](db[_0xe60e('0x65')][_0xe60e('0x39')]);_0x5f5b60['query']=_[_0xe60e('0x3e')](_0x4b967d[_0xe60e('0x3f')]);_0x5f5b60['filters']=_[_0xe60e('0x41')](_0x5f5b60[_0xe60e('0x3d')],_0x5f5b60['query']);_0x4b0e3d[_0xe60e('0x42')]=_[_0xe60e('0x41')](_0x5f5b60[_0xe60e('0x3d')],qs[_0xe60e('0x43')](_0x4b967d[_0xe60e('0x3f')]['fields']));_0x4b0e3d[_0xe60e('0x42')]=_0x4b0e3d[_0xe60e('0x42')]['length']?_0x4b0e3d[_0xe60e('0x42')]:_0x5f5b60[_0xe60e('0x3d')];if(!_0x4b967d[_0xe60e('0x3f')]['hasOwnProperty'](_0xe60e('0x5e'))){_0x4b0e3d[_0xe60e('0x28')]=qs[_0xe60e('0x28')](_0x4b967d[_0xe60e('0x3f')][_0xe60e('0x28')]);_0x4b0e3d['offset']=qs['offset'](_0x4b967d[_0xe60e('0x3f')][_0xe60e('0x26')]);}_0x4b0e3d[_0xe60e('0x5f')]=qs[_0xe60e('0x45')](_0x4b967d['query']['sort']);_0x4b0e3d[_0xe60e('0x49')]=qs['filters'](_[_0xe60e('0x46')](_0x4b967d['query'],_0x5f5b60[_0xe60e('0x40')]));_0x4b0e3d['where']['ChatWebsiteId']=_0x49b7fd['id'];if(_0x4b967d[_0xe60e('0x3f')][_0xe60e('0x47')]){_0x4b0e3d[_0xe60e('0x49')]=_[_0xe60e('0x48')](_0x4b0e3d[_0xe60e('0x49')],{'$or':_[_0xe60e('0x37')](_0x4b0e3d['attributes'],function(_0xde9985){var _0x1e910e={};_0x1e910e[_0xde9985]={'$like':'%'+_0x4b967d[_0xe60e('0x3f')][_0xe60e('0x47')]+'%'};return _0x1e910e;})});}_0x4b0e3d=_[_0xe60e('0x48')]({},_0x4b0e3d,_0x4b967d[_0xe60e('0x4a')]);return db[_0xe60e('0x65')][_0xe60e('0x29')]({'where':_0x4b0e3d['where']})['then'](function(_0x4dbb1d){_0x31d583[_0xe60e('0x29')]=_0x4dbb1d;if(_0x4b967d[_0xe60e('0x3f')][_0xe60e('0x60')]){_0x4b0e3d['include']=[{'all':!![]}];}return db[_0xe60e('0x65')][_0xe60e('0x68')](_0x4b0e3d);})['then'](function(_0x4a3e8f){_0x31d583[_0xe60e('0x4c')]=_0x4a3e8f;return _0x31d583;});}})[_0xe60e('0x17')](respondWithFilteredResult(_0xe678de,_0x4b0e3d))[_0xe60e('0x21')](handleError(_0xe678de,null));};exports[_0xe60e('0x69')]=function(_0x5d8350,_0x3599b2){return db[_0xe60e('0x38')][_0xe60e('0x4f')]({'where':{'id':_0x5d8350['params']['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0x3599b2,null))[_0xe60e('0x17')](function(_0x75c504){if(_0x75c504){return _0x75c504[_0xe60e('0x69')](_0x5d8350[_0xe60e('0x3f')][_0xe60e('0x62')]);}})[_0xe60e('0x17')](respondWithStatusCode(_0x3599b2,null))['catch'](handleError(_0x3599b2,null));};exports[_0xe60e('0x6a')]=function(_0x125ba7,_0xad6202){_0x125ba7[_0xe60e('0x57')]['sitepic']=_0x125ba7['file'][_0xe60e('0x6b')];return db[_0xe60e('0x38')][_0xe60e('0x4f')]({'where':{'id':_0x125ba7[_0xe60e('0x4e')]['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0xad6202,null))[_0xe60e('0x17')](saveUpdates(_0x125ba7[_0xe60e('0x57')],null))[_0xe60e('0x17')](respondWithResult(_0xad6202,null))[_0xe60e('0x21')](handleError(_0xad6202,null));};exports[_0xe60e('0x6c')]=function(_0x6a669b,_0x53da70){_0x6a669b[_0xe60e('0x57')]['agentAvatar']=_0x6a669b[_0xe60e('0x6d')][_0xe60e('0x6b')];return db[_0xe60e('0x38')]['find']({'where':{'id':_0x6a669b['params']['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0x53da70,null))[_0xe60e('0x17')](saveUpdates(_0x6a669b[_0xe60e('0x57')],null))[_0xe60e('0x17')](respondWithResult(_0x53da70,null))[_0xe60e('0x21')](handleError(_0x53da70,null));};exports[_0xe60e('0x6e')]=function(_0x2b6125,_0x4d27ae){_0x2b6125[_0xe60e('0x57')][_0xe60e('0x6f')]=_0x2b6125[_0xe60e('0x6d')][_0xe60e('0x6b')];return db[_0xe60e('0x38')]['find']({'where':{'id':_0x2b6125[_0xe60e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d27ae,null))[_0xe60e('0x17')](saveUpdates(_0x2b6125[_0xe60e('0x57')],null))[_0xe60e('0x17')](respondWithResult(_0x4d27ae,null))[_0xe60e('0x21')](handleError(_0x4d27ae,null));};exports[_0xe60e('0x70')]=function(_0x235481,_0x319305){_0x235481[_0xe60e('0x57')]['systemAvatar']=_0x235481[_0xe60e('0x6d')][_0xe60e('0x6b')];return db['ChatWebsite'][_0xe60e('0x4f')]({'where':{'id':_0x235481[_0xe60e('0x4e')]['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0x319305,null))[_0xe60e('0x17')](saveUpdates(_0x235481[_0xe60e('0x57')],null))[_0xe60e('0x17')](respondWithResult(_0x319305,null))[_0xe60e('0x21')](handleError(_0x319305,null));};exports[_0xe60e('0x71')]=function(_0x4a152a,_0xe70b34){var _0x226820=path['join'](config['root'],_0xe60e('0x72'));var _0x3779d6={'where':{'id':_0x4a152a[_0xe60e('0x4e')]['id']},'attributes':['id',_0xe60e('0x73')],'raw':!![]};var _0x4763ad=![];return require('../../config/license/util')[_0xe60e('0x74')]()[_0xe60e('0x17')](function(_0x2fee20){if(_0x2fee20){_0x4763ad=_0x2fee20[_0xe60e('0x75')];}})['then'](function(){return db[_0xe60e('0x38')][_0xe60e('0x4f')](_0x3779d6);})['then'](handleEntityNotFound(_0xe70b34,null))['then'](function(_0x34e33a){if(_0x34e33a){if(!_[_0xe60e('0x76')](_0x34e33a[_0xe60e('0x73')])){if(fs['existsSync'](path[_0xe60e('0x77')](config[_0xe60e('0x78')],_0xe60e('0x79'),_0x34e33a[_0xe60e('0x73')]))&&_0x4763ad){_0x226820=path[_0xe60e('0x77')](config['root'],'server/files/images/logos/',_0x34e33a['sitepic']);}}return _0xe70b34[_0xe60e('0x7a')](_0x226820);}})['catch'](handleError(_0xe70b34,null));};exports[_0xe60e('0x7b')]=function(_0x10857d,_0xb204ee){var _0x3b7448=path[_0xe60e('0x77')](config[_0xe60e('0x78')],_0xe60e('0x7c'));var _0x38651d={'where':{'id':_0x10857d['params']['id']},'attributes':['id',_0xe60e('0x7d')],'raw':!![]};return db[_0xe60e('0x38')][_0xe60e('0x4f')](_0x38651d)[_0xe60e('0x17')](handleEntityNotFound(_0xb204ee,null))[_0xe60e('0x17')](function(_0x3dd69b){if(_0x3dd69b){if(!_[_0xe60e('0x76')](_0x3dd69b[_0xe60e('0x7d')])){if(fs[_0xe60e('0x7e')](path['join'](config[_0xe60e('0x78')],'server/files/images/avatars/',_0x3dd69b['agentAvatar']))){_0x3b7448=path[_0xe60e('0x77')](config['root'],_0xe60e('0x7f'),_0x3dd69b['agentAvatar']);}}return _0xb204ee['download'](_0x3b7448);}})['catch'](handleError(_0xb204ee,null));};exports[_0xe60e('0x80')]=function(_0x41d4b7,_0x31ed8b){var _0x42abf2=path[_0xe60e('0x77')](config[_0xe60e('0x78')],_0xe60e('0x81'));var _0x488f94={'where':{'id':_0x41d4b7[_0xe60e('0x4e')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xe60e('0x4f')](_0x488f94)[_0xe60e('0x17')](handleEntityNotFound(_0x31ed8b,null))['then'](function(_0x15f9c2){if(_0x15f9c2){if(!_[_0xe60e('0x76')](_0x15f9c2[_0xe60e('0x6f')])){if(fs[_0xe60e('0x7e')](path['join'](config['root'],_0xe60e('0x7f'),_0x15f9c2['customerAvatar']))&&_0x15f9c2[_0xe60e('0x82')]){_0x42abf2=path[_0xe60e('0x77')](config['root'],'server/files/images/avatars/',_0x15f9c2[_0xe60e('0x6f')]);}}return _0x31ed8b['download'](_0x42abf2);}})[_0xe60e('0x21')](handleError(_0x31ed8b,null));};exports[_0xe60e('0x83')]=function(_0x5ad304,_0x14a1af){var _0x479082=path['join'](config[_0xe60e('0x78')],'server/files/images/avatars/system_avatar.png');var _0x39e27a={'where':{'id':_0x5ad304[_0xe60e('0x4e')]['id']},'attributes':['id',_0xe60e('0x84')],'raw':!![]};return db[_0xe60e('0x38')][_0xe60e('0x4f')](_0x39e27a)[_0xe60e('0x17')](handleEntityNotFound(_0x14a1af,null))[_0xe60e('0x17')](function(_0x2bbf4f){if(_0x2bbf4f){if(!_[_0xe60e('0x76')](_0x2bbf4f[_0xe60e('0x84')])){if(fs[_0xe60e('0x7e')](path['join'](config[_0xe60e('0x78')],_0xe60e('0x7f'),_0x2bbf4f[_0xe60e('0x84')]))){_0x479082=path[_0xe60e('0x77')](config['root'],_0xe60e('0x7f'),_0x2bbf4f[_0xe60e('0x84')]);}}return _0x14a1af[_0xe60e('0x7a')](_0x479082);}})['catch'](handleError(_0x14a1af,null));};exports[_0xe60e('0x85')]=function(_0x1c85c6,_0x44c8d9){var _0x537951=require('user-agent-parser');var _0x5e783d=new _0x537951();var _0x5c3c4a=_0x5e783d[_0xe60e('0x86')](_0x1c85c6[_0xe60e('0x87')][_0xe60e('0x88')])[_0xe60e('0x89')]();var _0x81fce7={'body':_0x1c85c6['body'],'channel':_0xe60e('0x8a')};var _0x3801a6=[];var _0x4ee5bc=[];var _0xd74b2e={};var _0x30fee3=![];return db[_0xe60e('0x8b')]['describe']()['then'](function(_0x363bf7){if(!_0x363bf7){throw new db[(_0xe60e('0x8c'))][(_0xe60e('0x8d'))](_0xe60e('0x8e'));}_0x3801a6=_['difference'](_[_0xe60e('0x3e')](_0x363bf7),[_0xe60e('0x8f'),'updatedAt']);_0x4ee5bc=_['difference'](_[_0xe60e('0x3e')](_0x363bf7),[_0xe60e('0x8f'),_0xe60e('0x90'),_0xe60e('0x91'),_0xe60e('0x92')]);if(_0x1c85c6[_0xe60e('0x57')]['id']){delete _0x1c85c6[_0xe60e('0x57')]['id'];}if(_[_0xe60e('0x76')](_0x1c85c6[_0xe60e('0x57')][_0xe60e('0x93')])){throw new db[(_0xe60e('0x8c'))][(_0xe60e('0x8d'))](_0xe60e('0x94'));}if(_[_0xe60e('0x76')](_0x1c85c6['body'][_0xe60e('0x57')])||_0x1c85c6[_0xe60e('0x57')][_0xe60e('0x57')]===''){throw new db[(_0xe60e('0x8c'))][(_0xe60e('0x8d'))](_0xe60e('0x95'));}if(_[_0xe60e('0x76')](_0x1c85c6[_0xe60e('0x57')][_0xe60e('0x96')])){throw new db[(_0xe60e('0x8c'))][(_0xe60e('0x8d'))](_0xe60e('0x97')+_0x4ee5bc);}if(!_[_0xe60e('0x98')](_0x4ee5bc,_0x1c85c6[_0xe60e('0x57')][_0xe60e('0x96')])){throw new db['Sequelize'][(_0xe60e('0x8d'))](_0xe60e('0x99')+_0x4ee5bc);}_0xd74b2e[_0x1c85c6[_0xe60e('0x57')]['mapKey']]=_0x1c85c6[_0xe60e('0x57')]['from'];})['then'](function(){return db[_0xe60e('0x38')][_0xe60e('0x4f')]({'where':{'id':_0x1c85c6[_0xe60e('0x4e')]['id']},'include':[{'model':db[_0xe60e('0x9a')],'as':'List','include':[{'model':db[_0xe60e('0x8b')],'as':_0xe60e('0x9b'),'where':_0xd74b2e,'limit':0x1,'order':[[_0xe60e('0x90'),_0xe60e('0x9c')]]}]},{'model':db[_0xe60e('0x9d')],'as':_0xe60e('0x9e')}]});})[_0xe60e('0x17')](handleEntityNotFound(_0x44c8d9,null))[_0xe60e('0x17')](function(_0x125385){if(_0x125385&&_0x125385['List']){_0x81fce7[_0xe60e('0x9f')]=_0x125385;_0x81fce7[_0xe60e('0xa0')]=_0x125385[_0xe60e('0x9e')];_0x81fce7[_0xe60e('0xa1')]=_0x125385['List'];_0x81fce7[_0xe60e('0xa0')]=_[_0xe60e('0xa2')](_0x81fce7[_0xe60e('0xa0')],[_0xe60e('0xa3')],[_0xe60e('0xa4')]);if(_0x81fce7[_0xe60e('0x9f')][_0xe60e('0x9e')]){delete _0x81fce7['account'][_0xe60e('0x9e')];}if(_0x81fce7['account']['List']&&_0x81fce7['account'][_0xe60e('0xa5')]['Contacts'][_0xe60e('0x44')]){return _0x81fce7[_0xe60e('0x9f')][_0xe60e('0xa5')][_0xe60e('0x9b')][0x0];}var _0x465f12=_[_0xe60e('0xe')](_0x1c85c6[_0xe60e('0x57')],{'firstName':_0x1c85c6[_0xe60e('0x57')][_0xe60e('0x93')],'ListId':_0x125385['ListId']});_0x465f12[_0x1c85c6[_0xe60e('0x57')]['mapKey']]=_0x1c85c6[_0xe60e('0x57')][_0xe60e('0x93')];return db['CmContact'][_0xe60e('0x66')](_0x465f12,{'fields':_0x3801a6,'raw':!![]});}})[_0xe60e('0x17')](handleEntityNotFound(_0x44c8d9,null))[_0xe60e('0x17')](function(_0x298700){_0x81fce7['contact']=_0x298700;var _0x54553d=_0x1c85c6[_0xe60e('0x57')][_0xe60e('0xa6')];if(_0x1c85c6['headers'][_0xe60e('0xa7')]){_0x54553d=_0x1c85c6[_0xe60e('0x87')]['cf-connecting-ip'];}else if(_0x1c85c6['headers']['x-forwarded-for']){_0x54553d=_[_0xe60e('0xa8')](_0x1c85c6[_0xe60e('0x87')][_0xe60e('0xa9')]['split'](','));}if(_0x298700){var _0x18e77c={'ContactId':_0x298700['id'],'ChatWebsiteId':_0x1c85c6[_0xe60e('0x4e')]['id'],'from':(_0x298700[_0xe60e('0xaa')]||'')+'\x20'+(_0x298700[_0xe60e('0xab')]||''),'customerIp':_0x54553d,'customerPort':_0x1c85c6['headers'][_0xe60e('0xac')]?_0x1c85c6[_0xe60e('0x87')][_0xe60e('0xac')]:null,'referer':_0x1c85c6[_0xe60e('0x57')][_0xe60e('0xad')],'browserName':_0x5c3c4a[_0xe60e('0xae')][_0xe60e('0x32')]&&_0x5c3c4a[_0xe60e('0xae')]['version']?util[_0xe60e('0xaf')](_0xe60e('0xb0'),_0x5c3c4a[_0xe60e('0xae')]['name'],_0x5c3c4a['browser'][_0xe60e('0xb1')]):'unknown','browserVersion':_0x5c3c4a['browser'][_0xe60e('0xb1')]||_0xe60e('0xb2'),'osName':util[_0xe60e('0xaf')](_0xe60e('0xb0'),_0x5c3c4a['os'][_0xe60e('0x32')],_0x5c3c4a['os'][_0xe60e('0xb1')]),'osVersion':_0x5c3c4a['os']['version'],'deviceModel':_0x5c3c4a[_0xe60e('0xb3')]['model']&&_0x5c3c4a[_0xe60e('0xb3')][_0xe60e('0xb4')]?util[_0xe60e('0xaf')](_0xe60e('0xb5'),_0x5c3c4a['device']['model'],_0x5c3c4a[_0xe60e('0xb3')][_0xe60e('0xb4')],_0x5c3c4a[_0xe60e('0xb3')][_0xe60e('0x3b')]):null,'deviceVendor':_0x5c3c4a[_0xe60e('0xb3')][_0xe60e('0xb4')],'deviceType':_0x5c3c4a[_0xe60e('0xb3')][_0xe60e('0x3b')],'formData':JSON[_0xe60e('0xb6')](_0x1c85c6[_0xe60e('0x57')])};var _0x5dcaab={'ChatWebsiteId':_0x1c85c6[_0xe60e('0x4e')]['id'],'closed':![]};if(_0x1c85c6[_0xe60e('0x57')][_0xe60e('0xb7')]){_0x5dcaab['threadId']=_0x1c85c6[_0xe60e('0x57')][_0xe60e('0xb7')];return db[_0xe60e('0xb8')][_0xe60e('0x4f')]({'where':_0x5dcaab})['then'](function(_0x30de45){if(_0x30de45){return[_0x30de45,![]];}_0x18e77c[_0xe60e('0xb7')]=_0x1c85c6[_0xe60e('0x57')][_0xe60e('0xb7')];_0x18e77c[_0xe60e('0xb9')]=_0x1c85c6[_0xe60e('0x57')][_0xe60e('0xb9')];return db[_0xe60e('0xb8')][_0xe60e('0x66')](_0x18e77c)[_0xe60e('0x17')](function(_0x299b67){return[_0x299b67,!![]];});});}_0x5dcaab['ContactId']=_0x298700['id'];if(_0x1c85c6[_0xe60e('0x57')][_0xe60e('0xba')]&&_0x1c85c6[_0xe60e('0x57')]['interaction']['id']){_0x5dcaab['id']=_0x1c85c6[_0xe60e('0x57')]['interaction']['id'];return db[_0xe60e('0xb8')][_0xe60e('0x4f')]({'where':_0x5dcaab})[_0xe60e('0x17')](function(_0x4690e5){if(_0x4690e5){return[_0x4690e5,![]];}return db[_0xe60e('0xb8')][_0xe60e('0x66')](_0x18e77c)[_0xe60e('0x17')](function(_0x3872c9){return[_0x3872c9,!![]];});});}return db[_0xe60e('0xb8')][_0xe60e('0x66')](_0x18e77c)['then'](function(_0x511267){return[_0x511267,!![]];});}})[_0xe60e('0xbb')](function(_0x1ba5bc,_0x3f988b){if(_0x1ba5bc){_0x30fee3=_0x3f988b;if(!_0x3f988b){var _0xad762c={'from':(_0x81fce7[_0xe60e('0xbc')][_0xe60e('0xaa')]||'')+'\x20'+(_0x81fce7[_0xe60e('0xbc')][_0xe60e('0xab')]||'')};if(_0x1c85c6[_0xe60e('0x57')][_0xe60e('0xb7')]&&_0x1c85c6[_0xe60e('0x57')][_0xe60e('0xbd')]&&_0x1c85c6[_0xe60e('0x57')][_0xe60e('0xb7')]!=_0x1c85c6[_0xe60e('0x57')][_0xe60e('0xbd')]){_0xad762c[_0xe60e('0xb7')]=_0x1c85c6[_0xe60e('0x57')][_0xe60e('0xbd')];}return _0x1ba5bc['update'](_0xad762c);}else{return _0x1ba5bc;}}})[_0xe60e('0x17')](function(_0x1922d6){_0x81fce7[_0xe60e('0xba')]=_0x1922d6['get']({'plain':!![]});_0x81fce7[_0xe60e('0xba')][_0xe60e('0xbe')]=_0x30fee3;if(_0x81fce7[_0xe60e('0xba')][_0xe60e('0xbe')]){if(_0x81fce7['account'][_0xe60e('0xbf')]){_0x81fce7[_0xe60e('0xa0')]['push']({'id':0x0,'priority':_0x81fce7[_0xe60e('0xa0')]['length']+0x1,'app':_0xe60e('0xc0'),'appdata':_0xe60e('0xc1'),'interval':_0xe60e('0xc2')});}}return db[_0xe60e('0xc3')][_0xe60e('0x66')]({'body':_0x1c85c6[_0xe60e('0x57')]['body'],'ChatWebsiteId':_0x1c85c6[_0xe60e('0x4e')]['id'],'ChatInteractionId':_0x1922d6['id'],'direction':'in','ContactId':_0x81fce7['contact']['id'],'AttachmentId':_0x1c85c6[_0xe60e('0x57')][_0xe60e('0xc4')]});})['then'](function(_0x575c2d){_0x81fce7[_0xe60e('0x1f')]=_0x575c2d;if(_0x81fce7[_0xe60e('0xba')][_0xe60e('0xc5')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x81fce7['interaction'][_0xe60e('0xc5')]}})['then'](function(_0x50fea8){if(_0x50fea8){_0x81fce7[_0xe60e('0xa0')][_0xe60e('0xc6')]({'id':0x0,'priority':0x0,'app':_0xe60e('0xc7'),'appdata':_0x50fea8[_0xe60e('0x32')]+','+(_0x81fce7[_0xe60e('0x9f')][_0xe60e('0xc8')]||0xa),'interval':_0xe60e('0xc2')});_0x81fce7['forcedOwnership']=!![];}return respondWithRpcPromise('Start','startRouting',_0x81fce7);});}return respondWithRpcPromise(_0xe60e('0xc9'),_0xe60e('0xca'),_0x81fce7);})[_0xe60e('0x17')](function(_0x33a055){respondWithRpcPromise(_0xe60e('0xcb'),_0xe60e('0xcb'),{'event':_0xe60e('0x85'),'message':_0x33a055},client9002);return _0x33a055;})[_0xe60e('0x17')](respondWithResult(_0x44c8d9,null))[_0xe60e('0x21')](handleError(_0x44c8d9,null));};exports[_0xe60e('0xcc')]=function(_0x2c7dc2,_0x819d95){var _0x3cb746,_0x365983,_0x4fdbe1;var _0x19c5c2=[];var _0x5a8c82={};var _0x1ac02e=_0x2c7dc2[_0xe60e('0xcd')]||[];var _0x46bce4=[];var _0x3df079;return db[_0xe60e('0x8b')]['describe']()[_0xe60e('0x17')](function(_0x53ca81){if(!_0x53ca81){throw new db['Sequelize']['ValidationError'](_0xe60e('0x8e'));}_0x19c5c2=_[_0xe60e('0xce')](_[_0xe60e('0x3e')](_0x53ca81),[_0xe60e('0x8f'),_0xe60e('0x90'),'CompanyId',_0xe60e('0x92')]);if(_0x2c7dc2[_0xe60e('0x57')]['id']){delete _0x2c7dc2[_0xe60e('0x57')]['id'];}if(_['isNil'](_0x2c7dc2[_0xe60e('0x57')][_0xe60e('0x93')])){throw _0x819d95[_0xe60e('0x23')](0x1f4)[_0xe60e('0x33')](new db[(_0xe60e('0x8c'))]['ValidationError'](_0xe60e('0x94')));}if(_[_0xe60e('0x76')](_0x2c7dc2['body'][_0xe60e('0x57')])||_0x2c7dc2[_0xe60e('0x57')][_0xe60e('0x57')]===''){throw _0x819d95['status'](0x1f4)[_0xe60e('0x33')](new db[(_0xe60e('0x8c'))][(_0xe60e('0x8d'))](_0xe60e('0x95')));}if(_[_0xe60e('0x76')](_0x2c7dc2[_0xe60e('0x57')][_0xe60e('0xcf')])){throw _0x819d95['status'](0x1f4)[_0xe60e('0x33')](new db[(_0xe60e('0x8c'))][(_0xe60e('0x8d'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19c5c2));}if(!_[_0xe60e('0x98')](_0x19c5c2,_0x2c7dc2[_0xe60e('0x57')][_0xe60e('0xcf')])){throw _0x819d95[_0xe60e('0x23')](0x1f4)[_0xe60e('0x33')](new db[(_0xe60e('0x8c'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19c5c2));}_0x5a8c82[_0x2c7dc2[_0xe60e('0x57')][_0xe60e('0xcf')]]=_0x2c7dc2[_0xe60e('0x57')]['from'];})['then'](function(){return db[_0xe60e('0x38')][_0xe60e('0x4f')]({'where':{'id':_0x2c7dc2[_0xe60e('0x4e')]['id']},'include':[{'model':db[_0xe60e('0x9a')],'as':_0xe60e('0xa5')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0xe60e('0x17')](handleEntityNotFound(_0x819d95,null))[_0xe60e('0x17')](function(_0x56310c){if(_0x56310c&&_0x56310c[_0xe60e('0xa5')]){_0x365983=_0x56310c;var _0x5bbc9c=_[_0xe60e('0xe')](_0x2c7dc2['body'],{'firstName':_0x2c7dc2['body'][_0xe60e('0x93')],'phone':_0x2c7dc2['body'][_0xe60e('0x93')],'ListId':_0x56310c[_0xe60e('0x92')]});_0x5bbc9c[_0x2c7dc2['body'][_0xe60e('0xcf')]]=_0x2c7dc2[_0xe60e('0x57')][_0xe60e('0x93')];return db[_0xe60e('0x8b')][_0xe60e('0xd0')]({'where':_0x5a8c82,'defaults':_0x5bbc9c});}})[_0xe60e('0xbb')](function(_0x3d5661){if(_0x3d5661){_0x4fdbe1=_0x3d5661;var _0x1ba39a=fs[_0xe60e('0xd1')](path[_0xe60e('0x77')](config[_0xe60e('0x78')],_0xe60e('0xd2')),'utf8');var _0x5e256f=ejs[_0xe60e('0xd3')](_0x1ba39a,{'body':_[_0xe60e('0xd4')](_0x2c7dc2['body'][_0xe60e('0x57')]),'bodyTitle':_0x365983[_0xe60e('0xd5')]});return db[_0xe60e('0xd6')]['create']({'body':_0x5e256f,'plainBody':htmlToText['fromString'](_0x5e256f),'ContactId':_0x3d5661['id'],'ChatWebsiteId':_0x365983['id']});}})[_0xe60e('0x17')](function(_0x4885fd){_0x3df079=_0x4885fd;if(_0x1ac02e[_0xe60e('0x44')]){var _0x22c32a=_0x1ac02e[_0xe60e('0x37')](function(_0x35b2e8){return{'name':_0x35b2e8[_0xe60e('0xd7')],'basename':_0x35b2e8[_0xe60e('0x6b')],'type':_0x35b2e8['mimetype'],'ChatOfflineMessageId':_0x4885fd['id']};});_0x46bce4=_0x22c32a[_0xe60e('0x37')](_0xf94f30=>{var _0x3b847f={'filename':_0xf94f30[_0xe60e('0x32')],'path':path[_0xe60e('0x77')](config['root'],_0xe60e('0xd8'),'files',_0xe60e('0xd9'),_0xe60e('0xda'),_0xf94f30['basename'])};return _0x3b847f;});if(!_0x365983[_0xe60e('0xdb')]){return db[_0xe60e('0xdc')]['transaction'](function(_0x2182da){return db[_0xe60e('0xdd')][_0xe60e('0xde')](_0x22c32a,{'transaction':_0x2182da});});}}})[_0xe60e('0x17')](function(){if(_0x3df079){_0x3cb746=_0x3df079;return db[_0xe60e('0xdf')][_0xe60e('0x5b')]({'where':{'service':!![]},'include':[{'model':db[_0xe60e('0xe0')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xe60e('0xe1')],'as':_0xe60e('0xe1'),'raw':!![]}]}]});}})[_0xe60e('0x17')](function(_0x2c3b05){if(_0x2c3b05&&_0x2c3b05[_0xe60e('0xe2')]&&_0x365983[_0xe60e('0xe3')]&&_0x365983[_0xe60e('0xe4')]){var _0x2ecfec=_0x2c3b05[_0xe60e('0xe5')]();return respondWithRpcPromise(_0xe60e('0xe6'),_0xe60e('0xe7'),{'account':_0x2ecfec,'message':{'from':util[_0xe60e('0xaf')](_0xe60e('0xe8'),_0x2c3b05['name'],_0x2c3b05[_0xe60e('0xe9')]||_0x2c3b05['Smtp']['user']),'to':_0x365983[_0xe60e('0xe4')],'subject':_0x365983[_0xe60e('0xea')],'html':_0x3cb746[_0xe60e('0x57')],'attachments':_0x46bce4}},client9003)[_0xe60e('0x17')](function(){return _0x3cb746;})[_0xe60e('0x21')](function(_0xfc95d5){logger[_0xe60e('0x1d')](_0xfc95d5);});}})[_0xe60e('0x17')](function(){if(_0x365983&&_0x365983['openNewInteraction']&&_0x365983[_0xe60e('0xeb')]){var _0x448e29=[];if(_0x1ac02e['length']){_0x448e29=_0x1ac02e[_0xe60e('0x37')](function(_0x2eb0fa){return{'name':_0x2eb0fa['originalname'],'basename':_0x2eb0fa[_0xe60e('0x6b')],'type':_0x2eb0fa[_0xe60e('0xec')],'ChatOfflineMessageId':_0x3df079['id']};});}var _0x27bfb4;if(!_['isNil'](_0x365983[_0xe60e('0xed')])){var _0x262522=_[_0xe60e('0x37')](_0x2c7dc2[_0xe60e('0x57')],function(_0x28f0a8){return _0x28f0a8;});var _0x296129=_[_0xe60e('0xee')](_0x262522)[0x0];var _0xbf943f=_[_0xe60e('0xef')](_0x296129,function(_0x147116){return _0x147116;});_0x27bfb4=_0xbf943f[0x1][_0x365983[_0xe60e('0xed')]];}var _0x4d775e={'from':_0x4fdbe1['email'],'firstName':_0x4fdbe1[_0xe60e('0xaa')],'lastName':_0x4fdbe1['lastName'],'mapKey':_0xe60e('0xe9'),'message':{'from':_0x4fdbe1[_0xe60e('0xe9')],'to':_0x365983[_0xe60e('0xdf')]['email'],'cc':'','subject':_[_0xe60e('0x76')](_0x27bfb4)?_0x365983[_0xe60e('0xea')]:_0x27bfb4,'messageId':'','sentAt':new Date(),'attach':_0x448e29[_0xe60e('0x44')],'attachments':_0x448e29,'originChannel':_0xe60e('0xf0'),'ChatWebsiteId':_0x365983['id'],'ChatOfflineMessageId':_0x3cb746['id'],'originTo':_0x365983[_0xe60e('0xdf')][_0xe60e('0xe9')]},'body':_0x3cb746['body']};var _0x5b96a9={'account':{'id':_0x365983[_0xe60e('0xeb')]},'body':_0x4d775e,'log':_0xe60e('0xf1')};return respondWithRpcPromise(_0xe60e('0xf1'),_0xe60e('0xf2'),_0x5b96a9,client9001)['then'](function(){return _0x3cb746;})[_0xe60e('0x21')](function(_0x3b5f09){logger[_0xe60e('0x1d')](_0x3b5f09);});}return;})[_0xe60e('0x17')](function(){if(_0x3cb746){return _0x3cb746;}})[_0xe60e('0x17')](respondWithResult(_0x819d95,null))[_0xe60e('0x21')](function(_0x49b779){logger[_0xe60e('0x1d')](_0xe60e('0x21'),_0x49b779);for(var _0x4ef217 of _0x1ac02e){var _0x3234fa=path[_0xe60e('0x77')](config[_0xe60e('0x78')],'server',_0xe60e('0xcd'),_0xe60e('0xd9'),'offline-chat',_0x4ef217[_0xe60e('0x6b')]);fs_extra[_0xe60e('0xf3')](_0x3234fa)[_0xe60e('0x21')](function(_0x1ac4cf){logger[_0xe60e('0x1d')](_0xe60e('0xf4'),_0x3234fa,_0x1ac4cf);});}});};exports[_0xe60e('0xf5')]=function(_0x56f1c5,_0x467b54){return db['ChatInteraction'][_0xe60e('0x4f')]({'where':{'id':_0x56f1c5[_0xe60e('0x4e')]['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0x467b54,null))['then'](function(_0x39a6c0){if(_0x39a6c0){return _0x39a6c0[_0xe60e('0xf5')](_0x56f1c5[_0xe60e('0x57')][_0xe60e('0x62')],_[_0xe60e('0xf6')](_0x56f1c5['body'],[_0xe60e('0x62'),'id'])||{});}})[_0xe60e('0x17')](respondWithResult(_0x467b54,null))['catch'](handleError(_0x467b54,null));};exports[_0xe60e('0xf7')]=function(_0x21b394,_0x49de66){var _0x8a5308={'raw':![],'where':{}};var _0xc5010c={};var _0x5429d2={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe60e('0x5b')]({'where':{'id':_0x21b394[_0xe60e('0x4e')]['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0x49de66,null))[_0xe60e('0x17')](function(_0x42e37c){if(_0x42e37c){_0xc5010c[_0xe60e('0x3d')]=_[_0xe60e('0x3e')](db[_0xe60e('0xb8')][_0xe60e('0x39')]);_0xc5010c[_0xe60e('0x3f')]=_[_0xe60e('0x3e')](_0x21b394[_0xe60e('0x3f')]);_0xc5010c['filters']=_[_0xe60e('0x41')](_0xc5010c['model'],_0xc5010c['query']);_0x8a5308[_0xe60e('0x42')]=_['intersection'](_0xc5010c[_0xe60e('0x3d')],qs[_0xe60e('0x43')](_0x21b394['query']['fields']));_0x8a5308[_0xe60e('0x42')]=_0x8a5308['attributes'][_0xe60e('0x44')]?_0x8a5308['attributes']:_0xc5010c[_0xe60e('0x3d')];if(!_0x21b394['query'][_0xe60e('0x5d')]('nolimit')){_0x8a5308['limit']=qs[_0xe60e('0x28')](_0x21b394['query'][_0xe60e('0x28')]);_0x8a5308[_0xe60e('0x26')]=qs[_0xe60e('0x26')](_0x21b394['query'][_0xe60e('0x26')]);}_0x8a5308[_0xe60e('0x5f')]=qs[_0xe60e('0x45')](_0x21b394[_0xe60e('0x3f')][_0xe60e('0x45')]);_0x8a5308[_0xe60e('0x49')]=qs[_0xe60e('0x40')](_[_0xe60e('0x46')](_0x21b394['query'],_0xc5010c[_0xe60e('0x40')]));_0x8a5308[_0xe60e('0x49')][_0xe60e('0x64')]=_0x42e37c['id'];if(_0x21b394['query'][_0xe60e('0x47')]){_0x8a5308[_0xe60e('0x49')]=_[_0xe60e('0x48')](_0x8a5308[_0xe60e('0x49')],{'$or':_['map'](_0x8a5308['attributes'],function(_0x446107){var _0x5464e1={};_0x5464e1[_0x446107]={'$like':'%'+_0x21b394[_0xe60e('0x3f')][_0xe60e('0x47')]+'%'};return _0x5464e1;})});}_0x8a5308=_[_0xe60e('0x48')]({},_0x8a5308,_0x21b394[_0xe60e('0x4a')]);return db['ChatInteraction']['count']({'where':_0x8a5308['where']})[_0xe60e('0x17')](function(_0x278ade){_0x5429d2[_0xe60e('0x29')]=_0x278ade;if(_0x21b394[_0xe60e('0x3f')][_0xe60e('0x60')]){_0x8a5308[_0xe60e('0x4b')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xe60e('0xf8')],'as':_0xe60e('0xf9'),'attributes':[_0xe60e('0x32'),_0xe60e('0xfa'),_0xe60e('0xfb')],'required':![]},{'model':db[_0xe60e('0xfc')],'as':'Tags','attributes':['id','name','color'],'where':_0x21b394['query'][_0xe60e('0xfd')]?{'id':_0x21b394[_0xe60e('0x3f')][_0xe60e('0xfd')]}:undefined,'required':_0x21b394[_0xe60e('0x3f')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0xe60e('0x68')](_0x8a5308);})['then'](function(_0x554f41){_0x5429d2[_0xe60e('0x4c')]=_0x554f41;return _0x5429d2;});}})['then'](respondWithFilteredResult(_0x49de66,_0x8a5308))[_0xe60e('0x21')](handleError(_0x49de66,null));};function iftimePromise(_0x4d2e96,_0x598c1e){return respondWithRpcPromise(_0xe60e('0xfe'),_0xe60e('0xff'),{'command':_0x598c1e[_0xe60e('0x100')]?util[_0xe60e('0xaf')]('iftime\x20%s,%s',_0x4d2e96['interval'],_0x598c1e[_0xe60e('0x100')]):util[_0xe60e('0xaf')]('iftime\x20%s',_0x4d2e96[_0xe60e('0x101')])},client9002)['then'](function(_0x343af9){var _0x56081d=_0x343af9&&_0x343af9['indexOf'](_0xe60e('0x102'))>=0x0?!![]:![];logger[_0xe60e('0x18')](_0xe60e('0x103'),_0x598c1e['id'],_0x4d2e96['id'],_0x4d2e96[_0xe60e('0x101')],_0x56081d?_0xe60e('0x104'):_0xe60e('0x105'),_0x598c1e['timezone']?_0x598c1e[_0xe60e('0x100')]:_0xe60e('0x106'));return _0x56081d;})[_0xe60e('0x21')](function(_0x9fb8e5){logger[_0xe60e('0x1d')](_0xe60e('0x103'),_0x598c1e['id'],_0x4d2e96['id'],_0x4d2e96['interval'],util[_0xe60e('0x107')](_0x9fb8e5,{'showHidden':![],'depth':null}),_0x598c1e['timezone']?_0x598c1e['timezone']:_0xe60e('0x106'));return![];});}exports[_0xe60e('0xff')]=function(_0x3e959d,_0x4e910a){var _0x52d727=0x0;var _0x42e0d3=0x0;var _0x4ac6bc=![];var _0x4a679d;var _0x58ba82;return db[_0xe60e('0x38')][_0xe60e('0x4f')]({'where':{'id':_0x3e959d['params']['id']},'include':[{'model':db[_0xe60e('0x108')],'as':_0xe60e('0x108'),'include':[{'model':db[_0xe60e('0x108')],'as':'Intervals','attributes':['id',_0xe60e('0x101')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x4e910a,null))[_0xe60e('0x17')](function(_0x135fa9){if(_0x135fa9){_0x4a679d=_0x135fa9;return _0x135fa9[_0xe60e('0x109')]({'raw':!![]});}})[_0xe60e('0x17')](function(_0x157a19){if(_0x4a679d){if(_0x157a19){_0x58ba82=_0x157a19;}}return require(_0xe60e('0x10a'))[_0xe60e('0x74')]();})[_0xe60e('0x17')](function(_0x582891){if(_0x582891){_0x42e0d3=_0x582891[_0xe60e('0x10b')];_0x4ac6bc=_0x582891[_0xe60e('0x75')];}})[_0xe60e('0x17')](function(){return db[_0xe60e('0xb8')][_0xe60e('0x29')]({'where':{'closed':![]}});})['then'](function(_0x33f935){_0x52d727=_0x33f935;if(_0x42e0d3&&_0x33f935>_0x42e0d3){return db[_0xe60e('0x10c')][_0xe60e('0x5b')]({'where':{'id':0x1}})[_0xe60e('0x17')](function(_0x87cc86){if(_0x87cc86){_0x87cc86[_0xe60e('0x10d')]('chatLicenseExceeded');}});}})[_0xe60e('0x17')](function(){if(_0x4a679d[_0xe60e('0x108')]&&_0x4a679d[_0xe60e('0x108')][_0xe60e('0x10e')]){var _0x12afbf=[];for(var _0x58d2a4=0x0;_0x58d2a4<_0x4a679d[_0xe60e('0x108')][_0xe60e('0x10e')]['length'];_0x58d2a4++){var _0x3cf4ac=_0x4a679d[_0xe60e('0x108')]['Intervals'][_0x58d2a4][_0xe60e('0x2e')]({'plain':!![]});_0x12afbf[_0xe60e('0x10f')](iftimePromise(_0x3cf4ac,_0x4a679d));}return BPromise[_0xe60e('0x110')](_0x12afbf)['then'](function(_0x238167){return _[_0xe60e('0x111')](_0x238167);});}else{return!![];}})[_0xe60e('0x17')](function(_0x61ed2e){var _0x497c6a=fs['readFileSync'](path[_0xe60e('0x77')](config[_0xe60e('0x78')],_0xe60e('0x112')),_0xe60e('0x113'));var _0x18f264=new url[(_0xe60e('0x114'))](_0x4a679d[_0xe60e('0x115')])[_0xe60e('0x116')];var _0x48aad4=_0xe60e('0x117');var _0x4c76c5=![];var _0x46f0b6={'chatVersion':_0x48aad4,'chatWebsiteAddressOrigin':_0x18f264,'remote':_0x4a679d['remote'],'query':querystring['stringify'](_[_0xe60e('0x48')](_0x4a679d[_0xe60e('0x2e')]({'plain':!![]}),{'customerIp':_0x3e959d[_0xe60e('0x87')][_0xe60e('0xa9')]||_0x3e959d[_0xe60e('0x87')][_0xe60e('0x118')]||_0x3e959d[_0xe60e('0x119')]['remoteAddress']||_0x3e959d['ip'],'referer':_0x3e959d[_0xe60e('0x87')][_0xe60e('0xad')],'openedInteractions':_0x52d727,'maxInteractions':_0x42e0d3,'virtual':_0x4ac6bc[_0xe60e('0x10b')],'online':_0x61ed2e,'custom':_0x4ac6bc}))['replace'](/'/g,'\x5c\x27')};_0x4e910a['send'](ejs[_0xe60e('0xd3')](Mustache[_0xe60e('0xd3')](_0x497c6a,_0x46f0b6),{'proactiveActions':_0x58ba82,'alignment':_0x4a679d['alignment'],'verticalAlignment':_0x4a679d[_0xe60e('0x11a')],'div_color':_0x4a679d['color'],'labelText':_0x4a679d[_0xe60e('0x11b')],'text_color':_0x4a679d[_0xe60e('0x11c')],'text_button_color':_0x4a679d[_0xe60e('0x11d')],'button_color':_0x4a679d[_0xe60e('0x11e')],'background_color':_0x4a679d[_0xe60e('0x11f')],'hideWhenOffline':_0x4a679d[_0xe60e('0x120')],'intervalId':_0x4a679d[_0xe60e('0x121')],'isDevelopment':_0x4c76c5,'chatVersion':_0x48aad4}));})[_0xe60e('0x21')](handleError(_0x4e910a,null));};exports[_0xe60e('0x122')]=function(_0x531aef,_0x48d5b7){var _0x327d59=_0x531aef[_0xe60e('0x4e')]['id'];var _0x368e42=_0x531aef[_0xe60e('0x57')];var _0x49cef2=0xc8;var _0x3061e2=null;return db['sequelize'][_0xe60e('0x123')]({'isolationLevel':db[_0xe60e('0xdc')][_0xe60e('0x124')][_0xe60e('0x125')][_0xe60e('0x126')]},function(_0x148770){return db['ChatWebsite'][_0xe60e('0x5b')]({'where':{'id':_0x327d59},'transaction':_0x148770})[_0xe60e('0x17')](function(_0x5006b6){if(_0x5006b6){return db[_0xe60e('0x9d')][_0xe60e('0x2d')]({'where':{'ChatWebsiteId':_0x327d59},'transaction':_0x148770})[_0xe60e('0x17')](function(){var _0x5f4ea2=_['map'](_0x368e42,function(_0x446a48){_0x446a48['ChatWebsiteId']=_0x327d59;return _0x446a48;});return db[_0xe60e('0x9d')][_0xe60e('0xde')](_0x5f4ea2,{'transaction':_0x148770});});}else{_0x49cef2=0x194;_0x3061e2=[];}});})[_0xe60e('0x17')](function(){if(_0x49cef2!==0x194){return db[_0xe60e('0x9d')][_0xe60e('0x127')]({'where':{'ChatWebsiteId':_0x327d59},'order':_0xe60e('0xa3')})[_0xe60e('0x17')](function(_0x268c1d){_0x3061e2=_0x268c1d;});}})['catch'](function(_0x3c3ef2){_0x49cef2=0x1f4;logger['error'](_0x3c3ef2[_0xe60e('0x31')]);if(_0x3c3ef2[_0xe60e('0x32')]){delete _0x3c3ef2[_0xe60e('0x32')];}_0x3061e2=_0x3c3ef2;})[_0xe60e('0x128')](function(){if(_0x3061e2===null){_0x48d5b7[_0xe60e('0x22')](_0x49cef2);}else{if(_0x49cef2===0x1f4){_0x48d5b7[_0xe60e('0x23')](_0x49cef2)[_0xe60e('0x33')](_0x3061e2);}else{_0x48d5b7[_0xe60e('0x23')](_0x49cef2)['json'](_0x3061e2);}}});};exports[_0xe60e('0x129')]=function(_0x5d41a7,_0x8ea3e1){var _0x557619={};var _0x536366={};var _0x441410;var _0xcf0cf;return db[_0xe60e('0x38')]['findOne']({'where':{'id':_0x5d41a7[_0xe60e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x8ea3e1,null))['then'](function(_0x52bec3){if(_0x52bec3){_0x441410=_0x52bec3;_0x536366[_0xe60e('0x3d')]=_[_0xe60e('0x3e')](db[_0xe60e('0x9d')][_0xe60e('0x39')]);_0x536366['query']=_[_0xe60e('0x3e')](_0x5d41a7['query']);_0x536366[_0xe60e('0x40')]=_['intersection'](_0x536366[_0xe60e('0x3d')],_0x536366['query']);_0x557619['attributes']=_[_0xe60e('0x41')](_0x536366['model'],qs[_0xe60e('0x43')](_0x5d41a7[_0xe60e('0x3f')][_0xe60e('0x43')]));_0x557619[_0xe60e('0x42')]=_0x557619[_0xe60e('0x42')][_0xe60e('0x44')]?_0x557619[_0xe60e('0x42')]:_0x536366[_0xe60e('0x3d')];_0x557619[_0xe60e('0x5f')]=qs[_0xe60e('0x45')](_0x5d41a7[_0xe60e('0x3f')][_0xe60e('0x45')]);_0x557619[_0xe60e('0x49')]=qs[_0xe60e('0x40')](_['pick'](_0x5d41a7['query'],_0x536366['filters']));if(_0x5d41a7['query']['filter']){_0x557619[_0xe60e('0x49')]=_[_0xe60e('0x48')](_0x557619[_0xe60e('0x49')],{'$or':_['map'](_0x557619[_0xe60e('0x42')],function(_0xccaa79){var _0x18504e={};_0x18504e[_0xccaa79]={'$like':'%'+_0x5d41a7[_0xe60e('0x3f')][_0xe60e('0x47')]+'%'};return _0x18504e;})});}_0x557619=_[_0xe60e('0x48')]({},_0x557619,_0x5d41a7['options']);return _0x441410[_0xe60e('0x129')](_0x557619);}})[_0xe60e('0x17')](function(_0x1c6717){if(_0x1c6717){_0xcf0cf=_0x1c6717['length'];if(!_0x5d41a7[_0xe60e('0x3f')][_0xe60e('0x5d')](_0xe60e('0x5e'))){_0x557619['limit']=qs['limit'](_0x5d41a7[_0xe60e('0x3f')][_0xe60e('0x28')]);_0x557619[_0xe60e('0x26')]=qs[_0xe60e('0x26')](_0x5d41a7['query'][_0xe60e('0x26')]);}return _0x441410[_0xe60e('0x129')](_0x557619);}})[_0xe60e('0x17')](function(_0x4641a6){if(_0x4641a6){return _0x4641a6?{'count':_0xcf0cf,'rows':_0x4641a6}:null;}})['then'](respondWithResult(_0x8ea3e1,null))[_0xe60e('0x21')](handleError(_0x8ea3e1,null));};exports['addProactiveActions']=function(_0x59c694,_0x7515f0){return db['chatProactiveAction']['find']({'where':{'id':_0x59c694['params']['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0x7515f0,null))[_0xe60e('0x17')](function(_0x5e1d5a){if(_0x5e1d5a){return _0x5e1d5a[_0xe60e('0x12a')](_0x59c694[_0xe60e('0x57')][_0xe60e('0x62')],_['omit'](_0x59c694[_0xe60e('0x57')],[_0xe60e('0x62'),'id'])||{});}})['then'](respondWithResult(_0x7515f0,null))[_0xe60e('0x21')](handleError(_0x7515f0,null));};exports[_0xe60e('0x109')]=function(_0x53d8f5,_0x2fa917){var _0x49ca07={};var _0xee8a80={};var _0x2693f4;var _0x53682c;return db[_0xe60e('0x38')][_0xe60e('0x5b')]({'where':{'id':_0x53d8f5[_0xe60e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2fa917,null))[_0xe60e('0x17')](function(_0xbad21f){if(_0xbad21f){_0x2693f4=_0xbad21f;_0xee8a80[_0xe60e('0x3d')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0xee8a80[_0xe60e('0x3f')]=_['keys'](_0x53d8f5[_0xe60e('0x3f')]);_0xee8a80[_0xe60e('0x40')]=_[_0xe60e('0x41')](_0xee8a80['model'],_0xee8a80[_0xe60e('0x3f')]);_0x49ca07['attributes']=_[_0xe60e('0x41')](_0xee8a80['model'],qs[_0xe60e('0x43')](_0x53d8f5['query'][_0xe60e('0x43')]));_0x49ca07[_0xe60e('0x42')]=_0x49ca07[_0xe60e('0x42')][_0xe60e('0x44')]?_0x49ca07['attributes']:_0xee8a80[_0xe60e('0x3d')];_0x49ca07[_0xe60e('0x5f')]=qs['sort'](_0x53d8f5[_0xe60e('0x3f')][_0xe60e('0x45')]);_0x49ca07[_0xe60e('0x49')]=qs['filters'](_['pick'](_0x53d8f5[_0xe60e('0x3f')],_0xee8a80[_0xe60e('0x40')]));if(_0x53d8f5[_0xe60e('0x3f')][_0xe60e('0x47')]){_0x49ca07[_0xe60e('0x49')]=_[_0xe60e('0x48')](_0x49ca07[_0xe60e('0x49')],{'$or':_[_0xe60e('0x37')](_0x49ca07['attributes'],function(_0x2db7f0){var _0x1be774={};_0x1be774[_0x2db7f0]={'$like':'%'+_0x53d8f5[_0xe60e('0x3f')][_0xe60e('0x47')]+'%'};return _0x1be774;})});}_0x49ca07=_[_0xe60e('0x48')]({},_0x49ca07,_0x53d8f5[_0xe60e('0x4a')]);return _0x2693f4['getProactiveActions'](_0x49ca07);}})[_0xe60e('0x17')](function(_0x116dd4){if(_0x116dd4){_0x53682c=_0x116dd4[_0xe60e('0x44')];if(!_0x53d8f5[_0xe60e('0x3f')]['hasOwnProperty']('nolimit')){_0x49ca07[_0xe60e('0x28')]=qs[_0xe60e('0x28')](_0x53d8f5[_0xe60e('0x3f')][_0xe60e('0x28')]);_0x49ca07['offset']=qs[_0xe60e('0x26')](_0x53d8f5[_0xe60e('0x3f')]['offset']);}return _0x2693f4['getProactiveActions'](_0x49ca07);}})[_0xe60e('0x17')](function(_0xf65679){if(_0xf65679){return _0xf65679?{'count':_0x53682c,'rows':_0xf65679}:null;}})[_0xe60e('0x17')](respondWithResult(_0x2fa917,null))[_0xe60e('0x21')](handleError(_0x2fa917,null));};exports['getFields']=function(_0x3b0cac,_0x176ea4){var _0x27d17f=_0x3b0cac[_0xe60e('0x3f')]['online']===_0xe60e('0x12b')?'offlineForm':_0xe60e('0x12c');return db[_0xe60e('0x38')][_0xe60e('0x4f')]({'attributes':['id',_0x27d17f],'where':{'id':_0x3b0cac[_0xe60e('0x4e')]['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0x176ea4,null))[_0xe60e('0x17')](function(_0x316d67){if(_0x316d67){var _0x505a38=_0x316d67[_0x27d17f];var _0x2ae850=_0x505a38&&_0x505a38[_0xe60e('0x12d')]?_0x505a38[_0xe60e('0x12d')]:[];_0x176ea4[_0xe60e('0x33')]({'fromKey':_[_0xe60e('0x76')](_0x505a38[_0xe60e('0x12e')])?undefined:_0x505a38['fromKey'],'count':_0x2ae850[_0xe60e('0x44')],'rows':_0x2ae850});}})[_0xe60e('0x21')](handleError(_0x176ea4,null));};exports[_0xe60e('0x12f')]=function(_0x580da9,_0x2f850e){var _0x2205b7={'raw':![],'where':{}};var _0x518bb7={};var _0x398a08={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x580da9[_0xe60e('0x4e')]['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0x2f850e,null))[_0xe60e('0x17')](function(_0x2cdb5d){if(_0x2cdb5d){_0x518bb7[_0xe60e('0x3d')]=_[_0xe60e('0x3e')](db['ChatOfflineMessage'][_0xe60e('0x39')]);_0x518bb7[_0xe60e('0x3f')]=_[_0xe60e('0x3e')](_0x580da9[_0xe60e('0x3f')]);_0x518bb7[_0xe60e('0x40')]=_[_0xe60e('0x41')](_0x518bb7[_0xe60e('0x3d')],_0x518bb7['query']);_0x2205b7[_0xe60e('0x42')]=_[_0xe60e('0x41')](_0x518bb7[_0xe60e('0x3d')],qs[_0xe60e('0x43')](_0x580da9[_0xe60e('0x3f')][_0xe60e('0x43')]));_0x2205b7[_0xe60e('0x42')]=_0x2205b7[_0xe60e('0x42')]['length']?_0x2205b7[_0xe60e('0x42')]:_0x518bb7[_0xe60e('0x3d')];if(!_0x580da9['query']['hasOwnProperty'](_0xe60e('0x5e'))){_0x2205b7[_0xe60e('0x28')]=qs[_0xe60e('0x28')](_0x580da9[_0xe60e('0x3f')][_0xe60e('0x28')]);_0x2205b7[_0xe60e('0x26')]=qs[_0xe60e('0x26')](_0x580da9[_0xe60e('0x3f')]['offset']);}_0x2205b7[_0xe60e('0x5f')]=qs[_0xe60e('0x45')](_0x580da9[_0xe60e('0x3f')]['sort']);_0x2205b7[_0xe60e('0x49')]=qs[_0xe60e('0x40')](_['pick'](_0x580da9[_0xe60e('0x3f')],_0x518bb7['filters']));_0x2205b7['where']['ChatWebsiteId']=_0x2cdb5d['id'];if(_0x580da9[_0xe60e('0x3f')][_0xe60e('0x47')]){_0x2205b7[_0xe60e('0x49')]=_['merge'](_0x2205b7[_0xe60e('0x49')],{'$or':_[_0xe60e('0x37')](_0x2205b7['attributes'],function(_0x1e45a2){var _0x3b606c={};_0x3b606c[_0x1e45a2]={'$like':'%'+_0x580da9[_0xe60e('0x3f')][_0xe60e('0x47')]+'%'};return _0x3b606c;})});}_0x2205b7=_['merge']({},_0x2205b7,_0x580da9[_0xe60e('0x4a')]);return db['ChatOfflineMessage'][_0xe60e('0x29')]({'where':_0x2205b7[_0xe60e('0x49')]})[_0xe60e('0x17')](function(_0x98a45b){_0x398a08['count']=_0x98a45b;if(_0x580da9[_0xe60e('0x3f')][_0xe60e('0x60')]){_0x2205b7[_0xe60e('0x4b')]=[{'all':!![]}];}else{_0x2205b7[_0xe60e('0x4b')]=[{'model':db[_0xe60e('0x8b')],'as':_0xe60e('0x130'),'required':![]},{'model':db['Attachment'],'as':_0xe60e('0x131'),'required':![]}];}return db[_0xe60e('0xd6')]['findAll'](_0x2205b7);})[_0xe60e('0x17')](function(_0xae743c){_0x398a08['rows']=_0xae743c;return _0x398a08;});}})[_0xe60e('0x17')](respondWithFilteredResult(_0x2f850e,_0x2205b7))[_0xe60e('0x21')](handleError(_0x2f850e,null));};exports['addAgents']=function(_0x4ca266,_0x302c3b){return db[_0xe60e('0x38')][_0xe60e('0x4f')]({'where':{'id':_0x4ca266[_0xe60e('0x4e')]['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0x302c3b,null))[_0xe60e('0x17')](function(_0x356c90){if(_0x356c90){return _0x356c90[_0xe60e('0x132')](_0x4ca266['body'][_0xe60e('0x62')],_[_0xe60e('0xf6')](_0x4ca266[_0xe60e('0x57')],[_0xe60e('0x62'),'id'])||{})['spread'](function(_0x725e3a){for(var _0x48a476=0x0;_0x48a476<_0x4ca266[_0xe60e('0x57')][_0xe60e('0x62')]['length'];_0x48a476+=0x1){socket[_0xe60e('0x133')]('userChatWebsite:save',{'UserId':Number(_0x4ca266[_0xe60e('0x57')][_0xe60e('0x62')][_0x48a476]),'ChatWebsiteId':Number(_0x4ca266['params']['id'])});}return _0x725e3a;});}})[_0xe60e('0x17')](respondWithResult(_0x302c3b,null))[_0xe60e('0x21')](handleError(_0x302c3b,null));};exports[_0xe60e('0x134')]=function(_0x1b667f,_0x17c27b){return db[_0xe60e('0x38')]['find']({'where':{'id':_0x1b667f['params']['id']}})[_0xe60e('0x17')](handleEntityNotFound(_0x17c27b,null))[_0xe60e('0x17')](function(_0x23350d){if(_0x23350d){return _0x23350d[_0xe60e('0x134')](_0x1b667f[_0xe60e('0x3f')]['ids'])[_0xe60e('0x17')](function(){if(_[_0xe60e('0x135')](_0x1b667f[_0xe60e('0x3f')][_0xe60e('0x62')])){for(var _0xabb30d=0x0;_0xabb30d<_0x1b667f[_0xe60e('0x3f')]['ids']['length'];_0xabb30d+=0x1){socket['emit'](_0xe60e('0x136'),{'UserId':Number(_0x1b667f['query'][_0xe60e('0x62')][_0xabb30d]),'ChatWebsiteId':Number(_0x1b667f['params']['id'])});}}else{socket[_0xe60e('0x133')](_0xe60e('0x136'),{'UserId':Number(_0x1b667f['query'][_0xe60e('0x62')]),'ChatWebsiteId':Number(_0x1b667f[_0xe60e('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x17c27b,null))[_0xe60e('0x21')](handleError(_0x17c27b,null));};exports[_0xe60e('0x137')]=function(_0x175950,_0x514506){var _0x271bda={};var _0x192ba7={};var _0x3d3607;var _0x2a4851;return db['ChatWebsite'][_0xe60e('0x5b')]({'where':{'id':_0x175950[_0xe60e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x514506,null))[_0xe60e('0x17')](function(_0x25a3ff){if(_0x25a3ff){_0x3d3607=_0x25a3ff;_0x192ba7[_0xe60e('0x3d')]=_[_0xe60e('0x3e')](db['User']['rawAttributes']);_0x192ba7[_0xe60e('0x3f')]=_[_0xe60e('0x3e')](_0x175950[_0xe60e('0x3f')]);_0x192ba7[_0xe60e('0x40')]=_[_0xe60e('0x41')](_0x192ba7['model'],_0x192ba7['query']);_0x271bda['attributes']=_[_0xe60e('0x41')](_0x192ba7[_0xe60e('0x3d')],qs[_0xe60e('0x43')](_0x175950[_0xe60e('0x3f')][_0xe60e('0x43')]));_0x271bda[_0xe60e('0x42')]=_0x271bda['attributes']['length']?_0x271bda[_0xe60e('0x42')]:_0x192ba7['model'];_0x271bda[_0xe60e('0x5f')]=qs['sort'](_0x175950[_0xe60e('0x3f')][_0xe60e('0x45')]);_0x271bda['where']=qs['filters'](_['pick'](_0x175950[_0xe60e('0x3f')],_0x192ba7[_0xe60e('0x40')]));if(_0x175950[_0xe60e('0x3f')][_0xe60e('0x47')]){_0x271bda[_0xe60e('0x49')]=_[_0xe60e('0x48')](_0x271bda[_0xe60e('0x49')],{'$or':_[_0xe60e('0x37')](_0x271bda[_0xe60e('0x42')],function(_0x39825b){var _0x4acdce={};_0x4acdce[_0x39825b]={'$like':'%'+_0x175950[_0xe60e('0x3f')][_0xe60e('0x47')]+'%'};return _0x4acdce;})});}_0x271bda=_[_0xe60e('0x48')]({},_0x271bda,_0x175950['options']);return _0x3d3607['getAgents'](_0x271bda);}})['then'](function(_0x297481){if(_0x297481){_0x2a4851=_0x297481[_0xe60e('0x44')];if(!_0x175950[_0xe60e('0x3f')][_0xe60e('0x5d')](_0xe60e('0x5e'))){_0x271bda[_0xe60e('0x28')]=qs[_0xe60e('0x28')](_0x175950[_0xe60e('0x3f')]['limit']);_0x271bda[_0xe60e('0x26')]=qs[_0xe60e('0x26')](_0x175950[_0xe60e('0x3f')][_0xe60e('0x26')]);}return _0x3d3607['getAgents'](_0x271bda);}})[_0xe60e('0x17')](function(_0x1f628e){if(_0x1f628e){return _0x1f628e?{'count':_0x2a4851,'rows':_0x1f628e}:null;}})[_0xe60e('0x17')](respondWithResult(_0x514506,null))[_0xe60e('0x21')](handleError(_0x514506,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 0d8d798..09fa221 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 _0x4fde=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update'];(function(_0x4217e5,_0x4b69e6){var _0xb02bc5=function(_0x234090){while(--_0x234090){_0x4217e5['push'](_0x4217e5['shift']());}};_0xb02bc5(++_0x4b69e6);}(_0x4fde,0x19f));var _0xe4fd=function(_0x593d89,_0x45145f){_0x593d89=_0x593d89-0x0;var _0x4aa403=_0x4fde[_0x593d89];return _0x4aa403;};'use strict';var EventEmitter=require(_0xe4fd('0x0'));var ChatWebsite=require(_0xe4fd('0x1'))['db'][_0xe4fd('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe4fd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe4fd('0x4'),'afterDestroy':_0xe4fd('0x5')};function emitEvent(_0x4bf61e){return function(_0x36d49f,_0x3c4c49,_0x8b810a){ChatWebsiteEvents[_0xe4fd('0x6')](_0x4bf61e+':'+_0x36d49f['id'],_0x36d49f);ChatWebsiteEvents[_0xe4fd('0x6')](_0x4bf61e,_0x36d49f);_0x8b810a(null);};}for(var e in events){if(events[_0xe4fd('0x7')](e)){var event=events[e];ChatWebsite[_0xe4fd('0x8')](e,emitEvent(event));}}module[_0xe4fd('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x9de3=['events','ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x296552,_0x19a077){var _0x415b90=function(_0x5211d5){while(--_0x5211d5){_0x296552['push'](_0x296552['shift']());}};_0x415b90(++_0x19a077);}(_0x9de3,0xea));var _0x39de=function(_0x24d3e8,_0x2d93b7){_0x24d3e8=_0x24d3e8-0x0;var _0x5c5e3c=_0x9de3[_0x24d3e8];return _0x5c5e3c;};'use strict';var EventEmitter=require(_0x39de('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x39de('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x39de('0x2')](0x0);var events={'afterCreate':_0x39de('0x3'),'afterUpdate':'update','afterDestroy':_0x39de('0x4')};function emitEvent(_0x515fba){return function(_0x1010da,_0x433e79,_0xcea98c){ChatWebsiteEvents[_0x39de('0x5')](_0x515fba+':'+_0x1010da['id'],_0x1010da);ChatWebsiteEvents['emit'](_0x515fba,_0x1010da);_0xcea98c(null);};}for(var e in events){if(events[_0x39de('0x6')](e)){var event=events[e];ChatWebsite[_0x39de('0x7')](e,emitEvent(event));}}module[_0x39de('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index fae90c9..bc182f4 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 _0x4b5e=['moment','bluebird','path','rimraf','../../config/environment','exports','ChatWebsite','lodash','util','../../config/logger','api'];(function(_0x118879,_0x4f4ee5){var _0x1eb6f6=function(_0x239b6e){while(--_0x239b6e){_0x118879['push'](_0x118879['shift']());}};_0x1eb6f6(++_0x4f4ee5);}(_0x4b5e,0x13b));var _0xe4b5=function(_0x59dcb7,_0x332ebf){_0x59dcb7=_0x59dcb7-0x0;var _0x54bc5a=_0x4b5e[_0x59dcb7];return _0x54bc5a;};'use strict';var _=require(_0xe4b5('0x0'));var util=require(_0xe4b5('0x1'));var logger=require(_0xe4b5('0x2'))(_0xe4b5('0x3'));var moment=require(_0xe4b5('0x4'));var BPromise=require(_0xe4b5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4b5('0x6'));var rimraf=require(_0xe4b5('0x7'));var config=require(_0xe4b5('0x8'));var attributes=require('./chatWebsite.attributes');module[_0xe4b5('0x9')]=function(_0xa4c8df,_0x3cc9a2){return _0xa4c8df['define'](_0xe4b5('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8cdd=['bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment'];(function(_0x162246,_0x4e5038){var _0x32ac95=function(_0x22270b){while(--_0x22270b){_0x162246['push'](_0x162246['shift']());}};_0x32ac95(++_0x4e5038);}(_0x8cdd,0xa5));var _0xd8cd=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x8cdd[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0xd8cd('0x0'));var util=require('util');var logger=require(_0xd8cd('0x1'))(_0xd8cd('0x2'));var moment=require(_0xd8cd('0x3'));var BPromise=require(_0xd8cd('0x4'));var rp=require(_0xd8cd('0x5'));var fs=require('fs');var path=require(_0xd8cd('0x6'));var rimraf=require(_0xd8cd('0x7'));var config=require('../../config/environment');var attributes=require(_0xd8cd('0x8'));module[_0xd8cd('0x9')]=function(_0x14f9f8,_0x15c5a3){return _0x14f9f8[_0xd8cd('0xa')](_0xd8cd('0xb'),attributes,{'tableName':_0xd8cd('0xc'),'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 f3045b3..4380900 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 _0xb433=['stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0xe5ad11,_0x122349){var _0x807dc2=function(_0x41002c){while(--_0x41002c){_0xe5ad11['push'](_0xe5ad11['shift']());}};_0x807dc2(++_0x122349);}(_0xb433,0x102));var _0x3b43=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0xb433[_0x249e96];return _0x17444c;};'use strict';var _=require(_0x3b43('0x0'));var util=require(_0x3b43('0x1'));var moment=require(_0x3b43('0x2'));var BPromise=require(_0x3b43('0x3'));var rs=require(_0x3b43('0x4'));var fs=require('fs');var Redis=require(_0x3b43('0x5'));var db=require(_0x3b43('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b43('0x7'));var config=require(_0x3b43('0x8'));var jayson=require(_0x3b43('0x9'));var client=jayson[_0x3b43('0xa')][_0x3b43('0xb')]({'port':0x232a});config[_0x3b43('0xc')]=_['defaults'](config[_0x3b43('0xc')],{'host':_0x3b43('0xd'),'port':0x18eb});var socket=require(_0x3b43('0xe'))(new Redis(config[_0x3b43('0xc')]));require(_0x3b43('0xf'))[_0x3b43('0x10')](socket);function respondWithRpcPromise(_0x18d240,_0x25ff93,_0x591ff5){return new BPromise(function(_0x49b0af,_0x55a46f){return client[_0x3b43('0x11')](_0x18d240,_0x591ff5)[_0x3b43('0x12')](function(_0x2e7dce){logger[_0x3b43('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x25ff93,'request\x20sent');logger[_0x3b43('0x14')](_0x3b43('0x15'),_0x25ff93,'request\x20sent',JSON[_0x3b43('0x16')](_0x2e7dce));if(_0x2e7dce[_0x3b43('0x17')]){if(_0x2e7dce['error']['code']===0x1f4){logger[_0x3b43('0x17')](_0x3b43('0x18'),_0x25ff93,_0x2e7dce[_0x3b43('0x17')][_0x3b43('0x19')]);return _0x55a46f(_0x2e7dce['error'][_0x3b43('0x19')]);}logger['error'](_0x3b43('0x18'),_0x25ff93,_0x2e7dce[_0x3b43('0x17')][_0x3b43('0x19')]);return _0x49b0af(_0x2e7dce['error'][_0x3b43('0x19')]);}else{logger[_0x3b43('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x25ff93,'request\x20sent');_0x49b0af(_0x2e7dce[_0x3b43('0x1a')][_0x3b43('0x19')]);}})[_0x3b43('0x1b')](function(_0x559e43){logger['error'](_0x3b43('0x18'),_0x25ff93,_0x559e43);_0x55a46f(_0x559e43);});});} \ No newline at end of file +var _0x7099=['../../mysqldb','../../config/logger','rpc','http','redis','defaults','localhost','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4c6fa6,_0x337f1){var _0x830f37=function(_0x52954b){while(--_0x52954b){_0x4c6fa6['push'](_0x4c6fa6['shift']());}};_0x830f37(++_0x337f1);}(_0x7099,0x1aa));var _0x9709=function(_0x3021e5,_0x571fe0){_0x3021e5=_0x3021e5-0x0;var _0x5d4529=_0x7099[_0x3021e5];return _0x5d4529;};'use strict';var _=require(_0x9709('0x0'));var util=require(_0x9709('0x1'));var moment=require(_0x9709('0x2'));var BPromise=require(_0x9709('0x3'));var rs=require(_0x9709('0x4'));var fs=require('fs');var Redis=require(_0x9709('0x5'));var db=require(_0x9709('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9709('0x7'))(_0x9709('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9709('0x9')]({'port':0x232a});config[_0x9709('0xa')]=_[_0x9709('0xb')](config['redis'],{'host':_0x9709('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9709('0xd'))[_0x9709('0xe')](socket);function respondWithRpcPromise(_0x431189,_0x579a5e,_0x31d92e){return new BPromise(function(_0x4adeb5,_0x5cdcbe){return client['request'](_0x431189,_0x31d92e)[_0x9709('0xf')](function(_0xe9432){logger[_0x9709('0x10')](_0x9709('0x11'),_0x579a5e,_0x9709('0x12'));logger['debug'](_0x9709('0x13'),_0x579a5e,_0x9709('0x12'),JSON['stringify'](_0xe9432));if(_0xe9432[_0x9709('0x14')]){if(_0xe9432[_0x9709('0x14')][_0x9709('0x15')]===0x1f4){logger[_0x9709('0x14')](_0x9709('0x11'),_0x579a5e,_0xe9432[_0x9709('0x14')]['message']);return _0x5cdcbe(_0xe9432[_0x9709('0x14')][_0x9709('0x16')]);}logger['error'](_0x9709('0x11'),_0x579a5e,_0xe9432[_0x9709('0x14')][_0x9709('0x16')]);return _0x4adeb5(_0xe9432[_0x9709('0x14')][_0x9709('0x16')]);}else{logger[_0x9709('0x10')](_0x9709('0x11'),_0x579a5e,_0x9709('0x12'));_0x4adeb5(_0xe9432[_0x9709('0x17')][_0x9709('0x16')]);}})['catch'](function(_0x2439b7){logger[_0x9709('0x14')](_0x9709('0x11'),_0x579a5e,_0x2439b7);_0x5cdcbe(_0x2439b7);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 8a3a84f..df9ab00 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 _0x305b=['removeListener','register','length','chatWebsite:','./chatWebsite.events','save','update','emit'];(function(_0xe84f0,_0x11cbb7){var _0x442ac6=function(_0x394a4a){while(--_0x394a4a){_0xe84f0['push'](_0xe84f0['shift']());}};_0x442ac6(++_0x11cbb7);}(_0x305b,0x1b4));var _0xb305=function(_0x3f00ee,_0x1d1673){_0x3f00ee=_0x3f00ee-0x0;var _0x18a07e=_0x305b[_0x3f00ee];return _0x18a07e;};'use strict';var ChatWebsiteEvents=require(_0xb305('0x0'));var events=[_0xb305('0x1'),'remove',_0xb305('0x2')];function createListener(_0x31d71e,_0x46590f){return function(_0x5c8c08){_0x46590f[_0xb305('0x3')](_0x31d71e,_0x5c8c08);};}function removeListener(_0x2e1570,_0xba812a){return function(){ChatWebsiteEvents[_0xb305('0x4')](_0x2e1570,_0xba812a);};}exports[_0xb305('0x5')]=function(_0x3ed7c2){for(var _0x3d52e7=0x0,_0x447861=events[_0xb305('0x6')];_0x3d52e7<_0x447861;_0x3d52e7++){var _0x2e579d=events[_0x3d52e7];var _0x4e00bf=createListener(_0xb305('0x7')+_0x2e579d,_0x3ed7c2);ChatWebsiteEvents['on'](_0x2e579d,_0x4e00bf);}}; \ No newline at end of file +var _0x7292=['update','emit','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x3720fa,_0x12ec40){var _0x20b212=function(_0xc71b3e){while(--_0xc71b3e){_0x3720fa['push'](_0x3720fa['shift']());}};_0x20b212(++_0x12ec40);}(_0x7292,0x1b7));var _0x2729=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x7292[_0x122096];return _0x3d1966;};'use strict';var ChatWebsiteEvents=require(_0x2729('0x0'));var events=[_0x2729('0x1'),'remove',_0x2729('0x2')];function createListener(_0x412108,_0x38a40f){return function(_0xd40e59){_0x38a40f[_0x2729('0x3')](_0x412108,_0xd40e59);};}function removeListener(_0x5b5fbb,_0x28a462){return function(){ChatWebsiteEvents['removeListener'](_0x5b5fbb,_0x28a462);};}exports[_0x2729('0x4')]=function(_0x385cc0){for(var _0x339767=0x0,_0x5a2d61=events[_0x2729('0x5')];_0x339767<_0x5a2d61;_0x339767++){var _0x2c59bd=events[_0x339767];var _0x40de28=createListener(_0x2729('0x6')+_0x2c59bd,_0x385cc0);ChatWebsiteEvents['on'](_0x2c59bd,_0x40de28);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 378d46b..3b19adc 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 _0xb12a=['join','root','server/files/images/logos/','format','%s-%s','/:id/logo','single','server/files/images/avatars/','originalname','file','addAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','now','any','offline','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/users','post','create','/:id/dispositions','addDisposition','diskStorage'];(function(_0x4b8412,_0x235b3d){var _0x1ed9ed=function(_0x455209){while(--_0x455209){_0x4b8412['push'](_0x4b8412['shift']());}};_0x1ed9ed(++_0x235b3d);}(_0xb12a,0x1bf));var _0xab12=function(_0x1bc055,_0x33b053){_0x1bc055=_0x1bc055-0x0;var _0xf0ac3d=_0xb12a[_0x1bc055];return _0xf0ac3d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xab12('0x0'));var timeout=require(_0xab12('0x1'));var express=require(_0xab12('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xab12('0x3'));var interaction=require(_0xab12('0x4'));var config=require(_0xab12('0x5'));var controller=require('./chatWebsite.controller');router[_0xab12('0x6')]('/',auth[_0xab12('0x7')](),controller[_0xab12('0x8')]);router['get'](_0xab12('0x9'),auth[_0xab12('0x7')](),controller[_0xab12('0xa')]);router[_0xab12('0x6')](_0xab12('0xb'),auth[_0xab12('0x7')](),controller[_0xab12('0xc')]);router['get']('/:id/dispositions',auth[_0xab12('0x7')](),controller[_0xab12('0xd')]);router[_0xab12('0x6')](_0xab12('0xe'),auth[_0xab12('0x7')](),controller[_0xab12('0xf')]);router['get']('/:id/logo',controller[_0xab12('0x10')]);router['get'](_0xab12('0x11'),controller[_0xab12('0x12')]);router[_0xab12('0x6')](_0xab12('0x13'),controller[_0xab12('0x14')]);router[_0xab12('0x6')](_0xab12('0x15'),controller['getSystemAvatar']);router['get'](_0xab12('0x16'),auth[_0xab12('0x7')](),controller['getInteractions']);router[_0xab12('0x6')]('/:id/snippet',controller[_0xab12('0x17')]);router[_0xab12('0x6')](_0xab12('0x18'),auth[_0xab12('0x7')](),controller[_0xab12('0x19')]);router[_0xab12('0x6')](_0xab12('0x1a'),auth['isAuthenticated'](),controller[_0xab12('0x1b')]);router[_0xab12('0x6')](_0xab12('0x1c'),controller[_0xab12('0x1d')]);router[_0xab12('0x6')]('/:id/offline_messages',auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0xab12('0x6')](_0xab12('0x1e'),auth[_0xab12('0x7')](),controller['getAgents']);router[_0xab12('0x1f')]('/',auth['isAuthenticated'](),controller[_0xab12('0x20')]);router[_0xab12('0x1f')](_0xab12('0x21'),auth[_0xab12('0x7')](),controller[_0xab12('0x22')]);router[_0xab12('0x1f')](_0xab12('0xe'),auth[_0xab12('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xab12('0x23')]({'destination':function(_0x4c3d9e,_0x3d0493,_0x4585bb){_0x4585bb(null,path[_0xab12('0x24')](config[_0xab12('0x25')],_0xab12('0x26')));},'filename':function(_0x182b29,_0x1507ee,_0x4e21b3){_0x4e21b3(null,util[_0xab12('0x27')](_0xab12('0x28'),Date['now'](),_0x1507ee['originalname']));}})});router[_0xab12('0x1f')](_0xab12('0x29'),upload[_0xab12('0x2a')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xab12('0x23')]({'destination':function(_0x2e177c,_0x34579c,_0x169b01){_0x169b01(null,path[_0xab12('0x24')](config['root'],_0xab12('0x2b')));},'filename':function(_0x159648,_0x46ba61,_0x1adb13){_0x1adb13(null,util[_0xab12('0x27')](_0xab12('0x28'),Date['now'](),_0x46ba61[_0xab12('0x2c')]));}})});router[_0xab12('0x1f')](_0xab12('0x11'),upload['single'](_0xab12('0x2d')),controller[_0xab12('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1b5622,_0x426918,_0x493657){_0x493657(null,path['join'](config[_0xab12('0x25')],_0xab12('0x2b')));},'filename':function(_0x33a005,_0x55c8ab,_0x7deedb){_0x7deedb(null,util[_0xab12('0x27')](_0xab12('0x28'),Date['now'](),_0x55c8ab[_0xab12('0x2c')]));}})});router[_0xab12('0x1f')](_0xab12('0x13'),upload[_0xab12('0x2a')](_0xab12('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xab12('0x23')]({'destination':function(_0x1453b0,_0x2c2c30,_0x50896c){_0x50896c(null,path['join'](config[_0xab12('0x25')],_0xab12('0x2b')));},'filename':function(_0x20aa63,_0x88b784,_0x4bbc3f){_0x4bbc3f(null,util['format'](_0xab12('0x28'),Date['now'](),_0x88b784['originalname']));}})});router[_0xab12('0x1f')](_0xab12('0x15'),upload[_0xab12('0x2a')](_0xab12('0x2d')),controller[_0xab12('0x2f')]);router[_0xab12('0x1f')](_0xab12('0x30'),controller[_0xab12('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0xab12('0x23')]({'destination':function(_0x910e4b,_0x37045c,_0x5f2d24){const _0x4ca2ba=path[_0xab12('0x24')](config[_0xab12('0x25')],_0xab12('0x32'),_0xab12('0x33'),_0xab12('0x34'));fs_extra['ensureDir'](_0x4ca2ba,function(){_0x5f2d24(null,_0x4ca2ba);});},'filename':function(_0x5ddd04,_0x1a8af7,_0x3f84d4){const _0x1f4421=_0x1a8af7[_0xab12('0x2c')][_0xab12('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x197052=path[_0xab12('0x36')](_0x1f4421);const _0x1d6864=Date[_0xab12('0x37')]()+'-'+_0x1f4421['replace'](_0x197052,'')+_0x197052;_0x3f84d4(null,_0x1d6864);}})});router[_0xab12('0x1f')]('/:id/offline',offlineUploadMulter[_0xab12('0x38')](),controller[_0xab12('0x39')]);router[_0xab12('0x1f')](_0xab12('0x16'),auth[_0xab12('0x7')](),controller['addInteraction']);router[_0xab12('0x1f')](_0xab12('0x18'),auth[_0xab12('0x7')](),controller[_0xab12('0x3a')]);router[_0xab12('0x1f')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xab12('0x3b')]);router['post'](_0xab12('0x1e'),auth[_0xab12('0x7')](),controller[_0xab12('0x3c')]);router[_0xab12('0x3d')](_0xab12('0xb'),auth[_0xab12('0x7')](),controller[_0xab12('0x3e')]);router['delete'](_0xab12('0xb'),auth[_0xab12('0x7')](),controller[_0xab12('0x3f')]);router[_0xab12('0x40')]('/:id/dispositions',auth[_0xab12('0x7')](),controller[_0xab12('0x41')]);router['delete'](_0xab12('0xe'),auth[_0xab12('0x7')](),controller[_0xab12('0x42')]);router[_0xab12('0x40')](_0xab12('0x1e'),auth[_0xab12('0x7')](),controller[_0xab12('0x43')]);module[_0xab12('0x44')]=router; \ No newline at end of file +var _0xfb34=['getApplications','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','getAgents','create','post','/:id/dispositions','diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','addAvatar','server/files/images/avatars/','format','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xfb34,0x154));var _0x4fb3=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xfb34[_0x32f7d7];return _0x133d09;};'use strict';var multer=require(_0x4fb3('0x0'));var util=require('util');var path=require(_0x4fb3('0x1'));var timeout=require(_0x4fb3('0x2'));var express=require(_0x4fb3('0x3'));var router=express[_0x4fb3('0x4')]();var fs_extra=require(_0x4fb3('0x5'));var auth=require(_0x4fb3('0x6'));var interaction=require(_0x4fb3('0x7'));var config=require(_0x4fb3('0x8'));var controller=require(_0x4fb3('0x9'));router[_0x4fb3('0xa')]('/',auth[_0x4fb3('0xb')](),controller['index']);router[_0x4fb3('0xa')](_0x4fb3('0xc'),auth[_0x4fb3('0xb')](),controller[_0x4fb3('0xd')]);router['get'](_0x4fb3('0xe'),auth[_0x4fb3('0xb')](),controller['show']);router[_0x4fb3('0xa')]('/:id/dispositions',auth[_0x4fb3('0xb')](),controller[_0x4fb3('0xf')]);router[_0x4fb3('0xa')](_0x4fb3('0x10'),auth[_0x4fb3('0xb')](),controller[_0x4fb3('0x11')]);router['get'](_0x4fb3('0x12'),controller[_0x4fb3('0x13')]);router[_0x4fb3('0xa')](_0x4fb3('0x14'),controller['getAvatar']);router[_0x4fb3('0xa')](_0x4fb3('0x15'),controller[_0x4fb3('0x16')]);router['get'](_0x4fb3('0x17'),controller[_0x4fb3('0x18')]);router[_0x4fb3('0xa')](_0x4fb3('0x19'),auth[_0x4fb3('0xb')](),controller[_0x4fb3('0x1a')]);router['get'](_0x4fb3('0x1b'),controller[_0x4fb3('0x1c')]);router[_0x4fb3('0xa')](_0x4fb3('0x1d'),auth[_0x4fb3('0xb')](),controller[_0x4fb3('0x1e')]);router['get']('/:id/proactive_actions',auth[_0x4fb3('0xb')](),controller[_0x4fb3('0x1f')]);router['get'](_0x4fb3('0x20'),controller['getFields']);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x4fb3('0x21')]);router[_0x4fb3('0xa')](_0x4fb3('0x22'),auth[_0x4fb3('0xb')](),controller[_0x4fb3('0x23')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4fb3('0x24')]);router[_0x4fb3('0x25')](_0x4fb3('0x26'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x4fb3('0x25')](_0x4fb3('0x10'),auth[_0x4fb3('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x4fb3('0x27')]({'destination':function(_0x5897d5,_0x30a5ce,_0x44d0c1){_0x44d0c1(null,path[_0x4fb3('0x28')](config[_0x4fb3('0x29')],_0x4fb3('0x2a')));},'filename':function(_0x43417d,_0x5f3fb1,_0x366e80){_0x366e80(null,util['format'](_0x4fb3('0x2b'),Date[_0x4fb3('0x2c')](),_0x5f3fb1[_0x4fb3('0x2d')]));}})});router[_0x4fb3('0x25')](_0x4fb3('0x12'),upload[_0x4fb3('0x2e')](_0x4fb3('0x2f')),controller[_0x4fb3('0x30')]);var upload=multer({'storage':multer[_0x4fb3('0x27')]({'destination':function(_0x232748,_0x485dbb,_0x1cbc32){_0x1cbc32(null,path[_0x4fb3('0x28')](config[_0x4fb3('0x29')],'server/files/images/avatars/'));},'filename':function(_0x21c608,_0x13276f,_0x400e20){_0x400e20(null,util['format']('%s-%s',Date[_0x4fb3('0x2c')](),_0x13276f[_0x4fb3('0x2d')]));}})});router[_0x4fb3('0x25')](_0x4fb3('0x14'),upload[_0x4fb3('0x2e')]('file'),controller[_0x4fb3('0x31')]);var upload=multer({'storage':multer[_0x4fb3('0x27')]({'destination':function(_0x1b61c6,_0x41e05b,_0x33edb4){_0x33edb4(null,path['join'](config[_0x4fb3('0x29')],_0x4fb3('0x32')));},'filename':function(_0x1e319c,_0x1b3da1,_0xf82d50){_0xf82d50(null,util[_0x4fb3('0x33')](_0x4fb3('0x2b'),Date[_0x4fb3('0x2c')](),_0x1b3da1[_0x4fb3('0x2d')]));}})});router[_0x4fb3('0x25')](_0x4fb3('0x15'),upload['single'](_0x4fb3('0x2f')),controller[_0x4fb3('0x34')]);var upload=multer({'storage':multer[_0x4fb3('0x27')]({'destination':function(_0x52aadd,_0x36495d,_0x2a9d97){_0x2a9d97(null,path['join'](config[_0x4fb3('0x29')],_0x4fb3('0x32')));},'filename':function(_0x457516,_0x170892,_0x90446f){_0x90446f(null,util[_0x4fb3('0x33')](_0x4fb3('0x2b'),Date[_0x4fb3('0x2c')](),_0x170892[_0x4fb3('0x2d')]));}})});router['post'](_0x4fb3('0x17'),upload['single'](_0x4fb3('0x2f')),controller[_0x4fb3('0x35')]);router[_0x4fb3('0x25')](_0x4fb3('0x36'),controller[_0x4fb3('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x4fb3('0x27')]({'destination':function(_0x3da300,_0x4fe944,_0x3688d6){const _0x82e22=path[_0x4fb3('0x28')](config[_0x4fb3('0x29')],_0x4fb3('0x38'),_0x4fb3('0x39'),'offline-chat');fs_extra[_0x4fb3('0x3a')](_0x82e22,function(){_0x3688d6(null,_0x82e22);});},'filename':function(_0x421c1f,_0x54813e,_0x439460){const _0x501f2f=_0x54813e['originalname'][_0x4fb3('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x394749=path[_0x4fb3('0x3c')](_0x501f2f);const _0x2c624f=Date['now']()+'-'+_0x501f2f[_0x4fb3('0x3b')](_0x394749,'')+_0x394749;_0x439460(null,_0x2c624f);}})});router[_0x4fb3('0x25')](_0x4fb3('0x3d'),offlineUploadMulter[_0x4fb3('0x3e')](),controller['offline']);router['post']('/:id/interactions',auth[_0x4fb3('0xb')](),controller[_0x4fb3('0x3f')]);router[_0x4fb3('0x25')](_0x4fb3('0x1d'),auth[_0x4fb3('0xb')](),controller[_0x4fb3('0x40')]);router[_0x4fb3('0x25')](_0x4fb3('0x41'),auth[_0x4fb3('0xb')](),controller[_0x4fb3('0x42')]);router[_0x4fb3('0x25')](_0x4fb3('0x22'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x4fb3('0xe'),auth[_0x4fb3('0xb')](),controller[_0x4fb3('0x43')]);router[_0x4fb3('0x44')](_0x4fb3('0xe'),auth[_0x4fb3('0xb')](),controller[_0x4fb3('0x45')]);router[_0x4fb3('0x44')](_0x4fb3('0x26'),auth['isAuthenticated'](),controller[_0x4fb3('0x46')]);router[_0x4fb3('0x44')](_0x4fb3('0x10'),auth[_0x4fb3('0xb')](),controller[_0x4fb3('0x47')]);router[_0x4fb3('0x44')](_0x4fb3('0x22'),auth[_0x4fb3('0xb')](),controller[_0x4fb3('0x48')]);module[_0x4fb3('0x49')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 5785b76..8ddc425 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 _0x7fac=['isAuthenticated','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','app','expressEndpoint','/client-logs','use'];(function(_0x5a18d4,_0x2c5efb){var _0x276b1d=function(_0x33b710){while(--_0x33b710){_0x5a18d4['push'](_0x5a18d4['shift']());}};_0x276b1d(++_0x2c5efb);}(_0x7fac,0x1b1));var _0xc7fa=function(_0x1895b7,_0x21fbc7){_0x1895b7=_0x1895b7-0x0;var _0x1aecdc=_0x7fac[_0x1895b7];return _0x1aecdc;};var beaverLogger=require(_0xc7fa('0x0'));var express=require(_0xc7fa('0x1'));var auth=require(_0xc7fa('0x2'));var config=require(_0xc7fa('0x3'));var router=express[_0xc7fa('0x4')]();var isProduction=config[_0xc7fa('0x5')]===_0xc7fa('0x6')||![];function clientSideLogs(_0x4b71f2,_0x388d87,_0x2afa07){var _0x4867d0=_0x4b71f2[_0xc7fa('0x7')]['get']('client-side-logger');if(!_0x4867d0){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xc7fa('0x8')]({'uri':_0xc7fa('0x9'),'logger':_0x4867d0,'enableCors':!isProduction})(_0x4b71f2,_0x388d87,_0x2afa07);}router[_0xc7fa('0xa')](auth[_0xc7fa('0xb')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x34aa=['Router','env','production','get','Client-Side\x20logger\x20not\x20found!','use','isAuthenticated','exports','beaver-logger/server','express'];(function(_0x42b534,_0x3b1ece){var _0x2ab1a3=function(_0x3d10b9){while(--_0x3d10b9){_0x42b534['push'](_0x42b534['shift']());}};_0x2ab1a3(++_0x3b1ece);}(_0x34aa,0xee));var _0xa34a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x34aa[_0xaa1b3e];return _0x454d7d;};var beaverLogger=require(_0xa34a('0x0'));var express=require(_0xa34a('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0xa34a('0x2')]();var isProduction=config[_0xa34a('0x3')]===_0xa34a('0x4')||![];function clientSideLogs(_0x55cd2c,_0x3b806a,_0x1e1264){var _0x37f719=_0x55cd2c['app'][_0xa34a('0x5')]('client-side-logger');if(!_0x37f719){throw new Error(_0xa34a('0x6'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x37f719,'enableCors':!isProduction})(_0x55cd2c,_0x3b806a,_0x1e1264);}router[_0xa34a('0x7')](auth[_0xa34a('0x8')](),clientSideLogs);module[_0xa34a('0x9')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 63aea60..b406c96 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 _0x7001=['sequelize','STRING','AmazonAWS','ENUM','Outlook365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x59080e,_0x2c3518){var _0x4f86a9=function(_0x43784a){while(--_0x43784a){_0x59080e['push'](_0x59080e['shift']());}};_0x4f86a9(++_0x2c3518);}(_0x7001,0xf2));var _0x1700=function(_0x42749b,_0x16a7ba){_0x42749b=_0x42749b-0x0;var _0x19db46=_0x7001[_0x42749b];return _0x19db46;};'use strict';var Sequelize=require(_0x1700('0x0'));module['exports']={'name':{'type':Sequelize[_0x1700('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x1700('0x2'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x1700('0x3')](_0x1700('0x4'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x1700('0x1')],'comment':_0x1700('0x5')},'data3':{'type':Sequelize['STRING'],'comment':_0x1700('0x6')},'data4':{'type':Sequelize[_0x1700('0x1')],'comment':_0x1700('0x7')},'data5':{'type':Sequelize[_0x1700('0x8')],'comment':_0x1700('0x9')},'data6':{'type':Sequelize['TEXT'],'comment':_0x1700('0xa')},'data7':{'type':Sequelize[_0x1700('0x8')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0x1302=['Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x8e2cd3,_0x34580f){var _0x431720=function(_0x5f0d32){while(--_0x5f0d32){_0x8e2cd3['push'](_0x8e2cd3['shift']());}};_0x431720(++_0x34580f);}(_0x1302,0x1b5));var _0x2130=function(_0x29ab55,_0x2f6641){_0x29ab55=_0x29ab55-0x0;var _0x18e4c1=_0x1302[_0x29ab55];return _0x18e4c1;};'use strict';var Sequelize=require(_0x2130('0x0'));module[_0x2130('0x1')]={'name':{'type':Sequelize[_0x2130('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2130('0x3')](_0x2130('0x4'),_0x2130('0x5'),_0x2130('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x2130('0x3')]('Outlook365',_0x2130('0x7'))},'data1':{'type':Sequelize[_0x2130('0x2')],'comment':_0x2130('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x2130('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x2130('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x2130('0x9')],'comment':_0x2130('0xa')},'data6':{'type':Sequelize[_0x2130('0x9')],'comment':_0x2130('0xb')},'data7':{'type':Sequelize[_0x2130('0x9')],'comment':_0x2130('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index bb3e55e..6837195 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 _0x28ec=['del','code','data5','access_token','refresh_token','data6','startRefreshInterval','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','end','status','offset','undefined','limit','count','Content-Range','json','then','destroy','sendStatus','error','stack','name','send','padEnd','index','map','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','model','order','sort','where','pick','filter','merge','VIRTUAL','CloudProvider','includeAll','include','service','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','options','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','find','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','state','base64','ascii','isValidIdToken','oauth2Claims'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x28ec,0x1d6));var _0xc28e=function(_0x1520d9,_0x492e6a){_0x1520d9=_0x1520d9-0x0;var _0x6a8a64=_0x28ec[_0x1520d9];return _0x6a8a64;};'use strict';var _=require('lodash');var Redis=require(_0xc28e('0x0'));var qs=require(_0xc28e('0x1'));var encryptor=require(_0xc28e('0x2'));var config=require(_0xc28e('0x3'));var logger=require(_0xc28e('0x4'))(_0xc28e('0x5'));var db=require(_0xc28e('0x6'))['db'];var oauth=require(_0xc28e('0x7'));config[_0xc28e('0x8')]=_[_0xc28e('0x9')](config['redis'],{'host':_0xc28e('0xa'),'port':0x18eb});var socket=require(_0xc28e('0xb'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x524a6d,_0x16d25b){_0x16d25b=_0x16d25b||0xcc;return function(_0x298366){if(_0x298366){return _0x524a6d['sendStatus'](_0x16d25b);}return _0x524a6d['status'](_0x16d25b)[_0xc28e('0xc')]();};}function respondWithResult(_0x4eb56c,_0x31509b){_0x31509b=_0x31509b||0xc8;return function(_0x2023c3){if(_0x2023c3){return _0x4eb56c[_0xc28e('0xd')](_0x31509b)['json'](_0x2023c3);}};}function respondWithFilteredResult(_0x29542d,_0x1a1834){return function(_0x1e5037){if(_0x1e5037){var _0x4841f6=typeof _0x1a1834[_0xc28e('0xe')]===_0xc28e('0xf')&&typeof _0x1a1834[_0xc28e('0x10')]==='undefined';var _0x1daf99=_0x1e5037['count'];var _0x2311b2=_0x4841f6?0x0:_0x1a1834[_0xc28e('0xe')];var _0x2e2828=_0x4841f6?_0x1e5037[_0xc28e('0x11')]:_0x1a1834['offset']+_0x1a1834[_0xc28e('0x10')];var _0x975f17;if(_0x2e2828>=_0x1daf99){_0x2e2828=_0x1daf99;_0x975f17=0xc8;}else{_0x975f17=0xce;}_0x29542d[_0xc28e('0xd')](_0x975f17);return _0x29542d['set'](_0xc28e('0x12'),_0x2311b2+'-'+_0x2e2828+'/'+_0x1daf99)[_0xc28e('0x13')](_0x1e5037);}return null;};}function saveUpdates(_0x540033){return function(_0x553394){if(_0x553394){return _0x553394['update'](_0x540033)[_0xc28e('0x14')](function(_0x53dc83){return _0x53dc83;});}return null;};}function removeEntity(_0x2cf915){return function(_0x4d4568){if(_0x4d4568){return _0x4d4568[_0xc28e('0x15')]()['then'](function(){_0x2cf915[_0xc28e('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a3d1b){return function(_0x303387){if(!_0x303387){_0x1a3d1b[_0xc28e('0x16')](0x194);}return _0x303387;};}function handleError(_0x2a210d,_0x4261ed){_0x4261ed=_0x4261ed||0x1f4;return function(_0x231372){logger[_0xc28e('0x17')](_0x231372[_0xc28e('0x18')]);if(_0x231372[_0xc28e('0x19')]){delete _0x231372[_0xc28e('0x19')];}_0x2a210d[_0xc28e('0xd')](_0x4261ed)[_0xc28e('0x1a')](_0x231372);};}function maskClientSecret(_0x5f3850){return _[_0xc28e('0x1b')](_0x5f3850['slice'](0x0,0x3),0x14,'*');}exports[_0xc28e('0x1c')]=function(_0xbeef25,_0x183dbd){var _0x2c251c={},_0x155245={},_0x1bd4ae={'count':0x0,'rows':[]};var _0x547770=_[_0xc28e('0x1d')](db['CloudProvider']['rawAttributes'],function(_0x1c6f96){return{'name':_0x1c6f96[_0xc28e('0x1e')],'type':_0x1c6f96[_0xc28e('0x1f')][_0xc28e('0x20')]};});_0x155245['model']=_[_0xc28e('0x1d')](_0x547770,_0xc28e('0x19'));_0x155245[_0xc28e('0x21')]=_[_0xc28e('0x22')](_0xbeef25['query']);_0x155245[_0xc28e('0x23')]=_[_0xc28e('0x24')](_0x155245['model'],_0x155245[_0xc28e('0x21')]);_0x2c251c['attributes']=_[_0xc28e('0x24')](_0x155245['model'],qs[_0xc28e('0x25')](_0xbeef25[_0xc28e('0x21')][_0xc28e('0x25')]));_0x2c251c[_0xc28e('0x26')]=_0x2c251c[_0xc28e('0x26')][_0xc28e('0x27')]?_0x2c251c[_0xc28e('0x26')]:_0x155245[_0xc28e('0x28')];if(!_0xbeef25[_0xc28e('0x21')]['hasOwnProperty']('nolimit')){_0x2c251c[_0xc28e('0x10')]=qs[_0xc28e('0x10')](_0xbeef25['query']['limit']);_0x2c251c[_0xc28e('0xe')]=qs[_0xc28e('0xe')](_0xbeef25[_0xc28e('0x21')][_0xc28e('0xe')]);}_0x2c251c[_0xc28e('0x29')]=qs[_0xc28e('0x2a')](_0xbeef25[_0xc28e('0x21')][_0xc28e('0x2a')]);_0x2c251c[_0xc28e('0x2b')]=qs[_0xc28e('0x23')](_[_0xc28e('0x2c')](_0xbeef25[_0xc28e('0x21')],_0x155245[_0xc28e('0x23')]),_0x547770);if(_0xbeef25[_0xc28e('0x21')][_0xc28e('0x2d')]){_0x2c251c[_0xc28e('0x2b')]=_[_0xc28e('0x2e')](_0x2c251c[_0xc28e('0x2b')],{'$or':_[_0xc28e('0x1d')](_0x547770,function(_0x3c953){if(_0x3c953[_0xc28e('0x1f')]!==_0xc28e('0x2f')){var _0x3d2f91={};_0x3d2f91[_0x3c953[_0xc28e('0x19')]]={'$like':'%'+_0xbeef25[_0xc28e('0x21')][_0xc28e('0x2d')]+'%'};return _0x3d2f91;}})});}_0x2c251c=_[_0xc28e('0x2e')]({},_0x2c251c,_0xbeef25['options']);var _0x26f008={'where':_0x2c251c[_0xc28e('0x2b')]};return db[_0xc28e('0x30')][_0xc28e('0x11')](_0x26f008)[_0xc28e('0x14')](function(_0x1d43c6){_0x1bd4ae[_0xc28e('0x11')]=_0x1d43c6;if(_0xbeef25[_0xc28e('0x21')][_0xc28e('0x31')]){_0x2c251c[_0xc28e('0x32')]=[{'all':!![]}];}return db[_0xc28e('0x30')]['findAll'](_0x2c251c);})[_0xc28e('0x14')](function(_0x2e9317){_0x1bd4ae['rows']=_[_0xc28e('0x1d')](_0x2e9317,function(_0x5e5fec){if(_0x5e5fec[_0xc28e('0x33')]===_0xc28e('0x34')){var _0x1480ad=encryptor[_0xc28e('0x35')](_0x5e5fec[_0xc28e('0x36')]);_0x5e5fec[_0xc28e('0x36')]=maskClientSecret(_0x1480ad);}return _0x5e5fec;});return _0x1bd4ae;})[_0xc28e('0x14')](respondWithFilteredResult(_0x183dbd,_0x2c251c))[_0xc28e('0x37')](handleError(_0x183dbd,null));};exports[_0xc28e('0x38')]=function(_0x49f3c3,_0xaf2e74){var _0x4b52cd={'raw':!![],'where':{'id':_0x49f3c3[_0xc28e('0x39')]['id']}},_0x37bb31={};_0x37bb31['model']=_['keys'](db[_0xc28e('0x30')][_0xc28e('0x3a')]);_0x37bb31['query']=_['keys'](_0x49f3c3[_0xc28e('0x21')]);_0x37bb31['filters']=_['intersection'](_0x37bb31[_0xc28e('0x28')],_0x37bb31['query']);_0x4b52cd[_0xc28e('0x26')]=_['intersection'](_0x37bb31['model'],qs[_0xc28e('0x25')](_0x49f3c3[_0xc28e('0x21')][_0xc28e('0x25')]));_0x4b52cd[_0xc28e('0x26')]=_0x4b52cd['attributes'][_0xc28e('0x27')]?_0x4b52cd[_0xc28e('0x26')]:_0x37bb31[_0xc28e('0x28')];if(_0x49f3c3[_0xc28e('0x21')][_0xc28e('0x31')]){_0x4b52cd[_0xc28e('0x32')]=[{'all':!![]}];}_0x4b52cd=_['merge']({},_0x4b52cd,_0x49f3c3[_0xc28e('0x3b')]);return db[_0xc28e('0x30')]['find'](_0x4b52cd)[_0xc28e('0x14')](handleEntityNotFound(_0xaf2e74,null))[_0xc28e('0x14')](function(_0x6d2a4e){if(_0x6d2a4e['service']==='MicrosoftAzure'){var _0x11aa2f=encryptor[_0xc28e('0x35')](_0x6d2a4e[_0xc28e('0x36')]);_0x6d2a4e[_0xc28e('0x36')]=maskClientSecret(_0x11aa2f);}return _0x6d2a4e;})['then'](respondWithResult(_0xaf2e74,null))[_0xc28e('0x37')](handleError(_0xaf2e74,null));};exports[_0xc28e('0x3c')]=function(_0x2e632a,_0x8d9729){if(!_0x2e632a[_0xc28e('0x3d')][_0xc28e('0x19')])throw new Error(_0xc28e('0x3e'));if(!_0x2e632a[_0xc28e('0x3d')]['service'])throw new Error(_0xc28e('0x3f'));var _0x5ca577=db[_0xc28e('0x30')][_0xc28e('0x3a')][_0xc28e('0x33')][_0xc28e('0x40')];if(!_0x5ca577[_0xc28e('0x41')](_0x2e632a[_0xc28e('0x3d')][_0xc28e('0x33')]))throw new Error(_0xc28e('0x42')+_0x5ca577[_0xc28e('0x43')](',\x20'));if(_0x2e632a[_0xc28e('0x3d')][_0xc28e('0x33')]===_0xc28e('0x34')&&_0x2e632a['body'][_0xc28e('0x36')]){_0x2e632a[_0xc28e('0x3d')][_0xc28e('0x36')]=encryptor[_0xc28e('0x44')](_0x2e632a[_0xc28e('0x3d')][_0xc28e('0x36')]);}return db['CloudProvider'][_0xc28e('0x3c')](_0x2e632a[_0xc28e('0x3d')],{})[_0xc28e('0x14')](respondWithResult(_0x8d9729,0xc9))['catch'](handleError(_0x8d9729,null));};exports[_0xc28e('0x45')]=function(_0x449a9f,_0x56c157){if(_0x449a9f[_0xc28e('0x3d')]['id']){delete _0x449a9f[_0xc28e('0x3d')]['id'];}return db['CloudProvider'][_0xc28e('0x46')]({'where':{'id':_0x449a9f[_0xc28e('0x39')]['id']}})['then'](handleEntityNotFound(_0x56c157,null))[_0xc28e('0x14')](function(_0x31a69d){if(_0x31a69d['service']===_0xc28e('0x34')&&_0x449a9f[_0xc28e('0x3d')][_0xc28e('0x36')]){_0x449a9f[_0xc28e('0x3d')][_0xc28e('0x36')]=encryptor[_0xc28e('0x44')](_0x449a9f[_0xc28e('0x3d')]['data3']);}return _0x31a69d;})[_0xc28e('0x14')](saveUpdates(_0x449a9f[_0xc28e('0x3d')],null))[_0xc28e('0x14')](respondWithResult(_0x56c157,null))[_0xc28e('0x37')](handleError(_0x56c157,null));};exports[_0xc28e('0x15')]=function(_0x4f15c9,_0x47bc88){return db['CloudProvider'][_0xc28e('0x46')]({'where':{'id':_0x4f15c9[_0xc28e('0x39')]['id']}})[_0xc28e('0x14')](handleEntityNotFound(_0x47bc88,null))[_0xc28e('0x14')](removeEntity(_0x47bc88,null))['catch'](handleError(_0x47bc88,null));};exports[_0xc28e('0x47')]=function(_0x3a93c4,_0x6030b6){return db[_0xc28e('0x30')]['findOne']({'where':{'id':_0x3a93c4[_0xc28e('0x39')]['id']},'raw':!![]})[_0xc28e('0x14')](function(_0x484332){if(!_0x484332)return _0x6030b6[_0xc28e('0x16')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x484332,_0x3a93c4[_0xc28e('0x48')]['id'])};})[_0xc28e('0x14')](respondWithResult(_0x6030b6,null))['catch'](handleError(_0x6030b6,null));};exports[_0xc28e('0x49')]=function(_0xed09f4,_0x5ccb99){var _0x252fca=_0xed09f4['body'];var _0x5c8d9e;var _0xb24d5d;if(_0x252fca['error'])throw _0x252fca;redis[_0xc28e('0x4a')](_0x252fca['state'])[_0xc28e('0x14')](function(_0x43aafd){if(!_0x43aafd)throw new Error(_0xc28e('0x4b'));_0x5c8d9e=JSON[_0xc28e('0x4c')](_0x43aafd);var _0x5e0b5d=Buffer['from'](_0x252fca[_0xc28e('0x4d')],_0xc28e('0x4e'))['toString'](_0xc28e('0x4f'));_0xb24d5d=JSON[_0xc28e('0x4c')](_0x5e0b5d);if(!oauth[_0xc28e('0x50')](_0x252fca['id_token'],_0x5c8d9e[_0xc28e('0x51')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xc28e('0x52')](_0x252fca[_0xc28e('0x4d')]);return oauth['getOauth2MicrosoftAccessToken'](_0x252fca[_0xc28e('0x53')],_0x5c8d9e);})[_0xc28e('0x14')](function(_0x5a13f7){_0x5c8d9e[_0xc28e('0x54')]=_0x5a13f7[_0xc28e('0x55')];_0x5c8d9e['data6']=_0x5a13f7[_0xc28e('0x56')];return db[_0xc28e('0x30')][_0xc28e('0x45')]({'data5':_0x5c8d9e[_0xc28e('0x54')],'data6':_0x5c8d9e[_0xc28e('0x57')]},{'where':{'id':_0x5c8d9e['id']}});})[_0xc28e('0x14')](function(){oauth[_0xc28e('0x58')](_0x5c8d9e);socket['emit']('microsoftAuthorization:success',{'id':_0xb24d5d['id']});return;})['then'](respondWithStatusCode(_0x5ccb99,null))['catch'](function(_0x2eb4e0){if(_0xb24d5d){socket['emit']('microsoftAuthorization:error',{'id':_0xb24d5d['id']});}if(!_0x5c8d9e){logger[_0xc28e('0x17')](_0xc28e('0x59'),_0x2eb4e0);return _0x5ccb99['status'](0x1f4)[_0xc28e('0x1a')](_0x2eb4e0['message']);}logger[_0xc28e('0x17')](_0xc28e('0x5a'),_0x5c8d9e['id'],JSON[_0xc28e('0x5b')](_0x2eb4e0));});}; \ No newline at end of file +var _0xe937=['offset','undefined','limit','count','Content-Range','json','update','then','destroy','end','sendStatus','error','name','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','type','key','query','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','options','include','findAll','rows','service','decryptString','data3','catch','params','keys','includeAll','MicrosoftAzure','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','find','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe937,0x116));var _0x7e93=function(_0x545f04,_0x23aea2){_0x545f04=_0x545f04-0x0;var _0x7e22d2=_0xe937[_0x545f04];return _0x7e22d2;};'use strict';var _=require(_0x7e93('0x0'));var Redis=require(_0x7e93('0x1'));var qs=require(_0x7e93('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x7e93('0x3'));var logger=require(_0x7e93('0x4'))(_0x7e93('0x5'));var db=require(_0x7e93('0x6'))['db'];var oauth=require(_0x7e93('0x7'));config['redis']=_[_0x7e93('0x8')](config[_0x7e93('0x9')],{'host':_0x7e93('0xa'),'port':0x18eb});var socket=require(_0x7e93('0xb'))(new Redis(config[_0x7e93('0x9')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x316e2e,_0x4a8338){_0x4a8338=_0x4a8338||0xcc;return function(_0xa0eb4a){if(_0xa0eb4a){return _0x316e2e['sendStatus'](_0x4a8338);}return _0x316e2e[_0x7e93('0xc')](_0x4a8338)['end']();};}function respondWithResult(_0x405e9a,_0x2a056c){_0x2a056c=_0x2a056c||0xc8;return function(_0x218bf9){if(_0x218bf9){return _0x405e9a[_0x7e93('0xc')](_0x2a056c)['json'](_0x218bf9);}};}function respondWithFilteredResult(_0x551026,_0x12a3cd){return function(_0x365849){if(_0x365849){var _0x459045=typeof _0x12a3cd[_0x7e93('0xd')]===_0x7e93('0xe')&&typeof _0x12a3cd[_0x7e93('0xf')]==='undefined';var _0x510621=_0x365849[_0x7e93('0x10')];var _0x3ab306=_0x459045?0x0:_0x12a3cd['offset'];var _0x135f41=_0x459045?_0x365849[_0x7e93('0x10')]:_0x12a3cd['offset']+_0x12a3cd[_0x7e93('0xf')];var _0x1670fb;if(_0x135f41>=_0x510621){_0x135f41=_0x510621;_0x1670fb=0xc8;}else{_0x1670fb=0xce;}_0x551026['status'](_0x1670fb);return _0x551026['set'](_0x7e93('0x11'),_0x3ab306+'-'+_0x135f41+'/'+_0x510621)[_0x7e93('0x12')](_0x365849);}return null;};}function saveUpdates(_0x3c932a){return function(_0x32edd1){if(_0x32edd1){return _0x32edd1[_0x7e93('0x13')](_0x3c932a)[_0x7e93('0x14')](function(_0x4d41db){return _0x4d41db;});}return null;};}function removeEntity(_0x1eab0e){return function(_0x3ae8f4){if(_0x3ae8f4){return _0x3ae8f4[_0x7e93('0x15')]()['then'](function(){_0x1eab0e[_0x7e93('0xc')](0xcc)[_0x7e93('0x16')]();});}};}function handleEntityNotFound(_0x191e3f){return function(_0x474bd6){if(!_0x474bd6){_0x191e3f[_0x7e93('0x17')](0x194);}return _0x474bd6;};}function handleError(_0x4f8902,_0x1bc2db){_0x1bc2db=_0x1bc2db||0x1f4;return function(_0x11ab7f){logger[_0x7e93('0x18')](_0x11ab7f['stack']);if(_0x11ab7f[_0x7e93('0x19')]){delete _0x11ab7f['name'];}_0x4f8902[_0x7e93('0xc')](_0x1bc2db)['send'](_0x11ab7f);};}function maskClientSecret(_0x112bf7){return _[_0x7e93('0x1a')](_0x112bf7[_0x7e93('0x1b')](0x0,0x3),0x14,'*');}exports[_0x7e93('0x1c')]=function(_0x5ff90e,_0x42e28a){var _0x53867a={},_0x43107f={},_0x2991d2={'count':0x0,'rows':[]};var _0x461ef5=_['map'](db[_0x7e93('0x1d')][_0x7e93('0x1e')],function(_0x49ebc9){return{'name':_0x49ebc9[_0x7e93('0x1f')],'type':_0x49ebc9[_0x7e93('0x20')][_0x7e93('0x21')]};});_0x43107f['model']=_['map'](_0x461ef5,'name');_0x43107f[_0x7e93('0x22')]=_['keys'](_0x5ff90e[_0x7e93('0x22')]);_0x43107f['filters']=_['intersection'](_0x43107f[_0x7e93('0x23')],_0x43107f[_0x7e93('0x22')]);_0x53867a[_0x7e93('0x24')]=_[_0x7e93('0x25')](_0x43107f[_0x7e93('0x23')],qs[_0x7e93('0x26')](_0x5ff90e[_0x7e93('0x22')][_0x7e93('0x26')]));_0x53867a[_0x7e93('0x24')]=_0x53867a[_0x7e93('0x24')][_0x7e93('0x27')]?_0x53867a[_0x7e93('0x24')]:_0x43107f[_0x7e93('0x23')];if(!_0x5ff90e[_0x7e93('0x22')]['hasOwnProperty'](_0x7e93('0x28'))){_0x53867a[_0x7e93('0xf')]=qs[_0x7e93('0xf')](_0x5ff90e['query'][_0x7e93('0xf')]);_0x53867a[_0x7e93('0xd')]=qs[_0x7e93('0xd')](_0x5ff90e['query']['offset']);}_0x53867a[_0x7e93('0x29')]=qs[_0x7e93('0x2a')](_0x5ff90e[_0x7e93('0x22')][_0x7e93('0x2a')]);_0x53867a[_0x7e93('0x2b')]=qs[_0x7e93('0x2c')](_[_0x7e93('0x2d')](_0x5ff90e[_0x7e93('0x22')],_0x43107f[_0x7e93('0x2c')]),_0x461ef5);if(_0x5ff90e['query'][_0x7e93('0x2e')]){_0x53867a[_0x7e93('0x2b')]=_[_0x7e93('0x2f')](_0x53867a[_0x7e93('0x2b')],{'$or':_[_0x7e93('0x30')](_0x461ef5,function(_0x548571){if(_0x548571[_0x7e93('0x20')]!=='VIRTUAL'){var _0x4ef2e6={};_0x4ef2e6[_0x548571[_0x7e93('0x19')]]={'$like':'%'+_0x5ff90e[_0x7e93('0x22')]['filter']+'%'};return _0x4ef2e6;}})});}_0x53867a=_['merge']({},_0x53867a,_0x5ff90e[_0x7e93('0x31')]);var _0x568c9d={'where':_0x53867a[_0x7e93('0x2b')]};return db[_0x7e93('0x1d')]['count'](_0x568c9d)['then'](function(_0x1d6ff2){_0x2991d2['count']=_0x1d6ff2;if(_0x5ff90e[_0x7e93('0x22')]['includeAll']){_0x53867a[_0x7e93('0x32')]=[{'all':!![]}];}return db[_0x7e93('0x1d')][_0x7e93('0x33')](_0x53867a);})[_0x7e93('0x14')](function(_0x37ea7c){_0x2991d2[_0x7e93('0x34')]=_['map'](_0x37ea7c,function(_0xd04793){if(_0xd04793[_0x7e93('0x35')]==='MicrosoftAzure'){var _0xce965d=encryptor[_0x7e93('0x36')](_0xd04793[_0x7e93('0x37')]);_0xd04793[_0x7e93('0x37')]=maskClientSecret(_0xce965d);}return _0xd04793;});return _0x2991d2;})['then'](respondWithFilteredResult(_0x42e28a,_0x53867a))[_0x7e93('0x38')](handleError(_0x42e28a,null));};exports['show']=function(_0x4a35c0,_0x22d374){var _0x323d64={'raw':!![],'where':{'id':_0x4a35c0[_0x7e93('0x39')]['id']}},_0x3514a4={};_0x3514a4[_0x7e93('0x23')]=_[_0x7e93('0x3a')](db['CloudProvider'][_0x7e93('0x1e')]);_0x3514a4[_0x7e93('0x22')]=_[_0x7e93('0x3a')](_0x4a35c0[_0x7e93('0x22')]);_0x3514a4[_0x7e93('0x2c')]=_[_0x7e93('0x25')](_0x3514a4['model'],_0x3514a4[_0x7e93('0x22')]);_0x323d64[_0x7e93('0x24')]=_[_0x7e93('0x25')](_0x3514a4[_0x7e93('0x23')],qs['fields'](_0x4a35c0[_0x7e93('0x22')][_0x7e93('0x26')]));_0x323d64[_0x7e93('0x24')]=_0x323d64[_0x7e93('0x24')][_0x7e93('0x27')]?_0x323d64['attributes']:_0x3514a4['model'];if(_0x4a35c0[_0x7e93('0x22')][_0x7e93('0x3b')]){_0x323d64[_0x7e93('0x32')]=[{'all':!![]}];}_0x323d64=_['merge']({},_0x323d64,_0x4a35c0[_0x7e93('0x31')]);return db['CloudProvider']['find'](_0x323d64)['then'](handleEntityNotFound(_0x22d374,null))[_0x7e93('0x14')](function(_0x4ba3c5){if(_0x4ba3c5[_0x7e93('0x35')]===_0x7e93('0x3c')){var _0x534365=encryptor['decryptString'](_0x4ba3c5[_0x7e93('0x37')]);_0x4ba3c5[_0x7e93('0x37')]=maskClientSecret(_0x534365);}return _0x4ba3c5;})[_0x7e93('0x14')](respondWithResult(_0x22d374,null))[_0x7e93('0x38')](handleError(_0x22d374,null));};exports[_0x7e93('0x3d')]=function(_0x480f51,_0x59e931){if(!_0x480f51['body'][_0x7e93('0x19')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x480f51[_0x7e93('0x3e')][_0x7e93('0x35')])throw new Error(_0x7e93('0x3f'));var _0x30a9a7=db[_0x7e93('0x1d')]['rawAttributes'][_0x7e93('0x35')][_0x7e93('0x40')];if(!_0x30a9a7[_0x7e93('0x41')](_0x480f51[_0x7e93('0x3e')][_0x7e93('0x35')]))throw new Error(_0x7e93('0x42')+_0x30a9a7['join'](',\x20'));if(_0x480f51[_0x7e93('0x3e')]['service']===_0x7e93('0x3c')&&_0x480f51[_0x7e93('0x3e')]['data3']){_0x480f51[_0x7e93('0x3e')][_0x7e93('0x37')]=encryptor['encryptString'](_0x480f51[_0x7e93('0x3e')][_0x7e93('0x37')]);}return db[_0x7e93('0x1d')]['create'](_0x480f51[_0x7e93('0x3e')],{})[_0x7e93('0x14')](respondWithResult(_0x59e931,0xc9))['catch'](handleError(_0x59e931,null));};exports[_0x7e93('0x13')]=function(_0x5b752a,_0x3beec6){if(_0x5b752a[_0x7e93('0x3e')]['id']){delete _0x5b752a[_0x7e93('0x3e')]['id'];}return db[_0x7e93('0x1d')]['find']({'where':{'id':_0x5b752a[_0x7e93('0x39')]['id']}})[_0x7e93('0x14')](handleEntityNotFound(_0x3beec6,null))['then'](function(_0x1c1a17){if(_0x1c1a17['service']===_0x7e93('0x3c')&&_0x5b752a[_0x7e93('0x3e')][_0x7e93('0x37')]){_0x5b752a[_0x7e93('0x3e')][_0x7e93('0x37')]=encryptor['encryptString'](_0x5b752a[_0x7e93('0x3e')]['data3']);}return _0x1c1a17;})[_0x7e93('0x14')](saveUpdates(_0x5b752a[_0x7e93('0x3e')],null))[_0x7e93('0x14')](respondWithResult(_0x3beec6,null))[_0x7e93('0x38')](handleError(_0x3beec6,null));};exports['destroy']=function(_0x5339e3,_0x336391){return db[_0x7e93('0x1d')][_0x7e93('0x43')]({'where':{'id':_0x5339e3[_0x7e93('0x39')]['id']}})[_0x7e93('0x14')](handleEntityNotFound(_0x336391,null))['then'](removeEntity(_0x336391,null))[_0x7e93('0x38')](handleError(_0x336391,null));};exports[_0x7e93('0x44')]=function(_0x36c305,_0x50e8c7){return db[_0x7e93('0x1d')][_0x7e93('0x45')]({'where':{'id':_0x36c305[_0x7e93('0x39')]['id']},'raw':!![]})[_0x7e93('0x14')](function(_0xdc878d){if(!_0xdc878d)return _0x50e8c7[_0x7e93('0x17')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0xdc878d,_0x36c305[_0x7e93('0x46')]['id'])};})[_0x7e93('0x14')](respondWithResult(_0x50e8c7,null))[_0x7e93('0x38')](handleError(_0x50e8c7,null));};exports[_0x7e93('0x47')]=function(_0x5eafe5,_0x2b3afa){var _0x444751=_0x5eafe5['body'];var _0x283aaa;var _0x46ac4c;if(_0x444751[_0x7e93('0x18')])throw _0x444751;redis[_0x7e93('0x48')](_0x444751[_0x7e93('0x49')])[_0x7e93('0x14')](function(_0x2e5c29){if(!_0x2e5c29)throw new Error(_0x7e93('0x4a'));_0x283aaa=JSON[_0x7e93('0x4b')](_0x2e5c29);var _0x5d278c=Buffer[_0x7e93('0x4c')](_0x444751[_0x7e93('0x49')],_0x7e93('0x4d'))[_0x7e93('0x4e')](_0x7e93('0x4f'));_0x46ac4c=JSON[_0x7e93('0x4b')](_0x5d278c);if(!oauth['isValidIdToken'](_0x444751[_0x7e93('0x50')],_0x283aaa[_0x7e93('0x51')]))throw new Error(_0x7e93('0x52'));redis[_0x7e93('0x53')](_0x444751[_0x7e93('0x49')]);return oauth['getOauth2MicrosoftAccessToken'](_0x444751[_0x7e93('0x54')],_0x283aaa);})[_0x7e93('0x14')](function(_0x10f614){_0x283aaa[_0x7e93('0x55')]=_0x10f614[_0x7e93('0x56')];_0x283aaa[_0x7e93('0x57')]=_0x10f614[_0x7e93('0x58')];return db[_0x7e93('0x1d')][_0x7e93('0x13')]({'data5':_0x283aaa[_0x7e93('0x55')],'data6':_0x283aaa[_0x7e93('0x57')]},{'where':{'id':_0x283aaa['id']}});})[_0x7e93('0x14')](function(){oauth[_0x7e93('0x59')](_0x283aaa);socket[_0x7e93('0x5a')]('microsoftAuthorization:success',{'id':_0x46ac4c['id']});return;})['then'](respondWithStatusCode(_0x2b3afa,null))[_0x7e93('0x38')](function(_0x4fde3e){if(_0x46ac4c){socket[_0x7e93('0x5a')](_0x7e93('0x5b'),{'id':_0x46ac4c['id']});}if(!_0x283aaa){logger[_0x7e93('0x18')](_0x7e93('0x5c'),_0x4fde3e);return _0x2b3afa[_0x7e93('0xc')](0x1f4)[_0x7e93('0x5d')](_0x4fde3e[_0x7e93('0x5e')]);}logger[_0x7e93('0x18')](_0x7e93('0x5f'),_0x283aaa['id'],JSON[_0x7e93('0x60')](_0x4fde3e));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 926f1ee..5a047b6 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 _0xfee3=['exports','define','cloud_providers','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes'];(function(_0x214277,_0x3cc365){var _0x2bae03=function(_0x6c4a8){while(--_0x6c4a8){_0x214277['push'](_0x214277['shift']());}};_0x2bae03(++_0x3cc365);}(_0xfee3,0x6f));var _0x3fee=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0xfee3[_0x4b6830];return _0x239e4a;};'use strict';var _=require(_0x3fee('0x0'));var util=require(_0x3fee('0x1'));var logger=require('../../config/logger')(_0x3fee('0x2'));var moment=require(_0x3fee('0x3'));var BPromise=require(_0x3fee('0x4'));var rp=require(_0x3fee('0x5'));var fs=require('fs');var path=require(_0x3fee('0x6'));var rimraf=require('rimraf');var config=require(_0x3fee('0x7'));var attributes=require(_0x3fee('0x8'));module[_0x3fee('0x9')]=function(_0x2c89ae,_0x5dc0cd){return _0x2c89ae[_0x3fee('0xa')]('CloudProvider',attributes,{'tableName':_0x3fee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1d1=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xa1d1,0x137));var _0x1a1d=function(_0x1af1c7,_0x20c65a){_0x1af1c7=_0x1af1c7-0x0;var _0x40d7ca=_0xa1d1[_0x1af1c7];return _0x40d7ca;};'use strict';var _=require(_0x1a1d('0x0'));var util=require(_0x1a1d('0x1'));var logger=require(_0x1a1d('0x2'))('api');var moment=require(_0x1a1d('0x3'));var BPromise=require(_0x1a1d('0x4'));var rp=require(_0x1a1d('0x5'));var fs=require('fs');var path=require(_0x1a1d('0x6'));var rimraf=require('rimraf');var config=require(_0x1a1d('0x7'));var attributes=require(_0x1a1d('0x8'));module['exports']=function(_0x1311a7,_0x5325e4){return _0x1311a7[_0x1a1d('0x9')](_0x1a1d('0xa'),attributes,{'tableName':_0x1a1d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index dc5e44a..e9aa967 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 _0x8126=['data3','intervals','bind','findAll','all','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','/authorize','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','data2','from','stringify','toString','hex','client_id','data1','response_type','response_mode','form_post','state','prompt','key','oauth2Claims','oauth2/','set','decode','payload','iss','aud','audience','nonce','isAfter','unix','resolve','CloudProvider','findOne','then','data6','data4','decryptString','POST','data5','access_token','refresh_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code'];(function(_0x368282,_0x19980f){var _0x7ff7b8=function(_0x36cce9){while(--_0x36cce9){_0x368282['push'](_0x368282['shift']());}};_0x7ff7b8(++_0x19980f);}(_0x8126,0x18b));var _0x6812=function(_0x50ede0,_0x7e6410){_0x50ede0=_0x50ede0-0x0;var _0x5cbe32=_0x8126[_0x50ede0];return _0x5cbe32;};'use strict';var _=require(_0x6812('0x0'));var crypto=require(_0x6812('0x1'));var jwt=require(_0x6812('0x2'));var moment=require(_0x6812('0x3'));var Redis=require(_0x6812('0x4'));var rp=require(_0x6812('0x5'));var util=require(_0x6812('0x6'));var encryptor=require(_0x6812('0x7'));var config=require(_0x6812('0x8'));var logger=require(_0x6812('0x9'))(_0x6812('0xa'));var schedule=require(_0x6812('0xb'));var db=require('../../mysqldb')['db'];config[_0x6812('0xc')]=_[_0x6812('0xd')](config['redis'],{'host':_0x6812('0xe'),'port':0x18eb});var redis=new Redis(config[_0x6812('0xc')]);var MICROSOFT_AUTH_URL=_0x6812('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x6812('0x10'),_0x6812('0x11'),_0x6812('0x12'),_0x6812('0x13'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x6812('0x14'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x6812('0x10'),_0x6812('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0x6812('0x15');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x215934){var _0x286d32=_[_0x6812('0x16')](AZURE_AUTH_SCOPES[_0x215934[_0x6812('0x17')]]);if(_0x215934[_0x6812('0x17')]===_0x6812('0x18'))_0x286d32[_0x6812('0x19')](_0x215934[_0x6812('0x1a')]+_0x6812('0x1b'));return _0x286d32[_0x6812('0x1c')]('\x20');}function getAccessTokenScope(_0x35a88d){if(_0x35a88d[_0x6812('0x17')]===_0x6812('0x1d'))return _0x6812('0x1e');if(_0x35a88d[_0x6812('0x17')]==='Dynamics365')return _0x35a88d['data7']+_0x6812('0x1b');}function generateMicrosoftAuthorizationUrl(_0x1fda17,_0x5cf128){var _0x4d7d32=MICROSOFT_AUTH_URL[_0x6812('0x1f')](_0x6812('0x20'),_0x1fda17[_0x6812('0x21')]);var _0x296418=['code','id_token'];var _0xdfcf51=Buffer[_0x6812('0x22')](JSON[_0x6812('0x23')]({'id':_0x5cf128}))['toString']('base64');var _0x585205=crypto['randomBytes'](0x10)[_0x6812('0x24')](_0x6812('0x25'));var _0x5e4e3d=getAuthorizationScopes(_0x1fda17);var _0x439619=[{'key':_0x6812('0x26'),'value':_0x1fda17[_0x6812('0x27')]},{'key':_0x6812('0x28'),'value':encodeURIComponent(_0x296418['join']('\x20'))},{'key':'redirect_uri','value':_0x1fda17['data4']},{'key':_0x6812('0x29'),'value':_0x6812('0x2a')},{'key':'scope','value':encodeURIComponent(_0x5e4e3d)},{'key':_0x6812('0x2b'),'value':_0xdfcf51},{'key':'nonce','value':_0x585205},{'key':_0x6812('0x2c'),'value':'login'}];var _0x20b2eb=_0x4d7d32+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x6812('0x16')](_0x439619,function(_0x1d2055){return _0x1d2055[_0x6812('0x2d')]+'='+_0x1d2055['value'];})[_0x6812('0x1c')]('&');_0x1fda17[_0x6812('0x2e')]={'issuer':_0x4d7d32[_0x6812('0x1f')](_0x6812('0x2f'),''),'audience':_0x1fda17[_0x6812('0x27')],'state':_0xdfcf51,'nonce':_0x585205};redis[_0x6812('0x30')](_0xdfcf51,JSON[_0x6812('0x23')](_0x1fda17));return _0x20b2eb;}function isValidIdToken(_0x2e5e85,_0x16c81d){try{var _0x5b3b94=jwt[_0x6812('0x31')](_0x2e5e85,{'complete':!![]});var _0x556167=_0x5b3b94[_0x6812('0x32')];if(_0x556167[_0x6812('0x33')]!==_0x16c81d['issuer'])return![];if(_0x556167[_0x6812('0x34')]!==_0x16c81d[_0x6812('0x35')])return![];if(_0x556167[_0x6812('0x36')]!==_0x16c81d['nonce'])return![];if(moment()[_0x6812('0x37')](moment[_0x6812('0x38')](_0x556167['exp'])))return![];return!![];}catch(_0x155a2d){throw _0x155a2d;}}function refreshOauth2MicrosoftAccessToken(_0x341567){return Promise[_0x6812('0x39')]()['then'](function(){if(_0x341567['data3'])return _0x341567;return db[_0x6812('0x3a')][_0x6812('0x3b')]({'where':{'id':_0x341567['id']},'raw':!![]});})[_0x6812('0x3c')](function(_0xed8146){var _0x38893b={'grant_type':'refresh_token','refresh_token':_0xed8146[_0x6812('0x3d')],'scope':getAccessTokenScope(_0xed8146),'redirect_uri':_0xed8146[_0x6812('0x3e')],'client_id':_0xed8146[_0x6812('0x27')],'client_secret':encryptor[_0x6812('0x3f')](_0xed8146['data3'])};var _0x396487={'method':_0x6812('0x40'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0xed8146[_0x6812('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x38893b,'json':!![]};return rp(_0x396487);})[_0x6812('0x3c')](function(_0x3c1444){_0x341567[_0x6812('0x41')]=_0x3c1444[_0x6812('0x42')];_0x341567[_0x6812('0x3d')]=_0x3c1444[_0x6812('0x43')];return db[_0x6812('0x3a')][_0x6812('0x44')]({'data5':_0x341567[_0x6812('0x41')],'data6':_0x341567[_0x6812('0x3d')]},{'where':{'id':_0x341567['id']}});})[_0x6812('0x3c')](function(){return _0x341567;})[_0x6812('0x45')](function(_0x12b853){logger[_0x6812('0x46')](_0x6812('0x47'),_0x341567['id'],_0x12b853);});}function getOauth2MicrosoftAccessToken(_0x29b6b7,_0x4f2d8b){var _0x3d4684={'grant_type':_0x6812('0x48'),'code':_0x29b6b7,'scope':getAccessTokenScope(_0x4f2d8b),'redirect_uri':_0x4f2d8b[_0x6812('0x3e')],'client_id':_0x4f2d8b[_0x6812('0x27')],'client_secret':encryptor[_0x6812('0x3f')](_0x4f2d8b[_0x6812('0x49')])};var _0x1a7ca8={'method':_0x6812('0x40'),'uri':MICROSOFT_AUTH_URL[_0x6812('0x1f')](_0x6812('0x20'),_0x4f2d8b[_0x6812('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3d4684,'json':!![]};return rp(_0x1a7ca8);}function startRefreshInterval(_0x41fc19){var _0x6f8d1=schedule[_0x6812('0x4a')];if(_0x6f8d1[_0x41fc19['id']])clearInterval(_0x6f8d1[_0x41fc19['id']]);_0x6f8d1[_0x41fc19['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x6812('0x4b')](this,{'id':_0x41fc19['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x6812('0x4a')]=_0x6f8d1;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x6812('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x6812('0x3c')](function(_0x330f9d){var _0x249cf2=_0x330f9d[_0x6812('0x16')](function(_0x208793){return refreshOauth2MicrosoftAccessToken(_0x208793)[_0x6812('0x3c')](function(_0x41c512){startRefreshInterval(_0x41c512);});});return Promise[_0x6812('0x4d')](_0x249cf2);})['catch'](function(_0x557c6a){var _0x260d55=_0x557c6a?util['inspect'](_0x557c6a,{'showHidden':![],'depth':null}):'';logger[_0x6812('0x46')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x260d55);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x9bcd=['isAfter','unix','exp','resolve','data3','CloudProvider','findOne','then','refresh_token','data6','decryptString','POST','data5','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','data7','join','Outlook365','/.default','replace','{TENANT_ID}','data2','code','id_token','from','toString','randomBytes','client_id','response_type','data4','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','data1','stringify','decode','payload','audience'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9bcd,0xb4));var _0xd9bc=function(_0x1ee940,_0x5b30b9){_0x1ee940=_0x1ee940-0x0;var _0x38e12e=_0x9bcd[_0x1ee940];return _0x38e12e;};'use strict';var _=require(_0xd9bc('0x0'));var crypto=require('crypto');var jwt=require(_0xd9bc('0x1'));var moment=require(_0xd9bc('0x2'));var Redis=require(_0xd9bc('0x3'));var rp=require(_0xd9bc('0x4'));var util=require(_0xd9bc('0x5'));var encryptor=require(_0xd9bc('0x6'));var config=require(_0xd9bc('0x7'));var logger=require(_0xd9bc('0x8'))(_0xd9bc('0x9'));var schedule=require(_0xd9bc('0xa'));var db=require(_0xd9bc('0xb'))['db'];config['redis']=_[_0xd9bc('0xc')](config[_0xd9bc('0xd')],{'host':_0xd9bc('0xe'),'port':0x18eb});var redis=new Redis(config[_0xd9bc('0xd')]);var MICROSOFT_AUTH_URL=_0xd9bc('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0xd9bc('0x10'),_0xd9bc('0x11'),_0xd9bc('0x12'),_0xd9bc('0x13'),_0xd9bc('0x14'),_0xd9bc('0x15'),_0xd9bc('0x16')],'Dynamics365':[_0xd9bc('0x10'),_0xd9bc('0x13')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xd9bc('0x17');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x33e0fd){var _0x12c6a9=_[_0xd9bc('0x18')](AZURE_AUTH_SCOPES[_0x33e0fd[_0xd9bc('0x19')]]);if(_0x33e0fd[_0xd9bc('0x19')]===_0xd9bc('0x1a'))_0x12c6a9['push'](_0x33e0fd[_0xd9bc('0x1b')]+'/.default');return _0x12c6a9[_0xd9bc('0x1c')]('\x20');}function getAccessTokenScope(_0x331e97){if(_0x331e97[_0xd9bc('0x19')]===_0xd9bc('0x1d'))return _0xd9bc('0x14');if(_0x331e97[_0xd9bc('0x19')]===_0xd9bc('0x1a'))return _0x331e97['data7']+_0xd9bc('0x1e');}function generateMicrosoftAuthorizationUrl(_0x16b3aa,_0x578578){var _0x288b84=MICROSOFT_AUTH_URL[_0xd9bc('0x1f')](_0xd9bc('0x20'),_0x16b3aa[_0xd9bc('0x21')]);var _0x234754=[_0xd9bc('0x22'),_0xd9bc('0x23')];var _0x428f54=Buffer[_0xd9bc('0x24')](JSON['stringify']({'id':_0x578578}))[_0xd9bc('0x25')]('base64');var _0x45d824=crypto[_0xd9bc('0x26')](0x10)[_0xd9bc('0x25')]('hex');var _0x2d4e2c=getAuthorizationScopes(_0x16b3aa);var _0x4d1246=[{'key':_0xd9bc('0x27'),'value':_0x16b3aa['data1']},{'key':_0xd9bc('0x28'),'value':encodeURIComponent(_0x234754['join']('\x20'))},{'key':'redirect_uri','value':_0x16b3aa[_0xd9bc('0x29')]},{'key':'response_mode','value':_0xd9bc('0x2a')},{'key':_0xd9bc('0x2b'),'value':encodeURIComponent(_0x2d4e2c)},{'key':_0xd9bc('0x2c'),'value':_0x428f54},{'key':_0xd9bc('0x2d'),'value':_0x45d824},{'key':_0xd9bc('0x2e'),'value':_0xd9bc('0x2f')}];var _0x216c6d=_0x288b84+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xd9bc('0x18')](_0x4d1246,function(_0x382c38){return _0x382c38[_0xd9bc('0x30')]+'='+_0x382c38[_0xd9bc('0x31')];})[_0xd9bc('0x1c')]('&');_0x16b3aa[_0xd9bc('0x32')]={'issuer':_0x288b84['replace'](_0xd9bc('0x33'),''),'audience':_0x16b3aa[_0xd9bc('0x34')],'state':_0x428f54,'nonce':_0x45d824};redis['set'](_0x428f54,JSON[_0xd9bc('0x35')](_0x16b3aa));return _0x216c6d;}function isValidIdToken(_0x72df5e,_0x398e83){try{var _0x44baf3=jwt[_0xd9bc('0x36')](_0x72df5e,{'complete':!![]});var _0x245ecd=_0x44baf3[_0xd9bc('0x37')];if(_0x245ecd['iss']!==_0x398e83['issuer'])return![];if(_0x245ecd['aud']!==_0x398e83[_0xd9bc('0x38')])return![];if(_0x245ecd[_0xd9bc('0x2d')]!==_0x398e83[_0xd9bc('0x2d')])return![];if(moment()[_0xd9bc('0x39')](moment[_0xd9bc('0x3a')](_0x245ecd[_0xd9bc('0x3b')])))return![];return!![];}catch(_0x4ff6e3){throw _0x4ff6e3;}}function refreshOauth2MicrosoftAccessToken(_0xe00c8){return Promise[_0xd9bc('0x3c')]()['then'](function(){if(_0xe00c8[_0xd9bc('0x3d')])return _0xe00c8;return db[_0xd9bc('0x3e')][_0xd9bc('0x3f')]({'where':{'id':_0xe00c8['id']},'raw':!![]});})[_0xd9bc('0x40')](function(_0x3af8bc){var _0x1d4d06={'grant_type':_0xd9bc('0x41'),'refresh_token':_0x3af8bc[_0xd9bc('0x42')],'scope':getAccessTokenScope(_0x3af8bc),'redirect_uri':_0x3af8bc[_0xd9bc('0x29')],'client_id':_0x3af8bc[_0xd9bc('0x34')],'client_secret':encryptor[_0xd9bc('0x43')](_0x3af8bc[_0xd9bc('0x3d')])};var _0x56f545={'method':_0xd9bc('0x44'),'uri':MICROSOFT_AUTH_URL[_0xd9bc('0x1f')](_0xd9bc('0x20'),_0x3af8bc[_0xd9bc('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1d4d06,'json':!![]};return rp(_0x56f545);})[_0xd9bc('0x40')](function(_0x2f5b15){_0xe00c8[_0xd9bc('0x45')]=_0x2f5b15['access_token'];_0xe00c8[_0xd9bc('0x42')]=_0x2f5b15[_0xd9bc('0x41')];return db[_0xd9bc('0x3e')][_0xd9bc('0x46')]({'data5':_0xe00c8['data5'],'data6':_0xe00c8[_0xd9bc('0x42')]},{'where':{'id':_0xe00c8['id']}});})[_0xd9bc('0x40')](function(){return _0xe00c8;})[_0xd9bc('0x47')](function(_0x161cde){logger['error'](_0xd9bc('0x48'),_0xe00c8['id'],_0x161cde);});}function getOauth2MicrosoftAccessToken(_0x361bd9,_0x116bbe){var _0x21fb8c={'grant_type':'authorization_code','code':_0x361bd9,'scope':getAccessTokenScope(_0x116bbe),'redirect_uri':_0x116bbe[_0xd9bc('0x29')],'client_id':_0x116bbe[_0xd9bc('0x34')],'client_secret':encryptor['decryptString'](_0x116bbe['data3'])};var _0x245212={'method':_0xd9bc('0x44'),'uri':MICROSOFT_AUTH_URL['replace'](_0xd9bc('0x20'),_0x116bbe[_0xd9bc('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x21fb8c,'json':!![]};return rp(_0x245212);}function startRefreshInterval(_0x3bba20){var _0x587197=schedule[_0xd9bc('0x49')];if(_0x587197[_0x3bba20['id']])clearInterval(_0x587197[_0x3bba20['id']]);_0x587197[_0x3bba20['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x3bba20['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x587197;}function startAllRefreshIntervals(){return db[_0xd9bc('0x3e')][_0xd9bc('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xd9bc('0x40')](function(_0x2fa096){var _0x22b8fb=_0x2fa096[_0xd9bc('0x18')](function(_0xca70b0){return refreshOauth2MicrosoftAccessToken(_0xca70b0)[_0xd9bc('0x40')](function(_0x341385){startRefreshInterval(_0x341385);});});return Promise[_0xd9bc('0x4b')](_0x22b8fb);})[_0xd9bc('0x47')](function(_0x150379){var _0xd2657c=_0x150379?util[_0xd9bc('0x4c')](_0x150379,{'showHidden':![],'depth':null}):'';logger[_0xd9bc('0x4d')](_0xd9bc('0x4e'),_0xd2657c);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index d035060..38ae10c 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 _0xdacc=['CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent'];(function(_0x5d5eee,_0x33ba5f){var _0x236350=function(_0x23b6ab){while(--_0x23b6ab){_0x5d5eee['push'](_0x5d5eee['shift']());}};_0x236350(++_0x33ba5f);}(_0xdacc,0x14f));var _0xcdac=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdacc[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xcdac('0x0'));var moment=require(_0xcdac('0x1'));var BPromise=require(_0xcdac('0x2'));var rs=require(_0xcdac('0x3'));var fs=require('fs');var Redis=require(_0xcdac('0x4'));var db=require(_0xcdac('0x5'))['db'];var utils=require(_0xcdac('0x6'));var logger=require('../../config/logger')(_0xcdac('0x7'));var config=require(_0xcdac('0x8'));var jayson=require(_0xcdac('0x9'));var client=jayson[_0xcdac('0xa')][_0xcdac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a10a1,_0x20a66e,_0x46ad29){return new BPromise(function(_0xe906b8,_0x213c05){return client[_0xcdac('0xc')](_0x2a10a1,_0x46ad29)[_0xcdac('0xd')](function(_0x33c4af){logger[_0xcdac('0xe')](_0xcdac('0xf'),_0x20a66e,_0xcdac('0x10'));logger['debug'](_0xcdac('0x11'),_0x20a66e,_0xcdac('0x10'),JSON['stringify'](_0x33c4af));if(_0x33c4af[_0xcdac('0x12')]){if(_0x33c4af[_0xcdac('0x12')][_0xcdac('0x13')]===0x1f4){logger[_0xcdac('0x12')](_0xcdac('0xf'),_0x20a66e,_0x33c4af['error']['message']);return _0x213c05(_0x33c4af[_0xcdac('0x12')]['message']);}logger[_0xcdac('0x12')]('CloudProvider,\x20%s,\x20%s',_0x20a66e,_0x33c4af['error'][_0xcdac('0x14')]);return _0xe906b8(_0x33c4af[_0xcdac('0x12')][_0xcdac('0x14')]);}else{logger[_0xcdac('0xe')](_0xcdac('0xf'),_0x20a66e,_0xcdac('0x10'));_0xe906b8(_0x33c4af['result'][_0xcdac('0x14')]);}})[_0xcdac('0x15')](function(_0x542a27){logger[_0xcdac('0x12')](_0xcdac('0xf'),_0x20a66e,_0x542a27);_0x213c05(_0x542a27);});});} \ No newline at end of file +var _0x7d25=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x3d8a41,_0x2b0fbe){var _0x28675e=function(_0x222859){while(--_0x222859){_0x3d8a41['push'](_0x3d8a41['shift']());}};_0x28675e(++_0x2b0fbe);}(_0x7d25,0x8a));var _0x57d2=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x7d25[_0x1477ef];return _0x164acd;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f43b2,_0x263d35,_0x147194){return new BPromise(function(_0x59ae87,_0x49e3e5){return client[_0x57d2('0x8')](_0x1f43b2,_0x147194)['then'](function(_0x3a1ec5){logger[_0x57d2('0x9')](_0x57d2('0xa'),_0x263d35,'request\x20sent');logger[_0x57d2('0xb')](_0x57d2('0xc'),_0x263d35,_0x57d2('0xd'),JSON[_0x57d2('0xe')](_0x3a1ec5));if(_0x3a1ec5[_0x57d2('0xf')]){if(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x10')]===0x1f4){logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);return _0x49e3e5(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);}logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')]['message']);return _0x59ae87(_0x3a1ec5['error'][_0x57d2('0x11')]);}else{logger[_0x57d2('0x9')]('CloudProvider,\x20%s,\x20%s',_0x263d35,_0x57d2('0xd'));_0x59ae87(_0x3a1ec5[_0x57d2('0x12')]['message']);}})[_0x57d2('0x13')](function(_0x4986ad){logger[_0x57d2('0xf')]('CloudProvider,\x20%s,\x20%s',_0x263d35,_0x4986ad);_0x49e3e5(_0x4986ad);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 866ba82..bb807af 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0xb8b8d4,_0x4ad252){_0xb8b8d4=_0xb8b8d4-0x0;var _0x5aff88=_0x7a54[_0xb8b8d4];return _0x5aff88;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7a54,0x106));var _0x47a5=function(_0x575e86,_0x36d052){_0x575e86=_0x575e86-0x0;var _0x16bf0a=_0x7a54[_0x575e86];return _0x16bf0a;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 285a25d..0ad3695 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 _0xeaa7=['exports','STRING','name','sequelize'];(function(_0x1315e5,_0xb0f5b1){var _0x14d224=function(_0x4021f7){while(--_0x4021f7){_0x1315e5['push'](_0x1315e5['shift']());}};_0x14d224(++_0xb0f5b1);}(_0xeaa7,0x113));var _0x7eaa=function(_0x6d6a66,_0x2924af){_0x6d6a66=_0x6d6a66-0x0;var _0x11eb6e=_0xeaa7[_0x6d6a66];return _0x11eb6e;};'use strict';var Sequelize=require(_0x7eaa('0x0'));module[_0x7eaa('0x1')]={'name':{'type':Sequelize[_0x7eaa('0x2')],'unique':_0x7eaa('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7eaa('0x2')]},'companyId':{'type':Sequelize[_0x7eaa('0x2')]},'website':{'type':Sequelize[_0x7eaa('0x2')]},'phone':{'type':Sequelize[_0x7eaa('0x2')]},'fax':{'type':Sequelize[_0x7eaa('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7eaa('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7eaa('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x7eaa('0x2')]},'sCity':{'type':Sequelize[_0x7eaa('0x2')]},'sCountry':{'type':Sequelize[_0x7eaa('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9bee=['STRING','name'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x9bee,0xf4));var _0xe9be=function(_0x1dae99,_0x4207dc){_0x1dae99=_0x1dae99-0x0;var _0x1cda0c=_0x9bee[_0x1dae99];return _0x1cda0c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe9be('0x0')],'unique':_0xe9be('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xe9be('0x0')]},'website':{'type':Sequelize[_0xe9be('0x0')]},'phone':{'type':Sequelize[_0xe9be('0x0')]},'fax':{'type':Sequelize[_0xe9be('0x0')]},'type':{'type':Sequelize[_0xe9be('0x0')]},'street':{'type':Sequelize[_0xe9be('0x0')]},'postalCode':{'type':Sequelize[_0xe9be('0x0')]},'city':{'type':Sequelize[_0xe9be('0x0')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xe9be('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe9be('0x0')]},'sStreet':{'type':Sequelize[_0xe9be('0x0')]},'sPostalCode':{'type':Sequelize[_0xe9be('0x0')]},'sCity':{'type':Sequelize[_0xe9be('0x0')]},'sCountry':{'type':Sequelize[_0xe9be('0x0')]},'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 6fbe392..e3584e9 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 _0x1792=['apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','map','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','body','addContacts','CmContact','omit','getContacts','filter','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x370f28,_0xb8cad9){var _0xe69f49=function(_0x373494){while(--_0x373494){_0x370f28['push'](_0x370f28['shift']());}};_0xe69f49(++_0xb8cad9);}(_0x1792,0x13e));var _0x2179=function(_0xffdec4,_0x322bec){_0xffdec4=_0xffdec4-0x0;var _0x479138=_0x1792[_0xffdec4];return _0x479138;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2179('0x0'));var zipdir=require(_0x2179('0x1'));var jsonpatch=require(_0x2179('0x2'));var rp=require(_0x2179('0x3'));var moment=require(_0x2179('0x4'));var BPromise=require(_0x2179('0x5'));var Mustache=require(_0x2179('0x6'));var util=require('util');var path=require(_0x2179('0x7'));var sox=require(_0x2179('0x8'));var csv=require(_0x2179('0x9'));var ejs=require(_0x2179('0xa'));var fs=require('fs');var fs_extra=require(_0x2179('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2179('0xc'));var jsforce=require(_0x2179('0xd'));var deskjs=require(_0x2179('0xe'));var toCsv=require(_0x2179('0x9'));var querystring=require(_0x2179('0xf'));var Papa=require(_0x2179('0x10'));var Redis=require(_0x2179('0x11'));var authService=require(_0x2179('0x12'));var qs=require(_0x2179('0x13'));var as=require(_0x2179('0x14'));var hardwareService=require(_0x2179('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x2179('0x16'));var config=require(_0x2179('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2179('0x18'))['db'];function respondWithStatusCode(_0x3e04c7,_0x398d51){_0x398d51=_0x398d51||0xcc;return function(_0x369cf1){if(_0x369cf1){return _0x3e04c7[_0x2179('0x19')](_0x398d51);}return _0x3e04c7[_0x2179('0x1a')](_0x398d51)['end']();};}function respondWithResult(_0x485998,_0x3e3e06){_0x3e3e06=_0x3e3e06||0xc8;return function(_0x253c33){if(_0x253c33){return _0x485998['status'](_0x3e3e06)[_0x2179('0x1b')](_0x253c33);}};}function respondWithFilteredResult(_0x30718b,_0x5b03fd){return function(_0x1d5b51){if(_0x1d5b51){var _0x51406d=typeof _0x5b03fd['offset']===_0x2179('0x1c')&&typeof _0x5b03fd[_0x2179('0x1d')]==='undefined';var _0x2ad6ce=_0x1d5b51[_0x2179('0x1e')];var _0x3d26d5=_0x51406d?0x0:_0x5b03fd[_0x2179('0x1f')];var _0x27728a=_0x51406d?_0x1d5b51['count']:_0x5b03fd[_0x2179('0x1f')]+_0x5b03fd['limit'];var _0x506c8c;if(_0x27728a>=_0x2ad6ce){_0x27728a=_0x2ad6ce;_0x506c8c=0xc8;}else{_0x506c8c=0xce;}_0x30718b[_0x2179('0x1a')](_0x506c8c);return _0x30718b[_0x2179('0x20')](_0x2179('0x21'),_0x3d26d5+'-'+_0x27728a+'/'+_0x2ad6ce)[_0x2179('0x1b')](_0x1d5b51);}return null;};}function patchUpdates(_0x11e942){return function(_0x133615){try{jsonpatch[_0x2179('0x22')](_0x133615,_0x11e942,!![]);}catch(_0xd3a594){return BPromise[_0x2179('0x23')](_0xd3a594);}return _0x133615[_0x2179('0x24')]();};}function saveUpdates(_0x326f3a,_0x36b18c){return function(_0x307683){if(_0x307683){return _0x307683[_0x2179('0x25')](_0x326f3a)[_0x2179('0x26')](function(_0x248a76){return _0x248a76;});}return null;};}function removeEntity(_0x4efe05,_0x2a70b3){return function(_0x16edf3){if(_0x16edf3){return _0x16edf3[_0x2179('0x27')]()[_0x2179('0x26')](function(){var _0x1e02ae=_0x16edf3[_0x2179('0x28')]({'plain':!![]});var _0x3fee3d=_0x2179('0x29');return db[_0x2179('0x2a')][_0x2179('0x27')]({'where':{'type':_0x3fee3d,'resourceId':_0x1e02ae['id']}})['then'](function(){return _0x16edf3;});})[_0x2179('0x26')](function(){_0x4efe05[_0x2179('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47da90,_0x41e692){return function(_0x1d6bab){if(!_0x1d6bab){_0x47da90[_0x2179('0x19')](0x194);}return _0x1d6bab;};}function handleError(_0x450307,_0x164368){_0x164368=_0x164368||0x1f4;return function(_0x3842d5){logger[_0x2179('0x2b')](_0x3842d5[_0x2179('0x2c')]);if(_0x3842d5[_0x2179('0x2d')]){delete _0x3842d5[_0x2179('0x2d')];}_0x450307[_0x2179('0x1a')](_0x164368)[_0x2179('0x2e')](_0x3842d5);};}exports[_0x2179('0x2f')]=function(_0x4d39d9,_0x284bce){var _0x5d5c30={},_0x8850f={},_0x4a327c={'count':0x0,'rows':[]};return db[_0x2179('0x30')][_0x2179('0x31')]()[_0x2179('0x26')](function(_0x9dc379){_0x8850f[_0x2179('0x32')]=_[_0x2179('0x33')](_0x9dc379);_0x8850f[_0x2179('0x34')]=_[_0x2179('0x33')](_0x4d39d9['query']);_0x8850f[_0x2179('0x35')]=_[_0x2179('0x36')](_0x8850f[_0x2179('0x32')],_0x8850f[_0x2179('0x34')]);_0x5d5c30[_0x2179('0x37')]=_[_0x2179('0x36')](_0x8850f[_0x2179('0x32')],qs['fields'](_0x4d39d9['query'][_0x2179('0x38')]));_0x5d5c30[_0x2179('0x37')]=_0x5d5c30[_0x2179('0x37')][_0x2179('0x39')]?_0x5d5c30[_0x2179('0x37')]:_0x8850f[_0x2179('0x32')];if(!_0x4d39d9['query'][_0x2179('0x3a')](_0x2179('0x3b'))){_0x5d5c30[_0x2179('0x1d')]=qs[_0x2179('0x1d')](_0x4d39d9[_0x2179('0x34')][_0x2179('0x1d')]);_0x5d5c30[_0x2179('0x1f')]=qs[_0x2179('0x1f')](_0x4d39d9[_0x2179('0x34')]['offset']);}_0x5d5c30[_0x2179('0x3c')]=qs[_0x2179('0x3d')](_0x4d39d9['query'][_0x2179('0x3d')]);_0x5d5c30['where']=qs['filters'](_['pick'](_0x4d39d9['query'],_0x8850f['filters']),_0x9dc379);if(_0x4d39d9[_0x2179('0x34')]['filter']){_0x5d5c30[_0x2179('0x3e')]=_['merge'](_0x5d5c30[_0x2179('0x3e')],{'$or':_[_0x2179('0x3f')](_0x5d5c30[_0x2179('0x37')],function(_0x3a6785){var _0x4f19eb={};_0x4f19eb[_0x3a6785]={'$like':'%'+_0x4d39d9[_0x2179('0x34')]['filter']+'%'};return _0x4f19eb;})});}_0x5d5c30=_[_0x2179('0x40')]({},_0x5d5c30,_0x4d39d9[_0x2179('0x41')]);var _0x381c1c={'where':_0x5d5c30[_0x2179('0x3e')]};return db[_0x2179('0x30')][_0x2179('0x1e')](_0x381c1c)[_0x2179('0x26')](function(_0x294ea2){_0x4a327c['count']=_0x294ea2;if(_0x4d39d9[_0x2179('0x34')][_0x2179('0x42')]){_0x5d5c30[_0x2179('0x43')]=[{'all':!![]}];}return db['CmCompany'][_0x2179('0x44')](_0x5d5c30);})[_0x2179('0x26')](function(_0x56aed7){_0x4a327c[_0x2179('0x45')]=_0x56aed7;return _0x4a327c;})[_0x2179('0x26')](respondWithFilteredResult(_0x284bce,_0x5d5c30))['catch'](handleError(_0x284bce,null));})[_0x2179('0x46')](handleError(_0x284bce,null));};exports[_0x2179('0x47')]=function(_0xcb48aa,_0x7da24f){var _0x399376={'raw':![],'where':{'id':_0xcb48aa[_0x2179('0x48')]['id']}},_0x11d69e={};_0x11d69e[_0x2179('0x32')]=_['keys'](db['CmCompany'][_0x2179('0x49')]);_0x11d69e[_0x2179('0x34')]=_[_0x2179('0x33')](_0xcb48aa[_0x2179('0x34')]);_0x11d69e['filters']=_[_0x2179('0x36')](_0x11d69e['model'],_0x11d69e[_0x2179('0x34')]);_0x399376['attributes']=_[_0x2179('0x36')](_0x11d69e[_0x2179('0x32')],qs[_0x2179('0x38')](_0xcb48aa[_0x2179('0x34')][_0x2179('0x38')]));_0x399376['attributes']=_0x399376[_0x2179('0x37')][_0x2179('0x39')]?_0x399376[_0x2179('0x37')]:_0x11d69e[_0x2179('0x32')];if(_0xcb48aa['query']['includeAll']){_0x399376['include']=[{'all':!![]}];}_0x399376=_['merge']({},_0x399376,_0xcb48aa[_0x2179('0x41')]);return db['CmCompany'][_0x2179('0x4a')](_0x399376)[_0x2179('0x26')](handleEntityNotFound(_0x7da24f,null))[_0x2179('0x26')](respondWithResult(_0x7da24f,null))[_0x2179('0x46')](handleError(_0x7da24f,null));};exports[_0x2179('0x4b')]=function(_0x190d3e,_0x44b218){return db[_0x2179('0x30')]['create'](_0x190d3e['body'],{})[_0x2179('0x26')](function(_0x3ce598){var _0x263c1c=_0x190d3e['user']['get']({'plain':!![]});if(!_0x263c1c)throw new Error(_0x2179('0x4c'));if(_0x263c1c[_0x2179('0x4d')]===_0x2179('0x4e')){var _0x527960=_0x3ce598[_0x2179('0x28')]({'plain':!![]});var _0x5e5c94=_0x2179('0x29');return db[_0x2179('0x4f')][_0x2179('0x4a')]({'where':{'name':_0x5e5c94,'userProfileId':_0x263c1c[_0x2179('0x50')]},'raw':!![]})[_0x2179('0x26')](function(_0x3165c5){if(_0x3165c5&&_0x3165c5[_0x2179('0x51')]===0x0){return db[_0x2179('0x2a')][_0x2179('0x4b')]({'name':_0x527960[_0x2179('0x2d')],'resourceId':_0x527960['id'],'type':_0x3165c5['name'],'sectionId':_0x3165c5['id']},{})[_0x2179('0x26')](function(){return _0x3ce598;});}else{return _0x3ce598;}})[_0x2179('0x46')](function(_0x54fd34){logger[_0x2179('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54fd34);throw _0x54fd34;});}return _0x3ce598;})[_0x2179('0x26')](respondWithResult(_0x44b218,0xc9))['catch'](handleError(_0x44b218,null));};exports[_0x2179('0x25')]=function(_0xa66223,_0x4b06c9){if(_0xa66223['body']['id']){delete _0xa66223[_0x2179('0x52')]['id'];}return db[_0x2179('0x30')][_0x2179('0x4a')]({'where':{'id':_0xa66223[_0x2179('0x48')]['id']}})[_0x2179('0x26')](handleEntityNotFound(_0x4b06c9,null))[_0x2179('0x26')](saveUpdates(_0xa66223[_0x2179('0x52')],null))['then'](respondWithResult(_0x4b06c9,null))[_0x2179('0x46')](handleError(_0x4b06c9,null));};exports[_0x2179('0x27')]=function(_0x5ae61f,_0x12a9e6){return db[_0x2179('0x30')][_0x2179('0x4a')]({'where':{'id':_0x5ae61f['params']['id']}})[_0x2179('0x26')](handleEntityNotFound(_0x12a9e6,null))[_0x2179('0x26')](removeEntity(_0x12a9e6,null))[_0x2179('0x46')](handleError(_0x12a9e6,null));};exports['describe']=function(_0x37f9c2,_0x3778da){return db[_0x2179('0x30')][_0x2179('0x31')]()[_0x2179('0x26')](respondWithResult(_0x3778da,null))['catch'](handleError(_0x3778da,null));};exports[_0x2179('0x53')]=function(_0x20cd0d,_0x7d54c5,_0xe11728){return db[_0x2179('0x54')][_0x2179('0x4a')]({'where':{'id':_0x20cd0d['params']['id']}})[_0x2179('0x26')](handleEntityNotFound(_0x7d54c5,null))[_0x2179('0x26')](function(_0x325f4f){if(_0x325f4f){return _0x325f4f['addContacts'](_0x20cd0d[_0x2179('0x52')]['ids'],_[_0x2179('0x55')](_0x20cd0d[_0x2179('0x52')],['ids','id'])||{});}})[_0x2179('0x26')](respondWithResult(_0x7d54c5,null))[_0x2179('0x46')](handleError(_0x7d54c5,null));};exports[_0x2179('0x56')]=function(_0x1deb5c,_0x42aaef,_0x47f9ae){var _0x21f6ae={};var _0x3554bd={};var _0x149168;var _0x21ad93;return db['CmCompany']['findOne']({'where':{'id':_0x1deb5c[_0x2179('0x48')]['id']}})[_0x2179('0x26')](handleEntityNotFound(_0x42aaef,null))[_0x2179('0x26')](function(_0x2780b0){if(_0x2780b0){_0x149168=_0x2780b0;_0x3554bd[_0x2179('0x32')]=_['keys'](db[_0x2179('0x54')]['rawAttributes']);_0x3554bd['query']=_['keys'](_0x1deb5c[_0x2179('0x34')]);_0x3554bd['filters']=_[_0x2179('0x36')](_0x3554bd[_0x2179('0x32')],_0x3554bd['query']);_0x21f6ae['attributes']=_[_0x2179('0x36')](_0x3554bd['model'],qs[_0x2179('0x38')](_0x1deb5c[_0x2179('0x34')][_0x2179('0x38')]));_0x21f6ae['attributes']=_0x21f6ae[_0x2179('0x37')][_0x2179('0x39')]?_0x21f6ae[_0x2179('0x37')]:_0x3554bd[_0x2179('0x32')];_0x21f6ae[_0x2179('0x3c')]=qs[_0x2179('0x3d')](_0x1deb5c[_0x2179('0x34')][_0x2179('0x3d')]);_0x21f6ae['where']=qs['filters'](_['pick'](_0x1deb5c[_0x2179('0x34')],_0x3554bd['filters']));if(_0x1deb5c[_0x2179('0x34')][_0x2179('0x57')]){_0x21f6ae[_0x2179('0x3e')]=_['merge'](_0x21f6ae[_0x2179('0x3e')],{'$or':_[_0x2179('0x3f')](_0x21f6ae[_0x2179('0x37')],function(_0x4945e1){var _0x30bf8a={};_0x30bf8a[_0x4945e1]={'$like':'%'+_0x1deb5c[_0x2179('0x34')][_0x2179('0x57')]+'%'};return _0x30bf8a;})});}_0x21f6ae=_[_0x2179('0x40')]({},_0x21f6ae,_0x1deb5c[_0x2179('0x41')]);return _0x149168[_0x2179('0x56')](_0x21f6ae);}})[_0x2179('0x26')](function(_0x402498){if(_0x402498){_0x21ad93=_0x402498[_0x2179('0x39')];if(!_0x1deb5c[_0x2179('0x34')][_0x2179('0x3a')](_0x2179('0x3b'))){_0x21f6ae[_0x2179('0x1d')]=qs['limit'](_0x1deb5c['query'][_0x2179('0x1d')]);_0x21f6ae[_0x2179('0x1f')]=qs[_0x2179('0x1f')](_0x1deb5c[_0x2179('0x34')][_0x2179('0x1f')]);}return _0x149168[_0x2179('0x56')](_0x21f6ae);}})[_0x2179('0x26')](function(_0x1cc9ee){if(_0x1cc9ee){return _0x1cc9ee?{'count':_0x21ad93,'rows':_0x1cc9ee}:null;}})[_0x2179('0x26')](respondWithResult(_0x42aaef,null))[_0x2179('0x46')](handleError(_0x42aaef,null));}; \ No newline at end of file +var _0xa00f=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','Content-Range','json','reject','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','stack','name','CmCompany','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','filter','options','includeAll','include','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa00f,0x1aa));var _0xfa00=function(_0x2bdb63,_0x51b131){_0x2bdb63=_0x2bdb63-0x0;var _0x81a804=_0xa00f[_0x2bdb63];return _0x81a804;};'use strict';var emlformat=require(_0xfa00('0x0'));var rimraf=require(_0xfa00('0x1'));var zipdir=require(_0xfa00('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa00('0x3'));var moment=require(_0xfa00('0x4'));var BPromise=require(_0xfa00('0x5'));var Mustache=require(_0xfa00('0x6'));var util=require(_0xfa00('0x7'));var path=require(_0xfa00('0x8'));var sox=require(_0xfa00('0x9'));var csv=require(_0xfa00('0xa'));var ejs=require(_0xfa00('0xb'));var fs=require('fs');var fs_extra=require(_0xfa00('0xc'));var _=require(_0xfa00('0xd'));var squel=require(_0xfa00('0xe'));var crypto=require(_0xfa00('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xfa00('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfa00('0x11'));var Redis=require(_0xfa00('0x12'));var authService=require(_0xfa00('0x13'));var qs=require(_0xfa00('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa00('0x15'));var logger=require(_0xfa00('0x16'))('api');var utils=require(_0xfa00('0x17'));var config=require(_0xfa00('0x18'));var licenseUtil=require(_0xfa00('0x19'));var db=require(_0xfa00('0x1a'))['db'];function respondWithStatusCode(_0x433801,_0x565df8){_0x565df8=_0x565df8||0xcc;return function(_0x2f2415){if(_0x2f2415){return _0x433801['sendStatus'](_0x565df8);}return _0x433801[_0xfa00('0x1b')](_0x565df8)[_0xfa00('0x1c')]();};}function respondWithResult(_0x56f72d,_0x2588f9){_0x2588f9=_0x2588f9||0xc8;return function(_0x58b9a6){if(_0x58b9a6){return _0x56f72d[_0xfa00('0x1b')](_0x2588f9)['json'](_0x58b9a6);}};}function respondWithFilteredResult(_0x1c88de,_0x2f8448){return function(_0x321825){if(_0x321825){var _0x5652e0=typeof _0x2f8448[_0xfa00('0x1d')]==='undefined'&&typeof _0x2f8448['limit']===_0xfa00('0x1e');var _0x4e2a0b=_0x321825[_0xfa00('0x1f')];var _0x2f1a23=_0x5652e0?0x0:_0x2f8448[_0xfa00('0x1d')];var _0x314c9d=_0x5652e0?_0x321825[_0xfa00('0x1f')]:_0x2f8448[_0xfa00('0x1d')]+_0x2f8448['limit'];var _0x3030fe;if(_0x314c9d>=_0x4e2a0b){_0x314c9d=_0x4e2a0b;_0x3030fe=0xc8;}else{_0x3030fe=0xce;}_0x1c88de[_0xfa00('0x1b')](_0x3030fe);return _0x1c88de['set'](_0xfa00('0x20'),_0x2f1a23+'-'+_0x314c9d+'/'+_0x4e2a0b)[_0xfa00('0x21')](_0x321825);}return null;};}function patchUpdates(_0x55f620){return function(_0x329693){try{jsonpatch['apply'](_0x329693,_0x55f620,!![]);}catch(_0x44bd47){return BPromise[_0xfa00('0x22')](_0x44bd47);}return _0x329693[_0xfa00('0x23')]();};}function saveUpdates(_0x11b47a,_0xde9059){return function(_0x38b907){if(_0x38b907){return _0x38b907[_0xfa00('0x24')](_0x11b47a)[_0xfa00('0x25')](function(_0x58ae44){return _0x58ae44;});}return null;};}function removeEntity(_0x36193d,_0x423efe){return function(_0x436d49){if(_0x436d49){return _0x436d49[_0xfa00('0x26')]()[_0xfa00('0x25')](function(){var _0x5204e6=_0x436d49[_0xfa00('0x27')]({'plain':!![]});var _0xa7055=_0xfa00('0x28');return db[_0xfa00('0x29')][_0xfa00('0x26')]({'where':{'type':_0xa7055,'resourceId':_0x5204e6['id']}})[_0xfa00('0x25')](function(){return _0x436d49;});})[_0xfa00('0x25')](function(){_0x36193d['status'](0xcc)[_0xfa00('0x1c')]();});}};}function handleEntityNotFound(_0x4d83c5,_0xfd613f){return function(_0x3c4305){if(!_0x3c4305){_0x4d83c5[_0xfa00('0x2a')](0x194);}return _0x3c4305;};}function handleError(_0x343c92,_0x588baa){_0x588baa=_0x588baa||0x1f4;return function(_0x3c3720){logger['error'](_0x3c3720[_0xfa00('0x2b')]);if(_0x3c3720['name']){delete _0x3c3720[_0xfa00('0x2c')];}_0x343c92[_0xfa00('0x1b')](_0x588baa)['send'](_0x3c3720);};}exports['index']=function(_0x133b15,_0x3bc48d){var _0x28c86e={},_0x1b55dc={},_0x25f8c9={'count':0x0,'rows':[]};return db[_0xfa00('0x2d')]['describe']()[_0xfa00('0x25')](function(_0x41776b){_0x1b55dc[_0xfa00('0x2e')]=_[_0xfa00('0x2f')](_0x41776b);_0x1b55dc['query']=_[_0xfa00('0x2f')](_0x133b15[_0xfa00('0x30')]);_0x1b55dc[_0xfa00('0x31')]=_[_0xfa00('0x32')](_0x1b55dc['model'],_0x1b55dc['query']);_0x28c86e['attributes']=_['intersection'](_0x1b55dc[_0xfa00('0x2e')],qs[_0xfa00('0x33')](_0x133b15[_0xfa00('0x30')][_0xfa00('0x33')]));_0x28c86e['attributes']=_0x28c86e[_0xfa00('0x34')][_0xfa00('0x35')]?_0x28c86e[_0xfa00('0x34')]:_0x1b55dc[_0xfa00('0x2e')];if(!_0x133b15[_0xfa00('0x30')][_0xfa00('0x36')](_0xfa00('0x37'))){_0x28c86e[_0xfa00('0x38')]=qs['limit'](_0x133b15[_0xfa00('0x30')][_0xfa00('0x38')]);_0x28c86e['offset']=qs[_0xfa00('0x1d')](_0x133b15[_0xfa00('0x30')][_0xfa00('0x1d')]);}_0x28c86e[_0xfa00('0x39')]=qs[_0xfa00('0x3a')](_0x133b15[_0xfa00('0x30')][_0xfa00('0x3a')]);_0x28c86e[_0xfa00('0x3b')]=qs[_0xfa00('0x31')](_[_0xfa00('0x3c')](_0x133b15[_0xfa00('0x30')],_0x1b55dc[_0xfa00('0x31')]),_0x41776b);if(_0x133b15[_0xfa00('0x30')]['filter']){_0x28c86e[_0xfa00('0x3b')]=_[_0xfa00('0x3d')](_0x28c86e[_0xfa00('0x3b')],{'$or':_[_0xfa00('0x3e')](_0x28c86e[_0xfa00('0x34')],function(_0x18c7cd){var _0x282493={};_0x282493[_0x18c7cd]={'$like':'%'+_0x133b15[_0xfa00('0x30')][_0xfa00('0x3f')]+'%'};return _0x282493;})});}_0x28c86e=_['merge']({},_0x28c86e,_0x133b15[_0xfa00('0x40')]);var _0x470a9d={'where':_0x28c86e[_0xfa00('0x3b')]};return db[_0xfa00('0x2d')]['count'](_0x470a9d)[_0xfa00('0x25')](function(_0x4de21d){_0x25f8c9[_0xfa00('0x1f')]=_0x4de21d;if(_0x133b15[_0xfa00('0x30')][_0xfa00('0x41')]){_0x28c86e[_0xfa00('0x42')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x28c86e);})[_0xfa00('0x25')](function(_0x2e2a03){_0x25f8c9[_0xfa00('0x43')]=_0x2e2a03;return _0x25f8c9;})[_0xfa00('0x25')](respondWithFilteredResult(_0x3bc48d,_0x28c86e))[_0xfa00('0x44')](handleError(_0x3bc48d,null));})['catch'](handleError(_0x3bc48d,null));};exports[_0xfa00('0x45')]=function(_0x120ea2,_0x3d04f8){var _0xec4704={'raw':![],'where':{'id':_0x120ea2[_0xfa00('0x46')]['id']}},_0x3048d3={};_0x3048d3[_0xfa00('0x2e')]=_[_0xfa00('0x2f')](db[_0xfa00('0x2d')]['rawAttributes']);_0x3048d3[_0xfa00('0x30')]=_[_0xfa00('0x2f')](_0x120ea2[_0xfa00('0x30')]);_0x3048d3[_0xfa00('0x31')]=_[_0xfa00('0x32')](_0x3048d3['model'],_0x3048d3[_0xfa00('0x30')]);_0xec4704[_0xfa00('0x34')]=_[_0xfa00('0x32')](_0x3048d3['model'],qs['fields'](_0x120ea2['query'][_0xfa00('0x33')]));_0xec4704[_0xfa00('0x34')]=_0xec4704[_0xfa00('0x34')][_0xfa00('0x35')]?_0xec4704['attributes']:_0x3048d3[_0xfa00('0x2e')];if(_0x120ea2['query']['includeAll']){_0xec4704[_0xfa00('0x42')]=[{'all':!![]}];}_0xec4704=_[_0xfa00('0x3d')]({},_0xec4704,_0x120ea2[_0xfa00('0x40')]);return db[_0xfa00('0x2d')]['find'](_0xec4704)[_0xfa00('0x25')](handleEntityNotFound(_0x3d04f8,null))[_0xfa00('0x25')](respondWithResult(_0x3d04f8,null))[_0xfa00('0x44')](handleError(_0x3d04f8,null));};exports[_0xfa00('0x47')]=function(_0x243bb6,_0x284883){return db[_0xfa00('0x2d')][_0xfa00('0x47')](_0x243bb6[_0xfa00('0x48')],{})['then'](function(_0x15c4bb){var _0x2c1c8d=_0x243bb6[_0xfa00('0x49')]['get']({'plain':!![]});if(!_0x2c1c8d)throw new Error(_0xfa00('0x4a'));if(_0x2c1c8d[_0xfa00('0x4b')]===_0xfa00('0x49')){var _0x107beb=_0x15c4bb['get']({'plain':!![]});var _0x28423f='Companies';return db[_0xfa00('0x4c')]['find']({'where':{'name':_0x28423f,'userProfileId':_0x2c1c8d[_0xfa00('0x4d')]},'raw':!![]})['then'](function(_0x80ee9c){if(_0x80ee9c&&_0x80ee9c['autoAssociation']===0x0){return db[_0xfa00('0x29')][_0xfa00('0x47')]({'name':_0x107beb['name'],'resourceId':_0x107beb['id'],'type':_0x80ee9c[_0xfa00('0x2c')],'sectionId':_0x80ee9c['id']},{})[_0xfa00('0x25')](function(){return _0x15c4bb;});}else{return _0x15c4bb;}})['catch'](function(_0x1a7ad0){logger[_0xfa00('0x4e')](_0xfa00('0x4f'),_0x1a7ad0);throw _0x1a7ad0;});}return _0x15c4bb;})[_0xfa00('0x25')](respondWithResult(_0x284883,0xc9))[_0xfa00('0x44')](handleError(_0x284883,null));};exports['update']=function(_0x63ca1d,_0x32547f){if(_0x63ca1d[_0xfa00('0x48')]['id']){delete _0x63ca1d[_0xfa00('0x48')]['id'];}return db[_0xfa00('0x2d')]['find']({'where':{'id':_0x63ca1d[_0xfa00('0x46')]['id']}})['then'](handleEntityNotFound(_0x32547f,null))[_0xfa00('0x25')](saveUpdates(_0x63ca1d['body'],null))[_0xfa00('0x25')](respondWithResult(_0x32547f,null))[_0xfa00('0x44')](handleError(_0x32547f,null));};exports['destroy']=function(_0x44d4f3,_0x5cf761){return db['CmCompany'][_0xfa00('0x50')]({'where':{'id':_0x44d4f3[_0xfa00('0x46')]['id']}})['then'](handleEntityNotFound(_0x5cf761,null))[_0xfa00('0x25')](removeEntity(_0x5cf761,null))[_0xfa00('0x44')](handleError(_0x5cf761,null));};exports[_0xfa00('0x51')]=function(_0x2bb63f,_0x19afd2){return db[_0xfa00('0x2d')][_0xfa00('0x51')]()[_0xfa00('0x25')](respondWithResult(_0x19afd2,null))[_0xfa00('0x44')](handleError(_0x19afd2,null));};exports[_0xfa00('0x52')]=function(_0x1509c1,_0x47514a,_0x4b058c){return db[_0xfa00('0x53')][_0xfa00('0x50')]({'where':{'id':_0x1509c1[_0xfa00('0x46')]['id']}})['then'](handleEntityNotFound(_0x47514a,null))[_0xfa00('0x25')](function(_0x562a6b){if(_0x562a6b){return _0x562a6b[_0xfa00('0x52')](_0x1509c1[_0xfa00('0x48')][_0xfa00('0x54')],_[_0xfa00('0x55')](_0x1509c1[_0xfa00('0x48')],[_0xfa00('0x54'),'id'])||{});}})[_0xfa00('0x25')](respondWithResult(_0x47514a,null))[_0xfa00('0x44')](handleError(_0x47514a,null));};exports[_0xfa00('0x56')]=function(_0x299ffd,_0x35a3e7,_0x26769a){var _0x306802={};var _0x4bfbb9={};var _0x297faa;var _0x272e56;return db[_0xfa00('0x2d')][_0xfa00('0x57')]({'where':{'id':_0x299ffd[_0xfa00('0x46')]['id']}})[_0xfa00('0x25')](handleEntityNotFound(_0x35a3e7,null))[_0xfa00('0x25')](function(_0x163671){if(_0x163671){_0x297faa=_0x163671;_0x4bfbb9[_0xfa00('0x2e')]=_[_0xfa00('0x2f')](db['CmContact'][_0xfa00('0x58')]);_0x4bfbb9['query']=_[_0xfa00('0x2f')](_0x299ffd[_0xfa00('0x30')]);_0x4bfbb9[_0xfa00('0x31')]=_[_0xfa00('0x32')](_0x4bfbb9['model'],_0x4bfbb9[_0xfa00('0x30')]);_0x306802[_0xfa00('0x34')]=_['intersection'](_0x4bfbb9[_0xfa00('0x2e')],qs[_0xfa00('0x33')](_0x299ffd[_0xfa00('0x30')][_0xfa00('0x33')]));_0x306802[_0xfa00('0x34')]=_0x306802[_0xfa00('0x34')]['length']?_0x306802[_0xfa00('0x34')]:_0x4bfbb9[_0xfa00('0x2e')];_0x306802[_0xfa00('0x39')]=qs[_0xfa00('0x3a')](_0x299ffd[_0xfa00('0x30')]['sort']);_0x306802['where']=qs[_0xfa00('0x31')](_['pick'](_0x299ffd[_0xfa00('0x30')],_0x4bfbb9[_0xfa00('0x31')]));if(_0x299ffd[_0xfa00('0x30')][_0xfa00('0x3f')]){_0x306802[_0xfa00('0x3b')]=_[_0xfa00('0x3d')](_0x306802[_0xfa00('0x3b')],{'$or':_[_0xfa00('0x3e')](_0x306802[_0xfa00('0x34')],function(_0xe76989){var _0x154973={};_0x154973[_0xe76989]={'$like':'%'+_0x299ffd['query'][_0xfa00('0x3f')]+'%'};return _0x154973;})});}_0x306802=_[_0xfa00('0x3d')]({},_0x306802,_0x299ffd[_0xfa00('0x40')]);return _0x297faa[_0xfa00('0x56')](_0x306802);}})[_0xfa00('0x25')](function(_0x3e3cd7){if(_0x3e3cd7){_0x272e56=_0x3e3cd7[_0xfa00('0x35')];if(!_0x299ffd['query'][_0xfa00('0x36')](_0xfa00('0x37'))){_0x306802[_0xfa00('0x38')]=qs[_0xfa00('0x38')](_0x299ffd[_0xfa00('0x30')][_0xfa00('0x38')]);_0x306802[_0xfa00('0x1d')]=qs[_0xfa00('0x1d')](_0x299ffd[_0xfa00('0x30')]['offset']);}return _0x297faa[_0xfa00('0x56')](_0x306802);}})[_0xfa00('0x25')](function(_0x58fb5d){if(_0x58fb5d){return _0x58fb5d?{'count':_0x272e56,'rows':_0x58fb5d}:null;}})[_0xfa00('0x25')](respondWithResult(_0x35a3e7,null))['catch'](handleError(_0x35a3e7,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index ec788dc..775cbe9 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 _0x01a3=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cmCompany.attributes','exports','CmCompany','cm_companies'];(function(_0xc4cb58,_0x3bac56){var _0x1e68d7=function(_0xeba53d){while(--_0xeba53d){_0xc4cb58['push'](_0xc4cb58['shift']());}};_0x1e68d7(++_0x3bac56);}(_0x01a3,0x9c));var _0x301a=function(_0x2ec688,_0x436cd5){_0x2ec688=_0x2ec688-0x0;var _0x1f9b88=_0x01a3[_0x2ec688];return _0x1f9b88;};'use strict';var _=require(_0x301a('0x0'));var util=require(_0x301a('0x1'));var logger=require(_0x301a('0x2'))(_0x301a('0x3'));var moment=require(_0x301a('0x4'));var BPromise=require(_0x301a('0x5'));var rp=require(_0x301a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x301a('0x7'));var config=require('../../config/environment');var attributes=require(_0x301a('0x8'));module[_0x301a('0x9')]=function(_0x2c6637,_0x56263d){return _0x2c6637['define'](_0x301a('0xa'),attributes,{'tableName':_0x301a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfceb=['bluebird','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment'];(function(_0x4347ec,_0x41c4b8){var _0x4c8314=function(_0x583acd){while(--_0x583acd){_0x4347ec['push'](_0x4347ec['shift']());}};_0x4c8314(++_0x41c4b8);}(_0xfceb,0x1b8));var _0xbfce=function(_0x5e6761,_0xb676b7){_0x5e6761=_0x5e6761-0x0;var _0x2355ed=_0xfceb[_0x5e6761];return _0x2355ed;};'use strict';var _=require(_0xbfce('0x0'));var util=require('util');var logger=require(_0xbfce('0x1'))(_0xbfce('0x2'));var moment=require(_0xbfce('0x3'));var BPromise=require(_0xbfce('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfce('0x5'));var rimraf=require('rimraf');var config=require(_0xbfce('0x6'));var attributes=require(_0xbfce('0x7'));module[_0xbfce('0x8')]=function(_0x3f96ff,_0x2a5369){return _0x3f96ff[_0xbfce('0x9')](_0xbfce('0xa'),attributes,{'tableName':_0xbfce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 68f267a..8c5a498 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 _0x132e=['then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x132e,0x140));var _0xe132=function(_0x1e399a,_0x351c59){_0x1e399a=_0x1e399a-0x0;var _0x539897=_0x132e[_0x1e399a];return _0x539897;};'use strict';var _=require(_0xe132('0x0'));var util=require('util');var moment=require(_0xe132('0x1'));var BPromise=require(_0xe132('0x2'));var rs=require(_0xe132('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe132('0x4'))['db'];var utils=require(_0xe132('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe132('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe132('0x7')][_0xe132('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1cd30d,_0x136d6c,_0x50647c){return new BPromise(function(_0xb508b0,_0x22f0eb){return client[_0xe132('0x9')](_0x1cd30d,_0x50647c)[_0xe132('0xa')](function(_0x682a57){logger[_0xe132('0xb')](_0xe132('0xc'),_0x136d6c,_0xe132('0xd'));logger[_0xe132('0xe')](_0xe132('0xf'),_0x136d6c,_0xe132('0xd'),JSON[_0xe132('0x10')](_0x682a57));if(_0x682a57[_0xe132('0x11')]){if(_0x682a57[_0xe132('0x11')][_0xe132('0x12')]===0x1f4){logger[_0xe132('0x11')](_0xe132('0xc'),_0x136d6c,_0x682a57[_0xe132('0x11')][_0xe132('0x13')]);return _0x22f0eb(_0x682a57['error'][_0xe132('0x13')]);}logger['error'](_0xe132('0xc'),_0x136d6c,_0x682a57[_0xe132('0x11')][_0xe132('0x13')]);return _0xb508b0(_0x682a57[_0xe132('0x11')][_0xe132('0x13')]);}else{logger[_0xe132('0xb')]('CmCompany,\x20%s,\x20%s',_0x136d6c,'request\x20sent');_0xb508b0(_0x682a57[_0xe132('0x14')]['message']);}})[_0xe132('0x15')](function(_0x2a4b7f){logger[_0xe132('0x11')](_0xe132('0xc'),_0x136d6c,_0x2a4b7f);_0x22f0eb(_0x2a4b7f);});});} \ No newline at end of file +var _0x9f30=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9f30,0x10f));var _0x09f3=function(_0x340c60,_0x5762cf){_0x340c60=_0x340c60-0x0;var _0x1f7f21=_0x9f30[_0x340c60];return _0x1f7f21;};'use strict';var _=require(_0x09f3('0x0'));var util=require('util');var moment=require(_0x09f3('0x1'));var BPromise=require(_0x09f3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x09f3('0x3'))['db'];var utils=require(_0x09f3('0x4'));var logger=require(_0x09f3('0x5'))(_0x09f3('0x6'));var config=require(_0x09f3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x09f3('0x8')][_0x09f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4dc6c7,_0x5ce857,_0x1e2c3f){return new BPromise(function(_0x2ba510,_0x2167d6){return client[_0x09f3('0xa')](_0x4dc6c7,_0x1e2c3f)[_0x09f3('0xb')](function(_0x57f7f0){logger[_0x09f3('0xc')]('CmCompany,\x20%s,\x20%s',_0x5ce857,_0x09f3('0xd'));logger[_0x09f3('0xe')](_0x09f3('0xf'),_0x5ce857,'request\x20sent',JSON[_0x09f3('0x10')](_0x57f7f0));if(_0x57f7f0[_0x09f3('0x11')]){if(_0x57f7f0[_0x09f3('0x11')][_0x09f3('0x12')]===0x1f4){logger[_0x09f3('0x11')]('CmCompany,\x20%s,\x20%s',_0x5ce857,_0x57f7f0[_0x09f3('0x11')][_0x09f3('0x13')]);return _0x2167d6(_0x57f7f0['error']['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x5ce857,_0x57f7f0[_0x09f3('0x11')][_0x09f3('0x13')]);return _0x2ba510(_0x57f7f0[_0x09f3('0x11')][_0x09f3('0x13')]);}else{logger[_0x09f3('0xc')](_0x09f3('0x14'),_0x5ce857,_0x09f3('0xd'));_0x2ba510(_0x57f7f0[_0x09f3('0x15')][_0x09f3('0x13')]);}})[_0x09f3('0x16')](function(_0x57864b){logger[_0x09f3('0x11')](_0x09f3('0x14'),_0x5ce857,_0x57864b);_0x2167d6(_0x57864b);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index e6e6801..9bfe9c0 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 _0x8e24=['show','getContacts','post','create','/:id/contacts','addContacts','put','update','delete','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','/:id'];(function(_0x2bf5df,_0x47b31a){var _0x285a4d=function(_0x5f6daf){while(--_0x5f6daf){_0x2bf5df['push'](_0x2bf5df['shift']());}};_0x285a4d(++_0x47b31a);}(_0x8e24,0x179));var _0x48e2=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0x8e24[_0x1b6311];return _0x25aab6;};'use strict';var multer=require(_0x48e2('0x0'));var util=require(_0x48e2('0x1'));var path=require('path');var timeout=require(_0x48e2('0x2'));var express=require(_0x48e2('0x3'));var router=express['Router']();var fs_extra=require(_0x48e2('0x4'));var auth=require(_0x48e2('0x5'));var interaction=require(_0x48e2('0x6'));var config=require(_0x48e2('0x7'));var controller=require(_0x48e2('0x8'));router['get']('/',auth[_0x48e2('0x9')](),controller[_0x48e2('0xa')]);router[_0x48e2('0xb')](_0x48e2('0xc'),auth[_0x48e2('0x9')](),controller['describe']);router[_0x48e2('0xb')](_0x48e2('0xd'),auth[_0x48e2('0x9')](),controller[_0x48e2('0xe')]);router[_0x48e2('0xb')]('/:id/contacts',auth[_0x48e2('0x9')](),controller[_0x48e2('0xf')]);router[_0x48e2('0x10')]('/',auth[_0x48e2('0x9')](),controller[_0x48e2('0x11')]);router[_0x48e2('0x10')](_0x48e2('0x12'),auth[_0x48e2('0x9')](),controller[_0x48e2('0x13')]);router[_0x48e2('0x14')]('/:id',auth[_0x48e2('0x9')](),controller[_0x48e2('0x15')]);router[_0x48e2('0x16')](_0x48e2('0xd'),auth[_0x48e2('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x030a=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','show','getContacts','post','/:id/contacts','addContacts','put','/:id','update'];(function(_0x5caa8a,_0x5a4fda){var _0x314c4e=function(_0x235579){while(--_0x235579){_0x5caa8a['push'](_0x5caa8a['shift']());}};_0x314c4e(++_0x5a4fda);}(_0x030a,0xc2));var _0xa030=function(_0x487b09,_0x349b11){_0x487b09=_0x487b09-0x0;var _0x28830b=_0x030a[_0x487b09];return _0x28830b;};'use strict';var multer=require(_0xa030('0x0'));var util=require(_0xa030('0x1'));var path=require('path');var timeout=require(_0xa030('0x2'));var express=require('express');var router=express[_0xa030('0x3')]();var fs_extra=require(_0xa030('0x4'));var auth=require(_0xa030('0x5'));var interaction=require(_0xa030('0x6'));var config=require(_0xa030('0x7'));var controller=require(_0xa030('0x8'));router[_0xa030('0x9')]('/',auth['isAuthenticated'](),controller[_0xa030('0xa')]);router['get'](_0xa030('0xb'),auth[_0xa030('0xc')](),controller[_0xa030('0xd')]);router['get']('/:id',auth[_0xa030('0xc')](),controller[_0xa030('0xe')]);router[_0xa030('0x9')]('/:id/contacts',auth[_0xa030('0xc')](),controller[_0xa030('0xf')]);router[_0xa030('0x10')]('/',auth[_0xa030('0xc')](),controller['create']);router[_0xa030('0x10')](_0xa030('0x11'),auth[_0xa030('0xc')](),controller[_0xa030('0x12')]);router[_0xa030('0x13')](_0xa030('0x14'),auth['isAuthenticated'](),controller[_0xa030('0x15')]);router['delete'](_0xa030('0x14'),auth[_0xa030('0xc')](),controller[_0xa030('0x16')]);module[_0xa030('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 4192fdf..6603fc7 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 _0x1fc0=['INTEGER','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0x149f32,_0x4273f7){var _0x11f475=function(_0x18eeef){while(--_0x18eeef){_0x149f32['push'](_0x149f32['shift']());}};_0x11f475(++_0x4273f7);}(_0x1fc0,0x65));var _0x01fc=function(_0x516726,_0x4b8d5d){_0x516726=_0x516726-0x0;var _0x50ee10=_0x1fc0[_0x516726];return _0x50ee10;};'use strict';var _=require(_0x01fc('0x0'));var Sequelize=require(_0x01fc('0x1'));module[_0x01fc('0x2')]={'firstName':{'type':Sequelize[_0x01fc('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x01fc('0x3')]},'street':{'type':Sequelize[_0x01fc('0x3')]},'postalCode':{'type':Sequelize[_0x01fc('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x01fc('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x01fc('0x3')]},'mobile':{'type':Sequelize[_0x01fc('0x3')]},'fax':{'type':Sequelize[_0x01fc('0x3')]},'email':{'type':Sequelize[_0x01fc('0x3')]},'url':{'type':Sequelize[_0x01fc('0x3')]},'facebook':{'type':Sequelize[_0x01fc('0x3')]},'fb_data':{'type':Sequelize[_0x01fc('0x3')]},'twitter':{'type':Sequelize[_0x01fc('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x01fc('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x01fc('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x01fc('0x3')]},'UserId':{'type':Sequelize[_0x01fc('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x01fc('0x3')]},'priority':{'type':Sequelize[_0x01fc('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x01fc('0x5')],'defaultValue':Sequelize[_0x01fc('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x01fc('0x4')]}}; \ No newline at end of file +var _0xb339=['NOW','lodash','sequelize','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x4542f5,_0x5ea961){var _0x49dbe4=function(_0x108ce9){while(--_0x108ce9){_0x4542f5['push'](_0x4542f5['shift']());}};_0x49dbe4(++_0x5ea961);}(_0xb339,0x161));var _0x9b33=function(_0xbc25e1,_0x27007d){_0xbc25e1=_0xbc25e1-0x0;var _0xaf0a85=_0xb339[_0xbc25e1];return _0xaf0a85;};'use strict';var _=require(_0x9b33('0x0'));var Sequelize=require(_0x9b33('0x1'));module[_0x9b33('0x2')]={'firstName':{'type':Sequelize[_0x9b33('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9b33('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x9b33('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x9b33('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x9b33('0x3')]},'mobile':{'type':Sequelize[_0x9b33('0x3')]},'fax':{'type':Sequelize[_0x9b33('0x3')]},'email':{'type':Sequelize[_0x9b33('0x3')]},'url':{'type':Sequelize[_0x9b33('0x3')]},'facebook':{'type':Sequelize[_0x9b33('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x9b33('0x3')]},'skype':{'type':Sequelize[_0x9b33('0x3')]},'teams':{'type':Sequelize[_0x9b33('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x9b33('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x9b33('0x3')]},'priority':{'type':Sequelize[_0x9b33('0x4')](0x2)[_0x9b33('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9b33('0x6')],'defaultValue':Sequelize[_0x9b33('0x7')]},'dialTimezone':{'type':Sequelize[_0x9b33('0x3')]},'utcOffset':{'type':Sequelize[_0x9b33('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 70a49e9..7ce23c5 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(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 a0b5ea4..dd8c2eb 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 _0xfb2d=['CmContact','setMaxListeners','save','update','remove','emit','events','../../mysqldb'];(function(_0x299e65,_0x5bf182){var _0x3a41b6=function(_0x1a2908){while(--_0x1a2908){_0x299e65['push'](_0x299e65['shift']());}};_0x3a41b6(++_0x5bf182);}(_0xfb2d,0x15e));var _0xdfb2=function(_0xaf025d,_0x586d7a){_0xaf025d=_0xaf025d-0x0;var _0x1c77cb=_0xfb2d[_0xaf025d];return _0x1c77cb;};'use strict';var EventEmitter=require(_0xdfb2('0x0'));var CmContact=require(_0xdfb2('0x1'))['db'][_0xdfb2('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xdfb2('0x3')](0x0);var events={'afterCreate':_0xdfb2('0x4'),'afterUpdate':_0xdfb2('0x5'),'afterDestroy':_0xdfb2('0x6')};function emitEvent(_0x5edbb2){return function(_0x1d91bd,_0x1bc16b,_0x3ae49b){CmContactEvents[_0xdfb2('0x7')](_0x5edbb2+':'+_0x1d91bd['id'],_0x1d91bd);CmContactEvents['emit'](_0x5edbb2,_0x1d91bd);_0x3ae49b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x9970=['../../mysqldb','CmContact','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0xb1df7a,_0x7c73b1){var _0x51ecda=function(_0x5797bf){while(--_0x5797bf){_0xb1df7a['push'](_0xb1df7a['shift']());}};_0x51ecda(++_0x7c73b1);}(_0x9970,0xef));var _0x0997=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9970[_0x618414];return _0x21c19a;};'use strict';var EventEmitter=require(_0x0997('0x0'));var CmContact=require(_0x0997('0x1'))['db'][_0x0997('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x0997('0x3')](0x0);var events={'afterCreate':_0x0997('0x4'),'afterUpdate':_0x0997('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2a6cd3){return function(_0x597211,_0x226dcf,_0x47fedd){CmContactEvents[_0x0997('0x6')](_0x2a6cd3+':'+_0x597211['id'],_0x597211);CmContactEvents[_0x0997('0x6')](_0x2a6cd3,_0x597211);_0x47fedd(null);};}for(var e in events){if(events[_0x0997('0x7')](e)){var event=events[e];CmContact[_0x0997('0x8')](e,emitEvent(event));}}module[_0x0997('0x9')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 4862a69..ad5a874 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 _0xc948=['length','CmList','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','findAll','onlyIfOpen','BlackLists','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','timezones','add','then','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','priority','callbackUniqueid','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','catch','afterCreate','utcOffset','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','outbound','dialCheckDuplicateType','Lists'];(function(_0x20ff86,_0x44ab91){var _0xb52be7=function(_0x1ee15b){while(--_0x1ee15b){_0x20ff86['push'](_0x20ff86['shift']());}};_0xb52be7(++_0x44ab91);}(_0xc948,0xb0));var _0x8c94=function(_0x2366bd,_0x330538){_0x2366bd=_0x2366bd-0x0;var _0xca0808=_0xc948[_0x2366bd];return _0xca0808;};'use strict';var _=require(_0x8c94('0x0'));var util=require(_0x8c94('0x1'));var logger=require(_0x8c94('0x2'))(_0x8c94('0x3'));var moment=require(_0x8c94('0x4'));var BPromise=require(_0x8c94('0x5'));var rp=require(_0x8c94('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c94('0x7'));var config=require(_0x8c94('0x8'));var shared=require('../../config/environment/shared');var attributes=require(_0x8c94('0x9'));module[_0x8c94('0xa')]=function(_0x1d1f11,_0x57274a){return _0x1d1f11[_0x8c94('0xb')](_0x8c94('0xc'),attributes,{'tableName':_0x8c94('0xd'),'paranoid':!![],'indexes':[{'name':_0x8c94('0xe'),'fields':['phone']},{'name':_0x8c94('0xf'),'fields':[_0x8c94('0x10'),_0x8c94('0x11'),_0x8c94('0xe'),'mobile',_0x8c94('0x12'),_0x8c94('0x13')],'type':_0x8c94('0x14')}],'timestamps':!![],'charset':_0x8c94('0x15'),'collate':_0x8c94('0x16'),'hooks':{'afterCreate':function(_0x2da5e8,_0x3fe689,_0x5eadb9){var _0x385b9e=_0x1d1f11[_0x8c94('0x17')];var _0x1c0067=_0x2da5e8[_0x8c94('0x18')]({'plain':!![]});function _0x5983bb(){return function(_0xe4a163){logger[_0x8c94('0x19')](_0x8c94('0x1a'),'afterCreate',util[_0x8c94('0x1b')](_0xe4a163,{'showHidden':![],'depth':null}));};}function _0x346d15(_0xa30ac2,_0x3a9494){var _0x1c91c9=_0x3a9494[_0x8c94('0x1c')]?_0x3a9494[_0x8c94('0x1c')]:moment()[_0x8c94('0x1d')](_0x8c94('0x1e'));return new BPromise(function(_0x1ea91d,_0x2daff9){if(_[_0x8c94('0x1f')](_0x3a9494[_0x8c94('0x20')])){_0x1ea91d({'ret':_0x1c91c9});}else{_0x385b9e[_0x8c94('0x21')][_0x8c94('0x22')]({'where':{'id':_0xa30ac2['id']}})['then'](function(_0x4188d7){if(!_[_0x8c94('0x1f')](_0x4188d7)){var _0x48d609=_0x4188d7[_0x8c94('0x20')];if(!_[_0x8c94('0x1f')](_0x48d609)){var _0x2eb4da=shared[_0x8c94('0x23')];var _0x37d088=_0x2eb4da[_0x48d609];var _0x1e942d=_0x2eb4da[_0x3a9494[_0x8c94('0x20')]];if(!_[_0x8c94('0x1f')](_0x37d088)&&!_['isNil'](_0x1e942d)){var _0x32fed3=_0x37d088['utcOffset']-_0x1e942d['utcOffset'];_0x1c91c9=_0x3a9494['scheduledat']?_0x3a9494['scheduledat']:moment();var _0x12a0b4=moment(_0x1c91c9)[_0x8c94('0x24')](_0x32fed3,'minutes');_0x1ea91d({'ret':_0x12a0b4[_0x8c94('0x1d')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1ea91d({'ret':_0x1c91c9});}else _0x1ea91d({'ret':_0x1c91c9});}else{_0x1ea91d({'ret':_0x1c91c9});}});}});return 0xa;}var _0x17e30a=function(_0x652d17){return new BPromise(function(_0x317454,_0x35b6de){_0x346d15(_0x652d17,_0x1c0067)[_0x8c94('0x25')](function(_0x5c0f7c){_0x1c0067[_0x8c94('0x1c')]=_0x5c0f7c[_0x8c94('0x26')];_0x385b9e['CmHopper'][_0x8c94('0x22')]({'where':{'phone':_0x1c0067[_0x8c94('0xe')],'VoiceQueueId':_0x652d17['id']}})[_0x8c94('0x25')](function(_0x43303e){if(!_['isNil'](_0x43303e)){throw new Error(_0x8c94('0x27')+_0x1c0067['phone']+_0x8c94('0x28')+_0x652d17['id']);}return _0x385b9e[_0x8c94('0x29')][_0x8c94('0x2a')]({'phone':_0x1c0067[_0x8c94('0xe')],'ContactId':_0x1c0067['id'],'ListId':_0x1c0067[_0x8c94('0x2b')],'priority':_0x1c0067['priority']?_0x1c0067[_0x8c94('0x2c')]:0x2,'scheduledat':_0x1c0067[_0x8c94('0x1c')]?_0x1c0067['scheduledat']:moment()[_0x8c94('0x1d')](_0x8c94('0x1e')),'callback':_0x1c0067[_0x8c94('0x2d')]?!![]:![],'callbackuniqueid':_0x1c0067[_0x8c94('0x2d')]?_0x1c0067[_0x8c94('0x2d')]:undefined,'callbackat':_0x1c0067[_0x8c94('0x2d')]?moment()[_0x8c94('0x1d')](_0x8c94('0x1e')):undefined,'VoiceQueueId':_0x652d17['id']});})['catch'](function(_0x27d35d){_0x35b6de(_0x27d35d);});});});};var _0x40ae15=function(_0x36f6bd){return new BPromise(function(_0xdaf764,_0x1b4633){_0x346d15(_0x36f6bd,_0x1c0067)[_0x8c94('0x25')](function(_0x37c53d){_0x1c0067['scheduledat']=_0x37c53d[_0x8c94('0x26')];_0x385b9e[_0x8c94('0x29')]['findOne']({'where':{'phone':_0x1c0067['phone'],'VoiceQueueId':_0x36f6bd['id']}})[_0x8c94('0x25')](function(_0x18276b){if(!_['isNil'](_0x18276b)){throw new Error(_0x8c94('0x27')+_0x1c0067[_0x8c94('0xe')]+_0x8c94('0x2e')+_0x36f6bd['id']);}return _0x385b9e[_0x8c94('0x2f')][_0x8c94('0x22')]({'where':{'calleridnum':_0x1c0067['phone'],'VoiceQueueId':_0x36f6bd['id']}});})[_0x8c94('0x25')](function(_0x4c3d6){if(!_[_0x8c94('0x1f')](_0x4c3d6)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x1c0067[_0x8c94('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x36f6bd['id']);}return _0x385b9e[_0x8c94('0x29')][_0x8c94('0x2a')]({'phone':_0x1c0067[_0x8c94('0xe')],'ContactId':_0x1c0067['id'],'ListId':_0x1c0067['ListId'],'priority':_0x1c0067[_0x8c94('0x2c')]?_0x1c0067[_0x8c94('0x2c')]:0x2,'scheduledat':_0x1c0067['scheduledat']?_0x1c0067['scheduledat']:moment()[_0x8c94('0x1d')](_0x8c94('0x1e')),'callback':_0x1c0067[_0x8c94('0x2d')]?!![]:![],'callbackuniqueid':_0x1c0067[_0x8c94('0x2d')]?_0x1c0067['callbackUniqueid']:undefined,'callbackat':_0x1c0067[_0x8c94('0x2d')]?moment()[_0x8c94('0x1d')](_0x8c94('0x1e')):undefined,'VoiceQueueId':_0x36f6bd['id']});})[_0x8c94('0x30')](function(_0x15c524){_0x1b4633(_0x15c524);});});});};function _0xabb1b8(){return function(_0x2da028){logger['error'](_0x8c94('0x1a'),_0x8c94('0x31'),util[_0x8c94('0x1b')](_0x2da028,{'showHidden':![],'depth':null}));};}function _0x52e136(_0x1c8da5,_0x4b7c51){var _0x335692=_0x4b7c51['scheduledat']?_0x4b7c51[_0x8c94('0x1c')]:moment()[_0x8c94('0x1d')](_0x8c94('0x1e'));return new BPromise(function(_0x5eec51,_0x2f5966){if(_[_0x8c94('0x1f')](_0x4b7c51[_0x8c94('0x20')])){_0x5eec51({'ret':_0x335692});}else{_0x385b9e['Campaign'][_0x8c94('0x22')]({'where':{'id':_0x1c8da5['id']}})[_0x8c94('0x25')](function(_0x3ae052){if(!_[_0x8c94('0x1f')](_0x3ae052)){var _0xabed1a=_0x3ae052[_0x8c94('0x20')];if(!_['isNil'](_0xabed1a)){var _0x1cf119=shared[_0x8c94('0x23')];var _0x546e98=_0x1cf119[_0xabed1a];var _0x51d2ab=_0x1cf119[_0x4b7c51['dialTimezone']];if(!_[_0x8c94('0x1f')](_0x546e98)&&!_[_0x8c94('0x1f')](_0x51d2ab)){var _0x3b937a=_0x546e98[_0x8c94('0x32')]-_0x51d2ab[_0x8c94('0x32')];_0x335692=_0x4b7c51['scheduledat']?_0x4b7c51['scheduledat']:moment();var _0x13e366=moment(_0x335692)[_0x8c94('0x24')](_0x3b937a,'minutes');_0x5eec51({'ret':_0x13e366[_0x8c94('0x1d')](_0x8c94('0x1e'))});}else _0x5eec51({'ret':_0x335692});}else _0x5eec51({'ret':_0x335692});}else{_0x5eec51({'ret':_0x335692});}});}});return 0xa;}var _0x1b8d35=function(_0x3ad6aa){return new BPromise(function(_0x2cd30d,_0x4d304c){_0x52e136(_0x3ad6aa,_0x1c0067)['then'](function(_0xa5dcbe){_0x1c0067[_0x8c94('0x1c')]=_0xa5dcbe['ret'];_0x385b9e[_0x8c94('0x29')][_0x8c94('0x22')]({'where':{'phone':_0x1c0067['phone'],'CampaignId':_0x3ad6aa['id']}})[_0x8c94('0x25')](function(_0x2419af){if(!_[_0x8c94('0x1f')](_0x2419af)){throw new Error(_0x8c94('0x27')+_0x1c0067['phone']+_0x8c94('0x33')+_0x3ad6aa['id']);}return _0x385b9e['CmHopper'][_0x8c94('0x2a')]({'phone':_0x1c0067[_0x8c94('0xe')],'ContactId':_0x1c0067['id'],'ListId':_0x1c0067[_0x8c94('0x2b')],'priority':_0x1c0067[_0x8c94('0x2c')]?_0x1c0067[_0x8c94('0x2c')]:0x2,'scheduledat':_0x1c0067[_0x8c94('0x1c')]?_0x1c0067[_0x8c94('0x1c')]:moment()[_0x8c94('0x1d')](_0x8c94('0x1e')),'callback':_0x1c0067[_0x8c94('0x2d')]?!![]:![],'callbackuniqueid':_0x1c0067[_0x8c94('0x2d')]?_0x1c0067[_0x8c94('0x2d')]:undefined,'callbackat':_0x1c0067[_0x8c94('0x2d')]?moment()[_0x8c94('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x3ad6aa['id']});})[_0x8c94('0x30')](function(_0x50a285){_0x4d304c(_0x50a285);});});});};var _0xac0a6b=function(_0x9b1c87){return new BPromise(function(_0x4a23fa,_0x3423ed){_0x52e136(_0x9b1c87,_0x1c0067)['then'](function(_0x3259f3){_0x1c0067['scheduledat']=_0x3259f3[_0x8c94('0x26')];_0x385b9e[_0x8c94('0x29')]['findOne']({'where':{'phone':_0x1c0067[_0x8c94('0xe')],'CampaignId':_0x9b1c87['id']}})[_0x8c94('0x25')](function(_0x192cfe){if(!_[_0x8c94('0x1f')](_0x192cfe)){throw new Error(_0x8c94('0x27')+_0x1c0067[_0x8c94('0xe')]+_0x8c94('0x34')+_0x9b1c87['id']);}return _0x385b9e['CmHopperFinal'][_0x8c94('0x22')]({'where':{'calleridnum':_0x1c0067['phone'],'CampaignId':_0x9b1c87['id']}});})[_0x8c94('0x25')](function(_0x32f2ae){if(!_['isNil'](_0x32f2ae)){throw new Error(_0x8c94('0x35')+_0x1c0067[_0x8c94('0xe')]+_0x8c94('0x36')+_0x9b1c87['id']);}return _0x385b9e['CmHopper']['create']({'phone':_0x1c0067[_0x8c94('0xe')],'ContactId':_0x1c0067['id'],'ListId':_0x1c0067['ListId'],'priority':_0x1c0067['priority']?_0x1c0067[_0x8c94('0x2c')]:0x2,'scheduledat':_0x1c0067['scheduledat']?_0x1c0067[_0x8c94('0x1c')]:moment()[_0x8c94('0x1d')](_0x8c94('0x1e')),'callback':_0x1c0067[_0x8c94('0x2d')]?!![]:![],'callbackuniqueid':_0x1c0067[_0x8c94('0x2d')]?_0x1c0067[_0x8c94('0x2d')]:undefined,'callbackat':_0x1c0067[_0x8c94('0x2d')]?moment()[_0x8c94('0x1d')](_0x8c94('0x1e')):undefined,'CampaignId':_0x9b1c87['id']});})['catch'](function(_0x14259d){_0x3423ed(_0x14259d);});});});};if(_0x1c0067[_0x8c94('0x2b')]){_0x385b9e['VoiceQueue']['findAll']({'where':{'type':_0x8c94('0x37')},'attributes':['id',_0x8c94('0x38'),_0x8c94('0x20')],'include':[{'model':_0x385b9e['CmList'],'as':_0x8c94('0x39'),'where':{'id':_0x1c0067[_0x8c94('0x2b')]}}]})['then'](function(_0x5b18e6){if(_0x5b18e6){var _0x396a77=[];for(var _0xa6e483=0x0,_0x22d8c3;_0xa6e483<_0x5b18e6[_0x8c94('0x3a')];_0xa6e483+=0x1){_0x22d8c3=_0x5b18e6[_0xa6e483][_0x8c94('0x18')]({'plain':!![]});switch(_0x22d8c3[_0x8c94('0x38')]){case'always':_0x40ae15(_0x22d8c3)['catch'](_0x5983bb());break;case'onlyIfOpen':_0x17e30a(_0x22d8c3)[_0x8c94('0x30')](_0x5983bb());break;default:_0x52e136(_0x22d8c3,_0x1c0067)['then'](function(_0x3d7055){_0x1c0067[_0x8c94('0x1c')]=_0x3d7055['ret'];_0x385b9e[_0x8c94('0x29')]['create']({'phone':_0x1c0067[_0x8c94('0xe')],'ContactId':_0x1c0067['id'],'ListId':_0x1c0067['ListId'],'scheduledat':_0x1c0067['scheduledat']?_0x1c0067[_0x8c94('0x1c')]:moment()['format'](_0x8c94('0x1e')),'priority':_0x1c0067['priority']?_0x1c0067[_0x8c94('0x2c')]:0x2,'callback':_0x1c0067[_0x8c94('0x2d')]?!![]:![],'callbackuniqueid':_0x1c0067['callbackUniqueid']?_0x1c0067[_0x8c94('0x2d')]:undefined,'callbackat':_0x1c0067[_0x8c94('0x2d')]?moment()[_0x8c94('0x1d')](_0x8c94('0x1e')):undefined,'VoiceQueueId':_0x22d8c3['id']})[_0x8c94('0x30')](_0x5983bb());});}}}})[_0x8c94('0x25')](function(){return _0x385b9e[_0x8c94('0x21')]['findAll']({'where':{'type':_0x8c94('0x37')},'attributes':['id'],'include':[{'model':_0x385b9e[_0x8c94('0x3b')],'as':'BlackLists','where':{'id':_0x1c0067['ListId']}}]})['then'](function(_0x1917d4){if(_0x1917d4){var _0x11ddf6=[];for(var _0x41fc5d=0x0,_0x4e57f6;_0x41fc5d<_0x1917d4['length'];_0x41fc5d+=0x1){_0x4e57f6=_0x1917d4[_0x41fc5d][_0x8c94('0x18')]({'plain':!![]});_0x385b9e[_0x8c94('0x3c')]['create']({'phone':_0x1c0067[_0x8c94('0xe')],'ContactId':_0x1c0067['id'],'ListId':_0x1c0067[_0x8c94('0x2b')],'VoiceQueueId':_0x4e57f6['id']})[_0x8c94('0x30')](function(_0x295183){logger[_0x8c94('0x19')](_0x8c94('0x3d'),'afterCreate',_0x295183[_0x8c94('0x3e')]);});}}});})[_0x8c94('0x25')](function(){return _0x385b9e[_0x8c94('0x3f')][_0x8c94('0x40')]({'attributes':['id','dialCheckDuplicateType',_0x8c94('0x20')],'include':[{'model':_0x385b9e[_0x8c94('0x3b')],'as':'Lists','where':{'id':_0x1c0067[_0x8c94('0x2b')]}}]})[_0x8c94('0x25')](function(_0x704595){if(_0x704595){var _0x367a19=[];for(var _0x5ad887=0x0,_0xb10790;_0x5ad887<_0x704595['length'];_0x5ad887+=0x1){_0xb10790=_0x704595[_0x5ad887]['get']({'plain':!![]});switch(_0xb10790[_0x8c94('0x38')]){case'always':_0xac0a6b(_0xb10790)[_0x8c94('0x30')](_0xabb1b8());break;case _0x8c94('0x41'):_0x1b8d35(_0xb10790)[_0x8c94('0x30')](_0xabb1b8());break;default:_0x385b9e['CmHopper']['create']({'phone':_0x1c0067[_0x8c94('0xe')],'ContactId':_0x1c0067['id'],'ListId':_0x1c0067[_0x8c94('0x2b')],'scheduledat':_0x1c0067['scheduledat']?_0x1c0067[_0x8c94('0x1c')]:moment()['format'](_0x8c94('0x1e')),'priority':_0x1c0067[_0x8c94('0x2c')]?_0x1c0067[_0x8c94('0x2c')]:0x2,'callback':_0x1c0067['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1c0067[_0x8c94('0x2d')]?_0x1c0067[_0x8c94('0x2d')]:undefined,'callbackat':_0x1c0067['callbackUniqueid']?moment()[_0x8c94('0x1d')](_0x8c94('0x1e')):undefined,'CampaignId':_0xb10790['id']})[_0x8c94('0x30')](_0xabb1b8());}}}});})['then'](function(){return _0x385b9e[_0x8c94('0x3f')][_0x8c94('0x40')]({'attributes':['id'],'include':[{'model':_0x385b9e[_0x8c94('0x3b')],'as':_0x8c94('0x42'),'where':{'id':_0x1c0067[_0x8c94('0x2b')]}}]})[_0x8c94('0x25')](function(_0x5c4e22){if(_0x5c4e22){var _0x402053=[];for(var _0x139c98=0x0,_0x239be6;_0x139c98<_0x5c4e22[_0x8c94('0x3a')];_0x139c98+=0x1){_0x239be6=_0x5c4e22[_0x139c98][_0x8c94('0x18')]({'plain':!![]});_0x385b9e[_0x8c94('0x3c')][_0x8c94('0x2a')]({'phone':_0x1c0067[_0x8c94('0xe')],'ContactId':_0x1c0067['id'],'ListId':_0x1c0067[_0x8c94('0x2b')],'CampaignId':_0x239be6['id']})[_0x8c94('0x30')](function(_0x3f6748){logger[_0x8c94('0x19')](_0x8c94('0x3d'),_0x8c94('0x31'),_0x3f6748[_0x8c94('0x3e')]);});}}});})[_0x8c94('0x25')](function(){_0x5eadb9();})[_0x8c94('0x30')](function(_0x192e81){logger[_0x8c94('0x19')](_0x8c94('0x3d'),_0x8c94('0x31'),_0x192e81[_0x8c94('0x3e')]);_0x5eadb9(_0x192e81);});}else{_0x5eadb9(new Error(_0x8c94('0x43')));}},'afterDestroy':function(_0x41e683,_0xf7f17f,_0xfc4e02){var _0x33326c=_0x1d1f11[_0x8c94('0x17')];var _0x5ec66e=_0x41e683[_0x8c94('0x18')]({'plain':!![]});return _0x33326c[_0x8c94('0x29')]['findAll']({'raw':!![],'where':{'ListId':_0x5ec66e[_0x8c94('0x2b')],'ContactId':_0x5ec66e['id']}})[_0x8c94('0x25')](function(_0x6b87dd){if(!_[_0x8c94('0x44')](_0x6b87dd)){var _0x54fce3=[];for(var _0x229eff=0x0;_0x229eff<_0x6b87dd[_0x8c94('0x3a')];_0x229eff+=0x1){var _0x884a6=_0x33326c[_0x8c94('0x29')][_0x8c94('0x45')]({'where':{'ListId':_0x6b87dd[_0x229eff][_0x8c94('0x2b')],'ContactId':_0x6b87dd[_0x229eff][_0x8c94('0x46')],'VoiceQueueId':_0x6b87dd[_0x229eff][_0x8c94('0x47')],'CampaignId':_0x6b87dd[_0x229eff][_0x8c94('0x48')]}});_0x54fce3[_0x8c94('0x49')](_0x884a6);}return BPromise[_0x8c94('0x4a')](_0x54fce3);}})[_0x8c94('0x25')](function(_0x3bfcf4){logger[_0x8c94('0x4b')](_0x8c94('0x4c'),util[_0x8c94('0x1b')](_0x3bfcf4,{'showHidden':![],'depth':null}));_0xfc4e02();})[_0x8c94('0x30')](function(_0x2663ad){logger[_0x8c94('0x19')](_0x8c94('0x4d'),util['inspect'](_0x2663ad,{'showHidden':![],'depth':null}));_0xfc4e02(_0x2663ad);});}}});}; \ No newline at end of file +var _0x2907=['afterCreate','Campaign','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','CmList','Lists','always','onlyIfOpen','length','CmHopperBlack','error','message','BlackLists','cmContact,\x20%s,\x20%s','List\x20not\x20found','ContactId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment/shared','./cmContact.attributes','phone','fti_cm_contacts','lastName','mobile','fax','email','FULLTEXT','utf8mb4','get','cmContact','inspect','scheduledat','format','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','\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'];(function(_0xd839e7,_0x4209e9){var _0xc3cf23=function(_0x16ace2){while(--_0x16ace2){_0xd839e7['push'](_0xd839e7['shift']());}};_0xc3cf23(++_0x4209e9);}(_0x2907,0x172));var _0x7290=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x2907[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x7290('0x0'));var util=require(_0x7290('0x1'));var logger=require(_0x7290('0x2'))(_0x7290('0x3'));var moment=require(_0x7290('0x4'));var BPromise=require('bluebird');var rp=require(_0x7290('0x5'));var fs=require('fs');var path=require(_0x7290('0x6'));var rimraf=require(_0x7290('0x7'));var config=require('../../config/environment');var shared=require(_0x7290('0x8'));var attributes=require(_0x7290('0x9'));module['exports']=function(_0x4a37c0,_0xd7592c){return _0x4a37c0['define']('CmContact',attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x7290('0xa'),'fields':[_0x7290('0xa')]},{'name':_0x7290('0xb'),'fields':['firstName',_0x7290('0xc'),'phone',_0x7290('0xd'),_0x7290('0xe'),_0x7290('0xf')],'type':_0x7290('0x10')}],'timestamps':!![],'charset':_0x7290('0x11'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x28bc6d,_0x358dc5,_0x566ce4){var _0x328d88=_0x4a37c0['models'];var _0x36fdf4=_0x28bc6d[_0x7290('0x12')]({'plain':!![]});function _0x18eb56(){return function(_0x4a756d){logger['error'](_0x7290('0x13'),'afterCreate',util[_0x7290('0x14')](_0x4a756d,{'showHidden':![],'depth':null}));};}function _0x1274bd(_0xe10cdc,_0x4a9fe7){var _0x131f32=_0x4a9fe7['scheduledat']?_0x4a9fe7[_0x7290('0x15')]:moment()[_0x7290('0x16')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x6e90ab,_0x30be92){if(_[_0x7290('0x17')](_0x4a9fe7[_0x7290('0x18')])){_0x6e90ab({'ret':_0x131f32});}else{_0x328d88[_0x7290('0x19')][_0x7290('0x1a')]({'where':{'id':_0xe10cdc['id']}})[_0x7290('0x1b')](function(_0x1487aa){if(!_['isNil'](_0x1487aa)){var _0x3c60f5=_0x1487aa[_0x7290('0x18')];if(!_[_0x7290('0x17')](_0x3c60f5)){var _0x3f6549=shared[_0x7290('0x1c')];var _0x3e0e12=_0x3f6549[_0x3c60f5];var _0x2bc096=_0x3f6549[_0x4a9fe7[_0x7290('0x18')]];if(!_['isNil'](_0x3e0e12)&&!_['isNil'](_0x2bc096)){var _0xbaef90=_0x3e0e12[_0x7290('0x1d')]-_0x2bc096[_0x7290('0x1d')];_0x131f32=_0x4a9fe7[_0x7290('0x15')]?_0x4a9fe7[_0x7290('0x15')]:moment();var _0x595dd0=moment(_0x131f32)[_0x7290('0x1e')](_0xbaef90,_0x7290('0x1f'));_0x6e90ab({'ret':_0x595dd0['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x6e90ab({'ret':_0x131f32});}else _0x6e90ab({'ret':_0x131f32});}else{_0x6e90ab({'ret':_0x131f32});}});}});return 0xa;}var _0xaa6b2=function(_0x5eca94){return new BPromise(function(_0x1dc69e,_0x4231ff){_0x1274bd(_0x5eca94,_0x36fdf4)[_0x7290('0x1b')](function(_0x554f20){_0x36fdf4[_0x7290('0x15')]=_0x554f20['ret'];_0x328d88[_0x7290('0x20')][_0x7290('0x1a')]({'where':{'phone':_0x36fdf4[_0x7290('0xa')],'VoiceQueueId':_0x5eca94['id']}})[_0x7290('0x1b')](function(_0x55fa37){if(!_[_0x7290('0x17')](_0x55fa37)){throw new Error(_0x7290('0x21')+_0x36fdf4[_0x7290('0xa')]+_0x7290('0x22')+_0x5eca94['id']);}return _0x328d88[_0x7290('0x20')][_0x7290('0x23')]({'phone':_0x36fdf4['phone'],'ContactId':_0x36fdf4['id'],'ListId':_0x36fdf4[_0x7290('0x24')],'priority':_0x36fdf4[_0x7290('0x25')]?_0x36fdf4[_0x7290('0x25')]:0x2,'scheduledat':_0x36fdf4[_0x7290('0x15')]?_0x36fdf4['scheduledat']:moment()[_0x7290('0x16')](_0x7290('0x26')),'callback':_0x36fdf4[_0x7290('0x27')]?!![]:![],'callbackuniqueid':_0x36fdf4[_0x7290('0x27')]?_0x36fdf4[_0x7290('0x27')]:undefined,'callbackat':_0x36fdf4[_0x7290('0x27')]?moment()['format'](_0x7290('0x26')):undefined,'VoiceQueueId':_0x5eca94['id']});})[_0x7290('0x28')](function(_0x5127e2){_0x4231ff(_0x5127e2);});});});};var _0x26ada7=function(_0x57870){return new BPromise(function(_0x3cac2b,_0x275e21){_0x1274bd(_0x57870,_0x36fdf4)[_0x7290('0x1b')](function(_0x1db574){_0x36fdf4[_0x7290('0x15')]=_0x1db574['ret'];_0x328d88[_0x7290('0x20')][_0x7290('0x1a')]({'where':{'phone':_0x36fdf4[_0x7290('0xa')],'VoiceQueueId':_0x57870['id']}})[_0x7290('0x1b')](function(_0x7a7da2){if(!_[_0x7290('0x17')](_0x7a7da2)){throw new Error(_0x7290('0x21')+_0x36fdf4[_0x7290('0xa')]+_0x7290('0x29')+_0x57870['id']);}return _0x328d88['CmHopperFinal'][_0x7290('0x1a')]({'where':{'calleridnum':_0x36fdf4[_0x7290('0xa')],'VoiceQueueId':_0x57870['id']}});})[_0x7290('0x1b')](function(_0x25cd18){if(!_[_0x7290('0x17')](_0x25cd18)){throw new Error(_0x7290('0x2a')+_0x36fdf4['phone']+_0x7290('0x2b')+_0x57870['id']);}return _0x328d88['CmHopper'][_0x7290('0x23')]({'phone':_0x36fdf4[_0x7290('0xa')],'ContactId':_0x36fdf4['id'],'ListId':_0x36fdf4[_0x7290('0x24')],'priority':_0x36fdf4[_0x7290('0x25')]?_0x36fdf4[_0x7290('0x25')]:0x2,'scheduledat':_0x36fdf4[_0x7290('0x15')]?_0x36fdf4[_0x7290('0x15')]:moment()[_0x7290('0x16')](_0x7290('0x26')),'callback':_0x36fdf4[_0x7290('0x27')]?!![]:![],'callbackuniqueid':_0x36fdf4[_0x7290('0x27')]?_0x36fdf4['callbackUniqueid']:undefined,'callbackat':_0x36fdf4[_0x7290('0x27')]?moment()[_0x7290('0x16')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x57870['id']});})[_0x7290('0x28')](function(_0x5f28c6){_0x275e21(_0x5f28c6);});});});};function _0x10667a(){return function(_0x5c2230){logger['error']('cmContact',_0x7290('0x2c'),util[_0x7290('0x14')](_0x5c2230,{'showHidden':![],'depth':null}));};}function _0x539a2a(_0x42c124,_0x227ea9){var _0x2a1e9f=_0x227ea9[_0x7290('0x15')]?_0x227ea9[_0x7290('0x15')]:moment()[_0x7290('0x16')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x540f72,_0x20a417){if(_['isNil'](_0x227ea9[_0x7290('0x18')])){_0x540f72({'ret':_0x2a1e9f});}else{_0x328d88[_0x7290('0x2d')][_0x7290('0x1a')]({'where':{'id':_0x42c124['id']}})[_0x7290('0x1b')](function(_0x13a201){if(!_[_0x7290('0x17')](_0x13a201)){var _0x248826=_0x13a201[_0x7290('0x18')];if(!_[_0x7290('0x17')](_0x248826)){var _0x3d516c=shared['timezones'];var _0x4f4e93=_0x3d516c[_0x248826];var _0x2e72fa=_0x3d516c[_0x227ea9[_0x7290('0x18')]];if(!_[_0x7290('0x17')](_0x4f4e93)&&!_[_0x7290('0x17')](_0x2e72fa)){var _0x3c3a78=_0x4f4e93[_0x7290('0x1d')]-_0x2e72fa['utcOffset'];_0x2a1e9f=_0x227ea9[_0x7290('0x15')]?_0x227ea9[_0x7290('0x15')]:moment();var _0x1ac940=moment(_0x2a1e9f)['add'](_0x3c3a78,_0x7290('0x1f'));_0x540f72({'ret':_0x1ac940[_0x7290('0x16')](_0x7290('0x26'))});}else _0x540f72({'ret':_0x2a1e9f});}else _0x540f72({'ret':_0x2a1e9f});}else{_0x540f72({'ret':_0x2a1e9f});}});}});return 0xa;}var _0x63d309=function(_0x2cd846){return new BPromise(function(_0x45ec5a,_0x20bbb7){_0x539a2a(_0x2cd846,_0x36fdf4)[_0x7290('0x1b')](function(_0x137356){_0x36fdf4[_0x7290('0x15')]=_0x137356[_0x7290('0x2e')];_0x328d88['CmHopper'][_0x7290('0x1a')]({'where':{'phone':_0x36fdf4[_0x7290('0xa')],'CampaignId':_0x2cd846['id']}})[_0x7290('0x1b')](function(_0x44ab70){if(!_[_0x7290('0x17')](_0x44ab70)){throw new Error(_0x7290('0x21')+_0x36fdf4[_0x7290('0xa')]+_0x7290('0x2f')+_0x2cd846['id']);}return _0x328d88[_0x7290('0x20')][_0x7290('0x23')]({'phone':_0x36fdf4['phone'],'ContactId':_0x36fdf4['id'],'ListId':_0x36fdf4[_0x7290('0x24')],'priority':_0x36fdf4['priority']?_0x36fdf4[_0x7290('0x25')]:0x2,'scheduledat':_0x36fdf4[_0x7290('0x15')]?_0x36fdf4[_0x7290('0x15')]:moment()[_0x7290('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x36fdf4[_0x7290('0x27')]?!![]:![],'callbackuniqueid':_0x36fdf4[_0x7290('0x27')]?_0x36fdf4[_0x7290('0x27')]:undefined,'callbackat':_0x36fdf4[_0x7290('0x27')]?moment()[_0x7290('0x16')](_0x7290('0x26')):undefined,'CampaignId':_0x2cd846['id']});})[_0x7290('0x28')](function(_0x2fe763){_0x20bbb7(_0x2fe763);});});});};var _0x401362=function(_0x33c45b){return new BPromise(function(_0x5747c4,_0x59c3e8){_0x539a2a(_0x33c45b,_0x36fdf4)[_0x7290('0x1b')](function(_0x462a4d){_0x36fdf4[_0x7290('0x15')]=_0x462a4d[_0x7290('0x2e')];_0x328d88[_0x7290('0x20')]['findOne']({'where':{'phone':_0x36fdf4[_0x7290('0xa')],'CampaignId':_0x33c45b['id']}})['then'](function(_0x389d67){if(!_['isNil'](_0x389d67)){throw new Error(_0x7290('0x21')+_0x36fdf4[_0x7290('0xa')]+_0x7290('0x30')+_0x33c45b['id']);}return _0x328d88['CmHopperFinal'][_0x7290('0x1a')]({'where':{'calleridnum':_0x36fdf4[_0x7290('0xa')],'CampaignId':_0x33c45b['id']}});})['then'](function(_0x31e877){if(!_[_0x7290('0x17')](_0x31e877)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x36fdf4['phone']+_0x7290('0x31')+_0x33c45b['id']);}return _0x328d88[_0x7290('0x20')][_0x7290('0x23')]({'phone':_0x36fdf4[_0x7290('0xa')],'ContactId':_0x36fdf4['id'],'ListId':_0x36fdf4[_0x7290('0x24')],'priority':_0x36fdf4[_0x7290('0x25')]?_0x36fdf4[_0x7290('0x25')]:0x2,'scheduledat':_0x36fdf4[_0x7290('0x15')]?_0x36fdf4[_0x7290('0x15')]:moment()[_0x7290('0x16')](_0x7290('0x26')),'callback':_0x36fdf4['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x36fdf4[_0x7290('0x27')]?_0x36fdf4[_0x7290('0x27')]:undefined,'callbackat':_0x36fdf4[_0x7290('0x27')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x33c45b['id']});})['catch'](function(_0x3e0cd1){_0x59c3e8(_0x3e0cd1);});});});};if(_0x36fdf4['ListId']){_0x328d88[_0x7290('0x19')][_0x7290('0x32')]({'where':{'type':'outbound'},'attributes':['id',_0x7290('0x33'),_0x7290('0x18')],'include':[{'model':_0x328d88[_0x7290('0x34')],'as':_0x7290('0x35'),'where':{'id':_0x36fdf4[_0x7290('0x24')]}}]})[_0x7290('0x1b')](function(_0x307734){if(_0x307734){var _0x4ebda6=[];for(var _0x459373=0x0,_0x27489e;_0x459373<_0x307734['length'];_0x459373+=0x1){_0x27489e=_0x307734[_0x459373][_0x7290('0x12')]({'plain':!![]});switch(_0x27489e[_0x7290('0x33')]){case _0x7290('0x36'):_0x26ada7(_0x27489e)[_0x7290('0x28')](_0x18eb56());break;case _0x7290('0x37'):_0xaa6b2(_0x27489e)['catch'](_0x18eb56());break;default:_0x539a2a(_0x27489e,_0x36fdf4)[_0x7290('0x1b')](function(_0x242f15){_0x36fdf4[_0x7290('0x15')]=_0x242f15[_0x7290('0x2e')];_0x328d88[_0x7290('0x20')]['create']({'phone':_0x36fdf4['phone'],'ContactId':_0x36fdf4['id'],'ListId':_0x36fdf4['ListId'],'scheduledat':_0x36fdf4[_0x7290('0x15')]?_0x36fdf4['scheduledat']:moment()[_0x7290('0x16')](_0x7290('0x26')),'priority':_0x36fdf4[_0x7290('0x25')]?_0x36fdf4[_0x7290('0x25')]:0x2,'callback':_0x36fdf4[_0x7290('0x27')]?!![]:![],'callbackuniqueid':_0x36fdf4[_0x7290('0x27')]?_0x36fdf4[_0x7290('0x27')]:undefined,'callbackat':_0x36fdf4['callbackUniqueid']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x27489e['id']})[_0x7290('0x28')](_0x18eb56());});}}}})['then'](function(){return _0x328d88[_0x7290('0x19')][_0x7290('0x32')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x328d88['CmList'],'as':'BlackLists','where':{'id':_0x36fdf4[_0x7290('0x24')]}}]})[_0x7290('0x1b')](function(_0xa0dad2){if(_0xa0dad2){var _0x1d8f7e=[];for(var _0x4a4db6=0x0,_0x107be6;_0x4a4db6<_0xa0dad2[_0x7290('0x38')];_0x4a4db6+=0x1){_0x107be6=_0xa0dad2[_0x4a4db6][_0x7290('0x12')]({'plain':!![]});_0x328d88[_0x7290('0x39')][_0x7290('0x23')]({'phone':_0x36fdf4[_0x7290('0xa')],'ContactId':_0x36fdf4['id'],'ListId':_0x36fdf4[_0x7290('0x24')],'VoiceQueueId':_0x107be6['id']})['catch'](function(_0x51bbb7){logger[_0x7290('0x3a')]('cmContact,\x20%s,\x20%s',_0x7290('0x2c'),_0x51bbb7[_0x7290('0x3b')]);});}}});})['then'](function(){return _0x328d88[_0x7290('0x2d')][_0x7290('0x32')]({'attributes':['id',_0x7290('0x33'),_0x7290('0x18')],'include':[{'model':_0x328d88[_0x7290('0x34')],'as':'Lists','where':{'id':_0x36fdf4[_0x7290('0x24')]}}]})['then'](function(_0x27eb7c){if(_0x27eb7c){var _0x491aff=[];for(var _0x5691d2=0x0,_0x1ff011;_0x5691d2<_0x27eb7c[_0x7290('0x38')];_0x5691d2+=0x1){_0x1ff011=_0x27eb7c[_0x5691d2][_0x7290('0x12')]({'plain':!![]});switch(_0x1ff011[_0x7290('0x33')]){case'always':_0x401362(_0x1ff011)[_0x7290('0x28')](_0x10667a());break;case _0x7290('0x37'):_0x63d309(_0x1ff011)['catch'](_0x10667a());break;default:_0x328d88['CmHopper'][_0x7290('0x23')]({'phone':_0x36fdf4[_0x7290('0xa')],'ContactId':_0x36fdf4['id'],'ListId':_0x36fdf4[_0x7290('0x24')],'scheduledat':_0x36fdf4[_0x7290('0x15')]?_0x36fdf4[_0x7290('0x15')]:moment()[_0x7290('0x16')](_0x7290('0x26')),'priority':_0x36fdf4[_0x7290('0x25')]?_0x36fdf4['priority']:0x2,'callback':_0x36fdf4[_0x7290('0x27')]?!![]:![],'callbackuniqueid':_0x36fdf4[_0x7290('0x27')]?_0x36fdf4[_0x7290('0x27')]:undefined,'callbackat':_0x36fdf4[_0x7290('0x27')]?moment()[_0x7290('0x16')](_0x7290('0x26')):undefined,'CampaignId':_0x1ff011['id']})[_0x7290('0x28')](_0x10667a());}}}});})[_0x7290('0x1b')](function(){return _0x328d88[_0x7290('0x2d')][_0x7290('0x32')]({'attributes':['id'],'include':[{'model':_0x328d88[_0x7290('0x34')],'as':_0x7290('0x3c'),'where':{'id':_0x36fdf4[_0x7290('0x24')]}}]})['then'](function(_0x1b75e0){if(_0x1b75e0){var _0x29ead6=[];for(var _0x4428c5=0x0,_0x7ae8e8;_0x4428c5<_0x1b75e0['length'];_0x4428c5+=0x1){_0x7ae8e8=_0x1b75e0[_0x4428c5][_0x7290('0x12')]({'plain':!![]});_0x328d88['CmHopperBlack'][_0x7290('0x23')]({'phone':_0x36fdf4[_0x7290('0xa')],'ContactId':_0x36fdf4['id'],'ListId':_0x36fdf4[_0x7290('0x24')],'CampaignId':_0x7ae8e8['id']})[_0x7290('0x28')](function(_0x1a81b6){logger[_0x7290('0x3a')](_0x7290('0x3d'),_0x7290('0x2c'),_0x1a81b6[_0x7290('0x3b')]);});}}});})['then'](function(){_0x566ce4();})['catch'](function(_0x5af5d5){logger[_0x7290('0x3a')](_0x7290('0x3d'),_0x7290('0x2c'),_0x5af5d5[_0x7290('0x3b')]);_0x566ce4(_0x5af5d5);});}else{_0x566ce4(new Error(_0x7290('0x3e')));}},'afterDestroy':function(_0x5f5d8b,_0x2953d1,_0x3c1504){var _0xcc210b=_0x4a37c0['models'];var _0x5be187=_0x5f5d8b['get']({'plain':!![]});return _0xcc210b['CmHopper'][_0x7290('0x32')]({'raw':!![],'where':{'ListId':_0x5be187[_0x7290('0x24')],'ContactId':_0x5be187['id']}})[_0x7290('0x1b')](function(_0x582760){if(!_['isEmpty'](_0x582760)){var _0x52aead=[];for(var _0x39e66c=0x0;_0x39e66c<_0x582760[_0x7290('0x38')];_0x39e66c+=0x1){var _0x2c9050=_0xcc210b[_0x7290('0x20')]['destroy']({'where':{'ListId':_0x582760[_0x39e66c][_0x7290('0x24')],'ContactId':_0x582760[_0x39e66c][_0x7290('0x3f')],'VoiceQueueId':_0x582760[_0x39e66c]['VoiceQueueId'],'CampaignId':_0x582760[_0x39e66c][_0x7290('0x40')]}});_0x52aead[_0x7290('0x41')](_0x2c9050);}return BPromise[_0x7290('0x42')](_0x52aead);}})[_0x7290('0x1b')](function(_0x50f876){logger[_0x7290('0x43')](_0x7290('0x44'),util[_0x7290('0x14')](_0x50f876,{'showHidden':![],'depth':null}));_0x3c1504();})[_0x7290('0x28')](function(_0x8db0e){logger['error']('[CmContact][afterDestroy][Error]',util[_0x7290('0x14')](_0x8db0e,{'showHidden':![],'depth':null}));_0x3c1504(_0x8db0e);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index bbc00b7..f839362 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x23141a,_0x4d9a83){var _0x33fff6=function(_0x600907){while(--_0x600907){_0x23141a['push'](_0x23141a['shift']());}};_0x33fff6(++_0x4d9a83);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x2f375b,_0x3a71f9){var _0x17c00a=function(_0x20698f){while(--_0x20698f){_0x2f375b['push'](_0x2f375b['shift']());}};_0x17c00a(++_0x3a71f9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 e57c532..70fb44b 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 _0x3f49=['exports','STRING','INTEGER','sequelize'];(function(_0xda88f6,_0x62a5ea){var _0x5377f3=function(_0x3c2f70){while(--_0x3c2f70){_0xda88f6['push'](_0xda88f6['shift']());}};_0x5377f3(++_0x62a5ea);}(_0x3f49,0x11f));var _0x93f4=function(_0x26d5af,_0x4eac65){_0x26d5af=_0x26d5af-0x0;var _0x1abdda=_0x3f49[_0x26d5af];return _0x1abdda;};'use strict';var Sequelize=require(_0x93f4('0x0'));module[_0x93f4('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x93f4('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x93f4('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x93f4('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x93f4('0x3')],'defaultValue':null},'description':{'type':Sequelize[_0x93f4('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x9649=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x240258,_0x1003f8){var _0x1e88ec=function(_0x1eb89c){while(--_0x1eb89c){_0x240258['push'](_0x240258['shift']());}};_0x1e88ec(++_0x1003f8);}(_0x9649,0x19f));var _0x9964=function(_0x312f7e,_0x5793a8){_0x312f7e=_0x312f7e-0x0;var _0xd4c018=_0x9649[_0x312f7e];return _0xd4c018;};'use strict';var Sequelize=require(_0x9964('0x0'));module[_0x9964('0x1')]={'CmContactId':{'type':Sequelize[_0x9964('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x9964('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x9964('0x3')],'defaultValue':_0x9964('0x4')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x9964('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 21de158..4630602 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 _0xd89a=['order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','include','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','CmContactHasItems','UserProfileResource','end','error','stack','name','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','filters','query','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x2c59df,_0x2a377e){var _0x3d4e9d=function(_0x19a3b1){while(--_0x19a3b1){_0x2c59df['push'](_0x2c59df['shift']());}};_0x3d4e9d(++_0x2a377e);}(_0xd89a,0x6b));var _0xad89=function(_0x127011,_0x46a223){_0x127011=_0x127011-0x0;var _0x5dfefb=_0xd89a[_0x127011];return _0x5dfefb;};'use strict';var emlformat=require(_0xad89('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad89('0x1'));var jsonpatch=require(_0xad89('0x2'));var rp=require(_0xad89('0x3'));var moment=require('moment');var BPromise=require(_0xad89('0x4'));var Mustache=require(_0xad89('0x5'));var util=require('util');var path=require(_0xad89('0x6'));var sox=require(_0xad89('0x7'));var csv=require(_0xad89('0x8'));var ejs=require(_0xad89('0x9'));var fs=require('fs');var fs_extra=require(_0xad89('0xa'));var _=require(_0xad89('0xb'));var squel=require('squel');var crypto=require(_0xad89('0xc'));var jsforce=require(_0xad89('0xd'));var deskjs=require(_0xad89('0xe'));var toCsv=require(_0xad89('0x8'));var querystring=require(_0xad89('0xf'));var Papa=require(_0xad89('0x10'));var Redis=require(_0xad89('0x11'));var authService=require(_0xad89('0x12'));var qs=require(_0xad89('0x13'));var as=require(_0xad89('0x14'));var hardwareService=require(_0xad89('0x15'));var logger=require(_0xad89('0x16'))(_0xad89('0x17'));var utils=require(_0xad89('0x18'));var config=require(_0xad89('0x19'));var licenseUtil=require(_0xad89('0x1a'));var db=require(_0xad89('0x1b'))['db'];function respondWithStatusCode(_0x566dd0,_0x2a183f){_0x2a183f=_0x2a183f||0xcc;return function(_0x5ed58e){if(_0x5ed58e){return _0x566dd0[_0xad89('0x1c')](_0x2a183f);}return _0x566dd0['status'](_0x2a183f)['end']();};}function respondWithResult(_0x36877b,_0x3e939f){_0x3e939f=_0x3e939f||0xc8;return function(_0x2d117c){if(_0x2d117c){return _0x36877b[_0xad89('0x1d')](_0x3e939f)[_0xad89('0x1e')](_0x2d117c);}};}function respondWithFilteredResult(_0x48eeb3,_0xf70bc9){return function(_0x5b59e9){if(_0x5b59e9){var _0x40080a=typeof _0xf70bc9[_0xad89('0x1f')]===_0xad89('0x20')&&typeof _0xf70bc9[_0xad89('0x21')]===_0xad89('0x20');var _0x1e8222=_0x5b59e9[_0xad89('0x22')];var _0x2f2d27=_0x40080a?0x0:_0xf70bc9[_0xad89('0x1f')];var _0x443061=_0x40080a?_0x5b59e9['count']:_0xf70bc9[_0xad89('0x1f')]+_0xf70bc9[_0xad89('0x21')];var _0x3db469;if(_0x443061>=_0x1e8222){_0x443061=_0x1e8222;_0x3db469=0xc8;}else{_0x3db469=0xce;}_0x48eeb3[_0xad89('0x1d')](_0x3db469);return _0x48eeb3[_0xad89('0x23')](_0xad89('0x24'),_0x2f2d27+'-'+_0x443061+'/'+_0x1e8222)['json'](_0x5b59e9);}return null;};}function patchUpdates(_0x2196c4){return function(_0x258939){try{jsonpatch[_0xad89('0x25')](_0x258939,_0x2196c4,!![]);}catch(_0x2aa575){return BPromise[_0xad89('0x26')](_0x2aa575);}return _0x258939['save']();};}function saveUpdates(_0x26722c,_0x4d8de1){return function(_0xae35b1){if(_0xae35b1){return _0xae35b1['update'](_0x26722c)[_0xad89('0x27')](function(_0x17bdb7){return _0x17bdb7;});}return null;};}function removeEntity(_0x3ed5fe,_0x5429a6){return function(_0x1718af){if(_0x1718af){return _0x1718af[_0xad89('0x28')]()[_0xad89('0x27')](function(){var _0x38e67b=_0x1718af[_0xad89('0x29')]({'plain':!![]});var _0x32eca3=_0xad89('0x2a');return db[_0xad89('0x2b')][_0xad89('0x28')]({'where':{'type':_0x32eca3,'resourceId':_0x38e67b['id']}})[_0xad89('0x27')](function(){return _0x1718af;});})[_0xad89('0x27')](function(){_0x3ed5fe[_0xad89('0x1d')](0xcc)[_0xad89('0x2c')]();});}};}function handleEntityNotFound(_0x8d6c00,_0xb2cab8){return function(_0x22ce52){if(!_0x22ce52){_0x8d6c00[_0xad89('0x1c')](0x194);}return _0x22ce52;};}function handleError(_0xe18a85,_0xe1df9f){_0xe1df9f=_0xe1df9f||0x1f4;return function(_0x818f57){logger[_0xad89('0x2d')](_0x818f57[_0xad89('0x2e')]);if(_0x818f57[_0xad89('0x2f')]){delete _0x818f57[_0xad89('0x2f')];}_0xe18a85[_0xad89('0x1d')](_0xe1df9f)['send'](_0x818f57);};}exports[_0xad89('0x30')]=function(_0x6e872c,_0x23ed7b){var _0x46fe07={},_0x2b58d8={},_0x9bc9bc={'count':0x0,'rows':[]};var _0x277d42=_[_0xad89('0x31')](db[_0xad89('0x32')][_0xad89('0x33')],function(_0x527776){return{'name':_0x527776[_0xad89('0x34')],'type':_0x527776[_0xad89('0x35')][_0xad89('0x36')]};});_0x2b58d8[_0xad89('0x37')]=_[_0xad89('0x31')](_0x277d42,'name');_0x2b58d8['query']=_['keys'](_0x6e872c['query']);_0x2b58d8[_0xad89('0x38')]=_['intersection'](_0x2b58d8[_0xad89('0x37')],_0x2b58d8[_0xad89('0x39')]);_0x46fe07[_0xad89('0x3a')]=_[_0xad89('0x3b')](_0x2b58d8['model'],qs[_0xad89('0x3c')](_0x6e872c[_0xad89('0x39')]['fields']));_0x46fe07['attributes']=_0x46fe07[_0xad89('0x3a')][_0xad89('0x3d')]?_0x46fe07[_0xad89('0x3a')]:_0x2b58d8[_0xad89('0x37')];if(!_0x6e872c[_0xad89('0x39')][_0xad89('0x3e')]('nolimit')){_0x46fe07[_0xad89('0x21')]=qs[_0xad89('0x21')](_0x6e872c[_0xad89('0x39')]['limit']);_0x46fe07['offset']=qs[_0xad89('0x1f')](_0x6e872c[_0xad89('0x39')]['offset']);}_0x46fe07[_0xad89('0x3f')]=qs[_0xad89('0x40')](_0x6e872c[_0xad89('0x39')][_0xad89('0x40')]);_0x46fe07[_0xad89('0x41')]=qs[_0xad89('0x38')](_[_0xad89('0x42')](_0x6e872c[_0xad89('0x39')],_0x2b58d8[_0xad89('0x38')]),_0x277d42);if(_0x6e872c[_0xad89('0x39')][_0xad89('0x43')]){_0x46fe07['where']=_[_0xad89('0x44')](_0x46fe07[_0xad89('0x41')],{'$or':_[_0xad89('0x31')](_0x277d42,function(_0x1104eb){if(_0x1104eb[_0xad89('0x35')]!=='VIRTUAL'){var _0x9b2fa7={};_0x9b2fa7[_0x1104eb[_0xad89('0x2f')]]={'$like':'%'+_0x6e872c[_0xad89('0x39')][_0xad89('0x43')]+'%'};return _0x9b2fa7;}})});}_0x46fe07=_[_0xad89('0x44')]({},_0x46fe07,_0x6e872c[_0xad89('0x45')]);var _0x4140fd={'where':_0x46fe07[_0xad89('0x41')]};return db[_0xad89('0x32')][_0xad89('0x22')](_0x4140fd)['then'](function(_0x4b2796){_0x9bc9bc[_0xad89('0x22')]=_0x4b2796;if(_0x6e872c[_0xad89('0x39')][_0xad89('0x46')]){_0x46fe07['include']=[{'all':!![]}];}return db[_0xad89('0x32')][_0xad89('0x47')](_0x46fe07);})['then'](function(_0x1a1975){_0x9bc9bc['rows']=_0x1a1975;return _0x9bc9bc;})[_0xad89('0x27')](respondWithFilteredResult(_0x23ed7b,_0x46fe07))[_0xad89('0x48')](handleError(_0x23ed7b,null));};exports[_0xad89('0x49')]=function(_0x71d7b4,_0x34c4b8){var _0x49617f={'raw':!![],'where':{'id':_0x71d7b4[_0xad89('0x4a')]['id']}},_0x140774={};_0x140774[_0xad89('0x37')]=_['keys'](db[_0xad89('0x32')][_0xad89('0x33')]);_0x140774[_0xad89('0x39')]=_['keys'](_0x71d7b4[_0xad89('0x39')]);_0x140774[_0xad89('0x38')]=_[_0xad89('0x3b')](_0x140774[_0xad89('0x37')],_0x140774[_0xad89('0x39')]);_0x49617f['attributes']=_[_0xad89('0x3b')](_0x140774[_0xad89('0x37')],qs[_0xad89('0x3c')](_0x71d7b4[_0xad89('0x39')][_0xad89('0x3c')]));_0x49617f[_0xad89('0x3a')]=_0x49617f[_0xad89('0x3a')]['length']?_0x49617f[_0xad89('0x3a')]:_0x140774[_0xad89('0x37')];if(_0x71d7b4['query'][_0xad89('0x46')]){_0x49617f[_0xad89('0x4b')]=[{'all':!![]}];}_0x49617f=_[_0xad89('0x44')]({},_0x49617f,_0x71d7b4[_0xad89('0x45')]);return db[_0xad89('0x32')][_0xad89('0x4c')](_0x49617f)[_0xad89('0x27')](handleEntityNotFound(_0x34c4b8,null))[_0xad89('0x27')](respondWithResult(_0x34c4b8,null))['catch'](handleError(_0x34c4b8,null));};exports[_0xad89('0x4d')]=function(_0x21423c,_0x5a8906){return db[_0xad89('0x32')][_0xad89('0x4d')](_0x21423c['body'],{})['then'](function(_0x482068){var _0x581523=_0x21423c[_0xad89('0x4e')]['get']({'plain':!![]});if(!_0x581523)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x581523[_0xad89('0x4f')]===_0xad89('0x4e')){var _0x1820c3=_0x482068[_0xad89('0x29')]({'plain':!![]});var _0x59e6a8='CmContactHasItems';return db[_0xad89('0x50')]['find']({'where':{'name':_0x59e6a8,'userProfileId':_0x581523[_0xad89('0x51')]},'raw':!![]})[_0xad89('0x27')](function(_0x2b0096){if(_0x2b0096&&_0x2b0096[_0xad89('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x1820c3['name'],'resourceId':_0x1820c3['id'],'type':_0x2b0096[_0xad89('0x2f')],'sectionId':_0x2b0096['id']},{})['then'](function(){return _0x482068;});}else{return _0x482068;}})[_0xad89('0x48')](function(_0x43a87c){logger['error'](_0xad89('0x53'),_0x43a87c);throw _0x43a87c;});}return _0x482068;})[_0xad89('0x27')](respondWithResult(_0x5a8906,0xc9))[_0xad89('0x48')](handleError(_0x5a8906,null));};exports['update']=function(_0x37bc4a,_0x472bcd){if(_0x37bc4a[_0xad89('0x54')]['id']){delete _0x37bc4a[_0xad89('0x54')]['id'];}return db[_0xad89('0x32')][_0xad89('0x4c')]({'where':{'id':_0x37bc4a['params']['id']}})[_0xad89('0x27')](handleEntityNotFound(_0x472bcd,null))[_0xad89('0x27')](saveUpdates(_0x37bc4a['body'],null))[_0xad89('0x27')](respondWithResult(_0x472bcd,null))[_0xad89('0x48')](handleError(_0x472bcd,null));};exports[_0xad89('0x28')]=function(_0x289c67,_0xabf84d){return db['CmContactHasItem']['find']({'where':{'id':_0x289c67[_0xad89('0x4a')]['id']}})[_0xad89('0x27')](handleEntityNotFound(_0xabf84d,null))[_0xad89('0x27')](removeEntity(_0xabf84d,null))[_0xad89('0x48')](handleError(_0xabf84d,null));}; \ No newline at end of file +var _0x0c2d=['pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','reject','update','then','get','CmContactHasItems','UserProfileResource','destroy','error','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0xf911e5,_0x2909ee){var _0x26e8f4=function(_0x331ede){while(--_0x331ede){_0xf911e5['push'](_0xf911e5['shift']());}};_0x26e8f4(++_0x2909ee);}(_0x0c2d,0xc2));var _0xd0c2=function(_0x3bcea3,_0x269a0e){_0x3bcea3=_0x3bcea3-0x0;var _0x49ad68=_0x0c2d[_0x3bcea3];return _0x49ad68;};'use strict';var emlformat=require(_0xd0c2('0x0'));var rimraf=require(_0xd0c2('0x1'));var zipdir=require(_0xd0c2('0x2'));var jsonpatch=require(_0xd0c2('0x3'));var rp=require(_0xd0c2('0x4'));var moment=require(_0xd0c2('0x5'));var BPromise=require(_0xd0c2('0x6'));var Mustache=require('mustache');var util=require(_0xd0c2('0x7'));var path=require(_0xd0c2('0x8'));var sox=require(_0xd0c2('0x9'));var csv=require(_0xd0c2('0xa'));var ejs=require(_0xd0c2('0xb'));var fs=require('fs');var fs_extra=require(_0xd0c2('0xc'));var _=require(_0xd0c2('0xd'));var squel=require(_0xd0c2('0xe'));var crypto=require('crypto');var jsforce=require(_0xd0c2('0xf'));var deskjs=require(_0xd0c2('0x10'));var toCsv=require(_0xd0c2('0xa'));var querystring=require(_0xd0c2('0x11'));var Papa=require(_0xd0c2('0x12'));var Redis=require(_0xd0c2('0x13'));var authService=require(_0xd0c2('0x14'));var qs=require(_0xd0c2('0x15'));var as=require(_0xd0c2('0x16'));var hardwareService=require(_0xd0c2('0x17'));var logger=require(_0xd0c2('0x18'))(_0xd0c2('0x19'));var utils=require(_0xd0c2('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xd0c2('0x1b'));var db=require(_0xd0c2('0x1c'))['db'];function respondWithStatusCode(_0x1ef7ab,_0x12a1e6){_0x12a1e6=_0x12a1e6||0xcc;return function(_0x46a4b5){if(_0x46a4b5){return _0x1ef7ab[_0xd0c2('0x1d')](_0x12a1e6);}return _0x1ef7ab[_0xd0c2('0x1e')](_0x12a1e6)['end']();};}function respondWithResult(_0x83c523,_0x411d16){_0x411d16=_0x411d16||0xc8;return function(_0x31fe41){if(_0x31fe41){return _0x83c523[_0xd0c2('0x1e')](_0x411d16)['json'](_0x31fe41);}};}function respondWithFilteredResult(_0x398f9e,_0xad1aa0){return function(_0x4aa1e6){if(_0x4aa1e6){var _0x411497=typeof _0xad1aa0[_0xd0c2('0x1f')]===_0xd0c2('0x20')&&typeof _0xad1aa0[_0xd0c2('0x21')]===_0xd0c2('0x20');var _0x21efa6=_0x4aa1e6[_0xd0c2('0x22')];var _0x43b0b3=_0x411497?0x0:_0xad1aa0[_0xd0c2('0x1f')];var _0x5535ec=_0x411497?_0x4aa1e6['count']:_0xad1aa0[_0xd0c2('0x1f')]+_0xad1aa0[_0xd0c2('0x21')];var _0x561cdd;if(_0x5535ec>=_0x21efa6){_0x5535ec=_0x21efa6;_0x561cdd=0xc8;}else{_0x561cdd=0xce;}_0x398f9e[_0xd0c2('0x1e')](_0x561cdd);return _0x398f9e[_0xd0c2('0x23')](_0xd0c2('0x24'),_0x43b0b3+'-'+_0x5535ec+'/'+_0x21efa6)['json'](_0x4aa1e6);}return null;};}function patchUpdates(_0x2e7a74){return function(_0x465db1){try{jsonpatch['apply'](_0x465db1,_0x2e7a74,!![]);}catch(_0x20ed14){return BPromise[_0xd0c2('0x25')](_0x20ed14);}return _0x465db1['save']();};}function saveUpdates(_0x59ca20,_0x4751d7){return function(_0xc151c){if(_0xc151c){return _0xc151c[_0xd0c2('0x26')](_0x59ca20)[_0xd0c2('0x27')](function(_0xe4dc9c){return _0xe4dc9c;});}return null;};}function removeEntity(_0x44b20c,_0x21c518){return function(_0x35da17){if(_0x35da17){return _0x35da17['destroy']()[_0xd0c2('0x27')](function(){var _0x4fd0bf=_0x35da17[_0xd0c2('0x28')]({'plain':!![]});var _0x457cd3=_0xd0c2('0x29');return db[_0xd0c2('0x2a')][_0xd0c2('0x2b')]({'where':{'type':_0x457cd3,'resourceId':_0x4fd0bf['id']}})[_0xd0c2('0x27')](function(){return _0x35da17;});})[_0xd0c2('0x27')](function(){_0x44b20c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5531d4,_0xb1c23b){return function(_0x49d7e3){if(!_0x49d7e3){_0x5531d4[_0xd0c2('0x1d')](0x194);}return _0x49d7e3;};}function handleError(_0x45fe25,_0x4eb8eb){_0x4eb8eb=_0x4eb8eb||0x1f4;return function(_0xa0047d){logger[_0xd0c2('0x2c')](_0xa0047d['stack']);if(_0xa0047d[_0xd0c2('0x2d')]){delete _0xa0047d['name'];}_0x45fe25[_0xd0c2('0x1e')](_0x4eb8eb)[_0xd0c2('0x2e')](_0xa0047d);};}exports[_0xd0c2('0x2f')]=function(_0x1a3a27,_0x1ab438){var _0x57bfea={},_0x16ade3={},_0x228e7a={'count':0x0,'rows':[]};var _0x37b6c7=_[_0xd0c2('0x30')](db[_0xd0c2('0x31')][_0xd0c2('0x32')],function(_0x1f397e){return{'name':_0x1f397e[_0xd0c2('0x33')],'type':_0x1f397e[_0xd0c2('0x34')]['key']};});_0x16ade3[_0xd0c2('0x35')]=_['map'](_0x37b6c7,'name');_0x16ade3[_0xd0c2('0x36')]=_['keys'](_0x1a3a27[_0xd0c2('0x36')]);_0x16ade3[_0xd0c2('0x37')]=_[_0xd0c2('0x38')](_0x16ade3[_0xd0c2('0x35')],_0x16ade3['query']);_0x57bfea[_0xd0c2('0x39')]=_[_0xd0c2('0x38')](_0x16ade3[_0xd0c2('0x35')],qs['fields'](_0x1a3a27[_0xd0c2('0x36')][_0xd0c2('0x3a')]));_0x57bfea[_0xd0c2('0x39')]=_0x57bfea[_0xd0c2('0x39')][_0xd0c2('0x3b')]?_0x57bfea[_0xd0c2('0x39')]:_0x16ade3['model'];if(!_0x1a3a27['query'][_0xd0c2('0x3c')](_0xd0c2('0x3d'))){_0x57bfea['limit']=qs[_0xd0c2('0x21')](_0x1a3a27[_0xd0c2('0x36')][_0xd0c2('0x21')]);_0x57bfea[_0xd0c2('0x1f')]=qs[_0xd0c2('0x1f')](_0x1a3a27[_0xd0c2('0x36')][_0xd0c2('0x1f')]);}_0x57bfea[_0xd0c2('0x3e')]=qs[_0xd0c2('0x3f')](_0x1a3a27[_0xd0c2('0x36')][_0xd0c2('0x3f')]);_0x57bfea['where']=qs['filters'](_[_0xd0c2('0x40')](_0x1a3a27[_0xd0c2('0x36')],_0x16ade3[_0xd0c2('0x37')]),_0x37b6c7);if(_0x1a3a27[_0xd0c2('0x36')][_0xd0c2('0x41')]){_0x57bfea[_0xd0c2('0x42')]=_[_0xd0c2('0x43')](_0x57bfea[_0xd0c2('0x42')],{'$or':_[_0xd0c2('0x30')](_0x37b6c7,function(_0x16f43c){if(_0x16f43c[_0xd0c2('0x34')]!==_0xd0c2('0x44')){var _0x2d521b={};_0x2d521b[_0x16f43c['name']]={'$like':'%'+_0x1a3a27['query']['filter']+'%'};return _0x2d521b;}})});}_0x57bfea=_[_0xd0c2('0x43')]({},_0x57bfea,_0x1a3a27[_0xd0c2('0x45')]);var _0x431989={'where':_0x57bfea[_0xd0c2('0x42')]};return db[_0xd0c2('0x31')][_0xd0c2('0x22')](_0x431989)['then'](function(_0x1a925d){_0x228e7a[_0xd0c2('0x22')]=_0x1a925d;if(_0x1a3a27[_0xd0c2('0x36')][_0xd0c2('0x46')]){_0x57bfea['include']=[{'all':!![]}];}return db[_0xd0c2('0x31')][_0xd0c2('0x47')](_0x57bfea);})[_0xd0c2('0x27')](function(_0x30ba4c){_0x228e7a['rows']=_0x30ba4c;return _0x228e7a;})['then'](respondWithFilteredResult(_0x1ab438,_0x57bfea))[_0xd0c2('0x48')](handleError(_0x1ab438,null));};exports['show']=function(_0x19d1b9,_0x423111){var _0x2700eb={'raw':!![],'where':{'id':_0x19d1b9['params']['id']}},_0x3ab036={};_0x3ab036[_0xd0c2('0x35')]=_[_0xd0c2('0x49')](db[_0xd0c2('0x31')]['rawAttributes']);_0x3ab036[_0xd0c2('0x36')]=_[_0xd0c2('0x49')](_0x19d1b9[_0xd0c2('0x36')]);_0x3ab036[_0xd0c2('0x37')]=_[_0xd0c2('0x38')](_0x3ab036[_0xd0c2('0x35')],_0x3ab036['query']);_0x2700eb['attributes']=_[_0xd0c2('0x38')](_0x3ab036[_0xd0c2('0x35')],qs[_0xd0c2('0x3a')](_0x19d1b9['query'][_0xd0c2('0x3a')]));_0x2700eb['attributes']=_0x2700eb['attributes'][_0xd0c2('0x3b')]?_0x2700eb[_0xd0c2('0x39')]:_0x3ab036[_0xd0c2('0x35')];if(_0x19d1b9[_0xd0c2('0x36')][_0xd0c2('0x46')]){_0x2700eb[_0xd0c2('0x4a')]=[{'all':!![]}];}_0x2700eb=_[_0xd0c2('0x43')]({},_0x2700eb,_0x19d1b9[_0xd0c2('0x45')]);return db['CmContactHasItem'][_0xd0c2('0x4b')](_0x2700eb)[_0xd0c2('0x27')](handleEntityNotFound(_0x423111,null))['then'](respondWithResult(_0x423111,null))[_0xd0c2('0x48')](handleError(_0x423111,null));};exports[_0xd0c2('0x4c')]=function(_0x2d0c48,_0x971aea){return db[_0xd0c2('0x31')]['create'](_0x2d0c48[_0xd0c2('0x4d')],{})[_0xd0c2('0x27')](function(_0x5f1862){var _0x583a67=_0x2d0c48['user'][_0xd0c2('0x28')]({'plain':!![]});if(!_0x583a67)throw new Error(_0xd0c2('0x4e'));if(_0x583a67[_0xd0c2('0x4f')]===_0xd0c2('0x50')){var _0xe4593a=_0x5f1862['get']({'plain':!![]});var _0x53f5d0=_0xd0c2('0x29');return db[_0xd0c2('0x51')][_0xd0c2('0x4b')]({'where':{'name':_0x53f5d0,'userProfileId':_0x583a67[_0xd0c2('0x52')]},'raw':!![]})['then'](function(_0x39fbd3){if(_0x39fbd3&&_0x39fbd3[_0xd0c2('0x53')]===0x0){return db[_0xd0c2('0x2a')]['create']({'name':_0xe4593a['name'],'resourceId':_0xe4593a['id'],'type':_0x39fbd3[_0xd0c2('0x2d')],'sectionId':_0x39fbd3['id']},{})[_0xd0c2('0x27')](function(){return _0x5f1862;});}else{return _0x5f1862;}})[_0xd0c2('0x48')](function(_0x67263c){logger[_0xd0c2('0x2c')](_0xd0c2('0x54'),_0x67263c);throw _0x67263c;});}return _0x5f1862;})[_0xd0c2('0x27')](respondWithResult(_0x971aea,0xc9))[_0xd0c2('0x48')](handleError(_0x971aea,null));};exports[_0xd0c2('0x26')]=function(_0x52124e,_0x3c36ed){if(_0x52124e['body']['id']){delete _0x52124e[_0xd0c2('0x4d')]['id'];}return db[_0xd0c2('0x31')][_0xd0c2('0x4b')]({'where':{'id':_0x52124e[_0xd0c2('0x55')]['id']}})[_0xd0c2('0x27')](handleEntityNotFound(_0x3c36ed,null))['then'](saveUpdates(_0x52124e['body'],null))[_0xd0c2('0x27')](respondWithResult(_0x3c36ed,null))[_0xd0c2('0x48')](handleError(_0x3c36ed,null));};exports['destroy']=function(_0x2a5fdf,_0x2f7ba9){return db[_0xd0c2('0x31')][_0xd0c2('0x4b')]({'where':{'id':_0x2a5fdf[_0xd0c2('0x55')]['id']}})[_0xd0c2('0x27')](handleEntityNotFound(_0x2f7ba9,null))[_0xd0c2('0x27')](removeEntity(_0x2f7ba9,null))['catch'](handleError(_0x2f7ba9,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 7c8d462..1089ad5 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 _0xa41d=['../../config/environment','CmContactHasItem','cm_contact_has_items','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa41d,0x1bb));var _0xda41=function(_0x3fd9fc,_0x1a5f73){_0x3fd9fc=_0x3fd9fc-0x0;var _0x929f26=_0xa41d[_0x3fd9fc];return _0x929f26;};'use strict';var _=require(_0xda41('0x0'));var util=require(_0xda41('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xda41('0x2'));var BPromise=require(_0xda41('0x3'));var rp=require(_0xda41('0x4'));var fs=require('fs');var path=require(_0xda41('0x5'));var rimraf=require(_0xda41('0x6'));var config=require(_0xda41('0x7'));var attributes=require('./cmContactHasItem.attributes');module['exports']=function(_0xa1e121,_0x293901){return _0xa1e121['define'](_0xda41('0x8'),attributes,{'tableName':_0xda41('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9354=['../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x134827,_0x21f6ed){var _0x366671=function(_0x4dc8d4){while(--_0x4dc8d4){_0x134827['push'](_0x134827['shift']());}};_0x366671(++_0x21f6ed);}(_0x9354,0x96));var _0x4935=function(_0x5bce33,_0x4a4b06){_0x5bce33=_0x5bce33-0x0;var _0x15bc20=_0x9354[_0x5bce33];return _0x15bc20;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var logger=require(_0x4935('0x1'))('api');var moment=require(_0x4935('0x2'));var BPromise=require(_0x4935('0x3'));var rp=require(_0x4935('0x4'));var fs=require('fs');var path=require(_0x4935('0x5'));var rimraf=require('rimraf');var config=require(_0x4935('0x6'));var attributes=require(_0x4935('0x7'));module[_0x4935('0x8')]=function(_0x2d518a,_0x263864){return _0x2d518a[_0x4935('0x9')](_0x4935('0xa'),attributes,{'tableName':_0x4935('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 e0340f2..099d0f3 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 _0x8b83=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','CmContactHasItem,\x20%s,\x20%s','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash'];(function(_0x32e81c,_0x75897){var _0x186401=function(_0x215c77){while(--_0x215c77){_0x32e81c['push'](_0x32e81c['shift']());}};_0x186401(++_0x75897);}(_0x8b83,0x8b));var _0x38b8=function(_0x21e4c2,_0x3f3199){_0x21e4c2=_0x21e4c2-0x0;var _0x1760d=_0x8b83[_0x21e4c2];return _0x1760d;};'use strict';var _=require(_0x38b8('0x0'));var util=require(_0x38b8('0x1'));var moment=require(_0x38b8('0x2'));var BPromise=require(_0x38b8('0x3'));var rs=require(_0x38b8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x38b8('0x5'))['db'];var utils=require(_0x38b8('0x6'));var logger=require('../../config/logger')(_0x38b8('0x7'));var config=require(_0x38b8('0x8'));var jayson=require(_0x38b8('0x9'));var client=jayson[_0x38b8('0xa')][_0x38b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42c965,_0x187f4d,_0x436085){return new BPromise(function(_0x1ee507,_0xf04831){return client['request'](_0x42c965,_0x436085)[_0x38b8('0xc')](function(_0x35088e){logger['info'](_0x38b8('0xd'),_0x187f4d,'request\x20sent');logger['debug'](_0x38b8('0xe'),_0x187f4d,_0x38b8('0xf'),JSON[_0x38b8('0x10')](_0x35088e));if(_0x35088e[_0x38b8('0x11')]){if(_0x35088e[_0x38b8('0x11')]['code']===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x187f4d,_0x35088e[_0x38b8('0x11')]['message']);return _0xf04831(_0x35088e['error'][_0x38b8('0x12')]);}logger[_0x38b8('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x187f4d,_0x35088e[_0x38b8('0x11')][_0x38b8('0x12')]);return _0x1ee507(_0x35088e[_0x38b8('0x11')]['message']);}else{logger['info'](_0x38b8('0xd'),_0x187f4d,_0x38b8('0xf'));_0x1ee507(_0x35088e[_0x38b8('0x13')][_0x38b8('0x12')]);}})['catch'](function(_0x1f693f){logger[_0x38b8('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x187f4d,_0x1f693f);_0xf04831(_0x1f693f);});});} \ No newline at end of file +var _0xe7a6=['CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5393da,_0x3f4678){var _0x4c42b0=function(_0x4b027c){while(--_0x4b027c){_0x5393da['push'](_0x5393da['shift']());}};_0x4c42b0(++_0x3f4678);}(_0xe7a6,0x148));var _0x6e7a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe7a6[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x6e7a('0x0'));var moment=require('moment');var BPromise=require(_0x6e7a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e7a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e7a('0x3'));var logger=require(_0x6e7a('0x4'))(_0x6e7a('0x5'));var config=require(_0x6e7a('0x6'));var jayson=require(_0x6e7a('0x7'));var client=jayson[_0x6e7a('0x8')][_0x6e7a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x373fdc,_0xf5ad41,_0x389bcc){return new BPromise(function(_0x2091fa,_0x21fee2){return client[_0x6e7a('0xa')](_0x373fdc,_0x389bcc)[_0x6e7a('0xb')](function(_0x43d7e3){logger['info'](_0x6e7a('0xc'),_0xf5ad41,_0x6e7a('0xd'));logger['debug'](_0x6e7a('0xe'),_0xf5ad41,'request\x20sent',JSON['stringify'](_0x43d7e3));if(_0x43d7e3['error']){if(_0x43d7e3[_0x6e7a('0xf')][_0x6e7a('0x10')]===0x1f4){logger['error'](_0x6e7a('0xc'),_0xf5ad41,_0x43d7e3[_0x6e7a('0xf')][_0x6e7a('0x11')]);return _0x21fee2(_0x43d7e3[_0x6e7a('0xf')][_0x6e7a('0x11')]);}logger[_0x6e7a('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0xf5ad41,_0x43d7e3[_0x6e7a('0xf')][_0x6e7a('0x11')]);return _0x2091fa(_0x43d7e3['error'][_0x6e7a('0x11')]);}else{logger[_0x6e7a('0x12')](_0x6e7a('0xc'),_0xf5ad41,_0x6e7a('0xd'));_0x2091fa(_0x43d7e3['result']['message']);}})[_0x6e7a('0x13')](function(_0x5f00e6){logger['error'](_0x6e7a('0xc'),_0xf5ad41,_0x5f00e6);_0x21fee2(_0x5f00e6);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 50d968a..ca0ba50 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 _0x5d3c=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','/:id','show'];(function(_0xd336f2,_0x19ca90){var _0x47ad51=function(_0x29a0ff){while(--_0x29a0ff){_0xd336f2['push'](_0xd336f2['shift']());}};_0x47ad51(++_0x19ca90);}(_0x5d3c,0x194));var _0xc5d3=function(_0x2841f0,_0x1f4a44){_0x2841f0=_0x2841f0-0x0;var _0x18b792=_0x5d3c[_0x2841f0];return _0x18b792;};'use strict';var multer=require(_0xc5d3('0x0'));var util=require(_0xc5d3('0x1'));var path=require(_0xc5d3('0x2'));var timeout=require(_0xc5d3('0x3'));var express=require('express');var router=express[_0xc5d3('0x4')]();var fs_extra=require(_0xc5d3('0x5'));var auth=require(_0xc5d3('0x6'));var interaction=require(_0xc5d3('0x7'));var config=require(_0xc5d3('0x8'));var controller=require(_0xc5d3('0x9'));router[_0xc5d3('0xa')]('/',auth[_0xc5d3('0xb')](),controller['index']);router[_0xc5d3('0xa')](_0xc5d3('0xc'),auth[_0xc5d3('0xb')](),controller[_0xc5d3('0xd')]);router['post']('/',auth[_0xc5d3('0xb')](),controller[_0xc5d3('0xe')]);router['put'](_0xc5d3('0xc'),auth['isAuthenticated'](),controller[_0xc5d3('0xf')]);router[_0xc5d3('0x10')](_0xc5d3('0xc'),auth[_0xc5d3('0xb')](),controller[_0xc5d3('0x11')]);module[_0xc5d3('0x12')]=router; \ No newline at end of file +var _0x06f7=['Router','fs-extra','../../components/auth/service','../../config/environment','./cmContactHasItem.controller','isAuthenticated','index','get','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x381886,_0x49870f){var _0x49c5df=function(_0x11513f){while(--_0x11513f){_0x381886['push'](_0x381886['shift']());}};_0x49c5df(++_0x49870f);}(_0x06f7,0xd7));var _0x706f=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0x06f7[_0x5c2a2b];return _0x19921f;};'use strict';var multer=require(_0x706f('0x0'));var util=require(_0x706f('0x1'));var path=require(_0x706f('0x2'));var timeout=require(_0x706f('0x3'));var express=require(_0x706f('0x4'));var router=express[_0x706f('0x5')]();var fs_extra=require(_0x706f('0x6'));var auth=require(_0x706f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x706f('0x8'));var controller=require(_0x706f('0x9'));router['get']('/',auth[_0x706f('0xa')](),controller[_0x706f('0xb')]);router[_0x706f('0xc')](_0x706f('0xd'),auth[_0x706f('0xa')](),controller[_0x706f('0xe')]);router[_0x706f('0xf')]('/',auth[_0x706f('0xa')](),controller['create']);router[_0x706f('0x10')](_0x706f('0xd'),auth['isAuthenticated'](),controller[_0x706f('0x11')]);router['delete'](_0x706f('0xd'),auth['isAuthenticated'](),controller[_0x706f('0x12')]);module[_0x706f('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 78c8ae9..2ad127a 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 _0xfb34=['name','type','select','parse','values','BOOLEAN','voice','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue'];(function(_0x44b505,_0x3754ee){var _0x239b49=function(_0x5ab058){while(--_0x5ab058){_0x44b505['push'](_0x44b505['shift']());}};_0x239b49(++_0x3754ee);}(_0xfb34,0x111));var _0x4fb3=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0xfb34[_0x5756c6];return _0x4b5806;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4fb3('0x0'));module[_0x4fb3('0x1')]={'name':{'type':Sequelize[_0x4fb3('0x2')],'get':function(_0x36aa40){return this[_0x4fb3('0x3')](_0x4fb3('0x4'));}},'alias':{'type':Sequelize[_0x4fb3('0x5')],'allowNull':![],'set':function(_0x29b60e){this[_0x4fb3('0x6')](_0x4fb3('0x4'),_0x29b60e?_0x29b60e:this[_0x4fb3('0x3')](_0x4fb3('0x7')));}},'type':{'type':Sequelize[_0x4fb3('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0x4fb3('0x3')](_0x4fb3('0x8'))===_0x4fb3('0x9')){return JSON[_0x4fb3('0xa')](this[_0x4fb3('0x3')](_0x4fb3('0xb')));}else{return this[_0x4fb3('0x3')](_0x4fb3('0xb'));}},'set':function(_0x28dc36){if(Array['isArray'](_0x28dc36)){this[_0x4fb3('0x6')]('values',JSON['stringify'](_0x28dc36));}else{this['setDataValue'](_0x4fb3('0xb'),_0x28dc36);}}},'required':{'type':Sequelize[_0x4fb3('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x4fb3('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x4fb3('0xd'))}}; \ No newline at end of file +var _0x1d9b=['exports','VIRTUAL','STRING','setDataValue','alias','TEXT','long','getDataValue','type','select','parse','values','isArray','stringify','BOOLEAN','voice','sequelize','lodash'];(function(_0x2c6615,_0x139760){var _0x2316bb=function(_0xf67fa4){while(--_0xf67fa4){_0x2c6615['push'](_0x2c6615['shift']());}};_0x2316bb(++_0x139760);}(_0x1d9b,0x7c));var _0xb1d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d9b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb1d9('0x0'));var _=require(_0xb1d9('0x1'));module[_0xb1d9('0x2')]={'name':{'type':Sequelize[_0xb1d9('0x3')],'get':function(_0x4a2d69){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xb1d9('0x4')],'allowNull':![],'set':function(_0x6aff3d){this[_0xb1d9('0x5')](_0xb1d9('0x6'),_0x6aff3d?_0x6aff3d:this['getDataValue']('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xb1d9('0x7')](_0xb1d9('0x8')),'get':function(){if(this[_0xb1d9('0x9')](_0xb1d9('0xa'))===_0xb1d9('0xb')){return JSON[_0xb1d9('0xc')](this[_0xb1d9('0x9')]('values'));}else{return this['getDataValue'](_0xb1d9('0xd'));}},'set':function(_0x55fb6e){if(Array[_0xb1d9('0xe')](_0x55fb6e)){this[_0xb1d9('0x5')](_0xb1d9('0xd'),JSON[_0xb1d9('0xf')](_0x55fb6e));}else{this[_0xb1d9('0x5')](_0xb1d9('0xd'),_0x55fb6e);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xb1d9('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xb1d9('0x11'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 1c88eaa..27b9a1f 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 _0x6cc7=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','limit','undefined','count','set','reject','then','error','stack','name','index','map','CmCustomField','rawAttributes','type','key','differenceBy','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','options','find','body','params','create','transaction','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','sequelize','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x171fc1,_0x53259d){var _0x430ca7=function(_0x85c4a1){while(--_0x85c4a1){_0x171fc1['push'](_0x171fc1['shift']());}};_0x430ca7(++_0x53259d);}(_0x6cc7,0x97));var _0x76cc=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x6cc7[_0xdc37a1];return _0x99b4fe;};'use strict';var emlformat=require(_0x76cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76cc('0x1'));var jsonpatch=require(_0x76cc('0x2'));var rp=require(_0x76cc('0x3'));var moment=require(_0x76cc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76cc('0x5'));var util=require(_0x76cc('0x6'));var path=require(_0x76cc('0x7'));var sox=require(_0x76cc('0x8'));var csv=require(_0x76cc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76cc('0xa'));var squel=require(_0x76cc('0xb'));var crypto=require(_0x76cc('0xc'));var jsforce=require(_0x76cc('0xd'));var deskjs=require(_0x76cc('0xe'));var toCsv=require(_0x76cc('0x9'));var querystring=require(_0x76cc('0xf'));var Papa=require(_0x76cc('0x10'));var Redis=require(_0x76cc('0x11'));var authService=require(_0x76cc('0x12'));var qs=require(_0x76cc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76cc('0x14'));var logger=require(_0x76cc('0x15'))(_0x76cc('0x16'));var utils=require(_0x76cc('0x17'));var config=require(_0x76cc('0x18'));var licenseUtil=require(_0x76cc('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x573ac0,_0xe93e85){_0xe93e85=_0xe93e85||0xcc;return function(_0x11766b){if(_0x11766b){return _0x573ac0['sendStatus'](_0xe93e85);}return _0x573ac0['status'](_0xe93e85)[_0x76cc('0x1a')]();};}function respondWithResult(_0x2330dc,_0x3eae94){_0x3eae94=_0x3eae94||0xc8;return function(_0x5dab54){if(_0x5dab54){return _0x2330dc[_0x76cc('0x1b')](_0x3eae94)[_0x76cc('0x1c')](_0x5dab54);}};}function respondWithFilteredResult(_0x51978b,_0x1ce27a){return function(_0x4ebd08){if(_0x4ebd08){var _0x51cdeb=typeof _0x1ce27a[_0x76cc('0x1d')]==='undefined'&&typeof _0x1ce27a[_0x76cc('0x1e')]===_0x76cc('0x1f');var _0x432819=_0x4ebd08[_0x76cc('0x20')];var _0xe03787=_0x51cdeb?0x0:_0x1ce27a[_0x76cc('0x1d')];var _0x15c8b9=_0x51cdeb?_0x4ebd08[_0x76cc('0x20')]:_0x1ce27a[_0x76cc('0x1d')]+_0x1ce27a[_0x76cc('0x1e')];var _0x2ad203;if(_0x15c8b9>=_0x432819){_0x15c8b9=_0x432819;_0x2ad203=0xc8;}else{_0x2ad203=0xce;}_0x51978b[_0x76cc('0x1b')](_0x2ad203);return _0x51978b[_0x76cc('0x21')]('Content-Range',_0xe03787+'-'+_0x15c8b9+'/'+_0x432819)['json'](_0x4ebd08);}return null;};}function patchUpdates(_0x9c8037){return function(_0x492ce3){try{jsonpatch['apply'](_0x492ce3,_0x9c8037,!![]);}catch(_0x113949){return BPromise[_0x76cc('0x22')](_0x113949);}return _0x492ce3['save']();};}function saveUpdates(_0x238c8a,_0x512c11){return function(_0x5c35fb){if(_0x5c35fb){return _0x5c35fb['update'](_0x238c8a)[_0x76cc('0x23')](function(_0x22e47b){return _0x22e47b;});}return null;};}function removeEntity(_0x5e0499,_0xba03d1){return function(_0x1ed360){if(_0x1ed360){return _0x1ed360['destroy']()[_0x76cc('0x23')](function(){_0x5e0499[_0x76cc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x389b3a,_0x4e6dc6){return function(_0x5bba3f){if(!_0x5bba3f){_0x389b3a['sendStatus'](0x194);}return _0x5bba3f;};}function handleError(_0x40ce84,_0x48ed53){_0x48ed53=_0x48ed53||0x1f4;return function(_0x467afd){logger[_0x76cc('0x24')](_0x467afd[_0x76cc('0x25')]);if(_0x467afd[_0x76cc('0x26')]){delete _0x467afd[_0x76cc('0x26')];}_0x40ce84['status'](_0x48ed53)['send'](_0x467afd);};}exports[_0x76cc('0x27')]=function(_0x4d2e79,_0x4e8462){var _0x12415d={},_0x417eab={},_0x10a4f7={'count':0x0,'rows':[]};var _0x5c3e22=_[_0x76cc('0x28')](db[_0x76cc('0x29')][_0x76cc('0x2a')],function(_0x37ed65){return{'name':_0x37ed65['fieldName'],'type':_0x37ed65[_0x76cc('0x2b')][_0x76cc('0x2c')]};});_0x417eab['model']=_[_0x76cc('0x2d')](_[_0x76cc('0x28')](_0x5c3e22,'name'),[_0x76cc('0x26')]);_0x417eab[_0x76cc('0x2e')]=_[_0x76cc('0x2f')](_0x4d2e79[_0x76cc('0x2e')]);_0x417eab[_0x76cc('0x30')]=_[_0x76cc('0x31')](_0x417eab[_0x76cc('0x32')],_0x417eab[_0x76cc('0x2e')]);_0x12415d['attributes']=_[_0x76cc('0x31')](_0x417eab[_0x76cc('0x32')],qs['fields'](_0x4d2e79[_0x76cc('0x2e')][_0x76cc('0x33')]));_0x12415d['attributes']=_0x12415d[_0x76cc('0x34')][_0x76cc('0x35')]?_0x12415d[_0x76cc('0x34')]:_0x417eab['model'];if(!_0x4d2e79[_0x76cc('0x2e')]['hasOwnProperty'](_0x76cc('0x36'))){_0x12415d[_0x76cc('0x1e')]=qs['limit'](_0x4d2e79[_0x76cc('0x2e')][_0x76cc('0x1e')]);_0x12415d[_0x76cc('0x1d')]=qs['offset'](_0x4d2e79['query'][_0x76cc('0x1d')]);}_0x12415d[_0x76cc('0x37')]=qs[_0x76cc('0x38')](_0x4d2e79['query'][_0x76cc('0x38')]);_0x12415d['where']=qs[_0x76cc('0x30')](_['pick'](_0x4d2e79[_0x76cc('0x2e')],_0x417eab[_0x76cc('0x30')]),_0x5c3e22);if(_0x4d2e79[_0x76cc('0x2e')][_0x76cc('0x39')]){_0x12415d[_0x76cc('0x3a')]=_['merge'](_0x12415d[_0x76cc('0x3a')],{'$or':_[_0x76cc('0x28')](_0x5c3e22,function(_0x495800){if(_0x495800['type']!==_0x76cc('0x3b')){var _0x104930={};_0x104930[_0x495800[_0x76cc('0x26')]]={'$like':'%'+_0x4d2e79[_0x76cc('0x2e')][_0x76cc('0x39')]+'%'};return _0x104930;}})});}_0x12415d=_[_0x76cc('0x3c')]({},_0x12415d,_0x4d2e79['options']);var _0x4bac26={'where':_0x12415d[_0x76cc('0x3a')]};return db['CmCustomField'][_0x76cc('0x20')](_0x4bac26)[_0x76cc('0x23')](function(_0x2b2dcb){_0x10a4f7[_0x76cc('0x20')]=_0x2b2dcb;if(_0x4d2e79[_0x76cc('0x2e')][_0x76cc('0x3d')]){_0x12415d[_0x76cc('0x3e')]=[{'all':!![]}];}return db['CmCustomField'][_0x76cc('0x3f')](_0x12415d);})[_0x76cc('0x23')](function(_0x345192){_0x10a4f7[_0x76cc('0x40')]=_0x345192;return _0x10a4f7;})['then'](respondWithFilteredResult(_0x4e8462,_0x12415d))[_0x76cc('0x41')](handleError(_0x4e8462,null));};exports[_0x76cc('0x42')]=function(_0x2dd83a,_0x179fb8){var _0x3467f0={'raw':!![],'where':{'id':_0x2dd83a['params']['id']}},_0x94ac10={};_0x94ac10['model']=_[_0x76cc('0x2f')](db[_0x76cc('0x29')][_0x76cc('0x2a')]);_0x94ac10[_0x76cc('0x2e')]=_[_0x76cc('0x2f')](_0x2dd83a[_0x76cc('0x2e')]);_0x94ac10[_0x76cc('0x30')]=_[_0x76cc('0x31')](_0x94ac10['model'],_0x94ac10[_0x76cc('0x2e')]);_0x3467f0[_0x76cc('0x34')]=_['intersection'](_0x94ac10[_0x76cc('0x32')],qs[_0x76cc('0x33')](_0x2dd83a[_0x76cc('0x2e')]['fields']));_0x3467f0[_0x76cc('0x34')]=_0x3467f0[_0x76cc('0x34')][_0x76cc('0x35')]?_0x3467f0[_0x76cc('0x34')]:_0x94ac10[_0x76cc('0x32')];if(_0x2dd83a[_0x76cc('0x2e')][_0x76cc('0x3d')]){_0x3467f0['include']=[{'all':!![]}];}_0x3467f0=_[_0x76cc('0x3c')]({},_0x3467f0,_0x2dd83a[_0x76cc('0x43')]);return db[_0x76cc('0x29')][_0x76cc('0x44')](_0x3467f0)[_0x76cc('0x23')](handleEntityNotFound(_0x179fb8,null))[_0x76cc('0x23')](respondWithResult(_0x179fb8,null))[_0x76cc('0x41')](handleError(_0x179fb8,null));};exports['update']=function(_0x19dd8e,_0x29237e){if(_0x19dd8e[_0x76cc('0x45')]['id']){delete _0x19dd8e['body']['id'];}return db['CmCustomField'][_0x76cc('0x44')]({'where':{'id':_0x19dd8e[_0x76cc('0x46')]['id']}})[_0x76cc('0x23')](handleEntityNotFound(_0x29237e,null))[_0x76cc('0x23')](saveUpdates(_0x19dd8e[_0x76cc('0x45')],null))[_0x76cc('0x23')](respondWithResult(_0x29237e,null))[_0x76cc('0x41')](handleError(_0x29237e,null));};exports['destroy']=function(_0x383bf4,_0x9ac3f6){return db['CmCustomField'][_0x76cc('0x44')]({'where':{'id':_0x383bf4['params']['id']}})[_0x76cc('0x23')](handleEntityNotFound(_0x9ac3f6,null))[_0x76cc('0x23')](removeEntity(_0x9ac3f6,null))[_0x76cc('0x41')](handleError(_0x9ac3f6,null));};exports[_0x76cc('0x47')]=function(_0x4b6948,_0x469170){var _0x3a53ef;return db['sequelize'][_0x76cc('0x48')](function(_0x2e068a){return db['CmCustomField'][_0x76cc('0x47')](_0x4b6948[_0x76cc('0x45')],{'transaction':_0x2e068a})['then'](function(_0xb92dac){_0x3a53ef=_0xb92dac;var _0x5de7de={'type':db[_0x76cc('0x49')][_0x76cc('0x4a')],'transaction':_0x2e068a};switch(_0x4b6948[_0x76cc('0x45')]['type']){case _0x76cc('0x4b'):_0x5de7de[_0x76cc('0x2b')]=db[_0x76cc('0x49')][_0x76cc('0x4a')];break;case _0x76cc('0x4c'):_0x5de7de[_0x76cc('0x2b')]=db[_0x76cc('0x49')][_0x76cc('0x4d')];break;case _0x76cc('0x4e'):_0x5de7de[_0x76cc('0x2b')]=db[_0x76cc('0x49')]['BOOLEAN'];_0x5de7de[_0x76cc('0x4f')]=![];break;default:}return db[_0x76cc('0x50')]['queryInterface'][_0x76cc('0x51')](_0x76cc('0x52'),util[_0x76cc('0x53')](_0x76cc('0x54'),_0x3a53ef['id']),_0x5de7de);})[_0x76cc('0x23')](function(){return _0x3a53ef;});})[_0x76cc('0x23')](respondWithResult(_0x469170,0xc9))[_0x76cc('0x41')](handleError(_0x469170,null));}; \ No newline at end of file +var _0x0d35=['send','CmCustomField','rawAttributes','type','key','model','differenceBy','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','body','destroy','create','transaction','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','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/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count','offset','set','Content-Range','reject','save','update','end','error','stack','name'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x0d35,0x8a));var _0x50d3=function(_0x3d6a92,_0x5da164){_0x3d6a92=_0x3d6a92-0x0;var _0x54a948=_0x0d35[_0x3d6a92];return _0x54a948;};'use strict';var emlformat=require(_0x50d3('0x0'));var rimraf=require(_0x50d3('0x1'));var zipdir=require(_0x50d3('0x2'));var jsonpatch=require(_0x50d3('0x3'));var rp=require(_0x50d3('0x4'));var moment=require(_0x50d3('0x5'));var BPromise=require(_0x50d3('0x6'));var Mustache=require(_0x50d3('0x7'));var util=require(_0x50d3('0x8'));var path=require(_0x50d3('0x9'));var sox=require(_0x50d3('0xa'));var csv=require('to-csv');var ejs=require(_0x50d3('0xb'));var fs=require('fs');var fs_extra=require(_0x50d3('0xc'));var _=require(_0x50d3('0xd'));var squel=require('squel');var crypto=require(_0x50d3('0xe'));var jsforce=require(_0x50d3('0xf'));var deskjs=require(_0x50d3('0x10'));var toCsv=require(_0x50d3('0x11'));var querystring=require(_0x50d3('0x12'));var Papa=require(_0x50d3('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x50d3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x50d3('0x15'))(_0x50d3('0x16'));var utils=require(_0x50d3('0x17'));var config=require(_0x50d3('0x18'));var licenseUtil=require(_0x50d3('0x19'));var db=require(_0x50d3('0x1a'))['db'];function respondWithStatusCode(_0x44d6db,_0xc4b6c4){_0xc4b6c4=_0xc4b6c4||0xcc;return function(_0x4df7f0){if(_0x4df7f0){return _0x44d6db[_0x50d3('0x1b')](_0xc4b6c4);}return _0x44d6db[_0x50d3('0x1c')](_0xc4b6c4)['end']();};}function respondWithResult(_0x289a68,_0xa6e36e){_0xa6e36e=_0xa6e36e||0xc8;return function(_0x547b37){if(_0x547b37){return _0x289a68['status'](_0xa6e36e)[_0x50d3('0x1d')](_0x547b37);}};}function respondWithFilteredResult(_0x2d1b83,_0x484562){return function(_0x12387e){if(_0x12387e){var _0x3142a3=typeof _0x484562['offset']==='undefined'&&typeof _0x484562[_0x50d3('0x1e')]==='undefined';var _0xddc679=_0x12387e[_0x50d3('0x1f')];var _0x2fb7e0=_0x3142a3?0x0:_0x484562[_0x50d3('0x20')];var _0x4c1664=_0x3142a3?_0x12387e[_0x50d3('0x1f')]:_0x484562[_0x50d3('0x20')]+_0x484562[_0x50d3('0x1e')];var _0x529411;if(_0x4c1664>=_0xddc679){_0x4c1664=_0xddc679;_0x529411=0xc8;}else{_0x529411=0xce;}_0x2d1b83[_0x50d3('0x1c')](_0x529411);return _0x2d1b83[_0x50d3('0x21')](_0x50d3('0x22'),_0x2fb7e0+'-'+_0x4c1664+'/'+_0xddc679)['json'](_0x12387e);}return null;};}function patchUpdates(_0x54b129){return function(_0x4850c7){try{jsonpatch['apply'](_0x4850c7,_0x54b129,!![]);}catch(_0x24c809){return BPromise[_0x50d3('0x23')](_0x24c809);}return _0x4850c7[_0x50d3('0x24')]();};}function saveUpdates(_0x1ab5a9,_0x582ee0){return function(_0x4a973a){if(_0x4a973a){return _0x4a973a[_0x50d3('0x25')](_0x1ab5a9)['then'](function(_0x3421d3){return _0x3421d3;});}return null;};}function removeEntity(_0x3688ee,_0x26a8c9){return function(_0xf95ec){if(_0xf95ec){return _0xf95ec['destroy']()['then'](function(){_0x3688ee['status'](0xcc)[_0x50d3('0x26')]();});}};}function handleEntityNotFound(_0x587bff,_0x26c0cb){return function(_0x2388ec){if(!_0x2388ec){_0x587bff[_0x50d3('0x1b')](0x194);}return _0x2388ec;};}function handleError(_0xb5609,_0x1287a2){_0x1287a2=_0x1287a2||0x1f4;return function(_0x3c43ff){logger[_0x50d3('0x27')](_0x3c43ff[_0x50d3('0x28')]);if(_0x3c43ff[_0x50d3('0x29')]){delete _0x3c43ff[_0x50d3('0x29')];}_0xb5609['status'](_0x1287a2)[_0x50d3('0x2a')](_0x3c43ff);};}exports['index']=function(_0x1b2ce1,_0x1792b4){var _0x58e5c8={},_0x2669eb={},_0x3fcc84={'count':0x0,'rows':[]};var _0x461578=_['map'](db[_0x50d3('0x2b')][_0x50d3('0x2c')],function(_0x2a2c79){return{'name':_0x2a2c79['fieldName'],'type':_0x2a2c79[_0x50d3('0x2d')][_0x50d3('0x2e')]};});_0x2669eb[_0x50d3('0x2f')]=_[_0x50d3('0x30')](_[_0x50d3('0x31')](_0x461578,'name'),[_0x50d3('0x29')]);_0x2669eb['query']=_[_0x50d3('0x32')](_0x1b2ce1[_0x50d3('0x33')]);_0x2669eb[_0x50d3('0x34')]=_[_0x50d3('0x35')](_0x2669eb[_0x50d3('0x2f')],_0x2669eb[_0x50d3('0x33')]);_0x58e5c8[_0x50d3('0x36')]=_['intersection'](_0x2669eb[_0x50d3('0x2f')],qs[_0x50d3('0x37')](_0x1b2ce1[_0x50d3('0x33')][_0x50d3('0x37')]));_0x58e5c8[_0x50d3('0x36')]=_0x58e5c8[_0x50d3('0x36')][_0x50d3('0x38')]?_0x58e5c8[_0x50d3('0x36')]:_0x2669eb[_0x50d3('0x2f')];if(!_0x1b2ce1[_0x50d3('0x33')]['hasOwnProperty'](_0x50d3('0x39'))){_0x58e5c8['limit']=qs[_0x50d3('0x1e')](_0x1b2ce1[_0x50d3('0x33')][_0x50d3('0x1e')]);_0x58e5c8['offset']=qs['offset'](_0x1b2ce1[_0x50d3('0x33')][_0x50d3('0x20')]);}_0x58e5c8[_0x50d3('0x3a')]=qs[_0x50d3('0x3b')](_0x1b2ce1['query'][_0x50d3('0x3b')]);_0x58e5c8[_0x50d3('0x3c')]=qs['filters'](_[_0x50d3('0x3d')](_0x1b2ce1[_0x50d3('0x33')],_0x2669eb[_0x50d3('0x34')]),_0x461578);if(_0x1b2ce1[_0x50d3('0x33')][_0x50d3('0x3e')]){_0x58e5c8[_0x50d3('0x3c')]=_[_0x50d3('0x3f')](_0x58e5c8[_0x50d3('0x3c')],{'$or':_[_0x50d3('0x31')](_0x461578,function(_0x5dd4c7){if(_0x5dd4c7[_0x50d3('0x2d')]!==_0x50d3('0x40')){var _0x27420c={};_0x27420c[_0x5dd4c7[_0x50d3('0x29')]]={'$like':'%'+_0x1b2ce1[_0x50d3('0x33')][_0x50d3('0x3e')]+'%'};return _0x27420c;}})});}_0x58e5c8=_['merge']({},_0x58e5c8,_0x1b2ce1[_0x50d3('0x41')]);var _0x40db72={'where':_0x58e5c8[_0x50d3('0x3c')]};return db[_0x50d3('0x2b')][_0x50d3('0x1f')](_0x40db72)[_0x50d3('0x42')](function(_0x1f6dd1){_0x3fcc84['count']=_0x1f6dd1;if(_0x1b2ce1['query'][_0x50d3('0x43')]){_0x58e5c8[_0x50d3('0x44')]=[{'all':!![]}];}return db[_0x50d3('0x2b')][_0x50d3('0x45')](_0x58e5c8);})[_0x50d3('0x42')](function(_0x1100d8){_0x3fcc84[_0x50d3('0x46')]=_0x1100d8;return _0x3fcc84;})['then'](respondWithFilteredResult(_0x1792b4,_0x58e5c8))[_0x50d3('0x47')](handleError(_0x1792b4,null));};exports[_0x50d3('0x48')]=function(_0x20b03e,_0x523f89){var _0x363a29={'raw':!![],'where':{'id':_0x20b03e[_0x50d3('0x49')]['id']}},_0x1731ba={};_0x1731ba[_0x50d3('0x2f')]=_['keys'](db[_0x50d3('0x2b')]['rawAttributes']);_0x1731ba[_0x50d3('0x33')]=_[_0x50d3('0x32')](_0x20b03e['query']);_0x1731ba[_0x50d3('0x34')]=_[_0x50d3('0x35')](_0x1731ba[_0x50d3('0x2f')],_0x1731ba[_0x50d3('0x33')]);_0x363a29[_0x50d3('0x36')]=_[_0x50d3('0x35')](_0x1731ba['model'],qs[_0x50d3('0x37')](_0x20b03e[_0x50d3('0x33')][_0x50d3('0x37')]));_0x363a29[_0x50d3('0x36')]=_0x363a29[_0x50d3('0x36')]['length']?_0x363a29[_0x50d3('0x36')]:_0x1731ba[_0x50d3('0x2f')];if(_0x20b03e['query'][_0x50d3('0x43')]){_0x363a29[_0x50d3('0x44')]=[{'all':!![]}];}_0x363a29=_[_0x50d3('0x3f')]({},_0x363a29,_0x20b03e[_0x50d3('0x41')]);return db[_0x50d3('0x2b')][_0x50d3('0x4a')](_0x363a29)[_0x50d3('0x42')](handleEntityNotFound(_0x523f89,null))[_0x50d3('0x42')](respondWithResult(_0x523f89,null))[_0x50d3('0x47')](handleError(_0x523f89,null));};exports[_0x50d3('0x25')]=function(_0x124f9c,_0x22c0db){if(_0x124f9c['body']['id']){delete _0x124f9c[_0x50d3('0x4b')]['id'];}return db[_0x50d3('0x2b')][_0x50d3('0x4a')]({'where':{'id':_0x124f9c[_0x50d3('0x49')]['id']}})[_0x50d3('0x42')](handleEntityNotFound(_0x22c0db,null))[_0x50d3('0x42')](saveUpdates(_0x124f9c[_0x50d3('0x4b')],null))[_0x50d3('0x42')](respondWithResult(_0x22c0db,null))[_0x50d3('0x47')](handleError(_0x22c0db,null));};exports[_0x50d3('0x4c')]=function(_0x1d714e,_0x452e46){return db[_0x50d3('0x2b')][_0x50d3('0x4a')]({'where':{'id':_0x1d714e[_0x50d3('0x49')]['id']}})[_0x50d3('0x42')](handleEntityNotFound(_0x452e46,null))['then'](removeEntity(_0x452e46,null))['catch'](handleError(_0x452e46,null));};exports[_0x50d3('0x4d')]=function(_0x364395,_0x42f032){var _0x2b8b52;return db['sequelize'][_0x50d3('0x4e')](function(_0x3faae2){return db[_0x50d3('0x2b')][_0x50d3('0x4d')](_0x364395[_0x50d3('0x4b')],{'transaction':_0x3faae2})['then'](function(_0x39f78c){_0x2b8b52=_0x39f78c;var _0x27aa54={'type':db[_0x50d3('0x4f')][_0x50d3('0x50')],'transaction':_0x3faae2};switch(_0x364395[_0x50d3('0x4b')][_0x50d3('0x2d')]){case _0x50d3('0x51'):_0x27aa54['type']=db[_0x50d3('0x4f')][_0x50d3('0x50')];break;case _0x50d3('0x52'):_0x27aa54[_0x50d3('0x2d')]=db[_0x50d3('0x4f')]['INTEGER'];break;case _0x50d3('0x53'):_0x27aa54['type']=db['Sequelize'][_0x50d3('0x54')];_0x27aa54[_0x50d3('0x55')]=![];break;default:}return db['sequelize'][_0x50d3('0x56')][_0x50d3('0x57')](_0x50d3('0x58'),util['format'](_0x50d3('0x59'),_0x2b8b52['id']),_0x27aa54);})[_0x50d3('0x42')](function(){return _0x2b8b52;});})['then'](respondWithResult(_0x42f032,0xc9))[_0x50d3('0x47')](handleError(_0x42f032,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 0c27232..cb667ae 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 _0xa681=['./cmCustomField.attributes','exports','define','CmCustomField','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xa681,0x13a));var _0x1a68=function(_0x4052f1,_0x2f58c1){_0x4052f1=_0x4052f1-0x0;var _0x1ad0da=_0xa681[_0x4052f1];return _0x1ad0da;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1a68('0x0'))(_0x1a68('0x1'));var moment=require('moment');var BPromise=require(_0x1a68('0x2'));var rp=require(_0x1a68('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a68('0x4'));var config=require(_0x1a68('0x5'));var attributes=require(_0x1a68('0x6'));module[_0x1a68('0x7')]=function(_0x2b6414,_0x3c82b9){return _0x2b6414[_0x1a68('0x8')](_0x1a68('0x9'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6579=['exports','CmCustomField','cm_custom_fields','lodash','../../config/logger','moment','request-promise','path','../../config/environment','./cmCustomField.attributes'];(function(_0x5c38cd,_0x5a6b4e){var _0xc985ef=function(_0x4aa1df){while(--_0x4aa1df){_0x5c38cd['push'](_0x5c38cd['shift']());}};_0xc985ef(++_0x5a6b4e);}(_0x6579,0xdf));var _0x9657=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6579[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9657('0x0'));var util=require('util');var logger=require(_0x9657('0x1'))('api');var moment=require(_0x9657('0x2'));var BPromise=require('bluebird');var rp=require(_0x9657('0x3'));var fs=require('fs');var path=require(_0x9657('0x4'));var rimraf=require('rimraf');var config=require(_0x9657('0x5'));var attributes=require(_0x9657('0x6'));module[_0x9657('0x7')]=function(_0x41ae7d,_0x1e13f5){return _0x41ae7d['define'](_0x9657('0x8'),attributes,{'tableName':_0x9657('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 59e93f0..88577f1 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 _0xffdd=['message','info','CmCustomField,\x20%s,\x20%s','request\x20sent','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','debug','stringify','error','code'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0xffdd,0x193));var _0xdffd=function(_0x57fc31,_0x5de793){_0x57fc31=_0x57fc31-0x0;var _0x3102d0=_0xffdd[_0x57fc31];return _0x3102d0;};'use strict';var _=require(_0xdffd('0x0'));var util=require(_0xdffd('0x1'));var moment=require(_0xdffd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdffd('0x3'));var db=require(_0xdffd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdffd('0x5'))(_0xdffd('0x6'));var config=require(_0xdffd('0x7'));var jayson=require(_0xdffd('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4835f6,_0x372e34,_0x25cd14){return new BPromise(function(_0x1c39c6,_0x2e9eb0){return client[_0xdffd('0x9')](_0x4835f6,_0x25cd14)[_0xdffd('0xa')](function(_0x19137c){logger['info']('CmCustomField,\x20%s,\x20%s',_0x372e34,'request\x20sent');logger[_0xdffd('0xb')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x372e34,'request\x20sent',JSON[_0xdffd('0xc')](_0x19137c));if(_0x19137c[_0xdffd('0xd')]){if(_0x19137c[_0xdffd('0xd')][_0xdffd('0xe')]===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0x372e34,_0x19137c[_0xdffd('0xd')]['message']);return _0x2e9eb0(_0x19137c[_0xdffd('0xd')][_0xdffd('0xf')]);}logger[_0xdffd('0xd')]('CmCustomField,\x20%s,\x20%s',_0x372e34,_0x19137c[_0xdffd('0xd')][_0xdffd('0xf')]);return _0x1c39c6(_0x19137c[_0xdffd('0xd')][_0xdffd('0xf')]);}else{logger[_0xdffd('0x10')](_0xdffd('0x11'),_0x372e34,_0xdffd('0x12'));_0x1c39c6(_0x19137c['result'][_0xdffd('0xf')]);}})['catch'](function(_0xa5dd99){logger[_0xdffd('0xd')](_0xdffd('0x11'),_0x372e34,_0xa5dd99);_0x2e9eb0(_0xa5dd99);});});} \ No newline at end of file +var _0x11c3=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCustomField,\x20%s,\x20%s','debug','stringify','error','message','info','result','lodash','util'];(function(_0x58bffa,_0x11cf92){var _0x15ab06=function(_0x3ff139){while(--_0x3ff139){_0x58bffa['push'](_0x58bffa['shift']());}};_0x15ab06(++_0x11cf92);}(_0x11c3,0xee));var _0x311c=function(_0x500a8a,_0x4a615b){_0x500a8a=_0x500a8a-0x0;var _0x1c0f9d=_0x11c3[_0x500a8a];return _0x1c0f9d;};'use strict';var _=require(_0x311c('0x0'));var util=require(_0x311c('0x1'));var moment=require(_0x311c('0x2'));var BPromise=require(_0x311c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x311c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x311c('0x5'));var logger=require(_0x311c('0x6'))(_0x311c('0x7'));var config=require(_0x311c('0x8'));var jayson=require(_0x311c('0x9'));var client=jayson[_0x311c('0xa')][_0x311c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x134039,_0x26bf4c,_0x545c47){return new BPromise(function(_0x40e332,_0x51aeb8){return client[_0x311c('0xc')](_0x134039,_0x545c47)['then'](function(_0x34f420){logger['info'](_0x311c('0xd'),_0x26bf4c,'request\x20sent');logger[_0x311c('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x26bf4c,'request\x20sent',JSON[_0x311c('0xf')](_0x34f420));if(_0x34f420[_0x311c('0x10')]){if(_0x34f420[_0x311c('0x10')]['code']===0x1f4){logger[_0x311c('0x10')]('CmCustomField,\x20%s,\x20%s',_0x26bf4c,_0x34f420[_0x311c('0x10')][_0x311c('0x11')]);return _0x51aeb8(_0x34f420[_0x311c('0x10')][_0x311c('0x11')]);}logger[_0x311c('0x10')](_0x311c('0xd'),_0x26bf4c,_0x34f420[_0x311c('0x10')][_0x311c('0x11')]);return _0x40e332(_0x34f420[_0x311c('0x10')]['message']);}else{logger[_0x311c('0x12')](_0x311c('0xd'),_0x26bf4c,'request\x20sent');_0x40e332(_0x34f420[_0x311c('0x13')][_0x311c('0x11')]);}})['catch'](function(_0xf9f1d9){logger['error'](_0x311c('0xd'),_0x26bf4c,_0xf9f1d9);_0x51aeb8(_0xf9f1d9);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index ba97210..389cc2f 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 _0x8463=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout'];(function(_0x3e45a6,_0x576195){var _0x4751f7=function(_0x14d175){while(--_0x14d175){_0x3e45a6['push'](_0x3e45a6['shift']());}};_0x4751f7(++_0x576195);}(_0x8463,0x140));var _0x3846=function(_0x452699,_0x19cb57){_0x452699=_0x452699-0x0;var _0x424fa7=_0x8463[_0x452699];return _0x424fa7;};'use strict';var multer=require(_0x3846('0x0'));var util=require(_0x3846('0x1'));var path=require('path');var timeout=require(_0x3846('0x2'));var express=require(_0x3846('0x3'));var router=express[_0x3846('0x4')]();var fs_extra=require(_0x3846('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3846('0x6'));var config=require(_0x3846('0x7'));var controller=require('./cmCustomField.controller');router[_0x3846('0x8')]('/',auth[_0x3846('0x9')](),controller[_0x3846('0xa')]);router[_0x3846('0x8')](_0x3846('0xb'),auth['isAuthenticated'](),controller[_0x3846('0xc')]);router[_0x3846('0xd')]('/',auth[_0x3846('0x9')](),controller[_0x3846('0xe')]);router[_0x3846('0xf')](_0x3846('0xb'),auth[_0x3846('0x9')](),controller[_0x3846('0x10')]);router[_0x3846('0x11')](_0x3846('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x3846('0x12')]=router; \ No newline at end of file +var _0x4d49=['create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x13d022,_0x48f636){var _0x267538=function(_0x48536b){while(--_0x48536b){_0x13d022['push'](_0x13d022['shift']());}};_0x267538(++_0x48f636);}(_0x4d49,0x141));var _0x94d4=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4d49[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x94d4('0x0'));var path=require('path');var timeout=require(_0x94d4('0x1'));var express=require(_0x94d4('0x2'));var router=express[_0x94d4('0x3')]();var fs_extra=require(_0x94d4('0x4'));var auth=require(_0x94d4('0x5'));var interaction=require(_0x94d4('0x6'));var config=require(_0x94d4('0x7'));var controller=require(_0x94d4('0x8'));router[_0x94d4('0x9')]('/',auth['isAuthenticated'](),controller[_0x94d4('0xa')]);router[_0x94d4('0x9')](_0x94d4('0xb'),auth[_0x94d4('0xc')](),controller[_0x94d4('0xd')]);router[_0x94d4('0xe')]('/',auth['isAuthenticated'](),controller[_0x94d4('0xf')]);router[_0x94d4('0x10')]('/:id',auth[_0x94d4('0xc')](),controller[_0x94d4('0x11')]);router[_0x94d4('0x12')](_0x94d4('0xb'),auth['isAuthenticated'](),controller[_0x94d4('0x13')]);module[_0x94d4('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 5a2bce9..f631941 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 _0xce35=['INTEGER','STRING','UNSIGNED','contactListQueue','sequelize','exports','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1b3a25,_0x24944b){var _0x2c3154=function(_0x328431){while(--_0x328431){_0x1b3a25['push'](_0x1b3a25['shift']());}};_0x2c3154(++_0x24944b);}(_0xce35,0x162));var _0x5ce3=function(_0x865622,_0xd4fc50){_0x865622=_0x865622-0x0;var _0x3e3dbc=_0xce35[_0x865622];return _0x3e3dbc;};'use strict';var moment=require('moment');var Sequelize=require(_0x5ce3('0x0'));module[_0x5ce3('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x5ce3('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5ce3('0x3')],'defaultValue':moment()[_0x5ce3('0x4')](_0x5ce3('0x5'))},'countbusyretry':{'type':Sequelize[_0x5ce3('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5ce3('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5ce3('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5ce3('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5ce3('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5ce3('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5ce3('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5ce3('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x5ce3('0x9')},'ListId':{'type':Sequelize[_0x5ce3('0x6')],'unique':_0x5ce3('0x9')},'UserId':{'type':Sequelize[_0x5ce3('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x5ce3('0x6')],'unique':_0x5ce3('0x9')},'CampaignId':{'type':Sequelize[_0x5ce3('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5ce3('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5ce3('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x5ce3('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x5ce3('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x28a1=['moment','sequelize','exports','STRING','BOOLEAN','format','INTEGER','DATE','UNSIGNED','contactListQueue'];(function(_0x3bdb62,_0x15155d){var _0x368f60=function(_0x2fbdcc){while(--_0x2fbdcc){_0x3bdb62['push'](_0x3bdb62['shift']());}};_0x368f60(++_0x15155d);}(_0x28a1,0x19a));var _0x128a=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x28a1[_0x36ed48];return _0x51c63a;};'use strict';var moment=require(_0x128a('0x0'));var Sequelize=require(_0x128a('0x1'));module[_0x128a('0x2')]={'phone':{'type':Sequelize[_0x128a('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x128a('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x128a('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x128a('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x128a('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x128a('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x128a('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x128a('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x128a('0x7')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x128a('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x128a('0x9')},'ListId':{'type':Sequelize[_0x128a('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x128a('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x128a('0x6')],'unique':_0x128a('0x9')},'CampaignId':{'type':Sequelize[_0x128a('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x128a('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x128a('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x128a('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x128a('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x128a('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x128a('0x7')],'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 8325e65..458e06a 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 _0x2fed=['offset','undefined','count','limit','set','Content-Range','update','error','stack','name','send','map','CmHopper','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','concat','$and','$gte','$lt','$lte','$ne','$eq','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$any','attributes','fields','length','nolimit','sort','pick','filter','where','merge','options','then','includeAll','include','rows','show','params','find','catch','create','body','describe','destroy','CampaignId','VoiceQueue','Campaign','VoiceQueueId','createdAt','state','statedesc','deleted','campaign','user','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','LOCK','dialActive','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','getTimezones','timezones','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','json'];(function(_0x5d3654,_0xd6ce2c){var _0x39cef3=function(_0x223c29){while(--_0x223c29){_0x5d3654['push'](_0x5d3654['shift']());}};_0x39cef3(++_0xd6ce2c);}(_0x2fed,0x7c));var _0xd2fe=function(_0x3b1fb9,_0x3c14b7){_0x3b1fb9=_0x3b1fb9-0x0;var _0x1cc8b0=_0x2fed[_0x3b1fb9];return _0x1cc8b0;};'use strict';var moment=require(_0xd2fe('0x0'));var _=require(_0xd2fe('0x1'));var qs=require(_0xd2fe('0x2'));var logger=require(_0xd2fe('0x3'))(_0xd2fe('0x4'));var shared=require('../../config/environment');var db=require(_0xd2fe('0x5'))['db'];function respondWithResult(_0x20b497,_0x48707a){_0x48707a=_0x48707a||0xc8;return function(_0x58f3f8){if(_0x58f3f8){return _0x20b497[_0xd2fe('0x6')](_0x48707a)[_0xd2fe('0x7')](_0x58f3f8);}};}function respondWithFilteredResult(_0xd85f89,_0x5be4d3){return function(_0x2f7bf5){if(_0x2f7bf5){var _0x44e015=typeof _0x5be4d3[_0xd2fe('0x8')]===_0xd2fe('0x9')&&typeof _0x5be4d3['limit']===_0xd2fe('0x9');var _0x107546=_0x2f7bf5[_0xd2fe('0xa')];var _0x1943ab=_0x44e015?0x0:_0x5be4d3[_0xd2fe('0x8')];var _0x2a06a9=_0x44e015?_0x2f7bf5[_0xd2fe('0xa')]:_0x5be4d3[_0xd2fe('0x8')]+_0x5be4d3[_0xd2fe('0xb')];var _0x13c68f;if(_0x2a06a9>=_0x107546){_0x2a06a9=_0x107546;_0x13c68f=0xc8;}else{_0x13c68f=0xce;}_0xd85f89[_0xd2fe('0x6')](_0x13c68f);return _0xd85f89[_0xd2fe('0xc')](_0xd2fe('0xd'),_0x1943ab+'-'+_0x2a06a9+'/'+_0x107546)[_0xd2fe('0x7')](_0x2f7bf5);}return null;};}function saveUpdates(_0x72f7e0,_0x2431da){return function(_0x22e414){if(_0x22e414){return _0x22e414[_0xd2fe('0xe')](_0x72f7e0)['then'](function(_0x1c2401){return _0x1c2401;});}return null;};}function handleEntityNotFound(_0x30fad9,_0x2a9355){return function(_0x5607a3){if(!_0x5607a3){_0x30fad9['sendStatus'](0x194);}return _0x5607a3;};}function handleError(_0x4ab9d2,_0x203bea){_0x203bea=_0x203bea||0x1f4;return function(_0x54f4cc){logger[_0xd2fe('0xf')](_0x54f4cc[_0xd2fe('0x10')]);if(_0x54f4cc[_0xd2fe('0x11')]){delete _0x54f4cc[_0xd2fe('0x11')];}_0x4ab9d2[_0xd2fe('0x6')](_0x203bea)[_0xd2fe('0x12')](_0x54f4cc);};}exports['index']=function(_0x5486e2,_0xe958a0){var _0x40162f={},_0x57f517={},_0x3ca715={'count':0x0,'rows':[]};var _0x247e4c=_[_0xd2fe('0x13')](db[_0xd2fe('0x14')][_0xd2fe('0x15')],function(_0x38d5ab){return{'name':_0x38d5ab[_0xd2fe('0x16')],'type':_0x38d5ab[_0xd2fe('0x17')][_0xd2fe('0x18')]};});_0x57f517[_0xd2fe('0x19')]=_['map'](_0x247e4c,_0xd2fe('0x11'));_0x57f517['query']=_[_0xd2fe('0x1a')](_0x5486e2[_0xd2fe('0x1b')]);_0x57f517[_0xd2fe('0x1c')]=_[_0xd2fe('0x1d')](_0x57f517['model'],_0x57f517[_0xd2fe('0x1b')]);_0x57f517['filters']=_[_0xd2fe('0x1e')](_0x57f517[_0xd2fe('0x1c')],[_0xd2fe('0x1f'),'$or','$gt',_0xd2fe('0x20'),_0xd2fe('0x21'),_0xd2fe('0x22'),_0xd2fe('0x23'),_0xd2fe('0x24'),'$not','$between','$notBetween',_0xd2fe('0x25'),_0xd2fe('0x26'),_0xd2fe('0x27'),_0xd2fe('0x28'),'$iLike',_0xd2fe('0x29'),_0xd2fe('0x27'),_0xd2fe('0x2a'),_0xd2fe('0x2b'),'$contained',_0xd2fe('0x2c')]);_0x40162f[_0xd2fe('0x2d')]=_[_0xd2fe('0x1d')](_0x57f517['model'],qs[_0xd2fe('0x2e')](_0x5486e2[_0xd2fe('0x1b')][_0xd2fe('0x2e')]));_0x40162f[_0xd2fe('0x2d')]=_0x40162f['attributes'][_0xd2fe('0x2f')]?_0x40162f[_0xd2fe('0x2d')]:_0x57f517[_0xd2fe('0x19')];if(!_0x5486e2[_0xd2fe('0x1b')]['hasOwnProperty'](_0xd2fe('0x30'))){_0x40162f[_0xd2fe('0xb')]=qs[_0xd2fe('0xb')](_0x5486e2[_0xd2fe('0x1b')][_0xd2fe('0xb')]);_0x40162f[_0xd2fe('0x8')]=qs['offset'](_0x5486e2[_0xd2fe('0x1b')][_0xd2fe('0x8')]);}_0x40162f['order']=qs[_0xd2fe('0x31')](_0x5486e2[_0xd2fe('0x1b')][_0xd2fe('0x31')]);_0x40162f['where']=qs[_0xd2fe('0x1c')](_[_0xd2fe('0x32')](_0x5486e2['query'],_0x57f517[_0xd2fe('0x1c')]),_0x247e4c);if(_0x5486e2[_0xd2fe('0x1b')][_0xd2fe('0x33')]){_0x40162f[_0xd2fe('0x34')]=_[_0xd2fe('0x35')](_0x40162f[_0xd2fe('0x34')],{'$or':_['map'](_0x247e4c,function(_0x4dd379){if(_0x4dd379[_0xd2fe('0x17')]!=='VIRTUAL'){var _0x50a2ff={};_0x50a2ff[_0x4dd379[_0xd2fe('0x11')]]={'$like':'%'+_0x5486e2[_0xd2fe('0x1b')][_0xd2fe('0x33')]+'%'};return _0x50a2ff;}})});}_0x40162f=_[_0xd2fe('0x35')]({},_0x40162f,_0x5486e2[_0xd2fe('0x36')]);var _0x4e0b4d={'where':_0x40162f[_0xd2fe('0x34')]};return db['CmHopper']['count'](_0x4e0b4d)[_0xd2fe('0x37')](function(_0x325ef7){_0x3ca715[_0xd2fe('0xa')]=_0x325ef7;if(_0x5486e2[_0xd2fe('0x1b')][_0xd2fe('0x38')]){_0x40162f[_0xd2fe('0x39')]=[{'all':!![]}];}return db[_0xd2fe('0x14')]['findAll'](_0x40162f);})[_0xd2fe('0x37')](function(_0x135829){_0x3ca715[_0xd2fe('0x3a')]=_0x135829;return _0x3ca715;})['then'](respondWithFilteredResult(_0xe958a0,_0x40162f))['catch'](handleError(_0xe958a0,null));};exports[_0xd2fe('0x3b')]=function(_0x3b0c00,_0x11a6df){var _0x1151e7={'raw':!![],'where':{'id':_0x3b0c00[_0xd2fe('0x3c')]['id']}},_0x3c6267={};_0x3c6267[_0xd2fe('0x19')]=_['keys'](db[_0xd2fe('0x14')][_0xd2fe('0x15')]);_0x3c6267['query']=_[_0xd2fe('0x1a')](_0x3b0c00[_0xd2fe('0x1b')]);_0x3c6267[_0xd2fe('0x1c')]=_[_0xd2fe('0x1d')](_0x3c6267['model'],_0x3c6267[_0xd2fe('0x1b')]);_0x1151e7[_0xd2fe('0x2d')]=_[_0xd2fe('0x1d')](_0x3c6267[_0xd2fe('0x19')],qs['fields'](_0x3b0c00[_0xd2fe('0x1b')][_0xd2fe('0x2e')]));_0x1151e7[_0xd2fe('0x2d')]=_0x1151e7['attributes'][_0xd2fe('0x2f')]?_0x1151e7[_0xd2fe('0x2d')]:_0x3c6267[_0xd2fe('0x19')];if(_0x3b0c00['query'][_0xd2fe('0x38')]){_0x1151e7[_0xd2fe('0x39')]=[{'all':!![]}];}_0x1151e7=_['merge']({},_0x1151e7,_0x3b0c00['options']);return db['CmHopper'][_0xd2fe('0x3d')](_0x1151e7)[_0xd2fe('0x37')](handleEntityNotFound(_0x11a6df,null))['then'](respondWithResult(_0x11a6df,null))[_0xd2fe('0x3e')](handleError(_0x11a6df,null));};exports[_0xd2fe('0x3f')]=function(_0x17589d,_0x5e6f7d){return db[_0xd2fe('0x14')][_0xd2fe('0x3f')](_0x17589d[_0xd2fe('0x40')],{})[_0xd2fe('0x37')](respondWithResult(_0x5e6f7d,0xc9))[_0xd2fe('0x3e')](handleError(_0x5e6f7d,null));};exports[_0xd2fe('0xe')]=function(_0x36baa2,_0x4fe5cb){if(_0x36baa2[_0xd2fe('0x40')]['id']){delete _0x36baa2[_0xd2fe('0x40')]['id'];}return db[_0xd2fe('0x14')][_0xd2fe('0x3d')]({'where':{'id':_0x36baa2[_0xd2fe('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4fe5cb,null))['then'](saveUpdates(_0x36baa2[_0xd2fe('0x40')],null))[_0xd2fe('0x37')](respondWithResult(_0x4fe5cb,null))[_0xd2fe('0x3e')](handleError(_0x4fe5cb,null));};exports['describe']=function(_0x5c4956,_0xc09227){return db[_0xd2fe('0x14')][_0xd2fe('0x41')]()[_0xd2fe('0x37')](respondWithResult(_0xc09227,null))[_0xd2fe('0x3e')](handleError(_0xc09227,null));};exports[_0xd2fe('0x42')]=function(_0x377e88,_0x13ec7d){var _0x465490;var _0x4318f4=_0x377e88[_0xd2fe('0x3c')]['id'];return db['CmHopper'][_0xd2fe('0x3d')]({'where':{'id':_0x377e88[_0xd2fe('0x3c')]['id']}})[_0xd2fe('0x37')](handleEntityNotFound(_0x13ec7d,null))['then'](function(_0xcf824e){if(_0xcf824e){return _0xcf824e['destroy']()['then'](function(_0x2238be){return _0x2238be;});}})['then'](function(_0x3be739){_0x465490=_0x3be739;if(_0x3be739){if(_0x3be739['VoiceQueueId']||_0x3be739[_0xd2fe('0x43')]){return db[_0x3be739['VoiceQueueId']?_0xd2fe('0x44'):_0xd2fe('0x45')]['find']({'where':{'id':_0x3be739['VoiceQueueId']?_0x3be739[_0xd2fe('0x46')]:_0x3be739[_0xd2fe('0x43')]},'attributes':['id','name'],'raw':!![]});}}})[_0xd2fe('0x37')](function(_0x363015){var _0xd4ce24={};if(_0x363015){_['merge'](_0xd4ce24,_['omit'](_0x465490['dataValues'],[_0xd2fe('0x47'),'updatedAt','id']));_0xd4ce24[_0xd2fe('0x48')]=0x15;_0xd4ce24[_0xd2fe('0x49')]=_0xd2fe('0x4a');_0xd4ce24[_0xd2fe('0x4b')]=_0x363015[_0xd2fe('0x11')];_0xd4ce24['membername']=_0x377e88[_0xd2fe('0x4c')][_0xd2fe('0x11')];_0xd4ce24['UserId']=_0x377e88[_0xd2fe('0x4c')]['id'];_0xd4ce24[_0xd2fe('0x4a')]=!![];_0xd4ce24['deletedat']=moment()[_0xd2fe('0x4d')](_0xd2fe('0x4e'));_0xd4ce24[_0xd2fe('0x4f')]=_0x465490[_0xd2fe('0x50')];_0xd4ce24['campaigntype']=_0x465490['VoiceQueueId']?_0xd2fe('0x51'):_0xd2fe('0x52');return db[_0xd2fe('0x53')]['find']({'where':{'id':_0xd4ce24[_0xd2fe('0x54')]},'attributes':['firstName',_0xd2fe('0x55')]})['then'](function(_0x4107de){if(!_['isNil'](_0x13ec7d)&&!_[_0xd2fe('0x56')](_0x4107de[_0xd2fe('0x57')])){_0xd4ce24[_0xd2fe('0x58')]=_0x4107de['firstName'];if(!_[_0xd2fe('0x56')](_0x4107de['lastName'])){_0xd4ce24[_0xd2fe('0x58')]+='\x20'+_0x4107de[_0xd2fe('0x55')];}}})[_0xd2fe('0x59')](function(){return db[_0xd2fe('0x5a')]['create'](_0xd4ce24);});}})[_0xd2fe('0x37')](function(_0x52e516){return db[_0xd2fe('0x5b')][_0xd2fe('0x42')]({'where':{'CmHopperId':_0x4318f4}});})[_0xd2fe('0x37')](function(){return _0x13ec7d[_0xd2fe('0x6')](0xcc)[_0xd2fe('0x5c')]();})[_0xd2fe('0x3e')](handleError(_0x13ec7d,null));};exports['getPreview']=function(_0x20783a,_0x1c6592){var _0x4c7325=[];return db['CmContact'][_0xd2fe('0x41')]()['then'](function(_0x22948f){_0x4c7325=_[_0xd2fe('0x1a')](_0x22948f);return _0x20783a[_0xd2fe('0x4c')][_0xd2fe('0x5d')]({'where':{'type':_0xd2fe('0x5e'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xd2fe('0x5f'),'dialPreviewAutoRecallMe'],'raw':!![]});})['then'](function(_0x16d68a){if(_0x16d68a&&_0x16d68a[_0xd2fe('0x2f')]){return db['sequelize']['transaction'](function(_0x291d88){var _0x264d9d={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd2fe('0x4d')](_0xd2fe('0x4e'))},'VoiceQueueId':{'$in':_[_0xd2fe('0x13')](_0x16d68a,'id')},'$or':[{'UserId':null},{'UserId':_0x20783a[_0xd2fe('0x4c')]['id']}]};var _0x5e5d7c={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x16d68a)[_0xd2fe('0x33')]([_0xd2fe('0x60'),0x0])[_0xd2fe('0x13')]('id')[_0xd2fe('0x61')]()},'$or':[{'UserId':null},{'UserId':_0x20783a[_0xd2fe('0x4c')]['id']}]};var _0x184d39={'$or':[_0x264d9d,_0x5e5d7c]};var _0x10021b=[];if(_0x20783a[_0xd2fe('0x40')]['direction']&&_0x20783a['body'][_0xd2fe('0x62')]===_0xd2fe('0x63')){if(!_[_0xd2fe('0x64')](_0x20783a[_0xd2fe('0x40')][_0xd2fe('0x65')])){_0x184d39['id']={'$in':_0x20783a['body'][_0xd2fe('0x65')]};}_0x10021b=[[_0xd2fe('0x66'),_0xd2fe('0x67')],['scheduledAt',_0x16d68a[0x0][_0xd2fe('0x5f')]==='ASC'?_0xd2fe('0x68'):'ASC'],db[_0xd2fe('0x69')][_0xd2fe('0x6a')](_0xd2fe('0x6b')),['id',_0xd2fe('0x68')]];}else{if(!_[_0xd2fe('0x64')](_0x20783a[_0xd2fe('0x40')]['hopperIds'])){_0x184d39['id']={'$notIn':_0x20783a[_0xd2fe('0x40')][_0xd2fe('0x65')]};}_0x10021b=[[_0xd2fe('0x66'),'DESC'],[_0xd2fe('0x6c'),_0x16d68a[0x0]['dialOrderByScheduledAt']],db[_0xd2fe('0x69')]['literal'](_0xd2fe('0x6d')),['id',_0xd2fe('0x67')]];}return db[_0xd2fe('0x14')][_0xd2fe('0x6e')]({'attributes':['id',_0xd2fe('0x6f'),_0xd2fe('0x50'),_0xd2fe('0x70')],'where':_0x184d39,'order':_0x10021b,'transaction':_0x291d88,'lock':_0x291d88['LOCK'][_0xd2fe('0x71')],'include':[{'model':db[_0xd2fe('0x53')],'as':_0xd2fe('0x72'),'attributes':_0x4c7325,'include':[{'model':db[_0xd2fe('0x73')],'as':_0xd2fe('0x74'),'attributes':['id',_0xd2fe('0x11')]}]},{'model':db[_0xd2fe('0x75')],'as':_0xd2fe('0x76'),'attributes':['id','name']},{'model':db[_0xd2fe('0x44')],'as':_0xd2fe('0x77'),'attributes':['id','name','dialActive']}]})['then'](function(_0x19e1e0){if(_0x19e1e0){return _0x19e1e0[_0xd2fe('0xe')]({'UserId':_0x20783a[_0xd2fe('0x4c')]['id']},{'transaction':_0x291d88});}});});}})[_0xd2fe('0x37')](handleEntityNotFound(_0x1c6592,null))['then'](respondWithResult(_0x1c6592,null))[_0xd2fe('0x3e')](handleError(_0x1c6592,null));};exports['getPreviewRecall']=function(_0x5ca53c,_0x322cc2,_0x4f5e96){var _0x22a007=[];var _0x24a619=_0x5ca53c[_0xd2fe('0x3c')]['id'];var _0xe6d707=_0x5ca53c['user']['id'];return db[_0xd2fe('0x53')][_0xd2fe('0x41')]()[_0xd2fe('0x37')](function(_0x169ead){_0x22a007=_[_0xd2fe('0x1a')](_0x169ead);return db[_0xd2fe('0x69')]['transaction'](function(_0x4c910c){const _0x318dbf={'id':_0x24a619};return db[_0xd2fe('0x14')][_0xd2fe('0x6e')]({'attributes':['id',_0xd2fe('0x6f'),'recallme'],'where':_0x318dbf,'transaction':_0x4c910c,'lock':_0x4c910c[_0xd2fe('0x78')][_0xd2fe('0x71')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x22a007,'include':[{'model':db[_0xd2fe('0x73')],'as':_0xd2fe('0x74'),'attributes':['id',_0xd2fe('0x11')]}]},{'model':db[_0xd2fe('0x75')],'as':_0xd2fe('0x76'),'attributes':['id',_0xd2fe('0x11')]},{'model':db[_0xd2fe('0x44')],'as':_0xd2fe('0x77'),'attributes':['id','name',_0xd2fe('0x79')]}]})[_0xd2fe('0x37')](function(_0x5dbaec){if(_0x5dbaec){return _0x5dbaec[_0xd2fe('0xe')]({'UserId':_0xe6d707},{'transaction':_0x4c910c});}});});})['then'](handleEntityNotFound(_0x322cc2,null))['then'](respondWithResult(_0x322cc2,null))['catch'](handleError(_0x322cc2,null));};exports[_0xd2fe('0x7a')]=function(_0x593310,_0x655d1){return _0x593310[_0xd2fe('0x4c')][_0xd2fe('0x5d')]({'where':{'type':_0xd2fe('0x5e'),'dialActive':!![],'dialMethod':_0xd2fe('0x7b')},'attributes':['id'],'raw':!![]})['then'](function(_0x3e2088){if(_0x3e2088&&_0x3e2088[_0xd2fe('0x2f')]){return db[_0xd2fe('0x14')][_0xd2fe('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd2fe('0x4d')](_0xd2fe('0x4e'))},'VoiceQueueId':{'$in':_[_0xd2fe('0x13')](_0x3e2088,'id')},'$or':[{'UserId':null},{'UserId':_0x593310['user']['id']}]}});}return 0x0;})[_0xd2fe('0x37')](function(_0x4ac020){if(!_[_0xd2fe('0x56')](_0x4ac020)&&_[_0xd2fe('0x7c')](_0x4ac020)){return _0x655d1[_0xd2fe('0x6')](0xc8)[_0xd2fe('0x7')]({'contacts':_0x4ac020});}else{logger['error'](_0xd2fe('0x7d'),_0xd2fe('0x7a'),0x194,_0xd2fe('0x7e'));_0x655d1[_0xd2fe('0x7f')](0x194);}})['catch'](handleError(_0x655d1,null));};exports[_0xd2fe('0x80')]=function(_0x872048,_0x159ba2){var _0x2c370f=shared[_0xd2fe('0x81')];var _0x275608=[];_[_0xd2fe('0x13')](_0x2c370f,function(_0x59153c){_0x275608['push']({'id':_0x59153c[_0xd2fe('0x11')],'name':_0x59153c[_0xd2fe('0x11')],'utcOffset':_0x59153c[_0xd2fe('0x82')]});});return _0x159ba2[_0xd2fe('0x6')](0xc8)[_0xd2fe('0x7')]({'tz':_0x275608});};exports[_0xd2fe('0x83')]=function(_0x36cbb0,_0x3d3d00){var _0x167922=shared[_0xd2fe('0x81')];var _0x35687b={};if(!_[_0xd2fe('0x56')](_0x167922[_0x36cbb0[_0xd2fe('0x40')]['id']]))_0x35687b=_0x167922[_0x36cbb0[_0xd2fe('0x40')]['id']];return _0x3d3d00[_0xd2fe('0x6')](0xc8)[_0xd2fe('0x7')](_0x35687b);}; \ No newline at end of file +var _0x6c32=['type','keys','filters','model','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$not','$in','$notIn','$notLike','$notILike','$like','$overlap','$contains','$contained','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','rawAttributes','include','create','body','find','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','updatedAt','state','statedesc','deleted','campaign','user','format','calleridnum','phone','campaigntype','CmContact','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','prev','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','Contact','Company','List','dialActive','getPreviewRecall','UPDATE','CmCompany','CmList','Queue','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','push','getTimezone','timezones','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','update','then','stack','name','index','map','CmHopper','fieldName'];(function(_0x3c0a9d,_0x37d2f0){var _0x52fae3=function(_0x34d290){while(--_0x34d290){_0x3c0a9d['push'](_0x3c0a9d['shift']());}};_0x52fae3(++_0x37d2f0);}(_0x6c32,0x6e));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x26c3('0x0'));var _=require(_0x26c3('0x1'));var qs=require(_0x26c3('0x2'));var logger=require(_0x26c3('0x3'))(_0x26c3('0x4'));var shared=require(_0x26c3('0x5'));var db=require(_0x26c3('0x6'))['db'];function respondWithResult(_0x321cc5,_0x36528a){_0x36528a=_0x36528a||0xc8;return function(_0x49d4a1){if(_0x49d4a1){return _0x321cc5[_0x26c3('0x7')](_0x36528a)[_0x26c3('0x8')](_0x49d4a1);}};}function respondWithFilteredResult(_0x15ac36,_0x57d915){return function(_0x187b81){if(_0x187b81){var _0x5b3a5f=typeof _0x57d915[_0x26c3('0x9')]===_0x26c3('0xa')&&typeof _0x57d915[_0x26c3('0xb')]===_0x26c3('0xa');var _0x2bbb9a=_0x187b81[_0x26c3('0xc')];var _0x155187=_0x5b3a5f?0x0:_0x57d915[_0x26c3('0x9')];var _0x356992=_0x5b3a5f?_0x187b81[_0x26c3('0xc')]:_0x57d915['offset']+_0x57d915['limit'];var _0x4aa8e2;if(_0x356992>=_0x2bbb9a){_0x356992=_0x2bbb9a;_0x4aa8e2=0xc8;}else{_0x4aa8e2=0xce;}_0x15ac36['status'](_0x4aa8e2);return _0x15ac36[_0x26c3('0xd')](_0x26c3('0xe'),_0x155187+'-'+_0x356992+'/'+_0x2bbb9a)[_0x26c3('0x8')](_0x187b81);}return null;};}function saveUpdates(_0x457fc9,_0x4b8d92){return function(_0x4c7b94){if(_0x4c7b94){return _0x4c7b94[_0x26c3('0xf')](_0x457fc9)[_0x26c3('0x10')](function(_0xbbbec7){return _0xbbbec7;});}return null;};}function handleEntityNotFound(_0x3cd3c7,_0x17c399){return function(_0x568d0b){if(!_0x568d0b){_0x3cd3c7['sendStatus'](0x194);}return _0x568d0b;};}function handleError(_0x2acfb1,_0xc14c69){_0xc14c69=_0xc14c69||0x1f4;return function(_0x4f4256){logger['error'](_0x4f4256[_0x26c3('0x11')]);if(_0x4f4256['name']){delete _0x4f4256[_0x26c3('0x12')];}_0x2acfb1['status'](_0xc14c69)['send'](_0x4f4256);};}exports[_0x26c3('0x13')]=function(_0x5545ee,_0x38fe17){var _0x50a3e5={},_0x170039={},_0x2613e2={'count':0x0,'rows':[]};var _0x1405fb=_[_0x26c3('0x14')](db[_0x26c3('0x15')]['rawAttributes'],function(_0x5c530f){return{'name':_0x5c530f[_0x26c3('0x16')],'type':_0x5c530f[_0x26c3('0x17')]['key']};});_0x170039['model']=_[_0x26c3('0x14')](_0x1405fb,'name');_0x170039['query']=_[_0x26c3('0x18')](_0x5545ee['query']);_0x170039[_0x26c3('0x19')]=_['intersection'](_0x170039[_0x26c3('0x1a')],_0x170039['query']);_0x170039[_0x26c3('0x19')]=_[_0x26c3('0x1b')](_0x170039[_0x26c3('0x19')],[_0x26c3('0x1c'),_0x26c3('0x1d'),_0x26c3('0x1e'),_0x26c3('0x1f'),_0x26c3('0x20'),_0x26c3('0x21'),_0x26c3('0x22'),'$eq',_0x26c3('0x23'),'$between','$notBetween',_0x26c3('0x24'),_0x26c3('0x25'),'$like',_0x26c3('0x26'),'$iLike',_0x26c3('0x27'),_0x26c3('0x28'),_0x26c3('0x29'),_0x26c3('0x2a'),_0x26c3('0x2b'),'$any']);_0x50a3e5[_0x26c3('0x2c')]=_[_0x26c3('0x2d')](_0x170039[_0x26c3('0x1a')],qs[_0x26c3('0x2e')](_0x5545ee[_0x26c3('0x2f')][_0x26c3('0x2e')]));_0x50a3e5['attributes']=_0x50a3e5[_0x26c3('0x2c')][_0x26c3('0x30')]?_0x50a3e5[_0x26c3('0x2c')]:_0x170039['model'];if(!_0x5545ee[_0x26c3('0x2f')][_0x26c3('0x31')](_0x26c3('0x32'))){_0x50a3e5[_0x26c3('0xb')]=qs[_0x26c3('0xb')](_0x5545ee[_0x26c3('0x2f')]['limit']);_0x50a3e5[_0x26c3('0x9')]=qs[_0x26c3('0x9')](_0x5545ee['query']['offset']);}_0x50a3e5['order']=qs['sort'](_0x5545ee['query'][_0x26c3('0x33')]);_0x50a3e5[_0x26c3('0x34')]=qs['filters'](_[_0x26c3('0x35')](_0x5545ee[_0x26c3('0x2f')],_0x170039['filters']),_0x1405fb);if(_0x5545ee['query'][_0x26c3('0x36')]){_0x50a3e5['where']=_[_0x26c3('0x37')](_0x50a3e5['where'],{'$or':_[_0x26c3('0x14')](_0x1405fb,function(_0x40e41c){if(_0x40e41c[_0x26c3('0x17')]!==_0x26c3('0x38')){var _0x474349={};_0x474349[_0x40e41c['name']]={'$like':'%'+_0x5545ee[_0x26c3('0x2f')][_0x26c3('0x36')]+'%'};return _0x474349;}})});}_0x50a3e5=_[_0x26c3('0x37')]({},_0x50a3e5,_0x5545ee[_0x26c3('0x39')]);var _0x43145f={'where':_0x50a3e5[_0x26c3('0x34')]};return db['CmHopper']['count'](_0x43145f)[_0x26c3('0x10')](function(_0xcdb3fb){_0x2613e2[_0x26c3('0xc')]=_0xcdb3fb;if(_0x5545ee[_0x26c3('0x2f')][_0x26c3('0x3a')]){_0x50a3e5['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x50a3e5);})[_0x26c3('0x10')](function(_0x3fc4f7){_0x2613e2[_0x26c3('0x3b')]=_0x3fc4f7;return _0x2613e2;})[_0x26c3('0x10')](respondWithFilteredResult(_0x38fe17,_0x50a3e5))[_0x26c3('0x3c')](handleError(_0x38fe17,null));};exports['show']=function(_0x592764,_0x6db262){var _0x16e680={'raw':!![],'where':{'id':_0x592764[_0x26c3('0x3d')]['id']}},_0x2d9e80={};_0x2d9e80['model']=_[_0x26c3('0x18')](db[_0x26c3('0x15')][_0x26c3('0x3e')]);_0x2d9e80[_0x26c3('0x2f')]=_[_0x26c3('0x18')](_0x592764[_0x26c3('0x2f')]);_0x2d9e80[_0x26c3('0x19')]=_[_0x26c3('0x2d')](_0x2d9e80[_0x26c3('0x1a')],_0x2d9e80[_0x26c3('0x2f')]);_0x16e680[_0x26c3('0x2c')]=_[_0x26c3('0x2d')](_0x2d9e80[_0x26c3('0x1a')],qs['fields'](_0x592764[_0x26c3('0x2f')][_0x26c3('0x2e')]));_0x16e680[_0x26c3('0x2c')]=_0x16e680[_0x26c3('0x2c')][_0x26c3('0x30')]?_0x16e680[_0x26c3('0x2c')]:_0x2d9e80['model'];if(_0x592764[_0x26c3('0x2f')]['includeAll']){_0x16e680[_0x26c3('0x3f')]=[{'all':!![]}];}_0x16e680=_['merge']({},_0x16e680,_0x592764[_0x26c3('0x39')]);return db[_0x26c3('0x15')]['find'](_0x16e680)[_0x26c3('0x10')](handleEntityNotFound(_0x6db262,null))[_0x26c3('0x10')](respondWithResult(_0x6db262,null))[_0x26c3('0x3c')](handleError(_0x6db262,null));};exports[_0x26c3('0x40')]=function(_0x651d74,_0x4a7d48){return db[_0x26c3('0x15')]['create'](_0x651d74[_0x26c3('0x41')],{})['then'](respondWithResult(_0x4a7d48,0xc9))['catch'](handleError(_0x4a7d48,null));};exports[_0x26c3('0xf')]=function(_0x2b86da,_0x278563){if(_0x2b86da['body']['id']){delete _0x2b86da[_0x26c3('0x41')]['id'];}return db[_0x26c3('0x15')][_0x26c3('0x42')]({'where':{'id':_0x2b86da[_0x26c3('0x3d')]['id']}})[_0x26c3('0x10')](handleEntityNotFound(_0x278563,null))[_0x26c3('0x10')](saveUpdates(_0x2b86da['body'],null))[_0x26c3('0x10')](respondWithResult(_0x278563,null))[_0x26c3('0x3c')](handleError(_0x278563,null));};exports[_0x26c3('0x43')]=function(_0x133cf7,_0x551e22){return db[_0x26c3('0x15')][_0x26c3('0x43')]()['then'](respondWithResult(_0x551e22,null))[_0x26c3('0x3c')](handleError(_0x551e22,null));};exports[_0x26c3('0x44')]=function(_0x522fe2,_0x4566ab){var _0x4827c6;var _0x2c6d8b=_0x522fe2[_0x26c3('0x3d')]['id'];return db[_0x26c3('0x15')][_0x26c3('0x42')]({'where':{'id':_0x522fe2[_0x26c3('0x3d')]['id']}})[_0x26c3('0x10')](handleEntityNotFound(_0x4566ab,null))[_0x26c3('0x10')](function(_0x4b7578){if(_0x4b7578){return _0x4b7578[_0x26c3('0x44')]()['then'](function(_0x4ada42){return _0x4ada42;});}})[_0x26c3('0x10')](function(_0x3a46f9){_0x4827c6=_0x3a46f9;if(_0x3a46f9){if(_0x3a46f9[_0x26c3('0x45')]||_0x3a46f9['CampaignId']){return db[_0x3a46f9['VoiceQueueId']?_0x26c3('0x46'):_0x26c3('0x47')][_0x26c3('0x42')]({'where':{'id':_0x3a46f9['VoiceQueueId']?_0x3a46f9[_0x26c3('0x45')]:_0x3a46f9[_0x26c3('0x48')]},'attributes':['id',_0x26c3('0x12')],'raw':!![]});}}})['then'](function(_0x24f3a1){var _0x4f3564={};if(_0x24f3a1){_[_0x26c3('0x37')](_0x4f3564,_[_0x26c3('0x49')](_0x4827c6[_0x26c3('0x4a')],['createdAt',_0x26c3('0x4b'),'id']));_0x4f3564[_0x26c3('0x4c')]=0x15;_0x4f3564[_0x26c3('0x4d')]=_0x26c3('0x4e');_0x4f3564[_0x26c3('0x4f')]=_0x24f3a1[_0x26c3('0x12')];_0x4f3564['membername']=_0x522fe2[_0x26c3('0x50')][_0x26c3('0x12')];_0x4f3564['UserId']=_0x522fe2[_0x26c3('0x50')]['id'];_0x4f3564['deleted']=!![];_0x4f3564['deletedat']=moment()[_0x26c3('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f3564[_0x26c3('0x52')]=_0x4827c6[_0x26c3('0x53')];_0x4f3564[_0x26c3('0x54')]=_0x4827c6[_0x26c3('0x45')]?'queue':'ivr';return db[_0x26c3('0x55')]['find']({'where':{'id':_0x4f3564['ContactId']},'attributes':['firstName',_0x26c3('0x56')]})['then'](function(_0x4a0100){if(!_[_0x26c3('0x57')](_0x4566ab)&&!_[_0x26c3('0x57')](_0x4a0100[_0x26c3('0x58')])){_0x4f3564[_0x26c3('0x59')]=_0x4a0100[_0x26c3('0x58')];if(!_[_0x26c3('0x57')](_0x4a0100['lastName'])){_0x4f3564[_0x26c3('0x59')]+='\x20'+_0x4a0100[_0x26c3('0x56')];}}})[_0x26c3('0x5a')](function(){return db[_0x26c3('0x5b')]['create'](_0x4f3564);});}})[_0x26c3('0x10')](function(_0x2c8390){return db[_0x26c3('0x5c')][_0x26c3('0x44')]({'where':{'CmHopperId':_0x2c6d8b}});})[_0x26c3('0x10')](function(){return _0x4566ab[_0x26c3('0x7')](0xcc)['end']();})[_0x26c3('0x3c')](handleError(_0x4566ab,null));};exports[_0x26c3('0x5d')]=function(_0x34c041,_0x3ad7b1){var _0x5cc9fc=[];return db[_0x26c3('0x55')][_0x26c3('0x43')]()[_0x26c3('0x10')](function(_0x416373){_0x5cc9fc=_['keys'](_0x416373);return _0x34c041[_0x26c3('0x50')][_0x26c3('0x5e')]({'where':{'type':_0x26c3('0x5f'),'dialActive':!![],'dialMethod':_0x26c3('0x60')},'attributes':['id','dialOrderByScheduledAt',_0x26c3('0x61')],'raw':!![]});})['then'](function(_0x2ada84){if(_0x2ada84&&_0x2ada84['length']){return db[_0x26c3('0x62')][_0x26c3('0x63')](function(_0x4bfda1){var _0x4518bc={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x26c3('0x51')](_0x26c3('0x64'))},'VoiceQueueId':{'$in':_[_0x26c3('0x14')](_0x2ada84,'id')},'$or':[{'UserId':null},{'UserId':_0x34c041[_0x26c3('0x50')]['id']}]};var _0x4fbd2e={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2ada84)[_0x26c3('0x36')]([_0x26c3('0x61'),0x0])[_0x26c3('0x14')]('id')[_0x26c3('0x65')]()},'$or':[{'UserId':null},{'UserId':_0x34c041[_0x26c3('0x50')]['id']}]};var _0x3268d7={'$or':[_0x4518bc,_0x4fbd2e]};var _0x38cd7e=[];if(_0x34c041['body'][_0x26c3('0x66')]&&_0x34c041[_0x26c3('0x41')][_0x26c3('0x66')]===_0x26c3('0x67')){if(!_['isEmpty'](_0x34c041[_0x26c3('0x41')][_0x26c3('0x68')])){_0x3268d7['id']={'$in':_0x34c041['body'][_0x26c3('0x68')]};}_0x38cd7e=[[_0x26c3('0x69'),_0x26c3('0x6a')],[_0x26c3('0x6b'),_0x2ada84[0x0][_0x26c3('0x6c')]===_0x26c3('0x6a')?_0x26c3('0x6d'):_0x26c3('0x6a')],db[_0x26c3('0x62')][_0x26c3('0x6e')](_0x26c3('0x6f')),['id',_0x26c3('0x6d')]];}else{if(!_['isEmpty'](_0x34c041['body']['hopperIds'])){_0x3268d7['id']={'$notIn':_0x34c041['body'][_0x26c3('0x68')]};}_0x38cd7e=[[_0x26c3('0x69'),_0x26c3('0x6d')],[_0x26c3('0x6b'),_0x2ada84[0x0][_0x26c3('0x6c')]],db[_0x26c3('0x62')][_0x26c3('0x6e')](_0x26c3('0x70')),['id','ASC']];}return db[_0x26c3('0x15')][_0x26c3('0x71')]({'attributes':['id',_0x26c3('0x72'),_0x26c3('0x53'),_0x26c3('0x73')],'where':_0x3268d7,'order':_0x38cd7e,'transaction':_0x4bfda1,'lock':_0x4bfda1[_0x26c3('0x74')]['UPDATE'],'include':[{'model':db[_0x26c3('0x55')],'as':_0x26c3('0x75'),'attributes':_0x5cc9fc,'include':[{'model':db['CmCompany'],'as':_0x26c3('0x76'),'attributes':['id',_0x26c3('0x12')]}]},{'model':db['CmList'],'as':_0x26c3('0x77'),'attributes':['id',_0x26c3('0x12')]},{'model':db[_0x26c3('0x46')],'as':'Queue','attributes':['id',_0x26c3('0x12'),_0x26c3('0x78')]}]})[_0x26c3('0x10')](function(_0x13f0ac){if(_0x13f0ac){return _0x13f0ac[_0x26c3('0xf')]({'UserId':_0x34c041[_0x26c3('0x50')]['id']},{'transaction':_0x4bfda1});}});});}})[_0x26c3('0x10')](handleEntityNotFound(_0x3ad7b1,null))['then'](respondWithResult(_0x3ad7b1,null))['catch'](handleError(_0x3ad7b1,null));};exports[_0x26c3('0x79')]=function(_0x1ce607,_0x1c7387,_0x18189a){var _0x56b282=[];var _0x3c03cb=_0x1ce607['params']['id'];var _0x568151=_0x1ce607[_0x26c3('0x50')]['id'];return db[_0x26c3('0x55')]['describe']()[_0x26c3('0x10')](function(_0x59a8b8){_0x56b282=_[_0x26c3('0x18')](_0x59a8b8);return db[_0x26c3('0x62')][_0x26c3('0x63')](function(_0x5bbaae){const _0xc40965={'id':_0x3c03cb};return db['CmHopper'][_0x26c3('0x71')]({'attributes':['id',_0x26c3('0x72'),_0x26c3('0x73')],'where':_0xc40965,'transaction':_0x5bbaae,'lock':_0x5bbaae[_0x26c3('0x74')][_0x26c3('0x7a')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x56b282,'include':[{'model':db[_0x26c3('0x7b')],'as':_0x26c3('0x76'),'attributes':['id','name']}]},{'model':db[_0x26c3('0x7c')],'as':_0x26c3('0x77'),'attributes':['id',_0x26c3('0x12')]},{'model':db['VoiceQueue'],'as':_0x26c3('0x7d'),'attributes':['id',_0x26c3('0x12'),'dialActive']}]})['then'](function(_0x1440c9){if(_0x1440c9){return _0x1440c9[_0x26c3('0xf')]({'UserId':_0x568151},{'transaction':_0x5bbaae});}});});})[_0x26c3('0x10')](handleEntityNotFound(_0x1c7387,null))[_0x26c3('0x10')](respondWithResult(_0x1c7387,null))[_0x26c3('0x3c')](handleError(_0x1c7387,null));};exports[_0x26c3('0x7e')]=function(_0x483458,_0x3ca3d7){return _0x483458[_0x26c3('0x50')]['getVoiceQueues']({'where':{'type':_0x26c3('0x5f'),'dialActive':!![],'dialMethod':_0x26c3('0x60')},'attributes':['id'],'raw':!![]})[_0x26c3('0x10')](function(_0x54691c){if(_0x54691c&&_0x54691c[_0x26c3('0x30')]){return db[_0x26c3('0x15')][_0x26c3('0xc')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x26c3('0x51')](_0x26c3('0x64'))},'VoiceQueueId':{'$in':_['map'](_0x54691c,'id')},'$or':[{'UserId':null},{'UserId':_0x483458['user']['id']}]}});}return 0x0;})[_0x26c3('0x10')](function(_0x469a0a){if(!_[_0x26c3('0x57')](_0x469a0a)&&_['isNumber'](_0x469a0a)){return _0x3ca3d7[_0x26c3('0x7')](0xc8)[_0x26c3('0x8')]({'contacts':_0x469a0a});}else{logger['error'](_0x26c3('0x7f'),_0x26c3('0x7e'),0x194,_0x26c3('0x80'));_0x3ca3d7['sendStatus'](0x194);}})[_0x26c3('0x3c')](handleError(_0x3ca3d7,null));};exports[_0x26c3('0x81')]=function(_0x452a3e,_0x188f2e){var _0x4e9d4b=shared['timezones'];var _0x34acb7=[];_[_0x26c3('0x14')](_0x4e9d4b,function(_0x1be246){_0x34acb7[_0x26c3('0x82')]({'id':_0x1be246[_0x26c3('0x12')],'name':_0x1be246[_0x26c3('0x12')],'utcOffset':_0x1be246['utcOffset']});});return _0x188f2e[_0x26c3('0x7')](0xc8)[_0x26c3('0x8')]({'tz':_0x34acb7});};exports[_0x26c3('0x83')]=function(_0x44a99e,_0x2c91f1){var _0x23f7af=shared[_0x26c3('0x84')];var _0x1da826={};if(!_[_0x26c3('0x57')](_0x23f7af[_0x44a99e[_0x26c3('0x41')]['id']]))_0x1da826=_0x23f7af[_0x44a99e['body']['id']];return _0x2c91f1[_0x26c3('0x7')](0xc8)[_0x26c3('0x8')](_0x1da826);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 7de6f4a..3a5fb3c 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 _0x187d=['moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api'];(function(_0x448e8d,_0x43a056){var _0x46e774=function(_0x22f0be){while(--_0x22f0be){_0x448e8d['push'](_0x448e8d['shift']());}};_0x46e774(++_0x43a056);}(_0x187d,0x93));var _0xd187=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x187d[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[{'name':_0xd187('0xc'),'fields':[_0xd187('0xc')]},{'name':_0xd187('0xd'),'fields':['phone']},{'name':_0xd187('0xe'),'fields':[_0xd187('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xba34=['priority','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper','scheduledat','phone'];(function(_0x33d239,_0x24bb87){var _0x6784c2=function(_0x2d8fb6){while(--_0x2d8fb6){_0x33d239['push'](_0x33d239['shift']());}};_0x6784c2(++_0x24bb87);}(_0xba34,0x119));var _0x4ba3=function(_0x2b1947,_0x5dad19){_0x2b1947=_0x2b1947-0x0;var _0x1c3b8b=_0xba34[_0x2b1947];return _0x1c3b8b;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('CmHopper',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[{'name':_0x4ba3('0xb'),'fields':[_0x4ba3('0xb')]},{'name':_0x4ba3('0xc'),'fields':[_0x4ba3('0xc')]},{'name':_0x4ba3('0xd'),'fields':[_0x4ba3('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 2ad5de7..9b22612 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 _0x940d=['rpc','GetCmHopper','CmHopper','findAll','options','raw','attributes','limit','include','model','map','info','stringify','catch','error','message','ShowCmHopper','find','where','then','debug','CreateCmHopper','create','UpdateCmHopper','update','body','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','order','LOCK','UPDATE','Contact','keys','Agent','name','voicePause','UserId','push','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','transaction','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','GetContactRecallMe','GetCmHopperPreview','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','literal','NOW()','User','CmList','List','lodash','util','bluebird','../../mysqldb','../../config/logger'];(function(_0x1cd925,_0x18abf8){var _0x35e7ce=function(_0x453929){while(--_0x453929){_0x1cd925['push'](_0x1cd925['shift']());}};_0x35e7ce(++_0x18abf8);}(_0x940d,0x181));var _0xd940=function(_0x29d793,_0x2e147c){_0x29d793=_0x29d793-0x0;var _0x2a4e69=_0x940d[_0x29d793];return _0x2a4e69;};'use strict';var _=require(_0xd940('0x0'));var util=require(_0xd940('0x1'));var moment=require('moment');var BPromise=require(_0xd940('0x2'));var db=require(_0xd940('0x3'))['db'];var logger=require(_0xd940('0x4'))(_0xd940('0x5'));exports[_0xd940('0x6')]=function(_0x3615b1){var _0xbc022b=this;return new Promise(function(_0x338c63,_0x48b456){return db[_0xd940('0x7')][_0xd940('0x8')]({'raw':_0x3615b1[_0xd940('0x9')]?_0x3615b1[_0xd940('0x9')][_0xd940('0xa')]===undefined?!![]:![]:!![],'where':_0x3615b1[_0xd940('0x9')]?_0x3615b1[_0xd940('0x9')]['where']||null:null,'attributes':_0x3615b1['options']?_0x3615b1[_0xd940('0x9')][_0xd940('0xb')]||null:null,'limit':_0x3615b1[_0xd940('0x9')]?_0x3615b1[_0xd940('0x9')][_0xd940('0xc')]||null:null,'include':_0x3615b1[_0xd940('0x9')]?_0x3615b1[_0xd940('0x9')]['include']?_['map'](_0x3615b1['options'][_0xd940('0xd')],function(_0x373997){return{'model':db[_0x373997[_0xd940('0xe')]],'as':_0x373997['as'],'attributes':_0x373997[_0xd940('0xb')],'include':_0x373997['include']?_[_0xd940('0xf')](_0x373997[_0xd940('0xd')],function(_0x15c6ec){return{'model':db[_0x15c6ec['model']],'as':_0x15c6ec['as'],'attributes':_0x15c6ec[_0xd940('0xb')],'include':_0x15c6ec['include']?_[_0xd940('0xf')](_0x15c6ec[_0xd940('0xd')],function(_0x25749f){return{'model':db[_0x25749f[_0xd940('0xe')]],'as':_0x25749f['as'],'attributes':_0x25749f[_0xd940('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a2fd2){logger[_0xd940('0x10')]('GetCmHopper',_0x3615b1);logger['debug'](_0xd940('0x6'),_0x3615b1,JSON[_0xd940('0x11')](_0x3a2fd2));_0x338c63(_0x3a2fd2);})[_0xd940('0x12')](function(_0x116928){logger[_0xd940('0x13')](_0xd940('0x6'),_0x116928[_0xd940('0x14')],_0x3615b1);_0x48b456(_0xbc022b['error'](0x1f4,_0x116928[_0xd940('0x14')]));});});};exports[_0xd940('0x15')]=function(_0x13903a){var _0x5ded1e=this;return new Promise(function(_0x2cda82,_0x3b4a32){return db['CmHopper'][_0xd940('0x16')]({'raw':_0x13903a['options']?_0x13903a[_0xd940('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x13903a[_0xd940('0x9')]?_0x13903a[_0xd940('0x9')][_0xd940('0x17')]||null:null,'attributes':_0x13903a[_0xd940('0x9')]?_0x13903a[_0xd940('0x9')][_0xd940('0xb')]||null:null,'include':_0x13903a[_0xd940('0x9')]?_0x13903a[_0xd940('0x9')][_0xd940('0xd')]?_[_0xd940('0xf')](_0x13903a[_0xd940('0x9')]['include'],function(_0x39a72c){return{'model':db[_0x39a72c[_0xd940('0xe')]],'as':_0x39a72c['as'],'attributes':_0x39a72c[_0xd940('0xb')],'include':_0x39a72c['include']?_[_0xd940('0xf')](_0x39a72c[_0xd940('0xd')],function(_0x219e18){return{'model':db[_0x219e18[_0xd940('0xe')]],'as':_0x219e18['as'],'attributes':_0x219e18[_0xd940('0xb')],'include':_0x219e18[_0xd940('0xd')]?_['map'](_0x219e18[_0xd940('0xd')],function(_0x23d492){return{'model':db[_0x23d492[_0xd940('0xe')]],'as':_0x23d492['as'],'attributes':_0x23d492['attributes']};}):[]};}):[]};}):[]:[]})[_0xd940('0x18')](function(_0x197412){logger[_0xd940('0x10')](_0xd940('0x15'),_0x13903a);logger[_0xd940('0x19')](_0xd940('0x15'),_0x13903a,JSON[_0xd940('0x11')](_0x197412));_0x2cda82(_0x197412);})['catch'](function(_0x52d6fd){logger[_0xd940('0x13')](_0xd940('0x15'),_0x52d6fd[_0xd940('0x14')],_0x13903a);_0x3b4a32(_0x5ded1e[_0xd940('0x13')](0x1f4,_0x52d6fd['message']));});});};exports[_0xd940('0x1a')]=function(_0x3b7364){var _0x1f496a=this;return new Promise(function(_0x245eb7,_0x78323d){return db[_0xd940('0x7')][_0xd940('0x1b')](_0x3b7364['body'],{'raw':_0x3b7364['options']?_0x3b7364[_0xd940('0x9')][_0xd940('0xa')]===undefined?!![]:![]:!![]})['then'](function(_0x3efa49){logger[_0xd940('0x10')]('CreateCmHopper',_0x3b7364);logger[_0xd940('0x19')](_0xd940('0x1a'),_0x3b7364,JSON[_0xd940('0x11')](_0x3efa49));_0x245eb7(_0x3efa49);})['catch'](function(_0x52abea){logger[_0xd940('0x13')]('CreateCmHopper',_0x52abea['message'],_0x3b7364);_0x78323d(_0x1f496a[_0xd940('0x13')](0x1f4,_0x52abea['message']));});});};exports[_0xd940('0x1c')]=function(_0x23b763){var _0x5ebcd2=this;return new Promise(function(_0x2c956e,_0xc594da){return db[_0xd940('0x7')][_0xd940('0x1d')](_0x23b763['body'],{'raw':_0x23b763[_0xd940('0x9')]?_0x23b763['options'][_0xd940('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23b763[_0xd940('0x9')]?_0x23b763[_0xd940('0x9')][_0xd940('0x17')]||null:null,'attributes':_0x23b763[_0xd940('0x9')]?_0x23b763[_0xd940('0x9')][_0xd940('0xb')]||null:null,'limit':_0x23b763[_0xd940('0x9')]?_0x23b763['options']['limit']||null:null})[_0xd940('0x18')](function(_0x68427c){logger['info'](_0xd940('0x1c'),_0x23b763);logger[_0xd940('0x10')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xd940('0x11')](_0x23b763[_0xd940('0x9')]['where']),_0x23b763[_0xd940('0x1e')][_0xd940('0x1f')]);logger['debug']('UpdateCmHopper',_0x23b763,JSON[_0xd940('0x11')](_0x68427c));_0x2c956e(_0x68427c);})[_0xd940('0x12')](function(_0x374399){logger[_0xd940('0x13')](_0xd940('0x1c'),_0x374399[_0xd940('0x14')],_0x23b763);_0xc594da(_0x5ebcd2[_0xd940('0x13')](0x1f4,_0x374399['message']));});});};exports[_0xd940('0x20')]=function(_0x1a0fca){var _0x29929b=this;return new Promise(function(_0x2c5e67,_0x2cfa17){return db[_0xd940('0x7')][_0xd940('0x21')]({'where':_0x1a0fca[_0xd940('0x9')]?_0x1a0fca['options']['where']||null:null})[_0xd940('0x18')](function(_0x838007){logger['info'](_0xd940('0x20'),_0x1a0fca);logger[_0xd940('0x19')](_0xd940('0x20'),_0x1a0fca,JSON[_0xd940('0x11')](_0x838007));_0x2c5e67(_0x838007);})[_0xd940('0x12')](function(_0xfe20db){logger[_0xd940('0x13')](_0xd940('0x20'),_0xfe20db[_0xd940('0x14')],_0x1a0fca);_0x2cfa17(_0x29929b['error'](0x1f4,_0xfe20db[_0xd940('0x14')]));});});};exports[_0xd940('0x22')]=function(_0x561376){var _0x3a5a19=this;return new Promise(function(_0x4debe5,_0x154ef9){return db[_0xd940('0x23')][_0xd940('0x24')]()[_0xd940('0x18')](function(_0x4908ce){return db[_0xd940('0x25')]['transaction'](function(_0x56a011){return db[_0xd940('0x7')]['findAll']({'where':_0x561376['options']?_0x561376[_0xd940('0x9')]['where']||null:null,'attributes':_0x561376['options']?_0x561376[_0xd940('0x9')][_0xd940('0xb')]||null:null,'limit':_0x561376[_0xd940('0x9')]?_0x561376[_0xd940('0x9')][_0xd940('0xc')]||null:null,'order':_0x561376['options']?_0x561376[_0xd940('0x9')][_0xd940('0x26')]||null:null,'transaction':_0x56a011,'lock':_0x56a011[_0xd940('0x27')][_0xd940('0x28')],'include':[{'model':db[_0xd940('0x23')],'as':_0xd940('0x29'),'attributes':_[_0xd940('0x2a')](_0x4908ce)},{'model':db['User'],'as':_0xd940('0x2b'),'attributes':['id',_0xd940('0x2c'),_0xd940('0x2d')]}]})[_0xd940('0x18')](function(_0x1c180f){var _0x296156=[];var _0x35eefa=[];for(var _0x35bfdd=0x0;_0x35bfdd<_0x1c180f['length'];_0x35bfdd+=0x1){var _0x823f58=_0x1c180f[_0x35bfdd][_0xd940('0x2e')];if(_0x823f58===null){_0x296156['push'](_0x1c180f[_0x35bfdd]['update'](_0x561376[_0xd940('0x1e')],{'transaction':_0x56a011}));}else if(!_0x35eefa['includes'](_0x823f58)){_0x35eefa[_0xd940('0x2f')](_0x823f58);_0x296156['push'](_0x1c180f[_0x35bfdd][_0xd940('0x1d')](_0x561376['body'],{'transaction':_0x56a011}));}}return BPromise[_0xd940('0x30')](_0x296156);});})['then'](function(_0x479f2e){logger[_0xd940('0x10')]('GetContactDialer',_0x561376);if(_0x479f2e[_0xd940('0x31')]>0x0){logger['info'](_0xd940('0x32'),_0x479f2e[0x0][_0xd940('0x33')]['id'],_0x479f2e[0x0]['dataValues'][_0xd940('0x34')],_0x479f2e[0x0][_0xd940('0x33')]['active']);}logger[_0xd940('0x19')](_0xd940('0x22'),_0x561376,JSON['stringify'](_0x479f2e));_0x4debe5(_0x479f2e);})['catch'](function(_0x34d8de){logger[_0xd940('0x13')](_0xd940('0x22'),_0x34d8de[_0xd940('0x14')],_0x561376);_0x154ef9(_0x3a5a19[_0xd940('0x13')](0x1f4,_0x34d8de[_0xd940('0x14')]));});});});};exports[_0xd940('0x35')]=function(_0x4b46e2){var _0x2ea02b=this;return new Promise(function(_0x4f24fd,_0x1b4c8c){return db['sequelize'][_0xd940('0x36')](function(_0x412aa2){return db['CmHopperFinal'][_0xd940('0x1b')](_0x4b46e2[_0xd940('0x1e')],{'raw':_0x4b46e2['options']?_0x4b46e2[_0xd940('0x9')][_0xd940('0xa')]===undefined?!![]:![]:!![],'transaction':_0x412aa2})[_0xd940('0x18')](function(){logger[_0xd940('0x10')](_0xd940('0x37'),JSON['stringify'](_0x4b46e2[_0xd940('0x9')]['where']),_0x4b46e2[_0xd940('0x9')][_0xd940('0x17')][_0xd940('0x1f')]);return db['CmHopper']['destroy']({'where':_0x4b46e2[_0xd940('0x9')]?_0x4b46e2['options'][_0xd940('0x17')]||null:null,'transaction':_0x412aa2});});})[_0xd940('0x18')](function(_0x35a793){logger[_0xd940('0x10')](_0xd940('0x35'),_0x4b46e2);logger[_0xd940('0x19')]('MoveContactManagedDialer',_0x4b46e2,JSON[_0xd940('0x11')](_0x35a793));_0x4f24fd(_0x35a793);})[_0xd940('0x12')](function(_0x631903){logger['error'](_0xd940('0x35'),_0x631903[_0xd940('0x14')],_0x4b46e2);_0x1b4c8c(_0x2ea02b[_0xd940('0x13')](0x1f4,_0x631903[_0xd940('0x14')]));});});};exports[_0xd940('0x38')]=function(_0x4fa94b){var _0xf4c94=this;return new Promise(function(_0x465f9d,_0x215f17){return db[_0xd940('0x7')][_0xd940('0x8')]({'raw':_0x4fa94b[_0xd940('0x9')]?_0x4fa94b[_0xd940('0x9')][_0xd940('0xa')]===undefined?!![]:![]:!![],'where':_0x4fa94b['options']?_0x4fa94b[_0xd940('0x9')][_0xd940('0x17')]||null:null,'attributes':[[db[_0xd940('0x25')]['fn'](_0xd940('0x39'),db[_0xd940('0x25')]['fn']('IF',db[_0xd940('0x25')]['literal'](_0xd940('0x3a')+util['format'](_0xd940('0x3b'),moment()[_0xd940('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xd940('0x3d')))),'contactsRescheduled']]})[_0xd940('0x18')](function(_0xbb0b88){logger[_0xd940('0x10')](_0xd940('0x38'),_0x4fa94b);logger[_0xd940('0x19')]('CountReScheduled',_0x4fa94b,JSON[_0xd940('0x11')](_0xbb0b88));_0x465f9d(_0xbb0b88);})[_0xd940('0x12')](function(_0x548930){logger[_0xd940('0x13')]('CountReScheduled',_0x548930[_0xd940('0x14')],_0x4fa94b);_0x215f17(_0xf4c94[_0xd940('0x13')](0x1f4,_0x548930[_0xd940('0x14')]));});});};exports['GetContactRecallMe']=function(_0x5e1f03){var _0x392445=this;return new Promise(function(_0x5cb1ba,_0x488ed){return db['CmContact']['describe']()[_0xd940('0x18')](function(){return db[_0xd940('0x25')]['transaction'](function(_0x23a35f){return db[_0xd940('0x7')]['findAll']({'where':_0x5e1f03['options']?_0x5e1f03[_0xd940('0x9')][_0xd940('0x17')]||null:null,'attributes':_0x5e1f03[_0xd940('0x9')]?_0x5e1f03[_0xd940('0x9')][_0xd940('0xb')]||null:null,'limit':0x1,'order':_0x5e1f03['options']?_0x5e1f03[_0xd940('0x9')][_0xd940('0x26')]||null:null,'group':db['CmHopper'][_0xd940('0x2e')],'transaction':_0x23a35f,'lock':_0x23a35f[_0xd940('0x27')][_0xd940('0x28')],'include':_0x5e1f03[_0xd940('0x9')]?_0x5e1f03[_0xd940('0x9')]['include']?_[_0xd940('0xf')](_0x5e1f03[_0xd940('0x9')][_0xd940('0xd')],function(_0x2c28a6){return{'model':db[_0x2c28a6['model']],'as':_0x2c28a6['as'],'attributes':_0x2c28a6[_0xd940('0xb')],'include':_0x2c28a6[_0xd940('0xd')]?_['map'](_0x2c28a6[_0xd940('0xd')],function(_0x5d6b8f){return{'model':db[_0x5d6b8f[_0xd940('0xe')]],'as':_0x5d6b8f['as'],'attributes':_0x5d6b8f[_0xd940('0xb')],'include':_0x5d6b8f[_0xd940('0xd')]?_[_0xd940('0xf')](_0x5d6b8f[_0xd940('0xd')],function(_0x44562d){return{'model':db[_0x44562d[_0xd940('0xe')]],'as':_0x44562d['as'],'attributes':_0x44562d[_0xd940('0xb')]};}):[]};}):[]};}):[]:[]})[_0xd940('0x18')](function(_0x5a5d11){var _0x4cead7=[];for(var _0x3e3554=0x0;_0x3e3554<_0x5a5d11['length'];_0x3e3554+=0x1){_0x4cead7[_0xd940('0x2f')](_0x5a5d11[_0x3e3554][_0xd940('0x1d')](_0x5e1f03[_0xd940('0x1e')],{'transaction':_0x23a35f}));}return BPromise[_0xd940('0x30')](_0x4cead7);});})[_0xd940('0x18')](function(_0x1ee7bc){logger[_0xd940('0x10')](_0xd940('0x3e'),_0x5e1f03);logger['debug'](_0xd940('0x3e'),_0x5e1f03,JSON[_0xd940('0x11')](_0x1ee7bc));_0x5cb1ba(_0x1ee7bc);})[_0xd940('0x12')](function(_0x831c45){logger[_0xd940('0x13')](_0xd940('0x3e'),_0x831c45[_0xd940('0x14')],_0x5e1f03);_0x488ed(_0x392445[_0xd940('0x13')](0x1f4,_0x831c45[_0xd940('0x14')]));});});});};exports[_0xd940('0x3f')]=function(_0x3838f2){var _0x331dea=this;return new Promise(function(_0x1ffd35,_0x4eeca8){db[_0xd940('0x23')][_0xd940('0x24')]()['then'](function(_0x251d9e){return db['CmHopper'][_0xd940('0x8')]({'raw':_0x3838f2[_0xd940('0x9')]?_0x3838f2['options'][_0xd940('0xa')]===undefined?!![]:![]:!![],'where':_0x3838f2['options']?_0x3838f2['options'][_0xd940('0x17')]||null:null,'attributes':_0x3838f2['options']?_0x3838f2[_0xd940('0x9')][_0xd940('0xb')]||null:null,'limit':_0x3838f2[_0xd940('0x9')]?_0x3838f2[_0xd940('0x9')][_0xd940('0xc')]||null:null,'include':_0x3838f2[_0xd940('0x9')]?_0x3838f2[_0xd940('0x9')][_0xd940('0xd')]?_[_0xd940('0xf')](_0x3838f2[_0xd940('0x9')][_0xd940('0xd')],function(_0x3b4eaf){return{'model':db[_0x3b4eaf[_0xd940('0xe')]],'as':_0x3b4eaf['as'],'attributes':_0x3b4eaf['as']===_0xd940('0x29')?_[_0xd940('0x2a')](_0x251d9e):_0x3b4eaf[_0xd940('0xb')],'include':_0x3b4eaf[_0xd940('0xd')]?_['map'](_0x3b4eaf[_0xd940('0xd')],function(_0xc6e66b){return{'model':db[_0xc6e66b[_0xd940('0xe')]],'as':_0xc6e66b['as'],'attributes':_0xc6e66b['attributes'],'include':_0xc6e66b[_0xd940('0xd')]?_[_0xd940('0xf')](_0xc6e66b[_0xd940('0xd')],function(_0x371d02){return{'model':db[_0x371d02[_0xd940('0xe')]],'as':_0x371d02['as'],'attributes':_0x371d02[_0xd940('0xb')]};}):[]};}):[]};}):[]:[]})[_0xd940('0x18')](function(_0xf10ecf){logger[_0xd940('0x10')](_0xd940('0x6'),_0x3838f2);logger['debug']('GetCmHopper',_0x3838f2,JSON[_0xd940('0x11')](_0xf10ecf));_0x1ffd35(_0xf10ecf);})[_0xd940('0x12')](function(_0xd93947){logger['error'](_0xd940('0x6'),_0xd93947[_0xd940('0x14')],_0x3838f2);_0x4eeca8(_0x331dea[_0xd940('0x13')](0x1f4,_0xd93947[_0xd940('0x14')]));});});});};exports['GetContactByPhone']=function(_0x5cc9c7){var _0x57918d=this;return new Promise(function(_0x4c8a3f,_0xe388de){return db['CmContact'][_0xd940('0x40')]({'raw':!![],'where':{'phone':_0x5cc9c7['options'][_0xd940('0x17')][_0xd940('0x41')]},'attributes':['id',_0xd940('0x42')],'order':[['id',_0xd940('0x43')]]})['then'](function(_0xe499d){logger[_0xd940('0x10')](_0xd940('0x44'),_0x5cc9c7);logger['debug'](_0xd940('0x44'),_0x5cc9c7,JSON[_0xd940('0x11')](_0xe499d));_0x4c8a3f(_0xe499d);})['catch'](function(_0x1dc69f){logger[_0xd940('0x13')](_0xd940('0x44'),_0x1dc69f[_0xd940('0x14')],_0x5cc9c7);_0xe388de(_0x57918d[_0xd940('0x13')](0x1f4,_0x1dc69f[_0xd940('0x14')]));});});};exports[_0xd940('0x45')]=function(_0x24dd8f){var _0x36a8a3=this;return new Promise(function(_0x39f10f,_0x4da087){return db[_0xd940('0x25')]['transaction'](function(_0x4d31a1){var _0x48079d=_0x24dd8f[_0xd940('0x9')]&&_0x24dd8f['options'][_0xd940('0x17')]?_0x24dd8f[_0xd940('0x9')][_0xd940('0x17')]:{};return db['CmHopper'][_0xd940('0x1d')](_0x24dd8f[_0xd940('0x1e')],{'where':_0x48079d,'transaction':_0x4d31a1})[_0xd940('0x18')](function(_0x31e3b0){logger[_0xd940('0x10')](_0xd940('0x45'),_0x24dd8f);logger[_0xd940('0x19')](_0xd940('0x45'),_0x24dd8f,JSON[_0xd940('0x11')](_0x31e3b0));_0x39f10f(_0x31e3b0);})[_0xd940('0x12')](function(_0x13d077){logger[_0xd940('0x13')](_0xd940('0x45'),_0x13d077['message'],_0x24dd8f);_0x4da087(_0x36a8a3[_0xd940('0x13')](0x1f4,_0x13d077[_0xd940('0x14')]));});});});};exports[_0xd940('0x46')]=function(_0x13a453){var _0x58373c=this;var _0x2a841a=_0x13a453[_0xd940('0x1e')]['where']['voiceQueueIds'];var _0x15fffd=_0x13a453[_0xd940('0x1e')][_0xd940('0x17')]['interval'];var _0x8f9475=_0x13a453[_0xd940('0x1e')][_0xd940('0x17')]['availableAgentsIds'];return new Promise(function(_0x2bdfb5,_0x45d1ce){return db['CmHopper'][_0xd940('0x8')]({'where':{'voiceQueueId':{'$in':_0x2a841a},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xd940('0x25')]['literal'](_0xd940('0x47')+_0x15fffd+_0xd940('0x48')),'$gt':db[_0xd940('0x25')][_0xd940('0x49')](_0xd940('0x4a'))}},'UserId':{'$in':_0x8f9475}},'include':[{'model':db[_0xd940('0x23')],'as':_0xd940('0x29')},{'model':db[_0xd940('0x4b')],'as':_0xd940('0x2b'),'attributes':['id',_0xd940('0x2c'),'voicePause']},{'model':db[_0xd940('0x4c')],'as':_0xd940('0x4d')}]})[_0xd940('0x18')](function(_0x2cb8aa){if(_0x2cb8aa[_0xd940('0x31')]>0x0){return db[_0xd940('0x25')][_0xd940('0x36')](function(_0x163b5c){return db['CmHopper'][_0xd940('0x1d')]({'recallmeNotifiedDate':db[_0xd940('0x25')][_0xd940('0x49')](_0xd940('0x4a'))},{'where':{'id':{'$in':_[_0xd940('0xf')](_0x2cb8aa,'id')}},'transaction':_0x163b5c})[_0xd940('0x18')](function(){_0x2bdfb5(_0x2cb8aa);})[_0xd940('0x12')](function(_0x22509b){logger[_0xd940('0x13')](_0xd940('0x46'),_0x22509b[_0xd940('0x14')],_0x13a453);_0x45d1ce(_0x58373c[_0xd940('0x13')](0x1f4,_0x22509b[_0xd940('0x14')]));});})[_0xd940('0x12')](function(_0x3a4bfe){logger[_0xd940('0x13')](_0xd940('0x46'),_0x3a4bfe[_0xd940('0x14')],_0x13a453);_0x45d1ce(_0x58373c['error'](0x1f4,_0x3a4bfe[_0xd940('0x14')]));});}else{_0x2bdfb5(_0x2cb8aa);}});});}; \ No newline at end of file +var _0xa914=['GetContactDialer','describe','findAll','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','dataValues','ContactId','MoveContactManagedDialer','sequelize','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','order','GetCmHopperPreview','limit','GetContactByPhone','phone','dialTimezone','getContactByPhone','ResetActiveCalls','voiceQueueIds','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','CmList','List','NOW()','CmHopperHandlePreviewRecallNotifications','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','options','where','attributes','include','model','map','then','debug','stringify','catch','error','message','ShowCmHopper','find','raw','info','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0xa914,0x83));var _0x4a91=function(_0x366145,_0xed43b){_0x366145=_0x366145-0x0;var _0x358077=_0xa914[_0x366145];return _0x358077;};'use strict';var _=require('lodash');var util=require(_0x4a91('0x0'));var moment=require(_0x4a91('0x1'));var BPromise=require(_0x4a91('0x2'));var db=require(_0x4a91('0x3'))['db'];var logger=require(_0x4a91('0x4'))(_0x4a91('0x5'));exports[_0x4a91('0x6')]=function(_0x221f5c){var _0x1449af=this;return new Promise(function(_0x506584,_0x55b408){return db[_0x4a91('0x7')]['findAll']({'raw':_0x221f5c[_0x4a91('0x8')]?_0x221f5c['options']['raw']===undefined?!![]:![]:!![],'where':_0x221f5c[_0x4a91('0x8')]?_0x221f5c[_0x4a91('0x8')][_0x4a91('0x9')]||null:null,'attributes':_0x221f5c[_0x4a91('0x8')]?_0x221f5c[_0x4a91('0x8')][_0x4a91('0xa')]||null:null,'limit':_0x221f5c[_0x4a91('0x8')]?_0x221f5c[_0x4a91('0x8')]['limit']||null:null,'include':_0x221f5c[_0x4a91('0x8')]?_0x221f5c[_0x4a91('0x8')][_0x4a91('0xb')]?_['map'](_0x221f5c[_0x4a91('0x8')]['include'],function(_0x53d17d){return{'model':db[_0x53d17d[_0x4a91('0xc')]],'as':_0x53d17d['as'],'attributes':_0x53d17d[_0x4a91('0xa')],'include':_0x53d17d[_0x4a91('0xb')]?_['map'](_0x53d17d['include'],function(_0x4838a5){return{'model':db[_0x4838a5[_0x4a91('0xc')]],'as':_0x4838a5['as'],'attributes':_0x4838a5['attributes'],'include':_0x4838a5[_0x4a91('0xb')]?_[_0x4a91('0xd')](_0x4838a5[_0x4a91('0xb')],function(_0x4bc140){return{'model':db[_0x4bc140[_0x4a91('0xc')]],'as':_0x4bc140['as'],'attributes':_0x4bc140[_0x4a91('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4a91('0xe')](function(_0x294c4c){logger['info'](_0x4a91('0x6'),_0x221f5c);logger[_0x4a91('0xf')](_0x4a91('0x6'),_0x221f5c,JSON[_0x4a91('0x10')](_0x294c4c));_0x506584(_0x294c4c);})[_0x4a91('0x11')](function(_0x874f50){logger[_0x4a91('0x12')](_0x4a91('0x6'),_0x874f50['message'],_0x221f5c);_0x55b408(_0x1449af[_0x4a91('0x12')](0x1f4,_0x874f50[_0x4a91('0x13')]));});});};exports[_0x4a91('0x14')]=function(_0x6d9a08){var _0x25aa9f=this;return new Promise(function(_0x5c9351,_0x481d68){return db['CmHopper'][_0x4a91('0x15')]({'raw':_0x6d9a08[_0x4a91('0x8')]?_0x6d9a08[_0x4a91('0x8')][_0x4a91('0x16')]===undefined?!![]:![]:!![],'where':_0x6d9a08['options']?_0x6d9a08[_0x4a91('0x8')][_0x4a91('0x9')]||null:null,'attributes':_0x6d9a08[_0x4a91('0x8')]?_0x6d9a08[_0x4a91('0x8')][_0x4a91('0xa')]||null:null,'include':_0x6d9a08[_0x4a91('0x8')]?_0x6d9a08['options'][_0x4a91('0xb')]?_[_0x4a91('0xd')](_0x6d9a08['options']['include'],function(_0x483f75){return{'model':db[_0x483f75['model']],'as':_0x483f75['as'],'attributes':_0x483f75['attributes'],'include':_0x483f75[_0x4a91('0xb')]?_[_0x4a91('0xd')](_0x483f75[_0x4a91('0xb')],function(_0x2e5a40){return{'model':db[_0x2e5a40[_0x4a91('0xc')]],'as':_0x2e5a40['as'],'attributes':_0x2e5a40[_0x4a91('0xa')],'include':_0x2e5a40[_0x4a91('0xb')]?_[_0x4a91('0xd')](_0x2e5a40[_0x4a91('0xb')],function(_0x178e1d){return{'model':db[_0x178e1d[_0x4a91('0xc')]],'as':_0x178e1d['as'],'attributes':_0x178e1d[_0x4a91('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4a91('0xe')](function(_0x563e22){logger[_0x4a91('0x17')](_0x4a91('0x14'),_0x6d9a08);logger[_0x4a91('0xf')](_0x4a91('0x14'),_0x6d9a08,JSON['stringify'](_0x563e22));_0x5c9351(_0x563e22);})['catch'](function(_0x6470f6){logger['error'](_0x4a91('0x14'),_0x6470f6[_0x4a91('0x13')],_0x6d9a08);_0x481d68(_0x25aa9f['error'](0x1f4,_0x6470f6[_0x4a91('0x13')]));});});};exports[_0x4a91('0x18')]=function(_0x526518){var _0x4a1035=this;return new Promise(function(_0x41d173,_0x25bd25){return db['CmHopper'][_0x4a91('0x19')](_0x526518[_0x4a91('0x1a')],{'raw':_0x526518[_0x4a91('0x8')]?_0x526518[_0x4a91('0x8')][_0x4a91('0x16')]===undefined?!![]:![]:!![]})[_0x4a91('0xe')](function(_0x28212f){logger[_0x4a91('0x17')](_0x4a91('0x18'),_0x526518);logger[_0x4a91('0xf')]('CreateCmHopper',_0x526518,JSON['stringify'](_0x28212f));_0x41d173(_0x28212f);})[_0x4a91('0x11')](function(_0x3a2ccb){logger[_0x4a91('0x12')](_0x4a91('0x18'),_0x3a2ccb[_0x4a91('0x13')],_0x526518);_0x25bd25(_0x4a1035['error'](0x1f4,_0x3a2ccb[_0x4a91('0x13')]));});});};exports[_0x4a91('0x1b')]=function(_0x33cfc1){var _0x2dc576=this;return new Promise(function(_0x421b41,_0x413380){return db[_0x4a91('0x7')][_0x4a91('0x1c')](_0x33cfc1['body'],{'raw':_0x33cfc1['options']?_0x33cfc1[_0x4a91('0x8')][_0x4a91('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33cfc1[_0x4a91('0x8')]?_0x33cfc1[_0x4a91('0x8')][_0x4a91('0x9')]||null:null,'attributes':_0x33cfc1['options']?_0x33cfc1[_0x4a91('0x8')]['attributes']||null:null,'limit':_0x33cfc1[_0x4a91('0x8')]?_0x33cfc1[_0x4a91('0x8')]['limit']||null:null})[_0x4a91('0xe')](function(_0x340d50){logger['info'](_0x4a91('0x1b'),_0x33cfc1);logger[_0x4a91('0x17')](_0x4a91('0x1d'),JSON[_0x4a91('0x10')](_0x33cfc1[_0x4a91('0x8')][_0x4a91('0x9')]),_0x33cfc1[_0x4a91('0x1a')][_0x4a91('0x1e')]);logger[_0x4a91('0xf')]('UpdateCmHopper',_0x33cfc1,JSON[_0x4a91('0x10')](_0x340d50));_0x421b41(_0x340d50);})['catch'](function(_0x4b6351){logger[_0x4a91('0x12')](_0x4a91('0x1b'),_0x4b6351[_0x4a91('0x13')],_0x33cfc1);_0x413380(_0x2dc576[_0x4a91('0x12')](0x1f4,_0x4b6351[_0x4a91('0x13')]));});});};exports[_0x4a91('0x1f')]=function(_0x2db916){var _0x26e189=this;return new Promise(function(_0x5285cc,_0x1c854f){return db[_0x4a91('0x7')][_0x4a91('0x20')]({'where':_0x2db916[_0x4a91('0x8')]?_0x2db916[_0x4a91('0x8')][_0x4a91('0x9')]||null:null})[_0x4a91('0xe')](function(_0x131a01){logger[_0x4a91('0x17')](_0x4a91('0x1f'),_0x2db916);logger[_0x4a91('0xf')](_0x4a91('0x1f'),_0x2db916,JSON[_0x4a91('0x10')](_0x131a01));_0x5285cc(_0x131a01);})[_0x4a91('0x11')](function(_0x2f62b4){logger[_0x4a91('0x12')](_0x4a91('0x1f'),_0x2f62b4[_0x4a91('0x13')],_0x2db916);_0x1c854f(_0x26e189[_0x4a91('0x12')](0x1f4,_0x2f62b4[_0x4a91('0x13')]));});});};exports[_0x4a91('0x21')]=function(_0x318310){var _0x5b7853=this;return new Promise(function(_0x5766c7,_0x563b79){return db['CmContact'][_0x4a91('0x22')]()[_0x4a91('0xe')](function(_0xaca0d3){return db['sequelize']['transaction'](function(_0x3d6dab){return db['CmHopper'][_0x4a91('0x23')]({'where':_0x318310[_0x4a91('0x8')]?_0x318310[_0x4a91('0x8')][_0x4a91('0x9')]||null:null,'attributes':_0x318310[_0x4a91('0x8')]?_0x318310['options']['attributes']||null:null,'limit':_0x318310['options']?_0x318310[_0x4a91('0x8')]['limit']||null:null,'order':_0x318310['options']?_0x318310[_0x4a91('0x8')]['order']||null:null,'transaction':_0x3d6dab,'lock':_0x3d6dab[_0x4a91('0x24')][_0x4a91('0x25')],'include':[{'model':db[_0x4a91('0x26')],'as':_0x4a91('0x27'),'attributes':_[_0x4a91('0x28')](_0xaca0d3)},{'model':db[_0x4a91('0x29')],'as':_0x4a91('0x2a'),'attributes':['id',_0x4a91('0x2b'),_0x4a91('0x2c')]}]})[_0x4a91('0xe')](function(_0x5e2437){var _0x4aa25f=[];var _0x450667=[];for(var _0x2e3ad8=0x0;_0x2e3ad8<_0x5e2437[_0x4a91('0x2d')];_0x2e3ad8+=0x1){var _0x37bd6e=_0x5e2437[_0x2e3ad8][_0x4a91('0x2e')];if(_0x37bd6e===null){_0x4aa25f[_0x4a91('0x2f')](_0x5e2437[_0x2e3ad8][_0x4a91('0x1c')](_0x318310[_0x4a91('0x1a')],{'transaction':_0x3d6dab}));}else if(!_0x450667[_0x4a91('0x30')](_0x37bd6e)){_0x450667['push'](_0x37bd6e);_0x4aa25f['push'](_0x5e2437[_0x2e3ad8][_0x4a91('0x1c')](_0x318310[_0x4a91('0x1a')],{'transaction':_0x3d6dab}));}}return BPromise[_0x4a91('0x31')](_0x4aa25f);});})['then'](function(_0x54f54f){logger[_0x4a91('0x17')](_0x4a91('0x21'),_0x318310);if(_0x54f54f['length']>0x0){logger['info']('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x54f54f[0x0][_0x4a91('0x32')]['id'],_0x54f54f[0x0][_0x4a91('0x32')][_0x4a91('0x33')],_0x54f54f[0x0]['dataValues'][_0x4a91('0x1e')]);}logger['debug']('GetContactDialer',_0x318310,JSON[_0x4a91('0x10')](_0x54f54f));_0x5766c7(_0x54f54f);})[_0x4a91('0x11')](function(_0x434af0){logger[_0x4a91('0x12')](_0x4a91('0x21'),_0x434af0['message'],_0x318310);_0x563b79(_0x5b7853[_0x4a91('0x12')](0x1f4,_0x434af0[_0x4a91('0x13')]));});});});};exports[_0x4a91('0x34')]=function(_0x19186d){var _0xe818d2=this;return new Promise(function(_0x5aa774,_0x536b3d){return db[_0x4a91('0x35')][_0x4a91('0x36')](function(_0x31d714){return db[_0x4a91('0x37')][_0x4a91('0x19')](_0x19186d[_0x4a91('0x1a')],{'raw':_0x19186d[_0x4a91('0x8')]?_0x19186d[_0x4a91('0x8')][_0x4a91('0x16')]===undefined?!![]:![]:!![],'transaction':_0x31d714})[_0x4a91('0xe')](function(){logger[_0x4a91('0x17')](_0x4a91('0x38'),JSON[_0x4a91('0x10')](_0x19186d[_0x4a91('0x8')]['where']),_0x19186d[_0x4a91('0x8')]['where']['active']);return db[_0x4a91('0x7')][_0x4a91('0x20')]({'where':_0x19186d[_0x4a91('0x8')]?_0x19186d[_0x4a91('0x8')][_0x4a91('0x9')]||null:null,'transaction':_0x31d714});});})[_0x4a91('0xe')](function(_0x56f835){logger[_0x4a91('0x17')](_0x4a91('0x34'),_0x19186d);logger[_0x4a91('0xf')]('MoveContactManagedDialer',_0x19186d,JSON[_0x4a91('0x10')](_0x56f835));_0x5aa774(_0x56f835);})[_0x4a91('0x11')](function(_0x505bdd){logger[_0x4a91('0x12')](_0x4a91('0x34'),_0x505bdd[_0x4a91('0x13')],_0x19186d);_0x536b3d(_0xe818d2[_0x4a91('0x12')](0x1f4,_0x505bdd[_0x4a91('0x13')]));});});};exports[_0x4a91('0x39')]=function(_0x5a8800){var _0x4b7692=this;return new Promise(function(_0x463d90,_0x26a7b8){return db[_0x4a91('0x7')][_0x4a91('0x23')]({'raw':_0x5a8800['options']?_0x5a8800[_0x4a91('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x5a8800['options']?_0x5a8800['options'][_0x4a91('0x9')]||null:null,'attributes':[[db[_0x4a91('0x35')]['fn'](_0x4a91('0x3a'),db[_0x4a91('0x35')]['fn']('IF',db[_0x4a91('0x35')]['literal'](_0x4a91('0x3b')+util[_0x4a91('0x3c')](_0x4a91('0x3d'),moment()[_0x4a91('0x3c')](_0x4a91('0x3e')))+_0x4a91('0x3f')))),'contactsRescheduled']]})[_0x4a91('0xe')](function(_0xb82c8f){logger[_0x4a91('0x17')](_0x4a91('0x39'),_0x5a8800);logger[_0x4a91('0xf')](_0x4a91('0x39'),_0x5a8800,JSON[_0x4a91('0x10')](_0xb82c8f));_0x463d90(_0xb82c8f);})['catch'](function(_0x3c6f66){logger[_0x4a91('0x12')](_0x4a91('0x39'),_0x3c6f66[_0x4a91('0x13')],_0x5a8800);_0x26a7b8(_0x4b7692[_0x4a91('0x12')](0x1f4,_0x3c6f66[_0x4a91('0x13')]));});});};exports[_0x4a91('0x40')]=function(_0x5b9577){var _0x551661=this;return new Promise(function(_0x1da89b,_0x15e186){return db[_0x4a91('0x26')][_0x4a91('0x22')]()[_0x4a91('0xe')](function(){return db[_0x4a91('0x35')][_0x4a91('0x36')](function(_0x25a742){return db['CmHopper']['findAll']({'where':_0x5b9577[_0x4a91('0x8')]?_0x5b9577['options'][_0x4a91('0x9')]||null:null,'attributes':_0x5b9577[_0x4a91('0x8')]?_0x5b9577[_0x4a91('0x8')][_0x4a91('0xa')]||null:null,'limit':0x1,'order':_0x5b9577[_0x4a91('0x8')]?_0x5b9577[_0x4a91('0x8')][_0x4a91('0x41')]||null:null,'group':db[_0x4a91('0x7')][_0x4a91('0x2e')],'transaction':_0x25a742,'lock':_0x25a742[_0x4a91('0x24')][_0x4a91('0x25')],'include':_0x5b9577['options']?_0x5b9577[_0x4a91('0x8')][_0x4a91('0xb')]?_[_0x4a91('0xd')](_0x5b9577[_0x4a91('0x8')][_0x4a91('0xb')],function(_0x248070){return{'model':db[_0x248070[_0x4a91('0xc')]],'as':_0x248070['as'],'attributes':_0x248070[_0x4a91('0xa')],'include':_0x248070['include']?_[_0x4a91('0xd')](_0x248070[_0x4a91('0xb')],function(_0x462cd6){return{'model':db[_0x462cd6[_0x4a91('0xc')]],'as':_0x462cd6['as'],'attributes':_0x462cd6[_0x4a91('0xa')],'include':_0x462cd6[_0x4a91('0xb')]?_['map'](_0x462cd6[_0x4a91('0xb')],function(_0xb88dd5){return{'model':db[_0xb88dd5[_0x4a91('0xc')]],'as':_0xb88dd5['as'],'attributes':_0xb88dd5[_0x4a91('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4a91('0xe')](function(_0x53f198){var _0x371e45=[];for(var _0x31720d=0x0;_0x31720d<_0x53f198[_0x4a91('0x2d')];_0x31720d+=0x1){_0x371e45['push'](_0x53f198[_0x31720d][_0x4a91('0x1c')](_0x5b9577[_0x4a91('0x1a')],{'transaction':_0x25a742}));}return BPromise['all'](_0x371e45);});})[_0x4a91('0xe')](function(_0x3a92ce){logger[_0x4a91('0x17')](_0x4a91('0x40'),_0x5b9577);logger['debug'](_0x4a91('0x40'),_0x5b9577,JSON[_0x4a91('0x10')](_0x3a92ce));_0x1da89b(_0x3a92ce);})[_0x4a91('0x11')](function(_0x3601f7){logger[_0x4a91('0x12')](_0x4a91('0x40'),_0x3601f7[_0x4a91('0x13')],_0x5b9577);_0x15e186(_0x551661['error'](0x1f4,_0x3601f7[_0x4a91('0x13')]));});});});};exports[_0x4a91('0x42')]=function(_0x3b34ae){var _0x52c19=this;return new Promise(function(_0x126f97,_0x25c87b){db[_0x4a91('0x26')][_0x4a91('0x22')]()[_0x4a91('0xe')](function(_0x175df7){return db[_0x4a91('0x7')]['findAll']({'raw':_0x3b34ae[_0x4a91('0x8')]?_0x3b34ae[_0x4a91('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x3b34ae['options']?_0x3b34ae['options'][_0x4a91('0x9')]||null:null,'attributes':_0x3b34ae['options']?_0x3b34ae[_0x4a91('0x8')][_0x4a91('0xa')]||null:null,'limit':_0x3b34ae[_0x4a91('0x8')]?_0x3b34ae[_0x4a91('0x8')][_0x4a91('0x43')]||null:null,'include':_0x3b34ae[_0x4a91('0x8')]?_0x3b34ae[_0x4a91('0x8')][_0x4a91('0xb')]?_[_0x4a91('0xd')](_0x3b34ae[_0x4a91('0x8')]['include'],function(_0x59bce9){return{'model':db[_0x59bce9[_0x4a91('0xc')]],'as':_0x59bce9['as'],'attributes':_0x59bce9['as']===_0x4a91('0x27')?_[_0x4a91('0x28')](_0x175df7):_0x59bce9[_0x4a91('0xa')],'include':_0x59bce9[_0x4a91('0xb')]?_[_0x4a91('0xd')](_0x59bce9[_0x4a91('0xb')],function(_0x556d1b){return{'model':db[_0x556d1b[_0x4a91('0xc')]],'as':_0x556d1b['as'],'attributes':_0x556d1b[_0x4a91('0xa')],'include':_0x556d1b['include']?_[_0x4a91('0xd')](_0x556d1b[_0x4a91('0xb')],function(_0xae3d91){return{'model':db[_0xae3d91[_0x4a91('0xc')]],'as':_0xae3d91['as'],'attributes':_0xae3d91['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a91('0xe')](function(_0x4cd9fd){logger[_0x4a91('0x17')](_0x4a91('0x6'),_0x3b34ae);logger['debug'](_0x4a91('0x6'),_0x3b34ae,JSON['stringify'](_0x4cd9fd));_0x126f97(_0x4cd9fd);})[_0x4a91('0x11')](function(_0xa51a69){logger['error'](_0x4a91('0x6'),_0xa51a69[_0x4a91('0x13')],_0x3b34ae);_0x25c87b(_0x52c19[_0x4a91('0x12')](0x1f4,_0xa51a69[_0x4a91('0x13')]));});});});};exports[_0x4a91('0x44')]=function(_0x64dc2a){var _0x4aabdc=this;return new Promise(function(_0x53eac5,_0xb00c7a){return db[_0x4a91('0x26')]['findOne']({'raw':!![],'where':{'phone':_0x64dc2a[_0x4a91('0x8')][_0x4a91('0x9')][_0x4a91('0x45')]},'attributes':['id',_0x4a91('0x46')],'order':[['id','DESC']]})['then'](function(_0x3e83fb){logger[_0x4a91('0x17')](_0x4a91('0x47'),_0x64dc2a);logger[_0x4a91('0xf')]('getContactByPhone',_0x64dc2a,JSON[_0x4a91('0x10')](_0x3e83fb));_0x53eac5(_0x3e83fb);})[_0x4a91('0x11')](function(_0x4f942b){logger[_0x4a91('0x12')]('getContactByPhone',_0x4f942b[_0x4a91('0x13')],_0x64dc2a);_0xb00c7a(_0x4aabdc[_0x4a91('0x12')](0x1f4,_0x4f942b['message']));});});};exports[_0x4a91('0x48')]=function(_0x41ea97){var _0x30326b=this;return new Promise(function(_0x3b2138,_0x2e34c0){return db[_0x4a91('0x35')]['transaction'](function(_0x4c8ca2){var _0x4643e2=_0x41ea97[_0x4a91('0x8')]&&_0x41ea97[_0x4a91('0x8')][_0x4a91('0x9')]?_0x41ea97[_0x4a91('0x8')][_0x4a91('0x9')]:{};return db[_0x4a91('0x7')][_0x4a91('0x1c')](_0x41ea97[_0x4a91('0x1a')],{'where':_0x4643e2,'transaction':_0x4c8ca2})[_0x4a91('0xe')](function(_0x4b03c5){logger[_0x4a91('0x17')]('ResetActiveCalls',_0x41ea97);logger[_0x4a91('0xf')](_0x4a91('0x48'),_0x41ea97,JSON[_0x4a91('0x10')](_0x4b03c5));_0x3b2138(_0x4b03c5);})['catch'](function(_0x7802a6){logger[_0x4a91('0x12')]('ResetActiveCalls',_0x7802a6[_0x4a91('0x13')],_0x41ea97);_0x2e34c0(_0x30326b[_0x4a91('0x12')](0x1f4,_0x7802a6[_0x4a91('0x13')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x356f4c){var _0x16c414=this;var _0x49a464=_0x356f4c[_0x4a91('0x1a')][_0x4a91('0x9')][_0x4a91('0x49')];var _0x24b98d=_0x356f4c[_0x4a91('0x1a')][_0x4a91('0x9')]['interval'];var _0x49c746=_0x356f4c['body'][_0x4a91('0x9')][_0x4a91('0x4a')];return new Promise(function(_0x5bdb4b,_0x2f8f61){return db[_0x4a91('0x7')]['findAll']({'where':{'voiceQueueId':{'$in':_0x49a464},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x4a91('0x35')][_0x4a91('0x4b')](_0x4a91('0x4c')+_0x24b98d+_0x4a91('0x4d')),'$gt':db[_0x4a91('0x35')][_0x4a91('0x4b')]('NOW()')}},'UserId':{'$in':_0x49c746}},'include':[{'model':db['CmContact'],'as':_0x4a91('0x27')},{'model':db['User'],'as':_0x4a91('0x2a'),'attributes':['id',_0x4a91('0x2b'),_0x4a91('0x2c')]},{'model':db[_0x4a91('0x4e')],'as':_0x4a91('0x4f')}]})[_0x4a91('0xe')](function(_0x19970f){if(_0x19970f[_0x4a91('0x2d')]>0x0){return db[_0x4a91('0x35')][_0x4a91('0x36')](function(_0x234a0d){return db[_0x4a91('0x7')][_0x4a91('0x1c')]({'recallmeNotifiedDate':db[_0x4a91('0x35')][_0x4a91('0x4b')](_0x4a91('0x50'))},{'where':{'id':{'$in':_[_0x4a91('0xd')](_0x19970f,'id')}},'transaction':_0x234a0d})[_0x4a91('0xe')](function(){_0x5bdb4b(_0x19970f);})['catch'](function(_0x504335){logger[_0x4a91('0x12')](_0x4a91('0x51'),_0x504335[_0x4a91('0x13')],_0x356f4c);_0x2f8f61(_0x16c414[_0x4a91('0x12')](0x1f4,_0x504335[_0x4a91('0x13')]));});})[_0x4a91('0x11')](function(_0x5d2190){logger[_0x4a91('0x12')](_0x4a91('0x51'),_0x5d2190[_0x4a91('0x13')],_0x356f4c);_0x2f8f61(_0x16c414[_0x4a91('0x12')](0x1f4,_0x5d2190[_0x4a91('0x13')]));});}else{_0x5bdb4b(_0x19970f);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index dbd1da1..31ab88f 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 _0x6a90=['isAuthenticated','/describe','/opencontacts','getOpenContacts','getTimezones','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','put','/:id','update','delete','exports','Router','./cmHopper.controller','get'];(function(_0x49d931,_0x121258){var _0x491a2a=function(_0x338d50){while(--_0x338d50){_0x49d931['push'](_0x49d931['shift']());}};_0x491a2a(++_0x121258);}(_0x6a90,0x123));var _0x06a9=function(_0x378a3e,_0x4e19b0){_0x378a3e=_0x378a3e-0x0;var _0x4f0d52=_0x6a90[_0x378a3e];return _0x4f0d52;};'use strict';var express=require('express');var router=express[_0x06a9('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x06a9('0x1'));router[_0x06a9('0x2')]('/',auth[_0x06a9('0x3')](),controller['index']);router['get'](_0x06a9('0x4'),auth[_0x06a9('0x3')](),controller['describe']);router[_0x06a9('0x2')](_0x06a9('0x5'),auth[_0x06a9('0x3')](),controller[_0x06a9('0x6')]);router[_0x06a9('0x2')]('/timezones',auth[_0x06a9('0x3')](),controller[_0x06a9('0x7')]);router[_0x06a9('0x2')]('/:id',auth[_0x06a9('0x3')](),controller[_0x06a9('0x8')]);router['get'](_0x06a9('0x9'),auth[_0x06a9('0x3')](),controller[_0x06a9('0xa')]);router[_0x06a9('0xb')]('/',auth['isAuthenticated'](),controller[_0x06a9('0xc')]);router[_0x06a9('0xb')](_0x06a9('0xd'),auth[_0x06a9('0x3')](),controller[_0x06a9('0xe')]);router[_0x06a9('0xb')](_0x06a9('0xf'),auth[_0x06a9('0x3')](),controller['getTimezone']);router[_0x06a9('0x10')](_0x06a9('0x11'),auth['isAuthenticated'](),controller[_0x06a9('0x12')]);router[_0x06a9('0x13')](_0x06a9('0x11'),auth[_0x06a9('0x3')](),controller['destroy']);module[_0x06a9('0x14')]=router; \ No newline at end of file +var _0xacc9=['isAuthenticated','describe','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','put','update','express','../../components/auth/service','./cmHopper.controller','get','index','/describe'];(function(_0x59e59d,_0x33ced5){var _0x593d84=function(_0x41f836){while(--_0x41f836){_0x59e59d['push'](_0x59e59d['shift']());}};_0x593d84(++_0x33ced5);}(_0xacc9,0xaa));var _0x9acc=function(_0x524b25,_0x418ca5){_0x524b25=_0x524b25-0x0;var _0x4d19fb=_0xacc9[_0x524b25];return _0x4d19fb;};'use strict';var express=require(_0x9acc('0x0'));var router=express['Router']();var auth=require(_0x9acc('0x1'));var controller=require(_0x9acc('0x2'));router[_0x9acc('0x3')]('/',auth['isAuthenticated'](),controller[_0x9acc('0x4')]);router[_0x9acc('0x3')](_0x9acc('0x5'),auth[_0x9acc('0x6')](),controller[_0x9acc('0x7')]);router['get']('/opencontacts',auth[_0x9acc('0x6')](),controller['getOpenContacts']);router[_0x9acc('0x3')](_0x9acc('0x8'),auth[_0x9acc('0x6')](),controller[_0x9acc('0x9')]);router[_0x9acc('0x3')](_0x9acc('0xa'),auth[_0x9acc('0x6')](),controller[_0x9acc('0xb')]);router['get'](_0x9acc('0xc'),auth['isAuthenticated'](),controller[_0x9acc('0xd')]);router[_0x9acc('0xe')]('/',auth[_0x9acc('0x6')](),controller[_0x9acc('0xf')]);router[_0x9acc('0xe')](_0x9acc('0x10'),auth[_0x9acc('0x6')](),controller[_0x9acc('0x11')]);router[_0x9acc('0xe')](_0x9acc('0x12'),auth['isAuthenticated'](),controller[_0x9acc('0x13')]);router[_0x9acc('0x14')]('/:id',auth[_0x9acc('0x6')](),controller[_0x9acc('0x15')]);router['delete'](_0x9acc('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 9272e4c..7c16e4b 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 _0x751f=['YYYY-MM-DD\x20HH:mm:ss','moment','exports','INTEGER','STRING','format'];(function(_0x5d07a7,_0x43ff2e){var _0x95d216=function(_0x5e259c){while(--_0x5e259c){_0x5d07a7['push'](_0x5d07a7['shift']());}};_0x95d216(++_0x43ff2e);}(_0x751f,0x1bd));var _0xf751=function(_0x3ab753,_0x2c7170){_0x3ab753=_0x3ab753-0x0;var _0x306dd9=_0x751f[_0x3ab753];return _0x306dd9;};'use strict';var moment=require(_0xf751('0x0'));var Sequelize=require('sequelize');module[_0xf751('0x1')]={'CmHopperId':{'type':Sequelize[_0xf751('0x2')]},'phone':{'type':Sequelize[_0xf751('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xf751('0x4')](_0xf751('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf751('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf751('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xf751('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf751('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf751('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf751('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7e9f=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','INTEGER'];(function(_0x599210,_0x181912){var _0x41aeb8=function(_0x51bd31){while(--_0x51bd31){_0x599210['push'](_0x599210['shift']());}};_0x41aeb8(++_0x181912);}(_0x7e9f,0x7b));var _0xf7e9=function(_0x210561,_0x3c1c59){_0x210561=_0x210561-0x0;var _0x435afc=_0x7e9f[_0x210561];return _0x435afc;};'use strict';var moment=require('moment');var Sequelize=require(_0xf7e9('0x0'));module[_0xf7e9('0x1')]={'CmHopperId':{'type':Sequelize[_0xf7e9('0x2')]},'phone':{'type':Sequelize[_0xf7e9('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xf7e9('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xf7e9('0x4')],'defaultValue':moment()[_0xf7e9('0x5')](_0xf7e9('0x6'))},'countbusyretry':{'type':Sequelize[_0xf7e9('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf7e9('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf7e9('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf7e9('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf7e9('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index f80def7..2d5a0dc 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 _0x8f7a=['rows','show','params','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','body','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','name','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x1a0011,_0x32b202){var _0x49bfb2=function(_0x2ecc23){while(--_0x2ecc23){_0x1a0011['push'](_0x1a0011['shift']());}};_0x49bfb2(++_0x32b202);}(_0x8f7a,0xbb));var _0xa8f7=function(_0x21ad36,_0x5aba39){_0x21ad36=_0x21ad36-0x0;var _0x29eb95=_0x8f7a[_0x21ad36];return _0x29eb95;};'use strict';var emlformat=require(_0xa8f7('0x0'));var rimraf=require(_0xa8f7('0x1'));var zipdir=require(_0xa8f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa8f7('0x3'));var Mustache=require('mustache');var util=require(_0xa8f7('0x4'));var path=require(_0xa8f7('0x5'));var sox=require(_0xa8f7('0x6'));var csv=require(_0xa8f7('0x7'));var ejs=require(_0xa8f7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa8f7('0x9'));var squel=require(_0xa8f7('0xa'));var crypto=require('crypto');var jsforce=require(_0xa8f7('0xb'));var deskjs=require(_0xa8f7('0xc'));var toCsv=require(_0xa8f7('0x7'));var querystring=require(_0xa8f7('0xd'));var Papa=require(_0xa8f7('0xe'));var Redis=require(_0xa8f7('0xf'));var authService=require(_0xa8f7('0x10'));var qs=require(_0xa8f7('0x11'));var as=require(_0xa8f7('0x12'));var hardwareService=require(_0xa8f7('0x13'));var logger=require(_0xa8f7('0x14'))(_0xa8f7('0x15'));var utils=require(_0xa8f7('0x16'));var config=require(_0xa8f7('0x17'));var licenseUtil=require(_0xa8f7('0x18'));var db=require(_0xa8f7('0x19'))['db'];function respondWithStatusCode(_0x1b9c0e,_0x348f82){_0x348f82=_0x348f82||0xcc;return function(_0x45c535){if(_0x45c535){return _0x1b9c0e[_0xa8f7('0x1a')](_0x348f82);}return _0x1b9c0e['status'](_0x348f82)[_0xa8f7('0x1b')]();};}function respondWithResult(_0x11faf0,_0x1dbcef){_0x1dbcef=_0x1dbcef||0xc8;return function(_0x3a2cc3){if(_0x3a2cc3){return _0x11faf0[_0xa8f7('0x1c')](_0x1dbcef)[_0xa8f7('0x1d')](_0x3a2cc3);}};}function respondWithFilteredResult(_0x82d3a2,_0x3c44f4){return function(_0x5149b2){if(_0x5149b2){var _0x52d615=typeof _0x3c44f4[_0xa8f7('0x1e')]==='undefined'&&typeof _0x3c44f4['limit']===_0xa8f7('0x1f');var _0x44c75b=_0x5149b2[_0xa8f7('0x20')];var _0x4f74e7=_0x52d615?0x0:_0x3c44f4[_0xa8f7('0x1e')];var _0x3b7754=_0x52d615?_0x5149b2[_0xa8f7('0x20')]:_0x3c44f4[_0xa8f7('0x1e')]+_0x3c44f4[_0xa8f7('0x21')];var _0x23dc5b;if(_0x3b7754>=_0x44c75b){_0x3b7754=_0x44c75b;_0x23dc5b=0xc8;}else{_0x23dc5b=0xce;}_0x82d3a2[_0xa8f7('0x1c')](_0x23dc5b);return _0x82d3a2[_0xa8f7('0x22')](_0xa8f7('0x23'),_0x4f74e7+'-'+_0x3b7754+'/'+_0x44c75b)[_0xa8f7('0x1d')](_0x5149b2);}return null;};}function patchUpdates(_0x1f1004){return function(_0x364381){try{jsonpatch[_0xa8f7('0x24')](_0x364381,_0x1f1004,!![]);}catch(_0x21ef0e){return BPromise[_0xa8f7('0x25')](_0x21ef0e);}return _0x364381[_0xa8f7('0x26')]();};}function saveUpdates(_0x3299ae,_0x5cabbc){return function(_0x1342b4){if(_0x1342b4){return _0x1342b4[_0xa8f7('0x27')](_0x3299ae)['then'](function(_0x53e665){return _0x53e665;});}return null;};}function removeEntity(_0x5ca8de,_0x80217f){return function(_0x57a7eb){if(_0x57a7eb){return _0x57a7eb[_0xa8f7('0x28')]()[_0xa8f7('0x29')](function(){var _0x2a29c1=_0x57a7eb[_0xa8f7('0x2a')]({'plain':!![]});var _0x25de6d='CmHopperAdditionalPhones';return db[_0xa8f7('0x2b')][_0xa8f7('0x28')]({'where':{'type':_0x25de6d,'resourceId':_0x2a29c1['id']}})['then'](function(){return _0x57a7eb;});})[_0xa8f7('0x29')](function(){_0x5ca8de[_0xa8f7('0x1c')](0xcc)[_0xa8f7('0x1b')]();});}};}function handleEntityNotFound(_0x3521c6,_0xb46fd6){return function(_0x4177a9){if(!_0x4177a9){_0x3521c6[_0xa8f7('0x1a')](0x194);}return _0x4177a9;};}function handleError(_0x148aa2,_0x2cf89f){_0x2cf89f=_0x2cf89f||0x1f4;return function(_0x2b5328){logger['error'](_0x2b5328['stack']);if(_0x2b5328[_0xa8f7('0x2c')]){delete _0x2b5328[_0xa8f7('0x2c')];}_0x148aa2['status'](_0x2cf89f)['send'](_0x2b5328);};}exports['index']=function(_0x2688c0,_0x1f1fa0){var _0x2dfc33={},_0x9d9ca={},_0x312df3={'count':0x0,'rows':[]};var _0x1a284c=_[_0xa8f7('0x2d')](db[_0xa8f7('0x2e')][_0xa8f7('0x2f')],function(_0x2690c6){return{'name':_0x2690c6[_0xa8f7('0x30')],'type':_0x2690c6[_0xa8f7('0x31')][_0xa8f7('0x32')]};});_0x9d9ca[_0xa8f7('0x33')]=_[_0xa8f7('0x2d')](_0x1a284c,_0xa8f7('0x2c'));_0x9d9ca[_0xa8f7('0x34')]=_[_0xa8f7('0x35')](_0x2688c0['query']);_0x9d9ca[_0xa8f7('0x36')]=_[_0xa8f7('0x37')](_0x9d9ca[_0xa8f7('0x33')],_0x9d9ca[_0xa8f7('0x34')]);_0x2dfc33['attributes']=_[_0xa8f7('0x37')](_0x9d9ca['model'],qs[_0xa8f7('0x38')](_0x2688c0['query'][_0xa8f7('0x38')]));_0x2dfc33[_0xa8f7('0x39')]=_0x2dfc33[_0xa8f7('0x39')][_0xa8f7('0x3a')]?_0x2dfc33[_0xa8f7('0x39')]:_0x9d9ca[_0xa8f7('0x33')];if(!_0x2688c0[_0xa8f7('0x34')][_0xa8f7('0x3b')](_0xa8f7('0x3c'))){_0x2dfc33[_0xa8f7('0x21')]=qs[_0xa8f7('0x21')](_0x2688c0[_0xa8f7('0x34')][_0xa8f7('0x21')]);_0x2dfc33[_0xa8f7('0x1e')]=qs[_0xa8f7('0x1e')](_0x2688c0[_0xa8f7('0x34')][_0xa8f7('0x1e')]);}_0x2dfc33['order']=qs[_0xa8f7('0x3d')](_0x2688c0['query'][_0xa8f7('0x3d')]);_0x2dfc33[_0xa8f7('0x3e')]=qs['filters'](_[_0xa8f7('0x3f')](_0x2688c0['query'],_0x9d9ca[_0xa8f7('0x36')]),_0x1a284c);if(_0x2688c0[_0xa8f7('0x34')][_0xa8f7('0x40')]){_0x2dfc33[_0xa8f7('0x3e')]=_[_0xa8f7('0x41')](_0x2dfc33['where'],{'$or':_[_0xa8f7('0x2d')](_0x1a284c,function(_0x4e1ba3){if(_0x4e1ba3[_0xa8f7('0x31')]!==_0xa8f7('0x42')){var _0x5a732a={};_0x5a732a[_0x4e1ba3[_0xa8f7('0x2c')]]={'$like':'%'+_0x2688c0[_0xa8f7('0x34')][_0xa8f7('0x40')]+'%'};return _0x5a732a;}})});}_0x2dfc33=_['merge']({},_0x2dfc33,_0x2688c0[_0xa8f7('0x43')]);var _0x581104={'where':_0x2dfc33[_0xa8f7('0x3e')]};return db[_0xa8f7('0x2e')][_0xa8f7('0x20')](_0x581104)[_0xa8f7('0x29')](function(_0x27eec1){_0x312df3[_0xa8f7('0x20')]=_0x27eec1;if(_0x2688c0[_0xa8f7('0x34')][_0xa8f7('0x44')]){_0x2dfc33[_0xa8f7('0x45')]=[{'all':!![]}];}return db[_0xa8f7('0x2e')][_0xa8f7('0x46')](_0x2dfc33);})['then'](function(_0x5771a3){_0x312df3[_0xa8f7('0x47')]=_0x5771a3;return _0x312df3;})[_0xa8f7('0x29')](respondWithFilteredResult(_0x1f1fa0,_0x2dfc33))['catch'](handleError(_0x1f1fa0,null));};exports[_0xa8f7('0x48')]=function(_0x589e73,_0x2fd9c9){var _0x3e9bf2={'raw':!![],'where':{'id':_0x589e73[_0xa8f7('0x49')]['id']}},_0x22c3c3={};_0x22c3c3[_0xa8f7('0x33')]=_[_0xa8f7('0x35')](db[_0xa8f7('0x2e')][_0xa8f7('0x2f')]);_0x22c3c3['query']=_[_0xa8f7('0x35')](_0x589e73[_0xa8f7('0x34')]);_0x22c3c3[_0xa8f7('0x36')]=_[_0xa8f7('0x37')](_0x22c3c3[_0xa8f7('0x33')],_0x22c3c3[_0xa8f7('0x34')]);_0x3e9bf2[_0xa8f7('0x39')]=_[_0xa8f7('0x37')](_0x22c3c3[_0xa8f7('0x33')],qs[_0xa8f7('0x38')](_0x589e73[_0xa8f7('0x34')][_0xa8f7('0x38')]));_0x3e9bf2['attributes']=_0x3e9bf2[_0xa8f7('0x39')][_0xa8f7('0x3a')]?_0x3e9bf2[_0xa8f7('0x39')]:_0x22c3c3[_0xa8f7('0x33')];if(_0x589e73[_0xa8f7('0x34')][_0xa8f7('0x44')]){_0x3e9bf2[_0xa8f7('0x45')]=[{'all':!![]}];}_0x3e9bf2=_['merge']({},_0x3e9bf2,_0x589e73[_0xa8f7('0x43')]);return db[_0xa8f7('0x2e')][_0xa8f7('0x4a')](_0x3e9bf2)['then'](handleEntityNotFound(_0x2fd9c9,null))['then'](respondWithResult(_0x2fd9c9,null))['catch'](handleError(_0x2fd9c9,null));};exports['create']=function(_0x2060b9,_0xd8cb3f){return db[_0xa8f7('0x2e')]['create'](_0x2060b9['body'],{})['then'](function(_0x22aa7d){var _0x5e1571=_0x2060b9[_0xa8f7('0x4b')]['get']({'plain':!![]});if(!_0x5e1571)throw new Error(_0xa8f7('0x4c'));if(_0x5e1571['role']==='user'){var _0x3dced3=_0x22aa7d['get']({'plain':!![]});var _0x529333=_0xa8f7('0x4d');return db[_0xa8f7('0x4e')][_0xa8f7('0x4a')]({'where':{'name':_0x529333,'userProfileId':_0x5e1571[_0xa8f7('0x4f')]},'raw':!![]})[_0xa8f7('0x29')](function(_0x664d4c){if(_0x664d4c&&_0x664d4c[_0xa8f7('0x50')]===0x0){return db['UserProfileResource'][_0xa8f7('0x51')]({'name':_0x3dced3[_0xa8f7('0x2c')],'resourceId':_0x3dced3['id'],'type':_0x664d4c[_0xa8f7('0x2c')],'sectionId':_0x664d4c['id']},{})[_0xa8f7('0x29')](function(){return _0x22aa7d;});}else{return _0x22aa7d;}})['catch'](function(_0x5ae3ab){logger[_0xa8f7('0x52')](_0xa8f7('0x53'),_0x5ae3ab);throw _0x5ae3ab;});}return _0x22aa7d;})[_0xa8f7('0x29')](respondWithResult(_0xd8cb3f,0xc9))[_0xa8f7('0x54')](handleError(_0xd8cb3f,null));};exports[_0xa8f7('0x27')]=function(_0x351e3b,_0xf8fcfc){if(_0x351e3b[_0xa8f7('0x55')]['id']){delete _0x351e3b['body']['id'];}return db[_0xa8f7('0x2e')][_0xa8f7('0x4a')]({'where':{'id':_0x351e3b[_0xa8f7('0x49')]['id']}})[_0xa8f7('0x29')](handleEntityNotFound(_0xf8fcfc,null))['then'](saveUpdates(_0x351e3b[_0xa8f7('0x55')],null))[_0xa8f7('0x29')](respondWithResult(_0xf8fcfc,null))['catch'](handleError(_0xf8fcfc,null));};exports[_0xa8f7('0x28')]=function(_0xfe7385,_0x2b7f8e){return db[_0xa8f7('0x2e')][_0xa8f7('0x4a')]({'where':{'id':_0xfe7385[_0xa8f7('0x49')]['id']}})[_0xa8f7('0x29')](handleEntityNotFound(_0x2b7f8e,null))[_0xa8f7('0x29')](removeEntity(_0x2b7f8e,null))[_0xa8f7('0x54')](handleError(_0x2b7f8e,null));}; \ No newline at end of file +var _0x76fc=['CmHopperAdditionalPhones','UserProfileResource','end','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get'];(function(_0x48b2cb,_0x105fc4){var _0x5bc76f=function(_0x3d6222){while(--_0x3d6222){_0x48b2cb['push'](_0x48b2cb['shift']());}};_0x5bc76f(++_0x105fc4);}(_0x76fc,0x85));var _0xc76f=function(_0x35e505,_0x351d73){_0x35e505=_0x35e505-0x0;var _0x3a6279=_0x76fc[_0x35e505];return _0x3a6279;};'use strict';var emlformat=require(_0xc76f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc76f('0x1'));var BPromise=require(_0xc76f('0x2'));var Mustache=require(_0xc76f('0x3'));var util=require(_0xc76f('0x4'));var path=require(_0xc76f('0x5'));var sox=require(_0xc76f('0x6'));var csv=require(_0xc76f('0x7'));var ejs=require(_0xc76f('0x8'));var fs=require('fs');var fs_extra=require(_0xc76f('0x9'));var _=require(_0xc76f('0xa'));var squel=require(_0xc76f('0xb'));var crypto=require('crypto');var jsforce=require(_0xc76f('0xc'));var deskjs=require(_0xc76f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc76f('0xe'));var Papa=require(_0xc76f('0xf'));var Redis=require(_0xc76f('0x10'));var authService=require(_0xc76f('0x11'));var qs=require(_0xc76f('0x12'));var as=require(_0xc76f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc76f('0x14'));var utils=require(_0xc76f('0x15'));var config=require(_0xc76f('0x16'));var licenseUtil=require(_0xc76f('0x17'));var db=require(_0xc76f('0x18'))['db'];function respondWithStatusCode(_0x2be1c2,_0x149d20){_0x149d20=_0x149d20||0xcc;return function(_0x51c3fe){if(_0x51c3fe){return _0x2be1c2[_0xc76f('0x19')](_0x149d20);}return _0x2be1c2[_0xc76f('0x1a')](_0x149d20)['end']();};}function respondWithResult(_0x2b6e00,_0x1c1a41){_0x1c1a41=_0x1c1a41||0xc8;return function(_0x16eae8){if(_0x16eae8){return _0x2b6e00[_0xc76f('0x1a')](_0x1c1a41)[_0xc76f('0x1b')](_0x16eae8);}};}function respondWithFilteredResult(_0x526d2e,_0xe753e6){return function(_0x640e25){if(_0x640e25){var _0x5776f4=typeof _0xe753e6[_0xc76f('0x1c')]===_0xc76f('0x1d')&&typeof _0xe753e6[_0xc76f('0x1e')]===_0xc76f('0x1d');var _0x2dda5b=_0x640e25[_0xc76f('0x1f')];var _0x9a05d6=_0x5776f4?0x0:_0xe753e6[_0xc76f('0x1c')];var _0xe9559=_0x5776f4?_0x640e25['count']:_0xe753e6['offset']+_0xe753e6[_0xc76f('0x1e')];var _0x18455b;if(_0xe9559>=_0x2dda5b){_0xe9559=_0x2dda5b;_0x18455b=0xc8;}else{_0x18455b=0xce;}_0x526d2e[_0xc76f('0x1a')](_0x18455b);return _0x526d2e[_0xc76f('0x20')](_0xc76f('0x21'),_0x9a05d6+'-'+_0xe9559+'/'+_0x2dda5b)[_0xc76f('0x1b')](_0x640e25);}return null;};}function patchUpdates(_0x120aa7){return function(_0x149834){try{jsonpatch[_0xc76f('0x22')](_0x149834,_0x120aa7,!![]);}catch(_0x422d5f){return BPromise[_0xc76f('0x23')](_0x422d5f);}return _0x149834[_0xc76f('0x24')]();};}function saveUpdates(_0x1fda68,_0x5849c1){return function(_0x3a13bf){if(_0x3a13bf){return _0x3a13bf[_0xc76f('0x25')](_0x1fda68)[_0xc76f('0x26')](function(_0x5828f2){return _0x5828f2;});}return null;};}function removeEntity(_0x20ef20,_0x35998e){return function(_0x46edb5){if(_0x46edb5){return _0x46edb5[_0xc76f('0x27')]()[_0xc76f('0x26')](function(){var _0x309c24=_0x46edb5[_0xc76f('0x28')]({'plain':!![]});var _0x2eb7e9=_0xc76f('0x29');return db[_0xc76f('0x2a')][_0xc76f('0x27')]({'where':{'type':_0x2eb7e9,'resourceId':_0x309c24['id']}})[_0xc76f('0x26')](function(){return _0x46edb5;});})[_0xc76f('0x26')](function(){_0x20ef20['status'](0xcc)[_0xc76f('0x2b')]();});}};}function handleEntityNotFound(_0x384456,_0x572f14){return function(_0x4059df){if(!_0x4059df){_0x384456[_0xc76f('0x19')](0x194);}return _0x4059df;};}function handleError(_0x7db6a8,_0x542cdf){_0x542cdf=_0x542cdf||0x1f4;return function(_0x399a89){logger[_0xc76f('0x2c')](_0x399a89[_0xc76f('0x2d')]);if(_0x399a89['name']){delete _0x399a89[_0xc76f('0x2e')];}_0x7db6a8[_0xc76f('0x1a')](_0x542cdf)[_0xc76f('0x2f')](_0x399a89);};}exports[_0xc76f('0x30')]=function(_0x5e03d4,_0x22b006){var _0x133e1f={},_0x2ab0da={},_0x59627c={'count':0x0,'rows':[]};var _0x162984=_[_0xc76f('0x31')](db[_0xc76f('0x32')][_0xc76f('0x33')],function(_0x3abc9d){return{'name':_0x3abc9d[_0xc76f('0x34')],'type':_0x3abc9d[_0xc76f('0x35')][_0xc76f('0x36')]};});_0x2ab0da[_0xc76f('0x37')]=_[_0xc76f('0x31')](_0x162984,_0xc76f('0x2e'));_0x2ab0da[_0xc76f('0x38')]=_['keys'](_0x5e03d4['query']);_0x2ab0da[_0xc76f('0x39')]=_[_0xc76f('0x3a')](_0x2ab0da['model'],_0x2ab0da[_0xc76f('0x38')]);_0x133e1f[_0xc76f('0x3b')]=_[_0xc76f('0x3a')](_0x2ab0da[_0xc76f('0x37')],qs[_0xc76f('0x3c')](_0x5e03d4[_0xc76f('0x38')][_0xc76f('0x3c')]));_0x133e1f['attributes']=_0x133e1f[_0xc76f('0x3b')][_0xc76f('0x3d')]?_0x133e1f['attributes']:_0x2ab0da[_0xc76f('0x37')];if(!_0x5e03d4[_0xc76f('0x38')][_0xc76f('0x3e')]('nolimit')){_0x133e1f[_0xc76f('0x1e')]=qs[_0xc76f('0x1e')](_0x5e03d4[_0xc76f('0x38')][_0xc76f('0x1e')]);_0x133e1f[_0xc76f('0x1c')]=qs[_0xc76f('0x1c')](_0x5e03d4['query'][_0xc76f('0x1c')]);}_0x133e1f[_0xc76f('0x3f')]=qs[_0xc76f('0x40')](_0x5e03d4[_0xc76f('0x38')][_0xc76f('0x40')]);_0x133e1f[_0xc76f('0x41')]=qs['filters'](_[_0xc76f('0x42')](_0x5e03d4[_0xc76f('0x38')],_0x2ab0da[_0xc76f('0x39')]),_0x162984);if(_0x5e03d4['query'][_0xc76f('0x43')]){_0x133e1f['where']=_['merge'](_0x133e1f[_0xc76f('0x41')],{'$or':_['map'](_0x162984,function(_0x5dd462){if(_0x5dd462[_0xc76f('0x35')]!==_0xc76f('0x44')){var _0x594848={};_0x594848[_0x5dd462[_0xc76f('0x2e')]]={'$like':'%'+_0x5e03d4['query'][_0xc76f('0x43')]+'%'};return _0x594848;}})});}_0x133e1f=_[_0xc76f('0x45')]({},_0x133e1f,_0x5e03d4[_0xc76f('0x46')]);var _0xbee48a={'where':_0x133e1f[_0xc76f('0x41')]};return db[_0xc76f('0x32')][_0xc76f('0x1f')](_0xbee48a)[_0xc76f('0x26')](function(_0x2c02ff){_0x59627c['count']=_0x2c02ff;if(_0x5e03d4[_0xc76f('0x38')][_0xc76f('0x47')]){_0x133e1f[_0xc76f('0x48')]=[{'all':!![]}];}return db[_0xc76f('0x32')]['findAll'](_0x133e1f);})[_0xc76f('0x26')](function(_0x36b522){_0x59627c[_0xc76f('0x49')]=_0x36b522;return _0x59627c;})[_0xc76f('0x26')](respondWithFilteredResult(_0x22b006,_0x133e1f))[_0xc76f('0x4a')](handleError(_0x22b006,null));};exports['show']=function(_0x13138f,_0x139325){var _0x5c1ff2={'raw':!![],'where':{'id':_0x13138f['params']['id']}},_0x491c06={};_0x491c06['model']=_[_0xc76f('0x4b')](db[_0xc76f('0x32')][_0xc76f('0x33')]);_0x491c06[_0xc76f('0x38')]=_['keys'](_0x13138f[_0xc76f('0x38')]);_0x491c06[_0xc76f('0x39')]=_['intersection'](_0x491c06[_0xc76f('0x37')],_0x491c06[_0xc76f('0x38')]);_0x5c1ff2[_0xc76f('0x3b')]=_[_0xc76f('0x3a')](_0x491c06['model'],qs[_0xc76f('0x3c')](_0x13138f[_0xc76f('0x38')][_0xc76f('0x3c')]));_0x5c1ff2[_0xc76f('0x3b')]=_0x5c1ff2[_0xc76f('0x3b')][_0xc76f('0x3d')]?_0x5c1ff2['attributes']:_0x491c06['model'];if(_0x13138f[_0xc76f('0x38')][_0xc76f('0x47')]){_0x5c1ff2[_0xc76f('0x48')]=[{'all':!![]}];}_0x5c1ff2=_[_0xc76f('0x45')]({},_0x5c1ff2,_0x13138f['options']);return db['CmHopperAdditionalPhone'][_0xc76f('0x4c')](_0x5c1ff2)[_0xc76f('0x26')](handleEntityNotFound(_0x139325,null))[_0xc76f('0x26')](respondWithResult(_0x139325,null))[_0xc76f('0x4a')](handleError(_0x139325,null));};exports[_0xc76f('0x4d')]=function(_0x59ade1,_0x3ac82f){return db[_0xc76f('0x32')][_0xc76f('0x4d')](_0x59ade1[_0xc76f('0x4e')],{})[_0xc76f('0x26')](function(_0x33790e){var _0x21cbd8=_0x59ade1['user'][_0xc76f('0x28')]({'plain':!![]});if(!_0x21cbd8)throw new Error(_0xc76f('0x4f'));if(_0x21cbd8[_0xc76f('0x50')]===_0xc76f('0x51')){var _0x5c9e91=_0x33790e[_0xc76f('0x28')]({'plain':!![]});var _0x4a89ba=_0xc76f('0x29');return db[_0xc76f('0x52')]['find']({'where':{'name':_0x4a89ba,'userProfileId':_0x21cbd8[_0xc76f('0x53')]},'raw':!![]})['then'](function(_0x146b01){if(_0x146b01&&_0x146b01[_0xc76f('0x54')]===0x0){return db[_0xc76f('0x2a')][_0xc76f('0x4d')]({'name':_0x5c9e91[_0xc76f('0x2e')],'resourceId':_0x5c9e91['id'],'type':_0x146b01['name'],'sectionId':_0x146b01['id']},{})[_0xc76f('0x26')](function(){return _0x33790e;});}else{return _0x33790e;}})['catch'](function(_0x4bd504){logger['error'](_0xc76f('0x55'),_0x4bd504);throw _0x4bd504;});}return _0x33790e;})[_0xc76f('0x26')](respondWithResult(_0x3ac82f,0xc9))[_0xc76f('0x4a')](handleError(_0x3ac82f,null));};exports[_0xc76f('0x25')]=function(_0x51a38c,_0x2e98bd){if(_0x51a38c[_0xc76f('0x4e')]['id']){delete _0x51a38c[_0xc76f('0x4e')]['id'];}return db[_0xc76f('0x32')][_0xc76f('0x4c')]({'where':{'id':_0x51a38c[_0xc76f('0x56')]['id']}})['then'](handleEntityNotFound(_0x2e98bd,null))[_0xc76f('0x26')](saveUpdates(_0x51a38c[_0xc76f('0x4e')],null))[_0xc76f('0x26')](respondWithResult(_0x2e98bd,null))[_0xc76f('0x4a')](handleError(_0x2e98bd,null));};exports['destroy']=function(_0x3c1f38,_0x490959){return db['CmHopperAdditionalPhone'][_0xc76f('0x4c')]({'where':{'id':_0x3c1f38[_0xc76f('0x56')]['id']}})[_0xc76f('0x26')](handleEntityNotFound(_0x490959,null))[_0xc76f('0x26')](removeEntity(_0x490959,null))[_0xc76f('0x4a')](handleError(_0x490959,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 0e7fb90..d275d72 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 _0xa022=['bluebird','rimraf','../../config/environment','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment'];(function(_0x1718c2,_0x2fc0f3){var _0x3caf9d=function(_0x228a5c){while(--_0x228a5c){_0x1718c2['push'](_0x1718c2['shift']());}};_0x3caf9d(++_0x2fc0f3);}(_0xa022,0x1e7));var _0x2a02=function(_0x19ff24,_0x47aae6){_0x19ff24=_0x19ff24-0x0;var _0x9cf14f=_0xa022[_0x19ff24];return _0x9cf14f;};'use strict';var _=require(_0x2a02('0x0'));var util=require(_0x2a02('0x1'));var logger=require(_0x2a02('0x2'))(_0x2a02('0x3'));var moment=require(_0x2a02('0x4'));var BPromise=require(_0x2a02('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2a02('0x6'));var config=require(_0x2a02('0x7'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x2a02('0x8')]=function(_0x497963,_0x14089f){return _0x497963[_0x2a02('0x9')](_0x2a02('0xa'),attributes,{'tableName':_0x2a02('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00a9=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','exports','define','cm_hopper_additional_phones'];(function(_0x1ac3c0,_0x20bfe4){var _0x7fb329=function(_0x29aaf0){while(--_0x29aaf0){_0x1ac3c0['push'](_0x1ac3c0['shift']());}};_0x7fb329(++_0x20bfe4);}(_0x00a9,0x190));var _0x900a=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x00a9[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x900a('0x0'));var util=require(_0x900a('0x1'));var logger=require(_0x900a('0x2'))('api');var moment=require(_0x900a('0x3'));var BPromise=require('bluebird');var rp=require(_0x900a('0x4'));var fs=require('fs');var path=require(_0x900a('0x5'));var rimraf=require(_0x900a('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x900a('0x7')]=function(_0x3a1422,_0x1ba03b){return _0x3a1422[_0x900a('0x8')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x900a('0x9'),'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 34b8d62..2513b51 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 _0x5b44=['phone','countnoanswerretry','countnosuchnumberretry','countdropretry','updatedAt','createdAt','sequelize','transaction','update','activateAdditionalPhone','field','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','OrderBy','countcongestionretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','ASC','countbusyretry','VerifyAdditionalPhones','SwapAdditionalPhones','CmHopper','duration','waitTime','isNil','scheduledat','add','minutes'];(function(_0x35341f,_0x3f0f0c){var _0x18c76a=function(_0x2264ae){while(--_0x2264ae){_0x35341f['push'](_0x35341f['shift']());}};_0x18c76a(++_0x3f0f0c);}(_0x5b44,0x13c));var _0x45b4=function(_0x108d5f,_0x4d2dd8){_0x108d5f=_0x108d5f-0x0;var _0x3cf41e=_0x5b44[_0x108d5f];return _0x3cf41e;};'use strict';var _=require(_0x45b4('0x0'));var util=require(_0x45b4('0x1'));var moment=require(_0x45b4('0x2'));var BPromise=require(_0x45b4('0x3'));var rs=require(_0x45b4('0x4'));var fs=require('fs');var Redis=require(_0x45b4('0x5'));var db=require(_0x45b4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x45b4('0x7'))(_0x45b4('0x8'));var config=require(_0x45b4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x45b4('0xa')][_0x45b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x522881,_0x2da9b9,_0x5605dc){return new BPromise(function(_0x59d0ed,_0x252bf8){return client[_0x45b4('0xc')](_0x522881,_0x5605dc)[_0x45b4('0xd')](function(_0x22f833){logger[_0x45b4('0xe')](_0x45b4('0xf'),_0x2da9b9,'request\x20sent');logger[_0x45b4('0x10')](_0x45b4('0x11'),_0x2da9b9,_0x45b4('0x12'),JSON[_0x45b4('0x13')](_0x22f833));if(_0x22f833[_0x45b4('0x14')]){if(_0x22f833['error'][_0x45b4('0x15')]===0x1f4){logger[_0x45b4('0x14')](_0x45b4('0xf'),_0x2da9b9,_0x22f833[_0x45b4('0x14')][_0x45b4('0x16')]);return _0x252bf8(_0x22f833[_0x45b4('0x14')]['message']);}logger[_0x45b4('0x14')](_0x45b4('0xf'),_0x2da9b9,_0x22f833[_0x45b4('0x14')][_0x45b4('0x16')]);return _0x59d0ed(_0x22f833[_0x45b4('0x14')][_0x45b4('0x16')]);}else{logger[_0x45b4('0xe')](_0x45b4('0xf'),_0x2da9b9,_0x45b4('0x12'));_0x59d0ed(_0x22f833[_0x45b4('0x17')]['message']);}})[_0x45b4('0x18')](function(_0x18b3be){logger[_0x45b4('0x14')](_0x45b4('0xf'),_0x2da9b9,_0x18b3be);_0x252bf8(_0x18b3be);});});}exports['VerifyAdditionalPhones']=function(_0x356c2e){var _0x47299b=this;return new Promise(function(_0x55c930,_0x2238c0){return db['CmHopper'][_0x45b4('0x19')]({'raw':!![],'where':{'ContactId':_0x356c2e[_0x45b4('0x1a')][_0x45b4('0x1b')],'ListId':_0x356c2e[_0x45b4('0x1a')][_0x45b4('0x1c')],'VoiceQueueId':_0x356c2e['body'][_0x45b4('0x1d')]===undefined?null:_0x356c2e['body'][_0x45b4('0x1d')],'CampaignId':_0x356c2e['body'][_0x45b4('0x1e')]===undefined?null:_0x356c2e[_0x45b4('0x1a')][_0x45b4('0x1e')]}})[_0x45b4('0xd')](function(_0x5c7baf){if(_0x5c7baf!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x5c7baf['id'],'OrderBy':{'$gt':_0x5c7baf[_0x45b4('0x1f')]}},'order':[[_0x45b4('0x1f'),'ASC']]})['then'](function(_0x4f92f1){var _0x7953fc=0x0;if(_0x4f92f1){if(_0x4f92f1['countbusyretry']+_0x4f92f1[_0x45b4('0x20')]+_0x4f92f1['countnoanswerretry']+_0x4f92f1['countnosuchnumberretry']+_0x4f92f1['countdropretry']+_0x4f92f1[_0x45b4('0x21')]+_0x4f92f1[_0x45b4('0x22')]+_0x4f92f1[_0x45b4('0x23')]<_0x356c2e[_0x45b4('0x24')][_0x45b4('0x25')])_0x7953fc=0x1;_0x55c930({'additional':_0x7953fc});}else{return db[_0x45b4('0x26')][_0x45b4('0x19')]({'raw':!![],'where':{'CmHopperId':_0x5c7baf['id']},'order':[['OrderBy',_0x45b4('0x27')]]})[_0x45b4('0xd')](function(_0x1ce313){var _0x25cc4f=0x0;if(_0x1ce313){if(_0x1ce313[_0x45b4('0x28')]+_0x1ce313[_0x45b4('0x20')]+_0x1ce313['countnoanswerretry']+_0x1ce313['countnosuchnumberretry']+_0x1ce313['countdropretry']+_0x1ce313[_0x45b4('0x21')]+_0x1ce313['countmachineretry']+_0x1ce313['countagentrejectretry']<_0x356c2e[_0x45b4('0x24')][_0x45b4('0x25')])_0x25cc4f=0x1;_0x55c930({'additional':_0x25cc4f});}else{_0x55c930({'additional':0x0});}})[_0x45b4('0x18')](function(_0x9af02c){logger[_0x45b4('0x14')](_0x45b4('0x29'),_0x9af02c[_0x45b4('0x16')]);_0x2238c0(_0x47299b['error'](0x1f4,_0x9af02c[_0x45b4('0x16')]));});}})[_0x45b4('0x18')](function(_0x2a9233){logger[_0x45b4('0x14')]('VerifyAdditionalPhones',_0x2a9233['message']);_0x2238c0(_0x47299b['error'](0x1f4,_0x2a9233['message']));});}else _0x55c930({'additional':0x0});});});};exports[_0x45b4('0x2a')]=function(_0x43197a){var _0x2cbbc9=this;return new Promise(function(_0x549f19,_0x197d1a){return db[_0x45b4('0x2b')][_0x45b4('0x19')]({'raw':!![],'where':{'ContactId':_0x43197a['body'][_0x45b4('0x1b')],'ListId':_0x43197a[_0x45b4('0x1a')][_0x45b4('0x1c')],'VoiceQueueId':_0x43197a[_0x45b4('0x1a')][_0x45b4('0x1d')]===undefined?null:_0x43197a[_0x45b4('0x1a')]['VoiceQueueId'],'CampaignId':_0x43197a[_0x45b4('0x1a')][_0x45b4('0x1e')]===undefined?null:_0x43197a['body'][_0x45b4('0x1e')]}})['then'](function(_0x4d8391){if(_0x4d8391!=null){return db[_0x45b4('0x26')][_0x45b4('0x19')]({'raw':!![],'where':{'CmHopperId':_0x4d8391['id'],'OrderBy':{'$gte':_0x4d8391['OrderBy']}},'order':[[_0x45b4('0x1f'),_0x45b4('0x27')]]})['then'](function(_0x25683e){if(_0x25683e)return activateAdditionalPhone(_0x4d8391,_0x43197a[_0x45b4('0x1a')],_0x25683e,_0x43197a[_0x45b4('0x2c')],_0x43197a[_0x45b4('0x2d')])['then'](function(_0x5d192b){_0x549f19(_0x5d192b);});else{return db[_0x45b4('0x26')][_0x45b4('0x19')]({'raw':!![],'where':{'CmHopperId':_0x4d8391['id']},'order':[['OrderBy','ASC']]})['then'](function(_0x4c77b1){if(_0x4c77b1)return activateAdditionalPhone(_0x4d8391,_0x43197a[_0x45b4('0x1a')],_0x4c77b1,_0x43197a[_0x45b4('0x2c')],_0x43197a['waitTime'])['then'](function(_0xb09165){_0x549f19(_0xb09165);});else{_0x549f19({'id':_0x4d8391['id'],'phone':''});}})[_0x45b4('0x18')](function(_0xd959a4){logger[_0x45b4('0x14')](_0x45b4('0x29'),_0xd959a4[_0x45b4('0x16')]);_0x197d1a(_0x2cbbc9[_0x45b4('0x14')](0x1f4,_0xd959a4[_0x45b4('0x16')]));});}})['catch'](function(_0x31cf1f){logger[_0x45b4('0x14')]('VerifyAdditionalPhones',_0x31cf1f[_0x45b4('0x16')]);_0x197d1a(_0x2cbbc9[_0x45b4('0x14')](0x1f4,_0x31cf1f[_0x45b4('0x16')]));});}else _0x549f19(0x1);});});};function activateAdditionalPhone(_0x33978d,_0x34b59c,_0x11f008,_0x74b5c2,_0x53ae43){return new Promise(function(_0x29736d,_0x376fb4){var _0x3496b3;if(_[_0x45b4('0x2e')](_0x11f008[_0x45b4('0x2f')])){_0x11f008[_0x45b4('0x2f')]=moment();}if(moment()>moment(_0x11f008[_0x45b4('0x2f')])){_0x3496b3=moment()[_0x45b4('0x30')](_0x53ae43||0x3,_0x45b4('0x31'));}else{if(_0x11f008[_0x45b4('0x1f')]==0x0){_0x3496b3=moment(_0x11f008[_0x45b4('0x2f')]);}else{_0x3496b3=moment()[_0x45b4('0x30')](_0x53ae43||0x3,_0x45b4('0x31'));}}if(_[_0x45b4('0x2e')](_0x3496b3)){_0x3496b3=moment()['add'](_0x53ae43||0x3,_0x45b4('0x31'));}var _0x2e608b={'phone':_0x33978d[_0x45b4('0x32')],'active':0x0,'OrderBy':_[_0x45b4('0x2e')](_0x33978d[_0x45b4('0x1f')])?0x0:_0x33978d[_0x45b4('0x1f')],'scheduledat':moment()[_0x45b4('0x30')](_0x74b5c2||0x1,_0x45b4('0x31')),'countbusyretry':_0x34b59c[_0x45b4('0x28')],'countcongestionretry':_0x34b59c[_0x45b4('0x20')],'countnoanswerretry':_0x34b59c[_0x45b4('0x33')],'countnosuchnumberretry':_0x34b59c[_0x45b4('0x34')],'countdropretry':_0x34b59c[_0x45b4('0x35')],'countabandonedretry':_0x34b59c[_0x45b4('0x21')],'countmachineretry':_0x34b59c[_0x45b4('0x22')],'countagentrejectretry':_0x34b59c[_0x45b4('0x23')],'createdAt':_0x34b59c['createdAt'],'updatedAt':_0x34b59c[_0x45b4('0x36')]};var _0x4ee301={'CmHopperId':_0x33978d['id'],'phone':_0x11f008[_0x45b4('0x32')],'active':0x0,'OrderBy':_[_0x45b4('0x2e')](_0x11f008[_0x45b4('0x1f')])?0x0:_0x11f008[_0x45b4('0x1f')],'scheduledat':_0x3496b3,'countbusyretry':_0x11f008[_0x45b4('0x28')],'countcongestionretry':_0x11f008[_0x45b4('0x20')],'countnoanswerretry':_0x11f008[_0x45b4('0x33')],'countnosuchnumberretry':_0x11f008['countnosuchnumberretry'],'countdropretry':_0x11f008[_0x45b4('0x35')],'countabandonedretry':_0x11f008[_0x45b4('0x21')],'countmachineretry':_0x11f008[_0x45b4('0x22')],'countagentrejectretry':_0x11f008[_0x45b4('0x23')],'createdAt':_0x11f008[_0x45b4('0x37')],'updatedAt':_0x11f008[_0x45b4('0x36')]};return db[_0x45b4('0x38')][_0x45b4('0x39')](function(_0x54cb92){return db['CmHopperAdditionalPhone'][_0x45b4('0x3a')](_0x2e608b,{'where':{'id':_0x11f008['id']}},{'transaction':_0x54cb92})[_0x45b4('0xd')](function(){return db[_0x45b4('0x2b')][_0x45b4('0x3a')](_0x4ee301,{'where':{'id':_0x33978d['id']}},{'transaction':_0x54cb92});});})[_0x45b4('0xd')](function(_0x3a5149){_0x29736d({'id':_0x33978d['id'],'phone':_0x11f008['phone']});})[_0x45b4('0x18')](function(_0xf46590){logger[_0x45b4('0x14')](_0x45b4('0x3b'),_0xf46590[_0x45b4('0x16')]);_0x376fb4({'error':_0xf46590[_0x45b4('0x16')]});});});}exports['IncrementPreviewCounters']=function(_0x23cf13){var _0x5de578=this;return new Promise(function(_0x3e61ec,_0x589092){return db[_0x45b4('0x2b')]['update'](_0x23cf13[_0x45b4('0x1a')][_0x45b4('0x3c')],{'where':{'id':_0x23cf13[_0x45b4('0x1a')]['id']}})['then'](function(_0x10d222){_0x3e61ec(_0x10d222);})['catch'](function(_0x1f2518){logger[_0x45b4('0x14')]('IncrementPreviewCounters',_0x1f2518[_0x45b4('0x16')]);_0x589092(_0x5de578[_0x45b4('0x14')](0x1f4,_0x1f2518[_0x45b4('0x16')]));});});}; \ No newline at end of file +var _0xc709=['IncrementPreviewCounters','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','OrderBy','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','entity','CmHopperAdditionalPhone','ASC','countbusyretry','countdropretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','sequelize','update','activateAdditionalPhone'];(function(_0x25b68b,_0x36cb6a){var _0x1deae5=function(_0x5e6069){while(--_0x5e6069){_0x25b68b['push'](_0x25b68b['shift']());}};_0x1deae5(++_0x36cb6a);}(_0xc709,0x71));var _0x9c70=function(_0x7185f7,_0x37065){_0x7185f7=_0x7185f7-0x0;var _0x182e45=_0xc709[_0x7185f7];return _0x182e45;};'use strict';var _=require(_0x9c70('0x0'));var util=require(_0x9c70('0x1'));var moment=require(_0x9c70('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c70('0x3'));var fs=require('fs');var Redis=require(_0x9c70('0x4'));var db=require(_0x9c70('0x5'))['db'];var utils=require(_0x9c70('0x6'));var logger=require(_0x9c70('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9c70('0x8')][_0x9c70('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1264f8,_0x2aa51e,_0x364a6){return new BPromise(function(_0x5a4d0d,_0x13965f){return client[_0x9c70('0xa')](_0x1264f8,_0x364a6)[_0x9c70('0xb')](function(_0x16f4ba){logger[_0x9c70('0xc')](_0x9c70('0xd'),_0x2aa51e,_0x9c70('0xe'));logger[_0x9c70('0xf')](_0x9c70('0x10'),_0x2aa51e,_0x9c70('0xe'),JSON['stringify'](_0x16f4ba));if(_0x16f4ba[_0x9c70('0x11')]){if(_0x16f4ba['error'][_0x9c70('0x12')]===0x1f4){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2aa51e,_0x16f4ba[_0x9c70('0x11')][_0x9c70('0x13')]);return _0x13965f(_0x16f4ba['error'][_0x9c70('0x13')]);}logger[_0x9c70('0x11')](_0x9c70('0xd'),_0x2aa51e,_0x16f4ba['error']['message']);return _0x5a4d0d(_0x16f4ba[_0x9c70('0x11')]['message']);}else{logger[_0x9c70('0xc')](_0x9c70('0xd'),_0x2aa51e,'request\x20sent');_0x5a4d0d(_0x16f4ba[_0x9c70('0x14')][_0x9c70('0x13')]);}})[_0x9c70('0x15')](function(_0x4b83b5){logger[_0x9c70('0x11')](_0x9c70('0xd'),_0x2aa51e,_0x4b83b5);_0x13965f(_0x4b83b5);});});}exports[_0x9c70('0x16')]=function(_0x290aee){var _0x8b56b0=this;return new Promise(function(_0x35b1d3,_0x5f199b){return db[_0x9c70('0x17')][_0x9c70('0x18')]({'raw':!![],'where':{'ContactId':_0x290aee[_0x9c70('0x19')][_0x9c70('0x1a')],'ListId':_0x290aee[_0x9c70('0x19')][_0x9c70('0x1b')],'VoiceQueueId':_0x290aee[_0x9c70('0x19')]['VoiceQueueId']===undefined?null:_0x290aee[_0x9c70('0x19')][_0x9c70('0x1c')],'CampaignId':_0x290aee[_0x9c70('0x19')][_0x9c70('0x1d')]===undefined?null:_0x290aee['body'][_0x9c70('0x1d')]}})[_0x9c70('0xb')](function(_0x54016e){if(_0x54016e!=null){return db['CmHopperAdditionalPhone'][_0x9c70('0x18')]({'raw':!![],'where':{'CmHopperId':_0x54016e['id'],'OrderBy':{'$gt':_0x54016e[_0x9c70('0x1e')]}},'order':[[_0x9c70('0x1e'),'ASC']]})['then'](function(_0x71d717){var _0x3ebbda=0x0;if(_0x71d717){if(_0x71d717['countbusyretry']+_0x71d717[_0x9c70('0x1f')]+_0x71d717[_0x9c70('0x20')]+_0x71d717[_0x9c70('0x21')]+_0x71d717['countdropretry']+_0x71d717[_0x9c70('0x22')]+_0x71d717['countmachineretry']+_0x71d717['countagentrejectretry']<_0x290aee[_0x9c70('0x23')]['dialGlobalMaxRetry'])_0x3ebbda=0x1;_0x35b1d3({'additional':_0x3ebbda});}else{return db[_0x9c70('0x24')][_0x9c70('0x18')]({'raw':!![],'where':{'CmHopperId':_0x54016e['id']},'order':[['OrderBy',_0x9c70('0x25')]]})[_0x9c70('0xb')](function(_0x2c1d3d){var _0x12c31a=0x0;if(_0x2c1d3d){if(_0x2c1d3d[_0x9c70('0x26')]+_0x2c1d3d['countcongestionretry']+_0x2c1d3d[_0x9c70('0x20')]+_0x2c1d3d[_0x9c70('0x21')]+_0x2c1d3d[_0x9c70('0x27')]+_0x2c1d3d[_0x9c70('0x22')]+_0x2c1d3d[_0x9c70('0x28')]+_0x2c1d3d[_0x9c70('0x29')]<_0x290aee[_0x9c70('0x23')][_0x9c70('0x2a')])_0x12c31a=0x1;_0x35b1d3({'additional':_0x12c31a});}else{_0x35b1d3({'additional':0x0});}})[_0x9c70('0x15')](function(_0x155c5c){logger[_0x9c70('0x11')](_0x9c70('0x16'),_0x155c5c[_0x9c70('0x13')]);_0x5f199b(_0x8b56b0[_0x9c70('0x11')](0x1f4,_0x155c5c[_0x9c70('0x13')]));});}})['catch'](function(_0x28dfdb){logger[_0x9c70('0x11')](_0x9c70('0x16'),_0x28dfdb['message']);_0x5f199b(_0x8b56b0['error'](0x1f4,_0x28dfdb[_0x9c70('0x13')]));});}else _0x35b1d3({'additional':0x0});});});};exports[_0x9c70('0x2b')]=function(_0x2bb47e){var _0xb54450=this;return new Promise(function(_0x1f90fc,_0x1172e4){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x2bb47e[_0x9c70('0x19')][_0x9c70('0x1a')],'ListId':_0x2bb47e[_0x9c70('0x19')]['ListId'],'VoiceQueueId':_0x2bb47e[_0x9c70('0x19')]['VoiceQueueId']===undefined?null:_0x2bb47e[_0x9c70('0x19')][_0x9c70('0x1c')],'CampaignId':_0x2bb47e['body']['CampaignId']===undefined?null:_0x2bb47e[_0x9c70('0x19')][_0x9c70('0x1d')]}})[_0x9c70('0xb')](function(_0x49266d){if(_0x49266d!=null){return db[_0x9c70('0x24')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x49266d['id'],'OrderBy':{'$gte':_0x49266d['OrderBy']}},'order':[[_0x9c70('0x1e'),_0x9c70('0x25')]]})['then'](function(_0x108d37){if(_0x108d37)return activateAdditionalPhone(_0x49266d,_0x2bb47e[_0x9c70('0x19')],_0x108d37,_0x2bb47e[_0x9c70('0x2c')],_0x2bb47e[_0x9c70('0x2d')])[_0x9c70('0xb')](function(_0x945f25){_0x1f90fc(_0x945f25);});else{return db[_0x9c70('0x24')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x49266d['id']},'order':[[_0x9c70('0x1e'),_0x9c70('0x25')]]})['then'](function(_0x1b2a18){if(_0x1b2a18)return activateAdditionalPhone(_0x49266d,_0x2bb47e['body'],_0x1b2a18,_0x2bb47e[_0x9c70('0x2c')],_0x2bb47e[_0x9c70('0x2d')])[_0x9c70('0xb')](function(_0x2ccd71){_0x1f90fc(_0x2ccd71);});else{_0x1f90fc({'id':_0x49266d['id'],'phone':''});}})[_0x9c70('0x15')](function(_0x2ae151){logger[_0x9c70('0x11')](_0x9c70('0x16'),_0x2ae151[_0x9c70('0x13')]);_0x1172e4(_0xb54450[_0x9c70('0x11')](0x1f4,_0x2ae151[_0x9c70('0x13')]));});}})[_0x9c70('0x15')](function(_0x336236){logger['error'](_0x9c70('0x16'),_0x336236['message']);_0x1172e4(_0xb54450['error'](0x1f4,_0x336236['message']));});}else _0x1f90fc(0x1);});});};function activateAdditionalPhone(_0x55801b,_0x451cb7,_0x49a5ac,_0x53274c,_0x361cbb){return new Promise(function(_0x389514,_0x1c168a){var _0xdd48f6;if(_[_0x9c70('0x2e')](_0x49a5ac[_0x9c70('0x2f')])){_0x49a5ac[_0x9c70('0x2f')]=moment();}if(moment()>moment(_0x49a5ac['scheduledat'])){_0xdd48f6=moment()['add'](_0x361cbb||0x3,'minutes');}else{if(_0x49a5ac[_0x9c70('0x1e')]==0x0){_0xdd48f6=moment(_0x49a5ac[_0x9c70('0x2f')]);}else{_0xdd48f6=moment()[_0x9c70('0x30')](_0x361cbb||0x3,_0x9c70('0x31'));}}if(_['isNil'](_0xdd48f6)){_0xdd48f6=moment()[_0x9c70('0x30')](_0x361cbb||0x3,_0x9c70('0x31'));}var _0x300e9c={'phone':_0x55801b[_0x9c70('0x32')],'active':0x0,'OrderBy':_['isNil'](_0x55801b['OrderBy'])?0x0:_0x55801b['OrderBy'],'scheduledat':moment()['add'](_0x53274c||0x1,'minutes'),'countbusyretry':_0x451cb7['countbusyretry'],'countcongestionretry':_0x451cb7[_0x9c70('0x1f')],'countnoanswerretry':_0x451cb7[_0x9c70('0x20')],'countnosuchnumberretry':_0x451cb7[_0x9c70('0x21')],'countdropretry':_0x451cb7[_0x9c70('0x27')],'countabandonedretry':_0x451cb7[_0x9c70('0x22')],'countmachineretry':_0x451cb7[_0x9c70('0x28')],'countagentrejectretry':_0x451cb7[_0x9c70('0x29')],'createdAt':_0x451cb7[_0x9c70('0x33')],'updatedAt':_0x451cb7['updatedAt']};var _0x2e62be={'CmHopperId':_0x55801b['id'],'phone':_0x49a5ac['phone'],'active':0x0,'OrderBy':_[_0x9c70('0x2e')](_0x49a5ac[_0x9c70('0x1e')])?0x0:_0x49a5ac['OrderBy'],'scheduledat':_0xdd48f6,'countbusyretry':_0x49a5ac['countbusyretry'],'countcongestionretry':_0x49a5ac[_0x9c70('0x1f')],'countnoanswerretry':_0x49a5ac[_0x9c70('0x20')],'countnosuchnumberretry':_0x49a5ac[_0x9c70('0x21')],'countdropretry':_0x49a5ac[_0x9c70('0x27')],'countabandonedretry':_0x49a5ac[_0x9c70('0x22')],'countmachineretry':_0x49a5ac[_0x9c70('0x28')],'countagentrejectretry':_0x49a5ac[_0x9c70('0x29')],'createdAt':_0x49a5ac[_0x9c70('0x33')],'updatedAt':_0x49a5ac['updatedAt']};return db[_0x9c70('0x34')]['transaction'](function(_0x1203e2){return db['CmHopperAdditionalPhone']['update'](_0x300e9c,{'where':{'id':_0x49a5ac['id']}},{'transaction':_0x1203e2})[_0x9c70('0xb')](function(){return db['CmHopper'][_0x9c70('0x35')](_0x2e62be,{'where':{'id':_0x55801b['id']}},{'transaction':_0x1203e2});});})['then'](function(_0x177c8b){_0x389514({'id':_0x55801b['id'],'phone':_0x49a5ac['phone']});})['catch'](function(_0xf3637e){logger[_0x9c70('0x11')](_0x9c70('0x36'),_0xf3637e['message']);_0x1c168a({'error':_0xf3637e[_0x9c70('0x13')]});});});}exports[_0x9c70('0x37')]=function(_0x55d912){var _0x4c8885=this;return new Promise(function(_0x30e3d2,_0x17471b){return db['CmHopper']['update'](_0x55d912[_0x9c70('0x19')]['field'],{'where':{'id':_0x55d912[_0x9c70('0x19')]['id']}})[_0x9c70('0xb')](function(_0x51e6ad){_0x30e3d2(_0x51e6ad);})['catch'](function(_0x410a9c){logger[_0x9c70('0x11')](_0x9c70('0x37'),_0x410a9c[_0x9c70('0x13')]);_0x17471b(_0x4c8885[_0x9c70('0x11')](0x1f4,_0x410a9c[_0x9c70('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index af477e4..4e9d75d 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 _0xaf11=['get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller'];(function(_0x3f2302,_0x3c3363){var _0x55fed4=function(_0x14d32e){while(--_0x14d32e){_0x3f2302['push'](_0x3f2302['shift']());}};_0x55fed4(++_0x3c3363);}(_0xaf11,0xfa));var _0x1af1=function(_0x41f38a,_0x5c78da){_0x41f38a=_0x41f38a-0x0;var _0xab5811=_0xaf11[_0x41f38a];return _0xab5811;};'use strict';var multer=require(_0x1af1('0x0'));var util=require(_0x1af1('0x1'));var path=require(_0x1af1('0x2'));var timeout=require(_0x1af1('0x3'));var express=require('express');var router=express[_0x1af1('0x4')]();var fs_extra=require(_0x1af1('0x5'));var auth=require(_0x1af1('0x6'));var interaction=require(_0x1af1('0x7'));var config=require(_0x1af1('0x8'));var controller=require(_0x1af1('0x9'));router[_0x1af1('0xa')]('/',auth[_0x1af1('0xb')](),controller[_0x1af1('0xc')]);router[_0x1af1('0xa')](_0x1af1('0xd'),auth[_0x1af1('0xb')](),controller[_0x1af1('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1af1('0xf')]);router[_0x1af1('0x10')](_0x1af1('0xd'),auth['isAuthenticated'](),controller[_0x1af1('0x11')]);router[_0x1af1('0x12')](_0x1af1('0xd'),auth[_0x1af1('0xb')](),controller['destroy']);module[_0x1af1('0x13')]=router; \ No newline at end of file +var _0x2804=['./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','create','put','delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x740fde,_0x490c95){var _0x15199f=function(_0x2f731c){while(--_0x2f731c){_0x740fde['push'](_0x740fde['shift']());}};_0x15199f(++_0x490c95);}(_0x2804,0xf8));var _0x4280=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2804[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x4280('0x0'));var util=require(_0x4280('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4280('0x2'));var router=express[_0x4280('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4280('0x4'));var interaction=require(_0x4280('0x5'));var config=require(_0x4280('0x6'));var controller=require(_0x4280('0x7'));router[_0x4280('0x8')]('/',auth[_0x4280('0x9')](),controller[_0x4280('0xa')]);router[_0x4280('0x8')](_0x4280('0xb'),auth[_0x4280('0x9')](),controller[_0x4280('0xc')]);router['post']('/',auth[_0x4280('0x9')](),controller[_0x4280('0xd')]);router[_0x4280('0xe')](_0x4280('0xb'),auth[_0x4280('0x9')](),controller['update']);router[_0x4280('0xf')](_0x4280('0xb'),auth[_0x4280('0x9')](),controller['destroy']);module[_0x4280('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index ce63448..72c24e7 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 _0xac47=['sequelize','exports','STRING','INTEGER','contactListQueue','moment'];(function(_0xbbc0bb,_0x1ec934){var _0x47534d=function(_0x1137cc){while(--_0x1137cc){_0xbbc0bb['push'](_0xbbc0bb['shift']());}};_0x47534d(++_0x1ec934);}(_0xac47,0x1af));var _0x7ac4=function(_0x4389d6,_0x58768d){_0x4389d6=_0x4389d6-0x0;var _0x3f279b=_0xac47[_0x4389d6];return _0x3f279b;};'use strict';var moment=require(_0x7ac4('0x0'));var Sequelize=require(_0x7ac4('0x1'));module[_0x7ac4('0x2')]={'phone':{'type':Sequelize[_0x7ac4('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x7ac4('0x4')],'unique':_0x7ac4('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x7ac4('0x5')},'VoiceQueueId':{'type':Sequelize[_0x7ac4('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x059d=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x5debd6,_0x3a972b){var _0x268feb=function(_0x218404){while(--_0x218404){_0x5debd6['push'](_0x5debd6['shift']());}};_0x268feb(++_0x3a972b);}(_0x059d,0x1b9));var _0xd059=function(_0x2938f4,_0x57457c){_0x2938f4=_0x2938f4-0x0;var _0x38b429=_0x059d[_0x2938f4];return _0x38b429;};'use strict';var moment=require(_0xd059('0x0'));var Sequelize=require(_0xd059('0x1'));module[_0xd059('0x2')]={'phone':{'type':Sequelize[_0xd059('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xd059('0x4')],'unique':_0xd059('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xd059('0x5')},'VoiceQueueId':{'type':Sequelize[_0xd059('0x4')],'unique':_0xd059('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index c88e7a9..3b6f9ef 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 _0x5115=['findAll','params','keys','catch','update','body','find','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x44efae,_0x45b7fe){var _0x46b69d=function(_0x32e16b){while(--_0x32e16b){_0x44efae['push'](_0x44efae['shift']());}};_0x46b69d(++_0x45b7fe);}(_0x5115,0x9a));var _0x5511=function(_0x4495ca,_0x570651){_0x4495ca=_0x4495ca-0x0;var _0x4637c0=_0x5115[_0x4495ca];return _0x4637c0;};'use strict';var emlformat=require(_0x5511('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5511('0x1'));var rp=require(_0x5511('0x2'));var moment=require(_0x5511('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5511('0x4'));var util=require(_0x5511('0x5'));var path=require(_0x5511('0x6'));var sox=require(_0x5511('0x7'));var csv=require(_0x5511('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5511('0x9'));var squel=require(_0x5511('0xa'));var crypto=require(_0x5511('0xb'));var jsforce=require(_0x5511('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5511('0x8'));var querystring=require('querystring');var Papa=require(_0x5511('0xd'));var Redis=require(_0x5511('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5511('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5511('0x10'));var logger=require(_0x5511('0x11'))(_0x5511('0x12'));var utils=require(_0x5511('0x13'));var config=require(_0x5511('0x14'));var licenseUtil=require(_0x5511('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x382af8,_0x4ebc19){_0x4ebc19=_0x4ebc19||0xcc;return function(_0x133c35){if(_0x133c35){return _0x382af8[_0x5511('0x16')](_0x4ebc19);}return _0x382af8[_0x5511('0x17')](_0x4ebc19)[_0x5511('0x18')]();};}function respondWithResult(_0x4a259f,_0x598d99){_0x598d99=_0x598d99||0xc8;return function(_0x478fdc){if(_0x478fdc){return _0x4a259f[_0x5511('0x17')](_0x598d99)['json'](_0x478fdc);}};}function respondWithFilteredResult(_0x1dc353,_0x4964a3){return function(_0x57ef1c){if(_0x57ef1c){var _0x46d174=typeof _0x4964a3[_0x5511('0x19')]==='undefined'&&typeof _0x4964a3[_0x5511('0x1a')]===_0x5511('0x1b');var _0x23c98e=_0x57ef1c[_0x5511('0x1c')];var _0x13bdc5=_0x46d174?0x0:_0x4964a3[_0x5511('0x19')];var _0x535348=_0x46d174?_0x57ef1c[_0x5511('0x1c')]:_0x4964a3[_0x5511('0x19')]+_0x4964a3['limit'];var _0x2fa8b1;if(_0x535348>=_0x23c98e){_0x535348=_0x23c98e;_0x2fa8b1=0xc8;}else{_0x2fa8b1=0xce;}_0x1dc353[_0x5511('0x17')](_0x2fa8b1);return _0x1dc353[_0x5511('0x1d')](_0x5511('0x1e'),_0x13bdc5+'-'+_0x535348+'/'+_0x23c98e)[_0x5511('0x1f')](_0x57ef1c);}return null;};}function patchUpdates(_0x20deb2){return function(_0x7eaa95){try{jsonpatch[_0x5511('0x20')](_0x7eaa95,_0x20deb2,!![]);}catch(_0x48c31c){return BPromise[_0x5511('0x21')](_0x48c31c);}return _0x7eaa95[_0x5511('0x22')]();};}function saveUpdates(_0x296f55,_0xe56132){return function(_0x364061){if(_0x364061){return _0x364061['update'](_0x296f55)[_0x5511('0x23')](function(_0x1d6ae2){return _0x1d6ae2;});}return null;};}function removeEntity(_0x31f99e,_0x4f4f0e){return function(_0xd856b1){if(_0xd856b1){return _0xd856b1[_0x5511('0x24')]()['then'](function(){_0x31f99e[_0x5511('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d525d,_0xb22976){return function(_0x3de14a){if(!_0x3de14a){_0x3d525d['sendStatus'](0x194);}return _0x3de14a;};}function handleError(_0xe40986,_0x2a4d31){_0x2a4d31=_0x2a4d31||0x1f4;return function(_0x140e23){logger[_0x5511('0x25')](_0x140e23[_0x5511('0x26')]);if(_0x140e23['name']){delete _0x140e23[_0x5511('0x27')];}_0xe40986[_0x5511('0x17')](_0x2a4d31)[_0x5511('0x28')](_0x140e23);};}exports[_0x5511('0x29')]=function(_0x4e3797,_0x4d34e0){var _0x46bf23={},_0xb186d0={},_0x4806a5={'count':0x0,'rows':[]};var _0x5d53dc=_[_0x5511('0x2a')](db[_0x5511('0x2b')][_0x5511('0x2c')],function(_0xe37de0){return{'name':_0xe37de0[_0x5511('0x2d')],'type':_0xe37de0[_0x5511('0x2e')][_0x5511('0x2f')]};});_0xb186d0['model']=_['map'](_0x5d53dc,_0x5511('0x27'));_0xb186d0[_0x5511('0x30')]=_['keys'](_0x4e3797['query']);_0xb186d0[_0x5511('0x31')]=_[_0x5511('0x32')](_0xb186d0['model'],_0xb186d0['query']);_0x46bf23[_0x5511('0x33')]=_[_0x5511('0x32')](_0xb186d0[_0x5511('0x34')],qs[_0x5511('0x35')](_0x4e3797[_0x5511('0x30')][_0x5511('0x35')]));_0x46bf23[_0x5511('0x33')]=_0x46bf23[_0x5511('0x33')][_0x5511('0x36')]?_0x46bf23[_0x5511('0x33')]:_0xb186d0[_0x5511('0x34')];if(!_0x4e3797[_0x5511('0x30')]['hasOwnProperty'](_0x5511('0x37'))){_0x46bf23[_0x5511('0x1a')]=qs[_0x5511('0x1a')](_0x4e3797['query']['limit']);_0x46bf23['offset']=qs['offset'](_0x4e3797['query']['offset']);}_0x46bf23[_0x5511('0x38')]=qs[_0x5511('0x39')](_0x4e3797[_0x5511('0x30')][_0x5511('0x39')]);_0x46bf23['where']=qs[_0x5511('0x31')](_['pick'](_0x4e3797['query'],_0xb186d0[_0x5511('0x31')]),_0x5d53dc);if(_0x4e3797[_0x5511('0x30')][_0x5511('0x3a')]){_0x46bf23[_0x5511('0x3b')]=_[_0x5511('0x3c')](_0x46bf23[_0x5511('0x3b')],{'$or':_['map'](_0x5d53dc,function(_0x2877e6){if(_0x2877e6[_0x5511('0x2e')]!==_0x5511('0x3d')){var _0x33e133={};_0x33e133[_0x2877e6[_0x5511('0x27')]]={'$like':'%'+_0x4e3797['query'][_0x5511('0x3a')]+'%'};return _0x33e133;}})});}_0x46bf23=_[_0x5511('0x3c')]({},_0x46bf23,_0x4e3797[_0x5511('0x3e')]);var _0x2fffe7={'where':_0x46bf23[_0x5511('0x3b')]};return db[_0x5511('0x2b')]['count'](_0x2fffe7)['then'](function(_0x1dfa1b){_0x4806a5['count']=_0x1dfa1b;if(_0x4e3797[_0x5511('0x30')][_0x5511('0x3f')]){_0x46bf23[_0x5511('0x40')]=[{'all':!![]}];}return db[_0x5511('0x2b')][_0x5511('0x41')](_0x46bf23);})[_0x5511('0x23')](function(_0x5e4321){_0x4806a5['rows']=_0x5e4321;return _0x4806a5;})[_0x5511('0x23')](respondWithFilteredResult(_0x4d34e0,_0x46bf23))['catch'](handleError(_0x4d34e0,null));};exports['show']=function(_0xa9dea1,_0x47a9b6){var _0x150507={'raw':!![],'where':{'id':_0xa9dea1[_0x5511('0x42')]['id']}},_0x41bf8d={};_0x41bf8d['model']=_[_0x5511('0x43')](db[_0x5511('0x2b')][_0x5511('0x2c')]);_0x41bf8d['query']=_[_0x5511('0x43')](_0xa9dea1['query']);_0x41bf8d[_0x5511('0x31')]=_[_0x5511('0x32')](_0x41bf8d['model'],_0x41bf8d[_0x5511('0x30')]);_0x150507[_0x5511('0x33')]=_[_0x5511('0x32')](_0x41bf8d[_0x5511('0x34')],qs['fields'](_0xa9dea1[_0x5511('0x30')][_0x5511('0x35')]));_0x150507['attributes']=_0x150507['attributes']['length']?_0x150507[_0x5511('0x33')]:_0x41bf8d[_0x5511('0x34')];if(_0xa9dea1['query'][_0x5511('0x3f')]){_0x150507[_0x5511('0x40')]=[{'all':!![]}];}_0x150507=_[_0x5511('0x3c')]({},_0x150507,_0xa9dea1[_0x5511('0x3e')]);return db['CmHopperBlack']['find'](_0x150507)[_0x5511('0x23')](handleEntityNotFound(_0x47a9b6,null))[_0x5511('0x23')](respondWithResult(_0x47a9b6,null))[_0x5511('0x44')](handleError(_0x47a9b6,null));};exports[_0x5511('0x45')]=function(_0x5d5e88,_0xf35dfa){if(_0x5d5e88[_0x5511('0x46')]['id']){delete _0x5d5e88[_0x5511('0x46')]['id'];}return db[_0x5511('0x2b')]['find']({'where':{'id':_0x5d5e88[_0x5511('0x42')]['id']}})[_0x5511('0x23')](handleEntityNotFound(_0xf35dfa,null))[_0x5511('0x23')](saveUpdates(_0x5d5e88['body'],null))[_0x5511('0x23')](respondWithResult(_0xf35dfa,null))[_0x5511('0x44')](handleError(_0xf35dfa,null));};exports[_0x5511('0x24')]=function(_0xd4b2d7,_0x5d430a){return db[_0x5511('0x2b')][_0x5511('0x47')]({'where':{'id':_0xd4b2d7[_0x5511('0x42')]['id']}})['then'](handleEntityNotFound(_0x5d430a,null))[_0x5511('0x23')](removeEntity(_0x5d430a,null))[_0x5511('0x44')](handleError(_0x5d430a,null));};exports[_0x5511('0x48')]=function(_0x36a3a2,_0x11df2d){return db[_0x5511('0x2b')][_0x5511('0x48')]()['then'](respondWithResult(_0x11df2d,null))[_0x5511('0x44')](handleError(_0x11df2d,null));}; \ No newline at end of file +var _0x89d6=['fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','reject','save','update','then','destroy','stack','name','send','map','CmHopperBlack','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','rawAttributes','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x58eec7,_0x2353db){var _0x25c5d3=function(_0x1ae895){while(--_0x1ae895){_0x58eec7['push'](_0x58eec7['shift']());}};_0x25c5d3(++_0x2353db);}(_0x89d6,0x119));var _0x689d=function(_0x2c6f0e,_0x39495d){_0x2c6f0e=_0x2c6f0e-0x0;var _0x5ced42=_0x89d6[_0x2c6f0e];return _0x5ced42;};'use strict';var emlformat=require(_0x689d('0x0'));var rimraf=require(_0x689d('0x1'));var zipdir=require(_0x689d('0x2'));var jsonpatch=require(_0x689d('0x3'));var rp=require('request-promise');var moment=require(_0x689d('0x4'));var BPromise=require(_0x689d('0x5'));var Mustache=require(_0x689d('0x6'));var util=require('util');var path=require(_0x689d('0x7'));var sox=require(_0x689d('0x8'));var csv=require(_0x689d('0x9'));var ejs=require(_0x689d('0xa'));var fs=require('fs');var fs_extra=require(_0x689d('0xb'));var _=require(_0x689d('0xc'));var squel=require('squel');var crypto=require(_0x689d('0xd'));var jsforce=require(_0x689d('0xe'));var deskjs=require(_0x689d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x689d('0x10'));var Redis=require(_0x689d('0x11'));var authService=require(_0x689d('0x12'));var qs=require(_0x689d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x689d('0x14'))(_0x689d('0x15'));var utils=require(_0x689d('0x16'));var config=require(_0x689d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x689d('0x18'))['db'];function respondWithStatusCode(_0x1e5c7a,_0x4a3284){_0x4a3284=_0x4a3284||0xcc;return function(_0x2f0f8){if(_0x2f0f8){return _0x1e5c7a[_0x689d('0x19')](_0x4a3284);}return _0x1e5c7a[_0x689d('0x1a')](_0x4a3284)[_0x689d('0x1b')]();};}function respondWithResult(_0x43a52a,_0x5143c6){_0x5143c6=_0x5143c6||0xc8;return function(_0x222734){if(_0x222734){return _0x43a52a[_0x689d('0x1a')](_0x5143c6)['json'](_0x222734);}};}function respondWithFilteredResult(_0x5f4920,_0x12d6ff){return function(_0x2a09e5){if(_0x2a09e5){var _0x3beb4a=typeof _0x12d6ff[_0x689d('0x1c')]===_0x689d('0x1d')&&typeof _0x12d6ff['limit']===_0x689d('0x1d');var _0x27feea=_0x2a09e5['count'];var _0x3110df=_0x3beb4a?0x0:_0x12d6ff['offset'];var _0x3b49a5=_0x3beb4a?_0x2a09e5[_0x689d('0x1e')]:_0x12d6ff[_0x689d('0x1c')]+_0x12d6ff[_0x689d('0x1f')];var _0x34e2ae;if(_0x3b49a5>=_0x27feea){_0x3b49a5=_0x27feea;_0x34e2ae=0xc8;}else{_0x34e2ae=0xce;}_0x5f4920[_0x689d('0x1a')](_0x34e2ae);return _0x5f4920[_0x689d('0x20')]('Content-Range',_0x3110df+'-'+_0x3b49a5+'/'+_0x27feea)[_0x689d('0x21')](_0x2a09e5);}return null;};}function patchUpdates(_0x56a952){return function(_0x17fe6c){try{jsonpatch['apply'](_0x17fe6c,_0x56a952,!![]);}catch(_0xc343dc){return BPromise[_0x689d('0x22')](_0xc343dc);}return _0x17fe6c[_0x689d('0x23')]();};}function saveUpdates(_0x55ebc6,_0x1740b3){return function(_0x490980){if(_0x490980){return _0x490980[_0x689d('0x24')](_0x55ebc6)[_0x689d('0x25')](function(_0x16040c){return _0x16040c;});}return null;};}function removeEntity(_0xe27c61,_0x2d2f99){return function(_0x4aea99){if(_0x4aea99){return _0x4aea99[_0x689d('0x26')]()[_0x689d('0x25')](function(){_0xe27c61[_0x689d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c6428,_0x35b34a){return function(_0x324185){if(!_0x324185){_0x2c6428[_0x689d('0x19')](0x194);}return _0x324185;};}function handleError(_0x254a31,_0x524b6f){_0x524b6f=_0x524b6f||0x1f4;return function(_0x477190){logger['error'](_0x477190[_0x689d('0x27')]);if(_0x477190[_0x689d('0x28')]){delete _0x477190[_0x689d('0x28')];}_0x254a31[_0x689d('0x1a')](_0x524b6f)[_0x689d('0x29')](_0x477190);};}exports['index']=function(_0x3b0763,_0x539279){var _0x5cb14e={},_0x4a976a={},_0x231d13={'count':0x0,'rows':[]};var _0x37ab67=_[_0x689d('0x2a')](db[_0x689d('0x2b')]['rawAttributes'],function(_0x5963cf){return{'name':_0x5963cf['fieldName'],'type':_0x5963cf[_0x689d('0x2c')][_0x689d('0x2d')]};});_0x4a976a[_0x689d('0x2e')]=_[_0x689d('0x2a')](_0x37ab67,_0x689d('0x28'));_0x4a976a[_0x689d('0x2f')]=_[_0x689d('0x30')](_0x3b0763['query']);_0x4a976a[_0x689d('0x31')]=_[_0x689d('0x32')](_0x4a976a['model'],_0x4a976a[_0x689d('0x2f')]);_0x5cb14e[_0x689d('0x33')]=_['intersection'](_0x4a976a[_0x689d('0x2e')],qs[_0x689d('0x34')](_0x3b0763[_0x689d('0x2f')][_0x689d('0x34')]));_0x5cb14e[_0x689d('0x33')]=_0x5cb14e[_0x689d('0x33')][_0x689d('0x35')]?_0x5cb14e[_0x689d('0x33')]:_0x4a976a[_0x689d('0x2e')];if(!_0x3b0763[_0x689d('0x2f')][_0x689d('0x36')](_0x689d('0x37'))){_0x5cb14e[_0x689d('0x1f')]=qs[_0x689d('0x1f')](_0x3b0763[_0x689d('0x2f')]['limit']);_0x5cb14e[_0x689d('0x1c')]=qs[_0x689d('0x1c')](_0x3b0763[_0x689d('0x2f')][_0x689d('0x1c')]);}_0x5cb14e[_0x689d('0x38')]=qs['sort'](_0x3b0763[_0x689d('0x2f')][_0x689d('0x39')]);_0x5cb14e[_0x689d('0x3a')]=qs[_0x689d('0x31')](_[_0x689d('0x3b')](_0x3b0763['query'],_0x4a976a['filters']),_0x37ab67);if(_0x3b0763[_0x689d('0x2f')][_0x689d('0x3c')]){_0x5cb14e[_0x689d('0x3a')]=_['merge'](_0x5cb14e['where'],{'$or':_['map'](_0x37ab67,function(_0x2eb55c){if(_0x2eb55c['type']!==_0x689d('0x3d')){var _0x39ad63={};_0x39ad63[_0x2eb55c[_0x689d('0x28')]]={'$like':'%'+_0x3b0763[_0x689d('0x2f')]['filter']+'%'};return _0x39ad63;}})});}_0x5cb14e=_[_0x689d('0x3e')]({},_0x5cb14e,_0x3b0763[_0x689d('0x3f')]);var _0x53d54b={'where':_0x5cb14e['where']};return db['CmHopperBlack']['count'](_0x53d54b)['then'](function(_0x59202c){_0x231d13[_0x689d('0x1e')]=_0x59202c;if(_0x3b0763['query']['includeAll']){_0x5cb14e[_0x689d('0x40')]=[{'all':!![]}];}return db[_0x689d('0x2b')][_0x689d('0x41')](_0x5cb14e);})['then'](function(_0x5e4a53){_0x231d13['rows']=_0x5e4a53;return _0x231d13;})[_0x689d('0x25')](respondWithFilteredResult(_0x539279,_0x5cb14e))[_0x689d('0x42')](handleError(_0x539279,null));};exports[_0x689d('0x43')]=function(_0x5346c5,_0x202a79){var _0x834f12={'raw':!![],'where':{'id':_0x5346c5[_0x689d('0x44')]['id']}},_0x46de2c={};_0x46de2c['model']=_[_0x689d('0x30')](db[_0x689d('0x2b')][_0x689d('0x45')]);_0x46de2c[_0x689d('0x2f')]=_[_0x689d('0x30')](_0x5346c5[_0x689d('0x2f')]);_0x46de2c[_0x689d('0x31')]=_[_0x689d('0x32')](_0x46de2c[_0x689d('0x2e')],_0x46de2c[_0x689d('0x2f')]);_0x834f12[_0x689d('0x33')]=_['intersection'](_0x46de2c[_0x689d('0x2e')],qs[_0x689d('0x34')](_0x5346c5[_0x689d('0x2f')][_0x689d('0x34')]));_0x834f12['attributes']=_0x834f12['attributes'][_0x689d('0x35')]?_0x834f12[_0x689d('0x33')]:_0x46de2c[_0x689d('0x2e')];if(_0x5346c5['query']['includeAll']){_0x834f12[_0x689d('0x40')]=[{'all':!![]}];}_0x834f12=_[_0x689d('0x3e')]({},_0x834f12,_0x5346c5['options']);return db[_0x689d('0x2b')][_0x689d('0x46')](_0x834f12)[_0x689d('0x25')](handleEntityNotFound(_0x202a79,null))[_0x689d('0x25')](respondWithResult(_0x202a79,null))[_0x689d('0x42')](handleError(_0x202a79,null));};exports[_0x689d('0x24')]=function(_0x24167a,_0x25f8f0){if(_0x24167a[_0x689d('0x47')]['id']){delete _0x24167a[_0x689d('0x47')]['id'];}return db[_0x689d('0x2b')][_0x689d('0x46')]({'where':{'id':_0x24167a['params']['id']}})['then'](handleEntityNotFound(_0x25f8f0,null))[_0x689d('0x25')](saveUpdates(_0x24167a['body'],null))[_0x689d('0x25')](respondWithResult(_0x25f8f0,null))[_0x689d('0x42')](handleError(_0x25f8f0,null));};exports[_0x689d('0x26')]=function(_0x50162f,_0x5e9501){return db[_0x689d('0x2b')]['find']({'where':{'id':_0x50162f[_0x689d('0x44')]['id']}})[_0x689d('0x25')](handleEntityNotFound(_0x5e9501,null))[_0x689d('0x25')](removeEntity(_0x5e9501,null))['catch'](handleError(_0x5e9501,null));};exports[_0x689d('0x48')]=function(_0x139097,_0x1cdab1){return db[_0x689d('0x2b')][_0x689d('0x48')]()['then'](respondWithResult(_0x1cdab1,null))[_0x689d('0x42')](handleError(_0x1cdab1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index a2030fc..35f36de 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 _0x67d6=['path','rimraf','./cmHopperBlack.attributes','CmHopperBlack','cm_hopper_black','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x49d931,_0x121258){var _0x491a2a=function(_0x338d50){while(--_0x338d50){_0x49d931['push'](_0x49d931['shift']());}};_0x491a2a(++_0x121258);}(_0x67d6,0x12e));var _0x667d=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x67d6[_0x46aff0];return _0x9d78cf;};'use strict';var _=require('lodash');var util=require(_0x667d('0x0'));var logger=require(_0x667d('0x1'))(_0x667d('0x2'));var moment=require(_0x667d('0x3'));var BPromise=require(_0x667d('0x4'));var rp=require(_0x667d('0x5'));var fs=require('fs');var path=require(_0x667d('0x6'));var rimraf=require(_0x667d('0x7'));var config=require('../../config/environment');var attributes=require(_0x667d('0x8'));module['exports']=function(_0x121923,_0x42481b){return _0x121923['define'](_0x667d('0x9'),attributes,{'tableName':_0x667d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x437b=['./cmHopperBlack.attributes','exports','define','lodash','util','api','path','rimraf'];(function(_0x52c8e,_0x9479d3){var _0x50ed48=function(_0x1bedd5){while(--_0x1bedd5){_0x52c8e['push'](_0x52c8e['shift']());}};_0x50ed48(++_0x9479d3);}(_0x437b,0x15b));var _0xb437=function(_0x2fc113,_0x45ec6e){_0x2fc113=_0x2fc113-0x0;var _0x5144ce=_0x437b[_0x2fc113];return _0x5144ce;};'use strict';var _=require(_0xb437('0x0'));var util=require(_0xb437('0x1'));var logger=require('../../config/logger')(_0xb437('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb437('0x3'));var rimraf=require(_0xb437('0x4'));var config=require('../../config/environment');var attributes=require(_0xb437('0x5'));module[_0xb437('0x6')]=function(_0x380319,_0x1bbb4e){return _0x380319[_0xb437('0x7')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','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 d24f874..cd95bed 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 _0xd576=['limit','include','model','map','GetCmHopperBlack','CmHopperBlack','body','then','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','findAll','raw','options','where','attributes'];(function(_0x2b097c,_0x26e0eb){var _0x335df=function(_0x3c3346){while(--_0x3c3346){_0x2b097c['push'](_0x2b097c['shift']());}};_0x335df(++_0x26e0eb);}(_0xd576,0x1eb));var _0x6d57=function(_0x4bfdb3,_0x3e761f){_0x4bfdb3=_0x4bfdb3-0x0;var _0x1d5082=_0xd576[_0x4bfdb3];return _0x1d5082;};'use strict';var _=require(_0x6d57('0x0'));var util=require(_0x6d57('0x1'));var moment=require(_0x6d57('0x2'));var BPromise=require(_0x6d57('0x3'));var rs=require(_0x6d57('0x4'));var fs=require('fs');var Redis=require(_0x6d57('0x5'));var db=require(_0x6d57('0x6'))['db'];var utils=require(_0x6d57('0x7'));var logger=require(_0x6d57('0x8'))(_0x6d57('0x9'));var config=require(_0x6d57('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6d57('0xb')][_0x6d57('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16de92,_0x3b480f,_0x351244){return new BPromise(function(_0x5ea273,_0x2c490d){return client[_0x6d57('0xd')](_0x16de92,_0x351244)['then'](function(_0x433f81){logger['info'](_0x6d57('0xe'),_0x3b480f,_0x6d57('0xf'));logger[_0x6d57('0x10')](_0x6d57('0x11'),_0x3b480f,_0x6d57('0xf'),JSON[_0x6d57('0x12')](_0x433f81));if(_0x433f81['error']){if(_0x433f81[_0x6d57('0x13')]['code']===0x1f4){logger[_0x6d57('0x13')](_0x6d57('0xe'),_0x3b480f,_0x433f81[_0x6d57('0x13')][_0x6d57('0x14')]);return _0x2c490d(_0x433f81[_0x6d57('0x13')][_0x6d57('0x14')]);}logger[_0x6d57('0x13')](_0x6d57('0xe'),_0x3b480f,_0x433f81[_0x6d57('0x13')]['message']);return _0x5ea273(_0x433f81[_0x6d57('0x13')][_0x6d57('0x14')]);}else{logger[_0x6d57('0x15')](_0x6d57('0xe'),_0x3b480f,_0x6d57('0xf'));_0x5ea273(_0x433f81[_0x6d57('0x16')][_0x6d57('0x14')]);}})[_0x6d57('0x17')](function(_0x5c8368){logger['error'](_0x6d57('0xe'),_0x3b480f,_0x5c8368);_0x2c490d(_0x5c8368);});});}exports['GetCmHopperBlack']=function(_0x441396){var _0x101831=this;return new Promise(function(_0xa20e78,_0x5145ae){return db['CmHopperBlack'][_0x6d57('0x18')]({'raw':_0x441396['options']?_0x441396['options'][_0x6d57('0x19')]===undefined?!![]:![]:!![],'where':_0x441396[_0x6d57('0x1a')]?_0x441396[_0x6d57('0x1a')][_0x6d57('0x1b')]||null:null,'attributes':_0x441396[_0x6d57('0x1a')]?_0x441396[_0x6d57('0x1a')][_0x6d57('0x1c')]||null:null,'limit':_0x441396[_0x6d57('0x1a')]?_0x441396[_0x6d57('0x1a')][_0x6d57('0x1d')]||null:null,'include':_0x441396['options']?_0x441396[_0x6d57('0x1a')][_0x6d57('0x1e')]?_['map'](_0x441396['options'][_0x6d57('0x1e')],function(_0x3d3163){return{'model':db[_0x3d3163[_0x6d57('0x1f')]],'as':_0x3d3163['as'],'attributes':_0x3d3163['attributes'],'include':_0x3d3163[_0x6d57('0x1e')]?_[_0x6d57('0x20')](_0x3d3163['include'],function(_0x3352d4){return{'model':db[_0x3352d4[_0x6d57('0x1f')]],'as':_0x3352d4['as'],'attributes':_0x3352d4[_0x6d57('0x1c')],'include':_0x3352d4[_0x6d57('0x1e')]?_[_0x6d57('0x20')](_0x3352d4[_0x6d57('0x1e')],function(_0x442161){return{'model':db[_0x442161[_0x6d57('0x1f')]],'as':_0x442161['as'],'attributes':_0x442161['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x129481){logger[_0x6d57('0x15')]('GetCmHopperBlack',_0x441396);logger[_0x6d57('0x10')](_0x6d57('0x21'),_0x441396,JSON[_0x6d57('0x12')](_0x129481));_0xa20e78(_0x129481);})['catch'](function(_0x5bf8ed){logger[_0x6d57('0x13')](_0x6d57('0x21'),_0x5bf8ed[_0x6d57('0x14')],_0x441396);_0x5145ae(_0x101831[_0x6d57('0x13')](0x1f4,_0x5bf8ed['message']));});});};exports['UpdateCmHopperBlack']=function(_0x2f35df){var _0x348485=this;return new Promise(function(_0x25e6f4,_0x1da17b){return db[_0x6d57('0x22')]['update'](_0x2f35df[_0x6d57('0x23')],{'raw':_0x2f35df[_0x6d57('0x1a')]?_0x2f35df['options'][_0x6d57('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f35df['options']?_0x2f35df[_0x6d57('0x1a')]['where']||null:null,'attributes':_0x2f35df[_0x6d57('0x1a')]?_0x2f35df['options']['attributes']||null:null,'limit':_0x2f35df['options']?_0x2f35df['options']['limit']||null:null})[_0x6d57('0x24')](function(_0x1d2bfe){logger['info'](_0x6d57('0x25'),_0x2f35df);logger['debug'](_0x6d57('0x25'),_0x2f35df,JSON[_0x6d57('0x12')](_0x1d2bfe));_0x25e6f4(_0x1d2bfe);})[_0x6d57('0x17')](function(_0x4a0a66){logger[_0x6d57('0x13')]('UpdateCmHopperBlack',_0x4a0a66[_0x6d57('0x14')],_0x2f35df);_0x1da17b(_0x348485[_0x6d57('0x13')](0x1f4,_0x4a0a66[_0x6d57('0x14')]));});});};exports[_0x6d57('0x26')]=function(_0x348746){var _0x3bd1ea=this;return new Promise(function(_0x32ea03,_0x4cb232){return db[_0x6d57('0x22')][_0x6d57('0x27')]({'where':_0x348746[_0x6d57('0x1a')]?_0x348746[_0x6d57('0x1a')][_0x6d57('0x1b')]||null:null})['then'](function(_0x4ae1aa){logger[_0x6d57('0x15')](_0x6d57('0x26'),_0x348746);logger['debug'](_0x6d57('0x26'),_0x348746,JSON[_0x6d57('0x12')](_0x4ae1aa));_0x32ea03(_0x4ae1aa);})[_0x6d57('0x17')](function(_0x1f46ae){logger[_0x6d57('0x13')]('DestroyCmHopperBlack',_0x1f46ae[_0x6d57('0x14')],_0x348746);_0x4cb232(_0x3bd1ea[_0x6d57('0x13')](0x1f4,_0x1f46ae[_0x6d57('0x14')]));});});}; \ No newline at end of file +var _0x0646=['options','raw','where','attributes','include','model','map','GetCmHopperBlack','UpdateCmHopperBlack','update','limit','DestroyCmHopperBlack','destroy','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CmHopperBlack','findAll'];(function(_0x3f47bd,_0xa1b88c){var _0x133064=function(_0xbac8a5){while(--_0xbac8a5){_0x3f47bd['push'](_0x3f47bd['shift']());}};_0x133064(++_0xa1b88c);}(_0x0646,0x1d5));var _0x6064=function(_0x350bb4,_0x553cb4){_0x350bb4=_0x350bb4-0x0;var _0x2588e7=_0x0646[_0x350bb4];return _0x2588e7;};'use strict';var _=require(_0x6064('0x0'));var util=require(_0x6064('0x1'));var moment=require('moment');var BPromise=require(_0x6064('0x2'));var rs=require(_0x6064('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6064('0x4'))['db'];var utils=require(_0x6064('0x5'));var logger=require(_0x6064('0x6'))(_0x6064('0x7'));var config=require(_0x6064('0x8'));var jayson=require(_0x6064('0x9'));var client=jayson['client'][_0x6064('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dca40,_0xda2aab,_0x345e02){return new BPromise(function(_0x4565fc,_0x1607cf){return client[_0x6064('0xb')](_0x4dca40,_0x345e02)[_0x6064('0xc')](function(_0x9b16dd){logger['info'](_0x6064('0xd'),_0xda2aab,_0x6064('0xe'));logger[_0x6064('0xf')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0xda2aab,_0x6064('0xe'),JSON[_0x6064('0x10')](_0x9b16dd));if(_0x9b16dd[_0x6064('0x11')]){if(_0x9b16dd['error'][_0x6064('0x12')]===0x1f4){logger[_0x6064('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0xda2aab,_0x9b16dd[_0x6064('0x11')]['message']);return _0x1607cf(_0x9b16dd['error'][_0x6064('0x13')]);}logger[_0x6064('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0xda2aab,_0x9b16dd[_0x6064('0x11')][_0x6064('0x13')]);return _0x4565fc(_0x9b16dd[_0x6064('0x11')][_0x6064('0x13')]);}else{logger[_0x6064('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0xda2aab,_0x6064('0xe'));_0x4565fc(_0x9b16dd[_0x6064('0x15')][_0x6064('0x13')]);}})[_0x6064('0x16')](function(_0x2f3a3d){logger[_0x6064('0x11')](_0x6064('0xd'),_0xda2aab,_0x2f3a3d);_0x1607cf(_0x2f3a3d);});});}exports['GetCmHopperBlack']=function(_0x3b4cf0){var _0x9ae3a3=this;return new Promise(function(_0x5cf99f,_0x258330){return db[_0x6064('0x17')][_0x6064('0x18')]({'raw':_0x3b4cf0[_0x6064('0x19')]?_0x3b4cf0[_0x6064('0x19')][_0x6064('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b4cf0['options']?_0x3b4cf0[_0x6064('0x19')][_0x6064('0x1b')]||null:null,'attributes':_0x3b4cf0[_0x6064('0x19')]?_0x3b4cf0[_0x6064('0x19')][_0x6064('0x1c')]||null:null,'limit':_0x3b4cf0[_0x6064('0x19')]?_0x3b4cf0['options']['limit']||null:null,'include':_0x3b4cf0[_0x6064('0x19')]?_0x3b4cf0[_0x6064('0x19')][_0x6064('0x1d')]?_['map'](_0x3b4cf0['options'][_0x6064('0x1d')],function(_0x28a49c){return{'model':db[_0x28a49c[_0x6064('0x1e')]],'as':_0x28a49c['as'],'attributes':_0x28a49c[_0x6064('0x1c')],'include':_0x28a49c[_0x6064('0x1d')]?_[_0x6064('0x1f')](_0x28a49c['include'],function(_0x384cac){return{'model':db[_0x384cac[_0x6064('0x1e')]],'as':_0x384cac['as'],'attributes':_0x384cac['attributes'],'include':_0x384cac[_0x6064('0x1d')]?_[_0x6064('0x1f')](_0x384cac['include'],function(_0x513a9e){return{'model':db[_0x513a9e['model']],'as':_0x513a9e['as'],'attributes':_0x513a9e['attributes']};}):[]};}):[]};}):[]:[]})[_0x6064('0xc')](function(_0x379cfe){logger[_0x6064('0x14')]('GetCmHopperBlack',_0x3b4cf0);logger[_0x6064('0xf')](_0x6064('0x20'),_0x3b4cf0,JSON[_0x6064('0x10')](_0x379cfe));_0x5cf99f(_0x379cfe);})[_0x6064('0x16')](function(_0x431c3d){logger[_0x6064('0x11')](_0x6064('0x20'),_0x431c3d[_0x6064('0x13')],_0x3b4cf0);_0x258330(_0x9ae3a3[_0x6064('0x11')](0x1f4,_0x431c3d[_0x6064('0x13')]));});});};exports[_0x6064('0x21')]=function(_0xc2d636){var _0x5d8be4=this;return new Promise(function(_0x199c4d,_0x1eb38a){return db[_0x6064('0x17')][_0x6064('0x22')](_0xc2d636['body'],{'raw':_0xc2d636[_0x6064('0x19')]?_0xc2d636[_0x6064('0x19')][_0x6064('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc2d636[_0x6064('0x19')]?_0xc2d636[_0x6064('0x19')][_0x6064('0x1b')]||null:null,'attributes':_0xc2d636[_0x6064('0x19')]?_0xc2d636[_0x6064('0x19')][_0x6064('0x1c')]||null:null,'limit':_0xc2d636[_0x6064('0x19')]?_0xc2d636['options'][_0x6064('0x23')]||null:null})[_0x6064('0xc')](function(_0x4ca518){logger[_0x6064('0x14')](_0x6064('0x21'),_0xc2d636);logger[_0x6064('0xf')]('UpdateCmHopperBlack',_0xc2d636,JSON[_0x6064('0x10')](_0x4ca518));_0x199c4d(_0x4ca518);})[_0x6064('0x16')](function(_0x2ffb4e){logger[_0x6064('0x11')]('UpdateCmHopperBlack',_0x2ffb4e[_0x6064('0x13')],_0xc2d636);_0x1eb38a(_0x5d8be4['error'](0x1f4,_0x2ffb4e[_0x6064('0x13')]));});});};exports[_0x6064('0x24')]=function(_0x4cf1b0){var _0x237d76=this;return new Promise(function(_0x1ba1b8,_0x1a830d){return db[_0x6064('0x17')][_0x6064('0x25')]({'where':_0x4cf1b0['options']?_0x4cf1b0[_0x6064('0x19')][_0x6064('0x1b')]||null:null})[_0x6064('0xc')](function(_0x28e8d2){logger[_0x6064('0x14')](_0x6064('0x24'),_0x4cf1b0);logger['debug'](_0x6064('0x24'),_0x4cf1b0,JSON[_0x6064('0x10')](_0x28e8d2));_0x1ba1b8(_0x28e8d2);})[_0x6064('0x16')](function(_0x57d03d){logger[_0x6064('0x11')](_0x6064('0x24'),_0x57d03d[_0x6064('0x13')],_0x4cf1b0);_0x1a830d(_0x237d76[_0x6064('0x11')](0x1f4,_0x57d03d[_0x6064('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index ebf256b..d2441bf 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 _0x5d58=['exports','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','put','destroy'];(function(_0x499c2a,_0x48bc9f){var _0x1a01e0=function(_0x3dbe65){while(--_0x3dbe65){_0x499c2a['push'](_0x499c2a['shift']());}};_0x1a01e0(++_0x48bc9f);}(_0x5d58,0x187));var _0x85d5=function(_0x2de380,_0x15294e){_0x2de380=_0x2de380-0x0;var _0x43cabb=_0x5d58[_0x2de380];return _0x43cabb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./cmHopperBlack.controller');router[_0x85d5('0x4')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0x6')]);router[_0x85d5('0x4')]('/describe',auth[_0x85d5('0x5')](),controller[_0x85d5('0x7')]);router['get'](_0x85d5('0x8'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0xa')](_0x85d5('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x85d5('0x8'),auth[_0x85d5('0x5')](),controller[_0x85d5('0xb')]);module[_0x85d5('0xc')]=router; \ No newline at end of file +var _0x5d58=['exports','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','put','destroy'];(function(_0x55619b,_0x48abf5){var _0x414d40=function(_0x92c145){while(--_0x92c145){_0x55619b['push'](_0x55619b['shift']());}};_0x414d40(++_0x48abf5);}(_0x5d58,0x187));var _0x85d5=function(_0x4867c7,_0x1c0977){_0x4867c7=_0x4867c7-0x0;var _0x2fdbfc=_0x5d58[_0x4867c7];return _0x2fdbfc;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./cmHopperBlack.controller');router[_0x85d5('0x4')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0x6')]);router[_0x85d5('0x4')]('/describe',auth[_0x85d5('0x5')](),controller[_0x85d5('0x7')]);router['get'](_0x85d5('0x8'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0xa')](_0x85d5('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x85d5('0x8'),auth[_0x85d5('0x5')](),controller[_0x85d5('0xb')]);module[_0x85d5('0xc')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 97d95ad..819dc1a 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 _0x4659=['setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime'];(function(_0x2168bf,_0x3e93f4){var _0x3008bc=function(_0x35e598){while(--_0x35e598){_0x2168bf['push'](_0x2168bf['shift']());}};_0x3008bc(++_0x3e93f4);}(_0x4659,0x1f3));var _0x9465=function(_0x208b82,_0x56a9db){_0x208b82=_0x208b82-0x0;var _0x50bac9=_0x4659[_0x208b82];return _0x50bac9;};'use strict';var Sequelize=require(_0x9465('0x0'));var moment=require(_0x9465('0x1'));module[_0x9465('0x2')]={'state':{'type':Sequelize[_0x9465('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x9465('0x4')]},'scheduledat':{'type':Sequelize[_0x9465('0x5')]},'countbusyretry':{'type':Sequelize[_0x9465('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9465('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9465('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9465('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x9465('0x4')]},'calleridnum':{'type':Sequelize[_0x9465('0x4')]},'calleridname':{'type':Sequelize[_0x9465('0x4')]},'starttime':{'type':Sequelize[_0x9465('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x9465('0x5')]},'droptime':{'type':Sequelize[_0x9465('0x5')]},'endtime':{'type':Sequelize[_0x9465('0x5')]},'ringtime':{'type':Sequelize[_0x9465('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9465('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9465('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9465('0x4')]},'reason':{'type':Sequelize[_0x9465('0x4')]},'disposition':{'type':Sequelize[_0x9465('0x4')]},'secondDisposition':{'type':Sequelize[_0x9465('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9465('0x4')]},'dispositionat':{'type':Sequelize[_0x9465('0x5')],'set':function(_0x1da0ba){var _0x1fa6ac=this[_0x9465('0x6')](_0x9465('0x7'));if(_0x1fa6ac&&_0x1da0ba){this[_0x9465('0x8')](_0x9465('0x9'),moment(_0x1da0ba)[_0x9465('0xa')](moment(_0x1fa6ac),_0x9465('0xb')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x9465('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x9465('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9465('0x5')]},'callback':{'type':Sequelize[_0x9465('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9465('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x9465('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x9465('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x9465('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9465('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9465('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9465('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd2fd=['sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','seconds','BOOLEAN'];(function(_0x127cef,_0x296fa8){var _0xb92f2f=function(_0x12a729){while(--_0x12a729){_0x127cef['push'](_0x127cef['shift']());}};_0xb92f2f(++_0x296fa8);}(_0xd2fd,0x8f));var _0xdd2f=function(_0x297884,_0x64d9be){_0x297884=_0x297884-0x0;var _0x37ce87=_0xd2fd[_0x297884];return _0x37ce87;};'use strict';var Sequelize=require(_0xdd2f('0x0'));var moment=require(_0xdd2f('0x1'));module[_0xdd2f('0x2')]={'state':{'type':Sequelize[_0xdd2f('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xdd2f('0x4')]},'scheduledat':{'type':Sequelize[_0xdd2f('0x5')]},'countbusyretry':{'type':Sequelize[_0xdd2f('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdd2f('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdd2f('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdd2f('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xdd2f('0x4')]},'originatecalleridname':{'type':Sequelize[_0xdd2f('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xdd2f('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xdd2f('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdd2f('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdd2f('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xdd2f('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdd2f('0x4')]},'campaign':{'type':Sequelize[_0xdd2f('0x4')]},'campaigntype':{'type':Sequelize[_0xdd2f('0x4')]},'membername':{'type':Sequelize[_0xdd2f('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xdd2f('0x4')]},'secondDisposition':{'type':Sequelize[_0xdd2f('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xdd2f('0x5')],'set':function(_0x8807a6){var _0x26dbd3=this[_0xdd2f('0x6')]('endtime');if(_0x26dbd3&&_0x8807a6){this[_0xdd2f('0x7')](_0xdd2f('0x8'),moment(_0x8807a6)['diff'](moment(_0x26dbd3),_0xdd2f('0x9')));}}},'amd':{'type':Sequelize[_0xdd2f('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xdd2f('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xdd2f('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xdd2f('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xdd2f('0x5')]},'callback':{'type':Sequelize[_0xdd2f('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdd2f('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdd2f('0x5')]},'deleted':{'type':Sequelize[_0xdd2f('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xdd2f('0x5')]},'recallme':{'type':Sequelize[_0xdd2f('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xdd2f('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdd2f('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdd2f('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdd2f('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdd2f('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index c05bb78..a1df188 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 _0xe3da=['COUNT','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','noSuchContacts','congestionContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','ContactId','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','from','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','createdAt','updatedAt','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts'];(function(_0x31fb16,_0x3a4f55){var _0x50f4b7=function(_0x42f60f){while(--_0x42f60f){_0x31fb16['push'](_0x31fb16['shift']());}};_0x50f4b7(++_0x3a4f55);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':!![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['describe']()['then'](respondWithResult(_0x4ed0f9,null))['catch'](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0xc8f551,_0x39f213){if(_0xc8f551[_0xae3d('0x4f')]['uniqueid']){delete _0xc8f551['body'][_0xae3d('0x50')];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'uniqueid':_0xc8f551[_0xae3d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39f213,null))[_0xae3d('0x28')](saveUpdates(_0xc8f551[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x39f213,null))[_0xae3d('0x48')](handleError(_0x39f213,null));};exports[_0xae3d('0x51')]=function(_0x38ccf1,_0x3e30ea,_0x291c7d){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x38ccf1[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),'noSuchContacts'],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),_0xae3d('0x56')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5a')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db['sequelize']['literal'](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5d')))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x61')))),'answeringMachine']]})[_0xae3d('0x28')](handleEntityNotFound(_0x3e30ea,null))[_0xae3d('0x28')](respondWithResult(_0x3e30ea,null))[_0xae3d('0x48')](handleError(_0x3e30ea,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x3a39ed,_0x31b362,_0x253ee4){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'CampaignId':_0x3a39ed[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),_0xae3d('0x62')],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),'noAnswerContacts'],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5a')))),_0xae3d('0x63')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x61')))),_0xae3d('0x64')]]})['then'](handleEntityNotFound(_0x31b362,null))[_0xae3d('0x28')](respondWithResult(_0x31b362,null))['catch'](handleError(_0x31b362,null));};exports[_0xae3d('0x65')]=function(_0x115e99,_0x26c409,_0x4709ea){return db[_0xae3d('0x66')]['find']({'where':{'id':_0x115e99[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x26c409,null))[_0xae3d('0x28')](function(_0x5f1e9c){var _0x546991;if(_0x5f1e9c){_0x546991=squel[_0xae3d('0x67')]()[_0xae3d('0x68')]('cm_hopper')['fromQuery']([_0xae3d('0x69'),'scheduledAt',_0xae3d('0x6a'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('ANY_VALUE(calleridnum)','phone')[_0xae3d('0x6c')](_0xae3d('0x6d'),_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),_0xae3d('0x6a'))[_0xae3d('0x6c')]('ANY_VALUE(ListId)',_0xae3d('0x70'))[_0xae3d('0x6c')](_0xae3d('0x71'),_0xae3d('0x72'))[_0xae3d('0x6c')](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')](_0xae3d('0x6d'),'updatedAt')['from'](_0xae3d('0x73'))[_0xae3d('0x3d')]('VoiceQueueId\x20=\x20?',_0x115e99[_0xae3d('0x4a')]['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x115e99[_0xae3d('0x4f')][_0xae3d('0x75')]['toString']())['where'](_0xae3d('0x76'))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')](_0xae3d('0x69'))['from'](_0xae3d('0x78'))[_0xae3d('0x3d')](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')]('calleridnum')[_0xae3d('0x7a')]('cm_hopper_final')['where'](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x7b')))[_0xae3d('0x7c')]('ContactId'))[_0xae3d('0x74')]();return db[_0xae3d('0x52')][_0xae3d('0x34')](_0x546991);}return[];})[_0xae3d('0x28')](respondWithResult(_0x26c409,null))[_0xae3d('0x48')](handleError(_0x26c409,null));};exports[_0xae3d('0x7d')]=function(_0x1c5f67,_0xa083d0,_0x26e422){return db[_0xae3d('0x7e')][_0xae3d('0x4d')]({'where':{'id':_0x1c5f67[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0xa083d0,null))[_0xae3d('0x28')](function(_0xf281f5){var _0x3261e5;if(_0xf281f5){_0x3261e5=squel[_0xae3d('0x67')]()['into'](_0xae3d('0x78'))[_0xae3d('0x7f')]([_0xae3d('0x69'),_0xae3d('0x6e'),_0xae3d('0x6a'),'ListId',_0xae3d('0x80'),_0xae3d('0x81'),_0xae3d('0x82')],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')](_0xae3d('0x83'),_0xae3d('0x69'))[_0xae3d('0x6c')]('NOW()',_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),'ContactId')[_0xae3d('0x6c')](_0xae3d('0x84'),_0xae3d('0x70'))['field'](_0xae3d('0x85'),_0xae3d('0x80'))['field'](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')]('NOW()',_0xae3d('0x82'))[_0xae3d('0x7a')](_0xae3d('0x73'))[_0xae3d('0x3d')](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x1c5f67['body'][_0xae3d('0x75')][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x76'))['where'](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('phone')['from'](_0xae3d('0x78'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()['field'](_0xae3d('0x87'))[_0xae3d('0x7a')](_0xae3d('0x73'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x204'))['group'](_0xae3d('0x6a')))['toString']();return db['sequelize'][_0xae3d('0x34')](_0x3261e5);}return[];})['then'](respondWithResult(_0xa083d0,null))[_0xae3d('0x48')](handleError(_0xa083d0,null));};exports['checkContactHopper']=function(_0x31f606,_0x47aa7a,_0x27c0ff){return db['CmHopper'][_0xae3d('0x88')]({'where':{'VoiceQueueId':_0x31f606['body'][_0xae3d('0x72')],'CampaignId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x80')],'ContactId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x6a')]}})[_0xae3d('0x28')](handleEntityNotFound(_0x47aa7a,null))[_0xae3d('0x28')](function(_0x95c4ce){if(_0x95c4ce){return _0x95c4ce;}return null;})[_0xae3d('0x28')](respondWithResult(_0x47aa7a,null))['catch'](handleError(_0x47aa7a,null));}; \ No newline at end of file +var _0xeda8=['calleridnum','state\x20=\x204','group','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','rows','catch','show','params','keys','options','find','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','select'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xeda8,0x104));var _0x8eda=function(_0x155248,_0x2652d6){_0x155248=_0x155248-0x0;var _0x28ec60=_0xeda8[_0x155248];return _0x28ec60;};'use strict';var emlformat=require(_0x8eda('0x0'));var rimraf=require(_0x8eda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eda('0x2'));var rp=require(_0x8eda('0x3'));var moment=require(_0x8eda('0x4'));var BPromise=require(_0x8eda('0x5'));var Mustache=require(_0x8eda('0x6'));var util=require(_0x8eda('0x7'));var path=require(_0x8eda('0x8'));var sox=require(_0x8eda('0x9'));var csv=require(_0x8eda('0xa'));var ejs=require(_0x8eda('0xb'));var fs=require('fs');var fs_extra=require(_0x8eda('0xc'));var _=require(_0x8eda('0xd'));var squel=require('squel');var crypto=require(_0x8eda('0xe'));var jsforce=require(_0x8eda('0xf'));var deskjs=require(_0x8eda('0x10'));var toCsv=require(_0x8eda('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8eda('0x11'));var as=require(_0x8eda('0x12'));var hardwareService=require(_0x8eda('0x13'));var logger=require('../../config/logger')(_0x8eda('0x14'));var utils=require('../../config/utils');var config=require(_0x8eda('0x15'));var licenseUtil=require(_0x8eda('0x16'));var db=require(_0x8eda('0x17'))['db'];function respondWithStatusCode(_0x1ad3df,_0x337573){_0x337573=_0x337573||0xcc;return function(_0x3af00c){if(_0x3af00c){return _0x1ad3df[_0x8eda('0x18')](_0x337573);}return _0x1ad3df[_0x8eda('0x19')](_0x337573)['end']();};}function respondWithResult(_0x500bd4,_0xe04d90){_0xe04d90=_0xe04d90||0xc8;return function(_0x223dcf){if(_0x223dcf){return _0x500bd4['status'](_0xe04d90)[_0x8eda('0x1a')](_0x223dcf);}};}function respondWithFilteredResult(_0x34b1ee,_0x123905){return function(_0x56ff8a){if(_0x56ff8a){var _0x3f2925=typeof _0x123905['offset']===_0x8eda('0x1b')&&typeof _0x123905['limit']===_0x8eda('0x1b');var _0x58023b=_0x56ff8a[_0x8eda('0x1c')];var _0x2a4d2b=_0x3f2925?0x0:_0x123905['offset'];var _0x5e44b7=_0x3f2925?_0x56ff8a[_0x8eda('0x1c')]:_0x123905[_0x8eda('0x1d')]+_0x123905[_0x8eda('0x1e')];var _0x41abfa;if(_0x5e44b7>=_0x58023b){_0x5e44b7=_0x58023b;_0x41abfa=0xc8;}else{_0x41abfa=0xce;}_0x34b1ee[_0x8eda('0x19')](_0x41abfa);return _0x34b1ee[_0x8eda('0x1f')](_0x8eda('0x20'),_0x2a4d2b+'-'+_0x5e44b7+'/'+_0x58023b)[_0x8eda('0x1a')](_0x56ff8a);}return null;};}function patchUpdates(_0x850cce){return function(_0x232786){try{jsonpatch[_0x8eda('0x21')](_0x232786,_0x850cce,!![]);}catch(_0x57f336){return BPromise[_0x8eda('0x22')](_0x57f336);}return _0x232786['save']();};}function saveUpdates(_0x45517e,_0x5183bc){return function(_0x1033d6){if(_0x1033d6){return _0x1033d6[_0x8eda('0x23')](_0x45517e)['then'](function(_0x58e54b){return _0x58e54b;});}return null;};}function removeEntity(_0x56dba4,_0x2a4c99){return function(_0x17cae8){if(_0x17cae8){return _0x17cae8['destroy']()[_0x8eda('0x24')](function(){_0x56dba4[_0x8eda('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e955,_0xfa57ca){return function(_0x24b1e1){if(!_0x24b1e1){_0x25e955[_0x8eda('0x18')](0x194);}return _0x24b1e1;};}function handleError(_0x2e42e4,_0x5c8488){_0x5c8488=_0x5c8488||0x1f4;return function(_0x41b5a9){logger['error'](_0x41b5a9[_0x8eda('0x25')]);if(_0x41b5a9[_0x8eda('0x26')]){delete _0x41b5a9[_0x8eda('0x26')];}_0x2e42e4['status'](_0x5c8488)[_0x8eda('0x27')](_0x41b5a9);};}exports[_0x8eda('0x28')]=function(_0x1dd12,_0x4cdd2e){var _0x1616ea={},_0x11a999={},_0x5dd315={'count':0x0,'rows':[]};var _0x27d2ce=_[_0x8eda('0x29')](db[_0x8eda('0x2a')][_0x8eda('0x2b')],function(_0x53274e){return{'name':_0x53274e['fieldName'],'type':_0x53274e['type'][_0x8eda('0x2c')]};});_0x11a999[_0x8eda('0x2d')]=_[_0x8eda('0x29')](_0x27d2ce,'name');_0x11a999['query']=_['keys'](_0x1dd12[_0x8eda('0x2e')]);_0x11a999[_0x8eda('0x2f')]=_[_0x8eda('0x30')](_0x11a999['model'],_0x11a999['query']);_0x1616ea['attributes']=_[_0x8eda('0x30')](_0x11a999[_0x8eda('0x2d')],qs[_0x8eda('0x31')](_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x31')]));_0x1616ea[_0x8eda('0x32')]=_0x1616ea[_0x8eda('0x32')][_0x8eda('0x33')]?_0x1616ea[_0x8eda('0x32')]:_0x11a999[_0x8eda('0x2d')];if(!_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x34')](_0x8eda('0x35'))){_0x1616ea[_0x8eda('0x1e')]=qs['limit'](_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x1e')]);_0x1616ea[_0x8eda('0x1d')]=qs['offset'](_0x1dd12['query'][_0x8eda('0x1d')]);}_0x1616ea[_0x8eda('0x36')]=qs[_0x8eda('0x37')](_0x1dd12[_0x8eda('0x2e')]['sort']);_0x1616ea[_0x8eda('0x38')]=qs[_0x8eda('0x2f')](_[_0x8eda('0x39')](_0x1dd12[_0x8eda('0x2e')],_0x11a999[_0x8eda('0x2f')]),_0x27d2ce);if(_0x1dd12[_0x8eda('0x2e')]['filter']){_0x1616ea[_0x8eda('0x38')]=_[_0x8eda('0x3a')](_0x1616ea[_0x8eda('0x38')],{'$or':_[_0x8eda('0x29')](_0x27d2ce,function(_0x261e12){if(_0x261e12[_0x8eda('0x3b')]!=='VIRTUAL'){var _0x1067eb={};_0x1067eb[_0x261e12[_0x8eda('0x26')]]={'$like':'%'+_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x3c')]+'%'};return _0x1067eb;}})});}_0x1616ea=_[_0x8eda('0x3a')]({},_0x1616ea,_0x1dd12['options']);var _0x17ee80={'where':_0x1616ea[_0x8eda('0x38')]};return db[_0x8eda('0x2a')]['count'](_0x17ee80)[_0x8eda('0x24')](function(_0x5d361e){_0x5dd315[_0x8eda('0x1c')]=_0x5d361e;if(_0x1dd12[_0x8eda('0x2e')][_0x8eda('0x3d')]){_0x1616ea[_0x8eda('0x3e')]=[{'all':!![]}];}return db[_0x8eda('0x2a')]['findAll'](_0x1616ea);})['then'](function(_0xbf14a1){_0x5dd315[_0x8eda('0x3f')]=_0xbf14a1;return _0x5dd315;})[_0x8eda('0x24')](respondWithFilteredResult(_0x4cdd2e,_0x1616ea))[_0x8eda('0x40')](handleError(_0x4cdd2e,null));};exports[_0x8eda('0x41')]=function(_0x13b3bc,_0x18b043){var _0xcb6164={'raw':!![],'where':{'id':_0x13b3bc[_0x8eda('0x42')]['id']}},_0x184590={};_0x184590[_0x8eda('0x2d')]=_[_0x8eda('0x43')](db[_0x8eda('0x2a')][_0x8eda('0x2b')]);_0x184590[_0x8eda('0x2e')]=_[_0x8eda('0x43')](_0x13b3bc[_0x8eda('0x2e')]);_0x184590[_0x8eda('0x2f')]=_[_0x8eda('0x30')](_0x184590['model'],_0x184590[_0x8eda('0x2e')]);_0xcb6164[_0x8eda('0x32')]=_['intersection'](_0x184590[_0x8eda('0x2d')],qs[_0x8eda('0x31')](_0x13b3bc['query'][_0x8eda('0x31')]));_0xcb6164[_0x8eda('0x32')]=_0xcb6164['attributes'][_0x8eda('0x33')]?_0xcb6164[_0x8eda('0x32')]:_0x184590[_0x8eda('0x2d')];if(_0x13b3bc['query'][_0x8eda('0x3d')]){_0xcb6164[_0x8eda('0x3e')]=[{'all':!![]}];}_0xcb6164=_[_0x8eda('0x3a')]({},_0xcb6164,_0x13b3bc[_0x8eda('0x44')]);return db[_0x8eda('0x2a')][_0x8eda('0x45')](_0xcb6164)[_0x8eda('0x24')](handleEntityNotFound(_0x18b043,null))['then'](respondWithResult(_0x18b043,null))[_0x8eda('0x40')](handleError(_0x18b043,null));};exports['describe']=function(_0xcde3e,_0x52b026){return db[_0x8eda('0x2a')]['describe']()[_0x8eda('0x24')](respondWithResult(_0x52b026,null))['catch'](handleError(_0x52b026,null));};exports[_0x8eda('0x23')]=function(_0x3aca19,_0xf445){if(_0x3aca19[_0x8eda('0x46')][_0x8eda('0x47')]){delete _0x3aca19[_0x8eda('0x46')][_0x8eda('0x47')];}return db[_0x8eda('0x2a')][_0x8eda('0x45')]({'where':{'uniqueid':_0x3aca19[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0xf445,null))[_0x8eda('0x24')](saveUpdates(_0x3aca19['body'],null))[_0x8eda('0x24')](respondWithResult(_0xf445,null))[_0x8eda('0x40')](handleError(_0xf445,null));};exports[_0x8eda('0x48')]=function(_0x3259de,_0x33ba39,_0x389399){return db[_0x8eda('0x2a')][_0x8eda('0x49')]({'raw':![],'where':{'VoiceQueueId':_0x3259de[_0x8eda('0x42')]['id']},'attributes':[[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4d')))),'noSuchContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4e')))),'noAnswerContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')]('`state`\x20=\x205,\x201,\x20null'))),_0x8eda('0x4f')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db['sequelize']['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x50')))),'congestionContacts'],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x51')))),_0x8eda('0x52')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')](_0x8eda('0x53')))),'abandonedContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0x8eda('0x54')],[db['sequelize']['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x55')))),_0x8eda('0x56')]]})[_0x8eda('0x24')](handleEntityNotFound(_0x33ba39,null))['then'](respondWithResult(_0x33ba39,null))[_0x8eda('0x40')](handleError(_0x33ba39,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xdd71ce,_0x4ba827,_0xfb98bf){return db['CmHopperFinal'][_0x8eda('0x49')]({'raw':![],'where':{'CampaignId':_0xdd71ce[_0x8eda('0x42')]['id']},'attributes':[[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x8eda('0x4c')](_0x8eda('0x4d')))),'noSuchContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x4e')))),_0x8eda('0x57')],[db['sequelize']['fn']('COUNT',db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x58')))),'busyContacts'],[db[_0x8eda('0x4a')]['fn']('COUNT',db[_0x8eda('0x4a')]['fn']('IF',db['sequelize'][_0x8eda('0x4c')]('`state`\x20=\x208,\x201,\x20null'))),_0x8eda('0x59')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')](_0x8eda('0x51')))),_0x8eda('0x52')],[db[_0x8eda('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eda('0x4a')]['literal'](_0x8eda('0x53')))),_0x8eda('0x5a')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x8eda('0x5b')))),_0x8eda('0x54')],[db[_0x8eda('0x4a')]['fn'](_0x8eda('0x4b'),db[_0x8eda('0x4a')]['fn']('IF',db[_0x8eda('0x4a')][_0x8eda('0x4c')]('`state`\x20=\x2019,\x201,\x20null'))),_0x8eda('0x56')]]})[_0x8eda('0x24')](handleEntityNotFound(_0x4ba827,null))['then'](respondWithResult(_0x4ba827,null))[_0x8eda('0x40')](handleError(_0x4ba827,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x47f57c,_0x49d1a1,_0x5e66cd){return db[_0x8eda('0x5c')][_0x8eda('0x45')]({'where':{'id':_0x47f57c[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x49d1a1,null))[_0x8eda('0x24')](function(_0xe5d324){var _0x589c2f;if(_0xe5d324){_0x589c2f=squel[_0x8eda('0x5d')]()[_0x8eda('0x5e')](_0x8eda('0x5f'))[_0x8eda('0x60')](['phone',_0x8eda('0x61'),_0x8eda('0x62'),_0x8eda('0x63'),_0x8eda('0x64'),_0x8eda('0x65'),_0x8eda('0x66')],squel['select']()[_0x8eda('0x67')](_0x8eda('0x68'),_0x8eda('0x69'))[_0x8eda('0x67')](_0x8eda('0x6a'),_0x8eda('0x61'))[_0x8eda('0x67')](_0x8eda('0x6b'),_0x8eda('0x62'))[_0x8eda('0x67')](_0x8eda('0x6c'),_0x8eda('0x63'))[_0x8eda('0x67')](_0x8eda('0x6d'),'VoiceQueueId')['field'](_0x8eda('0x6a'),_0x8eda('0x65'))[_0x8eda('0x67')](_0x8eda('0x6a'),'updatedAt')[_0x8eda('0x6e')](_0x8eda('0x6f'))['where'](_0x8eda('0x70'),_0x47f57c['params']['id'][_0x8eda('0x71')]())[_0x8eda('0x38')](_0x8eda('0x72'),_0x47f57c['body'][_0x8eda('0x73')][_0x8eda('0x71')]())[_0x8eda('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()[_0x8eda('0x67')]('phone')['from'](_0x8eda('0x5f'))[_0x8eda('0x38')](_0x8eda('0x70'),_0x47f57c[_0x8eda('0x42')]['id']['toString']()))[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x76'))['from'](_0x8eda('0x6f'))[_0x8eda('0x38')](_0x8eda('0x70'),_0x47f57c['params']['id']['toString']())['where'](_0x8eda('0x77')))[_0x8eda('0x78')](_0x8eda('0x62')))[_0x8eda('0x71')]();return db[_0x8eda('0x4a')][_0x8eda('0x2e')](_0x589c2f);}return[];})[_0x8eda('0x24')](respondWithResult(_0x49d1a1,null))[_0x8eda('0x40')](handleError(_0x49d1a1,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1bbe8b,_0x437c6f,_0x1006b1){return db['Campaign'][_0x8eda('0x45')]({'where':{'id':_0x1bbe8b[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x437c6f,null))[_0x8eda('0x24')](function(_0x33350e){var _0x3e245f;if(_0x33350e){_0x3e245f=squel[_0x8eda('0x5d')]()[_0x8eda('0x5e')](_0x8eda('0x5f'))[_0x8eda('0x60')]([_0x8eda('0x69'),'scheduledAt',_0x8eda('0x62'),_0x8eda('0x63'),_0x8eda('0x79'),_0x8eda('0x65'),_0x8eda('0x66')],squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x68'),_0x8eda('0x69'))[_0x8eda('0x67')](_0x8eda('0x6a'),'scheduledAt')['field']('ANY_VALUE(ContactId)',_0x8eda('0x62'))[_0x8eda('0x67')]('ANY_VALUE(ListId)',_0x8eda('0x63'))[_0x8eda('0x67')](_0x8eda('0x7a'),'CampaignId')[_0x8eda('0x67')]('NOW()',_0x8eda('0x65'))['field'](_0x8eda('0x6a'),_0x8eda('0x66'))['from'](_0x8eda('0x6f'))[_0x8eda('0x38')](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]())[_0x8eda('0x38')](_0x8eda('0x72'),_0x1bbe8b[_0x8eda('0x46')][_0x8eda('0x73')][_0x8eda('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x8eda('0x75')]()[_0x8eda('0x67')](_0x8eda('0x69'))['from'](_0x8eda('0x5f'))[_0x8eda('0x38')](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]()))[_0x8eda('0x38')](_0x8eda('0x74'),squel[_0x8eda('0x75')]()['field']('calleridnum')[_0x8eda('0x6e')](_0x8eda('0x6f'))['where'](_0x8eda('0x7b'),_0x1bbe8b[_0x8eda('0x42')]['id'][_0x8eda('0x71')]())['where'](_0x8eda('0x77')))[_0x8eda('0x78')](_0x8eda('0x62')))[_0x8eda('0x71')]();return db[_0x8eda('0x4a')][_0x8eda('0x2e')](_0x3e245f);}return[];})[_0x8eda('0x24')](respondWithResult(_0x437c6f,null))['catch'](handleError(_0x437c6f,null));};exports[_0x8eda('0x7c')]=function(_0x11f734,_0x4cb4e6,_0x5d8512){return db['CmHopper'][_0x8eda('0x7d')]({'where':{'VoiceQueueId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x64')],'CampaignId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x79')],'ContactId':_0x11f734[_0x8eda('0x46')][_0x8eda('0x62')]}})[_0x8eda('0x24')](handleEntityNotFound(_0x4cb4e6,null))[_0x8eda('0x24')](function(_0x1a3993){if(_0x1a3993){return _0x1a3993;}return null;})[_0x8eda('0x24')](respondWithResult(_0x4cb4e6,null))[_0x8eda('0x40')](handleError(_0x4cb4e6,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 288c55b..83467d2 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 _0x7921=['../../config/environment','./cmHopperFinal.attributes','exports','define','calleridnum','uniqueid','util','request-promise','path','rimraf'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7921,0x178));var _0x1792=function(_0x48005f,_0x5355d3){_0x48005f=_0x48005f-0x0;var _0x5b7163=_0x7921[_0x48005f];return _0x5b7163;};'use strict';var _=require('lodash');var util=require(_0x1792('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1792('0x1'));var fs=require('fs');var path=require(_0x1792('0x2'));var rimraf=require(_0x1792('0x3'));var config=require(_0x1792('0x4'));var attributes=require(_0x1792('0x5'));module[_0x1792('0x6')]=function(_0x3493dd,_0x310f18){return _0x3493dd[_0x1792('0x7')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x1792('0x8'),'fields':[_0x1792('0x8')]},{'name':_0x1792('0x9'),'fields':[_0x1792('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae92=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports','define','calleridnum'];(function(_0x192237,_0x1112d9){var _0x50e633=function(_0xf5ce6d){while(--_0xf5ce6d){_0x192237['push'](_0x192237['shift']());}};_0x50e633(++_0x1112d9);}(_0xae92,0xd1));var _0x2ae9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xae92[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2ae9('0x0'));var util=require(_0x2ae9('0x1'));var logger=require(_0x2ae9('0x2'))(_0x2ae9('0x3'));var moment=require(_0x2ae9('0x4'));var BPromise=require('bluebird');var rp=require(_0x2ae9('0x5'));var fs=require('fs');var path=require(_0x2ae9('0x6'));var rimraf=require('rimraf');var config=require(_0x2ae9('0x7'));var attributes=require(_0x2ae9('0x8'));module[_0x2ae9('0x9')]=function(_0x483c67,_0x288e5b){return _0x483c67[_0x2ae9('0xa')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x2ae9('0xb'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0x2ae9('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 307f634..b4d4a59 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xfb8002,_0x4fd084){var _0x33c366=function(_0x46449f){while(--_0x46449f){_0xfb8002['push'](_0xfb8002['shift']());}};_0x33c366(++_0x4fd084);}(_0x7a54,0x106));var _0x47a5=function(_0x5c64af,_0x1e4cd8){_0x5c64af=_0x5c64af-0x0;var _0x131aab=_0x7a54[_0x5c64af];return _0x131aab;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x25c1bb,_0x2b33a6){var _0x5a502b=function(_0x22106f){while(--_0x22106f){_0x25c1bb['push'](_0x25c1bb['shift']());}};_0x5a502b(++_0x2b33a6);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d120a,_0x5e4d33){_0x2d120a=_0x2d120a-0x0;var _0x205747=_0xb10b[_0x2d120a];return _0x205747;};'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 aaf527f..a1bc53b 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 _0x9aea=['post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','index','get','/describe','isAuthenticated','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal'];(function(_0x42ccac,_0x57482f){var _0x5773ae=function(_0x24cb73){while(--_0x24cb73){_0x42ccac['push'](_0x42ccac['shift']());}};_0x5773ae(++_0x57482f);}(_0x9aea,0xee));var _0xa9ae=function(_0x109a91,_0x170509){_0x109a91=_0x109a91-0x0;var _0x31c5e9=_0x9aea[_0x109a91];return _0x31c5e9;};'use strict';var multer=require(_0xa9ae('0x0'));var util=require('util');var path=require(_0xa9ae('0x1'));var timeout=require('connect-timeout');var express=require(_0xa9ae('0x2'));var router=express['Router']();var fs_extra=require(_0xa9ae('0x3'));var auth=require(_0xa9ae('0x4'));var interaction=require(_0xa9ae('0x5'));var config=require('../../config/environment');var controller=require(_0xa9ae('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa9ae('0x7')]);router[_0xa9ae('0x8')](_0xa9ae('0x9'),auth[_0xa9ae('0xa')](),controller['describe']);router['get'](_0xa9ae('0xb'),auth[_0xa9ae('0xa')](),controller[_0xa9ae('0xc')]);router['get'](_0xa9ae('0xd'),auth[_0xa9ae('0xa')](),controller[_0xa9ae('0xe')]);router[_0xa9ae('0x8')]('/campaign/countAttributes/:id',auth[_0xa9ae('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xa9ae('0xf')](_0xa9ae('0x10'),auth['isAuthenticated'](),controller[_0xa9ae('0x11')]);router['post'](_0xa9ae('0x12'),auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xa9ae('0xf')](_0xa9ae('0x13'),auth[_0xa9ae('0xa')](),controller[_0xa9ae('0x14')]);router[_0xa9ae('0x15')](_0xa9ae('0xb'),auth[_0xa9ae('0xa')](),controller['update']);module[_0xa9ae('0x16')]=router; \ No newline at end of file +var _0xfa25=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put'];(function(_0x1d0582,_0x566c25){var _0x1e70da=function(_0x1c701c){while(--_0x1c701c){_0x1d0582['push'](_0x1d0582['shift']());}};_0x1e70da(++_0x566c25);}(_0xfa25,0xd1));var _0x5fa2=function(_0x248902,_0x5bb080){_0x248902=_0x248902-0x0;var _0x3d0260=_0xfa25[_0x248902];return _0x3d0260;};'use strict';var multer=require('multer');var util=require(_0x5fa2('0x0'));var path=require(_0x5fa2('0x1'));var timeout=require(_0x5fa2('0x2'));var express=require(_0x5fa2('0x3'));var router=express[_0x5fa2('0x4')]();var fs_extra=require(_0x5fa2('0x5'));var auth=require(_0x5fa2('0x6'));var interaction=require(_0x5fa2('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x5fa2('0x8')]('/',auth[_0x5fa2('0x9')](),controller['index']);router['get'](_0x5fa2('0xa'),auth['isAuthenticated'](),controller[_0x5fa2('0xb')]);router[_0x5fa2('0x8')](_0x5fa2('0xc'),auth['isAuthenticated'](),controller[_0x5fa2('0xd')]);router[_0x5fa2('0x8')](_0x5fa2('0xe'),auth['isAuthenticated'](),controller[_0x5fa2('0xf')]);router['get']('/campaign/countAttributes/:id',auth[_0x5fa2('0x9')](),controller[_0x5fa2('0x10')]);router['post'](_0x5fa2('0x11'),auth[_0x5fa2('0x9')](),controller[_0x5fa2('0x12')]);router[_0x5fa2('0x13')](_0x5fa2('0x14'),auth[_0x5fa2('0x9')](),controller[_0x5fa2('0x15')]);router[_0x5fa2('0x13')](_0x5fa2('0x16'),auth[_0x5fa2('0x9')](),controller[_0x5fa2('0x17')]);router[_0x5fa2('0x18')](_0x5fa2('0xc'),auth[_0x5fa2('0x9')](),controller['update']);module[_0x5fa2('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 953bde7..bf85306 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 _0x2791=['DATE','BOOLEAN','INTEGER','STRING'];(function(_0x297893,_0x44666b){var _0x413dc5=function(_0x5b3392){while(--_0x5b3392){_0x297893['push'](_0x297893['shift']());}};_0x413dc5(++_0x44666b);}(_0x2791,0x15a));var _0x1279=function(_0x30d8ea,_0x155f0d){_0x30d8ea=_0x30d8ea-0x0;var _0x2408ac=_0x2791[_0x30d8ea];return _0x2408ac;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x1279('0x0')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x1279('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1279('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1279('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x1279('0x1')]},'originatecalleridname':{'type':Sequelize[_0x1279('0x1')]},'calleridnum':{'type':Sequelize[_0x1279('0x1')]},'calleridname':{'type':Sequelize[_0x1279('0x1')]},'starttime':{'type':Sequelize[_0x1279('0x2')]},'responsetime':{'type':Sequelize[_0x1279('0x2')]},'answertime':{'type':Sequelize[_0x1279('0x2')]},'droptime':{'type':Sequelize[_0x1279('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x1279('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1279('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1279('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1279('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1279('0x1')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x1279('0x1')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x1279('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0x1279('0x3')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1279('0x2')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x1279('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x1279('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1279('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1279('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1279('0x0')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x1279('0x1')]}}; \ No newline at end of file +var _0xbfd1=['INTEGER','DATE','BOOLEAN','exports','STRING'];(function(_0x5dfd65,_0x1ad889){var _0x47f853=function(_0x3fafbf){while(--_0x3fafbf){_0x5dfd65['push'](_0x5dfd65['shift']());}};_0x47f853(++_0x1ad889);}(_0xbfd1,0x134));var _0x1bfd=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xbfd1[_0x4baae2];return _0x1a2285;};'use strict';var Sequelize=require('sequelize');module[_0x1bfd('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x1bfd('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x1bfd('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1bfd('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1bfd('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1bfd('0x1')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x1bfd('0x1')]},'calleridnum':{'type':Sequelize[_0x1bfd('0x1')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x1bfd('0x3')]},'responsetime':{'type':Sequelize[_0x1bfd('0x3')]},'answertime':{'type':Sequelize[_0x1bfd('0x3')]},'droptime':{'type':Sequelize[_0x1bfd('0x3')]},'endtime':{'type':Sequelize[_0x1bfd('0x3')]},'ringtime':{'type':Sequelize[_0x1bfd('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1bfd('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1bfd('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1bfd('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1bfd('0x1')]},'campaign':{'type':Sequelize[_0x1bfd('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x1bfd('0x1')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x1bfd('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x1bfd('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1bfd('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1bfd('0x3')]},'recallme':{'type':Sequelize[_0x1bfd('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x1bfd('0x3')]},'edited':{'type':Sequelize[_0x1bfd('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x1bfd('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1bfd('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1bfd('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1bfd('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 40e1ce8..905eb92 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 _0xb969=['sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','CmHopperHistory','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x456120,_0x41f4b6){var _0x5bb63e=function(_0x15416a){while(--_0x15416a){_0x456120['push'](_0x456120['shift']());}};_0x5bb63e(++_0x41f4b6);}(_0xb969,0xc8));var _0x9b96=function(_0x158f4a,_0x173155){_0x158f4a=_0x158f4a-0x0;var _0x3bf08a=_0xb969[_0x158f4a];return _0x3bf08a;};'use strict';var emlformat=require(_0x9b96('0x0'));var rimraf=require(_0x9b96('0x1'));var zipdir=require(_0x9b96('0x2'));var jsonpatch=require(_0x9b96('0x3'));var rp=require(_0x9b96('0x4'));var moment=require(_0x9b96('0x5'));var BPromise=require(_0x9b96('0x6'));var Mustache=require('mustache');var util=require(_0x9b96('0x7'));var path=require(_0x9b96('0x8'));var sox=require(_0x9b96('0x9'));var csv=require(_0x9b96('0xa'));var ejs=require(_0x9b96('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b96('0xc'));var squel=require(_0x9b96('0xd'));var crypto=require(_0x9b96('0xe'));var jsforce=require(_0x9b96('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9b96('0xa'));var querystring=require(_0x9b96('0x10'));var Papa=require(_0x9b96('0x11'));var Redis=require(_0x9b96('0x12'));var authService=require(_0x9b96('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9b96('0x14'));var hardwareService=require(_0x9b96('0x15'));var logger=require('../../config/logger')(_0x9b96('0x16'));var utils=require(_0x9b96('0x17'));var config=require(_0x9b96('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ac26a,_0x5c1de9){_0x5c1de9=_0x5c1de9||0xcc;return function(_0x4018df){if(_0x4018df){return _0x5ac26a[_0x9b96('0x19')](_0x5c1de9);}return _0x5ac26a[_0x9b96('0x1a')](_0x5c1de9)[_0x9b96('0x1b')]();};}function respondWithResult(_0x5cb659,_0x18d2d3){_0x18d2d3=_0x18d2d3||0xc8;return function(_0x124f76){if(_0x124f76){return _0x5cb659[_0x9b96('0x1a')](_0x18d2d3)[_0x9b96('0x1c')](_0x124f76);}};}function respondWithFilteredResult(_0x220e72,_0x37211b){return function(_0xa0281a){if(_0xa0281a){var _0x2ce51f=typeof _0x37211b[_0x9b96('0x1d')]==='undefined'&&typeof _0x37211b['limit']===_0x9b96('0x1e');var _0x351aed=_0xa0281a[_0x9b96('0x1f')];var _0x5d9278=_0x2ce51f?0x0:_0x37211b[_0x9b96('0x1d')];var _0x10a41f=_0x2ce51f?_0xa0281a[_0x9b96('0x1f')]:_0x37211b[_0x9b96('0x1d')]+_0x37211b['limit'];var _0x373628;if(_0x10a41f>=_0x351aed){_0x10a41f=_0x351aed;_0x373628=0xc8;}else{_0x373628=0xce;}_0x220e72['status'](_0x373628);return _0x220e72[_0x9b96('0x20')](_0x9b96('0x21'),_0x5d9278+'-'+_0x10a41f+'/'+_0x351aed)[_0x9b96('0x1c')](_0xa0281a);}return null;};}function patchUpdates(_0x12158d){return function(_0x4f39af){try{jsonpatch[_0x9b96('0x22')](_0x4f39af,_0x12158d,!![]);}catch(_0x4a7c3){return BPromise[_0x9b96('0x23')](_0x4a7c3);}return _0x4f39af['save']();};}function saveUpdates(_0x4b969e,_0x2a4283){return function(_0x72a049){if(_0x72a049){return _0x72a049[_0x9b96('0x24')](_0x4b969e)[_0x9b96('0x25')](function(_0x2d442d){return _0x2d442d;});}return null;};}function removeEntity(_0x72ad7f,_0xd6e5e){return function(_0xfc0e9d){if(_0xfc0e9d){return _0xfc0e9d['destroy']()['then'](function(){_0x72ad7f['status'](0xcc)[_0x9b96('0x1b')]();});}};}function handleEntityNotFound(_0x12451b,_0x52b7f6){return function(_0x38cc27){if(!_0x38cc27){_0x12451b[_0x9b96('0x19')](0x194);}return _0x38cc27;};}function handleError(_0x29c92b,_0x2c14a3){_0x2c14a3=_0x2c14a3||0x1f4;return function(_0x1167bc){logger[_0x9b96('0x26')](_0x1167bc[_0x9b96('0x27')]);if(_0x1167bc[_0x9b96('0x28')]){delete _0x1167bc[_0x9b96('0x28')];}_0x29c92b['status'](_0x2c14a3)[_0x9b96('0x29')](_0x1167bc);};}exports[_0x9b96('0x2a')]=function(_0x2c849d,_0xab89d7){var _0x2ceac3={},_0x3bcad4={},_0x3a8383={'count':0x0,'rows':[]};var _0x5c826d=_['map'](db[_0x9b96('0x2b')][_0x9b96('0x2c')],function(_0x4de347){return{'name':_0x4de347['fieldName'],'type':_0x4de347[_0x9b96('0x2d')][_0x9b96('0x2e')]};});_0x3bcad4[_0x9b96('0x2f')]=_[_0x9b96('0x30')](_0x5c826d,_0x9b96('0x28'));_0x3bcad4[_0x9b96('0x31')]=_[_0x9b96('0x32')](_0x2c849d[_0x9b96('0x31')]);_0x3bcad4[_0x9b96('0x33')]=_[_0x9b96('0x34')](_0x3bcad4[_0x9b96('0x2f')],_0x3bcad4[_0x9b96('0x31')]);_0x2ceac3['attributes']=_[_0x9b96('0x34')](_0x3bcad4[_0x9b96('0x2f')],qs['fields'](_0x2c849d[_0x9b96('0x31')][_0x9b96('0x35')]));_0x2ceac3[_0x9b96('0x36')]=_0x2ceac3[_0x9b96('0x36')][_0x9b96('0x37')]?_0x2ceac3[_0x9b96('0x36')]:_0x3bcad4[_0x9b96('0x2f')];if(!_0x2c849d[_0x9b96('0x31')][_0x9b96('0x38')]('nolimit')){_0x2ceac3[_0x9b96('0x39')]=qs[_0x9b96('0x39')](_0x2c849d[_0x9b96('0x31')][_0x9b96('0x39')]);_0x2ceac3[_0x9b96('0x1d')]=qs['offset'](_0x2c849d[_0x9b96('0x31')][_0x9b96('0x1d')]);}_0x2ceac3['order']=qs['sort'](_0x2c849d['query']['sort']);_0x2ceac3['where']=qs[_0x9b96('0x33')](_[_0x9b96('0x3a')](_0x2c849d[_0x9b96('0x31')],_0x3bcad4[_0x9b96('0x33')]),_0x5c826d);if(_0x2c849d['query'][_0x9b96('0x3b')]){_0x2ceac3[_0x9b96('0x3c')]=_['merge'](_0x2ceac3[_0x9b96('0x3c')],{'$or':_[_0x9b96('0x30')](_0x5c826d,function(_0x36e09d){if(_0x36e09d[_0x9b96('0x2d')]!=='VIRTUAL'){var _0x19e2ce={};_0x19e2ce[_0x36e09d['name']]={'$like':'%'+_0x2c849d[_0x9b96('0x31')][_0x9b96('0x3b')]+'%'};return _0x19e2ce;}})});}_0x2ceac3=_[_0x9b96('0x3d')]({},_0x2ceac3,_0x2c849d[_0x9b96('0x3e')]);var _0x45c75a={'where':_0x2ceac3[_0x9b96('0x3c')]};return db['CmHopperHistory']['count'](_0x45c75a)[_0x9b96('0x25')](function(_0x356a29){_0x3a8383[_0x9b96('0x1f')]=_0x356a29;if(_0x2c849d['query'][_0x9b96('0x3f')]){_0x2ceac3['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x9b96('0x40')](_0x2ceac3);})[_0x9b96('0x25')](function(_0x2896f9){_0x3a8383[_0x9b96('0x41')]=_0x2896f9;return _0x3a8383;})[_0x9b96('0x25')](respondWithFilteredResult(_0xab89d7,_0x2ceac3))[_0x9b96('0x42')](handleError(_0xab89d7,null));};exports[_0x9b96('0x43')]=function(_0x337fb0,_0x16e79d){var _0xc8959f={'raw':!![],'where':{'id':_0x337fb0[_0x9b96('0x44')]['id']}},_0x52d0ad={};_0x52d0ad['model']=_[_0x9b96('0x32')](db[_0x9b96('0x2b')][_0x9b96('0x2c')]);_0x52d0ad[_0x9b96('0x31')]=_[_0x9b96('0x32')](_0x337fb0['query']);_0x52d0ad[_0x9b96('0x33')]=_[_0x9b96('0x34')](_0x52d0ad[_0x9b96('0x2f')],_0x52d0ad[_0x9b96('0x31')]);_0xc8959f[_0x9b96('0x36')]=_[_0x9b96('0x34')](_0x52d0ad[_0x9b96('0x2f')],qs[_0x9b96('0x35')](_0x337fb0['query'][_0x9b96('0x35')]));_0xc8959f[_0x9b96('0x36')]=_0xc8959f['attributes'][_0x9b96('0x37')]?_0xc8959f['attributes']:_0x52d0ad[_0x9b96('0x2f')];if(_0x337fb0[_0x9b96('0x31')]['includeAll']){_0xc8959f[_0x9b96('0x45')]=[{'all':!![]}];}_0xc8959f=_[_0x9b96('0x3d')]({},_0xc8959f,_0x337fb0['options']);return db[_0x9b96('0x2b')][_0x9b96('0x46')](_0xc8959f)['then'](handleEntityNotFound(_0x16e79d,null))[_0x9b96('0x25')](respondWithResult(_0x16e79d,null))[_0x9b96('0x42')](handleError(_0x16e79d,null));};exports[_0x9b96('0x47')]=function(_0x5e6a28,_0x343202){return db[_0x9b96('0x2b')][_0x9b96('0x47')](_0x5e6a28[_0x9b96('0x48')],{})[_0x9b96('0x25')](respondWithResult(_0x343202,0xc9))[_0x9b96('0x42')](handleError(_0x343202,null));};exports[_0x9b96('0x49')]=function(_0x549a9f,_0x509bf2){return db[_0x9b96('0x2b')][_0x9b96('0x49')]()['then'](respondWithResult(_0x509bf2,null))[_0x9b96('0x42')](handleError(_0x509bf2,null));};exports[_0x9b96('0x24')]=function(_0x4583c5,_0x2ab112){if(_0x4583c5[_0x9b96('0x48')][_0x9b96('0x4a')]){delete _0x4583c5[_0x9b96('0x48')]['uniqueid'];}return db[_0x9b96('0x2b')]['find']({'where':{'uniqueid':_0x4583c5[_0x9b96('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ab112,null))[_0x9b96('0x25')](saveUpdates(_0x4583c5[_0x9b96('0x48')],null))[_0x9b96('0x25')](respondWithResult(_0x2ab112,null))['catch'](handleError(_0x2ab112,null));}; \ No newline at end of file +var _0x7d70=['limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','keys','query','intersection','model','fields','length','attributes','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count'];(function(_0x32e177,_0x36e436){var _0x172dd1=function(_0x4e46e7){while(--_0x4e46e7){_0x32e177['push'](_0x32e177['shift']());}};_0x172dd1(++_0x36e436);}(_0x7d70,0x1eb));var _0x07d7=function(_0x311f84,_0x482a7b){_0x311f84=_0x311f84-0x0;var _0x275f9f=_0x7d70[_0x311f84];return _0x275f9f;};'use strict';var emlformat=require(_0x07d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x07d7('0x1'));var jsonpatch=require(_0x07d7('0x2'));var rp=require(_0x07d7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x07d7('0x4'));var util=require(_0x07d7('0x5'));var path=require(_0x07d7('0x6'));var sox=require(_0x07d7('0x7'));var csv=require(_0x07d7('0x8'));var ejs=require(_0x07d7('0x9'));var fs=require('fs');var fs_extra=require(_0x07d7('0xa'));var _=require(_0x07d7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x07d7('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x07d7('0xd'));var Redis=require('ioredis');var authService=require(_0x07d7('0xe'));var qs=require(_0x07d7('0xf'));var as=require(_0x07d7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x07d7('0x11'))(_0x07d7('0x12'));var utils=require(_0x07d7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x07d7('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x577731,_0x526e2d){_0x526e2d=_0x526e2d||0xcc;return function(_0x57e892){if(_0x57e892){return _0x577731[_0x07d7('0x15')](_0x526e2d);}return _0x577731[_0x07d7('0x16')](_0x526e2d)['end']();};}function respondWithResult(_0x7b5f91,_0x27cbbf){_0x27cbbf=_0x27cbbf||0xc8;return function(_0x15570e){if(_0x15570e){return _0x7b5f91[_0x07d7('0x16')](_0x27cbbf)[_0x07d7('0x17')](_0x15570e);}};}function respondWithFilteredResult(_0x37e3f8,_0x590258){return function(_0x16d596){if(_0x16d596){var _0x14ee7c=typeof _0x590258[_0x07d7('0x18')]==='undefined'&&typeof _0x590258['limit']===_0x07d7('0x19');var _0x516e97=_0x16d596[_0x07d7('0x1a')];var _0x2a654a=_0x14ee7c?0x0:_0x590258[_0x07d7('0x18')];var _0x4e76e4=_0x14ee7c?_0x16d596[_0x07d7('0x1a')]:_0x590258['offset']+_0x590258[_0x07d7('0x1b')];var _0x1037f7;if(_0x4e76e4>=_0x516e97){_0x4e76e4=_0x516e97;_0x1037f7=0xc8;}else{_0x1037f7=0xce;}_0x37e3f8[_0x07d7('0x16')](_0x1037f7);return _0x37e3f8[_0x07d7('0x1c')](_0x07d7('0x1d'),_0x2a654a+'-'+_0x4e76e4+'/'+_0x516e97)[_0x07d7('0x17')](_0x16d596);}return null;};}function patchUpdates(_0x355d8e){return function(_0x51bfba){try{jsonpatch[_0x07d7('0x1e')](_0x51bfba,_0x355d8e,!![]);}catch(_0x466684){return BPromise[_0x07d7('0x1f')](_0x466684);}return _0x51bfba['save']();};}function saveUpdates(_0x5efbd6,_0xd07fea){return function(_0x21736d){if(_0x21736d){return _0x21736d[_0x07d7('0x20')](_0x5efbd6)[_0x07d7('0x21')](function(_0x3e8efc){return _0x3e8efc;});}return null;};}function removeEntity(_0x47936d,_0x5bae81){return function(_0x2f4fe4){if(_0x2f4fe4){return _0x2f4fe4[_0x07d7('0x22')]()[_0x07d7('0x21')](function(){_0x47936d[_0x07d7('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e1dbc,_0x479afd){return function(_0x48f55f){if(!_0x48f55f){_0x1e1dbc[_0x07d7('0x15')](0x194);}return _0x48f55f;};}function handleError(_0x499aa8,_0x2ad576){_0x2ad576=_0x2ad576||0x1f4;return function(_0x4efc48){logger[_0x07d7('0x23')](_0x4efc48[_0x07d7('0x24')]);if(_0x4efc48[_0x07d7('0x25')]){delete _0x4efc48[_0x07d7('0x25')];}_0x499aa8[_0x07d7('0x16')](_0x2ad576)[_0x07d7('0x26')](_0x4efc48);};}exports[_0x07d7('0x27')]=function(_0x444f17,_0x56213f){var _0x364dd5={},_0x5bca43={},_0x2312ff={'count':0x0,'rows':[]};var _0x2ac2ad=_[_0x07d7('0x28')](db[_0x07d7('0x29')][_0x07d7('0x2a')],function(_0x192ce6){return{'name':_0x192ce6[_0x07d7('0x2b')],'type':_0x192ce6[_0x07d7('0x2c')][_0x07d7('0x2d')]};});_0x5bca43['model']=_[_0x07d7('0x28')](_0x2ac2ad,'name');_0x5bca43['query']=_[_0x07d7('0x2e')](_0x444f17[_0x07d7('0x2f')]);_0x5bca43['filters']=_[_0x07d7('0x30')](_0x5bca43[_0x07d7('0x31')],_0x5bca43[_0x07d7('0x2f')]);_0x364dd5['attributes']=_[_0x07d7('0x30')](_0x5bca43[_0x07d7('0x31')],qs[_0x07d7('0x32')](_0x444f17[_0x07d7('0x2f')][_0x07d7('0x32')]));_0x364dd5['attributes']=_0x364dd5['attributes'][_0x07d7('0x33')]?_0x364dd5[_0x07d7('0x34')]:_0x5bca43[_0x07d7('0x31')];if(!_0x444f17[_0x07d7('0x2f')]['hasOwnProperty'](_0x07d7('0x35'))){_0x364dd5[_0x07d7('0x1b')]=qs[_0x07d7('0x1b')](_0x444f17[_0x07d7('0x2f')][_0x07d7('0x1b')]);_0x364dd5[_0x07d7('0x18')]=qs[_0x07d7('0x18')](_0x444f17[_0x07d7('0x2f')][_0x07d7('0x18')]);}_0x364dd5[_0x07d7('0x36')]=qs[_0x07d7('0x37')](_0x444f17[_0x07d7('0x2f')][_0x07d7('0x37')]);_0x364dd5[_0x07d7('0x38')]=qs['filters'](_[_0x07d7('0x39')](_0x444f17[_0x07d7('0x2f')],_0x5bca43[_0x07d7('0x3a')]),_0x2ac2ad);if(_0x444f17[_0x07d7('0x2f')]['filter']){_0x364dd5[_0x07d7('0x38')]=_[_0x07d7('0x3b')](_0x364dd5[_0x07d7('0x38')],{'$or':_[_0x07d7('0x28')](_0x2ac2ad,function(_0x4d10b9){if(_0x4d10b9[_0x07d7('0x2c')]!==_0x07d7('0x3c')){var _0x3fb73a={};_0x3fb73a[_0x4d10b9[_0x07d7('0x25')]]={'$like':'%'+_0x444f17[_0x07d7('0x2f')][_0x07d7('0x3d')]+'%'};return _0x3fb73a;}})});}_0x364dd5=_[_0x07d7('0x3b')]({},_0x364dd5,_0x444f17[_0x07d7('0x3e')]);var _0x4c90bc={'where':_0x364dd5[_0x07d7('0x38')]};return db[_0x07d7('0x29')][_0x07d7('0x1a')](_0x4c90bc)[_0x07d7('0x21')](function(_0x1ef250){_0x2312ff[_0x07d7('0x1a')]=_0x1ef250;if(_0x444f17['query'][_0x07d7('0x3f')]){_0x364dd5[_0x07d7('0x40')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x07d7('0x41')](_0x364dd5);})[_0x07d7('0x21')](function(_0x241a66){_0x2312ff['rows']=_0x241a66;return _0x2312ff;})[_0x07d7('0x21')](respondWithFilteredResult(_0x56213f,_0x364dd5))[_0x07d7('0x42')](handleError(_0x56213f,null));};exports[_0x07d7('0x43')]=function(_0x327b81,_0x4a1584){var _0x2dca7c={'raw':!![],'where':{'id':_0x327b81[_0x07d7('0x44')]['id']}},_0x2b8431={};_0x2b8431[_0x07d7('0x31')]=_['keys'](db['CmHopperHistory'][_0x07d7('0x2a')]);_0x2b8431['query']=_[_0x07d7('0x2e')](_0x327b81[_0x07d7('0x2f')]);_0x2b8431['filters']=_[_0x07d7('0x30')](_0x2b8431[_0x07d7('0x31')],_0x2b8431[_0x07d7('0x2f')]);_0x2dca7c['attributes']=_[_0x07d7('0x30')](_0x2b8431[_0x07d7('0x31')],qs['fields'](_0x327b81[_0x07d7('0x2f')][_0x07d7('0x32')]));_0x2dca7c[_0x07d7('0x34')]=_0x2dca7c[_0x07d7('0x34')][_0x07d7('0x33')]?_0x2dca7c[_0x07d7('0x34')]:_0x2b8431[_0x07d7('0x31')];if(_0x327b81[_0x07d7('0x2f')][_0x07d7('0x3f')]){_0x2dca7c[_0x07d7('0x40')]=[{'all':!![]}];}_0x2dca7c=_[_0x07d7('0x3b')]({},_0x2dca7c,_0x327b81['options']);return db[_0x07d7('0x29')][_0x07d7('0x45')](_0x2dca7c)[_0x07d7('0x21')](handleEntityNotFound(_0x4a1584,null))[_0x07d7('0x21')](respondWithResult(_0x4a1584,null))[_0x07d7('0x42')](handleError(_0x4a1584,null));};exports[_0x07d7('0x46')]=function(_0x4d4823,_0x2e97fd){return db['CmHopperHistory']['create'](_0x4d4823[_0x07d7('0x47')],{})['then'](respondWithResult(_0x2e97fd,0xc9))[_0x07d7('0x42')](handleError(_0x2e97fd,null));};exports[_0x07d7('0x48')]=function(_0x5b7c21,_0x110d60){return db[_0x07d7('0x29')][_0x07d7('0x48')]()[_0x07d7('0x21')](respondWithResult(_0x110d60,null))[_0x07d7('0x42')](handleError(_0x110d60,null));};exports[_0x07d7('0x20')]=function(_0x1f9ac1,_0x5934a6){if(_0x1f9ac1['body']['uniqueid']){delete _0x1f9ac1[_0x07d7('0x47')][_0x07d7('0x49')];}return db['CmHopperHistory'][_0x07d7('0x45')]({'where':{'uniqueid':_0x1f9ac1[_0x07d7('0x44')]['id']}})[_0x07d7('0x21')](handleEntityNotFound(_0x5934a6,null))['then'](saveUpdates(_0x1f9ac1[_0x07d7('0x47')],null))['then'](respondWithResult(_0x5934a6,null))['catch'](handleError(_0x5934a6,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index dcb385e..e73534e 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 _0xa32b=['./cmHopperHistory.attributes','exports','CmHopperHistory','endtime','uniqueid','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa32b,0x68));var _0xba32=function(_0x5d6c3e,_0x409a3e){_0x5d6c3e=_0x5d6c3e-0x0;var _0x44ecb7=_0xa32b[_0x5d6c3e];return _0x44ecb7;};'use strict';var _=require(_0xba32('0x0'));var util=require('util');var logger=require(_0xba32('0x1'))('api');var moment=require('moment');var BPromise=require(_0xba32('0x2'));var rp=require(_0xba32('0x3'));var fs=require('fs');var path=require(_0xba32('0x4'));var rimraf=require('rimraf');var config=require(_0xba32('0x5'));var attributes=require(_0xba32('0x6'));module[_0xba32('0x7')]=function(_0x312fe7,_0x31dc74){return _0x312fe7['define'](_0xba32('0x8'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xba32('0x9'),'fields':[_0xba32('0x9')]},{'name':_0xba32('0xa'),'fields':[_0xba32('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x80e0=['cm_hopper_history','endtime','uniqueid','../../config/logger','api','moment','request-promise','path','rimraf','./cmHopperHistory.attributes','exports'];(function(_0x4454e7,_0x273018){var _0x3966bb=function(_0xc21cee){while(--_0xc21cee){_0x4454e7['push'](_0x4454e7['shift']());}};_0x3966bb(++_0x273018);}(_0x80e0,0x9d));var _0x080e=function(_0x372a74,_0x5df93c){_0x372a74=_0x372a74-0x0;var _0x533013=_0x80e0[_0x372a74];return _0x533013;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x080e('0x0'))(_0x080e('0x1'));var moment=require(_0x080e('0x2'));var BPromise=require('bluebird');var rp=require(_0x080e('0x3'));var fs=require('fs');var path=require(_0x080e('0x4'));var rimraf=require(_0x080e('0x5'));var config=require('../../config/environment');var attributes=require(_0x080e('0x6'));module[_0x080e('0x7')]=function(_0x307481,_0x52548f){return _0x307481['define']('CmHopperHistory',attributes,{'tableName':_0x080e('0x8'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x080e('0x9')]},{'name':'uniqueid','fields':[_0x080e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index ab90a0e..c33fe07 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 _0xcd56=['body','options','raw','stringify','CreateCmHopperHistory','AvgHandleTime','findAll','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','GetCampaignHopperHistory','where','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CmHopperHistory','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd56,0x1c9));var _0x6cd5=function(_0x226012,_0x4a2ad7){_0x226012=_0x226012-0x0;var _0x1de528=_0xcd56[_0x226012];return _0x1de528;};'use strict';var _=require(_0x6cd5('0x0'));var util=require(_0x6cd5('0x1'));var moment=require(_0x6cd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cd5('0x3'));var fs=require('fs');var Redis=require(_0x6cd5('0x4'));var db=require(_0x6cd5('0x5'))['db'];var utils=require(_0x6cd5('0x6'));var logger=require(_0x6cd5('0x7'))(_0x6cd5('0x8'));var config=require(_0x6cd5('0x9'));var jayson=require(_0x6cd5('0xa'));var client=jayson['client'][_0x6cd5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6a4a9c,_0x1c4af9,_0x25e9a3){return new BPromise(function(_0x589bf9,_0x52c80b){return client[_0x6cd5('0xc')](_0x6a4a9c,_0x25e9a3)[_0x6cd5('0xd')](function(_0x474eb7){logger[_0x6cd5('0xe')](_0x6cd5('0xf'),_0x1c4af9,_0x6cd5('0x10'));logger[_0x6cd5('0x11')](_0x6cd5('0x12'),_0x1c4af9,_0x6cd5('0x10'),JSON['stringify'](_0x474eb7));if(_0x474eb7[_0x6cd5('0x13')]){if(_0x474eb7['error'][_0x6cd5('0x14')]===0x1f4){logger[_0x6cd5('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x1c4af9,_0x474eb7['error']['message']);return _0x52c80b(_0x474eb7[_0x6cd5('0x13')]['message']);}logger[_0x6cd5('0x13')](_0x6cd5('0xf'),_0x1c4af9,_0x474eb7['error'][_0x6cd5('0x15')]);return _0x589bf9(_0x474eb7[_0x6cd5('0x13')]['message']);}else{logger[_0x6cd5('0xe')](_0x6cd5('0xf'),_0x1c4af9,_0x6cd5('0x10'));_0x589bf9(_0x474eb7[_0x6cd5('0x16')][_0x6cd5('0x15')]);}})[_0x6cd5('0x17')](function(_0x382547){logger[_0x6cd5('0x13')](_0x6cd5('0xf'),_0x1c4af9,_0x382547);_0x52c80b(_0x382547);});});}exports['CreateCmHopperHistory']=function(_0xb696b9){var _0xe42af0=this;return new Promise(function(_0x1bef3d,_0x50724d){return db[_0x6cd5('0x18')][_0x6cd5('0x19')](_0xb696b9[_0x6cd5('0x1a')],{'raw':_0xb696b9[_0x6cd5('0x1b')]?_0xb696b9['options'][_0x6cd5('0x1c')]===undefined?!![]:![]:!![]})[_0x6cd5('0xd')](function(_0x1b2bce){logger[_0x6cd5('0xe')]('CreateCmHopperHistory',_0xb696b9);logger[_0x6cd5('0x11')]('CreateCmHopperHistory',_0xb696b9,JSON[_0x6cd5('0x1d')](_0x1b2bce));_0x1bef3d(_0x1b2bce);})[_0x6cd5('0x17')](function(_0x314b5a){logger['error'](_0x6cd5('0x1e'),_0x314b5a['message'],_0xb696b9);_0x50724d(_0xe42af0[_0x6cd5('0x13')](0x1f4,_0x314b5a['message']));});});};exports[_0x6cd5('0x1f')]=function(_0x234648){var _0x2feb60=this;return new Promise(function(_0x4e502a,_0xba6cb9){return db[_0x6cd5('0x18')][_0x6cd5('0x20')]({'raw':_0x234648[_0x6cd5('0x1b')]?_0x234648[_0x6cd5('0x1b')][_0x6cd5('0x1c')]===undefined?!![]:![]:!![],'where':_0x234648['options']?_0x234648['options']['where']||null:null,'attributes':[[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x22'),db[_0x6cd5('0x21')][_0x6cd5('0x23')]('id')),'predictiveIntervalTotalCalls'],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x22'),db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')](_0x6cd5('0x25')))),_0x6cd5('0x26')],[db[_0x6cd5('0x21')]['fn']('COUNT',db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')](_0x6cd5('0x27')))),_0x6cd5('0x28')],[db[_0x6cd5('0x21')]['fn']('COUNT',db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0x6cd5('0x29')],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x2a'),db[_0x6cd5('0x21')]['fn']('IF',db['sequelize'][_0x6cd5('0x24')](_0x6cd5('0x2b')))),_0x6cd5('0x2c')],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x2a'),db['sequelize']['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')](_0x6cd5('0x2d')))),'predictiveIntervalAvgTalktime']]})[_0x6cd5('0xd')](function(_0x28d5c6){logger[_0x6cd5('0xe')]('AvgHandleTime',_0x234648);logger[_0x6cd5('0x11')](_0x6cd5('0x1f'),_0x234648,JSON[_0x6cd5('0x1d')](_0x28d5c6));_0x4e502a(_0x28d5c6);})[_0x6cd5('0x17')](function(_0x3a0435){logger[_0x6cd5('0x13')]('AvgHandleTime',_0x3a0435[_0x6cd5('0x15')],_0x234648);_0xba6cb9(_0x2feb60[_0x6cd5('0x13')](0x1f4,_0x3a0435[_0x6cd5('0x15')]));});});};exports[_0x6cd5('0x2e')]=function(_0x1bb7d0){var _0x3d5ff3=this;return new Promise(function(_0x57f709,_0x304015){return db['CmHopperHistory']['findAll']({'raw':_0x1bb7d0['options']?_0x1bb7d0[_0x6cd5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1bb7d0[_0x6cd5('0x1b')]?_0x1bb7d0[_0x6cd5('0x1b')]['where']||null:null,'attributes':[['campaign',_0x6cd5('0x2f')],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x22'),db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')](_0x6cd5('0x30')))),'outboundNoSuchCallsDay'],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x22'),db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')](_0x6cd5('0x31')))),_0x6cd5('0x32')],[db['sequelize']['fn']('COUNT',db[_0x6cd5('0x21')]['fn']('IF',db['sequelize']['literal'](_0x6cd5('0x25')))),'outboundAnswerCallsDay'],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x22'),db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')](_0x6cd5('0x33')))),'outboundBusyCallsDay'],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x22'),db['sequelize']['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')](_0x6cd5('0x34')))),_0x6cd5('0x35')],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x22'),db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x6cd5('0x36')],[db['sequelize']['fn'](_0x6cd5('0x22'),db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6cd5('0x37')],[db['sequelize']['fn'](_0x6cd5('0x22'),db['sequelize']['fn']('IF',db[_0x6cd5('0x21')]['literal'](_0x6cd5('0x38')))),_0x6cd5('0x39')],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x22'),db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')](_0x6cd5('0x3a')))),'outboundBlacklistCallsDay'],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x22'),db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')]('`state`\x20=\x2014,\x201,\x20null'))),_0x6cd5('0x3b')],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x22'),db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')](_0x6cd5('0x3c')))),'outboundRejectCallsDay'],[db[_0x6cd5('0x21')]['fn']('COUNT',db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')](_0x6cd5('0x3d')))),_0x6cd5('0x3e')],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x22'),db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')](_0x6cd5('0x3f')))),_0x6cd5('0x40')],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x22'),db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')][_0x6cd5('0x24')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':['campaign']})['then'](function(_0xa44dc4){logger[_0x6cd5('0xe')]('GetVoiceQueueHopperHistory',_0x1bb7d0);logger[_0x6cd5('0x11')](_0x6cd5('0x2e'),_0x1bb7d0,JSON[_0x6cd5('0x1d')](_0xa44dc4));_0x57f709(_0xa44dc4);})[_0x6cd5('0x17')](function(_0x271c9a){logger[_0x6cd5('0x13')](_0x6cd5('0x2e'),_0x271c9a[_0x6cd5('0x15')],_0x1bb7d0);_0x304015(_0x3d5ff3[_0x6cd5('0x13')](0x1f4,_0x271c9a[_0x6cd5('0x15')]));});});};exports[_0x6cd5('0x41')]=function(_0x45ffdf){var _0x4b66d9=this;return new Promise(function(_0x320b78,_0x27970f){return db['CmHopperHistory']['findAll']({'raw':_0x45ffdf[_0x6cd5('0x1b')]?_0x45ffdf[_0x6cd5('0x1b')][_0x6cd5('0x1c')]===undefined?!![]:![]:!![],'where':_0x45ffdf[_0x6cd5('0x1b')]?_0x45ffdf['options'][_0x6cd5('0x42')]||null:null,'attributes':[['campaign',_0x6cd5('0x2f')],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x22'),db[_0x6cd5('0x21')]['col']('id')),_0x6cd5('0x43')],[db[_0x6cd5('0x21')]['fn'](_0x6cd5('0x22'),db[_0x6cd5('0x21')]['fn']('IF',db[_0x6cd5('0x21')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x6cd5('0x44')]],'group':['campaign']})[_0x6cd5('0xd')](function(_0x52b120){logger[_0x6cd5('0xe')](_0x6cd5('0x41'),_0x45ffdf);logger['debug'](_0x6cd5('0x41'),_0x45ffdf,JSON[_0x6cd5('0x1d')](_0x52b120));_0x320b78(_0x52b120);})[_0x6cd5('0x17')](function(_0x2bdc13){logger[_0x6cd5('0x13')]('GetCampaignHopperHistory',_0x2bdc13[_0x6cd5('0x15')],_0x45ffdf);_0x27970f(_0x4b66d9[_0x6cd5('0x13')](0x1f4,_0x2bdc13[_0x6cd5('0x15')]));});});}; \ No newline at end of file +var _0x34b2=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`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','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x57a424,_0x4057be){var _0x361d1a=function(_0x452864){while(--_0x452864){_0x57a424['push'](_0x57a424['shift']());}};_0x361d1a(++_0x4057be);}(_0x34b2,0x11c));var _0x234b=function(_0x14f6db,_0x4d9f26){_0x14f6db=_0x14f6db-0x0;var _0x45344d=_0x34b2[_0x14f6db];return _0x45344d;};'use strict';var _=require(_0x234b('0x0'));var util=require(_0x234b('0x1'));var moment=require(_0x234b('0x2'));var BPromise=require(_0x234b('0x3'));var rs=require(_0x234b('0x4'));var fs=require('fs');var Redis=require(_0x234b('0x5'));var db=require(_0x234b('0x6'))['db'];var utils=require(_0x234b('0x7'));var logger=require(_0x234b('0x8'))(_0x234b('0x9'));var config=require(_0x234b('0xa'));var jayson=require(_0x234b('0xb'));var client=jayson[_0x234b('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52fac7,_0x5e71ac,_0x2eb07e){return new BPromise(function(_0x84f1f0,_0x153974){return client[_0x234b('0xd')](_0x52fac7,_0x2eb07e)['then'](function(_0x4f4899){logger[_0x234b('0xe')](_0x234b('0xf'),_0x5e71ac,_0x234b('0x10'));logger[_0x234b('0x11')](_0x234b('0x12'),_0x5e71ac,_0x234b('0x10'),JSON[_0x234b('0x13')](_0x4f4899));if(_0x4f4899[_0x234b('0x14')]){if(_0x4f4899[_0x234b('0x14')][_0x234b('0x15')]===0x1f4){logger[_0x234b('0x14')](_0x234b('0xf'),_0x5e71ac,_0x4f4899[_0x234b('0x14')]['message']);return _0x153974(_0x4f4899[_0x234b('0x14')][_0x234b('0x16')]);}logger['error'](_0x234b('0xf'),_0x5e71ac,_0x4f4899[_0x234b('0x14')]['message']);return _0x84f1f0(_0x4f4899[_0x234b('0x14')][_0x234b('0x16')]);}else{logger[_0x234b('0xe')](_0x234b('0xf'),_0x5e71ac,_0x234b('0x10'));_0x84f1f0(_0x4f4899[_0x234b('0x17')][_0x234b('0x16')]);}})[_0x234b('0x18')](function(_0x1fb3d8){logger['error'](_0x234b('0xf'),_0x5e71ac,_0x1fb3d8);_0x153974(_0x1fb3d8);});});}exports[_0x234b('0x19')]=function(_0x18153a){var _0x22696d=this;return new Promise(function(_0x4424a1,_0x530e4a){return db[_0x234b('0x1a')][_0x234b('0x1b')](_0x18153a[_0x234b('0x1c')],{'raw':_0x18153a[_0x234b('0x1d')]?_0x18153a['options'][_0x234b('0x1e')]===undefined?!![]:![]:!![]})[_0x234b('0x1f')](function(_0x2a47e1){logger[_0x234b('0xe')](_0x234b('0x19'),_0x18153a);logger['debug'](_0x234b('0x19'),_0x18153a,JSON[_0x234b('0x13')](_0x2a47e1));_0x4424a1(_0x2a47e1);})['catch'](function(_0x184e98){logger[_0x234b('0x14')](_0x234b('0x19'),_0x184e98[_0x234b('0x16')],_0x18153a);_0x530e4a(_0x22696d[_0x234b('0x14')](0x1f4,_0x184e98[_0x234b('0x16')]));});});};exports[_0x234b('0x20')]=function(_0x1b8ead){var _0x2d0f0c=this;return new Promise(function(_0x257453,_0x476fb7){return db['CmHopperHistory'][_0x234b('0x21')]({'raw':_0x1b8ead['options']?_0x1b8ead[_0x234b('0x1d')][_0x234b('0x1e')]===undefined?!![]:![]:!![],'where':_0x1b8ead[_0x234b('0x1d')]?_0x1b8ead[_0x234b('0x1d')][_0x234b('0x22')]||null:null,'attributes':[[db[_0x234b('0x23')]['fn'](_0x234b('0x24'),db['sequelize'][_0x234b('0x25')]('id')),_0x234b('0x26')],[db[_0x234b('0x23')]['fn'](_0x234b('0x24'),db[_0x234b('0x23')]['fn']('IF',db['sequelize'][_0x234b('0x27')]('`state`\x20=\x204,\x201,\x20null'))),_0x234b('0x28')],[db[_0x234b('0x23')]['fn'](_0x234b('0x24'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x234b('0x29')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x234b('0x23')]['fn'](_0x234b('0x24'),db[_0x234b('0x23')]['fn']('IF',db[_0x234b('0x23')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x234b('0x23')]['fn'](_0x234b('0x2a'),db[_0x234b('0x23')]['fn']('IF',db['sequelize'][_0x234b('0x27')](_0x234b('0x2b')))),_0x234b('0x2c')],[db[_0x234b('0x23')]['fn'](_0x234b('0x2a'),db[_0x234b('0x23')]['fn']('IF',db[_0x234b('0x23')][_0x234b('0x27')](_0x234b('0x2d')))),'predictiveIntervalAvgTalktime']]})[_0x234b('0x1f')](function(_0x454492){logger['info'](_0x234b('0x20'),_0x1b8ead);logger[_0x234b('0x11')]('AvgHandleTime',_0x1b8ead,JSON[_0x234b('0x13')](_0x454492));_0x257453(_0x454492);})[_0x234b('0x18')](function(_0x48170c){logger[_0x234b('0x14')](_0x234b('0x20'),_0x48170c[_0x234b('0x16')],_0x1b8ead);_0x476fb7(_0x2d0f0c['error'](0x1f4,_0x48170c[_0x234b('0x16')]));});});};exports[_0x234b('0x2e')]=function(_0x52cd1f){var _0xe4cef5=this;return new Promise(function(_0x47feec,_0x1509dc){return db['CmHopperHistory']['findAll']({'raw':_0x52cd1f['options']?_0x52cd1f[_0x234b('0x1d')][_0x234b('0x1e')]===undefined?!![]:![]:!![],'where':_0x52cd1f[_0x234b('0x1d')]?_0x52cd1f[_0x234b('0x1d')][_0x234b('0x22')]||null:null,'attributes':[[_0x234b('0x2f'),_0x234b('0x30')],[db[_0x234b('0x23')]['fn'](_0x234b('0x24'),db[_0x234b('0x23')]['fn']('IF',db['sequelize'][_0x234b('0x27')](_0x234b('0x31')))),_0x234b('0x32')],[db['sequelize']['fn'](_0x234b('0x24'),db['sequelize']['fn']('IF',db['sequelize'][_0x234b('0x27')](_0x234b('0x33')))),'outboundNoAnswerCallsDay'],[db[_0x234b('0x23')]['fn'](_0x234b('0x24'),db[_0x234b('0x23')]['fn']('IF',db[_0x234b('0x23')][_0x234b('0x27')](_0x234b('0x34')))),_0x234b('0x35')],[db[_0x234b('0x23')]['fn']('COUNT',db[_0x234b('0x23')]['fn']('IF',db[_0x234b('0x23')][_0x234b('0x27')](_0x234b('0x36')))),_0x234b('0x37')],[db[_0x234b('0x23')]['fn']('COUNT',db[_0x234b('0x23')]['fn']('IF',db[_0x234b('0x23')][_0x234b('0x27')](_0x234b('0x38')))),_0x234b('0x39')],[db[_0x234b('0x23')]['fn']('COUNT',db[_0x234b('0x23')]['fn']('IF',db['sequelize']['literal'](_0x234b('0x3a')))),_0x234b('0x3b')],[db[_0x234b('0x23')]['fn'](_0x234b('0x24'),db['sequelize']['fn']('IF',db['sequelize'][_0x234b('0x27')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x234b('0x3c')],[db[_0x234b('0x23')]['fn'](_0x234b('0x24'),db['sequelize']['fn']('IF',db[_0x234b('0x23')]['literal'](_0x234b('0x3d')))),_0x234b('0x3e')],[db[_0x234b('0x23')]['fn'](_0x234b('0x24'),db['sequelize']['fn']('IF',db[_0x234b('0x23')][_0x234b('0x27')](_0x234b('0x3f')))),_0x234b('0x40')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x234b('0x27')](_0x234b('0x41')))),_0x234b('0x42')],[db['sequelize']['fn']('COUNT',db[_0x234b('0x23')]['fn']('IF',db[_0x234b('0x23')][_0x234b('0x27')](_0x234b('0x43')))),_0x234b('0x44')],[db[_0x234b('0x23')]['fn'](_0x234b('0x24'),db[_0x234b('0x23')]['fn']('IF',db['sequelize'][_0x234b('0x27')]('`state`\x20=\x2016,\x201,\x20null'))),_0x234b('0x45')],[db[_0x234b('0x23')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x234b('0x23')][_0x234b('0x27')]('`state`\x20=\x2020,\x201,\x20null'))),_0x234b('0x44')],[db['sequelize']['fn'](_0x234b('0x24'),db[_0x234b('0x23')]['fn']('IF',db[_0x234b('0x23')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x234b('0x46')]],'group':[_0x234b('0x2f')]})['then'](function(_0x6560d1){logger['info']('GetVoiceQueueHopperHistory',_0x52cd1f);logger[_0x234b('0x11')](_0x234b('0x2e'),_0x52cd1f,JSON[_0x234b('0x13')](_0x6560d1));_0x47feec(_0x6560d1);})[_0x234b('0x18')](function(_0x5a0344){logger[_0x234b('0x14')]('GetVoiceQueueHopperHistory',_0x5a0344['message'],_0x52cd1f);_0x1509dc(_0xe4cef5[_0x234b('0x14')](0x1f4,_0x5a0344[_0x234b('0x16')]));});});};exports[_0x234b('0x47')]=function(_0x38dd1d){var _0x3d2072=this;return new Promise(function(_0x436c32,_0x4b9447){return db[_0x234b('0x1a')][_0x234b('0x21')]({'raw':_0x38dd1d[_0x234b('0x1d')]?_0x38dd1d[_0x234b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x38dd1d[_0x234b('0x1d')]?_0x38dd1d[_0x234b('0x1d')][_0x234b('0x22')]||null:null,'attributes':[['campaign',_0x234b('0x30')],[db[_0x234b('0x23')]['fn'](_0x234b('0x24'),db[_0x234b('0x23')][_0x234b('0x25')]('id')),_0x234b('0x48')],[db['sequelize']['fn'](_0x234b('0x24'),db[_0x234b('0x23')]['fn']('IF',db[_0x234b('0x23')][_0x234b('0x27')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0x234b('0x2f')]})[_0x234b('0x1f')](function(_0x4e4543){logger[_0x234b('0xe')]('GetCampaignHopperHistory',_0x38dd1d);logger['debug'](_0x234b('0x47'),_0x38dd1d,JSON['stringify'](_0x4e4543));_0x436c32(_0x4e4543);})[_0x234b('0x18')](function(_0x548fa3){logger[_0x234b('0x14')](_0x234b('0x47'),_0x548fa3[_0x234b('0x16')],_0x38dd1d);_0x4b9447(_0x3d2072[_0x234b('0x14')](0x1f4,_0x548fa3[_0x234b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 451ab80..4dcbd30 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 _0x115b=['isAuthenticated','create','put','/:id','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','/describe','describe','show','post'];(function(_0x51630f,_0x3d2e49){var _0x4ee621=function(_0x5da0d6){while(--_0x5da0d6){_0x51630f['push'](_0x51630f['shift']());}};_0x4ee621(++_0x3d2e49);}(_0x115b,0xba));var _0xb115=function(_0x2f5314,_0x57721f){_0x2f5314=_0x2f5314-0x0;var _0x3d3253=_0x115b[_0x2f5314];return _0x3d3253;};'use strict';var multer=require(_0xb115('0x0'));var util=require('util');var path=require(_0xb115('0x1'));var timeout=require(_0xb115('0x2'));var express=require(_0xb115('0x3'));var router=express[_0xb115('0x4')]();var fs_extra=require(_0xb115('0x5'));var auth=require(_0xb115('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router[_0xb115('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb115('0x7')](_0xb115('0x8'),auth['isAuthenticated'](),controller[_0xb115('0x9')]);router[_0xb115('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb115('0xa')]);router[_0xb115('0xb')]('/',auth[_0xb115('0xc')](),controller[_0xb115('0xd')]);router[_0xb115('0xe')](_0xb115('0xf'),auth[_0xb115('0xc')](),controller[_0xb115('0x10')]);module[_0xb115('0x11')]=router; \ No newline at end of file +var _0x5e11=['update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','create'];(function(_0x37034f,_0x6a71af){var _0x36b83e=function(_0x10c713){while(--_0x10c713){_0x37034f['push'](_0x37034f['shift']());}};_0x36b83e(++_0x6a71af);}(_0x5e11,0x167));var _0x15e1=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0x5e11[_0x5538d5];return _0x323b1a;};'use strict';var multer=require(_0x15e1('0x0'));var util=require(_0x15e1('0x1'));var path=require('path');var timeout=require(_0x15e1('0x2'));var express=require(_0x15e1('0x3'));var router=express[_0x15e1('0x4')]();var fs_extra=require(_0x15e1('0x5'));var auth=require(_0x15e1('0x6'));var interaction=require(_0x15e1('0x7'));var config=require(_0x15e1('0x8'));var controller=require(_0x15e1('0x9'));router[_0x15e1('0xa')]('/',auth[_0x15e1('0xb')](),controller['index']);router[_0x15e1('0xa')](_0x15e1('0xc'),auth[_0x15e1('0xb')](),controller[_0x15e1('0xd')]);router[_0x15e1('0xa')]('/:id',auth[_0x15e1('0xb')](),controller['show']);router['post']('/',auth[_0x15e1('0xb')](),controller[_0x15e1('0xe')]);router['put']('/:id',auth[_0x15e1('0xb')](),controller[_0x15e1('0xf')]);module[_0x15e1('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index f0d7717..9a52c78 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 _0xdb94=['STRING','exports'];(function(_0x163767,_0x53762c){var _0x5800d0=function(_0x3c8e0a){while(--_0x3c8e0a){_0x163767['push'](_0x163767['shift']());}};_0x5800d0(++_0x53762c);}(_0xdb94,0xe5));var _0x4db9=function(_0x4ca9e9,_0x52442d){_0x4ca9e9=_0x4ca9e9-0x0;var _0x2a947e=_0xdb94[_0x4ca9e9];return _0x2a947e;};'use strict';var Sequelize=require('sequelize');module[_0x4db9('0x0')]={'name':{'type':Sequelize[_0x4db9('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4db9('0x1')]},'dialPrefix':{'type':Sequelize[_0x4db9('0x1')]}}; \ No newline at end of file +var _0xeedf=['sequelize','exports','STRING'];(function(_0x5b2eac,_0x1675ca){var _0xdf3b4a=function(_0x45a698){while(--_0x45a698){_0x5b2eac['push'](_0x5b2eac['shift']());}};_0xdf3b4a(++_0x1675ca);}(_0xeedf,0x12c));var _0xfeed=function(_0xb9d119,_0x20dd9f){_0xb9d119=_0xb9d119-0x0;var _0x125973=_0xeedf[_0xb9d119];return _0x125973;};'use strict';var Sequelize=require(_0xfeed('0x0'));module[_0xfeed('0x1')]={'name':{'type':Sequelize[_0xfeed('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfeed('0x2')]},'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 b153b0e..8732979 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 _0x76c1=['queryInterface','addColumn','getCustomFields','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','message','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./cmList.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','Lists','UserProfileResource','sendStatus','error','stack','name','send','index','CmList','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','Disposition','getDispositions','findOne','length','pick','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','omit','success','dataValues','push','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','getContactsCsv','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','each','isEmpty','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN'];(function(_0x46e418,_0x5c4d24){var _0x5e1be5=function(_0x170bd4){while(--_0x170bd4){_0x46e418['push'](_0x46e418['shift']());}};_0x5e1be5(++_0x5c4d24);}(_0x76c1,0x15b));var _0x176c=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0x76c1[_0x576d8a];return _0x3dc3ef;};'use strict';var emlformat=require(_0x176c('0x0'));var rimraf=require(_0x176c('0x1'));var zipdir=require(_0x176c('0x2'));var jsonpatch=require(_0x176c('0x3'));var rp=require(_0x176c('0x4'));var moment=require(_0x176c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x176c('0x6'));var path=require(_0x176c('0x7'));var sox=require(_0x176c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x176c('0x9'));var _=require(_0x176c('0xa'));var squel=require('squel');var crypto=require(_0x176c('0xb'));var jsforce=require(_0x176c('0xc'));var deskjs=require(_0x176c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x176c('0xe'));var Redis=require(_0x176c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x176c('0x10'));var as=require(_0x176c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x176c('0x12'))(_0x176c('0x13'));var utils=require(_0x176c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x176c('0x15'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x176c('0x16')]=_[_0x176c('0x17')](config['redis'],{'host':_0x176c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x176c('0x16')]));require(_0x176c('0x19'))[_0x176c('0x1a')](socket);function respondWithStatusCode(_0x701920,_0x5bf5ca){_0x5bf5ca=_0x5bf5ca||0xcc;return function(_0x1b9f08){if(_0x1b9f08){return _0x701920['sendStatus'](_0x5bf5ca);}return _0x701920[_0x176c('0x1b')](_0x5bf5ca)[_0x176c('0x1c')]();};}function respondWithResult(_0x27693f,_0x62000e){_0x62000e=_0x62000e||0xc8;return function(_0x2a7f32){if(_0x2a7f32){return _0x27693f[_0x176c('0x1b')](_0x62000e)[_0x176c('0x1d')](_0x2a7f32);}};}function respondWithFilteredResult(_0x4cbad3,_0x1ab71f){return function(_0x2b33c3){if(_0x2b33c3){var _0x4301fc=typeof _0x1ab71f['offset']===_0x176c('0x1e')&&typeof _0x1ab71f[_0x176c('0x1f')]==='undefined';var _0x5cd3c5=_0x2b33c3[_0x176c('0x20')];var _0x20f856=_0x4301fc?0x0:_0x1ab71f[_0x176c('0x21')];var _0x16b1c0=_0x4301fc?_0x2b33c3['count']:_0x1ab71f[_0x176c('0x21')]+_0x1ab71f[_0x176c('0x1f')];var _0xd9b48d;if(_0x16b1c0>=_0x5cd3c5){_0x16b1c0=_0x5cd3c5;_0xd9b48d=0xc8;}else{_0xd9b48d=0xce;}_0x4cbad3[_0x176c('0x1b')](_0xd9b48d);return _0x4cbad3[_0x176c('0x22')](_0x176c('0x23'),_0x20f856+'-'+_0x16b1c0+'/'+_0x5cd3c5)[_0x176c('0x1d')](_0x2b33c3);}return null;};}function patchUpdates(_0x1c83a0){return function(_0x2fee46){try{jsonpatch[_0x176c('0x24')](_0x2fee46,_0x1c83a0,!![]);}catch(_0x15e442){return BPromise[_0x176c('0x25')](_0x15e442);}return _0x2fee46[_0x176c('0x26')]();};}function saveUpdates(_0x2b8f1a,_0x54038f){return function(_0x2b8724){if(_0x2b8724){return _0x2b8724[_0x176c('0x27')](_0x2b8f1a)[_0x176c('0x28')](function(_0x1e9815){return _0x1e9815;});}return null;};}function removeEntity(_0x49e882,_0x5b8b92){return function(_0x5956b2){if(_0x5956b2){return _0x5956b2[_0x176c('0x29')]()[_0x176c('0x28')](function(){var _0x482bb8=_0x5956b2['get']({'plain':!![]});var _0x162f26=_0x176c('0x2a');return db[_0x176c('0x2b')][_0x176c('0x29')]({'where':{'type':_0x162f26,'resourceId':_0x482bb8['id']}})['then'](function(){return _0x5956b2;});})[_0x176c('0x28')](function(){_0x49e882[_0x176c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16e3ee,_0x1132f5){return function(_0x51df1e){if(!_0x51df1e){_0x16e3ee[_0x176c('0x2c')](0x194);}return _0x51df1e;};}function handleError(_0x4eb170,_0x347512){_0x347512=_0x347512||0x1f4;return function(_0x362261){logger[_0x176c('0x2d')](_0x362261[_0x176c('0x2e')]);if(_0x362261[_0x176c('0x2f')]){delete _0x362261[_0x176c('0x2f')];}_0x4eb170[_0x176c('0x1b')](_0x347512)[_0x176c('0x30')](_0x362261);};}exports[_0x176c('0x31')]=function(_0x465052,_0x5e2fa3){var _0xecc3cb={},_0x1a547c={},_0x58b16d={'count':0x0,'rows':[]};var _0x357820=_['map'](db[_0x176c('0x32')]['rawAttributes'],function(_0x451231){return{'name':_0x451231['fieldName'],'type':_0x451231[_0x176c('0x33')][_0x176c('0x34')]};});_0x1a547c[_0x176c('0x35')]=_[_0x176c('0x36')](_0x357820,_0x176c('0x2f'));_0x1a547c[_0x176c('0x37')]=_[_0x176c('0x38')](_0x465052[_0x176c('0x37')]);_0x1a547c[_0x176c('0x39')]=_[_0x176c('0x3a')](_0x1a547c['model'],_0x1a547c['query']);_0xecc3cb['attributes']=_['intersection'](_0x1a547c['model'],qs[_0x176c('0x3b')](_0x465052[_0x176c('0x37')][_0x176c('0x3b')]));_0xecc3cb[_0x176c('0x3c')]=_0xecc3cb[_0x176c('0x3c')]['length']?_0xecc3cb[_0x176c('0x3c')]:_0x1a547c[_0x176c('0x35')];if(!_0x465052[_0x176c('0x37')][_0x176c('0x3d')](_0x176c('0x3e'))){_0xecc3cb['limit']=qs[_0x176c('0x1f')](_0x465052[_0x176c('0x37')][_0x176c('0x1f')]);_0xecc3cb[_0x176c('0x21')]=qs['offset'](_0x465052[_0x176c('0x37')][_0x176c('0x21')]);}_0xecc3cb[_0x176c('0x3f')]=qs[_0x176c('0x40')](_0x465052[_0x176c('0x37')][_0x176c('0x40')]);_0xecc3cb[_0x176c('0x41')]=qs[_0x176c('0x39')](_['pick'](_0x465052[_0x176c('0x37')],_0x1a547c['filters']),_0x357820);if(_0x465052[_0x176c('0x37')][_0x176c('0x42')]){_0xecc3cb[_0x176c('0x41')]=_[_0x176c('0x43')](_0xecc3cb[_0x176c('0x41')],{'$or':_[_0x176c('0x36')](_0x357820,function(_0x49c19f){if(_0x49c19f[_0x176c('0x33')]!==_0x176c('0x44')){var _0x5298b5={};_0x5298b5[_0x49c19f['name']]={'$like':'%'+_0x465052[_0x176c('0x37')][_0x176c('0x42')]+'%'};return _0x5298b5;}})});}_0xecc3cb=_[_0x176c('0x43')]({},_0xecc3cb,_0x465052[_0x176c('0x45')]);var _0xa9fca4={'where':_0xecc3cb['where']};return db[_0x176c('0x32')]['count'](_0xa9fca4)['then'](function(_0x26f489){_0x58b16d[_0x176c('0x20')]=_0x26f489;if(_0x465052[_0x176c('0x37')][_0x176c('0x46')]){_0xecc3cb['include']=[{'all':!![]}];}return db[_0x176c('0x32')][_0x176c('0x47')](_0xecc3cb);})['then'](function(_0x22698c){_0x58b16d[_0x176c('0x48')]=_0x22698c;return _0x58b16d;})[_0x176c('0x28')](respondWithFilteredResult(_0x5e2fa3,_0xecc3cb))['catch'](handleError(_0x5e2fa3,null));};exports[_0x176c('0x49')]=function(_0x28e385,_0x101a9f){var _0x5d966a={'raw':![],'where':{'id':_0x28e385[_0x176c('0x4a')]['id']}},_0x490086={};_0x490086[_0x176c('0x35')]=_[_0x176c('0x38')](db[_0x176c('0x32')][_0x176c('0x4b')]);_0x490086[_0x176c('0x37')]=_[_0x176c('0x38')](_0x28e385[_0x176c('0x37')]);_0x490086[_0x176c('0x39')]=_['intersection'](_0x490086[_0x176c('0x35')],_0x490086['query']);_0x5d966a[_0x176c('0x3c')]=_[_0x176c('0x3a')](_0x490086[_0x176c('0x35')],qs[_0x176c('0x3b')](_0x28e385[_0x176c('0x37')][_0x176c('0x3b')]));_0x5d966a[_0x176c('0x3c')]=_0x5d966a[_0x176c('0x3c')]['length']?_0x5d966a[_0x176c('0x3c')]:_0x490086[_0x176c('0x35')];if(_0x28e385[_0x176c('0x37')][_0x176c('0x46')]){_0x5d966a[_0x176c('0x4c')]=[{'all':!![]}];}_0x5d966a=_[_0x176c('0x43')]({},_0x5d966a,_0x28e385[_0x176c('0x45')]);return db[_0x176c('0x32')][_0x176c('0x4d')](_0x5d966a)['then'](handleEntityNotFound(_0x101a9f,null))['then'](respondWithResult(_0x101a9f,null))[_0x176c('0x4e')](handleError(_0x101a9f,null));};exports[_0x176c('0x4f')]=function(_0x21b909,_0x45e692){return db['CmList'][_0x176c('0x4f')](_0x21b909['body'],{})[_0x176c('0x28')](function(_0x41b690){var _0x24a518=_0x21b909[_0x176c('0x50')][_0x176c('0x51')]({'plain':!![]});if(!_0x24a518)throw new Error(_0x176c('0x52'));if(_0x24a518[_0x176c('0x53')]===_0x176c('0x50')){var _0x424533=_0x41b690[_0x176c('0x51')]({'plain':!![]});var _0x1992ab='Lists';return db[_0x176c('0x54')]['find']({'where':{'name':_0x1992ab,'userProfileId':_0x24a518[_0x176c('0x55')]},'raw':!![]})[_0x176c('0x28')](function(_0x52cc40){if(_0x52cc40&&_0x52cc40['autoAssociation']===0x0){return db[_0x176c('0x2b')]['create']({'name':_0x424533[_0x176c('0x2f')],'resourceId':_0x424533['id'],'type':_0x52cc40[_0x176c('0x2f')],'sectionId':_0x52cc40['id']},{})[_0x176c('0x28')](function(){return _0x41b690;});}else{return _0x41b690;}})[_0x176c('0x4e')](function(_0x2e489f){logger[_0x176c('0x2d')](_0x176c('0x56'),_0x2e489f);throw _0x2e489f;});}return _0x41b690;})[_0x176c('0x28')](respondWithResult(_0x45e692,0xc9))[_0x176c('0x4e')](handleError(_0x45e692,null));};exports['update']=function(_0xf1ab1d,_0x23eedf){if(_0xf1ab1d['body']['id']){delete _0xf1ab1d[_0x176c('0x57')]['id'];}return db[_0x176c('0x32')]['find']({'where':{'id':_0xf1ab1d['params']['id']}})[_0x176c('0x28')](handleEntityNotFound(_0x23eedf,null))[_0x176c('0x28')](saveUpdates(_0xf1ab1d[_0x176c('0x57')],null))[_0x176c('0x28')](respondWithResult(_0x23eedf,null))['catch'](handleError(_0x23eedf,null));};exports[_0x176c('0x29')]=function(_0x27d037,_0x217fda){return db['CmList']['find']({'where':{'id':_0x27d037['params']['id']}})['then'](handleEntityNotFound(_0x217fda,null))[_0x176c('0x28')](removeEntity(_0x217fda,null))[_0x176c('0x4e')](handleError(_0x217fda,null));};exports[_0x176c('0x58')]=function(_0x245032,_0x13b526){return db[_0x176c('0x32')]['describe']()['then'](respondWithResult(_0x13b526,null))['catch'](handleError(_0x13b526,null));};exports[_0x176c('0x59')]=function(_0x4b868b,_0x39a821,_0x24a2e7){if(_0x4b868b['body']['id']){delete _0x4b868b[_0x176c('0x57')]['id'];}return db[_0x176c('0x32')][_0x176c('0x4d')]({'where':{'id':_0x4b868b[_0x176c('0x4a')]['id']}})[_0x176c('0x28')](handleEntityNotFound(_0x39a821,null))[_0x176c('0x28')](function(_0x78fa08){if(_0x78fa08){_0x4b868b[_0x176c('0x57')][_0x176c('0x5a')]=_0x78fa08['id'];return db[_0x176c('0x5b')][_0x176c('0x4f')](_0x4b868b[_0x176c('0x57')]);}})[_0x176c('0x28')](respondWithResult(_0x39a821,null))[_0x176c('0x4e')](handleError(_0x39a821,null));};exports[_0x176c('0x5c')]=function(_0x2247bb,_0x26bd26,_0x165a45){var _0x44ec11={'raw':![],'where':{}};var _0x4df801={};var _0x1949e1={'count':0x0,'rows':[]};return db[_0x176c('0x32')][_0x176c('0x5d')]({'where':{'id':_0x2247bb[_0x176c('0x4a')]['id']}})[_0x176c('0x28')](handleEntityNotFound(_0x26bd26,null))[_0x176c('0x28')](function(_0x16bbe2){if(_0x16bbe2){_0x4df801[_0x176c('0x35')]=_[_0x176c('0x38')](db[_0x176c('0x5b')][_0x176c('0x4b')]);_0x4df801[_0x176c('0x37')]=_[_0x176c('0x38')](_0x2247bb[_0x176c('0x37')]);_0x4df801['filters']=_[_0x176c('0x3a')](_0x4df801[_0x176c('0x35')],_0x4df801[_0x176c('0x37')]);_0x44ec11['attributes']=_[_0x176c('0x3a')](_0x4df801['model'],qs[_0x176c('0x3b')](_0x2247bb[_0x176c('0x37')]['fields']));_0x44ec11[_0x176c('0x3c')]=_0x44ec11[_0x176c('0x3c')][_0x176c('0x5e')]?_0x44ec11[_0x176c('0x3c')]:_0x4df801[_0x176c('0x35')];if(!_0x2247bb[_0x176c('0x37')][_0x176c('0x3d')](_0x176c('0x3e'))){_0x44ec11[_0x176c('0x1f')]=qs['limit'](_0x2247bb[_0x176c('0x37')][_0x176c('0x1f')]);_0x44ec11[_0x176c('0x21')]=qs[_0x176c('0x21')](_0x2247bb[_0x176c('0x37')][_0x176c('0x21')]);}_0x44ec11['order']=qs[_0x176c('0x40')](_0x2247bb[_0x176c('0x37')][_0x176c('0x40')]);_0x44ec11['where']=qs['filters'](_[_0x176c('0x5f')](_0x2247bb[_0x176c('0x37')],_0x4df801[_0x176c('0x39')]));_0x44ec11[_0x176c('0x41')][_0x176c('0x5a')]=_0x16bbe2['id'];if(_0x2247bb[_0x176c('0x37')]['filter']){_0x44ec11[_0x176c('0x41')]=_[_0x176c('0x43')](_0x44ec11['where'],{'$or':_[_0x176c('0x36')](_0x44ec11[_0x176c('0x3c')],function(_0x455b8d){var _0xec1386={};_0xec1386[_0x455b8d]={'$like':'%'+_0x2247bb['query'][_0x176c('0x42')]+'%'};return _0xec1386;})});}_0x44ec11=_['merge']({},_0x44ec11,_0x2247bb['options']);return db[_0x176c('0x5b')][_0x176c('0x20')]({'where':_0x44ec11[_0x176c('0x41')]})[_0x176c('0x28')](function(_0x1a1194){_0x1949e1[_0x176c('0x20')]=_0x1a1194;if(_0x2247bb[_0x176c('0x37')][_0x176c('0x46')]){_0x44ec11[_0x176c('0x4c')]=[{'all':!![]}];}return db[_0x176c('0x5b')][_0x176c('0x47')](_0x44ec11);})['then'](function(_0x2783de){_0x1949e1[_0x176c('0x48')]=_0x2783de;return _0x1949e1;});}})[_0x176c('0x28')](respondWithFilteredResult(_0x26bd26,_0x44ec11))[_0x176c('0x4e')](handleError(_0x26bd26,null));};exports['removeDispositions']=function(_0x207206,_0x490cf8,_0x26594e){return db['CmList']['find']({'where':{'id':_0x207206[_0x176c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x490cf8,null))[_0x176c('0x28')](function(_0x55bfd4){if(_0x55bfd4){return _0x55bfd4[_0x176c('0x60')](_0x207206[_0x176c('0x37')][_0x176c('0x61')]);}})[_0x176c('0x28')](respondWithStatusCode(_0x490cf8,null))[_0x176c('0x4e')](handleError(_0x490cf8,null));};exports[_0x176c('0x62')]=function(_0x115850,_0x6ef15c,_0x494375){return db['CmList'][_0x176c('0x4d')]({'where':{'id':_0x115850[_0x176c('0x4a')]['id']}})[_0x176c('0x28')](handleEntityNotFound(_0x6ef15c,null))['then'](function(_0x987f75){if(_0x987f75){var _0x32fdff=[];var _0x11c8e2={'success':[],'errors':[]};return db[_0x176c('0x63')][_0x176c('0x58')]()[_0x176c('0x28')](function(_0x2161de){if(_0x115850[_0x176c('0x57')]['tags']&&_['isArray'](_0x115850[_0x176c('0x57')][_0x176c('0x64')])){if(_0x115850[_0x176c('0x57')][_0x176c('0x64')][_0x176c('0x5e')]){_0x115850[_0x176c('0x57')][_0x176c('0x64')]=_0x115850[_0x176c('0x57')][_0x176c('0x64')][_0x176c('0x65')](';')+';';}else{_0x115850[_0x176c('0x57')][_0x176c('0x64')]=null;}}else{_0x115850['body'][_0x176c('0x64')]=null;}if(_0x115850[_0x176c('0x57')]&&_[_0x176c('0x66')](_0x115850[_0x176c('0x57')])){for(var _0x41ce6f=0x0;_0x41ce6f<_0x115850['body']['length'];_0x41ce6f+=0x1){_0x115850[_0x176c('0x57')][_0x41ce6f][_0x176c('0x5a')]=_0x115850[_0x176c('0x4a')]['id'];_0x32fdff['push'](_0x115850[_0x176c('0x57')][_0x41ce6f]);}return BPromise['each'](_0x32fdff,function(_0x2c3857){return db[_0x176c('0x63')][_0x176c('0x4f')](_[_0x176c('0x67')](_0x2c3857,[_0x176c('0x61'),'id'])||{},{'fields':_[_0x176c('0x38')](_0x2161de),'raw':!![]})[_0x176c('0x28')](function(_0x212194){_0x11c8e2[_0x176c('0x68')]['push'](_0x212194[_0x176c('0x69')]);})[_0x176c('0x4e')](function(_0x288050){_0x11c8e2['errors'][_0x176c('0x6a')]({'data':_0x2c3857,'error':_0x288050['message']});});})[_0x176c('0x28')](function(_0xc6779d){return _0x11c8e2;})[_0x176c('0x4e')](function(_0x1fea6a){return _0x1fea6a;});}else{_0x6ef15c[_0x176c('0x1b')](0x190)[_0x176c('0x1d')]({'message':_0x176c('0x6b')});}});}})[_0x176c('0x28')](respondWithResult(_0x6ef15c,null))['catch'](handleError(_0x6ef15c,null));};exports[_0x176c('0x6c')]=function(_0x18e0f7,_0x10f3d8,_0x1df7c7){var _0x22bb4b;return db['CmList'][_0x176c('0x4d')]({'where':{'id':_0x18e0f7[_0x176c('0x4a')]['id']},'include':[{'model':db[_0x176c('0x6d')],'as':'CustomFields'}]})[_0x176c('0x28')](handleEntityNotFound(_0x10f3d8,null))[_0x176c('0x28')](function(_0x5be476){if(_0x5be476){_0x22bb4b=_0x5be476;return db[_0x176c('0x63')][_0x176c('0x4b')];}})[_0x176c('0x28')](function(_0x4f76bf){if(_0x4f76bf){var _0x215ce8={};var _0x1b285e={};_0x1b285e['model']=_[_0x176c('0x6e')](_[_0x176c('0x38')](_0x4f76bf),_[_0x176c('0x36')](_0x22bb4b[_0x176c('0x6f')],function(_0x5b88a7){return util[_0x176c('0x70')](_0x176c('0x71'),_0x5b88a7['id']);}));_0x1b285e[_0x176c('0x37')]=_[_0x176c('0x38')](_0x18e0f7[_0x176c('0x37')]);_0x1b285e[_0x176c('0x39')]=_[_0x176c('0x3a')](_0x1b285e['model'],_0x1b285e[_0x176c('0x37')]);_0x215ce8[_0x176c('0x3c')]=_[_0x176c('0x3a')](_0x1b285e[_0x176c('0x35')],qs['fields'](_0x18e0f7[_0x176c('0x37')][_0x176c('0x3b')]));_0x215ce8[_0x176c('0x3c')]=_0x215ce8[_0x176c('0x3c')][_0x176c('0x5e')]?_0x215ce8['attributes']:_0x1b285e['model'];if(!_0x18e0f7['query'][_0x176c('0x3d')](_0x176c('0x3e'))){_0x215ce8[_0x176c('0x1f')]=qs[_0x176c('0x1f')](_0x18e0f7[_0x176c('0x37')][_0x176c('0x1f')]);_0x215ce8['offset']=qs[_0x176c('0x21')](_0x18e0f7[_0x176c('0x37')][_0x176c('0x21')]);}_0x215ce8[_0x176c('0x3f')]=qs[_0x176c('0x40')](_0x18e0f7[_0x176c('0x37')][_0x176c('0x40')]);_0x215ce8[_0x176c('0x41')]=qs[_0x176c('0x39')](_['pick'](_0x18e0f7[_0x176c('0x37')],_0x1b285e[_0x176c('0x39')]));_0x215ce8['raw']=!![];if(_0x18e0f7[_0x176c('0x37')][_0x176c('0x42')]){_0x215ce8['where']=_[_0x176c('0x43')](_0x215ce8[_0x176c('0x41')],{'$or':_[_0x176c('0x36')](_0x215ce8[_0x176c('0x3c')],function(_0x1942db){var _0x4e2cb5={};_0x4e2cb5[_0x1942db]={'$like':'%'+_0x18e0f7[_0x176c('0x37')][_0x176c('0x42')]+'%'};return _0x4e2cb5;})});}_0x215ce8=_[_0x176c('0x43')]({},_0x215ce8,_0x18e0f7['options']);return _0x22bb4b[_0x176c('0x6c')](_0x215ce8);}})[_0x176c('0x28')](respondWithResult(_0x10f3d8,null))[_0x176c('0x4e')](handleError(_0x10f3d8,null));};exports[_0x176c('0x72')]=function(_0x1010cb,_0x1e329c,_0x267c0b){var _0x335645;var _0x5b0f34;var _0x5a9db0;var _0x31ba97=_0x1010cb[_0x176c('0x4a')]['id'];csv_results=[];return db[_0x176c('0x73')][_0x176c('0x47')]({'attributes':['id','name'],'raw':!![],'order':[_0x176c('0x74')]})[_0x176c('0x28')](function(_0x35bfee){_0x335645=_0x35bfee;var _0x589e09=_[_0x176c('0x38')](db[_0x176c('0x63')]['rawAttributes']);return db[_0x176c('0x6d')][_0x176c('0x47')]({'raw':!![],'attributes':['id',_0x176c('0x75')]})['then'](function(_0x4d3bd1){_0x5b0f34=_0x4d3bd1;var _0x346144=squel[_0x176c('0x76')]()[_0x176c('0x3b')](_0x589e09)[_0x176c('0x77')](_0x176c('0x78'),'c')[_0x176c('0x41')](_0x176c('0x79'),_0x31ba97)['where']('c.deletedAt\x20is\x20null')[_0x176c('0x7a')]();for(var _0x249c5c=0x0;_0x249c5c<_0x5b0f34[_0x176c('0x5e')];_0x249c5c++){_0x346144[_0x176c('0x7b')](_0x176c('0x7c')+_0x5b0f34[_0x249c5c]['id'],_0x176c('0x7d')+_0x5b0f34[_0x249c5c][_0x176c('0x75')]);}for(var _0x249c5c=0x0;_0x249c5c<_0x335645[_0x176c('0x5e')];_0x249c5c++){_0x346144[_0x176c('0x7b')](squel[_0x176c('0x76')]()['field'](_0x176c('0x7e'))[_0x176c('0x77')](_0x176c('0x7f'))[_0x176c('0x41')](_0x176c('0x80'),_0x335645[_0x249c5c]['id'])[_0x176c('0x41')](_0x176c('0x81')),_0x176c('0x82')+_0x335645[_0x249c5c][_0x176c('0x2f')]);_0x346144[_0x176c('0x7b')](squel[_0x176c('0x76')]()[_0x176c('0x7b')](_0x176c('0x83'))[_0x176c('0x77')]('cm_contact_has_items')['where'](_0x176c('0x80'),_0x335645[_0x249c5c]['id'])[_0x176c('0x41')](_0x176c('0x81')),_0x176c('0x84')+_0x335645[_0x249c5c][_0x176c('0x2f')]);}var _0xca83cd=[];_0xca83cd[_0x176c('0x6a')](_0x346144[_0x176c('0x85')]());BPromise[_0x176c('0x86')](_0xca83cd,handleQuery)[_0x176c('0x28')](function(_0x5cf33c){handleQuery(_0x346144[_0x176c('0x85')]());var _0xbed520=csv_results[0x0];if(!_[_0x176c('0x87')](_0xbed520)){var _0x371d54=toCsv(_0xbed520);var _0x19f84f=Date['now']();fs['writeFileSync'](util[_0x176c('0x70')](_0x176c('0x88'),_0x31ba97,_0x19f84f),_0x371d54);_0x1e329c[_0x176c('0x89')](_0x176c('0x8a'),_0x176c('0x8b')+util['format'](_0x176c('0x8c'),_0x31ba97,_0x19f84f));_0x1e329c[_0x176c('0x89')](_0x176c('0x8d'),_0x176c('0x8e'));return _0x1e329c[_0x176c('0x8f')](util[_0x176c('0x70')](_0x176c('0x88'),_0x31ba97,_0x19f84f));}else{return _0x1e329c[_0x176c('0x2c')](0xcc);}});});});};exports['addCustomField']=function(_0x12059f,_0x3aedb9,_0x1abd59){var _0x1ad4a3;delete _0x12059f['body']['id'];return db[_0x176c('0x32')]['findOne']({'where':{'id':_0x12059f[_0x176c('0x4a')]['id']}})[_0x176c('0x28')](handleEntityNotFound(_0x3aedb9,null))[_0x176c('0x28')](function(_0x22418a){if(_0x22418a){return db[_0x176c('0x90')][_0x176c('0x91')](function(_0x5449bc){return db['CmCustomField'][_0x176c('0x4f')](_0x12059f[_0x176c('0x57')],{'transaction':_0x5449bc})['then'](function(_0x20a4c1){_0x1ad4a3=_0x20a4c1;return _0x22418a[_0x176c('0x92')](_0x20a4c1,{'transaction':_0x5449bc});})['then'](function(){var _0x45be4d={'type':db[_0x176c('0x93')][_0x176c('0x94')],'transaction':_0x5449bc};switch(_0x12059f['body'][_0x176c('0x33')]){case _0x176c('0x95'):_0x45be4d['type']=db['Sequelize'][_0x176c('0x94')];break;case _0x176c('0x96'):_0x45be4d[_0x176c('0x33')]=db['Sequelize'][_0x176c('0x97')];break;case _0x176c('0x98'):_0x45be4d[_0x176c('0x33')]=db[_0x176c('0x93')][_0x176c('0x99')];_0x45be4d['defaultValue']=![];break;default:}return db[_0x176c('0x90')][_0x176c('0x9a')][_0x176c('0x9b')](_0x176c('0x78'),util[_0x176c('0x70')]('cf_%s',_0x1ad4a3['id']),_0x45be4d);})['then'](function(){return _0x1ad4a3;});});}})[_0x176c('0x28')](respondWithResult(_0x3aedb9,null))[_0x176c('0x4e')](handleError(_0x3aedb9,null));};exports[_0x176c('0x9c')]=function(_0xedba98,_0x264717,_0x41c87b){var _0x47d429={};var _0x31eedd={};var _0x1ddaa0;var _0x547273;return db[_0x176c('0x32')][_0x176c('0x5d')]({'where':{'id':_0xedba98['params']['id']}})[_0x176c('0x28')](handleEntityNotFound(_0x264717,null))[_0x176c('0x28')](function(_0x1a2710){if(_0x1a2710){_0x1ddaa0=_0x1a2710;_0x31eedd[_0x176c('0x35')]=_['keys'](db[_0x176c('0x6d')][_0x176c('0x4b')]);_0x31eedd[_0x176c('0x37')]=_['keys'](_0xedba98['query']);_0x31eedd[_0x176c('0x39')]=_[_0x176c('0x3a')](_0x31eedd[_0x176c('0x35')],_0x31eedd[_0x176c('0x37')]);_0x47d429[_0x176c('0x3c')]=_[_0x176c('0x3a')](_0x31eedd[_0x176c('0x35')],qs[_0x176c('0x3b')](_0xedba98[_0x176c('0x37')][_0x176c('0x3b')]));_0x47d429['attributes']=_0x47d429[_0x176c('0x3c')]['length']?_0x47d429[_0x176c('0x3c')]:_0x31eedd[_0x176c('0x35')];_0x47d429[_0x176c('0x3f')]=qs['sort'](_0xedba98['query']['sort']);_0x47d429[_0x176c('0x41')]=qs[_0x176c('0x39')](_[_0x176c('0x5f')](_0xedba98[_0x176c('0x37')],_0x31eedd[_0x176c('0x39')]));_0x47d429['where']=_['merge'](_0x47d429[_0x176c('0x41')],{'$or':[{'ListId':_0x1a2710['id']},{'ListId':null}]});if(_0xedba98[_0x176c('0x37')]['filter']){_0x47d429['where']=_['merge'](_0x47d429[_0x176c('0x41')],{'$or':_[_0x176c('0x36')](_0x47d429['attributes'],function(_0x464d70){var _0x32e0a5={};_0x32e0a5[_0x464d70]={'$like':'%'+_0xedba98[_0x176c('0x37')][_0x176c('0x42')]+'%'};return _0x32e0a5;})});}_0x47d429=_[_0x176c('0x43')]({},_0x47d429,_0xedba98[_0x176c('0x45')]);return db[_0x176c('0x6d')][_0x176c('0x9d')](_0x47d429);}})[_0x176c('0x28')](respondWithResult(_0x264717,null))['catch'](handleError(_0x264717,null));};exports['getGlobalCustomFields']=function(_0x1359af,_0x3082df){return db[_0x176c('0x6d')]['findAndCountAll']({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x3082df,null))[_0x176c('0x28')](function(_0x19b2cd){return _0x19b2cd;})[_0x176c('0x28')](respondWithResult(_0x3082df,null))[_0x176c('0x4e')](handleError(_0x3082df,null));};exports[_0x176c('0x9e')]=function(_0x5b5f29,_0x393ca2,_0x20c529){return db[_0x176c('0x32')][_0x176c('0x4d')]({'where':{'id':_0x5b5f29['params']['id']}})['then'](handleEntityNotFound(_0x393ca2,null))[_0x176c('0x28')](function(_0x297601){if(_0x297601){return _0x297601['addAgents'](_0x5b5f29[_0x176c('0x57')][_0x176c('0x61')],_[_0x176c('0x67')](_0x5b5f29[_0x176c('0x57')],[_0x176c('0x61'),'id'])||{})['spread'](function(_0x1e2423){for(var _0x1922b8=0x0;_0x1922b8<_0x5b5f29[_0x176c('0x57')][_0x176c('0x61')][_0x176c('0x5e')];_0x1922b8+=0x1){socket[_0x176c('0x9f')](_0x176c('0xa0'),{'UserId':Number(_0x5b5f29[_0x176c('0x57')][_0x176c('0x61')][_0x1922b8]),'CmListId':Number(_0x5b5f29[_0x176c('0x4a')]['id'])});}return _0x1e2423;});}})[_0x176c('0x28')](respondWithResult(_0x393ca2,null))[_0x176c('0x4e')](handleError(_0x393ca2,null));};exports[_0x176c('0xa1')]=function(_0xd9debd,_0xf1f0e6,_0x10a130){return db['CmList'][_0x176c('0x4d')]({'where':{'id':_0xd9debd[_0x176c('0x4a')]['id']}})[_0x176c('0x28')](handleEntityNotFound(_0xf1f0e6,null))['then'](function(_0x55faa8){if(_0x55faa8){return _0x55faa8[_0x176c('0xa1')](_0xd9debd[_0x176c('0x37')][_0x176c('0x61')])[_0x176c('0x28')](function(){if(_[_0x176c('0x66')](_0xd9debd[_0x176c('0x37')][_0x176c('0x61')])){for(var _0x46f16b=0x0;_0x46f16b<_0xd9debd[_0x176c('0x37')][_0x176c('0x61')][_0x176c('0x5e')];_0x46f16b+=0x1){socket[_0x176c('0x9f')](_0x176c('0xa2'),{'UserId':Number(_0xd9debd[_0x176c('0x37')]['ids'][_0x46f16b]),'CmListId':Number(_0xd9debd['params']['id'])});}}else{socket['emit'](_0x176c('0xa2'),{'UserId':Number(_0xd9debd[_0x176c('0x37')][_0x176c('0x61')]),'CmListId':Number(_0xd9debd['params']['id'])});}});}})[_0x176c('0x28')](respondWithStatusCode(_0xf1f0e6,null))['catch'](handleError(_0xf1f0e6,null));};exports[_0x176c('0xa3')]=function(_0x4ba669,_0x548280,_0x2fccb9){var _0x4beb5c={};var _0x279ecb={};var _0x32cc4f;var _0x2f7255;return db[_0x176c('0x32')][_0x176c('0x5d')]({'where':{'id':_0x4ba669['params']['id']}})['then'](handleEntityNotFound(_0x548280,null))['then'](function(_0x9f6abe){if(_0x9f6abe){_0x32cc4f=_0x9f6abe;_0x279ecb[_0x176c('0x35')]=_[_0x176c('0x38')](db[_0x176c('0xa4')][_0x176c('0x4b')]);_0x279ecb[_0x176c('0x37')]=_[_0x176c('0x38')](_0x4ba669['query']);_0x279ecb[_0x176c('0x39')]=_[_0x176c('0x3a')](_0x279ecb[_0x176c('0x35')],_0x279ecb[_0x176c('0x37')]);_0x4beb5c['attributes']=_[_0x176c('0x3a')](_0x279ecb[_0x176c('0x35')],qs[_0x176c('0x3b')](_0x4ba669[_0x176c('0x37')]['fields']));_0x4beb5c[_0x176c('0x3c')]=_0x4beb5c['attributes'][_0x176c('0x5e')]?_0x4beb5c[_0x176c('0x3c')]:_0x279ecb[_0x176c('0x35')];_0x4beb5c[_0x176c('0x3f')]=qs[_0x176c('0x40')](_0x4ba669[_0x176c('0x37')][_0x176c('0x40')]);_0x4beb5c['where']=qs[_0x176c('0x39')](_['pick'](_0x4ba669[_0x176c('0x37')],_0x279ecb['filters']));if(_0x4ba669[_0x176c('0x37')]['filter']){_0x4beb5c[_0x176c('0x41')]=_['merge'](_0x4beb5c[_0x176c('0x41')],{'$or':_['map'](_0x4beb5c[_0x176c('0x3c')],function(_0x2db8cc){var _0x360e92={};_0x360e92[_0x2db8cc]={'$like':'%'+_0x4ba669[_0x176c('0x37')][_0x176c('0x42')]+'%'};return _0x360e92;})});}_0x4beb5c=_['merge']({},_0x4beb5c,_0x4ba669[_0x176c('0x45')]);return _0x32cc4f['getAgents'](_0x4beb5c);}})['then'](function(_0xc2ab87){if(_0xc2ab87){_0x2f7255=_0xc2ab87[_0x176c('0x5e')];if(!_0x4ba669[_0x176c('0x37')][_0x176c('0x3d')](_0x176c('0x3e'))){_0x4beb5c[_0x176c('0x1f')]=qs[_0x176c('0x1f')](_0x4ba669['query'][_0x176c('0x1f')]);_0x4beb5c['offset']=qs[_0x176c('0x21')](_0x4ba669[_0x176c('0x37')][_0x176c('0x21')]);}return _0x32cc4f['getAgents'](_0x4beb5c);}})[_0x176c('0x28')](function(_0x316c1e){if(_0x316c1e){return _0x316c1e?{'count':_0x2f7255,'rows':_0x316c1e}:null;}})[_0x176c('0x28')](respondWithResult(_0x548280,null))[_0x176c('0x4e')](handleError(_0x548280,null));};function handleQuery(_0x4e71ec){logger[_0x176c('0xa5')](_0x4e71ec);return db[_0x176c('0x90')][_0x176c('0x37')](_0x4e71ec)['spread'](function(_0x2fae01){csv_results[_0x176c('0x6a')](_0x2fae01);})[_0x176c('0x4e')](function(_0x5d6fdd){logger[_0x176c('0x2d')](_0x5d6fdd[_0x176c('0xa6')]);});} \ No newline at end of file +var _0x30d5=['findAll','catch','show','rawAttributes','find','create','body','role','Lists','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','ListId','includeAll','rows','removeDispositions','addContacts','CmContact','tags','isArray','join','push','omit','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','ContactItemType','alias','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','select','description','description_additionalPhone_','toString','each','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','download','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','get','UserProfileResource','destroy','error','stack','name','send','index','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','CmList','include'];(function(_0x3f7ebc,_0x291344){var _0x319c10=function(_0x1227ad){while(--_0x1227ad){_0x3f7ebc['push'](_0x3f7ebc['shift']());}};_0x319c10(++_0x291344);}(_0x30d5,0x1ae));var _0x530d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x30d5[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x530d('0x0'));var rimraf=require(_0x530d('0x1'));var zipdir=require(_0x530d('0x2'));var jsonpatch=require(_0x530d('0x3'));var rp=require(_0x530d('0x4'));var moment=require(_0x530d('0x5'));var BPromise=require(_0x530d('0x6'));var Mustache=require(_0x530d('0x7'));var util=require(_0x530d('0x8'));var path=require(_0x530d('0x9'));var sox=require(_0x530d('0xa'));var csv=require(_0x530d('0xb'));var ejs=require(_0x530d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x530d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x530d('0xb'));var querystring=require(_0x530d('0xe'));var Papa=require(_0x530d('0xf'));var Redis=require('ioredis');var authService=require(_0x530d('0x10'));var qs=require(_0x530d('0x11'));var as=require(_0x530d('0x12'));var hardwareService=require(_0x530d('0x13'));var logger=require(_0x530d('0x14'))(_0x530d('0x15'));var utils=require('../../config/utils');var config=require(_0x530d('0x16'));var licenseUtil=require(_0x530d('0x17'));var db=require(_0x530d('0x18'))['db'];var csv_results;config[_0x530d('0x19')]=_[_0x530d('0x1a')](config[_0x530d('0x19')],{'host':_0x530d('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x530d('0x1c'))[_0x530d('0x1d')](socket);function respondWithStatusCode(_0x5b0cdc,_0x482e7b){_0x482e7b=_0x482e7b||0xcc;return function(_0x1f28f4){if(_0x1f28f4){return _0x5b0cdc[_0x530d('0x1e')](_0x482e7b);}return _0x5b0cdc[_0x530d('0x1f')](_0x482e7b)[_0x530d('0x20')]();};}function respondWithResult(_0x21c7d8,_0x612ae4){_0x612ae4=_0x612ae4||0xc8;return function(_0x5eb442){if(_0x5eb442){return _0x21c7d8[_0x530d('0x1f')](_0x612ae4)[_0x530d('0x21')](_0x5eb442);}};}function respondWithFilteredResult(_0x35118e,_0x510d4d){return function(_0x444e46){if(_0x444e46){var _0x3a69f4=typeof _0x510d4d['offset']===_0x530d('0x22')&&typeof _0x510d4d[_0x530d('0x23')]===_0x530d('0x22');var _0x2ccab8=_0x444e46[_0x530d('0x24')];var _0x1411b0=_0x3a69f4?0x0:_0x510d4d[_0x530d('0x25')];var _0x19e63e=_0x3a69f4?_0x444e46[_0x530d('0x24')]:_0x510d4d[_0x530d('0x25')]+_0x510d4d[_0x530d('0x23')];var _0x3b9d15;if(_0x19e63e>=_0x2ccab8){_0x19e63e=_0x2ccab8;_0x3b9d15=0xc8;}else{_0x3b9d15=0xce;}_0x35118e[_0x530d('0x1f')](_0x3b9d15);return _0x35118e[_0x530d('0x26')](_0x530d('0x27'),_0x1411b0+'-'+_0x19e63e+'/'+_0x2ccab8)[_0x530d('0x21')](_0x444e46);}return null;};}function patchUpdates(_0x1d947e){return function(_0x263037){try{jsonpatch[_0x530d('0x28')](_0x263037,_0x1d947e,!![]);}catch(_0x39a2b0){return BPromise['reject'](_0x39a2b0);}return _0x263037[_0x530d('0x29')]();};}function saveUpdates(_0x4be33b,_0x3e94a5){return function(_0x3cf582){if(_0x3cf582){return _0x3cf582['update'](_0x4be33b)[_0x530d('0x2a')](function(_0x30912d){return _0x30912d;});}return null;};}function removeEntity(_0xa41ad0,_0x40c049){return function(_0x4021cd){if(_0x4021cd){return _0x4021cd['destroy']()['then'](function(){var _0x81594e=_0x4021cd[_0x530d('0x2b')]({'plain':!![]});var _0x115e98='Lists';return db[_0x530d('0x2c')][_0x530d('0x2d')]({'where':{'type':_0x115e98,'resourceId':_0x81594e['id']}})['then'](function(){return _0x4021cd;});})[_0x530d('0x2a')](function(){_0xa41ad0[_0x530d('0x1f')](0xcc)[_0x530d('0x20')]();});}};}function handleEntityNotFound(_0x48dc4e,_0x1ff5a4){return function(_0x3d2657){if(!_0x3d2657){_0x48dc4e[_0x530d('0x1e')](0x194);}return _0x3d2657;};}function handleError(_0x31627e,_0x49bc63){_0x49bc63=_0x49bc63||0x1f4;return function(_0xf59f7){logger[_0x530d('0x2e')](_0xf59f7[_0x530d('0x2f')]);if(_0xf59f7[_0x530d('0x30')]){delete _0xf59f7['name'];}_0x31627e[_0x530d('0x1f')](_0x49bc63)[_0x530d('0x31')](_0xf59f7);};}exports[_0x530d('0x32')]=function(_0xc1381c,_0x5010a4){var _0x284b0f={},_0x235d67={},_0x2addba={'count':0x0,'rows':[]};var _0x36f656=_['map'](db['CmList']['rawAttributes'],function(_0x2ea090){return{'name':_0x2ea090[_0x530d('0x33')],'type':_0x2ea090[_0x530d('0x34')]['key']};});_0x235d67[_0x530d('0x35')]=_['map'](_0x36f656,_0x530d('0x30'));_0x235d67['query']=_[_0x530d('0x36')](_0xc1381c[_0x530d('0x37')]);_0x235d67[_0x530d('0x38')]=_[_0x530d('0x39')](_0x235d67[_0x530d('0x35')],_0x235d67[_0x530d('0x37')]);_0x284b0f[_0x530d('0x3a')]=_[_0x530d('0x39')](_0x235d67[_0x530d('0x35')],qs[_0x530d('0x3b')](_0xc1381c[_0x530d('0x37')][_0x530d('0x3b')]));_0x284b0f[_0x530d('0x3a')]=_0x284b0f[_0x530d('0x3a')][_0x530d('0x3c')]?_0x284b0f[_0x530d('0x3a')]:_0x235d67['model'];if(!_0xc1381c[_0x530d('0x37')][_0x530d('0x3d')](_0x530d('0x3e'))){_0x284b0f[_0x530d('0x23')]=qs[_0x530d('0x23')](_0xc1381c[_0x530d('0x37')][_0x530d('0x23')]);_0x284b0f[_0x530d('0x25')]=qs[_0x530d('0x25')](_0xc1381c[_0x530d('0x37')]['offset']);}_0x284b0f[_0x530d('0x3f')]=qs[_0x530d('0x40')](_0xc1381c[_0x530d('0x37')][_0x530d('0x40')]);_0x284b0f[_0x530d('0x41')]=qs[_0x530d('0x38')](_[_0x530d('0x42')](_0xc1381c[_0x530d('0x37')],_0x235d67['filters']),_0x36f656);if(_0xc1381c[_0x530d('0x37')][_0x530d('0x43')]){_0x284b0f['where']=_[_0x530d('0x44')](_0x284b0f[_0x530d('0x41')],{'$or':_[_0x530d('0x45')](_0x36f656,function(_0x59fd4f){if(_0x59fd4f[_0x530d('0x34')]!==_0x530d('0x46')){var _0x3bd534={};_0x3bd534[_0x59fd4f['name']]={'$like':'%'+_0xc1381c[_0x530d('0x37')][_0x530d('0x43')]+'%'};return _0x3bd534;}})});}_0x284b0f=_[_0x530d('0x44')]({},_0x284b0f,_0xc1381c[_0x530d('0x47')]);var _0xcef6bd={'where':_0x284b0f[_0x530d('0x41')]};return db[_0x530d('0x48')]['count'](_0xcef6bd)[_0x530d('0x2a')](function(_0x537590){_0x2addba[_0x530d('0x24')]=_0x537590;if(_0xc1381c[_0x530d('0x37')]['includeAll']){_0x284b0f[_0x530d('0x49')]=[{'all':!![]}];}return db[_0x530d('0x48')][_0x530d('0x4a')](_0x284b0f);})['then'](function(_0x25caac){_0x2addba['rows']=_0x25caac;return _0x2addba;})[_0x530d('0x2a')](respondWithFilteredResult(_0x5010a4,_0x284b0f))[_0x530d('0x4b')](handleError(_0x5010a4,null));};exports[_0x530d('0x4c')]=function(_0x2e592f,_0x123898){var _0x4e39ea={'raw':![],'where':{'id':_0x2e592f['params']['id']}},_0x39fecb={};_0x39fecb[_0x530d('0x35')]=_[_0x530d('0x36')](db['CmList'][_0x530d('0x4d')]);_0x39fecb[_0x530d('0x37')]=_[_0x530d('0x36')](_0x2e592f[_0x530d('0x37')]);_0x39fecb[_0x530d('0x38')]=_[_0x530d('0x39')](_0x39fecb[_0x530d('0x35')],_0x39fecb[_0x530d('0x37')]);_0x4e39ea['attributes']=_[_0x530d('0x39')](_0x39fecb[_0x530d('0x35')],qs['fields'](_0x2e592f[_0x530d('0x37')][_0x530d('0x3b')]));_0x4e39ea['attributes']=_0x4e39ea['attributes']['length']?_0x4e39ea[_0x530d('0x3a')]:_0x39fecb[_0x530d('0x35')];if(_0x2e592f[_0x530d('0x37')]['includeAll']){_0x4e39ea[_0x530d('0x49')]=[{'all':!![]}];}_0x4e39ea=_[_0x530d('0x44')]({},_0x4e39ea,_0x2e592f[_0x530d('0x47')]);return db[_0x530d('0x48')][_0x530d('0x4e')](_0x4e39ea)[_0x530d('0x2a')](handleEntityNotFound(_0x123898,null))[_0x530d('0x2a')](respondWithResult(_0x123898,null))['catch'](handleError(_0x123898,null));};exports[_0x530d('0x4f')]=function(_0x2b7fad,_0x36bc27){return db[_0x530d('0x48')][_0x530d('0x4f')](_0x2b7fad[_0x530d('0x50')],{})[_0x530d('0x2a')](function(_0x15bdb3){var _0x2542cb=_0x2b7fad['user'][_0x530d('0x2b')]({'plain':!![]});if(!_0x2542cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2542cb[_0x530d('0x51')]==='user'){var _0x2245b0=_0x15bdb3[_0x530d('0x2b')]({'plain':!![]});var _0x11ad43=_0x530d('0x52');return db[_0x530d('0x53')]['find']({'where':{'name':_0x11ad43,'userProfileId':_0x2542cb[_0x530d('0x54')]},'raw':!![]})[_0x530d('0x2a')](function(_0x5b7622){if(_0x5b7622&&_0x5b7622[_0x530d('0x55')]===0x0){return db[_0x530d('0x2c')]['create']({'name':_0x2245b0['name'],'resourceId':_0x2245b0['id'],'type':_0x5b7622['name'],'sectionId':_0x5b7622['id']},{})['then'](function(){return _0x15bdb3;});}else{return _0x15bdb3;}})[_0x530d('0x4b')](function(_0x30eb4f){logger[_0x530d('0x2e')](_0x530d('0x56'),_0x30eb4f);throw _0x30eb4f;});}return _0x15bdb3;})[_0x530d('0x2a')](respondWithResult(_0x36bc27,0xc9))['catch'](handleError(_0x36bc27,null));};exports['update']=function(_0x3c97f1,_0x516d83){if(_0x3c97f1[_0x530d('0x50')]['id']){delete _0x3c97f1[_0x530d('0x50')]['id'];}return db[_0x530d('0x48')][_0x530d('0x4e')]({'where':{'id':_0x3c97f1[_0x530d('0x57')]['id']}})[_0x530d('0x2a')](handleEntityNotFound(_0x516d83,null))['then'](saveUpdates(_0x3c97f1[_0x530d('0x50')],null))[_0x530d('0x2a')](respondWithResult(_0x516d83,null))[_0x530d('0x4b')](handleError(_0x516d83,null));};exports[_0x530d('0x2d')]=function(_0x39d5f5,_0x31af73){return db[_0x530d('0x48')][_0x530d('0x4e')]({'where':{'id':_0x39d5f5[_0x530d('0x57')]['id']}})[_0x530d('0x2a')](handleEntityNotFound(_0x31af73,null))[_0x530d('0x2a')](removeEntity(_0x31af73,null))[_0x530d('0x4b')](handleError(_0x31af73,null));};exports['describe']=function(_0x2edf9e,_0x44335){return db[_0x530d('0x48')][_0x530d('0x58')]()['then'](respondWithResult(_0x44335,null))[_0x530d('0x4b')](handleError(_0x44335,null));};exports[_0x530d('0x59')]=function(_0x20b2dd,_0x1a2bb5,_0x4f2757){if(_0x20b2dd['body']['id']){delete _0x20b2dd[_0x530d('0x50')]['id'];}return db[_0x530d('0x48')]['find']({'where':{'id':_0x20b2dd[_0x530d('0x57')]['id']}})[_0x530d('0x2a')](handleEntityNotFound(_0x1a2bb5,null))[_0x530d('0x2a')](function(_0x4e5d6e){if(_0x4e5d6e){_0x20b2dd[_0x530d('0x50')]['ListId']=_0x4e5d6e['id'];return db[_0x530d('0x5a')][_0x530d('0x4f')](_0x20b2dd[_0x530d('0x50')]);}})[_0x530d('0x2a')](respondWithResult(_0x1a2bb5,null))[_0x530d('0x4b')](handleError(_0x1a2bb5,null));};exports[_0x530d('0x5b')]=function(_0x27ad78,_0x5a6c06,_0x5edf18){var _0x57452c={'raw':![],'where':{}};var _0x481964={};var _0x3bd70e={'count':0x0,'rows':[]};return db[_0x530d('0x48')][_0x530d('0x5c')]({'where':{'id':_0x27ad78[_0x530d('0x57')]['id']}})[_0x530d('0x2a')](handleEntityNotFound(_0x5a6c06,null))[_0x530d('0x2a')](function(_0x40039a){if(_0x40039a){_0x481964[_0x530d('0x35')]=_[_0x530d('0x36')](db['Disposition'][_0x530d('0x4d')]);_0x481964[_0x530d('0x37')]=_['keys'](_0x27ad78[_0x530d('0x37')]);_0x481964[_0x530d('0x38')]=_[_0x530d('0x39')](_0x481964[_0x530d('0x35')],_0x481964[_0x530d('0x37')]);_0x57452c[_0x530d('0x3a')]=_['intersection'](_0x481964[_0x530d('0x35')],qs[_0x530d('0x3b')](_0x27ad78['query'][_0x530d('0x3b')]));_0x57452c[_0x530d('0x3a')]=_0x57452c[_0x530d('0x3a')]['length']?_0x57452c[_0x530d('0x3a')]:_0x481964['model'];if(!_0x27ad78[_0x530d('0x37')][_0x530d('0x3d')](_0x530d('0x3e'))){_0x57452c[_0x530d('0x23')]=qs[_0x530d('0x23')](_0x27ad78[_0x530d('0x37')][_0x530d('0x23')]);_0x57452c[_0x530d('0x25')]=qs[_0x530d('0x25')](_0x27ad78[_0x530d('0x37')]['offset']);}_0x57452c[_0x530d('0x3f')]=qs[_0x530d('0x40')](_0x27ad78[_0x530d('0x37')]['sort']);_0x57452c['where']=qs[_0x530d('0x38')](_[_0x530d('0x42')](_0x27ad78['query'],_0x481964['filters']));_0x57452c[_0x530d('0x41')][_0x530d('0x5d')]=_0x40039a['id'];if(_0x27ad78[_0x530d('0x37')][_0x530d('0x43')]){_0x57452c[_0x530d('0x41')]=_[_0x530d('0x44')](_0x57452c[_0x530d('0x41')],{'$or':_[_0x530d('0x45')](_0x57452c[_0x530d('0x3a')],function(_0x2e646a){var _0x2ed014={};_0x2ed014[_0x2e646a]={'$like':'%'+_0x27ad78[_0x530d('0x37')][_0x530d('0x43')]+'%'};return _0x2ed014;})});}_0x57452c=_[_0x530d('0x44')]({},_0x57452c,_0x27ad78[_0x530d('0x47')]);return db[_0x530d('0x5a')]['count']({'where':_0x57452c[_0x530d('0x41')]})[_0x530d('0x2a')](function(_0x104a67){_0x3bd70e['count']=_0x104a67;if(_0x27ad78[_0x530d('0x37')][_0x530d('0x5e')]){_0x57452c[_0x530d('0x49')]=[{'all':!![]}];}return db['Disposition'][_0x530d('0x4a')](_0x57452c);})[_0x530d('0x2a')](function(_0x2cf605){_0x3bd70e[_0x530d('0x5f')]=_0x2cf605;return _0x3bd70e;});}})[_0x530d('0x2a')](respondWithFilteredResult(_0x5a6c06,_0x57452c))[_0x530d('0x4b')](handleError(_0x5a6c06,null));};exports['removeDispositions']=function(_0x326951,_0x4a6024,_0x483982){return db[_0x530d('0x48')][_0x530d('0x4e')]({'where':{'id':_0x326951[_0x530d('0x57')]['id']}})[_0x530d('0x2a')](handleEntityNotFound(_0x4a6024,null))[_0x530d('0x2a')](function(_0x3c4528){if(_0x3c4528){return _0x3c4528[_0x530d('0x60')](_0x326951[_0x530d('0x37')]['ids']);}})[_0x530d('0x2a')](respondWithStatusCode(_0x4a6024,null))['catch'](handleError(_0x4a6024,null));};exports[_0x530d('0x61')]=function(_0x395277,_0x5973c1,_0x3d5036){return db[_0x530d('0x48')][_0x530d('0x4e')]({'where':{'id':_0x395277[_0x530d('0x57')]['id']}})[_0x530d('0x2a')](handleEntityNotFound(_0x5973c1,null))[_0x530d('0x2a')](function(_0xb7cc2a){if(_0xb7cc2a){var _0x315f2e=[];var _0x2ba57b={'success':[],'errors':[]};return db[_0x530d('0x62')][_0x530d('0x58')]()[_0x530d('0x2a')](function(_0x50a4e0){if(_0x395277['body'][_0x530d('0x63')]&&_[_0x530d('0x64')](_0x395277[_0x530d('0x50')][_0x530d('0x63')])){if(_0x395277[_0x530d('0x50')][_0x530d('0x63')][_0x530d('0x3c')]){_0x395277[_0x530d('0x50')][_0x530d('0x63')]=_0x395277[_0x530d('0x50')]['tags'][_0x530d('0x65')](';')+';';}else{_0x395277[_0x530d('0x50')][_0x530d('0x63')]=null;}}else{_0x395277[_0x530d('0x50')][_0x530d('0x63')]=null;}if(_0x395277[_0x530d('0x50')]&&_['isArray'](_0x395277[_0x530d('0x50')])){for(var _0x51475c=0x0;_0x51475c<_0x395277['body'][_0x530d('0x3c')];_0x51475c+=0x1){_0x395277[_0x530d('0x50')][_0x51475c][_0x530d('0x5d')]=_0x395277[_0x530d('0x57')]['id'];_0x315f2e[_0x530d('0x66')](_0x395277[_0x530d('0x50')][_0x51475c]);}return BPromise['each'](_0x315f2e,function(_0x2e9e6e){return db[_0x530d('0x62')][_0x530d('0x4f')](_[_0x530d('0x67')](_0x2e9e6e,[_0x530d('0x68'),'id'])||{},{'fields':_[_0x530d('0x36')](_0x50a4e0),'raw':!![]})[_0x530d('0x2a')](function(_0xb52a0d){_0x2ba57b[_0x530d('0x69')][_0x530d('0x66')](_0xb52a0d[_0x530d('0x6a')]);})[_0x530d('0x4b')](function(_0x1a849c){_0x2ba57b[_0x530d('0x6b')]['push']({'data':_0x2e9e6e,'error':_0x1a849c[_0x530d('0x6c')]});});})[_0x530d('0x2a')](function(_0x5d4b92){return _0x2ba57b;})[_0x530d('0x4b')](function(_0x26c00b){return _0x26c00b;});}else{_0x5973c1[_0x530d('0x1f')](0x190)['json']({'message':_0x530d('0x6d')});}});}})[_0x530d('0x2a')](respondWithResult(_0x5973c1,null))[_0x530d('0x4b')](handleError(_0x5973c1,null));};exports[_0x530d('0x6e')]=function(_0x17385d,_0x1f6fe5,_0x519dcc){var _0x508ef3;return db['CmList'][_0x530d('0x4e')]({'where':{'id':_0x17385d[_0x530d('0x57')]['id']},'include':[{'model':db[_0x530d('0x6f')],'as':_0x530d('0x70')}]})[_0x530d('0x2a')](handleEntityNotFound(_0x1f6fe5,null))[_0x530d('0x2a')](function(_0x3474f1){if(_0x3474f1){_0x508ef3=_0x3474f1;return db[_0x530d('0x62')]['rawAttributes'];}})[_0x530d('0x2a')](function(_0x292886){if(_0x292886){var _0xf98b5={};var _0x395773={};_0x395773[_0x530d('0x35')]=_[_0x530d('0x71')](_[_0x530d('0x36')](_0x292886),_[_0x530d('0x45')](_0x508ef3[_0x530d('0x70')],function(_0x360fd2){return util[_0x530d('0x72')](_0x530d('0x73'),_0x360fd2['id']);}));_0x395773[_0x530d('0x37')]=_[_0x530d('0x36')](_0x17385d[_0x530d('0x37')]);_0x395773[_0x530d('0x38')]=_['intersection'](_0x395773['model'],_0x395773[_0x530d('0x37')]);_0xf98b5[_0x530d('0x3a')]=_[_0x530d('0x39')](_0x395773['model'],qs[_0x530d('0x3b')](_0x17385d[_0x530d('0x37')][_0x530d('0x3b')]));_0xf98b5['attributes']=_0xf98b5['attributes'][_0x530d('0x3c')]?_0xf98b5[_0x530d('0x3a')]:_0x395773[_0x530d('0x35')];if(!_0x17385d[_0x530d('0x37')][_0x530d('0x3d')](_0x530d('0x3e'))){_0xf98b5[_0x530d('0x23')]=qs[_0x530d('0x23')](_0x17385d[_0x530d('0x37')][_0x530d('0x23')]);_0xf98b5[_0x530d('0x25')]=qs[_0x530d('0x25')](_0x17385d['query'][_0x530d('0x25')]);}_0xf98b5[_0x530d('0x3f')]=qs[_0x530d('0x40')](_0x17385d['query'][_0x530d('0x40')]);_0xf98b5[_0x530d('0x41')]=qs['filters'](_[_0x530d('0x42')](_0x17385d['query'],_0x395773[_0x530d('0x38')]));_0xf98b5[_0x530d('0x74')]=!![];if(_0x17385d[_0x530d('0x37')]['filter']){_0xf98b5[_0x530d('0x41')]=_['merge'](_0xf98b5[_0x530d('0x41')],{'$or':_[_0x530d('0x45')](_0xf98b5[_0x530d('0x3a')],function(_0x4ef072){var _0xe6f262={};_0xe6f262[_0x4ef072]={'$like':'%'+_0x17385d[_0x530d('0x37')][_0x530d('0x43')]+'%'};return _0xe6f262;})});}_0xf98b5=_[_0x530d('0x44')]({},_0xf98b5,_0x17385d[_0x530d('0x47')]);return _0x508ef3[_0x530d('0x6e')](_0xf98b5);}})[_0x530d('0x2a')](respondWithResult(_0x1f6fe5,null))['catch'](handleError(_0x1f6fe5,null));};exports['getContactsCsv']=function(_0x1517e8,_0x1ce305,_0x1ec043){var _0x5d3666;var _0x3608d9;var _0x12391a;var _0x2ad29d=_0x1517e8[_0x530d('0x57')]['id'];csv_results=[];return db[_0x530d('0x75')][_0x530d('0x4a')]({'attributes':['id','name'],'raw':!![],'order':['OrderBy']})[_0x530d('0x2a')](function(_0x561fd5){_0x5d3666=_0x561fd5;var _0x5b1bf2=_[_0x530d('0x36')](db[_0x530d('0x62')]['rawAttributes']);return db[_0x530d('0x6f')][_0x530d('0x4a')]({'raw':!![],'attributes':['id',_0x530d('0x76')]})['then'](function(_0x102181){_0x3608d9=_0x102181;var _0x2237f3=squel['select']()[_0x530d('0x3b')](_0x5b1bf2)[_0x530d('0x77')](_0x530d('0x78'),'c')[_0x530d('0x41')](_0x530d('0x79'),_0x2ad29d)[_0x530d('0x41')](_0x530d('0x7a'))[_0x530d('0x7b')]();for(var _0x43849c=0x0;_0x43849c<_0x3608d9[_0x530d('0x3c')];_0x43849c++){_0x2237f3[_0x530d('0x7c')]('c.cf_'+_0x3608d9[_0x43849c]['id'],_0x530d('0x7d')+_0x3608d9[_0x43849c][_0x530d('0x76')]);}for(var _0x43849c=0x0;_0x43849c<_0x5d3666[_0x530d('0x3c')];_0x43849c++){_0x2237f3['field'](squel['select']()['field'](_0x530d('0x7e'))[_0x530d('0x77')](_0x530d('0x7f'))[_0x530d('0x41')](_0x530d('0x80'),_0x5d3666[_0x43849c]['id'])['where'](_0x530d('0x81')),'additionalPhone_'+_0x5d3666[_0x43849c][_0x530d('0x30')]);_0x2237f3[_0x530d('0x7c')](squel[_0x530d('0x82')]()[_0x530d('0x7c')](_0x530d('0x83'))[_0x530d('0x77')](_0x530d('0x7f'))[_0x530d('0x41')](_0x530d('0x80'),_0x5d3666[_0x43849c]['id'])[_0x530d('0x41')](_0x530d('0x81')),_0x530d('0x84')+_0x5d3666[_0x43849c][_0x530d('0x30')]);}var _0x568511=[];_0x568511[_0x530d('0x66')](_0x2237f3[_0x530d('0x85')]());BPromise[_0x530d('0x86')](_0x568511,handleQuery)[_0x530d('0x2a')](function(_0x1a4719){handleQuery(_0x2237f3[_0x530d('0x85')]());var _0x3a526a=csv_results[0x0];if(!_[_0x530d('0x87')](_0x3a526a)){var _0x340c3e=toCsv(_0x3a526a);var _0x2390fa=Date[_0x530d('0x88')]();fs[_0x530d('0x89')](util[_0x530d('0x72')](_0x530d('0x8a'),_0x2ad29d,_0x2390fa),_0x340c3e);_0x1ce305[_0x530d('0x8b')](_0x530d('0x8c'),_0x530d('0x8d')+util[_0x530d('0x72')]('list_%d_%s.csv',_0x2ad29d,_0x2390fa));_0x1ce305[_0x530d('0x8b')]('Content-type','text/csv');return _0x1ce305[_0x530d('0x8e')](util['format'](_0x530d('0x8a'),_0x2ad29d,_0x2390fa));}else{return _0x1ce305[_0x530d('0x1e')](0xcc);}});});});};exports['addCustomField']=function(_0x1c8e7f,_0x4e6efb,_0x5dc1af){var _0x3ea432;delete _0x1c8e7f[_0x530d('0x50')]['id'];return db[_0x530d('0x48')][_0x530d('0x5c')]({'where':{'id':_0x1c8e7f[_0x530d('0x57')]['id']}})[_0x530d('0x2a')](handleEntityNotFound(_0x4e6efb,null))['then'](function(_0x32285a){if(_0x32285a){return db[_0x530d('0x8f')]['transaction'](function(_0x1a43a0){return db['CmCustomField'][_0x530d('0x4f')](_0x1c8e7f['body'],{'transaction':_0x1a43a0})['then'](function(_0x442183){_0x3ea432=_0x442183;return _0x32285a[_0x530d('0x90')](_0x442183,{'transaction':_0x1a43a0});})[_0x530d('0x2a')](function(){var _0xb807f2={'type':db[_0x530d('0x91')][_0x530d('0x92')],'transaction':_0x1a43a0};switch(_0x1c8e7f[_0x530d('0x50')][_0x530d('0x34')]){case _0x530d('0x93'):_0xb807f2[_0x530d('0x34')]=db['Sequelize'][_0x530d('0x92')];break;case _0x530d('0x94'):_0xb807f2['type']=db['Sequelize'][_0x530d('0x95')];break;case _0x530d('0x96'):_0xb807f2[_0x530d('0x34')]=db['Sequelize'][_0x530d('0x97')];_0xb807f2[_0x530d('0x98')]=![];break;default:}return db[_0x530d('0x8f')][_0x530d('0x99')][_0x530d('0x9a')](_0x530d('0x78'),util['format'](_0x530d('0x9b'),_0x3ea432['id']),_0xb807f2);})[_0x530d('0x2a')](function(){return _0x3ea432;});});}})[_0x530d('0x2a')](respondWithResult(_0x4e6efb,null))[_0x530d('0x4b')](handleError(_0x4e6efb,null));};exports[_0x530d('0x9c')]=function(_0x34c257,_0x1bc8e9,_0x4ee12d){var _0x31dd82={};var _0x4e7728={};var _0x4b8253;var _0x1057e4;return db[_0x530d('0x48')][_0x530d('0x5c')]({'where':{'id':_0x34c257[_0x530d('0x57')]['id']}})[_0x530d('0x2a')](handleEntityNotFound(_0x1bc8e9,null))[_0x530d('0x2a')](function(_0x60cff){if(_0x60cff){_0x4b8253=_0x60cff;_0x4e7728[_0x530d('0x35')]=_[_0x530d('0x36')](db[_0x530d('0x6f')]['rawAttributes']);_0x4e7728[_0x530d('0x37')]=_[_0x530d('0x36')](_0x34c257[_0x530d('0x37')]);_0x4e7728[_0x530d('0x38')]=_[_0x530d('0x39')](_0x4e7728[_0x530d('0x35')],_0x4e7728['query']);_0x31dd82[_0x530d('0x3a')]=_[_0x530d('0x39')](_0x4e7728[_0x530d('0x35')],qs[_0x530d('0x3b')](_0x34c257[_0x530d('0x37')][_0x530d('0x3b')]));_0x31dd82[_0x530d('0x3a')]=_0x31dd82[_0x530d('0x3a')]['length']?_0x31dd82[_0x530d('0x3a')]:_0x4e7728['model'];_0x31dd82[_0x530d('0x3f')]=qs[_0x530d('0x40')](_0x34c257[_0x530d('0x37')][_0x530d('0x40')]);_0x31dd82[_0x530d('0x41')]=qs['filters'](_[_0x530d('0x42')](_0x34c257['query'],_0x4e7728['filters']));_0x31dd82[_0x530d('0x41')]=_[_0x530d('0x44')](_0x31dd82[_0x530d('0x41')],{'$or':[{'ListId':_0x60cff['id']},{'ListId':null}]});if(_0x34c257[_0x530d('0x37')]['filter']){_0x31dd82['where']=_[_0x530d('0x44')](_0x31dd82[_0x530d('0x41')],{'$or':_[_0x530d('0x45')](_0x31dd82['attributes'],function(_0x1977d6){var _0xe1ca00={};_0xe1ca00[_0x1977d6]={'$like':'%'+_0x34c257[_0x530d('0x37')]['filter']+'%'};return _0xe1ca00;})});}_0x31dd82=_['merge']({},_0x31dd82,_0x34c257[_0x530d('0x47')]);return db['CmCustomField'][_0x530d('0x9d')](_0x31dd82);}})['then'](respondWithResult(_0x1bc8e9,null))[_0x530d('0x4b')](handleError(_0x1bc8e9,null));};exports[_0x530d('0x9e')]=function(_0x11ba2c,_0x305aa3){return db[_0x530d('0x6f')][_0x530d('0x9d')]({'where':{'ListId':null}})[_0x530d('0x2a')](handleEntityNotFound(_0x305aa3,null))[_0x530d('0x2a')](function(_0x3e03a3){return _0x3e03a3;})[_0x530d('0x2a')](respondWithResult(_0x305aa3,null))[_0x530d('0x4b')](handleError(_0x305aa3,null));};exports[_0x530d('0x9f')]=function(_0x5cd9b5,_0x24d63f,_0x3fd6aa){return db[_0x530d('0x48')]['find']({'where':{'id':_0x5cd9b5[_0x530d('0x57')]['id']}})['then'](handleEntityNotFound(_0x24d63f,null))[_0x530d('0x2a')](function(_0x2509ab){if(_0x2509ab){return _0x2509ab[_0x530d('0x9f')](_0x5cd9b5[_0x530d('0x50')]['ids'],_[_0x530d('0x67')](_0x5cd9b5['body'],[_0x530d('0x68'),'id'])||{})[_0x530d('0xa0')](function(_0x72dead){for(var _0x18a7f1=0x0;_0x18a7f1<_0x5cd9b5[_0x530d('0x50')][_0x530d('0x68')][_0x530d('0x3c')];_0x18a7f1+=0x1){socket[_0x530d('0xa1')](_0x530d('0xa2'),{'UserId':Number(_0x5cd9b5[_0x530d('0x50')]['ids'][_0x18a7f1]),'CmListId':Number(_0x5cd9b5[_0x530d('0x57')]['id'])});}return _0x72dead;});}})['then'](respondWithResult(_0x24d63f,null))[_0x530d('0x4b')](handleError(_0x24d63f,null));};exports['removeAgents']=function(_0x410f1e,_0x1dedb6,_0x171e7c){return db[_0x530d('0x48')][_0x530d('0x4e')]({'where':{'id':_0x410f1e[_0x530d('0x57')]['id']}})[_0x530d('0x2a')](handleEntityNotFound(_0x1dedb6,null))[_0x530d('0x2a')](function(_0x2a6c9d){if(_0x2a6c9d){return _0x2a6c9d[_0x530d('0xa3')](_0x410f1e[_0x530d('0x37')]['ids'])[_0x530d('0x2a')](function(){if(_[_0x530d('0x64')](_0x410f1e[_0x530d('0x37')][_0x530d('0x68')])){for(var _0x53848b=0x0;_0x53848b<_0x410f1e['query']['ids']['length'];_0x53848b+=0x1){socket['emit'](_0x530d('0xa4'),{'UserId':Number(_0x410f1e[_0x530d('0x37')][_0x530d('0x68')][_0x53848b]),'CmListId':Number(_0x410f1e[_0x530d('0x57')]['id'])});}}else{socket['emit'](_0x530d('0xa4'),{'UserId':Number(_0x410f1e[_0x530d('0x37')][_0x530d('0x68')]),'CmListId':Number(_0x410f1e[_0x530d('0x57')]['id'])});}});}})[_0x530d('0x2a')](respondWithStatusCode(_0x1dedb6,null))['catch'](handleError(_0x1dedb6,null));};exports[_0x530d('0xa5')]=function(_0x13e4f8,_0xee6f0e,_0x146b35){var _0x98f5ee={};var _0x2d1146={};var _0x17a754;var _0x469d85;return db[_0x530d('0x48')][_0x530d('0x5c')]({'where':{'id':_0x13e4f8[_0x530d('0x57')]['id']}})[_0x530d('0x2a')](handleEntityNotFound(_0xee6f0e,null))[_0x530d('0x2a')](function(_0x25283b){if(_0x25283b){_0x17a754=_0x25283b;_0x2d1146[_0x530d('0x35')]=_[_0x530d('0x36')](db[_0x530d('0xa6')]['rawAttributes']);_0x2d1146[_0x530d('0x37')]=_[_0x530d('0x36')](_0x13e4f8[_0x530d('0x37')]);_0x2d1146[_0x530d('0x38')]=_[_0x530d('0x39')](_0x2d1146[_0x530d('0x35')],_0x2d1146[_0x530d('0x37')]);_0x98f5ee[_0x530d('0x3a')]=_[_0x530d('0x39')](_0x2d1146[_0x530d('0x35')],qs[_0x530d('0x3b')](_0x13e4f8[_0x530d('0x37')][_0x530d('0x3b')]));_0x98f5ee[_0x530d('0x3a')]=_0x98f5ee['attributes'][_0x530d('0x3c')]?_0x98f5ee[_0x530d('0x3a')]:_0x2d1146[_0x530d('0x35')];_0x98f5ee[_0x530d('0x3f')]=qs[_0x530d('0x40')](_0x13e4f8[_0x530d('0x37')][_0x530d('0x40')]);_0x98f5ee['where']=qs[_0x530d('0x38')](_['pick'](_0x13e4f8[_0x530d('0x37')],_0x2d1146[_0x530d('0x38')]));if(_0x13e4f8[_0x530d('0x37')][_0x530d('0x43')]){_0x98f5ee[_0x530d('0x41')]=_[_0x530d('0x44')](_0x98f5ee[_0x530d('0x41')],{'$or':_[_0x530d('0x45')](_0x98f5ee['attributes'],function(_0x17d05f){var _0x221abd={};_0x221abd[_0x17d05f]={'$like':'%'+_0x13e4f8[_0x530d('0x37')][_0x530d('0x43')]+'%'};return _0x221abd;})});}_0x98f5ee=_[_0x530d('0x44')]({},_0x98f5ee,_0x13e4f8['options']);return _0x17a754['getAgents'](_0x98f5ee);}})[_0x530d('0x2a')](function(_0xf48752){if(_0xf48752){_0x469d85=_0xf48752[_0x530d('0x3c')];if(!_0x13e4f8['query'][_0x530d('0x3d')](_0x530d('0x3e'))){_0x98f5ee[_0x530d('0x23')]=qs['limit'](_0x13e4f8[_0x530d('0x37')][_0x530d('0x23')]);_0x98f5ee[_0x530d('0x25')]=qs['offset'](_0x13e4f8[_0x530d('0x37')][_0x530d('0x25')]);}return _0x17a754[_0x530d('0xa5')](_0x98f5ee);}})['then'](function(_0x385615){if(_0x385615){return _0x385615?{'count':_0x469d85,'rows':_0x385615}:null;}})['then'](respondWithResult(_0xee6f0e,null))['catch'](handleError(_0xee6f0e,null));};function handleQuery(_0xe3555d){logger[_0x530d('0xa7')](_0xe3555d);return db[_0x530d('0x8f')][_0x530d('0x37')](_0xe3555d)[_0x530d('0xa0')](function(_0x11a091){csv_results[_0x530d('0x66')](_0x11a091);})[_0x530d('0x4b')](function(_0x53775e){logger[_0x530d('0x2e')](_0x53775e['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 27c3e93..4d3d969 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x4c0baa,_0x2e110f){var _0x4bf459=function(_0x401aa3){while(--_0x401aa3){_0x4c0baa['push'](_0x4c0baa['shift']());}};_0x4bf459(++_0x2e110f);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe14b,0x93));var _0xbe14=function(_0x347dbb,_0x52fa9b){_0x347dbb=_0x347dbb-0x0;var _0x4ccba7=_0xe14b[_0x347dbb];return _0x4ccba7;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 5c92792..c85f1c1 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 _0x3c81=['moment','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','util','api'];(function(_0x3440b4,_0x1460ca){var _0x48efc6=function(_0xba3ea6){while(--_0xba3ea6){_0x3440b4['push'](_0x3440b4['shift']());}};_0x48efc6(++_0x1460ca);}(_0x3c81,0x102));var _0x13c8=function(_0x18e346,_0x54c488){_0x18e346=_0x18e346-0x0;var _0xdb5586=_0x3c81[_0x18e346];return _0xdb5586;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var logger=require('../../config/logger')(_0x13c8('0x2'));var moment=require(_0x13c8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x13c8('0x4'));var attributes=require(_0x13c8('0x5'));module[_0x13c8('0x6')]=function(_0x1c16f1,_0x2a4d66){return _0x1c16f1[_0x13c8('0x7')](_0x13c8('0x8'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22fb=['define','CmList','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x3a0668,_0x968aab){var _0x1895bb=function(_0x559f02){while(--_0x559f02){_0x3a0668['push'](_0x3a0668['shift']());}};_0x1895bb(++_0x968aab);}(_0x22fb,0x192));var _0xb22f=function(_0x3b3001,_0x49e60e){_0x3b3001=_0x3b3001-0x0;var _0x3ef8c1=_0x22fb[_0x3b3001];return _0x3ef8c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22f('0x0'))('api');var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rp=require(_0xb22f('0x3'));var fs=require('fs');var path=require(_0xb22f('0x4'));var rimraf=require(_0xb22f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb22f('0x6'));module[_0xb22f('0x7')]=function(_0x2d1fb3,_0xc3ffcc){return _0x2d1fb3[_0xb22f('0x8')](_0xb22f('0x9'),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 2b030e9..f11d01a 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 _0x751a=['register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','socket.io-emitter'];(function(_0x59c1b8,_0x251576){var _0x202875=function(_0x424b25){while(--_0x424b25){_0x59c1b8['push'](_0x59c1b8['shift']());}};_0x202875(++_0x251576);}(_0x751a,0xe4));var _0xa751=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x751a[_0x368e09];return _0x14b7df;};'use strict';var _=require(_0xa751('0x0'));var util=require(_0xa751('0x1'));var moment=require(_0xa751('0x2'));var BPromise=require('bluebird');var rs=require(_0xa751('0x3'));var fs=require('fs');var Redis=require(_0xa751('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa751('0x5'));var logger=require(_0xa751('0x6'))(_0xa751('0x7'));var config=require(_0xa751('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa751('0x9')]['http']({'port':0x232a});config[_0xa751('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa751('0xb'))(new Redis(config['redis']));require('./cmList.socket')[_0xa751('0xc')](socket);function respondWithRpcPromise(_0x10480f,_0x4bc5a5,_0xf1de21){return new BPromise(function(_0x43cefc,_0x5e4cb0){return client[_0xa751('0xd')](_0x10480f,_0xf1de21)[_0xa751('0xe')](function(_0x80bf73){logger['info'](_0xa751('0xf'),_0x4bc5a5,_0xa751('0x10'));logger[_0xa751('0x11')](_0xa751('0x12'),_0x4bc5a5,_0xa751('0x10'),JSON[_0xa751('0x13')](_0x80bf73));if(_0x80bf73[_0xa751('0x14')]){if(_0x80bf73[_0xa751('0x14')]['code']===0x1f4){logger[_0xa751('0x14')](_0xa751('0xf'),_0x4bc5a5,_0x80bf73[_0xa751('0x14')]['message']);return _0x5e4cb0(_0x80bf73[_0xa751('0x14')][_0xa751('0x15')]);}logger[_0xa751('0x14')](_0xa751('0xf'),_0x4bc5a5,_0x80bf73['error'][_0xa751('0x15')]);return _0x43cefc(_0x80bf73[_0xa751('0x14')][_0xa751('0x15')]);}else{logger[_0xa751('0x16')]('CmList,\x20%s,\x20%s',_0x4bc5a5,'request\x20sent');_0x43cefc(_0x80bf73[_0xa751('0x17')][_0xa751('0x15')]);}})['catch'](function(_0x22098e){logger[_0xa751('0x14')](_0xa751('0xf'),_0x4bc5a5,_0x22098e);_0x5e4cb0(_0x22098e);});});} \ No newline at end of file +var _0x80be=['redis','localhost','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3826d2,_0x5ee3c9){var _0x2ec504=function(_0x1f6e2a){while(--_0x1f6e2a){_0x3826d2['push'](_0x3826d2['shift']());}};_0x2ec504(++_0x5ee3c9);}(_0x80be,0x10b));var _0xe80b=function(_0x3cba80,_0x3024e7){_0x3cba80=_0x3cba80-0x0;var _0x11cb67=_0x80be[_0x3cba80];return _0x11cb67;};'use strict';var _=require(_0xe80b('0x0'));var util=require('util');var moment=require(_0xe80b('0x1'));var BPromise=require(_0xe80b('0x2'));var rs=require(_0xe80b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe80b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe80b('0x5'))('rpc');var config=require(_0xe80b('0x6'));var jayson=require(_0xe80b('0x7'));var client=jayson[_0xe80b('0x8')]['http']({'port':0x232a});config[_0xe80b('0x9')]=_['defaults'](config[_0xe80b('0x9')],{'host':_0xe80b('0xa'),'port':0x18eb});var socket=require(_0xe80b('0xb'))(new Redis(config[_0xe80b('0x9')]));require('./cmList.socket')[_0xe80b('0xc')](socket);function respondWithRpcPromise(_0x50d4d0,_0x47200d,_0x11b9d5){return new BPromise(function(_0x58a319,_0x115813){return client[_0xe80b('0xd')](_0x50d4d0,_0x11b9d5)[_0xe80b('0xe')](function(_0x15880c){logger[_0xe80b('0xf')](_0xe80b('0x10'),_0x47200d,_0xe80b('0x11'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x47200d,_0xe80b('0x11'),JSON[_0xe80b('0x12')](_0x15880c));if(_0x15880c[_0xe80b('0x13')]){if(_0x15880c[_0xe80b('0x13')]['code']===0x1f4){logger['error'](_0xe80b('0x10'),_0x47200d,_0x15880c[_0xe80b('0x13')]['message']);return _0x115813(_0x15880c[_0xe80b('0x13')][_0xe80b('0x14')]);}logger['error']('CmList,\x20%s,\x20%s',_0x47200d,_0x15880c[_0xe80b('0x13')]['message']);return _0x58a319(_0x15880c[_0xe80b('0x13')][_0xe80b('0x14')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x47200d,_0xe80b('0x11'));_0x58a319(_0x15880c[_0xe80b('0x15')][_0xe80b('0x14')]);}})[_0xe80b('0x16')](function(_0x334e21){logger[_0xe80b('0x13')](_0xe80b('0x10'),_0x47200d,_0x334e21);_0x115813(_0x334e21);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 1654474..91db816 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 _0xcb78=['update','emit','length','cmList:','./cmList.events','save','remove'];(function(_0x323956,_0x5b9349){var _0x1618fe=function(_0x7cb016){while(--_0x7cb016){_0x323956['push'](_0x323956['shift']());}};_0x1618fe(++_0x5b9349);}(_0xcb78,0x1bd));var _0x8cb7=function(_0x16e272,_0x5cf8ec){_0x16e272=_0x16e272-0x0;var _0x4cb000=_0xcb78[_0x16e272];return _0x4cb000;};'use strict';var CmListEvents=require(_0x8cb7('0x0'));var events=[_0x8cb7('0x1'),_0x8cb7('0x2'),_0x8cb7('0x3')];function createListener(_0x190a80,_0x3d211f){return function(_0x5a70f8){_0x3d211f[_0x8cb7('0x4')](_0x190a80,_0x5a70f8);};}function removeListener(_0x2fb5c5,_0x45c69b){return function(){CmListEvents['removeListener'](_0x2fb5c5,_0x45c69b);};}exports['register']=function(_0x1eb13c){for(var _0x27ccc7=0x0,_0x2e5f9c=events[_0x8cb7('0x5')];_0x27ccc7<_0x2e5f9c;_0x27ccc7++){var _0x5e958a=events[_0x27ccc7];var _0x11f00a=createListener(_0x8cb7('0x6')+_0x5e958a,_0x1eb13c);CmListEvents['on'](_0x5e958a,_0x11f00a);}}; \ No newline at end of file +var _0xad69=['length','./cmList.events','remove','update','emit','removeListener'];(function(_0x28e512,_0x2454e9){var _0x1660e1=function(_0x11d86b){while(--_0x11d86b){_0x28e512['push'](_0x28e512['shift']());}};_0x1660e1(++_0x2454e9);}(_0xad69,0x187));var _0x9ad6=function(_0x448f4e,_0x19300c){_0x448f4e=_0x448f4e-0x0;var _0x8c388b=_0xad69[_0x448f4e];return _0x8c388b;};'use strict';var CmListEvents=require(_0x9ad6('0x0'));var events=['save',_0x9ad6('0x1'),_0x9ad6('0x2')];function createListener(_0x4bc583,_0x22b543){return function(_0x3963a4){_0x22b543[_0x9ad6('0x3')](_0x4bc583,_0x3963a4);};}function removeListener(_0x1bc0a1,_0xc37bfb){return function(){CmListEvents[_0x9ad6('0x4')](_0x1bc0a1,_0xc37bfb);};}exports['register']=function(_0x5d9424){for(var _0x4c5c78=0x0,_0x464a02=events[_0x9ad6('0x5')];_0x4c5c78<_0x464a02;_0x4c5c78++){var _0x43e8a2=events[_0x4c5c78];var _0x685911=createListener('cmList:'+_0x43e8a2,_0x5d9424);CmListEvents['on'](_0x43e8a2,_0x685911);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 3443128..6ca8ab2 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 _0x6cb7=['show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','addDisposition','addContacts','addCustomField','addAgents','update','delete','destroy','removeDispositions','removeAgents','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','describe','/global_fields','/:id'];(function(_0xf93179,_0x1ddfb7){var _0x74fdea=function(_0x8901f){while(--_0x8901f){_0xf93179['push'](_0xf93179['shift']());}};_0x74fdea(++_0x1ddfb7);}(_0x6cb7,0x19f));var _0x76cb=function(_0x15a994,_0x87aa4b){_0x15a994=_0x15a994-0x0;var _0x1077ab=_0x6cb7[_0x15a994];return _0x1077ab;};'use strict';var multer=require('multer');var util=require(_0x76cb('0x0'));var path=require(_0x76cb('0x1'));var timeout=require(_0x76cb('0x2'));var express=require('express');var router=express[_0x76cb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x76cb('0x4'));var interaction=require(_0x76cb('0x5'));var config=require(_0x76cb('0x6'));var controller=require(_0x76cb('0x7'));router[_0x76cb('0x8')]('/',auth[_0x76cb('0x9')](),controller[_0x76cb('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x76cb('0xb')]);router['get'](_0x76cb('0xc'),auth[_0x76cb('0x9')](),controller['getGlobalCustomFields']);router[_0x76cb('0x8')](_0x76cb('0xd'),auth['isAuthenticated'](),controller[_0x76cb('0xe')]);router[_0x76cb('0x8')](_0x76cb('0xf'),auth['isAuthenticated'](),controller[_0x76cb('0x10')]);router[_0x76cb('0x8')](_0x76cb('0x11'),auth[_0x76cb('0x9')](),controller[_0x76cb('0x12')]);router[_0x76cb('0x8')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x76cb('0x13')]);router[_0x76cb('0x8')](_0x76cb('0x14'),auth['isAuthenticated'](),controller[_0x76cb('0x15')]);router[_0x76cb('0x8')](_0x76cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x76cb('0x17')]('/',auth[_0x76cb('0x9')](),controller['create']);router[_0x76cb('0x17')](_0x76cb('0xf'),auth[_0x76cb('0x9')](),controller[_0x76cb('0x18')]);router['post'](_0x76cb('0x11'),auth[_0x76cb('0x9')](),controller[_0x76cb('0x19')]);router[_0x76cb('0x17')](_0x76cb('0x14'),auth[_0x76cb('0x9')](),controller[_0x76cb('0x1a')]);router[_0x76cb('0x17')](_0x76cb('0x16'),auth[_0x76cb('0x9')](),controller[_0x76cb('0x1b')]);router['put']('/:id',auth[_0x76cb('0x9')](),controller[_0x76cb('0x1c')]);router[_0x76cb('0x1d')](_0x76cb('0xd'),auth['isAuthenticated'](),controller[_0x76cb('0x1e')]);router[_0x76cb('0x1d')](_0x76cb('0xf'),auth[_0x76cb('0x9')](),controller[_0x76cb('0x1f')]);router[_0x76cb('0x1d')](_0x76cb('0x16'),auth['isAuthenticated'](),controller[_0x76cb('0x20')]);module['exports']=router; \ No newline at end of file +var _0xb63c=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','/:id/fields','addAgents','put','update','delete','/:id/users','removeAgents','exports','multer'];(function(_0x47fc46,_0x498477){var _0xe63d8d=function(_0x3e8b60){while(--_0x3e8b60){_0x47fc46['push'](_0x47fc46['shift']());}};_0xe63d8d(++_0x498477);}(_0xb63c,0x155));var _0xcb63=function(_0x400dbb,_0x129a91){_0x400dbb=_0x400dbb-0x0;var _0x512abc=_0xb63c[_0x400dbb];return _0x512abc;};'use strict';var multer=require(_0xcb63('0x0'));var util=require(_0xcb63('0x1'));var path=require(_0xcb63('0x2'));var timeout=require(_0xcb63('0x3'));var express=require(_0xcb63('0x4'));var router=express[_0xcb63('0x5')]();var fs_extra=require(_0xcb63('0x6'));var auth=require(_0xcb63('0x7'));var interaction=require(_0xcb63('0x8'));var config=require(_0xcb63('0x9'));var controller=require(_0xcb63('0xa'));router[_0xcb63('0xb')]('/',auth[_0xcb63('0xc')](),controller[_0xcb63('0xd')]);router[_0xcb63('0xb')](_0xcb63('0xe'),auth[_0xcb63('0xc')](),controller[_0xcb63('0xf')]);router[_0xcb63('0xb')](_0xcb63('0x10'),auth[_0xcb63('0xc')](),controller[_0xcb63('0x11')]);router['get'](_0xcb63('0x12'),auth[_0xcb63('0xc')](),controller[_0xcb63('0x13')]);router['get']('/:id/dispositions',auth[_0xcb63('0xc')](),controller[_0xcb63('0x14')]);router[_0xcb63('0xb')]('/:id/contacts',auth[_0xcb63('0xc')](),controller[_0xcb63('0x15')]);router['get'](_0xcb63('0x16'),auth[_0xcb63('0xc')](),controller[_0xcb63('0x17')]);router[_0xcb63('0xb')]('/:id/fields',auth[_0xcb63('0xc')](),controller['getCustomFields']);router[_0xcb63('0xb')]('/:id/users',auth[_0xcb63('0xc')](),controller[_0xcb63('0x18')]);router[_0xcb63('0x19')]('/',auth['isAuthenticated'](),controller[_0xcb63('0x1a')]);router[_0xcb63('0x19')](_0xcb63('0x1b'),auth['isAuthenticated'](),controller[_0xcb63('0x1c')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0xcb63('0x1d')]);router['post'](_0xcb63('0x1e'),auth[_0xcb63('0xc')](),controller['addCustomField']);router['post']('/:id/users',auth[_0xcb63('0xc')](),controller[_0xcb63('0x1f')]);router[_0xcb63('0x20')]('/:id',auth[_0xcb63('0xc')](),controller[_0xcb63('0x21')]);router[_0xcb63('0x22')](_0xcb63('0x12'),auth['isAuthenticated'](),controller['destroy']);router[_0xcb63('0x22')](_0xcb63('0x1b'),auth[_0xcb63('0xc')](),controller['removeDispositions']);router[_0xcb63('0x22')](_0xcb63('0x23'),auth[_0xcb63('0xc')](),controller[_0xcb63('0x24')]);module[_0xcb63('0x25')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index b448042..0a025cf 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 _0x10a7=['sequelize','exports','VIRTUAL','getDataValue','STRING'];(function(_0x4c0694,_0x29e537){var _0x5e8ec0=function(_0x526b9f){while(--_0x526b9f){_0x4c0694['push'](_0x4c0694['shift']());}};_0x5e8ec0(++_0x29e537);}(_0x10a7,0xb4));var _0x710a=function(_0x17d2e9,_0x9bbc84){_0x17d2e9=_0x17d2e9-0x0;var _0x29a88b=_0x10a7[_0x17d2e9];return _0x29a88b;};'use strict';var Sequelize=require(_0x710a('0x0'));module[_0x710a('0x1')]={'name':{'type':Sequelize[_0x710a('0x2')],'get':function(_0x5dbf5c){return this[_0x710a('0x3')]('field');}},'field':{'type':Sequelize[_0x710a('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x710a('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x710a('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x31e5=['STRING','sequelize','field'];(function(_0x111399,_0x25f2e9){var _0x80b8b3=function(_0x534872){while(--_0x534872){_0x111399['push'](_0x111399['shift']());}};_0x80b8b3(++_0x25f2e9);}(_0x31e5,0x142));var _0x531e=function(_0x57f50a,_0x20d8ed){_0x57f50a=_0x57f50a-0x0;var _0x3d9f0c=_0x31e5[_0x57f50a];return _0x3d9f0c;};'use strict';var Sequelize=require(_0x531e('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1f626e){return this['getDataValue'](_0x531e('0x1'));}},'field':{'type':Sequelize[_0x531e('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0x531e('0x2')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 0622444..79acf95 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x18c8fa,_0x59b549){var _0x28ff95=function(_0x2b42b7){while(--_0x2b42b7){_0x18c8fa['push'](_0x18c8fa['shift']());}};_0x28ff95(++_0x59b549);}(_0x7a54,0x106));var _0x47a5=function(_0x5a973c,_0xa1c59c){_0x5a973c=_0x5a973c-0x0;var _0x1994ec=_0x7a54[_0x5a973c];return _0x1994ec;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x3582ac,_0x330556){var _0x5b04d8=function(_0x56dee0){while(--_0x56dee0){_0x3582ac['push'](_0x3582ac['shift']());}};_0x5b04d8(++_0x330556);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 2cad1ee..81951fd 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 _0x176c=['Condition','tools_conditions','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x2ef58a,_0x5df91a){var _0x2b7bc7=function(_0x113cee){while(--_0x113cee){_0x2ef58a['push'](_0x2ef58a['shift']());}};_0x2b7bc7(++_0x5df91a);}(_0x176c,0x183));var _0xc176=function(_0x515048,_0x4aa835){_0x515048=_0x515048-0x0;var _0x209d62=_0x176c[_0x515048];return _0x209d62;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc176('0x0'))('api');var moment=require(_0xc176('0x1'));var BPromise=require(_0xc176('0x2'));var rp=require(_0xc176('0x3'));var fs=require('fs');var path=require(_0xc176('0x4'));var rimraf=require(_0xc176('0x5'));var config=require(_0xc176('0x6'));var attributes=require(_0xc176('0x7'));module[_0xc176('0x8')]=function(_0xde8408,_0x20307e){return _0xde8408['define'](_0xc176('0x9'),attributes,{'tableName':_0xc176('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0cb9=['../../config/environment','./condition.attributes','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x0cb9,0x1e4));var _0x90cb=function(_0x3b392b,_0x29228b){_0x3b392b=_0x3b392b-0x0;var _0x5509e1=_0x0cb9[_0x3b392b];return _0x5509e1;};'use strict';var _=require(_0x90cb('0x0'));var util=require(_0x90cb('0x1'));var logger=require(_0x90cb('0x2'))(_0x90cb('0x3'));var moment=require(_0x90cb('0x4'));var BPromise=require('bluebird');var rp=require(_0x90cb('0x5'));var fs=require('fs');var path=require(_0x90cb('0x6'));var rimraf=require(_0x90cb('0x7'));var config=require(_0x90cb('0x8'));var attributes=require(_0x90cb('0x9'));module['exports']=function(_0x4d2b22,_0x5269a6){return _0x4d2b22['define'](_0x90cb('0xa'),attributes,{'tableName':_0x90cb('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 a1c8d09..0bd0d55 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 _0xcddd=['code','Condition,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x27cf4d,_0x572668){var _0x194d29=function(_0x495eb6){while(--_0x495eb6){_0x27cf4d['push'](_0x27cf4d['shift']());}};_0x194d29(++_0x572668);}(_0xcddd,0x10c));var _0xdcdd=function(_0x1bd630,_0x1c0741){_0x1bd630=_0x1bd630-0x0;var _0x30734b=_0xcddd[_0x1bd630];return _0x30734b;};'use strict';var _=require(_0xdcdd('0x0'));var util=require(_0xdcdd('0x1'));var moment=require(_0xdcdd('0x2'));var BPromise=require(_0xdcdd('0x3'));var rs=require(_0xdcdd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcdd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdcdd('0x6'))(_0xdcdd('0x7'));var config=require(_0xdcdd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdcdd('0x9')][_0xdcdd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bda32,_0x1bcc41,_0x9f525e){return new BPromise(function(_0xb68306,_0x459ac5){return client[_0xdcdd('0xb')](_0x2bda32,_0x9f525e)['then'](function(_0x51c43a){logger[_0xdcdd('0xc')]('Condition,\x20%s,\x20%s',_0x1bcc41,_0xdcdd('0xd'));logger[_0xdcdd('0xe')](_0xdcdd('0xf'),_0x1bcc41,'request\x20sent',JSON[_0xdcdd('0x10')](_0x51c43a));if(_0x51c43a[_0xdcdd('0x11')]){if(_0x51c43a['error'][_0xdcdd('0x12')]===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x1bcc41,_0x51c43a['error']['message']);return _0x459ac5(_0x51c43a[_0xdcdd('0x11')]['message']);}logger['error'](_0xdcdd('0x13'),_0x1bcc41,_0x51c43a[_0xdcdd('0x11')][_0xdcdd('0x14')]);return _0xb68306(_0x51c43a[_0xdcdd('0x11')][_0xdcdd('0x14')]);}else{logger[_0xdcdd('0xc')](_0xdcdd('0x13'),_0x1bcc41,_0xdcdd('0xd'));_0xb68306(_0x51c43a[_0xdcdd('0x15')][_0xdcdd('0x14')]);}})['catch'](function(_0x45d38d){logger[_0xdcdd('0x11')](_0xdcdd('0x13'),_0x1bcc41,_0x45d38d);_0x459ac5(_0x45d38d);});});} \ No newline at end of file +var _0xdc7c=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x406062,_0x1fd25a){var _0x5b188d=function(_0x29d535){while(--_0x29d535){_0x406062['push'](_0x406062['shift']());}};_0x5b188d(++_0x1fd25a);}(_0xdc7c,0xb4));var _0xcdc7=function(_0x4303a0,_0x5a7592){_0x4303a0=_0x4303a0-0x0;var _0x3af3e8=_0xdc7c[_0x4303a0];return _0x3af3e8;};'use strict';var _=require('lodash');var util=require(_0xcdc7('0x0'));var moment=require('moment');var BPromise=require(_0xcdc7('0x1'));var rs=require(_0xcdc7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcdc7('0x3'))['db'];var utils=require(_0xcdc7('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xcdc7('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xcdc7('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d2306,_0x3364c7,_0x1815f5){return new BPromise(function(_0x4bbcd5,_0xea7317){return client[_0xcdc7('0x7')](_0x2d2306,_0x1815f5)['then'](function(_0xde92e5){logger[_0xcdc7('0x8')](_0xcdc7('0x9'),_0x3364c7,_0xcdc7('0xa'));logger[_0xcdc7('0xb')](_0xcdc7('0xc'),_0x3364c7,_0xcdc7('0xa'),JSON[_0xcdc7('0xd')](_0xde92e5));if(_0xde92e5['error']){if(_0xde92e5['error']['code']===0x1f4){logger[_0xcdc7('0xe')]('Condition,\x20%s,\x20%s',_0x3364c7,_0xde92e5[_0xcdc7('0xe')][_0xcdc7('0xf')]);return _0xea7317(_0xde92e5[_0xcdc7('0xe')][_0xcdc7('0xf')]);}logger[_0xcdc7('0xe')]('Condition,\x20%s,\x20%s',_0x3364c7,_0xde92e5['error'][_0xcdc7('0xf')]);return _0x4bbcd5(_0xde92e5[_0xcdc7('0xe')][_0xcdc7('0xf')]);}else{logger['info'](_0xcdc7('0x9'),_0x3364c7,'request\x20sent');_0x4bbcd5(_0xde92e5[_0xcdc7('0x10')][_0xcdc7('0xf')]);}})[_0xcdc7('0x11')](function(_0x560446){logger['error'](_0xcdc7('0x9'),_0x3364c7,_0x560446);_0xea7317(_0x560446);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 3742afd..a794a2c 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 _0x546c=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','update','exports'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x546c,0x1c7));var _0xc546=function(_0x3f3093,_0x35914d){_0x3f3093=_0x3f3093-0x0;var _0x43b07d=_0x546c[_0x3f3093];return _0x43b07d;};'use strict';var multer=require(_0xc546('0x0'));var util=require(_0xc546('0x1'));var path=require(_0xc546('0x2'));var timeout=require(_0xc546('0x3'));var express=require(_0xc546('0x4'));var router=express[_0xc546('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc546('0x6'));var interaction=require(_0xc546('0x7'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0xc546('0x8')](_0xc546('0x9'),auth[_0xc546('0xa')](),controller[_0xc546('0xb')]);router['delete'](_0xc546('0x9'),auth[_0xc546('0xa')](),controller['destroy']);module[_0xc546('0xc')]=router; \ No newline at end of file +var _0xa304=['isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id'];(function(_0x3ba67d,_0x4a1238){var _0x2beb32=function(_0x1a5780){while(--_0x1a5780){_0x3ba67d['push'](_0x3ba67d['shift']());}};_0x2beb32(++_0x4a1238);}(_0xa304,0x164));var _0x4a30=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0xa304[_0x2074db];return _0x27324c;};'use strict';var multer=require(_0x4a30('0x0'));var util=require(_0x4a30('0x1'));var path=require(_0x4a30('0x2'));var timeout=require(_0x4a30('0x3'));var express=require(_0x4a30('0x4'));var router=express[_0x4a30('0x5')]();var fs_extra=require(_0x4a30('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4a30('0x7'));var config=require(_0x4a30('0x8'));var controller=require(_0x4a30('0x9'));router[_0x4a30('0xa')](_0x4a30('0xb'),auth[_0x4a30('0xc')](),controller[_0x4a30('0xd')]);router[_0x4a30('0xe')]('/:id',auth[_0x4a30('0xc')](),controller[_0x4a30('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 8313b7c..092360d 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 _0x68da=['sequelize','exports','STRING','name'];(function(_0x4fd31e,_0x2737da){var _0x34e019=function(_0x21bfe2){while(--_0x21bfe2){_0x4fd31e['push'](_0x4fd31e['shift']());}};_0x34e019(++_0x2737da);}(_0x68da,0x94));var _0xa68d=function(_0x23f0e1,_0x11d94b){_0x23f0e1=_0x23f0e1-0x0;var _0x257f0d=_0x68da[_0x23f0e1];return _0x257f0d;};'use strict';var Sequelize=require(_0xa68d('0x0'));module[_0xa68d('0x1')]={'name':{'type':Sequelize[_0xa68d('0x2')],'allowNull':![],'unique':_0xa68d('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xa68d('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x16eb=['STRING','exports','name'];(function(_0x2ed7d1,_0x363741){var _0x38ae3c=function(_0x4a1b42){while(--_0x4a1b42){_0x2ed7d1['push'](_0x2ed7d1['shift']());}};_0x38ae3c(++_0x363741);}(_0x16eb,0xc1));var _0xb16e=function(_0x222b3f,_0x133be7){_0x222b3f=_0x222b3f-0x0;var _0x20b57a=_0x16eb[_0x222b3f];return _0x20b57a;};'use strict';var Sequelize=require('sequelize');module[_0xb16e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb16e('0x1')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xb16e('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 1c516df..77941a0 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 _0x02ce=['role','UserProfileSection','CmContactHasItem','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','then','destroy','ContactItemTypes','UserProfileResource','end','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','user','get'];(function(_0x3936c4,_0x59b4bb){var _0x5c2e58=function(_0x35cd52){while(--_0x35cd52){_0x3936c4['push'](_0x3936c4['shift']());}};_0x5c2e58(++_0x59b4bb);}(_0x02ce,0x1ac));var _0xe02c=function(_0x418d6c,_0x5cae5c){_0x418d6c=_0x418d6c-0x0;var _0x3b94df=_0x02ce[_0x418d6c];return _0x3b94df;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];function respondWithStatusCode(_0x23d886,_0x32fc45){_0x32fc45=_0x32fc45||0xcc;return function(_0x5d6d13){if(_0x5d6d13){return _0x23d886[_0xe02c('0x1c')](_0x32fc45);}return _0x23d886['status'](_0x32fc45)['end']();};}function respondWithResult(_0x3f4e28,_0x56405a){_0x56405a=_0x56405a||0xc8;return function(_0x221910){if(_0x221910){return _0x3f4e28['status'](_0x56405a)[_0xe02c('0x1d')](_0x221910);}};}function respondWithFilteredResult(_0x4e9c6d,_0x256311){return function(_0x366893){if(_0x366893){var _0x59f2f6=typeof _0x256311[_0xe02c('0x1e')]===_0xe02c('0x1f')&&typeof _0x256311['limit']===_0xe02c('0x1f');var _0x20f492=_0x366893['count'];var _0x52917f=_0x59f2f6?0x0:_0x256311[_0xe02c('0x1e')];var _0x49604a=_0x59f2f6?_0x366893[_0xe02c('0x20')]:_0x256311[_0xe02c('0x1e')]+_0x256311[_0xe02c('0x21')];var _0x36fed0;if(_0x49604a>=_0x20f492){_0x49604a=_0x20f492;_0x36fed0=0xc8;}else{_0x36fed0=0xce;}_0x4e9c6d[_0xe02c('0x22')](_0x36fed0);return _0x4e9c6d['set'](_0xe02c('0x23'),_0x52917f+'-'+_0x49604a+'/'+_0x20f492)['json'](_0x366893);}return null;};}function patchUpdates(_0x4ea9b5){return function(_0x393621){try{jsonpatch[_0xe02c('0x24')](_0x393621,_0x4ea9b5,!![]);}catch(_0x480b9a){return BPromise[_0xe02c('0x25')](_0x480b9a);}return _0x393621[_0xe02c('0x26')]();};}function saveUpdates(_0x4ce5ee,_0x38dce2){return function(_0x45fd82){if(_0x45fd82){return _0x45fd82[_0xe02c('0x27')](_0x4ce5ee)[_0xe02c('0x28')](function(_0x2d44c8){return _0x2d44c8;});}return null;};}function removeEntity(_0x557142,_0x3e80e3){return function(_0xf41d4c){if(_0xf41d4c){return _0xf41d4c[_0xe02c('0x29')]()[_0xe02c('0x28')](function(){var _0x60b65e=_0xf41d4c['get']({'plain':!![]});var _0xefd882=_0xe02c('0x2a');return db[_0xe02c('0x2b')][_0xe02c('0x29')]({'where':{'type':_0xefd882,'resourceId':_0x60b65e['id']}})[_0xe02c('0x28')](function(){return _0xf41d4c;});})[_0xe02c('0x28')](function(){_0x557142[_0xe02c('0x22')](0xcc)[_0xe02c('0x2c')]();});}};}function handleEntityNotFound(_0x55ef2a,_0x55e475){return function(_0x3790eb){if(!_0x3790eb){_0x55ef2a[_0xe02c('0x1c')](0x194);}return _0x3790eb;};}function handleError(_0x481e02,_0x18b572){_0x18b572=_0x18b572||0x1f4;return function(_0x2d1d98){logger[_0xe02c('0x2d')](_0x2d1d98[_0xe02c('0x2e')]);if(_0x2d1d98[_0xe02c('0x2f')]){delete _0x2d1d98[_0xe02c('0x2f')];}_0x481e02[_0xe02c('0x22')](_0x18b572)[_0xe02c('0x30')](_0x2d1d98);};}exports[_0xe02c('0x31')]=function(_0x288004,_0x17d5b3){var _0x5a2da0={},_0x3c3d2c={},_0x3c1858={'count':0x0,'rows':[]};var _0x22b783=_[_0xe02c('0x32')](db[_0xe02c('0x33')][_0xe02c('0x34')],function(_0x58bf16){return{'name':_0x58bf16[_0xe02c('0x35')],'type':_0x58bf16[_0xe02c('0x36')]['key']};});_0x3c3d2c[_0xe02c('0x37')]=_[_0xe02c('0x32')](_0x22b783,_0xe02c('0x2f'));_0x3c3d2c[_0xe02c('0x38')]=_[_0xe02c('0x39')](_0x288004['query']);_0x3c3d2c['filters']=_[_0xe02c('0x3a')](_0x3c3d2c[_0xe02c('0x37')],_0x3c3d2c['query']);_0x5a2da0[_0xe02c('0x3b')]=_['intersection'](_0x3c3d2c[_0xe02c('0x37')],qs[_0xe02c('0x3c')](_0x288004[_0xe02c('0x38')][_0xe02c('0x3c')]));_0x5a2da0[_0xe02c('0x3b')]=_0x5a2da0['attributes'][_0xe02c('0x3d')]?_0x5a2da0['attributes']:_0x3c3d2c[_0xe02c('0x37')];if(!_0x288004[_0xe02c('0x38')][_0xe02c('0x3e')](_0xe02c('0x3f'))){_0x5a2da0[_0xe02c('0x21')]=qs[_0xe02c('0x21')](_0x288004['query'][_0xe02c('0x21')]);_0x5a2da0[_0xe02c('0x1e')]=qs['offset'](_0x288004[_0xe02c('0x38')][_0xe02c('0x1e')]);}_0x5a2da0['order']=qs[_0xe02c('0x40')](_0x288004['query'][_0xe02c('0x40')]);_0x5a2da0[_0xe02c('0x41')]=qs['filters'](_[_0xe02c('0x42')](_0x288004[_0xe02c('0x38')],_0x3c3d2c[_0xe02c('0x43')]),_0x22b783);if(_0x288004[_0xe02c('0x38')][_0xe02c('0x44')]){_0x5a2da0[_0xe02c('0x41')]=_['merge'](_0x5a2da0[_0xe02c('0x41')],{'$or':_['map'](_0x22b783,function(_0x5ae8cd){if(_0x5ae8cd[_0xe02c('0x36')]!==_0xe02c('0x45')){var _0x42fbac={};_0x42fbac[_0x5ae8cd[_0xe02c('0x2f')]]={'$like':'%'+_0x288004['query'][_0xe02c('0x44')]+'%'};return _0x42fbac;}})});}_0x5a2da0=_[_0xe02c('0x46')]({},_0x5a2da0,_0x288004[_0xe02c('0x47')]);var _0x5baef6={'where':_0x5a2da0['where']};return db[_0xe02c('0x33')][_0xe02c('0x20')](_0x5baef6)[_0xe02c('0x28')](function(_0x2313d2){_0x3c1858[_0xe02c('0x20')]=_0x2313d2;if(_0x288004[_0xe02c('0x38')][_0xe02c('0x48')]){_0x5a2da0[_0xe02c('0x49')]=[{'all':!![]}];}return db[_0xe02c('0x33')]['findAll'](_0x5a2da0);})[_0xe02c('0x28')](function(_0x5ef4a1){_0x3c1858['rows']=_0x5ef4a1;return _0x3c1858;})[_0xe02c('0x28')](respondWithFilteredResult(_0x17d5b3,_0x5a2da0))[_0xe02c('0x4a')](handleError(_0x17d5b3,null));};exports[_0xe02c('0x4b')]=function(_0x1719cf,_0x24d506){var _0x12ca0e={'raw':!![],'where':{'id':_0x1719cf[_0xe02c('0x4c')]['id']}},_0x165f4a={};_0x165f4a['model']=_['keys'](db[_0xe02c('0x33')][_0xe02c('0x34')]);_0x165f4a[_0xe02c('0x38')]=_['keys'](_0x1719cf[_0xe02c('0x38')]);_0x165f4a[_0xe02c('0x43')]=_[_0xe02c('0x3a')](_0x165f4a[_0xe02c('0x37')],_0x165f4a[_0xe02c('0x38')]);_0x12ca0e[_0xe02c('0x3b')]=_[_0xe02c('0x3a')](_0x165f4a[_0xe02c('0x37')],qs[_0xe02c('0x3c')](_0x1719cf[_0xe02c('0x38')]['fields']));_0x12ca0e[_0xe02c('0x3b')]=_0x12ca0e[_0xe02c('0x3b')][_0xe02c('0x3d')]?_0x12ca0e[_0xe02c('0x3b')]:_0x165f4a[_0xe02c('0x37')];if(_0x1719cf[_0xe02c('0x38')][_0xe02c('0x48')]){_0x12ca0e[_0xe02c('0x49')]=[{'all':!![]}];}_0x12ca0e=_[_0xe02c('0x46')]({},_0x12ca0e,_0x1719cf[_0xe02c('0x47')]);return db[_0xe02c('0x33')][_0xe02c('0x4d')](_0x12ca0e)[_0xe02c('0x28')](handleEntityNotFound(_0x24d506,null))['then'](respondWithResult(_0x24d506,null))[_0xe02c('0x4a')](handleError(_0x24d506,null));};exports['create']=function(_0x15b05c,_0x324911){return db[_0xe02c('0x33')][_0xe02c('0x4e')](_0x15b05c[_0xe02c('0x4f')],{})[_0xe02c('0x28')](function(_0x160969){var _0xc2b5dd=_0x15b05c[_0xe02c('0x50')][_0xe02c('0x51')]({'plain':!![]});if(!_0xc2b5dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc2b5dd[_0xe02c('0x52')]===_0xe02c('0x50')){var _0xeb4214=_0x160969['get']({'plain':!![]});var _0xdab6cb='ContactItemTypes';return db[_0xe02c('0x53')]['find']({'where':{'name':_0xdab6cb,'userProfileId':_0xc2b5dd['userProfileId']},'raw':!![]})['then'](function(_0x55cf99){if(_0x55cf99&&_0x55cf99['autoAssociation']===0x0){return db['UserProfileResource'][_0xe02c('0x4e')]({'name':_0xeb4214[_0xe02c('0x2f')],'resourceId':_0xeb4214['id'],'type':_0x55cf99[_0xe02c('0x2f')],'sectionId':_0x55cf99['id']},{})[_0xe02c('0x28')](function(){return _0x160969;});}else{return _0x160969;}})['catch'](function(_0x274beb){logger[_0xe02c('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x274beb);throw _0x274beb;});}return _0x160969;})[_0xe02c('0x28')](respondWithResult(_0x324911,0xc9))[_0xe02c('0x4a')](handleError(_0x324911,null));};exports[_0xe02c('0x27')]=function(_0x51f940,_0x57a00f){if(_0x51f940[_0xe02c('0x4f')]['id']){delete _0x51f940[_0xe02c('0x4f')]['id'];}return db[_0xe02c('0x33')]['find']({'where':{'id':_0x51f940[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x57a00f,null))['then'](saveUpdates(_0x51f940[_0xe02c('0x4f')],null))[_0xe02c('0x28')](respondWithResult(_0x57a00f,null))['catch'](handleError(_0x57a00f,null));};exports[_0xe02c('0x29')]=function(_0x849eea,_0x1ead72){return db['ContactItemType'][_0xe02c('0x4d')]({'where':{'id':_0x849eea[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ead72,null))[_0xe02c('0x28')](db[_0xe02c('0x54')][_0xe02c('0x27')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x849eea[_0xe02c('0x4c')]['id']}}))[_0xe02c('0x28')](removeEntity(_0x1ead72,null))[_0xe02c('0x4a')](handleError(_0x1ead72,null));}; \ No newline at end of file +var _0x0120=['intersection','attributes','fields','length','nolimit','order','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','ContactItemType','rawAttributes','type','key','model','query','keys','filters'];(function(_0x5239c5,_0x58dd53){var _0x42d766=function(_0x324853){while(--_0x324853){_0x5239c5['push'](_0x5239c5['shift']());}};_0x42d766(++_0x58dd53);}(_0x0120,0x6f));var _0x0012=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0120[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x0012('0x0'));var rimraf=require(_0x0012('0x1'));var zipdir=require(_0x0012('0x2'));var jsonpatch=require(_0x0012('0x3'));var rp=require(_0x0012('0x4'));var moment=require(_0x0012('0x5'));var BPromise=require(_0x0012('0x6'));var Mustache=require(_0x0012('0x7'));var util=require(_0x0012('0x8'));var path=require(_0x0012('0x9'));var sox=require(_0x0012('0xa'));var csv=require(_0x0012('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0012('0xc'));var crypto=require(_0x0012('0xd'));var jsforce=require(_0x0012('0xe'));var deskjs=require(_0x0012('0xf'));var toCsv=require(_0x0012('0xb'));var querystring=require('querystring');var Papa=require(_0x0012('0x10'));var Redis=require(_0x0012('0x11'));var authService=require(_0x0012('0x12'));var qs=require(_0x0012('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0012('0x14'));var logger=require('../../config/logger')(_0x0012('0x15'));var utils=require(_0x0012('0x16'));var config=require(_0x0012('0x17'));var licenseUtil=require(_0x0012('0x18'));var db=require(_0x0012('0x19'))['db'];function respondWithStatusCode(_0x4d3e7a,_0x6d4a1a){_0x6d4a1a=_0x6d4a1a||0xcc;return function(_0x4f0ee1){if(_0x4f0ee1){return _0x4d3e7a['sendStatus'](_0x6d4a1a);}return _0x4d3e7a['status'](_0x6d4a1a)['end']();};}function respondWithResult(_0x3a7d50,_0x496a2b){_0x496a2b=_0x496a2b||0xc8;return function(_0x3995fd){if(_0x3995fd){return _0x3a7d50[_0x0012('0x1a')](_0x496a2b)['json'](_0x3995fd);}};}function respondWithFilteredResult(_0x24f4ed,_0x1a0c0d){return function(_0x348810){if(_0x348810){var _0x3b8dfc=typeof _0x1a0c0d['offset']==='undefined'&&typeof _0x1a0c0d[_0x0012('0x1b')]===_0x0012('0x1c');var _0x3948bf=_0x348810[_0x0012('0x1d')];var _0x1d0423=_0x3b8dfc?0x0:_0x1a0c0d[_0x0012('0x1e')];var _0x1e78ee=_0x3b8dfc?_0x348810[_0x0012('0x1d')]:_0x1a0c0d['offset']+_0x1a0c0d[_0x0012('0x1b')];var _0x56b0e1;if(_0x1e78ee>=_0x3948bf){_0x1e78ee=_0x3948bf;_0x56b0e1=0xc8;}else{_0x56b0e1=0xce;}_0x24f4ed['status'](_0x56b0e1);return _0x24f4ed[_0x0012('0x1f')](_0x0012('0x20'),_0x1d0423+'-'+_0x1e78ee+'/'+_0x3948bf)[_0x0012('0x21')](_0x348810);}return null;};}function patchUpdates(_0x2c837e){return function(_0x53ac2d){try{jsonpatch['apply'](_0x53ac2d,_0x2c837e,!![]);}catch(_0x460d82){return BPromise[_0x0012('0x22')](_0x460d82);}return _0x53ac2d[_0x0012('0x23')]();};}function saveUpdates(_0x7177bc,_0x190f07){return function(_0x2e6a2c){if(_0x2e6a2c){return _0x2e6a2c[_0x0012('0x24')](_0x7177bc)[_0x0012('0x25')](function(_0x57487e){return _0x57487e;});}return null;};}function removeEntity(_0x24674c,_0x24a280){return function(_0x4cf4bd){if(_0x4cf4bd){return _0x4cf4bd[_0x0012('0x26')]()[_0x0012('0x25')](function(){var _0x340622=_0x4cf4bd[_0x0012('0x27')]({'plain':!![]});var _0x42bcd7='ContactItemTypes';return db[_0x0012('0x28')][_0x0012('0x26')]({'where':{'type':_0x42bcd7,'resourceId':_0x340622['id']}})[_0x0012('0x25')](function(){return _0x4cf4bd;});})[_0x0012('0x25')](function(){_0x24674c[_0x0012('0x1a')](0xcc)[_0x0012('0x29')]();});}};}function handleEntityNotFound(_0x15d48a,_0xf3781e){return function(_0x300e13){if(!_0x300e13){_0x15d48a[_0x0012('0x2a')](0x194);}return _0x300e13;};}function handleError(_0x34efc7,_0x20b78f){_0x20b78f=_0x20b78f||0x1f4;return function(_0x45c3ca){logger[_0x0012('0x2b')](_0x45c3ca[_0x0012('0x2c')]);if(_0x45c3ca[_0x0012('0x2d')]){delete _0x45c3ca[_0x0012('0x2d')];}_0x34efc7[_0x0012('0x1a')](_0x20b78f)[_0x0012('0x2e')](_0x45c3ca);};}exports[_0x0012('0x2f')]=function(_0x1bb14d,_0x4d0998){var _0x283134={},_0x1bb49b={},_0x4c2601={'count':0x0,'rows':[]};var _0x2fa6a2=_[_0x0012('0x30')](db[_0x0012('0x31')][_0x0012('0x32')],function(_0x287b05){return{'name':_0x287b05['fieldName'],'type':_0x287b05[_0x0012('0x33')][_0x0012('0x34')]};});_0x1bb49b[_0x0012('0x35')]=_['map'](_0x2fa6a2,_0x0012('0x2d'));_0x1bb49b[_0x0012('0x36')]=_[_0x0012('0x37')](_0x1bb14d[_0x0012('0x36')]);_0x1bb49b[_0x0012('0x38')]=_[_0x0012('0x39')](_0x1bb49b['model'],_0x1bb49b[_0x0012('0x36')]);_0x283134[_0x0012('0x3a')]=_[_0x0012('0x39')](_0x1bb49b[_0x0012('0x35')],qs['fields'](_0x1bb14d['query'][_0x0012('0x3b')]));_0x283134[_0x0012('0x3a')]=_0x283134[_0x0012('0x3a')][_0x0012('0x3c')]?_0x283134[_0x0012('0x3a')]:_0x1bb49b[_0x0012('0x35')];if(!_0x1bb14d[_0x0012('0x36')]['hasOwnProperty'](_0x0012('0x3d'))){_0x283134[_0x0012('0x1b')]=qs['limit'](_0x1bb14d[_0x0012('0x36')][_0x0012('0x1b')]);_0x283134[_0x0012('0x1e')]=qs[_0x0012('0x1e')](_0x1bb14d[_0x0012('0x36')][_0x0012('0x1e')]);}_0x283134[_0x0012('0x3e')]=qs['sort'](_0x1bb14d[_0x0012('0x36')]['sort']);_0x283134[_0x0012('0x3f')]=qs['filters'](_['pick'](_0x1bb14d[_0x0012('0x36')],_0x1bb49b[_0x0012('0x38')]),_0x2fa6a2);if(_0x1bb14d[_0x0012('0x36')]['filter']){_0x283134[_0x0012('0x3f')]=_[_0x0012('0x40')](_0x283134[_0x0012('0x3f')],{'$or':_[_0x0012('0x30')](_0x2fa6a2,function(_0x3d81ed){if(_0x3d81ed[_0x0012('0x33')]!==_0x0012('0x41')){var _0x11f001={};_0x11f001[_0x3d81ed['name']]={'$like':'%'+_0x1bb14d[_0x0012('0x36')][_0x0012('0x42')]+'%'};return _0x11f001;}})});}_0x283134=_[_0x0012('0x40')]({},_0x283134,_0x1bb14d[_0x0012('0x43')]);var _0x42e01c={'where':_0x283134[_0x0012('0x3f')]};return db[_0x0012('0x31')]['count'](_0x42e01c)['then'](function(_0x1c54de){_0x4c2601['count']=_0x1c54de;if(_0x1bb14d[_0x0012('0x36')][_0x0012('0x44')]){_0x283134[_0x0012('0x45')]=[{'all':!![]}];}return db[_0x0012('0x31')][_0x0012('0x46')](_0x283134);})['then'](function(_0x1bd93a){_0x4c2601[_0x0012('0x47')]=_0x1bd93a;return _0x4c2601;})['then'](respondWithFilteredResult(_0x4d0998,_0x283134))[_0x0012('0x48')](handleError(_0x4d0998,null));};exports[_0x0012('0x49')]=function(_0x422c06,_0x207b61){var _0x5259c2={'raw':!![],'where':{'id':_0x422c06[_0x0012('0x4a')]['id']}},_0x4ba00e={};_0x4ba00e['model']=_[_0x0012('0x37')](db['ContactItemType'][_0x0012('0x32')]);_0x4ba00e[_0x0012('0x36')]=_[_0x0012('0x37')](_0x422c06[_0x0012('0x36')]);_0x4ba00e['filters']=_[_0x0012('0x39')](_0x4ba00e['model'],_0x4ba00e[_0x0012('0x36')]);_0x5259c2[_0x0012('0x3a')]=_[_0x0012('0x39')](_0x4ba00e[_0x0012('0x35')],qs[_0x0012('0x3b')](_0x422c06[_0x0012('0x36')][_0x0012('0x3b')]));_0x5259c2['attributes']=_0x5259c2[_0x0012('0x3a')][_0x0012('0x3c')]?_0x5259c2[_0x0012('0x3a')]:_0x4ba00e[_0x0012('0x35')];if(_0x422c06[_0x0012('0x36')][_0x0012('0x44')]){_0x5259c2['include']=[{'all':!![]}];}_0x5259c2=_['merge']({},_0x5259c2,_0x422c06['options']);return db['ContactItemType'][_0x0012('0x4b')](_0x5259c2)[_0x0012('0x25')](handleEntityNotFound(_0x207b61,null))[_0x0012('0x25')](respondWithResult(_0x207b61,null))[_0x0012('0x48')](handleError(_0x207b61,null));};exports[_0x0012('0x4c')]=function(_0x53d552,_0x44ffaf){return db[_0x0012('0x31')][_0x0012('0x4c')](_0x53d552[_0x0012('0x4d')],{})[_0x0012('0x25')](function(_0x564bc4){var _0x156490=_0x53d552[_0x0012('0x4e')][_0x0012('0x27')]({'plain':!![]});if(!_0x156490)throw new Error(_0x0012('0x4f'));if(_0x156490[_0x0012('0x50')]==='user'){var _0x2389cd=_0x564bc4[_0x0012('0x27')]({'plain':!![]});var _0x46e6d9='ContactItemTypes';return db[_0x0012('0x51')][_0x0012('0x4b')]({'where':{'name':_0x46e6d9,'userProfileId':_0x156490[_0x0012('0x52')]},'raw':!![]})[_0x0012('0x25')](function(_0x27a650){if(_0x27a650&&_0x27a650['autoAssociation']===0x0){return db[_0x0012('0x28')]['create']({'name':_0x2389cd[_0x0012('0x2d')],'resourceId':_0x2389cd['id'],'type':_0x27a650[_0x0012('0x2d')],'sectionId':_0x27a650['id']},{})['then'](function(){return _0x564bc4;});}else{return _0x564bc4;}})[_0x0012('0x48')](function(_0x19cf31){logger[_0x0012('0x2b')](_0x0012('0x53'),_0x19cf31);throw _0x19cf31;});}return _0x564bc4;})[_0x0012('0x25')](respondWithResult(_0x44ffaf,0xc9))[_0x0012('0x48')](handleError(_0x44ffaf,null));};exports['update']=function(_0x14ac2d,_0x1a91eb){if(_0x14ac2d[_0x0012('0x4d')]['id']){delete _0x14ac2d[_0x0012('0x4d')]['id'];}return db['ContactItemType'][_0x0012('0x4b')]({'where':{'id':_0x14ac2d[_0x0012('0x4a')]['id']}})[_0x0012('0x25')](handleEntityNotFound(_0x1a91eb,null))['then'](saveUpdates(_0x14ac2d[_0x0012('0x4d')],null))[_0x0012('0x25')](respondWithResult(_0x1a91eb,null))[_0x0012('0x48')](handleError(_0x1a91eb,null));};exports[_0x0012('0x26')]=function(_0x1a48d9,_0x53e967){return db[_0x0012('0x31')][_0x0012('0x4b')]({'where':{'id':_0x1a48d9[_0x0012('0x4a')]['id']}})[_0x0012('0x25')](handleEntityNotFound(_0x53e967,null))[_0x0012('0x25')](db['CmContactHasItem']['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1a48d9[_0x0012('0x4a')]['id']}}))[_0x0012('0x25')](removeEntity(_0x53e967,null))[_0x0012('0x48')](handleError(_0x53e967,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 1fd788a..c16c632 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 _0x6151=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ContactItemType','tools_contact_item_types','lodash'];(function(_0x5e5759,_0x3a33ce){var _0x5f040e=function(_0x3516be){while(--_0x3516be){_0x5e5759['push'](_0x5e5759['shift']());}};_0x5f040e(++_0x3a33ce);}(_0x6151,0xb5));var _0x1615=function(_0x5201a7,_0x21f8bf){_0x5201a7=_0x5201a7-0x0;var _0x435d26=_0x6151[_0x5201a7];return _0x435d26;};'use strict';var _=require(_0x1615('0x0'));var util=require(_0x1615('0x1'));var logger=require(_0x1615('0x2'))(_0x1615('0x3'));var moment=require(_0x1615('0x4'));var BPromise=require(_0x1615('0x5'));var rp=require(_0x1615('0x6'));var fs=require('fs');var path=require(_0x1615('0x7'));var rimraf=require(_0x1615('0x8'));var config=require(_0x1615('0x9'));var attributes=require('./contactItemType.attributes');module[_0x1615('0xa')]=function(_0x5e03eb,_0x43f7ef){return _0x5e03eb[_0x1615('0xb')](_0x1615('0xc'),attributes,{'tableName':_0x1615('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbbc=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','tools_contact_item_types','lodash'];(function(_0x103913,_0x21f01e){var _0x5e2158=function(_0xeee212){while(--_0xeee212){_0x103913['push'](_0x103913['shift']());}};_0x5e2158(++_0x21f01e);}(_0xdbbc,0x1f3));var _0xcdbb=function(_0x1b3335,_0x2b2f52){_0x1b3335=_0x1b3335-0x0;var _0x300d95=_0xdbbc[_0x1b3335];return _0x300d95;};'use strict';var _=require(_0xcdbb('0x0'));var util=require(_0xcdbb('0x1'));var logger=require(_0xcdbb('0x2'))(_0xcdbb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcdbb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcdbb('0x5'));var config=require(_0xcdbb('0x6'));var attributes=require('./contactItemType.attributes');module[_0xcdbb('0x7')]=function(_0x59850c,_0x2484d1){return _0x59850c[_0xcdbb('0x8')]('ContactItemType',attributes,{'tableName':_0xcdbb('0x9'),'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 2b51d36..e20d9cf 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 _0xa846=['jayson/promise','client','http','then','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x292f6d,_0x47073b){var _0x21a98=function(_0x4246f7){while(--_0x4246f7){_0x292f6d['push'](_0x292f6d['shift']());}};_0x21a98(++_0x47073b);}(_0xa846,0x12a));var _0x6a84=function(_0x3720ad,_0xb5b9da){_0x3720ad=_0x3720ad-0x0;var _0x11cf62=_0xa846[_0x3720ad];return _0x11cf62;};'use strict';var _=require(_0x6a84('0x0'));var util=require(_0x6a84('0x1'));var moment=require(_0x6a84('0x2'));var BPromise=require(_0x6a84('0x3'));var rs=require(_0x6a84('0x4'));var fs=require('fs');var Redis=require(_0x6a84('0x5'));var db=require(_0x6a84('0x6'))['db'];var utils=require(_0x6a84('0x7'));var logger=require(_0x6a84('0x8'))(_0x6a84('0x9'));var config=require('../../config/environment');var jayson=require(_0x6a84('0xa'));var client=jayson[_0x6a84('0xb')][_0x6a84('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ca80d,_0x39d4ed,_0x360827){return new BPromise(function(_0xe79de7,_0x4d411e){return client['request'](_0x1ca80d,_0x360827)[_0x6a84('0xd')](function(_0x1ced63){logger['info'](_0x6a84('0xe'),_0x39d4ed,'request\x20sent');logger[_0x6a84('0xf')](_0x6a84('0x10'),_0x39d4ed,'request\x20sent',JSON[_0x6a84('0x11')](_0x1ced63));if(_0x1ced63[_0x6a84('0x12')]){if(_0x1ced63[_0x6a84('0x12')]['code']===0x1f4){logger[_0x6a84('0x12')](_0x6a84('0xe'),_0x39d4ed,_0x1ced63[_0x6a84('0x12')][_0x6a84('0x13')]);return _0x4d411e(_0x1ced63[_0x6a84('0x12')]['message']);}logger[_0x6a84('0x12')](_0x6a84('0xe'),_0x39d4ed,_0x1ced63['error']['message']);return _0xe79de7(_0x1ced63[_0x6a84('0x12')]['message']);}else{logger[_0x6a84('0x14')](_0x6a84('0xe'),_0x39d4ed,'request\x20sent');_0xe79de7(_0x1ced63['result']['message']);}})[_0x6a84('0x15')](function(_0x14a0fb){logger[_0x6a84('0x12')](_0x6a84('0xe'),_0x39d4ed,_0x14a0fb);_0x4d411e(_0x14a0fb);});});} \ No newline at end of file +var _0x7341=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','error','code','message','lodash','bluebird','ioredis'];(function(_0x3e45bb,_0x3dcb24){var _0x2d5f2b=function(_0x58e900){while(--_0x58e900){_0x3e45bb['push'](_0x3e45bb['shift']());}};_0x2d5f2b(++_0x3dcb24);}(_0x7341,0x1d1));var _0x1734=function(_0xb7b7ab,_0x29e27f){_0xb7b7ab=_0xb7b7ab-0x0;var _0x564b22=_0x7341[_0xb7b7ab];return _0x564b22;};'use strict';var _=require(_0x1734('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1734('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1734('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1734('0x3'));var logger=require(_0x1734('0x4'))(_0x1734('0x5'));var config=require(_0x1734('0x6'));var jayson=require(_0x1734('0x7'));var client=jayson[_0x1734('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5453e5,_0x300292,_0x2b597b){return new BPromise(function(_0x2520ac,_0x5e357b){return client[_0x1734('0x9')](_0x5453e5,_0x2b597b)[_0x1734('0xa')](function(_0x3a5e23){logger[_0x1734('0xb')](_0x1734('0xc'),_0x300292,_0x1734('0xd'));logger[_0x1734('0xe')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x300292,_0x1734('0xd'),JSON['stringify'](_0x3a5e23));if(_0x3a5e23['error']){if(_0x3a5e23[_0x1734('0xf')][_0x1734('0x10')]===0x1f4){logger[_0x1734('0xf')](_0x1734('0xc'),_0x300292,_0x3a5e23[_0x1734('0xf')]['message']);return _0x5e357b(_0x3a5e23['error'][_0x1734('0x11')]);}logger['error']('ContactItemType,\x20%s,\x20%s',_0x300292,_0x3a5e23[_0x1734('0xf')]['message']);return _0x2520ac(_0x3a5e23[_0x1734('0xf')]['message']);}else{logger[_0x1734('0xb')]('ContactItemType,\x20%s,\x20%s',_0x300292,'request\x20sent');_0x2520ac(_0x3a5e23['result'][_0x1734('0x11')]);}})['catch'](function(_0x37595c){logger[_0x1734('0xf')](_0x1734('0xc'),_0x300292,_0x37595c);_0x5e357b(_0x37595c);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 9cfab94..90d491c 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 _0xcc6b=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x18bd69,_0x5883ce){var _0x13f294=function(_0x276808){while(--_0x276808){_0x18bd69['push'](_0x18bd69['shift']());}};_0x13f294(++_0x5883ce);}(_0xcc6b,0x18d));var _0xbcc6=function(_0x3cf987,_0x527be2){_0x3cf987=_0x3cf987-0x0;var _0x48e399=_0xcc6b[_0x3cf987];return _0x48e399;};'use strict';var multer=require(_0xbcc6('0x0'));var util=require(_0xbcc6('0x1'));var path=require(_0xbcc6('0x2'));var timeout=require(_0xbcc6('0x3'));var express=require(_0xbcc6('0x4'));var router=express['Router']();var fs_extra=require(_0xbcc6('0x5'));var auth=require(_0xbcc6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbcc6('0x7'));var controller=require(_0xbcc6('0x8'));router[_0xbcc6('0x9')]('/',auth[_0xbcc6('0xa')](),controller[_0xbcc6('0xb')]);router[_0xbcc6('0x9')](_0xbcc6('0xc'),auth[_0xbcc6('0xa')](),controller[_0xbcc6('0xd')]);router[_0xbcc6('0xe')]('/',auth[_0xbcc6('0xa')](),controller['create']);router[_0xbcc6('0xf')](_0xbcc6('0xc'),auth[_0xbcc6('0xa')](),controller[_0xbcc6('0x10')]);router['delete']('/:id',auth[_0xbcc6('0xa')](),controller['destroy']);module[_0xbcc6('0x11')]=router; \ No newline at end of file +var _0x86d8=['./contactItemType.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x86d8,0xc9));var _0x886d=function(_0x18b97c,_0x142f1e){_0x18b97c=_0x18b97c-0x0;var _0x3c99e4=_0x86d8[_0x18b97c];return _0x3c99e4;};'use strict';var multer=require(_0x886d('0x0'));var util=require(_0x886d('0x1'));var path=require(_0x886d('0x2'));var timeout=require(_0x886d('0x3'));var express=require(_0x886d('0x4'));var router=express[_0x886d('0x5')]();var fs_extra=require(_0x886d('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x886d('0x7'));var controller=require(_0x886d('0x8'));router[_0x886d('0x9')]('/',auth['isAuthenticated'](),controller[_0x886d('0xa')]);router[_0x886d('0x9')](_0x886d('0xb'),auth[_0x886d('0xc')](),controller['show']);router[_0x886d('0xd')]('/',auth[_0x886d('0xc')](),controller[_0x886d('0xe')]);router[_0x886d('0xf')](_0x886d('0xb'),auth['isAuthenticated'](),controller[_0x886d('0x10')]);router[_0x886d('0x11')]('/:id',auth[_0x886d('0xc')](),controller[_0x886d('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 888d3d7..4305d78 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 _0x757a=['exports','STRING'];(function(_0x494a80,_0x4a5b20){var _0x20b8d6=function(_0x5c016c){while(--_0x5c016c){_0x494a80['push'](_0x494a80['shift']());}};_0x20b8d6(++_0x4a5b20);}(_0x757a,0xde));var _0xa757=function(_0x287d2a,_0x419f3b){_0x287d2a=_0x287d2a-0x0;var _0x33104c=_0x757a[_0x287d2a];return _0x33104c;};'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 +var _0x2032=['name','exports','STRING'];(function(_0x2923ce,_0x4ba677){var _0x1c54fe=function(_0x19762a){while(--_0x19762a){_0x2923ce['push'](_0x2923ce['shift']());}};_0x1c54fe(++_0x4ba677);}(_0x2032,0xd9));var _0x2203=function(_0xa9b83f,_0x72e317){_0xa9b83f=_0xa9b83f-0x0;var _0x19d03a=_0x2032[_0xa9b83f];return _0x19d03a;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 288bf0c..2a71687 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 _0xd782=['api','../../config/environment','../../config/license/util','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrs','value','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','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd782,0x171));var _0x2d78=function(_0x157fdf,_0xbd5ade){_0x157fdf=_0x157fdf-0x0;var _0x152177=_0xd782[_0x157fdf];return _0x152177;};'use strict';var emlformat=require(_0x2d78('0x0'));var rimraf=require(_0x2d78('0x1'));var zipdir=require(_0x2d78('0x2'));var jsonpatch=require(_0x2d78('0x3'));var rp=require(_0x2d78('0x4'));var moment=require(_0x2d78('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2d78('0x6'));var util=require(_0x2d78('0x7'));var path=require(_0x2d78('0x8'));var sox=require(_0x2d78('0x9'));var csv=require(_0x2d78('0xa'));var ejs=require(_0x2d78('0xb'));var fs=require('fs');var fs_extra=require(_0x2d78('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2d78('0xd'));var deskjs=require(_0x2d78('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2d78('0xf'));var Papa=require(_0x2d78('0x10'));var Redis=require(_0x2d78('0x11'));var authService=require(_0x2d78('0x12'));var qs=require(_0x2d78('0x13'));var as=require(_0x2d78('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2d78('0x15'));var utils=require('../../config/utils');var config=require(_0x2d78('0x16'));var licenseUtil=require(_0x2d78('0x17'));var db=require('../../mysqldb')['db'];config[_0x2d78('0x18')]=_[_0x2d78('0x19')](config[_0x2d78('0x18')],{'host':_0x2d78('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x1e679d,_0x36101f){_0x36101f=_0x36101f||0xcc;return function(_0x1c840a){if(_0x1c840a){return _0x1e679d[_0x2d78('0x1b')](_0x36101f);}return _0x1e679d[_0x2d78('0x1c')](_0x36101f)[_0x2d78('0x1d')]();};}function respondWithResult(_0x50d35a,_0x5bf71e){_0x5bf71e=_0x5bf71e||0xc8;return function(_0x32bc47){if(_0x32bc47){return _0x50d35a[_0x2d78('0x1c')](_0x5bf71e)[_0x2d78('0x1e')](_0x32bc47);}};}function respondWithFilteredResult(_0x589521,_0x3bccf2){return function(_0x5df979){if(_0x5df979){var _0x5cd7a3=typeof _0x3bccf2[_0x2d78('0x1f')]===_0x2d78('0x20')&&typeof _0x3bccf2[_0x2d78('0x21')]===_0x2d78('0x20');var _0x537ade=_0x5df979['count'];var _0x48b60c=_0x5cd7a3?0x0:_0x3bccf2[_0x2d78('0x1f')];var _0x27b0a2=_0x5cd7a3?_0x5df979[_0x2d78('0x22')]:_0x3bccf2['offset']+_0x3bccf2[_0x2d78('0x21')];var _0x2dbb34;if(_0x27b0a2>=_0x537ade){_0x27b0a2=_0x537ade;_0x2dbb34=0xc8;}else{_0x2dbb34=0xce;}_0x589521[_0x2d78('0x1c')](_0x2dbb34);return _0x589521[_0x2d78('0x23')](_0x2d78('0x24'),_0x48b60c+'-'+_0x27b0a2+'/'+_0x537ade)[_0x2d78('0x1e')](_0x5df979);}return null;};}function patchUpdates(_0x793f7b){return function(_0x54a66c){try{jsonpatch[_0x2d78('0x25')](_0x54a66c,_0x793f7b,!![]);}catch(_0x228840){return BPromise[_0x2d78('0x26')](_0x228840);}return _0x54a66c['save']();};}function saveUpdates(_0x5b5bda,_0x270d48){return function(_0x731157){if(_0x731157){return _0x731157[_0x2d78('0x27')](_0x5b5bda)[_0x2d78('0x28')](function(_0x350ba1){return _0x350ba1;});}return null;};}function removeEntity(_0x594a66,_0x27f9dc){return function(_0x12d50a){if(_0x12d50a){return _0x12d50a[_0x2d78('0x29')]()[_0x2d78('0x28')](function(){var _0x557864=_0x12d50a[_0x2d78('0x2a')]({'plain':!![]});var _0x2becfe='CustomDashboards';return db[_0x2d78('0x2b')][_0x2d78('0x29')]({'where':{'type':_0x2becfe,'resourceId':_0x557864['id']}})[_0x2d78('0x28')](function(){return _0x12d50a;});})[_0x2d78('0x28')](function(){_0x594a66[_0x2d78('0x1c')](0xcc)[_0x2d78('0x1d')]();});}};}function handleEntityNotFound(_0xb377a0,_0x691774){return function(_0x4ee262){if(!_0x4ee262){_0xb377a0[_0x2d78('0x1b')](0x194);}return _0x4ee262;};}function handleError(_0x110c46,_0x47cea5){_0x47cea5=_0x47cea5||0x1f4;return function(_0x29315b){logger[_0x2d78('0x2c')](_0x29315b[_0x2d78('0x2d')]);if(_0x29315b[_0x2d78('0x2e')]){delete _0x29315b[_0x2d78('0x2e')];}_0x110c46[_0x2d78('0x1c')](_0x47cea5)[_0x2d78('0x2f')](_0x29315b);};}exports[_0x2d78('0x30')]=function(_0x2b9ac4,_0x220fec){var _0x3241cd={},_0x3faf60={},_0x1696b3={'count':0x0,'rows':[]};var _0x363cef=_[_0x2d78('0x31')](db[_0x2d78('0x32')][_0x2d78('0x33')],function(_0x28cfda){return{'name':_0x28cfda[_0x2d78('0x34')],'type':_0x28cfda[_0x2d78('0x35')]['key']};});_0x3faf60[_0x2d78('0x36')]=_['map'](_0x363cef,_0x2d78('0x2e'));_0x3faf60['query']=_[_0x2d78('0x37')](_0x2b9ac4[_0x2d78('0x38')]);_0x3faf60[_0x2d78('0x39')]=_[_0x2d78('0x3a')](_0x3faf60[_0x2d78('0x36')],_0x3faf60[_0x2d78('0x38')]);_0x3241cd[_0x2d78('0x3b')]=_[_0x2d78('0x3a')](_0x3faf60['model'],qs[_0x2d78('0x3c')](_0x2b9ac4['query'][_0x2d78('0x3c')]));_0x3241cd[_0x2d78('0x3b')]=_0x3241cd[_0x2d78('0x3b')][_0x2d78('0x3d')]?_0x3241cd[_0x2d78('0x3b')]:_0x3faf60['model'];if(!_0x2b9ac4[_0x2d78('0x38')][_0x2d78('0x3e')](_0x2d78('0x3f'))){_0x3241cd[_0x2d78('0x21')]=qs[_0x2d78('0x21')](_0x2b9ac4[_0x2d78('0x38')][_0x2d78('0x21')]);_0x3241cd[_0x2d78('0x1f')]=qs[_0x2d78('0x1f')](_0x2b9ac4[_0x2d78('0x38')][_0x2d78('0x1f')]);}_0x3241cd[_0x2d78('0x40')]=qs[_0x2d78('0x41')](_0x2b9ac4[_0x2d78('0x38')]['sort']);_0x3241cd['where']=qs[_0x2d78('0x39')](_[_0x2d78('0x42')](_0x2b9ac4[_0x2d78('0x38')],_0x3faf60[_0x2d78('0x39')]),_0x363cef);if(_0x2b9ac4[_0x2d78('0x38')][_0x2d78('0x43')]){_0x3241cd[_0x2d78('0x44')]=_[_0x2d78('0x45')](_0x3241cd[_0x2d78('0x44')],{'$or':_[_0x2d78('0x31')](_0x363cef,function(_0x5d7b5c){if(_0x5d7b5c[_0x2d78('0x35')]!==_0x2d78('0x46')){var _0x3d275a={};_0x3d275a[_0x5d7b5c[_0x2d78('0x2e')]]={'$like':'%'+_0x2b9ac4[_0x2d78('0x38')][_0x2d78('0x43')]+'%'};return _0x3d275a;}})});}_0x3241cd=_['merge']({},_0x3241cd,_0x2b9ac4['options']);var _0xbb1a3c={'where':_0x3241cd[_0x2d78('0x44')]};return db[_0x2d78('0x32')]['count'](_0xbb1a3c)[_0x2d78('0x28')](function(_0x3dd8ed){_0x1696b3[_0x2d78('0x22')]=_0x3dd8ed;if(_0x2b9ac4[_0x2d78('0x38')][_0x2d78('0x47')]){_0x3241cd[_0x2d78('0x48')]=[{'all':!![]}];}return db[_0x2d78('0x32')][_0x2d78('0x49')](_0x3241cd);})[_0x2d78('0x28')](function(_0x5817e5){_0x1696b3[_0x2d78('0x4a')]=_0x5817e5;return _0x1696b3;})[_0x2d78('0x28')](respondWithFilteredResult(_0x220fec,_0x3241cd))[_0x2d78('0x4b')](handleError(_0x220fec,null));};exports[_0x2d78('0x4c')]=function(_0x9f4232,_0x9e6ea4){var _0x5c2f1d={'raw':![],'where':{'id':_0x9f4232[_0x2d78('0x4d')]['id']}},_0x3db984={};_0x3db984['model']=_['keys'](db[_0x2d78('0x32')]['rawAttributes']);_0x3db984[_0x2d78('0x38')]=_['keys'](_0x9f4232[_0x2d78('0x38')]);_0x3db984[_0x2d78('0x39')]=_[_0x2d78('0x3a')](_0x3db984[_0x2d78('0x36')],_0x3db984['query']);_0x5c2f1d[_0x2d78('0x3b')]=_[_0x2d78('0x3a')](_0x3db984[_0x2d78('0x36')],qs[_0x2d78('0x3c')](_0x9f4232[_0x2d78('0x38')][_0x2d78('0x3c')]));_0x5c2f1d[_0x2d78('0x3b')]=_0x5c2f1d['attributes'][_0x2d78('0x3d')]?_0x5c2f1d[_0x2d78('0x3b')]:_0x3db984[_0x2d78('0x36')];if(_0x9f4232['query'][_0x2d78('0x47')]){_0x5c2f1d[_0x2d78('0x48')]=[{'all':!![]}];}_0x5c2f1d=_[_0x2d78('0x45')]({},_0x5c2f1d,_0x9f4232[_0x2d78('0x4e')]);return db[_0x2d78('0x32')][_0x2d78('0x4f')](_0x5c2f1d)[_0x2d78('0x28')](handleEntityNotFound(_0x9e6ea4,null))[_0x2d78('0x28')](respondWithResult(_0x9e6ea4,null))[_0x2d78('0x4b')](handleError(_0x9e6ea4,null));};exports[_0x2d78('0x50')]=function(_0x1e9c3f,_0x2c6e81){return db['Dashboard']['create'](_0x1e9c3f[_0x2d78('0x51')],{})[_0x2d78('0x28')](function(_0x447ab8){var _0x410ff3=_0x1e9c3f[_0x2d78('0x52')][_0x2d78('0x2a')]({'plain':!![]});if(!_0x410ff3)throw new Error(_0x2d78('0x53'));if(_0x410ff3[_0x2d78('0x54')]===_0x2d78('0x52')){var _0x29f362=_0x447ab8['get']({'plain':!![]});var _0x5aa317=_0x2d78('0x55');return db['UserProfileSection']['find']({'where':{'name':_0x5aa317,'userProfileId':_0x410ff3[_0x2d78('0x56')]},'raw':!![]})['then'](function(_0x4a650e){if(_0x4a650e&&_0x4a650e[_0x2d78('0x57')]===0x0){return db[_0x2d78('0x2b')][_0x2d78('0x50')]({'name':_0x29f362['name'],'resourceId':_0x29f362['id'],'type':_0x4a650e[_0x2d78('0x2e')],'sectionId':_0x4a650e['id']},{})[_0x2d78('0x28')](function(){return _0x447ab8;});}else{return _0x447ab8;}})['catch'](function(_0x7c7fb){logger[_0x2d78('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7c7fb);throw _0x7c7fb;});}return _0x447ab8;})[_0x2d78('0x28')](respondWithResult(_0x2c6e81,0xc9))[_0x2d78('0x4b')](handleError(_0x2c6e81,null));};exports[_0x2d78('0x58')]=function(_0x42f937,_0x4ce0b3){var _0x40afa6={'where':{'id':_0x42f937[_0x2d78('0x4d')]['id']}},_0x453b8f={};_0x453b8f['model']=_[_0x2d78('0x37')](db[_0x2d78('0x32')][_0x2d78('0x33')]);_0x40afa6['attributes']=_[_0x2d78('0x3a')](_0x453b8f['model'],qs[_0x2d78('0x3c')](_0x42f937[_0x2d78('0x38')][_0x2d78('0x3c')]));_0x40afa6[_0x2d78('0x3b')]=_0x40afa6[_0x2d78('0x3b')][_0x2d78('0x3d')]?_0x40afa6[_0x2d78('0x3b')]:_0x453b8f['model'];if(_0x42f937[_0x2d78('0x38')]['includeAll']){_0x40afa6[_0x2d78('0x48')]=[{'all':!![]}];}_0x40afa6=_[_0x2d78('0x45')]({},_0x40afa6,_0x42f937[_0x2d78('0x4e')]);return db[_0x2d78('0x32')]['find'](_0x40afa6)[_0x2d78('0x28')](handleEntityNotFound(_0x4ce0b3,null))[_0x2d78('0x28')](function(_0x3143fc){if(_0x3143fc){var _0xc97057=_0x3143fc[_0x2d78('0x2a')]({'plain':!![]});_0xc97057=qs[_0x2d78('0x59')](_0xc97057,['id',_0x2d78('0x5a'),_0x2d78('0x5b')]);_0x42f937[_0x2d78('0x51')]=_[_0x2d78('0x59')](_0x42f937[_0x2d78('0x51')],['id',_0x2d78('0x5a'),_0x2d78('0x5b')]);return db[_0x2d78('0x32')][_0x2d78('0x50')](_['merge'](_0xc97057,_0x42f937[_0x2d78('0x51')]),{'include':_0x42f937[_0x2d78('0x38')][_0x2d78('0x47')]?[{'all':!![]}]:undefined})[_0x2d78('0x28')](function(_0x589f41){var _0x25de47=_0x42f937[_0x2d78('0x52')][_0x2d78('0x2a')]({'plain':!![]});if(!_0x25de47)throw new Error(_0x2d78('0x53'));if(_0x25de47[_0x2d78('0x54')]===_0x2d78('0x52')){var _0x3cd297=_0x589f41[_0x2d78('0x2a')]({'plain':!![]});var _0x31768f=_0x2d78('0x55');return db[_0x2d78('0x5c')][_0x2d78('0x4f')]({'where':{'name':_0x31768f,'userProfileId':_0x25de47[_0x2d78('0x56')]},'raw':!![]})[_0x2d78('0x28')](function(_0x445a95){if(_0x445a95&&_0x445a95[_0x2d78('0x57')]===0x0){return db['UserProfileResource'][_0x2d78('0x50')]({'name':_0x3cd297[_0x2d78('0x2e')],'resourceId':_0x3cd297['id'],'type':_0x445a95[_0x2d78('0x2e')],'sectionId':_0x445a95['id']},{})['then'](function(){return _0x589f41;});}else{return _0x589f41;}})[_0x2d78('0x4b')](function(_0x3c43ca){logger[_0x2d78('0x2c')](_0x2d78('0x5d'),_0x3c43ca);throw _0x3c43ca;});}return _0x589f41;});}})[_0x2d78('0x28')](respondWithResult(_0x4ce0b3,0xc9))[_0x2d78('0x4b')](handleError(_0x4ce0b3,null));};exports[_0x2d78('0x27')]=function(_0x413dda,_0x127e40){if(_0x413dda[_0x2d78('0x51')]['id']){delete _0x413dda['body']['id'];}return db[_0x2d78('0x32')][_0x2d78('0x4f')]({'where':{'id':_0x413dda[_0x2d78('0x4d')]['id']}})[_0x2d78('0x28')](handleEntityNotFound(_0x127e40,null))['then'](saveUpdates(_0x413dda[_0x2d78('0x51')],null))[_0x2d78('0x28')](respondWithResult(_0x127e40,null))[_0x2d78('0x4b')](handleError(_0x127e40,null));};exports['destroy']=function(_0x2b7d87,_0x31d4b6){return db['Dashboard'][_0x2d78('0x4f')]({'where':{'id':_0x2b7d87[_0x2d78('0x4d')]['id']}})[_0x2d78('0x28')](handleEntityNotFound(_0x31d4b6,null))[_0x2d78('0x28')](removeEntity(_0x31d4b6,null))[_0x2d78('0x4b')](handleError(_0x31d4b6,null));};function widgetAttributes(_0x2ba0d2){try{switch(_0x2ba0d2[_0x2d78('0x35')]){case _0x2d78('0x5e'):return[{'name':'attrUrl','value':_0x2ba0d2['attrUrl']||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x0]?_0x2ba0d2[_0x2d78('0x5f')][0x0][_0x2d78('0x60')]:undefined)||'https://'}];case _0x2d78('0x61'):return[{'name':_0x2d78('0x62'),'value':_0x2ba0d2[_0x2d78('0x62')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x0]?_0x2ba0d2['attrs'][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x2d78('0x63'),'value':_0x2ba0d2[_0x2d78('0x63')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2['attrs'][0x0]?_0x2ba0d2[_0x2d78('0x5f')][0x0]['value']:undefined)||_0x2d78('0x64')},{'name':_0x2d78('0x65'),'value':_0x2ba0d2[_0x2d78('0x65')]||(_0x2ba0d2['attrs']&&_0x2ba0d2[_0x2d78('0x5f')][0x1]?_0x2ba0d2[_0x2d78('0x5f')][0x1]['value']:undefined)||_0x2d78('0x66')},{'name':_0x2d78('0x67'),'value':_0x2ba0d2[_0x2d78('0x67')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x2]?_0x2ba0d2[_0x2d78('0x5f')][0x2][_0x2d78('0x60')]:undefined)||0xc}];case _0x2d78('0x68'):return[{'name':_0x2d78('0x69'),'value':_0x2ba0d2[_0x2d78('0x69')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x0]?_0x2ba0d2[_0x2d78('0x5f')][0x0][_0x2d78('0x60')]:undefined)||_0x2d78('0x6a')},{'name':_0x2d78('0x6b'),'value':_0x2ba0d2['attrVoiceQueues']||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x1]?_0x2ba0d2[_0x2d78('0x5f')][0x1][_0x2d78('0x60')]:undefined)||[]},{'name':_0x2d78('0x67'),'value':_0x2ba0d2['attrFontSize']||(_0x2ba0d2['attrs']&&_0x2ba0d2[_0x2d78('0x5f')][0x2]?_0x2ba0d2['attrs'][0x2][_0x2d78('0x60')]:undefined)||0x14},{'name':'attrChannel','value':_0x2ba0d2[_0x2d78('0x6c')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x3]?_0x2ba0d2[_0x2d78('0x5f')][0x3][_0x2d78('0x60')]:undefined)||_0x2d78('0x6d')},{'name':_0x2d78('0x6e'),'value':_0x2ba0d2['attrEmailAccounts']||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2['attrs'][0x4]?_0x2ba0d2['attrs'][0x4][_0x2d78('0x60')]:undefined)||''},{'name':_0x2d78('0x6f'),'value':_0x2ba0d2[_0x2d78('0x6f')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x5]?_0x2ba0d2[_0x2d78('0x5f')][0x5][_0x2d78('0x60')]:undefined)||''},{'name':_0x2d78('0x70'),'value':_0x2ba0d2[_0x2d78('0x70')]||(_0x2ba0d2['attrs']&&_0x2ba0d2[_0x2d78('0x5f')][0x6]?_0x2ba0d2[_0x2d78('0x5f')][0x6][_0x2d78('0x60')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2ba0d2[_0x2d78('0x71')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x7]?_0x2ba0d2['attrs'][0x7][_0x2d78('0x60')]:undefined)||''},{'name':_0x2d78('0x72'),'value':_0x2ba0d2[_0x2d78('0x72')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x8]?_0x2ba0d2['attrs'][0x8][_0x2d78('0x60')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2ba0d2[_0x2d78('0x73')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2['attrs'][0x9]?_0x2ba0d2[_0x2d78('0x5f')][0x9][_0x2d78('0x60')]:undefined)||''}];case _0x2d78('0x74'):case _0x2d78('0x75'):return[{'name':'attrSerie1','value':_0x2ba0d2[_0x2d78('0x76')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x0]?_0x2ba0d2[_0x2d78('0x5f')][0x0][_0x2d78('0x60')]:undefined)||_0x2d78('0x6a')},{'name':_0x2d78('0x77'),'value':_0x2ba0d2[_0x2d78('0x77')]||(_0x2ba0d2['attrs']&&_0x2ba0d2[_0x2d78('0x5f')][0x1]?_0x2ba0d2[_0x2d78('0x5f')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x2ba0d2[_0x2d78('0x78')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x2]?_0x2ba0d2[_0x2d78('0x5f')][0x2][_0x2d78('0x60')]:undefined)||null},{'name':_0x2d78('0x6b'),'value':_0x2ba0d2[_0x2d78('0x6b')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x3]?_0x2ba0d2[_0x2d78('0x5f')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x2ba0d2[_0x2d78('0x6c')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x4]?_0x2ba0d2['attrs'][0x4][_0x2d78('0x60')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x2ba0d2['attrEmailAccounts']||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2['attrs'][0x5]?_0x2ba0d2['attrs'][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x2ba0d2[_0x2d78('0x6f')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x6]?_0x2ba0d2[_0x2d78('0x5f')][0x6][_0x2d78('0x60')]:undefined)||''},{'name':_0x2d78('0x70'),'value':_0x2ba0d2[_0x2d78('0x70')]||(_0x2ba0d2['attrs']&&_0x2ba0d2[_0x2d78('0x5f')][0x7]?_0x2ba0d2[_0x2d78('0x5f')][0x7][_0x2d78('0x60')]:undefined)||''},{'name':_0x2d78('0x71'),'value':_0x2ba0d2[_0x2d78('0x71')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x8]?_0x2ba0d2['attrs'][0x8][_0x2d78('0x60')]:undefined)||''},{'name':_0x2d78('0x72'),'value':_0x2ba0d2[_0x2d78('0x72')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2['attrs'][0x9]?_0x2ba0d2['attrs'][0x9][_0x2d78('0x60')]:undefined)||''},{'name':_0x2d78('0x73'),'value':_0x2ba0d2[_0x2d78('0x73')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2['attrs'][0xa]?_0x2ba0d2['attrs'][0xa][_0x2d78('0x60')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x2ba0d2[_0x2d78('0x79')]||(_0x2ba0d2['attrs']&&_0x2ba0d2[_0x2d78('0x5f')][0x0]?_0x2ba0d2['attrs'][0x0][_0x2d78('0x35')]:undefined)||null,'value':_0x2ba0d2['attrReport']||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x0]?_0x2ba0d2[_0x2d78('0x5f')][0x0][_0x2d78('0x60')]:undefined)||null},{'name':_0x2d78('0x7a'),'value':_0x2ba0d2[_0x2d78('0x7a')]||(_0x2ba0d2[_0x2d78('0x5f')]&&_0x2ba0d2[_0x2d78('0x5f')][0x1]?_0x2ba0d2['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x4dde90){logger['error'](_0x2d78('0x7b'),JSON[_0x2d78('0x7c')](_0x4dde90));return[];}}exports[_0x2d78('0x7d')]=function(_0x221692,_0x2eb0ea,_0x32162a){if(_0x221692['body']['id']){delete _0x221692['body']['id'];}return db[_0x2d78('0x32')][_0x2d78('0x4f')]({'where':{'id':_0x221692[_0x2d78('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2eb0ea,null))[_0x2d78('0x28')](function(_0x4b833c){if(_0x4b833c){_0x221692[_0x2d78('0x51')][_0x2d78('0x7e')]=_0x4b833c['id'];_0x221692[_0x2d78('0x51')][_0x2d78('0x5f')]=widgetAttributes(_0x221692[_0x2d78('0x51')]);return db[_0x2d78('0x7f')]['create'](_0x221692[_0x2d78('0x51')]);}})['then'](respondWithResult(_0x2eb0ea,null))[_0x2d78('0x4b')](handleError(_0x2eb0ea,null));};exports['getItems']=function(_0x109847,_0x2bca73,_0xa27f15){var _0x469335={};var _0x2c6459={};var _0x13e7cb;var _0x5bf4d2;return db[_0x2d78('0x32')][_0x2d78('0x80')]({'where':{'id':_0x109847[_0x2d78('0x4d')]['id']}})[_0x2d78('0x28')](handleEntityNotFound(_0x2bca73,null))[_0x2d78('0x28')](function(_0x386067){if(_0x386067){_0x13e7cb=_0x386067;_0x2c6459['model']=_[_0x2d78('0x37')](db[_0x2d78('0x7f')][_0x2d78('0x33')]);_0x2c6459[_0x2d78('0x38')]=_[_0x2d78('0x37')](_0x109847[_0x2d78('0x38')]);_0x2c6459[_0x2d78('0x39')]=_[_0x2d78('0x3a')](_0x2c6459[_0x2d78('0x36')],_0x2c6459['query']);_0x469335['attributes']=_[_0x2d78('0x3a')](_0x2c6459[_0x2d78('0x36')],qs['fields'](_0x109847[_0x2d78('0x38')][_0x2d78('0x3c')]));_0x469335['attributes']=_0x469335[_0x2d78('0x3b')][_0x2d78('0x3d')]?_0x469335[_0x2d78('0x3b')]:_0x2c6459[_0x2d78('0x36')];_0x469335[_0x2d78('0x40')]=qs[_0x2d78('0x41')](_0x109847[_0x2d78('0x38')][_0x2d78('0x41')]);_0x469335[_0x2d78('0x44')]=qs['filters'](_[_0x2d78('0x42')](_0x109847[_0x2d78('0x38')],_0x2c6459[_0x2d78('0x39')]));if(_0x109847[_0x2d78('0x38')][_0x2d78('0x43')]){_0x469335[_0x2d78('0x44')]=_[_0x2d78('0x45')](_0x469335['where'],{'$or':_[_0x2d78('0x31')](_0x469335['attributes'],function(_0x3c6b06){var _0x522fa2={};_0x522fa2[_0x3c6b06]={'$like':'%'+_0x109847['query'][_0x2d78('0x43')]+'%'};return _0x522fa2;})});}_0x469335=_[_0x2d78('0x45')]({},_0x469335,_0x109847['options']);return _0x13e7cb[_0x2d78('0x81')](_0x469335);}})['then'](function(_0xc6c1e2){if(_0xc6c1e2){_0x5bf4d2=_0xc6c1e2['length'];if(!_0x109847[_0x2d78('0x38')][_0x2d78('0x3e')](_0x2d78('0x3f'))){_0x469335['limit']=qs[_0x2d78('0x21')](_0x109847[_0x2d78('0x38')][_0x2d78('0x21')]);_0x469335[_0x2d78('0x1f')]=qs[_0x2d78('0x1f')](_0x109847[_0x2d78('0x38')]['offset']);}return _0x13e7cb[_0x2d78('0x81')](_0x469335);}})[_0x2d78('0x28')](function(_0x2fda23){if(_0x2fda23){return _0x2fda23?{'count':_0x5bf4d2,'rows':_0x2fda23}:null;}})[_0x2d78('0x28')](respondWithResult(_0x2bca73,null))[_0x2d78('0x4b')](handleError(_0x2bca73,null));}; \ No newline at end of file +var _0x00aa=['pick','filters','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','fields','length','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','CustomDashboards','end','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','keys','model','query','attributes','intersection','hasOwnProperty','nolimit','order','sort','where'];(function(_0x66e546,_0x38c16a){var _0x6bdee9=function(_0x3574f2){while(--_0x3574f2){_0x66e546['push'](_0x66e546['shift']());}};_0x6bdee9(++_0x38c16a);}(_0x00aa,0x13e));var _0xa00a=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x00aa[_0x3c51d4];return _0x53c45f;};'use strict';var emlformat=require(_0xa00a('0x0'));var rimraf=require(_0xa00a('0x1'));var zipdir=require(_0xa00a('0x2'));var jsonpatch=require(_0xa00a('0x3'));var rp=require(_0xa00a('0x4'));var moment=require(_0xa00a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa00a('0x6'));var util=require(_0xa00a('0x7'));var path=require(_0xa00a('0x8'));var sox=require('sox');var csv=require(_0xa00a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa00a('0xa'));var _=require(_0xa00a('0xb'));var squel=require(_0xa00a('0xc'));var crypto=require(_0xa00a('0xd'));var jsforce=require(_0xa00a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa00a('0x9'));var querystring=require('querystring');var Papa=require(_0xa00a('0xf'));var Redis=require(_0xa00a('0x10'));var authService=require(_0xa00a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa00a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa00a('0x13'))(_0xa00a('0x14'));var utils=require('../../config/utils');var config=require(_0xa00a('0x15'));var licenseUtil=require(_0xa00a('0x16'));var db=require(_0xa00a('0x17'))['db'];config[_0xa00a('0x18')]=_['defaults'](config[_0xa00a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xa00a('0x19'))(new Redis(config[_0xa00a('0x18')]));require(_0xa00a('0x1a'))[_0xa00a('0x1b')](socket);function respondWithStatusCode(_0x257836,_0x1a3654){_0x1a3654=_0x1a3654||0xcc;return function(_0x2181ec){if(_0x2181ec){return _0x257836[_0xa00a('0x1c')](_0x1a3654);}return _0x257836[_0xa00a('0x1d')](_0x1a3654)['end']();};}function respondWithResult(_0x3b17d0,_0x2d23e9){_0x2d23e9=_0x2d23e9||0xc8;return function(_0x1d2a94){if(_0x1d2a94){return _0x3b17d0[_0xa00a('0x1d')](_0x2d23e9)[_0xa00a('0x1e')](_0x1d2a94);}};}function respondWithFilteredResult(_0x2db7cb,_0x26dbff){return function(_0xf61bab){if(_0xf61bab){var _0xb0bf29=typeof _0x26dbff[_0xa00a('0x1f')]===_0xa00a('0x20')&&typeof _0x26dbff[_0xa00a('0x21')]===_0xa00a('0x20');var _0x47657e=_0xf61bab[_0xa00a('0x22')];var _0x1bdcaf=_0xb0bf29?0x0:_0x26dbff[_0xa00a('0x1f')];var _0x457e2e=_0xb0bf29?_0xf61bab[_0xa00a('0x22')]:_0x26dbff[_0xa00a('0x1f')]+_0x26dbff[_0xa00a('0x21')];var _0x3cd104;if(_0x457e2e>=_0x47657e){_0x457e2e=_0x47657e;_0x3cd104=0xc8;}else{_0x3cd104=0xce;}_0x2db7cb[_0xa00a('0x1d')](_0x3cd104);return _0x2db7cb[_0xa00a('0x23')]('Content-Range',_0x1bdcaf+'-'+_0x457e2e+'/'+_0x47657e)[_0xa00a('0x1e')](_0xf61bab);}return null;};}function patchUpdates(_0x12889f){return function(_0x4c1ce1){try{jsonpatch[_0xa00a('0x24')](_0x4c1ce1,_0x12889f,!![]);}catch(_0x301d7d){return BPromise['reject'](_0x301d7d);}return _0x4c1ce1[_0xa00a('0x25')]();};}function saveUpdates(_0x5a60b4,_0x2bb5ad){return function(_0x18011f){if(_0x18011f){return _0x18011f[_0xa00a('0x26')](_0x5a60b4)[_0xa00a('0x27')](function(_0x2b320e){return _0x2b320e;});}return null;};}function removeEntity(_0x318d7c,_0x3590c6){return function(_0x15a841){if(_0x15a841){return _0x15a841[_0xa00a('0x28')]()[_0xa00a('0x27')](function(){var _0x50ea83=_0x15a841[_0xa00a('0x29')]({'plain':!![]});var _0x600e20=_0xa00a('0x2a');return db['UserProfileResource'][_0xa00a('0x28')]({'where':{'type':_0x600e20,'resourceId':_0x50ea83['id']}})[_0xa00a('0x27')](function(){return _0x15a841;});})[_0xa00a('0x27')](function(){_0x318d7c['status'](0xcc)[_0xa00a('0x2b')]();});}};}function handleEntityNotFound(_0x534317,_0x5e387d){return function(_0x46890a){if(!_0x46890a){_0x534317[_0xa00a('0x1c')](0x194);}return _0x46890a;};}function handleError(_0x285e1d,_0x122ec1){_0x122ec1=_0x122ec1||0x1f4;return function(_0x414f74){logger['error'](_0x414f74[_0xa00a('0x2c')]);if(_0x414f74[_0xa00a('0x2d')]){delete _0x414f74[_0xa00a('0x2d')];}_0x285e1d[_0xa00a('0x1d')](_0x122ec1)[_0xa00a('0x2e')](_0x414f74);};}exports[_0xa00a('0x2f')]=function(_0x4b2c7d,_0x18811b){var _0x84bac3={},_0x1385ec={},_0x5326f5={'count':0x0,'rows':[]};var _0x2a6357=_[_0xa00a('0x30')](db[_0xa00a('0x31')][_0xa00a('0x32')],function(_0x5d465b){return{'name':_0x5d465b[_0xa00a('0x33')],'type':_0x5d465b[_0xa00a('0x34')]['key']};});_0x1385ec['model']=_['map'](_0x2a6357,_0xa00a('0x2d'));_0x1385ec['query']=_[_0xa00a('0x35')](_0x4b2c7d['query']);_0x1385ec['filters']=_['intersection'](_0x1385ec[_0xa00a('0x36')],_0x1385ec[_0xa00a('0x37')]);_0x84bac3[_0xa00a('0x38')]=_[_0xa00a('0x39')](_0x1385ec['model'],qs['fields'](_0x4b2c7d['query']['fields']));_0x84bac3['attributes']=_0x84bac3[_0xa00a('0x38')]['length']?_0x84bac3[_0xa00a('0x38')]:_0x1385ec[_0xa00a('0x36')];if(!_0x4b2c7d['query'][_0xa00a('0x3a')](_0xa00a('0x3b'))){_0x84bac3[_0xa00a('0x21')]=qs['limit'](_0x4b2c7d[_0xa00a('0x37')][_0xa00a('0x21')]);_0x84bac3[_0xa00a('0x1f')]=qs['offset'](_0x4b2c7d[_0xa00a('0x37')][_0xa00a('0x1f')]);}_0x84bac3[_0xa00a('0x3c')]=qs[_0xa00a('0x3d')](_0x4b2c7d['query']['sort']);_0x84bac3[_0xa00a('0x3e')]=qs['filters'](_[_0xa00a('0x3f')](_0x4b2c7d['query'],_0x1385ec[_0xa00a('0x40')]),_0x2a6357);if(_0x4b2c7d[_0xa00a('0x37')]['filter']){_0x84bac3[_0xa00a('0x3e')]=_[_0xa00a('0x41')](_0x84bac3[_0xa00a('0x3e')],{'$or':_[_0xa00a('0x30')](_0x2a6357,function(_0x2d3c8e){if(_0x2d3c8e['type']!==_0xa00a('0x42')){var _0xc672cd={};_0xc672cd[_0x2d3c8e['name']]={'$like':'%'+_0x4b2c7d[_0xa00a('0x37')][_0xa00a('0x43')]+'%'};return _0xc672cd;}})});}_0x84bac3=_[_0xa00a('0x41')]({},_0x84bac3,_0x4b2c7d['options']);var _0x593725={'where':_0x84bac3[_0xa00a('0x3e')]};return db[_0xa00a('0x31')]['count'](_0x593725)[_0xa00a('0x27')](function(_0x5dc049){_0x5326f5[_0xa00a('0x22')]=_0x5dc049;if(_0x4b2c7d['query'][_0xa00a('0x44')]){_0x84bac3[_0xa00a('0x45')]=[{'all':!![]}];}return db['Dashboard'][_0xa00a('0x46')](_0x84bac3);})[_0xa00a('0x27')](function(_0x128c78){_0x5326f5[_0xa00a('0x47')]=_0x128c78;return _0x5326f5;})[_0xa00a('0x27')](respondWithFilteredResult(_0x18811b,_0x84bac3))['catch'](handleError(_0x18811b,null));};exports[_0xa00a('0x48')]=function(_0xfdd223,_0x9acb39){var _0x113fba={'raw':![],'where':{'id':_0xfdd223[_0xa00a('0x49')]['id']}},_0x54fd6f={};_0x54fd6f['model']=_[_0xa00a('0x35')](db['Dashboard']['rawAttributes']);_0x54fd6f[_0xa00a('0x37')]=_[_0xa00a('0x35')](_0xfdd223[_0xa00a('0x37')]);_0x54fd6f[_0xa00a('0x40')]=_['intersection'](_0x54fd6f['model'],_0x54fd6f['query']);_0x113fba[_0xa00a('0x38')]=_['intersection'](_0x54fd6f['model'],qs[_0xa00a('0x4a')](_0xfdd223[_0xa00a('0x37')][_0xa00a('0x4a')]));_0x113fba[_0xa00a('0x38')]=_0x113fba[_0xa00a('0x38')][_0xa00a('0x4b')]?_0x113fba[_0xa00a('0x38')]:_0x54fd6f['model'];if(_0xfdd223[_0xa00a('0x37')][_0xa00a('0x44')]){_0x113fba[_0xa00a('0x45')]=[{'all':!![]}];}_0x113fba=_[_0xa00a('0x41')]({},_0x113fba,_0xfdd223[_0xa00a('0x4c')]);return db[_0xa00a('0x31')]['find'](_0x113fba)[_0xa00a('0x27')](handleEntityNotFound(_0x9acb39,null))[_0xa00a('0x27')](respondWithResult(_0x9acb39,null))[_0xa00a('0x4d')](handleError(_0x9acb39,null));};exports[_0xa00a('0x4e')]=function(_0x2f3f11,_0x11c058){return db['Dashboard'][_0xa00a('0x4e')](_0x2f3f11[_0xa00a('0x4f')],{})[_0xa00a('0x27')](function(_0x50e0f2){var _0x289479=_0x2f3f11[_0xa00a('0x50')][_0xa00a('0x29')]({'plain':!![]});if(!_0x289479)throw new Error(_0xa00a('0x51'));if(_0x289479[_0xa00a('0x52')]==='user'){var _0x3b9235=_0x50e0f2[_0xa00a('0x29')]({'plain':!![]});var _0x1bc469='CustomDashboards';return db[_0xa00a('0x53')][_0xa00a('0x54')]({'where':{'name':_0x1bc469,'userProfileId':_0x289479[_0xa00a('0x55')]},'raw':!![]})['then'](function(_0xe7f412){if(_0xe7f412&&_0xe7f412[_0xa00a('0x56')]===0x0){return db[_0xa00a('0x57')][_0xa00a('0x4e')]({'name':_0x3b9235[_0xa00a('0x2d')],'resourceId':_0x3b9235['id'],'type':_0xe7f412[_0xa00a('0x2d')],'sectionId':_0xe7f412['id']},{})[_0xa00a('0x27')](function(){return _0x50e0f2;});}else{return _0x50e0f2;}})[_0xa00a('0x4d')](function(_0x27935d){logger[_0xa00a('0x58')](_0xa00a('0x59'),_0x27935d);throw _0x27935d;});}return _0x50e0f2;})[_0xa00a('0x27')](respondWithResult(_0x11c058,0xc9))['catch'](handleError(_0x11c058,null));};exports['clone']=function(_0x674ccd,_0xd6eda3){var _0xadc532={'where':{'id':_0x674ccd[_0xa00a('0x49')]['id']}},_0x14dd54={};_0x14dd54[_0xa00a('0x36')]=_['keys'](db[_0xa00a('0x31')][_0xa00a('0x32')]);_0xadc532[_0xa00a('0x38')]=_[_0xa00a('0x39')](_0x14dd54[_0xa00a('0x36')],qs[_0xa00a('0x4a')](_0x674ccd['query']['fields']));_0xadc532[_0xa00a('0x38')]=_0xadc532[_0xa00a('0x38')][_0xa00a('0x4b')]?_0xadc532[_0xa00a('0x38')]:_0x14dd54[_0xa00a('0x36')];if(_0x674ccd[_0xa00a('0x37')][_0xa00a('0x44')]){_0xadc532[_0xa00a('0x45')]=[{'all':!![]}];}_0xadc532=_[_0xa00a('0x41')]({},_0xadc532,_0x674ccd[_0xa00a('0x4c')]);return db[_0xa00a('0x31')][_0xa00a('0x54')](_0xadc532)[_0xa00a('0x27')](handleEntityNotFound(_0xd6eda3,null))['then'](function(_0x433f3a){if(_0x433f3a){var _0x59c7df=_0x433f3a[_0xa00a('0x29')]({'plain':!![]});_0x59c7df=qs[_0xa00a('0x5a')](_0x59c7df,['id',_0xa00a('0x5b'),_0xa00a('0x5c')]);_0x674ccd[_0xa00a('0x4f')]=_[_0xa00a('0x5a')](_0x674ccd['body'],['id',_0xa00a('0x5b'),_0xa00a('0x5c')]);return db['Dashboard'][_0xa00a('0x4e')](_[_0xa00a('0x41')](_0x59c7df,_0x674ccd[_0xa00a('0x4f')]),{'include':_0x674ccd[_0xa00a('0x37')][_0xa00a('0x44')]?[{'all':!![]}]:undefined})[_0xa00a('0x27')](function(_0x50fe2a){var _0x43557e=_0x674ccd['user']['get']({'plain':!![]});if(!_0x43557e)throw new Error(_0xa00a('0x51'));if(_0x43557e['role']==='user'){var _0x4b5646=_0x50fe2a[_0xa00a('0x29')]({'plain':!![]});var _0x1c781a=_0xa00a('0x2a');return db[_0xa00a('0x53')][_0xa00a('0x54')]({'where':{'name':_0x1c781a,'userProfileId':_0x43557e['userProfileId']},'raw':!![]})[_0xa00a('0x27')](function(_0x3c0f38){if(_0x3c0f38&&_0x3c0f38[_0xa00a('0x56')]===0x0){return db[_0xa00a('0x57')][_0xa00a('0x4e')]({'name':_0x4b5646[_0xa00a('0x2d')],'resourceId':_0x4b5646['id'],'type':_0x3c0f38[_0xa00a('0x2d')],'sectionId':_0x3c0f38['id']},{})[_0xa00a('0x27')](function(){return _0x50fe2a;});}else{return _0x50fe2a;}})[_0xa00a('0x4d')](function(_0x2f4782){logger[_0xa00a('0x58')](_0xa00a('0x59'),_0x2f4782);throw _0x2f4782;});}return _0x50fe2a;});}})[_0xa00a('0x27')](respondWithResult(_0xd6eda3,0xc9))[_0xa00a('0x4d')](handleError(_0xd6eda3,null));};exports[_0xa00a('0x26')]=function(_0x1e1d36,_0x204c35){if(_0x1e1d36[_0xa00a('0x4f')]['id']){delete _0x1e1d36[_0xa00a('0x4f')]['id'];}return db['Dashboard'][_0xa00a('0x54')]({'where':{'id':_0x1e1d36[_0xa00a('0x49')]['id']}})[_0xa00a('0x27')](handleEntityNotFound(_0x204c35,null))[_0xa00a('0x27')](saveUpdates(_0x1e1d36[_0xa00a('0x4f')],null))[_0xa00a('0x27')](respondWithResult(_0x204c35,null))[_0xa00a('0x4d')](handleError(_0x204c35,null));};exports[_0xa00a('0x28')]=function(_0x30cb03,_0x2784a3){return db[_0xa00a('0x31')][_0xa00a('0x54')]({'where':{'id':_0x30cb03[_0xa00a('0x49')]['id']}})[_0xa00a('0x27')](handleEntityNotFound(_0x2784a3,null))[_0xa00a('0x27')](removeEntity(_0x2784a3,null))[_0xa00a('0x4d')](handleError(_0x2784a3,null));};function widgetAttributes(_0x50d332){try{switch(_0x50d332[_0xa00a('0x34')]){case'iframe':return[{'name':_0xa00a('0x5d'),'value':_0x50d332['attrUrl']||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x0]?_0x50d332[_0xa00a('0x5e')][0x0][_0xa00a('0x5f')]:undefined)||'https://'}];case _0xa00a('0x60'):return[{'name':_0xa00a('0x61'),'value':_0x50d332[_0xa00a('0x61')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x0]?_0x50d332['attrs'][0x0][_0xa00a('0x5f')]:undefined)||''}];case _0xa00a('0x62'):return[{'name':_0xa00a('0x63'),'value':_0x50d332[_0xa00a('0x63')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x0]?_0x50d332['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0xa00a('0x64'),'value':_0x50d332[_0xa00a('0x64')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x1]?_0x50d332[_0xa00a('0x5e')][0x1]['value']:undefined)||'0.00'},{'name':_0xa00a('0x65'),'value':_0x50d332[_0xa00a('0x65')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x2]?_0x50d332['attrs'][0x2][_0xa00a('0x5f')]:undefined)||0xc}];case _0xa00a('0x66'):return[{'name':_0xa00a('0x67'),'value':_0x50d332['attrMetric']||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332['attrs'][0x0]?_0x50d332[_0xa00a('0x5e')][0x0][_0xa00a('0x5f')]:undefined)||_0xa00a('0x68')},{'name':_0xa00a('0x69'),'value':_0x50d332[_0xa00a('0x69')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x1]?_0x50d332[_0xa00a('0x5e')][0x1][_0xa00a('0x5f')]:undefined)||[]},{'name':_0xa00a('0x65'),'value':_0x50d332[_0xa00a('0x65')]||(_0x50d332['attrs']&&_0x50d332[_0xa00a('0x5e')][0x2]?_0x50d332[_0xa00a('0x5e')][0x2][_0xa00a('0x5f')]:undefined)||0x14},{'name':_0xa00a('0x6a'),'value':_0x50d332[_0xa00a('0x6a')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x3]?_0x50d332[_0xa00a('0x5e')][0x3]['value']:undefined)||_0xa00a('0x6b')},{'name':_0xa00a('0x6c'),'value':_0x50d332[_0xa00a('0x6c')]||(_0x50d332['attrs']&&_0x50d332['attrs'][0x4]?_0x50d332[_0xa00a('0x5e')][0x4][_0xa00a('0x5f')]:undefined)||''},{'name':_0xa00a('0x6d'),'value':_0x50d332[_0xa00a('0x6d')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x5]?_0x50d332['attrs'][0x5]['value']:undefined)||''},{'name':_0xa00a('0x6e'),'value':_0x50d332[_0xa00a('0x6e')]||(_0x50d332['attrs']&&_0x50d332[_0xa00a('0x5e')][0x6]?_0x50d332[_0xa00a('0x5e')][0x6]['value']:undefined)||''},{'name':_0xa00a('0x6f'),'value':_0x50d332[_0xa00a('0x6f')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x7]?_0x50d332['attrs'][0x7][_0xa00a('0x5f')]:undefined)||''},{'name':_0xa00a('0x70'),'value':_0x50d332['attrWhatsappAccounts']||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x8]?_0x50d332[_0xa00a('0x5e')][0x8]['value']:undefined)||''},{'name':_0xa00a('0x71'),'value':_0x50d332[_0xa00a('0x71')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x9]?_0x50d332[_0xa00a('0x5e')][0x9][_0xa00a('0x5f')]:undefined)||''}];case _0xa00a('0x72'):case _0xa00a('0x73'):return[{'name':'attrSerie1','value':_0x50d332[_0xa00a('0x74')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x0]?_0x50d332[_0xa00a('0x5e')][0x0]['value']:undefined)||_0xa00a('0x68')},{'name':_0xa00a('0x75'),'value':_0x50d332[_0xa00a('0x75')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x1]?_0x50d332[_0xa00a('0x5e')][0x1][_0xa00a('0x5f')]:undefined)||null},{'name':'attrSerie3','value':_0x50d332['attrSerie3']||(_0x50d332['attrs']&&_0x50d332[_0xa00a('0x5e')][0x2]?_0x50d332['attrs'][0x2]['value']:undefined)||null},{'name':_0xa00a('0x69'),'value':_0x50d332[_0xa00a('0x69')]||(_0x50d332['attrs']&&_0x50d332[_0xa00a('0x5e')][0x3]?_0x50d332[_0xa00a('0x5e')][0x3][_0xa00a('0x5f')]:undefined)||[]},{'name':_0xa00a('0x6a'),'value':_0x50d332[_0xa00a('0x6a')]||(_0x50d332['attrs']&&_0x50d332[_0xa00a('0x5e')][0x4]?_0x50d332[_0xa00a('0x5e')][0x4][_0xa00a('0x5f')]:undefined)||'voice'},{'name':_0xa00a('0x6c'),'value':_0x50d332['attrEmailAccounts']||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x5]?_0x50d332[_0xa00a('0x5e')][0x5]['value']:undefined)||''},{'name':_0xa00a('0x6d'),'value':_0x50d332[_0xa00a('0x6d')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332['attrs'][0x6]?_0x50d332[_0xa00a('0x5e')][0x6][_0xa00a('0x5f')]:undefined)||''},{'name':_0xa00a('0x6e'),'value':_0x50d332[_0xa00a('0x6e')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x7]?_0x50d332[_0xa00a('0x5e')][0x7]['value']:undefined)||''},{'name':_0xa00a('0x6f'),'value':_0x50d332[_0xa00a('0x6f')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x8]?_0x50d332[_0xa00a('0x5e')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x50d332[_0xa00a('0x70')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0x9]?_0x50d332[_0xa00a('0x5e')][0x9][_0xa00a('0x5f')]:undefined)||''},{'name':_0xa00a('0x71'),'value':_0x50d332[_0xa00a('0x71')]||(_0x50d332[_0xa00a('0x5e')]&&_0x50d332[_0xa00a('0x5e')][0xa]?_0x50d332['attrs'][0xa][_0xa00a('0x5f')]:undefined)||''}];case'web-report':return[{'name':_0xa00a('0x76'),'type':_0x50d332['reportType']||(_0x50d332['attrs']&&_0x50d332[_0xa00a('0x5e')][0x0]?_0x50d332[_0xa00a('0x5e')][0x0][_0xa00a('0x34')]:undefined)||null,'value':_0x50d332['attrReport']||(_0x50d332['attrs']&&_0x50d332['attrs'][0x0]?_0x50d332['attrs'][0x0][_0xa00a('0x5f')]:undefined)||null},{'name':_0xa00a('0x77'),'value':_0x50d332[_0xa00a('0x77')]||(_0x50d332['attrs']&&_0x50d332[_0xa00a('0x5e')][0x1]?_0x50d332[_0xa00a('0x5e')][0x1][_0xa00a('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x1507af){logger[_0xa00a('0x58')](_0xa00a('0x78'),JSON[_0xa00a('0x79')](_0x1507af));return[];}}exports[_0xa00a('0x7a')]=function(_0x122968,_0x545692,_0x215752){if(_0x122968[_0xa00a('0x4f')]['id']){delete _0x122968['body']['id'];}return db['Dashboard'][_0xa00a('0x54')]({'where':{'id':_0x122968['params']['id']}})[_0xa00a('0x27')](handleEntityNotFound(_0x545692,null))[_0xa00a('0x27')](function(_0x8f8458){if(_0x8f8458){_0x122968['body'][_0xa00a('0x7b')]=_0x8f8458['id'];_0x122968[_0xa00a('0x4f')]['attrs']=widgetAttributes(_0x122968[_0xa00a('0x4f')]);return db[_0xa00a('0x7c')][_0xa00a('0x4e')](_0x122968[_0xa00a('0x4f')]);}})['then'](respondWithResult(_0x545692,null))[_0xa00a('0x4d')](handleError(_0x545692,null));};exports[_0xa00a('0x7d')]=function(_0x5b614b,_0x4b99b4,_0x337b95){var _0x346ff2={};var _0x1b7e4d={};var _0x2859d3;var _0x417e4c;return db[_0xa00a('0x31')][_0xa00a('0x7e')]({'where':{'id':_0x5b614b[_0xa00a('0x49')]['id']}})[_0xa00a('0x27')](handleEntityNotFound(_0x4b99b4,null))[_0xa00a('0x27')](function(_0x56318a){if(_0x56318a){_0x2859d3=_0x56318a;_0x1b7e4d[_0xa00a('0x36')]=_['keys'](db['DashboardItem'][_0xa00a('0x32')]);_0x1b7e4d[_0xa00a('0x37')]=_[_0xa00a('0x35')](_0x5b614b[_0xa00a('0x37')]);_0x1b7e4d[_0xa00a('0x40')]=_[_0xa00a('0x39')](_0x1b7e4d[_0xa00a('0x36')],_0x1b7e4d[_0xa00a('0x37')]);_0x346ff2[_0xa00a('0x38')]=_[_0xa00a('0x39')](_0x1b7e4d[_0xa00a('0x36')],qs[_0xa00a('0x4a')](_0x5b614b[_0xa00a('0x37')][_0xa00a('0x4a')]));_0x346ff2[_0xa00a('0x38')]=_0x346ff2[_0xa00a('0x38')]['length']?_0x346ff2[_0xa00a('0x38')]:_0x1b7e4d[_0xa00a('0x36')];_0x346ff2[_0xa00a('0x3c')]=qs[_0xa00a('0x3d')](_0x5b614b[_0xa00a('0x37')][_0xa00a('0x3d')]);_0x346ff2['where']=qs[_0xa00a('0x40')](_[_0xa00a('0x3f')](_0x5b614b[_0xa00a('0x37')],_0x1b7e4d[_0xa00a('0x40')]));if(_0x5b614b['query'][_0xa00a('0x43')]){_0x346ff2[_0xa00a('0x3e')]=_[_0xa00a('0x41')](_0x346ff2[_0xa00a('0x3e')],{'$or':_[_0xa00a('0x30')](_0x346ff2['attributes'],function(_0x5c7029){var _0x419153={};_0x419153[_0x5c7029]={'$like':'%'+_0x5b614b[_0xa00a('0x37')]['filter']+'%'};return _0x419153;})});}_0x346ff2=_[_0xa00a('0x41')]({},_0x346ff2,_0x5b614b[_0xa00a('0x4c')]);return _0x2859d3[_0xa00a('0x7d')](_0x346ff2);}})[_0xa00a('0x27')](function(_0x14b34d){if(_0x14b34d){_0x417e4c=_0x14b34d[_0xa00a('0x4b')];if(!_0x5b614b[_0xa00a('0x37')][_0xa00a('0x3a')]('nolimit')){_0x346ff2[_0xa00a('0x21')]=qs[_0xa00a('0x21')](_0x5b614b[_0xa00a('0x37')][_0xa00a('0x21')]);_0x346ff2[_0xa00a('0x1f')]=qs[_0xa00a('0x1f')](_0x5b614b[_0xa00a('0x37')][_0xa00a('0x1f')]);}return _0x2859d3[_0xa00a('0x7d')](_0x346ff2);}})[_0xa00a('0x27')](function(_0x3466d7){if(_0x3466d7){return _0x3466d7?{'count':_0x417e4c,'rows':_0x3466d7}:null;}})[_0xa00a('0x27')](respondWithResult(_0x4b99b4,null))[_0xa00a('0x4d')](handleError(_0x4b99b4,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 7861ed3..92943c4 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 _0x3408=['exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x514ce9,_0x4a060b){var _0x4e0188=function(_0x215ee5){while(--_0x215ee5){_0x514ce9['push'](_0x514ce9['shift']());}};_0x4e0188(++_0x4a060b);}(_0x3408,0x177));var _0x8340=function(_0x60b02d,_0x200c50){_0x60b02d=_0x60b02d-0x0;var _0x10640e=_0x3408[_0x60b02d];return _0x10640e;};'use strict';var EventEmitter=require(_0x8340('0x0'));var Dashboard=require(_0x8340('0x1'))['db'][_0x8340('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8340('0x3')](0x0);var events={'afterCreate':_0x8340('0x4'),'afterUpdate':_0x8340('0x5'),'afterDestroy':_0x8340('0x6')};function emitEvent(_0x3c8360){return function(_0x1ca22c,_0x33ee17,_0x67180){DashboardEvents[_0x8340('0x7')](_0x3c8360+':'+_0x1ca22c['id'],_0x1ca22c);DashboardEvents[_0x8340('0x7')](_0x3c8360,_0x1ca22c);_0x67180(null);};}for(var e in events){if(events[_0x8340('0x8')](e)){var event=events[e];Dashboard[_0x8340('0x9')](e,emitEvent(event));}}module[_0x8340('0xa')]=DashboardEvents; \ No newline at end of file +var _0xd38e=['emit','hasOwnProperty','hook','events','Dashboard','setMaxListeners','save','update','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd38e,0x17d));var _0xed38=function(_0x492061,_0x571d68){_0x492061=_0x492061-0x0;var _0x46f22a=_0xd38e[_0x492061];return _0x46f22a;};'use strict';var EventEmitter=require(_0xed38('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xed38('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xed38('0x2')](0x0);var events={'afterCreate':_0xed38('0x3'),'afterUpdate':_0xed38('0x4'),'afterDestroy':_0xed38('0x5')};function emitEvent(_0x5b48d4){return function(_0x17e1e5,_0x45062f,_0x273ae1){DashboardEvents['emit'](_0x5b48d4+':'+_0x17e1e5['id'],_0x17e1e5);DashboardEvents[_0xed38('0x6')](_0x5b48d4,_0x17e1e5);_0x273ae1(null);};}for(var e in events){if(events[_0xed38('0x7')](e)){var event=events[e];Dashboard[_0xed38('0x8')](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 a83a74b..2d5754c 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 _0xcf35=['./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x58aab1,_0x1e6a38){var _0xe30c64=function(_0x13553a){while(--_0x13553a){_0x58aab1['push'](_0x58aab1['shift']());}};_0xe30c64(++_0x1e6a38);}(_0xcf35,0x1a9));var _0x5cf3=function(_0x3a732d,_0x573e63){_0x3a732d=_0x3a732d-0x0;var _0x3248d6=_0xcf35[_0x3a732d];return _0x3248d6;};'use strict';var _=require(_0x5cf3('0x0'));var util=require(_0x5cf3('0x1'));var logger=require(_0x5cf3('0x2'))(_0x5cf3('0x3'));var moment=require('moment');var BPromise=require(_0x5cf3('0x4'));var rp=require(_0x5cf3('0x5'));var fs=require('fs');var path=require(_0x5cf3('0x6'));var rimraf=require(_0x5cf3('0x7'));var config=require(_0x5cf3('0x8'));var attributes=require(_0x5cf3('0x9'));module[_0x5cf3('0xa')]=function(_0x255411,_0x58d442){return _0x255411[_0x5cf3('0xb')](_0x5cf3('0xc'),attributes,{'tableName':_0x5cf3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e24=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash'];(function(_0x3b584b,_0x39dc34){var _0x38559d=function(_0x2cbf9e){while(--_0x2cbf9e){_0x3b584b['push'](_0x3b584b['shift']());}};_0x38559d(++_0x39dc34);}(_0x8e24,0x1bf));var _0x48e2=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x8e24[_0x45f951];return _0x24756c;};'use strict';var _=require(_0x48e2('0x0'));var util=require(_0x48e2('0x1'));var logger=require('../../config/logger')(_0x48e2('0x2'));var moment=require(_0x48e2('0x3'));var BPromise=require(_0x48e2('0x4'));var rp=require(_0x48e2('0x5'));var fs=require('fs');var path=require(_0x48e2('0x6'));var rimraf=require(_0x48e2('0x7'));var config=require(_0x48e2('0x8'));var attributes=require(_0x48e2('0x9'));module[_0x48e2('0xa')]=function(_0x2c0d0b,_0x289db4){return _0x2c0d0b[_0x48e2('0xb')](_0x48e2('0xc'),attributes,{'tableName':_0x48e2('0xd'),'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 9b458a7..3ccce80 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 _0xd771=['result','catch','lodash','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0xd771,0x7a));var _0x1d77=function(_0x4622b8,_0x1f8c65){_0x4622b8=_0x4622b8-0x0;var _0x24ed84=_0xd771[_0x4622b8];return _0x24ed84;};'use strict';var _=require(_0x1d77('0x0'));var util=require('util');var moment=require(_0x1d77('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1d77('0x2'));var logger=require(_0x1d77('0x3'))(_0x1d77('0x4'));var config=require(_0x1d77('0x5'));var jayson=require(_0x1d77('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x1d77('0x7')]=_[_0x1d77('0x8')](config[_0x1d77('0x7')],{'host':_0x1d77('0x9'),'port':0x18eb});var socket=require(_0x1d77('0xa'))(new Redis(config[_0x1d77('0x7')]));require('./dashboard.socket')[_0x1d77('0xb')](socket);function respondWithRpcPromise(_0x1bd340,_0x151565,_0x1dbbc8){return new BPromise(function(_0x57fd1a,_0x51a545){return client[_0x1d77('0xc')](_0x1bd340,_0x1dbbc8)[_0x1d77('0xd')](function(_0x4b39e2){logger[_0x1d77('0xe')](_0x1d77('0xf'),_0x151565,_0x1d77('0x10'));logger['debug'](_0x1d77('0x11'),_0x151565,'request\x20sent',JSON[_0x1d77('0x12')](_0x4b39e2));if(_0x4b39e2['error']){if(_0x4b39e2[_0x1d77('0x13')][_0x1d77('0x14')]===0x1f4){logger[_0x1d77('0x13')](_0x1d77('0xf'),_0x151565,_0x4b39e2[_0x1d77('0x13')][_0x1d77('0x15')]);return _0x51a545(_0x4b39e2[_0x1d77('0x13')][_0x1d77('0x15')]);}logger[_0x1d77('0x13')](_0x1d77('0xf'),_0x151565,_0x4b39e2[_0x1d77('0x13')]['message']);return _0x57fd1a(_0x4b39e2[_0x1d77('0x13')][_0x1d77('0x15')]);}else{logger[_0x1d77('0xe')](_0x1d77('0xf'),_0x151565,_0x1d77('0x10'));_0x57fd1a(_0x4b39e2[_0x1d77('0x16')][_0x1d77('0x15')]);}})[_0x1d77('0x17')](function(_0x133b61){logger[_0x1d77('0x13')](_0x1d77('0xf'),_0x151565,_0x133b61);_0x51a545(_0x133b61);});});} \ No newline at end of file +var _0xcd18=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','./dashboard.socket','register','request','then','request\x20sent','debug','stringify','error','Dashboard,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird'];(function(_0xb24170,_0x544806){var _0x42679a=function(_0x50a95b){while(--_0x50a95b){_0xb24170['push'](_0xb24170['shift']());}};_0x42679a(++_0x544806);}(_0xcd18,0x195));var _0x8cd1=function(_0x5aeda7,_0x74556a){_0x5aeda7=_0x5aeda7-0x0;var _0x122f8a=_0xcd18[_0x5aeda7];return _0x122f8a;};'use strict';var _=require(_0x8cd1('0x0'));var util=require(_0x8cd1('0x1'));var moment=require('moment');var BPromise=require(_0x8cd1('0x2'));var rs=require(_0x8cd1('0x3'));var fs=require('fs');var Redis=require(_0x8cd1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8cd1('0x5'));var logger=require(_0x8cd1('0x6'))(_0x8cd1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8cd1('0x8')][_0x8cd1('0x9')]({'port':0x232a});config['redis']=_[_0x8cd1('0xa')](config[_0x8cd1('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8cd1('0xb')]));require(_0x8cd1('0xc'))[_0x8cd1('0xd')](socket);function respondWithRpcPromise(_0x53aaa9,_0x9e8ed9,_0x3211d0){return new BPromise(function(_0x4b65ed,_0xfa96){return client[_0x8cd1('0xe')](_0x53aaa9,_0x3211d0)[_0x8cd1('0xf')](function(_0x594157){logger['info']('Dashboard,\x20%s,\x20%s',_0x9e8ed9,_0x8cd1('0x10'));logger[_0x8cd1('0x11')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x9e8ed9,_0x8cd1('0x10'),JSON[_0x8cd1('0x12')](_0x594157));if(_0x594157['error']){if(_0x594157[_0x8cd1('0x13')]['code']===0x1f4){logger[_0x8cd1('0x13')](_0x8cd1('0x14'),_0x9e8ed9,_0x594157[_0x8cd1('0x13')]['message']);return _0xfa96(_0x594157['error'][_0x8cd1('0x15')]);}logger[_0x8cd1('0x13')](_0x8cd1('0x14'),_0x9e8ed9,_0x594157[_0x8cd1('0x13')][_0x8cd1('0x15')]);return _0x4b65ed(_0x594157['error'][_0x8cd1('0x15')]);}else{logger[_0x8cd1('0x16')](_0x8cd1('0x14'),_0x9e8ed9,'request\x20sent');_0x4b65ed(_0x594157['result'][_0x8cd1('0x15')]);}})[_0x8cd1('0x17')](function(_0x3ebf22){logger[_0x8cd1('0x13')]('Dashboard,\x20%s,\x20%s',_0x9e8ed9,_0x3ebf22);_0xfa96(_0x3ebf22);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 9381d1a..6da9a49 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 _0xb61a=['length','dashboard:','./dashboard.events','save','remove','update','emit','removeListener','register'];(function(_0x2ecead,_0x4369c8){var _0x3ec06c=function(_0x1ee896){while(--_0x1ee896){_0x2ecead['push'](_0x2ecead['shift']());}};_0x3ec06c(++_0x4369c8);}(_0xb61a,0x92));var _0xab61=function(_0x598c71,_0x16b523){_0x598c71=_0x598c71-0x0;var _0x33afd1=_0xb61a[_0x598c71];return _0x33afd1;};'use strict';var DashboardEvents=require(_0xab61('0x0'));var events=[_0xab61('0x1'),_0xab61('0x2'),_0xab61('0x3')];function createListener(_0x56a73a,_0x413342){return function(_0x3f02df){_0x413342[_0xab61('0x4')](_0x56a73a,_0x3f02df);};}function removeListener(_0x5993f9,_0x2ee453){return function(){DashboardEvents[_0xab61('0x5')](_0x5993f9,_0x2ee453);};}exports[_0xab61('0x6')]=function(_0xe3e05e){for(var _0xcbb056=0x0,_0x103af9=events[_0xab61('0x7')];_0xcbb056<_0x103af9;_0xcbb056++){var _0x311ea4=events[_0xcbb056];var _0x4ab955=createListener(_0xab61('0x8')+_0x311ea4,_0xe3e05e);DashboardEvents['on'](_0x311ea4,_0x4ab955);}}; \ No newline at end of file +var _0xc5c6=['update','emit','removeListener','register','length','remove'];(function(_0x5956bd,_0x4215f2){var _0x2a2a27=function(_0x2cd66d){while(--_0x2cd66d){_0x5956bd['push'](_0x5956bd['shift']());}};_0x2a2a27(++_0x4215f2);}(_0xc5c6,0xd7));var _0x6c5c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc5c6[_0x321bb2];return _0x9c12ed;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0x6c5c('0x0'),_0x6c5c('0x1')];function createListener(_0x473558,_0x275106){return function(_0x3f0247){_0x275106[_0x6c5c('0x2')](_0x473558,_0x3f0247);};}function removeListener(_0x34d1a9,_0x55e572){return function(){DashboardEvents[_0x6c5c('0x3')](_0x34d1a9,_0x55e572);};}exports[_0x6c5c('0x4')]=function(_0x8bde17){for(var _0x4a3877=0x0,_0x2c187a=events[_0x6c5c('0x5')];_0x4a3877<_0x2c187a;_0x4a3877++){var _0x4ff152=events[_0x4a3877];var _0x1d729d=createListener('dashboard:'+_0x4ff152,_0x8bde17);DashboardEvents['on'](_0x4ff152,_0x1d729d);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index ead04b0..87eadae 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 _0x75dc=['getItems','create','post','/:id/clone','addItem','put','/:id','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','get','show','/:id/items'];(function(_0x52e331,_0x582b6e){var _0x414818=function(_0x1d9329){while(--_0x1d9329){_0x52e331['push'](_0x52e331['shift']());}};_0x414818(++_0x582b6e);}(_0x75dc,0x1d7));var _0xc75d=function(_0x450076,_0x10983b){_0x450076=_0x450076-0x0;var _0x2029cc=_0x75dc[_0x450076];return _0x2029cc;};'use strict';var multer=require(_0xc75d('0x0'));var util=require(_0xc75d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc75d('0x2')]();var fs_extra=require(_0xc75d('0x3'));var auth=require(_0xc75d('0x4'));var interaction=require(_0xc75d('0x5'));var config=require(_0xc75d('0x6'));var controller=require(_0xc75d('0x7'));router['get']('/',auth[_0xc75d('0x8')](),controller[_0xc75d('0x9')]);router[_0xc75d('0xa')]('/:id',auth[_0xc75d('0x8')](),controller[_0xc75d('0xb')]);router[_0xc75d('0xa')](_0xc75d('0xc'),auth['isAuthenticated'](),controller[_0xc75d('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc75d('0xe')]);router[_0xc75d('0xf')](_0xc75d('0x10'),auth[_0xc75d('0x8')](),controller['clone']);router[_0xc75d('0xf')](_0xc75d('0xc'),auth[_0xc75d('0x8')](),controller[_0xc75d('0x11')]);router[_0xc75d('0x12')](_0xc75d('0x13'),auth[_0xc75d('0x8')](),controller['update']);router[_0xc75d('0x14')](_0xc75d('0x13'),auth[_0xc75d('0x8')](),controller[_0xc75d('0x15')]);module['exports']=router; \ No newline at end of file +var _0x7d43=['get','/:id','show','/:id/items','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','path','express','../../components/interaction/service','./dashboard.controller','isAuthenticated','index'];(function(_0x4dd5c3,_0x251c25){var _0x1f68ca=function(_0x47c385){while(--_0x47c385){_0x4dd5c3['push'](_0x4dd5c3['shift']());}};_0x1f68ca(++_0x251c25);}(_0x7d43,0xb5));var _0x37d4=function(_0x14b8c7,_0x4839ea){_0x14b8c7=_0x14b8c7-0x0;var _0x4bb5a3=_0x7d43[_0x14b8c7];return _0x4bb5a3;};'use strict';var multer=require(_0x37d4('0x0'));var util=require(_0x37d4('0x1'));var path=require(_0x37d4('0x2'));var timeout=require('connect-timeout');var express=require(_0x37d4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x37d4('0x4'));var config=require('../../config/environment');var controller=require(_0x37d4('0x5'));router['get']('/',auth[_0x37d4('0x6')](),controller[_0x37d4('0x7')]);router[_0x37d4('0x8')](_0x37d4('0x9'),auth['isAuthenticated'](),controller[_0x37d4('0xa')]);router[_0x37d4('0x8')](_0x37d4('0xb'),auth[_0x37d4('0x6')](),controller['getItems']);router[_0x37d4('0xc')]('/',auth[_0x37d4('0x6')](),controller[_0x37d4('0xd')]);router[_0x37d4('0xc')](_0x37d4('0xe'),auth['isAuthenticated'](),controller['clone']);router[_0x37d4('0xc')](_0x37d4('0xb'),auth[_0x37d4('0x6')](),controller[_0x37d4('0xf')]);router[_0x37d4('0x10')](_0x37d4('0x9'),auth[_0x37d4('0x6')](),controller[_0x37d4('0x11')]);router[_0x37d4('0x12')](_0x37d4('0x9'),auth[_0x37d4('0x6')](),controller[_0x37d4('0x13')]);module[_0x37d4('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 65200d0..47a36e7 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 _0x1967=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','squel','lodash','exports','STRING','TEXT','long'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x1967,0x173));var _0x7196=function(_0x5063e5,_0x48099d){_0x5063e5=_0x5063e5-0x0;var _0x3d05df=_0x1967[_0x5063e5];return _0x3d05df;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x7196('0x0'));var _=require(_0x7196('0x1'));module[_0x7196('0x2')]={'title':{'type':Sequelize[_0x7196('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x7196('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x7196('0x4')](_0x7196('0x5')),'get':function(){try{return JSON[_0x7196('0x6')](this[_0x7196('0x7')](_0x7196('0x8')));}catch(_0x5c128f){return[];}},'set':function(_0x36b01e){try{this[_0x7196('0x9')](_0x7196('0x8'),JSON[_0x7196('0xa')](_0x36b01e));}catch(_0x266a6e){this[_0x7196('0x9')]('attrs',JSON[_0x7196('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x7196('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7196('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x7196('0xb')]},'col':{'type':Sequelize[_0x7196('0xb')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x7196('0x3')],'allowNull':![],'defaultValue':_0x7196('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x7196('0x3')]},'titleFontSize':{'type':Sequelize[_0x7196('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0x2542=['exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash'];(function(_0x169a8a,_0x3526b1){var _0x2e8502=function(_0x4c37f3){while(--_0x4c37f3){_0x169a8a['push'](_0x169a8a['shift']());}};_0x2e8502(++_0x3526b1);}(_0x2542,0x169));var _0x2254=function(_0xce2ee4,_0x3fe1e1){_0xce2ee4=_0xce2ee4-0x0;var _0x3fd000=_0x2542[_0xce2ee4];return _0x3fd000;};'use strict';var Sequelize=require(_0x2254('0x0'));var squel=require(_0x2254('0x1'));var _=require(_0x2254('0x2'));module[_0x2254('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2254('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x2254('0x5')),'get':function(){try{return JSON[_0x2254('0x6')](this[_0x2254('0x7')](_0x2254('0x8')));}catch(_0x76c902){return[];}},'set':function(_0x508183){try{this[_0x2254('0x9')](_0x2254('0x8'),JSON[_0x2254('0xa')](_0x508183));}catch(_0x3c45ec){this[_0x2254('0x9')](_0x2254('0x8'),JSON[_0x2254('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x2254('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x2254('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x2254('0xb')]},'col':{'type':Sequelize[_0x2254('0xb')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2254('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x2254('0x4')],'allowNull':![],'defaultValue':_0x2254('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x2254('0x4')]},'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 811f8d4..712c93d 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 _0x176c=['request-promise','moment','bluebird','util','path','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','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','DashboardItem','rawAttributes','query','filters','intersection','model','attributes','fields','length','include','merge','options','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x58f9a8,_0x46cc13){var _0x551362=function(_0x4af943){while(--_0x4af943){_0x58f9a8['push'](_0x58f9a8['shift']());}};_0x551362(++_0x46cc13);}(_0x176c,0x134));var _0xc176=function(_0x23548c,_0x39c48e){_0x23548c=_0x23548c-0x0;var _0x60116e=_0x176c[_0x23548c];return _0x60116e;};'use strict';var emlformat=require(_0xc176('0x0'));var rimraf=require(_0xc176('0x1'));var zipdir=require(_0xc176('0x2'));var jsonpatch=require(_0xc176('0x3'));var rp=require(_0xc176('0x4'));var moment=require(_0xc176('0x5'));var BPromise=require(_0xc176('0x6'));var Mustache=require('mustache');var util=require(_0xc176('0x7'));var path=require(_0xc176('0x8'));var sox=require('sox');var csv=require(_0xc176('0x9'));var ejs=require(_0xc176('0xa'));var fs=require('fs');var fs_extra=require(_0xc176('0xb'));var _=require('lodash');var squel=require(_0xc176('0xc'));var crypto=require(_0xc176('0xd'));var jsforce=require(_0xc176('0xe'));var deskjs=require(_0xc176('0xf'));var toCsv=require(_0xc176('0x9'));var querystring=require('querystring');var Papa=require(_0xc176('0x10'));var Redis=require(_0xc176('0x11'));var authService=require(_0xc176('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc176('0x13'));var hardwareService=require(_0xc176('0x14'));var logger=require(_0xc176('0x15'))(_0xc176('0x16'));var utils=require(_0xc176('0x17'));var config=require(_0xc176('0x18'));var licenseUtil=require(_0xc176('0x19'));var db=require(_0xc176('0x1a'))['db'];config['redis']=_[_0xc176('0x1b')](config[_0xc176('0x1c')],{'host':_0xc176('0x1d'),'port':0x18eb});var socket=require(_0xc176('0x1e'))(new Redis(config[_0xc176('0x1c')]));require('./dashboardItem.socket')[_0xc176('0x1f')](socket);function respondWithStatusCode(_0x3ba62e,_0x27ded2){_0x27ded2=_0x27ded2||0xcc;return function(_0x4b8af0){if(_0x4b8af0){return _0x3ba62e[_0xc176('0x20')](_0x27ded2);}return _0x3ba62e['status'](_0x27ded2)[_0xc176('0x21')]();};}function respondWithResult(_0x246e9f,_0x4fdbd5){_0x4fdbd5=_0x4fdbd5||0xc8;return function(_0xfc47b4){if(_0xfc47b4){return _0x246e9f[_0xc176('0x22')](_0x4fdbd5)[_0xc176('0x23')](_0xfc47b4);}};}function respondWithFilteredResult(_0x1b9b5b,_0x33b528){return function(_0x284bb8){if(_0x284bb8){var _0x5e081a=typeof _0x33b528[_0xc176('0x24')]==='undefined'&&typeof _0x33b528[_0xc176('0x25')]===_0xc176('0x26');var _0x1c40bf=_0x284bb8[_0xc176('0x27')];var _0x261680=_0x5e081a?0x0:_0x33b528[_0xc176('0x24')];var _0x5526da=_0x5e081a?_0x284bb8['count']:_0x33b528[_0xc176('0x24')]+_0x33b528['limit'];var _0x179994;if(_0x5526da>=_0x1c40bf){_0x5526da=_0x1c40bf;_0x179994=0xc8;}else{_0x179994=0xce;}_0x1b9b5b['status'](_0x179994);return _0x1b9b5b[_0xc176('0x28')](_0xc176('0x29'),_0x261680+'-'+_0x5526da+'/'+_0x1c40bf)[_0xc176('0x23')](_0x284bb8);}return null;};}function patchUpdates(_0x580149){return function(_0x583c16){try{jsonpatch[_0xc176('0x2a')](_0x583c16,_0x580149,!![]);}catch(_0xdb4e6f){return BPromise[_0xc176('0x2b')](_0xdb4e6f);}return _0x583c16[_0xc176('0x2c')]();};}function saveUpdates(_0x5670da,_0x2e264d){return function(_0x5b71e6){if(_0x5b71e6){return _0x5b71e6[_0xc176('0x2d')](_0x5670da)['then'](function(_0x5049f8){return _0x5049f8;});}return null;};}function removeEntity(_0x39ee9b,_0x12ab18){return function(_0x3e4ecb){if(_0x3e4ecb){return _0x3e4ecb[_0xc176('0x2e')]()[_0xc176('0x2f')](function(){_0x39ee9b[_0xc176('0x22')](0xcc)[_0xc176('0x21')]();});}};}function handleEntityNotFound(_0x3d9fbf,_0x2cbdfa){return function(_0x3f5509){if(!_0x3f5509){_0x3d9fbf[_0xc176('0x20')](0x194);}return _0x3f5509;};}function handleError(_0x93f53c,_0x4628ad){_0x4628ad=_0x4628ad||0x1f4;return function(_0x449d76){logger[_0xc176('0x30')](_0x449d76[_0xc176('0x31')]);if(_0x449d76[_0xc176('0x32')]){delete _0x449d76['name'];}_0x93f53c['status'](_0x4628ad)[_0xc176('0x33')](_0x449d76);};}exports[_0xc176('0x34')]=function(_0x56a1bd,_0x17e111){var _0x3c7c1b={'raw':![],'where':{'id':_0x56a1bd[_0xc176('0x35')]['id']}},_0x2034fe={};_0x2034fe['model']=_['keys'](db[_0xc176('0x36')][_0xc176('0x37')]);_0x2034fe[_0xc176('0x38')]=_['keys'](_0x56a1bd[_0xc176('0x38')]);_0x2034fe[_0xc176('0x39')]=_[_0xc176('0x3a')](_0x2034fe[_0xc176('0x3b')],_0x2034fe[_0xc176('0x38')]);_0x3c7c1b[_0xc176('0x3c')]=_[_0xc176('0x3a')](_0x2034fe[_0xc176('0x3b')],qs['fields'](_0x56a1bd['query'][_0xc176('0x3d')]));_0x3c7c1b[_0xc176('0x3c')]=_0x3c7c1b[_0xc176('0x3c')][_0xc176('0x3e')]?_0x3c7c1b[_0xc176('0x3c')]:_0x2034fe[_0xc176('0x3b')];if(_0x56a1bd[_0xc176('0x38')]['includeAll']){_0x3c7c1b[_0xc176('0x3f')]=[{'all':!![]}];}_0x3c7c1b=_[_0xc176('0x40')]({},_0x3c7c1b,_0x56a1bd[_0xc176('0x41')]);return db['DashboardItem'][_0xc176('0x42')](_0x3c7c1b)[_0xc176('0x2f')](handleEntityNotFound(_0x17e111,null))[_0xc176('0x2f')](respondWithResult(_0x17e111,null))[_0xc176('0x43')](handleError(_0x17e111,null));};exports[_0xc176('0x2e')]=function(_0x38875c,_0xcaa2ad){return db[_0xc176('0x36')]['find']({'where':{'id':_0x38875c[_0xc176('0x35')]['id']}})[_0xc176('0x2f')](handleEntityNotFound(_0xcaa2ad,null))['then'](removeEntity(_0xcaa2ad,null))[_0xc176('0x43')](handleError(_0xcaa2ad,null));};function widgetAttributes(_0x196cb0){try{switch(_0x196cb0[_0xc176('0x44')]){case _0xc176('0x45'):return[{'name':_0xc176('0x46'),'value':_0x196cb0[_0xc176('0x46')]||(_0x196cb0['attrs']&&_0x196cb0['attrs'][0x0]?_0x196cb0[_0xc176('0x47')][0x0]['value']:undefined)||_0xc176('0x48')}];case _0xc176('0x49'):return[{'name':_0xc176('0x4a'),'value':_0x196cb0[_0xc176('0x4a')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x0]?_0x196cb0[_0xc176('0x47')][0x0][_0xc176('0x4b')]:undefined)||''}];case _0xc176('0x4c'):return[{'name':_0xc176('0x4d'),'value':_0x196cb0['attrHourFormat']||(_0x196cb0['attrs']&&_0x196cb0[_0xc176('0x47')][0x0]?_0x196cb0[_0xc176('0x47')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0xc176('0x4e'),'value':_0x196cb0[_0xc176('0x4e')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x1]?_0x196cb0['attrs'][0x1]['value']:undefined)||'0.00'},{'name':_0xc176('0x4f'),'value':_0x196cb0[_0xc176('0x4f')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0['attrs'][0x2]?_0x196cb0[_0xc176('0x47')][0x2][_0xc176('0x4b')]:undefined)||0xc}];case _0xc176('0x50'):return[{'name':_0xc176('0x51'),'value':_0x196cb0[_0xc176('0x51')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x0]?_0x196cb0['attrs'][0x0][_0xc176('0x4b')]:undefined)||_0xc176('0x52')},{'name':_0xc176('0x53'),'value':_0x196cb0[_0xc176('0x53')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x1]?_0x196cb0[_0xc176('0x47')][0x1]['value']:undefined)||[]},{'name':_0xc176('0x4f'),'value':_0x196cb0['attrFontSize']||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x2]?_0x196cb0[_0xc176('0x47')][0x2][_0xc176('0x4b')]:undefined)||0x14},{'name':'attrChannel','value':_0x196cb0[_0xc176('0x54')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x3]?_0x196cb0['attrs'][0x3][_0xc176('0x4b')]:undefined)||_0xc176('0x55')},{'name':_0xc176('0x56'),'value':_0x196cb0[_0xc176('0x56')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x4]?_0x196cb0[_0xc176('0x47')][0x4][_0xc176('0x4b')]:undefined)||''},{'name':_0xc176('0x57'),'value':_0x196cb0[_0xc176('0x57')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x5]?_0x196cb0[_0xc176('0x47')][0x5][_0xc176('0x4b')]:undefined)||''},{'name':_0xc176('0x58'),'value':_0x196cb0[_0xc176('0x58')]||(_0x196cb0['attrs']&&_0x196cb0['attrs'][0x6]?_0x196cb0['attrs'][0x6]['value']:undefined)||''},{'name':_0xc176('0x59'),'value':_0x196cb0[_0xc176('0x59')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x7]?_0x196cb0['attrs'][0x7][_0xc176('0x4b')]:undefined)||''},{'name':_0xc176('0x5a'),'value':_0x196cb0[_0xc176('0x5a')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x8]?_0x196cb0[_0xc176('0x47')][0x8][_0xc176('0x4b')]:undefined)||''},{'name':'attrChatWebsites','value':_0x196cb0[_0xc176('0x5b')]||(_0x196cb0['attrs']&&_0x196cb0[_0xc176('0x47')][0x9]?_0x196cb0[_0xc176('0x47')][0x9][_0xc176('0x4b')]:undefined)||''}];case _0xc176('0x5c'):case _0xc176('0x5d'):return[{'name':_0xc176('0x5e'),'value':_0x196cb0[_0xc176('0x5e')]||(_0x196cb0['attrs']&&_0x196cb0[_0xc176('0x47')][0x0]?_0x196cb0[_0xc176('0x47')][0x0]['value']:undefined)||_0xc176('0x52')},{'name':_0xc176('0x5f'),'value':_0x196cb0[_0xc176('0x5f')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x1]?_0x196cb0[_0xc176('0x47')][0x1][_0xc176('0x4b')]:undefined)||null},{'name':'attrSerie3','value':_0x196cb0[_0xc176('0x60')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x2]?_0x196cb0['attrs'][0x2]['value']:undefined)||null},{'name':_0xc176('0x53'),'value':_0x196cb0[_0xc176('0x53')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0['attrs'][0x3]?_0x196cb0['attrs'][0x3][_0xc176('0x4b')]:undefined)||[]},{'name':_0xc176('0x54'),'value':_0x196cb0[_0xc176('0x54')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0['attrs'][0x4]?_0x196cb0[_0xc176('0x47')][0x4]['value']:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x196cb0[_0xc176('0x56')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x5]?_0x196cb0[_0xc176('0x47')][0x5][_0xc176('0x4b')]:undefined)||''},{'name':_0xc176('0x57'),'value':_0x196cb0[_0xc176('0x57')]||(_0x196cb0['attrs']&&_0x196cb0[_0xc176('0x47')][0x6]?_0x196cb0['attrs'][0x6][_0xc176('0x4b')]:undefined)||''},{'name':_0xc176('0x58'),'value':_0x196cb0[_0xc176('0x58')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0['attrs'][0x7]?_0x196cb0[_0xc176('0x47')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x196cb0[_0xc176('0x59')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x8]?_0x196cb0[_0xc176('0x47')][0x8][_0xc176('0x4b')]:undefined)||''},{'name':_0xc176('0x5a'),'value':_0x196cb0[_0xc176('0x5a')]||(_0x196cb0['attrs']&&_0x196cb0[_0xc176('0x47')][0x9]?_0x196cb0[_0xc176('0x47')][0x9][_0xc176('0x4b')]:undefined)||''},{'name':'attrChatWebsites','value':_0x196cb0[_0xc176('0x5b')]||(_0x196cb0['attrs']&&_0x196cb0['attrs'][0xa]?_0x196cb0[_0xc176('0x47')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0xc176('0x61'),'type':_0x196cb0[_0xc176('0x62')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0[_0xc176('0x47')][0x0]?_0x196cb0[_0xc176('0x47')][0x0][_0xc176('0x44')]:undefined)||null,'value':_0x196cb0[_0xc176('0x61')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0['attrs'][0x0]?_0x196cb0['attrs'][0x0][_0xc176('0x4b')]:undefined)||null},{'name':_0xc176('0x63'),'value':_0x196cb0[_0xc176('0x63')]||(_0x196cb0[_0xc176('0x47')]&&_0x196cb0['attrs'][0x1]?_0x196cb0[_0xc176('0x47')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x209ca6){logger[_0xc176('0x30')](_0xc176('0x64'),JSON[_0xc176('0x65')](_0x209ca6));return[];}}exports['create']=function(_0x1580fe,_0x1ce264){if(_0x1580fe[_0xc176('0x66')]){_0x1580fe[_0xc176('0x66')][_0xc176('0x47')]=widgetAttributes(_0x1580fe[_0xc176('0x66')]);}return db[_0xc176('0x36')][_0xc176('0x67')](_0x1580fe[_0xc176('0x66')],{})[_0xc176('0x2f')](respondWithResult(_0x1ce264,0xc9))[_0xc176('0x43')](handleError(_0x1ce264,null));};exports[_0xc176('0x2d')]=function(_0x55ccd7,_0x20ff1f){if(_0x55ccd7[_0xc176('0x66')]['id']){delete _0x55ccd7[_0xc176('0x66')]['id'];}_0x55ccd7['body'][_0xc176('0x47')]=widgetAttributes(_0x55ccd7[_0xc176('0x66')]);return db[_0xc176('0x36')][_0xc176('0x42')]({'where':{'id':_0x55ccd7[_0xc176('0x35')]['id']}})[_0xc176('0x2f')](handleEntityNotFound(_0x20ff1f,null))[_0xc176('0x2f')](saveUpdates(_0x55ccd7[_0xc176('0x66')],null))['then'](respondWithResult(_0x20ff1f,null))[_0xc176('0x43')](handleError(_0x20ff1f,null));}; \ No newline at end of file +var _0xd8a5=['localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','find','catch','DashboardItem','type','iframe','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','reportType','widgetAttributes:\x20%s','stringify','body','create','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults'];(function(_0x57c8a7,_0x595947){var _0x3dccc4=function(_0x1b2b46){while(--_0x1b2b46){_0x57c8a7['push'](_0x57c8a7['shift']());}};_0x3dccc4(++_0x595947);}(_0xd8a5,0x160));var _0x5d8a=function(_0x3d0dbf,_0x4c29e4){_0x3d0dbf=_0x3d0dbf-0x0;var _0x67e3ab=_0xd8a5[_0x3d0dbf];return _0x67e3ab;};'use strict';var emlformat=require(_0x5d8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d8a('0x1'));var jsonpatch=require(_0x5d8a('0x2'));var rp=require('request-promise');var moment=require(_0x5d8a('0x3'));var BPromise=require(_0x5d8a('0x4'));var Mustache=require(_0x5d8a('0x5'));var util=require(_0x5d8a('0x6'));var path=require(_0x5d8a('0x7'));var sox=require(_0x5d8a('0x8'));var csv=require(_0x5d8a('0x9'));var ejs=require(_0x5d8a('0xa'));var fs=require('fs');var fs_extra=require(_0x5d8a('0xb'));var _=require(_0x5d8a('0xc'));var squel=require(_0x5d8a('0xd'));var crypto=require(_0x5d8a('0xe'));var jsforce=require(_0x5d8a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5d8a('0x9'));var querystring=require(_0x5d8a('0x10'));var Papa=require(_0x5d8a('0x11'));var Redis=require(_0x5d8a('0x12'));var authService=require(_0x5d8a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5d8a('0x14'));var hardwareService=require(_0x5d8a('0x15'));var logger=require(_0x5d8a('0x16'))(_0x5d8a('0x17'));var utils=require('../../config/utils');var config=require(_0x5d8a('0x18'));var licenseUtil=require(_0x5d8a('0x19'));var db=require('../../mysqldb')['db'];config[_0x5d8a('0x1a')]=_[_0x5d8a('0x1b')](config[_0x5d8a('0x1a')],{'host':_0x5d8a('0x1c'),'port':0x18eb});var socket=require(_0x5d8a('0x1d'))(new Redis(config[_0x5d8a('0x1a')]));require(_0x5d8a('0x1e'))[_0x5d8a('0x1f')](socket);function respondWithStatusCode(_0x3d852e,_0x33b2de){_0x33b2de=_0x33b2de||0xcc;return function(_0x94a2ba){if(_0x94a2ba){return _0x3d852e[_0x5d8a('0x20')](_0x33b2de);}return _0x3d852e['status'](_0x33b2de)['end']();};}function respondWithResult(_0x39a1b8,_0x1567e0){_0x1567e0=_0x1567e0||0xc8;return function(_0x596ab7){if(_0x596ab7){return _0x39a1b8[_0x5d8a('0x21')](_0x1567e0)[_0x5d8a('0x22')](_0x596ab7);}};}function respondWithFilteredResult(_0x341262,_0x129a1d){return function(_0x5eb748){if(_0x5eb748){var _0x16ff4e=typeof _0x129a1d['offset']===_0x5d8a('0x23')&&typeof _0x129a1d[_0x5d8a('0x24')]===_0x5d8a('0x23');var _0x235257=_0x5eb748[_0x5d8a('0x25')];var _0x478612=_0x16ff4e?0x0:_0x129a1d[_0x5d8a('0x26')];var _0x48fc2b=_0x16ff4e?_0x5eb748[_0x5d8a('0x25')]:_0x129a1d[_0x5d8a('0x26')]+_0x129a1d[_0x5d8a('0x24')];var _0x3c2524;if(_0x48fc2b>=_0x235257){_0x48fc2b=_0x235257;_0x3c2524=0xc8;}else{_0x3c2524=0xce;}_0x341262['status'](_0x3c2524);return _0x341262[_0x5d8a('0x27')](_0x5d8a('0x28'),_0x478612+'-'+_0x48fc2b+'/'+_0x235257)[_0x5d8a('0x22')](_0x5eb748);}return null;};}function patchUpdates(_0x5443b9){return function(_0x43d9ec){try{jsonpatch[_0x5d8a('0x29')](_0x43d9ec,_0x5443b9,!![]);}catch(_0x186aa9){return BPromise[_0x5d8a('0x2a')](_0x186aa9);}return _0x43d9ec['save']();};}function saveUpdates(_0x8cbf6e,_0x463519){return function(_0x482532){if(_0x482532){return _0x482532[_0x5d8a('0x2b')](_0x8cbf6e)['then'](function(_0x194b9e){return _0x194b9e;});}return null;};}function removeEntity(_0x281c93,_0x2f57da){return function(_0x564636){if(_0x564636){return _0x564636[_0x5d8a('0x2c')]()[_0x5d8a('0x2d')](function(){_0x281c93['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a637f,_0x189617){return function(_0x20fae2){if(!_0x20fae2){_0x3a637f['sendStatus'](0x194);}return _0x20fae2;};}function handleError(_0x2fa9fd,_0x3cafbf){_0x3cafbf=_0x3cafbf||0x1f4;return function(_0x4e4c43){logger[_0x5d8a('0x2e')](_0x4e4c43[_0x5d8a('0x2f')]);if(_0x4e4c43[_0x5d8a('0x30')]){delete _0x4e4c43[_0x5d8a('0x30')];}_0x2fa9fd[_0x5d8a('0x21')](_0x3cafbf)['send'](_0x4e4c43);};}exports[_0x5d8a('0x31')]=function(_0x13c112,_0x6fda47){var _0x1b1d4b={'raw':![],'where':{'id':_0x13c112[_0x5d8a('0x32')]['id']}},_0x2b10e6={};_0x2b10e6[_0x5d8a('0x33')]=_[_0x5d8a('0x34')](db['DashboardItem'][_0x5d8a('0x35')]);_0x2b10e6[_0x5d8a('0x36')]=_[_0x5d8a('0x34')](_0x13c112[_0x5d8a('0x36')]);_0x2b10e6[_0x5d8a('0x37')]=_[_0x5d8a('0x38')](_0x2b10e6[_0x5d8a('0x33')],_0x2b10e6[_0x5d8a('0x36')]);_0x1b1d4b[_0x5d8a('0x39')]=_[_0x5d8a('0x38')](_0x2b10e6[_0x5d8a('0x33')],qs[_0x5d8a('0x3a')](_0x13c112['query'][_0x5d8a('0x3a')]));_0x1b1d4b[_0x5d8a('0x39')]=_0x1b1d4b[_0x5d8a('0x39')]['length']?_0x1b1d4b[_0x5d8a('0x39')]:_0x2b10e6['model'];if(_0x13c112[_0x5d8a('0x36')]['includeAll']){_0x1b1d4b['include']=[{'all':!![]}];}_0x1b1d4b=_[_0x5d8a('0x3b')]({},_0x1b1d4b,_0x13c112['options']);return db['DashboardItem'][_0x5d8a('0x3c')](_0x1b1d4b)[_0x5d8a('0x2d')](handleEntityNotFound(_0x6fda47,null))[_0x5d8a('0x2d')](respondWithResult(_0x6fda47,null))[_0x5d8a('0x3d')](handleError(_0x6fda47,null));};exports[_0x5d8a('0x2c')]=function(_0x2d9a48,_0x20fb04){return db[_0x5d8a('0x3e')][_0x5d8a('0x3c')]({'where':{'id':_0x2d9a48['params']['id']}})['then'](handleEntityNotFound(_0x20fb04,null))['then'](removeEntity(_0x20fb04,null))[_0x5d8a('0x3d')](handleError(_0x20fb04,null));};function widgetAttributes(_0x1d1c7a){try{switch(_0x1d1c7a[_0x5d8a('0x3f')]){case _0x5d8a('0x40'):return[{'name':'attrUrl','value':_0x1d1c7a['attrUrl']||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x0]?_0x1d1c7a[_0x5d8a('0x41')][0x0][_0x5d8a('0x42')]:undefined)||_0x5d8a('0x43')}];case _0x5d8a('0x44'):return[{'name':_0x5d8a('0x45'),'value':_0x1d1c7a['attrPath']||(_0x1d1c7a['attrs']&&_0x1d1c7a['attrs'][0x0]?_0x1d1c7a[_0x5d8a('0x41')][0x0][_0x5d8a('0x42')]:undefined)||''}];case _0x5d8a('0x46'):return[{'name':_0x5d8a('0x47'),'value':_0x1d1c7a[_0x5d8a('0x47')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x0]?_0x1d1c7a['attrs'][0x0][_0x5d8a('0x42')]:undefined)||_0x5d8a('0x48')},{'name':_0x5d8a('0x49'),'value':_0x1d1c7a['attrTimezone']||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x1]?_0x1d1c7a[_0x5d8a('0x41')][0x1][_0x5d8a('0x42')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x1d1c7a[_0x5d8a('0x4a')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x2]?_0x1d1c7a['attrs'][0x2][_0x5d8a('0x42')]:undefined)||0xc}];case'counter':return[{'name':_0x5d8a('0x4b'),'value':_0x1d1c7a[_0x5d8a('0x4b')]||(_0x1d1c7a['attrs']&&_0x1d1c7a['attrs'][0x0]?_0x1d1c7a[_0x5d8a('0x41')][0x0][_0x5d8a('0x42')]:undefined)||_0x5d8a('0x4c')},{'name':_0x5d8a('0x4d'),'value':_0x1d1c7a[_0x5d8a('0x4d')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x1]?_0x1d1c7a[_0x5d8a('0x41')][0x1][_0x5d8a('0x42')]:undefined)||[]},{'name':_0x5d8a('0x4a'),'value':_0x1d1c7a[_0x5d8a('0x4a')]||(_0x1d1c7a['attrs']&&_0x1d1c7a[_0x5d8a('0x41')][0x2]?_0x1d1c7a[_0x5d8a('0x41')][0x2][_0x5d8a('0x42')]:undefined)||0x14},{'name':_0x5d8a('0x4e'),'value':_0x1d1c7a[_0x5d8a('0x4e')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a['attrs'][0x3]?_0x1d1c7a['attrs'][0x3][_0x5d8a('0x42')]:undefined)||_0x5d8a('0x4f')},{'name':_0x5d8a('0x50'),'value':_0x1d1c7a[_0x5d8a('0x50')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x4]?_0x1d1c7a[_0x5d8a('0x41')][0x4][_0x5d8a('0x42')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x1d1c7a[_0x5d8a('0x51')]||(_0x1d1c7a['attrs']&&_0x1d1c7a['attrs'][0x5]?_0x1d1c7a[_0x5d8a('0x41')][0x5]['value']:undefined)||''},{'name':_0x5d8a('0x52'),'value':_0x1d1c7a[_0x5d8a('0x52')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x6]?_0x1d1c7a['attrs'][0x6]['value']:undefined)||''},{'name':_0x5d8a('0x53'),'value':_0x1d1c7a[_0x5d8a('0x53')]||(_0x1d1c7a['attrs']&&_0x1d1c7a[_0x5d8a('0x41')][0x7]?_0x1d1c7a['attrs'][0x7]['value']:undefined)||''},{'name':_0x5d8a('0x54'),'value':_0x1d1c7a[_0x5d8a('0x54')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x8]?_0x1d1c7a['attrs'][0x8][_0x5d8a('0x42')]:undefined)||''},{'name':_0x5d8a('0x55'),'value':_0x1d1c7a[_0x5d8a('0x55')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x9]?_0x1d1c7a[_0x5d8a('0x41')][0x9][_0x5d8a('0x42')]:undefined)||''}];case _0x5d8a('0x56'):case'pie-chart':return[{'name':'attrSerie1','value':_0x1d1c7a[_0x5d8a('0x57')]||(_0x1d1c7a['attrs']&&_0x1d1c7a['attrs'][0x0]?_0x1d1c7a[_0x5d8a('0x41')][0x0][_0x5d8a('0x42')]:undefined)||'total'},{'name':'attrSerie2','value':_0x1d1c7a[_0x5d8a('0x58')]||(_0x1d1c7a['attrs']&&_0x1d1c7a[_0x5d8a('0x41')][0x1]?_0x1d1c7a['attrs'][0x1][_0x5d8a('0x42')]:undefined)||null},{'name':_0x5d8a('0x59'),'value':_0x1d1c7a[_0x5d8a('0x59')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x2]?_0x1d1c7a[_0x5d8a('0x41')][0x2][_0x5d8a('0x42')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1d1c7a[_0x5d8a('0x4d')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x3]?_0x1d1c7a[_0x5d8a('0x41')][0x3][_0x5d8a('0x42')]:undefined)||[]},{'name':'attrChannel','value':_0x1d1c7a[_0x5d8a('0x4e')]||(_0x1d1c7a['attrs']&&_0x1d1c7a[_0x5d8a('0x41')][0x4]?_0x1d1c7a['attrs'][0x4][_0x5d8a('0x42')]:undefined)||'voice'},{'name':_0x5d8a('0x50'),'value':_0x1d1c7a[_0x5d8a('0x50')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x5]?_0x1d1c7a[_0x5d8a('0x41')][0x5][_0x5d8a('0x42')]:undefined)||''},{'name':_0x5d8a('0x51'),'value':_0x1d1c7a[_0x5d8a('0x51')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x6]?_0x1d1c7a[_0x5d8a('0x41')][0x6][_0x5d8a('0x42')]:undefined)||''},{'name':_0x5d8a('0x52'),'value':_0x1d1c7a[_0x5d8a('0x52')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a['attrs'][0x7]?_0x1d1c7a[_0x5d8a('0x41')][0x7][_0x5d8a('0x42')]:undefined)||''},{'name':_0x5d8a('0x53'),'value':_0x1d1c7a[_0x5d8a('0x53')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x8]?_0x1d1c7a[_0x5d8a('0x41')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1d1c7a[_0x5d8a('0x54')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x9]?_0x1d1c7a['attrs'][0x9][_0x5d8a('0x42')]:undefined)||''},{'name':_0x5d8a('0x55'),'value':_0x1d1c7a[_0x5d8a('0x55')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0xa]?_0x1d1c7a['attrs'][0xa][_0x5d8a('0x42')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x1d1c7a[_0x5d8a('0x5a')]||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x0]?_0x1d1c7a[_0x5d8a('0x41')][0x0][_0x5d8a('0x3f')]:undefined)||null,'value':_0x1d1c7a['attrReport']||(_0x1d1c7a[_0x5d8a('0x41')]&&_0x1d1c7a[_0x5d8a('0x41')][0x0]?_0x1d1c7a['attrs'][0x0][_0x5d8a('0x42')]:undefined)||null},{'name':'attrRefresh','value':_0x1d1c7a['attrRefresh']||(_0x1d1c7a['attrs']&&_0x1d1c7a[_0x5d8a('0x41')][0x1]?_0x1d1c7a['attrs'][0x1][_0x5d8a('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x413fb7){logger[_0x5d8a('0x2e')](_0x5d8a('0x5b'),JSON[_0x5d8a('0x5c')](_0x413fb7));return[];}}exports['create']=function(_0x44becd,_0x3e4d0d){if(_0x44becd[_0x5d8a('0x5d')]){_0x44becd[_0x5d8a('0x5d')]['attrs']=widgetAttributes(_0x44becd[_0x5d8a('0x5d')]);}return db[_0x5d8a('0x3e')][_0x5d8a('0x5e')](_0x44becd[_0x5d8a('0x5d')],{})[_0x5d8a('0x2d')](respondWithResult(_0x3e4d0d,0xc9))[_0x5d8a('0x3d')](handleError(_0x3e4d0d,null));};exports[_0x5d8a('0x2b')]=function(_0x5213ae,_0x16b070){if(_0x5213ae[_0x5d8a('0x5d')]['id']){delete _0x5213ae['body']['id'];}_0x5213ae['body'][_0x5d8a('0x41')]=widgetAttributes(_0x5213ae[_0x5d8a('0x5d')]);return db[_0x5d8a('0x3e')][_0x5d8a('0x3c')]({'where':{'id':_0x5213ae[_0x5d8a('0x32')]['id']}})[_0x5d8a('0x2d')](handleEntityNotFound(_0x16b070,null))[_0x5d8a('0x2d')](saveUpdates(_0x5213ae[_0x5d8a('0x5d')],null))[_0x5d8a('0x2d')](respondWithResult(_0x16b070,null))[_0x5d8a('0x3d')](handleError(_0x16b070,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 1806bd3..0718e64 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 _0x6824=['../../mysqldb','DashboardItem','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x52eb16,_0x89c3d8){var _0x382d3f=function(_0x378238){while(--_0x378238){_0x52eb16['push'](_0x52eb16['shift']());}};_0x382d3f(++_0x89c3d8);}(_0x6824,0x104));var _0x4682=function(_0x1954ee,_0x2eeed1){_0x1954ee=_0x1954ee-0x0;var _0x3f19f2=_0x6824[_0x1954ee];return _0x3f19f2;};'use strict';var EventEmitter=require(_0x4682('0x0'));var DashboardItem=require(_0x4682('0x1'))['db'][_0x4682('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4682('0x3'),'afterUpdate':_0x4682('0x4'),'afterDestroy':_0x4682('0x5')};function emitEvent(_0x55b4a6){return function(_0x269bf3,_0x35d080,_0x52a911){DashboardItemEvents[_0x4682('0x6')](_0x55b4a6+':'+_0x269bf3['id'],_0x269bf3);DashboardItemEvents[_0x4682('0x6')](_0x55b4a6,_0x269bf3);_0x52a911(null);};}for(var e in events){if(events[_0x4682('0x7')](e)){var event=events[e];DashboardItem[_0x4682('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x5848=['exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hook'];(function(_0x4c6999,_0x3f93b1){var _0x2ea471=function(_0x4dbece){while(--_0x4dbece){_0x4c6999['push'](_0x4c6999['shift']());}};_0x2ea471(++_0x3f93b1);}(_0x5848,0x17d));var _0x8584=function(_0x58dc59,_0x596f64){_0x58dc59=_0x58dc59-0x0;var _0x26405b=_0x5848[_0x58dc59];return _0x26405b;};'use strict';var EventEmitter=require(_0x8584('0x0'));var DashboardItem=require(_0x8584('0x1'))['db'][_0x8584('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x8584('0x3')](0x0);var events={'afterCreate':_0x8584('0x4'),'afterUpdate':_0x8584('0x5'),'afterDestroy':_0x8584('0x6')};function emitEvent(_0x492407){return function(_0x293719,_0x423895,_0x5490c9){DashboardItemEvents[_0x8584('0x7')](_0x492407+':'+_0x293719['id'],_0x293719);DashboardItemEvents[_0x8584('0x7')](_0x492407,_0x293719);_0x5490c9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x8584('0x8')](e,emitEvent(event));}}module[_0x8584('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 0a46aff..1d1a2da 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 _0x0359=['define','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x13e325,_0xbbb21f){var _0x49dfed=function(_0x59ce21){while(--_0x59ce21){_0x13e325['push'](_0x13e325['shift']());}};_0x49dfed(++_0xbbb21f);}(_0x0359,0xf4));var _0x9035=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x0359[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require(_0x9035('0x0'));var logger=require(_0x9035('0x1'))(_0x9035('0x2'));var moment=require(_0x9035('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9035('0x4'));var rimraf=require(_0x9035('0x5'));var config=require(_0x9035('0x6'));var attributes=require('./dashboardItem.attributes');module[_0x9035('0x7')]=function(_0x21d2f7,_0x31f408){return _0x21d2f7[_0x9035('0x8')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x23b4=['exports','DashboardItem','dashboard_items','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x23b4,0x16e));var _0x423b=function(_0x2cf7dd,_0x26172a){_0x2cf7dd=_0x2cf7dd-0x0;var _0x20450a=_0x23b4[_0x2cf7dd];return _0x20450a;};'use strict';var _=require('lodash');var util=require(_0x423b('0x0'));var logger=require(_0x423b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x423b('0x2'));var rp=require(_0x423b('0x3'));var fs=require('fs');var path=require(_0x423b('0x4'));var rimraf=require(_0x423b('0x5'));var config=require(_0x423b('0x6'));var attributes=require(_0x423b('0x7'));module[_0x423b('0x8')]=function(_0x496524,_0x179257){return _0x496524['define'](_0x423b('0x9'),attributes,{'tableName':_0x423b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 41f4b2f..4abafe0 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 _0xf4c3=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x39c78f,_0x413f03){var _0xd13125=function(_0x16949c){while(--_0x16949c){_0x39c78f['push'](_0x39c78f['shift']());}};_0xd13125(++_0x413f03);}(_0xf4c3,0x1df));var _0x3f4c=function(_0x47a204,_0x24b906){_0x47a204=_0x47a204-0x0;var _0x5623fc=_0xf4c3[_0x47a204];return _0x5623fc;};'use strict';var _=require(_0x3f4c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3f4c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f4c('0x2'));var db=require(_0x3f4c('0x3'))['db'];var utils=require(_0x3f4c('0x4'));var logger=require(_0x3f4c('0x5'))(_0x3f4c('0x6'));var config=require(_0x3f4c('0x7'));var jayson=require(_0x3f4c('0x8'));var client=jayson[_0x3f4c('0x9')][_0x3f4c('0xa')]({'port':0x232a});config[_0x3f4c('0xb')]=_[_0x3f4c('0xc')](config['redis'],{'host':_0x3f4c('0xd'),'port':0x18eb});var socket=require(_0x3f4c('0xe'))(new Redis(config[_0x3f4c('0xb')]));require(_0x3f4c('0xf'))[_0x3f4c('0x10')](socket);function respondWithRpcPromise(_0x10e002,_0x249c7c,_0x48d6c3){return new BPromise(function(_0x4d68c4,_0x45738b){return client['request'](_0x10e002,_0x48d6c3)[_0x3f4c('0x11')](function(_0xd81e9f){logger[_0x3f4c('0x12')](_0x3f4c('0x13'),_0x249c7c,'request\x20sent');logger[_0x3f4c('0x14')](_0x3f4c('0x15'),_0x249c7c,_0x3f4c('0x16'),JSON[_0x3f4c('0x17')](_0xd81e9f));if(_0xd81e9f[_0x3f4c('0x18')]){if(_0xd81e9f['error']['code']===0x1f4){logger['error'](_0x3f4c('0x13'),_0x249c7c,_0xd81e9f['error'][_0x3f4c('0x19')]);return _0x45738b(_0xd81e9f[_0x3f4c('0x18')]['message']);}logger['error'](_0x3f4c('0x13'),_0x249c7c,_0xd81e9f[_0x3f4c('0x18')][_0x3f4c('0x19')]);return _0x4d68c4(_0xd81e9f['error'][_0x3f4c('0x19')]);}else{logger[_0x3f4c('0x12')]('DashboardItem,\x20%s,\x20%s',_0x249c7c,'request\x20sent');_0x4d68c4(_0xd81e9f[_0x3f4c('0x1a')][_0x3f4c('0x19')]);}})['catch'](function(_0x37f975){logger[_0x3f4c('0x18')]('DashboardItem,\x20%s,\x20%s',_0x249c7c,_0x37f975);_0x45738b(_0x37f975);});});} \ No newline at end of file +var _0x83dc=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x51639a,_0x35f006){var _0x3abae4=function(_0x89b35e){while(--_0x89b35e){_0x51639a['push'](_0x51639a['shift']());}};_0x3abae4(++_0x35f006);}(_0x83dc,0x182));var _0xc83d=function(_0x2a741e,_0x3e398e){_0x2a741e=_0x2a741e-0x0;var _0x5180af=_0x83dc[_0x2a741e];return _0x5180af;};'use strict';var _=require(_0xc83d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc83d('0x1'));var rs=require(_0xc83d('0x2'));var fs=require('fs');var Redis=require(_0xc83d('0x3'));var db=require(_0xc83d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc83d('0x5'))(_0xc83d('0x6'));var config=require(_0xc83d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc83d('0x8')]['http']({'port':0x232a});config[_0xc83d('0x9')]=_[_0xc83d('0xa')](config[_0xc83d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc83d('0xb'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0xc83d('0xc')](socket);function respondWithRpcPromise(_0xbd35a7,_0x4b01a8,_0x29c8f8){return new BPromise(function(_0x5b5871,_0x55de82){return client[_0xc83d('0xd')](_0xbd35a7,_0x29c8f8)[_0xc83d('0xe')](function(_0x2fbdc0){logger['info'](_0xc83d('0xf'),_0x4b01a8,_0xc83d('0x10'));logger[_0xc83d('0x11')](_0xc83d('0x12'),_0x4b01a8,_0xc83d('0x10'),JSON[_0xc83d('0x13')](_0x2fbdc0));if(_0x2fbdc0['error']){if(_0x2fbdc0[_0xc83d('0x14')][_0xc83d('0x15')]===0x1f4){logger[_0xc83d('0x14')](_0xc83d('0xf'),_0x4b01a8,_0x2fbdc0[_0xc83d('0x14')][_0xc83d('0x16')]);return _0x55de82(_0x2fbdc0[_0xc83d('0x14')][_0xc83d('0x16')]);}logger[_0xc83d('0x14')](_0xc83d('0xf'),_0x4b01a8,_0x2fbdc0[_0xc83d('0x14')][_0xc83d('0x16')]);return _0x5b5871(_0x2fbdc0['error'][_0xc83d('0x16')]);}else{logger[_0xc83d('0x17')](_0xc83d('0xf'),_0x4b01a8,'request\x20sent');_0x5b5871(_0x2fbdc0[_0xc83d('0x18')]['message']);}})[_0xc83d('0x19')](function(_0x3e7053){logger['error']('DashboardItem,\x20%s,\x20%s',_0x4b01a8,_0x3e7053);_0x55de82(_0x3e7053);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 1fe1ef8..9783c5c 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 _0xaac0=['update','removeListener','register','length','dashboardItem:','./dashboardItem.events','remove'];(function(_0x50d1c6,_0x40051c){var _0x3cd375=function(_0x5bcfd9){while(--_0x5bcfd9){_0x50d1c6['push'](_0x50d1c6['shift']());}};_0x3cd375(++_0x40051c);}(_0xaac0,0x1da));var _0x0aac=function(_0x34559b,_0x42b8ed){_0x34559b=_0x34559b-0x0;var _0x517ca8=_0xaac0[_0x34559b];return _0x517ca8;};'use strict';var DashboardItemEvents=require(_0x0aac('0x0'));var events=['save',_0x0aac('0x1'),_0x0aac('0x2')];function createListener(_0x19d60a,_0xa221fc){return function(_0x437da5){_0xa221fc['emit'](_0x19d60a,_0x437da5);};}function removeListener(_0x5be960,_0x2a5e69){return function(){DashboardItemEvents[_0x0aac('0x3')](_0x5be960,_0x2a5e69);};}exports[_0x0aac('0x4')]=function(_0x4491be){for(var _0x57e714=0x0,_0x16c9dc=events[_0x0aac('0x5')];_0x57e714<_0x16c9dc;_0x57e714++){var _0x5749c5=events[_0x57e714];var _0x52d10f=createListener(_0x0aac('0x6')+_0x5749c5,_0x4491be);DashboardItemEvents['on'](_0x5749c5,_0x52d10f);}}; \ No newline at end of file +var _0x1864=['save','update','emit','register','./dashboardItem.events'];(function(_0x4ee97e,_0x4b17bc){var _0x575183=function(_0x46c9c2){while(--_0x46c9c2){_0x4ee97e['push'](_0x4ee97e['shift']());}};_0x575183(++_0x4b17bc);}(_0x1864,0x17b));var _0x4186=function(_0x3868d4,_0x5a3d1b){_0x3868d4=_0x3868d4-0x0;var _0x1e4a20=_0x1864[_0x3868d4];return _0x1e4a20;};'use strict';var DashboardItemEvents=require(_0x4186('0x0'));var events=[_0x4186('0x1'),'remove',_0x4186('0x2')];function createListener(_0x2e8cd4,_0x59cf3a){return function(_0x2d3f27){_0x59cf3a[_0x4186('0x3')](_0x2e8cd4,_0x2d3f27);};}function removeListener(_0x44a9cb,_0x57b0b1){return function(){DashboardItemEvents['removeListener'](_0x44a9cb,_0x57b0b1);};}exports[_0x4186('0x4')]=function(_0xc0c2e8){for(var _0xa39b84=0x0,_0x382cc2=events['length'];_0xa39b84<_0x382cc2;_0xa39b84++){var _0x56a361=events[_0xa39b84];var _0x1951cd=createListener('dashboardItem:'+_0x56a361,_0xc0c2e8);DashboardItemEvents['on'](_0x56a361,_0x1951cd);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 3465ae7..f3f4382 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 _0x15f8=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x3ebbc4,_0x1e2ed7){var _0x598d1d=function(_0x1fdadc){while(--_0x1fdadc){_0x3ebbc4['push'](_0x3ebbc4['shift']());}};_0x598d1d(++_0x1e2ed7);}(_0x15f8,0x1aa));var _0x815f=function(_0x156dc8,_0x4bcf44){_0x156dc8=_0x156dc8-0x0;var _0x31a381=_0x15f8[_0x156dc8];return _0x31a381;};'use strict';var multer=require(_0x815f('0x0'));var util=require(_0x815f('0x1'));var path=require(_0x815f('0x2'));var timeout=require('connect-timeout');var express=require(_0x815f('0x3'));var router=express[_0x815f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x815f('0x5'));var interaction=require(_0x815f('0x6'));var config=require(_0x815f('0x7'));var controller=require('./dashboardItem.controller');router[_0x815f('0x8')](_0x815f('0x9'),auth[_0x815f('0xa')](),controller[_0x815f('0xb')]);router[_0x815f('0xc')]('/',auth['isAuthenticated'](),controller[_0x815f('0xd')]);router[_0x815f('0xe')](_0x815f('0x9'),auth[_0x815f('0xa')](),controller[_0x815f('0xf')]);router[_0x815f('0x10')](_0x815f('0x9'),auth[_0x815f('0xa')](),controller['destroy']);module[_0x815f('0x11')]=router; \ No newline at end of file +var _0xbe1f=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','create','put','update','destroy','exports','multer'];(function(_0x331136,_0x15c2e9){var _0x1d0359=function(_0x555a86){while(--_0x555a86){_0x331136['push'](_0x331136['shift']());}};_0x1d0359(++_0x15c2e9);}(_0xbe1f,0x8b));var _0xfbe1=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbe1f[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0xfbe1('0x0'));var util=require(_0xfbe1('0x1'));var path=require(_0xfbe1('0x2'));var timeout=require(_0xfbe1('0x3'));var express=require(_0xfbe1('0x4'));var router=express[_0xfbe1('0x5')]();var fs_extra=require(_0xfbe1('0x6'));var auth=require(_0xfbe1('0x7'));var interaction=require(_0xfbe1('0x8'));var config=require(_0xfbe1('0x9'));var controller=require(_0xfbe1('0xa'));router[_0xfbe1('0xb')](_0xfbe1('0xc'),auth[_0xfbe1('0xd')](),controller[_0xfbe1('0xe')]);router['post']('/',auth[_0xfbe1('0xd')](),controller[_0xfbe1('0xf')]);router[_0xfbe1('0x10')]('/:id',auth[_0xfbe1('0xd')](),controller[_0xfbe1('0x11')]);router['delete'](_0xfbe1('0xc'),auth[_0xfbe1('0xd')](),controller[_0xfbe1('0x12')]);module[_0xfbe1('0x13')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 8b81207..e7e2ad6 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 _0x001e=['STRING','ENUM','second','first','sequelize','exports'];(function(_0x14ab76,_0xb25263){var _0x51c311=function(_0x190f5b){while(--_0x190f5b){_0x14ab76['push'](_0x14ab76['shift']());}};_0x51c311(++_0xb25263);}(_0x001e,0x88));var _0xe001=function(_0x469c7f,_0x4b6e5d){_0x469c7f=_0x469c7f-0x0;var _0x5282f2=_0x001e[_0x469c7f];return _0x5282f2;};'use strict';var Sequelize=require(_0xe001('0x0'));module[_0xe001('0x1')]={'name':{'type':Sequelize[_0xe001('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xe001('0x3')]('first',_0xe001('0x4'),'third'),'allowNull':![],'defaultValue':_0xe001('0x5')},'description':{'type':Sequelize[_0xe001('0x2')]}}; \ No newline at end of file +var _0xca62=['STRING','second','third','first','sequelize','exports'];(function(_0x17228a,_0x41792b){var _0x17490c=function(_0x359dac){while(--_0x359dac){_0x17228a['push'](_0x17228a['shift']());}};_0x17490c(++_0x41792b);}(_0xca62,0x64));var _0x2ca6=function(_0x821e8c,_0x40569b){_0x821e8c=_0x821e8c-0x0;var _0x30ac8a=_0xca62[_0x821e8c];return _0x30ac8a;};'use strict';var Sequelize=require(_0x2ca6('0x0'));module[_0x2ca6('0x1')]={'name':{'type':Sequelize[_0x2ca6('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0x2ca6('0x3'),_0x2ca6('0x4')),'allowNull':![],'defaultValue':_0x2ca6('0x5')},'description':{'type':Sequelize[_0x2ca6('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index a3cf8a6..9a14c9d 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 _0x9ade=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','get','Dispositions','UserProfileResource','error','name','send','index','map','Disposition','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3926c4,_0xee03f6){var _0x42250b=function(_0x2944ca){while(--_0x2944ca){_0x3926c4['push'](_0x3926c4['shift']());}};_0x42250b(++_0xee03f6);}(_0x9ade,0x8e));var _0xe9ad=function(_0x98417d,_0x2d249c){_0x98417d=_0x98417d-0x0;var _0x51ee3c=_0x9ade[_0x98417d];return _0x51ee3c;};'use strict';var emlformat=require(_0xe9ad('0x0'));var rimraf=require(_0xe9ad('0x1'));var zipdir=require(_0xe9ad('0x2'));var jsonpatch=require(_0xe9ad('0x3'));var rp=require(_0xe9ad('0x4'));var moment=require(_0xe9ad('0x5'));var BPromise=require(_0xe9ad('0x6'));var Mustache=require(_0xe9ad('0x7'));var util=require(_0xe9ad('0x8'));var path=require(_0xe9ad('0x9'));var sox=require('sox');var csv=require(_0xe9ad('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9ad('0xb'));var squel=require(_0xe9ad('0xc'));var crypto=require(_0xe9ad('0xd'));var jsforce=require(_0xe9ad('0xe'));var deskjs=require(_0xe9ad('0xf'));var toCsv=require(_0xe9ad('0xa'));var querystring=require(_0xe9ad('0x10'));var Papa=require(_0xe9ad('0x11'));var Redis=require(_0xe9ad('0x12'));var authService=require(_0xe9ad('0x13'));var qs=require(_0xe9ad('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe9ad('0x15'));var logger=require(_0xe9ad('0x16'))('api');var utils=require(_0xe9ad('0x17'));var config=require(_0xe9ad('0x18'));var licenseUtil=require(_0xe9ad('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x436bd2,_0x4c25c3){_0x4c25c3=_0x4c25c3||0xcc;return function(_0x51ac8e){if(_0x51ac8e){return _0x436bd2[_0xe9ad('0x1a')](_0x4c25c3);}return _0x436bd2[_0xe9ad('0x1b')](_0x4c25c3)[_0xe9ad('0x1c')]();};}function respondWithResult(_0xe57dbe,_0x1c5cef){_0x1c5cef=_0x1c5cef||0xc8;return function(_0x338052){if(_0x338052){return _0xe57dbe[_0xe9ad('0x1b')](_0x1c5cef)[_0xe9ad('0x1d')](_0x338052);}};}function respondWithFilteredResult(_0x59ac31,_0x7c6fb8){return function(_0x448616){if(_0x448616){var _0x37c6a9=typeof _0x7c6fb8[_0xe9ad('0x1e')]===_0xe9ad('0x1f')&&typeof _0x7c6fb8[_0xe9ad('0x20')]==='undefined';var _0x30e5ed=_0x448616[_0xe9ad('0x21')];var _0x2e3691=_0x37c6a9?0x0:_0x7c6fb8[_0xe9ad('0x1e')];var _0x42a934=_0x37c6a9?_0x448616[_0xe9ad('0x21')]:_0x7c6fb8[_0xe9ad('0x1e')]+_0x7c6fb8[_0xe9ad('0x20')];var _0x473aef;if(_0x42a934>=_0x30e5ed){_0x42a934=_0x30e5ed;_0x473aef=0xc8;}else{_0x473aef=0xce;}_0x59ac31[_0xe9ad('0x1b')](_0x473aef);return _0x59ac31[_0xe9ad('0x22')]('Content-Range',_0x2e3691+'-'+_0x42a934+'/'+_0x30e5ed)[_0xe9ad('0x1d')](_0x448616);}return null;};}function patchUpdates(_0x5e775f){return function(_0x3fff1e){try{jsonpatch['apply'](_0x3fff1e,_0x5e775f,!![]);}catch(_0x3c1911){return BPromise['reject'](_0x3c1911);}return _0x3fff1e[_0xe9ad('0x23')]();};}function saveUpdates(_0x37089a,_0x2c43fb){return function(_0x4f3d4e){if(_0x4f3d4e){return _0x4f3d4e['update'](_0x37089a)[_0xe9ad('0x24')](function(_0x39c9b6){return _0x39c9b6;});}return null;};}function removeEntity(_0x533f57,_0x6d555f){return function(_0x7454cb){if(_0x7454cb){return _0x7454cb[_0xe9ad('0x25')]()['then'](function(){var _0x19c705=_0x7454cb[_0xe9ad('0x26')]({'plain':!![]});var _0x1cce72=_0xe9ad('0x27');return db[_0xe9ad('0x28')]['destroy']({'where':{'type':_0x1cce72,'resourceId':_0x19c705['id']}})[_0xe9ad('0x24')](function(){return _0x7454cb;});})[_0xe9ad('0x24')](function(){_0x533f57[_0xe9ad('0x1b')](0xcc)[_0xe9ad('0x1c')]();});}};}function handleEntityNotFound(_0x20ee77,_0x27b0eb){return function(_0x58b582){if(!_0x58b582){_0x20ee77['sendStatus'](0x194);}return _0x58b582;};}function handleError(_0x276303,_0x4a9916){_0x4a9916=_0x4a9916||0x1f4;return function(_0x23cd32){logger[_0xe9ad('0x29')](_0x23cd32['stack']);if(_0x23cd32[_0xe9ad('0x2a')]){delete _0x23cd32[_0xe9ad('0x2a')];}_0x276303[_0xe9ad('0x1b')](_0x4a9916)[_0xe9ad('0x2b')](_0x23cd32);};}exports[_0xe9ad('0x2c')]=function(_0x1d9928,_0x1e2003){var _0x562cb5={},_0x193cf2={},_0x26d1c7={'count':0x0,'rows':[]};var _0x2b0a6f=_[_0xe9ad('0x2d')](db[_0xe9ad('0x2e')][_0xe9ad('0x2f')],function(_0x249c78){return{'name':_0x249c78['fieldName'],'type':_0x249c78[_0xe9ad('0x30')][_0xe9ad('0x31')]};});_0x193cf2[_0xe9ad('0x32')]=_[_0xe9ad('0x2d')](_0x2b0a6f,'name');_0x193cf2[_0xe9ad('0x33')]=_['keys'](_0x1d9928[_0xe9ad('0x33')]);_0x193cf2[_0xe9ad('0x34')]=_[_0xe9ad('0x35')](_0x193cf2[_0xe9ad('0x32')],_0x193cf2[_0xe9ad('0x33')]);_0x562cb5[_0xe9ad('0x36')]=_['intersection'](_0x193cf2[_0xe9ad('0x32')],qs[_0xe9ad('0x37')](_0x1d9928[_0xe9ad('0x33')][_0xe9ad('0x37')]));_0x562cb5[_0xe9ad('0x36')]=_0x562cb5['attributes'][_0xe9ad('0x38')]?_0x562cb5[_0xe9ad('0x36')]:_0x193cf2[_0xe9ad('0x32')];if(!_0x1d9928[_0xe9ad('0x33')]['hasOwnProperty']('nolimit')){_0x562cb5[_0xe9ad('0x20')]=qs[_0xe9ad('0x20')](_0x1d9928['query'][_0xe9ad('0x20')]);_0x562cb5[_0xe9ad('0x1e')]=qs['offset'](_0x1d9928[_0xe9ad('0x33')]['offset']);}_0x562cb5[_0xe9ad('0x39')]=qs[_0xe9ad('0x3a')](_0x1d9928[_0xe9ad('0x33')]['sort']);_0x562cb5[_0xe9ad('0x3b')]=qs['filters'](_[_0xe9ad('0x3c')](_0x1d9928[_0xe9ad('0x33')],_0x193cf2[_0xe9ad('0x34')]),_0x2b0a6f);if(_0x1d9928[_0xe9ad('0x33')][_0xe9ad('0x3d')]){_0x562cb5['where']=_[_0xe9ad('0x3e')](_0x562cb5['where'],{'$or':_[_0xe9ad('0x2d')](_0x2b0a6f,function(_0x873a5a){if(_0x873a5a['type']!==_0xe9ad('0x3f')){var _0x551d25={};_0x551d25[_0x873a5a['name']]={'$like':'%'+_0x1d9928[_0xe9ad('0x33')][_0xe9ad('0x3d')]+'%'};return _0x551d25;}})});}_0x562cb5=_[_0xe9ad('0x3e')]({},_0x562cb5,_0x1d9928['options']);var _0x1b4cae={'where':_0x562cb5['where']};return db['Disposition'][_0xe9ad('0x21')](_0x1b4cae)[_0xe9ad('0x24')](function(_0x1cfffc){_0x26d1c7[_0xe9ad('0x21')]=_0x1cfffc;if(_0x1d9928[_0xe9ad('0x33')][_0xe9ad('0x40')]){_0x562cb5['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x562cb5);})[_0xe9ad('0x24')](function(_0x13fd26){_0x26d1c7[_0xe9ad('0x41')]=_0x13fd26;return _0x26d1c7;})[_0xe9ad('0x24')](respondWithFilteredResult(_0x1e2003,_0x562cb5))[_0xe9ad('0x42')](handleError(_0x1e2003,null));};exports[_0xe9ad('0x43')]=function(_0x4afd4c,_0x2e7885){var _0x5f4e42={'raw':!![],'where':{'id':_0x4afd4c[_0xe9ad('0x44')]['id']}},_0x18733f={};_0x18733f['model']=_[_0xe9ad('0x45')](db[_0xe9ad('0x2e')]['rawAttributes']);_0x18733f[_0xe9ad('0x33')]=_['keys'](_0x4afd4c['query']);_0x18733f[_0xe9ad('0x34')]=_[_0xe9ad('0x35')](_0x18733f['model'],_0x18733f[_0xe9ad('0x33')]);_0x5f4e42[_0xe9ad('0x36')]=_[_0xe9ad('0x35')](_0x18733f[_0xe9ad('0x32')],qs[_0xe9ad('0x37')](_0x4afd4c[_0xe9ad('0x33')][_0xe9ad('0x37')]));_0x5f4e42[_0xe9ad('0x36')]=_0x5f4e42[_0xe9ad('0x36')][_0xe9ad('0x38')]?_0x5f4e42[_0xe9ad('0x36')]:_0x18733f[_0xe9ad('0x32')];if(_0x4afd4c[_0xe9ad('0x33')][_0xe9ad('0x40')]){_0x5f4e42[_0xe9ad('0x46')]=[{'all':!![]}];}_0x5f4e42=_[_0xe9ad('0x3e')]({},_0x5f4e42,_0x4afd4c[_0xe9ad('0x47')]);return db[_0xe9ad('0x2e')][_0xe9ad('0x48')](_0x5f4e42)[_0xe9ad('0x24')](handleEntityNotFound(_0x2e7885,null))[_0xe9ad('0x24')](respondWithResult(_0x2e7885,null))[_0xe9ad('0x42')](handleError(_0x2e7885,null));};exports['create']=function(_0x436772,_0x2f123c){return db[_0xe9ad('0x2e')][_0xe9ad('0x49')](_0x436772[_0xe9ad('0x4a')],{})['then'](function(_0x595f84){var _0x315403=_0x436772[_0xe9ad('0x4b')][_0xe9ad('0x26')]({'plain':!![]});if(!_0x315403)throw new Error(_0xe9ad('0x4c'));if(_0x315403['role']==='user'){var _0x2a5c9f=_0x595f84[_0xe9ad('0x26')]({'plain':!![]});var _0x2feb01=_0xe9ad('0x27');return db[_0xe9ad('0x4d')][_0xe9ad('0x48')]({'where':{'name':_0x2feb01,'userProfileId':_0x315403[_0xe9ad('0x4e')]},'raw':!![]})['then'](function(_0x2b1812){if(_0x2b1812&&_0x2b1812[_0xe9ad('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x2a5c9f[_0xe9ad('0x2a')],'resourceId':_0x2a5c9f['id'],'type':_0x2b1812['name'],'sectionId':_0x2b1812['id']},{})[_0xe9ad('0x24')](function(){return _0x595f84;});}else{return _0x595f84;}})[_0xe9ad('0x42')](function(_0x202590){logger[_0xe9ad('0x29')](_0xe9ad('0x50'),_0x202590);throw _0x202590;});}return _0x595f84;})['then'](respondWithResult(_0x2f123c,0xc9))['catch'](handleError(_0x2f123c,null));};exports[_0xe9ad('0x51')]=function(_0x4669ec,_0x5f3be7){if(_0x4669ec[_0xe9ad('0x4a')]['id']){delete _0x4669ec[_0xe9ad('0x4a')]['id'];}return db[_0xe9ad('0x2e')][_0xe9ad('0x48')]({'where':{'id':_0x4669ec[_0xe9ad('0x44')]['id']}})[_0xe9ad('0x24')](handleEntityNotFound(_0x5f3be7,null))['then'](saveUpdates(_0x4669ec[_0xe9ad('0x4a')],null))[_0xe9ad('0x24')](respondWithResult(_0x5f3be7,null))[_0xe9ad('0x42')](handleError(_0x5f3be7,null));};exports[_0xe9ad('0x25')]=function(_0x279310,_0x38d9ad){return db['Disposition']['find']({'where':{'id':_0x279310[_0xe9ad('0x44')]['id']}})['then'](handleEntityNotFound(_0x38d9ad,null))[_0xe9ad('0x24')](removeEntity(_0x38d9ad,null))[_0xe9ad('0x42')](handleError(_0x38d9ad,null));}; \ No newline at end of file +var _0xb0df=['count','set','Content-Range','apply','reject','save','then','destroy','get','Dispositions','UserProfileResource','end','error','stack','name','send','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','options','Disposition','includeAll','findAll','rows','catch','show','params','include','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xb0df,0x85));var _0xfb0d=function(_0x2932cf,_0x362fd9){_0x2932cf=_0x2932cf-0x0;var _0x1711dd=_0xb0df[_0x2932cf];return _0x1711dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb0d('0x0'));var zipdir=require(_0xfb0d('0x1'));var jsonpatch=require(_0xfb0d('0x2'));var rp=require(_0xfb0d('0x3'));var moment=require(_0xfb0d('0x4'));var BPromise=require(_0xfb0d('0x5'));var Mustache=require(_0xfb0d('0x6'));var util=require(_0xfb0d('0x7'));var path=require(_0xfb0d('0x8'));var sox=require('sox');var csv=require(_0xfb0d('0x9'));var ejs=require(_0xfb0d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfb0d('0xb'));var crypto=require(_0xfb0d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfb0d('0x9'));var querystring=require(_0xfb0d('0xd'));var Papa=require('papaparse');var Redis=require(_0xfb0d('0xe'));var authService=require(_0xfb0d('0xf'));var qs=require(_0xfb0d('0x10'));var as=require(_0xfb0d('0x11'));var hardwareService=require(_0xfb0d('0x12'));var logger=require(_0xfb0d('0x13'))('api');var utils=require(_0xfb0d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfb0d('0x15'));var db=require(_0xfb0d('0x16'))['db'];function respondWithStatusCode(_0x254576,_0x2e9f20){_0x2e9f20=_0x2e9f20||0xcc;return function(_0x244260){if(_0x244260){return _0x254576[_0xfb0d('0x17')](_0x2e9f20);}return _0x254576[_0xfb0d('0x18')](_0x2e9f20)['end']();};}function respondWithResult(_0x505e22,_0x5b7e54){_0x5b7e54=_0x5b7e54||0xc8;return function(_0x13ec1c){if(_0x13ec1c){return _0x505e22[_0xfb0d('0x18')](_0x5b7e54)[_0xfb0d('0x19')](_0x13ec1c);}};}function respondWithFilteredResult(_0x14751e,_0x38c64b){return function(_0x241a5e){if(_0x241a5e){var _0xced21c=typeof _0x38c64b['offset']===_0xfb0d('0x1a')&&typeof _0x38c64b[_0xfb0d('0x1b')]===_0xfb0d('0x1a');var _0x2aa48d=_0x241a5e['count'];var _0x28f8dc=_0xced21c?0x0:_0x38c64b[_0xfb0d('0x1c')];var _0x374de1=_0xced21c?_0x241a5e[_0xfb0d('0x1d')]:_0x38c64b[_0xfb0d('0x1c')]+_0x38c64b[_0xfb0d('0x1b')];var _0x2778ab;if(_0x374de1>=_0x2aa48d){_0x374de1=_0x2aa48d;_0x2778ab=0xc8;}else{_0x2778ab=0xce;}_0x14751e['status'](_0x2778ab);return _0x14751e[_0xfb0d('0x1e')](_0xfb0d('0x1f'),_0x28f8dc+'-'+_0x374de1+'/'+_0x2aa48d)[_0xfb0d('0x19')](_0x241a5e);}return null;};}function patchUpdates(_0x412173){return function(_0x258004){try{jsonpatch[_0xfb0d('0x20')](_0x258004,_0x412173,!![]);}catch(_0x2fb83c){return BPromise[_0xfb0d('0x21')](_0x2fb83c);}return _0x258004[_0xfb0d('0x22')]();};}function saveUpdates(_0x21e334,_0x3411cb){return function(_0x5ef220){if(_0x5ef220){return _0x5ef220['update'](_0x21e334)[_0xfb0d('0x23')](function(_0x1b2096){return _0x1b2096;});}return null;};}function removeEntity(_0x5a0200,_0x580c01){return function(_0x3bd70b){if(_0x3bd70b){return _0x3bd70b[_0xfb0d('0x24')]()['then'](function(){var _0x85663a=_0x3bd70b[_0xfb0d('0x25')]({'plain':!![]});var _0x1c234c=_0xfb0d('0x26');return db[_0xfb0d('0x27')][_0xfb0d('0x24')]({'where':{'type':_0x1c234c,'resourceId':_0x85663a['id']}})[_0xfb0d('0x23')](function(){return _0x3bd70b;});})[_0xfb0d('0x23')](function(){_0x5a0200[_0xfb0d('0x18')](0xcc)[_0xfb0d('0x28')]();});}};}function handleEntityNotFound(_0x1c6770,_0x803bdd){return function(_0x5ccecd){if(!_0x5ccecd){_0x1c6770[_0xfb0d('0x17')](0x194);}return _0x5ccecd;};}function handleError(_0x4313f0,_0x48ba7a){_0x48ba7a=_0x48ba7a||0x1f4;return function(_0x13de4){logger[_0xfb0d('0x29')](_0x13de4[_0xfb0d('0x2a')]);if(_0x13de4[_0xfb0d('0x2b')]){delete _0x13de4['name'];}_0x4313f0['status'](_0x48ba7a)[_0xfb0d('0x2c')](_0x13de4);};}exports['index']=function(_0x21f005,_0x58fdf1){var _0x38bdfc={},_0x3093f5={},_0x6a8b0e={'count':0x0,'rows':[]};var _0x404be1=_['map'](db['Disposition'][_0xfb0d('0x2d')],function(_0x3111a3){return{'name':_0x3111a3[_0xfb0d('0x2e')],'type':_0x3111a3[_0xfb0d('0x2f')]['key']};});_0x3093f5[_0xfb0d('0x30')]=_['map'](_0x404be1,_0xfb0d('0x2b'));_0x3093f5['query']=_[_0xfb0d('0x31')](_0x21f005[_0xfb0d('0x32')]);_0x3093f5[_0xfb0d('0x33')]=_[_0xfb0d('0x34')](_0x3093f5[_0xfb0d('0x30')],_0x3093f5[_0xfb0d('0x32')]);_0x38bdfc['attributes']=_[_0xfb0d('0x34')](_0x3093f5[_0xfb0d('0x30')],qs[_0xfb0d('0x35')](_0x21f005[_0xfb0d('0x32')][_0xfb0d('0x35')]));_0x38bdfc['attributes']=_0x38bdfc[_0xfb0d('0x36')][_0xfb0d('0x37')]?_0x38bdfc[_0xfb0d('0x36')]:_0x3093f5[_0xfb0d('0x30')];if(!_0x21f005['query']['hasOwnProperty']('nolimit')){_0x38bdfc[_0xfb0d('0x1b')]=qs[_0xfb0d('0x1b')](_0x21f005[_0xfb0d('0x32')][_0xfb0d('0x1b')]);_0x38bdfc[_0xfb0d('0x1c')]=qs[_0xfb0d('0x1c')](_0x21f005[_0xfb0d('0x32')]['offset']);}_0x38bdfc[_0xfb0d('0x38')]=qs[_0xfb0d('0x39')](_0x21f005['query']['sort']);_0x38bdfc[_0xfb0d('0x3a')]=qs[_0xfb0d('0x33')](_[_0xfb0d('0x3b')](_0x21f005[_0xfb0d('0x32')],_0x3093f5[_0xfb0d('0x33')]),_0x404be1);if(_0x21f005['query'][_0xfb0d('0x3c')]){_0x38bdfc[_0xfb0d('0x3a')]=_[_0xfb0d('0x3d')](_0x38bdfc[_0xfb0d('0x3a')],{'$or':_['map'](_0x404be1,function(_0x46dc01){if(_0x46dc01[_0xfb0d('0x2f')]!=='VIRTUAL'){var _0x40f11a={};_0x40f11a[_0x46dc01[_0xfb0d('0x2b')]]={'$like':'%'+_0x21f005[_0xfb0d('0x32')][_0xfb0d('0x3c')]+'%'};return _0x40f11a;}})});}_0x38bdfc=_[_0xfb0d('0x3d')]({},_0x38bdfc,_0x21f005[_0xfb0d('0x3e')]);var _0x51bef0={'where':_0x38bdfc[_0xfb0d('0x3a')]};return db[_0xfb0d('0x3f')][_0xfb0d('0x1d')](_0x51bef0)['then'](function(_0x22f73b){_0x6a8b0e[_0xfb0d('0x1d')]=_0x22f73b;if(_0x21f005['query'][_0xfb0d('0x40')]){_0x38bdfc['include']=[{'all':!![]}];}return db[_0xfb0d('0x3f')][_0xfb0d('0x41')](_0x38bdfc);})['then'](function(_0x52b2dc){_0x6a8b0e[_0xfb0d('0x42')]=_0x52b2dc;return _0x6a8b0e;})['then'](respondWithFilteredResult(_0x58fdf1,_0x38bdfc))[_0xfb0d('0x43')](handleError(_0x58fdf1,null));};exports[_0xfb0d('0x44')]=function(_0x1e24f8,_0x3d3a23){var _0x3a369e={'raw':!![],'where':{'id':_0x1e24f8[_0xfb0d('0x45')]['id']}},_0x26fd5e={};_0x26fd5e['model']=_[_0xfb0d('0x31')](db[_0xfb0d('0x3f')][_0xfb0d('0x2d')]);_0x26fd5e[_0xfb0d('0x32')]=_[_0xfb0d('0x31')](_0x1e24f8['query']);_0x26fd5e[_0xfb0d('0x33')]=_['intersection'](_0x26fd5e[_0xfb0d('0x30')],_0x26fd5e[_0xfb0d('0x32')]);_0x3a369e[_0xfb0d('0x36')]=_[_0xfb0d('0x34')](_0x26fd5e[_0xfb0d('0x30')],qs[_0xfb0d('0x35')](_0x1e24f8[_0xfb0d('0x32')]['fields']));_0x3a369e[_0xfb0d('0x36')]=_0x3a369e[_0xfb0d('0x36')][_0xfb0d('0x37')]?_0x3a369e[_0xfb0d('0x36')]:_0x26fd5e[_0xfb0d('0x30')];if(_0x1e24f8[_0xfb0d('0x32')]['includeAll']){_0x3a369e[_0xfb0d('0x46')]=[{'all':!![]}];}_0x3a369e=_[_0xfb0d('0x3d')]({},_0x3a369e,_0x1e24f8['options']);return db[_0xfb0d('0x3f')]['find'](_0x3a369e)['then'](handleEntityNotFound(_0x3d3a23,null))[_0xfb0d('0x23')](respondWithResult(_0x3d3a23,null))[_0xfb0d('0x43')](handleError(_0x3d3a23,null));};exports[_0xfb0d('0x47')]=function(_0x48085d,_0x3d6893){return db[_0xfb0d('0x3f')][_0xfb0d('0x47')](_0x48085d[_0xfb0d('0x48')],{})[_0xfb0d('0x23')](function(_0xe2acbf){var _0x25ba79=_0x48085d[_0xfb0d('0x49')][_0xfb0d('0x25')]({'plain':!![]});if(!_0x25ba79)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25ba79[_0xfb0d('0x4a')]==='user'){var _0x1a31de=_0xe2acbf['get']({'plain':!![]});var _0x8d6193='Dispositions';return db[_0xfb0d('0x4b')]['find']({'where':{'name':_0x8d6193,'userProfileId':_0x25ba79[_0xfb0d('0x4c')]},'raw':!![]})[_0xfb0d('0x23')](function(_0x4af07a){if(_0x4af07a&&_0x4af07a[_0xfb0d('0x4d')]===0x0){return db[_0xfb0d('0x27')][_0xfb0d('0x47')]({'name':_0x1a31de[_0xfb0d('0x2b')],'resourceId':_0x1a31de['id'],'type':_0x4af07a[_0xfb0d('0x2b')],'sectionId':_0x4af07a['id']},{})['then'](function(){return _0xe2acbf;});}else{return _0xe2acbf;}})[_0xfb0d('0x43')](function(_0x5735bb){logger[_0xfb0d('0x29')](_0xfb0d('0x4e'),_0x5735bb);throw _0x5735bb;});}return _0xe2acbf;})[_0xfb0d('0x23')](respondWithResult(_0x3d6893,0xc9))['catch'](handleError(_0x3d6893,null));};exports[_0xfb0d('0x4f')]=function(_0x1608c7,_0x41335d){if(_0x1608c7[_0xfb0d('0x48')]['id']){delete _0x1608c7['body']['id'];}return db[_0xfb0d('0x3f')][_0xfb0d('0x50')]({'where':{'id':_0x1608c7[_0xfb0d('0x45')]['id']}})[_0xfb0d('0x23')](handleEntityNotFound(_0x41335d,null))[_0xfb0d('0x23')](saveUpdates(_0x1608c7[_0xfb0d('0x48')],null))[_0xfb0d('0x23')](respondWithResult(_0x41335d,null))[_0xfb0d('0x43')](handleError(_0x41335d,null));};exports['destroy']=function(_0x312ada,_0x3a609f){return db[_0xfb0d('0x3f')]['find']({'where':{'id':_0x312ada[_0xfb0d('0x45')]['id']}})[_0xfb0d('0x23')](handleEntityNotFound(_0x3a609f,null))[_0xfb0d('0x23')](removeEntity(_0x3a609f,null))[_0xfb0d('0x43')](handleError(_0x3a609f,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 7b6897b..f964ce6 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 _0x1ddc=['name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice'];(function(_0x21a80c,_0x105ad1){var _0x432f5a=function(_0x3ebb06){while(--_0x3ebb06){_0x21a80c['push'](_0x21a80c['shift']());}};_0x432f5a(++_0x105ad1);}(_0x1ddc,0x1bb));var _0xc1dd=function(_0x266247,_0x1c303f){_0x266247=_0x266247-0x0;var _0x1396e3=_0x1ddc[_0x266247];return _0x1396e3;};'use strict';var _=require(_0xc1dd('0x0'));var util=require('util');var logger=require(_0xc1dd('0x1'))(_0xc1dd('0x2'));var moment=require(_0xc1dd('0x3'));var BPromise=require(_0xc1dd('0x4'));var rp=require(_0xc1dd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc1dd('0x6'));var config=require('../../config/environment');var attributes=require(_0xc1dd('0x7'));module[_0xc1dd('0x8')]=function(_0x450282,_0x18ade8){return _0x450282[_0xc1dd('0x9')](_0xc1dd('0xa'),attributes,{'tableName':_0xc1dd('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xc1dd('0xc'),'fields':[_0xc1dd('0xd'),_0xc1dd('0xe')]},{'unique':!![],'name':_0xc1dd('0xf'),'fields':['name',_0xc1dd('0x10')]},{'unique':!![],'name':_0xc1dd('0x11'),'fields':[_0xc1dd('0xd'),_0xc1dd('0x12')]},{'unique':!![],'name':'name_sms','fields':['name',_0xc1dd('0x13')]},{'unique':!![],'name':_0xc1dd('0x14'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0xc1dd('0x15'),'fields':[_0xc1dd('0xd'),_0xc1dd('0x16')]},{'unique':!![],'name':_0xc1dd('0x17'),'fields':[_0xc1dd('0xd'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7976=['name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name','ChatWebsiteId','name_mail','SmsAccountId','name_fax','name_openchannel'];(function(_0x161885,_0x1ae085){var _0x2ec8a2=function(_0x21e0ee){while(--_0x21e0ee){_0x161885['push'](_0x161885['shift']());}};_0x2ec8a2(++_0x1ae085);}(_0x7976,0x1ce));var _0x6797=function(_0x30433a,_0x5a717b){_0x30433a=_0x30433a-0x0;var _0x237f71=_0x7976[_0x30433a];return _0x237f71;};'use strict';var _=require(_0x6797('0x0'));var util=require(_0x6797('0x1'));var logger=require(_0x6797('0x2'))(_0x6797('0x3'));var moment=require(_0x6797('0x4'));var BPromise=require(_0x6797('0x5'));var rp=require(_0x6797('0x6'));var fs=require('fs');var path=require(_0x6797('0x7'));var rimraf=require(_0x6797('0x8'));var config=require(_0x6797('0x9'));var attributes=require(_0x6797('0xa'));module['exports']=function(_0x5a2a10,_0x4c9cc2){return _0x5a2a10[_0x6797('0xb')](_0x6797('0xc'),attributes,{'tableName':_0x6797('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x6797('0xe'),'fields':[_0x6797('0xf'),'ListId']},{'unique':!![],'name':'name_chat','fields':[_0x6797('0xf'),_0x6797('0x10')]},{'unique':!![],'name':_0x6797('0x11'),'fields':[_0x6797('0xf'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':['name',_0x6797('0x12')]},{'unique':!![],'name':_0x6797('0x13'),'fields':[_0x6797('0xf'),'FaxAccountId']},{'unique':!![],'name':_0x6797('0x14'),'fields':[_0x6797('0xf'),'OpenchannelAccountId']},{'unique':!![],'name':_0x6797('0x15'),'fields':['name',_0x6797('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 930bf0a..d93ec15 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(_0x14697e,_0x2214b4){var _0x2f7b21=function(_0x511a1b){while(--_0x511a1b){_0x14697e['push'](_0x14697e['shift']());}};_0x2f7b21(++_0x2214b4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x188adf,_0x3eade2){var _0xa1520c=function(_0x17086d){while(--_0x17086d){_0x188adf['push'](_0x188adf['shift']());}};_0xa1520c(++_0x3eade2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 e3e7725..f4dcdd4 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 _0x23f2=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','show','post','put','update'];(function(_0x4bf44f,_0x5ee38b){var _0x74b438=function(_0xcf7015){while(--_0xcf7015){_0x4bf44f['push'](_0x4bf44f['shift']());}};_0x74b438(++_0x5ee38b);}(_0x23f2,0x193));var _0x223f=function(_0x59362d,_0x390803){_0x59362d=_0x59362d-0x0;var _0xbb1f70=_0x23f2[_0x59362d];return _0xbb1f70;};'use strict';var multer=require(_0x223f('0x0'));var util=require('util');var path=require(_0x223f('0x1'));var timeout=require(_0x223f('0x2'));var express=require(_0x223f('0x3'));var router=express[_0x223f('0x4')]();var fs_extra=require(_0x223f('0x5'));var auth=require(_0x223f('0x6'));var interaction=require(_0x223f('0x7'));var config=require(_0x223f('0x8'));var controller=require(_0x223f('0x9'));router[_0x223f('0xa')]('/',auth[_0x223f('0xb')](),controller['index']);router[_0x223f('0xa')](_0x223f('0xc'),auth['isAuthenticated'](),controller[_0x223f('0xd')]);router[_0x223f('0xe')]('/',auth[_0x223f('0xb')](),controller['create']);router[_0x223f('0xf')](_0x223f('0xc'),auth[_0x223f('0xb')](),controller[_0x223f('0x10')]);router[_0x223f('0x11')](_0x223f('0xc'),auth[_0x223f('0xb')](),controller[_0x223f('0x12')]);module[_0x223f('0x13')]=router; \ No newline at end of file +var _0x996b=['./disposition.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1c02a4,_0x460f22){var _0x331fd3=function(_0x13750a){while(--_0x13750a){_0x1c02a4['push'](_0x1c02a4['shift']());}};_0x331fd3(++_0x460f22);}(_0x996b,0x19a));var _0xb996=function(_0x14333a,_0x158f1f){_0x14333a=_0x14333a-0x0;var _0x1cb31c=_0x996b[_0x14333a];return _0x1cb31c;};'use strict';var multer=require(_0xb996('0x0'));var util=require(_0xb996('0x1'));var path=require(_0xb996('0x2'));var timeout=require(_0xb996('0x3'));var express=require(_0xb996('0x4'));var router=express[_0xb996('0x5')]();var fs_extra=require(_0xb996('0x6'));var auth=require(_0xb996('0x7'));var interaction=require(_0xb996('0x8'));var config=require(_0xb996('0x9'));var controller=require(_0xb996('0xa'));router[_0xb996('0xb')]('/',auth[_0xb996('0xc')](),controller['index']);router[_0xb996('0xb')](_0xb996('0xd'),auth[_0xb996('0xc')](),controller[_0xb996('0xe')]);router[_0xb996('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb996('0x10')](_0xb996('0xd'),auth[_0xb996('0xc')](),controller[_0xb996('0x11')]);router[_0xb996('0x12')](_0xb996('0xd'),auth[_0xb996('0xc')](),controller[_0xb996('0x13')]);module[_0xb996('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 9ff1ece..8f314c5 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 _0x91f7=['v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','SIP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','12000','14400'];(function(_0x58d9b3,_0x3851d6){var _0x10762b=function(_0x3d9994){while(--_0x3d9994){_0x58d9b3['push'](_0x58d9b3['shift']());}};_0x10762b(++_0x3851d6);}(_0x91f7,0x9c));var _0x791f=function(_0x18b143,_0x4ce6a9){_0x18b143=_0x18b143-0x0;var _0x50fc5e=_0x91f7[_0x18b143];return _0x50fc5e;};'use strict';var Sequelize=require(_0x791f('0x0'));module[_0x791f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x791f('0x2')]},'ecm':{'type':Sequelize[_0x791f('0x3')](_0x791f('0x4'),'no'),'defaultValue':_0x791f('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x791f('0x5')},'localstationid':{'type':Sequelize[_0x791f('0x2')],'unique':_0x791f('0x6')},'minrate':{'type':Sequelize[_0x791f('0x3')](_0x791f('0x7'),'4800',_0x791f('0x8'),_0x791f('0x9'),_0x791f('0xa'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x791f('0x3')](_0x791f('0x7'),'4800','7200','9600','12000',_0x791f('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x791f('0x2')],'defaultValue':_0x791f('0xc')},'gateway':{'type':Sequelize[_0x791f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x791f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x791f('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x791f('0xe'),_0x791f('0xf'),_0x791f('0x10')),'defaultValue':_0x791f('0x11')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x791f('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x791f('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x791f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x791f('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x791f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x791f('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x791f('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x791f('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x791f('0x13')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1dca0c){if(!_0x1dca0c)this['setDataValue'](_0x791f('0x15'),null);this[_0x791f('0x16')](_0x791f('0x17'),_0x1dca0c);}}}; \ No newline at end of file +var _0xe119=['v17,v27,v29','SIP','IAX','DADHI','KHOMP','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','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','12000','7200','9600','14400'];(function(_0x2e9a0b,_0x1daf5a){var _0x3df1a2=function(_0x81317b){while(--_0x81317b){_0x2e9a0b['push'](_0x2e9a0b['shift']());}};_0x3df1a2(++_0x1daf5a);}(_0xe119,0xf8));var _0x9e11=function(_0x4f2930,_0x40ad4b){_0x4f2930=_0x4f2930-0x0;var _0x397db7=_0xe119[_0x4f2930];return _0x397db7;};'use strict';var Sequelize=require(_0x9e11('0x0'));module['exports']={'name':{'type':Sequelize[_0x9e11('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9e11('0x1')]},'ecm':{'type':Sequelize[_0x9e11('0x2')](_0x9e11('0x3'),'no'),'defaultValue':_0x9e11('0x3')},'headerinfo':{'type':Sequelize[_0x9e11('0x1')],'defaultValue':_0x9e11('0x4')},'localstationid':{'type':Sequelize[_0x9e11('0x1')],'unique':_0x9e11('0x5')},'minrate':{'type':Sequelize[_0x9e11('0x2')](_0x9e11('0x6'),_0x9e11('0x7'),'7200','9600',_0x9e11('0x8'),'14400'),'defaultValue':_0x9e11('0x7')},'maxrate':{'type':Sequelize[_0x9e11('0x2')]('2400','4800',_0x9e11('0x9'),_0x9e11('0xa'),_0x9e11('0x8'),'14400'),'defaultValue':_0x9e11('0xb')},'modem':{'type':Sequelize[_0x9e11('0x1')],'defaultValue':_0x9e11('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9e11('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x9e11('0x2')](_0x9e11('0xd'),_0x9e11('0xe'),_0x9e11('0xf'),_0x9e11('0x10')),'defaultValue':_0x9e11('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9e11('0x11')],'defaultValue':function(){return _0x9e11('0x12');}},'notificationSound':{'type':Sequelize[_0x9e11('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9e11('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9e11('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9e11('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9e11('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9e11('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9e11('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x9e11('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x9e11('0x13')],'defaultValue':![],'comment':_0x9e11('0x16'),'set':function(_0x491653){if(!_0x491653)this[_0x9e11('0x17')](_0x9e11('0x18'),null);this['setDataValue'](_0x9e11('0x19'),_0x491653);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 84877cd..4271dce 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 _0xae93=['length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','Disposition','getDispositions','removeDispositions','addAnswer','getAnswers','rows','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','findOne','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','finally','getApplications','context','from-voip-provider','exten','app','system','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','TrunkId','ListId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','List','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','out','filename','Messages','Contact\x20not\x20found','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','localhost','socket.io-emitter','redis','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','get','FaxAccounts','UserProfileResource','status','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes'];(function(_0x5f259c,_0x26127d){var _0xddcf04=function(_0x5ea71f){while(--_0x5ea71f){_0x5f259c['push'](_0x5f259c['shift']());}};_0xddcf04(++_0x26127d);}(_0xae93,0x7e));var _0x3ae9=function(_0x283726,_0x14e652){_0x283726=_0x283726-0x0;var _0x410df3=_0xae93[_0x283726];return _0x410df3;};'use strict';var emlformat=require(_0x3ae9('0x0'));var rimraf=require(_0x3ae9('0x1'));var zipdir=require(_0x3ae9('0x2'));var jsonpatch=require(_0x3ae9('0x3'));var rp=require(_0x3ae9('0x4'));var moment=require(_0x3ae9('0x5'));var BPromise=require(_0x3ae9('0x6'));var Mustache=require(_0x3ae9('0x7'));var util=require(_0x3ae9('0x8'));var path=require(_0x3ae9('0x9'));var sox=require('sox');var csv=require(_0x3ae9('0xa'));var ejs=require(_0x3ae9('0xb'));var fs=require('fs');var fs_extra=require(_0x3ae9('0xc'));var _=require(_0x3ae9('0xd'));var squel=require(_0x3ae9('0xe'));var crypto=require('crypto');var jsforce=require(_0x3ae9('0xf'));var deskjs=require(_0x3ae9('0x10'));var toCsv=require(_0x3ae9('0xa'));var querystring=require(_0x3ae9('0x11'));var Papa=require('papaparse');var Redis=require(_0x3ae9('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3ae9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ae9('0x14'))(_0x3ae9('0x15'));var utils=require(_0x3ae9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3ae9('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x3ae9('0x18'),'port':0x18eb});var socket=require(_0x3ae9('0x19'))(new Redis(config[_0x3ae9('0x1a')]));require('./faxAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb5db,_0x4e5457,_0x512370,_0x28c14c){return new BPromise(function(_0x36704d,_0x1cc774){var _0x1bc6f8=_0x28c14c||client;return _0x1bc6f8[_0x3ae9('0x1b')](_0x5bb5db,_0x512370)[_0x3ae9('0x1c')](function(_0x2d0790){logger['info'](_0x3ae9('0x1d'),_0x4e5457,_0x3ae9('0x1e'));logger[_0x3ae9('0x1f')](_0x3ae9('0x20'),_0x4e5457,_0x3ae9('0x1e'),JSON['stringify'](_0x2d0790));if(_0x2d0790[_0x3ae9('0x21')]){if(_0x2d0790['error']['code']===0x1f4){logger[_0x3ae9('0x21')](_0x3ae9('0x1d'),_0x4e5457,_0x2d0790[_0x3ae9('0x21')][_0x3ae9('0x22')]);return _0x1cc774(_0x2d0790[_0x3ae9('0x21')][_0x3ae9('0x22')]);}logger[_0x3ae9('0x21')](_0x3ae9('0x1d'),_0x4e5457,_0x2d0790['error']['message']);return _0x36704d(_0x2d0790[_0x3ae9('0x21')][_0x3ae9('0x22')]);}else{logger[_0x3ae9('0x23')](_0x3ae9('0x1d'),_0x4e5457,_0x3ae9('0x1e'));_0x36704d(_0x2d0790[_0x3ae9('0x24')][_0x3ae9('0x22')]);}})['catch'](function(_0x522543){logger['error']('FaxAccount,\x20%s,\x20%s',_0x4e5457,_0x522543);_0x1cc774(_0x522543);});});}function respondWithStatusCode(_0x590fb7,_0x5a06f2){_0x5a06f2=_0x5a06f2||0xcc;return function(_0x389de3){if(_0x389de3){return _0x590fb7[_0x3ae9('0x25')](_0x5a06f2);}return _0x590fb7['status'](_0x5a06f2)[_0x3ae9('0x26')]();};}function respondWithResult(_0x3101aa,_0x49c254){_0x49c254=_0x49c254||0xc8;return function(_0x5bff80){if(_0x5bff80){return _0x3101aa['status'](_0x49c254)[_0x3ae9('0x27')](_0x5bff80);}};}function respondWithFilteredResult(_0x3bb2cb,_0x2c2ab0){return function(_0x5e853d){if(_0x5e853d){var _0x2ce4f9=typeof _0x2c2ab0[_0x3ae9('0x28')]==='undefined'&&typeof _0x2c2ab0[_0x3ae9('0x29')]===_0x3ae9('0x2a');var _0x324a26=_0x5e853d[_0x3ae9('0x2b')];var _0x734257=_0x2ce4f9?0x0:_0x2c2ab0[_0x3ae9('0x28')];var _0x4731b3=_0x2ce4f9?_0x5e853d[_0x3ae9('0x2b')]:_0x2c2ab0[_0x3ae9('0x28')]+_0x2c2ab0[_0x3ae9('0x29')];var _0x272808;if(_0x4731b3>=_0x324a26){_0x4731b3=_0x324a26;_0x272808=0xc8;}else{_0x272808=0xce;}_0x3bb2cb['status'](_0x272808);return _0x3bb2cb[_0x3ae9('0x2c')](_0x3ae9('0x2d'),_0x734257+'-'+_0x4731b3+'/'+_0x324a26)[_0x3ae9('0x27')](_0x5e853d);}return null;};}function patchUpdates(_0x5272d0){return function(_0x4bb1cf){try{jsonpatch[_0x3ae9('0x2e')](_0x4bb1cf,_0x5272d0,!![]);}catch(_0x4995c7){return BPromise['reject'](_0x4995c7);}return _0x4bb1cf[_0x3ae9('0x2f')]();};}function saveUpdates(_0x2a88f5,_0x886d05){return function(_0x1411ec){if(_0x1411ec){return _0x1411ec[_0x3ae9('0x30')](_0x2a88f5)[_0x3ae9('0x1c')](function(_0x1700fb){return _0x1700fb;});}return null;};}function removeEntity(_0x1fa442,_0x2a2eb8){return function(_0x6aac8c){if(_0x6aac8c){return _0x6aac8c[_0x3ae9('0x31')]()['then'](function(){var _0x21fc75=_0x6aac8c[_0x3ae9('0x32')]({'plain':!![]});var _0x1f51e9=_0x3ae9('0x33');return db[_0x3ae9('0x34')][_0x3ae9('0x31')]({'where':{'type':_0x1f51e9,'resourceId':_0x21fc75['id']}})[_0x3ae9('0x1c')](function(){return _0x6aac8c;});})[_0x3ae9('0x1c')](function(){_0x1fa442[_0x3ae9('0x35')](0xcc)[_0x3ae9('0x26')]();});}};}function handleEntityNotFound(_0x23991b,_0x32cbbb){return function(_0x38c085){if(!_0x38c085){_0x23991b[_0x3ae9('0x25')](0x194);}return _0x38c085;};}function handleError(_0x2e2a04,_0x21cccd){_0x21cccd=_0x21cccd||0x1f4;return function(_0x211a01){logger['error'](_0x211a01[_0x3ae9('0x36')]);if(_0x211a01['name']){delete _0x211a01[_0x3ae9('0x37')];}_0x2e2a04[_0x3ae9('0x35')](_0x21cccd)[_0x3ae9('0x38')](_0x211a01);};}exports[_0x3ae9('0x39')]=function(_0x4ff01a,_0x1afbfe){var _0x5f17ba={'include':[{'model':db[_0x3ae9('0x3a')],'as':_0x3ae9('0x3b')}]},_0x13c622={},_0x56c8df={'count':0x0,'rows':[]};var _0x4433db=_[_0x3ae9('0x3c')](db[_0x3ae9('0x3d')][_0x3ae9('0x3e')],function(_0x448b0b){return{'name':_0x448b0b[_0x3ae9('0x3f')],'type':_0x448b0b[_0x3ae9('0x40')][_0x3ae9('0x41')]};});_0x13c622[_0x3ae9('0x42')]=_[_0x3ae9('0x3c')](_0x4433db,_0x3ae9('0x37'));_0x13c622[_0x3ae9('0x43')]=_[_0x3ae9('0x44')](_0x4ff01a[_0x3ae9('0x43')]);_0x13c622[_0x3ae9('0x45')]=_[_0x3ae9('0x46')](_0x13c622[_0x3ae9('0x42')],_0x13c622[_0x3ae9('0x43')]);_0x5f17ba['attributes']=_[_0x3ae9('0x46')](_0x13c622['model'],qs[_0x3ae9('0x47')](_0x4ff01a[_0x3ae9('0x43')][_0x3ae9('0x47')]));_0x5f17ba[_0x3ae9('0x48')]=_0x5f17ba[_0x3ae9('0x48')][_0x3ae9('0x49')]?_0x5f17ba[_0x3ae9('0x48')]:_0x13c622[_0x3ae9('0x42')];if(!_0x4ff01a[_0x3ae9('0x43')][_0x3ae9('0x4a')](_0x3ae9('0x4b'))){_0x5f17ba[_0x3ae9('0x29')]=qs[_0x3ae9('0x29')](_0x4ff01a[_0x3ae9('0x43')][_0x3ae9('0x29')]);_0x5f17ba['offset']=qs['offset'](_0x4ff01a[_0x3ae9('0x43')]['offset']);}_0x5f17ba[_0x3ae9('0x4c')]=qs['sort'](_0x4ff01a[_0x3ae9('0x43')][_0x3ae9('0x4d')]);_0x5f17ba['where']=qs[_0x3ae9('0x45')](_[_0x3ae9('0x4e')](_0x4ff01a[_0x3ae9('0x43')],_0x13c622[_0x3ae9('0x45')]),_0x4433db);if(_0x4ff01a[_0x3ae9('0x43')][_0x3ae9('0x4f')]){_0x5f17ba[_0x3ae9('0x50')]=_[_0x3ae9('0x51')](_0x5f17ba['where'],{'$or':_['map'](_0x4433db,function(_0x51b8fd){if(_0x51b8fd[_0x3ae9('0x40')]!==_0x3ae9('0x52')){var _0x3b0e62={};_0x3b0e62[_0x51b8fd[_0x3ae9('0x37')]]={'$like':'%'+_0x4ff01a[_0x3ae9('0x43')][_0x3ae9('0x4f')]+'%'};return _0x3b0e62;}})});}_0x5f17ba=_['merge']({},_0x5f17ba,_0x4ff01a[_0x3ae9('0x53')]);var _0x730c97={'where':_0x5f17ba[_0x3ae9('0x50')]};return db[_0x3ae9('0x3d')]['count'](_0x730c97)[_0x3ae9('0x1c')](function(_0x35b556){_0x56c8df[_0x3ae9('0x2b')]=_0x35b556;if(_0x4ff01a[_0x3ae9('0x43')][_0x3ae9('0x54')]){_0x5f17ba['include']=[{'all':!![]}];}return db[_0x3ae9('0x3d')][_0x3ae9('0x55')](_0x5f17ba);})[_0x3ae9('0x1c')](function(_0x400d76){_0x56c8df['rows']=_0x400d76;return _0x56c8df;})[_0x3ae9('0x1c')](respondWithFilteredResult(_0x1afbfe,_0x5f17ba))[_0x3ae9('0x56')](handleError(_0x1afbfe,null));};exports[_0x3ae9('0x57')]=function(_0x1d8289,_0x385f9e){var _0x1aa007={'raw':![],'where':{'id':_0x1d8289[_0x3ae9('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x3ae9('0x3b')}]},_0x58a22b={};_0x58a22b[_0x3ae9('0x42')]=_[_0x3ae9('0x44')](db['FaxAccount'][_0x3ae9('0x3e')]);_0x58a22b[_0x3ae9('0x43')]=_[_0x3ae9('0x44')](_0x1d8289[_0x3ae9('0x43')]);_0x58a22b[_0x3ae9('0x45')]=_['intersection'](_0x58a22b[_0x3ae9('0x42')],_0x58a22b[_0x3ae9('0x43')]);_0x1aa007[_0x3ae9('0x48')]=_[_0x3ae9('0x46')](_0x58a22b[_0x3ae9('0x42')],qs['fields'](_0x1d8289['query'][_0x3ae9('0x47')]));_0x1aa007['attributes']=_0x1aa007[_0x3ae9('0x48')][_0x3ae9('0x49')]?_0x1aa007['attributes']:_0x58a22b[_0x3ae9('0x42')];if(_0x1d8289[_0x3ae9('0x43')]['includeAll']){_0x1aa007[_0x3ae9('0x59')]=[{'all':!![]}];}_0x1aa007=_[_0x3ae9('0x51')]({},_0x1aa007,_0x1d8289[_0x3ae9('0x53')]);return db[_0x3ae9('0x3d')][_0x3ae9('0x5a')](_0x1aa007)['then'](handleEntityNotFound(_0x385f9e,null))[_0x3ae9('0x1c')](respondWithResult(_0x385f9e,null))[_0x3ae9('0x56')](handleError(_0x385f9e,null));};exports[_0x3ae9('0x5b')]=function(_0x43342a,_0x38d28e){return db[_0x3ae9('0x3d')][_0x3ae9('0x5b')](_0x43342a[_0x3ae9('0x5c')],{})['then'](function(_0x24c036){var _0x54755f=_0x43342a[_0x3ae9('0x5d')][_0x3ae9('0x32')]({'plain':!![]});if(!_0x54755f)throw new Error(_0x3ae9('0x5e'));if(_0x54755f[_0x3ae9('0x5f')]===_0x3ae9('0x5d')){var _0x2c63e8=_0x24c036[_0x3ae9('0x32')]({'plain':!![]});var _0x5b4bb3='FaxAccounts';return db[_0x3ae9('0x60')][_0x3ae9('0x5a')]({'where':{'name':_0x5b4bb3,'userProfileId':_0x54755f['userProfileId']},'raw':!![]})[_0x3ae9('0x1c')](function(_0xffdca8){if(_0xffdca8&&_0xffdca8[_0x3ae9('0x61')]===0x0){return db[_0x3ae9('0x34')][_0x3ae9('0x5b')]({'name':_0x2c63e8['name'],'resourceId':_0x2c63e8['id'],'type':_0xffdca8[_0x3ae9('0x37')],'sectionId':_0xffdca8['id']},{})[_0x3ae9('0x1c')](function(){return _0x24c036;});}else{return _0x24c036;}})[_0x3ae9('0x56')](function(_0x3aeb4a){logger[_0x3ae9('0x21')](_0x3ae9('0x62'),_0x3aeb4a);throw _0x3aeb4a;});}return _0x24c036;})[_0x3ae9('0x1c')](respondWithResult(_0x38d28e,0xc9))[_0x3ae9('0x56')](handleError(_0x38d28e,null));};exports[_0x3ae9('0x30')]=function(_0x40c728,_0x4a0d81){if(_0x40c728[_0x3ae9('0x5c')]['id']){delete _0x40c728['body']['id'];}return db['FaxAccount'][_0x3ae9('0x5a')]({'where':{'id':_0x40c728[_0x3ae9('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x3ae9('0x3b')}]})[_0x3ae9('0x1c')](handleEntityNotFound(_0x4a0d81,null))[_0x3ae9('0x1c')](saveUpdates(_0x40c728[_0x3ae9('0x5c')],null))['then'](respondWithResult(_0x4a0d81,null))['catch'](handleError(_0x4a0d81,null));};exports[_0x3ae9('0x31')]=function(_0xfbcaa5,_0x1b4364){return db[_0x3ae9('0x3d')][_0x3ae9('0x5a')]({'where':{'id':_0xfbcaa5[_0x3ae9('0x58')]['id']}})[_0x3ae9('0x1c')](handleEntityNotFound(_0x1b4364,null))[_0x3ae9('0x1c')](removeEntity(_0x1b4364,null))[_0x3ae9('0x56')](handleError(_0x1b4364,null));};exports[_0x3ae9('0x63')]=function(_0x4a495d,_0x42f6fd){return db[_0x3ae9('0x3d')]['describe']()[_0x3ae9('0x1c')](respondWithResult(_0x42f6fd,null))['catch'](handleError(_0x42f6fd,null));};exports['addDisposition']=function(_0x55dbf8,_0x3ccba1,_0x9047ff){if(_0x55dbf8[_0x3ae9('0x5c')]['id']){delete _0x55dbf8[_0x3ae9('0x5c')]['id'];}return db[_0x3ae9('0x3d')][_0x3ae9('0x5a')]({'where':{'id':_0x55dbf8['params']['id']}})[_0x3ae9('0x1c')](handleEntityNotFound(_0x3ccba1,null))['then'](function(_0x34f111){if(_0x34f111){_0x55dbf8['body'][_0x3ae9('0x64')]=_0x34f111['id'];return db[_0x3ae9('0x65')][_0x3ae9('0x5b')](_0x55dbf8['body']);}})[_0x3ae9('0x1c')](respondWithResult(_0x3ccba1,null))[_0x3ae9('0x56')](handleError(_0x3ccba1,null));};exports[_0x3ae9('0x66')]=function(_0x351b77,_0x4ea943,_0x4840bd){var _0x1061c2={'raw':![],'where':{}};var _0x53650b={};var _0x1222cc={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x351b77[_0x3ae9('0x58')]['id']}})[_0x3ae9('0x1c')](handleEntityNotFound(_0x4ea943,null))[_0x3ae9('0x1c')](function(_0x5e3335){if(_0x5e3335){_0x53650b[_0x3ae9('0x42')]=_['keys'](db['Disposition'][_0x3ae9('0x3e')]);_0x53650b[_0x3ae9('0x43')]=_[_0x3ae9('0x44')](_0x351b77[_0x3ae9('0x43')]);_0x53650b[_0x3ae9('0x45')]=_[_0x3ae9('0x46')](_0x53650b[_0x3ae9('0x42')],_0x53650b[_0x3ae9('0x43')]);_0x1061c2[_0x3ae9('0x48')]=_[_0x3ae9('0x46')](_0x53650b[_0x3ae9('0x42')],qs[_0x3ae9('0x47')](_0x351b77[_0x3ae9('0x43')][_0x3ae9('0x47')]));_0x1061c2[_0x3ae9('0x48')]=_0x1061c2[_0x3ae9('0x48')][_0x3ae9('0x49')]?_0x1061c2['attributes']:_0x53650b[_0x3ae9('0x42')];if(!_0x351b77[_0x3ae9('0x43')][_0x3ae9('0x4a')](_0x3ae9('0x4b'))){_0x1061c2[_0x3ae9('0x29')]=qs['limit'](_0x351b77[_0x3ae9('0x43')]['limit']);_0x1061c2[_0x3ae9('0x28')]=qs[_0x3ae9('0x28')](_0x351b77[_0x3ae9('0x43')]['offset']);}_0x1061c2[_0x3ae9('0x4c')]=qs['sort'](_0x351b77['query']['sort']);_0x1061c2[_0x3ae9('0x50')]=qs['filters'](_[_0x3ae9('0x4e')](_0x351b77[_0x3ae9('0x43')],_0x53650b[_0x3ae9('0x45')]));_0x1061c2[_0x3ae9('0x50')][_0x3ae9('0x64')]=_0x5e3335['id'];if(_0x351b77[_0x3ae9('0x43')][_0x3ae9('0x4f')]){_0x1061c2[_0x3ae9('0x50')]=_[_0x3ae9('0x51')](_0x1061c2[_0x3ae9('0x50')],{'$or':_['map'](_0x1061c2['attributes'],function(_0xec257a){var _0xf2f4d7={};_0xf2f4d7[_0xec257a]={'$like':'%'+_0x351b77[_0x3ae9('0x43')][_0x3ae9('0x4f')]+'%'};return _0xf2f4d7;})});}_0x1061c2=_[_0x3ae9('0x51')]({},_0x1061c2,_0x351b77[_0x3ae9('0x53')]);return db[_0x3ae9('0x65')][_0x3ae9('0x2b')]({'where':_0x1061c2['where']})[_0x3ae9('0x1c')](function(_0x417a6e){_0x1222cc[_0x3ae9('0x2b')]=_0x417a6e;if(_0x351b77[_0x3ae9('0x43')][_0x3ae9('0x54')]){_0x1061c2[_0x3ae9('0x59')]=[{'all':!![]}];}return db[_0x3ae9('0x65')][_0x3ae9('0x55')](_0x1061c2);})[_0x3ae9('0x1c')](function(_0xb6b5d){_0x1222cc['rows']=_0xb6b5d;return _0x1222cc;});}})['then'](respondWithFilteredResult(_0x4ea943,_0x1061c2))['catch'](handleError(_0x4ea943,null));};exports[_0x3ae9('0x67')]=function(_0x1f8f9e,_0x1e287f,_0x4a6825){return db[_0x3ae9('0x3d')][_0x3ae9('0x5a')]({'where':{'id':_0x1f8f9e[_0x3ae9('0x58')]['id']}})[_0x3ae9('0x1c')](handleEntityNotFound(_0x1e287f,null))['then'](function(_0x5858d4){if(_0x5858d4){return _0x5858d4['removeDispositions'](_0x1f8f9e[_0x3ae9('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x1e287f,null))[_0x3ae9('0x56')](handleError(_0x1e287f,null));};exports[_0x3ae9('0x68')]=function(_0x115bb2,_0x2fcb1f,_0x23d5b0){if(_0x115bb2['body']['id']){delete _0x115bb2['body']['id'];}return db['FaxAccount'][_0x3ae9('0x5a')]({'where':{'id':_0x115bb2[_0x3ae9('0x58')]['id']}})[_0x3ae9('0x1c')](handleEntityNotFound(_0x2fcb1f,null))[_0x3ae9('0x1c')](function(_0x37e607){if(_0x37e607){_0x115bb2[_0x3ae9('0x5c')]['FaxAccountId']=_0x37e607['id'];return db['CannedAnswer'][_0x3ae9('0x5b')](_0x115bb2[_0x3ae9('0x5c')]);}})[_0x3ae9('0x1c')](respondWithResult(_0x2fcb1f,null))[_0x3ae9('0x56')](handleError(_0x2fcb1f,null));};exports[_0x3ae9('0x69')]=function(_0x3899f0,_0x23b5f2,_0x134497){var _0x4fe081={'raw':![],'where':{}};var _0x57c4d8={};var _0xd093eb={'count':0x0,'rows':[]};return db[_0x3ae9('0x3d')]['findOne']({'where':{'id':_0x3899f0[_0x3ae9('0x58')]['id']}})[_0x3ae9('0x1c')](handleEntityNotFound(_0x23b5f2,null))[_0x3ae9('0x1c')](function(_0x17ae27){if(_0x17ae27){_0x57c4d8[_0x3ae9('0x42')]=_[_0x3ae9('0x44')](db['CannedAnswer'][_0x3ae9('0x3e')]);_0x57c4d8['query']=_['keys'](_0x3899f0[_0x3ae9('0x43')]);_0x57c4d8[_0x3ae9('0x45')]=_['intersection'](_0x57c4d8['model'],_0x57c4d8['query']);_0x4fe081[_0x3ae9('0x48')]=_['intersection'](_0x57c4d8[_0x3ae9('0x42')],qs['fields'](_0x3899f0[_0x3ae9('0x43')][_0x3ae9('0x47')]));_0x4fe081[_0x3ae9('0x48')]=_0x4fe081[_0x3ae9('0x48')]['length']?_0x4fe081[_0x3ae9('0x48')]:_0x57c4d8[_0x3ae9('0x42')];if(!_0x3899f0[_0x3ae9('0x43')][_0x3ae9('0x4a')](_0x3ae9('0x4b'))){_0x4fe081[_0x3ae9('0x29')]=qs[_0x3ae9('0x29')](_0x3899f0[_0x3ae9('0x43')][_0x3ae9('0x29')]);_0x4fe081[_0x3ae9('0x28')]=qs['offset'](_0x3899f0[_0x3ae9('0x43')][_0x3ae9('0x28')]);}_0x4fe081[_0x3ae9('0x4c')]=qs[_0x3ae9('0x4d')](_0x3899f0[_0x3ae9('0x43')]['sort']);_0x4fe081[_0x3ae9('0x50')]=qs[_0x3ae9('0x45')](_['pick'](_0x3899f0[_0x3ae9('0x43')],_0x57c4d8[_0x3ae9('0x45')]));_0x4fe081[_0x3ae9('0x50')][_0x3ae9('0x64')]=_0x17ae27['id'];if(_0x3899f0[_0x3ae9('0x43')][_0x3ae9('0x4f')]){_0x4fe081[_0x3ae9('0x50')]=_[_0x3ae9('0x51')](_0x4fe081['where'],{'$or':_['map'](_0x4fe081['attributes'],function(_0x3e6826){var _0x54f990={};_0x54f990[_0x3e6826]={'$like':'%'+_0x3899f0[_0x3ae9('0x43')][_0x3ae9('0x4f')]+'%'};return _0x54f990;})});}_0x4fe081=_[_0x3ae9('0x51')]({},_0x4fe081,_0x3899f0[_0x3ae9('0x53')]);return db['CannedAnswer'][_0x3ae9('0x2b')]({'where':_0x4fe081[_0x3ae9('0x50')]})[_0x3ae9('0x1c')](function(_0x356d50){_0xd093eb[_0x3ae9('0x2b')]=_0x356d50;if(_0x3899f0[_0x3ae9('0x43')][_0x3ae9('0x54')]){_0x4fe081[_0x3ae9('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3ae9('0x55')](_0x4fe081);})[_0x3ae9('0x1c')](function(_0x2d9e4e){_0xd093eb[_0x3ae9('0x6a')]=_0x2d9e4e;return _0xd093eb;});}})[_0x3ae9('0x1c')](respondWithFilteredResult(_0x23b5f2,_0x4fe081))[_0x3ae9('0x56')](handleError(_0x23b5f2,null));};exports[_0x3ae9('0x6b')]=function(_0x56307a,_0x44b1b4,_0x39c072){return db[_0x3ae9('0x3d')]['find']({'where':{'id':_0x56307a[_0x3ae9('0x58')]['id']}})[_0x3ae9('0x1c')](handleEntityNotFound(_0x44b1b4,null))[_0x3ae9('0x1c')](function(_0xe9f60f){if(_0xe9f60f){return _0xe9f60f['removeAnswers'](_0x56307a[_0x3ae9('0x43')][_0x3ae9('0x6c')]);}})[_0x3ae9('0x1c')](respondWithStatusCode(_0x44b1b4,null))[_0x3ae9('0x56')](handleError(_0x44b1b4,null));};exports[_0x3ae9('0x6d')]=function(_0x284ed8,_0x3c8329,_0x4e71a4){return db[_0x3ae9('0x6e')][_0x3ae9('0x5a')]({'where':{'id':_0x284ed8['params']['id']}})['then'](handleEntityNotFound(_0x3c8329,null))[_0x3ae9('0x1c')](function(_0xdcd992){if(_0xdcd992){return _0xdcd992[_0x3ae9('0x6d')](_0x284ed8[_0x3ae9('0x5c')]['ids'],_[_0x3ae9('0x6f')](_0x284ed8[_0x3ae9('0x5c')],['ids','id'])||{});}})['then'](respondWithResult(_0x3c8329,null))[_0x3ae9('0x56')](handleError(_0x3c8329,null));};exports[_0x3ae9('0x70')]=function(_0x24b5f7,_0x37386e,_0x371f37){var _0x2d7b46={'raw':![],'where':{}};var _0xcb9369={};var _0x149cf0={'count':0x0,'rows':[]};return db[_0x3ae9('0x3d')][_0x3ae9('0x71')]({'where':{'id':_0x24b5f7[_0x3ae9('0x58')]['id']}})[_0x3ae9('0x1c')](handleEntityNotFound(_0x37386e,null))['then'](function(_0x229b48){if(_0x229b48){_0xcb9369[_0x3ae9('0x42')]=_[_0x3ae9('0x44')](db[_0x3ae9('0x6e')]['rawAttributes']);_0xcb9369['query']=_[_0x3ae9('0x44')](_0x24b5f7[_0x3ae9('0x43')]);_0xcb9369['filters']=_[_0x3ae9('0x46')](_0xcb9369[_0x3ae9('0x42')],_0xcb9369['query']);_0x2d7b46[_0x3ae9('0x48')]=_[_0x3ae9('0x46')](_0xcb9369['model'],qs[_0x3ae9('0x47')](_0x24b5f7[_0x3ae9('0x43')][_0x3ae9('0x47')]));_0x2d7b46[_0x3ae9('0x48')]=_0x2d7b46[_0x3ae9('0x48')][_0x3ae9('0x49')]?_0x2d7b46[_0x3ae9('0x48')]:_0xcb9369[_0x3ae9('0x42')];if(!_0x24b5f7['query']['hasOwnProperty'](_0x3ae9('0x4b'))){_0x2d7b46['limit']=qs['limit'](_0x24b5f7[_0x3ae9('0x43')]['limit']);_0x2d7b46[_0x3ae9('0x28')]=qs[_0x3ae9('0x28')](_0x24b5f7[_0x3ae9('0x43')][_0x3ae9('0x28')]);}_0x2d7b46[_0x3ae9('0x4c')]=qs[_0x3ae9('0x4d')](_0x24b5f7[_0x3ae9('0x43')][_0x3ae9('0x4d')]);_0x2d7b46[_0x3ae9('0x50')]=qs['filters'](_[_0x3ae9('0x4e')](_0x24b5f7[_0x3ae9('0x43')],_0xcb9369[_0x3ae9('0x45')]));_0x2d7b46[_0x3ae9('0x50')]['FaxAccountId']=_0x229b48['id'];if(_0x24b5f7[_0x3ae9('0x43')]['filter']){_0x2d7b46[_0x3ae9('0x50')]=_[_0x3ae9('0x51')](_0x2d7b46[_0x3ae9('0x50')],{'$or':_['map'](_0x2d7b46[_0x3ae9('0x48')],function(_0x530f10){var _0x5a2f71={};_0x5a2f71[_0x530f10]={'$like':'%'+_0x24b5f7[_0x3ae9('0x43')][_0x3ae9('0x4f')]+'%'};return _0x5a2f71;})});}_0x2d7b46=_[_0x3ae9('0x51')]({},_0x2d7b46,_0x24b5f7[_0x3ae9('0x53')]);return db['FaxInteraction']['count']({'where':_0x2d7b46[_0x3ae9('0x50')]})['then'](function(_0x10fe7d){_0x149cf0[_0x3ae9('0x2b')]=_0x10fe7d;if(_0x24b5f7[_0x3ae9('0x43')][_0x3ae9('0x54')]){_0x2d7b46['include']=[{'model':db[_0x3ae9('0x72')],'as':_0x3ae9('0x73'),'required':![]},{'model':db[_0x3ae9('0x74')],'as':_0x3ae9('0x75'),'attributes':[_0x3ae9('0x37'),'fullname',_0x3ae9('0x76')],'required':![]},{'model':db[_0x3ae9('0x77')],'as':_0x3ae9('0x78'),'attributes':['id',_0x3ae9('0x37'),_0x3ae9('0x79')],'where':_0x24b5f7['query']['tag']?{'id':_0x24b5f7[_0x3ae9('0x43')][_0x3ae9('0x7a')]}:undefined,'required':_0x24b5f7[_0x3ae9('0x43')][_0x3ae9('0x7a')]?!![]:![]}];}return db['FaxInteraction'][_0x3ae9('0x55')](_0x2d7b46);})[_0x3ae9('0x1c')](function(_0x155bd4){_0x149cf0[_0x3ae9('0x6a')]=_0x155bd4;return _0x149cf0;});}})['then'](respondWithFilteredResult(_0x37386e,_0x2d7b46))[_0x3ae9('0x56')](handleError(_0x37386e,null));};exports[_0x3ae9('0x7b')]=function(_0x1e1050,_0x33f33b){var _0x2e5e06=_0x1e1050[_0x3ae9('0x58')]['id'];var _0x397cc2=_0x1e1050[_0x3ae9('0x5c')];var _0x552449=0xc8;var _0x39ddf3=null;return db[_0x3ae9('0x7c')][_0x3ae9('0x7d')]({'isolationLevel':db[_0x3ae9('0x7c')][_0x3ae9('0x7e')][_0x3ae9('0x7f')][_0x3ae9('0x80')]},function(_0x13dcd0){return db[_0x3ae9('0x3d')]['findOne']({'where':{'id':_0x2e5e06},'transaction':_0x13dcd0})[_0x3ae9('0x1c')](function(_0x1c50d3){if(_0x1c50d3){return db[_0x3ae9('0x81')][_0x3ae9('0x31')]({'where':{'FaxAccountId':_0x2e5e06},'transaction':_0x13dcd0})[_0x3ae9('0x1c')](function(){var _0x52f84d=_['map'](_0x397cc2,function(_0x2052f8){_0x2052f8[_0x3ae9('0x64')]=_0x2e5e06;return _0x2052f8;});return db[_0x3ae9('0x81')][_0x3ae9('0x82')](_0x52f84d,{'transaction':_0x13dcd0});});}else{_0x552449=0x194;_0x39ddf3=[];}});})[_0x3ae9('0x1c')](function(){if(_0x552449!==0x194){return db[_0x3ae9('0x81')][_0x3ae9('0x83')]({'where':{'FaxAccountId':_0x2e5e06},'order':'priority'})[_0x3ae9('0x1c')](function(_0x1b09ee){_0x39ddf3=_0x1b09ee;});}})[_0x3ae9('0x56')](function(_0x56693a){_0x552449=0x1f4;logger[_0x3ae9('0x21')](_0x56693a[_0x3ae9('0x36')]);if(_0x56693a[_0x3ae9('0x37')]){delete _0x56693a['name'];}_0x39ddf3=_0x56693a;})[_0x3ae9('0x84')](function(){if(_0x39ddf3===null){_0x33f33b[_0x3ae9('0x25')](_0x552449);}else{if(_0x552449===0x1f4){_0x33f33b[_0x3ae9('0x35')](_0x552449)[_0x3ae9('0x38')](_0x39ddf3);}else{_0x33f33b[_0x3ae9('0x35')](_0x552449)[_0x3ae9('0x27')](_0x39ddf3);}}});};exports['getApplications']=function(_0x16cae5,_0x555f52,_0x3a85cd){var _0x5ae072={};var _0x51f077={};var _0x5d55f3;var _0x4badda;return db[_0x3ae9('0x3d')][_0x3ae9('0x71')]({'where':{'id':_0x16cae5[_0x3ae9('0x58')]['id']}})[_0x3ae9('0x1c')](handleEntityNotFound(_0x555f52,null))['then'](function(_0x39de67){if(_0x39de67){_0x5d55f3=_0x39de67;_0x51f077[_0x3ae9('0x42')]=_[_0x3ae9('0x44')](db[_0x3ae9('0x81')][_0x3ae9('0x3e')]);_0x51f077[_0x3ae9('0x43')]=_[_0x3ae9('0x44')](_0x16cae5['query']);_0x51f077['filters']=_['intersection'](_0x51f077[_0x3ae9('0x42')],_0x51f077[_0x3ae9('0x43')]);_0x5ae072['attributes']=_[_0x3ae9('0x46')](_0x51f077['model'],qs[_0x3ae9('0x47')](_0x16cae5[_0x3ae9('0x43')][_0x3ae9('0x47')]));_0x5ae072[_0x3ae9('0x48')]=_0x5ae072[_0x3ae9('0x48')][_0x3ae9('0x49')]?_0x5ae072['attributes']:_0x51f077[_0x3ae9('0x42')];_0x5ae072[_0x3ae9('0x4c')]=qs['sort'](_0x16cae5['query'][_0x3ae9('0x4d')]);_0x5ae072['where']=qs[_0x3ae9('0x45')](_[_0x3ae9('0x4e')](_0x16cae5['query'],_0x51f077[_0x3ae9('0x45')]));if(_0x16cae5[_0x3ae9('0x43')][_0x3ae9('0x4f')]){_0x5ae072['where']=_[_0x3ae9('0x51')](_0x5ae072[_0x3ae9('0x50')],{'$or':_[_0x3ae9('0x3c')](_0x5ae072['attributes'],function(_0x4cbeb0){var _0x23e817={};_0x23e817[_0x4cbeb0]={'$like':'%'+_0x16cae5[_0x3ae9('0x43')][_0x3ae9('0x4f')]+'%'};return _0x23e817;})});}_0x5ae072=_[_0x3ae9('0x51')]({},_0x5ae072,_0x16cae5['options']);return _0x5d55f3[_0x3ae9('0x85')](_0x5ae072);}})[_0x3ae9('0x1c')](function(_0x183d27){if(_0x183d27){_0x4badda=_0x183d27[_0x3ae9('0x49')];if(!_0x16cae5[_0x3ae9('0x43')][_0x3ae9('0x4a')](_0x3ae9('0x4b'))){_0x5ae072[_0x3ae9('0x29')]=qs[_0x3ae9('0x29')](_0x16cae5[_0x3ae9('0x43')][_0x3ae9('0x29')]);_0x5ae072[_0x3ae9('0x28')]=qs[_0x3ae9('0x28')](_0x16cae5[_0x3ae9('0x43')][_0x3ae9('0x28')]);}return _0x5d55f3['getApplications'](_0x5ae072);}})[_0x3ae9('0x1c')](function(_0xc2bef0){if(_0xc2bef0){return _0xc2bef0?{'count':_0x4badda,'rows':_0xc2bef0}:null;}})['then'](respondWithResult(_0x555f52,null))[_0x3ae9('0x56')](handleError(_0x555f52,null));};function Extension(_0x28a2ab,_0x2ace0b,_0x4745b5,_0x404a1a){this[_0x3ae9('0x86')]=_0x3ae9('0x87');this[_0x3ae9('0x88')]=_0x28a2ab['localstationid'];this[_0x3ae9('0x89')]=_0x404a1a;this['type']=_0x3ae9('0x8a');this[_0x3ae9('0x8b')]=_0x3ae9('0x8c');this['FaxAccountId']=_0x28a2ab['id'];this[_0x3ae9('0x8d')]=_0x2ace0b;this[_0x3ae9('0x8e')]=_0x4745b5;}function createExtensionsReciveFax(_0x14dfb2){var _0x49f1de=0x1;var _0xf5d411=[];_0xf5d411[_0x3ae9('0x8f')](new Extension(_0x14dfb2,_0x49f1de,'',_0x3ae9('0x90')));_0x49f1de+=0x1;_0xf5d411[_0x3ae9('0x8f')](new Extension(_0x14dfb2,_0x49f1de,_0x3ae9('0x91'),_0x3ae9('0x92')));_0x49f1de+=0x1;for(var _0x1e2441 in _0x14dfb2){if(_0x14dfb2[_0x3ae9('0x4a')](_0x1e2441)&&(_0x1e2441===_0x3ae9('0x93')||_0x1e2441==='localstationid'||_0x1e2441==='gateway'||_0x1e2441===_0x3ae9('0x94')||_0x1e2441===_0x3ae9('0x95')||_0x1e2441===_0x3ae9('0x96')||_0x1e2441===_0x3ae9('0x97')||_0x1e2441===_0x3ae9('0x98')||_0x1e2441===_0x3ae9('0x99'))){_0xf5d411['push'](new Extension(_0x14dfb2,_0x49f1de,'FAXOPT('+_0x1e2441+')='+_0x14dfb2[_0x1e2441],_0x3ae9('0x92')));_0x49f1de+=0x1;}}_0xf5d411['push'](new Extension(_0x14dfb2,_0x49f1de,'6',_0x3ae9('0x9a')));_0x49f1de+=0x1;_0xf5d411[_0x3ae9('0x8f')](new Extension(_0x14dfb2,_0x49f1de,_0x3ae9('0x9b'),_0x3ae9('0x9c')));_0x49f1de=0x0;return _0xf5d411;}exports[_0x3ae9('0x9d')]=function(_0x5b212f,_0x470e86,_0x591450){var _0x3cc4f0;return db[_0x3ae9('0x7c')][_0x3ae9('0x7d')](function(_0x2a6405){return db[_0x3ae9('0x3d')][_0x3ae9('0x5b')](_0x5b212f[_0x3ae9('0x5c')],{'transaction':_0x2a6405})[_0x3ae9('0x1c')](function(_0xb9c90f){_0x3cc4f0=_0xb9c90f[_0x3ae9('0x32')]({'plain':!![]});return db[_0x3ae9('0x9e')][_0x3ae9('0x82')](createExtensionsReciveFax(_0x3cc4f0),{'transaction':_0x2a6405});});})[_0x3ae9('0x1c')](function(){return _0x3cc4f0;})[_0x3ae9('0x1c')](respondWithResult(_0x470e86,null))[_0x3ae9('0x56')](handleError(_0x470e86,null));};exports[_0x3ae9('0x9f')]=function(_0x3f6caa,_0x2ed410,_0x54120b){var _0x31450f;return db[_0x3ae9('0x7c')][_0x3ae9('0x7d')](function(_0x98502a){return db[_0x3ae9('0x3d')][_0x3ae9('0x30')](_0x3f6caa[_0x3ae9('0x5c')],{'where':{'id':_0x3f6caa[_0x3ae9('0x5c')]['id']},'transaction':_0x98502a})[_0x3ae9('0x1c')](function(_0x491d80){return db['VoiceExtension'][_0x3ae9('0x31')]({'where':{'FaxAccountId':_0x3f6caa[_0x3ae9('0x5c')]['id']},'transaction':_0x98502a})[_0x3ae9('0x1c')](function(_0x874f27){return db[_0x3ae9('0x9e')][_0x3ae9('0x82')](createExtensionsReciveFax(_[_0x3ae9('0x6f')](_0x3f6caa[_0x3ae9('0x5c')],[_0x3ae9('0xa0'),'key',_0x3ae9('0xa1'),'updatedAt',_0x3ae9('0xa2'),_0x3ae9('0xa3')])),{'transaction':_0x98502a});});});})['then'](function(){return db['FaxAccount']['findById'](_0x3f6caa[_0x3ae9('0x5c')]['id']);})[_0x3ae9('0x1c')](respondWithResult(_0x2ed410,null))['catch'](handleError(_0x2ed410,null));};exports[_0x3ae9('0xa4')]=function(_0x1deb60,_0x3b44de,_0x59b2be){var _0xb26ff7={'raw':!![],'where':{}};var _0x21ebb4={};var _0x2ac1fe={'count':0x0,'rows':[]};return db['FaxAccount'][_0x3ae9('0x71')]({'where':{'id':_0x1deb60[_0x3ae9('0x58')]['id']}})[_0x3ae9('0x1c')](handleEntityNotFound(_0x3b44de,null))[_0x3ae9('0x1c')](function(_0x3927b1){if(_0x3927b1){_0x21ebb4[_0x3ae9('0x42')]=_[_0x3ae9('0x44')](db['FaxMessage'][_0x3ae9('0x3e')]);_0x21ebb4['query']=_['keys'](_0x1deb60[_0x3ae9('0x43')]);_0x21ebb4[_0x3ae9('0x45')]=_[_0x3ae9('0x46')](_0x21ebb4['model'],_0x21ebb4['query']);_0xb26ff7[_0x3ae9('0x48')]=_['intersection'](_0x21ebb4[_0x3ae9('0x42')],qs[_0x3ae9('0x47')](_0x1deb60['query'][_0x3ae9('0x47')]));_0xb26ff7[_0x3ae9('0x48')]=_0xb26ff7[_0x3ae9('0x48')]['length']?_0xb26ff7[_0x3ae9('0x48')]:_0x21ebb4['model'];if(!_0x1deb60[_0x3ae9('0x43')][_0x3ae9('0x4a')](_0x3ae9('0x4b'))){_0xb26ff7['limit']=qs[_0x3ae9('0x29')](_0x1deb60['query']['limit']);_0xb26ff7[_0x3ae9('0x28')]=qs[_0x3ae9('0x28')](_0x1deb60[_0x3ae9('0x43')][_0x3ae9('0x28')]);}_0xb26ff7[_0x3ae9('0x4c')]=qs[_0x3ae9('0x4d')](_0x1deb60[_0x3ae9('0x43')][_0x3ae9('0x4d')]);_0xb26ff7[_0x3ae9('0x50')]=qs['filters'](_[_0x3ae9('0x4e')](_0x1deb60['query'],_0x21ebb4[_0x3ae9('0x45')]));_0xb26ff7['where'][_0x3ae9('0x64')]=_0x3927b1['id'];if(_0x1deb60[_0x3ae9('0x43')]['filter']){_0xb26ff7[_0x3ae9('0x50')]=_[_0x3ae9('0x51')](_0xb26ff7[_0x3ae9('0x50')],{'$or':_[_0x3ae9('0x3c')](_0xb26ff7['attributes'],function(_0x2b5c76){var _0x407f4e={};_0x407f4e[_0x2b5c76]={'$like':'%'+_0x1deb60['query'][_0x3ae9('0x4f')]+'%'};return _0x407f4e;})});}if(_0x1deb60[_0x3ae9('0x43')][_0x3ae9('0xa5')]){var _0x4e83d9=_0x1deb60[_0x3ae9('0x43')][_0x3ae9('0xa5')][_0x3ae9('0xa6')](',');var _0x188d36={};_0x188d36[_0x4e83d9[0x0]]={'$gte':moment(_0x4e83d9[0x1])[_0x3ae9('0xa7')](_0x3ae9('0xa8'))};_0xb26ff7[_0x3ae9('0x50')]=_['merge'](_0xb26ff7['where'],_0x188d36);}_0xb26ff7=_['merge']({},_0xb26ff7,_0x1deb60['options']);return db[_0x3ae9('0xa9')][_0x3ae9('0x2b')]({'where':_0xb26ff7[_0x3ae9('0x50')]})[_0x3ae9('0x1c')](function(_0x205b80){_0x2ac1fe[_0x3ae9('0x2b')]=_0x205b80;if(_0x1deb60[_0x3ae9('0x43')][_0x3ae9('0x54')]){_0xb26ff7[_0x3ae9('0x59')]=[{'all':!![]}];}return db[_0x3ae9('0xa9')][_0x3ae9('0x55')](_0xb26ff7);})[_0x3ae9('0x1c')](function(_0x563aac){_0x2ac1fe[_0x3ae9('0x6a')]=_0x563aac;return _0x2ac1fe;});}})[_0x3ae9('0x1c')](respondWithFilteredResult(_0x3b44de,_0xb26ff7))[_0x3ae9('0x56')](handleError(_0x3b44de,null));};exports[_0x3ae9('0x38')]=function(_0x366f0,_0x1b780f,_0x2b62e5){var _0x369fc2,_0xdedf09={},_0x32d040;if(_0x366f0['body']['to']){_0x32d040=_0x366f0[_0x3ae9('0x5c')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x366f0[_0x3ae9('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x3ae9('0xaa'),'include':[{'model':db[_0x3ae9('0x72')],'as':_0x3ae9('0xab'),'where':{'fax':_0x32d040},'limit':0x1,'order':[[_0x3ae9('0xac'),_0x3ae9('0xad')]]}]}]})['then'](handleEntityNotFound(_0x1b780f,null))[_0x3ae9('0x1c')](function(_0x457f6c){_0x369fc2=_0x457f6c;if(_0x366f0[_0x3ae9('0x5c')]['attachments']&&_0x366f0['body']['attachments']['length']){for(var _0x505ae1=0x0;_0x505ae1<_0x366f0[_0x3ae9('0x5c')][_0x3ae9('0xae')][_0x3ae9('0x49')];_0x505ae1+=0x1){_0x366f0[_0x3ae9('0x5c')]['attachments'][_0x505ae1]={'filename':_0x366f0[_0x3ae9('0x5c')][_0x3ae9('0xae')][_0x505ae1][_0x3ae9('0x37')],'id':_0x366f0['body'][_0x3ae9('0xae')][_0x505ae1]['id'],'path':path[_0x3ae9('0xaf')](config[_0x3ae9('0xb0')],_0x3ae9('0xb1'),_0x366f0[_0x3ae9('0x5c')]['attachments'][_0x505ae1][_0x3ae9('0xb2')])};}}return respondWithRpcPromise(_0x3ae9('0xb3'),_0x3ae9('0xb3'),{'FaxAccountId':_[_0x3ae9('0xb4')](_0x366f0['params']['id'])?undefined:_0x366f0[_0x3ae9('0x58')]['id'],'path':_['isNil'](_0x366f0[_0x3ae9('0x5c')][_0x3ae9('0xae')][0x0][_0x3ae9('0x9')])?undefined:_0x366f0['body']['attachments'][0x0][_0x3ae9('0x9')],'fax':_[_0x3ae9('0xb4')](_0x366f0[_0x3ae9('0x5c')]['to'][0x0])?undefined:_0x366f0[_0x3ae9('0x5c')]['to'][0x0]},client9002);})[_0x3ae9('0x1c')](function(){if(_0x369fc2){if(_[_0x3ae9('0xb4')](_0x366f0[_0x3ae9('0x5c')][_0x3ae9('0xb5')])){_0x366f0['body'][_0x3ae9('0xb5')]=util[_0x3ae9('0xa7')](_0x3ae9('0xb6'),_0x369fc2[_0x3ae9('0x37')],_0x369fc2[_0x3ae9('0xb7')]);}if(_0x369fc2[_0x3ae9('0xaa')]){if(_0x369fc2[_0x3ae9('0xaa')]['Contacts'][_0x3ae9('0x49')]){return _0x369fc2[_0x3ae9('0xaa')][_0x3ae9('0xab')][0x0];}else{return db[_0x3ae9('0x72')][_0x3ae9('0x5b')](_[_0x3ae9('0xb8')](_0x366f0[_0x3ae9('0x5c')],{'firstName':_0x366f0['body']['to'][0x0],'phone':_0x366f0[_0x3ae9('0x5c')]['to'][0x0],'fax':_0x366f0[_0x3ae9('0x5c')]['to'][0x0],'ListId':_0x369fc2['ListId']}));}}else{throw new Error(_0x3ae9('0xb9'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x3ae9('0x1c')](function(_0x53524b){if(_0x53524b){return db[_0x3ae9('0x6e')][_0x3ae9('0x5a')]({'where':{'ContactId':_0x53524b['id'],'closed':![],'FaxAccountId':_0x369fc2['id']}})[_0x3ae9('0x1c')](function(_0x314808){if(_0x314808){return[_0x314808,![]];}return db[_0x3ae9('0x6e')][_0x3ae9('0x5b')]({'UserId':_0x366f0[_0x3ae9('0x5d')]['id'],'ContactId':_0x53524b['id'],'FaxAccountId':_0x369fc2['id'],'fax':_0x366f0['body']['to'][0x0],'firstMsgDirection':_0x3ae9('0xba'),'Messages':[_[_0x3ae9('0x51')](_0x366f0[_0x3ae9('0x5c')],{'read':![],'body':_0x366f0[_0x3ae9('0x5c')][_0x3ae9('0xae')][0x0][_0x3ae9('0xbb')],'FaxAccountId':_0x369fc2['id'],'UserId':_0x366f0['user']['id'],'ContactId':_0x53524b['id'],'AttachmentId':_0x366f0[_0x3ae9('0x5c')][_0x3ae9('0xae')][0x0]['id']})]},{'include':[{'model':db[_0x3ae9('0xa9')],'as':_0x3ae9('0xbc')}]})[_0x3ae9('0x1c')](function(_0x14d250){return[_0x14d250,!![]];});});}else{throw new Error(_0x3ae9('0xbd'));}})['spread'](function(_0x4f11f6,_0x35531b){if(_0x35531b){return _0x4f11f6;}return db['FaxMessage'][_0x3ae9('0x5b')]({'direction':'out','read':![],'body':_0x366f0[_0x3ae9('0x5c')]['attachments'][0x0][_0x3ae9('0xbb')],'FaxAccountId':_0x369fc2['id'],'FaxInteractionId':_0x4f11f6['id'],'UserId':_0x366f0[_0x3ae9('0x5d')]['id'],'ContactId':_0x4f11f6['ContactId'],'AttachmentId':_0x366f0[_0x3ae9('0x5c')]['attachments'][0x0]['id']})[_0x3ae9('0x1c')](function(_0x2c7973){_0x4f11f6[_0x3ae9('0xbe')]['Messages']=[];_0x4f11f6[_0x3ae9('0xbe')][_0x3ae9('0xbc')]['push'](_0x2c7973[_0x3ae9('0xbe')]);return _0x4f11f6;});})[_0x3ae9('0x1c')](function(_0x54f890){respondWithRpcPromise('SendFax',_0x3ae9('0xbf'),{'FaxAccountId':_[_0x3ae9('0xb4')](_0x366f0[_0x3ae9('0x58')]['id'])?undefined:_0x366f0[_0x3ae9('0x58')]['id'],'path':_['isNil'](_0x366f0[_0x3ae9('0x5c')][_0x3ae9('0xae')][0x0][_0x3ae9('0x9')])?undefined:_0x366f0['body'][_0x3ae9('0xae')][0x0][_0x3ae9('0x9')],'fax':_['isNil'](_0x366f0[_0x3ae9('0x5c')]['to'][0x0])?undefined:_0x366f0[_0x3ae9('0x5c')]['to'][0x0],'AttachmentId':_0x366f0[_0x3ae9('0x5c')]['attachments'][0x0]['id']},client9002)['then'](function(_0x59afbb){logger[_0x3ae9('0x23')](_0x3ae9('0xc0'),_0x59afbb);})['catch'](function(_0x3acbf1){logger[_0x3ae9('0x23')]('SendFaxRpc,\x20%s',_0x3acbf1);});return _0x54f890;})[_0x3ae9('0x1c')](respondWithResult(_0x1b780f,null))['catch'](handleError(_0x1b780f,null));};exports[_0x3ae9('0xc1')]=function(_0xde5415,_0xf5ffa5,_0x4737d9){return db['FaxAccount'][_0x3ae9('0x5a')]({'where':{'id':_0xde5415[_0x3ae9('0x58')]['id']}})[_0x3ae9('0x1c')](handleEntityNotFound(_0xf5ffa5,null))[_0x3ae9('0x1c')](function(_0x22f045){if(_0x22f045){return _0x22f045[_0x3ae9('0xc1')](_0xde5415['body'][_0x3ae9('0x6c')],_[_0x3ae9('0x6f')](_0xde5415['body'],[_0x3ae9('0x6c'),'id'])||{})['spread'](function(_0x9a6022){for(var _0x3e64af=0x0;_0x3e64af<_0xde5415[_0x3ae9('0x5c')][_0x3ae9('0x6c')][_0x3ae9('0x49')];_0x3e64af+=0x1){socket[_0x3ae9('0xc2')]('userFaxAccount:save',{'UserId':Number(_0xde5415['body'][_0x3ae9('0x6c')][_0x3e64af]),'FaxAccountId':Number(_0xde5415[_0x3ae9('0x58')]['id'])});}return _0x9a6022;});}})['then'](respondWithResult(_0xf5ffa5,null))[_0x3ae9('0x56')](handleError(_0xf5ffa5,null));};exports[_0x3ae9('0xc3')]=function(_0x3f0334,_0x36e391,_0x3deed3){return db[_0x3ae9('0x3d')][_0x3ae9('0x5a')]({'where':{'id':_0x3f0334['params']['id']}})[_0x3ae9('0x1c')](handleEntityNotFound(_0x36e391,null))[_0x3ae9('0x1c')](function(_0xa4e134){if(_0xa4e134){return _0xa4e134[_0x3ae9('0xc3')](_0x3f0334[_0x3ae9('0x43')][_0x3ae9('0x6c')])[_0x3ae9('0x1c')](function(){if(_[_0x3ae9('0xc4')](_0x3f0334[_0x3ae9('0x43')]['ids'])){for(var _0x147b78=0x0;_0x147b78<_0x3f0334['query']['ids'][_0x3ae9('0x49')];_0x147b78+=0x1){socket[_0x3ae9('0xc2')](_0x3ae9('0xc5'),{'UserId':Number(_0x3f0334[_0x3ae9('0x43')][_0x3ae9('0x6c')][_0x147b78]),'FaxAccountId':Number(_0x3f0334[_0x3ae9('0x58')]['id'])});}}else{socket[_0x3ae9('0xc2')](_0x3ae9('0xc5'),{'UserId':Number(_0x3f0334[_0x3ae9('0x43')]['ids']),'FaxAccountId':Number(_0x3f0334[_0x3ae9('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x36e391,null))['catch'](handleError(_0x36e391,null));};exports[_0x3ae9('0xc6')]=function(_0x38a506,_0x2436db,_0x440a68){var _0x354072={};var _0x1fb47f={};var _0x5c3c2d;var _0x273d32;return db[_0x3ae9('0x3d')][_0x3ae9('0x71')]({'where':{'id':_0x38a506[_0x3ae9('0x58')]['id']}})[_0x3ae9('0x1c')](handleEntityNotFound(_0x2436db,null))[_0x3ae9('0x1c')](function(_0x367567){if(_0x367567){_0x5c3c2d=_0x367567;_0x1fb47f['model']=_[_0x3ae9('0x44')](db[_0x3ae9('0x74')][_0x3ae9('0x3e')]);_0x1fb47f[_0x3ae9('0x43')]=_['keys'](_0x38a506[_0x3ae9('0x43')]);_0x1fb47f[_0x3ae9('0x45')]=_[_0x3ae9('0x46')](_0x1fb47f[_0x3ae9('0x42')],_0x1fb47f[_0x3ae9('0x43')]);_0x354072[_0x3ae9('0x48')]=_['intersection'](_0x1fb47f['model'],qs['fields'](_0x38a506['query'][_0x3ae9('0x47')]));_0x354072[_0x3ae9('0x48')]=_0x354072[_0x3ae9('0x48')][_0x3ae9('0x49')]?_0x354072['attributes']:_0x1fb47f[_0x3ae9('0x42')];_0x354072[_0x3ae9('0x4c')]=qs[_0x3ae9('0x4d')](_0x38a506[_0x3ae9('0x43')]['sort']);_0x354072[_0x3ae9('0x50')]=qs['filters'](_[_0x3ae9('0x4e')](_0x38a506['query'],_0x1fb47f[_0x3ae9('0x45')]));if(_0x38a506[_0x3ae9('0x43')][_0x3ae9('0x4f')]){_0x354072[_0x3ae9('0x50')]=_[_0x3ae9('0x51')](_0x354072['where'],{'$or':_[_0x3ae9('0x3c')](_0x354072[_0x3ae9('0x48')],function(_0x546e2f){var _0x21305a={};_0x21305a[_0x546e2f]={'$like':'%'+_0x38a506['query'][_0x3ae9('0x4f')]+'%'};return _0x21305a;})});}_0x354072=_[_0x3ae9('0x51')]({},_0x354072,_0x38a506[_0x3ae9('0x53')]);return _0x5c3c2d['getAgents'](_0x354072);}})[_0x3ae9('0x1c')](function(_0x1af786){if(_0x1af786){_0x273d32=_0x1af786[_0x3ae9('0x49')];if(!_0x38a506[_0x3ae9('0x43')][_0x3ae9('0x4a')](_0x3ae9('0x4b'))){_0x354072[_0x3ae9('0x29')]=qs['limit'](_0x38a506[_0x3ae9('0x43')][_0x3ae9('0x29')]);_0x354072['offset']=qs[_0x3ae9('0x28')](_0x38a506[_0x3ae9('0x43')][_0x3ae9('0x28')]);}return _0x5c3c2d['getAgents'](_0x354072);}})[_0x3ae9('0x1c')](function(_0x250e29){if(_0x250e29){return _0x250e29?{'count':_0x273d32,'rows':_0x250e29}:null;}})['then'](respondWithResult(_0x2436db,null))['catch'](handleError(_0x2436db,null));}; \ No newline at end of file +var _0xc6db=['from','format','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','isArray','emit','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','http','client','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','filter','merge','options','FaxAccount','rows','show','params','Pause','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','autoAssociation','describe','addDisposition','FaxAccountId','Disposition','getDispositions','sort','pick','includeAll','findAll','removeDispositions','addAnswer','CannedAnswer','findOne','order','removeAnswers','ids','addInteraction','omit','getInteractions','FaxInteraction','User','fullname','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','addAccountApplications','VoiceExtension','updateAccountApplications','tech','key','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xc6db,0xd4));var _0xbc6d=function(_0x50e6d7,_0x64c311){_0x50e6d7=_0x50e6d7-0x0;var _0x3df90e=_0xc6db[_0x50e6d7];return _0x3df90e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbc6d('0x0'));var zipdir=require(_0xbc6d('0x1'));var jsonpatch=require(_0xbc6d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbc6d('0x3'));var Mustache=require(_0xbc6d('0x4'));var util=require('util');var path=require(_0xbc6d('0x5'));var sox=require('sox');var csv=require(_0xbc6d('0x6'));var ejs=require(_0xbc6d('0x7'));var fs=require('fs');var fs_extra=require(_0xbc6d('0x8'));var _=require('lodash');var squel=require(_0xbc6d('0x9'));var crypto=require(_0xbc6d('0xa'));var jsforce=require(_0xbc6d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbc6d('0x6'));var querystring=require(_0xbc6d('0xc'));var Papa=require(_0xbc6d('0xd'));var Redis=require(_0xbc6d('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbc6d('0xf'));var hardwareService=require(_0xbc6d('0x10'));var logger=require(_0xbc6d('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xbc6d('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc6d('0x13'))['db'];config[_0xbc6d('0x14')]=_[_0xbc6d('0x15')](config['redis'],{'host':_0xbc6d('0x16'),'port':0x18eb});var socket=require(_0xbc6d('0x17'))(new Redis(config[_0xbc6d('0x14')]));require(_0xbc6d('0x18'))['register'](socket);var jayson=require(_0xbc6d('0x19'));var client=jayson['client'][_0xbc6d('0x1a')]({'port':0x232c});var client9002=jayson[_0xbc6d('0x1b')][_0xbc6d('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xd39efb,_0x24a86c,_0x4e765d,_0x135a8c){return new BPromise(function(_0x10c866,_0x27f4eb){var _0x31dcb6=_0x135a8c||client;return _0x31dcb6[_0xbc6d('0x1c')](_0xd39efb,_0x4e765d)['then'](function(_0x279d16){logger[_0xbc6d('0x1d')](_0xbc6d('0x1e'),_0x24a86c,_0xbc6d('0x1f'));logger['debug'](_0xbc6d('0x20'),_0x24a86c,_0xbc6d('0x1f'),JSON[_0xbc6d('0x21')](_0x279d16));if(_0x279d16[_0xbc6d('0x22')]){if(_0x279d16[_0xbc6d('0x22')][_0xbc6d('0x23')]===0x1f4){logger[_0xbc6d('0x22')](_0xbc6d('0x1e'),_0x24a86c,_0x279d16[_0xbc6d('0x22')][_0xbc6d('0x24')]);return _0x27f4eb(_0x279d16['error']['message']);}logger[_0xbc6d('0x22')](_0xbc6d('0x1e'),_0x24a86c,_0x279d16['error'][_0xbc6d('0x24')]);return _0x10c866(_0x279d16[_0xbc6d('0x22')][_0xbc6d('0x24')]);}else{logger[_0xbc6d('0x1d')](_0xbc6d('0x1e'),_0x24a86c,_0xbc6d('0x1f'));_0x10c866(_0x279d16[_0xbc6d('0x25')]['message']);}})[_0xbc6d('0x26')](function(_0x385a81){logger['error'](_0xbc6d('0x1e'),_0x24a86c,_0x385a81);_0x27f4eb(_0x385a81);});});}function respondWithStatusCode(_0x32db5b,_0x5d6cdc){_0x5d6cdc=_0x5d6cdc||0xcc;return function(_0x48b6c2){if(_0x48b6c2){return _0x32db5b[_0xbc6d('0x27')](_0x5d6cdc);}return _0x32db5b[_0xbc6d('0x28')](_0x5d6cdc)[_0xbc6d('0x29')]();};}function respondWithResult(_0x29fbed,_0x5695f3){_0x5695f3=_0x5695f3||0xc8;return function(_0x551efd){if(_0x551efd){return _0x29fbed['status'](_0x5695f3)['json'](_0x551efd);}};}function respondWithFilteredResult(_0x36d242,_0x4751aa){return function(_0x1bf283){if(_0x1bf283){var _0x452190=typeof _0x4751aa[_0xbc6d('0x2a')]===_0xbc6d('0x2b')&&typeof _0x4751aa[_0xbc6d('0x2c')]===_0xbc6d('0x2b');var _0x7c808d=_0x1bf283[_0xbc6d('0x2d')];var _0x28c519=_0x452190?0x0:_0x4751aa[_0xbc6d('0x2a')];var _0x5a8a86=_0x452190?_0x1bf283['count']:_0x4751aa[_0xbc6d('0x2a')]+_0x4751aa['limit'];var _0x28c579;if(_0x5a8a86>=_0x7c808d){_0x5a8a86=_0x7c808d;_0x28c579=0xc8;}else{_0x28c579=0xce;}_0x36d242[_0xbc6d('0x28')](_0x28c579);return _0x36d242[_0xbc6d('0x2e')]('Content-Range',_0x28c519+'-'+_0x5a8a86+'/'+_0x7c808d)[_0xbc6d('0x2f')](_0x1bf283);}return null;};}function patchUpdates(_0x28744f){return function(_0x3a1f83){try{jsonpatch[_0xbc6d('0x30')](_0x3a1f83,_0x28744f,!![]);}catch(_0x281286){return BPromise['reject'](_0x281286);}return _0x3a1f83[_0xbc6d('0x31')]();};}function saveUpdates(_0x4ebe51,_0x3b687a){return function(_0x30ab1a){if(_0x30ab1a){return _0x30ab1a[_0xbc6d('0x32')](_0x4ebe51)[_0xbc6d('0x33')](function(_0x3b0166){return _0x3b0166;});}return null;};}function removeEntity(_0x39d08e,_0x57376c){return function(_0x48ca5a){if(_0x48ca5a){return _0x48ca5a[_0xbc6d('0x34')]()['then'](function(){var _0x42d9e8=_0x48ca5a[_0xbc6d('0x35')]({'plain':!![]});var _0x41645f='FaxAccounts';return db[_0xbc6d('0x36')]['destroy']({'where':{'type':_0x41645f,'resourceId':_0x42d9e8['id']}})[_0xbc6d('0x33')](function(){return _0x48ca5a;});})[_0xbc6d('0x33')](function(){_0x39d08e[_0xbc6d('0x28')](0xcc)[_0xbc6d('0x29')]();});}};}function handleEntityNotFound(_0x23f21a,_0xd08123){return function(_0x315593){if(!_0x315593){_0x23f21a[_0xbc6d('0x27')](0x194);}return _0x315593;};}function handleError(_0x22975b,_0x19fd4b){_0x19fd4b=_0x19fd4b||0x1f4;return function(_0x32183e){logger['error'](_0x32183e[_0xbc6d('0x37')]);if(_0x32183e[_0xbc6d('0x38')]){delete _0x32183e[_0xbc6d('0x38')];}_0x22975b[_0xbc6d('0x28')](_0x19fd4b)[_0xbc6d('0x39')](_0x32183e);};}exports[_0xbc6d('0x3a')]=function(_0x133e92,_0xa3d83a){var _0x4a769b={'include':[{'model':db['Pause'],'as':_0xbc6d('0x3b')}]},_0x4e991c={},_0x217a44={'count':0x0,'rows':[]};var _0x522280=_[_0xbc6d('0x3c')](db['FaxAccount'][_0xbc6d('0x3d')],function(_0x55030f){return{'name':_0x55030f[_0xbc6d('0x3e')],'type':_0x55030f[_0xbc6d('0x3f')]['key']};});_0x4e991c[_0xbc6d('0x40')]=_[_0xbc6d('0x3c')](_0x522280,_0xbc6d('0x38'));_0x4e991c['query']=_[_0xbc6d('0x41')](_0x133e92[_0xbc6d('0x42')]);_0x4e991c[_0xbc6d('0x43')]=_['intersection'](_0x4e991c[_0xbc6d('0x40')],_0x4e991c[_0xbc6d('0x42')]);_0x4a769b[_0xbc6d('0x44')]=_[_0xbc6d('0x45')](_0x4e991c['model'],qs[_0xbc6d('0x46')](_0x133e92['query']['fields']));_0x4a769b[_0xbc6d('0x44')]=_0x4a769b[_0xbc6d('0x44')][_0xbc6d('0x47')]?_0x4a769b[_0xbc6d('0x44')]:_0x4e991c[_0xbc6d('0x40')];if(!_0x133e92[_0xbc6d('0x42')][_0xbc6d('0x48')](_0xbc6d('0x49'))){_0x4a769b['limit']=qs[_0xbc6d('0x2c')](_0x133e92['query'][_0xbc6d('0x2c')]);_0x4a769b[_0xbc6d('0x2a')]=qs[_0xbc6d('0x2a')](_0x133e92[_0xbc6d('0x42')]['offset']);}_0x4a769b['order']=qs['sort'](_0x133e92[_0xbc6d('0x42')]['sort']);_0x4a769b[_0xbc6d('0x4a')]=qs[_0xbc6d('0x43')](_['pick'](_0x133e92['query'],_0x4e991c['filters']),_0x522280);if(_0x133e92[_0xbc6d('0x42')][_0xbc6d('0x4b')]){_0x4a769b[_0xbc6d('0x4a')]=_[_0xbc6d('0x4c')](_0x4a769b['where'],{'$or':_['map'](_0x522280,function(_0x3b72d9){if(_0x3b72d9['type']!=='VIRTUAL'){var _0x4279ea={};_0x4279ea[_0x3b72d9[_0xbc6d('0x38')]]={'$like':'%'+_0x133e92[_0xbc6d('0x42')][_0xbc6d('0x4b')]+'%'};return _0x4279ea;}})});}_0x4a769b=_['merge']({},_0x4a769b,_0x133e92[_0xbc6d('0x4d')]);var _0x2cee25={'where':_0x4a769b[_0xbc6d('0x4a')]};return db[_0xbc6d('0x4e')]['count'](_0x2cee25)['then'](function(_0x2e7502){_0x217a44[_0xbc6d('0x2d')]=_0x2e7502;if(_0x133e92[_0xbc6d('0x42')]['includeAll']){_0x4a769b['include']=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x4a769b);})[_0xbc6d('0x33')](function(_0x21a8dc){_0x217a44[_0xbc6d('0x4f')]=_0x21a8dc;return _0x217a44;})[_0xbc6d('0x33')](respondWithFilteredResult(_0xa3d83a,_0x4a769b))[_0xbc6d('0x26')](handleError(_0xa3d83a,null));};exports[_0xbc6d('0x50')]=function(_0x523745,_0x1e69e9){var _0x1aa78a={'raw':![],'where':{'id':_0x523745[_0xbc6d('0x51')]['id']},'include':[{'model':db[_0xbc6d('0x52')],'as':_0xbc6d('0x3b')}]},_0x8004bf={};_0x8004bf['model']=_['keys'](db[_0xbc6d('0x4e')][_0xbc6d('0x3d')]);_0x8004bf['query']=_['keys'](_0x523745[_0xbc6d('0x42')]);_0x8004bf[_0xbc6d('0x43')]=_[_0xbc6d('0x45')](_0x8004bf[_0xbc6d('0x40')],_0x8004bf[_0xbc6d('0x42')]);_0x1aa78a[_0xbc6d('0x44')]=_['intersection'](_0x8004bf['model'],qs['fields'](_0x523745['query'][_0xbc6d('0x46')]));_0x1aa78a[_0xbc6d('0x44')]=_0x1aa78a[_0xbc6d('0x44')]['length']?_0x1aa78a[_0xbc6d('0x44')]:_0x8004bf[_0xbc6d('0x40')];if(_0x523745['query']['includeAll']){_0x1aa78a[_0xbc6d('0x53')]=[{'all':!![]}];}_0x1aa78a=_[_0xbc6d('0x4c')]({},_0x1aa78a,_0x523745['options']);return db[_0xbc6d('0x4e')][_0xbc6d('0x54')](_0x1aa78a)['then'](handleEntityNotFound(_0x1e69e9,null))[_0xbc6d('0x33')](respondWithResult(_0x1e69e9,null))[_0xbc6d('0x26')](handleError(_0x1e69e9,null));};exports[_0xbc6d('0x55')]=function(_0x30e95a,_0x2383d5){return db[_0xbc6d('0x4e')][_0xbc6d('0x55')](_0x30e95a[_0xbc6d('0x56')],{})[_0xbc6d('0x33')](function(_0x100100){var _0x33026f=_0x30e95a[_0xbc6d('0x57')][_0xbc6d('0x35')]({'plain':!![]});if(!_0x33026f)throw new Error(_0xbc6d('0x58'));if(_0x33026f[_0xbc6d('0x59')]===_0xbc6d('0x57')){var _0x27a3b9=_0x100100[_0xbc6d('0x35')]({'plain':!![]});var _0x399cfb=_0xbc6d('0x5a');return db[_0xbc6d('0x5b')][_0xbc6d('0x54')]({'where':{'name':_0x399cfb,'userProfileId':_0x33026f['userProfileId']},'raw':!![]})[_0xbc6d('0x33')](function(_0xe3edf9){if(_0xe3edf9&&_0xe3edf9[_0xbc6d('0x5c')]===0x0){return db[_0xbc6d('0x36')]['create']({'name':_0x27a3b9[_0xbc6d('0x38')],'resourceId':_0x27a3b9['id'],'type':_0xe3edf9[_0xbc6d('0x38')],'sectionId':_0xe3edf9['id']},{})[_0xbc6d('0x33')](function(){return _0x100100;});}else{return _0x100100;}})[_0xbc6d('0x26')](function(_0x62f0f5){logger[_0xbc6d('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x62f0f5);throw _0x62f0f5;});}return _0x100100;})[_0xbc6d('0x33')](respondWithResult(_0x2383d5,0xc9))[_0xbc6d('0x26')](handleError(_0x2383d5,null));};exports[_0xbc6d('0x32')]=function(_0x20868d,_0x3dbd0c){if(_0x20868d[_0xbc6d('0x56')]['id']){delete _0x20868d[_0xbc6d('0x56')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x20868d['params']['id']},'include':[{'model':db[_0xbc6d('0x52')],'as':_0xbc6d('0x3b')}]})[_0xbc6d('0x33')](handleEntityNotFound(_0x3dbd0c,null))['then'](saveUpdates(_0x20868d[_0xbc6d('0x56')],null))[_0xbc6d('0x33')](respondWithResult(_0x3dbd0c,null))[_0xbc6d('0x26')](handleError(_0x3dbd0c,null));};exports['destroy']=function(_0x11b2bb,_0x1f97c1){return db[_0xbc6d('0x4e')][_0xbc6d('0x54')]({'where':{'id':_0x11b2bb[_0xbc6d('0x51')]['id']}})[_0xbc6d('0x33')](handleEntityNotFound(_0x1f97c1,null))[_0xbc6d('0x33')](removeEntity(_0x1f97c1,null))['catch'](handleError(_0x1f97c1,null));};exports[_0xbc6d('0x5d')]=function(_0x5d9ff2,_0x4cfe7c){return db['FaxAccount'][_0xbc6d('0x5d')]()['then'](respondWithResult(_0x4cfe7c,null))[_0xbc6d('0x26')](handleError(_0x4cfe7c,null));};exports[_0xbc6d('0x5e')]=function(_0x5732d0,_0x540fcd,_0x3812aa){if(_0x5732d0[_0xbc6d('0x56')]['id']){delete _0x5732d0[_0xbc6d('0x56')]['id'];}return db[_0xbc6d('0x4e')]['find']({'where':{'id':_0x5732d0[_0xbc6d('0x51')]['id']}})[_0xbc6d('0x33')](handleEntityNotFound(_0x540fcd,null))[_0xbc6d('0x33')](function(_0x429a2b){if(_0x429a2b){_0x5732d0[_0xbc6d('0x56')][_0xbc6d('0x5f')]=_0x429a2b['id'];return db[_0xbc6d('0x60')]['create'](_0x5732d0[_0xbc6d('0x56')]);}})['then'](respondWithResult(_0x540fcd,null))[_0xbc6d('0x26')](handleError(_0x540fcd,null));};exports[_0xbc6d('0x61')]=function(_0x30347a,_0x1f8657,_0x1af3dc){var _0x31f2fd={'raw':![],'where':{}};var _0x275749={};var _0x1a7fbf={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x30347a['params']['id']}})[_0xbc6d('0x33')](handleEntityNotFound(_0x1f8657,null))['then'](function(_0x5afcb4){if(_0x5afcb4){_0x275749[_0xbc6d('0x40')]=_[_0xbc6d('0x41')](db[_0xbc6d('0x60')]['rawAttributes']);_0x275749['query']=_[_0xbc6d('0x41')](_0x30347a[_0xbc6d('0x42')]);_0x275749[_0xbc6d('0x43')]=_['intersection'](_0x275749['model'],_0x275749['query']);_0x31f2fd[_0xbc6d('0x44')]=_['intersection'](_0x275749[_0xbc6d('0x40')],qs[_0xbc6d('0x46')](_0x30347a['query']['fields']));_0x31f2fd[_0xbc6d('0x44')]=_0x31f2fd[_0xbc6d('0x44')][_0xbc6d('0x47')]?_0x31f2fd[_0xbc6d('0x44')]:_0x275749['model'];if(!_0x30347a[_0xbc6d('0x42')]['hasOwnProperty'](_0xbc6d('0x49'))){_0x31f2fd[_0xbc6d('0x2c')]=qs['limit'](_0x30347a[_0xbc6d('0x42')][_0xbc6d('0x2c')]);_0x31f2fd[_0xbc6d('0x2a')]=qs[_0xbc6d('0x2a')](_0x30347a['query'][_0xbc6d('0x2a')]);}_0x31f2fd['order']=qs['sort'](_0x30347a[_0xbc6d('0x42')][_0xbc6d('0x62')]);_0x31f2fd[_0xbc6d('0x4a')]=qs['filters'](_[_0xbc6d('0x63')](_0x30347a[_0xbc6d('0x42')],_0x275749[_0xbc6d('0x43')]));_0x31f2fd[_0xbc6d('0x4a')][_0xbc6d('0x5f')]=_0x5afcb4['id'];if(_0x30347a[_0xbc6d('0x42')][_0xbc6d('0x4b')]){_0x31f2fd[_0xbc6d('0x4a')]=_[_0xbc6d('0x4c')](_0x31f2fd['where'],{'$or':_[_0xbc6d('0x3c')](_0x31f2fd[_0xbc6d('0x44')],function(_0x472a95){var _0x160469={};_0x160469[_0x472a95]={'$like':'%'+_0x30347a[_0xbc6d('0x42')][_0xbc6d('0x4b')]+'%'};return _0x160469;})});}_0x31f2fd=_[_0xbc6d('0x4c')]({},_0x31f2fd,_0x30347a['options']);return db[_0xbc6d('0x60')][_0xbc6d('0x2d')]({'where':_0x31f2fd[_0xbc6d('0x4a')]})[_0xbc6d('0x33')](function(_0x18d4bf){_0x1a7fbf[_0xbc6d('0x2d')]=_0x18d4bf;if(_0x30347a[_0xbc6d('0x42')][_0xbc6d('0x64')]){_0x31f2fd[_0xbc6d('0x53')]=[{'all':!![]}];}return db[_0xbc6d('0x60')][_0xbc6d('0x65')](_0x31f2fd);})['then'](function(_0x2127dd){_0x1a7fbf[_0xbc6d('0x4f')]=_0x2127dd;return _0x1a7fbf;});}})[_0xbc6d('0x33')](respondWithFilteredResult(_0x1f8657,_0x31f2fd))['catch'](handleError(_0x1f8657,null));};exports[_0xbc6d('0x66')]=function(_0x4747e7,_0x2c5716,_0x5b6928){return db['FaxAccount'][_0xbc6d('0x54')]({'where':{'id':_0x4747e7[_0xbc6d('0x51')]['id']}})[_0xbc6d('0x33')](handleEntityNotFound(_0x2c5716,null))[_0xbc6d('0x33')](function(_0x4de919){if(_0x4de919){return _0x4de919['removeDispositions'](_0x4747e7[_0xbc6d('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x2c5716,null))[_0xbc6d('0x26')](handleError(_0x2c5716,null));};exports[_0xbc6d('0x67')]=function(_0x5a5258,_0x5633cf,_0x4f8b5d){if(_0x5a5258[_0xbc6d('0x56')]['id']){delete _0x5a5258[_0xbc6d('0x56')]['id'];}return db['FaxAccount'][_0xbc6d('0x54')]({'where':{'id':_0x5a5258[_0xbc6d('0x51')]['id']}})[_0xbc6d('0x33')](handleEntityNotFound(_0x5633cf,null))[_0xbc6d('0x33')](function(_0x2e118a){if(_0x2e118a){_0x5a5258[_0xbc6d('0x56')][_0xbc6d('0x5f')]=_0x2e118a['id'];return db[_0xbc6d('0x68')][_0xbc6d('0x55')](_0x5a5258[_0xbc6d('0x56')]);}})[_0xbc6d('0x33')](respondWithResult(_0x5633cf,null))[_0xbc6d('0x26')](handleError(_0x5633cf,null));};exports['getAnswers']=function(_0x56fbcc,_0x45fb13,_0x3a6829){var _0x1b1eeb={'raw':![],'where':{}};var _0x5afa0f={};var _0x25da59={'count':0x0,'rows':[]};return db[_0xbc6d('0x4e')][_0xbc6d('0x69')]({'where':{'id':_0x56fbcc[_0xbc6d('0x51')]['id']}})[_0xbc6d('0x33')](handleEntityNotFound(_0x45fb13,null))['then'](function(_0x1287fc){if(_0x1287fc){_0x5afa0f[_0xbc6d('0x40')]=_['keys'](db['CannedAnswer'][_0xbc6d('0x3d')]);_0x5afa0f['query']=_['keys'](_0x56fbcc[_0xbc6d('0x42')]);_0x5afa0f[_0xbc6d('0x43')]=_[_0xbc6d('0x45')](_0x5afa0f['model'],_0x5afa0f[_0xbc6d('0x42')]);_0x1b1eeb[_0xbc6d('0x44')]=_[_0xbc6d('0x45')](_0x5afa0f['model'],qs[_0xbc6d('0x46')](_0x56fbcc['query'][_0xbc6d('0x46')]));_0x1b1eeb[_0xbc6d('0x44')]=_0x1b1eeb[_0xbc6d('0x44')][_0xbc6d('0x47')]?_0x1b1eeb[_0xbc6d('0x44')]:_0x5afa0f[_0xbc6d('0x40')];if(!_0x56fbcc[_0xbc6d('0x42')][_0xbc6d('0x48')]('nolimit')){_0x1b1eeb['limit']=qs['limit'](_0x56fbcc['query'][_0xbc6d('0x2c')]);_0x1b1eeb['offset']=qs[_0xbc6d('0x2a')](_0x56fbcc[_0xbc6d('0x42')][_0xbc6d('0x2a')]);}_0x1b1eeb[_0xbc6d('0x6a')]=qs[_0xbc6d('0x62')](_0x56fbcc['query'][_0xbc6d('0x62')]);_0x1b1eeb[_0xbc6d('0x4a')]=qs['filters'](_[_0xbc6d('0x63')](_0x56fbcc['query'],_0x5afa0f['filters']));_0x1b1eeb[_0xbc6d('0x4a')][_0xbc6d('0x5f')]=_0x1287fc['id'];if(_0x56fbcc[_0xbc6d('0x42')][_0xbc6d('0x4b')]){_0x1b1eeb[_0xbc6d('0x4a')]=_['merge'](_0x1b1eeb[_0xbc6d('0x4a')],{'$or':_[_0xbc6d('0x3c')](_0x1b1eeb[_0xbc6d('0x44')],function(_0x46c2dc){var _0x2598d={};_0x2598d[_0x46c2dc]={'$like':'%'+_0x56fbcc[_0xbc6d('0x42')][_0xbc6d('0x4b')]+'%'};return _0x2598d;})});}_0x1b1eeb=_['merge']({},_0x1b1eeb,_0x56fbcc[_0xbc6d('0x4d')]);return db[_0xbc6d('0x68')][_0xbc6d('0x2d')]({'where':_0x1b1eeb[_0xbc6d('0x4a')]})['then'](function(_0x49757f){_0x25da59[_0xbc6d('0x2d')]=_0x49757f;if(_0x56fbcc[_0xbc6d('0x42')][_0xbc6d('0x64')]){_0x1b1eeb['include']=[{'all':!![]}];}return db[_0xbc6d('0x68')][_0xbc6d('0x65')](_0x1b1eeb);})['then'](function(_0x586ac5){_0x25da59[_0xbc6d('0x4f')]=_0x586ac5;return _0x25da59;});}})[_0xbc6d('0x33')](respondWithFilteredResult(_0x45fb13,_0x1b1eeb))[_0xbc6d('0x26')](handleError(_0x45fb13,null));};exports[_0xbc6d('0x6b')]=function(_0x5e90f9,_0x47bc17,_0x2e1f22){return db['FaxAccount']['find']({'where':{'id':_0x5e90f9[_0xbc6d('0x51')]['id']}})[_0xbc6d('0x33')](handleEntityNotFound(_0x47bc17,null))[_0xbc6d('0x33')](function(_0x312e0e){if(_0x312e0e){return _0x312e0e['removeAnswers'](_0x5e90f9[_0xbc6d('0x42')][_0xbc6d('0x6c')]);}})[_0xbc6d('0x33')](respondWithStatusCode(_0x47bc17,null))[_0xbc6d('0x26')](handleError(_0x47bc17,null));};exports[_0xbc6d('0x6d')]=function(_0x10a779,_0x3e7e05,_0x3a8c39){return db['FaxInteraction'][_0xbc6d('0x54')]({'where':{'id':_0x10a779[_0xbc6d('0x51')]['id']}})[_0xbc6d('0x33')](handleEntityNotFound(_0x3e7e05,null))[_0xbc6d('0x33')](function(_0x15b900){if(_0x15b900){return _0x15b900[_0xbc6d('0x6d')](_0x10a779[_0xbc6d('0x56')][_0xbc6d('0x6c')],_[_0xbc6d('0x6e')](_0x10a779[_0xbc6d('0x56')],[_0xbc6d('0x6c'),'id'])||{});}})[_0xbc6d('0x33')](respondWithResult(_0x3e7e05,null))[_0xbc6d('0x26')](handleError(_0x3e7e05,null));};exports[_0xbc6d('0x6f')]=function(_0x43c027,_0x402ff8,_0x5877be){var _0x306d36={'raw':![],'where':{}};var _0x680931={};var _0xf066a={'count':0x0,'rows':[]};return db[_0xbc6d('0x4e')]['findOne']({'where':{'id':_0x43c027[_0xbc6d('0x51')]['id']}})[_0xbc6d('0x33')](handleEntityNotFound(_0x402ff8,null))[_0xbc6d('0x33')](function(_0x123863){if(_0x123863){_0x680931[_0xbc6d('0x40')]=_[_0xbc6d('0x41')](db[_0xbc6d('0x70')][_0xbc6d('0x3d')]);_0x680931[_0xbc6d('0x42')]=_[_0xbc6d('0x41')](_0x43c027[_0xbc6d('0x42')]);_0x680931['filters']=_['intersection'](_0x680931[_0xbc6d('0x40')],_0x680931[_0xbc6d('0x42')]);_0x306d36['attributes']=_[_0xbc6d('0x45')](_0x680931[_0xbc6d('0x40')],qs['fields'](_0x43c027[_0xbc6d('0x42')][_0xbc6d('0x46')]));_0x306d36[_0xbc6d('0x44')]=_0x306d36[_0xbc6d('0x44')][_0xbc6d('0x47')]?_0x306d36[_0xbc6d('0x44')]:_0x680931[_0xbc6d('0x40')];if(!_0x43c027[_0xbc6d('0x42')][_0xbc6d('0x48')]('nolimit')){_0x306d36[_0xbc6d('0x2c')]=qs[_0xbc6d('0x2c')](_0x43c027[_0xbc6d('0x42')]['limit']);_0x306d36[_0xbc6d('0x2a')]=qs[_0xbc6d('0x2a')](_0x43c027['query'][_0xbc6d('0x2a')]);}_0x306d36[_0xbc6d('0x6a')]=qs['sort'](_0x43c027[_0xbc6d('0x42')][_0xbc6d('0x62')]);_0x306d36[_0xbc6d('0x4a')]=qs[_0xbc6d('0x43')](_[_0xbc6d('0x63')](_0x43c027[_0xbc6d('0x42')],_0x680931[_0xbc6d('0x43')]));_0x306d36[_0xbc6d('0x4a')]['FaxAccountId']=_0x123863['id'];if(_0x43c027[_0xbc6d('0x42')]['filter']){_0x306d36[_0xbc6d('0x4a')]=_[_0xbc6d('0x4c')](_0x306d36['where'],{'$or':_[_0xbc6d('0x3c')](_0x306d36[_0xbc6d('0x44')],function(_0x1da32a){var _0x2b4ad9={};_0x2b4ad9[_0x1da32a]={'$like':'%'+_0x43c027['query'][_0xbc6d('0x4b')]+'%'};return _0x2b4ad9;})});}_0x306d36=_[_0xbc6d('0x4c')]({},_0x306d36,_0x43c027[_0xbc6d('0x4d')]);return db[_0xbc6d('0x70')][_0xbc6d('0x2d')]({'where':_0x306d36['where']})[_0xbc6d('0x33')](function(_0x1ef0a9){_0xf066a[_0xbc6d('0x2d')]=_0x1ef0a9;if(_0x43c027[_0xbc6d('0x42')][_0xbc6d('0x64')]){_0x306d36['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xbc6d('0x71')],'as':'Owner','attributes':[_0xbc6d('0x38'),_0xbc6d('0x72'),'internal'],'required':![]},{'model':db[_0xbc6d('0x73')],'as':_0xbc6d('0x74'),'attributes':['id',_0xbc6d('0x38'),_0xbc6d('0x75')],'where':_0x43c027[_0xbc6d('0x42')][_0xbc6d('0x76')]?{'id':_0x43c027[_0xbc6d('0x42')]['tag']}:undefined,'required':_0x43c027[_0xbc6d('0x42')][_0xbc6d('0x76')]?!![]:![]}];}return db[_0xbc6d('0x70')][_0xbc6d('0x65')](_0x306d36);})[_0xbc6d('0x33')](function(_0x5be16f){_0xf066a[_0xbc6d('0x4f')]=_0x5be16f;return _0xf066a;});}})['then'](respondWithFilteredResult(_0x402ff8,_0x306d36))['catch'](handleError(_0x402ff8,null));};exports['addApplications']=function(_0xcfef55,_0x119dd0){var _0x3b6040=_0xcfef55[_0xbc6d('0x51')]['id'];var _0x9b176=_0xcfef55[_0xbc6d('0x56')];var _0x58f785=0xc8;var _0x18f46c=null;return db[_0xbc6d('0x77')][_0xbc6d('0x78')]({'isolationLevel':db[_0xbc6d('0x77')][_0xbc6d('0x79')][_0xbc6d('0x7a')][_0xbc6d('0x7b')]},function(_0x58c030){return db[_0xbc6d('0x4e')][_0xbc6d('0x69')]({'where':{'id':_0x3b6040},'transaction':_0x58c030})[_0xbc6d('0x33')](function(_0x1af46a){if(_0x1af46a){return db[_0xbc6d('0x7c')]['destroy']({'where':{'FaxAccountId':_0x3b6040},'transaction':_0x58c030})[_0xbc6d('0x33')](function(){var _0x15c013=_[_0xbc6d('0x3c')](_0x9b176,function(_0x294cf1){_0x294cf1[_0xbc6d('0x5f')]=_0x3b6040;return _0x294cf1;});return db[_0xbc6d('0x7c')][_0xbc6d('0x7d')](_0x15c013,{'transaction':_0x58c030});});}else{_0x58f785=0x194;_0x18f46c=[];}});})['then'](function(){if(_0x58f785!==0x194){return db[_0xbc6d('0x7c')][_0xbc6d('0x7e')]({'where':{'FaxAccountId':_0x3b6040},'order':_0xbc6d('0x7f')})['then'](function(_0xb29274){_0x18f46c=_0xb29274;});}})[_0xbc6d('0x26')](function(_0x2b4842){_0x58f785=0x1f4;logger['error'](_0x2b4842[_0xbc6d('0x37')]);if(_0x2b4842[_0xbc6d('0x38')]){delete _0x2b4842[_0xbc6d('0x38')];}_0x18f46c=_0x2b4842;})[_0xbc6d('0x80')](function(){if(_0x18f46c===null){_0x119dd0[_0xbc6d('0x27')](_0x58f785);}else{if(_0x58f785===0x1f4){_0x119dd0['status'](_0x58f785)[_0xbc6d('0x39')](_0x18f46c);}else{_0x119dd0[_0xbc6d('0x28')](_0x58f785)[_0xbc6d('0x2f')](_0x18f46c);}}});};exports[_0xbc6d('0x81')]=function(_0x340418,_0x26c2a0,_0x2a7473){var _0x25f9dd={};var _0x5cd1fd={};var _0x151e09;var _0x5d8846;return db[_0xbc6d('0x4e')][_0xbc6d('0x69')]({'where':{'id':_0x340418['params']['id']}})[_0xbc6d('0x33')](handleEntityNotFound(_0x26c2a0,null))['then'](function(_0x1608a6){if(_0x1608a6){_0x151e09=_0x1608a6;_0x5cd1fd[_0xbc6d('0x40')]=_[_0xbc6d('0x41')](db['FaxApplication']['rawAttributes']);_0x5cd1fd[_0xbc6d('0x42')]=_[_0xbc6d('0x41')](_0x340418[_0xbc6d('0x42')]);_0x5cd1fd[_0xbc6d('0x43')]=_['intersection'](_0x5cd1fd[_0xbc6d('0x40')],_0x5cd1fd[_0xbc6d('0x42')]);_0x25f9dd[_0xbc6d('0x44')]=_[_0xbc6d('0x45')](_0x5cd1fd[_0xbc6d('0x40')],qs[_0xbc6d('0x46')](_0x340418[_0xbc6d('0x42')][_0xbc6d('0x46')]));_0x25f9dd[_0xbc6d('0x44')]=_0x25f9dd[_0xbc6d('0x44')][_0xbc6d('0x47')]?_0x25f9dd[_0xbc6d('0x44')]:_0x5cd1fd['model'];_0x25f9dd[_0xbc6d('0x6a')]=qs[_0xbc6d('0x62')](_0x340418[_0xbc6d('0x42')][_0xbc6d('0x62')]);_0x25f9dd[_0xbc6d('0x4a')]=qs[_0xbc6d('0x43')](_['pick'](_0x340418['query'],_0x5cd1fd[_0xbc6d('0x43')]));if(_0x340418[_0xbc6d('0x42')][_0xbc6d('0x4b')]){_0x25f9dd[_0xbc6d('0x4a')]=_[_0xbc6d('0x4c')](_0x25f9dd[_0xbc6d('0x4a')],{'$or':_['map'](_0x25f9dd[_0xbc6d('0x44')],function(_0x3d934b){var _0x3c7599={};_0x3c7599[_0x3d934b]={'$like':'%'+_0x340418[_0xbc6d('0x42')]['filter']+'%'};return _0x3c7599;})});}_0x25f9dd=_['merge']({},_0x25f9dd,_0x340418[_0xbc6d('0x4d')]);return _0x151e09[_0xbc6d('0x81')](_0x25f9dd);}})[_0xbc6d('0x33')](function(_0x35d6fa){if(_0x35d6fa){_0x5d8846=_0x35d6fa['length'];if(!_0x340418[_0xbc6d('0x42')][_0xbc6d('0x48')](_0xbc6d('0x49'))){_0x25f9dd[_0xbc6d('0x2c')]=qs[_0xbc6d('0x2c')](_0x340418[_0xbc6d('0x42')][_0xbc6d('0x2c')]);_0x25f9dd[_0xbc6d('0x2a')]=qs[_0xbc6d('0x2a')](_0x340418['query'][_0xbc6d('0x2a')]);}return _0x151e09['getApplications'](_0x25f9dd);}})[_0xbc6d('0x33')](function(_0x550d0d){if(_0x550d0d){return _0x550d0d?{'count':_0x5d8846,'rows':_0x550d0d}:null;}})[_0xbc6d('0x33')](respondWithResult(_0x26c2a0,null))[_0xbc6d('0x26')](handleError(_0x26c2a0,null));};function Extension(_0x18e87f,_0x50b0ee,_0x342941,_0x3a318c){this['context']=_0xbc6d('0x82');this[_0xbc6d('0x83')]=_0x18e87f[_0xbc6d('0x84')];this[_0xbc6d('0x85')]=_0x3a318c;this[_0xbc6d('0x3f')]=_0xbc6d('0x86');this[_0xbc6d('0x87')]=_0xbc6d('0x88');this[_0xbc6d('0x5f')]=_0x18e87f['id'];this[_0xbc6d('0x7f')]=_0x50b0ee;this[_0xbc6d('0x89')]=_0x342941;}function createExtensionsReciveFax(_0x122e34){var _0x1c4674=0x1;var _0x29220b=[];_0x29220b[_0xbc6d('0x8a')](new Extension(_0x122e34,_0x1c4674,'',_0xbc6d('0x8b')));_0x1c4674+=0x1;_0x29220b['push'](new Extension(_0x122e34,_0x1c4674,_0xbc6d('0x8c'),_0xbc6d('0x8d')));_0x1c4674+=0x1;for(var _0x151f96 in _0x122e34){if(_0x122e34[_0xbc6d('0x48')](_0x151f96)&&(_0x151f96===_0xbc6d('0x8e')||_0x151f96==='localstationid'||_0x151f96===_0xbc6d('0x8f')||_0x151f96===_0xbc6d('0x90')||_0x151f96===_0xbc6d('0x91')||_0x151f96===_0xbc6d('0x92')||_0x151f96===_0xbc6d('0x93')||_0x151f96===_0xbc6d('0x94')||_0x151f96===_0xbc6d('0x95'))){_0x29220b[_0xbc6d('0x8a')](new Extension(_0x122e34,_0x1c4674,'FAXOPT('+_0x151f96+')='+_0x122e34[_0x151f96],_0xbc6d('0x8d')));_0x1c4674+=0x1;}}_0x29220b[_0xbc6d('0x8a')](new Extension(_0x122e34,_0x1c4674,'6','Wait'));_0x1c4674+=0x1;_0x29220b['push'](new Extension(_0x122e34,_0x1c4674,'/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'));_0x1c4674=0x0;return _0x29220b;}exports[_0xbc6d('0x96')]=function(_0x30188d,_0x48a215,_0x51777){var _0x4fe40b;return db[_0xbc6d('0x77')][_0xbc6d('0x78')](function(_0x4cb5e8){return db[_0xbc6d('0x4e')][_0xbc6d('0x55')](_0x30188d['body'],{'transaction':_0x4cb5e8})[_0xbc6d('0x33')](function(_0x50ab71){_0x4fe40b=_0x50ab71[_0xbc6d('0x35')]({'plain':!![]});return db[_0xbc6d('0x97')][_0xbc6d('0x7d')](createExtensionsReciveFax(_0x4fe40b),{'transaction':_0x4cb5e8});});})[_0xbc6d('0x33')](function(){return _0x4fe40b;})[_0xbc6d('0x33')](respondWithResult(_0x48a215,null))[_0xbc6d('0x26')](handleError(_0x48a215,null));};exports[_0xbc6d('0x98')]=function(_0x2b562b,_0x86d8f1,_0x531a0c){var _0x139747;return db[_0xbc6d('0x77')]['transaction'](function(_0x5641c0){return db['FaxAccount'][_0xbc6d('0x32')](_0x2b562b['body'],{'where':{'id':_0x2b562b[_0xbc6d('0x56')]['id']},'transaction':_0x5641c0})[_0xbc6d('0x33')](function(_0x13b302){return db[_0xbc6d('0x97')][_0xbc6d('0x34')]({'where':{'FaxAccountId':_0x2b562b[_0xbc6d('0x56')]['id']},'transaction':_0x5641c0})[_0xbc6d('0x33')](function(_0x5df820){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0xbc6d('0x6e')](_0x2b562b[_0xbc6d('0x56')],[_0xbc6d('0x99'),_0xbc6d('0x9a'),'createdAt',_0xbc6d('0x9b'),_0xbc6d('0x9c'),_0xbc6d('0x9d')])),{'transaction':_0x5641c0});});});})[_0xbc6d('0x33')](function(){return db[_0xbc6d('0x4e')][_0xbc6d('0x9e')](_0x2b562b[_0xbc6d('0x56')]['id']);})[_0xbc6d('0x33')](respondWithResult(_0x86d8f1,null))[_0xbc6d('0x26')](handleError(_0x86d8f1,null));};exports[_0xbc6d('0x9f')]=function(_0x376857,_0x575ff8,_0x520faf){var _0x4e18bd={'raw':!![],'where':{}};var _0x273a06={};var _0x31b8ee={'count':0x0,'rows':[]};return db[_0xbc6d('0x4e')][_0xbc6d('0x69')]({'where':{'id':_0x376857['params']['id']}})[_0xbc6d('0x33')](handleEntityNotFound(_0x575ff8,null))[_0xbc6d('0x33')](function(_0x4dcab0){if(_0x4dcab0){_0x273a06[_0xbc6d('0x40')]=_[_0xbc6d('0x41')](db[_0xbc6d('0xa0')][_0xbc6d('0x3d')]);_0x273a06['query']=_[_0xbc6d('0x41')](_0x376857['query']);_0x273a06[_0xbc6d('0x43')]=_['intersection'](_0x273a06[_0xbc6d('0x40')],_0x273a06[_0xbc6d('0x42')]);_0x4e18bd['attributes']=_[_0xbc6d('0x45')](_0x273a06[_0xbc6d('0x40')],qs['fields'](_0x376857['query'][_0xbc6d('0x46')]));_0x4e18bd[_0xbc6d('0x44')]=_0x4e18bd[_0xbc6d('0x44')][_0xbc6d('0x47')]?_0x4e18bd[_0xbc6d('0x44')]:_0x273a06[_0xbc6d('0x40')];if(!_0x376857[_0xbc6d('0x42')][_0xbc6d('0x48')](_0xbc6d('0x49'))){_0x4e18bd['limit']=qs['limit'](_0x376857['query'][_0xbc6d('0x2c')]);_0x4e18bd[_0xbc6d('0x2a')]=qs[_0xbc6d('0x2a')](_0x376857[_0xbc6d('0x42')][_0xbc6d('0x2a')]);}_0x4e18bd[_0xbc6d('0x6a')]=qs[_0xbc6d('0x62')](_0x376857[_0xbc6d('0x42')][_0xbc6d('0x62')]);_0x4e18bd[_0xbc6d('0x4a')]=qs[_0xbc6d('0x43')](_[_0xbc6d('0x63')](_0x376857['query'],_0x273a06['filters']));_0x4e18bd[_0xbc6d('0x4a')][_0xbc6d('0x5f')]=_0x4dcab0['id'];if(_0x376857['query']['filter']){_0x4e18bd[_0xbc6d('0x4a')]=_[_0xbc6d('0x4c')](_0x4e18bd[_0xbc6d('0x4a')],{'$or':_[_0xbc6d('0x3c')](_0x4e18bd[_0xbc6d('0x44')],function(_0x3bb768){var _0x708bd5={};_0x708bd5[_0x3bb768]={'$like':'%'+_0x376857[_0xbc6d('0x42')][_0xbc6d('0x4b')]+'%'};return _0x708bd5;})});}if(_0x376857[_0xbc6d('0x42')][_0xbc6d('0xa1')]){var _0x81ec71=_0x376857[_0xbc6d('0x42')][_0xbc6d('0xa1')][_0xbc6d('0xa2')](',');var _0x344a63={};_0x344a63[_0x81ec71[0x0]]={'$gte':moment(_0x81ec71[0x1])['format'](_0xbc6d('0xa3'))};_0x4e18bd['where']=_['merge'](_0x4e18bd['where'],_0x344a63);}_0x4e18bd=_['merge']({},_0x4e18bd,_0x376857[_0xbc6d('0x4d')]);return db[_0xbc6d('0xa0')][_0xbc6d('0x2d')]({'where':_0x4e18bd[_0xbc6d('0x4a')]})[_0xbc6d('0x33')](function(_0x12f21f){_0x31b8ee[_0xbc6d('0x2d')]=_0x12f21f;if(_0x376857[_0xbc6d('0x42')][_0xbc6d('0x64')]){_0x4e18bd['include']=[{'all':!![]}];}return db[_0xbc6d('0xa0')][_0xbc6d('0x65')](_0x4e18bd);})[_0xbc6d('0x33')](function(_0x208baf){_0x31b8ee[_0xbc6d('0x4f')]=_0x208baf;return _0x31b8ee;});}})[_0xbc6d('0x33')](respondWithFilteredResult(_0x575ff8,_0x4e18bd))['catch'](handleError(_0x575ff8,null));};exports['send']=function(_0x2f9376,_0x454b72,_0x3e4001){var _0x2bb77f,_0x31fb3f={},_0x4c9492;if(_0x2f9376[_0xbc6d('0x56')]['to']){_0x4c9492=_0x2f9376[_0xbc6d('0x56')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x2f9376[_0xbc6d('0x51')]['id']},'include':[{'model':db[_0xbc6d('0xa4')],'as':_0xbc6d('0xa5'),'include':[{'model':db[_0xbc6d('0xa6')],'as':_0xbc6d('0xa7'),'where':{'fax':_0x4c9492},'limit':0x1,'order':[[_0xbc6d('0x9b'),_0xbc6d('0xa8')]]}]}]})[_0xbc6d('0x33')](handleEntityNotFound(_0x454b72,null))[_0xbc6d('0x33')](function(_0x361675){_0x2bb77f=_0x361675;if(_0x2f9376[_0xbc6d('0x56')][_0xbc6d('0xa9')]&&_0x2f9376[_0xbc6d('0x56')][_0xbc6d('0xa9')][_0xbc6d('0x47')]){for(var _0x230023=0x0;_0x230023<_0x2f9376[_0xbc6d('0x56')][_0xbc6d('0xa9')][_0xbc6d('0x47')];_0x230023+=0x1){_0x2f9376[_0xbc6d('0x56')]['attachments'][_0x230023]={'filename':_0x2f9376[_0xbc6d('0x56')]['attachments'][_0x230023][_0xbc6d('0x38')],'id':_0x2f9376[_0xbc6d('0x56')]['attachments'][_0x230023]['id'],'path':path[_0xbc6d('0xaa')](config[_0xbc6d('0xab')],_0xbc6d('0xac'),_0x2f9376[_0xbc6d('0x56')]['attachments'][_0x230023][_0xbc6d('0xad')])};}}return respondWithRpcPromise(_0xbc6d('0xae'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x2f9376[_0xbc6d('0x51')]['id'])?undefined:_0x2f9376['params']['id'],'path':_['isNil'](_0x2f9376[_0xbc6d('0x56')]['attachments'][0x0][_0xbc6d('0x5')])?undefined:_0x2f9376[_0xbc6d('0x56')][_0xbc6d('0xa9')][0x0][_0xbc6d('0x5')],'fax':_[_0xbc6d('0xaf')](_0x2f9376['body']['to'][0x0])?undefined:_0x2f9376[_0xbc6d('0x56')]['to'][0x0]},client9002);})[_0xbc6d('0x33')](function(){if(_0x2bb77f){if(_['isNil'](_0x2f9376[_0xbc6d('0x56')][_0xbc6d('0xb0')])){_0x2f9376[_0xbc6d('0x56')][_0xbc6d('0xb0')]=util[_0xbc6d('0xb1')]('\x22%s\x22\x20<%s>',_0x2bb77f[_0xbc6d('0x38')],_0x2bb77f['fax']);}if(_0x2bb77f[_0xbc6d('0xa5')]){if(_0x2bb77f[_0xbc6d('0xa5')][_0xbc6d('0xa7')]['length']){return _0x2bb77f[_0xbc6d('0xa5')][_0xbc6d('0xa7')][0x0];}else{return db[_0xbc6d('0xa6')][_0xbc6d('0x55')](_[_0xbc6d('0x15')](_0x2f9376[_0xbc6d('0x56')],{'firstName':_0x2f9376['body']['to'][0x0],'phone':_0x2f9376[_0xbc6d('0x56')]['to'][0x0],'fax':_0x2f9376['body']['to'][0x0],'ListId':_0x2bb77f[_0xbc6d('0x9d')]}));}}else{throw new Error(_0xbc6d('0xb2'));}}else{throw new Error(_0xbc6d('0xb3'));}})[_0xbc6d('0x33')](function(_0x4aa84c){if(_0x4aa84c){return db['FaxInteraction'][_0xbc6d('0x54')]({'where':{'ContactId':_0x4aa84c['id'],'closed':![],'FaxAccountId':_0x2bb77f['id']}})[_0xbc6d('0x33')](function(_0x530b2d){if(_0x530b2d){return[_0x530b2d,![]];}return db[_0xbc6d('0x70')][_0xbc6d('0x55')]({'UserId':_0x2f9376[_0xbc6d('0x57')]['id'],'ContactId':_0x4aa84c['id'],'FaxAccountId':_0x2bb77f['id'],'fax':_0x2f9376[_0xbc6d('0x56')]['to'][0x0],'firstMsgDirection':_0xbc6d('0xb4'),'Messages':[_[_0xbc6d('0x4c')](_0x2f9376['body'],{'read':![],'body':_0x2f9376[_0xbc6d('0x56')][_0xbc6d('0xa9')][0x0]['filename'],'FaxAccountId':_0x2bb77f['id'],'UserId':_0x2f9376[_0xbc6d('0x57')]['id'],'ContactId':_0x4aa84c['id'],'AttachmentId':_0x2f9376[_0xbc6d('0x56')][_0xbc6d('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0xbc6d('0xa0')],'as':_0xbc6d('0xb5')}]})[_0xbc6d('0x33')](function(_0x2c28b){return[_0x2c28b,!![]];});});}else{throw new Error(_0xbc6d('0xb6'));}})[_0xbc6d('0xb7')](function(_0x562127,_0x564ae3){if(_0x564ae3){return _0x562127;}return db[_0xbc6d('0xa0')][_0xbc6d('0x55')]({'direction':_0xbc6d('0xb4'),'read':![],'body':_0x2f9376[_0xbc6d('0x56')][_0xbc6d('0xa9')][0x0]['filename'],'FaxAccountId':_0x2bb77f['id'],'FaxInteractionId':_0x562127['id'],'UserId':_0x2f9376['user']['id'],'ContactId':_0x562127[_0xbc6d('0xb8')],'AttachmentId':_0x2f9376['body'][_0xbc6d('0xa9')][0x0]['id']})[_0xbc6d('0x33')](function(_0x676066){_0x562127[_0xbc6d('0xb9')][_0xbc6d('0xb5')]=[];_0x562127[_0xbc6d('0xb9')][_0xbc6d('0xb5')][_0xbc6d('0x8a')](_0x676066[_0xbc6d('0xb9')]);return _0x562127;});})[_0xbc6d('0x33')](function(_0x5d5051){respondWithRpcPromise(_0xbc6d('0xba'),_0xbc6d('0xba'),{'FaxAccountId':_['isNil'](_0x2f9376['params']['id'])?undefined:_0x2f9376[_0xbc6d('0x51')]['id'],'path':_['isNil'](_0x2f9376[_0xbc6d('0x56')][_0xbc6d('0xa9')][0x0][_0xbc6d('0x5')])?undefined:_0x2f9376[_0xbc6d('0x56')][_0xbc6d('0xa9')][0x0][_0xbc6d('0x5')],'fax':_[_0xbc6d('0xaf')](_0x2f9376[_0xbc6d('0x56')]['to'][0x0])?undefined:_0x2f9376[_0xbc6d('0x56')]['to'][0x0],'AttachmentId':_0x2f9376['body']['attachments'][0x0]['id']},client9002)[_0xbc6d('0x33')](function(_0x572544){logger[_0xbc6d('0x1d')](_0xbc6d('0xbb'),_0x572544);})['catch'](function(_0x48d8c4){logger[_0xbc6d('0x1d')](_0xbc6d('0xbb'),_0x48d8c4);});return _0x5d5051;})[_0xbc6d('0x33')](respondWithResult(_0x454b72,null))[_0xbc6d('0x26')](handleError(_0x454b72,null));};exports[_0xbc6d('0xbc')]=function(_0x28eb6e,_0x30d9db,_0x33e399){return db[_0xbc6d('0x4e')][_0xbc6d('0x54')]({'where':{'id':_0x28eb6e[_0xbc6d('0x51')]['id']}})['then'](handleEntityNotFound(_0x30d9db,null))[_0xbc6d('0x33')](function(_0x51ccd7){if(_0x51ccd7){return _0x51ccd7['addAgents'](_0x28eb6e['body'][_0xbc6d('0x6c')],_[_0xbc6d('0x6e')](_0x28eb6e['body'],[_0xbc6d('0x6c'),'id'])||{})['spread'](function(_0x2585e2){for(var _0x9cb400=0x0;_0x9cb400<_0x28eb6e[_0xbc6d('0x56')][_0xbc6d('0x6c')][_0xbc6d('0x47')];_0x9cb400+=0x1){socket['emit'](_0xbc6d('0xbd'),{'UserId':Number(_0x28eb6e['body']['ids'][_0x9cb400]),'FaxAccountId':Number(_0x28eb6e['params']['id'])});}return _0x2585e2;});}})[_0xbc6d('0x33')](respondWithResult(_0x30d9db,null))[_0xbc6d('0x26')](handleError(_0x30d9db,null));};exports['removeAgents']=function(_0x43d260,_0x9c8f2f,_0x4c1706){return db['FaxAccount']['find']({'where':{'id':_0x43d260['params']['id']}})[_0xbc6d('0x33')](handleEntityNotFound(_0x9c8f2f,null))[_0xbc6d('0x33')](function(_0xf9c4fa){if(_0xf9c4fa){return _0xf9c4fa['removeAgents'](_0x43d260['query'][_0xbc6d('0x6c')])[_0xbc6d('0x33')](function(){if(_[_0xbc6d('0xbe')](_0x43d260[_0xbc6d('0x42')][_0xbc6d('0x6c')])){for(var _0x2e5295=0x0;_0x2e5295<_0x43d260[_0xbc6d('0x42')][_0xbc6d('0x6c')][_0xbc6d('0x47')];_0x2e5295+=0x1){socket[_0xbc6d('0xbf')](_0xbc6d('0xc0'),{'UserId':Number(_0x43d260[_0xbc6d('0x42')]['ids'][_0x2e5295]),'FaxAccountId':Number(_0x43d260[_0xbc6d('0x51')]['id'])});}}else{socket['emit'](_0xbc6d('0xc0'),{'UserId':Number(_0x43d260[_0xbc6d('0x42')][_0xbc6d('0x6c')]),'FaxAccountId':Number(_0x43d260[_0xbc6d('0x51')]['id'])});}});}})[_0xbc6d('0x33')](respondWithStatusCode(_0x9c8f2f,null))[_0xbc6d('0x26')](handleError(_0x9c8f2f,null));};exports[_0xbc6d('0xc1')]=function(_0x72df36,_0x199737,_0x349b22){var _0x377b98={};var _0x197f8f={};var _0x33b16f;var _0x2cd24a;return db[_0xbc6d('0x4e')][_0xbc6d('0x69')]({'where':{'id':_0x72df36[_0xbc6d('0x51')]['id']}})['then'](handleEntityNotFound(_0x199737,null))[_0xbc6d('0x33')](function(_0x543619){if(_0x543619){_0x33b16f=_0x543619;_0x197f8f['model']=_[_0xbc6d('0x41')](db[_0xbc6d('0x71')][_0xbc6d('0x3d')]);_0x197f8f[_0xbc6d('0x42')]=_['keys'](_0x72df36[_0xbc6d('0x42')]);_0x197f8f[_0xbc6d('0x43')]=_[_0xbc6d('0x45')](_0x197f8f[_0xbc6d('0x40')],_0x197f8f[_0xbc6d('0x42')]);_0x377b98['attributes']=_[_0xbc6d('0x45')](_0x197f8f[_0xbc6d('0x40')],qs[_0xbc6d('0x46')](_0x72df36['query']['fields']));_0x377b98[_0xbc6d('0x44')]=_0x377b98['attributes'][_0xbc6d('0x47')]?_0x377b98['attributes']:_0x197f8f[_0xbc6d('0x40')];_0x377b98[_0xbc6d('0x6a')]=qs[_0xbc6d('0x62')](_0x72df36[_0xbc6d('0x42')]['sort']);_0x377b98[_0xbc6d('0x4a')]=qs[_0xbc6d('0x43')](_[_0xbc6d('0x63')](_0x72df36[_0xbc6d('0x42')],_0x197f8f[_0xbc6d('0x43')]));if(_0x72df36[_0xbc6d('0x42')][_0xbc6d('0x4b')]){_0x377b98['where']=_[_0xbc6d('0x4c')](_0x377b98[_0xbc6d('0x4a')],{'$or':_[_0xbc6d('0x3c')](_0x377b98[_0xbc6d('0x44')],function(_0x144f2c){var _0x4e3c39={};_0x4e3c39[_0x144f2c]={'$like':'%'+_0x72df36[_0xbc6d('0x42')]['filter']+'%'};return _0x4e3c39;})});}_0x377b98=_[_0xbc6d('0x4c')]({},_0x377b98,_0x72df36[_0xbc6d('0x4d')]);return _0x33b16f['getAgents'](_0x377b98);}})['then'](function(_0x3fe81c){if(_0x3fe81c){_0x2cd24a=_0x3fe81c['length'];if(!_0x72df36['query'][_0xbc6d('0x48')](_0xbc6d('0x49'))){_0x377b98[_0xbc6d('0x2c')]=qs[_0xbc6d('0x2c')](_0x72df36[_0xbc6d('0x42')][_0xbc6d('0x2c')]);_0x377b98[_0xbc6d('0x2a')]=qs[_0xbc6d('0x2a')](_0x72df36['query'][_0xbc6d('0x2a')]);}return _0x33b16f[_0xbc6d('0xc1')](_0x377b98);}})[_0xbc6d('0x33')](function(_0x299a12){if(_0x299a12){return _0x299a12?{'count':_0x2cd24a,'rows':_0x299a12}:null;}})[_0xbc6d('0x33')](respondWithResult(_0x199737,null))[_0xbc6d('0x26')](handleError(_0x199737,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index ac93c7c..2fdce4f 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 _0x2186=['hook','exports','../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x29aa28,_0x6ddead){var _0x2fa62a=function(_0x11f010){while(--_0x11f010){_0x29aa28['push'](_0x29aa28['shift']());}};_0x2fa62a(++_0x6ddead);}(_0x2186,0x18e));var _0x6218=function(_0x3b698a,_0x1b29ab){_0x3b698a=_0x3b698a-0x0;var _0x9bde74=_0x2186[_0x3b698a];return _0x9bde74;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x6218('0x0'))['db'][_0x6218('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6218('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6218('0x3'),'afterDestroy':_0x6218('0x4')};function emitEvent(_0x445923){return function(_0x5bdea7,_0x1c58b9,_0x4deecb){FaxAccountEvents['emit'](_0x445923+':'+_0x5bdea7['id'],_0x5bdea7);FaxAccountEvents[_0x6218('0x5')](_0x445923,_0x5bdea7);_0x4deecb(null);};}for(var e in events){if(events[_0x6218('0x6')](e)){var event=events[e];FaxAccount[_0x6218('0x7')](e,emitEvent(event));}}module[_0x6218('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x7c46=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x5ab27f,_0x21a462){var _0x23826c=function(_0x4292ac){while(--_0x4292ac){_0x5ab27f['push'](_0x5ab27f['shift']());}};_0x23826c(++_0x21a462);}(_0x7c46,0x100));var _0x67c4=function(_0x3fa8b2,_0x2d49a0){_0x3fa8b2=_0x3fa8b2-0x0;var _0x5863ba=_0x7c46[_0x3fa8b2];return _0x5863ba;};'use strict';var EventEmitter=require(_0x67c4('0x0'));var FaxAccount=require(_0x67c4('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x67c4('0x2')](0x0);var events={'afterCreate':_0x67c4('0x3'),'afterUpdate':_0x67c4('0x4'),'afterDestroy':_0x67c4('0x5')};function emitEvent(_0x301071){return function(_0x3a9bee,_0x207acf,_0x353d67){FaxAccountEvents['emit'](_0x301071+':'+_0x3a9bee['id'],_0x3a9bee);FaxAccountEvents[_0x67c4('0x6')](_0x301071,_0x3a9bee);_0x353d67(null);};}for(var e in events){if(events[_0x67c4('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x67c4('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 1747967..8f642b8 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 _0x6eb6=['request-promise','path','../../config/environment','./faxAccount.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird'];(function(_0x20cf47,_0x460a48){var _0x1687e6=function(_0x45d335){while(--_0x45d335){_0x20cf47['push'](_0x20cf47['shift']());}};_0x1687e6(++_0x460a48);}(_0x6eb6,0x10e));var _0x66eb=function(_0x4244ff,_0x31d180){_0x4244ff=_0x4244ff-0x0;var _0x487ccc=_0x6eb6[_0x4244ff];return _0x487ccc;};'use strict';var _=require(_0x66eb('0x0'));var util=require('util');var logger=require(_0x66eb('0x1'))(_0x66eb('0x2'));var moment=require(_0x66eb('0x3'));var BPromise=require(_0x66eb('0x4'));var rp=require(_0x66eb('0x5'));var fs=require('fs');var path=require(_0x66eb('0x6'));var rimraf=require('rimraf');var config=require(_0x66eb('0x7'));var attributes=require(_0x66eb('0x8'));module[_0x66eb('0x9')]=function(_0x462b48,_0x510d78){return _0x462b48[_0x66eb('0xa')]('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x64f5=['fax_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x45067a,_0x48f3f8){var _0x29e7f9=function(_0x29f968){while(--_0x29f968){_0x45067a['push'](_0x45067a['shift']());}};_0x29e7f9(++_0x48f3f8);}(_0x64f5,0x1c8));var _0x564f=function(_0xa8b01,_0x1ec0b3){_0xa8b01=_0xa8b01-0x0;var _0x9803c=_0x64f5[_0xa8b01];return _0x9803c;};'use strict';var _=require(_0x564f('0x0'));var util=require(_0x564f('0x1'));var logger=require('../../config/logger')(_0x564f('0x2'));var moment=require(_0x564f('0x3'));var BPromise=require(_0x564f('0x4'));var rp=require(_0x564f('0x5'));var fs=require('fs');var path=require(_0x564f('0x6'));var rimraf=require(_0x564f('0x7'));var config=require('../../config/environment');var attributes=require(_0x564f('0x8'));module[_0x564f('0x9')]=function(_0x5f0bec,_0x518251){return _0x5f0bec[_0x564f('0xa')](_0x564f('0xb'),attributes,{'tableName':_0x564f('0xc'),'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 7b157c8..c4f91e4 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 _0x44f3=['interaction','ContactId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','map','include','model','catch','body','then','Sequelize','createdAt','updatedAt','keys','CompanyId','ValidationError','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','List','Contacts','FaxApplication','Applications','applications','orderBy','priority','length','defaults','ListId','CmContact','create','contact','fax','FaxInteraction','find','Contact\x20not\x20found','spread','get','autoclose','push','close','*,*,*,*','created'];(function(_0x1c4318,_0x2c9e67){var _0x58b562=function(_0x517f90){while(--_0x517f90){_0x1c4318['push'](_0x1c4318['shift']());}};_0x58b562(++_0x2c9e67);}(_0x44f3,0x109));var _0x344f=function(_0x699ab0,_0x292661){_0x699ab0=_0x699ab0-0x0;var _0x9558bb=_0x44f3[_0x699ab0];return _0x9558bb;};'use strict';var _=require(_0x344f('0x0'));var util=require(_0x344f('0x1'));var moment=require(_0x344f('0x2'));var BPromise=require('bluebird');var rs=require(_0x344f('0x3'));var fs=require('fs');var Redis=require(_0x344f('0x4'));var db=require(_0x344f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x344f('0x6'))(_0x344f('0x7'));var config=require(_0x344f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x344f('0x9')][_0x344f('0xa')]({'port':0x232c});config[_0x344f('0xb')]=_['defaults'](config['redis'],{'host':_0x344f('0xc'),'port':0x18eb});var socket=require(_0x344f('0xd'))(new Redis(config[_0x344f('0xb')]));require(_0x344f('0xe'))[_0x344f('0xf')](socket);function respondWithRpcPromise(_0x254466,_0x15f54f,_0x45b8ae){return new BPromise(function(_0x1e6c7f,_0x1a4aa3){return client[_0x344f('0x10')](_0x254466,_0x45b8ae)['then'](function(_0x570f90){logger['info'](_0x344f('0x11'),_0x15f54f,_0x344f('0x12'));logger[_0x344f('0x13')](_0x344f('0x14'),_0x15f54f,'request\x20sent',JSON['stringify'](_0x570f90));if(_0x570f90[_0x344f('0x15')]){if(_0x570f90[_0x344f('0x15')][_0x344f('0x16')]===0x1f4){logger['error'](_0x344f('0x11'),_0x15f54f,_0x570f90[_0x344f('0x15')]['message']);return _0x1a4aa3(_0x570f90[_0x344f('0x15')]['message']);}logger['error'](_0x344f('0x11'),_0x15f54f,_0x570f90[_0x344f('0x15')][_0x344f('0x17')]);return _0x1e6c7f(_0x570f90[_0x344f('0x15')][_0x344f('0x17')]);}else{logger[_0x344f('0x18')](_0x344f('0x11'),_0x15f54f,'request\x20sent');_0x1e6c7f(_0x570f90['result']['message']);}})['catch'](function(_0x3936af){logger['error'](_0x344f('0x11'),_0x15f54f,_0x3936af);_0x1a4aa3(_0x3936af);});});}exports[_0x344f('0x19')]=function(_0x28779a){var _0x232fcb=this;return new Promise(function(_0x24edfe,_0x3e12e2){return db[_0x344f('0x1a')][_0x344f('0x1b')]({'raw':_0x28779a[_0x344f('0x1c')]?_0x28779a[_0x344f('0x1c')][_0x344f('0x1d')]===undefined?!![]:![]:!![],'where':_0x28779a[_0x344f('0x1c')]?_0x28779a['options'][_0x344f('0x1e')]||null:null,'attributes':_0x28779a[_0x344f('0x1c')]?_0x28779a[_0x344f('0x1c')][_0x344f('0x1f')]||null:null,'limit':_0x28779a['options']?_0x28779a[_0x344f('0x1c')]['limit']||null:null,'include':_0x28779a[_0x344f('0x1c')]?_0x28779a['options']['include']?_[_0x344f('0x20')](_0x28779a['options'][_0x344f('0x21')],function(_0x50bf6f){return{'model':db[_0x50bf6f[_0x344f('0x22')]],'as':_0x50bf6f['as'],'attributes':_0x50bf6f['attributes'],'include':_0x50bf6f[_0x344f('0x21')]?_[_0x344f('0x20')](_0x50bf6f[_0x344f('0x21')],function(_0x4b9da9){return{'model':db[_0x4b9da9[_0x344f('0x22')]],'as':_0x4b9da9['as'],'attributes':_0x4b9da9['attributes'],'include':_0x4b9da9[_0x344f('0x21')]?_[_0x344f('0x20')](_0x4b9da9[_0x344f('0x21')],function(_0xca753c){return{'model':db[_0xca753c[_0x344f('0x22')]],'as':_0xca753c['as'],'attributes':_0xca753c[_0x344f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57edf0){logger[_0x344f('0x18')](_0x344f('0x19'),_0x28779a);logger[_0x344f('0x13')](_0x344f('0x19'),_0x28779a,JSON['stringify'](_0x57edf0));_0x24edfe(_0x57edf0);})[_0x344f('0x23')](function(_0x1e1ada){logger[_0x344f('0x15')](_0x344f('0x19'),_0x1e1ada[_0x344f('0x17')],_0x28779a);_0x3e12e2(_0x232fcb[_0x344f('0x15')](0x1f4,_0x1e1ada[_0x344f('0x17')]));});});};exports['NotifyFaxAccount']=function(_0x1b1385,_0x5393d2,_0x5505f6){var _0xf1b2c0=this;return new Promise(function(_0x736956,_0x29b2cc){var _0x31bf70={'body':_0x1b1385[_0x344f('0x24')],'channel':'fax'};var _0x5b9125=[];var _0x30f66e=[];var _0x29a966={};return db['CmContact']['describe']()[_0x344f('0x25')](function(_0xfd8f13){if(!_0xfd8f13){throw new db[(_0x344f('0x26'))]['ValidationError']('no\x20available\x20attributes');}_0x5b9125=_['difference'](_['keys'](_0xfd8f13),[_0x344f('0x27'),_0x344f('0x28')]);_0x30f66e=_['difference'](_[_0x344f('0x29')](_0xfd8f13),['createdAt','updatedAt',_0x344f('0x2a'),'ListId']);if(_0x1b1385[_0x344f('0x24')]['id']){delete _0x1b1385[_0x344f('0x24')]['id'];}if(_['isNil'](_0x1b1385[_0x344f('0x24')]['from'])){throw new db['Sequelize'][(_0x344f('0x2b'))]('from\x20is\x20mandatory');}if(_[_0x344f('0x2c')](_0x1b1385[_0x344f('0x24')][_0x344f('0x24')])||_0x1b1385[_0x344f('0x24')][_0x344f('0x24')]===''){throw new db['Sequelize'][(_0x344f('0x2b'))](_0x344f('0x2d'));}if(_[_0x344f('0x2c')](_0x1b1385[_0x344f('0x24')]['mapKey'])){throw new db[(_0x344f('0x26'))][(_0x344f('0x2b'))](_0x344f('0x2e')+_0x30f66e);}if(!_['includes'](_0x30f66e,_0x1b1385['body'][_0x344f('0x2f')])){throw new db[(_0x344f('0x26'))]['ValidationError'](_0x344f('0x30')+_0x30f66e);}_0x29a966[_0x1b1385[_0x344f('0x24')][_0x344f('0x2f')]]=_0x1b1385[_0x344f('0x24')][_0x344f('0x31')];})[_0x344f('0x25')](function(){return db[_0x344f('0x1a')]['find']({'where':{'id':_0x1b1385[_0x344f('0x32')]['id']},'include':[{'model':db['CmList'],'as':_0x344f('0x33'),'include':[{'model':db['CmContact'],'as':_0x344f('0x34'),'where':_0x29a966,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x344f('0x35')],'as':_0x344f('0x36')}]});})[_0x344f('0x25')](function(_0x35b4f6){if(_0x35b4f6&&_0x35b4f6[_0x344f('0x33')]){var _0x132e6f=_0x35b4f6['get']({'plain':!![]});_0x31bf70['account']=_0x132e6f;_0x31bf70[_0x344f('0x37')]=_0x132e6f[_0x344f('0x36')];_0x31bf70['list']=_0x132e6f[_0x344f('0x33')];_0x31bf70['applications']=_[_0x344f('0x38')](_0x31bf70['applications'],[_0x344f('0x39')],['asc']);if(_0x31bf70[_0x344f('0x32')][_0x344f('0x36')]){delete _0x31bf70['account']['Applications'];}if(_0x31bf70['account'][_0x344f('0x33')]&&_0x31bf70[_0x344f('0x32')][_0x344f('0x33')][_0x344f('0x34')][_0x344f('0x3a')]){return _0x31bf70['account'][_0x344f('0x33')]['Contacts'][0x0];}var _0x33ed3e=_[_0x344f('0x3b')](_0x1b1385[_0x344f('0x24')],{'firstName':_0x1b1385['body'][_0x344f('0x31')],'ListId':_0x132e6f[_0x344f('0x3c')]});_0x33ed3e[_0x1b1385[_0x344f('0x24')][_0x344f('0x2f')]]=_0x1b1385[_0x344f('0x24')]['from'];return db[_0x344f('0x3d')][_0x344f('0x3e')](_0x33ed3e,{'fields':_0x5b9125,'raw':!![]});}})[_0x344f('0x25')](function(_0x21e394){_0x31bf70[_0x344f('0x3f')]=_0x21e394;if(_0x21e394){var _0x38c77f={'ContactId':_0x21e394['id'],'FaxAccountId':_0x1b1385[_0x344f('0x32')]['id'],'fax':_0x21e394[_0x344f('0x40')]};return db[_0x344f('0x41')][_0x344f('0x42')]({'where':{'ContactId':_0x21e394['id'],'closed':![],'FaxAccountId':_0x1b1385[_0x344f('0x32')]['id']}})[_0x344f('0x25')](function(_0x5cca3b){if(_0x5cca3b){return[_0x5cca3b,![]];}return db['FaxInteraction'][_0x344f('0x3e')](_0x38c77f)['then'](function(_0x43fbfa){return[_0x43fbfa,!![]];});});}else{throw new Error(_0x344f('0x43'));}})[_0x344f('0x44')](function(_0x2038b2,_0x2a80e8){var _0x1aea4d=_0x2038b2[_0x344f('0x45')]({'plain':!![]});if(_0x2a80e8){if(_0x31bf70['account'][_0x344f('0x46')]){_0x31bf70[_0x344f('0x37')][_0x344f('0x47')]({'id':0x0,'priority':_0x31bf70['applications'][_0x344f('0x3a')]+0x1,'app':_0x344f('0x48'),'appdata':'unmanaged','interval':_0x344f('0x49')});}_0x1aea4d[_0x344f('0x4a')]=!![];}else{_0x1aea4d[_0x344f('0x4a')]=![];}_0x31bf70[_0x344f('0x4b')]=_0x1aea4d;return db['FaxMessage'][_0x344f('0x3e')]({'body':_0x1b1385['body']['body'],'FaxAccountId':_0x1b1385[_0x344f('0x32')]['id'],'FaxInteractionId':_0x2038b2['id'],'direction':'in','ContactId':_0x2038b2[_0x344f('0x4c')],'AttachmentId':_0x1b1385['body']['AttachmentId']});})[_0x344f('0x25')](function(_0x184503){_0x31bf70[_0x344f('0x17')]=_0x184503;if(_0x31bf70['interaction'][_0x344f('0x4d')]){return db[_0x344f('0x4e')]['find']({'attributes':['id',_0x344f('0x4f')],'where':{'id':_0x31bf70['interaction'][_0x344f('0x4d')]}})[_0x344f('0x25')](function(_0x103454){if(_0x103454){_0x31bf70[_0x344f('0x37')][_0x344f('0x50')]({'id':0x0,'priority':0x0,'app':_0x344f('0x51'),'appdata':_0x103454[_0x344f('0x4f')]+','+(_0x31bf70[_0x344f('0x32')][_0x344f('0x52')]||0xa),'interval':_0x344f('0x49')});}return respondWithRpcPromise(_0x344f('0x53'),_0x344f('0x54'),_0x31bf70);});}return respondWithRpcPromise('Start',_0x344f('0x54'),_0x31bf70);})['then'](function(_0x4d2313){_0x736956(_0x4d2313);})[_0x344f('0x23')](function(_0x5f4304){_0x29b2cc(_0xf1b2c0[_0x344f('0x15')](0x1f4,_0x5f4304[_0x344f('0x17')]));});});}; \ No newline at end of file +var _0x2a23=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','FaxAccount','find','account','CmList','List','DESC','FaxApplication','Applications','applications','list','orderBy','priority','asc','Contacts','length','create','FaxInteraction','Contact\x20not\x20found','spread','get','push','close','unmanaged','*,*,*,*','interaction','FaxMessage','AttachmentId','UserId','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetFaxAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','debug','NotifyFaxAccount','body','CmContact','describe','ValidationError','no\x20available\x20attributes','keys','createdAt','difference','updatedAt','isNil','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2a23,0x177));var _0x32a2=function(_0x377663,_0x33eebe){_0x377663=_0x377663-0x0;var _0x27698c=_0x2a23[_0x377663];return _0x27698c;};'use strict';var _=require(_0x32a2('0x0'));var util=require(_0x32a2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x32a2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32a2('0x3'))['db'];var utils=require(_0x32a2('0x4'));var logger=require(_0x32a2('0x5'))(_0x32a2('0x6'));var config=require(_0x32a2('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x32a2('0x8')]({'port':0x232c});config[_0x32a2('0x9')]=_['defaults'](config[_0x32a2('0x9')],{'host':_0x32a2('0xa'),'port':0x18eb});var socket=require(_0x32a2('0xb'))(new Redis(config[_0x32a2('0x9')]));require(_0x32a2('0xc'))[_0x32a2('0xd')](socket);function respondWithRpcPromise(_0xb9d891,_0x5464b4,_0x507042){return new BPromise(function(_0x423b7a,_0x39fe2c){return client['request'](_0xb9d891,_0x507042)['then'](function(_0x277168){logger[_0x32a2('0xe')](_0x32a2('0xf'),_0x5464b4,_0x32a2('0x10'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5464b4,_0x32a2('0x10'),JSON[_0x32a2('0x11')](_0x277168));if(_0x277168[_0x32a2('0x12')]){if(_0x277168[_0x32a2('0x12')][_0x32a2('0x13')]===0x1f4){logger[_0x32a2('0x12')](_0x32a2('0xf'),_0x5464b4,_0x277168[_0x32a2('0x12')][_0x32a2('0x14')]);return _0x39fe2c(_0x277168[_0x32a2('0x12')][_0x32a2('0x14')]);}logger[_0x32a2('0x12')](_0x32a2('0xf'),_0x5464b4,_0x277168[_0x32a2('0x12')][_0x32a2('0x14')]);return _0x423b7a(_0x277168[_0x32a2('0x12')][_0x32a2('0x14')]);}else{logger[_0x32a2('0xe')](_0x32a2('0xf'),_0x5464b4,_0x32a2('0x10'));_0x423b7a(_0x277168[_0x32a2('0x15')]['message']);}})['catch'](function(_0xd8d562){logger[_0x32a2('0x12')]('FaxAccount,\x20%s,\x20%s',_0x5464b4,_0xd8d562);_0x39fe2c(_0xd8d562);});});}exports[_0x32a2('0x16')]=function(_0x38502b){var _0x5b2b03=this;return new Promise(function(_0x3f47ef,_0x19e8d3){return db['FaxAccount'][_0x32a2('0x17')]({'raw':_0x38502b[_0x32a2('0x18')]?_0x38502b[_0x32a2('0x18')][_0x32a2('0x19')]===undefined?!![]:![]:!![],'where':_0x38502b[_0x32a2('0x18')]?_0x38502b[_0x32a2('0x18')][_0x32a2('0x1a')]||null:null,'attributes':_0x38502b[_0x32a2('0x18')]?_0x38502b[_0x32a2('0x18')][_0x32a2('0x1b')]||null:null,'limit':_0x38502b[_0x32a2('0x18')]?_0x38502b[_0x32a2('0x18')][_0x32a2('0x1c')]||null:null,'include':_0x38502b[_0x32a2('0x18')]?_0x38502b['options']['include']?_['map'](_0x38502b[_0x32a2('0x18')][_0x32a2('0x1d')],function(_0x51d4b1){return{'model':db[_0x51d4b1[_0x32a2('0x1e')]],'as':_0x51d4b1['as'],'attributes':_0x51d4b1['attributes'],'include':_0x51d4b1[_0x32a2('0x1d')]?_[_0x32a2('0x1f')](_0x51d4b1[_0x32a2('0x1d')],function(_0x5db720){return{'model':db[_0x5db720[_0x32a2('0x1e')]],'as':_0x5db720['as'],'attributes':_0x5db720[_0x32a2('0x1b')],'include':_0x5db720[_0x32a2('0x1d')]?_[_0x32a2('0x1f')](_0x5db720['include'],function(_0x446d0b){return{'model':db[_0x446d0b[_0x32a2('0x1e')]],'as':_0x446d0b['as'],'attributes':_0x446d0b[_0x32a2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x32a2('0x20')](function(_0x4f4aac){logger[_0x32a2('0xe')](_0x32a2('0x16'),_0x38502b);logger[_0x32a2('0x21')](_0x32a2('0x16'),_0x38502b,JSON[_0x32a2('0x11')](_0x4f4aac));_0x3f47ef(_0x4f4aac);})['catch'](function(_0x3f67a1){logger['error'](_0x32a2('0x16'),_0x3f67a1[_0x32a2('0x14')],_0x38502b);_0x19e8d3(_0x5b2b03[_0x32a2('0x12')](0x1f4,_0x3f67a1[_0x32a2('0x14')]));});});};exports[_0x32a2('0x22')]=function(_0x2a0569,_0x46f8b7,_0x43f6be){var _0x1cd602=this;return new Promise(function(_0x1e43ea,_0x32f971){var _0x3efc4c={'body':_0x2a0569[_0x32a2('0x23')],'channel':'fax'};var _0xcce27f=[];var _0x156609=[];var _0x4a65f6={};return db[_0x32a2('0x24')][_0x32a2('0x25')]()['then'](function(_0x587f8e){if(!_0x587f8e){throw new db['Sequelize'][(_0x32a2('0x26'))](_0x32a2('0x27'));}_0xcce27f=_['difference'](_[_0x32a2('0x28')](_0x587f8e),[_0x32a2('0x29'),'updatedAt']);_0x156609=_[_0x32a2('0x2a')](_[_0x32a2('0x28')](_0x587f8e),[_0x32a2('0x29'),_0x32a2('0x2b'),'CompanyId','ListId']);if(_0x2a0569[_0x32a2('0x23')]['id']){delete _0x2a0569[_0x32a2('0x23')]['id'];}if(_[_0x32a2('0x2c')](_0x2a0569[_0x32a2('0x23')]['from'])){throw new db['Sequelize']['ValidationError'](_0x32a2('0x2d'));}if(_[_0x32a2('0x2c')](_0x2a0569[_0x32a2('0x23')]['body'])||_0x2a0569[_0x32a2('0x23')][_0x32a2('0x23')]===''){throw new db[(_0x32a2('0x2e'))][(_0x32a2('0x26'))](_0x32a2('0x2f'));}if(_[_0x32a2('0x2c')](_0x2a0569[_0x32a2('0x23')][_0x32a2('0x30')])){throw new db[(_0x32a2('0x2e'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x156609);}if(!_[_0x32a2('0x31')](_0x156609,_0x2a0569[_0x32a2('0x23')]['mapKey'])){throw new db['Sequelize'][(_0x32a2('0x26'))](_0x32a2('0x32')+_0x156609);}_0x4a65f6[_0x2a0569[_0x32a2('0x23')][_0x32a2('0x30')]]=_0x2a0569[_0x32a2('0x23')][_0x32a2('0x33')];})[_0x32a2('0x20')](function(){return db[_0x32a2('0x34')][_0x32a2('0x35')]({'where':{'id':_0x2a0569[_0x32a2('0x36')]['id']},'include':[{'model':db[_0x32a2('0x37')],'as':_0x32a2('0x38'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4a65f6,'limit':0x1,'order':[[_0x32a2('0x2b'),_0x32a2('0x39')]]}]},{'model':db[_0x32a2('0x3a')],'as':_0x32a2('0x3b')}]});})['then'](function(_0x244fd0){if(_0x244fd0&&_0x244fd0[_0x32a2('0x38')]){var _0x51a8b9=_0x244fd0['get']({'plain':!![]});_0x3efc4c[_0x32a2('0x36')]=_0x51a8b9;_0x3efc4c[_0x32a2('0x3c')]=_0x51a8b9['Applications'];_0x3efc4c[_0x32a2('0x3d')]=_0x51a8b9[_0x32a2('0x38')];_0x3efc4c[_0x32a2('0x3c')]=_[_0x32a2('0x3e')](_0x3efc4c[_0x32a2('0x3c')],[_0x32a2('0x3f')],[_0x32a2('0x40')]);if(_0x3efc4c[_0x32a2('0x36')][_0x32a2('0x3b')]){delete _0x3efc4c[_0x32a2('0x36')][_0x32a2('0x3b')];}if(_0x3efc4c[_0x32a2('0x36')][_0x32a2('0x38')]&&_0x3efc4c[_0x32a2('0x36')][_0x32a2('0x38')][_0x32a2('0x41')][_0x32a2('0x42')]){return _0x3efc4c[_0x32a2('0x36')]['List'][_0x32a2('0x41')][0x0];}var _0x237c2c=_['defaults'](_0x2a0569[_0x32a2('0x23')],{'firstName':_0x2a0569[_0x32a2('0x23')][_0x32a2('0x33')],'ListId':_0x51a8b9['ListId']});_0x237c2c[_0x2a0569[_0x32a2('0x23')][_0x32a2('0x30')]]=_0x2a0569[_0x32a2('0x23')][_0x32a2('0x33')];return db['CmContact'][_0x32a2('0x43')](_0x237c2c,{'fields':_0xcce27f,'raw':!![]});}})['then'](function(_0x120ac6){_0x3efc4c['contact']=_0x120ac6;if(_0x120ac6){var _0x33ce75={'ContactId':_0x120ac6['id'],'FaxAccountId':_0x2a0569[_0x32a2('0x36')]['id'],'fax':_0x120ac6['fax']};return db[_0x32a2('0x44')][_0x32a2('0x35')]({'where':{'ContactId':_0x120ac6['id'],'closed':![],'FaxAccountId':_0x2a0569['account']['id']}})['then'](function(_0x54ca2b){if(_0x54ca2b){return[_0x54ca2b,![]];}return db['FaxInteraction']['create'](_0x33ce75)[_0x32a2('0x20')](function(_0x1e90d0){return[_0x1e90d0,!![]];});});}else{throw new Error(_0x32a2('0x45'));}})[_0x32a2('0x46')](function(_0x419fd7,_0x1a96b4){var _0x4051d6=_0x419fd7[_0x32a2('0x47')]({'plain':!![]});if(_0x1a96b4){if(_0x3efc4c[_0x32a2('0x36')]['autoclose']){_0x3efc4c['applications'][_0x32a2('0x48')]({'id':0x0,'priority':_0x3efc4c[_0x32a2('0x3c')][_0x32a2('0x42')]+0x1,'app':_0x32a2('0x49'),'appdata':_0x32a2('0x4a'),'interval':_0x32a2('0x4b')});}_0x4051d6['created']=!![];}else{_0x4051d6['created']=![];}_0x3efc4c[_0x32a2('0x4c')]=_0x4051d6;return db[_0x32a2('0x4d')]['create']({'body':_0x2a0569['body'][_0x32a2('0x23')],'FaxAccountId':_0x2a0569[_0x32a2('0x36')]['id'],'FaxInteractionId':_0x419fd7['id'],'direction':'in','ContactId':_0x419fd7['ContactId'],'AttachmentId':_0x2a0569[_0x32a2('0x23')][_0x32a2('0x4e')]});})[_0x32a2('0x20')](function(_0x1070be){_0x3efc4c[_0x32a2('0x14')]=_0x1070be;if(_0x3efc4c[_0x32a2('0x4c')][_0x32a2('0x4f')]){return db['User'][_0x32a2('0x35')]({'attributes':['id',_0x32a2('0x50')],'where':{'id':_0x3efc4c[_0x32a2('0x4c')][_0x32a2('0x4f')]}})['then'](function(_0x512416){if(_0x512416){_0x3efc4c[_0x32a2('0x3c')][_0x32a2('0x51')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x512416['name']+','+(_0x3efc4c[_0x32a2('0x36')][_0x32a2('0x52')]||0xa),'interval':_0x32a2('0x4b')});}return respondWithRpcPromise(_0x32a2('0x53'),_0x32a2('0x54'),_0x3efc4c);});}return respondWithRpcPromise('Start',_0x32a2('0x54'),_0x3efc4c);})[_0x32a2('0x20')](function(_0x2abc42){_0x1e43ea(_0x2abc42);})['catch'](function(_0x4ef077){_0x32f971(_0x1cd602[_0x32a2('0x12')](0x1f4,_0x4ef077['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 17b7aec..c07653c 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 _0x823d=['save','update','removeListener','register','length','faxAccount:'];(function(_0x19dcc8,_0x4bae0e){var _0x2810f4=function(_0x507cf4){while(--_0x507cf4){_0x19dcc8['push'](_0x19dcc8['shift']());}};_0x2810f4(++_0x4bae0e);}(_0x823d,0xa8));var _0xd823=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0x823d[_0x16938f];return _0x5c66e9;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xd823('0x0'),'remove',_0xd823('0x1')];function createListener(_0x4715f9,_0x3b3751){return function(_0x5b6178){_0x3b3751['emit'](_0x4715f9,_0x5b6178);};}function removeListener(_0xbe90e,_0x186f1a){return function(){FaxAccountEvents[_0xd823('0x2')](_0xbe90e,_0x186f1a);};}exports[_0xd823('0x3')]=function(_0x1c0929){for(var _0x3088fe=0x0,_0x5f1b32=events[_0xd823('0x4')];_0x3088fe<_0x5f1b32;_0x3088fe++){var _0x396832=events[_0x3088fe];var _0x4f34f9=createListener(_0xd823('0x5')+_0x396832,_0x1c0929);FaxAccountEvents['on'](_0x396832,_0x4f34f9);}}; \ No newline at end of file +var _0x4122=['faxAccount:','./faxAccount.events','remove','update','removeListener','register','length'];(function(_0x35481f,_0xbb0ebc){var _0x1fd73c=function(_0x1ea339){while(--_0x1ea339){_0x35481f['push'](_0x35481f['shift']());}};_0x1fd73c(++_0xbb0ebc);}(_0x4122,0x190));var _0x2412=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4122[_0x46e363];return _0x3fb059;};'use strict';var FaxAccountEvents=require(_0x2412('0x0'));var events=['save',_0x2412('0x1'),_0x2412('0x2')];function createListener(_0x37bade,_0x2439bf){return function(_0x15bdd0){_0x2439bf['emit'](_0x37bade,_0x15bdd0);};}function removeListener(_0x1253f9,_0x877c0e){return function(){FaxAccountEvents[_0x2412('0x3')](_0x1253f9,_0x877c0e);};}exports[_0x2412('0x4')]=function(_0x107747){for(var _0x45ff6e=0x0,_0x2a4146=events[_0x2412('0x5')];_0x45ff6e<_0x2a4146;_0x45ff6e++){var _0x223717=events[_0x45ff6e];var _0x64a6bf=createListener(_0x2412('0x6')+_0x223717,_0x107747);FaxAccountEvents['on'](_0x223717,_0x64a6bf);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index c613894..1aa57b3 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(_0x361ddf,_0x44e167){var _0x324e9f=function(_0x5614e4){while(--_0x5614e4){_0x361ddf['push'](_0x361ddf['shift']());}};_0x324e9f(++_0x44e167);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x4a66fc,_0x2da159){var _0x5d74cb=function(_0x1c2008){while(--_0x1c2008){_0x4a66fc['push'](_0x4a66fc['shift']());}};_0x5d74cb(++_0x2da159);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 5e63fd9..3aa9bfd 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 _0x4af9=['*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0xd9be91,_0x50af7f){var _0x5a2c6c=function(_0x60cda2){while(--_0x60cda2){_0xd9be91['push'](_0xd9be91['shift']());}};_0x5a2c6c(++_0x50af7f);}(_0x4af9,0x196));var _0x94af=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4af9[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0x94af('0x0')]={'priority':{'type':Sequelize[_0x94af('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x94af('0x2')],'allowNull':![],'defaultValue':_0x94af('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x94af('0x2')]},'interval':{'type':Sequelize[_0x94af('0x2')],'defaultValue':_0x94af('0x4')}}; \ No newline at end of file +var _0x6250=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x53d41b,_0x5bfd6d){var _0x546411=function(_0x2eecc){while(--_0x2eecc){_0x53d41b['push'](_0x53d41b['shift']());}};_0x546411(++_0x5bfd6d);}(_0x6250,0x108));var _0x0625=function(_0x30b368,_0xad288d){_0x30b368=_0x30b368-0x0;var _0x46c64f=_0x6250[_0x30b368];return _0x46c64f;};'use strict';var Sequelize=require(_0x0625('0x0'));module[_0x0625('0x1')]={'priority':{'type':Sequelize[_0x0625('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0625('0x3')],'allowNull':![],'defaultValue':_0x0625('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0625('0x3')],'defaultValue':_0x0625('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 4b60606..a1d6a97 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 _0x444b=['offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','FaxApplication','includeAll','rows','catch','show','params','keys','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count'];(function(_0x29b564,_0x2d95bd){var _0xae0676=function(_0x4eedb8){while(--_0x4eedb8){_0x29b564['push'](_0x29b564['shift']());}};_0xae0676(++_0x2d95bd);}(_0x444b,0x13d));var _0xb444=function(_0x78557a,_0x930096){_0x78557a=_0x78557a-0x0;var _0x534d71=_0x444b[_0x78557a];return _0x534d71;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb444('0x0'));var zipdir=require(_0xb444('0x1'));var jsonpatch=require(_0xb444('0x2'));var rp=require(_0xb444('0x3'));var moment=require('moment');var BPromise=require(_0xb444('0x4'));var Mustache=require(_0xb444('0x5'));var util=require('util');var path=require(_0xb444('0x6'));var sox=require('sox');var csv=require(_0xb444('0x7'));var ejs=require(_0xb444('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb444('0x9'));var squel=require(_0xb444('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb444('0x7'));var querystring=require('querystring');var Papa=require(_0xb444('0xb'));var Redis=require(_0xb444('0xc'));var authService=require(_0xb444('0xd'));var qs=require(_0xb444('0xe'));var as=require(_0xb444('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb444('0x10'))(_0xb444('0x11'));var utils=require(_0xb444('0x12'));var config=require(_0xb444('0x13'));var licenseUtil=require(_0xb444('0x14'));var db=require(_0xb444('0x15'))['db'];function respondWithStatusCode(_0x2ce0c2,_0x437791){_0x437791=_0x437791||0xcc;return function(_0x4efd2d){if(_0x4efd2d){return _0x2ce0c2[_0xb444('0x16')](_0x437791);}return _0x2ce0c2[_0xb444('0x17')](_0x437791)['end']();};}function respondWithResult(_0x54b460,_0x3af857){_0x3af857=_0x3af857||0xc8;return function(_0x2a7e17){if(_0x2a7e17){return _0x54b460[_0xb444('0x17')](_0x3af857)[_0xb444('0x18')](_0x2a7e17);}};}function respondWithFilteredResult(_0x3b9f0d,_0x55ced3){return function(_0x5568d1){if(_0x5568d1){var _0x14da28=typeof _0x55ced3['offset']==='undefined'&&typeof _0x55ced3[_0xb444('0x19')]===_0xb444('0x1a');var _0x1f4595=_0x5568d1[_0xb444('0x1b')];var _0x2b672f=_0x14da28?0x0:_0x55ced3[_0xb444('0x1c')];var _0x4c2b37=_0x14da28?_0x5568d1[_0xb444('0x1b')]:_0x55ced3[_0xb444('0x1c')]+_0x55ced3[_0xb444('0x19')];var _0x194cbd;if(_0x4c2b37>=_0x1f4595){_0x4c2b37=_0x1f4595;_0x194cbd=0xc8;}else{_0x194cbd=0xce;}_0x3b9f0d[_0xb444('0x17')](_0x194cbd);return _0x3b9f0d['set'](_0xb444('0x1d'),_0x2b672f+'-'+_0x4c2b37+'/'+_0x1f4595)[_0xb444('0x18')](_0x5568d1);}return null;};}function patchUpdates(_0x1fc9ca){return function(_0x142537){try{jsonpatch[_0xb444('0x1e')](_0x142537,_0x1fc9ca,!![]);}catch(_0x27df56){return BPromise[_0xb444('0x1f')](_0x27df56);}return _0x142537[_0xb444('0x20')]();};}function saveUpdates(_0x38e2a4,_0x2076b5){return function(_0x544743){if(_0x544743){return _0x544743[_0xb444('0x21')](_0x38e2a4)[_0xb444('0x22')](function(_0x114e0c){return _0x114e0c;});}return null;};}function removeEntity(_0x4f75ed,_0x53d3f0){return function(_0x5a4e3a){if(_0x5a4e3a){return _0x5a4e3a[_0xb444('0x23')]()[_0xb444('0x22')](function(){_0x4f75ed[_0xb444('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x196d2b,_0x3054fd){return function(_0xed91ee){if(!_0xed91ee){_0x196d2b[_0xb444('0x16')](0x194);}return _0xed91ee;};}function handleError(_0x37eaeb,_0x137de8){_0x137de8=_0x137de8||0x1f4;return function(_0x7f21d3){logger[_0xb444('0x24')](_0x7f21d3[_0xb444('0x25')]);if(_0x7f21d3[_0xb444('0x26')]){delete _0x7f21d3[_0xb444('0x26')];}_0x37eaeb[_0xb444('0x17')](_0x137de8)[_0xb444('0x27')](_0x7f21d3);};}exports[_0xb444('0x28')]=function(_0x2d5d31,_0x5f3902){var _0x445add={},_0x440c27={},_0xdc23ee={'count':0x0,'rows':[]};var _0x330c3c=_['map'](db['FaxApplication'][_0xb444('0x29')],function(_0x3ed406){return{'name':_0x3ed406['fieldName'],'type':_0x3ed406[_0xb444('0x2a')][_0xb444('0x2b')]};});_0x440c27[_0xb444('0x2c')]=_[_0xb444('0x2d')](_0x330c3c,_0xb444('0x26'));_0x440c27[_0xb444('0x2e')]=_['keys'](_0x2d5d31[_0xb444('0x2e')]);_0x440c27[_0xb444('0x2f')]=_[_0xb444('0x30')](_0x440c27[_0xb444('0x2c')],_0x440c27[_0xb444('0x2e')]);_0x445add['attributes']=_[_0xb444('0x30')](_0x440c27[_0xb444('0x2c')],qs[_0xb444('0x31')](_0x2d5d31['query'][_0xb444('0x31')]));_0x445add[_0xb444('0x32')]=_0x445add[_0xb444('0x32')][_0xb444('0x33')]?_0x445add['attributes']:_0x440c27[_0xb444('0x2c')];if(!_0x2d5d31[_0xb444('0x2e')][_0xb444('0x34')]('nolimit')){_0x445add['limit']=qs[_0xb444('0x19')](_0x2d5d31['query'][_0xb444('0x19')]);_0x445add['offset']=qs[_0xb444('0x1c')](_0x2d5d31[_0xb444('0x2e')]['offset']);}_0x445add['order']=qs[_0xb444('0x35')](_0x2d5d31[_0xb444('0x2e')]['sort']);_0x445add['where']=qs[_0xb444('0x2f')](_[_0xb444('0x36')](_0x2d5d31['query'],_0x440c27[_0xb444('0x2f')]),_0x330c3c);if(_0x2d5d31[_0xb444('0x2e')]['filter']){_0x445add[_0xb444('0x37')]=_[_0xb444('0x38')](_0x445add[_0xb444('0x37')],{'$or':_[_0xb444('0x2d')](_0x330c3c,function(_0x1c291d){if(_0x1c291d[_0xb444('0x2a')]!==_0xb444('0x39')){var _0x440756={};_0x440756[_0x1c291d[_0xb444('0x26')]]={'$like':'%'+_0x2d5d31[_0xb444('0x2e')]['filter']+'%'};return _0x440756;}})});}_0x445add=_[_0xb444('0x38')]({},_0x445add,_0x2d5d31['options']);var _0x252dff={'where':_0x445add[_0xb444('0x37')]};return db[_0xb444('0x3a')][_0xb444('0x1b')](_0x252dff)[_0xb444('0x22')](function(_0xe539e7){_0xdc23ee[_0xb444('0x1b')]=_0xe539e7;if(_0x2d5d31[_0xb444('0x2e')][_0xb444('0x3b')]){_0x445add['include']=[{'all':!![]}];}return db[_0xb444('0x3a')]['findAll'](_0x445add);})['then'](function(_0x1a38fb){_0xdc23ee[_0xb444('0x3c')]=_0x1a38fb;return _0xdc23ee;})[_0xb444('0x22')](respondWithFilteredResult(_0x5f3902,_0x445add))[_0xb444('0x3d')](handleError(_0x5f3902,null));};exports[_0xb444('0x3e')]=function(_0x26d7a2,_0x341e21){var _0x19283c={'raw':!![],'where':{'id':_0x26d7a2[_0xb444('0x3f')]['id']}},_0x344a32={};_0x344a32[_0xb444('0x2c')]=_[_0xb444('0x40')](db['FaxApplication'][_0xb444('0x29')]);_0x344a32['query']=_[_0xb444('0x40')](_0x26d7a2[_0xb444('0x2e')]);_0x344a32[_0xb444('0x2f')]=_[_0xb444('0x30')](_0x344a32[_0xb444('0x2c')],_0x344a32[_0xb444('0x2e')]);_0x19283c['attributes']=_[_0xb444('0x30')](_0x344a32[_0xb444('0x2c')],qs[_0xb444('0x31')](_0x26d7a2[_0xb444('0x2e')]['fields']));_0x19283c[_0xb444('0x32')]=_0x19283c[_0xb444('0x32')]['length']?_0x19283c['attributes']:_0x344a32[_0xb444('0x2c')];if(_0x26d7a2['query'][_0xb444('0x3b')]){_0x19283c['include']=[{'all':!![]}];}_0x19283c=_['merge']({},_0x19283c,_0x26d7a2[_0xb444('0x41')]);return db[_0xb444('0x3a')][_0xb444('0x42')](_0x19283c)[_0xb444('0x22')](handleEntityNotFound(_0x341e21,null))['then'](respondWithResult(_0x341e21,null))[_0xb444('0x3d')](handleError(_0x341e21,null));};exports[_0xb444('0x43')]=function(_0x325610,_0x4bbbbc){return db[_0xb444('0x3a')][_0xb444('0x43')](_0x325610[_0xb444('0x44')],{})['then'](respondWithResult(_0x4bbbbc,0xc9))[_0xb444('0x3d')](handleError(_0x4bbbbc,null));};exports[_0xb444('0x21')]=function(_0x1eefe5,_0x56ee38){if(_0x1eefe5[_0xb444('0x44')]['id']){delete _0x1eefe5[_0xb444('0x44')]['id'];}return db['FaxApplication'][_0xb444('0x42')]({'where':{'id':_0x1eefe5[_0xb444('0x3f')]['id']}})[_0xb444('0x22')](handleEntityNotFound(_0x56ee38,null))[_0xb444('0x22')](saveUpdates(_0x1eefe5[_0xb444('0x44')],null))[_0xb444('0x22')](respondWithResult(_0x56ee38,null))[_0xb444('0x3d')](handleError(_0x56ee38,null));};exports[_0xb444('0x23')]=function(_0x663e17,_0xb121e2){return db['FaxApplication'][_0xb444('0x42')]({'where':{'id':_0x663e17[_0xb444('0x3f')]['id']}})[_0xb444('0x22')](handleEntityNotFound(_0xb121e2,null))[_0xb444('0x22')](removeEntity(_0xb121e2,null))[_0xb444('0x3d')](handleError(_0xb121e2,null));}; \ No newline at end of file +var _0xd60e=['order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','error','stack','name','send','index','map','FaxApplication','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x2b59a5,_0x3b17c4){var _0x447f65=function(_0x3be6cf){while(--_0x3be6cf){_0x2b59a5['push'](_0x2b59a5['shift']());}};_0x447f65(++_0x3b17c4);}(_0xd60e,0xaa));var _0xed60=function(_0x28d93c,_0x5efa6f){_0x28d93c=_0x28d93c-0x0;var _0x4d8d3c=_0xd60e[_0x28d93c];return _0x4d8d3c;};'use strict';var emlformat=require(_0xed60('0x0'));var rimraf=require(_0xed60('0x1'));var zipdir=require(_0xed60('0x2'));var jsonpatch=require(_0xed60('0x3'));var rp=require(_0xed60('0x4'));var moment=require(_0xed60('0x5'));var BPromise=require(_0xed60('0x6'));var Mustache=require('mustache');var util=require(_0xed60('0x7'));var path=require(_0xed60('0x8'));var sox=require('sox');var csv=require(_0xed60('0x9'));var ejs=require(_0xed60('0xa'));var fs=require('fs');var fs_extra=require(_0xed60('0xb'));var _=require(_0xed60('0xc'));var squel=require(_0xed60('0xd'));var crypto=require(_0xed60('0xe'));var jsforce=require(_0xed60('0xf'));var deskjs=require(_0xed60('0x10'));var toCsv=require(_0xed60('0x9'));var querystring=require(_0xed60('0x11'));var Papa=require(_0xed60('0x12'));var Redis=require('ioredis');var authService=require(_0xed60('0x13'));var qs=require(_0xed60('0x14'));var as=require(_0xed60('0x15'));var hardwareService=require(_0xed60('0x16'));var logger=require(_0xed60('0x17'))(_0xed60('0x18'));var utils=require(_0xed60('0x19'));var config=require(_0xed60('0x1a'));var licenseUtil=require(_0xed60('0x1b'));var db=require(_0xed60('0x1c'))['db'];function respondWithStatusCode(_0x185c25,_0x494048){_0x494048=_0x494048||0xcc;return function(_0xb987de){if(_0xb987de){return _0x185c25[_0xed60('0x1d')](_0x494048);}return _0x185c25[_0xed60('0x1e')](_0x494048)[_0xed60('0x1f')]();};}function respondWithResult(_0x325221,_0x484ecc){_0x484ecc=_0x484ecc||0xc8;return function(_0x1ecb15){if(_0x1ecb15){return _0x325221['status'](_0x484ecc)[_0xed60('0x20')](_0x1ecb15);}};}function respondWithFilteredResult(_0x2978d0,_0xbed1ac){return function(_0x454a9a){if(_0x454a9a){var _0xc898a9=typeof _0xbed1ac[_0xed60('0x21')]===_0xed60('0x22')&&typeof _0xbed1ac[_0xed60('0x23')]===_0xed60('0x22');var _0x37c45b=_0x454a9a[_0xed60('0x24')];var _0x12b629=_0xc898a9?0x0:_0xbed1ac[_0xed60('0x21')];var _0x426106=_0xc898a9?_0x454a9a[_0xed60('0x24')]:_0xbed1ac[_0xed60('0x21')]+_0xbed1ac[_0xed60('0x23')];var _0x25db3b;if(_0x426106>=_0x37c45b){_0x426106=_0x37c45b;_0x25db3b=0xc8;}else{_0x25db3b=0xce;}_0x2978d0['status'](_0x25db3b);return _0x2978d0[_0xed60('0x25')]('Content-Range',_0x12b629+'-'+_0x426106+'/'+_0x37c45b)[_0xed60('0x20')](_0x454a9a);}return null;};}function patchUpdates(_0x38ce59){return function(_0x1475c7){try{jsonpatch['apply'](_0x1475c7,_0x38ce59,!![]);}catch(_0x5add73){return BPromise[_0xed60('0x26')](_0x5add73);}return _0x1475c7[_0xed60('0x27')]();};}function saveUpdates(_0x55ab0e,_0x507ce1){return function(_0x330f25){if(_0x330f25){return _0x330f25[_0xed60('0x28')](_0x55ab0e)['then'](function(_0x34ab86){return _0x34ab86;});}return null;};}function removeEntity(_0x462c3b,_0x301d12){return function(_0x1b4bf4){if(_0x1b4bf4){return _0x1b4bf4[_0xed60('0x29')]()[_0xed60('0x2a')](function(){_0x462c3b[_0xed60('0x1e')](0xcc)[_0xed60('0x1f')]();});}};}function handleEntityNotFound(_0x1fccbe,_0x256ecd){return function(_0x15506d){if(!_0x15506d){_0x1fccbe[_0xed60('0x1d')](0x194);}return _0x15506d;};}function handleError(_0x468efe,_0x1641b8){_0x1641b8=_0x1641b8||0x1f4;return function(_0x3315c3){logger[_0xed60('0x2b')](_0x3315c3[_0xed60('0x2c')]);if(_0x3315c3[_0xed60('0x2d')]){delete _0x3315c3[_0xed60('0x2d')];}_0x468efe[_0xed60('0x1e')](_0x1641b8)[_0xed60('0x2e')](_0x3315c3);};}exports[_0xed60('0x2f')]=function(_0x149cb4,_0x32467d){var _0x18ec85={},_0x156d64={},_0x2c8611={'count':0x0,'rows':[]};var _0x11930c=_[_0xed60('0x30')](db[_0xed60('0x31')]['rawAttributes'],function(_0x1f13d3){return{'name':_0x1f13d3[_0xed60('0x32')],'type':_0x1f13d3['type'][_0xed60('0x33')]};});_0x156d64[_0xed60('0x34')]=_[_0xed60('0x30')](_0x11930c,'name');_0x156d64[_0xed60('0x35')]=_['keys'](_0x149cb4[_0xed60('0x35')]);_0x156d64[_0xed60('0x36')]=_['intersection'](_0x156d64[_0xed60('0x34')],_0x156d64[_0xed60('0x35')]);_0x18ec85['attributes']=_[_0xed60('0x37')](_0x156d64[_0xed60('0x34')],qs[_0xed60('0x38')](_0x149cb4[_0xed60('0x35')][_0xed60('0x38')]));_0x18ec85[_0xed60('0x39')]=_0x18ec85[_0xed60('0x39')][_0xed60('0x3a')]?_0x18ec85[_0xed60('0x39')]:_0x156d64[_0xed60('0x34')];if(!_0x149cb4['query'][_0xed60('0x3b')](_0xed60('0x3c'))){_0x18ec85['limit']=qs[_0xed60('0x23')](_0x149cb4['query'][_0xed60('0x23')]);_0x18ec85['offset']=qs['offset'](_0x149cb4['query'][_0xed60('0x21')]);}_0x18ec85[_0xed60('0x3d')]=qs[_0xed60('0x3e')](_0x149cb4['query']['sort']);_0x18ec85[_0xed60('0x3f')]=qs[_0xed60('0x36')](_['pick'](_0x149cb4[_0xed60('0x35')],_0x156d64[_0xed60('0x36')]),_0x11930c);if(_0x149cb4[_0xed60('0x35')][_0xed60('0x40')]){_0x18ec85['where']=_[_0xed60('0x41')](_0x18ec85[_0xed60('0x3f')],{'$or':_[_0xed60('0x30')](_0x11930c,function(_0x558180){if(_0x558180[_0xed60('0x42')]!=='VIRTUAL'){var _0x5ea4f9={};_0x5ea4f9[_0x558180['name']]={'$like':'%'+_0x149cb4[_0xed60('0x35')][_0xed60('0x40')]+'%'};return _0x5ea4f9;}})});}_0x18ec85=_[_0xed60('0x41')]({},_0x18ec85,_0x149cb4[_0xed60('0x43')]);var _0x113755={'where':_0x18ec85[_0xed60('0x3f')]};return db['FaxApplication'][_0xed60('0x24')](_0x113755)['then'](function(_0x11e121){_0x2c8611['count']=_0x11e121;if(_0x149cb4[_0xed60('0x35')][_0xed60('0x44')]){_0x18ec85[_0xed60('0x45')]=[{'all':!![]}];}return db[_0xed60('0x31')][_0xed60('0x46')](_0x18ec85);})[_0xed60('0x2a')](function(_0x206075){_0x2c8611[_0xed60('0x47')]=_0x206075;return _0x2c8611;})[_0xed60('0x2a')](respondWithFilteredResult(_0x32467d,_0x18ec85))[_0xed60('0x48')](handleError(_0x32467d,null));};exports['show']=function(_0x4f4441,_0x18f333){var _0x3426af={'raw':!![],'where':{'id':_0x4f4441[_0xed60('0x49')]['id']}},_0x2164c3={};_0x2164c3[_0xed60('0x34')]=_['keys'](db[_0xed60('0x31')]['rawAttributes']);_0x2164c3[_0xed60('0x35')]=_['keys'](_0x4f4441[_0xed60('0x35')]);_0x2164c3[_0xed60('0x36')]=_[_0xed60('0x37')](_0x2164c3['model'],_0x2164c3[_0xed60('0x35')]);_0x3426af[_0xed60('0x39')]=_[_0xed60('0x37')](_0x2164c3[_0xed60('0x34')],qs[_0xed60('0x38')](_0x4f4441[_0xed60('0x35')][_0xed60('0x38')]));_0x3426af[_0xed60('0x39')]=_0x3426af['attributes'][_0xed60('0x3a')]?_0x3426af[_0xed60('0x39')]:_0x2164c3['model'];if(_0x4f4441[_0xed60('0x35')]['includeAll']){_0x3426af[_0xed60('0x45')]=[{'all':!![]}];}_0x3426af=_[_0xed60('0x41')]({},_0x3426af,_0x4f4441[_0xed60('0x43')]);return db[_0xed60('0x31')][_0xed60('0x4a')](_0x3426af)[_0xed60('0x2a')](handleEntityNotFound(_0x18f333,null))['then'](respondWithResult(_0x18f333,null))[_0xed60('0x48')](handleError(_0x18f333,null));};exports['create']=function(_0x52e256,_0xb9010f){return db[_0xed60('0x31')][_0xed60('0x4b')](_0x52e256[_0xed60('0x4c')],{})[_0xed60('0x2a')](respondWithResult(_0xb9010f,0xc9))[_0xed60('0x48')](handleError(_0xb9010f,null));};exports[_0xed60('0x28')]=function(_0xae134,_0x1b9218){if(_0xae134[_0xed60('0x4c')]['id']){delete _0xae134[_0xed60('0x4c')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0xae134['params']['id']}})[_0xed60('0x2a')](handleEntityNotFound(_0x1b9218,null))['then'](saveUpdates(_0xae134['body'],null))['then'](respondWithResult(_0x1b9218,null))['catch'](handleError(_0x1b9218,null));};exports[_0xed60('0x29')]=function(_0xd5b31f,_0x3a6c51){return db[_0xed60('0x31')][_0xed60('0x4a')]({'where':{'id':_0xd5b31f[_0xed60('0x49')]['id']}})[_0xed60('0x2a')](handleEntityNotFound(_0x3a6c51,null))['then'](removeEntity(_0x3a6c51,null))[_0xed60('0x48')](handleError(_0x3a6c51,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 01f08e5..fe2dc8a 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 _0x793f=['moment','request-promise','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x554ce2,_0x4947db){var _0x47a17a=function(_0x257c5f){while(--_0x257c5f){_0x554ce2['push'](_0x554ce2['shift']());}};_0x47a17a(++_0x4947db);}(_0x793f,0x80));var _0xf793=function(_0x665c1c,_0x217755){_0x665c1c=_0x665c1c-0x0;var _0x181b40=_0x793f[_0x665c1c];return _0x181b40;};'use strict';var _=require(_0xf793('0x0'));var util=require(_0xf793('0x1'));var logger=require(_0xf793('0x2'))(_0xf793('0x3'));var moment=require(_0xf793('0x4'));var BPromise=require('bluebird');var rp=require(_0xf793('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf793('0x6'));module[_0xf793('0x7')]=function(_0x1ba1e0,_0x395d3e){return _0x1ba1e0['define'](_0xf793('0x8'),attributes,{'tableName':_0xf793('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf793('0xa')});}; \ No newline at end of file +var _0x6fdd=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3c64d1,_0x3c002a){var _0xb48c10=function(_0x416e72){while(--_0x416e72){_0x3c64d1['push'](_0x3c64d1['shift']());}};_0xb48c10(++_0x3c002a);}(_0x6fdd,0x1df));var _0xd6fd=function(_0x3e91a9,_0x53c466){_0x3e91a9=_0x3e91a9-0x0;var _0x25c9ad=_0x6fdd[_0x3e91a9];return _0x25c9ad;};'use strict';var _=require(_0xd6fd('0x0'));var util=require('util');var logger=require(_0xd6fd('0x1'))(_0xd6fd('0x2'));var moment=require(_0xd6fd('0x3'));var BPromise=require(_0xd6fd('0x4'));var rp=require(_0xd6fd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd6fd('0x6'));var config=require(_0xd6fd('0x7'));var attributes=require(_0xd6fd('0x8'));module[_0xd6fd('0x9')]=function(_0x4f81ef,_0x288563){return _0x4f81ef[_0xd6fd('0xa')](_0xd6fd('0xb'),attributes,{'tableName':_0xd6fd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd6fd('0xd'),'collate':_0xd6fd('0xe')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 9e13468..d04af67 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 _0x01e7=['debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','UpdateFaxApplication','FaxApplication','update','body','options','where','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FaxApplication,\x20%s,\x20%s'];(function(_0x4a3746,_0x37b7a8){var _0x3916c4=function(_0x3d8b1a){while(--_0x3d8b1a){_0x4a3746['push'](_0x4a3746['shift']());}};_0x3916c4(++_0x37b7a8);}(_0x01e7,0x125));var _0x701e=function(_0x55d694,_0x5bb69d){_0x55d694=_0x55d694-0x0;var _0x5c9d3e=_0x01e7[_0x55d694];return _0x5c9d3e;};'use strict';var _=require(_0x701e('0x0'));var util=require(_0x701e('0x1'));var moment=require(_0x701e('0x2'));var BPromise=require(_0x701e('0x3'));var rs=require(_0x701e('0x4'));var fs=require('fs');var Redis=require(_0x701e('0x5'));var db=require(_0x701e('0x6'))['db'];var utils=require(_0x701e('0x7'));var logger=require(_0x701e('0x8'))(_0x701e('0x9'));var config=require(_0x701e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x701e('0xb')][_0x701e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9ab603,_0x4cf450,_0x5984de){return new BPromise(function(_0x3dc407,_0xe9b695){return client[_0x701e('0xd')](_0x9ab603,_0x5984de)[_0x701e('0xe')](function(_0x3aea34){logger[_0x701e('0xf')](_0x701e('0x10'),_0x4cf450,'request\x20sent');logger[_0x701e('0x11')](_0x701e('0x12'),_0x4cf450,_0x701e('0x13'),JSON['stringify'](_0x3aea34));if(_0x3aea34['error']){if(_0x3aea34[_0x701e('0x14')][_0x701e('0x15')]===0x1f4){logger[_0x701e('0x14')](_0x701e('0x10'),_0x4cf450,_0x3aea34[_0x701e('0x14')]['message']);return _0xe9b695(_0x3aea34[_0x701e('0x14')][_0x701e('0x16')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x4cf450,_0x3aea34['error'][_0x701e('0x16')]);return _0x3dc407(_0x3aea34[_0x701e('0x14')][_0x701e('0x16')]);}else{logger['info'](_0x701e('0x10'),_0x4cf450,'request\x20sent');_0x3dc407(_0x3aea34[_0x701e('0x17')][_0x701e('0x16')]);}})['catch'](function(_0x40b85b){logger['error'](_0x701e('0x10'),_0x4cf450,_0x40b85b);_0xe9b695(_0x40b85b);});});}exports[_0x701e('0x18')]=function(_0x3d8a39){var _0xbe878=this;return new Promise(function(_0x43a1d3,_0x3cbe65){return db[_0x701e('0x19')][_0x701e('0x1a')](_0x3d8a39[_0x701e('0x1b')],{'raw':_0x3d8a39[_0x701e('0x1c')]?_0x3d8a39[_0x701e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d8a39[_0x701e('0x1c')]?_0x3d8a39['options'][_0x701e('0x1d')]||null:null,'attributes':_0x3d8a39[_0x701e('0x1c')]?_0x3d8a39['options']['attributes']||null:null,'limit':_0x3d8a39[_0x701e('0x1c')]?_0x3d8a39[_0x701e('0x1c')]['limit']||null:null})['then'](function(_0x3328e7){logger[_0x701e('0xf')](_0x701e('0x18'),_0x3d8a39);logger[_0x701e('0x11')](_0x701e('0x18'),_0x3d8a39,JSON[_0x701e('0x1e')](_0x3328e7));_0x43a1d3(_0x3328e7);})['catch'](function(_0x181b7c){logger[_0x701e('0x14')](_0x701e('0x18'),_0x181b7c[_0x701e('0x16')],_0x3d8a39);_0x3cbe65(_0xbe878['error'](0x1f4,_0x181b7c[_0x701e('0x16')]));});});}; \ No newline at end of file +var _0xe84a=['code','error','message','catch','body','options','raw','where','limit','then','UpdateFaxApplication','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FaxApplication,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x36d301,_0x22d467){var _0x1ac8d2=function(_0x46a670){while(--_0x46a670){_0x36d301['push'](_0x36d301['shift']());}};_0x1ac8d2(++_0x22d467);}(_0xe84a,0x97));var _0xae84=function(_0x192bfa,_0x54901c){_0x192bfa=_0x192bfa-0x0;var _0x37f066=_0xe84a[_0x192bfa];return _0x37f066;};'use strict';var _=require(_0xae84('0x0'));var util=require(_0xae84('0x1'));var moment=require(_0xae84('0x2'));var BPromise=require(_0xae84('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae84('0x4'));var db=require(_0xae84('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xae84('0x6'))(_0xae84('0x7'));var config=require(_0xae84('0x8'));var jayson=require(_0xae84('0x9'));var client=jayson['client'][_0xae84('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21ebf2,_0x1d3028,_0x402701){return new BPromise(function(_0x36bd5f,_0xf6d2c2){return client[_0xae84('0xb')](_0x21ebf2,_0x402701)['then'](function(_0x5261b8){logger[_0xae84('0xc')](_0xae84('0xd'),_0x1d3028,'request\x20sent');logger[_0xae84('0xe')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x1d3028,_0xae84('0xf'),JSON[_0xae84('0x10')](_0x5261b8));if(_0x5261b8['error']){if(_0x5261b8['error'][_0xae84('0x11')]===0x1f4){logger[_0xae84('0x12')](_0xae84('0xd'),_0x1d3028,_0x5261b8[_0xae84('0x12')][_0xae84('0x13')]);return _0xf6d2c2(_0x5261b8[_0xae84('0x12')][_0xae84('0x13')]);}logger[_0xae84('0x12')](_0xae84('0xd'),_0x1d3028,_0x5261b8[_0xae84('0x12')]['message']);return _0x36bd5f(_0x5261b8['error'][_0xae84('0x13')]);}else{logger[_0xae84('0xc')](_0xae84('0xd'),_0x1d3028,_0xae84('0xf'));_0x36bd5f(_0x5261b8['result']['message']);}})[_0xae84('0x14')](function(_0x11329b){logger[_0xae84('0x12')](_0xae84('0xd'),_0x1d3028,_0x11329b);_0xf6d2c2(_0x11329b);});});}exports['UpdateFaxApplication']=function(_0x32eb37){var _0x52ec2b=this;return new Promise(function(_0x52803a,_0x1050e5){return db['FaxApplication']['update'](_0x32eb37[_0xae84('0x15')],{'raw':_0x32eb37[_0xae84('0x16')]?_0x32eb37[_0xae84('0x16')][_0xae84('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32eb37[_0xae84('0x16')]?_0x32eb37['options'][_0xae84('0x18')]||null:null,'attributes':_0x32eb37[_0xae84('0x16')]?_0x32eb37[_0xae84('0x16')]['attributes']||null:null,'limit':_0x32eb37[_0xae84('0x16')]?_0x32eb37[_0xae84('0x16')][_0xae84('0x19')]||null:null})[_0xae84('0x1a')](function(_0x555915){logger['info'](_0xae84('0x1b'),_0x32eb37);logger[_0xae84('0xe')](_0xae84('0x1b'),_0x32eb37,JSON[_0xae84('0x10')](_0x555915));_0x52803a(_0x555915);})[_0xae84('0x14')](function(_0x185ee5){logger[_0xae84('0x12')]('UpdateFaxApplication',_0x185ee5['message'],_0x32eb37);_0x1050e5(_0x52ec2b[_0xae84('0x12')](0x1f4,_0x185ee5['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index ad45b56..502c432 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 _0xea28=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xea28,0x13a));var _0x8ea2=function(_0x17caf7,_0x205f70){_0x17caf7=_0x17caf7-0x0;var _0x11b4d7=_0xea28[_0x17caf7];return _0x11b4d7;};'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('0xf')]('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0x11')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x12')]);router['delete']('/:id',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);module[_0x8ea2('0x14')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x32d9fe,_0x213473){var _0x1b8f8e=function(_0x39c16c){while(--_0x39c16c){_0x32d9fe['push'](_0x32d9fe['shift']());}};_0x1b8f8e(++_0x213473);}(_0xda3f,0xec));var _0xfda3=function(_0x549b8e,_0x882b7){_0x549b8e=_0x549b8e-0x0;var _0x1b45f6=_0xda3f[_0x549b8e];return _0x1b45f6;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./faxApplication.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 80b39ca..0f013fe 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 _0x8ec1=['STRING','ENUM','out','exports','BOOLEAN','DATE'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x8ec1,0x183));var _0x18ec=function(_0x431cf2,_0x1d4456){_0x431cf2=_0x431cf2-0x0;var _0x10c9a7=_0x8ec1[_0x431cf2];return _0x10c9a7;};'use strict';var Sequelize=require('sequelize');module[_0x18ec('0x0')]={'closed':{'type':Sequelize[_0x18ec('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x18ec('0x2')]},'disposition':{'type':Sequelize[_0x18ec('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x18ec('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x18ec('0x2')]},'fax':{'type':Sequelize[_0x18ec('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x18ec('0x4')]('in',_0x18ec('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x18ec('0x4')]('in',_0x18ec('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xd128=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd128,0x12b));var _0x8d12=function(_0x16ab3e,_0x1305df){_0x16ab3e=_0x16ab3e-0x0;var _0x34f199=_0xd128[_0x16ab3e];return _0x34f199;};'use strict';var Sequelize=require(_0x8d12('0x0'));module[_0x8d12('0x1')]={'closed':{'type':Sequelize[_0x8d12('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8d12('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8d12('0x4')]},'note':{'type':Sequelize[_0x8d12('0x4')]},'read1stAt':{'type':Sequelize[_0x8d12('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8d12('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8d12('0x5')]('in',_0x8d12('0x6')),'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 4ef6054..7e7f3db 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 _0x07d3=['addTags','setTags','spread','Tag','color','emit','removeTags','unix','toString','join','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','existsSync','pipe','createWriteStream','basename','resolve','download','log','unlinkSync','zip-dir','bluebird','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./faxInteraction.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query','params','model','filters','intersection','attributes','fields','length','includeAll','include','options','FaxInteraction','find','create','body','catch','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','keys','hasOwnProperty','nolimit','sort','pick','where','FaxInteractionId','merge','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows'];(function(_0x45ffeb,_0xc0af19){var _0x5133bd=function(_0x1cd8bd){while(--_0x1cd8bd){_0x45ffeb['push'](_0x45ffeb['shift']());}};_0x5133bd(++_0xc0af19);}(_0x07d3,0xe7));var _0x307d=function(_0x308698,_0x580bc6){_0x308698=_0x308698-0x0;var _0x5b061f=_0x07d3[_0x308698];return _0x5b061f;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x307d('0x0'));var moment=require('moment');var BPromise=require(_0x307d('0x1'));var util=require('util');var path=require(_0x307d('0x2'));var fs=require('fs');var _=require(_0x307d('0x3'));var Redis=require(_0x307d('0x4'));var interaction=require(_0x307d('0x5'));var qs=require(_0x307d('0x6'));var logger=require(_0x307d('0x7'))(_0x307d('0x8'));var config=require(_0x307d('0x9'));var db=require(_0x307d('0xa'))['db'];config[_0x307d('0xb')]=_[_0x307d('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x307d('0xd'))[_0x307d('0xe')](socket);function respondWithStatusCode(_0x1c05d3,_0x1c6b93){_0x1c6b93=_0x1c6b93||0xcc;return function(_0x3f9d17){if(_0x3f9d17){return _0x1c05d3['sendStatus'](_0x1c6b93);}return _0x1c05d3['status'](_0x1c6b93)[_0x307d('0xf')]();};}function respondWithResult(_0x31f3fe,_0x100439){_0x100439=_0x100439||0xc8;return function(_0x565ec2){if(_0x565ec2){return _0x31f3fe[_0x307d('0x10')](_0x100439)[_0x307d('0x11')](_0x565ec2);}};}function respondWithFilteredResult(_0x36961b,_0xb06127){return function(_0x25d1cd){if(_0x25d1cd){var _0x21e3b7=typeof _0xb06127[_0x307d('0x12')]===_0x307d('0x13')&&typeof _0xb06127[_0x307d('0x14')]===_0x307d('0x13');var _0x4a5292=_0x25d1cd[_0x307d('0x15')];var _0x395e27=_0x21e3b7?0x0:_0xb06127[_0x307d('0x12')];var _0x297cfa=_0x21e3b7?_0x25d1cd[_0x307d('0x15')]:_0xb06127[_0x307d('0x12')]+_0xb06127[_0x307d('0x14')];var _0x593cf9;if(_0x297cfa>=_0x4a5292){_0x297cfa=_0x4a5292;_0x593cf9=0xc8;}else{_0x593cf9=0xce;}_0x36961b['status'](_0x593cf9);return _0x36961b[_0x307d('0x16')](_0x307d('0x17'),_0x395e27+'-'+_0x297cfa+'/'+_0x4a5292)['json'](_0x25d1cd);}return null;};}function saveUpdates(_0x5a6f1f){return function(_0xc5ac8e){if(_0xc5ac8e){return _0xc5ac8e[_0x307d('0x18')](_0x5a6f1f)[_0x307d('0x19')](function(_0x1be410){return _0x1be410;});}return null;};}function removeEntity(_0x3b4f44){return function(_0x37ad6e){if(_0x37ad6e){return _0x37ad6e['destroy']()[_0x307d('0x19')](function(){_0x3b4f44['status'](0xcc)[_0x307d('0xf')]();});}};}function handleEntityNotFound(_0xf73c4a){return function(_0x42db1a){if(!_0x42db1a){_0xf73c4a[_0x307d('0x1a')](0x194);}return _0x42db1a;};}function handleError(_0x2b7b2d,_0x2f61f3){_0x2f61f3=_0x2f61f3||0x1f4;return function(_0x255c57){logger['error'](_0x255c57['stack']);if(_0x255c57[_0x307d('0x1b')]){delete _0x255c57[_0x307d('0x1b')];}_0x2b7b2d[_0x307d('0x10')](_0x2f61f3)[_0x307d('0x1c')](_0x255c57);};}exports[_0x307d('0x1d')]=function(_0x34925,_0x703b99){var _0x1752fe={};var _0x190b0f=_[_0x307d('0x1e')](db['FaxInteraction'][_0x307d('0x1f')],function(_0x43010f){return{'name':_0x43010f[_0x307d('0x20')],'type':_0x43010f[_0x307d('0x21')][_0x307d('0x22')]};});_0x1752fe=qs[_0x307d('0x23')](_0x190b0f,_0x34925);return interaction[_0x307d('0x24')](_0x307d('0x25'),_0x34925[_0x307d('0x26')],_0x34925['user'],_0x1752fe,_0x190b0f)[_0x307d('0x19')](respondWithFilteredResult(_0x703b99,_0x1752fe))['catch'](handleError(_0x703b99,null));};exports['show']=function(_0x3712ec,_0x2c77ec){var _0x24eee5={'raw':![],'where':{'id':_0x3712ec[_0x307d('0x27')]['id']}},_0x4ef68b={};_0x4ef68b[_0x307d('0x28')]=_['keys'](db['FaxInteraction']['rawAttributes']);_0x4ef68b['query']=_['keys'](_0x3712ec[_0x307d('0x26')]);_0x4ef68b[_0x307d('0x29')]=_[_0x307d('0x2a')](_0x4ef68b[_0x307d('0x28')],_0x4ef68b[_0x307d('0x26')]);_0x24eee5[_0x307d('0x2b')]=_['intersection'](_0x4ef68b['model'],qs['fields'](_0x3712ec[_0x307d('0x26')][_0x307d('0x2c')]));_0x24eee5[_0x307d('0x2b')]=_0x24eee5[_0x307d('0x2b')][_0x307d('0x2d')]?_0x24eee5['attributes']:_0x4ef68b[_0x307d('0x28')];if(_0x3712ec['query'][_0x307d('0x2e')]){_0x24eee5[_0x307d('0x2f')]=[{'all':!![]}];}_0x24eee5=_['merge']({},_0x24eee5,_0x3712ec[_0x307d('0x30')]);return db[_0x307d('0x31')][_0x307d('0x32')](_0x24eee5)[_0x307d('0x19')](handleEntityNotFound(_0x2c77ec,null))[_0x307d('0x19')](respondWithResult(_0x2c77ec,null))['catch'](handleError(_0x2c77ec,null));};exports['create']=function(_0x12ccee,_0x35ef4a){return db[_0x307d('0x31')][_0x307d('0x33')](_0x12ccee[_0x307d('0x34')],{})['then'](respondWithResult(_0x35ef4a,0xc9))[_0x307d('0x35')](handleError(_0x35ef4a,null));};exports[_0x307d('0x18')]=function(_0x3e1a4f,_0x1fdbf9){if(_0x3e1a4f[_0x307d('0x34')]['id']){delete _0x3e1a4f[_0x307d('0x34')]['id'];}return db[_0x307d('0x31')][_0x307d('0x32')]({'where':{'id':_0x3e1a4f[_0x307d('0x27')]['id']}})[_0x307d('0x19')](handleEntityNotFound(_0x1fdbf9,null))[_0x307d('0x19')](saveUpdates(_0x3e1a4f[_0x307d('0x34')],null))[_0x307d('0x19')](respondWithResult(_0x1fdbf9,null))[_0x307d('0x35')](handleError(_0x1fdbf9,null));};exports['destroy']=function(_0x837c40,_0x206491){return db[_0x307d('0x31')][_0x307d('0x32')]({'where':{'id':_0x837c40[_0x307d('0x27')]['id']}})['then'](handleEntityNotFound(_0x206491,null))[_0x307d('0x19')](removeEntity(_0x206491,null))[_0x307d('0x35')](handleError(_0x206491,null));};exports[_0x307d('0x36')]=function(_0xa0dfa1,_0x211a20){return db[_0x307d('0x31')]['describe']()['then'](respondWithResult(_0x211a20,null))[_0x307d('0x35')](handleError(_0x211a20,null));};exports[_0x307d('0x37')]=function(_0x286c53,_0xa8fd3b){return db[_0x307d('0x38')][_0x307d('0x32')]({'where':{'id':_0x286c53[_0x307d('0x27')]['id']}})[_0x307d('0x19')](handleEntityNotFound(_0xa8fd3b,null))[_0x307d('0x19')](function(_0x5a0a3c){if(_0x5a0a3c){return _0x5a0a3c[_0x307d('0x37')](_0x286c53['body'][_0x307d('0x39')],_[_0x307d('0x3a')](_0x286c53['body'],[_0x307d('0x39'),'id'])||{});}})[_0x307d('0x19')](respondWithResult(_0xa8fd3b,null))[_0x307d('0x35')](handleError(_0xa8fd3b,null));};exports[_0x307d('0x3b')]=function(_0x17db03,_0xbe8f29){var _0x34f942={'raw':![],'where':{}};var _0x5dc6b4={};var _0x41666f={'count':0x0,'rows':[]};return db[_0x307d('0x31')][_0x307d('0x3c')]({'where':{'id':_0x17db03[_0x307d('0x27')]['id']}})[_0x307d('0x19')](handleEntityNotFound(_0xbe8f29,null))['then'](function(_0x81a861){if(_0x81a861){_0x5dc6b4[_0x307d('0x28')]=_[_0x307d('0x3d')](db[_0x307d('0x38')][_0x307d('0x1f')]);_0x5dc6b4[_0x307d('0x26')]=_[_0x307d('0x3d')](_0x17db03[_0x307d('0x26')]);_0x5dc6b4[_0x307d('0x29')]=_[_0x307d('0x2a')](_0x5dc6b4[_0x307d('0x28')],_0x5dc6b4[_0x307d('0x26')]);_0x34f942[_0x307d('0x2b')]=_['intersection'](_0x5dc6b4[_0x307d('0x28')],qs[_0x307d('0x2c')](_0x17db03[_0x307d('0x26')][_0x307d('0x2c')]));_0x34f942['attributes']=_0x34f942[_0x307d('0x2b')][_0x307d('0x2d')]?_0x34f942[_0x307d('0x2b')]:_0x5dc6b4[_0x307d('0x28')];if(!_0x17db03[_0x307d('0x26')][_0x307d('0x3e')](_0x307d('0x3f'))){_0x34f942[_0x307d('0x14')]=qs[_0x307d('0x14')](_0x17db03['query'][_0x307d('0x14')]);_0x34f942[_0x307d('0x12')]=qs['offset'](_0x17db03['query'][_0x307d('0x12')]);}_0x34f942['order']=qs['sort'](_0x17db03[_0x307d('0x26')][_0x307d('0x40')]);_0x34f942['where']=qs[_0x307d('0x29')](_[_0x307d('0x41')](_0x17db03['query'],_0x5dc6b4['filters']));_0x34f942[_0x307d('0x42')][_0x307d('0x43')]=_0x81a861['id'];if(_0x17db03['query']['filter']){_0x34f942[_0x307d('0x42')]=_[_0x307d('0x44')](_0x34f942[_0x307d('0x42')],{'$or':_['map'](_0x34f942[_0x307d('0x2b')],function(_0x4382e1){var _0x5860c2={};_0x5860c2[_0x4382e1]={'$like':'%'+_0x17db03['query'][_0x307d('0x45')]+'%'};return _0x5860c2;})});}if(_0x17db03[_0x307d('0x26')][_0x307d('0x46')]){var _0x339508=_0x17db03[_0x307d('0x26')][_0x307d('0x46')][_0x307d('0x47')](',');var _0x36fbbc={};_0x36fbbc[_0x339508[0x0]]={'$gte':moment(_0x339508[0x1])[_0x307d('0x48')](_0x307d('0x49'))};_0x34f942[_0x307d('0x42')]=_[_0x307d('0x44')](_0x34f942['where'],_0x36fbbc);}_0x34f942=_[_0x307d('0x44')]({},_0x34f942,_0x17db03[_0x307d('0x30')]);return db['FaxMessage'][_0x307d('0x15')]({'where':_0x34f942[_0x307d('0x42')]})[_0x307d('0x19')](function(_0x485cab){_0x41666f[_0x307d('0x15')]=_0x485cab;if(_0x17db03[_0x307d('0x26')][_0x307d('0x2e')]){_0x34f942[_0x307d('0x2f')]=[{'all':!![]}];}return db[_0x307d('0x38')][_0x307d('0x24')](_0x34f942);})[_0x307d('0x19')](function(_0x4c34d5){_0x41666f[_0x307d('0x4a')]=_0x4c34d5;return _0x41666f;});}})[_0x307d('0x19')](respondWithFilteredResult(_0xbe8f29,_0x34f942))['catch'](handleError(_0xbe8f29,null));};exports[_0x307d('0x4b')]=function(_0xed8701,_0x55a4e0){return db[_0x307d('0x31')][_0x307d('0x32')]({'where':{'id':_0xed8701[_0x307d('0x27')]['id']}})[_0x307d('0x19')](handleEntityNotFound(_0x55a4e0,null))[_0x307d('0x19')](function(_0x189814){if(_0x189814){return _0x189814[_0x307d('0x4c')](_0xed8701[_0x307d('0x34')][_0x307d('0x39')],_[_0x307d('0x3a')](_0xed8701[_0x307d('0x34')],[_0x307d('0x39'),'id'])||{})[_0x307d('0x4d')](function(){return db[_0x307d('0x4e')][_0x307d('0x24')]({'attributes':['id',_0x307d('0x1b'),_0x307d('0x4f')],'where':{'id':_0xed8701[_0x307d('0x34')][_0x307d('0x39')]}});})[_0x307d('0x19')](function(_0x183acb){socket[_0x307d('0x50')]('faxInteractionTags:save',{'id':Number(_0xed8701[_0x307d('0x27')]['id']),'tags':_0x183acb||[]});return{'id':Number(_0xed8701[_0x307d('0x27')]['id']),'tags':_0x183acb||[]};});}})[_0x307d('0x19')](respondWithResult(_0x55a4e0,null))[_0x307d('0x35')](handleError(_0x55a4e0,null));};exports['removeTags']=function(_0x519b3c,_0xa79ac8){return db[_0x307d('0x31')][_0x307d('0x32')]({'where':{'id':_0x519b3c[_0x307d('0x27')]['id']}})[_0x307d('0x19')](handleEntityNotFound(_0xa79ac8,null))['then'](function(_0x38b462){if(_0x38b462){return _0x38b462[_0x307d('0x51')](_0x519b3c[_0x307d('0x26')][_0x307d('0x39')]);}})[_0x307d('0x19')](respondWithStatusCode(_0xa79ac8,null))[_0x307d('0x35')](handleError(_0xa79ac8,null));};exports['download']=function(_0x55aba2,_0x2d692b){var _0x546cee=moment()[_0x307d('0x52')]()[_0x307d('0x53')]();var _0xeed62b=path[_0x307d('0x54')](config['root'],_0x307d('0x55'),_0x307d('0x56'),_0x307d('0x57'));var _0x31212d=path[_0x307d('0x54')](config['root'],_0x307d('0x55'),_0x307d('0x56'),_0x307d('0x58'));var _0x89b836=path['join'](_0xeed62b,_0x546cee);var _0x371c72=util[_0x307d('0x48')](_0x307d('0x59'),_0x55aba2[_0x307d('0x27')]['id'],_0x546cee);var _0x1dfbf0=path[_0x307d('0x54')](_0xeed62b,_0x371c72);var _0x75e9d=[];_0x75e9d['push']({'model':db[_0x307d('0x5a')],'as':_0x307d('0x5a'),'raw':!![]});var _0x2d2467=[{'model':db[_0x307d('0x38')],'as':_0x307d('0x5b'),'attributes':['id',_0x307d('0x34'),'createdAt'],'include':_0x75e9d}];return db['FaxInteraction'][_0x307d('0x32')]({'where':{'id':_0x55aba2[_0x307d('0x27')]['id']},'include':_0x2d2467})[_0x307d('0x19')](handleEntityNotFound(_0x2d692b,null))[_0x307d('0x19')](function(_0x4ac403){if(_0x4ac403&&_0x4ac403[_0x307d('0x5b')]){var _0x1a357a=_0x4ac403[_0x307d('0x5c')]({'plain':!![]});fs[_0x307d('0x5d')](_0x89b836);for(var _0x177a9d=0x0;_0x177a9d<_0x1a357a[_0x307d('0x5b')][_0x307d('0x2d')];_0x177a9d++){var _0x2c506d=_0x1a357a[_0x307d('0x5b')][_0x177a9d][_0x307d('0x5a')];if(_0x2c506d){var _0x2ea353=path['join'](_0x31212d,_0x2c506d['basename']);if(fs[_0x307d('0x5e')](_0x2ea353)){fs['createReadStream'](_0x2ea353)[_0x307d('0x5f')](fs[_0x307d('0x60')](path[_0x307d('0x54')](_0x89b836,_0x2c506d[_0x307d('0x61')])));}}}return BPromise[_0x307d('0x62')]()[_0x307d('0x19')](function(){return new BPromise(function(_0x48f22b,_0x3645aa){zipdir(_0x89b836,{'saveTo':_0x1dfbf0},function(_0x48c3e6,_0x532878){if(_0x48c3e6)return _0x3645aa(_0x48c3e6);return _0x48f22b(_0x532878);});})[_0x307d('0x19')](function(){return new BPromise(function(_0x1b8256,_0x587a75){rimraf(_0x89b836,function(_0x13ac4b){if(_0x13ac4b)_0x587a75(_0x13ac4b);return _0x1b8256();});});})[_0x307d('0x19')](function(){return _0x2d692b[_0x307d('0x63')](_0x1dfbf0,_0x371c72,function(_0x134e1c){if(_0x134e1c){console[_0x307d('0x64')]('err',_0x134e1c);}else{fs[_0x307d('0x65')](_0x1dfbf0);}});});});}else{return _0x2d692b[_0x307d('0x1a')](0xc8);}})['catch'](handleError(_0x2d692b,null));}; \ No newline at end of file +var _0x81cf=['undefined','limit','set','Content-Range','update','then','destroy','stack','name','send','index','FaxInteraction','rawAttributes','fieldName','type','key','fax','query','user','show','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','catch','create','body','find','params','describe','addMessage','FaxMessage','ids','findOne','hasOwnProperty','nolimit','order','sort','pick','where','map','$gte','split','count','findAll','rows','addTags','setTags','omit','spread','Tag','color','faxInteractionTags:save','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','push','Attachment','createdAt','get','mkdirSync','Messages','basename','existsSync','createReadStream','createWriteStream','resolve','log','err','unlinkSync','rimraf','moment','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','end','status','json','offset'];(function(_0x41a3af,_0x35694d){var _0x2075ec=function(_0x36dffb){while(--_0x36dffb){_0x41a3af['push'](_0x41a3af['shift']());}};_0x2075ec(++_0x35694d);}(_0x81cf,0x1f0));var _0xf81c=function(_0x423edc,_0x1ec185){_0x423edc=_0x423edc-0x0;var _0x3d6101=_0x81cf[_0x423edc];return _0x3d6101;};'use strict';var rimraf=require(_0xf81c('0x0'));var zipdir=require('zip-dir');var moment=require(_0xf81c('0x1'));var BPromise=require('bluebird');var util=require(_0xf81c('0x2'));var path=require(_0xf81c('0x3'));var fs=require('fs');var _=require(_0xf81c('0x4'));var Redis=require(_0xf81c('0x5'));var interaction=require(_0xf81c('0x6'));var qs=require(_0xf81c('0x7'));var logger=require(_0xf81c('0x8'))('api');var config=require(_0xf81c('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf81c('0xa')](config['redis'],{'host':_0xf81c('0xb'),'port':0x18eb});var socket=require(_0xf81c('0xc'))(new Redis(config['redis']));require(_0xf81c('0xd'))['register'](socket);function respondWithStatusCode(_0x21a2b6,_0x5ae3db){_0x5ae3db=_0x5ae3db||0xcc;return function(_0x1fafb6){if(_0x1fafb6){return _0x21a2b6[_0xf81c('0xe')](_0x5ae3db);}return _0x21a2b6['status'](_0x5ae3db)[_0xf81c('0xf')]();};}function respondWithResult(_0x2adebb,_0x59ee9b){_0x59ee9b=_0x59ee9b||0xc8;return function(_0x40230b){if(_0x40230b){return _0x2adebb[_0xf81c('0x10')](_0x59ee9b)[_0xf81c('0x11')](_0x40230b);}};}function respondWithFilteredResult(_0x3470f0,_0x32e454){return function(_0x4756dd){if(_0x4756dd){var _0x594d4d=typeof _0x32e454[_0xf81c('0x12')]===_0xf81c('0x13')&&typeof _0x32e454[_0xf81c('0x14')]===_0xf81c('0x13');var _0x22ce73=_0x4756dd['count'];var _0x5528d5=_0x594d4d?0x0:_0x32e454[_0xf81c('0x12')];var _0x72f842=_0x594d4d?_0x4756dd['count']:_0x32e454[_0xf81c('0x12')]+_0x32e454[_0xf81c('0x14')];var _0x2ca4e2;if(_0x72f842>=_0x22ce73){_0x72f842=_0x22ce73;_0x2ca4e2=0xc8;}else{_0x2ca4e2=0xce;}_0x3470f0[_0xf81c('0x10')](_0x2ca4e2);return _0x3470f0[_0xf81c('0x15')](_0xf81c('0x16'),_0x5528d5+'-'+_0x72f842+'/'+_0x22ce73)[_0xf81c('0x11')](_0x4756dd);}return null;};}function saveUpdates(_0x2b339c){return function(_0x1fe6ad){if(_0x1fe6ad){return _0x1fe6ad[_0xf81c('0x17')](_0x2b339c)[_0xf81c('0x18')](function(_0x34f2a5){return _0x34f2a5;});}return null;};}function removeEntity(_0x2ce548){return function(_0x4dffa0){if(_0x4dffa0){return _0x4dffa0[_0xf81c('0x19')]()['then'](function(){_0x2ce548[_0xf81c('0x10')](0xcc)[_0xf81c('0xf')]();});}};}function handleEntityNotFound(_0x18df54){return function(_0x5aee2b){if(!_0x5aee2b){_0x18df54[_0xf81c('0xe')](0x194);}return _0x5aee2b;};}function handleError(_0x12eb16,_0x2f3b2f){_0x2f3b2f=_0x2f3b2f||0x1f4;return function(_0x4904ab){logger['error'](_0x4904ab[_0xf81c('0x1a')]);if(_0x4904ab[_0xf81c('0x1b')]){delete _0x4904ab[_0xf81c('0x1b')];}_0x12eb16[_0xf81c('0x10')](_0x2f3b2f)[_0xf81c('0x1c')](_0x4904ab);};}exports[_0xf81c('0x1d')]=function(_0x115265,_0x16dacd){var _0x270aaa={};var _0x207251=_['map'](db[_0xf81c('0x1e')][_0xf81c('0x1f')],function(_0x2438f4){return{'name':_0x2438f4[_0xf81c('0x20')],'type':_0x2438f4[_0xf81c('0x21')][_0xf81c('0x22')]};});_0x270aaa=qs['getOptions'](_0x207251,_0x115265);return interaction['findAll'](_0xf81c('0x23'),_0x115265[_0xf81c('0x24')],_0x115265[_0xf81c('0x25')],_0x270aaa,_0x207251)[_0xf81c('0x18')](respondWithFilteredResult(_0x16dacd,_0x270aaa))['catch'](handleError(_0x16dacd,null));};exports[_0xf81c('0x26')]=function(_0x5e0996,_0x118190){var _0x391501={'raw':![],'where':{'id':_0x5e0996['params']['id']}},_0x382a3b={};_0x382a3b[_0xf81c('0x27')]=_[_0xf81c('0x28')](db['FaxInteraction'][_0xf81c('0x1f')]);_0x382a3b['query']=_[_0xf81c('0x28')](_0x5e0996[_0xf81c('0x24')]);_0x382a3b[_0xf81c('0x29')]=_[_0xf81c('0x2a')](_0x382a3b[_0xf81c('0x27')],_0x382a3b['query']);_0x391501[_0xf81c('0x2b')]=_['intersection'](_0x382a3b[_0xf81c('0x27')],qs[_0xf81c('0x2c')](_0x5e0996[_0xf81c('0x24')][_0xf81c('0x2c')]));_0x391501[_0xf81c('0x2b')]=_0x391501[_0xf81c('0x2b')][_0xf81c('0x2d')]?_0x391501[_0xf81c('0x2b')]:_0x382a3b[_0xf81c('0x27')];if(_0x5e0996[_0xf81c('0x24')][_0xf81c('0x2e')]){_0x391501[_0xf81c('0x2f')]=[{'all':!![]}];}_0x391501=_[_0xf81c('0x30')]({},_0x391501,_0x5e0996[_0xf81c('0x31')]);return db[_0xf81c('0x1e')]['find'](_0x391501)[_0xf81c('0x18')](handleEntityNotFound(_0x118190,null))[_0xf81c('0x18')](respondWithResult(_0x118190,null))[_0xf81c('0x32')](handleError(_0x118190,null));};exports[_0xf81c('0x33')]=function(_0x40b77c,_0x37ced1){return db[_0xf81c('0x1e')][_0xf81c('0x33')](_0x40b77c[_0xf81c('0x34')],{})[_0xf81c('0x18')](respondWithResult(_0x37ced1,0xc9))[_0xf81c('0x32')](handleError(_0x37ced1,null));};exports['update']=function(_0x1663af,_0x19b56f){if(_0x1663af['body']['id']){delete _0x1663af[_0xf81c('0x34')]['id'];}return db['FaxInteraction'][_0xf81c('0x35')]({'where':{'id':_0x1663af[_0xf81c('0x36')]['id']}})[_0xf81c('0x18')](handleEntityNotFound(_0x19b56f,null))[_0xf81c('0x18')](saveUpdates(_0x1663af[_0xf81c('0x34')],null))[_0xf81c('0x18')](respondWithResult(_0x19b56f,null))[_0xf81c('0x32')](handleError(_0x19b56f,null));};exports['destroy']=function(_0x2afdf2,_0x58eebe){return db['FaxInteraction'][_0xf81c('0x35')]({'where':{'id':_0x2afdf2[_0xf81c('0x36')]['id']}})[_0xf81c('0x18')](handleEntityNotFound(_0x58eebe,null))[_0xf81c('0x18')](removeEntity(_0x58eebe,null))[_0xf81c('0x32')](handleError(_0x58eebe,null));};exports[_0xf81c('0x37')]=function(_0x14b1a5,_0x5eb873){return db[_0xf81c('0x1e')][_0xf81c('0x37')]()[_0xf81c('0x18')](respondWithResult(_0x5eb873,null))[_0xf81c('0x32')](handleError(_0x5eb873,null));};exports[_0xf81c('0x38')]=function(_0x5c7111,_0x4e6953){return db[_0xf81c('0x39')]['find']({'where':{'id':_0x5c7111[_0xf81c('0x36')]['id']}})['then'](handleEntityNotFound(_0x4e6953,null))[_0xf81c('0x18')](function(_0x54fff7){if(_0x54fff7){return _0x54fff7[_0xf81c('0x38')](_0x5c7111[_0xf81c('0x34')][_0xf81c('0x3a')],_['omit'](_0x5c7111[_0xf81c('0x34')],['ids','id'])||{});}})[_0xf81c('0x18')](respondWithResult(_0x4e6953,null))[_0xf81c('0x32')](handleError(_0x4e6953,null));};exports['getMessages']=function(_0x395ea3,_0xb7a94c){var _0x12c6c7={'raw':![],'where':{}};var _0x4e58b5={};var _0xb8b846={'count':0x0,'rows':[]};return db[_0xf81c('0x1e')][_0xf81c('0x3b')]({'where':{'id':_0x395ea3['params']['id']}})['then'](handleEntityNotFound(_0xb7a94c,null))['then'](function(_0x3cb87e){if(_0x3cb87e){_0x4e58b5[_0xf81c('0x27')]=_[_0xf81c('0x28')](db[_0xf81c('0x39')][_0xf81c('0x1f')]);_0x4e58b5['query']=_[_0xf81c('0x28')](_0x395ea3[_0xf81c('0x24')]);_0x4e58b5[_0xf81c('0x29')]=_[_0xf81c('0x2a')](_0x4e58b5[_0xf81c('0x27')],_0x4e58b5[_0xf81c('0x24')]);_0x12c6c7[_0xf81c('0x2b')]=_[_0xf81c('0x2a')](_0x4e58b5[_0xf81c('0x27')],qs['fields'](_0x395ea3[_0xf81c('0x24')][_0xf81c('0x2c')]));_0x12c6c7[_0xf81c('0x2b')]=_0x12c6c7[_0xf81c('0x2b')][_0xf81c('0x2d')]?_0x12c6c7[_0xf81c('0x2b')]:_0x4e58b5[_0xf81c('0x27')];if(!_0x395ea3[_0xf81c('0x24')][_0xf81c('0x3c')](_0xf81c('0x3d'))){_0x12c6c7[_0xf81c('0x14')]=qs[_0xf81c('0x14')](_0x395ea3[_0xf81c('0x24')][_0xf81c('0x14')]);_0x12c6c7[_0xf81c('0x12')]=qs[_0xf81c('0x12')](_0x395ea3[_0xf81c('0x24')][_0xf81c('0x12')]);}_0x12c6c7[_0xf81c('0x3e')]=qs[_0xf81c('0x3f')](_0x395ea3[_0xf81c('0x24')][_0xf81c('0x3f')]);_0x12c6c7['where']=qs[_0xf81c('0x29')](_[_0xf81c('0x40')](_0x395ea3[_0xf81c('0x24')],_0x4e58b5[_0xf81c('0x29')]));_0x12c6c7['where']['FaxInteractionId']=_0x3cb87e['id'];if(_0x395ea3['query']['filter']){_0x12c6c7[_0xf81c('0x41')]=_[_0xf81c('0x30')](_0x12c6c7[_0xf81c('0x41')],{'$or':_[_0xf81c('0x42')](_0x12c6c7[_0xf81c('0x2b')],function(_0x45d1dd){var _0x3fac6e={};_0x3fac6e[_0x45d1dd]={'$like':'%'+_0x395ea3[_0xf81c('0x24')]['filter']+'%'};return _0x3fac6e;})});}if(_0x395ea3[_0xf81c('0x24')]['$gte']){var _0x283b00=_0x395ea3[_0xf81c('0x24')][_0xf81c('0x43')][_0xf81c('0x44')](',');var _0x54f0b9={};_0x54f0b9[_0x283b00[0x0]]={'$gte':moment(_0x283b00[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x12c6c7[_0xf81c('0x41')]=_[_0xf81c('0x30')](_0x12c6c7['where'],_0x54f0b9);}_0x12c6c7=_[_0xf81c('0x30')]({},_0x12c6c7,_0x395ea3['options']);return db[_0xf81c('0x39')][_0xf81c('0x45')]({'where':_0x12c6c7[_0xf81c('0x41')]})['then'](function(_0x8814af){_0xb8b846['count']=_0x8814af;if(_0x395ea3[_0xf81c('0x24')]['includeAll']){_0x12c6c7[_0xf81c('0x2f')]=[{'all':!![]}];}return db[_0xf81c('0x39')][_0xf81c('0x46')](_0x12c6c7);})[_0xf81c('0x18')](function(_0x1bcf6a){_0xb8b846[_0xf81c('0x47')]=_0x1bcf6a;return _0xb8b846;});}})[_0xf81c('0x18')](respondWithFilteredResult(_0xb7a94c,_0x12c6c7))[_0xf81c('0x32')](handleError(_0xb7a94c,null));};exports[_0xf81c('0x48')]=function(_0x3b7a9f,_0x44dadd){return db[_0xf81c('0x1e')][_0xf81c('0x35')]({'where':{'id':_0x3b7a9f[_0xf81c('0x36')]['id']}})[_0xf81c('0x18')](handleEntityNotFound(_0x44dadd,null))[_0xf81c('0x18')](function(_0x277598){if(_0x277598){return _0x277598[_0xf81c('0x49')](_0x3b7a9f[_0xf81c('0x34')][_0xf81c('0x3a')],_[_0xf81c('0x4a')](_0x3b7a9f[_0xf81c('0x34')],[_0xf81c('0x3a'),'id'])||{})[_0xf81c('0x4b')](function(){return db[_0xf81c('0x4c')]['findAll']({'attributes':['id',_0xf81c('0x1b'),_0xf81c('0x4d')],'where':{'id':_0x3b7a9f['body'][_0xf81c('0x3a')]}});})[_0xf81c('0x18')](function(_0x27abee){socket['emit'](_0xf81c('0x4e'),{'id':Number(_0x3b7a9f[_0xf81c('0x36')]['id']),'tags':_0x27abee||[]});return{'id':Number(_0x3b7a9f[_0xf81c('0x36')]['id']),'tags':_0x27abee||[]};});}})[_0xf81c('0x18')](respondWithResult(_0x44dadd,null))['catch'](handleError(_0x44dadd,null));};exports['removeTags']=function(_0x28d028,_0x211524){return db[_0xf81c('0x1e')][_0xf81c('0x35')]({'where':{'id':_0x28d028[_0xf81c('0x36')]['id']}})[_0xf81c('0x18')](handleEntityNotFound(_0x211524,null))[_0xf81c('0x18')](function(_0x2a39a6){if(_0x2a39a6){return _0x2a39a6['removeTags'](_0x28d028['query'][_0xf81c('0x3a')]);}})[_0xf81c('0x18')](respondWithStatusCode(_0x211524,null))[_0xf81c('0x32')](handleError(_0x211524,null));};exports[_0xf81c('0x4f')]=function(_0x1a2150,_0xf8b5db){var _0x565dd1=moment()[_0xf81c('0x50')]()['toString']();var _0x8272ed=path[_0xf81c('0x51')](config[_0xf81c('0x52')],_0xf81c('0x53'),_0xf81c('0x54'),_0xf81c('0x55'));var _0x20daca=path[_0xf81c('0x51')](config['root'],_0xf81c('0x53'),_0xf81c('0x54'),_0xf81c('0x56'));var _0x132ae8=path[_0xf81c('0x51')](_0x8272ed,_0x565dd1);var _0x52ecd0=util[_0xf81c('0x57')](_0xf81c('0x58'),_0x1a2150[_0xf81c('0x36')]['id'],_0x565dd1);var _0x29701e=path['join'](_0x8272ed,_0x52ecd0);var _0x4d5854=[];_0x4d5854[_0xf81c('0x59')]({'model':db[_0xf81c('0x5a')],'as':_0xf81c('0x5a'),'raw':!![]});var _0x222300=[{'model':db[_0xf81c('0x39')],'as':'Messages','attributes':['id',_0xf81c('0x34'),_0xf81c('0x5b')],'include':_0x4d5854}];return db['FaxInteraction'][_0xf81c('0x35')]({'where':{'id':_0x1a2150[_0xf81c('0x36')]['id']},'include':_0x222300})[_0xf81c('0x18')](handleEntityNotFound(_0xf8b5db,null))[_0xf81c('0x18')](function(_0x2df6fb){if(_0x2df6fb&&_0x2df6fb['Messages']){var _0x114765=_0x2df6fb[_0xf81c('0x5c')]({'plain':!![]});fs[_0xf81c('0x5d')](_0x132ae8);for(var _0x675e9a=0x0;_0x675e9a<_0x114765[_0xf81c('0x5e')][_0xf81c('0x2d')];_0x675e9a++){var _0x44b7ae=_0x114765['Messages'][_0x675e9a][_0xf81c('0x5a')];if(_0x44b7ae){var _0x5a6af8=path[_0xf81c('0x51')](_0x20daca,_0x44b7ae[_0xf81c('0x5f')]);if(fs[_0xf81c('0x60')](_0x5a6af8)){fs[_0xf81c('0x61')](_0x5a6af8)['pipe'](fs[_0xf81c('0x62')](path[_0xf81c('0x51')](_0x132ae8,_0x44b7ae[_0xf81c('0x5f')])));}}}return BPromise[_0xf81c('0x63')]()['then'](function(){return new BPromise(function(_0x575de5,_0x2d6e4d){zipdir(_0x132ae8,{'saveTo':_0x29701e},function(_0x190e23,_0x3146c7){if(_0x190e23)return _0x2d6e4d(_0x190e23);return _0x575de5(_0x3146c7);});})['then'](function(){return new BPromise(function(_0x414a75,_0x3dccdc){rimraf(_0x132ae8,function(_0xbf6e96){if(_0xbf6e96)_0x3dccdc(_0xbf6e96);return _0x414a75();});});})[_0xf81c('0x18')](function(){return _0xf8b5db[_0xf81c('0x4f')](_0x29701e,_0x52ecd0,function(_0x29159b){if(_0x29159b){console[_0xf81c('0x64')](_0xf81c('0x65'),_0x29159b);}else{fs[_0xf81c('0x66')](_0x29701e);}});});});}else{return _0xf8b5db[_0xf81c('0xe')](0xc8);}})[_0xf81c('0x32')](handleError(_0xf8b5db,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index c5b6565..a19a6dc 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 _0x5837=['save','update','remove','getUsers','then','setDataValue','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners'];(function(_0x56dcc7,_0x4f3a6e){var _0x5b2efe=function(_0x467a4d){while(--_0x467a4d){_0x56dcc7['push'](_0x56dcc7['shift']());}};_0x5b2efe(++_0x4f3a6e);}(_0x5837,0xfb));var _0x7583=function(_0x20ae3b,_0x23a21c){_0x20ae3b=_0x20ae3b-0x0;var _0x391475=_0x5837[_0x20ae3b];return _0x391475;};'use strict';var EventEmitter=require(_0x7583('0x0'));var FaxInteraction=require(_0x7583('0x1'))['db'][_0x7583('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x7583('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x7583('0x4')](0x0);var events={'afterCreate':_0x7583('0x5'),'afterUpdate':_0x7583('0x6'),'afterDestroy':_0x7583('0x7')};function emitEvent(_0xd33f16){return function(_0x4a4346,_0x56ee33,_0x51fa63){_0x4a4346[_0x7583('0x8')]({'attributes':['id'],'raw':!![]})[_0x7583('0x9')](function(_0x534ea6){_0x4a4346[_0x7583('0xa')]('Users',_0x534ea6['map'](function(_0x871092){return{'id':_0x871092['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x4a4346['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7583('0x9')](function(_0x19967){_0x4a4346[_0x7583('0xa')]('unreadMessages',_0x19967[_0x7583('0xb')]);FaxInteractionEvents[_0x7583('0xc')](_0xd33f16+':'+_0x4a4346['id'],_0x4a4346);FaxInteractionEvents['emit'](_0xd33f16,_0x4a4346);_0x51fa63(null);})['catch'](_0x51fa63(null));};}for(var e in events){if(events[_0x7583('0xd')](e)){var event=events[e];FaxInteraction[_0x7583('0xe')](e,emitEvent(event));}}module[_0x7583('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x30ab=['unreadMessages','emit','hasOwnProperty','events','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','map','setDataValue'];(function(_0x13c82f,_0x353a63){var _0x117e17=function(_0xeeabe7){while(--_0xeeabe7){_0x13c82f['push'](_0x13c82f['shift']());}};_0x117e17(++_0x353a63);}(_0x30ab,0x6b));var _0xb30a=function(_0x6b0702,_0x1e459f){_0x6b0702=_0x6b0702-0x0;var _0x126c0f=_0x30ab[_0x6b0702];return _0x126c0f;};'use strict';var EventEmitter=require(_0xb30a('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0xb30a('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xb30a('0x2')](0x0);var events={'afterCreate':_0xb30a('0x3'),'afterUpdate':_0xb30a('0x4'),'afterDestroy':_0xb30a('0x5')};function emitEvent(_0x29dccf){return function(_0x4669e5,_0x15937d,_0x1de920){_0x4669e5[_0xb30a('0x6')]({'attributes':['id'],'raw':!![]})[_0xb30a('0x7')](function(_0x228a33){_0x4669e5['setDataValue']('Users',_0x228a33[_0xb30a('0x8')](function(_0x101789){return{'id':_0x101789['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x4669e5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb30a('0x7')](function(_0x24f277){_0x4669e5[_0xb30a('0x9')](_0xb30a('0xa'),_0x24f277['length']);FaxInteractionEvents[_0xb30a('0xb')](_0x29dccf+':'+_0x4669e5['id'],_0x4669e5);FaxInteractionEvents[_0xb30a('0xb')](_0x29dccf,_0x4669e5);_0x1de920(null);})['catch'](_0x1de920(null));};}for(var e in events){if(events[_0xb30a('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index af0fb8d..14f97ba 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 _0xaac4=['bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','changed','closed','closedAt','format','lodash','util','api','moment'];(function(_0x13a665,_0x186a96){var _0x7b9d21=function(_0x5e4aa9){while(--_0x5e4aa9){_0x13a665['push'](_0x13a665['shift']());}};_0x7b9d21(++_0x186a96);}(_0xaac4,0x6c));var _0x4aac=function(_0x56989c,_0x6781f0){_0x56989c=_0x56989c-0x0;var _0x22ab27=_0xaac4[_0x56989c];return _0x22ab27;};'use strict';var _=require(_0x4aac('0x0'));var util=require(_0x4aac('0x1'));var logger=require('../../config/logger')(_0x4aac('0x2'));var moment=require(_0x4aac('0x3'));var BPromise=require(_0x4aac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4aac('0x5'));var rimraf=require(_0x4aac('0x6'));var config=require(_0x4aac('0x7'));var attributes=require(_0x4aac('0x8'));module[_0x4aac('0x9')]=function(_0x4c94f2,_0x2d795c){return _0x4c94f2[_0x4aac('0xa')](_0x4aac('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x645ec6,_0x59735a,_0x3ba0ea){if(_0x645ec6[_0x4aac('0xc')](_0x4aac('0xd'))){_0x645ec6[_0x4aac('0xe')]=moment()[_0x4aac('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3ba0ea(null,_0x645ec6);}}});}; \ No newline at end of file +var _0x3551=['changed','closed','closedAt','format','util','../../config/logger','moment','bluebird','path','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3551,0x1b7));var _0x1355=function(_0x47ee23,_0x58aad2){_0x47ee23=_0x47ee23-0x0;var _0x5b4718=_0x3551[_0x47ee23];return _0x5b4718;};'use strict';var _=require('lodash');var util=require(_0x1355('0x0'));var logger=require(_0x1355('0x1'))('api');var moment=require(_0x1355('0x2'));var BPromise=require(_0x1355('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1355('0x4'));var rimraf=require('rimraf');var config=require(_0x1355('0x5'));var attributes=require(_0x1355('0x6'));module[_0x1355('0x7')]=function(_0x482344,_0x16bd61){return _0x482344[_0x1355('0x8')](_0x1355('0x9'),attributes,{'tableName':_0x1355('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52a3be,_0x428c6e,_0x58f93e){if(_0x52a3be[_0x1355('0xb')](_0x1355('0xc'))){_0x52a3be[_0x1355('0xd')]=moment()[_0x1355('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x58f93e(null,_0x52a3be);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 412f341..30c9466 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 _0x97f5=['FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','limit','debug','AddTagsToFaxInteraction','find','addTags','ids','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','localhost','socket.io-emitter','redis','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0x97f5,0xa9));var _0x597f=function(_0x2366a8,_0x5a7a4e){_0x2366a8=_0x2366a8-0x0;var _0x585285=_0x97f5[_0x2366a8];return _0x585285;};'use strict';var _=require('lodash');var util=require(_0x597f('0x0'));var moment=require('moment');var BPromise=require(_0x597f('0x1'));var rs=require(_0x597f('0x2'));var fs=require('fs');var Redis=require(_0x597f('0x3'));var db=require(_0x597f('0x4'))['db'];var utils=require(_0x597f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x597f('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x597f('0x7'),'port':0x18eb});var socket=require(_0x597f('0x8'))(new Redis(config[_0x597f('0x9')]));require(_0x597f('0xa'))[_0x597f('0xb')](socket);function respondWithRpcPromise(_0x2ae89d,_0x39bff9,_0x143b4e){return new BPromise(function(_0x253315,_0x50154e){return client[_0x597f('0xc')](_0x2ae89d,_0x143b4e)['then'](function(_0x6ff51d){logger[_0x597f('0xd')](_0x597f('0xe'),_0x39bff9,_0x597f('0xf'));logger['debug'](_0x597f('0x10'),_0x39bff9,'request\x20sent',JSON[_0x597f('0x11')](_0x6ff51d));if(_0x6ff51d[_0x597f('0x12')]){if(_0x6ff51d[_0x597f('0x12')]['code']===0x1f4){logger[_0x597f('0x12')](_0x597f('0xe'),_0x39bff9,_0x6ff51d['error'][_0x597f('0x13')]);return _0x50154e(_0x6ff51d[_0x597f('0x12')][_0x597f('0x13')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x39bff9,_0x6ff51d[_0x597f('0x12')][_0x597f('0x13')]);return _0x253315(_0x6ff51d[_0x597f('0x12')][_0x597f('0x13')]);}else{logger['info'](_0x597f('0xe'),_0x39bff9,_0x597f('0xf'));_0x253315(_0x6ff51d[_0x597f('0x14')][_0x597f('0x13')]);}})[_0x597f('0x15')](function(_0x460402){logger[_0x597f('0x12')](_0x597f('0xe'),_0x39bff9,_0x460402);_0x50154e(_0x460402);});});}exports[_0x597f('0x16')]=function(_0x8a6554){var _0x4d0f8d=this;return new Promise(function(_0xc93d67,_0x16bc6c){return db[_0x597f('0x17')][_0x597f('0x18')](_0x8a6554[_0x597f('0x19')],{'raw':_0x8a6554[_0x597f('0x1a')]?_0x8a6554[_0x597f('0x1a')][_0x597f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8a6554[_0x597f('0x1a')]?_0x8a6554[_0x597f('0x1a')][_0x597f('0x1c')]||null:null,'attributes':_0x8a6554[_0x597f('0x1a')]?_0x8a6554[_0x597f('0x1a')]['attributes']||null:null,'limit':_0x8a6554[_0x597f('0x1a')]?_0x8a6554[_0x597f('0x1a')][_0x597f('0x1d')]||null:null})['then'](function(_0x57fc80){logger['info'](_0x597f('0x16'),_0x8a6554);logger[_0x597f('0x1e')](_0x597f('0x16'),_0x8a6554,JSON[_0x597f('0x11')](_0x57fc80));_0xc93d67(_0x57fc80);})[_0x597f('0x15')](function(_0x27bf0f){logger[_0x597f('0x12')](_0x597f('0x16'),_0x27bf0f[_0x597f('0x13')],_0x8a6554);_0x16bc6c(_0x4d0f8d[_0x597f('0x12')](0x1f4,_0x27bf0f[_0x597f('0x13')]));});});};exports[_0x597f('0x1f')]=function(_0x51ea2c){return new Promise(function(_0x25ee9c,_0x4cb1df){return db[_0x597f('0x17')][_0x597f('0x20')]({'where':_0x51ea2c[_0x597f('0x1a')]?_0x51ea2c['options'][_0x597f('0x1c')]||null:null})['then'](function(_0x5ac804){if(_0x5ac804){return _0x5ac804[_0x597f('0x21')](_0x51ea2c[_0x597f('0x19')][_0x597f('0x22')],_['omit'](_0x51ea2c[_0x597f('0x19')],['ids','id'])||{});}})[_0x597f('0x23')](function(_0x28f92d){logger[_0x597f('0xd')]('AddTags',_0x51ea2c);logger[_0x597f('0x1e')](_0x597f('0x24'),_0x51ea2c,JSON[_0x597f('0x11')](_0x28f92d));_0x25ee9c(_0x28f92d);})['catch'](function(_0x5cda7c){logger[_0x597f('0x12')](_0x597f('0x24'),_0x5cda7c['message'],_0x51ea2c);_0x4cb1df(_this[_0x597f('0x12')](0x1f4,_0x5cda7c[_0x597f('0x13')]));});});}; \ No newline at end of file +var _0x4299=['then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','debug','stringify','catch','addTags','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./faxInteraction.socket','register','request'];(function(_0x184119,_0x36ddde){var _0x51fbfd=function(_0x59ff5a){while(--_0x59ff5a){_0x184119['push'](_0x184119['shift']());}};_0x51fbfd(++_0x36ddde);}(_0x4299,0x1be));var _0x9429=function(_0x2a6243,_0x489287){_0x2a6243=_0x2a6243-0x0;var _0x5933ae=_0x4299[_0x2a6243];return _0x5933ae;};'use strict';var _=require('lodash');var util=require(_0x9429('0x0'));var moment=require(_0x9429('0x1'));var BPromise=require(_0x9429('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9429('0x3'));var db=require(_0x9429('0x4'))['db'];var utils=require(_0x9429('0x5'));var logger=require('../../config/logger')(_0x9429('0x6'));var config=require(_0x9429('0x7'));var jayson=require(_0x9429('0x8'));var client=jayson[_0x9429('0x9')]['http']({'port':0x232a});config['redis']=_[_0x9429('0xa')](config[_0x9429('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9429('0xc'))(new Redis(config['redis']));require(_0x9429('0xd'))[_0x9429('0xe')](socket);function respondWithRpcPromise(_0x558ac0,_0x15bfab,_0xe6255f){return new BPromise(function(_0x176fa0,_0x51ead5){return client[_0x9429('0xf')](_0x558ac0,_0xe6255f)[_0x9429('0x10')](function(_0x4fb2a8){logger[_0x9429('0x11')](_0x9429('0x12'),_0x15bfab,_0x9429('0x13'));logger['debug'](_0x9429('0x14'),_0x15bfab,'request\x20sent',JSON['stringify'](_0x4fb2a8));if(_0x4fb2a8[_0x9429('0x15')]){if(_0x4fb2a8[_0x9429('0x15')][_0x9429('0x16')]===0x1f4){logger[_0x9429('0x15')](_0x9429('0x12'),_0x15bfab,_0x4fb2a8[_0x9429('0x15')][_0x9429('0x17')]);return _0x51ead5(_0x4fb2a8['error']['message']);}logger[_0x9429('0x15')](_0x9429('0x12'),_0x15bfab,_0x4fb2a8['error'][_0x9429('0x17')]);return _0x176fa0(_0x4fb2a8[_0x9429('0x15')][_0x9429('0x17')]);}else{logger[_0x9429('0x11')](_0x9429('0x12'),_0x15bfab,_0x9429('0x13'));_0x176fa0(_0x4fb2a8[_0x9429('0x18')][_0x9429('0x17')]);}})['catch'](function(_0x3d4029){logger[_0x9429('0x15')](_0x9429('0x12'),_0x15bfab,_0x3d4029);_0x51ead5(_0x3d4029);});});}exports[_0x9429('0x19')]=function(_0x158e1c){var _0x4d47ed=this;return new Promise(function(_0x36ac1a,_0x2cee26){return db[_0x9429('0x1a')][_0x9429('0x1b')](_0x158e1c[_0x9429('0x1c')],{'raw':_0x158e1c[_0x9429('0x1d')]?_0x158e1c[_0x9429('0x1d')][_0x9429('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x158e1c[_0x9429('0x1d')]?_0x158e1c[_0x9429('0x1d')][_0x9429('0x1f')]||null:null,'attributes':_0x158e1c[_0x9429('0x1d')]?_0x158e1c[_0x9429('0x1d')][_0x9429('0x20')]||null:null,'limit':_0x158e1c[_0x9429('0x1d')]?_0x158e1c[_0x9429('0x1d')][_0x9429('0x21')]||null:null})[_0x9429('0x10')](function(_0x4a4774){logger[_0x9429('0x11')]('UpdateFaxInteraction',_0x158e1c);logger[_0x9429('0x22')](_0x9429('0x19'),_0x158e1c,JSON[_0x9429('0x23')](_0x4a4774));_0x36ac1a(_0x4a4774);})[_0x9429('0x24')](function(_0x537ae2){logger[_0x9429('0x15')](_0x9429('0x19'),_0x537ae2['message'],_0x158e1c);_0x2cee26(_0x4d47ed['error'](0x1f4,_0x537ae2[_0x9429('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x3ef833){return new Promise(function(_0x2f7752,_0x4dc9b9){return db[_0x9429('0x1a')]['find']({'where':_0x3ef833['options']?_0x3ef833[_0x9429('0x1d')]['where']||null:null})[_0x9429('0x10')](function(_0x5f1482){if(_0x5f1482){return _0x5f1482[_0x9429('0x25')](_0x3ef833[_0x9429('0x1c')][_0x9429('0x26')],_[_0x9429('0x27')](_0x3ef833['body'],[_0x9429('0x26'),'id'])||{});}})[_0x9429('0x28')](function(_0x6a07d3){logger['info'](_0x9429('0x29'),_0x3ef833);logger[_0x9429('0x22')](_0x9429('0x29'),_0x3ef833,JSON['stringify'](_0x6a07d3));_0x2f7752(_0x6a07d3);})[_0x9429('0x24')](function(_0x1056a0){logger['error']('AddTags',_0x1056a0['message'],_0x3ef833);_0x4dc9b9(_this[_0x9429('0x15')](0x1f4,_0x1056a0[_0x9429('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 3c94052..175d5a9 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 _0xf5f8=['remove','update','emit','removeListener','faxInteraction:','save'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xf5f8,0x8f));var _0x8f5f=function(_0x5adc03,_0x3716d0){_0x5adc03=_0x5adc03-0x0;var _0x41926c=_0xf5f8[_0x5adc03];return _0x41926c;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x8f5f('0x0'),_0x8f5f('0x1'),_0x8f5f('0x2')];function createListener(_0x3e590c,_0x46b770){return function(_0x579815){_0x46b770[_0x8f5f('0x3')](_0x3e590c,_0x579815);};}function removeListener(_0x2dfa37,_0x2373d2){return function(){FaxInteractionEvents[_0x8f5f('0x4')](_0x2dfa37,_0x2373d2);};}exports['register']=function(_0xb2f257){for(var _0x56ffd6=0x0,_0x1b3a59=events['length'];_0x56ffd6<_0x1b3a59;_0x56ffd6++){var _0x1e4337=events[_0x56ffd6];var _0x47bc56=createListener(_0x8f5f('0x5')+_0x1e4337,_0xb2f257);FaxInteractionEvents['on'](_0x1e4337,_0x47bc56);}}; \ No newline at end of file +var _0xef9f=['emit','faxInteraction:','save','remove','update'];(function(_0x56c3be,_0x589436){var _0x41a00e=function(_0x124112){while(--_0x124112){_0x56c3be['push'](_0x56c3be['shift']());}};_0x41a00e(++_0x589436);}(_0xef9f,0x1ce));var _0xfef9=function(_0x2ef4f7,_0x2dae03){_0x2ef4f7=_0x2ef4f7-0x0;var _0x1e5f65=_0xef9f[_0x2ef4f7];return _0x1e5f65;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xfef9('0x0'),_0xfef9('0x1'),_0xfef9('0x2')];function createListener(_0x52da45,_0xe8491f){return function(_0x2c9bb3){_0xe8491f[_0xfef9('0x3')](_0x52da45,_0x2c9bb3);};}function removeListener(_0xfd1c69,_0x1aea5a){return function(){FaxInteractionEvents['removeListener'](_0xfd1c69,_0x1aea5a);};}exports['register']=function(_0x50e247){for(var _0x2a65aa=0x0,_0x2fc0be=events['length'];_0x2a65aa<_0x2fc0be;_0x2a65aa++){var _0x23dec7=events[_0x2a65aa];var _0x5b8698=createListener(_0xfef9('0x4')+_0x23dec7,_0x50e247);FaxInteractionEvents['on'](_0x23dec7,_0x5b8698);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 89fc524..66aa10b 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 _0xf293=['tracked','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','post','create','addMessage','/:id/tags','fax','faxinteraction:addtags','put','faxinteraction:update','delete'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xf293,0xde));var _0x3f29=function(_0x3e7f8a,_0xce56ec){_0x3e7f8a=_0x3e7f8a-0x0;var _0x520088=_0xf293[_0x3e7f8a];return _0x520088;};'use strict';var multer=require(_0x3f29('0x0'));var util=require(_0x3f29('0x1'));var path=require(_0x3f29('0x2'));var timeout=require(_0x3f29('0x3'));var express=require(_0x3f29('0x4'));var router=express[_0x3f29('0x5')]();var fs_extra=require(_0x3f29('0x6'));var auth=require(_0x3f29('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3f29('0x8'));var controller=require('./faxInteraction.controller');router[_0x3f29('0x9')]('/',auth[_0x3f29('0xa')](),controller[_0x3f29('0xb')]);router['get'](_0x3f29('0xc'),auth['isAuthenticated'](),controller[_0x3f29('0xd')]);router[_0x3f29('0x9')](_0x3f29('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3f29('0x9')]('/:id/messages',auth[_0x3f29('0xa')](),controller[_0x3f29('0xf')]);router[_0x3f29('0x9')](_0x3f29('0x10'),auth[_0x3f29('0xa')](),controller['download']);router[_0x3f29('0x11')]('/',auth[_0x3f29('0xa')](),controller[_0x3f29('0x12')]);router[_0x3f29('0x11')]('/:id/messages',auth['isAuthenticated'](),controller[_0x3f29('0x13')]);router[_0x3f29('0x11')](_0x3f29('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0x3f29('0x15'),_0x3f29('0x16')),controller['addTags']);router[_0x3f29('0x17')]('/:id',auth[_0x3f29('0xa')](),interaction['tracked'](_0x3f29('0x15'),_0x3f29('0x18')),controller['update']);router[_0x3f29('0x19')]('/:id',auth[_0x3f29('0xa')](),interaction[_0x3f29('0x1a')]('fax',_0x3f29('0x1b')),controller[_0x3f29('0x1c')]);router[_0x3f29('0x19')](_0x3f29('0x14'),auth[_0x3f29('0xa')](),controller[_0x3f29('0x1d')]);module[_0x3f29('0x1e')]=router; \ No newline at end of file +var _0x78f4=['tracked','fax','faxinteraction:addtags','addTags','put','/:id','faxinteraction:destroy','destroy','/:id/tags','removeTags','exports','path','express','fs-extra','../../components/auth/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create'];(function(_0x36c8d1,_0x1063dc){var _0x181a0a=function(_0x42797c){while(--_0x42797c){_0x36c8d1['push'](_0x36c8d1['shift']());}};_0x181a0a(++_0x1063dc);}(_0x78f4,0x193));var _0x478f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78f4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x478f('0x0'));var timeout=require('connect-timeout');var express=require(_0x478f('0x1'));var router=express['Router']();var fs_extra=require(_0x478f('0x2'));var auth=require(_0x478f('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x478f('0x4'));router[_0x478f('0x5')]('/',auth[_0x478f('0x6')](),controller[_0x478f('0x7')]);router[_0x478f('0x5')](_0x478f('0x8'),auth['isAuthenticated'](),controller[_0x478f('0x9')]);router[_0x478f('0x5')]('/:id',auth[_0x478f('0x6')](),controller[_0x478f('0xa')]);router['get'](_0x478f('0xb'),auth[_0x478f('0x6')](),controller[_0x478f('0xc')]);router[_0x478f('0x5')](_0x478f('0xd'),auth[_0x478f('0x6')](),controller[_0x478f('0xe')]);router[_0x478f('0xf')]('/',auth['isAuthenticated'](),controller[_0x478f('0x10')]);router[_0x478f('0xf')](_0x478f('0xb'),auth[_0x478f('0x6')](),controller['addMessage']);router[_0x478f('0xf')]('/:id/tags',auth[_0x478f('0x6')](),interaction[_0x478f('0x11')](_0x478f('0x12'),_0x478f('0x13')),controller[_0x478f('0x14')]);router[_0x478f('0x15')](_0x478f('0x16'),auth[_0x478f('0x6')](),interaction[_0x478f('0x11')](_0x478f('0x12'),'faxinteraction:update'),controller['update']);router['delete'](_0x478f('0x16'),auth[_0x478f('0x6')](),interaction['tracked']('fax',_0x478f('0x17')),controller[_0x478f('0x18')]);router['delete'](_0x478f('0x19'),auth['isAuthenticated'](),controller[_0x478f('0x1a')]);module[_0x478f('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index bae8d14..13f29a9 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 _0x7a59=['sequelize','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x469eea,_0x5ea550){var _0x396f40=function(_0x592c7b){while(--_0x592c7b){_0x469eea['push'](_0x469eea['shift']());}};_0x396f40(++_0x5ea550);}(_0x7a59,0x16e));var _0x97a5=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x7a59[_0x45b034];return _0x509cb0;};'use strict';var Sequelize=require(_0x97a5('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x97a5('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x97a5('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x97a5('0x3')]('in',_0x97a5('0x4')),'defaultValue':_0x97a5('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x97a5('0x5')]}}; \ No newline at end of file +var _0xf72b=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x231dda,_0x5b04cc){var _0x3f88cb=function(_0x16eb77){while(--_0x16eb77){_0x231dda['push'](_0x231dda['shift']());}};_0x3f88cb(++_0x5b04cc);}(_0xf72b,0x1d9));var _0xbf72=function(_0x5502e2,_0x1a0723){_0x5502e2=_0x5502e2-0x0;var _0x2ce396=_0xf72b[_0x5502e2];return _0x2ce396;};'use strict';var Sequelize=require(_0xbf72('0x0'));module['exports']={'body':{'type':Sequelize[_0xbf72('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbf72('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbf72('0x3')]('in','out'),'defaultValue':_0xbf72('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xbf72('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xbf72('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 64f9614..14f7a0a 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 _0x51a0=['rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','fullname','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','Attachment','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','stack','name','send','FaxMessage','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','intersection','length','find','body','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','null','RejectMessage'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x51a0,0x1c9));var _0x051a=function(_0x489fe3,_0x5ebb81){_0x489fe3=_0x489fe3-0x0;var _0x592190=_0x51a0[_0x489fe3];return _0x592190;};'use strict';var emlformat=require(_0x051a('0x0'));var rimraf=require(_0x051a('0x1'));var zipdir=require(_0x051a('0x2'));var jsonpatch=require(_0x051a('0x3'));var rp=require(_0x051a('0x4'));var moment=require(_0x051a('0x5'));var BPromise=require(_0x051a('0x6'));var Mustache=require(_0x051a('0x7'));var util=require(_0x051a('0x8'));var path=require('path');var sox=require(_0x051a('0x9'));var csv=require(_0x051a('0xa'));var ejs=require(_0x051a('0xb'));var fs=require('fs');var fs_extra=require(_0x051a('0xc'));var _=require(_0x051a('0xd'));var squel=require('squel');var crypto=require(_0x051a('0xe'));var jsforce=require(_0x051a('0xf'));var deskjs=require(_0x051a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x051a('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x051a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x051a('0x13'));var hardwareService=require(_0x051a('0x14'));var logger=require(_0x051a('0x15'))(_0x051a('0x16'));var utils=require(_0x051a('0x17'));var config=require(_0x051a('0x18'));var licenseUtil=require(_0x051a('0x19'));var db=require(_0x051a('0x1a'))['db'];config[_0x051a('0x1b')]=_[_0x051a('0x1c')](config[_0x051a('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x051a('0x1b')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x051a('0x1d'));var client=jayson[_0x051a('0x1e')][_0x051a('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x125a59,_0x3248cd,_0x2ea802,_0x2bc4de){return new BPromise(function(_0x3b4dbf,_0x22a32a){var _0x749341=_0x2bc4de||client;return _0x749341[_0x051a('0x20')](_0x125a59,_0x2ea802)[_0x051a('0x21')](function(_0x202066){logger[_0x051a('0x22')](_0x051a('0x23'),_0x3248cd,_0x051a('0x24'));logger['debug'](_0x051a('0x25'),_0x3248cd,_0x051a('0x24'),JSON[_0x051a('0x26')](_0x202066));if(_0x202066[_0x051a('0x27')]){if(_0x202066[_0x051a('0x27')][_0x051a('0x28')]===0x1f4){logger[_0x051a('0x27')](_0x051a('0x23'),_0x3248cd,_0x202066['error'][_0x051a('0x29')]);return _0x22a32a(_0x202066[_0x051a('0x27')][_0x051a('0x29')]);}logger[_0x051a('0x27')]('FaxMessage,\x20%s,\x20%s',_0x3248cd,_0x202066[_0x051a('0x27')]['message']);return _0x3b4dbf(_0x202066['error'][_0x051a('0x29')]);}else{logger[_0x051a('0x22')](_0x051a('0x23'),_0x3248cd,'request\x20sent');_0x3b4dbf(_0x202066[_0x051a('0x2a')]['message']);}})[_0x051a('0x2b')](function(_0x51476d){logger[_0x051a('0x27')](_0x051a('0x23'),_0x3248cd,_0x51476d);_0x22a32a(_0x51476d);});});}function respondWithStatusCode(_0x230c03,_0x22c14b){_0x22c14b=_0x22c14b||0xcc;return function(_0x355c3c){if(_0x355c3c){return _0x230c03[_0x051a('0x2c')](_0x22c14b);}return _0x230c03['status'](_0x22c14b)[_0x051a('0x2d')]();};}function respondWithResult(_0x50d669,_0x45da2c){_0x45da2c=_0x45da2c||0xc8;return function(_0x3ad27f){if(_0x3ad27f){return _0x50d669[_0x051a('0x2e')](_0x45da2c)[_0x051a('0x2f')](_0x3ad27f);}};}function respondWithFilteredResult(_0x137e21,_0x36610d){return function(_0x4a9eeb){if(_0x4a9eeb){var _0x45eaa1=typeof _0x36610d[_0x051a('0x30')]===_0x051a('0x31')&&typeof _0x36610d[_0x051a('0x32')]===_0x051a('0x31');var _0x28cc51=_0x4a9eeb[_0x051a('0x33')];var _0x210cad=_0x45eaa1?0x0:_0x36610d[_0x051a('0x30')];var _0x3c9347=_0x45eaa1?_0x4a9eeb[_0x051a('0x33')]:_0x36610d[_0x051a('0x30')]+_0x36610d[_0x051a('0x32')];var _0x3f9ff1;if(_0x3c9347>=_0x28cc51){_0x3c9347=_0x28cc51;_0x3f9ff1=0xc8;}else{_0x3f9ff1=0xce;}_0x137e21[_0x051a('0x2e')](_0x3f9ff1);return _0x137e21[_0x051a('0x34')](_0x051a('0x35'),_0x210cad+'-'+_0x3c9347+'/'+_0x28cc51)[_0x051a('0x2f')](_0x4a9eeb);}return null;};}function patchUpdates(_0x2277b2){return function(_0x1d5a38){try{jsonpatch['apply'](_0x1d5a38,_0x2277b2,!![]);}catch(_0x3bed35){return BPromise[_0x051a('0x36')](_0x3bed35);}return _0x1d5a38['save']();};}function saveUpdates(_0x19c980,_0xa66177){return function(_0x3ff212){if(_0x3ff212){return _0x3ff212[_0x051a('0x37')](_0x19c980)[_0x051a('0x21')](function(_0x5caac6){return _0x5caac6;});}return null;};}function removeEntity(_0xe61bef,_0x57e5ca){return function(_0x500597){if(_0x500597){return _0x500597[_0x051a('0x38')]()[_0x051a('0x21')](function(){_0xe61bef['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dd6f8,_0x556a56){return function(_0x1c7214){if(!_0x1c7214){_0x2dd6f8[_0x051a('0x2c')](0x194);}return _0x1c7214;};}function handleError(_0x17567e,_0x38acc0){_0x38acc0=_0x38acc0||0x1f4;return function(_0x1f6f2b){logger[_0x051a('0x27')](_0x1f6f2b[_0x051a('0x39')]);if(_0x1f6f2b['name']){delete _0x1f6f2b[_0x051a('0x3a')];}_0x17567e[_0x051a('0x2e')](_0x38acc0)[_0x051a('0x3b')](_0x1f6f2b);};}exports['index']=function(_0x3e3dfb,_0x5bc044){var _0x28004b={},_0x4f9057={},_0x178129={'count':0x0,'rows':[]};var _0x1bbac2=_['map'](db[_0x051a('0x3c')][_0x051a('0x3d')],function(_0x4440d7){return{'name':_0x4440d7[_0x051a('0x3e')],'type':_0x4440d7[_0x051a('0x3f')][_0x051a('0x40')]};});_0x4f9057[_0x051a('0x41')]=_[_0x051a('0x42')](_0x1bbac2,_0x051a('0x3a'));_0x4f9057['query']=_[_0x051a('0x43')](_0x3e3dfb[_0x051a('0x44')]);_0x4f9057[_0x051a('0x45')]=_['intersection'](_0x4f9057[_0x051a('0x41')],_0x4f9057[_0x051a('0x44')]);_0x28004b[_0x051a('0x46')]=_['intersection'](_0x4f9057['model'],qs[_0x051a('0x47')](_0x3e3dfb[_0x051a('0x44')][_0x051a('0x47')]));_0x28004b[_0x051a('0x46')]=_0x28004b['attributes']['length']?_0x28004b[_0x051a('0x46')]:_0x4f9057[_0x051a('0x41')];if(!_0x3e3dfb['query'][_0x051a('0x48')](_0x051a('0x49'))){_0x28004b[_0x051a('0x32')]=qs[_0x051a('0x32')](_0x3e3dfb['query'][_0x051a('0x32')]);_0x28004b[_0x051a('0x30')]=qs[_0x051a('0x30')](_0x3e3dfb['query'][_0x051a('0x30')]);}_0x28004b[_0x051a('0x4a')]=qs[_0x051a('0x4b')](_0x3e3dfb[_0x051a('0x44')][_0x051a('0x4b')]);_0x28004b[_0x051a('0x4c')]=qs[_0x051a('0x45')](_[_0x051a('0x4d')](_0x3e3dfb['query'],_0x4f9057[_0x051a('0x45')]),_0x1bbac2);if(_0x3e3dfb[_0x051a('0x44')]['filter']){_0x28004b[_0x051a('0x4c')]=_['merge'](_0x28004b[_0x051a('0x4c')],{'$or':_[_0x051a('0x42')](_0x1bbac2,function(_0x3508cd){if(_0x3508cd[_0x051a('0x3f')]!==_0x051a('0x4e')){var _0x5ab697={};_0x5ab697[_0x3508cd[_0x051a('0x3a')]]={'$like':'%'+_0x3e3dfb[_0x051a('0x44')][_0x051a('0x4f')]+'%'};return _0x5ab697;}})});}_0x28004b=_[_0x051a('0x50')]({},_0x28004b,_0x3e3dfb[_0x051a('0x51')]);var _0x52f411={'where':_0x28004b[_0x051a('0x4c')]};return db['FaxMessage']['count'](_0x52f411)[_0x051a('0x21')](function(_0x346bb0){_0x178129[_0x051a('0x33')]=_0x346bb0;if(_0x3e3dfb[_0x051a('0x44')][_0x051a('0x52')]){_0x28004b[_0x051a('0x53')]=[{'all':!![]}];}return db['FaxMessage'][_0x051a('0x54')](_0x28004b);})[_0x051a('0x21')](function(_0x3be947){_0x178129['rows']=_0x3be947;return _0x178129;})[_0x051a('0x21')](respondWithFilteredResult(_0x5bc044,_0x28004b))[_0x051a('0x2b')](handleError(_0x5bc044,null));};exports['show']=function(_0x1ad4a6,_0x35cf8b){var _0x41dc95={'raw':!![],'where':{'id':_0x1ad4a6[_0x051a('0x55')]['id']}},_0x24a9b1={};_0x24a9b1['model']=_[_0x051a('0x43')](db[_0x051a('0x3c')][_0x051a('0x3d')]);_0x24a9b1[_0x051a('0x44')]=_[_0x051a('0x43')](_0x1ad4a6[_0x051a('0x44')]);_0x24a9b1[_0x051a('0x45')]=_[_0x051a('0x56')](_0x24a9b1[_0x051a('0x41')],_0x24a9b1[_0x051a('0x44')]);_0x41dc95[_0x051a('0x46')]=_[_0x051a('0x56')](_0x24a9b1[_0x051a('0x41')],qs[_0x051a('0x47')](_0x1ad4a6[_0x051a('0x44')][_0x051a('0x47')]));_0x41dc95[_0x051a('0x46')]=_0x41dc95[_0x051a('0x46')][_0x051a('0x57')]?_0x41dc95[_0x051a('0x46')]:_0x24a9b1[_0x051a('0x41')];if(_0x1ad4a6[_0x051a('0x44')]['includeAll']){_0x41dc95[_0x051a('0x53')]=[{'all':!![]}];}_0x41dc95=_['merge']({},_0x41dc95,_0x1ad4a6[_0x051a('0x51')]);return db[_0x051a('0x3c')][_0x051a('0x58')](_0x41dc95)['then'](handleEntityNotFound(_0x35cf8b,null))[_0x051a('0x21')](respondWithResult(_0x35cf8b,null))['catch'](handleError(_0x35cf8b,null));};exports[_0x051a('0x37')]=function(_0xe1b1e,_0x3ec5d8){if(_0xe1b1e['body']['id']){delete _0xe1b1e[_0x051a('0x59')]['id'];}return db[_0x051a('0x3c')][_0x051a('0x58')]({'where':{'id':_0xe1b1e[_0x051a('0x55')]['id']}})['then'](handleEntityNotFound(_0x3ec5d8,null))['then'](saveUpdates(_0xe1b1e['body'],null))[_0x051a('0x21')](respondWithResult(_0x3ec5d8,null))['catch'](handleError(_0x3ec5d8,null));};exports[_0x051a('0x38')]=function(_0x4034b5,_0x69ee62){return db['FaxMessage'][_0x051a('0x58')]({'where':{'id':_0x4034b5[_0x051a('0x55')]['id']}})[_0x051a('0x21')](handleEntityNotFound(_0x69ee62,null))[_0x051a('0x21')](removeEntity(_0x69ee62,null))[_0x051a('0x2b')](handleError(_0x69ee62,null));};exports[_0x051a('0x5a')]=function(_0x3cd464,_0x99d165){return db[_0x051a('0x3c')][_0x051a('0x5a')]()[_0x051a('0x21')](respondWithResult(_0x99d165,null))[_0x051a('0x2b')](handleError(_0x99d165,null));};var interaction_log=require(_0x051a('0x15'))(_0x051a('0x5b'));exports[_0x051a('0x5c')]=function(_0x32adf4,_0x551e1f,_0x682392){var _0x3e2ebd={'agent':{},'channel':_0x051a('0x5d')};if(_0x32adf4[_0x051a('0x59')]['id']){delete _0x32adf4[_0x051a('0x59')]['id'];}_0x32adf4[_0x051a('0x59')][_0x051a('0x5e')]=!![];_0x32adf4[_0x051a('0x59')]['readAt']=moment()[_0x051a('0x5f')](_0x051a('0x60'));_0x32adf4[_0x051a('0x59')][_0x051a('0x61')]=_0x32adf4[_0x051a('0x59')]['UserId']||_0x32adf4['user']['id'];_0x3e2ebd[_0x051a('0x62')]['id']=_0x32adf4['body'][_0x051a('0x61')];return db['FaxMessage'][_0x051a('0x58')]({'where':{'id':_0x32adf4[_0x051a('0x55')]['id'],'UserId':null}})[_0x051a('0x21')](handleEntityNotFound(_0x551e1f,null))[_0x051a('0x21')](saveUpdates(_0x32adf4[_0x051a('0x59')],null))[_0x051a('0x21')](function(_0x20eba2){if(_0x20eba2){_0x3e2ebd[_0x051a('0x29')]=_0x20eba2[_0x051a('0x63')]({'plain':!![]});return db[_0x051a('0x64')][_0x051a('0x58')]({'where':{'id':_0x20eba2[_0x051a('0x65')]}});}return null;})[_0x051a('0x21')](handleEntityNotFound(_0x551e1f,null))['then'](function(_0x5584fa){if(_0x5584fa){return _0x5584fa[_0x051a('0x37')]({'UserId':_0x32adf4[_0x051a('0x59')][_0x051a('0x61')],'read1stAt':_[_0x051a('0x66')](_0x5584fa[_0x051a('0x67')])?moment()['format'](_0x051a('0x60')):undefined});}return null;})['then'](function(_0x1614ce){if(_0x1614ce){_0x3e2ebd[_0x051a('0x68')]=_0x1614ce[_0x051a('0x63')]({'plain':!![]});interaction_log[_0x051a('0x22')](_0x051a('0x69'),_0x32adf4['user']['id'],_0x32adf4[_0x051a('0x6a')]['name'],_0x32adf4[_0x051a('0x6a')]['role'],_0x3e2ebd[_0x051a('0x68')]['id'],_0x32adf4[_0x051a('0x59')]?JSON[_0x051a('0x26')](_0x32adf4['body']):'null');return respondWithRpcPromise(_0x051a('0x6b'),_0x051a('0x6c'),_0x3e2ebd);}return null;})[_0x051a('0x21')](function(_0x5e1463){var _0x2d7dee='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e1463['message']['ContactId'];return db[_0x051a('0x6d')][_0x051a('0x44')](_0x2d7dee,{'type':db[_0x051a('0x6e')][_0x051a('0x6f')][_0x051a('0x70')],'raw':!![]})[_0x051a('0x21')](function(_0x3b8496){return _0x3b8496;});})['then'](function(_0x15b7e7){if(_0x15b7e7){_0x3e2ebd[_0x051a('0x29')][_0x051a('0x71')]=_0x15b7e7[0x0];if(!_0x32adf4['body'][_0x051a('0x61')])return;return db[_0x051a('0x72')]['find']({'where':{'id':_0x32adf4[_0x051a('0x59')][_0x051a('0x61')],'role':_0x051a('0x62')},'attributes':['id',_0x051a('0x3a'),'fullname',_0x051a('0x73'),_0x051a('0x74')],'raw':!![]});}return null;})['then'](function(_0x3440a8){if(!_0x3440a8)return null;_0x3e2ebd[_0x051a('0x29')][_0x051a('0x62')]=_0x3440a8;return _0x3e2ebd;})[_0x051a('0x21')](function(_0x192858){if(_0x192858){if(_0x32adf4[_0x051a('0x59')][_0x051a('0x75')]){_0x3e2ebd[_0x051a('0x29')][_0x051a('0x76')]=util[_0x051a('0x5f')](_0x051a('0x77'),_0x32adf4[_0x051a('0x6a')][_0x051a('0x3a')]);_0x3e2ebd[_0x051a('0x29')][_0x051a('0x78')]=_0x3e2ebd[_0x051a('0x78')];_0x3e2ebd[_0x051a('0x29')][_0x051a('0x79')]=_0x3e2ebd['channel'];_0x3e2ebd['message'][_0x051a('0x7a')]=_0x051a('0x5c');return respondWithRpcPromise(_0x051a('0x7b'),'EventManager',{'event':_0x051a('0x7c'),'message':_0x3e2ebd[_0x051a('0x29')]},client9002)[_0x051a('0x21')](function(){return _0x3e2ebd;});}return _0x3e2ebd;}return null;})[_0x051a('0x21')](respondWithResult(_0x551e1f,null))[_0x051a('0x2b')](handleError(_0x551e1f,null));};var interaction_log=require(_0x051a('0x15'))(_0x051a('0x5b'));exports['reject']=function(_0x2ab0bb,_0x1b6f62,_0x145ded){var _0x2df12e={'agent':{},'channel':_0x051a('0x5d')};if(_0x2ab0bb['body']['id']){delete _0x2ab0bb[_0x051a('0x59')]['id'];}_0x2ab0bb[_0x051a('0x59')][_0x051a('0x61')]=_0x2ab0bb[_0x051a('0x59')][_0x051a('0x61')]||_0x2ab0bb['user']['id'];_0x2df12e[_0x051a('0x62')]['id']=_0x2ab0bb['body'][_0x051a('0x61')];return db[_0x051a('0x3c')][_0x051a('0x58')]({'where':{'id':_0x2ab0bb['params']['id'],'UserId':null}})[_0x051a('0x21')](handleEntityNotFound(_0x1b6f62,null))[_0x051a('0x21')](function(_0x219af0){if(_0x219af0){_0x2df12e[_0x051a('0x29')]=_0x219af0['get']({'plain':!![]});return db[_0x051a('0x64')][_0x051a('0x58')]({'where':{'id':_0x219af0[_0x051a('0x65')]}});}return null;})[_0x051a('0x21')](handleEntityNotFound(_0x1b6f62,null))['then'](function(_0x34c070){if(_0x34c070){_0x2df12e[_0x051a('0x68')]=_0x34c070['get']({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2ab0bb['user']['id'],_0x2ab0bb[_0x051a('0x6a')][_0x051a('0x3a')],_0x2ab0bb[_0x051a('0x6a')]['role'],_0x2df12e['interaction']['id'],_0x2ab0bb['body']?JSON['stringify'](_0x2ab0bb['body']):_0x051a('0x7d'));return respondWithRpcPromise(_0x051a('0x7e'),_0x051a('0x7f'),_0x2df12e);}return null;})['then'](function(_0x509ae6){var _0x4ba75c=_0x051a('0x80')+_0x509ae6[_0x051a('0x29')][_0x051a('0x81')];return db[_0x051a('0x6d')]['query'](_0x4ba75c,{'type':db[_0x051a('0x6e')]['QueryTypes'][_0x051a('0x70')],'raw':!![]})[_0x051a('0x21')](function(_0x49dfc2){return _0x49dfc2;});})[_0x051a('0x21')](function(_0x1585ce){if(_0x1585ce){_0x2df12e[_0x051a('0x29')][_0x051a('0x71')]=_0x1585ce[0x0];if(!_0x2ab0bb['body']['UserId'])return;return db[_0x051a('0x72')]['find']({'where':{'id':_0x2ab0bb[_0x051a('0x59')][_0x051a('0x61')],'role':'agent'},'attributes':['id',_0x051a('0x3a'),_0x051a('0x82'),'email',_0x051a('0x74')],'raw':!![]});}return null;})[_0x051a('0x21')](function(_0x25637d){if(!_0x25637d)return null;_0x2df12e[_0x051a('0x29')]['agent']=_0x25637d;return _0x2df12e;})[_0x051a('0x21')](function(_0x53357c){if(_0x53357c){_0x53357c[_0x051a('0x29')]['interface']=util[_0x051a('0x5f')](_0x051a('0x77'),_0x2ab0bb['user'][_0x051a('0x3a')]);_0x53357c[_0x051a('0x29')]['channel']=_0x2df12e[_0x051a('0x78')];_0x53357c['message'][_0x051a('0x79')]=_0x2df12e[_0x051a('0x78')];_0x53357c[_0x051a('0x29')][_0x051a('0x7a')]=_0x051a('0x36');respondWithRpcPromise(_0x051a('0x7b'),'EventManager',{'event':'rejectmessage','message':_0x53357c['message']},client9002);return _0x2df12e;}return null;})[_0x051a('0x21')](respondWithResult(_0x1b6f62,null))['catch'](handleError(_0x1b6f62,null));};exports[_0x051a('0x83')]=function(_0x33664e,_0x4d07ee){var _0x7dd075;return db[_0x051a('0x3c')][_0x051a('0x83')](_0x33664e['body'],{})[_0x051a('0x21')](function(_0x46e566){_0x7dd075=_0x46e566;return db[_0x051a('0x84')][_0x051a('0x85')]({'where':{'id':_0x7dd075[_0x051a('0x81')]}});})['then'](function(_0x1e6271){if(_['isNil'](_0x1e6271)){return;}else{_0x7dd075['fax']=_0x1e6271[_0x051a('0x5d')];return db['Attachment'][_0x051a('0x85')]({'where':{'id':_0x7dd075[_0x051a('0x86')]}});}})[_0x051a('0x21')](function(_0x5094c4){return respondWithRpcPromise(_0x051a('0x87'),_0x051a('0x87'),{'FaxAccountId':_['isNil'](_0x33664e['body'])?undefined:_0x33664e[_0x051a('0x59')][_0x051a('0x88')],'path':_['isNil'](_0x5094c4)?undefined:util['format'](_0x051a('0x89'),_0x5094c4[_0x051a('0x8a')]),'fax':_[_0x051a('0x66')](_0x7dd075[_0x051a('0x5d')])?undefined:_0x7dd075['fax'],'AttachmentId':_0x7dd075['AttachmentId']},client9002);})[_0x051a('0x21')](respondWithResult(_0x4d07ee,0xc9))[_0x051a('0x2b')](handleError(_0x4d07ee,null));};exports[_0x051a('0x8b')]=function(_0x53f34b,_0x1be106){var _0x5a0ebe=path[_0x051a('0x8c')](config[_0x051a('0x8d')],_0x051a('0x8e'),_0x051a('0x8f'),_0x051a('0x90'));return db['FaxMessage'][_0x051a('0x58')]({'where':{'id':_0x53f34b[_0x051a('0x55')]['id']},'include':[{'model':db[_0x051a('0x91')],'as':_0x051a('0x91')}]})[_0x051a('0x21')](handleEntityNotFound(_0x1be106,null))[_0x051a('0x21')](function(_0x17c8fb){if(_0x17c8fb){return _0x1be106[_0x051a('0x8b')](path[_0x051a('0x8c')](_0x5a0ebe,_0x17c8fb[_0x051a('0x91')]['basename']));}})[_0x051a('0x2b')](handleError(_0x1be106,null));}; \ No newline at end of file +var _0x8be5=['rejectMessage','Sequelize','User','internal','SIP/%s','rejectmessage','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','files','attachments','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','name','send','index','FaxMessage','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','params','includeAll','include','find','body','fax-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteractionId','isNil','read1stAt','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','reject','fax','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x36f752,_0x4e6dc9){var _0x3722ca=function(_0x278b61){while(--_0x278b61){_0x36f752['push'](_0x36f752['shift']());}};_0x3722ca(++_0x4e6dc9);}(_0x8be5,0x1b0));var _0x58be=function(_0x4ae379,_0x28b775){_0x4ae379=_0x4ae379-0x0;var _0xaf6d85=_0x8be5[_0x4ae379];return _0xaf6d85;};'use strict';var emlformat=require(_0x58be('0x0'));var rimraf=require(_0x58be('0x1'));var zipdir=require(_0x58be('0x2'));var jsonpatch=require(_0x58be('0x3'));var rp=require(_0x58be('0x4'));var moment=require(_0x58be('0x5'));var BPromise=require(_0x58be('0x6'));var Mustache=require(_0x58be('0x7'));var util=require(_0x58be('0x8'));var path=require(_0x58be('0x9'));var sox=require('sox');var csv=require(_0x58be('0xa'));var ejs=require(_0x58be('0xb'));var fs=require('fs');var fs_extra=require(_0x58be('0xc'));var _=require(_0x58be('0xd'));var squel=require(_0x58be('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x58be('0xa'));var querystring=require(_0x58be('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x58be('0x10'));var qs=require(_0x58be('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x58be('0x12'));var logger=require(_0x58be('0x13'))(_0x58be('0x14'));var utils=require(_0x58be('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x58be('0x16'));var db=require(_0x58be('0x17'))['db'];config[_0x58be('0x18')]=_[_0x58be('0x19')](config[_0x58be('0x18')],{'host':_0x58be('0x1a'),'port':0x18eb});var socket=require(_0x58be('0x1b'))(new Redis(config[_0x58be('0x18')]));require(_0x58be('0x1c'))[_0x58be('0x1d')](socket);var jayson=require(_0x58be('0x1e'));var client=jayson[_0x58be('0x1f')][_0x58be('0x20')]({'port':0x232c});var client9002=jayson[_0x58be('0x1f')][_0x58be('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x25d23d,_0x3f78b9,_0x25919a,_0x3687f6){return new BPromise(function(_0x2b8659,_0x2dcdda){var _0x386d5e=_0x3687f6||client;return _0x386d5e['request'](_0x25d23d,_0x25919a)[_0x58be('0x21')](function(_0x4bd016){logger['info'](_0x58be('0x22'),_0x3f78b9,'request\x20sent');logger[_0x58be('0x23')](_0x58be('0x24'),_0x3f78b9,_0x58be('0x25'),JSON['stringify'](_0x4bd016));if(_0x4bd016[_0x58be('0x26')]){if(_0x4bd016[_0x58be('0x26')]['code']===0x1f4){logger[_0x58be('0x26')](_0x58be('0x22'),_0x3f78b9,_0x4bd016[_0x58be('0x26')][_0x58be('0x27')]);return _0x2dcdda(_0x4bd016['error'][_0x58be('0x27')]);}logger[_0x58be('0x26')](_0x58be('0x22'),_0x3f78b9,_0x4bd016['error'][_0x58be('0x27')]);return _0x2b8659(_0x4bd016[_0x58be('0x26')][_0x58be('0x27')]);}else{logger[_0x58be('0x28')](_0x58be('0x22'),_0x3f78b9,_0x58be('0x25'));_0x2b8659(_0x4bd016['result'][_0x58be('0x27')]);}})[_0x58be('0x29')](function(_0x1bacd3){logger[_0x58be('0x26')]('FaxMessage,\x20%s,\x20%s',_0x3f78b9,_0x1bacd3);_0x2dcdda(_0x1bacd3);});});}function respondWithStatusCode(_0x31b28a,_0x4289b3){_0x4289b3=_0x4289b3||0xcc;return function(_0x418541){if(_0x418541){return _0x31b28a[_0x58be('0x2a')](_0x4289b3);}return _0x31b28a[_0x58be('0x2b')](_0x4289b3)[_0x58be('0x2c')]();};}function respondWithResult(_0xdc810f,_0x35c99e){_0x35c99e=_0x35c99e||0xc8;return function(_0x2ae71c){if(_0x2ae71c){return _0xdc810f[_0x58be('0x2b')](_0x35c99e)[_0x58be('0x2d')](_0x2ae71c);}};}function respondWithFilteredResult(_0x45e76b,_0x595351){return function(_0x1ac6d2){if(_0x1ac6d2){var _0x2902ed=typeof _0x595351[_0x58be('0x2e')]===_0x58be('0x2f')&&typeof _0x595351[_0x58be('0x30')]===_0x58be('0x2f');var _0x418902=_0x1ac6d2[_0x58be('0x31')];var _0x88dc30=_0x2902ed?0x0:_0x595351[_0x58be('0x2e')];var _0x2351bb=_0x2902ed?_0x1ac6d2['count']:_0x595351['offset']+_0x595351[_0x58be('0x30')];var _0x3d84a6;if(_0x2351bb>=_0x418902){_0x2351bb=_0x418902;_0x3d84a6=0xc8;}else{_0x3d84a6=0xce;}_0x45e76b[_0x58be('0x2b')](_0x3d84a6);return _0x45e76b[_0x58be('0x32')](_0x58be('0x33'),_0x88dc30+'-'+_0x2351bb+'/'+_0x418902)[_0x58be('0x2d')](_0x1ac6d2);}return null;};}function patchUpdates(_0x1e9d4b){return function(_0x2559ec){try{jsonpatch[_0x58be('0x34')](_0x2559ec,_0x1e9d4b,!![]);}catch(_0x4471a3){return BPromise['reject'](_0x4471a3);}return _0x2559ec[_0x58be('0x35')]();};}function saveUpdates(_0x9a9715,_0x1f34d7){return function(_0x3ce4fe){if(_0x3ce4fe){return _0x3ce4fe[_0x58be('0x36')](_0x9a9715)[_0x58be('0x21')](function(_0x2908a0){return _0x2908a0;});}return null;};}function removeEntity(_0x147512,_0x4e1b29){return function(_0x33b0e5){if(_0x33b0e5){return _0x33b0e5[_0x58be('0x37')]()[_0x58be('0x21')](function(){_0x147512[_0x58be('0x2b')](0xcc)[_0x58be('0x2c')]();});}};}function handleEntityNotFound(_0x5778fb,_0x161675){return function(_0x8917e6){if(!_0x8917e6){_0x5778fb['sendStatus'](0x194);}return _0x8917e6;};}function handleError(_0x5c5fbe,_0x59cc5e){_0x59cc5e=_0x59cc5e||0x1f4;return function(_0x4cecac){logger[_0x58be('0x26')](_0x4cecac['stack']);if(_0x4cecac[_0x58be('0x38')]){delete _0x4cecac[_0x58be('0x38')];}_0x5c5fbe[_0x58be('0x2b')](_0x59cc5e)[_0x58be('0x39')](_0x4cecac);};}exports[_0x58be('0x3a')]=function(_0xd64a37,_0x32ab85){var _0x3ee7e1={},_0x2725df={},_0x19da07={'count':0x0,'rows':[]};var _0x53cb87=_['map'](db[_0x58be('0x3b')][_0x58be('0x3c')],function(_0x2d5cb4){return{'name':_0x2d5cb4[_0x58be('0x3d')],'type':_0x2d5cb4[_0x58be('0x3e')][_0x58be('0x3f')]};});_0x2725df[_0x58be('0x40')]=_[_0x58be('0x41')](_0x53cb87,_0x58be('0x38'));_0x2725df[_0x58be('0x42')]=_[_0x58be('0x43')](_0xd64a37[_0x58be('0x42')]);_0x2725df['filters']=_[_0x58be('0x44')](_0x2725df[_0x58be('0x40')],_0x2725df['query']);_0x3ee7e1[_0x58be('0x45')]=_['intersection'](_0x2725df[_0x58be('0x40')],qs[_0x58be('0x46')](_0xd64a37[_0x58be('0x42')]['fields']));_0x3ee7e1[_0x58be('0x45')]=_0x3ee7e1['attributes'][_0x58be('0x47')]?_0x3ee7e1[_0x58be('0x45')]:_0x2725df[_0x58be('0x40')];if(!_0xd64a37[_0x58be('0x42')]['hasOwnProperty'](_0x58be('0x48'))){_0x3ee7e1[_0x58be('0x30')]=qs['limit'](_0xd64a37[_0x58be('0x42')][_0x58be('0x30')]);_0x3ee7e1[_0x58be('0x2e')]=qs['offset'](_0xd64a37[_0x58be('0x42')][_0x58be('0x2e')]);}_0x3ee7e1[_0x58be('0x49')]=qs[_0x58be('0x4a')](_0xd64a37['query'][_0x58be('0x4a')]);_0x3ee7e1[_0x58be('0x4b')]=qs[_0x58be('0x4c')](_['pick'](_0xd64a37['query'],_0x2725df[_0x58be('0x4c')]),_0x53cb87);if(_0xd64a37[_0x58be('0x42')][_0x58be('0x4d')]){_0x3ee7e1[_0x58be('0x4b')]=_[_0x58be('0x4e')](_0x3ee7e1[_0x58be('0x4b')],{'$or':_[_0x58be('0x41')](_0x53cb87,function(_0x24c823){if(_0x24c823[_0x58be('0x3e')]!==_0x58be('0x4f')){var _0x5eb988={};_0x5eb988[_0x24c823[_0x58be('0x38')]]={'$like':'%'+_0xd64a37[_0x58be('0x42')][_0x58be('0x4d')]+'%'};return _0x5eb988;}})});}_0x3ee7e1=_['merge']({},_0x3ee7e1,_0xd64a37[_0x58be('0x50')]);var _0x128949={'where':_0x3ee7e1[_0x58be('0x4b')]};return db[_0x58be('0x3b')][_0x58be('0x31')](_0x128949)[_0x58be('0x21')](function(_0xa7f398){_0x19da07[_0x58be('0x31')]=_0xa7f398;if(_0xd64a37[_0x58be('0x42')]['includeAll']){_0x3ee7e1['include']=[{'all':!![]}];}return db[_0x58be('0x3b')]['findAll'](_0x3ee7e1);})['then'](function(_0x3afb78){_0x19da07['rows']=_0x3afb78;return _0x19da07;})[_0x58be('0x21')](respondWithFilteredResult(_0x32ab85,_0x3ee7e1))[_0x58be('0x29')](handleError(_0x32ab85,null));};exports['show']=function(_0x11fea6,_0x21960a){var _0x3550a2={'raw':!![],'where':{'id':_0x11fea6[_0x58be('0x51')]['id']}},_0x3e6ab6={};_0x3e6ab6[_0x58be('0x40')]=_[_0x58be('0x43')](db[_0x58be('0x3b')][_0x58be('0x3c')]);_0x3e6ab6['query']=_[_0x58be('0x43')](_0x11fea6[_0x58be('0x42')]);_0x3e6ab6['filters']=_['intersection'](_0x3e6ab6[_0x58be('0x40')],_0x3e6ab6[_0x58be('0x42')]);_0x3550a2[_0x58be('0x45')]=_[_0x58be('0x44')](_0x3e6ab6['model'],qs[_0x58be('0x46')](_0x11fea6[_0x58be('0x42')][_0x58be('0x46')]));_0x3550a2['attributes']=_0x3550a2[_0x58be('0x45')]['length']?_0x3550a2[_0x58be('0x45')]:_0x3e6ab6[_0x58be('0x40')];if(_0x11fea6[_0x58be('0x42')][_0x58be('0x52')]){_0x3550a2[_0x58be('0x53')]=[{'all':!![]}];}_0x3550a2=_[_0x58be('0x4e')]({},_0x3550a2,_0x11fea6[_0x58be('0x50')]);return db[_0x58be('0x3b')][_0x58be('0x54')](_0x3550a2)[_0x58be('0x21')](handleEntityNotFound(_0x21960a,null))[_0x58be('0x21')](respondWithResult(_0x21960a,null))[_0x58be('0x29')](handleError(_0x21960a,null));};exports['update']=function(_0x2617a7,_0x3188a4){if(_0x2617a7[_0x58be('0x55')]['id']){delete _0x2617a7[_0x58be('0x55')]['id'];}return db[_0x58be('0x3b')][_0x58be('0x54')]({'where':{'id':_0x2617a7['params']['id']}})['then'](handleEntityNotFound(_0x3188a4,null))[_0x58be('0x21')](saveUpdates(_0x2617a7[_0x58be('0x55')],null))[_0x58be('0x21')](respondWithResult(_0x3188a4,null))[_0x58be('0x29')](handleError(_0x3188a4,null));};exports[_0x58be('0x37')]=function(_0xd9fe0f,_0x3e049e){return db[_0x58be('0x3b')][_0x58be('0x54')]({'where':{'id':_0xd9fe0f[_0x58be('0x51')]['id']}})['then'](handleEntityNotFound(_0x3e049e,null))[_0x58be('0x21')](removeEntity(_0x3e049e,null))[_0x58be('0x29')](handleError(_0x3e049e,null));};exports['describe']=function(_0x2635f8,_0x4bb927){return db[_0x58be('0x3b')]['describe']()[_0x58be('0x21')](respondWithResult(_0x4bb927,null))['catch'](handleError(_0x4bb927,null));};var interaction_log=require('../../config/logger')(_0x58be('0x56'));exports[_0x58be('0x57')]=function(_0x1fbf06,_0x600b7b,_0x263c85){var _0x24216f={'agent':{},'channel':'fax'};if(_0x1fbf06[_0x58be('0x55')]['id']){delete _0x1fbf06[_0x58be('0x55')]['id'];}_0x1fbf06['body'][_0x58be('0x58')]=!![];_0x1fbf06[_0x58be('0x55')]['readAt']=moment()[_0x58be('0x59')](_0x58be('0x5a'));_0x1fbf06['body']['UserId']=_0x1fbf06['body'][_0x58be('0x5b')]||_0x1fbf06[_0x58be('0x5c')]['id'];_0x24216f[_0x58be('0x5d')]['id']=_0x1fbf06[_0x58be('0x55')][_0x58be('0x5b')];return db[_0x58be('0x3b')][_0x58be('0x54')]({'where':{'id':_0x1fbf06[_0x58be('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x600b7b,null))[_0x58be('0x21')](saveUpdates(_0x1fbf06['body'],null))['then'](function(_0x5d8640){if(_0x5d8640){_0x24216f[_0x58be('0x27')]=_0x5d8640['get']({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x5d8640[_0x58be('0x5e')]}});}return null;})[_0x58be('0x21')](handleEntityNotFound(_0x600b7b,null))['then'](function(_0x35819f){if(_0x35819f){return _0x35819f[_0x58be('0x36')]({'UserId':_0x1fbf06[_0x58be('0x55')][_0x58be('0x5b')],'read1stAt':_[_0x58be('0x5f')](_0x35819f[_0x58be('0x60')])?moment()[_0x58be('0x59')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x21e346){if(_0x21e346){_0x24216f['interaction']=_0x21e346[_0x58be('0x61')]({'plain':!![]});interaction_log[_0x58be('0x28')](_0x58be('0x62'),_0x1fbf06[_0x58be('0x5c')]['id'],_0x1fbf06[_0x58be('0x5c')][_0x58be('0x38')],_0x1fbf06[_0x58be('0x5c')][_0x58be('0x63')],_0x24216f[_0x58be('0x64')]['id'],_0x1fbf06['body']?JSON[_0x58be('0x65')](_0x1fbf06['body']):_0x58be('0x66'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x24216f);}return null;})[_0x58be('0x21')](function(_0x54c968){var _0x4aee7a=_0x58be('0x67')+_0x54c968['message'][_0x58be('0x68')];return db['sequelize'][_0x58be('0x42')](_0x4aee7a,{'type':db['Sequelize'][_0x58be('0x69')][_0x58be('0x6a')],'raw':!![]})[_0x58be('0x21')](function(_0x3c690a){return _0x3c690a;});})[_0x58be('0x21')](function(_0x160e74){if(_0x160e74){_0x24216f['message'][_0x58be('0x6b')]=_0x160e74[0x0];if(!_0x1fbf06['body'][_0x58be('0x5b')])return;return db['User'][_0x58be('0x54')]({'where':{'id':_0x1fbf06[_0x58be('0x55')][_0x58be('0x5b')],'role':_0x58be('0x5d')},'attributes':['id',_0x58be('0x38'),'fullname',_0x58be('0x6c'),'internal'],'raw':!![]});}return null;})[_0x58be('0x21')](function(_0xf91be4){if(!_0xf91be4)return null;_0x24216f[_0x58be('0x27')][_0x58be('0x5d')]=_0xf91be4;return _0x24216f;})[_0x58be('0x21')](function(_0x40f16b){if(_0x40f16b){if(_0x1fbf06['body'][_0x58be('0x6d')]){_0x24216f[_0x58be('0x27')][_0x58be('0x6e')]=util['format']('SIP/%s',_0x1fbf06['user'][_0x58be('0x38')]);_0x24216f[_0x58be('0x27')][_0x58be('0x6f')]=_0x24216f[_0x58be('0x6f')];_0x24216f[_0x58be('0x27')][_0x58be('0x70')]=_0x24216f[_0x58be('0x6f')];_0x24216f[_0x58be('0x27')][_0x58be('0x71')]='accept';return respondWithRpcPromise('EventManager',_0x58be('0x72'),{'event':_0x58be('0x73'),'message':_0x24216f[_0x58be('0x27')]},client9002)[_0x58be('0x21')](function(){return _0x24216f;});}return _0x24216f;}return null;})['then'](respondWithResult(_0x600b7b,null))[_0x58be('0x29')](handleError(_0x600b7b,null));};var interaction_log=require(_0x58be('0x13'))(_0x58be('0x56'));exports[_0x58be('0x74')]=function(_0x39850e,_0x2393cc,_0x3560e4){var _0x5ae90f={'agent':{},'channel':_0x58be('0x75')};if(_0x39850e['body']['id']){delete _0x39850e['body']['id'];}_0x39850e['body'][_0x58be('0x5b')]=_0x39850e[_0x58be('0x55')][_0x58be('0x5b')]||_0x39850e[_0x58be('0x5c')]['id'];_0x5ae90f[_0x58be('0x5d')]['id']=_0x39850e[_0x58be('0x55')][_0x58be('0x5b')];return db[_0x58be('0x3b')]['find']({'where':{'id':_0x39850e[_0x58be('0x51')]['id'],'UserId':null}})[_0x58be('0x21')](handleEntityNotFound(_0x2393cc,null))[_0x58be('0x21')](function(_0x145754){if(_0x145754){_0x5ae90f['message']=_0x145754['get']({'plain':!![]});return db[_0x58be('0x76')][_0x58be('0x54')]({'where':{'id':_0x145754[_0x58be('0x5e')]}});}return null;})[_0x58be('0x21')](handleEntityNotFound(_0x2393cc,null))[_0x58be('0x21')](function(_0x2ae029){if(_0x2ae029){_0x5ae90f[_0x58be('0x64')]=_0x2ae029['get']({'plain':!![]});interaction_log[_0x58be('0x28')](_0x58be('0x77'),_0x39850e[_0x58be('0x5c')]['id'],_0x39850e[_0x58be('0x5c')]['name'],_0x39850e[_0x58be('0x5c')][_0x58be('0x63')],_0x5ae90f[_0x58be('0x64')]['id'],_0x39850e['body']?JSON['stringify'](_0x39850e[_0x58be('0x55')]):_0x58be('0x66'));return respondWithRpcPromise('RejectMessage',_0x58be('0x78'),_0x5ae90f);}return null;})['then'](function(_0x1a3b7f){var _0x194453=_0x58be('0x67')+_0x1a3b7f[_0x58be('0x27')]['ContactId'];return db['sequelize'][_0x58be('0x42')](_0x194453,{'type':db[_0x58be('0x79')][_0x58be('0x69')][_0x58be('0x6a')],'raw':!![]})[_0x58be('0x21')](function(_0x213a02){return _0x213a02;});})[_0x58be('0x21')](function(_0x3af363){if(_0x3af363){_0x5ae90f[_0x58be('0x27')][_0x58be('0x6b')]=_0x3af363[0x0];if(!_0x39850e[_0x58be('0x55')][_0x58be('0x5b')])return;return db[_0x58be('0x7a')][_0x58be('0x54')]({'where':{'id':_0x39850e['body']['UserId'],'role':_0x58be('0x5d')},'attributes':['id',_0x58be('0x38'),'fullname',_0x58be('0x6c'),_0x58be('0x7b')],'raw':!![]});}return null;})['then'](function(_0x3fbbbf){if(!_0x3fbbbf)return null;_0x5ae90f[_0x58be('0x27')]['agent']=_0x3fbbbf;return _0x5ae90f;})[_0x58be('0x21')](function(_0x1d5bab){if(_0x1d5bab){_0x1d5bab['message'][_0x58be('0x6e')]=util[_0x58be('0x59')](_0x58be('0x7c'),_0x39850e[_0x58be('0x5c')][_0x58be('0x38')]);_0x1d5bab[_0x58be('0x27')]['channel']=_0x5ae90f[_0x58be('0x6f')];_0x1d5bab[_0x58be('0x27')]['motionChannel']=_0x5ae90f[_0x58be('0x6f')];_0x1d5bab[_0x58be('0x27')]['event']='reject';respondWithRpcPromise(_0x58be('0x72'),_0x58be('0x72'),{'event':_0x58be('0x7d'),'message':_0x1d5bab[_0x58be('0x27')]},client9002);return _0x5ae90f;}return null;})[_0x58be('0x21')](respondWithResult(_0x2393cc,null))[_0x58be('0x29')](handleError(_0x2393cc,null));};exports['create']=function(_0x407b5d,_0x845a9f){var _0x16915b;return db[_0x58be('0x3b')]['create'](_0x407b5d[_0x58be('0x55')],{})[_0x58be('0x21')](function(_0x2a7e2e){_0x16915b=_0x2a7e2e;return db['CmContact']['findOne']({'where':{'id':_0x16915b[_0x58be('0x68')]}});})[_0x58be('0x21')](function(_0x750ce1){if(_[_0x58be('0x5f')](_0x750ce1)){return;}else{_0x16915b[_0x58be('0x75')]=_0x750ce1[_0x58be('0x75')];return db[_0x58be('0x7e')]['findOne']({'where':{'id':_0x16915b[_0x58be('0x7f')]}});}})[_0x58be('0x21')](function(_0xd559e4){return respondWithRpcPromise(_0x58be('0x80'),_0x58be('0x80'),{'FaxAccountId':_[_0x58be('0x5f')](_0x407b5d[_0x58be('0x55')])?undefined:_0x407b5d['body'][_0x58be('0x81')],'path':_[_0x58be('0x5f')](_0xd559e4)?undefined:util[_0x58be('0x59')](_0x58be('0x82'),_0xd559e4[_0x58be('0x83')]),'fax':_['isNil'](_0x16915b[_0x58be('0x75')])?undefined:_0x16915b[_0x58be('0x75')],'AttachmentId':_0x16915b[_0x58be('0x7f')]},client9002);})[_0x58be('0x21')](respondWithResult(_0x845a9f,0xc9))[_0x58be('0x29')](handleError(_0x845a9f,null));};exports['download']=function(_0x27888c,_0x507826){var _0x4b35e4=path[_0x58be('0x84')](config[_0x58be('0x85')],_0x58be('0x86'),_0x58be('0x87'),_0x58be('0x88'));return db[_0x58be('0x3b')][_0x58be('0x54')]({'where':{'id':_0x27888c[_0x58be('0x51')]['id']},'include':[{'model':db[_0x58be('0x7e')],'as':_0x58be('0x7e')}]})['then'](handleEntityNotFound(_0x507826,null))[_0x58be('0x21')](function(_0x2e99d1){if(_0x2e99d1){return _0x507826[_0x58be('0x89')](path[_0x58be('0x84')](_0x4b35e4,_0x2e99d1[_0x58be('0x7e')][_0x58be('0x83')]));}})[_0x58be('0x29')](handleError(_0x507826,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 334809e..0ee3924 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 _0x741c=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0xf193b8,_0x524ae2){var _0x54e80e=function(_0x4f75b5){while(--_0x4f75b5){_0xf193b8['push'](_0xf193b8['shift']());}};_0x54e80e(++_0x524ae2);}(_0x741c,0x196));var _0xc741=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x741c[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0xc741('0x0'));var FaxMessage=require(_0xc741('0x1'))['db'][_0xc741('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc741('0x3')](0x0);var events={'afterCreate':_0xc741('0x4'),'afterUpdate':_0xc741('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5cee2e){return function(_0x4089bf,_0x4ccc27,_0xc80e99){FaxMessageEvents[_0xc741('0x6')](_0x5cee2e+':'+_0x4089bf['id'],_0x4089bf);FaxMessageEvents[_0xc741('0x6')](_0x5cee2e,_0x4089bf);_0xc80e99(null);};}for(var e in events){if(events[_0xc741('0x7')](e)){var event=events[e];FaxMessage[_0xc741('0x8')](e,emitEvent(event));}}module[_0xc741('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x7fd6=['FaxMessage','setMaxListeners','save','update','remove','hook','exports','events'];(function(_0x57be66,_0x42fff8){var _0x4c2111=function(_0x10e8b4){while(--_0x10e8b4){_0x57be66['push'](_0x57be66['shift']());}};_0x4c2111(++_0x42fff8);}(_0x7fd6,0x157));var _0x67fd=function(_0x4ff01e,_0x3cb556){_0x4ff01e=_0x4ff01e-0x0;var _0x429b75=_0x7fd6[_0x4ff01e];return _0x429b75;};'use strict';var EventEmitter=require(_0x67fd('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x67fd('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x67fd('0x2')](0x0);var events={'afterCreate':_0x67fd('0x3'),'afterUpdate':_0x67fd('0x4'),'afterDestroy':_0x67fd('0x5')};function emitEvent(_0xbdd0c0){return function(_0x4f52bc,_0x187f3e,_0x50238d){FaxMessageEvents['emit'](_0xbdd0c0+':'+_0x4f52bc['id'],_0x4f52bc);FaxMessageEvents['emit'](_0xbdd0c0,_0x4f52bc);_0x50238d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x67fd('0x6')](e,emitEvent(event));}}module[_0x67fd('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 098a95d..6680b98 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 _0x33d8=['rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','models','get','toLowerCase','direction','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird'];(function(_0x3b498c,_0x46c9af){var _0x222042=function(_0x3992df){while(--_0x3992df){_0x3b498c['push'](_0x3b498c['shift']());}};_0x222042(++_0x46c9af);}(_0x33d8,0x83));var _0x833d=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x33d8[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var util=require(_0x833d('0x0'));var logger=require('../../config/logger')(_0x833d('0x1'));var moment=require(_0x833d('0x2'));var BPromise=require(_0x833d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x833d('0x4'));var config=require('../../config/environment');var attributes=require(_0x833d('0x5'));module[_0x833d('0x6')]=function(_0x203f85,_0x55d533){return _0x203f85[_0x833d('0x7')](_0x833d('0x8'),attributes,{'tableName':_0x833d('0x9'),'paranoid':![],'indexes':[{'name':_0x833d('0xa'),'fields':[_0x833d('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x52deb9,_0x402dec,_0x24bae8){var _0x4797c2=_0x203f85[_0x833d('0xc')];var _0x3a300e=_0x52deb9[_0x833d('0xd')]({'plain':!![]});if(_0x3a300e['direction'][_0x833d('0xe')]()==='in'||_0x3a300e[_0x833d('0xf')][_0x833d('0xe')]()==='out'&&!_0x3a300e['secret']&&!_[_0x833d('0x10')](_0x3a300e[_0x833d('0x11')])){_0x4797c2[_0x833d('0x12')][_0x833d('0x13')]({'where':{'id':_0x3a300e[_0x833d('0x14')]}})[_0x833d('0x15')](function(_0x51e82e){if(_0x51e82e){_0x51e82e[_0x833d('0x16')]({'lastMsgAt':_0x3a300e[_0x833d('0x17')],'lastMsgDirection':_0x3a300e[_0x833d('0xf')][_0x833d('0xe')]()});}})[_0x833d('0x18')](function(_0x4c715c){console['error'](_0x4c715c);});}_0x24bae8();}},'charset':_0x833d('0x19'),'collate':_0x833d('0x1a')});}; \ No newline at end of file +var _0x9d88=['FaxInteraction','findOne','FaxInteractionId','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','define','fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x486ab6,_0x257c0a){var _0x1ce5ea=function(_0x1443a5){while(--_0x1443a5){_0x486ab6['push'](_0x486ab6['shift']());}};_0x1ce5ea(++_0x257c0a);}(_0x9d88,0x78));var _0x89d8=function(_0x1f8710,_0x524167){_0x1f8710=_0x1f8710-0x0;var _0x1a59d7=_0x9d88[_0x1f8710];return _0x1a59d7;};'use strict';var _=require(_0x89d8('0x0'));var util=require('util');var logger=require(_0x89d8('0x1'))(_0x89d8('0x2'));var moment=require(_0x89d8('0x3'));var BPromise=require(_0x89d8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89d8('0x5'));var rimraf=require(_0x89d8('0x6'));var config=require(_0x89d8('0x7'));var attributes=require(_0x89d8('0x8'));module['exports']=function(_0x1a5883,_0x4a18c0){return _0x1a5883[_0x89d8('0x9')]('FaxMessage',attributes,{'tableName':_0x89d8('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x89d8('0xb')],'type':_0x89d8('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f6939,_0x2222fc,_0x5ccf9c){var _0x419b32=_0x1a5883['models'];var _0x4e30fd=_0x4f6939[_0x89d8('0xd')]({'plain':!![]});if(_0x4e30fd[_0x89d8('0xe')][_0x89d8('0xf')]()==='in'||_0x4e30fd[_0x89d8('0xe')][_0x89d8('0xf')]()===_0x89d8('0x10')&&!_0x4e30fd[_0x89d8('0x11')]&&!_[_0x89d8('0x12')](_0x4e30fd[_0x89d8('0x13')])){_0x419b32[_0x89d8('0x14')][_0x89d8('0x15')]({'where':{'id':_0x4e30fd[_0x89d8('0x16')]}})['then'](function(_0x4620a8){if(_0x4620a8){_0x4620a8['update']({'lastMsgAt':_0x4e30fd[_0x89d8('0x17')],'lastMsgDirection':_0x4e30fd['direction'][_0x89d8('0xf')]()});}})[_0x89d8('0x18')](function(_0x20825c){console[_0x89d8('0x19')](_0x20825c);});}_0x5ccf9c();}},'charset':_0x89d8('0x1a'),'collate':_0x89d8('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index e8b6967..7133617 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fd1=['debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','raw','catch','UpdateFaxMessage','options','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fd1,0x155));var _0x15fd=function(_0x102174,_0x5c5944){_0x102174=_0x102174-0x0;var _0x23934f=_0x5fd1[_0x102174];return _0x23934f;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});config[_0x15fd('0xa')]=_[_0x15fd('0xb')](config['redis'],{'host':_0x15fd('0xc'),'port':0x18eb});var socket=require(_0x15fd('0xd'))(new Redis(config[_0x15fd('0xa')]));require('./faxMessage.socket')[_0x15fd('0xe')](socket);function respondWithRpcPromise(_0x5c9c63,_0x3dfdbb,_0x250457){return new BPromise(function(_0x4c226a,_0x4883fd){return client['request'](_0x5c9c63,_0x250457)[_0x15fd('0xf')](function(_0x2a4d55){logger[_0x15fd('0x10')](_0x15fd('0x11'),_0x3dfdbb,_0x15fd('0x12'));logger[_0x15fd('0x13')](_0x15fd('0x14'),_0x3dfdbb,_0x15fd('0x12'),JSON[_0x15fd('0x15')](_0x2a4d55));if(_0x2a4d55['error']){if(_0x2a4d55['error']['code']===0x1f4){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);return _0x4883fd(_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);}logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55['error']['message']);return _0x4c226a(_0x2a4d55[_0x15fd('0x16')]['message']);}else{logger[_0x15fd('0x10')]('FaxMessage,\x20%s,\x20%s',_0x3dfdbb,_0x15fd('0x12'));_0x4c226a(_0x2a4d55[_0x15fd('0x18')][_0x15fd('0x17')]);}})['catch'](function(_0x367c36){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x367c36);_0x4883fd(_0x367c36);});});}exports[_0x15fd('0x19')]=function(_0x2fb919){var _0x36a90e=this;return new Promise(function(_0x3761db,_0x2f46f1){return db[_0x15fd('0x1a')][_0x15fd('0x1b')](_0x2fb919[_0x15fd('0x1c')],{'raw':_0x2fb919['options']?_0x2fb919['options'][_0x15fd('0x1d')]===undefined?!![]:![]:!![]})[_0x15fd('0xf')](function(_0x252a1c){logger[_0x15fd('0x10')](_0x15fd('0x19'),_0x2fb919);logger[_0x15fd('0x13')](_0x15fd('0x19'),_0x2fb919,JSON['stringify'](_0x252a1c));_0x3761db(_0x252a1c);})[_0x15fd('0x1e')](function(_0x2d19ac){logger[_0x15fd('0x16')]('CreateFaxMessage',_0x2d19ac[_0x15fd('0x17')],_0x2fb919);_0x2f46f1(_0x36a90e['error'](0x1f4,_0x2d19ac[_0x15fd('0x17')]));});});};exports[_0x15fd('0x1f')]=function(_0x21601d){var _0x4c9708=this;return new Promise(function(_0x16b87c,_0x1cbf2c){return db[_0x15fd('0x1a')]['update'](_0x21601d[_0x15fd('0x1c')],{'raw':_0x21601d['options']?_0x21601d[_0x15fd('0x20')][_0x15fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x21')]||null:null,'attributes':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x22')]||null:null,'limit':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x23')]||null:null})['then'](function(_0x47c22c){logger[_0x15fd('0x10')]('UpdateFaxMessage',_0x21601d);logger[_0x15fd('0x13')](_0x15fd('0x1f'),_0x21601d,JSON['stringify'](_0x47c22c));_0x16b87c(_0x47c22c);})[_0x15fd('0x1e')](function(_0x197d15){logger['error'](_0x15fd('0x1f'),_0x197d15[_0x15fd('0x17')],_0x21601d);_0x1cbf2c(_0x4c9708[_0x15fd('0x16')](0x1f4,_0x197d15[_0x15fd('0x17')]));});});}; \ No newline at end of file +var _0xac9d=['then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','FaxMessage','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request'];(function(_0x35f471,_0x192a78){var _0x13cfd1=function(_0x5edff5){while(--_0x5edff5){_0x35f471['push'](_0x35f471['shift']());}};_0x13cfd1(++_0x192a78);}(_0xac9d,0x14d));var _0xdac9=function(_0x3bb5b4,_0x128455){_0x3bb5b4=_0x3bb5b4-0x0;var _0x586c60=_0xac9d[_0x3bb5b4];return _0x586c60;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});config[_0xdac9('0xc')]=_[_0xdac9('0xd')](config[_0xdac9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdac9('0xe'))(new Redis(config['redis']));require(_0xdac9('0xf'))[_0xdac9('0x10')](socket);function respondWithRpcPromise(_0x39c92c,_0x1a4674,_0x23ec14){return new BPromise(function(_0x2859bf,_0x255627){return client[_0xdac9('0x11')](_0x39c92c,_0x23ec14)[_0xdac9('0x12')](function(_0x5514c5){logger[_0xdac9('0x13')](_0xdac9('0x14'),_0x1a4674,'request\x20sent');logger[_0xdac9('0x15')](_0xdac9('0x16'),_0x1a4674,_0xdac9('0x17'),JSON['stringify'](_0x5514c5));if(_0x5514c5[_0xdac9('0x18')]){if(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x19')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x255627(_0x5514c5['error'][_0xdac9('0x1a')]);}logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x2859bf(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);}else{logger[_0xdac9('0x13')]('FaxMessage,\x20%s,\x20%s',_0x1a4674,_0xdac9('0x17'));_0x2859bf(_0x5514c5[_0xdac9('0x1b')]['message']);}})[_0xdac9('0x1c')](function(_0xa57f2d){logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0xa57f2d);_0x255627(_0xa57f2d);});});}exports['CreateFaxMessage']=function(_0x520369){var _0x4029fc=this;return new Promise(function(_0x20ece3,_0x2b9d91){return db[_0xdac9('0x1d')]['create'](_0x520369[_0xdac9('0x1e')],{'raw':_0x520369[_0xdac9('0x1f')]?_0x520369[_0xdac9('0x1f')][_0xdac9('0x20')]===undefined?!![]:![]:!![]})[_0xdac9('0x12')](function(_0x42317c){logger[_0xdac9('0x13')](_0xdac9('0x21'),_0x520369);logger[_0xdac9('0x15')](_0xdac9('0x21'),_0x520369,JSON['stringify'](_0x42317c));_0x20ece3(_0x42317c);})[_0xdac9('0x1c')](function(_0x11f4fd){logger[_0xdac9('0x18')](_0xdac9('0x21'),_0x11f4fd['message'],_0x520369);_0x2b9d91(_0x4029fc[_0xdac9('0x18')](0x1f4,_0x11f4fd['message']));});});};exports[_0xdac9('0x22')]=function(_0x2fce71){var _0x566d8c=this;return new Promise(function(_0x433be9,_0x5105f1){return db[_0xdac9('0x1d')][_0xdac9('0x23')](_0x2fce71[_0xdac9('0x1e')],{'raw':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71[_0xdac9('0x1f')]['where']||null:null,'attributes':_0x2fce71['options']?_0x2fce71[_0xdac9('0x1f')][_0xdac9('0x24')]||null:null,'limit':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71[_0xdac9('0x1f')][_0xdac9('0x25')]||null:null})[_0xdac9('0x12')](function(_0xed99f9){logger[_0xdac9('0x13')](_0xdac9('0x22'),_0x2fce71);logger[_0xdac9('0x15')](_0xdac9('0x22'),_0x2fce71,JSON[_0xdac9('0x26')](_0xed99f9));_0x433be9(_0xed99f9);})[_0xdac9('0x1c')](function(_0x336fd5){logger[_0xdac9('0x18')](_0xdac9('0x22'),_0x336fd5[_0xdac9('0x1a')],_0x2fce71);_0x5105f1(_0x566d8c[_0xdac9('0x18')](0x1f4,_0x336fd5[_0xdac9('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index e21f435..2abdbb3 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 _0x8098=['save','remove','update','emit','removeListener','register','faxMessage:'];(function(_0xb07ecb,_0x413999){var _0xb0480f=function(_0x1ac1fb){while(--_0x1ac1fb){_0xb07ecb['push'](_0xb07ecb['shift']());}};_0xb0480f(++_0x413999);}(_0x8098,0x18f));var _0x8809=function(_0x2dfb9e,_0x20bc71){_0x2dfb9e=_0x2dfb9e-0x0;var _0x24b2ab=_0x8098[_0x2dfb9e];return _0x24b2ab;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x8809('0x0'),_0x8809('0x1'),_0x8809('0x2')];function createListener(_0x38c708,_0x5cdcfa){return function(_0x5542e0){_0x5cdcfa[_0x8809('0x3')](_0x38c708,_0x5542e0);};}function removeListener(_0x15d2b7,_0x3c8041){return function(){FaxMessageEvents[_0x8809('0x4')](_0x15d2b7,_0x3c8041);};}exports[_0x8809('0x5')]=function(_0x30718b){for(var _0x5a1b9c=0x0,_0x541e00=events['length'];_0x5a1b9c<_0x541e00;_0x5a1b9c++){var _0x393b87=events[_0x5a1b9c];var _0x36ec47=createListener(_0x8809('0x6')+_0x393b87,_0x30718b);FaxMessageEvents['on'](_0x393b87,_0x36ec47);}}; \ No newline at end of file +var _0xb53b=['update','emit','removeListener','./faxMessage.events','save'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0xb53b,0x76));var _0xbb53=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xb53b[_0x934425];return _0x31d596;};'use strict';var FaxMessageEvents=require(_0xbb53('0x0'));var events=[_0xbb53('0x1'),'remove',_0xbb53('0x2')];function createListener(_0x69a025,_0x21f337){return function(_0x2b467d){_0x21f337[_0xbb53('0x3')](_0x69a025,_0x2b467d);};}function removeListener(_0xccfc01,_0x532a3d){return function(){FaxMessageEvents[_0xbb53('0x4')](_0xccfc01,_0x532a3d);};}exports['register']=function(_0x1edb59){for(var _0x45fba1=0x0,_0x2f81c7=events['length'];_0x45fba1<_0x2f81c7;_0x45fba1++){var _0x590552=events[_0x45fba1];var _0x334363=createListener('faxMessage:'+_0x590552,_0x1edb59);FaxMessageEvents['on'](_0x590552,_0x334363);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 1c45040..4327901 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 _0xeb74=['Router','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','describe','show','/:id/download','download','post','fax','faxmessage:create','create','put','/:id','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x140fc9,_0x4b27bc){var _0x10f7f4=function(_0x203d3b){while(--_0x203d3b){_0x140fc9['push'](_0x140fc9['shift']());}};_0x10f7f4(++_0x4b27bc);}(_0xeb74,0xe3));var _0x4eb7=function(_0x2f67f8,_0x11f414){_0x2f67f8=_0x2f67f8-0x0;var _0x5c57f3=_0xeb74[_0x2f67f8];return _0x5c57f3;};'use strict';var multer=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var path=require(_0x4eb7('0x2'));var timeout=require(_0x4eb7('0x3'));var express=require(_0x4eb7('0x4'));var router=express[_0x4eb7('0x5')]();var fs_extra=require(_0x4eb7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4eb7('0x7'));var config=require(_0x4eb7('0x8'));var controller=require(_0x4eb7('0x9'));router[_0x4eb7('0xa')]('/',auth[_0x4eb7('0xb')](),controller['index']);router[_0x4eb7('0xa')]('/describe',auth[_0x4eb7('0xb')](),controller[_0x4eb7('0xc')]);router['get']('/:id',auth[_0x4eb7('0xb')](),controller[_0x4eb7('0xd')]);router['get'](_0x4eb7('0xe'),auth['isAuthenticated'](),controller[_0x4eb7('0xf')]);router[_0x4eb7('0x10')]('/',auth[_0x4eb7('0xb')](),interaction['tracked'](_0x4eb7('0x11'),_0x4eb7('0x12')),controller[_0x4eb7('0x13')]);router[_0x4eb7('0x14')](_0x4eb7('0x15'),auth[_0x4eb7('0xb')](),controller[_0x4eb7('0x16')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x4eb7('0x17')]);router['put'](_0x4eb7('0x18'),auth[_0x4eb7('0xb')](),controller[_0x4eb7('0x19')]);router[_0x4eb7('0x1a')](_0x4eb7('0x15'),auth[_0x4eb7('0xb')](),controller[_0x4eb7('0x1b')]);module[_0x4eb7('0x1c')]=router; \ No newline at end of file +var _0xf290=['/:id','show','/:id/download','download','post','fax','create','put','update','accept','/:id/reject','reject','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0x4c553,_0x520828){var _0x55cb13=function(_0x4b9956){while(--_0x4b9956){_0x4c553['push'](_0x4c553['shift']());}};_0x55cb13(++_0x520828);}(_0xf290,0xde));var _0x0f29=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0xf290[_0x531d15];return _0x271a18;};'use strict';var multer=require('multer');var util=require(_0x0f29('0x0'));var path=require('path');var timeout=require(_0x0f29('0x1'));var express=require('express');var router=express[_0x0f29('0x2')]();var fs_extra=require(_0x0f29('0x3'));var auth=require(_0x0f29('0x4'));var interaction=require(_0x0f29('0x5'));var config=require(_0x0f29('0x6'));var controller=require('./faxMessage.controller');router[_0x0f29('0x7')]('/',auth['isAuthenticated'](),controller[_0x0f29('0x8')]);router[_0x0f29('0x7')](_0x0f29('0x9'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xb')]);router[_0x0f29('0x7')](_0x0f29('0xc'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xd')]);router[_0x0f29('0x7')](_0x0f29('0xe'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xf')]);router[_0x0f29('0x10')]('/',auth[_0x0f29('0xa')](),interaction['tracked'](_0x0f29('0x11'),'faxmessage:create'),controller[_0x0f29('0x12')]);router[_0x0f29('0x13')](_0x0f29('0xc'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x14')]);router[_0x0f29('0x13')]('/:id/accept',auth[_0x0f29('0xa')](),controller[_0x0f29('0x15')]);router[_0x0f29('0x13')](_0x0f29('0x16'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x17')]);router[_0x0f29('0x18')](_0x0f29('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x0f29('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 464ac47..8551678 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 _0x2d47=['STRING','ENUM','rrmemory','roundrobin','INTEGER','sequelize','exports'];(function(_0x2be3be,_0x124d53){var _0x12e1a2=function(_0x1dab79){while(--_0x1dab79){_0x2be3be['push'](_0x2be3be['shift']());}};_0x12e1a2(++_0x124d53);}(_0x2d47,0x10f));var _0x72d4=function(_0x3c834d,_0x4f9feb){_0x3c834d=_0x3c834d-0x0;var _0x508ff4=_0x2d47[_0x3c834d];return _0x508ff4;};'use strict';var Sequelize=require(_0x72d4('0x0'));module[_0x72d4('0x1')]={'name':{'type':Sequelize[_0x72d4('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x72d4('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x72d4('0x3')](_0x72d4('0x4'),'beepall',_0x72d4('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x72d4('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x00cd=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0xd81849,_0x49ab82){var _0x4f7189=function(_0x68f23b){while(--_0x68f23b){_0xd81849['push'](_0xd81849['shift']());}};_0x4f7189(++_0x49ab82);}(_0x00cd,0xee));var _0xd00c=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0x00cd[_0x2c2980];return _0x2a20a9;};'use strict';var Sequelize=require(_0xd00c('0x0'));module[_0xd00c('0x1')]={'name':{'type':Sequelize[_0xd00c('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd00c('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd00c('0x4')](_0xd00c('0x5'),_0xd00c('0x6'),_0xd00c('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'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 53faf90..7e21e43 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 _0xf195=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','offset','undefined','count','json','apply','update','destroy','get','FaxQueues','UserProfileResource','error','stack','name','send','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','then','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','pick','FaxQueueId','UserFaxQueue','User','findAndCountAll','UserId','faxPause','format','%s/%s','SIP','createdAt','getTeams','addTeams','ids','Agents','online','voicePause','flatMap','transaction','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','all','compact','value','removeAgents','addAgents','spread','userFaxQueue:remove','getAgents','eml-format','zip-dir','request-promise','moment'];(function(_0x11dd87,_0x1f43b2){var _0x37e86b=function(_0xf8d043){while(--_0xf8d043){_0x11dd87['push'](_0x11dd87['shift']());}};_0x37e86b(++_0x1f43b2);}(_0xf195,0x87));var _0x5f19=function(_0x57da0a,_0x284aed){_0x57da0a=_0x57da0a-0x0;var _0x3145d5=_0xf195[_0x57da0a];return _0x3145d5;};'use strict';var emlformat=require(_0x5f19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f19('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f19('0x2'));var moment=require(_0x5f19('0x3'));var BPromise=require(_0x5f19('0x4'));var Mustache=require(_0x5f19('0x5'));var util=require(_0x5f19('0x6'));var path=require(_0x5f19('0x7'));var sox=require(_0x5f19('0x8'));var csv=require('to-csv');var ejs=require(_0x5f19('0x9'));var fs=require('fs');var fs_extra=require(_0x5f19('0xa'));var _=require(_0x5f19('0xb'));var squel=require(_0x5f19('0xc'));var crypto=require(_0x5f19('0xd'));var jsforce=require(_0x5f19('0xe'));var deskjs=require(_0x5f19('0xf'));var toCsv=require(_0x5f19('0x10'));var querystring=require(_0x5f19('0x11'));var Papa=require(_0x5f19('0x12'));var Redis=require(_0x5f19('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5f19('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f19('0x15'));var logger=require('../../config/logger')(_0x5f19('0x16'));var utils=require('../../config/utils');var config=require(_0x5f19('0x17'));var licenseUtil=require(_0x5f19('0x18'));var db=require(_0x5f19('0x19'))['db'];config[_0x5f19('0x1a')]=_[_0x5f19('0x1b')](config[_0x5f19('0x1a')],{'host':_0x5f19('0x1c'),'port':0x18eb});var socket=require(_0x5f19('0x1d'))(new Redis(config[_0x5f19('0x1a')]));require(_0x5f19('0x1e'))[_0x5f19('0x1f')](socket);function respondWithStatusCode(_0x507418,_0x3f39a0){_0x3f39a0=_0x3f39a0||0xcc;return function(_0x5c17d6){if(_0x5c17d6){return _0x507418[_0x5f19('0x20')](_0x3f39a0);}return _0x507418[_0x5f19('0x21')](_0x3f39a0)[_0x5f19('0x22')]();};}function respondWithResult(_0x5eb3ff,_0x4715b5){_0x4715b5=_0x4715b5||0xc8;return function(_0x296b25){if(_0x296b25){return _0x5eb3ff[_0x5f19('0x21')](_0x4715b5)['json'](_0x296b25);}};}function respondWithFilteredResult(_0x2c77de,_0x2b6b32){return function(_0x324661){if(_0x324661){var _0x2d247f=typeof _0x2b6b32[_0x5f19('0x23')]===_0x5f19('0x24')&&typeof _0x2b6b32['limit']===_0x5f19('0x24');var _0x12d21c=_0x324661[_0x5f19('0x25')];var _0x17ba99=_0x2d247f?0x0:_0x2b6b32[_0x5f19('0x23')];var _0x1e24e8=_0x2d247f?_0x324661[_0x5f19('0x25')]:_0x2b6b32[_0x5f19('0x23')]+_0x2b6b32['limit'];var _0x5e5547;if(_0x1e24e8>=_0x12d21c){_0x1e24e8=_0x12d21c;_0x5e5547=0xc8;}else{_0x5e5547=0xce;}_0x2c77de[_0x5f19('0x21')](_0x5e5547);return _0x2c77de['set']('Content-Range',_0x17ba99+'-'+_0x1e24e8+'/'+_0x12d21c)[_0x5f19('0x26')](_0x324661);}return null;};}function patchUpdates(_0x47274e){return function(_0x556c3b){try{jsonpatch[_0x5f19('0x27')](_0x556c3b,_0x47274e,!![]);}catch(_0x5a5126){return BPromise['reject'](_0x5a5126);}return _0x556c3b['save']();};}function saveUpdates(_0x1b5400,_0x1a789d){return function(_0x11cb9a){if(_0x11cb9a){return _0x11cb9a[_0x5f19('0x28')](_0x1b5400)['then'](function(_0x58e0bc){return _0x58e0bc;});}return null;};}function removeEntity(_0x1d578a,_0x37d731){return function(_0x1f452f){if(_0x1f452f){return _0x1f452f[_0x5f19('0x29')]()['then'](function(){var _0x140774=_0x1f452f[_0x5f19('0x2a')]({'plain':!![]});var _0x4d86d5=_0x5f19('0x2b');return db[_0x5f19('0x2c')][_0x5f19('0x29')]({'where':{'type':_0x4d86d5,'resourceId':_0x140774['id']}})['then'](function(){return _0x1f452f;});})['then'](function(){_0x1d578a[_0x5f19('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x453362,_0x5e3824){return function(_0x59c672){if(!_0x59c672){_0x453362[_0x5f19('0x20')](0x194);}return _0x59c672;};}function handleError(_0x22e14c,_0x1cd0b0){_0x1cd0b0=_0x1cd0b0||0x1f4;return function(_0x2d765b){logger[_0x5f19('0x2d')](_0x2d765b[_0x5f19('0x2e')]);if(_0x2d765b[_0x5f19('0x2f')]){delete _0x2d765b['name'];}_0x22e14c[_0x5f19('0x21')](_0x1cd0b0)[_0x5f19('0x30')](_0x2d765b);};}exports['index']=function(_0x118858,_0x64bd3e){var _0x1b0521={},_0x1cefdb={},_0x4cd8a9={'count':0x0,'rows':[]};var _0x525da3=_[_0x5f19('0x31')](db[_0x5f19('0x32')][_0x5f19('0x33')],function(_0x5a58c9){return{'name':_0x5a58c9[_0x5f19('0x34')],'type':_0x5a58c9[_0x5f19('0x35')][_0x5f19('0x36')]};});_0x1cefdb[_0x5f19('0x37')]=_[_0x5f19('0x31')](_0x525da3,_0x5f19('0x2f'));_0x1cefdb[_0x5f19('0x38')]=_[_0x5f19('0x39')](_0x118858[_0x5f19('0x38')]);_0x1cefdb['filters']=_[_0x5f19('0x3a')](_0x1cefdb[_0x5f19('0x37')],_0x1cefdb[_0x5f19('0x38')]);_0x1b0521[_0x5f19('0x3b')]=_[_0x5f19('0x3a')](_0x1cefdb['model'],qs[_0x5f19('0x3c')](_0x118858['query'][_0x5f19('0x3c')]));_0x1b0521[_0x5f19('0x3b')]=_0x1b0521['attributes'][_0x5f19('0x3d')]?_0x1b0521[_0x5f19('0x3b')]:_0x1cefdb[_0x5f19('0x37')];if(!_0x118858[_0x5f19('0x38')][_0x5f19('0x3e')]('nolimit')){_0x1b0521[_0x5f19('0x3f')]=qs[_0x5f19('0x3f')](_0x118858[_0x5f19('0x38')][_0x5f19('0x3f')]);_0x1b0521[_0x5f19('0x23')]=qs[_0x5f19('0x23')](_0x118858['query'][_0x5f19('0x23')]);}_0x1b0521[_0x5f19('0x40')]=qs[_0x5f19('0x41')](_0x118858[_0x5f19('0x38')][_0x5f19('0x41')]);_0x1b0521[_0x5f19('0x42')]=qs[_0x5f19('0x43')](_['pick'](_0x118858['query'],_0x1cefdb[_0x5f19('0x43')]),_0x525da3);if(_0x118858[_0x5f19('0x38')][_0x5f19('0x44')]){_0x1b0521['where']=_[_0x5f19('0x45')](_0x1b0521['where'],{'$or':_[_0x5f19('0x31')](_0x525da3,function(_0x567129){if(_0x567129[_0x5f19('0x35')]!==_0x5f19('0x46')){var _0x1dc90b={};_0x1dc90b[_0x567129[_0x5f19('0x2f')]]={'$like':'%'+_0x118858[_0x5f19('0x38')]['filter']+'%'};return _0x1dc90b;}})});}_0x1b0521=_[_0x5f19('0x45')]({},_0x1b0521,_0x118858[_0x5f19('0x47')]);var _0x4ac841={'where':_0x1b0521[_0x5f19('0x42')]};return db[_0x5f19('0x32')]['count'](_0x4ac841)['then'](function(_0x3c45cf){_0x4cd8a9[_0x5f19('0x25')]=_0x3c45cf;if(_0x118858[_0x5f19('0x38')][_0x5f19('0x48')]){_0x1b0521['include']=[{'all':!![]}];}return db[_0x5f19('0x32')][_0x5f19('0x49')](_0x1b0521);})[_0x5f19('0x4a')](function(_0x51b507){_0x4cd8a9[_0x5f19('0x4b')]=_0x51b507;return _0x4cd8a9;})['then'](respondWithFilteredResult(_0x64bd3e,_0x1b0521))[_0x5f19('0x4c')](handleError(_0x64bd3e,null));};exports[_0x5f19('0x4d')]=function(_0x14ddf4,_0x538d56){var _0x935038={'raw':!![],'where':{'id':_0x14ddf4[_0x5f19('0x4e')]['id']}},_0x35ec4c={};_0x35ec4c['model']=_[_0x5f19('0x39')](db[_0x5f19('0x32')][_0x5f19('0x33')]);_0x35ec4c[_0x5f19('0x38')]=_[_0x5f19('0x39')](_0x14ddf4[_0x5f19('0x38')]);_0x35ec4c[_0x5f19('0x43')]=_[_0x5f19('0x3a')](_0x35ec4c[_0x5f19('0x37')],_0x35ec4c[_0x5f19('0x38')]);_0x935038[_0x5f19('0x3b')]=_['intersection'](_0x35ec4c[_0x5f19('0x37')],qs['fields'](_0x14ddf4[_0x5f19('0x38')][_0x5f19('0x3c')]));_0x935038[_0x5f19('0x3b')]=_0x935038[_0x5f19('0x3b')][_0x5f19('0x3d')]?_0x935038[_0x5f19('0x3b')]:_0x35ec4c[_0x5f19('0x37')];if(_0x14ddf4['query'][_0x5f19('0x48')]){_0x935038['include']=[{'all':!![]}];}_0x935038=_[_0x5f19('0x45')]({},_0x935038,_0x14ddf4[_0x5f19('0x47')]);return db[_0x5f19('0x32')][_0x5f19('0x4f')](_0x935038)['then'](handleEntityNotFound(_0x538d56,null))[_0x5f19('0x4a')](respondWithResult(_0x538d56,null))[_0x5f19('0x4c')](handleError(_0x538d56,null));};exports['create']=function(_0x120c49,_0x492df8){return db[_0x5f19('0x32')][_0x5f19('0x50')](_0x120c49[_0x5f19('0x51')],{})['then'](function(_0x44b0e4){var _0x2d25e0=_0x120c49[_0x5f19('0x52')][_0x5f19('0x2a')]({'plain':!![]});if(!_0x2d25e0)throw new Error(_0x5f19('0x53'));if(_0x2d25e0[_0x5f19('0x54')]===_0x5f19('0x52')){var _0x3ade74=_0x44b0e4['get']({'plain':!![]});var _0x211161=_0x5f19('0x2b');return db['UserProfileSection'][_0x5f19('0x4f')]({'where':{'name':_0x211161,'userProfileId':_0x2d25e0[_0x5f19('0x55')]},'raw':!![]})[_0x5f19('0x4a')](function(_0x4a3a14){if(_0x4a3a14&&_0x4a3a14['autoAssociation']===0x0){return db['UserProfileResource'][_0x5f19('0x50')]({'name':_0x3ade74[_0x5f19('0x2f')],'resourceId':_0x3ade74['id'],'type':_0x4a3a14[_0x5f19('0x2f')],'sectionId':_0x4a3a14['id']},{})['then'](function(){return _0x44b0e4;});}else{return _0x44b0e4;}})[_0x5f19('0x4c')](function(_0x697dc){logger['error'](_0x5f19('0x56'),_0x697dc);throw _0x697dc;});}return _0x44b0e4;})[_0x5f19('0x4a')](respondWithResult(_0x492df8,0xc9))[_0x5f19('0x4c')](handleError(_0x492df8,null));};exports['update']=function(_0x21b138,_0x177dd3){if(_0x21b138[_0x5f19('0x51')]['id']){delete _0x21b138[_0x5f19('0x51')]['id'];}return db[_0x5f19('0x32')][_0x5f19('0x4f')]({'where':{'id':_0x21b138[_0x5f19('0x4e')]['id']}})[_0x5f19('0x4a')](handleEntityNotFound(_0x177dd3,null))[_0x5f19('0x4a')](saveUpdates(_0x21b138[_0x5f19('0x51')],null))[_0x5f19('0x4a')](respondWithResult(_0x177dd3,null))[_0x5f19('0x4c')](handleError(_0x177dd3,null));};exports[_0x5f19('0x29')]=function(_0x3d8eb6,_0x14219b){return db[_0x5f19('0x32')][_0x5f19('0x4f')]({'where':{'id':_0x3d8eb6['params']['id']}})[_0x5f19('0x4a')](handleEntityNotFound(_0x14219b,null))['then'](removeEntity(_0x14219b,null))[_0x5f19('0x4c')](handleError(_0x14219b,null));};exports[_0x5f19('0x57')]=function(_0xd5651b,_0xa27e01){return db['FaxQueue'][_0x5f19('0x57')]()[_0x5f19('0x4a')](respondWithResult(_0xa27e01,null))['catch'](handleError(_0xa27e01,null));};exports[_0x5f19('0x58')]=function(_0xde0270,_0x541e86,_0x51265b){var _0x347d3b={'raw':!![],'where':{}},_0x5a4eca={},_0x484711;return db['FaxQueue'][_0x5f19('0x59')]({'where':{'id':_0xde0270['params']['id']}})['then'](handleEntityNotFound(_0x541e86,null))[_0x5f19('0x4a')](function(_0x3f081a){if(_0x3f081a){_0x484711=_0x3f081a[_0x5f19('0x2a')]({'plain':!![]});_0x5a4eca[_0x5f19('0x37')]=_['keys'](db['UserFaxQueue']['rawAttributes']);_0x5a4eca[_0x5f19('0x38')]=_[_0x5f19('0x39')](_0xde0270[_0x5f19('0x38')]);_0x5a4eca[_0x5f19('0x43')]=_[_0x5f19('0x3a')](_0x5a4eca['model'],_0x5a4eca[_0x5f19('0x38')]);_0x347d3b[_0x5f19('0x3b')]=_[_0x5f19('0x3a')](_0x5a4eca['model'],qs[_0x5f19('0x3c')](_0xde0270[_0x5f19('0x38')][_0x5f19('0x3c')]));_0x347d3b[_0x5f19('0x3b')]=_0x347d3b[_0x5f19('0x3b')]['length']?_0x347d3b[_0x5f19('0x3b')]:_0x5a4eca['model'];if(!_0xde0270[_0x5f19('0x38')][_0x5f19('0x3e')](_0x5f19('0x5a'))){_0x347d3b[_0x5f19('0x3f')]=qs[_0x5f19('0x3f')](_0xde0270[_0x5f19('0x38')][_0x5f19('0x3f')]);_0x347d3b[_0x5f19('0x23')]=qs[_0x5f19('0x23')](_0xde0270[_0x5f19('0x38')][_0x5f19('0x23')]);}_0x347d3b[_0x5f19('0x40')]=qs[_0x5f19('0x41')](_0xde0270[_0x5f19('0x38')][_0x5f19('0x41')]);_0x347d3b[_0x5f19('0x42')]=qs[_0x5f19('0x43')](_[_0x5f19('0x5b')](_0xde0270[_0x5f19('0x38')],_0x5a4eca[_0x5f19('0x43')]));_0x347d3b[_0x5f19('0x42')][_0x5f19('0x5c')]=_0x3f081a['id'];if(_0xde0270[_0x5f19('0x38')][_0x5f19('0x44')]){_0x347d3b[_0x5f19('0x42')]=_[_0x5f19('0x45')](_0x347d3b[_0x5f19('0x42')],{'$or':_[_0x5f19('0x31')](_0x347d3b[_0x5f19('0x3b')],function(_0x564e66){var _0x16072c={};_0x16072c[_0x564e66]={'$like':'%'+_0xde0270[_0x5f19('0x38')][_0x5f19('0x44')]+'%'};return _0x16072c;})});}_0x347d3b=_['merge']({},_0x347d3b,_0xde0270[_0x5f19('0x47')]);return db[_0x5f19('0x5d')][_0x5f19('0x49')](_0x347d3b);}})[_0x5f19('0x4a')](function(_0x1499d1){if(_0x1499d1){return db[_0x5f19('0x5e')][_0x5f19('0x5f')]({'where':{'id':_[_0x5f19('0x31')](_0x1499d1,_0x5f19('0x60')),'role':'agent'},'attributes':['id',_0x5f19('0x2f'),_0x5f19('0x61'),'updatedAt','createdAt']});}})[_0x5f19('0x4a')](function(_0x3fa1ab){if(_0x3fa1ab){return{'count':_0x3fa1ab['count'],'rows':_[_0x5f19('0x31')](_0x3fa1ab[_0x5f19('0x4b')],function(_0x16df75){return{'membername':_0x16df75[_0x5f19('0x2f')],'UserId':_0x16df75['id'],'queue_name':_0x484711[_0x5f19('0x2f')],'FaxQueueId':_0x484711['id'],'interface':util[_0x5f19('0x62')](_0x5f19('0x63'),_0x5f19('0x64'),_0x16df75[_0x5f19('0x2f')]),'penalty':0x0,'paused':_0x16df75['faxPause'],'createdAt':_0x16df75[_0x5f19('0x65')],'updatedAt':_0x16df75['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x541e86,_0x347d3b))[_0x5f19('0x4c')](handleError(_0x541e86,null));};exports['getTeams']=function(_0x3085e,_0x44ef3f,_0x572992){var _0x3ba9e3={};var _0x125fcd={};var _0x40da5f;var _0x27ee81;return db[_0x5f19('0x32')]['findOne']({'where':{'id':_0x3085e[_0x5f19('0x4e')]['id']}})[_0x5f19('0x4a')](handleEntityNotFound(_0x44ef3f,null))['then'](function(_0x5bab69){if(_0x5bab69){_0x40da5f=_0x5bab69;_0x125fcd[_0x5f19('0x37')]=_[_0x5f19('0x39')](db['Team'][_0x5f19('0x33')]);_0x125fcd[_0x5f19('0x38')]=_['keys'](_0x3085e['query']);_0x125fcd['filters']=_['intersection'](_0x125fcd[_0x5f19('0x37')],_0x125fcd[_0x5f19('0x38')]);_0x3ba9e3['attributes']=_[_0x5f19('0x3a')](_0x125fcd[_0x5f19('0x37')],qs['fields'](_0x3085e[_0x5f19('0x38')]['fields']));_0x3ba9e3['attributes']=_0x3ba9e3['attributes'][_0x5f19('0x3d')]?_0x3ba9e3[_0x5f19('0x3b')]:_0x125fcd[_0x5f19('0x37')];_0x3ba9e3[_0x5f19('0x40')]=qs[_0x5f19('0x41')](_0x3085e[_0x5f19('0x38')][_0x5f19('0x41')]);_0x3ba9e3[_0x5f19('0x42')]=qs['filters'](_[_0x5f19('0x5b')](_0x3085e['query'],_0x125fcd[_0x5f19('0x43')]));if(_0x3085e[_0x5f19('0x38')][_0x5f19('0x44')]){_0x3ba9e3['where']=_[_0x5f19('0x45')](_0x3ba9e3[_0x5f19('0x42')],{'$or':_[_0x5f19('0x31')](_0x3ba9e3[_0x5f19('0x3b')],function(_0x1f2494){var _0x1dcf1a={};_0x1dcf1a[_0x1f2494]={'$like':'%'+_0x3085e[_0x5f19('0x38')]['filter']+'%'};return _0x1dcf1a;})});}_0x3ba9e3=_[_0x5f19('0x45')]({},_0x3ba9e3,_0x3085e[_0x5f19('0x47')]);return _0x40da5f[_0x5f19('0x66')](_0x3ba9e3);}})['then'](function(_0x32536f){if(_0x32536f){_0x27ee81=_0x32536f['length'];if(!_0x3085e[_0x5f19('0x38')][_0x5f19('0x3e')](_0x5f19('0x5a'))){_0x3ba9e3[_0x5f19('0x3f')]=qs[_0x5f19('0x3f')](_0x3085e[_0x5f19('0x38')][_0x5f19('0x3f')]);_0x3ba9e3['offset']=qs['offset'](_0x3085e[_0x5f19('0x38')][_0x5f19('0x23')]);}return _0x40da5f[_0x5f19('0x66')](_0x3ba9e3);}})['then'](function(_0x53ade5){if(_0x53ade5){return _0x53ade5?{'count':_0x27ee81,'rows':_0x53ade5}:null;}})[_0x5f19('0x4a')](respondWithResult(_0x44ef3f,null))[_0x5f19('0x4c')](handleError(_0x44ef3f,null));};exports[_0x5f19('0x67')]=function(_0x2d24a0,_0x41c51c,_0x16f294){var _0x4cffe9=_0x2d24a0[_0x5f19('0x51')][_0x5f19('0x68')];return db['Team']['findAll']({'where':{'id':_0x4cffe9},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5f19('0x69'),'attributes':['id','name',_0x5f19('0x6a'),_0x5f19('0x6b'),'interface'],'raw':!![]}]})[_0x5f19('0x4a')](function(_0x15e5ac){if(_0x15e5ac){var _0x40eab3=_[_0x5f19('0x6c')](_0x15e5ac,function(_0x57495f){var _0x330871=_0x57495f[_0x5f19('0x2a')]({'plain':!![]});return _0x330871[_0x5f19('0x69')];});return db[_0x5f19('0x32')]['find']({'where':{'id':_0x2d24a0[_0x5f19('0x4e')]['id']}})[_0x5f19('0x4a')](function(_0x53bc7f){return db['sequelize'][_0x5f19('0x6d')](function(_0x584e04){return _0x53bc7f[_0x5f19('0x67')](_0x4cffe9,{'transaction':_0x584e04})[_0x5f19('0x4a')](function(){return BPromise['each'](_0x40eab3,function(_0x52d995){return db[_0x5f19('0x5d')][_0x5f19('0x6e')]({'where':{'UserId':_0x52d995['id'],'FaxQueueId':_0x2d24a0[_0x5f19('0x4e')]['id']},'transaction':_0x584e04});});})[_0x5f19('0x4a')](function(){_0x40eab3[_0x5f19('0x6f')](function(_0x20048){socket[_0x5f19('0x70')](_0x5f19('0x71'),{'UserId':_0x20048['id'],'FaxQueueId':_0x53bc7f['id']});});});});});}})[_0x5f19('0x4a')](respondWithStatusCode(_0x41c51c,null))['catch'](handleError(_0x41c51c,null));};exports[_0x5f19('0x72')]=function(_0x28e9ee,_0x4c5283,_0x36613c){return db['Team'][_0x5f19('0x49')]({'where':{'id':_0x28e9ee[_0x5f19('0x38')][_0x5f19('0x68')]},'attributes':['id'],'include':[{'model':db[_0x5f19('0x5e')],'as':_0x5f19('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4c5283,null))[_0x5f19('0x4a')](function(_0x542288){var _0x1b67f0=_['map'](_0x542288,'id');var _0x1de89e=[];var _0x1a6cf1=[];var _0x43dff9=squel[_0x5f19('0x73')]();_0x43dff9['field'](_0x5f19('0x74'))[_0x5f19('0x75')](_0x5f19('0x76'),'tq')[_0x5f19('0x77')](_0x5f19('0x78'),'ut',_0x5f19('0x79'))[_0x5f19('0x42')](_0x5f19('0x7a'),_0x28e9ee[_0x5f19('0x4e')]['id']);for(var _0x2a48a4=0x0;_0x2a48a4<_0x542288[_0x5f19('0x3d')];_0x2a48a4+=0x1){let _0x1bb21e=_0x542288[_0x2a48a4];for(var _0x521080=0x0;_0x521080<_0x1bb21e[_0x5f19('0x69')]['length'];_0x521080+=0x1){let _0x43850c=_0x1bb21e['Agents'][_0x521080];var _0x4e1a22=_0x43dff9[_0x5f19('0x7b')]();_0x4e1a22[_0x5f19('0x42')](_0x5f19('0x7c'),_0x43850c['id']);_0x1a6cf1[_0x5f19('0x7d')](db[_0x5f19('0x7e')]['query'](_0x4e1a22[_0x5f19('0x7f')](),{'type':db[_0x5f19('0x7e')][_0x5f19('0x80')][_0x5f19('0x81')]})[_0x5f19('0x4a')](function(_0x44ee94){if(_0x44ee94[_0x5f19('0x3d')]===0x1){return _0x43850c['id'];}else{var _0x25c301=_['every'](_[_0x5f19('0x31')](_0x44ee94,_0x5f19('0x82')),function(_0x14a25d){return _['includes'](_0x1b67f0,_0x14a25d);});if(_0x25c301){return _0x43850c['id'];}}}));}}return BPromise[_0x5f19('0x83')](_0x1a6cf1)['then'](function(_0xc93d7c){_0x1de89e=_(_0x1de89e)['union'](_0xc93d7c)[_0x5f19('0x84')]()[_0x5f19('0x85')]();return db['FaxQueue'][_0x5f19('0x4f')]({'where':{'id':_0x28e9ee['params']['id']}})[_0x5f19('0x4a')](function(_0x360c01){return db[_0x5f19('0x7e')][_0x5f19('0x6d')](function(_0x53cf17){return _0x360c01[_0x5f19('0x72')](_0x28e9ee[_0x5f19('0x38')]['ids'],{'transaction':_0x53cf17})['then'](function(){if(!_['isEmpty'](_0x1de89e)){return _0x360c01[_0x5f19('0x86')](_0x1de89e,{'transaction':_0x53cf17});}})['then'](function(){_0x1de89e['forEach'](function(_0x2b32ec){socket['emit']('userFaxQueue:remove',{'UserId':_0x2b32ec,'FaxQueueId':_0x360c01['id']});});});});});});})[_0x5f19('0x4a')](respondWithStatusCode(_0x4c5283,null))[_0x5f19('0x4c')](handleError(_0x4c5283,null));};exports[_0x5f19('0x87')]=function(_0x471395,_0x275a2c,_0x2d2244){return db[_0x5f19('0x32')][_0x5f19('0x4f')]({'where':{'id':_0x471395['params']['id']}})['then'](handleEntityNotFound(_0x275a2c,null))[_0x5f19('0x4a')](function(_0x26dad6){if(_0x26dad6){return _0x26dad6[_0x5f19('0x87')](_0x471395[_0x5f19('0x51')]['ids'],_['omit'](_0x471395['body'],[_0x5f19('0x68'),'id'])||{})[_0x5f19('0x88')](function(_0x5dc0a9){for(var _0x1f2d1c=0x0;_0x1f2d1c<_0x471395[_0x5f19('0x51')][_0x5f19('0x68')][_0x5f19('0x3d')];_0x1f2d1c+=0x1){socket['emit'](_0x5f19('0x71'),{'UserId':Number(_0x471395[_0x5f19('0x51')][_0x5f19('0x68')][_0x1f2d1c]),'FaxQueueId':Number(_0x471395['params']['id'])});}return _0x5dc0a9;});}})['then'](respondWithResult(_0x275a2c,null))['catch'](handleError(_0x275a2c,null));};exports[_0x5f19('0x86')]=function(_0x1e8922,_0x382a82,_0x240e4b){return db[_0x5f19('0x32')][_0x5f19('0x4f')]({'where':{'id':_0x1e8922[_0x5f19('0x4e')]['id']}})[_0x5f19('0x4a')](handleEntityNotFound(_0x382a82,null))[_0x5f19('0x4a')](function(_0x24f094){if(_0x24f094){return _0x24f094['removeAgents'](_0x1e8922[_0x5f19('0x38')][_0x5f19('0x68')])['then'](function(){if(_['isArray'](_0x1e8922[_0x5f19('0x38')]['ids'])){for(var _0x3bf7a6=0x0;_0x3bf7a6<_0x1e8922[_0x5f19('0x38')][_0x5f19('0x68')]['length'];_0x3bf7a6+=0x1){socket[_0x5f19('0x70')]('userFaxQueue:remove',{'UserId':Number(_0x1e8922[_0x5f19('0x38')][_0x5f19('0x68')][_0x3bf7a6]),'FaxQueueId':Number(_0x1e8922[_0x5f19('0x4e')]['id'])});}}else{socket[_0x5f19('0x70')](_0x5f19('0x89'),{'UserId':Number(_0x1e8922[_0x5f19('0x38')]['ids']),'FaxQueueId':Number(_0x1e8922[_0x5f19('0x4e')]['id'])});}});}})[_0x5f19('0x4a')](respondWithStatusCode(_0x382a82,null))['catch'](handleError(_0x382a82,null));};exports[_0x5f19('0x8a')]=function(_0x422705,_0x5edf99,_0x7ca4b6){var _0x4127f2={};var _0x18931f={};var _0x3f7ae7;var _0x2b2079;return db[_0x5f19('0x32')][_0x5f19('0x59')]({'where':{'id':_0x422705[_0x5f19('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5edf99,null))[_0x5f19('0x4a')](function(_0x1937c9){if(_0x1937c9){_0x3f7ae7=_0x1937c9;_0x18931f[_0x5f19('0x37')]=_[_0x5f19('0x39')](db[_0x5f19('0x5e')][_0x5f19('0x33')]);_0x18931f[_0x5f19('0x38')]=_['keys'](_0x422705[_0x5f19('0x38')]);_0x18931f[_0x5f19('0x43')]=_[_0x5f19('0x3a')](_0x18931f[_0x5f19('0x37')],_0x18931f[_0x5f19('0x38')]);_0x4127f2[_0x5f19('0x3b')]=_['intersection'](_0x18931f['model'],qs[_0x5f19('0x3c')](_0x422705[_0x5f19('0x38')]['fields']));_0x4127f2[_0x5f19('0x3b')]=_0x4127f2[_0x5f19('0x3b')][_0x5f19('0x3d')]?_0x4127f2['attributes']:_0x18931f['model'];_0x4127f2['order']=qs['sort'](_0x422705[_0x5f19('0x38')][_0x5f19('0x41')]);_0x4127f2[_0x5f19('0x42')]=qs['filters'](_['pick'](_0x422705[_0x5f19('0x38')],_0x18931f['filters']));if(_0x422705[_0x5f19('0x38')]['filter']){_0x4127f2['where']=_[_0x5f19('0x45')](_0x4127f2[_0x5f19('0x42')],{'$or':_[_0x5f19('0x31')](_0x4127f2[_0x5f19('0x3b')],function(_0x4a4665){var _0x25cc7f={};_0x25cc7f[_0x4a4665]={'$like':'%'+_0x422705[_0x5f19('0x38')][_0x5f19('0x44')]+'%'};return _0x25cc7f;})});}_0x4127f2=_['merge']({},_0x4127f2,_0x422705[_0x5f19('0x47')]);return _0x3f7ae7[_0x5f19('0x8a')](_0x4127f2);}})['then'](function(_0x3a27f2){if(_0x3a27f2){_0x2b2079=_0x3a27f2[_0x5f19('0x3d')];if(!_0x422705[_0x5f19('0x38')]['hasOwnProperty'](_0x5f19('0x5a'))){_0x4127f2[_0x5f19('0x3f')]=qs[_0x5f19('0x3f')](_0x422705[_0x5f19('0x38')][_0x5f19('0x3f')]);_0x4127f2['offset']=qs['offset'](_0x422705[_0x5f19('0x38')][_0x5f19('0x23')]);}return _0x3f7ae7[_0x5f19('0x8a')](_0x4127f2);}})['then'](function(_0x542399){if(_0x542399){return _0x542399?{'count':_0x2b2079,'rows':_0x542399}:null;}})[_0x5f19('0x4a')](respondWithResult(_0x5edf99,null))[_0x5f19('0x4c')](handleError(_0x5edf99,null));}; \ No newline at end of file +var _0xd80a=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','order','sort','FaxQueueId','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','then','get','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','params','intersection','includeAll','options'];(function(_0x3424e5,_0x22d9b0){var _0x12d876=function(_0x578a87){while(--_0x578a87){_0x3424e5['push'](_0x3424e5['shift']());}};_0x12d876(++_0x22d9b0);}(_0xd80a,0x173));var _0xad80=function(_0x40f43b,_0x3e9404){_0x40f43b=_0x40f43b-0x0;var _0x180da6=_0xd80a[_0x40f43b];return _0x180da6;};'use strict';var emlformat=require(_0xad80('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad80('0x1'));var jsonpatch=require(_0xad80('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xad80('0x3'));var Mustache=require(_0xad80('0x4'));var util=require(_0xad80('0x5'));var path=require('path');var sox=require(_0xad80('0x6'));var csv=require('to-csv');var ejs=require(_0xad80('0x7'));var fs=require('fs');var fs_extra=require(_0xad80('0x8'));var _=require(_0xad80('0x9'));var squel=require(_0xad80('0xa'));var crypto=require(_0xad80('0xb'));var jsforce=require(_0xad80('0xc'));var deskjs=require(_0xad80('0xd'));var toCsv=require(_0xad80('0xe'));var querystring=require(_0xad80('0xf'));var Papa=require(_0xad80('0x10'));var Redis=require(_0xad80('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xad80('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xad80('0x13'));var logger=require(_0xad80('0x14'))(_0xad80('0x15'));var utils=require(_0xad80('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xad80('0x17'));var db=require(_0xad80('0x18'))['db'];config['redis']=_[_0xad80('0x19')](config['redis'],{'host':_0xad80('0x1a'),'port':0x18eb});var socket=require(_0xad80('0x1b'))(new Redis(config[_0xad80('0x1c')]));require('./faxQueue.socket')[_0xad80('0x1d')](socket);function respondWithStatusCode(_0x18a3b7,_0x5c5128){_0x5c5128=_0x5c5128||0xcc;return function(_0x1d3a05){if(_0x1d3a05){return _0x18a3b7[_0xad80('0x1e')](_0x5c5128);}return _0x18a3b7[_0xad80('0x1f')](_0x5c5128)[_0xad80('0x20')]();};}function respondWithResult(_0x381eb5,_0x483b07){_0x483b07=_0x483b07||0xc8;return function(_0x5052b3){if(_0x5052b3){return _0x381eb5[_0xad80('0x1f')](_0x483b07)['json'](_0x5052b3);}};}function respondWithFilteredResult(_0x479f7d,_0x4ee344){return function(_0x1ef90d){if(_0x1ef90d){var _0x3e23bb=typeof _0x4ee344[_0xad80('0x21')]===_0xad80('0x22')&&typeof _0x4ee344[_0xad80('0x23')]==='undefined';var _0x15bc3f=_0x1ef90d[_0xad80('0x24')];var _0x2020e3=_0x3e23bb?0x0:_0x4ee344[_0xad80('0x21')];var _0x2e5107=_0x3e23bb?_0x1ef90d[_0xad80('0x24')]:_0x4ee344[_0xad80('0x21')]+_0x4ee344[_0xad80('0x23')];var _0x5e8299;if(_0x2e5107>=_0x15bc3f){_0x2e5107=_0x15bc3f;_0x5e8299=0xc8;}else{_0x5e8299=0xce;}_0x479f7d[_0xad80('0x1f')](_0x5e8299);return _0x479f7d[_0xad80('0x25')](_0xad80('0x26'),_0x2020e3+'-'+_0x2e5107+'/'+_0x15bc3f)[_0xad80('0x27')](_0x1ef90d);}return null;};}function patchUpdates(_0x4635b5){return function(_0x5d6f47){try{jsonpatch[_0xad80('0x28')](_0x5d6f47,_0x4635b5,!![]);}catch(_0xd68a8f){return BPromise['reject'](_0xd68a8f);}return _0x5d6f47[_0xad80('0x29')]();};}function saveUpdates(_0x506aec,_0x5c0566){return function(_0x8956e5){if(_0x8956e5){return _0x8956e5[_0xad80('0x2a')](_0x506aec)['then'](function(_0x15c854){return _0x15c854;});}return null;};}function removeEntity(_0x298d4d,_0x45793d){return function(_0x249529){if(_0x249529){return _0x249529[_0xad80('0x2b')]()[_0xad80('0x2c')](function(){var _0xaedbe4=_0x249529[_0xad80('0x2d')]({'plain':!![]});var _0x2ccfee='FaxQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x2ccfee,'resourceId':_0xaedbe4['id']}})[_0xad80('0x2c')](function(){return _0x249529;});})[_0xad80('0x2c')](function(){_0x298d4d['status'](0xcc)[_0xad80('0x20')]();});}};}function handleEntityNotFound(_0x2387aa,_0x2661d7){return function(_0x1cbcd){if(!_0x1cbcd){_0x2387aa[_0xad80('0x1e')](0x194);}return _0x1cbcd;};}function handleError(_0x10d7f2,_0xa1de73){_0xa1de73=_0xa1de73||0x1f4;return function(_0x25e2b9){logger[_0xad80('0x2e')](_0x25e2b9[_0xad80('0x2f')]);if(_0x25e2b9[_0xad80('0x30')]){delete _0x25e2b9[_0xad80('0x30')];}_0x10d7f2['status'](_0xa1de73)[_0xad80('0x31')](_0x25e2b9);};}exports[_0xad80('0x32')]=function(_0x359577,_0x4d7383){var _0x1d9449={},_0x56438c={},_0xc71630={'count':0x0,'rows':[]};var _0x442828=_[_0xad80('0x33')](db[_0xad80('0x34')][_0xad80('0x35')],function(_0x1799c){return{'name':_0x1799c[_0xad80('0x36')],'type':_0x1799c[_0xad80('0x37')][_0xad80('0x38')]};});_0x56438c[_0xad80('0x39')]=_['map'](_0x442828,'name');_0x56438c[_0xad80('0x3a')]=_[_0xad80('0x3b')](_0x359577['query']);_0x56438c[_0xad80('0x3c')]=_['intersection'](_0x56438c['model'],_0x56438c['query']);_0x1d9449[_0xad80('0x3d')]=_['intersection'](_0x56438c['model'],qs[_0xad80('0x3e')](_0x359577['query'][_0xad80('0x3e')]));_0x1d9449[_0xad80('0x3d')]=_0x1d9449['attributes'][_0xad80('0x3f')]?_0x1d9449[_0xad80('0x3d')]:_0x56438c['model'];if(!_0x359577[_0xad80('0x3a')][_0xad80('0x40')](_0xad80('0x41'))){_0x1d9449[_0xad80('0x23')]=qs['limit'](_0x359577[_0xad80('0x3a')]['limit']);_0x1d9449['offset']=qs[_0xad80('0x21')](_0x359577[_0xad80('0x3a')][_0xad80('0x21')]);}_0x1d9449['order']=qs['sort'](_0x359577['query']['sort']);_0x1d9449[_0xad80('0x42')]=qs[_0xad80('0x3c')](_[_0xad80('0x43')](_0x359577[_0xad80('0x3a')],_0x56438c['filters']),_0x442828);if(_0x359577[_0xad80('0x3a')][_0xad80('0x44')]){_0x1d9449['where']=_[_0xad80('0x45')](_0x1d9449[_0xad80('0x42')],{'$or':_[_0xad80('0x33')](_0x442828,function(_0x51e947){if(_0x51e947[_0xad80('0x37')]!==_0xad80('0x46')){var _0x2b467d={};_0x2b467d[_0x51e947[_0xad80('0x30')]]={'$like':'%'+_0x359577[_0xad80('0x3a')]['filter']+'%'};return _0x2b467d;}})});}_0x1d9449=_[_0xad80('0x45')]({},_0x1d9449,_0x359577['options']);var _0x5f04cf={'where':_0x1d9449['where']};return db[_0xad80('0x34')]['count'](_0x5f04cf)[_0xad80('0x2c')](function(_0x1edc05){_0xc71630[_0xad80('0x24')]=_0x1edc05;if(_0x359577[_0xad80('0x3a')]['includeAll']){_0x1d9449[_0xad80('0x47')]=[{'all':!![]}];}return db[_0xad80('0x34')][_0xad80('0x48')](_0x1d9449);})[_0xad80('0x2c')](function(_0x547e56){_0xc71630[_0xad80('0x49')]=_0x547e56;return _0xc71630;})[_0xad80('0x2c')](respondWithFilteredResult(_0x4d7383,_0x1d9449))[_0xad80('0x4a')](handleError(_0x4d7383,null));};exports['show']=function(_0x46cf62,_0x1ee680){var _0x15ab1b={'raw':!![],'where':{'id':_0x46cf62[_0xad80('0x4b')]['id']}},_0x2c9c93={};_0x2c9c93[_0xad80('0x39')]=_[_0xad80('0x3b')](db[_0xad80('0x34')][_0xad80('0x35')]);_0x2c9c93['query']=_[_0xad80('0x3b')](_0x46cf62['query']);_0x2c9c93['filters']=_['intersection'](_0x2c9c93[_0xad80('0x39')],_0x2c9c93[_0xad80('0x3a')]);_0x15ab1b[_0xad80('0x3d')]=_[_0xad80('0x4c')](_0x2c9c93[_0xad80('0x39')],qs[_0xad80('0x3e')](_0x46cf62[_0xad80('0x3a')][_0xad80('0x3e')]));_0x15ab1b[_0xad80('0x3d')]=_0x15ab1b[_0xad80('0x3d')]['length']?_0x15ab1b[_0xad80('0x3d')]:_0x2c9c93['model'];if(_0x46cf62[_0xad80('0x3a')][_0xad80('0x4d')]){_0x15ab1b['include']=[{'all':!![]}];}_0x15ab1b=_[_0xad80('0x45')]({},_0x15ab1b,_0x46cf62[_0xad80('0x4e')]);return db['FaxQueue']['find'](_0x15ab1b)[_0xad80('0x2c')](handleEntityNotFound(_0x1ee680,null))[_0xad80('0x2c')](respondWithResult(_0x1ee680,null))[_0xad80('0x4a')](handleError(_0x1ee680,null));};exports['create']=function(_0x246dd5,_0x42f8cc){return db['FaxQueue'][_0xad80('0x4f')](_0x246dd5[_0xad80('0x50')],{})[_0xad80('0x2c')](function(_0x316a8c){var _0xf77d1a=_0x246dd5[_0xad80('0x51')][_0xad80('0x2d')]({'plain':!![]});if(!_0xf77d1a)throw new Error(_0xad80('0x52'));if(_0xf77d1a[_0xad80('0x53')]===_0xad80('0x51')){var _0x47ae28=_0x316a8c[_0xad80('0x2d')]({'plain':!![]});var _0x4cf7e8=_0xad80('0x54');return db[_0xad80('0x55')][_0xad80('0x56')]({'where':{'name':_0x4cf7e8,'userProfileId':_0xf77d1a[_0xad80('0x57')]},'raw':!![]})['then'](function(_0x147bc8){if(_0x147bc8&&_0x147bc8[_0xad80('0x58')]===0x0){return db['UserProfileResource'][_0xad80('0x4f')]({'name':_0x47ae28['name'],'resourceId':_0x47ae28['id'],'type':_0x147bc8[_0xad80('0x30')],'sectionId':_0x147bc8['id']},{})['then'](function(){return _0x316a8c;});}else{return _0x316a8c;}})[_0xad80('0x4a')](function(_0x5c1c07){logger[_0xad80('0x2e')](_0xad80('0x59'),_0x5c1c07);throw _0x5c1c07;});}return _0x316a8c;})[_0xad80('0x2c')](respondWithResult(_0x42f8cc,0xc9))[_0xad80('0x4a')](handleError(_0x42f8cc,null));};exports['update']=function(_0x463d8d,_0x437061){if(_0x463d8d['body']['id']){delete _0x463d8d[_0xad80('0x50')]['id'];}return db[_0xad80('0x34')][_0xad80('0x56')]({'where':{'id':_0x463d8d[_0xad80('0x4b')]['id']}})['then'](handleEntityNotFound(_0x437061,null))[_0xad80('0x2c')](saveUpdates(_0x463d8d[_0xad80('0x50')],null))[_0xad80('0x2c')](respondWithResult(_0x437061,null))[_0xad80('0x4a')](handleError(_0x437061,null));};exports[_0xad80('0x2b')]=function(_0x3e953b,_0x23a1c8){return db['FaxQueue'][_0xad80('0x56')]({'where':{'id':_0x3e953b[_0xad80('0x4b')]['id']}})[_0xad80('0x2c')](handleEntityNotFound(_0x23a1c8,null))[_0xad80('0x2c')](removeEntity(_0x23a1c8,null))['catch'](handleError(_0x23a1c8,null));};exports[_0xad80('0x5a')]=function(_0x175d28,_0x4c7c05){return db[_0xad80('0x34')][_0xad80('0x5a')]()[_0xad80('0x2c')](respondWithResult(_0x4c7c05,null))[_0xad80('0x4a')](handleError(_0x4c7c05,null));};exports[_0xad80('0x5b')]=function(_0x2dbf59,_0x38e152,_0x74f028){var _0x3cebca={'raw':!![],'where':{}},_0x1fca8c={},_0x153882;return db['FaxQueue'][_0xad80('0x5c')]({'where':{'id':_0x2dbf59[_0xad80('0x4b')]['id']}})['then'](handleEntityNotFound(_0x38e152,null))['then'](function(_0x3347ba){if(_0x3347ba){_0x153882=_0x3347ba[_0xad80('0x2d')]({'plain':!![]});_0x1fca8c['model']=_[_0xad80('0x3b')](db[_0xad80('0x5d')][_0xad80('0x35')]);_0x1fca8c[_0xad80('0x3a')]=_['keys'](_0x2dbf59[_0xad80('0x3a')]);_0x1fca8c['filters']=_[_0xad80('0x4c')](_0x1fca8c['model'],_0x1fca8c['query']);_0x3cebca[_0xad80('0x3d')]=_[_0xad80('0x4c')](_0x1fca8c[_0xad80('0x39')],qs[_0xad80('0x3e')](_0x2dbf59[_0xad80('0x3a')][_0xad80('0x3e')]));_0x3cebca[_0xad80('0x3d')]=_0x3cebca['attributes'][_0xad80('0x3f')]?_0x3cebca[_0xad80('0x3d')]:_0x1fca8c[_0xad80('0x39')];if(!_0x2dbf59[_0xad80('0x3a')][_0xad80('0x40')](_0xad80('0x41'))){_0x3cebca[_0xad80('0x23')]=qs[_0xad80('0x23')](_0x2dbf59[_0xad80('0x3a')][_0xad80('0x23')]);_0x3cebca[_0xad80('0x21')]=qs[_0xad80('0x21')](_0x2dbf59[_0xad80('0x3a')]['offset']);}_0x3cebca[_0xad80('0x5e')]=qs[_0xad80('0x5f')](_0x2dbf59['query'][_0xad80('0x5f')]);_0x3cebca['where']=qs['filters'](_[_0xad80('0x43')](_0x2dbf59['query'],_0x1fca8c[_0xad80('0x3c')]));_0x3cebca[_0xad80('0x42')][_0xad80('0x60')]=_0x3347ba['id'];if(_0x2dbf59['query']['filter']){_0x3cebca[_0xad80('0x42')]=_[_0xad80('0x45')](_0x3cebca[_0xad80('0x42')],{'$or':_[_0xad80('0x33')](_0x3cebca[_0xad80('0x3d')],function(_0x30040c){var _0x2ee314={};_0x2ee314[_0x30040c]={'$like':'%'+_0x2dbf59[_0xad80('0x3a')]['filter']+'%'};return _0x2ee314;})});}_0x3cebca=_[_0xad80('0x45')]({},_0x3cebca,_0x2dbf59[_0xad80('0x4e')]);return db[_0xad80('0x5d')][_0xad80('0x48')](_0x3cebca);}})[_0xad80('0x2c')](function(_0xc5c198){if(_0xc5c198){return db[_0xad80('0x61')][_0xad80('0x62')]({'where':{'id':_[_0xad80('0x33')](_0xc5c198,_0xad80('0x63')),'role':'agent'},'attributes':['id',_0xad80('0x30'),_0xad80('0x64'),_0xad80('0x65'),_0xad80('0x66')]});}})[_0xad80('0x2c')](function(_0x1d63ec){if(_0x1d63ec){return{'count':_0x1d63ec[_0xad80('0x24')],'rows':_[_0xad80('0x33')](_0x1d63ec[_0xad80('0x49')],function(_0x42a41e){return{'membername':_0x42a41e['name'],'UserId':_0x42a41e['id'],'queue_name':_0x153882[_0xad80('0x30')],'FaxQueueId':_0x153882['id'],'interface':util[_0xad80('0x67')](_0xad80('0x68'),_0xad80('0x69'),_0x42a41e[_0xad80('0x30')]),'penalty':0x0,'paused':_0x42a41e[_0xad80('0x64')],'createdAt':_0x42a41e[_0xad80('0x66')],'updatedAt':_0x42a41e[_0xad80('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xad80('0x2c')](respondWithFilteredResult(_0x38e152,_0x3cebca))[_0xad80('0x4a')](handleError(_0x38e152,null));};exports[_0xad80('0x6a')]=function(_0x368f95,_0x57ef37,_0x174f4d){var _0xe2092b={};var _0x3ffa12={};var _0x43b10f;var _0x25d888;return db[_0xad80('0x34')][_0xad80('0x5c')]({'where':{'id':_0x368f95['params']['id']}})[_0xad80('0x2c')](handleEntityNotFound(_0x57ef37,null))[_0xad80('0x2c')](function(_0x30077){if(_0x30077){_0x43b10f=_0x30077;_0x3ffa12[_0xad80('0x39')]=_[_0xad80('0x3b')](db[_0xad80('0x6b')][_0xad80('0x35')]);_0x3ffa12[_0xad80('0x3a')]=_[_0xad80('0x3b')](_0x368f95['query']);_0x3ffa12[_0xad80('0x3c')]=_[_0xad80('0x4c')](_0x3ffa12[_0xad80('0x39')],_0x3ffa12[_0xad80('0x3a')]);_0xe2092b[_0xad80('0x3d')]=_['intersection'](_0x3ffa12['model'],qs[_0xad80('0x3e')](_0x368f95[_0xad80('0x3a')][_0xad80('0x3e')]));_0xe2092b[_0xad80('0x3d')]=_0xe2092b[_0xad80('0x3d')][_0xad80('0x3f')]?_0xe2092b[_0xad80('0x3d')]:_0x3ffa12['model'];_0xe2092b[_0xad80('0x5e')]=qs[_0xad80('0x5f')](_0x368f95['query'][_0xad80('0x5f')]);_0xe2092b[_0xad80('0x42')]=qs[_0xad80('0x3c')](_[_0xad80('0x43')](_0x368f95[_0xad80('0x3a')],_0x3ffa12[_0xad80('0x3c')]));if(_0x368f95['query'][_0xad80('0x44')]){_0xe2092b[_0xad80('0x42')]=_[_0xad80('0x45')](_0xe2092b['where'],{'$or':_[_0xad80('0x33')](_0xe2092b[_0xad80('0x3d')],function(_0x2284c8){var _0x240b5e={};_0x240b5e[_0x2284c8]={'$like':'%'+_0x368f95['query']['filter']+'%'};return _0x240b5e;})});}_0xe2092b=_[_0xad80('0x45')]({},_0xe2092b,_0x368f95[_0xad80('0x4e')]);return _0x43b10f[_0xad80('0x6a')](_0xe2092b);}})['then'](function(_0x157f3e){if(_0x157f3e){_0x25d888=_0x157f3e[_0xad80('0x3f')];if(!_0x368f95[_0xad80('0x3a')][_0xad80('0x40')]('nolimit')){_0xe2092b[_0xad80('0x23')]=qs[_0xad80('0x23')](_0x368f95['query'][_0xad80('0x23')]);_0xe2092b[_0xad80('0x21')]=qs[_0xad80('0x21')](_0x368f95[_0xad80('0x3a')][_0xad80('0x21')]);}return _0x43b10f[_0xad80('0x6a')](_0xe2092b);}})[_0xad80('0x2c')](function(_0x4de38e){if(_0x4de38e){return _0x4de38e?{'count':_0x25d888,'rows':_0x4de38e}:null;}})[_0xad80('0x2c')](respondWithResult(_0x57ef37,null))[_0xad80('0x4a')](handleError(_0x57ef37,null));};exports['addTeams']=function(_0x4db3bd,_0x5e1652,_0x3f8aba){var _0x4d22e4=_0x4db3bd[_0xad80('0x50')][_0xad80('0x6c')];return db[_0xad80('0x6b')][_0xad80('0x48')]({'where':{'id':_0x4d22e4},'attributes':['id'],'include':[{'model':db[_0xad80('0x61')],'as':_0xad80('0x6d'),'attributes':['id',_0xad80('0x30'),_0xad80('0x6e'),'voicePause',_0xad80('0x6f')],'raw':!![]}]})['then'](function(_0x54c487){if(_0x54c487){var _0x5af9e4=_[_0xad80('0x70')](_0x54c487,function(_0xd666c3){var _0x3cd051=_0xd666c3[_0xad80('0x2d')]({'plain':!![]});return _0x3cd051[_0xad80('0x6d')];});return db[_0xad80('0x34')][_0xad80('0x56')]({'where':{'id':_0x4db3bd[_0xad80('0x4b')]['id']}})[_0xad80('0x2c')](function(_0x30d389){return db['sequelize'][_0xad80('0x71')](function(_0x4f1931){return _0x30d389[_0xad80('0x72')](_0x4d22e4,{'transaction':_0x4f1931})[_0xad80('0x2c')](function(){return BPromise[_0xad80('0x73')](_0x5af9e4,function(_0x21ec73){return db[_0xad80('0x5d')][_0xad80('0x74')]({'where':{'UserId':_0x21ec73['id'],'FaxQueueId':_0x4db3bd[_0xad80('0x4b')]['id']},'transaction':_0x4f1931});});})[_0xad80('0x2c')](function(){_0x5af9e4[_0xad80('0x75')](function(_0x1cf689){socket[_0xad80('0x76')]('userFaxQueue:save',{'UserId':_0x1cf689['id'],'FaxQueueId':_0x30d389['id']});});});});});}})[_0xad80('0x2c')](respondWithStatusCode(_0x5e1652,null))[_0xad80('0x4a')](handleError(_0x5e1652,null));};exports[_0xad80('0x77')]=function(_0x13beed,_0x9f6093,_0x33294d){return db[_0xad80('0x6b')][_0xad80('0x48')]({'where':{'id':_0x13beed[_0xad80('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0xad80('0x61')],'as':_0xad80('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xad80('0x2c')](handleEntityNotFound(_0x9f6093,null))[_0xad80('0x2c')](function(_0xacfff9){var _0x286b68=_[_0xad80('0x33')](_0xacfff9,'id');var _0x3a616e=[];var _0x988464=[];var _0x105523=squel[_0xad80('0x78')]();_0x105523[_0xad80('0x79')](_0xad80('0x7a'))[_0xad80('0x7b')](_0xad80('0x7c'),'tq')[_0xad80('0x7d')](_0xad80('0x7e'),'ut',_0xad80('0x7f'))[_0xad80('0x42')](_0xad80('0x80'),_0x13beed[_0xad80('0x4b')]['id']);for(var _0x3f2a57=0x0;_0x3f2a57<_0xacfff9['length'];_0x3f2a57+=0x1){let _0x2a5e9e=_0xacfff9[_0x3f2a57];for(var _0xe9e155=0x0;_0xe9e155<_0x2a5e9e[_0xad80('0x6d')][_0xad80('0x3f')];_0xe9e155+=0x1){let _0x469bea=_0x2a5e9e['Agents'][_0xe9e155];var _0x52f622=_0x105523[_0xad80('0x81')]();_0x52f622['where'](_0xad80('0x82'),_0x469bea['id']);_0x988464[_0xad80('0x83')](db['sequelize'][_0xad80('0x3a')](_0x52f622[_0xad80('0x84')](),{'type':db[_0xad80('0x85')][_0xad80('0x86')][_0xad80('0x87')]})[_0xad80('0x2c')](function(_0x50bf32){if(_0x50bf32['length']===0x1){return _0x469bea['id'];}else{var _0x580ad3=_[_0xad80('0x88')](_[_0xad80('0x33')](_0x50bf32,_0xad80('0x89')),function(_0x34902d){return _[_0xad80('0x8a')](_0x286b68,_0x34902d);});if(_0x580ad3){return _0x469bea['id'];}}}));}}return BPromise[_0xad80('0x8b')](_0x988464)['then'](function(_0x373ccd){_0x3a616e=_(_0x3a616e)['union'](_0x373ccd)['compact']()[_0xad80('0x8c')]();return db[_0xad80('0x34')][_0xad80('0x56')]({'where':{'id':_0x13beed[_0xad80('0x4b')]['id']}})[_0xad80('0x2c')](function(_0x4f6e3f){return db[_0xad80('0x85')][_0xad80('0x71')](function(_0x3dfe39){return _0x4f6e3f['removeTeams'](_0x13beed[_0xad80('0x3a')][_0xad80('0x6c')],{'transaction':_0x3dfe39})[_0xad80('0x2c')](function(){if(!_[_0xad80('0x8d')](_0x3a616e)){return _0x4f6e3f[_0xad80('0x8e')](_0x3a616e,{'transaction':_0x3dfe39});}})['then'](function(){_0x3a616e[_0xad80('0x75')](function(_0x424efe){socket[_0xad80('0x76')](_0xad80('0x8f'),{'UserId':_0x424efe,'FaxQueueId':_0x4f6e3f['id']});});});});});});})[_0xad80('0x2c')](respondWithStatusCode(_0x9f6093,null))['catch'](handleError(_0x9f6093,null));};exports[_0xad80('0x90')]=function(_0x2bb607,_0x2db158,_0x3c3a02){return db['FaxQueue'][_0xad80('0x56')]({'where':{'id':_0x2bb607['params']['id']}})['then'](handleEntityNotFound(_0x2db158,null))[_0xad80('0x2c')](function(_0x1b081f){if(_0x1b081f){return _0x1b081f[_0xad80('0x90')](_0x2bb607[_0xad80('0x50')][_0xad80('0x6c')],_[_0xad80('0x91')](_0x2bb607['body'],[_0xad80('0x6c'),'id'])||{})[_0xad80('0x92')](function(_0x113324){for(var _0x543c8f=0x0;_0x543c8f<_0x2bb607[_0xad80('0x50')]['ids'][_0xad80('0x3f')];_0x543c8f+=0x1){socket[_0xad80('0x76')](_0xad80('0x93'),{'UserId':Number(_0x2bb607['body'][_0xad80('0x6c')][_0x543c8f]),'FaxQueueId':Number(_0x2bb607[_0xad80('0x4b')]['id'])});}return _0x113324;});}})[_0xad80('0x2c')](respondWithResult(_0x2db158,null))[_0xad80('0x4a')](handleError(_0x2db158,null));};exports['removeAgents']=function(_0x2b6543,_0x164cdc,_0x237d49){return db['FaxQueue'][_0xad80('0x56')]({'where':{'id':_0x2b6543[_0xad80('0x4b')]['id']}})['then'](handleEntityNotFound(_0x164cdc,null))[_0xad80('0x2c')](function(_0x198dd8){if(_0x198dd8){return _0x198dd8['removeAgents'](_0x2b6543[_0xad80('0x3a')][_0xad80('0x6c')])[_0xad80('0x2c')](function(){if(_[_0xad80('0x94')](_0x2b6543[_0xad80('0x3a')][_0xad80('0x6c')])){for(var _0x35fe52=0x0;_0x35fe52<_0x2b6543[_0xad80('0x3a')][_0xad80('0x6c')][_0xad80('0x3f')];_0x35fe52+=0x1){socket[_0xad80('0x76')](_0xad80('0x8f'),{'UserId':Number(_0x2b6543[_0xad80('0x3a')]['ids'][_0x35fe52]),'FaxQueueId':Number(_0x2b6543[_0xad80('0x4b')]['id'])});}}else{socket['emit'](_0xad80('0x8f'),{'UserId':Number(_0x2b6543[_0xad80('0x3a')]['ids']),'FaxQueueId':Number(_0x2b6543[_0xad80('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x164cdc,null))[_0xad80('0x4a')](handleError(_0x164cdc,null));};exports[_0xad80('0x95')]=function(_0x25d739,_0x57cf00,_0xabbabe){var _0x5700d4={};var _0x4a2a8d={};var _0xc05f47;var _0x30bb7a;return db['FaxQueue']['findOne']({'where':{'id':_0x25d739[_0xad80('0x4b')]['id']}})[_0xad80('0x2c')](handleEntityNotFound(_0x57cf00,null))['then'](function(_0x5c57b1){if(_0x5c57b1){_0xc05f47=_0x5c57b1;_0x4a2a8d[_0xad80('0x39')]=_[_0xad80('0x3b')](db[_0xad80('0x61')][_0xad80('0x35')]);_0x4a2a8d[_0xad80('0x3a')]=_[_0xad80('0x3b')](_0x25d739['query']);_0x4a2a8d[_0xad80('0x3c')]=_[_0xad80('0x4c')](_0x4a2a8d[_0xad80('0x39')],_0x4a2a8d['query']);_0x5700d4[_0xad80('0x3d')]=_[_0xad80('0x4c')](_0x4a2a8d[_0xad80('0x39')],qs[_0xad80('0x3e')](_0x25d739[_0xad80('0x3a')][_0xad80('0x3e')]));_0x5700d4['attributes']=_0x5700d4[_0xad80('0x3d')]['length']?_0x5700d4[_0xad80('0x3d')]:_0x4a2a8d[_0xad80('0x39')];_0x5700d4[_0xad80('0x5e')]=qs[_0xad80('0x5f')](_0x25d739[_0xad80('0x3a')][_0xad80('0x5f')]);_0x5700d4[_0xad80('0x42')]=qs[_0xad80('0x3c')](_[_0xad80('0x43')](_0x25d739[_0xad80('0x3a')],_0x4a2a8d[_0xad80('0x3c')]));if(_0x25d739[_0xad80('0x3a')][_0xad80('0x44')]){_0x5700d4[_0xad80('0x42')]=_['merge'](_0x5700d4[_0xad80('0x42')],{'$or':_['map'](_0x5700d4[_0xad80('0x3d')],function(_0x5881bf){var _0x4b604a={};_0x4b604a[_0x5881bf]={'$like':'%'+_0x25d739[_0xad80('0x3a')]['filter']+'%'};return _0x4b604a;})});}_0x5700d4=_[_0xad80('0x45')]({},_0x5700d4,_0x25d739[_0xad80('0x4e')]);return _0xc05f47[_0xad80('0x95')](_0x5700d4);}})[_0xad80('0x2c')](function(_0x29b5d1){if(_0x29b5d1){_0x30bb7a=_0x29b5d1['length'];if(!_0x25d739[_0xad80('0x3a')][_0xad80('0x40')]('nolimit')){_0x5700d4['limit']=qs[_0xad80('0x23')](_0x25d739[_0xad80('0x3a')][_0xad80('0x23')]);_0x5700d4[_0xad80('0x21')]=qs['offset'](_0x25d739[_0xad80('0x3a')][_0xad80('0x21')]);}return _0xc05f47[_0xad80('0x95')](_0x5700d4);}})[_0xad80('0x2c')](function(_0x56bf38){if(_0x56bf38){return _0x56bf38?{'count':_0x30bb7a,'rows':_0x56bf38}:null;}})[_0xad80('0x2c')](respondWithResult(_0x57cf00,null))[_0xad80('0x4a')](handleError(_0x57cf00,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 556d8ca..ef41684 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 _0x8970=['events','FaxQueue','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x70b540,_0x1262f0){var _0x42b140=function(_0x1f162e){while(--_0x1f162e){_0x70b540['push'](_0x70b540['shift']());}};_0x42b140(++_0x1262f0);}(_0x8970,0x1b0));var _0x0897=function(_0x32d04e,_0xbfad4e){_0x32d04e=_0x32d04e-0x0;var _0x37d739=_0x8970[_0x32d04e];return _0x37d739;};'use strict';var EventEmitter=require(_0x0897('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x0897('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0897('0x2'),'afterDestroy':_0x0897('0x3')};function emitEvent(_0x57cbca){return function(_0x4dfdff,_0xb54ddb,_0x333bf0){FaxQueueEvents[_0x0897('0x4')](_0x57cbca+':'+_0x4dfdff['id'],_0x4dfdff);FaxQueueEvents['emit'](_0x57cbca,_0x4dfdff);_0x333bf0(null);};}for(var e in events){if(events[_0x0897('0x5')](e)){var event=events[e];FaxQueue[_0x0897('0x6')](e,emitEvent(event));}}module[_0x0897('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x6bd5=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x18141d,_0x49680d){var _0x26d656=function(_0x2b760e){while(--_0x2b760e){_0x18141d['push'](_0x18141d['shift']());}};_0x26d656(++_0x49680d);}(_0x6bd5,0x125));var _0x56bd=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x6bd5[_0x616290];return _0x453879;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x56bd('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x56bd('0x1')](0x0);var events={'afterCreate':_0x56bd('0x2'),'afterUpdate':_0x56bd('0x3'),'afterDestroy':_0x56bd('0x4')};function emitEvent(_0x1bbe6a){return function(_0x3d1a2e,_0x51d882,_0xff139c){FaxQueueEvents[_0x56bd('0x5')](_0x1bbe6a+':'+_0x3d1a2e['id'],_0x3d1a2e);FaxQueueEvents[_0x56bd('0x5')](_0x1bbe6a,_0x3d1a2e);_0xff139c(null);};}for(var e in events){if(events[_0x56bd('0x6')](e)){var event=events[e];FaxQueue[_0x56bd('0x7')](e,emitEvent(event));}}module[_0x56bd('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index cff44ab..90b03bc 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 _0xd72f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxQueue.attributes','exports','define','fax_queues','util'];(function(_0x6d394d,_0x185b80){var _0x1f0621=function(_0x2e5c81){while(--_0x2e5c81){_0x6d394d['push'](_0x6d394d['shift']());}};_0x1f0621(++_0x185b80);}(_0xd72f,0x1c7));var _0xfd72=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xd72f[_0xf50820];return _0x2a9b10;};'use strict';var _=require('lodash');var util=require(_0xfd72('0x0'));var logger=require(_0xfd72('0x1'))(_0xfd72('0x2'));var moment=require(_0xfd72('0x3'));var BPromise=require(_0xfd72('0x4'));var rp=require(_0xfd72('0x5'));var fs=require('fs');var path=require(_0xfd72('0x6'));var rimraf=require(_0xfd72('0x7'));var config=require('../../config/environment');var attributes=require(_0xfd72('0x8'));module[_0xfd72('0x9')]=function(_0x4fc785,_0x53590e){return _0x4fc785[_0xfd72('0xa')]('FaxQueue',attributes,{'tableName':_0xfd72('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ae5=['bluebird','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','util','../../config/logger','api','moment'];(function(_0x2ee006,_0x518580){var _0x2481b6=function(_0x4a00f8){while(--_0x4a00f8){_0x2ee006['push'](_0x2ee006['shift']());}};_0x2481b6(++_0x518580);}(_0x3ae5,0x124));var _0x53ae=function(_0x3ccb37,_0x2df041){_0x3ccb37=_0x3ccb37-0x0;var _0x16cb31=_0x3ae5[_0x3ccb37];return _0x16cb31;};'use strict';var _=require(_0x53ae('0x0'));var util=require(_0x53ae('0x1'));var logger=require(_0x53ae('0x2'))(_0x53ae('0x3'));var moment=require(_0x53ae('0x4'));var BPromise=require(_0x53ae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x53ae('0x6'));var attributes=require(_0x53ae('0x7'));module[_0x53ae('0x8')]=function(_0x5b7124,_0x417bbc){return _0x5b7124[_0x53ae('0x9')]('FaxQueue',attributes,{'tableName':_0x53ae('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 5355c90..b77e657 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 _0x67a9=['GetFaxQueue','FaxQueue','options','where','attributes','include','map','model','ShowFaxQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','defaults','socket.io-emitter','./faxQueue.socket','request','then','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','info','catch'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x67a9,0xf7));var _0x967a=function(_0x1fa8f5,_0x1e156c){_0x1fa8f5=_0x1fa8f5-0x0;var _0x4d87bc=_0x67a9[_0x1fa8f5];return _0x4d87bc;};'use strict';var _=require(_0x967a('0x0'));var util=require(_0x967a('0x1'));var moment=require('moment');var BPromise=require(_0x967a('0x2'));var rs=require(_0x967a('0x3'));var fs=require('fs');var Redis=require(_0x967a('0x4'));var db=require(_0x967a('0x5'))['db'];var utils=require(_0x967a('0x6'));var logger=require(_0x967a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x967a('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x967a('0x9')]=_[_0x967a('0xa')](config[_0x967a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x967a('0xb'))(new Redis(config[_0x967a('0x9')]));require(_0x967a('0xc'))['register'](socket);function respondWithRpcPromise(_0x5daff9,_0x27951e,_0x570167){return new BPromise(function(_0x43f90f,_0x1726e6){return client[_0x967a('0xd')](_0x5daff9,_0x570167)[_0x967a('0xe')](function(_0xa37e22){logger['info']('FaxQueue,\x20%s,\x20%s',_0x27951e,_0x967a('0xf'));logger[_0x967a('0x10')](_0x967a('0x11'),_0x27951e,'request\x20sent',JSON[_0x967a('0x12')](_0xa37e22));if(_0xa37e22[_0x967a('0x13')]){if(_0xa37e22[_0x967a('0x13')][_0x967a('0x14')]===0x1f4){logger['error'](_0x967a('0x15'),_0x27951e,_0xa37e22[_0x967a('0x13')][_0x967a('0x16')]);return _0x1726e6(_0xa37e22[_0x967a('0x13')][_0x967a('0x16')]);}logger[_0x967a('0x13')](_0x967a('0x15'),_0x27951e,_0xa37e22['error']['message']);return _0x43f90f(_0xa37e22[_0x967a('0x13')]['message']);}else{logger[_0x967a('0x17')](_0x967a('0x15'),_0x27951e,_0x967a('0xf'));_0x43f90f(_0xa37e22['result'][_0x967a('0x16')]);}})[_0x967a('0x18')](function(_0x71745d){logger[_0x967a('0x13')]('FaxQueue,\x20%s,\x20%s',_0x27951e,_0x71745d);_0x1726e6(_0x71745d);});});}exports[_0x967a('0x19')]=function(_0x2dc636){var _0x1b4e9f=this;return new Promise(function(_0x2086d0,_0x2aa718){return db[_0x967a('0x1a')]['findAll']({'raw':_0x2dc636[_0x967a('0x1b')]?_0x2dc636[_0x967a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2dc636[_0x967a('0x1b')]?_0x2dc636[_0x967a('0x1b')][_0x967a('0x1c')]||null:null,'attributes':_0x2dc636[_0x967a('0x1b')]?_0x2dc636['options'][_0x967a('0x1d')]||null:null,'limit':_0x2dc636['options']?_0x2dc636[_0x967a('0x1b')]['limit']||null:null,'include':_0x2dc636[_0x967a('0x1b')]?_0x2dc636[_0x967a('0x1b')][_0x967a('0x1e')]?_[_0x967a('0x1f')](_0x2dc636[_0x967a('0x1b')][_0x967a('0x1e')],function(_0x4962cf){return{'model':db[_0x4962cf['model']],'as':_0x4962cf['as'],'attributes':_0x4962cf[_0x967a('0x1d')],'include':_0x4962cf[_0x967a('0x1e')]?_[_0x967a('0x1f')](_0x4962cf[_0x967a('0x1e')],function(_0x1d5d1d){return{'model':db[_0x1d5d1d[_0x967a('0x20')]],'as':_0x1d5d1d['as'],'attributes':_0x1d5d1d[_0x967a('0x1d')],'include':_0x1d5d1d[_0x967a('0x1e')]?_[_0x967a('0x1f')](_0x1d5d1d[_0x967a('0x1e')],function(_0x5c77b1){return{'model':db[_0x5c77b1['model']],'as':_0x5c77b1['as'],'attributes':_0x5c77b1['attributes']};}):[]};}):[]};}):[]:[]})[_0x967a('0xe')](function(_0x23af72){logger['info'](_0x967a('0x19'),_0x2dc636);logger[_0x967a('0x10')](_0x967a('0x19'),_0x2dc636,JSON[_0x967a('0x12')](_0x23af72));_0x2086d0(_0x23af72);})[_0x967a('0x18')](function(_0x786870){logger['error'](_0x967a('0x19'),_0x786870[_0x967a('0x16')],_0x2dc636);_0x2aa718(_0x1b4e9f['error'](0x1f4,_0x786870[_0x967a('0x16')]));});});};exports[_0x967a('0x21')]=function(_0x433307){var _0x391ef6=this;return new Promise(function(_0x5ad00e,_0x39beb2){return db[_0x967a('0x1a')]['find']({'raw':_0x433307['options']?_0x433307['options']['raw']===undefined?!![]:![]:!![],'where':_0x433307[_0x967a('0x1b')]?_0x433307[_0x967a('0x1b')]['where']||null:null,'attributes':_0x433307[_0x967a('0x1b')]?_0x433307['options'][_0x967a('0x1d')]||null:null,'include':_0x433307[_0x967a('0x1b')]?_0x433307[_0x967a('0x1b')][_0x967a('0x1e')]?_['map'](_0x433307[_0x967a('0x1b')][_0x967a('0x1e')],function(_0x2ac7ac){return{'model':db[_0x2ac7ac[_0x967a('0x20')]],'as':_0x2ac7ac['as'],'attributes':_0x2ac7ac[_0x967a('0x1d')],'include':_0x2ac7ac[_0x967a('0x1e')]?_[_0x967a('0x1f')](_0x2ac7ac['include'],function(_0x3d0ff0){return{'model':db[_0x3d0ff0[_0x967a('0x20')]],'as':_0x3d0ff0['as'],'attributes':_0x3d0ff0[_0x967a('0x1d')],'include':_0x3d0ff0[_0x967a('0x1e')]?_[_0x967a('0x1f')](_0x3d0ff0[_0x967a('0x1e')],function(_0x135f10){return{'model':db[_0x135f10[_0x967a('0x20')]],'as':_0x135f10['as'],'attributes':_0x135f10[_0x967a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x967a('0xe')](function(_0x43a125){logger['info']('ShowFaxQueue',_0x433307);logger['debug']('ShowFaxQueue',_0x433307,JSON[_0x967a('0x12')](_0x43a125));_0x5ad00e(_0x43a125);})[_0x967a('0x18')](function(_0x5cafae){logger['error'](_0x967a('0x21'),_0x5cafae[_0x967a('0x16')],_0x433307);_0x39beb2(_0x391ef6['error'](0x1f4,_0x5cafae[_0x967a('0x16')]));});});}; \ No newline at end of file +var _0x621f=['catch','FaxQueue','findAll','options','raw','attributes','limit','include','map','model','GetFaxQueue','ShowFaxQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x5c4352,_0x565a97){var _0x22b620=function(_0x19d774){while(--_0x19d774){_0x5c4352['push'](_0x5c4352['shift']());}};_0x22b620(++_0x565a97);}(_0x621f,0x1e2));var _0xf621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x621f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf621('0x0'));var util=require(_0xf621('0x1'));var moment=require(_0xf621('0x2'));var BPromise=require(_0xf621('0x3'));var rs=require(_0xf621('0x4'));var fs=require('fs');var Redis=require(_0xf621('0x5'));var db=require(_0xf621('0x6'))['db'];var utils=require(_0xf621('0x7'));var logger=require(_0xf621('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf621('0x9'));var client=jayson[_0xf621('0xa')]['http']({'port':0x232a});config[_0xf621('0xb')]=_['defaults'](config[_0xf621('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0xf621('0xc')](socket);function respondWithRpcPromise(_0x6674f1,_0x1c2ecb,_0x3f5751){return new BPromise(function(_0x4f88c1,_0x46aa23){return client[_0xf621('0xd')](_0x6674f1,_0x3f5751)[_0xf621('0xe')](function(_0x3363e7){logger[_0xf621('0xf')](_0xf621('0x10'),_0x1c2ecb,'request\x20sent');logger[_0xf621('0x11')](_0xf621('0x12'),_0x1c2ecb,_0xf621('0x13'),JSON[_0xf621('0x14')](_0x3363e7));if(_0x3363e7[_0xf621('0x15')]){if(_0x3363e7[_0xf621('0x15')][_0xf621('0x16')]===0x1f4){logger[_0xf621('0x15')](_0xf621('0x10'),_0x1c2ecb,_0x3363e7[_0xf621('0x15')][_0xf621('0x17')]);return _0x46aa23(_0x3363e7[_0xf621('0x15')]['message']);}logger[_0xf621('0x15')](_0xf621('0x10'),_0x1c2ecb,_0x3363e7[_0xf621('0x15')][_0xf621('0x17')]);return _0x4f88c1(_0x3363e7[_0xf621('0x15')][_0xf621('0x17')]);}else{logger[_0xf621('0xf')](_0xf621('0x10'),_0x1c2ecb,_0xf621('0x13'));_0x4f88c1(_0x3363e7[_0xf621('0x18')]['message']);}})[_0xf621('0x19')](function(_0x14d1e5){logger['error'](_0xf621('0x10'),_0x1c2ecb,_0x14d1e5);_0x46aa23(_0x14d1e5);});});}exports['GetFaxQueue']=function(_0x1937ac){var _0x4b9914=this;return new Promise(function(_0x91b89c,_0x52428a){return db[_0xf621('0x1a')][_0xf621('0x1b')]({'raw':_0x1937ac[_0xf621('0x1c')]?_0x1937ac['options'][_0xf621('0x1d')]===undefined?!![]:![]:!![],'where':_0x1937ac['options']?_0x1937ac[_0xf621('0x1c')]['where']||null:null,'attributes':_0x1937ac[_0xf621('0x1c')]?_0x1937ac[_0xf621('0x1c')][_0xf621('0x1e')]||null:null,'limit':_0x1937ac[_0xf621('0x1c')]?_0x1937ac[_0xf621('0x1c')][_0xf621('0x1f')]||null:null,'include':_0x1937ac[_0xf621('0x1c')]?_0x1937ac[_0xf621('0x1c')][_0xf621('0x20')]?_[_0xf621('0x21')](_0x1937ac[_0xf621('0x1c')][_0xf621('0x20')],function(_0x3816d5){return{'model':db[_0x3816d5[_0xf621('0x22')]],'as':_0x3816d5['as'],'attributes':_0x3816d5['attributes'],'include':_0x3816d5[_0xf621('0x20')]?_['map'](_0x3816d5[_0xf621('0x20')],function(_0x3eaa17){return{'model':db[_0x3eaa17[_0xf621('0x22')]],'as':_0x3eaa17['as'],'attributes':_0x3eaa17['attributes'],'include':_0x3eaa17[_0xf621('0x20')]?_[_0xf621('0x21')](_0x3eaa17[_0xf621('0x20')],function(_0x74cb88){return{'model':db[_0x74cb88['model']],'as':_0x74cb88['as'],'attributes':_0x74cb88[_0xf621('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf621('0xe')](function(_0x39955e){logger[_0xf621('0xf')]('GetFaxQueue',_0x1937ac);logger[_0xf621('0x11')](_0xf621('0x23'),_0x1937ac,JSON[_0xf621('0x14')](_0x39955e));_0x91b89c(_0x39955e);})[_0xf621('0x19')](function(_0x43c1c0){logger[_0xf621('0x15')](_0xf621('0x23'),_0x43c1c0['message'],_0x1937ac);_0x52428a(_0x4b9914[_0xf621('0x15')](0x1f4,_0x43c1c0[_0xf621('0x17')]));});});};exports[_0xf621('0x24')]=function(_0x472c8c){var _0x5e8e45=this;return new Promise(function(_0x3a0e7f,_0x422b4b){return db['FaxQueue'][_0xf621('0x25')]({'raw':_0x472c8c[_0xf621('0x1c')]?_0x472c8c[_0xf621('0x1c')][_0xf621('0x1d')]===undefined?!![]:![]:!![],'where':_0x472c8c['options']?_0x472c8c['options'][_0xf621('0x26')]||null:null,'attributes':_0x472c8c[_0xf621('0x1c')]?_0x472c8c['options'][_0xf621('0x1e')]||null:null,'include':_0x472c8c[_0xf621('0x1c')]?_0x472c8c[_0xf621('0x1c')][_0xf621('0x20')]?_[_0xf621('0x21')](_0x472c8c[_0xf621('0x1c')][_0xf621('0x20')],function(_0x45d5a3){return{'model':db[_0x45d5a3[_0xf621('0x22')]],'as':_0x45d5a3['as'],'attributes':_0x45d5a3[_0xf621('0x1e')],'include':_0x45d5a3['include']?_[_0xf621('0x21')](_0x45d5a3[_0xf621('0x20')],function(_0x59b1d2){return{'model':db[_0x59b1d2[_0xf621('0x22')]],'as':_0x59b1d2['as'],'attributes':_0x59b1d2[_0xf621('0x1e')],'include':_0x59b1d2[_0xf621('0x20')]?_[_0xf621('0x21')](_0x59b1d2[_0xf621('0x20')],function(_0x29a8b0){return{'model':db[_0x29a8b0[_0xf621('0x22')]],'as':_0x29a8b0['as'],'attributes':_0x29a8b0[_0xf621('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf621('0xe')](function(_0x20c900){logger[_0xf621('0xf')]('ShowFaxQueue',_0x472c8c);logger[_0xf621('0x11')]('ShowFaxQueue',_0x472c8c,JSON[_0xf621('0x14')](_0x20c900));_0x3a0e7f(_0x20c900);})[_0xf621('0x19')](function(_0x63760e){logger['error']('ShowFaxQueue',_0x63760e['message'],_0x472c8c);_0x422b4b(_0x5e8e45['error'](0x1f4,_0x63760e[_0xf621('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 57943af..39c657d 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 _0x30d1=['register','./faxQueue.events','save','remove','update','emit','removeListener'];(function(_0x529be5,_0x20e047){var _0x50826a=function(_0x3cac56){while(--_0x3cac56){_0x529be5['push'](_0x529be5['shift']());}};_0x50826a(++_0x20e047);}(_0x30d1,0x127));var _0x130d=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0x30d1[_0x434783];return _0x13efcf;};'use strict';var FaxQueueEvents=require(_0x130d('0x0'));var events=[_0x130d('0x1'),_0x130d('0x2'),_0x130d('0x3')];function createListener(_0x467c1b,_0x41b1e4){return function(_0x4634f3){_0x41b1e4[_0x130d('0x4')](_0x467c1b,_0x4634f3);};}function removeListener(_0x108828,_0x4b058e){return function(){FaxQueueEvents[_0x130d('0x5')](_0x108828,_0x4b058e);};}exports[_0x130d('0x6')]=function(_0x23d5b3){for(var _0x375c5a=0x0,_0x51fa39=events['length'];_0x375c5a<_0x51fa39;_0x375c5a++){var _0x4ebad4=events[_0x375c5a];var _0x47705e=createListener('faxQueue:'+_0x4ebad4,_0x23d5b3);FaxQueueEvents['on'](_0x4ebad4,_0x47705e);}}; \ No newline at end of file +var _0x0967=['update','removeListener','register','length','faxQueue:','./faxQueue.events'];(function(_0x520aca,_0x5b38d1){var _0x48796d=function(_0x3f716f){while(--_0x3f716f){_0x520aca['push'](_0x520aca['shift']());}};_0x48796d(++_0x5b38d1);}(_0x0967,0x173));var _0x7096=function(_0xc64636,_0xd44842){_0xc64636=_0xc64636-0x0;var _0x51cb18=_0x0967[_0xc64636];return _0x51cb18;};'use strict';var FaxQueueEvents=require(_0x7096('0x0'));var events=['save','remove',_0x7096('0x1')];function createListener(_0x369487,_0x59ecd8){return function(_0x2d573d){_0x59ecd8['emit'](_0x369487,_0x2d573d);};}function removeListener(_0x5ae39e,_0x377c8f){return function(){FaxQueueEvents[_0x7096('0x2')](_0x5ae39e,_0x377c8f);};}exports[_0x7096('0x3')]=function(_0x349de2){for(var _0x58f55b=0x0,_0x3b16a9=events[_0x7096('0x4')];_0x58f55b<_0x3b16a9;_0x58f55b++){var _0x12fb9d=events[_0x58f55b];var _0x415293=createListener(_0x7096('0x5')+_0x12fb9d,_0x349de2);FaxQueueEvents['on'](_0x12fb9d,_0x415293);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index dcc7a3a..732a4e5 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 _0xfdbd=['getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addAgents','put','/:id','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','isAuthenticated','index','describe','get','show','/:id/members'];(function(_0x1129a7,_0x1c88c7){var _0x38dffa=function(_0x4b3673){while(--_0x4b3673){_0x1129a7['push'](_0x1129a7['shift']());}};_0x38dffa(++_0x1c88c7);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x3441e9,_0x269c8a){_0x3441e9=_0x3441e9-0x0;var _0x7f9ada=_0xfdbd[_0x3441e9];return _0x7f9ada;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var fs_extra=require(_0xdfdb('0x6'));var auth=require(_0xdfdb('0x7'));var interaction=require(_0xdfdb('0x8'));var config=require('../../config/environment');var controller=require(_0xdfdb('0x9'));router['get']('/',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xd')](_0xdfdb('0xf'),auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x10')]);router[_0xdfdb('0xd')]('/:id/teams',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x11')]);router['get'](_0xdfdb('0x12'),auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x13')]);router[_0xdfdb('0x14')]('/',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x15')]);router[_0xdfdb('0x14')](_0xdfdb('0x16'),auth['isAuthenticated'](),controller['addTeams']);router[_0xdfdb('0x14')]('/:id/users',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x17')]);router[_0xdfdb('0x18')](_0xdfdb('0x19'),auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x1a')]);router['delete']('/:id',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x1b')]);router[_0xdfdb('0x1c')]('/:id/teams',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x1d')]);router[_0xdfdb('0x1c')](_0xdfdb('0x12'),auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x1e')]);module[_0xdfdb('0x1f')]=router; \ No newline at end of file +var _0x82d8=['update','delete','destroy','removeAgents','exports','multer','path','Router','../../components/auth/service','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put'];(function(_0x4df8f5,_0x69a011){var _0x3043e8=function(_0x1f927d){while(--_0x1f927d){_0x4df8f5['push'](_0x4df8f5['shift']());}};_0x3043e8(++_0x69a011);}(_0x82d8,0xff));var _0x882d=function(_0x2ec442,_0x326fd6){_0x2ec442=_0x2ec442-0x0;var _0x547a9f=_0x82d8[_0x2ec442];return _0x547a9f;};'use strict';var multer=require(_0x882d('0x0'));var util=require('util');var path=require(_0x882d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x882d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x882d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x882d('0x4'));router[_0x882d('0x5')]('/',auth[_0x882d('0x6')](),controller[_0x882d('0x7')]);router[_0x882d('0x5')](_0x882d('0x8'),auth[_0x882d('0x6')](),controller['describe']);router[_0x882d('0x5')](_0x882d('0x9'),auth[_0x882d('0x6')](),controller['show']);router[_0x882d('0x5')](_0x882d('0xa'),auth['isAuthenticated'](),controller[_0x882d('0xb')]);router[_0x882d('0x5')](_0x882d('0xc'),auth['isAuthenticated'](),controller[_0x882d('0xd')]);router[_0x882d('0x5')](_0x882d('0xe'),auth[_0x882d('0x6')](),controller[_0x882d('0xf')]);router[_0x882d('0x10')]('/',auth[_0x882d('0x6')](),controller['create']);router['post'](_0x882d('0xc'),auth[_0x882d('0x6')](),controller[_0x882d('0x11')]);router[_0x882d('0x10')](_0x882d('0xe'),auth['isAuthenticated'](),controller[_0x882d('0x12')]);router[_0x882d('0x13')](_0x882d('0x9'),auth[_0x882d('0x6')](),controller[_0x882d('0x14')]);router[_0x882d('0x15')](_0x882d('0x9'),auth[_0x882d('0x6')](),controller[_0x882d('0x16')]);router['delete']('/:id/teams',auth[_0x882d('0x6')](),controller['removeTeams']);router[_0x882d('0x15')]('/:id/users',auth[_0x882d('0x6')](),controller[_0x882d('0x17')]);module[_0x882d('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 677970b..b7c205c 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 _0x4e8d=['DATE','STRING','moment','exports'];(function(_0x39c6b5,_0x3c4093){var _0x41e989=function(_0x3bf8c4){while(--_0x3bf8c4){_0x39c6b5['push'](_0x39c6b5['shift']());}};_0x41e989(++_0x3c4093);}(_0x4e8d,0x156));var _0xd4e8=function(_0x1c7ccc,_0x39ffd1){_0x1c7ccc=_0x1c7ccc-0x0;var _0x150e39=_0x4e8d[_0x1c7ccc];return _0x150e39;};'use strict';var moment=require(_0xd4e8('0x0'));var Sequelize=require('sequelize');module[_0xd4e8('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd4e8('0x2')]},'leaveAt':{'type':Sequelize[_0xd4e8('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd4e8('0x2')]},'reason':{'type':Sequelize[_0xd4e8('0x3')]}}; \ No newline at end of file +var _0x8584=['sequelize','exports','STRING','DATE'];(function(_0x6d83a5,_0x5c4ec5){var _0x4a50d5=function(_0x322b53){while(--_0x322b53){_0x6d83a5['push'](_0x6d83a5['shift']());}};_0x4a50d5(++_0x5c4ec5);}(_0x8584,0x16c));var _0x4858=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x8584[_0x3e5086];return _0xfeb102;};'use strict';var moment=require('moment');var Sequelize=require(_0x4858('0x0'));module[_0x4858('0x1')]={'uniqueid':{'type':Sequelize[_0x4858('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4858('0x2')]},'joinAt':{'type':Sequelize[_0x4858('0x3')]},'leaveAt':{'type':Sequelize[_0x4858('0x3')]},'acceptAt':{'type':Sequelize[_0x4858('0x3')]},'exitAt':{'type':Sequelize[_0x4858('0x3')]},'reason':{'type':Sequelize[_0x4858('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index e6fa023..d97c4c3 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 _0x83f1=['sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','show','params','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path'];(function(_0x1e63f1,_0xe3c3cc){var _0x5bc880=function(_0x106961){while(--_0x106961){_0x1e63f1['push'](_0x1e63f1['shift']());}};_0x5bc880(++_0xe3c3cc);}(_0x83f1,0x1cc));var _0x183f=function(_0x245a26,_0x57c49e){_0x245a26=_0x245a26-0x0;var _0x3b87b9=_0x83f1[_0x245a26];return _0x3b87b9;};'use strict';var emlformat=require(_0x183f('0x0'));var rimraf=require(_0x183f('0x1'));var zipdir=require(_0x183f('0x2'));var jsonpatch=require(_0x183f('0x3'));var rp=require(_0x183f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x183f('0x5'));var util=require(_0x183f('0x6'));var path=require(_0x183f('0x7'));var sox=require(_0x183f('0x8'));var csv=require(_0x183f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x183f('0xa'));var _=require(_0x183f('0xb'));var squel=require(_0x183f('0xc'));var crypto=require('crypto');var jsforce=require(_0x183f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x183f('0x9'));var querystring=require(_0x183f('0xe'));var Papa=require(_0x183f('0xf'));var Redis=require(_0x183f('0x10'));var authService=require(_0x183f('0x11'));var qs=require(_0x183f('0x12'));var as=require(_0x183f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x183f('0x14'))(_0x183f('0x15'));var utils=require(_0x183f('0x16'));var config=require(_0x183f('0x17'));var licenseUtil=require(_0x183f('0x18'));var db=require(_0x183f('0x19'))['db'];function respondWithStatusCode(_0x16572d,_0x5e638c){_0x5e638c=_0x5e638c||0xcc;return function(_0x29452c){if(_0x29452c){return _0x16572d['sendStatus'](_0x5e638c);}return _0x16572d['status'](_0x5e638c)[_0x183f('0x1a')]();};}function respondWithResult(_0x417e1c,_0x37335a){_0x37335a=_0x37335a||0xc8;return function(_0x103526){if(_0x103526){return _0x417e1c[_0x183f('0x1b')](_0x37335a)['json'](_0x103526);}};}function respondWithFilteredResult(_0x170f43,_0x550a50){return function(_0x3e5994){if(_0x3e5994){var _0x357f65=typeof _0x550a50[_0x183f('0x1c')]==='undefined'&&typeof _0x550a50[_0x183f('0x1d')]===_0x183f('0x1e');var _0x3db030=_0x3e5994['count'];var _0x284244=_0x357f65?0x0:_0x550a50[_0x183f('0x1c')];var _0x2c3468=_0x357f65?_0x3e5994[_0x183f('0x1f')]:_0x550a50[_0x183f('0x1c')]+_0x550a50[_0x183f('0x1d')];var _0x5e7196;if(_0x2c3468>=_0x3db030){_0x2c3468=_0x3db030;_0x5e7196=0xc8;}else{_0x5e7196=0xce;}_0x170f43[_0x183f('0x1b')](_0x5e7196);return _0x170f43[_0x183f('0x20')](_0x183f('0x21'),_0x284244+'-'+_0x2c3468+'/'+_0x3db030)['json'](_0x3e5994);}return null;};}function patchUpdates(_0x26a103){return function(_0x4ad044){try{jsonpatch[_0x183f('0x22')](_0x4ad044,_0x26a103,!![]);}catch(_0x28e9c5){return BPromise[_0x183f('0x23')](_0x28e9c5);}return _0x4ad044[_0x183f('0x24')]();};}function saveUpdates(_0x52ef31,_0x3a1bec){return function(_0x29a5cb){if(_0x29a5cb){return _0x29a5cb[_0x183f('0x25')](_0x52ef31)[_0x183f('0x26')](function(_0x3871b7){return _0x3871b7;});}return null;};}function removeEntity(_0xde34f,_0x2b0f17){return function(_0x129ba5){if(_0x129ba5){return _0x129ba5[_0x183f('0x27')]()[_0x183f('0x26')](function(){_0xde34f['status'](0xcc)[_0x183f('0x1a')]();});}};}function handleEntityNotFound(_0x4d6ccf,_0x583326){return function(_0x427ea6){if(!_0x427ea6){_0x4d6ccf[_0x183f('0x28')](0x194);}return _0x427ea6;};}function handleError(_0x6c2913,_0x30e6bf){_0x30e6bf=_0x30e6bf||0x1f4;return function(_0x3fd9de){logger[_0x183f('0x29')](_0x3fd9de[_0x183f('0x2a')]);if(_0x3fd9de[_0x183f('0x2b')]){delete _0x3fd9de[_0x183f('0x2b')];}_0x6c2913[_0x183f('0x1b')](_0x30e6bf)[_0x183f('0x2c')](_0x3fd9de);};}exports[_0x183f('0x2d')]=function(_0x110853,_0x8e331b){var _0xb7a748={},_0x43bd3c={},_0x3566bf={'count':0x0,'rows':[]};var _0x483496=_['map'](db[_0x183f('0x2e')][_0x183f('0x2f')],function(_0x51e7f1){return{'name':_0x51e7f1[_0x183f('0x30')],'type':_0x51e7f1['type']['key']};});_0x43bd3c[_0x183f('0x31')]=_[_0x183f('0x32')](_0x483496,_0x183f('0x2b'));_0x43bd3c[_0x183f('0x33')]=_[_0x183f('0x34')](_0x110853[_0x183f('0x33')]);_0x43bd3c[_0x183f('0x35')]=_[_0x183f('0x36')](_0x43bd3c[_0x183f('0x31')],_0x43bd3c['query']);_0xb7a748[_0x183f('0x37')]=_[_0x183f('0x36')](_0x43bd3c[_0x183f('0x31')],qs[_0x183f('0x38')](_0x110853[_0x183f('0x33')]['fields']));_0xb7a748[_0x183f('0x37')]=_0xb7a748[_0x183f('0x37')]['length']?_0xb7a748[_0x183f('0x37')]:_0x43bd3c['model'];if(!_0x110853[_0x183f('0x33')][_0x183f('0x39')](_0x183f('0x3a'))){_0xb7a748[_0x183f('0x1d')]=qs['limit'](_0x110853[_0x183f('0x33')]['limit']);_0xb7a748[_0x183f('0x1c')]=qs[_0x183f('0x1c')](_0x110853['query'][_0x183f('0x1c')]);}_0xb7a748[_0x183f('0x3b')]=qs['sort'](_0x110853[_0x183f('0x33')][_0x183f('0x3c')]);_0xb7a748[_0x183f('0x3d')]=qs[_0x183f('0x35')](_[_0x183f('0x3e')](_0x110853[_0x183f('0x33')],_0x43bd3c[_0x183f('0x35')]),_0x483496);if(_0x110853[_0x183f('0x33')][_0x183f('0x3f')]){_0xb7a748['where']=_[_0x183f('0x40')](_0xb7a748[_0x183f('0x3d')],{'$or':_[_0x183f('0x32')](_0x483496,function(_0x458942){if(_0x458942[_0x183f('0x41')]!==_0x183f('0x42')){var _0x512f3f={};_0x512f3f[_0x458942[_0x183f('0x2b')]]={'$like':'%'+_0x110853[_0x183f('0x33')][_0x183f('0x3f')]+'%'};return _0x512f3f;}})});}_0xb7a748=_['merge']({},_0xb7a748,_0x110853[_0x183f('0x43')]);var _0x1c9eb6={'where':_0xb7a748[_0x183f('0x3d')]};return db[_0x183f('0x2e')][_0x183f('0x1f')](_0x1c9eb6)[_0x183f('0x26')](function(_0x4fe2ce){_0x3566bf[_0x183f('0x1f')]=_0x4fe2ce;if(_0x110853[_0x183f('0x33')][_0x183f('0x44')]){_0xb7a748[_0x183f('0x45')]=[{'all':!![]}];}return db[_0x183f('0x2e')]['findAll'](_0xb7a748);})[_0x183f('0x26')](function(_0x502c1a){_0x3566bf['rows']=_0x502c1a;return _0x3566bf;})[_0x183f('0x26')](respondWithFilteredResult(_0x8e331b,_0xb7a748))['catch'](handleError(_0x8e331b,null));};exports[_0x183f('0x46')]=function(_0x37214f,_0x546f14){var _0x107d04={'raw':!![],'where':{'id':_0x37214f[_0x183f('0x47')]['id']}},_0x118385={};_0x118385[_0x183f('0x31')]=_[_0x183f('0x34')](db[_0x183f('0x2e')][_0x183f('0x2f')]);_0x118385[_0x183f('0x33')]=_['keys'](_0x37214f[_0x183f('0x33')]);_0x118385[_0x183f('0x35')]=_[_0x183f('0x36')](_0x118385[_0x183f('0x31')],_0x118385[_0x183f('0x33')]);_0x107d04[_0x183f('0x37')]=_[_0x183f('0x36')](_0x118385[_0x183f('0x31')],qs[_0x183f('0x38')](_0x37214f[_0x183f('0x33')][_0x183f('0x38')]));_0x107d04[_0x183f('0x37')]=_0x107d04[_0x183f('0x37')][_0x183f('0x48')]?_0x107d04['attributes']:_0x118385[_0x183f('0x31')];if(_0x37214f[_0x183f('0x33')]['includeAll']){_0x107d04[_0x183f('0x45')]=[{'all':!![]}];}_0x107d04=_[_0x183f('0x40')]({},_0x107d04,_0x37214f[_0x183f('0x43')]);return db[_0x183f('0x2e')][_0x183f('0x49')](_0x107d04)['then'](handleEntityNotFound(_0x546f14,null))['then'](respondWithResult(_0x546f14,null))[_0x183f('0x4a')](handleError(_0x546f14,null));};exports[_0x183f('0x4b')]=function(_0x569354,_0x34f49e){return db[_0x183f('0x2e')]['create'](_0x569354[_0x183f('0x4c')],{})[_0x183f('0x26')](respondWithResult(_0x34f49e,0xc9))[_0x183f('0x4a')](handleError(_0x34f49e,null));};exports['update']=function(_0x2488ad,_0x5f9312){if(_0x2488ad[_0x183f('0x4c')]['id']){delete _0x2488ad[_0x183f('0x4c')]['id'];}return db[_0x183f('0x2e')][_0x183f('0x49')]({'where':{'id':_0x2488ad['params']['id']}})[_0x183f('0x26')](handleEntityNotFound(_0x5f9312,null))[_0x183f('0x26')](saveUpdates(_0x2488ad['body'],null))['then'](respondWithResult(_0x5f9312,null))[_0x183f('0x4a')](handleError(_0x5f9312,null));};exports[_0x183f('0x27')]=function(_0x4c4554,_0x2c79b7){return db[_0x183f('0x2e')]['find']({'where':{'id':_0x4c4554[_0x183f('0x47')]['id']}})['then'](handleEntityNotFound(_0x2c79b7,null))[_0x183f('0x26')](removeEntity(_0x2c79b7,null))[_0x183f('0x4a')](handleError(_0x2c79b7,null));};exports[_0x183f('0x4d')]=function(_0x23aeb3,_0x5b609f){return db[_0x183f('0x2e')][_0x183f('0x4d')]()['then'](respondWithResult(_0x5b609f,null))['catch'](handleError(_0x5b609f,null));}; \ No newline at end of file +var _0x0f9f=['create','body','update','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','keys','filters','intersection','attributes','model','fields','query','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch'];(function(_0x4bdfc6,_0x4c2991){var _0x5091d0=function(_0x16cdc1){while(--_0x16cdc1){_0x4bdfc6['push'](_0x4bdfc6['shift']());}};_0x5091d0(++_0x4c2991);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x5fe5ca,_0x4e92d3){_0x5fe5ca=_0x5fe5ca-0x0;var _0x42f45f=_0x0f9f[_0x5fe5ca];return _0x42f45f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf0f9('0x0'));var zipdir=require(_0xf0f9('0x1'));var jsonpatch=require(_0xf0f9('0x2'));var rp=require('request-promise');var moment=require(_0xf0f9('0x3'));var BPromise=require(_0xf0f9('0x4'));var Mustache=require(_0xf0f9('0x5'));var util=require(_0xf0f9('0x6'));var path=require(_0xf0f9('0x7'));var sox=require(_0xf0f9('0x8'));var csv=require(_0xf0f9('0x9'));var ejs=require(_0xf0f9('0xa'));var fs=require('fs');var fs_extra=require(_0xf0f9('0xb'));var _=require(_0xf0f9('0xc'));var squel=require('squel');var crypto=require(_0xf0f9('0xd'));var jsforce=require(_0xf0f9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf0f9('0x9'));var querystring=require(_0xf0f9('0xf'));var Papa=require(_0xf0f9('0x10'));var Redis=require('ioredis');var authService=require(_0xf0f9('0x11'));var qs=require(_0xf0f9('0x12'));var as=require(_0xf0f9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf0f9('0x14'));var utils=require(_0xf0f9('0x15'));var config=require(_0xf0f9('0x16'));var licenseUtil=require(_0xf0f9('0x17'));var db=require(_0xf0f9('0x18'))['db'];function respondWithStatusCode(_0x32d17f,_0x2360eb){_0x2360eb=_0x2360eb||0xcc;return function(_0x4f27c2){if(_0x4f27c2){return _0x32d17f[_0xf0f9('0x19')](_0x2360eb);}return _0x32d17f[_0xf0f9('0x1a')](_0x2360eb)[_0xf0f9('0x1b')]();};}function respondWithResult(_0x200514,_0x524169){_0x524169=_0x524169||0xc8;return function(_0x51d78a){if(_0x51d78a){return _0x200514[_0xf0f9('0x1a')](_0x524169)[_0xf0f9('0x1c')](_0x51d78a);}};}function respondWithFilteredResult(_0xa7d48c,_0x2e2955){return function(_0x2b05e3){if(_0x2b05e3){var _0x2f5bec=typeof _0x2e2955[_0xf0f9('0x1d')]===_0xf0f9('0x1e')&&typeof _0x2e2955[_0xf0f9('0x1f')]===_0xf0f9('0x1e');var _0x4d3534=_0x2b05e3['count'];var _0x350a48=_0x2f5bec?0x0:_0x2e2955[_0xf0f9('0x1d')];var _0x4c4e17=_0x2f5bec?_0x2b05e3[_0xf0f9('0x20')]:_0x2e2955['offset']+_0x2e2955['limit'];var _0x42c157;if(_0x4c4e17>=_0x4d3534){_0x4c4e17=_0x4d3534;_0x42c157=0xc8;}else{_0x42c157=0xce;}_0xa7d48c[_0xf0f9('0x1a')](_0x42c157);return _0xa7d48c[_0xf0f9('0x21')](_0xf0f9('0x22'),_0x350a48+'-'+_0x4c4e17+'/'+_0x4d3534)[_0xf0f9('0x1c')](_0x2b05e3);}return null;};}function patchUpdates(_0x4ed9ff){return function(_0x5ccbc9){try{jsonpatch['apply'](_0x5ccbc9,_0x4ed9ff,!![]);}catch(_0x102336){return BPromise[_0xf0f9('0x23')](_0x102336);}return _0x5ccbc9[_0xf0f9('0x24')]();};}function saveUpdates(_0x5d87a9,_0x4a8726){return function(_0x209cd4){if(_0x209cd4){return _0x209cd4['update'](_0x5d87a9)[_0xf0f9('0x25')](function(_0x414f87){return _0x414f87;});}return null;};}function removeEntity(_0x173c79,_0x570c68){return function(_0x33dfca){if(_0x33dfca){return _0x33dfca[_0xf0f9('0x26')]()[_0xf0f9('0x25')](function(){_0x173c79['status'](0xcc)[_0xf0f9('0x1b')]();});}};}function handleEntityNotFound(_0x33f070,_0x2879a2){return function(_0x185e1e){if(!_0x185e1e){_0x33f070[_0xf0f9('0x19')](0x194);}return _0x185e1e;};}function handleError(_0x19d750,_0x5df7f5){_0x5df7f5=_0x5df7f5||0x1f4;return function(_0x28e1f6){logger['error'](_0x28e1f6[_0xf0f9('0x27')]);if(_0x28e1f6[_0xf0f9('0x28')]){delete _0x28e1f6['name'];}_0x19d750['status'](_0x5df7f5)[_0xf0f9('0x29')](_0x28e1f6);};}exports['index']=function(_0x2121b8,_0x3f236e){var _0x269e47={},_0x353502={},_0x3ec658={'count':0x0,'rows':[]};var _0x39cd34=_[_0xf0f9('0x2a')](db[_0xf0f9('0x2b')][_0xf0f9('0x2c')],function(_0x4e4e08){return{'name':_0x4e4e08[_0xf0f9('0x2d')],'type':_0x4e4e08[_0xf0f9('0x2e')]['key']};});_0x353502['model']=_[_0xf0f9('0x2a')](_0x39cd34,'name');_0x353502['query']=_[_0xf0f9('0x2f')](_0x2121b8['query']);_0x353502[_0xf0f9('0x30')]=_[_0xf0f9('0x31')](_0x353502['model'],_0x353502['query']);_0x269e47[_0xf0f9('0x32')]=_[_0xf0f9('0x31')](_0x353502[_0xf0f9('0x33')],qs[_0xf0f9('0x34')](_0x2121b8[_0xf0f9('0x35')][_0xf0f9('0x34')]));_0x269e47[_0xf0f9('0x32')]=_0x269e47[_0xf0f9('0x32')][_0xf0f9('0x36')]?_0x269e47[_0xf0f9('0x32')]:_0x353502[_0xf0f9('0x33')];if(!_0x2121b8[_0xf0f9('0x35')][_0xf0f9('0x37')]('nolimit')){_0x269e47[_0xf0f9('0x1f')]=qs['limit'](_0x2121b8[_0xf0f9('0x35')][_0xf0f9('0x1f')]);_0x269e47[_0xf0f9('0x1d')]=qs[_0xf0f9('0x1d')](_0x2121b8[_0xf0f9('0x35')][_0xf0f9('0x1d')]);}_0x269e47[_0xf0f9('0x38')]=qs['sort'](_0x2121b8['query'][_0xf0f9('0x39')]);_0x269e47[_0xf0f9('0x3a')]=qs[_0xf0f9('0x30')](_[_0xf0f9('0x3b')](_0x2121b8[_0xf0f9('0x35')],_0x353502['filters']),_0x39cd34);if(_0x2121b8[_0xf0f9('0x35')][_0xf0f9('0x3c')]){_0x269e47[_0xf0f9('0x3a')]=_[_0xf0f9('0x3d')](_0x269e47[_0xf0f9('0x3a')],{'$or':_['map'](_0x39cd34,function(_0x2a5860){if(_0x2a5860[_0xf0f9('0x2e')]!==_0xf0f9('0x3e')){var _0x208aa9={};_0x208aa9[_0x2a5860[_0xf0f9('0x28')]]={'$like':'%'+_0x2121b8[_0xf0f9('0x35')]['filter']+'%'};return _0x208aa9;}})});}_0x269e47=_[_0xf0f9('0x3d')]({},_0x269e47,_0x2121b8[_0xf0f9('0x3f')]);var _0x13b8c5={'where':_0x269e47['where']};return db[_0xf0f9('0x2b')][_0xf0f9('0x20')](_0x13b8c5)[_0xf0f9('0x25')](function(_0xa2b82b){_0x3ec658[_0xf0f9('0x20')]=_0xa2b82b;if(_0x2121b8[_0xf0f9('0x35')][_0xf0f9('0x40')]){_0x269e47[_0xf0f9('0x41')]=[{'all':!![]}];}return db[_0xf0f9('0x2b')][_0xf0f9('0x42')](_0x269e47);})[_0xf0f9('0x25')](function(_0x149870){_0x3ec658[_0xf0f9('0x43')]=_0x149870;return _0x3ec658;})['then'](respondWithFilteredResult(_0x3f236e,_0x269e47))['catch'](handleError(_0x3f236e,null));};exports[_0xf0f9('0x44')]=function(_0x4a3355,_0x54daca){var _0x4e8234={'raw':!![],'where':{'id':_0x4a3355[_0xf0f9('0x45')]['id']}},_0x2cb95d={};_0x2cb95d[_0xf0f9('0x33')]=_[_0xf0f9('0x2f')](db[_0xf0f9('0x2b')][_0xf0f9('0x2c')]);_0x2cb95d[_0xf0f9('0x35')]=_[_0xf0f9('0x2f')](_0x4a3355[_0xf0f9('0x35')]);_0x2cb95d['filters']=_[_0xf0f9('0x31')](_0x2cb95d[_0xf0f9('0x33')],_0x2cb95d[_0xf0f9('0x35')]);_0x4e8234['attributes']=_[_0xf0f9('0x31')](_0x2cb95d[_0xf0f9('0x33')],qs[_0xf0f9('0x34')](_0x4a3355['query'][_0xf0f9('0x34')]));_0x4e8234[_0xf0f9('0x32')]=_0x4e8234['attributes'][_0xf0f9('0x36')]?_0x4e8234[_0xf0f9('0x32')]:_0x2cb95d[_0xf0f9('0x33')];if(_0x4a3355[_0xf0f9('0x35')]['includeAll']){_0x4e8234[_0xf0f9('0x41')]=[{'all':!![]}];}_0x4e8234=_[_0xf0f9('0x3d')]({},_0x4e8234,_0x4a3355[_0xf0f9('0x3f')]);return db[_0xf0f9('0x2b')][_0xf0f9('0x46')](_0x4e8234)[_0xf0f9('0x25')](handleEntityNotFound(_0x54daca,null))['then'](respondWithResult(_0x54daca,null))[_0xf0f9('0x47')](handleError(_0x54daca,null));};exports['create']=function(_0x340374,_0x38956b){return db[_0xf0f9('0x2b')][_0xf0f9('0x48')](_0x340374[_0xf0f9('0x49')],{})[_0xf0f9('0x25')](respondWithResult(_0x38956b,0xc9))[_0xf0f9('0x47')](handleError(_0x38956b,null));};exports[_0xf0f9('0x4a')]=function(_0x1f47fa,_0x13bb13){if(_0x1f47fa[_0xf0f9('0x49')]['id']){delete _0x1f47fa[_0xf0f9('0x49')]['id'];}return db[_0xf0f9('0x2b')][_0xf0f9('0x46')]({'where':{'id':_0x1f47fa[_0xf0f9('0x45')]['id']}})[_0xf0f9('0x25')](handleEntityNotFound(_0x13bb13,null))[_0xf0f9('0x25')](saveUpdates(_0x1f47fa[_0xf0f9('0x49')],null))[_0xf0f9('0x25')](respondWithResult(_0x13bb13,null))[_0xf0f9('0x47')](handleError(_0x13bb13,null));};exports[_0xf0f9('0x26')]=function(_0x40711c,_0x3db0b2){return db[_0xf0f9('0x2b')]['find']({'where':{'id':_0x40711c['params']['id']}})[_0xf0f9('0x25')](handleEntityNotFound(_0x3db0b2,null))['then'](removeEntity(_0x3db0b2,null))[_0xf0f9('0x47')](handleError(_0x3db0b2,null));};exports[_0xf0f9('0x4b')]=function(_0x1821bc,_0x542de6){return db[_0xf0f9('0x2b')]['describe']()[_0xf0f9('0x25')](respondWithResult(_0x542de6,null))[_0xf0f9('0x47')](handleError(_0x542de6,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index c7d5d0a..939f4bb 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 _0x0295=['rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash','api','request-promise','path'];(function(_0x18daeb,_0x2f413d){var _0x1a87c9=function(_0x59c0ed){while(--_0x59c0ed){_0x18daeb['push'](_0x18daeb['shift']());}};_0x1a87c9(++_0x2f413d);}(_0x0295,0x1f0));var _0x5029=function(_0x39665a,_0xc729df){_0x39665a=_0x39665a-0x0;var _0x173185=_0x0295[_0x39665a];return _0x173185;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5029('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x814b,0x1a2));var _0xb814=function(_0xcba291,_0x10e9d5){_0xcba291=_0xcba291-0x0;var _0x162274=_0x814b[_0xcba291];return _0x162274;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 041d321..aaa1f70 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 _0x17ef=['raw','info','debug','FaxQueueReport','update','body','UpdateFaxQueueReport','catch','util','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxQueueReport,\x20%s,\x20%s','result','CreateFaxQueueReport','options'];(function(_0x42d2af,_0x3961b5){var _0x1d6d63=function(_0x10833e){while(--_0x10833e){_0x42d2af['push'](_0x42d2af['shift']());}};_0x1d6d63(++_0x3961b5);}(_0x17ef,0x19d));var _0xf17e=function(_0x439b34,_0x5890c7){_0x439b34=_0x439b34-0x0;var _0x9399a1=_0x17ef[_0x439b34];return _0x9399a1;};'use strict';var _=require('lodash');var util=require(_0xf17e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf17e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf17e('0x2'))('rpc');var config=require(_0xf17e('0x3'));var jayson=require(_0xf17e('0x4'));var client=jayson[_0xf17e('0x5')][_0xf17e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a10be,_0x5565c9,_0x2a951a){return new BPromise(function(_0x20ca71,_0xee10c3){return client[_0xf17e('0x7')](_0x5a10be,_0x2a951a)[_0xf17e('0x8')](function(_0x55f2dc){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x5565c9,_0xf17e('0x9'));logger['debug'](_0xf17e('0xa'),_0x5565c9,_0xf17e('0x9'),JSON[_0xf17e('0xb')](_0x55f2dc));if(_0x55f2dc[_0xf17e('0xc')]){if(_0x55f2dc[_0xf17e('0xc')][_0xf17e('0xd')]===0x1f4){logger[_0xf17e('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x5565c9,_0x55f2dc[_0xf17e('0xc')]['message']);return _0xee10c3(_0x55f2dc['error'][_0xf17e('0xe')]);}logger['error'](_0xf17e('0xf'),_0x5565c9,_0x55f2dc[_0xf17e('0xc')][_0xf17e('0xe')]);return _0x20ca71(_0x55f2dc[_0xf17e('0xc')][_0xf17e('0xe')]);}else{logger['info'](_0xf17e('0xf'),_0x5565c9,_0xf17e('0x9'));_0x20ca71(_0x55f2dc[_0xf17e('0x10')][_0xf17e('0xe')]);}})['catch'](function(_0x2c56ac){logger[_0xf17e('0xc')](_0xf17e('0xf'),_0x5565c9,_0x2c56ac);_0xee10c3(_0x2c56ac);});});}exports[_0xf17e('0x11')]=function(_0x5f11f9){var _0xe7c50f=this;return new Promise(function(_0xb2cdda,_0x375228){return db['FaxQueueReport']['create'](_0x5f11f9['body'],{'raw':_0x5f11f9[_0xf17e('0x12')]?_0x5f11f9[_0xf17e('0x12')][_0xf17e('0x13')]===undefined?!![]:![]:!![]})[_0xf17e('0x8')](function(_0x2fe3b9){logger[_0xf17e('0x14')](_0xf17e('0x11'),_0x5f11f9);logger[_0xf17e('0x15')](_0xf17e('0x11'),_0x5f11f9,JSON[_0xf17e('0xb')](_0x2fe3b9));_0xb2cdda(_0x2fe3b9);})['catch'](function(_0x5e71bc){logger[_0xf17e('0xc')]('CreateFaxQueueReport',_0x5e71bc['message'],_0x5f11f9);_0x375228(_0xe7c50f['error'](0x1f4,_0x5e71bc[_0xf17e('0xe')]));});});};exports['UpdateFaxQueueReport']=function(_0x8c91f8){var _0x175c68=this;return new Promise(function(_0xd041a7,_0x292fac){return db[_0xf17e('0x16')][_0xf17e('0x17')](_0x8c91f8[_0xf17e('0x18')],{'raw':_0x8c91f8[_0xf17e('0x12')]?_0x8c91f8[_0xf17e('0x12')][_0xf17e('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8c91f8[_0xf17e('0x12')]?_0x8c91f8[_0xf17e('0x12')]['where']||null:null,'attributes':_0x8c91f8['options']?_0x8c91f8[_0xf17e('0x12')]['attributes']||null:null,'limit':_0x8c91f8['options']?_0x8c91f8[_0xf17e('0x12')]['limit']||null:null})[_0xf17e('0x8')](function(_0x11cbbe){logger['info'](_0xf17e('0x19'),_0x8c91f8);logger[_0xf17e('0x15')](_0xf17e('0x19'),_0x8c91f8,JSON[_0xf17e('0xb')](_0x11cbbe));_0xd041a7(_0x11cbbe);})[_0xf17e('0x1a')](function(_0x59d806){logger['error'](_0xf17e('0x19'),_0x59d806[_0xf17e('0xe')],_0x8c91f8);_0x292fac(_0x175c68[_0xf17e('0xc')](0x1f4,_0x59d806[_0xf17e('0xe')]));});});}; \ No newline at end of file +var _0x634c=['http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','update','where','limit','UpdateFaxQueueReport','lodash','util','randomstring','../../mysqldb','../../config/logger','jayson/promise','client'];(function(_0x3a21c0,_0x348451){var _0x411e84=function(_0xdd7b02){while(--_0xdd7b02){_0x3a21c0['push'](_0x3a21c0['shift']());}};_0x411e84(++_0x348451);}(_0x634c,0xfe));var _0xc634=function(_0x38713a,_0x266691){_0x38713a=_0x38713a-0x0;var _0x3607e7=_0x634c[_0x38713a];return _0x3607e7;};'use strict';var _=require(_0xc634('0x0'));var util=require(_0xc634('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc634('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc634('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc634('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc634('0x5'));var client=jayson[_0xc634('0x6')][_0xc634('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x243b89,_0xea936d,_0x51eace){return new BPromise(function(_0x3ac940,_0x2af757){return client['request'](_0x243b89,_0x51eace)[_0xc634('0x8')](function(_0x4cb8b6){logger[_0xc634('0x9')](_0xc634('0xa'),_0xea936d,_0xc634('0xb'));logger[_0xc634('0xc')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0xea936d,_0xc634('0xb'),JSON[_0xc634('0xd')](_0x4cb8b6));if(_0x4cb8b6[_0xc634('0xe')]){if(_0x4cb8b6[_0xc634('0xe')][_0xc634('0xf')]===0x1f4){logger[_0xc634('0xe')](_0xc634('0xa'),_0xea936d,_0x4cb8b6[_0xc634('0xe')][_0xc634('0x10')]);return _0x2af757(_0x4cb8b6[_0xc634('0xe')][_0xc634('0x10')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0xea936d,_0x4cb8b6[_0xc634('0xe')][_0xc634('0x10')]);return _0x3ac940(_0x4cb8b6['error'][_0xc634('0x10')]);}else{logger[_0xc634('0x9')](_0xc634('0xa'),_0xea936d,_0xc634('0xb'));_0x3ac940(_0x4cb8b6[_0xc634('0x11')][_0xc634('0x10')]);}})[_0xc634('0x12')](function(_0x2994b4){logger[_0xc634('0xe')](_0xc634('0xa'),_0xea936d,_0x2994b4);_0x2af757(_0x2994b4);});});}exports[_0xc634('0x13')]=function(_0x5de00e){var _0x1111fd=this;return new Promise(function(_0x351fe4,_0x4cca16){return db[_0xc634('0x14')][_0xc634('0x15')](_0x5de00e[_0xc634('0x16')],{'raw':_0x5de00e[_0xc634('0x17')]?_0x5de00e[_0xc634('0x17')][_0xc634('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x252f37){logger[_0xc634('0x9')](_0xc634('0x13'),_0x5de00e);logger[_0xc634('0xc')](_0xc634('0x13'),_0x5de00e,JSON[_0xc634('0xd')](_0x252f37));_0x351fe4(_0x252f37);})[_0xc634('0x12')](function(_0x19434b){logger[_0xc634('0xe')](_0xc634('0x13'),_0x19434b[_0xc634('0x10')],_0x5de00e);_0x4cca16(_0x1111fd[_0xc634('0xe')](0x1f4,_0x19434b['message']));});});};exports['UpdateFaxQueueReport']=function(_0x16ef2c){var _0xb84542=this;return new Promise(function(_0x300d96,_0x5b9d6e){return db[_0xc634('0x14')][_0xc634('0x19')](_0x16ef2c['body'],{'raw':_0x16ef2c[_0xc634('0x17')]?_0x16ef2c[_0xc634('0x17')][_0xc634('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16ef2c[_0xc634('0x17')]?_0x16ef2c[_0xc634('0x17')][_0xc634('0x1a')]||null:null,'attributes':_0x16ef2c[_0xc634('0x17')]?_0x16ef2c[_0xc634('0x17')]['attributes']||null:null,'limit':_0x16ef2c[_0xc634('0x17')]?_0x16ef2c[_0xc634('0x17')][_0xc634('0x1b')]||null:null})['then'](function(_0x3817f6){logger[_0xc634('0x9')](_0xc634('0x1c'),_0x16ef2c);logger[_0xc634('0xc')](_0xc634('0x1c'),_0x16ef2c,JSON[_0xc634('0xd')](_0x3817f6));_0x300d96(_0x3817f6);})[_0xc634('0x12')](function(_0x3d4b69){logger['error'](_0xc634('0x1c'),_0x3d4b69['message'],_0x16ef2c);_0x5b9d6e(_0xb84542[_0xc634('0xe')](0x1f4,_0x3d4b69[_0xc634('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 15af1aa..a8c2b98 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 _0xc3eb=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','put','update','delete','destroy','exports'];(function(_0x45becd,_0x36b127){var _0x9a860f=function(_0x32d89f){while(--_0x32d89f){_0x45becd['push'](_0x45becd['shift']());}};_0x9a860f(++_0x36b127);}(_0xc3eb,0x72));var _0xbc3e=function(_0x55a89e,_0x1a05ab){_0x55a89e=_0x55a89e-0x0;var _0x3aa2bd=_0xc3eb[_0x55a89e];return _0x3aa2bd;};'use strict';var multer=require('multer');var util=require(_0xbc3e('0x0'));var path=require(_0xbc3e('0x1'));var timeout=require(_0xbc3e('0x2'));var express=require('express');var router=express[_0xbc3e('0x3')]();var fs_extra=require(_0xbc3e('0x4'));var auth=require(_0xbc3e('0x5'));var interaction=require(_0xbc3e('0x6'));var config=require(_0xbc3e('0x7'));var controller=require(_0xbc3e('0x8'));router[_0xbc3e('0x9')]('/',auth[_0xbc3e('0xa')](),controller[_0xbc3e('0xb')]);router['get'](_0xbc3e('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xbc3e('0x9')](_0xbc3e('0xd'),auth[_0xbc3e('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbc3e('0xe')](_0xbc3e('0xd'),auth['isAuthenticated'](),controller[_0xbc3e('0xf')]);router[_0xbc3e('0x10')](_0xbc3e('0xd'),auth[_0xbc3e('0xa')](),controller[_0xbc3e('0x11')]);module[_0xbc3e('0x12')]=router; \ No newline at end of file +var _0x9365=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','index','/:id','post','isAuthenticated','create','put','update','delete'];(function(_0x18cc1e,_0x25722c){var _0x11c3d=function(_0x11dba3){while(--_0x11dba3){_0x18cc1e['push'](_0x18cc1e['shift']());}};_0x11c3d(++_0x25722c);}(_0x9365,0xf2));var _0x5936=function(_0x5be1ac,_0x5ee1f4){_0x5be1ac=_0x5be1ac-0x0;var _0x21b996=_0x9365[_0x5be1ac];return _0x21b996;};'use strict';var multer=require(_0x5936('0x0'));var util=require(_0x5936('0x1'));var path=require(_0x5936('0x2'));var timeout=require(_0x5936('0x3'));var express=require(_0x5936('0x4'));var router=express[_0x5936('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5936('0x6'));var interaction=require(_0x5936('0x7'));var config=require('../../config/environment');var controller=require(_0x5936('0x8'));router[_0x5936('0x9')]('/',auth['isAuthenticated'](),controller[_0x5936('0xa')]);router[_0x5936('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5936('0x9')](_0x5936('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x5936('0xc')]('/',auth[_0x5936('0xd')](),controller[_0x5936('0xe')]);router[_0x5936('0xf')]('/:id',auth[_0x5936('0xd')](),controller[_0x5936('0x10')]);router[_0x5936('0x11')](_0x5936('0xb'),auth[_0x5936('0xd')](),controller[_0x5936('0x12')]);module[_0x5936('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index bf9287b..58e1f7c 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0xfedc72,_0x292f02){var _0x2c7c78=function(_0x12fbf1){while(--_0x12fbf1){_0xfedc72['push'](_0xfedc72['shift']());}};_0x2c7c78(++_0x292f02);}(_0xb43b,0x1b2));var _0xbb43=function(_0x198297,_0x39c6dc){_0x198297=_0x198297-0x0;var _0x1630d2=_0xb43b[_0x198297];return _0x1630d2;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x44fed9,_0x527599){var _0x343be3=function(_0x81d668){while(--_0x81d668){_0x44fed9['push'](_0x44fed9['shift']());}};_0x343be3(++_0x527599);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1413d6,_0x1d2d63){_0x1413d6=_0x1413d6-0x0;var _0x54d405=_0xf4eb[_0x1413d6];return _0x54d405;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index a7d2034..4b583b8 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 _0x6b82=['name','send','index','map','FaxTransferReport','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','apply','reject','save','then','destroy','stack'];(function(_0x15a8fa,_0x4652b2){var _0x1355c2=function(_0x203292){while(--_0x203292){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x1355c2(++_0x4652b2);}(_0x6b82,0xbc));var _0x26b8=function(_0x2cde51,_0x41b85c){_0x2cde51=_0x2cde51-0x0;var _0x37177e=_0x6b82[_0x2cde51];return _0x37177e;};'use strict';var emlformat=require(_0x26b8('0x0'));var rimraf=require(_0x26b8('0x1'));var zipdir=require(_0x26b8('0x2'));var jsonpatch=require(_0x26b8('0x3'));var rp=require(_0x26b8('0x4'));var moment=require(_0x26b8('0x5'));var BPromise=require(_0x26b8('0x6'));var Mustache=require('mustache');var util=require(_0x26b8('0x7'));var path=require(_0x26b8('0x8'));var sox=require(_0x26b8('0x9'));var csv=require('to-csv');var ejs=require(_0x26b8('0xa'));var fs=require('fs');var fs_extra=require(_0x26b8('0xb'));var _=require('lodash');var squel=require(_0x26b8('0xc'));var crypto=require(_0x26b8('0xd'));var jsforce=require(_0x26b8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x26b8('0xf'));var querystring=require(_0x26b8('0x10'));var Papa=require(_0x26b8('0x11'));var Redis=require(_0x26b8('0x12'));var authService=require(_0x26b8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x26b8('0x14'));var hardwareService=require(_0x26b8('0x15'));var logger=require(_0x26b8('0x16'))(_0x26b8('0x17'));var utils=require(_0x26b8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x26b8('0x19'));var db=require(_0x26b8('0x1a'))['db'];function respondWithStatusCode(_0x56ffaa,_0x5bf5d4){_0x5bf5d4=_0x5bf5d4||0xcc;return function(_0x212402){if(_0x212402){return _0x56ffaa['sendStatus'](_0x5bf5d4);}return _0x56ffaa[_0x26b8('0x1b')](_0x5bf5d4)[_0x26b8('0x1c')]();};}function respondWithResult(_0x47a99b,_0x2f75ef){_0x2f75ef=_0x2f75ef||0xc8;return function(_0x5988ae){if(_0x5988ae){return _0x47a99b[_0x26b8('0x1b')](_0x2f75ef)[_0x26b8('0x1d')](_0x5988ae);}};}function respondWithFilteredResult(_0x584f30,_0x3e2443){return function(_0x37fb0b){if(_0x37fb0b){var _0x5749fa=typeof _0x3e2443[_0x26b8('0x1e')]==='undefined'&&typeof _0x3e2443[_0x26b8('0x1f')]==='undefined';var _0x38d6b2=_0x37fb0b[_0x26b8('0x20')];var _0x2d3db2=_0x5749fa?0x0:_0x3e2443['offset'];var _0x16e6e5=_0x5749fa?_0x37fb0b[_0x26b8('0x20')]:_0x3e2443['offset']+_0x3e2443[_0x26b8('0x1f')];var _0x5e49f8;if(_0x16e6e5>=_0x38d6b2){_0x16e6e5=_0x38d6b2;_0x5e49f8=0xc8;}else{_0x5e49f8=0xce;}_0x584f30['status'](_0x5e49f8);return _0x584f30[_0x26b8('0x21')]('Content-Range',_0x2d3db2+'-'+_0x16e6e5+'/'+_0x38d6b2)[_0x26b8('0x1d')](_0x37fb0b);}return null;};}function patchUpdates(_0x51d981){return function(_0x5744bf){try{jsonpatch[_0x26b8('0x22')](_0x5744bf,_0x51d981,!![]);}catch(_0xa89653){return BPromise[_0x26b8('0x23')](_0xa89653);}return _0x5744bf[_0x26b8('0x24')]();};}function saveUpdates(_0x37c3e4,_0x286eba){return function(_0xda0636){if(_0xda0636){return _0xda0636['update'](_0x37c3e4)[_0x26b8('0x25')](function(_0x156420){return _0x156420;});}return null;};}function removeEntity(_0x201925,_0x5ee2d4){return function(_0x3ca155){if(_0x3ca155){return _0x3ca155[_0x26b8('0x26')]()['then'](function(){_0x201925[_0x26b8('0x1b')](0xcc)[_0x26b8('0x1c')]();});}};}function handleEntityNotFound(_0x4a71b5,_0x1b4652){return function(_0x586527){if(!_0x586527){_0x4a71b5['sendStatus'](0x194);}return _0x586527;};}function handleError(_0x57c8e7,_0x2254d9){_0x2254d9=_0x2254d9||0x1f4;return function(_0x571b3d){logger['error'](_0x571b3d[_0x26b8('0x27')]);if(_0x571b3d['name']){delete _0x571b3d[_0x26b8('0x28')];}_0x57c8e7[_0x26b8('0x1b')](_0x2254d9)[_0x26b8('0x29')](_0x571b3d);};}exports[_0x26b8('0x2a')]=function(_0x54bcef,_0x540966){var _0x4f1eb9={},_0x1602d8={},_0x1457c6={'count':0x0,'rows':[]};var _0x2f67b5=_[_0x26b8('0x2b')](db[_0x26b8('0x2c')][_0x26b8('0x2d')],function(_0x38970f){return{'name':_0x38970f[_0x26b8('0x2e')],'type':_0x38970f['type']['key']};});_0x1602d8[_0x26b8('0x2f')]=_[_0x26b8('0x2b')](_0x2f67b5,'name');_0x1602d8[_0x26b8('0x30')]=_['keys'](_0x54bcef[_0x26b8('0x30')]);_0x1602d8[_0x26b8('0x31')]=_[_0x26b8('0x32')](_0x1602d8[_0x26b8('0x2f')],_0x1602d8[_0x26b8('0x30')]);_0x4f1eb9[_0x26b8('0x33')]=_[_0x26b8('0x32')](_0x1602d8[_0x26b8('0x2f')],qs['fields'](_0x54bcef[_0x26b8('0x30')][_0x26b8('0x34')]));_0x4f1eb9[_0x26b8('0x33')]=_0x4f1eb9[_0x26b8('0x33')][_0x26b8('0x35')]?_0x4f1eb9['attributes']:_0x1602d8[_0x26b8('0x2f')];if(!_0x54bcef[_0x26b8('0x30')]['hasOwnProperty'](_0x26b8('0x36'))){_0x4f1eb9[_0x26b8('0x1f')]=qs[_0x26b8('0x1f')](_0x54bcef[_0x26b8('0x30')][_0x26b8('0x1f')]);_0x4f1eb9[_0x26b8('0x1e')]=qs[_0x26b8('0x1e')](_0x54bcef['query']['offset']);}_0x4f1eb9[_0x26b8('0x37')]=qs[_0x26b8('0x38')](_0x54bcef[_0x26b8('0x30')]['sort']);_0x4f1eb9[_0x26b8('0x39')]=qs[_0x26b8('0x31')](_[_0x26b8('0x3a')](_0x54bcef['query'],_0x1602d8[_0x26b8('0x31')]),_0x2f67b5);if(_0x54bcef[_0x26b8('0x30')]['filter']){_0x4f1eb9[_0x26b8('0x39')]=_[_0x26b8('0x3b')](_0x4f1eb9[_0x26b8('0x39')],{'$or':_[_0x26b8('0x2b')](_0x2f67b5,function(_0x506eb5){if(_0x506eb5[_0x26b8('0x3c')]!==_0x26b8('0x3d')){var _0x2b265a={};_0x2b265a[_0x506eb5['name']]={'$like':'%'+_0x54bcef[_0x26b8('0x30')][_0x26b8('0x3e')]+'%'};return _0x2b265a;}})});}_0x4f1eb9=_[_0x26b8('0x3b')]({},_0x4f1eb9,_0x54bcef[_0x26b8('0x3f')]);var _0x523b35={'where':_0x4f1eb9[_0x26b8('0x39')]};return db[_0x26b8('0x2c')][_0x26b8('0x20')](_0x523b35)[_0x26b8('0x25')](function(_0x3cca81){_0x1457c6['count']=_0x3cca81;if(_0x54bcef[_0x26b8('0x30')][_0x26b8('0x40')]){_0x4f1eb9['include']=[{'all':!![]}];}return db[_0x26b8('0x2c')][_0x26b8('0x41')](_0x4f1eb9);})['then'](function(_0x464425){_0x1457c6[_0x26b8('0x42')]=_0x464425;return _0x1457c6;})[_0x26b8('0x25')](respondWithFilteredResult(_0x540966,_0x4f1eb9))[_0x26b8('0x43')](handleError(_0x540966,null));};exports[_0x26b8('0x44')]=function(_0x2cb3a3,_0x517399){var _0x342c98={'raw':!![],'where':{'id':_0x2cb3a3[_0x26b8('0x45')]['id']}},_0xd7929={};_0xd7929[_0x26b8('0x2f')]=_['keys'](db['FaxTransferReport'][_0x26b8('0x2d')]);_0xd7929[_0x26b8('0x30')]=_['keys'](_0x2cb3a3[_0x26b8('0x30')]);_0xd7929[_0x26b8('0x31')]=_[_0x26b8('0x32')](_0xd7929[_0x26b8('0x2f')],_0xd7929[_0x26b8('0x30')]);_0x342c98[_0x26b8('0x33')]=_[_0x26b8('0x32')](_0xd7929[_0x26b8('0x2f')],qs['fields'](_0x2cb3a3[_0x26b8('0x30')][_0x26b8('0x34')]));_0x342c98[_0x26b8('0x33')]=_0x342c98['attributes']['length']?_0x342c98[_0x26b8('0x33')]:_0xd7929[_0x26b8('0x2f')];if(_0x2cb3a3[_0x26b8('0x30')][_0x26b8('0x40')]){_0x342c98[_0x26b8('0x46')]=[{'all':!![]}];}_0x342c98=_[_0x26b8('0x3b')]({},_0x342c98,_0x2cb3a3[_0x26b8('0x3f')]);return db[_0x26b8('0x2c')][_0x26b8('0x47')](_0x342c98)[_0x26b8('0x25')](handleEntityNotFound(_0x517399,null))['then'](respondWithResult(_0x517399,null))['catch'](handleError(_0x517399,null));};exports[_0x26b8('0x48')]=function(_0x3d0a8e,_0x56d4c2){return db[_0x26b8('0x2c')]['create'](_0x3d0a8e[_0x26b8('0x49')],{})[_0x26b8('0x25')](respondWithResult(_0x56d4c2,0xc9))[_0x26b8('0x43')](handleError(_0x56d4c2,null));};exports[_0x26b8('0x4a')]=function(_0x13e7bc,_0x4f8943){if(_0x13e7bc[_0x26b8('0x49')]['id']){delete _0x13e7bc[_0x26b8('0x49')]['id'];}return db[_0x26b8('0x2c')][_0x26b8('0x47')]({'where':{'id':_0x13e7bc['params']['id']}})['then'](handleEntityNotFound(_0x4f8943,null))[_0x26b8('0x25')](saveUpdates(_0x13e7bc[_0x26b8('0x49')],null))[_0x26b8('0x25')](respondWithResult(_0x4f8943,null))[_0x26b8('0x43')](handleError(_0x4f8943,null));};exports[_0x26b8('0x26')]=function(_0x24e397,_0x3054ad){return db[_0x26b8('0x2c')]['find']({'where':{'id':_0x24e397['params']['id']}})['then'](handleEntityNotFound(_0x3054ad,null))[_0x26b8('0x25')](removeEntity(_0x3054ad,null))[_0x26b8('0x43')](handleError(_0x3054ad,null));};exports['describe']=function(_0x9b8a58,_0x44d39c){return db[_0x26b8('0x2c')][_0x26b8('0x4b')]()[_0x26b8('0x25')](respondWithResult(_0x44d39c,null))[_0x26b8('0x43')](handleError(_0x44d39c,null));}; \ No newline at end of file +var _0x2af8=['fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','find','update','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','key','model','query','keys','filters','intersection','attributes'];(function(_0x4dc4bd,_0x490bf0){var _0x22a362=function(_0x1512b1){while(--_0x1512b1){_0x4dc4bd['push'](_0x4dc4bd['shift']());}};_0x22a362(++_0x490bf0);}(_0x2af8,0x189));var _0x82af=function(_0x12bfbd,_0x22e758){_0x12bfbd=_0x12bfbd-0x0;var _0x454299=_0x2af8[_0x12bfbd];return _0x454299;};'use strict';var emlformat=require(_0x82af('0x0'));var rimraf=require(_0x82af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82af('0x2'));var rp=require(_0x82af('0x3'));var moment=require(_0x82af('0x4'));var BPromise=require(_0x82af('0x5'));var Mustache=require(_0x82af('0x6'));var util=require(_0x82af('0x7'));var path=require(_0x82af('0x8'));var sox=require('sox');var csv=require(_0x82af('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82af('0xa'));var squel=require(_0x82af('0xb'));var crypto=require(_0x82af('0xc'));var jsforce=require(_0x82af('0xd'));var deskjs=require(_0x82af('0xe'));var toCsv=require(_0x82af('0x9'));var querystring=require(_0x82af('0xf'));var Papa=require(_0x82af('0x10'));var Redis=require(_0x82af('0x11'));var authService=require(_0x82af('0x12'));var qs=require(_0x82af('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82af('0x14'));var logger=require('../../config/logger')(_0x82af('0x15'));var utils=require('../../config/utils');var config=require(_0x82af('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x82af('0x17'))['db'];function respondWithStatusCode(_0x2a6811,_0x3a11ca){_0x3a11ca=_0x3a11ca||0xcc;return function(_0x3d6e65){if(_0x3d6e65){return _0x2a6811['sendStatus'](_0x3a11ca);}return _0x2a6811[_0x82af('0x18')](_0x3a11ca)[_0x82af('0x19')]();};}function respondWithResult(_0x418482,_0x279abc){_0x279abc=_0x279abc||0xc8;return function(_0x4da7d5){if(_0x4da7d5){return _0x418482[_0x82af('0x18')](_0x279abc)['json'](_0x4da7d5);}};}function respondWithFilteredResult(_0xee8f2f,_0x157d26){return function(_0x399773){if(_0x399773){var _0x45eec7=typeof _0x157d26[_0x82af('0x1a')]===_0x82af('0x1b')&&typeof _0x157d26[_0x82af('0x1c')]===_0x82af('0x1b');var _0x31c7dd=_0x399773['count'];var _0x30dcac=_0x45eec7?0x0:_0x157d26[_0x82af('0x1a')];var _0xdcf151=_0x45eec7?_0x399773[_0x82af('0x1d')]:_0x157d26[_0x82af('0x1a')]+_0x157d26[_0x82af('0x1c')];var _0x4ed778;if(_0xdcf151>=_0x31c7dd){_0xdcf151=_0x31c7dd;_0x4ed778=0xc8;}else{_0x4ed778=0xce;}_0xee8f2f[_0x82af('0x18')](_0x4ed778);return _0xee8f2f[_0x82af('0x1e')](_0x82af('0x1f'),_0x30dcac+'-'+_0xdcf151+'/'+_0x31c7dd)[_0x82af('0x20')](_0x399773);}return null;};}function patchUpdates(_0x2c9997){return function(_0x110abe){try{jsonpatch['apply'](_0x110abe,_0x2c9997,!![]);}catch(_0x14268c){return BPromise[_0x82af('0x21')](_0x14268c);}return _0x110abe[_0x82af('0x22')]();};}function saveUpdates(_0x285829,_0x1a8dd9){return function(_0x298b83){if(_0x298b83){return _0x298b83['update'](_0x285829)[_0x82af('0x23')](function(_0x29dda2){return _0x29dda2;});}return null;};}function removeEntity(_0x3a0a1d,_0x5d4940){return function(_0x68f34b){if(_0x68f34b){return _0x68f34b['destroy']()[_0x82af('0x23')](function(){_0x3a0a1d[_0x82af('0x18')](0xcc)[_0x82af('0x19')]();});}};}function handleEntityNotFound(_0x4ecdf0,_0x3b4f8c){return function(_0x2befc3){if(!_0x2befc3){_0x4ecdf0['sendStatus'](0x194);}return _0x2befc3;};}function handleError(_0x572acf,_0x38a69e){_0x38a69e=_0x38a69e||0x1f4;return function(_0x535499){logger[_0x82af('0x24')](_0x535499[_0x82af('0x25')]);if(_0x535499[_0x82af('0x26')]){delete _0x535499[_0x82af('0x26')];}_0x572acf[_0x82af('0x18')](_0x38a69e)[_0x82af('0x27')](_0x535499);};}exports[_0x82af('0x28')]=function(_0x4e6679,_0x108a90){var _0x2c0dd7={},_0x3fbb17={},_0xb3f438={'count':0x0,'rows':[]};var _0x201786=_[_0x82af('0x29')](db[_0x82af('0x2a')][_0x82af('0x2b')],function(_0x5b79a2){return{'name':_0x5b79a2['fieldName'],'type':_0x5b79a2['type'][_0x82af('0x2c')]};});_0x3fbb17[_0x82af('0x2d')]=_[_0x82af('0x29')](_0x201786,_0x82af('0x26'));_0x3fbb17[_0x82af('0x2e')]=_[_0x82af('0x2f')](_0x4e6679[_0x82af('0x2e')]);_0x3fbb17[_0x82af('0x30')]=_[_0x82af('0x31')](_0x3fbb17['model'],_0x3fbb17[_0x82af('0x2e')]);_0x2c0dd7[_0x82af('0x32')]=_[_0x82af('0x31')](_0x3fbb17[_0x82af('0x2d')],qs[_0x82af('0x33')](_0x4e6679['query']['fields']));_0x2c0dd7[_0x82af('0x32')]=_0x2c0dd7[_0x82af('0x32')][_0x82af('0x34')]?_0x2c0dd7[_0x82af('0x32')]:_0x3fbb17['model'];if(!_0x4e6679[_0x82af('0x2e')][_0x82af('0x35')](_0x82af('0x36'))){_0x2c0dd7[_0x82af('0x1c')]=qs[_0x82af('0x1c')](_0x4e6679[_0x82af('0x2e')][_0x82af('0x1c')]);_0x2c0dd7[_0x82af('0x1a')]=qs[_0x82af('0x1a')](_0x4e6679['query'][_0x82af('0x1a')]);}_0x2c0dd7['order']=qs[_0x82af('0x37')](_0x4e6679[_0x82af('0x2e')][_0x82af('0x37')]);_0x2c0dd7[_0x82af('0x38')]=qs['filters'](_[_0x82af('0x39')](_0x4e6679[_0x82af('0x2e')],_0x3fbb17[_0x82af('0x30')]),_0x201786);if(_0x4e6679[_0x82af('0x2e')]['filter']){_0x2c0dd7[_0x82af('0x38')]=_[_0x82af('0x3a')](_0x2c0dd7[_0x82af('0x38')],{'$or':_['map'](_0x201786,function(_0x1501a4){if(_0x1501a4[_0x82af('0x3b')]!==_0x82af('0x3c')){var _0x13e857={};_0x13e857[_0x1501a4[_0x82af('0x26')]]={'$like':'%'+_0x4e6679[_0x82af('0x2e')][_0x82af('0x3d')]+'%'};return _0x13e857;}})});}_0x2c0dd7=_[_0x82af('0x3a')]({},_0x2c0dd7,_0x4e6679['options']);var _0x2c8884={'where':_0x2c0dd7[_0x82af('0x38')]};return db[_0x82af('0x2a')][_0x82af('0x1d')](_0x2c8884)[_0x82af('0x23')](function(_0x123b85){_0xb3f438[_0x82af('0x1d')]=_0x123b85;if(_0x4e6679[_0x82af('0x2e')][_0x82af('0x3e')]){_0x2c0dd7[_0x82af('0x3f')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x82af('0x40')](_0x2c0dd7);})[_0x82af('0x23')](function(_0x57669e){_0xb3f438[_0x82af('0x41')]=_0x57669e;return _0xb3f438;})['then'](respondWithFilteredResult(_0x108a90,_0x2c0dd7))[_0x82af('0x42')](handleError(_0x108a90,null));};exports[_0x82af('0x43')]=function(_0x1e9d20,_0x413983){var _0xd2084a={'raw':!![],'where':{'id':_0x1e9d20[_0x82af('0x44')]['id']}},_0x3b4f54={};_0x3b4f54[_0x82af('0x2d')]=_['keys'](db[_0x82af('0x2a')][_0x82af('0x2b')]);_0x3b4f54[_0x82af('0x2e')]=_[_0x82af('0x2f')](_0x1e9d20[_0x82af('0x2e')]);_0x3b4f54['filters']=_[_0x82af('0x31')](_0x3b4f54['model'],_0x3b4f54[_0x82af('0x2e')]);_0xd2084a[_0x82af('0x32')]=_[_0x82af('0x31')](_0x3b4f54['model'],qs[_0x82af('0x33')](_0x1e9d20[_0x82af('0x2e')][_0x82af('0x33')]));_0xd2084a[_0x82af('0x32')]=_0xd2084a['attributes'][_0x82af('0x34')]?_0xd2084a[_0x82af('0x32')]:_0x3b4f54[_0x82af('0x2d')];if(_0x1e9d20[_0x82af('0x2e')][_0x82af('0x3e')]){_0xd2084a[_0x82af('0x3f')]=[{'all':!![]}];}_0xd2084a=_[_0x82af('0x3a')]({},_0xd2084a,_0x1e9d20['options']);return db['FaxTransferReport'][_0x82af('0x45')](_0xd2084a)[_0x82af('0x23')](handleEntityNotFound(_0x413983,null))[_0x82af('0x23')](respondWithResult(_0x413983,null))['catch'](handleError(_0x413983,null));};exports['create']=function(_0x5bee1c,_0x3ee8a9){return db[_0x82af('0x2a')]['create'](_0x5bee1c['body'],{})[_0x82af('0x23')](respondWithResult(_0x3ee8a9,0xc9))[_0x82af('0x42')](handleError(_0x3ee8a9,null));};exports[_0x82af('0x46')]=function(_0xb1a0ee,_0x4a3299){if(_0xb1a0ee[_0x82af('0x47')]['id']){delete _0xb1a0ee[_0x82af('0x47')]['id'];}return db[_0x82af('0x2a')]['find']({'where':{'id':_0xb1a0ee[_0x82af('0x44')]['id']}})[_0x82af('0x23')](handleEntityNotFound(_0x4a3299,null))['then'](saveUpdates(_0xb1a0ee['body'],null))[_0x82af('0x23')](respondWithResult(_0x4a3299,null))[_0x82af('0x42')](handleError(_0x4a3299,null));};exports[_0x82af('0x48')]=function(_0x14e98e,_0x56ca6c){return db[_0x82af('0x2a')]['find']({'where':{'id':_0x14e98e[_0x82af('0x44')]['id']}})[_0x82af('0x23')](handleEntityNotFound(_0x56ca6c,null))[_0x82af('0x23')](removeEntity(_0x56ca6c,null))[_0x82af('0x42')](handleError(_0x56ca6c,null));};exports[_0x82af('0x49')]=function(_0x328c70,_0x59d487){return db['FaxTransferReport']['describe']()['then'](respondWithResult(_0x59d487,null))[_0x82af('0x42')](handleError(_0x59d487,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index b489513..94594a4 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 _0x1bc6=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0x39aedf,_0x2f5df8){var _0x39356c=function(_0x1411c9){while(--_0x1411c9){_0x39aedf['push'](_0x39aedf['shift']());}};_0x39356c(++_0x2f5df8);}(_0x1bc6,0x94));var _0x61bc=function(_0x419223,_0x19d588){_0x419223=_0x419223-0x0;var _0x4c545e=_0x1bc6[_0x419223];return _0x4c545e;};'use strict';var _=require(_0x61bc('0x0'));var util=require(_0x61bc('0x1'));var logger=require(_0x61bc('0x2'))(_0x61bc('0x3'));var moment=require(_0x61bc('0x4'));var BPromise=require(_0x61bc('0x5'));var rp=require(_0x61bc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x61bc('0x7'));var config=require(_0x61bc('0x8'));var attributes=require(_0x61bc('0x9'));module[_0x61bc('0xa')]=function(_0x362ebb,_0x1af9bc){return _0x362ebb[_0x61bc('0xb')](_0x61bc('0xc'),attributes,{'tableName':_0x61bc('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x61bc('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbfe0=['FaxTransferReport','report_fax_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x11e90b,_0x3ec29a){var _0x31452e=function(_0x96b4ad){while(--_0x96b4ad){_0x11e90b['push'](_0x11e90b['shift']());}};_0x31452e(++_0x3ec29a);}(_0xbfe0,0x1ed));var _0x0bfe=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0xbfe0[_0x421cf8];return _0x145c48;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0bfe('0x0'))(_0x0bfe('0x1'));var moment=require(_0x0bfe('0x2'));var BPromise=require(_0x0bfe('0x3'));var rp=require(_0x0bfe('0x4'));var fs=require('fs');var path=require(_0x0bfe('0x5'));var rimraf=require(_0x0bfe('0x6'));var config=require(_0x0bfe('0x7'));var attributes=require(_0x0bfe('0x8'));module[_0x0bfe('0x9')]=function(_0x48b75e,_0x10407d){return _0x48b75e[_0x0bfe('0xa')](_0x0bfe('0xb'),attributes,{'tableName':_0x0bfe('0xc'),'paranoid':![],'indexes':[{'name':_0x0bfe('0xd'),'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 137c0ed..0b33faa 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 _0x2127=['client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4d337e,_0x2f7eed){var _0x247963=function(_0x3d6564){while(--_0x3d6564){_0x4d337e['push'](_0x4d337e['shift']());}};_0x247963(++_0x2f7eed);}(_0x2127,0xdf));var _0x7212=function(_0x4b563f,_0x2a1057){_0x4b563f=_0x4b563f-0x0;var _0x214f20=_0x2127[_0x4b563f];return _0x214f20;};'use strict';var _=require('lodash');var util=require(_0x7212('0x0'));var moment=require('moment');var BPromise=require(_0x7212('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7212('0x2'));var db=require(_0x7212('0x3'))['db'];var utils=require(_0x7212('0x4'));var logger=require(_0x7212('0x5'))(_0x7212('0x6'));var config=require('../../config/environment');var jayson=require(_0x7212('0x7'));var client=jayson[_0x7212('0x8')][_0x7212('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x127fab,_0xe31b93,_0x3aca49){return new BPromise(function(_0x5d1e6e,_0x4721d9){return client[_0x7212('0xa')](_0x127fab,_0x3aca49)[_0x7212('0xb')](function(_0x4552c7){logger['info'](_0x7212('0xc'),_0xe31b93,_0x7212('0xd'));logger[_0x7212('0xe')](_0x7212('0xf'),_0xe31b93,_0x7212('0xd'),JSON[_0x7212('0x10')](_0x4552c7));if(_0x4552c7[_0x7212('0x11')]){if(_0x4552c7['error']['code']===0x1f4){logger[_0x7212('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0xe31b93,_0x4552c7[_0x7212('0x11')][_0x7212('0x12')]);return _0x4721d9(_0x4552c7['error']['message']);}logger[_0x7212('0x11')](_0x7212('0xc'),_0xe31b93,_0x4552c7[_0x7212('0x11')]['message']);return _0x5d1e6e(_0x4552c7['error']['message']);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0xe31b93,_0x7212('0xd'));_0x5d1e6e(_0x4552c7[_0x7212('0x13')][_0x7212('0x12')]);}})[_0x7212('0x14')](function(_0x58fe54){logger[_0x7212('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0xe31b93,_0x58fe54);_0x4721d9(_0x58fe54);});});} \ No newline at end of file +var _0x669f=['request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','FaxTransferReport,\x20%s,\x20%s','message','lodash','moment','../../config/utils','jayson/promise','client','http','then','info'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x669f,0x19c));var _0xf669=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x669f[_0x291f8b];return _0x275171;};'use strict';var _=require(_0xf669('0x0'));var util=require('util');var moment=require(_0xf669('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf669('0x2'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf669('0x3'));var client=jayson[_0xf669('0x4')][_0xf669('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x1dcbbc,_0x2f0cc4,_0x39300a){return new BPromise(function(_0x5932ca,_0x53f5d5){return client['request'](_0x1dcbbc,_0x39300a)[_0xf669('0x6')](function(_0x4a3fcf){logger[_0xf669('0x7')]('FaxTransferReport,\x20%s,\x20%s',_0x2f0cc4,_0xf669('0x8'));logger['debug'](_0xf669('0x9'),_0x2f0cc4,_0xf669('0x8'),JSON['stringify'](_0x4a3fcf));if(_0x4a3fcf['error']){if(_0x4a3fcf[_0xf669('0xa')][_0xf669('0xb')]===0x1f4){logger[_0xf669('0xa')](_0xf669('0xc'),_0x2f0cc4,_0x4a3fcf[_0xf669('0xa')]['message']);return _0x53f5d5(_0x4a3fcf[_0xf669('0xa')][_0xf669('0xd')]);}logger[_0xf669('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x2f0cc4,_0x4a3fcf[_0xf669('0xa')][_0xf669('0xd')]);return _0x5932ca(_0x4a3fcf[_0xf669('0xa')]['message']);}else{logger[_0xf669('0x7')](_0xf669('0xc'),_0x2f0cc4,_0xf669('0x8'));_0x5932ca(_0x4a3fcf['result'][_0xf669('0xd')]);}})['catch'](function(_0x323b38){logger['error'](_0xf669('0xc'),_0x2f0cc4,_0x323b38);_0x53f5d5(_0x323b38);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 53b2748..9020bc1 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 _0x5637=['/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./faxTransferReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x4d67ec,_0x1f4f90){var _0x34f0cf=function(_0x26ef04){while(--_0x26ef04){_0x4d67ec['push'](_0x4d67ec['shift']());}};_0x34f0cf(++_0x1f4f90);}(_0x5637,0xe4));var _0x7563=function(_0xf44d3,_0x442ed6){_0xf44d3=_0xf44d3-0x0;var _0x38b0cc=_0x5637[_0xf44d3];return _0x38b0cc;};'use strict';var multer=require(_0x7563('0x0'));var util=require(_0x7563('0x1'));var path=require(_0x7563('0x2'));var timeout=require(_0x7563('0x3'));var express=require(_0x7563('0x4'));var router=express[_0x7563('0x5')]();var fs_extra=require(_0x7563('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7563('0x7'));router[_0x7563('0x8')]('/',auth[_0x7563('0x9')](),controller['index']);router[_0x7563('0x8')](_0x7563('0xa'),auth[_0x7563('0x9')](),controller[_0x7563('0xb')]);router[_0x7563('0x8')](_0x7563('0xc'),auth[_0x7563('0x9')](),controller[_0x7563('0xd')]);router[_0x7563('0xe')]('/',auth[_0x7563('0x9')](),controller['create']);router[_0x7563('0xf')](_0x7563('0xc'),auth[_0x7563('0x9')](),controller[_0x7563('0x10')]);router[_0x7563('0x11')](_0x7563('0xc'),auth['isAuthenticated'](),controller[_0x7563('0x12')]);module[_0x7563('0x13')]=router; \ No newline at end of file +var _0xf065=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','show','post','/:id'];(function(_0x4090ea,_0x3061ac){var _0x18c31c=function(_0x2a7883){while(--_0x2a7883){_0x4090ea['push'](_0x4090ea['shift']());}};_0x18c31c(++_0x3061ac);}(_0xf065,0x178));var _0x5f06=function(_0x2b71ce,_0x10a62b){_0x2b71ce=_0x2b71ce-0x0;var _0x371bef=_0xf065[_0x2b71ce];return _0x371bef;};'use strict';var multer=require('multer');var util=require(_0x5f06('0x0'));var path=require(_0x5f06('0x1'));var timeout=require(_0x5f06('0x2'));var express=require(_0x5f06('0x3'));var router=express[_0x5f06('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5f06('0x5'));var interaction=require(_0x5f06('0x6'));var config=require(_0x5f06('0x7'));var controller=require(_0x5f06('0x8'));router['get']('/',auth[_0x5f06('0x9')](),controller[_0x5f06('0xa')]);router['get']('/describe',auth[_0x5f06('0x9')](),controller['describe']);router[_0x5f06('0xb')]('/:id',auth[_0x5f06('0x9')](),controller[_0x5f06('0xc')]);router[_0x5f06('0xd')]('/',auth[_0x5f06('0x9')](),controller['create']);router['put'](_0x5f06('0xe'),auth[_0x5f06('0x9')](),controller['update']);router['delete'](_0x5f06('0xe'),auth[_0x5f06('0x9')](),controller[_0x5f06('0xf')]);module[_0x5f06('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index b510f0c..8582ed5 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 _0x03f2=['update','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x03f2,0x191));var _0x203f=function(_0x1bcb80,_0x3b9357){_0x1bcb80=_0x1bcb80-0x0;var _0x392977=_0x03f2[_0x1bcb80];return _0x392977;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x203f('0x0'));var timeout=require(_0x203f('0x1'));var express=require(_0x203f('0x2'));var router=express[_0x203f('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x203f('0x4'));var config=require(_0x203f('0x5'));var controller=require(_0x203f('0x6'));router[_0x203f('0x7')]('/',auth['isAuthenticated'](),controller[_0x203f('0x8')]);router[_0x203f('0x7')](_0x203f('0x9'),auth[_0x203f('0xa')](),controller[_0x203f('0xb')]);router[_0x203f('0x7')](_0x203f('0xc'),auth[_0x203f('0xa')](),controller[_0x203f('0xd')]);router[_0x203f('0x7')](_0x203f('0xe'),auth[_0x203f('0xa')](),controller[_0x203f('0xf')]);router['post']('/',auth[_0x203f('0xa')](),controller[_0x203f('0x10')]);router[_0x203f('0x11')](_0x203f('0xc'),auth[_0x203f('0xa')](),controller[_0x203f('0x12')]);router['put'](_0x203f('0x9'),auth[_0x203f('0xa')](),controller[_0x203f('0x13')]);router['delete'](_0x203f('0x9'),auth[_0x203f('0xa')](),controller[_0x203f('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc950=['../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','post','addConfiguration','update','delete','destroy','exports','multer','express','Router','../../components/auth/service'];(function(_0x87eee5,_0x581852){var _0x17e2dc=function(_0x1122d2){while(--_0x1122d2){_0x87eee5['push'](_0x87eee5['shift']());}};_0x17e2dc(++_0x581852);}(_0xc950,0x1ea));var _0x0c95=function(_0x263c47,_0x5f3c26){_0x263c47=_0x263c47-0x0;var _0x539e50=_0xc950[_0x263c47];return _0x539e50;};'use strict';var multer=require(_0x0c95('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0c95('0x1'));var router=express[_0x0c95('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0c95('0x3'));var interaction=require(_0x0c95('0x4'));var config=require(_0x0c95('0x5'));var controller=require(_0x0c95('0x6'));router[_0x0c95('0x7')]('/',auth[_0x0c95('0x8')](),controller['index']);router[_0x0c95('0x7')](_0x0c95('0x9'),auth[_0x0c95('0x8')](),controller[_0x0c95('0xa')]);router[_0x0c95('0x7')](_0x0c95('0xb'),auth['isAuthenticated'](),controller[_0x0c95('0xc')]);router[_0x0c95('0x7')]('/:id/fields',auth[_0x0c95('0x8')](),controller['getFields']);router[_0x0c95('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0c95('0xd')](_0x0c95('0xb'),auth[_0x0c95('0x8')](),controller[_0x0c95('0xe')]);router['put'](_0x0c95('0x9'),auth[_0x0c95('0x8')](),controller[_0x0c95('0xf')]);router[_0x0c95('0x10')]('/:id',auth[_0x0c95('0x8')](),controller[_0x0c95('0x11')]);module[_0x0c95('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 0573060..26b0db2 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 _0xeda7=['integrationTab','exports','STRING','ENUM','newTab'];(function(_0x9b29b4,_0xf7fa85){var _0x3a9cd2=function(_0x33daf7){while(--_0x33daf7){_0x9b29b4['push'](_0x9b29b4['shift']());}};_0x3a9cd2(++_0xf7fa85);}(_0xeda7,0x1a5));var _0x7eda=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeda7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7eda('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7eda('0x1')]},'username':{'type':Sequelize[_0x7eda('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x7eda('0x2')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x7eda('0x1')]},'consumerKey':{'type':Sequelize[_0x7eda('0x1')]},'consumerSecret':{'type':Sequelize[_0x7eda('0x1')]},'token':{'type':Sequelize[_0x7eda('0x1')]},'tokenSecret':{'type':Sequelize[_0x7eda('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x7eda('0x3')),'defaultValue':_0x7eda('0x4')}}; \ No newline at end of file +var _0x65ae=['ENUM','basic','integrationTab','sequelize','exports','STRING'];(function(_0x48f98f,_0x271ed6){var _0x787102=function(_0x2fda20){while(--_0x2fda20){_0x48f98f['push'](_0x48f98f['shift']());}};_0x787102(++_0x271ed6);}(_0x65ae,0xc9));var _0xe65a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x65ae[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xe65a('0x0'));module[_0xe65a('0x1')]={'name':{'type':Sequelize[_0xe65a('0x2')]},'description':{'type':Sequelize[_0xe65a('0x2')]},'username':{'type':Sequelize[_0xe65a('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xe65a('0x3')](_0xe65a('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xe65a('0x2')]},'consumerKey':{'type':Sequelize[_0xe65a('0x2')]},'consumerSecret':{'type':Sequelize[_0xe65a('0x2')]},'token':{'type':Sequelize[_0xe65a('0x2')]},'tokenSecret':{'type':Sequelize[_0xe65a('0x2')]},'serverUrl':{'type':Sequelize[_0xe65a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe65a('0x3')](_0xe65a('0x5'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 26d2d1e..8ab96de 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 _0x7d67=['getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','password','toString','base64','concat','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','index','map','DeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','include','show','includeAll','find','catch','create','body','params','findOne','DeskConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField'];(function(_0x2652b8,_0x59c8a9){var _0x2ae5b0=function(_0x4d3376){while(--_0x4d3376){_0x2652b8['push'](_0x2652b8['shift']());}};_0x2ae5b0(++_0x59c8a9);}(_0x7d67,0xfb));var _0x77d6=function(_0x165a2c,_0xa7bc83){_0x165a2c=_0x165a2c-0x0;var _0x3ddcee=_0x7d67[_0x165a2c];return _0x3ddcee;};'use strict';var emlformat=require(_0x77d6('0x0'));var rimraf=require(_0x77d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77d6('0x2'));var rp=require(_0x77d6('0x3'));var moment=require(_0x77d6('0x4'));var BPromise=require(_0x77d6('0x5'));var Mustache=require(_0x77d6('0x6'));var util=require('util');var path=require(_0x77d6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x77d6('0x8'));var fs=require('fs');var fs_extra=require(_0x77d6('0x9'));var _=require(_0x77d6('0xa'));var squel=require(_0x77d6('0xb'));var crypto=require(_0x77d6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x77d6('0xd'));var toCsv=require(_0x77d6('0xe'));var querystring=require('querystring');var Papa=require(_0x77d6('0xf'));var Redis=require(_0x77d6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x77d6('0x11'));var as=require(_0x77d6('0x12'));var hardwareService=require(_0x77d6('0x13'));var logger=require(_0x77d6('0x14'))(_0x77d6('0x15'));var utils=require(_0x77d6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x77d6('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2ac925,_0x2f8505){_0x2f8505=_0x2f8505||0xcc;return function(_0x48c8a2){if(_0x48c8a2){return _0x2ac925[_0x77d6('0x18')](_0x2f8505);}return _0x2ac925['status'](_0x2f8505)[_0x77d6('0x19')]();};}function respondWithResult(_0x10ffd7,_0x1abd77){_0x1abd77=_0x1abd77||0xc8;return function(_0x18a6ee){if(_0x18a6ee){return _0x10ffd7[_0x77d6('0x1a')](_0x1abd77)[_0x77d6('0x1b')](_0x18a6ee);}};}function respondWithFilteredResult(_0x6fbcc7,_0x1caf58){return function(_0x5d6d88){if(_0x5d6d88){var _0x16040e=typeof _0x1caf58[_0x77d6('0x1c')]===_0x77d6('0x1d')&&typeof _0x1caf58[_0x77d6('0x1e')]===_0x77d6('0x1d');var _0x2935c6=_0x5d6d88['count'];var _0x4af230=_0x16040e?0x0:_0x1caf58[_0x77d6('0x1c')];var _0x351804=_0x16040e?_0x5d6d88[_0x77d6('0x1f')]:_0x1caf58[_0x77d6('0x1c')]+_0x1caf58[_0x77d6('0x1e')];var _0x161ffb;if(_0x351804>=_0x2935c6){_0x351804=_0x2935c6;_0x161ffb=0xc8;}else{_0x161ffb=0xce;}_0x6fbcc7[_0x77d6('0x1a')](_0x161ffb);return _0x6fbcc7[_0x77d6('0x20')](_0x77d6('0x21'),_0x4af230+'-'+_0x351804+'/'+_0x2935c6)[_0x77d6('0x1b')](_0x5d6d88);}return null;};}function patchUpdates(_0x26c403){return function(_0x31c1f0){try{jsonpatch['apply'](_0x31c1f0,_0x26c403,!![]);}catch(_0x106ff0){return BPromise['reject'](_0x106ff0);}return _0x31c1f0[_0x77d6('0x22')]();};}function saveUpdates(_0x436a20,_0x5047f6){return function(_0x1ae5e7){if(_0x1ae5e7){return _0x1ae5e7[_0x77d6('0x23')](_0x436a20)[_0x77d6('0x24')](function(_0xd25b5b){return _0xd25b5b;});}return null;};}function removeEntity(_0x1328ee,_0x1cd749){return function(_0x43b88b){if(_0x43b88b){return _0x43b88b[_0x77d6('0x25')]()[_0x77d6('0x24')](function(){_0x1328ee['status'](0xcc)[_0x77d6('0x19')]();});}};}function handleEntityNotFound(_0xbf675c,_0x3f09e6){return function(_0x241212){if(!_0x241212){_0xbf675c['sendStatus'](0x194);}return _0x241212;};}function handleError(_0x195043,_0xf9e3c9){_0xf9e3c9=_0xf9e3c9||0x1f4;return function(_0xa97c4){logger[_0x77d6('0x26')](_0xa97c4['stack']);if(_0xa97c4[_0x77d6('0x27')]){delete _0xa97c4[_0x77d6('0x27')];}_0x195043[_0x77d6('0x1a')](_0xf9e3c9)[_0x77d6('0x28')](_0xa97c4);};}exports[_0x77d6('0x29')]=function(_0x46e1aa,_0x3cb485){var _0x19959b={},_0x4ee16d={},_0x405fb2={'count':0x0,'rows':[]};var _0x5e9c06=_[_0x77d6('0x2a')](db[_0x77d6('0x2b')][_0x77d6('0x2c')],function(_0x5bf3f3){return{'name':_0x5bf3f3[_0x77d6('0x2d')],'type':_0x5bf3f3['type'][_0x77d6('0x2e')]};});_0x4ee16d[_0x77d6('0x2f')]=_[_0x77d6('0x2a')](_0x5e9c06,_0x77d6('0x27'));_0x4ee16d[_0x77d6('0x30')]=_[_0x77d6('0x31')](_0x46e1aa[_0x77d6('0x30')]);_0x4ee16d[_0x77d6('0x32')]=_['intersection'](_0x4ee16d[_0x77d6('0x2f')],_0x4ee16d[_0x77d6('0x30')]);_0x19959b[_0x77d6('0x33')]=_[_0x77d6('0x34')](_0x4ee16d[_0x77d6('0x2f')],qs[_0x77d6('0x35')](_0x46e1aa[_0x77d6('0x30')]['fields']));_0x19959b[_0x77d6('0x33')]=_0x19959b[_0x77d6('0x33')][_0x77d6('0x36')]?_0x19959b[_0x77d6('0x33')]:_0x4ee16d[_0x77d6('0x2f')];if(!_0x46e1aa[_0x77d6('0x30')][_0x77d6('0x37')](_0x77d6('0x38'))){_0x19959b[_0x77d6('0x1e')]=qs['limit'](_0x46e1aa[_0x77d6('0x30')]['limit']);_0x19959b[_0x77d6('0x1c')]=qs[_0x77d6('0x1c')](_0x46e1aa[_0x77d6('0x30')][_0x77d6('0x1c')]);}_0x19959b['order']=qs[_0x77d6('0x39')](_0x46e1aa[_0x77d6('0x30')]['sort']);_0x19959b[_0x77d6('0x3a')]=qs[_0x77d6('0x32')](_[_0x77d6('0x3b')](_0x46e1aa[_0x77d6('0x30')],_0x4ee16d[_0x77d6('0x32')]),_0x5e9c06);if(_0x46e1aa[_0x77d6('0x30')]['filter']){_0x19959b[_0x77d6('0x3a')]=_[_0x77d6('0x3c')](_0x19959b[_0x77d6('0x3a')],{'$or':_[_0x77d6('0x2a')](_0x5e9c06,function(_0x5b5152){if(_0x5b5152[_0x77d6('0x3d')]!==_0x77d6('0x3e')){var _0x44d242={};_0x44d242[_0x5b5152[_0x77d6('0x27')]]={'$like':'%'+_0x46e1aa[_0x77d6('0x30')][_0x77d6('0x3f')]+'%'};return _0x44d242;}})});}_0x19959b=_[_0x77d6('0x3c')]({},_0x19959b,_0x46e1aa[_0x77d6('0x40')]);var _0x2d6416={'where':_0x19959b[_0x77d6('0x3a')]};return db[_0x77d6('0x2b')]['count'](_0x2d6416)[_0x77d6('0x24')](function(_0x11f1db){_0x405fb2['count']=_0x11f1db;if(_0x46e1aa[_0x77d6('0x30')]['includeAll']){_0x19959b[_0x77d6('0x41')]=[{'all':!![]}];}return db[_0x77d6('0x2b')]['findAll'](_0x19959b);})[_0x77d6('0x24')](function(_0x2bd49e){_0x405fb2['rows']=_0x2bd49e;return _0x405fb2;})[_0x77d6('0x24')](respondWithFilteredResult(_0x3cb485,_0x19959b))['catch'](handleError(_0x3cb485,null));};exports[_0x77d6('0x42')]=function(_0x5c114c,_0x1408cc){var _0x1991b2={'raw':![],'where':{'id':_0x5c114c['params']['id']}},_0x22cc3a={};_0x22cc3a[_0x77d6('0x2f')]=_[_0x77d6('0x31')](db['DeskAccount']['rawAttributes']);_0x22cc3a[_0x77d6('0x30')]=_[_0x77d6('0x31')](_0x5c114c[_0x77d6('0x30')]);_0x22cc3a[_0x77d6('0x32')]=_['intersection'](_0x22cc3a['model'],_0x22cc3a['query']);_0x1991b2['attributes']=_[_0x77d6('0x34')](_0x22cc3a['model'],qs['fields'](_0x5c114c[_0x77d6('0x30')]['fields']));_0x1991b2[_0x77d6('0x33')]=_0x1991b2[_0x77d6('0x33')]['length']?_0x1991b2[_0x77d6('0x33')]:_0x22cc3a[_0x77d6('0x2f')];if(_0x5c114c[_0x77d6('0x30')][_0x77d6('0x43')]){_0x1991b2[_0x77d6('0x41')]=[{'all':!![]}];}_0x1991b2=_[_0x77d6('0x3c')]({},_0x1991b2,_0x5c114c['options']);return db[_0x77d6('0x2b')][_0x77d6('0x44')](_0x1991b2)[_0x77d6('0x24')](handleEntityNotFound(_0x1408cc,null))[_0x77d6('0x24')](respondWithResult(_0x1408cc,null))[_0x77d6('0x45')](handleError(_0x1408cc,null));};exports[_0x77d6('0x46')]=function(_0xd9eeeb,_0x2afc61){return db[_0x77d6('0x2b')][_0x77d6('0x46')](_0xd9eeeb[_0x77d6('0x47')],{})['then'](respondWithResult(_0x2afc61,0xc9))[_0x77d6('0x45')](handleError(_0x2afc61,null));};exports['update']=function(_0x4af468,_0x58da10){if(_0x4af468[_0x77d6('0x47')]['id']){delete _0x4af468[_0x77d6('0x47')]['id'];}return db[_0x77d6('0x2b')][_0x77d6('0x44')]({'where':{'id':_0x4af468[_0x77d6('0x48')]['id']}})[_0x77d6('0x24')](handleEntityNotFound(_0x58da10,null))['then'](saveUpdates(_0x4af468['body'],null))[_0x77d6('0x24')](respondWithResult(_0x58da10,null))['catch'](handleError(_0x58da10,null));};exports[_0x77d6('0x25')]=function(_0x10fe44,_0x3565f1){return db[_0x77d6('0x2b')][_0x77d6('0x44')]({'where':{'id':_0x10fe44[_0x77d6('0x48')]['id']}})[_0x77d6('0x24')](handleEntityNotFound(_0x3565f1,null))['then'](removeEntity(_0x3565f1,null))[_0x77d6('0x45')](handleError(_0x3565f1,null));};exports['getConfigurations']=function(_0x399a27,_0x2c6e9d,_0x54229b){var _0x100fcd={};var _0x5f8624={};var _0x4b675c;var _0x2f054b;return db['DeskAccount'][_0x77d6('0x49')]({'where':{'id':_0x399a27[_0x77d6('0x48')]['id']}})[_0x77d6('0x24')](handleEntityNotFound(_0x2c6e9d,null))[_0x77d6('0x24')](function(_0x58267f){if(_0x58267f){_0x4b675c=_0x58267f;_0x5f8624[_0x77d6('0x2f')]=_[_0x77d6('0x31')](db[_0x77d6('0x4a')][_0x77d6('0x2c')]);_0x5f8624['query']=_[_0x77d6('0x31')](_0x399a27[_0x77d6('0x30')]);_0x5f8624[_0x77d6('0x32')]=_[_0x77d6('0x34')](_0x5f8624['model'],_0x5f8624[_0x77d6('0x30')]);_0x100fcd[_0x77d6('0x33')]=_['intersection'](_0x5f8624[_0x77d6('0x2f')],qs['fields'](_0x399a27[_0x77d6('0x30')][_0x77d6('0x35')]));_0x100fcd[_0x77d6('0x33')]=_0x100fcd[_0x77d6('0x33')][_0x77d6('0x36')]?_0x100fcd['attributes']:_0x5f8624[_0x77d6('0x2f')];_0x100fcd['order']=qs[_0x77d6('0x39')](_0x399a27[_0x77d6('0x30')]['sort']);_0x100fcd[_0x77d6('0x3a')]=qs[_0x77d6('0x32')](_[_0x77d6('0x3b')](_0x399a27[_0x77d6('0x30')],_0x5f8624[_0x77d6('0x32')]));if(_0x399a27[_0x77d6('0x30')][_0x77d6('0x3f')]){_0x100fcd['where']=_['merge'](_0x100fcd[_0x77d6('0x3a')],{'$or':_[_0x77d6('0x2a')](_0x100fcd['attributes'],function(_0x4a03ef){var _0x2f3d0d={};_0x2f3d0d[_0x4a03ef]={'$like':'%'+_0x399a27[_0x77d6('0x30')][_0x77d6('0x3f')]+'%'};return _0x2f3d0d;})});}_0x100fcd=_[_0x77d6('0x3c')]({},_0x100fcd,_0x399a27['options']);return _0x4b675c['getConfigurations'](_0x100fcd);}})['then'](function(_0x4864e9){if(_0x4864e9){_0x2f054b=_0x4864e9[_0x77d6('0x36')];if(!_0x399a27[_0x77d6('0x30')][_0x77d6('0x37')](_0x77d6('0x38'))){_0x100fcd[_0x77d6('0x1e')]=qs[_0x77d6('0x1e')](_0x399a27[_0x77d6('0x30')][_0x77d6('0x1e')]);_0x100fcd[_0x77d6('0x1c')]=qs[_0x77d6('0x1c')](_0x399a27[_0x77d6('0x30')][_0x77d6('0x1c')]);}return _0x4b675c[_0x77d6('0x4b')](_0x100fcd);}})[_0x77d6('0x24')](function(_0x47a4ef){if(_0x47a4ef){return _0x47a4ef?{'count':_0x2f054b,'rows':_0x47a4ef}:null;}})[_0x77d6('0x24')](respondWithResult(_0x2c6e9d,null))['catch'](handleError(_0x2c6e9d,null));};exports['addConfiguration']=function(_0x31d1ed,_0x23177b,_0x28eeb0){if(_0x31d1ed[_0x77d6('0x47')]['id']){delete _0x31d1ed[_0x77d6('0x47')]['id'];}return db[_0x77d6('0x2b')][_0x77d6('0x49')]({'where':{'id':_0x31d1ed[_0x77d6('0x48')]['id']}})[_0x77d6('0x24')](handleEntityNotFound(_0x23177b,null))['then'](function(_0x4a1265){if(_0x4a1265){_0x31d1ed['body'][_0x77d6('0x4c')]=_0x4a1265['id'];_0x31d1ed[_0x77d6('0x47')][_0x77d6('0x4d')]=integrations[_0x77d6('0x4e')](_0x31d1ed['body'][_0x77d6('0x4f')],_0x31d1ed[_0x77d6('0x47')]['type']);_0x31d1ed[_0x77d6('0x47')]['Descriptions']=integrations[_0x77d6('0x50')](_0x31d1ed[_0x77d6('0x47')][_0x77d6('0x4f')],_0x31d1ed[_0x77d6('0x47')][_0x77d6('0x3d')]);return db[_0x77d6('0x4a')]['create'](_0x31d1ed['body'],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0x77d6('0x51')],'as':'Descriptions'}]});}return null;})[_0x77d6('0x24')](respondWithResult(_0x23177b,null))[_0x77d6('0x45')](handleError(_0x23177b,null));};exports[_0x77d6('0x52')]=function(_0x2d072f,_0x4a16d2,_0x5aba63){var _0x3454c2=[{'name':_0x77d6('0x53'),'label':_0x77d6('0x53'),'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 _0x4c626a='';return db[_0x77d6('0x2b')]['findOne']({'where':{'id':_0x2d072f[_0x77d6('0x48')]['id']},'attributes':['id',_0x77d6('0x54'),_0x77d6('0x55'),_0x77d6('0x56'),'password',_0x77d6('0x57'),_0x77d6('0x58'),'token','tokenSecret']})[_0x77d6('0x24')](handleEntityNotFound(_0x4a16d2,null))[_0x77d6('0x24')](function(_0x122831){if(_0x122831){_0x4c626a=_0x122831[_0x77d6('0x54')];var _0xc1cd3c=_0x4c626a[_0x77d6('0x59')](-0x1);if(_0xc1cd3c==='/'){_0x4c626a=_0x4c626a[_0x77d6('0x5a')](0x0,_0x4c626a[_0x77d6('0x5b')](_0xc1cd3c));}var _0x5071b6={'method':_0x77d6('0x5c'),'uri':util[_0x77d6('0x5d')](_0x77d6('0x5e'),_0x4c626a),'headers':{'Content-Type':'application/json','Accept':_0x77d6('0x5f')},'json':!![]};if(_0x122831[_0x77d6('0x55')]===_0x77d6('0x60')){_0x5071b6[_0x77d6('0x61')][_0x77d6('0x62')]=util[_0x77d6('0x5d')](_0x77d6('0x63'),new Buffer(util['format'](_0x77d6('0x64'),_0x122831['username'],_0x122831[_0x77d6('0x65')]))[_0x77d6('0x66')](_0x77d6('0x67')));}return rp(_0x5071b6)[_0x77d6('0x24')](function(_0x418a23){return _0x3454c2[_0x77d6('0x68')](_[_0x77d6('0x2a')](_0x418a23['_embedded']['entries'],function(_0x202272){return{'id':_0x202272[_0x77d6('0x27')],'name':_0x202272['name'],'type':_0x202272[_0x77d6('0x3d')],'active':_0x202272[_0x77d6('0x69')],'label':_0x202272[_0x77d6('0x6a')],'custom':!![]};}));});}})[_0x77d6('0x24')](function(_0x1aa317){return{'count':_0x1aa317[_0x77d6('0x36')],'rows':_0x1aa317};})['then'](respondWithResult(_0x4a16d2,null))[_0x77d6('0x45')](function(_0x14d00a){var _0x229552=_0x2d072f[_0x77d6('0x30')][_0x77d6('0x6b')]?0x1f4:_0x14d00a['statusCode']||0x1f4;logger[_0x77d6('0x26')](_0x77d6('0x6c'),_0x77d6('0x52'),_0x229552,JSON[_0x77d6('0x6d')](_0x14d00a));delete _0x14d00a[_0x77d6('0x27')];if(_0x229552===0x191){_0x229552=0x190;}_0x4a16d2[_0x77d6('0x1a')](_0x229552)['send'](_0x2d072f[_0x77d6('0x30')]['test']?{'message':_0x77d6('0x6e'),'statusCode':_0x14d00a['statusCode']}:_0x14d00a);});}; \ No newline at end of file +var _0x74fe=['find','create','body','destroy','getConfigurations','sort','options','hasOwnProperty','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','Subjects','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','end','sendStatus','error','stack','name','index','map','DeskAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','where','pick','filter','merge','then','includeAll','include','findAll','rows','catch','show','params'];(function(_0x51a89c,_0x529131){var _0x1ef0bc=function(_0xfc1920){while(--_0xfc1920){_0x51a89c['push'](_0x51a89c['shift']());}};_0x1ef0bc(++_0x529131);}(_0x74fe,0x189));var _0xe74f=function(_0x32e5e8,_0x4999f5){_0x32e5e8=_0x32e5e8-0x0;var _0x5e1fb7=_0x74fe[_0x32e5e8];return _0x5e1fb7;};'use strict';var emlformat=require(_0xe74f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe74f('0x1'));var jsonpatch=require(_0xe74f('0x2'));var rp=require('request-promise');var moment=require(_0xe74f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe74f('0x4'));var util=require(_0xe74f('0x5'));var path=require(_0xe74f('0x6'));var sox=require('sox');var csv=require(_0xe74f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe74f('0x8'));var _=require(_0xe74f('0x9'));var squel=require('squel');var crypto=require(_0xe74f('0xa'));var jsforce=require(_0xe74f('0xb'));var deskjs=require(_0xe74f('0xc'));var toCsv=require(_0xe74f('0x7'));var querystring=require(_0xe74f('0xd'));var Papa=require(_0xe74f('0xe'));var Redis=require(_0xe74f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe74f('0x10'));var as=require(_0xe74f('0x11'));var hardwareService=require(_0xe74f('0x12'));var logger=require('../../config/logger')(_0xe74f('0x13'));var utils=require('../../config/utils');var config=require(_0xe74f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe74f('0x15'))['db'];var integrations=require(_0xe74f('0x16'));function respondWithStatusCode(_0x758f49,_0x4cdd8c){_0x4cdd8c=_0x4cdd8c||0xcc;return function(_0x2931e6){if(_0x2931e6){return _0x758f49['sendStatus'](_0x4cdd8c);}return _0x758f49['status'](_0x4cdd8c)['end']();};}function respondWithResult(_0x306aad,_0x43b8d3){_0x43b8d3=_0x43b8d3||0xc8;return function(_0x327324){if(_0x327324){return _0x306aad[_0xe74f('0x17')](_0x43b8d3)[_0xe74f('0x18')](_0x327324);}};}function respondWithFilteredResult(_0x2f5d84,_0xab5223){return function(_0x71b058){if(_0x71b058){var _0x4d2ec0=typeof _0xab5223[_0xe74f('0x19')]==='undefined'&&typeof _0xab5223[_0xe74f('0x1a')]===_0xe74f('0x1b');var _0x28635e=_0x71b058['count'];var _0x20b16e=_0x4d2ec0?0x0:_0xab5223['offset'];var _0x1bcf70=_0x4d2ec0?_0x71b058[_0xe74f('0x1c')]:_0xab5223['offset']+_0xab5223['limit'];var _0x4aec8f;if(_0x1bcf70>=_0x28635e){_0x1bcf70=_0x28635e;_0x4aec8f=0xc8;}else{_0x4aec8f=0xce;}_0x2f5d84[_0xe74f('0x17')](_0x4aec8f);return _0x2f5d84[_0xe74f('0x1d')](_0xe74f('0x1e'),_0x20b16e+'-'+_0x1bcf70+'/'+_0x28635e)[_0xe74f('0x18')](_0x71b058);}return null;};}function patchUpdates(_0x46aac2){return function(_0x40ebb5){try{jsonpatch[_0xe74f('0x1f')](_0x40ebb5,_0x46aac2,!![]);}catch(_0x2ab48b){return BPromise['reject'](_0x2ab48b);}return _0x40ebb5[_0xe74f('0x20')]();};}function saveUpdates(_0x5d0006,_0x19e03b){return function(_0x4a5dc6){if(_0x4a5dc6){return _0x4a5dc6[_0xe74f('0x21')](_0x5d0006)['then'](function(_0x472b54){return _0x472b54;});}return null;};}function removeEntity(_0x16db64,_0x38d1e9){return function(_0xfcdad0){if(_0xfcdad0){return _0xfcdad0['destroy']()['then'](function(){_0x16db64[_0xe74f('0x17')](0xcc)[_0xe74f('0x22')]();});}};}function handleEntityNotFound(_0x3ad6fd,_0x59bc55){return function(_0x4e1d27){if(!_0x4e1d27){_0x3ad6fd[_0xe74f('0x23')](0x194);}return _0x4e1d27;};}function handleError(_0x4e02e9,_0x1d4683){_0x1d4683=_0x1d4683||0x1f4;return function(_0x4b4b93){logger[_0xe74f('0x24')](_0x4b4b93[_0xe74f('0x25')]);if(_0x4b4b93['name']){delete _0x4b4b93[_0xe74f('0x26')];}_0x4e02e9[_0xe74f('0x17')](_0x1d4683)['send'](_0x4b4b93);};}exports[_0xe74f('0x27')]=function(_0x4ede94,_0x428b6c){var _0x19df27={},_0x1c12e0={},_0x43a07b={'count':0x0,'rows':[]};var _0x1f4e07=_[_0xe74f('0x28')](db[_0xe74f('0x29')][_0xe74f('0x2a')],function(_0x3ee012){return{'name':_0x3ee012[_0xe74f('0x2b')],'type':_0x3ee012[_0xe74f('0x2c')]['key']};});_0x1c12e0['model']=_['map'](_0x1f4e07,_0xe74f('0x26'));_0x1c12e0[_0xe74f('0x2d')]=_[_0xe74f('0x2e')](_0x4ede94[_0xe74f('0x2d')]);_0x1c12e0[_0xe74f('0x2f')]=_[_0xe74f('0x30')](_0x1c12e0[_0xe74f('0x31')],_0x1c12e0[_0xe74f('0x2d')]);_0x19df27[_0xe74f('0x32')]=_[_0xe74f('0x30')](_0x1c12e0[_0xe74f('0x31')],qs[_0xe74f('0x33')](_0x4ede94[_0xe74f('0x2d')]['fields']));_0x19df27[_0xe74f('0x32')]=_0x19df27[_0xe74f('0x32')][_0xe74f('0x34')]?_0x19df27['attributes']:_0x1c12e0[_0xe74f('0x31')];if(!_0x4ede94[_0xe74f('0x2d')]['hasOwnProperty'](_0xe74f('0x35'))){_0x19df27[_0xe74f('0x1a')]=qs[_0xe74f('0x1a')](_0x4ede94[_0xe74f('0x2d')][_0xe74f('0x1a')]);_0x19df27['offset']=qs[_0xe74f('0x19')](_0x4ede94[_0xe74f('0x2d')][_0xe74f('0x19')]);}_0x19df27[_0xe74f('0x36')]=qs['sort'](_0x4ede94[_0xe74f('0x2d')]['sort']);_0x19df27[_0xe74f('0x37')]=qs['filters'](_[_0xe74f('0x38')](_0x4ede94['query'],_0x1c12e0['filters']),_0x1f4e07);if(_0x4ede94[_0xe74f('0x2d')][_0xe74f('0x39')]){_0x19df27[_0xe74f('0x37')]=_['merge'](_0x19df27[_0xe74f('0x37')],{'$or':_[_0xe74f('0x28')](_0x1f4e07,function(_0x5dd18a){if(_0x5dd18a[_0xe74f('0x2c')]!=='VIRTUAL'){var _0x1e5043={};_0x1e5043[_0x5dd18a['name']]={'$like':'%'+_0x4ede94[_0xe74f('0x2d')][_0xe74f('0x39')]+'%'};return _0x1e5043;}})});}_0x19df27=_[_0xe74f('0x3a')]({},_0x19df27,_0x4ede94['options']);var _0x35238f={'where':_0x19df27['where']};return db[_0xe74f('0x29')][_0xe74f('0x1c')](_0x35238f)[_0xe74f('0x3b')](function(_0x287757){_0x43a07b[_0xe74f('0x1c')]=_0x287757;if(_0x4ede94['query'][_0xe74f('0x3c')]){_0x19df27[_0xe74f('0x3d')]=[{'all':!![]}];}return db['DeskAccount'][_0xe74f('0x3e')](_0x19df27);})[_0xe74f('0x3b')](function(_0x976aca){_0x43a07b[_0xe74f('0x3f')]=_0x976aca;return _0x43a07b;})[_0xe74f('0x3b')](respondWithFilteredResult(_0x428b6c,_0x19df27))[_0xe74f('0x40')](handleError(_0x428b6c,null));};exports[_0xe74f('0x41')]=function(_0x2c6d18,_0x795a81){var _0x1e0469={'raw':![],'where':{'id':_0x2c6d18[_0xe74f('0x42')]['id']}},_0x453e4b={};_0x453e4b[_0xe74f('0x31')]=_[_0xe74f('0x2e')](db[_0xe74f('0x29')][_0xe74f('0x2a')]);_0x453e4b[_0xe74f('0x2d')]=_[_0xe74f('0x2e')](_0x2c6d18[_0xe74f('0x2d')]);_0x453e4b[_0xe74f('0x2f')]=_[_0xe74f('0x30')](_0x453e4b[_0xe74f('0x31')],_0x453e4b['query']);_0x1e0469[_0xe74f('0x32')]=_[_0xe74f('0x30')](_0x453e4b[_0xe74f('0x31')],qs[_0xe74f('0x33')](_0x2c6d18[_0xe74f('0x2d')][_0xe74f('0x33')]));_0x1e0469[_0xe74f('0x32')]=_0x1e0469[_0xe74f('0x32')][_0xe74f('0x34')]?_0x1e0469['attributes']:_0x453e4b['model'];if(_0x2c6d18[_0xe74f('0x2d')][_0xe74f('0x3c')]){_0x1e0469[_0xe74f('0x3d')]=[{'all':!![]}];}_0x1e0469=_[_0xe74f('0x3a')]({},_0x1e0469,_0x2c6d18['options']);return db[_0xe74f('0x29')][_0xe74f('0x43')](_0x1e0469)[_0xe74f('0x3b')](handleEntityNotFound(_0x795a81,null))['then'](respondWithResult(_0x795a81,null))[_0xe74f('0x40')](handleError(_0x795a81,null));};exports[_0xe74f('0x44')]=function(_0x1c4129,_0x136476){return db[_0xe74f('0x29')][_0xe74f('0x44')](_0x1c4129[_0xe74f('0x45')],{})[_0xe74f('0x3b')](respondWithResult(_0x136476,0xc9))[_0xe74f('0x40')](handleError(_0x136476,null));};exports[_0xe74f('0x21')]=function(_0x282664,_0xf54b0){if(_0x282664['body']['id']){delete _0x282664['body']['id'];}return db[_0xe74f('0x29')]['find']({'where':{'id':_0x282664[_0xe74f('0x42')]['id']}})[_0xe74f('0x3b')](handleEntityNotFound(_0xf54b0,null))[_0xe74f('0x3b')](saveUpdates(_0x282664[_0xe74f('0x45')],null))[_0xe74f('0x3b')](respondWithResult(_0xf54b0,null))['catch'](handleError(_0xf54b0,null));};exports[_0xe74f('0x46')]=function(_0xbc7f00,_0x4e9b11){return db[_0xe74f('0x29')][_0xe74f('0x43')]({'where':{'id':_0xbc7f00[_0xe74f('0x42')]['id']}})[_0xe74f('0x3b')](handleEntityNotFound(_0x4e9b11,null))[_0xe74f('0x3b')](removeEntity(_0x4e9b11,null))[_0xe74f('0x40')](handleError(_0x4e9b11,null));};exports[_0xe74f('0x47')]=function(_0x448759,_0x41d629,_0x5050e2){var _0x50d6d8={};var _0x39f29f={};var _0x16d73f;var _0x560ee0;return db['DeskAccount']['findOne']({'where':{'id':_0x448759[_0xe74f('0x42')]['id']}})[_0xe74f('0x3b')](handleEntityNotFound(_0x41d629,null))[_0xe74f('0x3b')](function(_0x3d67f6){if(_0x3d67f6){_0x16d73f=_0x3d67f6;_0x39f29f[_0xe74f('0x31')]=_[_0xe74f('0x2e')](db['DeskConfiguration'][_0xe74f('0x2a')]);_0x39f29f[_0xe74f('0x2d')]=_[_0xe74f('0x2e')](_0x448759[_0xe74f('0x2d')]);_0x39f29f[_0xe74f('0x2f')]=_[_0xe74f('0x30')](_0x39f29f[_0xe74f('0x31')],_0x39f29f[_0xe74f('0x2d')]);_0x50d6d8[_0xe74f('0x32')]=_['intersection'](_0x39f29f['model'],qs[_0xe74f('0x33')](_0x448759['query'][_0xe74f('0x33')]));_0x50d6d8['attributes']=_0x50d6d8[_0xe74f('0x32')][_0xe74f('0x34')]?_0x50d6d8[_0xe74f('0x32')]:_0x39f29f[_0xe74f('0x31')];_0x50d6d8[_0xe74f('0x36')]=qs['sort'](_0x448759[_0xe74f('0x2d')][_0xe74f('0x48')]);_0x50d6d8['where']=qs[_0xe74f('0x2f')](_[_0xe74f('0x38')](_0x448759[_0xe74f('0x2d')],_0x39f29f[_0xe74f('0x2f')]));if(_0x448759[_0xe74f('0x2d')]['filter']){_0x50d6d8[_0xe74f('0x37')]=_[_0xe74f('0x3a')](_0x50d6d8[_0xe74f('0x37')],{'$or':_['map'](_0x50d6d8[_0xe74f('0x32')],function(_0xd0052c){var _0x4b78d7={};_0x4b78d7[_0xd0052c]={'$like':'%'+_0x448759[_0xe74f('0x2d')]['filter']+'%'};return _0x4b78d7;})});}_0x50d6d8=_[_0xe74f('0x3a')]({},_0x50d6d8,_0x448759[_0xe74f('0x49')]);return _0x16d73f[_0xe74f('0x47')](_0x50d6d8);}})['then'](function(_0x4a74c0){if(_0x4a74c0){_0x560ee0=_0x4a74c0[_0xe74f('0x34')];if(!_0x448759[_0xe74f('0x2d')][_0xe74f('0x4a')](_0xe74f('0x35'))){_0x50d6d8[_0xe74f('0x1a')]=qs['limit'](_0x448759[_0xe74f('0x2d')]['limit']);_0x50d6d8[_0xe74f('0x19')]=qs[_0xe74f('0x19')](_0x448759[_0xe74f('0x2d')]['offset']);}return _0x16d73f[_0xe74f('0x47')](_0x50d6d8);}})[_0xe74f('0x3b')](function(_0x5e0a62){if(_0x5e0a62){return _0x5e0a62?{'count':_0x560ee0,'rows':_0x5e0a62}:null;}})[_0xe74f('0x3b')](respondWithResult(_0x41d629,null))[_0xe74f('0x40')](handleError(_0x41d629,null));};exports[_0xe74f('0x4b')]=function(_0x4d7533,_0xa0c552,_0x115a4d){if(_0x4d7533[_0xe74f('0x45')]['id']){delete _0x4d7533[_0xe74f('0x45')]['id'];}return db[_0xe74f('0x29')]['findOne']({'where':{'id':_0x4d7533[_0xe74f('0x42')]['id']}})[_0xe74f('0x3b')](handleEntityNotFound(_0xa0c552,null))[_0xe74f('0x3b')](function(_0x5280c8){if(_0x5280c8){_0x4d7533[_0xe74f('0x45')]['AccountId']=_0x5280c8['id'];_0x4d7533[_0xe74f('0x45')]['Subjects']=integrations[_0xe74f('0x4c')](_0x4d7533[_0xe74f('0x45')][_0xe74f('0x4d')],_0x4d7533[_0xe74f('0x45')]['type']);_0x4d7533[_0xe74f('0x45')][_0xe74f('0x4e')]=integrations[_0xe74f('0x4f')](_0x4d7533[_0xe74f('0x45')][_0xe74f('0x4d')],_0x4d7533[_0xe74f('0x45')][_0xe74f('0x2c')]);return db[_0xe74f('0x50')][_0xe74f('0x44')](_0x4d7533[_0xe74f('0x45')],{'include':[{'model':db[_0xe74f('0x51')],'as':_0xe74f('0x52')},{'model':db[_0xe74f('0x51')],'as':'Descriptions'}]});}return null;})[_0xe74f('0x3b')](respondWithResult(_0xa0c552,null))[_0xe74f('0x40')](handleError(_0xa0c552,null));};exports[_0xe74f('0x53')]=function(_0x222cd1,_0x41e0c2,_0x5b30de){var _0xd3b5e6=[{'name':_0xe74f('0x54'),'label':_0xe74f('0x54'),'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 _0x56a08c='';return db[_0xe74f('0x29')]['findOne']({'where':{'id':_0x222cd1['params']['id']},'attributes':['id',_0xe74f('0x55'),_0xe74f('0x56'),_0xe74f('0x57'),_0xe74f('0x58'),_0xe74f('0x59'),_0xe74f('0x5a'),_0xe74f('0x5b'),_0xe74f('0x5c')]})['then'](handleEntityNotFound(_0x41e0c2,null))[_0xe74f('0x3b')](function(_0x55d2d0){if(_0x55d2d0){_0x56a08c=_0x55d2d0['remoteUri'];var _0x164466=_0x56a08c[_0xe74f('0x5d')](-0x1);if(_0x164466==='/'){_0x56a08c=_0x56a08c[_0xe74f('0x5e')](0x0,_0x56a08c[_0xe74f('0x5f')](_0x164466));}var _0x21ff6e={'method':'GET','uri':util[_0xe74f('0x60')](_0xe74f('0x61'),_0x56a08c),'headers':{'Content-Type':_0xe74f('0x62'),'Accept':_0xe74f('0x62')},'json':!![]};if(_0x55d2d0['authType']===_0xe74f('0x63')){_0x21ff6e[_0xe74f('0x64')][_0xe74f('0x65')]=util[_0xe74f('0x60')]('Basic\x20%s',new Buffer(util[_0xe74f('0x60')](_0xe74f('0x66'),_0x55d2d0[_0xe74f('0x57')],_0x55d2d0[_0xe74f('0x58')]))[_0xe74f('0x67')](_0xe74f('0x68')));}return rp(_0x21ff6e)['then'](function(_0x51fa48){return _0xd3b5e6[_0xe74f('0x69')](_[_0xe74f('0x28')](_0x51fa48[_0xe74f('0x6a')][_0xe74f('0x6b')],function(_0x5ded40){return{'id':_0x5ded40[_0xe74f('0x26')],'name':_0x5ded40[_0xe74f('0x26')],'type':_0x5ded40[_0xe74f('0x2c')],'active':_0x5ded40[_0xe74f('0x6c')],'label':_0x5ded40[_0xe74f('0x6d')],'custom':!![]};}));});}})['then'](function(_0x3420c0){return{'count':_0x3420c0[_0xe74f('0x34')],'rows':_0x3420c0};})[_0xe74f('0x3b')](respondWithResult(_0x41e0c2,null))['catch'](function(_0xbe6e0d){var _0x4fb264=_0x222cd1[_0xe74f('0x2d')][_0xe74f('0x6e')]?0x1f4:_0xbe6e0d[_0xe74f('0x6f')]||0x1f4;logger['error'](_0xe74f('0x70'),'getFields',_0x4fb264,JSON[_0xe74f('0x71')](_0xbe6e0d));delete _0xbe6e0d['name'];if(_0x4fb264===0x191){_0x4fb264=0x190;}_0x41e0c2[_0xe74f('0x17')](_0x4fb264)[_0xe74f('0x72')](_0x222cd1[_0xe74f('0x2d')][_0xe74f('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0xbe6e0d[_0xe74f('0x6f')]}:_0xbe6e0d);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 4e01b72..7dfb502 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 _0x3a87=['../../components/integrations/configuration','exports','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x3a87,0x161));var _0x73a8=function(_0x284885,_0x34b143){_0x284885=_0x284885-0x0;var _0x3a9710=_0x3a87[_0x284885];return _0x3a9710;};'use strict';var _=require(_0x73a8('0x0'));var util=require(_0x73a8('0x1'));var logger=require(_0x73a8('0x2'))(_0x73a8('0x3'));var moment=require(_0x73a8('0x4'));var BPromise=require(_0x73a8('0x5'));var rp=require(_0x73a8('0x6'));var fs=require('fs');var path=require(_0x73a8('0x7'));var rimraf=require(_0x73a8('0x8'));var config=require(_0x73a8('0x9'));var attributes=require(_0x73a8('0xa'));var integrations=require(_0x73a8('0xb'));module[_0x73a8('0xc')]=function(_0x444018,_0x59f844){return _0x444018['define']('DeskAccount',attributes,{'tableName':_0x73a8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c37=['path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5cf52f,_0x2304cc){var _0x5b4b76=function(_0x3c408b){while(--_0x3c408b){_0x5cf52f['push'](_0x5cf52f['shift']());}};_0x5b4b76(++_0x2304cc);}(_0x2c37,0x152));var _0x72c3=function(_0x4b8a11,_0x4af4c6){_0x4b8a11=_0x4b8a11-0x0;var _0x3554e3=_0x2c37[_0x4b8a11];return _0x3554e3;};'use strict';var _=require(_0x72c3('0x0'));var util=require(_0x72c3('0x1'));var logger=require(_0x72c3('0x2'))(_0x72c3('0x3'));var moment=require(_0x72c3('0x4'));var BPromise=require(_0x72c3('0x5'));var rp=require(_0x72c3('0x6'));var fs=require('fs');var path=require(_0x72c3('0x7'));var rimraf=require(_0x72c3('0x8'));var config=require(_0x72c3('0x9'));var attributes=require(_0x72c3('0xa'));var integrations=require('../../components/integrations/configuration');module[_0x72c3('0xb')]=function(_0x2fa40f,_0x35ac12){return _0x2fa40f[_0x72c3('0xc')](_0x72c3('0xd'),attributes,{'tableName':_0x72c3('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 303c8e6..715b961 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 _0xb070=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetDeskAccount','findAll','options','attributes','include','map','model','catch','ShowDeskAccount','DeskAccount','find','raw','util','moment','bluebird'];(function(_0x547a04,_0x4f4d69){var _0x2f48a4=function(_0x5e4120){while(--_0x5e4120){_0x547a04['push'](_0x547a04['shift']());}};_0x2f48a4(++_0x4f4d69);}(_0xb070,0x17e));var _0x0b07=function(_0x385f88,_0x2402a6){_0x385f88=_0x385f88-0x0;var _0x56792f=_0xb070[_0x385f88];return _0x56792f;};'use strict';var _=require('lodash');var util=require(_0x0b07('0x0'));var moment=require(_0x0b07('0x1'));var BPromise=require(_0x0b07('0x2'));var rs=require(_0x0b07('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0b07('0x4'));var logger=require(_0x0b07('0x5'))(_0x0b07('0x6'));var config=require(_0x0b07('0x7'));var jayson=require(_0x0b07('0x8'));var client=jayson[_0x0b07('0x9')][_0x0b07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2416df,_0x9f33d5,_0x572fd5){return new BPromise(function(_0x361fa4,_0x7bd04a){return client[_0x0b07('0xb')](_0x2416df,_0x572fd5)[_0x0b07('0xc')](function(_0x252153){logger['info'](_0x0b07('0xd'),_0x9f33d5,_0x0b07('0xe'));logger[_0x0b07('0xf')](_0x0b07('0x10'),_0x9f33d5,_0x0b07('0xe'),JSON[_0x0b07('0x11')](_0x252153));if(_0x252153[_0x0b07('0x12')]){if(_0x252153[_0x0b07('0x12')][_0x0b07('0x13')]===0x1f4){logger[_0x0b07('0x12')](_0x0b07('0xd'),_0x9f33d5,_0x252153[_0x0b07('0x12')][_0x0b07('0x14')]);return _0x7bd04a(_0x252153[_0x0b07('0x12')][_0x0b07('0x14')]);}logger['error'](_0x0b07('0xd'),_0x9f33d5,_0x252153[_0x0b07('0x12')][_0x0b07('0x14')]);return _0x361fa4(_0x252153[_0x0b07('0x12')]['message']);}else{logger[_0x0b07('0x15')](_0x0b07('0xd'),_0x9f33d5,'request\x20sent');_0x361fa4(_0x252153[_0x0b07('0x16')][_0x0b07('0x14')]);}})['catch'](function(_0x762296){logger[_0x0b07('0x12')](_0x0b07('0xd'),_0x9f33d5,_0x762296);_0x7bd04a(_0x762296);});});}exports[_0x0b07('0x17')]=function(_0x590818){var _0x1d620a=this;return new Promise(function(_0x378b32,_0x18ca34){return db['DeskAccount'][_0x0b07('0x18')]({'raw':_0x590818[_0x0b07('0x19')]?_0x590818[_0x0b07('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x590818[_0x0b07('0x19')]?_0x590818[_0x0b07('0x19')]['where']||null:null,'attributes':_0x590818['options']?_0x590818[_0x0b07('0x19')][_0x0b07('0x1a')]||null:null,'limit':_0x590818[_0x0b07('0x19')]?_0x590818[_0x0b07('0x19')]['limit']||null:null,'include':_0x590818['options']?_0x590818[_0x0b07('0x19')][_0x0b07('0x1b')]?_[_0x0b07('0x1c')](_0x590818[_0x0b07('0x19')][_0x0b07('0x1b')],function(_0x5135cb){return{'model':db[_0x5135cb[_0x0b07('0x1d')]],'as':_0x5135cb['as'],'attributes':_0x5135cb[_0x0b07('0x1a')],'include':_0x5135cb[_0x0b07('0x1b')]?_[_0x0b07('0x1c')](_0x5135cb[_0x0b07('0x1b')],function(_0x1facf0){return{'model':db[_0x1facf0[_0x0b07('0x1d')]],'as':_0x1facf0['as'],'attributes':_0x1facf0[_0x0b07('0x1a')],'include':_0x1facf0[_0x0b07('0x1b')]?_[_0x0b07('0x1c')](_0x1facf0[_0x0b07('0x1b')],function(_0x265496){return{'model':db[_0x265496['model']],'as':_0x265496['as'],'attributes':_0x265496[_0x0b07('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0b07('0xc')](function(_0x38cfaa){logger[_0x0b07('0x15')](_0x0b07('0x17'),_0x590818);logger[_0x0b07('0xf')](_0x0b07('0x17'),_0x590818,JSON['stringify'](_0x38cfaa));_0x378b32(_0x38cfaa);})[_0x0b07('0x1e')](function(_0x4fee65){logger['error'](_0x0b07('0x17'),_0x4fee65[_0x0b07('0x14')],_0x590818);_0x18ca34(_0x1d620a['error'](0x1f4,_0x4fee65[_0x0b07('0x14')]));});});};exports[_0x0b07('0x1f')]=function(_0x2e3cf7){var _0x9dca8b=this;return new Promise(function(_0x3acb5e,_0x38fc8c){return db[_0x0b07('0x20')][_0x0b07('0x21')]({'raw':_0x2e3cf7['options']?_0x2e3cf7[_0x0b07('0x19')][_0x0b07('0x22')]===undefined?!![]:![]:!![],'where':_0x2e3cf7[_0x0b07('0x19')]?_0x2e3cf7[_0x0b07('0x19')]['where']||null:null,'attributes':_0x2e3cf7[_0x0b07('0x19')]?_0x2e3cf7[_0x0b07('0x19')][_0x0b07('0x1a')]||null:null,'include':_0x2e3cf7['options']?_0x2e3cf7[_0x0b07('0x19')]['include']?_[_0x0b07('0x1c')](_0x2e3cf7['options'][_0x0b07('0x1b')],function(_0x3f25b7){return{'model':db[_0x3f25b7[_0x0b07('0x1d')]],'as':_0x3f25b7['as'],'attributes':_0x3f25b7['attributes'],'include':_0x3f25b7[_0x0b07('0x1b')]?_[_0x0b07('0x1c')](_0x3f25b7[_0x0b07('0x1b')],function(_0x577c50){return{'model':db[_0x577c50['model']],'as':_0x577c50['as'],'attributes':_0x577c50['attributes'],'include':_0x577c50[_0x0b07('0x1b')]?_[_0x0b07('0x1c')](_0x577c50[_0x0b07('0x1b')],function(_0x67669d){return{'model':db[_0x67669d[_0x0b07('0x1d')]],'as':_0x67669d['as'],'attributes':_0x67669d[_0x0b07('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0b07('0xc')](function(_0x4d9635){logger['info']('ShowDeskAccount',_0x2e3cf7);logger[_0x0b07('0xf')](_0x0b07('0x1f'),_0x2e3cf7,JSON[_0x0b07('0x11')](_0x4d9635));_0x3acb5e(_0x4d9635);})['catch'](function(_0x1a8e15){logger[_0x0b07('0x12')](_0x0b07('0x1f'),_0x1a8e15[_0x0b07('0x14')],_0x2e3cf7);_0x38fc8c(_0x9dca8b[_0x0b07('0x12')](0x1f4,_0x1a8e15[_0x0b07('0x14')]));});});}; \ No newline at end of file +var _0xa2b8=['debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','options','where','include','map','model','attributes','DeskAccount','raw','ShowDeskAccount','util','ioredis','../../config/logger','rpc','client','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x2001cf,_0x1594c1){var _0x1718a4=function(_0x5175cb){while(--_0x5175cb){_0x2001cf['push'](_0x2001cf['shift']());}};_0x1718a4(++_0x1594c1);}(_0xa2b8,0xb4));var _0x8a2b=function(_0x5ea6c2,_0x137660){_0x5ea6c2=_0x5ea6c2-0x0;var _0x30a7b1=_0xa2b8[_0x5ea6c2];return _0x30a7b1;};'use strict';var _=require('lodash');var util=require(_0x8a2b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a2b('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8a2b('0x2'))(_0x8a2b('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a2b('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b52b6,_0x32bafb,_0x5e5170){return new BPromise(function(_0x1094b3,_0x15f9ed){return client['request'](_0x4b52b6,_0x5e5170)[_0x8a2b('0x5')](function(_0x282722){logger[_0x8a2b('0x6')](_0x8a2b('0x7'),_0x32bafb,_0x8a2b('0x8'));logger[_0x8a2b('0x9')](_0x8a2b('0xa'),_0x32bafb,_0x8a2b('0x8'),JSON[_0x8a2b('0xb')](_0x282722));if(_0x282722[_0x8a2b('0xc')]){if(_0x282722[_0x8a2b('0xc')][_0x8a2b('0xd')]===0x1f4){logger['error'](_0x8a2b('0x7'),_0x32bafb,_0x282722['error'][_0x8a2b('0xe')]);return _0x15f9ed(_0x282722['error'][_0x8a2b('0xe')]);}logger[_0x8a2b('0xc')](_0x8a2b('0x7'),_0x32bafb,_0x282722['error'][_0x8a2b('0xe')]);return _0x1094b3(_0x282722[_0x8a2b('0xc')][_0x8a2b('0xe')]);}else{logger[_0x8a2b('0x6')](_0x8a2b('0x7'),_0x32bafb,'request\x20sent');_0x1094b3(_0x282722[_0x8a2b('0xf')][_0x8a2b('0xe')]);}})[_0x8a2b('0x10')](function(_0x454e2e){logger[_0x8a2b('0xc')](_0x8a2b('0x7'),_0x32bafb,_0x454e2e);_0x15f9ed(_0x454e2e);});});}exports[_0x8a2b('0x11')]=function(_0x2712d1){var _0x33dcec=this;return new Promise(function(_0x210cbe,_0xd03303){return db['DeskAccount']['findAll']({'raw':_0x2712d1['options']?_0x2712d1[_0x8a2b('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x2712d1['options']?_0x2712d1[_0x8a2b('0x12')][_0x8a2b('0x13')]||null:null,'attributes':_0x2712d1['options']?_0x2712d1['options']['attributes']||null:null,'limit':_0x2712d1[_0x8a2b('0x12')]?_0x2712d1[_0x8a2b('0x12')]['limit']||null:null,'include':_0x2712d1[_0x8a2b('0x12')]?_0x2712d1[_0x8a2b('0x12')][_0x8a2b('0x14')]?_[_0x8a2b('0x15')](_0x2712d1[_0x8a2b('0x12')][_0x8a2b('0x14')],function(_0x49ae41){return{'model':db[_0x49ae41[_0x8a2b('0x16')]],'as':_0x49ae41['as'],'attributes':_0x49ae41['attributes'],'include':_0x49ae41[_0x8a2b('0x14')]?_[_0x8a2b('0x15')](_0x49ae41[_0x8a2b('0x14')],function(_0x433a61){return{'model':db[_0x433a61[_0x8a2b('0x16')]],'as':_0x433a61['as'],'attributes':_0x433a61[_0x8a2b('0x17')],'include':_0x433a61[_0x8a2b('0x14')]?_[_0x8a2b('0x15')](_0x433a61[_0x8a2b('0x14')],function(_0x5d374c){return{'model':db[_0x5d374c[_0x8a2b('0x16')]],'as':_0x5d374c['as'],'attributes':_0x5d374c[_0x8a2b('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3134e2){logger['info'](_0x8a2b('0x11'),_0x2712d1);logger['debug'](_0x8a2b('0x11'),_0x2712d1,JSON[_0x8a2b('0xb')](_0x3134e2));_0x210cbe(_0x3134e2);})[_0x8a2b('0x10')](function(_0x11c652){logger['error']('GetDeskAccount',_0x11c652[_0x8a2b('0xe')],_0x2712d1);_0xd03303(_0x33dcec['error'](0x1f4,_0x11c652[_0x8a2b('0xe')]));});});};exports['ShowDeskAccount']=function(_0x3b7263){var _0x3b4c33=this;return new Promise(function(_0x156724,_0x164bb7){return db[_0x8a2b('0x18')]['find']({'raw':_0x3b7263[_0x8a2b('0x12')]?_0x3b7263[_0x8a2b('0x12')][_0x8a2b('0x19')]===undefined?!![]:![]:!![],'where':_0x3b7263['options']?_0x3b7263['options'][_0x8a2b('0x13')]||null:null,'attributes':_0x3b7263[_0x8a2b('0x12')]?_0x3b7263['options'][_0x8a2b('0x17')]||null:null,'include':_0x3b7263[_0x8a2b('0x12')]?_0x3b7263[_0x8a2b('0x12')][_0x8a2b('0x14')]?_[_0x8a2b('0x15')](_0x3b7263['options'][_0x8a2b('0x14')],function(_0x1eda46){return{'model':db[_0x1eda46[_0x8a2b('0x16')]],'as':_0x1eda46['as'],'attributes':_0x1eda46['attributes'],'include':_0x1eda46[_0x8a2b('0x14')]?_[_0x8a2b('0x15')](_0x1eda46[_0x8a2b('0x14')],function(_0x303fe1){return{'model':db[_0x303fe1[_0x8a2b('0x16')]],'as':_0x303fe1['as'],'attributes':_0x303fe1[_0x8a2b('0x17')],'include':_0x303fe1['include']?_[_0x8a2b('0x15')](_0x303fe1[_0x8a2b('0x14')],function(_0x393b32){return{'model':db[_0x393b32[_0x8a2b('0x16')]],'as':_0x393b32['as'],'attributes':_0x393b32['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a2b('0x5')](function(_0x4458fb){logger['info'](_0x8a2b('0x1a'),_0x3b7263);logger['debug'](_0x8a2b('0x1a'),_0x3b7263,JSON['stringify'](_0x4458fb));_0x156724(_0x4458fb);})[_0x8a2b('0x10')](function(_0x2a0834){logger[_0x8a2b('0xc')](_0x8a2b('0x1a'),_0x2a0834['message'],_0x3b7263);_0x164bb7(_0x3b4c33[_0x8a2b('0xc')](0x1f4,_0x2a0834[_0x8a2b('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 279c00b..461af30 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x21babb,_0x1cb338){var _0x2be65d=function(_0x3da71a){while(--_0x3da71a){_0x21babb['push'](_0x21babb['shift']());}};_0x2be65d(++_0x1cb338);}(_0x008c,0x188));var _0xc008=function(_0x1eb585,_0x202476){_0x1eb585=_0x1eb585-0x0;var _0x497ee2=_0x008c[_0x1eb585];return _0x497ee2;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4e39d1,_0x37617b){var _0x2a68f0=function(_0x4ec2e3){while(--_0x4ec2e3){_0x4e39d1['push'](_0x4e39d1['shift']());}};_0x2a68f0(++_0x37617b);}(_0x008c,0x188));var _0xc008=function(_0x769935,_0x2311a5){_0x769935=_0x769935-0x0;var _0x24f62e=_0x008c[_0x769935];return _0x24f62e;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index c778814..7f03914 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 _0xbf2e=['STRING','sequelize','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xbf2e,0xd9));var _0xebf2=function(_0x584dd3,_0x538067){_0x584dd3=_0x584dd3-0x0;var _0x545442=_0xbf2e[_0x584dd3];return _0x545442;};'use strict';var Sequelize=require(_0xebf2('0x0'));module[_0xebf2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xebf2('0x2')]}}; \ No newline at end of file +var _0x6dfd=['sequelize','STRING'];(function(_0x5179a5,_0x419746){var _0x15c8ce=function(_0x1b13c4){while(--_0x1b13c4){_0x5179a5['push'](_0x5179a5['shift']());}};_0x15c8ce(++_0x419746);}(_0x6dfd,0x180));var _0xd6df=function(_0x2946b5,_0x131d9c){_0x2946b5=_0x2946b5-0x0;var _0x4b2e6d=_0x6dfd[_0x2946b5];return _0x4b2e6d;};'use strict';var Sequelize=require(_0xd6df('0x0'));module['exports']={'name':{'type':Sequelize[_0xd6df('0x1')]},'description':{'type':Sequelize[_0xd6df('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 89371c6..11fc403 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 _0xc1b9=['save','update','then','end','stack','name','index','DeskConfiguration','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','map','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','create','body','find','destroy','getFields','DeskField','sort','options','getSubjects','getDescriptions','findOne','Tag','getTags','setTags','ids','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1b9,0xdf));var _0x9c1b=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0xc1b9[_0xb875ee];return _0x4c7f3a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9c1b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c1b('0x1'));var moment=require(_0x9c1b('0x2'));var BPromise=require(_0x9c1b('0x3'));var Mustache=require(_0x9c1b('0x4'));var util=require(_0x9c1b('0x5'));var path=require(_0x9c1b('0x6'));var sox=require('sox');var csv=require(_0x9c1b('0x7'));var ejs=require(_0x9c1b('0x8'));var fs=require('fs');var fs_extra=require(_0x9c1b('0x9'));var _=require('lodash');var squel=require(_0x9c1b('0xa'));var crypto=require(_0x9c1b('0xb'));var jsforce=require(_0x9c1b('0xc'));var deskjs=require(_0x9c1b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9c1b('0xe'));var Papa=require(_0x9c1b('0xf'));var Redis=require(_0x9c1b('0x10'));var authService=require(_0x9c1b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9c1b('0x12'));var hardwareService=require(_0x9c1b('0x13'));var logger=require(_0x9c1b('0x14'))(_0x9c1b('0x15'));var utils=require(_0x9c1b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9c1b('0x17'))['db'];function respondWithStatusCode(_0x12a8dc,_0x1e61ce){_0x1e61ce=_0x1e61ce||0xcc;return function(_0x5aadf2){if(_0x5aadf2){return _0x12a8dc[_0x9c1b('0x18')](_0x1e61ce);}return _0x12a8dc[_0x9c1b('0x19')](_0x1e61ce)['end']();};}function respondWithResult(_0x3d2b25,_0x14d75c){_0x14d75c=_0x14d75c||0xc8;return function(_0x5f1b9b){if(_0x5f1b9b){return _0x3d2b25[_0x9c1b('0x19')](_0x14d75c)['json'](_0x5f1b9b);}};}function respondWithFilteredResult(_0x5d33bd,_0x92a390){return function(_0x441b3b){if(_0x441b3b){var _0x34afb9=typeof _0x92a390['offset']===_0x9c1b('0x1a')&&typeof _0x92a390[_0x9c1b('0x1b')]==='undefined';var _0x40fec2=_0x441b3b[_0x9c1b('0x1c')];var _0x2fbf16=_0x34afb9?0x0:_0x92a390[_0x9c1b('0x1d')];var _0x304288=_0x34afb9?_0x441b3b[_0x9c1b('0x1c')]:_0x92a390[_0x9c1b('0x1d')]+_0x92a390[_0x9c1b('0x1b')];var _0x3e0859;if(_0x304288>=_0x40fec2){_0x304288=_0x40fec2;_0x3e0859=0xc8;}else{_0x3e0859=0xce;}_0x5d33bd[_0x9c1b('0x19')](_0x3e0859);return _0x5d33bd[_0x9c1b('0x1e')](_0x9c1b('0x1f'),_0x2fbf16+'-'+_0x304288+'/'+_0x40fec2)[_0x9c1b('0x20')](_0x441b3b);}return null;};}function patchUpdates(_0x36545e){return function(_0x302924){try{jsonpatch[_0x9c1b('0x21')](_0x302924,_0x36545e,!![]);}catch(_0x37174c){return BPromise[_0x9c1b('0x22')](_0x37174c);}return _0x302924[_0x9c1b('0x23')]();};}function saveUpdates(_0x213a10,_0x1ad3df){return function(_0x4ed05f){if(_0x4ed05f){return _0x4ed05f[_0x9c1b('0x24')](_0x213a10)['then'](function(_0x3a3f4a){return _0x3a3f4a;});}return null;};}function removeEntity(_0x1dee58,_0x506c0d){return function(_0x4ae489){if(_0x4ae489){return _0x4ae489['destroy']()[_0x9c1b('0x25')](function(){_0x1dee58[_0x9c1b('0x19')](0xcc)[_0x9c1b('0x26')]();});}};}function handleEntityNotFound(_0x47fc93,_0x4fe172){return function(_0x162d6c){if(!_0x162d6c){_0x47fc93[_0x9c1b('0x18')](0x194);}return _0x162d6c;};}function handleError(_0x20759c,_0x200064){_0x200064=_0x200064||0x1f4;return function(_0x142b69){logger['error'](_0x142b69[_0x9c1b('0x27')]);if(_0x142b69['name']){delete _0x142b69[_0x9c1b('0x28')];}_0x20759c['status'](_0x200064)['send'](_0x142b69);};}exports[_0x9c1b('0x29')]=function(_0x386d74,_0x308aa4){var _0x452574={},_0x1b28e2={},_0x200974={'count':0x0,'rows':[]};var _0x2df830=_['map'](db[_0x9c1b('0x2a')]['rawAttributes'],function(_0x1d1628){return{'name':_0x1d1628[_0x9c1b('0x2b')],'type':_0x1d1628['type'][_0x9c1b('0x2c')]};});_0x1b28e2[_0x9c1b('0x2d')]=_['map'](_0x2df830,_0x9c1b('0x28'));_0x1b28e2[_0x9c1b('0x2e')]=_['keys'](_0x386d74['query']);_0x1b28e2[_0x9c1b('0x2f')]=_[_0x9c1b('0x30')](_0x1b28e2[_0x9c1b('0x2d')],_0x1b28e2[_0x9c1b('0x2e')]);_0x452574[_0x9c1b('0x31')]=_[_0x9c1b('0x30')](_0x1b28e2[_0x9c1b('0x2d')],qs['fields'](_0x386d74[_0x9c1b('0x2e')][_0x9c1b('0x32')]));_0x452574[_0x9c1b('0x31')]=_0x452574[_0x9c1b('0x31')][_0x9c1b('0x33')]?_0x452574[_0x9c1b('0x31')]:_0x1b28e2[_0x9c1b('0x2d')];if(!_0x386d74[_0x9c1b('0x2e')][_0x9c1b('0x34')](_0x9c1b('0x35'))){_0x452574[_0x9c1b('0x1b')]=qs['limit'](_0x386d74[_0x9c1b('0x2e')][_0x9c1b('0x1b')]);_0x452574['offset']=qs[_0x9c1b('0x1d')](_0x386d74[_0x9c1b('0x2e')][_0x9c1b('0x1d')]);}_0x452574[_0x9c1b('0x36')]=qs['sort'](_0x386d74[_0x9c1b('0x2e')]['sort']);_0x452574['where']=qs[_0x9c1b('0x2f')](_[_0x9c1b('0x37')](_0x386d74[_0x9c1b('0x2e')],_0x1b28e2[_0x9c1b('0x2f')]),_0x2df830);if(_0x386d74[_0x9c1b('0x2e')][_0x9c1b('0x38')]){_0x452574[_0x9c1b('0x39')]=_[_0x9c1b('0x3a')](_0x452574[_0x9c1b('0x39')],{'$or':_[_0x9c1b('0x3b')](_0x2df830,function(_0x19853f){if(_0x19853f[_0x9c1b('0x3c')]!==_0x9c1b('0x3d')){var _0x21a5e7={};_0x21a5e7[_0x19853f[_0x9c1b('0x28')]]={'$like':'%'+_0x386d74[_0x9c1b('0x2e')][_0x9c1b('0x38')]+'%'};return _0x21a5e7;}})});}_0x452574=_[_0x9c1b('0x3a')]({},_0x452574,_0x386d74['options']);var _0x1cee32={'where':_0x452574[_0x9c1b('0x39')]};return db[_0x9c1b('0x2a')]['count'](_0x1cee32)[_0x9c1b('0x25')](function(_0x115124){_0x200974[_0x9c1b('0x1c')]=_0x115124;if(_0x386d74[_0x9c1b('0x2e')][_0x9c1b('0x3e')]){_0x452574[_0x9c1b('0x3f')]=[{'all':!![]}];}return db[_0x9c1b('0x2a')][_0x9c1b('0x40')](_0x452574);})[_0x9c1b('0x25')](function(_0x2eca45){_0x200974[_0x9c1b('0x41')]=_0x2eca45;return _0x200974;})[_0x9c1b('0x25')](respondWithFilteredResult(_0x308aa4,_0x452574))[_0x9c1b('0x42')](handleError(_0x308aa4,null));};exports[_0x9c1b('0x43')]=function(_0x4ce7f9,_0x1f8522){var _0x1f96c3={'raw':![],'where':{'id':_0x4ce7f9[_0x9c1b('0x44')]['id']}},_0x5f228c={};_0x5f228c[_0x9c1b('0x2d')]=_['keys'](db[_0x9c1b('0x2a')][_0x9c1b('0x45')]);_0x5f228c[_0x9c1b('0x2e')]=_[_0x9c1b('0x46')](_0x4ce7f9[_0x9c1b('0x2e')]);_0x5f228c[_0x9c1b('0x2f')]=_[_0x9c1b('0x30')](_0x5f228c['model'],_0x5f228c[_0x9c1b('0x2e')]);_0x1f96c3[_0x9c1b('0x31')]=_['intersection'](_0x5f228c[_0x9c1b('0x2d')],qs[_0x9c1b('0x32')](_0x4ce7f9[_0x9c1b('0x2e')][_0x9c1b('0x32')]));_0x1f96c3[_0x9c1b('0x31')]=_0x1f96c3['attributes'][_0x9c1b('0x33')]?_0x1f96c3[_0x9c1b('0x31')]:_0x5f228c['model'];if(_0x4ce7f9[_0x9c1b('0x2e')][_0x9c1b('0x3e')]){_0x1f96c3['include']=[{'all':!![]}];}_0x1f96c3=_[_0x9c1b('0x3a')]({},_0x1f96c3,_0x4ce7f9['options']);return db[_0x9c1b('0x2a')]['find'](_0x1f96c3)['then'](handleEntityNotFound(_0x1f8522,null))[_0x9c1b('0x25')](respondWithResult(_0x1f8522,null))[_0x9c1b('0x42')](handleError(_0x1f8522,null));};exports[_0x9c1b('0x47')]=function(_0x4e74ff,_0x59d9c0){return db[_0x9c1b('0x2a')][_0x9c1b('0x47')](_0x4e74ff[_0x9c1b('0x48')],{})[_0x9c1b('0x25')](respondWithResult(_0x59d9c0,0xc9))[_0x9c1b('0x42')](handleError(_0x59d9c0,null));};exports[_0x9c1b('0x24')]=function(_0x3b471f,_0xae4cd3){if(_0x3b471f[_0x9c1b('0x48')]['id']){delete _0x3b471f['body']['id'];}return db[_0x9c1b('0x2a')][_0x9c1b('0x49')]({'where':{'id':_0x3b471f[_0x9c1b('0x44')]['id']}})[_0x9c1b('0x25')](handleEntityNotFound(_0xae4cd3,null))['then'](saveUpdates(_0x3b471f[_0x9c1b('0x48')],null))[_0x9c1b('0x25')](respondWithResult(_0xae4cd3,null))[_0x9c1b('0x42')](handleError(_0xae4cd3,null));};exports[_0x9c1b('0x4a')]=function(_0x452794,_0x54624b){return db['DeskConfiguration']['find']({'where':{'id':_0x452794[_0x9c1b('0x44')]['id']}})[_0x9c1b('0x25')](handleEntityNotFound(_0x54624b,null))[_0x9c1b('0x25')](removeEntity(_0x54624b,null))[_0x9c1b('0x42')](handleError(_0x54624b,null));};exports[_0x9c1b('0x4b')]=function(_0x297632,_0x201ff8,_0x309e68){var _0x5327a3={};var _0x81dac0={};var _0x4b8b1e;var _0x1319fa;return db[_0x9c1b('0x2a')]['findOne']({'where':{'id':_0x297632[_0x9c1b('0x44')]['id']}})['then'](handleEntityNotFound(_0x201ff8,null))[_0x9c1b('0x25')](function(_0x236a15){if(_0x236a15){_0x4b8b1e=_0x236a15;_0x81dac0[_0x9c1b('0x2d')]=_[_0x9c1b('0x46')](db[_0x9c1b('0x4c')][_0x9c1b('0x45')]);_0x81dac0[_0x9c1b('0x2e')]=_[_0x9c1b('0x46')](_0x297632[_0x9c1b('0x2e')]);_0x81dac0['filters']=_[_0x9c1b('0x30')](_0x81dac0[_0x9c1b('0x2d')],_0x81dac0[_0x9c1b('0x2e')]);_0x5327a3[_0x9c1b('0x31')]=_[_0x9c1b('0x30')](_0x81dac0['model'],qs['fields'](_0x297632[_0x9c1b('0x2e')][_0x9c1b('0x32')]));_0x5327a3[_0x9c1b('0x31')]=_0x5327a3[_0x9c1b('0x31')][_0x9c1b('0x33')]?_0x5327a3[_0x9c1b('0x31')]:_0x81dac0[_0x9c1b('0x2d')];_0x5327a3[_0x9c1b('0x36')]=qs[_0x9c1b('0x4d')](_0x297632['query'][_0x9c1b('0x4d')]);_0x5327a3[_0x9c1b('0x39')]=qs['filters'](_[_0x9c1b('0x37')](_0x297632[_0x9c1b('0x2e')],_0x81dac0[_0x9c1b('0x2f')]));if(_0x297632['query']['filter']){_0x5327a3[_0x9c1b('0x39')]=_[_0x9c1b('0x3a')](_0x5327a3[_0x9c1b('0x39')],{'$or':_[_0x9c1b('0x3b')](_0x5327a3[_0x9c1b('0x31')],function(_0x1a56b6){var _0x358c46={};_0x358c46[_0x1a56b6]={'$like':'%'+_0x297632[_0x9c1b('0x2e')]['filter']+'%'};return _0x358c46;})});}_0x5327a3=_['merge']({},_0x5327a3,_0x297632['options']);return _0x4b8b1e[_0x9c1b('0x4b')](_0x5327a3);}})[_0x9c1b('0x25')](function(_0x23386f){if(_0x23386f){_0x1319fa=_0x23386f[_0x9c1b('0x33')];if(!_0x297632[_0x9c1b('0x2e')][_0x9c1b('0x34')](_0x9c1b('0x35'))){_0x5327a3['limit']=qs['limit'](_0x297632['query']['limit']);_0x5327a3[_0x9c1b('0x1d')]=qs[_0x9c1b('0x1d')](_0x297632['query'][_0x9c1b('0x1d')]);}return _0x4b8b1e['getFields'](_0x5327a3);}})[_0x9c1b('0x25')](function(_0x29bf15){if(_0x29bf15){return _0x29bf15?{'count':_0x1319fa,'rows':_0x29bf15}:null;}})[_0x9c1b('0x25')](respondWithResult(_0x201ff8,null))['catch'](handleError(_0x201ff8,null));};exports['getSubjects']=function(_0x3232dd,_0x2aac22,_0x4ef3ea){var _0x5681ce={};var _0x1c690a={};var _0x389574;var _0x46541f;return db[_0x9c1b('0x2a')]['findOne']({'where':{'id':_0x3232dd[_0x9c1b('0x44')]['id']}})['then'](handleEntityNotFound(_0x2aac22,null))[_0x9c1b('0x25')](function(_0x59fa62){if(_0x59fa62){_0x389574=_0x59fa62;_0x1c690a[_0x9c1b('0x2d')]=_[_0x9c1b('0x46')](db['DeskField']['rawAttributes']);_0x1c690a[_0x9c1b('0x2e')]=_[_0x9c1b('0x46')](_0x3232dd[_0x9c1b('0x2e')]);_0x1c690a['filters']=_[_0x9c1b('0x30')](_0x1c690a[_0x9c1b('0x2d')],_0x1c690a[_0x9c1b('0x2e')]);_0x5681ce['attributes']=_[_0x9c1b('0x30')](_0x1c690a[_0x9c1b('0x2d')],qs[_0x9c1b('0x32')](_0x3232dd['query'][_0x9c1b('0x32')]));_0x5681ce[_0x9c1b('0x31')]=_0x5681ce[_0x9c1b('0x31')][_0x9c1b('0x33')]?_0x5681ce[_0x9c1b('0x31')]:_0x1c690a[_0x9c1b('0x2d')];_0x5681ce['order']=qs[_0x9c1b('0x4d')](_0x3232dd[_0x9c1b('0x2e')][_0x9c1b('0x4d')]);_0x5681ce[_0x9c1b('0x39')]=qs['filters'](_[_0x9c1b('0x37')](_0x3232dd[_0x9c1b('0x2e')],_0x1c690a[_0x9c1b('0x2f')]));if(_0x3232dd[_0x9c1b('0x2e')][_0x9c1b('0x38')]){_0x5681ce[_0x9c1b('0x39')]=_[_0x9c1b('0x3a')](_0x5681ce[_0x9c1b('0x39')],{'$or':_[_0x9c1b('0x3b')](_0x5681ce['attributes'],function(_0x46377b){var _0x10ce78={};_0x10ce78[_0x46377b]={'$like':'%'+_0x3232dd[_0x9c1b('0x2e')]['filter']+'%'};return _0x10ce78;})});}_0x5681ce=_['merge']({},_0x5681ce,_0x3232dd[_0x9c1b('0x4e')]);return _0x389574[_0x9c1b('0x4f')](_0x5681ce);}})[_0x9c1b('0x25')](function(_0x5367c8){if(_0x5367c8){_0x46541f=_0x5367c8[_0x9c1b('0x33')];if(!_0x3232dd[_0x9c1b('0x2e')]['hasOwnProperty'](_0x9c1b('0x35'))){_0x5681ce[_0x9c1b('0x1b')]=qs['limit'](_0x3232dd[_0x9c1b('0x2e')][_0x9c1b('0x1b')]);_0x5681ce[_0x9c1b('0x1d')]=qs[_0x9c1b('0x1d')](_0x3232dd[_0x9c1b('0x2e')][_0x9c1b('0x1d')]);}return _0x389574[_0x9c1b('0x4f')](_0x5681ce);}})[_0x9c1b('0x25')](function(_0x56e100){if(_0x56e100){return _0x56e100?{'count':_0x46541f,'rows':_0x56e100}:null;}})['then'](respondWithResult(_0x2aac22,null))[_0x9c1b('0x42')](handleError(_0x2aac22,null));};exports[_0x9c1b('0x50')]=function(_0x4f17c7,_0x345725,_0xfc991e){var _0x426efd={};var _0x189016={};var _0x276903;var _0x30bf42;return db[_0x9c1b('0x2a')][_0x9c1b('0x51')]({'where':{'id':_0x4f17c7[_0x9c1b('0x44')]['id']}})[_0x9c1b('0x25')](handleEntityNotFound(_0x345725,null))[_0x9c1b('0x25')](function(_0x14b7cf){if(_0x14b7cf){_0x276903=_0x14b7cf;_0x189016['model']=_[_0x9c1b('0x46')](db[_0x9c1b('0x4c')]['rawAttributes']);_0x189016[_0x9c1b('0x2e')]=_['keys'](_0x4f17c7['query']);_0x189016[_0x9c1b('0x2f')]=_[_0x9c1b('0x30')](_0x189016[_0x9c1b('0x2d')],_0x189016['query']);_0x426efd[_0x9c1b('0x31')]=_['intersection'](_0x189016[_0x9c1b('0x2d')],qs[_0x9c1b('0x32')](_0x4f17c7[_0x9c1b('0x2e')][_0x9c1b('0x32')]));_0x426efd[_0x9c1b('0x31')]=_0x426efd[_0x9c1b('0x31')][_0x9c1b('0x33')]?_0x426efd[_0x9c1b('0x31')]:_0x189016[_0x9c1b('0x2d')];_0x426efd[_0x9c1b('0x36')]=qs[_0x9c1b('0x4d')](_0x4f17c7[_0x9c1b('0x2e')][_0x9c1b('0x4d')]);_0x426efd[_0x9c1b('0x39')]=qs['filters'](_[_0x9c1b('0x37')](_0x4f17c7[_0x9c1b('0x2e')],_0x189016[_0x9c1b('0x2f')]));if(_0x4f17c7[_0x9c1b('0x2e')][_0x9c1b('0x38')]){_0x426efd['where']=_['merge'](_0x426efd[_0x9c1b('0x39')],{'$or':_[_0x9c1b('0x3b')](_0x426efd['attributes'],function(_0x3a0ab4){var _0x2c4cac={};_0x2c4cac[_0x3a0ab4]={'$like':'%'+_0x4f17c7['query'][_0x9c1b('0x38')]+'%'};return _0x2c4cac;})});}_0x426efd=_[_0x9c1b('0x3a')]({},_0x426efd,_0x4f17c7[_0x9c1b('0x4e')]);return _0x276903[_0x9c1b('0x50')](_0x426efd);}})[_0x9c1b('0x25')](function(_0x52537b){if(_0x52537b){_0x30bf42=_0x52537b[_0x9c1b('0x33')];if(!_0x4f17c7[_0x9c1b('0x2e')][_0x9c1b('0x34')](_0x9c1b('0x35'))){_0x426efd['limit']=qs[_0x9c1b('0x1b')](_0x4f17c7[_0x9c1b('0x2e')][_0x9c1b('0x1b')]);_0x426efd['offset']=qs[_0x9c1b('0x1d')](_0x4f17c7[_0x9c1b('0x2e')][_0x9c1b('0x1d')]);}return _0x276903[_0x9c1b('0x50')](_0x426efd);}})[_0x9c1b('0x25')](function(_0x3df736){if(_0x3df736){return _0x3df736?{'count':_0x30bf42,'rows':_0x3df736}:null;}})[_0x9c1b('0x25')](respondWithResult(_0x345725,null))[_0x9c1b('0x42')](handleError(_0x345725,null));};exports['getTags']=function(_0x3f2eac,_0x394efd,_0x35c3e7){var _0x196977={};var _0x4cd175={};var _0x3797f8;var _0x137e47;return db[_0x9c1b('0x2a')][_0x9c1b('0x51')]({'where':{'id':_0x3f2eac[_0x9c1b('0x44')]['id']}})[_0x9c1b('0x25')](handleEntityNotFound(_0x394efd,null))[_0x9c1b('0x25')](function(_0x1f1316){if(_0x1f1316){_0x3797f8=_0x1f1316;_0x4cd175[_0x9c1b('0x2d')]=_[_0x9c1b('0x46')](db[_0x9c1b('0x52')][_0x9c1b('0x45')]);_0x4cd175[_0x9c1b('0x2e')]=_[_0x9c1b('0x46')](_0x3f2eac[_0x9c1b('0x2e')]);_0x4cd175[_0x9c1b('0x2f')]=_[_0x9c1b('0x30')](_0x4cd175[_0x9c1b('0x2d')],_0x4cd175[_0x9c1b('0x2e')]);_0x196977[_0x9c1b('0x31')]=_[_0x9c1b('0x30')](_0x4cd175['model'],qs['fields'](_0x3f2eac['query'][_0x9c1b('0x32')]));_0x196977[_0x9c1b('0x31')]=_0x196977[_0x9c1b('0x31')]['length']?_0x196977['attributes']:_0x4cd175[_0x9c1b('0x2d')];_0x196977[_0x9c1b('0x36')]=qs[_0x9c1b('0x4d')](_0x3f2eac[_0x9c1b('0x2e')]['sort']);_0x196977[_0x9c1b('0x39')]=qs['filters'](_[_0x9c1b('0x37')](_0x3f2eac[_0x9c1b('0x2e')],_0x4cd175[_0x9c1b('0x2f')]));if(_0x3f2eac[_0x9c1b('0x2e')][_0x9c1b('0x38')]){_0x196977[_0x9c1b('0x39')]=_[_0x9c1b('0x3a')](_0x196977[_0x9c1b('0x39')],{'$or':_['map'](_0x196977[_0x9c1b('0x31')],function(_0x531204){var _0x15f121={};_0x15f121[_0x531204]={'$like':'%'+_0x3f2eac['query'][_0x9c1b('0x38')]+'%'};return _0x15f121;})});}_0x196977=_['merge']({},_0x196977,_0x3f2eac['options']);return _0x3797f8[_0x9c1b('0x53')](_0x196977);}})[_0x9c1b('0x25')](function(_0x475383){if(_0x475383){_0x137e47=_0x475383[_0x9c1b('0x33')];if(!_0x3f2eac[_0x9c1b('0x2e')][_0x9c1b('0x34')](_0x9c1b('0x35'))){_0x196977[_0x9c1b('0x1b')]=qs[_0x9c1b('0x1b')](_0x3f2eac[_0x9c1b('0x2e')][_0x9c1b('0x1b')]);_0x196977['offset']=qs[_0x9c1b('0x1d')](_0x3f2eac[_0x9c1b('0x2e')]['offset']);}return _0x3797f8[_0x9c1b('0x53')](_0x196977);}})[_0x9c1b('0x25')](function(_0x46a652){if(_0x46a652){return _0x46a652?{'count':_0x137e47,'rows':_0x46a652}:null;}})[_0x9c1b('0x25')](respondWithResult(_0x394efd,null))[_0x9c1b('0x42')](handleError(_0x394efd,null));};exports[_0x9c1b('0x54')]=function(_0x583188,_0x1e19b1,_0x5cd0ee){if(_0x583188['body']['id']){delete _0x583188[_0x9c1b('0x48')]['id'];}return db[_0x9c1b('0x2a')][_0x9c1b('0x51')]({'where':{'id':_0x583188['params']['id']}})[_0x9c1b('0x25')](handleEntityNotFound(_0x1e19b1,null))['then'](function(_0xf75f0e){if(_0xf75f0e){return _0xf75f0e[_0x9c1b('0x54')](_0x583188[_0x9c1b('0x48')][_0x9c1b('0x55')]||[]);}return null;})[_0x9c1b('0x25')](respondWithResult(_0x1e19b1,null))[_0x9c1b('0x42')](handleError(_0x1e19b1,null));}; \ No newline at end of file +var _0x4521=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','undefined','limit','count','offset','status','apply','reject','save','then','error','name','send','index','DeskConfiguration','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','update','destroy','findOne','getFields','nolimit','getSubjects','getDescriptions','DeskField','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x998c5,_0xe04890){var _0x509a89=function(_0x3f58d7){while(--_0x3f58d7){_0x998c5['push'](_0x998c5['shift']());}};_0x509a89(++_0xe04890);}(_0x4521,0x1ec));var _0x1452=function(_0x51b56b,_0x48e574){_0x51b56b=_0x51b56b-0x0;var _0x1ecf0c=_0x4521[_0x51b56b];return _0x1ecf0c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1452('0x0'));var zipdir=require(_0x1452('0x1'));var jsonpatch=require(_0x1452('0x2'));var rp=require(_0x1452('0x3'));var moment=require(_0x1452('0x4'));var BPromise=require(_0x1452('0x5'));var Mustache=require(_0x1452('0x6'));var util=require(_0x1452('0x7'));var path=require(_0x1452('0x8'));var sox=require('sox');var csv=require(_0x1452('0x9'));var ejs=require(_0x1452('0xa'));var fs=require('fs');var fs_extra=require(_0x1452('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1452('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1452('0xd'));var toCsv=require(_0x1452('0x9'));var querystring=require(_0x1452('0xe'));var Papa=require(_0x1452('0xf'));var Redis=require(_0x1452('0x10'));var authService=require(_0x1452('0x11'));var qs=require(_0x1452('0x12'));var as=require(_0x1452('0x13'));var hardwareService=require(_0x1452('0x14'));var logger=require(_0x1452('0x15'))(_0x1452('0x16'));var utils=require(_0x1452('0x17'));var config=require(_0x1452('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33f6b0,_0x133e99){_0x133e99=_0x133e99||0xcc;return function(_0x136e71){if(_0x136e71){return _0x33f6b0[_0x1452('0x19')](_0x133e99);}return _0x33f6b0['status'](_0x133e99)[_0x1452('0x1a')]();};}function respondWithResult(_0x5b2821,_0x4a1af1){_0x4a1af1=_0x4a1af1||0xc8;return function(_0x233870){if(_0x233870){return _0x5b2821['status'](_0x4a1af1)[_0x1452('0x1b')](_0x233870);}};}function respondWithFilteredResult(_0x17da2e,_0xc9ae7d){return function(_0x1067ce){if(_0x1067ce){var _0x488ea4=typeof _0xc9ae7d['offset']===_0x1452('0x1c')&&typeof _0xc9ae7d[_0x1452('0x1d')]===_0x1452('0x1c');var _0x185b9a=_0x1067ce[_0x1452('0x1e')];var _0x120ff1=_0x488ea4?0x0:_0xc9ae7d[_0x1452('0x1f')];var _0x901de1=_0x488ea4?_0x1067ce['count']:_0xc9ae7d[_0x1452('0x1f')]+_0xc9ae7d[_0x1452('0x1d')];var _0xb4dbad;if(_0x901de1>=_0x185b9a){_0x901de1=_0x185b9a;_0xb4dbad=0xc8;}else{_0xb4dbad=0xce;}_0x17da2e[_0x1452('0x20')](_0xb4dbad);return _0x17da2e['set']('Content-Range',_0x120ff1+'-'+_0x901de1+'/'+_0x185b9a)[_0x1452('0x1b')](_0x1067ce);}return null;};}function patchUpdates(_0x1de6a7){return function(_0x198ee4){try{jsonpatch[_0x1452('0x21')](_0x198ee4,_0x1de6a7,!![]);}catch(_0x2c00b4){return BPromise[_0x1452('0x22')](_0x2c00b4);}return _0x198ee4[_0x1452('0x23')]();};}function saveUpdates(_0x1a50e6,_0x52600a){return function(_0x30b9b6){if(_0x30b9b6){return _0x30b9b6['update'](_0x1a50e6)['then'](function(_0x4ec03a){return _0x4ec03a;});}return null;};}function removeEntity(_0xa965b7,_0xa0e7e3){return function(_0x63bbc0){if(_0x63bbc0){return _0x63bbc0['destroy']()[_0x1452('0x24')](function(){_0xa965b7[_0x1452('0x20')](0xcc)[_0x1452('0x1a')]();});}};}function handleEntityNotFound(_0x2b8e7f,_0x59d8ae){return function(_0x4df298){if(!_0x4df298){_0x2b8e7f[_0x1452('0x19')](0x194);}return _0x4df298;};}function handleError(_0x17d2f9,_0x538c88){_0x538c88=_0x538c88||0x1f4;return function(_0x1c01dd){logger[_0x1452('0x25')](_0x1c01dd['stack']);if(_0x1c01dd['name']){delete _0x1c01dd[_0x1452('0x26')];}_0x17d2f9['status'](_0x538c88)[_0x1452('0x27')](_0x1c01dd);};}exports[_0x1452('0x28')]=function(_0x217137,_0x2b9427){var _0xcdc82c={},_0x104ecc={},_0x10a416={'count':0x0,'rows':[]};var _0x3a6dea=_['map'](db[_0x1452('0x29')]['rawAttributes'],function(_0x1f69dd){return{'name':_0x1f69dd[_0x1452('0x2a')],'type':_0x1f69dd[_0x1452('0x2b')][_0x1452('0x2c')]};});_0x104ecc[_0x1452('0x2d')]=_[_0x1452('0x2e')](_0x3a6dea,_0x1452('0x26'));_0x104ecc[_0x1452('0x2f')]=_[_0x1452('0x30')](_0x217137[_0x1452('0x2f')]);_0x104ecc[_0x1452('0x31')]=_[_0x1452('0x32')](_0x104ecc['model'],_0x104ecc[_0x1452('0x2f')]);_0xcdc82c[_0x1452('0x33')]=_[_0x1452('0x32')](_0x104ecc[_0x1452('0x2d')],qs[_0x1452('0x34')](_0x217137['query']['fields']));_0xcdc82c['attributes']=_0xcdc82c[_0x1452('0x33')][_0x1452('0x35')]?_0xcdc82c[_0x1452('0x33')]:_0x104ecc[_0x1452('0x2d')];if(!_0x217137[_0x1452('0x2f')][_0x1452('0x36')]('nolimit')){_0xcdc82c['limit']=qs['limit'](_0x217137[_0x1452('0x2f')][_0x1452('0x1d')]);_0xcdc82c[_0x1452('0x1f')]=qs[_0x1452('0x1f')](_0x217137[_0x1452('0x2f')][_0x1452('0x1f')]);}_0xcdc82c[_0x1452('0x37')]=qs[_0x1452('0x38')](_0x217137[_0x1452('0x2f')][_0x1452('0x38')]);_0xcdc82c[_0x1452('0x39')]=qs[_0x1452('0x31')](_[_0x1452('0x3a')](_0x217137[_0x1452('0x2f')],_0x104ecc[_0x1452('0x31')]),_0x3a6dea);if(_0x217137[_0x1452('0x2f')][_0x1452('0x3b')]){_0xcdc82c['where']=_[_0x1452('0x3c')](_0xcdc82c[_0x1452('0x39')],{'$or':_[_0x1452('0x2e')](_0x3a6dea,function(_0x4d8aa2){if(_0x4d8aa2[_0x1452('0x2b')]!==_0x1452('0x3d')){var _0x318234={};_0x318234[_0x4d8aa2['name']]={'$like':'%'+_0x217137[_0x1452('0x2f')][_0x1452('0x3b')]+'%'};return _0x318234;}})});}_0xcdc82c=_['merge']({},_0xcdc82c,_0x217137[_0x1452('0x3e')]);var _0x98ae26={'where':_0xcdc82c[_0x1452('0x39')]};return db[_0x1452('0x29')][_0x1452('0x1e')](_0x98ae26)[_0x1452('0x24')](function(_0x1aa5b7){_0x10a416[_0x1452('0x1e')]=_0x1aa5b7;if(_0x217137[_0x1452('0x2f')][_0x1452('0x3f')]){_0xcdc82c[_0x1452('0x40')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x1452('0x41')](_0xcdc82c);})[_0x1452('0x24')](function(_0x11cf0e){_0x10a416[_0x1452('0x42')]=_0x11cf0e;return _0x10a416;})[_0x1452('0x24')](respondWithFilteredResult(_0x2b9427,_0xcdc82c))[_0x1452('0x43')](handleError(_0x2b9427,null));};exports['show']=function(_0x46e21e,_0x5120b3){var _0x4fe1e8={'raw':![],'where':{'id':_0x46e21e[_0x1452('0x44')]['id']}},_0x15354b={};_0x15354b[_0x1452('0x2d')]=_['keys'](db[_0x1452('0x29')][_0x1452('0x45')]);_0x15354b['query']=_['keys'](_0x46e21e['query']);_0x15354b[_0x1452('0x31')]=_[_0x1452('0x32')](_0x15354b[_0x1452('0x2d')],_0x15354b[_0x1452('0x2f')]);_0x4fe1e8[_0x1452('0x33')]=_[_0x1452('0x32')](_0x15354b[_0x1452('0x2d')],qs[_0x1452('0x34')](_0x46e21e[_0x1452('0x2f')]['fields']));_0x4fe1e8[_0x1452('0x33')]=_0x4fe1e8[_0x1452('0x33')][_0x1452('0x35')]?_0x4fe1e8['attributes']:_0x15354b[_0x1452('0x2d')];if(_0x46e21e[_0x1452('0x2f')][_0x1452('0x3f')]){_0x4fe1e8[_0x1452('0x40')]=[{'all':!![]}];}_0x4fe1e8=_['merge']({},_0x4fe1e8,_0x46e21e['options']);return db['DeskConfiguration'][_0x1452('0x46')](_0x4fe1e8)[_0x1452('0x24')](handleEntityNotFound(_0x5120b3,null))[_0x1452('0x24')](respondWithResult(_0x5120b3,null))[_0x1452('0x43')](handleError(_0x5120b3,null));};exports[_0x1452('0x47')]=function(_0xf28990,_0x3df17e){return db[_0x1452('0x29')][_0x1452('0x47')](_0xf28990[_0x1452('0x48')],{})['then'](respondWithResult(_0x3df17e,0xc9))[_0x1452('0x43')](handleError(_0x3df17e,null));};exports[_0x1452('0x49')]=function(_0x479fa2,_0x4b356c){if(_0x479fa2[_0x1452('0x48')]['id']){delete _0x479fa2['body']['id'];}return db[_0x1452('0x29')][_0x1452('0x46')]({'where':{'id':_0x479fa2[_0x1452('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b356c,null))[_0x1452('0x24')](saveUpdates(_0x479fa2[_0x1452('0x48')],null))[_0x1452('0x24')](respondWithResult(_0x4b356c,null))[_0x1452('0x43')](handleError(_0x4b356c,null));};exports[_0x1452('0x4a')]=function(_0x591ee2,_0xa172a9){return db[_0x1452('0x29')]['find']({'where':{'id':_0x591ee2['params']['id']}})['then'](handleEntityNotFound(_0xa172a9,null))[_0x1452('0x24')](removeEntity(_0xa172a9,null))[_0x1452('0x43')](handleError(_0xa172a9,null));};exports['getFields']=function(_0x11f19e,_0xc0d0ad,_0x1d7bbb){var _0x37c595={};var _0x241d7b={};var _0x4af14c;var _0x434f62;return db['DeskConfiguration'][_0x1452('0x4b')]({'where':{'id':_0x11f19e[_0x1452('0x44')]['id']}})[_0x1452('0x24')](handleEntityNotFound(_0xc0d0ad,null))[_0x1452('0x24')](function(_0x268516){if(_0x268516){_0x4af14c=_0x268516;_0x241d7b['model']=_[_0x1452('0x30')](db['DeskField'][_0x1452('0x45')]);_0x241d7b[_0x1452('0x2f')]=_[_0x1452('0x30')](_0x11f19e[_0x1452('0x2f')]);_0x241d7b[_0x1452('0x31')]=_[_0x1452('0x32')](_0x241d7b[_0x1452('0x2d')],_0x241d7b['query']);_0x37c595[_0x1452('0x33')]=_[_0x1452('0x32')](_0x241d7b[_0x1452('0x2d')],qs[_0x1452('0x34')](_0x11f19e[_0x1452('0x2f')][_0x1452('0x34')]));_0x37c595[_0x1452('0x33')]=_0x37c595[_0x1452('0x33')][_0x1452('0x35')]?_0x37c595[_0x1452('0x33')]:_0x241d7b[_0x1452('0x2d')];_0x37c595['order']=qs[_0x1452('0x38')](_0x11f19e[_0x1452('0x2f')][_0x1452('0x38')]);_0x37c595[_0x1452('0x39')]=qs[_0x1452('0x31')](_[_0x1452('0x3a')](_0x11f19e[_0x1452('0x2f')],_0x241d7b[_0x1452('0x31')]));if(_0x11f19e['query'][_0x1452('0x3b')]){_0x37c595[_0x1452('0x39')]=_[_0x1452('0x3c')](_0x37c595[_0x1452('0x39')],{'$or':_['map'](_0x37c595[_0x1452('0x33')],function(_0x3dfa61){var _0x50bb93={};_0x50bb93[_0x3dfa61]={'$like':'%'+_0x11f19e[_0x1452('0x2f')][_0x1452('0x3b')]+'%'};return _0x50bb93;})});}_0x37c595=_['merge']({},_0x37c595,_0x11f19e[_0x1452('0x3e')]);return _0x4af14c[_0x1452('0x4c')](_0x37c595);}})[_0x1452('0x24')](function(_0xc7223d){if(_0xc7223d){_0x434f62=_0xc7223d[_0x1452('0x35')];if(!_0x11f19e[_0x1452('0x2f')][_0x1452('0x36')](_0x1452('0x4d'))){_0x37c595[_0x1452('0x1d')]=qs[_0x1452('0x1d')](_0x11f19e[_0x1452('0x2f')][_0x1452('0x1d')]);_0x37c595[_0x1452('0x1f')]=qs['offset'](_0x11f19e[_0x1452('0x2f')][_0x1452('0x1f')]);}return _0x4af14c[_0x1452('0x4c')](_0x37c595);}})[_0x1452('0x24')](function(_0x5b9c89){if(_0x5b9c89){return _0x5b9c89?{'count':_0x434f62,'rows':_0x5b9c89}:null;}})[_0x1452('0x24')](respondWithResult(_0xc0d0ad,null))['catch'](handleError(_0xc0d0ad,null));};exports[_0x1452('0x4e')]=function(_0x29786c,_0x321970,_0x43fb9b){var _0xda674c={};var _0xc1bf25={};var _0x40e21b;var _0x1acbc2;return db[_0x1452('0x29')][_0x1452('0x4b')]({'where':{'id':_0x29786c[_0x1452('0x44')]['id']}})['then'](handleEntityNotFound(_0x321970,null))[_0x1452('0x24')](function(_0x2b51e2){if(_0x2b51e2){_0x40e21b=_0x2b51e2;_0xc1bf25[_0x1452('0x2d')]=_[_0x1452('0x30')](db['DeskField'][_0x1452('0x45')]);_0xc1bf25[_0x1452('0x2f')]=_[_0x1452('0x30')](_0x29786c['query']);_0xc1bf25[_0x1452('0x31')]=_['intersection'](_0xc1bf25['model'],_0xc1bf25['query']);_0xda674c[_0x1452('0x33')]=_[_0x1452('0x32')](_0xc1bf25['model'],qs[_0x1452('0x34')](_0x29786c[_0x1452('0x2f')][_0x1452('0x34')]));_0xda674c[_0x1452('0x33')]=_0xda674c['attributes'][_0x1452('0x35')]?_0xda674c[_0x1452('0x33')]:_0xc1bf25['model'];_0xda674c[_0x1452('0x37')]=qs[_0x1452('0x38')](_0x29786c[_0x1452('0x2f')][_0x1452('0x38')]);_0xda674c[_0x1452('0x39')]=qs[_0x1452('0x31')](_[_0x1452('0x3a')](_0x29786c[_0x1452('0x2f')],_0xc1bf25['filters']));if(_0x29786c[_0x1452('0x2f')][_0x1452('0x3b')]){_0xda674c[_0x1452('0x39')]=_['merge'](_0xda674c[_0x1452('0x39')],{'$or':_[_0x1452('0x2e')](_0xda674c[_0x1452('0x33')],function(_0x23b54b){var _0x104b1d={};_0x104b1d[_0x23b54b]={'$like':'%'+_0x29786c[_0x1452('0x2f')][_0x1452('0x3b')]+'%'};return _0x104b1d;})});}_0xda674c=_['merge']({},_0xda674c,_0x29786c[_0x1452('0x3e')]);return _0x40e21b[_0x1452('0x4e')](_0xda674c);}})[_0x1452('0x24')](function(_0x3b92b9){if(_0x3b92b9){_0x1acbc2=_0x3b92b9[_0x1452('0x35')];if(!_0x29786c[_0x1452('0x2f')][_0x1452('0x36')]('nolimit')){_0xda674c['limit']=qs[_0x1452('0x1d')](_0x29786c[_0x1452('0x2f')]['limit']);_0xda674c[_0x1452('0x1f')]=qs[_0x1452('0x1f')](_0x29786c['query'][_0x1452('0x1f')]);}return _0x40e21b['getSubjects'](_0xda674c);}})[_0x1452('0x24')](function(_0x4b7aa7){if(_0x4b7aa7){return _0x4b7aa7?{'count':_0x1acbc2,'rows':_0x4b7aa7}:null;}})[_0x1452('0x24')](respondWithResult(_0x321970,null))[_0x1452('0x43')](handleError(_0x321970,null));};exports[_0x1452('0x4f')]=function(_0x1b442e,_0x28f64a,_0x3d4523){var _0x5159fb={};var _0x193ba2={};var _0x1046c2;var _0xae6970;return db[_0x1452('0x29')][_0x1452('0x4b')]({'where':{'id':_0x1b442e[_0x1452('0x44')]['id']}})['then'](handleEntityNotFound(_0x28f64a,null))[_0x1452('0x24')](function(_0x1698d7){if(_0x1698d7){_0x1046c2=_0x1698d7;_0x193ba2['model']=_[_0x1452('0x30')](db[_0x1452('0x50')]['rawAttributes']);_0x193ba2[_0x1452('0x2f')]=_[_0x1452('0x30')](_0x1b442e[_0x1452('0x2f')]);_0x193ba2[_0x1452('0x31')]=_['intersection'](_0x193ba2['model'],_0x193ba2[_0x1452('0x2f')]);_0x5159fb['attributes']=_['intersection'](_0x193ba2[_0x1452('0x2d')],qs[_0x1452('0x34')](_0x1b442e[_0x1452('0x2f')]['fields']));_0x5159fb[_0x1452('0x33')]=_0x5159fb[_0x1452('0x33')]['length']?_0x5159fb[_0x1452('0x33')]:_0x193ba2[_0x1452('0x2d')];_0x5159fb['order']=qs['sort'](_0x1b442e['query'][_0x1452('0x38')]);_0x5159fb[_0x1452('0x39')]=qs['filters'](_[_0x1452('0x3a')](_0x1b442e[_0x1452('0x2f')],_0x193ba2[_0x1452('0x31')]));if(_0x1b442e['query']['filter']){_0x5159fb[_0x1452('0x39')]=_[_0x1452('0x3c')](_0x5159fb[_0x1452('0x39')],{'$or':_[_0x1452('0x2e')](_0x5159fb[_0x1452('0x33')],function(_0xf8a58c){var _0x540803={};_0x540803[_0xf8a58c]={'$like':'%'+_0x1b442e['query']['filter']+'%'};return _0x540803;})});}_0x5159fb=_[_0x1452('0x3c')]({},_0x5159fb,_0x1b442e[_0x1452('0x3e')]);return _0x1046c2[_0x1452('0x4f')](_0x5159fb);}})[_0x1452('0x24')](function(_0x38683e){if(_0x38683e){_0xae6970=_0x38683e['length'];if(!_0x1b442e[_0x1452('0x2f')][_0x1452('0x36')](_0x1452('0x4d'))){_0x5159fb['limit']=qs[_0x1452('0x1d')](_0x1b442e[_0x1452('0x2f')][_0x1452('0x1d')]);_0x5159fb[_0x1452('0x1f')]=qs[_0x1452('0x1f')](_0x1b442e[_0x1452('0x2f')][_0x1452('0x1f')]);}return _0x1046c2[_0x1452('0x4f')](_0x5159fb);}})[_0x1452('0x24')](function(_0x40289b){if(_0x40289b){return _0x40289b?{'count':_0xae6970,'rows':_0x40289b}:null;}})[_0x1452('0x24')](respondWithResult(_0x28f64a,null))[_0x1452('0x43')](handleError(_0x28f64a,null));};exports[_0x1452('0x51')]=function(_0x31a649,_0xf686f7,_0x2eb014){var _0x5561a5={};var _0x3d683d={};var _0x11c4e9;var _0x2ea110;return db[_0x1452('0x29')]['findOne']({'where':{'id':_0x31a649[_0x1452('0x44')]['id']}})['then'](handleEntityNotFound(_0xf686f7,null))[_0x1452('0x24')](function(_0x2efbe9){if(_0x2efbe9){_0x11c4e9=_0x2efbe9;_0x3d683d[_0x1452('0x2d')]=_['keys'](db[_0x1452('0x52')][_0x1452('0x45')]);_0x3d683d['query']=_['keys'](_0x31a649[_0x1452('0x2f')]);_0x3d683d[_0x1452('0x31')]=_[_0x1452('0x32')](_0x3d683d['model'],_0x3d683d[_0x1452('0x2f')]);_0x5561a5['attributes']=_['intersection'](_0x3d683d[_0x1452('0x2d')],qs[_0x1452('0x34')](_0x31a649[_0x1452('0x2f')][_0x1452('0x34')]));_0x5561a5[_0x1452('0x33')]=_0x5561a5[_0x1452('0x33')][_0x1452('0x35')]?_0x5561a5[_0x1452('0x33')]:_0x3d683d['model'];_0x5561a5[_0x1452('0x37')]=qs[_0x1452('0x38')](_0x31a649[_0x1452('0x2f')][_0x1452('0x38')]);_0x5561a5['where']=qs[_0x1452('0x31')](_[_0x1452('0x3a')](_0x31a649['query'],_0x3d683d[_0x1452('0x31')]));if(_0x31a649['query']['filter']){_0x5561a5[_0x1452('0x39')]=_[_0x1452('0x3c')](_0x5561a5[_0x1452('0x39')],{'$or':_[_0x1452('0x2e')](_0x5561a5['attributes'],function(_0x3acfc2){var _0x4858df={};_0x4858df[_0x3acfc2]={'$like':'%'+_0x31a649[_0x1452('0x2f')][_0x1452('0x3b')]+'%'};return _0x4858df;})});}_0x5561a5=_[_0x1452('0x3c')]({},_0x5561a5,_0x31a649[_0x1452('0x3e')]);return _0x11c4e9[_0x1452('0x51')](_0x5561a5);}})[_0x1452('0x24')](function(_0x393c25){if(_0x393c25){_0x2ea110=_0x393c25[_0x1452('0x35')];if(!_0x31a649[_0x1452('0x2f')]['hasOwnProperty']('nolimit')){_0x5561a5[_0x1452('0x1d')]=qs[_0x1452('0x1d')](_0x31a649[_0x1452('0x2f')][_0x1452('0x1d')]);_0x5561a5['offset']=qs[_0x1452('0x1f')](_0x31a649[_0x1452('0x2f')][_0x1452('0x1f')]);}return _0x11c4e9['getTags'](_0x5561a5);}})[_0x1452('0x24')](function(_0x2837c0){if(_0x2837c0){return _0x2837c0?{'count':_0x2ea110,'rows':_0x2837c0}:null;}})[_0x1452('0x24')](respondWithResult(_0xf686f7,null))[_0x1452('0x43')](handleError(_0xf686f7,null));};exports[_0x1452('0x53')]=function(_0x10d4da,_0x581e4e,_0x46e740){if(_0x10d4da[_0x1452('0x48')]['id']){delete _0x10d4da[_0x1452('0x48')]['id'];}return db['DeskConfiguration'][_0x1452('0x4b')]({'where':{'id':_0x10d4da['params']['id']}})[_0x1452('0x24')](handleEntityNotFound(_0x581e4e,null))[_0x1452('0x24')](function(_0x202c72){if(_0x202c72){return _0x202c72['setTags'](_0x10d4da['body'][_0x1452('0x54')]||[]);}return null;})[_0x1452('0x24')](respondWithResult(_0x581e4e,null))[_0x1452('0x43')](handleError(_0x581e4e,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index c17e972..ffc4dda 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 _0xa53a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','DeskConfiguration','int_desk_configurations','util','../../config/logger','api'];(function(_0xac8ae5,_0x42726a){var _0x189d4b=function(_0x4ebab9){while(--_0x4ebab9){_0xac8ae5['push'](_0xac8ae5['shift']());}};_0x189d4b(++_0x42726a);}(_0xa53a,0x101));var _0xaa53=function(_0x3846cb,_0xdd1472){_0x3846cb=_0x3846cb-0x0;var _0x422547=_0xa53a[_0x3846cb];return _0x422547;};'use strict';var _=require('lodash');var util=require(_0xaa53('0x0'));var logger=require(_0xaa53('0x1'))(_0xaa53('0x2'));var moment=require(_0xaa53('0x3'));var BPromise=require(_0xaa53('0x4'));var rp=require(_0xaa53('0x5'));var fs=require('fs');var path=require(_0xaa53('0x6'));var rimraf=require(_0xaa53('0x7'));var config=require(_0xaa53('0x8'));var attributes=require('./intDeskConfiguration.attributes');module[_0xaa53('0x9')]=function(_0x3159bc,_0x23c783){return _0x3159bc[_0xaa53('0xa')](_0xaa53('0xb'),attributes,{'tableName':_0xaa53('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x912f=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','exports','define','DeskConfiguration','int_desk_configurations'];(function(_0x102d50,_0x244eae){var _0x1a8611=function(_0x2db2ff){while(--_0x2db2ff){_0x102d50['push'](_0x102d50['shift']());}};_0x1a8611(++_0x244eae);}(_0x912f,0x1d9));var _0xf912=function(_0x4aeab0,_0x19499b){_0x4aeab0=_0x4aeab0-0x0;var _0xe6b4f=_0x912f[_0x4aeab0];return _0xe6b4f;};'use strict';var _=require(_0xf912('0x0'));var util=require(_0xf912('0x1'));var logger=require(_0xf912('0x2'))('api');var moment=require(_0xf912('0x3'));var BPromise=require(_0xf912('0x4'));var rp=require(_0xf912('0x5'));var fs=require('fs');var path=require(_0xf912('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module[_0xf912('0x7')]=function(_0x43132c,_0x5840fc){return _0x43132c[_0xf912('0x8')](_0xf912('0x9'),attributes,{'tableName':_0xf912('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 c428ce2..d96b491 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 _0x1433=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','DeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','lodash','util'];(function(_0x1e5430,_0x2d4ada){var _0x537969=function(_0x1f19d8){while(--_0x1f19d8){_0x1e5430['push'](_0x1e5430['shift']());}};_0x537969(++_0x2d4ada);}(_0x1433,0x152));var _0x3143=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x1433[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x3143('0x0'));var util=require(_0x3143('0x1'));var moment=require(_0x3143('0x2'));var BPromise=require(_0x3143('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3143('0x4'));var db=require(_0x3143('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3143('0x6'))(_0x3143('0x7'));var config=require(_0x3143('0x8'));var jayson=require(_0x3143('0x9'));var client=jayson[_0x3143('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x548743,_0x1539d6,_0x36c7c4){return new BPromise(function(_0x882cec,_0x2a8778){return client[_0x3143('0xb')](_0x548743,_0x36c7c4)['then'](function(_0x2ca81d){logger[_0x3143('0xc')](_0x3143('0xd'),_0x1539d6,'request\x20sent');logger[_0x3143('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1539d6,_0x3143('0xf'),JSON[_0x3143('0x10')](_0x2ca81d));if(_0x2ca81d[_0x3143('0x11')]){if(_0x2ca81d[_0x3143('0x11')]['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x1539d6,_0x2ca81d[_0x3143('0x11')][_0x3143('0x12')]);return _0x2a8778(_0x2ca81d[_0x3143('0x11')][_0x3143('0x12')]);}logger[_0x3143('0x11')](_0x3143('0xd'),_0x1539d6,_0x2ca81d[_0x3143('0x11')][_0x3143('0x12')]);return _0x882cec(_0x2ca81d['error'][_0x3143('0x12')]);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x1539d6,_0x3143('0xf'));_0x882cec(_0x2ca81d['result'][_0x3143('0x12')]);}})[_0x3143('0x13')](function(_0x3f9137){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x1539d6,_0x3f9137);_0x2a8778(_0x3f9137);});});} \ No newline at end of file +var _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2b94cc,_0x579442){var _0x409314=function(_0x2b4c11){while(--_0x2b4c11){_0x2b94cc['push'](_0x2b94cc['shift']());}};_0x409314(++_0x579442);}(_0x7880,0x1f4));var _0x0788=function(_0x809314,_0xaf27c0){_0x809314=_0x809314-0x0;var _0x1a94b6=_0x7880[_0x809314];return _0x1a94b6;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 28beb8f..d88c348 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 _0x3753=['/:id','show','post','create','put','update','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index'];(function(_0x16ec1c,_0x575c2b){var _0x317efe=function(_0x7356f0){while(--_0x7356f0){_0x16ec1c['push'](_0x16ec1c['shift']());}};_0x317efe(++_0x575c2b);}(_0x3753,0x6d));var _0x3375=function(_0x40b687,_0x3d93e3){_0x40b687=_0x40b687-0x0;var _0x1a32fa=_0x3753[_0x40b687];return _0x1a32fa;};'use strict';var multer=require(_0x3375('0x0'));var util=require('util');var path=require(_0x3375('0x1'));var timeout=require(_0x3375('0x2'));var express=require('express');var router=express[_0x3375('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3375('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3375('0x5'));var controller=require(_0x3375('0x6'));router[_0x3375('0x7')]('/',auth[_0x3375('0x8')](),controller[_0x3375('0x9')]);router[_0x3375('0x7')](_0x3375('0xa'),auth[_0x3375('0x8')](),controller[_0x3375('0xb')]);router[_0x3375('0xc')]('/',auth[_0x3375('0x8')](),controller[_0x3375('0xd')]);router[_0x3375('0xe')](_0x3375('0xa'),auth['isAuthenticated'](),controller[_0x3375('0xf')]);router['delete'](_0x3375('0xa'),auth[_0x3375('0x8')](),controller['destroy']);module[_0x3375('0x10')]=router; \ No newline at end of file +var _0x31d8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','/:id','show','put','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x22e4ba,_0x1640dc){var _0x2a4228=function(_0x5c4209){while(--_0x5c4209){_0x22e4ba['push'](_0x22e4ba['shift']());}};_0x2a4228(++_0x1640dc);}(_0x31d8,0xf7));var _0x831d=function(_0x3f0bd9,_0x3a894d){_0x3f0bd9=_0x3f0bd9-0x0;var _0x27ea54=_0x31d8[_0x3f0bd9];return _0x27ea54;};'use strict';var multer=require(_0x831d('0x0'));var util=require(_0x831d('0x1'));var path=require('path');var timeout=require(_0x831d('0x2'));var express=require(_0x831d('0x3'));var router=express[_0x831d('0x4')]();var fs_extra=require(_0x831d('0x5'));var auth=require(_0x831d('0x6'));var interaction=require(_0x831d('0x7'));var config=require(_0x831d('0x8'));var controller=require(_0x831d('0x9'));router['get']('/',auth[_0x831d('0xa')](),controller[_0x831d('0xb')]);router['get'](_0x831d('0xc'),auth[_0x831d('0xa')](),controller[_0x831d('0xd')]);router['post']('/',auth[_0x831d('0xa')](),controller['create']);router[_0x831d('0xe')](_0x831d('0xc'),auth[_0x831d('0xa')](),controller['update']);router[_0x831d('0xf')](_0x831d('0xc'),auth['isAuthenticated'](),controller[_0x831d('0x10')]);module[_0x831d('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 74801a7..b9418ae 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 _0xc670=['customVariable','sequelize','ENUM','string','variable','STRING'];(function(_0x37b07c,_0x5941a1){var _0x264672=function(_0x4860e6){while(--_0x4860e6){_0x37b07c['push'](_0x37b07c['shift']());}};_0x264672(++_0x5941a1);}(_0xc670,0x97));var _0x0c67=function(_0x208af6,_0x1d4b9b){_0x208af6=_0x208af6-0x0;var _0xb10182=_0xc670[_0x208af6];return _0xb10182;};'use strict';var Sequelize=require(_0x0c67('0x0'));module['exports']={'type':{'type':Sequelize[_0x0c67('0x1')](_0x0c67('0x2'),_0x0c67('0x3'),'customVariable','keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x0c67('0x4')]},'key':{'type':Sequelize[_0x0c67('0x4')]},'keyType':{'type':Sequelize[_0x0c67('0x1')](_0x0c67('0x2'),_0x0c67('0x3'),_0x0c67('0x5'))},'keyContent':{'type':Sequelize[_0x0c67('0x4')]},'idField':{'type':Sequelize[_0x0c67('0x4')]},'nameField':{'type':Sequelize[_0x0c67('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0c67('0x4')]}}; \ No newline at end of file +var _0x72e6=['keyValue','picklist','STRING','ENUM','sequelize','exports','string','variable','customVariable'];(function(_0x1b1858,_0x15327e){var _0x3bafe7=function(_0x2fe1d9){while(--_0x2fe1d9){_0x1b1858['push'](_0x1b1858['shift']());}};_0x3bafe7(++_0x15327e);}(_0x72e6,0x8b));var _0x672e=function(_0x3635fa,_0x2b3e14){_0x3635fa=_0x3635fa-0x0;var _0x8a7530=_0x72e6[_0x3635fa];return _0x8a7530;};'use strict';var Sequelize=require(_0x672e('0x0'));module[_0x672e('0x1')]={'type':{'type':Sequelize['ENUM'](_0x672e('0x2'),_0x672e('0x3'),_0x672e('0x4'),_0x672e('0x5'),_0x672e('0x6')),'defaultValue':_0x672e('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x672e('0x7')]},'keyType':{'type':Sequelize[_0x672e('0x8')](_0x672e('0x2'),_0x672e('0x3'),_0x672e('0x4'))},'keyContent':{'type':Sequelize[_0x672e('0x7')]},'idField':{'type':Sequelize[_0x672e('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x672e('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 4d6085b..b0a769b 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 _0xb934=['moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','DeskField','rows','catch','show','rawAttributes','length','find','create','body','params','eml-format','rimraf','zip-dir','request-promise'];(function(_0x2a655e,_0x419bc6){var _0x8a2d2d=function(_0x1b87a9){while(--_0x1b87a9){_0x2a655e['push'](_0x2a655e['shift']());}};_0x8a2d2d(++_0x419bc6);}(_0xb934,0x92));var _0x4b93=function(_0x30c9f4,_0x57c0c5){_0x30c9f4=_0x30c9f4-0x0;var _0x4ab60e=_0xb934[_0x30c9f4];return _0x4ab60e;};'use strict';var emlformat=require(_0x4b93('0x0'));var rimraf=require(_0x4b93('0x1'));var zipdir=require(_0x4b93('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b93('0x3'));var moment=require(_0x4b93('0x4'));var BPromise=require(_0x4b93('0x5'));var Mustache=require(_0x4b93('0x6'));var util=require(_0x4b93('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4b93('0x8'));var ejs=require(_0x4b93('0x9'));var fs=require('fs');var fs_extra=require(_0x4b93('0xa'));var _=require(_0x4b93('0xb'));var squel=require('squel');var crypto=require(_0x4b93('0xc'));var jsforce=require(_0x4b93('0xd'));var deskjs=require(_0x4b93('0xe'));var toCsv=require(_0x4b93('0x8'));var querystring=require(_0x4b93('0xf'));var Papa=require(_0x4b93('0x10'));var Redis=require(_0x4b93('0x11'));var authService=require(_0x4b93('0x12'));var qs=require(_0x4b93('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b93('0x14'));var logger=require(_0x4b93('0x15'))(_0x4b93('0x16'));var utils=require(_0x4b93('0x17'));var config=require(_0x4b93('0x18'));var licenseUtil=require(_0x4b93('0x19'));var db=require(_0x4b93('0x1a'))['db'];function respondWithStatusCode(_0x68be2e,_0xae64c){_0xae64c=_0xae64c||0xcc;return function(_0x28bebf){if(_0x28bebf){return _0x68be2e[_0x4b93('0x1b')](_0xae64c);}return _0x68be2e[_0x4b93('0x1c')](_0xae64c)[_0x4b93('0x1d')]();};}function respondWithResult(_0x3f4db7,_0x11dd47){_0x11dd47=_0x11dd47||0xc8;return function(_0x4f7c7a){if(_0x4f7c7a){return _0x3f4db7[_0x4b93('0x1c')](_0x11dd47)[_0x4b93('0x1e')](_0x4f7c7a);}};}function respondWithFilteredResult(_0xbc5eb1,_0x53eb43){return function(_0x19a9d5){if(_0x19a9d5){var _0x387a16=typeof _0x53eb43[_0x4b93('0x1f')]===_0x4b93('0x20')&&typeof _0x53eb43[_0x4b93('0x21')]==='undefined';var _0x67669d=_0x19a9d5[_0x4b93('0x22')];var _0x554c16=_0x387a16?0x0:_0x53eb43['offset'];var _0x11a1f3=_0x387a16?_0x19a9d5[_0x4b93('0x22')]:_0x53eb43[_0x4b93('0x1f')]+_0x53eb43[_0x4b93('0x21')];var _0x2899cb;if(_0x11a1f3>=_0x67669d){_0x11a1f3=_0x67669d;_0x2899cb=0xc8;}else{_0x2899cb=0xce;}_0xbc5eb1[_0x4b93('0x1c')](_0x2899cb);return _0xbc5eb1[_0x4b93('0x23')](_0x4b93('0x24'),_0x554c16+'-'+_0x11a1f3+'/'+_0x67669d)[_0x4b93('0x1e')](_0x19a9d5);}return null;};}function patchUpdates(_0x36bf8a){return function(_0x2c750e){try{jsonpatch['apply'](_0x2c750e,_0x36bf8a,!![]);}catch(_0x5798d3){return BPromise['reject'](_0x5798d3);}return _0x2c750e['save']();};}function saveUpdates(_0x5b8cd6,_0x15f204){return function(_0x4b7858){if(_0x4b7858){return _0x4b7858[_0x4b93('0x25')](_0x5b8cd6)[_0x4b93('0x26')](function(_0x40e9a3){return _0x40e9a3;});}return null;};}function removeEntity(_0x3c443b,_0x36c610){return function(_0x135c6a){if(_0x135c6a){return _0x135c6a[_0x4b93('0x27')]()[_0x4b93('0x26')](function(){_0x3c443b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a74eb,_0x4fff6a){return function(_0x118afb){if(!_0x118afb){_0x1a74eb['sendStatus'](0x194);}return _0x118afb;};}function handleError(_0x352f08,_0x5a0a76){_0x5a0a76=_0x5a0a76||0x1f4;return function(_0x5ec0af){logger[_0x4b93('0x28')](_0x5ec0af[_0x4b93('0x29')]);if(_0x5ec0af[_0x4b93('0x2a')]){delete _0x5ec0af[_0x4b93('0x2a')];}_0x352f08[_0x4b93('0x1c')](_0x5a0a76)[_0x4b93('0x2b')](_0x5ec0af);};}exports[_0x4b93('0x2c')]=function(_0x43b5b7,_0x4c457b){var _0x2bff36={},_0x2a86e0={},_0x3411d5={'count':0x0,'rows':[]};var _0x567cf0=_[_0x4b93('0x2d')](db['DeskField']['rawAttributes'],function(_0x339c18){return{'name':_0x339c18[_0x4b93('0x2e')],'type':_0x339c18[_0x4b93('0x2f')][_0x4b93('0x30')]};});_0x2a86e0[_0x4b93('0x31')]=_[_0x4b93('0x2d')](_0x567cf0,_0x4b93('0x2a'));_0x2a86e0[_0x4b93('0x32')]=_[_0x4b93('0x33')](_0x43b5b7[_0x4b93('0x32')]);_0x2a86e0['filters']=_[_0x4b93('0x34')](_0x2a86e0['model'],_0x2a86e0['query']);_0x2bff36[_0x4b93('0x35')]=_[_0x4b93('0x34')](_0x2a86e0[_0x4b93('0x31')],qs[_0x4b93('0x36')](_0x43b5b7[_0x4b93('0x32')][_0x4b93('0x36')]));_0x2bff36[_0x4b93('0x35')]=_0x2bff36[_0x4b93('0x35')]['length']?_0x2bff36[_0x4b93('0x35')]:_0x2a86e0[_0x4b93('0x31')];if(!_0x43b5b7['query']['hasOwnProperty'](_0x4b93('0x37'))){_0x2bff36[_0x4b93('0x21')]=qs[_0x4b93('0x21')](_0x43b5b7[_0x4b93('0x32')][_0x4b93('0x21')]);_0x2bff36['offset']=qs[_0x4b93('0x1f')](_0x43b5b7[_0x4b93('0x32')][_0x4b93('0x1f')]);}_0x2bff36[_0x4b93('0x38')]=qs[_0x4b93('0x39')](_0x43b5b7[_0x4b93('0x32')]['sort']);_0x2bff36['where']=qs['filters'](_['pick'](_0x43b5b7[_0x4b93('0x32')],_0x2a86e0[_0x4b93('0x3a')]),_0x567cf0);if(_0x43b5b7['query'][_0x4b93('0x3b')]){_0x2bff36[_0x4b93('0x3c')]=_[_0x4b93('0x3d')](_0x2bff36[_0x4b93('0x3c')],{'$or':_['map'](_0x567cf0,function(_0x444623){if(_0x444623[_0x4b93('0x2f')]!=='VIRTUAL'){var _0x393cf9={};_0x393cf9[_0x444623['name']]={'$like':'%'+_0x43b5b7[_0x4b93('0x32')]['filter']+'%'};return _0x393cf9;}})});}_0x2bff36=_['merge']({},_0x2bff36,_0x43b5b7[_0x4b93('0x3e')]);var _0x36d50a={'where':_0x2bff36['where']};return db['DeskField'][_0x4b93('0x22')](_0x36d50a)[_0x4b93('0x26')](function(_0x3ecf96){_0x3411d5[_0x4b93('0x22')]=_0x3ecf96;if(_0x43b5b7[_0x4b93('0x32')][_0x4b93('0x3f')]){_0x2bff36[_0x4b93('0x40')]=[{'all':!![]}];}return db[_0x4b93('0x41')]['findAll'](_0x2bff36);})[_0x4b93('0x26')](function(_0x4ff1ea){_0x3411d5[_0x4b93('0x42')]=_0x4ff1ea;return _0x3411d5;})['then'](respondWithFilteredResult(_0x4c457b,_0x2bff36))[_0x4b93('0x43')](handleError(_0x4c457b,null));};exports[_0x4b93('0x44')]=function(_0x1b9fad,_0x5a8c00){var _0x343f5a={'raw':!![],'where':{'id':_0x1b9fad['params']['id']}},_0xe1e51b={};_0xe1e51b['model']=_['keys'](db['DeskField'][_0x4b93('0x45')]);_0xe1e51b[_0x4b93('0x32')]=_[_0x4b93('0x33')](_0x1b9fad[_0x4b93('0x32')]);_0xe1e51b['filters']=_['intersection'](_0xe1e51b[_0x4b93('0x31')],_0xe1e51b[_0x4b93('0x32')]);_0x343f5a['attributes']=_[_0x4b93('0x34')](_0xe1e51b[_0x4b93('0x31')],qs['fields'](_0x1b9fad['query'][_0x4b93('0x36')]));_0x343f5a[_0x4b93('0x35')]=_0x343f5a[_0x4b93('0x35')][_0x4b93('0x46')]?_0x343f5a[_0x4b93('0x35')]:_0xe1e51b[_0x4b93('0x31')];if(_0x1b9fad[_0x4b93('0x32')][_0x4b93('0x3f')]){_0x343f5a['include']=[{'all':!![]}];}_0x343f5a=_[_0x4b93('0x3d')]({},_0x343f5a,_0x1b9fad[_0x4b93('0x3e')]);return db[_0x4b93('0x41')][_0x4b93('0x47')](_0x343f5a)[_0x4b93('0x26')](handleEntityNotFound(_0x5a8c00,null))[_0x4b93('0x26')](respondWithResult(_0x5a8c00,null))[_0x4b93('0x43')](handleError(_0x5a8c00,null));};exports['create']=function(_0x58679c,_0x30a0f9){return db[_0x4b93('0x41')][_0x4b93('0x48')](_0x58679c['body'],{})[_0x4b93('0x26')](respondWithResult(_0x30a0f9,0xc9))['catch'](handleError(_0x30a0f9,null));};exports['update']=function(_0x43b777,_0x5aece5){if(_0x43b777[_0x4b93('0x49')]['id']){delete _0x43b777[_0x4b93('0x49')]['id'];}return db[_0x4b93('0x41')][_0x4b93('0x47')]({'where':{'id':_0x43b777[_0x4b93('0x4a')]['id']}})[_0x4b93('0x26')](handleEntityNotFound(_0x5aece5,null))[_0x4b93('0x26')](saveUpdates(_0x43b777[_0x4b93('0x49')],null))['then'](respondWithResult(_0x5aece5,null))[_0x4b93('0x43')](handleError(_0x5aece5,null));};exports[_0x4b93('0x27')]=function(_0x11eacc,_0x46c070){return db['DeskField'][_0x4b93('0x47')]({'where':{'id':_0x11eacc[_0x4b93('0x4a')]['id']}})[_0x4b93('0x26')](handleEntityNotFound(_0x46c070,null))[_0x4b93('0x26')](removeEntity(_0x46c070,null))['catch'](handleError(_0x46c070,null));}; \ No newline at end of file +var _0x8658=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','keys','filters','query','intersection','model','fields','attributes','order','sort','pick','filter','where','merge','options','DeskField','includeAll','include','rows','catch','params','length','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x269437,_0x31208a){var _0x4187b3=function(_0x1fa346){while(--_0x1fa346){_0x269437['push'](_0x269437['shift']());}};_0x4187b3(++_0x31208a);}(_0x8658,0x1d3));var _0x8865=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x8658[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0x8865('0x0'));var rimraf=require(_0x8865('0x1'));var zipdir=require(_0x8865('0x2'));var jsonpatch=require(_0x8865('0x3'));var rp=require(_0x8865('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8865('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8865('0x6'));var csv=require(_0x8865('0x7'));var ejs=require(_0x8865('0x8'));var fs=require('fs');var fs_extra=require(_0x8865('0x9'));var _=require(_0x8865('0xa'));var squel=require(_0x8865('0xb'));var crypto=require(_0x8865('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8865('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8865('0xe'));var Papa=require('papaparse');var Redis=require(_0x8865('0xf'));var authService=require(_0x8865('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8865('0x11'));var hardwareService=require(_0x8865('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x8865('0x13'));var config=require(_0x8865('0x14'));var licenseUtil=require(_0x8865('0x15'));var db=require(_0x8865('0x16'))['db'];function respondWithStatusCode(_0x5858ce,_0x363729){_0x363729=_0x363729||0xcc;return function(_0x132386){if(_0x132386){return _0x5858ce[_0x8865('0x17')](_0x363729);}return _0x5858ce[_0x8865('0x18')](_0x363729)[_0x8865('0x19')]();};}function respondWithResult(_0x5aacac,_0x2c3502){_0x2c3502=_0x2c3502||0xc8;return function(_0x50e5e8){if(_0x50e5e8){return _0x5aacac[_0x8865('0x18')](_0x2c3502)[_0x8865('0x1a')](_0x50e5e8);}};}function respondWithFilteredResult(_0x1a2dee,_0x5367a6){return function(_0x3eb5f9){if(_0x3eb5f9){var _0x55edca=typeof _0x5367a6[_0x8865('0x1b')]===_0x8865('0x1c')&&typeof _0x5367a6['limit']===_0x8865('0x1c');var _0x9f4f33=_0x3eb5f9[_0x8865('0x1d')];var _0x4f6310=_0x55edca?0x0:_0x5367a6[_0x8865('0x1b')];var _0x1409c0=_0x55edca?_0x3eb5f9[_0x8865('0x1d')]:_0x5367a6[_0x8865('0x1b')]+_0x5367a6[_0x8865('0x1e')];var _0x24b431;if(_0x1409c0>=_0x9f4f33){_0x1409c0=_0x9f4f33;_0x24b431=0xc8;}else{_0x24b431=0xce;}_0x1a2dee[_0x8865('0x18')](_0x24b431);return _0x1a2dee[_0x8865('0x1f')](_0x8865('0x20'),_0x4f6310+'-'+_0x1409c0+'/'+_0x9f4f33)[_0x8865('0x1a')](_0x3eb5f9);}return null;};}function patchUpdates(_0x199ca7){return function(_0x4f9773){try{jsonpatch[_0x8865('0x21')](_0x4f9773,_0x199ca7,!![]);}catch(_0x232e21){return BPromise['reject'](_0x232e21);}return _0x4f9773[_0x8865('0x22')]();};}function saveUpdates(_0x19594f,_0x5d2f14){return function(_0x31b1b1){if(_0x31b1b1){return _0x31b1b1['update'](_0x19594f)[_0x8865('0x23')](function(_0x1601e0){return _0x1601e0;});}return null;};}function removeEntity(_0x6927b,_0x304a23){return function(_0x3b39fa){if(_0x3b39fa){return _0x3b39fa[_0x8865('0x24')]()[_0x8865('0x23')](function(){_0x6927b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4153ca,_0x461392){return function(_0x1f4b4e){if(!_0x1f4b4e){_0x4153ca['sendStatus'](0x194);}return _0x1f4b4e;};}function handleError(_0x4ee787,_0x4df452){_0x4df452=_0x4df452||0x1f4;return function(_0x40d674){logger[_0x8865('0x25')](_0x40d674[_0x8865('0x26')]);if(_0x40d674['name']){delete _0x40d674[_0x8865('0x27')];}_0x4ee787[_0x8865('0x18')](_0x4df452)[_0x8865('0x28')](_0x40d674);};}exports[_0x8865('0x29')]=function(_0x131fe6,_0x258d98){var _0x112e3c={},_0x143bc3={},_0x3c5d62={'count':0x0,'rows':[]};var _0x5cac52=_[_0x8865('0x2a')](db['DeskField'][_0x8865('0x2b')],function(_0x1e4998){return{'name':_0x1e4998['fieldName'],'type':_0x1e4998[_0x8865('0x2c')][_0x8865('0x2d')]};});_0x143bc3['model']=_['map'](_0x5cac52,'name');_0x143bc3['query']=_[_0x8865('0x2e')](_0x131fe6['query']);_0x143bc3[_0x8865('0x2f')]=_['intersection'](_0x143bc3['model'],_0x143bc3[_0x8865('0x30')]);_0x112e3c['attributes']=_[_0x8865('0x31')](_0x143bc3[_0x8865('0x32')],qs[_0x8865('0x33')](_0x131fe6[_0x8865('0x30')][_0x8865('0x33')]));_0x112e3c['attributes']=_0x112e3c[_0x8865('0x34')]['length']?_0x112e3c[_0x8865('0x34')]:_0x143bc3[_0x8865('0x32')];if(!_0x131fe6[_0x8865('0x30')]['hasOwnProperty']('nolimit')){_0x112e3c[_0x8865('0x1e')]=qs[_0x8865('0x1e')](_0x131fe6['query'][_0x8865('0x1e')]);_0x112e3c[_0x8865('0x1b')]=qs[_0x8865('0x1b')](_0x131fe6['query'][_0x8865('0x1b')]);}_0x112e3c[_0x8865('0x35')]=qs[_0x8865('0x36')](_0x131fe6['query']['sort']);_0x112e3c['where']=qs[_0x8865('0x2f')](_[_0x8865('0x37')](_0x131fe6[_0x8865('0x30')],_0x143bc3[_0x8865('0x2f')]),_0x5cac52);if(_0x131fe6['query'][_0x8865('0x38')]){_0x112e3c[_0x8865('0x39')]=_[_0x8865('0x3a')](_0x112e3c[_0x8865('0x39')],{'$or':_['map'](_0x5cac52,function(_0x58fa4a){if(_0x58fa4a['type']!=='VIRTUAL'){var _0x3a8057={};_0x3a8057[_0x58fa4a['name']]={'$like':'%'+_0x131fe6[_0x8865('0x30')][_0x8865('0x38')]+'%'};return _0x3a8057;}})});}_0x112e3c=_[_0x8865('0x3a')]({},_0x112e3c,_0x131fe6[_0x8865('0x3b')]);var _0x12f465={'where':_0x112e3c[_0x8865('0x39')]};return db[_0x8865('0x3c')][_0x8865('0x1d')](_0x12f465)[_0x8865('0x23')](function(_0x1bbf8d){_0x3c5d62['count']=_0x1bbf8d;if(_0x131fe6[_0x8865('0x30')][_0x8865('0x3d')]){_0x112e3c[_0x8865('0x3e')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x112e3c);})[_0x8865('0x23')](function(_0x5d8c7b){_0x3c5d62[_0x8865('0x3f')]=_0x5d8c7b;return _0x3c5d62;})[_0x8865('0x23')](respondWithFilteredResult(_0x258d98,_0x112e3c))[_0x8865('0x40')](handleError(_0x258d98,null));};exports['show']=function(_0x86b557,_0x90749c){var _0x9fd95={'raw':!![],'where':{'id':_0x86b557[_0x8865('0x41')]['id']}},_0x186948={};_0x186948[_0x8865('0x32')]=_['keys'](db[_0x8865('0x3c')][_0x8865('0x2b')]);_0x186948[_0x8865('0x30')]=_['keys'](_0x86b557['query']);_0x186948[_0x8865('0x2f')]=_['intersection'](_0x186948['model'],_0x186948['query']);_0x9fd95[_0x8865('0x34')]=_[_0x8865('0x31')](_0x186948[_0x8865('0x32')],qs[_0x8865('0x33')](_0x86b557[_0x8865('0x30')][_0x8865('0x33')]));_0x9fd95[_0x8865('0x34')]=_0x9fd95['attributes'][_0x8865('0x42')]?_0x9fd95[_0x8865('0x34')]:_0x186948[_0x8865('0x32')];if(_0x86b557[_0x8865('0x30')][_0x8865('0x3d')]){_0x9fd95[_0x8865('0x3e')]=[{'all':!![]}];}_0x9fd95=_[_0x8865('0x3a')]({},_0x9fd95,_0x86b557[_0x8865('0x3b')]);return db[_0x8865('0x3c')]['find'](_0x9fd95)[_0x8865('0x23')](handleEntityNotFound(_0x90749c,null))[_0x8865('0x23')](respondWithResult(_0x90749c,null))['catch'](handleError(_0x90749c,null));};exports[_0x8865('0x43')]=function(_0x47540c,_0x18aa59){return db['DeskField']['create'](_0x47540c[_0x8865('0x44')],{})[_0x8865('0x23')](respondWithResult(_0x18aa59,0xc9))[_0x8865('0x40')](handleError(_0x18aa59,null));};exports['update']=function(_0x276c51,_0x1053a5){if(_0x276c51[_0x8865('0x44')]['id']){delete _0x276c51[_0x8865('0x44')]['id'];}return db['DeskField'][_0x8865('0x45')]({'where':{'id':_0x276c51[_0x8865('0x41')]['id']}})[_0x8865('0x23')](handleEntityNotFound(_0x1053a5,null))[_0x8865('0x23')](saveUpdates(_0x276c51[_0x8865('0x44')],null))['then'](respondWithResult(_0x1053a5,null))[_0x8865('0x40')](handleError(_0x1053a5,null));};exports['destroy']=function(_0x3cb558,_0x1b1800){return db[_0x8865('0x3c')][_0x8865('0x45')]({'where':{'id':_0x3cb558['params']['id']}})[_0x8865('0x23')](handleEntityNotFound(_0x1b1800,null))['then'](removeEntity(_0x1b1800,null))[_0x8865('0x40')](handleError(_0x1b1800,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 2b21d65..fbcc60e 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 _0x1ef2=['./intDeskField.attributes','exports','define','DeskField','int_desk_fields','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x32af99,_0x4a98e4){var _0x29751d=function(_0x581bf0){while(--_0x581bf0){_0x32af99['push'](_0x32af99['shift']());}};_0x29751d(++_0x4a98e4);}(_0x1ef2,0x8d));var _0x21ef=function(_0x42ebba,_0x4cbf87){_0x42ebba=_0x42ebba-0x0;var _0x3fd2af=_0x1ef2[_0x42ebba];return _0x3fd2af;};'use strict';var _=require(_0x21ef('0x0'));var util=require(_0x21ef('0x1'));var logger=require(_0x21ef('0x2'))(_0x21ef('0x3'));var moment=require(_0x21ef('0x4'));var BPromise=require(_0x21ef('0x5'));var rp=require(_0x21ef('0x6'));var fs=require('fs');var path=require(_0x21ef('0x7'));var rimraf=require('rimraf');var config=require(_0x21ef('0x8'));var attributes=require(_0x21ef('0x9'));module[_0x21ef('0xa')]=function(_0x10f6b9,_0x3d74f7){return _0x10f6b9[_0x21ef('0xb')](_0x21ef('0xc'),attributes,{'tableName':_0x21ef('0xd'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField',_0x21ef('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd672=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','util','moment'];(function(_0x4f4660,_0xe150f7){var _0x1c2f2e=function(_0x316a5c){while(--_0x316a5c){_0x4f4660['push'](_0x4f4660['shift']());}};_0x1c2f2e(++_0xe150f7);}(_0xd672,0xd0));var _0x2d67=function(_0x10df8e,_0x2b8cb6){_0x10df8e=_0x10df8e-0x0;var _0x5179b0=_0xd672[_0x10df8e];return _0x5179b0;};'use strict';var _=require('lodash');var util=require(_0x2d67('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2d67('0x1'));var BPromise=require(_0x2d67('0x2'));var rp=require(_0x2d67('0x3'));var fs=require('fs');var path=require(_0x2d67('0x4'));var rimraf=require(_0x2d67('0x5'));var config=require(_0x2d67('0x6'));var attributes=require(_0x2d67('0x7'));module[_0x2d67('0x8')]=function(_0x476853,_0x494c2b){return _0x476853['define'](_0x2d67('0x9'),attributes,{'tableName':_0x2d67('0xa'),'paranoid':![],'indexes':[{'name':_0x2d67('0xb'),'fields':[_0x2d67('0xc'),_0x2d67('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 4ad80e0..6c42961 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 _0x8584=['debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','DeskField,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x39157f,_0x3d8c1e){var _0x1ae4e2=function(_0x3429af){while(--_0x3429af){_0x39157f['push'](_0x39157f['shift']());}};_0x1ae4e2(++_0x3d8c1e);}(_0x8584,0x126));var _0x4858=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x8584[_0x122096];return _0x3d1966;};'use strict';var _=require(_0x4858('0x0'));var util=require(_0x4858('0x1'));var moment=require(_0x4858('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4858('0x3'));var db=require(_0x4858('0x4'))['db'];var utils=require(_0x4858('0x5'));var logger=require(_0x4858('0x6'))(_0x4858('0x7'));var config=require(_0x4858('0x8'));var jayson=require(_0x4858('0x9'));var client=jayson['client'][_0x4858('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46dbba,_0x5c5519,_0x5f1246){return new BPromise(function(_0x511516,_0x4e9ab6){return client[_0x4858('0xb')](_0x46dbba,_0x5f1246)[_0x4858('0xc')](function(_0x29d8a8){logger[_0x4858('0xd')]('DeskField,\x20%s,\x20%s',_0x5c5519,'request\x20sent');logger[_0x4858('0xe')](_0x4858('0xf'),_0x5c5519,_0x4858('0x10'),JSON['stringify'](_0x29d8a8));if(_0x29d8a8[_0x4858('0x11')]){if(_0x29d8a8['error'][_0x4858('0x12')]===0x1f4){logger[_0x4858('0x11')](_0x4858('0x13'),_0x5c5519,_0x29d8a8[_0x4858('0x11')][_0x4858('0x14')]);return _0x4e9ab6(_0x29d8a8[_0x4858('0x11')][_0x4858('0x14')]);}logger['error'](_0x4858('0x13'),_0x5c5519,_0x29d8a8['error'][_0x4858('0x14')]);return _0x511516(_0x29d8a8[_0x4858('0x11')][_0x4858('0x14')]);}else{logger['info'](_0x4858('0x13'),_0x5c5519,'request\x20sent');_0x511516(_0x29d8a8[_0x4858('0x15')][_0x4858('0x14')]);}})['catch'](function(_0x2c81b4){logger['error']('DeskField,\x20%s,\x20%s',_0x5c5519,_0x2c81b4);_0x4e9ab6(_0x2c81b4);});});} \ No newline at end of file +var _0xec38=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring'];(function(_0x2687c9,_0x218a66){var _0x1e346a=function(_0x52b018){while(--_0x52b018){_0x2687c9['push'](_0x2687c9['shift']());}};_0x1e346a(++_0x218a66);}(_0xec38,0x123));var _0x8ec3=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0xec38[_0xf16b1];return _0x26f94d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8ec3('0x0'));var BPromise=require(_0x8ec3('0x1'));var rs=require(_0x8ec3('0x2'));var fs=require('fs');var Redis=require(_0x8ec3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8ec3('0x4'));var logger=require(_0x8ec3('0x5'))(_0x8ec3('0x6'));var config=require('../../config/environment');var jayson=require(_0x8ec3('0x7'));var client=jayson[_0x8ec3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf90233,_0x294641,_0xe5b5f5){return new BPromise(function(_0x4e5355,_0x2f7674){return client[_0x8ec3('0x9')](_0xf90233,_0xe5b5f5)[_0x8ec3('0xa')](function(_0x5e78a2){logger[_0x8ec3('0xb')](_0x8ec3('0xc'),_0x294641,_0x8ec3('0xd'));logger[_0x8ec3('0xe')](_0x8ec3('0xf'),_0x294641,_0x8ec3('0xd'),JSON[_0x8ec3('0x10')](_0x5e78a2));if(_0x5e78a2[_0x8ec3('0x11')]){if(_0x5e78a2[_0x8ec3('0x11')]['code']===0x1f4){logger['error'](_0x8ec3('0xc'),_0x294641,_0x5e78a2[_0x8ec3('0x11')][_0x8ec3('0x12')]);return _0x2f7674(_0x5e78a2[_0x8ec3('0x11')][_0x8ec3('0x12')]);}logger[_0x8ec3('0x11')](_0x8ec3('0xc'),_0x294641,_0x5e78a2['error'][_0x8ec3('0x12')]);return _0x4e5355(_0x5e78a2[_0x8ec3('0x11')][_0x8ec3('0x12')]);}else{logger[_0x8ec3('0xb')](_0x8ec3('0xc'),_0x294641,_0x8ec3('0xd'));_0x4e5355(_0x5e78a2[_0x8ec3('0x13')][_0x8ec3('0x12')]);}})[_0x8ec3('0x14')](function(_0xbdaa90){logger[_0x8ec3('0x11')]('DeskField,\x20%s,\x20%s',_0x294641,_0xbdaa90);_0x2f7674(_0xbdaa90);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index f92fda0..38d0bdb 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 _0x6e4e=['../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x6e4e,0x1de));var _0xe6e4=function(_0x11dcf3,_0x277f82){_0x11dcf3=_0x11dcf3-0x0;var _0x57d2d8=_0x6e4e[_0x11dcf3];return _0x57d2d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe6e4('0x0'));var timeout=require(_0xe6e4('0x1'));var express=require(_0xe6e4('0x2'));var router=express[_0xe6e4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe6e4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe6e4('0x5'));var controller=require(_0xe6e4('0x6'));router['get']('/',auth[_0xe6e4('0x7')](),controller[_0xe6e4('0x8')]);router[_0xe6e4('0x9')](_0xe6e4('0xa'),auth[_0xe6e4('0x7')](),controller[_0xe6e4('0xb')]);router[_0xe6e4('0x9')](_0xe6e4('0xc'),auth[_0xe6e4('0x7')](),controller[_0xe6e4('0xd')]);router['get']('/:id/fields',auth[_0xe6e4('0x7')](),controller[_0xe6e4('0xe')]);router[_0xe6e4('0xf')]('/',auth[_0xe6e4('0x7')](),controller[_0xe6e4('0x10')]);router['post'](_0xe6e4('0xc'),auth[_0xe6e4('0x7')](),controller[_0xe6e4('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe6e4('0x12')](_0xe6e4('0xa'),auth[_0xe6e4('0x7')](),controller[_0xe6e4('0x13')]);module[_0xe6e4('0x14')]=router; \ No newline at end of file +var _0x7e54=['/:id/fields','getFields','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x1221cf,_0x46e682){var _0x292d93=function(_0x292e9e){while(--_0x292e9e){_0x1221cf['push'](_0x1221cf['shift']());}};_0x292d93(++_0x46e682);}(_0x7e54,0xf8));var _0x47e5=function(_0x2a9c0c,_0x11aed7){_0x2a9c0c=_0x2a9c0c-0x0;var _0x32c294=_0x7e54[_0x2a9c0c];return _0x32c294;};'use strict';var multer=require(_0x47e5('0x0'));var util=require(_0x47e5('0x1'));var path=require(_0x47e5('0x2'));var timeout=require(_0x47e5('0x3'));var express=require(_0x47e5('0x4'));var router=express[_0x47e5('0x5')]();var fs_extra=require(_0x47e5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x47e5('0x7'));var config=require('../../config/environment');var controller=require(_0x47e5('0x8'));router[_0x47e5('0x9')]('/',auth[_0x47e5('0xa')](),controller[_0x47e5('0xb')]);router[_0x47e5('0x9')](_0x47e5('0xc'),auth[_0x47e5('0xa')](),controller[_0x47e5('0xd')]);router[_0x47e5('0x9')](_0x47e5('0xe'),auth[_0x47e5('0xa')](),controller[_0x47e5('0xf')]);router[_0x47e5('0x9')](_0x47e5('0x10'),auth[_0x47e5('0xa')](),controller[_0x47e5('0x11')]);router['post']('/',auth[_0x47e5('0xa')](),controller[_0x47e5('0x12')]);router['post'](_0x47e5('0xe'),auth[_0x47e5('0xa')](),controller[_0x47e5('0x13')]);router[_0x47e5('0x14')](_0x47e5('0xc'),auth['isAuthenticated'](),controller[_0x47e5('0x15')]);router['delete']('/:id',auth[_0x47e5('0xa')](),controller[_0x47e5('0x16')]);module[_0x47e5('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 2d88ef8..f8461da 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 _0xd5da=['exports','STRING','BOOLEAN','sequelize'];(function(_0x221c0c,_0x1fc9f5){var _0x26922d=function(_0x4a3b31){while(--_0x4a3b31){_0x221c0c['push'](_0x221c0c['shift']());}};_0x26922d(++_0x1fc9f5);}(_0xd5da,0x9f));var _0xad5d=function(_0x5bc406,_0x129c28){_0x5bc406=_0x5bc406-0x0;var _0x1285c3=_0xd5da[_0x5bc406];return _0x1285c3;};'use strict';var Sequelize=require(_0xad5d('0x0'));module[_0xad5d('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xad5d('0x2')]},'password':{'type':Sequelize[_0xad5d('0x2')]},'remoteUri':{'type':Sequelize[_0xad5d('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xad5d('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xad5d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xad5d('0x2')]},'modernAuthentication':{'type':Sequelize[_0xad5d('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x379e=['sequelize','STRING'];(function(_0x158929,_0x20b545){var _0x232e5d=function(_0x4bdb18){while(--_0x4bdb18){_0x158929['push'](_0x158929['shift']());}};_0x232e5d(++_0x20b545);}(_0x379e,0x104));var _0xe379=function(_0x1ac26c,_0x3c2048){_0x1ac26c=_0x1ac26c-0x0;var _0x45a5fb=_0x379e[_0x1ac26c];return _0x45a5fb;};'use strict';var Sequelize=require(_0xe379('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xe379('0x1')]},'remoteUri':{'type':Sequelize[_0xe379('0x1')]},'tenantId':{'type':Sequelize[_0xe379('0x1')]},'clientId':{'type':Sequelize[_0xe379('0x1')]},'clientSecret':{'type':Sequelize[_0xe379('0x1')]},'serverUrl':{'type':Sequelize[_0xe379('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe379('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index dd71bf8..f5f8f6b 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 _0x51a8=['utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','CloudProvider','data7','access_token','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','clientSecret','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','test','statusCode','send',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','../../components/parsers/qs','api','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','end','sendStatus','error','stack','index','map','Dynamics365Account','rawAttributes','fieldName','type','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','getConfigurations','findOne','pick','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','ticketType','incident','Incident','title','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath'];(function(_0x4c1b76,_0x2cdc2d){var _0x3ace6b=function(_0x40fac1){while(--_0x40fac1){_0x4c1b76['push'](_0x4c1b76['shift']());}};_0x3ace6b(++_0x2cdc2d);}(_0x51a8,0xec));var _0x851a=function(_0x2b677e,_0x5d6f61){_0x2b677e=_0x2b677e-0x0;var _0x115efc=_0x51a8[_0x2b677e];return _0x115efc;};'use strict';var rp=require(_0x851a('0x0'));var util=require(_0x851a('0x1'));var _=require('lodash');var qs=require(_0x851a('0x2'));var logger=require('../../config/logger')(_0x851a('0x3'));var db=require('../../mysqldb')['db'];var integrations=require(_0x851a('0x4'));function respondWithResult(_0x3fa2fa,_0x3e62cd){_0x3e62cd=_0x3e62cd||0xc8;return function(_0x284a2c){if(_0x284a2c){return _0x3fa2fa[_0x851a('0x5')](_0x3e62cd)['json'](_0x284a2c);}};}function respondWithFilteredResult(_0x317ead,_0x4775c2){return function(_0x233c96){if(_0x233c96){var _0x2814c6=typeof _0x4775c2[_0x851a('0x6')]===_0x851a('0x7')&&typeof _0x4775c2[_0x851a('0x8')]===_0x851a('0x7');var _0x1c6dd8=_0x233c96['count'];var _0x1e7d17=_0x2814c6?0x0:_0x4775c2[_0x851a('0x6')];var _0x4acfe9=_0x2814c6?_0x233c96[_0x851a('0x9')]:_0x4775c2[_0x851a('0x6')]+_0x4775c2[_0x851a('0x8')];var _0x322616;if(_0x4acfe9>=_0x1c6dd8){_0x4acfe9=_0x1c6dd8;_0x322616=0xc8;}else{_0x322616=0xce;}_0x317ead['status'](_0x322616);return _0x317ead[_0x851a('0xa')](_0x851a('0xb'),_0x1e7d17+'-'+_0x4acfe9+'/'+_0x1c6dd8)[_0x851a('0xc')](_0x233c96);}return null;};}function saveUpdates(_0x171db9){return function(_0x3ef339){if(_0x3ef339){return _0x3ef339[_0x851a('0xd')](_0x171db9)[_0x851a('0xe')](function(_0x25daa2){return _0x25daa2;});}return null;};}function removeEntity(_0x70496b){return function(_0x415cb4){if(_0x415cb4){return _0x415cb4[_0x851a('0xf')]()[_0x851a('0xe')](function(){_0x70496b[_0x851a('0x5')](0xcc)[_0x851a('0x10')]();});}};}function handleEntityNotFound(_0x3b4df8){return function(_0x1f3688){if(!_0x1f3688){_0x3b4df8[_0x851a('0x11')](0x194);}return _0x1f3688;};}function handleError(_0x23a3fc,_0x6c81f6){_0x6c81f6=_0x6c81f6||0x1f4;return function(_0x1a9141){logger[_0x851a('0x12')](_0x1a9141[_0x851a('0x13')]);if(_0x1a9141['name']){delete _0x1a9141['name'];}_0x23a3fc[_0x851a('0x5')](_0x6c81f6)['send'](_0x1a9141);};}exports[_0x851a('0x14')]=function(_0x4cb9a,_0x522e8f){var _0x21e65b={},_0x2fffb1={},_0x40ff8c={'count':0x0,'rows':[]};var _0x265bfc=_[_0x851a('0x15')](db[_0x851a('0x16')][_0x851a('0x17')],function(_0x185dbc){return{'name':_0x185dbc[_0x851a('0x18')],'type':_0x185dbc[_0x851a('0x19')]['key']};});_0x2fffb1[_0x851a('0x1a')]=_[_0x851a('0x15')](_0x265bfc,_0x851a('0x1b'));_0x2fffb1[_0x851a('0x1c')]=_['keys'](_0x4cb9a['query']);_0x2fffb1[_0x851a('0x1d')]=_['intersection'](_0x2fffb1[_0x851a('0x1a')],_0x2fffb1[_0x851a('0x1c')]);_0x21e65b[_0x851a('0x1e')]=_[_0x851a('0x1f')](_0x2fffb1['model'],qs['fields'](_0x4cb9a[_0x851a('0x1c')][_0x851a('0x20')]));_0x21e65b['attributes']=_0x21e65b['attributes'][_0x851a('0x21')]?_0x21e65b[_0x851a('0x1e')]:_0x2fffb1[_0x851a('0x1a')];if(!_0x4cb9a[_0x851a('0x1c')][_0x851a('0x22')]('nolimit')){_0x21e65b['limit']=qs['limit'](_0x4cb9a['query'][_0x851a('0x8')]);_0x21e65b[_0x851a('0x6')]=qs[_0x851a('0x6')](_0x4cb9a[_0x851a('0x1c')][_0x851a('0x6')]);}_0x21e65b[_0x851a('0x23')]=qs[_0x851a('0x24')](_0x4cb9a[_0x851a('0x1c')][_0x851a('0x24')]);_0x21e65b[_0x851a('0x25')]=qs['filters'](_['pick'](_0x4cb9a['query'],_0x2fffb1[_0x851a('0x1d')]),_0x265bfc);if(_0x4cb9a['query'][_0x851a('0x26')]){_0x21e65b[_0x851a('0x25')]=_[_0x851a('0x27')](_0x21e65b[_0x851a('0x25')],{'$or':_[_0x851a('0x15')](_0x265bfc,function(_0x26b232){if(_0x26b232['type']!==_0x851a('0x28')){var _0x260455={};_0x260455[_0x26b232[_0x851a('0x1b')]]={'$like':'%'+_0x4cb9a['query']['filter']+'%'};return _0x260455;}})});}_0x21e65b=_['merge']({},_0x21e65b,_0x4cb9a[_0x851a('0x29')]);var _0x3a049a={'where':_0x21e65b[_0x851a('0x25')]};return db[_0x851a('0x16')][_0x851a('0x9')](_0x3a049a)[_0x851a('0xe')](function(_0x541c22){_0x40ff8c[_0x851a('0x9')]=_0x541c22;if(_0x4cb9a[_0x851a('0x1c')][_0x851a('0x2a')]){_0x21e65b[_0x851a('0x2b')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x851a('0x2c')](_0x21e65b);})[_0x851a('0xe')](function(_0x1ccb58){_0x40ff8c['rows']=_0x1ccb58;return _0x40ff8c;})[_0x851a('0xe')](respondWithFilteredResult(_0x522e8f,_0x21e65b))[_0x851a('0x2d')](handleError(_0x522e8f,null));};exports[_0x851a('0x2e')]=function(_0x567fc2,_0x4a2be0){var _0x3ff91e={'raw':![],'where':{'id':_0x567fc2[_0x851a('0x2f')]['id']}},_0x46303e={};_0x46303e['model']=_[_0x851a('0x30')](db[_0x851a('0x16')][_0x851a('0x17')]);_0x46303e[_0x851a('0x1c')]=_[_0x851a('0x30')](_0x567fc2['query']);_0x46303e[_0x851a('0x1d')]=_[_0x851a('0x1f')](_0x46303e[_0x851a('0x1a')],_0x46303e[_0x851a('0x1c')]);_0x3ff91e[_0x851a('0x1e')]=_[_0x851a('0x1f')](_0x46303e['model'],qs['fields'](_0x567fc2[_0x851a('0x1c')]['fields']));_0x3ff91e['attributes']=_0x3ff91e[_0x851a('0x1e')][_0x851a('0x21')]?_0x3ff91e[_0x851a('0x1e')]:_0x46303e[_0x851a('0x1a')];if(_0x567fc2[_0x851a('0x1c')]['includeAll']){_0x3ff91e['include']=[{'all':!![]}];}_0x3ff91e=_[_0x851a('0x27')]({},_0x3ff91e,_0x567fc2[_0x851a('0x29')]);return db[_0x851a('0x16')][_0x851a('0x31')](_0x3ff91e)['then'](handleEntityNotFound(_0x4a2be0,null))[_0x851a('0xe')](respondWithResult(_0x4a2be0,null))[_0x851a('0x2d')](handleError(_0x4a2be0,null));};exports[_0x851a('0x32')]=function(_0x4e8663,_0x4f6fe9){return db[_0x851a('0x16')][_0x851a('0x32')](_0x4e8663[_0x851a('0x33')],{})[_0x851a('0xe')](respondWithResult(_0x4f6fe9,0xc9))[_0x851a('0x2d')](handleError(_0x4f6fe9,null));};exports['update']=function(_0x4a1abc,_0xc1de2a){if(_0x4a1abc[_0x851a('0x33')]['id']){delete _0x4a1abc[_0x851a('0x33')]['id'];}return db[_0x851a('0x16')]['find']({'where':{'id':_0x4a1abc[_0x851a('0x2f')]['id']}})[_0x851a('0xe')](handleEntityNotFound(_0xc1de2a,null))['then'](saveUpdates(_0x4a1abc[_0x851a('0x33')],null))[_0x851a('0xe')](respondWithResult(_0xc1de2a,null))[_0x851a('0x2d')](handleError(_0xc1de2a,null));};exports[_0x851a('0xf')]=function(_0xb54800,_0x53a8cf){return db['Dynamics365Account'][_0x851a('0x31')]({'where':{'id':_0xb54800[_0x851a('0x2f')]['id']}})[_0x851a('0xe')](handleEntityNotFound(_0x53a8cf,null))[_0x851a('0xe')](removeEntity(_0x53a8cf,null))[_0x851a('0x2d')](handleError(_0x53a8cf,null));};exports[_0x851a('0x34')]=function(_0x16088c,_0xdcd10f){var _0x3a5749={};var _0x127efe={};var _0x333bf6;var _0x554e3d;return db[_0x851a('0x16')][_0x851a('0x35')]({'where':{'id':_0x16088c[_0x851a('0x2f')]['id']}})[_0x851a('0xe')](handleEntityNotFound(_0xdcd10f,null))['then'](function(_0x2d1d9b){if(_0x2d1d9b){_0x333bf6=_0x2d1d9b;_0x127efe['model']=_[_0x851a('0x30')](db['Dynamics365Configuration'][_0x851a('0x17')]);_0x127efe[_0x851a('0x1c')]=_[_0x851a('0x30')](_0x16088c[_0x851a('0x1c')]);_0x127efe[_0x851a('0x1d')]=_[_0x851a('0x1f')](_0x127efe[_0x851a('0x1a')],_0x127efe['query']);_0x3a5749['attributes']=_[_0x851a('0x1f')](_0x127efe[_0x851a('0x1a')],qs['fields'](_0x16088c[_0x851a('0x1c')][_0x851a('0x20')]));_0x3a5749[_0x851a('0x1e')]=_0x3a5749[_0x851a('0x1e')][_0x851a('0x21')]?_0x3a5749[_0x851a('0x1e')]:_0x127efe[_0x851a('0x1a')];_0x3a5749['order']=qs[_0x851a('0x24')](_0x16088c[_0x851a('0x1c')][_0x851a('0x24')]);_0x3a5749[_0x851a('0x25')]=qs['filters'](_[_0x851a('0x36')](_0x16088c[_0x851a('0x1c')],_0x127efe['filters']));if(_0x16088c[_0x851a('0x1c')][_0x851a('0x26')]){_0x3a5749[_0x851a('0x25')]=_['merge'](_0x3a5749[_0x851a('0x25')],{'$or':_[_0x851a('0x15')](_0x3a5749[_0x851a('0x1e')],function(_0x5d21d2){var _0x2378ff={};_0x2378ff[_0x5d21d2]={'$like':'%'+_0x16088c[_0x851a('0x1c')]['filter']+'%'};return _0x2378ff;})});}_0x3a5749=_['merge']({},_0x3a5749,_0x16088c[_0x851a('0x29')]);return _0x333bf6[_0x851a('0x34')](_0x3a5749);}})[_0x851a('0xe')](function(_0x20be0c){if(_0x20be0c){_0x554e3d=_0x20be0c['length'];if(!_0x16088c[_0x851a('0x1c')]['hasOwnProperty'](_0x851a('0x37'))){_0x3a5749['limit']=qs[_0x851a('0x8')](_0x16088c[_0x851a('0x1c')][_0x851a('0x8')]);_0x3a5749[_0x851a('0x6')]=qs['offset'](_0x16088c['query']['offset']);}return _0x333bf6['getConfigurations'](_0x3a5749);}})[_0x851a('0xe')](function(_0x4dbf8){if(_0x4dbf8){return _0x4dbf8?{'count':_0x554e3d,'rows':_0x4dbf8}:null;}})[_0x851a('0xe')](respondWithResult(_0xdcd10f,null))[_0x851a('0x2d')](handleError(_0xdcd10f,null));};exports[_0x851a('0x38')]=function(_0x2ce735,_0x55e1ea){if(_0x2ce735[_0x851a('0x33')]['id']){delete _0x2ce735[_0x851a('0x33')]['id'];}return db[_0x851a('0x16')][_0x851a('0x35')]({'where':{'id':_0x2ce735['params']['id']}})['then'](handleEntityNotFound(_0x55e1ea,null))[_0x851a('0xe')](function(_0x478c0c){if(_0x478c0c){_0x2ce735['body']['AccountId']=_0x478c0c['id'];_0x2ce735[_0x851a('0x33')][_0x851a('0x39')]=integrations[_0x851a('0x3a')](_0x2ce735[_0x851a('0x33')][_0x851a('0x3b')],_0x2ce735[_0x851a('0x33')][_0x851a('0x19')]);_0x2ce735[_0x851a('0x33')][_0x851a('0x3c')]=integrations[_0x851a('0x3d')](_0x2ce735['body'][_0x851a('0x3b')],_0x2ce735[_0x851a('0x33')][_0x851a('0x19')]);return db['Dynamics365Configuration']['create'](_0x2ce735[_0x851a('0x33')],{'include':[{'model':db[_0x851a('0x3e')],'as':'Subjects'},{'model':db[_0x851a('0x3e')],'as':'Descriptions'}]});}return null;})[_0x851a('0xe')](respondWithResult(_0x55e1ea,null))[_0x851a('0x2d')](handleError(_0x55e1ea,null));};function sanitizeRemoteUri(_0x484780){var _0x3746c9=_0x484780[_0x851a('0x3f')](-0x1);if(_0x3746c9==='/')return _0x484780[_0x851a('0x40')](0x0,_0x484780[_0x851a('0x41')](_0x3746c9));return _0x484780;}function getWebApiUrl(_0x1a52c6){return util[_0x851a('0x42')]('%s/api/data/v9.0/',_0x1a52c6);}exports['getFields']=function(_0x37690a,_0x39518d){var _0x3a5f38=_0x37690a[_0x851a('0x1c')][_0x851a('0x43')];var _0x2a60f2=_0x3a5f38===_0x851a('0x44')?_0x851a('0x45'):'PhoneCall';var _0x3ba5f0='';var _0x47566a='';var _0x7e1456='';var _0x2da341='';var _0x38cc51='';var _0x26ed74='';var _0x809d0c='';var _0x3f8fb7='';var _0xd6698d=[_0x851a('0x46'),'description',_0x851a('0x47'),_0x851a('0x48'),_0x851a('0x49'),_0x851a('0x4a'),'phonenumber',_0x851a('0x4b'),_0x851a('0x4c'),_0x851a('0x4d')];var _0xc5c4f4=[_0x851a('0x4e'),'accountidyominame',_0x851a('0x4f'),_0x851a('0x50'),_0x851a('0x51'),_0x851a('0x52'),'contractdetailidname',_0x851a('0x53'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0x851a('0x54'),_0x851a('0x55'),_0x851a('0x56'),'createdonbehalfbyname',_0x851a('0x57'),_0x851a('0x58'),_0x851a('0x59'),_0x851a('0x5a'),_0x851a('0x5b'),_0x851a('0x5c'),'entityimage_timestamp',_0x851a('0x5d'),_0x851a('0x5e'),_0x851a('0x5f'),_0x851a('0x60'),'followupby',_0x851a('0x61'),_0x851a('0x62'),_0x851a('0x63'),_0x851a('0x64'),_0x851a('0x65'),'modifiedbyexternalpartyname',_0x851a('0x66'),_0x851a('0x67'),_0x851a('0x68'),_0x851a('0x69'),_0x851a('0x6a'),_0x851a('0x6b'),_0x851a('0x6c'),_0x851a('0x6d'),_0x851a('0x6e'),'onholdtime',_0x851a('0x6f'),'owneridname','owneridtype','owneridyominame',_0x851a('0x70'),_0x851a('0x71'),_0x851a('0x72'),_0x851a('0x73'),_0x851a('0x74'),'productserialnumber',_0x851a('0x75'),_0x851a('0x76'),_0x851a('0x77'),'responsiblecontactidname',_0x851a('0x78'),_0x851a('0x79'),_0x851a('0x7a'),'slaname',_0x851a('0x7b'),'statecode',_0x851a('0x7c'),_0x851a('0x7d'),_0x851a('0x7e'),_0x851a('0x7f'),_0x851a('0x80'),_0x851a('0x81'),_0x851a('0x82'),_0x851a('0x83')];var _0x237934=_0xd6698d[_0x851a('0x84')](_0xc5c4f4);return db['Dynamics365Account'][_0x851a('0x35')]({'where':{'id':_0x37690a[_0x851a('0x2f')]['id']},'attributes':['id',_0x851a('0x85'),_0x851a('0x86'),_0x851a('0x87'),'tenantId','clientId','clientSecret','modernAuthentication'],'include':[{'model':db[_0x851a('0x88')],'as':_0x851a('0x88'),'attributes':['id','data5',_0x851a('0x89')]}]})[_0x851a('0xe')](handleEntityNotFound(_0x39518d,null))['then'](function(_0x510ed2){if(_0x510ed2){if(_0x510ed2['modernAuthentication']){_0x510ed2[_0x851a('0x8a')]=_0x510ed2['CloudProvider']['data5'];_0x3f8fb7=sanitizeRemoteUri(_0x510ed2[_0x851a('0x88')][_0x851a('0x89')]);_0x809d0c=getWebApiUrl(_0x3f8fb7);return _0x510ed2;}_0x3f8fb7=sanitizeRemoteUri(_0x510ed2['remoteUri']);_0x809d0c=getWebApiUrl(_0x3f8fb7);var _0x33588b={'method':'POST','uri':_0x851a('0x8b')+_0x510ed2[_0x851a('0x8c')]+_0x851a('0x8d'),'form':{'client_id':_0x510ed2[_0x851a('0x8e')],'resource':_0x3f8fb7,'username':_0x510ed2[_0x851a('0x85')],'password':_0x510ed2[_0x851a('0x86')],'grant_type':_0x851a('0x86'),'client_secret':_0x510ed2[_0x851a('0x8f')]},'json':!![]};return rp(_0x33588b);}})[_0x851a('0xe')](function(_0x3789b7){_0x26ed74=_0x3789b7['access_token'];var _0x592a16={'method':'GET','uri':encodeURI(_0x809d0c+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x2a60f2+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x26ed74,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x592a16);})[_0x851a('0xe')](function(_0x2ca557){var _0x92671f=_0x2ca557[_0x851a('0x90')][0x0];var _0x5f236a=_0x92671f[_0x851a('0x91')];var _0x5e4917={'method':_0x851a('0x92'),'uri':_0x809d0c+_0x851a('0x93')+_0x5f236a+_0x851a('0x94'),'headers':{'Authorization':_0x851a('0x95')+_0x26ed74,'If-None-Match':null,'OData-Version':_0x851a('0x96')},'json':!![]};return rp(_0x5e4917);})[_0x851a('0xe')](function(_0x25af17){_0x3ba5f0=_0x25af17;_0x47566a=_0x3ba5f0[_0x851a('0x97')];_0x47566a=_[_0x851a('0x98')](_0x47566a,function(_0xd78c4f){return!_0x237934[_0x851a('0x99')](_0xd78c4f['LogicalName']);});var _0x2827c8=[];var _0x31665f=[];_0x47566a[_0x851a('0x9a')](function(_0x1411c1){if(_0x1411c1[_0x851a('0x9b')]){var _0x512b8b=_0x1411c1[_0x851a('0x9b')][_0x851a('0x40')](_0x1411c1[_0x851a('0x9b')][_0x851a('0x41')]('.')+0x1);if(_0x512b8b===_0x851a('0x9c')){_0x2827c8[_0x851a('0x9d')](getSelectList(_0x809d0c,_0x3a5f38,_0x31665f,_0x3ba5f0[_0x851a('0x91')],_0x1411c1[_0x851a('0x91')],_0x26ed74));}}});return Promise[_0x851a('0x9e')](_0x2827c8);})[_0x851a('0xe')](function(_0x2f2ebc){_0x7e1456=_0x2f2ebc[0x0];var _0x1503a3=[];var _0x249e7f=[];_0x47566a['forEach'](function(_0x515a7d){if(!_[_0x851a('0x9f')](_0x515a7d[_0x851a('0x9b')])){var _0x1599b5=_0x515a7d[_0x851a('0x9b')]['substring'](_0x515a7d[_0x851a('0x9b')][_0x851a('0x41')]('.')+0x1);if(_0x1599b5==='BooleanAttributeMetadata'){_0x1503a3[_0x851a('0x9d')](getBooleanList(_0x809d0c,_0x3a5f38,_0x249e7f,_0x3ba5f0['MetadataId'],_0x515a7d['MetadataId'],_0x26ed74));}}});return Promise[_0x851a('0x9e')](_0x1503a3);})['then'](function(_0x1c6e4c){_0x2da341=_0x1c6e4c[0x0];var _0x167aef=[];var _0xf3ba83=[];_0x47566a[_0x851a('0x9a')](function(_0x915faf){if(_0x915faf['@odata.type']){var _0x1402de=_0x915faf[_0x851a('0x9b')]['substring'](_0x915faf['@odata.type']['lastIndexOf']('.')+0x1);if(_0x1402de===_0x851a('0xa0')||_0x1402de==='DoubleAttributeMetadata'||_0x1402de===_0x851a('0xa1')||_0x1402de===_0x851a('0xa2')||_0x1402de==='MemoAttributeMetadata'||_0x1402de===_0x851a('0xa3')||_0x1402de===_0x851a('0xa4')||_0x1402de==='EntityNameAttributeMetadata'||_0x1402de===_0x851a('0xa5')||_0x1402de==='DecimalAttributeMetadata'){_0x167aef[_0x851a('0x9d')](getInputList(_0x809d0c,_0x3a5f38,_0x1402de,_0xf3ba83,_0x3ba5f0[_0x851a('0x91')],_0x915faf[_0x851a('0x91')],_0x26ed74));}}});return Promise['all'](_0x167aef);})[_0x851a('0xe')](function(_0x4507b2){_0x38cc51=_0x4507b2[0x0];var _0x2a878a=_0x7e1456[_0x851a('0x84')](_0x2da341)[_0x851a('0x84')](_0x38cc51);var _0x582b29={'count':_0x2a878a[_0x851a('0x21')],'rows':_0x2a878a};return _0x582b29;})[_0x851a('0xe')](respondWithResult(_0x39518d,null))[_0x851a('0x2d')](function(_0x225141){var _0x281ad8=_0x37690a[_0x851a('0x1c')][_0x851a('0xa6')]?0x1f4:_0x225141[_0x851a('0xa7')]||0x1f4;logger['error'](_0x225141['stack']);delete _0x225141[_0x851a('0x1b')];if(_0x281ad8===0x191){_0x281ad8=0x190;}_0x39518d[_0x851a('0x5')](_0x281ad8)[_0x851a('0xa8')](_0x37690a[_0x851a('0x1c')][_0x851a('0xa6')]?{'message':'Wrong\x20credentials','statusCode':_0x225141[_0x851a('0xa7')]}:_0x225141);});};function getSelectList(_0x46f4f6,_0x36bf8f,_0x7ea8f9,_0x4efcd9,_0x3602a3,_0x2027cb){var _0x2dd6a9={'method':_0x851a('0x92'),'uri':_0x46f4f6+'EntityDefinitions('+_0x4efcd9+_0x851a('0xa9')+_0x3602a3+_0x851a('0xaa')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x2027cb,'If-None-Match':null,'OData-Version':_0x851a('0x96')},'json':!![]};return rp(_0x2dd6a9)[_0x851a('0xe')](function(_0x1720f7){var _0x23ae61=[];var _0x1950db=_0x1720f7[_0x851a('0xab')]['Options'];_0x1950db['forEach'](function(_0x40c783){_0x23ae61['push']({'name':_0x40c783[_0x851a('0xac')][_0x851a('0xad')][_0x851a('0xac')],'value':String(_0x40c783[_0x851a('0xae')])});});var _0x1bb0ea={'id':_0x36bf8f+'_'+_0x1720f7[_0x851a('0xaf')],'name':_0x1720f7[_0x851a('0xb0')]['UserLocalizedLabel'][_0x851a('0xac')],'custom':![],'options':_0x23ae61};_0x7ea8f9['push'](_0x1bb0ea);return _0x7ea8f9;});}function getBooleanList(_0x156d15,_0x5e258e,_0x256443,_0x67f7d9,_0x47f602,_0x238761){var _0x5aa4c1={'method':_0x851a('0x92'),'uri':_0x156d15+_0x851a('0x93')+_0x67f7d9+')/Attributes('+_0x47f602+_0x851a('0xb1'),'headers':{'Authorization':'Bearer\x20'+_0x238761,'If-None-Match':null,'OData-Version':_0x851a('0x96')},'json':!![]};return rp(_0x5aa4c1)['then'](function(_0x4eb0b8){var _0xcd79e3=[];_0xcd79e3[_0x851a('0x9d')]({'name':_0x4eb0b8[_0x851a('0xab')]['TrueOption'][_0x851a('0xac')][_0x851a('0xad')][_0x851a('0xac')],'value':_0x851a('0xb2')},{'name':_0x4eb0b8[_0x851a('0xab')][_0x851a('0xb3')][_0x851a('0xac')][_0x851a('0xad')][_0x851a('0xac')],'value':_0x851a('0xb4')});var _0x39d877={'id':_0x5e258e+'_'+_0x4eb0b8[_0x851a('0xaf')],'name':_0x4eb0b8[_0x851a('0xb0')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0xcd79e3};_0x256443['push'](_0x39d877);return _0x256443;});}function getInputList(_0x5bb746,_0x34e7e,_0xda6b34,_0x19feb4,_0x3d4cd0,_0x730b33,_0x3e3e14){var _0x27e95b={'method':_0x851a('0x92'),'uri':_0x5bb746+_0x851a('0x93')+_0x3d4cd0+_0x851a('0xa9')+_0x730b33+_0x851a('0xb5')+_0xda6b34+_0x851a('0xb6'),'headers':{'Authorization':_0x851a('0x95')+_0x3e3e14,'If-None-Match':null,'OData-Version':_0x851a('0x96')},'json':!![]};return rp(_0x27e95b)[_0x851a('0xe')](function(_0x53cc91){var _0x4c09ad={'id':_0x34e7e+'_'+_0x53cc91['LogicalName'],'name':_0x53cc91[_0x851a('0xb0')]['UserLocalizedLabel']?_0x53cc91[_0x851a('0xb0')][_0x851a('0xad')][_0x851a('0xac')]:_0x53cc91[_0x851a('0xaf')],'custom':![],'options':[]};_0x19feb4[_0x851a('0x9d')](_0x4c09ad);return _0x19feb4;});} \ No newline at end of file +var _0x7c63=['versionnumber','username','tenantId','modernAuthentication','CloudProvider','data5','access_token','data7','remoteUri','POST','https://login.microsoftonline.com/','clientId','password','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','isNil','all','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','concat','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','show','length','find','catch','body','params','getConfigurations','findOne','Dynamics365Configuration','pick','AccountId','Subjects','channel','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','parentcaseidname','primarycontactidyominame','prioritycodename','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode'];(function(_0x208385,_0x18fe7b){var _0x206f35=function(_0x55905a){while(--_0x55905a){_0x208385['push'](_0x208385['shift']());}};_0x206f35(++_0x18fe7b);}(_0x7c63,0xf3));var _0x37c6=function(_0x22d617,_0x1e93fd){_0x22d617=_0x22d617-0x0;var _0xe5136e=_0x7c63[_0x22d617];return _0xe5136e;};'use strict';var rp=require(_0x37c6('0x0'));var util=require(_0x37c6('0x1'));var _=require(_0x37c6('0x2'));var qs=require(_0x37c6('0x3'));var logger=require('../../config/logger')(_0x37c6('0x4'));var db=require(_0x37c6('0x5'))['db'];var integrations=require(_0x37c6('0x6'));function respondWithResult(_0x4c6e48,_0x1154f3){_0x1154f3=_0x1154f3||0xc8;return function(_0x4d75dc){if(_0x4d75dc){return _0x4c6e48[_0x37c6('0x7')](_0x1154f3)[_0x37c6('0x8')](_0x4d75dc);}};}function respondWithFilteredResult(_0x4d8401,_0x3685c7){return function(_0x317414){if(_0x317414){var _0x245a44=typeof _0x3685c7[_0x37c6('0x9')]===_0x37c6('0xa')&&typeof _0x3685c7['limit']===_0x37c6('0xa');var _0x79485a=_0x317414[_0x37c6('0xb')];var _0x488e3d=_0x245a44?0x0:_0x3685c7[_0x37c6('0x9')];var _0x3bd170=_0x245a44?_0x317414[_0x37c6('0xb')]:_0x3685c7['offset']+_0x3685c7[_0x37c6('0xc')];var _0x421dd9;if(_0x3bd170>=_0x79485a){_0x3bd170=_0x79485a;_0x421dd9=0xc8;}else{_0x421dd9=0xce;}_0x4d8401[_0x37c6('0x7')](_0x421dd9);return _0x4d8401[_0x37c6('0xd')](_0x37c6('0xe'),_0x488e3d+'-'+_0x3bd170+'/'+_0x79485a)[_0x37c6('0x8')](_0x317414);}return null;};}function saveUpdates(_0x502818){return function(_0x527fab){if(_0x527fab){return _0x527fab[_0x37c6('0xf')](_0x502818)[_0x37c6('0x10')](function(_0x1d01aa){return _0x1d01aa;});}return null;};}function removeEntity(_0x25fa38){return function(_0x582d4b){if(_0x582d4b){return _0x582d4b[_0x37c6('0x11')]()[_0x37c6('0x10')](function(){_0x25fa38['status'](0xcc)[_0x37c6('0x12')]();});}};}function handleEntityNotFound(_0x1def07){return function(_0x1b6bd2){if(!_0x1b6bd2){_0x1def07[_0x37c6('0x13')](0x194);}return _0x1b6bd2;};}function handleError(_0x4effa3,_0x1060ae){_0x1060ae=_0x1060ae||0x1f4;return function(_0x1605e7){logger[_0x37c6('0x14')](_0x1605e7[_0x37c6('0x15')]);if(_0x1605e7[_0x37c6('0x16')]){delete _0x1605e7['name'];}_0x4effa3[_0x37c6('0x7')](_0x1060ae)[_0x37c6('0x17')](_0x1605e7);};}exports[_0x37c6('0x18')]=function(_0x5000e0,_0x581089){var _0x474a4c={},_0x39c0a4={},_0x1ca1f2={'count':0x0,'rows':[]};var _0x319948=_[_0x37c6('0x19')](db[_0x37c6('0x1a')][_0x37c6('0x1b')],function(_0x2c19c7){return{'name':_0x2c19c7['fieldName'],'type':_0x2c19c7['type'][_0x37c6('0x1c')]};});_0x39c0a4[_0x37c6('0x1d')]=_['map'](_0x319948,'name');_0x39c0a4[_0x37c6('0x1e')]=_[_0x37c6('0x1f')](_0x5000e0[_0x37c6('0x1e')]);_0x39c0a4[_0x37c6('0x20')]=_[_0x37c6('0x21')](_0x39c0a4[_0x37c6('0x1d')],_0x39c0a4[_0x37c6('0x1e')]);_0x474a4c[_0x37c6('0x22')]=_['intersection'](_0x39c0a4[_0x37c6('0x1d')],qs[_0x37c6('0x23')](_0x5000e0['query'][_0x37c6('0x23')]));_0x474a4c[_0x37c6('0x22')]=_0x474a4c[_0x37c6('0x22')]['length']?_0x474a4c[_0x37c6('0x22')]:_0x39c0a4['model'];if(!_0x5000e0['query'][_0x37c6('0x24')](_0x37c6('0x25'))){_0x474a4c[_0x37c6('0xc')]=qs[_0x37c6('0xc')](_0x5000e0[_0x37c6('0x1e')][_0x37c6('0xc')]);_0x474a4c[_0x37c6('0x9')]=qs[_0x37c6('0x9')](_0x5000e0['query']['offset']);}_0x474a4c[_0x37c6('0x26')]=qs[_0x37c6('0x27')](_0x5000e0['query'][_0x37c6('0x27')]);_0x474a4c[_0x37c6('0x28')]=qs[_0x37c6('0x20')](_['pick'](_0x5000e0['query'],_0x39c0a4['filters']),_0x319948);if(_0x5000e0['query'][_0x37c6('0x29')]){_0x474a4c[_0x37c6('0x28')]=_[_0x37c6('0x2a')](_0x474a4c[_0x37c6('0x28')],{'$or':_[_0x37c6('0x19')](_0x319948,function(_0x37f584){if(_0x37f584[_0x37c6('0x2b')]!==_0x37c6('0x2c')){var _0x5e15c8={};_0x5e15c8[_0x37f584[_0x37c6('0x16')]]={'$like':'%'+_0x5000e0[_0x37c6('0x1e')][_0x37c6('0x29')]+'%'};return _0x5e15c8;}})});}_0x474a4c=_['merge']({},_0x474a4c,_0x5000e0[_0x37c6('0x2d')]);var _0x3d3792={'where':_0x474a4c[_0x37c6('0x28')]};return db[_0x37c6('0x1a')][_0x37c6('0xb')](_0x3d3792)['then'](function(_0x118f8b){_0x1ca1f2[_0x37c6('0xb')]=_0x118f8b;if(_0x5000e0['query'][_0x37c6('0x2e')]){_0x474a4c['include']=[{'all':!![]}];}return db[_0x37c6('0x1a')][_0x37c6('0x2f')](_0x474a4c);})[_0x37c6('0x10')](function(_0x2f6fc0){_0x1ca1f2['rows']=_0x2f6fc0;return _0x1ca1f2;})[_0x37c6('0x10')](respondWithFilteredResult(_0x581089,_0x474a4c))['catch'](handleError(_0x581089,null));};exports[_0x37c6('0x30')]=function(_0x2f4373,_0x28ce64){var _0x56954e={'raw':![],'where':{'id':_0x2f4373['params']['id']}},_0x5d22b5={};_0x5d22b5[_0x37c6('0x1d')]=_['keys'](db[_0x37c6('0x1a')][_0x37c6('0x1b')]);_0x5d22b5[_0x37c6('0x1e')]=_[_0x37c6('0x1f')](_0x2f4373[_0x37c6('0x1e')]);_0x5d22b5['filters']=_[_0x37c6('0x21')](_0x5d22b5[_0x37c6('0x1d')],_0x5d22b5[_0x37c6('0x1e')]);_0x56954e[_0x37c6('0x22')]=_[_0x37c6('0x21')](_0x5d22b5[_0x37c6('0x1d')],qs[_0x37c6('0x23')](_0x2f4373[_0x37c6('0x1e')][_0x37c6('0x23')]));_0x56954e[_0x37c6('0x22')]=_0x56954e[_0x37c6('0x22')][_0x37c6('0x31')]?_0x56954e[_0x37c6('0x22')]:_0x5d22b5[_0x37c6('0x1d')];if(_0x2f4373[_0x37c6('0x1e')][_0x37c6('0x2e')]){_0x56954e['include']=[{'all':!![]}];}_0x56954e=_[_0x37c6('0x2a')]({},_0x56954e,_0x2f4373[_0x37c6('0x2d')]);return db[_0x37c6('0x1a')][_0x37c6('0x32')](_0x56954e)['then'](handleEntityNotFound(_0x28ce64,null))[_0x37c6('0x10')](respondWithResult(_0x28ce64,null))[_0x37c6('0x33')](handleError(_0x28ce64,null));};exports['create']=function(_0xe600a5,_0x220b1b){return db[_0x37c6('0x1a')]['create'](_0xe600a5[_0x37c6('0x34')],{})[_0x37c6('0x10')](respondWithResult(_0x220b1b,0xc9))['catch'](handleError(_0x220b1b,null));};exports[_0x37c6('0xf')]=function(_0x12951d,_0x320610){if(_0x12951d['body']['id']){delete _0x12951d['body']['id'];}return db['Dynamics365Account'][_0x37c6('0x32')]({'where':{'id':_0x12951d[_0x37c6('0x35')]['id']}})[_0x37c6('0x10')](handleEntityNotFound(_0x320610,null))[_0x37c6('0x10')](saveUpdates(_0x12951d['body'],null))[_0x37c6('0x10')](respondWithResult(_0x320610,null))[_0x37c6('0x33')](handleError(_0x320610,null));};exports['destroy']=function(_0x4bedc7,_0x421b94){return db[_0x37c6('0x1a')][_0x37c6('0x32')]({'where':{'id':_0x4bedc7[_0x37c6('0x35')]['id']}})[_0x37c6('0x10')](handleEntityNotFound(_0x421b94,null))[_0x37c6('0x10')](removeEntity(_0x421b94,null))['catch'](handleError(_0x421b94,null));};exports[_0x37c6('0x36')]=function(_0x1adc89,_0x563919){var _0x919875={};var _0x3327b3={};var _0x298ad4;var _0x2b7a03;return db['Dynamics365Account'][_0x37c6('0x37')]({'where':{'id':_0x1adc89[_0x37c6('0x35')]['id']}})['then'](handleEntityNotFound(_0x563919,null))['then'](function(_0x2451cb){if(_0x2451cb){_0x298ad4=_0x2451cb;_0x3327b3['model']=_[_0x37c6('0x1f')](db[_0x37c6('0x38')][_0x37c6('0x1b')]);_0x3327b3[_0x37c6('0x1e')]=_[_0x37c6('0x1f')](_0x1adc89['query']);_0x3327b3[_0x37c6('0x20')]=_[_0x37c6('0x21')](_0x3327b3['model'],_0x3327b3[_0x37c6('0x1e')]);_0x919875[_0x37c6('0x22')]=_[_0x37c6('0x21')](_0x3327b3[_0x37c6('0x1d')],qs['fields'](_0x1adc89['query'][_0x37c6('0x23')]));_0x919875[_0x37c6('0x22')]=_0x919875['attributes'][_0x37c6('0x31')]?_0x919875['attributes']:_0x3327b3['model'];_0x919875[_0x37c6('0x26')]=qs['sort'](_0x1adc89[_0x37c6('0x1e')][_0x37c6('0x27')]);_0x919875['where']=qs[_0x37c6('0x20')](_[_0x37c6('0x39')](_0x1adc89[_0x37c6('0x1e')],_0x3327b3[_0x37c6('0x20')]));if(_0x1adc89[_0x37c6('0x1e')][_0x37c6('0x29')]){_0x919875[_0x37c6('0x28')]=_[_0x37c6('0x2a')](_0x919875[_0x37c6('0x28')],{'$or':_[_0x37c6('0x19')](_0x919875[_0x37c6('0x22')],function(_0x25955e){var _0x2cb3b1={};_0x2cb3b1[_0x25955e]={'$like':'%'+_0x1adc89[_0x37c6('0x1e')][_0x37c6('0x29')]+'%'};return _0x2cb3b1;})});}_0x919875=_[_0x37c6('0x2a')]({},_0x919875,_0x1adc89[_0x37c6('0x2d')]);return _0x298ad4['getConfigurations'](_0x919875);}})['then'](function(_0x14e605){if(_0x14e605){_0x2b7a03=_0x14e605[_0x37c6('0x31')];if(!_0x1adc89[_0x37c6('0x1e')]['hasOwnProperty']('nolimit')){_0x919875[_0x37c6('0xc')]=qs['limit'](_0x1adc89[_0x37c6('0x1e')][_0x37c6('0xc')]);_0x919875[_0x37c6('0x9')]=qs['offset'](_0x1adc89['query'][_0x37c6('0x9')]);}return _0x298ad4[_0x37c6('0x36')](_0x919875);}})[_0x37c6('0x10')](function(_0x3085c4){if(_0x3085c4){return _0x3085c4?{'count':_0x2b7a03,'rows':_0x3085c4}:null;}})[_0x37c6('0x10')](respondWithResult(_0x563919,null))[_0x37c6('0x33')](handleError(_0x563919,null));};exports['addConfiguration']=function(_0x11aa10,_0x51ee53){if(_0x11aa10[_0x37c6('0x34')]['id']){delete _0x11aa10[_0x37c6('0x34')]['id'];}return db[_0x37c6('0x1a')][_0x37c6('0x37')]({'where':{'id':_0x11aa10['params']['id']}})[_0x37c6('0x10')](handleEntityNotFound(_0x51ee53,null))[_0x37c6('0x10')](function(_0x3d1553){if(_0x3d1553){_0x11aa10['body'][_0x37c6('0x3a')]=_0x3d1553['id'];_0x11aa10[_0x37c6('0x34')][_0x37c6('0x3b')]=integrations['getSubjects'](_0x11aa10[_0x37c6('0x34')][_0x37c6('0x3c')],_0x11aa10[_0x37c6('0x34')][_0x37c6('0x2b')]);_0x11aa10[_0x37c6('0x34')]['Descriptions']=integrations['getDescriptions'](_0x11aa10[_0x37c6('0x34')][_0x37c6('0x3c')],_0x11aa10[_0x37c6('0x34')][_0x37c6('0x2b')]);return db[_0x37c6('0x38')]['create'](_0x11aa10[_0x37c6('0x34')],{'include':[{'model':db[_0x37c6('0x3d')],'as':_0x37c6('0x3b')},{'model':db[_0x37c6('0x3d')],'as':_0x37c6('0x3e')}]});}return null;})['then'](respondWithResult(_0x51ee53,null))['catch'](handleError(_0x51ee53,null));};function sanitizeRemoteUri(_0x22beee){var _0x366faa=_0x22beee[_0x37c6('0x3f')](-0x1);if(_0x366faa==='/')return _0x22beee[_0x37c6('0x40')](0x0,_0x22beee[_0x37c6('0x41')](_0x366faa));return _0x22beee;}function getWebApiUrl(_0x24f1fa){return util[_0x37c6('0x42')](_0x37c6('0x43'),_0x24f1fa);}exports['getFields']=function(_0x385cd4,_0x933161){var _0x359728=_0x385cd4[_0x37c6('0x1e')][_0x37c6('0x44')];var _0x25b85d=_0x359728===_0x37c6('0x45')?_0x37c6('0x46'):_0x37c6('0x47');var _0x3d7731='';var _0xaa7f25='';var _0x3f384d='';var _0x31ae1e='';var _0xb2bbe6='';var _0x25b20b='';var _0x3d7c91='';var _0x1aeaca='';var _0x53f36a=[_0x37c6('0x48'),'description',_0x37c6('0x49'),_0x37c6('0x4a'),_0x37c6('0x4b'),'subject',_0x37c6('0x4c'),_0x37c6('0x4d'),_0x37c6('0x4e'),_0x37c6('0x4f')];var _0x224cdd=['accountidname','accountidyominame','actualserviceunits',_0x37c6('0x50'),_0x37c6('0x51'),_0x37c6('0x52'),_0x37c6('0x53'),'contractidname',_0x37c6('0x54'),_0x37c6('0x55'),_0x37c6('0x56'),_0x37c6('0x57'),'createdon',_0x37c6('0x58'),'createdonbehalfbyyominame','customeridname',_0x37c6('0x59'),_0x37c6('0x5a'),_0x37c6('0x5b'),_0x37c6('0x5c'),_0x37c6('0x5d'),_0x37c6('0x5e'),_0x37c6('0x5f'),_0x37c6('0x60'),_0x37c6('0x61'),_0x37c6('0x62'),_0x37c6('0x63'),_0x37c6('0x64'),_0x37c6('0x65'),_0x37c6('0x66'),_0x37c6('0x67'),_0x37c6('0x68'),'modifiedbyexternalpartyyominame',_0x37c6('0x69'),_0x37c6('0x6a'),'modifiedon',_0x37c6('0x6b'),_0x37c6('0x6c'),_0x37c6('0x6d'),_0x37c6('0x6e'),'numberofchildincidents',_0x37c6('0x6f'),_0x37c6('0x70'),_0x37c6('0x71'),'owneridtype','owneridyominame',_0x37c6('0x72'),'primarycontactidname',_0x37c6('0x73'),_0x37c6('0x74'),'productidname','productserialnumber',_0x37c6('0x75'),_0x37c6('0x76'),_0x37c6('0x77'),'responsiblecontactidname',_0x37c6('0x78'),_0x37c6('0x79'),_0x37c6('0x7a'),_0x37c6('0x7b'),_0x37c6('0x7c'),_0x37c6('0x7d'),_0x37c6('0x7e'),_0x37c6('0x7f'),_0x37c6('0x80'),_0x37c6('0x81'),_0x37c6('0x82'),_0x37c6('0x83'),_0x37c6('0x84'),_0x37c6('0x85')];var _0x1cd380=_0x53f36a['concat'](_0x224cdd);return db[_0x37c6('0x1a')][_0x37c6('0x37')]({'where':{'id':_0x385cd4[_0x37c6('0x35')]['id']},'attributes':['id',_0x37c6('0x86'),'password','remoteUri',_0x37c6('0x87'),'clientId','clientSecret',_0x37c6('0x88')],'include':[{'model':db['CloudProvider'],'as':_0x37c6('0x89'),'attributes':['id',_0x37c6('0x8a'),'data7']}]})[_0x37c6('0x10')](handleEntityNotFound(_0x933161,null))[_0x37c6('0x10')](function(_0x4335eb){if(_0x4335eb){if(_0x4335eb[_0x37c6('0x88')]){_0x4335eb[_0x37c6('0x8b')]=_0x4335eb[_0x37c6('0x89')][_0x37c6('0x8a')];_0x1aeaca=sanitizeRemoteUri(_0x4335eb[_0x37c6('0x89')][_0x37c6('0x8c')]);_0x3d7c91=getWebApiUrl(_0x1aeaca);return _0x4335eb;}_0x1aeaca=sanitizeRemoteUri(_0x4335eb[_0x37c6('0x8d')]);_0x3d7c91=getWebApiUrl(_0x1aeaca);var _0x369d0f={'method':_0x37c6('0x8e'),'uri':_0x37c6('0x8f')+_0x4335eb[_0x37c6('0x87')]+'/oauth2/token','form':{'client_id':_0x4335eb[_0x37c6('0x90')],'resource':_0x1aeaca,'username':_0x4335eb['username'],'password':_0x4335eb[_0x37c6('0x91')],'grant_type':'password','client_secret':_0x4335eb[_0x37c6('0x92')]},'json':!![]};return rp(_0x369d0f);}})['then'](function(_0x4fea4c){_0x25b20b=_0x4fea4c['access_token'];var _0x5d8054={'method':_0x37c6('0x93'),'uri':encodeURI(_0x3d7c91+_0x37c6('0x94')+_0x25b85d+'\x27'),'headers':{'Authorization':_0x37c6('0x95')+_0x25b20b,'If-None-Match':null,'OData-Version':_0x37c6('0x96')},'json':!![]};return rp(_0x5d8054);})[_0x37c6('0x10')](function(_0x59ca3b){var _0x3673e0=_0x59ca3b[_0x37c6('0x97')][0x0];var _0x5898af=_0x3673e0[_0x37c6('0x98')];var _0x42caa2={'method':_0x37c6('0x93'),'uri':_0x3d7c91+_0x37c6('0x99')+_0x5898af+_0x37c6('0x9a'),'headers':{'Authorization':_0x37c6('0x95')+_0x25b20b,'If-None-Match':null,'OData-Version':_0x37c6('0x96')},'json':!![]};return rp(_0x42caa2);})['then'](function(_0x39bf4c){_0x3d7731=_0x39bf4c;_0xaa7f25=_0x3d7731['Attributes'];_0xaa7f25=_['remove'](_0xaa7f25,function(_0xf4b7c){return!_0x1cd380[_0x37c6('0x9b')](_0xf4b7c[_0x37c6('0x9c')]);});var _0x5a9c80=[];var _0x5be242=[];_0xaa7f25[_0x37c6('0x9d')](function(_0x2923ba){if(_0x2923ba['@odata.type']){var _0x3dfbf8=_0x2923ba[_0x37c6('0x9e')][_0x37c6('0x40')](_0x2923ba[_0x37c6('0x9e')][_0x37c6('0x41')]('.')+0x1);if(_0x3dfbf8===_0x37c6('0x9f')){_0x5a9c80[_0x37c6('0xa0')](getSelectList(_0x3d7c91,_0x359728,_0x5be242,_0x3d7731['MetadataId'],_0x2923ba[_0x37c6('0x98')],_0x25b20b));}}});return Promise['all'](_0x5a9c80);})[_0x37c6('0x10')](function(_0x3e1b3c){_0x3f384d=_0x3e1b3c[0x0];var _0x5197e8=[];var _0x539fe5=[];_0xaa7f25['forEach'](function(_0x218518){if(!_[_0x37c6('0xa1')](_0x218518['@odata.type'])){var _0x58325a=_0x218518[_0x37c6('0x9e')]['substring'](_0x218518[_0x37c6('0x9e')][_0x37c6('0x41')]('.')+0x1);if(_0x58325a==='BooleanAttributeMetadata'){_0x5197e8[_0x37c6('0xa0')](getBooleanList(_0x3d7c91,_0x359728,_0x539fe5,_0x3d7731[_0x37c6('0x98')],_0x218518[_0x37c6('0x98')],_0x25b20b));}}});return Promise[_0x37c6('0xa2')](_0x5197e8);})['then'](function(_0x21ed66){_0x31ae1e=_0x21ed66[0x0];var _0x5c9bba=[];var _0x34ecdd=[];_0xaa7f25[_0x37c6('0x9d')](function(_0x571288){if(_0x571288[_0x37c6('0x9e')]){var _0xf53161=_0x571288[_0x37c6('0x9e')][_0x37c6('0x40')](_0x571288[_0x37c6('0x9e')][_0x37c6('0x41')]('.')+0x1);if(_0xf53161==='StringAttributeMetadata'||_0xf53161===_0x37c6('0xa3')||_0xf53161===_0x37c6('0xa4')||_0xf53161===_0x37c6('0xa5')||_0xf53161===_0x37c6('0xa6')||_0xf53161===_0x37c6('0xa7')||_0xf53161===_0x37c6('0xa8')||_0xf53161==='EntityNameAttributeMetadata'||_0xf53161===_0x37c6('0xa9')||_0xf53161==='DecimalAttributeMetadata'){_0x5c9bba[_0x37c6('0xa0')](getInputList(_0x3d7c91,_0x359728,_0xf53161,_0x34ecdd,_0x3d7731[_0x37c6('0x98')],_0x571288[_0x37c6('0x98')],_0x25b20b));}}});return Promise[_0x37c6('0xa2')](_0x5c9bba);})['then'](function(_0x17aa1b){_0xb2bbe6=_0x17aa1b[0x0];var _0x3f7dc3=_0x3f384d[_0x37c6('0xaa')](_0x31ae1e)[_0x37c6('0xaa')](_0xb2bbe6);var _0x2f41ae={'count':_0x3f7dc3[_0x37c6('0x31')],'rows':_0x3f7dc3};return _0x2f41ae;})[_0x37c6('0x10')](respondWithResult(_0x933161,null))[_0x37c6('0x33')](function(_0x6d1a26){var _0x1382f4=_0x385cd4[_0x37c6('0x1e')][_0x37c6('0xab')]?0x1f4:_0x6d1a26[_0x37c6('0xac')]||0x1f4;logger['error'](_0x6d1a26[_0x37c6('0x15')]);delete _0x6d1a26[_0x37c6('0x16')];if(_0x1382f4===0x191){_0x1382f4=0x190;}_0x933161[_0x37c6('0x7')](_0x1382f4)[_0x37c6('0x17')](_0x385cd4['query'][_0x37c6('0xab')]?{'message':_0x37c6('0xad'),'statusCode':_0x6d1a26[_0x37c6('0xac')]}:_0x6d1a26);});};function getSelectList(_0x1ec453,_0x30a199,_0xd4ade5,_0x3587df,_0xd9b71b,_0x5a0208){var _0x43efaf={'method':_0x37c6('0x93'),'uri':_0x1ec453+_0x37c6('0x99')+_0x3587df+_0x37c6('0xae')+_0xd9b71b+_0x37c6('0xaf')+_0x37c6('0xb0'),'headers':{'Authorization':_0x37c6('0x95')+_0x5a0208,'If-None-Match':null,'OData-Version':_0x37c6('0x96')},'json':!![]};return rp(_0x43efaf)['then'](function(_0x475832){var _0x597958=[];var _0x13001=_0x475832[_0x37c6('0xb1')][_0x37c6('0xb2')];_0x13001[_0x37c6('0x9d')](function(_0x49faf3){_0x597958[_0x37c6('0xa0')]({'name':_0x49faf3['Label'][_0x37c6('0xb3')][_0x37c6('0xb4')],'value':String(_0x49faf3[_0x37c6('0xb5')])});});var _0x2ed892={'id':_0x30a199+'_'+_0x475832[_0x37c6('0x9c')],'name':_0x475832[_0x37c6('0xb6')][_0x37c6('0xb3')][_0x37c6('0xb4')],'custom':![],'options':_0x597958};_0xd4ade5['push'](_0x2ed892);return _0xd4ade5;});}function getBooleanList(_0x2b45be,_0x554676,_0x2aac18,_0x251277,_0x5841e2,_0x16daca){var _0x4bd222={'method':_0x37c6('0x93'),'uri':_0x2b45be+_0x37c6('0x99')+_0x251277+_0x37c6('0xae')+_0x5841e2+_0x37c6('0xb7'),'headers':{'Authorization':_0x37c6('0x95')+_0x16daca,'If-None-Match':null,'OData-Version':_0x37c6('0x96')},'json':!![]};return rp(_0x4bd222)[_0x37c6('0x10')](function(_0x4fe52c){var _0x189d74=[];_0x189d74[_0x37c6('0xa0')]({'name':_0x4fe52c[_0x37c6('0xb1')][_0x37c6('0xb8')][_0x37c6('0xb4')][_0x37c6('0xb3')][_0x37c6('0xb4')],'value':_0x37c6('0xb9')},{'name':_0x4fe52c[_0x37c6('0xb1')]['FalseOption'][_0x37c6('0xb4')]['UserLocalizedLabel']['Label'],'value':_0x37c6('0xba')});var _0x53ef3c={'id':_0x554676+'_'+_0x4fe52c['LogicalName'],'name':_0x4fe52c[_0x37c6('0xb6')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x189d74};_0x2aac18[_0x37c6('0xa0')](_0x53ef3c);return _0x2aac18;});}function getInputList(_0x53f5ae,_0xfb7034,_0x316acb,_0x27915c,_0x281e19,_0x1802c2,_0x475a5a){var _0x46da0a={'method':_0x37c6('0x93'),'uri':_0x53f5ae+_0x37c6('0x99')+_0x281e19+')/Attributes('+_0x1802c2+')/Microsoft.Dynamics.CRM.'+_0x316acb+_0x37c6('0xbb'),'headers':{'Authorization':_0x37c6('0x95')+_0x475a5a,'If-None-Match':null,'OData-Version':_0x37c6('0x96')},'json':!![]};return rp(_0x46da0a)[_0x37c6('0x10')](function(_0x2e5828){var _0x166d63={'id':_0xfb7034+'_'+_0x2e5828[_0x37c6('0x9c')],'name':_0x2e5828['DisplayName'][_0x37c6('0xb3')]?_0x2e5828[_0x37c6('0xb6')][_0x37c6('0xb3')]['Label']:_0x2e5828[_0x37c6('0x9c')],'custom':![],'options':[]};_0x27915c['push'](_0x166d63);return _0x27915c;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 4414a15..45e4b61 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(_0xbb2f3,_0x587de6){var _0x41dd12=function(_0x249fde){while(--_0x249fde){_0xbb2f3['push'](_0xbb2f3['shift']());}};_0x41dd12(++_0x587de6);}(_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'));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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x35af2a,_0x1885d2){var _0x5cdcdd=function(_0xcce3e2){while(--_0xcce3e2){_0x35af2a['push'](_0x35af2a['shift']());}};_0x5cdcdd(++_0x1885d2);}(_0xe706,0xa3));var _0x6e70=function(_0x50b6ff,_0xb9324f){_0x50b6ff=_0x50b6ff-0x0;var _0x57cb31=_0xe706[_0x50b6ff];return _0x57cb31;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 48139ac..c603501 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 _0x5fa2=['Dynamics365Account','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','attributes','limit','include','map','model','GetDynamics365Account','ShowDynamics365Account'];(function(_0xc3e18a,_0x1f29fc){var _0x3d1704=function(_0x22976c){while(--_0x22976c){_0xc3e18a['push'](_0xc3e18a['shift']());}};_0x3d1704(++_0x1f29fc);}(_0x5fa2,0x1b2));var _0x25fa=function(_0x42b98c,_0x3d8330){_0x42b98c=_0x42b98c-0x0;var _0x22af4f=_0x5fa2[_0x42b98c];return _0x22af4f;};'use strict';var _=require(_0x25fa('0x0'));var util=require(_0x25fa('0x1'));var moment=require(_0x25fa('0x2'));var BPromise=require(_0x25fa('0x3'));var rs=require(_0x25fa('0x4'));var fs=require('fs');var Redis=require(_0x25fa('0x5'));var db=require(_0x25fa('0x6'))['db'];var utils=require(_0x25fa('0x7'));var logger=require('../../config/logger')(_0x25fa('0x8'));var config=require('../../config/environment');var jayson=require(_0x25fa('0x9'));var client=jayson[_0x25fa('0xa')][_0x25fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x126066,_0x439099,_0x3c3a10){return new BPromise(function(_0x4bd050,_0xbca1c2){return client[_0x25fa('0xc')](_0x126066,_0x3c3a10)[_0x25fa('0xd')](function(_0x13c9f5){logger[_0x25fa('0xe')](_0x25fa('0xf'),_0x439099,_0x25fa('0x10'));logger[_0x25fa('0x11')](_0x25fa('0x12'),_0x439099,_0x25fa('0x10'),JSON[_0x25fa('0x13')](_0x13c9f5));if(_0x13c9f5[_0x25fa('0x14')]){if(_0x13c9f5[_0x25fa('0x14')][_0x25fa('0x15')]===0x1f4){logger[_0x25fa('0x14')](_0x25fa('0xf'),_0x439099,_0x13c9f5[_0x25fa('0x14')][_0x25fa('0x16')]);return _0xbca1c2(_0x13c9f5[_0x25fa('0x14')][_0x25fa('0x16')]);}logger[_0x25fa('0x14')](_0x25fa('0xf'),_0x439099,_0x13c9f5['error'][_0x25fa('0x16')]);return _0x4bd050(_0x13c9f5[_0x25fa('0x14')]['message']);}else{logger[_0x25fa('0xe')](_0x25fa('0xf'),_0x439099,_0x25fa('0x10'));_0x4bd050(_0x13c9f5[_0x25fa('0x17')]['message']);}})[_0x25fa('0x18')](function(_0xace6b2){logger[_0x25fa('0x14')](_0x25fa('0xf'),_0x439099,_0xace6b2);_0xbca1c2(_0xace6b2);});});}exports['GetDynamics365Account']=function(_0x46e7c8){var _0x40dc81=this;return new Promise(function(_0x3be071,_0x3fc118){return db['Dynamics365Account']['findAll']({'raw':_0x46e7c8[_0x25fa('0x19')]?_0x46e7c8[_0x25fa('0x19')][_0x25fa('0x1a')]===undefined?!![]:![]:!![],'where':_0x46e7c8[_0x25fa('0x19')]?_0x46e7c8['options']['where']||null:null,'attributes':_0x46e7c8[_0x25fa('0x19')]?_0x46e7c8[_0x25fa('0x19')][_0x25fa('0x1b')]||null:null,'limit':_0x46e7c8[_0x25fa('0x19')]?_0x46e7c8[_0x25fa('0x19')][_0x25fa('0x1c')]||null:null,'include':_0x46e7c8[_0x25fa('0x19')]?_0x46e7c8[_0x25fa('0x19')][_0x25fa('0x1d')]?_[_0x25fa('0x1e')](_0x46e7c8[_0x25fa('0x19')][_0x25fa('0x1d')],function(_0x565676){return{'model':db[_0x565676[_0x25fa('0x1f')]],'as':_0x565676['as'],'attributes':_0x565676[_0x25fa('0x1b')],'include':_0x565676['include']?_['map'](_0x565676[_0x25fa('0x1d')],function(_0x248a11){return{'model':db[_0x248a11[_0x25fa('0x1f')]],'as':_0x248a11['as'],'attributes':_0x248a11[_0x25fa('0x1b')],'include':_0x248a11['include']?_[_0x25fa('0x1e')](_0x248a11[_0x25fa('0x1d')],function(_0x4db885){return{'model':db[_0x4db885['model']],'as':_0x4db885['as'],'attributes':_0x4db885[_0x25fa('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x25fa('0xd')](function(_0x1894ae){logger[_0x25fa('0xe')](_0x25fa('0x20'),_0x46e7c8);logger['debug']('GetDynamics365Account',_0x46e7c8,JSON['stringify'](_0x1894ae));_0x3be071(_0x1894ae);})[_0x25fa('0x18')](function(_0x489981){logger['error'](_0x25fa('0x20'),_0x489981[_0x25fa('0x16')],_0x46e7c8);_0x3fc118(_0x40dc81[_0x25fa('0x14')](0x1f4,_0x489981[_0x25fa('0x16')]));});});};exports[_0x25fa('0x21')]=function(_0xec1ce4){var _0x5ab76e=this;return new Promise(function(_0xfc52b5,_0x372614){return db[_0x25fa('0x22')]['find']({'raw':_0xec1ce4[_0x25fa('0x19')]?_0xec1ce4[_0x25fa('0x19')][_0x25fa('0x1a')]===undefined?!![]:![]:!![],'where':_0xec1ce4[_0x25fa('0x19')]?_0xec1ce4[_0x25fa('0x19')][_0x25fa('0x23')]||null:null,'attributes':_0xec1ce4[_0x25fa('0x19')]?_0xec1ce4[_0x25fa('0x19')][_0x25fa('0x1b')]||null:null,'include':_0xec1ce4[_0x25fa('0x19')]?_0xec1ce4[_0x25fa('0x19')][_0x25fa('0x1d')]?_['map'](_0xec1ce4[_0x25fa('0x19')]['include'],function(_0xebf60d){return{'model':db[_0xebf60d[_0x25fa('0x1f')]],'as':_0xebf60d['as'],'attributes':_0xebf60d[_0x25fa('0x1b')],'include':_0xebf60d[_0x25fa('0x1d')]?_[_0x25fa('0x1e')](_0xebf60d[_0x25fa('0x1d')],function(_0x5a90c2){return{'model':db[_0x5a90c2['model']],'as':_0x5a90c2['as'],'attributes':_0x5a90c2[_0x25fa('0x1b')],'include':_0x5a90c2[_0x25fa('0x1d')]?_[_0x25fa('0x1e')](_0x5a90c2[_0x25fa('0x1d')],function(_0x574469){return{'model':db[_0x574469['model']],'as':_0x574469['as'],'attributes':_0x574469[_0x25fa('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x25fa('0xd')](function(_0x1e4dc5){logger['info'](_0x25fa('0x21'),_0xec1ce4);logger[_0x25fa('0x11')](_0x25fa('0x21'),_0xec1ce4,JSON[_0x25fa('0x13')](_0x1e4dc5));_0xfc52b5(_0x1e4dc5);})[_0x25fa('0x18')](function(_0x1d5053){logger['error'](_0x25fa('0x21'),_0x1d5053[_0x25fa('0x16')],_0xec1ce4);_0x372614(_0x5ab76e['error'](0x1f4,_0x1d5053[_0x25fa('0x16')]));});});}; \ No newline at end of file +var _0x9ed8=['info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','Dynamics365Account','options','where','attributes','limit','map','include','model','GetDynamics365Account','ShowDynamics365Account','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0xa31ead,_0x599e75){var _0x53fe5d=function(_0x2b7072){while(--_0x2b7072){_0xa31ead['push'](_0xa31ead['shift']());}};_0x53fe5d(++_0x599e75);}(_0x9ed8,0xa2));var _0x89ed=function(_0x272948,_0x4abe31){_0x272948=_0x272948-0x0;var _0x5caefb=_0x9ed8[_0x272948];return _0x5caefb;};'use strict';var _=require(_0x89ed('0x0'));var util=require(_0x89ed('0x1'));var moment=require(_0x89ed('0x2'));var BPromise=require('bluebird');var rs=require(_0x89ed('0x3'));var fs=require('fs');var Redis=require(_0x89ed('0x4'));var db=require(_0x89ed('0x5'))['db'];var utils=require(_0x89ed('0x6'));var logger=require(_0x89ed('0x7'))('rpc');var config=require(_0x89ed('0x8'));var jayson=require(_0x89ed('0x9'));var client=jayson[_0x89ed('0xa')][_0x89ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x180105,_0x2f7787,_0xda6390){return new BPromise(function(_0x372041,_0x3e3490){return client['request'](_0x180105,_0xda6390)[_0x89ed('0xc')](function(_0x2830cb){logger[_0x89ed('0xd')](_0x89ed('0xe'),_0x2f7787,_0x89ed('0xf'));logger[_0x89ed('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x2f7787,'request\x20sent',JSON[_0x89ed('0x11')](_0x2830cb));if(_0x2830cb['error']){if(_0x2830cb['error'][_0x89ed('0x12')]===0x1f4){logger[_0x89ed('0x13')](_0x89ed('0xe'),_0x2f7787,_0x2830cb[_0x89ed('0x13')][_0x89ed('0x14')]);return _0x3e3490(_0x2830cb[_0x89ed('0x13')][_0x89ed('0x14')]);}logger['error'](_0x89ed('0xe'),_0x2f7787,_0x2830cb[_0x89ed('0x13')][_0x89ed('0x14')]);return _0x372041(_0x2830cb[_0x89ed('0x13')]['message']);}else{logger['info'](_0x89ed('0xe'),_0x2f7787,_0x89ed('0xf'));_0x372041(_0x2830cb[_0x89ed('0x15')]['message']);}})[_0x89ed('0x16')](function(_0x4a9e4f){logger[_0x89ed('0x13')](_0x89ed('0xe'),_0x2f7787,_0x4a9e4f);_0x3e3490(_0x4a9e4f);});});}exports['GetDynamics365Account']=function(_0x399cd1){var _0x47a9ec=this;return new Promise(function(_0x3a89f0,_0x37c156){return db[_0x89ed('0x17')]['findAll']({'raw':_0x399cd1[_0x89ed('0x18')]?_0x399cd1[_0x89ed('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x399cd1[_0x89ed('0x18')]?_0x399cd1[_0x89ed('0x18')][_0x89ed('0x19')]||null:null,'attributes':_0x399cd1['options']?_0x399cd1[_0x89ed('0x18')][_0x89ed('0x1a')]||null:null,'limit':_0x399cd1[_0x89ed('0x18')]?_0x399cd1[_0x89ed('0x18')][_0x89ed('0x1b')]||null:null,'include':_0x399cd1[_0x89ed('0x18')]?_0x399cd1['options']['include']?_[_0x89ed('0x1c')](_0x399cd1[_0x89ed('0x18')][_0x89ed('0x1d')],function(_0x544dff){return{'model':db[_0x544dff[_0x89ed('0x1e')]],'as':_0x544dff['as'],'attributes':_0x544dff[_0x89ed('0x1a')],'include':_0x544dff[_0x89ed('0x1d')]?_['map'](_0x544dff[_0x89ed('0x1d')],function(_0x20ebd0){return{'model':db[_0x20ebd0[_0x89ed('0x1e')]],'as':_0x20ebd0['as'],'attributes':_0x20ebd0[_0x89ed('0x1a')],'include':_0x20ebd0[_0x89ed('0x1d')]?_['map'](_0x20ebd0['include'],function(_0x26cf13){return{'model':db[_0x26cf13[_0x89ed('0x1e')]],'as':_0x26cf13['as'],'attributes':_0x26cf13[_0x89ed('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40b669){logger[_0x89ed('0xd')](_0x89ed('0x1f'),_0x399cd1);logger[_0x89ed('0x10')](_0x89ed('0x1f'),_0x399cd1,JSON[_0x89ed('0x11')](_0x40b669));_0x3a89f0(_0x40b669);})[_0x89ed('0x16')](function(_0x4e8571){logger[_0x89ed('0x13')](_0x89ed('0x1f'),_0x4e8571[_0x89ed('0x14')],_0x399cd1);_0x37c156(_0x47a9ec[_0x89ed('0x13')](0x1f4,_0x4e8571['message']));});});};exports[_0x89ed('0x20')]=function(_0x1d186f){var _0x6a809b=this;return new Promise(function(_0x1e253f,_0x21f618){return db[_0x89ed('0x17')][_0x89ed('0x21')]({'raw':_0x1d186f[_0x89ed('0x18')]?_0x1d186f[_0x89ed('0x18')][_0x89ed('0x22')]===undefined?!![]:![]:!![],'where':_0x1d186f[_0x89ed('0x18')]?_0x1d186f[_0x89ed('0x18')]['where']||null:null,'attributes':_0x1d186f['options']?_0x1d186f['options']['attributes']||null:null,'include':_0x1d186f[_0x89ed('0x18')]?_0x1d186f[_0x89ed('0x18')][_0x89ed('0x1d')]?_[_0x89ed('0x1c')](_0x1d186f[_0x89ed('0x18')][_0x89ed('0x1d')],function(_0x59ebce){return{'model':db[_0x59ebce[_0x89ed('0x1e')]],'as':_0x59ebce['as'],'attributes':_0x59ebce[_0x89ed('0x1a')],'include':_0x59ebce[_0x89ed('0x1d')]?_[_0x89ed('0x1c')](_0x59ebce[_0x89ed('0x1d')],function(_0x35fd76){return{'model':db[_0x35fd76[_0x89ed('0x1e')]],'as':_0x35fd76['as'],'attributes':_0x35fd76[_0x89ed('0x1a')],'include':_0x35fd76[_0x89ed('0x1d')]?_['map'](_0x35fd76[_0x89ed('0x1d')],function(_0x1c7912){return{'model':db[_0x1c7912[_0x89ed('0x1e')]],'as':_0x1c7912['as'],'attributes':_0x1c7912[_0x89ed('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x89ed('0xc')](function(_0x205022){logger['info'](_0x89ed('0x20'),_0x1d186f);logger[_0x89ed('0x10')](_0x89ed('0x20'),_0x1d186f,JSON[_0x89ed('0x11')](_0x205022));_0x1e253f(_0x205022);})[_0x89ed('0x16')](function(_0x5667ec){logger['error'](_0x89ed('0x20'),_0x5667ec[_0x89ed('0x14')],_0x1d186f);_0x21f618(_0x6a809b[_0x89ed('0x13')](0x1f4,_0x5667ec['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 6f3ca8b..4b18e84 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 _0x9c1d=['show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id'];(function(_0x4f6e6a,_0x1f0d01){var _0x571c37=function(_0x206922){while(--_0x206922){_0x4f6e6a['push'](_0x4f6e6a['shift']());}};_0x571c37(++_0x1f0d01);}(_0x9c1d,0x1a9));var _0xd9c1=function(_0x61f432,_0x1fe3df){_0x61f432=_0x61f432-0x0;var _0x4084f3=_0x9c1d[_0x61f432];return _0x4084f3;};'use strict';var multer=require(_0xd9c1('0x0'));var util=require(_0xd9c1('0x1'));var path=require(_0xd9c1('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9c1('0x3'));var router=express[_0xd9c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd9c1('0x5'));var interaction=require(_0xd9c1('0x6'));var config=require('../../config/environment');var controller=require(_0xd9c1('0x7'));router[_0xd9c1('0x8')]('/',auth[_0xd9c1('0x9')](),controller[_0xd9c1('0xa')]);router[_0xd9c1('0x8')](_0xd9c1('0xb'),auth[_0xd9c1('0x9')](),controller[_0xd9c1('0xc')]);router[_0xd9c1('0x8')]('/:id/fields',auth[_0xd9c1('0x9')](),controller[_0xd9c1('0xd')]);router[_0xd9c1('0x8')](_0xd9c1('0xe'),auth[_0xd9c1('0x9')](),controller[_0xd9c1('0xf')]);router[_0xd9c1('0x8')]('/:id/descriptions',auth[_0xd9c1('0x9')](),controller[_0xd9c1('0x10')]);router[_0xd9c1('0x11')]('/',auth['isAuthenticated'](),controller[_0xd9c1('0x12')]);router['put'](_0xd9c1('0xb'),auth[_0xd9c1('0x9')](),controller[_0xd9c1('0x13')]);router[_0xd9c1('0x14')](_0xd9c1('0xb'),auth[_0xd9c1('0x9')](),controller[_0xd9c1('0x15')]);module[_0xd9c1('0x16')]=router; \ No newline at end of file +var _0x49a3=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x49a3,0xe6));var _0x349a=function(_0x15e8e2,_0xc4051){_0x15e8e2=_0x15e8e2-0x0;var _0x163688=_0x49a3[_0x15e8e2];return _0x163688;};'use strict';var multer=require('multer');var util=require(_0x349a('0x0'));var path=require(_0x349a('0x1'));var timeout=require(_0x349a('0x2'));var express=require(_0x349a('0x3'));var router=express[_0x349a('0x4')]();var fs_extra=require(_0x349a('0x5'));var auth=require(_0x349a('0x6'));var interaction=require(_0x349a('0x7'));var config=require(_0x349a('0x8'));var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0x349a('0x9')](),controller['index']);router['get'](_0x349a('0xa'),auth[_0x349a('0x9')](),controller[_0x349a('0xb')]);router[_0x349a('0xc')]('/:id/fields',auth[_0x349a('0x9')](),controller['getFields']);router[_0x349a('0xc')](_0x349a('0xd'),auth['isAuthenticated'](),controller[_0x349a('0xe')]);router['get'](_0x349a('0xf'),auth['isAuthenticated'](),controller[_0x349a('0x10')]);router[_0x349a('0x11')]('/',auth[_0x349a('0x9')](),controller[_0x349a('0x12')]);router[_0x349a('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x349a('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x349a('0x15')]);module[_0x349a('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index a310460..596ab64 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 _0x737b=['exports','STRING','incident','phonecall','ENUM','contact','nothing'];(function(_0x1da88d,_0x30251f){var _0x2fd082=function(_0x815326){while(--_0x815326){_0x1da88d['push'](_0x1da88d['shift']());}};_0x2fd082(++_0x30251f);}(_0x737b,0xfc));var _0xb737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x737b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xb737('0x0')]={'name':{'type':Sequelize[_0xb737('0x1')]},'description':{'type':Sequelize[_0xb737('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xb737('0x2'),_0xb737('0x3')),'defaultValue':_0xb737('0x2')},'moduleCreate':{'type':Sequelize[_0xb737('0x4')](_0xb737('0x5'),_0xb737('0x6')),'defaultValue':_0xb737('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xb737('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x78be=['incident','phonecall','contact','nothing','BOOLEAN','sequelize','exports','STRING','ENUM'];(function(_0x23f3c0,_0x53118e){var _0xb517c2=function(_0x465ffc){while(--_0x465ffc){_0x23f3c0['push'](_0x23f3c0['shift']());}};_0xb517c2(++_0x53118e);}(_0x78be,0x125));var _0xe78b=function(_0x495bae,_0x42593c){_0x495bae=_0x495bae-0x0;var _0x37b35e=_0x78be[_0x495bae];return _0x37b35e;};'use strict';var Sequelize=require(_0xe78b('0x0'));module[_0xe78b('0x1')]={'name':{'type':Sequelize[_0xe78b('0x2')]},'description':{'type':Sequelize[_0xe78b('0x2')]},'ticketType':{'type':Sequelize[_0xe78b('0x3')](_0xe78b('0x4'),_0xe78b('0x5')),'defaultValue':_0xe78b('0x4')},'moduleCreate':{'type':Sequelize[_0xe78b('0x3')](_0xe78b('0x6'),_0xe78b('0x7')),'defaultValue':_0xe78b('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xe78b('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 3c4f1b0..2641185 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 _0x31ed=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','count','offset','limit','set','json','reject','then','sendStatus','error','stack','name','map','Dynamics365Configuration','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','find','create','body','catch','params','destroy','getFields','findOne','Dynamics365Field','rawAttributes','sort','hasOwnProperty','getSubjects','options','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0xf77e6b,_0x116a5f){var _0x55831a=function(_0x18216a){while(--_0x18216a){_0xf77e6b['push'](_0xf77e6b['shift']());}};_0x55831a(++_0x116a5f);}(_0x31ed,0x17f));var _0xd31e=function(_0x1564ab,_0x3670f1){_0x1564ab=_0x1564ab-0x0;var _0x184cfb=_0x31ed[_0x1564ab];return _0x184cfb;};'use strict';var emlformat=require(_0xd31e('0x0'));var rimraf=require(_0xd31e('0x1'));var zipdir=require(_0xd31e('0x2'));var jsonpatch=require(_0xd31e('0x3'));var rp=require(_0xd31e('0x4'));var moment=require('moment');var BPromise=require(_0xd31e('0x5'));var Mustache=require(_0xd31e('0x6'));var util=require(_0xd31e('0x7'));var path=require(_0xd31e('0x8'));var sox=require(_0xd31e('0x9'));var csv=require(_0xd31e('0xa'));var ejs=require(_0xd31e('0xb'));var fs=require('fs');var fs_extra=require(_0xd31e('0xc'));var _=require(_0xd31e('0xd'));var squel=require(_0xd31e('0xe'));var crypto=require(_0xd31e('0xf'));var jsforce=require(_0xd31e('0x10'));var deskjs=require(_0xd31e('0x11'));var toCsv=require(_0xd31e('0xa'));var querystring=require('querystring');var Papa=require(_0xd31e('0x12'));var Redis=require(_0xd31e('0x13'));var authService=require(_0xd31e('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd31e('0x15'));var hardwareService=require(_0xd31e('0x16'));var logger=require(_0xd31e('0x17'))(_0xd31e('0x18'));var utils=require(_0xd31e('0x19'));var config=require(_0xd31e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xd31e('0x1b'))['db'];function respondWithStatusCode(_0x1e49d0,_0x28915e){_0x28915e=_0x28915e||0xcc;return function(_0x494ffa){if(_0x494ffa){return _0x1e49d0['sendStatus'](_0x28915e);}return _0x1e49d0[_0xd31e('0x1c')](_0x28915e)[_0xd31e('0x1d')]();};}function respondWithResult(_0x17a06e,_0x5017b8){_0x5017b8=_0x5017b8||0xc8;return function(_0x47b614){if(_0x47b614){return _0x17a06e[_0xd31e('0x1c')](_0x5017b8)['json'](_0x47b614);}};}function respondWithFilteredResult(_0x5a02f8,_0x285394){return function(_0x44cfee){if(_0x44cfee){var _0x6d5dbd=typeof _0x285394['offset']===_0xd31e('0x1e')&&typeof _0x285394['limit']==='undefined';var _0x360ef1=_0x44cfee[_0xd31e('0x1f')];var _0x43d162=_0x6d5dbd?0x0:_0x285394[_0xd31e('0x20')];var _0x5dcba4=_0x6d5dbd?_0x44cfee['count']:_0x285394[_0xd31e('0x20')]+_0x285394[_0xd31e('0x21')];var _0x55665b;if(_0x5dcba4>=_0x360ef1){_0x5dcba4=_0x360ef1;_0x55665b=0xc8;}else{_0x55665b=0xce;}_0x5a02f8[_0xd31e('0x1c')](_0x55665b);return _0x5a02f8[_0xd31e('0x22')]('Content-Range',_0x43d162+'-'+_0x5dcba4+'/'+_0x360ef1)[_0xd31e('0x23')](_0x44cfee);}return null;};}function patchUpdates(_0x1f49ef){return function(_0x1d2bd7){try{jsonpatch['apply'](_0x1d2bd7,_0x1f49ef,!![]);}catch(_0x478893){return BPromise[_0xd31e('0x24')](_0x478893);}return _0x1d2bd7['save']();};}function saveUpdates(_0x210248,_0x2cca31){return function(_0x376de9){if(_0x376de9){return _0x376de9['update'](_0x210248)[_0xd31e('0x25')](function(_0x58d3c9){return _0x58d3c9;});}return null;};}function removeEntity(_0x2c68d4,_0x4de147){return function(_0x2592f5){if(_0x2592f5){return _0x2592f5['destroy']()[_0xd31e('0x25')](function(){_0x2c68d4[_0xd31e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49e11c,_0x1fffe){return function(_0x189d22){if(!_0x189d22){_0x49e11c[_0xd31e('0x26')](0x194);}return _0x189d22;};}function handleError(_0x24394b,_0x393845){_0x393845=_0x393845||0x1f4;return function(_0x1cb0c8){logger[_0xd31e('0x27')](_0x1cb0c8[_0xd31e('0x28')]);if(_0x1cb0c8[_0xd31e('0x29')]){delete _0x1cb0c8[_0xd31e('0x29')];}_0x24394b[_0xd31e('0x1c')](_0x393845)['send'](_0x1cb0c8);};}exports['index']=function(_0x3a4b0c,_0x42eded){var _0x49695b={},_0x11a8c6={},_0x5669ff={'count':0x0,'rows':[]};var _0x501751=_[_0xd31e('0x2a')](db[_0xd31e('0x2b')]['rawAttributes'],function(_0x12cb5c){return{'name':_0x12cb5c[_0xd31e('0x2c')],'type':_0x12cb5c[_0xd31e('0x2d')][_0xd31e('0x2e')]};});_0x11a8c6['model']=_['map'](_0x501751,_0xd31e('0x29'));_0x11a8c6[_0xd31e('0x2f')]=_[_0xd31e('0x30')](_0x3a4b0c[_0xd31e('0x2f')]);_0x11a8c6['filters']=_[_0xd31e('0x31')](_0x11a8c6[_0xd31e('0x32')],_0x11a8c6[_0xd31e('0x2f')]);_0x49695b['attributes']=_[_0xd31e('0x31')](_0x11a8c6['model'],qs[_0xd31e('0x33')](_0x3a4b0c[_0xd31e('0x2f')][_0xd31e('0x33')]));_0x49695b[_0xd31e('0x34')]=_0x49695b['attributes'][_0xd31e('0x35')]?_0x49695b['attributes']:_0x11a8c6[_0xd31e('0x32')];if(!_0x3a4b0c[_0xd31e('0x2f')]['hasOwnProperty'](_0xd31e('0x36'))){_0x49695b[_0xd31e('0x21')]=qs['limit'](_0x3a4b0c[_0xd31e('0x2f')][_0xd31e('0x21')]);_0x49695b[_0xd31e('0x20')]=qs[_0xd31e('0x20')](_0x3a4b0c[_0xd31e('0x2f')][_0xd31e('0x20')]);}_0x49695b[_0xd31e('0x37')]=qs['sort'](_0x3a4b0c[_0xd31e('0x2f')]['sort']);_0x49695b[_0xd31e('0x38')]=qs[_0xd31e('0x39')](_[_0xd31e('0x3a')](_0x3a4b0c[_0xd31e('0x2f')],_0x11a8c6['filters']),_0x501751);if(_0x3a4b0c[_0xd31e('0x2f')][_0xd31e('0x3b')]){_0x49695b[_0xd31e('0x38')]=_[_0xd31e('0x3c')](_0x49695b[_0xd31e('0x38')],{'$or':_[_0xd31e('0x2a')](_0x501751,function(_0x224181){if(_0x224181[_0xd31e('0x2d')]!==_0xd31e('0x3d')){var _0x57e074={};_0x57e074[_0x224181[_0xd31e('0x29')]]={'$like':'%'+_0x3a4b0c[_0xd31e('0x2f')][_0xd31e('0x3b')]+'%'};return _0x57e074;}})});}_0x49695b=_['merge']({},_0x49695b,_0x3a4b0c['options']);var _0x370d76={'where':_0x49695b[_0xd31e('0x38')]};return db[_0xd31e('0x2b')][_0xd31e('0x1f')](_0x370d76)[_0xd31e('0x25')](function(_0x36a6ad){_0x5669ff[_0xd31e('0x1f')]=_0x36a6ad;if(_0x3a4b0c[_0xd31e('0x2f')][_0xd31e('0x3e')]){_0x49695b[_0xd31e('0x3f')]=[{'all':!![]}];}return db[_0xd31e('0x2b')]['findAll'](_0x49695b);})[_0xd31e('0x25')](function(_0x156ed3){_0x5669ff[_0xd31e('0x40')]=_0x156ed3;return _0x5669ff;})[_0xd31e('0x25')](respondWithFilteredResult(_0x42eded,_0x49695b))['catch'](handleError(_0x42eded,null));};exports['show']=function(_0x28f9f2,_0x57f541){var _0x59b4b2={'raw':![],'where':{'id':_0x28f9f2['params']['id']}},_0x2e761c={};_0x2e761c[_0xd31e('0x32')]=_[_0xd31e('0x30')](db[_0xd31e('0x2b')]['rawAttributes']);_0x2e761c[_0xd31e('0x2f')]=_[_0xd31e('0x30')](_0x28f9f2[_0xd31e('0x2f')]);_0x2e761c['filters']=_['intersection'](_0x2e761c[_0xd31e('0x32')],_0x2e761c[_0xd31e('0x2f')]);_0x59b4b2[_0xd31e('0x34')]=_[_0xd31e('0x31')](_0x2e761c[_0xd31e('0x32')],qs[_0xd31e('0x33')](_0x28f9f2[_0xd31e('0x2f')][_0xd31e('0x33')]));_0x59b4b2[_0xd31e('0x34')]=_0x59b4b2[_0xd31e('0x34')]['length']?_0x59b4b2[_0xd31e('0x34')]:_0x2e761c[_0xd31e('0x32')];if(_0x28f9f2[_0xd31e('0x2f')][_0xd31e('0x3e')]){_0x59b4b2['include']=[{'all':!![]}];}_0x59b4b2=_[_0xd31e('0x3c')]({},_0x59b4b2,_0x28f9f2['options']);return db[_0xd31e('0x2b')][_0xd31e('0x41')](_0x59b4b2)['then'](handleEntityNotFound(_0x57f541,null))[_0xd31e('0x25')](respondWithResult(_0x57f541,null))['catch'](handleError(_0x57f541,null));};exports[_0xd31e('0x42')]=function(_0x55adb7,_0x3c6f9b){return db[_0xd31e('0x2b')][_0xd31e('0x42')](_0x55adb7[_0xd31e('0x43')],{})['then'](respondWithResult(_0x3c6f9b,0xc9))[_0xd31e('0x44')](handleError(_0x3c6f9b,null));};exports['update']=function(_0x4ba7e0,_0x440ae9){if(_0x4ba7e0[_0xd31e('0x43')]['id']){delete _0x4ba7e0[_0xd31e('0x43')]['id'];}return db[_0xd31e('0x2b')][_0xd31e('0x41')]({'where':{'id':_0x4ba7e0[_0xd31e('0x45')]['id']}})[_0xd31e('0x25')](handleEntityNotFound(_0x440ae9,null))['then'](saveUpdates(_0x4ba7e0['body'],null))[_0xd31e('0x25')](respondWithResult(_0x440ae9,null))[_0xd31e('0x44')](handleError(_0x440ae9,null));};exports[_0xd31e('0x46')]=function(_0x2720da,_0x3f7561){return db[_0xd31e('0x2b')][_0xd31e('0x41')]({'where':{'id':_0x2720da['params']['id']}})[_0xd31e('0x25')](handleEntityNotFound(_0x3f7561,null))['then'](removeEntity(_0x3f7561,null))['catch'](handleError(_0x3f7561,null));};exports[_0xd31e('0x47')]=function(_0x4acb9c,_0x43d2f8,_0xcd6bf0){var _0xc12d07={};var _0x4883a5={};var _0x1fdf25;var _0x2bd5e8;return db['Dynamics365Configuration'][_0xd31e('0x48')]({'where':{'id':_0x4acb9c['params']['id']}})['then'](handleEntityNotFound(_0x43d2f8,null))[_0xd31e('0x25')](function(_0x2042f9){if(_0x2042f9){_0x1fdf25=_0x2042f9;_0x4883a5[_0xd31e('0x32')]=_[_0xd31e('0x30')](db[_0xd31e('0x49')][_0xd31e('0x4a')]);_0x4883a5[_0xd31e('0x2f')]=_[_0xd31e('0x30')](_0x4acb9c['query']);_0x4883a5[_0xd31e('0x39')]=_['intersection'](_0x4883a5['model'],_0x4883a5[_0xd31e('0x2f')]);_0xc12d07[_0xd31e('0x34')]=_['intersection'](_0x4883a5[_0xd31e('0x32')],qs['fields'](_0x4acb9c['query'][_0xd31e('0x33')]));_0xc12d07[_0xd31e('0x34')]=_0xc12d07[_0xd31e('0x34')][_0xd31e('0x35')]?_0xc12d07[_0xd31e('0x34')]:_0x4883a5[_0xd31e('0x32')];_0xc12d07[_0xd31e('0x37')]=qs[_0xd31e('0x4b')](_0x4acb9c[_0xd31e('0x2f')][_0xd31e('0x4b')]);_0xc12d07[_0xd31e('0x38')]=qs['filters'](_['pick'](_0x4acb9c[_0xd31e('0x2f')],_0x4883a5[_0xd31e('0x39')]));if(_0x4acb9c[_0xd31e('0x2f')][_0xd31e('0x3b')]){_0xc12d07[_0xd31e('0x38')]=_['merge'](_0xc12d07[_0xd31e('0x38')],{'$or':_[_0xd31e('0x2a')](_0xc12d07['attributes'],function(_0x429229){var _0x2cc679={};_0x2cc679[_0x429229]={'$like':'%'+_0x4acb9c[_0xd31e('0x2f')]['filter']+'%'};return _0x2cc679;})});}_0xc12d07=_['merge']({},_0xc12d07,_0x4acb9c['options']);return _0x1fdf25[_0xd31e('0x47')](_0xc12d07);}})[_0xd31e('0x25')](function(_0x468689){if(_0x468689){_0x2bd5e8=_0x468689['length'];if(!_0x4acb9c[_0xd31e('0x2f')][_0xd31e('0x4c')](_0xd31e('0x36'))){_0xc12d07['limit']=qs[_0xd31e('0x21')](_0x4acb9c['query'][_0xd31e('0x21')]);_0xc12d07['offset']=qs[_0xd31e('0x20')](_0x4acb9c['query'][_0xd31e('0x20')]);}return _0x1fdf25['getFields'](_0xc12d07);}})[_0xd31e('0x25')](function(_0xfbfe27){if(_0xfbfe27){return _0xfbfe27?{'count':_0x2bd5e8,'rows':_0xfbfe27}:null;}})[_0xd31e('0x25')](respondWithResult(_0x43d2f8,null))[_0xd31e('0x44')](handleError(_0x43d2f8,null));};exports[_0xd31e('0x4d')]=function(_0x2ab54d,_0x5d6b19,_0x4bbbbc){var _0x4fe89b={};var _0x4b78ca={};var _0x4d3e30;var _0x10457f;return db['Dynamics365Configuration'][_0xd31e('0x48')]({'where':{'id':_0x2ab54d[_0xd31e('0x45')]['id']}})[_0xd31e('0x25')](handleEntityNotFound(_0x5d6b19,null))[_0xd31e('0x25')](function(_0x31eb30){if(_0x31eb30){_0x4d3e30=_0x31eb30;_0x4b78ca[_0xd31e('0x32')]=_[_0xd31e('0x30')](db['Dynamics365Field'][_0xd31e('0x4a')]);_0x4b78ca[_0xd31e('0x2f')]=_[_0xd31e('0x30')](_0x2ab54d['query']);_0x4b78ca[_0xd31e('0x39')]=_[_0xd31e('0x31')](_0x4b78ca[_0xd31e('0x32')],_0x4b78ca[_0xd31e('0x2f')]);_0x4fe89b[_0xd31e('0x34')]=_[_0xd31e('0x31')](_0x4b78ca[_0xd31e('0x32')],qs['fields'](_0x2ab54d[_0xd31e('0x2f')][_0xd31e('0x33')]));_0x4fe89b[_0xd31e('0x34')]=_0x4fe89b['attributes'][_0xd31e('0x35')]?_0x4fe89b[_0xd31e('0x34')]:_0x4b78ca[_0xd31e('0x32')];_0x4fe89b['order']=qs[_0xd31e('0x4b')](_0x2ab54d[_0xd31e('0x2f')]['sort']);_0x4fe89b[_0xd31e('0x38')]=qs[_0xd31e('0x39')](_[_0xd31e('0x3a')](_0x2ab54d[_0xd31e('0x2f')],_0x4b78ca[_0xd31e('0x39')]));if(_0x2ab54d['query'][_0xd31e('0x3b')]){_0x4fe89b[_0xd31e('0x38')]=_[_0xd31e('0x3c')](_0x4fe89b[_0xd31e('0x38')],{'$or':_[_0xd31e('0x2a')](_0x4fe89b[_0xd31e('0x34')],function(_0x22e814){var _0x4ce51b={};_0x4ce51b[_0x22e814]={'$like':'%'+_0x2ab54d['query']['filter']+'%'};return _0x4ce51b;})});}_0x4fe89b=_[_0xd31e('0x3c')]({},_0x4fe89b,_0x2ab54d[_0xd31e('0x4e')]);return _0x4d3e30[_0xd31e('0x4d')](_0x4fe89b);}})[_0xd31e('0x25')](function(_0x2312c7){if(_0x2312c7){_0x10457f=_0x2312c7[_0xd31e('0x35')];if(!_0x2ab54d['query'][_0xd31e('0x4c')](_0xd31e('0x36'))){_0x4fe89b[_0xd31e('0x21')]=qs[_0xd31e('0x21')](_0x2ab54d[_0xd31e('0x2f')]['limit']);_0x4fe89b[_0xd31e('0x20')]=qs[_0xd31e('0x20')](_0x2ab54d[_0xd31e('0x2f')][_0xd31e('0x20')]);}return _0x4d3e30[_0xd31e('0x4d')](_0x4fe89b);}})[_0xd31e('0x25')](function(_0x1522d4){if(_0x1522d4){return _0x1522d4?{'count':_0x10457f,'rows':_0x1522d4}:null;}})['then'](respondWithResult(_0x5d6b19,null))[_0xd31e('0x44')](handleError(_0x5d6b19,null));};exports[_0xd31e('0x4f')]=function(_0x39065f,_0x51459e,_0x45a322){var _0x3aaacd={};var _0x253b15={};var _0x1b3472;var _0x4be299;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x39065f[_0xd31e('0x45')]['id']}})['then'](handleEntityNotFound(_0x51459e,null))[_0xd31e('0x25')](function(_0x72ab68){if(_0x72ab68){_0x1b3472=_0x72ab68;_0x253b15[_0xd31e('0x32')]=_[_0xd31e('0x30')](db['Dynamics365Field'][_0xd31e('0x4a')]);_0x253b15[_0xd31e('0x2f')]=_['keys'](_0x39065f[_0xd31e('0x2f')]);_0x253b15['filters']=_[_0xd31e('0x31')](_0x253b15['model'],_0x253b15[_0xd31e('0x2f')]);_0x3aaacd[_0xd31e('0x34')]=_[_0xd31e('0x31')](_0x253b15[_0xd31e('0x32')],qs[_0xd31e('0x33')](_0x39065f[_0xd31e('0x2f')]['fields']));_0x3aaacd['attributes']=_0x3aaacd[_0xd31e('0x34')][_0xd31e('0x35')]?_0x3aaacd[_0xd31e('0x34')]:_0x253b15['model'];_0x3aaacd[_0xd31e('0x37')]=qs['sort'](_0x39065f['query']['sort']);_0x3aaacd[_0xd31e('0x38')]=qs[_0xd31e('0x39')](_['pick'](_0x39065f['query'],_0x253b15[_0xd31e('0x39')]));if(_0x39065f[_0xd31e('0x2f')][_0xd31e('0x3b')]){_0x3aaacd[_0xd31e('0x38')]=_[_0xd31e('0x3c')](_0x3aaacd[_0xd31e('0x38')],{'$or':_[_0xd31e('0x2a')](_0x3aaacd[_0xd31e('0x34')],function(_0x4a821e){var _0x72ca92={};_0x72ca92[_0x4a821e]={'$like':'%'+_0x39065f[_0xd31e('0x2f')]['filter']+'%'};return _0x72ca92;})});}_0x3aaacd=_['merge']({},_0x3aaacd,_0x39065f[_0xd31e('0x4e')]);return _0x1b3472[_0xd31e('0x4f')](_0x3aaacd);}})[_0xd31e('0x25')](function(_0x5b5ed4){if(_0x5b5ed4){_0x4be299=_0x5b5ed4[_0xd31e('0x35')];if(!_0x39065f[_0xd31e('0x2f')][_0xd31e('0x4c')](_0xd31e('0x36'))){_0x3aaacd['limit']=qs[_0xd31e('0x21')](_0x39065f[_0xd31e('0x2f')]['limit']);_0x3aaacd[_0xd31e('0x20')]=qs[_0xd31e('0x20')](_0x39065f[_0xd31e('0x2f')][_0xd31e('0x20')]);}return _0x1b3472[_0xd31e('0x4f')](_0x3aaacd);}})[_0xd31e('0x25')](function(_0x226487){if(_0x226487){return _0x226487?{'count':_0x4be299,'rows':_0x226487}:null;}})[_0xd31e('0x25')](respondWithResult(_0x51459e,null))[_0xd31e('0x44')](handleError(_0x51459e,null));}; \ No newline at end of file +var _0xa3b7=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','send','index','map','Dynamics365Configuration','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','update','find','getFields','findOne','Dynamics365Field','order','getSubjects','nolimit','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x5c66a9,_0x2eb507){var _0x4783b1=function(_0x4f5db5){while(--_0x4f5db5){_0x5c66a9['push'](_0x5c66a9['shift']());}};_0x4783b1(++_0x2eb507);}(_0xa3b7,0xf4));var _0x7a3b=function(_0x238830,_0x545f75){_0x238830=_0x238830-0x0;var _0x5917f0=_0xa3b7[_0x238830];return _0x5917f0;};'use strict';var emlformat=require(_0x7a3b('0x0'));var rimraf=require(_0x7a3b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7a3b('0x2'));var rp=require(_0x7a3b('0x3'));var moment=require(_0x7a3b('0x4'));var BPromise=require(_0x7a3b('0x5'));var Mustache=require(_0x7a3b('0x6'));var util=require(_0x7a3b('0x7'));var path=require(_0x7a3b('0x8'));var sox=require(_0x7a3b('0x9'));var csv=require(_0x7a3b('0xa'));var ejs=require(_0x7a3b('0xb'));var fs=require('fs');var fs_extra=require(_0x7a3b('0xc'));var _=require(_0x7a3b('0xd'));var squel=require(_0x7a3b('0xe'));var crypto=require(_0x7a3b('0xf'));var jsforce=require(_0x7a3b('0x10'));var deskjs=require(_0x7a3b('0x11'));var toCsv=require(_0x7a3b('0xa'));var querystring=require(_0x7a3b('0x12'));var Papa=require(_0x7a3b('0x13'));var Redis=require(_0x7a3b('0x14'));var authService=require(_0x7a3b('0x15'));var qs=require(_0x7a3b('0x16'));var as=require(_0x7a3b('0x17'));var hardwareService=require(_0x7a3b('0x18'));var logger=require(_0x7a3b('0x19'))(_0x7a3b('0x1a'));var utils=require(_0x7a3b('0x1b'));var config=require(_0x7a3b('0x1c'));var licenseUtil=require(_0x7a3b('0x1d'));var db=require(_0x7a3b('0x1e'))['db'];function respondWithStatusCode(_0x1a1311,_0x1e9e7c){_0x1e9e7c=_0x1e9e7c||0xcc;return function(_0x448595){if(_0x448595){return _0x1a1311[_0x7a3b('0x1f')](_0x1e9e7c);}return _0x1a1311[_0x7a3b('0x20')](_0x1e9e7c)[_0x7a3b('0x21')]();};}function respondWithResult(_0x24ca86,_0x5a7a66){_0x5a7a66=_0x5a7a66||0xc8;return function(_0x2cc782){if(_0x2cc782){return _0x24ca86[_0x7a3b('0x20')](_0x5a7a66)['json'](_0x2cc782);}};}function respondWithFilteredResult(_0xbcf3e8,_0x4676dd){return function(_0x4c7640){if(_0x4c7640){var _0x256b5d=typeof _0x4676dd[_0x7a3b('0x22')]===_0x7a3b('0x23')&&typeof _0x4676dd[_0x7a3b('0x24')]==='undefined';var _0x3eab64=_0x4c7640[_0x7a3b('0x25')];var _0x339447=_0x256b5d?0x0:_0x4676dd[_0x7a3b('0x22')];var _0x999d55=_0x256b5d?_0x4c7640['count']:_0x4676dd[_0x7a3b('0x22')]+_0x4676dd[_0x7a3b('0x24')];var _0x5d6cef;if(_0x999d55>=_0x3eab64){_0x999d55=_0x3eab64;_0x5d6cef=0xc8;}else{_0x5d6cef=0xce;}_0xbcf3e8[_0x7a3b('0x20')](_0x5d6cef);return _0xbcf3e8[_0x7a3b('0x26')]('Content-Range',_0x339447+'-'+_0x999d55+'/'+_0x3eab64)['json'](_0x4c7640);}return null;};}function patchUpdates(_0x3db348){return function(_0x7f951f){try{jsonpatch[_0x7a3b('0x27')](_0x7f951f,_0x3db348,!![]);}catch(_0xf5ed53){return BPromise[_0x7a3b('0x28')](_0xf5ed53);}return _0x7f951f[_0x7a3b('0x29')]();};}function saveUpdates(_0x11d907,_0x47b61c){return function(_0x35f313){if(_0x35f313){return _0x35f313['update'](_0x11d907)[_0x7a3b('0x2a')](function(_0x662259){return _0x662259;});}return null;};}function removeEntity(_0xfa8425,_0x4c2880){return function(_0x47a199){if(_0x47a199){return _0x47a199['destroy']()['then'](function(){_0xfa8425[_0x7a3b('0x20')](0xcc)[_0x7a3b('0x21')]();});}};}function handleEntityNotFound(_0x3a6006,_0x5ed5f6){return function(_0x1aca4c){if(!_0x1aca4c){_0x3a6006[_0x7a3b('0x1f')](0x194);}return _0x1aca4c;};}function handleError(_0x588a7c,_0x4aa686){_0x4aa686=_0x4aa686||0x1f4;return function(_0x413082){logger[_0x7a3b('0x2b')](_0x413082[_0x7a3b('0x2c')]);if(_0x413082[_0x7a3b('0x2d')]){delete _0x413082[_0x7a3b('0x2d')];}_0x588a7c[_0x7a3b('0x20')](_0x4aa686)[_0x7a3b('0x2e')](_0x413082);};}exports[_0x7a3b('0x2f')]=function(_0x2b46cc,_0x1276b4){var _0x23143e={},_0x4b5552={},_0xa5b603={'count':0x0,'rows':[]};var _0xe465dc=_[_0x7a3b('0x30')](db[_0x7a3b('0x31')]['rawAttributes'],function(_0x1209f1){return{'name':_0x1209f1[_0x7a3b('0x32')],'type':_0x1209f1[_0x7a3b('0x33')][_0x7a3b('0x34')]};});_0x4b5552[_0x7a3b('0x35')]=_[_0x7a3b('0x30')](_0xe465dc,_0x7a3b('0x2d'));_0x4b5552['query']=_[_0x7a3b('0x36')](_0x2b46cc[_0x7a3b('0x37')]);_0x4b5552[_0x7a3b('0x38')]=_['intersection'](_0x4b5552['model'],_0x4b5552[_0x7a3b('0x37')]);_0x23143e[_0x7a3b('0x39')]=_[_0x7a3b('0x3a')](_0x4b5552[_0x7a3b('0x35')],qs[_0x7a3b('0x3b')](_0x2b46cc['query'][_0x7a3b('0x3b')]));_0x23143e[_0x7a3b('0x39')]=_0x23143e[_0x7a3b('0x39')][_0x7a3b('0x3c')]?_0x23143e[_0x7a3b('0x39')]:_0x4b5552['model'];if(!_0x2b46cc[_0x7a3b('0x37')][_0x7a3b('0x3d')]('nolimit')){_0x23143e[_0x7a3b('0x24')]=qs['limit'](_0x2b46cc[_0x7a3b('0x37')][_0x7a3b('0x24')]);_0x23143e[_0x7a3b('0x22')]=qs[_0x7a3b('0x22')](_0x2b46cc[_0x7a3b('0x37')]['offset']);}_0x23143e['order']=qs[_0x7a3b('0x3e')](_0x2b46cc[_0x7a3b('0x37')][_0x7a3b('0x3e')]);_0x23143e[_0x7a3b('0x3f')]=qs[_0x7a3b('0x38')](_[_0x7a3b('0x40')](_0x2b46cc['query'],_0x4b5552[_0x7a3b('0x38')]),_0xe465dc);if(_0x2b46cc[_0x7a3b('0x37')][_0x7a3b('0x41')]){_0x23143e[_0x7a3b('0x3f')]=_[_0x7a3b('0x42')](_0x23143e[_0x7a3b('0x3f')],{'$or':_[_0x7a3b('0x30')](_0xe465dc,function(_0x4686ec){if(_0x4686ec[_0x7a3b('0x33')]!==_0x7a3b('0x43')){var _0x2ec40c={};_0x2ec40c[_0x4686ec['name']]={'$like':'%'+_0x2b46cc['query']['filter']+'%'};return _0x2ec40c;}})});}_0x23143e=_[_0x7a3b('0x42')]({},_0x23143e,_0x2b46cc[_0x7a3b('0x44')]);var _0x5f2629={'where':_0x23143e['where']};return db[_0x7a3b('0x31')][_0x7a3b('0x25')](_0x5f2629)[_0x7a3b('0x2a')](function(_0x5e59dd){_0xa5b603['count']=_0x5e59dd;if(_0x2b46cc['query'][_0x7a3b('0x45')]){_0x23143e[_0x7a3b('0x46')]=[{'all':!![]}];}return db[_0x7a3b('0x31')][_0x7a3b('0x47')](_0x23143e);})[_0x7a3b('0x2a')](function(_0x72b6bb){_0xa5b603['rows']=_0x72b6bb;return _0xa5b603;})[_0x7a3b('0x2a')](respondWithFilteredResult(_0x1276b4,_0x23143e))[_0x7a3b('0x48')](handleError(_0x1276b4,null));};exports[_0x7a3b('0x49')]=function(_0x480d48,_0x24e3d4){var _0x3acbf6={'raw':![],'where':{'id':_0x480d48[_0x7a3b('0x4a')]['id']}},_0x2fe912={};_0x2fe912['model']=_[_0x7a3b('0x36')](db[_0x7a3b('0x31')][_0x7a3b('0x4b')]);_0x2fe912['query']=_[_0x7a3b('0x36')](_0x480d48[_0x7a3b('0x37')]);_0x2fe912[_0x7a3b('0x38')]=_[_0x7a3b('0x3a')](_0x2fe912[_0x7a3b('0x35')],_0x2fe912[_0x7a3b('0x37')]);_0x3acbf6[_0x7a3b('0x39')]=_[_0x7a3b('0x3a')](_0x2fe912[_0x7a3b('0x35')],qs[_0x7a3b('0x3b')](_0x480d48[_0x7a3b('0x37')]['fields']));_0x3acbf6[_0x7a3b('0x39')]=_0x3acbf6['attributes'][_0x7a3b('0x3c')]?_0x3acbf6[_0x7a3b('0x39')]:_0x2fe912[_0x7a3b('0x35')];if(_0x480d48[_0x7a3b('0x37')][_0x7a3b('0x45')]){_0x3acbf6['include']=[{'all':!![]}];}_0x3acbf6=_[_0x7a3b('0x42')]({},_0x3acbf6,_0x480d48[_0x7a3b('0x44')]);return db[_0x7a3b('0x31')]['find'](_0x3acbf6)['then'](handleEntityNotFound(_0x24e3d4,null))[_0x7a3b('0x2a')](respondWithResult(_0x24e3d4,null))[_0x7a3b('0x48')](handleError(_0x24e3d4,null));};exports[_0x7a3b('0x4c')]=function(_0x3d5c12,_0x426c0f){return db['Dynamics365Configuration'][_0x7a3b('0x4c')](_0x3d5c12[_0x7a3b('0x4d')],{})['then'](respondWithResult(_0x426c0f,0xc9))[_0x7a3b('0x48')](handleError(_0x426c0f,null));};exports[_0x7a3b('0x4e')]=function(_0x42f992,_0x3bd6af){if(_0x42f992['body']['id']){delete _0x42f992[_0x7a3b('0x4d')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x42f992[_0x7a3b('0x4a')]['id']}})[_0x7a3b('0x2a')](handleEntityNotFound(_0x3bd6af,null))[_0x7a3b('0x2a')](saveUpdates(_0x42f992[_0x7a3b('0x4d')],null))[_0x7a3b('0x2a')](respondWithResult(_0x3bd6af,null))[_0x7a3b('0x48')](handleError(_0x3bd6af,null));};exports['destroy']=function(_0x3da354,_0x28bb1e){return db[_0x7a3b('0x31')][_0x7a3b('0x4f')]({'where':{'id':_0x3da354[_0x7a3b('0x4a')]['id']}})[_0x7a3b('0x2a')](handleEntityNotFound(_0x28bb1e,null))[_0x7a3b('0x2a')](removeEntity(_0x28bb1e,null))[_0x7a3b('0x48')](handleError(_0x28bb1e,null));};exports[_0x7a3b('0x50')]=function(_0x5cb9c1,_0x1e7e8a,_0x4a204e){var _0x21fc18={};var _0xb5727e={};var _0x263487;var _0x2b5ce3;return db['Dynamics365Configuration'][_0x7a3b('0x51')]({'where':{'id':_0x5cb9c1['params']['id']}})[_0x7a3b('0x2a')](handleEntityNotFound(_0x1e7e8a,null))['then'](function(_0x5cba96){if(_0x5cba96){_0x263487=_0x5cba96;_0xb5727e[_0x7a3b('0x35')]=_[_0x7a3b('0x36')](db[_0x7a3b('0x52')][_0x7a3b('0x4b')]);_0xb5727e[_0x7a3b('0x37')]=_[_0x7a3b('0x36')](_0x5cb9c1['query']);_0xb5727e[_0x7a3b('0x38')]=_['intersection'](_0xb5727e[_0x7a3b('0x35')],_0xb5727e[_0x7a3b('0x37')]);_0x21fc18[_0x7a3b('0x39')]=_[_0x7a3b('0x3a')](_0xb5727e['model'],qs[_0x7a3b('0x3b')](_0x5cb9c1[_0x7a3b('0x37')][_0x7a3b('0x3b')]));_0x21fc18['attributes']=_0x21fc18['attributes'][_0x7a3b('0x3c')]?_0x21fc18[_0x7a3b('0x39')]:_0xb5727e[_0x7a3b('0x35')];_0x21fc18[_0x7a3b('0x53')]=qs[_0x7a3b('0x3e')](_0x5cb9c1['query'][_0x7a3b('0x3e')]);_0x21fc18[_0x7a3b('0x3f')]=qs['filters'](_[_0x7a3b('0x40')](_0x5cb9c1[_0x7a3b('0x37')],_0xb5727e['filters']));if(_0x5cb9c1[_0x7a3b('0x37')][_0x7a3b('0x41')]){_0x21fc18['where']=_[_0x7a3b('0x42')](_0x21fc18['where'],{'$or':_[_0x7a3b('0x30')](_0x21fc18['attributes'],function(_0x32500d){var _0x416c48={};_0x416c48[_0x32500d]={'$like':'%'+_0x5cb9c1[_0x7a3b('0x37')][_0x7a3b('0x41')]+'%'};return _0x416c48;})});}_0x21fc18=_['merge']({},_0x21fc18,_0x5cb9c1[_0x7a3b('0x44')]);return _0x263487[_0x7a3b('0x50')](_0x21fc18);}})['then'](function(_0x27c100){if(_0x27c100){_0x2b5ce3=_0x27c100[_0x7a3b('0x3c')];if(!_0x5cb9c1['query'][_0x7a3b('0x3d')]('nolimit')){_0x21fc18[_0x7a3b('0x24')]=qs[_0x7a3b('0x24')](_0x5cb9c1['query'][_0x7a3b('0x24')]);_0x21fc18[_0x7a3b('0x22')]=qs[_0x7a3b('0x22')](_0x5cb9c1[_0x7a3b('0x37')][_0x7a3b('0x22')]);}return _0x263487[_0x7a3b('0x50')](_0x21fc18);}})[_0x7a3b('0x2a')](function(_0x23332e){if(_0x23332e){return _0x23332e?{'count':_0x2b5ce3,'rows':_0x23332e}:null;}})['then'](respondWithResult(_0x1e7e8a,null))[_0x7a3b('0x48')](handleError(_0x1e7e8a,null));};exports[_0x7a3b('0x54')]=function(_0x39dae7,_0x558117,_0x47ddb7){var _0x185e65={};var _0x37367d={};var _0x3a5286;var _0x4754b0;return db[_0x7a3b('0x31')]['findOne']({'where':{'id':_0x39dae7[_0x7a3b('0x4a')]['id']}})[_0x7a3b('0x2a')](handleEntityNotFound(_0x558117,null))[_0x7a3b('0x2a')](function(_0xbf09b8){if(_0xbf09b8){_0x3a5286=_0xbf09b8;_0x37367d[_0x7a3b('0x35')]=_['keys'](db[_0x7a3b('0x52')][_0x7a3b('0x4b')]);_0x37367d['query']=_[_0x7a3b('0x36')](_0x39dae7[_0x7a3b('0x37')]);_0x37367d[_0x7a3b('0x38')]=_[_0x7a3b('0x3a')](_0x37367d['model'],_0x37367d['query']);_0x185e65[_0x7a3b('0x39')]=_['intersection'](_0x37367d[_0x7a3b('0x35')],qs[_0x7a3b('0x3b')](_0x39dae7[_0x7a3b('0x37')][_0x7a3b('0x3b')]));_0x185e65['attributes']=_0x185e65['attributes'][_0x7a3b('0x3c')]?_0x185e65[_0x7a3b('0x39')]:_0x37367d[_0x7a3b('0x35')];_0x185e65[_0x7a3b('0x53')]=qs[_0x7a3b('0x3e')](_0x39dae7[_0x7a3b('0x37')][_0x7a3b('0x3e')]);_0x185e65[_0x7a3b('0x3f')]=qs[_0x7a3b('0x38')](_[_0x7a3b('0x40')](_0x39dae7[_0x7a3b('0x37')],_0x37367d['filters']));if(_0x39dae7[_0x7a3b('0x37')]['filter']){_0x185e65['where']=_[_0x7a3b('0x42')](_0x185e65[_0x7a3b('0x3f')],{'$or':_[_0x7a3b('0x30')](_0x185e65[_0x7a3b('0x39')],function(_0x3a1d8d){var _0x3873a0={};_0x3873a0[_0x3a1d8d]={'$like':'%'+_0x39dae7['query'][_0x7a3b('0x41')]+'%'};return _0x3873a0;})});}_0x185e65=_[_0x7a3b('0x42')]({},_0x185e65,_0x39dae7[_0x7a3b('0x44')]);return _0x3a5286[_0x7a3b('0x54')](_0x185e65);}})[_0x7a3b('0x2a')](function(_0x51968c){if(_0x51968c){_0x4754b0=_0x51968c['length'];if(!_0x39dae7[_0x7a3b('0x37')][_0x7a3b('0x3d')](_0x7a3b('0x55'))){_0x185e65[_0x7a3b('0x24')]=qs['limit'](_0x39dae7[_0x7a3b('0x37')][_0x7a3b('0x24')]);_0x185e65['offset']=qs[_0x7a3b('0x22')](_0x39dae7['query'][_0x7a3b('0x22')]);}return _0x3a5286[_0x7a3b('0x54')](_0x185e65);}})['then'](function(_0x21985c){if(_0x21985c){return _0x21985c?{'count':_0x4754b0,'rows':_0x21985c}:null;}})[_0x7a3b('0x2a')](respondWithResult(_0x558117,null))[_0x7a3b('0x48')](handleError(_0x558117,null));};exports[_0x7a3b('0x56')]=function(_0x1ccc3b,_0x7750bc,_0x4824f3){var _0x377d9b={};var _0x168e2d={};var _0x59e11d;var _0xfe9a22;return db[_0x7a3b('0x31')][_0x7a3b('0x51')]({'where':{'id':_0x1ccc3b[_0x7a3b('0x4a')]['id']}})[_0x7a3b('0x2a')](handleEntityNotFound(_0x7750bc,null))['then'](function(_0x18d7af){if(_0x18d7af){_0x59e11d=_0x18d7af;_0x168e2d[_0x7a3b('0x35')]=_[_0x7a3b('0x36')](db[_0x7a3b('0x52')][_0x7a3b('0x4b')]);_0x168e2d[_0x7a3b('0x37')]=_[_0x7a3b('0x36')](_0x1ccc3b[_0x7a3b('0x37')]);_0x168e2d['filters']=_[_0x7a3b('0x3a')](_0x168e2d[_0x7a3b('0x35')],_0x168e2d['query']);_0x377d9b[_0x7a3b('0x39')]=_[_0x7a3b('0x3a')](_0x168e2d[_0x7a3b('0x35')],qs[_0x7a3b('0x3b')](_0x1ccc3b['query'][_0x7a3b('0x3b')]));_0x377d9b['attributes']=_0x377d9b[_0x7a3b('0x39')]['length']?_0x377d9b['attributes']:_0x168e2d['model'];_0x377d9b[_0x7a3b('0x53')]=qs[_0x7a3b('0x3e')](_0x1ccc3b[_0x7a3b('0x37')][_0x7a3b('0x3e')]);_0x377d9b[_0x7a3b('0x3f')]=qs[_0x7a3b('0x38')](_['pick'](_0x1ccc3b[_0x7a3b('0x37')],_0x168e2d[_0x7a3b('0x38')]));if(_0x1ccc3b[_0x7a3b('0x37')]['filter']){_0x377d9b[_0x7a3b('0x3f')]=_['merge'](_0x377d9b[_0x7a3b('0x3f')],{'$or':_['map'](_0x377d9b['attributes'],function(_0x40dcf6){var _0x638aec={};_0x638aec[_0x40dcf6]={'$like':'%'+_0x1ccc3b[_0x7a3b('0x37')][_0x7a3b('0x41')]+'%'};return _0x638aec;})});}_0x377d9b=_[_0x7a3b('0x42')]({},_0x377d9b,_0x1ccc3b[_0x7a3b('0x44')]);return _0x59e11d[_0x7a3b('0x56')](_0x377d9b);}})[_0x7a3b('0x2a')](function(_0x4767f0){if(_0x4767f0){_0xfe9a22=_0x4767f0[_0x7a3b('0x3c')];if(!_0x1ccc3b[_0x7a3b('0x37')][_0x7a3b('0x3d')](_0x7a3b('0x55'))){_0x377d9b['limit']=qs['limit'](_0x1ccc3b[_0x7a3b('0x37')][_0x7a3b('0x24')]);_0x377d9b[_0x7a3b('0x22')]=qs['offset'](_0x1ccc3b[_0x7a3b('0x37')]['offset']);}return _0x59e11d[_0x7a3b('0x56')](_0x377d9b);}})['then'](function(_0x16d6b8){if(_0x16d6b8){return _0x16d6b8?{'count':_0xfe9a22,'rows':_0x16d6b8}:null;}})['then'](respondWithResult(_0x7750bc,null))[_0x7a3b('0x48')](handleError(_0x7750bc,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 7fafcbb..557d9a1 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 _0xaa88=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x35beff,_0x26451e){var _0x4a9967=function(_0x336f26){while(--_0x336f26){_0x35beff['push'](_0x35beff['shift']());}};_0x4a9967(++_0x26451e);}(_0xaa88,0x137));var _0x8aa8=function(_0x2468b5,_0x506b9e){_0x2468b5=_0x2468b5-0x0;var _0x1056e4=_0xaa88[_0x2468b5];return _0x1056e4;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var moment=require('moment');var BPromise=require(_0x8aa8('0x4'));var rp=require(_0x8aa8('0x5'));var fs=require('fs');var path=require(_0x8aa8('0x6'));var rimraf=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var attributes=require(_0x8aa8('0x9'));module['exports']=function(_0x5bda0d,_0x460042){return _0x5bda0d['define'](_0x8aa8('0xa'),attributes,{'tableName':_0x8aa8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0x5142b4,_0x3d4d32){var _0x386752=function(_0x1ba0a7){while(--_0x1ba0a7){_0x5142b4['push'](_0x5142b4['shift']());}};_0x386752(++_0x3d4d32);}(_0xedd9,0xfc));var _0x9edd=function(_0x5eea3b,_0x26c54b){_0x5eea3b=_0x5eea3b-0x0;var _0x45c930=_0xedd9[_0x5eea3b];return _0x45c930;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 1615f20..0d3a3f5 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 _0xc4a2=['request\x20sent','debug','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xc4a2,0xd7));var _0x2c4a=function(_0x39508a,_0x4205dd){_0x39508a=_0x39508a-0x0;var _0x30c957=_0xc4a2[_0x39508a];return _0x30c957;};'use strict';var _=require(_0x2c4a('0x0'));var util=require('util');var moment=require(_0x2c4a('0x1'));var BPromise=require(_0x2c4a('0x2'));var rs=require(_0x2c4a('0x3'));var fs=require('fs');var Redis=require(_0x2c4a('0x4'));var db=require(_0x2c4a('0x5'))['db'];var utils=require(_0x2c4a('0x6'));var logger=require('../../config/logger')(_0x2c4a('0x7'));var config=require(_0x2c4a('0x8'));var jayson=require(_0x2c4a('0x9'));var client=jayson[_0x2c4a('0xa')][_0x2c4a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36920d,_0x377763,_0xf1eb4e){return new BPromise(function(_0x9e2050,_0x1c6af5){return client[_0x2c4a('0xc')](_0x36920d,_0xf1eb4e)[_0x2c4a('0xd')](function(_0xa353fd){logger[_0x2c4a('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x377763,_0x2c4a('0xf'));logger[_0x2c4a('0x10')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x377763,_0x2c4a('0xf'),JSON['stringify'](_0xa353fd));if(_0xa353fd[_0x2c4a('0x11')]){if(_0xa353fd[_0x2c4a('0x11')][_0x2c4a('0x12')]===0x1f4){logger[_0x2c4a('0x11')](_0x2c4a('0x13'),_0x377763,_0xa353fd['error'][_0x2c4a('0x14')]);return _0x1c6af5(_0xa353fd[_0x2c4a('0x11')]['message']);}logger[_0x2c4a('0x11')](_0x2c4a('0x13'),_0x377763,_0xa353fd[_0x2c4a('0x11')][_0x2c4a('0x14')]);return _0x9e2050(_0xa353fd[_0x2c4a('0x11')][_0x2c4a('0x14')]);}else{logger['info'](_0x2c4a('0x13'),_0x377763,_0x2c4a('0xf'));_0x9e2050(_0xa353fd[_0x2c4a('0x15')]['message']);}})[_0x2c4a('0x16')](function(_0x3b00fe){logger[_0x2c4a('0x11')](_0x2c4a('0x13'),_0x377763,_0x3b00fe);_0x1c6af5(_0x3b00fe);});});} \ No newline at end of file +var _0xea42=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug'];(function(_0x4f8909,_0x127885){var _0x8b66ef=function(_0x3b4891){while(--_0x3b4891){_0x4f8909['push'](_0x4f8909['shift']());}};_0x8b66ef(++_0x127885);}(_0xea42,0x81));var _0x2ea4=function(_0x300a2f,_0x54bb3c){_0x300a2f=_0x300a2f-0x0;var _0x5ee082=_0xea42[_0x300a2f];return _0x5ee082;};'use strict';var _=require(_0x2ea4('0x0'));var util=require(_0x2ea4('0x1'));var moment=require(_0x2ea4('0x2'));var BPromise=require(_0x2ea4('0x3'));var rs=require(_0x2ea4('0x4'));var fs=require('fs');var Redis=require(_0x2ea4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2ea4('0x6'))(_0x2ea4('0x7'));var config=require(_0x2ea4('0x8'));var jayson=require(_0x2ea4('0x9'));var client=jayson[_0x2ea4('0xa')][_0x2ea4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39276b,_0x1cff7c,_0xf66f90){return new BPromise(function(_0x44668e,_0x473f15){return client[_0x2ea4('0xc')](_0x39276b,_0xf66f90)[_0x2ea4('0xd')](function(_0x12627d){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x1cff7c,'request\x20sent');logger[_0x2ea4('0xe')](_0x2ea4('0xf'),_0x1cff7c,_0x2ea4('0x10'),JSON[_0x2ea4('0x11')](_0x12627d));if(_0x12627d[_0x2ea4('0x12')]){if(_0x12627d['error'][_0x2ea4('0x13')]===0x1f4){logger[_0x2ea4('0x12')](_0x2ea4('0x14'),_0x1cff7c,_0x12627d[_0x2ea4('0x12')][_0x2ea4('0x15')]);return _0x473f15(_0x12627d[_0x2ea4('0x12')][_0x2ea4('0x15')]);}logger['error'](_0x2ea4('0x14'),_0x1cff7c,_0x12627d[_0x2ea4('0x12')][_0x2ea4('0x15')]);return _0x44668e(_0x12627d[_0x2ea4('0x12')][_0x2ea4('0x15')]);}else{logger[_0x2ea4('0x16')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1cff7c,_0x2ea4('0x10'));_0x44668e(_0x12627d[_0x2ea4('0x17')]['message']);}})['catch'](function(_0x1ffead){logger[_0x2ea4('0x12')](_0x2ea4('0x14'),_0x1cff7c,_0x1ffead);_0x473f15(_0x1ffead);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 9c587d9..ce7fbd6 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 _0x52a4=['destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','put','update'];(function(_0x34ffbe,_0x3658d8){var _0x58a04c=function(_0x6f5047){while(--_0x6f5047){_0x34ffbe['push'](_0x34ffbe['shift']());}};_0x58a04c(++_0x3658d8);}(_0x52a4,0x1f2));var _0x452a=function(_0x2a1e0a,_0xfbbc49){_0x2a1e0a=_0x2a1e0a-0x0;var _0x5ac121=_0x52a4[_0x2a1e0a];return _0x5ac121;};'use strict';var multer=require('multer');var util=require(_0x452a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x452a('0x1'));var router=express[_0x452a('0x2')]();var fs_extra=require(_0x452a('0x3'));var auth=require(_0x452a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x452a('0x5'));var controller=require(_0x452a('0x6'));router[_0x452a('0x7')]('/',auth['isAuthenticated'](),controller[_0x452a('0x8')]);router['get'](_0x452a('0x9'),auth[_0x452a('0xa')](),controller[_0x452a('0xb')]);router['post']('/',auth[_0x452a('0xa')](),controller['create']);router[_0x452a('0xc')]('/:id',auth[_0x452a('0xa')](),controller[_0x452a('0xd')]);router['delete'](_0x452a('0x9'),auth['isAuthenticated'](),controller[_0x452a('0xe')]);module[_0x452a('0xf')]=router; \ No newline at end of file +var _0xdeda=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','multer'];(function(_0x10222d,_0x3a0c2a){var _0x3dd89d=function(_0x1768fc){while(--_0x1768fc){_0x10222d['push'](_0x10222d['shift']());}};_0x3dd89d(++_0x3a0c2a);}(_0xdeda,0x77));var _0xaded=function(_0x5f0d96,_0x350939){_0x5f0d96=_0x5f0d96-0x0;var _0x2771b0=_0xdeda[_0x5f0d96];return _0x2771b0;};'use strict';var multer=require(_0xaded('0x0'));var util=require(_0xaded('0x1'));var path=require(_0xaded('0x2'));var timeout=require(_0xaded('0x3'));var express=require(_0xaded('0x4'));var router=express[_0xaded('0x5')]();var fs_extra=require(_0xaded('0x6'));var auth=require(_0xaded('0x7'));var interaction=require(_0xaded('0x8'));var config=require(_0xaded('0x9'));var controller=require(_0xaded('0xa'));router['get']('/',auth[_0xaded('0xb')](),controller[_0xaded('0xc')]);router[_0xaded('0xd')](_0xaded('0xe'),auth[_0xaded('0xb')](),controller['show']);router[_0xaded('0xf')]('/',auth[_0xaded('0xb')](),controller[_0xaded('0x10')]);router[_0xaded('0x11')](_0xaded('0xe'),auth['isAuthenticated'](),controller[_0xaded('0x12')]);router[_0xaded('0x13')](_0xaded('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index e8d2ffa..5611715 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 _0x75bd=['STRING','ENUM','sequelize','exports','variable','customVariable','keyValue','picklist','string'];(function(_0x2f2c82,_0x131cac){var _0x26fb26=function(_0x2c3cc1){while(--_0x2c3cc1){_0x2f2c82['push'](_0x2f2c82['shift']());}};_0x26fb26(++_0x131cac);}(_0x75bd,0x1df));var _0xd75b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x75bd[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xd75b('0x0'));module[_0xd75b('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xd75b('0x2'),_0xd75b('0x3'),_0xd75b('0x4'),_0xd75b('0x5')),'defaultValue':_0xd75b('0x6')},'content':{'type':Sequelize[_0xd75b('0x7')]},'key':{'type':Sequelize[_0xd75b('0x7')]},'keyType':{'type':Sequelize[_0xd75b('0x8')]('string',_0xd75b('0x2'),_0xd75b('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd75b('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd75b('0x7')]}}; \ No newline at end of file +var _0xdc10=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0xdc10,0x19f));var _0x0dc1=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xdc10[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x0dc1('0x0'));module[_0x0dc1('0x1')]={'type':{'type':Sequelize[_0x0dc1('0x2')](_0x0dc1('0x3'),_0x0dc1('0x4'),_0x0dc1('0x5'),_0x0dc1('0x6'),'picklist'),'defaultValue':_0x0dc1('0x3')},'content':{'type':Sequelize[_0x0dc1('0x7')]},'key':{'type':Sequelize[_0x0dc1('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x0dc1('0x3'),_0x0dc1('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x0dc1('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0dc1('0x7')]},'customField':{'type':Sequelize[_0x0dc1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0dc1('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 7282e13..a5a7c9a 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 _0x1093=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','keys','intersection','find','create','body','params','catch','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','attributes'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x1093,0x1b5));var _0x3109=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x1093[_0x2763f2];return _0x3ef471;};'use strict';var emlformat=require(_0x3109('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3109('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3109('0x2'));var moment=require(_0x3109('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3109('0x4'));var util=require('util');var path=require(_0x3109('0x5'));var sox=require(_0x3109('0x6'));var csv=require(_0x3109('0x7'));var ejs=require(_0x3109('0x8'));var fs=require('fs');var fs_extra=require(_0x3109('0x9'));var _=require(_0x3109('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3109('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3109('0x7'));var querystring=require(_0x3109('0xc'));var Papa=require(_0x3109('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3109('0xe'))(_0x3109('0xf'));var utils=require(_0x3109('0x10'));var config=require(_0x3109('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x3109('0x12'))['db'];function respondWithStatusCode(_0x516881,_0x1b8b42){_0x1b8b42=_0x1b8b42||0xcc;return function(_0x1f1729){if(_0x1f1729){return _0x516881['sendStatus'](_0x1b8b42);}return _0x516881[_0x3109('0x13')](_0x1b8b42)[_0x3109('0x14')]();};}function respondWithResult(_0x4d518f,_0x29d1ca){_0x29d1ca=_0x29d1ca||0xc8;return function(_0x38f2fd){if(_0x38f2fd){return _0x4d518f[_0x3109('0x13')](_0x29d1ca)[_0x3109('0x15')](_0x38f2fd);}};}function respondWithFilteredResult(_0x4cd38d,_0x39d8ce){return function(_0x596e1f){if(_0x596e1f){var _0x14883e=typeof _0x39d8ce[_0x3109('0x16')]==='undefined'&&typeof _0x39d8ce[_0x3109('0x17')]==='undefined';var _0x2d7518=_0x596e1f[_0x3109('0x18')];var _0x2dc1b7=_0x14883e?0x0:_0x39d8ce['offset'];var _0x2fff44=_0x14883e?_0x596e1f[_0x3109('0x18')]:_0x39d8ce[_0x3109('0x16')]+_0x39d8ce['limit'];var _0x456181;if(_0x2fff44>=_0x2d7518){_0x2fff44=_0x2d7518;_0x456181=0xc8;}else{_0x456181=0xce;}_0x4cd38d[_0x3109('0x13')](_0x456181);return _0x4cd38d[_0x3109('0x19')](_0x3109('0x1a'),_0x2dc1b7+'-'+_0x2fff44+'/'+_0x2d7518)['json'](_0x596e1f);}return null;};}function patchUpdates(_0x45b665){return function(_0x24838b){try{jsonpatch[_0x3109('0x1b')](_0x24838b,_0x45b665,!![]);}catch(_0x40f81e){return BPromise[_0x3109('0x1c')](_0x40f81e);}return _0x24838b[_0x3109('0x1d')]();};}function saveUpdates(_0x340359,_0x38e813){return function(_0x599285){if(_0x599285){return _0x599285[_0x3109('0x1e')](_0x340359)[_0x3109('0x1f')](function(_0x25a9ec){return _0x25a9ec;});}return null;};}function removeEntity(_0x56054c,_0x40e7e1){return function(_0x1c0918){if(_0x1c0918){return _0x1c0918[_0x3109('0x20')]()[_0x3109('0x1f')](function(){_0x56054c[_0x3109('0x13')](0xcc)[_0x3109('0x14')]();});}};}function handleEntityNotFound(_0x3a23f,_0x27e28b){return function(_0x2922c3){if(!_0x2922c3){_0x3a23f[_0x3109('0x21')](0x194);}return _0x2922c3;};}function handleError(_0x1f74e5,_0x5b043b){_0x5b043b=_0x5b043b||0x1f4;return function(_0x3d7e98){logger['error'](_0x3d7e98['stack']);if(_0x3d7e98[_0x3109('0x22')]){delete _0x3d7e98[_0x3109('0x22')];}_0x1f74e5['status'](_0x5b043b)[_0x3109('0x23')](_0x3d7e98);};}exports[_0x3109('0x24')]=function(_0x4ff64b,_0x2632ed){var _0x45e1e1={},_0xa820f={},_0x3a90df={'count':0x0,'rows':[]};var _0x25799d=_[_0x3109('0x25')](db[_0x3109('0x26')][_0x3109('0x27')],function(_0x2c4486){return{'name':_0x2c4486[_0x3109('0x28')],'type':_0x2c4486[_0x3109('0x29')][_0x3109('0x2a')]};});_0xa820f[_0x3109('0x2b')]=_[_0x3109('0x25')](_0x25799d,'name');_0xa820f[_0x3109('0x2c')]=_['keys'](_0x4ff64b[_0x3109('0x2c')]);_0xa820f['filters']=_['intersection'](_0xa820f['model'],_0xa820f['query']);_0x45e1e1[_0x3109('0x2d')]=_['intersection'](_0xa820f[_0x3109('0x2b')],qs[_0x3109('0x2e')](_0x4ff64b[_0x3109('0x2c')][_0x3109('0x2e')]));_0x45e1e1[_0x3109('0x2d')]=_0x45e1e1[_0x3109('0x2d')][_0x3109('0x2f')]?_0x45e1e1['attributes']:_0xa820f[_0x3109('0x2b')];if(!_0x4ff64b['query'][_0x3109('0x30')](_0x3109('0x31'))){_0x45e1e1[_0x3109('0x17')]=qs[_0x3109('0x17')](_0x4ff64b[_0x3109('0x2c')][_0x3109('0x17')]);_0x45e1e1[_0x3109('0x16')]=qs[_0x3109('0x16')](_0x4ff64b[_0x3109('0x2c')][_0x3109('0x16')]);}_0x45e1e1[_0x3109('0x32')]=qs[_0x3109('0x33')](_0x4ff64b[_0x3109('0x2c')][_0x3109('0x33')]);_0x45e1e1[_0x3109('0x34')]=qs['filters'](_['pick'](_0x4ff64b[_0x3109('0x2c')],_0xa820f[_0x3109('0x35')]),_0x25799d);if(_0x4ff64b[_0x3109('0x2c')][_0x3109('0x36')]){_0x45e1e1[_0x3109('0x34')]=_['merge'](_0x45e1e1[_0x3109('0x34')],{'$or':_[_0x3109('0x25')](_0x25799d,function(_0x55bbf7){if(_0x55bbf7[_0x3109('0x29')]!==_0x3109('0x37')){var _0x1dd2f2={};_0x1dd2f2[_0x55bbf7[_0x3109('0x22')]]={'$like':'%'+_0x4ff64b[_0x3109('0x2c')][_0x3109('0x36')]+'%'};return _0x1dd2f2;}})});}_0x45e1e1=_[_0x3109('0x38')]({},_0x45e1e1,_0x4ff64b[_0x3109('0x39')]);var _0x1ea08d={'where':_0x45e1e1[_0x3109('0x34')]};return db[_0x3109('0x26')][_0x3109('0x18')](_0x1ea08d)['then'](function(_0x585dd6){_0x3a90df[_0x3109('0x18')]=_0x585dd6;if(_0x4ff64b[_0x3109('0x2c')][_0x3109('0x3a')]){_0x45e1e1[_0x3109('0x3b')]=[{'all':!![]}];}return db[_0x3109('0x26')][_0x3109('0x3c')](_0x45e1e1);})[_0x3109('0x1f')](function(_0x1913ac){_0x3a90df['rows']=_0x1913ac;return _0x3a90df;})['then'](respondWithFilteredResult(_0x2632ed,_0x45e1e1))['catch'](handleError(_0x2632ed,null));};exports[_0x3109('0x3d')]=function(_0x326f00,_0x38b5f4){var _0x2b66ea={'raw':!![],'where':{'id':_0x326f00['params']['id']}},_0x28968d={};_0x28968d[_0x3109('0x2b')]=_[_0x3109('0x3e')](db['Dynamics365Field']['rawAttributes']);_0x28968d['query']=_[_0x3109('0x3e')](_0x326f00['query']);_0x28968d[_0x3109('0x35')]=_['intersection'](_0x28968d[_0x3109('0x2b')],_0x28968d[_0x3109('0x2c')]);_0x2b66ea[_0x3109('0x2d')]=_[_0x3109('0x3f')](_0x28968d[_0x3109('0x2b')],qs[_0x3109('0x2e')](_0x326f00[_0x3109('0x2c')][_0x3109('0x2e')]));_0x2b66ea[_0x3109('0x2d')]=_0x2b66ea['attributes']['length']?_0x2b66ea[_0x3109('0x2d')]:_0x28968d[_0x3109('0x2b')];if(_0x326f00[_0x3109('0x2c')][_0x3109('0x3a')]){_0x2b66ea[_0x3109('0x3b')]=[{'all':!![]}];}_0x2b66ea=_['merge']({},_0x2b66ea,_0x326f00[_0x3109('0x39')]);return db[_0x3109('0x26')][_0x3109('0x40')](_0x2b66ea)[_0x3109('0x1f')](handleEntityNotFound(_0x38b5f4,null))[_0x3109('0x1f')](respondWithResult(_0x38b5f4,null))['catch'](handleError(_0x38b5f4,null));};exports[_0x3109('0x41')]=function(_0x3e2ba4,_0x1a899d){return db[_0x3109('0x26')][_0x3109('0x41')](_0x3e2ba4['body'],{})['then'](respondWithResult(_0x1a899d,0xc9))['catch'](handleError(_0x1a899d,null));};exports[_0x3109('0x1e')]=function(_0x3d2c94,_0x543f25){if(_0x3d2c94[_0x3109('0x42')]['id']){delete _0x3d2c94[_0x3109('0x42')]['id'];}return db['Dynamics365Field'][_0x3109('0x40')]({'where':{'id':_0x3d2c94['params']['id']}})['then'](handleEntityNotFound(_0x543f25,null))[_0x3109('0x1f')](saveUpdates(_0x3d2c94[_0x3109('0x42')],null))[_0x3109('0x1f')](respondWithResult(_0x543f25,null))['catch'](handleError(_0x543f25,null));};exports[_0x3109('0x20')]=function(_0x1b4a0e,_0x32131d){return db[_0x3109('0x26')][_0x3109('0x40')]({'where':{'id':_0x1b4a0e[_0x3109('0x43')]['id']}})[_0x3109('0x1f')](handleEntityNotFound(_0x32131d,null))[_0x3109('0x1f')](removeEntity(_0x32131d,null))[_0x3109('0x44')](handleError(_0x32131d,null));}; \ No newline at end of file +var _0xb856=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','error','stack','name','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','params','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5b1bab,_0x2de8dd){var _0x25600d=function(_0x5a1149){while(--_0x5a1149){_0x5b1bab['push'](_0x5b1bab['shift']());}};_0x25600d(++_0x2de8dd);}(_0xb856,0x147));var _0x6b85=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb856[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b85('0x0'));var zipdir=require(_0x6b85('0x1'));var jsonpatch=require(_0x6b85('0x2'));var rp=require(_0x6b85('0x3'));var moment=require(_0x6b85('0x4'));var BPromise=require(_0x6b85('0x5'));var Mustache=require('mustache');var util=require(_0x6b85('0x6'));var path=require('path');var sox=require(_0x6b85('0x7'));var csv=require(_0x6b85('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b85('0x9'));var _=require(_0x6b85('0xa'));var squel=require(_0x6b85('0xb'));var crypto=require(_0x6b85('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6b85('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6b85('0xd'));var authService=require(_0x6b85('0xe'));var qs=require(_0x6b85('0xf'));var as=require(_0x6b85('0x10'));var hardwareService=require(_0x6b85('0x11'));var logger=require(_0x6b85('0x12'))('api');var utils=require(_0x6b85('0x13'));var config=require(_0x6b85('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6b85('0x15'))['db'];function respondWithStatusCode(_0xa9516d,_0x3e0e6b){_0x3e0e6b=_0x3e0e6b||0xcc;return function(_0x258808){if(_0x258808){return _0xa9516d[_0x6b85('0x16')](_0x3e0e6b);}return _0xa9516d[_0x6b85('0x17')](_0x3e0e6b)[_0x6b85('0x18')]();};}function respondWithResult(_0x328a75,_0x5f1258){_0x5f1258=_0x5f1258||0xc8;return function(_0x56cdbf){if(_0x56cdbf){return _0x328a75[_0x6b85('0x17')](_0x5f1258)['json'](_0x56cdbf);}};}function respondWithFilteredResult(_0x30e38e,_0x4f7d2c){return function(_0x17c8c6){if(_0x17c8c6){var _0x200dff=typeof _0x4f7d2c[_0x6b85('0x19')]===_0x6b85('0x1a')&&typeof _0x4f7d2c[_0x6b85('0x1b')]==='undefined';var _0x2ad5b1=_0x17c8c6[_0x6b85('0x1c')];var _0x108aac=_0x200dff?0x0:_0x4f7d2c[_0x6b85('0x19')];var _0x43e39c=_0x200dff?_0x17c8c6['count']:_0x4f7d2c[_0x6b85('0x19')]+_0x4f7d2c[_0x6b85('0x1b')];var _0x473dce;if(_0x43e39c>=_0x2ad5b1){_0x43e39c=_0x2ad5b1;_0x473dce=0xc8;}else{_0x473dce=0xce;}_0x30e38e[_0x6b85('0x17')](_0x473dce);return _0x30e38e['set'](_0x6b85('0x1d'),_0x108aac+'-'+_0x43e39c+'/'+_0x2ad5b1)[_0x6b85('0x1e')](_0x17c8c6);}return null;};}function patchUpdates(_0x42bdcb){return function(_0x442bb0){try{jsonpatch['apply'](_0x442bb0,_0x42bdcb,!![]);}catch(_0x582223){return BPromise[_0x6b85('0x1f')](_0x582223);}return _0x442bb0[_0x6b85('0x20')]();};}function saveUpdates(_0x326468,_0x245851){return function(_0x462a50){if(_0x462a50){return _0x462a50[_0x6b85('0x21')](_0x326468)[_0x6b85('0x22')](function(_0x393551){return _0x393551;});}return null;};}function removeEntity(_0x454892,_0x2fcd2f){return function(_0x5e573f){if(_0x5e573f){return _0x5e573f[_0x6b85('0x23')]()[_0x6b85('0x22')](function(){_0x454892[_0x6b85('0x17')](0xcc)[_0x6b85('0x18')]();});}};}function handleEntityNotFound(_0x1a189c,_0x46065d){return function(_0x3de637){if(!_0x3de637){_0x1a189c[_0x6b85('0x16')](0x194);}return _0x3de637;};}function handleError(_0x3285ce,_0x1c3ab7){_0x1c3ab7=_0x1c3ab7||0x1f4;return function(_0x36529d){logger[_0x6b85('0x24')](_0x36529d[_0x6b85('0x25')]);if(_0x36529d['name']){delete _0x36529d[_0x6b85('0x26')];}_0x3285ce['status'](_0x1c3ab7)['send'](_0x36529d);};}exports['index']=function(_0x59e342,_0x3516c7){var _0xb438e6={},_0x3d2422={},_0x48bba1={'count':0x0,'rows':[]};var _0x4e806f=_[_0x6b85('0x27')](db[_0x6b85('0x28')][_0x6b85('0x29')],function(_0x36ba9a){return{'name':_0x36ba9a[_0x6b85('0x2a')],'type':_0x36ba9a[_0x6b85('0x2b')][_0x6b85('0x2c')]};});_0x3d2422[_0x6b85('0x2d')]=_[_0x6b85('0x27')](_0x4e806f,_0x6b85('0x26'));_0x3d2422[_0x6b85('0x2e')]=_[_0x6b85('0x2f')](_0x59e342['query']);_0x3d2422[_0x6b85('0x30')]=_[_0x6b85('0x31')](_0x3d2422['model'],_0x3d2422[_0x6b85('0x2e')]);_0xb438e6[_0x6b85('0x32')]=_[_0x6b85('0x31')](_0x3d2422[_0x6b85('0x2d')],qs['fields'](_0x59e342['query'][_0x6b85('0x33')]));_0xb438e6[_0x6b85('0x32')]=_0xb438e6[_0x6b85('0x32')][_0x6b85('0x34')]?_0xb438e6['attributes']:_0x3d2422[_0x6b85('0x2d')];if(!_0x59e342[_0x6b85('0x2e')][_0x6b85('0x35')](_0x6b85('0x36'))){_0xb438e6['limit']=qs[_0x6b85('0x1b')](_0x59e342[_0x6b85('0x2e')][_0x6b85('0x1b')]);_0xb438e6[_0x6b85('0x19')]=qs[_0x6b85('0x19')](_0x59e342[_0x6b85('0x2e')][_0x6b85('0x19')]);}_0xb438e6['order']=qs[_0x6b85('0x37')](_0x59e342['query']['sort']);_0xb438e6[_0x6b85('0x38')]=qs['filters'](_['pick'](_0x59e342[_0x6b85('0x2e')],_0x3d2422['filters']),_0x4e806f);if(_0x59e342['query'][_0x6b85('0x39')]){_0xb438e6[_0x6b85('0x38')]=_[_0x6b85('0x3a')](_0xb438e6[_0x6b85('0x38')],{'$or':_[_0x6b85('0x27')](_0x4e806f,function(_0x198125){if(_0x198125['type']!==_0x6b85('0x3b')){var _0x4fbc4e={};_0x4fbc4e[_0x198125['name']]={'$like':'%'+_0x59e342[_0x6b85('0x2e')][_0x6b85('0x39')]+'%'};return _0x4fbc4e;}})});}_0xb438e6=_['merge']({},_0xb438e6,_0x59e342[_0x6b85('0x3c')]);var _0x470225={'where':_0xb438e6['where']};return db[_0x6b85('0x28')][_0x6b85('0x1c')](_0x470225)[_0x6b85('0x22')](function(_0x4950c9){_0x48bba1[_0x6b85('0x1c')]=_0x4950c9;if(_0x59e342[_0x6b85('0x2e')]['includeAll']){_0xb438e6[_0x6b85('0x3d')]=[{'all':!![]}];}return db[_0x6b85('0x28')][_0x6b85('0x3e')](_0xb438e6);})[_0x6b85('0x22')](function(_0x3ad993){_0x48bba1['rows']=_0x3ad993;return _0x48bba1;})[_0x6b85('0x22')](respondWithFilteredResult(_0x3516c7,_0xb438e6))[_0x6b85('0x3f')](handleError(_0x3516c7,null));};exports['show']=function(_0xe6897f,_0x20a410){var _0x3ea4b1={'raw':!![],'where':{'id':_0xe6897f[_0x6b85('0x40')]['id']}},_0x1bdb6e={};_0x1bdb6e[_0x6b85('0x2d')]=_[_0x6b85('0x2f')](db['Dynamics365Field'][_0x6b85('0x29')]);_0x1bdb6e[_0x6b85('0x2e')]=_[_0x6b85('0x2f')](_0xe6897f[_0x6b85('0x2e')]);_0x1bdb6e['filters']=_[_0x6b85('0x31')](_0x1bdb6e[_0x6b85('0x2d')],_0x1bdb6e[_0x6b85('0x2e')]);_0x3ea4b1['attributes']=_[_0x6b85('0x31')](_0x1bdb6e[_0x6b85('0x2d')],qs[_0x6b85('0x33')](_0xe6897f['query'][_0x6b85('0x33')]));_0x3ea4b1[_0x6b85('0x32')]=_0x3ea4b1[_0x6b85('0x32')][_0x6b85('0x34')]?_0x3ea4b1[_0x6b85('0x32')]:_0x1bdb6e[_0x6b85('0x2d')];if(_0xe6897f[_0x6b85('0x2e')][_0x6b85('0x41')]){_0x3ea4b1[_0x6b85('0x3d')]=[{'all':!![]}];}_0x3ea4b1=_[_0x6b85('0x3a')]({},_0x3ea4b1,_0xe6897f[_0x6b85('0x3c')]);return db[_0x6b85('0x28')][_0x6b85('0x42')](_0x3ea4b1)[_0x6b85('0x22')](handleEntityNotFound(_0x20a410,null))['then'](respondWithResult(_0x20a410,null))[_0x6b85('0x3f')](handleError(_0x20a410,null));};exports[_0x6b85('0x43')]=function(_0x5174be,_0x3faa17){return db[_0x6b85('0x28')]['create'](_0x5174be[_0x6b85('0x44')],{})[_0x6b85('0x22')](respondWithResult(_0x3faa17,0xc9))[_0x6b85('0x3f')](handleError(_0x3faa17,null));};exports['update']=function(_0xbcdaec,_0x5ba832){if(_0xbcdaec[_0x6b85('0x44')]['id']){delete _0xbcdaec[_0x6b85('0x44')]['id'];}return db[_0x6b85('0x28')][_0x6b85('0x42')]({'where':{'id':_0xbcdaec['params']['id']}})[_0x6b85('0x22')](handleEntityNotFound(_0x5ba832,null))[_0x6b85('0x22')](saveUpdates(_0xbcdaec['body'],null))[_0x6b85('0x22')](respondWithResult(_0x5ba832,null))[_0x6b85('0x3f')](handleError(_0x5ba832,null));};exports[_0x6b85('0x23')]=function(_0x4dac34,_0x4818ac){return db[_0x6b85('0x28')][_0x6b85('0x42')]({'where':{'id':_0x4dac34[_0x6b85('0x40')]['id']}})['then'](handleEntityNotFound(_0x4818ac,null))['then'](removeEntity(_0x4818ac,null))[_0x6b85('0x3f')](handleError(_0x4818ac,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 3477dda..d4ff1e6 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 _0x2109=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','idField','FieldId'];(function(_0x23c86f,_0x4cdf3b){var _0x4475c2=function(_0x2d562d){while(--_0x2d562d){_0x23c86f['push'](_0x23c86f['shift']());}};_0x4475c2(++_0x4cdf3b);}(_0x2109,0x70));var _0x9210=function(_0x4f0501,_0x2754d4){_0x4f0501=_0x4f0501-0x0;var _0x22845e=_0x2109[_0x4f0501];return _0x22845e;};'use strict';var _=require(_0x9210('0x0'));var util=require(_0x9210('0x1'));var logger=require(_0x9210('0x2'))(_0x9210('0x3'));var moment=require(_0x9210('0x4'));var BPromise=require(_0x9210('0x5'));var rp=require(_0x9210('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9210('0x7'));var attributes=require(_0x9210('0x8'));module[_0x9210('0x9')]=function(_0xab1738,_0x29a63b){return _0xab1738['define'](_0x9210('0xa'),attributes,{'tableName':_0x9210('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x9210('0xc'),_0x9210('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x15c9=['request-promise','path','rimraf','../../config/environment','exports','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','util','../../config/logger','api','bluebird'];(function(_0x1ce4d1,_0xea0bcb){var _0x1b270e=function(_0x584e49){while(--_0x584e49){_0x1ce4d1['push'](_0x1ce4d1['shift']());}};_0x1b270e(++_0xea0bcb);}(_0x15c9,0x64));var _0x915c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x15c9[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x915c('0x0'));var logger=require(_0x915c('0x1'))(_0x915c('0x2'));var moment=require('moment');var BPromise=require(_0x915c('0x3'));var rp=require(_0x915c('0x4'));var fs=require('fs');var path=require(_0x915c('0x5'));var rimraf=require(_0x915c('0x6'));var config=require(_0x915c('0x7'));var attributes=require('./intDynamics365Field.attributes');module[_0x915c('0x8')]=function(_0xfe7ea1,_0x1d3fa1){return _0xfe7ea1['define']('Dynamics365Field',attributes,{'tableName':_0x915c('0x9'),'paranoid':![],'indexes':[{'name':_0x915c('0xa'),'fields':[_0x915c('0xb'),_0x915c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index a671f1b..c715a77 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 _0x83cb=['request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','Dynamics365Field,\x20%s,\x20%s','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x50ed52,_0x31943a){var _0x1fb3ca=function(_0x35f741){while(--_0x35f741){_0x50ed52['push'](_0x50ed52['shift']());}};_0x1fb3ca(++_0x31943a);}(_0x83cb,0xa2));var _0xb83c=function(_0x5f1431,_0x49bea0){_0x5f1431=_0x5f1431-0x0;var _0x165500=_0x83cb[_0x5f1431];return _0x165500;};'use strict';var _=require(_0xb83c('0x0'));var util=require(_0xb83c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb83c('0x2'));var fs=require('fs');var Redis=require(_0xb83c('0x3'));var db=require(_0xb83c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb83c('0x5'))(_0xb83c('0x6'));var config=require(_0xb83c('0x7'));var jayson=require(_0xb83c('0x8'));var client=jayson[_0xb83c('0x9')][_0xb83c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bdaa0,_0x152b47,_0x235056){return new BPromise(function(_0x31efd9,_0x182b90){return client[_0xb83c('0xb')](_0x5bdaa0,_0x235056)[_0xb83c('0xc')](function(_0x54b792){logger[_0xb83c('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x152b47,_0xb83c('0xe'));logger['debug'](_0xb83c('0xf'),_0x152b47,_0xb83c('0xe'),JSON['stringify'](_0x54b792));if(_0x54b792[_0xb83c('0x10')]){if(_0x54b792['error'][_0xb83c('0x11')]===0x1f4){logger[_0xb83c('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x152b47,_0x54b792['error'][_0xb83c('0x12')]);return _0x182b90(_0x54b792[_0xb83c('0x10')][_0xb83c('0x12')]);}logger[_0xb83c('0x10')](_0xb83c('0x13'),_0x152b47,_0x54b792[_0xb83c('0x10')][_0xb83c('0x12')]);return _0x31efd9(_0x54b792[_0xb83c('0x10')][_0xb83c('0x12')]);}else{logger[_0xb83c('0xd')](_0xb83c('0x13'),_0x152b47,'request\x20sent');_0x31efd9(_0x54b792[_0xb83c('0x14')][_0xb83c('0x12')]);}})[_0xb83c('0x15')](function(_0x45d1de){logger[_0xb83c('0x10')](_0xb83c('0x13'),_0x152b47,_0x45d1de);_0x182b90(_0x45d1de);});});} \ No newline at end of file +var _0xc40b=['stringify','error','Dynamics365Field,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xc40b,0x9d));var _0xbc40=function(_0x2810a8,_0xf04a9d){_0x2810a8=_0x2810a8-0x0;var _0x54c890=_0xc40b[_0x2810a8];return _0x54c890;};'use strict';var _=require(_0xbc40('0x0'));var util=require(_0xbc40('0x1'));var moment=require(_0xbc40('0x2'));var BPromise=require(_0xbc40('0x3'));var rs=require(_0xbc40('0x4'));var fs=require('fs');var Redis=require(_0xbc40('0x5'));var db=require(_0xbc40('0x6'))['db'];var utils=require(_0xbc40('0x7'));var logger=require(_0xbc40('0x8'))(_0xbc40('0x9'));var config=require(_0xbc40('0xa'));var jayson=require(_0xbc40('0xb'));var client=jayson[_0xbc40('0xc')][_0xbc40('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x79513c,_0x24584b,_0x5789ed){return new BPromise(function(_0x432687,_0x3dd1a5){return client['request'](_0x79513c,_0x5789ed)[_0xbc40('0xe')](function(_0x2b9178){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x24584b,'request\x20sent');logger[_0xbc40('0xf')](_0xbc40('0x10'),_0x24584b,_0xbc40('0x11'),JSON[_0xbc40('0x12')](_0x2b9178));if(_0x2b9178[_0xbc40('0x13')]){if(_0x2b9178[_0xbc40('0x13')]['code']===0x1f4){logger[_0xbc40('0x13')](_0xbc40('0x14'),_0x24584b,_0x2b9178[_0xbc40('0x13')][_0xbc40('0x15')]);return _0x3dd1a5(_0x2b9178[_0xbc40('0x13')]['message']);}logger[_0xbc40('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x24584b,_0x2b9178[_0xbc40('0x13')][_0xbc40('0x15')]);return _0x432687(_0x2b9178[_0xbc40('0x13')][_0xbc40('0x15')]);}else{logger[_0xbc40('0x16')](_0xbc40('0x14'),_0x24584b,'request\x20sent');_0x432687(_0x2b9178[_0xbc40('0x17')][_0xbc40('0x15')]);}})[_0xbc40('0x18')](function(_0x3fa6b1){logger['error'](_0xbc40('0x14'),_0x24584b,_0x3fa6b1);_0x3dd1a5(_0x3fa6b1);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 63eb5be..67e7b68 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 _0x9746=['isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intFreshdeskAccount.controller','get'];(function(_0x22beb0,_0x33543){var _0x2ef16f=function(_0x55aa0e){while(--_0x55aa0e){_0x22beb0['push'](_0x22beb0['shift']());}};_0x2ef16f(++_0x33543);}(_0x9746,0x1af));var _0x6974=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x9746[_0x2fc012];return _0x2891f9;};'use strict';var multer=require(_0x6974('0x0'));var util=require(_0x6974('0x1'));var path=require(_0x6974('0x2'));var timeout=require(_0x6974('0x3'));var express=require(_0x6974('0x4'));var router=express[_0x6974('0x5')]();var fs_extra=require(_0x6974('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6974('0x7'));var controller=require(_0x6974('0x8'));router[_0x6974('0x9')]('/',auth[_0x6974('0xa')](),controller[_0x6974('0xb')]);router[_0x6974('0x9')](_0x6974('0xc'),auth[_0x6974('0xa')](),controller['show']);router['get'](_0x6974('0xd'),auth['isAuthenticated'](),controller[_0x6974('0xe')]);router[_0x6974('0x9')](_0x6974('0xf'),auth[_0x6974('0xa')](),controller[_0x6974('0x10')]);router[_0x6974('0x11')]('/',auth[_0x6974('0xa')](),controller[_0x6974('0x12')]);router[_0x6974('0x11')](_0x6974('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x6974('0x13')]('/:id',auth[_0x6974('0xa')](),controller['update']);router['delete'](_0x6974('0xc'),auth[_0x6974('0xa')](),controller[_0x6974('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf981=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','create','post','addConfiguration','put','update','exports','util'];(function(_0x17e496,_0x26aefd){var _0x146ae7=function(_0xe74f9a){while(--_0xe74f9a){_0x17e496['push'](_0x17e496['shift']());}};_0x146ae7(++_0x26aefd);}(_0xf981,0x83));var _0x1f98=function(_0x4b107b,_0x504dd2){_0x4b107b=_0x4b107b-0x0;var _0x582caa=_0xf981[_0x4b107b];return _0x582caa;};'use strict';var multer=require('multer');var util=require(_0x1f98('0x0'));var path=require(_0x1f98('0x1'));var timeout=require('connect-timeout');var express=require(_0x1f98('0x2'));var router=express[_0x1f98('0x3')]();var fs_extra=require(_0x1f98('0x4'));var auth=require(_0x1f98('0x5'));var interaction=require(_0x1f98('0x6'));var config=require(_0x1f98('0x7'));var controller=require(_0x1f98('0x8'));router[_0x1f98('0x9')]('/',auth['isAuthenticated'](),controller[_0x1f98('0xa')]);router[_0x1f98('0x9')](_0x1f98('0xb'),auth[_0x1f98('0xc')](),controller[_0x1f98('0xd')]);router['get'](_0x1f98('0xe'),auth[_0x1f98('0xc')](),controller[_0x1f98('0xf')]);router[_0x1f98('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x1f98('0xc')](),controller[_0x1f98('0x10')]);router[_0x1f98('0x11')]('/:id/configurations',auth[_0x1f98('0xc')](),controller[_0x1f98('0x12')]);router[_0x1f98('0x13')](_0x1f98('0xb'),auth['isAuthenticated'](),controller[_0x1f98('0x14')]);router['delete'](_0x1f98('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x1f98('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 9526223..6dd5bed 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 _0x7708=['sequelize','exports','STRING','remoteUri'];(function(_0xbf18c2,_0x4fd07d){var _0x6163ac=function(_0x330f12){while(--_0x330f12){_0xbf18c2['push'](_0xbf18c2['shift']());}};_0x6163ac(++_0x4fd07d);}(_0x7708,0x188));var _0x8770=function(_0x4b4277,_0x22676f){_0x4b4277=_0x4b4277-0x0;var _0x1ff405=_0x7708[_0x4b4277];return _0x1ff405;};'use strict';var Sequelize=require(_0x8770('0x0'));module[_0x8770('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8770('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8770('0x3')},'serverUrl':{'type':Sequelize[_0x8770('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1a85=['STRING','remoteUri'];(function(_0x4aa7e2,_0x1373af){var _0x1effa9=function(_0xc9916f){while(--_0xc9916f){_0x4aa7e2['push'](_0x4aa7e2['shift']());}};_0x1effa9(++_0x1373af);}(_0x1a85,0x178));var _0x51a8=function(_0x1e7bdd,_0x216b81){_0x1e7bdd=_0x1e7bdd-0x0;var _0xcd343d=_0x1a85[_0x1e7bdd];return _0xcd343d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x51a8('0x0')]},'description':{'type':Sequelize[_0x51a8('0x0')]},'username':{'type':Sequelize[_0x51a8('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x51a8('0x0')],'unique':_0x51a8('0x1')},'serverUrl':{'type':Sequelize[_0x51a8('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 8c906e7..1ed0419 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 _0x4a3c=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','FreshdeskConfiguration','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','slice','GET','format','%s/%s','apiKey','toString','base64','requester','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_dropdown','label','choices','statusCode','stringify','test','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','querystring'];(function(_0x1cf5ad,_0x5c11bb){var _0x5b7d0b=function(_0x14f716){while(--_0x14f716){_0x1cf5ad['push'](_0x1cf5ad['shift']());}};_0x5b7d0b(++_0x5c11bb);}(_0x4a3c,0x13c));var _0xc4a3=function(_0x568303,_0x364b06){_0x568303=_0x568303-0x0;var _0x5903cd=_0x4a3c[_0x568303];return _0x5903cd;};'use strict';var emlformat=require(_0xc4a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4a3('0x1'));var jsonpatch=require(_0xc4a3('0x2'));var rp=require(_0xc4a3('0x3'));var moment=require(_0xc4a3('0x4'));var BPromise=require(_0xc4a3('0x5'));var Mustache=require(_0xc4a3('0x6'));var util=require(_0xc4a3('0x7'));var path=require('path');var sox=require(_0xc4a3('0x8'));var csv=require(_0xc4a3('0x9'));var ejs=require(_0xc4a3('0xa'));var fs=require('fs');var fs_extra=require(_0xc4a3('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc4a3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc4a3('0x9'));var querystring=require(_0xc4a3('0xd'));var Papa=require(_0xc4a3('0xe'));var Redis=require(_0xc4a3('0xf'));var authService=require(_0xc4a3('0x10'));var qs=require(_0xc4a3('0x11'));var as=require(_0xc4a3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xc4a3('0x13'));function respondWithStatusCode(_0x15e13f,_0x27a41f){_0x27a41f=_0x27a41f||0xcc;return function(_0x1e41d6){if(_0x1e41d6){return _0x15e13f['sendStatus'](_0x27a41f);}return _0x15e13f[_0xc4a3('0x14')](_0x27a41f)[_0xc4a3('0x15')]();};}function respondWithResult(_0x54f14b,_0x466e1f){_0x466e1f=_0x466e1f||0xc8;return function(_0x434188){if(_0x434188){return _0x54f14b[_0xc4a3('0x14')](_0x466e1f)[_0xc4a3('0x16')](_0x434188);}};}function respondWithFilteredResult(_0x747bfb,_0x31c331){return function(_0x2b2db2){if(_0x2b2db2){var _0x262a54=typeof _0x31c331[_0xc4a3('0x17')]==='undefined'&&typeof _0x31c331[_0xc4a3('0x18')]===_0xc4a3('0x19');var _0x3c70d6=_0x2b2db2[_0xc4a3('0x1a')];var _0x57e6ed=_0x262a54?0x0:_0x31c331[_0xc4a3('0x17')];var _0x245896=_0x262a54?_0x2b2db2[_0xc4a3('0x1a')]:_0x31c331['offset']+_0x31c331[_0xc4a3('0x18')];var _0x141720;if(_0x245896>=_0x3c70d6){_0x245896=_0x3c70d6;_0x141720=0xc8;}else{_0x141720=0xce;}_0x747bfb[_0xc4a3('0x14')](_0x141720);return _0x747bfb[_0xc4a3('0x1b')](_0xc4a3('0x1c'),_0x57e6ed+'-'+_0x245896+'/'+_0x3c70d6)[_0xc4a3('0x16')](_0x2b2db2);}return null;};}function patchUpdates(_0x30cdf5){return function(_0x5654ed){try{jsonpatch[_0xc4a3('0x1d')](_0x5654ed,_0x30cdf5,!![]);}catch(_0x1799bf){return BPromise[_0xc4a3('0x1e')](_0x1799bf);}return _0x5654ed[_0xc4a3('0x1f')]();};}function saveUpdates(_0x525191,_0x3691b3){return function(_0x5dd62b){if(_0x5dd62b){return _0x5dd62b[_0xc4a3('0x20')](_0x525191)[_0xc4a3('0x21')](function(_0x195bb3){return _0x195bb3;});}return null;};}function removeEntity(_0x3a3f7e,_0x1ca707){return function(_0x353ce1){if(_0x353ce1){return _0x353ce1[_0xc4a3('0x22')]()['then'](function(){_0x3a3f7e[_0xc4a3('0x14')](0xcc)[_0xc4a3('0x15')]();});}};}function handleEntityNotFound(_0x446a24,_0x3d659b){return function(_0x168901){if(!_0x168901){_0x446a24[_0xc4a3('0x23')](0x194);}return _0x168901;};}function handleError(_0xc223b0,_0x1dd70a){_0x1dd70a=_0x1dd70a||0x1f4;return function(_0x2a3679){logger[_0xc4a3('0x24')](_0x2a3679[_0xc4a3('0x25')]);if(_0x2a3679[_0xc4a3('0x26')]){delete _0x2a3679[_0xc4a3('0x26')];}_0xc223b0[_0xc4a3('0x14')](_0x1dd70a)[_0xc4a3('0x27')](_0x2a3679);};}exports[_0xc4a3('0x28')]=function(_0x58d302,_0x1ad1b7){var _0x56bdd3={},_0x23e411={},_0x17d3fc={'count':0x0,'rows':[]};var _0x12a609=_['map'](db[_0xc4a3('0x29')][_0xc4a3('0x2a')],function(_0x3b4367){return{'name':_0x3b4367[_0xc4a3('0x2b')],'type':_0x3b4367['type']['key']};});_0x23e411[_0xc4a3('0x2c')]=_[_0xc4a3('0x2d')](_0x12a609,'name');_0x23e411[_0xc4a3('0x2e')]=_[_0xc4a3('0x2f')](_0x58d302['query']);_0x23e411[_0xc4a3('0x30')]=_[_0xc4a3('0x31')](_0x23e411[_0xc4a3('0x2c')],_0x23e411[_0xc4a3('0x2e')]);_0x56bdd3[_0xc4a3('0x32')]=_[_0xc4a3('0x31')](_0x23e411[_0xc4a3('0x2c')],qs['fields'](_0x58d302[_0xc4a3('0x2e')][_0xc4a3('0x33')]));_0x56bdd3[_0xc4a3('0x32')]=_0x56bdd3[_0xc4a3('0x32')][_0xc4a3('0x34')]?_0x56bdd3['attributes']:_0x23e411[_0xc4a3('0x2c')];if(!_0x58d302[_0xc4a3('0x2e')][_0xc4a3('0x35')](_0xc4a3('0x36'))){_0x56bdd3[_0xc4a3('0x18')]=qs[_0xc4a3('0x18')](_0x58d302[_0xc4a3('0x2e')]['limit']);_0x56bdd3[_0xc4a3('0x17')]=qs[_0xc4a3('0x17')](_0x58d302[_0xc4a3('0x2e')][_0xc4a3('0x17')]);}_0x56bdd3[_0xc4a3('0x37')]=qs['sort'](_0x58d302[_0xc4a3('0x2e')][_0xc4a3('0x38')]);_0x56bdd3[_0xc4a3('0x39')]=qs['filters'](_[_0xc4a3('0x3a')](_0x58d302['query'],_0x23e411[_0xc4a3('0x30')]),_0x12a609);if(_0x58d302[_0xc4a3('0x2e')][_0xc4a3('0x3b')]){_0x56bdd3['where']=_[_0xc4a3('0x3c')](_0x56bdd3[_0xc4a3('0x39')],{'$or':_['map'](_0x12a609,function(_0x1607b6){if(_0x1607b6[_0xc4a3('0x3d')]!==_0xc4a3('0x3e')){var _0x2f7ec9={};_0x2f7ec9[_0x1607b6[_0xc4a3('0x26')]]={'$like':'%'+_0x58d302[_0xc4a3('0x2e')]['filter']+'%'};return _0x2f7ec9;}})});}_0x56bdd3=_[_0xc4a3('0x3c')]({},_0x56bdd3,_0x58d302[_0xc4a3('0x3f')]);var _0x4835e4={'where':_0x56bdd3[_0xc4a3('0x39')]};return db[_0xc4a3('0x29')]['count'](_0x4835e4)[_0xc4a3('0x21')](function(_0x5d447f){_0x17d3fc[_0xc4a3('0x1a')]=_0x5d447f;if(_0x58d302['query'][_0xc4a3('0x40')]){_0x56bdd3[_0xc4a3('0x41')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xc4a3('0x42')](_0x56bdd3);})[_0xc4a3('0x21')](function(_0xcb4296){_0x17d3fc[_0xc4a3('0x43')]=_0xcb4296;return _0x17d3fc;})[_0xc4a3('0x21')](respondWithFilteredResult(_0x1ad1b7,_0x56bdd3))[_0xc4a3('0x44')](handleError(_0x1ad1b7,null));};exports[_0xc4a3('0x45')]=function(_0x2d6fae,_0x5a1438){var _0x3e7693={'raw':![],'where':{'id':_0x2d6fae[_0xc4a3('0x46')]['id']}},_0x1c07bd={};_0x1c07bd[_0xc4a3('0x2c')]=_['keys'](db[_0xc4a3('0x29')][_0xc4a3('0x2a')]);_0x1c07bd[_0xc4a3('0x2e')]=_[_0xc4a3('0x2f')](_0x2d6fae['query']);_0x1c07bd['filters']=_[_0xc4a3('0x31')](_0x1c07bd[_0xc4a3('0x2c')],_0x1c07bd['query']);_0x3e7693[_0xc4a3('0x32')]=_[_0xc4a3('0x31')](_0x1c07bd[_0xc4a3('0x2c')],qs[_0xc4a3('0x33')](_0x2d6fae[_0xc4a3('0x2e')][_0xc4a3('0x33')]));_0x3e7693[_0xc4a3('0x32')]=_0x3e7693[_0xc4a3('0x32')]['length']?_0x3e7693['attributes']:_0x1c07bd[_0xc4a3('0x2c')];if(_0x2d6fae[_0xc4a3('0x2e')]['includeAll']){_0x3e7693[_0xc4a3('0x41')]=[{'all':!![]}];}_0x3e7693=_[_0xc4a3('0x3c')]({},_0x3e7693,_0x2d6fae[_0xc4a3('0x3f')]);return db[_0xc4a3('0x29')][_0xc4a3('0x47')](_0x3e7693)['then'](handleEntityNotFound(_0x5a1438,null))[_0xc4a3('0x21')](respondWithResult(_0x5a1438,null))['catch'](handleError(_0x5a1438,null));};exports[_0xc4a3('0x48')]=function(_0x20e0c1,_0x1b3bd4){return db['FreshdeskAccount'][_0xc4a3('0x48')](_0x20e0c1[_0xc4a3('0x49')],{})[_0xc4a3('0x21')](respondWithResult(_0x1b3bd4,0xc9))[_0xc4a3('0x44')](handleError(_0x1b3bd4,null));};exports[_0xc4a3('0x20')]=function(_0xb3d32d,_0xc586b5){if(_0xb3d32d[_0xc4a3('0x49')]['id']){delete _0xb3d32d[_0xc4a3('0x49')]['id'];}return db[_0xc4a3('0x29')]['find']({'where':{'id':_0xb3d32d[_0xc4a3('0x46')]['id']}})[_0xc4a3('0x21')](handleEntityNotFound(_0xc586b5,null))['then'](saveUpdates(_0xb3d32d[_0xc4a3('0x49')],null))[_0xc4a3('0x21')](respondWithResult(_0xc586b5,null))[_0xc4a3('0x44')](handleError(_0xc586b5,null));};exports[_0xc4a3('0x22')]=function(_0x9a397e,_0xfa0abf){return db[_0xc4a3('0x29')][_0xc4a3('0x47')]({'where':{'id':_0x9a397e[_0xc4a3('0x46')]['id']}})[_0xc4a3('0x21')](handleEntityNotFound(_0xfa0abf,null))['then'](removeEntity(_0xfa0abf,null))[_0xc4a3('0x44')](handleError(_0xfa0abf,null));};exports[_0xc4a3('0x4a')]=function(_0x580880,_0x4b15f1,_0x5eccda){var _0x41d289={};var _0x59b7e6={};var _0x53c99d;var _0x117f70;return db[_0xc4a3('0x29')]['findOne']({'where':{'id':_0x580880[_0xc4a3('0x46')]['id']}})[_0xc4a3('0x21')](handleEntityNotFound(_0x4b15f1,null))['then'](function(_0x599272){if(_0x599272){_0x53c99d=_0x599272;_0x59b7e6[_0xc4a3('0x2c')]=_['keys'](db[_0xc4a3('0x4b')][_0xc4a3('0x2a')]);_0x59b7e6[_0xc4a3('0x2e')]=_[_0xc4a3('0x2f')](_0x580880[_0xc4a3('0x2e')]);_0x59b7e6[_0xc4a3('0x30')]=_[_0xc4a3('0x31')](_0x59b7e6[_0xc4a3('0x2c')],_0x59b7e6['query']);_0x41d289[_0xc4a3('0x32')]=_[_0xc4a3('0x31')](_0x59b7e6[_0xc4a3('0x2c')],qs[_0xc4a3('0x33')](_0x580880[_0xc4a3('0x2e')][_0xc4a3('0x33')]));_0x41d289[_0xc4a3('0x32')]=_0x41d289[_0xc4a3('0x32')][_0xc4a3('0x34')]?_0x41d289[_0xc4a3('0x32')]:_0x59b7e6['model'];_0x41d289[_0xc4a3('0x37')]=qs['sort'](_0x580880['query'][_0xc4a3('0x38')]);_0x41d289[_0xc4a3('0x39')]=qs['filters'](_['pick'](_0x580880[_0xc4a3('0x2e')],_0x59b7e6[_0xc4a3('0x30')]));if(_0x580880[_0xc4a3('0x2e')][_0xc4a3('0x3b')]){_0x41d289[_0xc4a3('0x39')]=_[_0xc4a3('0x3c')](_0x41d289[_0xc4a3('0x39')],{'$or':_['map'](_0x41d289[_0xc4a3('0x32')],function(_0x4954f0){var _0x174323={};_0x174323[_0x4954f0]={'$like':'%'+_0x580880[_0xc4a3('0x2e')][_0xc4a3('0x3b')]+'%'};return _0x174323;})});}_0x41d289=_[_0xc4a3('0x3c')]({},_0x41d289,_0x580880[_0xc4a3('0x3f')]);return _0x53c99d[_0xc4a3('0x4a')](_0x41d289);}})[_0xc4a3('0x21')](function(_0x33b9a9){if(_0x33b9a9){_0x117f70=_0x33b9a9[_0xc4a3('0x34')];if(!_0x580880[_0xc4a3('0x2e')]['hasOwnProperty'](_0xc4a3('0x36'))){_0x41d289[_0xc4a3('0x18')]=qs[_0xc4a3('0x18')](_0x580880[_0xc4a3('0x2e')][_0xc4a3('0x18')]);_0x41d289[_0xc4a3('0x17')]=qs[_0xc4a3('0x17')](_0x580880[_0xc4a3('0x2e')][_0xc4a3('0x17')]);}return _0x53c99d['getConfigurations'](_0x41d289);}})['then'](function(_0x3d0c7a){if(_0x3d0c7a){return _0x3d0c7a?{'count':_0x117f70,'rows':_0x3d0c7a}:null;}})[_0xc4a3('0x21')](respondWithResult(_0x4b15f1,null))[_0xc4a3('0x44')](handleError(_0x4b15f1,null));};exports[_0xc4a3('0x4c')]=function(_0x4f7de6,_0x16c269,_0x2f8c68){if(_0x4f7de6[_0xc4a3('0x49')]['id']){delete _0x4f7de6[_0xc4a3('0x49')]['id'];}return db[_0xc4a3('0x29')][_0xc4a3('0x4d')]({'where':{'id':_0x4f7de6[_0xc4a3('0x46')]['id']}})['then'](handleEntityNotFound(_0x16c269,null))[_0xc4a3('0x21')](function(_0x5b75ff){if(_0x5b75ff){_0x4f7de6[_0xc4a3('0x49')]['AccountId']=_0x5b75ff['id'];_0x4f7de6[_0xc4a3('0x49')][_0xc4a3('0x4e')]=integrations[_0xc4a3('0x4f')](_0x4f7de6[_0xc4a3('0x49')][_0xc4a3('0x50')],_0x4f7de6[_0xc4a3('0x49')]['type']);_0x4f7de6[_0xc4a3('0x49')][_0xc4a3('0x51')]=integrations[_0xc4a3('0x52')](_0x4f7de6[_0xc4a3('0x49')][_0xc4a3('0x50')],_0x4f7de6['body'][_0xc4a3('0x3d')]);return db[_0xc4a3('0x4b')][_0xc4a3('0x48')](_0x4f7de6[_0xc4a3('0x49')],{'include':[{'model':db[_0xc4a3('0x53')],'as':_0xc4a3('0x4e')},{'model':db[_0xc4a3('0x53')],'as':_0xc4a3('0x51')}]});}return null;})[_0xc4a3('0x21')](respondWithResult(_0x16c269,null))[_0xc4a3('0x44')](handleError(_0x16c269,null));};exports[_0xc4a3('0x54')]=function(_0x11b2ef,_0x421086,_0xbc74f5){var _0x49bfe7='';return db[_0xc4a3('0x29')][_0xc4a3('0x4d')]({'where':{'id':_0x11b2ef[_0xc4a3('0x46')]['id']},'attributes':['id',_0xc4a3('0x55'),'apiKey']})['then'](handleEntityNotFound(_0x421086,null))[_0xc4a3('0x21')](function(_0x54be73){if(_0x54be73){_0x49bfe7=_0x54be73[_0xc4a3('0x55')];var _0x34e6bb=_0x49bfe7[_0xc4a3('0x56')](-0x1);if(_0x34e6bb==='/'){_0x49bfe7=_0x49bfe7['substring'](0x0,_0x49bfe7['lastIndexOf'](_0x34e6bb));}return rp({'method':_0xc4a3('0x57'),'uri':util[_0xc4a3('0x58')](_0xc4a3('0x59'),_0x49bfe7,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xc4a3('0x58')]('Basic\x20%s',new Buffer(util[_0xc4a3('0x58')]('%s:X',_0x54be73[_0xc4a3('0x5a')]))[_0xc4a3('0x5b')](_0xc4a3('0x5c')))},'json':!![]});}})[_0xc4a3('0x21')](function(_0x26e234){if(_0x26e234){var _0xc7df05=[_0xc4a3('0x5d'),'subject',_0xc4a3('0x5e'),_0xc4a3('0x5f'),_0xc4a3('0x14'),_0xc4a3('0x60'),_0xc4a3('0x61'),_0xc4a3('0x62'),_0xc4a3('0x63'),_0xc4a3('0x61'),_0xc4a3('0x64')];_[_0xc4a3('0x65')](_0x26e234,function(_0x368f2c){return _0xc7df05[_0xc4a3('0x66')](_0x368f2c[_0xc4a3('0x26')])||!_0x368f2c[_0xc4a3('0x67')]&&_0x368f2c[_0xc4a3('0x3d')]!=='custom_text'&&_0x368f2c[_0xc4a3('0x3d')]!==_0xc4a3('0x68');});return{'count':_0x26e234[_0xc4a3('0x34')],'rows':_[_0xc4a3('0x2d')](_0x26e234,function(_0x3bac0c){return{'id':_0x3bac0c['name'],'name':_0x3bac0c[_0xc4a3('0x69')],'custom':!_0x3bac0c[_0xc4a3('0x67')],'options':_0x3bac0c[_0xc4a3('0x6a')]?_[_0xc4a3('0x2d')](_0x3bac0c[_0xc4a3('0x6a')],function(_0x18f0b3){return{'name':_['capitalize'](_0x18f0b3),'value':_0x18f0b3};}):[]};})};}})[_0xc4a3('0x21')](respondWithResult(_0x421086,null))['catch'](function(_0x27e7d9){var _0x5d7eb0=_0x11b2ef[_0xc4a3('0x2e')]['test']?0x1f4:_0x27e7d9[_0xc4a3('0x6b')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5d7eb0,JSON[_0xc4a3('0x6c')](_0x27e7d9));delete _0x27e7d9[_0xc4a3('0x26')];if(_0x5d7eb0===0x191){_0x5d7eb0=0x190;}_0x421086[_0xc4a3('0x14')](_0x5d7eb0)[_0xc4a3('0x27')](_0x11b2ef[_0xc4a3('0x2e')][_0xc4a3('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x27e7d9[_0xc4a3('0x6b')]}:_0x27e7d9);});}; \ No newline at end of file +var _0xdfe9=['send','map','FreshdeskAccount','rawAttributes','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','getConfigurations','findOne','keys','FreshdeskConfiguration','pick','addConfiguration','AccountId','Subjects','channel','type','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','Basic\x20%s','format','%s:X','base64','requester','subject','agent','description','priority','group','source','ticket_type','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name'];(function(_0x1d22da,_0x47a555){var _0x39cc92=function(_0x39b2cf){while(--_0x39b2cf){_0x1d22da['push'](_0x1d22da['shift']());}};_0x39cc92(++_0x47a555);}(_0xdfe9,0xc3));var _0x9dfe=function(_0x3c5dfe,_0xa23c9c){_0x3c5dfe=_0x3c5dfe-0x0;var _0x200482=_0xdfe9[_0x3c5dfe];return _0x200482;};'use strict';var emlformat=require(_0x9dfe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9dfe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9dfe('0x2'));var BPromise=require(_0x9dfe('0x3'));var Mustache=require(_0x9dfe('0x4'));var util=require(_0x9dfe('0x5'));var path=require(_0x9dfe('0x6'));var sox=require(_0x9dfe('0x7'));var csv=require(_0x9dfe('0x8'));var ejs=require(_0x9dfe('0x9'));var fs=require('fs');var fs_extra=require(_0x9dfe('0xa'));var _=require(_0x9dfe('0xb'));var squel=require(_0x9dfe('0xc'));var crypto=require('crypto');var jsforce=require(_0x9dfe('0xd'));var deskjs=require(_0x9dfe('0xe'));var toCsv=require(_0x9dfe('0x8'));var querystring=require(_0x9dfe('0xf'));var Papa=require(_0x9dfe('0x10'));var Redis=require(_0x9dfe('0x11'));var authService=require(_0x9dfe('0x12'));var qs=require(_0x9dfe('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9dfe('0x14'));var logger=require(_0x9dfe('0x15'))(_0x9dfe('0x16'));var utils=require(_0x9dfe('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9dfe('0x18'))['db'];var integrations=require(_0x9dfe('0x19'));function respondWithStatusCode(_0x4da42d,_0x547ae1){_0x547ae1=_0x547ae1||0xcc;return function(_0x5d9256){if(_0x5d9256){return _0x4da42d[_0x9dfe('0x1a')](_0x547ae1);}return _0x4da42d[_0x9dfe('0x1b')](_0x547ae1)[_0x9dfe('0x1c')]();};}function respondWithResult(_0x12794d,_0x189edc){_0x189edc=_0x189edc||0xc8;return function(_0x2646b1){if(_0x2646b1){return _0x12794d[_0x9dfe('0x1b')](_0x189edc)[_0x9dfe('0x1d')](_0x2646b1);}};}function respondWithFilteredResult(_0x316205,_0x56c864){return function(_0x538be3){if(_0x538be3){var _0x2d960e=typeof _0x56c864['offset']===_0x9dfe('0x1e')&&typeof _0x56c864[_0x9dfe('0x1f')]===_0x9dfe('0x1e');var _0x43ad01=_0x538be3[_0x9dfe('0x20')];var _0x1bddd4=_0x2d960e?0x0:_0x56c864['offset'];var _0x270796=_0x2d960e?_0x538be3[_0x9dfe('0x20')]:_0x56c864[_0x9dfe('0x21')]+_0x56c864[_0x9dfe('0x1f')];var _0x2ebbc4;if(_0x270796>=_0x43ad01){_0x270796=_0x43ad01;_0x2ebbc4=0xc8;}else{_0x2ebbc4=0xce;}_0x316205[_0x9dfe('0x1b')](_0x2ebbc4);return _0x316205[_0x9dfe('0x22')](_0x9dfe('0x23'),_0x1bddd4+'-'+_0x270796+'/'+_0x43ad01)[_0x9dfe('0x1d')](_0x538be3);}return null;};}function patchUpdates(_0x1cf33d){return function(_0x117483){try{jsonpatch[_0x9dfe('0x24')](_0x117483,_0x1cf33d,!![]);}catch(_0x3c67cc){return BPromise[_0x9dfe('0x25')](_0x3c67cc);}return _0x117483['save']();};}function saveUpdates(_0x484f22,_0x35cb5c){return function(_0x1e1b3a){if(_0x1e1b3a){return _0x1e1b3a[_0x9dfe('0x26')](_0x484f22)[_0x9dfe('0x27')](function(_0x30f0cd){return _0x30f0cd;});}return null;};}function removeEntity(_0x3da663,_0x3354b7){return function(_0x361e5e){if(_0x361e5e){return _0x361e5e[_0x9dfe('0x28')]()[_0x9dfe('0x27')](function(){_0x3da663[_0x9dfe('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b9502,_0x14a616){return function(_0x18c158){if(!_0x18c158){_0x5b9502['sendStatus'](0x194);}return _0x18c158;};}function handleError(_0x1ac1dc,_0x332020){_0x332020=_0x332020||0x1f4;return function(_0x41238d){logger['error'](_0x41238d[_0x9dfe('0x29')]);if(_0x41238d[_0x9dfe('0x2a')]){delete _0x41238d[_0x9dfe('0x2a')];}_0x1ac1dc[_0x9dfe('0x1b')](_0x332020)[_0x9dfe('0x2b')](_0x41238d);};}exports['index']=function(_0x409711,_0x5dc3e2){var _0x306426={},_0x409602={},_0x796981={'count':0x0,'rows':[]};var _0x37e7af=_[_0x9dfe('0x2c')](db[_0x9dfe('0x2d')][_0x9dfe('0x2e')],function(_0x222cea){return{'name':_0x222cea['fieldName'],'type':_0x222cea['type'][_0x9dfe('0x2f')]};});_0x409602['model']=_[_0x9dfe('0x2c')](_0x37e7af,_0x9dfe('0x2a'));_0x409602[_0x9dfe('0x30')]=_['keys'](_0x409711[_0x9dfe('0x30')]);_0x409602[_0x9dfe('0x31')]=_['intersection'](_0x409602['model'],_0x409602[_0x9dfe('0x30')]);_0x306426[_0x9dfe('0x32')]=_[_0x9dfe('0x33')](_0x409602[_0x9dfe('0x34')],qs['fields'](_0x409711[_0x9dfe('0x30')][_0x9dfe('0x35')]));_0x306426[_0x9dfe('0x32')]=_0x306426[_0x9dfe('0x32')][_0x9dfe('0x36')]?_0x306426['attributes']:_0x409602[_0x9dfe('0x34')];if(!_0x409711[_0x9dfe('0x30')][_0x9dfe('0x37')](_0x9dfe('0x38'))){_0x306426[_0x9dfe('0x1f')]=qs[_0x9dfe('0x1f')](_0x409711[_0x9dfe('0x30')]['limit']);_0x306426[_0x9dfe('0x21')]=qs[_0x9dfe('0x21')](_0x409711[_0x9dfe('0x30')][_0x9dfe('0x21')]);}_0x306426[_0x9dfe('0x39')]=qs['sort'](_0x409711[_0x9dfe('0x30')][_0x9dfe('0x3a')]);_0x306426['where']=qs[_0x9dfe('0x31')](_['pick'](_0x409711[_0x9dfe('0x30')],_0x409602[_0x9dfe('0x31')]),_0x37e7af);if(_0x409711[_0x9dfe('0x30')][_0x9dfe('0x3b')]){_0x306426[_0x9dfe('0x3c')]=_['merge'](_0x306426['where'],{'$or':_[_0x9dfe('0x2c')](_0x37e7af,function(_0x135063){if(_0x135063['type']!==_0x9dfe('0x3d')){var _0x509d7f={};_0x509d7f[_0x135063[_0x9dfe('0x2a')]]={'$like':'%'+_0x409711['query']['filter']+'%'};return _0x509d7f;}})});}_0x306426=_['merge']({},_0x306426,_0x409711[_0x9dfe('0x3e')]);var _0x4fa232={'where':_0x306426['where']};return db[_0x9dfe('0x2d')]['count'](_0x4fa232)[_0x9dfe('0x27')](function(_0x17391e){_0x796981[_0x9dfe('0x20')]=_0x17391e;if(_0x409711[_0x9dfe('0x30')][_0x9dfe('0x3f')]){_0x306426[_0x9dfe('0x40')]=[{'all':!![]}];}return db[_0x9dfe('0x2d')][_0x9dfe('0x41')](_0x306426);})[_0x9dfe('0x27')](function(_0x23dfa2){_0x796981[_0x9dfe('0x42')]=_0x23dfa2;return _0x796981;})[_0x9dfe('0x27')](respondWithFilteredResult(_0x5dc3e2,_0x306426))[_0x9dfe('0x43')](handleError(_0x5dc3e2,null));};exports[_0x9dfe('0x44')]=function(_0x2cd4c1,_0x1350fa){var _0x5dfa4b={'raw':![],'where':{'id':_0x2cd4c1[_0x9dfe('0x45')]['id']}},_0x895592={};_0x895592[_0x9dfe('0x34')]=_['keys'](db['FreshdeskAccount'][_0x9dfe('0x2e')]);_0x895592['query']=_['keys'](_0x2cd4c1[_0x9dfe('0x30')]);_0x895592[_0x9dfe('0x31')]=_[_0x9dfe('0x33')](_0x895592[_0x9dfe('0x34')],_0x895592[_0x9dfe('0x30')]);_0x5dfa4b[_0x9dfe('0x32')]=_[_0x9dfe('0x33')](_0x895592[_0x9dfe('0x34')],qs[_0x9dfe('0x35')](_0x2cd4c1[_0x9dfe('0x30')]['fields']));_0x5dfa4b[_0x9dfe('0x32')]=_0x5dfa4b[_0x9dfe('0x32')][_0x9dfe('0x36')]?_0x5dfa4b[_0x9dfe('0x32')]:_0x895592[_0x9dfe('0x34')];if(_0x2cd4c1[_0x9dfe('0x30')]['includeAll']){_0x5dfa4b[_0x9dfe('0x40')]=[{'all':!![]}];}_0x5dfa4b=_[_0x9dfe('0x46')]({},_0x5dfa4b,_0x2cd4c1[_0x9dfe('0x3e')]);return db[_0x9dfe('0x2d')][_0x9dfe('0x47')](_0x5dfa4b)[_0x9dfe('0x27')](handleEntityNotFound(_0x1350fa,null))['then'](respondWithResult(_0x1350fa,null))[_0x9dfe('0x43')](handleError(_0x1350fa,null));};exports[_0x9dfe('0x48')]=function(_0x37036d,_0x4509d4){return db[_0x9dfe('0x2d')][_0x9dfe('0x48')](_0x37036d[_0x9dfe('0x49')],{})[_0x9dfe('0x27')](respondWithResult(_0x4509d4,0xc9))[_0x9dfe('0x43')](handleError(_0x4509d4,null));};exports[_0x9dfe('0x26')]=function(_0xb597b1,_0x323ac3){if(_0xb597b1[_0x9dfe('0x49')]['id']){delete _0xb597b1[_0x9dfe('0x49')]['id'];}return db[_0x9dfe('0x2d')]['find']({'where':{'id':_0xb597b1[_0x9dfe('0x45')]['id']}})[_0x9dfe('0x27')](handleEntityNotFound(_0x323ac3,null))['then'](saveUpdates(_0xb597b1['body'],null))[_0x9dfe('0x27')](respondWithResult(_0x323ac3,null))[_0x9dfe('0x43')](handleError(_0x323ac3,null));};exports['destroy']=function(_0x4caa6a,_0x554811){return db[_0x9dfe('0x2d')][_0x9dfe('0x47')]({'where':{'id':_0x4caa6a[_0x9dfe('0x45')]['id']}})[_0x9dfe('0x27')](handleEntityNotFound(_0x554811,null))['then'](removeEntity(_0x554811,null))[_0x9dfe('0x43')](handleError(_0x554811,null));};exports[_0x9dfe('0x4a')]=function(_0x1fa0e1,_0x454ddc,_0x1a2f71){var _0x4a4a2a={};var _0x3599c7={};var _0x219475;var _0x5a1f13;return db[_0x9dfe('0x2d')][_0x9dfe('0x4b')]({'where':{'id':_0x1fa0e1['params']['id']}})[_0x9dfe('0x27')](handleEntityNotFound(_0x454ddc,null))[_0x9dfe('0x27')](function(_0x435486){if(_0x435486){_0x219475=_0x435486;_0x3599c7['model']=_[_0x9dfe('0x4c')](db[_0x9dfe('0x4d')]['rawAttributes']);_0x3599c7['query']=_[_0x9dfe('0x4c')](_0x1fa0e1['query']);_0x3599c7['filters']=_[_0x9dfe('0x33')](_0x3599c7[_0x9dfe('0x34')],_0x3599c7[_0x9dfe('0x30')]);_0x4a4a2a['attributes']=_['intersection'](_0x3599c7[_0x9dfe('0x34')],qs[_0x9dfe('0x35')](_0x1fa0e1[_0x9dfe('0x30')][_0x9dfe('0x35')]));_0x4a4a2a[_0x9dfe('0x32')]=_0x4a4a2a[_0x9dfe('0x32')][_0x9dfe('0x36')]?_0x4a4a2a['attributes']:_0x3599c7[_0x9dfe('0x34')];_0x4a4a2a[_0x9dfe('0x39')]=qs[_0x9dfe('0x3a')](_0x1fa0e1['query'][_0x9dfe('0x3a')]);_0x4a4a2a['where']=qs[_0x9dfe('0x31')](_[_0x9dfe('0x4e')](_0x1fa0e1[_0x9dfe('0x30')],_0x3599c7[_0x9dfe('0x31')]));if(_0x1fa0e1[_0x9dfe('0x30')]['filter']){_0x4a4a2a[_0x9dfe('0x3c')]=_[_0x9dfe('0x46')](_0x4a4a2a[_0x9dfe('0x3c')],{'$or':_[_0x9dfe('0x2c')](_0x4a4a2a[_0x9dfe('0x32')],function(_0x1823c3){var _0xb4c3c0={};_0xb4c3c0[_0x1823c3]={'$like':'%'+_0x1fa0e1[_0x9dfe('0x30')][_0x9dfe('0x3b')]+'%'};return _0xb4c3c0;})});}_0x4a4a2a=_[_0x9dfe('0x46')]({},_0x4a4a2a,_0x1fa0e1[_0x9dfe('0x3e')]);return _0x219475['getConfigurations'](_0x4a4a2a);}})[_0x9dfe('0x27')](function(_0x522735){if(_0x522735){_0x5a1f13=_0x522735['length'];if(!_0x1fa0e1[_0x9dfe('0x30')][_0x9dfe('0x37')](_0x9dfe('0x38'))){_0x4a4a2a['limit']=qs['limit'](_0x1fa0e1[_0x9dfe('0x30')][_0x9dfe('0x1f')]);_0x4a4a2a[_0x9dfe('0x21')]=qs[_0x9dfe('0x21')](_0x1fa0e1[_0x9dfe('0x30')][_0x9dfe('0x21')]);}return _0x219475[_0x9dfe('0x4a')](_0x4a4a2a);}})['then'](function(_0x2c7c2c){if(_0x2c7c2c){return _0x2c7c2c?{'count':_0x5a1f13,'rows':_0x2c7c2c}:null;}})[_0x9dfe('0x27')](respondWithResult(_0x454ddc,null))[_0x9dfe('0x43')](handleError(_0x454ddc,null));};exports[_0x9dfe('0x4f')]=function(_0x54f59e,_0x5a9508,_0xc624ce){if(_0x54f59e[_0x9dfe('0x49')]['id']){delete _0x54f59e[_0x9dfe('0x49')]['id'];}return db[_0x9dfe('0x2d')][_0x9dfe('0x4b')]({'where':{'id':_0x54f59e[_0x9dfe('0x45')]['id']}})[_0x9dfe('0x27')](handleEntityNotFound(_0x5a9508,null))[_0x9dfe('0x27')](function(_0x8f7882){if(_0x8f7882){_0x54f59e[_0x9dfe('0x49')][_0x9dfe('0x50')]=_0x8f7882['id'];_0x54f59e[_0x9dfe('0x49')][_0x9dfe('0x51')]=integrations['getSubjects'](_0x54f59e['body'][_0x9dfe('0x52')],_0x54f59e[_0x9dfe('0x49')][_0x9dfe('0x53')]);_0x54f59e['body'][_0x9dfe('0x54')]=integrations[_0x9dfe('0x55')](_0x54f59e['body'][_0x9dfe('0x52')],_0x54f59e[_0x9dfe('0x49')][_0x9dfe('0x53')]);return db[_0x9dfe('0x4d')][_0x9dfe('0x48')](_0x54f59e[_0x9dfe('0x49')],{'include':[{'model':db[_0x9dfe('0x56')],'as':_0x9dfe('0x51')},{'model':db[_0x9dfe('0x56')],'as':_0x9dfe('0x54')}]});}return null;})[_0x9dfe('0x27')](respondWithResult(_0x5a9508,null))['catch'](handleError(_0x5a9508,null));};exports[_0x9dfe('0x57')]=function(_0x202d2a,_0x4914f0,_0x567c27){var _0x30f2a6='';return db[_0x9dfe('0x2d')][_0x9dfe('0x4b')]({'where':{'id':_0x202d2a[_0x9dfe('0x45')]['id']},'attributes':['id',_0x9dfe('0x58'),_0x9dfe('0x59')]})['then'](handleEntityNotFound(_0x4914f0,null))['then'](function(_0x3681b7){if(_0x3681b7){_0x30f2a6=_0x3681b7[_0x9dfe('0x58')];var _0xb087a9=_0x30f2a6[_0x9dfe('0x5a')](-0x1);if(_0xb087a9==='/'){_0x30f2a6=_0x30f2a6[_0x9dfe('0x5b')](0x0,_0x30f2a6[_0x9dfe('0x5c')](_0xb087a9));}return rp({'method':_0x9dfe('0x5d'),'uri':util['format'](_0x9dfe('0x5e'),_0x30f2a6,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0x9dfe('0x5f'),new Buffer(util[_0x9dfe('0x60')](_0x9dfe('0x61'),_0x3681b7['apiKey']))['toString'](_0x9dfe('0x62')))},'json':!![]});}})[_0x9dfe('0x27')](function(_0x2b6a7e){if(_0x2b6a7e){var _0x4d4ba5=[_0x9dfe('0x63'),_0x9dfe('0x64'),_0x9dfe('0x65'),_0x9dfe('0x66'),'status',_0x9dfe('0x67'),_0x9dfe('0x68'),_0x9dfe('0x69'),_0x9dfe('0x6a'),_0x9dfe('0x68'),'company'];_['remove'](_0x2b6a7e,function(_0x4b43f1){return _0x4d4ba5['includes'](_0x4b43f1['name'])||!_0x4b43f1[_0x9dfe('0x6b')]&&_0x4b43f1[_0x9dfe('0x53')]!==_0x9dfe('0x6c')&&_0x4b43f1[_0x9dfe('0x53')]!==_0x9dfe('0x6d');});return{'count':_0x2b6a7e[_0x9dfe('0x36')],'rows':_[_0x9dfe('0x2c')](_0x2b6a7e,function(_0x474aa2){return{'id':_0x474aa2[_0x9dfe('0x2a')],'name':_0x474aa2[_0x9dfe('0x6e')],'custom':!_0x474aa2[_0x9dfe('0x6b')],'options':_0x474aa2[_0x9dfe('0x6f')]?_[_0x9dfe('0x2c')](_0x474aa2[_0x9dfe('0x6f')],function(_0x54fc4b){return{'name':_[_0x9dfe('0x70')](_0x54fc4b),'value':_0x54fc4b};}):[]};})};}})['then'](respondWithResult(_0x4914f0,null))[_0x9dfe('0x43')](function(_0x17da0f){var _0x3a27d0=_0x202d2a[_0x9dfe('0x30')][_0x9dfe('0x71')]?0x1f4:_0x17da0f[_0x9dfe('0x72')]||0x1f4;logger[_0x9dfe('0x73')](_0x9dfe('0x74'),'getFields',_0x3a27d0,JSON[_0x9dfe('0x75')](_0x17da0f));delete _0x17da0f[_0x9dfe('0x2a')];if(_0x3a27d0===0x191){_0x3a27d0=0x190;}_0x4914f0[_0x9dfe('0x1b')](_0x3a27d0)['send'](_0x202d2a[_0x9dfe('0x30')][_0x9dfe('0x71')]?{'message':_0x9dfe('0x76'),'statusCode':_0x17da0f['statusCode']}:_0x17da0f);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 9b96d2a..b2b0b8d 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 _0x3cff=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','FreshdeskAccount','lodash','util'];(function(_0x5e6d67,_0x2bbe63){var _0x3f3dd9=function(_0x1830bc){while(--_0x1830bc){_0x5e6d67['push'](_0x5e6d67['shift']());}};_0x3f3dd9(++_0x2bbe63);}(_0x3cff,0xe8));var _0xf3cf=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0x3cff[_0x5f08a6];return _0x5d0641;};'use strict';var _=require(_0xf3cf('0x0'));var util=require(_0xf3cf('0x1'));var logger=require(_0xf3cf('0x2'))(_0xf3cf('0x3'));var moment=require(_0xf3cf('0x4'));var BPromise=require('bluebird');var rp=require(_0xf3cf('0x5'));var fs=require('fs');var path=require(_0xf3cf('0x6'));var rimraf=require(_0xf3cf('0x7'));var config=require(_0xf3cf('0x8'));var attributes=require(_0xf3cf('0x9'));var integrations=require(_0xf3cf('0xa'));module[_0xf3cf('0xb')]=function(_0x47e6dc,_0x2477c8){return _0x47e6dc['define'](_0xf3cf('0xc'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe307=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','util'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xe307,0x15c));var _0x7e30=function(_0x33e1c7,_0x2d3b2f){_0x33e1c7=_0x33e1c7-0x0;var _0x4c47b1=_0xe307[_0x33e1c7];return _0x4c47b1;};'use strict';var _=require(_0x7e30('0x0'));var util=require(_0x7e30('0x1'));var logger=require(_0x7e30('0x2'))('api');var moment=require(_0x7e30('0x3'));var BPromise=require(_0x7e30('0x4'));var rp=require(_0x7e30('0x5'));var fs=require('fs');var path=require(_0x7e30('0x6'));var rimraf=require(_0x7e30('0x7'));var config=require(_0x7e30('0x8'));var attributes=require(_0x7e30('0x9'));var integrations=require(_0x7e30('0xa'));module[_0x7e30('0xb')]=function(_0x2ff871,_0xe701fc){return _0x2ff871['define'](_0x7e30('0xc'),attributes,{'tableName':_0x7e30('0xd'),'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 527a0bf..cab7aaa 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 _0xde50=['FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','limit','include','model','map','attributes','then','ShowFreshdeskAccount','find','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','http','info','FreshdeskAccount,\x20%s,\x20%s','debug'];(function(_0x453fd1,_0x4a825f){var _0x487183=function(_0x69548f){while(--_0x69548f){_0x453fd1['push'](_0x453fd1['shift']());}};_0x487183(++_0x4a825f);}(_0xde50,0x140));var _0x0de5=function(_0x36ed59,_0x534595){_0x36ed59=_0x36ed59-0x0;var _0xd1925b=_0xde50[_0x36ed59];return _0xd1925b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0de5('0x0'));var BPromise=require(_0x0de5('0x1'));var rs=require(_0x0de5('0x2'));var fs=require('fs');var Redis=require(_0x0de5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0de5('0x4'));var logger=require('../../config/logger')(_0x0de5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0de5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2714e3,_0x2a5d94,_0x57410e){return new BPromise(function(_0xe3ac44,_0x4d5f0e){return client['request'](_0x2714e3,_0x57410e)['then'](function(_0x396293){logger[_0x0de5('0x7')](_0x0de5('0x8'),_0x2a5d94,'request\x20sent');logger[_0x0de5('0x9')](_0x0de5('0xa'),_0x2a5d94,'request\x20sent',JSON[_0x0de5('0xb')](_0x396293));if(_0x396293[_0x0de5('0xc')]){if(_0x396293[_0x0de5('0xc')]['code']===0x1f4){logger['error'](_0x0de5('0x8'),_0x2a5d94,_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);return _0x4d5f0e(_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);}logger['error'](_0x0de5('0x8'),_0x2a5d94,_0x396293['error']['message']);return _0xe3ac44(_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);}else{logger[_0x0de5('0x7')](_0x0de5('0x8'),_0x2a5d94,_0x0de5('0xe'));_0xe3ac44(_0x396293[_0x0de5('0xf')]['message']);}})[_0x0de5('0x10')](function(_0xeb58e1){logger[_0x0de5('0xc')](_0x0de5('0x8'),_0x2a5d94,_0xeb58e1);_0x4d5f0e(_0xeb58e1);});});}exports[_0x0de5('0x11')]=function(_0x2860e8){var _0x58ce66=this;return new Promise(function(_0x21e4b6,_0x48ba4e){return db[_0x0de5('0x12')][_0x0de5('0x13')]({'raw':_0x2860e8[_0x0de5('0x14')]?_0x2860e8[_0x0de5('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2860e8[_0x0de5('0x14')]?_0x2860e8['options'][_0x0de5('0x15')]||null:null,'attributes':_0x2860e8[_0x0de5('0x14')]?_0x2860e8[_0x0de5('0x14')]['attributes']||null:null,'limit':_0x2860e8[_0x0de5('0x14')]?_0x2860e8[_0x0de5('0x14')][_0x0de5('0x16')]||null:null,'include':_0x2860e8[_0x0de5('0x14')]?_0x2860e8['options'][_0x0de5('0x17')]?_['map'](_0x2860e8[_0x0de5('0x14')][_0x0de5('0x17')],function(_0x3bf543){return{'model':db[_0x3bf543[_0x0de5('0x18')]],'as':_0x3bf543['as'],'attributes':_0x3bf543['attributes'],'include':_0x3bf543['include']?_[_0x0de5('0x19')](_0x3bf543['include'],function(_0x378089){return{'model':db[_0x378089['model']],'as':_0x378089['as'],'attributes':_0x378089[_0x0de5('0x1a')],'include':_0x378089[_0x0de5('0x17')]?_[_0x0de5('0x19')](_0x378089[_0x0de5('0x17')],function(_0x3b8981){return{'model':db[_0x3b8981['model']],'as':_0x3b8981['as'],'attributes':_0x3b8981[_0x0de5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0de5('0x1b')](function(_0x3880e8){logger[_0x0de5('0x7')](_0x0de5('0x11'),_0x2860e8);logger[_0x0de5('0x9')]('GetFreshdeskAccount',_0x2860e8,JSON[_0x0de5('0xb')](_0x3880e8));_0x21e4b6(_0x3880e8);})['catch'](function(_0x521026){logger[_0x0de5('0xc')]('GetFreshdeskAccount',_0x521026['message'],_0x2860e8);_0x48ba4e(_0x58ce66[_0x0de5('0xc')](0x1f4,_0x521026[_0x0de5('0xd')]));});});};exports[_0x0de5('0x1c')]=function(_0x523b4f){var _0xbefe67=this;return new Promise(function(_0x50a222,_0x1a9638){return db[_0x0de5('0x12')][_0x0de5('0x1d')]({'raw':_0x523b4f[_0x0de5('0x14')]?_0x523b4f['options']['raw']===undefined?!![]:![]:!![],'where':_0x523b4f[_0x0de5('0x14')]?_0x523b4f[_0x0de5('0x14')][_0x0de5('0x15')]||null:null,'attributes':_0x523b4f[_0x0de5('0x14')]?_0x523b4f[_0x0de5('0x14')]['attributes']||null:null,'include':_0x523b4f[_0x0de5('0x14')]?_0x523b4f[_0x0de5('0x14')]['include']?_['map'](_0x523b4f[_0x0de5('0x14')][_0x0de5('0x17')],function(_0x3a8f77){return{'model':db[_0x3a8f77[_0x0de5('0x18')]],'as':_0x3a8f77['as'],'attributes':_0x3a8f77[_0x0de5('0x1a')],'include':_0x3a8f77[_0x0de5('0x17')]?_[_0x0de5('0x19')](_0x3a8f77['include'],function(_0x2a4bb6){return{'model':db[_0x2a4bb6[_0x0de5('0x18')]],'as':_0x2a4bb6['as'],'attributes':_0x2a4bb6['attributes'],'include':_0x2a4bb6[_0x0de5('0x17')]?_[_0x0de5('0x19')](_0x2a4bb6[_0x0de5('0x17')],function(_0x239d7c){return{'model':db[_0x239d7c[_0x0de5('0x18')]],'as':_0x239d7c['as'],'attributes':_0x239d7c[_0x0de5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0de5('0x1b')](function(_0x128bb8){logger['info'](_0x0de5('0x1c'),_0x523b4f);logger['debug'](_0x0de5('0x1c'),_0x523b4f,JSON['stringify'](_0x128bb8));_0x50a222(_0x128bb8);})[_0x0de5('0x10')](function(_0x267f1d){logger[_0x0de5('0xc')]('ShowFreshdeskAccount',_0x267f1d[_0x0de5('0xd')],_0x523b4f);_0x1a9638(_0xbefe67[_0x0de5('0xc')](0x1f4,_0x267f1d[_0x0de5('0xd')]));});});}; \ No newline at end of file +var _0x4134=['message','FreshdeskAccount,\x20%s,\x20%s','result','catch','FreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','where','then','lodash','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x17336a,_0x14b0c0){var _0x2b71d5=function(_0x462d1a){while(--_0x462d1a){_0x17336a['push'](_0x17336a['shift']());}};_0x2b71d5(++_0x14b0c0);}(_0x4134,0x89));var _0x4413=function(_0x5ec84f,_0x11877d){_0x5ec84f=_0x5ec84f-0x0;var _0x2dc82c=_0x4134[_0x5ec84f];return _0x2dc82c;};'use strict';var _=require(_0x4413('0x0'));var util=require('util');var moment=require(_0x4413('0x1'));var BPromise=require(_0x4413('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4413('0x3'));var logger=require(_0x4413('0x4'))('rpc');var config=require(_0x4413('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47fc80,_0x3561f2,_0x5a8c11){return new BPromise(function(_0x4c50aa,_0x38b65e){return client['request'](_0x47fc80,_0x5a8c11)['then'](function(_0x52081d){logger[_0x4413('0x6')]('FreshdeskAccount,\x20%s,\x20%s',_0x3561f2,_0x4413('0x7'));logger[_0x4413('0x8')](_0x4413('0x9'),_0x3561f2,'request\x20sent',JSON[_0x4413('0xa')](_0x52081d));if(_0x52081d[_0x4413('0xb')]){if(_0x52081d[_0x4413('0xb')][_0x4413('0xc')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x3561f2,_0x52081d['error'][_0x4413('0xd')]);return _0x38b65e(_0x52081d[_0x4413('0xb')][_0x4413('0xd')]);}logger[_0x4413('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x3561f2,_0x52081d[_0x4413('0xb')][_0x4413('0xd')]);return _0x4c50aa(_0x52081d[_0x4413('0xb')][_0x4413('0xd')]);}else{logger[_0x4413('0x6')](_0x4413('0xe'),_0x3561f2,_0x4413('0x7'));_0x4c50aa(_0x52081d[_0x4413('0xf')][_0x4413('0xd')]);}})[_0x4413('0x10')](function(_0xa20761){logger[_0x4413('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x3561f2,_0xa20761);_0x38b65e(_0xa20761);});});}exports['GetFreshdeskAccount']=function(_0x4a4b38){var _0x19f434=this;return new Promise(function(_0x3a293c,_0x12ea02){return db[_0x4413('0x11')][_0x4413('0x12')]({'raw':_0x4a4b38['options']?_0x4a4b38[_0x4413('0x13')][_0x4413('0x14')]===undefined?!![]:![]:!![],'where':_0x4a4b38[_0x4413('0x13')]?_0x4a4b38['options']['where']||null:null,'attributes':_0x4a4b38[_0x4413('0x13')]?_0x4a4b38[_0x4413('0x13')][_0x4413('0x15')]||null:null,'limit':_0x4a4b38[_0x4413('0x13')]?_0x4a4b38[_0x4413('0x13')][_0x4413('0x16')]||null:null,'include':_0x4a4b38['options']?_0x4a4b38[_0x4413('0x13')][_0x4413('0x17')]?_[_0x4413('0x18')](_0x4a4b38['options']['include'],function(_0x1ddeab){return{'model':db[_0x1ddeab['model']],'as':_0x1ddeab['as'],'attributes':_0x1ddeab[_0x4413('0x15')],'include':_0x1ddeab[_0x4413('0x17')]?_[_0x4413('0x18')](_0x1ddeab[_0x4413('0x17')],function(_0x4c1dee){return{'model':db[_0x4c1dee[_0x4413('0x19')]],'as':_0x4c1dee['as'],'attributes':_0x4c1dee['attributes'],'include':_0x4c1dee['include']?_[_0x4413('0x18')](_0x4c1dee[_0x4413('0x17')],function(_0x5a43d4){return{'model':db[_0x5a43d4[_0x4413('0x19')]],'as':_0x5a43d4['as'],'attributes':_0x5a43d4[_0x4413('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31a6f8){logger[_0x4413('0x6')](_0x4413('0x1a'),_0x4a4b38);logger[_0x4413('0x8')]('GetFreshdeskAccount',_0x4a4b38,JSON[_0x4413('0xa')](_0x31a6f8));_0x3a293c(_0x31a6f8);})['catch'](function(_0x426695){logger[_0x4413('0xb')]('GetFreshdeskAccount',_0x426695[_0x4413('0xd')],_0x4a4b38);_0x12ea02(_0x19f434[_0x4413('0xb')](0x1f4,_0x426695[_0x4413('0xd')]));});});};exports[_0x4413('0x1b')]=function(_0x50d7ee){var _0xb74e92=this;return new Promise(function(_0x4d5a1b,_0xda2119){return db[_0x4413('0x11')]['find']({'raw':_0x50d7ee[_0x4413('0x13')]?_0x50d7ee['options'][_0x4413('0x14')]===undefined?!![]:![]:!![],'where':_0x50d7ee[_0x4413('0x13')]?_0x50d7ee[_0x4413('0x13')][_0x4413('0x1c')]||null:null,'attributes':_0x50d7ee['options']?_0x50d7ee['options'][_0x4413('0x15')]||null:null,'include':_0x50d7ee[_0x4413('0x13')]?_0x50d7ee[_0x4413('0x13')][_0x4413('0x17')]?_[_0x4413('0x18')](_0x50d7ee['options'][_0x4413('0x17')],function(_0x55d1f9){return{'model':db[_0x55d1f9[_0x4413('0x19')]],'as':_0x55d1f9['as'],'attributes':_0x55d1f9[_0x4413('0x15')],'include':_0x55d1f9['include']?_[_0x4413('0x18')](_0x55d1f9['include'],function(_0x449e7e){return{'model':db[_0x449e7e[_0x4413('0x19')]],'as':_0x449e7e['as'],'attributes':_0x449e7e[_0x4413('0x15')],'include':_0x449e7e[_0x4413('0x17')]?_[_0x4413('0x18')](_0x449e7e[_0x4413('0x17')],function(_0x9ad2ce){return{'model':db[_0x9ad2ce[_0x4413('0x19')]],'as':_0x9ad2ce['as'],'attributes':_0x9ad2ce['attributes']};}):[]};}):[]};}):[]:[]})[_0x4413('0x1d')](function(_0x339853){logger[_0x4413('0x6')](_0x4413('0x1b'),_0x50d7ee);logger['debug']('ShowFreshdeskAccount',_0x50d7ee,JSON[_0x4413('0xa')](_0x339853));_0x4d5a1b(_0x339853);})[_0x4413('0x10')](function(_0x7df7d0){logger[_0x4413('0xb')](_0x4413('0x1b'),_0x7df7d0[_0x4413('0xd')],_0x50d7ee);_0xda2119(_0xb74e92['error'](0x1f4,_0x7df7d0[_0x4413('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index fe2af04..36a99fe 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 _0x573a=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','update'];(function(_0x8c2306,_0x3084ec){var _0x8e4fc7=function(_0x2754fc){while(--_0x2754fc){_0x8c2306['push'](_0x8c2306['shift']());}};_0x8e4fc7(++_0x3084ec);}(_0x573a,0x110));var _0xa573=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0x573a[_0x15dbca];return _0x326533;};'use strict';var multer=require(_0xa573('0x0'));var util=require(_0xa573('0x1'));var path=require(_0xa573('0x2'));var timeout=require(_0xa573('0x3'));var express=require(_0xa573('0x4'));var router=express[_0xa573('0x5')]();var fs_extra=require(_0xa573('0x6'));var auth=require(_0xa573('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa573('0x8'));var controller=require(_0xa573('0x9'));router[_0xa573('0xa')]('/',auth[_0xa573('0xb')](),controller[_0xa573('0xc')]);router['get'](_0xa573('0xd'),auth[_0xa573('0xb')](),controller[_0xa573('0xe')]);router['get'](_0xa573('0xf'),auth[_0xa573('0xb')](),controller[_0xa573('0x10')]);router[_0xa573('0xa')](_0xa573('0x11'),auth[_0xa573('0xb')](),controller[_0xa573('0x12')]);router[_0xa573('0xa')](_0xa573('0x13'),auth[_0xa573('0xb')](),controller[_0xa573('0x14')]);router[_0xa573('0xa')](_0xa573('0x15'),auth[_0xa573('0xb')](),controller[_0xa573('0x16')]);router['post']('/',auth[_0xa573('0xb')](),controller[_0xa573('0x17')]);router[_0xa573('0x18')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa573('0x19')]);router[_0xa573('0x1a')](_0xa573('0xd'),auth[_0xa573('0xb')](),controller[_0xa573('0x1b')]);router[_0xa573('0x1c')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa573('0x1d')]=router; \ No newline at end of file +var _0xed39=['put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','/:id','isAuthenticated','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags'];(function(_0x2749d0,_0x544a64){var _0x58972f=function(_0x2fa4d8){while(--_0x2fa4d8){_0x2749d0['push'](_0x2749d0['shift']());}};_0x58972f(++_0x544a64);}(_0xed39,0x1f2));var _0x9ed3=function(_0x5000f5,_0x549e98){_0x5000f5=_0x5000f5-0x0;var _0x34ca60=_0xed39[_0x5000f5];return _0x34ca60;};'use strict';var multer=require(_0x9ed3('0x0'));var util=require(_0x9ed3('0x1'));var path=require('path');var timeout=require(_0x9ed3('0x2'));var express=require(_0x9ed3('0x3'));var router=express[_0x9ed3('0x4')]();var fs_extra=require(_0x9ed3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9ed3('0x6'));var config=require(_0x9ed3('0x7'));var controller=require(_0x9ed3('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9ed3('0x9'),auth[_0x9ed3('0xa')](),controller['show']);router[_0x9ed3('0xb')](_0x9ed3('0xc'),auth[_0x9ed3('0xa')](),controller[_0x9ed3('0xd')]);router[_0x9ed3('0xb')](_0x9ed3('0xe'),auth[_0x9ed3('0xa')](),controller[_0x9ed3('0xf')]);router[_0x9ed3('0xb')](_0x9ed3('0x10'),auth[_0x9ed3('0xa')](),controller[_0x9ed3('0x11')]);router[_0x9ed3('0xb')](_0x9ed3('0x12'),auth[_0x9ed3('0xa')](),controller[_0x9ed3('0x13')]);router[_0x9ed3('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9ed3('0x14')](_0x9ed3('0x12'),auth[_0x9ed3('0xa')](),controller[_0x9ed3('0x15')]);router[_0x9ed3('0x16')](_0x9ed3('0x9'),auth[_0x9ed3('0xa')](),controller[_0x9ed3('0x17')]);router['delete'](_0x9ed3('0x9'),auth['isAuthenticated'](),controller[_0x9ed3('0x18')]);module[_0x9ed3('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 5d47ec1..0aa0716 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 _0x5666=['sequelize','exports','STRING'];(function(_0x22342c,_0x218835){var _0xd3b434=function(_0x45b259){while(--_0x45b259){_0x22342c['push'](_0x22342c['shift']());}};_0xd3b434(++_0x218835);}(_0x5666,0x9c));var _0x6566=function(_0x11278d,_0xb189f1){_0x11278d=_0x11278d-0x0;var _0x5c1432=_0x5666[_0x11278d];return _0x5c1432;};'use strict';var Sequelize=require(_0x6566('0x0'));module[_0x6566('0x1')]={'name':{'type':Sequelize[_0x6566('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9b19=['sequelize','exports','STRING'];(function(_0x501f6a,_0x5591e1){var _0x5edb99=function(_0x43e856){while(--_0x43e856){_0x501f6a['push'](_0x501f6a['shift']());}};_0x5edb99(++_0x5591e1);}(_0x9b19,0x1b9));var _0x99b1=function(_0x3789b9,_0x5c2f00){_0x3789b9=_0x3789b9-0x0;var _0x4d020d=_0x9b19[_0x3789b9];return _0x4d020d;};'use strict';var Sequelize=require(_0x99b1('0x0'));module[_0x99b1('0x1')]={'name':{'type':Sequelize[_0x99b1('0x2')]},'description':{'type':Sequelize[_0x99b1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index d405289..e2b3b32 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 _0x842d=['name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','FreshdeskConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','FreshdeskField','pick','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','stack'];(function(_0x26693b,_0x1209d0){var _0x2d3c39=function(_0x266729){while(--_0x266729){_0x26693b['push'](_0x26693b['shift']());}};_0x2d3c39(++_0x1209d0);}(_0x842d,0x175));var _0xd842=function(_0x43371b,_0x1cb4cf){_0x43371b=_0x43371b-0x0;var _0x19cd26=_0x842d[_0x43371b];return _0x19cd26;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd842('0x0'));var zipdir=require(_0xd842('0x1'));var jsonpatch=require(_0xd842('0x2'));var rp=require(_0xd842('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd842('0x4'));var util=require(_0xd842('0x5'));var path=require(_0xd842('0x6'));var sox=require(_0xd842('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd842('0x8'));var _=require(_0xd842('0x9'));var squel=require('squel');var crypto=require(_0xd842('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd842('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd842('0xc'));var Redis=require(_0xd842('0xd'));var authService=require(_0xd842('0xe'));var qs=require(_0xd842('0xf'));var as=require(_0xd842('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd842('0x11'));var config=require(_0xd842('0x12'));var licenseUtil=require(_0xd842('0x13'));var db=require(_0xd842('0x14'))['db'];function respondWithStatusCode(_0x445d7c,_0x56d5fb){_0x56d5fb=_0x56d5fb||0xcc;return function(_0x50b834){if(_0x50b834){return _0x445d7c[_0xd842('0x15')](_0x56d5fb);}return _0x445d7c['status'](_0x56d5fb)[_0xd842('0x16')]();};}function respondWithResult(_0x9d1f4e,_0x2fc401){_0x2fc401=_0x2fc401||0xc8;return function(_0x5a7e49){if(_0x5a7e49){return _0x9d1f4e[_0xd842('0x17')](_0x2fc401)['json'](_0x5a7e49);}};}function respondWithFilteredResult(_0x3d0a7f,_0x36e740){return function(_0x34bd4e){if(_0x34bd4e){var _0x549f6a=typeof _0x36e740[_0xd842('0x18')]===_0xd842('0x19')&&typeof _0x36e740[_0xd842('0x1a')]===_0xd842('0x19');var _0x41e78e=_0x34bd4e[_0xd842('0x1b')];var _0x10d7af=_0x549f6a?0x0:_0x36e740[_0xd842('0x18')];var _0x3da361=_0x549f6a?_0x34bd4e[_0xd842('0x1b')]:_0x36e740[_0xd842('0x18')]+_0x36e740['limit'];var _0x2ccb89;if(_0x3da361>=_0x41e78e){_0x3da361=_0x41e78e;_0x2ccb89=0xc8;}else{_0x2ccb89=0xce;}_0x3d0a7f[_0xd842('0x17')](_0x2ccb89);return _0x3d0a7f[_0xd842('0x1c')](_0xd842('0x1d'),_0x10d7af+'-'+_0x3da361+'/'+_0x41e78e)[_0xd842('0x1e')](_0x34bd4e);}return null;};}function patchUpdates(_0x32dad5){return function(_0x18c1dd){try{jsonpatch['apply'](_0x18c1dd,_0x32dad5,!![]);}catch(_0x114fa6){return BPromise[_0xd842('0x1f')](_0x114fa6);}return _0x18c1dd['save']();};}function saveUpdates(_0x51ac5c,_0x25f2d7){return function(_0x1c1cc7){if(_0x1c1cc7){return _0x1c1cc7[_0xd842('0x20')](_0x51ac5c)[_0xd842('0x21')](function(_0x54ddd7){return _0x54ddd7;});}return null;};}function removeEntity(_0x490a19,_0x539b7b){return function(_0x32c99c){if(_0x32c99c){return _0x32c99c[_0xd842('0x22')]()[_0xd842('0x21')](function(){_0x490a19[_0xd842('0x17')](0xcc)[_0xd842('0x16')]();});}};}function handleEntityNotFound(_0x5b615d,_0x142c10){return function(_0x1f9184){if(!_0x1f9184){_0x5b615d[_0xd842('0x15')](0x194);}return _0x1f9184;};}function handleError(_0x34e56c,_0x4e9787){_0x4e9787=_0x4e9787||0x1f4;return function(_0x145b86){logger[_0xd842('0x23')](_0x145b86[_0xd842('0x24')]);if(_0x145b86[_0xd842('0x25')]){delete _0x145b86[_0xd842('0x25')];}_0x34e56c[_0xd842('0x17')](_0x4e9787)[_0xd842('0x26')](_0x145b86);};}exports[_0xd842('0x27')]=function(_0x401801,_0x3b1c37){var _0x85bef3={},_0x4c2686={},_0x2616f0={'count':0x0,'rows':[]};var _0x23449f=_['map'](db['FreshdeskConfiguration'][_0xd842('0x28')],function(_0x3e2fd8){return{'name':_0x3e2fd8[_0xd842('0x29')],'type':_0x3e2fd8[_0xd842('0x2a')][_0xd842('0x2b')]};});_0x4c2686[_0xd842('0x2c')]=_[_0xd842('0x2d')](_0x23449f,_0xd842('0x25'));_0x4c2686[_0xd842('0x2e')]=_[_0xd842('0x2f')](_0x401801['query']);_0x4c2686[_0xd842('0x30')]=_[_0xd842('0x31')](_0x4c2686['model'],_0x4c2686['query']);_0x85bef3[_0xd842('0x32')]=_['intersection'](_0x4c2686[_0xd842('0x2c')],qs[_0xd842('0x33')](_0x401801['query'][_0xd842('0x33')]));_0x85bef3['attributes']=_0x85bef3[_0xd842('0x32')][_0xd842('0x34')]?_0x85bef3['attributes']:_0x4c2686[_0xd842('0x2c')];if(!_0x401801[_0xd842('0x2e')][_0xd842('0x35')]('nolimit')){_0x85bef3[_0xd842('0x1a')]=qs[_0xd842('0x1a')](_0x401801['query']['limit']);_0x85bef3['offset']=qs[_0xd842('0x18')](_0x401801[_0xd842('0x2e')][_0xd842('0x18')]);}_0x85bef3[_0xd842('0x36')]=qs[_0xd842('0x37')](_0x401801[_0xd842('0x2e')][_0xd842('0x37')]);_0x85bef3[_0xd842('0x38')]=qs[_0xd842('0x30')](_['pick'](_0x401801[_0xd842('0x2e')],_0x4c2686['filters']),_0x23449f);if(_0x401801[_0xd842('0x2e')][_0xd842('0x39')]){_0x85bef3[_0xd842('0x38')]=_[_0xd842('0x3a')](_0x85bef3[_0xd842('0x38')],{'$or':_[_0xd842('0x2d')](_0x23449f,function(_0x125834){if(_0x125834[_0xd842('0x2a')]!==_0xd842('0x3b')){var _0x438304={};_0x438304[_0x125834[_0xd842('0x25')]]={'$like':'%'+_0x401801[_0xd842('0x2e')][_0xd842('0x39')]+'%'};return _0x438304;}})});}_0x85bef3=_[_0xd842('0x3a')]({},_0x85bef3,_0x401801[_0xd842('0x3c')]);var _0x4a441c={'where':_0x85bef3[_0xd842('0x38')]};return db[_0xd842('0x3d')][_0xd842('0x1b')](_0x4a441c)[_0xd842('0x21')](function(_0x53d958){_0x2616f0[_0xd842('0x1b')]=_0x53d958;if(_0x401801['query'][_0xd842('0x3e')]){_0x85bef3[_0xd842('0x3f')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xd842('0x40')](_0x85bef3);})[_0xd842('0x21')](function(_0x3e9f7e){_0x2616f0[_0xd842('0x41')]=_0x3e9f7e;return _0x2616f0;})[_0xd842('0x21')](respondWithFilteredResult(_0x3b1c37,_0x85bef3))[_0xd842('0x42')](handleError(_0x3b1c37,null));};exports[_0xd842('0x43')]=function(_0x576c21,_0x119750){var _0x4b9b31={'raw':![],'where':{'id':_0x576c21[_0xd842('0x44')]['id']}},_0x3372d2={};_0x3372d2[_0xd842('0x2c')]=_[_0xd842('0x2f')](db['FreshdeskConfiguration'][_0xd842('0x28')]);_0x3372d2[_0xd842('0x2e')]=_[_0xd842('0x2f')](_0x576c21[_0xd842('0x2e')]);_0x3372d2['filters']=_[_0xd842('0x31')](_0x3372d2[_0xd842('0x2c')],_0x3372d2[_0xd842('0x2e')]);_0x4b9b31['attributes']=_[_0xd842('0x31')](_0x3372d2['model'],qs['fields'](_0x576c21[_0xd842('0x2e')][_0xd842('0x33')]));_0x4b9b31[_0xd842('0x32')]=_0x4b9b31[_0xd842('0x32')][_0xd842('0x34')]?_0x4b9b31[_0xd842('0x32')]:_0x3372d2[_0xd842('0x2c')];if(_0x576c21[_0xd842('0x2e')][_0xd842('0x3e')]){_0x4b9b31[_0xd842('0x3f')]=[{'all':!![]}];}_0x4b9b31=_['merge']({},_0x4b9b31,_0x576c21[_0xd842('0x3c')]);return db[_0xd842('0x3d')][_0xd842('0x45')](_0x4b9b31)[_0xd842('0x21')](handleEntityNotFound(_0x119750,null))[_0xd842('0x21')](respondWithResult(_0x119750,null))[_0xd842('0x42')](handleError(_0x119750,null));};exports[_0xd842('0x46')]=function(_0x32eee9,_0x4771d4){return db[_0xd842('0x3d')][_0xd842('0x46')](_0x32eee9[_0xd842('0x47')],{})[_0xd842('0x21')](respondWithResult(_0x4771d4,0xc9))['catch'](handleError(_0x4771d4,null));};exports[_0xd842('0x20')]=function(_0x4b909c,_0x10ac4b){if(_0x4b909c[_0xd842('0x47')]['id']){delete _0x4b909c[_0xd842('0x47')]['id'];}return db[_0xd842('0x3d')][_0xd842('0x45')]({'where':{'id':_0x4b909c['params']['id']}})[_0xd842('0x21')](handleEntityNotFound(_0x10ac4b,null))[_0xd842('0x21')](saveUpdates(_0x4b909c['body'],null))[_0xd842('0x21')](respondWithResult(_0x10ac4b,null))['catch'](handleError(_0x10ac4b,null));};exports[_0xd842('0x22')]=function(_0x1eda5b,_0x576921){return db[_0xd842('0x3d')][_0xd842('0x45')]({'where':{'id':_0x1eda5b[_0xd842('0x44')]['id']}})['then'](handleEntityNotFound(_0x576921,null))[_0xd842('0x21')](removeEntity(_0x576921,null))[_0xd842('0x42')](handleError(_0x576921,null));};exports[_0xd842('0x48')]=function(_0x4f6685,_0x2f7d94,_0x4f6f99){var _0x37fb0e={};var _0x13daf0={};var _0x3a667e;var _0x281b95;return db[_0xd842('0x3d')][_0xd842('0x49')]({'where':{'id':_0x4f6685['params']['id']}})[_0xd842('0x21')](handleEntityNotFound(_0x2f7d94,null))['then'](function(_0x208cf7){if(_0x208cf7){_0x3a667e=_0x208cf7;_0x13daf0[_0xd842('0x2c')]=_[_0xd842('0x2f')](db[_0xd842('0x4a')][_0xd842('0x28')]);_0x13daf0[_0xd842('0x2e')]=_[_0xd842('0x2f')](_0x4f6685['query']);_0x13daf0[_0xd842('0x30')]=_[_0xd842('0x31')](_0x13daf0[_0xd842('0x2c')],_0x13daf0[_0xd842('0x2e')]);_0x37fb0e[_0xd842('0x32')]=_['intersection'](_0x13daf0[_0xd842('0x2c')],qs['fields'](_0x4f6685[_0xd842('0x2e')]['fields']));_0x37fb0e[_0xd842('0x32')]=_0x37fb0e[_0xd842('0x32')][_0xd842('0x34')]?_0x37fb0e[_0xd842('0x32')]:_0x13daf0[_0xd842('0x2c')];_0x37fb0e[_0xd842('0x36')]=qs[_0xd842('0x37')](_0x4f6685[_0xd842('0x2e')][_0xd842('0x37')]);_0x37fb0e[_0xd842('0x38')]=qs['filters'](_[_0xd842('0x4b')](_0x4f6685['query'],_0x13daf0[_0xd842('0x30')]));if(_0x4f6685[_0xd842('0x2e')][_0xd842('0x39')]){_0x37fb0e[_0xd842('0x38')]=_[_0xd842('0x3a')](_0x37fb0e[_0xd842('0x38')],{'$or':_[_0xd842('0x2d')](_0x37fb0e[_0xd842('0x32')],function(_0x4c945e){var _0x50e325={};_0x50e325[_0x4c945e]={'$like':'%'+_0x4f6685[_0xd842('0x2e')][_0xd842('0x39')]+'%'};return _0x50e325;})});}_0x37fb0e=_[_0xd842('0x3a')]({},_0x37fb0e,_0x4f6685[_0xd842('0x3c')]);return _0x3a667e[_0xd842('0x48')](_0x37fb0e);}})['then'](function(_0x59695d){if(_0x59695d){_0x281b95=_0x59695d['length'];if(!_0x4f6685[_0xd842('0x2e')][_0xd842('0x35')](_0xd842('0x4c'))){_0x37fb0e[_0xd842('0x1a')]=qs['limit'](_0x4f6685['query']['limit']);_0x37fb0e[_0xd842('0x18')]=qs[_0xd842('0x18')](_0x4f6685[_0xd842('0x2e')][_0xd842('0x18')]);}return _0x3a667e[_0xd842('0x48')](_0x37fb0e);}})[_0xd842('0x21')](function(_0x3ddfa1){if(_0x3ddfa1){return _0x3ddfa1?{'count':_0x281b95,'rows':_0x3ddfa1}:null;}})[_0xd842('0x21')](respondWithResult(_0x2f7d94,null))[_0xd842('0x42')](handleError(_0x2f7d94,null));};exports[_0xd842('0x4d')]=function(_0x231003,_0xec87d7,_0x578182){var _0x2f8f1d={};var _0xda31d1={};var _0x258d1f;var _0x4bec55;return db[_0xd842('0x3d')][_0xd842('0x49')]({'where':{'id':_0x231003['params']['id']}})[_0xd842('0x21')](handleEntityNotFound(_0xec87d7,null))[_0xd842('0x21')](function(_0x48dd91){if(_0x48dd91){_0x258d1f=_0x48dd91;_0xda31d1['model']=_[_0xd842('0x2f')](db[_0xd842('0x4a')][_0xd842('0x28')]);_0xda31d1[_0xd842('0x2e')]=_[_0xd842('0x2f')](_0x231003[_0xd842('0x2e')]);_0xda31d1[_0xd842('0x30')]=_[_0xd842('0x31')](_0xda31d1[_0xd842('0x2c')],_0xda31d1[_0xd842('0x2e')]);_0x2f8f1d[_0xd842('0x32')]=_[_0xd842('0x31')](_0xda31d1['model'],qs[_0xd842('0x33')](_0x231003['query']['fields']));_0x2f8f1d[_0xd842('0x32')]=_0x2f8f1d[_0xd842('0x32')][_0xd842('0x34')]?_0x2f8f1d[_0xd842('0x32')]:_0xda31d1[_0xd842('0x2c')];_0x2f8f1d[_0xd842('0x36')]=qs[_0xd842('0x37')](_0x231003['query'][_0xd842('0x37')]);_0x2f8f1d[_0xd842('0x38')]=qs[_0xd842('0x30')](_[_0xd842('0x4b')](_0x231003[_0xd842('0x2e')],_0xda31d1[_0xd842('0x30')]));if(_0x231003['query'][_0xd842('0x39')]){_0x2f8f1d[_0xd842('0x38')]=_['merge'](_0x2f8f1d[_0xd842('0x38')],{'$or':_[_0xd842('0x2d')](_0x2f8f1d[_0xd842('0x32')],function(_0x499ac6){var _0x18d101={};_0x18d101[_0x499ac6]={'$like':'%'+_0x231003[_0xd842('0x2e')][_0xd842('0x39')]+'%'};return _0x18d101;})});}_0x2f8f1d=_[_0xd842('0x3a')]({},_0x2f8f1d,_0x231003[_0xd842('0x3c')]);return _0x258d1f[_0xd842('0x4d')](_0x2f8f1d);}})[_0xd842('0x21')](function(_0x28677a){if(_0x28677a){_0x4bec55=_0x28677a[_0xd842('0x34')];if(!_0x231003[_0xd842('0x2e')][_0xd842('0x35')](_0xd842('0x4c'))){_0x2f8f1d['limit']=qs[_0xd842('0x1a')](_0x231003[_0xd842('0x2e')]['limit']);_0x2f8f1d[_0xd842('0x18')]=qs[_0xd842('0x18')](_0x231003[_0xd842('0x2e')][_0xd842('0x18')]);}return _0x258d1f[_0xd842('0x4d')](_0x2f8f1d);}})['then'](function(_0x5c5229){if(_0x5c5229){return _0x5c5229?{'count':_0x4bec55,'rows':_0x5c5229}:null;}})[_0xd842('0x21')](respondWithResult(_0xec87d7,null))[_0xd842('0x42')](handleError(_0xec87d7,null));};exports[_0xd842('0x4e')]=function(_0x39ba0b,_0x29df7f,_0xa79f3f){var _0x222c84={};var _0x348c4f={};var _0xc004c0;var _0x3c2964;return db[_0xd842('0x3d')][_0xd842('0x49')]({'where':{'id':_0x39ba0b[_0xd842('0x44')]['id']}})[_0xd842('0x21')](handleEntityNotFound(_0x29df7f,null))[_0xd842('0x21')](function(_0xd743fb){if(_0xd743fb){_0xc004c0=_0xd743fb;_0x348c4f[_0xd842('0x2c')]=_[_0xd842('0x2f')](db[_0xd842('0x4a')][_0xd842('0x28')]);_0x348c4f[_0xd842('0x2e')]=_[_0xd842('0x2f')](_0x39ba0b[_0xd842('0x2e')]);_0x348c4f[_0xd842('0x30')]=_[_0xd842('0x31')](_0x348c4f[_0xd842('0x2c')],_0x348c4f[_0xd842('0x2e')]);_0x222c84[_0xd842('0x32')]=_['intersection'](_0x348c4f[_0xd842('0x2c')],qs[_0xd842('0x33')](_0x39ba0b[_0xd842('0x2e')]['fields']));_0x222c84[_0xd842('0x32')]=_0x222c84[_0xd842('0x32')]['length']?_0x222c84[_0xd842('0x32')]:_0x348c4f[_0xd842('0x2c')];_0x222c84[_0xd842('0x36')]=qs[_0xd842('0x37')](_0x39ba0b[_0xd842('0x2e')]['sort']);_0x222c84[_0xd842('0x38')]=qs[_0xd842('0x30')](_[_0xd842('0x4b')](_0x39ba0b['query'],_0x348c4f[_0xd842('0x30')]));if(_0x39ba0b[_0xd842('0x2e')]['filter']){_0x222c84[_0xd842('0x38')]=_['merge'](_0x222c84['where'],{'$or':_[_0xd842('0x2d')](_0x222c84['attributes'],function(_0x1a4b02){var _0x32e351={};_0x32e351[_0x1a4b02]={'$like':'%'+_0x39ba0b['query'][_0xd842('0x39')]+'%'};return _0x32e351;})});}_0x222c84=_[_0xd842('0x3a')]({},_0x222c84,_0x39ba0b[_0xd842('0x3c')]);return _0xc004c0[_0xd842('0x4e')](_0x222c84);}})[_0xd842('0x21')](function(_0x5bd594){if(_0x5bd594){_0x3c2964=_0x5bd594['length'];if(!_0x39ba0b[_0xd842('0x2e')][_0xd842('0x35')](_0xd842('0x4c'))){_0x222c84[_0xd842('0x1a')]=qs[_0xd842('0x1a')](_0x39ba0b[_0xd842('0x2e')]['limit']);_0x222c84['offset']=qs[_0xd842('0x18')](_0x39ba0b[_0xd842('0x2e')][_0xd842('0x18')]);}return _0xc004c0[_0xd842('0x4e')](_0x222c84);}})[_0xd842('0x21')](function(_0x5dacc4){if(_0x5dacc4){return _0x5dacc4?{'count':_0x3c2964,'rows':_0x5dacc4}:null;}})['then'](respondWithResult(_0x29df7f,null))[_0xd842('0x42')](handleError(_0x29df7f,null));};exports[_0xd842('0x4f')]=function(_0xef65be,_0xd1385d,_0xee3938){var _0x504521={};var _0x45cfcb={};var _0x4a22d7;var _0x2bebf6;return db[_0xd842('0x3d')][_0xd842('0x49')]({'where':{'id':_0xef65be[_0xd842('0x44')]['id']}})[_0xd842('0x21')](handleEntityNotFound(_0xd1385d,null))[_0xd842('0x21')](function(_0x1f0760){if(_0x1f0760){_0x4a22d7=_0x1f0760;_0x45cfcb[_0xd842('0x2c')]=_[_0xd842('0x2f')](db[_0xd842('0x50')][_0xd842('0x28')]);_0x45cfcb['query']=_['keys'](_0xef65be['query']);_0x45cfcb[_0xd842('0x30')]=_[_0xd842('0x31')](_0x45cfcb['model'],_0x45cfcb['query']);_0x504521['attributes']=_[_0xd842('0x31')](_0x45cfcb['model'],qs[_0xd842('0x33')](_0xef65be['query'][_0xd842('0x33')]));_0x504521['attributes']=_0x504521[_0xd842('0x32')][_0xd842('0x34')]?_0x504521[_0xd842('0x32')]:_0x45cfcb[_0xd842('0x2c')];_0x504521['order']=qs[_0xd842('0x37')](_0xef65be[_0xd842('0x2e')][_0xd842('0x37')]);_0x504521[_0xd842('0x38')]=qs['filters'](_[_0xd842('0x4b')](_0xef65be[_0xd842('0x2e')],_0x45cfcb[_0xd842('0x30')]));if(_0xef65be[_0xd842('0x2e')]['filter']){_0x504521[_0xd842('0x38')]=_[_0xd842('0x3a')](_0x504521[_0xd842('0x38')],{'$or':_[_0xd842('0x2d')](_0x504521[_0xd842('0x32')],function(_0xe18cec){var _0x5a17dd={};_0x5a17dd[_0xe18cec]={'$like':'%'+_0xef65be[_0xd842('0x2e')][_0xd842('0x39')]+'%'};return _0x5a17dd;})});}_0x504521=_[_0xd842('0x3a')]({},_0x504521,_0xef65be[_0xd842('0x3c')]);return _0x4a22d7[_0xd842('0x4f')](_0x504521);}})[_0xd842('0x21')](function(_0x4ec2bc){if(_0x4ec2bc){_0x2bebf6=_0x4ec2bc[_0xd842('0x34')];if(!_0xef65be['query']['hasOwnProperty'](_0xd842('0x4c'))){_0x504521[_0xd842('0x1a')]=qs[_0xd842('0x1a')](_0xef65be['query'][_0xd842('0x1a')]);_0x504521['offset']=qs[_0xd842('0x18')](_0xef65be['query']['offset']);}return _0x4a22d7[_0xd842('0x4f')](_0x504521);}})[_0xd842('0x21')](function(_0x38e150){if(_0x38e150){return _0x38e150?{'count':_0x2bebf6,'rows':_0x38e150}:null;}})[_0xd842('0x21')](respondWithResult(_0xd1385d,null))[_0xd842('0x42')](handleError(_0xd1385d,null));};exports['setTags']=function(_0xc32a05,_0xeca1c3,_0x40223c){if(_0xc32a05[_0xd842('0x47')]['id']){delete _0xc32a05[_0xd842('0x47')]['id'];}return db[_0xd842('0x3d')][_0xd842('0x49')]({'where':{'id':_0xc32a05[_0xd842('0x44')]['id']}})[_0xd842('0x21')](handleEntityNotFound(_0xeca1c3,null))[_0xd842('0x21')](function(_0x54ff81){if(_0x54ff81){return _0x54ff81[_0xd842('0x51')](_0xc32a05[_0xd842('0x47')]['ids']||[]);}return null;})['then'](respondWithResult(_0xeca1c3,null))[_0xd842('0x42')](handleError(_0xeca1c3,null));}; \ No newline at end of file +var _0x3349=['rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','then','destroy','stack','name','index','map','FreshdeskConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','merge','find','create','body','update','params','getFields','findOne','FreshdeskField','sort','pick','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format'];(function(_0x5cb3d4,_0x41f1aa){var _0x5c44f1=function(_0x4879e2){while(--_0x4879e2){_0x5cb3d4['push'](_0x5cb3d4['shift']());}};_0x5c44f1(++_0x41f1aa);}(_0x3349,0xa3));var _0x9334=function(_0x2ace4e,_0x4546f3){_0x2ace4e=_0x2ace4e-0x0;var _0x115c09=_0x3349[_0x2ace4e];return _0x115c09;};'use strict';var emlformat=require(_0x9334('0x0'));var rimraf=require(_0x9334('0x1'));var zipdir=require(_0x9334('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9334('0x3'));var moment=require(_0x9334('0x4'));var BPromise=require(_0x9334('0x5'));var Mustache=require('mustache');var util=require(_0x9334('0x6'));var path=require('path');var sox=require(_0x9334('0x7'));var csv=require(_0x9334('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9334('0x9'));var _=require('lodash');var squel=require(_0x9334('0xa'));var crypto=require(_0x9334('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9334('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9334('0xd'));var Papa=require(_0x9334('0xe'));var Redis=require(_0x9334('0xf'));var authService=require(_0x9334('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9334('0x11'));var logger=require(_0x9334('0x12'))(_0x9334('0x13'));var utils=require(_0x9334('0x14'));var config=require(_0x9334('0x15'));var licenseUtil=require(_0x9334('0x16'));var db=require(_0x9334('0x17'))['db'];function respondWithStatusCode(_0x5802e7,_0x474ed1){_0x474ed1=_0x474ed1||0xcc;return function(_0x117278){if(_0x117278){return _0x5802e7[_0x9334('0x18')](_0x474ed1);}return _0x5802e7[_0x9334('0x19')](_0x474ed1)[_0x9334('0x1a')]();};}function respondWithResult(_0x4820c5,_0xdd6db){_0xdd6db=_0xdd6db||0xc8;return function(_0x4d6848){if(_0x4d6848){return _0x4820c5[_0x9334('0x19')](_0xdd6db)[_0x9334('0x1b')](_0x4d6848);}};}function respondWithFilteredResult(_0x56c566,_0x5e2dd1){return function(_0x47dd35){if(_0x47dd35){var _0x1ff203=typeof _0x5e2dd1['offset']===_0x9334('0x1c')&&typeof _0x5e2dd1[_0x9334('0x1d')]===_0x9334('0x1c');var _0x24b6a7=_0x47dd35['count'];var _0x59d968=_0x1ff203?0x0:_0x5e2dd1[_0x9334('0x1e')];var _0x1cfef6=_0x1ff203?_0x47dd35[_0x9334('0x1f')]:_0x5e2dd1[_0x9334('0x1e')]+_0x5e2dd1[_0x9334('0x1d')];var _0x3e6b3c;if(_0x1cfef6>=_0x24b6a7){_0x1cfef6=_0x24b6a7;_0x3e6b3c=0xc8;}else{_0x3e6b3c=0xce;}_0x56c566[_0x9334('0x19')](_0x3e6b3c);return _0x56c566[_0x9334('0x20')]('Content-Range',_0x59d968+'-'+_0x1cfef6+'/'+_0x24b6a7)[_0x9334('0x1b')](_0x47dd35);}return null;};}function patchUpdates(_0xb67794){return function(_0x26ba9e){try{jsonpatch[_0x9334('0x21')](_0x26ba9e,_0xb67794,!![]);}catch(_0x293f3a){return BPromise[_0x9334('0x22')](_0x293f3a);}return _0x26ba9e['save']();};}function saveUpdates(_0x385b7f,_0x365aa0){return function(_0x374ba6){if(_0x374ba6){return _0x374ba6['update'](_0x385b7f)[_0x9334('0x23')](function(_0x157a98){return _0x157a98;});}return null;};}function removeEntity(_0x49121e,_0x4ff8eb){return function(_0xf5308b){if(_0xf5308b){return _0xf5308b[_0x9334('0x24')]()[_0x9334('0x23')](function(){_0x49121e['status'](0xcc)[_0x9334('0x1a')]();});}};}function handleEntityNotFound(_0x4ec662,_0x1b3626){return function(_0x50276a){if(!_0x50276a){_0x4ec662[_0x9334('0x18')](0x194);}return _0x50276a;};}function handleError(_0x3841cf,_0x3e3d27){_0x3e3d27=_0x3e3d27||0x1f4;return function(_0x1c7ede){logger['error'](_0x1c7ede[_0x9334('0x25')]);if(_0x1c7ede[_0x9334('0x26')]){delete _0x1c7ede[_0x9334('0x26')];}_0x3841cf['status'](_0x3e3d27)['send'](_0x1c7ede);};}exports[_0x9334('0x27')]=function(_0x41088d,_0x3f1dd6){var _0x3783c7={},_0xd21d77={},_0x187faf={'count':0x0,'rows':[]};var _0x2fbfe3=_[_0x9334('0x28')](db[_0x9334('0x29')][_0x9334('0x2a')],function(_0x1b0c2f){return{'name':_0x1b0c2f['fieldName'],'type':_0x1b0c2f[_0x9334('0x2b')][_0x9334('0x2c')]};});_0xd21d77[_0x9334('0x2d')]=_[_0x9334('0x28')](_0x2fbfe3,'name');_0xd21d77[_0x9334('0x2e')]=_[_0x9334('0x2f')](_0x41088d[_0x9334('0x2e')]);_0xd21d77[_0x9334('0x30')]=_['intersection'](_0xd21d77[_0x9334('0x2d')],_0xd21d77['query']);_0x3783c7[_0x9334('0x31')]=_[_0x9334('0x32')](_0xd21d77['model'],qs[_0x9334('0x33')](_0x41088d[_0x9334('0x2e')][_0x9334('0x33')]));_0x3783c7[_0x9334('0x31')]=_0x3783c7['attributes'][_0x9334('0x34')]?_0x3783c7[_0x9334('0x31')]:_0xd21d77[_0x9334('0x2d')];if(!_0x41088d[_0x9334('0x2e')]['hasOwnProperty'](_0x9334('0x35'))){_0x3783c7[_0x9334('0x1d')]=qs['limit'](_0x41088d['query'][_0x9334('0x1d')]);_0x3783c7[_0x9334('0x1e')]=qs[_0x9334('0x1e')](_0x41088d['query'][_0x9334('0x1e')]);}_0x3783c7[_0x9334('0x36')]=qs['sort'](_0x41088d['query']['sort']);_0x3783c7[_0x9334('0x37')]=qs['filters'](_['pick'](_0x41088d['query'],_0xd21d77[_0x9334('0x30')]),_0x2fbfe3);if(_0x41088d[_0x9334('0x2e')]['filter']){_0x3783c7['where']=_['merge'](_0x3783c7[_0x9334('0x37')],{'$or':_[_0x9334('0x28')](_0x2fbfe3,function(_0x90b2f4){if(_0x90b2f4[_0x9334('0x2b')]!==_0x9334('0x38')){var _0x28fbf3={};_0x28fbf3[_0x90b2f4[_0x9334('0x26')]]={'$like':'%'+_0x41088d['query'][_0x9334('0x39')]+'%'};return _0x28fbf3;}})});}_0x3783c7=_['merge']({},_0x3783c7,_0x41088d[_0x9334('0x3a')]);var _0x4f1237={'where':_0x3783c7[_0x9334('0x37')]};return db[_0x9334('0x29')][_0x9334('0x1f')](_0x4f1237)[_0x9334('0x23')](function(_0x4f66c4){_0x187faf[_0x9334('0x1f')]=_0x4f66c4;if(_0x41088d[_0x9334('0x2e')][_0x9334('0x3b')]){_0x3783c7[_0x9334('0x3c')]=[{'all':!![]}];}return db[_0x9334('0x29')][_0x9334('0x3d')](_0x3783c7);})[_0x9334('0x23')](function(_0x1fe811){_0x187faf[_0x9334('0x3e')]=_0x1fe811;return _0x187faf;})['then'](respondWithFilteredResult(_0x3f1dd6,_0x3783c7))[_0x9334('0x3f')](handleError(_0x3f1dd6,null));};exports[_0x9334('0x40')]=function(_0x4fa881,_0x3108f9){var _0x328462={'raw':![],'where':{'id':_0x4fa881['params']['id']}},_0x11eab7={};_0x11eab7['model']=_['keys'](db[_0x9334('0x29')]['rawAttributes']);_0x11eab7[_0x9334('0x2e')]=_['keys'](_0x4fa881[_0x9334('0x2e')]);_0x11eab7[_0x9334('0x30')]=_[_0x9334('0x32')](_0x11eab7[_0x9334('0x2d')],_0x11eab7[_0x9334('0x2e')]);_0x328462['attributes']=_[_0x9334('0x32')](_0x11eab7[_0x9334('0x2d')],qs[_0x9334('0x33')](_0x4fa881[_0x9334('0x2e')][_0x9334('0x33')]));_0x328462[_0x9334('0x31')]=_0x328462[_0x9334('0x31')][_0x9334('0x34')]?_0x328462[_0x9334('0x31')]:_0x11eab7['model'];if(_0x4fa881[_0x9334('0x2e')][_0x9334('0x3b')]){_0x328462['include']=[{'all':!![]}];}_0x328462=_[_0x9334('0x41')]({},_0x328462,_0x4fa881[_0x9334('0x3a')]);return db[_0x9334('0x29')][_0x9334('0x42')](_0x328462)['then'](handleEntityNotFound(_0x3108f9,null))[_0x9334('0x23')](respondWithResult(_0x3108f9,null))[_0x9334('0x3f')](handleError(_0x3108f9,null));};exports[_0x9334('0x43')]=function(_0x1b8eb8,_0x1e0899){return db[_0x9334('0x29')][_0x9334('0x43')](_0x1b8eb8[_0x9334('0x44')],{})[_0x9334('0x23')](respondWithResult(_0x1e0899,0xc9))[_0x9334('0x3f')](handleError(_0x1e0899,null));};exports[_0x9334('0x45')]=function(_0x488980,_0x5e9e0c){if(_0x488980[_0x9334('0x44')]['id']){delete _0x488980[_0x9334('0x44')]['id'];}return db[_0x9334('0x29')][_0x9334('0x42')]({'where':{'id':_0x488980[_0x9334('0x46')]['id']}})[_0x9334('0x23')](handleEntityNotFound(_0x5e9e0c,null))[_0x9334('0x23')](saveUpdates(_0x488980[_0x9334('0x44')],null))['then'](respondWithResult(_0x5e9e0c,null))[_0x9334('0x3f')](handleError(_0x5e9e0c,null));};exports[_0x9334('0x24')]=function(_0x3660c6,_0x59d891){return db[_0x9334('0x29')][_0x9334('0x42')]({'where':{'id':_0x3660c6[_0x9334('0x46')]['id']}})['then'](handleEntityNotFound(_0x59d891,null))['then'](removeEntity(_0x59d891,null))[_0x9334('0x3f')](handleError(_0x59d891,null));};exports[_0x9334('0x47')]=function(_0x4a1685,_0x4169ad,_0x22fff6){var _0xbfa62d={};var _0x9041e9={};var _0x5ce982;var _0x201462;return db[_0x9334('0x29')][_0x9334('0x48')]({'where':{'id':_0x4a1685[_0x9334('0x46')]['id']}})['then'](handleEntityNotFound(_0x4169ad,null))['then'](function(_0x3f6887){if(_0x3f6887){_0x5ce982=_0x3f6887;_0x9041e9[_0x9334('0x2d')]=_[_0x9334('0x2f')](db[_0x9334('0x49')][_0x9334('0x2a')]);_0x9041e9[_0x9334('0x2e')]=_['keys'](_0x4a1685[_0x9334('0x2e')]);_0x9041e9[_0x9334('0x30')]=_[_0x9334('0x32')](_0x9041e9['model'],_0x9041e9[_0x9334('0x2e')]);_0xbfa62d[_0x9334('0x31')]=_['intersection'](_0x9041e9['model'],qs[_0x9334('0x33')](_0x4a1685[_0x9334('0x2e')][_0x9334('0x33')]));_0xbfa62d['attributes']=_0xbfa62d[_0x9334('0x31')][_0x9334('0x34')]?_0xbfa62d[_0x9334('0x31')]:_0x9041e9[_0x9334('0x2d')];_0xbfa62d[_0x9334('0x36')]=qs[_0x9334('0x4a')](_0x4a1685[_0x9334('0x2e')][_0x9334('0x4a')]);_0xbfa62d[_0x9334('0x37')]=qs['filters'](_[_0x9334('0x4b')](_0x4a1685[_0x9334('0x2e')],_0x9041e9[_0x9334('0x30')]));if(_0x4a1685[_0x9334('0x2e')][_0x9334('0x39')]){_0xbfa62d[_0x9334('0x37')]=_[_0x9334('0x41')](_0xbfa62d[_0x9334('0x37')],{'$or':_[_0x9334('0x28')](_0xbfa62d[_0x9334('0x31')],function(_0x15098c){var _0x3d3025={};_0x3d3025[_0x15098c]={'$like':'%'+_0x4a1685[_0x9334('0x2e')]['filter']+'%'};return _0x3d3025;})});}_0xbfa62d=_['merge']({},_0xbfa62d,_0x4a1685[_0x9334('0x3a')]);return _0x5ce982['getFields'](_0xbfa62d);}})[_0x9334('0x23')](function(_0x13701c){if(_0x13701c){_0x201462=_0x13701c[_0x9334('0x34')];if(!_0x4a1685['query']['hasOwnProperty'](_0x9334('0x35'))){_0xbfa62d[_0x9334('0x1d')]=qs['limit'](_0x4a1685[_0x9334('0x2e')]['limit']);_0xbfa62d[_0x9334('0x1e')]=qs[_0x9334('0x1e')](_0x4a1685[_0x9334('0x2e')]['offset']);}return _0x5ce982[_0x9334('0x47')](_0xbfa62d);}})['then'](function(_0x5c5de5){if(_0x5c5de5){return _0x5c5de5?{'count':_0x201462,'rows':_0x5c5de5}:null;}})[_0x9334('0x23')](respondWithResult(_0x4169ad,null))[_0x9334('0x3f')](handleError(_0x4169ad,null));};exports[_0x9334('0x4c')]=function(_0x41fd93,_0x48b412,_0x59a22f){var _0x8843c7={};var _0x5095a3={};var _0x523997;var _0x5da267;return db[_0x9334('0x29')][_0x9334('0x48')]({'where':{'id':_0x41fd93[_0x9334('0x46')]['id']}})[_0x9334('0x23')](handleEntityNotFound(_0x48b412,null))[_0x9334('0x23')](function(_0x4ce447){if(_0x4ce447){_0x523997=_0x4ce447;_0x5095a3[_0x9334('0x2d')]=_['keys'](db[_0x9334('0x49')][_0x9334('0x2a')]);_0x5095a3[_0x9334('0x2e')]=_[_0x9334('0x2f')](_0x41fd93[_0x9334('0x2e')]);_0x5095a3[_0x9334('0x30')]=_['intersection'](_0x5095a3['model'],_0x5095a3['query']);_0x8843c7[_0x9334('0x31')]=_[_0x9334('0x32')](_0x5095a3['model'],qs[_0x9334('0x33')](_0x41fd93[_0x9334('0x2e')][_0x9334('0x33')]));_0x8843c7['attributes']=_0x8843c7['attributes']['length']?_0x8843c7[_0x9334('0x31')]:_0x5095a3[_0x9334('0x2d')];_0x8843c7[_0x9334('0x36')]=qs[_0x9334('0x4a')](_0x41fd93[_0x9334('0x2e')][_0x9334('0x4a')]);_0x8843c7[_0x9334('0x37')]=qs['filters'](_['pick'](_0x41fd93[_0x9334('0x2e')],_0x5095a3[_0x9334('0x30')]));if(_0x41fd93[_0x9334('0x2e')][_0x9334('0x39')]){_0x8843c7[_0x9334('0x37')]=_[_0x9334('0x41')](_0x8843c7[_0x9334('0x37')],{'$or':_[_0x9334('0x28')](_0x8843c7[_0x9334('0x31')],function(_0x1fd89c){var _0x31d4f3={};_0x31d4f3[_0x1fd89c]={'$like':'%'+_0x41fd93[_0x9334('0x2e')]['filter']+'%'};return _0x31d4f3;})});}_0x8843c7=_['merge']({},_0x8843c7,_0x41fd93[_0x9334('0x3a')]);return _0x523997[_0x9334('0x4c')](_0x8843c7);}})[_0x9334('0x23')](function(_0x9e69ae){if(_0x9e69ae){_0x5da267=_0x9e69ae[_0x9334('0x34')];if(!_0x41fd93[_0x9334('0x2e')]['hasOwnProperty']('nolimit')){_0x8843c7[_0x9334('0x1d')]=qs[_0x9334('0x1d')](_0x41fd93[_0x9334('0x2e')][_0x9334('0x1d')]);_0x8843c7['offset']=qs[_0x9334('0x1e')](_0x41fd93[_0x9334('0x2e')][_0x9334('0x1e')]);}return _0x523997[_0x9334('0x4c')](_0x8843c7);}})[_0x9334('0x23')](function(_0x2b4dc7){if(_0x2b4dc7){return _0x2b4dc7?{'count':_0x5da267,'rows':_0x2b4dc7}:null;}})[_0x9334('0x23')](respondWithResult(_0x48b412,null))[_0x9334('0x3f')](handleError(_0x48b412,null));};exports[_0x9334('0x4d')]=function(_0x1146b5,_0x59362d,_0x460301){var _0x4c6f0b={};var _0x51f0c2={};var _0x165982;var _0x39278a;return db['FreshdeskConfiguration'][_0x9334('0x48')]({'where':{'id':_0x1146b5[_0x9334('0x46')]['id']}})['then'](handleEntityNotFound(_0x59362d,null))[_0x9334('0x23')](function(_0x58a4a1){if(_0x58a4a1){_0x165982=_0x58a4a1;_0x51f0c2[_0x9334('0x2d')]=_[_0x9334('0x2f')](db[_0x9334('0x49')][_0x9334('0x2a')]);_0x51f0c2['query']=_[_0x9334('0x2f')](_0x1146b5['query']);_0x51f0c2[_0x9334('0x30')]=_[_0x9334('0x32')](_0x51f0c2['model'],_0x51f0c2[_0x9334('0x2e')]);_0x4c6f0b[_0x9334('0x31')]=_[_0x9334('0x32')](_0x51f0c2['model'],qs[_0x9334('0x33')](_0x1146b5[_0x9334('0x2e')][_0x9334('0x33')]));_0x4c6f0b['attributes']=_0x4c6f0b[_0x9334('0x31')][_0x9334('0x34')]?_0x4c6f0b[_0x9334('0x31')]:_0x51f0c2['model'];_0x4c6f0b['order']=qs[_0x9334('0x4a')](_0x1146b5[_0x9334('0x2e')][_0x9334('0x4a')]);_0x4c6f0b['where']=qs[_0x9334('0x30')](_[_0x9334('0x4b')](_0x1146b5[_0x9334('0x2e')],_0x51f0c2[_0x9334('0x30')]));if(_0x1146b5[_0x9334('0x2e')][_0x9334('0x39')]){_0x4c6f0b[_0x9334('0x37')]=_['merge'](_0x4c6f0b[_0x9334('0x37')],{'$or':_[_0x9334('0x28')](_0x4c6f0b[_0x9334('0x31')],function(_0x33ab83){var _0x2af3db={};_0x2af3db[_0x33ab83]={'$like':'%'+_0x1146b5[_0x9334('0x2e')]['filter']+'%'};return _0x2af3db;})});}_0x4c6f0b=_[_0x9334('0x41')]({},_0x4c6f0b,_0x1146b5[_0x9334('0x3a')]);return _0x165982[_0x9334('0x4d')](_0x4c6f0b);}})[_0x9334('0x23')](function(_0x1a4b1a){if(_0x1a4b1a){_0x39278a=_0x1a4b1a[_0x9334('0x34')];if(!_0x1146b5[_0x9334('0x2e')]['hasOwnProperty'](_0x9334('0x35'))){_0x4c6f0b[_0x9334('0x1d')]=qs[_0x9334('0x1d')](_0x1146b5[_0x9334('0x2e')][_0x9334('0x1d')]);_0x4c6f0b['offset']=qs[_0x9334('0x1e')](_0x1146b5[_0x9334('0x2e')]['offset']);}return _0x165982['getDescriptions'](_0x4c6f0b);}})['then'](function(_0x35318b){if(_0x35318b){return _0x35318b?{'count':_0x39278a,'rows':_0x35318b}:null;}})[_0x9334('0x23')](respondWithResult(_0x59362d,null))[_0x9334('0x3f')](handleError(_0x59362d,null));};exports['getTags']=function(_0x347934,_0x2fd309,_0x14b7ed){var _0x1598b8={};var _0x599759={};var _0x3d9f38;var _0x51345d;return db[_0x9334('0x29')][_0x9334('0x48')]({'where':{'id':_0x347934[_0x9334('0x46')]['id']}})[_0x9334('0x23')](handleEntityNotFound(_0x2fd309,null))['then'](function(_0x3c7c82){if(_0x3c7c82){_0x3d9f38=_0x3c7c82;_0x599759[_0x9334('0x2d')]=_['keys'](db[_0x9334('0x4e')][_0x9334('0x2a')]);_0x599759[_0x9334('0x2e')]=_[_0x9334('0x2f')](_0x347934['query']);_0x599759['filters']=_[_0x9334('0x32')](_0x599759[_0x9334('0x2d')],_0x599759[_0x9334('0x2e')]);_0x1598b8[_0x9334('0x31')]=_['intersection'](_0x599759[_0x9334('0x2d')],qs[_0x9334('0x33')](_0x347934['query'][_0x9334('0x33')]));_0x1598b8['attributes']=_0x1598b8['attributes'][_0x9334('0x34')]?_0x1598b8[_0x9334('0x31')]:_0x599759[_0x9334('0x2d')];_0x1598b8['order']=qs[_0x9334('0x4a')](_0x347934[_0x9334('0x2e')]['sort']);_0x1598b8['where']=qs[_0x9334('0x30')](_[_0x9334('0x4b')](_0x347934[_0x9334('0x2e')],_0x599759['filters']));if(_0x347934[_0x9334('0x2e')][_0x9334('0x39')]){_0x1598b8['where']=_['merge'](_0x1598b8[_0x9334('0x37')],{'$or':_[_0x9334('0x28')](_0x1598b8[_0x9334('0x31')],function(_0x7c4664){var _0x105f6a={};_0x105f6a[_0x7c4664]={'$like':'%'+_0x347934[_0x9334('0x2e')][_0x9334('0x39')]+'%'};return _0x105f6a;})});}_0x1598b8=_[_0x9334('0x41')]({},_0x1598b8,_0x347934['options']);return _0x3d9f38[_0x9334('0x4f')](_0x1598b8);}})[_0x9334('0x23')](function(_0x424ae4){if(_0x424ae4){_0x51345d=_0x424ae4[_0x9334('0x34')];if(!_0x347934[_0x9334('0x2e')]['hasOwnProperty']('nolimit')){_0x1598b8[_0x9334('0x1d')]=qs['limit'](_0x347934[_0x9334('0x2e')][_0x9334('0x1d')]);_0x1598b8[_0x9334('0x1e')]=qs[_0x9334('0x1e')](_0x347934[_0x9334('0x2e')][_0x9334('0x1e')]);}return _0x3d9f38[_0x9334('0x4f')](_0x1598b8);}})['then'](function(_0x3c3d82){if(_0x3c3d82){return _0x3c3d82?{'count':_0x51345d,'rows':_0x3c3d82}:null;}})['then'](respondWithResult(_0x2fd309,null))[_0x9334('0x3f')](handleError(_0x2fd309,null));};exports[_0x9334('0x50')]=function(_0x5694b7,_0x1f81d8,_0x471251){if(_0x5694b7[_0x9334('0x44')]['id']){delete _0x5694b7[_0x9334('0x44')]['id'];}return db[_0x9334('0x29')][_0x9334('0x48')]({'where':{'id':_0x5694b7[_0x9334('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f81d8,null))[_0x9334('0x23')](function(_0x2d3ce5){if(_0x2d3ce5){return _0x2d3ce5[_0x9334('0x50')](_0x5694b7[_0x9334('0x44')][_0x9334('0x51')]||[]);}return null;})[_0x9334('0x23')](respondWithResult(_0x1f81d8,null))[_0x9334('0x3f')](handleError(_0x1f81d8,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 10ec3b1..efcd663 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 _0x4608=['api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','../../config/logger'];(function(_0x5b3a3c,_0x5a8e66){var _0x282066=function(_0x545e7d){while(--_0x545e7d){_0x5b3a3c['push'](_0x5b3a3c['shift']());}};_0x282066(++_0x5a8e66);}(_0x4608,0x8e));var _0x8460=function(_0x23cd7a,_0x40f76e){_0x23cd7a=_0x23cd7a-0x0;var _0x3b97c4=_0x4608[_0x23cd7a];return _0x3b97c4;};'use strict';var _=require(_0x8460('0x0'));var util=require('util');var logger=require(_0x8460('0x1'))(_0x8460('0x2'));var moment=require(_0x8460('0x3'));var BPromise=require(_0x8460('0x4'));var rp=require(_0x8460('0x5'));var fs=require('fs');var path=require(_0x8460('0x6'));var rimraf=require('rimraf');var config=require(_0x8460('0x7'));var attributes=require(_0x8460('0x8'));module[_0x8460('0x9')]=function(_0x59bdd1,_0x40399e){return _0x59bdd1[_0x8460('0xa')]('FreshdeskConfiguration',attributes,{'tableName':_0x8460('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed94=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','int_freshdesk_configurations'];(function(_0x2b93e1,_0x10e1d3){var _0x40f612=function(_0x1dd6c0){while(--_0x1dd6c0){_0x2b93e1['push'](_0x2b93e1['shift']());}};_0x40f612(++_0x10e1d3);}(_0xed94,0x6e));var _0x4ed9=function(_0x34e747,_0x173163){_0x34e747=_0x34e747-0x0;var _0x200a90=_0xed94[_0x34e747];return _0x200a90;};'use strict';var _=require(_0x4ed9('0x0'));var util=require(_0x4ed9('0x1'));var logger=require(_0x4ed9('0x2'))(_0x4ed9('0x3'));var moment=require(_0x4ed9('0x4'));var BPromise=require(_0x4ed9('0x5'));var rp=require(_0x4ed9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4ed9('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x4ed9('0x8')]=function(_0x1e025c,_0x5b5366){return _0x1e025c[_0x4ed9('0x9')]('FreshdeskConfiguration',attributes,{'tableName':_0x4ed9('0xa'),'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 4b889db..6d18365 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 _0x60e7=['result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x37c096,_0x3abf0f){var _0x29c4f3=function(_0x436e67){while(--_0x436e67){_0x37c096['push'](_0x37c096['shift']());}};_0x29c4f3(++_0x3abf0f);}(_0x60e7,0xca));var _0x760e=function(_0x195ef9,_0x28c1d6){_0x195ef9=_0x195ef9-0x0;var _0x33a2de=_0x60e7[_0x195ef9];return _0x33a2de;};'use strict';var _=require(_0x760e('0x0'));var util=require('util');var moment=require(_0x760e('0x1'));var BPromise=require('bluebird');var rs=require(_0x760e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x760e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x760e('0x4'))('rpc');var config=require(_0x760e('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x760e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x535e80,_0x21d0db,_0x2ed232){return new BPromise(function(_0x1e22a6,_0x58683f){return client[_0x760e('0x7')](_0x535e80,_0x2ed232)[_0x760e('0x8')](function(_0x5ea0ef){logger['info'](_0x760e('0x9'),_0x21d0db,_0x760e('0xa'));logger[_0x760e('0xb')](_0x760e('0xc'),_0x21d0db,_0x760e('0xa'),JSON[_0x760e('0xd')](_0x5ea0ef));if(_0x5ea0ef[_0x760e('0xe')]){if(_0x5ea0ef['error'][_0x760e('0xf')]===0x1f4){logger[_0x760e('0xe')](_0x760e('0x9'),_0x21d0db,_0x5ea0ef[_0x760e('0xe')][_0x760e('0x10')]);return _0x58683f(_0x5ea0ef[_0x760e('0xe')]['message']);}logger[_0x760e('0xe')](_0x760e('0x9'),_0x21d0db,_0x5ea0ef[_0x760e('0xe')][_0x760e('0x10')]);return _0x1e22a6(_0x5ea0ef[_0x760e('0xe')][_0x760e('0x10')]);}else{logger[_0x760e('0x11')](_0x760e('0x9'),_0x21d0db,_0x760e('0xa'));_0x1e22a6(_0x5ea0ef[_0x760e('0x12')][_0x760e('0x10')]);}})[_0x760e('0x13')](function(_0x25c0cb){logger['error'](_0x760e('0x9'),_0x21d0db,_0x25c0cb);_0x58683f(_0x25c0cb);});});} \ No newline at end of file +var _0x0e5d=['../../config/environment','jayson/promise','client','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x42bafd,_0x3f0fe3){var _0x2ed705=function(_0x4311ea){while(--_0x4311ea){_0x42bafd['push'](_0x42bafd['shift']());}};_0x2ed705(++_0x3f0fe3);}(_0x0e5d,0x141));var _0xd0e5=function(_0x217853,_0x3fcece){_0x217853=_0x217853-0x0;var _0x4c22b1=_0x0e5d[_0x217853];return _0x4c22b1;};'use strict';var _=require('lodash');var util=require(_0xd0e5('0x0'));var moment=require(_0xd0e5('0x1'));var BPromise=require(_0xd0e5('0x2'));var rs=require(_0xd0e5('0x3'));var fs=require('fs');var Redis=require(_0xd0e5('0x4'));var db=require(_0xd0e5('0x5'))['db'];var utils=require(_0xd0e5('0x6'));var logger=require(_0xd0e5('0x7'))(_0xd0e5('0x8'));var config=require(_0xd0e5('0x9'));var jayson=require(_0xd0e5('0xa'));var client=jayson[_0xd0e5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cde8f,_0x41b8d1,_0x1b867d){return new BPromise(function(_0x530eaa,_0x406155){return client['request'](_0x3cde8f,_0x1b867d)[_0xd0e5('0xc')](function(_0x907e3d){logger[_0xd0e5('0xd')](_0xd0e5('0xe'),_0x41b8d1,_0xd0e5('0xf'));logger['debug'](_0xd0e5('0x10'),_0x41b8d1,_0xd0e5('0xf'),JSON[_0xd0e5('0x11')](_0x907e3d));if(_0x907e3d[_0xd0e5('0x12')]){if(_0x907e3d[_0xd0e5('0x12')]['code']===0x1f4){logger['error'](_0xd0e5('0xe'),_0x41b8d1,_0x907e3d[_0xd0e5('0x12')][_0xd0e5('0x13')]);return _0x406155(_0x907e3d[_0xd0e5('0x12')]['message']);}logger['error'](_0xd0e5('0xe'),_0x41b8d1,_0x907e3d[_0xd0e5('0x12')][_0xd0e5('0x13')]);return _0x530eaa(_0x907e3d[_0xd0e5('0x12')]['message']);}else{logger[_0xd0e5('0xd')](_0xd0e5('0xe'),_0x41b8d1,_0xd0e5('0xf'));_0x530eaa(_0x907e3d[_0xd0e5('0x14')][_0xd0e5('0x13')]);}})[_0xd0e5('0x15')](function(_0x8262c6){logger[_0xd0e5('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x41b8d1,_0x8262c6);_0x406155(_0x8262c6);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index ff89f00..4e04c60 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 _0xfe3d=['util','path','connect-timeout','express','../../components/interaction/service','./intFreshdeskField.controller','isAuthenticated','index','get','show','post','create','put','delete','exports','multer'];(function(_0x5366af,_0x1e692e){var _0x6cc73e=function(_0xe83a5d){while(--_0xe83a5d){_0x5366af['push'](_0x5366af['shift']());}};_0x6cc73e(++_0x1e692e);}(_0xfe3d,0x6f));var _0xdfe3=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xfe3d[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0xdfe3('0x0'));var util=require(_0xdfe3('0x1'));var path=require(_0xdfe3('0x2'));var timeout=require(_0xdfe3('0x3'));var express=require(_0xdfe3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdfe3('0x5'));var config=require('../../config/environment');var controller=require(_0xdfe3('0x6'));router['get']('/',auth[_0xdfe3('0x7')](),controller[_0xdfe3('0x8')]);router[_0xdfe3('0x9')]('/:id',auth[_0xdfe3('0x7')](),controller[_0xdfe3('0xa')]);router[_0xdfe3('0xb')]('/',auth[_0xdfe3('0x7')](),controller[_0xdfe3('0xc')]);router[_0xdfe3('0xd')]('/:id',auth[_0xdfe3('0x7')](),controller['update']);router[_0xdfe3('0xe')]('/:id',auth[_0xdfe3('0x7')](),controller['destroy']);module[_0xdfe3('0xf')]=router; \ No newline at end of file +var _0xb6b1=['../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1ab72d,_0x34c035){var _0x1c60d2=function(_0x57dfe1){while(--_0x57dfe1){_0x1ab72d['push'](_0x1ab72d['shift']());}};_0x1c60d2(++_0x34c035);}(_0xb6b1,0x12b));var _0x1b6b=function(_0x2a276d,_0x482b0c){_0x2a276d=_0x2a276d-0x0;var _0x2914cd=_0xb6b1[_0x2a276d];return _0x2914cd;};'use strict';var multer=require(_0x1b6b('0x0'));var util=require('util');var path=require(_0x1b6b('0x1'));var timeout=require(_0x1b6b('0x2'));var express=require('express');var router=express[_0x1b6b('0x3')]();var fs_extra=require(_0x1b6b('0x4'));var auth=require(_0x1b6b('0x5'));var interaction=require(_0x1b6b('0x6'));var config=require(_0x1b6b('0x7'));var controller=require(_0x1b6b('0x8'));router[_0x1b6b('0x9')]('/',auth[_0x1b6b('0xa')](),controller[_0x1b6b('0xb')]);router[_0x1b6b('0x9')](_0x1b6b('0xc'),auth[_0x1b6b('0xa')](),controller[_0x1b6b('0xd')]);router[_0x1b6b('0xe')]('/',auth[_0x1b6b('0xa')](),controller['create']);router['put'](_0x1b6b('0xc'),auth[_0x1b6b('0xa')](),controller['update']);router[_0x1b6b('0xf')](_0x1b6b('0xc'),auth['isAuthenticated'](),controller[_0x1b6b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 04a81dc..ac0e9fd 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 _0x1591=['BOOLEAN','exports','variable','keyValue','picklist','STRING','string','customVariable'];(function(_0x450d3f,_0xa3bd69){var _0x319d30=function(_0xe854af){while(--_0xe854af){_0x450d3f['push'](_0x450d3f['shift']());}};_0x319d30(++_0xa3bd69);}(_0x1591,0x109));var _0x1159=function(_0x415603,_0x21320c){_0x415603=_0x415603-0x0;var _0x131e72=_0x1591[_0x415603];return _0x131e72;};'use strict';var Sequelize=require('sequelize');module[_0x1159('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0x1159('0x1'),'customVariable',_0x1159('0x2'),_0x1159('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1159('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x1159('0x5'),_0x1159('0x1'),_0x1159('0x6'))},'keyContent':{'type':Sequelize[_0x1159('0x4')]},'idField':{'type':Sequelize[_0x1159('0x4')]},'nameField':{'type':Sequelize[_0x1159('0x4')]},'customField':{'type':Sequelize[_0x1159('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1f5a=['ENUM','customVariable','keyValue','picklist','string','STRING','variable','BOOLEAN'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1f5a,0x130));var _0xa1f5=function(_0x4bc3d5,_0x87a27f){_0x4bc3d5=_0x4bc3d5-0x0;var _0x1d6fc8=_0x1f5a[_0x4bc3d5];return _0x1d6fc8;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xa1f5('0x0')]('string','variable',_0xa1f5('0x1'),_0xa1f5('0x2'),_0xa1f5('0x3')),'defaultValue':_0xa1f5('0x4')},'content':{'type':Sequelize[_0xa1f5('0x5')]},'key':{'type':Sequelize[_0xa1f5('0x5')]},'keyType':{'type':Sequelize[_0xa1f5('0x0')](_0xa1f5('0x4'),_0xa1f5('0x6'),_0xa1f5('0x1'))},'keyContent':{'type':Sequelize[_0xa1f5('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa1f5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index ef7190e..b284b60 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 _0x1752=['name','send','index','map','type','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','FreshdeskField','includeAll','findAll','catch','show','params','fields','include','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','reject','update','then','destroy','error','stack'];(function(_0x52e114,_0x29a48a){var _0x29a43c=function(_0x3da5a7){while(--_0x3da5a7){_0x52e114['push'](_0x52e114['shift']());}};_0x29a43c(++_0x29a48a);}(_0x1752,0xa5));var _0x2175=function(_0x408c7d,_0x17f380){_0x408c7d=_0x408c7d-0x0;var _0x323cd0=_0x1752[_0x408c7d];return _0x323cd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2175('0x0'));var zipdir=require(_0x2175('0x1'));var jsonpatch=require(_0x2175('0x2'));var rp=require(_0x2175('0x3'));var moment=require(_0x2175('0x4'));var BPromise=require(_0x2175('0x5'));var Mustache=require('mustache');var util=require(_0x2175('0x6'));var path=require(_0x2175('0x7'));var sox=require(_0x2175('0x8'));var csv=require(_0x2175('0x9'));var ejs=require(_0x2175('0xa'));var fs=require('fs');var fs_extra=require(_0x2175('0xb'));var _=require(_0x2175('0xc'));var squel=require(_0x2175('0xd'));var crypto=require(_0x2175('0xe'));var jsforce=require(_0x2175('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2175('0x9'));var querystring=require(_0x2175('0x10'));var Papa=require(_0x2175('0x11'));var Redis=require(_0x2175('0x12'));var authService=require(_0x2175('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2175('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2175('0x15'))['db'];function respondWithStatusCode(_0x5bc446,_0x43be3c){_0x43be3c=_0x43be3c||0xcc;return function(_0x393c02){if(_0x393c02){return _0x5bc446['sendStatus'](_0x43be3c);}return _0x5bc446[_0x2175('0x16')](_0x43be3c)[_0x2175('0x17')]();};}function respondWithResult(_0x45df73,_0x3bc01f){_0x3bc01f=_0x3bc01f||0xc8;return function(_0x21d4cd){if(_0x21d4cd){return _0x45df73[_0x2175('0x16')](_0x3bc01f)[_0x2175('0x18')](_0x21d4cd);}};}function respondWithFilteredResult(_0x413688,_0x5d84db){return function(_0x55b798){if(_0x55b798){var _0x371b42=typeof _0x5d84db[_0x2175('0x19')]===_0x2175('0x1a')&&typeof _0x5d84db['limit']==='undefined';var _0x588b0b=_0x55b798[_0x2175('0x1b')];var _0x377586=_0x371b42?0x0:_0x5d84db['offset'];var _0x53576c=_0x371b42?_0x55b798[_0x2175('0x1b')]:_0x5d84db[_0x2175('0x19')]+_0x5d84db[_0x2175('0x1c')];var _0x51628d;if(_0x53576c>=_0x588b0b){_0x53576c=_0x588b0b;_0x51628d=0xc8;}else{_0x51628d=0xce;}_0x413688[_0x2175('0x16')](_0x51628d);return _0x413688['set'](_0x2175('0x1d'),_0x377586+'-'+_0x53576c+'/'+_0x588b0b)['json'](_0x55b798);}return null;};}function patchUpdates(_0x37818a){return function(_0x4ec36c){try{jsonpatch['apply'](_0x4ec36c,_0x37818a,!![]);}catch(_0x5344af){return BPromise[_0x2175('0x1e')](_0x5344af);}return _0x4ec36c['save']();};}function saveUpdates(_0x28c4b8,_0x46ea57){return function(_0x2dd77b){if(_0x2dd77b){return _0x2dd77b[_0x2175('0x1f')](_0x28c4b8)[_0x2175('0x20')](function(_0x12d150){return _0x12d150;});}return null;};}function removeEntity(_0x5ac63e,_0x49d4b9){return function(_0x3d849e){if(_0x3d849e){return _0x3d849e[_0x2175('0x21')]()[_0x2175('0x20')](function(){_0x5ac63e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9c6374,_0xe252f0){return function(_0x2204cd){if(!_0x2204cd){_0x9c6374['sendStatus'](0x194);}return _0x2204cd;};}function handleError(_0x224fa3,_0x4d2120){_0x4d2120=_0x4d2120||0x1f4;return function(_0x5e696c){logger[_0x2175('0x22')](_0x5e696c[_0x2175('0x23')]);if(_0x5e696c[_0x2175('0x24')]){delete _0x5e696c[_0x2175('0x24')];}_0x224fa3[_0x2175('0x16')](_0x4d2120)[_0x2175('0x25')](_0x5e696c);};}exports[_0x2175('0x26')]=function(_0x40d8c8,_0x1b807b){var _0x1c721d={},_0x7b6edb={},_0x56dcf9={'count':0x0,'rows':[]};var _0x20fccf=_[_0x2175('0x27')](db['FreshdeskField']['rawAttributes'],function(_0x3d64ac){return{'name':_0x3d64ac['fieldName'],'type':_0x3d64ac[_0x2175('0x28')]['key']};});_0x7b6edb['model']=_['map'](_0x20fccf,_0x2175('0x24'));_0x7b6edb[_0x2175('0x29')]=_[_0x2175('0x2a')](_0x40d8c8[_0x2175('0x29')]);_0x7b6edb['filters']=_[_0x2175('0x2b')](_0x7b6edb[_0x2175('0x2c')],_0x7b6edb['query']);_0x1c721d[_0x2175('0x2d')]=_[_0x2175('0x2b')](_0x7b6edb['model'],qs['fields'](_0x40d8c8['query']['fields']));_0x1c721d[_0x2175('0x2d')]=_0x1c721d[_0x2175('0x2d')][_0x2175('0x2e')]?_0x1c721d[_0x2175('0x2d')]:_0x7b6edb[_0x2175('0x2c')];if(!_0x40d8c8[_0x2175('0x29')][_0x2175('0x2f')](_0x2175('0x30'))){_0x1c721d['limit']=qs['limit'](_0x40d8c8['query']['limit']);_0x1c721d['offset']=qs[_0x2175('0x19')](_0x40d8c8[_0x2175('0x29')]['offset']);}_0x1c721d[_0x2175('0x31')]=qs[_0x2175('0x32')](_0x40d8c8[_0x2175('0x29')][_0x2175('0x32')]);_0x1c721d[_0x2175('0x33')]=qs[_0x2175('0x34')](_['pick'](_0x40d8c8[_0x2175('0x29')],_0x7b6edb[_0x2175('0x34')]),_0x20fccf);if(_0x40d8c8[_0x2175('0x29')][_0x2175('0x35')]){_0x1c721d[_0x2175('0x33')]=_[_0x2175('0x36')](_0x1c721d[_0x2175('0x33')],{'$or':_[_0x2175('0x27')](_0x20fccf,function(_0x38c212){if(_0x38c212[_0x2175('0x28')]!==_0x2175('0x37')){var _0x4be65c={};_0x4be65c[_0x38c212[_0x2175('0x24')]]={'$like':'%'+_0x40d8c8[_0x2175('0x29')][_0x2175('0x35')]+'%'};return _0x4be65c;}})});}_0x1c721d=_['merge']({},_0x1c721d,_0x40d8c8['options']);var _0x932bb6={'where':_0x1c721d['where']};return db[_0x2175('0x38')][_0x2175('0x1b')](_0x932bb6)[_0x2175('0x20')](function(_0x4989df){_0x56dcf9['count']=_0x4989df;if(_0x40d8c8[_0x2175('0x29')][_0x2175('0x39')]){_0x1c721d['include']=[{'all':!![]}];}return db['FreshdeskField'][_0x2175('0x3a')](_0x1c721d);})[_0x2175('0x20')](function(_0x61784d){_0x56dcf9['rows']=_0x61784d;return _0x56dcf9;})[_0x2175('0x20')](respondWithFilteredResult(_0x1b807b,_0x1c721d))[_0x2175('0x3b')](handleError(_0x1b807b,null));};exports[_0x2175('0x3c')]=function(_0x5a6679,_0x49cf7d){var _0x459cee={'raw':!![],'where':{'id':_0x5a6679[_0x2175('0x3d')]['id']}},_0x47f60d={};_0x47f60d[_0x2175('0x2c')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x47f60d[_0x2175('0x29')]=_['keys'](_0x5a6679['query']);_0x47f60d[_0x2175('0x34')]=_['intersection'](_0x47f60d[_0x2175('0x2c')],_0x47f60d[_0x2175('0x29')]);_0x459cee[_0x2175('0x2d')]=_[_0x2175('0x2b')](_0x47f60d[_0x2175('0x2c')],qs[_0x2175('0x3e')](_0x5a6679['query'][_0x2175('0x3e')]));_0x459cee[_0x2175('0x2d')]=_0x459cee[_0x2175('0x2d')][_0x2175('0x2e')]?_0x459cee[_0x2175('0x2d')]:_0x47f60d[_0x2175('0x2c')];if(_0x5a6679['query'][_0x2175('0x39')]){_0x459cee[_0x2175('0x3f')]=[{'all':!![]}];}_0x459cee=_[_0x2175('0x36')]({},_0x459cee,_0x5a6679['options']);return db[_0x2175('0x38')]['find'](_0x459cee)['then'](handleEntityNotFound(_0x49cf7d,null))[_0x2175('0x20')](respondWithResult(_0x49cf7d,null))[_0x2175('0x3b')](handleError(_0x49cf7d,null));};exports[_0x2175('0x40')]=function(_0x5ee4aa,_0x32d6eb){return db[_0x2175('0x38')][_0x2175('0x40')](_0x5ee4aa[_0x2175('0x41')],{})[_0x2175('0x20')](respondWithResult(_0x32d6eb,0xc9))['catch'](handleError(_0x32d6eb,null));};exports['update']=function(_0xdb0a97,_0xeaabe3){if(_0xdb0a97[_0x2175('0x41')]['id']){delete _0xdb0a97[_0x2175('0x41')]['id'];}return db[_0x2175('0x38')]['find']({'where':{'id':_0xdb0a97[_0x2175('0x3d')]['id']}})[_0x2175('0x20')](handleEntityNotFound(_0xeaabe3,null))[_0x2175('0x20')](saveUpdates(_0xdb0a97['body'],null))['then'](respondWithResult(_0xeaabe3,null))[_0x2175('0x3b')](handleError(_0xeaabe3,null));};exports['destroy']=function(_0x5af419,_0x5bab81){return db['FreshdeskField'][_0x2175('0x42')]({'where':{'id':_0x5af419[_0x2175('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5bab81,null))['then'](removeEntity(_0x5bab81,null))['catch'](handleError(_0x5bab81,null));}; \ No newline at end of file +var _0x750a=['../../config/license/util','status','end','offset','undefined','count','set','json','destroy','then','sendStatus','error','stack','name','send','map','FreshdeskField','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','find','catch','create','body','update','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment'];(function(_0x30c32c,_0x3879b8){var _0x3b1ed8=function(_0x1bbc0e){while(--_0x1bbc0e){_0x30c32c['push'](_0x30c32c['shift']());}};_0x3b1ed8(++_0x3879b8);}(_0x750a,0x140));var _0xa750=function(_0x4e2604,_0x508dcb){_0x4e2604=_0x4e2604-0x0;var _0x294c2a=_0x750a[_0x4e2604];return _0x294c2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa750('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa750('0x1'));var moment=require(_0xa750('0x2'));var BPromise=require(_0xa750('0x3'));var Mustache=require(_0xa750('0x4'));var util=require(_0xa750('0x5'));var path=require(_0xa750('0x6'));var sox=require(_0xa750('0x7'));var csv=require(_0xa750('0x8'));var ejs=require(_0xa750('0x9'));var fs=require('fs');var fs_extra=require(_0xa750('0xa'));var _=require(_0xa750('0xb'));var squel=require(_0xa750('0xc'));var crypto=require(_0xa750('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa750('0x8'));var querystring=require('querystring');var Papa=require(_0xa750('0xe'));var Redis=require(_0xa750('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa750('0x10'));var as=require(_0xa750('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa750('0x12'));var utils=require('../../config/utils');var config=require(_0xa750('0x13'));var licenseUtil=require(_0xa750('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24ec62,_0x1c5657){_0x1c5657=_0x1c5657||0xcc;return function(_0x344c67){if(_0x344c67){return _0x24ec62['sendStatus'](_0x1c5657);}return _0x24ec62[_0xa750('0x15')](_0x1c5657)[_0xa750('0x16')]();};}function respondWithResult(_0x2d3421,_0x24e48a){_0x24e48a=_0x24e48a||0xc8;return function(_0xa66181){if(_0xa66181){return _0x2d3421[_0xa750('0x15')](_0x24e48a)['json'](_0xa66181);}};}function respondWithFilteredResult(_0x3ae2a1,_0x8488ea){return function(_0x290d46){if(_0x290d46){var _0x49fe3b=typeof _0x8488ea[_0xa750('0x17')]===_0xa750('0x18')&&typeof _0x8488ea['limit']==='undefined';var _0x321eb2=_0x290d46['count'];var _0x433dbd=_0x49fe3b?0x0:_0x8488ea[_0xa750('0x17')];var _0x4f1faa=_0x49fe3b?_0x290d46[_0xa750('0x19')]:_0x8488ea['offset']+_0x8488ea['limit'];var _0x25e335;if(_0x4f1faa>=_0x321eb2){_0x4f1faa=_0x321eb2;_0x25e335=0xc8;}else{_0x25e335=0xce;}_0x3ae2a1['status'](_0x25e335);return _0x3ae2a1[_0xa750('0x1a')]('Content-Range',_0x433dbd+'-'+_0x4f1faa+'/'+_0x321eb2)[_0xa750('0x1b')](_0x290d46);}return null;};}function patchUpdates(_0x4a007d){return function(_0x3dc7f1){try{jsonpatch['apply'](_0x3dc7f1,_0x4a007d,!![]);}catch(_0x1efb68){return BPromise['reject'](_0x1efb68);}return _0x3dc7f1['save']();};}function saveUpdates(_0xaa9d3e,_0x52da84){return function(_0x216fbf){if(_0x216fbf){return _0x216fbf['update'](_0xaa9d3e)['then'](function(_0x5b433d){return _0x5b433d;});}return null;};}function removeEntity(_0x5d758e,_0x15d72f){return function(_0x2ec6c4){if(_0x2ec6c4){return _0x2ec6c4[_0xa750('0x1c')]()[_0xa750('0x1d')](function(){_0x5d758e[_0xa750('0x15')](0xcc)[_0xa750('0x16')]();});}};}function handleEntityNotFound(_0x3001bc,_0x7e22ad){return function(_0x3d52b3){if(!_0x3d52b3){_0x3001bc[_0xa750('0x1e')](0x194);}return _0x3d52b3;};}function handleError(_0xe92342,_0x27a5eb){_0x27a5eb=_0x27a5eb||0x1f4;return function(_0x31ea63){logger[_0xa750('0x1f')](_0x31ea63[_0xa750('0x20')]);if(_0x31ea63['name']){delete _0x31ea63[_0xa750('0x21')];}_0xe92342[_0xa750('0x15')](_0x27a5eb)[_0xa750('0x22')](_0x31ea63);};}exports['index']=function(_0x35ab53,_0x6ade2b){var _0x3270e3={},_0x1223d2={},_0x579f1c={'count':0x0,'rows':[]};var _0x297eef=_[_0xa750('0x23')](db[_0xa750('0x24')][_0xa750('0x25')],function(_0x2c5253){return{'name':_0x2c5253['fieldName'],'type':_0x2c5253[_0xa750('0x26')]['key']};});_0x1223d2[_0xa750('0x27')]=_[_0xa750('0x23')](_0x297eef,'name');_0x1223d2[_0xa750('0x28')]=_[_0xa750('0x29')](_0x35ab53[_0xa750('0x28')]);_0x1223d2[_0xa750('0x2a')]=_[_0xa750('0x2b')](_0x1223d2[_0xa750('0x27')],_0x1223d2[_0xa750('0x28')]);_0x3270e3[_0xa750('0x2c')]=_['intersection'](_0x1223d2[_0xa750('0x27')],qs['fields'](_0x35ab53[_0xa750('0x28')][_0xa750('0x2d')]));_0x3270e3[_0xa750('0x2c')]=_0x3270e3[_0xa750('0x2c')]['length']?_0x3270e3[_0xa750('0x2c')]:_0x1223d2[_0xa750('0x27')];if(!_0x35ab53['query'][_0xa750('0x2e')](_0xa750('0x2f'))){_0x3270e3[_0xa750('0x30')]=qs[_0xa750('0x30')](_0x35ab53['query'][_0xa750('0x30')]);_0x3270e3['offset']=qs['offset'](_0x35ab53[_0xa750('0x28')][_0xa750('0x17')]);}_0x3270e3[_0xa750('0x31')]=qs['sort'](_0x35ab53[_0xa750('0x28')][_0xa750('0x32')]);_0x3270e3[_0xa750('0x33')]=qs['filters'](_[_0xa750('0x34')](_0x35ab53[_0xa750('0x28')],_0x1223d2[_0xa750('0x2a')]),_0x297eef);if(_0x35ab53['query'][_0xa750('0x35')]){_0x3270e3[_0xa750('0x33')]=_[_0xa750('0x36')](_0x3270e3['where'],{'$or':_[_0xa750('0x23')](_0x297eef,function(_0x339f10){if(_0x339f10[_0xa750('0x26')]!==_0xa750('0x37')){var _0x4dd8d5={};_0x4dd8d5[_0x339f10['name']]={'$like':'%'+_0x35ab53[_0xa750('0x28')][_0xa750('0x35')]+'%'};return _0x4dd8d5;}})});}_0x3270e3=_['merge']({},_0x3270e3,_0x35ab53[_0xa750('0x38')]);var _0x2f57e9={'where':_0x3270e3[_0xa750('0x33')]};return db[_0xa750('0x24')][_0xa750('0x19')](_0x2f57e9)['then'](function(_0x6c99c4){_0x579f1c[_0xa750('0x19')]=_0x6c99c4;if(_0x35ab53[_0xa750('0x28')][_0xa750('0x39')]){_0x3270e3[_0xa750('0x3a')]=[{'all':!![]}];}return db[_0xa750('0x24')][_0xa750('0x3b')](_0x3270e3);})['then'](function(_0x3daa38){_0x579f1c['rows']=_0x3daa38;return _0x579f1c;})[_0xa750('0x1d')](respondWithFilteredResult(_0x6ade2b,_0x3270e3))['catch'](handleError(_0x6ade2b,null));};exports[_0xa750('0x3c')]=function(_0x376afb,_0xf9fd5f){var _0x1be24e={'raw':!![],'where':{'id':_0x376afb[_0xa750('0x3d')]['id']}},_0x430d60={};_0x430d60[_0xa750('0x27')]=_[_0xa750('0x29')](db[_0xa750('0x24')][_0xa750('0x25')]);_0x430d60[_0xa750('0x28')]=_[_0xa750('0x29')](_0x376afb[_0xa750('0x28')]);_0x430d60[_0xa750('0x2a')]=_[_0xa750('0x2b')](_0x430d60[_0xa750('0x27')],_0x430d60[_0xa750('0x28')]);_0x1be24e[_0xa750('0x2c')]=_[_0xa750('0x2b')](_0x430d60[_0xa750('0x27')],qs['fields'](_0x376afb[_0xa750('0x28')][_0xa750('0x2d')]));_0x1be24e[_0xa750('0x2c')]=_0x1be24e[_0xa750('0x2c')][_0xa750('0x3e')]?_0x1be24e[_0xa750('0x2c')]:_0x430d60[_0xa750('0x27')];if(_0x376afb[_0xa750('0x28')][_0xa750('0x39')]){_0x1be24e['include']=[{'all':!![]}];}_0x1be24e=_[_0xa750('0x36')]({},_0x1be24e,_0x376afb[_0xa750('0x38')]);return db['FreshdeskField'][_0xa750('0x3f')](_0x1be24e)[_0xa750('0x1d')](handleEntityNotFound(_0xf9fd5f,null))[_0xa750('0x1d')](respondWithResult(_0xf9fd5f,null))[_0xa750('0x40')](handleError(_0xf9fd5f,null));};exports[_0xa750('0x41')]=function(_0x2c2c9a,_0x5e7a95){return db[_0xa750('0x24')][_0xa750('0x41')](_0x2c2c9a[_0xa750('0x42')],{})['then'](respondWithResult(_0x5e7a95,0xc9))[_0xa750('0x40')](handleError(_0x5e7a95,null));};exports[_0xa750('0x43')]=function(_0x58afd2,_0x93e49f){if(_0x58afd2[_0xa750('0x42')]['id']){delete _0x58afd2[_0xa750('0x42')]['id'];}return db['FreshdeskField'][_0xa750('0x3f')]({'where':{'id':_0x58afd2[_0xa750('0x3d')]['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x93e49f,null))[_0xa750('0x1d')](saveUpdates(_0x58afd2['body'],null))[_0xa750('0x1d')](respondWithResult(_0x93e49f,null))[_0xa750('0x40')](handleError(_0x93e49f,null));};exports[_0xa750('0x1c')]=function(_0xed4f88,_0x4ce363){return db[_0xa750('0x24')][_0xa750('0x3f')]({'where':{'id':_0xed4f88['params']['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x4ce363,null))['then'](removeEntity(_0x4ce363,null))[_0xa750('0x40')](handleError(_0x4ce363,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 63f3a66..2d64dd6 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 _0x1bdd=['../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x2c6028,_0x236c9b){var _0x4520d0=function(_0x41d0c3){while(--_0x41d0c3){_0x2c6028['push'](_0x2c6028['shift']());}};_0x4520d0(++_0x236c9b);}(_0x1bdd,0x143));var _0xd1bd=function(_0x248ef7,_0x5cf848){_0x248ef7=_0x248ef7-0x0;var _0x5bad0b=_0x1bdd[_0x248ef7];return _0x5bad0b;};'use strict';var _=require(_0xd1bd('0x0'));var util=require(_0xd1bd('0x1'));var logger=require(_0xd1bd('0x2'))(_0xd1bd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd1bd('0x4'));var fs=require('fs');var path=require(_0xd1bd('0x5'));var rimraf=require(_0xd1bd('0x6'));var config=require(_0xd1bd('0x7'));var attributes=require(_0xd1bd('0x8'));module['exports']=function(_0x23db60,_0x2fc380){return _0x23db60[_0xd1bd('0x9')](_0xd1bd('0xa'),attributes,{'tableName':_0xd1bd('0xb'),'paranoid':![],'indexes':[{'name':_0xd1bd('0xc'),'fields':[_0xd1bd('0xd'),_0xd1bd('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x88eb=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','util'];(function(_0x1e50fc,_0x3d2684){var _0x497f51=function(_0x2f744b){while(--_0x2f744b){_0x1e50fc['push'](_0x1e50fc['shift']());}};_0x497f51(++_0x3d2684);}(_0x88eb,0x76));var _0xb88e=function(_0x2a4e92,_0x4c19d6){_0x2a4e92=_0x2a4e92-0x0;var _0x5964ab=_0x88eb[_0x2a4e92];return _0x5964ab;};'use strict';var _=require(_0xb88e('0x0'));var util=require(_0xb88e('0x1'));var logger=require(_0xb88e('0x2'))('api');var moment=require(_0xb88e('0x3'));var BPromise=require('bluebird');var rp=require(_0xb88e('0x4'));var fs=require('fs');var path=require(_0xb88e('0x5'));var rimraf=require(_0xb88e('0x6'));var config=require(_0xb88e('0x7'));var attributes=require(_0xb88e('0x8'));module[_0xb88e('0x9')]=function(_0x442da8,_0x14854b){return _0x442da8[_0xb88e('0xa')](_0xb88e('0xb'),attributes,{'tableName':_0xb88e('0xc'),'paranoid':![],'indexes':[{'name':_0xb88e('0xd'),'fields':[_0xb88e('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 4216f73..c8de0db 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 _0xc09b=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','result','lodash'];(function(_0x36f0e2,_0x4e7f80){var _0x108f36=function(_0x289b3a){while(--_0x289b3a){_0x36f0e2['push'](_0x36f0e2['shift']());}};_0x108f36(++_0x4e7f80);}(_0xc09b,0x113));var _0xbc09=function(_0x36c220,_0x3e2e34){_0x36c220=_0x36c220-0x0;var _0x58d7c6=_0xc09b[_0x36c220];return _0x58d7c6;};'use strict';var _=require(_0xbc09('0x0'));var util=require(_0xbc09('0x1'));var moment=require(_0xbc09('0x2'));var BPromise=require(_0xbc09('0x3'));var rs=require(_0xbc09('0x4'));var fs=require('fs');var Redis=require(_0xbc09('0x5'));var db=require(_0xbc09('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc09('0x7'))(_0xbc09('0x8'));var config=require(_0xbc09('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbc09('0xa')][_0xbc09('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19f702,_0x57e999,_0x368bc4){return new BPromise(function(_0x2dc6de,_0x1b80aa){return client[_0xbc09('0xc')](_0x19f702,_0x368bc4)[_0xbc09('0xd')](function(_0x529d70){logger[_0xbc09('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x57e999,'request\x20sent');logger[_0xbc09('0xf')](_0xbc09('0x10'),_0x57e999,'request\x20sent',JSON[_0xbc09('0x11')](_0x529d70));if(_0x529d70[_0xbc09('0x12')]){if(_0x529d70['error'][_0xbc09('0x13')]===0x1f4){logger['error'](_0xbc09('0x14'),_0x57e999,_0x529d70[_0xbc09('0x12')]['message']);return _0x1b80aa(_0x529d70[_0xbc09('0x12')][_0xbc09('0x15')]);}logger[_0xbc09('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x57e999,_0x529d70[_0xbc09('0x12')][_0xbc09('0x15')]);return _0x2dc6de(_0x529d70[_0xbc09('0x12')][_0xbc09('0x15')]);}else{logger[_0xbc09('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x57e999,'request\x20sent');_0x2dc6de(_0x529d70[_0xbc09('0x16')]['message']);}})['catch'](function(_0x1b1969){logger[_0xbc09('0x12')](_0xbc09('0x14'),_0x57e999,_0x1b1969);_0x1b80aa(_0x1b1969);});});} \ No newline at end of file +var _0xea9f=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x55e2e7,_0x3d7ffb){var _0x2ca98a=function(_0x499090){while(--_0x499090){_0x55e2e7['push'](_0x55e2e7['shift']());}};_0x2ca98a(++_0x3d7ffb);}(_0xea9f,0x15f));var _0xfea9=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xea9f[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xfea9('0x0'));var util=require(_0xfea9('0x1'));var moment=require(_0xfea9('0x2'));var BPromise=require(_0xfea9('0x3'));var rs=require(_0xfea9('0x4'));var fs=require('fs');var Redis=require(_0xfea9('0x5'));var db=require(_0xfea9('0x6'))['db'];var utils=require(_0xfea9('0x7'));var logger=require(_0xfea9('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfea9('0x9'));var client=jayson[_0xfea9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb3334,_0x5b91ce,_0x3623f1){return new BPromise(function(_0x52ded,_0x1c421f){return client['request'](_0xb3334,_0x3623f1)[_0xfea9('0xb')](function(_0x50735f){logger['info'](_0xfea9('0xc'),_0x5b91ce,_0xfea9('0xd'));logger[_0xfea9('0xe')](_0xfea9('0xf'),_0x5b91ce,_0xfea9('0xd'),JSON[_0xfea9('0x10')](_0x50735f));if(_0x50735f[_0xfea9('0x11')]){if(_0x50735f[_0xfea9('0x11')][_0xfea9('0x12')]===0x1f4){logger[_0xfea9('0x11')](_0xfea9('0xc'),_0x5b91ce,_0x50735f[_0xfea9('0x11')][_0xfea9('0x13')]);return _0x1c421f(_0x50735f[_0xfea9('0x11')]['message']);}logger[_0xfea9('0x11')](_0xfea9('0xc'),_0x5b91ce,_0x50735f[_0xfea9('0x11')][_0xfea9('0x13')]);return _0x52ded(_0x50735f[_0xfea9('0x11')][_0xfea9('0x13')]);}else{logger[_0xfea9('0x14')](_0xfea9('0xc'),_0x5b91ce,_0xfea9('0xd'));_0x52ded(_0x50735f[_0xfea9('0x15')][_0xfea9('0x13')]);}})[_0xfea9('0x16')](function(_0x51d08a){logger[_0xfea9('0x11')](_0xfea9('0xc'),_0x5b91ce,_0x51d08a);_0x1c421f(_0x51d08a);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index fb21861..bcd427e 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 _0xbfcc=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update'];(function(_0x35825a,_0x567e61){var _0x4f2110=function(_0x14061d){while(--_0x14061d){_0x35825a['push'](_0x35825a['shift']());}};_0x4f2110(++_0x567e61);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xbfcc[_0x257642];return _0x3d813b;};'use strict';var multer=require(_0xcbfc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcbfc('0x1'));var express=require(_0xcbfc('0x2'));var router=express[_0xcbfc('0x3')]();var fs_extra=require(_0xcbfc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router[_0xcbfc('0x5')]('/',auth[_0xcbfc('0x6')](),controller['index']);router[_0xcbfc('0x5')]('/:id',auth[_0xcbfc('0x6')](),controller[_0xcbfc('0x7')]);router[_0xcbfc('0x5')](_0xcbfc('0x8'),auth['isAuthenticated'](),controller[_0xcbfc('0x9')]);router[_0xcbfc('0x5')](_0xcbfc('0xa'),auth[_0xcbfc('0x6')](),controller[_0xcbfc('0xb')]);router[_0xcbfc('0xc')]('/',auth['isAuthenticated'](),controller[_0xcbfc('0xd')]);router[_0xcbfc('0xc')](_0xcbfc('0x8'),auth[_0xcbfc('0x6')](),controller[_0xcbfc('0xe')]);router['put'](_0xcbfc('0xf'),auth[_0xcbfc('0x6')](),controller[_0xcbfc('0x10')]);router['delete'](_0xcbfc('0xf'),auth[_0xcbfc('0x6')](),controller[_0xcbfc('0x11')]);module[_0xcbfc('0x12')]=router; \ No newline at end of file +var _0xa478=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','getConfigurations','getFields','post','/:id/configurations','update'];(function(_0x163e14,_0x304102){var _0xfa992e=function(_0x15cf74){while(--_0x15cf74){_0x163e14['push'](_0x163e14['shift']());}};_0xfa992e(++_0x304102);}(_0xa478,0x136));var _0x8a47=function(_0x4c184d,_0x4278ab){_0x4c184d=_0x4c184d-0x0;var _0x23d997=_0xa478[_0x4c184d];return _0x23d997;};'use strict';var multer=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var path=require(_0x8a47('0x2'));var timeout=require(_0x8a47('0x3'));var express=require(_0x8a47('0x4'));var router=express[_0x8a47('0x5')]();var fs_extra=require(_0x8a47('0x6'));var auth=require(_0x8a47('0x7'));var interaction=require(_0x8a47('0x8'));var config=require(_0x8a47('0x9'));var controller=require(_0x8a47('0xa'));router[_0x8a47('0xb')]('/',auth['isAuthenticated'](),controller[_0x8a47('0xc')]);router[_0x8a47('0xb')](_0x8a47('0xd'),auth[_0x8a47('0xe')](),controller['show']);router[_0x8a47('0xb')]('/:id/configurations',auth[_0x8a47('0xe')](),controller[_0x8a47('0xf')]);router[_0x8a47('0xb')]('/:id/fields',auth[_0x8a47('0xe')](),controller[_0x8a47('0x10')]);router['post']('/',auth[_0x8a47('0xe')](),controller['create']);router[_0x8a47('0x11')](_0x8a47('0x12'),auth[_0x8a47('0xe')](),controller['addConfiguration']);router['put']('/:id',auth[_0x8a47('0xe')](),controller[_0x8a47('0x13')]);router['delete'](_0x8a47('0xd'),auth[_0x8a47('0xe')](),controller[_0x8a47('0x14')]);module[_0x8a47('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 7184847..9c02ba1 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 _0x1a85=['STRING','remoteUri'];(function(_0xc3083f,_0x5ac664){var _0x8e45bb=function(_0x466769){while(--_0x466769){_0xc3083f['push'](_0xc3083f['shift']());}};_0x8e45bb(++_0x5ac664);}(_0x1a85,0x178));var _0x51a8=function(_0x4f7b43,_0x119c22){_0x4f7b43=_0x4f7b43-0x0;var _0x2fcdf3=_0x1a85[_0x4f7b43];return _0x2fcdf3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x51a8('0x0')]},'description':{'type':Sequelize[_0x51a8('0x0')]},'username':{'type':Sequelize[_0x51a8('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x51a8('0x0')],'unique':_0x51a8('0x1')},'serverUrl':{'type':Sequelize[_0x51a8('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x627e=['STRING','remoteUri','sequelize','exports'];(function(_0x5ed582,_0x1c20c9){var _0x41c624=function(_0x34d8a0){while(--_0x34d8a0){_0x5ed582['push'](_0x5ed582['shift']());}};_0x41c624(++_0x1c20c9);}(_0x627e,0x14a));var _0xe627=function(_0x1648a2,_0x32fe82){_0x1648a2=_0x1648a2-0x0;var _0x553bea=_0x627e[_0x1648a2];return _0x553bea;};'use strict';var Sequelize=require(_0xe627('0x0'));module[_0xe627('0x1')]={'name':{'type':Sequelize[_0xe627('0x2')]},'description':{'type':Sequelize[_0xe627('0x2')]},'username':{'type':Sequelize[_0xe627('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xe627('0x2')]},'remoteUri':{'type':Sequelize[_0xe627('0x2')],'unique':_0xe627('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 685837c..e2296f4 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 _0x773f=['slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','offset','undefined','limit','count','status','set','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','FreshsalesAccount','includeAll','include','findAll','rows','catch','rawAttributes','options','create','body','find','params','destroy','getConfigurations','findOne','FreshsalesConfiguration','pick','addConfiguration','AccountId','channel','Descriptions','Subjects','username','remoteUri','apiKey'];(function(_0x5ec473,_0x98a6cc){var _0x5f2030=function(_0x2d00b3){while(--_0x2d00b3){_0x5ec473['push'](_0x5ec473['shift']());}};_0x5f2030(++_0x98a6cc);}(_0x773f,0x1a7));var _0xf773=function(_0x10df1e,_0xf56f85){_0x10df1e=_0x10df1e-0x0;var _0x3e24fb=_0x773f[_0x10df1e];return _0x3e24fb;};'use strict';var emlformat=require(_0xf773('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf773('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf773('0x2'));var moment=require(_0xf773('0x3'));var BPromise=require(_0xf773('0x4'));var Mustache=require(_0xf773('0x5'));var util=require(_0xf773('0x6'));var path=require(_0xf773('0x7'));var sox=require(_0xf773('0x8'));var csv=require(_0xf773('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf773('0xa'));var _=require(_0xf773('0xb'));var squel=require(_0xf773('0xc'));var crypto=require(_0xf773('0xd'));var jsforce=require(_0xf773('0xe'));var deskjs=require(_0xf773('0xf'));var toCsv=require(_0xf773('0x9'));var querystring=require(_0xf773('0x10'));var Papa=require(_0xf773('0x11'));var Redis=require(_0xf773('0x12'));var authService=require(_0xf773('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf773('0x14'))(_0xf773('0x15'));var utils=require(_0xf773('0x16'));var config=require(_0xf773('0x17'));var licenseUtil=require(_0xf773('0x18'));var db=require(_0xf773('0x19'))['db'];var integrations=require(_0xf773('0x1a'));function respondWithStatusCode(_0xc82764,_0x47457f){_0x47457f=_0x47457f||0xcc;return function(_0x35efa0){if(_0x35efa0){return _0xc82764['sendStatus'](_0x47457f);}return _0xc82764['status'](_0x47457f)[_0xf773('0x1b')]();};}function respondWithResult(_0x423de2,_0xcbac9f){_0xcbac9f=_0xcbac9f||0xc8;return function(_0x40fd33){if(_0x40fd33){return _0x423de2['status'](_0xcbac9f)['json'](_0x40fd33);}};}function respondWithFilteredResult(_0x41fa11,_0xe74f8a){return function(_0x2f7c48){if(_0x2f7c48){var _0x470405=typeof _0xe74f8a[_0xf773('0x1c')]===_0xf773('0x1d')&&typeof _0xe74f8a[_0xf773('0x1e')]===_0xf773('0x1d');var _0x1e9c9d=_0x2f7c48[_0xf773('0x1f')];var _0x20e723=_0x470405?0x0:_0xe74f8a[_0xf773('0x1c')];var _0x4ad051=_0x470405?_0x2f7c48[_0xf773('0x1f')]:_0xe74f8a[_0xf773('0x1c')]+_0xe74f8a['limit'];var _0x55cd50;if(_0x4ad051>=_0x1e9c9d){_0x4ad051=_0x1e9c9d;_0x55cd50=0xc8;}else{_0x55cd50=0xce;}_0x41fa11[_0xf773('0x20')](_0x55cd50);return _0x41fa11[_0xf773('0x21')]('Content-Range',_0x20e723+'-'+_0x4ad051+'/'+_0x1e9c9d)['json'](_0x2f7c48);}return null;};}function patchUpdates(_0x2e781e){return function(_0x21f6c2){try{jsonpatch['apply'](_0x21f6c2,_0x2e781e,!![]);}catch(_0xa4edd4){return BPromise[_0xf773('0x22')](_0xa4edd4);}return _0x21f6c2[_0xf773('0x23')]();};}function saveUpdates(_0x5a4781,_0x5202f8){return function(_0x56010d){if(_0x56010d){return _0x56010d[_0xf773('0x24')](_0x5a4781)[_0xf773('0x25')](function(_0x473498){return _0x473498;});}return null;};}function removeEntity(_0x303f81,_0x990cfe){return function(_0x4a19ca){if(_0x4a19ca){return _0x4a19ca['destroy']()[_0xf773('0x25')](function(){_0x303f81[_0xf773('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e2bbc,_0x136b39){return function(_0x881496){if(!_0x881496){_0x2e2bbc['sendStatus'](0x194);}return _0x881496;};}function handleError(_0x3a48f1,_0x1ece6e){_0x1ece6e=_0x1ece6e||0x1f4;return function(_0x32f9d4){logger[_0xf773('0x26')](_0x32f9d4[_0xf773('0x27')]);if(_0x32f9d4[_0xf773('0x28')]){delete _0x32f9d4[_0xf773('0x28')];}_0x3a48f1[_0xf773('0x20')](_0x1ece6e)[_0xf773('0x29')](_0x32f9d4);};}exports[_0xf773('0x2a')]=function(_0x361ad9,_0x3cb448){var _0x1030c5={},_0x27b510={},_0x175c06={'count':0x0,'rows':[]};var _0x3a5230=_[_0xf773('0x2b')](db['FreshsalesAccount']['rawAttributes'],function(_0x5f58d4){return{'name':_0x5f58d4[_0xf773('0x2c')],'type':_0x5f58d4[_0xf773('0x2d')][_0xf773('0x2e')]};});_0x27b510[_0xf773('0x2f')]=_['map'](_0x3a5230,_0xf773('0x28'));_0x27b510[_0xf773('0x30')]=_[_0xf773('0x31')](_0x361ad9[_0xf773('0x30')]);_0x27b510[_0xf773('0x32')]=_[_0xf773('0x33')](_0x27b510[_0xf773('0x2f')],_0x27b510[_0xf773('0x30')]);_0x1030c5['attributes']=_[_0xf773('0x33')](_0x27b510[_0xf773('0x2f')],qs['fields'](_0x361ad9['query'][_0xf773('0x34')]));_0x1030c5[_0xf773('0x35')]=_0x1030c5['attributes'][_0xf773('0x36')]?_0x1030c5[_0xf773('0x35')]:_0x27b510[_0xf773('0x2f')];if(!_0x361ad9[_0xf773('0x30')][_0xf773('0x37')](_0xf773('0x38'))){_0x1030c5['limit']=qs[_0xf773('0x1e')](_0x361ad9['query'][_0xf773('0x1e')]);_0x1030c5[_0xf773('0x1c')]=qs[_0xf773('0x1c')](_0x361ad9[_0xf773('0x30')][_0xf773('0x1c')]);}_0x1030c5['order']=qs[_0xf773('0x39')](_0x361ad9[_0xf773('0x30')][_0xf773('0x39')]);_0x1030c5[_0xf773('0x3a')]=qs['filters'](_['pick'](_0x361ad9['query'],_0x27b510[_0xf773('0x32')]),_0x3a5230);if(_0x361ad9['query'][_0xf773('0x3b')]){_0x1030c5[_0xf773('0x3a')]=_[_0xf773('0x3c')](_0x1030c5[_0xf773('0x3a')],{'$or':_['map'](_0x3a5230,function(_0xf771a1){if(_0xf771a1['type']!==_0xf773('0x3d')){var _0x2783f3={};_0x2783f3[_0xf771a1[_0xf773('0x28')]]={'$like':'%'+_0x361ad9[_0xf773('0x30')][_0xf773('0x3b')]+'%'};return _0x2783f3;}})});}_0x1030c5=_[_0xf773('0x3c')]({},_0x1030c5,_0x361ad9['options']);var _0x52a820={'where':_0x1030c5['where']};return db[_0xf773('0x3e')][_0xf773('0x1f')](_0x52a820)[_0xf773('0x25')](function(_0x1c92e7){_0x175c06['count']=_0x1c92e7;if(_0x361ad9[_0xf773('0x30')][_0xf773('0x3f')]){_0x1030c5[_0xf773('0x40')]=[{'all':!![]}];}return db[_0xf773('0x3e')][_0xf773('0x41')](_0x1030c5);})['then'](function(_0x520500){_0x175c06[_0xf773('0x42')]=_0x520500;return _0x175c06;})[_0xf773('0x25')](respondWithFilteredResult(_0x3cb448,_0x1030c5))[_0xf773('0x43')](handleError(_0x3cb448,null));};exports['show']=function(_0x2b16f9,_0x2cde2e){var _0x3133b9={'raw':![],'where':{'id':_0x2b16f9['params']['id']}},_0x421af1={};_0x421af1[_0xf773('0x2f')]=_[_0xf773('0x31')](db['FreshsalesAccount'][_0xf773('0x44')]);_0x421af1['query']=_[_0xf773('0x31')](_0x2b16f9[_0xf773('0x30')]);_0x421af1[_0xf773('0x32')]=_[_0xf773('0x33')](_0x421af1[_0xf773('0x2f')],_0x421af1[_0xf773('0x30')]);_0x3133b9[_0xf773('0x35')]=_[_0xf773('0x33')](_0x421af1[_0xf773('0x2f')],qs[_0xf773('0x34')](_0x2b16f9[_0xf773('0x30')][_0xf773('0x34')]));_0x3133b9[_0xf773('0x35')]=_0x3133b9[_0xf773('0x35')][_0xf773('0x36')]?_0x3133b9['attributes']:_0x421af1[_0xf773('0x2f')];if(_0x2b16f9[_0xf773('0x30')][_0xf773('0x3f')]){_0x3133b9['include']=[{'all':!![]}];}_0x3133b9=_[_0xf773('0x3c')]({},_0x3133b9,_0x2b16f9[_0xf773('0x45')]);return db[_0xf773('0x3e')]['find'](_0x3133b9)['then'](handleEntityNotFound(_0x2cde2e,null))[_0xf773('0x25')](respondWithResult(_0x2cde2e,null))[_0xf773('0x43')](handleError(_0x2cde2e,null));};exports['create']=function(_0x8a59f5,_0x380de4){return db[_0xf773('0x3e')][_0xf773('0x46')](_0x8a59f5[_0xf773('0x47')],{})[_0xf773('0x25')](respondWithResult(_0x380de4,0xc9))[_0xf773('0x43')](handleError(_0x380de4,null));};exports[_0xf773('0x24')]=function(_0x3fc7e5,_0x4bc804){if(_0x3fc7e5[_0xf773('0x47')]['id']){delete _0x3fc7e5['body']['id'];}return db['FreshsalesAccount'][_0xf773('0x48')]({'where':{'id':_0x3fc7e5[_0xf773('0x49')]['id']}})[_0xf773('0x25')](handleEntityNotFound(_0x4bc804,null))[_0xf773('0x25')](saveUpdates(_0x3fc7e5['body'],null))[_0xf773('0x25')](respondWithResult(_0x4bc804,null))[_0xf773('0x43')](handleError(_0x4bc804,null));};exports[_0xf773('0x4a')]=function(_0x5b7038,_0x23f465){return db[_0xf773('0x3e')]['find']({'where':{'id':_0x5b7038[_0xf773('0x49')]['id']}})[_0xf773('0x25')](handleEntityNotFound(_0x23f465,null))[_0xf773('0x25')](removeEntity(_0x23f465,null))[_0xf773('0x43')](handleError(_0x23f465,null));};exports[_0xf773('0x4b')]=function(_0x407805,_0x4d8505,_0x5ea506){var _0xb1aa17={};var _0x33a2de={};var _0x4cc05b;var _0x14d4e6;return db[_0xf773('0x3e')][_0xf773('0x4c')]({'where':{'id':_0x407805[_0xf773('0x49')]['id']}})[_0xf773('0x25')](handleEntityNotFound(_0x4d8505,null))[_0xf773('0x25')](function(_0x3ac249){if(_0x3ac249){_0x4cc05b=_0x3ac249;_0x33a2de[_0xf773('0x2f')]=_[_0xf773('0x31')](db[_0xf773('0x4d')][_0xf773('0x44')]);_0x33a2de['query']=_['keys'](_0x407805[_0xf773('0x30')]);_0x33a2de[_0xf773('0x32')]=_[_0xf773('0x33')](_0x33a2de[_0xf773('0x2f')],_0x33a2de['query']);_0xb1aa17[_0xf773('0x35')]=_['intersection'](_0x33a2de['model'],qs[_0xf773('0x34')](_0x407805[_0xf773('0x30')][_0xf773('0x34')]));_0xb1aa17[_0xf773('0x35')]=_0xb1aa17[_0xf773('0x35')][_0xf773('0x36')]?_0xb1aa17[_0xf773('0x35')]:_0x33a2de[_0xf773('0x2f')];_0xb1aa17['order']=qs['sort'](_0x407805[_0xf773('0x30')]['sort']);_0xb1aa17[_0xf773('0x3a')]=qs[_0xf773('0x32')](_[_0xf773('0x4e')](_0x407805[_0xf773('0x30')],_0x33a2de[_0xf773('0x32')]));if(_0x407805[_0xf773('0x30')][_0xf773('0x3b')]){_0xb1aa17[_0xf773('0x3a')]=_[_0xf773('0x3c')](_0xb1aa17[_0xf773('0x3a')],{'$or':_[_0xf773('0x2b')](_0xb1aa17[_0xf773('0x35')],function(_0x51a46c){var _0x32c975={};_0x32c975[_0x51a46c]={'$like':'%'+_0x407805[_0xf773('0x30')][_0xf773('0x3b')]+'%'};return _0x32c975;})});}_0xb1aa17=_[_0xf773('0x3c')]({},_0xb1aa17,_0x407805[_0xf773('0x45')]);return _0x4cc05b[_0xf773('0x4b')](_0xb1aa17);}})[_0xf773('0x25')](function(_0x4b133b){if(_0x4b133b){_0x14d4e6=_0x4b133b[_0xf773('0x36')];if(!_0x407805['query'][_0xf773('0x37')](_0xf773('0x38'))){_0xb1aa17[_0xf773('0x1e')]=qs[_0xf773('0x1e')](_0x407805[_0xf773('0x30')]['limit']);_0xb1aa17[_0xf773('0x1c')]=qs[_0xf773('0x1c')](_0x407805[_0xf773('0x30')][_0xf773('0x1c')]);}return _0x4cc05b[_0xf773('0x4b')](_0xb1aa17);}})['then'](function(_0x1a60d8){if(_0x1a60d8){return _0x1a60d8?{'count':_0x14d4e6,'rows':_0x1a60d8}:null;}})['then'](respondWithResult(_0x4d8505,null))[_0xf773('0x43')](handleError(_0x4d8505,null));};exports[_0xf773('0x4f')]=function(_0x1c28e1,_0x2674f1,_0x5d73ce){if(_0x1c28e1[_0xf773('0x47')]['id']){delete _0x1c28e1[_0xf773('0x47')]['id'];}return db[_0xf773('0x3e')][_0xf773('0x4c')]({'where':{'id':_0x1c28e1['params']['id']}})[_0xf773('0x25')](handleEntityNotFound(_0x2674f1,null))[_0xf773('0x25')](function(_0x382426){if(_0x382426){_0x1c28e1['body'][_0xf773('0x50')]=_0x382426['id'];_0x1c28e1[_0xf773('0x47')]['Subjects']=integrations['getSubjects'](_0x1c28e1[_0xf773('0x47')][_0xf773('0x51')],_0x1c28e1[_0xf773('0x47')]['type']);_0x1c28e1['body'][_0xf773('0x52')]=integrations['getDescriptions'](_0x1c28e1[_0xf773('0x47')]['channel'],_0x1c28e1[_0xf773('0x47')][_0xf773('0x2d')]);return db[_0xf773('0x4d')][_0xf773('0x46')](_0x1c28e1['body'],{'include':[{'model':db['FreshsalesField'],'as':_0xf773('0x53')},{'model':db['FreshsalesField'],'as':_0xf773('0x52')}]});}return null;})[_0xf773('0x25')](respondWithResult(_0x2674f1,null))[_0xf773('0x43')](handleError(_0x2674f1,null));};exports['getFields']=function(_0x12c5c4,_0x4197e7,_0x17c31d){var _0x14efa0='';var _0x4c1eca='';return db[_0xf773('0x3e')][_0xf773('0x4c')]({'where':{'id':_0x12c5c4[_0xf773('0x49')]['id']},'attributes':['id',_0xf773('0x54'),_0xf773('0x55'),_0xf773('0x56')]})[_0xf773('0x25')](handleEntityNotFound(_0x4197e7,null))[_0xf773('0x25')](function(_0x2c0508){if(_0x2c0508){_0x4c1eca=_0x2c0508[_0xf773('0x54')];_0x14efa0=_0x2c0508[_0xf773('0x55')];var _0x23f744=_0x2c0508['remoteUri'][_0xf773('0x57')](-0x1);if(_0x23f744==='/'){_0x14efa0=_0x14efa0['substring'](0x0,_0x14efa0[_0xf773('0x58')](_0x23f744));}return rp({'method':_0xf773('0x59'),'uri':util[_0xf773('0x5a')](_0xf773('0x5b'),_0x14efa0,_0xf773('0x5c')),'headers':{'Authorization':_0xf773('0x5d')+_0x2c0508[_0xf773('0x56')]},'json':!![]});}})[_0xf773('0x25')](function(_0x4bc571){if(_0x4bc571){var _0x1452ab=_0x4bc571[_0xf773('0x5e')];var _0x55e7fb=![];var _0x43c876=null;for(_0x43c876=0x0;_0x43c876<_0x1452ab[_0xf773('0x36')];_0x43c876++){if(_0x1452ab[_0x43c876][_0xf773('0x5f')]===_0x4c1eca){_0x55e7fb=!![];}}if(_0x55e7fb){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xf773('0x25')](respondWithResult(_0x4197e7,null))['catch'](function(_0x3f942b){var _0xbd3173=_0x12c5c4['query'][_0xf773('0x60')]?0x1f4:_0x3f942b[_0xf773('0x61')]||0x1f4;logger[_0xf773('0x26')](_0xf773('0x62'),_0xf773('0x63'),_0xbd3173,JSON[_0xf773('0x64')](_0x3f942b));delete _0x3f942b[_0xf773('0x28')];if(_0xbd3173===0x191){_0xbd3173=0x190;}_0x4197e7['status'](_0xbd3173)[_0xf773('0x29')](_0x12c5c4['query'][_0xf773('0x60')]?{'message':_0xf773('0x65'),'statusCode':_0x3f942b[_0xf773('0x61')]}:_0x3f942b);});}; \ No newline at end of file +var _0xabac=['type','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','keys','filters','options','find','create','FreshsalesAccount','update','body','findOne','rawAttributes','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','remoteUri','apiKey','username','slice','lastIndexOf','GET','format','%s%s','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','set','apply','reject','then','destroy','error','stack','name','send','index','map','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge'];(function(_0x2cdd70,_0x1271f3){var _0x3c3c2d=function(_0x386ab7){while(--_0x386ab7){_0x2cdd70['push'](_0x2cdd70['shift']());}};_0x3c3c2d(++_0x1271f3);}(_0xabac,0xf4));var _0xcaba=function(_0x236e5a,_0x189b20){_0x236e5a=_0x236e5a-0x0;var _0x2887a=_0xabac[_0x236e5a];return _0x2887a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcaba('0x0'));var zipdir=require(_0xcaba('0x1'));var jsonpatch=require(_0xcaba('0x2'));var rp=require(_0xcaba('0x3'));var moment=require(_0xcaba('0x4'));var BPromise=require(_0xcaba('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcaba('0x6'));var ejs=require(_0xcaba('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaba('0x8'));var squel=require(_0xcaba('0x9'));var crypto=require('crypto');var jsforce=require(_0xcaba('0xa'));var deskjs=require(_0xcaba('0xb'));var toCsv=require(_0xcaba('0x6'));var querystring=require(_0xcaba('0xc'));var Papa=require(_0xcaba('0xd'));var Redis=require('ioredis');var authService=require(_0xcaba('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcaba('0xf'));var hardwareService=require(_0xcaba('0x10'));var logger=require(_0xcaba('0x11'))(_0xcaba('0x12'));var utils=require(_0xcaba('0x13'));var config=require(_0xcaba('0x14'));var licenseUtil=require(_0xcaba('0x15'));var db=require(_0xcaba('0x16'))['db'];var integrations=require(_0xcaba('0x17'));function respondWithStatusCode(_0x1ad13a,_0x38ce63){_0x38ce63=_0x38ce63||0xcc;return function(_0x3ef27f){if(_0x3ef27f){return _0x1ad13a[_0xcaba('0x18')](_0x38ce63);}return _0x1ad13a[_0xcaba('0x19')](_0x38ce63)['end']();};}function respondWithResult(_0x213bf8,_0x38c4c1){_0x38c4c1=_0x38c4c1||0xc8;return function(_0x41e3b6){if(_0x41e3b6){return _0x213bf8[_0xcaba('0x19')](_0x38c4c1)[_0xcaba('0x1a')](_0x41e3b6);}};}function respondWithFilteredResult(_0x1bfbb0,_0x351698){return function(_0x585807){if(_0x585807){var _0x1c7b87=typeof _0x351698[_0xcaba('0x1b')]==='undefined'&&typeof _0x351698[_0xcaba('0x1c')]==='undefined';var _0x131540=_0x585807['count'];var _0xb50455=_0x1c7b87?0x0:_0x351698[_0xcaba('0x1b')];var _0x44d2d9=_0x1c7b87?_0x585807['count']:_0x351698[_0xcaba('0x1b')]+_0x351698[_0xcaba('0x1c')];var _0xb297bb;if(_0x44d2d9>=_0x131540){_0x44d2d9=_0x131540;_0xb297bb=0xc8;}else{_0xb297bb=0xce;}_0x1bfbb0[_0xcaba('0x19')](_0xb297bb);return _0x1bfbb0[_0xcaba('0x1d')]('Content-Range',_0xb50455+'-'+_0x44d2d9+'/'+_0x131540)['json'](_0x585807);}return null;};}function patchUpdates(_0x52c29d){return function(_0x9e7d32){try{jsonpatch[_0xcaba('0x1e')](_0x9e7d32,_0x52c29d,!![]);}catch(_0xf40321){return BPromise[_0xcaba('0x1f')](_0xf40321);}return _0x9e7d32['save']();};}function saveUpdates(_0xc669f1,_0x78956f){return function(_0x1a581f){if(_0x1a581f){return _0x1a581f['update'](_0xc669f1)[_0xcaba('0x20')](function(_0x26f1f6){return _0x26f1f6;});}return null;};}function removeEntity(_0x5a15b2,_0x5d43e5){return function(_0x42b812){if(_0x42b812){return _0x42b812[_0xcaba('0x21')]()[_0xcaba('0x20')](function(){_0x5a15b2[_0xcaba('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x447ee5,_0x16523d){return function(_0x1b8ef8){if(!_0x1b8ef8){_0x447ee5[_0xcaba('0x18')](0x194);}return _0x1b8ef8;};}function handleError(_0x17cdd1,_0x155917){_0x155917=_0x155917||0x1f4;return function(_0x1e1f07){logger[_0xcaba('0x22')](_0x1e1f07[_0xcaba('0x23')]);if(_0x1e1f07[_0xcaba('0x24')]){delete _0x1e1f07['name'];}_0x17cdd1[_0xcaba('0x19')](_0x155917)[_0xcaba('0x25')](_0x1e1f07);};}exports[_0xcaba('0x26')]=function(_0x529ceb,_0x4e16f9){var _0x2cf3db={},_0x110342={},_0x4e6ad5={'count':0x0,'rows':[]};var _0x386a79=_[_0xcaba('0x27')](db['FreshsalesAccount']['rawAttributes'],function(_0x35f75c){return{'name':_0x35f75c[_0xcaba('0x28')],'type':_0x35f75c['type']['key']};});_0x110342[_0xcaba('0x29')]=_['map'](_0x386a79,_0xcaba('0x24'));_0x110342[_0xcaba('0x2a')]=_['keys'](_0x529ceb[_0xcaba('0x2a')]);_0x110342['filters']=_[_0xcaba('0x2b')](_0x110342[_0xcaba('0x29')],_0x110342[_0xcaba('0x2a')]);_0x2cf3db[_0xcaba('0x2c')]=_[_0xcaba('0x2b')](_0x110342[_0xcaba('0x29')],qs[_0xcaba('0x2d')](_0x529ceb['query']['fields']));_0x2cf3db[_0xcaba('0x2c')]=_0x2cf3db['attributes'][_0xcaba('0x2e')]?_0x2cf3db[_0xcaba('0x2c')]:_0x110342[_0xcaba('0x29')];if(!_0x529ceb[_0xcaba('0x2a')][_0xcaba('0x2f')]('nolimit')){_0x2cf3db[_0xcaba('0x1c')]=qs[_0xcaba('0x1c')](_0x529ceb[_0xcaba('0x2a')][_0xcaba('0x1c')]);_0x2cf3db['offset']=qs[_0xcaba('0x1b')](_0x529ceb['query'][_0xcaba('0x1b')]);}_0x2cf3db[_0xcaba('0x30')]=qs[_0xcaba('0x31')](_0x529ceb[_0xcaba('0x2a')][_0xcaba('0x31')]);_0x2cf3db[_0xcaba('0x32')]=qs['filters'](_['pick'](_0x529ceb[_0xcaba('0x2a')],_0x110342['filters']),_0x386a79);if(_0x529ceb['query'][_0xcaba('0x33')]){_0x2cf3db[_0xcaba('0x32')]=_[_0xcaba('0x34')](_0x2cf3db[_0xcaba('0x32')],{'$or':_[_0xcaba('0x27')](_0x386a79,function(_0x596530){if(_0x596530[_0xcaba('0x35')]!==_0xcaba('0x36')){var _0x3fd941={};_0x3fd941[_0x596530['name']]={'$like':'%'+_0x529ceb[_0xcaba('0x2a')][_0xcaba('0x33')]+'%'};return _0x3fd941;}})});}_0x2cf3db=_[_0xcaba('0x34')]({},_0x2cf3db,_0x529ceb['options']);var _0x2615bb={'where':_0x2cf3db[_0xcaba('0x32')]};return db['FreshsalesAccount'][_0xcaba('0x37')](_0x2615bb)[_0xcaba('0x20')](function(_0x1ccdd3){_0x4e6ad5[_0xcaba('0x37')]=_0x1ccdd3;if(_0x529ceb[_0xcaba('0x2a')][_0xcaba('0x38')]){_0x2cf3db[_0xcaba('0x39')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xcaba('0x3a')](_0x2cf3db);})[_0xcaba('0x20')](function(_0x290f0b){_0x4e6ad5[_0xcaba('0x3b')]=_0x290f0b;return _0x4e6ad5;})['then'](respondWithFilteredResult(_0x4e16f9,_0x2cf3db))[_0xcaba('0x3c')](handleError(_0x4e16f9,null));};exports[_0xcaba('0x3d')]=function(_0x2826cd,_0x56a8b6){var _0x55e66b={'raw':![],'where':{'id':_0x2826cd[_0xcaba('0x3e')]['id']}},_0x625a36={};_0x625a36[_0xcaba('0x29')]=_[_0xcaba('0x3f')](db['FreshsalesAccount']['rawAttributes']);_0x625a36[_0xcaba('0x2a')]=_['keys'](_0x2826cd['query']);_0x625a36[_0xcaba('0x40')]=_[_0xcaba('0x2b')](_0x625a36[_0xcaba('0x29')],_0x625a36[_0xcaba('0x2a')]);_0x55e66b[_0xcaba('0x2c')]=_[_0xcaba('0x2b')](_0x625a36['model'],qs['fields'](_0x2826cd[_0xcaba('0x2a')]['fields']));_0x55e66b['attributes']=_0x55e66b[_0xcaba('0x2c')][_0xcaba('0x2e')]?_0x55e66b['attributes']:_0x625a36[_0xcaba('0x29')];if(_0x2826cd['query'][_0xcaba('0x38')]){_0x55e66b[_0xcaba('0x39')]=[{'all':!![]}];}_0x55e66b=_['merge']({},_0x55e66b,_0x2826cd[_0xcaba('0x41')]);return db['FreshsalesAccount'][_0xcaba('0x42')](_0x55e66b)[_0xcaba('0x20')](handleEntityNotFound(_0x56a8b6,null))[_0xcaba('0x20')](respondWithResult(_0x56a8b6,null))[_0xcaba('0x3c')](handleError(_0x56a8b6,null));};exports[_0xcaba('0x43')]=function(_0x5ee2fb,_0x710c8d){return db[_0xcaba('0x44')][_0xcaba('0x43')](_0x5ee2fb['body'],{})[_0xcaba('0x20')](respondWithResult(_0x710c8d,0xc9))[_0xcaba('0x3c')](handleError(_0x710c8d,null));};exports[_0xcaba('0x45')]=function(_0x22f6a4,_0xacd33f){if(_0x22f6a4['body']['id']){delete _0x22f6a4['body']['id'];}return db[_0xcaba('0x44')][_0xcaba('0x42')]({'where':{'id':_0x22f6a4[_0xcaba('0x3e')]['id']}})['then'](handleEntityNotFound(_0xacd33f,null))[_0xcaba('0x20')](saveUpdates(_0x22f6a4[_0xcaba('0x46')],null))[_0xcaba('0x20')](respondWithResult(_0xacd33f,null))[_0xcaba('0x3c')](handleError(_0xacd33f,null));};exports[_0xcaba('0x21')]=function(_0x19cd08,_0x5b8278){return db[_0xcaba('0x44')][_0xcaba('0x42')]({'where':{'id':_0x19cd08[_0xcaba('0x3e')]['id']}})[_0xcaba('0x20')](handleEntityNotFound(_0x5b8278,null))[_0xcaba('0x20')](removeEntity(_0x5b8278,null))[_0xcaba('0x3c')](handleError(_0x5b8278,null));};exports['getConfigurations']=function(_0x40fc21,_0x2bc7ec,_0x2ccccc){var _0x52ae18={};var _0x56ccd7={};var _0x50f572;var _0x18a963;return db[_0xcaba('0x44')][_0xcaba('0x47')]({'where':{'id':_0x40fc21[_0xcaba('0x3e')]['id']}})[_0xcaba('0x20')](handleEntityNotFound(_0x2bc7ec,null))['then'](function(_0x51aee1){if(_0x51aee1){_0x50f572=_0x51aee1;_0x56ccd7[_0xcaba('0x29')]=_[_0xcaba('0x3f')](db['FreshsalesConfiguration'][_0xcaba('0x48')]);_0x56ccd7['query']=_[_0xcaba('0x3f')](_0x40fc21[_0xcaba('0x2a')]);_0x56ccd7[_0xcaba('0x40')]=_[_0xcaba('0x2b')](_0x56ccd7['model'],_0x56ccd7[_0xcaba('0x2a')]);_0x52ae18[_0xcaba('0x2c')]=_[_0xcaba('0x2b')](_0x56ccd7[_0xcaba('0x29')],qs[_0xcaba('0x2d')](_0x40fc21[_0xcaba('0x2a')][_0xcaba('0x2d')]));_0x52ae18[_0xcaba('0x2c')]=_0x52ae18['attributes'][_0xcaba('0x2e')]?_0x52ae18['attributes']:_0x56ccd7[_0xcaba('0x29')];_0x52ae18[_0xcaba('0x30')]=qs[_0xcaba('0x31')](_0x40fc21['query'][_0xcaba('0x31')]);_0x52ae18[_0xcaba('0x32')]=qs[_0xcaba('0x40')](_['pick'](_0x40fc21[_0xcaba('0x2a')],_0x56ccd7[_0xcaba('0x40')]));if(_0x40fc21[_0xcaba('0x2a')]['filter']){_0x52ae18[_0xcaba('0x32')]=_[_0xcaba('0x34')](_0x52ae18['where'],{'$or':_[_0xcaba('0x27')](_0x52ae18[_0xcaba('0x2c')],function(_0x3c1ba2){var _0x2993b1={};_0x2993b1[_0x3c1ba2]={'$like':'%'+_0x40fc21[_0xcaba('0x2a')][_0xcaba('0x33')]+'%'};return _0x2993b1;})});}_0x52ae18=_[_0xcaba('0x34')]({},_0x52ae18,_0x40fc21[_0xcaba('0x41')]);return _0x50f572[_0xcaba('0x49')](_0x52ae18);}})[_0xcaba('0x20')](function(_0x3e0aad){if(_0x3e0aad){_0x18a963=_0x3e0aad['length'];if(!_0x40fc21[_0xcaba('0x2a')][_0xcaba('0x2f')]('nolimit')){_0x52ae18[_0xcaba('0x1c')]=qs['limit'](_0x40fc21[_0xcaba('0x2a')][_0xcaba('0x1c')]);_0x52ae18[_0xcaba('0x1b')]=qs['offset'](_0x40fc21['query'][_0xcaba('0x1b')]);}return _0x50f572['getConfigurations'](_0x52ae18);}})[_0xcaba('0x20')](function(_0x48e0a8){if(_0x48e0a8){return _0x48e0a8?{'count':_0x18a963,'rows':_0x48e0a8}:null;}})[_0xcaba('0x20')](respondWithResult(_0x2bc7ec,null))[_0xcaba('0x3c')](handleError(_0x2bc7ec,null));};exports[_0xcaba('0x4a')]=function(_0x3f8212,_0x2ec75c,_0x243247){if(_0x3f8212[_0xcaba('0x46')]['id']){delete _0x3f8212[_0xcaba('0x46')]['id'];}return db[_0xcaba('0x44')][_0xcaba('0x47')]({'where':{'id':_0x3f8212['params']['id']}})[_0xcaba('0x20')](handleEntityNotFound(_0x2ec75c,null))[_0xcaba('0x20')](function(_0x35254f){if(_0x35254f){_0x3f8212[_0xcaba('0x46')][_0xcaba('0x4b')]=_0x35254f['id'];_0x3f8212[_0xcaba('0x46')][_0xcaba('0x4c')]=integrations['getSubjects'](_0x3f8212[_0xcaba('0x46')][_0xcaba('0x4d')],_0x3f8212[_0xcaba('0x46')][_0xcaba('0x35')]);_0x3f8212['body'][_0xcaba('0x4e')]=integrations[_0xcaba('0x4f')](_0x3f8212[_0xcaba('0x46')][_0xcaba('0x4d')],_0x3f8212[_0xcaba('0x46')][_0xcaba('0x35')]);return db[_0xcaba('0x50')][_0xcaba('0x43')](_0x3f8212[_0xcaba('0x46')],{'include':[{'model':db[_0xcaba('0x51')],'as':_0xcaba('0x4c')},{'model':db[_0xcaba('0x51')],'as':_0xcaba('0x4e')}]});}return null;})['then'](respondWithResult(_0x2ec75c,null))[_0xcaba('0x3c')](handleError(_0x2ec75c,null));};exports[_0xcaba('0x52')]=function(_0x238622,_0x57bc4d,_0x50ebb4){var _0xb69fa2='';var _0x1d7d98='';return db[_0xcaba('0x44')][_0xcaba('0x47')]({'where':{'id':_0x238622[_0xcaba('0x3e')]['id']},'attributes':['id','username',_0xcaba('0x53'),_0xcaba('0x54')]})[_0xcaba('0x20')](handleEntityNotFound(_0x57bc4d,null))[_0xcaba('0x20')](function(_0x165aa5){if(_0x165aa5){_0x1d7d98=_0x165aa5[_0xcaba('0x55')];_0xb69fa2=_0x165aa5[_0xcaba('0x53')];var _0x1cd18a=_0x165aa5[_0xcaba('0x53')][_0xcaba('0x56')](-0x1);if(_0x1cd18a==='/'){_0xb69fa2=_0xb69fa2['substring'](0x0,_0xb69fa2[_0xcaba('0x57')](_0x1cd18a));}return rp({'method':_0xcaba('0x58'),'uri':util[_0xcaba('0x59')](_0xcaba('0x5a'),_0xb69fa2,'/api/selector/owners'),'headers':{'Authorization':_0xcaba('0x5b')+_0x165aa5['apiKey']},'json':!![]});}})[_0xcaba('0x20')](function(_0x55acb1){if(_0x55acb1){var _0x5f5ca2=_0x55acb1[_0xcaba('0x5c')];var _0x573b12=![];var _0x4f7ca5=null;for(_0x4f7ca5=0x0;_0x4f7ca5<_0x5f5ca2['length'];_0x4f7ca5++){if(_0x5f5ca2[_0x4f7ca5]['email']===_0x1d7d98){_0x573b12=!![];}}if(_0x573b12){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xcaba('0x5d')});}}})['then'](respondWithResult(_0x57bc4d,null))['catch'](function(_0x3dae2f){var _0x4706f9=_0x238622[_0xcaba('0x2a')]['test']?0x1f4:_0x3dae2f['statusCode']||0x1f4;logger[_0xcaba('0x22')](_0xcaba('0x5e'),_0xcaba('0x52'),_0x4706f9,JSON[_0xcaba('0x5f')](_0x3dae2f));delete _0x3dae2f['name'];if(_0x4706f9===0x191){_0x4706f9=0x190;}_0x57bc4d[_0xcaba('0x19')](_0x4706f9)[_0xcaba('0x25')](_0x238622[_0xcaba('0x2a')][_0xcaba('0x60')]?{'message':_0xcaba('0x61'),'statusCode':_0x3dae2f[_0xcaba('0x62')]}:_0x3dae2f);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 6ef5671..342d105 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 _0xb091=['request-promise','../../config/environment','./intFreshsalesAccount.attributes','exports','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','api','moment'];(function(_0x20ffc8,_0x21cc30){var _0x317af0=function(_0x2711c0){while(--_0x2711c0){_0x20ffc8['push'](_0x20ffc8['shift']());}};_0x317af0(++_0x21cc30);}(_0xb091,0x16e));var _0x1b09=function(_0x5dbcee,_0x2a735f){_0x5dbcee=_0x5dbcee-0x0;var _0xc32f9d=_0xb091[_0x5dbcee];return _0xc32f9d;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var logger=require(_0x1b09('0x1'))(_0x1b09('0x2'));var moment=require(_0x1b09('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b09('0x5'));var attributes=require(_0x1b09('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x1b09('0x7')]=function(_0x5fa348,_0x2bf4f6){return _0x5fa348['define'](_0x1b09('0x8'),attributes,{'tableName':_0x1b09('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb145=['request-promise','path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x331b90,_0xf2dad9){var _0x586abc=function(_0x2443e6){while(--_0x2443e6){_0x331b90['push'](_0x331b90['shift']());}};_0x586abc(++_0xf2dad9);}(_0xb145,0xa3));var _0x5b14=function(_0x3ca76d,_0x2ae69a){_0x3ca76d=_0x3ca76d-0x0;var _0x244cd6=_0xb145[_0x3ca76d];return _0x244cd6;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var logger=require(_0x5b14('0x1'))(_0x5b14('0x2'));var moment=require(_0x5b14('0x3'));var BPromise=require(_0x5b14('0x4'));var rp=require(_0x5b14('0x5'));var fs=require('fs');var path=require(_0x5b14('0x6'));var rimraf=require(_0x5b14('0x7'));var config=require('../../config/environment');var attributes=require(_0x5b14('0x8'));var integrations=require(_0x5b14('0x9'));module[_0x5b14('0xa')]=function(_0x4d82ad,_0x50fd91){return _0x4d82ad[_0x5b14('0xb')](_0x5b14('0xc'),attributes,{'tableName':_0x5b14('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 9b299f2..2741202 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 _0x6d38=['moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','include','model','debug','catch','ShowFreshsalesAccount','find','map','util'];(function(_0x1bc013,_0x7771c6){var _0x55df36=function(_0x1c02e0){while(--_0x1c02e0){_0x1bc013['push'](_0x1bc013['shift']());}};_0x55df36(++_0x7771c6);}(_0x6d38,0x1ef));var _0x86d3=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x6d38[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});}exports[_0x86d3('0x12')]=function(_0x46feec){var _0x120ef3=this;return new Promise(function(_0x33e459,_0x32dee7){return db[_0x86d3('0x13')]['findAll']({'raw':_0x46feec[_0x86d3('0x14')]?_0x46feec['options'][_0x86d3('0x15')]===undefined?!![]:![]:!![],'where':_0x46feec['options']?_0x46feec['options'][_0x86d3('0x16')]||null:null,'attributes':_0x46feec[_0x86d3('0x14')]?_0x46feec[_0x86d3('0x14')][_0x86d3('0x17')]||null:null,'limit':_0x46feec['options']?_0x46feec[_0x86d3('0x14')]['limit']||null:null,'include':_0x46feec[_0x86d3('0x14')]?_0x46feec[_0x86d3('0x14')][_0x86d3('0x18')]?_['map'](_0x46feec[_0x86d3('0x14')][_0x86d3('0x18')],function(_0x1fa4ac){return{'model':db[_0x1fa4ac['model']],'as':_0x1fa4ac['as'],'attributes':_0x1fa4ac['attributes'],'include':_0x1fa4ac[_0x86d3('0x18')]?_['map'](_0x1fa4ac[_0x86d3('0x18')],function(_0x1bea5e){return{'model':db[_0x1bea5e[_0x86d3('0x19')]],'as':_0x1bea5e['as'],'attributes':_0x1bea5e[_0x86d3('0x17')],'include':_0x1bea5e['include']?_['map'](_0x1bea5e[_0x86d3('0x18')],function(_0x611764){return{'model':db[_0x611764['model']],'as':_0x611764['as'],'attributes':_0x611764[_0x86d3('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42413c){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x46feec);logger[_0x86d3('0x1a')](_0x86d3('0x12'),_0x46feec,JSON[_0x86d3('0xd')](_0x42413c));_0x33e459(_0x42413c);})[_0x86d3('0x1b')](function(_0x35d708){logger[_0x86d3('0xe')](_0x86d3('0x12'),_0x35d708[_0x86d3('0xf')],_0x46feec);_0x32dee7(_0x120ef3[_0x86d3('0xe')](0x1f4,_0x35d708[_0x86d3('0xf')]));});});};exports[_0x86d3('0x1c')]=function(_0x5b09f6){var _0x120a0c=this;return new Promise(function(_0x403be3,_0x2bda35){return db[_0x86d3('0x13')][_0x86d3('0x1d')]({'raw':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6['options'][_0x86d3('0x15')]===undefined?!![]:![]:!![],'where':_0x5b09f6['options']?_0x5b09f6['options'][_0x86d3('0x16')]||null:null,'attributes':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6[_0x86d3('0x14')]['attributes']||null:null,'include':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6[_0x86d3('0x14')]['include']?_[_0x86d3('0x1e')](_0x5b09f6[_0x86d3('0x14')][_0x86d3('0x18')],function(_0x476eb3){return{'model':db[_0x476eb3[_0x86d3('0x19')]],'as':_0x476eb3['as'],'attributes':_0x476eb3[_0x86d3('0x17')],'include':_0x476eb3[_0x86d3('0x18')]?_[_0x86d3('0x1e')](_0x476eb3['include'],function(_0x4cdf45){return{'model':db[_0x4cdf45['model']],'as':_0x4cdf45['as'],'attributes':_0x4cdf45[_0x86d3('0x17')],'include':_0x4cdf45['include']?_[_0x86d3('0x1e')](_0x4cdf45['include'],function(_0x366943){return{'model':db[_0x366943[_0x86d3('0x19')]],'as':_0x366943['as'],'attributes':_0x366943[_0x86d3('0x17')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0xa')](function(_0x1e22c2){logger[_0x86d3('0x10')](_0x86d3('0x1c'),_0x5b09f6);logger['debug'](_0x86d3('0x1c'),_0x5b09f6,JSON[_0x86d3('0xd')](_0x1e22c2));_0x403be3(_0x1e22c2);})['catch'](function(_0x178fc6){logger[_0x86d3('0xe')](_0x86d3('0x1c'),_0x178fc6[_0x86d3('0xf')],_0x5b09f6);_0x2bda35(_0x120a0c['error'](0x1f4,_0x178fc6[_0x86d3('0xf')]));});});}; \ No newline at end of file +var _0xa456=['message','result','GetFreshsalesAccount','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x123ba7,_0x2cc005){var _0x19bf60=function(_0x173002){while(--_0x173002){_0x123ba7['push'](_0x123ba7['shift']());}};_0x19bf60(++_0x2cc005);}(_0xa456,0x142));var _0x6a45=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xa456[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var moment=require(_0x6a45('0x2'));var BPromise=require(_0x6a45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a45('0x4'));var db=require(_0x6a45('0x5'))['db'];var utils=require(_0x6a45('0x6'));var logger=require('../../config/logger')(_0x6a45('0x7'));var config=require(_0x6a45('0x8'));var jayson=require(_0x6a45('0x9'));var client=jayson[_0x6a45('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25cf8d,_0x26bfc0,_0x214514){return new BPromise(function(_0x19e67c,_0x3deb09){return client['request'](_0x25cf8d,_0x214514)[_0x6a45('0xb')](function(_0x517040){logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));logger[_0x6a45('0xf')](_0x6a45('0x10'),_0x26bfc0,'request\x20sent',JSON['stringify'](_0x517040));if(_0x517040[_0x6a45('0x11')]){if(_0x517040[_0x6a45('0x11')]['code']===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x26bfc0,_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);return _0x3deb09(_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);}logger[_0x6a45('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x26bfc0,_0x517040['error'][_0x6a45('0x12')]);return _0x19e67c(_0x517040[_0x6a45('0x11')]['message']);}else{logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));_0x19e67c(_0x517040[_0x6a45('0x13')]['message']);}})['catch'](function(_0x49023f){logger[_0x6a45('0x11')](_0x6a45('0xd'),_0x26bfc0,_0x49023f);_0x3deb09(_0x49023f);});});}exports[_0x6a45('0x14')]=function(_0x52a055){var _0x379c22=this;return new Promise(function(_0x102981,_0x3439c8){return db['FreshsalesAccount']['findAll']({'raw':_0x52a055['options']?_0x52a055[_0x6a45('0x15')][_0x6a45('0x16')]===undefined?!![]:![]:!![],'where':_0x52a055['options']?_0x52a055[_0x6a45('0x15')][_0x6a45('0x17')]||null:null,'attributes':_0x52a055['options']?_0x52a055[_0x6a45('0x15')][_0x6a45('0x18')]||null:null,'limit':_0x52a055[_0x6a45('0x15')]?_0x52a055[_0x6a45('0x15')][_0x6a45('0x19')]||null:null,'include':_0x52a055['options']?_0x52a055['options'][_0x6a45('0x1a')]?_[_0x6a45('0x1b')](_0x52a055[_0x6a45('0x15')][_0x6a45('0x1a')],function(_0x25a380){return{'model':db[_0x25a380[_0x6a45('0x1c')]],'as':_0x25a380['as'],'attributes':_0x25a380[_0x6a45('0x18')],'include':_0x25a380[_0x6a45('0x1a')]?_[_0x6a45('0x1b')](_0x25a380[_0x6a45('0x1a')],function(_0x1310d7){return{'model':db[_0x1310d7[_0x6a45('0x1c')]],'as':_0x1310d7['as'],'attributes':_0x1310d7['attributes'],'include':_0x1310d7[_0x6a45('0x1a')]?_['map'](_0x1310d7[_0x6a45('0x1a')],function(_0x25467d){return{'model':db[_0x25467d[_0x6a45('0x1c')]],'as':_0x25467d['as'],'attributes':_0x25467d[_0x6a45('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6a45('0xb')](function(_0x526062){logger[_0x6a45('0xc')](_0x6a45('0x14'),_0x52a055);logger[_0x6a45('0xf')](_0x6a45('0x14'),_0x52a055,JSON[_0x6a45('0x1d')](_0x526062));_0x102981(_0x526062);})[_0x6a45('0x1e')](function(_0x3fac9b){logger[_0x6a45('0x11')]('GetFreshsalesAccount',_0x3fac9b[_0x6a45('0x12')],_0x52a055);_0x3439c8(_0x379c22[_0x6a45('0x11')](0x1f4,_0x3fac9b[_0x6a45('0x12')]));});});};exports[_0x6a45('0x1f')]=function(_0x3b07a1){var _0x5dc288=this;return new Promise(function(_0x1f95d4,_0x1f96bf){return db[_0x6a45('0x20')][_0x6a45('0x21')]({'raw':_0x3b07a1['options']?_0x3b07a1['options'][_0x6a45('0x16')]===undefined?!![]:![]:!![],'where':_0x3b07a1['options']?_0x3b07a1[_0x6a45('0x15')]['where']||null:null,'attributes':_0x3b07a1[_0x6a45('0x15')]?_0x3b07a1[_0x6a45('0x15')][_0x6a45('0x18')]||null:null,'include':_0x3b07a1[_0x6a45('0x15')]?_0x3b07a1[_0x6a45('0x15')][_0x6a45('0x1a')]?_[_0x6a45('0x1b')](_0x3b07a1[_0x6a45('0x15')][_0x6a45('0x1a')],function(_0x36f4a4){return{'model':db[_0x36f4a4[_0x6a45('0x1c')]],'as':_0x36f4a4['as'],'attributes':_0x36f4a4[_0x6a45('0x18')],'include':_0x36f4a4[_0x6a45('0x1a')]?_['map'](_0x36f4a4[_0x6a45('0x1a')],function(_0x4ae2ac){return{'model':db[_0x4ae2ac[_0x6a45('0x1c')]],'as':_0x4ae2ac['as'],'attributes':_0x4ae2ac[_0x6a45('0x18')],'include':_0x4ae2ac[_0x6a45('0x1a')]?_[_0x6a45('0x1b')](_0x4ae2ac[_0x6a45('0x1a')],function(_0x2199c1){return{'model':db[_0x2199c1['model']],'as':_0x2199c1['as'],'attributes':_0x2199c1[_0x6a45('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6a45('0xb')](function(_0x2b75f6){logger[_0x6a45('0xc')](_0x6a45('0x1f'),_0x3b07a1);logger[_0x6a45('0xf')]('ShowFreshsalesAccount',_0x3b07a1,JSON[_0x6a45('0x1d')](_0x2b75f6));_0x1f95d4(_0x2b75f6);})[_0x6a45('0x1e')](function(_0x5c76bd){logger[_0x6a45('0x11')](_0x6a45('0x1f'),_0x5c76bd[_0x6a45('0x12')],_0x3b07a1);_0x1f96bf(_0x5dc288[_0x6a45('0x11')](0x1f4,_0x5c76bd[_0x6a45('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index d3ab2f0..4e5a84f 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 _0xff0e=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','getFields','post','create','update','destroy','exports'];(function(_0x29a7cb,_0x4d8818){var _0x351843=function(_0x4f524f){while(--_0x4f524f){_0x29a7cb['push'](_0x29a7cb['shift']());}};_0x351843(++_0x4d8818);}(_0xff0e,0xb0));var _0xeff0=function(_0x4c380f,_0x17579a){_0x4c380f=_0x4c380f-0x0;var _0x56cc81=_0xff0e[_0x4c380f];return _0x56cc81;};'use strict';var multer=require(_0xeff0('0x0'));var util=require('util');var path=require(_0xeff0('0x1'));var timeout=require(_0xeff0('0x2'));var express=require(_0xeff0('0x3'));var router=express[_0xeff0('0x4')]();var fs_extra=require(_0xeff0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeff0('0x6'));var config=require(_0xeff0('0x7'));var controller=require(_0xeff0('0x8'));router[_0xeff0('0x9')]('/',auth[_0xeff0('0xa')](),controller[_0xeff0('0xb')]);router['get'](_0xeff0('0xc'),auth['isAuthenticated'](),controller[_0xeff0('0xd')]);router[_0xeff0('0x9')](_0xeff0('0xe'),auth[_0xeff0('0xa')](),controller[_0xeff0('0xf')]);router[_0xeff0('0x9')]('/:id/descriptions',auth[_0xeff0('0xa')](),controller['getDescriptions']);router[_0xeff0('0x9')]('/:id/fields',auth[_0xeff0('0xa')](),controller[_0xeff0('0x10')]);router[_0xeff0('0x11')]('/',auth[_0xeff0('0xa')](),controller[_0xeff0('0x12')]);router['put'](_0xeff0('0xc'),auth['isAuthenticated'](),controller[_0xeff0('0x13')]);router['delete']('/:id',auth[_0xeff0('0xa')](),controller[_0xeff0('0x14')]);module[_0xeff0('0x15')]=router; \ No newline at end of file +var _0x2991=['getDescriptions','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','get','/:id','show','getSubjects'];(function(_0x1de246,_0x169506){var _0x108de1=function(_0x184814){while(--_0x184814){_0x1de246['push'](_0x1de246['shift']());}};_0x108de1(++_0x169506);}(_0x2991,0x112));var _0x1299=function(_0x145bbe,_0x1393f3){_0x145bbe=_0x145bbe-0x0;var _0x532b4b=_0x2991[_0x145bbe];return _0x532b4b;};'use strict';var multer=require(_0x1299('0x0'));var util=require('util');var path=require(_0x1299('0x1'));var timeout=require(_0x1299('0x2'));var express=require('express');var router=express[_0x1299('0x3')]();var fs_extra=require(_0x1299('0x4'));var auth=require(_0x1299('0x5'));var interaction=require(_0x1299('0x6'));var config=require(_0x1299('0x7'));var controller=require(_0x1299('0x8'));router['get']('/',auth[_0x1299('0x9')](),controller['index']);router[_0x1299('0xa')](_0x1299('0xb'),auth[_0x1299('0x9')](),controller[_0x1299('0xc')]);router['get']('/:id/subjects',auth[_0x1299('0x9')](),controller[_0x1299('0xd')]);router[_0x1299('0xa')]('/:id/descriptions',auth[_0x1299('0x9')](),controller[_0x1299('0xe')]);router[_0x1299('0xa')](_0x1299('0xf'),auth[_0x1299('0x9')](),controller[_0x1299('0x10')]);router[_0x1299('0x11')]('/',auth[_0x1299('0x9')](),controller[_0x1299('0x12')]);router[_0x1299('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x1299('0x14')]);router[_0x1299('0x15')](_0x1299('0xb'),auth[_0x1299('0x9')](),controller[_0x1299('0x16')]);module[_0x1299('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index d296586..b12cc61 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 _0x20e3=['sequelize','exports','STRING'];(function(_0x281220,_0x3d3798){var _0x44864f=function(_0x222c1f){while(--_0x222c1f){_0x281220['push'](_0x281220['shift']());}};_0x44864f(++_0x3d3798);}(_0x20e3,0x90));var _0x320e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x20e3[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x320e('0x0'));module[_0x320e('0x1')]={'name':{'type':Sequelize[_0x320e('0x2')]},'description':{'type':Sequelize[_0x320e('0x2')]}}; \ No newline at end of file +var _0x5e47=['STRING','sequelize','exports'];(function(_0x8dd85f,_0x102a4c){var _0x5d55ee=function(_0x1463ab){while(--_0x1463ab){_0x8dd85f['push'](_0x8dd85f['shift']());}};_0x5d55ee(++_0x102a4c);}(_0x5e47,0x1ab));var _0x75e4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5e47[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x75e4('0x0'));module[_0x75e4('0x1')]={'name':{'type':Sequelize[_0x75e4('0x2')]},'description':{'type':Sequelize[_0x75e4('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 14bf027..3580771 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 _0x0b5a=['attributes','fields','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','keys','options','find','create','body','getSubjects','params','FreshsalesField','order','pick','findOne','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','end','status','json','undefined','count','offset','limit','set','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection'];(function(_0x326c67,_0x5a25be){var _0x186634=function(_0x2c9364){while(--_0x2c9364){_0x326c67['push'](_0x326c67['shift']());}};_0x186634(++_0x5a25be);}(_0x0b5a,0x158));var _0xa0b5=function(_0x1139ac,_0x17f0ff){_0x1139ac=_0x1139ac-0x0;var _0x39c9d1=_0x0b5a[_0x1139ac];return _0x39c9d1;};'use strict';var emlformat=require(_0xa0b5('0x0'));var rimraf=require(_0xa0b5('0x1'));var zipdir=require(_0xa0b5('0x2'));var jsonpatch=require(_0xa0b5('0x3'));var rp=require(_0xa0b5('0x4'));var moment=require('moment');var BPromise=require(_0xa0b5('0x5'));var Mustache=require(_0xa0b5('0x6'));var util=require('util');var path=require(_0xa0b5('0x7'));var sox=require(_0xa0b5('0x8'));var csv=require(_0xa0b5('0x9'));var ejs=require(_0xa0b5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0b5('0xb'));var squel=require(_0xa0b5('0xc'));var crypto=require(_0xa0b5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa0b5('0xe'));var toCsv=require(_0xa0b5('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa0b5('0xf'));var authService=require(_0xa0b5('0x10'));var qs=require(_0xa0b5('0x11'));var as=require(_0xa0b5('0x12'));var hardwareService=require(_0xa0b5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa0b5('0x14'));var config=require(_0xa0b5('0x15'));var licenseUtil=require(_0xa0b5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18db88,_0x276fea){_0x276fea=_0x276fea||0xcc;return function(_0x247f76){if(_0x247f76){return _0x18db88['sendStatus'](_0x276fea);}return _0x18db88['status'](_0x276fea)[_0xa0b5('0x17')]();};}function respondWithResult(_0x1262f5,_0x3e262c){_0x3e262c=_0x3e262c||0xc8;return function(_0x587cfe){if(_0x587cfe){return _0x1262f5[_0xa0b5('0x18')](_0x3e262c)[_0xa0b5('0x19')](_0x587cfe);}};}function respondWithFilteredResult(_0x5da88f,_0x4243eb){return function(_0x1dc75e){if(_0x1dc75e){var _0x30aa09=typeof _0x4243eb['offset']===_0xa0b5('0x1a')&&typeof _0x4243eb['limit']===_0xa0b5('0x1a');var _0x28c06a=_0x1dc75e[_0xa0b5('0x1b')];var _0x58d632=_0x30aa09?0x0:_0x4243eb[_0xa0b5('0x1c')];var _0x3d2b33=_0x30aa09?_0x1dc75e[_0xa0b5('0x1b')]:_0x4243eb[_0xa0b5('0x1c')]+_0x4243eb[_0xa0b5('0x1d')];var _0x3bce13;if(_0x3d2b33>=_0x28c06a){_0x3d2b33=_0x28c06a;_0x3bce13=0xc8;}else{_0x3bce13=0xce;}_0x5da88f[_0xa0b5('0x18')](_0x3bce13);return _0x5da88f[_0xa0b5('0x1e')]('Content-Range',_0x58d632+'-'+_0x3d2b33+'/'+_0x28c06a)['json'](_0x1dc75e);}return null;};}function patchUpdates(_0x48c97d){return function(_0x593ffc){try{jsonpatch[_0xa0b5('0x1f')](_0x593ffc,_0x48c97d,!![]);}catch(_0x51d148){return BPromise[_0xa0b5('0x20')](_0x51d148);}return _0x593ffc[_0xa0b5('0x21')]();};}function saveUpdates(_0x5906d5,_0x18056e){return function(_0x2f2b6f){if(_0x2f2b6f){return _0x2f2b6f['update'](_0x5906d5)[_0xa0b5('0x22')](function(_0xc0e9db){return _0xc0e9db;});}return null;};}function removeEntity(_0x156146,_0x390d24){return function(_0x14718b){if(_0x14718b){return _0x14718b[_0xa0b5('0x23')]()[_0xa0b5('0x22')](function(){_0x156146['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x141d5f,_0x53103d){return function(_0x577255){if(!_0x577255){_0x141d5f[_0xa0b5('0x24')](0x194);}return _0x577255;};}function handleError(_0x3d46c9,_0xc6e863){_0xc6e863=_0xc6e863||0x1f4;return function(_0x1f833b){logger[_0xa0b5('0x25')](_0x1f833b[_0xa0b5('0x26')]);if(_0x1f833b[_0xa0b5('0x27')]){delete _0x1f833b[_0xa0b5('0x27')];}_0x3d46c9[_0xa0b5('0x18')](_0xc6e863)[_0xa0b5('0x28')](_0x1f833b);};}exports[_0xa0b5('0x29')]=function(_0x8067cd,_0xfa7be5){var _0x200502={},_0x24aa17={},_0x9dbf45={'count':0x0,'rows':[]};var _0x3ed7f3=_[_0xa0b5('0x2a')](db[_0xa0b5('0x2b')][_0xa0b5('0x2c')],function(_0x557924){return{'name':_0x557924[_0xa0b5('0x2d')],'type':_0x557924['type'][_0xa0b5('0x2e')]};});_0x24aa17[_0xa0b5('0x2f')]=_[_0xa0b5('0x2a')](_0x3ed7f3,_0xa0b5('0x27'));_0x24aa17['query']=_['keys'](_0x8067cd[_0xa0b5('0x30')]);_0x24aa17[_0xa0b5('0x31')]=_[_0xa0b5('0x32')](_0x24aa17['model'],_0x24aa17[_0xa0b5('0x30')]);_0x200502[_0xa0b5('0x33')]=_['intersection'](_0x24aa17['model'],qs[_0xa0b5('0x34')](_0x8067cd[_0xa0b5('0x30')]['fields']));_0x200502[_0xa0b5('0x33')]=_0x200502[_0xa0b5('0x33')][_0xa0b5('0x35')]?_0x200502[_0xa0b5('0x33')]:_0x24aa17[_0xa0b5('0x2f')];if(!_0x8067cd[_0xa0b5('0x30')][_0xa0b5('0x36')]('nolimit')){_0x200502[_0xa0b5('0x1d')]=qs['limit'](_0x8067cd[_0xa0b5('0x30')][_0xa0b5('0x1d')]);_0x200502[_0xa0b5('0x1c')]=qs[_0xa0b5('0x1c')](_0x8067cd[_0xa0b5('0x30')]['offset']);}_0x200502['order']=qs[_0xa0b5('0x37')](_0x8067cd[_0xa0b5('0x30')][_0xa0b5('0x37')]);_0x200502[_0xa0b5('0x38')]=qs[_0xa0b5('0x31')](_['pick'](_0x8067cd[_0xa0b5('0x30')],_0x24aa17['filters']),_0x3ed7f3);if(_0x8067cd[_0xa0b5('0x30')][_0xa0b5('0x39')]){_0x200502[_0xa0b5('0x38')]=_[_0xa0b5('0x3a')](_0x200502['where'],{'$or':_[_0xa0b5('0x2a')](_0x3ed7f3,function(_0x31ba64){if(_0x31ba64[_0xa0b5('0x3b')]!==_0xa0b5('0x3c')){var _0xed9489={};_0xed9489[_0x31ba64[_0xa0b5('0x27')]]={'$like':'%'+_0x8067cd[_0xa0b5('0x30')][_0xa0b5('0x39')]+'%'};return _0xed9489;}})});}_0x200502=_['merge']({},_0x200502,_0x8067cd['options']);var _0x216617={'where':_0x200502[_0xa0b5('0x38')]};return db[_0xa0b5('0x2b')][_0xa0b5('0x1b')](_0x216617)[_0xa0b5('0x22')](function(_0x44ea90){_0x9dbf45[_0xa0b5('0x1b')]=_0x44ea90;if(_0x8067cd[_0xa0b5('0x30')][_0xa0b5('0x3d')]){_0x200502[_0xa0b5('0x3e')]=[{'all':!![]}];}return db[_0xa0b5('0x2b')][_0xa0b5('0x3f')](_0x200502);})[_0xa0b5('0x22')](function(_0x1c3658){_0x9dbf45['rows']=_0x1c3658;return _0x9dbf45;})[_0xa0b5('0x22')](respondWithFilteredResult(_0xfa7be5,_0x200502))[_0xa0b5('0x40')](handleError(_0xfa7be5,null));};exports[_0xa0b5('0x41')]=function(_0x29dd45,_0x284bfa){var _0x2b448b={'raw':![],'where':{'id':_0x29dd45['params']['id']}},_0x1bda03={};_0x1bda03[_0xa0b5('0x2f')]=_[_0xa0b5('0x42')](db[_0xa0b5('0x2b')]['rawAttributes']);_0x1bda03[_0xa0b5('0x30')]=_[_0xa0b5('0x42')](_0x29dd45['query']);_0x1bda03[_0xa0b5('0x31')]=_[_0xa0b5('0x32')](_0x1bda03[_0xa0b5('0x2f')],_0x1bda03[_0xa0b5('0x30')]);_0x2b448b['attributes']=_[_0xa0b5('0x32')](_0x1bda03[_0xa0b5('0x2f')],qs[_0xa0b5('0x34')](_0x29dd45[_0xa0b5('0x30')]['fields']));_0x2b448b['attributes']=_0x2b448b[_0xa0b5('0x33')][_0xa0b5('0x35')]?_0x2b448b[_0xa0b5('0x33')]:_0x1bda03[_0xa0b5('0x2f')];if(_0x29dd45[_0xa0b5('0x30')]['includeAll']){_0x2b448b[_0xa0b5('0x3e')]=[{'all':!![]}];}_0x2b448b=_[_0xa0b5('0x3a')]({},_0x2b448b,_0x29dd45[_0xa0b5('0x43')]);return db[_0xa0b5('0x2b')][_0xa0b5('0x44')](_0x2b448b)['then'](handleEntityNotFound(_0x284bfa,null))[_0xa0b5('0x22')](respondWithResult(_0x284bfa,null))['catch'](handleError(_0x284bfa,null));};exports[_0xa0b5('0x45')]=function(_0x49e38b,_0x132c9b){return db[_0xa0b5('0x2b')][_0xa0b5('0x45')](_0x49e38b['body'],{})['then'](respondWithResult(_0x132c9b,0xc9))[_0xa0b5('0x40')](handleError(_0x132c9b,null));};exports['update']=function(_0x515a51,_0x1bd47a){if(_0x515a51[_0xa0b5('0x46')]['id']){delete _0x515a51[_0xa0b5('0x46')]['id'];}return db[_0xa0b5('0x2b')]['find']({'where':{'id':_0x515a51['params']['id']}})[_0xa0b5('0x22')](handleEntityNotFound(_0x1bd47a,null))[_0xa0b5('0x22')](saveUpdates(_0x515a51[_0xa0b5('0x46')],null))[_0xa0b5('0x22')](respondWithResult(_0x1bd47a,null))['catch'](handleError(_0x1bd47a,null));};exports[_0xa0b5('0x23')]=function(_0x2c0c03,_0x459e7b){return db[_0xa0b5('0x2b')]['find']({'where':{'id':_0x2c0c03['params']['id']}})[_0xa0b5('0x22')](handleEntityNotFound(_0x459e7b,null))[_0xa0b5('0x22')](removeEntity(_0x459e7b,null))[_0xa0b5('0x40')](handleError(_0x459e7b,null));};exports[_0xa0b5('0x47')]=function(_0x4fa71f,_0x3f6552,_0x1a0f3d){var _0x2d2a28={};var _0x5e699f={};var _0x11d231;var _0x1e7b47;return db[_0xa0b5('0x2b')]['findOne']({'where':{'id':_0x4fa71f[_0xa0b5('0x48')]['id']}})['then'](handleEntityNotFound(_0x3f6552,null))['then'](function(_0x2b0d4d){if(_0x2b0d4d){_0x11d231=_0x2b0d4d;_0x5e699f[_0xa0b5('0x2f')]=_[_0xa0b5('0x42')](db[_0xa0b5('0x49')][_0xa0b5('0x2c')]);_0x5e699f[_0xa0b5('0x30')]=_[_0xa0b5('0x42')](_0x4fa71f[_0xa0b5('0x30')]);_0x5e699f[_0xa0b5('0x31')]=_[_0xa0b5('0x32')](_0x5e699f[_0xa0b5('0x2f')],_0x5e699f[_0xa0b5('0x30')]);_0x2d2a28[_0xa0b5('0x33')]=_[_0xa0b5('0x32')](_0x5e699f['model'],qs[_0xa0b5('0x34')](_0x4fa71f[_0xa0b5('0x30')][_0xa0b5('0x34')]));_0x2d2a28['attributes']=_0x2d2a28[_0xa0b5('0x33')]['length']?_0x2d2a28[_0xa0b5('0x33')]:_0x5e699f[_0xa0b5('0x2f')];_0x2d2a28[_0xa0b5('0x4a')]=qs[_0xa0b5('0x37')](_0x4fa71f[_0xa0b5('0x30')][_0xa0b5('0x37')]);_0x2d2a28[_0xa0b5('0x38')]=qs[_0xa0b5('0x31')](_[_0xa0b5('0x4b')](_0x4fa71f[_0xa0b5('0x30')],_0x5e699f[_0xa0b5('0x31')]));if(_0x4fa71f[_0xa0b5('0x30')][_0xa0b5('0x39')]){_0x2d2a28[_0xa0b5('0x38')]=_[_0xa0b5('0x3a')](_0x2d2a28[_0xa0b5('0x38')],{'$or':_['map'](_0x2d2a28[_0xa0b5('0x33')],function(_0x651582){var _0x75a552={};_0x75a552[_0x651582]={'$like':'%'+_0x4fa71f[_0xa0b5('0x30')][_0xa0b5('0x39')]+'%'};return _0x75a552;})});}_0x2d2a28=_['merge']({},_0x2d2a28,_0x4fa71f['options']);return _0x11d231[_0xa0b5('0x47')](_0x2d2a28);}})['then'](function(_0x4640e8){if(_0x4640e8){_0x1e7b47=_0x4640e8[_0xa0b5('0x35')];if(!_0x4fa71f[_0xa0b5('0x30')]['hasOwnProperty']('nolimit')){_0x2d2a28['limit']=qs['limit'](_0x4fa71f[_0xa0b5('0x30')][_0xa0b5('0x1d')]);_0x2d2a28[_0xa0b5('0x1c')]=qs[_0xa0b5('0x1c')](_0x4fa71f['query'][_0xa0b5('0x1c')]);}return _0x11d231[_0xa0b5('0x47')](_0x2d2a28);}})['then'](function(_0x2a2d6b){if(_0x2a2d6b){return _0x2a2d6b?{'count':_0x1e7b47,'rows':_0x2a2d6b}:null;}})[_0xa0b5('0x22')](respondWithResult(_0x3f6552,null))[_0xa0b5('0x40')](handleError(_0x3f6552,null));};exports['getDescriptions']=function(_0x277292,_0x3db9be,_0x178038){var _0x25833f={};var _0x4532e0={};var _0x4d8831;var _0x4ec198;return db[_0xa0b5('0x2b')][_0xa0b5('0x4c')]({'where':{'id':_0x277292[_0xa0b5('0x48')]['id']}})[_0xa0b5('0x22')](handleEntityNotFound(_0x3db9be,null))['then'](function(_0x3a1b30){if(_0x3a1b30){_0x4d8831=_0x3a1b30;_0x4532e0['model']=_[_0xa0b5('0x42')](db[_0xa0b5('0x49')]['rawAttributes']);_0x4532e0['query']=_[_0xa0b5('0x42')](_0x277292[_0xa0b5('0x30')]);_0x4532e0['filters']=_['intersection'](_0x4532e0[_0xa0b5('0x2f')],_0x4532e0['query']);_0x25833f[_0xa0b5('0x33')]=_[_0xa0b5('0x32')](_0x4532e0[_0xa0b5('0x2f')],qs['fields'](_0x277292['query'][_0xa0b5('0x34')]));_0x25833f[_0xa0b5('0x33')]=_0x25833f[_0xa0b5('0x33')]['length']?_0x25833f[_0xa0b5('0x33')]:_0x4532e0[_0xa0b5('0x2f')];_0x25833f[_0xa0b5('0x4a')]=qs[_0xa0b5('0x37')](_0x277292[_0xa0b5('0x30')]['sort']);_0x25833f['where']=qs[_0xa0b5('0x31')](_[_0xa0b5('0x4b')](_0x277292['query'],_0x4532e0[_0xa0b5('0x31')]));if(_0x277292[_0xa0b5('0x30')][_0xa0b5('0x39')]){_0x25833f[_0xa0b5('0x38')]=_[_0xa0b5('0x3a')](_0x25833f[_0xa0b5('0x38')],{'$or':_[_0xa0b5('0x2a')](_0x25833f[_0xa0b5('0x33')],function(_0x14091c){var _0x30bef9={};_0x30bef9[_0x14091c]={'$like':'%'+_0x277292[_0xa0b5('0x30')][_0xa0b5('0x39')]+'%'};return _0x30bef9;})});}_0x25833f=_[_0xa0b5('0x3a')]({},_0x25833f,_0x277292[_0xa0b5('0x43')]);return _0x4d8831['getDescriptions'](_0x25833f);}})[_0xa0b5('0x22')](function(_0x4e3285){if(_0x4e3285){_0x4ec198=_0x4e3285[_0xa0b5('0x35')];if(!_0x277292[_0xa0b5('0x30')][_0xa0b5('0x36')](_0xa0b5('0x4d'))){_0x25833f[_0xa0b5('0x1d')]=qs[_0xa0b5('0x1d')](_0x277292['query'][_0xa0b5('0x1d')]);_0x25833f[_0xa0b5('0x1c')]=qs[_0xa0b5('0x1c')](_0x277292[_0xa0b5('0x30')][_0xa0b5('0x1c')]);}return _0x4d8831[_0xa0b5('0x4e')](_0x25833f);}})[_0xa0b5('0x22')](function(_0x3eb75d){if(_0x3eb75d){return _0x3eb75d?{'count':_0x4ec198,'rows':_0x3eb75d}:null;}})[_0xa0b5('0x22')](respondWithResult(_0x3db9be,null))[_0xa0b5('0x40')](handleError(_0x3db9be,null));};exports['getFields']=function(_0x3e6140,_0x188ca9,_0x246018){var _0x349e76={};var _0x1cf994={};var _0x1baa69;var _0x46d16a;return db[_0xa0b5('0x2b')]['findOne']({'where':{'id':_0x3e6140[_0xa0b5('0x48')]['id']}})[_0xa0b5('0x22')](handleEntityNotFound(_0x188ca9,null))[_0xa0b5('0x22')](function(_0x354008){if(_0x354008){_0x1baa69=_0x354008;_0x1cf994[_0xa0b5('0x2f')]=_[_0xa0b5('0x42')](db[_0xa0b5('0x49')]['rawAttributes']);_0x1cf994['query']=_[_0xa0b5('0x42')](_0x3e6140[_0xa0b5('0x30')]);_0x1cf994[_0xa0b5('0x31')]=_['intersection'](_0x1cf994[_0xa0b5('0x2f')],_0x1cf994[_0xa0b5('0x30')]);_0x349e76[_0xa0b5('0x33')]=_[_0xa0b5('0x32')](_0x1cf994[_0xa0b5('0x2f')],qs[_0xa0b5('0x34')](_0x3e6140[_0xa0b5('0x30')]['fields']));_0x349e76['attributes']=_0x349e76[_0xa0b5('0x33')][_0xa0b5('0x35')]?_0x349e76[_0xa0b5('0x33')]:_0x1cf994[_0xa0b5('0x2f')];_0x349e76['order']=qs[_0xa0b5('0x37')](_0x3e6140[_0xa0b5('0x30')][_0xa0b5('0x37')]);_0x349e76[_0xa0b5('0x38')]=qs[_0xa0b5('0x31')](_[_0xa0b5('0x4b')](_0x3e6140[_0xa0b5('0x30')],_0x1cf994[_0xa0b5('0x31')]));if(_0x3e6140[_0xa0b5('0x30')][_0xa0b5('0x39')]){_0x349e76[_0xa0b5('0x38')]=_[_0xa0b5('0x3a')](_0x349e76[_0xa0b5('0x38')],{'$or':_['map'](_0x349e76[_0xa0b5('0x33')],function(_0x241d7){var _0x163732={};_0x163732[_0x241d7]={'$like':'%'+_0x3e6140[_0xa0b5('0x30')][_0xa0b5('0x39')]+'%'};return _0x163732;})});}_0x349e76=_[_0xa0b5('0x3a')]({},_0x349e76,_0x3e6140[_0xa0b5('0x43')]);return _0x1baa69['getFields'](_0x349e76);}})[_0xa0b5('0x22')](function(_0x1a052c){if(_0x1a052c){_0x46d16a=_0x1a052c[_0xa0b5('0x35')];if(!_0x3e6140[_0xa0b5('0x30')]['hasOwnProperty'](_0xa0b5('0x4d'))){_0x349e76[_0xa0b5('0x1d')]=qs[_0xa0b5('0x1d')](_0x3e6140[_0xa0b5('0x30')]['limit']);_0x349e76[_0xa0b5('0x1c')]=qs[_0xa0b5('0x1c')](_0x3e6140['query'][_0xa0b5('0x1c')]);}return _0x1baa69['getFields'](_0x349e76);}})[_0xa0b5('0x22')](function(_0x2374b7){if(_0x2374b7){return _0x2374b7?{'count':_0x46d16a,'rows':_0x2374b7}:null;}})[_0xa0b5('0x22')](respondWithResult(_0x188ca9,null))['catch'](handleError(_0x188ca9,null));}; \ No newline at end of file +var _0xab28=['getFields','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','includeAll','include','FreshsalesConfiguration','findAll','rows','catch','show','params','options','find','create','body','getSubjects','findOne','FreshsalesField','order','pick','merge','getDescriptions'];(function(_0x4044bd,_0x390ebf){var _0x46f00f=function(_0x887ee2){while(--_0x887ee2){_0x4044bd['push'](_0x4044bd['shift']());}};_0x46f00f(++_0x390ebf);}(_0xab28,0x149));var _0x8ab2=function(_0x484cac,_0x30ad3a){_0x484cac=_0x484cac-0x0;var _0x1d6e77=_0xab28[_0x484cac];return _0x1d6e77;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ab2('0x0'));var zipdir=require(_0x8ab2('0x1'));var jsonpatch=require(_0x8ab2('0x2'));var rp=require(_0x8ab2('0x3'));var moment=require('moment');var BPromise=require(_0x8ab2('0x4'));var Mustache=require('mustache');var util=require(_0x8ab2('0x5'));var path=require(_0x8ab2('0x6'));var sox=require(_0x8ab2('0x7'));var csv=require(_0x8ab2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ab2('0x9'));var _=require(_0x8ab2('0xa'));var squel=require('squel');var crypto=require(_0x8ab2('0xb'));var jsforce=require(_0x8ab2('0xc'));var deskjs=require(_0x8ab2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8ab2('0xe'));var Papa=require('papaparse');var Redis=require(_0x8ab2('0xf'));var authService=require(_0x8ab2('0x10'));var qs=require(_0x8ab2('0x11'));var as=require(_0x8ab2('0x12'));var hardwareService=require(_0x8ab2('0x13'));var logger=require(_0x8ab2('0x14'))(_0x8ab2('0x15'));var utils=require(_0x8ab2('0x16'));var config=require(_0x8ab2('0x17'));var licenseUtil=require(_0x8ab2('0x18'));var db=require(_0x8ab2('0x19'))['db'];function respondWithStatusCode(_0x4ccb18,_0x1488e9){_0x1488e9=_0x1488e9||0xcc;return function(_0x178efb){if(_0x178efb){return _0x4ccb18[_0x8ab2('0x1a')](_0x1488e9);}return _0x4ccb18[_0x8ab2('0x1b')](_0x1488e9)[_0x8ab2('0x1c')]();};}function respondWithResult(_0x16274e,_0x4af1a9){_0x4af1a9=_0x4af1a9||0xc8;return function(_0x1ba929){if(_0x1ba929){return _0x16274e[_0x8ab2('0x1b')](_0x4af1a9)[_0x8ab2('0x1d')](_0x1ba929);}};}function respondWithFilteredResult(_0xf85999,_0xacba14){return function(_0x3114e7){if(_0x3114e7){var _0x326311=typeof _0xacba14[_0x8ab2('0x1e')]===_0x8ab2('0x1f')&&typeof _0xacba14[_0x8ab2('0x20')]===_0x8ab2('0x1f');var _0x2e8a11=_0x3114e7[_0x8ab2('0x21')];var _0x40b34f=_0x326311?0x0:_0xacba14['offset'];var _0x4cd69c=_0x326311?_0x3114e7[_0x8ab2('0x21')]:_0xacba14[_0x8ab2('0x1e')]+_0xacba14['limit'];var _0x3685f9;if(_0x4cd69c>=_0x2e8a11){_0x4cd69c=_0x2e8a11;_0x3685f9=0xc8;}else{_0x3685f9=0xce;}_0xf85999[_0x8ab2('0x1b')](_0x3685f9);return _0xf85999[_0x8ab2('0x22')]('Content-Range',_0x40b34f+'-'+_0x4cd69c+'/'+_0x2e8a11)[_0x8ab2('0x1d')](_0x3114e7);}return null;};}function patchUpdates(_0x47790a){return function(_0x15f326){try{jsonpatch[_0x8ab2('0x23')](_0x15f326,_0x47790a,!![]);}catch(_0x6aaa13){return BPromise['reject'](_0x6aaa13);}return _0x15f326[_0x8ab2('0x24')]();};}function saveUpdates(_0x50c094,_0x1dff7d){return function(_0x49eb47){if(_0x49eb47){return _0x49eb47[_0x8ab2('0x25')](_0x50c094)[_0x8ab2('0x26')](function(_0x259dcc){return _0x259dcc;});}return null;};}function removeEntity(_0xe0c61,_0x48b051){return function(_0x2cf5a2){if(_0x2cf5a2){return _0x2cf5a2[_0x8ab2('0x27')]()[_0x8ab2('0x26')](function(){_0xe0c61[_0x8ab2('0x1b')](0xcc)[_0x8ab2('0x1c')]();});}};}function handleEntityNotFound(_0x178da7,_0x3989b8){return function(_0x335187){if(!_0x335187){_0x178da7[_0x8ab2('0x1a')](0x194);}return _0x335187;};}function handleError(_0x998af0,_0x40de88){_0x40de88=_0x40de88||0x1f4;return function(_0x4a4a6b){logger['error'](_0x4a4a6b[_0x8ab2('0x28')]);if(_0x4a4a6b[_0x8ab2('0x29')]){delete _0x4a4a6b[_0x8ab2('0x29')];}_0x998af0[_0x8ab2('0x1b')](_0x40de88)[_0x8ab2('0x2a')](_0x4a4a6b);};}exports[_0x8ab2('0x2b')]=function(_0x429528,_0x3ecef4){var _0x34bade={},_0x5d0043={},_0x1261f8={'count':0x0,'rows':[]};var _0x1cd88f=_[_0x8ab2('0x2c')](db['FreshsalesConfiguration'][_0x8ab2('0x2d')],function(_0x48734a){return{'name':_0x48734a[_0x8ab2('0x2e')],'type':_0x48734a[_0x8ab2('0x2f')][_0x8ab2('0x30')]};});_0x5d0043[_0x8ab2('0x31')]=_[_0x8ab2('0x2c')](_0x1cd88f,_0x8ab2('0x29'));_0x5d0043['query']=_[_0x8ab2('0x32')](_0x429528[_0x8ab2('0x33')]);_0x5d0043[_0x8ab2('0x34')]=_[_0x8ab2('0x35')](_0x5d0043[_0x8ab2('0x31')],_0x5d0043[_0x8ab2('0x33')]);_0x34bade[_0x8ab2('0x36')]=_[_0x8ab2('0x35')](_0x5d0043[_0x8ab2('0x31')],qs[_0x8ab2('0x37')](_0x429528[_0x8ab2('0x33')]['fields']));_0x34bade[_0x8ab2('0x36')]=_0x34bade[_0x8ab2('0x36')][_0x8ab2('0x38')]?_0x34bade[_0x8ab2('0x36')]:_0x5d0043[_0x8ab2('0x31')];if(!_0x429528[_0x8ab2('0x33')][_0x8ab2('0x39')](_0x8ab2('0x3a'))){_0x34bade[_0x8ab2('0x20')]=qs[_0x8ab2('0x20')](_0x429528[_0x8ab2('0x33')]['limit']);_0x34bade[_0x8ab2('0x1e')]=qs['offset'](_0x429528[_0x8ab2('0x33')]['offset']);}_0x34bade['order']=qs[_0x8ab2('0x3b')](_0x429528[_0x8ab2('0x33')][_0x8ab2('0x3b')]);_0x34bade['where']=qs[_0x8ab2('0x34')](_['pick'](_0x429528['query'],_0x5d0043[_0x8ab2('0x34')]),_0x1cd88f);if(_0x429528['query'][_0x8ab2('0x3c')]){_0x34bade[_0x8ab2('0x3d')]=_['merge'](_0x34bade['where'],{'$or':_[_0x8ab2('0x2c')](_0x1cd88f,function(_0x3dc1ab){if(_0x3dc1ab[_0x8ab2('0x2f')]!=='VIRTUAL'){var _0x4ab459={};_0x4ab459[_0x3dc1ab[_0x8ab2('0x29')]]={'$like':'%'+_0x429528[_0x8ab2('0x33')][_0x8ab2('0x3c')]+'%'};return _0x4ab459;}})});}_0x34bade=_['merge']({},_0x34bade,_0x429528['options']);var _0x11be93={'where':_0x34bade[_0x8ab2('0x3d')]};return db['FreshsalesConfiguration'][_0x8ab2('0x21')](_0x11be93)[_0x8ab2('0x26')](function(_0x1b81a0){_0x1261f8[_0x8ab2('0x21')]=_0x1b81a0;if(_0x429528[_0x8ab2('0x33')][_0x8ab2('0x3e')]){_0x34bade[_0x8ab2('0x3f')]=[{'all':!![]}];}return db[_0x8ab2('0x40')][_0x8ab2('0x41')](_0x34bade);})['then'](function(_0x2f66cb){_0x1261f8[_0x8ab2('0x42')]=_0x2f66cb;return _0x1261f8;})[_0x8ab2('0x26')](respondWithFilteredResult(_0x3ecef4,_0x34bade))[_0x8ab2('0x43')](handleError(_0x3ecef4,null));};exports[_0x8ab2('0x44')]=function(_0x132f08,_0x482146){var _0x117133={'raw':![],'where':{'id':_0x132f08[_0x8ab2('0x45')]['id']}},_0x2d5ac3={};_0x2d5ac3[_0x8ab2('0x31')]=_[_0x8ab2('0x32')](db[_0x8ab2('0x40')][_0x8ab2('0x2d')]);_0x2d5ac3[_0x8ab2('0x33')]=_['keys'](_0x132f08[_0x8ab2('0x33')]);_0x2d5ac3[_0x8ab2('0x34')]=_['intersection'](_0x2d5ac3['model'],_0x2d5ac3['query']);_0x117133[_0x8ab2('0x36')]=_[_0x8ab2('0x35')](_0x2d5ac3[_0x8ab2('0x31')],qs[_0x8ab2('0x37')](_0x132f08['query'][_0x8ab2('0x37')]));_0x117133['attributes']=_0x117133[_0x8ab2('0x36')][_0x8ab2('0x38')]?_0x117133[_0x8ab2('0x36')]:_0x2d5ac3[_0x8ab2('0x31')];if(_0x132f08[_0x8ab2('0x33')]['includeAll']){_0x117133['include']=[{'all':!![]}];}_0x117133=_['merge']({},_0x117133,_0x132f08[_0x8ab2('0x46')]);return db['FreshsalesConfiguration'][_0x8ab2('0x47')](_0x117133)['then'](handleEntityNotFound(_0x482146,null))[_0x8ab2('0x26')](respondWithResult(_0x482146,null))['catch'](handleError(_0x482146,null));};exports['create']=function(_0x30c9c7,_0x3cf2b6){return db[_0x8ab2('0x40')][_0x8ab2('0x48')](_0x30c9c7[_0x8ab2('0x49')],{})[_0x8ab2('0x26')](respondWithResult(_0x3cf2b6,0xc9))[_0x8ab2('0x43')](handleError(_0x3cf2b6,null));};exports[_0x8ab2('0x25')]=function(_0xe006ab,_0x3a40c5){if(_0xe006ab[_0x8ab2('0x49')]['id']){delete _0xe006ab[_0x8ab2('0x49')]['id'];}return db[_0x8ab2('0x40')]['find']({'where':{'id':_0xe006ab[_0x8ab2('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a40c5,null))[_0x8ab2('0x26')](saveUpdates(_0xe006ab['body'],null))['then'](respondWithResult(_0x3a40c5,null))[_0x8ab2('0x43')](handleError(_0x3a40c5,null));};exports[_0x8ab2('0x27')]=function(_0x3cd85a,_0x4d60af){return db[_0x8ab2('0x40')][_0x8ab2('0x47')]({'where':{'id':_0x3cd85a['params']['id']}})[_0x8ab2('0x26')](handleEntityNotFound(_0x4d60af,null))[_0x8ab2('0x26')](removeEntity(_0x4d60af,null))[_0x8ab2('0x43')](handleError(_0x4d60af,null));};exports[_0x8ab2('0x4a')]=function(_0x5a9687,_0x2cbe4d,_0x741fb7){var _0x155c7e={};var _0x4c010d={};var _0x5b91dc;var _0x420582;return db[_0x8ab2('0x40')][_0x8ab2('0x4b')]({'where':{'id':_0x5a9687[_0x8ab2('0x45')]['id']}})[_0x8ab2('0x26')](handleEntityNotFound(_0x2cbe4d,null))[_0x8ab2('0x26')](function(_0x1846a0){if(_0x1846a0){_0x5b91dc=_0x1846a0;_0x4c010d[_0x8ab2('0x31')]=_[_0x8ab2('0x32')](db[_0x8ab2('0x4c')]['rawAttributes']);_0x4c010d[_0x8ab2('0x33')]=_[_0x8ab2('0x32')](_0x5a9687[_0x8ab2('0x33')]);_0x4c010d[_0x8ab2('0x34')]=_[_0x8ab2('0x35')](_0x4c010d[_0x8ab2('0x31')],_0x4c010d['query']);_0x155c7e['attributes']=_[_0x8ab2('0x35')](_0x4c010d[_0x8ab2('0x31')],qs[_0x8ab2('0x37')](_0x5a9687[_0x8ab2('0x33')][_0x8ab2('0x37')]));_0x155c7e[_0x8ab2('0x36')]=_0x155c7e[_0x8ab2('0x36')][_0x8ab2('0x38')]?_0x155c7e['attributes']:_0x4c010d[_0x8ab2('0x31')];_0x155c7e[_0x8ab2('0x4d')]=qs['sort'](_0x5a9687[_0x8ab2('0x33')][_0x8ab2('0x3b')]);_0x155c7e[_0x8ab2('0x3d')]=qs[_0x8ab2('0x34')](_[_0x8ab2('0x4e')](_0x5a9687[_0x8ab2('0x33')],_0x4c010d['filters']));if(_0x5a9687[_0x8ab2('0x33')][_0x8ab2('0x3c')]){_0x155c7e[_0x8ab2('0x3d')]=_[_0x8ab2('0x4f')](_0x155c7e['where'],{'$or':_[_0x8ab2('0x2c')](_0x155c7e[_0x8ab2('0x36')],function(_0x5df5df){var _0x174d4e={};_0x174d4e[_0x5df5df]={'$like':'%'+_0x5a9687[_0x8ab2('0x33')]['filter']+'%'};return _0x174d4e;})});}_0x155c7e=_[_0x8ab2('0x4f')]({},_0x155c7e,_0x5a9687[_0x8ab2('0x46')]);return _0x5b91dc['getSubjects'](_0x155c7e);}})[_0x8ab2('0x26')](function(_0x31093){if(_0x31093){_0x420582=_0x31093[_0x8ab2('0x38')];if(!_0x5a9687[_0x8ab2('0x33')][_0x8ab2('0x39')](_0x8ab2('0x3a'))){_0x155c7e[_0x8ab2('0x20')]=qs[_0x8ab2('0x20')](_0x5a9687[_0x8ab2('0x33')][_0x8ab2('0x20')]);_0x155c7e[_0x8ab2('0x1e')]=qs[_0x8ab2('0x1e')](_0x5a9687[_0x8ab2('0x33')][_0x8ab2('0x1e')]);}return _0x5b91dc['getSubjects'](_0x155c7e);}})['then'](function(_0x4b7159){if(_0x4b7159){return _0x4b7159?{'count':_0x420582,'rows':_0x4b7159}:null;}})[_0x8ab2('0x26')](respondWithResult(_0x2cbe4d,null))[_0x8ab2('0x43')](handleError(_0x2cbe4d,null));};exports[_0x8ab2('0x50')]=function(_0x5c267d,_0x236aa2,_0x7ee337){var _0x51af09={};var _0xb4a300={};var _0x4737ec;var _0x4b4fc2;return db[_0x8ab2('0x40')][_0x8ab2('0x4b')]({'where':{'id':_0x5c267d['params']['id']}})[_0x8ab2('0x26')](handleEntityNotFound(_0x236aa2,null))['then'](function(_0x41ea30){if(_0x41ea30){_0x4737ec=_0x41ea30;_0xb4a300[_0x8ab2('0x31')]=_['keys'](db[_0x8ab2('0x4c')]['rawAttributes']);_0xb4a300[_0x8ab2('0x33')]=_['keys'](_0x5c267d[_0x8ab2('0x33')]);_0xb4a300[_0x8ab2('0x34')]=_[_0x8ab2('0x35')](_0xb4a300['model'],_0xb4a300['query']);_0x51af09[_0x8ab2('0x36')]=_[_0x8ab2('0x35')](_0xb4a300[_0x8ab2('0x31')],qs[_0x8ab2('0x37')](_0x5c267d[_0x8ab2('0x33')]['fields']));_0x51af09[_0x8ab2('0x36')]=_0x51af09[_0x8ab2('0x36')][_0x8ab2('0x38')]?_0x51af09[_0x8ab2('0x36')]:_0xb4a300[_0x8ab2('0x31')];_0x51af09[_0x8ab2('0x4d')]=qs[_0x8ab2('0x3b')](_0x5c267d['query'][_0x8ab2('0x3b')]);_0x51af09[_0x8ab2('0x3d')]=qs[_0x8ab2('0x34')](_['pick'](_0x5c267d[_0x8ab2('0x33')],_0xb4a300[_0x8ab2('0x34')]));if(_0x5c267d[_0x8ab2('0x33')][_0x8ab2('0x3c')]){_0x51af09[_0x8ab2('0x3d')]=_[_0x8ab2('0x4f')](_0x51af09[_0x8ab2('0x3d')],{'$or':_[_0x8ab2('0x2c')](_0x51af09[_0x8ab2('0x36')],function(_0x38651b){var _0x962353={};_0x962353[_0x38651b]={'$like':'%'+_0x5c267d[_0x8ab2('0x33')][_0x8ab2('0x3c')]+'%'};return _0x962353;})});}_0x51af09=_[_0x8ab2('0x4f')]({},_0x51af09,_0x5c267d[_0x8ab2('0x46')]);return _0x4737ec['getDescriptions'](_0x51af09);}})[_0x8ab2('0x26')](function(_0x5c1b6f){if(_0x5c1b6f){_0x4b4fc2=_0x5c1b6f[_0x8ab2('0x38')];if(!_0x5c267d['query']['hasOwnProperty'](_0x8ab2('0x3a'))){_0x51af09[_0x8ab2('0x20')]=qs[_0x8ab2('0x20')](_0x5c267d[_0x8ab2('0x33')][_0x8ab2('0x20')]);_0x51af09[_0x8ab2('0x1e')]=qs[_0x8ab2('0x1e')](_0x5c267d[_0x8ab2('0x33')]['offset']);}return _0x4737ec['getDescriptions'](_0x51af09);}})[_0x8ab2('0x26')](function(_0x3acf28){if(_0x3acf28){return _0x3acf28?{'count':_0x4b4fc2,'rows':_0x3acf28}:null;}})[_0x8ab2('0x26')](respondWithResult(_0x236aa2,null))[_0x8ab2('0x43')](handleError(_0x236aa2,null));};exports[_0x8ab2('0x51')]=function(_0x2bcef3,_0x575385,_0x55b42f){var _0x4218cc={};var _0x438908={};var _0x3f4dae;var _0x15c1cf;return db[_0x8ab2('0x40')][_0x8ab2('0x4b')]({'where':{'id':_0x2bcef3[_0x8ab2('0x45')]['id']}})[_0x8ab2('0x26')](handleEntityNotFound(_0x575385,null))[_0x8ab2('0x26')](function(_0x30bb2a){if(_0x30bb2a){_0x3f4dae=_0x30bb2a;_0x438908[_0x8ab2('0x31')]=_['keys'](db['FreshsalesField'][_0x8ab2('0x2d')]);_0x438908[_0x8ab2('0x33')]=_[_0x8ab2('0x32')](_0x2bcef3['query']);_0x438908['filters']=_['intersection'](_0x438908['model'],_0x438908['query']);_0x4218cc['attributes']=_[_0x8ab2('0x35')](_0x438908['model'],qs[_0x8ab2('0x37')](_0x2bcef3[_0x8ab2('0x33')]['fields']));_0x4218cc[_0x8ab2('0x36')]=_0x4218cc[_0x8ab2('0x36')][_0x8ab2('0x38')]?_0x4218cc[_0x8ab2('0x36')]:_0x438908[_0x8ab2('0x31')];_0x4218cc[_0x8ab2('0x4d')]=qs[_0x8ab2('0x3b')](_0x2bcef3[_0x8ab2('0x33')][_0x8ab2('0x3b')]);_0x4218cc[_0x8ab2('0x3d')]=qs['filters'](_['pick'](_0x2bcef3['query'],_0x438908[_0x8ab2('0x34')]));if(_0x2bcef3[_0x8ab2('0x33')][_0x8ab2('0x3c')]){_0x4218cc[_0x8ab2('0x3d')]=_['merge'](_0x4218cc[_0x8ab2('0x3d')],{'$or':_[_0x8ab2('0x2c')](_0x4218cc[_0x8ab2('0x36')],function(_0x4692e5){var _0x164998={};_0x164998[_0x4692e5]={'$like':'%'+_0x2bcef3['query']['filter']+'%'};return _0x164998;})});}_0x4218cc=_[_0x8ab2('0x4f')]({},_0x4218cc,_0x2bcef3[_0x8ab2('0x46')]);return _0x3f4dae[_0x8ab2('0x51')](_0x4218cc);}})[_0x8ab2('0x26')](function(_0x28aa2e){if(_0x28aa2e){_0x15c1cf=_0x28aa2e['length'];if(!_0x2bcef3['query'][_0x8ab2('0x39')](_0x8ab2('0x3a'))){_0x4218cc[_0x8ab2('0x20')]=qs[_0x8ab2('0x20')](_0x2bcef3[_0x8ab2('0x33')]['limit']);_0x4218cc[_0x8ab2('0x1e')]=qs[_0x8ab2('0x1e')](_0x2bcef3['query']['offset']);}return _0x3f4dae[_0x8ab2('0x51')](_0x4218cc);}})[_0x8ab2('0x26')](function(_0x315187){if(_0x315187){return _0x315187?{'count':_0x15c1cf,'rows':_0x315187}:null;}})[_0x8ab2('0x26')](respondWithResult(_0x575385,null))[_0x8ab2('0x43')](handleError(_0x575385,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 6d7056a..d2dc900 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 _0x9b9d=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','int_freshsales_configurations','lodash'];(function(_0x50a463,_0x517a1a){var _0x2971df=function(_0x1f9cf1){while(--_0x1f9cf1){_0x50a463['push'](_0x50a463['shift']());}};_0x2971df(++_0x517a1a);}(_0x9b9d,0x18b));var _0xd9b9=function(_0x1fd3e2,_0x1a6772){_0x1fd3e2=_0x1fd3e2-0x0;var _0x5a9210=_0x9b9d[_0x1fd3e2];return _0x5a9210;};'use strict';var _=require(_0xd9b9('0x0'));var util=require(_0xd9b9('0x1'));var logger=require(_0xd9b9('0x2'))(_0xd9b9('0x3'));var moment=require(_0xd9b9('0x4'));var BPromise=require(_0xd9b9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9b9('0x6'));var rimraf=require(_0xd9b9('0x7'));var config=require(_0xd9b9('0x8'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xd9b9('0x9')]=function(_0x37d5c8,_0x301b46){return _0x37d5c8[_0xd9b9('0xa')]('FreshsalesConfiguration',attributes,{'tableName':_0xd9b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffc8=['FreshsalesConfiguration','int_freshsales_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','./intFreshsalesConfiguration.attributes','exports'];(function(_0x120404,_0x9fc558){var _0x11956a=function(_0x2c4467){while(--_0x2c4467){_0x120404['push'](_0x120404['shift']());}};_0x11956a(++_0x9fc558);}(_0xffc8,0x86));var _0x8ffc=function(_0x11957a,_0x41b53d){_0x11957a=_0x11957a-0x0;var _0x41f840=_0xffc8[_0x11957a];return _0x41f840;};'use strict';var _=require('lodash');var util=require(_0x8ffc('0x0'));var logger=require(_0x8ffc('0x1'))(_0x8ffc('0x2'));var moment=require(_0x8ffc('0x3'));var BPromise=require(_0x8ffc('0x4'));var rp=require(_0x8ffc('0x5'));var fs=require('fs');var path=require(_0x8ffc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8ffc('0x7'));module[_0x8ffc('0x8')]=function(_0x23bfdb,_0x240dda){return _0x23bfdb['define'](_0x8ffc('0x9'),attributes,{'tableName':_0x8ffc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index ed73f8a..af7d00a 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 _0x7bf4=['info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x7bf4,0x15c));var _0x47bf=function(_0x2915ee,_0x25447b){_0x2915ee=_0x2915ee-0x0;var _0x332d00=_0x7bf4[_0x2915ee];return _0x332d00;};'use strict';var _=require('lodash');var util=require(_0x47bf('0x0'));var moment=require('moment');var BPromise=require(_0x47bf('0x1'));var rs=require(_0x47bf('0x2'));var fs=require('fs');var Redis=require(_0x47bf('0x3'));var db=require(_0x47bf('0x4'))['db'];var utils=require(_0x47bf('0x5'));var logger=require(_0x47bf('0x6'))(_0x47bf('0x7'));var config=require(_0x47bf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x47bf('0x9')][_0x47bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38dc97,_0x28a8a5,_0x2a2fe6){return new BPromise(function(_0x4271cd,_0x22536d){return client[_0x47bf('0xb')](_0x38dc97,_0x2a2fe6)['then'](function(_0x2ce0d6){logger[_0x47bf('0xc')](_0x47bf('0xd'),_0x28a8a5,_0x47bf('0xe'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x28a8a5,_0x47bf('0xe'),JSON[_0x47bf('0xf')](_0x2ce0d6));if(_0x2ce0d6[_0x47bf('0x10')]){if(_0x2ce0d6[_0x47bf('0x10')]['code']===0x1f4){logger[_0x47bf('0x10')](_0x47bf('0xd'),_0x28a8a5,_0x2ce0d6[_0x47bf('0x10')]['message']);return _0x22536d(_0x2ce0d6['error'][_0x47bf('0x11')]);}logger['error'](_0x47bf('0xd'),_0x28a8a5,_0x2ce0d6[_0x47bf('0x10')]['message']);return _0x4271cd(_0x2ce0d6[_0x47bf('0x10')][_0x47bf('0x11')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x28a8a5,'request\x20sent');_0x4271cd(_0x2ce0d6[_0x47bf('0x12')][_0x47bf('0x11')]);}})[_0x47bf('0x13')](function(_0x3ae2f8){logger[_0x47bf('0x10')](_0x47bf('0xd'),_0x28a8a5,_0x3ae2f8);_0x22536d(_0x3ae2f8);});});} \ No newline at end of file +var _0x6b94=['rpc','../../config/environment','client','request','info','request\x20sent','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xbd6f8e,_0x10c174){var _0x57b158=function(_0x4ccfaa){while(--_0x4ccfaa){_0xbd6f8e['push'](_0xbd6f8e['shift']());}};_0x57b158(++_0x10c174);}(_0x6b94,0xd1));var _0x46b9=function(_0x280551,_0x3e9b84){_0x280551=_0x280551-0x0;var _0x1f0ad2=_0x6b94[_0x280551];return _0x1f0ad2;};'use strict';var _=require('lodash');var util=require(_0x46b9('0x0'));var moment=require(_0x46b9('0x1'));var BPromise=require(_0x46b9('0x2'));var rs=require(_0x46b9('0x3'));var fs=require('fs');var Redis=require(_0x46b9('0x4'));var db=require(_0x46b9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x46b9('0x6'))(_0x46b9('0x7'));var config=require(_0x46b9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46b9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x257ff1,_0x320eb2,_0x3eed05){return new BPromise(function(_0x450198,_0x310ddf){return client[_0x46b9('0xa')](_0x257ff1,_0x3eed05)['then'](function(_0x458d5f){logger[_0x46b9('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x320eb2,_0x46b9('0xc'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x320eb2,'request\x20sent',JSON['stringify'](_0x458d5f));if(_0x458d5f[_0x46b9('0xd')]){if(_0x458d5f[_0x46b9('0xd')][_0x46b9('0xe')]===0x1f4){logger[_0x46b9('0xd')](_0x46b9('0xf'),_0x320eb2,_0x458d5f[_0x46b9('0xd')]['message']);return _0x310ddf(_0x458d5f[_0x46b9('0xd')][_0x46b9('0x10')]);}logger[_0x46b9('0xd')](_0x46b9('0xf'),_0x320eb2,_0x458d5f[_0x46b9('0xd')]['message']);return _0x450198(_0x458d5f['error'][_0x46b9('0x10')]);}else{logger['info'](_0x46b9('0xf'),_0x320eb2,_0x46b9('0xc'));_0x450198(_0x458d5f['result'][_0x46b9('0x10')]);}})[_0x46b9('0x11')](function(_0x441125){logger[_0x46b9('0xd')](_0x46b9('0xf'),_0x320eb2,_0x441125);_0x310ddf(_0x441125);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 2716fa0..931748d 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 _0xa1fd=['create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x10d463,_0x4e16e4){var _0x4600de=function(_0x297d18){while(--_0x297d18){_0x10d463['push'](_0x10d463['shift']());}};_0x4600de(++_0x4e16e4);}(_0xa1fd,0x1b9));var _0xda1f=function(_0xd3fee5,_0x1428b5){_0xd3fee5=_0xd3fee5-0x0;var _0xb7815a=_0xa1fd[_0xd3fee5];return _0xb7815a;};'use strict';var multer=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var path=require(_0xda1f('0x2'));var timeout=require(_0xda1f('0x3'));var express=require('express');var router=express[_0xda1f('0x4')]();var fs_extra=require(_0xda1f('0x5'));var auth=require(_0xda1f('0x6'));var interaction=require(_0xda1f('0x7'));var config=require(_0xda1f('0x8'));var controller=require('./intFreshsalesField.controller');router[_0xda1f('0x9')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xb')]);router['get'](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0xd')]);router[_0xda1f('0xe')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xf')]);router[_0xda1f('0x10')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller['update']);router[_0xda1f('0x11')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc3b0=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer','util'];(function(_0x55cf03,_0x51dd3f){var _0x194f78=function(_0xb4320d){while(--_0xb4320d){_0x55cf03['push'](_0x55cf03['shift']());}};_0x194f78(++_0x51dd3f);}(_0xc3b0,0x166));var _0x0c3b=function(_0x4aef3d,_0x4a8847){_0x4aef3d=_0x4aef3d-0x0;var _0xbe1a42=_0xc3b0[_0x4aef3d];return _0xbe1a42;};'use strict';var multer=require(_0x0c3b('0x0'));var util=require(_0x0c3b('0x1'));var path=require(_0x0c3b('0x2'));var timeout=require(_0x0c3b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0c3b('0x4'));var auth=require(_0x0c3b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0c3b('0x6'));var controller=require(_0x0c3b('0x7'));router[_0x0c3b('0x8')]('/',auth['isAuthenticated'](),controller[_0x0c3b('0x9')]);router[_0x0c3b('0x8')](_0x0c3b('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x0c3b('0xb')](),controller[_0x0c3b('0xc')]);router[_0x0c3b('0xd')](_0x0c3b('0xa'),auth[_0x0c3b('0xb')](),controller[_0x0c3b('0xe')]);router[_0x0c3b('0xf')](_0x0c3b('0xa'),auth[_0x0c3b('0xb')](),controller[_0x0c3b('0x10')]);module[_0x0c3b('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 7ee50b2..ec242c5 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 _0xe9e6=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','exports'];(function(_0x1c55f1,_0x3669ca){var _0x44dd27=function(_0x531d3e){while(--_0x531d3e){_0x1c55f1['push'](_0x1c55f1['shift']());}};_0x44dd27(++_0x3669ca);}(_0xe9e6,0xef));var _0x6e9e=function(_0x26bafe,_0x13e506){_0x26bafe=_0x26bafe-0x0;var _0x307879=_0xe9e6[_0x26bafe];return _0x307879;};'use strict';var Sequelize=require('sequelize');module[_0x6e9e('0x0')]={'type':{'type':Sequelize[_0x6e9e('0x1')]('string',_0x6e9e('0x2'),_0x6e9e('0x3'),_0x6e9e('0x4'),_0x6e9e('0x5')),'defaultValue':_0x6e9e('0x6')},'content':{'type':Sequelize[_0x6e9e('0x7')]},'key':{'type':Sequelize[_0x6e9e('0x7')]},'keyType':{'type':Sequelize[_0x6e9e('0x1')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x6e9e('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x05f2=['sequelize','exports','string','keyValue','ENUM','customVariable','STRING','BOOLEAN'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x05f2,0x140));var _0x205f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x05f2[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x205f('0x0'));module[_0x205f('0x1')]={'type':{'type':Sequelize['ENUM'](_0x205f('0x2'),'variable','customVariable',_0x205f('0x3'),'picklist'),'defaultValue':_0x205f('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x205f('0x4')](_0x205f('0x2'),'variable',_0x205f('0x5'))},'keyContent':{'type':Sequelize[_0x205f('0x6')]},'idField':{'type':Sequelize[_0x205f('0x6')]},'nameField':{'type':Sequelize[_0x205f('0x6')]},'customField':{'type':Sequelize[_0x205f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x205f('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index c01e857..795c830 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 _0x66e7=['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/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','stack','send','map','FreshsalesField','fieldName','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','rows','catch','params','rawAttributes','include','find','create','body','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox'];(function(_0x1297b7,_0x39a9d4){var _0x5d7dfa=function(_0x25b156){while(--_0x25b156){_0x1297b7['push'](_0x1297b7['shift']());}};_0x5d7dfa(++_0x39a9d4);}(_0x66e7,0x161));var _0x766e=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x66e7[_0x1762b4];return _0x29beda;};'use strict';var emlformat=require(_0x766e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x766e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x766e('0x2'));var moment=require('moment');var BPromise=require(_0x766e('0x3'));var Mustache=require(_0x766e('0x4'));var util=require('util');var path=require(_0x766e('0x5'));var sox=require(_0x766e('0x6'));var csv=require(_0x766e('0x7'));var ejs=require(_0x766e('0x8'));var fs=require('fs');var fs_extra=require(_0x766e('0x9'));var _=require(_0x766e('0xa'));var squel=require(_0x766e('0xb'));var crypto=require(_0x766e('0xc'));var jsforce=require(_0x766e('0xd'));var deskjs=require(_0x766e('0xe'));var toCsv=require(_0x766e('0x7'));var querystring=require('querystring');var Papa=require(_0x766e('0xf'));var Redis=require(_0x766e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x766e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x766e('0x12'));var logger=require(_0x766e('0x13'))(_0x766e('0x14'));var utils=require(_0x766e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x766e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ae180,_0x58a7f3){_0x58a7f3=_0x58a7f3||0xcc;return function(_0x8e2f8f){if(_0x8e2f8f){return _0x3ae180[_0x766e('0x17')](_0x58a7f3);}return _0x3ae180[_0x766e('0x18')](_0x58a7f3)[_0x766e('0x19')]();};}function respondWithResult(_0x32c1f5,_0x32581c){_0x32581c=_0x32581c||0xc8;return function(_0x1db4da){if(_0x1db4da){return _0x32c1f5[_0x766e('0x18')](_0x32581c)[_0x766e('0x1a')](_0x1db4da);}};}function respondWithFilteredResult(_0x483779,_0x55d1b9){return function(_0x2fd682){if(_0x2fd682){var _0x5685e7=typeof _0x55d1b9[_0x766e('0x1b')]===_0x766e('0x1c')&&typeof _0x55d1b9[_0x766e('0x1d')]===_0x766e('0x1c');var _0x2a0264=_0x2fd682[_0x766e('0x1e')];var _0x75894b=_0x5685e7?0x0:_0x55d1b9['offset'];var _0x45dfa1=_0x5685e7?_0x2fd682['count']:_0x55d1b9[_0x766e('0x1b')]+_0x55d1b9[_0x766e('0x1d')];var _0x27e5cb;if(_0x45dfa1>=_0x2a0264){_0x45dfa1=_0x2a0264;_0x27e5cb=0xc8;}else{_0x27e5cb=0xce;}_0x483779[_0x766e('0x18')](_0x27e5cb);return _0x483779['set'](_0x766e('0x1f'),_0x75894b+'-'+_0x45dfa1+'/'+_0x2a0264)[_0x766e('0x1a')](_0x2fd682);}return null;};}function patchUpdates(_0x4100a9){return function(_0x29e09c){try{jsonpatch[_0x766e('0x20')](_0x29e09c,_0x4100a9,!![]);}catch(_0x366549){return BPromise[_0x766e('0x21')](_0x366549);}return _0x29e09c['save']();};}function saveUpdates(_0x356f73,_0x48dc7e){return function(_0x59e06a){if(_0x59e06a){return _0x59e06a[_0x766e('0x22')](_0x356f73)['then'](function(_0x5884ec){return _0x5884ec;});}return null;};}function removeEntity(_0x59f6c6,_0x1b3ec1){return function(_0x36ac73){if(_0x36ac73){return _0x36ac73[_0x766e('0x23')]()[_0x766e('0x24')](function(){_0x59f6c6[_0x766e('0x18')](0xcc)[_0x766e('0x19')]();});}};}function handleEntityNotFound(_0x2603d9,_0xc0fae0){return function(_0x478a13){if(!_0x478a13){_0x2603d9[_0x766e('0x17')](0x194);}return _0x478a13;};}function handleError(_0xcfc870,_0x2026cf){_0x2026cf=_0x2026cf||0x1f4;return function(_0x414174){logger[_0x766e('0x25')](_0x414174[_0x766e('0x26')]);if(_0x414174['name']){delete _0x414174['name'];}_0xcfc870[_0x766e('0x18')](_0x2026cf)[_0x766e('0x27')](_0x414174);};}exports['index']=function(_0x42a326,_0x1181cc){var _0x43ae5c={},_0x17cb7c={},_0x2a18c2={'count':0x0,'rows':[]};var _0x4579d5=_[_0x766e('0x28')](db[_0x766e('0x29')]['rawAttributes'],function(_0x210808){return{'name':_0x210808[_0x766e('0x2a')],'type':_0x210808['type'][_0x766e('0x2b')]};});_0x17cb7c[_0x766e('0x2c')]=_[_0x766e('0x28')](_0x4579d5,_0x766e('0x2d'));_0x17cb7c[_0x766e('0x2e')]=_[_0x766e('0x2f')](_0x42a326[_0x766e('0x2e')]);_0x17cb7c['filters']=_[_0x766e('0x30')](_0x17cb7c[_0x766e('0x2c')],_0x17cb7c['query']);_0x43ae5c['attributes']=_[_0x766e('0x30')](_0x17cb7c[_0x766e('0x2c')],qs[_0x766e('0x31')](_0x42a326[_0x766e('0x2e')][_0x766e('0x31')]));_0x43ae5c[_0x766e('0x32')]=_0x43ae5c[_0x766e('0x32')][_0x766e('0x33')]?_0x43ae5c[_0x766e('0x32')]:_0x17cb7c['model'];if(!_0x42a326['query'][_0x766e('0x34')](_0x766e('0x35'))){_0x43ae5c[_0x766e('0x1d')]=qs['limit'](_0x42a326[_0x766e('0x2e')][_0x766e('0x1d')]);_0x43ae5c[_0x766e('0x1b')]=qs['offset'](_0x42a326[_0x766e('0x2e')][_0x766e('0x1b')]);}_0x43ae5c[_0x766e('0x36')]=qs['sort'](_0x42a326[_0x766e('0x2e')]['sort']);_0x43ae5c['where']=qs[_0x766e('0x37')](_[_0x766e('0x38')](_0x42a326['query'],_0x17cb7c['filters']),_0x4579d5);if(_0x42a326['query'][_0x766e('0x39')]){_0x43ae5c[_0x766e('0x3a')]=_[_0x766e('0x3b')](_0x43ae5c[_0x766e('0x3a')],{'$or':_[_0x766e('0x28')](_0x4579d5,function(_0x9d1727){if(_0x9d1727[_0x766e('0x3c')]!==_0x766e('0x3d')){var _0xb38336={};_0xb38336[_0x9d1727[_0x766e('0x2d')]]={'$like':'%'+_0x42a326[_0x766e('0x2e')][_0x766e('0x39')]+'%'};return _0xb38336;}})});}_0x43ae5c=_[_0x766e('0x3b')]({},_0x43ae5c,_0x42a326[_0x766e('0x3e')]);var _0x157379={'where':_0x43ae5c[_0x766e('0x3a')]};return db[_0x766e('0x29')]['count'](_0x157379)[_0x766e('0x24')](function(_0x3ec4a9){_0x2a18c2['count']=_0x3ec4a9;if(_0x42a326[_0x766e('0x2e')][_0x766e('0x3f')]){_0x43ae5c['include']=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x43ae5c);})[_0x766e('0x24')](function(_0x10a4fe){_0x2a18c2[_0x766e('0x40')]=_0x10a4fe;return _0x2a18c2;})[_0x766e('0x24')](respondWithFilteredResult(_0x1181cc,_0x43ae5c))[_0x766e('0x41')](handleError(_0x1181cc,null));};exports['show']=function(_0x11f40c,_0x11ae27){var _0x21d46a={'raw':!![],'where':{'id':_0x11f40c[_0x766e('0x42')]['id']}},_0x301c05={};_0x301c05[_0x766e('0x2c')]=_[_0x766e('0x2f')](db['FreshsalesField'][_0x766e('0x43')]);_0x301c05['query']=_[_0x766e('0x2f')](_0x11f40c[_0x766e('0x2e')]);_0x301c05[_0x766e('0x37')]=_[_0x766e('0x30')](_0x301c05[_0x766e('0x2c')],_0x301c05[_0x766e('0x2e')]);_0x21d46a[_0x766e('0x32')]=_[_0x766e('0x30')](_0x301c05[_0x766e('0x2c')],qs[_0x766e('0x31')](_0x11f40c[_0x766e('0x2e')][_0x766e('0x31')]));_0x21d46a[_0x766e('0x32')]=_0x21d46a[_0x766e('0x32')][_0x766e('0x33')]?_0x21d46a['attributes']:_0x301c05[_0x766e('0x2c')];if(_0x11f40c['query'][_0x766e('0x3f')]){_0x21d46a[_0x766e('0x44')]=[{'all':!![]}];}_0x21d46a=_[_0x766e('0x3b')]({},_0x21d46a,_0x11f40c[_0x766e('0x3e')]);return db[_0x766e('0x29')][_0x766e('0x45')](_0x21d46a)[_0x766e('0x24')](handleEntityNotFound(_0x11ae27,null))[_0x766e('0x24')](respondWithResult(_0x11ae27,null))[_0x766e('0x41')](handleError(_0x11ae27,null));};exports[_0x766e('0x46')]=function(_0x1d12b3,_0x49ea20){return db[_0x766e('0x29')][_0x766e('0x46')](_0x1d12b3[_0x766e('0x47')],{})['then'](respondWithResult(_0x49ea20,0xc9))[_0x766e('0x41')](handleError(_0x49ea20,null));};exports['update']=function(_0x3c89bd,_0x3ad7ba){if(_0x3c89bd[_0x766e('0x47')]['id']){delete _0x3c89bd[_0x766e('0x47')]['id'];}return db[_0x766e('0x29')][_0x766e('0x45')]({'where':{'id':_0x3c89bd['params']['id']}})[_0x766e('0x24')](handleEntityNotFound(_0x3ad7ba,null))[_0x766e('0x24')](saveUpdates(_0x3c89bd[_0x766e('0x47')],null))[_0x766e('0x24')](respondWithResult(_0x3ad7ba,null))[_0x766e('0x41')](handleError(_0x3ad7ba,null));};exports[_0x766e('0x23')]=function(_0x5a0b76,_0x4641db){return db['FreshsalesField']['find']({'where':{'id':_0x5a0b76[_0x766e('0x42')]['id']}})[_0x766e('0x24')](handleEntityNotFound(_0x4641db,null))[_0x766e('0x24')](removeEntity(_0x4641db,null))[_0x766e('0x41')](handleError(_0x4641db,null));}; \ No newline at end of file +var _0x022a=['apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','FreshsalesField','includeAll','include','findAll','show','params','rawAttributes','options','find','catch','create','body','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','limit','count','offset','status','Content-Range'];(function(_0xc82040,_0x549217){var _0x249098=function(_0x4cfe83){while(--_0x4cfe83){_0xc82040['push'](_0xc82040['shift']());}};_0x249098(++_0x549217);}(_0x022a,0x108));var _0xa022=function(_0x2aa22d,_0x375edf){_0x2aa22d=_0x2aa22d-0x0;var _0x683fa5=_0x022a[_0x2aa22d];return _0x683fa5;};'use strict';var emlformat=require(_0xa022('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa022('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa022('0x2'));var moment=require('moment');var BPromise=require(_0xa022('0x3'));var Mustache=require(_0xa022('0x4'));var util=require(_0xa022('0x5'));var path=require(_0xa022('0x6'));var sox=require(_0xa022('0x7'));var csv=require(_0xa022('0x8'));var ejs=require(_0xa022('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa022('0xa'));var jsforce=require(_0xa022('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa022('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa022('0xc'));var authService=require(_0xa022('0xd'));var qs=require(_0xa022('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa022('0xf'));var logger=require(_0xa022('0x10'))(_0xa022('0x11'));var utils=require(_0xa022('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa022('0x13'));var db=require(_0xa022('0x14'))['db'];function respondWithStatusCode(_0x103167,_0x1d15b9){_0x1d15b9=_0x1d15b9||0xcc;return function(_0x276c61){if(_0x276c61){return _0x103167[_0xa022('0x15')](_0x1d15b9);}return _0x103167['status'](_0x1d15b9)['end']();};}function respondWithResult(_0x3da05e,_0x56996e){_0x56996e=_0x56996e||0xc8;return function(_0x48dcf3){if(_0x48dcf3){return _0x3da05e['status'](_0x56996e)[_0xa022('0x16')](_0x48dcf3);}};}function respondWithFilteredResult(_0x1ff7ed,_0x24150d){return function(_0xbae931){if(_0xbae931){var _0x237f9e=typeof _0x24150d['offset']==='undefined'&&typeof _0x24150d[_0xa022('0x17')]==='undefined';var _0xc87f23=_0xbae931[_0xa022('0x18')];var _0x5641c0=_0x237f9e?0x0:_0x24150d[_0xa022('0x19')];var _0x55ce4b=_0x237f9e?_0xbae931[_0xa022('0x18')]:_0x24150d[_0xa022('0x19')]+_0x24150d[_0xa022('0x17')];var _0x25707c;if(_0x55ce4b>=_0xc87f23){_0x55ce4b=_0xc87f23;_0x25707c=0xc8;}else{_0x25707c=0xce;}_0x1ff7ed[_0xa022('0x1a')](_0x25707c);return _0x1ff7ed['set'](_0xa022('0x1b'),_0x5641c0+'-'+_0x55ce4b+'/'+_0xc87f23)[_0xa022('0x16')](_0xbae931);}return null;};}function patchUpdates(_0x1ee183){return function(_0x4b82f3){try{jsonpatch[_0xa022('0x1c')](_0x4b82f3,_0x1ee183,!![]);}catch(_0x554abe){return BPromise[_0xa022('0x1d')](_0x554abe);}return _0x4b82f3[_0xa022('0x1e')]();};}function saveUpdates(_0x1a0cd5,_0x3caa97){return function(_0x539aa0){if(_0x539aa0){return _0x539aa0[_0xa022('0x1f')](_0x1a0cd5)[_0xa022('0x20')](function(_0x1bb280){return _0x1bb280;});}return null;};}function removeEntity(_0x43fe5c,_0x21c20a){return function(_0xe81a00){if(_0xe81a00){return _0xe81a00[_0xa022('0x21')]()[_0xa022('0x20')](function(){_0x43fe5c[_0xa022('0x1a')](0xcc)[_0xa022('0x22')]();});}};}function handleEntityNotFound(_0x55d48e,_0x258435){return function(_0x324929){if(!_0x324929){_0x55d48e[_0xa022('0x15')](0x194);}return _0x324929;};}function handleError(_0x453a9a,_0x417280){_0x417280=_0x417280||0x1f4;return function(_0x5f13e8){logger[_0xa022('0x23')](_0x5f13e8[_0xa022('0x24')]);if(_0x5f13e8[_0xa022('0x25')]){delete _0x5f13e8[_0xa022('0x25')];}_0x453a9a['status'](_0x417280)[_0xa022('0x26')](_0x5f13e8);};}exports[_0xa022('0x27')]=function(_0x4a4e83,_0x5668b4){var _0x8331c7={},_0x1b0025={},_0x328f72={'count':0x0,'rows':[]};var _0x18217b=_[_0xa022('0x28')](db['FreshsalesField']['rawAttributes'],function(_0xfd33aa){return{'name':_0xfd33aa[_0xa022('0x29')],'type':_0xfd33aa[_0xa022('0x2a')][_0xa022('0x2b')]};});_0x1b0025[_0xa022('0x2c')]=_[_0xa022('0x28')](_0x18217b,_0xa022('0x25'));_0x1b0025[_0xa022('0x2d')]=_[_0xa022('0x2e')](_0x4a4e83[_0xa022('0x2d')]);_0x1b0025['filters']=_['intersection'](_0x1b0025[_0xa022('0x2c')],_0x1b0025['query']);_0x8331c7['attributes']=_[_0xa022('0x2f')](_0x1b0025[_0xa022('0x2c')],qs[_0xa022('0x30')](_0x4a4e83[_0xa022('0x2d')]['fields']));_0x8331c7[_0xa022('0x31')]=_0x8331c7[_0xa022('0x31')][_0xa022('0x32')]?_0x8331c7[_0xa022('0x31')]:_0x1b0025[_0xa022('0x2c')];if(!_0x4a4e83[_0xa022('0x2d')][_0xa022('0x33')](_0xa022('0x34'))){_0x8331c7[_0xa022('0x17')]=qs[_0xa022('0x17')](_0x4a4e83[_0xa022('0x2d')][_0xa022('0x17')]);_0x8331c7[_0xa022('0x19')]=qs['offset'](_0x4a4e83['query'][_0xa022('0x19')]);}_0x8331c7[_0xa022('0x35')]=qs['sort'](_0x4a4e83['query'][_0xa022('0x36')]);_0x8331c7[_0xa022('0x37')]=qs[_0xa022('0x38')](_[_0xa022('0x39')](_0x4a4e83[_0xa022('0x2d')],_0x1b0025[_0xa022('0x38')]),_0x18217b);if(_0x4a4e83[_0xa022('0x2d')]['filter']){_0x8331c7['where']=_['merge'](_0x8331c7['where'],{'$or':_[_0xa022('0x28')](_0x18217b,function(_0x5e0d6c){if(_0x5e0d6c['type']!==_0xa022('0x3a')){var _0x93afd9={};_0x93afd9[_0x5e0d6c[_0xa022('0x25')]]={'$like':'%'+_0x4a4e83[_0xa022('0x2d')][_0xa022('0x3b')]+'%'};return _0x93afd9;}})});}_0x8331c7=_[_0xa022('0x3c')]({},_0x8331c7,_0x4a4e83['options']);var _0x34de80={'where':_0x8331c7[_0xa022('0x37')]};return db[_0xa022('0x3d')]['count'](_0x34de80)[_0xa022('0x20')](function(_0x2bec4f){_0x328f72[_0xa022('0x18')]=_0x2bec4f;if(_0x4a4e83[_0xa022('0x2d')][_0xa022('0x3e')]){_0x8331c7[_0xa022('0x3f')]=[{'all':!![]}];}return db[_0xa022('0x3d')][_0xa022('0x40')](_0x8331c7);})[_0xa022('0x20')](function(_0x4e7df6){_0x328f72['rows']=_0x4e7df6;return _0x328f72;})[_0xa022('0x20')](respondWithFilteredResult(_0x5668b4,_0x8331c7))['catch'](handleError(_0x5668b4,null));};exports[_0xa022('0x41')]=function(_0x577c94,_0xd19101){var _0x364828={'raw':!![],'where':{'id':_0x577c94[_0xa022('0x42')]['id']}},_0x2accd4={};_0x2accd4[_0xa022('0x2c')]=_[_0xa022('0x2e')](db[_0xa022('0x3d')][_0xa022('0x43')]);_0x2accd4[_0xa022('0x2d')]=_['keys'](_0x577c94[_0xa022('0x2d')]);_0x2accd4[_0xa022('0x38')]=_[_0xa022('0x2f')](_0x2accd4['model'],_0x2accd4['query']);_0x364828['attributes']=_['intersection'](_0x2accd4[_0xa022('0x2c')],qs[_0xa022('0x30')](_0x577c94[_0xa022('0x2d')]['fields']));_0x364828[_0xa022('0x31')]=_0x364828[_0xa022('0x31')]['length']?_0x364828['attributes']:_0x2accd4[_0xa022('0x2c')];if(_0x577c94['query'][_0xa022('0x3e')]){_0x364828[_0xa022('0x3f')]=[{'all':!![]}];}_0x364828=_[_0xa022('0x3c')]({},_0x364828,_0x577c94[_0xa022('0x44')]);return db[_0xa022('0x3d')][_0xa022('0x45')](_0x364828)['then'](handleEntityNotFound(_0xd19101,null))[_0xa022('0x20')](respondWithResult(_0xd19101,null))[_0xa022('0x46')](handleError(_0xd19101,null));};exports[_0xa022('0x47')]=function(_0x6f96f7,_0x22b0a4){return db['FreshsalesField'][_0xa022('0x47')](_0x6f96f7['body'],{})[_0xa022('0x20')](respondWithResult(_0x22b0a4,0xc9))[_0xa022('0x46')](handleError(_0x22b0a4,null));};exports[_0xa022('0x1f')]=function(_0x29d6c3,_0x3b26e8){if(_0x29d6c3[_0xa022('0x48')]['id']){delete _0x29d6c3[_0xa022('0x48')]['id'];}return db[_0xa022('0x3d')][_0xa022('0x45')]({'where':{'id':_0x29d6c3[_0xa022('0x42')]['id']}})[_0xa022('0x20')](handleEntityNotFound(_0x3b26e8,null))[_0xa022('0x20')](saveUpdates(_0x29d6c3[_0xa022('0x48')],null))[_0xa022('0x20')](respondWithResult(_0x3b26e8,null))['catch'](handleError(_0x3b26e8,null));};exports['destroy']=function(_0x178db0,_0x27eac9){return db[_0xa022('0x3d')][_0xa022('0x45')]({'where':{'id':_0x178db0[_0xa022('0x42')]['id']}})[_0xa022('0x20')](handleEntityNotFound(_0x27eac9,null))[_0xa022('0x20')](removeEntity(_0x27eac9,null))[_0xa022('0x46')](handleError(_0x27eac9,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index d923bb3..00fec66 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 _0x0b7f=['int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','api','bluebird','request-promise','path','./intFreshsalesField.attributes','exports','define'];(function(_0x575907,_0x5a5d07){var _0x29cae2=function(_0x44d83){while(--_0x44d83){_0x575907['push'](_0x575907['shift']());}};_0x29cae2(++_0x5a5d07);}(_0x0b7f,0x115));var _0xf0b7=function(_0x58389d,_0x3137df){_0x58389d=_0x58389d-0x0;var _0x2be20a=_0x0b7f[_0x58389d];return _0x2be20a;};'use strict';var _=require(_0xf0b7('0x0'));var util=require(_0xf0b7('0x1'));var logger=require('../../config/logger')(_0xf0b7('0x2'));var moment=require('moment');var BPromise=require(_0xf0b7('0x3'));var rp=require(_0xf0b7('0x4'));var fs=require('fs');var path=require(_0xf0b7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf0b7('0x6'));module[_0xf0b7('0x7')]=function(_0x77940d,_0x41c63d){return _0x77940d[_0xf0b7('0x8')]('FreshsalesField',attributes,{'tableName':_0xf0b7('0x9'),'paranoid':![],'indexes':[{'name':_0xf0b7('0xa'),'fields':[_0xf0b7('0xb'),_0xf0b7('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3746=['lodash','util','api','bluebird','request-promise','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField'];(function(_0x35a59c,_0x3c08ef){var _0x11bf0e=function(_0x154cec){while(--_0x154cec){_0x35a59c['push'](_0x35a59c['shift']());}};_0x11bf0e(++_0x3c08ef);}(_0x3746,0xa9));var _0x6374=function(_0x4e3c5e,_0x33ad12){_0x4e3c5e=_0x4e3c5e-0x0;var _0x14c1a5=_0x3746[_0x4e3c5e];return _0x14c1a5;};'use strict';var _=require(_0x6374('0x0'));var util=require(_0x6374('0x1'));var logger=require('../../config/logger')(_0x6374('0x2'));var moment=require('moment');var BPromise=require(_0x6374('0x3'));var rp=require(_0x6374('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6374('0x5'));var attributes=require(_0x6374('0x6'));module[_0x6374('0x7')]=function(_0x3ef994,_0xa74f70){return _0x3ef994[_0x6374('0x8')](_0x6374('0x9'),attributes,{'tableName':_0x6374('0xa'),'paranoid':![],'indexes':[{'name':_0x6374('0xb'),'fields':[_0x6374('0xc'),'FieldId'],'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 0b69abb..cabe60d 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 _0x2542=['info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4f46ff,_0x41ed8f){var _0x201816=function(_0x52e357){while(--_0x52e357){_0x4f46ff['push'](_0x4f46ff['shift']());}};_0x201816(++_0x41ed8f);}(_0x2542,0x169));var _0x2254=function(_0x3ef090,_0x406ee2){_0x3ef090=_0x3ef090-0x0;var _0x1fc6ed=_0x2542[_0x3ef090];return _0x1fc6ed;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x5bfeed,_0x3421c2){var _0x1882bc=function(_0x3b76af){while(--_0x3b76af){_0x5bfeed['push'](_0x5bfeed['shift']());}};_0x1882bc(++_0x3421c2);}(_0xabce,0x103));var _0xeabc=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xabce[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('FreshsalesField,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 4a857f2..f83f337 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(_0x15b2ef,_0x5e7365){var _0x59bdc9=function(_0x2ccc7d){while(--_0x2ccc7d){_0x15b2ef['push'](_0x15b2ef['shift']());}};_0x59bdc9(++_0x5e7365);}(_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/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(_0xbbb8e2,_0x4e941c){var _0x98fea7=function(_0x52d5c8){while(--_0x52d5c8){_0xbbb8e2['push'](_0xbbb8e2['shift']());}};_0x98fea7(++_0x4e941c);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 7e3ad78..c43850a 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 _0x2bab=['username','newTab','sequelize','exports','STRING'];(function(_0x4c3979,_0x4f19eb){var _0x31dc76=function(_0x28b288){while(--_0x28b288){_0x4c3979['push'](_0x4c3979['shift']());}};_0x31dc76(++_0x4f19eb);}(_0x2bab,0x1ba));var _0xb2ba=function(_0xe1c003,_0x151d96){_0xe1c003=_0xe1c003-0x0;var _0x18140c=_0x2bab[_0xe1c003];return _0x18140c;};'use strict';var Sequelize=require(_0xb2ba('0x0'));module[_0xb2ba('0x1')]={'name':{'type':Sequelize[_0xb2ba('0x2')]},'description':{'type':Sequelize[_0xb2ba('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xb2ba('0x3')},'remoteUri':{'type':Sequelize[_0xb2ba('0x2')]},'password':{'type':Sequelize[_0xb2ba('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xb2ba('0x2')]},'securityToken':{'type':Sequelize[_0xb2ba('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xb2ba('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xf562=['username','ENUM','newTab','integrationTab','sequelize','exports','STRING'];(function(_0x24c013,_0x114147){var _0x1424a8=function(_0x38a797){while(--_0x38a797){_0x24c013['push'](_0x24c013['shift']());}};_0x1424a8(++_0x114147);}(_0xf562,0x100));var _0x2f56=function(_0x135f2e,_0x30ec68){_0x135f2e=_0x135f2e-0x0;var _0x5d5ed7=_0xf562[_0x135f2e];return _0x5d5ed7;};'use strict';var Sequelize=require(_0x2f56('0x0'));module[_0x2f56('0x1')]={'name':{'type':Sequelize[_0x2f56('0x2')]},'description':{'type':Sequelize[_0x2f56('0x2')]},'username':{'type':Sequelize[_0x2f56('0x2')],'unique':_0x2f56('0x3')},'remoteUri':{'type':Sequelize[_0x2f56('0x2')]},'password':{'type':Sequelize[_0x2f56('0x2')]},'clientId':{'type':Sequelize[_0x2f56('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x2f56('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2f56('0x4')]('integrationTab',_0x2f56('0x5')),'defaultValue':_0x2f56('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 0136a5a..7a8c968 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 _0xc1d9=['Connection','clientSecret','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','int','picklist','boolean','textarea','includes','label','picklistValues','value','True','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','index','map','SalesforceAccount','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','name','merge','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','destroy','getConfigurations','findOne','SalesforceConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','remoteUri','clientId','username','password','securityToken','slice','substring','lastIndexOf'];(function(_0x2183cb,_0x4e2cf3){var _0x1d70bc=function(_0x16df8f){while(--_0x16df8f){_0x2183cb['push'](_0x2183cb['shift']());}};_0x1d70bc(++_0x4e2cf3);}(_0xc1d9,0x9c));var _0x9c1d=function(_0x2ce0cc,_0x2820de){_0x2ce0cc=_0x2ce0cc-0x0;var _0x5418a7=_0xc1d9[_0x2ce0cc];return _0x5418a7;};'use strict';var emlformat=require(_0x9c1d('0x0'));var rimraf=require(_0x9c1d('0x1'));var zipdir=require(_0x9c1d('0x2'));var jsonpatch=require(_0x9c1d('0x3'));var rp=require(_0x9c1d('0x4'));var moment=require(_0x9c1d('0x5'));var BPromise=require(_0x9c1d('0x6'));var Mustache=require(_0x9c1d('0x7'));var util=require(_0x9c1d('0x8'));var path=require(_0x9c1d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9c1d('0xa'));var fs=require('fs');var fs_extra=require(_0x9c1d('0xb'));var _=require(_0x9c1d('0xc'));var squel=require(_0x9c1d('0xd'));var crypto=require(_0x9c1d('0xe'));var jsforce=require(_0x9c1d('0xf'));var deskjs=require(_0x9c1d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9c1d('0x11'));var Papa=require('papaparse');var Redis=require(_0x9c1d('0x12'));var authService=require(_0x9c1d('0x13'));var qs=require(_0x9c1d('0x14'));var as=require(_0x9c1d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9c1d('0x16'))(_0x9c1d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9c1d('0x18'))['db'];var integrations=require(_0x9c1d('0x19'));function respondWithStatusCode(_0x3513b7,_0x43d410){_0x43d410=_0x43d410||0xcc;return function(_0x2632ca){if(_0x2632ca){return _0x3513b7[_0x9c1d('0x1a')](_0x43d410);}return _0x3513b7['status'](_0x43d410)[_0x9c1d('0x1b')]();};}function respondWithResult(_0x71b743,_0x4cd69d){_0x4cd69d=_0x4cd69d||0xc8;return function(_0x1f17b1){if(_0x1f17b1){return _0x71b743[_0x9c1d('0x1c')](_0x4cd69d)[_0x9c1d('0x1d')](_0x1f17b1);}};}function respondWithFilteredResult(_0x1e23ca,_0x2408f3){return function(_0x219a5b){if(_0x219a5b){var _0x41e7a6=typeof _0x2408f3[_0x9c1d('0x1e')]==='undefined'&&typeof _0x2408f3['limit']===_0x9c1d('0x1f');var _0xffee3c=_0x219a5b[_0x9c1d('0x20')];var _0x37ad1a=_0x41e7a6?0x0:_0x2408f3['offset'];var _0x22bd9d=_0x41e7a6?_0x219a5b[_0x9c1d('0x20')]:_0x2408f3[_0x9c1d('0x1e')]+_0x2408f3[_0x9c1d('0x21')];var _0x51b064;if(_0x22bd9d>=_0xffee3c){_0x22bd9d=_0xffee3c;_0x51b064=0xc8;}else{_0x51b064=0xce;}_0x1e23ca[_0x9c1d('0x1c')](_0x51b064);return _0x1e23ca['set'](_0x9c1d('0x22'),_0x37ad1a+'-'+_0x22bd9d+'/'+_0xffee3c)[_0x9c1d('0x1d')](_0x219a5b);}return null;};}function patchUpdates(_0x6ad424){return function(_0x39ab64){try{jsonpatch[_0x9c1d('0x23')](_0x39ab64,_0x6ad424,!![]);}catch(_0x1d113c){return BPromise[_0x9c1d('0x24')](_0x1d113c);}return _0x39ab64[_0x9c1d('0x25')]();};}function saveUpdates(_0x1263b2,_0x109480){return function(_0x2be961){if(_0x2be961){return _0x2be961[_0x9c1d('0x26')](_0x1263b2)[_0x9c1d('0x27')](function(_0xf02b95){return _0xf02b95;});}return null;};}function removeEntity(_0x3cbf0e,_0x3d7f93){return function(_0x27318f){if(_0x27318f){return _0x27318f['destroy']()['then'](function(){_0x3cbf0e[_0x9c1d('0x1c')](0xcc)[_0x9c1d('0x1b')]();});}};}function handleEntityNotFound(_0x34d222,_0x4a2d54){return function(_0x245a6b){if(!_0x245a6b){_0x34d222['sendStatus'](0x194);}return _0x245a6b;};}function handleError(_0x58d8f5,_0x5661b1){_0x5661b1=_0x5661b1||0x1f4;return function(_0x25f09b){logger[_0x9c1d('0x28')](_0x25f09b[_0x9c1d('0x29')]);if(_0x25f09b['name']){delete _0x25f09b['name'];}_0x58d8f5[_0x9c1d('0x1c')](_0x5661b1)['send'](_0x25f09b);};}exports[_0x9c1d('0x2a')]=function(_0x4a4a7a,_0x4d24ce){var _0x31c372={},_0x53da1c={},_0x34940b={'count':0x0,'rows':[]};var _0x4ba564=_[_0x9c1d('0x2b')](db[_0x9c1d('0x2c')][_0x9c1d('0x2d')],function(_0x444149){return{'name':_0x444149[_0x9c1d('0x2e')],'type':_0x444149['type'][_0x9c1d('0x2f')]};});_0x53da1c[_0x9c1d('0x30')]=_['map'](_0x4ba564,'name');_0x53da1c[_0x9c1d('0x31')]=_['keys'](_0x4a4a7a[_0x9c1d('0x31')]);_0x53da1c[_0x9c1d('0x32')]=_['intersection'](_0x53da1c[_0x9c1d('0x30')],_0x53da1c[_0x9c1d('0x31')]);_0x31c372['attributes']=_[_0x9c1d('0x33')](_0x53da1c[_0x9c1d('0x30')],qs[_0x9c1d('0x34')](_0x4a4a7a[_0x9c1d('0x31')][_0x9c1d('0x34')]));_0x31c372['attributes']=_0x31c372[_0x9c1d('0x35')][_0x9c1d('0x36')]?_0x31c372['attributes']:_0x53da1c[_0x9c1d('0x30')];if(!_0x4a4a7a[_0x9c1d('0x31')][_0x9c1d('0x37')](_0x9c1d('0x38'))){_0x31c372['limit']=qs[_0x9c1d('0x21')](_0x4a4a7a[_0x9c1d('0x31')][_0x9c1d('0x21')]);_0x31c372[_0x9c1d('0x1e')]=qs[_0x9c1d('0x1e')](_0x4a4a7a[_0x9c1d('0x31')]['offset']);}_0x31c372[_0x9c1d('0x39')]=qs[_0x9c1d('0x3a')](_0x4a4a7a[_0x9c1d('0x31')][_0x9c1d('0x3a')]);_0x31c372[_0x9c1d('0x3b')]=qs[_0x9c1d('0x32')](_['pick'](_0x4a4a7a['query'],_0x53da1c[_0x9c1d('0x32')]),_0x4ba564);if(_0x4a4a7a[_0x9c1d('0x31')][_0x9c1d('0x3c')]){_0x31c372[_0x9c1d('0x3b')]=_['merge'](_0x31c372[_0x9c1d('0x3b')],{'$or':_[_0x9c1d('0x2b')](_0x4ba564,function(_0x2070f2){if(_0x2070f2[_0x9c1d('0x3d')]!==_0x9c1d('0x3e')){var _0x152dcc={};_0x152dcc[_0x2070f2[_0x9c1d('0x3f')]]={'$like':'%'+_0x4a4a7a[_0x9c1d('0x31')][_0x9c1d('0x3c')]+'%'};return _0x152dcc;}})});}_0x31c372=_[_0x9c1d('0x40')]({},_0x31c372,_0x4a4a7a[_0x9c1d('0x41')]);var _0x47134f={'where':_0x31c372[_0x9c1d('0x3b')]};return db[_0x9c1d('0x2c')][_0x9c1d('0x20')](_0x47134f)['then'](function(_0x30019d){_0x34940b[_0x9c1d('0x20')]=_0x30019d;if(_0x4a4a7a[_0x9c1d('0x31')][_0x9c1d('0x42')]){_0x31c372[_0x9c1d('0x43')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x9c1d('0x44')](_0x31c372);})[_0x9c1d('0x27')](function(_0x49c82c){_0x34940b[_0x9c1d('0x45')]=_0x49c82c;return _0x34940b;})[_0x9c1d('0x27')](respondWithFilteredResult(_0x4d24ce,_0x31c372))[_0x9c1d('0x46')](handleError(_0x4d24ce,null));};exports['show']=function(_0x18496e,_0x322e6c){var _0x46423d={'raw':![],'where':{'id':_0x18496e[_0x9c1d('0x47')]['id']}},_0x28f7fd={};_0x28f7fd[_0x9c1d('0x30')]=_['keys'](db[_0x9c1d('0x2c')][_0x9c1d('0x2d')]);_0x28f7fd[_0x9c1d('0x31')]=_[_0x9c1d('0x48')](_0x18496e[_0x9c1d('0x31')]);_0x28f7fd[_0x9c1d('0x32')]=_['intersection'](_0x28f7fd[_0x9c1d('0x30')],_0x28f7fd[_0x9c1d('0x31')]);_0x46423d[_0x9c1d('0x35')]=_[_0x9c1d('0x33')](_0x28f7fd['model'],qs[_0x9c1d('0x34')](_0x18496e[_0x9c1d('0x31')][_0x9c1d('0x34')]));_0x46423d[_0x9c1d('0x35')]=_0x46423d[_0x9c1d('0x35')]['length']?_0x46423d[_0x9c1d('0x35')]:_0x28f7fd['model'];if(_0x18496e[_0x9c1d('0x31')][_0x9c1d('0x42')]){_0x46423d['include']=[{'all':!![]}];}_0x46423d=_[_0x9c1d('0x40')]({},_0x46423d,_0x18496e[_0x9c1d('0x41')]);return db[_0x9c1d('0x2c')]['find'](_0x46423d)[_0x9c1d('0x27')](handleEntityNotFound(_0x322e6c,null))[_0x9c1d('0x27')](respondWithResult(_0x322e6c,null))[_0x9c1d('0x46')](handleError(_0x322e6c,null));};exports[_0x9c1d('0x49')]=function(_0x14ce58,_0x3eea10){return db[_0x9c1d('0x2c')][_0x9c1d('0x49')](_0x14ce58[_0x9c1d('0x4a')],{})[_0x9c1d('0x27')](respondWithResult(_0x3eea10,0xc9))['catch'](handleError(_0x3eea10,null));};exports[_0x9c1d('0x26')]=function(_0x198614,_0xe14705){if(_0x198614['body']['id']){delete _0x198614[_0x9c1d('0x4a')]['id'];}return db['SalesforceAccount'][_0x9c1d('0x4b')]({'where':{'id':_0x198614[_0x9c1d('0x47')]['id']}})[_0x9c1d('0x27')](handleEntityNotFound(_0xe14705,null))['then'](saveUpdates(_0x198614[_0x9c1d('0x4a')],null))[_0x9c1d('0x27')](respondWithResult(_0xe14705,null))['catch'](handleError(_0xe14705,null));};exports[_0x9c1d('0x4c')]=function(_0x387076,_0x2364d9){return db[_0x9c1d('0x2c')]['find']({'where':{'id':_0x387076[_0x9c1d('0x47')]['id']}})[_0x9c1d('0x27')](handleEntityNotFound(_0x2364d9,null))[_0x9c1d('0x27')](removeEntity(_0x2364d9,null))[_0x9c1d('0x46')](handleError(_0x2364d9,null));};exports[_0x9c1d('0x4d')]=function(_0x182dd8,_0x2a5a6a,_0x40eca2){var _0x1e80e7={};var _0x489e00={};var _0x5039e0;var _0x5e91a9;return db[_0x9c1d('0x2c')][_0x9c1d('0x4e')]({'where':{'id':_0x182dd8[_0x9c1d('0x47')]['id']}})[_0x9c1d('0x27')](handleEntityNotFound(_0x2a5a6a,null))['then'](function(_0x4fd963){if(_0x4fd963){_0x5039e0=_0x4fd963;_0x489e00[_0x9c1d('0x30')]=_['keys'](db[_0x9c1d('0x4f')][_0x9c1d('0x2d')]);_0x489e00[_0x9c1d('0x31')]=_['keys'](_0x182dd8[_0x9c1d('0x31')]);_0x489e00[_0x9c1d('0x32')]=_['intersection'](_0x489e00[_0x9c1d('0x30')],_0x489e00['query']);_0x1e80e7[_0x9c1d('0x35')]=_[_0x9c1d('0x33')](_0x489e00[_0x9c1d('0x30')],qs[_0x9c1d('0x34')](_0x182dd8['query'][_0x9c1d('0x34')]));_0x1e80e7['attributes']=_0x1e80e7[_0x9c1d('0x35')][_0x9c1d('0x36')]?_0x1e80e7[_0x9c1d('0x35')]:_0x489e00[_0x9c1d('0x30')];_0x1e80e7[_0x9c1d('0x39')]=qs[_0x9c1d('0x3a')](_0x182dd8['query'][_0x9c1d('0x3a')]);_0x1e80e7[_0x9c1d('0x3b')]=qs[_0x9c1d('0x32')](_[_0x9c1d('0x50')](_0x182dd8[_0x9c1d('0x31')],_0x489e00[_0x9c1d('0x32')]));if(_0x182dd8[_0x9c1d('0x31')][_0x9c1d('0x3c')]){_0x1e80e7[_0x9c1d('0x3b')]=_['merge'](_0x1e80e7[_0x9c1d('0x3b')],{'$or':_[_0x9c1d('0x2b')](_0x1e80e7[_0x9c1d('0x35')],function(_0x2d5dde){var _0x31a9ae={};_0x31a9ae[_0x2d5dde]={'$like':'%'+_0x182dd8['query']['filter']+'%'};return _0x31a9ae;})});}_0x1e80e7=_[_0x9c1d('0x40')]({},_0x1e80e7,_0x182dd8['options']);return _0x5039e0['getConfigurations'](_0x1e80e7);}})[_0x9c1d('0x27')](function(_0x41e672){if(_0x41e672){_0x5e91a9=_0x41e672['length'];if(!_0x182dd8[_0x9c1d('0x31')][_0x9c1d('0x37')](_0x9c1d('0x38'))){_0x1e80e7['limit']=qs[_0x9c1d('0x21')](_0x182dd8[_0x9c1d('0x31')][_0x9c1d('0x21')]);_0x1e80e7['offset']=qs[_0x9c1d('0x1e')](_0x182dd8[_0x9c1d('0x31')][_0x9c1d('0x1e')]);}return _0x5039e0['getConfigurations'](_0x1e80e7);}})['then'](function(_0x5260d7){if(_0x5260d7){return _0x5260d7?{'count':_0x5e91a9,'rows':_0x5260d7}:null;}})[_0x9c1d('0x27')](respondWithResult(_0x2a5a6a,null))[_0x9c1d('0x46')](handleError(_0x2a5a6a,null));};exports[_0x9c1d('0x51')]=function(_0x222fc8,_0xa73c2d,_0x19430f){if(_0x222fc8[_0x9c1d('0x4a')]['id']){delete _0x222fc8[_0x9c1d('0x4a')]['id'];}return db[_0x9c1d('0x2c')][_0x9c1d('0x4e')]({'where':{'id':_0x222fc8[_0x9c1d('0x47')]['id']}})['then'](handleEntityNotFound(_0xa73c2d,null))[_0x9c1d('0x27')](function(_0x48c9e1){if(_0x48c9e1){_0x222fc8[_0x9c1d('0x4a')][_0x9c1d('0x52')]=_0x48c9e1['id'];_0x222fc8[_0x9c1d('0x4a')][_0x9c1d('0x53')]=integrations[_0x9c1d('0x54')](_0x222fc8[_0x9c1d('0x4a')][_0x9c1d('0x55')],_0x222fc8[_0x9c1d('0x4a')][_0x9c1d('0x3d')]);_0x222fc8[_0x9c1d('0x4a')]['Descriptions']=integrations[_0x9c1d('0x56')](_0x222fc8['body']['channel'],_0x222fc8[_0x9c1d('0x4a')][_0x9c1d('0x3d')]);return db['SalesforceConfiguration'][_0x9c1d('0x49')](_0x222fc8['body'],{'include':[{'model':db[_0x9c1d('0x57')],'as':_0x9c1d('0x53')},{'model':db[_0x9c1d('0x57')],'as':_0x9c1d('0x58')}]});}return null;})[_0x9c1d('0x27')](respondWithResult(_0xa73c2d,null))[_0x9c1d('0x46')](handleError(_0xa73c2d,null));};exports[_0x9c1d('0x59')]=function(_0x451a1c,_0x1b0a2b,_0x2642a8){var _0xf0fe23;var _0x482a22='';var _0x1769db='Task';return db[_0x9c1d('0x2c')][_0x9c1d('0x4e')]({'where':{'id':_0x451a1c[_0x9c1d('0x47')]['id']},'attributes':['id',_0x9c1d('0x5a'),_0x9c1d('0x5b'),'clientSecret',_0x9c1d('0x5c'),_0x9c1d('0x5d'),_0x9c1d('0x5e')]})[_0x9c1d('0x27')](handleEntityNotFound(_0x1b0a2b,null))[_0x9c1d('0x27')](function(_0x4e866b){if(_0x4e866b){_0x482a22=_0x4e866b['remoteUri'];var _0x4b0fdd=_0x482a22[_0x9c1d('0x5f')](-0x1);if(_0x4b0fdd==='/'){_0x482a22=_0x482a22[_0x9c1d('0x60')](0x0,_0x482a22[_0x9c1d('0x61')](_0x4b0fdd));}_0xf0fe23=new jsforce[(_0x9c1d('0x62'))]({'oauth2':{'loginUrl':_0x482a22,'clientId':_0x4e866b['clientId'],'clientSecret':_0x4e866b[_0x9c1d('0x63')]}});return _0xf0fe23[_0x9c1d('0x64')](_0x4e866b[_0x9c1d('0x5c')],_0x4e866b[_0x9c1d('0x5d')][_0x9c1d('0x65')](_0x4e866b['securityToken']));}})[_0x9c1d('0x27')](function(_0x22bc62){if(_0x22bc62){if(!_[_0x9c1d('0x66')](_0x451a1c[_0x9c1d('0x31')][_0x9c1d('0x67')])){_0x1769db=_0x451a1c[_0x9c1d('0x31')]['ticketType'];}return _0xf0fe23[_0x9c1d('0x68')](_0x1769db)[_0x9c1d('0x69')]();}})['then'](function(_0x13b40b){var _0x3a7063=[_0x9c1d('0x6a'),_0x9c1d('0x6b'),_0x9c1d('0x6c'),_0x9c1d('0x6d'),_0x9c1d('0x6e'),'Description'];var _0x50b3be=['string',_0x9c1d('0x6f'),_0x9c1d('0x70'),_0x9c1d('0x71'),'email',_0x9c1d('0x72'),'phone'];if(_0x13b40b){_['remove'](_0x13b40b['fields'],function(_0x1a7298){return _0x3a7063[_0x9c1d('0x73')](_0x1a7298[_0x9c1d('0x3f')])||!_0x50b3be[_0x9c1d('0x73')](_0x1a7298[_0x9c1d('0x3d')]);});return{'count':_0x13b40b['fields'][_0x9c1d('0x36')],'rows':_[_0x9c1d('0x2b')](_0x13b40b[_0x9c1d('0x34')],function(_0x19fea9){return{'id':_0x19fea9[_0x9c1d('0x3f')],'name':_0x19fea9[_0x9c1d('0x74')],'custom':_0x19fea9['custom'],'options':_0x19fea9['picklistValues'][_0x9c1d('0x36')]>0x0?_[_0x9c1d('0x2b')](_0x19fea9[_0x9c1d('0x75')],function(_0x1b5f69){return{'name':_0x1b5f69[_0x9c1d('0x74')],'value':_0x1b5f69[_0x9c1d('0x76')]};}):_0x19fea9[_0x9c1d('0x3d')]==_0x9c1d('0x71')?[{'name':_0x9c1d('0x77'),'value':'true'},{'name':_0x9c1d('0x78'),'value':_0x9c1d('0x79')}]:[]};})};}})[_0x9c1d('0x27')](respondWithResult(_0x1b0a2b,null))[_0x9c1d('0x46')](function(_0x159f91){var _0x27ed2e=_0x451a1c['query']['test']?0x1f4:_0x159f91[_0x9c1d('0x7a')]||0x1f4;logger['error'](_0x9c1d('0x7b'),_0x9c1d('0x59'),_0x27ed2e,JSON[_0x9c1d('0x7c')](_0x159f91));delete _0x159f91['name'];if(_0x27ed2e===0x191){_0x27ed2e=0x190;}_0x1b0a2b[_0x9c1d('0x1c')](_0x27ed2e)[_0x9c1d('0x7d')](_0x451a1c[_0x9c1d('0x31')][_0x9c1d('0x7e')]?{'message':'Wrong\x20credentials','statusCode':_0x159f91[_0x9c1d('0x7a')]}:_0x159f91);});}; \ No newline at end of file +var _0x68cf=['VIRTUAL','options','includeAll','include','SalesforceAccount','findAll','rows','params','intersection','find','catch','create','body','destroy','getConfigurations','findOne','SalesforceConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','remoteUri','clientId','clientSecret','username','slice','substring','lastIndexOf','Connection','login','password','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','includes','label','custom','picklistValues','value','true','False','false','test','statusCode','error','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','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','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0xe833cc,_0x467d44){var _0x3ac7d6=function(_0x138911){while(--_0x138911){_0xe833cc['push'](_0xe833cc['shift']());}};_0x3ac7d6(++_0x467d44);}(_0x68cf,0x1b8));var _0xf68c=function(_0x1f3637,_0x14d11f){_0x1f3637=_0x1f3637-0x0;var _0x536456=_0x68cf[_0x1f3637];return _0x536456;};'use strict';var emlformat=require(_0xf68c('0x0'));var rimraf=require(_0xf68c('0x1'));var zipdir=require(_0xf68c('0x2'));var jsonpatch=require(_0xf68c('0x3'));var rp=require(_0xf68c('0x4'));var moment=require(_0xf68c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf68c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf68c('0x7'));var ejs=require(_0xf68c('0x8'));var fs=require('fs');var fs_extra=require(_0xf68c('0x9'));var _=require(_0xf68c('0xa'));var squel=require(_0xf68c('0xb'));var crypto=require('crypto');var jsforce=require(_0xf68c('0xc'));var deskjs=require(_0xf68c('0xd'));var toCsv=require(_0xf68c('0x7'));var querystring=require(_0xf68c('0xe'));var Papa=require('papaparse');var Redis=require(_0xf68c('0xf'));var authService=require(_0xf68c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf68c('0x11'));var hardwareService=require(_0xf68c('0x12'));var logger=require(_0xf68c('0x13'))(_0xf68c('0x14'));var utils=require(_0xf68c('0x15'));var config=require(_0xf68c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xf68c('0x17'));function respondWithStatusCode(_0x158dda,_0x2f764c){_0x2f764c=_0x2f764c||0xcc;return function(_0xac0e19){if(_0xac0e19){return _0x158dda['sendStatus'](_0x2f764c);}return _0x158dda[_0xf68c('0x18')](_0x2f764c)[_0xf68c('0x19')]();};}function respondWithResult(_0x349551,_0xeb709d){_0xeb709d=_0xeb709d||0xc8;return function(_0x39098c){if(_0x39098c){return _0x349551['status'](_0xeb709d)[_0xf68c('0x1a')](_0x39098c);}};}function respondWithFilteredResult(_0x591993,_0x1e5409){return function(_0x424f27){if(_0x424f27){var _0x482f4c=typeof _0x1e5409[_0xf68c('0x1b')]===_0xf68c('0x1c')&&typeof _0x1e5409[_0xf68c('0x1d')]===_0xf68c('0x1c');var _0x4b033a=_0x424f27[_0xf68c('0x1e')];var _0x14b7fd=_0x482f4c?0x0:_0x1e5409[_0xf68c('0x1b')];var _0x45e629=_0x482f4c?_0x424f27[_0xf68c('0x1e')]:_0x1e5409['offset']+_0x1e5409[_0xf68c('0x1d')];var _0x199b9c;if(_0x45e629>=_0x4b033a){_0x45e629=_0x4b033a;_0x199b9c=0xc8;}else{_0x199b9c=0xce;}_0x591993[_0xf68c('0x18')](_0x199b9c);return _0x591993[_0xf68c('0x1f')](_0xf68c('0x20'),_0x14b7fd+'-'+_0x45e629+'/'+_0x4b033a)[_0xf68c('0x1a')](_0x424f27);}return null;};}function patchUpdates(_0x214d94){return function(_0x57608a){try{jsonpatch[_0xf68c('0x21')](_0x57608a,_0x214d94,!![]);}catch(_0x397509){return BPromise['reject'](_0x397509);}return _0x57608a[_0xf68c('0x22')]();};}function saveUpdates(_0x5845ca,_0x2d8d5e){return function(_0x191eb1){if(_0x191eb1){return _0x191eb1[_0xf68c('0x23')](_0x5845ca)[_0xf68c('0x24')](function(_0x52b635){return _0x52b635;});}return null;};}function removeEntity(_0x1b364a,_0x16f212){return function(_0x4f7952){if(_0x4f7952){return _0x4f7952['destroy']()[_0xf68c('0x24')](function(){_0x1b364a[_0xf68c('0x18')](0xcc)[_0xf68c('0x19')]();});}};}function handleEntityNotFound(_0x5ecafb,_0x1c86b7){return function(_0x28725a){if(!_0x28725a){_0x5ecafb[_0xf68c('0x25')](0x194);}return _0x28725a;};}function handleError(_0x38d150,_0x3b27bc){_0x3b27bc=_0x3b27bc||0x1f4;return function(_0x28eb23){logger['error'](_0x28eb23[_0xf68c('0x26')]);if(_0x28eb23[_0xf68c('0x27')]){delete _0x28eb23[_0xf68c('0x27')];}_0x38d150[_0xf68c('0x18')](_0x3b27bc)[_0xf68c('0x28')](_0x28eb23);};}exports['index']=function(_0xb81a92,_0x2eb682){var _0x2427e0={},_0x1f2414={},_0xbd47e={'count':0x0,'rows':[]};var _0x1a13ef=_[_0xf68c('0x29')](db['SalesforceAccount'][_0xf68c('0x2a')],function(_0x45e982){return{'name':_0x45e982[_0xf68c('0x2b')],'type':_0x45e982[_0xf68c('0x2c')][_0xf68c('0x2d')]};});_0x1f2414[_0xf68c('0x2e')]=_[_0xf68c('0x29')](_0x1a13ef,_0xf68c('0x27'));_0x1f2414[_0xf68c('0x2f')]=_[_0xf68c('0x30')](_0xb81a92[_0xf68c('0x2f')]);_0x1f2414[_0xf68c('0x31')]=_['intersection'](_0x1f2414['model'],_0x1f2414[_0xf68c('0x2f')]);_0x2427e0[_0xf68c('0x32')]=_['intersection'](_0x1f2414[_0xf68c('0x2e')],qs[_0xf68c('0x33')](_0xb81a92[_0xf68c('0x2f')][_0xf68c('0x33')]));_0x2427e0[_0xf68c('0x32')]=_0x2427e0['attributes'][_0xf68c('0x34')]?_0x2427e0[_0xf68c('0x32')]:_0x1f2414[_0xf68c('0x2e')];if(!_0xb81a92[_0xf68c('0x2f')]['hasOwnProperty'](_0xf68c('0x35'))){_0x2427e0['limit']=qs[_0xf68c('0x1d')](_0xb81a92[_0xf68c('0x2f')][_0xf68c('0x1d')]);_0x2427e0[_0xf68c('0x1b')]=qs[_0xf68c('0x1b')](_0xb81a92[_0xf68c('0x2f')][_0xf68c('0x1b')]);}_0x2427e0[_0xf68c('0x36')]=qs[_0xf68c('0x37')](_0xb81a92['query'][_0xf68c('0x37')]);_0x2427e0[_0xf68c('0x38')]=qs[_0xf68c('0x31')](_[_0xf68c('0x39')](_0xb81a92[_0xf68c('0x2f')],_0x1f2414[_0xf68c('0x31')]),_0x1a13ef);if(_0xb81a92[_0xf68c('0x2f')][_0xf68c('0x3a')]){_0x2427e0[_0xf68c('0x38')]=_[_0xf68c('0x3b')](_0x2427e0[_0xf68c('0x38')],{'$or':_[_0xf68c('0x29')](_0x1a13ef,function(_0x2df273){if(_0x2df273['type']!==_0xf68c('0x3c')){var _0x90e6d6={};_0x90e6d6[_0x2df273[_0xf68c('0x27')]]={'$like':'%'+_0xb81a92[_0xf68c('0x2f')]['filter']+'%'};return _0x90e6d6;}})});}_0x2427e0=_['merge']({},_0x2427e0,_0xb81a92[_0xf68c('0x3d')]);var _0x1a6f59={'where':_0x2427e0[_0xf68c('0x38')]};return db['SalesforceAccount'][_0xf68c('0x1e')](_0x1a6f59)['then'](function(_0x320470){_0xbd47e[_0xf68c('0x1e')]=_0x320470;if(_0xb81a92[_0xf68c('0x2f')][_0xf68c('0x3e')]){_0x2427e0[_0xf68c('0x3f')]=[{'all':!![]}];}return db[_0xf68c('0x40')][_0xf68c('0x41')](_0x2427e0);})['then'](function(_0x2b63d2){_0xbd47e[_0xf68c('0x42')]=_0x2b63d2;return _0xbd47e;})[_0xf68c('0x24')](respondWithFilteredResult(_0x2eb682,_0x2427e0))['catch'](handleError(_0x2eb682,null));};exports['show']=function(_0x2b13d2,_0x174f24){var _0xeee805={'raw':![],'where':{'id':_0x2b13d2[_0xf68c('0x43')]['id']}},_0x2716a4={};_0x2716a4['model']=_[_0xf68c('0x30')](db[_0xf68c('0x40')][_0xf68c('0x2a')]);_0x2716a4[_0xf68c('0x2f')]=_[_0xf68c('0x30')](_0x2b13d2[_0xf68c('0x2f')]);_0x2716a4[_0xf68c('0x31')]=_[_0xf68c('0x44')](_0x2716a4[_0xf68c('0x2e')],_0x2716a4[_0xf68c('0x2f')]);_0xeee805[_0xf68c('0x32')]=_[_0xf68c('0x44')](_0x2716a4[_0xf68c('0x2e')],qs[_0xf68c('0x33')](_0x2b13d2['query'][_0xf68c('0x33')]));_0xeee805[_0xf68c('0x32')]=_0xeee805[_0xf68c('0x32')][_0xf68c('0x34')]?_0xeee805[_0xf68c('0x32')]:_0x2716a4['model'];if(_0x2b13d2[_0xf68c('0x2f')][_0xf68c('0x3e')]){_0xeee805[_0xf68c('0x3f')]=[{'all':!![]}];}_0xeee805=_[_0xf68c('0x3b')]({},_0xeee805,_0x2b13d2[_0xf68c('0x3d')]);return db[_0xf68c('0x40')][_0xf68c('0x45')](_0xeee805)[_0xf68c('0x24')](handleEntityNotFound(_0x174f24,null))[_0xf68c('0x24')](respondWithResult(_0x174f24,null))[_0xf68c('0x46')](handleError(_0x174f24,null));};exports['create']=function(_0x571f49,_0x5c08b6){return db[_0xf68c('0x40')][_0xf68c('0x47')](_0x571f49[_0xf68c('0x48')],{})[_0xf68c('0x24')](respondWithResult(_0x5c08b6,0xc9))[_0xf68c('0x46')](handleError(_0x5c08b6,null));};exports['update']=function(_0x41fd3f,_0x333a4d){if(_0x41fd3f[_0xf68c('0x48')]['id']){delete _0x41fd3f[_0xf68c('0x48')]['id'];}return db[_0xf68c('0x40')][_0xf68c('0x45')]({'where':{'id':_0x41fd3f[_0xf68c('0x43')]['id']}})[_0xf68c('0x24')](handleEntityNotFound(_0x333a4d,null))['then'](saveUpdates(_0x41fd3f['body'],null))['then'](respondWithResult(_0x333a4d,null))[_0xf68c('0x46')](handleError(_0x333a4d,null));};exports[_0xf68c('0x49')]=function(_0x153470,_0x16949a){return db[_0xf68c('0x40')][_0xf68c('0x45')]({'where':{'id':_0x153470[_0xf68c('0x43')]['id']}})[_0xf68c('0x24')](handleEntityNotFound(_0x16949a,null))[_0xf68c('0x24')](removeEntity(_0x16949a,null))[_0xf68c('0x46')](handleError(_0x16949a,null));};exports[_0xf68c('0x4a')]=function(_0x1a0155,_0x513744,_0x44c469){var _0x36e6e2={};var _0x139b8a={};var _0x4e86c5;var _0x1a27b5;return db[_0xf68c('0x40')][_0xf68c('0x4b')]({'where':{'id':_0x1a0155[_0xf68c('0x43')]['id']}})[_0xf68c('0x24')](handleEntityNotFound(_0x513744,null))[_0xf68c('0x24')](function(_0x4e2a4e){if(_0x4e2a4e){_0x4e86c5=_0x4e2a4e;_0x139b8a['model']=_[_0xf68c('0x30')](db[_0xf68c('0x4c')][_0xf68c('0x2a')]);_0x139b8a[_0xf68c('0x2f')]=_[_0xf68c('0x30')](_0x1a0155[_0xf68c('0x2f')]);_0x139b8a[_0xf68c('0x31')]=_[_0xf68c('0x44')](_0x139b8a[_0xf68c('0x2e')],_0x139b8a[_0xf68c('0x2f')]);_0x36e6e2[_0xf68c('0x32')]=_[_0xf68c('0x44')](_0x139b8a[_0xf68c('0x2e')],qs['fields'](_0x1a0155[_0xf68c('0x2f')][_0xf68c('0x33')]));_0x36e6e2[_0xf68c('0x32')]=_0x36e6e2[_0xf68c('0x32')][_0xf68c('0x34')]?_0x36e6e2[_0xf68c('0x32')]:_0x139b8a[_0xf68c('0x2e')];_0x36e6e2[_0xf68c('0x36')]=qs[_0xf68c('0x37')](_0x1a0155['query'][_0xf68c('0x37')]);_0x36e6e2[_0xf68c('0x38')]=qs[_0xf68c('0x31')](_[_0xf68c('0x39')](_0x1a0155[_0xf68c('0x2f')],_0x139b8a[_0xf68c('0x31')]));if(_0x1a0155[_0xf68c('0x2f')]['filter']){_0x36e6e2[_0xf68c('0x38')]=_[_0xf68c('0x3b')](_0x36e6e2['where'],{'$or':_[_0xf68c('0x29')](_0x36e6e2[_0xf68c('0x32')],function(_0x1d589c){var _0x50090b={};_0x50090b[_0x1d589c]={'$like':'%'+_0x1a0155[_0xf68c('0x2f')][_0xf68c('0x3a')]+'%'};return _0x50090b;})});}_0x36e6e2=_['merge']({},_0x36e6e2,_0x1a0155[_0xf68c('0x3d')]);return _0x4e86c5[_0xf68c('0x4a')](_0x36e6e2);}})[_0xf68c('0x24')](function(_0x4d0a87){if(_0x4d0a87){_0x1a27b5=_0x4d0a87[_0xf68c('0x34')];if(!_0x1a0155[_0xf68c('0x2f')]['hasOwnProperty'](_0xf68c('0x35'))){_0x36e6e2[_0xf68c('0x1d')]=qs[_0xf68c('0x1d')](_0x1a0155[_0xf68c('0x2f')][_0xf68c('0x1d')]);_0x36e6e2['offset']=qs['offset'](_0x1a0155[_0xf68c('0x2f')][_0xf68c('0x1b')]);}return _0x4e86c5[_0xf68c('0x4a')](_0x36e6e2);}})[_0xf68c('0x24')](function(_0x55abab){if(_0x55abab){return _0x55abab?{'count':_0x1a27b5,'rows':_0x55abab}:null;}})[_0xf68c('0x24')](respondWithResult(_0x513744,null))['catch'](handleError(_0x513744,null));};exports['addConfiguration']=function(_0x7c0796,_0x12e81a,_0x52edac){if(_0x7c0796[_0xf68c('0x48')]['id']){delete _0x7c0796[_0xf68c('0x48')]['id'];}return db[_0xf68c('0x40')][_0xf68c('0x4b')]({'where':{'id':_0x7c0796[_0xf68c('0x43')]['id']}})[_0xf68c('0x24')](handleEntityNotFound(_0x12e81a,null))[_0xf68c('0x24')](function(_0x200de5){if(_0x200de5){_0x7c0796[_0xf68c('0x48')][_0xf68c('0x4d')]=_0x200de5['id'];_0x7c0796[_0xf68c('0x48')]['Subjects']=integrations[_0xf68c('0x4e')](_0x7c0796['body'][_0xf68c('0x4f')],_0x7c0796[_0xf68c('0x48')][_0xf68c('0x2c')]);_0x7c0796[_0xf68c('0x48')][_0xf68c('0x50')]=integrations[_0xf68c('0x51')](_0x7c0796[_0xf68c('0x48')][_0xf68c('0x4f')],_0x7c0796[_0xf68c('0x48')][_0xf68c('0x2c')]);return db[_0xf68c('0x4c')][_0xf68c('0x47')](_0x7c0796[_0xf68c('0x48')],{'include':[{'model':db[_0xf68c('0x52')],'as':'Subjects'},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0xf68c('0x24')](respondWithResult(_0x12e81a,null))[_0xf68c('0x46')](handleError(_0x12e81a,null));};exports['getFields']=function(_0x4f9a69,_0x20c213,_0x5d74af){var _0x59f990;var _0xe6828a='';var _0x51d644='Task';return db[_0xf68c('0x40')][_0xf68c('0x4b')]({'where':{'id':_0x4f9a69[_0xf68c('0x43')]['id']},'attributes':['id',_0xf68c('0x53'),_0xf68c('0x54'),_0xf68c('0x55'),_0xf68c('0x56'),'password','securityToken']})[_0xf68c('0x24')](handleEntityNotFound(_0x20c213,null))['then'](function(_0x526325){if(_0x526325){_0xe6828a=_0x526325[_0xf68c('0x53')];var _0x2d9026=_0xe6828a[_0xf68c('0x57')](-0x1);if(_0x2d9026==='/'){_0xe6828a=_0xe6828a[_0xf68c('0x58')](0x0,_0xe6828a[_0xf68c('0x59')](_0x2d9026));}_0x59f990=new jsforce[(_0xf68c('0x5a'))]({'oauth2':{'loginUrl':_0xe6828a,'clientId':_0x526325['clientId'],'clientSecret':_0x526325[_0xf68c('0x55')]}});return _0x59f990[_0xf68c('0x5b')](_0x526325['username'],_0x526325[_0xf68c('0x5c')][_0xf68c('0x5d')](_0x526325[_0xf68c('0x5e')]));}})[_0xf68c('0x24')](function(_0x4e40a3){if(_0x4e40a3){if(!_[_0xf68c('0x5f')](_0x4f9a69['query']['ticketType'])){_0x51d644=_0x4f9a69[_0xf68c('0x2f')][_0xf68c('0x60')];}return _0x59f990[_0xf68c('0x61')](_0x51d644)[_0xf68c('0x62')]();}})[_0xf68c('0x24')](function(_0x4c5b0d){var _0xe4675b=[_0xf68c('0x63'),_0xf68c('0x64'),'IsReminderSet',_0xf68c('0x65'),_0xf68c('0x66'),_0xf68c('0x67')];var _0x3912da=[_0xf68c('0x68'),_0xf68c('0x69'),_0xf68c('0x6a'),_0xf68c('0x6b'),_0xf68c('0x6c'),_0xf68c('0x6d'),_0xf68c('0x6e')];if(_0x4c5b0d){_['remove'](_0x4c5b0d[_0xf68c('0x33')],function(_0x40da61){return _0xe4675b[_0xf68c('0x6f')](_0x40da61[_0xf68c('0x27')])||!_0x3912da[_0xf68c('0x6f')](_0x40da61['type']);});return{'count':_0x4c5b0d['fields']['length'],'rows':_[_0xf68c('0x29')](_0x4c5b0d[_0xf68c('0x33')],function(_0x52e68e){return{'id':_0x52e68e['name'],'name':_0x52e68e[_0xf68c('0x70')],'custom':_0x52e68e[_0xf68c('0x71')],'options':_0x52e68e['picklistValues'][_0xf68c('0x34')]>0x0?_[_0xf68c('0x29')](_0x52e68e[_0xf68c('0x72')],function(_0x3d6b82){return{'name':_0x3d6b82['label'],'value':_0x3d6b82[_0xf68c('0x73')]};}):_0x52e68e['type']==_0xf68c('0x6b')?[{'name':'True','value':_0xf68c('0x74')},{'name':_0xf68c('0x75'),'value':_0xf68c('0x76')}]:[]};})};}})[_0xf68c('0x24')](respondWithResult(_0x20c213,null))[_0xf68c('0x46')](function(_0xd35178){var _0x184063=_0x4f9a69[_0xf68c('0x2f')][_0xf68c('0x77')]?0x1f4:_0xd35178[_0xf68c('0x78')]||0x1f4;logger[_0xf68c('0x79')]('getFields,\x20%s,\x20%s,\x20%s',_0xf68c('0x7a'),_0x184063,JSON[_0xf68c('0x7b')](_0xd35178));delete _0xd35178[_0xf68c('0x27')];if(_0x184063===0x191){_0x184063=0x190;}_0x20c213[_0xf68c('0x18')](_0x184063)['send'](_0x4f9a69[_0xf68c('0x2f')][_0xf68c('0x77')]?{'message':_0xf68c('0x7c'),'statusCode':_0xd35178[_0xf68c('0x78')]}:_0xd35178);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 8032ce0..cd0ad81 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 _0x1095=['bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x34b259,_0x22c926){var _0x38142a=function(_0x571511){while(--_0x571511){_0x34b259['push'](_0x34b259['shift']());}};_0x38142a(++_0x22c926);}(_0x1095,0x1e9));var _0x5109=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x1095[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x5109('0x0'));var util=require(_0x5109('0x1'));var logger=require(_0x5109('0x2'))(_0x5109('0x3'));var moment=require(_0x5109('0x4'));var BPromise=require(_0x5109('0x5'));var rp=require(_0x5109('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5109('0x7'));var config=require(_0x5109('0x8'));var attributes=require(_0x5109('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x5109('0xa')]=function(_0x48951b,_0x3ce2b9){return _0x48951b['define'](_0x5109('0xb'),attributes,{'tableName':_0x5109('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa85a=['rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','util','api','moment','bluebird','request-promise','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa85a,0xcc));var _0xaa85=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xa85a[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require(_0xaa85('0x0'));var logger=require('../../config/logger')(_0xaa85('0x1'));var moment=require(_0xaa85('0x2'));var BPromise=require(_0xaa85('0x3'));var rp=require(_0xaa85('0x4'));var fs=require('fs');var path=require(_0xaa85('0x5'));var rimraf=require(_0xaa85('0x6'));var config=require(_0xaa85('0x7'));var attributes=require(_0xaa85('0x8'));var integrations=require(_0xaa85('0x9'));module[_0xaa85('0xa')]=function(_0xdbf70c,_0x7da8){return _0xdbf70c[_0xaa85('0xb')](_0xaa85('0xc'),attributes,{'tableName':_0xaa85('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 f02f96f..59063d9 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 _0x216d=['../../config/environment','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowSalesforceAccount','SalesforceAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x98ac1f,_0x2effb0){var _0x1579d1=function(_0x54b8d7){while(--_0x54b8d7){_0x98ac1f['push'](_0x98ac1f['shift']());}};_0x1579d1(++_0x2effb0);}(_0x216d,0x120));var _0xd216=function(_0x5157c6,_0x5a86b8){_0x5157c6=_0x5157c6-0x0;var _0x37531b=_0x216d[_0x5157c6];return _0x37531b;};'use strict';var _=require(_0xd216('0x0'));var util=require(_0xd216('0x1'));var moment=require('moment');var BPromise=require(_0xd216('0x2'));var rs=require(_0xd216('0x3'));var fs=require('fs');var Redis=require(_0xd216('0x4'));var db=require(_0xd216('0x5'))['db'];var utils=require(_0xd216('0x6'));var logger=require(_0xd216('0x7'))('rpc');var config=require(_0xd216('0x8'));var jayson=require(_0xd216('0x9'));var client=jayson[_0xd216('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e9eab,_0xb2bf40,_0x38941a){return new BPromise(function(_0x7e47a2,_0x2f131d){return client[_0xd216('0xb')](_0x4e9eab,_0x38941a)[_0xd216('0xc')](function(_0x411662){logger[_0xd216('0xd')](_0xd216('0xe'),_0xb2bf40,'request\x20sent');logger[_0xd216('0xf')](_0xd216('0x10'),_0xb2bf40,_0xd216('0x11'),JSON[_0xd216('0x12')](_0x411662));if(_0x411662['error']){if(_0x411662['error'][_0xd216('0x13')]===0x1f4){logger[_0xd216('0x14')](_0xd216('0xe'),_0xb2bf40,_0x411662[_0xd216('0x14')][_0xd216('0x15')]);return _0x2f131d(_0x411662[_0xd216('0x14')]['message']);}logger[_0xd216('0x14')]('SalesforceAccount,\x20%s,\x20%s',_0xb2bf40,_0x411662[_0xd216('0x14')]['message']);return _0x7e47a2(_0x411662[_0xd216('0x14')]['message']);}else{logger[_0xd216('0xd')](_0xd216('0xe'),_0xb2bf40,'request\x20sent');_0x7e47a2(_0x411662[_0xd216('0x16')]['message']);}})[_0xd216('0x17')](function(_0x291913){logger['error'](_0xd216('0xe'),_0xb2bf40,_0x291913);_0x2f131d(_0x291913);});});}exports[_0xd216('0x18')]=function(_0x19e1b7){var _0x21db61=this;return new Promise(function(_0x330e2b,_0x1ca6e5){return db['SalesforceAccount'][_0xd216('0x19')]({'raw':_0x19e1b7['options']?_0x19e1b7[_0xd216('0x1a')][_0xd216('0x1b')]===undefined?!![]:![]:!![],'where':_0x19e1b7[_0xd216('0x1a')]?_0x19e1b7['options'][_0xd216('0x1c')]||null:null,'attributes':_0x19e1b7[_0xd216('0x1a')]?_0x19e1b7[_0xd216('0x1a')][_0xd216('0x1d')]||null:null,'limit':_0x19e1b7[_0xd216('0x1a')]?_0x19e1b7[_0xd216('0x1a')][_0xd216('0x1e')]||null:null,'include':_0x19e1b7[_0xd216('0x1a')]?_0x19e1b7[_0xd216('0x1a')]['include']?_['map'](_0x19e1b7['options'][_0xd216('0x1f')],function(_0x506408){return{'model':db[_0x506408[_0xd216('0x20')]],'as':_0x506408['as'],'attributes':_0x506408['attributes'],'include':_0x506408[_0xd216('0x1f')]?_['map'](_0x506408[_0xd216('0x1f')],function(_0x97cfb7){return{'model':db[_0x97cfb7[_0xd216('0x20')]],'as':_0x97cfb7['as'],'attributes':_0x97cfb7[_0xd216('0x1d')],'include':_0x97cfb7[_0xd216('0x1f')]?_[_0xd216('0x21')](_0x97cfb7['include'],function(_0x4edc8c){return{'model':db[_0x4edc8c['model']],'as':_0x4edc8c['as'],'attributes':_0x4edc8c[_0xd216('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd216('0xc')](function(_0x4d7e2e){logger['info'](_0xd216('0x18'),_0x19e1b7);logger['debug']('GetSalesforceAccount',_0x19e1b7,JSON[_0xd216('0x12')](_0x4d7e2e));_0x330e2b(_0x4d7e2e);})[_0xd216('0x17')](function(_0x48b3d6){logger[_0xd216('0x14')](_0xd216('0x18'),_0x48b3d6[_0xd216('0x15')],_0x19e1b7);_0x1ca6e5(_0x21db61[_0xd216('0x14')](0x1f4,_0x48b3d6[_0xd216('0x15')]));});});};exports[_0xd216('0x22')]=function(_0x10c12c){var _0xd908a3=this;return new Promise(function(_0x216fdc,_0x308d70){return db[_0xd216('0x23')][_0xd216('0x24')]({'raw':_0x10c12c[_0xd216('0x1a')]?_0x10c12c['options'][_0xd216('0x1b')]===undefined?!![]:![]:!![],'where':_0x10c12c[_0xd216('0x1a')]?_0x10c12c[_0xd216('0x1a')]['where']||null:null,'attributes':_0x10c12c[_0xd216('0x1a')]?_0x10c12c[_0xd216('0x1a')]['attributes']||null:null,'include':_0x10c12c[_0xd216('0x1a')]?_0x10c12c[_0xd216('0x1a')]['include']?_['map'](_0x10c12c['options'][_0xd216('0x1f')],function(_0x5df6fe){return{'model':db[_0x5df6fe[_0xd216('0x20')]],'as':_0x5df6fe['as'],'attributes':_0x5df6fe['attributes'],'include':_0x5df6fe[_0xd216('0x1f')]?_[_0xd216('0x21')](_0x5df6fe[_0xd216('0x1f')],function(_0x3fccd8){return{'model':db[_0x3fccd8[_0xd216('0x20')]],'as':_0x3fccd8['as'],'attributes':_0x3fccd8[_0xd216('0x1d')],'include':_0x3fccd8[_0xd216('0x1f')]?_['map'](_0x3fccd8['include'],function(_0x428539){return{'model':db[_0x428539[_0xd216('0x20')]],'as':_0x428539['as'],'attributes':_0x428539['attributes']};}):[]};}):[]};}):[]:[]})[_0xd216('0xc')](function(_0x265a45){logger[_0xd216('0xd')](_0xd216('0x22'),_0x10c12c);logger[_0xd216('0xf')](_0xd216('0x22'),_0x10c12c,JSON[_0xd216('0x12')](_0x265a45));_0x216fdc(_0x265a45);})['catch'](function(_0x570024){logger['error'](_0xd216('0x22'),_0x570024['message'],_0x10c12c);_0x308d70(_0xd908a3['error'](0x1f4,_0x570024[_0xd216('0x15')]));});});}; \ No newline at end of file +var _0x609b=['info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetSalesforceAccount','options','limit','include','attributes','model','then','SalesforceAccount','find','raw','where','map','ShowSalesforceAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request'];(function(_0x5d8ae3,_0x13d7bc){var _0x28f388=function(_0x1e33b4){while(--_0x1e33b4){_0x5d8ae3['push'](_0x5d8ae3['shift']());}};_0x28f388(++_0x13d7bc);}(_0x609b,0x155));var _0xb609=function(_0x2783e3,_0x16f5e4){_0x2783e3=_0x2783e3-0x0;var _0x1b2a9a=_0x609b[_0x2783e3];return _0x1b2a9a;};'use strict';var _=require(_0xb609('0x0'));var util=require(_0xb609('0x1'));var moment=require(_0xb609('0x2'));var BPromise=require('bluebird');var rs=require(_0xb609('0x3'));var fs=require('fs');var Redis=require(_0xb609('0x4'));var db=require(_0xb609('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb609('0x6'))('rpc');var config=require(_0xb609('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb609('0x8')][_0xb609('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x425c5a,_0x41e898,_0x2b79ae){return new BPromise(function(_0x14ed39,_0x5d0a2f){return client[_0xb609('0xa')](_0x425c5a,_0x2b79ae)['then'](function(_0x413dc3){logger[_0xb609('0xb')](_0xb609('0xc'),_0x41e898,_0xb609('0xd'));logger[_0xb609('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x41e898,_0xb609('0xd'),JSON[_0xb609('0xf')](_0x413dc3));if(_0x413dc3[_0xb609('0x10')]){if(_0x413dc3['error']['code']===0x1f4){logger[_0xb609('0x10')](_0xb609('0xc'),_0x41e898,_0x413dc3[_0xb609('0x10')]['message']);return _0x5d0a2f(_0x413dc3[_0xb609('0x10')][_0xb609('0x11')]);}logger[_0xb609('0x10')](_0xb609('0xc'),_0x41e898,_0x413dc3['error'][_0xb609('0x11')]);return _0x14ed39(_0x413dc3[_0xb609('0x10')][_0xb609('0x11')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x41e898,'request\x20sent');_0x14ed39(_0x413dc3['result']['message']);}})[_0xb609('0x12')](function(_0x33fbc2){logger[_0xb609('0x10')](_0xb609('0xc'),_0x41e898,_0x33fbc2);_0x5d0a2f(_0x33fbc2);});});}exports[_0xb609('0x13')]=function(_0x569626){var _0x3c159e=this;return new Promise(function(_0x6e8909,_0x4e7171){return db['SalesforceAccount']['findAll']({'raw':_0x569626[_0xb609('0x14')]?_0x569626[_0xb609('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x569626[_0xb609('0x14')]?_0x569626[_0xb609('0x14')]['where']||null:null,'attributes':_0x569626[_0xb609('0x14')]?_0x569626[_0xb609('0x14')]['attributes']||null:null,'limit':_0x569626['options']?_0x569626[_0xb609('0x14')][_0xb609('0x15')]||null:null,'include':_0x569626[_0xb609('0x14')]?_0x569626[_0xb609('0x14')][_0xb609('0x16')]?_['map'](_0x569626[_0xb609('0x14')]['include'],function(_0x462b30){return{'model':db[_0x462b30['model']],'as':_0x462b30['as'],'attributes':_0x462b30[_0xb609('0x17')],'include':_0x462b30['include']?_['map'](_0x462b30[_0xb609('0x16')],function(_0x1ea761){return{'model':db[_0x1ea761['model']],'as':_0x1ea761['as'],'attributes':_0x1ea761[_0xb609('0x17')],'include':_0x1ea761['include']?_['map'](_0x1ea761[_0xb609('0x16')],function(_0x23c847){return{'model':db[_0x23c847[_0xb609('0x18')]],'as':_0x23c847['as'],'attributes':_0x23c847[_0xb609('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb609('0x19')](function(_0x359437){logger['info'](_0xb609('0x13'),_0x569626);logger['debug'](_0xb609('0x13'),_0x569626,JSON[_0xb609('0xf')](_0x359437));_0x6e8909(_0x359437);})[_0xb609('0x12')](function(_0xa70906){logger[_0xb609('0x10')](_0xb609('0x13'),_0xa70906[_0xb609('0x11')],_0x569626);_0x4e7171(_0x3c159e[_0xb609('0x10')](0x1f4,_0xa70906[_0xb609('0x11')]));});});};exports['ShowSalesforceAccount']=function(_0x3d48dc){var _0x5c0b83=this;return new Promise(function(_0x409950,_0x29e8a5){return db[_0xb609('0x1a')][_0xb609('0x1b')]({'raw':_0x3d48dc[_0xb609('0x14')]?_0x3d48dc[_0xb609('0x14')][_0xb609('0x1c')]===undefined?!![]:![]:!![],'where':_0x3d48dc[_0xb609('0x14')]?_0x3d48dc['options'][_0xb609('0x1d')]||null:null,'attributes':_0x3d48dc[_0xb609('0x14')]?_0x3d48dc[_0xb609('0x14')][_0xb609('0x17')]||null:null,'include':_0x3d48dc[_0xb609('0x14')]?_0x3d48dc[_0xb609('0x14')][_0xb609('0x16')]?_[_0xb609('0x1e')](_0x3d48dc[_0xb609('0x14')][_0xb609('0x16')],function(_0xc83ad){return{'model':db[_0xc83ad[_0xb609('0x18')]],'as':_0xc83ad['as'],'attributes':_0xc83ad[_0xb609('0x17')],'include':_0xc83ad[_0xb609('0x16')]?_[_0xb609('0x1e')](_0xc83ad[_0xb609('0x16')],function(_0x4da633){return{'model':db[_0x4da633[_0xb609('0x18')]],'as':_0x4da633['as'],'attributes':_0x4da633[_0xb609('0x17')],'include':_0x4da633['include']?_[_0xb609('0x1e')](_0x4da633['include'],function(_0x2549c3){return{'model':db[_0x2549c3[_0xb609('0x18')]],'as':_0x2549c3['as'],'attributes':_0x2549c3['attributes']};}):[]};}):[]};}):[]:[]})[_0xb609('0x19')](function(_0x21f9b2){logger[_0xb609('0xb')](_0xb609('0x1f'),_0x3d48dc);logger[_0xb609('0xe')]('ShowSalesforceAccount',_0x3d48dc,JSON[_0xb609('0xf')](_0x21f9b2));_0x409950(_0x21f9b2);})['catch'](function(_0x484946){logger[_0xb609('0x10')](_0xb609('0x1f'),_0x484946[_0xb609('0x11')],_0x3d48dc);_0x29e8a5(_0x5c0b83[_0xb609('0x10')](0x1f4,_0x484946['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 61eee74..a16db79 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(_0x2c0a5f,_0x1efaec){var _0xc07d94=function(_0x2b61a5){while(--_0x2b61a5){_0x2c0a5f['push'](_0x2c0a5f['shift']());}};_0xc07d94(++_0x1efaec);}(_0x2ef3,0xba));var _0x32ef=function(_0x47f4ea,_0xbd9a83){_0x47f4ea=_0x47f4ea-0x0;var _0x543b46=_0x2ef3[_0x47f4ea];return _0x543b46;};'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(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xdb28,0x106));var _0x8db2=function(_0x579d93,_0x25f482){_0x579d93=_0x579d93-0x0;var _0x1a1b12=_0xdb28[_0x579d93];return _0x1a1b12;};'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 2e98f24..15c406e 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 _0x220c=['account','sequelize','STRING','Task','Case','contact_lead','contact','lead','account_contact_lead','ENUM','nothing'];(function(_0x25d11d,_0xe0ff0c){var _0x502980=function(_0x42eb12){while(--_0x42eb12){_0x25d11d['push'](_0x25d11d['shift']());}};_0x502980(++_0xe0ff0c);}(_0x220c,0xf3));var _0xc220=function(_0x5366d4,_0x5e1716){_0x5366d4=_0x5366d4-0x0;var _0x57c204=_0x220c[_0x5366d4];return _0x57c204;};'use strict';var Sequelize=require(_0xc220('0x0'));module['exports']={'name':{'type':Sequelize[_0xc220('0x1')]},'description':{'type':Sequelize[_0xc220('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xc220('0x2'),_0xc220('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0xc220('0x4'),_0xc220('0x5'),_0xc220('0x6'),_0xc220('0x7'),'account'),'defaultValue':_0xc220('0x4')},'moduleCreate':{'type':Sequelize[_0xc220('0x8')](_0xc220('0x9'),_0xc220('0x5'),_0xc220('0x6'),_0xc220('0xa')),'defaultValue':_0xc220('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xc220('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xc220('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xc220('0x1')]}}; \ No newline at end of file +var _0x0780=['exports','STRING','ENUM','Task','contact_lead','contact','account_contact_lead','account','nothing','lead','sequelize'];(function(_0x148d66,_0x3e1074){var _0x56a7bd=function(_0x33ebfa){while(--_0x33ebfa){_0x148d66['push'](_0x148d66['shift']());}};_0x56a7bd(++_0x3e1074);}(_0x0780,0x18b));var _0x0078=function(_0x137366,_0x12a66d){_0x137366=_0x137366-0x0;var _0x170ef7=_0x0780[_0x137366];return _0x170ef7;};'use strict';var Sequelize=require(_0x0078('0x0'));module[_0x0078('0x1')]={'name':{'type':Sequelize[_0x0078('0x2')]},'description':{'type':Sequelize[_0x0078('0x2')]},'ticketType':{'type':Sequelize[_0x0078('0x3')](_0x0078('0x4'),'Case'),'defaultValue':_0x0078('0x4')},'moduleSearch':{'type':Sequelize[_0x0078('0x3')](_0x0078('0x5'),_0x0078('0x6'),'lead',_0x0078('0x7'),_0x0078('0x8')),'defaultValue':_0x0078('0x5')},'moduleCreate':{'type':Sequelize['ENUM'](_0x0078('0x9'),_0x0078('0x6'),_0x0078('0xa'),_0x0078('0x8')),'defaultValue':_0x0078('0xa')},'leadId':{'type':Sequelize[_0x0078('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x0078('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x0078('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x0078('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index cee456f..86bbb37 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 _0xbb07=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','error','stack','name','send','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','where','count','includeAll','findAll','catch','params','keys','include','find','create','body','destroy','getFields','findOne','SalesforceField','getSubjects','options','getDescriptions'];(function(_0x3c73e5,_0x198b7b){var _0x223370=function(_0x14657d){while(--_0x14657d){_0x3c73e5['push'](_0x3c73e5['shift']());}};_0x223370(++_0x198b7b);}(_0xbb07,0xf0));var _0x7bb0=function(_0x405531,_0x1c6e9b){_0x405531=_0x405531-0x0;var _0x2784f6=_0xbb07[_0x405531];return _0x2784f6;};'use strict';var emlformat=require(_0x7bb0('0x0'));var rimraf=require(_0x7bb0('0x1'));var zipdir=require(_0x7bb0('0x2'));var jsonpatch=require(_0x7bb0('0x3'));var rp=require(_0x7bb0('0x4'));var moment=require(_0x7bb0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7bb0('0x6'));var util=require('util');var path=require(_0x7bb0('0x7'));var sox=require(_0x7bb0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bb0('0x9'));var _=require(_0x7bb0('0xa'));var squel=require(_0x7bb0('0xb'));var crypto=require(_0x7bb0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7bb0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7bb0('0xe'));var Papa=require('papaparse');var Redis=require(_0x7bb0('0xf'));var authService=require(_0x7bb0('0x10'));var qs=require(_0x7bb0('0x11'));var as=require(_0x7bb0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bb0('0x13'))(_0x7bb0('0x14'));var utils=require(_0x7bb0('0x15'));var config=require(_0x7bb0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7bb0('0x17'))['db'];function respondWithStatusCode(_0x17f39a,_0x382314){_0x382314=_0x382314||0xcc;return function(_0x3f8720){if(_0x3f8720){return _0x17f39a[_0x7bb0('0x18')](_0x382314);}return _0x17f39a[_0x7bb0('0x19')](_0x382314)[_0x7bb0('0x1a')]();};}function respondWithResult(_0x3abe4a,_0x5f4c0b){_0x5f4c0b=_0x5f4c0b||0xc8;return function(_0x5b3b7d){if(_0x5b3b7d){return _0x3abe4a['status'](_0x5f4c0b)[_0x7bb0('0x1b')](_0x5b3b7d);}};}function respondWithFilteredResult(_0x271584,_0x56a6d8){return function(_0x150172){if(_0x150172){var _0x3a7d0e=typeof _0x56a6d8[_0x7bb0('0x1c')]===_0x7bb0('0x1d')&&typeof _0x56a6d8[_0x7bb0('0x1e')]===_0x7bb0('0x1d');var _0x400e2d=_0x150172['count'];var _0x1eff21=_0x3a7d0e?0x0:_0x56a6d8[_0x7bb0('0x1c')];var _0xf32c0a=_0x3a7d0e?_0x150172['count']:_0x56a6d8[_0x7bb0('0x1c')]+_0x56a6d8['limit'];var _0x1acee9;if(_0xf32c0a>=_0x400e2d){_0xf32c0a=_0x400e2d;_0x1acee9=0xc8;}else{_0x1acee9=0xce;}_0x271584['status'](_0x1acee9);return _0x271584[_0x7bb0('0x1f')](_0x7bb0('0x20'),_0x1eff21+'-'+_0xf32c0a+'/'+_0x400e2d)['json'](_0x150172);}return null;};}function patchUpdates(_0x4a4fe6){return function(_0x4f554e){try{jsonpatch['apply'](_0x4f554e,_0x4a4fe6,!![]);}catch(_0x2372d7){return BPromise[_0x7bb0('0x21')](_0x2372d7);}return _0x4f554e[_0x7bb0('0x22')]();};}function saveUpdates(_0x3f0304,_0x6c5ec2){return function(_0x5622c4){if(_0x5622c4){return _0x5622c4[_0x7bb0('0x23')](_0x3f0304)[_0x7bb0('0x24')](function(_0x7e5126){return _0x7e5126;});}return null;};}function removeEntity(_0x2993c9,_0x2236b8){return function(_0x5171ba){if(_0x5171ba){return _0x5171ba['destroy']()[_0x7bb0('0x24')](function(){_0x2993c9[_0x7bb0('0x19')](0xcc)[_0x7bb0('0x1a')]();});}};}function handleEntityNotFound(_0x2da65d,_0x2d6644){return function(_0x2d6e62){if(!_0x2d6e62){_0x2da65d[_0x7bb0('0x18')](0x194);}return _0x2d6e62;};}function handleError(_0x5993d1,_0x548f6f){_0x548f6f=_0x548f6f||0x1f4;return function(_0x165b92){logger[_0x7bb0('0x25')](_0x165b92[_0x7bb0('0x26')]);if(_0x165b92['name']){delete _0x165b92[_0x7bb0('0x27')];}_0x5993d1[_0x7bb0('0x19')](_0x548f6f)[_0x7bb0('0x28')](_0x165b92);};}exports['index']=function(_0x1db982,_0x238d25){var _0x4ff888={},_0x1757de={},_0x238b9b={'count':0x0,'rows':[]};var _0x3aab15=_[_0x7bb0('0x29')](db[_0x7bb0('0x2a')][_0x7bb0('0x2b')],function(_0x448deb){return{'name':_0x448deb[_0x7bb0('0x2c')],'type':_0x448deb['type'][_0x7bb0('0x2d')]};});_0x1757de[_0x7bb0('0x2e')]=_[_0x7bb0('0x29')](_0x3aab15,_0x7bb0('0x27'));_0x1757de[_0x7bb0('0x2f')]=_['keys'](_0x1db982[_0x7bb0('0x2f')]);_0x1757de[_0x7bb0('0x30')]=_[_0x7bb0('0x31')](_0x1757de[_0x7bb0('0x2e')],_0x1757de[_0x7bb0('0x2f')]);_0x4ff888['attributes']=_[_0x7bb0('0x31')](_0x1757de['model'],qs['fields'](_0x1db982[_0x7bb0('0x2f')][_0x7bb0('0x32')]));_0x4ff888['attributes']=_0x4ff888[_0x7bb0('0x33')][_0x7bb0('0x34')]?_0x4ff888[_0x7bb0('0x33')]:_0x1757de[_0x7bb0('0x2e')];if(!_0x1db982[_0x7bb0('0x2f')][_0x7bb0('0x35')](_0x7bb0('0x36'))){_0x4ff888[_0x7bb0('0x1e')]=qs['limit'](_0x1db982[_0x7bb0('0x2f')][_0x7bb0('0x1e')]);_0x4ff888[_0x7bb0('0x1c')]=qs[_0x7bb0('0x1c')](_0x1db982['query']['offset']);}_0x4ff888[_0x7bb0('0x37')]=qs[_0x7bb0('0x38')](_0x1db982['query'][_0x7bb0('0x38')]);_0x4ff888['where']=qs[_0x7bb0('0x30')](_[_0x7bb0('0x39')](_0x1db982['query'],_0x1757de[_0x7bb0('0x30')]),_0x3aab15);if(_0x1db982[_0x7bb0('0x2f')][_0x7bb0('0x3a')]){_0x4ff888['where']=_[_0x7bb0('0x3b')](_0x4ff888['where'],{'$or':_[_0x7bb0('0x29')](_0x3aab15,function(_0x23be67){if(_0x23be67[_0x7bb0('0x3c')]!==_0x7bb0('0x3d')){var _0x5c8789={};_0x5c8789[_0x23be67[_0x7bb0('0x27')]]={'$like':'%'+_0x1db982[_0x7bb0('0x2f')][_0x7bb0('0x3a')]+'%'};return _0x5c8789;}})});}_0x4ff888=_[_0x7bb0('0x3b')]({},_0x4ff888,_0x1db982['options']);var _0x51f42f={'where':_0x4ff888[_0x7bb0('0x3e')]};return db[_0x7bb0('0x2a')][_0x7bb0('0x3f')](_0x51f42f)[_0x7bb0('0x24')](function(_0x5f5da9){_0x238b9b[_0x7bb0('0x3f')]=_0x5f5da9;if(_0x1db982[_0x7bb0('0x2f')][_0x7bb0('0x40')]){_0x4ff888['include']=[{'all':!![]}];}return db[_0x7bb0('0x2a')][_0x7bb0('0x41')](_0x4ff888);})[_0x7bb0('0x24')](function(_0x58003a){_0x238b9b['rows']=_0x58003a;return _0x238b9b;})[_0x7bb0('0x24')](respondWithFilteredResult(_0x238d25,_0x4ff888))[_0x7bb0('0x42')](handleError(_0x238d25,null));};exports['show']=function(_0x32853a,_0xadf39){var _0x5b57c7={'raw':![],'where':{'id':_0x32853a[_0x7bb0('0x43')]['id']}},_0x34d487={};_0x34d487[_0x7bb0('0x2e')]=_[_0x7bb0('0x44')](db[_0x7bb0('0x2a')][_0x7bb0('0x2b')]);_0x34d487[_0x7bb0('0x2f')]=_['keys'](_0x32853a[_0x7bb0('0x2f')]);_0x34d487[_0x7bb0('0x30')]=_['intersection'](_0x34d487[_0x7bb0('0x2e')],_0x34d487[_0x7bb0('0x2f')]);_0x5b57c7[_0x7bb0('0x33')]=_['intersection'](_0x34d487[_0x7bb0('0x2e')],qs[_0x7bb0('0x32')](_0x32853a[_0x7bb0('0x2f')]['fields']));_0x5b57c7[_0x7bb0('0x33')]=_0x5b57c7[_0x7bb0('0x33')]['length']?_0x5b57c7['attributes']:_0x34d487[_0x7bb0('0x2e')];if(_0x32853a['query'][_0x7bb0('0x40')]){_0x5b57c7[_0x7bb0('0x45')]=[{'all':!![]}];}_0x5b57c7=_[_0x7bb0('0x3b')]({},_0x5b57c7,_0x32853a['options']);return db[_0x7bb0('0x2a')][_0x7bb0('0x46')](_0x5b57c7)[_0x7bb0('0x24')](handleEntityNotFound(_0xadf39,null))[_0x7bb0('0x24')](respondWithResult(_0xadf39,null))['catch'](handleError(_0xadf39,null));};exports[_0x7bb0('0x47')]=function(_0x3203c9,_0x3bc5d6){return db[_0x7bb0('0x2a')][_0x7bb0('0x47')](_0x3203c9[_0x7bb0('0x48')],{})['then'](respondWithResult(_0x3bc5d6,0xc9))[_0x7bb0('0x42')](handleError(_0x3bc5d6,null));};exports[_0x7bb0('0x23')]=function(_0x27497a,_0x5937b3){if(_0x27497a[_0x7bb0('0x48')]['id']){delete _0x27497a['body']['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x27497a['params']['id']}})['then'](handleEntityNotFound(_0x5937b3,null))[_0x7bb0('0x24')](saveUpdates(_0x27497a['body'],null))['then'](respondWithResult(_0x5937b3,null))[_0x7bb0('0x42')](handleError(_0x5937b3,null));};exports[_0x7bb0('0x49')]=function(_0x49c46c,_0x69dd14){return db[_0x7bb0('0x2a')][_0x7bb0('0x46')]({'where':{'id':_0x49c46c[_0x7bb0('0x43')]['id']}})[_0x7bb0('0x24')](handleEntityNotFound(_0x69dd14,null))[_0x7bb0('0x24')](removeEntity(_0x69dd14,null))[_0x7bb0('0x42')](handleError(_0x69dd14,null));};exports[_0x7bb0('0x4a')]=function(_0x15f389,_0xa5754f,_0xdc44ab){var _0x143637={};var _0x4348a6={};var _0x5a8f69;var _0x49bdca;return db['SalesforceConfiguration'][_0x7bb0('0x4b')]({'where':{'id':_0x15f389[_0x7bb0('0x43')]['id']}})['then'](handleEntityNotFound(_0xa5754f,null))[_0x7bb0('0x24')](function(_0x472d27){if(_0x472d27){_0x5a8f69=_0x472d27;_0x4348a6[_0x7bb0('0x2e')]=_['keys'](db[_0x7bb0('0x4c')]['rawAttributes']);_0x4348a6['query']=_['keys'](_0x15f389[_0x7bb0('0x2f')]);_0x4348a6[_0x7bb0('0x30')]=_['intersection'](_0x4348a6[_0x7bb0('0x2e')],_0x4348a6[_0x7bb0('0x2f')]);_0x143637[_0x7bb0('0x33')]=_[_0x7bb0('0x31')](_0x4348a6[_0x7bb0('0x2e')],qs[_0x7bb0('0x32')](_0x15f389[_0x7bb0('0x2f')][_0x7bb0('0x32')]));_0x143637[_0x7bb0('0x33')]=_0x143637['attributes'][_0x7bb0('0x34')]?_0x143637['attributes']:_0x4348a6[_0x7bb0('0x2e')];_0x143637[_0x7bb0('0x37')]=qs['sort'](_0x15f389['query'][_0x7bb0('0x38')]);_0x143637[_0x7bb0('0x3e')]=qs['filters'](_[_0x7bb0('0x39')](_0x15f389[_0x7bb0('0x2f')],_0x4348a6[_0x7bb0('0x30')]));if(_0x15f389[_0x7bb0('0x2f')]['filter']){_0x143637[_0x7bb0('0x3e')]=_[_0x7bb0('0x3b')](_0x143637[_0x7bb0('0x3e')],{'$or':_['map'](_0x143637[_0x7bb0('0x33')],function(_0x4adc38){var _0x3b054a={};_0x3b054a[_0x4adc38]={'$like':'%'+_0x15f389[_0x7bb0('0x2f')][_0x7bb0('0x3a')]+'%'};return _0x3b054a;})});}_0x143637=_[_0x7bb0('0x3b')]({},_0x143637,_0x15f389['options']);return _0x5a8f69[_0x7bb0('0x4a')](_0x143637);}})[_0x7bb0('0x24')](function(_0x5cfe44){if(_0x5cfe44){_0x49bdca=_0x5cfe44[_0x7bb0('0x34')];if(!_0x15f389[_0x7bb0('0x2f')]['hasOwnProperty'](_0x7bb0('0x36'))){_0x143637[_0x7bb0('0x1e')]=qs[_0x7bb0('0x1e')](_0x15f389[_0x7bb0('0x2f')][_0x7bb0('0x1e')]);_0x143637[_0x7bb0('0x1c')]=qs['offset'](_0x15f389[_0x7bb0('0x2f')][_0x7bb0('0x1c')]);}return _0x5a8f69[_0x7bb0('0x4a')](_0x143637);}})['then'](function(_0x176dbd){if(_0x176dbd){return _0x176dbd?{'count':_0x49bdca,'rows':_0x176dbd}:null;}})[_0x7bb0('0x24')](respondWithResult(_0xa5754f,null))[_0x7bb0('0x42')](handleError(_0xa5754f,null));};exports[_0x7bb0('0x4d')]=function(_0x52e067,_0x163619,_0x380db1){var _0x5eb738={};var _0xb67fee={};var _0x3afac5;var _0x571343;return db[_0x7bb0('0x2a')][_0x7bb0('0x4b')]({'where':{'id':_0x52e067[_0x7bb0('0x43')]['id']}})[_0x7bb0('0x24')](handleEntityNotFound(_0x163619,null))[_0x7bb0('0x24')](function(_0x59845e){if(_0x59845e){_0x3afac5=_0x59845e;_0xb67fee[_0x7bb0('0x2e')]=_[_0x7bb0('0x44')](db[_0x7bb0('0x4c')][_0x7bb0('0x2b')]);_0xb67fee[_0x7bb0('0x2f')]=_[_0x7bb0('0x44')](_0x52e067[_0x7bb0('0x2f')]);_0xb67fee[_0x7bb0('0x30')]=_[_0x7bb0('0x31')](_0xb67fee[_0x7bb0('0x2e')],_0xb67fee[_0x7bb0('0x2f')]);_0x5eb738['attributes']=_[_0x7bb0('0x31')](_0xb67fee[_0x7bb0('0x2e')],qs[_0x7bb0('0x32')](_0x52e067[_0x7bb0('0x2f')]['fields']));_0x5eb738[_0x7bb0('0x33')]=_0x5eb738[_0x7bb0('0x33')][_0x7bb0('0x34')]?_0x5eb738[_0x7bb0('0x33')]:_0xb67fee[_0x7bb0('0x2e')];_0x5eb738[_0x7bb0('0x37')]=qs[_0x7bb0('0x38')](_0x52e067[_0x7bb0('0x2f')]['sort']);_0x5eb738[_0x7bb0('0x3e')]=qs[_0x7bb0('0x30')](_[_0x7bb0('0x39')](_0x52e067[_0x7bb0('0x2f')],_0xb67fee[_0x7bb0('0x30')]));if(_0x52e067[_0x7bb0('0x2f')][_0x7bb0('0x3a')]){_0x5eb738[_0x7bb0('0x3e')]=_[_0x7bb0('0x3b')](_0x5eb738[_0x7bb0('0x3e')],{'$or':_[_0x7bb0('0x29')](_0x5eb738['attributes'],function(_0x342de6){var _0xb0c6a={};_0xb0c6a[_0x342de6]={'$like':'%'+_0x52e067[_0x7bb0('0x2f')][_0x7bb0('0x3a')]+'%'};return _0xb0c6a;})});}_0x5eb738=_['merge']({},_0x5eb738,_0x52e067[_0x7bb0('0x4e')]);return _0x3afac5['getSubjects'](_0x5eb738);}})[_0x7bb0('0x24')](function(_0x2ba0a3){if(_0x2ba0a3){_0x571343=_0x2ba0a3[_0x7bb0('0x34')];if(!_0x52e067['query'][_0x7bb0('0x35')](_0x7bb0('0x36'))){_0x5eb738[_0x7bb0('0x1e')]=qs[_0x7bb0('0x1e')](_0x52e067['query'][_0x7bb0('0x1e')]);_0x5eb738[_0x7bb0('0x1c')]=qs[_0x7bb0('0x1c')](_0x52e067['query'][_0x7bb0('0x1c')]);}return _0x3afac5[_0x7bb0('0x4d')](_0x5eb738);}})[_0x7bb0('0x24')](function(_0x7dec83){if(_0x7dec83){return _0x7dec83?{'count':_0x571343,'rows':_0x7dec83}:null;}})[_0x7bb0('0x24')](respondWithResult(_0x163619,null))[_0x7bb0('0x42')](handleError(_0x163619,null));};exports['getDescriptions']=function(_0x30fa7b,_0x117592,_0x465c88){var _0x28afad={};var _0x3f4c11={};var _0x43832f;var _0x2b2e08;return db[_0x7bb0('0x2a')][_0x7bb0('0x4b')]({'where':{'id':_0x30fa7b[_0x7bb0('0x43')]['id']}})[_0x7bb0('0x24')](handleEntityNotFound(_0x117592,null))[_0x7bb0('0x24')](function(_0x48ee2c){if(_0x48ee2c){_0x43832f=_0x48ee2c;_0x3f4c11['model']=_[_0x7bb0('0x44')](db[_0x7bb0('0x4c')][_0x7bb0('0x2b')]);_0x3f4c11[_0x7bb0('0x2f')]=_[_0x7bb0('0x44')](_0x30fa7b['query']);_0x3f4c11[_0x7bb0('0x30')]=_[_0x7bb0('0x31')](_0x3f4c11[_0x7bb0('0x2e')],_0x3f4c11[_0x7bb0('0x2f')]);_0x28afad[_0x7bb0('0x33')]=_[_0x7bb0('0x31')](_0x3f4c11[_0x7bb0('0x2e')],qs['fields'](_0x30fa7b[_0x7bb0('0x2f')][_0x7bb0('0x32')]));_0x28afad[_0x7bb0('0x33')]=_0x28afad[_0x7bb0('0x33')]['length']?_0x28afad[_0x7bb0('0x33')]:_0x3f4c11['model'];_0x28afad[_0x7bb0('0x37')]=qs[_0x7bb0('0x38')](_0x30fa7b[_0x7bb0('0x2f')][_0x7bb0('0x38')]);_0x28afad[_0x7bb0('0x3e')]=qs[_0x7bb0('0x30')](_[_0x7bb0('0x39')](_0x30fa7b[_0x7bb0('0x2f')],_0x3f4c11[_0x7bb0('0x30')]));if(_0x30fa7b[_0x7bb0('0x2f')][_0x7bb0('0x3a')]){_0x28afad[_0x7bb0('0x3e')]=_[_0x7bb0('0x3b')](_0x28afad[_0x7bb0('0x3e')],{'$or':_[_0x7bb0('0x29')](_0x28afad[_0x7bb0('0x33')],function(_0x45151d){var _0x5ed028={};_0x5ed028[_0x45151d]={'$like':'%'+_0x30fa7b['query'][_0x7bb0('0x3a')]+'%'};return _0x5ed028;})});}_0x28afad=_['merge']({},_0x28afad,_0x30fa7b['options']);return _0x43832f[_0x7bb0('0x4f')](_0x28afad);}})['then'](function(_0x50a8ab){if(_0x50a8ab){_0x2b2e08=_0x50a8ab[_0x7bb0('0x34')];if(!_0x30fa7b[_0x7bb0('0x2f')][_0x7bb0('0x35')](_0x7bb0('0x36'))){_0x28afad[_0x7bb0('0x1e')]=qs[_0x7bb0('0x1e')](_0x30fa7b[_0x7bb0('0x2f')][_0x7bb0('0x1e')]);_0x28afad[_0x7bb0('0x1c')]=qs['offset'](_0x30fa7b[_0x7bb0('0x2f')]['offset']);}return _0x43832f['getDescriptions'](_0x28afad);}})['then'](function(_0x149a5a){if(_0x149a5a){return _0x149a5a?{'count':_0x2b2e08,'rows':_0x149a5a}:null;}})[_0x7bb0('0x24')](respondWithResult(_0x117592,null))[_0x7bb0('0x42')](handleError(_0x117592,null));}; \ No newline at end of file +var _0x724d=['../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','length','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','keys','fields','catch','body','find','params','destroy','getFields','findOne','hasOwnProperty','nolimit','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x587dc0,_0x2a409f){var _0x4abb3e=function(_0x3fdcec){while(--_0x3fdcec){_0x587dc0['push'](_0x587dc0['shift']());}};_0x4abb3e(++_0x2a409f);}(_0x724d,0xe5));var _0xd724=function(_0x5bf2b3,_0xfcd364){_0x5bf2b3=_0x5bf2b3-0x0;var _0x5e8a9b=_0x724d[_0x5bf2b3];return _0x5e8a9b;};'use strict';var emlformat=require(_0xd724('0x0'));var rimraf=require(_0xd724('0x1'));var zipdir=require(_0xd724('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd724('0x3'));var moment=require(_0xd724('0x4'));var BPromise=require(_0xd724('0x5'));var Mustache=require(_0xd724('0x6'));var util=require(_0xd724('0x7'));var path=require(_0xd724('0x8'));var sox=require(_0xd724('0x9'));var csv=require(_0xd724('0xa'));var ejs=require(_0xd724('0xb'));var fs=require('fs');var fs_extra=require(_0xd724('0xc'));var _=require(_0xd724('0xd'));var squel=require(_0xd724('0xe'));var crypto=require(_0xd724('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd724('0x10'));var toCsv=require(_0xd724('0xa'));var querystring=require(_0xd724('0x11'));var Papa=require(_0xd724('0x12'));var Redis=require(_0xd724('0x13'));var authService=require(_0xd724('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd724('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd724('0x16'));var utils=require(_0xd724('0x17'));var config=require(_0xd724('0x18'));var licenseUtil=require(_0xd724('0x19'));var db=require(_0xd724('0x1a'))['db'];function respondWithStatusCode(_0x3628a4,_0x4438ca){_0x4438ca=_0x4438ca||0xcc;return function(_0x17e1ea){if(_0x17e1ea){return _0x3628a4[_0xd724('0x1b')](_0x4438ca);}return _0x3628a4[_0xd724('0x1c')](_0x4438ca)[_0xd724('0x1d')]();};}function respondWithResult(_0x1a20c9,_0x3a9867){_0x3a9867=_0x3a9867||0xc8;return function(_0x1017d6){if(_0x1017d6){return _0x1a20c9[_0xd724('0x1c')](_0x3a9867)[_0xd724('0x1e')](_0x1017d6);}};}function respondWithFilteredResult(_0x48f9f7,_0x24a95d){return function(_0x29f82c){if(_0x29f82c){var _0x394ffc=typeof _0x24a95d[_0xd724('0x1f')]===_0xd724('0x20')&&typeof _0x24a95d[_0xd724('0x21')]===_0xd724('0x20');var _0x4572a9=_0x29f82c[_0xd724('0x22')];var _0x734b54=_0x394ffc?0x0:_0x24a95d[_0xd724('0x1f')];var _0x32985b=_0x394ffc?_0x29f82c[_0xd724('0x22')]:_0x24a95d[_0xd724('0x1f')]+_0x24a95d[_0xd724('0x21')];var _0x50d5ea;if(_0x32985b>=_0x4572a9){_0x32985b=_0x4572a9;_0x50d5ea=0xc8;}else{_0x50d5ea=0xce;}_0x48f9f7['status'](_0x50d5ea);return _0x48f9f7[_0xd724('0x23')](_0xd724('0x24'),_0x734b54+'-'+_0x32985b+'/'+_0x4572a9)[_0xd724('0x1e')](_0x29f82c);}return null;};}function patchUpdates(_0x180411){return function(_0x1bc827){try{jsonpatch[_0xd724('0x25')](_0x1bc827,_0x180411,!![]);}catch(_0x24d90a){return BPromise[_0xd724('0x26')](_0x24d90a);}return _0x1bc827[_0xd724('0x27')]();};}function saveUpdates(_0x379d26,_0x588079){return function(_0x135955){if(_0x135955){return _0x135955[_0xd724('0x28')](_0x379d26)['then'](function(_0x9b0f81){return _0x9b0f81;});}return null;};}function removeEntity(_0x4a4a0c,_0x8fa74){return function(_0x1522d2){if(_0x1522d2){return _0x1522d2['destroy']()[_0xd724('0x29')](function(){_0x4a4a0c[_0xd724('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2af376,_0x314e6b){return function(_0x435d2b){if(!_0x435d2b){_0x2af376[_0xd724('0x1b')](0x194);}return _0x435d2b;};}function handleError(_0x18e4de,_0x450abe){_0x450abe=_0x450abe||0x1f4;return function(_0x1fe8a0){logger['error'](_0x1fe8a0[_0xd724('0x2a')]);if(_0x1fe8a0[_0xd724('0x2b')]){delete _0x1fe8a0[_0xd724('0x2b')];}_0x18e4de[_0xd724('0x1c')](_0x450abe)[_0xd724('0x2c')](_0x1fe8a0);};}exports[_0xd724('0x2d')]=function(_0x26b09a,_0x58ef99){var _0x27a34e={},_0x244b2f={},_0x455d57={'count':0x0,'rows':[]};var _0x4ee6d9=_[_0xd724('0x2e')](db[_0xd724('0x2f')][_0xd724('0x30')],function(_0x32fa73){return{'name':_0x32fa73[_0xd724('0x31')],'type':_0x32fa73[_0xd724('0x32')][_0xd724('0x33')]};});_0x244b2f['model']=_[_0xd724('0x2e')](_0x4ee6d9,_0xd724('0x2b'));_0x244b2f[_0xd724('0x34')]=_['keys'](_0x26b09a[_0xd724('0x34')]);_0x244b2f[_0xd724('0x35')]=_['intersection'](_0x244b2f['model'],_0x244b2f[_0xd724('0x34')]);_0x27a34e[_0xd724('0x36')]=_[_0xd724('0x37')](_0x244b2f[_0xd724('0x38')],qs['fields'](_0x26b09a[_0xd724('0x34')]['fields']));_0x27a34e[_0xd724('0x36')]=_0x27a34e[_0xd724('0x36')][_0xd724('0x39')]?_0x27a34e[_0xd724('0x36')]:_0x244b2f[_0xd724('0x38')];if(!_0x26b09a[_0xd724('0x34')]['hasOwnProperty']('nolimit')){_0x27a34e[_0xd724('0x21')]=qs['limit'](_0x26b09a['query']['limit']);_0x27a34e[_0xd724('0x1f')]=qs[_0xd724('0x1f')](_0x26b09a[_0xd724('0x34')][_0xd724('0x1f')]);}_0x27a34e[_0xd724('0x3a')]=qs['sort'](_0x26b09a[_0xd724('0x34')][_0xd724('0x3b')]);_0x27a34e['where']=qs[_0xd724('0x35')](_[_0xd724('0x3c')](_0x26b09a[_0xd724('0x34')],_0x244b2f[_0xd724('0x35')]),_0x4ee6d9);if(_0x26b09a[_0xd724('0x34')][_0xd724('0x3d')]){_0x27a34e[_0xd724('0x3e')]=_[_0xd724('0x3f')](_0x27a34e['where'],{'$or':_['map'](_0x4ee6d9,function(_0x26178d){if(_0x26178d[_0xd724('0x32')]!==_0xd724('0x40')){var _0x17c945={};_0x17c945[_0x26178d[_0xd724('0x2b')]]={'$like':'%'+_0x26b09a[_0xd724('0x34')][_0xd724('0x3d')]+'%'};return _0x17c945;}})});}_0x27a34e=_['merge']({},_0x27a34e,_0x26b09a[_0xd724('0x41')]);var _0x2cd6e2={'where':_0x27a34e[_0xd724('0x3e')]};return db[_0xd724('0x2f')]['count'](_0x2cd6e2)[_0xd724('0x29')](function(_0x2b93c2){_0x455d57[_0xd724('0x22')]=_0x2b93c2;if(_0x26b09a[_0xd724('0x34')][_0xd724('0x42')]){_0x27a34e[_0xd724('0x43')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x27a34e);})[_0xd724('0x29')](function(_0x9bdf3d){_0x455d57[_0xd724('0x44')]=_0x9bdf3d;return _0x455d57;})['then'](respondWithFilteredResult(_0x58ef99,_0x27a34e))['catch'](handleError(_0x58ef99,null));};exports['show']=function(_0xaa0d1b,_0x49a416){var _0x26935f={'raw':![],'where':{'id':_0xaa0d1b['params']['id']}},_0x2487d4={};_0x2487d4['model']=_[_0xd724('0x45')](db[_0xd724('0x2f')][_0xd724('0x30')]);_0x2487d4['query']=_[_0xd724('0x45')](_0xaa0d1b['query']);_0x2487d4[_0xd724('0x35')]=_[_0xd724('0x37')](_0x2487d4[_0xd724('0x38')],_0x2487d4[_0xd724('0x34')]);_0x26935f[_0xd724('0x36')]=_[_0xd724('0x37')](_0x2487d4[_0xd724('0x38')],qs[_0xd724('0x46')](_0xaa0d1b[_0xd724('0x34')][_0xd724('0x46')]));_0x26935f[_0xd724('0x36')]=_0x26935f[_0xd724('0x36')][_0xd724('0x39')]?_0x26935f[_0xd724('0x36')]:_0x2487d4['model'];if(_0xaa0d1b['query'][_0xd724('0x42')]){_0x26935f['include']=[{'all':!![]}];}_0x26935f=_[_0xd724('0x3f')]({},_0x26935f,_0xaa0d1b['options']);return db[_0xd724('0x2f')]['find'](_0x26935f)['then'](handleEntityNotFound(_0x49a416,null))[_0xd724('0x29')](respondWithResult(_0x49a416,null))[_0xd724('0x47')](handleError(_0x49a416,null));};exports['create']=function(_0x473573,_0xe4b3a8){return db[_0xd724('0x2f')]['create'](_0x473573[_0xd724('0x48')],{})[_0xd724('0x29')](respondWithResult(_0xe4b3a8,0xc9))[_0xd724('0x47')](handleError(_0xe4b3a8,null));};exports[_0xd724('0x28')]=function(_0x334295,_0xbc3b0f){if(_0x334295[_0xd724('0x48')]['id']){delete _0x334295[_0xd724('0x48')]['id'];}return db[_0xd724('0x2f')][_0xd724('0x49')]({'where':{'id':_0x334295[_0xd724('0x4a')]['id']}})[_0xd724('0x29')](handleEntityNotFound(_0xbc3b0f,null))[_0xd724('0x29')](saveUpdates(_0x334295[_0xd724('0x48')],null))[_0xd724('0x29')](respondWithResult(_0xbc3b0f,null))['catch'](handleError(_0xbc3b0f,null));};exports[_0xd724('0x4b')]=function(_0x1acf63,_0x5e250f){return db[_0xd724('0x2f')][_0xd724('0x49')]({'where':{'id':_0x1acf63[_0xd724('0x4a')]['id']}})[_0xd724('0x29')](handleEntityNotFound(_0x5e250f,null))[_0xd724('0x29')](removeEntity(_0x5e250f,null))[_0xd724('0x47')](handleError(_0x5e250f,null));};exports[_0xd724('0x4c')]=function(_0x2e0a05,_0x3c8cd2,_0xda92c8){var _0x12b669={};var _0x173dbe={};var _0x43b1b3;var _0x2ae97e;return db[_0xd724('0x2f')][_0xd724('0x4d')]({'where':{'id':_0x2e0a05['params']['id']}})[_0xd724('0x29')](handleEntityNotFound(_0x3c8cd2,null))[_0xd724('0x29')](function(_0x4b7b95){if(_0x4b7b95){_0x43b1b3=_0x4b7b95;_0x173dbe['model']=_[_0xd724('0x45')](db['SalesforceField'][_0xd724('0x30')]);_0x173dbe[_0xd724('0x34')]=_[_0xd724('0x45')](_0x2e0a05[_0xd724('0x34')]);_0x173dbe[_0xd724('0x35')]=_[_0xd724('0x37')](_0x173dbe[_0xd724('0x38')],_0x173dbe[_0xd724('0x34')]);_0x12b669['attributes']=_[_0xd724('0x37')](_0x173dbe[_0xd724('0x38')],qs[_0xd724('0x46')](_0x2e0a05[_0xd724('0x34')][_0xd724('0x46')]));_0x12b669['attributes']=_0x12b669['attributes'][_0xd724('0x39')]?_0x12b669[_0xd724('0x36')]:_0x173dbe[_0xd724('0x38')];_0x12b669[_0xd724('0x3a')]=qs['sort'](_0x2e0a05['query'][_0xd724('0x3b')]);_0x12b669[_0xd724('0x3e')]=qs[_0xd724('0x35')](_[_0xd724('0x3c')](_0x2e0a05[_0xd724('0x34')],_0x173dbe[_0xd724('0x35')]));if(_0x2e0a05[_0xd724('0x34')][_0xd724('0x3d')]){_0x12b669[_0xd724('0x3e')]=_[_0xd724('0x3f')](_0x12b669[_0xd724('0x3e')],{'$or':_['map'](_0x12b669[_0xd724('0x36')],function(_0x34d909){var _0x558e62={};_0x558e62[_0x34d909]={'$like':'%'+_0x2e0a05[_0xd724('0x34')][_0xd724('0x3d')]+'%'};return _0x558e62;})});}_0x12b669=_[_0xd724('0x3f')]({},_0x12b669,_0x2e0a05[_0xd724('0x41')]);return _0x43b1b3[_0xd724('0x4c')](_0x12b669);}})[_0xd724('0x29')](function(_0x342531){if(_0x342531){_0x2ae97e=_0x342531[_0xd724('0x39')];if(!_0x2e0a05[_0xd724('0x34')][_0xd724('0x4e')](_0xd724('0x4f'))){_0x12b669['limit']=qs[_0xd724('0x21')](_0x2e0a05[_0xd724('0x34')][_0xd724('0x21')]);_0x12b669[_0xd724('0x1f')]=qs[_0xd724('0x1f')](_0x2e0a05[_0xd724('0x34')][_0xd724('0x1f')]);}return _0x43b1b3[_0xd724('0x4c')](_0x12b669);}})[_0xd724('0x29')](function(_0x197e76){if(_0x197e76){return _0x197e76?{'count':_0x2ae97e,'rows':_0x197e76}:null;}})[_0xd724('0x29')](respondWithResult(_0x3c8cd2,null))[_0xd724('0x47')](handleError(_0x3c8cd2,null));};exports['getSubjects']=function(_0x11165f,_0x226d83,_0x36f2f9){var _0x489726={};var _0xa8e287={};var _0x56c106;var _0x46977a;return db[_0xd724('0x2f')][_0xd724('0x4d')]({'where':{'id':_0x11165f[_0xd724('0x4a')]['id']}})['then'](handleEntityNotFound(_0x226d83,null))[_0xd724('0x29')](function(_0x12e87f){if(_0x12e87f){_0x56c106=_0x12e87f;_0xa8e287[_0xd724('0x38')]=_['keys'](db[_0xd724('0x50')][_0xd724('0x30')]);_0xa8e287[_0xd724('0x34')]=_[_0xd724('0x45')](_0x11165f[_0xd724('0x34')]);_0xa8e287['filters']=_[_0xd724('0x37')](_0xa8e287['model'],_0xa8e287[_0xd724('0x34')]);_0x489726[_0xd724('0x36')]=_[_0xd724('0x37')](_0xa8e287[_0xd724('0x38')],qs[_0xd724('0x46')](_0x11165f[_0xd724('0x34')][_0xd724('0x46')]));_0x489726[_0xd724('0x36')]=_0x489726['attributes'][_0xd724('0x39')]?_0x489726[_0xd724('0x36')]:_0xa8e287['model'];_0x489726[_0xd724('0x3a')]=qs[_0xd724('0x3b')](_0x11165f[_0xd724('0x34')][_0xd724('0x3b')]);_0x489726['where']=qs['filters'](_[_0xd724('0x3c')](_0x11165f[_0xd724('0x34')],_0xa8e287[_0xd724('0x35')]));if(_0x11165f[_0xd724('0x34')]['filter']){_0x489726['where']=_['merge'](_0x489726['where'],{'$or':_[_0xd724('0x2e')](_0x489726['attributes'],function(_0x41aee6){var _0x3d04f2={};_0x3d04f2[_0x41aee6]={'$like':'%'+_0x11165f[_0xd724('0x34')]['filter']+'%'};return _0x3d04f2;})});}_0x489726=_['merge']({},_0x489726,_0x11165f[_0xd724('0x41')]);return _0x56c106[_0xd724('0x51')](_0x489726);}})['then'](function(_0x9ef09){if(_0x9ef09){_0x46977a=_0x9ef09[_0xd724('0x39')];if(!_0x11165f['query'][_0xd724('0x4e')](_0xd724('0x4f'))){_0x489726[_0xd724('0x21')]=qs[_0xd724('0x21')](_0x11165f[_0xd724('0x34')][_0xd724('0x21')]);_0x489726[_0xd724('0x1f')]=qs[_0xd724('0x1f')](_0x11165f['query'][_0xd724('0x1f')]);}return _0x56c106[_0xd724('0x51')](_0x489726);}})['then'](function(_0x3d688e){if(_0x3d688e){return _0x3d688e?{'count':_0x46977a,'rows':_0x3d688e}:null;}})[_0xd724('0x29')](respondWithResult(_0x226d83,null))[_0xd724('0x47')](handleError(_0x226d83,null));};exports[_0xd724('0x52')]=function(_0x5807dc,_0xfc693b,_0x36a3a9){var _0x19fee1={};var _0x136ac5={};var _0xe067d4;var _0x2e7660;return db[_0xd724('0x2f')][_0xd724('0x4d')]({'where':{'id':_0x5807dc[_0xd724('0x4a')]['id']}})[_0xd724('0x29')](handleEntityNotFound(_0xfc693b,null))[_0xd724('0x29')](function(_0x50231b){if(_0x50231b){_0xe067d4=_0x50231b;_0x136ac5[_0xd724('0x38')]=_[_0xd724('0x45')](db[_0xd724('0x50')][_0xd724('0x30')]);_0x136ac5[_0xd724('0x34')]=_['keys'](_0x5807dc['query']);_0x136ac5[_0xd724('0x35')]=_['intersection'](_0x136ac5[_0xd724('0x38')],_0x136ac5[_0xd724('0x34')]);_0x19fee1[_0xd724('0x36')]=_[_0xd724('0x37')](_0x136ac5['model'],qs[_0xd724('0x46')](_0x5807dc[_0xd724('0x34')][_0xd724('0x46')]));_0x19fee1[_0xd724('0x36')]=_0x19fee1[_0xd724('0x36')][_0xd724('0x39')]?_0x19fee1[_0xd724('0x36')]:_0x136ac5[_0xd724('0x38')];_0x19fee1[_0xd724('0x3a')]=qs[_0xd724('0x3b')](_0x5807dc[_0xd724('0x34')]['sort']);_0x19fee1['where']=qs[_0xd724('0x35')](_['pick'](_0x5807dc[_0xd724('0x34')],_0x136ac5[_0xd724('0x35')]));if(_0x5807dc['query']['filter']){_0x19fee1[_0xd724('0x3e')]=_[_0xd724('0x3f')](_0x19fee1['where'],{'$or':_[_0xd724('0x2e')](_0x19fee1[_0xd724('0x36')],function(_0x5480c3){var _0x5c7251={};_0x5c7251[_0x5480c3]={'$like':'%'+_0x5807dc[_0xd724('0x34')][_0xd724('0x3d')]+'%'};return _0x5c7251;})});}_0x19fee1=_[_0xd724('0x3f')]({},_0x19fee1,_0x5807dc[_0xd724('0x41')]);return _0xe067d4[_0xd724('0x52')](_0x19fee1);}})[_0xd724('0x29')](function(_0x18d2af){if(_0x18d2af){_0x2e7660=_0x18d2af[_0xd724('0x39')];if(!_0x5807dc[_0xd724('0x34')]['hasOwnProperty'](_0xd724('0x4f'))){_0x19fee1[_0xd724('0x21')]=qs['limit'](_0x5807dc['query'][_0xd724('0x21')]);_0x19fee1['offset']=qs[_0xd724('0x1f')](_0x5807dc['query'][_0xd724('0x1f')]);}return _0xe067d4[_0xd724('0x52')](_0x19fee1);}})[_0xd724('0x29')](function(_0x520902){if(_0x520902){return _0x520902?{'count':_0x2e7660,'rows':_0x520902}:null;}})[_0xd724('0x29')](respondWithResult(_0xfc693b,null))[_0xd724('0x47')](handleError(_0xfc693b,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index c3da8a3..5304b0d 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 _0x53a4=['path','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','util','../../config/logger','api','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53a4,0x87));var _0x453a=function(_0x32e3e2,_0x2df019){_0x32e3e2=_0x32e3e2-0x0;var _0x2456de=_0x53a4[_0x32e3e2];return _0x2456de;};'use strict';var _=require(_0x453a('0x0'));var util=require(_0x453a('0x1'));var logger=require(_0x453a('0x2'))(_0x453a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x453a('0x4'));var fs=require('fs');var path=require(_0x453a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x453a('0x6'));module[_0x453a('0x7')]=function(_0x1e8abc,_0x585ff8){return _0x1e8abc[_0x453a('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0x453a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4b4=['SalesforceConfiguration','int_salesforce_configurations','lodash','util','api','bluebird','request-promise','../../config/environment','./intSalesforceConfiguration.attributes','exports','define'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf4b4,0x1ba));var _0x4f4b=function(_0x53e0f1,_0x3bbca3){_0x53e0f1=_0x53e0f1-0x0;var _0x332f2a=_0xf4b4[_0x53e0f1];return _0x332f2a;};'use strict';var _=require(_0x4f4b('0x0'));var util=require(_0x4f4b('0x1'));var logger=require('../../config/logger')(_0x4f4b('0x2'));var moment=require('moment');var BPromise=require(_0x4f4b('0x3'));var rp=require(_0x4f4b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4f4b('0x5'));var attributes=require(_0x4f4b('0x6'));module[_0x4f4b('0x7')]=function(_0x44cb0f,_0x5f55c6){return _0x44cb0f[_0x4f4b('0x8')](_0x4f4b('0x9'),attributes,{'tableName':_0x4f4b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index f282855..1eed25e 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 _0x8aaf=['rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','SalesforceConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2ddd42,_0x39be46){var _0x189dc1=function(_0xab9aac){while(--_0xab9aac){_0x2ddd42['push'](_0x2ddd42['shift']());}};_0x189dc1(++_0x39be46);}(_0x8aaf,0x1d2));var _0xf8aa=function(_0x363ae2,_0xd9988b){_0x363ae2=_0x363ae2-0x0;var _0x2c6c4e=_0x8aaf[_0x363ae2];return _0x2c6c4e;};'use strict';var _=require(_0xf8aa('0x0'));var util=require(_0xf8aa('0x1'));var moment=require(_0xf8aa('0x2'));var BPromise=require(_0xf8aa('0x3'));var rs=require(_0xf8aa('0x4'));var fs=require('fs');var Redis=require(_0xf8aa('0x5'));var db=require(_0xf8aa('0x6'))['db'];var utils=require(_0xf8aa('0x7'));var logger=require(_0xf8aa('0x8'))(_0xf8aa('0x9'));var config=require(_0xf8aa('0xa'));var jayson=require(_0xf8aa('0xb'));var client=jayson[_0xf8aa('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x499614,_0x3eb2ee,_0x26b542){return new BPromise(function(_0x13014f,_0x466782){return client[_0xf8aa('0xd')](_0x499614,_0x26b542)[_0xf8aa('0xe')](function(_0x4761a7){logger[_0xf8aa('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3eb2ee,_0xf8aa('0x10'));logger[_0xf8aa('0x11')](_0xf8aa('0x12'),_0x3eb2ee,_0xf8aa('0x10'),JSON[_0xf8aa('0x13')](_0x4761a7));if(_0x4761a7[_0xf8aa('0x14')]){if(_0x4761a7[_0xf8aa('0x14')]['code']===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x3eb2ee,_0x4761a7[_0xf8aa('0x14')][_0xf8aa('0x15')]);return _0x466782(_0x4761a7[_0xf8aa('0x14')]['message']);}logger['error'](_0xf8aa('0x16'),_0x3eb2ee,_0x4761a7[_0xf8aa('0x14')][_0xf8aa('0x15')]);return _0x13014f(_0x4761a7[_0xf8aa('0x14')][_0xf8aa('0x15')]);}else{logger[_0xf8aa('0xf')](_0xf8aa('0x16'),_0x3eb2ee,_0xf8aa('0x10'));_0x13014f(_0x4761a7[_0xf8aa('0x17')][_0xf8aa('0x15')]);}})[_0xf8aa('0x18')](function(_0x46753f){logger[_0xf8aa('0x14')](_0xf8aa('0x16'),_0x3eb2ee,_0x46753f);_0x466782(_0x46753f);});});} \ No newline at end of file +var _0xa34b=['debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0xfbe26d,_0x4ecba4){var _0x283d33=function(_0x2fda25){while(--_0x2fda25){_0xfbe26d['push'](_0xfbe26d['shift']());}};_0x283d33(++_0x4ecba4);}(_0xa34b,0x1ae));var _0xba34=function(_0xd8c9eb,_0x23b19e){_0xd8c9eb=_0xd8c9eb-0x0;var _0x5eb349=_0xa34b[_0xd8c9eb];return _0x5eb349;};'use strict';var _=require(_0xba34('0x0'));var util=require('util');var moment=require(_0xba34('0x1'));var BPromise=require(_0xba34('0x2'));var rs=require(_0xba34('0x3'));var fs=require('fs');var Redis=require(_0xba34('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba34('0x5'))(_0xba34('0x6'));var config=require(_0xba34('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba34('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33d199,_0x3056e3,_0x15c147){return new BPromise(function(_0x5f2977,_0x4a2fd2){return client[_0xba34('0x9')](_0x33d199,_0x15c147)[_0xba34('0xa')](function(_0x4f2c9f){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x3056e3,'request\x20sent');logger[_0xba34('0xb')](_0xba34('0xc'),_0x3056e3,_0xba34('0xd'),JSON[_0xba34('0xe')](_0x4f2c9f));if(_0x4f2c9f[_0xba34('0xf')]){if(_0x4f2c9f[_0xba34('0xf')][_0xba34('0x10')]===0x1f4){logger[_0xba34('0xf')](_0xba34('0x11'),_0x3056e3,_0x4f2c9f[_0xba34('0xf')][_0xba34('0x12')]);return _0x4a2fd2(_0x4f2c9f['error'][_0xba34('0x12')]);}logger[_0xba34('0xf')](_0xba34('0x11'),_0x3056e3,_0x4f2c9f[_0xba34('0xf')]['message']);return _0x5f2977(_0x4f2c9f[_0xba34('0xf')]['message']);}else{logger['info'](_0xba34('0x11'),_0x3056e3,_0xba34('0xd'));_0x5f2977(_0x4f2c9f[_0xba34('0x13')][_0xba34('0x12')]);}})[_0xba34('0x14')](function(_0x13a581){logger[_0xba34('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3056e3,_0x13a581);_0x4a2fd2(_0x13a581);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 4bdfcc4..82c0b69 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 _0x9cf0=['put','update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','/:id','show','post','create'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9cf0,0x1e8));var _0x09cf=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9cf0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x09cf('0x0'));var util=require(_0x09cf('0x1'));var path=require(_0x09cf('0x2'));var timeout=require('connect-timeout');var express=require(_0x09cf('0x3'));var router=express[_0x09cf('0x4')]();var fs_extra=require(_0x09cf('0x5'));var auth=require(_0x09cf('0x6'));var interaction=require(_0x09cf('0x7'));var config=require(_0x09cf('0x8'));var controller=require(_0x09cf('0x9'));router['get']('/',auth[_0x09cf('0xa')](),controller[_0x09cf('0xb')]);router['get'](_0x09cf('0xc'),auth[_0x09cf('0xa')](),controller[_0x09cf('0xd')]);router[_0x09cf('0xe')]('/',auth[_0x09cf('0xa')](),controller[_0x09cf('0xf')]);router[_0x09cf('0x10')](_0x09cf('0xc'),auth[_0x09cf('0xa')](),controller[_0x09cf('0x11')]);router['delete'](_0x09cf('0xc'),auth[_0x09cf('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x820a=['index','/:id','show','post','create','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated'];(function(_0x567b74,_0x3fd508){var _0x1a3186=function(_0x1dbcdd){while(--_0x1dbcdd){_0x567b74['push'](_0x567b74['shift']());}};_0x1a3186(++_0x3fd508);}(_0x820a,0xa1));var _0xa820=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x820a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa820('0x0'));var util=require(_0xa820('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa820('0x2'));var router=express[_0xa820('0x3')]();var fs_extra=require(_0xa820('0x4'));var auth=require(_0xa820('0x5'));var interaction=require(_0xa820('0x6'));var config=require('../../config/environment');var controller=require(_0xa820('0x7'));router[_0xa820('0x8')]('/',auth[_0xa820('0x9')](),controller[_0xa820('0xa')]);router[_0xa820('0x8')](_0xa820('0xb'),auth['isAuthenticated'](),controller[_0xa820('0xc')]);router[_0xa820('0xd')]('/',auth['isAuthenticated'](),controller[_0xa820('0xe')]);router[_0xa820('0xf')](_0xa820('0xb'),auth['isAuthenticated'](),controller[_0xa820('0x10')]);router[_0xa820('0x11')]('/:id',auth[_0xa820('0x9')](),controller['destroy']);module[_0xa820('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index d680890..5fde091 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 _0x0281=['ENUM','variable','customVariable','sequelize','string','picklist','STRING'];(function(_0x5105e8,_0x44a2e0){var _0x53bbf5=function(_0x29dfb8){while(--_0x29dfb8){_0x5105e8['push'](_0x5105e8['shift']());}};_0x53bbf5(++_0x44a2e0);}(_0x0281,0xab));var _0x1028=function(_0x24619c,_0x182d88){_0x24619c=_0x24619c-0x0;var _0x3baf2f=_0x0281[_0x24619c];return _0x3baf2f;};'use strict';var Sequelize=require(_0x1028('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x1028('0x1'),'variable','customVariable','keyValue',_0x1028('0x2')),'defaultValue':_0x1028('0x1')},'content':{'type':Sequelize[_0x1028('0x3')]},'key':{'type':Sequelize[_0x1028('0x3')]},'keyType':{'type':Sequelize[_0x1028('0x4')]('string',_0x1028('0x5'),_0x1028('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1028('0x3')]},'variableName':{'type':Sequelize[_0x1028('0x3')]}}; \ No newline at end of file +var _0xfa8d=['sequelize','exports','ENUM','string','customVariable','picklist','STRING'];(function(_0x24b9d7,_0x407534){var _0x3e5718=function(_0x5de267){while(--_0x5de267){_0x24b9d7['push'](_0x24b9d7['shift']());}};_0x3e5718(++_0x407534);}(_0xfa8d,0x1b9));var _0xdfa8=function(_0x155c0d,_0x4d3cb2){_0x155c0d=_0x155c0d-0x0;var _0x33ace2=_0xfa8d[_0x155c0d];return _0x33ace2;};'use strict';var Sequelize=require(_0xdfa8('0x0'));module[_0xdfa8('0x1')]={'type':{'type':Sequelize[_0xdfa8('0x2')](_0xdfa8('0x3'),'variable',_0xdfa8('0x4'),'keyValue',_0xdfa8('0x5')),'defaultValue':_0xdfa8('0x3')},'content':{'type':Sequelize[_0xdfa8('0x6')]},'key':{'type':Sequelize[_0xdfa8('0x6')]},'keyType':{'type':Sequelize[_0xdfa8('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xdfa8('0x6')]},'idField':{'type':Sequelize[_0xdfa8('0x6')]},'variableName':{'type':Sequelize[_0xdfa8('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 1d2d57b..75e63b1 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 _0x27fd=['sendStatus','error','stack','name','index','map','SalesforceField','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','then','destroy'];(function(_0x59c83,_0x5a6227){var _0x49aee2=function(_0x5dfcb6){while(--_0x5dfcb6){_0x59c83['push'](_0x59c83['shift']());}};_0x49aee2(++_0x5a6227);}(_0x27fd,0x196));var _0xd27f=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0x27fd[_0x95411e];return _0x2c8718;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd27f('0x0'));var zipdir=require(_0xd27f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd27f('0x2'));var moment=require(_0xd27f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd27f('0x4'));var util=require(_0xd27f('0x5'));var path=require(_0xd27f('0x6'));var sox=require('sox');var csv=require(_0xd27f('0x7'));var ejs=require(_0xd27f('0x8'));var fs=require('fs');var fs_extra=require(_0xd27f('0x9'));var _=require(_0xd27f('0xa'));var squel=require(_0xd27f('0xb'));var crypto=require(_0xd27f('0xc'));var jsforce=require(_0xd27f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd27f('0x7'));var querystring=require(_0xd27f('0xe'));var Papa=require(_0xd27f('0xf'));var Redis=require(_0xd27f('0x10'));var authService=require(_0xd27f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd27f('0x12'));var hardwareService=require(_0xd27f('0x13'));var logger=require(_0xd27f('0x14'))(_0xd27f('0x15'));var utils=require(_0xd27f('0x16'));var config=require(_0xd27f('0x17'));var licenseUtil=require(_0xd27f('0x18'));var db=require(_0xd27f('0x19'))['db'];function respondWithStatusCode(_0x33b66f,_0x30fde9){_0x30fde9=_0x30fde9||0xcc;return function(_0x1b812b){if(_0x1b812b){return _0x33b66f['sendStatus'](_0x30fde9);}return _0x33b66f[_0xd27f('0x1a')](_0x30fde9)[_0xd27f('0x1b')]();};}function respondWithResult(_0x3c8f77,_0x230ced){_0x230ced=_0x230ced||0xc8;return function(_0x377473){if(_0x377473){return _0x3c8f77[_0xd27f('0x1a')](_0x230ced)[_0xd27f('0x1c')](_0x377473);}};}function respondWithFilteredResult(_0xb0bfab,_0x40cc6a){return function(_0x209c9d){if(_0x209c9d){var _0x3a7979=typeof _0x40cc6a['offset']===_0xd27f('0x1d')&&typeof _0x40cc6a[_0xd27f('0x1e')]===_0xd27f('0x1d');var _0x175e79=_0x209c9d[_0xd27f('0x1f')];var _0x409399=_0x3a7979?0x0:_0x40cc6a[_0xd27f('0x20')];var _0x3a2f9c=_0x3a7979?_0x209c9d['count']:_0x40cc6a['offset']+_0x40cc6a['limit'];var _0x5f5132;if(_0x3a2f9c>=_0x175e79){_0x3a2f9c=_0x175e79;_0x5f5132=0xc8;}else{_0x5f5132=0xce;}_0xb0bfab['status'](_0x5f5132);return _0xb0bfab[_0xd27f('0x21')](_0xd27f('0x22'),_0x409399+'-'+_0x3a2f9c+'/'+_0x175e79)[_0xd27f('0x1c')](_0x209c9d);}return null;};}function patchUpdates(_0x593cc2){return function(_0x1ad90b){try{jsonpatch[_0xd27f('0x23')](_0x1ad90b,_0x593cc2,!![]);}catch(_0x860ade){return BPromise['reject'](_0x860ade);}return _0x1ad90b['save']();};}function saveUpdates(_0x47d6ec,_0x3195d5){return function(_0x3dce83){if(_0x3dce83){return _0x3dce83['update'](_0x47d6ec)[_0xd27f('0x24')](function(_0xf50e3c){return _0xf50e3c;});}return null;};}function removeEntity(_0x4ca52c,_0x9fbc49){return function(_0xba0abf){if(_0xba0abf){return _0xba0abf[_0xd27f('0x25')]()[_0xd27f('0x24')](function(){_0x4ca52c[_0xd27f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5baac1,_0x4f8151){return function(_0x30534e){if(!_0x30534e){_0x5baac1[_0xd27f('0x26')](0x194);}return _0x30534e;};}function handleError(_0x422943,_0x2452ba){_0x2452ba=_0x2452ba||0x1f4;return function(_0x1734c0){logger[_0xd27f('0x27')](_0x1734c0[_0xd27f('0x28')]);if(_0x1734c0[_0xd27f('0x29')]){delete _0x1734c0[_0xd27f('0x29')];}_0x422943['status'](_0x2452ba)['send'](_0x1734c0);};}exports[_0xd27f('0x2a')]=function(_0x525c48,_0x36ad28){var _0x3e95e7={},_0xfc3487={},_0x3f516f={'count':0x0,'rows':[]};var _0x471705=_[_0xd27f('0x2b')](db[_0xd27f('0x2c')][_0xd27f('0x2d')],function(_0x58dbfb){return{'name':_0x58dbfb['fieldName'],'type':_0x58dbfb[_0xd27f('0x2e')][_0xd27f('0x2f')]};});_0xfc3487['model']=_[_0xd27f('0x2b')](_0x471705,_0xd27f('0x29'));_0xfc3487[_0xd27f('0x30')]=_[_0xd27f('0x31')](_0x525c48[_0xd27f('0x30')]);_0xfc3487[_0xd27f('0x32')]=_[_0xd27f('0x33')](_0xfc3487['model'],_0xfc3487[_0xd27f('0x30')]);_0x3e95e7['attributes']=_['intersection'](_0xfc3487[_0xd27f('0x34')],qs['fields'](_0x525c48['query'][_0xd27f('0x35')]));_0x3e95e7[_0xd27f('0x36')]=_0x3e95e7[_0xd27f('0x36')][_0xd27f('0x37')]?_0x3e95e7['attributes']:_0xfc3487[_0xd27f('0x34')];if(!_0x525c48[_0xd27f('0x30')]['hasOwnProperty'](_0xd27f('0x38'))){_0x3e95e7[_0xd27f('0x1e')]=qs[_0xd27f('0x1e')](_0x525c48[_0xd27f('0x30')]['limit']);_0x3e95e7['offset']=qs[_0xd27f('0x20')](_0x525c48[_0xd27f('0x30')][_0xd27f('0x20')]);}_0x3e95e7[_0xd27f('0x39')]=qs[_0xd27f('0x3a')](_0x525c48[_0xd27f('0x30')]['sort']);_0x3e95e7['where']=qs['filters'](_[_0xd27f('0x3b')](_0x525c48[_0xd27f('0x30')],_0xfc3487[_0xd27f('0x32')]),_0x471705);if(_0x525c48['query'][_0xd27f('0x3c')]){_0x3e95e7['where']=_[_0xd27f('0x3d')](_0x3e95e7[_0xd27f('0x3e')],{'$or':_[_0xd27f('0x2b')](_0x471705,function(_0x4df90e){if(_0x4df90e[_0xd27f('0x2e')]!==_0xd27f('0x3f')){var _0x564b31={};_0x564b31[_0x4df90e[_0xd27f('0x29')]]={'$like':'%'+_0x525c48[_0xd27f('0x30')]['filter']+'%'};return _0x564b31;}})});}_0x3e95e7=_[_0xd27f('0x3d')]({},_0x3e95e7,_0x525c48[_0xd27f('0x40')]);var _0x4a4aba={'where':_0x3e95e7[_0xd27f('0x3e')]};return db['SalesforceField']['count'](_0x4a4aba)[_0xd27f('0x24')](function(_0x44a60a){_0x3f516f['count']=_0x44a60a;if(_0x525c48['query']['includeAll']){_0x3e95e7[_0xd27f('0x41')]=[{'all':!![]}];}return db[_0xd27f('0x2c')][_0xd27f('0x42')](_0x3e95e7);})[_0xd27f('0x24')](function(_0x8c713f){_0x3f516f[_0xd27f('0x43')]=_0x8c713f;return _0x3f516f;})[_0xd27f('0x24')](respondWithFilteredResult(_0x36ad28,_0x3e95e7))[_0xd27f('0x44')](handleError(_0x36ad28,null));};exports[_0xd27f('0x45')]=function(_0x25a44b,_0x3d1b7a){var _0x20281e={'raw':!![],'where':{'id':_0x25a44b[_0xd27f('0x46')]['id']}},_0x2bf35b={};_0x2bf35b[_0xd27f('0x34')]=_['keys'](db[_0xd27f('0x2c')][_0xd27f('0x2d')]);_0x2bf35b['query']=_['keys'](_0x25a44b[_0xd27f('0x30')]);_0x2bf35b[_0xd27f('0x32')]=_[_0xd27f('0x33')](_0x2bf35b[_0xd27f('0x34')],_0x2bf35b[_0xd27f('0x30')]);_0x20281e[_0xd27f('0x36')]=_[_0xd27f('0x33')](_0x2bf35b[_0xd27f('0x34')],qs['fields'](_0x25a44b[_0xd27f('0x30')][_0xd27f('0x35')]));_0x20281e['attributes']=_0x20281e[_0xd27f('0x36')][_0xd27f('0x37')]?_0x20281e['attributes']:_0x2bf35b[_0xd27f('0x34')];if(_0x25a44b[_0xd27f('0x30')]['includeAll']){_0x20281e['include']=[{'all':!![]}];}_0x20281e=_[_0xd27f('0x3d')]({},_0x20281e,_0x25a44b[_0xd27f('0x40')]);return db['SalesforceField'][_0xd27f('0x47')](_0x20281e)[_0xd27f('0x24')](handleEntityNotFound(_0x3d1b7a,null))[_0xd27f('0x24')](respondWithResult(_0x3d1b7a,null))[_0xd27f('0x44')](handleError(_0x3d1b7a,null));};exports[_0xd27f('0x48')]=function(_0x1e78e8,_0x5ea2fd){return db[_0xd27f('0x2c')][_0xd27f('0x48')](_0x1e78e8[_0xd27f('0x49')],{})[_0xd27f('0x24')](respondWithResult(_0x5ea2fd,0xc9))[_0xd27f('0x44')](handleError(_0x5ea2fd,null));};exports['update']=function(_0x37ce05,_0xb5b86a){if(_0x37ce05[_0xd27f('0x49')]['id']){delete _0x37ce05['body']['id'];}return db[_0xd27f('0x2c')]['find']({'where':{'id':_0x37ce05[_0xd27f('0x46')]['id']}})[_0xd27f('0x24')](handleEntityNotFound(_0xb5b86a,null))[_0xd27f('0x24')](saveUpdates(_0x37ce05[_0xd27f('0x49')],null))[_0xd27f('0x24')](respondWithResult(_0xb5b86a,null))[_0xd27f('0x44')](handleError(_0xb5b86a,null));};exports[_0xd27f('0x25')]=function(_0x3c4b9d,_0x2a0bf4){return db['SalesforceField'][_0xd27f('0x47')]({'where':{'id':_0x3c4b9d[_0xd27f('0x46')]['id']}})[_0xd27f('0x24')](handleEntityNotFound(_0x2a0bf4,null))[_0xd27f('0x24')](removeEntity(_0x2a0bf4,null))[_0xd27f('0x44')](handleError(_0x2a0bf4,null));}; \ No newline at end of file +var _0x2899=['fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','length','find','create','body','params','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x2899,0x121));var _0x9289=function(_0x23487f,_0x540ecd){_0x23487f=_0x23487f-0x0;var _0x1ebc8f=_0x2899[_0x23487f];return _0x1ebc8f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9289('0x0'));var path=require(_0x9289('0x1'));var sox=require(_0x9289('0x2'));var csv=require('to-csv');var ejs=require(_0x9289('0x3'));var fs=require('fs');var fs_extra=require(_0x9289('0x4'));var _=require('lodash');var squel=require(_0x9289('0x5'));var crypto=require(_0x9289('0x6'));var jsforce=require('jsforce');var deskjs=require(_0x9289('0x7'));var toCsv=require(_0x9289('0x8'));var querystring=require(_0x9289('0x9'));var Papa=require(_0x9289('0xa'));var Redis=require(_0x9289('0xb'));var authService=require(_0x9289('0xc'));var qs=require(_0x9289('0xd'));var as=require(_0x9289('0xe'));var hardwareService=require(_0x9289('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x9289('0x10'));var config=require(_0x9289('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x9289('0x12'))['db'];function respondWithStatusCode(_0x477fbd,_0x28f92b){_0x28f92b=_0x28f92b||0xcc;return function(_0x251cc2){if(_0x251cc2){return _0x477fbd[_0x9289('0x13')](_0x28f92b);}return _0x477fbd['status'](_0x28f92b)[_0x9289('0x14')]();};}function respondWithResult(_0x11b3b5,_0x180116){_0x180116=_0x180116||0xc8;return function(_0x3f5c94){if(_0x3f5c94){return _0x11b3b5[_0x9289('0x15')](_0x180116)[_0x9289('0x16')](_0x3f5c94);}};}function respondWithFilteredResult(_0x485405,_0x401a1f){return function(_0x358af1){if(_0x358af1){var _0x48257c=typeof _0x401a1f[_0x9289('0x17')]===_0x9289('0x18')&&typeof _0x401a1f[_0x9289('0x19')]===_0x9289('0x18');var _0x498d71=_0x358af1[_0x9289('0x1a')];var _0x326d07=_0x48257c?0x0:_0x401a1f[_0x9289('0x17')];var _0x1c6e6a=_0x48257c?_0x358af1[_0x9289('0x1a')]:_0x401a1f[_0x9289('0x17')]+_0x401a1f[_0x9289('0x19')];var _0x173e44;if(_0x1c6e6a>=_0x498d71){_0x1c6e6a=_0x498d71;_0x173e44=0xc8;}else{_0x173e44=0xce;}_0x485405[_0x9289('0x15')](_0x173e44);return _0x485405[_0x9289('0x1b')](_0x9289('0x1c'),_0x326d07+'-'+_0x1c6e6a+'/'+_0x498d71)['json'](_0x358af1);}return null;};}function patchUpdates(_0x504fa9){return function(_0x3faf0f){try{jsonpatch['apply'](_0x3faf0f,_0x504fa9,!![]);}catch(_0x346170){return BPromise[_0x9289('0x1d')](_0x346170);}return _0x3faf0f['save']();};}function saveUpdates(_0x3d5a05,_0x542ba9){return function(_0x52557e){if(_0x52557e){return _0x52557e[_0x9289('0x1e')](_0x3d5a05)[_0x9289('0x1f')](function(_0x35be82){return _0x35be82;});}return null;};}function removeEntity(_0x2c0097,_0x56e898){return function(_0x557b79){if(_0x557b79){return _0x557b79[_0x9289('0x20')]()[_0x9289('0x1f')](function(){_0x2c0097[_0x9289('0x15')](0xcc)[_0x9289('0x14')]();});}};}function handleEntityNotFound(_0x168302,_0x30cf6c){return function(_0x5f2b85){if(!_0x5f2b85){_0x168302[_0x9289('0x13')](0x194);}return _0x5f2b85;};}function handleError(_0x214ca8,_0xbd9a2e){_0xbd9a2e=_0xbd9a2e||0x1f4;return function(_0x12b3eb){logger[_0x9289('0x21')](_0x12b3eb[_0x9289('0x22')]);if(_0x12b3eb[_0x9289('0x23')]){delete _0x12b3eb[_0x9289('0x23')];}_0x214ca8[_0x9289('0x15')](_0xbd9a2e)[_0x9289('0x24')](_0x12b3eb);};}exports[_0x9289('0x25')]=function(_0x26c4a6,_0x12d43c){var _0x5fd255={},_0x464401={},_0xe160de={'count':0x0,'rows':[]};var _0x330bde=_[_0x9289('0x26')](db[_0x9289('0x27')][_0x9289('0x28')],function(_0x1b6590){return{'name':_0x1b6590[_0x9289('0x29')],'type':_0x1b6590[_0x9289('0x2a')]['key']};});_0x464401[_0x9289('0x2b')]=_[_0x9289('0x26')](_0x330bde,'name');_0x464401[_0x9289('0x2c')]=_[_0x9289('0x2d')](_0x26c4a6['query']);_0x464401[_0x9289('0x2e')]=_[_0x9289('0x2f')](_0x464401[_0x9289('0x2b')],_0x464401[_0x9289('0x2c')]);_0x5fd255[_0x9289('0x30')]=_[_0x9289('0x2f')](_0x464401[_0x9289('0x2b')],qs['fields'](_0x26c4a6[_0x9289('0x2c')][_0x9289('0x31')]));_0x5fd255[_0x9289('0x30')]=_0x5fd255['attributes']['length']?_0x5fd255[_0x9289('0x30')]:_0x464401[_0x9289('0x2b')];if(!_0x26c4a6[_0x9289('0x2c')]['hasOwnProperty']('nolimit')){_0x5fd255[_0x9289('0x19')]=qs[_0x9289('0x19')](_0x26c4a6[_0x9289('0x2c')]['limit']);_0x5fd255[_0x9289('0x17')]=qs[_0x9289('0x17')](_0x26c4a6[_0x9289('0x2c')][_0x9289('0x17')]);}_0x5fd255[_0x9289('0x32')]=qs[_0x9289('0x33')](_0x26c4a6[_0x9289('0x2c')][_0x9289('0x33')]);_0x5fd255[_0x9289('0x34')]=qs[_0x9289('0x2e')](_['pick'](_0x26c4a6[_0x9289('0x2c')],_0x464401[_0x9289('0x2e')]),_0x330bde);if(_0x26c4a6[_0x9289('0x2c')][_0x9289('0x35')]){_0x5fd255[_0x9289('0x34')]=_['merge'](_0x5fd255[_0x9289('0x34')],{'$or':_[_0x9289('0x26')](_0x330bde,function(_0x4a3108){if(_0x4a3108['type']!=='VIRTUAL'){var _0x18fecf={};_0x18fecf[_0x4a3108[_0x9289('0x23')]]={'$like':'%'+_0x26c4a6[_0x9289('0x2c')]['filter']+'%'};return _0x18fecf;}})});}_0x5fd255=_[_0x9289('0x36')]({},_0x5fd255,_0x26c4a6[_0x9289('0x37')]);var _0x42da0a={'where':_0x5fd255[_0x9289('0x34')]};return db[_0x9289('0x27')][_0x9289('0x1a')](_0x42da0a)[_0x9289('0x1f')](function(_0x2879e0){_0xe160de['count']=_0x2879e0;if(_0x26c4a6['query'][_0x9289('0x38')]){_0x5fd255[_0x9289('0x39')]=[{'all':!![]}];}return db[_0x9289('0x27')][_0x9289('0x3a')](_0x5fd255);})['then'](function(_0x139e36){_0xe160de[_0x9289('0x3b')]=_0x139e36;return _0xe160de;})[_0x9289('0x1f')](respondWithFilteredResult(_0x12d43c,_0x5fd255))[_0x9289('0x3c')](handleError(_0x12d43c,null));};exports['show']=function(_0x13e43b,_0xd3d18e){var _0x252a22={'raw':!![],'where':{'id':_0x13e43b['params']['id']}},_0x1daae2={};_0x1daae2['model']=_[_0x9289('0x2d')](db[_0x9289('0x27')][_0x9289('0x28')]);_0x1daae2[_0x9289('0x2c')]=_['keys'](_0x13e43b['query']);_0x1daae2['filters']=_[_0x9289('0x2f')](_0x1daae2[_0x9289('0x2b')],_0x1daae2['query']);_0x252a22[_0x9289('0x30')]=_['intersection'](_0x1daae2[_0x9289('0x2b')],qs['fields'](_0x13e43b[_0x9289('0x2c')][_0x9289('0x31')]));_0x252a22[_0x9289('0x30')]=_0x252a22[_0x9289('0x30')][_0x9289('0x3d')]?_0x252a22[_0x9289('0x30')]:_0x1daae2['model'];if(_0x13e43b['query']['includeAll']){_0x252a22[_0x9289('0x39')]=[{'all':!![]}];}_0x252a22=_['merge']({},_0x252a22,_0x13e43b[_0x9289('0x37')]);return db[_0x9289('0x27')][_0x9289('0x3e')](_0x252a22)[_0x9289('0x1f')](handleEntityNotFound(_0xd3d18e,null))[_0x9289('0x1f')](respondWithResult(_0xd3d18e,null))['catch'](handleError(_0xd3d18e,null));};exports[_0x9289('0x3f')]=function(_0xf86e2c,_0x14c208){return db['SalesforceField'][_0x9289('0x3f')](_0xf86e2c[_0x9289('0x40')],{})[_0x9289('0x1f')](respondWithResult(_0x14c208,0xc9))[_0x9289('0x3c')](handleError(_0x14c208,null));};exports[_0x9289('0x1e')]=function(_0x17421f,_0x37bcc7){if(_0x17421f[_0x9289('0x40')]['id']){delete _0x17421f[_0x9289('0x40')]['id'];}return db[_0x9289('0x27')][_0x9289('0x3e')]({'where':{'id':_0x17421f['params']['id']}})[_0x9289('0x1f')](handleEntityNotFound(_0x37bcc7,null))['then'](saveUpdates(_0x17421f['body'],null))[_0x9289('0x1f')](respondWithResult(_0x37bcc7,null))['catch'](handleError(_0x37bcc7,null));};exports[_0x9289('0x20')]=function(_0x428c5c,_0x5d3bee){return db[_0x9289('0x27')][_0x9289('0x3e')]({'where':{'id':_0x428c5c[_0x9289('0x41')]['id']}})[_0x9289('0x1f')](handleEntityNotFound(_0x5d3bee,null))['then'](removeEntity(_0x5d3bee,null))['catch'](handleError(_0x5d3bee,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index e9419a1..6fe5fdb 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 _0xf443=['exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xf443,0x12b));var _0x3f44=function(_0x510411,_0x33718b){_0x510411=_0x510411-0x0;var _0x2c1253=_0xf443[_0x510411];return _0x2c1253;};'use strict';var _=require(_0x3f44('0x0'));var util=require(_0x3f44('0x1'));var logger=require(_0x3f44('0x2'))(_0x3f44('0x3'));var moment=require('moment');var BPromise=require(_0x3f44('0x4'));var rp=require(_0x3f44('0x5'));var fs=require('fs');var path=require(_0x3f44('0x6'));var rimraf=require(_0x3f44('0x7'));var config=require(_0x3f44('0x8'));var attributes=require('./intSalesforceField.attributes');module[_0x3f44('0x9')]=function(_0xe879a,_0xcd6a42){return _0xe879a[_0x3f44('0xa')](_0x3f44('0xb'),attributes,{'tableName':_0x3f44('0xc'),'paranoid':![],'indexes':[{'name':_0x3f44('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9181=['path','../../config/environment','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','api','moment','bluebird'];(function(_0xe0c564,_0x2ff569){var _0x32e0f6=function(_0x3fd0fc){while(--_0x3fd0fc){_0xe0c564['push'](_0xe0c564['shift']());}};_0x32e0f6(++_0x2ff569);}(_0x9181,0xa5));var _0x1918=function(_0x5edbe1,_0x292862){_0x5edbe1=_0x5edbe1-0x0;var _0xc11440=_0x9181[_0x5edbe1];return _0xc11440;};'use strict';var _=require('lodash');var util=require(_0x1918('0x0'));var logger=require('../../config/logger')(_0x1918('0x1'));var moment=require(_0x1918('0x2'));var BPromise=require(_0x1918('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1918('0x4'));var rimraf=require('rimraf');var config=require(_0x1918('0x5'));var attributes=require('./intSalesforceField.attributes');module[_0x1918('0x6')]=function(_0x52b1ab,_0x5b115d){return _0x52b1ab[_0x1918('0x7')](_0x1918('0x8'),attributes,{'tableName':_0x1918('0x9'),'paranoid':![],'indexes':[{'name':_0x1918('0xa'),'fields':[_0x1918('0xb'),_0x1918('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 8f62913..2a46f85 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 _0xbdfe=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbdfe,0x177));var _0xebdf=function(_0x20dda3,_0xfcb775){_0x20dda3=_0x20dda3-0x0;var _0x547b71=_0xbdfe[_0x20dda3];return _0x547b71;};'use strict';var _=require(_0xebdf('0x0'));var util=require('util');var moment=require(_0xebdf('0x1'));var BPromise=require(_0xebdf('0x2'));var rs=require(_0xebdf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xebdf('0x4'))(_0xebdf('0x5'));var config=require(_0xebdf('0x6'));var jayson=require(_0xebdf('0x7'));var client=jayson[_0xebdf('0x8')][_0xebdf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43a7df,_0x3cf103,_0x17fa28){return new BPromise(function(_0x3aafdb,_0x736d6d){return client[_0xebdf('0xa')](_0x43a7df,_0x17fa28)[_0xebdf('0xb')](function(_0x17eb43){logger['info'](_0xebdf('0xc'),_0x3cf103,_0xebdf('0xd'));logger[_0xebdf('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3cf103,_0xebdf('0xd'),JSON[_0xebdf('0xf')](_0x17eb43));if(_0x17eb43[_0xebdf('0x10')]){if(_0x17eb43['error']['code']===0x1f4){logger[_0xebdf('0x10')](_0xebdf('0xc'),_0x3cf103,_0x17eb43['error'][_0xebdf('0x11')]);return _0x736d6d(_0x17eb43[_0xebdf('0x10')][_0xebdf('0x11')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x3cf103,_0x17eb43[_0xebdf('0x10')][_0xebdf('0x11')]);return _0x3aafdb(_0x17eb43[_0xebdf('0x10')]['message']);}else{logger[_0xebdf('0x12')](_0xebdf('0xc'),_0x3cf103,_0xebdf('0xd'));_0x3aafdb(_0x17eb43[_0xebdf('0x13')][_0xebdf('0x11')]);}})[_0xebdf('0x14')](function(_0x1bc141){logger['error'](_0xebdf('0xc'),_0x3cf103,_0x1bc141);_0x736d6d(_0x1bc141);});});} \ No newline at end of file +var _0xdc0b=['error','code','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0xdc0b,0x139));var _0xbdc0=function(_0x1f45a3,_0xc60f48){_0x1f45a3=_0x1f45a3-0x0;var _0x3b7711=_0xdc0b[_0x1f45a3];return _0x3b7711;};'use strict';var _=require('lodash');var util=require(_0xbdc0('0x0'));var moment=require(_0xbdc0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbdc0('0x2'))['db'];var utils=require(_0xbdc0('0x3'));var logger=require(_0xbdc0('0x4'))(_0xbdc0('0x5'));var config=require(_0xbdc0('0x6'));var jayson=require(_0xbdc0('0x7'));var client=jayson[_0xbdc0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bb00e,_0x1f0416,_0x577ced){return new BPromise(function(_0xb34f6d,_0x105520){return client[_0xbdc0('0x9')](_0x4bb00e,_0x577ced)[_0xbdc0('0xa')](function(_0x2dd5cd){logger[_0xbdc0('0xb')](_0xbdc0('0xc'),_0x1f0416,_0xbdc0('0xd'));logger[_0xbdc0('0xe')](_0xbdc0('0xf'),_0x1f0416,_0xbdc0('0xd'),JSON[_0xbdc0('0x10')](_0x2dd5cd));if(_0x2dd5cd['error']){if(_0x2dd5cd[_0xbdc0('0x11')][_0xbdc0('0x12')]===0x1f4){logger['error'](_0xbdc0('0xc'),_0x1f0416,_0x2dd5cd[_0xbdc0('0x11')][_0xbdc0('0x13')]);return _0x105520(_0x2dd5cd[_0xbdc0('0x11')][_0xbdc0('0x13')]);}logger[_0xbdc0('0x11')](_0xbdc0('0xc'),_0x1f0416,_0x2dd5cd[_0xbdc0('0x11')]['message']);return _0xb34f6d(_0x2dd5cd[_0xbdc0('0x11')][_0xbdc0('0x13')]);}else{logger[_0xbdc0('0xb')](_0xbdc0('0xc'),_0x1f0416,_0xbdc0('0xd'));_0xb34f6d(_0x2dd5cd[_0xbdc0('0x14')]['message']);}})[_0xbdc0('0x15')](function(_0x833ecb){logger[_0xbdc0('0x11')](_0xbdc0('0xc'),_0x1f0416,_0x833ecb);_0x105520(_0x833ecb);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 7c43cc8..458a678 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 _0x29fc=['./intServicenowAccount.controller','isAuthenticated','get','/:id','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy','util','connect-timeout','fs-extra','../../components/interaction/service'];(function(_0x589d2f,_0xc49372){var _0x1db27c=function(_0x25d0d3){while(--_0x25d0d3){_0x589d2f['push'](_0x589d2f['shift']());}};_0x1db27c(++_0xc49372);}(_0x29fc,0xb0));var _0xc29f=function(_0x305bf8,_0x3fc0ad){_0x305bf8=_0x305bf8-0x0;var _0x2b1919=_0x29fc[_0x305bf8];return _0x2b1919;};'use strict';var multer=require('multer');var util=require(_0xc29f('0x0'));var path=require('path');var timeout=require(_0xc29f('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc29f('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xc29f('0x3'));var config=require('../../config/environment');var controller=require(_0xc29f('0x4'));router['get']('/',auth[_0xc29f('0x5')](),controller['index']);router[_0xc29f('0x6')](_0xc29f('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xc29f('0x6')](_0xc29f('0x8'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xc29f('0x6')](_0xc29f('0x9'),auth[_0xc29f('0x5')](),controller[_0xc29f('0xa')]);router['post']('/',auth[_0xc29f('0x5')](),controller[_0xc29f('0xb')]);router[_0xc29f('0xc')](_0xc29f('0x8'),auth[_0xc29f('0x5')](),controller[_0xc29f('0xd')]);router[_0xc29f('0xe')]('/:id',auth[_0xc29f('0x5')](),controller[_0xc29f('0xf')]);router[_0xc29f('0x10')]('/:id',auth[_0xc29f('0x5')](),controller[_0xc29f('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb7f1=['path','connect-timeout','express','fs-extra','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update','delete','destroy','exports'];(function(_0x13e0a6,_0x1be031){var _0x20e2b7=function(_0x47c5a2){while(--_0x47c5a2){_0x13e0a6['push'](_0x13e0a6['shift']());}};_0x20e2b7(++_0x1be031);}(_0xb7f1,0xdc));var _0x1b7f=function(_0x26e954,_0xf5e77){_0x26e954=_0x26e954-0x0;var _0x1bdaea=_0xb7f1[_0x26e954];return _0x1bdaea;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1b7f('0x0'));var timeout=require(_0x1b7f('0x1'));var express=require(_0x1b7f('0x2'));var router=express['Router']();var fs_extra=require(_0x1b7f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b7f('0x4'));var controller=require(_0x1b7f('0x5'));router['get']('/',auth[_0x1b7f('0x6')](),controller[_0x1b7f('0x7')]);router[_0x1b7f('0x8')](_0x1b7f('0x9'),auth[_0x1b7f('0x6')](),controller['show']);router[_0x1b7f('0x8')](_0x1b7f('0xa'),auth[_0x1b7f('0x6')](),controller[_0x1b7f('0xb')]);router[_0x1b7f('0x8')](_0x1b7f('0xc'),auth[_0x1b7f('0x6')](),controller['getFields']);router[_0x1b7f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1b7f('0xd')](_0x1b7f('0xa'),auth[_0x1b7f('0x6')](),controller[_0x1b7f('0xe')]);router[_0x1b7f('0xf')](_0x1b7f('0x9'),auth['isAuthenticated'](),controller[_0x1b7f('0x10')]);router[_0x1b7f('0x11')](_0x1b7f('0x9'),auth[_0x1b7f('0x6')](),controller[_0x1b7f('0x12')]);module[_0x1b7f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 3cbf0a3..51510ea 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 _0x31ca=['remoteUri','exports','STRING','username'];(function(_0x51dd22,_0x4689cd){var _0xc87c99=function(_0x2c7f31){while(--_0x2c7f31){_0x51dd22['push'](_0x51dd22['shift']());}};_0xc87c99(++_0x4689cd);}(_0x31ca,0x1cd));var _0xa31c=function(_0xb30821,_0x22c5d7){_0xb30821=_0xb30821-0x0;var _0x4f28f4=_0x31ca[_0xb30821];return _0x4f28f4;};'use strict';var Sequelize=require('sequelize');module[_0xa31c('0x0')]={'name':{'type':Sequelize[_0xa31c('0x1')]},'description':{'type':Sequelize[_0xa31c('0x1')]},'username':{'type':Sequelize[_0xa31c('0x1')],'unique':_0xa31c('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa31c('0x3')},'serverUrl':{'type':Sequelize[_0xa31c('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xa36b=['sequelize','exports','STRING','username','remoteUri'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xa36b,0x181));var _0xba36=function(_0x27b993,_0x639ff2){_0x27b993=_0x27b993-0x0;var _0x5ec866=_0xa36b[_0x27b993];return _0x5ec866;};'use strict';var Sequelize=require(_0xba36('0x0'));module[_0xba36('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xba36('0x2')]},'username':{'type':Sequelize[_0xba36('0x2')],'unique':_0xba36('0x3')},'password':{'type':Sequelize[_0xba36('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xba36('0x4')},'serverUrl':{'type':Sequelize[_0xba36('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 a0c1a78..4b00eb0 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 _0x3ae2=['activity_due','assigned_to','severity','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','correlation_id','location','category','username','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','password','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','forEach','label','push','all','TCL:\x20_object','remove','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','statusCode','test','Wrong\x20credentials','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','result','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','params','keys','length','includeAll','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','order','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','knowledge','subcategory','close_code','incident_state','parent','made_sla','watch_list','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','business_duration','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','notify','parent_incident','contact_type','reopened_by','urgency','problem_id','company'];(function(_0x2e1220,_0x514427){var _0x5bbabd=function(_0x1bd4fe){while(--_0x1bd4fe){_0x2e1220['push'](_0x2e1220['shift']());}};_0x5bbabd(++_0x514427);}(_0x3ae2,0xe5));var _0x23ae=function(_0x548d7d,_0x2d41fc){_0x548d7d=_0x548d7d-0x0;var _0xb1c878=_0x3ae2[_0x548d7d];return _0xb1c878;};'use strict';var emlformat=require(_0x23ae('0x0'));var rimraf=require(_0x23ae('0x1'));var zipdir=require(_0x23ae('0x2'));var jsonpatch=require(_0x23ae('0x3'));var rp=require(_0x23ae('0x4'));var moment=require(_0x23ae('0x5'));var BPromise=require(_0x23ae('0x6'));var Mustache=require(_0x23ae('0x7'));var util=require(_0x23ae('0x8'));var path=require('path');var sox=require(_0x23ae('0x9'));var csv=require('to-csv');var ejs=require(_0x23ae('0xa'));var fs=require('fs');var fs_extra=require(_0x23ae('0xb'));var _=require(_0x23ae('0xc'));var squel=require(_0x23ae('0xd'));var crypto=require(_0x23ae('0xe'));var jsforce=require(_0x23ae('0xf'));var deskjs=require(_0x23ae('0x10'));var toCsv=require(_0x23ae('0x11'));var querystring=require(_0x23ae('0x12'));var Papa=require('papaparse');var Redis=require(_0x23ae('0x13'));var authService=require(_0x23ae('0x14'));var qs=require(_0x23ae('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x23ae('0x16'));var licenseUtil=require(_0x23ae('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x23ae('0x18'));function respondWithStatusCode(_0x1a2928,_0x3a5e79){_0x3a5e79=_0x3a5e79||0xcc;return function(_0x43e0a2){if(_0x43e0a2){return _0x1a2928[_0x23ae('0x19')](_0x3a5e79);}return _0x1a2928[_0x23ae('0x1a')](_0x3a5e79)[_0x23ae('0x1b')]();};}function respondWithResult(_0x3a4aaa,_0x3fa10f){_0x3fa10f=_0x3fa10f||0xc8;return function(_0x421553){if(_0x421553){return _0x3a4aaa[_0x23ae('0x1a')](_0x3fa10f)[_0x23ae('0x1c')](_0x421553);}};}function respondWithFilteredResult(_0x217ab2,_0x5d4997){return function(_0x7a737e){if(_0x7a737e){var _0x49aa9a=typeof _0x5d4997[_0x23ae('0x1d')]===_0x23ae('0x1e')&&typeof _0x5d4997[_0x23ae('0x1f')]===_0x23ae('0x1e');var _0xc3c4ab=_0x7a737e[_0x23ae('0x20')];var _0x35282e=_0x49aa9a?0x0:_0x5d4997[_0x23ae('0x1d')];var _0x51d130=_0x49aa9a?_0x7a737e['count']:_0x5d4997['offset']+_0x5d4997[_0x23ae('0x1f')];var _0x3b44aa;if(_0x51d130>=_0xc3c4ab){_0x51d130=_0xc3c4ab;_0x3b44aa=0xc8;}else{_0x3b44aa=0xce;}_0x217ab2[_0x23ae('0x1a')](_0x3b44aa);return _0x217ab2[_0x23ae('0x21')](_0x23ae('0x22'),_0x35282e+'-'+_0x51d130+'/'+_0xc3c4ab)[_0x23ae('0x1c')](_0x7a737e);}return null;};}function patchUpdates(_0x5ccd7b){return function(_0x2c38b0){try{jsonpatch['apply'](_0x2c38b0,_0x5ccd7b,!![]);}catch(_0x53b511){return BPromise[_0x23ae('0x23')](_0x53b511);}return _0x2c38b0[_0x23ae('0x24')]();};}function saveUpdates(_0xca4072,_0x407b99){return function(_0x563538){if(_0x563538){return _0x563538['update'](_0xca4072)[_0x23ae('0x25')](function(_0x5a7ca2){return _0x5a7ca2;});}return null;};}function removeEntity(_0x2b709c,_0x3c72bb){return function(_0xd33ef2){if(_0xd33ef2){return _0xd33ef2['destroy']()[_0x23ae('0x25')](function(){_0x2b709c[_0x23ae('0x1a')](0xcc)[_0x23ae('0x1b')]();});}};}function handleEntityNotFound(_0x4b11ec,_0x4b4e12){return function(_0x596ec4){if(!_0x596ec4){_0x4b11ec[_0x23ae('0x19')](0x194);}return _0x596ec4;};}function handleError(_0x1bcaf6,_0x5a9f90){_0x5a9f90=_0x5a9f90||0x1f4;return function(_0x2316fb){logger['error'](_0x2316fb['stack']);if(_0x2316fb[_0x23ae('0x26')]){delete _0x2316fb[_0x23ae('0x26')];}_0x1bcaf6[_0x23ae('0x1a')](_0x5a9f90)[_0x23ae('0x27')](_0x2316fb);};}exports['index']=function(_0x367420,_0x373bf3){var _0x4d7d2c={},_0x4f17c8={},_0x225c0f={'count':0x0,'rows':[]};var _0x4804ec=_[_0x23ae('0x28')](db[_0x23ae('0x29')][_0x23ae('0x2a')],function(_0x3684c3){return{'name':_0x3684c3[_0x23ae('0x2b')],'type':_0x3684c3[_0x23ae('0x2c')][_0x23ae('0x2d')]};});_0x4f17c8[_0x23ae('0x2e')]=_[_0x23ae('0x28')](_0x4804ec,_0x23ae('0x26'));_0x4f17c8['query']=_['keys'](_0x367420[_0x23ae('0x2f')]);_0x4f17c8[_0x23ae('0x30')]=_['intersection'](_0x4f17c8[_0x23ae('0x2e')],_0x4f17c8[_0x23ae('0x2f')]);_0x4d7d2c['attributes']=_[_0x23ae('0x31')](_0x4f17c8[_0x23ae('0x2e')],qs[_0x23ae('0x32')](_0x367420[_0x23ae('0x2f')]['fields']));_0x4d7d2c[_0x23ae('0x33')]=_0x4d7d2c['attributes']['length']?_0x4d7d2c[_0x23ae('0x33')]:_0x4f17c8['model'];if(!_0x367420[_0x23ae('0x2f')][_0x23ae('0x34')]('nolimit')){_0x4d7d2c[_0x23ae('0x1f')]=qs[_0x23ae('0x1f')](_0x367420[_0x23ae('0x2f')][_0x23ae('0x1f')]);_0x4d7d2c[_0x23ae('0x1d')]=qs[_0x23ae('0x1d')](_0x367420[_0x23ae('0x2f')]['offset']);}_0x4d7d2c['order']=qs['sort'](_0x367420[_0x23ae('0x2f')][_0x23ae('0x35')]);_0x4d7d2c[_0x23ae('0x36')]=qs['filters'](_[_0x23ae('0x37')](_0x367420[_0x23ae('0x2f')],_0x4f17c8[_0x23ae('0x30')]),_0x4804ec);if(_0x367420['query'][_0x23ae('0x38')]){_0x4d7d2c['where']=_[_0x23ae('0x39')](_0x4d7d2c[_0x23ae('0x36')],{'$or':_[_0x23ae('0x28')](_0x4804ec,function(_0x594cf4){if(_0x594cf4['type']!==_0x23ae('0x3a')){var _0x13f8b5={};_0x13f8b5[_0x594cf4[_0x23ae('0x26')]]={'$like':'%'+_0x367420[_0x23ae('0x2f')][_0x23ae('0x38')]+'%'};return _0x13f8b5;}})});}_0x4d7d2c=_['merge']({},_0x4d7d2c,_0x367420[_0x23ae('0x3b')]);var _0x411e2b={'where':_0x4d7d2c['where']};return db[_0x23ae('0x29')][_0x23ae('0x20')](_0x411e2b)[_0x23ae('0x25')](function(_0x15b26a){_0x225c0f['count']=_0x15b26a;if(_0x367420['query']['includeAll']){_0x4d7d2c[_0x23ae('0x3c')]=[{'all':!![]}];}return db[_0x23ae('0x29')]['findAll'](_0x4d7d2c);})[_0x23ae('0x25')](function(_0x456eff){_0x225c0f[_0x23ae('0x3d')]=_0x456eff;return _0x225c0f;})[_0x23ae('0x25')](respondWithFilteredResult(_0x373bf3,_0x4d7d2c))[_0x23ae('0x3e')](handleError(_0x373bf3,null));};exports['show']=function(_0x1af629,_0x3d3298){var _0x24afed={'raw':![],'where':{'id':_0x1af629[_0x23ae('0x3f')]['id']}},_0x38f382={};_0x38f382[_0x23ae('0x2e')]=_[_0x23ae('0x40')](db[_0x23ae('0x29')][_0x23ae('0x2a')]);_0x38f382[_0x23ae('0x2f')]=_[_0x23ae('0x40')](_0x1af629[_0x23ae('0x2f')]);_0x38f382['filters']=_[_0x23ae('0x31')](_0x38f382[_0x23ae('0x2e')],_0x38f382[_0x23ae('0x2f')]);_0x24afed['attributes']=_[_0x23ae('0x31')](_0x38f382[_0x23ae('0x2e')],qs['fields'](_0x1af629[_0x23ae('0x2f')][_0x23ae('0x32')]));_0x24afed[_0x23ae('0x33')]=_0x24afed[_0x23ae('0x33')][_0x23ae('0x41')]?_0x24afed[_0x23ae('0x33')]:_0x38f382[_0x23ae('0x2e')];if(_0x1af629[_0x23ae('0x2f')][_0x23ae('0x42')]){_0x24afed[_0x23ae('0x3c')]=[{'all':!![]}];}_0x24afed=_[_0x23ae('0x39')]({},_0x24afed,_0x1af629[_0x23ae('0x3b')]);return db[_0x23ae('0x29')][_0x23ae('0x43')](_0x24afed)['then'](handleEntityNotFound(_0x3d3298,null))[_0x23ae('0x25')](respondWithResult(_0x3d3298,null))[_0x23ae('0x3e')](handleError(_0x3d3298,null));};exports[_0x23ae('0x44')]=function(_0x4834dd,_0x1141bf){return db[_0x23ae('0x29')][_0x23ae('0x44')](_0x4834dd[_0x23ae('0x45')],{})[_0x23ae('0x25')](respondWithResult(_0x1141bf,0xc9))[_0x23ae('0x3e')](handleError(_0x1141bf,null));};exports['update']=function(_0x339af8,_0x497f86){if(_0x339af8[_0x23ae('0x45')]['id']){delete _0x339af8[_0x23ae('0x45')]['id'];}return db['ServicenowAccount'][_0x23ae('0x43')]({'where':{'id':_0x339af8[_0x23ae('0x3f')]['id']}})['then'](handleEntityNotFound(_0x497f86,null))[_0x23ae('0x25')](saveUpdates(_0x339af8['body'],null))['then'](respondWithResult(_0x497f86,null))['catch'](handleError(_0x497f86,null));};exports[_0x23ae('0x46')]=function(_0x320baf,_0x70cc2b){return db[_0x23ae('0x29')][_0x23ae('0x43')]({'where':{'id':_0x320baf[_0x23ae('0x3f')]['id']}})[_0x23ae('0x25')](handleEntityNotFound(_0x70cc2b,null))['then'](removeEntity(_0x70cc2b,null))['catch'](handleError(_0x70cc2b,null));};exports[_0x23ae('0x47')]=function(_0x4ea4e1,_0x557106,_0x144250){var _0x4bcd3c={};var _0x227b39={};var _0x3d9a96;var _0x519530;return db['ServicenowAccount'][_0x23ae('0x48')]({'where':{'id':_0x4ea4e1[_0x23ae('0x3f')]['id']}})[_0x23ae('0x25')](handleEntityNotFound(_0x557106,null))[_0x23ae('0x25')](function(_0x379aee){if(_0x379aee){_0x3d9a96=_0x379aee;_0x227b39[_0x23ae('0x2e')]=_[_0x23ae('0x40')](db[_0x23ae('0x49')][_0x23ae('0x2a')]);_0x227b39[_0x23ae('0x2f')]=_[_0x23ae('0x40')](_0x4ea4e1['query']);_0x227b39[_0x23ae('0x30')]=_[_0x23ae('0x31')](_0x227b39[_0x23ae('0x2e')],_0x227b39[_0x23ae('0x2f')]);_0x4bcd3c[_0x23ae('0x33')]=_[_0x23ae('0x31')](_0x227b39[_0x23ae('0x2e')],qs['fields'](_0x4ea4e1[_0x23ae('0x2f')]['fields']));_0x4bcd3c[_0x23ae('0x33')]=_0x4bcd3c[_0x23ae('0x33')][_0x23ae('0x41')]?_0x4bcd3c[_0x23ae('0x33')]:_0x227b39['model'];_0x4bcd3c[_0x23ae('0x4a')]=qs['sort'](_0x4ea4e1['query'][_0x23ae('0x35')]);_0x4bcd3c[_0x23ae('0x36')]=qs[_0x23ae('0x30')](_[_0x23ae('0x37')](_0x4ea4e1[_0x23ae('0x2f')],_0x227b39[_0x23ae('0x30')]));if(_0x4ea4e1[_0x23ae('0x2f')][_0x23ae('0x38')]){_0x4bcd3c[_0x23ae('0x36')]=_[_0x23ae('0x39')](_0x4bcd3c[_0x23ae('0x36')],{'$or':_[_0x23ae('0x28')](_0x4bcd3c[_0x23ae('0x33')],function(_0x490d4b){var _0x312d0e={};_0x312d0e[_0x490d4b]={'$like':'%'+_0x4ea4e1[_0x23ae('0x2f')][_0x23ae('0x38')]+'%'};return _0x312d0e;})});}_0x4bcd3c=_[_0x23ae('0x39')]({},_0x4bcd3c,_0x4ea4e1[_0x23ae('0x3b')]);return _0x3d9a96[_0x23ae('0x47')](_0x4bcd3c);}})[_0x23ae('0x25')](function(_0x505f73){if(_0x505f73){_0x519530=_0x505f73[_0x23ae('0x41')];if(!_0x4ea4e1[_0x23ae('0x2f')][_0x23ae('0x34')]('nolimit')){_0x4bcd3c[_0x23ae('0x1f')]=qs[_0x23ae('0x1f')](_0x4ea4e1[_0x23ae('0x2f')][_0x23ae('0x1f')]);_0x4bcd3c[_0x23ae('0x1d')]=qs[_0x23ae('0x1d')](_0x4ea4e1[_0x23ae('0x2f')][_0x23ae('0x1d')]);}return _0x3d9a96[_0x23ae('0x47')](_0x4bcd3c);}})['then'](function(_0x24815c){if(_0x24815c){return _0x24815c?{'count':_0x519530,'rows':_0x24815c}:null;}})[_0x23ae('0x25')](respondWithResult(_0x557106,null))['catch'](handleError(_0x557106,null));};exports['addConfiguration']=function(_0x1da103,_0x5271c0,_0x34676f){if(_0x1da103[_0x23ae('0x45')]['id']){delete _0x1da103[_0x23ae('0x45')]['id'];}return db[_0x23ae('0x29')]['findOne']({'where':{'id':_0x1da103[_0x23ae('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5271c0,null))[_0x23ae('0x25')](function(_0x71c5e8){if(_0x71c5e8){_0x1da103[_0x23ae('0x45')][_0x23ae('0x4b')]=_0x71c5e8['id'];_0x1da103['body'][_0x23ae('0x4c')]=integrations[_0x23ae('0x4d')](_0x1da103[_0x23ae('0x45')][_0x23ae('0x4e')],_0x1da103[_0x23ae('0x45')][_0x23ae('0x2c')]);_0x1da103[_0x23ae('0x45')][_0x23ae('0x4f')]=integrations[_0x23ae('0x50')](_0x1da103[_0x23ae('0x45')][_0x23ae('0x4e')],_0x1da103[_0x23ae('0x45')][_0x23ae('0x2c')]);return db[_0x23ae('0x49')][_0x23ae('0x44')](_0x1da103[_0x23ae('0x45')],{'include':[{'model':db['ServicenowField'],'as':_0x23ae('0x4c')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x23ae('0x25')](respondWithResult(_0x5271c0,null))[_0x23ae('0x3e')](handleError(_0x5271c0,null));};exports[_0x23ae('0x51')]=function(_0x1d9e58,_0x28559e,_0x164016){var _0x163adf=['made_sla','hold_reason',_0x23ae('0x52'),_0x23ae('0x53'),_0x23ae('0x54'),'notify',_0x23ae('0x55'),'severity','category'];var _0x24730b=[_0x23ae('0x56'),_0x23ae('0x57'),'caused_by',_0x23ae('0x58'),'upon_reject',_0x23ae('0x59'),_0x23ae('0x5a'),_0x23ae('0x5b'),_0x23ae('0x5c'),_0x23ae('0x5d'),_0x23ae('0x5e'),'sys_updated_by',_0x23ae('0x5f'),_0x23ae('0x60'),_0x23ae('0x61'),_0x23ae('0x62'),'state',_0x23ae('0x63'),_0x23ae('0x52'),_0x23ae('0x4a'),_0x23ae('0x64'),_0x23ae('0x65'),'cmdb_ci',_0x23ae('0x66'),_0x23ae('0x67'),'active',_0x23ae('0x68'),_0x23ae('0x69'),_0x23ae('0x6a'),_0x23ae('0x6b'),'rfc',_0x23ae('0x6c'),_0x23ae('0x6d'),'opened_at',_0x23ae('0x6e'),'group_list',_0x23ae('0x6f'),_0x23ae('0x70'),_0x23ae('0x71'),'caller_id',_0x23ae('0x72'),_0x23ae('0x53'),_0x23ae('0x73'),_0x23ae('0x74'),_0x23ae('0x54'),_0x23ae('0x75'),_0x23ae('0x76'),_0x23ae('0x77'),_0x23ae('0x78'),_0x23ae('0x79'),'additional_assignee_list',_0x23ae('0x7a'),_0x23ae('0x7b'),_0x23ae('0x7c'),'sys_class_name','close_notes','closed_by','follow_up',_0x23ae('0x7d'),'sys_id',_0x23ae('0x7e'),_0x23ae('0x7f'),_0x23ae('0x55'),_0x23ae('0x80'),_0x23ae('0x81'),_0x23ae('0x82'),'reassignment_count',_0x23ae('0x83'),_0x23ae('0x84'),_0x23ae('0x85'),_0x23ae('0x86'),'sla_due',_0x23ae('0x87'),_0x23ae('0x88'),_0x23ae('0x89'),_0x23ae('0x8a'),_0x23ae('0x8b'),'sys_tags','escalation','upon_approval',_0x23ae('0x8c'),_0x23ae('0x8d'),_0x23ae('0x8e')];var _0x37bd04='';var _0x17a3e4='';var _0x5bdb83=[];var _0x241d76='';var _0x19b081='';var _0x553b58=[];var _0x14b5a5='';var _0x22481c='';var _0x2a57cd={};var _0x216306='';return db[_0x23ae('0x29')][_0x23ae('0x48')]({'where':{'id':_0x1d9e58[_0x23ae('0x3f')]['id']},'attributes':['id',_0x23ae('0x8f'),'password',_0x23ae('0x90'),_0x23ae('0x91'),_0x23ae('0x92')]})[_0x23ae('0x25')](handleEntityNotFound(_0x28559e,null))['then'](function(_0x1cb5b0){if(_0x1cb5b0){_0x216306=_0x1cb5b0[_0x23ae('0x91')];var _0x31beea=_0x216306[_0x23ae('0x93')](-0x1);if(_0x31beea==='/'){_0x216306=_0x216306[_0x23ae('0x94')](0x0,_0x216306[_0x23ae('0x95')](_0x31beea));}_0x22481c=util[_0x23ae('0x96')]('%s/api/now/doc/table/schema/',_0x216306);_0x14b5a5=util[_0x23ae('0x96')](_0x23ae('0x97'),_0x216306);_0x2a57cd={'user':_0x1cb5b0[_0x23ae('0x8f')],'pass':_0x1cb5b0[_0x23ae('0x98')]};var _0x5ba517={'method':'GET','uri':_0x22481c+_0x23ae('0x99'),'auth':_0x2a57cd,'json':!![]};return rp(_0x5ba517);}})[_0x23ae('0x25')](function(_0x24b37a){if(_0x24b37a['result']['length']>0x0){_0x37bd04=_0x24b37a['result'];}console[_0x23ae('0x9a')](_0x23ae('0x9b'),_0x37bd04);_0x553b58=[];_0x17a3e4=Object[_0x23ae('0x9c')]([],_0x37bd04);_['remove'](_0x17a3e4,function(_0xe84741){return!_0x163adf['includes'](_0xe84741[_0x23ae('0x26')]);});_0x17a3e4[_0x23ae('0x9d')](function(_0x10b71d){var _0x2a66a7=createFieldObject(_0x14b5a5,_0x2a57cd,_0x10b71d['internalType'],_0x10b71d[_0x23ae('0x26')],_0x10b71d[_0x23ae('0x9e')],![]);_0x553b58[_0x23ae('0x9f')](_0x2a66a7);});return Promise[_0x23ae('0xa0')](_0x553b58);})[_0x23ae('0x25')](function(_0x51a466){_0x5bdb83=_0x51a466;_0x241d76=Object[_0x23ae('0x9c')]([],_0x37bd04);console[_0x23ae('0x9a')](_0x23ae('0xa1'),_0x37bd04);_[_0x23ae('0xa2')](_0x241d76,function(_0xf3dcd4){return _0x24730b[_0x23ae('0xa3')](_0xf3dcd4[_0x23ae('0x26')]);});console[_0x23ae('0x9a')](_0x23ae('0xa4'),_0x241d76);_0x553b58=[];_0x241d76[_0x23ae('0x9d')](function(_0x3b8f14){var _0x3b3327=createFieldObject(_0x14b5a5,_0x2a57cd,_0x3b8f14['internalType'],_0x3b8f14[_0x23ae('0x26')],_0x3b8f14['label'],!![]);_0x553b58[_0x23ae('0x9f')](_0x3b3327);});return Promise[_0x23ae('0xa0')](_0x553b58);})[_0x23ae('0x25')](function(_0x537da1){_0x19b081=_0x537da1;var _0x9c5f96=_0x5bdb83[_0x23ae('0xa5')](_0x19b081);return{'count':_0x9c5f96[_0x23ae('0x41')],'rows':_0x9c5f96};})[_0x23ae('0x25')](respondWithResult(_0x28559e,null))['catch'](function(_0x8b6045){console[_0x23ae('0x9a')](_0x23ae('0xa6')+_0x8b6045);var _0x1d4eb4=_0x1d9e58[_0x23ae('0x2f')]['test']?0x1f4:_0x8b6045[_0x23ae('0xa7')]||0x1f4;logger['error'](_0x8b6045['stack']);delete _0x8b6045[_0x23ae('0x26')];if(_0x1d4eb4===0x191){_0x1d4eb4=0x190;}_0x28559e[_0x23ae('0x1a')](_0x1d4eb4)[_0x23ae('0x27')](_0x1d9e58[_0x23ae('0x2f')][_0x23ae('0xa8')]?{'message':_0x23ae('0xa9'),'statusCode':_0x8b6045[_0x23ae('0xa7')]}:_0x8b6045);});};function createFieldObject(_0x191874,_0x2f747a,_0x41807e,_0x1778fc,_0x42924d,_0x358bba){return new Promise(function(_0x36d406,_0x59173b){var _0x1bda7e={'id':_0x1778fc,'name':_0x42924d,'custom':_0x358bba};if(_0x41807e===_0x23ae('0xaa')){_0x1bda7e[_0x23ae('0x3b')]=[{'name':_0x23ae('0xab'),'value':_0x23ae('0xac')},{'name':_0x23ae('0xad'),'value':_0x23ae('0xae')}];_0x36d406(_0x1bda7e);}else{var _0x2efb64={'method':_0x23ae('0xaf'),'uri':_0x191874+_0x23ae('0xb0')+_0x1778fc,'auth':_0x2f747a,'json':!![]};return rp(_0x2efb64)['then'](function(_0x5a4df){var _0x46fe19=[];if(_0x5a4df['result'][_0x23ae('0x41')]>0x0){_0x5a4df[_0x23ae('0xb1')][_0x23ae('0x9d')](function(_0x2dba2c){if(_0x2dba2c[_0x23ae('0xb2')]===_0x23ae('0xae')){var _0x598444={'name':_0x2dba2c[_0x23ae('0x9e')],'value':_0x2dba2c[_0x23ae('0xb3')]};_0x46fe19['push'](_0x598444);}});}_0x1bda7e['options']=_0x46fe19;if(_0x1bda7e['options'][_0x23ae('0x41')]>0x0){_0x36d406(_0x1bda7e);}else{if(_0x358bba==![]){_0x36d406();}else{_0x36d406(_0x1bda7e);}}});}});} \ No newline at end of file +var _0x0fef=['sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','business_service','priority','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','due_date','sys_tags','upon_approval','correlation_id','location','category','username','email','remoteUri','serverUrl','slice','substring','%s/api/now/doc/table/schema/','format','%s/api/now/table/','password','result','log','incident\x20table\x20objects','assign','includes','forEach','push','all','remove','label','ServiceNow\x20error:\x20','statusCode','test','Wrong\x20credentials','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','where','pick','filters','filter','VIRTUAL','options','ServicenowAccount','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','update','getConfigurations','findOne','ServicenowConfiguration','sort','hasOwnProperty','nolimit','AccountId','getSubjects','channel','Subjects','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','severity','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','sys_updated_by','opened_by','sys_created_on','sys_domain'];(function(_0x414f67,_0x861aed){var _0x338537=function(_0x4696fd){while(--_0x4696fd){_0x414f67['push'](_0x414f67['shift']());}};_0x338537(++_0x861aed);}(_0x0fef,0x10a));var _0xf0fe=function(_0x12fede,_0x2e0c84){_0x12fede=_0x12fede-0x0;var _0x5673ef=_0x0fef[_0x12fede];return _0x5673ef;};'use strict';var emlformat=require(_0xf0fe('0x0'));var rimraf=require(_0xf0fe('0x1'));var zipdir=require(_0xf0fe('0x2'));var jsonpatch=require(_0xf0fe('0x3'));var rp=require(_0xf0fe('0x4'));var moment=require(_0xf0fe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf0fe('0x6'));var util=require(_0xf0fe('0x7'));var path=require(_0xf0fe('0x8'));var sox=require(_0xf0fe('0x9'));var csv=require(_0xf0fe('0xa'));var ejs=require(_0xf0fe('0xb'));var fs=require('fs');var fs_extra=require(_0xf0fe('0xc'));var _=require(_0xf0fe('0xd'));var squel=require('squel');var crypto=require(_0xf0fe('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf0fe('0xa'));var querystring=require(_0xf0fe('0xf'));var Papa=require(_0xf0fe('0x10'));var Redis=require(_0xf0fe('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf0fe('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0fe('0x13'))(_0xf0fe('0x14'));var utils=require(_0xf0fe('0x15'));var config=require(_0xf0fe('0x16'));var licenseUtil=require(_0xf0fe('0x17'));var db=require(_0xf0fe('0x18'))['db'];var integrations=require(_0xf0fe('0x19'));function respondWithStatusCode(_0x2fdd13,_0x2b1ff4){_0x2b1ff4=_0x2b1ff4||0xcc;return function(_0x1414bb){if(_0x1414bb){return _0x2fdd13[_0xf0fe('0x1a')](_0x2b1ff4);}return _0x2fdd13[_0xf0fe('0x1b')](_0x2b1ff4)[_0xf0fe('0x1c')]();};}function respondWithResult(_0x4a5385,_0x26c859){_0x26c859=_0x26c859||0xc8;return function(_0x354ed2){if(_0x354ed2){return _0x4a5385[_0xf0fe('0x1b')](_0x26c859)[_0xf0fe('0x1d')](_0x354ed2);}};}function respondWithFilteredResult(_0x1e6a87,_0x2091d2){return function(_0x4761f6){if(_0x4761f6){var _0x24e2c7=typeof _0x2091d2['offset']===_0xf0fe('0x1e')&&typeof _0x2091d2[_0xf0fe('0x1f')]==='undefined';var _0x3b9d50=_0x4761f6[_0xf0fe('0x20')];var _0x49cbdc=_0x24e2c7?0x0:_0x2091d2[_0xf0fe('0x21')];var _0x533ed0=_0x24e2c7?_0x4761f6['count']:_0x2091d2[_0xf0fe('0x21')]+_0x2091d2[_0xf0fe('0x1f')];var _0xc4b60e;if(_0x533ed0>=_0x3b9d50){_0x533ed0=_0x3b9d50;_0xc4b60e=0xc8;}else{_0xc4b60e=0xce;}_0x1e6a87[_0xf0fe('0x1b')](_0xc4b60e);return _0x1e6a87[_0xf0fe('0x22')](_0xf0fe('0x23'),_0x49cbdc+'-'+_0x533ed0+'/'+_0x3b9d50)[_0xf0fe('0x1d')](_0x4761f6);}return null;};}function patchUpdates(_0x532f0d){return function(_0x1b39a9){try{jsonpatch[_0xf0fe('0x24')](_0x1b39a9,_0x532f0d,!![]);}catch(_0x45288f){return BPromise['reject'](_0x45288f);}return _0x1b39a9['save']();};}function saveUpdates(_0x202c14,_0xe5800d){return function(_0x263b1d){if(_0x263b1d){return _0x263b1d['update'](_0x202c14)[_0xf0fe('0x25')](function(_0x4a663b){return _0x4a663b;});}return null;};}function removeEntity(_0xee694b,_0x1018bb){return function(_0x351fcf){if(_0x351fcf){return _0x351fcf[_0xf0fe('0x26')]()['then'](function(){_0xee694b[_0xf0fe('0x1b')](0xcc)[_0xf0fe('0x1c')]();});}};}function handleEntityNotFound(_0x4d7534,_0x52341f){return function(_0x26530e){if(!_0x26530e){_0x4d7534[_0xf0fe('0x1a')](0x194);}return _0x26530e;};}function handleError(_0x336923,_0x3a2fc9){_0x3a2fc9=_0x3a2fc9||0x1f4;return function(_0x20bfd0){logger[_0xf0fe('0x27')](_0x20bfd0['stack']);if(_0x20bfd0['name']){delete _0x20bfd0[_0xf0fe('0x28')];}_0x336923[_0xf0fe('0x1b')](_0x3a2fc9)['send'](_0x20bfd0);};}exports[_0xf0fe('0x29')]=function(_0x132e7b,_0x307e71){var _0x52005c={},_0x1a236a={},_0x407b8a={'count':0x0,'rows':[]};var _0x2bafaf=_[_0xf0fe('0x2a')](db['ServicenowAccount'][_0xf0fe('0x2b')],function(_0x55a82a){return{'name':_0x55a82a[_0xf0fe('0x2c')],'type':_0x55a82a[_0xf0fe('0x2d')][_0xf0fe('0x2e')]};});_0x1a236a[_0xf0fe('0x2f')]=_[_0xf0fe('0x2a')](_0x2bafaf,_0xf0fe('0x28'));_0x1a236a[_0xf0fe('0x30')]=_[_0xf0fe('0x31')](_0x132e7b[_0xf0fe('0x30')]);_0x1a236a['filters']=_[_0xf0fe('0x32')](_0x1a236a[_0xf0fe('0x2f')],_0x1a236a['query']);_0x52005c[_0xf0fe('0x33')]=_[_0xf0fe('0x32')](_0x1a236a[_0xf0fe('0x2f')],qs['fields'](_0x132e7b[_0xf0fe('0x30')][_0xf0fe('0x34')]));_0x52005c[_0xf0fe('0x33')]=_0x52005c[_0xf0fe('0x33')][_0xf0fe('0x35')]?_0x52005c['attributes']:_0x1a236a[_0xf0fe('0x2f')];if(!_0x132e7b[_0xf0fe('0x30')]['hasOwnProperty']('nolimit')){_0x52005c['limit']=qs[_0xf0fe('0x1f')](_0x132e7b[_0xf0fe('0x30')][_0xf0fe('0x1f')]);_0x52005c[_0xf0fe('0x21')]=qs['offset'](_0x132e7b[_0xf0fe('0x30')]['offset']);}_0x52005c[_0xf0fe('0x36')]=qs['sort'](_0x132e7b['query']['sort']);_0x52005c[_0xf0fe('0x37')]=qs['filters'](_[_0xf0fe('0x38')](_0x132e7b['query'],_0x1a236a[_0xf0fe('0x39')]),_0x2bafaf);if(_0x132e7b[_0xf0fe('0x30')][_0xf0fe('0x3a')]){_0x52005c[_0xf0fe('0x37')]=_['merge'](_0x52005c[_0xf0fe('0x37')],{'$or':_['map'](_0x2bafaf,function(_0x4cf32e){if(_0x4cf32e[_0xf0fe('0x2d')]!==_0xf0fe('0x3b')){var _0x31169f={};_0x31169f[_0x4cf32e[_0xf0fe('0x28')]]={'$like':'%'+_0x132e7b['query'][_0xf0fe('0x3a')]+'%'};return _0x31169f;}})});}_0x52005c=_['merge']({},_0x52005c,_0x132e7b[_0xf0fe('0x3c')]);var _0x1994f6={'where':_0x52005c['where']};return db[_0xf0fe('0x3d')]['count'](_0x1994f6)['then'](function(_0x50be49){_0x407b8a[_0xf0fe('0x20')]=_0x50be49;if(_0x132e7b[_0xf0fe('0x30')][_0xf0fe('0x3e')]){_0x52005c[_0xf0fe('0x3f')]=[{'all':!![]}];}return db[_0xf0fe('0x3d')][_0xf0fe('0x40')](_0x52005c);})[_0xf0fe('0x25')](function(_0x3d300f){_0x407b8a[_0xf0fe('0x41')]=_0x3d300f;return _0x407b8a;})[_0xf0fe('0x25')](respondWithFilteredResult(_0x307e71,_0x52005c))[_0xf0fe('0x42')](handleError(_0x307e71,null));};exports[_0xf0fe('0x43')]=function(_0x3301c2,_0x2ec7ae){var _0x1127b6={'raw':![],'where':{'id':_0x3301c2[_0xf0fe('0x44')]['id']}},_0x1a2974={};_0x1a2974[_0xf0fe('0x2f')]=_[_0xf0fe('0x31')](db[_0xf0fe('0x3d')][_0xf0fe('0x2b')]);_0x1a2974[_0xf0fe('0x30')]=_[_0xf0fe('0x31')](_0x3301c2[_0xf0fe('0x30')]);_0x1a2974[_0xf0fe('0x39')]=_['intersection'](_0x1a2974[_0xf0fe('0x2f')],_0x1a2974[_0xf0fe('0x30')]);_0x1127b6[_0xf0fe('0x33')]=_[_0xf0fe('0x32')](_0x1a2974[_0xf0fe('0x2f')],qs['fields'](_0x3301c2[_0xf0fe('0x30')][_0xf0fe('0x34')]));_0x1127b6[_0xf0fe('0x33')]=_0x1127b6[_0xf0fe('0x33')][_0xf0fe('0x35')]?_0x1127b6['attributes']:_0x1a2974[_0xf0fe('0x2f')];if(_0x3301c2[_0xf0fe('0x30')][_0xf0fe('0x3e')]){_0x1127b6[_0xf0fe('0x3f')]=[{'all':!![]}];}_0x1127b6=_[_0xf0fe('0x45')]({},_0x1127b6,_0x3301c2['options']);return db['ServicenowAccount'][_0xf0fe('0x46')](_0x1127b6)[_0xf0fe('0x25')](handleEntityNotFound(_0x2ec7ae,null))[_0xf0fe('0x25')](respondWithResult(_0x2ec7ae,null))[_0xf0fe('0x42')](handleError(_0x2ec7ae,null));};exports['create']=function(_0x25c7df,_0xa92fbb){return db[_0xf0fe('0x3d')][_0xf0fe('0x47')](_0x25c7df[_0xf0fe('0x48')],{})[_0xf0fe('0x25')](respondWithResult(_0xa92fbb,0xc9))[_0xf0fe('0x42')](handleError(_0xa92fbb,null));};exports[_0xf0fe('0x49')]=function(_0x521e26,_0x551f3c){if(_0x521e26[_0xf0fe('0x48')]['id']){delete _0x521e26[_0xf0fe('0x48')]['id'];}return db[_0xf0fe('0x3d')][_0xf0fe('0x46')]({'where':{'id':_0x521e26[_0xf0fe('0x44')]['id']}})['then'](handleEntityNotFound(_0x551f3c,null))[_0xf0fe('0x25')](saveUpdates(_0x521e26[_0xf0fe('0x48')],null))[_0xf0fe('0x25')](respondWithResult(_0x551f3c,null))['catch'](handleError(_0x551f3c,null));};exports[_0xf0fe('0x26')]=function(_0x3a0205,_0x3796de){return db[_0xf0fe('0x3d')][_0xf0fe('0x46')]({'where':{'id':_0x3a0205['params']['id']}})[_0xf0fe('0x25')](handleEntityNotFound(_0x3796de,null))[_0xf0fe('0x25')](removeEntity(_0x3796de,null))[_0xf0fe('0x42')](handleError(_0x3796de,null));};exports[_0xf0fe('0x4a')]=function(_0x2a8b12,_0x10b4ea,_0x3b422d){var _0x2348e2={};var _0x222d16={};var _0x3029ef;var _0x5065a1;return db[_0xf0fe('0x3d')][_0xf0fe('0x4b')]({'where':{'id':_0x2a8b12[_0xf0fe('0x44')]['id']}})['then'](handleEntityNotFound(_0x10b4ea,null))[_0xf0fe('0x25')](function(_0x2ad9a6){if(_0x2ad9a6){_0x3029ef=_0x2ad9a6;_0x222d16[_0xf0fe('0x2f')]=_[_0xf0fe('0x31')](db[_0xf0fe('0x4c')][_0xf0fe('0x2b')]);_0x222d16[_0xf0fe('0x30')]=_[_0xf0fe('0x31')](_0x2a8b12[_0xf0fe('0x30')]);_0x222d16['filters']=_[_0xf0fe('0x32')](_0x222d16[_0xf0fe('0x2f')],_0x222d16[_0xf0fe('0x30')]);_0x2348e2['attributes']=_[_0xf0fe('0x32')](_0x222d16[_0xf0fe('0x2f')],qs['fields'](_0x2a8b12[_0xf0fe('0x30')][_0xf0fe('0x34')]));_0x2348e2['attributes']=_0x2348e2[_0xf0fe('0x33')][_0xf0fe('0x35')]?_0x2348e2['attributes']:_0x222d16[_0xf0fe('0x2f')];_0x2348e2[_0xf0fe('0x36')]=qs[_0xf0fe('0x4d')](_0x2a8b12[_0xf0fe('0x30')][_0xf0fe('0x4d')]);_0x2348e2[_0xf0fe('0x37')]=qs[_0xf0fe('0x39')](_[_0xf0fe('0x38')](_0x2a8b12[_0xf0fe('0x30')],_0x222d16[_0xf0fe('0x39')]));if(_0x2a8b12[_0xf0fe('0x30')][_0xf0fe('0x3a')]){_0x2348e2[_0xf0fe('0x37')]=_[_0xf0fe('0x45')](_0x2348e2[_0xf0fe('0x37')],{'$or':_[_0xf0fe('0x2a')](_0x2348e2[_0xf0fe('0x33')],function(_0x1ef635){var _0x492ce7={};_0x492ce7[_0x1ef635]={'$like':'%'+_0x2a8b12[_0xf0fe('0x30')][_0xf0fe('0x3a')]+'%'};return _0x492ce7;})});}_0x2348e2=_[_0xf0fe('0x45')]({},_0x2348e2,_0x2a8b12[_0xf0fe('0x3c')]);return _0x3029ef['getConfigurations'](_0x2348e2);}})[_0xf0fe('0x25')](function(_0x23abd8){if(_0x23abd8){_0x5065a1=_0x23abd8[_0xf0fe('0x35')];if(!_0x2a8b12[_0xf0fe('0x30')][_0xf0fe('0x4e')](_0xf0fe('0x4f'))){_0x2348e2[_0xf0fe('0x1f')]=qs[_0xf0fe('0x1f')](_0x2a8b12['query'][_0xf0fe('0x1f')]);_0x2348e2[_0xf0fe('0x21')]=qs[_0xf0fe('0x21')](_0x2a8b12[_0xf0fe('0x30')][_0xf0fe('0x21')]);}return _0x3029ef[_0xf0fe('0x4a')](_0x2348e2);}})[_0xf0fe('0x25')](function(_0x4740f7){if(_0x4740f7){return _0x4740f7?{'count':_0x5065a1,'rows':_0x4740f7}:null;}})[_0xf0fe('0x25')](respondWithResult(_0x10b4ea,null))[_0xf0fe('0x42')](handleError(_0x10b4ea,null));};exports['addConfiguration']=function(_0x2644f4,_0x51b583,_0x3e3221){if(_0x2644f4[_0xf0fe('0x48')]['id']){delete _0x2644f4['body']['id'];}return db['ServicenowAccount'][_0xf0fe('0x4b')]({'where':{'id':_0x2644f4[_0xf0fe('0x44')]['id']}})[_0xf0fe('0x25')](handleEntityNotFound(_0x51b583,null))[_0xf0fe('0x25')](function(_0x46bc69){if(_0x46bc69){_0x2644f4[_0xf0fe('0x48')][_0xf0fe('0x50')]=_0x46bc69['id'];_0x2644f4['body']['Subjects']=integrations[_0xf0fe('0x51')](_0x2644f4['body'][_0xf0fe('0x52')],_0x2644f4[_0xf0fe('0x48')][_0xf0fe('0x2d')]);_0x2644f4[_0xf0fe('0x48')]['Descriptions']=integrations['getDescriptions'](_0x2644f4['body'][_0xf0fe('0x52')],_0x2644f4[_0xf0fe('0x48')][_0xf0fe('0x2d')]);return db[_0xf0fe('0x4c')]['create'](_0x2644f4[_0xf0fe('0x48')],{'include':[{'model':db['ServicenowField'],'as':_0xf0fe('0x53')},{'model':db[_0xf0fe('0x54')],'as':'Descriptions'}]});}return null;})[_0xf0fe('0x25')](respondWithResult(_0x51b583,null))[_0xf0fe('0x42')](handleError(_0x51b583,null));};exports[_0xf0fe('0x55')]=function(_0x5658e4,_0xbc0a58,_0x2c0162){var _0x2c5ed0=[_0xf0fe('0x56'),_0xf0fe('0x57'),_0xf0fe('0x58'),_0xf0fe('0x59'),_0xf0fe('0x5a'),_0xf0fe('0x5b'),'incident_state',_0xf0fe('0x5c'),'category'];var _0x44ceb0=[_0xf0fe('0x5d'),_0xf0fe('0x56'),_0xf0fe('0x5e'),_0xf0fe('0x5f'),_0xf0fe('0x60'),_0xf0fe('0x61'),_0xf0fe('0x62'),_0xf0fe('0x57'),'approval_history',_0xf0fe('0x63'),'resolved_by',_0xf0fe('0x64'),_0xf0fe('0x65'),'user_input',_0xf0fe('0x66'),_0xf0fe('0x67'),'state',_0xf0fe('0x68'),'knowledge',_0xf0fe('0x36'),_0xf0fe('0x69'),_0xf0fe('0x6a'),_0xf0fe('0x6b'),_0xf0fe('0x6c'),'impact','active','work_notes_list',_0xf0fe('0x6d'),_0xf0fe('0x6e'),'sys_domain_path',_0xf0fe('0x6f'),_0xf0fe('0x70'),_0xf0fe('0x71'),'opened_at',_0xf0fe('0x72'),_0xf0fe('0x73'),_0xf0fe('0x74'),_0xf0fe('0x75'),_0xf0fe('0x76'),_0xf0fe('0x77'),'approval_set','subcategory',_0xf0fe('0x78'),_0xf0fe('0x79'),_0xf0fe('0x5a'),_0xf0fe('0x7a'),_0xf0fe('0x7b'),_0xf0fe('0x7c'),_0xf0fe('0x7d'),_0xf0fe('0x7e'),_0xf0fe('0x7f'),_0xf0fe('0x80'),_0xf0fe('0x81'),'notify',_0xf0fe('0x82'),_0xf0fe('0x83'),_0xf0fe('0x84'),_0xf0fe('0x85'),_0xf0fe('0x86'),_0xf0fe('0x87'),_0xf0fe('0x88'),_0xf0fe('0x89'),_0xf0fe('0x8a'),_0xf0fe('0x8b'),_0xf0fe('0x8c'),_0xf0fe('0x8d'),'reassignment_count',_0xf0fe('0x8e'),_0xf0fe('0x8f'),_0xf0fe('0x5c'),'comments',_0xf0fe('0x90'),_0xf0fe('0x91'),_0xf0fe('0x92'),_0xf0fe('0x93'),'sys_mod_count','reopen_count',_0xf0fe('0x94'),'escalation',_0xf0fe('0x95'),_0xf0fe('0x96'),_0xf0fe('0x97'),_0xf0fe('0x98')];var _0xea7bb2='';var _0x2a2453='';var _0x51b33a=[];var _0x311d46='';var _0xa48f4e='';var _0x2b57b9=[];var _0x307da3='';var _0x88cef4='';var _0x5dd679={};var _0x551d43='';return db[_0xf0fe('0x3d')][_0xf0fe('0x4b')]({'where':{'id':_0x5658e4['params']['id']},'attributes':['id',_0xf0fe('0x99'),'password',_0xf0fe('0x9a'),_0xf0fe('0x9b'),_0xf0fe('0x9c')]})['then'](handleEntityNotFound(_0xbc0a58,null))[_0xf0fe('0x25')](function(_0x1f32f0){if(_0x1f32f0){_0x551d43=_0x1f32f0[_0xf0fe('0x9b')];var _0x452bed=_0x551d43[_0xf0fe('0x9d')](-0x1);if(_0x452bed==='/'){_0x551d43=_0x551d43[_0xf0fe('0x9e')](0x0,_0x551d43['lastIndexOf'](_0x452bed));}_0x88cef4=util['format'](_0xf0fe('0x9f'),_0x551d43);_0x307da3=util[_0xf0fe('0xa0')](_0xf0fe('0xa1'),_0x551d43);_0x5dd679={'user':_0x1f32f0[_0xf0fe('0x99')],'pass':_0x1f32f0[_0xf0fe('0xa2')]};var _0x1e6915={'method':'GET','uri':_0x88cef4+'incident?sysparm_display_value=all','auth':_0x5dd679,'json':!![]};return rp(_0x1e6915);}})[_0xf0fe('0x25')](function(_0x3d1e71){if(_0x3d1e71[_0xf0fe('0xa3')][_0xf0fe('0x35')]>0x0){_0xea7bb2=_0x3d1e71['result'];}console[_0xf0fe('0xa4')](_0xf0fe('0xa5'),_0xea7bb2);_0x2b57b9=[];_0x2a2453=Object[_0xf0fe('0xa6')]([],_0xea7bb2);_['remove'](_0x2a2453,function(_0x2be483){return!_0x2c5ed0[_0xf0fe('0xa7')](_0x2be483[_0xf0fe('0x28')]);});_0x2a2453[_0xf0fe('0xa8')](function(_0x6b8340){var _0x48fbbe=createFieldObject(_0x307da3,_0x5dd679,_0x6b8340['internalType'],_0x6b8340[_0xf0fe('0x28')],_0x6b8340['label'],![]);_0x2b57b9[_0xf0fe('0xa9')](_0x48fbbe);});return Promise[_0xf0fe('0xaa')](_0x2b57b9);})[_0xf0fe('0x25')](function(_0x24da6d){_0x51b33a=_0x24da6d;_0x311d46=Object[_0xf0fe('0xa6')]([],_0xea7bb2);console[_0xf0fe('0xa4')]('TCL:\x20_object',_0xea7bb2);_[_0xf0fe('0xab')](_0x311d46,function(_0x52a564){return _0x44ceb0['includes'](_0x52a564[_0xf0fe('0x28')]);});console[_0xf0fe('0xa4')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x311d46);_0x2b57b9=[];_0x311d46[_0xf0fe('0xa8')](function(_0x5aa059){var _0x4869db=createFieldObject(_0x307da3,_0x5dd679,_0x5aa059['internalType'],_0x5aa059[_0xf0fe('0x28')],_0x5aa059[_0xf0fe('0xac')],!![]);_0x2b57b9[_0xf0fe('0xa9')](_0x4869db);});return Promise['all'](_0x2b57b9);})[_0xf0fe('0x25')](function(_0x3e466a){_0xa48f4e=_0x3e466a;var _0x13cfb7=_0x51b33a['concat'](_0xa48f4e);return{'count':_0x13cfb7['length'],'rows':_0x13cfb7};})['then'](respondWithResult(_0xbc0a58,null))[_0xf0fe('0x42')](function(_0x394de9){console[_0xf0fe('0xa4')](_0xf0fe('0xad')+_0x394de9);var _0x398207=_0x5658e4[_0xf0fe('0x30')]['test']?0x1f4:_0x394de9[_0xf0fe('0xae')]||0x1f4;logger[_0xf0fe('0x27')](_0x394de9['stack']);delete _0x394de9[_0xf0fe('0x28')];if(_0x398207===0x191){_0x398207=0x190;}_0xbc0a58[_0xf0fe('0x1b')](_0x398207)['send'](_0x5658e4[_0xf0fe('0x30')][_0xf0fe('0xaf')]?{'message':_0xf0fe('0xb0'),'statusCode':_0x394de9[_0xf0fe('0xae')]}:_0x394de9);});};function createFieldObject(_0x5b36e5,_0x120e03,_0x3ad8f6,_0x9e096e,_0x1bc52c,_0x586c50){return new Promise(function(_0x18bca3,_0x532c4e){var _0x2963e6={'id':_0x9e096e,'name':_0x1bc52c,'custom':_0x586c50};if(_0x3ad8f6===_0xf0fe('0xb1')){_0x2963e6[_0xf0fe('0x3c')]=[{'name':_0xf0fe('0xb2'),'value':_0xf0fe('0xb3')},{'name':_0xf0fe('0xb4'),'value':_0xf0fe('0xb5')}];_0x18bca3(_0x2963e6);}else{var _0x1e67d7={'method':_0xf0fe('0xb6'),'uri':_0x5b36e5+_0xf0fe('0xb7')+_0x9e096e,'auth':_0x120e03,'json':!![]};return rp(_0x1e67d7)['then'](function(_0xd59ea6){var _0x685c5b=[];if(_0xd59ea6[_0xf0fe('0xa3')][_0xf0fe('0x35')]>0x0){_0xd59ea6[_0xf0fe('0xa3')]['forEach'](function(_0x2926bf){if(_0x2926bf[_0xf0fe('0xb8')]===_0xf0fe('0xb5')){var _0x4726e9={'name':_0x2926bf[_0xf0fe('0xac')],'value':_0x2926bf['value']};_0x685c5b[_0xf0fe('0xa9')](_0x4726e9);}});}_0x2963e6[_0xf0fe('0x3c')]=_0x685c5b;if(_0x2963e6[_0xf0fe('0x3c')][_0xf0fe('0x35')]>0x0){_0x18bca3(_0x2963e6);}else{if(_0x586c50==![]){_0x18bca3();}else{_0x18bca3(_0x2963e6);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 4311c34..ec33d15 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 _0x9c5a=['int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x3f5bd4,_0x1f8853){var _0x77beff=function(_0x3bc261){while(--_0x3bc261){_0x3f5bd4['push'](_0x3f5bd4['shift']());}};_0x77beff(++_0x1f8853);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x4f4be3,_0x46cfdf){_0x4f4be3=_0x4f4be3-0x0;var _0x99afcd=_0x9c5a[_0x4f4be3];return _0x99afcd;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xa9c5('0x8'));module['exports']=function(_0x394d84,_0x3df556){return _0x394d84['define']('ServicenowAccount',attributes,{'tableName':_0xa9c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x687b=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x527c4f,_0x20149f){var _0x1342bb=function(_0x420f9a){while(--_0x420f9a){_0x527c4f['push'](_0x527c4f['shift']());}};_0x1342bb(++_0x20149f);}(_0x687b,0x14a));var _0xb687=function(_0x4a6979,_0x5f3d1a){_0x4a6979=_0x4a6979-0x0;var _0x226f93=_0x687b[_0x4a6979];return _0x226f93;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));var integrations=require(_0xb687('0x9'));module[_0xb687('0xa')]=function(_0xf43a1f,_0x47ffea){return _0xf43a1f[_0xb687('0xb')]('ServicenowAccount',attributes,{'tableName':_0xb687('0xc'),'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 2e25d1a..219d6ba 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 _0x46a1=['attributes','stringify','ShowServicenowAccount','find','raw','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','limit','include','map','model'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0x46a1,0x17b));var _0x146a=function(_0x4ac248,_0xa3d161){_0x4ac248=_0x4ac248-0x0;var _0x810d4b=_0x46a1[_0x4ac248];return _0x810d4b;};'use strict';var _=require(_0x146a('0x0'));var util=require(_0x146a('0x1'));var moment=require(_0x146a('0x2'));var BPromise=require(_0x146a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x146a('0x4'));var logger=require(_0x146a('0x5'))('rpc');var config=require(_0x146a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x146a('0x7')][_0x146a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c4e2b,_0x45960f,_0x146263){return new BPromise(function(_0x4859fd,_0x38a378){return client[_0x146a('0x9')](_0x1c4e2b,_0x146263)[_0x146a('0xa')](function(_0x161045){logger[_0x146a('0xb')](_0x146a('0xc'),_0x45960f,_0x146a('0xd'));logger[_0x146a('0xe')](_0x146a('0xf'),_0x45960f,'request\x20sent',JSON['stringify'](_0x161045));if(_0x161045[_0x146a('0x10')]){if(_0x161045[_0x146a('0x10')]['code']===0x1f4){logger[_0x146a('0x10')](_0x146a('0xc'),_0x45960f,_0x161045['error'][_0x146a('0x11')]);return _0x38a378(_0x161045[_0x146a('0x10')]['message']);}logger[_0x146a('0x10')](_0x146a('0xc'),_0x45960f,_0x161045[_0x146a('0x10')][_0x146a('0x11')]);return _0x4859fd(_0x161045[_0x146a('0x10')][_0x146a('0x11')]);}else{logger[_0x146a('0xb')](_0x146a('0xc'),_0x45960f,'request\x20sent');_0x4859fd(_0x161045[_0x146a('0x12')]['message']);}})[_0x146a('0x13')](function(_0x59f968){logger[_0x146a('0x10')](_0x146a('0xc'),_0x45960f,_0x59f968);_0x38a378(_0x59f968);});});}exports[_0x146a('0x14')]=function(_0x5aa9ba){var _0x4b17d2=this;return new Promise(function(_0x12acd2,_0x240e08){return db[_0x146a('0x15')][_0x146a('0x16')]({'raw':_0x5aa9ba[_0x146a('0x17')]?_0x5aa9ba[_0x146a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5aa9ba['options']?_0x5aa9ba[_0x146a('0x17')][_0x146a('0x18')]||null:null,'attributes':_0x5aa9ba[_0x146a('0x17')]?_0x5aa9ba['options']['attributes']||null:null,'limit':_0x5aa9ba[_0x146a('0x17')]?_0x5aa9ba['options'][_0x146a('0x19')]||null:null,'include':_0x5aa9ba['options']?_0x5aa9ba[_0x146a('0x17')][_0x146a('0x1a')]?_[_0x146a('0x1b')](_0x5aa9ba[_0x146a('0x17')][_0x146a('0x1a')],function(_0x5e49ca){return{'model':db[_0x5e49ca[_0x146a('0x1c')]],'as':_0x5e49ca['as'],'attributes':_0x5e49ca[_0x146a('0x1d')],'include':_0x5e49ca[_0x146a('0x1a')]?_['map'](_0x5e49ca[_0x146a('0x1a')],function(_0x557f9d){return{'model':db[_0x557f9d[_0x146a('0x1c')]],'as':_0x557f9d['as'],'attributes':_0x557f9d[_0x146a('0x1d')],'include':_0x557f9d['include']?_[_0x146a('0x1b')](_0x557f9d[_0x146a('0x1a')],function(_0x52aee4){return{'model':db[_0x52aee4['model']],'as':_0x52aee4['as'],'attributes':_0x52aee4[_0x146a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x146a('0xa')](function(_0x408bfb){logger[_0x146a('0xb')]('GetServicenowAccount',_0x5aa9ba);logger['debug'](_0x146a('0x14'),_0x5aa9ba,JSON[_0x146a('0x1e')](_0x408bfb));_0x12acd2(_0x408bfb);})[_0x146a('0x13')](function(_0x10b1a3){logger[_0x146a('0x10')](_0x146a('0x14'),_0x10b1a3[_0x146a('0x11')],_0x5aa9ba);_0x240e08(_0x4b17d2['error'](0x1f4,_0x10b1a3['message']));});});};exports[_0x146a('0x1f')]=function(_0xfb9741){var _0x5c4837=this;return new Promise(function(_0x28cfdc,_0x39490d){return db[_0x146a('0x15')][_0x146a('0x20')]({'raw':_0xfb9741[_0x146a('0x17')]?_0xfb9741[_0x146a('0x17')][_0x146a('0x21')]===undefined?!![]:![]:!![],'where':_0xfb9741['options']?_0xfb9741[_0x146a('0x17')][_0x146a('0x18')]||null:null,'attributes':_0xfb9741[_0x146a('0x17')]?_0xfb9741['options'][_0x146a('0x1d')]||null:null,'include':_0xfb9741[_0x146a('0x17')]?_0xfb9741[_0x146a('0x17')][_0x146a('0x1a')]?_['map'](_0xfb9741[_0x146a('0x17')][_0x146a('0x1a')],function(_0x121a23){return{'model':db[_0x121a23[_0x146a('0x1c')]],'as':_0x121a23['as'],'attributes':_0x121a23[_0x146a('0x1d')],'include':_0x121a23['include']?_[_0x146a('0x1b')](_0x121a23['include'],function(_0x208d0b){return{'model':db[_0x208d0b[_0x146a('0x1c')]],'as':_0x208d0b['as'],'attributes':_0x208d0b[_0x146a('0x1d')],'include':_0x208d0b[_0x146a('0x1a')]?_[_0x146a('0x1b')](_0x208d0b[_0x146a('0x1a')],function(_0x51f574){return{'model':db[_0x51f574[_0x146a('0x1c')]],'as':_0x51f574['as'],'attributes':_0x51f574[_0x146a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x146a('0xa')](function(_0x3f32d5){logger['info'](_0x146a('0x1f'),_0xfb9741);logger[_0x146a('0xe')](_0x146a('0x1f'),_0xfb9741,JSON[_0x146a('0x1e')](_0x3f32d5));_0x28cfdc(_0x3f32d5);})[_0x146a('0x13')](function(_0x2a3b53){logger[_0x146a('0x10')](_0x146a('0x1f'),_0x2a3b53[_0x146a('0x11')],_0xfb9741);_0x39490d(_0x5c4837[_0x146a('0x10')](0x1f4,_0x2a3b53[_0x146a('0x11')]));});});}; \ No newline at end of file +var _0x4392=['http','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','options','where','include','map','model','attributes','then','stringify','find','raw','ShowServicenowAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x8b4966,_0x1f4ec3){var _0x4e3470=function(_0x3edd92){while(--_0x3edd92){_0x8b4966['push'](_0x8b4966['shift']());}};_0x4e3470(++_0x1f4ec3);}(_0x4392,0xc7));var _0x2439=function(_0x3ec5ab,_0x17b398){_0x3ec5ab=_0x3ec5ab-0x0;var _0x39e35e=_0x4392[_0x3ec5ab];return _0x39e35e;};'use strict';var _=require(_0x2439('0x0'));var util=require(_0x2439('0x1'));var moment=require('moment');var BPromise=require(_0x2439('0x2'));var rs=require(_0x2439('0x3'));var fs=require('fs');var Redis=require(_0x2439('0x4'));var db=require(_0x2439('0x5'))['db'];var utils=require(_0x2439('0x6'));var logger=require('../../config/logger')(_0x2439('0x7'));var config=require(_0x2439('0x8'));var jayson=require(_0x2439('0x9'));var client=jayson[_0x2439('0xa')][_0x2439('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1eb182,_0x25a9c2,_0x54883e){return new BPromise(function(_0x1e7627,_0x1ebacc){return client['request'](_0x1eb182,_0x54883e)['then'](function(_0x3aae61){logger[_0x2439('0xc')](_0x2439('0xd'),_0x25a9c2,_0x2439('0xe'));logger[_0x2439('0xf')](_0x2439('0x10'),_0x25a9c2,_0x2439('0xe'),JSON['stringify'](_0x3aae61));if(_0x3aae61[_0x2439('0x11')]){if(_0x3aae61[_0x2439('0x11')][_0x2439('0x12')]===0x1f4){logger['error'](_0x2439('0xd'),_0x25a9c2,_0x3aae61[_0x2439('0x11')][_0x2439('0x13')]);return _0x1ebacc(_0x3aae61[_0x2439('0x11')]['message']);}logger['error'](_0x2439('0xd'),_0x25a9c2,_0x3aae61[_0x2439('0x11')]['message']);return _0x1e7627(_0x3aae61[_0x2439('0x11')]['message']);}else{logger[_0x2439('0xc')](_0x2439('0xd'),_0x25a9c2,_0x2439('0xe'));_0x1e7627(_0x3aae61[_0x2439('0x14')]['message']);}})[_0x2439('0x15')](function(_0x1887be){logger['error'](_0x2439('0xd'),_0x25a9c2,_0x1887be);_0x1ebacc(_0x1887be);});});}exports[_0x2439('0x16')]=function(_0x311c75){var _0x5d45cb=this;return new Promise(function(_0x459c8e,_0x20b60e){return db[_0x2439('0x17')]['findAll']({'raw':_0x311c75[_0x2439('0x18')]?_0x311c75[_0x2439('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x311c75[_0x2439('0x18')]?_0x311c75[_0x2439('0x18')][_0x2439('0x19')]||null:null,'attributes':_0x311c75[_0x2439('0x18')]?_0x311c75['options']['attributes']||null:null,'limit':_0x311c75['options']?_0x311c75[_0x2439('0x18')]['limit']||null:null,'include':_0x311c75[_0x2439('0x18')]?_0x311c75[_0x2439('0x18')][_0x2439('0x1a')]?_[_0x2439('0x1b')](_0x311c75[_0x2439('0x18')][_0x2439('0x1a')],function(_0x30dcd4){return{'model':db[_0x30dcd4[_0x2439('0x1c')]],'as':_0x30dcd4['as'],'attributes':_0x30dcd4[_0x2439('0x1d')],'include':_0x30dcd4[_0x2439('0x1a')]?_['map'](_0x30dcd4[_0x2439('0x1a')],function(_0x57c49c){return{'model':db[_0x57c49c[_0x2439('0x1c')]],'as':_0x57c49c['as'],'attributes':_0x57c49c['attributes'],'include':_0x57c49c[_0x2439('0x1a')]?_[_0x2439('0x1b')](_0x57c49c[_0x2439('0x1a')],function(_0x32705d){return{'model':db[_0x32705d[_0x2439('0x1c')]],'as':_0x32705d['as'],'attributes':_0x32705d[_0x2439('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2439('0x1e')](function(_0x4a99cf){logger[_0x2439('0xc')](_0x2439('0x16'),_0x311c75);logger[_0x2439('0xf')](_0x2439('0x16'),_0x311c75,JSON[_0x2439('0x1f')](_0x4a99cf));_0x459c8e(_0x4a99cf);})[_0x2439('0x15')](function(_0x26906c){logger[_0x2439('0x11')](_0x2439('0x16'),_0x26906c[_0x2439('0x13')],_0x311c75);_0x20b60e(_0x5d45cb[_0x2439('0x11')](0x1f4,_0x26906c[_0x2439('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x5e3a43){var _0x3cf695=this;return new Promise(function(_0x2d30dd,_0x169f56){return db[_0x2439('0x17')][_0x2439('0x20')]({'raw':_0x5e3a43['options']?_0x5e3a43[_0x2439('0x18')][_0x2439('0x21')]===undefined?!![]:![]:!![],'where':_0x5e3a43['options']?_0x5e3a43['options']['where']||null:null,'attributes':_0x5e3a43[_0x2439('0x18')]?_0x5e3a43[_0x2439('0x18')]['attributes']||null:null,'include':_0x5e3a43['options']?_0x5e3a43['options'][_0x2439('0x1a')]?_['map'](_0x5e3a43[_0x2439('0x18')]['include'],function(_0x10439a){return{'model':db[_0x10439a[_0x2439('0x1c')]],'as':_0x10439a['as'],'attributes':_0x10439a[_0x2439('0x1d')],'include':_0x10439a['include']?_[_0x2439('0x1b')](_0x10439a['include'],function(_0x1719e1){return{'model':db[_0x1719e1[_0x2439('0x1c')]],'as':_0x1719e1['as'],'attributes':_0x1719e1[_0x2439('0x1d')],'include':_0x1719e1[_0x2439('0x1a')]?_[_0x2439('0x1b')](_0x1719e1['include'],function(_0x2ab978){return{'model':db[_0x2ab978[_0x2439('0x1c')]],'as':_0x2ab978['as'],'attributes':_0x2ab978[_0x2439('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2439('0x1e')](function(_0x43d6d2){logger[_0x2439('0xc')]('ShowServicenowAccount',_0x5e3a43);logger[_0x2439('0xf')](_0x2439('0x22'),_0x5e3a43,JSON['stringify'](_0x43d6d2));_0x2d30dd(_0x43d6d2);})['catch'](function(_0x26ae7d){logger[_0x2439('0x11')](_0x2439('0x22'),_0x26ae7d[_0x2439('0x13')],_0x5e3a43);_0x169f56(_0x3cf695[_0x2439('0x11')](0x1f4,_0x26ae7d[_0x2439('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 7f8b982..de1ee79 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 _0xdc85=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','show','/:id/fields'];(function(_0x5eff31,_0x30b3a2){var _0x3decf0=function(_0x49ea1d){while(--_0x49ea1d){_0x5eff31['push'](_0x5eff31['shift']());}};_0x3decf0(++_0x30b3a2);}(_0xdc85,0x184));var _0x5dc8=function(_0x50d491,_0x2b1d98){_0x50d491=_0x50d491-0x0;var _0x52c422=_0xdc85[_0x50d491];return _0x52c422;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5dc8('0x0'));var timeout=require(_0x5dc8('0x1'));var express=require(_0x5dc8('0x2'));var router=express[_0x5dc8('0x3')]();var fs_extra=require(_0x5dc8('0x4'));var auth=require(_0x5dc8('0x5'));var interaction=require(_0x5dc8('0x6'));var config=require('../../config/environment');var controller=require(_0x5dc8('0x7'));router[_0x5dc8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x5dc8('0x9')](),controller[_0x5dc8('0xa')]);router[_0x5dc8('0x8')](_0x5dc8('0xb'),auth['isAuthenticated'](),controller[_0x5dc8('0xc')]);router[_0x5dc8('0x8')](_0x5dc8('0xd'),auth[_0x5dc8('0x9')](),controller[_0x5dc8('0xe')]);router['get'](_0x5dc8('0xf'),auth['isAuthenticated'](),controller[_0x5dc8('0x10')]);router[_0x5dc8('0x11')]('/',auth[_0x5dc8('0x9')](),controller[_0x5dc8('0x12')]);router[_0x5dc8('0x13')](_0x5dc8('0x14'),auth[_0x5dc8('0x9')](),controller[_0x5dc8('0x15')]);router[_0x5dc8('0x16')](_0x5dc8('0x14'),auth[_0x5dc8('0x9')](),controller[_0x5dc8('0x17')]);module[_0x5dc8('0x18')]=router; \ No newline at end of file +var _0xa354=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update'];(function(_0x431004,_0xc7125a){var _0x4b739c=function(_0x582822){while(--_0x582822){_0x431004['push'](_0x431004['shift']());}};_0x4b739c(++_0xc7125a);}(_0xa354,0xab));var _0x4a35=function(_0x578157,_0x762d0a){_0x578157=_0x578157-0x0;var _0x3005db=_0xa354[_0x578157];return _0x3005db;};'use strict';var multer=require(_0x4a35('0x0'));var util=require(_0x4a35('0x1'));var path=require('path');var timeout=require(_0x4a35('0x2'));var express=require(_0x4a35('0x3'));var router=express[_0x4a35('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4a35('0x5'));var config=require(_0x4a35('0x6'));var controller=require(_0x4a35('0x7'));router[_0x4a35('0x8')]('/',auth[_0x4a35('0x9')](),controller[_0x4a35('0xa')]);router[_0x4a35('0x8')](_0x4a35('0xb'),auth[_0x4a35('0x9')](),controller[_0x4a35('0xc')]);router[_0x4a35('0x8')]('/:id/fields',auth[_0x4a35('0x9')](),controller[_0x4a35('0xd')]);router[_0x4a35('0x8')](_0x4a35('0xe'),auth[_0x4a35('0x9')](),controller[_0x4a35('0xf')]);router[_0x4a35('0x8')](_0x4a35('0x10'),auth[_0x4a35('0x9')](),controller[_0x4a35('0x11')]);router['post']('/',auth[_0x4a35('0x9')](),controller[_0x4a35('0x12')]);router[_0x4a35('0x13')](_0x4a35('0xb'),auth[_0x4a35('0x9')](),controller[_0x4a35('0x14')]);router[_0x4a35('0x15')](_0x4a35('0xb'),auth[_0x4a35('0x9')](),controller[_0x4a35('0x16')]);module[_0x4a35('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 1dce442..982657c 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 _0x8bcf=['sequelize','exports','STRING'];(function(_0x17785e,_0x407d4e){var _0x5ccb41=function(_0x4f055e){while(--_0x4f055e){_0x17785e['push'](_0x17785e['shift']());}};_0x5ccb41(++_0x407d4e);}(_0x8bcf,0x99));var _0xf8bc=function(_0x1b7cc1,_0x5c41e4){_0x1b7cc1=_0x1b7cc1-0x0;var _0x26abb3=_0x8bcf[_0x1b7cc1];return _0x26abb3;};'use strict';var Sequelize=require(_0xf8bc('0x0'));module[_0xf8bc('0x1')]={'name':{'type':Sequelize[_0xf8bc('0x2')]},'description':{'type':Sequelize[_0xf8bc('0x2')]}}; \ No newline at end of file +var _0x0cc1=['exports','STRING','sequelize'];(function(_0x1d987a,_0x38ccf6){var _0x4ace48=function(_0x23751e){while(--_0x23751e){_0x1d987a['push'](_0x1d987a['shift']());}};_0x4ace48(++_0x38ccf6);}(_0x0cc1,0x1eb));var _0x10cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cc1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x10cc('0x0'));module[_0x10cc('0x1')]={'name':{'type':Sequelize[_0x10cc('0x2')]},'description':{'type':Sequelize[_0x10cc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 256d43e..48ad51e 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 _0x949b=['then','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','ServicenowConfiguration','includeAll','include','rows','show','params','create','body','find','destroy','catch','getFields','findOne','ServicenowField','pick','filter','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','update'];(function(_0x5a0e20,_0x25dee4){var _0x20b0ac=function(_0x1a53cc){while(--_0x1a53cc){_0x5a0e20['push'](_0x5a0e20['shift']());}};_0x20b0ac(++_0x25dee4);}(_0x949b,0x72));var _0xb949=function(_0x1ed2ed,_0x374e63){_0x1ed2ed=_0x1ed2ed-0x0;var _0x3f0689=_0x949b[_0x1ed2ed];return _0x3f0689;};'use strict';var emlformat=require(_0xb949('0x0'));var rimraf=require(_0xb949('0x1'));var zipdir=require(_0xb949('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb949('0x3'));var moment=require('moment');var BPromise=require(_0xb949('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb949('0x5'));var sox=require('sox');var csv=require(_0xb949('0x6'));var ejs=require(_0xb949('0x7'));var fs=require('fs');var fs_extra=require(_0xb949('0x8'));var _=require('lodash');var squel=require(_0xb949('0x9'));var crypto=require('crypto');var jsforce=require(_0xb949('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb949('0x6'));var querystring=require(_0xb949('0xb'));var Papa=require(_0xb949('0xc'));var Redis=require('ioredis');var authService=require(_0xb949('0xd'));var qs=require(_0xb949('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb949('0xf'));var utils=require(_0xb949('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xb949('0x11'));var db=require(_0xb949('0x12'))['db'];function respondWithStatusCode(_0x2774d9,_0x44449c){_0x44449c=_0x44449c||0xcc;return function(_0x57dbef){if(_0x57dbef){return _0x2774d9[_0xb949('0x13')](_0x44449c);}return _0x2774d9[_0xb949('0x14')](_0x44449c)[_0xb949('0x15')]();};}function respondWithResult(_0x4d9a25,_0x103b18){_0x103b18=_0x103b18||0xc8;return function(_0x4b7dcf){if(_0x4b7dcf){return _0x4d9a25[_0xb949('0x14')](_0x103b18)[_0xb949('0x16')](_0x4b7dcf);}};}function respondWithFilteredResult(_0x30cbe1,_0x6b403e){return function(_0x23dbb7){if(_0x23dbb7){var _0x407af7=typeof _0x6b403e[_0xb949('0x17')]==='undefined'&&typeof _0x6b403e[_0xb949('0x18')]==='undefined';var _0x34f2f3=_0x23dbb7[_0xb949('0x19')];var _0x9166e9=_0x407af7?0x0:_0x6b403e['offset'];var _0x22d7cb=_0x407af7?_0x23dbb7[_0xb949('0x19')]:_0x6b403e[_0xb949('0x17')]+_0x6b403e[_0xb949('0x18')];var _0x150fd6;if(_0x22d7cb>=_0x34f2f3){_0x22d7cb=_0x34f2f3;_0x150fd6=0xc8;}else{_0x150fd6=0xce;}_0x30cbe1['status'](_0x150fd6);return _0x30cbe1['set'](_0xb949('0x1a'),_0x9166e9+'-'+_0x22d7cb+'/'+_0x34f2f3)['json'](_0x23dbb7);}return null;};}function patchUpdates(_0x30a7d6){return function(_0x3d7a85){try{jsonpatch['apply'](_0x3d7a85,_0x30a7d6,!![]);}catch(_0x16f1d5){return BPromise['reject'](_0x16f1d5);}return _0x3d7a85['save']();};}function saveUpdates(_0x1dbeb3,_0x23ceca){return function(_0x1fe771){if(_0x1fe771){return _0x1fe771[_0xb949('0x1b')](_0x1dbeb3)['then'](function(_0xbf4e24){return _0xbf4e24;});}return null;};}function removeEntity(_0x43496e,_0x23a6fd){return function(_0x5948be){if(_0x5948be){return _0x5948be['destroy']()[_0xb949('0x1c')](function(){_0x43496e['status'](0xcc)[_0xb949('0x15')]();});}};}function handleEntityNotFound(_0x1481ac,_0x26a4e4){return function(_0xd2efa6){if(!_0xd2efa6){_0x1481ac[_0xb949('0x13')](0x194);}return _0xd2efa6;};}function handleError(_0x1e7ab5,_0x17a82a){_0x17a82a=_0x17a82a||0x1f4;return function(_0x56b925){logger[_0xb949('0x1d')](_0x56b925['stack']);if(_0x56b925[_0xb949('0x1e')]){delete _0x56b925[_0xb949('0x1e')];}_0x1e7ab5[_0xb949('0x14')](_0x17a82a)[_0xb949('0x1f')](_0x56b925);};}exports[_0xb949('0x20')]=function(_0x575a92,_0x31e149){var _0x2e0222={},_0x2d6fb4={},_0x50abc1={'count':0x0,'rows':[]};var _0x5350fd=_[_0xb949('0x21')](db['ServicenowConfiguration'][_0xb949('0x22')],function(_0x25faa7){return{'name':_0x25faa7['fieldName'],'type':_0x25faa7[_0xb949('0x23')][_0xb949('0x24')]};});_0x2d6fb4[_0xb949('0x25')]=_[_0xb949('0x21')](_0x5350fd,_0xb949('0x1e'));_0x2d6fb4[_0xb949('0x26')]=_[_0xb949('0x27')](_0x575a92['query']);_0x2d6fb4[_0xb949('0x28')]=_[_0xb949('0x29')](_0x2d6fb4[_0xb949('0x25')],_0x2d6fb4[_0xb949('0x26')]);_0x2e0222[_0xb949('0x2a')]=_[_0xb949('0x29')](_0x2d6fb4[_0xb949('0x25')],qs[_0xb949('0x2b')](_0x575a92[_0xb949('0x26')][_0xb949('0x2b')]));_0x2e0222['attributes']=_0x2e0222[_0xb949('0x2a')][_0xb949('0x2c')]?_0x2e0222[_0xb949('0x2a')]:_0x2d6fb4[_0xb949('0x25')];if(!_0x575a92[_0xb949('0x26')][_0xb949('0x2d')](_0xb949('0x2e'))){_0x2e0222[_0xb949('0x18')]=qs[_0xb949('0x18')](_0x575a92[_0xb949('0x26')]['limit']);_0x2e0222[_0xb949('0x17')]=qs[_0xb949('0x17')](_0x575a92[_0xb949('0x26')][_0xb949('0x17')]);}_0x2e0222[_0xb949('0x2f')]=qs[_0xb949('0x30')](_0x575a92[_0xb949('0x26')]['sort']);_0x2e0222['where']=qs[_0xb949('0x28')](_['pick'](_0x575a92['query'],_0x2d6fb4['filters']),_0x5350fd);if(_0x575a92[_0xb949('0x26')]['filter']){_0x2e0222[_0xb949('0x31')]=_[_0xb949('0x32')](_0x2e0222['where'],{'$or':_[_0xb949('0x21')](_0x5350fd,function(_0x3cc6ee){if(_0x3cc6ee[_0xb949('0x23')]!==_0xb949('0x33')){var _0x33fac6={};_0x33fac6[_0x3cc6ee[_0xb949('0x1e')]]={'$like':'%'+_0x575a92['query']['filter']+'%'};return _0x33fac6;}})});}_0x2e0222=_['merge']({},_0x2e0222,_0x575a92[_0xb949('0x34')]);var _0x4f3631={'where':_0x2e0222[_0xb949('0x31')]};return db[_0xb949('0x35')][_0xb949('0x19')](_0x4f3631)['then'](function(_0x49b9ec){_0x50abc1[_0xb949('0x19')]=_0x49b9ec;if(_0x575a92[_0xb949('0x26')][_0xb949('0x36')]){_0x2e0222[_0xb949('0x37')]=[{'all':!![]}];}return db[_0xb949('0x35')]['findAll'](_0x2e0222);})[_0xb949('0x1c')](function(_0x36ee24){_0x50abc1[_0xb949('0x38')]=_0x36ee24;return _0x50abc1;})['then'](respondWithFilteredResult(_0x31e149,_0x2e0222))['catch'](handleError(_0x31e149,null));};exports[_0xb949('0x39')]=function(_0x542cf2,_0x38b732){var _0x210d48={'raw':![],'where':{'id':_0x542cf2[_0xb949('0x3a')]['id']}},_0x2cf155={};_0x2cf155[_0xb949('0x25')]=_[_0xb949('0x27')](db[_0xb949('0x35')][_0xb949('0x22')]);_0x2cf155[_0xb949('0x26')]=_[_0xb949('0x27')](_0x542cf2[_0xb949('0x26')]);_0x2cf155['filters']=_[_0xb949('0x29')](_0x2cf155[_0xb949('0x25')],_0x2cf155[_0xb949('0x26')]);_0x210d48[_0xb949('0x2a')]=_[_0xb949('0x29')](_0x2cf155[_0xb949('0x25')],qs[_0xb949('0x2b')](_0x542cf2['query']['fields']));_0x210d48[_0xb949('0x2a')]=_0x210d48[_0xb949('0x2a')][_0xb949('0x2c')]?_0x210d48[_0xb949('0x2a')]:_0x2cf155[_0xb949('0x25')];if(_0x542cf2[_0xb949('0x26')][_0xb949('0x36')]){_0x210d48[_0xb949('0x37')]=[{'all':!![]}];}_0x210d48=_[_0xb949('0x32')]({},_0x210d48,_0x542cf2[_0xb949('0x34')]);return db[_0xb949('0x35')]['find'](_0x210d48)['then'](handleEntityNotFound(_0x38b732,null))[_0xb949('0x1c')](respondWithResult(_0x38b732,null))['catch'](handleError(_0x38b732,null));};exports[_0xb949('0x3b')]=function(_0x5909a1,_0x28f026){return db[_0xb949('0x35')][_0xb949('0x3b')](_0x5909a1[_0xb949('0x3c')],{})[_0xb949('0x1c')](respondWithResult(_0x28f026,0xc9))['catch'](handleError(_0x28f026,null));};exports[_0xb949('0x1b')]=function(_0x45477c,_0x44077d){if(_0x45477c[_0xb949('0x3c')]['id']){delete _0x45477c[_0xb949('0x3c')]['id'];}return db['ServicenowConfiguration'][_0xb949('0x3d')]({'where':{'id':_0x45477c['params']['id']}})['then'](handleEntityNotFound(_0x44077d,null))[_0xb949('0x1c')](saveUpdates(_0x45477c['body'],null))['then'](respondWithResult(_0x44077d,null))['catch'](handleError(_0x44077d,null));};exports[_0xb949('0x3e')]=function(_0x483341,_0x306774){return db['ServicenowConfiguration'][_0xb949('0x3d')]({'where':{'id':_0x483341[_0xb949('0x3a')]['id']}})[_0xb949('0x1c')](handleEntityNotFound(_0x306774,null))[_0xb949('0x1c')](removeEntity(_0x306774,null))[_0xb949('0x3f')](handleError(_0x306774,null));};exports[_0xb949('0x40')]=function(_0x2e29e1,_0x319fc5,_0x3dab1d){var _0x51702d={};var _0x32eeff={};var _0x16e9b4;var _0x4e3b0c;return db[_0xb949('0x35')][_0xb949('0x41')]({'where':{'id':_0x2e29e1['params']['id']}})[_0xb949('0x1c')](handleEntityNotFound(_0x319fc5,null))[_0xb949('0x1c')](function(_0x3772d6){if(_0x3772d6){_0x16e9b4=_0x3772d6;_0x32eeff[_0xb949('0x25')]=_[_0xb949('0x27')](db[_0xb949('0x42')][_0xb949('0x22')]);_0x32eeff[_0xb949('0x26')]=_[_0xb949('0x27')](_0x2e29e1[_0xb949('0x26')]);_0x32eeff[_0xb949('0x28')]=_[_0xb949('0x29')](_0x32eeff['model'],_0x32eeff[_0xb949('0x26')]);_0x51702d['attributes']=_['intersection'](_0x32eeff[_0xb949('0x25')],qs[_0xb949('0x2b')](_0x2e29e1['query']['fields']));_0x51702d['attributes']=_0x51702d['attributes']['length']?_0x51702d[_0xb949('0x2a')]:_0x32eeff[_0xb949('0x25')];_0x51702d[_0xb949('0x2f')]=qs[_0xb949('0x30')](_0x2e29e1[_0xb949('0x26')][_0xb949('0x30')]);_0x51702d[_0xb949('0x31')]=qs[_0xb949('0x28')](_[_0xb949('0x43')](_0x2e29e1[_0xb949('0x26')],_0x32eeff['filters']));if(_0x2e29e1[_0xb949('0x26')][_0xb949('0x44')]){_0x51702d[_0xb949('0x31')]=_[_0xb949('0x32')](_0x51702d[_0xb949('0x31')],{'$or':_[_0xb949('0x21')](_0x51702d[_0xb949('0x2a')],function(_0x23d7f5){var _0x1eee2a={};_0x1eee2a[_0x23d7f5]={'$like':'%'+_0x2e29e1[_0xb949('0x26')][_0xb949('0x44')]+'%'};return _0x1eee2a;})});}_0x51702d=_[_0xb949('0x32')]({},_0x51702d,_0x2e29e1['options']);return _0x16e9b4[_0xb949('0x40')](_0x51702d);}})[_0xb949('0x1c')](function(_0x53d3e6){if(_0x53d3e6){_0x4e3b0c=_0x53d3e6[_0xb949('0x2c')];if(!_0x2e29e1[_0xb949('0x26')][_0xb949('0x2d')]('nolimit')){_0x51702d['limit']=qs[_0xb949('0x18')](_0x2e29e1[_0xb949('0x26')][_0xb949('0x18')]);_0x51702d['offset']=qs['offset'](_0x2e29e1[_0xb949('0x26')][_0xb949('0x17')]);}return _0x16e9b4[_0xb949('0x40')](_0x51702d);}})['then'](function(_0x5d47fa){if(_0x5d47fa){return _0x5d47fa?{'count':_0x4e3b0c,'rows':_0x5d47fa}:null;}})[_0xb949('0x1c')](respondWithResult(_0x319fc5,null))['catch'](handleError(_0x319fc5,null));};exports[_0xb949('0x45')]=function(_0x3d7d2c,_0x1b3f8e,_0x5c01a2){var _0x11355d={};var _0x1637d2={};var _0x188cf1;var _0xc5b29d;return db[_0xb949('0x35')]['findOne']({'where':{'id':_0x3d7d2c[_0xb949('0x3a')]['id']}})[_0xb949('0x1c')](handleEntityNotFound(_0x1b3f8e,null))[_0xb949('0x1c')](function(_0x1ebee2){if(_0x1ebee2){_0x188cf1=_0x1ebee2;_0x1637d2[_0xb949('0x25')]=_['keys'](db[_0xb949('0x42')][_0xb949('0x22')]);_0x1637d2[_0xb949('0x26')]=_[_0xb949('0x27')](_0x3d7d2c['query']);_0x1637d2[_0xb949('0x28')]=_[_0xb949('0x29')](_0x1637d2[_0xb949('0x25')],_0x1637d2[_0xb949('0x26')]);_0x11355d['attributes']=_[_0xb949('0x29')](_0x1637d2[_0xb949('0x25')],qs[_0xb949('0x2b')](_0x3d7d2c['query'][_0xb949('0x2b')]));_0x11355d[_0xb949('0x2a')]=_0x11355d[_0xb949('0x2a')][_0xb949('0x2c')]?_0x11355d[_0xb949('0x2a')]:_0x1637d2[_0xb949('0x25')];_0x11355d[_0xb949('0x2f')]=qs[_0xb949('0x30')](_0x3d7d2c['query'][_0xb949('0x30')]);_0x11355d['where']=qs['filters'](_[_0xb949('0x43')](_0x3d7d2c[_0xb949('0x26')],_0x1637d2[_0xb949('0x28')]));if(_0x3d7d2c[_0xb949('0x26')][_0xb949('0x44')]){_0x11355d[_0xb949('0x31')]=_['merge'](_0x11355d[_0xb949('0x31')],{'$or':_['map'](_0x11355d[_0xb949('0x2a')],function(_0x3facec){var _0x5bad6b={};_0x5bad6b[_0x3facec]={'$like':'%'+_0x3d7d2c['query'][_0xb949('0x44')]+'%'};return _0x5bad6b;})});}_0x11355d=_[_0xb949('0x32')]({},_0x11355d,_0x3d7d2c[_0xb949('0x34')]);return _0x188cf1[_0xb949('0x45')](_0x11355d);}})[_0xb949('0x1c')](function(_0x11b76b){if(_0x11b76b){_0xc5b29d=_0x11b76b[_0xb949('0x2c')];if(!_0x3d7d2c[_0xb949('0x26')]['hasOwnProperty'](_0xb949('0x2e'))){_0x11355d[_0xb949('0x18')]=qs[_0xb949('0x18')](_0x3d7d2c[_0xb949('0x26')][_0xb949('0x18')]);_0x11355d[_0xb949('0x17')]=qs['offset'](_0x3d7d2c[_0xb949('0x26')][_0xb949('0x17')]);}return _0x188cf1[_0xb949('0x45')](_0x11355d);}})[_0xb949('0x1c')](function(_0x191c7f){if(_0x191c7f){return _0x191c7f?{'count':_0xc5b29d,'rows':_0x191c7f}:null;}})[_0xb949('0x1c')](respondWithResult(_0x1b3f8e,null))[_0xb949('0x3f')](handleError(_0x1b3f8e,null));};exports[_0xb949('0x46')]=function(_0x231725,_0x2e5b32,_0x1c9008){var _0x142d62={};var _0x39a970={};var _0x491ea1;var _0x10d470;return db['ServicenowConfiguration'][_0xb949('0x41')]({'where':{'id':_0x231725[_0xb949('0x3a')]['id']}})[_0xb949('0x1c')](handleEntityNotFound(_0x2e5b32,null))['then'](function(_0x29d396){if(_0x29d396){_0x491ea1=_0x29d396;_0x39a970[_0xb949('0x25')]=_[_0xb949('0x27')](db[_0xb949('0x42')]['rawAttributes']);_0x39a970[_0xb949('0x26')]=_[_0xb949('0x27')](_0x231725['query']);_0x39a970[_0xb949('0x28')]=_['intersection'](_0x39a970[_0xb949('0x25')],_0x39a970[_0xb949('0x26')]);_0x142d62[_0xb949('0x2a')]=_[_0xb949('0x29')](_0x39a970[_0xb949('0x25')],qs[_0xb949('0x2b')](_0x231725[_0xb949('0x26')]['fields']));_0x142d62[_0xb949('0x2a')]=_0x142d62[_0xb949('0x2a')][_0xb949('0x2c')]?_0x142d62[_0xb949('0x2a')]:_0x39a970[_0xb949('0x25')];_0x142d62[_0xb949('0x2f')]=qs[_0xb949('0x30')](_0x231725[_0xb949('0x26')][_0xb949('0x30')]);_0x142d62[_0xb949('0x31')]=qs['filters'](_['pick'](_0x231725[_0xb949('0x26')],_0x39a970['filters']));if(_0x231725['query']['filter']){_0x142d62[_0xb949('0x31')]=_[_0xb949('0x32')](_0x142d62[_0xb949('0x31')],{'$or':_[_0xb949('0x21')](_0x142d62['attributes'],function(_0x157d77){var _0x55b69c={};_0x55b69c[_0x157d77]={'$like':'%'+_0x231725[_0xb949('0x26')][_0xb949('0x44')]+'%'};return _0x55b69c;})});}_0x142d62=_[_0xb949('0x32')]({},_0x142d62,_0x231725[_0xb949('0x34')]);return _0x491ea1[_0xb949('0x46')](_0x142d62);}})[_0xb949('0x1c')](function(_0x21180f){if(_0x21180f){_0x10d470=_0x21180f[_0xb949('0x2c')];if(!_0x231725[_0xb949('0x26')]['hasOwnProperty'](_0xb949('0x2e'))){_0x142d62[_0xb949('0x18')]=qs[_0xb949('0x18')](_0x231725[_0xb949('0x26')]['limit']);_0x142d62[_0xb949('0x17')]=qs[_0xb949('0x17')](_0x231725[_0xb949('0x26')]['offset']);}return _0x491ea1[_0xb949('0x46')](_0x142d62);}})[_0xb949('0x1c')](function(_0x41c906){if(_0x41c906){return _0x41c906?{'count':_0x10d470,'rows':_0x41c906}:null;}})[_0xb949('0x1c')](respondWithResult(_0x2e5b32,null))[_0xb949('0x3f')](handleError(_0x2e5b32,null));}; \ No newline at end of file +var _0xdbdf=['ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ServicenowConfiguration','includeAll','include','findAll','rows','catch','show','params','options','find','body','getFields','findOne'];(function(_0x29abe1,_0x1660e9){var _0x3d614c=function(_0x3d8359){while(--_0x3d8359){_0x29abe1['push'](_0x29abe1['shift']());}};_0x3d614c(++_0x1660e9);}(_0xdbdf,0xf6));var _0xfdbd=function(_0x58ef64,_0x47c44e){_0x58ef64=_0x58ef64-0x0;var _0x51584b=_0xdbdf[_0x58ef64];return _0x51584b;};'use strict';var emlformat=require(_0xfdbd('0x0'));var rimraf=require(_0xfdbd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfdbd('0x2'));var rp=require('request-promise');var moment=require(_0xfdbd('0x3'));var BPromise=require(_0xfdbd('0x4'));var Mustache=require(_0xfdbd('0x5'));var util=require('util');var path=require(_0xfdbd('0x6'));var sox=require(_0xfdbd('0x7'));var csv=require(_0xfdbd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfdbd('0x9'));var squel=require(_0xfdbd('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdbd('0xb'));var deskjs=require(_0xfdbd('0xc'));var toCsv=require(_0xfdbd('0x8'));var querystring=require(_0xfdbd('0xd'));var Papa=require(_0xfdbd('0xe'));var Redis=require(_0xfdbd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfdbd('0x10'));var as=require(_0xfdbd('0x11'));var hardwareService=require(_0xfdbd('0x12'));var logger=require(_0xfdbd('0x13'))(_0xfdbd('0x14'));var utils=require(_0xfdbd('0x15'));var config=require(_0xfdbd('0x16'));var licenseUtil=require(_0xfdbd('0x17'));var db=require(_0xfdbd('0x18'))['db'];function respondWithStatusCode(_0x2717e1,_0x44f931){_0x44f931=_0x44f931||0xcc;return function(_0x1bf8f5){if(_0x1bf8f5){return _0x2717e1[_0xfdbd('0x19')](_0x44f931);}return _0x2717e1['status'](_0x44f931)[_0xfdbd('0x1a')]();};}function respondWithResult(_0x303896,_0x217cc3){_0x217cc3=_0x217cc3||0xc8;return function(_0x320725){if(_0x320725){return _0x303896[_0xfdbd('0x1b')](_0x217cc3)[_0xfdbd('0x1c')](_0x320725);}};}function respondWithFilteredResult(_0xc91d55,_0x462ce2){return function(_0x2a3052){if(_0x2a3052){var _0x43495b=typeof _0x462ce2[_0xfdbd('0x1d')]===_0xfdbd('0x1e')&&typeof _0x462ce2[_0xfdbd('0x1f')]===_0xfdbd('0x1e');var _0x8d2c6a=_0x2a3052[_0xfdbd('0x20')];var _0x3bd54b=_0x43495b?0x0:_0x462ce2['offset'];var _0x5e9659=_0x43495b?_0x2a3052['count']:_0x462ce2[_0xfdbd('0x1d')]+_0x462ce2[_0xfdbd('0x1f')];var _0xd51b29;if(_0x5e9659>=_0x8d2c6a){_0x5e9659=_0x8d2c6a;_0xd51b29=0xc8;}else{_0xd51b29=0xce;}_0xc91d55[_0xfdbd('0x1b')](_0xd51b29);return _0xc91d55[_0xfdbd('0x21')](_0xfdbd('0x22'),_0x3bd54b+'-'+_0x5e9659+'/'+_0x8d2c6a)[_0xfdbd('0x1c')](_0x2a3052);}return null;};}function patchUpdates(_0x5943a3){return function(_0x3efe3c){try{jsonpatch[_0xfdbd('0x23')](_0x3efe3c,_0x5943a3,!![]);}catch(_0x32c793){return BPromise['reject'](_0x32c793);}return _0x3efe3c['save']();};}function saveUpdates(_0xb9a53b,_0x1dc1ce){return function(_0x15d00f){if(_0x15d00f){return _0x15d00f[_0xfdbd('0x24')](_0xb9a53b)['then'](function(_0x160d7e){return _0x160d7e;});}return null;};}function removeEntity(_0x44b132,_0x2c651d){return function(_0x89612d){if(_0x89612d){return _0x89612d[_0xfdbd('0x25')]()[_0xfdbd('0x26')](function(){_0x44b132[_0xfdbd('0x1b')](0xcc)[_0xfdbd('0x1a')]();});}};}function handleEntityNotFound(_0x472ec2,_0x2116cc){return function(_0x1dba73){if(!_0x1dba73){_0x472ec2[_0xfdbd('0x19')](0x194);}return _0x1dba73;};}function handleError(_0x32f35c,_0x1a0b9f){_0x1a0b9f=_0x1a0b9f||0x1f4;return function(_0x4708e8){logger[_0xfdbd('0x27')](_0x4708e8[_0xfdbd('0x28')]);if(_0x4708e8[_0xfdbd('0x29')]){delete _0x4708e8[_0xfdbd('0x29')];}_0x32f35c[_0xfdbd('0x1b')](_0x1a0b9f)[_0xfdbd('0x2a')](_0x4708e8);};}exports[_0xfdbd('0x2b')]=function(_0x4a3fb2,_0x2bcd94){var _0x23925b={},_0x2e01af={},_0x275b31={'count':0x0,'rows':[]};var _0xfcf12d=_[_0xfdbd('0x2c')](db['ServicenowConfiguration'][_0xfdbd('0x2d')],function(_0x293fa0){return{'name':_0x293fa0['fieldName'],'type':_0x293fa0[_0xfdbd('0x2e')][_0xfdbd('0x2f')]};});_0x2e01af[_0xfdbd('0x30')]=_[_0xfdbd('0x2c')](_0xfcf12d,_0xfdbd('0x29'));_0x2e01af[_0xfdbd('0x31')]=_[_0xfdbd('0x32')](_0x4a3fb2['query']);_0x2e01af[_0xfdbd('0x33')]=_[_0xfdbd('0x34')](_0x2e01af[_0xfdbd('0x30')],_0x2e01af[_0xfdbd('0x31')]);_0x23925b[_0xfdbd('0x35')]=_[_0xfdbd('0x34')](_0x2e01af[_0xfdbd('0x30')],qs[_0xfdbd('0x36')](_0x4a3fb2[_0xfdbd('0x31')][_0xfdbd('0x36')]));_0x23925b[_0xfdbd('0x35')]=_0x23925b['attributes'][_0xfdbd('0x37')]?_0x23925b[_0xfdbd('0x35')]:_0x2e01af[_0xfdbd('0x30')];if(!_0x4a3fb2[_0xfdbd('0x31')][_0xfdbd('0x38')](_0xfdbd('0x39'))){_0x23925b[_0xfdbd('0x1f')]=qs['limit'](_0x4a3fb2[_0xfdbd('0x31')][_0xfdbd('0x1f')]);_0x23925b[_0xfdbd('0x1d')]=qs[_0xfdbd('0x1d')](_0x4a3fb2[_0xfdbd('0x31')]['offset']);}_0x23925b[_0xfdbd('0x3a')]=qs[_0xfdbd('0x3b')](_0x4a3fb2[_0xfdbd('0x31')][_0xfdbd('0x3b')]);_0x23925b[_0xfdbd('0x3c')]=qs[_0xfdbd('0x33')](_[_0xfdbd('0x3d')](_0x4a3fb2[_0xfdbd('0x31')],_0x2e01af['filters']),_0xfcf12d);if(_0x4a3fb2[_0xfdbd('0x31')]['filter']){_0x23925b[_0xfdbd('0x3c')]=_[_0xfdbd('0x3e')](_0x23925b['where'],{'$or':_[_0xfdbd('0x2c')](_0xfcf12d,function(_0x30a407){if(_0x30a407[_0xfdbd('0x2e')]!==_0xfdbd('0x3f')){var _0x2e1958={};_0x2e1958[_0x30a407['name']]={'$like':'%'+_0x4a3fb2[_0xfdbd('0x31')][_0xfdbd('0x40')]+'%'};return _0x2e1958;}})});}_0x23925b=_[_0xfdbd('0x3e')]({},_0x23925b,_0x4a3fb2['options']);var _0x29296e={'where':_0x23925b[_0xfdbd('0x3c')]};return db[_0xfdbd('0x41')][_0xfdbd('0x20')](_0x29296e)[_0xfdbd('0x26')](function(_0xb307eb){_0x275b31[_0xfdbd('0x20')]=_0xb307eb;if(_0x4a3fb2['query'][_0xfdbd('0x42')]){_0x23925b[_0xfdbd('0x43')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xfdbd('0x44')](_0x23925b);})[_0xfdbd('0x26')](function(_0x41d4f4){_0x275b31[_0xfdbd('0x45')]=_0x41d4f4;return _0x275b31;})['then'](respondWithFilteredResult(_0x2bcd94,_0x23925b))[_0xfdbd('0x46')](handleError(_0x2bcd94,null));};exports[_0xfdbd('0x47')]=function(_0x465f25,_0x40ceaf){var _0x5f133f={'raw':![],'where':{'id':_0x465f25[_0xfdbd('0x48')]['id']}},_0x344e0e={};_0x344e0e[_0xfdbd('0x30')]=_[_0xfdbd('0x32')](db[_0xfdbd('0x41')]['rawAttributes']);_0x344e0e[_0xfdbd('0x31')]=_[_0xfdbd('0x32')](_0x465f25['query']);_0x344e0e['filters']=_[_0xfdbd('0x34')](_0x344e0e['model'],_0x344e0e[_0xfdbd('0x31')]);_0x5f133f[_0xfdbd('0x35')]=_[_0xfdbd('0x34')](_0x344e0e[_0xfdbd('0x30')],qs[_0xfdbd('0x36')](_0x465f25[_0xfdbd('0x31')][_0xfdbd('0x36')]));_0x5f133f[_0xfdbd('0x35')]=_0x5f133f[_0xfdbd('0x35')][_0xfdbd('0x37')]?_0x5f133f[_0xfdbd('0x35')]:_0x344e0e[_0xfdbd('0x30')];if(_0x465f25[_0xfdbd('0x31')][_0xfdbd('0x42')]){_0x5f133f['include']=[{'all':!![]}];}_0x5f133f=_[_0xfdbd('0x3e')]({},_0x5f133f,_0x465f25[_0xfdbd('0x49')]);return db['ServicenowConfiguration'][_0xfdbd('0x4a')](_0x5f133f)[_0xfdbd('0x26')](handleEntityNotFound(_0x40ceaf,null))[_0xfdbd('0x26')](respondWithResult(_0x40ceaf,null))[_0xfdbd('0x46')](handleError(_0x40ceaf,null));};exports['create']=function(_0xbb9853,_0x3aa05c){return db[_0xfdbd('0x41')]['create'](_0xbb9853['body'],{})[_0xfdbd('0x26')](respondWithResult(_0x3aa05c,0xc9))['catch'](handleError(_0x3aa05c,null));};exports[_0xfdbd('0x24')]=function(_0x2ac6fc,_0x508ae0){if(_0x2ac6fc['body']['id']){delete _0x2ac6fc['body']['id'];}return db[_0xfdbd('0x41')]['find']({'where':{'id':_0x2ac6fc[_0xfdbd('0x48')]['id']}})[_0xfdbd('0x26')](handleEntityNotFound(_0x508ae0,null))[_0xfdbd('0x26')](saveUpdates(_0x2ac6fc[_0xfdbd('0x4b')],null))[_0xfdbd('0x26')](respondWithResult(_0x508ae0,null))[_0xfdbd('0x46')](handleError(_0x508ae0,null));};exports[_0xfdbd('0x25')]=function(_0x3b3453,_0x14bcfd){return db[_0xfdbd('0x41')]['find']({'where':{'id':_0x3b3453['params']['id']}})[_0xfdbd('0x26')](handleEntityNotFound(_0x14bcfd,null))[_0xfdbd('0x26')](removeEntity(_0x14bcfd,null))[_0xfdbd('0x46')](handleError(_0x14bcfd,null));};exports[_0xfdbd('0x4c')]=function(_0x4a52c1,_0x58f855,_0x13aab6){var _0x465458={};var _0x4a0073={};var _0x10e008;var _0xdffc05;return db[_0xfdbd('0x41')][_0xfdbd('0x4d')]({'where':{'id':_0x4a52c1[_0xfdbd('0x48')]['id']}})[_0xfdbd('0x26')](handleEntityNotFound(_0x58f855,null))['then'](function(_0x3ef2ff){if(_0x3ef2ff){_0x10e008=_0x3ef2ff;_0x4a0073['model']=_['keys'](db[_0xfdbd('0x4e')][_0xfdbd('0x2d')]);_0x4a0073[_0xfdbd('0x31')]=_[_0xfdbd('0x32')](_0x4a52c1[_0xfdbd('0x31')]);_0x4a0073[_0xfdbd('0x33')]=_[_0xfdbd('0x34')](_0x4a0073[_0xfdbd('0x30')],_0x4a0073[_0xfdbd('0x31')]);_0x465458[_0xfdbd('0x35')]=_[_0xfdbd('0x34')](_0x4a0073[_0xfdbd('0x30')],qs['fields'](_0x4a52c1[_0xfdbd('0x31')][_0xfdbd('0x36')]));_0x465458[_0xfdbd('0x35')]=_0x465458[_0xfdbd('0x35')][_0xfdbd('0x37')]?_0x465458[_0xfdbd('0x35')]:_0x4a0073[_0xfdbd('0x30')];_0x465458[_0xfdbd('0x3a')]=qs[_0xfdbd('0x3b')](_0x4a52c1[_0xfdbd('0x31')]['sort']);_0x465458[_0xfdbd('0x3c')]=qs[_0xfdbd('0x33')](_[_0xfdbd('0x3d')](_0x4a52c1[_0xfdbd('0x31')],_0x4a0073[_0xfdbd('0x33')]));if(_0x4a52c1['query'][_0xfdbd('0x40')]){_0x465458['where']=_[_0xfdbd('0x3e')](_0x465458[_0xfdbd('0x3c')],{'$or':_[_0xfdbd('0x2c')](_0x465458['attributes'],function(_0x582fcb){var _0x2d574a={};_0x2d574a[_0x582fcb]={'$like':'%'+_0x4a52c1['query'][_0xfdbd('0x40')]+'%'};return _0x2d574a;})});}_0x465458=_[_0xfdbd('0x3e')]({},_0x465458,_0x4a52c1[_0xfdbd('0x49')]);return _0x10e008[_0xfdbd('0x4c')](_0x465458);}})[_0xfdbd('0x26')](function(_0x142df2){if(_0x142df2){_0xdffc05=_0x142df2[_0xfdbd('0x37')];if(!_0x4a52c1[_0xfdbd('0x31')][_0xfdbd('0x38')](_0xfdbd('0x39'))){_0x465458[_0xfdbd('0x1f')]=qs[_0xfdbd('0x1f')](_0x4a52c1['query'][_0xfdbd('0x1f')]);_0x465458[_0xfdbd('0x1d')]=qs[_0xfdbd('0x1d')](_0x4a52c1['query'][_0xfdbd('0x1d')]);}return _0x10e008[_0xfdbd('0x4c')](_0x465458);}})['then'](function(_0x1ba057){if(_0x1ba057){return _0x1ba057?{'count':_0xdffc05,'rows':_0x1ba057}:null;}})[_0xfdbd('0x26')](respondWithResult(_0x58f855,null))[_0xfdbd('0x46')](handleError(_0x58f855,null));};exports['getSubjects']=function(_0x4091f2,_0x3c626c,_0x3b99e7){var _0x503fa1={};var _0x3dc558={};var _0x3c3209;var _0xdaccc8;return db[_0xfdbd('0x41')][_0xfdbd('0x4d')]({'where':{'id':_0x4091f2['params']['id']}})['then'](handleEntityNotFound(_0x3c626c,null))['then'](function(_0x332ca6){if(_0x332ca6){_0x3c3209=_0x332ca6;_0x3dc558[_0xfdbd('0x30')]=_['keys'](db['ServicenowField'][_0xfdbd('0x2d')]);_0x3dc558['query']=_['keys'](_0x4091f2['query']);_0x3dc558['filters']=_['intersection'](_0x3dc558[_0xfdbd('0x30')],_0x3dc558[_0xfdbd('0x31')]);_0x503fa1[_0xfdbd('0x35')]=_[_0xfdbd('0x34')](_0x3dc558[_0xfdbd('0x30')],qs[_0xfdbd('0x36')](_0x4091f2['query'][_0xfdbd('0x36')]));_0x503fa1['attributes']=_0x503fa1[_0xfdbd('0x35')]['length']?_0x503fa1['attributes']:_0x3dc558['model'];_0x503fa1[_0xfdbd('0x3a')]=qs[_0xfdbd('0x3b')](_0x4091f2[_0xfdbd('0x31')]['sort']);_0x503fa1['where']=qs[_0xfdbd('0x33')](_['pick'](_0x4091f2[_0xfdbd('0x31')],_0x3dc558[_0xfdbd('0x33')]));if(_0x4091f2[_0xfdbd('0x31')][_0xfdbd('0x40')]){_0x503fa1[_0xfdbd('0x3c')]=_['merge'](_0x503fa1[_0xfdbd('0x3c')],{'$or':_[_0xfdbd('0x2c')](_0x503fa1[_0xfdbd('0x35')],function(_0x5ad9f2){var _0x1bd23d={};_0x1bd23d[_0x5ad9f2]={'$like':'%'+_0x4091f2['query'][_0xfdbd('0x40')]+'%'};return _0x1bd23d;})});}_0x503fa1=_[_0xfdbd('0x3e')]({},_0x503fa1,_0x4091f2['options']);return _0x3c3209[_0xfdbd('0x4f')](_0x503fa1);}})['then'](function(_0x3e378a){if(_0x3e378a){_0xdaccc8=_0x3e378a[_0xfdbd('0x37')];if(!_0x4091f2[_0xfdbd('0x31')][_0xfdbd('0x38')]('nolimit')){_0x503fa1[_0xfdbd('0x1f')]=qs[_0xfdbd('0x1f')](_0x4091f2[_0xfdbd('0x31')][_0xfdbd('0x1f')]);_0x503fa1[_0xfdbd('0x1d')]=qs[_0xfdbd('0x1d')](_0x4091f2['query'][_0xfdbd('0x1d')]);}return _0x3c3209[_0xfdbd('0x4f')](_0x503fa1);}})[_0xfdbd('0x26')](function(_0x113255){if(_0x113255){return _0x113255?{'count':_0xdaccc8,'rows':_0x113255}:null;}})[_0xfdbd('0x26')](respondWithResult(_0x3c626c,null))[_0xfdbd('0x46')](handleError(_0x3c626c,null));};exports['getDescriptions']=function(_0x2c0040,_0x3b0dec,_0x4ba4f6){var _0x4e3b61={};var _0x395fd1={};var _0x62bc4d;var _0x4d4f17;return db[_0xfdbd('0x41')]['findOne']({'where':{'id':_0x2c0040['params']['id']}})[_0xfdbd('0x26')](handleEntityNotFound(_0x3b0dec,null))[_0xfdbd('0x26')](function(_0x3a5bea){if(_0x3a5bea){_0x62bc4d=_0x3a5bea;_0x395fd1[_0xfdbd('0x30')]=_[_0xfdbd('0x32')](db[_0xfdbd('0x4e')]['rawAttributes']);_0x395fd1[_0xfdbd('0x31')]=_[_0xfdbd('0x32')](_0x2c0040[_0xfdbd('0x31')]);_0x395fd1[_0xfdbd('0x33')]=_[_0xfdbd('0x34')](_0x395fd1['model'],_0x395fd1[_0xfdbd('0x31')]);_0x4e3b61['attributes']=_[_0xfdbd('0x34')](_0x395fd1[_0xfdbd('0x30')],qs[_0xfdbd('0x36')](_0x2c0040[_0xfdbd('0x31')][_0xfdbd('0x36')]));_0x4e3b61[_0xfdbd('0x35')]=_0x4e3b61[_0xfdbd('0x35')][_0xfdbd('0x37')]?_0x4e3b61['attributes']:_0x395fd1['model'];_0x4e3b61[_0xfdbd('0x3a')]=qs[_0xfdbd('0x3b')](_0x2c0040['query'][_0xfdbd('0x3b')]);_0x4e3b61[_0xfdbd('0x3c')]=qs[_0xfdbd('0x33')](_[_0xfdbd('0x3d')](_0x2c0040[_0xfdbd('0x31')],_0x395fd1[_0xfdbd('0x33')]));if(_0x2c0040[_0xfdbd('0x31')]['filter']){_0x4e3b61[_0xfdbd('0x3c')]=_[_0xfdbd('0x3e')](_0x4e3b61[_0xfdbd('0x3c')],{'$or':_[_0xfdbd('0x2c')](_0x4e3b61[_0xfdbd('0x35')],function(_0x45360c){var _0x3f48bb={};_0x3f48bb[_0x45360c]={'$like':'%'+_0x2c0040[_0xfdbd('0x31')][_0xfdbd('0x40')]+'%'};return _0x3f48bb;})});}_0x4e3b61=_[_0xfdbd('0x3e')]({},_0x4e3b61,_0x2c0040[_0xfdbd('0x49')]);return _0x62bc4d[_0xfdbd('0x50')](_0x4e3b61);}})[_0xfdbd('0x26')](function(_0x59ea66){if(_0x59ea66){_0x4d4f17=_0x59ea66[_0xfdbd('0x37')];if(!_0x2c0040[_0xfdbd('0x31')][_0xfdbd('0x38')]('nolimit')){_0x4e3b61['limit']=qs[_0xfdbd('0x1f')](_0x2c0040[_0xfdbd('0x31')][_0xfdbd('0x1f')]);_0x4e3b61[_0xfdbd('0x1d')]=qs[_0xfdbd('0x1d')](_0x2c0040[_0xfdbd('0x31')][_0xfdbd('0x1d')]);}return _0x62bc4d[_0xfdbd('0x50')](_0x4e3b61);}})[_0xfdbd('0x26')](function(_0x1384fa){if(_0x1384fa){return _0x1384fa?{'count':_0x4d4f17,'rows':_0x1384fa}:null;}})['then'](respondWithResult(_0x3b0dec,null))['catch'](handleError(_0x3b0dec,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 8bedec5..6dd2805 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 _0xd142=['request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api'];(function(_0x14fd5c,_0x383544){var _0x18c83f=function(_0xfc92d6){while(--_0xfc92d6){_0x14fd5c['push'](_0x14fd5c['shift']());}};_0x18c83f(++_0x383544);}(_0xd142,0x11a));var _0x2d14=function(_0x4e96a4,_0x207e09){_0x4e96a4=_0x4e96a4-0x0;var _0x1beafa=_0xd142[_0x4e96a4];return _0x1beafa;};'use strict';var _=require(_0x2d14('0x0'));var util=require(_0x2d14('0x1'));var logger=require(_0x2d14('0x2'))(_0x2d14('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d14('0x4'));var fs=require('fs');var path=require(_0x2d14('0x5'));var rimraf=require(_0x2d14('0x6'));var config=require(_0x2d14('0x7'));var attributes=require(_0x2d14('0x8'));module[_0x2d14('0x9')]=function(_0xb3acd1,_0x5dd0e5){return _0xb3acd1[_0x2d14('0xa')](_0x2d14('0xb'),attributes,{'tableName':_0x2d14('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e5e=['define','int_servicenow_configurations','lodash','util','api','moment','bluebird','path','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x40c62f,_0xbcb568){var _0xdb0971=function(_0x3c1895){while(--_0x3c1895){_0x40c62f['push'](_0x40c62f['shift']());}};_0xdb0971(++_0xbcb568);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x9e5e[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0xe9e5('0x0'));var util=require(_0xe9e5('0x1'));var logger=require('../../config/logger')(_0xe9e5('0x2'));var moment=require(_0xe9e5('0x3'));var BPromise=require(_0xe9e5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9e5('0x5'));var rimraf=require('rimraf');var config=require(_0xe9e5('0x6'));var attributes=require(_0xe9e5('0x7'));module['exports']=function(_0x5c09f0,_0xf4d974){return _0x5c09f0[_0xe9e5('0x8')]('ServicenowConfiguration',attributes,{'tableName':_0xe9e5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index addbc7d..ffe8279 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 _0x7370=['error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xc3e0f0,_0x2fb885){var _0xdb8147=function(_0x2f9dc6){while(--_0x2f9dc6){_0xc3e0f0['push'](_0xc3e0f0['shift']());}};_0xdb8147(++_0x2fb885);}(_0x7370,0x1e2));var _0x0737=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x7370[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0x0737('0x0'));var util=require(_0x0737('0x1'));var moment=require(_0x0737('0x2'));var BPromise=require(_0x0737('0x3'));var rs=require(_0x0737('0x4'));var fs=require('fs');var Redis=require(_0x0737('0x5'));var db=require(_0x0737('0x6'))['db'];var utils=require(_0x0737('0x7'));var logger=require(_0x0737('0x8'))(_0x0737('0x9'));var config=require(_0x0737('0xa'));var jayson=require(_0x0737('0xb'));var client=jayson['client'][_0x0737('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb44b81,_0x3e424a,_0x11f6c8){return new BPromise(function(_0x57909f,_0x61bc0e){return client[_0x0737('0xd')](_0xb44b81,_0x11f6c8)[_0x0737('0xe')](function(_0xd89bb2){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x3e424a,'request\x20sent');logger['debug'](_0x0737('0xf'),_0x3e424a,_0x0737('0x10'),JSON[_0x0737('0x11')](_0xd89bb2));if(_0xd89bb2[_0x0737('0x12')]){if(_0xd89bb2[_0x0737('0x12')][_0x0737('0x13')]===0x1f4){logger[_0x0737('0x12')](_0x0737('0x14'),_0x3e424a,_0xd89bb2['error']['message']);return _0x61bc0e(_0xd89bb2[_0x0737('0x12')][_0x0737('0x15')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x3e424a,_0xd89bb2[_0x0737('0x12')][_0x0737('0x15')]);return _0x57909f(_0xd89bb2[_0x0737('0x12')][_0x0737('0x15')]);}else{logger[_0x0737('0x16')](_0x0737('0x14'),_0x3e424a,_0x0737('0x10'));_0x57909f(_0xd89bb2[_0x0737('0x17')][_0x0737('0x15')]);}})[_0x0737('0x18')](function(_0x5c6f9f){logger[_0x0737('0x12')](_0x0737('0x14'),_0x3e424a,_0x5c6f9f);_0x61bc0e(_0x5c6f9f);});});} \ No newline at end of file +var _0x1561=['message','result','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x526cef,_0xca6945){var _0x2a3c2f=function(_0x471e52){while(--_0x471e52){_0x526cef['push'](_0x526cef['shift']());}};_0x2a3c2f(++_0xca6945);}(_0x1561,0x8e));var _0x1156=function(_0x3db936,_0x335cd0){_0x3db936=_0x3db936-0x0;var _0x4d21ca=_0x1561[_0x3db936];return _0x4d21ca;};'use strict';var _=require(_0x1156('0x0'));var util=require(_0x1156('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1156('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1156('0x3'))['db'];var utils=require(_0x1156('0x4'));var logger=require(_0x1156('0x5'))(_0x1156('0x6'));var config=require(_0x1156('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1156('0x8')][_0x1156('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf26c4a,_0xcb1701,_0x5d8ea8){return new BPromise(function(_0x317ebf,_0x5c6053){return client[_0x1156('0xa')](_0xf26c4a,_0x5d8ea8)['then'](function(_0x37c330){logger[_0x1156('0xb')](_0x1156('0xc'),_0xcb1701,_0x1156('0xd'));logger[_0x1156('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0xcb1701,_0x1156('0xd'),JSON[_0x1156('0xf')](_0x37c330));if(_0x37c330[_0x1156('0x10')]){if(_0x37c330[_0x1156('0x10')][_0x1156('0x11')]===0x1f4){logger[_0x1156('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0xcb1701,_0x37c330[_0x1156('0x10')]['message']);return _0x5c6053(_0x37c330[_0x1156('0x10')][_0x1156('0x12')]);}logger['error'](_0x1156('0xc'),_0xcb1701,_0x37c330[_0x1156('0x10')][_0x1156('0x12')]);return _0x317ebf(_0x37c330[_0x1156('0x10')][_0x1156('0x12')]);}else{logger[_0x1156('0xb')](_0x1156('0xc'),_0xcb1701,_0x1156('0xd'));_0x317ebf(_0x37c330[_0x1156('0x13')][_0x1156('0x12')]);}})['catch'](function(_0x22ec64){logger[_0x1156('0x10')](_0x1156('0xc'),_0xcb1701,_0x22ec64);_0x5c6053(_0x22ec64);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index ace4fb3..76ffa88 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 _0xa29e=['../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x224ded,_0x1b2757){var _0x3f2c61=function(_0xb06dea){while(--_0xb06dea){_0x224ded['push'](_0x224ded['shift']());}};_0x3f2c61(++_0x1b2757);}(_0xa29e,0xd4));var _0xea29=function(_0x5ecbbc,_0x2541f5){_0x5ecbbc=_0x5ecbbc-0x0;var _0x219a19=_0xa29e[_0x5ecbbc];return _0x219a19;};'use strict';var multer=require(_0xea29('0x0'));var util=require(_0xea29('0x1'));var path=require(_0xea29('0x2'));var timeout=require(_0xea29('0x3'));var express=require(_0xea29('0x4'));var router=express[_0xea29('0x5')]();var fs_extra=require(_0xea29('0x6'));var auth=require(_0xea29('0x7'));var interaction=require(_0xea29('0x8'));var config=require(_0xea29('0x9'));var controller=require(_0xea29('0xa'));router[_0xea29('0xb')]('/',auth[_0xea29('0xc')](),controller[_0xea29('0xd')]);router[_0xea29('0xb')](_0xea29('0xe'),auth[_0xea29('0xc')](),controller[_0xea29('0xf')]);router['post']('/',auth[_0xea29('0xc')](),controller[_0xea29('0x10')]);router[_0xea29('0x11')](_0xea29('0xe'),auth[_0xea29('0xc')](),controller['update']);router[_0xea29('0x12')](_0xea29('0xe'),auth[_0xea29('0xc')](),controller[_0xea29('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0b88=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','show','post','create','update','delete','/:id','destroy','exports'];(function(_0x52e3b8,_0x1242a0){var _0x584e1c=function(_0x31e5d9){while(--_0x31e5d9){_0x52e3b8['push'](_0x52e3b8['shift']());}};_0x584e1c(++_0x1242a0);}(_0x0b88,0xc8));var _0x80b8=function(_0x4c6141,_0x514dd8){_0x4c6141=_0x4c6141-0x0;var _0x25aa4d=_0x0b88[_0x4c6141];return _0x25aa4d;};'use strict';var multer=require(_0x80b8('0x0'));var util=require(_0x80b8('0x1'));var path=require(_0x80b8('0x2'));var timeout=require(_0x80b8('0x3'));var express=require(_0x80b8('0x4'));var router=express[_0x80b8('0x5')]();var fs_extra=require(_0x80b8('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x80b8('0x7'));var controller=require(_0x80b8('0x8'));router[_0x80b8('0x9')]('/',auth[_0x80b8('0xa')](),controller[_0x80b8('0xb')]);router[_0x80b8('0x9')]('/:id',auth[_0x80b8('0xa')](),controller[_0x80b8('0xc')]);router[_0x80b8('0xd')]('/',auth['isAuthenticated'](),controller[_0x80b8('0xe')]);router['put']('/:id',auth[_0x80b8('0xa')](),controller[_0x80b8('0xf')]);router[_0x80b8('0x10')](_0x80b8('0x11'),auth[_0x80b8('0xa')](),controller[_0x80b8('0x12')]);module[_0x80b8('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 1817c69..7ac1383 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 _0x08cb=['STRING','ENUM','customVariable','BOOLEAN','sequelize','string','variable','keyValue','picklist'];(function(_0x18aaaf,_0x385db6){var _0x52d892=function(_0x1ac6da){while(--_0x1ac6da){_0x18aaaf['push'](_0x18aaaf['shift']());}};_0x52d892(++_0x385db6);}(_0x08cb,0x187));var _0xb08c=function(_0xefe74c,_0x4b9540){_0xefe74c=_0xefe74c-0x0;var _0x29c1ee=_0x08cb[_0xefe74c];return _0x29c1ee;};'use strict';var Sequelize=require(_0xb08c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xb08c('0x1'),_0xb08c('0x2'),'customVariable',_0xb08c('0x3'),_0xb08c('0x4')),'defaultValue':_0xb08c('0x1')},'content':{'type':Sequelize[_0xb08c('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb08c('0x6')]('string','variable',_0xb08c('0x7'))},'keyContent':{'type':Sequelize[_0xb08c('0x5')]},'idField':{'type':Sequelize[_0xb08c('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb08c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8653=['STRING','BOOLEAN','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0xb833b1,_0x1c3d3f){var _0x1ab87a=function(_0x1c9f6c){while(--_0x1c9f6c){_0xb833b1['push'](_0xb833b1['shift']());}};_0x1ab87a(++_0x1c3d3f);}(_0x8653,0xaa));var _0x3865=function(_0x42ea05,_0x548d2d){_0x42ea05=_0x42ea05-0x0;var _0x582b39=_0x8653[_0x42ea05];return _0x582b39;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x3865('0x0')](_0x3865('0x1'),_0x3865('0x2'),_0x3865('0x3'),_0x3865('0x4'),_0x3865('0x5')),'defaultValue':_0x3865('0x1')},'content':{'type':Sequelize[_0x3865('0x6')]},'key':{'type':Sequelize[_0x3865('0x6')]},'keyType':{'type':Sequelize[_0x3865('0x0')](_0x3865('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x3865('0x6')]},'idField':{'type':Sequelize[_0x3865('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3865('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3865('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 97a23d6..96967ef 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 _0x3007=['stack','name','index','map','rawAttributes','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','ServicenowField','findAll','rows','catch','create','body','find','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','error'];(function(_0x3d2389,_0x123fd1){var _0x1673bc=function(_0x5a8fcf){while(--_0x5a8fcf){_0x3d2389['push'](_0x3d2389['shift']());}};_0x1673bc(++_0x123fd1);}(_0x3007,0xaf));var _0x7300=function(_0x23ca93,_0x2812f9){_0x23ca93=_0x23ca93-0x0;var _0x1c9d7c=_0x3007[_0x23ca93];return _0x1c9d7c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7300('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7300('0x1'));var rp=require('request-promise');var moment=require(_0x7300('0x2'));var BPromise=require(_0x7300('0x3'));var Mustache=require(_0x7300('0x4'));var util=require(_0x7300('0x5'));var path=require(_0x7300('0x6'));var sox=require('sox');var csv=require(_0x7300('0x7'));var ejs=require(_0x7300('0x8'));var fs=require('fs');var fs_extra=require(_0x7300('0x9'));var _=require(_0x7300('0xa'));var squel=require(_0x7300('0xb'));var crypto=require(_0x7300('0xc'));var jsforce=require(_0x7300('0xd'));var deskjs=require(_0x7300('0xe'));var toCsv=require(_0x7300('0x7'));var querystring=require(_0x7300('0xf'));var Papa=require(_0x7300('0x10'));var Redis=require('ioredis');var authService=require(_0x7300('0x11'));var qs=require(_0x7300('0x12'));var as=require(_0x7300('0x13'));var hardwareService=require(_0x7300('0x14'));var logger=require('../../config/logger')(_0x7300('0x15'));var utils=require('../../config/utils');var config=require(_0x7300('0x16'));var licenseUtil=require(_0x7300('0x17'));var db=require(_0x7300('0x18'))['db'];function respondWithStatusCode(_0xb9510,_0x1bd1e9){_0x1bd1e9=_0x1bd1e9||0xcc;return function(_0x3f9998){if(_0x3f9998){return _0xb9510[_0x7300('0x19')](_0x1bd1e9);}return _0xb9510[_0x7300('0x1a')](_0x1bd1e9)[_0x7300('0x1b')]();};}function respondWithResult(_0x4e170c,_0x38135c){_0x38135c=_0x38135c||0xc8;return function(_0x585237){if(_0x585237){return _0x4e170c[_0x7300('0x1a')](_0x38135c)['json'](_0x585237);}};}function respondWithFilteredResult(_0x512de4,_0x34657a){return function(_0x3bd864){if(_0x3bd864){var _0x11335b=typeof _0x34657a['offset']==='undefined'&&typeof _0x34657a[_0x7300('0x1c')]==='undefined';var _0xd775b3=_0x3bd864[_0x7300('0x1d')];var _0x4f3a62=_0x11335b?0x0:_0x34657a[_0x7300('0x1e')];var _0x53158b=_0x11335b?_0x3bd864[_0x7300('0x1d')]:_0x34657a[_0x7300('0x1e')]+_0x34657a[_0x7300('0x1c')];var _0x468938;if(_0x53158b>=_0xd775b3){_0x53158b=_0xd775b3;_0x468938=0xc8;}else{_0x468938=0xce;}_0x512de4[_0x7300('0x1a')](_0x468938);return _0x512de4[_0x7300('0x1f')](_0x7300('0x20'),_0x4f3a62+'-'+_0x53158b+'/'+_0xd775b3)[_0x7300('0x21')](_0x3bd864);}return null;};}function patchUpdates(_0x76f31d){return function(_0x4ee045){try{jsonpatch[_0x7300('0x22')](_0x4ee045,_0x76f31d,!![]);}catch(_0x2ab7a8){return BPromise[_0x7300('0x23')](_0x2ab7a8);}return _0x4ee045[_0x7300('0x24')]();};}function saveUpdates(_0x1a12ab,_0x2cf313){return function(_0x330a47){if(_0x330a47){return _0x330a47[_0x7300('0x25')](_0x1a12ab)['then'](function(_0x9fbe57){return _0x9fbe57;});}return null;};}function removeEntity(_0x365305,_0x432e5c){return function(_0x8c8ea6){if(_0x8c8ea6){return _0x8c8ea6[_0x7300('0x26')]()[_0x7300('0x27')](function(){_0x365305[_0x7300('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4753b1,_0x5c04b4){return function(_0x55b8f5){if(!_0x55b8f5){_0x4753b1[_0x7300('0x19')](0x194);}return _0x55b8f5;};}function handleError(_0x1b0ebd,_0x86c6d){_0x86c6d=_0x86c6d||0x1f4;return function(_0x4c0a4a){logger[_0x7300('0x28')](_0x4c0a4a[_0x7300('0x29')]);if(_0x4c0a4a[_0x7300('0x2a')]){delete _0x4c0a4a[_0x7300('0x2a')];}_0x1b0ebd[_0x7300('0x1a')](_0x86c6d)['send'](_0x4c0a4a);};}exports[_0x7300('0x2b')]=function(_0x30f47e,_0x573410){var _0xc5cd02={},_0x3c936b={},_0x5614c3={'count':0x0,'rows':[]};var _0x4ccd61=_[_0x7300('0x2c')](db['ServicenowField'][_0x7300('0x2d')],function(_0x170c01){return{'name':_0x170c01['fieldName'],'type':_0x170c01['type']['key']};});_0x3c936b['model']=_['map'](_0x4ccd61,_0x7300('0x2a'));_0x3c936b[_0x7300('0x2e')]=_[_0x7300('0x2f')](_0x30f47e[_0x7300('0x2e')]);_0x3c936b[_0x7300('0x30')]=_[_0x7300('0x31')](_0x3c936b[_0x7300('0x32')],_0x3c936b[_0x7300('0x2e')]);_0xc5cd02[_0x7300('0x33')]=_[_0x7300('0x31')](_0x3c936b['model'],qs[_0x7300('0x34')](_0x30f47e[_0x7300('0x2e')][_0x7300('0x34')]));_0xc5cd02['attributes']=_0xc5cd02[_0x7300('0x33')]['length']?_0xc5cd02[_0x7300('0x33')]:_0x3c936b[_0x7300('0x32')];if(!_0x30f47e[_0x7300('0x2e')][_0x7300('0x35')]('nolimit')){_0xc5cd02[_0x7300('0x1c')]=qs['limit'](_0x30f47e['query'][_0x7300('0x1c')]);_0xc5cd02[_0x7300('0x1e')]=qs['offset'](_0x30f47e[_0x7300('0x2e')]['offset']);}_0xc5cd02[_0x7300('0x36')]=qs[_0x7300('0x37')](_0x30f47e[_0x7300('0x2e')][_0x7300('0x37')]);_0xc5cd02[_0x7300('0x38')]=qs[_0x7300('0x30')](_['pick'](_0x30f47e[_0x7300('0x2e')],_0x3c936b['filters']),_0x4ccd61);if(_0x30f47e[_0x7300('0x2e')][_0x7300('0x39')]){_0xc5cd02[_0x7300('0x38')]=_['merge'](_0xc5cd02['where'],{'$or':_[_0x7300('0x2c')](_0x4ccd61,function(_0xdda5de){if(_0xdda5de[_0x7300('0x3a')]!==_0x7300('0x3b')){var _0x2e9c92={};_0x2e9c92[_0xdda5de[_0x7300('0x2a')]]={'$like':'%'+_0x30f47e[_0x7300('0x2e')][_0x7300('0x39')]+'%'};return _0x2e9c92;}})});}_0xc5cd02=_[_0x7300('0x3c')]({},_0xc5cd02,_0x30f47e[_0x7300('0x3d')]);var _0x1fd6e3={'where':_0xc5cd02[_0x7300('0x38')]};return db['ServicenowField'][_0x7300('0x1d')](_0x1fd6e3)['then'](function(_0x525fb9){_0x5614c3[_0x7300('0x1d')]=_0x525fb9;if(_0x30f47e[_0x7300('0x2e')][_0x7300('0x3e')]){_0xc5cd02[_0x7300('0x3f')]=[{'all':!![]}];}return db[_0x7300('0x40')][_0x7300('0x41')](_0xc5cd02);})['then'](function(_0x44bb48){_0x5614c3[_0x7300('0x42')]=_0x44bb48;return _0x5614c3;})['then'](respondWithFilteredResult(_0x573410,_0xc5cd02))['catch'](handleError(_0x573410,null));};exports['show']=function(_0x31b7e7,_0x673c79){var _0x3611df={'raw':!![],'where':{'id':_0x31b7e7['params']['id']}},_0x330ba9={};_0x330ba9[_0x7300('0x32')]=_[_0x7300('0x2f')](db[_0x7300('0x40')]['rawAttributes']);_0x330ba9[_0x7300('0x2e')]=_[_0x7300('0x2f')](_0x31b7e7[_0x7300('0x2e')]);_0x330ba9[_0x7300('0x30')]=_['intersection'](_0x330ba9[_0x7300('0x32')],_0x330ba9[_0x7300('0x2e')]);_0x3611df[_0x7300('0x33')]=_[_0x7300('0x31')](_0x330ba9[_0x7300('0x32')],qs[_0x7300('0x34')](_0x31b7e7[_0x7300('0x2e')][_0x7300('0x34')]));_0x3611df[_0x7300('0x33')]=_0x3611df[_0x7300('0x33')]['length']?_0x3611df[_0x7300('0x33')]:_0x330ba9[_0x7300('0x32')];if(_0x31b7e7[_0x7300('0x2e')][_0x7300('0x3e')]){_0x3611df[_0x7300('0x3f')]=[{'all':!![]}];}_0x3611df=_[_0x7300('0x3c')]({},_0x3611df,_0x31b7e7[_0x7300('0x3d')]);return db[_0x7300('0x40')]['find'](_0x3611df)['then'](handleEntityNotFound(_0x673c79,null))['then'](respondWithResult(_0x673c79,null))[_0x7300('0x43')](handleError(_0x673c79,null));};exports[_0x7300('0x44')]=function(_0x5e981c,_0x3381ce){return db[_0x7300('0x40')][_0x7300('0x44')](_0x5e981c['body'],{})[_0x7300('0x27')](respondWithResult(_0x3381ce,0xc9))[_0x7300('0x43')](handleError(_0x3381ce,null));};exports['update']=function(_0x173327,_0x1aad40){if(_0x173327[_0x7300('0x45')]['id']){delete _0x173327[_0x7300('0x45')]['id'];}return db[_0x7300('0x40')][_0x7300('0x46')]({'where':{'id':_0x173327[_0x7300('0x47')]['id']}})[_0x7300('0x27')](handleEntityNotFound(_0x1aad40,null))[_0x7300('0x27')](saveUpdates(_0x173327[_0x7300('0x45')],null))['then'](respondWithResult(_0x1aad40,null))[_0x7300('0x43')](handleError(_0x1aad40,null));};exports[_0x7300('0x26')]=function(_0x3edb4e,_0x18c831){return db[_0x7300('0x40')][_0x7300('0x46')]({'where':{'id':_0x3edb4e[_0x7300('0x47')]['id']}})['then'](handleEntityNotFound(_0x18c831,null))['then'](removeEntity(_0x18c831,null))[_0x7300('0x43')](handleError(_0x18c831,null));}; \ No newline at end of file +var _0x901e=['lodash','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','name','send','index','map','ServicenowField','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','show','params','fields','includeAll','find','catch','update','body','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra'];(function(_0x47408e,_0x481428){var _0x1636bc=function(_0x2fe7a6){while(--_0x2fe7a6){_0x47408e['push'](_0x47408e['shift']());}};_0x1636bc(++_0x481428);}(_0x901e,0x100));var _0xe901=function(_0x110c54,_0xa3cfcb){_0x110c54=_0x110c54-0x0;var _0x58a348=_0x901e[_0x110c54];return _0x58a348;};'use strict';var emlformat=require(_0xe901('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe901('0x1'));var rp=require(_0xe901('0x2'));var moment=require('moment');var BPromise=require(_0xe901('0x3'));var Mustache=require(_0xe901('0x4'));var util=require(_0xe901('0x5'));var path=require('path');var sox=require(_0xe901('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe901('0x7'));var _=require(_0xe901('0x8'));var squel=require('squel');var crypto=require(_0xe901('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe901('0xa'));var querystring=require(_0xe901('0xb'));var Papa=require(_0xe901('0xc'));var Redis=require('ioredis');var authService=require(_0xe901('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe901('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe901('0xf'));var utils=require(_0xe901('0x10'));var config=require(_0xe901('0x11'));var licenseUtil=require(_0xe901('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33b0c7,_0x198b0c){_0x198b0c=_0x198b0c||0xcc;return function(_0x4166b1){if(_0x4166b1){return _0x33b0c7['sendStatus'](_0x198b0c);}return _0x33b0c7[_0xe901('0x13')](_0x198b0c)[_0xe901('0x14')]();};}function respondWithResult(_0x23056c,_0x38503d){_0x38503d=_0x38503d||0xc8;return function(_0x4a06cd){if(_0x4a06cd){return _0x23056c[_0xe901('0x13')](_0x38503d)[_0xe901('0x15')](_0x4a06cd);}};}function respondWithFilteredResult(_0xd98ba8,_0x51a89f){return function(_0x8d4a6){if(_0x8d4a6){var _0x27e294=typeof _0x51a89f[_0xe901('0x16')]==='undefined'&&typeof _0x51a89f[_0xe901('0x17')]===_0xe901('0x18');var _0x23551c=_0x8d4a6[_0xe901('0x19')];var _0x4ac743=_0x27e294?0x0:_0x51a89f['offset'];var _0x3903f8=_0x27e294?_0x8d4a6['count']:_0x51a89f[_0xe901('0x16')]+_0x51a89f['limit'];var _0x59e97f;if(_0x3903f8>=_0x23551c){_0x3903f8=_0x23551c;_0x59e97f=0xc8;}else{_0x59e97f=0xce;}_0xd98ba8['status'](_0x59e97f);return _0xd98ba8[_0xe901('0x1a')](_0xe901('0x1b'),_0x4ac743+'-'+_0x3903f8+'/'+_0x23551c)['json'](_0x8d4a6);}return null;};}function patchUpdates(_0x2a49d8){return function(_0xf91109){try{jsonpatch[_0xe901('0x1c')](_0xf91109,_0x2a49d8,!![]);}catch(_0x4c9a49){return BPromise[_0xe901('0x1d')](_0x4c9a49);}return _0xf91109['save']();};}function saveUpdates(_0x1db253,_0x5a2514){return function(_0x3212b5){if(_0x3212b5){return _0x3212b5['update'](_0x1db253)[_0xe901('0x1e')](function(_0x143a0d){return _0x143a0d;});}return null;};}function removeEntity(_0x410518,_0x492dae){return function(_0x51e3c3){if(_0x51e3c3){return _0x51e3c3[_0xe901('0x1f')]()[_0xe901('0x1e')](function(){_0x410518[_0xe901('0x13')](0xcc)[_0xe901('0x14')]();});}};}function handleEntityNotFound(_0x332e82,_0x12268f){return function(_0x45f4ab){if(!_0x45f4ab){_0x332e82['sendStatus'](0x194);}return _0x45f4ab;};}function handleError(_0x3c87f8,_0x4edeb4){_0x4edeb4=_0x4edeb4||0x1f4;return function(_0xd33e87){logger['error'](_0xd33e87['stack']);if(_0xd33e87[_0xe901('0x20')]){delete _0xd33e87[_0xe901('0x20')];}_0x3c87f8[_0xe901('0x13')](_0x4edeb4)[_0xe901('0x21')](_0xd33e87);};}exports[_0xe901('0x22')]=function(_0x47899b,_0x55af81){var _0x40a6cf={},_0x214cec={},_0x1d50b2={'count':0x0,'rows':[]};var _0x4d8589=_[_0xe901('0x23')](db[_0xe901('0x24')][_0xe901('0x25')],function(_0x10566){return{'name':_0x10566['fieldName'],'type':_0x10566[_0xe901('0x26')]['key']};});_0x214cec[_0xe901('0x27')]=_[_0xe901('0x23')](_0x4d8589,_0xe901('0x20'));_0x214cec[_0xe901('0x28')]=_[_0xe901('0x29')](_0x47899b['query']);_0x214cec[_0xe901('0x2a')]=_[_0xe901('0x2b')](_0x214cec['model'],_0x214cec[_0xe901('0x28')]);_0x40a6cf[_0xe901('0x2c')]=_[_0xe901('0x2b')](_0x214cec['model'],qs['fields'](_0x47899b['query']['fields']));_0x40a6cf[_0xe901('0x2c')]=_0x40a6cf[_0xe901('0x2c')][_0xe901('0x2d')]?_0x40a6cf['attributes']:_0x214cec['model'];if(!_0x47899b[_0xe901('0x28')][_0xe901('0x2e')](_0xe901('0x2f'))){_0x40a6cf[_0xe901('0x17')]=qs[_0xe901('0x17')](_0x47899b[_0xe901('0x28')][_0xe901('0x17')]);_0x40a6cf['offset']=qs[_0xe901('0x16')](_0x47899b[_0xe901('0x28')]['offset']);}_0x40a6cf[_0xe901('0x30')]=qs[_0xe901('0x31')](_0x47899b[_0xe901('0x28')][_0xe901('0x31')]);_0x40a6cf[_0xe901('0x32')]=qs[_0xe901('0x2a')](_[_0xe901('0x33')](_0x47899b['query'],_0x214cec['filters']),_0x4d8589);if(_0x47899b[_0xe901('0x28')]['filter']){_0x40a6cf[_0xe901('0x32')]=_[_0xe901('0x34')](_0x40a6cf[_0xe901('0x32')],{'$or':_[_0xe901('0x23')](_0x4d8589,function(_0x2c9637){if(_0x2c9637[_0xe901('0x26')]!==_0xe901('0x35')){var _0x5657d7={};_0x5657d7[_0x2c9637[_0xe901('0x20')]]={'$like':'%'+_0x47899b['query'][_0xe901('0x36')]+'%'};return _0x5657d7;}})});}_0x40a6cf=_[_0xe901('0x34')]({},_0x40a6cf,_0x47899b[_0xe901('0x37')]);var _0x317f38={'where':_0x40a6cf[_0xe901('0x32')]};return db[_0xe901('0x24')][_0xe901('0x19')](_0x317f38)[_0xe901('0x1e')](function(_0x34680a){_0x1d50b2['count']=_0x34680a;if(_0x47899b[_0xe901('0x28')]['includeAll']){_0x40a6cf[_0xe901('0x38')]=[{'all':!![]}];}return db[_0xe901('0x24')][_0xe901('0x39')](_0x40a6cf);})[_0xe901('0x1e')](function(_0x10881f){_0x1d50b2['rows']=_0x10881f;return _0x1d50b2;})[_0xe901('0x1e')](respondWithFilteredResult(_0x55af81,_0x40a6cf))['catch'](handleError(_0x55af81,null));};exports[_0xe901('0x3a')]=function(_0x4116c1,_0x4e8756){var _0x1d0356={'raw':!![],'where':{'id':_0x4116c1[_0xe901('0x3b')]['id']}},_0x4c4cfe={};_0x4c4cfe[_0xe901('0x27')]=_[_0xe901('0x29')](db[_0xe901('0x24')][_0xe901('0x25')]);_0x4c4cfe[_0xe901('0x28')]=_[_0xe901('0x29')](_0x4116c1[_0xe901('0x28')]);_0x4c4cfe['filters']=_[_0xe901('0x2b')](_0x4c4cfe[_0xe901('0x27')],_0x4c4cfe[_0xe901('0x28')]);_0x1d0356['attributes']=_['intersection'](_0x4c4cfe[_0xe901('0x27')],qs[_0xe901('0x3c')](_0x4116c1[_0xe901('0x28')][_0xe901('0x3c')]));_0x1d0356[_0xe901('0x2c')]=_0x1d0356[_0xe901('0x2c')][_0xe901('0x2d')]?_0x1d0356[_0xe901('0x2c')]:_0x4c4cfe[_0xe901('0x27')];if(_0x4116c1[_0xe901('0x28')][_0xe901('0x3d')]){_0x1d0356['include']=[{'all':!![]}];}_0x1d0356=_['merge']({},_0x1d0356,_0x4116c1['options']);return db[_0xe901('0x24')][_0xe901('0x3e')](_0x1d0356)[_0xe901('0x1e')](handleEntityNotFound(_0x4e8756,null))['then'](respondWithResult(_0x4e8756,null))[_0xe901('0x3f')](handleError(_0x4e8756,null));};exports['create']=function(_0x1f0bf9,_0x7f5450){return db[_0xe901('0x24')]['create'](_0x1f0bf9['body'],{})['then'](respondWithResult(_0x7f5450,0xc9))[_0xe901('0x3f')](handleError(_0x7f5450,null));};exports[_0xe901('0x40')]=function(_0x45ea5c,_0x55ae97){if(_0x45ea5c[_0xe901('0x41')]['id']){delete _0x45ea5c[_0xe901('0x41')]['id'];}return db[_0xe901('0x24')]['find']({'where':{'id':_0x45ea5c[_0xe901('0x3b')]['id']}})[_0xe901('0x1e')](handleEntityNotFound(_0x55ae97,null))['then'](saveUpdates(_0x45ea5c[_0xe901('0x41')],null))['then'](respondWithResult(_0x55ae97,null))['catch'](handleError(_0x55ae97,null));};exports['destroy']=function(_0x2acb77,_0x529010){return db[_0xe901('0x24')][_0xe901('0x3e')]({'where':{'id':_0x2acb77[_0xe901('0x3b')]['id']}})['then'](handleEntityNotFound(_0x529010,null))['then'](removeEntity(_0x529010,null))[_0xe901('0x3f')](handleError(_0x529010,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index a8a686c..1c344a9 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 _0x711a=['./intServicenowField.attributes','exports','define','servicenow_unique_index','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x364f65,_0x5160bd){var _0x3aaf92=function(_0x53da89){while(--_0x53da89){_0x364f65['push'](_0x364f65['shift']());}};_0x3aaf92(++_0x5160bd);}(_0x711a,0x75));var _0xa711=function(_0x39b090,_0x4bbd7e){_0x39b090=_0x39b090-0x0;var _0x5a0f05=_0x711a[_0x39b090];return _0x5a0f05;};'use strict';var _=require('lodash');var util=require(_0xa711('0x0'));var logger=require(_0xa711('0x1'))(_0xa711('0x2'));var moment=require(_0xa711('0x3'));var BPromise=require(_0xa711('0x4'));var rp=require(_0xa711('0x5'));var fs=require('fs');var path=require(_0xa711('0x6'));var rimraf=require(_0xa711('0x7'));var config=require(_0xa711('0x8'));var attributes=require(_0xa711('0x9'));module[_0xa711('0xa')]=function(_0x353f5a,_0x25a327){return _0x353f5a[_0xa711('0xb')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xa711('0xc'),'fields':['idField',_0xa711('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6324=['rimraf','../../config/environment','./intServicenowField.attributes','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x37cc8a,_0x13f856){var _0x28c855=function(_0x34869d){while(--_0x34869d){_0x37cc8a['push'](_0x37cc8a['shift']());}};_0x28c855(++_0x13f856);}(_0x6324,0x161));var _0x4632=function(_0x3f4315,_0xd6ec89){_0x3f4315=_0x3f4315-0x0;var _0x5842e3=_0x6324[_0x3f4315];return _0x5842e3;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var logger=require('../../config/logger')(_0x4632('0x2'));var moment=require(_0x4632('0x3'));var BPromise=require(_0x4632('0x4'));var rp=require(_0x4632('0x5'));var fs=require('fs');var path=require(_0x4632('0x6'));var rimraf=require(_0x4632('0x7'));var config=require(_0x4632('0x8'));var attributes=require(_0x4632('0x9'));module['exports']=function(_0xac4daf,_0x32ad33){return _0xac4daf['define'](_0x4632('0xa'),attributes,{'tableName':_0x4632('0xb'),'paranoid':![],'indexes':[{'name':_0x4632('0xc'),'fields':[_0x4632('0xd'),_0x4632('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 5fdf10f..b43cbbc 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x3cc3c9,_0x360bdc){var _0x24ab75=function(_0x26270f){while(--_0x26270f){_0x3cc3c9['push'](_0x3cc3c9['shift']());}};_0x24ab75(++_0x360bdc);}(_0xb43b,0x1b2));var _0xbb43=function(_0x538c24,_0x2f3efe){_0x538c24=_0x538c24-0x0;var _0x32f92b=_0xb43b[_0x538c24];return _0x32f92b;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x338225,_0x19b136){var _0x2eb497=function(_0x2b703c){while(--_0x2b703c){_0x338225['push'](_0x338225['shift']());}};_0x2eb497(++_0x19b136);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index ed4b9fb..0015df5 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3cc57b,_0xf42081){var _0x32d4ab=function(_0x5f115b){while(--_0x5f115b){_0x3cc57b['push'](_0x3cc57b['shift']());}};_0x32d4ab(++_0xf42081);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +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(_0x2e9f5f,_0x4c2a4f){var _0x46f462=function(_0x2481a3){while(--_0x2481a3){_0x2e9f5f['push'](_0x2e9f5f['shift']());}};_0x46f462(++_0x4c2a4f);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index eb2ad0e..7fb15c8 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(_0xbea9e5,_0x28cccc){var _0x2b9076=function(_0x1b102f){while(--_0x1b102f){_0xbea9e5['push'](_0xbea9e5['shift']());}};_0x2b9076(++_0x28cccc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x164d88,_0x136fbc){var _0x4874cb=function(_0x386b20){while(--_0x386b20){_0x164d88['push'](_0x164d88['shift']());}};_0x4874cb(++_0x136fbc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 8c25e48..7e19469 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 _0x6a94=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','limit','count','set','Content-Range','apply','reject','then','destroy','sendStatus','error','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','options','body','update','find','getConfigurations','findOne','SugarcrmConfiguration','order','hasOwnProperty','nolimit','addConfiguration','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','password','remoteUri','substring','%s%s','/service/v4_1/rest.php','login','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','format','get_module_fields','Calls','module_fields','remove','includes','values','value','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x284b45,_0x381b4b){var _0x34bda6=function(_0x3b1aae){while(--_0x3b1aae){_0x284b45['push'](_0x284b45['shift']());}};_0x34bda6(++_0x381b4b);}(_0x6a94,0xd9));var _0x46a9=function(_0xea2cb4,_0xfb5e72){_0xea2cb4=_0xea2cb4-0x0;var _0x5b9521=_0x6a94[_0xea2cb4];return _0x5b9521;};'use strict';var emlformat=require(_0x46a9('0x0'));var rimraf=require(_0x46a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46a9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x46a9('0x3'));var util=require('util');var path=require('path');var sox=require(_0x46a9('0x4'));var csv=require(_0x46a9('0x5'));var ejs=require(_0x46a9('0x6'));var fs=require('fs');var fs_extra=require(_0x46a9('0x7'));var _=require(_0x46a9('0x8'));var squel=require(_0x46a9('0x9'));var crypto=require(_0x46a9('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x46a9('0x5'));var querystring=require(_0x46a9('0xb'));var Papa=require(_0x46a9('0xc'));var Redis=require(_0x46a9('0xd'));var authService=require(_0x46a9('0xe'));var qs=require(_0x46a9('0xf'));var as=require(_0x46a9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46a9('0x11'))(_0x46a9('0x12'));var utils=require(_0x46a9('0x13'));var config=require(_0x46a9('0x14'));var licenseUtil=require(_0x46a9('0x15'));var db=require(_0x46a9('0x16'))['db'];var integrations=require(_0x46a9('0x17'));function respondWithStatusCode(_0x34bc14,_0x4f9804){_0x4f9804=_0x4f9804||0xcc;return function(_0x498fdb){if(_0x498fdb){return _0x34bc14['sendStatus'](_0x4f9804);}return _0x34bc14['status'](_0x4f9804)[_0x46a9('0x18')]();};}function respondWithResult(_0x3497a0,_0xe36457){_0xe36457=_0xe36457||0xc8;return function(_0x56253f){if(_0x56253f){return _0x3497a0[_0x46a9('0x19')](_0xe36457)[_0x46a9('0x1a')](_0x56253f);}};}function respondWithFilteredResult(_0x2dbcff,_0x18a6ee){return function(_0x4ddeb6){if(_0x4ddeb6){var _0x25ed69=typeof _0x18a6ee[_0x46a9('0x1b')]==='undefined'&&typeof _0x18a6ee[_0x46a9('0x1c')]==='undefined';var _0x55b844=_0x4ddeb6['count'];var _0x4849ae=_0x25ed69?0x0:_0x18a6ee['offset'];var _0xffe9fa=_0x25ed69?_0x4ddeb6[_0x46a9('0x1d')]:_0x18a6ee[_0x46a9('0x1b')]+_0x18a6ee['limit'];var _0x23cbbb;if(_0xffe9fa>=_0x55b844){_0xffe9fa=_0x55b844;_0x23cbbb=0xc8;}else{_0x23cbbb=0xce;}_0x2dbcff[_0x46a9('0x19')](_0x23cbbb);return _0x2dbcff[_0x46a9('0x1e')](_0x46a9('0x1f'),_0x4849ae+'-'+_0xffe9fa+'/'+_0x55b844)[_0x46a9('0x1a')](_0x4ddeb6);}return null;};}function patchUpdates(_0x5b2957){return function(_0x24bd9e){try{jsonpatch[_0x46a9('0x20')](_0x24bd9e,_0x5b2957,!![]);}catch(_0xe8393b){return BPromise[_0x46a9('0x21')](_0xe8393b);}return _0x24bd9e['save']();};}function saveUpdates(_0x1f1907,_0x2f0378){return function(_0x29ed5d){if(_0x29ed5d){return _0x29ed5d['update'](_0x1f1907)[_0x46a9('0x22')](function(_0x512e36){return _0x512e36;});}return null;};}function removeEntity(_0x53a54c,_0x783b2e){return function(_0x347cf1){if(_0x347cf1){return _0x347cf1[_0x46a9('0x23')]()[_0x46a9('0x22')](function(){_0x53a54c[_0x46a9('0x19')](0xcc)[_0x46a9('0x18')]();});}};}function handleEntityNotFound(_0x3d9b6b,_0x4a92b7){return function(_0x54385f){if(!_0x54385f){_0x3d9b6b[_0x46a9('0x24')](0x194);}return _0x54385f;};}function handleError(_0x43d980,_0x14f404){_0x14f404=_0x14f404||0x1f4;return function(_0x283695){logger[_0x46a9('0x25')](_0x283695['stack']);if(_0x283695[_0x46a9('0x26')]){delete _0x283695[_0x46a9('0x26')];}_0x43d980[_0x46a9('0x19')](_0x14f404)[_0x46a9('0x27')](_0x283695);};}exports[_0x46a9('0x28')]=function(_0x91dbc5,_0x2b870f){var _0x94bcde={},_0x545a27={},_0x2629c6={'count':0x0,'rows':[]};var _0x5420fb=_[_0x46a9('0x29')](db[_0x46a9('0x2a')][_0x46a9('0x2b')],function(_0x56e671){return{'name':_0x56e671[_0x46a9('0x2c')],'type':_0x56e671[_0x46a9('0x2d')][_0x46a9('0x2e')]};});_0x545a27[_0x46a9('0x2f')]=_[_0x46a9('0x29')](_0x5420fb,_0x46a9('0x26'));_0x545a27['query']=_[_0x46a9('0x30')](_0x91dbc5[_0x46a9('0x31')]);_0x545a27[_0x46a9('0x32')]=_[_0x46a9('0x33')](_0x545a27[_0x46a9('0x2f')],_0x545a27[_0x46a9('0x31')]);_0x94bcde[_0x46a9('0x34')]=_[_0x46a9('0x33')](_0x545a27['model'],qs[_0x46a9('0x35')](_0x91dbc5[_0x46a9('0x31')]['fields']));_0x94bcde[_0x46a9('0x34')]=_0x94bcde[_0x46a9('0x34')][_0x46a9('0x36')]?_0x94bcde['attributes']:_0x545a27[_0x46a9('0x2f')];if(!_0x91dbc5[_0x46a9('0x31')]['hasOwnProperty']('nolimit')){_0x94bcde['limit']=qs[_0x46a9('0x1c')](_0x91dbc5[_0x46a9('0x31')][_0x46a9('0x1c')]);_0x94bcde[_0x46a9('0x1b')]=qs[_0x46a9('0x1b')](_0x91dbc5['query']['offset']);}_0x94bcde['order']=qs['sort'](_0x91dbc5[_0x46a9('0x31')][_0x46a9('0x37')]);_0x94bcde[_0x46a9('0x38')]=qs[_0x46a9('0x32')](_[_0x46a9('0x39')](_0x91dbc5[_0x46a9('0x31')],_0x545a27['filters']),_0x5420fb);if(_0x91dbc5[_0x46a9('0x31')][_0x46a9('0x3a')]){_0x94bcde[_0x46a9('0x38')]=_[_0x46a9('0x3b')](_0x94bcde[_0x46a9('0x38')],{'$or':_['map'](_0x5420fb,function(_0x27709){if(_0x27709['type']!==_0x46a9('0x3c')){var _0x42c888={};_0x42c888[_0x27709[_0x46a9('0x26')]]={'$like':'%'+_0x91dbc5[_0x46a9('0x31')][_0x46a9('0x3a')]+'%'};return _0x42c888;}})});}_0x94bcde=_[_0x46a9('0x3b')]({},_0x94bcde,_0x91dbc5['options']);var _0x1170ca={'where':_0x94bcde[_0x46a9('0x38')]};return db['SugarcrmAccount']['count'](_0x1170ca)['then'](function(_0x170d4f){_0x2629c6['count']=_0x170d4f;if(_0x91dbc5[_0x46a9('0x31')][_0x46a9('0x3d')]){_0x94bcde['include']=[{'all':!![]}];}return db[_0x46a9('0x2a')][_0x46a9('0x3e')](_0x94bcde);})[_0x46a9('0x22')](function(_0x4ed8e9){_0x2629c6[_0x46a9('0x3f')]=_0x4ed8e9;return _0x2629c6;})['then'](respondWithFilteredResult(_0x2b870f,_0x94bcde))[_0x46a9('0x40')](handleError(_0x2b870f,null));};exports['show']=function(_0xd583a0,_0xd9d255){var _0x11865a={'raw':![],'where':{'id':_0xd583a0[_0x46a9('0x41')]['id']}},_0x3420e8={};_0x3420e8['model']=_[_0x46a9('0x30')](db[_0x46a9('0x2a')]['rawAttributes']);_0x3420e8[_0x46a9('0x31')]=_[_0x46a9('0x30')](_0xd583a0[_0x46a9('0x31')]);_0x3420e8[_0x46a9('0x32')]=_[_0x46a9('0x33')](_0x3420e8['model'],_0x3420e8[_0x46a9('0x31')]);_0x11865a[_0x46a9('0x34')]=_[_0x46a9('0x33')](_0x3420e8[_0x46a9('0x2f')],qs[_0x46a9('0x35')](_0xd583a0[_0x46a9('0x31')]['fields']));_0x11865a['attributes']=_0x11865a[_0x46a9('0x34')][_0x46a9('0x36')]?_0x11865a[_0x46a9('0x34')]:_0x3420e8['model'];if(_0xd583a0['query'][_0x46a9('0x3d')]){_0x11865a['include']=[{'all':!![]}];}_0x11865a=_[_0x46a9('0x3b')]({},_0x11865a,_0xd583a0[_0x46a9('0x42')]);return db['SugarcrmAccount']['find'](_0x11865a)[_0x46a9('0x22')](handleEntityNotFound(_0xd9d255,null))[_0x46a9('0x22')](respondWithResult(_0xd9d255,null))[_0x46a9('0x40')](handleError(_0xd9d255,null));};exports['create']=function(_0x4a8807,_0x109c4c){return db[_0x46a9('0x2a')]['create'](_0x4a8807[_0x46a9('0x43')],{})[_0x46a9('0x22')](respondWithResult(_0x109c4c,0xc9))[_0x46a9('0x40')](handleError(_0x109c4c,null));};exports[_0x46a9('0x44')]=function(_0x1ca4a1,_0x4c52fb){if(_0x1ca4a1['body']['id']){delete _0x1ca4a1[_0x46a9('0x43')]['id'];}return db[_0x46a9('0x2a')][_0x46a9('0x45')]({'where':{'id':_0x1ca4a1[_0x46a9('0x41')]['id']}})[_0x46a9('0x22')](handleEntityNotFound(_0x4c52fb,null))[_0x46a9('0x22')](saveUpdates(_0x1ca4a1['body'],null))['then'](respondWithResult(_0x4c52fb,null))['catch'](handleError(_0x4c52fb,null));};exports[_0x46a9('0x23')]=function(_0x376960,_0x2c1679){return db[_0x46a9('0x2a')][_0x46a9('0x45')]({'where':{'id':_0x376960[_0x46a9('0x41')]['id']}})['then'](handleEntityNotFound(_0x2c1679,null))[_0x46a9('0x22')](removeEntity(_0x2c1679,null))[_0x46a9('0x40')](handleError(_0x2c1679,null));};exports[_0x46a9('0x46')]=function(_0x2558e0,_0x386614,_0x2a656b){var _0x286f91={};var _0x21dd61={};var _0x417ff0;var _0x5c74fc;return db[_0x46a9('0x2a')][_0x46a9('0x47')]({'where':{'id':_0x2558e0[_0x46a9('0x41')]['id']}})[_0x46a9('0x22')](handleEntityNotFound(_0x386614,null))[_0x46a9('0x22')](function(_0x2a97c0){if(_0x2a97c0){_0x417ff0=_0x2a97c0;_0x21dd61[_0x46a9('0x2f')]=_['keys'](db[_0x46a9('0x48')][_0x46a9('0x2b')]);_0x21dd61[_0x46a9('0x31')]=_[_0x46a9('0x30')](_0x2558e0[_0x46a9('0x31')]);_0x21dd61[_0x46a9('0x32')]=_['intersection'](_0x21dd61['model'],_0x21dd61[_0x46a9('0x31')]);_0x286f91[_0x46a9('0x34')]=_[_0x46a9('0x33')](_0x21dd61[_0x46a9('0x2f')],qs[_0x46a9('0x35')](_0x2558e0[_0x46a9('0x31')][_0x46a9('0x35')]));_0x286f91['attributes']=_0x286f91['attributes'][_0x46a9('0x36')]?_0x286f91[_0x46a9('0x34')]:_0x21dd61[_0x46a9('0x2f')];_0x286f91[_0x46a9('0x49')]=qs[_0x46a9('0x37')](_0x2558e0[_0x46a9('0x31')]['sort']);_0x286f91[_0x46a9('0x38')]=qs['filters'](_[_0x46a9('0x39')](_0x2558e0[_0x46a9('0x31')],_0x21dd61[_0x46a9('0x32')]));if(_0x2558e0['query']['filter']){_0x286f91[_0x46a9('0x38')]=_[_0x46a9('0x3b')](_0x286f91[_0x46a9('0x38')],{'$or':_[_0x46a9('0x29')](_0x286f91['attributes'],function(_0xca29a5){var _0x5382db={};_0x5382db[_0xca29a5]={'$like':'%'+_0x2558e0['query'][_0x46a9('0x3a')]+'%'};return _0x5382db;})});}_0x286f91=_[_0x46a9('0x3b')]({},_0x286f91,_0x2558e0[_0x46a9('0x42')]);return _0x417ff0[_0x46a9('0x46')](_0x286f91);}})[_0x46a9('0x22')](function(_0x1cfecb){if(_0x1cfecb){_0x5c74fc=_0x1cfecb[_0x46a9('0x36')];if(!_0x2558e0[_0x46a9('0x31')][_0x46a9('0x4a')](_0x46a9('0x4b'))){_0x286f91[_0x46a9('0x1c')]=qs[_0x46a9('0x1c')](_0x2558e0[_0x46a9('0x31')]['limit']);_0x286f91[_0x46a9('0x1b')]=qs[_0x46a9('0x1b')](_0x2558e0[_0x46a9('0x31')][_0x46a9('0x1b')]);}return _0x417ff0[_0x46a9('0x46')](_0x286f91);}})[_0x46a9('0x22')](function(_0x46d6d3){if(_0x46d6d3){return _0x46d6d3?{'count':_0x5c74fc,'rows':_0x46d6d3}:null;}})[_0x46a9('0x22')](respondWithResult(_0x386614,null))['catch'](handleError(_0x386614,null));};exports[_0x46a9('0x4c')]=function(_0x416a46,_0x1da0b4,_0x5ae98a){if(_0x416a46[_0x46a9('0x43')]['id']){delete _0x416a46[_0x46a9('0x43')]['id'];}return db[_0x46a9('0x2a')]['findOne']({'where':{'id':_0x416a46[_0x46a9('0x41')]['id']}})[_0x46a9('0x22')](handleEntityNotFound(_0x1da0b4,null))[_0x46a9('0x22')](function(_0x42c889){if(_0x42c889){_0x416a46[_0x46a9('0x43')]['AccountId']=_0x42c889['id'];_0x416a46['body'][_0x46a9('0x4d')]=integrations['getSubjects'](_0x416a46[_0x46a9('0x43')][_0x46a9('0x4e')],_0x416a46[_0x46a9('0x43')][_0x46a9('0x2d')]);_0x416a46[_0x46a9('0x43')][_0x46a9('0x4f')]=integrations[_0x46a9('0x50')](_0x416a46[_0x46a9('0x43')][_0x46a9('0x4e')],_0x416a46[_0x46a9('0x43')][_0x46a9('0x2d')]);return db[_0x46a9('0x48')]['create'](_0x416a46[_0x46a9('0x43')],{'include':[{'model':db[_0x46a9('0x51')],'as':'Subjects'},{'model':db[_0x46a9('0x51')],'as':'Descriptions'}]});}return null;})[_0x46a9('0x22')](respondWithResult(_0x1da0b4,null))[_0x46a9('0x40')](handleError(_0x1da0b4,null));};exports[_0x46a9('0x52')]=function(_0x1c7597,_0x56f8a1,_0x3ca6fe){var _0x2b6476='';var _0x142f13=['id',_0x46a9('0x26'),_0x46a9('0x53'),_0x46a9('0x54'),_0x46a9('0x55'),_0x46a9('0x56'),_0x46a9('0x57'),_0x46a9('0x58'),_0x46a9('0x59'),_0x46a9('0x5a'),'parent_name','direction'];return db[_0x46a9('0x2a')][_0x46a9('0x47')]({'where':{'id':_0x1c7597[_0x46a9('0x41')]['id']},'attributes':['id','username',_0x46a9('0x5b'),_0x46a9('0x5c')]})[_0x46a9('0x22')](handleEntityNotFound(_0x56f8a1,null))[_0x46a9('0x22')](function(_0x33e8eb){if(_0x33e8eb){_0x2b6476=_0x33e8eb[_0x46a9('0x5c')];var _0x30be57=_0x2b6476['slice'](-0x1);if(_0x30be57==='/'){_0x2b6476=_0x2b6476[_0x46a9('0x5d')](0x0,_0x2b6476['lastIndexOf'](_0x30be57));}return rp({'method':'POST','uri':util['format'](_0x46a9('0x5e'),_0x2b6476,_0x46a9('0x5f')),'json':!![],'form':{'method':_0x46a9('0x60'),'input_type':_0x46a9('0x61'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x33e8eb[_0x46a9('0x62')],'password':_0x33e8eb[_0x46a9('0x5b')],'encryption':_0x46a9('0x63')},'application':_0x46a9('0x64')})}});}})[_0x46a9('0x22')](function(_0x4dfe46){if(_0x4dfe46&&_0x4dfe46[_0x46a9('0x26')]!==_0x46a9('0x65')&&_0x4dfe46[_0x46a9('0x26')]!==_0x46a9('0x66')){return rp({'method':_0x46a9('0x67'),'uri':util[_0x46a9('0x68')]('%s%s',_0x2b6476,_0x46a9('0x5f')),'json':!![],'form':{'method':_0x46a9('0x69'),'input_type':_0x46a9('0x61'),'response_type':_0x46a9('0x61'),'rest_data':JSON['stringify']({'session':_0x4dfe46['id'],'module_name':_0x46a9('0x6a')})}})['then'](function(_0x3ee2f0){if(_0x3ee2f0){var _0x52dcde=_['values'](_0x3ee2f0[_0x46a9('0x6b')]);_[_0x46a9('0x6c')](_0x52dcde,function(_0xa8d18){return _0x142f13[_0x46a9('0x6d')](_0xa8d18[_0x46a9('0x26')]);});return{'count':_0x52dcde[_0x46a9('0x36')],'rows':_[_0x46a9('0x29')](_0x52dcde,function(_0x55b44e){return{'id':_0x55b44e[_0x46a9('0x26')],'name':_0x55b44e['label'],'custom':_['endsWith'](_0x55b44e[_0x46a9('0x26')],'_c')?!![]:![],'options':_0x55b44e[_0x46a9('0x42')]?_[_0x46a9('0x29')](_[_0x46a9('0x6e')](_0x55b44e[_0x46a9('0x42')]),function(_0x4d4428){return{'name':_0x4d4428[_0x46a9('0x6f')],'value':_0x4d4428[_0x46a9('0x26')]};}):[]};})};}})[_0x46a9('0x22')](respondWithResult(_0x56f8a1,null))['catch'](function(_0xf68b74){var _0x2e6179=_0x1c7597[_0x46a9('0x31')][_0x46a9('0x70')]?0x1f4:_0xf68b74['statusCode']||0x1f4;logger['error'](_0x46a9('0x71'),_0x46a9('0x52'),_0x2e6179,JSON[_0x46a9('0x72')](_0xf68b74));delete _0xf68b74[_0x46a9('0x26')];if(_0x2e6179===0x191){_0x2e6179=0x190;}_0x56f8a1['status'](_0x2e6179)['send'](_0x1c7597[_0x46a9('0x31')][_0x46a9('0x70')]?{'message':_0x46a9('0x73'),'statusCode':_0xf68b74[_0x46a9('0x74')]}:_0xf68b74);});}else{var _0x21ccb5=0x1f4;_0x56f8a1[_0x46a9('0x19')](_0x21ccb5)[_0x46a9('0x27')]({'message':_0x46a9('0x73'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x279d=['/service/v4_1/rest.php','login','stringify','username','PLAIN','POST','JSON','values','module_fields','label','endsWith','value','statusCode','test','Wrong\x20credentials','send','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','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','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply','reject','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','find','create','body','update','params','findOne','length','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','getDescriptions','SugarcrmConfiguration','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','duration_hours','parent_id','parent_type','password','remoteUri','slice','substring','format','%s%s'];(function(_0x361b32,_0x315245){var _0x1d71fe=function(_0x2cfc47){while(--_0x2cfc47){_0x361b32['push'](_0x361b32['shift']());}};_0x1d71fe(++_0x315245);}(_0x279d,0x1d8));var _0xd279=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x279d[_0x4a3898];return _0x25ceb0;};'use strict';var emlformat=require(_0xd279('0x0'));var rimraf=require(_0xd279('0x1'));var zipdir=require(_0xd279('0x2'));var jsonpatch=require(_0xd279('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd279('0x4'));var Mustache=require(_0xd279('0x5'));var util=require('util');var path=require(_0xd279('0x6'));var sox=require(_0xd279('0x7'));var csv=require(_0xd279('0x8'));var ejs=require(_0xd279('0x9'));var fs=require('fs');var fs_extra=require(_0xd279('0xa'));var _=require(_0xd279('0xb'));var squel=require(_0xd279('0xc'));var crypto=require('crypto');var jsforce=require(_0xd279('0xd'));var deskjs=require(_0xd279('0xe'));var toCsv=require(_0xd279('0x8'));var querystring=require(_0xd279('0xf'));var Papa=require(_0xd279('0x10'));var Redis=require(_0xd279('0x11'));var authService=require(_0xd279('0x12'));var qs=require(_0xd279('0x13'));var as=require(_0xd279('0x14'));var hardwareService=require(_0xd279('0x15'));var logger=require(_0xd279('0x16'))('api');var utils=require(_0xd279('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd279('0x18'));var db=require(_0xd279('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xeb0828,_0x54f78b){_0x54f78b=_0x54f78b||0xcc;return function(_0x590646){if(_0x590646){return _0xeb0828[_0xd279('0x1a')](_0x54f78b);}return _0xeb0828['status'](_0x54f78b)[_0xd279('0x1b')]();};}function respondWithResult(_0x5c3b48,_0x2bf8e3){_0x2bf8e3=_0x2bf8e3||0xc8;return function(_0x3f3514){if(_0x3f3514){return _0x5c3b48[_0xd279('0x1c')](_0x2bf8e3)[_0xd279('0x1d')](_0x3f3514);}};}function respondWithFilteredResult(_0x5c1c0f,_0x55b3c5){return function(_0x20db5d){if(_0x20db5d){var _0x440e80=typeof _0x55b3c5[_0xd279('0x1e')]===_0xd279('0x1f')&&typeof _0x55b3c5['limit']===_0xd279('0x1f');var _0x591f5f=_0x20db5d['count'];var _0x544e01=_0x440e80?0x0:_0x55b3c5[_0xd279('0x1e')];var _0x2a5d61=_0x440e80?_0x20db5d['count']:_0x55b3c5[_0xd279('0x1e')]+_0x55b3c5[_0xd279('0x20')];var _0x281040;if(_0x2a5d61>=_0x591f5f){_0x2a5d61=_0x591f5f;_0x281040=0xc8;}else{_0x281040=0xce;}_0x5c1c0f[_0xd279('0x1c')](_0x281040);return _0x5c1c0f['set'](_0xd279('0x21'),_0x544e01+'-'+_0x2a5d61+'/'+_0x591f5f)[_0xd279('0x1d')](_0x20db5d);}return null;};}function patchUpdates(_0x5577fc){return function(_0x1509bc){try{jsonpatch[_0xd279('0x22')](_0x1509bc,_0x5577fc,!![]);}catch(_0x1c1d6e){return BPromise[_0xd279('0x23')](_0x1c1d6e);}return _0x1509bc['save']();};}function saveUpdates(_0x36fd44,_0x2716f4){return function(_0x13180f){if(_0x13180f){return _0x13180f['update'](_0x36fd44)[_0xd279('0x24')](function(_0x1a06e7){return _0x1a06e7;});}return null;};}function removeEntity(_0x3a9e73,_0x307599){return function(_0x251de4){if(_0x251de4){return _0x251de4[_0xd279('0x25')]()[_0xd279('0x24')](function(){_0x3a9e73[_0xd279('0x1c')](0xcc)[_0xd279('0x1b')]();});}};}function handleEntityNotFound(_0x48f1b1,_0x53e0f6){return function(_0x38686c){if(!_0x38686c){_0x48f1b1[_0xd279('0x1a')](0x194);}return _0x38686c;};}function handleError(_0x563637,_0x46a162){_0x46a162=_0x46a162||0x1f4;return function(_0x26bd72){logger[_0xd279('0x26')](_0x26bd72[_0xd279('0x27')]);if(_0x26bd72['name']){delete _0x26bd72[_0xd279('0x28')];}_0x563637[_0xd279('0x1c')](_0x46a162)['send'](_0x26bd72);};}exports[_0xd279('0x29')]=function(_0x577102,_0x159ea4){var _0x2347ed={},_0x3e64f6={},_0x47175a={'count':0x0,'rows':[]};var _0x2dd41e=_[_0xd279('0x2a')](db[_0xd279('0x2b')][_0xd279('0x2c')],function(_0x3c95fb){return{'name':_0x3c95fb['fieldName'],'type':_0x3c95fb[_0xd279('0x2d')][_0xd279('0x2e')]};});_0x3e64f6[_0xd279('0x2f')]=_[_0xd279('0x2a')](_0x2dd41e,_0xd279('0x28'));_0x3e64f6[_0xd279('0x30')]=_[_0xd279('0x31')](_0x577102[_0xd279('0x30')]);_0x3e64f6[_0xd279('0x32')]=_['intersection'](_0x3e64f6['model'],_0x3e64f6[_0xd279('0x30')]);_0x2347ed[_0xd279('0x33')]=_[_0xd279('0x34')](_0x3e64f6[_0xd279('0x2f')],qs['fields'](_0x577102[_0xd279('0x30')][_0xd279('0x35')]));_0x2347ed[_0xd279('0x33')]=_0x2347ed[_0xd279('0x33')]['length']?_0x2347ed[_0xd279('0x33')]:_0x3e64f6[_0xd279('0x2f')];if(!_0x577102[_0xd279('0x30')]['hasOwnProperty'](_0xd279('0x36'))){_0x2347ed['limit']=qs[_0xd279('0x20')](_0x577102['query'][_0xd279('0x20')]);_0x2347ed[_0xd279('0x1e')]=qs['offset'](_0x577102[_0xd279('0x30')][_0xd279('0x1e')]);}_0x2347ed[_0xd279('0x37')]=qs['sort'](_0x577102[_0xd279('0x30')][_0xd279('0x38')]);_0x2347ed[_0xd279('0x39')]=qs[_0xd279('0x32')](_[_0xd279('0x3a')](_0x577102[_0xd279('0x30')],_0x3e64f6['filters']),_0x2dd41e);if(_0x577102['query'][_0xd279('0x3b')]){_0x2347ed[_0xd279('0x39')]=_[_0xd279('0x3c')](_0x2347ed[_0xd279('0x39')],{'$or':_[_0xd279('0x2a')](_0x2dd41e,function(_0x1c7cd1){if(_0x1c7cd1['type']!==_0xd279('0x3d')){var _0x5c41d9={};_0x5c41d9[_0x1c7cd1[_0xd279('0x28')]]={'$like':'%'+_0x577102[_0xd279('0x30')]['filter']+'%'};return _0x5c41d9;}})});}_0x2347ed=_['merge']({},_0x2347ed,_0x577102[_0xd279('0x3e')]);var _0x3996ea={'where':_0x2347ed[_0xd279('0x39')]};return db[_0xd279('0x2b')]['count'](_0x3996ea)[_0xd279('0x24')](function(_0x584748){_0x47175a[_0xd279('0x3f')]=_0x584748;if(_0x577102[_0xd279('0x30')][_0xd279('0x40')]){_0x2347ed[_0xd279('0x41')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x2347ed);})[_0xd279('0x24')](function(_0x46c899){_0x47175a[_0xd279('0x42')]=_0x46c899;return _0x47175a;})[_0xd279('0x24')](respondWithFilteredResult(_0x159ea4,_0x2347ed))[_0xd279('0x43')](handleError(_0x159ea4,null));};exports['show']=function(_0x580b30,_0x10ae13){var _0x3acc04={'raw':![],'where':{'id':_0x580b30['params']['id']}},_0x3353d8={};_0x3353d8['model']=_[_0xd279('0x31')](db['SugarcrmAccount'][_0xd279('0x2c')]);_0x3353d8[_0xd279('0x30')]=_['keys'](_0x580b30[_0xd279('0x30')]);_0x3353d8[_0xd279('0x32')]=_[_0xd279('0x34')](_0x3353d8[_0xd279('0x2f')],_0x3353d8[_0xd279('0x30')]);_0x3acc04[_0xd279('0x33')]=_[_0xd279('0x34')](_0x3353d8[_0xd279('0x2f')],qs['fields'](_0x580b30[_0xd279('0x30')][_0xd279('0x35')]));_0x3acc04[_0xd279('0x33')]=_0x3acc04[_0xd279('0x33')]['length']?_0x3acc04[_0xd279('0x33')]:_0x3353d8[_0xd279('0x2f')];if(_0x580b30[_0xd279('0x30')][_0xd279('0x40')]){_0x3acc04[_0xd279('0x41')]=[{'all':!![]}];}_0x3acc04=_[_0xd279('0x3c')]({},_0x3acc04,_0x580b30[_0xd279('0x3e')]);return db[_0xd279('0x2b')][_0xd279('0x44')](_0x3acc04)[_0xd279('0x24')](handleEntityNotFound(_0x10ae13,null))[_0xd279('0x24')](respondWithResult(_0x10ae13,null))['catch'](handleError(_0x10ae13,null));};exports['create']=function(_0x4f2a56,_0x469db5){return db[_0xd279('0x2b')][_0xd279('0x45')](_0x4f2a56[_0xd279('0x46')],{})[_0xd279('0x24')](respondWithResult(_0x469db5,0xc9))[_0xd279('0x43')](handleError(_0x469db5,null));};exports[_0xd279('0x47')]=function(_0x55b189,_0x247c09){if(_0x55b189[_0xd279('0x46')]['id']){delete _0x55b189[_0xd279('0x46')]['id'];}return db[_0xd279('0x2b')][_0xd279('0x44')]({'where':{'id':_0x55b189[_0xd279('0x48')]['id']}})[_0xd279('0x24')](handleEntityNotFound(_0x247c09,null))[_0xd279('0x24')](saveUpdates(_0x55b189[_0xd279('0x46')],null))[_0xd279('0x24')](respondWithResult(_0x247c09,null))[_0xd279('0x43')](handleError(_0x247c09,null));};exports[_0xd279('0x25')]=function(_0x341d92,_0x496e2f){return db[_0xd279('0x2b')]['find']({'where':{'id':_0x341d92[_0xd279('0x48')]['id']}})[_0xd279('0x24')](handleEntityNotFound(_0x496e2f,null))[_0xd279('0x24')](removeEntity(_0x496e2f,null))[_0xd279('0x43')](handleError(_0x496e2f,null));};exports['getConfigurations']=function(_0x18c54a,_0x6bad4b,_0x1e7ee){var _0x17d0e5={};var _0x2409ec={};var _0x2279d2;var _0xeb52c3;return db[_0xd279('0x2b')][_0xd279('0x49')]({'where':{'id':_0x18c54a[_0xd279('0x48')]['id']}})['then'](handleEntityNotFound(_0x6bad4b,null))[_0xd279('0x24')](function(_0x2224af){if(_0x2224af){_0x2279d2=_0x2224af;_0x2409ec[_0xd279('0x2f')]=_['keys'](db['SugarcrmConfiguration'][_0xd279('0x2c')]);_0x2409ec[_0xd279('0x30')]=_[_0xd279('0x31')](_0x18c54a[_0xd279('0x30')]);_0x2409ec[_0xd279('0x32')]=_['intersection'](_0x2409ec[_0xd279('0x2f')],_0x2409ec[_0xd279('0x30')]);_0x17d0e5[_0xd279('0x33')]=_[_0xd279('0x34')](_0x2409ec['model'],qs[_0xd279('0x35')](_0x18c54a[_0xd279('0x30')][_0xd279('0x35')]));_0x17d0e5[_0xd279('0x33')]=_0x17d0e5['attributes'][_0xd279('0x4a')]?_0x17d0e5[_0xd279('0x33')]:_0x2409ec['model'];_0x17d0e5[_0xd279('0x37')]=qs[_0xd279('0x38')](_0x18c54a[_0xd279('0x30')][_0xd279('0x38')]);_0x17d0e5['where']=qs[_0xd279('0x32')](_[_0xd279('0x3a')](_0x18c54a[_0xd279('0x30')],_0x2409ec[_0xd279('0x32')]));if(_0x18c54a[_0xd279('0x30')][_0xd279('0x3b')]){_0x17d0e5[_0xd279('0x39')]=_[_0xd279('0x3c')](_0x17d0e5[_0xd279('0x39')],{'$or':_[_0xd279('0x2a')](_0x17d0e5['attributes'],function(_0xf42a38){var _0x3e5aab={};_0x3e5aab[_0xf42a38]={'$like':'%'+_0x18c54a[_0xd279('0x30')][_0xd279('0x3b')]+'%'};return _0x3e5aab;})});}_0x17d0e5=_[_0xd279('0x3c')]({},_0x17d0e5,_0x18c54a['options']);return _0x2279d2[_0xd279('0x4b')](_0x17d0e5);}})['then'](function(_0x29506f){if(_0x29506f){_0xeb52c3=_0x29506f['length'];if(!_0x18c54a[_0xd279('0x30')][_0xd279('0x4c')]('nolimit')){_0x17d0e5[_0xd279('0x20')]=qs[_0xd279('0x20')](_0x18c54a['query'][_0xd279('0x20')]);_0x17d0e5[_0xd279('0x1e')]=qs[_0xd279('0x1e')](_0x18c54a['query'][_0xd279('0x1e')]);}return _0x2279d2[_0xd279('0x4b')](_0x17d0e5);}})['then'](function(_0xd08d87){if(_0xd08d87){return _0xd08d87?{'count':_0xeb52c3,'rows':_0xd08d87}:null;}})['then'](respondWithResult(_0x6bad4b,null))['catch'](handleError(_0x6bad4b,null));};exports[_0xd279('0x4d')]=function(_0x5a8719,_0x2b96a4,_0xd89985){if(_0x5a8719[_0xd279('0x46')]['id']){delete _0x5a8719[_0xd279('0x46')]['id'];}return db['SugarcrmAccount'][_0xd279('0x49')]({'where':{'id':_0x5a8719['params']['id']}})[_0xd279('0x24')](handleEntityNotFound(_0x2b96a4,null))[_0xd279('0x24')](function(_0x2f9219){if(_0x2f9219){_0x5a8719[_0xd279('0x46')][_0xd279('0x4e')]=_0x2f9219['id'];_0x5a8719[_0xd279('0x46')][_0xd279('0x4f')]=integrations['getSubjects'](_0x5a8719[_0xd279('0x46')][_0xd279('0x50')],_0x5a8719['body']['type']);_0x5a8719[_0xd279('0x46')]['Descriptions']=integrations[_0xd279('0x51')](_0x5a8719[_0xd279('0x46')][_0xd279('0x50')],_0x5a8719[_0xd279('0x46')]['type']);return db[_0xd279('0x52')][_0xd279('0x45')](_0x5a8719[_0xd279('0x46')],{'include':[{'model':db['SugarcrmField'],'as':_0xd279('0x4f')},{'model':db[_0xd279('0x53')],'as':_0xd279('0x54')}]});}return null;})[_0xd279('0x24')](respondWithResult(_0x2b96a4,null))[_0xd279('0x43')](handleError(_0x2b96a4,null));};exports[_0xd279('0x55')]=function(_0x19d408,_0x485be9,_0x39c4bf){var _0x32219c='';var _0x597654=['id',_0xd279('0x28'),_0xd279('0x56'),_0xd279('0x57'),_0xd279('0x58'),'date_start',_0xd279('0x59'),'duration_minutes',_0xd279('0x5a'),_0xd279('0x5b'),'parent_name','direction'];return db['SugarcrmAccount'][_0xd279('0x49')]({'where':{'id':_0x19d408[_0xd279('0x48')]['id']},'attributes':['id','username',_0xd279('0x5c'),'remoteUri']})[_0xd279('0x24')](handleEntityNotFound(_0x485be9,null))[_0xd279('0x24')](function(_0x1fda22){if(_0x1fda22){_0x32219c=_0x1fda22[_0xd279('0x5d')];var _0x557464=_0x32219c[_0xd279('0x5e')](-0x1);if(_0x557464==='/'){_0x32219c=_0x32219c[_0xd279('0x5f')](0x0,_0x32219c['lastIndexOf'](_0x557464));}return rp({'method':'POST','uri':util[_0xd279('0x60')](_0xd279('0x61'),_0x32219c,_0xd279('0x62')),'json':!![],'form':{'method':_0xd279('0x63'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xd279('0x64')]({'user_auth':{'user_name':_0x1fda22[_0xd279('0x65')],'password':_0x1fda22[_0xd279('0x5c')],'encryption':_0xd279('0x66')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xd279('0x24')](function(_0x1bdc49){if(_0x1bdc49&&_0x1bdc49[_0xd279('0x28')]!=='Invalid\x20Login'&&_0x1bdc49['name']!=='Password\x20Expired'){return rp({'method':_0xd279('0x67'),'uri':util[_0xd279('0x60')](_0xd279('0x61'),_0x32219c,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xd279('0x68'),'response_type':_0xd279('0x68'),'rest_data':JSON[_0xd279('0x64')]({'session':_0x1bdc49['id'],'module_name':'Calls'})}})[_0xd279('0x24')](function(_0x3c9e72){if(_0x3c9e72){var _0x18f19a=_[_0xd279('0x69')](_0x3c9e72[_0xd279('0x6a')]);_['remove'](_0x18f19a,function(_0x5338b3){return _0x597654['includes'](_0x5338b3[_0xd279('0x28')]);});return{'count':_0x18f19a[_0xd279('0x4a')],'rows':_['map'](_0x18f19a,function(_0x6fb154){return{'id':_0x6fb154[_0xd279('0x28')],'name':_0x6fb154[_0xd279('0x6b')],'custom':_[_0xd279('0x6c')](_0x6fb154['name'],'_c')?!![]:![],'options':_0x6fb154[_0xd279('0x3e')]?_[_0xd279('0x2a')](_['values'](_0x6fb154[_0xd279('0x3e')]),function(_0x6cdeeb){return{'name':_0x6cdeeb[_0xd279('0x6d')],'value':_0x6cdeeb[_0xd279('0x28')]};}):[]};})};}})['then'](respondWithResult(_0x485be9,null))['catch'](function(_0x3a7ef3){var _0x38bae9=_0x19d408['query']['test']?0x1f4:_0x3a7ef3[_0xd279('0x6e')]||0x1f4;logger[_0xd279('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0xd279('0x55'),_0x38bae9,JSON[_0xd279('0x64')](_0x3a7ef3));delete _0x3a7ef3[_0xd279('0x28')];if(_0x38bae9===0x191){_0x38bae9=0x190;}_0x485be9[_0xd279('0x1c')](_0x38bae9)['send'](_0x19d408[_0xd279('0x30')][_0xd279('0x6f')]?{'message':_0xd279('0x70'),'statusCode':_0x3a7ef3[_0xd279('0x6e')]}:_0x3a7ef3);});}else{var _0x4109f1=0x1f4;_0x485be9[_0xd279('0x1c')](_0x4109f1)[_0xd279('0x71')]({'message':_0xd279('0x70'),'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 061358a..51c4a5e 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 _0xd6ed=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xd6ed,0x1aa));var _0xdd6e=function(_0x2cb474,_0x1d3290){_0x2cb474=_0x2cb474-0x0;var _0x42b8d5=_0xd6ed[_0x2cb474];return _0x42b8d5;};'use strict';var _=require('lodash');var util=require(_0xdd6e('0x0'));var logger=require(_0xdd6e('0x1'))(_0xdd6e('0x2'));var moment=require(_0xdd6e('0x3'));var BPromise=require(_0xdd6e('0x4'));var rp=require(_0xdd6e('0x5'));var fs=require('fs');var path=require(_0xdd6e('0x6'));var rimraf=require(_0xdd6e('0x7'));var config=require(_0xdd6e('0x8'));var attributes=require(_0xdd6e('0x9'));var integrations=require(_0xdd6e('0xa'));module[_0xdd6e('0xb')]=function(_0x5599bd,_0x4b77c8){return _0x5599bd[_0xdd6e('0xc')](_0xdd6e('0xd'),attributes,{'tableName':_0xdd6e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79e2=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api','moment','request-promise'];(function(_0x194cb5,_0x479e8a){var _0x55db4b=function(_0x2c8192){while(--_0x2c8192){_0x194cb5['push'](_0x194cb5['shift']());}};_0x55db4b(++_0x479e8a);}(_0x79e2,0x1c3));var _0x279e=function(_0x59684c,_0x4f23bd){_0x59684c=_0x59684c-0x0;var _0x6e9beb=_0x79e2[_0x59684c];return _0x6e9beb;};'use strict';var _=require(_0x279e('0x0'));var util=require('util');var logger=require(_0x279e('0x1'))(_0x279e('0x2'));var moment=require(_0x279e('0x3'));var BPromise=require('bluebird');var rp=require(_0x279e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x279e('0x5'));var config=require(_0x279e('0x6'));var attributes=require(_0x279e('0x7'));var integrations=require(_0x279e('0x8'));module['exports']=function(_0x5a2f72,_0x1c6b6f){return _0x5a2f72[_0x279e('0x9')](_0x279e('0xa'),attributes,{'tableName':_0x279e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index c70d515..a5e7f5d 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 _0x74cc=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowSugarcrmAccount','find','lodash','util','moment'];(function(_0x51e2fa,_0x2b54d1){var _0x3bba5d=function(_0xf9d851){while(--_0xf9d851){_0x51e2fa['push'](_0x51e2fa['shift']());}};_0x3bba5d(++_0x2b54d1);}(_0x74cc,0xbb));var _0xc74c=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x74cc[_0x3054be];return _0x3df150;};'use strict';var _=require(_0xc74c('0x0'));var util=require(_0xc74c('0x1'));var moment=require(_0xc74c('0x2'));var BPromise=require(_0xc74c('0x3'));var rs=require(_0xc74c('0x4'));var fs=require('fs');var Redis=require(_0xc74c('0x5'));var db=require(_0xc74c('0x6'))['db'];var utils=require(_0xc74c('0x7'));var logger=require(_0xc74c('0x8'))(_0xc74c('0x9'));var config=require(_0xc74c('0xa'));var jayson=require(_0xc74c('0xb'));var client=jayson[_0xc74c('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fbe1c,_0x215b0a,_0x4b860e){return new BPromise(function(_0x241170,_0x24ddd7){return client[_0xc74c('0xd')](_0x2fbe1c,_0x4b860e)[_0xc74c('0xe')](function(_0x3058ad){logger[_0xc74c('0xf')](_0xc74c('0x10'),_0x215b0a,_0xc74c('0x11'));logger[_0xc74c('0x12')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x215b0a,_0xc74c('0x11'),JSON[_0xc74c('0x13')](_0x3058ad));if(_0x3058ad[_0xc74c('0x14')]){if(_0x3058ad[_0xc74c('0x14')][_0xc74c('0x15')]===0x1f4){logger['error'](_0xc74c('0x10'),_0x215b0a,_0x3058ad[_0xc74c('0x14')]['message']);return _0x24ddd7(_0x3058ad[_0xc74c('0x14')][_0xc74c('0x16')]);}logger[_0xc74c('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0x215b0a,_0x3058ad[_0xc74c('0x14')]['message']);return _0x241170(_0x3058ad[_0xc74c('0x14')][_0xc74c('0x16')]);}else{logger[_0xc74c('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x215b0a,_0xc74c('0x11'));_0x241170(_0x3058ad[_0xc74c('0x17')][_0xc74c('0x16')]);}})[_0xc74c('0x18')](function(_0x4211e9){logger[_0xc74c('0x14')](_0xc74c('0x10'),_0x215b0a,_0x4211e9);_0x24ddd7(_0x4211e9);});});}exports[_0xc74c('0x19')]=function(_0x4ba308){var _0x2dbca3=this;return new Promise(function(_0x28606b,_0x2ff407){return db[_0xc74c('0x1a')][_0xc74c('0x1b')]({'raw':_0x4ba308[_0xc74c('0x1c')]?_0x4ba308[_0xc74c('0x1c')][_0xc74c('0x1d')]===undefined?!![]:![]:!![],'where':_0x4ba308[_0xc74c('0x1c')]?_0x4ba308[_0xc74c('0x1c')][_0xc74c('0x1e')]||null:null,'attributes':_0x4ba308[_0xc74c('0x1c')]?_0x4ba308[_0xc74c('0x1c')][_0xc74c('0x1f')]||null:null,'limit':_0x4ba308[_0xc74c('0x1c')]?_0x4ba308[_0xc74c('0x1c')][_0xc74c('0x20')]||null:null,'include':_0x4ba308[_0xc74c('0x1c')]?_0x4ba308[_0xc74c('0x1c')]['include']?_[_0xc74c('0x21')](_0x4ba308[_0xc74c('0x1c')][_0xc74c('0x22')],function(_0x5cfef0){return{'model':db[_0x5cfef0[_0xc74c('0x23')]],'as':_0x5cfef0['as'],'attributes':_0x5cfef0[_0xc74c('0x1f')],'include':_0x5cfef0['include']?_['map'](_0x5cfef0[_0xc74c('0x22')],function(_0x475027){return{'model':db[_0x475027[_0xc74c('0x23')]],'as':_0x475027['as'],'attributes':_0x475027[_0xc74c('0x1f')],'include':_0x475027[_0xc74c('0x22')]?_['map'](_0x475027['include'],function(_0x65e4ea){return{'model':db[_0x65e4ea[_0xc74c('0x23')]],'as':_0x65e4ea['as'],'attributes':_0x65e4ea[_0xc74c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b0d6d){logger[_0xc74c('0xf')](_0xc74c('0x19'),_0x4ba308);logger[_0xc74c('0x12')](_0xc74c('0x19'),_0x4ba308,JSON['stringify'](_0x1b0d6d));_0x28606b(_0x1b0d6d);})[_0xc74c('0x18')](function(_0x582699){logger[_0xc74c('0x14')]('GetSugarcrmAccount',_0x582699[_0xc74c('0x16')],_0x4ba308);_0x2ff407(_0x2dbca3['error'](0x1f4,_0x582699['message']));});});};exports[_0xc74c('0x24')]=function(_0x3bc22b){var _0x452896=this;return new Promise(function(_0x2ec3ff,_0x512339){return db[_0xc74c('0x1a')][_0xc74c('0x25')]({'raw':_0x3bc22b['options']?_0x3bc22b[_0xc74c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3bc22b[_0xc74c('0x1c')]?_0x3bc22b[_0xc74c('0x1c')]['where']||null:null,'attributes':_0x3bc22b['options']?_0x3bc22b[_0xc74c('0x1c')][_0xc74c('0x1f')]||null:null,'include':_0x3bc22b[_0xc74c('0x1c')]?_0x3bc22b[_0xc74c('0x1c')][_0xc74c('0x22')]?_[_0xc74c('0x21')](_0x3bc22b[_0xc74c('0x1c')][_0xc74c('0x22')],function(_0x1c2050){return{'model':db[_0x1c2050[_0xc74c('0x23')]],'as':_0x1c2050['as'],'attributes':_0x1c2050['attributes'],'include':_0x1c2050[_0xc74c('0x22')]?_[_0xc74c('0x21')](_0x1c2050['include'],function(_0x1845f0){return{'model':db[_0x1845f0[_0xc74c('0x23')]],'as':_0x1845f0['as'],'attributes':_0x1845f0[_0xc74c('0x1f')],'include':_0x1845f0[_0xc74c('0x22')]?_[_0xc74c('0x21')](_0x1845f0[_0xc74c('0x22')],function(_0x3324fa){return{'model':db[_0x3324fa['model']],'as':_0x3324fa['as'],'attributes':_0x3324fa[_0xc74c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc74c('0xe')](function(_0x570fd1){logger[_0xc74c('0xf')](_0xc74c('0x24'),_0x3bc22b);logger[_0xc74c('0x12')](_0xc74c('0x24'),_0x3bc22b,JSON[_0xc74c('0x13')](_0x570fd1));_0x2ec3ff(_0x570fd1);})[_0xc74c('0x18')](function(_0x27752a){logger[_0xc74c('0x14')](_0xc74c('0x24'),_0x27752a[_0xc74c('0x16')],_0x3bc22b);_0x512339(_0x452896['error'](0x1f4,_0x27752a['message']));});});}; \ No newline at end of file +var _0x84ed=['error','code','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit','include','model','map','debug','catch','ShowSugarcrmAccount','find','lodash','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x483dba,_0x1a3942){var _0x15b8c7=function(_0x514902){while(--_0x514902){_0x483dba['push'](_0x483dba['shift']());}};_0x15b8c7(++_0x1a3942);}(_0x84ed,0x1e3));var _0xd84e=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x84ed[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xd84e('0x0'));var util=require(_0xd84e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd84e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd84e('0x3'))(_0xd84e('0x4'));var config=require(_0xd84e('0x5'));var jayson=require(_0xd84e('0x6'));var client=jayson[_0xd84e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dc7ea,_0x5d0c0f,_0x5e73b1){return new BPromise(function(_0x21ee26,_0x1961fa){return client['request'](_0x1dc7ea,_0x5e73b1)[_0xd84e('0x8')](function(_0x1ad446){logger[_0xd84e('0x9')](_0xd84e('0xa'),_0x5d0c0f,_0xd84e('0xb'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x5d0c0f,_0xd84e('0xb'),JSON[_0xd84e('0xc')](_0x1ad446));if(_0x1ad446[_0xd84e('0xd')]){if(_0x1ad446['error'][_0xd84e('0xe')]===0x1f4){logger[_0xd84e('0xd')](_0xd84e('0xa'),_0x5d0c0f,_0x1ad446[_0xd84e('0xd')][_0xd84e('0xf')]);return _0x1961fa(_0x1ad446['error'][_0xd84e('0xf')]);}logger['error'](_0xd84e('0xa'),_0x5d0c0f,_0x1ad446[_0xd84e('0xd')][_0xd84e('0xf')]);return _0x21ee26(_0x1ad446[_0xd84e('0xd')][_0xd84e('0xf')]);}else{logger[_0xd84e('0x9')](_0xd84e('0xa'),_0x5d0c0f,'request\x20sent');_0x21ee26(_0x1ad446[_0xd84e('0x10')][_0xd84e('0xf')]);}})['catch'](function(_0xa80dfc){logger[_0xd84e('0xd')](_0xd84e('0xa'),_0x5d0c0f,_0xa80dfc);_0x1961fa(_0xa80dfc);});});}exports[_0xd84e('0x11')]=function(_0xcf8984){var _0x480734=this;return new Promise(function(_0x94877b,_0x275315){return db[_0xd84e('0x12')][_0xd84e('0x13')]({'raw':_0xcf8984[_0xd84e('0x14')]?_0xcf8984['options'][_0xd84e('0x15')]===undefined?!![]:![]:!![],'where':_0xcf8984[_0xd84e('0x14')]?_0xcf8984['options']['where']||null:null,'attributes':_0xcf8984[_0xd84e('0x14')]?_0xcf8984['options'][_0xd84e('0x16')]||null:null,'limit':_0xcf8984[_0xd84e('0x14')]?_0xcf8984[_0xd84e('0x14')][_0xd84e('0x17')]||null:null,'include':_0xcf8984['options']?_0xcf8984['options'][_0xd84e('0x18')]?_['map'](_0xcf8984[_0xd84e('0x14')][_0xd84e('0x18')],function(_0x2bdc76){return{'model':db[_0x2bdc76[_0xd84e('0x19')]],'as':_0x2bdc76['as'],'attributes':_0x2bdc76[_0xd84e('0x16')],'include':_0x2bdc76[_0xd84e('0x18')]?_[_0xd84e('0x1a')](_0x2bdc76[_0xd84e('0x18')],function(_0x455cae){return{'model':db[_0x455cae[_0xd84e('0x19')]],'as':_0x455cae['as'],'attributes':_0x455cae[_0xd84e('0x16')],'include':_0x455cae[_0xd84e('0x18')]?_[_0xd84e('0x1a')](_0x455cae['include'],function(_0x1c6dcf){return{'model':db[_0x1c6dcf['model']],'as':_0x1c6dcf['as'],'attributes':_0x1c6dcf[_0xd84e('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd84e('0x8')](function(_0x4103a5){logger[_0xd84e('0x9')]('GetSugarcrmAccount',_0xcf8984);logger[_0xd84e('0x1b')](_0xd84e('0x11'),_0xcf8984,JSON['stringify'](_0x4103a5));_0x94877b(_0x4103a5);})[_0xd84e('0x1c')](function(_0x5ee67b){logger[_0xd84e('0xd')](_0xd84e('0x11'),_0x5ee67b[_0xd84e('0xf')],_0xcf8984);_0x275315(_0x480734['error'](0x1f4,_0x5ee67b[_0xd84e('0xf')]));});});};exports[_0xd84e('0x1d')]=function(_0x1f4b5d){var _0x4e25a4=this;return new Promise(function(_0x29b44c,_0x53ce4b){return db['SugarcrmAccount'][_0xd84e('0x1e')]({'raw':_0x1f4b5d['options']?_0x1f4b5d[_0xd84e('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x1f4b5d[_0xd84e('0x14')]?_0x1f4b5d[_0xd84e('0x14')]['where']||null:null,'attributes':_0x1f4b5d['options']?_0x1f4b5d['options'][_0xd84e('0x16')]||null:null,'include':_0x1f4b5d[_0xd84e('0x14')]?_0x1f4b5d[_0xd84e('0x14')][_0xd84e('0x18')]?_[_0xd84e('0x1a')](_0x1f4b5d[_0xd84e('0x14')][_0xd84e('0x18')],function(_0x393c09){return{'model':db[_0x393c09[_0xd84e('0x19')]],'as':_0x393c09['as'],'attributes':_0x393c09['attributes'],'include':_0x393c09[_0xd84e('0x18')]?_[_0xd84e('0x1a')](_0x393c09['include'],function(_0x6317dd){return{'model':db[_0x6317dd[_0xd84e('0x19')]],'as':_0x6317dd['as'],'attributes':_0x6317dd[_0xd84e('0x16')],'include':_0x6317dd['include']?_[_0xd84e('0x1a')](_0x6317dd[_0xd84e('0x18')],function(_0x4b2610){return{'model':db[_0x4b2610[_0xd84e('0x19')]],'as':_0x4b2610['as'],'attributes':_0x4b2610[_0xd84e('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd84e('0x8')](function(_0x211d2e){logger['info']('ShowSugarcrmAccount',_0x1f4b5d);logger[_0xd84e('0x1b')](_0xd84e('0x1d'),_0x1f4b5d,JSON['stringify'](_0x211d2e));_0x29b44c(_0x211d2e);})['catch'](function(_0x20e52e){logger[_0xd84e('0xd')](_0xd84e('0x1d'),_0x20e52e['message'],_0x1f4b5d);_0x53ce4b(_0x4e25a4[_0xd84e('0xd')](0x1f4,_0x20e52e[_0xd84e('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 97a70a6..57ebca1 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 _0x9571=['index','/:id','getFields','getSubjects','getDescriptions','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated'];(function(_0x1ed609,_0x4fa79b){var _0x3da1c9=function(_0x5b03c5){while(--_0x5b03c5){_0x1ed609['push'](_0x1ed609['shift']());}};_0x3da1c9(++_0x4fa79b);}(_0x9571,0x1c2));var _0x1957=function(_0x1b8a6c,_0x4c2a5f){_0x1b8a6c=_0x1b8a6c-0x0;var _0x13ec3b=_0x9571[_0x1b8a6c];return _0x13ec3b;};'use strict';var multer=require(_0x1957('0x0'));var util=require(_0x1957('0x1'));var path=require(_0x1957('0x2'));var timeout=require(_0x1957('0x3'));var express=require(_0x1957('0x4'));var router=express[_0x1957('0x5')]();var fs_extra=require(_0x1957('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1957('0x7'));var config=require(_0x1957('0x8'));var controller=require(_0x1957('0x9'));router[_0x1957('0xa')]('/',auth[_0x1957('0xb')](),controller[_0x1957('0xc')]);router[_0x1957('0xa')](_0x1957('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x1957('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1957('0xe')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x1957('0xf')]);router[_0x1957('0xa')]('/:id/descriptions',auth[_0x1957('0xb')](),controller[_0x1957('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1957('0x11')]);router[_0x1957('0x12')](_0x1957('0xd'),auth['isAuthenticated'](),controller[_0x1957('0x13')]);router[_0x1957('0x14')](_0x1957('0xd'),auth[_0x1957('0xb')](),controller['destroy']);module[_0x1957('0x15')]=router; \ No newline at end of file +var _0x6057=['delete','/:id','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update'];(function(_0x571350,_0x576cf1){var _0x5f1394=function(_0x2444cd){while(--_0x2444cd){_0x571350['push'](_0x571350['shift']());}};_0x5f1394(++_0x576cf1);}(_0x6057,0x71));var _0x7605=function(_0x53afe9,_0x2c9f40){_0x53afe9=_0x53afe9-0x0;var _0x396396=_0x6057[_0x53afe9];return _0x396396;};'use strict';var multer=require(_0x7605('0x0'));var util=require(_0x7605('0x1'));var path=require(_0x7605('0x2'));var timeout=require(_0x7605('0x3'));var express=require(_0x7605('0x4'));var router=express['Router']();var fs_extra=require(_0x7605('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7605('0x6'));var config=require('../../config/environment');var controller=require(_0x7605('0x7'));router[_0x7605('0x8')]('/',auth[_0x7605('0x9')](),controller['index']);router[_0x7605('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7605('0xa')]);router[_0x7605('0x8')](_0x7605('0xb'),auth[_0x7605('0x9')](),controller[_0x7605('0xc')]);router['get'](_0x7605('0xd'),auth[_0x7605('0x9')](),controller['getSubjects']);router['get'](_0x7605('0xe'),auth['isAuthenticated'](),controller[_0x7605('0xf')]);router[_0x7605('0x10')]('/',auth[_0x7605('0x9')](),controller[_0x7605('0x11')]);router['put']('/:id',auth[_0x7605('0x9')](),controller[_0x7605('0x12')]);router[_0x7605('0x13')](_0x7605('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0x7605('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 16ea4bf..6eb4007 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 _0x51f9=['exports','STRING','sequelize'];(function(_0x5e5c7b,_0x2495a3){var _0x3f947f=function(_0x29bca5){while(--_0x29bca5){_0x5e5c7b['push'](_0x5e5c7b['shift']());}};_0x3f947f(++_0x2495a3);}(_0x51f9,0x146));var _0x951f=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0x51f9[_0x34eb31];return _0x254994;};'use strict';var Sequelize=require(_0x951f('0x0'));module[_0x951f('0x1')]={'name':{'type':Sequelize[_0x951f('0x2')]},'description':{'type':Sequelize[_0x951f('0x2')]}}; \ No newline at end of file +var _0x33bd=['sequelize','exports','STRING'];(function(_0x10dd07,_0x1455f1){var _0xe697b7=function(_0xef62a9){while(--_0xef62a9){_0x10dd07['push'](_0x10dd07['shift']());}};_0xe697b7(++_0x1455f1);}(_0x33bd,0x19e));var _0xd33b=function(_0x472612,_0x4e8b56){_0x472612=_0x472612-0x0;var _0x2c0fb8=_0x33bd[_0x472612];return _0x2c0fb8;};'use strict';var Sequelize=require(_0xd33b('0x0'));module[_0xd33b('0x1')]={'name':{'type':Sequelize[_0xd33b('0x2')]},'description':{'type':Sequelize[_0xd33b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 3ef06cf..e26fc7c 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 _0xbfb4=['hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','destroy','getFields','findOne','SugarcrmField','fields','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','key','model','keys','query','intersection','attributes','length'];(function(_0x32d75d,_0x5b44ea){var _0x19abb5=function(_0x19c779){while(--_0x19c779){_0x32d75d['push'](_0x32d75d['shift']());}};_0x19abb5(++_0x5b44ea);}(_0xbfb4,0x170));var _0x4bfb=function(_0x4bc02b,_0x254107){_0x4bc02b=_0x4bc02b-0x0;var _0xd56bd3=_0xbfb4[_0x4bc02b];return _0xd56bd3;};'use strict';var emlformat=require(_0x4bfb('0x0'));var rimraf=require(_0x4bfb('0x1'));var zipdir=require(_0x4bfb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4bfb('0x3'));var moment=require(_0x4bfb('0x4'));var BPromise=require(_0x4bfb('0x5'));var Mustache=require(_0x4bfb('0x6'));var util=require('util');var path=require(_0x4bfb('0x7'));var sox=require(_0x4bfb('0x8'));var csv=require(_0x4bfb('0x9'));var ejs=require(_0x4bfb('0xa'));var fs=require('fs');var fs_extra=require(_0x4bfb('0xb'));var _=require(_0x4bfb('0xc'));var squel=require(_0x4bfb('0xd'));var crypto=require('crypto');var jsforce=require(_0x4bfb('0xe'));var deskjs=require(_0x4bfb('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4bfb('0x10'));var Redis=require(_0x4bfb('0x11'));var authService=require(_0x4bfb('0x12'));var qs=require(_0x4bfb('0x13'));var as=require(_0x4bfb('0x14'));var hardwareService=require(_0x4bfb('0x15'));var logger=require(_0x4bfb('0x16'))(_0x4bfb('0x17'));var utils=require(_0x4bfb('0x18'));var config=require(_0x4bfb('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4bfb('0x1a'))['db'];function respondWithStatusCode(_0x272a4b,_0x1e3ed1){_0x1e3ed1=_0x1e3ed1||0xcc;return function(_0x27911d){if(_0x27911d){return _0x272a4b['sendStatus'](_0x1e3ed1);}return _0x272a4b[_0x4bfb('0x1b')](_0x1e3ed1)['end']();};}function respondWithResult(_0x43580a,_0xf3afba){_0xf3afba=_0xf3afba||0xc8;return function(_0x58e027){if(_0x58e027){return _0x43580a[_0x4bfb('0x1b')](_0xf3afba)[_0x4bfb('0x1c')](_0x58e027);}};}function respondWithFilteredResult(_0x1ab93f,_0x3e6e82){return function(_0x25dbab){if(_0x25dbab){var _0x30beea=typeof _0x3e6e82[_0x4bfb('0x1d')]===_0x4bfb('0x1e')&&typeof _0x3e6e82[_0x4bfb('0x1f')]==='undefined';var _0x11e73e=_0x25dbab[_0x4bfb('0x20')];var _0x55a3e0=_0x30beea?0x0:_0x3e6e82[_0x4bfb('0x1d')];var _0x4e1899=_0x30beea?_0x25dbab[_0x4bfb('0x20')]:_0x3e6e82['offset']+_0x3e6e82[_0x4bfb('0x1f')];var _0x86a61c;if(_0x4e1899>=_0x11e73e){_0x4e1899=_0x11e73e;_0x86a61c=0xc8;}else{_0x86a61c=0xce;}_0x1ab93f[_0x4bfb('0x1b')](_0x86a61c);return _0x1ab93f[_0x4bfb('0x21')](_0x4bfb('0x22'),_0x55a3e0+'-'+_0x4e1899+'/'+_0x11e73e)[_0x4bfb('0x1c')](_0x25dbab);}return null;};}function patchUpdates(_0x2541c7){return function(_0x349c29){try{jsonpatch[_0x4bfb('0x23')](_0x349c29,_0x2541c7,!![]);}catch(_0x646e24){return BPromise[_0x4bfb('0x24')](_0x646e24);}return _0x349c29[_0x4bfb('0x25')]();};}function saveUpdates(_0x4a5b74,_0x4db481){return function(_0x824aa8){if(_0x824aa8){return _0x824aa8[_0x4bfb('0x26')](_0x4a5b74)[_0x4bfb('0x27')](function(_0x3b0d1f){return _0x3b0d1f;});}return null;};}function removeEntity(_0x58af4e,_0x15184c){return function(_0xba7cfc){if(_0xba7cfc){return _0xba7cfc['destroy']()[_0x4bfb('0x27')](function(){_0x58af4e[_0x4bfb('0x1b')](0xcc)[_0x4bfb('0x28')]();});}};}function handleEntityNotFound(_0xc30732,_0xe8f58d){return function(_0x430f46){if(!_0x430f46){_0xc30732[_0x4bfb('0x29')](0x194);}return _0x430f46;};}function handleError(_0x175065,_0x549d7f){_0x549d7f=_0x549d7f||0x1f4;return function(_0x2576fa){logger[_0x4bfb('0x2a')](_0x2576fa[_0x4bfb('0x2b')]);if(_0x2576fa['name']){delete _0x2576fa[_0x4bfb('0x2c')];}_0x175065[_0x4bfb('0x1b')](_0x549d7f)[_0x4bfb('0x2d')](_0x2576fa);};}exports[_0x4bfb('0x2e')]=function(_0x425753,_0x343ee9){var _0x37f88d={},_0x4d5a99={},_0x44ba0b={'count':0x0,'rows':[]};var _0x58f4c9=_[_0x4bfb('0x2f')](db[_0x4bfb('0x30')][_0x4bfb('0x31')],function(_0x5bc7c1){return{'name':_0x5bc7c1['fieldName'],'type':_0x5bc7c1['type'][_0x4bfb('0x32')]};});_0x4d5a99[_0x4bfb('0x33')]=_['map'](_0x58f4c9,_0x4bfb('0x2c'));_0x4d5a99['query']=_[_0x4bfb('0x34')](_0x425753[_0x4bfb('0x35')]);_0x4d5a99['filters']=_[_0x4bfb('0x36')](_0x4d5a99[_0x4bfb('0x33')],_0x4d5a99[_0x4bfb('0x35')]);_0x37f88d['attributes']=_[_0x4bfb('0x36')](_0x4d5a99[_0x4bfb('0x33')],qs['fields'](_0x425753[_0x4bfb('0x35')]['fields']));_0x37f88d['attributes']=_0x37f88d[_0x4bfb('0x37')][_0x4bfb('0x38')]?_0x37f88d['attributes']:_0x4d5a99[_0x4bfb('0x33')];if(!_0x425753[_0x4bfb('0x35')][_0x4bfb('0x39')](_0x4bfb('0x3a'))){_0x37f88d[_0x4bfb('0x1f')]=qs[_0x4bfb('0x1f')](_0x425753['query'][_0x4bfb('0x1f')]);_0x37f88d['offset']=qs[_0x4bfb('0x1d')](_0x425753[_0x4bfb('0x35')]['offset']);}_0x37f88d['order']=qs[_0x4bfb('0x3b')](_0x425753['query'][_0x4bfb('0x3b')]);_0x37f88d['where']=qs[_0x4bfb('0x3c')](_[_0x4bfb('0x3d')](_0x425753[_0x4bfb('0x35')],_0x4d5a99[_0x4bfb('0x3c')]),_0x58f4c9);if(_0x425753[_0x4bfb('0x35')]['filter']){_0x37f88d[_0x4bfb('0x3e')]=_[_0x4bfb('0x3f')](_0x37f88d['where'],{'$or':_[_0x4bfb('0x2f')](_0x58f4c9,function(_0x2f4a8a){if(_0x2f4a8a['type']!==_0x4bfb('0x40')){var _0x276e4b={};_0x276e4b[_0x2f4a8a[_0x4bfb('0x2c')]]={'$like':'%'+_0x425753[_0x4bfb('0x35')][_0x4bfb('0x41')]+'%'};return _0x276e4b;}})});}_0x37f88d=_[_0x4bfb('0x3f')]({},_0x37f88d,_0x425753[_0x4bfb('0x42')]);var _0x1d1c40={'where':_0x37f88d[_0x4bfb('0x3e')]};return db[_0x4bfb('0x30')][_0x4bfb('0x20')](_0x1d1c40)['then'](function(_0x5c62e3){_0x44ba0b[_0x4bfb('0x20')]=_0x5c62e3;if(_0x425753[_0x4bfb('0x35')][_0x4bfb('0x43')]){_0x37f88d['include']=[{'all':!![]}];}return db[_0x4bfb('0x30')][_0x4bfb('0x44')](_0x37f88d);})['then'](function(_0x1c8e11){_0x44ba0b[_0x4bfb('0x45')]=_0x1c8e11;return _0x44ba0b;})[_0x4bfb('0x27')](respondWithFilteredResult(_0x343ee9,_0x37f88d))['catch'](handleError(_0x343ee9,null));};exports[_0x4bfb('0x46')]=function(_0x472e80,_0x11bc0a){var _0xcf8217={'raw':![],'where':{'id':_0x472e80[_0x4bfb('0x47')]['id']}},_0x3f7b83={};_0x3f7b83[_0x4bfb('0x33')]=_[_0x4bfb('0x34')](db[_0x4bfb('0x30')]['rawAttributes']);_0x3f7b83[_0x4bfb('0x35')]=_[_0x4bfb('0x34')](_0x472e80[_0x4bfb('0x35')]);_0x3f7b83[_0x4bfb('0x3c')]=_[_0x4bfb('0x36')](_0x3f7b83['model'],_0x3f7b83[_0x4bfb('0x35')]);_0xcf8217[_0x4bfb('0x37')]=_['intersection'](_0x3f7b83[_0x4bfb('0x33')],qs['fields'](_0x472e80['query']['fields']));_0xcf8217[_0x4bfb('0x37')]=_0xcf8217[_0x4bfb('0x37')][_0x4bfb('0x38')]?_0xcf8217['attributes']:_0x3f7b83[_0x4bfb('0x33')];if(_0x472e80[_0x4bfb('0x35')][_0x4bfb('0x43')]){_0xcf8217[_0x4bfb('0x48')]=[{'all':!![]}];}_0xcf8217=_['merge']({},_0xcf8217,_0x472e80['options']);return db[_0x4bfb('0x30')][_0x4bfb('0x49')](_0xcf8217)[_0x4bfb('0x27')](handleEntityNotFound(_0x11bc0a,null))['then'](respondWithResult(_0x11bc0a,null))[_0x4bfb('0x4a')](handleError(_0x11bc0a,null));};exports[_0x4bfb('0x4b')]=function(_0x3b2dde,_0x2d7310){return db[_0x4bfb('0x30')]['create'](_0x3b2dde['body'],{})[_0x4bfb('0x27')](respondWithResult(_0x2d7310,0xc9))[_0x4bfb('0x4a')](handleError(_0x2d7310,null));};exports['update']=function(_0x355805,_0x647474){if(_0x355805[_0x4bfb('0x4c')]['id']){delete _0x355805[_0x4bfb('0x4c')]['id'];}return db[_0x4bfb('0x30')][_0x4bfb('0x49')]({'where':{'id':_0x355805[_0x4bfb('0x47')]['id']}})['then'](handleEntityNotFound(_0x647474,null))['then'](saveUpdates(_0x355805[_0x4bfb('0x4c')],null))[_0x4bfb('0x27')](respondWithResult(_0x647474,null))['catch'](handleError(_0x647474,null));};exports[_0x4bfb('0x4d')]=function(_0xa7592b,_0x4fff05){return db[_0x4bfb('0x30')]['find']({'where':{'id':_0xa7592b[_0x4bfb('0x47')]['id']}})[_0x4bfb('0x27')](handleEntityNotFound(_0x4fff05,null))[_0x4bfb('0x27')](removeEntity(_0x4fff05,null))['catch'](handleError(_0x4fff05,null));};exports[_0x4bfb('0x4e')]=function(_0x4f9add,_0x4062de,_0x3dc5a4){var _0x27ae4b={};var _0x53aa5a={};var _0x1fd2ef;var _0x407b7d;return db[_0x4bfb('0x30')][_0x4bfb('0x4f')]({'where':{'id':_0x4f9add[_0x4bfb('0x47')]['id']}})[_0x4bfb('0x27')](handleEntityNotFound(_0x4062de,null))[_0x4bfb('0x27')](function(_0x45758a){if(_0x45758a){_0x1fd2ef=_0x45758a;_0x53aa5a[_0x4bfb('0x33')]=_[_0x4bfb('0x34')](db[_0x4bfb('0x50')][_0x4bfb('0x31')]);_0x53aa5a[_0x4bfb('0x35')]=_[_0x4bfb('0x34')](_0x4f9add['query']);_0x53aa5a[_0x4bfb('0x3c')]=_[_0x4bfb('0x36')](_0x53aa5a['model'],_0x53aa5a['query']);_0x27ae4b['attributes']=_[_0x4bfb('0x36')](_0x53aa5a[_0x4bfb('0x33')],qs[_0x4bfb('0x51')](_0x4f9add[_0x4bfb('0x35')][_0x4bfb('0x51')]));_0x27ae4b[_0x4bfb('0x37')]=_0x27ae4b['attributes'][_0x4bfb('0x38')]?_0x27ae4b[_0x4bfb('0x37')]:_0x53aa5a[_0x4bfb('0x33')];_0x27ae4b[_0x4bfb('0x52')]=qs[_0x4bfb('0x3b')](_0x4f9add['query'][_0x4bfb('0x3b')]);_0x27ae4b[_0x4bfb('0x3e')]=qs[_0x4bfb('0x3c')](_[_0x4bfb('0x3d')](_0x4f9add['query'],_0x53aa5a[_0x4bfb('0x3c')]));if(_0x4f9add[_0x4bfb('0x35')]['filter']){_0x27ae4b[_0x4bfb('0x3e')]=_[_0x4bfb('0x3f')](_0x27ae4b[_0x4bfb('0x3e')],{'$or':_[_0x4bfb('0x2f')](_0x27ae4b[_0x4bfb('0x37')],function(_0x483815){var _0x2ec755={};_0x2ec755[_0x483815]={'$like':'%'+_0x4f9add[_0x4bfb('0x35')][_0x4bfb('0x41')]+'%'};return _0x2ec755;})});}_0x27ae4b=_[_0x4bfb('0x3f')]({},_0x27ae4b,_0x4f9add['options']);return _0x1fd2ef['getFields'](_0x27ae4b);}})[_0x4bfb('0x27')](function(_0x52f10f){if(_0x52f10f){_0x407b7d=_0x52f10f[_0x4bfb('0x38')];if(!_0x4f9add[_0x4bfb('0x35')][_0x4bfb('0x39')]('nolimit')){_0x27ae4b[_0x4bfb('0x1f')]=qs[_0x4bfb('0x1f')](_0x4f9add[_0x4bfb('0x35')][_0x4bfb('0x1f')]);_0x27ae4b[_0x4bfb('0x1d')]=qs[_0x4bfb('0x1d')](_0x4f9add[_0x4bfb('0x35')]['offset']);}return _0x1fd2ef['getFields'](_0x27ae4b);}})[_0x4bfb('0x27')](function(_0x30de67){if(_0x30de67){return _0x30de67?{'count':_0x407b7d,'rows':_0x30de67}:null;}})['then'](respondWithResult(_0x4062de,null))['catch'](handleError(_0x4062de,null));};exports['getSubjects']=function(_0x293540,_0x5b5b71,_0x779f43){var _0x30921d={};var _0x39de89={};var _0x66f7d8;var _0x38dd68;return db[_0x4bfb('0x30')]['findOne']({'where':{'id':_0x293540[_0x4bfb('0x47')]['id']}})[_0x4bfb('0x27')](handleEntityNotFound(_0x5b5b71,null))[_0x4bfb('0x27')](function(_0x4ef9dc){if(_0x4ef9dc){_0x66f7d8=_0x4ef9dc;_0x39de89[_0x4bfb('0x33')]=_[_0x4bfb('0x34')](db[_0x4bfb('0x50')][_0x4bfb('0x31')]);_0x39de89[_0x4bfb('0x35')]=_[_0x4bfb('0x34')](_0x293540['query']);_0x39de89[_0x4bfb('0x3c')]=_[_0x4bfb('0x36')](_0x39de89['model'],_0x39de89['query']);_0x30921d['attributes']=_[_0x4bfb('0x36')](_0x39de89[_0x4bfb('0x33')],qs['fields'](_0x293540[_0x4bfb('0x35')][_0x4bfb('0x51')]));_0x30921d[_0x4bfb('0x37')]=_0x30921d['attributes']['length']?_0x30921d[_0x4bfb('0x37')]:_0x39de89['model'];_0x30921d[_0x4bfb('0x52')]=qs[_0x4bfb('0x3b')](_0x293540[_0x4bfb('0x35')][_0x4bfb('0x3b')]);_0x30921d['where']=qs[_0x4bfb('0x3c')](_[_0x4bfb('0x3d')](_0x293540[_0x4bfb('0x35')],_0x39de89[_0x4bfb('0x3c')]));if(_0x293540['query'][_0x4bfb('0x41')]){_0x30921d[_0x4bfb('0x3e')]=_[_0x4bfb('0x3f')](_0x30921d['where'],{'$or':_[_0x4bfb('0x2f')](_0x30921d[_0x4bfb('0x37')],function(_0x138fb8){var _0x4d3505={};_0x4d3505[_0x138fb8]={'$like':'%'+_0x293540[_0x4bfb('0x35')]['filter']+'%'};return _0x4d3505;})});}_0x30921d=_[_0x4bfb('0x3f')]({},_0x30921d,_0x293540[_0x4bfb('0x42')]);return _0x66f7d8[_0x4bfb('0x53')](_0x30921d);}})[_0x4bfb('0x27')](function(_0x5e0793){if(_0x5e0793){_0x38dd68=_0x5e0793[_0x4bfb('0x38')];if(!_0x293540[_0x4bfb('0x35')][_0x4bfb('0x39')](_0x4bfb('0x3a'))){_0x30921d[_0x4bfb('0x1f')]=qs['limit'](_0x293540[_0x4bfb('0x35')][_0x4bfb('0x1f')]);_0x30921d['offset']=qs['offset'](_0x293540['query'][_0x4bfb('0x1d')]);}return _0x66f7d8[_0x4bfb('0x53')](_0x30921d);}})[_0x4bfb('0x27')](function(_0x5865ec){if(_0x5865ec){return _0x5865ec?{'count':_0x38dd68,'rows':_0x5865ec}:null;}})[_0x4bfb('0x27')](respondWithResult(_0x5b5b71,null))[_0x4bfb('0x4a')](handleError(_0x5b5b71,null));};exports[_0x4bfb('0x54')]=function(_0x23c5d6,_0x14d682,_0x1ccf89){var _0x5985e1={};var _0x2021ca={};var _0x22bc85;var _0x12dfc5;return db[_0x4bfb('0x30')][_0x4bfb('0x4f')]({'where':{'id':_0x23c5d6[_0x4bfb('0x47')]['id']}})[_0x4bfb('0x27')](handleEntityNotFound(_0x14d682,null))['then'](function(_0x45131f){if(_0x45131f){_0x22bc85=_0x45131f;_0x2021ca['model']=_[_0x4bfb('0x34')](db[_0x4bfb('0x50')][_0x4bfb('0x31')]);_0x2021ca[_0x4bfb('0x35')]=_[_0x4bfb('0x34')](_0x23c5d6[_0x4bfb('0x35')]);_0x2021ca[_0x4bfb('0x3c')]=_[_0x4bfb('0x36')](_0x2021ca['model'],_0x2021ca[_0x4bfb('0x35')]);_0x5985e1['attributes']=_[_0x4bfb('0x36')](_0x2021ca[_0x4bfb('0x33')],qs['fields'](_0x23c5d6['query'][_0x4bfb('0x51')]));_0x5985e1[_0x4bfb('0x37')]=_0x5985e1['attributes'][_0x4bfb('0x38')]?_0x5985e1['attributes']:_0x2021ca[_0x4bfb('0x33')];_0x5985e1[_0x4bfb('0x52')]=qs[_0x4bfb('0x3b')](_0x23c5d6[_0x4bfb('0x35')][_0x4bfb('0x3b')]);_0x5985e1[_0x4bfb('0x3e')]=qs[_0x4bfb('0x3c')](_[_0x4bfb('0x3d')](_0x23c5d6[_0x4bfb('0x35')],_0x2021ca['filters']));if(_0x23c5d6['query'][_0x4bfb('0x41')]){_0x5985e1[_0x4bfb('0x3e')]=_[_0x4bfb('0x3f')](_0x5985e1['where'],{'$or':_[_0x4bfb('0x2f')](_0x5985e1['attributes'],function(_0x4f28cc){var _0x509aa0={};_0x509aa0[_0x4f28cc]={'$like':'%'+_0x23c5d6['query']['filter']+'%'};return _0x509aa0;})});}_0x5985e1=_[_0x4bfb('0x3f')]({},_0x5985e1,_0x23c5d6[_0x4bfb('0x42')]);return _0x22bc85['getDescriptions'](_0x5985e1);}})['then'](function(_0x5388f7){if(_0x5388f7){_0x12dfc5=_0x5388f7[_0x4bfb('0x38')];if(!_0x23c5d6[_0x4bfb('0x35')]['hasOwnProperty'](_0x4bfb('0x3a'))){_0x5985e1['limit']=qs['limit'](_0x23c5d6['query'][_0x4bfb('0x1f')]);_0x5985e1[_0x4bfb('0x1d')]=qs[_0x4bfb('0x1d')](_0x23c5d6[_0x4bfb('0x35')][_0x4bfb('0x1d')]);}return _0x22bc85[_0x4bfb('0x54')](_0x5985e1);}})[_0x4bfb('0x27')](function(_0x13c01b){if(_0x13c01b){return _0x13c01b?{'count':_0x12dfc5,'rows':_0x13c01b}:null;}})[_0x4bfb('0x27')](respondWithResult(_0x14d682,null))[_0x4bfb('0x4a')](handleError(_0x14d682,null));}; \ No newline at end of file +var _0x01c0=['merge','includeAll','include','findAll','rows','catch','keys','rawAttributes','options','find','create','body','params','SugarcrmField','getFields','nolimit','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','map','SugarcrmConfiguration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x2ca090,_0x507fe9){var _0x3ae46b=function(_0x541cad){while(--_0x541cad){_0x2ca090['push'](_0x2ca090['shift']());}};_0x3ae46b(++_0x507fe9);}(_0x01c0,0x100));var _0x001c=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x01c0[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0x001c('0x0'));var rimraf=require(_0x001c('0x1'));var zipdir=require(_0x001c('0x2'));var jsonpatch=require(_0x001c('0x3'));var rp=require(_0x001c('0x4'));var moment=require('moment');var BPromise=require(_0x001c('0x5'));var Mustache=require('mustache');var util=require(_0x001c('0x6'));var path=require('path');var sox=require(_0x001c('0x7'));var csv=require(_0x001c('0x8'));var ejs=require(_0x001c('0x9'));var fs=require('fs');var fs_extra=require(_0x001c('0xa'));var _=require(_0x001c('0xb'));var squel=require(_0x001c('0xc'));var crypto=require(_0x001c('0xd'));var jsforce=require(_0x001c('0xe'));var deskjs=require(_0x001c('0xf'));var toCsv=require(_0x001c('0x8'));var querystring=require(_0x001c('0x10'));var Papa=require(_0x001c('0x11'));var Redis=require('ioredis');var authService=require(_0x001c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x001c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x001c('0x14'))(_0x001c('0x15'));var utils=require('../../config/utils');var config=require(_0x001c('0x16'));var licenseUtil=require(_0x001c('0x17'));var db=require(_0x001c('0x18'))['db'];function respondWithStatusCode(_0x33f02e,_0x2bc19a){_0x2bc19a=_0x2bc19a||0xcc;return function(_0x3b7525){if(_0x3b7525){return _0x33f02e[_0x001c('0x19')](_0x2bc19a);}return _0x33f02e[_0x001c('0x1a')](_0x2bc19a)['end']();};}function respondWithResult(_0x2d59ff,_0x23fb45){_0x23fb45=_0x23fb45||0xc8;return function(_0x29cd0d){if(_0x29cd0d){return _0x2d59ff[_0x001c('0x1a')](_0x23fb45)['json'](_0x29cd0d);}};}function respondWithFilteredResult(_0x48d381,_0x26f9c5){return function(_0x123480){if(_0x123480){var _0x50481f=typeof _0x26f9c5[_0x001c('0x1b')]===_0x001c('0x1c')&&typeof _0x26f9c5[_0x001c('0x1d')]===_0x001c('0x1c');var _0x58961e=_0x123480[_0x001c('0x1e')];var _0x1025f7=_0x50481f?0x0:_0x26f9c5['offset'];var _0x1c0dee=_0x50481f?_0x123480[_0x001c('0x1e')]:_0x26f9c5['offset']+_0x26f9c5[_0x001c('0x1d')];var _0xe32bd9;if(_0x1c0dee>=_0x58961e){_0x1c0dee=_0x58961e;_0xe32bd9=0xc8;}else{_0xe32bd9=0xce;}_0x48d381[_0x001c('0x1a')](_0xe32bd9);return _0x48d381['set'](_0x001c('0x1f'),_0x1025f7+'-'+_0x1c0dee+'/'+_0x58961e)[_0x001c('0x20')](_0x123480);}return null;};}function patchUpdates(_0x40870f){return function(_0x16cc38){try{jsonpatch[_0x001c('0x21')](_0x16cc38,_0x40870f,!![]);}catch(_0x361bfb){return BPromise[_0x001c('0x22')](_0x361bfb);}return _0x16cc38[_0x001c('0x23')]();};}function saveUpdates(_0x1e61ef,_0x1174bb){return function(_0x1125bc){if(_0x1125bc){return _0x1125bc[_0x001c('0x24')](_0x1e61ef)['then'](function(_0x7e6407){return _0x7e6407;});}return null;};}function removeEntity(_0x52391f,_0x2a38c9){return function(_0x298cd7){if(_0x298cd7){return _0x298cd7[_0x001c('0x25')]()[_0x001c('0x26')](function(){_0x52391f[_0x001c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bccd2,_0x1e5cf4){return function(_0x5ceb36){if(!_0x5ceb36){_0x5bccd2[_0x001c('0x19')](0x194);}return _0x5ceb36;};}function handleError(_0x120bac,_0x17bef7){_0x17bef7=_0x17bef7||0x1f4;return function(_0x5e15e2){logger[_0x001c('0x27')](_0x5e15e2[_0x001c('0x28')]);if(_0x5e15e2['name']){delete _0x5e15e2[_0x001c('0x29')];}_0x120bac[_0x001c('0x1a')](_0x17bef7)['send'](_0x5e15e2);};}exports['index']=function(_0x20e1ab,_0xc95f8e){var _0x3772ba={},_0x14ce03={},_0x118683={'count':0x0,'rows':[]};var _0x31c9cf=_[_0x001c('0x2a')](db[_0x001c('0x2b')]['rawAttributes'],function(_0x547de2){return{'name':_0x547de2[_0x001c('0x2c')],'type':_0x547de2[_0x001c('0x2d')][_0x001c('0x2e')]};});_0x14ce03[_0x001c('0x2f')]=_[_0x001c('0x2a')](_0x31c9cf,_0x001c('0x29'));_0x14ce03[_0x001c('0x30')]=_['keys'](_0x20e1ab['query']);_0x14ce03[_0x001c('0x31')]=_[_0x001c('0x32')](_0x14ce03['model'],_0x14ce03['query']);_0x3772ba[_0x001c('0x33')]=_['intersection'](_0x14ce03[_0x001c('0x2f')],qs[_0x001c('0x34')](_0x20e1ab[_0x001c('0x30')]['fields']));_0x3772ba['attributes']=_0x3772ba['attributes'][_0x001c('0x35')]?_0x3772ba['attributes']:_0x14ce03[_0x001c('0x2f')];if(!_0x20e1ab[_0x001c('0x30')][_0x001c('0x36')]('nolimit')){_0x3772ba[_0x001c('0x1d')]=qs[_0x001c('0x1d')](_0x20e1ab['query']['limit']);_0x3772ba[_0x001c('0x1b')]=qs['offset'](_0x20e1ab['query'][_0x001c('0x1b')]);}_0x3772ba[_0x001c('0x37')]=qs['sort'](_0x20e1ab[_0x001c('0x30')][_0x001c('0x38')]);_0x3772ba[_0x001c('0x39')]=qs[_0x001c('0x31')](_[_0x001c('0x3a')](_0x20e1ab[_0x001c('0x30')],_0x14ce03[_0x001c('0x31')]),_0x31c9cf);if(_0x20e1ab[_0x001c('0x30')][_0x001c('0x3b')]){_0x3772ba[_0x001c('0x39')]=_[_0x001c('0x3c')](_0x3772ba['where'],{'$or':_[_0x001c('0x2a')](_0x31c9cf,function(_0x242dd6){if(_0x242dd6[_0x001c('0x2d')]!=='VIRTUAL'){var _0x21cae3={};_0x21cae3[_0x242dd6['name']]={'$like':'%'+_0x20e1ab[_0x001c('0x30')]['filter']+'%'};return _0x21cae3;}})});}_0x3772ba=_[_0x001c('0x3c')]({},_0x3772ba,_0x20e1ab['options']);var _0x1b5866={'where':_0x3772ba[_0x001c('0x39')]};return db[_0x001c('0x2b')]['count'](_0x1b5866)[_0x001c('0x26')](function(_0x49317d){_0x118683[_0x001c('0x1e')]=_0x49317d;if(_0x20e1ab[_0x001c('0x30')][_0x001c('0x3d')]){_0x3772ba[_0x001c('0x3e')]=[{'all':!![]}];}return db[_0x001c('0x2b')][_0x001c('0x3f')](_0x3772ba);})[_0x001c('0x26')](function(_0x25bca6){_0x118683[_0x001c('0x40')]=_0x25bca6;return _0x118683;})[_0x001c('0x26')](respondWithFilteredResult(_0xc95f8e,_0x3772ba))[_0x001c('0x41')](handleError(_0xc95f8e,null));};exports['show']=function(_0x4cce45,_0x22ae4c){var _0xbef03c={'raw':![],'where':{'id':_0x4cce45['params']['id']}},_0x20d7a8={};_0x20d7a8[_0x001c('0x2f')]=_[_0x001c('0x42')](db[_0x001c('0x2b')][_0x001c('0x43')]);_0x20d7a8[_0x001c('0x30')]=_['keys'](_0x4cce45[_0x001c('0x30')]);_0x20d7a8[_0x001c('0x31')]=_[_0x001c('0x32')](_0x20d7a8['model'],_0x20d7a8[_0x001c('0x30')]);_0xbef03c[_0x001c('0x33')]=_[_0x001c('0x32')](_0x20d7a8[_0x001c('0x2f')],qs['fields'](_0x4cce45[_0x001c('0x30')][_0x001c('0x34')]));_0xbef03c[_0x001c('0x33')]=_0xbef03c[_0x001c('0x33')][_0x001c('0x35')]?_0xbef03c[_0x001c('0x33')]:_0x20d7a8['model'];if(_0x4cce45[_0x001c('0x30')][_0x001c('0x3d')]){_0xbef03c[_0x001c('0x3e')]=[{'all':!![]}];}_0xbef03c=_[_0x001c('0x3c')]({},_0xbef03c,_0x4cce45[_0x001c('0x44')]);return db[_0x001c('0x2b')][_0x001c('0x45')](_0xbef03c)[_0x001c('0x26')](handleEntityNotFound(_0x22ae4c,null))[_0x001c('0x26')](respondWithResult(_0x22ae4c,null))['catch'](handleError(_0x22ae4c,null));};exports['create']=function(_0x2e588a,_0x2d1c78){return db[_0x001c('0x2b')][_0x001c('0x46')](_0x2e588a[_0x001c('0x47')],{})[_0x001c('0x26')](respondWithResult(_0x2d1c78,0xc9))[_0x001c('0x41')](handleError(_0x2d1c78,null));};exports[_0x001c('0x24')]=function(_0x15bc63,_0xaa6f0a){if(_0x15bc63[_0x001c('0x47')]['id']){delete _0x15bc63[_0x001c('0x47')]['id'];}return db['SugarcrmConfiguration'][_0x001c('0x45')]({'where':{'id':_0x15bc63[_0x001c('0x48')]['id']}})[_0x001c('0x26')](handleEntityNotFound(_0xaa6f0a,null))[_0x001c('0x26')](saveUpdates(_0x15bc63['body'],null))[_0x001c('0x26')](respondWithResult(_0xaa6f0a,null))[_0x001c('0x41')](handleError(_0xaa6f0a,null));};exports[_0x001c('0x25')]=function(_0x3c8878,_0x49c78d){return db[_0x001c('0x2b')][_0x001c('0x45')]({'where':{'id':_0x3c8878['params']['id']}})[_0x001c('0x26')](handleEntityNotFound(_0x49c78d,null))[_0x001c('0x26')](removeEntity(_0x49c78d,null))[_0x001c('0x41')](handleError(_0x49c78d,null));};exports['getFields']=function(_0x11cbb6,_0x371f17,_0xfd318e){var _0xc64eb1={};var _0x1a09a8={};var _0x4d06ae;var _0x2e231d;return db[_0x001c('0x2b')]['findOne']({'where':{'id':_0x11cbb6[_0x001c('0x48')]['id']}})[_0x001c('0x26')](handleEntityNotFound(_0x371f17,null))[_0x001c('0x26')](function(_0x4e3db6){if(_0x4e3db6){_0x4d06ae=_0x4e3db6;_0x1a09a8[_0x001c('0x2f')]=_[_0x001c('0x42')](db[_0x001c('0x49')][_0x001c('0x43')]);_0x1a09a8[_0x001c('0x30')]=_[_0x001c('0x42')](_0x11cbb6[_0x001c('0x30')]);_0x1a09a8[_0x001c('0x31')]=_['intersection'](_0x1a09a8[_0x001c('0x2f')],_0x1a09a8[_0x001c('0x30')]);_0xc64eb1[_0x001c('0x33')]=_['intersection'](_0x1a09a8[_0x001c('0x2f')],qs[_0x001c('0x34')](_0x11cbb6[_0x001c('0x30')]['fields']));_0xc64eb1[_0x001c('0x33')]=_0xc64eb1[_0x001c('0x33')][_0x001c('0x35')]?_0xc64eb1['attributes']:_0x1a09a8[_0x001c('0x2f')];_0xc64eb1[_0x001c('0x37')]=qs[_0x001c('0x38')](_0x11cbb6[_0x001c('0x30')][_0x001c('0x38')]);_0xc64eb1[_0x001c('0x39')]=qs['filters'](_[_0x001c('0x3a')](_0x11cbb6[_0x001c('0x30')],_0x1a09a8[_0x001c('0x31')]));if(_0x11cbb6[_0x001c('0x30')][_0x001c('0x3b')]){_0xc64eb1[_0x001c('0x39')]=_[_0x001c('0x3c')](_0xc64eb1[_0x001c('0x39')],{'$or':_['map'](_0xc64eb1['attributes'],function(_0x25aae8){var _0x18e844={};_0x18e844[_0x25aae8]={'$like':'%'+_0x11cbb6[_0x001c('0x30')]['filter']+'%'};return _0x18e844;})});}_0xc64eb1=_[_0x001c('0x3c')]({},_0xc64eb1,_0x11cbb6[_0x001c('0x44')]);return _0x4d06ae[_0x001c('0x4a')](_0xc64eb1);}})[_0x001c('0x26')](function(_0x4b64e2){if(_0x4b64e2){_0x2e231d=_0x4b64e2[_0x001c('0x35')];if(!_0x11cbb6[_0x001c('0x30')][_0x001c('0x36')](_0x001c('0x4b'))){_0xc64eb1[_0x001c('0x1d')]=qs[_0x001c('0x1d')](_0x11cbb6['query'][_0x001c('0x1d')]);_0xc64eb1['offset']=qs['offset'](_0x11cbb6[_0x001c('0x30')][_0x001c('0x1b')]);}return _0x4d06ae[_0x001c('0x4a')](_0xc64eb1);}})[_0x001c('0x26')](function(_0x21e602){if(_0x21e602){return _0x21e602?{'count':_0x2e231d,'rows':_0x21e602}:null;}})[_0x001c('0x26')](respondWithResult(_0x371f17,null))['catch'](handleError(_0x371f17,null));};exports[_0x001c('0x4c')]=function(_0x29cb56,_0x13d3d9,_0x49aa46){var _0x220631={};var _0x5ba514={};var _0x177831;var _0xae8aa9;return db[_0x001c('0x2b')][_0x001c('0x4d')]({'where':{'id':_0x29cb56[_0x001c('0x48')]['id']}})[_0x001c('0x26')](handleEntityNotFound(_0x13d3d9,null))[_0x001c('0x26')](function(_0x24cadd){if(_0x24cadd){_0x177831=_0x24cadd;_0x5ba514[_0x001c('0x2f')]=_[_0x001c('0x42')](db['SugarcrmField'][_0x001c('0x43')]);_0x5ba514[_0x001c('0x30')]=_['keys'](_0x29cb56['query']);_0x5ba514['filters']=_[_0x001c('0x32')](_0x5ba514['model'],_0x5ba514[_0x001c('0x30')]);_0x220631[_0x001c('0x33')]=_[_0x001c('0x32')](_0x5ba514[_0x001c('0x2f')],qs['fields'](_0x29cb56[_0x001c('0x30')][_0x001c('0x34')]));_0x220631['attributes']=_0x220631[_0x001c('0x33')]['length']?_0x220631['attributes']:_0x5ba514[_0x001c('0x2f')];_0x220631[_0x001c('0x37')]=qs[_0x001c('0x38')](_0x29cb56[_0x001c('0x30')][_0x001c('0x38')]);_0x220631['where']=qs[_0x001c('0x31')](_['pick'](_0x29cb56['query'],_0x5ba514[_0x001c('0x31')]));if(_0x29cb56[_0x001c('0x30')]['filter']){_0x220631['where']=_['merge'](_0x220631[_0x001c('0x39')],{'$or':_[_0x001c('0x2a')](_0x220631['attributes'],function(_0x41b149){var _0x360785={};_0x360785[_0x41b149]={'$like':'%'+_0x29cb56[_0x001c('0x30')][_0x001c('0x3b')]+'%'};return _0x360785;})});}_0x220631=_[_0x001c('0x3c')]({},_0x220631,_0x29cb56[_0x001c('0x44')]);return _0x177831[_0x001c('0x4c')](_0x220631);}})[_0x001c('0x26')](function(_0x35662f){if(_0x35662f){_0xae8aa9=_0x35662f[_0x001c('0x35')];if(!_0x29cb56[_0x001c('0x30')][_0x001c('0x36')](_0x001c('0x4b'))){_0x220631['limit']=qs[_0x001c('0x1d')](_0x29cb56[_0x001c('0x30')]['limit']);_0x220631[_0x001c('0x1b')]=qs[_0x001c('0x1b')](_0x29cb56[_0x001c('0x30')][_0x001c('0x1b')]);}return _0x177831[_0x001c('0x4c')](_0x220631);}})[_0x001c('0x26')](function(_0x14a7ad){if(_0x14a7ad){return _0x14a7ad?{'count':_0xae8aa9,'rows':_0x14a7ad}:null;}})['then'](respondWithResult(_0x13d3d9,null))['catch'](handleError(_0x13d3d9,null));};exports[_0x001c('0x4e')]=function(_0x455551,_0x1552ac,_0x1aedbf){var _0x2c3a37={};var _0x2682ff={};var _0x19c2dc;var _0x5a5082;return db[_0x001c('0x2b')][_0x001c('0x4d')]({'where':{'id':_0x455551[_0x001c('0x48')]['id']}})[_0x001c('0x26')](handleEntityNotFound(_0x1552ac,null))['then'](function(_0x764973){if(_0x764973){_0x19c2dc=_0x764973;_0x2682ff[_0x001c('0x2f')]=_[_0x001c('0x42')](db['SugarcrmField'][_0x001c('0x43')]);_0x2682ff[_0x001c('0x30')]=_[_0x001c('0x42')](_0x455551['query']);_0x2682ff['filters']=_[_0x001c('0x32')](_0x2682ff[_0x001c('0x2f')],_0x2682ff[_0x001c('0x30')]);_0x2c3a37['attributes']=_['intersection'](_0x2682ff['model'],qs['fields'](_0x455551['query'][_0x001c('0x34')]));_0x2c3a37[_0x001c('0x33')]=_0x2c3a37[_0x001c('0x33')][_0x001c('0x35')]?_0x2c3a37['attributes']:_0x2682ff[_0x001c('0x2f')];_0x2c3a37['order']=qs[_0x001c('0x38')](_0x455551[_0x001c('0x30')]['sort']);_0x2c3a37[_0x001c('0x39')]=qs[_0x001c('0x31')](_['pick'](_0x455551[_0x001c('0x30')],_0x2682ff[_0x001c('0x31')]));if(_0x455551[_0x001c('0x30')][_0x001c('0x3b')]){_0x2c3a37['where']=_[_0x001c('0x3c')](_0x2c3a37[_0x001c('0x39')],{'$or':_['map'](_0x2c3a37[_0x001c('0x33')],function(_0x2faaf3){var _0x510f4e={};_0x510f4e[_0x2faaf3]={'$like':'%'+_0x455551['query'][_0x001c('0x3b')]+'%'};return _0x510f4e;})});}_0x2c3a37=_[_0x001c('0x3c')]({},_0x2c3a37,_0x455551[_0x001c('0x44')]);return _0x19c2dc[_0x001c('0x4e')](_0x2c3a37);}})[_0x001c('0x26')](function(_0x37df41){if(_0x37df41){_0x5a5082=_0x37df41[_0x001c('0x35')];if(!_0x455551['query'][_0x001c('0x36')](_0x001c('0x4b'))){_0x2c3a37['limit']=qs[_0x001c('0x1d')](_0x455551[_0x001c('0x30')]['limit']);_0x2c3a37[_0x001c('0x1b')]=qs[_0x001c('0x1b')](_0x455551['query'][_0x001c('0x1b')]);}return _0x19c2dc[_0x001c('0x4e')](_0x2c3a37);}})[_0x001c('0x26')](function(_0x99293d){if(_0x99293d){return _0x99293d?{'count':_0x5a5082,'rows':_0x99293d}:null;}})['then'](respondWithResult(_0x1552ac,null))[_0x001c('0x41')](handleError(_0x1552ac,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 93de18f..307cb98 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 _0x58a8=['SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x58a8,0xda));var _0x858a=function(_0x9906ff,_0x471c43){_0x9906ff=_0x9906ff-0x0;var _0x143a16=_0x58a8[_0x9906ff];return _0x143a16;};'use strict';var _=require(_0x858a('0x0'));var util=require(_0x858a('0x1'));var logger=require(_0x858a('0x2'))(_0x858a('0x3'));var moment=require(_0x858a('0x4'));var BPromise=require('bluebird');var rp=require(_0x858a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x858a('0x6'));var attributes=require(_0x858a('0x7'));module[_0x858a('0x8')]=function(_0x51dbf8,_0x174a6d){return _0x51dbf8[_0x858a('0x9')](_0x858a('0xa'),attributes,{'tableName':_0x858a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x215f=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','../../config/logger','api','moment','bluebird','path'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x215f,0xab));var _0xf215=function(_0x4d048c,_0x11d5cb){_0x4d048c=_0x4d048c-0x0;var _0x1001af=_0x215f[_0x4d048c];return _0x1001af;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf215('0x0'))(_0xf215('0x1'));var moment=require(_0xf215('0x2'));var BPromise=require(_0xf215('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf215('0x4'));var rimraf=require(_0xf215('0x5'));var config=require(_0xf215('0x6'));var attributes=require(_0xf215('0x7'));module['exports']=function(_0x2f6fc2,_0x556621){return _0x2f6fc2[_0xf215('0x8')](_0xf215('0x9'),attributes,{'tableName':_0xf215('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 62e3827..d362704 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 _0xb93e=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2b7cec,_0x948c5d){var _0x5c7780=function(_0x3f3aac){while(--_0x3f3aac){_0x2b7cec['push'](_0x2b7cec['shift']());}};_0x5c7780(++_0x948c5d);}(_0xb93e,0x1b9));var _0xeb93=function(_0xf0e370,_0x1e6c42){_0xf0e370=_0xf0e370-0x0;var _0x174ca5=_0xb93e[_0xf0e370];return _0x174ca5;};'use strict';var _=require(_0xeb93('0x0'));var util=require(_0xeb93('0x1'));var moment=require(_0xeb93('0x2'));var BPromise=require(_0xeb93('0x3'));var rs=require(_0xeb93('0x4'));var fs=require('fs');var Redis=require(_0xeb93('0x5'));var db=require(_0xeb93('0x6'))['db'];var utils=require(_0xeb93('0x7'));var logger=require(_0xeb93('0x8'))('rpc');var config=require(_0xeb93('0x9'));var jayson=require(_0xeb93('0xa'));var client=jayson[_0xeb93('0xb')][_0xeb93('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x526076,_0x4300d6,_0x2d337a){return new BPromise(function(_0x5ebf05,_0x4f165e){return client['request'](_0x526076,_0x2d337a)[_0xeb93('0xd')](function(_0x389f2e){logger[_0xeb93('0xe')](_0xeb93('0xf'),_0x4300d6,_0xeb93('0x10'));logger['debug'](_0xeb93('0x11'),_0x4300d6,'request\x20sent',JSON[_0xeb93('0x12')](_0x389f2e));if(_0x389f2e['error']){if(_0x389f2e[_0xeb93('0x13')][_0xeb93('0x14')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4300d6,_0x389f2e[_0xeb93('0x13')][_0xeb93('0x15')]);return _0x4f165e(_0x389f2e[_0xeb93('0x13')][_0xeb93('0x15')]);}logger['error'](_0xeb93('0xf'),_0x4300d6,_0x389f2e[_0xeb93('0x13')][_0xeb93('0x15')]);return _0x5ebf05(_0x389f2e[_0xeb93('0x13')][_0xeb93('0x15')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4300d6,'request\x20sent');_0x5ebf05(_0x389f2e[_0xeb93('0x16')][_0xeb93('0x15')]);}})['catch'](function(_0x27f1fd){logger[_0xeb93('0x13')](_0xeb93('0xf'),_0x4300d6,_0x27f1fd);_0x4f165e(_0x27f1fd);});});} \ No newline at end of file +var _0xb8e5=['then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x19bf7d,_0x4b4b58){var _0x548354=function(_0x5ce5cb){while(--_0x5ce5cb){_0x19bf7d['push'](_0x19bf7d['shift']());}};_0x548354(++_0x4b4b58);}(_0xb8e5,0x1ad));var _0x5b8e=function(_0x2851d7,_0x4d945a){_0x2851d7=_0x2851d7-0x0;var _0x45b548=_0xb8e5[_0x2851d7];return _0x45b548;};'use strict';var _=require(_0x5b8e('0x0'));var util=require(_0x5b8e('0x1'));var moment=require(_0x5b8e('0x2'));var BPromise=require(_0x5b8e('0x3'));var rs=require(_0x5b8e('0x4'));var fs=require('fs');var Redis=require(_0x5b8e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b8e('0x6'))('rpc');var config=require(_0x5b8e('0x7'));var jayson=require(_0x5b8e('0x8'));var client=jayson[_0x5b8e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57af9e,_0x4f4bfb,_0x3298dc){return new BPromise(function(_0x12066c,_0x43a33d){return client[_0x5b8e('0xa')](_0x57af9e,_0x3298dc)[_0x5b8e('0xb')](function(_0x498d54){logger[_0x5b8e('0xc')](_0x5b8e('0xd'),_0x4f4bfb,_0x5b8e('0xe'));logger[_0x5b8e('0xf')](_0x5b8e('0x10'),_0x4f4bfb,_0x5b8e('0xe'),JSON['stringify'](_0x498d54));if(_0x498d54[_0x5b8e('0x11')]){if(_0x498d54[_0x5b8e('0x11')][_0x5b8e('0x12')]===0x1f4){logger[_0x5b8e('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4f4bfb,_0x498d54[_0x5b8e('0x11')]['message']);return _0x43a33d(_0x498d54[_0x5b8e('0x11')][_0x5b8e('0x13')]);}logger[_0x5b8e('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4f4bfb,_0x498d54['error'][_0x5b8e('0x13')]);return _0x12066c(_0x498d54[_0x5b8e('0x11')]['message']);}else{logger[_0x5b8e('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4f4bfb,_0x5b8e('0xe'));_0x12066c(_0x498d54[_0x5b8e('0x14')][_0x5b8e('0x13')]);}})[_0x5b8e('0x15')](function(_0x561598){logger[_0x5b8e('0x11')](_0x5b8e('0xd'),_0x4f4bfb,_0x561598);_0x43a33d(_0x561598);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 5a8726a..5349d19 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 _0xf562=['isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get'];(function(_0x187c0f,_0x30d4fd){var _0x1ce7d7=function(_0x5e8d34){while(--_0x5e8d34){_0x187c0f['push'](_0x187c0f['shift']());}};_0x1ce7d7(++_0x30d4fd);}(_0xf562,0x129));var _0x2f56=function(_0x33b718,_0x134497){_0x33b718=_0x33b718-0x0;var _0xb7e013=_0xf562[_0x33b718];return _0xb7e013;};'use strict';var multer=require(_0x2f56('0x0'));var util=require(_0x2f56('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2f56('0x2'));var router=express[_0x2f56('0x3')]();var fs_extra=require(_0x2f56('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2f56('0x5'));var config=require(_0x2f56('0x6'));var controller=require(_0x2f56('0x7'));router[_0x2f56('0x8')]('/',auth[_0x2f56('0x9')](),controller['index']);router[_0x2f56('0x8')]('/:id',auth[_0x2f56('0x9')](),controller[_0x2f56('0xa')]);router[_0x2f56('0xb')]('/',auth['isAuthenticated'](),controller[_0x2f56('0xc')]);router['put'](_0x2f56('0xd'),auth[_0x2f56('0x9')](),controller[_0x2f56('0xe')]);router[_0x2f56('0xf')](_0x2f56('0xd'),auth[_0x2f56('0x9')](),controller[_0x2f56('0x10')]);module[_0x2f56('0x11')]=router; \ No newline at end of file +var _0xc006=['show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xc006,0x14b));var _0x6c00=function(_0x171bef,_0x4cba08){_0x171bef=_0x171bef-0x0;var _0x28828a=_0xc006[_0x171bef];return _0x28828a;};'use strict';var multer=require(_0x6c00('0x0'));var util=require(_0x6c00('0x1'));var path=require(_0x6c00('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c00('0x3'));var router=express[_0x6c00('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6c00('0x5'));var config=require(_0x6c00('0x6'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0x6c00('0x7')](),controller[_0x6c00('0x8')]);router[_0x6c00('0x9')](_0x6c00('0xa'),auth[_0x6c00('0x7')](),controller[_0x6c00('0xb')]);router[_0x6c00('0xc')]('/',auth['isAuthenticated'](),controller[_0x6c00('0xd')]);router[_0x6c00('0xe')](_0x6c00('0xa'),auth['isAuthenticated'](),controller[_0x6c00('0xf')]);router[_0x6c00('0x10')](_0x6c00('0xa'),auth['isAuthenticated'](),controller[_0x6c00('0x11')]);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 0b9cce2..7f54fdd 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 _0x8a53=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x2977e8,_0x257939){var _0x9da807=function(_0x420d3f){while(--_0x420d3f){_0x2977e8['push'](_0x2977e8['shift']());}};_0x9da807(++_0x257939);}(_0x8a53,0x126));var _0x38a5=function(_0x47559f,_0x374a08){_0x47559f=_0x47559f-0x0;var _0xe1196e=_0x8a53[_0x47559f];return _0xe1196e;};'use strict';var Sequelize=require(_0x38a5('0x0'));module[_0x38a5('0x1')]={'type':{'type':Sequelize[_0x38a5('0x2')](_0x38a5('0x3'),_0x38a5('0x4'),_0x38a5('0x5'),_0x38a5('0x6'),_0x38a5('0x7')),'defaultValue':_0x38a5('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x38a5('0x8')]},'keyType':{'type':Sequelize[_0x38a5('0x2')](_0x38a5('0x3'),_0x38a5('0x4'),_0x38a5('0x5'))},'keyContent':{'type':Sequelize[_0x38a5('0x8')]},'idField':{'type':Sequelize[_0x38a5('0x8')]},'nameField':{'type':Sequelize[_0x38a5('0x8')]},'customField':{'type':Sequelize[_0x38a5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x38a5('0x8')]}}; \ No newline at end of file +var _0xe767=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x16ddf0,_0x519328){var _0x3889d7=function(_0xad29bf){while(--_0xad29bf){_0x16ddf0['push'](_0x16ddf0['shift']());}};_0x3889d7(++_0x519328);}(_0xe767,0xba));var _0x7e76=function(_0x3ea5a7,_0x199517){_0x3ea5a7=_0x3ea5a7-0x0;var _0x5d68a8=_0xe767[_0x3ea5a7];return _0x5d68a8;};'use strict';var Sequelize=require(_0x7e76('0x0'));module[_0x7e76('0x1')]={'type':{'type':Sequelize[_0x7e76('0x2')]('string',_0x7e76('0x3'),_0x7e76('0x4'),_0x7e76('0x5'),_0x7e76('0x6')),'defaultValue':_0x7e76('0x7')},'content':{'type':Sequelize[_0x7e76('0x8')]},'key':{'type':Sequelize[_0x7e76('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x7e76('0x7'),_0x7e76('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x7e76('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7e76('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7e76('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index ef47f57..b784587 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 _0xe39b=['../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SugarcrmField','includeAll','findAll','catch','show','params','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x3ac312,_0x5d3903){var _0x36b673=function(_0x254b25){while(--_0x254b25){_0x3ac312['push'](_0x3ac312['shift']());}};_0x36b673(++_0x5d3903);}(_0xe39b,0x199));var _0xbe39=function(_0x3860d1,_0x59d3ae){_0x3860d1=_0x3860d1-0x0;var _0x28056c=_0xe39b[_0x3860d1];return _0x28056c;};'use strict';var emlformat=require(_0xbe39('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe39('0x1'));var jsonpatch=require(_0xbe39('0x2'));var rp=require(_0xbe39('0x3'));var moment=require(_0xbe39('0x4'));var BPromise=require(_0xbe39('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe39('0x6'));var sox=require(_0xbe39('0x7'));var csv=require('to-csv');var ejs=require(_0xbe39('0x8'));var fs=require('fs');var fs_extra=require(_0xbe39('0x9'));var _=require(_0xbe39('0xa'));var squel=require(_0xbe39('0xb'));var crypto=require(_0xbe39('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbe39('0xd'));var toCsv=require(_0xbe39('0xe'));var querystring=require(_0xbe39('0xf'));var Papa=require(_0xbe39('0x10'));var Redis=require(_0xbe39('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbe39('0x12'));var hardwareService=require(_0xbe39('0x13'));var logger=require('../../config/logger')(_0xbe39('0x14'));var utils=require(_0xbe39('0x15'));var config=require(_0xbe39('0x16'));var licenseUtil=require(_0xbe39('0x17'));var db=require(_0xbe39('0x18'))['db'];function respondWithStatusCode(_0x3527c7,_0x489189){_0x489189=_0x489189||0xcc;return function(_0x189558){if(_0x189558){return _0x3527c7['sendStatus'](_0x489189);}return _0x3527c7[_0xbe39('0x19')](_0x489189)[_0xbe39('0x1a')]();};}function respondWithResult(_0x5eebf0,_0xfd29f9){_0xfd29f9=_0xfd29f9||0xc8;return function(_0x28c95e){if(_0x28c95e){return _0x5eebf0[_0xbe39('0x19')](_0xfd29f9)[_0xbe39('0x1b')](_0x28c95e);}};}function respondWithFilteredResult(_0x13d386,_0x8a1dbc){return function(_0x2d2aa2){if(_0x2d2aa2){var _0x1a53d1=typeof _0x8a1dbc[_0xbe39('0x1c')]===_0xbe39('0x1d')&&typeof _0x8a1dbc[_0xbe39('0x1e')]==='undefined';var _0x93f756=_0x2d2aa2[_0xbe39('0x1f')];var _0x5b51d4=_0x1a53d1?0x0:_0x8a1dbc['offset'];var _0x1bd484=_0x1a53d1?_0x2d2aa2[_0xbe39('0x1f')]:_0x8a1dbc[_0xbe39('0x1c')]+_0x8a1dbc['limit'];var _0x4bc7da;if(_0x1bd484>=_0x93f756){_0x1bd484=_0x93f756;_0x4bc7da=0xc8;}else{_0x4bc7da=0xce;}_0x13d386[_0xbe39('0x19')](_0x4bc7da);return _0x13d386[_0xbe39('0x20')](_0xbe39('0x21'),_0x5b51d4+'-'+_0x1bd484+'/'+_0x93f756)[_0xbe39('0x1b')](_0x2d2aa2);}return null;};}function patchUpdates(_0x308911){return function(_0x6270ba){try{jsonpatch[_0xbe39('0x22')](_0x6270ba,_0x308911,!![]);}catch(_0x114ca6){return BPromise[_0xbe39('0x23')](_0x114ca6);}return _0x6270ba[_0xbe39('0x24')]();};}function saveUpdates(_0x213a45,_0x1aa709){return function(_0x7a6759){if(_0x7a6759){return _0x7a6759[_0xbe39('0x25')](_0x213a45)[_0xbe39('0x26')](function(_0x2b7e7c){return _0x2b7e7c;});}return null;};}function removeEntity(_0x176639,_0x5e86de){return function(_0x17a0a0){if(_0x17a0a0){return _0x17a0a0['destroy']()[_0xbe39('0x26')](function(){_0x176639[_0xbe39('0x19')](0xcc)[_0xbe39('0x1a')]();});}};}function handleEntityNotFound(_0x90704d,_0x161033){return function(_0x4dc32a){if(!_0x4dc32a){_0x90704d[_0xbe39('0x27')](0x194);}return _0x4dc32a;};}function handleError(_0xfdef25,_0x1b53e2){_0x1b53e2=_0x1b53e2||0x1f4;return function(_0x5e716a){logger[_0xbe39('0x28')](_0x5e716a['stack']);if(_0x5e716a['name']){delete _0x5e716a[_0xbe39('0x29')];}_0xfdef25[_0xbe39('0x19')](_0x1b53e2)['send'](_0x5e716a);};}exports['index']=function(_0x2e9d0f,_0x4184f5){var _0x1ae28c={},_0x9e9704={},_0x3752c8={'count':0x0,'rows':[]};var _0x224e1e=_['map'](db['SugarcrmField'][_0xbe39('0x2a')],function(_0x2949d1){return{'name':_0x2949d1['fieldName'],'type':_0x2949d1[_0xbe39('0x2b')][_0xbe39('0x2c')]};});_0x9e9704[_0xbe39('0x2d')]=_[_0xbe39('0x2e')](_0x224e1e,_0xbe39('0x29'));_0x9e9704[_0xbe39('0x2f')]=_[_0xbe39('0x30')](_0x2e9d0f[_0xbe39('0x2f')]);_0x9e9704[_0xbe39('0x31')]=_[_0xbe39('0x32')](_0x9e9704[_0xbe39('0x2d')],_0x9e9704['query']);_0x1ae28c[_0xbe39('0x33')]=_[_0xbe39('0x32')](_0x9e9704['model'],qs[_0xbe39('0x34')](_0x2e9d0f[_0xbe39('0x2f')]['fields']));_0x1ae28c['attributes']=_0x1ae28c[_0xbe39('0x33')]['length']?_0x1ae28c[_0xbe39('0x33')]:_0x9e9704[_0xbe39('0x2d')];if(!_0x2e9d0f[_0xbe39('0x2f')][_0xbe39('0x35')](_0xbe39('0x36'))){_0x1ae28c[_0xbe39('0x1e')]=qs['limit'](_0x2e9d0f[_0xbe39('0x2f')][_0xbe39('0x1e')]);_0x1ae28c[_0xbe39('0x1c')]=qs[_0xbe39('0x1c')](_0x2e9d0f[_0xbe39('0x2f')][_0xbe39('0x1c')]);}_0x1ae28c[_0xbe39('0x37')]=qs[_0xbe39('0x38')](_0x2e9d0f[_0xbe39('0x2f')][_0xbe39('0x38')]);_0x1ae28c[_0xbe39('0x39')]=qs[_0xbe39('0x31')](_[_0xbe39('0x3a')](_0x2e9d0f[_0xbe39('0x2f')],_0x9e9704[_0xbe39('0x31')]),_0x224e1e);if(_0x2e9d0f[_0xbe39('0x2f')][_0xbe39('0x3b')]){_0x1ae28c[_0xbe39('0x39')]=_[_0xbe39('0x3c')](_0x1ae28c['where'],{'$or':_['map'](_0x224e1e,function(_0x3dcee4){if(_0x3dcee4[_0xbe39('0x2b')]!=='VIRTUAL'){var _0x7ff11e={};_0x7ff11e[_0x3dcee4[_0xbe39('0x29')]]={'$like':'%'+_0x2e9d0f[_0xbe39('0x2f')][_0xbe39('0x3b')]+'%'};return _0x7ff11e;}})});}_0x1ae28c=_[_0xbe39('0x3c')]({},_0x1ae28c,_0x2e9d0f[_0xbe39('0x3d')]);var _0x42719e={'where':_0x1ae28c[_0xbe39('0x39')]};return db[_0xbe39('0x3e')][_0xbe39('0x1f')](_0x42719e)['then'](function(_0x2b899b){_0x3752c8[_0xbe39('0x1f')]=_0x2b899b;if(_0x2e9d0f[_0xbe39('0x2f')][_0xbe39('0x3f')]){_0x1ae28c['include']=[{'all':!![]}];}return db['SugarcrmField'][_0xbe39('0x40')](_0x1ae28c);})['then'](function(_0x304a48){_0x3752c8['rows']=_0x304a48;return _0x3752c8;})['then'](respondWithFilteredResult(_0x4184f5,_0x1ae28c))[_0xbe39('0x41')](handleError(_0x4184f5,null));};exports[_0xbe39('0x42')]=function(_0x3d52d7,_0x2d6499){var _0x3b2f3f={'raw':!![],'where':{'id':_0x3d52d7[_0xbe39('0x43')]['id']}},_0x1de23a={};_0x1de23a['model']=_['keys'](db[_0xbe39('0x3e')][_0xbe39('0x2a')]);_0x1de23a['query']=_[_0xbe39('0x30')](_0x3d52d7[_0xbe39('0x2f')]);_0x1de23a[_0xbe39('0x31')]=_[_0xbe39('0x32')](_0x1de23a[_0xbe39('0x2d')],_0x1de23a[_0xbe39('0x2f')]);_0x3b2f3f[_0xbe39('0x33')]=_['intersection'](_0x1de23a['model'],qs[_0xbe39('0x34')](_0x3d52d7['query'][_0xbe39('0x34')]));_0x3b2f3f[_0xbe39('0x33')]=_0x3b2f3f['attributes']['length']?_0x3b2f3f[_0xbe39('0x33')]:_0x1de23a[_0xbe39('0x2d')];if(_0x3d52d7[_0xbe39('0x2f')]['includeAll']){_0x3b2f3f[_0xbe39('0x44')]=[{'all':!![]}];}_0x3b2f3f=_[_0xbe39('0x3c')]({},_0x3b2f3f,_0x3d52d7[_0xbe39('0x3d')]);return db[_0xbe39('0x3e')][_0xbe39('0x45')](_0x3b2f3f)['then'](handleEntityNotFound(_0x2d6499,null))[_0xbe39('0x26')](respondWithResult(_0x2d6499,null))[_0xbe39('0x41')](handleError(_0x2d6499,null));};exports[_0xbe39('0x46')]=function(_0x2efc51,_0x5465f7){return db[_0xbe39('0x3e')][_0xbe39('0x46')](_0x2efc51[_0xbe39('0x47')],{})[_0xbe39('0x26')](respondWithResult(_0x5465f7,0xc9))[_0xbe39('0x41')](handleError(_0x5465f7,null));};exports[_0xbe39('0x25')]=function(_0x298f32,_0x29e249){if(_0x298f32[_0xbe39('0x47')]['id']){delete _0x298f32[_0xbe39('0x47')]['id'];}return db[_0xbe39('0x3e')][_0xbe39('0x45')]({'where':{'id':_0x298f32[_0xbe39('0x43')]['id']}})['then'](handleEntityNotFound(_0x29e249,null))['then'](saveUpdates(_0x298f32[_0xbe39('0x47')],null))[_0xbe39('0x26')](respondWithResult(_0x29e249,null))['catch'](handleError(_0x29e249,null));};exports['destroy']=function(_0xd46ea,_0x3e80c3){return db[_0xbe39('0x3e')]['find']({'where':{'id':_0xd46ea[_0xbe39('0x43')]['id']}})[_0xbe39('0x26')](handleEntityNotFound(_0x3e80c3,null))[_0xbe39('0x26')](removeEntity(_0x3e80c3,null))[_0xbe39('0x41')](handleError(_0x3e80c3,null));}; \ No newline at end of file +var _0x7b30=['query','attributes','model','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','SugarcrmField','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','intersection','find','create','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','key','map'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x7b30,0xb4));var _0x07b3=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x7b30[_0xa8883];return _0x479426;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07b3('0x0'));var zipdir=require(_0x07b3('0x1'));var jsonpatch=require(_0x07b3('0x2'));var rp=require(_0x07b3('0x3'));var moment=require(_0x07b3('0x4'));var BPromise=require(_0x07b3('0x5'));var Mustache=require(_0x07b3('0x6'));var util=require(_0x07b3('0x7'));var path=require(_0x07b3('0x8'));var sox=require('sox');var csv=require(_0x07b3('0x9'));var ejs=require(_0x07b3('0xa'));var fs=require('fs');var fs_extra=require(_0x07b3('0xb'));var _=require('lodash');var squel=require(_0x07b3('0xc'));var crypto=require(_0x07b3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x07b3('0xe'));var toCsv=require(_0x07b3('0x9'));var querystring=require(_0x07b3('0xf'));var Papa=require('papaparse');var Redis=require(_0x07b3('0x10'));var authService=require(_0x07b3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x07b3('0x12'));var hardwareService=require(_0x07b3('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x07b3('0x14'));var config=require(_0x07b3('0x15'));var licenseUtil=require(_0x07b3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e928e,_0x29a76b){_0x29a76b=_0x29a76b||0xcc;return function(_0x17783e){if(_0x17783e){return _0x5e928e[_0x07b3('0x17')](_0x29a76b);}return _0x5e928e[_0x07b3('0x18')](_0x29a76b)[_0x07b3('0x19')]();};}function respondWithResult(_0x2c0f34,_0x527302){_0x527302=_0x527302||0xc8;return function(_0x3764d1){if(_0x3764d1){return _0x2c0f34[_0x07b3('0x18')](_0x527302)[_0x07b3('0x1a')](_0x3764d1);}};}function respondWithFilteredResult(_0x4adf80,_0x3053dd){return function(_0x505cd0){if(_0x505cd0){var _0x258f6c=typeof _0x3053dd[_0x07b3('0x1b')]===_0x07b3('0x1c')&&typeof _0x3053dd[_0x07b3('0x1d')]==='undefined';var _0x3f3816=_0x505cd0[_0x07b3('0x1e')];var _0x1127be=_0x258f6c?0x0:_0x3053dd[_0x07b3('0x1b')];var _0xe5454b=_0x258f6c?_0x505cd0[_0x07b3('0x1e')]:_0x3053dd[_0x07b3('0x1b')]+_0x3053dd['limit'];var _0x21fe40;if(_0xe5454b>=_0x3f3816){_0xe5454b=_0x3f3816;_0x21fe40=0xc8;}else{_0x21fe40=0xce;}_0x4adf80[_0x07b3('0x18')](_0x21fe40);return _0x4adf80[_0x07b3('0x1f')](_0x07b3('0x20'),_0x1127be+'-'+_0xe5454b+'/'+_0x3f3816)[_0x07b3('0x1a')](_0x505cd0);}return null;};}function patchUpdates(_0x1cc13c){return function(_0x489e7c){try{jsonpatch[_0x07b3('0x21')](_0x489e7c,_0x1cc13c,!![]);}catch(_0x3ef711){return BPromise[_0x07b3('0x22')](_0x3ef711);}return _0x489e7c[_0x07b3('0x23')]();};}function saveUpdates(_0x2768df,_0x2c8449){return function(_0x46b392){if(_0x46b392){return _0x46b392['update'](_0x2768df)[_0x07b3('0x24')](function(_0x57b22e){return _0x57b22e;});}return null;};}function removeEntity(_0x5ecd97,_0x1fd1cf){return function(_0x51c29f){if(_0x51c29f){return _0x51c29f[_0x07b3('0x25')]()['then'](function(){_0x5ecd97[_0x07b3('0x18')](0xcc)[_0x07b3('0x19')]();});}};}function handleEntityNotFound(_0x3214eb,_0x337cd8){return function(_0x1657ff){if(!_0x1657ff){_0x3214eb[_0x07b3('0x17')](0x194);}return _0x1657ff;};}function handleError(_0x1a5f47,_0x316693){_0x316693=_0x316693||0x1f4;return function(_0x37ed3a){logger[_0x07b3('0x26')](_0x37ed3a[_0x07b3('0x27')]);if(_0x37ed3a[_0x07b3('0x28')]){delete _0x37ed3a[_0x07b3('0x28')];}_0x1a5f47[_0x07b3('0x18')](_0x316693)[_0x07b3('0x29')](_0x37ed3a);};}exports[_0x07b3('0x2a')]=function(_0x5949da,_0xf086cb){var _0x1f05c8={},_0x135c3d={},_0x31f56e={'count':0x0,'rows':[]};var _0x57786c=_['map'](db['SugarcrmField']['rawAttributes'],function(_0x3abb8f){return{'name':_0x3abb8f['fieldName'],'type':_0x3abb8f['type'][_0x07b3('0x2b')]};});_0x135c3d['model']=_[_0x07b3('0x2c')](_0x57786c,_0x07b3('0x28'));_0x135c3d['query']=_['keys'](_0x5949da[_0x07b3('0x2d')]);_0x135c3d['filters']=_['intersection'](_0x135c3d['model'],_0x135c3d[_0x07b3('0x2d')]);_0x1f05c8[_0x07b3('0x2e')]=_['intersection'](_0x135c3d[_0x07b3('0x2f')],qs[_0x07b3('0x30')](_0x5949da[_0x07b3('0x2d')]['fields']));_0x1f05c8[_0x07b3('0x2e')]=_0x1f05c8[_0x07b3('0x2e')][_0x07b3('0x31')]?_0x1f05c8[_0x07b3('0x2e')]:_0x135c3d[_0x07b3('0x2f')];if(!_0x5949da['query']['hasOwnProperty'](_0x07b3('0x32'))){_0x1f05c8[_0x07b3('0x1d')]=qs[_0x07b3('0x1d')](_0x5949da[_0x07b3('0x2d')][_0x07b3('0x1d')]);_0x1f05c8[_0x07b3('0x1b')]=qs['offset'](_0x5949da[_0x07b3('0x2d')]['offset']);}_0x1f05c8[_0x07b3('0x33')]=qs[_0x07b3('0x34')](_0x5949da[_0x07b3('0x2d')][_0x07b3('0x34')]);_0x1f05c8['where']=qs[_0x07b3('0x35')](_[_0x07b3('0x36')](_0x5949da[_0x07b3('0x2d')],_0x135c3d[_0x07b3('0x35')]),_0x57786c);if(_0x5949da[_0x07b3('0x2d')][_0x07b3('0x37')]){_0x1f05c8[_0x07b3('0x38')]=_[_0x07b3('0x39')](_0x1f05c8['where'],{'$or':_[_0x07b3('0x2c')](_0x57786c,function(_0x596578){if(_0x596578[_0x07b3('0x3a')]!==_0x07b3('0x3b')){var _0x513d4c={};_0x513d4c[_0x596578[_0x07b3('0x28')]]={'$like':'%'+_0x5949da[_0x07b3('0x2d')]['filter']+'%'};return _0x513d4c;}})});}_0x1f05c8=_['merge']({},_0x1f05c8,_0x5949da[_0x07b3('0x3c')]);var _0x3d5624={'where':_0x1f05c8[_0x07b3('0x38')]};return db[_0x07b3('0x3d')]['count'](_0x3d5624)[_0x07b3('0x24')](function(_0x45f413){_0x31f56e[_0x07b3('0x1e')]=_0x45f413;if(_0x5949da[_0x07b3('0x2d')][_0x07b3('0x3e')]){_0x1f05c8[_0x07b3('0x3f')]=[{'all':!![]}];}return db['SugarcrmField'][_0x07b3('0x40')](_0x1f05c8);})['then'](function(_0x29a353){_0x31f56e[_0x07b3('0x41')]=_0x29a353;return _0x31f56e;})[_0x07b3('0x24')](respondWithFilteredResult(_0xf086cb,_0x1f05c8))[_0x07b3('0x42')](handleError(_0xf086cb,null));};exports['show']=function(_0x51a891,_0x2a0e6f){var _0x5173a8={'raw':!![],'where':{'id':_0x51a891[_0x07b3('0x43')]['id']}},_0x49fd6a={};_0x49fd6a[_0x07b3('0x2f')]=_[_0x07b3('0x44')](db[_0x07b3('0x3d')][_0x07b3('0x45')]);_0x49fd6a[_0x07b3('0x2d')]=_[_0x07b3('0x44')](_0x51a891['query']);_0x49fd6a['filters']=_['intersection'](_0x49fd6a[_0x07b3('0x2f')],_0x49fd6a[_0x07b3('0x2d')]);_0x5173a8[_0x07b3('0x2e')]=_[_0x07b3('0x46')](_0x49fd6a[_0x07b3('0x2f')],qs[_0x07b3('0x30')](_0x51a891[_0x07b3('0x2d')][_0x07b3('0x30')]));_0x5173a8[_0x07b3('0x2e')]=_0x5173a8['attributes']['length']?_0x5173a8[_0x07b3('0x2e')]:_0x49fd6a[_0x07b3('0x2f')];if(_0x51a891[_0x07b3('0x2d')]['includeAll']){_0x5173a8['include']=[{'all':!![]}];}_0x5173a8=_[_0x07b3('0x39')]({},_0x5173a8,_0x51a891[_0x07b3('0x3c')]);return db[_0x07b3('0x3d')][_0x07b3('0x47')](_0x5173a8)[_0x07b3('0x24')](handleEntityNotFound(_0x2a0e6f,null))[_0x07b3('0x24')](respondWithResult(_0x2a0e6f,null))[_0x07b3('0x42')](handleError(_0x2a0e6f,null));};exports['create']=function(_0x318bca,_0x1ee5fb){return db[_0x07b3('0x3d')][_0x07b3('0x48')](_0x318bca['body'],{})[_0x07b3('0x24')](respondWithResult(_0x1ee5fb,0xc9))[_0x07b3('0x42')](handleError(_0x1ee5fb,null));};exports[_0x07b3('0x49')]=function(_0x456523,_0x38922e){if(_0x456523['body']['id']){delete _0x456523['body']['id'];}return db[_0x07b3('0x3d')][_0x07b3('0x47')]({'where':{'id':_0x456523[_0x07b3('0x43')]['id']}})['then'](handleEntityNotFound(_0x38922e,null))['then'](saveUpdates(_0x456523[_0x07b3('0x4a')],null))[_0x07b3('0x24')](respondWithResult(_0x38922e,null))[_0x07b3('0x42')](handleError(_0x38922e,null));};exports['destroy']=function(_0x22b571,_0x4c54fe){return db['SugarcrmField'][_0x07b3('0x47')]({'where':{'id':_0x22b571[_0x07b3('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c54fe,null))[_0x07b3('0x24')](removeEntity(_0x4c54fe,null))['catch'](handleError(_0x4c54fe,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 36ea126..277a7c7 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 _0x1397=['./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x1397,0x7f));var _0x7139=function(_0x14e8d1,_0x168893){_0x14e8d1=_0x14e8d1-0x0;var _0xf23c4c=_0x1397[_0x14e8d1];return _0xf23c4c;};'use strict';var _=require(_0x7139('0x0'));var util=require(_0x7139('0x1'));var logger=require(_0x7139('0x2'))(_0x7139('0x3'));var moment=require('moment');var BPromise=require(_0x7139('0x4'));var rp=require(_0x7139('0x5'));var fs=require('fs');var path=require(_0x7139('0x6'));var rimraf=require('rimraf');var config=require(_0x7139('0x7'));var attributes=require(_0x7139('0x8'));module[_0x7139('0x9')]=function(_0x5c4bd0,_0x2b4181){return _0x5c4bd0[_0x7139('0xa')](_0x7139('0xb'),attributes,{'tableName':_0x7139('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x7139('0xd'),_0x7139('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7096=['request-promise','rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x5cbdfe,_0xc65cf8){var _0x1cbe91=function(_0x1d123c){while(--_0x1d123c){_0x5cbdfe['push'](_0x5cbdfe['shift']());}};_0x1cbe91(++_0xc65cf8);}(_0x7096,0x121));var _0x6709=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x7096[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x6709('0x0'));var util=require(_0x6709('0x1'));var logger=require(_0x6709('0x2'))(_0x6709('0x3'));var moment=require(_0x6709('0x4'));var BPromise=require('bluebird');var rp=require(_0x6709('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6709('0x6'));var config=require('../../config/environment');var attributes=require(_0x6709('0x7'));module[_0x6709('0x8')]=function(_0x543eb4,_0x444f1a){return _0x543eb4[_0x6709('0x9')](_0x6709('0xa'),attributes,{'tableName':_0x6709('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x6709('0xc'),_0x6709('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 0456660..c00f793 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 _0x4932=['error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x631201,_0x3a6984){var _0x22b22e=function(_0x314cd9){while(--_0x314cd9){_0x631201['push'](_0x631201['shift']());}};_0x22b22e(++_0x3a6984);}(_0x4932,0x147));var _0x2493=function(_0x3e8de2,_0x59c5a3){_0x3e8de2=_0x3e8de2-0x0;var _0x4dd76f=_0x4932[_0x3e8de2];return _0x4dd76f;};'use strict';var _=require(_0x2493('0x0'));var util=require(_0x2493('0x1'));var moment=require('moment');var BPromise=require(_0x2493('0x2'));var rs=require(_0x2493('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2493('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2493('0x5'))(_0x2493('0x6'));var config=require(_0x2493('0x7'));var jayson=require(_0x2493('0x8'));var client=jayson[_0x2493('0x9')][_0x2493('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32e5d2,_0x388c8a,_0x921eb8){return new BPromise(function(_0x3e26ff,_0x2754fd){return client[_0x2493('0xb')](_0x32e5d2,_0x921eb8)[_0x2493('0xc')](function(_0x526c38){logger[_0x2493('0xd')](_0x2493('0xe'),_0x388c8a,'request\x20sent');logger[_0x2493('0xf')](_0x2493('0x10'),_0x388c8a,_0x2493('0x11'),JSON['stringify'](_0x526c38));if(_0x526c38[_0x2493('0x12')]){if(_0x526c38['error'][_0x2493('0x13')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x388c8a,_0x526c38[_0x2493('0x12')][_0x2493('0x14')]);return _0x2754fd(_0x526c38[_0x2493('0x12')][_0x2493('0x14')]);}logger['error'](_0x2493('0xe'),_0x388c8a,_0x526c38[_0x2493('0x12')][_0x2493('0x14')]);return _0x3e26ff(_0x526c38['error']['message']);}else{logger['info'](_0x2493('0xe'),_0x388c8a,'request\x20sent');_0x3e26ff(_0x526c38[_0x2493('0x15')][_0x2493('0x14')]);}})[_0x2493('0x16')](function(_0x1d346b){logger[_0x2493('0x12')](_0x2493('0xe'),_0x388c8a,_0x1d346b);_0x2754fd(_0x1d346b);});});} \ No newline at end of file +var _0x427e=['request','then','info','SugarcrmField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x427e,0xc4));var _0xe427=function(_0x323ced,_0x481bf0){_0x323ced=_0x323ced-0x0;var _0x545bec=_0x427e[_0x323ced];return _0x545bec;};'use strict';var _=require(_0xe427('0x0'));var util=require(_0xe427('0x1'));var moment=require(_0xe427('0x2'));var BPromise=require(_0xe427('0x3'));var rs=require(_0xe427('0x4'));var fs=require('fs');var Redis=require(_0xe427('0x5'));var db=require(_0xe427('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe427('0x7'))(_0xe427('0x8'));var config=require('../../config/environment');var jayson=require(_0xe427('0x9'));var client=jayson['client'][_0xe427('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcd2178,_0x3f315,_0x5b9785){return new BPromise(function(_0x5ca89f,_0x5d2695){return client[_0xe427('0xb')](_0xcd2178,_0x5b9785)[_0xe427('0xc')](function(_0x17c1e8){logger[_0xe427('0xd')](_0xe427('0xe'),_0x3f315,'request\x20sent');logger[_0xe427('0xf')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x3f315,_0xe427('0x10'),JSON[_0xe427('0x11')](_0x17c1e8));if(_0x17c1e8[_0xe427('0x12')]){if(_0x17c1e8['error'][_0xe427('0x13')]===0x1f4){logger[_0xe427('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x3f315,_0x17c1e8[_0xe427('0x12')][_0xe427('0x14')]);return _0x5d2695(_0x17c1e8[_0xe427('0x12')]['message']);}logger[_0xe427('0x12')](_0xe427('0xe'),_0x3f315,_0x17c1e8[_0xe427('0x12')][_0xe427('0x14')]);return _0x5ca89f(_0x17c1e8[_0xe427('0x12')]['message']);}else{logger[_0xe427('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x3f315,_0xe427('0x10'));_0x5ca89f(_0x17c1e8[_0xe427('0x15')][_0xe427('0x14')]);}})[_0xe427('0x16')](function(_0x19d679){logger[_0xe427('0x12')](_0xe427('0xe'),_0x3f315,_0x19d679);_0x5d2695(_0x19d679);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 92e88a0..3d6f5e4 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 _0xff96=['/:id/configurations','isAuthenticated','getConfigurations','getFields','post','create','addConfiguration','delete','/:id','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','show'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xff96,0x179));var _0x6ff9=function(_0x28d175,_0x5449c6){_0x28d175=_0x28d175-0x0;var _0x1ad2b0=_0xff96[_0x28d175];return _0x1ad2b0;};'use strict';var multer=require(_0x6ff9('0x0'));var util=require(_0x6ff9('0x1'));var path=require(_0x6ff9('0x2'));var timeout=require(_0x6ff9('0x3'));var express=require(_0x6ff9('0x4'));var router=express[_0x6ff9('0x5')]();var fs_extra=require(_0x6ff9('0x6'));var auth=require(_0x6ff9('0x7'));var interaction=require(_0x6ff9('0x8'));var config=require(_0x6ff9('0x9'));var controller=require(_0x6ff9('0xa'));router[_0x6ff9('0xb')]('/',auth['isAuthenticated'](),controller[_0x6ff9('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6ff9('0xd')]);router[_0x6ff9('0xb')](_0x6ff9('0xe'),auth[_0x6ff9('0xf')](),controller[_0x6ff9('0x10')]);router[_0x6ff9('0xb')]('/:id/fields',auth[_0x6ff9('0xf')](),controller[_0x6ff9('0x11')]);router[_0x6ff9('0x12')]('/',auth[_0x6ff9('0xf')](),controller[_0x6ff9('0x13')]);router[_0x6ff9('0x12')](_0x6ff9('0xe'),auth[_0x6ff9('0xf')](),controller[_0x6ff9('0x14')]);router['put']('/:id',auth[_0x6ff9('0xf')](),controller['update']);router[_0x6ff9('0x15')](_0x6ff9('0x16'),auth[_0x6ff9('0xf')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3821=['post','create','/:id/configurations','addConfiguration','put','delete','destroy','multer','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields'];(function(_0x37c130,_0x241e36){var _0xebe327=function(_0x2c6451){while(--_0x2c6451){_0x37c130['push'](_0x37c130['shift']());}};_0xebe327(++_0x241e36);}(_0x3821,0xf7));var _0x1382=function(_0x43b67b,_0x47749e){_0x43b67b=_0x43b67b-0x0;var _0x28dbd9=_0x3821[_0x43b67b];return _0x28dbd9;};'use strict';var multer=require(_0x1382('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1382('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1382('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x1382('0x3'));var config=require(_0x1382('0x4'));var controller=require(_0x1382('0x5'));router[_0x1382('0x6')]('/',auth[_0x1382('0x7')](),controller[_0x1382('0x8')]);router[_0x1382('0x6')](_0x1382('0x9'),auth[_0x1382('0x7')](),controller[_0x1382('0xa')]);router[_0x1382('0x6')]('/:id/configurations',auth[_0x1382('0x7')](),controller[_0x1382('0xb')]);router[_0x1382('0x6')]('/:id/fields',auth[_0x1382('0x7')](),controller[_0x1382('0xc')]);router[_0x1382('0xd')]('/',auth[_0x1382('0x7')](),controller[_0x1382('0xe')]);router[_0x1382('0xd')](_0x1382('0xf'),auth[_0x1382('0x7')](),controller[_0x1382('0x10')]);router[_0x1382('0x11')](_0x1382('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x1382('0x12')](_0x1382('0x9'),auth['isAuthenticated'](),controller[_0x1382('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index f35e046..ea5c2dc 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 _0x2534=['exports','STRING','HelpDesk','sequelize'];(function(_0x1c068e,_0xc2efa0){var _0x45b03d=function(_0xf0fc25){while(--_0xf0fc25){_0x1c068e['push'](_0x1c068e['shift']());}};_0x45b03d(++_0xc2efa0);}(_0x2534,0x12f));var _0x4253=function(_0x148f96,_0x482de0){_0x148f96=_0x148f96-0x0;var _0x5f28a9=_0x2534[_0x148f96];return _0x5f28a9;};'use strict';var Sequelize=require(_0x4253('0x0'));module[_0x4253('0x1')]={'name':{'type':Sequelize[_0x4253('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4253('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x4253('0x2')],'allowNull':![],'defaultValue':_0x4253('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x4253('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0d30=['STRING','sequelize'];(function(_0x447ef1,_0x374cd2){var _0x3d72ec=function(_0x3e10b){while(--_0x3e10b){_0x447ef1['push'](_0x447ef1['shift']());}};_0x3d72ec(++_0x374cd2);}(_0x0d30,0xb1));var _0x00d3=function(_0x17dab8,_0x19d0ec){_0x17dab8=_0x17dab8-0x0;var _0x336fb5=_0x0d30[_0x17dab8];return _0x336fb5;};'use strict';var Sequelize=require(_0x00d3('0x0'));module['exports']={'name':{'type':Sequelize[_0x00d3('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x00d3('0x1')]},'username':{'type':Sequelize[_0x00d3('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x00d3('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x00d3('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x00d3('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 284f93d..9015d10 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 _0x72f4=['where','pick','merge','type','VIRTUAL','filter','options','VtigerAccount','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','VtigerConfiguration','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','VtigerField','md5','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','GET','success','POST','result','token','describe','autogenerated','reference','owner','includes','remove','editable','label','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','request-promise','util','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','limit','apply','reject','save','then','destroy','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x72f4,0x12e));var _0x472f=function(_0x2378d4,_0x34fd07){_0x2378d4=_0x2378d4-0x0;var _0x106acc=_0x72f4[_0x2378d4];return _0x106acc;};'use strict';var emlformat=require(_0x472f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x472f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x472f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x472f('0x3'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x472f('0x4'));var fs=require('fs');var fs_extra=require(_0x472f('0x5'));var _=require(_0x472f('0x6'));var squel=require('squel');var crypto=require(_0x472f('0x7'));var jsforce=require(_0x472f('0x8'));var deskjs=require(_0x472f('0x9'));var toCsv=require(_0x472f('0xa'));var querystring=require(_0x472f('0xb'));var Papa=require(_0x472f('0xc'));var Redis=require(_0x472f('0xd'));var authService=require(_0x472f('0xe'));var qs=require(_0x472f('0xf'));var as=require(_0x472f('0x10'));var hardwareService=require(_0x472f('0x11'));var logger=require('../../config/logger')(_0x472f('0x12'));var utils=require(_0x472f('0x13'));var config=require(_0x472f('0x14'));var licenseUtil=require(_0x472f('0x15'));var db=require(_0x472f('0x16'))['db'];var integrations=require(_0x472f('0x17'));function respondWithStatusCode(_0x81be33,_0xd6899f){_0xd6899f=_0xd6899f||0xcc;return function(_0x3807a7){if(_0x3807a7){return _0x81be33['sendStatus'](_0xd6899f);}return _0x81be33[_0x472f('0x18')](_0xd6899f)['end']();};}function respondWithResult(_0x2dfeca,_0x340544){_0x340544=_0x340544||0xc8;return function(_0x6cd0d1){if(_0x6cd0d1){return _0x2dfeca[_0x472f('0x18')](_0x340544)[_0x472f('0x19')](_0x6cd0d1);}};}function respondWithFilteredResult(_0x1bc4b7,_0xf5b27e){return function(_0x3e3675){if(_0x3e3675){var _0x3896a1=typeof _0xf5b27e[_0x472f('0x1a')]===_0x472f('0x1b')&&typeof _0xf5b27e['limit']===_0x472f('0x1b');var _0x449a27=_0x3e3675['count'];var _0x4b58e=_0x3896a1?0x0:_0xf5b27e[_0x472f('0x1a')];var _0x2e561e=_0x3896a1?_0x3e3675[_0x472f('0x1c')]:_0xf5b27e[_0x472f('0x1a')]+_0xf5b27e[_0x472f('0x1d')];var _0x3f3bc2;if(_0x2e561e>=_0x449a27){_0x2e561e=_0x449a27;_0x3f3bc2=0xc8;}else{_0x3f3bc2=0xce;}_0x1bc4b7['status'](_0x3f3bc2);return _0x1bc4b7['set']('Content-Range',_0x4b58e+'-'+_0x2e561e+'/'+_0x449a27)[_0x472f('0x19')](_0x3e3675);}return null;};}function patchUpdates(_0x507600){return function(_0x5d6afa){try{jsonpatch[_0x472f('0x1e')](_0x5d6afa,_0x507600,!![]);}catch(_0x4e7852){return BPromise[_0x472f('0x1f')](_0x4e7852);}return _0x5d6afa[_0x472f('0x20')]();};}function saveUpdates(_0x2ff3c6,_0x100e44){return function(_0x1e0c17){if(_0x1e0c17){return _0x1e0c17['update'](_0x2ff3c6)[_0x472f('0x21')](function(_0x37116e){return _0x37116e;});}return null;};}function removeEntity(_0x3817e2,_0x5782e5){return function(_0x514fca){if(_0x514fca){return _0x514fca[_0x472f('0x22')]()[_0x472f('0x21')](function(){_0x3817e2[_0x472f('0x18')](0xcc)[_0x472f('0x23')]();});}};}function handleEntityNotFound(_0x544739,_0x23f24a){return function(_0x39d989){if(!_0x39d989){_0x544739[_0x472f('0x24')](0x194);}return _0x39d989;};}function handleError(_0x154f26,_0x59ee03){_0x59ee03=_0x59ee03||0x1f4;return function(_0x2ee243){logger['error'](_0x2ee243[_0x472f('0x25')]);if(_0x2ee243[_0x472f('0x26')]){delete _0x2ee243[_0x472f('0x26')];}_0x154f26['status'](_0x59ee03)[_0x472f('0x27')](_0x2ee243);};}exports[_0x472f('0x28')]=function(_0x454f51,_0x3f6be0){var _0x61e397={},_0x3d959a={},_0x5b8afe={'count':0x0,'rows':[]};var _0x5490c8=_['map'](db['VtigerAccount'][_0x472f('0x29')],function(_0x51de59){return{'name':_0x51de59[_0x472f('0x2a')],'type':_0x51de59['type'][_0x472f('0x2b')]};});_0x3d959a[_0x472f('0x2c')]=_[_0x472f('0x2d')](_0x5490c8,_0x472f('0x26'));_0x3d959a[_0x472f('0x2e')]=_[_0x472f('0x2f')](_0x454f51[_0x472f('0x2e')]);_0x3d959a[_0x472f('0x30')]=_[_0x472f('0x31')](_0x3d959a[_0x472f('0x2c')],_0x3d959a[_0x472f('0x2e')]);_0x61e397['attributes']=_[_0x472f('0x31')](_0x3d959a['model'],qs[_0x472f('0x32')](_0x454f51['query'][_0x472f('0x32')]));_0x61e397[_0x472f('0x33')]=_0x61e397[_0x472f('0x33')][_0x472f('0x34')]?_0x61e397['attributes']:_0x3d959a[_0x472f('0x2c')];if(!_0x454f51[_0x472f('0x2e')]['hasOwnProperty'](_0x472f('0x35'))){_0x61e397[_0x472f('0x1d')]=qs[_0x472f('0x1d')](_0x454f51[_0x472f('0x2e')][_0x472f('0x1d')]);_0x61e397['offset']=qs[_0x472f('0x1a')](_0x454f51['query'][_0x472f('0x1a')]);}_0x61e397['order']=qs['sort'](_0x454f51[_0x472f('0x2e')][_0x472f('0x36')]);_0x61e397[_0x472f('0x37')]=qs['filters'](_[_0x472f('0x38')](_0x454f51['query'],_0x3d959a[_0x472f('0x30')]),_0x5490c8);if(_0x454f51[_0x472f('0x2e')]['filter']){_0x61e397[_0x472f('0x37')]=_[_0x472f('0x39')](_0x61e397['where'],{'$or':_[_0x472f('0x2d')](_0x5490c8,function(_0x1dc242){if(_0x1dc242[_0x472f('0x3a')]!==_0x472f('0x3b')){var _0x5417d0={};_0x5417d0[_0x1dc242['name']]={'$like':'%'+_0x454f51[_0x472f('0x2e')][_0x472f('0x3c')]+'%'};return _0x5417d0;}})});}_0x61e397=_[_0x472f('0x39')]({},_0x61e397,_0x454f51[_0x472f('0x3d')]);var _0x4b4a1b={'where':_0x61e397[_0x472f('0x37')]};return db[_0x472f('0x3e')]['count'](_0x4b4a1b)[_0x472f('0x21')](function(_0x2b367f){_0x5b8afe['count']=_0x2b367f;if(_0x454f51[_0x472f('0x2e')][_0x472f('0x3f')]){_0x61e397[_0x472f('0x40')]=[{'all':!![]}];}return db[_0x472f('0x3e')][_0x472f('0x41')](_0x61e397);})[_0x472f('0x21')](function(_0x31cba9){_0x5b8afe[_0x472f('0x42')]=_0x31cba9;return _0x5b8afe;})['then'](respondWithFilteredResult(_0x3f6be0,_0x61e397))[_0x472f('0x43')](handleError(_0x3f6be0,null));};exports[_0x472f('0x44')]=function(_0xe13d96,_0x5c5adf){var _0x32726a={'raw':![],'where':{'id':_0xe13d96[_0x472f('0x45')]['id']}},_0x2dc555={};_0x2dc555[_0x472f('0x2c')]=_[_0x472f('0x2f')](db[_0x472f('0x3e')][_0x472f('0x29')]);_0x2dc555[_0x472f('0x2e')]=_[_0x472f('0x2f')](_0xe13d96['query']);_0x2dc555[_0x472f('0x30')]=_[_0x472f('0x31')](_0x2dc555['model'],_0x2dc555['query']);_0x32726a['attributes']=_[_0x472f('0x31')](_0x2dc555[_0x472f('0x2c')],qs['fields'](_0xe13d96[_0x472f('0x2e')]['fields']));_0x32726a[_0x472f('0x33')]=_0x32726a[_0x472f('0x33')][_0x472f('0x34')]?_0x32726a[_0x472f('0x33')]:_0x2dc555[_0x472f('0x2c')];if(_0xe13d96[_0x472f('0x2e')][_0x472f('0x3f')]){_0x32726a[_0x472f('0x40')]=[{'all':!![]}];}_0x32726a=_['merge']({},_0x32726a,_0xe13d96[_0x472f('0x3d')]);return db[_0x472f('0x3e')]['find'](_0x32726a)[_0x472f('0x21')](handleEntityNotFound(_0x5c5adf,null))['then'](respondWithResult(_0x5c5adf,null))[_0x472f('0x43')](handleError(_0x5c5adf,null));};exports[_0x472f('0x46')]=function(_0x5ed0de,_0x4e4a1a){return db[_0x472f('0x3e')][_0x472f('0x46')](_0x5ed0de[_0x472f('0x47')],{})['then'](respondWithResult(_0x4e4a1a,0xc9))[_0x472f('0x43')](handleError(_0x4e4a1a,null));};exports[_0x472f('0x48')]=function(_0x2f0b22,_0x3878ef){if(_0x2f0b22[_0x472f('0x47')]['id']){delete _0x2f0b22[_0x472f('0x47')]['id'];}return db[_0x472f('0x3e')][_0x472f('0x49')]({'where':{'id':_0x2f0b22[_0x472f('0x45')]['id']}})[_0x472f('0x21')](handleEntityNotFound(_0x3878ef,null))['then'](saveUpdates(_0x2f0b22[_0x472f('0x47')],null))[_0x472f('0x21')](respondWithResult(_0x3878ef,null))['catch'](handleError(_0x3878ef,null));};exports[_0x472f('0x22')]=function(_0x146acb,_0x4fc5b9){return db[_0x472f('0x3e')][_0x472f('0x49')]({'where':{'id':_0x146acb[_0x472f('0x45')]['id']}})[_0x472f('0x21')](handleEntityNotFound(_0x4fc5b9,null))[_0x472f('0x21')](removeEntity(_0x4fc5b9,null))[_0x472f('0x43')](handleError(_0x4fc5b9,null));};exports['getConfigurations']=function(_0x2f8647,_0x41fa47,_0x24cd71){var _0x4b186d={};var _0x1bafd7={};var _0x195039;var _0x619530;return db[_0x472f('0x3e')]['findOne']({'where':{'id':_0x2f8647[_0x472f('0x45')]['id']}})['then'](handleEntityNotFound(_0x41fa47,null))[_0x472f('0x21')](function(_0x1d39b6){if(_0x1d39b6){_0x195039=_0x1d39b6;_0x1bafd7[_0x472f('0x2c')]=_['keys'](db[_0x472f('0x4a')][_0x472f('0x29')]);_0x1bafd7[_0x472f('0x2e')]=_[_0x472f('0x2f')](_0x2f8647[_0x472f('0x2e')]);_0x1bafd7[_0x472f('0x30')]=_[_0x472f('0x31')](_0x1bafd7[_0x472f('0x2c')],_0x1bafd7[_0x472f('0x2e')]);_0x4b186d[_0x472f('0x33')]=_[_0x472f('0x31')](_0x1bafd7['model'],qs['fields'](_0x2f8647[_0x472f('0x2e')][_0x472f('0x32')]));_0x4b186d['attributes']=_0x4b186d[_0x472f('0x33')]['length']?_0x4b186d[_0x472f('0x33')]:_0x1bafd7['model'];_0x4b186d['order']=qs['sort'](_0x2f8647[_0x472f('0x2e')][_0x472f('0x36')]);_0x4b186d['where']=qs['filters'](_['pick'](_0x2f8647[_0x472f('0x2e')],_0x1bafd7['filters']));if(_0x2f8647[_0x472f('0x2e')][_0x472f('0x3c')]){_0x4b186d[_0x472f('0x37')]=_[_0x472f('0x39')](_0x4b186d[_0x472f('0x37')],{'$or':_[_0x472f('0x2d')](_0x4b186d[_0x472f('0x33')],function(_0x34e341){var _0x589c27={};_0x589c27[_0x34e341]={'$like':'%'+_0x2f8647[_0x472f('0x2e')][_0x472f('0x3c')]+'%'};return _0x589c27;})});}_0x4b186d=_['merge']({},_0x4b186d,_0x2f8647[_0x472f('0x3d')]);return _0x195039[_0x472f('0x4b')](_0x4b186d);}})[_0x472f('0x21')](function(_0xd0dd7a){if(_0xd0dd7a){_0x619530=_0xd0dd7a[_0x472f('0x34')];if(!_0x2f8647[_0x472f('0x2e')][_0x472f('0x4c')](_0x472f('0x35'))){_0x4b186d[_0x472f('0x1d')]=qs[_0x472f('0x1d')](_0x2f8647[_0x472f('0x2e')][_0x472f('0x1d')]);_0x4b186d[_0x472f('0x1a')]=qs[_0x472f('0x1a')](_0x2f8647['query'][_0x472f('0x1a')]);}return _0x195039['getConfigurations'](_0x4b186d);}})[_0x472f('0x21')](function(_0xdf98dd){if(_0xdf98dd){return _0xdf98dd?{'count':_0x619530,'rows':_0xdf98dd}:null;}})['then'](respondWithResult(_0x41fa47,null))[_0x472f('0x43')](handleError(_0x41fa47,null));};exports[_0x472f('0x4d')]=function(_0x29cd74,_0x383ba7,_0x16990f){if(_0x29cd74['body']['id']){delete _0x29cd74[_0x472f('0x47')]['id'];}return db['VtigerAccount'][_0x472f('0x4e')]({'where':{'id':_0x29cd74['params']['id']}})[_0x472f('0x21')](handleEntityNotFound(_0x383ba7,null))['then'](function(_0x43390b){if(_0x43390b){_0x29cd74[_0x472f('0x47')][_0x472f('0x4f')]=_0x43390b['id'];_0x29cd74[_0x472f('0x47')][_0x472f('0x50')]=integrations[_0x472f('0x51')](_0x29cd74[_0x472f('0x47')]['channel'],_0x29cd74[_0x472f('0x47')][_0x472f('0x3a')]);_0x29cd74[_0x472f('0x47')][_0x472f('0x52')]=integrations['getDescriptions'](_0x29cd74['body'][_0x472f('0x53')],_0x29cd74[_0x472f('0x47')]['type']);return db[_0x472f('0x4a')][_0x472f('0x46')](_0x29cd74[_0x472f('0x47')],{'include':[{'model':db[_0x472f('0x54')],'as':_0x472f('0x50')},{'model':db[_0x472f('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x383ba7,null))[_0x472f('0x43')](handleError(_0x383ba7,null));};var md5=require(_0x472f('0x55'));exports[_0x472f('0x56')]=function(_0x4e88be,_0x51c387,_0x1e05a8){var _0x10a368=null;var _0x37a096=null;var _0x513756=null;var _0x3dfbb6=null;var _0x423979='';return db[_0x472f('0x3e')][_0x472f('0x4e')]({'where':{'id':_0x4e88be[_0x472f('0x45')]['id']},'attributes':['id',_0x472f('0x26'),_0x472f('0x57'),'description',_0x472f('0x58'),_0x472f('0x59'),_0x472f('0x5a'),'accessKey']})[_0x472f('0x21')](handleEntityNotFound(_0x51c387,null))[_0x472f('0x21')](function(_0x1e0785){if(_0x1e0785){_0x10a368=_0x1e0785[_0x472f('0x57')];_0x37a096=_0x1e0785[_0x472f('0x5b')];_0x513756=_0x1e0785[_0x472f('0x58')];_0x423979=_0x1e0785[_0x472f('0x59')];var _0x2af772=_0x423979[_0x472f('0x5c')](-0x1);if(_0x2af772==='/'){_0x423979=_0x423979[_0x472f('0x5d')](0x0,_0x423979[_0x472f('0x5e')](_0x2af772));}_0x3dfbb6=util[_0x472f('0x5f')]('%s/webservice.php',_0x423979);var _0x1d155c={'method':_0x472f('0x60'),'uri':_0x3dfbb6,'qs':{'operation':'getchallenge','username':_0x1e0785['username']},'json':!![]};return rp(_0x1d155c);}})[_0x472f('0x21')](function(_0x38847c){if(_0x38847c[_0x472f('0x61')]){var _0x47293f={'method':_0x472f('0x62'),'uri':_0x3dfbb6,'form':{'operation':'login','username':_0x10a368,'accessKey':md5(_0x38847c[_0x472f('0x63')][_0x472f('0x64')]+_0x37a096)},'json':!![]};return rp(_0x47293f);}})[_0x472f('0x21')](function(_0x3a4a5f){if(_0x3a4a5f[_0x472f('0x61')]){var _0xe77d02={'method':_0x472f('0x60'),'uri':_0x3dfbb6,'qs':{'operation':_0x472f('0x65'),'username':_0x10a368,'sessionName':_0x3a4a5f[_0x472f('0x63')]['sessionName'],'elementType':_0x513756},'json':!![]};return rp(_0xe77d02);}})[_0x472f('0x21')](function(_0x468f3f){if(_0x468f3f['success']){var _0x5cd993=[_0x472f('0x66'),_0x472f('0x67'),_0x472f('0x68')];_['remove'](_0x468f3f[_0x472f('0x63')][_0x472f('0x32')],function(_0x489f0b){return _0x5cd993[_0x472f('0x69')](_0x489f0b[_0x472f('0x3a')][_0x472f('0x26')]);});_[_0x472f('0x6a')](_0x468f3f[_0x472f('0x63')][_0x472f('0x32')],function(_0x41beaa){return _0x41beaa[_0x472f('0x6b')]==='false';});return{'count':_0x468f3f[_0x472f('0x63')][_0x472f('0x32')]['length'],'rows':_['map'](_0x468f3f['result'][_0x472f('0x32')],function(_0x52c2cf){return{'id':_0x52c2cf[_0x472f('0x26')],'name':_0x52c2cf[_0x472f('0x6c')],'custom':_['startsWith'](_0x52c2cf[_0x472f('0x26')],'cf_')?!![]:![],'options':_0x52c2cf['type'][_0x472f('0x26')]===_0x472f('0x6d')&&_0x52c2cf['type'][_0x472f('0x6e')]['length']>0x0?_[_0x472f('0x2d')](_0x52c2cf[_0x472f('0x3a')]['picklistValues'],function(_0x1b1a57){return{'name':_0x1b1a57[_0x472f('0x6c')],'value':_0x1b1a57[_0x472f('0x6f')]};}):[]};})};}})[_0x472f('0x21')](respondWithResult(_0x51c387,null))[_0x472f('0x43')](function(_0x243df8){console[_0x472f('0x70')](_0x472f('0x71')+_0x243df8);var _0x59b2d5=_0x4e88be[_0x472f('0x2e')][_0x472f('0x72')]?0x1f4:_0x243df8[_0x472f('0x73')]||0x1f4;logger[_0x472f('0x74')](_0x472f('0x75'),_0x472f('0x56'),_0x59b2d5,JSON[_0x472f('0x76')](_0x243df8));delete _0x243df8[_0x472f('0x26')];if(_0x59b2d5===0x191){_0x59b2d5=0x190;}_0x51c387[_0x472f('0x18')](_0x59b2d5)[_0x472f('0x27')](_0x4e88be[_0x472f('0x2e')][_0x472f('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x243df8['statusCode']}:_0x243df8);});}; \ No newline at end of file +var _0x95af=['serverUrl','accessKey','remoteUri','slice','substring','lastIndexOf','format','getchallenge','success','POST','result','token','describe','sessionName','reference','remove','false','label','startsWith','cf_','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','options','find','create','body','findOne','VtigerConfiguration','pick','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','getFields','username','description','moduleName'];(function(_0x1d8f38,_0x47221b){var _0x5d1b8a=function(_0x45017a){while(--_0x45017a){_0x1d8f38['push'](_0x1d8f38['shift']());}};_0x5d1b8a(++_0x47221b);}(_0x95af,0x98));var _0xf95a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x95af[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xf95a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf95a('0x1'));var jsonpatch=require(_0xf95a('0x2'));var rp=require(_0xf95a('0x3'));var moment=require(_0xf95a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf95a('0x5'));var util=require(_0xf95a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf95a('0x7'));var ejs=require(_0xf95a('0x8'));var fs=require('fs');var fs_extra=require(_0xf95a('0x9'));var _=require(_0xf95a('0xa'));var squel=require(_0xf95a('0xb'));var crypto=require(_0xf95a('0xc'));var jsforce=require(_0xf95a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf95a('0x7'));var querystring=require('querystring');var Papa=require(_0xf95a('0xe'));var Redis=require(_0xf95a('0xf'));var authService=require(_0xf95a('0x10'));var qs=require(_0xf95a('0x11'));var as=require(_0xf95a('0x12'));var hardwareService=require(_0xf95a('0x13'));var logger=require('../../config/logger')(_0xf95a('0x14'));var utils=require(_0xf95a('0x15'));var config=require(_0xf95a('0x16'));var licenseUtil=require(_0xf95a('0x17'));var db=require(_0xf95a('0x18'))['db'];var integrations=require(_0xf95a('0x19'));function respondWithStatusCode(_0x4902f9,_0x58229d){_0x58229d=_0x58229d||0xcc;return function(_0x32afe5){if(_0x32afe5){return _0x4902f9[_0xf95a('0x1a')](_0x58229d);}return _0x4902f9[_0xf95a('0x1b')](_0x58229d)[_0xf95a('0x1c')]();};}function respondWithResult(_0x54ed3a,_0x6ecc46){_0x6ecc46=_0x6ecc46||0xc8;return function(_0x128347){if(_0x128347){return _0x54ed3a[_0xf95a('0x1b')](_0x6ecc46)[_0xf95a('0x1d')](_0x128347);}};}function respondWithFilteredResult(_0x388070,_0x54e792){return function(_0x25ca94){if(_0x25ca94){var _0x37d194=typeof _0x54e792[_0xf95a('0x1e')]==='undefined'&&typeof _0x54e792['limit']==='undefined';var _0x1a91ab=_0x25ca94[_0xf95a('0x1f')];var _0x2ded8a=_0x37d194?0x0:_0x54e792[_0xf95a('0x1e')];var _0x53f1e2=_0x37d194?_0x25ca94[_0xf95a('0x1f')]:_0x54e792['offset']+_0x54e792[_0xf95a('0x20')];var _0x4b2f29;if(_0x53f1e2>=_0x1a91ab){_0x53f1e2=_0x1a91ab;_0x4b2f29=0xc8;}else{_0x4b2f29=0xce;}_0x388070[_0xf95a('0x1b')](_0x4b2f29);return _0x388070[_0xf95a('0x21')](_0xf95a('0x22'),_0x2ded8a+'-'+_0x53f1e2+'/'+_0x1a91ab)[_0xf95a('0x1d')](_0x25ca94);}return null;};}function patchUpdates(_0x234a59){return function(_0x1ac901){try{jsonpatch[_0xf95a('0x23')](_0x1ac901,_0x234a59,!![]);}catch(_0xc96638){return BPromise[_0xf95a('0x24')](_0xc96638);}return _0x1ac901[_0xf95a('0x25')]();};}function saveUpdates(_0xbe3ea4,_0x378d5e){return function(_0x9fbe0d){if(_0x9fbe0d){return _0x9fbe0d[_0xf95a('0x26')](_0xbe3ea4)[_0xf95a('0x27')](function(_0x53ceb1){return _0x53ceb1;});}return null;};}function removeEntity(_0x300000,_0xd51d61){return function(_0x21decf){if(_0x21decf){return _0x21decf[_0xf95a('0x28')]()['then'](function(){_0x300000[_0xf95a('0x1b')](0xcc)[_0xf95a('0x1c')]();});}};}function handleEntityNotFound(_0x5b8405,_0x154695){return function(_0x5b6377){if(!_0x5b6377){_0x5b8405[_0xf95a('0x1a')](0x194);}return _0x5b6377;};}function handleError(_0x2ac013,_0xa301c5){_0xa301c5=_0xa301c5||0x1f4;return function(_0x191256){logger[_0xf95a('0x29')](_0x191256[_0xf95a('0x2a')]);if(_0x191256[_0xf95a('0x2b')]){delete _0x191256['name'];}_0x2ac013[_0xf95a('0x1b')](_0xa301c5)['send'](_0x191256);};}exports[_0xf95a('0x2c')]=function(_0x1d4758,_0x59c4f0){var _0x564e1b={},_0x5140c5={},_0x55bc19={'count':0x0,'rows':[]};var _0x3105e1=_[_0xf95a('0x2d')](db[_0xf95a('0x2e')][_0xf95a('0x2f')],function(_0x35935f){return{'name':_0x35935f[_0xf95a('0x30')],'type':_0x35935f[_0xf95a('0x31')][_0xf95a('0x32')]};});_0x5140c5[_0xf95a('0x33')]=_[_0xf95a('0x2d')](_0x3105e1,'name');_0x5140c5[_0xf95a('0x34')]=_[_0xf95a('0x35')](_0x1d4758['query']);_0x5140c5['filters']=_[_0xf95a('0x36')](_0x5140c5['model'],_0x5140c5['query']);_0x564e1b[_0xf95a('0x37')]=_[_0xf95a('0x36')](_0x5140c5[_0xf95a('0x33')],qs[_0xf95a('0x38')](_0x1d4758[_0xf95a('0x34')][_0xf95a('0x38')]));_0x564e1b[_0xf95a('0x37')]=_0x564e1b['attributes'][_0xf95a('0x39')]?_0x564e1b[_0xf95a('0x37')]:_0x5140c5[_0xf95a('0x33')];if(!_0x1d4758[_0xf95a('0x34')]['hasOwnProperty'](_0xf95a('0x3a'))){_0x564e1b['limit']=qs[_0xf95a('0x20')](_0x1d4758[_0xf95a('0x34')][_0xf95a('0x20')]);_0x564e1b['offset']=qs[_0xf95a('0x1e')](_0x1d4758[_0xf95a('0x34')][_0xf95a('0x1e')]);}_0x564e1b[_0xf95a('0x3b')]=qs[_0xf95a('0x3c')](_0x1d4758[_0xf95a('0x34')]['sort']);_0x564e1b[_0xf95a('0x3d')]=qs['filters'](_['pick'](_0x1d4758[_0xf95a('0x34')],_0x5140c5[_0xf95a('0x3e')]),_0x3105e1);if(_0x1d4758[_0xf95a('0x34')][_0xf95a('0x3f')]){_0x564e1b[_0xf95a('0x3d')]=_[_0xf95a('0x40')](_0x564e1b[_0xf95a('0x3d')],{'$or':_[_0xf95a('0x2d')](_0x3105e1,function(_0x47a258){if(_0x47a258[_0xf95a('0x31')]!==_0xf95a('0x41')){var _0x519b47={};_0x519b47[_0x47a258[_0xf95a('0x2b')]]={'$like':'%'+_0x1d4758['query'][_0xf95a('0x3f')]+'%'};return _0x519b47;}})});}_0x564e1b=_[_0xf95a('0x40')]({},_0x564e1b,_0x1d4758['options']);var _0x29a562={'where':_0x564e1b[_0xf95a('0x3d')]};return db[_0xf95a('0x2e')]['count'](_0x29a562)[_0xf95a('0x27')](function(_0x4f8bd4){_0x55bc19['count']=_0x4f8bd4;if(_0x1d4758['query'][_0xf95a('0x42')]){_0x564e1b[_0xf95a('0x43')]=[{'all':!![]}];}return db[_0xf95a('0x2e')]['findAll'](_0x564e1b);})['then'](function(_0x2c3c1c){_0x55bc19[_0xf95a('0x44')]=_0x2c3c1c;return _0x55bc19;})[_0xf95a('0x27')](respondWithFilteredResult(_0x59c4f0,_0x564e1b))[_0xf95a('0x45')](handleError(_0x59c4f0,null));};exports['show']=function(_0x47abe3,_0x275e44){var _0x27cc2c={'raw':![],'where':{'id':_0x47abe3[_0xf95a('0x46')]['id']}},_0x3507fa={};_0x3507fa[_0xf95a('0x33')]=_[_0xf95a('0x35')](db[_0xf95a('0x2e')][_0xf95a('0x2f')]);_0x3507fa[_0xf95a('0x34')]=_[_0xf95a('0x35')](_0x47abe3['query']);_0x3507fa[_0xf95a('0x3e')]=_[_0xf95a('0x36')](_0x3507fa[_0xf95a('0x33')],_0x3507fa[_0xf95a('0x34')]);_0x27cc2c['attributes']=_[_0xf95a('0x36')](_0x3507fa[_0xf95a('0x33')],qs['fields'](_0x47abe3['query'][_0xf95a('0x38')]));_0x27cc2c[_0xf95a('0x37')]=_0x27cc2c['attributes']['length']?_0x27cc2c[_0xf95a('0x37')]:_0x3507fa['model'];if(_0x47abe3[_0xf95a('0x34')][_0xf95a('0x42')]){_0x27cc2c[_0xf95a('0x43')]=[{'all':!![]}];}_0x27cc2c=_['merge']({},_0x27cc2c,_0x47abe3[_0xf95a('0x47')]);return db[_0xf95a('0x2e')][_0xf95a('0x48')](_0x27cc2c)['then'](handleEntityNotFound(_0x275e44,null))[_0xf95a('0x27')](respondWithResult(_0x275e44,null))['catch'](handleError(_0x275e44,null));};exports[_0xf95a('0x49')]=function(_0x315390,_0x542108){return db[_0xf95a('0x2e')]['create'](_0x315390[_0xf95a('0x4a')],{})['then'](respondWithResult(_0x542108,0xc9))[_0xf95a('0x45')](handleError(_0x542108,null));};exports['update']=function(_0x4f92c8,_0x6f0b32){if(_0x4f92c8[_0xf95a('0x4a')]['id']){delete _0x4f92c8[_0xf95a('0x4a')]['id'];}return db[_0xf95a('0x2e')][_0xf95a('0x48')]({'where':{'id':_0x4f92c8['params']['id']}})[_0xf95a('0x27')](handleEntityNotFound(_0x6f0b32,null))[_0xf95a('0x27')](saveUpdates(_0x4f92c8[_0xf95a('0x4a')],null))[_0xf95a('0x27')](respondWithResult(_0x6f0b32,null))[_0xf95a('0x45')](handleError(_0x6f0b32,null));};exports[_0xf95a('0x28')]=function(_0x48b03b,_0xc8c3f6){return db[_0xf95a('0x2e')][_0xf95a('0x48')]({'where':{'id':_0x48b03b[_0xf95a('0x46')]['id']}})[_0xf95a('0x27')](handleEntityNotFound(_0xc8c3f6,null))[_0xf95a('0x27')](removeEntity(_0xc8c3f6,null))[_0xf95a('0x45')](handleError(_0xc8c3f6,null));};exports['getConfigurations']=function(_0x5dfd84,_0x27dedf,_0x560a4f){var _0x50b9d3={};var _0x4b4eba={};var _0x1f25f5;var _0x45a0bf;return db[_0xf95a('0x2e')][_0xf95a('0x4b')]({'where':{'id':_0x5dfd84['params']['id']}})['then'](handleEntityNotFound(_0x27dedf,null))[_0xf95a('0x27')](function(_0x3b82fb){if(_0x3b82fb){_0x1f25f5=_0x3b82fb;_0x4b4eba['model']=_[_0xf95a('0x35')](db[_0xf95a('0x4c')][_0xf95a('0x2f')]);_0x4b4eba[_0xf95a('0x34')]=_[_0xf95a('0x35')](_0x5dfd84['query']);_0x4b4eba[_0xf95a('0x3e')]=_[_0xf95a('0x36')](_0x4b4eba['model'],_0x4b4eba['query']);_0x50b9d3[_0xf95a('0x37')]=_[_0xf95a('0x36')](_0x4b4eba[_0xf95a('0x33')],qs['fields'](_0x5dfd84[_0xf95a('0x34')][_0xf95a('0x38')]));_0x50b9d3[_0xf95a('0x37')]=_0x50b9d3[_0xf95a('0x37')][_0xf95a('0x39')]?_0x50b9d3[_0xf95a('0x37')]:_0x4b4eba['model'];_0x50b9d3[_0xf95a('0x3b')]=qs['sort'](_0x5dfd84[_0xf95a('0x34')]['sort']);_0x50b9d3[_0xf95a('0x3d')]=qs[_0xf95a('0x3e')](_[_0xf95a('0x4d')](_0x5dfd84['query'],_0x4b4eba['filters']));if(_0x5dfd84[_0xf95a('0x34')][_0xf95a('0x3f')]){_0x50b9d3[_0xf95a('0x3d')]=_[_0xf95a('0x40')](_0x50b9d3[_0xf95a('0x3d')],{'$or':_[_0xf95a('0x2d')](_0x50b9d3['attributes'],function(_0x4a6f91){var _0x1a28b3={};_0x1a28b3[_0x4a6f91]={'$like':'%'+_0x5dfd84[_0xf95a('0x34')][_0xf95a('0x3f')]+'%'};return _0x1a28b3;})});}_0x50b9d3=_[_0xf95a('0x40')]({},_0x50b9d3,_0x5dfd84[_0xf95a('0x47')]);return _0x1f25f5[_0xf95a('0x4e')](_0x50b9d3);}})[_0xf95a('0x27')](function(_0xa6bce5){if(_0xa6bce5){_0x45a0bf=_0xa6bce5[_0xf95a('0x39')];if(!_0x5dfd84[_0xf95a('0x34')][_0xf95a('0x4f')]('nolimit')){_0x50b9d3[_0xf95a('0x20')]=qs[_0xf95a('0x20')](_0x5dfd84[_0xf95a('0x34')][_0xf95a('0x20')]);_0x50b9d3[_0xf95a('0x1e')]=qs[_0xf95a('0x1e')](_0x5dfd84[_0xf95a('0x34')][_0xf95a('0x1e')]);}return _0x1f25f5[_0xf95a('0x4e')](_0x50b9d3);}})[_0xf95a('0x27')](function(_0x523b9b){if(_0x523b9b){return _0x523b9b?{'count':_0x45a0bf,'rows':_0x523b9b}:null;}})[_0xf95a('0x27')](respondWithResult(_0x27dedf,null))['catch'](handleError(_0x27dedf,null));};exports[_0xf95a('0x50')]=function(_0x5f426d,_0x4bd4fd,_0x147acd){if(_0x5f426d['body']['id']){delete _0x5f426d[_0xf95a('0x4a')]['id'];}return db[_0xf95a('0x2e')][_0xf95a('0x4b')]({'where':{'id':_0x5f426d[_0xf95a('0x46')]['id']}})['then'](handleEntityNotFound(_0x4bd4fd,null))[_0xf95a('0x27')](function(_0x1812b1){if(_0x1812b1){_0x5f426d['body'][_0xf95a('0x51')]=_0x1812b1['id'];_0x5f426d['body'][_0xf95a('0x52')]=integrations[_0xf95a('0x53')](_0x5f426d['body']['channel'],_0x5f426d['body']['type']);_0x5f426d[_0xf95a('0x4a')][_0xf95a('0x54')]=integrations[_0xf95a('0x55')](_0x5f426d[_0xf95a('0x4a')][_0xf95a('0x56')],_0x5f426d['body'][_0xf95a('0x31')]);return db[_0xf95a('0x4c')]['create'](_0x5f426d[_0xf95a('0x4a')],{'include':[{'model':db[_0xf95a('0x57')],'as':_0xf95a('0x52')},{'model':db[_0xf95a('0x57')],'as':_0xf95a('0x54')}]});}return null;})['then'](respondWithResult(_0x4bd4fd,null))[_0xf95a('0x45')](handleError(_0x4bd4fd,null));};var md5=require('md5');exports[_0xf95a('0x58')]=function(_0x3ee10f,_0x47a880,_0x2a5e21){var _0x459037=null;var _0x77ac63=null;var _0x5b457f=null;var _0x41e80f=null;var _0x27083a='';return db['VtigerAccount'][_0xf95a('0x4b')]({'where':{'id':_0x3ee10f[_0xf95a('0x46')]['id']},'attributes':['id',_0xf95a('0x2b'),_0xf95a('0x59'),_0xf95a('0x5a'),_0xf95a('0x5b'),'remoteUri',_0xf95a('0x5c'),_0xf95a('0x5d')]})[_0xf95a('0x27')](handleEntityNotFound(_0x47a880,null))[_0xf95a('0x27')](function(_0x22275e){if(_0x22275e){_0x459037=_0x22275e[_0xf95a('0x59')];_0x77ac63=_0x22275e['accessKey'];_0x5b457f=_0x22275e['moduleName'];_0x27083a=_0x22275e[_0xf95a('0x5e')];var _0x2a7339=_0x27083a[_0xf95a('0x5f')](-0x1);if(_0x2a7339==='/'){_0x27083a=_0x27083a[_0xf95a('0x60')](0x0,_0x27083a[_0xf95a('0x61')](_0x2a7339));}_0x41e80f=util[_0xf95a('0x62')]('%s/webservice.php',_0x27083a);var _0xc638d2={'method':'GET','uri':_0x41e80f,'qs':{'operation':_0xf95a('0x63'),'username':_0x22275e[_0xf95a('0x59')]},'json':!![]};return rp(_0xc638d2);}})['then'](function(_0x2ec9d2){if(_0x2ec9d2[_0xf95a('0x64')]){var _0x2ac17c={'method':_0xf95a('0x65'),'uri':_0x41e80f,'form':{'operation':'login','username':_0x459037,'accessKey':md5(_0x2ec9d2[_0xf95a('0x66')][_0xf95a('0x67')]+_0x77ac63)},'json':!![]};return rp(_0x2ac17c);}})['then'](function(_0x27bb89){if(_0x27bb89[_0xf95a('0x64')]){var _0x3ed8c5={'method':'GET','uri':_0x41e80f,'qs':{'operation':_0xf95a('0x68'),'username':_0x459037,'sessionName':_0x27bb89['result'][_0xf95a('0x69')],'elementType':_0x5b457f},'json':!![]};return rp(_0x3ed8c5);}})['then'](function(_0x370531){if(_0x370531[_0xf95a('0x64')]){var _0x225ed3=['autogenerated',_0xf95a('0x6a'),'owner'];_[_0xf95a('0x6b')](_0x370531[_0xf95a('0x66')]['fields'],function(_0x45d52b){return _0x225ed3['includes'](_0x45d52b[_0xf95a('0x31')][_0xf95a('0x2b')]);});_[_0xf95a('0x6b')](_0x370531[_0xf95a('0x66')][_0xf95a('0x38')],function(_0x3240ba){return _0x3240ba['editable']===_0xf95a('0x6c');});return{'count':_0x370531[_0xf95a('0x66')][_0xf95a('0x38')][_0xf95a('0x39')],'rows':_[_0xf95a('0x2d')](_0x370531['result'][_0xf95a('0x38')],function(_0x5d5f12){return{'id':_0x5d5f12[_0xf95a('0x2b')],'name':_0x5d5f12[_0xf95a('0x6d')],'custom':_[_0xf95a('0x6e')](_0x5d5f12['name'],_0xf95a('0x6f'))?!![]:![],'options':_0x5d5f12[_0xf95a('0x31')][_0xf95a('0x2b')]==='picklist'&&_0x5d5f12['type'][_0xf95a('0x70')]['length']>0x0?_['map'](_0x5d5f12[_0xf95a('0x31')][_0xf95a('0x70')],function(_0x48fd87){return{'name':_0x48fd87[_0xf95a('0x6d')],'value':_0x48fd87[_0xf95a('0x71')]};}):[]};})};}})['then'](respondWithResult(_0x47a880,null))[_0xf95a('0x45')](function(_0x4b4c1a){console[_0xf95a('0x72')](_0xf95a('0x73')+_0x4b4c1a);var _0x1708f5=_0x3ee10f[_0xf95a('0x34')]['test']?0x1f4:_0x4b4c1a[_0xf95a('0x74')]||0x1f4;logger[_0xf95a('0x29')](_0xf95a('0x75'),_0xf95a('0x58'),_0x1708f5,JSON[_0xf95a('0x76')](_0x4b4c1a));delete _0x4b4c1a['name'];if(_0x1708f5===0x191){_0x1708f5=0x190;}_0x47a880[_0xf95a('0x1b')](_0x1708f5)[_0xf95a('0x77')](_0x3ee10f['query'][_0xf95a('0x78')]?{'message':_0xf95a('0x79'),'statusCode':_0x4b4c1a[_0xf95a('0x74')]}:_0x4b4c1a);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 06c5679..6b8575f 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 _0xdbee=['lodash','../../config/logger','bluebird','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount'];(function(_0x1fbdd6,_0x21ad1f){var _0x8a8600=function(_0x31a1c3){while(--_0x31a1c3){_0x1fbdd6['push'](_0x1fbdd6['shift']());}};_0x8a8600(++_0x21ad1f);}(_0xdbee,0x1c0));var _0xedbe=function(_0xc84695,_0x5e17e3){_0xc84695=_0xc84695-0x0;var _0x310f79=_0xdbee[_0xc84695];return _0x310f79;};'use strict';var _=require(_0xedbe('0x0'));var util=require('util');var logger=require(_0xedbe('0x1'))('api');var moment=require('moment');var BPromise=require(_0xedbe('0x2'));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(_0xedbe('0x3'));var integrations=require(_0xedbe('0x4'));module[_0xedbe('0x5')]=function(_0x45215a,_0x6d221b){return _0x45215a['define'](_0xedbe('0x6'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0ad=['rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x53051a,_0x430d67){var _0x253366=function(_0x47cdbd){while(--_0x47cdbd){_0x53051a['push'](_0x53051a['shift']());}};_0x253366(++_0x430d67);}(_0xa0ad,0xd7));var _0xda0a=function(_0x5ebf44,_0x4e543e){_0x5ebf44=_0x5ebf44-0x0;var _0x2fef12=_0xa0ad[_0x5ebf44];return _0x2fef12;};'use strict';var _=require(_0xda0a('0x0'));var util=require(_0xda0a('0x1'));var logger=require(_0xda0a('0x2'))('api');var moment=require(_0xda0a('0x3'));var BPromise=require('bluebird');var rp=require(_0xda0a('0x4'));var fs=require('fs');var path=require(_0xda0a('0x5'));var rimraf=require(_0xda0a('0x6'));var config=require(_0xda0a('0x7'));var attributes=require(_0xda0a('0x8'));var integrations=require(_0xda0a('0x9'));module[_0xda0a('0xa')]=function(_0x2cabbd,_0x1f7dda){return _0x2cabbd['define'](_0xda0a('0xb'),attributes,{'tableName':_0xda0a('0xc'),'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 2635dc6..06ec4a6 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 _0xee5b=['map','model','attributes','catch','ShowVtigerAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','include'];(function(_0x3ce3bc,_0x3530af){var _0x31100b=function(_0x2a2f46){while(--_0x2a2f46){_0x3ce3bc['push'](_0x3ce3bc['shift']());}};_0x31100b(++_0x3530af);}(_0xee5b,0x1f4));var _0xbee5=function(_0x3d472b,_0x5da346){_0x3d472b=_0x3d472b-0x0;var _0x36f99c=_0xee5b[_0x3d472b];return _0x36f99c;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var moment=require(_0xbee5('0x1'));var BPromise=require(_0xbee5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbee5('0x3'));var db=require(_0xbee5('0x4'))['db'];var utils=require(_0xbee5('0x5'));var logger=require(_0xbee5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbee5('0x7'));var client=jayson[_0xbee5('0x8')][_0xbee5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x804ab8,_0x4f5065,_0x5505e3){return new BPromise(function(_0x53d5b9,_0x5baf5c){return client['request'](_0x804ab8,_0x5505e3)[_0xbee5('0xa')](function(_0x7dda04){logger[_0xbee5('0xb')](_0xbee5('0xc'),_0x4f5065,'request\x20sent');logger[_0xbee5('0xd')](_0xbee5('0xe'),_0x4f5065,_0xbee5('0xf'),JSON[_0xbee5('0x10')](_0x7dda04));if(_0x7dda04[_0xbee5('0x11')]){if(_0x7dda04[_0xbee5('0x11')][_0xbee5('0x12')]===0x1f4){logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error'][_0xbee5('0x13')]);return _0x5baf5c(_0x7dda04['error'][_0xbee5('0x13')]);}logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error']['message']);return _0x53d5b9(_0x7dda04[_0xbee5('0x11')]['message']);}else{logger[_0xbee5('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x4f5065,_0xbee5('0xf'));_0x53d5b9(_0x7dda04[_0xbee5('0x14')][_0xbee5('0x13')]);}})['catch'](function(_0x27e034){logger[_0xbee5('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x4f5065,_0x27e034);_0x5baf5c(_0x27e034);});});}exports[_0xbee5('0x15')]=function(_0x538460){var _0x11b4a3=this;return new Promise(function(_0x3c3f4e,_0x35eb5c){return db[_0xbee5('0x16')][_0xbee5('0x17')]({'raw':_0x538460[_0xbee5('0x18')]?_0x538460[_0xbee5('0x18')][_0xbee5('0x19')]===undefined?!![]:![]:!![],'where':_0x538460[_0xbee5('0x18')]?_0x538460[_0xbee5('0x18')][_0xbee5('0x1a')]||null:null,'attributes':_0x538460[_0xbee5('0x18')]?_0x538460[_0xbee5('0x18')]['attributes']||null:null,'limit':_0x538460['options']?_0x538460[_0xbee5('0x18')]['limit']||null:null,'include':_0x538460[_0xbee5('0x18')]?_0x538460[_0xbee5('0x18')][_0xbee5('0x1b')]?_[_0xbee5('0x1c')](_0x538460[_0xbee5('0x18')][_0xbee5('0x1b')],function(_0x359ccf){return{'model':db[_0x359ccf[_0xbee5('0x1d')]],'as':_0x359ccf['as'],'attributes':_0x359ccf[_0xbee5('0x1e')],'include':_0x359ccf['include']?_['map'](_0x359ccf['include'],function(_0x519473){return{'model':db[_0x519473['model']],'as':_0x519473['as'],'attributes':_0x519473[_0xbee5('0x1e')],'include':_0x519473[_0xbee5('0x1b')]?_[_0xbee5('0x1c')](_0x519473[_0xbee5('0x1b')],function(_0x169042){return{'model':db[_0x169042[_0xbee5('0x1d')]],'as':_0x169042['as'],'attributes':_0x169042[_0xbee5('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36b50f){logger[_0xbee5('0xb')](_0xbee5('0x15'),_0x538460);logger[_0xbee5('0xd')](_0xbee5('0x15'),_0x538460,JSON['stringify'](_0x36b50f));_0x3c3f4e(_0x36b50f);})[_0xbee5('0x1f')](function(_0x15ffb1){logger[_0xbee5('0x11')](_0xbee5('0x15'),_0x15ffb1[_0xbee5('0x13')],_0x538460);_0x35eb5c(_0x11b4a3[_0xbee5('0x11')](0x1f4,_0x15ffb1[_0xbee5('0x13')]));});});};exports[_0xbee5('0x20')]=function(_0x2ccb91){var _0x59c2e4=this;return new Promise(function(_0x22df5f,_0x5b10a6){return db[_0xbee5('0x16')]['find']({'raw':_0x2ccb91[_0xbee5('0x18')]?_0x2ccb91['options'][_0xbee5('0x19')]===undefined?!![]:![]:!![],'where':_0x2ccb91['options']?_0x2ccb91[_0xbee5('0x18')][_0xbee5('0x1a')]||null:null,'attributes':_0x2ccb91[_0xbee5('0x18')]?_0x2ccb91[_0xbee5('0x18')]['attributes']||null:null,'include':_0x2ccb91[_0xbee5('0x18')]?_0x2ccb91[_0xbee5('0x18')][_0xbee5('0x1b')]?_[_0xbee5('0x1c')](_0x2ccb91['options'][_0xbee5('0x1b')],function(_0x28f8e3){return{'model':db[_0x28f8e3[_0xbee5('0x1d')]],'as':_0x28f8e3['as'],'attributes':_0x28f8e3[_0xbee5('0x1e')],'include':_0x28f8e3['include']?_[_0xbee5('0x1c')](_0x28f8e3[_0xbee5('0x1b')],function(_0x3e854){return{'model':db[_0x3e854[_0xbee5('0x1d')]],'as':_0x3e854['as'],'attributes':_0x3e854['attributes'],'include':_0x3e854[_0xbee5('0x1b')]?_['map'](_0x3e854[_0xbee5('0x1b')],function(_0x58a2e3){return{'model':db[_0x58a2e3['model']],'as':_0x58a2e3['as'],'attributes':_0x58a2e3['attributes']};}):[]};}):[]};}):[]:[]})[_0xbee5('0xa')](function(_0x315523){logger[_0xbee5('0xb')](_0xbee5('0x20'),_0x2ccb91);logger[_0xbee5('0xd')](_0xbee5('0x20'),_0x2ccb91,JSON[_0xbee5('0x10')](_0x315523));_0x22df5f(_0x315523);})[_0xbee5('0x1f')](function(_0x58452a){logger[_0xbee5('0x11')]('ShowVtigerAccount',_0x58452a[_0xbee5('0x13')],_0x2ccb91);_0x5b10a6(_0x59c2e4[_0xbee5('0x11')](0x1f4,_0x58452a[_0xbee5('0x13')]));});});}; \ No newline at end of file +var _0x91a7=['VtigerAccount,\x20%s,\x20%s','catch','GetVtigerAccount','options','raw','where','attributes','limit','include','map','model','ShowVtigerAccount','VtigerAccount','find','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','message'];(function(_0x1f76d1,_0xd73d2f){var _0x41f619=function(_0x28945a){while(--_0x28945a){_0x1f76d1['push'](_0x1f76d1['shift']());}};_0x41f619(++_0xd73d2f);}(_0x91a7,0xe7));var _0x791a=function(_0x1ac0aa,_0x396873){_0x1ac0aa=_0x1ac0aa-0x0;var _0x3a9b06=_0x91a7[_0x1ac0aa];return _0x3a9b06;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var moment=require(_0x791a('0x1'));var BPromise=require(_0x791a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x791a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x791a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x791a('0x5'));var jayson=require(_0x791a('0x6'));var client=jayson['client'][_0x791a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5db6db,_0x33baac,_0x159e24){return new BPromise(function(_0x5aa10a,_0x1a32b4){return client[_0x791a('0x8')](_0x5db6db,_0x159e24)[_0x791a('0x9')](function(_0x80ff65){logger[_0x791a('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));logger[_0x791a('0xc')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'),JSON[_0x791a('0xd')](_0x80ff65));if(_0x80ff65[_0x791a('0xe')]){if(_0x80ff65[_0x791a('0xe')][_0x791a('0xf')]===0x1f4){logger[_0x791a('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x1a32b4(_0x80ff65[_0x791a('0xe')]['message']);}logger[_0x791a('0xe')](_0x791a('0x11'),_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x5aa10a(_0x80ff65[_0x791a('0xe')][_0x791a('0x10')]);}else{logger[_0x791a('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));_0x5aa10a(_0x80ff65['result'][_0x791a('0x10')]);}})[_0x791a('0x12')](function(_0x49ae3e){logger[_0x791a('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x49ae3e);_0x1a32b4(_0x49ae3e);});});}exports[_0x791a('0x13')]=function(_0x52941d){var _0x4a84ee=this;return new Promise(function(_0x588d00,_0x40f0d3){return db['VtigerAccount']['findAll']({'raw':_0x52941d[_0x791a('0x14')]?_0x52941d[_0x791a('0x14')][_0x791a('0x15')]===undefined?!![]:![]:!![],'where':_0x52941d[_0x791a('0x14')]?_0x52941d['options'][_0x791a('0x16')]||null:null,'attributes':_0x52941d[_0x791a('0x14')]?_0x52941d[_0x791a('0x14')][_0x791a('0x17')]||null:null,'limit':_0x52941d['options']?_0x52941d[_0x791a('0x14')][_0x791a('0x18')]||null:null,'include':_0x52941d[_0x791a('0x14')]?_0x52941d[_0x791a('0x14')][_0x791a('0x19')]?_[_0x791a('0x1a')](_0x52941d[_0x791a('0x14')][_0x791a('0x19')],function(_0x323c6a){return{'model':db[_0x323c6a[_0x791a('0x1b')]],'as':_0x323c6a['as'],'attributes':_0x323c6a[_0x791a('0x17')],'include':_0x323c6a['include']?_[_0x791a('0x1a')](_0x323c6a[_0x791a('0x19')],function(_0x380329){return{'model':db[_0x380329[_0x791a('0x1b')]],'as':_0x380329['as'],'attributes':_0x380329['attributes'],'include':_0x380329[_0x791a('0x19')]?_[_0x791a('0x1a')](_0x380329['include'],function(_0xdfa84f){return{'model':db[_0xdfa84f[_0x791a('0x1b')]],'as':_0xdfa84f['as'],'attributes':_0xdfa84f[_0x791a('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29194d){logger[_0x791a('0xa')](_0x791a('0x13'),_0x52941d);logger[_0x791a('0xc')](_0x791a('0x13'),_0x52941d,JSON[_0x791a('0xd')](_0x29194d));_0x588d00(_0x29194d);})[_0x791a('0x12')](function(_0x889534){logger['error'](_0x791a('0x13'),_0x889534[_0x791a('0x10')],_0x52941d);_0x40f0d3(_0x4a84ee[_0x791a('0xe')](0x1f4,_0x889534['message']));});});};exports[_0x791a('0x1c')]=function(_0x5df656){var _0xc59f5e=this;return new Promise(function(_0x2e4ec8,_0xcde862){return db[_0x791a('0x1d')][_0x791a('0x1e')]({'raw':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')][_0x791a('0x16')]||null:null,'attributes':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')]['attributes']||null:null,'include':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')][_0x791a('0x19')]?_[_0x791a('0x1a')](_0x5df656[_0x791a('0x14')]['include'],function(_0x305836){return{'model':db[_0x305836[_0x791a('0x1b')]],'as':_0x305836['as'],'attributes':_0x305836[_0x791a('0x17')],'include':_0x305836[_0x791a('0x19')]?_[_0x791a('0x1a')](_0x305836['include'],function(_0xd5609){return{'model':db[_0xd5609['model']],'as':_0xd5609['as'],'attributes':_0xd5609[_0x791a('0x17')],'include':_0xd5609['include']?_['map'](_0xd5609[_0x791a('0x19')],function(_0x404530){return{'model':db[_0x404530[_0x791a('0x1b')]],'as':_0x404530['as'],'attributes':_0x404530[_0x791a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x791a('0x9')](function(_0x3f46be){logger[_0x791a('0xa')]('ShowVtigerAccount',_0x5df656);logger[_0x791a('0xc')]('ShowVtigerAccount',_0x5df656,JSON[_0x791a('0xd')](_0x3f46be));_0x2e4ec8(_0x3f46be);})['catch'](function(_0x25e8cc){logger[_0x791a('0xe')]('ShowVtigerAccount',_0x25e8cc[_0x791a('0x10')],_0x5df656);_0xcde862(_0xc59f5e[_0x791a('0xe')](0x1f4,_0x25e8cc['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 61d0e7a..2cf04e5 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 _0x6f27=['/:id/descriptions','getDescriptions','post','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x36a410,_0x4b16c1){var _0x5ef5ab=function(_0x32560a){while(--_0x32560a){_0x36a410['push'](_0x36a410['shift']());}};_0x5ef5ab(++_0x4b16c1);}(_0x6f27,0x73));var _0x76f2=function(_0x6b888e,_0x420fed){_0x6b888e=_0x6b888e-0x0;var _0x17d0f6=_0x6f27[_0x6b888e];return _0x17d0f6;};'use strict';var multer=require(_0x76f2('0x0'));var util=require(_0x76f2('0x1'));var path=require(_0x76f2('0x2'));var timeout=require(_0x76f2('0x3'));var express=require(_0x76f2('0x4'));var router=express[_0x76f2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x76f2('0x6'));var interaction=require(_0x76f2('0x7'));var config=require(_0x76f2('0x8'));var controller=require(_0x76f2('0x9'));router[_0x76f2('0xa')]('/',auth[_0x76f2('0xb')](),controller['index']);router[_0x76f2('0xa')](_0x76f2('0xc'),auth['isAuthenticated'](),controller[_0x76f2('0xd')]);router[_0x76f2('0xa')](_0x76f2('0xe'),auth[_0x76f2('0xb')](),controller[_0x76f2('0xf')]);router[_0x76f2('0xa')](_0x76f2('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x76f2('0xa')](_0x76f2('0x11'),auth[_0x76f2('0xb')](),controller[_0x76f2('0x12')]);router[_0x76f2('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x76f2('0xc'),auth['isAuthenticated'](),controller[_0x76f2('0x14')]);router['delete'](_0x76f2('0xc'),auth[_0x76f2('0xb')](),controller[_0x76f2('0x15')]);module['exports']=router; \ No newline at end of file +var _0x55e4=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1a6be0,_0x518f7f){var _0x3625a3=function(_0x5d512e){while(--_0x5d512e){_0x1a6be0['push'](_0x1a6be0['shift']());}};_0x3625a3(++_0x518f7f);}(_0x55e4,0x153));var _0x455e=function(_0x465d56,_0x32c514){_0x465d56=_0x465d56-0x0;var _0x544ae3=_0x55e4[_0x465d56];return _0x544ae3;};'use strict';var multer=require(_0x455e('0x0'));var util=require('util');var path=require(_0x455e('0x1'));var timeout=require(_0x455e('0x2'));var express=require(_0x455e('0x3'));var router=express[_0x455e('0x4')]();var fs_extra=require(_0x455e('0x5'));var auth=require(_0x455e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x455e('0x7'));var controller=require('./intVtigerConfiguration.controller');router[_0x455e('0x8')]('/',auth[_0x455e('0x9')](),controller[_0x455e('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x455e('0xb')]);router['get'](_0x455e('0xc'),auth['isAuthenticated'](),controller[_0x455e('0xd')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x455e('0xe'),auth[_0x455e('0x9')](),controller[_0x455e('0xf')]);router[_0x455e('0x10')]('/',auth[_0x455e('0x9')](),controller[_0x455e('0x11')]);router[_0x455e('0x12')](_0x455e('0x13'),auth[_0x455e('0x9')](),controller[_0x455e('0x14')]);router[_0x455e('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x455e('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 8fe2bfc..fc3f429 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 _0x39d3=['exports','STRING','sequelize'];(function(_0x76cc84,_0x1e8b58){var _0x5bf683=function(_0x2e5626){while(--_0x2e5626){_0x76cc84['push'](_0x76cc84['shift']());}};_0x5bf683(++_0x1e8b58);}(_0x39d3,0x1cd));var _0x339d=function(_0x53c49d,_0x3fc43e){_0x53c49d=_0x53c49d-0x0;var _0x117277=_0x39d3[_0x53c49d];return _0x117277;};'use strict';var Sequelize=require(_0x339d('0x0'));module[_0x339d('0x1')]={'name':{'type':Sequelize[_0x339d('0x2')]},'description':{'type':Sequelize[_0x339d('0x2')]}}; \ No newline at end of file +var _0x0240=['exports','sequelize'];(function(_0x31eddb,_0x2c3ee5){var _0x123e0d=function(_0x211340){while(--_0x211340){_0x31eddb['push'](_0x31eddb['shift']());}};_0x123e0d(++_0x2c3ee5);}(_0x0240,0x177));var _0x0024=function(_0x35c911,_0x37e542){_0x35c911=_0x35c911-0x0;var _0xe7debc=_0x0240[_0x35c911];return _0xe7debc;};'use strict';var Sequelize=require(_0x0024('0x0'));module[_0x0024('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index e27f36e..04f0cfb 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 _0x1961=['query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','params','options','create','body','destroy','find','findOne','VtigerField','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','count','limit','set','Content-Range','save','update','then','error','stack','name','send','index','VtigerConfiguration','rawAttributes','fieldName','type','key','model','map'];(function(_0x110d7a,_0x3cb471){var _0x13a2f2=function(_0x194d7a){while(--_0x194d7a){_0x110d7a['push'](_0x110d7a['shift']());}};_0x13a2f2(++_0x3cb471);}(_0x1961,0x10c));var _0x1196=function(_0x525812,_0x2ae9aa){_0x525812=_0x525812-0x0;var _0x534f9d=_0x1961[_0x525812];return _0x534f9d;};'use strict';var emlformat=require(_0x1196('0x0'));var rimraf=require(_0x1196('0x1'));var zipdir=require(_0x1196('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1196('0x3'));var moment=require(_0x1196('0x4'));var BPromise=require(_0x1196('0x5'));var Mustache=require(_0x1196('0x6'));var util=require('util');var path=require(_0x1196('0x7'));var sox=require(_0x1196('0x8'));var csv=require('to-csv');var ejs=require(_0x1196('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1196('0xa'));var jsforce=require(_0x1196('0xb'));var deskjs=require(_0x1196('0xc'));var toCsv=require(_0x1196('0xd'));var querystring=require(_0x1196('0xe'));var Papa=require(_0x1196('0xf'));var Redis=require(_0x1196('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1196('0x11'));var hardwareService=require(_0x1196('0x12'));var logger=require(_0x1196('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1196('0x14'));var licenseUtil=require(_0x1196('0x15'));var db=require(_0x1196('0x16'))['db'];function respondWithStatusCode(_0x10e6d4,_0x49c39d){_0x49c39d=_0x49c39d||0xcc;return function(_0x390e10){if(_0x390e10){return _0x10e6d4[_0x1196('0x17')](_0x49c39d);}return _0x10e6d4['status'](_0x49c39d)[_0x1196('0x18')]();};}function respondWithResult(_0x3f815b,_0x44fee9){_0x44fee9=_0x44fee9||0xc8;return function(_0x38fabd){if(_0x38fabd){return _0x3f815b[_0x1196('0x19')](_0x44fee9)[_0x1196('0x1a')](_0x38fabd);}};}function respondWithFilteredResult(_0xfab473,_0x52204e){return function(_0x23e7c7){if(_0x23e7c7){var _0x3fdef1=typeof _0x52204e['offset']==='undefined'&&typeof _0x52204e['limit']===_0x1196('0x1b');var _0x24e249=_0x23e7c7['count'];var _0x312d8d=_0x3fdef1?0x0:_0x52204e[_0x1196('0x1c')];var _0x3c542a=_0x3fdef1?_0x23e7c7[_0x1196('0x1d')]:_0x52204e[_0x1196('0x1c')]+_0x52204e[_0x1196('0x1e')];var _0x238ba7;if(_0x3c542a>=_0x24e249){_0x3c542a=_0x24e249;_0x238ba7=0xc8;}else{_0x238ba7=0xce;}_0xfab473[_0x1196('0x19')](_0x238ba7);return _0xfab473[_0x1196('0x1f')](_0x1196('0x20'),_0x312d8d+'-'+_0x3c542a+'/'+_0x24e249)['json'](_0x23e7c7);}return null;};}function patchUpdates(_0x20d10e){return function(_0x30384c){try{jsonpatch['apply'](_0x30384c,_0x20d10e,!![]);}catch(_0x379eaa){return BPromise['reject'](_0x379eaa);}return _0x30384c[_0x1196('0x21')]();};}function saveUpdates(_0x292905,_0x154161){return function(_0x40c4f7){if(_0x40c4f7){return _0x40c4f7[_0x1196('0x22')](_0x292905)[_0x1196('0x23')](function(_0x41f9e0){return _0x41f9e0;});}return null;};}function removeEntity(_0x4bbade,_0x4cb4f8){return function(_0x3c5f24){if(_0x3c5f24){return _0x3c5f24['destroy']()[_0x1196('0x23')](function(){_0x4bbade[_0x1196('0x19')](0xcc)[_0x1196('0x18')]();});}};}function handleEntityNotFound(_0x544ce7,_0x1fc236){return function(_0x6e0843){if(!_0x6e0843){_0x544ce7[_0x1196('0x17')](0x194);}return _0x6e0843;};}function handleError(_0x5a8d22,_0x4687fb){_0x4687fb=_0x4687fb||0x1f4;return function(_0x3c28c7){logger[_0x1196('0x24')](_0x3c28c7[_0x1196('0x25')]);if(_0x3c28c7[_0x1196('0x26')]){delete _0x3c28c7['name'];}_0x5a8d22[_0x1196('0x19')](_0x4687fb)[_0x1196('0x27')](_0x3c28c7);};}exports[_0x1196('0x28')]=function(_0x368e1b,_0x5f247a){var _0x134447={},_0x10b3f9={},_0xf17f00={'count':0x0,'rows':[]};var _0x3a8f71=_['map'](db[_0x1196('0x29')][_0x1196('0x2a')],function(_0x3156e2){return{'name':_0x3156e2[_0x1196('0x2b')],'type':_0x3156e2[_0x1196('0x2c')][_0x1196('0x2d')]};});_0x10b3f9[_0x1196('0x2e')]=_[_0x1196('0x2f')](_0x3a8f71,'name');_0x10b3f9[_0x1196('0x30')]=_[_0x1196('0x31')](_0x368e1b[_0x1196('0x30')]);_0x10b3f9['filters']=_[_0x1196('0x32')](_0x10b3f9[_0x1196('0x2e')],_0x10b3f9[_0x1196('0x30')]);_0x134447[_0x1196('0x33')]=_[_0x1196('0x32')](_0x10b3f9['model'],qs[_0x1196('0x34')](_0x368e1b[_0x1196('0x30')][_0x1196('0x34')]));_0x134447[_0x1196('0x33')]=_0x134447[_0x1196('0x33')][_0x1196('0x35')]?_0x134447['attributes']:_0x10b3f9[_0x1196('0x2e')];if(!_0x368e1b[_0x1196('0x30')][_0x1196('0x36')](_0x1196('0x37'))){_0x134447[_0x1196('0x1e')]=qs[_0x1196('0x1e')](_0x368e1b[_0x1196('0x30')]['limit']);_0x134447['offset']=qs[_0x1196('0x1c')](_0x368e1b[_0x1196('0x30')][_0x1196('0x1c')]);}_0x134447[_0x1196('0x38')]=qs[_0x1196('0x39')](_0x368e1b['query']['sort']);_0x134447[_0x1196('0x3a')]=qs[_0x1196('0x3b')](_[_0x1196('0x3c')](_0x368e1b['query'],_0x10b3f9[_0x1196('0x3b')]),_0x3a8f71);if(_0x368e1b[_0x1196('0x30')][_0x1196('0x3d')]){_0x134447['where']=_[_0x1196('0x3e')](_0x134447[_0x1196('0x3a')],{'$or':_[_0x1196('0x2f')](_0x3a8f71,function(_0x5f7736){if(_0x5f7736['type']!=='VIRTUAL'){var _0xbf55cf={};_0xbf55cf[_0x5f7736['name']]={'$like':'%'+_0x368e1b['query']['filter']+'%'};return _0xbf55cf;}})});}_0x134447=_[_0x1196('0x3e')]({},_0x134447,_0x368e1b['options']);var _0x59d310={'where':_0x134447[_0x1196('0x3a')]};return db[_0x1196('0x29')][_0x1196('0x1d')](_0x59d310)[_0x1196('0x23')](function(_0x4b784c){_0xf17f00[_0x1196('0x1d')]=_0x4b784c;if(_0x368e1b[_0x1196('0x30')][_0x1196('0x3f')]){_0x134447[_0x1196('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x1196('0x41')](_0x134447);})[_0x1196('0x23')](function(_0x2bde3f){_0xf17f00[_0x1196('0x42')]=_0x2bde3f;return _0xf17f00;})[_0x1196('0x23')](respondWithFilteredResult(_0x5f247a,_0x134447))[_0x1196('0x43')](handleError(_0x5f247a,null));};exports['show']=function(_0x4fcf08,_0x3be410){var _0x4a51b0={'raw':![],'where':{'id':_0x4fcf08[_0x1196('0x44')]['id']}},_0x319f75={};_0x319f75[_0x1196('0x2e')]=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x319f75[_0x1196('0x30')]=_[_0x1196('0x31')](_0x4fcf08[_0x1196('0x30')]);_0x319f75[_0x1196('0x3b')]=_['intersection'](_0x319f75['model'],_0x319f75['query']);_0x4a51b0['attributes']=_['intersection'](_0x319f75[_0x1196('0x2e')],qs['fields'](_0x4fcf08[_0x1196('0x30')]['fields']));_0x4a51b0[_0x1196('0x33')]=_0x4a51b0[_0x1196('0x33')]['length']?_0x4a51b0[_0x1196('0x33')]:_0x319f75[_0x1196('0x2e')];if(_0x4fcf08[_0x1196('0x30')][_0x1196('0x3f')]){_0x4a51b0[_0x1196('0x40')]=[{'all':!![]}];}_0x4a51b0=_['merge']({},_0x4a51b0,_0x4fcf08[_0x1196('0x45')]);return db[_0x1196('0x29')]['find'](_0x4a51b0)['then'](handleEntityNotFound(_0x3be410,null))[_0x1196('0x23')](respondWithResult(_0x3be410,null))[_0x1196('0x43')](handleError(_0x3be410,null));};exports[_0x1196('0x46')]=function(_0x940dd0,_0x324bcd){return db[_0x1196('0x29')][_0x1196('0x46')](_0x940dd0[_0x1196('0x47')],{})['then'](respondWithResult(_0x324bcd,0xc9))[_0x1196('0x43')](handleError(_0x324bcd,null));};exports[_0x1196('0x22')]=function(_0x41a816,_0x1249c7){if(_0x41a816['body']['id']){delete _0x41a816[_0x1196('0x47')]['id'];}return db[_0x1196('0x29')]['find']({'where':{'id':_0x41a816['params']['id']}})[_0x1196('0x23')](handleEntityNotFound(_0x1249c7,null))[_0x1196('0x23')](saveUpdates(_0x41a816[_0x1196('0x47')],null))['then'](respondWithResult(_0x1249c7,null))['catch'](handleError(_0x1249c7,null));};exports[_0x1196('0x48')]=function(_0x1f00c4,_0x45351f){return db[_0x1196('0x29')][_0x1196('0x49')]({'where':{'id':_0x1f00c4['params']['id']}})[_0x1196('0x23')](handleEntityNotFound(_0x45351f,null))[_0x1196('0x23')](removeEntity(_0x45351f,null))[_0x1196('0x43')](handleError(_0x45351f,null));};exports['getFields']=function(_0x206901,_0x34a9d2,_0x48e8c7){var _0xccd81c={};var _0x6ac529={};var _0x542aaf;var _0x10a01c;return db[_0x1196('0x29')][_0x1196('0x4a')]({'where':{'id':_0x206901[_0x1196('0x44')]['id']}})['then'](handleEntityNotFound(_0x34a9d2,null))[_0x1196('0x23')](function(_0x4c842d){if(_0x4c842d){_0x542aaf=_0x4c842d;_0x6ac529['model']=_[_0x1196('0x31')](db[_0x1196('0x4b')][_0x1196('0x2a')]);_0x6ac529[_0x1196('0x30')]=_[_0x1196('0x31')](_0x206901['query']);_0x6ac529['filters']=_[_0x1196('0x32')](_0x6ac529[_0x1196('0x2e')],_0x6ac529[_0x1196('0x30')]);_0xccd81c[_0x1196('0x33')]=_['intersection'](_0x6ac529[_0x1196('0x2e')],qs['fields'](_0x206901[_0x1196('0x30')][_0x1196('0x34')]));_0xccd81c[_0x1196('0x33')]=_0xccd81c[_0x1196('0x33')][_0x1196('0x35')]?_0xccd81c[_0x1196('0x33')]:_0x6ac529[_0x1196('0x2e')];_0xccd81c['order']=qs['sort'](_0x206901[_0x1196('0x30')][_0x1196('0x39')]);_0xccd81c['where']=qs[_0x1196('0x3b')](_['pick'](_0x206901[_0x1196('0x30')],_0x6ac529[_0x1196('0x3b')]));if(_0x206901['query'][_0x1196('0x3d')]){_0xccd81c[_0x1196('0x3a')]=_[_0x1196('0x3e')](_0xccd81c[_0x1196('0x3a')],{'$or':_[_0x1196('0x2f')](_0xccd81c['attributes'],function(_0x5adcba){var _0x11471d={};_0x11471d[_0x5adcba]={'$like':'%'+_0x206901['query'][_0x1196('0x3d')]+'%'};return _0x11471d;})});}_0xccd81c=_['merge']({},_0xccd81c,_0x206901[_0x1196('0x45')]);return _0x542aaf[_0x1196('0x4c')](_0xccd81c);}})['then'](function(_0xf6adee){if(_0xf6adee){_0x10a01c=_0xf6adee['length'];if(!_0x206901[_0x1196('0x30')][_0x1196('0x36')](_0x1196('0x37'))){_0xccd81c[_0x1196('0x1e')]=qs[_0x1196('0x1e')](_0x206901['query'][_0x1196('0x1e')]);_0xccd81c[_0x1196('0x1c')]=qs[_0x1196('0x1c')](_0x206901[_0x1196('0x30')]['offset']);}return _0x542aaf['getFields'](_0xccd81c);}})[_0x1196('0x23')](function(_0x48f901){if(_0x48f901){return _0x48f901?{'count':_0x10a01c,'rows':_0x48f901}:null;}})[_0x1196('0x23')](respondWithResult(_0x34a9d2,null))[_0x1196('0x43')](handleError(_0x34a9d2,null));};exports[_0x1196('0x4d')]=function(_0x7a9b4e,_0x2092e5,_0x2c4f58){var _0x33a920={};var _0x3bdc4d={};var _0x47cfa;var _0x5f592d;return db['VtigerConfiguration'][_0x1196('0x4a')]({'where':{'id':_0x7a9b4e[_0x1196('0x44')]['id']}})[_0x1196('0x23')](handleEntityNotFound(_0x2092e5,null))['then'](function(_0x203cd9){if(_0x203cd9){_0x47cfa=_0x203cd9;_0x3bdc4d[_0x1196('0x2e')]=_[_0x1196('0x31')](db[_0x1196('0x4b')][_0x1196('0x2a')]);_0x3bdc4d[_0x1196('0x30')]=_[_0x1196('0x31')](_0x7a9b4e['query']);_0x3bdc4d[_0x1196('0x3b')]=_['intersection'](_0x3bdc4d[_0x1196('0x2e')],_0x3bdc4d[_0x1196('0x30')]);_0x33a920[_0x1196('0x33')]=_[_0x1196('0x32')](_0x3bdc4d[_0x1196('0x2e')],qs[_0x1196('0x34')](_0x7a9b4e['query'][_0x1196('0x34')]));_0x33a920['attributes']=_0x33a920['attributes'][_0x1196('0x35')]?_0x33a920[_0x1196('0x33')]:_0x3bdc4d[_0x1196('0x2e')];_0x33a920[_0x1196('0x38')]=qs[_0x1196('0x39')](_0x7a9b4e[_0x1196('0x30')]['sort']);_0x33a920[_0x1196('0x3a')]=qs[_0x1196('0x3b')](_['pick'](_0x7a9b4e[_0x1196('0x30')],_0x3bdc4d[_0x1196('0x3b')]));if(_0x7a9b4e[_0x1196('0x30')]['filter']){_0x33a920[_0x1196('0x3a')]=_[_0x1196('0x3e')](_0x33a920[_0x1196('0x3a')],{'$or':_[_0x1196('0x2f')](_0x33a920[_0x1196('0x33')],function(_0x36377d){var _0x16780f={};_0x16780f[_0x36377d]={'$like':'%'+_0x7a9b4e[_0x1196('0x30')]['filter']+'%'};return _0x16780f;})});}_0x33a920=_[_0x1196('0x3e')]({},_0x33a920,_0x7a9b4e[_0x1196('0x45')]);return _0x47cfa[_0x1196('0x4d')](_0x33a920);}})[_0x1196('0x23')](function(_0x1dbcae){if(_0x1dbcae){_0x5f592d=_0x1dbcae[_0x1196('0x35')];if(!_0x7a9b4e[_0x1196('0x30')]['hasOwnProperty']('nolimit')){_0x33a920[_0x1196('0x1e')]=qs[_0x1196('0x1e')](_0x7a9b4e['query'][_0x1196('0x1e')]);_0x33a920[_0x1196('0x1c')]=qs[_0x1196('0x1c')](_0x7a9b4e[_0x1196('0x30')]['offset']);}return _0x47cfa[_0x1196('0x4d')](_0x33a920);}})['then'](function(_0x98795){if(_0x98795){return _0x98795?{'count':_0x5f592d,'rows':_0x98795}:null;}})['then'](respondWithResult(_0x2092e5,null))[_0x1196('0x43')](handleError(_0x2092e5,null));};exports[_0x1196('0x4e')]=function(_0x3dbe0e,_0x405ba7,_0x157195){var _0x3b084c={};var _0x211185={};var _0x19a949;var _0x3b6b21;return db[_0x1196('0x29')]['findOne']({'where':{'id':_0x3dbe0e[_0x1196('0x44')]['id']}})['then'](handleEntityNotFound(_0x405ba7,null))['then'](function(_0x290a3d){if(_0x290a3d){_0x19a949=_0x290a3d;_0x211185[_0x1196('0x2e')]=_[_0x1196('0x31')](db[_0x1196('0x4b')][_0x1196('0x2a')]);_0x211185['query']=_[_0x1196('0x31')](_0x3dbe0e[_0x1196('0x30')]);_0x211185['filters']=_['intersection'](_0x211185[_0x1196('0x2e')],_0x211185[_0x1196('0x30')]);_0x3b084c['attributes']=_[_0x1196('0x32')](_0x211185[_0x1196('0x2e')],qs[_0x1196('0x34')](_0x3dbe0e[_0x1196('0x30')]['fields']));_0x3b084c[_0x1196('0x33')]=_0x3b084c['attributes'][_0x1196('0x35')]?_0x3b084c['attributes']:_0x211185['model'];_0x3b084c['order']=qs[_0x1196('0x39')](_0x3dbe0e['query'][_0x1196('0x39')]);_0x3b084c[_0x1196('0x3a')]=qs[_0x1196('0x3b')](_[_0x1196('0x3c')](_0x3dbe0e[_0x1196('0x30')],_0x211185[_0x1196('0x3b')]));if(_0x3dbe0e['query'][_0x1196('0x3d')]){_0x3b084c[_0x1196('0x3a')]=_[_0x1196('0x3e')](_0x3b084c[_0x1196('0x3a')],{'$or':_[_0x1196('0x2f')](_0x3b084c[_0x1196('0x33')],function(_0x59a987){var _0x2e07b6={};_0x2e07b6[_0x59a987]={'$like':'%'+_0x3dbe0e['query'][_0x1196('0x3d')]+'%'};return _0x2e07b6;})});}_0x3b084c=_[_0x1196('0x3e')]({},_0x3b084c,_0x3dbe0e[_0x1196('0x45')]);return _0x19a949[_0x1196('0x4e')](_0x3b084c);}})['then'](function(_0x17fd51){if(_0x17fd51){_0x3b6b21=_0x17fd51[_0x1196('0x35')];if(!_0x3dbe0e['query'][_0x1196('0x36')](_0x1196('0x37'))){_0x3b084c[_0x1196('0x1e')]=qs[_0x1196('0x1e')](_0x3dbe0e['query'][_0x1196('0x1e')]);_0x3b084c[_0x1196('0x1c')]=qs['offset'](_0x3dbe0e[_0x1196('0x30')][_0x1196('0x1c')]);}return _0x19a949[_0x1196('0x4e')](_0x3b084c);}})[_0x1196('0x23')](function(_0x217a0f){if(_0x217a0f){return _0x217a0f?{'count':_0x3b6b21,'rows':_0x217a0f}:null;}})[_0x1196('0x23')](respondWithResult(_0x405ba7,null))['catch'](handleError(_0x405ba7,null));}; \ No newline at end of file +var _0x389d=['map','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','params','options','find','catch','create','body','update','getFields','findOne','VtigerField','hasOwnProperty','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','save','then','destroy','error','name','VtigerConfiguration','rawAttributes','fieldName','type','key','model'];(function(_0x395edb,_0x28fd10){var _0x3dec79=function(_0xc5d4ba){while(--_0xc5d4ba){_0x395edb['push'](_0x395edb['shift']());}};_0x3dec79(++_0x28fd10);}(_0x389d,0x6f));var _0xd389=function(_0x3c2863,_0x1b2cee){_0x3c2863=_0x3c2863-0x0;var _0x2c3d27=_0x389d[_0x3c2863];return _0x2c3d27;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd389('0x0'));var jsonpatch=require(_0xd389('0x1'));var rp=require(_0xd389('0x2'));var moment=require(_0xd389('0x3'));var BPromise=require(_0xd389('0x4'));var Mustache=require(_0xd389('0x5'));var util=require(_0xd389('0x6'));var path=require(_0xd389('0x7'));var sox=require(_0xd389('0x8'));var csv=require(_0xd389('0x9'));var ejs=require(_0xd389('0xa'));var fs=require('fs');var fs_extra=require(_0xd389('0xb'));var _=require('lodash');var squel=require(_0xd389('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd389('0xd'));var toCsv=require(_0xd389('0x9'));var querystring=require(_0xd389('0xe'));var Papa=require(_0xd389('0xf'));var Redis=require('ioredis');var authService=require(_0xd389('0x10'));var qs=require(_0xd389('0x11'));var as=require(_0xd389('0x12'));var hardwareService=require(_0xd389('0x13'));var logger=require(_0xd389('0x14'))(_0xd389('0x15'));var utils=require(_0xd389('0x16'));var config=require(_0xd389('0x17'));var licenseUtil=require(_0xd389('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a989d,_0x2285d4){_0x2285d4=_0x2285d4||0xcc;return function(_0x41dda3){if(_0x41dda3){return _0x2a989d[_0xd389('0x19')](_0x2285d4);}return _0x2a989d[_0xd389('0x1a')](_0x2285d4)[_0xd389('0x1b')]();};}function respondWithResult(_0x53c3fa,_0x6472ab){_0x6472ab=_0x6472ab||0xc8;return function(_0x3f1ad8){if(_0x3f1ad8){return _0x53c3fa[_0xd389('0x1a')](_0x6472ab)['json'](_0x3f1ad8);}};}function respondWithFilteredResult(_0x3d9a09,_0xd8f1a6){return function(_0x3e9616){if(_0x3e9616){var _0x39d338=typeof _0xd8f1a6['offset']===_0xd389('0x1c')&&typeof _0xd8f1a6[_0xd389('0x1d')]===_0xd389('0x1c');var _0xaa0585=_0x3e9616['count'];var _0x288154=_0x39d338?0x0:_0xd8f1a6[_0xd389('0x1e')];var _0x4be6ea=_0x39d338?_0x3e9616[_0xd389('0x1f')]:_0xd8f1a6[_0xd389('0x1e')]+_0xd8f1a6[_0xd389('0x1d')];var _0x239edc;if(_0x4be6ea>=_0xaa0585){_0x4be6ea=_0xaa0585;_0x239edc=0xc8;}else{_0x239edc=0xce;}_0x3d9a09['status'](_0x239edc);return _0x3d9a09[_0xd389('0x20')](_0xd389('0x21'),_0x288154+'-'+_0x4be6ea+'/'+_0xaa0585)[_0xd389('0x22')](_0x3e9616);}return null;};}function patchUpdates(_0x30d46a){return function(_0x53f83e){try{jsonpatch[_0xd389('0x23')](_0x53f83e,_0x30d46a,!![]);}catch(_0xc76bb9){return BPromise['reject'](_0xc76bb9);}return _0x53f83e[_0xd389('0x24')]();};}function saveUpdates(_0x2bfb2b,_0x110640){return function(_0x140172){if(_0x140172){return _0x140172['update'](_0x2bfb2b)[_0xd389('0x25')](function(_0x2e5359){return _0x2e5359;});}return null;};}function removeEntity(_0x152e93,_0x24765e){return function(_0x51581d){if(_0x51581d){return _0x51581d[_0xd389('0x26')]()['then'](function(){_0x152e93[_0xd389('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59de9e,_0x3d6436){return function(_0x4069f9){if(!_0x4069f9){_0x59de9e[_0xd389('0x19')](0x194);}return _0x4069f9;};}function handleError(_0x4a5234,_0x3bd3d6){_0x3bd3d6=_0x3bd3d6||0x1f4;return function(_0x23484c){logger[_0xd389('0x27')](_0x23484c['stack']);if(_0x23484c[_0xd389('0x28')]){delete _0x23484c[_0xd389('0x28')];}_0x4a5234['status'](_0x3bd3d6)['send'](_0x23484c);};}exports['index']=function(_0x52bfd1,_0x411d2d){var _0x19dbb0={},_0x44efa9={},_0x4fa124={'count':0x0,'rows':[]};var _0x84af69=_['map'](db[_0xd389('0x29')][_0xd389('0x2a')],function(_0x18978b){return{'name':_0x18978b[_0xd389('0x2b')],'type':_0x18978b[_0xd389('0x2c')][_0xd389('0x2d')]};});_0x44efa9[_0xd389('0x2e')]=_[_0xd389('0x2f')](_0x84af69,_0xd389('0x28'));_0x44efa9['query']=_[_0xd389('0x30')](_0x52bfd1[_0xd389('0x31')]);_0x44efa9[_0xd389('0x32')]=_['intersection'](_0x44efa9[_0xd389('0x2e')],_0x44efa9[_0xd389('0x31')]);_0x19dbb0[_0xd389('0x33')]=_[_0xd389('0x34')](_0x44efa9[_0xd389('0x2e')],qs['fields'](_0x52bfd1[_0xd389('0x31')][_0xd389('0x35')]));_0x19dbb0[_0xd389('0x33')]=_0x19dbb0[_0xd389('0x33')][_0xd389('0x36')]?_0x19dbb0[_0xd389('0x33')]:_0x44efa9[_0xd389('0x2e')];if(!_0x52bfd1['query']['hasOwnProperty'](_0xd389('0x37'))){_0x19dbb0[_0xd389('0x1d')]=qs[_0xd389('0x1d')](_0x52bfd1[_0xd389('0x31')]['limit']);_0x19dbb0[_0xd389('0x1e')]=qs[_0xd389('0x1e')](_0x52bfd1['query']['offset']);}_0x19dbb0[_0xd389('0x38')]=qs['sort'](_0x52bfd1[_0xd389('0x31')][_0xd389('0x39')]);_0x19dbb0[_0xd389('0x3a')]=qs[_0xd389('0x32')](_[_0xd389('0x3b')](_0x52bfd1[_0xd389('0x31')],_0x44efa9[_0xd389('0x32')]),_0x84af69);if(_0x52bfd1['query'][_0xd389('0x3c')]){_0x19dbb0[_0xd389('0x3a')]=_[_0xd389('0x3d')](_0x19dbb0['where'],{'$or':_[_0xd389('0x2f')](_0x84af69,function(_0x1be633){if(_0x1be633[_0xd389('0x2c')]!==_0xd389('0x3e')){var _0x23ea1e={};_0x23ea1e[_0x1be633[_0xd389('0x28')]]={'$like':'%'+_0x52bfd1['query'][_0xd389('0x3c')]+'%'};return _0x23ea1e;}})});}_0x19dbb0=_[_0xd389('0x3d')]({},_0x19dbb0,_0x52bfd1['options']);var _0x2faba3={'where':_0x19dbb0[_0xd389('0x3a')]};return db[_0xd389('0x29')][_0xd389('0x1f')](_0x2faba3)['then'](function(_0x5f26d5){_0x4fa124[_0xd389('0x1f')]=_0x5f26d5;if(_0x52bfd1[_0xd389('0x31')][_0xd389('0x3f')]){_0x19dbb0[_0xd389('0x40')]=[{'all':!![]}];}return db[_0xd389('0x29')]['findAll'](_0x19dbb0);})[_0xd389('0x25')](function(_0x46b40f){_0x4fa124[_0xd389('0x41')]=_0x46b40f;return _0x4fa124;})[_0xd389('0x25')](respondWithFilteredResult(_0x411d2d,_0x19dbb0))['catch'](handleError(_0x411d2d,null));};exports['show']=function(_0x54bc39,_0x13a2cd){var _0x20666d={'raw':![],'where':{'id':_0x54bc39[_0xd389('0x42')]['id']}},_0x52970f={};_0x52970f['model']=_['keys'](db[_0xd389('0x29')]['rawAttributes']);_0x52970f[_0xd389('0x31')]=_['keys'](_0x54bc39[_0xd389('0x31')]);_0x52970f['filters']=_[_0xd389('0x34')](_0x52970f['model'],_0x52970f[_0xd389('0x31')]);_0x20666d[_0xd389('0x33')]=_[_0xd389('0x34')](_0x52970f[_0xd389('0x2e')],qs[_0xd389('0x35')](_0x54bc39[_0xd389('0x31')][_0xd389('0x35')]));_0x20666d[_0xd389('0x33')]=_0x20666d[_0xd389('0x33')][_0xd389('0x36')]?_0x20666d[_0xd389('0x33')]:_0x52970f[_0xd389('0x2e')];if(_0x54bc39[_0xd389('0x31')][_0xd389('0x3f')]){_0x20666d[_0xd389('0x40')]=[{'all':!![]}];}_0x20666d=_['merge']({},_0x20666d,_0x54bc39[_0xd389('0x43')]);return db[_0xd389('0x29')][_0xd389('0x44')](_0x20666d)[_0xd389('0x25')](handleEntityNotFound(_0x13a2cd,null))['then'](respondWithResult(_0x13a2cd,null))[_0xd389('0x45')](handleError(_0x13a2cd,null));};exports[_0xd389('0x46')]=function(_0x225d7a,_0x31c9d9){return db[_0xd389('0x29')][_0xd389('0x46')](_0x225d7a[_0xd389('0x47')],{})['then'](respondWithResult(_0x31c9d9,0xc9))['catch'](handleError(_0x31c9d9,null));};exports[_0xd389('0x48')]=function(_0x1e89ec,_0x11cfd5){if(_0x1e89ec[_0xd389('0x47')]['id']){delete _0x1e89ec['body']['id'];}return db[_0xd389('0x29')]['find']({'where':{'id':_0x1e89ec[_0xd389('0x42')]['id']}})['then'](handleEntityNotFound(_0x11cfd5,null))[_0xd389('0x25')](saveUpdates(_0x1e89ec[_0xd389('0x47')],null))[_0xd389('0x25')](respondWithResult(_0x11cfd5,null))[_0xd389('0x45')](handleError(_0x11cfd5,null));};exports['destroy']=function(_0x72b242,_0x5e622a){return db['VtigerConfiguration'][_0xd389('0x44')]({'where':{'id':_0x72b242[_0xd389('0x42')]['id']}})['then'](handleEntityNotFound(_0x5e622a,null))[_0xd389('0x25')](removeEntity(_0x5e622a,null))[_0xd389('0x45')](handleError(_0x5e622a,null));};exports[_0xd389('0x49')]=function(_0x3e69fe,_0x71c362,_0x2f67e1){var _0x34e1cb={};var _0x254e85={};var _0x539870;var _0x5d66eb;return db['VtigerConfiguration'][_0xd389('0x4a')]({'where':{'id':_0x3e69fe[_0xd389('0x42')]['id']}})['then'](handleEntityNotFound(_0x71c362,null))[_0xd389('0x25')](function(_0x1ccf1c){if(_0x1ccf1c){_0x539870=_0x1ccf1c;_0x254e85[_0xd389('0x2e')]=_[_0xd389('0x30')](db[_0xd389('0x4b')]['rawAttributes']);_0x254e85['query']=_['keys'](_0x3e69fe[_0xd389('0x31')]);_0x254e85[_0xd389('0x32')]=_[_0xd389('0x34')](_0x254e85[_0xd389('0x2e')],_0x254e85[_0xd389('0x31')]);_0x34e1cb[_0xd389('0x33')]=_['intersection'](_0x254e85[_0xd389('0x2e')],qs[_0xd389('0x35')](_0x3e69fe['query']['fields']));_0x34e1cb[_0xd389('0x33')]=_0x34e1cb['attributes'][_0xd389('0x36')]?_0x34e1cb['attributes']:_0x254e85[_0xd389('0x2e')];_0x34e1cb[_0xd389('0x38')]=qs[_0xd389('0x39')](_0x3e69fe[_0xd389('0x31')][_0xd389('0x39')]);_0x34e1cb[_0xd389('0x3a')]=qs[_0xd389('0x32')](_[_0xd389('0x3b')](_0x3e69fe['query'],_0x254e85[_0xd389('0x32')]));if(_0x3e69fe['query'][_0xd389('0x3c')]){_0x34e1cb[_0xd389('0x3a')]=_[_0xd389('0x3d')](_0x34e1cb[_0xd389('0x3a')],{'$or':_['map'](_0x34e1cb[_0xd389('0x33')],function(_0x56744d){var _0x3e5eb2={};_0x3e5eb2[_0x56744d]={'$like':'%'+_0x3e69fe[_0xd389('0x31')][_0xd389('0x3c')]+'%'};return _0x3e5eb2;})});}_0x34e1cb=_[_0xd389('0x3d')]({},_0x34e1cb,_0x3e69fe['options']);return _0x539870[_0xd389('0x49')](_0x34e1cb);}})[_0xd389('0x25')](function(_0x192166){if(_0x192166){_0x5d66eb=_0x192166[_0xd389('0x36')];if(!_0x3e69fe[_0xd389('0x31')][_0xd389('0x4c')]('nolimit')){_0x34e1cb[_0xd389('0x1d')]=qs[_0xd389('0x1d')](_0x3e69fe[_0xd389('0x31')][_0xd389('0x1d')]);_0x34e1cb[_0xd389('0x1e')]=qs['offset'](_0x3e69fe[_0xd389('0x31')][_0xd389('0x1e')]);}return _0x539870['getFields'](_0x34e1cb);}})[_0xd389('0x25')](function(_0x35ba92){if(_0x35ba92){return _0x35ba92?{'count':_0x5d66eb,'rows':_0x35ba92}:null;}})[_0xd389('0x25')](respondWithResult(_0x71c362,null))[_0xd389('0x45')](handleError(_0x71c362,null));};exports[_0xd389('0x4d')]=function(_0x462897,_0x810354,_0x5d92ee){var _0x31b03d={};var _0x39a247={};var _0xe2f158;var _0x1035ef;return db[_0xd389('0x29')][_0xd389('0x4a')]({'where':{'id':_0x462897[_0xd389('0x42')]['id']}})[_0xd389('0x25')](handleEntityNotFound(_0x810354,null))[_0xd389('0x25')](function(_0x5b014e){if(_0x5b014e){_0xe2f158=_0x5b014e;_0x39a247[_0xd389('0x2e')]=_[_0xd389('0x30')](db[_0xd389('0x4b')][_0xd389('0x2a')]);_0x39a247[_0xd389('0x31')]=_[_0xd389('0x30')](_0x462897['query']);_0x39a247[_0xd389('0x32')]=_[_0xd389('0x34')](_0x39a247[_0xd389('0x2e')],_0x39a247[_0xd389('0x31')]);_0x31b03d[_0xd389('0x33')]=_['intersection'](_0x39a247[_0xd389('0x2e')],qs[_0xd389('0x35')](_0x462897['query'][_0xd389('0x35')]));_0x31b03d[_0xd389('0x33')]=_0x31b03d['attributes'][_0xd389('0x36')]?_0x31b03d[_0xd389('0x33')]:_0x39a247[_0xd389('0x2e')];_0x31b03d['order']=qs[_0xd389('0x39')](_0x462897[_0xd389('0x31')][_0xd389('0x39')]);_0x31b03d[_0xd389('0x3a')]=qs['filters'](_[_0xd389('0x3b')](_0x462897[_0xd389('0x31')],_0x39a247[_0xd389('0x32')]));if(_0x462897[_0xd389('0x31')][_0xd389('0x3c')]){_0x31b03d[_0xd389('0x3a')]=_['merge'](_0x31b03d['where'],{'$or':_['map'](_0x31b03d['attributes'],function(_0x4ac2fb){var _0x1a49a4={};_0x1a49a4[_0x4ac2fb]={'$like':'%'+_0x462897[_0xd389('0x31')]['filter']+'%'};return _0x1a49a4;})});}_0x31b03d=_[_0xd389('0x3d')]({},_0x31b03d,_0x462897[_0xd389('0x43')]);return _0xe2f158[_0xd389('0x4d')](_0x31b03d);}})[_0xd389('0x25')](function(_0x2fc222){if(_0x2fc222){_0x1035ef=_0x2fc222['length'];if(!_0x462897[_0xd389('0x31')][_0xd389('0x4c')]('nolimit')){_0x31b03d[_0xd389('0x1d')]=qs[_0xd389('0x1d')](_0x462897[_0xd389('0x31')][_0xd389('0x1d')]);_0x31b03d[_0xd389('0x1e')]=qs['offset'](_0x462897['query'][_0xd389('0x1e')]);}return _0xe2f158[_0xd389('0x4d')](_0x31b03d);}})['then'](function(_0x5ee762){if(_0x5ee762){return _0x5ee762?{'count':_0x1035ef,'rows':_0x5ee762}:null;}})[_0xd389('0x25')](respondWithResult(_0x810354,null))[_0xd389('0x45')](handleError(_0x810354,null));};exports['getDescriptions']=function(_0x2bf56f,_0x28da5a,_0xe581a1){var _0x281d0e={};var _0x2d38a2={};var _0x4b9fa6;var _0x43a119;return db[_0xd389('0x29')][_0xd389('0x4a')]({'where':{'id':_0x2bf56f[_0xd389('0x42')]['id']}})[_0xd389('0x25')](handleEntityNotFound(_0x28da5a,null))['then'](function(_0x17a0ce){if(_0x17a0ce){_0x4b9fa6=_0x17a0ce;_0x2d38a2[_0xd389('0x2e')]=_['keys'](db[_0xd389('0x4b')]['rawAttributes']);_0x2d38a2['query']=_[_0xd389('0x30')](_0x2bf56f[_0xd389('0x31')]);_0x2d38a2[_0xd389('0x32')]=_[_0xd389('0x34')](_0x2d38a2['model'],_0x2d38a2[_0xd389('0x31')]);_0x281d0e[_0xd389('0x33')]=_[_0xd389('0x34')](_0x2d38a2[_0xd389('0x2e')],qs['fields'](_0x2bf56f[_0xd389('0x31')][_0xd389('0x35')]));_0x281d0e[_0xd389('0x33')]=_0x281d0e[_0xd389('0x33')][_0xd389('0x36')]?_0x281d0e[_0xd389('0x33')]:_0x2d38a2['model'];_0x281d0e[_0xd389('0x38')]=qs[_0xd389('0x39')](_0x2bf56f[_0xd389('0x31')][_0xd389('0x39')]);_0x281d0e['where']=qs[_0xd389('0x32')](_[_0xd389('0x3b')](_0x2bf56f['query'],_0x2d38a2['filters']));if(_0x2bf56f['query'][_0xd389('0x3c')]){_0x281d0e['where']=_[_0xd389('0x3d')](_0x281d0e[_0xd389('0x3a')],{'$or':_[_0xd389('0x2f')](_0x281d0e[_0xd389('0x33')],function(_0x58324a){var _0x426e0b={};_0x426e0b[_0x58324a]={'$like':'%'+_0x2bf56f[_0xd389('0x31')][_0xd389('0x3c')]+'%'};return _0x426e0b;})});}_0x281d0e=_[_0xd389('0x3d')]({},_0x281d0e,_0x2bf56f[_0xd389('0x43')]);return _0x4b9fa6[_0xd389('0x4e')](_0x281d0e);}})[_0xd389('0x25')](function(_0x418b23){if(_0x418b23){_0x43a119=_0x418b23[_0xd389('0x36')];if(!_0x2bf56f['query'][_0xd389('0x4c')](_0xd389('0x37'))){_0x281d0e[_0xd389('0x1d')]=qs[_0xd389('0x1d')](_0x2bf56f[_0xd389('0x31')][_0xd389('0x1d')]);_0x281d0e['offset']=qs[_0xd389('0x1e')](_0x2bf56f[_0xd389('0x31')][_0xd389('0x1e')]);}return _0x4b9fa6[_0xd389('0x4e')](_0x281d0e);}})[_0xd389('0x25')](function(_0x3ace9d){if(_0x3ace9d){return _0x3ace9d?{'count':_0x43a119,'rows':_0x3ace9d}:null;}})[_0xd389('0x25')](respondWithResult(_0x28da5a,null))[_0xd389('0x45')](handleError(_0x28da5a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 67eb40c..03cf339 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 _0x57bd=['path','./intVtigerConfiguration.attributes','exports','define','util','../../config/logger','api','request-promise'];(function(_0x156d74,_0x454de9){var _0x2b913e=function(_0x5386a9){while(--_0x5386a9){_0x156d74['push'](_0x156d74['shift']());}};_0x2b913e(++_0x454de9);}(_0x57bd,0x6c));var _0xd57b=function(_0x4d09c7,_0x3a3964){_0x4d09c7=_0x4d09c7-0x0;var _0x51ad2c=_0x57bd[_0x4d09c7];return _0x51ad2c;};'use strict';var _=require('lodash');var util=require(_0xd57b('0x0'));var logger=require(_0xd57b('0x1'))(_0xd57b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd57b('0x3'));var fs=require('fs');var path=require(_0xd57b('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd57b('0x5'));module[_0xd57b('0x6')]=function(_0x1a83ef,_0x2e07e8){return _0x1a83ef[_0xd57b('0x7')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x081f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration'];(function(_0x42164a,_0x3ca230){var _0x38a7dd=function(_0x1e88f5){while(--_0x1e88f5){_0x42164a['push'](_0x42164a['shift']());}};_0x38a7dd(++_0x3ca230);}(_0x081f,0x18c));var _0xf081=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0x081f[_0x4da356];return _0x321b07;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf081('0x0'))(_0xf081('0x1'));var moment=require(_0xf081('0x2'));var BPromise=require(_0xf081('0x3'));var rp=require(_0xf081('0x4'));var fs=require('fs');var path=require(_0xf081('0x5'));var rimraf=require(_0xf081('0x6'));var config=require(_0xf081('0x7'));var attributes=require(_0xf081('0x8'));module['exports']=function(_0x5a727b,_0x14c74c){return _0x5a727b[_0xf081('0x9')](_0xf081('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 1949f19..0a72886 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 _0xeb98=['client','http','request','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xeb98,0x1aa));var _0x8eb9=function(_0x2b5382,_0x180a90){_0x2b5382=_0x2b5382-0x0;var _0x54a288=_0xeb98[_0x2b5382];return _0x54a288;};'use strict';var _=require(_0x8eb9('0x0'));var util=require(_0x8eb9('0x1'));var moment=require(_0x8eb9('0x2'));var BPromise=require(_0x8eb9('0x3'));var rs=require(_0x8eb9('0x4'));var fs=require('fs');var Redis=require(_0x8eb9('0x5'));var db=require(_0x8eb9('0x6'))['db'];var utils=require(_0x8eb9('0x7'));var logger=require(_0x8eb9('0x8'))('rpc');var config=require(_0x8eb9('0x9'));var jayson=require(_0x8eb9('0xa'));var client=jayson[_0x8eb9('0xb')][_0x8eb9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x103229,_0x431489,_0x4de9ed){return new BPromise(function(_0x29f55d,_0x3e1778){return client[_0x8eb9('0xd')](_0x103229,_0x4de9ed)['then'](function(_0x5e29c5){logger['info'](_0x8eb9('0xe'),_0x431489,_0x8eb9('0xf'));logger[_0x8eb9('0x10')](_0x8eb9('0x11'),_0x431489,_0x8eb9('0xf'),JSON[_0x8eb9('0x12')](_0x5e29c5));if(_0x5e29c5[_0x8eb9('0x13')]){if(_0x5e29c5[_0x8eb9('0x13')][_0x8eb9('0x14')]===0x1f4){logger[_0x8eb9('0x13')](_0x8eb9('0xe'),_0x431489,_0x5e29c5[_0x8eb9('0x13')][_0x8eb9('0x15')]);return _0x3e1778(_0x5e29c5[_0x8eb9('0x13')][_0x8eb9('0x15')]);}logger['error'](_0x8eb9('0xe'),_0x431489,_0x5e29c5['error'][_0x8eb9('0x15')]);return _0x29f55d(_0x5e29c5[_0x8eb9('0x13')][_0x8eb9('0x15')]);}else{logger[_0x8eb9('0x16')]('VtigerConfiguration,\x20%s,\x20%s',_0x431489,_0x8eb9('0xf'));_0x29f55d(_0x5e29c5['result']['message']);}})['catch'](function(_0x16805c){logger[_0x8eb9('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x431489,_0x16805c);_0x3e1778(_0x16805c);});});} \ No newline at end of file +var _0xea40=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x184496,_0x434675){var _0x1b8cd3=function(_0x51579e){while(--_0x51579e){_0x184496['push'](_0x184496['shift']());}};_0x1b8cd3(++_0x434675);}(_0xea40,0x1d0));var _0x0ea4=function(_0x314ccd,_0xb410af){_0x314ccd=_0x314ccd-0x0;var _0x27ed35=_0xea40[_0x314ccd];return _0x27ed35;};'use strict';var _=require(_0x0ea4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0ea4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ea4('0x2'));var db=require(_0x0ea4('0x3'))['db'];var utils=require(_0x0ea4('0x4'));var logger=require(_0x0ea4('0x5'))(_0x0ea4('0x6'));var config=require(_0x0ea4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0ea4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12b6e5,_0x25563d,_0x3716e9){return new BPromise(function(_0xcf4125,_0x356e1f){return client[_0x0ea4('0x9')](_0x12b6e5,_0x3716e9)[_0x0ea4('0xa')](function(_0x23451b){logger[_0x0ea4('0xb')](_0x0ea4('0xc'),_0x25563d,_0x0ea4('0xd'));logger['debug'](_0x0ea4('0xe'),_0x25563d,_0x0ea4('0xd'),JSON['stringify'](_0x23451b));if(_0x23451b[_0x0ea4('0xf')]){if(_0x23451b[_0x0ea4('0xf')][_0x0ea4('0x10')]===0x1f4){logger[_0x0ea4('0xf')](_0x0ea4('0xc'),_0x25563d,_0x23451b[_0x0ea4('0xf')][_0x0ea4('0x11')]);return _0x356e1f(_0x23451b['error']['message']);}logger['error'](_0x0ea4('0xc'),_0x25563d,_0x23451b[_0x0ea4('0xf')][_0x0ea4('0x11')]);return _0xcf4125(_0x23451b[_0x0ea4('0xf')][_0x0ea4('0x11')]);}else{logger[_0x0ea4('0xb')](_0x0ea4('0xc'),_0x25563d,'request\x20sent');_0xcf4125(_0x23451b['result'][_0x0ea4('0x11')]);}})[_0x0ea4('0x12')](function(_0x59e8e5){logger[_0x0ea4('0xf')](_0x0ea4('0xc'),_0x25563d,_0x59e8e5);_0x356e1f(_0x59e8e5);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index da29c29..4ff34c0 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 _0x96a5=['destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','isAuthenticated','show','post','create','put','/:id','delete'];(function(_0x1cd7f8,_0x2053de){var _0x154bac=function(_0x4fbb49){while(--_0x4fbb49){_0x1cd7f8['push'](_0x1cd7f8['shift']());}};_0x154bac(++_0x2053de);}(_0x96a5,0x91));var _0x596a=function(_0x2317a9,_0x500127){_0x2317a9=_0x2317a9-0x0;var _0x1bebf5=_0x96a5[_0x2317a9];return _0x1bebf5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x596a('0x0'));var timeout=require(_0x596a('0x1'));var express=require(_0x596a('0x2'));var router=express[_0x596a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x596a('0x4'));var interaction=require(_0x596a('0x5'));var config=require(_0x596a('0x6'));var controller=require(_0x596a('0x7'));router[_0x596a('0x8')]('/',auth['isAuthenticated'](),controller[_0x596a('0x9')]);router[_0x596a('0x8')]('/:id',auth[_0x596a('0xa')](),controller[_0x596a('0xb')]);router[_0x596a('0xc')]('/',auth['isAuthenticated'](),controller[_0x596a('0xd')]);router[_0x596a('0xe')](_0x596a('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x596a('0x10')](_0x596a('0xf'),auth[_0x596a('0xa')](),controller[_0x596a('0x11')]);module['exports']=router; \ No newline at end of file +var _0xfec3=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout'];(function(_0x2ea57d,_0x2494cf){var _0x4e4b67=function(_0x414afb){while(--_0x414afb){_0x2ea57d['push'](_0x2ea57d['shift']());}};_0x4e4b67(++_0x2494cf);}(_0xfec3,0x177));var _0x3fec=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfec3[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x3fec('0x0'));var util=require('util');var path=require(_0x3fec('0x1'));var timeout=require(_0x3fec('0x2'));var express=require(_0x3fec('0x3'));var router=express[_0x3fec('0x4')]();var fs_extra=require(_0x3fec('0x5'));var auth=require(_0x3fec('0x6'));var interaction=require(_0x3fec('0x7'));var config=require(_0x3fec('0x8'));var controller=require(_0x3fec('0x9'));router['get']('/',auth[_0x3fec('0xa')](),controller[_0x3fec('0xb')]);router[_0x3fec('0xc')](_0x3fec('0xd'),auth['isAuthenticated'](),controller[_0x3fec('0xe')]);router[_0x3fec('0xf')]('/',auth[_0x3fec('0xa')](),controller[_0x3fec('0x10')]);router[_0x3fec('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3fec('0x12')]);router[_0x3fec('0x13')]('/:id',auth[_0x3fec('0xa')](),controller[_0x3fec('0x14')]);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 e878e4f..a061cb0 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 _0xdad1=['ENUM','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x54456a,_0x2cce9f){var _0x3db32b=function(_0x29880f){while(--_0x29880f){_0x54456a['push'](_0x54456a['shift']());}};_0x3db32b(++_0x2cce9f);}(_0xdad1,0x8e));var _0x1dad=function(_0x4cf4fa,_0x29e1f1){_0x4cf4fa=_0x4cf4fa-0x0;var _0xda3b5a=_0xdad1[_0x4cf4fa];return _0xda3b5a;};'use strict';var Sequelize=require(_0x1dad('0x0'));module[_0x1dad('0x1')]={'type':{'type':Sequelize[_0x1dad('0x2')]('string','variable','customVariable',_0x1dad('0x3'),_0x1dad('0x4')),'defaultValue':_0x1dad('0x5')},'content':{'type':Sequelize[_0x1dad('0x6')]},'key':{'type':Sequelize[_0x1dad('0x6')]},'keyType':{'type':Sequelize[_0x1dad('0x2')](_0x1dad('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1dad('0x6')]},'nameField':{'type':Sequelize[_0x1dad('0x6')]},'customField':{'type':Sequelize[_0x1dad('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1dad('0x6')]}}; \ No newline at end of file +var _0xc197=['STRING','customVariable','sequelize','exports','ENUM','string','keyValue','picklist'];(function(_0x2b746e,_0x398130){var _0x1c4a61=function(_0x2b7e0f){while(--_0x2b7e0f){_0x2b746e['push'](_0x2b746e['shift']());}};_0x1c4a61(++_0x398130);}(_0xc197,0xaa));var _0x7c19=function(_0xa955,_0x212db5){_0xa955=_0xa955-0x0;var _0x265199=_0xc197[_0xa955];return _0x265199;};'use strict';var Sequelize=require(_0x7c19('0x0'));module[_0x7c19('0x1')]={'type':{'type':Sequelize[_0x7c19('0x2')](_0x7c19('0x3'),'variable','customVariable',_0x7c19('0x4'),_0x7c19('0x5')),'defaultValue':_0x7c19('0x3')},'content':{'type':Sequelize[_0x7c19('0x6')]},'key':{'type':Sequelize[_0x7c19('0x6')]},'keyType':{'type':Sequelize[_0x7c19('0x2')](_0x7c19('0x3'),'variable',_0x7c19('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7c19('0x6')]},'nameField':{'type':Sequelize[_0x7c19('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7c19('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index b03f24a..3dbd3c2 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 _0xd3f2=['include','findAll','rows','catch','show','params','options','find','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','count','limit','apply','reject','update','then','destroy','stack','name','send','map','VtigerField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll'];(function(_0x2b6876,_0x193ced){var _0x5e613e=function(_0x4d25b7){while(--_0x4d25b7){_0x2b6876['push'](_0x2b6876['shift']());}};_0x5e613e(++_0x193ced);}(_0xd3f2,0x1b9));var _0x2d3f=function(_0x20a6bd,_0xaeb074){_0x20a6bd=_0x20a6bd-0x0;var _0x318a91=_0xd3f2[_0x20a6bd];return _0x318a91;};'use strict';var emlformat=require(_0x2d3f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2d3f('0x1'));var rp=require(_0x2d3f('0x2'));var moment=require(_0x2d3f('0x3'));var BPromise=require(_0x2d3f('0x4'));var Mustache=require(_0x2d3f('0x5'));var util=require(_0x2d3f('0x6'));var path=require('path');var sox=require(_0x2d3f('0x7'));var csv=require(_0x2d3f('0x8'));var ejs=require(_0x2d3f('0x9'));var fs=require('fs');var fs_extra=require(_0x2d3f('0xa'));var _=require(_0x2d3f('0xb'));var squel=require(_0x2d3f('0xc'));var crypto=require('crypto');var jsforce=require(_0x2d3f('0xd'));var deskjs=require(_0x2d3f('0xe'));var toCsv=require(_0x2d3f('0x8'));var querystring=require(_0x2d3f('0xf'));var Papa=require(_0x2d3f('0x10'));var Redis=require(_0x2d3f('0x11'));var authService=require(_0x2d3f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2d3f('0x13'));var hardwareService=require(_0x2d3f('0x14'));var logger=require(_0x2d3f('0x15'))(_0x2d3f('0x16'));var utils=require(_0x2d3f('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2d3f('0x18'))['db'];function respondWithStatusCode(_0x566e13,_0x135d63){_0x135d63=_0x135d63||0xcc;return function(_0x5da457){if(_0x5da457){return _0x566e13[_0x2d3f('0x19')](_0x135d63);}return _0x566e13[_0x2d3f('0x1a')](_0x135d63)[_0x2d3f('0x1b')]();};}function respondWithResult(_0x1f9914,_0x114240){_0x114240=_0x114240||0xc8;return function(_0x3c6778){if(_0x3c6778){return _0x1f9914[_0x2d3f('0x1a')](_0x114240)[_0x2d3f('0x1c')](_0x3c6778);}};}function respondWithFilteredResult(_0xff16bd,_0x17b49b){return function(_0x27147d){if(_0x27147d){var _0x443e88=typeof _0x17b49b[_0x2d3f('0x1d')]==='undefined'&&typeof _0x17b49b['limit']==='undefined';var _0xb89673=_0x27147d[_0x2d3f('0x1e')];var _0x89ae5a=_0x443e88?0x0:_0x17b49b[_0x2d3f('0x1d')];var _0x41ba49=_0x443e88?_0x27147d['count']:_0x17b49b[_0x2d3f('0x1d')]+_0x17b49b[_0x2d3f('0x1f')];var _0x3321c5;if(_0x41ba49>=_0xb89673){_0x41ba49=_0xb89673;_0x3321c5=0xc8;}else{_0x3321c5=0xce;}_0xff16bd['status'](_0x3321c5);return _0xff16bd['set']('Content-Range',_0x89ae5a+'-'+_0x41ba49+'/'+_0xb89673)[_0x2d3f('0x1c')](_0x27147d);}return null;};}function patchUpdates(_0x14e51c){return function(_0x503a22){try{jsonpatch[_0x2d3f('0x20')](_0x503a22,_0x14e51c,!![]);}catch(_0x2e3a26){return BPromise[_0x2d3f('0x21')](_0x2e3a26);}return _0x503a22['save']();};}function saveUpdates(_0x5dd835,_0x455f08){return function(_0x3d0002){if(_0x3d0002){return _0x3d0002[_0x2d3f('0x22')](_0x5dd835)[_0x2d3f('0x23')](function(_0x59a230){return _0x59a230;});}return null;};}function removeEntity(_0x5e9bfc,_0xb5b715){return function(_0x36b5c2){if(_0x36b5c2){return _0x36b5c2[_0x2d3f('0x24')]()[_0x2d3f('0x23')](function(){_0x5e9bfc[_0x2d3f('0x1a')](0xcc)[_0x2d3f('0x1b')]();});}};}function handleEntityNotFound(_0x220e13,_0x50041f){return function(_0x3cfcbc){if(!_0x3cfcbc){_0x220e13[_0x2d3f('0x19')](0x194);}return _0x3cfcbc;};}function handleError(_0x5dc856,_0x4f621e){_0x4f621e=_0x4f621e||0x1f4;return function(_0x583aaa){logger['error'](_0x583aaa[_0x2d3f('0x25')]);if(_0x583aaa[_0x2d3f('0x26')]){delete _0x583aaa[_0x2d3f('0x26')];}_0x5dc856[_0x2d3f('0x1a')](_0x4f621e)[_0x2d3f('0x27')](_0x583aaa);};}exports['index']=function(_0x307676,_0x16f4f5){var _0x28385e={},_0x479b2f={},_0x1f94a7={'count':0x0,'rows':[]};var _0x3e10ef=_[_0x2d3f('0x28')](db[_0x2d3f('0x29')][_0x2d3f('0x2a')],function(_0x49c959){return{'name':_0x49c959[_0x2d3f('0x2b')],'type':_0x49c959[_0x2d3f('0x2c')][_0x2d3f('0x2d')]};});_0x479b2f['model']=_[_0x2d3f('0x28')](_0x3e10ef,_0x2d3f('0x26'));_0x479b2f[_0x2d3f('0x2e')]=_[_0x2d3f('0x2f')](_0x307676[_0x2d3f('0x2e')]);_0x479b2f[_0x2d3f('0x30')]=_[_0x2d3f('0x31')](_0x479b2f[_0x2d3f('0x32')],_0x479b2f[_0x2d3f('0x2e')]);_0x28385e[_0x2d3f('0x33')]=_['intersection'](_0x479b2f[_0x2d3f('0x32')],qs[_0x2d3f('0x34')](_0x307676[_0x2d3f('0x2e')][_0x2d3f('0x34')]));_0x28385e['attributes']=_0x28385e[_0x2d3f('0x33')][_0x2d3f('0x35')]?_0x28385e[_0x2d3f('0x33')]:_0x479b2f[_0x2d3f('0x32')];if(!_0x307676[_0x2d3f('0x2e')][_0x2d3f('0x36')](_0x2d3f('0x37'))){_0x28385e[_0x2d3f('0x1f')]=qs[_0x2d3f('0x1f')](_0x307676[_0x2d3f('0x2e')][_0x2d3f('0x1f')]);_0x28385e[_0x2d3f('0x1d')]=qs[_0x2d3f('0x1d')](_0x307676[_0x2d3f('0x2e')]['offset']);}_0x28385e[_0x2d3f('0x38')]=qs[_0x2d3f('0x39')](_0x307676[_0x2d3f('0x2e')][_0x2d3f('0x39')]);_0x28385e[_0x2d3f('0x3a')]=qs[_0x2d3f('0x30')](_[_0x2d3f('0x3b')](_0x307676[_0x2d3f('0x2e')],_0x479b2f[_0x2d3f('0x30')]),_0x3e10ef);if(_0x307676['query'][_0x2d3f('0x3c')]){_0x28385e['where']=_[_0x2d3f('0x3d')](_0x28385e[_0x2d3f('0x3a')],{'$or':_[_0x2d3f('0x28')](_0x3e10ef,function(_0x4ae9db){if(_0x4ae9db['type']!=='VIRTUAL'){var _0x3867ee={};_0x3867ee[_0x4ae9db['name']]={'$like':'%'+_0x307676[_0x2d3f('0x2e')][_0x2d3f('0x3c')]+'%'};return _0x3867ee;}})});}_0x28385e=_[_0x2d3f('0x3d')]({},_0x28385e,_0x307676['options']);var _0x343fea={'where':_0x28385e[_0x2d3f('0x3a')]};return db['VtigerField']['count'](_0x343fea)[_0x2d3f('0x23')](function(_0x340766){_0x1f94a7[_0x2d3f('0x1e')]=_0x340766;if(_0x307676[_0x2d3f('0x2e')][_0x2d3f('0x3e')]){_0x28385e[_0x2d3f('0x3f')]=[{'all':!![]}];}return db[_0x2d3f('0x29')][_0x2d3f('0x40')](_0x28385e);})['then'](function(_0x5a69e9){_0x1f94a7[_0x2d3f('0x41')]=_0x5a69e9;return _0x1f94a7;})[_0x2d3f('0x23')](respondWithFilteredResult(_0x16f4f5,_0x28385e))[_0x2d3f('0x42')](handleError(_0x16f4f5,null));};exports[_0x2d3f('0x43')]=function(_0x29a03c,_0x2c16ef){var _0x11b634={'raw':!![],'where':{'id':_0x29a03c[_0x2d3f('0x44')]['id']}},_0x3585dd={};_0x3585dd['model']=_[_0x2d3f('0x2f')](db[_0x2d3f('0x29')][_0x2d3f('0x2a')]);_0x3585dd[_0x2d3f('0x2e')]=_[_0x2d3f('0x2f')](_0x29a03c['query']);_0x3585dd['filters']=_[_0x2d3f('0x31')](_0x3585dd['model'],_0x3585dd[_0x2d3f('0x2e')]);_0x11b634[_0x2d3f('0x33')]=_[_0x2d3f('0x31')](_0x3585dd[_0x2d3f('0x32')],qs[_0x2d3f('0x34')](_0x29a03c['query']['fields']));_0x11b634[_0x2d3f('0x33')]=_0x11b634[_0x2d3f('0x33')]['length']?_0x11b634['attributes']:_0x3585dd['model'];if(_0x29a03c[_0x2d3f('0x2e')][_0x2d3f('0x3e')]){_0x11b634[_0x2d3f('0x3f')]=[{'all':!![]}];}_0x11b634=_['merge']({},_0x11b634,_0x29a03c[_0x2d3f('0x45')]);return db[_0x2d3f('0x29')][_0x2d3f('0x46')](_0x11b634)['then'](handleEntityNotFound(_0x2c16ef,null))[_0x2d3f('0x23')](respondWithResult(_0x2c16ef,null))[_0x2d3f('0x42')](handleError(_0x2c16ef,null));};exports['create']=function(_0x194aa7,_0x2160bf){return db[_0x2d3f('0x29')]['create'](_0x194aa7[_0x2d3f('0x47')],{})[_0x2d3f('0x23')](respondWithResult(_0x2160bf,0xc9))[_0x2d3f('0x42')](handleError(_0x2160bf,null));};exports[_0x2d3f('0x22')]=function(_0x531e6b,_0x1a868f){if(_0x531e6b['body']['id']){delete _0x531e6b[_0x2d3f('0x47')]['id'];}return db[_0x2d3f('0x29')]['find']({'where':{'id':_0x531e6b[_0x2d3f('0x44')]['id']}})[_0x2d3f('0x23')](handleEntityNotFound(_0x1a868f,null))[_0x2d3f('0x23')](saveUpdates(_0x531e6b[_0x2d3f('0x47')],null))[_0x2d3f('0x23')](respondWithResult(_0x1a868f,null))[_0x2d3f('0x42')](handleError(_0x1a868f,null));};exports[_0x2d3f('0x24')]=function(_0x2a9039,_0x4855e5){return db[_0x2d3f('0x29')][_0x2d3f('0x46')]({'where':{'id':_0x2a9039['params']['id']}})['then'](handleEntityNotFound(_0x4855e5,null))['then'](removeEntity(_0x4855e5,null))[_0x2d3f('0x42')](handleError(_0x4855e5,null));}; \ No newline at end of file +var _0x0ddc=['../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','error','stack','send','index','VtigerField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','name','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2d4c9e,_0x42d5c9){var _0x37c1c5=function(_0x4b5aad){while(--_0x4b5aad){_0x2d4c9e['push'](_0x2d4c9e['shift']());}};_0x37c1c5(++_0x42d5c9);}(_0x0ddc,0x121));var _0xc0dd=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x0ddc[_0x5f0089];return _0x193892;};'use strict';var emlformat=require(_0xc0dd('0x0'));var rimraf=require(_0xc0dd('0x1'));var zipdir=require(_0xc0dd('0x2'));var jsonpatch=require(_0xc0dd('0x3'));var rp=require(_0xc0dd('0x4'));var moment=require('moment');var BPromise=require(_0xc0dd('0x5'));var Mustache=require(_0xc0dd('0x6'));var util=require(_0xc0dd('0x7'));var path=require(_0xc0dd('0x8'));var sox=require(_0xc0dd('0x9'));var csv=require('to-csv');var ejs=require(_0xc0dd('0xa'));var fs=require('fs');var fs_extra=require(_0xc0dd('0xb'));var _=require(_0xc0dd('0xc'));var squel=require('squel');var crypto=require(_0xc0dd('0xd'));var jsforce=require(_0xc0dd('0xe'));var deskjs=require(_0xc0dd('0xf'));var toCsv=require(_0xc0dd('0x10'));var querystring=require(_0xc0dd('0x11'));var Papa=require(_0xc0dd('0x12'));var Redis=require(_0xc0dd('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc0dd('0x14'));var as=require(_0xc0dd('0x15'));var hardwareService=require(_0xc0dd('0x16'));var logger=require(_0xc0dd('0x17'))(_0xc0dd('0x18'));var utils=require(_0xc0dd('0x19'));var config=require(_0xc0dd('0x1a'));var licenseUtil=require(_0xc0dd('0x1b'));var db=require(_0xc0dd('0x1c'))['db'];function respondWithStatusCode(_0xa3dcfa,_0x4ea1e2){_0x4ea1e2=_0x4ea1e2||0xcc;return function(_0x1b8ad9){if(_0x1b8ad9){return _0xa3dcfa['sendStatus'](_0x4ea1e2);}return _0xa3dcfa['status'](_0x4ea1e2)[_0xc0dd('0x1d')]();};}function respondWithResult(_0x278525,_0x5a6715){_0x5a6715=_0x5a6715||0xc8;return function(_0x1b9678){if(_0x1b9678){return _0x278525[_0xc0dd('0x1e')](_0x5a6715)['json'](_0x1b9678);}};}function respondWithFilteredResult(_0x404564,_0x39c04b){return function(_0x439610){if(_0x439610){var _0x3777a1=typeof _0x39c04b[_0xc0dd('0x1f')]===_0xc0dd('0x20')&&typeof _0x39c04b[_0xc0dd('0x21')]===_0xc0dd('0x20');var _0x181164=_0x439610[_0xc0dd('0x22')];var _0x45d016=_0x3777a1?0x0:_0x39c04b[_0xc0dd('0x1f')];var _0x5a5726=_0x3777a1?_0x439610[_0xc0dd('0x22')]:_0x39c04b[_0xc0dd('0x1f')]+_0x39c04b['limit'];var _0x109b24;if(_0x5a5726>=_0x181164){_0x5a5726=_0x181164;_0x109b24=0xc8;}else{_0x109b24=0xce;}_0x404564[_0xc0dd('0x1e')](_0x109b24);return _0x404564['set'](_0xc0dd('0x23'),_0x45d016+'-'+_0x5a5726+'/'+_0x181164)[_0xc0dd('0x24')](_0x439610);}return null;};}function patchUpdates(_0x53957){return function(_0x3e58eb){try{jsonpatch['apply'](_0x3e58eb,_0x53957,!![]);}catch(_0x46d176){return BPromise[_0xc0dd('0x25')](_0x46d176);}return _0x3e58eb[_0xc0dd('0x26')]();};}function saveUpdates(_0x2da8c7,_0x101df9){return function(_0x406fda){if(_0x406fda){return _0x406fda[_0xc0dd('0x27')](_0x2da8c7)[_0xc0dd('0x28')](function(_0x11ac30){return _0x11ac30;});}return null;};}function removeEntity(_0x11c0a0,_0x33dced){return function(_0x1c5cda){if(_0x1c5cda){return _0x1c5cda['destroy']()[_0xc0dd('0x28')](function(){_0x11c0a0[_0xc0dd('0x1e')](0xcc)[_0xc0dd('0x1d')]();});}};}function handleEntityNotFound(_0x4f3607,_0x55266f){return function(_0x533157){if(!_0x533157){_0x4f3607['sendStatus'](0x194);}return _0x533157;};}function handleError(_0x2eccd0,_0x3786dd){_0x3786dd=_0x3786dd||0x1f4;return function(_0x555bad){logger[_0xc0dd('0x29')](_0x555bad[_0xc0dd('0x2a')]);if(_0x555bad['name']){delete _0x555bad['name'];}_0x2eccd0['status'](_0x3786dd)[_0xc0dd('0x2b')](_0x555bad);};}exports[_0xc0dd('0x2c')]=function(_0x28e6e0,_0x593d95){var _0x4ecba1={},_0x96ffae={},_0x1d9078={'count':0x0,'rows':[]};var _0x58baf5=_['map'](db[_0xc0dd('0x2d')][_0xc0dd('0x2e')],function(_0x1b9a72){return{'name':_0x1b9a72[_0xc0dd('0x2f')],'type':_0x1b9a72[_0xc0dd('0x30')][_0xc0dd('0x31')]};});_0x96ffae[_0xc0dd('0x32')]=_[_0xc0dd('0x33')](_0x58baf5,'name');_0x96ffae[_0xc0dd('0x34')]=_[_0xc0dd('0x35')](_0x28e6e0[_0xc0dd('0x34')]);_0x96ffae[_0xc0dd('0x36')]=_[_0xc0dd('0x37')](_0x96ffae[_0xc0dd('0x32')],_0x96ffae[_0xc0dd('0x34')]);_0x4ecba1[_0xc0dd('0x38')]=_['intersection'](_0x96ffae['model'],qs['fields'](_0x28e6e0[_0xc0dd('0x34')][_0xc0dd('0x39')]));_0x4ecba1[_0xc0dd('0x38')]=_0x4ecba1[_0xc0dd('0x38')][_0xc0dd('0x3a')]?_0x4ecba1['attributes']:_0x96ffae[_0xc0dd('0x32')];if(!_0x28e6e0[_0xc0dd('0x34')][_0xc0dd('0x3b')](_0xc0dd('0x3c'))){_0x4ecba1[_0xc0dd('0x21')]=qs[_0xc0dd('0x21')](_0x28e6e0[_0xc0dd('0x34')][_0xc0dd('0x21')]);_0x4ecba1[_0xc0dd('0x1f')]=qs[_0xc0dd('0x1f')](_0x28e6e0[_0xc0dd('0x34')][_0xc0dd('0x1f')]);}_0x4ecba1['order']=qs[_0xc0dd('0x3d')](_0x28e6e0['query'][_0xc0dd('0x3d')]);_0x4ecba1[_0xc0dd('0x3e')]=qs[_0xc0dd('0x36')](_[_0xc0dd('0x3f')](_0x28e6e0[_0xc0dd('0x34')],_0x96ffae[_0xc0dd('0x36')]),_0x58baf5);if(_0x28e6e0[_0xc0dd('0x34')][_0xc0dd('0x40')]){_0x4ecba1[_0xc0dd('0x3e')]=_[_0xc0dd('0x41')](_0x4ecba1['where'],{'$or':_[_0xc0dd('0x33')](_0x58baf5,function(_0x4d59ac){if(_0x4d59ac[_0xc0dd('0x30')]!=='VIRTUAL'){var _0x2d192c={};_0x2d192c[_0x4d59ac[_0xc0dd('0x42')]]={'$like':'%'+_0x28e6e0['query']['filter']+'%'};return _0x2d192c;}})});}_0x4ecba1=_[_0xc0dd('0x41')]({},_0x4ecba1,_0x28e6e0['options']);var _0x1e3734={'where':_0x4ecba1[_0xc0dd('0x3e')]};return db[_0xc0dd('0x2d')]['count'](_0x1e3734)[_0xc0dd('0x28')](function(_0x45c9d7){_0x1d9078['count']=_0x45c9d7;if(_0x28e6e0[_0xc0dd('0x34')][_0xc0dd('0x43')]){_0x4ecba1[_0xc0dd('0x44')]=[{'all':!![]}];}return db['VtigerField'][_0xc0dd('0x45')](_0x4ecba1);})[_0xc0dd('0x28')](function(_0x249d1b){_0x1d9078[_0xc0dd('0x46')]=_0x249d1b;return _0x1d9078;})[_0xc0dd('0x28')](respondWithFilteredResult(_0x593d95,_0x4ecba1))['catch'](handleError(_0x593d95,null));};exports[_0xc0dd('0x47')]=function(_0x235aba,_0x255d2a){var _0x59afc9={'raw':!![],'where':{'id':_0x235aba[_0xc0dd('0x48')]['id']}},_0x4cf41c={};_0x4cf41c['model']=_['keys'](db[_0xc0dd('0x2d')][_0xc0dd('0x2e')]);_0x4cf41c[_0xc0dd('0x34')]=_['keys'](_0x235aba[_0xc0dd('0x34')]);_0x4cf41c[_0xc0dd('0x36')]=_[_0xc0dd('0x37')](_0x4cf41c[_0xc0dd('0x32')],_0x4cf41c['query']);_0x59afc9[_0xc0dd('0x38')]=_[_0xc0dd('0x37')](_0x4cf41c[_0xc0dd('0x32')],qs[_0xc0dd('0x39')](_0x235aba[_0xc0dd('0x34')][_0xc0dd('0x39')]));_0x59afc9[_0xc0dd('0x38')]=_0x59afc9[_0xc0dd('0x38')]['length']?_0x59afc9['attributes']:_0x4cf41c[_0xc0dd('0x32')];if(_0x235aba[_0xc0dd('0x34')][_0xc0dd('0x43')]){_0x59afc9[_0xc0dd('0x44')]=[{'all':!![]}];}_0x59afc9=_['merge']({},_0x59afc9,_0x235aba[_0xc0dd('0x49')]);return db[_0xc0dd('0x2d')][_0xc0dd('0x4a')](_0x59afc9)[_0xc0dd('0x28')](handleEntityNotFound(_0x255d2a,null))['then'](respondWithResult(_0x255d2a,null))[_0xc0dd('0x4b')](handleError(_0x255d2a,null));};exports[_0xc0dd('0x4c')]=function(_0x1cb7ae,_0x471355){return db['VtigerField'][_0xc0dd('0x4c')](_0x1cb7ae[_0xc0dd('0x4d')],{})[_0xc0dd('0x28')](respondWithResult(_0x471355,0xc9))[_0xc0dd('0x4b')](handleError(_0x471355,null));};exports[_0xc0dd('0x27')]=function(_0x16bbe3,_0x81bb05){if(_0x16bbe3[_0xc0dd('0x4d')]['id']){delete _0x16bbe3[_0xc0dd('0x4d')]['id'];}return db['VtigerField'][_0xc0dd('0x4a')]({'where':{'id':_0x16bbe3['params']['id']}})[_0xc0dd('0x28')](handleEntityNotFound(_0x81bb05,null))['then'](saveUpdates(_0x16bbe3[_0xc0dd('0x4d')],null))[_0xc0dd('0x28')](respondWithResult(_0x81bb05,null))[_0xc0dd('0x4b')](handleError(_0x81bb05,null));};exports[_0xc0dd('0x4e')]=function(_0xfe6777,_0x2169b2){return db['VtigerField'][_0xc0dd('0x4a')]({'where':{'id':_0xfe6777[_0xc0dd('0x48')]['id']}})[_0xc0dd('0x28')](handleEntityNotFound(_0x2169b2,null))[_0xc0dd('0x28')](removeEntity(_0x2169b2,null))[_0xc0dd('0x4b')](handleError(_0x2169b2,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 38d9d40..6a2df43 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 _0xbd0f=['./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x579427,_0x3221f8){var _0x350c6a=function(_0x35b0b2){while(--_0x35b0b2){_0x579427['push'](_0x579427['shift']());}};_0x350c6a(++_0x3221f8);}(_0xbd0f,0x1aa));var _0xfbd0=function(_0x323c26,_0x398ecf){_0x323c26=_0x323c26-0x0;var _0x3311ad=_0xbd0f[_0x323c26];return _0x3311ad;};'use strict';var _=require(_0xfbd0('0x0'));var util=require(_0xfbd0('0x1'));var logger=require(_0xfbd0('0x2'))(_0xfbd0('0x3'));var moment=require(_0xfbd0('0x4'));var BPromise=require(_0xfbd0('0x5'));var rp=require(_0xfbd0('0x6'));var fs=require('fs');var path=require(_0xfbd0('0x7'));var rimraf=require(_0xfbd0('0x8'));var config=require('../../config/environment');var attributes=require(_0xfbd0('0x9'));module[_0xfbd0('0xa')]=function(_0x4bee2b,_0x388a3f){return _0x4bee2b['define'](_0xfbd0('0xb'),attributes,{'tableName':_0xfbd0('0xc'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xfbd0('0xd'),_0xfbd0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x44c6=['path','../../config/environment','./intVtigerField.attributes','define','VtigerField','idField','FieldId','lodash','moment','bluebird','request-promise'];(function(_0x3e9eb2,_0x300701){var _0x1b03ba=function(_0x25bdde){while(--_0x25bdde){_0x3e9eb2['push'](_0x3e9eb2['shift']());}};_0x1b03ba(++_0x300701);}(_0x44c6,0x193));var _0x644c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x44c6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x644c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x644c('0x1'));var BPromise=require(_0x644c('0x2'));var rp=require(_0x644c('0x3'));var fs=require('fs');var path=require(_0x644c('0x4'));var rimraf=require('rimraf');var config=require(_0x644c('0x5'));var attributes=require(_0x644c('0x6'));module['exports']=function(_0x5bb4b5,_0x43b444){return _0x5bb4b5[_0x644c('0x7')](_0x644c('0x8'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x644c('0x9'),_0x644c('0xa')],'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 4c64e4c..80c0cea 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 _0x6573=['jayson/promise','client','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x556028,_0x181eb3){var _0x294c42=function(_0x1b5f5d){while(--_0x1b5f5d){_0x556028['push'](_0x556028['shift']());}};_0x294c42(++_0x181eb3);}(_0x6573,0x1aa));var _0x3657=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6573[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x3657('0x0'));var moment=require(_0x3657('0x1'));var BPromise=require(_0x3657('0x2'));var rs=require(_0x3657('0x3'));var fs=require('fs');var Redis=require(_0x3657('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3657('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3657('0x6'));var client=jayson[_0x3657('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15dada,_0x152420,_0x5cbe8b){return new BPromise(function(_0x19b4af,_0x4cbf37){return client['request'](_0x15dada,_0x5cbe8b)[_0x3657('0x8')](function(_0x126ddc){logger['info'](_0x3657('0x9'),_0x152420,_0x3657('0xa'));logger[_0x3657('0xb')](_0x3657('0xc'),_0x152420,_0x3657('0xa'),JSON[_0x3657('0xd')](_0x126ddc));if(_0x126ddc[_0x3657('0xe')]){if(_0x126ddc['error']['code']===0x1f4){logger[_0x3657('0xe')]('VtigerField,\x20%s,\x20%s',_0x152420,_0x126ddc['error'][_0x3657('0xf')]);return _0x4cbf37(_0x126ddc['error']['message']);}logger[_0x3657('0xe')](_0x3657('0x9'),_0x152420,_0x126ddc[_0x3657('0xe')][_0x3657('0xf')]);return _0x19b4af(_0x126ddc[_0x3657('0xe')][_0x3657('0xf')]);}else{logger[_0x3657('0x10')]('VtigerField,\x20%s,\x20%s',_0x152420,'request\x20sent');_0x19b4af(_0x126ddc['result']['message']);}})[_0x3657('0x11')](function(_0x3b316d){logger[_0x3657('0xe')](_0x3657('0x9'),_0x152420,_0x3b316d);_0x4cbf37(_0x3b316d);});});} \ No newline at end of file +var _0xd86a=['http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x56dbe5,_0x57fa97){var _0x47009d=function(_0x2ed2db){while(--_0x2ed2db){_0x56dbe5['push'](_0x56dbe5['shift']());}};_0x47009d(++_0x57fa97);}(_0xd86a,0x19c));var _0xad86=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0xd86a[_0x2d61b2];return _0x12df89;};'use strict';var _=require(_0xad86('0x0'));var util=require('util');var moment=require(_0xad86('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad86('0x2'))['db'];var utils=require(_0xad86('0x3'));var logger=require(_0xad86('0x4'))('rpc');var config=require(_0xad86('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xad86('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x106788,_0x4b7311,_0x2bd01e){return new BPromise(function(_0x2d4712,_0x18369f){return client[_0xad86('0x7')](_0x106788,_0x2bd01e)[_0xad86('0x8')](function(_0x2003ce){logger[_0xad86('0x9')](_0xad86('0xa'),_0x4b7311,_0xad86('0xb'));logger[_0xad86('0xc')](_0xad86('0xd'),_0x4b7311,_0xad86('0xb'),JSON[_0xad86('0xe')](_0x2003ce));if(_0x2003ce[_0xad86('0xf')]){if(_0x2003ce[_0xad86('0xf')][_0xad86('0x10')]===0x1f4){logger[_0xad86('0xf')](_0xad86('0xa'),_0x4b7311,_0x2003ce[_0xad86('0xf')][_0xad86('0x11')]);return _0x18369f(_0x2003ce[_0xad86('0xf')]['message']);}logger['error'](_0xad86('0xa'),_0x4b7311,_0x2003ce[_0xad86('0xf')][_0xad86('0x11')]);return _0x2d4712(_0x2003ce['error'][_0xad86('0x11')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x4b7311,_0xad86('0xb'));_0x2d4712(_0x2003ce[_0xad86('0x12')][_0xad86('0x11')]);}})['catch'](function(_0x42f7a0){logger['error']('VtigerField,\x20%s,\x20%s',_0x4b7311,_0x42f7a0);_0x18369f(_0x42f7a0);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 195a061..668e50c 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 _0xcaf2=['getFields','post','addConfiguration','put','update','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xcaf2,0x8a));var _0x2caf=function(_0x13fcaf,_0x416c69){_0x13fcaf=_0x13fcaf-0x0;var _0x4fa631=_0xcaf2[_0x13fcaf];return _0x4fa631;};'use strict';var multer=require(_0x2caf('0x0'));var util=require('util');var path=require(_0x2caf('0x1'));var timeout=require(_0x2caf('0x2'));var express=require('express');var router=express[_0x2caf('0x3')]();var fs_extra=require(_0x2caf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2caf('0x5'));var config=require('../../config/environment');var controller=require(_0x2caf('0x6'));router[_0x2caf('0x7')]('/',auth[_0x2caf('0x8')](),controller['index']);router[_0x2caf('0x7')](_0x2caf('0x9'),auth[_0x2caf('0x8')](),controller[_0x2caf('0xa')]);router['get'](_0x2caf('0xb'),auth[_0x2caf('0x8')](),controller[_0x2caf('0xc')]);router[_0x2caf('0x7')](_0x2caf('0xd'),auth[_0x2caf('0x8')](),controller[_0x2caf('0xe')]);router[_0x2caf('0xf')]('/',auth[_0x2caf('0x8')](),controller['create']);router[_0x2caf('0xf')](_0x2caf('0xb'),auth[_0x2caf('0x8')](),controller[_0x2caf('0x10')]);router[_0x2caf('0x11')](_0x2caf('0x9'),auth[_0x2caf('0x8')](),controller[_0x2caf('0x12')]);router['delete'](_0x2caf('0x9'),auth[_0x2caf('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2c6e=['../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x459eaf,_0x2e6a6c){var _0x292ce6=function(_0x4ea1a9){while(--_0x4ea1a9){_0x459eaf['push'](_0x459eaf['shift']());}};_0x292ce6(++_0x2e6a6c);}(_0x2c6e,0x161));var _0xe2c6=function(_0x1a4c34,_0x3b12fb){_0x1a4c34=_0x1a4c34-0x0;var _0x5e11ba=_0x2c6e[_0x1a4c34];return _0x5e11ba;};'use strict';var multer=require(_0xe2c6('0x0'));var util=require(_0xe2c6('0x1'));var path=require(_0xe2c6('0x2'));var timeout=require(_0xe2c6('0x3'));var express=require(_0xe2c6('0x4'));var router=express[_0xe2c6('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe2c6('0x6'));var config=require(_0xe2c6('0x7'));var controller=require(_0xe2c6('0x8'));router[_0xe2c6('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2c6('0xa')]);router[_0xe2c6('0x9')](_0xe2c6('0xb'),auth[_0xe2c6('0xc')](),controller[_0xe2c6('0xd')]);router['get'](_0xe2c6('0xe'),auth[_0xe2c6('0xc')](),controller['getConfigurations']);router[_0xe2c6('0x9')](_0xe2c6('0xf'),auth[_0xe2c6('0xc')](),controller['getFields']);router[_0xe2c6('0x10')]('/',auth[_0xe2c6('0xc')](),controller[_0xe2c6('0x11')]);router[_0xe2c6('0x10')](_0xe2c6('0xe'),auth[_0xe2c6('0xc')](),controller[_0xe2c6('0x12')]);router[_0xe2c6('0x13')](_0xe2c6('0xb'),auth[_0xe2c6('0xc')](),controller[_0xe2c6('0x14')]);router[_0xe2c6('0x15')](_0xe2c6('0xb'),auth[_0xe2c6('0xc')](),controller[_0xe2c6('0x16')]);module[_0xe2c6('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 b2f63dc..5fb1125 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 _0xb4b6=['username','remoteUri','password','ENUM','integrationTab','newTab','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x25f5d3,_0xe55443){_0x25f5d3=_0x25f5d3-0x0;var _0x4d29bb=_0xb4b6[_0x25f5d3];return _0x4d29bb;};'use strict';var Sequelize=require('sequelize');module[_0x6b4b('0x0')]={'name':{'type':Sequelize[_0x6b4b('0x1')]},'description':{'type':Sequelize[_0x6b4b('0x1')]},'username':{'type':Sequelize[_0x6b4b('0x1')],'unique':_0x6b4b('0x2')},'password':{'type':Sequelize[_0x6b4b('0x1')]},'token':{'type':Sequelize[_0x6b4b('0x1')]},'remoteUri':{'type':Sequelize[_0x6b4b('0x1')],'unique':_0x6b4b('0x3')},'authType':{'type':Sequelize['ENUM'](_0x6b4b('0x4'),'token'),'defaultValue':_0x6b4b('0x4')},'serverUrl':{'type':Sequelize[_0x6b4b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x6b4b('0x5')](_0x6b4b('0x6'),_0x6b4b('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x2aa3=['password','integrationTab','newTab','sequelize','exports','STRING','remoteUri','ENUM'];(function(_0x1046b4,_0x597b2d){var _0x30d4a1=function(_0x2cba72){while(--_0x2cba72){_0x1046b4['push'](_0x1046b4['shift']());}};_0x30d4a1(++_0x597b2d);}(_0x2aa3,0x83));var _0x32aa=function(_0x541dc0,_0xc2e585){_0x541dc0=_0x541dc0-0x0;var _0x548b54=_0x2aa3[_0x541dc0];return _0x548b54;};'use strict';var Sequelize=require(_0x32aa('0x0'));module[_0x32aa('0x1')]={'name':{'type':Sequelize[_0x32aa('0x2')]},'description':{'type':Sequelize[_0x32aa('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x32aa('0x2')]},'token':{'type':Sequelize[_0x32aa('0x2')]},'remoteUri':{'type':Sequelize[_0x32aa('0x2')],'unique':_0x32aa('0x3')},'authType':{'type':Sequelize[_0x32aa('0x4')](_0x32aa('0x5'),'token'),'defaultValue':_0x32aa('0x5')},'serverUrl':{'type':Sequelize[_0x32aa('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x32aa('0x4')](_0x32aa('0x6'),_0x32aa('0x7')),'defaultValue':_0x32aa('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index f893058..588a781 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 _0x0972=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','error','name','send','index','map','ZendeskAccount','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','getConfigurations','findOne','AccountId','channel','Descriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','GET','format','%s/%s','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','title','position','system_field_options','custom_field_options','test','statusCode','stringify','Wrong\x20credentials','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x39d760,_0x53adfa){var _0x38b81b=function(_0x36f2f3){while(--_0x36f2f3){_0x39d760['push'](_0x39d760['shift']());}};_0x38b81b(++_0x53adfa);}(_0x0972,0x64));var _0x2097=function(_0x323d8d,_0x186406){_0x323d8d=_0x323d8d-0x0;var _0x41d9f6=_0x0972[_0x323d8d];return _0x41d9f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2097('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2097('0x1'));var rp=require('request-promise');var moment=require(_0x2097('0x2'));var BPromise=require(_0x2097('0x3'));var Mustache=require('mustache');var util=require(_0x2097('0x4'));var path=require(_0x2097('0x5'));var sox=require(_0x2097('0x6'));var csv=require(_0x2097('0x7'));var ejs=require(_0x2097('0x8'));var fs=require('fs');var fs_extra=require(_0x2097('0x9'));var _=require(_0x2097('0xa'));var squel=require('squel');var crypto=require(_0x2097('0xb'));var jsforce=require(_0x2097('0xc'));var deskjs=require(_0x2097('0xd'));var toCsv=require(_0x2097('0x7'));var querystring=require(_0x2097('0xe'));var Papa=require('papaparse');var Redis=require(_0x2097('0xf'));var authService=require(_0x2097('0x10'));var qs=require(_0x2097('0x11'));var as=require(_0x2097('0x12'));var hardwareService=require(_0x2097('0x13'));var logger=require(_0x2097('0x14'))(_0x2097('0x15'));var utils=require(_0x2097('0x16'));var config=require(_0x2097('0x17'));var licenseUtil=require(_0x2097('0x18'));var db=require(_0x2097('0x19'))['db'];var integrations=require(_0x2097('0x1a'));function respondWithStatusCode(_0x170005,_0x16871b){_0x16871b=_0x16871b||0xcc;return function(_0x24ca42){if(_0x24ca42){return _0x170005[_0x2097('0x1b')](_0x16871b);}return _0x170005[_0x2097('0x1c')](_0x16871b)[_0x2097('0x1d')]();};}function respondWithResult(_0x2c3e41,_0x354387){_0x354387=_0x354387||0xc8;return function(_0x5d0a43){if(_0x5d0a43){return _0x2c3e41[_0x2097('0x1c')](_0x354387)[_0x2097('0x1e')](_0x5d0a43);}};}function respondWithFilteredResult(_0x4d31bc,_0x4eec05){return function(_0x4fc8c5){if(_0x4fc8c5){var _0x409deb=typeof _0x4eec05['offset']===_0x2097('0x1f')&&typeof _0x4eec05[_0x2097('0x20')]===_0x2097('0x1f');var _0x1347e4=_0x4fc8c5[_0x2097('0x21')];var _0x53e2b4=_0x409deb?0x0:_0x4eec05[_0x2097('0x22')];var _0x140094=_0x409deb?_0x4fc8c5[_0x2097('0x21')]:_0x4eec05[_0x2097('0x22')]+_0x4eec05[_0x2097('0x20')];var _0x235304;if(_0x140094>=_0x1347e4){_0x140094=_0x1347e4;_0x235304=0xc8;}else{_0x235304=0xce;}_0x4d31bc[_0x2097('0x1c')](_0x235304);return _0x4d31bc[_0x2097('0x23')]('Content-Range',_0x53e2b4+'-'+_0x140094+'/'+_0x1347e4)['json'](_0x4fc8c5);}return null;};}function patchUpdates(_0xf65dc6){return function(_0x569c21){try{jsonpatch[_0x2097('0x24')](_0x569c21,_0xf65dc6,!![]);}catch(_0x1ac5f1){return BPromise['reject'](_0x1ac5f1);}return _0x569c21[_0x2097('0x25')]();};}function saveUpdates(_0x5b0582,_0x2e17c8){return function(_0xf32d3f){if(_0xf32d3f){return _0xf32d3f[_0x2097('0x26')](_0x5b0582)[_0x2097('0x27')](function(_0x36b15e){return _0x36b15e;});}return null;};}function removeEntity(_0x35047b,_0x56390a){return function(_0xae5f9){if(_0xae5f9){return _0xae5f9['destroy']()[_0x2097('0x27')](function(){_0x35047b[_0x2097('0x1c')](0xcc)[_0x2097('0x1d')]();});}};}function handleEntityNotFound(_0x9f59bc,_0x499988){return function(_0x2d683a){if(!_0x2d683a){_0x9f59bc[_0x2097('0x1b')](0x194);}return _0x2d683a;};}function handleError(_0x56af3b,_0x1229fc){_0x1229fc=_0x1229fc||0x1f4;return function(_0x5ed0fa){logger[_0x2097('0x28')](_0x5ed0fa['stack']);if(_0x5ed0fa[_0x2097('0x29')]){delete _0x5ed0fa[_0x2097('0x29')];}_0x56af3b[_0x2097('0x1c')](_0x1229fc)[_0x2097('0x2a')](_0x5ed0fa);};}exports[_0x2097('0x2b')]=function(_0x36228c,_0x450e0b){var _0x4b443d={},_0x11242f={},_0x14d964={'count':0x0,'rows':[]};var _0x5cce55=_[_0x2097('0x2c')](db[_0x2097('0x2d')]['rawAttributes'],function(_0x4d0916){return{'name':_0x4d0916[_0x2097('0x2e')],'type':_0x4d0916[_0x2097('0x2f')][_0x2097('0x30')]};});_0x11242f[_0x2097('0x31')]=_[_0x2097('0x2c')](_0x5cce55,_0x2097('0x29'));_0x11242f['query']=_[_0x2097('0x32')](_0x36228c['query']);_0x11242f[_0x2097('0x33')]=_[_0x2097('0x34')](_0x11242f[_0x2097('0x31')],_0x11242f[_0x2097('0x35')]);_0x4b443d[_0x2097('0x36')]=_[_0x2097('0x34')](_0x11242f[_0x2097('0x31')],qs[_0x2097('0x37')](_0x36228c[_0x2097('0x35')]['fields']));_0x4b443d[_0x2097('0x36')]=_0x4b443d[_0x2097('0x36')][_0x2097('0x38')]?_0x4b443d['attributes']:_0x11242f[_0x2097('0x31')];if(!_0x36228c[_0x2097('0x35')][_0x2097('0x39')](_0x2097('0x3a'))){_0x4b443d['limit']=qs['limit'](_0x36228c['query'][_0x2097('0x20')]);_0x4b443d[_0x2097('0x22')]=qs[_0x2097('0x22')](_0x36228c[_0x2097('0x35')][_0x2097('0x22')]);}_0x4b443d[_0x2097('0x3b')]=qs['sort'](_0x36228c[_0x2097('0x35')][_0x2097('0x3c')]);_0x4b443d[_0x2097('0x3d')]=qs[_0x2097('0x33')](_[_0x2097('0x3e')](_0x36228c[_0x2097('0x35')],_0x11242f['filters']),_0x5cce55);if(_0x36228c[_0x2097('0x35')][_0x2097('0x3f')]){_0x4b443d[_0x2097('0x3d')]=_['merge'](_0x4b443d['where'],{'$or':_[_0x2097('0x2c')](_0x5cce55,function(_0x372693){if(_0x372693[_0x2097('0x2f')]!==_0x2097('0x40')){var _0x41c9e6={};_0x41c9e6[_0x372693[_0x2097('0x29')]]={'$like':'%'+_0x36228c[_0x2097('0x35')][_0x2097('0x3f')]+'%'};return _0x41c9e6;}})});}_0x4b443d=_[_0x2097('0x41')]({},_0x4b443d,_0x36228c[_0x2097('0x42')]);var _0x337979={'where':_0x4b443d[_0x2097('0x3d')]};return db['ZendeskAccount'][_0x2097('0x21')](_0x337979)[_0x2097('0x27')](function(_0x7b556c){_0x14d964['count']=_0x7b556c;if(_0x36228c[_0x2097('0x35')][_0x2097('0x43')]){_0x4b443d[_0x2097('0x44')]=[{'all':!![]}];}return db[_0x2097('0x2d')][_0x2097('0x45')](_0x4b443d);})[_0x2097('0x27')](function(_0x29dab3){_0x14d964[_0x2097('0x46')]=_0x29dab3;return _0x14d964;})['then'](respondWithFilteredResult(_0x450e0b,_0x4b443d))[_0x2097('0x47')](handleError(_0x450e0b,null));};exports[_0x2097('0x48')]=function(_0x186ca5,_0x3288ae){var _0x12e0e2={'raw':![],'where':{'id':_0x186ca5[_0x2097('0x49')]['id']}},_0xe3ac1b={};_0xe3ac1b[_0x2097('0x31')]=_['keys'](db[_0x2097('0x2d')]['rawAttributes']);_0xe3ac1b[_0x2097('0x35')]=_[_0x2097('0x32')](_0x186ca5[_0x2097('0x35')]);_0xe3ac1b[_0x2097('0x33')]=_[_0x2097('0x34')](_0xe3ac1b['model'],_0xe3ac1b[_0x2097('0x35')]);_0x12e0e2[_0x2097('0x36')]=_[_0x2097('0x34')](_0xe3ac1b[_0x2097('0x31')],qs[_0x2097('0x37')](_0x186ca5['query'][_0x2097('0x37')]));_0x12e0e2[_0x2097('0x36')]=_0x12e0e2[_0x2097('0x36')][_0x2097('0x38')]?_0x12e0e2[_0x2097('0x36')]:_0xe3ac1b[_0x2097('0x31')];if(_0x186ca5[_0x2097('0x35')][_0x2097('0x43')]){_0x12e0e2['include']=[{'all':!![]}];}_0x12e0e2=_[_0x2097('0x41')]({},_0x12e0e2,_0x186ca5[_0x2097('0x42')]);return db[_0x2097('0x2d')][_0x2097('0x4a')](_0x12e0e2)['then'](handleEntityNotFound(_0x3288ae,null))['then'](respondWithResult(_0x3288ae,null))['catch'](handleError(_0x3288ae,null));};exports[_0x2097('0x4b')]=function(_0x396979,_0x4c4ef9){return db[_0x2097('0x2d')][_0x2097('0x4b')](_0x396979['body'],{})['then'](respondWithResult(_0x4c4ef9,0xc9))[_0x2097('0x47')](handleError(_0x4c4ef9,null));};exports[_0x2097('0x26')]=function(_0x1b4de6,_0x5a0c05){if(_0x1b4de6[_0x2097('0x4c')]['id']){delete _0x1b4de6[_0x2097('0x4c')]['id'];}return db['ZendeskAccount'][_0x2097('0x4a')]({'where':{'id':_0x1b4de6[_0x2097('0x49')]['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x5a0c05,null))[_0x2097('0x27')](saveUpdates(_0x1b4de6[_0x2097('0x4c')],null))['then'](respondWithResult(_0x5a0c05,null))['catch'](handleError(_0x5a0c05,null));};exports[_0x2097('0x4d')]=function(_0x39f9cb,_0x329632){return db['ZendeskAccount']['find']({'where':{'id':_0x39f9cb[_0x2097('0x49')]['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x329632,null))['then'](removeEntity(_0x329632,null))[_0x2097('0x47')](handleError(_0x329632,null));};exports[_0x2097('0x4e')]=function(_0x12bdbd,_0x33490e,_0x390a52){var _0x4a709a={};var _0x42b222={};var _0x228b60;var _0x190859;return db['ZendeskAccount'][_0x2097('0x4f')]({'where':{'id':_0x12bdbd[_0x2097('0x49')]['id']}})['then'](handleEntityNotFound(_0x33490e,null))[_0x2097('0x27')](function(_0x4d6ed6){if(_0x4d6ed6){_0x228b60=_0x4d6ed6;_0x42b222[_0x2097('0x31')]=_['keys'](db['ZendeskConfiguration']['rawAttributes']);_0x42b222[_0x2097('0x35')]=_['keys'](_0x12bdbd['query']);_0x42b222[_0x2097('0x33')]=_['intersection'](_0x42b222[_0x2097('0x31')],_0x42b222[_0x2097('0x35')]);_0x4a709a['attributes']=_[_0x2097('0x34')](_0x42b222[_0x2097('0x31')],qs[_0x2097('0x37')](_0x12bdbd[_0x2097('0x35')][_0x2097('0x37')]));_0x4a709a['attributes']=_0x4a709a[_0x2097('0x36')]['length']?_0x4a709a[_0x2097('0x36')]:_0x42b222[_0x2097('0x31')];_0x4a709a[_0x2097('0x3b')]=qs['sort'](_0x12bdbd[_0x2097('0x35')][_0x2097('0x3c')]);_0x4a709a[_0x2097('0x3d')]=qs[_0x2097('0x33')](_[_0x2097('0x3e')](_0x12bdbd['query'],_0x42b222['filters']));if(_0x12bdbd[_0x2097('0x35')][_0x2097('0x3f')]){_0x4a709a['where']=_['merge'](_0x4a709a['where'],{'$or':_['map'](_0x4a709a[_0x2097('0x36')],function(_0x4cdc65){var _0x4445ff={};_0x4445ff[_0x4cdc65]={'$like':'%'+_0x12bdbd[_0x2097('0x35')]['filter']+'%'};return _0x4445ff;})});}_0x4a709a=_[_0x2097('0x41')]({},_0x4a709a,_0x12bdbd[_0x2097('0x42')]);return _0x228b60[_0x2097('0x4e')](_0x4a709a);}})[_0x2097('0x27')](function(_0x2a2673){if(_0x2a2673){_0x190859=_0x2a2673[_0x2097('0x38')];if(!_0x12bdbd[_0x2097('0x35')][_0x2097('0x39')](_0x2097('0x3a'))){_0x4a709a['limit']=qs[_0x2097('0x20')](_0x12bdbd[_0x2097('0x35')][_0x2097('0x20')]);_0x4a709a[_0x2097('0x22')]=qs[_0x2097('0x22')](_0x12bdbd[_0x2097('0x35')]['offset']);}return _0x228b60[_0x2097('0x4e')](_0x4a709a);}})[_0x2097('0x27')](function(_0xcabda7){if(_0xcabda7){return _0xcabda7?{'count':_0x190859,'rows':_0xcabda7}:null;}})[_0x2097('0x27')](respondWithResult(_0x33490e,null))[_0x2097('0x47')](handleError(_0x33490e,null));};exports['addConfiguration']=function(_0x437b79,_0x28dd95,_0x5ea02c){if(_0x437b79['body']['id']){delete _0x437b79['body']['id'];}return db[_0x2097('0x2d')][_0x2097('0x4f')]({'where':{'id':_0x437b79[_0x2097('0x49')]['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x28dd95,null))[_0x2097('0x27')](function(_0x18d90a){if(_0x18d90a){_0x437b79[_0x2097('0x4c')][_0x2097('0x50')]=_0x18d90a['id'];_0x437b79[_0x2097('0x4c')]['Subjects']=integrations['getSubjects'](_0x437b79[_0x2097('0x4c')][_0x2097('0x51')],_0x437b79[_0x2097('0x4c')][_0x2097('0x2f')]);_0x437b79[_0x2097('0x4c')][_0x2097('0x52')]=integrations['getDescriptions'](_0x437b79[_0x2097('0x4c')][_0x2097('0x51')],_0x437b79[_0x2097('0x4c')][_0x2097('0x2f')]);return db['ZendeskConfiguration']['create'](_0x437b79[_0x2097('0x4c')],{'include':[{'model':db[_0x2097('0x53')],'as':'Subjects'},{'model':db[_0x2097('0x53')],'as':_0x2097('0x52')}]});}return null;})[_0x2097('0x27')](respondWithResult(_0x28dd95,null))[_0x2097('0x47')](handleError(_0x28dd95,null));};exports[_0x2097('0x54')]=function(_0x3b5519,_0x10f891,_0x2c6f24){var _0x54159e='';return db[_0x2097('0x2d')][_0x2097('0x4f')]({'where':{'id':_0x3b5519['params']['id']},'attributes':['id',_0x2097('0x55'),_0x2097('0x56'),_0x2097('0x57'),_0x2097('0x58'),_0x2097('0x59')]})[_0x2097('0x27')](handleEntityNotFound(_0x10f891,null))[_0x2097('0x27')](function(_0x22d1ce){if(_0x22d1ce){_0x54159e=_0x22d1ce[_0x2097('0x59')];var _0x1b7021=_0x54159e[_0x2097('0x5a')](-0x1);if(_0x1b7021==='/'){_0x54159e=_0x54159e['substring'](0x0,_0x54159e[_0x2097('0x5b')](_0x1b7021));}var _0x41abda={'method':_0x2097('0x5c'),'uri':util[_0x2097('0x5d')](_0x2097('0x5e'),_0x54159e,'ticket_fields'),'json':!![]};switch(_0x22d1ce[_0x2097('0x58')]){case _0x2097('0x56'):_0x41abda[_0x2097('0x5f')]={'Authorization':util['format'](_0x2097('0x60'),new Buffer(util['format'](_0x2097('0x61'),_0x22d1ce['username'],_0x22d1ce[_0x2097('0x56')]))['toString'](_0x2097('0x62')))};break;case'token':_0x41abda[_0x2097('0x5f')]={'Authorization':util[_0x2097('0x5d')](_0x2097('0x60'),new Buffer(util[_0x2097('0x5d')](_0x2097('0x63'),_0x22d1ce['username'],_0x22d1ce[_0x2097('0x57')]))[_0x2097('0x64')](_0x2097('0x62')))};break;default:throw new db[(_0x2097('0x65'))][(_0x2097('0x66'))](_0x2097('0x67'));}return rp(_0x41abda);}})[_0x2097('0x27')](function(_0x360dd5){if(_0x360dd5){var _0xd4e39d=[_0x2097('0x68'),_0x2097('0x69'),_0x2097('0x6a'),_0x2097('0x6b')];_[_0x2097('0x6c')](_0x360dd5[_0x2097('0x6d')],function(_0xf3831c){return _0xd4e39d['includes'](_0xf3831c[_0x2097('0x2f')]);});return{'count':_0x360dd5['ticket_fields']['length'],'rows':_[_0x2097('0x2c')](_0x360dd5[_0x2097('0x6d')],function(_0x107fab){return{'id':_0x107fab['id'],'name':_0x107fab['position']>0x7?_0x107fab[_0x2097('0x6e')]:_0x107fab[_0x2097('0x2f')],'custom':_0x107fab[_0x2097('0x6f')]>0x7?!![]:![],'options':_0x107fab[_0x2097('0x70')]?_0x107fab['system_field_options']:_0x107fab[_0x2097('0x71')]?_0x107fab['custom_field_options']:[]};})};}})[_0x2097('0x27')](respondWithResult(_0x10f891,null))[_0x2097('0x47')](function(_0x2619db){var _0x1e380e=_0x3b5519['query'][_0x2097('0x72')]?0x1f4:_0x2619db[_0x2097('0x73')]||0x1f4;logger[_0x2097('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x2097('0x54'),_0x1e380e,JSON[_0x2097('0x74')](_0x2619db));delete _0x2619db[_0x2097('0x29')];if(_0x1e380e===0x191){_0x1e380e=0x190;}_0x10f891['status'](_0x1e380e)[_0x2097('0x2a')](_0x3b5519[_0x2097('0x35')][_0x2097('0x72')]?{'message':_0x2097('0x75'),'statusCode':_0x2619db[_0x2097('0x73')]}:_0x2619db);});}; \ No newline at end of file +var _0x4cf8=['sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','params','options','find','create','body','ZendeskConfiguration','fields','getConfigurations','nolimit','findOne','Subjects','channel','ZendeskField','username','password','token','authType','remoteUri','slice','substring','format','ticket_fields','headers','Basic\x20%s','base64','toString','Unknown\x20authentication\x20type','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','order'];(function(_0x289de9,_0x215533){var _0x1ed19f=function(_0x16dfaa){while(--_0x16dfaa){_0x289de9['push'](_0x289de9['shift']());}};_0x1ed19f(++_0x215533);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x21ccfc,_0x48834e){_0x21ccfc=_0x21ccfc-0x0;var _0x279454=_0x4cf8[_0x21ccfc];return _0x279454;};'use strict';var emlformat=require(_0x84cf('0x0'));var rimraf=require(_0x84cf('0x1'));var zipdir=require(_0x84cf('0x2'));var jsonpatch=require(_0x84cf('0x3'));var rp=require(_0x84cf('0x4'));var moment=require(_0x84cf('0x5'));var BPromise=require(_0x84cf('0x6'));var Mustache=require(_0x84cf('0x7'));var util=require(_0x84cf('0x8'));var path=require(_0x84cf('0x9'));var sox=require(_0x84cf('0xa'));var csv=require(_0x84cf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84cf('0xc'));var squel=require('squel');var crypto=require(_0x84cf('0xd'));var jsforce=require(_0x84cf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x84cf('0xb'));var querystring=require(_0x84cf('0xf'));var Papa=require('papaparse');var Redis=require(_0x84cf('0x10'));var authService=require(_0x84cf('0x11'));var qs=require(_0x84cf('0x12'));var as=require(_0x84cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84cf('0x14'))(_0x84cf('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x84cf('0x16'));var db=require(_0x84cf('0x17'))['db'];var integrations=require(_0x84cf('0x18'));function respondWithStatusCode(_0x33f83e,_0x172d04){_0x172d04=_0x172d04||0xcc;return function(_0x214ca0){if(_0x214ca0){return _0x33f83e[_0x84cf('0x19')](_0x172d04);}return _0x33f83e[_0x84cf('0x1a')](_0x172d04)[_0x84cf('0x1b')]();};}function respondWithResult(_0x250a19,_0x2fc41f){_0x2fc41f=_0x2fc41f||0xc8;return function(_0x385027){if(_0x385027){return _0x250a19[_0x84cf('0x1a')](_0x2fc41f)[_0x84cf('0x1c')](_0x385027);}};}function respondWithFilteredResult(_0x27261b,_0x167c3e){return function(_0x464e70){if(_0x464e70){var _0x240edf=typeof _0x167c3e[_0x84cf('0x1d')]==='undefined'&&typeof _0x167c3e[_0x84cf('0x1e')]===_0x84cf('0x1f');var _0xfa6641=_0x464e70[_0x84cf('0x20')];var _0x1dad1a=_0x240edf?0x0:_0x167c3e[_0x84cf('0x1d')];var _0xe6b5b6=_0x240edf?_0x464e70['count']:_0x167c3e['offset']+_0x167c3e[_0x84cf('0x1e')];var _0x1990c7;if(_0xe6b5b6>=_0xfa6641){_0xe6b5b6=_0xfa6641;_0x1990c7=0xc8;}else{_0x1990c7=0xce;}_0x27261b[_0x84cf('0x1a')](_0x1990c7);return _0x27261b[_0x84cf('0x21')](_0x84cf('0x22'),_0x1dad1a+'-'+_0xe6b5b6+'/'+_0xfa6641)['json'](_0x464e70);}return null;};}function patchUpdates(_0x39a37b){return function(_0x448b5d){try{jsonpatch[_0x84cf('0x23')](_0x448b5d,_0x39a37b,!![]);}catch(_0x33b72e){return BPromise[_0x84cf('0x24')](_0x33b72e);}return _0x448b5d['save']();};}function saveUpdates(_0x42fa45,_0x160f86){return function(_0x475b19){if(_0x475b19){return _0x475b19[_0x84cf('0x25')](_0x42fa45)[_0x84cf('0x26')](function(_0x29e9e1){return _0x29e9e1;});}return null;};}function removeEntity(_0x7feb4,_0x4c9d1c){return function(_0x2b2c90){if(_0x2b2c90){return _0x2b2c90[_0x84cf('0x27')]()[_0x84cf('0x26')](function(){_0x7feb4[_0x84cf('0x1a')](0xcc)[_0x84cf('0x1b')]();});}};}function handleEntityNotFound(_0x44d4bf,_0x3c7eda){return function(_0xa44c81){if(!_0xa44c81){_0x44d4bf[_0x84cf('0x19')](0x194);}return _0xa44c81;};}function handleError(_0x6797c0,_0x5179c1){_0x5179c1=_0x5179c1||0x1f4;return function(_0x83f20b){logger[_0x84cf('0x28')](_0x83f20b[_0x84cf('0x29')]);if(_0x83f20b[_0x84cf('0x2a')]){delete _0x83f20b['name'];}_0x6797c0[_0x84cf('0x1a')](_0x5179c1)['send'](_0x83f20b);};}exports[_0x84cf('0x2b')]=function(_0x4092fd,_0x43b41b){var _0xc15298={},_0x51adcf={},_0x20de4b={'count':0x0,'rows':[]};var _0x2e4653=_[_0x84cf('0x2c')](db[_0x84cf('0x2d')][_0x84cf('0x2e')],function(_0x31dbf5){return{'name':_0x31dbf5[_0x84cf('0x2f')],'type':_0x31dbf5[_0x84cf('0x30')][_0x84cf('0x31')]};});_0x51adcf['model']=_['map'](_0x2e4653,_0x84cf('0x2a'));_0x51adcf[_0x84cf('0x32')]=_[_0x84cf('0x33')](_0x4092fd[_0x84cf('0x32')]);_0x51adcf[_0x84cf('0x34')]=_[_0x84cf('0x35')](_0x51adcf[_0x84cf('0x36')],_0x51adcf[_0x84cf('0x32')]);_0xc15298['attributes']=_[_0x84cf('0x35')](_0x51adcf[_0x84cf('0x36')],qs['fields'](_0x4092fd[_0x84cf('0x32')]['fields']));_0xc15298[_0x84cf('0x37')]=_0xc15298[_0x84cf('0x37')][_0x84cf('0x38')]?_0xc15298[_0x84cf('0x37')]:_0x51adcf[_0x84cf('0x36')];if(!_0x4092fd['query'][_0x84cf('0x39')]('nolimit')){_0xc15298['limit']=qs[_0x84cf('0x1e')](_0x4092fd[_0x84cf('0x32')]['limit']);_0xc15298[_0x84cf('0x1d')]=qs[_0x84cf('0x1d')](_0x4092fd[_0x84cf('0x32')][_0x84cf('0x1d')]);}_0xc15298[_0x84cf('0x3a')]=qs[_0x84cf('0x3b')](_0x4092fd['query'][_0x84cf('0x3b')]);_0xc15298[_0x84cf('0x3c')]=qs[_0x84cf('0x34')](_[_0x84cf('0x3d')](_0x4092fd[_0x84cf('0x32')],_0x51adcf[_0x84cf('0x34')]),_0x2e4653);if(_0x4092fd['query'][_0x84cf('0x3e')]){_0xc15298['where']=_[_0x84cf('0x3f')](_0xc15298[_0x84cf('0x3c')],{'$or':_[_0x84cf('0x2c')](_0x2e4653,function(_0x373d62){if(_0x373d62[_0x84cf('0x30')]!==_0x84cf('0x40')){var _0x263ceb={};_0x263ceb[_0x373d62[_0x84cf('0x2a')]]={'$like':'%'+_0x4092fd[_0x84cf('0x32')]['filter']+'%'};return _0x263ceb;}})});}_0xc15298=_[_0x84cf('0x3f')]({},_0xc15298,_0x4092fd['options']);var _0xfb50c1={'where':_0xc15298[_0x84cf('0x3c')]};return db['ZendeskAccount'][_0x84cf('0x20')](_0xfb50c1)['then'](function(_0x3b248a){_0x20de4b['count']=_0x3b248a;if(_0x4092fd[_0x84cf('0x32')]['includeAll']){_0xc15298[_0x84cf('0x41')]=[{'all':!![]}];}return db[_0x84cf('0x2d')]['findAll'](_0xc15298);})[_0x84cf('0x26')](function(_0x426ddb){_0x20de4b[_0x84cf('0x42')]=_0x426ddb;return _0x20de4b;})['then'](respondWithFilteredResult(_0x43b41b,_0xc15298))[_0x84cf('0x43')](handleError(_0x43b41b,null));};exports['show']=function(_0x1c84e0,_0x58b539){var _0x56b0e5={'raw':![],'where':{'id':_0x1c84e0[_0x84cf('0x44')]['id']}},_0x59c4d7={};_0x59c4d7[_0x84cf('0x36')]=_['keys'](db[_0x84cf('0x2d')]['rawAttributes']);_0x59c4d7[_0x84cf('0x32')]=_[_0x84cf('0x33')](_0x1c84e0['query']);_0x59c4d7[_0x84cf('0x34')]=_['intersection'](_0x59c4d7[_0x84cf('0x36')],_0x59c4d7['query']);_0x56b0e5['attributes']=_['intersection'](_0x59c4d7['model'],qs['fields'](_0x1c84e0['query']['fields']));_0x56b0e5[_0x84cf('0x37')]=_0x56b0e5[_0x84cf('0x37')][_0x84cf('0x38')]?_0x56b0e5[_0x84cf('0x37')]:_0x59c4d7['model'];if(_0x1c84e0[_0x84cf('0x32')]['includeAll']){_0x56b0e5[_0x84cf('0x41')]=[{'all':!![]}];}_0x56b0e5=_[_0x84cf('0x3f')]({},_0x56b0e5,_0x1c84e0[_0x84cf('0x45')]);return db[_0x84cf('0x2d')][_0x84cf('0x46')](_0x56b0e5)[_0x84cf('0x26')](handleEntityNotFound(_0x58b539,null))['then'](respondWithResult(_0x58b539,null))[_0x84cf('0x43')](handleError(_0x58b539,null));};exports[_0x84cf('0x47')]=function(_0x4a4cf7,_0xb2b8ae){return db[_0x84cf('0x2d')][_0x84cf('0x47')](_0x4a4cf7['body'],{})['then'](respondWithResult(_0xb2b8ae,0xc9))['catch'](handleError(_0xb2b8ae,null));};exports[_0x84cf('0x25')]=function(_0x104421,_0x25d4f8){if(_0x104421[_0x84cf('0x48')]['id']){delete _0x104421[_0x84cf('0x48')]['id'];}return db[_0x84cf('0x2d')]['find']({'where':{'id':_0x104421[_0x84cf('0x44')]['id']}})['then'](handleEntityNotFound(_0x25d4f8,null))[_0x84cf('0x26')](saveUpdates(_0x104421['body'],null))['then'](respondWithResult(_0x25d4f8,null))[_0x84cf('0x43')](handleError(_0x25d4f8,null));};exports[_0x84cf('0x27')]=function(_0x426df1,_0x55e24e){return db['ZendeskAccount'][_0x84cf('0x46')]({'where':{'id':_0x426df1[_0x84cf('0x44')]['id']}})[_0x84cf('0x26')](handleEntityNotFound(_0x55e24e,null))[_0x84cf('0x26')](removeEntity(_0x55e24e,null))[_0x84cf('0x43')](handleError(_0x55e24e,null));};exports['getConfigurations']=function(_0xcfe28f,_0x225fc2,_0x5e4af1){var _0x33145e={};var _0x5baea8={};var _0x4fd496;var _0x147194;return db[_0x84cf('0x2d')]['findOne']({'where':{'id':_0xcfe28f['params']['id']}})[_0x84cf('0x26')](handleEntityNotFound(_0x225fc2,null))[_0x84cf('0x26')](function(_0x2f739a){if(_0x2f739a){_0x4fd496=_0x2f739a;_0x5baea8[_0x84cf('0x36')]=_[_0x84cf('0x33')](db[_0x84cf('0x49')][_0x84cf('0x2e')]);_0x5baea8[_0x84cf('0x32')]=_['keys'](_0xcfe28f[_0x84cf('0x32')]);_0x5baea8[_0x84cf('0x34')]=_['intersection'](_0x5baea8['model'],_0x5baea8[_0x84cf('0x32')]);_0x33145e[_0x84cf('0x37')]=_[_0x84cf('0x35')](_0x5baea8[_0x84cf('0x36')],qs[_0x84cf('0x4a')](_0xcfe28f[_0x84cf('0x32')][_0x84cf('0x4a')]));_0x33145e['attributes']=_0x33145e[_0x84cf('0x37')]['length']?_0x33145e[_0x84cf('0x37')]:_0x5baea8['model'];_0x33145e[_0x84cf('0x3a')]=qs[_0x84cf('0x3b')](_0xcfe28f['query'][_0x84cf('0x3b')]);_0x33145e[_0x84cf('0x3c')]=qs['filters'](_[_0x84cf('0x3d')](_0xcfe28f['query'],_0x5baea8['filters']));if(_0xcfe28f['query']['filter']){_0x33145e[_0x84cf('0x3c')]=_[_0x84cf('0x3f')](_0x33145e[_0x84cf('0x3c')],{'$or':_[_0x84cf('0x2c')](_0x33145e['attributes'],function(_0x32aa8b){var _0x3c1c55={};_0x3c1c55[_0x32aa8b]={'$like':'%'+_0xcfe28f['query'][_0x84cf('0x3e')]+'%'};return _0x3c1c55;})});}_0x33145e=_[_0x84cf('0x3f')]({},_0x33145e,_0xcfe28f[_0x84cf('0x45')]);return _0x4fd496[_0x84cf('0x4b')](_0x33145e);}})[_0x84cf('0x26')](function(_0x273711){if(_0x273711){_0x147194=_0x273711[_0x84cf('0x38')];if(!_0xcfe28f[_0x84cf('0x32')]['hasOwnProperty'](_0x84cf('0x4c'))){_0x33145e['limit']=qs[_0x84cf('0x1e')](_0xcfe28f[_0x84cf('0x32')][_0x84cf('0x1e')]);_0x33145e[_0x84cf('0x1d')]=qs[_0x84cf('0x1d')](_0xcfe28f['query'][_0x84cf('0x1d')]);}return _0x4fd496[_0x84cf('0x4b')](_0x33145e);}})[_0x84cf('0x26')](function(_0x4ebb4b){if(_0x4ebb4b){return _0x4ebb4b?{'count':_0x147194,'rows':_0x4ebb4b}:null;}})[_0x84cf('0x26')](respondWithResult(_0x225fc2,null))[_0x84cf('0x43')](handleError(_0x225fc2,null));};exports['addConfiguration']=function(_0x84d9cb,_0x482958,_0x26f8d4){if(_0x84d9cb[_0x84cf('0x48')]['id']){delete _0x84d9cb['body']['id'];}return db[_0x84cf('0x2d')][_0x84cf('0x4d')]({'where':{'id':_0x84d9cb['params']['id']}})[_0x84cf('0x26')](handleEntityNotFound(_0x482958,null))[_0x84cf('0x26')](function(_0x262ae1){if(_0x262ae1){_0x84d9cb[_0x84cf('0x48')]['AccountId']=_0x262ae1['id'];_0x84d9cb[_0x84cf('0x48')][_0x84cf('0x4e')]=integrations['getSubjects'](_0x84d9cb['body']['channel'],_0x84d9cb[_0x84cf('0x48')][_0x84cf('0x30')]);_0x84d9cb[_0x84cf('0x48')]['Descriptions']=integrations['getDescriptions'](_0x84d9cb[_0x84cf('0x48')][_0x84cf('0x4f')],_0x84d9cb[_0x84cf('0x48')][_0x84cf('0x30')]);return db[_0x84cf('0x49')][_0x84cf('0x47')](_0x84d9cb[_0x84cf('0x48')],{'include':[{'model':db[_0x84cf('0x50')],'as':'Subjects'},{'model':db[_0x84cf('0x50')],'as':'Descriptions'}]});}return null;})[_0x84cf('0x26')](respondWithResult(_0x482958,null))[_0x84cf('0x43')](handleError(_0x482958,null));};exports['getFields']=function(_0x5b154a,_0x282c17,_0x31e622){var _0x373a25='';return db[_0x84cf('0x2d')][_0x84cf('0x4d')]({'where':{'id':_0x5b154a['params']['id']},'attributes':['id',_0x84cf('0x51'),_0x84cf('0x52'),_0x84cf('0x53'),_0x84cf('0x54'),'remoteUri']})[_0x84cf('0x26')](handleEntityNotFound(_0x282c17,null))['then'](function(_0x4bfa38){if(_0x4bfa38){_0x373a25=_0x4bfa38[_0x84cf('0x55')];var _0x292202=_0x373a25[_0x84cf('0x56')](-0x1);if(_0x292202==='/'){_0x373a25=_0x373a25[_0x84cf('0x57')](0x0,_0x373a25['lastIndexOf'](_0x292202));}var _0x5c8e79={'method':'GET','uri':util[_0x84cf('0x58')]('%s/%s',_0x373a25,_0x84cf('0x59')),'json':!![]};switch(_0x4bfa38[_0x84cf('0x54')]){case _0x84cf('0x52'):_0x5c8e79[_0x84cf('0x5a')]={'Authorization':util['format'](_0x84cf('0x5b'),new Buffer(util[_0x84cf('0x58')]('%s:%s',_0x4bfa38[_0x84cf('0x51')],_0x4bfa38['password']))['toString'](_0x84cf('0x5c')))};break;case _0x84cf('0x53'):_0x5c8e79['headers']={'Authorization':util['format'](_0x84cf('0x5b'),new Buffer(util['format']('%s/token:%s',_0x4bfa38['username'],_0x4bfa38[_0x84cf('0x53')]))[_0x84cf('0x5d')](_0x84cf('0x5c')))};break;default:throw new db['Sequelize']['ValidationError'](_0x84cf('0x5e'));}return rp(_0x5c8e79);}})[_0x84cf('0x26')](function(_0x4393a0){if(_0x4393a0){var _0x4686e2=['subject','description','group',_0x84cf('0x5f')];_[_0x84cf('0x60')](_0x4393a0[_0x84cf('0x59')],function(_0x4fc2f2){return _0x4686e2[_0x84cf('0x61')](_0x4fc2f2[_0x84cf('0x30')]);});return{'count':_0x4393a0[_0x84cf('0x59')][_0x84cf('0x38')],'rows':_[_0x84cf('0x2c')](_0x4393a0['ticket_fields'],function(_0x1ffa84){return{'id':_0x1ffa84['id'],'name':_0x1ffa84[_0x84cf('0x62')]>0x7?_0x1ffa84[_0x84cf('0x63')]:_0x1ffa84['type'],'custom':_0x1ffa84[_0x84cf('0x62')]>0x7?!![]:![],'options':_0x1ffa84[_0x84cf('0x64')]?_0x1ffa84['system_field_options']:_0x1ffa84[_0x84cf('0x65')]?_0x1ffa84[_0x84cf('0x65')]:[]};})};}})[_0x84cf('0x26')](respondWithResult(_0x282c17,null))[_0x84cf('0x43')](function(_0x538a77){var _0x4f1fbb=_0x5b154a[_0x84cf('0x32')][_0x84cf('0x66')]?0x1f4:_0x538a77['statusCode']||0x1f4;logger['error'](_0x84cf('0x67'),_0x84cf('0x68'),_0x4f1fbb,JSON[_0x84cf('0x69')](_0x538a77));delete _0x538a77[_0x84cf('0x2a')];if(_0x4f1fbb===0x191){_0x4f1fbb=0x190;}_0x282c17[_0x84cf('0x1a')](_0x4f1fbb)[_0x84cf('0x6a')](_0x5b154a[_0x84cf('0x32')][_0x84cf('0x66')]?{'message':'Wrong\x20credentials','statusCode':_0x538a77[_0x84cf('0x6b')]}:_0x538a77);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 7c3d70b..78d26a7 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 _0x7d9e=['util','api','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','lodash'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x7d9e,0x107));var _0xe7d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d9e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe7d9('0x0'));var util=require(_0xe7d9('0x1'));var logger=require('../../config/logger')(_0xe7d9('0x2'));var moment=require('moment');var BPromise=require(_0xe7d9('0x3'));var rp=require(_0xe7d9('0x4'));var fs=require('fs');var path=require(_0xe7d9('0x5'));var rimraf=require('rimraf');var config=require(_0xe7d9('0x6'));var attributes=require(_0xe7d9('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xe7d9('0x8')]=function(_0x1d86e9,_0x39fbb3){return _0x1d86e9[_0xe7d9('0x9')](_0xe7d9('0xa'),attributes,{'tableName':_0xe7d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b5a=['moment','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','lodash','util','api'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x1b5a,0x8c));var _0xa1b5=function(_0x165a4a,_0x2ef42c){_0x165a4a=_0x165a4a-0x0;var _0x18634a=_0x1b5a[_0x165a4a];return _0x18634a;};'use strict';var _=require(_0xa1b5('0x0'));var util=require(_0xa1b5('0x1'));var logger=require('../../config/logger')(_0xa1b5('0x2'));var moment=require(_0xa1b5('0x3'));var BPromise=require(_0xa1b5('0x4'));var rp=require(_0xa1b5('0x5'));var fs=require('fs');var path=require(_0xa1b5('0x6'));var rimraf=require('rimraf');var config=require(_0xa1b5('0x7'));var attributes=require(_0xa1b5('0x8'));var integrations=require(_0xa1b5('0x9'));module['exports']=function(_0x249f51,_0x59c696){return _0x249f51[_0xa1b5('0xa')](_0xa1b5('0xb'),attributes,{'tableName':_0xa1b5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index a1660ce..0330baf 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 _0xbf2a=['message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','limit','include','model','map','attributes','ShowZendeskAccount','find','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0xbf2a,0x1ec));var _0xabf2=function(_0x5baf32,_0x103278){_0x5baf32=_0x5baf32-0x0;var _0x539cae=_0xbf2a[_0x5baf32];return _0x539cae;};'use strict';var _=require(_0xabf2('0x0'));var util=require(_0xabf2('0x1'));var moment=require(_0xabf2('0x2'));var BPromise=require('bluebird');var rs=require(_0xabf2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xabf2('0x4'));var logger=require(_0xabf2('0x5'))(_0xabf2('0x6'));var config=require('../../config/environment');var jayson=require(_0xabf2('0x7'));var client=jayson[_0xabf2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b7e1f,_0x538df9,_0x2a59fd){return new BPromise(function(_0x350f4b,_0x14ad11){return client[_0xabf2('0x9')](_0x5b7e1f,_0x2a59fd)[_0xabf2('0xa')](function(_0x2c4ea9){logger[_0xabf2('0xb')](_0xabf2('0xc'),_0x538df9,_0xabf2('0xd'));logger[_0xabf2('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x538df9,'request\x20sent',JSON[_0xabf2('0xf')](_0x2c4ea9));if(_0x2c4ea9[_0xabf2('0x10')]){if(_0x2c4ea9[_0xabf2('0x10')][_0xabf2('0x11')]===0x1f4){logger[_0xabf2('0x10')](_0xabf2('0xc'),_0x538df9,_0x2c4ea9[_0xabf2('0x10')]['message']);return _0x14ad11(_0x2c4ea9[_0xabf2('0x10')]['message']);}logger[_0xabf2('0x10')](_0xabf2('0xc'),_0x538df9,_0x2c4ea9['error'][_0xabf2('0x12')]);return _0x350f4b(_0x2c4ea9[_0xabf2('0x10')][_0xabf2('0x12')]);}else{logger[_0xabf2('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x538df9,_0xabf2('0xd'));_0x350f4b(_0x2c4ea9[_0xabf2('0x13')][_0xabf2('0x12')]);}})[_0xabf2('0x14')](function(_0x259bf3){logger[_0xabf2('0x10')](_0xabf2('0xc'),_0x538df9,_0x259bf3);_0x14ad11(_0x259bf3);});});}exports[_0xabf2('0x15')]=function(_0x499fff){var _0x45a559=this;return new Promise(function(_0xa6e7b3,_0x8297ca){return db[_0xabf2('0x16')][_0xabf2('0x17')]({'raw':_0x499fff[_0xabf2('0x18')]?_0x499fff['options'][_0xabf2('0x19')]===undefined?!![]:![]:!![],'where':_0x499fff[_0xabf2('0x18')]?_0x499fff['options'][_0xabf2('0x1a')]||null:null,'attributes':_0x499fff[_0xabf2('0x18')]?_0x499fff[_0xabf2('0x18')]['attributes']||null:null,'limit':_0x499fff[_0xabf2('0x18')]?_0x499fff['options'][_0xabf2('0x1b')]||null:null,'include':_0x499fff[_0xabf2('0x18')]?_0x499fff[_0xabf2('0x18')][_0xabf2('0x1c')]?_['map'](_0x499fff[_0xabf2('0x18')][_0xabf2('0x1c')],function(_0xc540da){return{'model':db[_0xc540da[_0xabf2('0x1d')]],'as':_0xc540da['as'],'attributes':_0xc540da['attributes'],'include':_0xc540da[_0xabf2('0x1c')]?_[_0xabf2('0x1e')](_0xc540da[_0xabf2('0x1c')],function(_0xc30480){return{'model':db[_0xc30480[_0xabf2('0x1d')]],'as':_0xc30480['as'],'attributes':_0xc30480[_0xabf2('0x1f')],'include':_0xc30480[_0xabf2('0x1c')]?_['map'](_0xc30480['include'],function(_0x4e4a4f){return{'model':db[_0x4e4a4f[_0xabf2('0x1d')]],'as':_0x4e4a4f['as'],'attributes':_0x4e4a4f['attributes']};}):[]};}):[]};}):[]:[]})[_0xabf2('0xa')](function(_0x478802){logger[_0xabf2('0xb')]('GetZendeskAccount',_0x499fff);logger[_0xabf2('0xe')](_0xabf2('0x15'),_0x499fff,JSON[_0xabf2('0xf')](_0x478802));_0xa6e7b3(_0x478802);})[_0xabf2('0x14')](function(_0x3d5027){logger['error']('GetZendeskAccount',_0x3d5027[_0xabf2('0x12')],_0x499fff);_0x8297ca(_0x45a559[_0xabf2('0x10')](0x1f4,_0x3d5027[_0xabf2('0x12')]));});});};exports[_0xabf2('0x20')]=function(_0x59c31e){var _0x46c5bf=this;return new Promise(function(_0x34120d,_0x47c93a){return db[_0xabf2('0x16')][_0xabf2('0x21')]({'raw':_0x59c31e[_0xabf2('0x18')]?_0x59c31e[_0xabf2('0x18')][_0xabf2('0x19')]===undefined?!![]:![]:!![],'where':_0x59c31e['options']?_0x59c31e[_0xabf2('0x18')][_0xabf2('0x1a')]||null:null,'attributes':_0x59c31e[_0xabf2('0x18')]?_0x59c31e[_0xabf2('0x18')]['attributes']||null:null,'include':_0x59c31e[_0xabf2('0x18')]?_0x59c31e[_0xabf2('0x18')][_0xabf2('0x1c')]?_[_0xabf2('0x1e')](_0x59c31e[_0xabf2('0x18')]['include'],function(_0x3aca4c){return{'model':db[_0x3aca4c[_0xabf2('0x1d')]],'as':_0x3aca4c['as'],'attributes':_0x3aca4c[_0xabf2('0x1f')],'include':_0x3aca4c['include']?_['map'](_0x3aca4c['include'],function(_0x36dc93){return{'model':db[_0x36dc93[_0xabf2('0x1d')]],'as':_0x36dc93['as'],'attributes':_0x36dc93['attributes'],'include':_0x36dc93['include']?_[_0xabf2('0x1e')](_0x36dc93['include'],function(_0x4b17c6){return{'model':db[_0x4b17c6[_0xabf2('0x1d')]],'as':_0x4b17c6['as'],'attributes':_0x4b17c6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x158f0b){logger[_0xabf2('0xb')](_0xabf2('0x20'),_0x59c31e);logger['debug'](_0xabf2('0x20'),_0x59c31e,JSON[_0xabf2('0xf')](_0x158f0b));_0x34120d(_0x158f0b);})[_0xabf2('0x14')](function(_0x233e0a){logger['error'](_0xabf2('0x20'),_0x233e0a[_0xabf2('0x12')],_0x59c31e);_0x47c93a(_0x46c5bf['error'](0x1f4,_0x233e0a['message']));});});}; \ No newline at end of file +var _0x4523=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','then','debug','ShowZendeskAccount','find','lodash','util','moment'];(function(_0x356870,_0x3a1d32){var _0x2cc847=function(_0x4114cd){while(--_0x4114cd){_0x356870['push'](_0x356870['shift']());}};_0x2cc847(++_0x3a1d32);}(_0x4523,0x165));var _0x3452=function(_0x2794ca,_0x3678f7){_0x2794ca=_0x2794ca-0x0;var _0x282278=_0x4523[_0x2794ca];return _0x282278;};'use strict';var _=require(_0x3452('0x0'));var util=require(_0x3452('0x1'));var moment=require(_0x3452('0x2'));var BPromise=require('bluebird');var rs=require(_0x3452('0x3'));var fs=require('fs');var Redis=require(_0x3452('0x4'));var db=require(_0x3452('0x5'))['db'];var utils=require(_0x3452('0x6'));var logger=require(_0x3452('0x7'))(_0x3452('0x8'));var config=require(_0x3452('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3452('0xa')][_0x3452('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d1675,_0x5e66e9,_0x5604a5){return new BPromise(function(_0xb3e186,_0x1b80b7){return client['request'](_0x2d1675,_0x5604a5)['then'](function(_0x3fe0f3){logger[_0x3452('0xc')](_0x3452('0xd'),_0x5e66e9,_0x3452('0xe'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x5e66e9,_0x3452('0xe'),JSON[_0x3452('0xf')](_0x3fe0f3));if(_0x3fe0f3['error']){if(_0x3fe0f3[_0x3452('0x10')][_0x3452('0x11')]===0x1f4){logger['error'](_0x3452('0xd'),_0x5e66e9,_0x3fe0f3[_0x3452('0x10')][_0x3452('0x12')]);return _0x1b80b7(_0x3fe0f3['error'][_0x3452('0x12')]);}logger[_0x3452('0x10')](_0x3452('0xd'),_0x5e66e9,_0x3fe0f3[_0x3452('0x10')][_0x3452('0x12')]);return _0xb3e186(_0x3fe0f3[_0x3452('0x10')][_0x3452('0x12')]);}else{logger[_0x3452('0xc')](_0x3452('0xd'),_0x5e66e9,_0x3452('0xe'));_0xb3e186(_0x3fe0f3[_0x3452('0x13')][_0x3452('0x12')]);}})[_0x3452('0x14')](function(_0x79488c){logger[_0x3452('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x5e66e9,_0x79488c);_0x1b80b7(_0x79488c);});});}exports[_0x3452('0x15')]=function(_0x12f23d){var _0x3becf2=this;return new Promise(function(_0x574750,_0x5b3013){return db[_0x3452('0x16')][_0x3452('0x17')]({'raw':_0x12f23d[_0x3452('0x18')]?_0x12f23d[_0x3452('0x18')][_0x3452('0x19')]===undefined?!![]:![]:!![],'where':_0x12f23d[_0x3452('0x18')]?_0x12f23d[_0x3452('0x18')][_0x3452('0x1a')]||null:null,'attributes':_0x12f23d[_0x3452('0x18')]?_0x12f23d['options']['attributes']||null:null,'limit':_0x12f23d[_0x3452('0x18')]?_0x12f23d[_0x3452('0x18')][_0x3452('0x1b')]||null:null,'include':_0x12f23d[_0x3452('0x18')]?_0x12f23d[_0x3452('0x18')][_0x3452('0x1c')]?_[_0x3452('0x1d')](_0x12f23d[_0x3452('0x18')]['include'],function(_0x2ad2fd){return{'model':db[_0x2ad2fd[_0x3452('0x1e')]],'as':_0x2ad2fd['as'],'attributes':_0x2ad2fd[_0x3452('0x1f')],'include':_0x2ad2fd['include']?_[_0x3452('0x1d')](_0x2ad2fd[_0x3452('0x1c')],function(_0x2d1c8d){return{'model':db[_0x2d1c8d[_0x3452('0x1e')]],'as':_0x2d1c8d['as'],'attributes':_0x2d1c8d[_0x3452('0x1f')],'include':_0x2d1c8d[_0x3452('0x1c')]?_[_0x3452('0x1d')](_0x2d1c8d[_0x3452('0x1c')],function(_0x552fa5){return{'model':db[_0x552fa5['model']],'as':_0x552fa5['as'],'attributes':_0x552fa5[_0x3452('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3452('0x20')](function(_0x54ada8){logger[_0x3452('0xc')](_0x3452('0x15'),_0x12f23d);logger[_0x3452('0x21')](_0x3452('0x15'),_0x12f23d,JSON[_0x3452('0xf')](_0x54ada8));_0x574750(_0x54ada8);})[_0x3452('0x14')](function(_0x1ffdde){logger[_0x3452('0x10')](_0x3452('0x15'),_0x1ffdde[_0x3452('0x12')],_0x12f23d);_0x5b3013(_0x3becf2['error'](0x1f4,_0x1ffdde[_0x3452('0x12')]));});});};exports[_0x3452('0x22')]=function(_0x48924c){var _0x24a358=this;return new Promise(function(_0x252709,_0x24a340){return db[_0x3452('0x16')][_0x3452('0x23')]({'raw':_0x48924c['options']?_0x48924c['options']['raw']===undefined?!![]:![]:!![],'where':_0x48924c[_0x3452('0x18')]?_0x48924c['options'][_0x3452('0x1a')]||null:null,'attributes':_0x48924c[_0x3452('0x18')]?_0x48924c['options'][_0x3452('0x1f')]||null:null,'include':_0x48924c[_0x3452('0x18')]?_0x48924c[_0x3452('0x18')][_0x3452('0x1c')]?_[_0x3452('0x1d')](_0x48924c[_0x3452('0x18')][_0x3452('0x1c')],function(_0x1c70d5){return{'model':db[_0x1c70d5[_0x3452('0x1e')]],'as':_0x1c70d5['as'],'attributes':_0x1c70d5[_0x3452('0x1f')],'include':_0x1c70d5['include']?_[_0x3452('0x1d')](_0x1c70d5[_0x3452('0x1c')],function(_0x29b333){return{'model':db[_0x29b333[_0x3452('0x1e')]],'as':_0x29b333['as'],'attributes':_0x29b333['attributes'],'include':_0x29b333['include']?_[_0x3452('0x1d')](_0x29b333[_0x3452('0x1c')],function(_0x4762fa){return{'model':db[_0x4762fa[_0x3452('0x1e')]],'as':_0x4762fa['as'],'attributes':_0x4762fa[_0x3452('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3452('0x20')](function(_0x86e278){logger[_0x3452('0xc')](_0x3452('0x22'),_0x48924c);logger[_0x3452('0x21')](_0x3452('0x22'),_0x48924c,JSON['stringify'](_0x86e278));_0x252709(_0x86e278);})[_0x3452('0x14')](function(_0x5a1008){logger[_0x3452('0x10')](_0x3452('0x22'),_0x5a1008[_0x3452('0x12')],_0x48924c);_0x24a340(_0x24a358[_0x3452('0x10')](0x1f4,_0x5a1008['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index eb93ca2..d136f28 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 _0xb688=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','update','exports','util'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0xb688,0xcf));var _0x8b68=function(_0x1c2f29,_0xd124c4){_0x1c2f29=_0x1c2f29-0x0;var _0x6d56aa=_0xb688[_0x1c2f29];return _0x6d56aa;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x9')](_0x8b68('0x14'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x17')]);router[_0x8b68('0x16')]('/:id/tags',auth[_0x8b68('0xc')](),controller['setTags']);router['put'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x18')]);router['delete']('/:id',auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x19')]=router; \ No newline at end of file +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(_0x3fcfb6,_0x515024){var _0x3b99a7=function(_0x10ddfd){while(--_0x10ddfd){_0x3fcfb6['push'](_0x3fcfb6['shift']());}};_0x3b99a7(++_0x515024);}(_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('./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 diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 5c9b007..929b114 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 _0x9b67=['sequelize','STRING'];(function(_0x323a20,_0x1506d7){var _0x125c02=function(_0x591f59){while(--_0x591f59){_0x323a20['push'](_0x323a20['shift']());}};_0x125c02(++_0x1506d7);}(_0x9b67,0x1dc));var _0x79b6=function(_0x52aeca,_0x13cd7c){_0x52aeca=_0x52aeca-0x0;var _0x15fa0a=_0x9b67[_0x52aeca];return _0x15fa0a;};'use strict';var Sequelize=require(_0x79b6('0x0'));module['exports']={'name':{'type':Sequelize[_0x79b6('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x21c5=['exports','STRING'];(function(_0x3c9a46,_0x24edc9){var _0x5b320b=function(_0x5d13ff){while(--_0x5d13ff){_0x3c9a46['push'](_0x3c9a46['shift']());}};_0x5b320b(++_0x24edc9);}(_0x21c5,0x168));var _0x521c=function(_0xe746f7,_0x4a7206){_0xe746f7=_0xe746f7-0x0;var _0x37b778=_0x21c5[_0xe746f7];return _0x37b778;};'use strict';var Sequelize=require('sequelize');module[_0x521c('0x0')]={'name':{'type':Sequelize[_0x521c('0x1')]},'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 7eb514e..2510380 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 _0x4924=['apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','getFields','findOne','ZendeskField','pick','getSubjects','filter','getDescriptions','getTags','Tag','setTags','ids','zip-dir','fast-json-patch','moment','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x222e99,_0x4f7311){var _0x6b0224=function(_0x8ce0e1){while(--_0x8ce0e1){_0x222e99['push'](_0x222e99['shift']());}};_0x6b0224(++_0x4f7311);}(_0x4924,0x1d3));var _0x4492=function(_0x5b5eb4,_0x117c87){_0x5b5eb4=_0x5b5eb4-0x0;var _0x42af53=_0x4924[_0x5b5eb4];return _0x42af53;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4492('0x0'));var jsonpatch=require(_0x4492('0x1'));var rp=require('request-promise');var moment=require(_0x4492('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4492('0x3'));var path=require(_0x4492('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4492('0x5'));var fs=require('fs');var fs_extra=require(_0x4492('0x6'));var _=require(_0x4492('0x7'));var squel=require(_0x4492('0x8'));var crypto=require(_0x4492('0x9'));var jsforce=require(_0x4492('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4492('0xb'));var querystring=require(_0x4492('0xc'));var Papa=require(_0x4492('0xd'));var Redis=require(_0x4492('0xe'));var authService=require(_0x4492('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4492('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4492('0x11'))(_0x4492('0x12'));var utils=require('../../config/utils');var config=require(_0x4492('0x13'));var licenseUtil=require(_0x4492('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19c463,_0x21925c){_0x21925c=_0x21925c||0xcc;return function(_0x1235f3){if(_0x1235f3){return _0x19c463[_0x4492('0x15')](_0x21925c);}return _0x19c463[_0x4492('0x16')](_0x21925c)[_0x4492('0x17')]();};}function respondWithResult(_0x296b05,_0x1bf691){_0x1bf691=_0x1bf691||0xc8;return function(_0x3346f2){if(_0x3346f2){return _0x296b05['status'](_0x1bf691)[_0x4492('0x18')](_0x3346f2);}};}function respondWithFilteredResult(_0x2acb5a,_0x1be302){return function(_0xe50910){if(_0xe50910){var _0x49931b=typeof _0x1be302[_0x4492('0x19')]===_0x4492('0x1a')&&typeof _0x1be302[_0x4492('0x1b')]===_0x4492('0x1a');var _0x3f8558=_0xe50910[_0x4492('0x1c')];var _0x30aaab=_0x49931b?0x0:_0x1be302[_0x4492('0x19')];var _0x1871cf=_0x49931b?_0xe50910[_0x4492('0x1c')]:_0x1be302[_0x4492('0x19')]+_0x1be302[_0x4492('0x1b')];var _0xdfdbf2;if(_0x1871cf>=_0x3f8558){_0x1871cf=_0x3f8558;_0xdfdbf2=0xc8;}else{_0xdfdbf2=0xce;}_0x2acb5a['status'](_0xdfdbf2);return _0x2acb5a[_0x4492('0x1d')](_0x4492('0x1e'),_0x30aaab+'-'+_0x1871cf+'/'+_0x3f8558)[_0x4492('0x18')](_0xe50910);}return null;};}function patchUpdates(_0x4a3ad7){return function(_0x139aee){try{jsonpatch[_0x4492('0x1f')](_0x139aee,_0x4a3ad7,!![]);}catch(_0x4f1dc9){return BPromise[_0x4492('0x20')](_0x4f1dc9);}return _0x139aee[_0x4492('0x21')]();};}function saveUpdates(_0x392b8e,_0x29e9d8){return function(_0xc396e8){if(_0xc396e8){return _0xc396e8[_0x4492('0x22')](_0x392b8e)[_0x4492('0x23')](function(_0x3b881d){return _0x3b881d;});}return null;};}function removeEntity(_0x47978b,_0x1eac79){return function(_0x502ae1){if(_0x502ae1){return _0x502ae1[_0x4492('0x24')]()[_0x4492('0x23')](function(){_0x47978b[_0x4492('0x16')](0xcc)[_0x4492('0x17')]();});}};}function handleEntityNotFound(_0x4b43cf,_0x2f95f4){return function(_0x59137c){if(!_0x59137c){_0x4b43cf[_0x4492('0x15')](0x194);}return _0x59137c;};}function handleError(_0x11c291,_0x2097ad){_0x2097ad=_0x2097ad||0x1f4;return function(_0x1980e4){logger['error'](_0x1980e4[_0x4492('0x25')]);if(_0x1980e4[_0x4492('0x26')]){delete _0x1980e4[_0x4492('0x26')];}_0x11c291[_0x4492('0x16')](_0x2097ad)[_0x4492('0x27')](_0x1980e4);};}exports[_0x4492('0x28')]=function(_0x7f953c,_0x440ed8){var _0x2178a2={},_0x3f352a={},_0x5ec5be={'count':0x0,'rows':[]};var _0x2e3f31=_[_0x4492('0x29')](db[_0x4492('0x2a')][_0x4492('0x2b')],function(_0x1812ca){return{'name':_0x1812ca[_0x4492('0x2c')],'type':_0x1812ca[_0x4492('0x2d')][_0x4492('0x2e')]};});_0x3f352a[_0x4492('0x2f')]=_[_0x4492('0x29')](_0x2e3f31,_0x4492('0x26'));_0x3f352a['query']=_['keys'](_0x7f953c[_0x4492('0x30')]);_0x3f352a[_0x4492('0x31')]=_[_0x4492('0x32')](_0x3f352a[_0x4492('0x2f')],_0x3f352a[_0x4492('0x30')]);_0x2178a2[_0x4492('0x33')]=_[_0x4492('0x32')](_0x3f352a[_0x4492('0x2f')],qs[_0x4492('0x34')](_0x7f953c[_0x4492('0x30')][_0x4492('0x34')]));_0x2178a2[_0x4492('0x33')]=_0x2178a2[_0x4492('0x33')]['length']?_0x2178a2[_0x4492('0x33')]:_0x3f352a['model'];if(!_0x7f953c['query'][_0x4492('0x35')](_0x4492('0x36'))){_0x2178a2[_0x4492('0x1b')]=qs[_0x4492('0x1b')](_0x7f953c[_0x4492('0x30')][_0x4492('0x1b')]);_0x2178a2[_0x4492('0x19')]=qs[_0x4492('0x19')](_0x7f953c[_0x4492('0x30')][_0x4492('0x19')]);}_0x2178a2[_0x4492('0x37')]=qs['sort'](_0x7f953c[_0x4492('0x30')][_0x4492('0x38')]);_0x2178a2[_0x4492('0x39')]=qs['filters'](_['pick'](_0x7f953c[_0x4492('0x30')],_0x3f352a[_0x4492('0x31')]),_0x2e3f31);if(_0x7f953c[_0x4492('0x30')]['filter']){_0x2178a2[_0x4492('0x39')]=_[_0x4492('0x3a')](_0x2178a2['where'],{'$or':_[_0x4492('0x29')](_0x2e3f31,function(_0x1e5116){if(_0x1e5116['type']!=='VIRTUAL'){var _0x11be98={};_0x11be98[_0x1e5116[_0x4492('0x26')]]={'$like':'%'+_0x7f953c[_0x4492('0x30')]['filter']+'%'};return _0x11be98;}})});}_0x2178a2=_[_0x4492('0x3a')]({},_0x2178a2,_0x7f953c[_0x4492('0x3b')]);var _0x199eed={'where':_0x2178a2['where']};return db[_0x4492('0x2a')][_0x4492('0x1c')](_0x199eed)[_0x4492('0x23')](function(_0x33bec5){_0x5ec5be[_0x4492('0x1c')]=_0x33bec5;if(_0x7f953c['query'][_0x4492('0x3c')]){_0x2178a2['include']=[{'all':!![]}];}return db[_0x4492('0x2a')][_0x4492('0x3d')](_0x2178a2);})[_0x4492('0x23')](function(_0x366aae){_0x5ec5be[_0x4492('0x3e')]=_0x366aae;return _0x5ec5be;})[_0x4492('0x23')](respondWithFilteredResult(_0x440ed8,_0x2178a2))[_0x4492('0x3f')](handleError(_0x440ed8,null));};exports[_0x4492('0x40')]=function(_0x53d8e3,_0x40a10e){var _0xf53020={'raw':![],'where':{'id':_0x53d8e3[_0x4492('0x41')]['id']}},_0x1d752f={};_0x1d752f[_0x4492('0x2f')]=_[_0x4492('0x42')](db[_0x4492('0x2a')][_0x4492('0x2b')]);_0x1d752f[_0x4492('0x30')]=_[_0x4492('0x42')](_0x53d8e3[_0x4492('0x30')]);_0x1d752f['filters']=_[_0x4492('0x32')](_0x1d752f['model'],_0x1d752f[_0x4492('0x30')]);_0xf53020[_0x4492('0x33')]=_['intersection'](_0x1d752f[_0x4492('0x2f')],qs[_0x4492('0x34')](_0x53d8e3[_0x4492('0x30')][_0x4492('0x34')]));_0xf53020[_0x4492('0x33')]=_0xf53020[_0x4492('0x33')][_0x4492('0x43')]?_0xf53020[_0x4492('0x33')]:_0x1d752f[_0x4492('0x2f')];if(_0x53d8e3['query'][_0x4492('0x3c')]){_0xf53020[_0x4492('0x44')]=[{'all':!![]}];}_0xf53020=_[_0x4492('0x3a')]({},_0xf53020,_0x53d8e3[_0x4492('0x3b')]);return db[_0x4492('0x2a')][_0x4492('0x45')](_0xf53020)[_0x4492('0x23')](handleEntityNotFound(_0x40a10e,null))[_0x4492('0x23')](respondWithResult(_0x40a10e,null))['catch'](handleError(_0x40a10e,null));};exports[_0x4492('0x46')]=function(_0x1ac270,_0x1871a6){return db[_0x4492('0x2a')][_0x4492('0x46')](_0x1ac270[_0x4492('0x47')],{})[_0x4492('0x23')](respondWithResult(_0x1871a6,0xc9))[_0x4492('0x3f')](handleError(_0x1871a6,null));};exports[_0x4492('0x22')]=function(_0x5d431a,_0x1376f4){if(_0x5d431a['body']['id']){delete _0x5d431a[_0x4492('0x47')]['id'];}return db['ZendeskConfiguration'][_0x4492('0x45')]({'where':{'id':_0x5d431a[_0x4492('0x41')]['id']}})[_0x4492('0x23')](handleEntityNotFound(_0x1376f4,null))[_0x4492('0x23')](saveUpdates(_0x5d431a[_0x4492('0x47')],null))[_0x4492('0x23')](respondWithResult(_0x1376f4,null))[_0x4492('0x3f')](handleError(_0x1376f4,null));};exports['destroy']=function(_0x329acd,_0x6030b6){return db[_0x4492('0x2a')][_0x4492('0x45')]({'where':{'id':_0x329acd['params']['id']}})[_0x4492('0x23')](handleEntityNotFound(_0x6030b6,null))['then'](removeEntity(_0x6030b6,null))[_0x4492('0x3f')](handleError(_0x6030b6,null));};exports[_0x4492('0x48')]=function(_0x47e0b7,_0x25409b,_0x279200){var _0x245557={};var _0x2aa342={};var _0x4f5f56;var _0x42d8ed;return db[_0x4492('0x2a')][_0x4492('0x49')]({'where':{'id':_0x47e0b7[_0x4492('0x41')]['id']}})[_0x4492('0x23')](handleEntityNotFound(_0x25409b,null))[_0x4492('0x23')](function(_0x47e27d){if(_0x47e27d){_0x4f5f56=_0x47e27d;_0x2aa342[_0x4492('0x2f')]=_['keys'](db[_0x4492('0x4a')][_0x4492('0x2b')]);_0x2aa342[_0x4492('0x30')]=_[_0x4492('0x42')](_0x47e0b7['query']);_0x2aa342[_0x4492('0x31')]=_[_0x4492('0x32')](_0x2aa342[_0x4492('0x2f')],_0x2aa342[_0x4492('0x30')]);_0x245557['attributes']=_['intersection'](_0x2aa342['model'],qs[_0x4492('0x34')](_0x47e0b7[_0x4492('0x30')][_0x4492('0x34')]));_0x245557['attributes']=_0x245557[_0x4492('0x33')][_0x4492('0x43')]?_0x245557['attributes']:_0x2aa342[_0x4492('0x2f')];_0x245557['order']=qs[_0x4492('0x38')](_0x47e0b7[_0x4492('0x30')][_0x4492('0x38')]);_0x245557['where']=qs['filters'](_['pick'](_0x47e0b7[_0x4492('0x30')],_0x2aa342[_0x4492('0x31')]));if(_0x47e0b7[_0x4492('0x30')]['filter']){_0x245557[_0x4492('0x39')]=_[_0x4492('0x3a')](_0x245557['where'],{'$or':_['map'](_0x245557['attributes'],function(_0x5818cf){var _0x19bbd1={};_0x19bbd1[_0x5818cf]={'$like':'%'+_0x47e0b7[_0x4492('0x30')]['filter']+'%'};return _0x19bbd1;})});}_0x245557=_[_0x4492('0x3a')]({},_0x245557,_0x47e0b7['options']);return _0x4f5f56[_0x4492('0x48')](_0x245557);}})['then'](function(_0x1729ce){if(_0x1729ce){_0x42d8ed=_0x1729ce['length'];if(!_0x47e0b7[_0x4492('0x30')][_0x4492('0x35')]('nolimit')){_0x245557['limit']=qs[_0x4492('0x1b')](_0x47e0b7[_0x4492('0x30')][_0x4492('0x1b')]);_0x245557[_0x4492('0x19')]=qs[_0x4492('0x19')](_0x47e0b7[_0x4492('0x30')][_0x4492('0x19')]);}return _0x4f5f56['getFields'](_0x245557);}})[_0x4492('0x23')](function(_0x4ee93e){if(_0x4ee93e){return _0x4ee93e?{'count':_0x42d8ed,'rows':_0x4ee93e}:null;}})[_0x4492('0x23')](respondWithResult(_0x25409b,null))[_0x4492('0x3f')](handleError(_0x25409b,null));};exports['getSubjects']=function(_0xec8731,_0x3cf74d,_0x589101){var _0x1c93a7={};var _0xcba4e5={};var _0x1875f6;var _0x467508;return db[_0x4492('0x2a')]['findOne']({'where':{'id':_0xec8731[_0x4492('0x41')]['id']}})[_0x4492('0x23')](handleEntityNotFound(_0x3cf74d,null))[_0x4492('0x23')](function(_0x238966){if(_0x238966){_0x1875f6=_0x238966;_0xcba4e5['model']=_[_0x4492('0x42')](db['ZendeskField'][_0x4492('0x2b')]);_0xcba4e5[_0x4492('0x30')]=_[_0x4492('0x42')](_0xec8731['query']);_0xcba4e5[_0x4492('0x31')]=_[_0x4492('0x32')](_0xcba4e5[_0x4492('0x2f')],_0xcba4e5[_0x4492('0x30')]);_0x1c93a7['attributes']=_['intersection'](_0xcba4e5[_0x4492('0x2f')],qs['fields'](_0xec8731[_0x4492('0x30')][_0x4492('0x34')]));_0x1c93a7['attributes']=_0x1c93a7[_0x4492('0x33')][_0x4492('0x43')]?_0x1c93a7[_0x4492('0x33')]:_0xcba4e5['model'];_0x1c93a7[_0x4492('0x37')]=qs[_0x4492('0x38')](_0xec8731['query'][_0x4492('0x38')]);_0x1c93a7[_0x4492('0x39')]=qs['filters'](_[_0x4492('0x4b')](_0xec8731[_0x4492('0x30')],_0xcba4e5['filters']));if(_0xec8731[_0x4492('0x30')]['filter']){_0x1c93a7[_0x4492('0x39')]=_[_0x4492('0x3a')](_0x1c93a7[_0x4492('0x39')],{'$or':_['map'](_0x1c93a7[_0x4492('0x33')],function(_0xca182d){var _0xacb85e={};_0xacb85e[_0xca182d]={'$like':'%'+_0xec8731['query']['filter']+'%'};return _0xacb85e;})});}_0x1c93a7=_['merge']({},_0x1c93a7,_0xec8731['options']);return _0x1875f6[_0x4492('0x4c')](_0x1c93a7);}})[_0x4492('0x23')](function(_0x1c4e5a){if(_0x1c4e5a){_0x467508=_0x1c4e5a[_0x4492('0x43')];if(!_0xec8731[_0x4492('0x30')]['hasOwnProperty']('nolimit')){_0x1c93a7[_0x4492('0x1b')]=qs['limit'](_0xec8731[_0x4492('0x30')]['limit']);_0x1c93a7['offset']=qs[_0x4492('0x19')](_0xec8731[_0x4492('0x30')]['offset']);}return _0x1875f6['getSubjects'](_0x1c93a7);}})[_0x4492('0x23')](function(_0x2abdb8){if(_0x2abdb8){return _0x2abdb8?{'count':_0x467508,'rows':_0x2abdb8}:null;}})[_0x4492('0x23')](respondWithResult(_0x3cf74d,null))['catch'](handleError(_0x3cf74d,null));};exports['getDescriptions']=function(_0x422fd6,_0x44f701,_0x138533){var _0x1c95e6={};var _0x1ff4cc={};var _0x156684;var _0x424a85;return db[_0x4492('0x2a')][_0x4492('0x49')]({'where':{'id':_0x422fd6[_0x4492('0x41')]['id']}})[_0x4492('0x23')](handleEntityNotFound(_0x44f701,null))[_0x4492('0x23')](function(_0x5ba25e){if(_0x5ba25e){_0x156684=_0x5ba25e;_0x1ff4cc[_0x4492('0x2f')]=_[_0x4492('0x42')](db[_0x4492('0x4a')][_0x4492('0x2b')]);_0x1ff4cc[_0x4492('0x30')]=_['keys'](_0x422fd6[_0x4492('0x30')]);_0x1ff4cc[_0x4492('0x31')]=_[_0x4492('0x32')](_0x1ff4cc['model'],_0x1ff4cc[_0x4492('0x30')]);_0x1c95e6[_0x4492('0x33')]=_['intersection'](_0x1ff4cc[_0x4492('0x2f')],qs[_0x4492('0x34')](_0x422fd6[_0x4492('0x30')][_0x4492('0x34')]));_0x1c95e6[_0x4492('0x33')]=_0x1c95e6[_0x4492('0x33')][_0x4492('0x43')]?_0x1c95e6[_0x4492('0x33')]:_0x1ff4cc['model'];_0x1c95e6[_0x4492('0x37')]=qs[_0x4492('0x38')](_0x422fd6['query']['sort']);_0x1c95e6[_0x4492('0x39')]=qs[_0x4492('0x31')](_[_0x4492('0x4b')](_0x422fd6['query'],_0x1ff4cc['filters']));if(_0x422fd6[_0x4492('0x30')][_0x4492('0x4d')]){_0x1c95e6[_0x4492('0x39')]=_[_0x4492('0x3a')](_0x1c95e6[_0x4492('0x39')],{'$or':_['map'](_0x1c95e6[_0x4492('0x33')],function(_0x4e0adf){var _0x274d8c={};_0x274d8c[_0x4e0adf]={'$like':'%'+_0x422fd6[_0x4492('0x30')]['filter']+'%'};return _0x274d8c;})});}_0x1c95e6=_[_0x4492('0x3a')]({},_0x1c95e6,_0x422fd6[_0x4492('0x3b')]);return _0x156684[_0x4492('0x4e')](_0x1c95e6);}})[_0x4492('0x23')](function(_0x364aa6){if(_0x364aa6){_0x424a85=_0x364aa6[_0x4492('0x43')];if(!_0x422fd6['query'][_0x4492('0x35')](_0x4492('0x36'))){_0x1c95e6[_0x4492('0x1b')]=qs[_0x4492('0x1b')](_0x422fd6[_0x4492('0x30')]['limit']);_0x1c95e6[_0x4492('0x19')]=qs[_0x4492('0x19')](_0x422fd6[_0x4492('0x30')]['offset']);}return _0x156684[_0x4492('0x4e')](_0x1c95e6);}})[_0x4492('0x23')](function(_0x2a7a0e){if(_0x2a7a0e){return _0x2a7a0e?{'count':_0x424a85,'rows':_0x2a7a0e}:null;}})[_0x4492('0x23')](respondWithResult(_0x44f701,null))[_0x4492('0x3f')](handleError(_0x44f701,null));};exports[_0x4492('0x4f')]=function(_0x1829bc,_0x5dd30d,_0x5bc95e){var _0x22d23b={};var _0x1d541a={};var _0xdf1758;var _0x45883e;return db['ZendeskConfiguration'][_0x4492('0x49')]({'where':{'id':_0x1829bc['params']['id']}})[_0x4492('0x23')](handleEntityNotFound(_0x5dd30d,null))[_0x4492('0x23')](function(_0x1e2bfa){if(_0x1e2bfa){_0xdf1758=_0x1e2bfa;_0x1d541a['model']=_[_0x4492('0x42')](db[_0x4492('0x50')]['rawAttributes']);_0x1d541a[_0x4492('0x30')]=_[_0x4492('0x42')](_0x1829bc[_0x4492('0x30')]);_0x1d541a[_0x4492('0x31')]=_[_0x4492('0x32')](_0x1d541a[_0x4492('0x2f')],_0x1d541a[_0x4492('0x30')]);_0x22d23b[_0x4492('0x33')]=_['intersection'](_0x1d541a[_0x4492('0x2f')],qs[_0x4492('0x34')](_0x1829bc[_0x4492('0x30')][_0x4492('0x34')]));_0x22d23b[_0x4492('0x33')]=_0x22d23b[_0x4492('0x33')]['length']?_0x22d23b[_0x4492('0x33')]:_0x1d541a[_0x4492('0x2f')];_0x22d23b[_0x4492('0x37')]=qs[_0x4492('0x38')](_0x1829bc['query']['sort']);_0x22d23b['where']=qs[_0x4492('0x31')](_[_0x4492('0x4b')](_0x1829bc[_0x4492('0x30')],_0x1d541a[_0x4492('0x31')]));if(_0x1829bc[_0x4492('0x30')][_0x4492('0x4d')]){_0x22d23b[_0x4492('0x39')]=_[_0x4492('0x3a')](_0x22d23b[_0x4492('0x39')],{'$or':_['map'](_0x22d23b[_0x4492('0x33')],function(_0x28eeaf){var _0x1ff3f0={};_0x1ff3f0[_0x28eeaf]={'$like':'%'+_0x1829bc[_0x4492('0x30')][_0x4492('0x4d')]+'%'};return _0x1ff3f0;})});}_0x22d23b=_[_0x4492('0x3a')]({},_0x22d23b,_0x1829bc[_0x4492('0x3b')]);return _0xdf1758[_0x4492('0x4f')](_0x22d23b);}})['then'](function(_0x59a869){if(_0x59a869){_0x45883e=_0x59a869[_0x4492('0x43')];if(!_0x1829bc[_0x4492('0x30')][_0x4492('0x35')](_0x4492('0x36'))){_0x22d23b[_0x4492('0x1b')]=qs[_0x4492('0x1b')](_0x1829bc[_0x4492('0x30')][_0x4492('0x1b')]);_0x22d23b[_0x4492('0x19')]=qs[_0x4492('0x19')](_0x1829bc['query'][_0x4492('0x19')]);}return _0xdf1758[_0x4492('0x4f')](_0x22d23b);}})['then'](function(_0x2f2742){if(_0x2f2742){return _0x2f2742?{'count':_0x45883e,'rows':_0x2f2742}:null;}})[_0x4492('0x23')](respondWithResult(_0x5dd30d,null))[_0x4492('0x3f')](handleError(_0x5dd30d,null));};exports[_0x4492('0x51')]=function(_0x165342,_0x4400ca,_0x2e744a){if(_0x165342[_0x4492('0x47')]['id']){delete _0x165342[_0x4492('0x47')]['id'];}return db[_0x4492('0x2a')][_0x4492('0x49')]({'where':{'id':_0x165342['params']['id']}})['then'](handleEntityNotFound(_0x4400ca,null))[_0x4492('0x23')](function(_0x1ab530){if(_0x1ab530){return _0x1ab530[_0x4492('0x51')](_0x165342[_0x4492('0x47')][_0x4492('0x52')]||[]);}return null;})['then'](respondWithResult(_0x4400ca,null))[_0x4492('0x3f')](handleError(_0x4400ca,null));}; \ No newline at end of file +var _0x50fb=['type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','length','includeAll','options','find','create','body','params','ZendeskField','getFields','nolimit','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName'];(function(_0x4f766a,_0x89cf4f){var _0x35dd21=function(_0x59d95b){while(--_0x59d95b){_0x4f766a['push'](_0x4f766a['shift']());}};_0x35dd21(++_0x89cf4f);}(_0x50fb,0x78));var _0xb50f=function(_0x3d9ad5,_0x2f2153){_0x3d9ad5=_0x3d9ad5-0x0;var _0x3577b7=_0x50fb[_0x3d9ad5];return _0x3577b7;};'use strict';var emlformat=require(_0xb50f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb50f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb50f('0x2'));var moment=require(_0xb50f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb50f('0x4'));var util=require(_0xb50f('0x5'));var path=require(_0xb50f('0x6'));var sox=require('sox');var csv=require(_0xb50f('0x7'));var ejs=require(_0xb50f('0x8'));var fs=require('fs');var fs_extra=require(_0xb50f('0x9'));var _=require(_0xb50f('0xa'));var squel=require(_0xb50f('0xb'));var crypto=require('crypto');var jsforce=require(_0xb50f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb50f('0x7'));var querystring=require(_0xb50f('0xd'));var Papa=require(_0xb50f('0xe'));var Redis=require(_0xb50f('0xf'));var authService=require(_0xb50f('0x10'));var qs=require(_0xb50f('0x11'));var as=require(_0xb50f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb50f('0x13'))(_0xb50f('0x14'));var utils=require('../../config/utils');var config=require(_0xb50f('0x15'));var licenseUtil=require(_0xb50f('0x16'));var db=require(_0xb50f('0x17'))['db'];function respondWithStatusCode(_0x1e6c15,_0x8629c4){_0x8629c4=_0x8629c4||0xcc;return function(_0x4913c0){if(_0x4913c0){return _0x1e6c15['sendStatus'](_0x8629c4);}return _0x1e6c15[_0xb50f('0x18')](_0x8629c4)[_0xb50f('0x19')]();};}function respondWithResult(_0x4e9381,_0x3210a5){_0x3210a5=_0x3210a5||0xc8;return function(_0x1139f9){if(_0x1139f9){return _0x4e9381[_0xb50f('0x18')](_0x3210a5)[_0xb50f('0x1a')](_0x1139f9);}};}function respondWithFilteredResult(_0x4667d4,_0x4423df){return function(_0x3f7756){if(_0x3f7756){var _0x48398a=typeof _0x4423df[_0xb50f('0x1b')]===_0xb50f('0x1c')&&typeof _0x4423df['limit']===_0xb50f('0x1c');var _0x25c42b=_0x3f7756['count'];var _0x47ca41=_0x48398a?0x0:_0x4423df[_0xb50f('0x1b')];var _0x3d2292=_0x48398a?_0x3f7756[_0xb50f('0x1d')]:_0x4423df[_0xb50f('0x1b')]+_0x4423df[_0xb50f('0x1e')];var _0x423c89;if(_0x3d2292>=_0x25c42b){_0x3d2292=_0x25c42b;_0x423c89=0xc8;}else{_0x423c89=0xce;}_0x4667d4[_0xb50f('0x18')](_0x423c89);return _0x4667d4['set']('Content-Range',_0x47ca41+'-'+_0x3d2292+'/'+_0x25c42b)['json'](_0x3f7756);}return null;};}function patchUpdates(_0x1fc26b){return function(_0x57e131){try{jsonpatch[_0xb50f('0x1f')](_0x57e131,_0x1fc26b,!![]);}catch(_0x2017c9){return BPromise['reject'](_0x2017c9);}return _0x57e131[_0xb50f('0x20')]();};}function saveUpdates(_0x40feb7,_0x4d413e){return function(_0xdff06f){if(_0xdff06f){return _0xdff06f[_0xb50f('0x21')](_0x40feb7)[_0xb50f('0x22')](function(_0x2a6070){return _0x2a6070;});}return null;};}function removeEntity(_0x4f00dc,_0x592c36){return function(_0x59a452){if(_0x59a452){return _0x59a452[_0xb50f('0x23')]()[_0xb50f('0x22')](function(){_0x4f00dc[_0xb50f('0x18')](0xcc)[_0xb50f('0x19')]();});}};}function handleEntityNotFound(_0x1a3fcd,_0xe1bd3f){return function(_0x5024b1){if(!_0x5024b1){_0x1a3fcd[_0xb50f('0x24')](0x194);}return _0x5024b1;};}function handleError(_0x18be53,_0x280ece){_0x280ece=_0x280ece||0x1f4;return function(_0x1a89cd){logger[_0xb50f('0x25')](_0x1a89cd[_0xb50f('0x26')]);if(_0x1a89cd[_0xb50f('0x27')]){delete _0x1a89cd[_0xb50f('0x27')];}_0x18be53['status'](_0x280ece)[_0xb50f('0x28')](_0x1a89cd);};}exports[_0xb50f('0x29')]=function(_0x268345,_0x1485ac){var _0x44995d={},_0x29c902={},_0x2ea350={'count':0x0,'rows':[]};var _0xda3230=_[_0xb50f('0x2a')](db[_0xb50f('0x2b')][_0xb50f('0x2c')],function(_0x1082ae){return{'name':_0x1082ae[_0xb50f('0x2d')],'type':_0x1082ae[_0xb50f('0x2e')][_0xb50f('0x2f')]};});_0x29c902[_0xb50f('0x30')]=_[_0xb50f('0x2a')](_0xda3230,_0xb50f('0x27'));_0x29c902[_0xb50f('0x31')]=_[_0xb50f('0x32')](_0x268345[_0xb50f('0x31')]);_0x29c902['filters']=_[_0xb50f('0x33')](_0x29c902['model'],_0x29c902[_0xb50f('0x31')]);_0x44995d[_0xb50f('0x34')]=_[_0xb50f('0x33')](_0x29c902['model'],qs[_0xb50f('0x35')](_0x268345['query'][_0xb50f('0x35')]));_0x44995d[_0xb50f('0x34')]=_0x44995d[_0xb50f('0x34')]['length']?_0x44995d[_0xb50f('0x34')]:_0x29c902['model'];if(!_0x268345[_0xb50f('0x31')][_0xb50f('0x36')]('nolimit')){_0x44995d[_0xb50f('0x1e')]=qs['limit'](_0x268345[_0xb50f('0x31')][_0xb50f('0x1e')]);_0x44995d[_0xb50f('0x1b')]=qs['offset'](_0x268345[_0xb50f('0x31')][_0xb50f('0x1b')]);}_0x44995d[_0xb50f('0x37')]=qs['sort'](_0x268345[_0xb50f('0x31')][_0xb50f('0x38')]);_0x44995d[_0xb50f('0x39')]=qs[_0xb50f('0x3a')](_[_0xb50f('0x3b')](_0x268345[_0xb50f('0x31')],_0x29c902[_0xb50f('0x3a')]),_0xda3230);if(_0x268345[_0xb50f('0x31')][_0xb50f('0x3c')]){_0x44995d[_0xb50f('0x39')]=_['merge'](_0x44995d[_0xb50f('0x39')],{'$or':_[_0xb50f('0x2a')](_0xda3230,function(_0x29f5f5){if(_0x29f5f5[_0xb50f('0x2e')]!==_0xb50f('0x3d')){var _0x37bf5f={};_0x37bf5f[_0x29f5f5['name']]={'$like':'%'+_0x268345[_0xb50f('0x31')][_0xb50f('0x3c')]+'%'};return _0x37bf5f;}})});}_0x44995d=_[_0xb50f('0x3e')]({},_0x44995d,_0x268345['options']);var _0xd16f02={'where':_0x44995d[_0xb50f('0x39')]};return db[_0xb50f('0x2b')][_0xb50f('0x1d')](_0xd16f02)[_0xb50f('0x22')](function(_0x168daf){_0x2ea350[_0xb50f('0x1d')]=_0x168daf;if(_0x268345[_0xb50f('0x31')]['includeAll']){_0x44995d[_0xb50f('0x3f')]=[{'all':!![]}];}return db[_0xb50f('0x2b')][_0xb50f('0x40')](_0x44995d);})[_0xb50f('0x22')](function(_0x35835c){_0x2ea350[_0xb50f('0x41')]=_0x35835c;return _0x2ea350;})[_0xb50f('0x22')](respondWithFilteredResult(_0x1485ac,_0x44995d))[_0xb50f('0x42')](handleError(_0x1485ac,null));};exports['show']=function(_0x45671a,_0x38ed22){var _0x4ece87={'raw':![],'where':{'id':_0x45671a['params']['id']}},_0x3ae4ba={};_0x3ae4ba['model']=_[_0xb50f('0x32')](db[_0xb50f('0x2b')][_0xb50f('0x2c')]);_0x3ae4ba['query']=_[_0xb50f('0x32')](_0x45671a[_0xb50f('0x31')]);_0x3ae4ba[_0xb50f('0x3a')]=_[_0xb50f('0x33')](_0x3ae4ba[_0xb50f('0x30')],_0x3ae4ba[_0xb50f('0x31')]);_0x4ece87[_0xb50f('0x34')]=_['intersection'](_0x3ae4ba[_0xb50f('0x30')],qs[_0xb50f('0x35')](_0x45671a[_0xb50f('0x31')][_0xb50f('0x35')]));_0x4ece87[_0xb50f('0x34')]=_0x4ece87[_0xb50f('0x34')][_0xb50f('0x43')]?_0x4ece87[_0xb50f('0x34')]:_0x3ae4ba['model'];if(_0x45671a[_0xb50f('0x31')][_0xb50f('0x44')]){_0x4ece87['include']=[{'all':!![]}];}_0x4ece87=_[_0xb50f('0x3e')]({},_0x4ece87,_0x45671a[_0xb50f('0x45')]);return db[_0xb50f('0x2b')][_0xb50f('0x46')](_0x4ece87)[_0xb50f('0x22')](handleEntityNotFound(_0x38ed22,null))[_0xb50f('0x22')](respondWithResult(_0x38ed22,null))[_0xb50f('0x42')](handleError(_0x38ed22,null));};exports[_0xb50f('0x47')]=function(_0x407f60,_0x19ecff){return db[_0xb50f('0x2b')]['create'](_0x407f60['body'],{})[_0xb50f('0x22')](respondWithResult(_0x19ecff,0xc9))[_0xb50f('0x42')](handleError(_0x19ecff,null));};exports[_0xb50f('0x21')]=function(_0x1e8c9a,_0x4e6e73){if(_0x1e8c9a[_0xb50f('0x48')]['id']){delete _0x1e8c9a[_0xb50f('0x48')]['id'];}return db[_0xb50f('0x2b')][_0xb50f('0x46')]({'where':{'id':_0x1e8c9a[_0xb50f('0x49')]['id']}})[_0xb50f('0x22')](handleEntityNotFound(_0x4e6e73,null))['then'](saveUpdates(_0x1e8c9a[_0xb50f('0x48')],null))[_0xb50f('0x22')](respondWithResult(_0x4e6e73,null))[_0xb50f('0x42')](handleError(_0x4e6e73,null));};exports[_0xb50f('0x23')]=function(_0x34126b,_0x33d355){return db[_0xb50f('0x2b')][_0xb50f('0x46')]({'where':{'id':_0x34126b[_0xb50f('0x49')]['id']}})[_0xb50f('0x22')](handleEntityNotFound(_0x33d355,null))['then'](removeEntity(_0x33d355,null))[_0xb50f('0x42')](handleError(_0x33d355,null));};exports['getFields']=function(_0x58c01b,_0x2f12e9,_0x9956b6){var _0x3b9ae4={};var _0x5e0222={};var _0x2dc621;var _0x4685b7;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x58c01b[_0xb50f('0x49')]['id']}})[_0xb50f('0x22')](handleEntityNotFound(_0x2f12e9,null))[_0xb50f('0x22')](function(_0x3a05cd){if(_0x3a05cd){_0x2dc621=_0x3a05cd;_0x5e0222['model']=_['keys'](db[_0xb50f('0x4a')][_0xb50f('0x2c')]);_0x5e0222['query']=_[_0xb50f('0x32')](_0x58c01b[_0xb50f('0x31')]);_0x5e0222[_0xb50f('0x3a')]=_[_0xb50f('0x33')](_0x5e0222[_0xb50f('0x30')],_0x5e0222[_0xb50f('0x31')]);_0x3b9ae4[_0xb50f('0x34')]=_[_0xb50f('0x33')](_0x5e0222[_0xb50f('0x30')],qs[_0xb50f('0x35')](_0x58c01b['query'][_0xb50f('0x35')]));_0x3b9ae4[_0xb50f('0x34')]=_0x3b9ae4[_0xb50f('0x34')][_0xb50f('0x43')]?_0x3b9ae4[_0xb50f('0x34')]:_0x5e0222[_0xb50f('0x30')];_0x3b9ae4[_0xb50f('0x37')]=qs[_0xb50f('0x38')](_0x58c01b[_0xb50f('0x31')][_0xb50f('0x38')]);_0x3b9ae4[_0xb50f('0x39')]=qs[_0xb50f('0x3a')](_[_0xb50f('0x3b')](_0x58c01b[_0xb50f('0x31')],_0x5e0222['filters']));if(_0x58c01b[_0xb50f('0x31')][_0xb50f('0x3c')]){_0x3b9ae4[_0xb50f('0x39')]=_[_0xb50f('0x3e')](_0x3b9ae4[_0xb50f('0x39')],{'$or':_[_0xb50f('0x2a')](_0x3b9ae4[_0xb50f('0x34')],function(_0x112786){var _0x40e8d1={};_0x40e8d1[_0x112786]={'$like':'%'+_0x58c01b[_0xb50f('0x31')][_0xb50f('0x3c')]+'%'};return _0x40e8d1;})});}_0x3b9ae4=_['merge']({},_0x3b9ae4,_0x58c01b[_0xb50f('0x45')]);return _0x2dc621[_0xb50f('0x4b')](_0x3b9ae4);}})['then'](function(_0x28ba06){if(_0x28ba06){_0x4685b7=_0x28ba06['length'];if(!_0x58c01b['query'][_0xb50f('0x36')](_0xb50f('0x4c'))){_0x3b9ae4[_0xb50f('0x1e')]=qs[_0xb50f('0x1e')](_0x58c01b[_0xb50f('0x31')][_0xb50f('0x1e')]);_0x3b9ae4['offset']=qs['offset'](_0x58c01b[_0xb50f('0x31')][_0xb50f('0x1b')]);}return _0x2dc621[_0xb50f('0x4b')](_0x3b9ae4);}})[_0xb50f('0x22')](function(_0x352ff4){if(_0x352ff4){return _0x352ff4?{'count':_0x4685b7,'rows':_0x352ff4}:null;}})[_0xb50f('0x22')](respondWithResult(_0x2f12e9,null))[_0xb50f('0x42')](handleError(_0x2f12e9,null));};exports[_0xb50f('0x4d')]=function(_0x33d8de,_0x4f8988,_0x3d982b){var _0x42c547={};var _0x359011={};var _0x1c1043;var _0x5667ca;return db[_0xb50f('0x2b')][_0xb50f('0x4e')]({'where':{'id':_0x33d8de[_0xb50f('0x49')]['id']}})[_0xb50f('0x22')](handleEntityNotFound(_0x4f8988,null))[_0xb50f('0x22')](function(_0x4da5b9){if(_0x4da5b9){_0x1c1043=_0x4da5b9;_0x359011[_0xb50f('0x30')]=_[_0xb50f('0x32')](db[_0xb50f('0x4a')][_0xb50f('0x2c')]);_0x359011[_0xb50f('0x31')]=_[_0xb50f('0x32')](_0x33d8de[_0xb50f('0x31')]);_0x359011[_0xb50f('0x3a')]=_[_0xb50f('0x33')](_0x359011['model'],_0x359011[_0xb50f('0x31')]);_0x42c547['attributes']=_[_0xb50f('0x33')](_0x359011[_0xb50f('0x30')],qs[_0xb50f('0x35')](_0x33d8de[_0xb50f('0x31')][_0xb50f('0x35')]));_0x42c547[_0xb50f('0x34')]=_0x42c547[_0xb50f('0x34')][_0xb50f('0x43')]?_0x42c547[_0xb50f('0x34')]:_0x359011[_0xb50f('0x30')];_0x42c547['order']=qs[_0xb50f('0x38')](_0x33d8de[_0xb50f('0x31')][_0xb50f('0x38')]);_0x42c547[_0xb50f('0x39')]=qs[_0xb50f('0x3a')](_[_0xb50f('0x3b')](_0x33d8de[_0xb50f('0x31')],_0x359011[_0xb50f('0x3a')]));if(_0x33d8de[_0xb50f('0x31')][_0xb50f('0x3c')]){_0x42c547['where']=_[_0xb50f('0x3e')](_0x42c547[_0xb50f('0x39')],{'$or':_['map'](_0x42c547[_0xb50f('0x34')],function(_0x4a7f3a){var _0x2aec63={};_0x2aec63[_0x4a7f3a]={'$like':'%'+_0x33d8de['query'][_0xb50f('0x3c')]+'%'};return _0x2aec63;})});}_0x42c547=_[_0xb50f('0x3e')]({},_0x42c547,_0x33d8de[_0xb50f('0x45')]);return _0x1c1043[_0xb50f('0x4d')](_0x42c547);}})[_0xb50f('0x22')](function(_0x17d122){if(_0x17d122){_0x5667ca=_0x17d122['length'];if(!_0x33d8de['query'][_0xb50f('0x36')]('nolimit')){_0x42c547[_0xb50f('0x1e')]=qs[_0xb50f('0x1e')](_0x33d8de[_0xb50f('0x31')][_0xb50f('0x1e')]);_0x42c547[_0xb50f('0x1b')]=qs[_0xb50f('0x1b')](_0x33d8de[_0xb50f('0x31')][_0xb50f('0x1b')]);}return _0x1c1043[_0xb50f('0x4d')](_0x42c547);}})['then'](function(_0x4c8645){if(_0x4c8645){return _0x4c8645?{'count':_0x5667ca,'rows':_0x4c8645}:null;}})['then'](respondWithResult(_0x4f8988,null))[_0xb50f('0x42')](handleError(_0x4f8988,null));};exports['getDescriptions']=function(_0x2baeab,_0x17e704,_0x11f03c){var _0x5b6ed8={};var _0x3a8e86={};var _0x1af481;var _0x4c2bd1;return db['ZendeskConfiguration'][_0xb50f('0x4e')]({'where':{'id':_0x2baeab[_0xb50f('0x49')]['id']}})[_0xb50f('0x22')](handleEntityNotFound(_0x17e704,null))[_0xb50f('0x22')](function(_0x45e780){if(_0x45e780){_0x1af481=_0x45e780;_0x3a8e86['model']=_['keys'](db['ZendeskField']['rawAttributes']);_0x3a8e86['query']=_[_0xb50f('0x32')](_0x2baeab[_0xb50f('0x31')]);_0x3a8e86[_0xb50f('0x3a')]=_[_0xb50f('0x33')](_0x3a8e86[_0xb50f('0x30')],_0x3a8e86[_0xb50f('0x31')]);_0x5b6ed8[_0xb50f('0x34')]=_[_0xb50f('0x33')](_0x3a8e86[_0xb50f('0x30')],qs['fields'](_0x2baeab[_0xb50f('0x31')]['fields']));_0x5b6ed8['attributes']=_0x5b6ed8[_0xb50f('0x34')][_0xb50f('0x43')]?_0x5b6ed8[_0xb50f('0x34')]:_0x3a8e86['model'];_0x5b6ed8[_0xb50f('0x37')]=qs[_0xb50f('0x38')](_0x2baeab[_0xb50f('0x31')]['sort']);_0x5b6ed8['where']=qs[_0xb50f('0x3a')](_['pick'](_0x2baeab[_0xb50f('0x31')],_0x3a8e86[_0xb50f('0x3a')]));if(_0x2baeab[_0xb50f('0x31')]['filter']){_0x5b6ed8['where']=_[_0xb50f('0x3e')](_0x5b6ed8[_0xb50f('0x39')],{'$or':_[_0xb50f('0x2a')](_0x5b6ed8[_0xb50f('0x34')],function(_0x2958c0){var _0x4c2277={};_0x4c2277[_0x2958c0]={'$like':'%'+_0x2baeab[_0xb50f('0x31')]['filter']+'%'};return _0x4c2277;})});}_0x5b6ed8=_[_0xb50f('0x3e')]({},_0x5b6ed8,_0x2baeab['options']);return _0x1af481[_0xb50f('0x4f')](_0x5b6ed8);}})[_0xb50f('0x22')](function(_0x46908a){if(_0x46908a){_0x4c2bd1=_0x46908a['length'];if(!_0x2baeab[_0xb50f('0x31')][_0xb50f('0x36')]('nolimit')){_0x5b6ed8[_0xb50f('0x1e')]=qs[_0xb50f('0x1e')](_0x2baeab[_0xb50f('0x31')][_0xb50f('0x1e')]);_0x5b6ed8[_0xb50f('0x1b')]=qs[_0xb50f('0x1b')](_0x2baeab[_0xb50f('0x31')][_0xb50f('0x1b')]);}return _0x1af481[_0xb50f('0x4f')](_0x5b6ed8);}})[_0xb50f('0x22')](function(_0x25f34){if(_0x25f34){return _0x25f34?{'count':_0x4c2bd1,'rows':_0x25f34}:null;}})[_0xb50f('0x22')](respondWithResult(_0x17e704,null))[_0xb50f('0x42')](handleError(_0x17e704,null));};exports[_0xb50f('0x50')]=function(_0x1b6db5,_0x33195a,_0x29883b){var _0x1c894e={};var _0x57fc58={};var _0x5cdbe2;var _0x252ccc;return db[_0xb50f('0x2b')][_0xb50f('0x4e')]({'where':{'id':_0x1b6db5[_0xb50f('0x49')]['id']}})[_0xb50f('0x22')](handleEntityNotFound(_0x33195a,null))[_0xb50f('0x22')](function(_0x52541c){if(_0x52541c){_0x5cdbe2=_0x52541c;_0x57fc58[_0xb50f('0x30')]=_[_0xb50f('0x32')](db[_0xb50f('0x51')]['rawAttributes']);_0x57fc58[_0xb50f('0x31')]=_[_0xb50f('0x32')](_0x1b6db5['query']);_0x57fc58[_0xb50f('0x3a')]=_[_0xb50f('0x33')](_0x57fc58[_0xb50f('0x30')],_0x57fc58[_0xb50f('0x31')]);_0x1c894e[_0xb50f('0x34')]=_['intersection'](_0x57fc58[_0xb50f('0x30')],qs['fields'](_0x1b6db5[_0xb50f('0x31')]['fields']));_0x1c894e['attributes']=_0x1c894e[_0xb50f('0x34')][_0xb50f('0x43')]?_0x1c894e['attributes']:_0x57fc58[_0xb50f('0x30')];_0x1c894e[_0xb50f('0x37')]=qs[_0xb50f('0x38')](_0x1b6db5[_0xb50f('0x31')]['sort']);_0x1c894e[_0xb50f('0x39')]=qs[_0xb50f('0x3a')](_[_0xb50f('0x3b')](_0x1b6db5[_0xb50f('0x31')],_0x57fc58[_0xb50f('0x3a')]));if(_0x1b6db5[_0xb50f('0x31')][_0xb50f('0x3c')]){_0x1c894e[_0xb50f('0x39')]=_[_0xb50f('0x3e')](_0x1c894e[_0xb50f('0x39')],{'$or':_[_0xb50f('0x2a')](_0x1c894e[_0xb50f('0x34')],function(_0x102667){var _0x1c4117={};_0x1c4117[_0x102667]={'$like':'%'+_0x1b6db5['query'][_0xb50f('0x3c')]+'%'};return _0x1c4117;})});}_0x1c894e=_['merge']({},_0x1c894e,_0x1b6db5[_0xb50f('0x45')]);return _0x5cdbe2[_0xb50f('0x50')](_0x1c894e);}})[_0xb50f('0x22')](function(_0x407966){if(_0x407966){_0x252ccc=_0x407966[_0xb50f('0x43')];if(!_0x1b6db5[_0xb50f('0x31')][_0xb50f('0x36')](_0xb50f('0x4c'))){_0x1c894e[_0xb50f('0x1e')]=qs['limit'](_0x1b6db5['query'][_0xb50f('0x1e')]);_0x1c894e[_0xb50f('0x1b')]=qs[_0xb50f('0x1b')](_0x1b6db5[_0xb50f('0x31')][_0xb50f('0x1b')]);}return _0x5cdbe2[_0xb50f('0x50')](_0x1c894e);}})[_0xb50f('0x22')](function(_0xc12114){if(_0xc12114){return _0xc12114?{'count':_0x252ccc,'rows':_0xc12114}:null;}})[_0xb50f('0x22')](respondWithResult(_0x33195a,null))[_0xb50f('0x42')](handleError(_0x33195a,null));};exports[_0xb50f('0x52')]=function(_0x593cc0,_0x19203e,_0x2e8b5a){if(_0x593cc0['body']['id']){delete _0x593cc0[_0xb50f('0x48')]['id'];}return db['ZendeskConfiguration'][_0xb50f('0x4e')]({'where':{'id':_0x593cc0[_0xb50f('0x49')]['id']}})['then'](handleEntityNotFound(_0x19203e,null))['then'](function(_0x22bc43){if(_0x22bc43){return _0x22bc43[_0xb50f('0x52')](_0x593cc0[_0xb50f('0x48')]['ids']||[]);}return null;})[_0xb50f('0x22')](respondWithResult(_0x19203e,null))[_0xb50f('0x42')](handleError(_0x19203e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 801e1ed..66bb644 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 _0x1399=['ZendeskConfiguration','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define'];(function(_0x150d6b,_0x59af9d){var _0x5d170c=function(_0x2178ad){while(--_0x2178ad){_0x150d6b['push'](_0x150d6b['shift']());}};_0x5d170c(++_0x59af9d);}(_0x1399,0x16c));var _0x9139=function(_0x2b439e,_0x21ce5e){_0x2b439e=_0x2b439e-0x0;var _0x189dd0=_0x1399[_0x2b439e];return _0x189dd0;};'use strict';var _=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var logger=require('../../config/logger')(_0x9139('0x2'));var moment=require('moment');var BPromise=require(_0x9139('0x3'));var rp=require(_0x9139('0x4'));var fs=require('fs');var path=require(_0x9139('0x5'));var rimraf=require(_0x9139('0x6'));var config=require(_0x9139('0x7'));var attributes=require(_0x9139('0x8'));module['exports']=function(_0x54af2d,_0x8f086b){return _0x54af2d[_0x9139('0x9')](_0x9139('0xa'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc900=['api','moment','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations','../../config/logger'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xc900,0xb3));var _0x0c90=function(_0xa2c20e,_0x3c50cd){_0xa2c20e=_0xa2c20e-0x0;var _0x4d484b=_0xc900[_0xa2c20e];return _0x4d484b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c90('0x0'))(_0x0c90('0x1'));var moment=require(_0x0c90('0x2'));var BPromise=require('bluebird');var rp=require(_0x0c90('0x3'));var fs=require('fs');var path=require(_0x0c90('0x4'));var rimraf=require('rimraf');var config=require(_0x0c90('0x5'));var attributes=require(_0x0c90('0x6'));module[_0x0c90('0x7')]=function(_0x718a5c,_0x42f9a3){return _0x718a5c[_0x0c90('0x8')]('ZendeskConfiguration',attributes,{'tableName':_0x0c90('0x9'),'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 9a2ea8b..183a6bf 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 _0xf875=['util','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x5dba1a,_0xb9f9d6){var _0x3a70f7=function(_0x2c9321){while(--_0x2c9321){_0x5dba1a['push'](_0x5dba1a['shift']());}};_0x3a70f7(++_0xb9f9d6);}(_0xf875,0x1a1));var _0x5f87=function(_0x5c049a,_0x2c1263){_0x5c049a=_0x5c049a-0x0;var _0x168e70=_0xf875[_0x5c049a];return _0x168e70;};'use strict';var _=require(_0x5f87('0x0'));var util=require(_0x5f87('0x1'));var moment=require('moment');var BPromise=require(_0x5f87('0x2'));var rs=require(_0x5f87('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f87('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f87('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5f87('0x6'));var client=jayson[_0x5f87('0x7')][_0x5f87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cd623,_0x4f44d1,_0x154929){return new BPromise(function(_0x12f07d,_0x5ed310){return client[_0x5f87('0x9')](_0x5cd623,_0x154929)[_0x5f87('0xa')](function(_0x315416){logger[_0x5f87('0xb')](_0x5f87('0xc'),_0x4f44d1,_0x5f87('0xd'));logger[_0x5f87('0xe')](_0x5f87('0xf'),_0x4f44d1,_0x5f87('0xd'),JSON[_0x5f87('0x10')](_0x315416));if(_0x315416[_0x5f87('0x11')]){if(_0x315416[_0x5f87('0x11')][_0x5f87('0x12')]===0x1f4){logger[_0x5f87('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4f44d1,_0x315416[_0x5f87('0x11')][_0x5f87('0x13')]);return _0x5ed310(_0x315416[_0x5f87('0x11')][_0x5f87('0x13')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x4f44d1,_0x315416[_0x5f87('0x11')][_0x5f87('0x13')]);return _0x12f07d(_0x315416['error'][_0x5f87('0x13')]);}else{logger[_0x5f87('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4f44d1,_0x5f87('0xd'));_0x12f07d(_0x315416[_0x5f87('0x14')]['message']);}})[_0x5f87('0x15')](function(_0x57eb95){logger[_0x5f87('0x11')](_0x5f87('0xc'),_0x4f44d1,_0x57eb95);_0x5ed310(_0x57eb95);});});} \ No newline at end of file +var _0xaa7c=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0xcd2491,_0x8e975e){var _0x423f06=function(_0x4b2bf0){while(--_0x4b2bf0){_0xcd2491['push'](_0xcd2491['shift']());}};_0x423f06(++_0x8e975e);}(_0xaa7c,0x129));var _0xcaa7=function(_0x249c9b,_0xed0853){_0x249c9b=_0x249c9b-0x0;var _0x373b39=_0xaa7c[_0x249c9b];return _0x373b39;};'use strict';var _=require(_0xcaa7('0x0'));var util=require(_0xcaa7('0x1'));var moment=require(_0xcaa7('0x2'));var BPromise=require('bluebird');var rs=require(_0xcaa7('0x3'));var fs=require('fs');var Redis=require(_0xcaa7('0x4'));var db=require(_0xcaa7('0x5'))['db'];var utils=require(_0xcaa7('0x6'));var logger=require(_0xcaa7('0x7'))(_0xcaa7('0x8'));var config=require(_0xcaa7('0x9'));var jayson=require(_0xcaa7('0xa'));var client=jayson['client'][_0xcaa7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e36a0,_0x3f7e18,_0x496c5f){return new BPromise(function(_0x72df93,_0x14e2de){return client[_0xcaa7('0xc')](_0x4e36a0,_0x496c5f)[_0xcaa7('0xd')](function(_0x78e602){logger['info'](_0xcaa7('0xe'),_0x3f7e18,_0xcaa7('0xf'));logger[_0xcaa7('0x10')](_0xcaa7('0x11'),_0x3f7e18,'request\x20sent',JSON[_0xcaa7('0x12')](_0x78e602));if(_0x78e602[_0xcaa7('0x13')]){if(_0x78e602[_0xcaa7('0x13')]['code']===0x1f4){logger[_0xcaa7('0x13')](_0xcaa7('0xe'),_0x3f7e18,_0x78e602[_0xcaa7('0x13')]['message']);return _0x14e2de(_0x78e602['error'][_0xcaa7('0x14')]);}logger[_0xcaa7('0x13')](_0xcaa7('0xe'),_0x3f7e18,_0x78e602['error']['message']);return _0x72df93(_0x78e602[_0xcaa7('0x13')][_0xcaa7('0x14')]);}else{logger[_0xcaa7('0x15')](_0xcaa7('0xe'),_0x3f7e18,_0xcaa7('0xf'));_0x72df93(_0x78e602[_0xcaa7('0x16')][_0xcaa7('0x14')]);}})[_0xcaa7('0x17')](function(_0x1ee976){logger['error'](_0xcaa7('0xe'),_0x3f7e18,_0x1ee976);_0x14e2de(_0x1ee976);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 29c9e93..da3f0ef 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 _0x77dd=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x18a7c6,_0x4bf5ed){var _0x316139=function(_0x481b75){while(--_0x481b75){_0x18a7c6['push'](_0x18a7c6['shift']());}};_0x316139(++_0x4bf5ed);}(_0x77dd,0x181));var _0xd77d=function(_0xce9195,_0x1963e1){_0xce9195=_0xce9195-0x0;var _0x530fe6=_0x77dd[_0xce9195];return _0x530fe6;};'use strict';var multer=require('multer');var util=require(_0xd77d('0x0'));var path=require(_0xd77d('0x1'));var timeout=require(_0xd77d('0x2'));var express=require(_0xd77d('0x3'));var router=express[_0xd77d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd77d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd77d('0x6'));var controller=require(_0xd77d('0x7'));router[_0xd77d('0x8')]('/',auth[_0xd77d('0x9')](),controller[_0xd77d('0xa')]);router[_0xd77d('0x8')](_0xd77d('0xb'),auth[_0xd77d('0x9')](),controller[_0xd77d('0xc')]);router[_0xd77d('0xd')]('/',auth[_0xd77d('0x9')](),controller[_0xd77d('0xe')]);router[_0xd77d('0xf')](_0xd77d('0xb'),auth[_0xd77d('0x9')](),controller[_0xd77d('0x10')]);router[_0xd77d('0x11')](_0xd77d('0xb'),auth[_0xd77d('0x9')](),controller[_0xd77d('0x12')]);module[_0xd77d('0x13')]=router; \ No newline at end of file +var _0xa9f0=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x3be577,_0x33c662){var _0x10bbd8=function(_0x42141f){while(--_0x42141f){_0x3be577['push'](_0x3be577['shift']());}};_0x10bbd8(++_0x33c662);}(_0xa9f0,0x158));var _0x0a9f=function(_0x46abd5,_0x37d9a9){_0x46abd5=_0x46abd5-0x0;var _0xa700d8=_0xa9f0[_0x46abd5];return _0xa700d8;};'use strict';var multer=require('multer');var util=require(_0x0a9f('0x0'));var path=require(_0x0a9f('0x1'));var timeout=require(_0x0a9f('0x2'));var express=require(_0x0a9f('0x3'));var router=express[_0x0a9f('0x4')]();var fs_extra=require(_0x0a9f('0x5'));var auth=require(_0x0a9f('0x6'));var interaction=require(_0x0a9f('0x7'));var config=require(_0x0a9f('0x8'));var controller=require(_0x0a9f('0x9'));router[_0x0a9f('0xa')]('/',auth[_0x0a9f('0xb')](),controller[_0x0a9f('0xc')]);router[_0x0a9f('0xa')](_0x0a9f('0xd'),auth[_0x0a9f('0xb')](),controller[_0x0a9f('0xe')]);router[_0x0a9f('0xf')]('/',auth['isAuthenticated'](),controller[_0x0a9f('0x10')]);router['put'](_0x0a9f('0xd'),auth[_0x0a9f('0xb')](),controller['update']);router[_0x0a9f('0x11')](_0x0a9f('0xd'),auth[_0x0a9f('0xb')](),controller[_0x0a9f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 07b7789..46d3684 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 _0x2987=['sequelize','exports','ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x2987,0x80));var _0x7298=function(_0x40f30e,_0x4729dc){_0x40f30e=_0x40f30e-0x0;var _0x2ea85a=_0x2987[_0x40f30e];return _0x2ea85a;};'use strict';var Sequelize=require(_0x7298('0x0'));module[_0x7298('0x1')]={'type':{'type':Sequelize[_0x7298('0x2')](_0x7298('0x3'),_0x7298('0x4'),'customVariable',_0x7298('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7298('0x6')]},'keyType':{'type':Sequelize[_0x7298('0x2')](_0x7298('0x3'),_0x7298('0x4'),_0x7298('0x7'))},'keyContent':{'type':Sequelize[_0x7298('0x6')]},'idField':{'type':Sequelize[_0x7298('0x6')]},'nameField':{'type':Sequelize[_0x7298('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7298('0x6')]}}; \ No newline at end of file +var _0x1af6=['picklist','STRING','variable','BOOLEAN','exports','ENUM','string','customVariable','keyValue'];(function(_0x534c33,_0x120ebc){var _0x22b732=function(_0x2ecd80){while(--_0x2ecd80){_0x534c33['push'](_0x534c33['shift']());}};_0x22b732(++_0x120ebc);}(_0x1af6,0x1f3));var _0x61af=function(_0x1bd6a3,_0x205fa4){_0x1bd6a3=_0x1bd6a3-0x0;var _0x373be8=_0x1af6[_0x1bd6a3];return _0x373be8;};'use strict';var Sequelize=require('sequelize');module[_0x61af('0x0')]={'type':{'type':Sequelize[_0x61af('0x1')](_0x61af('0x2'),'variable',_0x61af('0x3'),_0x61af('0x4'),_0x61af('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x61af('0x6')]},'key':{'type':Sequelize[_0x61af('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x61af('0x2'),_0x61af('0x7'),_0x61af('0x3'))},'keyContent':{'type':Sequelize[_0x61af('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x61af('0x6')]},'customField':{'type':Sequelize[_0x61af('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x61af('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 56cd112..d0b28e8 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 _0x2d6a=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','set','json','apply','reject','save','update','then','destroy','end','error','send','map','ZendeskField','rawAttributes','fieldName','model','name','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0xc10ce0,_0x36666f){var _0x156c0b=function(_0x567edb){while(--_0x567edb){_0xc10ce0['push'](_0xc10ce0['shift']());}};_0x156c0b(++_0x36666f);}(_0x2d6a,0x16a));var _0xa2d6=function(_0x5916c7,_0x2edfba){_0x5916c7=_0x5916c7-0x0;var _0x4178bd=_0x2d6a[_0x5916c7];return _0x4178bd;};'use strict';var emlformat=require(_0xa2d6('0x0'));var rimraf=require(_0xa2d6('0x1'));var zipdir=require(_0xa2d6('0x2'));var jsonpatch=require(_0xa2d6('0x3'));var rp=require(_0xa2d6('0x4'));var moment=require('moment');var BPromise=require(_0xa2d6('0x5'));var Mustache=require(_0xa2d6('0x6'));var util=require(_0xa2d6('0x7'));var path=require(_0xa2d6('0x8'));var sox=require(_0xa2d6('0x9'));var csv=require(_0xa2d6('0xa'));var ejs=require(_0xa2d6('0xb'));var fs=require('fs');var fs_extra=require(_0xa2d6('0xc'));var _=require(_0xa2d6('0xd'));var squel=require(_0xa2d6('0xe'));var crypto=require(_0xa2d6('0xf'));var jsforce=require(_0xa2d6('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa2d6('0xa'));var querystring=require(_0xa2d6('0x11'));var Papa=require(_0xa2d6('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa2d6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa2d6('0x14'));var logger=require(_0xa2d6('0x15'))('api');var utils=require(_0xa2d6('0x16'));var config=require(_0xa2d6('0x17'));var licenseUtil=require(_0xa2d6('0x18'));var db=require(_0xa2d6('0x19'))['db'];function respondWithStatusCode(_0x2a94b6,_0x37b83b){_0x37b83b=_0x37b83b||0xcc;return function(_0x3640c8){if(_0x3640c8){return _0x2a94b6[_0xa2d6('0x1a')](_0x37b83b);}return _0x2a94b6[_0xa2d6('0x1b')](_0x37b83b)['end']();};}function respondWithResult(_0x3c982d,_0x3a0ec3){_0x3a0ec3=_0x3a0ec3||0xc8;return function(_0x884312){if(_0x884312){return _0x3c982d[_0xa2d6('0x1b')](_0x3a0ec3)['json'](_0x884312);}};}function respondWithFilteredResult(_0x167a84,_0x584a38){return function(_0xec434d){if(_0xec434d){var _0x5d83ac=typeof _0x584a38[_0xa2d6('0x1c')]===_0xa2d6('0x1d')&&typeof _0x584a38[_0xa2d6('0x1e')]===_0xa2d6('0x1d');var _0xd7ba6c=_0xec434d['count'];var _0x450a54=_0x5d83ac?0x0:_0x584a38[_0xa2d6('0x1c')];var _0x14107a=_0x5d83ac?_0xec434d['count']:_0x584a38[_0xa2d6('0x1c')]+_0x584a38[_0xa2d6('0x1e')];var _0x14769c;if(_0x14107a>=_0xd7ba6c){_0x14107a=_0xd7ba6c;_0x14769c=0xc8;}else{_0x14769c=0xce;}_0x167a84[_0xa2d6('0x1b')](_0x14769c);return _0x167a84[_0xa2d6('0x1f')]('Content-Range',_0x450a54+'-'+_0x14107a+'/'+_0xd7ba6c)[_0xa2d6('0x20')](_0xec434d);}return null;};}function patchUpdates(_0x359479){return function(_0x2ec19d){try{jsonpatch[_0xa2d6('0x21')](_0x2ec19d,_0x359479,!![]);}catch(_0x34d5ab){return BPromise[_0xa2d6('0x22')](_0x34d5ab);}return _0x2ec19d[_0xa2d6('0x23')]();};}function saveUpdates(_0x48389b,_0x55d3e7){return function(_0x4fec42){if(_0x4fec42){return _0x4fec42[_0xa2d6('0x24')](_0x48389b)[_0xa2d6('0x25')](function(_0x3b4f31){return _0x3b4f31;});}return null;};}function removeEntity(_0x3cf5a7,_0x36e922){return function(_0x1f76cc){if(_0x1f76cc){return _0x1f76cc[_0xa2d6('0x26')]()[_0xa2d6('0x25')](function(){_0x3cf5a7[_0xa2d6('0x1b')](0xcc)[_0xa2d6('0x27')]();});}};}function handleEntityNotFound(_0x3e94b6,_0xc69316){return function(_0x489640){if(!_0x489640){_0x3e94b6[_0xa2d6('0x1a')](0x194);}return _0x489640;};}function handleError(_0x342d2c,_0x440188){_0x440188=_0x440188||0x1f4;return function(_0x5acdb0){logger[_0xa2d6('0x28')](_0x5acdb0['stack']);if(_0x5acdb0['name']){delete _0x5acdb0['name'];}_0x342d2c[_0xa2d6('0x1b')](_0x440188)[_0xa2d6('0x29')](_0x5acdb0);};}exports['index']=function(_0xd6d3d9,_0x414c01){var _0x39e447={},_0x20d5f2={},_0x39c0e6={'count':0x0,'rows':[]};var _0x2ed13d=_[_0xa2d6('0x2a')](db[_0xa2d6('0x2b')][_0xa2d6('0x2c')],function(_0x5377a7){return{'name':_0x5377a7[_0xa2d6('0x2d')],'type':_0x5377a7['type']['key']};});_0x20d5f2[_0xa2d6('0x2e')]=_['map'](_0x2ed13d,_0xa2d6('0x2f'));_0x20d5f2[_0xa2d6('0x30')]=_[_0xa2d6('0x31')](_0xd6d3d9[_0xa2d6('0x30')]);_0x20d5f2['filters']=_[_0xa2d6('0x32')](_0x20d5f2['model'],_0x20d5f2['query']);_0x39e447[_0xa2d6('0x33')]=_[_0xa2d6('0x32')](_0x20d5f2[_0xa2d6('0x2e')],qs[_0xa2d6('0x34')](_0xd6d3d9[_0xa2d6('0x30')][_0xa2d6('0x34')]));_0x39e447[_0xa2d6('0x33')]=_0x39e447[_0xa2d6('0x33')]['length']?_0x39e447[_0xa2d6('0x33')]:_0x20d5f2[_0xa2d6('0x2e')];if(!_0xd6d3d9[_0xa2d6('0x30')]['hasOwnProperty'](_0xa2d6('0x35'))){_0x39e447[_0xa2d6('0x1e')]=qs['limit'](_0xd6d3d9[_0xa2d6('0x30')][_0xa2d6('0x1e')]);_0x39e447[_0xa2d6('0x1c')]=qs['offset'](_0xd6d3d9['query'][_0xa2d6('0x1c')]);}_0x39e447[_0xa2d6('0x36')]=qs[_0xa2d6('0x37')](_0xd6d3d9[_0xa2d6('0x30')][_0xa2d6('0x37')]);_0x39e447[_0xa2d6('0x38')]=qs[_0xa2d6('0x39')](_[_0xa2d6('0x3a')](_0xd6d3d9[_0xa2d6('0x30')],_0x20d5f2['filters']),_0x2ed13d);if(_0xd6d3d9['query'][_0xa2d6('0x3b')]){_0x39e447[_0xa2d6('0x38')]=_['merge'](_0x39e447[_0xa2d6('0x38')],{'$or':_[_0xa2d6('0x2a')](_0x2ed13d,function(_0x2ba6a2){if(_0x2ba6a2[_0xa2d6('0x3c')]!==_0xa2d6('0x3d')){var _0x554a26={};_0x554a26[_0x2ba6a2['name']]={'$like':'%'+_0xd6d3d9[_0xa2d6('0x30')][_0xa2d6('0x3b')]+'%'};return _0x554a26;}})});}_0x39e447=_[_0xa2d6('0x3e')]({},_0x39e447,_0xd6d3d9[_0xa2d6('0x3f')]);var _0x13bff6={'where':_0x39e447[_0xa2d6('0x38')]};return db[_0xa2d6('0x2b')][_0xa2d6('0x40')](_0x13bff6)[_0xa2d6('0x25')](function(_0x77907d){_0x39c0e6[_0xa2d6('0x40')]=_0x77907d;if(_0xd6d3d9[_0xa2d6('0x30')][_0xa2d6('0x41')]){_0x39e447[_0xa2d6('0x42')]=[{'all':!![]}];}return db[_0xa2d6('0x2b')][_0xa2d6('0x43')](_0x39e447);})[_0xa2d6('0x25')](function(_0x5503e1){_0x39c0e6['rows']=_0x5503e1;return _0x39c0e6;})[_0xa2d6('0x25')](respondWithFilteredResult(_0x414c01,_0x39e447))[_0xa2d6('0x44')](handleError(_0x414c01,null));};exports[_0xa2d6('0x45')]=function(_0x3b2b85,_0x84541){var _0x364965={'raw':!![],'where':{'id':_0x3b2b85[_0xa2d6('0x46')]['id']}},_0x2d1b66={};_0x2d1b66[_0xa2d6('0x2e')]=_[_0xa2d6('0x31')](db[_0xa2d6('0x2b')]['rawAttributes']);_0x2d1b66[_0xa2d6('0x30')]=_[_0xa2d6('0x31')](_0x3b2b85[_0xa2d6('0x30')]);_0x2d1b66[_0xa2d6('0x39')]=_['intersection'](_0x2d1b66[_0xa2d6('0x2e')],_0x2d1b66[_0xa2d6('0x30')]);_0x364965[_0xa2d6('0x33')]=_['intersection'](_0x2d1b66['model'],qs[_0xa2d6('0x34')](_0x3b2b85[_0xa2d6('0x30')]['fields']));_0x364965[_0xa2d6('0x33')]=_0x364965[_0xa2d6('0x33')]['length']?_0x364965[_0xa2d6('0x33')]:_0x2d1b66['model'];if(_0x3b2b85[_0xa2d6('0x30')][_0xa2d6('0x41')]){_0x364965[_0xa2d6('0x42')]=[{'all':!![]}];}_0x364965=_[_0xa2d6('0x3e')]({},_0x364965,_0x3b2b85[_0xa2d6('0x3f')]);return db[_0xa2d6('0x2b')][_0xa2d6('0x47')](_0x364965)[_0xa2d6('0x25')](handleEntityNotFound(_0x84541,null))['then'](respondWithResult(_0x84541,null))[_0xa2d6('0x44')](handleError(_0x84541,null));};exports['create']=function(_0x38175a,_0x2bc29e){return db['ZendeskField'][_0xa2d6('0x48')](_0x38175a[_0xa2d6('0x49')],{})[_0xa2d6('0x25')](respondWithResult(_0x2bc29e,0xc9))[_0xa2d6('0x44')](handleError(_0x2bc29e,null));};exports['update']=function(_0x4dbd9a,_0x488b91){if(_0x4dbd9a[_0xa2d6('0x49')]['id']){delete _0x4dbd9a[_0xa2d6('0x49')]['id'];}return db[_0xa2d6('0x2b')][_0xa2d6('0x47')]({'where':{'id':_0x4dbd9a[_0xa2d6('0x46')]['id']}})[_0xa2d6('0x25')](handleEntityNotFound(_0x488b91,null))[_0xa2d6('0x25')](saveUpdates(_0x4dbd9a[_0xa2d6('0x49')],null))[_0xa2d6('0x25')](respondWithResult(_0x488b91,null))[_0xa2d6('0x44')](handleError(_0x488b91,null));};exports['destroy']=function(_0x5fc23b,_0x1375b9){return db[_0xa2d6('0x2b')][_0xa2d6('0x47')]({'where':{'id':_0x5fc23b[_0xa2d6('0x46')]['id']}})[_0xa2d6('0x25')](handleEntityNotFound(_0x1375b9,null))[_0xa2d6('0x25')](removeEntity(_0x1375b9,null))['catch'](handleError(_0x1375b9,null));}; \ No newline at end of file +var _0xad7c=['to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','ZendeskField','findAll','rows','catch','show','params','keys','length','include','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xad7c,0x8c));var _0xcad7=function(_0x42951f,_0x3bfc37){_0x42951f=_0x42951f-0x0;var _0xa793a0=_0xad7c[_0x42951f];return _0xa793a0;};'use strict';var emlformat=require(_0xcad7('0x0'));var rimraf=require(_0xcad7('0x1'));var zipdir=require(_0xcad7('0x2'));var jsonpatch=require(_0xcad7('0x3'));var rp=require(_0xcad7('0x4'));var moment=require('moment');var BPromise=require(_0xcad7('0x5'));var Mustache=require(_0xcad7('0x6'));var util=require(_0xcad7('0x7'));var path=require(_0xcad7('0x8'));var sox=require(_0xcad7('0x9'));var csv=require(_0xcad7('0xa'));var ejs=require(_0xcad7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcad7('0xc'));var squel=require(_0xcad7('0xd'));var crypto=require('crypto');var jsforce=require(_0xcad7('0xe'));var deskjs=require(_0xcad7('0xf'));var toCsv=require(_0xcad7('0xa'));var querystring=require(_0xcad7('0x10'));var Papa=require(_0xcad7('0x11'));var Redis=require(_0xcad7('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcad7('0x13'));var as=require(_0xcad7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcad7('0x15'))(_0xcad7('0x16'));var utils=require(_0xcad7('0x17'));var config=require(_0xcad7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xcad7('0x19'))['db'];function respondWithStatusCode(_0x140455,_0x23fbd1){_0x23fbd1=_0x23fbd1||0xcc;return function(_0x1bdcd9){if(_0x1bdcd9){return _0x140455['sendStatus'](_0x23fbd1);}return _0x140455[_0xcad7('0x1a')](_0x23fbd1)[_0xcad7('0x1b')]();};}function respondWithResult(_0x1d20dd,_0x12a8f5){_0x12a8f5=_0x12a8f5||0xc8;return function(_0x159f6f){if(_0x159f6f){return _0x1d20dd[_0xcad7('0x1a')](_0x12a8f5)[_0xcad7('0x1c')](_0x159f6f);}};}function respondWithFilteredResult(_0x302698,_0x258483){return function(_0x4b1af4){if(_0x4b1af4){var _0x22d201=typeof _0x258483[_0xcad7('0x1d')]===_0xcad7('0x1e')&&typeof _0x258483[_0xcad7('0x1f')]===_0xcad7('0x1e');var _0x42c5a9=_0x4b1af4[_0xcad7('0x20')];var _0x3d9789=_0x22d201?0x0:_0x258483[_0xcad7('0x1d')];var _0x3c2196=_0x22d201?_0x4b1af4[_0xcad7('0x20')]:_0x258483[_0xcad7('0x1d')]+_0x258483[_0xcad7('0x1f')];var _0xf6f633;if(_0x3c2196>=_0x42c5a9){_0x3c2196=_0x42c5a9;_0xf6f633=0xc8;}else{_0xf6f633=0xce;}_0x302698[_0xcad7('0x1a')](_0xf6f633);return _0x302698[_0xcad7('0x21')](_0xcad7('0x22'),_0x3d9789+'-'+_0x3c2196+'/'+_0x42c5a9)[_0xcad7('0x1c')](_0x4b1af4);}return null;};}function patchUpdates(_0xcb03c4){return function(_0x5c1765){try{jsonpatch[_0xcad7('0x23')](_0x5c1765,_0xcb03c4,!![]);}catch(_0x311065){return BPromise[_0xcad7('0x24')](_0x311065);}return _0x5c1765['save']();};}function saveUpdates(_0x2a7b8a,_0x443a67){return function(_0x5f3edd){if(_0x5f3edd){return _0x5f3edd['update'](_0x2a7b8a)[_0xcad7('0x25')](function(_0x406acc){return _0x406acc;});}return null;};}function removeEntity(_0x36b9b1,_0x4b055f){return function(_0x4e6b69){if(_0x4e6b69){return _0x4e6b69[_0xcad7('0x26')]()[_0xcad7('0x25')](function(){_0x36b9b1[_0xcad7('0x1a')](0xcc)[_0xcad7('0x1b')]();});}};}function handleEntityNotFound(_0x160f7a,_0x402df9){return function(_0x1f7e71){if(!_0x1f7e71){_0x160f7a[_0xcad7('0x27')](0x194);}return _0x1f7e71;};}function handleError(_0x388407,_0x2f8a78){_0x2f8a78=_0x2f8a78||0x1f4;return function(_0x52fb54){logger[_0xcad7('0x28')](_0x52fb54[_0xcad7('0x29')]);if(_0x52fb54[_0xcad7('0x2a')]){delete _0x52fb54['name'];}_0x388407[_0xcad7('0x1a')](_0x2f8a78)['send'](_0x52fb54);};}exports[_0xcad7('0x2b')]=function(_0x567e7a,_0x39f763){var _0x274041={},_0x47db8a={},_0x6433cc={'count':0x0,'rows':[]};var _0x2301ee=_[_0xcad7('0x2c')](db['ZendeskField'][_0xcad7('0x2d')],function(_0x17857b){return{'name':_0x17857b[_0xcad7('0x2e')],'type':_0x17857b[_0xcad7('0x2f')][_0xcad7('0x30')]};});_0x47db8a[_0xcad7('0x31')]=_['map'](_0x2301ee,_0xcad7('0x2a'));_0x47db8a[_0xcad7('0x32')]=_['keys'](_0x567e7a[_0xcad7('0x32')]);_0x47db8a[_0xcad7('0x33')]=_[_0xcad7('0x34')](_0x47db8a[_0xcad7('0x31')],_0x47db8a[_0xcad7('0x32')]);_0x274041[_0xcad7('0x35')]=_[_0xcad7('0x34')](_0x47db8a['model'],qs[_0xcad7('0x36')](_0x567e7a[_0xcad7('0x32')]['fields']));_0x274041[_0xcad7('0x35')]=_0x274041[_0xcad7('0x35')]['length']?_0x274041[_0xcad7('0x35')]:_0x47db8a[_0xcad7('0x31')];if(!_0x567e7a[_0xcad7('0x32')][_0xcad7('0x37')](_0xcad7('0x38'))){_0x274041[_0xcad7('0x1f')]=qs[_0xcad7('0x1f')](_0x567e7a[_0xcad7('0x32')]['limit']);_0x274041[_0xcad7('0x1d')]=qs[_0xcad7('0x1d')](_0x567e7a[_0xcad7('0x32')][_0xcad7('0x1d')]);}_0x274041[_0xcad7('0x39')]=qs[_0xcad7('0x3a')](_0x567e7a[_0xcad7('0x32')][_0xcad7('0x3a')]);_0x274041[_0xcad7('0x3b')]=qs['filters'](_[_0xcad7('0x3c')](_0x567e7a[_0xcad7('0x32')],_0x47db8a[_0xcad7('0x33')]),_0x2301ee);if(_0x567e7a[_0xcad7('0x32')]['filter']){_0x274041[_0xcad7('0x3b')]=_[_0xcad7('0x3d')](_0x274041[_0xcad7('0x3b')],{'$or':_[_0xcad7('0x2c')](_0x2301ee,function(_0x665fc9){if(_0x665fc9['type']!=='VIRTUAL'){var _0x5c7d11={};_0x5c7d11[_0x665fc9[_0xcad7('0x2a')]]={'$like':'%'+_0x567e7a['query']['filter']+'%'};return _0x5c7d11;}})});}_0x274041=_[_0xcad7('0x3d')]({},_0x274041,_0x567e7a[_0xcad7('0x3e')]);var _0x2e55cb={'where':_0x274041[_0xcad7('0x3b')]};return db[_0xcad7('0x3f')][_0xcad7('0x20')](_0x2e55cb)['then'](function(_0x87c2f){_0x6433cc[_0xcad7('0x20')]=_0x87c2f;if(_0x567e7a[_0xcad7('0x32')]['includeAll']){_0x274041['include']=[{'all':!![]}];}return db[_0xcad7('0x3f')][_0xcad7('0x40')](_0x274041);})[_0xcad7('0x25')](function(_0x5d97c7){_0x6433cc[_0xcad7('0x41')]=_0x5d97c7;return _0x6433cc;})[_0xcad7('0x25')](respondWithFilteredResult(_0x39f763,_0x274041))[_0xcad7('0x42')](handleError(_0x39f763,null));};exports[_0xcad7('0x43')]=function(_0x29b16b,_0x44ba1a){var _0xcd055a={'raw':!![],'where':{'id':_0x29b16b[_0xcad7('0x44')]['id']}},_0x21b305={};_0x21b305[_0xcad7('0x31')]=_[_0xcad7('0x45')](db[_0xcad7('0x3f')][_0xcad7('0x2d')]);_0x21b305['query']=_['keys'](_0x29b16b[_0xcad7('0x32')]);_0x21b305[_0xcad7('0x33')]=_[_0xcad7('0x34')](_0x21b305[_0xcad7('0x31')],_0x21b305['query']);_0xcd055a[_0xcad7('0x35')]=_[_0xcad7('0x34')](_0x21b305[_0xcad7('0x31')],qs[_0xcad7('0x36')](_0x29b16b[_0xcad7('0x32')][_0xcad7('0x36')]));_0xcd055a[_0xcad7('0x35')]=_0xcd055a[_0xcad7('0x35')][_0xcad7('0x46')]?_0xcd055a[_0xcad7('0x35')]:_0x21b305['model'];if(_0x29b16b[_0xcad7('0x32')]['includeAll']){_0xcd055a[_0xcad7('0x47')]=[{'all':!![]}];}_0xcd055a=_[_0xcad7('0x3d')]({},_0xcd055a,_0x29b16b['options']);return db[_0xcad7('0x3f')]['find'](_0xcd055a)[_0xcad7('0x25')](handleEntityNotFound(_0x44ba1a,null))[_0xcad7('0x25')](respondWithResult(_0x44ba1a,null))[_0xcad7('0x42')](handleError(_0x44ba1a,null));};exports['create']=function(_0x44021e,_0x4e1c34){return db[_0xcad7('0x3f')][_0xcad7('0x48')](_0x44021e['body'],{})[_0xcad7('0x25')](respondWithResult(_0x4e1c34,0xc9))[_0xcad7('0x42')](handleError(_0x4e1c34,null));};exports[_0xcad7('0x49')]=function(_0x4b8293,_0x33c291){if(_0x4b8293['body']['id']){delete _0x4b8293[_0xcad7('0x4a')]['id'];}return db[_0xcad7('0x3f')]['find']({'where':{'id':_0x4b8293[_0xcad7('0x44')]['id']}})[_0xcad7('0x25')](handleEntityNotFound(_0x33c291,null))[_0xcad7('0x25')](saveUpdates(_0x4b8293[_0xcad7('0x4a')],null))['then'](respondWithResult(_0x33c291,null))[_0xcad7('0x42')](handleError(_0x33c291,null));};exports[_0xcad7('0x26')]=function(_0x533274,_0x332aa9){return db[_0xcad7('0x3f')]['find']({'where':{'id':_0x533274[_0xcad7('0x44')]['id']}})[_0xcad7('0x25')](handleEntityNotFound(_0x332aa9,null))[_0xcad7('0x25')](removeEntity(_0x332aa9,null))[_0xcad7('0x42')](handleError(_0x332aa9,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index a2482f4..a2ae523 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 _0x115f=['int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','exports'];(function(_0x3356bf,_0x3166bd){var _0x20cb92=function(_0x55f1e9){while(--_0x55f1e9){_0x3356bf['push'](_0x3356bf['shift']());}};_0x20cb92(++_0x3166bd);}(_0x115f,0x148));var _0xf115=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x115f[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xf115('0x0'));var util=require(_0xf115('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf115('0x2'));var rp=require(_0xf115('0x3'));var fs=require('fs');var path=require(_0xf115('0x4'));var rimraf=require(_0xf115('0x5'));var config=require('../../config/environment');var attributes=require(_0xf115('0x6'));module[_0xf115('0x7')]=function(_0x2bb89d,_0x3dd2f4){return _0x2bb89d['define']('ZendeskField',attributes,{'tableName':_0xf115('0x8'),'paranoid':![],'indexes':[{'name':_0xf115('0x9'),'fields':[_0xf115('0xa'),_0xf115('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfe9f=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash'];(function(_0x3fb506,_0x1ff530){var _0x512e17=function(_0x3792e9){while(--_0x3792e9){_0x3fb506['push'](_0x3fb506['shift']());}};_0x512e17(++_0x1ff530);}(_0xfe9f,0xb5));var _0xffe9=function(_0x33c315,_0x1fb576){_0x33c315=_0x33c315-0x0;var _0x3bdbc6=_0xfe9f[_0x33c315];return _0x3bdbc6;};'use strict';var _=require(_0xffe9('0x0'));var util=require(_0xffe9('0x1'));var logger=require(_0xffe9('0x2'))(_0xffe9('0x3'));var moment=require(_0xffe9('0x4'));var BPromise=require('bluebird');var rp=require(_0xffe9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xffe9('0x6'));var config=require(_0xffe9('0x7'));var attributes=require(_0xffe9('0x8'));module[_0xffe9('0x9')]=function(_0x14e15b,_0x58e5d0){return _0x14e15b['define'](_0xffe9('0xa'),attributes,{'tableName':_0xffe9('0xb'),'paranoid':![],'indexes':[{'name':_0xffe9('0xc'),'fields':['idField',_0xffe9('0xd')],'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 e02f49e..360f1fa 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 _0x4250=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x4250,0x18c));var _0x0425=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x4250[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x0425('0x0'));var util=require(_0x0425('0x1'));var moment=require(_0x0425('0x2'));var BPromise=require(_0x0425('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0425('0x4'));var db=require(_0x0425('0x5'))['db'];var utils=require(_0x0425('0x6'));var logger=require(_0x0425('0x7'))(_0x0425('0x8'));var config=require(_0x0425('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0425('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fc027,_0x664b58,_0x341a13){return new BPromise(function(_0x5329af,_0x5016b7){return client[_0x0425('0xb')](_0x3fc027,_0x341a13)[_0x0425('0xc')](function(_0x4c92b4){logger['info'](_0x0425('0xd'),_0x664b58,_0x0425('0xe'));logger[_0x0425('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x664b58,_0x0425('0xe'),JSON[_0x0425('0x10')](_0x4c92b4));if(_0x4c92b4[_0x0425('0x11')]){if(_0x4c92b4['error'][_0x0425('0x12')]===0x1f4){logger['error'](_0x0425('0xd'),_0x664b58,_0x4c92b4['error'][_0x0425('0x13')]);return _0x5016b7(_0x4c92b4[_0x0425('0x11')]['message']);}logger[_0x0425('0x11')]('ZendeskField,\x20%s,\x20%s',_0x664b58,_0x4c92b4[_0x0425('0x11')]['message']);return _0x5329af(_0x4c92b4[_0x0425('0x11')]['message']);}else{logger[_0x0425('0x14')](_0x0425('0xd'),_0x664b58,_0x0425('0xe'));_0x5329af(_0x4c92b4[_0x0425('0x15')][_0x0425('0x13')]);}})['catch'](function(_0x284b64){logger['error'](_0x0425('0xd'),_0x664b58,_0x284b64);_0x5016b7(_0x284b64);});});} \ No newline at end of file +var _0xb215=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb215,0x17d));var _0x5b21=function(_0x3175d1,_0x46b7fc){_0x3175d1=_0x3175d1-0x0;var _0x1ebea4=_0xb215[_0x3175d1];return _0x1ebea4;};'use strict';var _=require('lodash');var util=require(_0x5b21('0x0'));var moment=require(_0x5b21('0x1'));var BPromise=require(_0x5b21('0x2'));var rs=require(_0x5b21('0x3'));var fs=require('fs');var Redis=require(_0x5b21('0x4'));var db=require(_0x5b21('0x5'))['db'];var utils=require(_0x5b21('0x6'));var logger=require('../../config/logger')(_0x5b21('0x7'));var config=require(_0x5b21('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5b21('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d0abc,_0x49d644,_0x48e6d9){return new BPromise(function(_0x2bd5a0,_0x24b64a){return client[_0x5b21('0xa')](_0x4d0abc,_0x48e6d9)['then'](function(_0x5a2942){logger[_0x5b21('0xb')](_0x5b21('0xc'),_0x49d644,_0x5b21('0xd'));logger[_0x5b21('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x49d644,_0x5b21('0xd'),JSON['stringify'](_0x5a2942));if(_0x5a2942['error']){if(_0x5a2942[_0x5b21('0xf')][_0x5b21('0x10')]===0x1f4){logger[_0x5b21('0xf')]('ZendeskField,\x20%s,\x20%s',_0x49d644,_0x5a2942['error'][_0x5b21('0x11')]);return _0x24b64a(_0x5a2942['error'][_0x5b21('0x11')]);}logger[_0x5b21('0xf')]('ZendeskField,\x20%s,\x20%s',_0x49d644,_0x5a2942[_0x5b21('0xf')]['message']);return _0x2bd5a0(_0x5a2942[_0x5b21('0xf')][_0x5b21('0x11')]);}else{logger['info'](_0x5b21('0xc'),_0x49d644,_0x5b21('0xd'));_0x2bd5a0(_0x5a2942[_0x5b21('0x12')]['message']);}})[_0x5b21('0x13')](function(_0x10d9a2){logger['error']('ZendeskField,\x20%s,\x20%s',_0x49d644,_0x10d9a2);_0x24b64a(_0x10d9a2);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 9675930..667a7ed 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 _0x3a92=['exports','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','/:id','getConfigurations','/:id/fields','getFields','create','/:id/configurations','put'];(function(_0x819b1,_0x25ca36){var _0x15aa26=function(_0x51cee8){while(--_0x51cee8){_0x819b1['push'](_0x819b1['shift']());}};_0x15aa26(++_0x25ca36);}(_0x3a92,0x1bb));var _0x23a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a92[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x23a9('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x23a9('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x23a9('0x2'));var interaction=require(_0x23a9('0x3'));var config=require(_0x23a9('0x4'));var controller=require(_0x23a9('0x5'));router['get']('/',auth[_0x23a9('0x6')](),controller[_0x23a9('0x7')]);router[_0x23a9('0x8')](_0x23a9('0x9'),auth[_0x23a9('0x6')](),controller['show']);router[_0x23a9('0x8')]('/:id/configurations',auth[_0x23a9('0x6')](),controller[_0x23a9('0xa')]);router[_0x23a9('0x8')](_0x23a9('0xb'),auth['isAuthenticated'](),controller[_0x23a9('0xc')]);router['post']('/',auth[_0x23a9('0x6')](),controller[_0x23a9('0xd')]);router['post'](_0x23a9('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x23a9('0xf')](_0x23a9('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x23a9('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x23a9('0x10')]=router; \ No newline at end of file +var _0xacf2=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','post','create','addConfiguration','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x58c729,_0x17ea06){var _0x6dda6f=function(_0x105f09){while(--_0x105f09){_0x58c729['push'](_0x58c729['shift']());}};_0x6dda6f(++_0x17ea06);}(_0xacf2,0xac));var _0x2acf=function(_0x43cc3b,_0x2f3963){_0x43cc3b=_0x43cc3b-0x0;var _0x44fe5e=_0xacf2[_0x43cc3b];return _0x44fe5e;};'use strict';var multer=require(_0x2acf('0x0'));var util=require(_0x2acf('0x1'));var path=require(_0x2acf('0x2'));var timeout=require(_0x2acf('0x3'));var express=require(_0x2acf('0x4'));var router=express[_0x2acf('0x5')]();var fs_extra=require(_0x2acf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2acf('0x7'));var config=require(_0x2acf('0x8'));var controller=require(_0x2acf('0x9'));router[_0x2acf('0xa')]('/',auth[_0x2acf('0xb')](),controller[_0x2acf('0xc')]);router[_0x2acf('0xa')](_0x2acf('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x2acf('0xa')](_0x2acf('0xe'),auth[_0x2acf('0xb')](),controller[_0x2acf('0xf')]);router[_0x2acf('0xa')]('/:id/fields',auth[_0x2acf('0xb')](),controller['getFields']);router[_0x2acf('0x10')]('/',auth[_0x2acf('0xb')](),controller[_0x2acf('0x11')]);router[_0x2acf('0x10')](_0x2acf('0xe'),auth[_0x2acf('0xb')](),controller[_0x2acf('0x12')]);router[_0x2acf('0x13')](_0x2acf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x2acf('0x14')](_0x2acf('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x2acf('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index efb9a75..e79931e 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 _0x22fb=['STRING'];(function(_0x5814a1,_0x51839e){var _0x517834=function(_0x93f00){while(--_0x93f00){_0x5814a1['push'](_0x5814a1['shift']());}};_0x517834(++_0x51839e);}(_0x22fb,0x192));var _0xb22f=function(_0x1f211d,_0x2ab006){_0x1f211d=_0x1f211d-0x0;var _0x35e76f=_0x22fb[_0x1f211d];return _0x35e76f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb22f('0x0')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb22f('0x0')]},'zone':{'type':Sequelize[_0xb22f('0x0')]},'clientId':{'type':Sequelize[_0xb22f('0x0')]},'clientSecret':{'type':Sequelize[_0xb22f('0x0')]},'serverUrl':{'type':Sequelize[_0xb22f('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb22f('0x0')]}}; \ No newline at end of file +var _0x6f0d=['exports','STRING'];(function(_0x546e46,_0x213d67){var _0x2108e8=function(_0x28f6ca){while(--_0x28f6ca){_0x546e46['push'](_0x546e46['shift']());}};_0x2108e8(++_0x213d67);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x4812a7,_0x1aa8c8){_0x4812a7=_0x4812a7-0x0;var _0x45224f=_0x6f0d[_0x4812a7];return _0x45224f;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'name':{'type':Sequelize[_0xd6f0('0x1')]},'description':{'type':Sequelize[_0xd6f0('0x1')]},'host':{'type':Sequelize[_0xd6f0('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xd6f0('0x1')]},'clientSecret':{'type':Sequelize[_0xd6f0('0x1')]},'serverUrl':{'type':Sequelize[_0xd6f0('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xd6f0('0x1')]},'refreshToken':{'type':Sequelize[_0xd6f0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 77a39dc..a648ba9 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 _0x1d7d=['lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes','api_name','push','display_label','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','limit','count','set','Content-Range','json','update','then','destroy','error','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','map','query','filters','model','attributes','intersection','fields','nolimit','sort','pick','filter','where','options','includeAll','include','findAll','rows','catch','keys','length','find','create','body','params','getConfigurations','order','merge','hasOwnProperty','addConfiguration','findOne','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','substring'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0x1d7d,0x193));var _0xd1d7=function(_0x475c83,_0xa63dc9){_0x475c83=_0x475c83-0x0;var _0x315bd1=_0x1d7d[_0x475c83];return _0x315bd1;};'use strict';var emlformat=require(_0xd1d7('0x0'));var rimraf=require(_0xd1d7('0x1'));var zipdir=require(_0xd1d7('0x2'));var jsonpatch=require(_0xd1d7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd1d7('0x4'));var Mustache=require(_0xd1d7('0x5'));var util=require(_0xd1d7('0x6'));var path=require(_0xd1d7('0x7'));var sox=require(_0xd1d7('0x8'));var csv=require(_0xd1d7('0x9'));var ejs=require(_0xd1d7('0xa'));var fs=require('fs');var fs_extra=require(_0xd1d7('0xb'));var _=require(_0xd1d7('0xc'));var squel=require(_0xd1d7('0xd'));var crypto=require(_0xd1d7('0xe'));var jsforce=require(_0xd1d7('0xf'));var deskjs=require(_0xd1d7('0x10'));var toCsv=require(_0xd1d7('0x9'));var querystring=require(_0xd1d7('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd1d7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd1d7('0x13'));var hardwareService=require(_0xd1d7('0x14'));var logger=require(_0xd1d7('0x15'))(_0xd1d7('0x16'));var utils=require(_0xd1d7('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3464ec,_0x57671a){_0x57671a=_0x57671a||0xcc;return function(_0x2fbd5d){if(_0x2fbd5d){return _0x3464ec[_0xd1d7('0x18')](_0x57671a);}return _0x3464ec[_0xd1d7('0x19')](_0x57671a)[_0xd1d7('0x1a')]();};}function respondWithResult(_0x147494,_0x4cce2f){_0x4cce2f=_0x4cce2f||0xc8;return function(_0x723ac9){if(_0x723ac9){return _0x147494[_0xd1d7('0x19')](_0x4cce2f)['json'](_0x723ac9);}};}function respondWithFilteredResult(_0x4b8dc5,_0x207719){return function(_0xb44740){if(_0xb44740){var _0x3046fa=typeof _0x207719[_0xd1d7('0x1b')]==='undefined'&&typeof _0x207719[_0xd1d7('0x1c')]==='undefined';var _0x33be7e=_0xb44740[_0xd1d7('0x1d')];var _0x125bf3=_0x3046fa?0x0:_0x207719[_0xd1d7('0x1b')];var _0xa03c6e=_0x3046fa?_0xb44740[_0xd1d7('0x1d')]:_0x207719[_0xd1d7('0x1b')]+_0x207719[_0xd1d7('0x1c')];var _0x1472e6;if(_0xa03c6e>=_0x33be7e){_0xa03c6e=_0x33be7e;_0x1472e6=0xc8;}else{_0x1472e6=0xce;}_0x4b8dc5['status'](_0x1472e6);return _0x4b8dc5[_0xd1d7('0x1e')](_0xd1d7('0x1f'),_0x125bf3+'-'+_0xa03c6e+'/'+_0x33be7e)[_0xd1d7('0x20')](_0xb44740);}return null;};}function patchUpdates(_0x52d2f1){return function(_0x179fae){try{jsonpatch['apply'](_0x179fae,_0x52d2f1,!![]);}catch(_0x406d6){return BPromise['reject'](_0x406d6);}return _0x179fae['save']();};}function saveUpdates(_0x16c65c,_0x44cbdc){return function(_0x21c711){if(_0x21c711){return _0x21c711[_0xd1d7('0x21')](_0x16c65c)[_0xd1d7('0x22')](function(_0x136c7d){return _0x136c7d;});}return null;};}function removeEntity(_0x385881,_0x5d7d11){return function(_0x536591){if(_0x536591){return _0x536591[_0xd1d7('0x23')]()[_0xd1d7('0x22')](function(){_0x385881[_0xd1d7('0x19')](0xcc)[_0xd1d7('0x1a')]();});}};}function handleEntityNotFound(_0x181828,_0x97a7f){return function(_0x24499f){if(!_0x24499f){_0x181828[_0xd1d7('0x18')](0x194);}return _0x24499f;};}function handleError(_0x75c74d,_0x376c32){_0x376c32=_0x376c32||0x1f4;return function(_0x210e02){logger[_0xd1d7('0x24')](_0x210e02[_0xd1d7('0x25')]);if(_0x210e02[_0xd1d7('0x26')]){delete _0x210e02[_0xd1d7('0x26')];}_0x75c74d[_0xd1d7('0x19')](_0x376c32)[_0xd1d7('0x27')](_0x210e02);};}exports[_0xd1d7('0x28')]=function(_0x5975af,_0x4dd52c){var _0xa9bdc1={},_0x5b3d84={},_0x3fc834={'count':0x0,'rows':[]};var _0x367d0a=_['map'](db[_0xd1d7('0x29')][_0xd1d7('0x2a')],function(_0x5692b0){return{'name':_0x5692b0[_0xd1d7('0x2b')],'type':_0x5692b0[_0xd1d7('0x2c')][_0xd1d7('0x2d')]};});_0x5b3d84['model']=_[_0xd1d7('0x2e')](_0x367d0a,_0xd1d7('0x26'));_0x5b3d84[_0xd1d7('0x2f')]=_['keys'](_0x5975af['query']);_0x5b3d84[_0xd1d7('0x30')]=_['intersection'](_0x5b3d84[_0xd1d7('0x31')],_0x5b3d84[_0xd1d7('0x2f')]);_0xa9bdc1[_0xd1d7('0x32')]=_[_0xd1d7('0x33')](_0x5b3d84[_0xd1d7('0x31')],qs[_0xd1d7('0x34')](_0x5975af[_0xd1d7('0x2f')][_0xd1d7('0x34')]));_0xa9bdc1[_0xd1d7('0x32')]=_0xa9bdc1[_0xd1d7('0x32')]['length']?_0xa9bdc1[_0xd1d7('0x32')]:_0x5b3d84[_0xd1d7('0x31')];if(!_0x5975af['query']['hasOwnProperty'](_0xd1d7('0x35'))){_0xa9bdc1[_0xd1d7('0x1c')]=qs['limit'](_0x5975af[_0xd1d7('0x2f')][_0xd1d7('0x1c')]);_0xa9bdc1['offset']=qs[_0xd1d7('0x1b')](_0x5975af[_0xd1d7('0x2f')]['offset']);}_0xa9bdc1['order']=qs[_0xd1d7('0x36')](_0x5975af[_0xd1d7('0x2f')][_0xd1d7('0x36')]);_0xa9bdc1['where']=qs['filters'](_[_0xd1d7('0x37')](_0x5975af[_0xd1d7('0x2f')],_0x5b3d84[_0xd1d7('0x30')]),_0x367d0a);if(_0x5975af[_0xd1d7('0x2f')][_0xd1d7('0x38')]){_0xa9bdc1['where']=_['merge'](_0xa9bdc1[_0xd1d7('0x39')],{'$or':_[_0xd1d7('0x2e')](_0x367d0a,function(_0x439e69){if(_0x439e69[_0xd1d7('0x2c')]!=='VIRTUAL'){var _0x5e73c2={};_0x5e73c2[_0x439e69[_0xd1d7('0x26')]]={'$like':'%'+_0x5975af['query'][_0xd1d7('0x38')]+'%'};return _0x5e73c2;}})});}_0xa9bdc1=_['merge']({},_0xa9bdc1,_0x5975af[_0xd1d7('0x3a')]);var _0x100047={'where':_0xa9bdc1[_0xd1d7('0x39')]};return db[_0xd1d7('0x29')][_0xd1d7('0x1d')](_0x100047)['then'](function(_0x50217d){_0x3fc834[_0xd1d7('0x1d')]=_0x50217d;if(_0x5975af[_0xd1d7('0x2f')][_0xd1d7('0x3b')]){_0xa9bdc1[_0xd1d7('0x3c')]=[{'all':!![]}];}return db[_0xd1d7('0x29')][_0xd1d7('0x3d')](_0xa9bdc1);})[_0xd1d7('0x22')](function(_0x401d52){_0x3fc834[_0xd1d7('0x3e')]=_0x401d52;return _0x3fc834;})[_0xd1d7('0x22')](respondWithFilteredResult(_0x4dd52c,_0xa9bdc1))[_0xd1d7('0x3f')](handleError(_0x4dd52c,null));};exports['show']=function(_0x205129,_0x25675a){var _0x411fd5={'raw':![],'where':{'id':_0x205129['params']['id']}},_0x5b08b2={};_0x5b08b2['model']=_[_0xd1d7('0x40')](db[_0xd1d7('0x29')][_0xd1d7('0x2a')]);_0x5b08b2[_0xd1d7('0x2f')]=_[_0xd1d7('0x40')](_0x205129[_0xd1d7('0x2f')]);_0x5b08b2['filters']=_['intersection'](_0x5b08b2[_0xd1d7('0x31')],_0x5b08b2['query']);_0x411fd5[_0xd1d7('0x32')]=_['intersection'](_0x5b08b2[_0xd1d7('0x31')],qs['fields'](_0x205129[_0xd1d7('0x2f')][_0xd1d7('0x34')]));_0x411fd5['attributes']=_0x411fd5[_0xd1d7('0x32')][_0xd1d7('0x41')]?_0x411fd5[_0xd1d7('0x32')]:_0x5b08b2[_0xd1d7('0x31')];if(_0x205129[_0xd1d7('0x2f')][_0xd1d7('0x3b')]){_0x411fd5['include']=[{'all':!![]}];}_0x411fd5=_['merge']({},_0x411fd5,_0x205129[_0xd1d7('0x3a')]);return db[_0xd1d7('0x29')][_0xd1d7('0x42')](_0x411fd5)[_0xd1d7('0x22')](handleEntityNotFound(_0x25675a,null))[_0xd1d7('0x22')](respondWithResult(_0x25675a,null))['catch'](handleError(_0x25675a,null));};exports[_0xd1d7('0x43')]=function(_0x432a83,_0x258638){return db[_0xd1d7('0x29')][_0xd1d7('0x43')](_0x432a83[_0xd1d7('0x44')],{})['then'](respondWithResult(_0x258638,0xc9))['catch'](handleError(_0x258638,null));};exports[_0xd1d7('0x21')]=function(_0x24558c,_0x328b46){if(_0x24558c[_0xd1d7('0x44')]['id']){delete _0x24558c[_0xd1d7('0x44')]['id'];}return db[_0xd1d7('0x29')][_0xd1d7('0x42')]({'where':{'id':_0x24558c[_0xd1d7('0x45')]['id']}})[_0xd1d7('0x22')](handleEntityNotFound(_0x328b46,null))[_0xd1d7('0x22')](saveUpdates(_0x24558c[_0xd1d7('0x44')],null))[_0xd1d7('0x22')](respondWithResult(_0x328b46,null))[_0xd1d7('0x3f')](handleError(_0x328b46,null));};exports[_0xd1d7('0x23')]=function(_0x5a8fde,_0xd8d339){return db['ZohoAccount'][_0xd1d7('0x42')]({'where':{'id':_0x5a8fde[_0xd1d7('0x45')]['id']}})['then'](handleEntityNotFound(_0xd8d339,null))[_0xd1d7('0x22')](removeEntity(_0xd8d339,null))[_0xd1d7('0x3f')](handleError(_0xd8d339,null));};exports[_0xd1d7('0x46')]=function(_0x4ac7c4,_0x52b206,_0x4a27e8){var _0x4e7908={};var _0x2601be={};var _0x169ec4;var _0x3619f3;return db['ZohoAccount']['findOne']({'where':{'id':_0x4ac7c4['params']['id']}})[_0xd1d7('0x22')](handleEntityNotFound(_0x52b206,null))[_0xd1d7('0x22')](function(_0x33af7b){if(_0x33af7b){_0x169ec4=_0x33af7b;_0x2601be[_0xd1d7('0x31')]=_[_0xd1d7('0x40')](db['ZohoConfiguration'][_0xd1d7('0x2a')]);_0x2601be[_0xd1d7('0x2f')]=_[_0xd1d7('0x40')](_0x4ac7c4['query']);_0x2601be[_0xd1d7('0x30')]=_[_0xd1d7('0x33')](_0x2601be[_0xd1d7('0x31')],_0x2601be[_0xd1d7('0x2f')]);_0x4e7908[_0xd1d7('0x32')]=_[_0xd1d7('0x33')](_0x2601be[_0xd1d7('0x31')],qs[_0xd1d7('0x34')](_0x4ac7c4[_0xd1d7('0x2f')]['fields']));_0x4e7908['attributes']=_0x4e7908[_0xd1d7('0x32')][_0xd1d7('0x41')]?_0x4e7908[_0xd1d7('0x32')]:_0x2601be[_0xd1d7('0x31')];_0x4e7908[_0xd1d7('0x47')]=qs[_0xd1d7('0x36')](_0x4ac7c4[_0xd1d7('0x2f')][_0xd1d7('0x36')]);_0x4e7908[_0xd1d7('0x39')]=qs['filters'](_['pick'](_0x4ac7c4[_0xd1d7('0x2f')],_0x2601be[_0xd1d7('0x30')]));if(_0x4ac7c4[_0xd1d7('0x2f')][_0xd1d7('0x38')]){_0x4e7908['where']=_[_0xd1d7('0x48')](_0x4e7908[_0xd1d7('0x39')],{'$or':_['map'](_0x4e7908[_0xd1d7('0x32')],function(_0x5cc1f7){var _0x6ba78c={};_0x6ba78c[_0x5cc1f7]={'$like':'%'+_0x4ac7c4[_0xd1d7('0x2f')][_0xd1d7('0x38')]+'%'};return _0x6ba78c;})});}_0x4e7908=_[_0xd1d7('0x48')]({},_0x4e7908,_0x4ac7c4[_0xd1d7('0x3a')]);return _0x169ec4[_0xd1d7('0x46')](_0x4e7908);}})[_0xd1d7('0x22')](function(_0x1be3ee){if(_0x1be3ee){_0x3619f3=_0x1be3ee[_0xd1d7('0x41')];if(!_0x4ac7c4[_0xd1d7('0x2f')][_0xd1d7('0x49')](_0xd1d7('0x35'))){_0x4e7908['limit']=qs['limit'](_0x4ac7c4[_0xd1d7('0x2f')][_0xd1d7('0x1c')]);_0x4e7908[_0xd1d7('0x1b')]=qs[_0xd1d7('0x1b')](_0x4ac7c4['query'][_0xd1d7('0x1b')]);}return _0x169ec4[_0xd1d7('0x46')](_0x4e7908);}})['then'](function(_0xc27403){if(_0xc27403){return _0xc27403?{'count':_0x3619f3,'rows':_0xc27403}:null;}})[_0xd1d7('0x22')](respondWithResult(_0x52b206,null))['catch'](handleError(_0x52b206,null));};exports[_0xd1d7('0x4a')]=function(_0x253b73,_0x2d895b,_0x3ddd24){if(_0x253b73['body']['id']){delete _0x253b73['body']['id'];}return db[_0xd1d7('0x29')][_0xd1d7('0x4b')]({'where':{'id':_0x253b73[_0xd1d7('0x45')]['id']}})[_0xd1d7('0x22')](handleEntityNotFound(_0x2d895b,null))[_0xd1d7('0x22')](function(_0x4f944e){if(_0x4f944e){_0x253b73[_0xd1d7('0x44')]['AccountId']=_0x4f944e['id'];_0x253b73[_0xd1d7('0x44')][_0xd1d7('0x4c')]=integrations[_0xd1d7('0x4d')](_0x253b73[_0xd1d7('0x44')]['channel'],_0x253b73[_0xd1d7('0x44')][_0xd1d7('0x2c')]);_0x253b73[_0xd1d7('0x44')][_0xd1d7('0x4e')]=integrations[_0xd1d7('0x4f')](_0x253b73['body'][_0xd1d7('0x50')],_0x253b73['body'][_0xd1d7('0x2c')]);return db[_0xd1d7('0x51')][_0xd1d7('0x43')](_0x253b73[_0xd1d7('0x44')],{'include':[{'model':db[_0xd1d7('0x52')],'as':_0xd1d7('0x4c')},{'model':db['ZohoField'],'as':_0xd1d7('0x4e')}]});}return null;})[_0xd1d7('0x22')](respondWithResult(_0x2d895b,null))[_0xd1d7('0x3f')](handleError(_0x2d895b,null));};function getAccessToken(_0x4b64fe){return new Promise(function(_0x572f0f,_0x31475c){var _0x21e633;switch(_0x4b64fe[_0xd1d7('0x53')]){case'US':_0x21e633=_0xd1d7('0x54');break;case'AU':_0x21e633='https://accounts.zoho.com.au';break;case'EU':_0x21e633=_0xd1d7('0x55');break;case'IN':_0x21e633=_0xd1d7('0x56');break;case'CN':_0x21e633=_0xd1d7('0x57');break;default:_0x21e633=_0xd1d7('0x55');break;}var _0x19c33d={'method':_0xd1d7('0x58'),'uri':_0x21e633+_0xd1d7('0x59'),'qs':{'refresh_token':_0x4b64fe[_0xd1d7('0x5a')],'client_id':_0x4b64fe[_0xd1d7('0x5b')],'client_secret':_0x4b64fe[_0xd1d7('0x5c')],'grant_type':_0xd1d7('0x5d')},'json':!![]};return rp(_0x19c33d)[_0xd1d7('0x22')](function(_0x543145){if(_0x543145['access_token']){_0x572f0f(_0x543145[_0xd1d7('0x5e')]);}else{_0x31475c(_0xd1d7('0x5f'));}})[_0xd1d7('0x3f')](function(_0x54321b){_0x31475c(_0x54321b);});});}exports[_0xd1d7('0x60')]=function(_0x171a72,_0x3e2d4a,_0x5b6d95){var _0x3b49b1,_0x271fcd,_0x24b1ab,_0x209122,_0x2d706e;return db[_0xd1d7('0x29')][_0xd1d7('0x4b')]({'where':{'id':_0x171a72[_0xd1d7('0x45')]['id']},'attributes':['id',_0xd1d7('0x61'),_0xd1d7('0x53'),'clientId',_0xd1d7('0x5c'),_0xd1d7('0x62'),_0xd1d7('0x63'),_0xd1d7('0x5a')]})[_0xd1d7('0x22')](handleEntityNotFound(_0x3e2d4a,null))[_0xd1d7('0x22')](function(_0x35e575){_0x2d706e=_0x35e575;_0x3b49b1=_0x2d706e[_0xd1d7('0x61')];_0x271fcd=_0x3b49b1==='zoho.eu'?'eu':'com';_0x24b1ab=_0x2d706e[_0xd1d7('0x62')];var _0x3ab7d1=_0x24b1ab['slice'](-0x1);if(_0x3ab7d1==='/'||_0x3ab7d1==='\x5c'||_0x3ab7d1===':'){_0x24b1ab=_0x24b1ab[_0xd1d7('0x64')](0x0,_0x24b1ab[_0xd1d7('0x65')](_0x3ab7d1));}if(!_0x2d706e[_0xd1d7('0x5a')]){throw new Error(_0xd1d7('0x66'));}return getAccessToken(_0x2d706e);})[_0xd1d7('0x22')](function(_0x2eb3df){if(_0x2eb3df){return rp({'method':_0xd1d7('0x67'),'uri':util[_0xd1d7('0x68')](_0xd1d7('0x69'),_0x271fcd),'qs':{'module':_0xd1d7('0x6a')},'headers':{'Authorization':_0xd1d7('0x6b')+_0x2eb3df},'json':!![]});}})['then'](function(_0x2b5818){if(_0x2b5818){if(_0x2b5818['response']&&_0x2b5818['response'][_0xd1d7('0x24')]){throw new Error(_0x2b5818[_0xd1d7('0x6c')][_0xd1d7('0x24')][_0xd1d7('0x6d')]);}var _0x2da63b=[];var _0x1b94b7=[];var _0x2f8662=[_0xd1d7('0x6e'),'Subject',_0xd1d7('0x6f'),_0xd1d7('0x70'),_0xd1d7('0x71'),'Call_Result',_0xd1d7('0x72'),_0xd1d7('0x73')];_0x1b94b7=_[_0xd1d7('0x74')](_0x2b5818['fields'],function(_0x53bb5e){return _0x2f8662[_0xd1d7('0x75')](_0x53bb5e[_0xd1d7('0x76')]);});for(var _0x4ebed4=0x0;_0x4ebed4<_0x1b94b7[_0xd1d7('0x41')];_0x4ebed4++){if(_0x1b94b7[_0x4ebed4]['system_mandatory']===![]){_0x2da63b[_0xd1d7('0x77')]({'id':_0x1b94b7[_0x4ebed4]['id'],'name':_0x1b94b7[_0x4ebed4][_0xd1d7('0x78')],'custom':_0x1b94b7[_0x4ebed4]['custom_field'],'options':_0x1b94b7[_0x4ebed4]['data_type']===_0xd1d7('0x79')&&_0x1b94b7[_0x4ebed4][_0xd1d7('0x7a')][_0xd1d7('0x41')]>-0x1?_['map'](_0x1b94b7[_0x4ebed4][_0xd1d7('0x7a')],function(_0x4a5161){return{'name':_0x4a5161,'value':_0x4a5161};}):[]});}}return{'count':_0x2da63b['length'],'rows':_0x2da63b};}else{return{'count':0x0,'rows':[]};}})[_0xd1d7('0x22')](respondWithResult(_0x3e2d4a,null))['catch'](function(_0x38e233){var _0x3cb46e=_0x171a72[_0xd1d7('0x2f')][_0xd1d7('0x7b')]?0x1f4:_0x38e233[_0xd1d7('0x7c')]||0x1f4;logger[_0xd1d7('0x24')](_0xd1d7('0x7d'),_0xd1d7('0x60'),_0x3cb46e,JSON['stringify'](_0x38e233));delete _0x38e233[_0xd1d7('0x26')];if(_0x3cb46e===0x191){_0x3cb46e=0x190;}_0x3e2d4a[_0xd1d7('0x19')](_0x3cb46e)[_0xd1d7('0x27')](_0x171a72[_0xd1d7('0x2f')][_0xd1d7('0x7b')]?{'message':'Wrong\x20credentials','statusCode':_0x38e233['statusCode']}:_0x38e233);});}; \ No newline at end of file +var _0xfaf3=['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','../../components/integrations/configuration','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','ZohoAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','serverUrl','code','refreshToken','zoho.eu','com','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','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','push','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','crypto'];(function(_0x2a240d,_0x43fa5e){var _0x48fc79=function(_0x2df94d){while(--_0x2df94d){_0x2a240d['push'](_0x2a240d['shift']());}};_0x48fc79(++_0x43fa5e);}(_0xfaf3,0x181));var _0x3faf=function(_0x1d4db1,_0x352324){_0x1d4db1=_0x1d4db1-0x0;var _0x213150=_0xfaf3[_0x1d4db1];return _0x213150;};'use strict';var emlformat=require(_0x3faf('0x0'));var rimraf=require(_0x3faf('0x1'));var zipdir=require(_0x3faf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3faf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3faf('0x4'));var util=require(_0x3faf('0x5'));var path=require(_0x3faf('0x6'));var sox=require(_0x3faf('0x7'));var csv=require(_0x3faf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3faf('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3faf('0xa'));var jsforce=require(_0x3faf('0xb'));var deskjs=require(_0x3faf('0xc'));var toCsv=require(_0x3faf('0x8'));var querystring=require('querystring');var Papa=require(_0x3faf('0xd'));var Redis=require(_0x3faf('0xe'));var authService=require(_0x3faf('0xf'));var qs=require(_0x3faf('0x10'));var as=require(_0x3faf('0x11'));var hardwareService=require(_0x3faf('0x12'));var logger=require(_0x3faf('0x13'))(_0x3faf('0x14'));var utils=require(_0x3faf('0x15'));var config=require(_0x3faf('0x16'));var licenseUtil=require(_0x3faf('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3faf('0x18'));function respondWithStatusCode(_0x5d7c1f,_0x3aece0){_0x3aece0=_0x3aece0||0xcc;return function(_0x38bdc5){if(_0x38bdc5){return _0x5d7c1f[_0x3faf('0x19')](_0x3aece0);}return _0x5d7c1f[_0x3faf('0x1a')](_0x3aece0)[_0x3faf('0x1b')]();};}function respondWithResult(_0x4168de,_0x3fd840){_0x3fd840=_0x3fd840||0xc8;return function(_0x49fac8){if(_0x49fac8){return _0x4168de[_0x3faf('0x1a')](_0x3fd840)['json'](_0x49fac8);}};}function respondWithFilteredResult(_0x2c8c27,_0x170e77){return function(_0x550d20){if(_0x550d20){var _0x394c07=typeof _0x170e77[_0x3faf('0x1c')]==='undefined'&&typeof _0x170e77[_0x3faf('0x1d')]==='undefined';var _0x1b7493=_0x550d20[_0x3faf('0x1e')];var _0x5c18cc=_0x394c07?0x0:_0x170e77['offset'];var _0x13f5d7=_0x394c07?_0x550d20['count']:_0x170e77[_0x3faf('0x1c')]+_0x170e77[_0x3faf('0x1d')];var _0x5e247f;if(_0x13f5d7>=_0x1b7493){_0x13f5d7=_0x1b7493;_0x5e247f=0xc8;}else{_0x5e247f=0xce;}_0x2c8c27[_0x3faf('0x1a')](_0x5e247f);return _0x2c8c27[_0x3faf('0x1f')](_0x3faf('0x20'),_0x5c18cc+'-'+_0x13f5d7+'/'+_0x1b7493)[_0x3faf('0x21')](_0x550d20);}return null;};}function patchUpdates(_0x136a93){return function(_0x385e50){try{jsonpatch[_0x3faf('0x22')](_0x385e50,_0x136a93,!![]);}catch(_0x14696a){return BPromise['reject'](_0x14696a);}return _0x385e50[_0x3faf('0x23')]();};}function saveUpdates(_0x4e7eb1,_0x20b619){return function(_0x38bd87){if(_0x38bd87){return _0x38bd87[_0x3faf('0x24')](_0x4e7eb1)[_0x3faf('0x25')](function(_0x4ad71a){return _0x4ad71a;});}return null;};}function removeEntity(_0x4681f6,_0x4ee365){return function(_0x4f596e){if(_0x4f596e){return _0x4f596e[_0x3faf('0x26')]()[_0x3faf('0x25')](function(){_0x4681f6[_0x3faf('0x1a')](0xcc)[_0x3faf('0x1b')]();});}};}function handleEntityNotFound(_0x1312d9,_0x2a9df9){return function(_0x6b70bd){if(!_0x6b70bd){_0x1312d9[_0x3faf('0x19')](0x194);}return _0x6b70bd;};}function handleError(_0x395859,_0x47ca04){_0x47ca04=_0x47ca04||0x1f4;return function(_0x329085){logger[_0x3faf('0x27')](_0x329085[_0x3faf('0x28')]);if(_0x329085[_0x3faf('0x29')]){delete _0x329085[_0x3faf('0x29')];}_0x395859['status'](_0x47ca04)[_0x3faf('0x2a')](_0x329085);};}exports[_0x3faf('0x2b')]=function(_0x3628d0,_0xb3721){var _0x1da519={},_0xba6bcf={},_0x3a82a8={'count':0x0,'rows':[]};var _0x10cce6=_[_0x3faf('0x2c')](db[_0x3faf('0x2d')][_0x3faf('0x2e')],function(_0x14ced3){return{'name':_0x14ced3['fieldName'],'type':_0x14ced3[_0x3faf('0x2f')][_0x3faf('0x30')]};});_0xba6bcf[_0x3faf('0x31')]=_[_0x3faf('0x2c')](_0x10cce6,'name');_0xba6bcf[_0x3faf('0x32')]=_['keys'](_0x3628d0[_0x3faf('0x32')]);_0xba6bcf[_0x3faf('0x33')]=_[_0x3faf('0x34')](_0xba6bcf[_0x3faf('0x31')],_0xba6bcf['query']);_0x1da519[_0x3faf('0x35')]=_[_0x3faf('0x34')](_0xba6bcf[_0x3faf('0x31')],qs[_0x3faf('0x36')](_0x3628d0[_0x3faf('0x32')][_0x3faf('0x36')]));_0x1da519['attributes']=_0x1da519['attributes']['length']?_0x1da519[_0x3faf('0x35')]:_0xba6bcf['model'];if(!_0x3628d0['query'][_0x3faf('0x37')](_0x3faf('0x38'))){_0x1da519['limit']=qs[_0x3faf('0x1d')](_0x3628d0['query'][_0x3faf('0x1d')]);_0x1da519[_0x3faf('0x1c')]=qs[_0x3faf('0x1c')](_0x3628d0[_0x3faf('0x32')][_0x3faf('0x1c')]);}_0x1da519[_0x3faf('0x39')]=qs[_0x3faf('0x3a')](_0x3628d0['query'][_0x3faf('0x3a')]);_0x1da519['where']=qs['filters'](_[_0x3faf('0x3b')](_0x3628d0[_0x3faf('0x32')],_0xba6bcf[_0x3faf('0x33')]),_0x10cce6);if(_0x3628d0[_0x3faf('0x32')]['filter']){_0x1da519[_0x3faf('0x3c')]=_[_0x3faf('0x3d')](_0x1da519[_0x3faf('0x3c')],{'$or':_['map'](_0x10cce6,function(_0x603b50){if(_0x603b50[_0x3faf('0x2f')]!=='VIRTUAL'){var _0x47fb7f={};_0x47fb7f[_0x603b50['name']]={'$like':'%'+_0x3628d0[_0x3faf('0x32')][_0x3faf('0x3e')]+'%'};return _0x47fb7f;}})});}_0x1da519=_[_0x3faf('0x3d')]({},_0x1da519,_0x3628d0['options']);var _0x43cb14={'where':_0x1da519[_0x3faf('0x3c')]};return db['ZohoAccount'][_0x3faf('0x1e')](_0x43cb14)[_0x3faf('0x25')](function(_0x5075fb){_0x3a82a8['count']=_0x5075fb;if(_0x3628d0[_0x3faf('0x32')][_0x3faf('0x3f')]){_0x1da519[_0x3faf('0x40')]=[{'all':!![]}];}return db[_0x3faf('0x2d')][_0x3faf('0x41')](_0x1da519);})[_0x3faf('0x25')](function(_0xe79a7b){_0x3a82a8[_0x3faf('0x42')]=_0xe79a7b;return _0x3a82a8;})[_0x3faf('0x25')](respondWithFilteredResult(_0xb3721,_0x1da519))[_0x3faf('0x43')](handleError(_0xb3721,null));};exports[_0x3faf('0x44')]=function(_0x488e70,_0x632a53){var _0x187c1e={'raw':![],'where':{'id':_0x488e70[_0x3faf('0x45')]['id']}},_0x30661c={};_0x30661c[_0x3faf('0x31')]=_['keys'](db[_0x3faf('0x2d')]['rawAttributes']);_0x30661c[_0x3faf('0x32')]=_[_0x3faf('0x46')](_0x488e70['query']);_0x30661c[_0x3faf('0x33')]=_[_0x3faf('0x34')](_0x30661c[_0x3faf('0x31')],_0x30661c[_0x3faf('0x32')]);_0x187c1e['attributes']=_['intersection'](_0x30661c[_0x3faf('0x31')],qs['fields'](_0x488e70[_0x3faf('0x32')][_0x3faf('0x36')]));_0x187c1e['attributes']=_0x187c1e[_0x3faf('0x35')][_0x3faf('0x47')]?_0x187c1e[_0x3faf('0x35')]:_0x30661c[_0x3faf('0x31')];if(_0x488e70[_0x3faf('0x32')][_0x3faf('0x3f')]){_0x187c1e[_0x3faf('0x40')]=[{'all':!![]}];}_0x187c1e=_[_0x3faf('0x3d')]({},_0x187c1e,_0x488e70[_0x3faf('0x48')]);return db[_0x3faf('0x2d')][_0x3faf('0x49')](_0x187c1e)[_0x3faf('0x25')](handleEntityNotFound(_0x632a53,null))[_0x3faf('0x25')](respondWithResult(_0x632a53,null))[_0x3faf('0x43')](handleError(_0x632a53,null));};exports['create']=function(_0x42c498,_0x489c66){return db['ZohoAccount'][_0x3faf('0x4a')](_0x42c498[_0x3faf('0x4b')],{})['then'](respondWithResult(_0x489c66,0xc9))[_0x3faf('0x43')](handleError(_0x489c66,null));};exports['update']=function(_0x1511ba,_0x4b561c){if(_0x1511ba[_0x3faf('0x4b')]['id']){delete _0x1511ba[_0x3faf('0x4b')]['id'];}return db['ZohoAccount'][_0x3faf('0x49')]({'where':{'id':_0x1511ba[_0x3faf('0x45')]['id']}})[_0x3faf('0x25')](handleEntityNotFound(_0x4b561c,null))[_0x3faf('0x25')](saveUpdates(_0x1511ba['body'],null))[_0x3faf('0x25')](respondWithResult(_0x4b561c,null))[_0x3faf('0x43')](handleError(_0x4b561c,null));};exports['destroy']=function(_0x4bcb25,_0x182efe){return db['ZohoAccount'][_0x3faf('0x49')]({'where':{'id':_0x4bcb25[_0x3faf('0x45')]['id']}})[_0x3faf('0x25')](handleEntityNotFound(_0x182efe,null))[_0x3faf('0x25')](removeEntity(_0x182efe,null))['catch'](handleError(_0x182efe,null));};exports['getConfigurations']=function(_0x5e8a6b,_0x19342f,_0x17b8b2){var _0x58c5f8={};var _0x4858af={};var _0x5828f0;var _0x490128;return db[_0x3faf('0x2d')][_0x3faf('0x4c')]({'where':{'id':_0x5e8a6b['params']['id']}})[_0x3faf('0x25')](handleEntityNotFound(_0x19342f,null))[_0x3faf('0x25')](function(_0x3eac01){if(_0x3eac01){_0x5828f0=_0x3eac01;_0x4858af['model']=_[_0x3faf('0x46')](db[_0x3faf('0x4d')][_0x3faf('0x2e')]);_0x4858af[_0x3faf('0x32')]=_['keys'](_0x5e8a6b[_0x3faf('0x32')]);_0x4858af[_0x3faf('0x33')]=_[_0x3faf('0x34')](_0x4858af[_0x3faf('0x31')],_0x4858af[_0x3faf('0x32')]);_0x58c5f8[_0x3faf('0x35')]=_['intersection'](_0x4858af[_0x3faf('0x31')],qs[_0x3faf('0x36')](_0x5e8a6b[_0x3faf('0x32')]['fields']));_0x58c5f8['attributes']=_0x58c5f8[_0x3faf('0x35')][_0x3faf('0x47')]?_0x58c5f8[_0x3faf('0x35')]:_0x4858af[_0x3faf('0x31')];_0x58c5f8[_0x3faf('0x39')]=qs[_0x3faf('0x3a')](_0x5e8a6b['query'][_0x3faf('0x3a')]);_0x58c5f8[_0x3faf('0x3c')]=qs[_0x3faf('0x33')](_[_0x3faf('0x3b')](_0x5e8a6b[_0x3faf('0x32')],_0x4858af[_0x3faf('0x33')]));if(_0x5e8a6b['query'][_0x3faf('0x3e')]){_0x58c5f8[_0x3faf('0x3c')]=_['merge'](_0x58c5f8['where'],{'$or':_[_0x3faf('0x2c')](_0x58c5f8[_0x3faf('0x35')],function(_0x2f05c9){var _0x413530={};_0x413530[_0x2f05c9]={'$like':'%'+_0x5e8a6b[_0x3faf('0x32')]['filter']+'%'};return _0x413530;})});}_0x58c5f8=_[_0x3faf('0x3d')]({},_0x58c5f8,_0x5e8a6b[_0x3faf('0x48')]);return _0x5828f0['getConfigurations'](_0x58c5f8);}})[_0x3faf('0x25')](function(_0x3231b3){if(_0x3231b3){_0x490128=_0x3231b3[_0x3faf('0x47')];if(!_0x5e8a6b[_0x3faf('0x32')][_0x3faf('0x37')]('nolimit')){_0x58c5f8[_0x3faf('0x1d')]=qs[_0x3faf('0x1d')](_0x5e8a6b[_0x3faf('0x32')][_0x3faf('0x1d')]);_0x58c5f8[_0x3faf('0x1c')]=qs[_0x3faf('0x1c')](_0x5e8a6b[_0x3faf('0x32')][_0x3faf('0x1c')]);}return _0x5828f0['getConfigurations'](_0x58c5f8);}})[_0x3faf('0x25')](function(_0xfb37d2){if(_0xfb37d2){return _0xfb37d2?{'count':_0x490128,'rows':_0xfb37d2}:null;}})[_0x3faf('0x25')](respondWithResult(_0x19342f,null))[_0x3faf('0x43')](handleError(_0x19342f,null));};exports[_0x3faf('0x4e')]=function(_0x48fd18,_0x299471,_0x2353d2){if(_0x48fd18['body']['id']){delete _0x48fd18[_0x3faf('0x4b')]['id'];}return db[_0x3faf('0x2d')][_0x3faf('0x4c')]({'where':{'id':_0x48fd18[_0x3faf('0x45')]['id']}})[_0x3faf('0x25')](handleEntityNotFound(_0x299471,null))[_0x3faf('0x25')](function(_0x3f76df){if(_0x3f76df){_0x48fd18[_0x3faf('0x4b')][_0x3faf('0x4f')]=_0x3f76df['id'];_0x48fd18[_0x3faf('0x4b')][_0x3faf('0x50')]=integrations['getSubjects'](_0x48fd18[_0x3faf('0x4b')][_0x3faf('0x51')],_0x48fd18[_0x3faf('0x4b')][_0x3faf('0x2f')]);_0x48fd18[_0x3faf('0x4b')][_0x3faf('0x52')]=integrations['getDescriptions'](_0x48fd18[_0x3faf('0x4b')][_0x3faf('0x51')],_0x48fd18[_0x3faf('0x4b')]['type']);return db[_0x3faf('0x4d')][_0x3faf('0x4a')](_0x48fd18[_0x3faf('0x4b')],{'include':[{'model':db[_0x3faf('0x53')],'as':'Subjects'},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x299471,null))[_0x3faf('0x43')](handleError(_0x299471,null));};function getAccessToken(_0x2cc4a3){return new Promise(function(_0x1757de,_0x2782c4){var _0x443ecb;switch(_0x2cc4a3[_0x3faf('0x54')]){case'US':_0x443ecb=_0x3faf('0x55');break;case'AU':_0x443ecb=_0x3faf('0x56');break;case'EU':_0x443ecb=_0x3faf('0x57');break;case'IN':_0x443ecb=_0x3faf('0x58');break;case'CN':_0x443ecb=_0x3faf('0x59');break;default:_0x443ecb='https://accounts.zoho.eu';break;}var _0x26ddff={'method':_0x3faf('0x5a'),'uri':_0x443ecb+_0x3faf('0x5b'),'qs':{'refresh_token':_0x2cc4a3['refreshToken'],'client_id':_0x2cc4a3['clientId'],'client_secret':_0x2cc4a3[_0x3faf('0x5c')],'grant_type':_0x3faf('0x5d')},'json':!![]};return rp(_0x26ddff)[_0x3faf('0x25')](function(_0x160d06){if(_0x160d06['access_token']){_0x1757de(_0x160d06[_0x3faf('0x5e')]);}else{_0x2782c4(_0x3faf('0x5f'));}})[_0x3faf('0x43')](function(_0x1ec735){_0x2782c4(_0x1ec735);});});}exports[_0x3faf('0x60')]=function(_0x22cf2f,_0x571953,_0x35aacc){var _0x1667ea,_0x1f2722,_0x5b70bd,_0x3de610,_0x415ee5;return db[_0x3faf('0x2d')][_0x3faf('0x4c')]({'where':{'id':_0x22cf2f[_0x3faf('0x45')]['id']},'attributes':['id',_0x3faf('0x61'),_0x3faf('0x54'),_0x3faf('0x62'),_0x3faf('0x5c'),_0x3faf('0x63'),_0x3faf('0x64'),_0x3faf('0x65')]})[_0x3faf('0x25')](handleEntityNotFound(_0x571953,null))[_0x3faf('0x25')](function(_0x51e61){_0x415ee5=_0x51e61;_0x1667ea=_0x415ee5[_0x3faf('0x61')];_0x1f2722=_0x1667ea===_0x3faf('0x66')?'eu':_0x3faf('0x67');_0x5b70bd=_0x415ee5[_0x3faf('0x63')];var _0x419af6=_0x5b70bd[_0x3faf('0x68')](-0x1);if(_0x419af6==='/'||_0x419af6==='\x5c'||_0x419af6===':'){_0x5b70bd=_0x5b70bd[_0x3faf('0x69')](0x0,_0x5b70bd[_0x3faf('0x6a')](_0x419af6));}if(!_0x415ee5[_0x3faf('0x65')]){throw new Error(_0x3faf('0x6b'));}return getAccessToken(_0x415ee5);})['then'](function(_0x184909){if(_0x184909){return rp({'method':_0x3faf('0x6c'),'uri':util[_0x3faf('0x6d')](_0x3faf('0x6e'),_0x1f2722),'qs':{'module':_0x3faf('0x6f')},'headers':{'Authorization':_0x3faf('0x70')+_0x184909},'json':!![]});}})[_0x3faf('0x25')](function(_0x3320d5){if(_0x3320d5){if(_0x3320d5[_0x3faf('0x71')]&&_0x3320d5[_0x3faf('0x71')]['error']){throw new Error(_0x3320d5[_0x3faf('0x71')][_0x3faf('0x27')][_0x3faf('0x72')]);}var _0x409eff=[];var _0x44a9df=[];var _0x3b6999=[_0x3faf('0x73'),'Subject',_0x3faf('0x74'),_0x3faf('0x75'),_0x3faf('0x76'),_0x3faf('0x77'),_0x3faf('0x78'),'Call_Type'];_0x44a9df=_[_0x3faf('0x79')](_0x3320d5[_0x3faf('0x36')],function(_0x1581aa){return _0x3b6999[_0x3faf('0x7a')](_0x1581aa[_0x3faf('0x7b')]);});for(var _0x260781=0x0;_0x260781<_0x44a9df[_0x3faf('0x47')];_0x260781++){if(_0x44a9df[_0x260781]['system_mandatory']===![]){_0x409eff[_0x3faf('0x7c')]({'id':_0x44a9df[_0x260781]['id'],'name':_0x44a9df[_0x260781]['display_label'],'custom':_0x44a9df[_0x260781]['custom_field'],'options':_0x44a9df[_0x260781][_0x3faf('0x7d')]==='picklist'&&_0x44a9df[_0x260781][_0x3faf('0x7e')][_0x3faf('0x47')]>-0x1?_[_0x3faf('0x2c')](_0x44a9df[_0x260781]['pick_list_values'],function(_0x429aae){return{'name':_0x429aae,'value':_0x429aae};}):[]});}}return{'count':_0x409eff[_0x3faf('0x47')],'rows':_0x409eff};}else{return{'count':0x0,'rows':[]};}})[_0x3faf('0x25')](respondWithResult(_0x571953,null))[_0x3faf('0x43')](function(_0x35905a){var _0x2150ca=_0x22cf2f['query'][_0x3faf('0x7f')]?0x1f4:_0x35905a[_0x3faf('0x80')]||0x1f4;logger[_0x3faf('0x27')](_0x3faf('0x81'),_0x3faf('0x60'),_0x2150ca,JSON[_0x3faf('0x82')](_0x35905a));delete _0x35905a[_0x3faf('0x29')];if(_0x2150ca===0x191){_0x2150ca=0x190;}_0x571953[_0x3faf('0x1a')](_0x2150ca)['send'](_0x22cf2f['query'][_0x3faf('0x7f')]?{'message':_0x3faf('0x83'),'statusCode':_0x35905a[_0x3faf('0x80')]}:_0x35905a);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 7b24bea..73ab71d 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 _0x3066=['rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','application/x-www-form-urlencoded','then','parse','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','/oauth/v2/token','refresh_token','refreshToken','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4876a5,_0x58f4ba){var _0x474ddc=function(_0x49dc75){while(--_0x49dc75){_0x4876a5['push'](_0x4876a5['shift']());}};_0x474ddc(++_0x58f4ba);}(_0x3066,0x185));var _0x6306=function(_0x380c78,_0x37bbfd){_0x380c78=_0x380c78-0x0;var _0x1aad3e=_0x3066[_0x380c78];return _0x1aad3e;};'use strict';var _=require(_0x6306('0x0'));var util=require(_0x6306('0x1'));var logger=require(_0x6306('0x2'))(_0x6306('0x3'));var moment=require(_0x6306('0x4'));var BPromise=require(_0x6306('0x5'));var rp=require(_0x6306('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6306('0x7'));var config=require(_0x6306('0x8'));var attributes=require(_0x6306('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x6306('0xa')]=function(_0x4d26a7,_0x1c5261){return _0x4d26a7[_0x6306('0xb')](_0x6306('0xc'),attributes,{'tableName':_0x6306('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3bfe77,_0x22cb58,_0x28f97f){if(_0x3bfe77[_0x6306('0xe')]('zone')||_0x3bfe77['changed'](_0x6306('0xf'))||_0x3bfe77['changed'](_0x6306('0x10'))||_0x3bfe77['changed'](_0x6306('0x11'))||_0x3bfe77[_0x6306('0xe')](_0x6306('0x12'))||_0x3bfe77['changed'](_0x6306('0x13'))){var _0x20d8ec,_0x3acdc9;_0x20d8ec=_0x3bfe77['serverUrl'];var _0x4b42bc=_0x20d8ec[_0x6306('0x14')](-0x1);if(_0x4b42bc==='/'||_0x4b42bc==='\x5c'||_0x4b42bc===':'){_0x20d8ec=_0x20d8ec[_0x6306('0x15')](0x0,_0x20d8ec[_0x6306('0x16')](_0x4b42bc));}switch(_0x3bfe77[_0x6306('0x17')]){case'US':_0x3acdc9=_0x6306('0x18');break;case'AU':_0x3acdc9=_0x6306('0x19');break;case'IN':_0x3acdc9=_0x6306('0x1a');break;case'CN':_0x3acdc9=_0x6306('0x1b');break;default:_0x3acdc9=_0x6306('0x1c');break;}var _0x53c06d={'method':_0x6306('0x1d'),'uri':_0x3acdc9+'/oauth/v2/token','form':{'grant_type':_0x6306('0x1e'),'client_id':_0x3bfe77[_0x6306('0x10')],'client_secret':_0x3bfe77[_0x6306('0x11')],'redirect_uri':_0x3bfe77[_0x6306('0xf')],'code':_0x3bfe77[_0x6306('0x12')]},'headers':{'Content-Type':_0x6306('0x1f')}};return rp(_0x53c06d)[_0x6306('0x20')](function(_0x27806c){var _0x5e8c44=JSON[_0x6306('0x21')](_0x27806c);if(_0x5e8c44['refresh_token']){_0x3bfe77['refreshToken']=_0x5e8c44['refresh_token'];logger[_0x6306('0x22')](util[_0x6306('0x23')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3bfe77[_0x6306('0x24')],_0x3bfe77['id']));}else{logger[_0x6306('0x25')](util[_0x6306('0x23')](_0x6306('0x26'),_0x3bfe77[_0x6306('0x24')],_0x3bfe77['id']),util[_0x6306('0x27')](_0x5e8c44,{'showHidden':![],'depth':null}));}return _0x28f97f(null,_0x22cb58);})[_0x6306('0x28')](function(_0x343362){logger[_0x6306('0x25')](util[_0x6306('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3bfe77[_0x6306('0x24')],_0x3bfe77['id']),util[_0x6306('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x28f97f(_0x343362);});}else{return _0x28f97f(null,_0x22cb58);}},'beforeUpdate':function(_0x4ee116,_0xfc79b2,_0xa1fd73){if(_0x4ee116[_0x6306('0xe')]('zone')||_0x4ee116[_0x6306('0xe')](_0x6306('0xf'))||_0x4ee116[_0x6306('0xe')](_0x6306('0x10'))||_0x4ee116[_0x6306('0xe')](_0x6306('0x11'))||_0x4ee116[_0x6306('0xe')](_0x6306('0x12'))||_0x4ee116[_0x6306('0xe')](_0x6306('0x13'))){var _0x433a6b,_0x1136f5;_0x433a6b=_0x4ee116['serverUrl'];var _0x39d322=_0x433a6b[_0x6306('0x14')](-0x1);if(_0x39d322==='/'||_0x39d322==='\x5c'||_0x39d322===':'){_0x433a6b=_0x433a6b[_0x6306('0x15')](0x0,_0x433a6b[_0x6306('0x16')](_0x39d322));}switch(_0x4ee116[_0x6306('0x17')]){case'US':_0x1136f5=_0x6306('0x18');break;case'AU':_0x1136f5=_0x6306('0x19');break;case'IN':_0x1136f5=_0x6306('0x1a');break;case'CN':_0x1136f5=_0x6306('0x1b');break;default:_0x1136f5='https://accounts.zoho.eu';break;}var _0x4191f0={'method':_0x6306('0x1d'),'uri':_0x1136f5+_0x6306('0x29'),'form':{'grant_type':_0x6306('0x1e'),'client_id':_0x4ee116[_0x6306('0x10')],'client_secret':_0x4ee116[_0x6306('0x11')],'redirect_uri':_0x4ee116[_0x6306('0xf')],'code':_0x4ee116['code']},'headers':{'Content-Type':_0x6306('0x1f')}};return rp(_0x4191f0)[_0x6306('0x20')](function(_0x3f24d9){var _0x3c6077=JSON[_0x6306('0x21')](_0x3f24d9);if(_0x3c6077[_0x6306('0x2a')]){_0x4ee116[_0x6306('0x2b')]=_0x3c6077['refresh_token'];logger[_0x6306('0x22')](util[_0x6306('0x23')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4ee116[_0x6306('0x24')],_0x4ee116['id']));}else{logger[_0x6306('0x25')](util[_0x6306('0x23')](_0x6306('0x26'),_0x4ee116[_0x6306('0x24')],_0x4ee116['id']),util[_0x6306('0x27')](_0x3c6077,{'showHidden':![],'depth':null}));}return _0xa1fd73(null,_0xfc79b2);})[_0x6306('0x28')](function(_0x5a290b){logger[_0x6306('0x25')](util[_0x6306('0x23')](_0x6306('0x26'),_0x4ee116[_0x6306('0x24')],_0x4ee116['id']),util[_0x6306('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0xa1fd73(_0x5a290b);});}else{return _0xa1fd73(null,_0xfc79b2);}}}});}; \ No newline at end of file +var _0x7bc0=['int_zoho_accounts','changed','zone','serverUrl','clientSecret','host','slice','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','clientId','code','then','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','substring','https://accounts.zoho.com','authorization_code','application/x-www-form-urlencoded','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x44ca27,_0x81f0da){var _0x38bc17=function(_0x476f85){while(--_0x476f85){_0x44ca27['push'](_0x44ca27['shift']());}};_0x38bc17(++_0x81f0da);}(_0x7bc0,0x9c));var _0x07bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7bc0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x07bc('0x0'));var util=require(_0x07bc('0x1'));var logger=require(_0x07bc('0x2'))(_0x07bc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x07bc('0x4'));var fs=require('fs');var path=require(_0x07bc('0x5'));var rimraf=require(_0x07bc('0x6'));var config=require(_0x07bc('0x7'));var attributes=require(_0x07bc('0x8'));var integrations=require(_0x07bc('0x9'));module[_0x07bc('0xa')]=function(_0x29d264,_0x28c3c9){return _0x29d264[_0x07bc('0xb')]('ZohoAccount',attributes,{'tableName':_0x07bc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1faf2f,_0x31e1d5,_0x2578a9){if(_0x1faf2f[_0x07bc('0xd')](_0x07bc('0xe'))||_0x1faf2f[_0x07bc('0xd')](_0x07bc('0xf'))||_0x1faf2f[_0x07bc('0xd')]('clientId')||_0x1faf2f[_0x07bc('0xd')](_0x07bc('0x10'))||_0x1faf2f['changed']('code')||_0x1faf2f[_0x07bc('0xd')](_0x07bc('0x11'))){var _0x8c7461,_0x1e114b;_0x8c7461=_0x1faf2f[_0x07bc('0xf')];var _0x368c9c=_0x8c7461[_0x07bc('0x12')](-0x1);if(_0x368c9c==='/'||_0x368c9c==='\x5c'||_0x368c9c===':'){_0x8c7461=_0x8c7461['substring'](0x0,_0x8c7461[_0x07bc('0x13')](_0x368c9c));}switch(_0x1faf2f[_0x07bc('0xe')]){case'US':_0x1e114b='https://accounts.zoho.com';break;case'AU':_0x1e114b=_0x07bc('0x14');break;case'IN':_0x1e114b=_0x07bc('0x15');break;case'CN':_0x1e114b=_0x07bc('0x16');break;default:_0x1e114b=_0x07bc('0x17');break;}var _0x1186e1={'method':_0x07bc('0x18'),'uri':_0x1e114b+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x1faf2f[_0x07bc('0x19')],'client_secret':_0x1faf2f['clientSecret'],'redirect_uri':_0x1faf2f[_0x07bc('0xf')],'code':_0x1faf2f[_0x07bc('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1186e1)[_0x07bc('0x1b')](function(_0xdee518){var _0x5a8abd=JSON[_0x07bc('0x1c')](_0xdee518);if(_0x5a8abd[_0x07bc('0x1d')]){_0x1faf2f[_0x07bc('0x1e')]=_0x5a8abd[_0x07bc('0x1d')];logger['info'](util[_0x07bc('0x1f')](_0x07bc('0x20'),_0x1faf2f[_0x07bc('0x21')],_0x1faf2f['id']));}else{logger[_0x07bc('0x22')](util[_0x07bc('0x1f')](_0x07bc('0x23'),_0x1faf2f[_0x07bc('0x21')],_0x1faf2f['id']),util[_0x07bc('0x24')](_0x5a8abd,{'showHidden':![],'depth':null}));}return _0x2578a9(null,_0x31e1d5);})[_0x07bc('0x25')](function(_0x3b52c5){logger[_0x07bc('0x22')](util[_0x07bc('0x1f')](_0x07bc('0x23'),_0x1faf2f[_0x07bc('0x21')],_0x1faf2f['id']),util[_0x07bc('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x2578a9(_0x3b52c5);});}else{return _0x2578a9(null,_0x31e1d5);}},'beforeUpdate':function(_0x2b72c6,_0x4d09aa,_0x505373){if(_0x2b72c6[_0x07bc('0xd')](_0x07bc('0xe'))||_0x2b72c6[_0x07bc('0xd')]('serverUrl')||_0x2b72c6[_0x07bc('0xd')](_0x07bc('0x19'))||_0x2b72c6['changed'](_0x07bc('0x10'))||_0x2b72c6[_0x07bc('0xd')]('code')||_0x2b72c6[_0x07bc('0xd')](_0x07bc('0x11'))){var _0x2a36df,_0xb08587;_0x2a36df=_0x2b72c6[_0x07bc('0xf')];var _0x3eb180=_0x2a36df[_0x07bc('0x12')](-0x1);if(_0x3eb180==='/'||_0x3eb180==='\x5c'||_0x3eb180===':'){_0x2a36df=_0x2a36df[_0x07bc('0x26')](0x0,_0x2a36df['lastIndexOf'](_0x3eb180));}switch(_0x2b72c6[_0x07bc('0xe')]){case'US':_0xb08587=_0x07bc('0x27');break;case'AU':_0xb08587=_0x07bc('0x14');break;case'IN':_0xb08587=_0x07bc('0x15');break;case'CN':_0xb08587=_0x07bc('0x16');break;default:_0xb08587=_0x07bc('0x17');break;}var _0x20183a={'method':'POST','uri':_0xb08587+'/oauth/v2/token','form':{'grant_type':_0x07bc('0x28'),'client_id':_0x2b72c6[_0x07bc('0x19')],'client_secret':_0x2b72c6['clientSecret'],'redirect_uri':_0x2b72c6[_0x07bc('0xf')],'code':_0x2b72c6[_0x07bc('0x1a')]},'headers':{'Content-Type':_0x07bc('0x29')}};return rp(_0x20183a)['then'](function(_0x5bf505){var _0xd062a4=JSON[_0x07bc('0x1c')](_0x5bf505);if(_0xd062a4[_0x07bc('0x1d')]){_0x2b72c6[_0x07bc('0x1e')]=_0xd062a4[_0x07bc('0x1d')];logger['info'](util[_0x07bc('0x1f')](_0x07bc('0x20'),_0x2b72c6[_0x07bc('0x21')],_0x2b72c6['id']));}else{logger[_0x07bc('0x22')](util[_0x07bc('0x1f')](_0x07bc('0x23'),_0x2b72c6[_0x07bc('0x21')],_0x2b72c6['id']),util[_0x07bc('0x24')](_0xd062a4,{'showHidden':![],'depth':null}));}return _0x505373(null,_0x4d09aa);})[_0x07bc('0x25')](function(_0x3f7075){logger['error'](util[_0x07bc('0x1f')](_0x07bc('0x23'),_0x2b72c6[_0x07bc('0x21')],_0x2b72c6['id']),util[_0x07bc('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x505373(_0x3f7075);});}else{return _0x505373(null,_0x4d09aa);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 0f7e3e2..7dc0c01 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 _0x6ca3=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','then','GetZohoAccount','debug','ShowZohoAccount','find'];(function(_0x1427e5,_0x34526e){var _0x59bb5f=function(_0x353365){while(--_0x353365){_0x1427e5['push'](_0x1427e5['shift']());}};_0x59bb5f(++_0x34526e);}(_0x6ca3,0xba));var _0x36ca=function(_0x114d1f,_0x55548e){_0x114d1f=_0x114d1f-0x0;var _0x5b91d4=_0x6ca3[_0x114d1f];return _0x5b91d4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x36ca('0x0'));var BPromise=require(_0x36ca('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36ca('0x2'));var db=require(_0x36ca('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x36ca('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x36ca('0x5'));var client=jayson[_0x36ca('0x6')][_0x36ca('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4453c2,_0x5996df,_0x5e70ee){return new BPromise(function(_0x1a160c,_0x3c43be){return client['request'](_0x4453c2,_0x5e70ee)['then'](function(_0x14e486){logger[_0x36ca('0x8')](_0x36ca('0x9'),_0x5996df,_0x36ca('0xa'));logger['debug'](_0x36ca('0xb'),_0x5996df,'request\x20sent',JSON[_0x36ca('0xc')](_0x14e486));if(_0x14e486[_0x36ca('0xd')]){if(_0x14e486[_0x36ca('0xd')][_0x36ca('0xe')]===0x1f4){logger[_0x36ca('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x5996df,_0x14e486[_0x36ca('0xd')][_0x36ca('0xf')]);return _0x3c43be(_0x14e486[_0x36ca('0xd')]['message']);}logger[_0x36ca('0xd')](_0x36ca('0x9'),_0x5996df,_0x14e486[_0x36ca('0xd')][_0x36ca('0xf')]);return _0x1a160c(_0x14e486[_0x36ca('0xd')][_0x36ca('0xf')]);}else{logger[_0x36ca('0x8')](_0x36ca('0x9'),_0x5996df,_0x36ca('0xa'));_0x1a160c(_0x14e486['result'][_0x36ca('0xf')]);}})[_0x36ca('0x10')](function(_0x212cb2){logger[_0x36ca('0xd')](_0x36ca('0x9'),_0x5996df,_0x212cb2);_0x3c43be(_0x212cb2);});});}exports['GetZohoAccount']=function(_0x4d136c){var _0x182b07=this;return new Promise(function(_0xd39461,_0x211c42){return db[_0x36ca('0x11')][_0x36ca('0x12')]({'raw':_0x4d136c['options']?_0x4d136c[_0x36ca('0x13')][_0x36ca('0x14')]===undefined?!![]:![]:!![],'where':_0x4d136c[_0x36ca('0x13')]?_0x4d136c[_0x36ca('0x13')][_0x36ca('0x15')]||null:null,'attributes':_0x4d136c[_0x36ca('0x13')]?_0x4d136c[_0x36ca('0x13')][_0x36ca('0x16')]||null:null,'limit':_0x4d136c['options']?_0x4d136c[_0x36ca('0x13')]['limit']||null:null,'include':_0x4d136c[_0x36ca('0x13')]?_0x4d136c[_0x36ca('0x13')][_0x36ca('0x17')]?_[_0x36ca('0x18')](_0x4d136c['options']['include'],function(_0x136dd3){return{'model':db[_0x136dd3[_0x36ca('0x19')]],'as':_0x136dd3['as'],'attributes':_0x136dd3['attributes'],'include':_0x136dd3[_0x36ca('0x17')]?_[_0x36ca('0x18')](_0x136dd3[_0x36ca('0x17')],function(_0x93430f){return{'model':db[_0x93430f[_0x36ca('0x19')]],'as':_0x93430f['as'],'attributes':_0x93430f['attributes'],'include':_0x93430f[_0x36ca('0x17')]?_[_0x36ca('0x18')](_0x93430f[_0x36ca('0x17')],function(_0x4a792e){return{'model':db[_0x4a792e[_0x36ca('0x19')]],'as':_0x4a792e['as'],'attributes':_0x4a792e[_0x36ca('0x16')]};}):[]};}):[]};}):[]:[]})[_0x36ca('0x1a')](function(_0x34cc07){logger[_0x36ca('0x8')](_0x36ca('0x1b'),_0x4d136c);logger[_0x36ca('0x1c')](_0x36ca('0x1b'),_0x4d136c,JSON['stringify'](_0x34cc07));_0xd39461(_0x34cc07);})[_0x36ca('0x10')](function(_0x46782f){logger[_0x36ca('0xd')](_0x36ca('0x1b'),_0x46782f[_0x36ca('0xf')],_0x4d136c);_0x211c42(_0x182b07['error'](0x1f4,_0x46782f[_0x36ca('0xf')]));});});};exports[_0x36ca('0x1d')]=function(_0x55bb12){var _0x33f833=this;return new Promise(function(_0x21efc6,_0x294404){return db[_0x36ca('0x11')][_0x36ca('0x1e')]({'raw':_0x55bb12[_0x36ca('0x13')]?_0x55bb12[_0x36ca('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x55bb12[_0x36ca('0x13')]?_0x55bb12[_0x36ca('0x13')][_0x36ca('0x15')]||null:null,'attributes':_0x55bb12[_0x36ca('0x13')]?_0x55bb12['options']['attributes']||null:null,'include':_0x55bb12['options']?_0x55bb12[_0x36ca('0x13')][_0x36ca('0x17')]?_[_0x36ca('0x18')](_0x55bb12[_0x36ca('0x13')][_0x36ca('0x17')],function(_0x357b6f){return{'model':db[_0x357b6f[_0x36ca('0x19')]],'as':_0x357b6f['as'],'attributes':_0x357b6f[_0x36ca('0x16')],'include':_0x357b6f[_0x36ca('0x17')]?_[_0x36ca('0x18')](_0x357b6f['include'],function(_0x140b84){return{'model':db[_0x140b84['model']],'as':_0x140b84['as'],'attributes':_0x140b84[_0x36ca('0x16')],'include':_0x140b84[_0x36ca('0x17')]?_[_0x36ca('0x18')](_0x140b84[_0x36ca('0x17')],function(_0x459914){return{'model':db[_0x459914[_0x36ca('0x19')]],'as':_0x459914['as'],'attributes':_0x459914[_0x36ca('0x16')]};}):[]};}):[]};}):[]:[]})[_0x36ca('0x1a')](function(_0x3331a6){logger['info'](_0x36ca('0x1d'),_0x55bb12);logger['debug'](_0x36ca('0x1d'),_0x55bb12,JSON[_0x36ca('0xc')](_0x3331a6));_0x21efc6(_0x3331a6);})['catch'](function(_0x5aa8b8){logger[_0x36ca('0xd')]('ShowZohoAccount',_0x5aa8b8[_0x36ca('0xf')],_0x55bb12);_0x294404(_0x33f833[_0x36ca('0xd')](0x1f4,_0x5aa8b8[_0x36ca('0xf')]));});});}; \ No newline at end of file +var _0x5430=['map','model','find','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include'];(function(_0x12d35f,_0x554a51){var _0x355080=function(_0x3c03d2){while(--_0x3c03d2){_0x12d35f['push'](_0x12d35f['shift']());}};_0x355080(++_0x554a51);}(_0x5430,0x10c));var _0x0543=function(_0x13cffe,_0x4c6847){_0x13cffe=_0x13cffe-0x0;var _0x281179=_0x5430[_0x13cffe];return _0x281179;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));var BPromise=require(_0x0543('0x3'));var rs=require(_0x0543('0x4'));var fs=require('fs');var Redis=require(_0x0543('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0543('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0543('0x7'));var client=jayson[_0x0543('0x8')][_0x0543('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x319568,_0x46bca7,_0x5ac352){return new BPromise(function(_0x372974,_0x7b8280){return client[_0x0543('0xa')](_0x319568,_0x5ac352)[_0x0543('0xb')](function(_0x2fb723){logger[_0x0543('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'));logger[_0x0543('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'),JSON[_0x0543('0xf')](_0x2fb723));if(_0x2fb723[_0x0543('0x10')]){if(_0x2fb723[_0x0543('0x10')][_0x0543('0x11')]===0x1f4){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x7b8280(_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);}logger[_0x0543('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x372974(_0x2fb723['error']['message']);}else{logger[_0x0543('0xc')](_0x0543('0x12'),_0x46bca7,_0x0543('0xd'));_0x372974(_0x2fb723[_0x0543('0x14')][_0x0543('0x13')]);}})['catch'](function(_0xe69a3d){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0xe69a3d);_0x7b8280(_0xe69a3d);});});}exports[_0x0543('0x15')]=function(_0x20b396){var _0x285080=this;return new Promise(function(_0x577cf0,_0x5eb03e){return db[_0x0543('0x16')]['findAll']({'raw':_0x20b396['options']?_0x20b396[_0x0543('0x17')][_0x0543('0x18')]===undefined?!![]:![]:!![],'where':_0x20b396[_0x0543('0x17')]?_0x20b396['options'][_0x0543('0x19')]||null:null,'attributes':_0x20b396['options']?_0x20b396[_0x0543('0x17')][_0x0543('0x1a')]||null:null,'limit':_0x20b396['options']?_0x20b396[_0x0543('0x17')][_0x0543('0x1b')]||null:null,'include':_0x20b396[_0x0543('0x17')]?_0x20b396[_0x0543('0x17')][_0x0543('0x1c')]?_[_0x0543('0x1d')](_0x20b396['options']['include'],function(_0x59f1b2){return{'model':db[_0x59f1b2[_0x0543('0x1e')]],'as':_0x59f1b2['as'],'attributes':_0x59f1b2[_0x0543('0x1a')],'include':_0x59f1b2[_0x0543('0x1c')]?_[_0x0543('0x1d')](_0x59f1b2[_0x0543('0x1c')],function(_0x26e500){return{'model':db[_0x26e500[_0x0543('0x1e')]],'as':_0x26e500['as'],'attributes':_0x26e500[_0x0543('0x1a')],'include':_0x26e500[_0x0543('0x1c')]?_[_0x0543('0x1d')](_0x26e500[_0x0543('0x1c')],function(_0x21fc63){return{'model':db[_0x21fc63['model']],'as':_0x21fc63['as'],'attributes':_0x21fc63[_0x0543('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0543('0xb')](function(_0x30ad9e){logger['info'](_0x0543('0x15'),_0x20b396);logger[_0x0543('0xe')](_0x0543('0x15'),_0x20b396,JSON[_0x0543('0xf')](_0x30ad9e));_0x577cf0(_0x30ad9e);})['catch'](function(_0x1732be){logger[_0x0543('0x10')]('GetZohoAccount',_0x1732be['message'],_0x20b396);_0x5eb03e(_0x285080[_0x0543('0x10')](0x1f4,_0x1732be[_0x0543('0x13')]));});});};exports['ShowZohoAccount']=function(_0x3b879b){var _0x2e03d1=this;return new Promise(function(_0x931ccc,_0x2bd6ce){return db[_0x0543('0x16')][_0x0543('0x1f')]({'raw':_0x3b879b[_0x0543('0x17')]?_0x3b879b['options'][_0x0543('0x18')]===undefined?!![]:![]:!![],'where':_0x3b879b['options']?_0x3b879b[_0x0543('0x17')][_0x0543('0x19')]||null:null,'attributes':_0x3b879b[_0x0543('0x17')]?_0x3b879b[_0x0543('0x17')][_0x0543('0x1a')]||null:null,'include':_0x3b879b['options']?_0x3b879b[_0x0543('0x17')]['include']?_[_0x0543('0x1d')](_0x3b879b[_0x0543('0x17')][_0x0543('0x1c')],function(_0x327027){return{'model':db[_0x327027['model']],'as':_0x327027['as'],'attributes':_0x327027[_0x0543('0x1a')],'include':_0x327027['include']?_[_0x0543('0x1d')](_0x327027[_0x0543('0x1c')],function(_0x3fbf5f){return{'model':db[_0x3fbf5f[_0x0543('0x1e')]],'as':_0x3fbf5f['as'],'attributes':_0x3fbf5f[_0x0543('0x1a')],'include':_0x3fbf5f[_0x0543('0x1c')]?_[_0x0543('0x1d')](_0x3fbf5f[_0x0543('0x1c')],function(_0x8ef4d4){return{'model':db[_0x8ef4d4[_0x0543('0x1e')]],'as':_0x8ef4d4['as'],'attributes':_0x8ef4d4['attributes']};}):[]};}):[]};}):[]:[]})[_0x0543('0xb')](function(_0x2d76d6){logger['info'](_0x0543('0x20'),_0x3b879b);logger['debug'](_0x0543('0x20'),_0x3b879b,JSON[_0x0543('0xf')](_0x2d76d6));_0x931ccc(_0x2d76d6);})['catch'](function(_0x5e8800){logger[_0x0543('0x10')](_0x0543('0x20'),_0x5e8800['message'],_0x3b879b);_0x2bd6ce(_0x2e03d1[_0x0543('0x10')](0x1f4,_0x5e8800[_0x0543('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 4251109..f79f298 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 _0x7674=['/:id','isAuthenticated','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0x7674,0x90));var _0x4767=function(_0x4f11cb,_0x14e174){_0x4f11cb=_0x4f11cb-0x0;var _0x491488=_0x7674[_0x4f11cb];return _0x491488;};'use strict';var multer=require(_0x4767('0x0'));var util=require('util');var path=require(_0x4767('0x1'));var timeout=require('connect-timeout');var express=require(_0x4767('0x2'));var router=express[_0x4767('0x3')]();var fs_extra=require(_0x4767('0x4'));var auth=require(_0x4767('0x5'));var interaction=require(_0x4767('0x6'));var config=require(_0x4767('0x7'));var controller=require(_0x4767('0x8'));router[_0x4767('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4767('0x9')](_0x4767('0xa'),auth[_0x4767('0xb')](),controller['show']);router[_0x4767('0x9')](_0x4767('0xc'),auth[_0x4767('0xb')](),controller[_0x4767('0xd')]);router[_0x4767('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x4767('0xe'),auth[_0x4767('0xb')](),controller[_0x4767('0xf')]);router[_0x4767('0x10')]('/',auth[_0x4767('0xb')](),controller[_0x4767('0x11')]);router[_0x4767('0x12')](_0x4767('0xa'),auth[_0x4767('0xb')](),controller[_0x4767('0x13')]);router[_0x4767('0x14')](_0x4767('0xa'),auth['isAuthenticated'](),controller[_0x4767('0x15')]);module['exports']=router; \ No newline at end of file +var _0xcb1f=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','exports','multer'];(function(_0x348015,_0x413c2c){var _0x57e539=function(_0x40e790){while(--_0x40e790){_0x348015['push'](_0x348015['shift']());}};_0x57e539(++_0x413c2c);}(_0xcb1f,0x107));var _0xfcb1=function(_0x4a49d8,_0x405a65){_0x4a49d8=_0x4a49d8-0x0;var _0xb197ff=_0xcb1f[_0x4a49d8];return _0xb197ff;};'use strict';var multer=require(_0xfcb1('0x0'));var util=require(_0xfcb1('0x1'));var path=require(_0xfcb1('0x2'));var timeout=require(_0xfcb1('0x3'));var express=require('express');var router=express[_0xfcb1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfcb1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfcb1('0x6'));var controller=require(_0xfcb1('0x7'));router[_0xfcb1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfcb1('0x8')](_0xfcb1('0x9'),auth[_0xfcb1('0xa')](),controller[_0xfcb1('0xb')]);router[_0xfcb1('0x8')](_0xfcb1('0xc'),auth[_0xfcb1('0xa')](),controller[_0xfcb1('0xd')]);router[_0xfcb1('0x8')]('/:id/subjects',auth[_0xfcb1('0xa')](),controller[_0xfcb1('0xe')]);router[_0xfcb1('0x8')](_0xfcb1('0xf'),auth['isAuthenticated'](),controller[_0xfcb1('0x10')]);router[_0xfcb1('0x11')]('/',auth[_0xfcb1('0xa')](),controller[_0xfcb1('0x12')]);router[_0xfcb1('0x13')](_0xfcb1('0x9'),auth[_0xfcb1('0xa')](),controller['update']);router[_0xfcb1('0x14')](_0xfcb1('0x9'),auth[_0xfcb1('0xa')](),controller['destroy']);module[_0xfcb1('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 88e42bc..f469426 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 _0x459d=['sequelize','exports','STRING','ENUM','lead','contact','contact_lead'];(function(_0x4112c9,_0x59a81d){var _0x1ab736=function(_0x182d3b){while(--_0x182d3b){_0x4112c9['push'](_0x4112c9['shift']());}};_0x1ab736(++_0x59a81d);}(_0x459d,0xd9));var _0xd459=function(_0x40e732,_0x298ec9){_0x40e732=_0x40e732-0x0;var _0x17d868=_0x459d[_0x40e732];return _0x17d868;};'use strict';var Sequelize=require(_0xd459('0x0'));module[_0xd459('0x1')]={'name':{'type':Sequelize[_0xd459('0x2')]},'moduleCreate':{'type':Sequelize[_0xd459('0x3')](_0xd459('0x4'),_0xd459('0x5'),'nothing'),'defaultValue':_0xd459('0x4')},'moduleSearch':{'type':Sequelize[_0xd459('0x3')](_0xd459('0x6'),_0xd459('0x5'),_0xd459('0x4')),'defaultValue':_0xd459('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5ec3=['STRING','sequelize','exports','ENUM','lead','contact','nothing','contact_lead'];(function(_0x36bab9,_0x13d26b){var _0x2b51cc=function(_0x197859){while(--_0x197859){_0x36bab9['push'](_0x36bab9['shift']());}};_0x2b51cc(++_0x13d26b);}(_0x5ec3,0xa1));var _0x35ec=function(_0x555378,_0x414fab){_0x555378=_0x555378-0x0;var _0x5f3375=_0x5ec3[_0x555378];return _0x5f3375;};'use strict';var Sequelize=require(_0x35ec('0x0'));module[_0x35ec('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x35ec('0x2')](_0x35ec('0x3'),_0x35ec('0x4'),_0x35ec('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x35ec('0x2')](_0x35ec('0x6'),_0x35ec('0x4'),_0x35ec('0x3')),'defaultValue':_0x35ec('0x6')},'description':{'type':Sequelize[_0x35ec('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 16308e6..fae3588 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 _0x994c=['include','rows','catch','show','params','find','create','body','findOne','ZohoField','order','filter','hasOwnProperty','getFields','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','options','ZohoConfiguration','includeAll'];(function(_0x53e7f4,_0x7709ce){var _0x17b660=function(_0x1d9352){while(--_0x1d9352){_0x53e7f4['push'](_0x53e7f4['shift']());}};_0x17b660(++_0x7709ce);}(_0x994c,0xfe));var _0xc994=function(_0x5d9465,_0x257fdd){_0x5d9465=_0x5d9465-0x0;var _0xeda10e=_0x994c[_0x5d9465];return _0xeda10e;};'use strict';var emlformat=require(_0xc994('0x0'));var rimraf=require(_0xc994('0x1'));var zipdir=require(_0xc994('0x2'));var jsonpatch=require(_0xc994('0x3'));var rp=require(_0xc994('0x4'));var moment=require(_0xc994('0x5'));var BPromise=require(_0xc994('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc994('0x7'));var sox=require(_0xc994('0x8'));var csv=require(_0xc994('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc994('0xa'));var _=require(_0xc994('0xb'));var squel=require('squel');var crypto=require(_0xc994('0xc'));var jsforce=require(_0xc994('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc994('0x9'));var querystring=require(_0xc994('0xe'));var Papa=require(_0xc994('0xf'));var Redis=require('ioredis');var authService=require(_0xc994('0x10'));var qs=require(_0xc994('0x11'));var as=require(_0xc994('0x12'));var hardwareService=require(_0xc994('0x13'));var logger=require(_0xc994('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc994('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc994('0x16'))['db'];function respondWithStatusCode(_0x398b3f,_0x414a){_0x414a=_0x414a||0xcc;return function(_0x3dffc9){if(_0x3dffc9){return _0x398b3f[_0xc994('0x17')](_0x414a);}return _0x398b3f['status'](_0x414a)[_0xc994('0x18')]();};}function respondWithResult(_0x100e9e,_0x1d53cd){_0x1d53cd=_0x1d53cd||0xc8;return function(_0x28e8f2){if(_0x28e8f2){return _0x100e9e[_0xc994('0x19')](_0x1d53cd)[_0xc994('0x1a')](_0x28e8f2);}};}function respondWithFilteredResult(_0x5091a9,_0x6e1407){return function(_0x16945b){if(_0x16945b){var _0x3c052d=typeof _0x6e1407[_0xc994('0x1b')]===_0xc994('0x1c')&&typeof _0x6e1407[_0xc994('0x1d')]==='undefined';var _0x26adc5=_0x16945b[_0xc994('0x1e')];var _0x197ebb=_0x3c052d?0x0:_0x6e1407[_0xc994('0x1b')];var _0x421a5b=_0x3c052d?_0x16945b['count']:_0x6e1407['offset']+_0x6e1407['limit'];var _0x2ceb16;if(_0x421a5b>=_0x26adc5){_0x421a5b=_0x26adc5;_0x2ceb16=0xc8;}else{_0x2ceb16=0xce;}_0x5091a9[_0xc994('0x19')](_0x2ceb16);return _0x5091a9[_0xc994('0x1f')](_0xc994('0x20'),_0x197ebb+'-'+_0x421a5b+'/'+_0x26adc5)[_0xc994('0x1a')](_0x16945b);}return null;};}function patchUpdates(_0x1167c8){return function(_0x2710b0){try{jsonpatch[_0xc994('0x21')](_0x2710b0,_0x1167c8,!![]);}catch(_0x1fc294){return BPromise[_0xc994('0x22')](_0x1fc294);}return _0x2710b0['save']();};}function saveUpdates(_0x26a13a,_0x4f1090){return function(_0x27785b){if(_0x27785b){return _0x27785b[_0xc994('0x23')](_0x26a13a)[_0xc994('0x24')](function(_0x50adae){return _0x50adae;});}return null;};}function removeEntity(_0x38094e,_0x1213ce){return function(_0x184051){if(_0x184051){return _0x184051[_0xc994('0x25')]()[_0xc994('0x24')](function(){_0x38094e[_0xc994('0x19')](0xcc)[_0xc994('0x18')]();});}};}function handleEntityNotFound(_0x25e675,_0x2d6336){return function(_0x2c7666){if(!_0x2c7666){_0x25e675['sendStatus'](0x194);}return _0x2c7666;};}function handleError(_0x1a4720,_0x201d5e){_0x201d5e=_0x201d5e||0x1f4;return function(_0x495bd8){logger[_0xc994('0x26')](_0x495bd8[_0xc994('0x27')]);if(_0x495bd8[_0xc994('0x28')]){delete _0x495bd8['name'];}_0x1a4720[_0xc994('0x19')](_0x201d5e)['send'](_0x495bd8);};}exports[_0xc994('0x29')]=function(_0x217563,_0x4188f5){var _0x33aafa={},_0x2484fc={},_0x27ee8a={'count':0x0,'rows':[]};var _0x26ae70=_[_0xc994('0x2a')](db['ZohoConfiguration'][_0xc994('0x2b')],function(_0x29d34f){return{'name':_0x29d34f[_0xc994('0x2c')],'type':_0x29d34f[_0xc994('0x2d')]['key']};});_0x2484fc[_0xc994('0x2e')]=_['map'](_0x26ae70,'name');_0x2484fc[_0xc994('0x2f')]=_[_0xc994('0x30')](_0x217563[_0xc994('0x2f')]);_0x2484fc[_0xc994('0x31')]=_[_0xc994('0x32')](_0x2484fc[_0xc994('0x2e')],_0x2484fc[_0xc994('0x2f')]);_0x33aafa[_0xc994('0x33')]=_[_0xc994('0x32')](_0x2484fc[_0xc994('0x2e')],qs[_0xc994('0x34')](_0x217563[_0xc994('0x2f')][_0xc994('0x34')]));_0x33aafa[_0xc994('0x33')]=_0x33aafa[_0xc994('0x33')][_0xc994('0x35')]?_0x33aafa[_0xc994('0x33')]:_0x2484fc['model'];if(!_0x217563[_0xc994('0x2f')]['hasOwnProperty'](_0xc994('0x36'))){_0x33aafa[_0xc994('0x1d')]=qs['limit'](_0x217563[_0xc994('0x2f')][_0xc994('0x1d')]);_0x33aafa['offset']=qs[_0xc994('0x1b')](_0x217563[_0xc994('0x2f')][_0xc994('0x1b')]);}_0x33aafa['order']=qs[_0xc994('0x37')](_0x217563['query'][_0xc994('0x37')]);_0x33aafa['where']=qs['filters'](_['pick'](_0x217563[_0xc994('0x2f')],_0x2484fc[_0xc994('0x31')]),_0x26ae70);if(_0x217563[_0xc994('0x2f')]['filter']){_0x33aafa[_0xc994('0x38')]=_[_0xc994('0x39')](_0x33aafa['where'],{'$or':_['map'](_0x26ae70,function(_0x46210d){if(_0x46210d['type']!==_0xc994('0x3a')){var _0x191438={};_0x191438[_0x46210d[_0xc994('0x28')]]={'$like':'%'+_0x217563['query']['filter']+'%'};return _0x191438;}})});}_0x33aafa=_[_0xc994('0x39')]({},_0x33aafa,_0x217563[_0xc994('0x3b')]);var _0x1985b8={'where':_0x33aafa[_0xc994('0x38')]};return db[_0xc994('0x3c')][_0xc994('0x1e')](_0x1985b8)['then'](function(_0x2fa14b){_0x27ee8a[_0xc994('0x1e')]=_0x2fa14b;if(_0x217563[_0xc994('0x2f')][_0xc994('0x3d')]){_0x33aafa[_0xc994('0x3e')]=[{'all':!![]}];}return db[_0xc994('0x3c')]['findAll'](_0x33aafa);})['then'](function(_0x222eb2){_0x27ee8a[_0xc994('0x3f')]=_0x222eb2;return _0x27ee8a;})[_0xc994('0x24')](respondWithFilteredResult(_0x4188f5,_0x33aafa))[_0xc994('0x40')](handleError(_0x4188f5,null));};exports[_0xc994('0x41')]=function(_0x3132e5,_0x259efb){var _0xdf9398={'raw':![],'where':{'id':_0x3132e5[_0xc994('0x42')]['id']}},_0x2b45e3={};_0x2b45e3[_0xc994('0x2e')]=_[_0xc994('0x30')](db[_0xc994('0x3c')][_0xc994('0x2b')]);_0x2b45e3[_0xc994('0x2f')]=_['keys'](_0x3132e5[_0xc994('0x2f')]);_0x2b45e3[_0xc994('0x31')]=_[_0xc994('0x32')](_0x2b45e3['model'],_0x2b45e3[_0xc994('0x2f')]);_0xdf9398['attributes']=_[_0xc994('0x32')](_0x2b45e3[_0xc994('0x2e')],qs[_0xc994('0x34')](_0x3132e5[_0xc994('0x2f')][_0xc994('0x34')]));_0xdf9398[_0xc994('0x33')]=_0xdf9398[_0xc994('0x33')][_0xc994('0x35')]?_0xdf9398['attributes']:_0x2b45e3['model'];if(_0x3132e5[_0xc994('0x2f')][_0xc994('0x3d')]){_0xdf9398[_0xc994('0x3e')]=[{'all':!![]}];}_0xdf9398=_[_0xc994('0x39')]({},_0xdf9398,_0x3132e5[_0xc994('0x3b')]);return db['ZohoConfiguration'][_0xc994('0x43')](_0xdf9398)['then'](handleEntityNotFound(_0x259efb,null))[_0xc994('0x24')](respondWithResult(_0x259efb,null))['catch'](handleError(_0x259efb,null));};exports['create']=function(_0x409697,_0x19dacf){return db[_0xc994('0x3c')][_0xc994('0x44')](_0x409697[_0xc994('0x45')],{})['then'](respondWithResult(_0x19dacf,0xc9))[_0xc994('0x40')](handleError(_0x19dacf,null));};exports['update']=function(_0x38450a,_0x3af92d){if(_0x38450a[_0xc994('0x45')]['id']){delete _0x38450a[_0xc994('0x45')]['id'];}return db[_0xc994('0x3c')]['find']({'where':{'id':_0x38450a[_0xc994('0x42')]['id']}})[_0xc994('0x24')](handleEntityNotFound(_0x3af92d,null))[_0xc994('0x24')](saveUpdates(_0x38450a['body'],null))[_0xc994('0x24')](respondWithResult(_0x3af92d,null))[_0xc994('0x40')](handleError(_0x3af92d,null));};exports[_0xc994('0x25')]=function(_0x250572,_0x46a9a8){return db[_0xc994('0x3c')][_0xc994('0x43')]({'where':{'id':_0x250572[_0xc994('0x42')]['id']}})['then'](handleEntityNotFound(_0x46a9a8,null))['then'](removeEntity(_0x46a9a8,null))[_0xc994('0x40')](handleError(_0x46a9a8,null));};exports['getFields']=function(_0x3ebb79,_0x5a094d,_0x28b0c6){var _0x3bea0e={};var _0x3fe513={};var _0x14942a;var _0x3fb3af;return db[_0xc994('0x3c')][_0xc994('0x46')]({'where':{'id':_0x3ebb79[_0xc994('0x42')]['id']}})['then'](handleEntityNotFound(_0x5a094d,null))[_0xc994('0x24')](function(_0x3da412){if(_0x3da412){_0x14942a=_0x3da412;_0x3fe513[_0xc994('0x2e')]=_[_0xc994('0x30')](db[_0xc994('0x47')][_0xc994('0x2b')]);_0x3fe513[_0xc994('0x2f')]=_[_0xc994('0x30')](_0x3ebb79[_0xc994('0x2f')]);_0x3fe513[_0xc994('0x31')]=_[_0xc994('0x32')](_0x3fe513[_0xc994('0x2e')],_0x3fe513[_0xc994('0x2f')]);_0x3bea0e[_0xc994('0x33')]=_['intersection'](_0x3fe513[_0xc994('0x2e')],qs[_0xc994('0x34')](_0x3ebb79[_0xc994('0x2f')]['fields']));_0x3bea0e['attributes']=_0x3bea0e[_0xc994('0x33')][_0xc994('0x35')]?_0x3bea0e[_0xc994('0x33')]:_0x3fe513[_0xc994('0x2e')];_0x3bea0e[_0xc994('0x48')]=qs[_0xc994('0x37')](_0x3ebb79[_0xc994('0x2f')][_0xc994('0x37')]);_0x3bea0e['where']=qs[_0xc994('0x31')](_['pick'](_0x3ebb79[_0xc994('0x2f')],_0x3fe513[_0xc994('0x31')]));if(_0x3ebb79[_0xc994('0x2f')][_0xc994('0x49')]){_0x3bea0e[_0xc994('0x38')]=_[_0xc994('0x39')](_0x3bea0e[_0xc994('0x38')],{'$or':_[_0xc994('0x2a')](_0x3bea0e[_0xc994('0x33')],function(_0x322899){var _0x4c2400={};_0x4c2400[_0x322899]={'$like':'%'+_0x3ebb79[_0xc994('0x2f')][_0xc994('0x49')]+'%'};return _0x4c2400;})});}_0x3bea0e=_[_0xc994('0x39')]({},_0x3bea0e,_0x3ebb79[_0xc994('0x3b')]);return _0x14942a['getFields'](_0x3bea0e);}})['then'](function(_0x54a500){if(_0x54a500){_0x3fb3af=_0x54a500[_0xc994('0x35')];if(!_0x3ebb79[_0xc994('0x2f')][_0xc994('0x4a')]('nolimit')){_0x3bea0e[_0xc994('0x1d')]=qs[_0xc994('0x1d')](_0x3ebb79[_0xc994('0x2f')]['limit']);_0x3bea0e[_0xc994('0x1b')]=qs['offset'](_0x3ebb79['query']['offset']);}return _0x14942a[_0xc994('0x4b')](_0x3bea0e);}})[_0xc994('0x24')](function(_0x58298e){if(_0x58298e){return _0x58298e?{'count':_0x3fb3af,'rows':_0x58298e}:null;}})['then'](respondWithResult(_0x5a094d,null))[_0xc994('0x40')](handleError(_0x5a094d,null));};exports['getSubjects']=function(_0x4af8a0,_0x51f5d1,_0x56e3e4){var _0x4a9e86={};var _0x143559={};var _0x13e2da;var _0x5bccfd;return db[_0xc994('0x3c')][_0xc994('0x46')]({'where':{'id':_0x4af8a0[_0xc994('0x42')]['id']}})['then'](handleEntityNotFound(_0x51f5d1,null))['then'](function(_0x24fe57){if(_0x24fe57){_0x13e2da=_0x24fe57;_0x143559['model']=_[_0xc994('0x30')](db[_0xc994('0x47')][_0xc994('0x2b')]);_0x143559[_0xc994('0x2f')]=_['keys'](_0x4af8a0[_0xc994('0x2f')]);_0x143559['filters']=_[_0xc994('0x32')](_0x143559['model'],_0x143559[_0xc994('0x2f')]);_0x4a9e86['attributes']=_['intersection'](_0x143559[_0xc994('0x2e')],qs[_0xc994('0x34')](_0x4af8a0['query'][_0xc994('0x34')]));_0x4a9e86[_0xc994('0x33')]=_0x4a9e86[_0xc994('0x33')][_0xc994('0x35')]?_0x4a9e86[_0xc994('0x33')]:_0x143559[_0xc994('0x2e')];_0x4a9e86[_0xc994('0x48')]=qs[_0xc994('0x37')](_0x4af8a0['query']['sort']);_0x4a9e86[_0xc994('0x38')]=qs[_0xc994('0x31')](_[_0xc994('0x4c')](_0x4af8a0[_0xc994('0x2f')],_0x143559[_0xc994('0x31')]));if(_0x4af8a0[_0xc994('0x2f')][_0xc994('0x49')]){_0x4a9e86['where']=_['merge'](_0x4a9e86['where'],{'$or':_[_0xc994('0x2a')](_0x4a9e86[_0xc994('0x33')],function(_0x515d45){var _0x5b8f12={};_0x5b8f12[_0x515d45]={'$like':'%'+_0x4af8a0[_0xc994('0x2f')][_0xc994('0x49')]+'%'};return _0x5b8f12;})});}_0x4a9e86=_[_0xc994('0x39')]({},_0x4a9e86,_0x4af8a0[_0xc994('0x3b')]);return _0x13e2da[_0xc994('0x4d')](_0x4a9e86);}})['then'](function(_0x104669){if(_0x104669){_0x5bccfd=_0x104669['length'];if(!_0x4af8a0['query']['hasOwnProperty'](_0xc994('0x36'))){_0x4a9e86['limit']=qs[_0xc994('0x1d')](_0x4af8a0['query'][_0xc994('0x1d')]);_0x4a9e86['offset']=qs[_0xc994('0x1b')](_0x4af8a0['query'][_0xc994('0x1b')]);}return _0x13e2da['getSubjects'](_0x4a9e86);}})[_0xc994('0x24')](function(_0xff6a55){if(_0xff6a55){return _0xff6a55?{'count':_0x5bccfd,'rows':_0xff6a55}:null;}})[_0xc994('0x24')](respondWithResult(_0x51f5d1,null))[_0xc994('0x40')](handleError(_0x51f5d1,null));};exports[_0xc994('0x4e')]=function(_0x18b8fc,_0x15a858,_0x491e35){var _0x7baafc={};var _0x2d38ca={};var _0x305e7a;var _0x3faef5;return db[_0xc994('0x3c')]['findOne']({'where':{'id':_0x18b8fc['params']['id']}})[_0xc994('0x24')](handleEntityNotFound(_0x15a858,null))[_0xc994('0x24')](function(_0x413546){if(_0x413546){_0x305e7a=_0x413546;_0x2d38ca['model']=_[_0xc994('0x30')](db[_0xc994('0x47')]['rawAttributes']);_0x2d38ca[_0xc994('0x2f')]=_[_0xc994('0x30')](_0x18b8fc[_0xc994('0x2f')]);_0x2d38ca[_0xc994('0x31')]=_[_0xc994('0x32')](_0x2d38ca[_0xc994('0x2e')],_0x2d38ca[_0xc994('0x2f')]);_0x7baafc[_0xc994('0x33')]=_[_0xc994('0x32')](_0x2d38ca['model'],qs[_0xc994('0x34')](_0x18b8fc[_0xc994('0x2f')][_0xc994('0x34')]));_0x7baafc[_0xc994('0x33')]=_0x7baafc[_0xc994('0x33')][_0xc994('0x35')]?_0x7baafc[_0xc994('0x33')]:_0x2d38ca[_0xc994('0x2e')];_0x7baafc[_0xc994('0x48')]=qs[_0xc994('0x37')](_0x18b8fc[_0xc994('0x2f')]['sort']);_0x7baafc[_0xc994('0x38')]=qs['filters'](_[_0xc994('0x4c')](_0x18b8fc[_0xc994('0x2f')],_0x2d38ca['filters']));if(_0x18b8fc[_0xc994('0x2f')][_0xc994('0x49')]){_0x7baafc['where']=_[_0xc994('0x39')](_0x7baafc[_0xc994('0x38')],{'$or':_[_0xc994('0x2a')](_0x7baafc[_0xc994('0x33')],function(_0x3364ce){var _0x4b5309={};_0x4b5309[_0x3364ce]={'$like':'%'+_0x18b8fc[_0xc994('0x2f')][_0xc994('0x49')]+'%'};return _0x4b5309;})});}_0x7baafc=_[_0xc994('0x39')]({},_0x7baafc,_0x18b8fc[_0xc994('0x3b')]);return _0x305e7a['getDescriptions'](_0x7baafc);}})['then'](function(_0xc6d0ee){if(_0xc6d0ee){_0x3faef5=_0xc6d0ee[_0xc994('0x35')];if(!_0x18b8fc[_0xc994('0x2f')][_0xc994('0x4a')](_0xc994('0x36'))){_0x7baafc[_0xc994('0x1d')]=qs[_0xc994('0x1d')](_0x18b8fc[_0xc994('0x2f')][_0xc994('0x1d')]);_0x7baafc[_0xc994('0x1b')]=qs[_0xc994('0x1b')](_0x18b8fc[_0xc994('0x2f')][_0xc994('0x1b')]);}return _0x305e7a[_0xc994('0x4e')](_0x7baafc);}})['then'](function(_0x3073d2){if(_0x3073d2){return _0x3073d2?{'count':_0x3faef5,'rows':_0x3073d2}:null;}})[_0xc994('0x24')](respondWithResult(_0x15a858,null))[_0xc994('0x40')](handleError(_0x15a858,null));}; \ No newline at end of file +var _0x9073=['status','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','ZohoConfiguration','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','findOne','ZohoField','hasOwnProperty','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x2840fd,_0x58b53b){var _0x54bfc5=function(_0x132811){while(--_0x132811){_0x2840fd['push'](_0x2840fd['shift']());}};_0x54bfc5(++_0x58b53b);}(_0x9073,0x1bc));var _0x3907=function(_0x525513,_0x44220c){_0x525513=_0x525513-0x0;var _0x17f77f=_0x9073[_0x525513];return _0x17f77f;};'use strict';var emlformat=require(_0x3907('0x0'));var rimraf=require(_0x3907('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3907('0x2'));var rp=require(_0x3907('0x3'));var moment=require(_0x3907('0x4'));var BPromise=require(_0x3907('0x5'));var Mustache=require(_0x3907('0x6'));var util=require(_0x3907('0x7'));var path=require(_0x3907('0x8'));var sox=require('sox');var csv=require(_0x3907('0x9'));var ejs=require(_0x3907('0xa'));var fs=require('fs');var fs_extra=require(_0x3907('0xb'));var _=require(_0x3907('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3907('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3907('0x9'));var querystring=require(_0x3907('0xe'));var Papa=require(_0x3907('0xf'));var Redis=require(_0x3907('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3907('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3907('0x12'))(_0x3907('0x13'));var utils=require('../../config/utils');var config=require(_0x3907('0x14'));var licenseUtil=require(_0x3907('0x15'));var db=require(_0x3907('0x16'))['db'];function respondWithStatusCode(_0x403e5f,_0x507bb8){_0x507bb8=_0x507bb8||0xcc;return function(_0x2c85b9){if(_0x2c85b9){return _0x403e5f[_0x3907('0x17')](_0x507bb8);}return _0x403e5f[_0x3907('0x18')](_0x507bb8)['end']();};}function respondWithResult(_0x2d1bd4,_0x3134a5){_0x3134a5=_0x3134a5||0xc8;return function(_0x4ba051){if(_0x4ba051){return _0x2d1bd4[_0x3907('0x18')](_0x3134a5)['json'](_0x4ba051);}};}function respondWithFilteredResult(_0x369a34,_0x39c312){return function(_0x4ed8a2){if(_0x4ed8a2){var _0x509aa8=typeof _0x39c312['offset']===_0x3907('0x19')&&typeof _0x39c312['limit']===_0x3907('0x19');var _0x2c60b2=_0x4ed8a2[_0x3907('0x1a')];var _0x5b6728=_0x509aa8?0x0:_0x39c312[_0x3907('0x1b')];var _0x12bb9f=_0x509aa8?_0x4ed8a2[_0x3907('0x1a')]:_0x39c312[_0x3907('0x1b')]+_0x39c312[_0x3907('0x1c')];var _0x25ae86;if(_0x12bb9f>=_0x2c60b2){_0x12bb9f=_0x2c60b2;_0x25ae86=0xc8;}else{_0x25ae86=0xce;}_0x369a34[_0x3907('0x18')](_0x25ae86);return _0x369a34[_0x3907('0x1d')]('Content-Range',_0x5b6728+'-'+_0x12bb9f+'/'+_0x2c60b2)[_0x3907('0x1e')](_0x4ed8a2);}return null;};}function patchUpdates(_0x235caa){return function(_0x431156){try{jsonpatch[_0x3907('0x1f')](_0x431156,_0x235caa,!![]);}catch(_0x4ac552){return BPromise[_0x3907('0x20')](_0x4ac552);}return _0x431156[_0x3907('0x21')]();};}function saveUpdates(_0x11beb7,_0x21c287){return function(_0x295141){if(_0x295141){return _0x295141[_0x3907('0x22')](_0x11beb7)[_0x3907('0x23')](function(_0x4fcfe3){return _0x4fcfe3;});}return null;};}function removeEntity(_0x15bc00,_0x1bde35){return function(_0x1e47c9){if(_0x1e47c9){return _0x1e47c9[_0x3907('0x24')]()[_0x3907('0x23')](function(){_0x15bc00['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc056ce,_0x953c98){return function(_0x22e2c8){if(!_0x22e2c8){_0xc056ce['sendStatus'](0x194);}return _0x22e2c8;};}function handleError(_0x5dbae5,_0x1d974f){_0x1d974f=_0x1d974f||0x1f4;return function(_0x668b96){logger[_0x3907('0x25')](_0x668b96['stack']);if(_0x668b96[_0x3907('0x26')]){delete _0x668b96['name'];}_0x5dbae5[_0x3907('0x18')](_0x1d974f)[_0x3907('0x27')](_0x668b96);};}exports['index']=function(_0x1c5425,_0x569de1){var _0x2b26ab={},_0x348212={},_0x271d2c={'count':0x0,'rows':[]};var _0x7061f0=_[_0x3907('0x28')](db['ZohoConfiguration'][_0x3907('0x29')],function(_0x559ab0){return{'name':_0x559ab0[_0x3907('0x2a')],'type':_0x559ab0[_0x3907('0x2b')]['key']};});_0x348212[_0x3907('0x2c')]=_[_0x3907('0x28')](_0x7061f0,_0x3907('0x26'));_0x348212['query']=_[_0x3907('0x2d')](_0x1c5425[_0x3907('0x2e')]);_0x348212[_0x3907('0x2f')]=_[_0x3907('0x30')](_0x348212[_0x3907('0x2c')],_0x348212[_0x3907('0x2e')]);_0x2b26ab[_0x3907('0x31')]=_[_0x3907('0x30')](_0x348212[_0x3907('0x2c')],qs['fields'](_0x1c5425[_0x3907('0x2e')][_0x3907('0x32')]));_0x2b26ab['attributes']=_0x2b26ab[_0x3907('0x31')][_0x3907('0x33')]?_0x2b26ab['attributes']:_0x348212['model'];if(!_0x1c5425['query']['hasOwnProperty'](_0x3907('0x34'))){_0x2b26ab['limit']=qs[_0x3907('0x1c')](_0x1c5425[_0x3907('0x2e')][_0x3907('0x1c')]);_0x2b26ab[_0x3907('0x1b')]=qs[_0x3907('0x1b')](_0x1c5425['query'][_0x3907('0x1b')]);}_0x2b26ab[_0x3907('0x35')]=qs[_0x3907('0x36')](_0x1c5425[_0x3907('0x2e')][_0x3907('0x36')]);_0x2b26ab['where']=qs[_0x3907('0x2f')](_[_0x3907('0x37')](_0x1c5425['query'],_0x348212['filters']),_0x7061f0);if(_0x1c5425[_0x3907('0x2e')][_0x3907('0x38')]){_0x2b26ab[_0x3907('0x39')]=_[_0x3907('0x3a')](_0x2b26ab[_0x3907('0x39')],{'$or':_[_0x3907('0x28')](_0x7061f0,function(_0x4120b7){if(_0x4120b7[_0x3907('0x2b')]!==_0x3907('0x3b')){var _0x1a7b67={};_0x1a7b67[_0x4120b7[_0x3907('0x26')]]={'$like':'%'+_0x1c5425[_0x3907('0x2e')][_0x3907('0x38')]+'%'};return _0x1a7b67;}})});}_0x2b26ab=_['merge']({},_0x2b26ab,_0x1c5425['options']);var _0x5d3399={'where':_0x2b26ab[_0x3907('0x39')]};return db[_0x3907('0x3c')]['count'](_0x5d3399)[_0x3907('0x23')](function(_0x49408b){_0x271d2c[_0x3907('0x1a')]=_0x49408b;if(_0x1c5425[_0x3907('0x2e')][_0x3907('0x3d')]){_0x2b26ab['include']=[{'all':!![]}];}return db[_0x3907('0x3c')][_0x3907('0x3e')](_0x2b26ab);})[_0x3907('0x23')](function(_0x221559){_0x271d2c[_0x3907('0x3f')]=_0x221559;return _0x271d2c;})['then'](respondWithFilteredResult(_0x569de1,_0x2b26ab))[_0x3907('0x40')](handleError(_0x569de1,null));};exports[_0x3907('0x41')]=function(_0xd5a3c8,_0x3affd2){var _0x5530b9={'raw':![],'where':{'id':_0xd5a3c8[_0x3907('0x42')]['id']}},_0x4a655b={};_0x4a655b[_0x3907('0x2c')]=_[_0x3907('0x2d')](db[_0x3907('0x3c')]['rawAttributes']);_0x4a655b[_0x3907('0x2e')]=_[_0x3907('0x2d')](_0xd5a3c8[_0x3907('0x2e')]);_0x4a655b[_0x3907('0x2f')]=_[_0x3907('0x30')](_0x4a655b[_0x3907('0x2c')],_0x4a655b[_0x3907('0x2e')]);_0x5530b9[_0x3907('0x31')]=_['intersection'](_0x4a655b[_0x3907('0x2c')],qs[_0x3907('0x32')](_0xd5a3c8[_0x3907('0x2e')][_0x3907('0x32')]));_0x5530b9[_0x3907('0x31')]=_0x5530b9[_0x3907('0x31')][_0x3907('0x33')]?_0x5530b9[_0x3907('0x31')]:_0x4a655b[_0x3907('0x2c')];if(_0xd5a3c8[_0x3907('0x2e')]['includeAll']){_0x5530b9[_0x3907('0x43')]=[{'all':!![]}];}_0x5530b9=_[_0x3907('0x3a')]({},_0x5530b9,_0xd5a3c8[_0x3907('0x44')]);return db[_0x3907('0x3c')][_0x3907('0x45')](_0x5530b9)[_0x3907('0x23')](handleEntityNotFound(_0x3affd2,null))[_0x3907('0x23')](respondWithResult(_0x3affd2,null))['catch'](handleError(_0x3affd2,null));};exports[_0x3907('0x46')]=function(_0x19f8e3,_0x46d3de){return db['ZohoConfiguration']['create'](_0x19f8e3['body'],{})[_0x3907('0x23')](respondWithResult(_0x46d3de,0xc9))['catch'](handleError(_0x46d3de,null));};exports['update']=function(_0x4af532,_0x14504e){if(_0x4af532[_0x3907('0x47')]['id']){delete _0x4af532[_0x3907('0x47')]['id'];}return db[_0x3907('0x3c')]['find']({'where':{'id':_0x4af532[_0x3907('0x42')]['id']}})[_0x3907('0x23')](handleEntityNotFound(_0x14504e,null))['then'](saveUpdates(_0x4af532[_0x3907('0x47')],null))[_0x3907('0x23')](respondWithResult(_0x14504e,null))[_0x3907('0x40')](handleError(_0x14504e,null));};exports['destroy']=function(_0x19e02e,_0x343937){return db['ZohoConfiguration'][_0x3907('0x45')]({'where':{'id':_0x19e02e[_0x3907('0x42')]['id']}})[_0x3907('0x23')](handleEntityNotFound(_0x343937,null))[_0x3907('0x23')](removeEntity(_0x343937,null))['catch'](handleError(_0x343937,null));};exports['getFields']=function(_0x1aac89,_0x2d2ecc,_0x546e96){var _0x5af94e={};var _0x3514ef={};var _0x5e5e4f;var _0x3f78c8;return db[_0x3907('0x3c')][_0x3907('0x48')]({'where':{'id':_0x1aac89[_0x3907('0x42')]['id']}})[_0x3907('0x23')](handleEntityNotFound(_0x2d2ecc,null))['then'](function(_0x5093cc){if(_0x5093cc){_0x5e5e4f=_0x5093cc;_0x3514ef[_0x3907('0x2c')]=_[_0x3907('0x2d')](db[_0x3907('0x49')][_0x3907('0x29')]);_0x3514ef[_0x3907('0x2e')]=_[_0x3907('0x2d')](_0x1aac89['query']);_0x3514ef['filters']=_['intersection'](_0x3514ef[_0x3907('0x2c')],_0x3514ef[_0x3907('0x2e')]);_0x5af94e[_0x3907('0x31')]=_['intersection'](_0x3514ef[_0x3907('0x2c')],qs[_0x3907('0x32')](_0x1aac89[_0x3907('0x2e')]['fields']));_0x5af94e[_0x3907('0x31')]=_0x5af94e['attributes'][_0x3907('0x33')]?_0x5af94e[_0x3907('0x31')]:_0x3514ef['model'];_0x5af94e[_0x3907('0x35')]=qs[_0x3907('0x36')](_0x1aac89[_0x3907('0x2e')][_0x3907('0x36')]);_0x5af94e[_0x3907('0x39')]=qs[_0x3907('0x2f')](_[_0x3907('0x37')](_0x1aac89['query'],_0x3514ef[_0x3907('0x2f')]));if(_0x1aac89[_0x3907('0x2e')][_0x3907('0x38')]){_0x5af94e[_0x3907('0x39')]=_[_0x3907('0x3a')](_0x5af94e[_0x3907('0x39')],{'$or':_[_0x3907('0x28')](_0x5af94e[_0x3907('0x31')],function(_0x54b803){var _0x3794b9={};_0x3794b9[_0x54b803]={'$like':'%'+_0x1aac89[_0x3907('0x2e')][_0x3907('0x38')]+'%'};return _0x3794b9;})});}_0x5af94e=_[_0x3907('0x3a')]({},_0x5af94e,_0x1aac89[_0x3907('0x44')]);return _0x5e5e4f['getFields'](_0x5af94e);}})[_0x3907('0x23')](function(_0x22e557){if(_0x22e557){_0x3f78c8=_0x22e557['length'];if(!_0x1aac89[_0x3907('0x2e')][_0x3907('0x4a')](_0x3907('0x34'))){_0x5af94e[_0x3907('0x1c')]=qs[_0x3907('0x1c')](_0x1aac89[_0x3907('0x2e')][_0x3907('0x1c')]);_0x5af94e[_0x3907('0x1b')]=qs[_0x3907('0x1b')](_0x1aac89['query'][_0x3907('0x1b')]);}return _0x5e5e4f[_0x3907('0x4b')](_0x5af94e);}})['then'](function(_0xfc4ab1){if(_0xfc4ab1){return _0xfc4ab1?{'count':_0x3f78c8,'rows':_0xfc4ab1}:null;}})['then'](respondWithResult(_0x2d2ecc,null))['catch'](handleError(_0x2d2ecc,null));};exports[_0x3907('0x4c')]=function(_0x32e6e5,_0x3fcb2e,_0x38465c){var _0x33e05f={};var _0x13058a={};var _0x2da4bd;var _0x1ea06e;return db[_0x3907('0x3c')][_0x3907('0x48')]({'where':{'id':_0x32e6e5[_0x3907('0x42')]['id']}})[_0x3907('0x23')](handleEntityNotFound(_0x3fcb2e,null))['then'](function(_0x2ca312){if(_0x2ca312){_0x2da4bd=_0x2ca312;_0x13058a[_0x3907('0x2c')]=_[_0x3907('0x2d')](db[_0x3907('0x49')]['rawAttributes']);_0x13058a[_0x3907('0x2e')]=_[_0x3907('0x2d')](_0x32e6e5[_0x3907('0x2e')]);_0x13058a[_0x3907('0x2f')]=_[_0x3907('0x30')](_0x13058a[_0x3907('0x2c')],_0x13058a[_0x3907('0x2e')]);_0x33e05f[_0x3907('0x31')]=_[_0x3907('0x30')](_0x13058a[_0x3907('0x2c')],qs[_0x3907('0x32')](_0x32e6e5['query'][_0x3907('0x32')]));_0x33e05f['attributes']=_0x33e05f[_0x3907('0x31')][_0x3907('0x33')]?_0x33e05f[_0x3907('0x31')]:_0x13058a[_0x3907('0x2c')];_0x33e05f[_0x3907('0x35')]=qs[_0x3907('0x36')](_0x32e6e5[_0x3907('0x2e')][_0x3907('0x36')]);_0x33e05f[_0x3907('0x39')]=qs[_0x3907('0x2f')](_[_0x3907('0x37')](_0x32e6e5[_0x3907('0x2e')],_0x13058a['filters']));if(_0x32e6e5['query'][_0x3907('0x38')]){_0x33e05f[_0x3907('0x39')]=_['merge'](_0x33e05f[_0x3907('0x39')],{'$or':_[_0x3907('0x28')](_0x33e05f[_0x3907('0x31')],function(_0xf56fe7){var _0x400c4d={};_0x400c4d[_0xf56fe7]={'$like':'%'+_0x32e6e5['query'][_0x3907('0x38')]+'%'};return _0x400c4d;})});}_0x33e05f=_[_0x3907('0x3a')]({},_0x33e05f,_0x32e6e5[_0x3907('0x44')]);return _0x2da4bd[_0x3907('0x4c')](_0x33e05f);}})[_0x3907('0x23')](function(_0x16def2){if(_0x16def2){_0x1ea06e=_0x16def2[_0x3907('0x33')];if(!_0x32e6e5[_0x3907('0x2e')][_0x3907('0x4a')](_0x3907('0x34'))){_0x33e05f[_0x3907('0x1c')]=qs[_0x3907('0x1c')](_0x32e6e5['query'][_0x3907('0x1c')]);_0x33e05f['offset']=qs[_0x3907('0x1b')](_0x32e6e5[_0x3907('0x2e')][_0x3907('0x1b')]);}return _0x2da4bd[_0x3907('0x4c')](_0x33e05f);}})['then'](function(_0x41ff6f){if(_0x41ff6f){return _0x41ff6f?{'count':_0x1ea06e,'rows':_0x41ff6f}:null;}})[_0x3907('0x23')](respondWithResult(_0x3fcb2e,null))[_0x3907('0x40')](handleError(_0x3fcb2e,null));};exports[_0x3907('0x4d')]=function(_0x4445cf,_0x29e591,_0x28bce0){var _0xd63c67={};var _0x2d23a8={};var _0x197801;var _0x351d9a;return db[_0x3907('0x3c')][_0x3907('0x48')]({'where':{'id':_0x4445cf[_0x3907('0x42')]['id']}})[_0x3907('0x23')](handleEntityNotFound(_0x29e591,null))[_0x3907('0x23')](function(_0x4e4408){if(_0x4e4408){_0x197801=_0x4e4408;_0x2d23a8[_0x3907('0x2c')]=_['keys'](db['ZohoField'][_0x3907('0x29')]);_0x2d23a8[_0x3907('0x2e')]=_[_0x3907('0x2d')](_0x4445cf[_0x3907('0x2e')]);_0x2d23a8[_0x3907('0x2f')]=_[_0x3907('0x30')](_0x2d23a8[_0x3907('0x2c')],_0x2d23a8['query']);_0xd63c67[_0x3907('0x31')]=_[_0x3907('0x30')](_0x2d23a8[_0x3907('0x2c')],qs[_0x3907('0x32')](_0x4445cf['query'][_0x3907('0x32')]));_0xd63c67[_0x3907('0x31')]=_0xd63c67[_0x3907('0x31')][_0x3907('0x33')]?_0xd63c67[_0x3907('0x31')]:_0x2d23a8['model'];_0xd63c67[_0x3907('0x35')]=qs[_0x3907('0x36')](_0x4445cf[_0x3907('0x2e')][_0x3907('0x36')]);_0xd63c67[_0x3907('0x39')]=qs[_0x3907('0x2f')](_[_0x3907('0x37')](_0x4445cf[_0x3907('0x2e')],_0x2d23a8[_0x3907('0x2f')]));if(_0x4445cf[_0x3907('0x2e')]['filter']){_0xd63c67[_0x3907('0x39')]=_[_0x3907('0x3a')](_0xd63c67['where'],{'$or':_['map'](_0xd63c67[_0x3907('0x31')],function(_0x511022){var _0x401bde={};_0x401bde[_0x511022]={'$like':'%'+_0x4445cf['query'][_0x3907('0x38')]+'%'};return _0x401bde;})});}_0xd63c67=_['merge']({},_0xd63c67,_0x4445cf[_0x3907('0x44')]);return _0x197801[_0x3907('0x4d')](_0xd63c67);}})[_0x3907('0x23')](function(_0x38092e){if(_0x38092e){_0x351d9a=_0x38092e['length'];if(!_0x4445cf[_0x3907('0x2e')][_0x3907('0x4a')](_0x3907('0x34'))){_0xd63c67[_0x3907('0x1c')]=qs['limit'](_0x4445cf[_0x3907('0x2e')][_0x3907('0x1c')]);_0xd63c67[_0x3907('0x1b')]=qs['offset'](_0x4445cf['query'][_0x3907('0x1b')]);}return _0x197801['getDescriptions'](_0xd63c67);}})['then'](function(_0x340220){if(_0x340220){return _0x340220?{'count':_0x351d9a,'rows':_0x340220}:null;}})[_0x3907('0x23')](respondWithResult(_0x29e591,null))[_0x3907('0x40')](handleError(_0x29e591,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index a86c2c8..e93ab49 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 _0x5db8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intZohoConfiguration.attributes','define'];(function(_0x4afdd5,_0x4f4184){var _0x14a65d=function(_0x3b7c34){while(--_0x3b7c34){_0x4afdd5['push'](_0x4afdd5['shift']());}};_0x14a65d(++_0x4f4184);}(_0x5db8,0x104));var _0x85db=function(_0x45dbe3,_0xd2bf96){_0x45dbe3=_0x45dbe3-0x0;var _0x1e71cf=_0x5db8[_0x45dbe3];return _0x1e71cf;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var logger=require(_0x85db('0x2'))(_0x85db('0x3'));var moment=require(_0x85db('0x4'));var BPromise=require(_0x85db('0x5'));var rp=require(_0x85db('0x6'));var fs=require('fs');var path=require(_0x85db('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x85db('0x8'));module['exports']=function(_0x18924a,_0x3df7ce){return _0x18924a[_0x85db('0x9')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08d7=['rimraf','../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x08d7,0xf6));var _0x708d=function(_0x2ea183,_0x3cff11){_0x2ea183=_0x2ea183-0x0;var _0x47c16c=_0x08d7[_0x2ea183];return _0x47c16c;};'use strict';var _=require(_0x708d('0x0'));var util=require('util');var logger=require(_0x708d('0x1'))(_0x708d('0x2'));var moment=require(_0x708d('0x3'));var BPromise=require('bluebird');var rp=require(_0x708d('0x4'));var fs=require('fs');var path=require(_0x708d('0x5'));var rimraf=require(_0x708d('0x6'));var config=require(_0x708d('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0x708d('0x8')]=function(_0x135094,_0x3af86b){return _0x135094[_0x708d('0x9')](_0x708d('0xa'),attributes,{'tableName':_0x708d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 8527720..7d6488f 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 _0xab44=['error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4c5143,_0x181163){var _0x53f209=function(_0xf3f899){while(--_0xf3f899){_0x4c5143['push'](_0x4c5143['shift']());}};_0x53f209(++_0x181163);}(_0xab44,0x139));var _0x4ab4=function(_0x21e085,_0x3e4616){_0x21e085=_0x21e085-0x0;var _0x5e70c5=_0xab44[_0x21e085];return _0x5e70c5;};'use strict';var _=require('lodash');var util=require(_0x4ab4('0x0'));var moment=require(_0x4ab4('0x1'));var BPromise=require(_0x4ab4('0x2'));var rs=require(_0x4ab4('0x3'));var fs=require('fs');var Redis=require(_0x4ab4('0x4'));var db=require(_0x4ab4('0x5'))['db'];var utils=require(_0x4ab4('0x6'));var logger=require('../../config/logger')(_0x4ab4('0x7'));var config=require(_0x4ab4('0x8'));var jayson=require(_0x4ab4('0x9'));var client=jayson[_0x4ab4('0xa')][_0x4ab4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48abf2,_0x3bfd6c,_0x4c0847){return new BPromise(function(_0x251305,_0x390d85){return client[_0x4ab4('0xc')](_0x48abf2,_0x4c0847)[_0x4ab4('0xd')](function(_0x35fb7e){logger['info'](_0x4ab4('0xe'),_0x3bfd6c,_0x4ab4('0xf'));logger[_0x4ab4('0x10')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3bfd6c,_0x4ab4('0xf'),JSON['stringify'](_0x35fb7e));if(_0x35fb7e['error']){if(_0x35fb7e[_0x4ab4('0x11')][_0x4ab4('0x12')]===0x1f4){logger[_0x4ab4('0x11')](_0x4ab4('0xe'),_0x3bfd6c,_0x35fb7e[_0x4ab4('0x11')]['message']);return _0x390d85(_0x35fb7e[_0x4ab4('0x11')]['message']);}logger[_0x4ab4('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x3bfd6c,_0x35fb7e[_0x4ab4('0x11')][_0x4ab4('0x13')]);return _0x251305(_0x35fb7e[_0x4ab4('0x11')][_0x4ab4('0x13')]);}else{logger[_0x4ab4('0x14')](_0x4ab4('0xe'),_0x3bfd6c,_0x4ab4('0xf'));_0x251305(_0x35fb7e[_0x4ab4('0x15')][_0x4ab4('0x13')]);}})['catch'](function(_0x42fd5d){logger[_0x4ab4('0x11')](_0x4ab4('0xe'),_0x3bfd6c,_0x42fd5d);_0x390d85(_0x42fd5d);});});} \ No newline at end of file +var _0x2d64=['../../config/environment','request','info','request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x50d316,_0x332ffb){var _0x56a3bf=function(_0x12fb0b){while(--_0x12fb0b){_0x50d316['push'](_0x50d316['shift']());}};_0x56a3bf(++_0x332ffb);}(_0x2d64,0x81));var _0x42d6=function(_0x84008f,_0x4e556c){_0x84008f=_0x84008f-0x0;var _0x2d3615=_0x2d64[_0x84008f];return _0x2d3615;};'use strict';var _=require('lodash');var util=require(_0x42d6('0x0'));var moment=require(_0x42d6('0x1'));var BPromise=require('bluebird');var rs=require(_0x42d6('0x2'));var fs=require('fs');var Redis=require(_0x42d6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x42d6('0x4'));var logger=require(_0x42d6('0x5'))(_0x42d6('0x6'));var config=require(_0x42d6('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe1c870,_0x2b8b84,_0x5765bf){return new BPromise(function(_0x3d822d,_0x3fa900){return client[_0x42d6('0x8')](_0xe1c870,_0x5765bf)['then'](function(_0x15e32c){logger[_0x42d6('0x9')]('ZohoConfiguration,\x20%s,\x20%s',_0x2b8b84,_0x42d6('0xa'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x2b8b84,_0x42d6('0xa'),JSON[_0x42d6('0xb')](_0x15e32c));if(_0x15e32c[_0x42d6('0xc')]){if(_0x15e32c[_0x42d6('0xc')][_0x42d6('0xd')]===0x1f4){logger[_0x42d6('0xc')](_0x42d6('0xe'),_0x2b8b84,_0x15e32c[_0x42d6('0xc')][_0x42d6('0xf')]);return _0x3fa900(_0x15e32c[_0x42d6('0xc')][_0x42d6('0xf')]);}logger[_0x42d6('0xc')](_0x42d6('0xe'),_0x2b8b84,_0x15e32c[_0x42d6('0xc')][_0x42d6('0xf')]);return _0x3d822d(_0x15e32c['error'][_0x42d6('0xf')]);}else{logger[_0x42d6('0x9')](_0x42d6('0xe'),_0x2b8b84,_0x42d6('0xa'));_0x3d822d(_0x15e32c[_0x42d6('0x10')][_0x42d6('0xf')]);}})['catch'](function(_0x22b117){logger['error'](_0x42d6('0xe'),_0x2b8b84,_0x22b117);_0x3fa900(_0x22b117);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 3acb6ba..b68bb41 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 _0x3bb4=['exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','put','update','delete'];(function(_0xfe3aed,_0x1558b2){var _0x8cbbc2=function(_0x57f204){while(--_0x57f204){_0xfe3aed['push'](_0xfe3aed['shift']());}};_0x8cbbc2(++_0x1558b2);}(_0x3bb4,0x141));var _0x43bb=function(_0x5bdf58,_0x2a3a6f){_0x5bdf58=_0x5bdf58-0x0;var _0x100b14=_0x3bb4[_0x5bdf58];return _0x100b14;};'use strict';var multer=require(_0x43bb('0x0'));var util=require('util');var path=require(_0x43bb('0x1'));var timeout=require(_0x43bb('0x2'));var express=require(_0x43bb('0x3'));var router=express['Router']();var fs_extra=require(_0x43bb('0x4'));var auth=require(_0x43bb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x43bb('0x6'));var controller=require('./intZohoField.controller');router['get']('/',auth[_0x43bb('0x7')](),controller[_0x43bb('0x8')]);router[_0x43bb('0x9')](_0x43bb('0xa'),auth[_0x43bb('0x7')](),controller[_0x43bb('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x43bb('0xc')](_0x43bb('0xa'),auth[_0x43bb('0x7')](),controller[_0x43bb('0xd')]);router[_0x43bb('0xe')](_0x43bb('0xa'),auth[_0x43bb('0x7')](),controller['destroy']);module[_0x43bb('0xf')]=router; \ No newline at end of file +var _0x6bb2=['create','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3ae204,_0x4d994e){var _0x480f72=function(_0x55ae7d){while(--_0x55ae7d){_0x3ae204['push'](_0x3ae204['shift']());}};_0x480f72(++_0x4d994e);}(_0x6bb2,0x95));var _0x26bb=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x6bb2[_0x24237f];return _0x48298e;};'use strict';var multer=require('multer');var util=require(_0x26bb('0x0'));var path=require('path');var timeout=require(_0x26bb('0x1'));var express=require('express');var router=express[_0x26bb('0x2')]();var fs_extra=require(_0x26bb('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x26bb('0x4'));var controller=require(_0x26bb('0x5'));router[_0x26bb('0x6')]('/',auth[_0x26bb('0x7')](),controller[_0x26bb('0x8')]);router['get'](_0x26bb('0x9'),auth[_0x26bb('0x7')](),controller[_0x26bb('0xa')]);router['post']('/',auth[_0x26bb('0x7')](),controller[_0x26bb('0xb')]);router[_0x26bb('0xc')](_0x26bb('0x9'),auth[_0x26bb('0x7')](),controller[_0x26bb('0xd')]);router[_0x26bb('0xe')](_0x26bb('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x26bb('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 6a3f56e..e39faa2 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 _0xd09a=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','sequelize','exports'];(function(_0x1e6bde,_0x270caa){var _0x386ccf=function(_0x241052){while(--_0x241052){_0x1e6bde['push'](_0x1e6bde['shift']());}};_0x386ccf(++_0x270caa);}(_0xd09a,0x1d2));var _0xad09=function(_0x1114f6,_0x214edc){_0x1114f6=_0x1114f6-0x0;var _0x2e7a23=_0xd09a[_0x1114f6];return _0x2e7a23;};'use strict';var Sequelize=require(_0xad09('0x0'));module[_0xad09('0x1')]={'type':{'type':Sequelize[_0xad09('0x2')]('string',_0xad09('0x3'),_0xad09('0x4'),_0xad09('0x5'),_0xad09('0x6')),'defaultValue':_0xad09('0x7')},'content':{'type':Sequelize[_0xad09('0x8')]},'key':{'type':Sequelize[_0xad09('0x8')]},'keyType':{'type':Sequelize[_0xad09('0x2')]('string',_0xad09('0x3'),_0xad09('0x4'))},'keyContent':{'type':Sequelize[_0xad09('0x8')]},'idField':{'type':Sequelize[_0xad09('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3e7b=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x51dfd8,_0x5cc322){var _0x3d08a8=function(_0x25e1f1){while(--_0x25e1f1){_0x51dfd8['push'](_0x51dfd8['shift']());}};_0x3d08a8(++_0x5cc322);}(_0x3e7b,0x1ba));var _0xb3e7=function(_0x4b70e7,_0xb6fb77){_0x4b70e7=_0x4b70e7-0x0;var _0xbe7bfd=_0x3e7b[_0x4b70e7];return _0xbe7bfd;};'use strict';var Sequelize=require(_0xb3e7('0x0'));module[_0xb3e7('0x1')]={'type':{'type':Sequelize[_0xb3e7('0x2')](_0xb3e7('0x3'),'variable',_0xb3e7('0x4'),_0xb3e7('0x5'),_0xb3e7('0x6')),'defaultValue':_0xb3e7('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb3e7('0x7')]},'keyType':{'type':Sequelize[_0xb3e7('0x2')](_0xb3e7('0x3'),'variable',_0xb3e7('0x4'))},'keyContent':{'type':Sequelize[_0xb3e7('0x7')]},'idField':{'type':Sequelize[_0xb3e7('0x7')]},'nameField':{'type':Sequelize[_0xb3e7('0x7')]},'customField':{'type':Sequelize[_0xb3e7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb3e7('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 0b85302..156621c 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 _0xf07f=['filter','merge','type','VIRTUAL','options','includeAll','include','ZohoField','findAll','rows','find','catch','create','body','destroy','params','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','update','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x52f64e,_0x1e1717){var _0xd5dfc8=function(_0x323e3a){while(--_0x323e3a){_0x52f64e['push'](_0x52f64e['shift']());}};_0xd5dfc8(++_0x1e1717);}(_0xf07f,0xa4));var _0xff07=function(_0x5d55d4,_0x1577fe){_0x5d55d4=_0x5d55d4-0x0;var _0x419d69=_0xf07f[_0x5d55d4];return _0x419d69;};'use strict';var emlformat=require(_0xff07('0x0'));var rimraf=require(_0xff07('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff07('0x2'));var rp=require('request-promise');var moment=require(_0xff07('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xff07('0x4'));var util=require(_0xff07('0x5'));var path=require(_0xff07('0x6'));var sox=require(_0xff07('0x7'));var csv=require(_0xff07('0x8'));var ejs=require(_0xff07('0x9'));var fs=require('fs');var fs_extra=require(_0xff07('0xa'));var _=require(_0xff07('0xb'));var squel=require(_0xff07('0xc'));var crypto=require(_0xff07('0xd'));var jsforce=require(_0xff07('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xff07('0x8'));var querystring=require(_0xff07('0xf'));var Papa=require('papaparse');var Redis=require(_0xff07('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xff07('0x11'));var as=require(_0xff07('0x12'));var hardwareService=require(_0xff07('0x13'));var logger=require(_0xff07('0x14'))(_0xff07('0x15'));var utils=require('../../config/utils');var config=require(_0xff07('0x16'));var licenseUtil=require(_0xff07('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ffbf9,_0x473de5){_0x473de5=_0x473de5||0xcc;return function(_0x247c0a){if(_0x247c0a){return _0x3ffbf9[_0xff07('0x18')](_0x473de5);}return _0x3ffbf9['status'](_0x473de5)[_0xff07('0x19')]();};}function respondWithResult(_0x4a990c,_0x242536){_0x242536=_0x242536||0xc8;return function(_0x15a55c){if(_0x15a55c){return _0x4a990c['status'](_0x242536)[_0xff07('0x1a')](_0x15a55c);}};}function respondWithFilteredResult(_0x1a11a6,_0x5cd138){return function(_0x4bfa19){if(_0x4bfa19){var _0x5ca77b=typeof _0x5cd138['offset']===_0xff07('0x1b')&&typeof _0x5cd138[_0xff07('0x1c')]===_0xff07('0x1b');var _0x4caff8=_0x4bfa19[_0xff07('0x1d')];var _0x4bf3f0=_0x5ca77b?0x0:_0x5cd138['offset'];var _0x57f4d2=_0x5ca77b?_0x4bfa19['count']:_0x5cd138[_0xff07('0x1e')]+_0x5cd138['limit'];var _0x176e38;if(_0x57f4d2>=_0x4caff8){_0x57f4d2=_0x4caff8;_0x176e38=0xc8;}else{_0x176e38=0xce;}_0x1a11a6[_0xff07('0x1f')](_0x176e38);return _0x1a11a6[_0xff07('0x20')](_0xff07('0x21'),_0x4bf3f0+'-'+_0x57f4d2+'/'+_0x4caff8)[_0xff07('0x1a')](_0x4bfa19);}return null;};}function patchUpdates(_0x18500b){return function(_0x372266){try{jsonpatch['apply'](_0x372266,_0x18500b,!![]);}catch(_0x27592f){return BPromise['reject'](_0x27592f);}return _0x372266['save']();};}function saveUpdates(_0x237159,_0x40fc63){return function(_0x595319){if(_0x595319){return _0x595319[_0xff07('0x22')](_0x237159)[_0xff07('0x23')](function(_0xb4212){return _0xb4212;});}return null;};}function removeEntity(_0x24b572,_0x111560){return function(_0x11294d){if(_0x11294d){return _0x11294d['destroy']()[_0xff07('0x23')](function(){_0x24b572['status'](0xcc)[_0xff07('0x19')]();});}};}function handleEntityNotFound(_0x4bf26f,_0x2f2e02){return function(_0x1a87ce){if(!_0x1a87ce){_0x4bf26f[_0xff07('0x18')](0x194);}return _0x1a87ce;};}function handleError(_0x36e7ef,_0x2cbb49){_0x2cbb49=_0x2cbb49||0x1f4;return function(_0x3c99fd){logger[_0xff07('0x24')](_0x3c99fd[_0xff07('0x25')]);if(_0x3c99fd[_0xff07('0x26')]){delete _0x3c99fd[_0xff07('0x26')];}_0x36e7ef[_0xff07('0x1f')](_0x2cbb49)['send'](_0x3c99fd);};}exports[_0xff07('0x27')]=function(_0x22fdb1,_0x56b845){var _0x2cb387={},_0x515571={},_0x5dcd53={'count':0x0,'rows':[]};var _0x47ac6c=_[_0xff07('0x28')](db['ZohoField'][_0xff07('0x29')],function(_0x2d6836){return{'name':_0x2d6836[_0xff07('0x2a')],'type':_0x2d6836['type'][_0xff07('0x2b')]};});_0x515571[_0xff07('0x2c')]=_[_0xff07('0x28')](_0x47ac6c,_0xff07('0x26'));_0x515571[_0xff07('0x2d')]=_[_0xff07('0x2e')](_0x22fdb1['query']);_0x515571[_0xff07('0x2f')]=_[_0xff07('0x30')](_0x515571[_0xff07('0x2c')],_0x515571[_0xff07('0x2d')]);_0x2cb387[_0xff07('0x31')]=_[_0xff07('0x30')](_0x515571[_0xff07('0x2c')],qs['fields'](_0x22fdb1[_0xff07('0x2d')][_0xff07('0x32')]));_0x2cb387[_0xff07('0x31')]=_0x2cb387[_0xff07('0x31')][_0xff07('0x33')]?_0x2cb387[_0xff07('0x31')]:_0x515571[_0xff07('0x2c')];if(!_0x22fdb1[_0xff07('0x2d')][_0xff07('0x34')](_0xff07('0x35'))){_0x2cb387['limit']=qs['limit'](_0x22fdb1[_0xff07('0x2d')][_0xff07('0x1c')]);_0x2cb387[_0xff07('0x1e')]=qs['offset'](_0x22fdb1['query'][_0xff07('0x1e')]);}_0x2cb387[_0xff07('0x36')]=qs[_0xff07('0x37')](_0x22fdb1[_0xff07('0x2d')][_0xff07('0x37')]);_0x2cb387[_0xff07('0x38')]=qs[_0xff07('0x2f')](_[_0xff07('0x39')](_0x22fdb1[_0xff07('0x2d')],_0x515571[_0xff07('0x2f')]),_0x47ac6c);if(_0x22fdb1[_0xff07('0x2d')][_0xff07('0x3a')]){_0x2cb387[_0xff07('0x38')]=_[_0xff07('0x3b')](_0x2cb387['where'],{'$or':_[_0xff07('0x28')](_0x47ac6c,function(_0x500218){if(_0x500218[_0xff07('0x3c')]!==_0xff07('0x3d')){var _0x592ca8={};_0x592ca8[_0x500218[_0xff07('0x26')]]={'$like':'%'+_0x22fdb1['query'][_0xff07('0x3a')]+'%'};return _0x592ca8;}})});}_0x2cb387=_[_0xff07('0x3b')]({},_0x2cb387,_0x22fdb1[_0xff07('0x3e')]);var _0x3ae8fe={'where':_0x2cb387[_0xff07('0x38')]};return db['ZohoField'][_0xff07('0x1d')](_0x3ae8fe)[_0xff07('0x23')](function(_0x5ef160){_0x5dcd53[_0xff07('0x1d')]=_0x5ef160;if(_0x22fdb1[_0xff07('0x2d')][_0xff07('0x3f')]){_0x2cb387[_0xff07('0x40')]=[{'all':!![]}];}return db[_0xff07('0x41')][_0xff07('0x42')](_0x2cb387);})[_0xff07('0x23')](function(_0x5b6473){_0x5dcd53[_0xff07('0x43')]=_0x5b6473;return _0x5dcd53;})['then'](respondWithFilteredResult(_0x56b845,_0x2cb387))['catch'](handleError(_0x56b845,null));};exports['show']=function(_0x5366ca,_0x2814d4){var _0x3a1581={'raw':!![],'where':{'id':_0x5366ca['params']['id']}},_0x565e41={};_0x565e41[_0xff07('0x2c')]=_[_0xff07('0x2e')](db[_0xff07('0x41')][_0xff07('0x29')]);_0x565e41[_0xff07('0x2d')]=_[_0xff07('0x2e')](_0x5366ca[_0xff07('0x2d')]);_0x565e41[_0xff07('0x2f')]=_[_0xff07('0x30')](_0x565e41[_0xff07('0x2c')],_0x565e41[_0xff07('0x2d')]);_0x3a1581['attributes']=_[_0xff07('0x30')](_0x565e41[_0xff07('0x2c')],qs[_0xff07('0x32')](_0x5366ca['query'][_0xff07('0x32')]));_0x3a1581[_0xff07('0x31')]=_0x3a1581[_0xff07('0x31')][_0xff07('0x33')]?_0x3a1581[_0xff07('0x31')]:_0x565e41[_0xff07('0x2c')];if(_0x5366ca['query']['includeAll']){_0x3a1581['include']=[{'all':!![]}];}_0x3a1581=_['merge']({},_0x3a1581,_0x5366ca[_0xff07('0x3e')]);return db[_0xff07('0x41')][_0xff07('0x44')](_0x3a1581)[_0xff07('0x23')](handleEntityNotFound(_0x2814d4,null))['then'](respondWithResult(_0x2814d4,null))[_0xff07('0x45')](handleError(_0x2814d4,null));};exports[_0xff07('0x46')]=function(_0x5f2d11,_0x3f3041){return db[_0xff07('0x41')][_0xff07('0x46')](_0x5f2d11[_0xff07('0x47')],{})[_0xff07('0x23')](respondWithResult(_0x3f3041,0xc9))[_0xff07('0x45')](handleError(_0x3f3041,null));};exports['update']=function(_0x4cef1d,_0x103924){if(_0x4cef1d[_0xff07('0x47')]['id']){delete _0x4cef1d[_0xff07('0x47')]['id'];}return db[_0xff07('0x41')][_0xff07('0x44')]({'where':{'id':_0x4cef1d['params']['id']}})[_0xff07('0x23')](handleEntityNotFound(_0x103924,null))[_0xff07('0x23')](saveUpdates(_0x4cef1d['body'],null))[_0xff07('0x23')](respondWithResult(_0x103924,null))[_0xff07('0x45')](handleError(_0x103924,null));};exports[_0xff07('0x48')]=function(_0x3575f7,_0x958c19){return db[_0xff07('0x41')]['find']({'where':{'id':_0x3575f7[_0xff07('0x49')]['id']}})[_0xff07('0x23')](handleEntityNotFound(_0x958c19,null))['then'](removeEntity(_0x958c19,null))[_0xff07('0x45')](handleError(_0x958c19,null));}; \ No newline at end of file +var _0xe1c4=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ZohoField','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2bc49f,_0x2c2efc){var _0x2c3799=function(_0x199c06){while(--_0x199c06){_0x2bc49f['push'](_0x2bc49f['shift']());}};_0x2c3799(++_0x2c2efc);}(_0xe1c4,0x1ec));var _0x4e1c=function(_0x392ca0,_0x15bea8){_0x392ca0=_0x392ca0-0x0;var _0x29f92e=_0xe1c4[_0x392ca0];return _0x29f92e;};'use strict';var emlformat=require(_0x4e1c('0x0'));var rimraf=require(_0x4e1c('0x1'));var zipdir=require(_0x4e1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4e1c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4e1c('0x4'));var util=require(_0x4e1c('0x5'));var path=require(_0x4e1c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4e1c('0x7'));var fs=require('fs');var fs_extra=require(_0x4e1c('0x8'));var _=require(_0x4e1c('0x9'));var squel=require(_0x4e1c('0xa'));var crypto=require(_0x4e1c('0xb'));var jsforce=require(_0x4e1c('0xc'));var deskjs=require(_0x4e1c('0xd'));var toCsv=require(_0x4e1c('0xe'));var querystring=require(_0x4e1c('0xf'));var Papa=require(_0x4e1c('0x10'));var Redis=require(_0x4e1c('0x11'));var authService=require(_0x4e1c('0x12'));var qs=require(_0x4e1c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e1c('0x14'));var logger=require(_0x4e1c('0x15'))('api');var utils=require(_0x4e1c('0x16'));var config=require(_0x4e1c('0x17'));var licenseUtil=require(_0x4e1c('0x18'));var db=require(_0x4e1c('0x19'))['db'];function respondWithStatusCode(_0x54b2d1,_0xb4a030){_0xb4a030=_0xb4a030||0xcc;return function(_0x12178d){if(_0x12178d){return _0x54b2d1[_0x4e1c('0x1a')](_0xb4a030);}return _0x54b2d1[_0x4e1c('0x1b')](_0xb4a030)['end']();};}function respondWithResult(_0x531159,_0x550f27){_0x550f27=_0x550f27||0xc8;return function(_0x12e7fe){if(_0x12e7fe){return _0x531159[_0x4e1c('0x1b')](_0x550f27)[_0x4e1c('0x1c')](_0x12e7fe);}};}function respondWithFilteredResult(_0x201779,_0x4d47ec){return function(_0x2cd5bc){if(_0x2cd5bc){var _0x374c78=typeof _0x4d47ec[_0x4e1c('0x1d')]===_0x4e1c('0x1e')&&typeof _0x4d47ec[_0x4e1c('0x1f')]===_0x4e1c('0x1e');var _0x58d9e3=_0x2cd5bc[_0x4e1c('0x20')];var _0x399bcc=_0x374c78?0x0:_0x4d47ec[_0x4e1c('0x1d')];var _0x46a887=_0x374c78?_0x2cd5bc[_0x4e1c('0x20')]:_0x4d47ec[_0x4e1c('0x1d')]+_0x4d47ec[_0x4e1c('0x1f')];var _0x544b08;if(_0x46a887>=_0x58d9e3){_0x46a887=_0x58d9e3;_0x544b08=0xc8;}else{_0x544b08=0xce;}_0x201779[_0x4e1c('0x1b')](_0x544b08);return _0x201779[_0x4e1c('0x21')](_0x4e1c('0x22'),_0x399bcc+'-'+_0x46a887+'/'+_0x58d9e3)[_0x4e1c('0x1c')](_0x2cd5bc);}return null;};}function patchUpdates(_0x33da37){return function(_0x427cc1){try{jsonpatch[_0x4e1c('0x23')](_0x427cc1,_0x33da37,!![]);}catch(_0x53a020){return BPromise[_0x4e1c('0x24')](_0x53a020);}return _0x427cc1[_0x4e1c('0x25')]();};}function saveUpdates(_0xc57bcc,_0x169b4e){return function(_0x3dde0d){if(_0x3dde0d){return _0x3dde0d[_0x4e1c('0x26')](_0xc57bcc)[_0x4e1c('0x27')](function(_0x19ed77){return _0x19ed77;});}return null;};}function removeEntity(_0x45c13e,_0x5ada14){return function(_0x46ad33){if(_0x46ad33){return _0x46ad33[_0x4e1c('0x28')]()[_0x4e1c('0x27')](function(){_0x45c13e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17f5a5,_0x551d50){return function(_0x25cc93){if(!_0x25cc93){_0x17f5a5[_0x4e1c('0x1a')](0x194);}return _0x25cc93;};}function handleError(_0x2a2ccb,_0x564b30){_0x564b30=_0x564b30||0x1f4;return function(_0x12364d){logger[_0x4e1c('0x29')](_0x12364d['stack']);if(_0x12364d[_0x4e1c('0x2a')]){delete _0x12364d[_0x4e1c('0x2a')];}_0x2a2ccb[_0x4e1c('0x1b')](_0x564b30)[_0x4e1c('0x2b')](_0x12364d);};}exports[_0x4e1c('0x2c')]=function(_0x5ef2f7,_0xeccf79){var _0x8e3e14={},_0x1b5ba8={},_0x1c4c4a={'count':0x0,'rows':[]};var _0x504259=_[_0x4e1c('0x2d')](db[_0x4e1c('0x2e')]['rawAttributes'],function(_0x46d181){return{'name':_0x46d181['fieldName'],'type':_0x46d181[_0x4e1c('0x2f')][_0x4e1c('0x30')]};});_0x1b5ba8[_0x4e1c('0x31')]=_[_0x4e1c('0x2d')](_0x504259,'name');_0x1b5ba8[_0x4e1c('0x32')]=_['keys'](_0x5ef2f7[_0x4e1c('0x32')]);_0x1b5ba8['filters']=_[_0x4e1c('0x33')](_0x1b5ba8[_0x4e1c('0x31')],_0x1b5ba8['query']);_0x8e3e14[_0x4e1c('0x34')]=_['intersection'](_0x1b5ba8[_0x4e1c('0x31')],qs[_0x4e1c('0x35')](_0x5ef2f7[_0x4e1c('0x32')][_0x4e1c('0x35')]));_0x8e3e14[_0x4e1c('0x34')]=_0x8e3e14[_0x4e1c('0x34')][_0x4e1c('0x36')]?_0x8e3e14[_0x4e1c('0x34')]:_0x1b5ba8[_0x4e1c('0x31')];if(!_0x5ef2f7[_0x4e1c('0x32')]['hasOwnProperty'](_0x4e1c('0x37'))){_0x8e3e14[_0x4e1c('0x1f')]=qs[_0x4e1c('0x1f')](_0x5ef2f7[_0x4e1c('0x32')][_0x4e1c('0x1f')]);_0x8e3e14[_0x4e1c('0x1d')]=qs['offset'](_0x5ef2f7['query'][_0x4e1c('0x1d')]);}_0x8e3e14[_0x4e1c('0x38')]=qs[_0x4e1c('0x39')](_0x5ef2f7[_0x4e1c('0x32')]['sort']);_0x8e3e14[_0x4e1c('0x3a')]=qs[_0x4e1c('0x3b')](_['pick'](_0x5ef2f7[_0x4e1c('0x32')],_0x1b5ba8[_0x4e1c('0x3b')]),_0x504259);if(_0x5ef2f7[_0x4e1c('0x32')]['filter']){_0x8e3e14[_0x4e1c('0x3a')]=_[_0x4e1c('0x3c')](_0x8e3e14['where'],{'$or':_[_0x4e1c('0x2d')](_0x504259,function(_0x128ddd){if(_0x128ddd[_0x4e1c('0x2f')]!==_0x4e1c('0x3d')){var _0x1cb1a3={};_0x1cb1a3[_0x128ddd[_0x4e1c('0x2a')]]={'$like':'%'+_0x5ef2f7['query']['filter']+'%'};return _0x1cb1a3;}})});}_0x8e3e14=_[_0x4e1c('0x3c')]({},_0x8e3e14,_0x5ef2f7[_0x4e1c('0x3e')]);var _0x390d05={'where':_0x8e3e14[_0x4e1c('0x3a')]};return db[_0x4e1c('0x2e')][_0x4e1c('0x20')](_0x390d05)[_0x4e1c('0x27')](function(_0x6838bc){_0x1c4c4a[_0x4e1c('0x20')]=_0x6838bc;if(_0x5ef2f7[_0x4e1c('0x32')][_0x4e1c('0x3f')]){_0x8e3e14['include']=[{'all':!![]}];}return db['ZohoField'][_0x4e1c('0x40')](_0x8e3e14);})[_0x4e1c('0x27')](function(_0xe26367){_0x1c4c4a[_0x4e1c('0x41')]=_0xe26367;return _0x1c4c4a;})[_0x4e1c('0x27')](respondWithFilteredResult(_0xeccf79,_0x8e3e14))[_0x4e1c('0x42')](handleError(_0xeccf79,null));};exports['show']=function(_0x18d021,_0x1da617){var _0x827f0a={'raw':!![],'where':{'id':_0x18d021[_0x4e1c('0x43')]['id']}},_0xdfb6d7={};_0xdfb6d7[_0x4e1c('0x31')]=_[_0x4e1c('0x44')](db[_0x4e1c('0x2e')][_0x4e1c('0x45')]);_0xdfb6d7[_0x4e1c('0x32')]=_[_0x4e1c('0x44')](_0x18d021['query']);_0xdfb6d7[_0x4e1c('0x3b')]=_[_0x4e1c('0x33')](_0xdfb6d7[_0x4e1c('0x31')],_0xdfb6d7[_0x4e1c('0x32')]);_0x827f0a[_0x4e1c('0x34')]=_[_0x4e1c('0x33')](_0xdfb6d7[_0x4e1c('0x31')],qs[_0x4e1c('0x35')](_0x18d021['query'][_0x4e1c('0x35')]));_0x827f0a['attributes']=_0x827f0a[_0x4e1c('0x34')][_0x4e1c('0x36')]?_0x827f0a['attributes']:_0xdfb6d7[_0x4e1c('0x31')];if(_0x18d021[_0x4e1c('0x32')]['includeAll']){_0x827f0a['include']=[{'all':!![]}];}_0x827f0a=_[_0x4e1c('0x3c')]({},_0x827f0a,_0x18d021[_0x4e1c('0x3e')]);return db[_0x4e1c('0x2e')][_0x4e1c('0x46')](_0x827f0a)['then'](handleEntityNotFound(_0x1da617,null))[_0x4e1c('0x27')](respondWithResult(_0x1da617,null))[_0x4e1c('0x42')](handleError(_0x1da617,null));};exports[_0x4e1c('0x47')]=function(_0x6fae67,_0x488fe4){return db[_0x4e1c('0x2e')][_0x4e1c('0x47')](_0x6fae67[_0x4e1c('0x48')],{})[_0x4e1c('0x27')](respondWithResult(_0x488fe4,0xc9))[_0x4e1c('0x42')](handleError(_0x488fe4,null));};exports[_0x4e1c('0x26')]=function(_0x38aa72,_0x25ba45){if(_0x38aa72[_0x4e1c('0x48')]['id']){delete _0x38aa72['body']['id'];}return db[_0x4e1c('0x2e')]['find']({'where':{'id':_0x38aa72[_0x4e1c('0x43')]['id']}})[_0x4e1c('0x27')](handleEntityNotFound(_0x25ba45,null))[_0x4e1c('0x27')](saveUpdates(_0x38aa72['body'],null))['then'](respondWithResult(_0x25ba45,null))[_0x4e1c('0x42')](handleError(_0x25ba45,null));};exports[_0x4e1c('0x28')]=function(_0x4b6910,_0x304b74){return db[_0x4e1c('0x2e')]['find']({'where':{'id':_0x4b6910['params']['id']}})[_0x4e1c('0x27')](handleEntityNotFound(_0x304b74,null))['then'](removeEntity(_0x304b74,null))[_0x4e1c('0x42')](handleError(_0x304b74,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index b3c4034..0624bd3 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 _0xacf4=['bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','../../config/logger','api','moment'];(function(_0x15a510,_0x3890b1){var _0x38759d=function(_0x2dd390){while(--_0x2dd390){_0x15a510['push'](_0x15a510['shift']());}};_0x38759d(++_0x3890b1);}(_0xacf4,0xe7));var _0x4acf=function(_0xc1763a,_0x320c57){_0xc1763a=_0xc1763a-0x0;var _0x5e7fd=_0xacf4[_0xc1763a];return _0x5e7fd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[{'name':_0x4acf('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c3c=['path','rimraf','../../config/environment','./intZohoField.attributes','exports','zoho_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x42711a,_0x87b6b){var _0x2a03f8=function(_0x5bce3d){while(--_0x5bce3d){_0x42711a['push'](_0x42711a['shift']());}};_0x2a03f8(++_0x87b6b);}(_0x5c3c,0x132));var _0xc5c3=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x5c3c[_0x39d544];return _0x5a5ff2;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var logger=require(_0xc5c3('0x2'))(_0xc5c3('0x3'));var moment=require('moment');var BPromise=require(_0xc5c3('0x4'));var rp=require(_0xc5c3('0x5'));var fs=require('fs');var path=require(_0xc5c3('0x6'));var rimraf=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var attributes=require(_0xc5c3('0x9'));module[_0xc5c3('0xa')]=function(_0x23a6b5,_0x28bdd9){return _0x23a6b5['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xc5c3('0xb'),'fields':[_0xc5c3('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index d7c1661..dad5640 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 _0xe3a8=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x2125f0,_0x2f23b9){var _0x12d6eb=function(_0x7a43ea){while(--_0x7a43ea){_0x2125f0['push'](_0x2125f0['shift']());}};_0x12d6eb(++_0x2f23b9);}(_0xe3a8,0xb2));var _0x8e3a=function(_0x4f9123,_0x2b9e21){_0x4f9123=_0x4f9123-0x0;var _0x18878b=_0xe3a8[_0x4f9123];return _0x18878b;};'use strict';var _=require(_0x8e3a('0x0'));var util=require(_0x8e3a('0x1'));var moment=require(_0x8e3a('0x2'));var BPromise=require(_0x8e3a('0x3'));var rs=require(_0x8e3a('0x4'));var fs=require('fs');var Redis=require(_0x8e3a('0x5'));var db=require(_0x8e3a('0x6'))['db'];var utils=require(_0x8e3a('0x7'));var logger=require('../../config/logger')(_0x8e3a('0x8'));var config=require(_0x8e3a('0x9'));var jayson=require(_0x8e3a('0xa'));var client=jayson[_0x8e3a('0xb')][_0x8e3a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c8098,_0x52c9c4,_0x119221){return new BPromise(function(_0xc308dc,_0x1c3fa0){return client['request'](_0x4c8098,_0x119221)[_0x8e3a('0xd')](function(_0x1f3c85){logger[_0x8e3a('0xe')](_0x8e3a('0xf'),_0x52c9c4,_0x8e3a('0x10'));logger[_0x8e3a('0x11')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x52c9c4,_0x8e3a('0x10'),JSON[_0x8e3a('0x12')](_0x1f3c85));if(_0x1f3c85[_0x8e3a('0x13')]){if(_0x1f3c85['error'][_0x8e3a('0x14')]===0x1f4){logger[_0x8e3a('0x13')]('ZohoField,\x20%s,\x20%s',_0x52c9c4,_0x1f3c85[_0x8e3a('0x13')]['message']);return _0x1c3fa0(_0x1f3c85[_0x8e3a('0x13')][_0x8e3a('0x15')]);}logger[_0x8e3a('0x13')](_0x8e3a('0xf'),_0x52c9c4,_0x1f3c85[_0x8e3a('0x13')]['message']);return _0xc308dc(_0x1f3c85[_0x8e3a('0x13')][_0x8e3a('0x15')]);}else{logger[_0x8e3a('0xe')](_0x8e3a('0xf'),_0x52c9c4,_0x8e3a('0x10'));_0xc308dc(_0x1f3c85['result'][_0x8e3a('0x15')]);}})['catch'](function(_0x3adb95){logger['error'](_0x8e3a('0xf'),_0x52c9c4,_0x3adb95);_0x1c3fa0(_0x3adb95);});});} \ No newline at end of file +var _0x5ab5=['http','request','then','info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5ab5,0x1d9));var _0x55ab=function(_0x10f82a,_0x32ad47){_0x10f82a=_0x10f82a-0x0;var _0xc6077e=_0x5ab5[_0x10f82a];return _0xc6077e;};'use strict';var _=require('lodash');var util=require(_0x55ab('0x0'));var moment=require('moment');var BPromise=require(_0x55ab('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55ab('0x2'));var db=require(_0x55ab('0x3'))['db'];var utils=require(_0x55ab('0x4'));var logger=require(_0x55ab('0x5'))(_0x55ab('0x6'));var config=require(_0x55ab('0x7'));var jayson=require(_0x55ab('0x8'));var client=jayson[_0x55ab('0x9')][_0x55ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56b7bb,_0xfceb6c,_0x5c3d66){return new BPromise(function(_0x127538,_0x276217){return client[_0x55ab('0xb')](_0x56b7bb,_0x5c3d66)[_0x55ab('0xc')](function(_0x2e3597){logger[_0x55ab('0xd')](_0x55ab('0xe'),_0xfceb6c,'request\x20sent');logger['debug'](_0x55ab('0xf'),_0xfceb6c,_0x55ab('0x10'),JSON[_0x55ab('0x11')](_0x2e3597));if(_0x2e3597[_0x55ab('0x12')]){if(_0x2e3597[_0x55ab('0x12')]['code']===0x1f4){logger[_0x55ab('0x12')]('ZohoField,\x20%s,\x20%s',_0xfceb6c,_0x2e3597[_0x55ab('0x12')][_0x55ab('0x13')]);return _0x276217(_0x2e3597[_0x55ab('0x12')][_0x55ab('0x13')]);}logger[_0x55ab('0x12')](_0x55ab('0xe'),_0xfceb6c,_0x2e3597[_0x55ab('0x12')][_0x55ab('0x13')]);return _0x127538(_0x2e3597[_0x55ab('0x12')][_0x55ab('0x13')]);}else{logger[_0x55ab('0xd')](_0x55ab('0xe'),_0xfceb6c,'request\x20sent');_0x127538(_0x2e3597['result']['message']);}})[_0x55ab('0x14')](function(_0x4bdac8){logger['error']('ZohoField,\x20%s,\x20%s',_0xfceb6c,_0x4bdac8);_0x276217(_0x4bdac8);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 3e4a5e9..99bf162 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x12012d,_0x46e1f6){var _0x2ccaf1=function(_0x3a9488){while(--_0x3a9488){_0x12012d['push'](_0x12012d['shift']());}};_0x2ccaf1(++_0x46e1f6);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x85062d,_0x393121){var _0x19cb79=function(_0x55937f){while(--_0x55937f){_0x85062d['push'](_0x85062d['shift']());}};_0x19cb79(++_0x393121);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0xcb91[_0x168127];return _0x4c99ad;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index b3fb702..a91ad41 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 _0x7be9=['INTEGER','BOOLEAN','state','exports','STRING','unique_name_and_version','app.js'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x7be9,0xff));var _0x97be=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x7be9[_0x20ef64];return _0x3707d8;};'use strict';var Sequelize=require('sequelize');module[_0x97be('0x0')]={'name':{'type':Sequelize[_0x97be('0x1')],'allowNull':![],'unique':_0x97be('0x2')},'version':{'type':Sequelize[_0x97be('0x1')],'allowNull':![],'unique':_0x97be('0x2')},'main':{'type':Sequelize[_0x97be('0x1')],'defaultValue':_0x97be('0x3')},'filename':{'type':Sequelize[_0x97be('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x97be('0x4')]},'active':{'type':Sequelize[_0x97be('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x97be('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x97be('0x1')],'unique':_0x97be('0x6')},'description':{'type':Sequelize[_0x97be('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x97be('0x1')]},'link':{'type':Sequelize[_0x97be('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x3edd=['exports','STRING','unique_name_and_version','app.js','BOOLEAN','state','sequelize'];(function(_0x48e9fa,_0x24c10a){var _0xfc6a70=function(_0x422025){while(--_0x422025){_0x48e9fa['push'](_0x48e9fa['shift']());}};_0xfc6a70(++_0x24c10a);}(_0x3edd,0x14f));var _0xd3ed=function(_0x16da36,_0x3903d6){_0x16da36=_0x16da36-0x0;var _0x2212ff=_0x3edd[_0x16da36];return _0x2212ff;};'use strict';var Sequelize=require(_0xd3ed('0x0'));module[_0xd3ed('0x1')]={'name':{'type':Sequelize[_0xd3ed('0x2')],'allowNull':![],'unique':_0xd3ed('0x3')},'version':{'type':Sequelize[_0xd3ed('0x2')],'allowNull':![],'unique':_0xd3ed('0x3')},'main':{'type':Sequelize[_0xd3ed('0x2')],'defaultValue':_0xd3ed('0x4')},'filename':{'type':Sequelize[_0xd3ed('0x2')]},'path':{'type':Sequelize[_0xd3ed('0x2')]},'type':{'type':Sequelize[_0xd3ed('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xd3ed('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xd3ed('0x2')]},'logo':{'type':Sequelize[_0xd3ed('0x2')]},'state':{'type':Sequelize[_0xd3ed('0x2')],'unique':_0xd3ed('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xd3ed('0x2')]},'remoteUri':{'type':Sequelize[_0xd3ed('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index fe1eaa4..4ac1cc3 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 _0x6d38=['sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','filters','intersection','create','catch','body','find','params','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','Integration','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order'];(function(_0x5216e0,_0x4f8cb9){var _0x5b3f40=function(_0x30c832){while(--_0x30c832){_0x5216e0['push'](_0x5216e0['shift']());}};_0x5b3f40(++_0x4f8cb9);}(_0x6d38,0x1ef));var _0x86d3=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x6d38[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0x7d4d2e,_0x440a55){_0x440a55=_0x440a55||0xcc;return function(_0x26d64c){if(_0x26d64c){return _0x7d4d2e[_0x86d3('0x14')](_0x440a55);}return _0x7d4d2e[_0x86d3('0x15')](_0x440a55)[_0x86d3('0x16')]();};}function respondWithResult(_0x12ef4a,_0x5ce2ff){_0x5ce2ff=_0x5ce2ff||0xc8;return function(_0x1c1ba8){if(_0x1c1ba8){return _0x12ef4a[_0x86d3('0x15')](_0x5ce2ff)[_0x86d3('0x17')](_0x1c1ba8);}};}function respondWithFilteredResult(_0x207f6f,_0x1ea535){return function(_0x34fb3b){if(_0x34fb3b){var _0x1ff008=typeof _0x1ea535[_0x86d3('0x18')]==='undefined'&&typeof _0x1ea535[_0x86d3('0x19')]===_0x86d3('0x1a');var _0x431b3f=_0x34fb3b[_0x86d3('0x1b')];var _0x46feec=_0x1ff008?0x0:_0x1ea535[_0x86d3('0x18')];var _0x33e459=_0x1ff008?_0x34fb3b[_0x86d3('0x1b')]:_0x1ea535[_0x86d3('0x18')]+_0x1ea535['limit'];var _0x191ba5;if(_0x33e459>=_0x431b3f){_0x33e459=_0x431b3f;_0x191ba5=0xc8;}else{_0x191ba5=0xce;}_0x207f6f['status'](_0x191ba5);return _0x207f6f[_0x86d3('0x1c')]('Content-Range',_0x46feec+'-'+_0x33e459+'/'+_0x431b3f)['json'](_0x34fb3b);}return null;};}function patchUpdates(_0x41486a){return function(_0x1edb6d){try{jsonpatch[_0x86d3('0x1d')](_0x1edb6d,_0x41486a,!![]);}catch(_0x1720ae){return BPromise['reject'](_0x1720ae);}return _0x1edb6d[_0x86d3('0x1e')]();};}function saveUpdates(_0x55e1c3,_0x36e0fa){return function(_0x3fdf67){if(_0x3fdf67){return _0x3fdf67[_0x86d3('0x1f')](_0x55e1c3)['then'](function(_0x39d819){return _0x39d819;});}return null;};}function removeEntity(_0x72b3d4,_0x1fa4ac){return function(_0x4bf5b8){if(_0x4bf5b8){return _0x4bf5b8['destroy']()[_0x86d3('0x20')](function(){_0x72b3d4['status'](0xcc)[_0x86d3('0x16')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x21')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x22')];}_0x481077[_0x86d3('0x15')](_0x3359e4)[_0x86d3('0x23')](_0x611764);};}exports[_0x86d3('0x24')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=_[_0x86d3('0x25')](db[_0x86d3('0x26')][_0x86d3('0x27')],function(_0x28c25e){return{'name':_0x28c25e['fieldName'],'type':_0x28c25e[_0x86d3('0x28')][_0x86d3('0x29')]};});_0x35d708[_0x86d3('0x2a')]=_[_0x86d3('0x25')](_0x44dacf,_0x86d3('0x22'));_0x35d708[_0x86d3('0x2b')]=_['keys'](_0x11a6fd[_0x86d3('0x2b')]);_0x35d708['filters']=_['intersection'](_0x35d708[_0x86d3('0x2a')],_0x35d708[_0x86d3('0x2b')]);_0x1f203e[_0x86d3('0x2c')]=_['intersection'](_0x35d708[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x11a6fd['query'][_0x86d3('0x2d')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e[_0x86d3('0x2c')][_0x86d3('0x2e')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708[_0x86d3('0x2a')];if(!_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x2f')]('nolimit')){_0x1f203e['limit']=qs['limit'](_0x11a6fd[_0x86d3('0x2b')]['limit']);_0x1f203e[_0x86d3('0x18')]=qs['offset'](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x18')]);}_0x1f203e[_0x86d3('0x30')]=qs[_0x86d3('0x31')](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x31')]);_0x1f203e[_0x86d3('0x32')]=qs['filters'](_[_0x86d3('0x33')](_0x11a6fd[_0x86d3('0x2b')],_0x35d708['filters']),_0x44dacf);if(_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]){_0x1f203e[_0x86d3('0x32')]=_[_0x86d3('0x35')](_0x1f203e['where'],{'$or':_[_0x86d3('0x25')](_0x44dacf,function(_0x42ac0d){if(_0x42ac0d[_0x86d3('0x28')]!=='VIRTUAL'){var _0x5762ca={};_0x5762ca[_0x42ac0d[_0x86d3('0x22')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]+'%'};return _0x5762ca;}})});}_0x1f203e=_[_0x86d3('0x35')]({},_0x1f203e,_0x11a6fd[_0x86d3('0x36')]);var _0x3666fc={'where':_0x1f203e[_0x86d3('0x32')]};return db['Integration'][_0x86d3('0x1b')](_0x3666fc)[_0x86d3('0x20')](function(_0x2bdc67){_0x303f13[_0x86d3('0x1b')]=_0x2bdc67;if(_0x11a6fd['query'][_0x86d3('0x37')]){_0x1f203e[_0x86d3('0x38')]=[{'all':!![]}];}return db[_0x86d3('0x26')][_0x86d3('0x39')](_0x1f203e);})['then'](function(_0x587747){_0x303f13[_0x86d3('0x3a')]=_0x587747;return _0x303f13;})['then'](respondWithFilteredResult(_0x14c9ff,_0x1f203e))['catch'](handleError(_0x14c9ff,null));};exports[_0x86d3('0x3b')]=function(_0x1385fc,_0x43490a){var _0x35d6fe={'raw':![],'where':{'id':_0x1385fc['params']['id']}},_0x23ef72={};_0x23ef72[_0x86d3('0x2a')]=_[_0x86d3('0x3c')](db[_0x86d3('0x26')]['rawAttributes']);_0x23ef72[_0x86d3('0x2b')]=_[_0x86d3('0x3c')](_0x1385fc['query']);_0x23ef72[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x23ef72['model'],_0x23ef72['query']);_0x35d6fe['attributes']=_[_0x86d3('0x3e')](_0x23ef72[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x2d')]));_0x35d6fe[_0x86d3('0x2c')]=_0x35d6fe['attributes'][_0x86d3('0x2e')]?_0x35d6fe[_0x86d3('0x2c')]:_0x23ef72['model'];if(_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x37')]){_0x35d6fe[_0x86d3('0x38')]=[{'all':!![]}];}_0x35d6fe=_[_0x86d3('0x35')]({},_0x35d6fe,_0x1385fc[_0x86d3('0x36')]);return db[_0x86d3('0x26')]['find'](_0x35d6fe)[_0x86d3('0x20')](handleEntityNotFound(_0x43490a,null))[_0x86d3('0x20')](respondWithResult(_0x43490a,null))['catch'](handleError(_0x43490a,null));};exports[_0x86d3('0x3f')]=function(_0x412d0e,_0xd20863){return db[_0x86d3('0x26')][_0x86d3('0x3f')](_0x412d0e['body'],{})[_0x86d3('0x20')](respondWithResult(_0xd20863,0xc9))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x14fa58,_0x369b75){if(_0x14fa58[_0x86d3('0x41')]['id']){delete _0x14fa58[_0x86d3('0x41')]['id'];}return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x14fa58[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x369b75,null))[_0x86d3('0x20')](saveUpdates(_0x14fa58['body'],null))[_0x86d3('0x20')](respondWithResult(_0x369b75,null))[_0x86d3('0x40')](handleError(_0x369b75,null));};exports['destroy']=function(_0x43290d,_0x23a6ee){return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x43290d[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x23a6ee,null))['then'](removeEntity(_0x23a6ee,null))['catch'](handleError(_0x23a6ee,null));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Integration','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x3652c0,_0x263b28){var _0xa9c8d6=function(_0x148c53){while(--_0x148c53){_0x3652c0['push'](_0x3652c0['shift']());}};_0xa9c8d6(++_0x263b28);}(_0x7a54,0x106));var _0x47a5=function(_0x2e7bff,_0x5a96eb){_0x2e7bff=_0x2e7bff-0x0;var _0x489d26=_0x7a54[_0x2e7bff];return _0x489d26;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['Integration'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['Integration']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['Integration']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index df1b566..7654a9e 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 _0x392c=['moment','bluebird','request-promise','rimraf','./integration.attributes','define','Integration','lodash','../../config/logger','api'];(function(_0x4741c1,_0x4000b0){var _0x131543=function(_0x575f1b){while(--_0x575f1b){_0x4741c1['push'](_0x4741c1['shift']());}};_0x131543(++_0x4000b0);}(_0x392c,0x197));var _0xc392=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x392c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc392('0x0'));var util=require('util');var logger=require(_0xc392('0x1'))(_0xc392('0x2'));var moment=require(_0xc392('0x3'));var BPromise=require(_0xc392('0x4'));var rp=require(_0xc392('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc392('0x6'));var config=require('../../config/environment');var attributes=require(_0xc392('0x7'));module['exports']=function(_0x4bcc55,_0x4a926b){return _0x4bcc55[_0xc392('0x8')](_0xc392('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea7e=['moment','bluebird','request-promise','path','rimraf','./integration.attributes','exports','Integration','lodash','util','api'];(function(_0x334038,_0x486da7){var _0x3aa840=function(_0x1e9f49){while(--_0x1e9f49){_0x334038['push'](_0x334038['shift']());}};_0x3aa840(++_0x486da7);}(_0xea7e,0xb8));var _0xeea7=function(_0x3fb181,_0x500244){_0x3fb181=_0x3fb181-0x0;var _0x4b9edb=_0xea7e[_0x3fb181];return _0x4b9edb;};'use strict';var _=require(_0xeea7('0x0'));var util=require(_0xeea7('0x1'));var logger=require('../../config/logger')(_0xeea7('0x2'));var moment=require(_0xeea7('0x3'));var BPromise=require(_0xeea7('0x4'));var rp=require(_0xeea7('0x5'));var fs=require('fs');var path=require(_0xeea7('0x6'));var rimraf=require(_0xeea7('0x7'));var config=require('../../config/environment');var attributes=require(_0xeea7('0x8'));module[_0xeea7('0x9')]=function(_0xe632c6,_0x58e169){return _0xe632c6['define'](_0xeea7('0xa'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index b5d7d03..b4ac74a 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 _0x0295=['client','http','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','Integration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5c00c5,_0x2e25d5){var _0x54409b=function(_0x30bb7d){while(--_0x30bb7d){_0x5c00c5['push'](_0x5c00c5['shift']());}};_0x54409b(++_0x2e25d5);}(_0x0295,0x1f0));var _0x5029=function(_0x20c59f,_0x583d0a){_0x20c59f=_0x20c59f-0x0;var _0x2b6df8=_0x0295[_0x20c59f];return _0x2b6df8;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('Integration,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file +var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x49d14c,_0x4b4e3f){var _0x268973=function(_0x465ef2){while(--_0x465ef2){_0x49d14c['push'](_0x49d14c['shift']());}};_0x268973(++_0x4b4e3f);}(_0xba34,0x119));var _0x4ba3=function(_0x5afe4d,_0x385fb8){_0x5afe4d=_0x5afe4d-0x0;var _0x2e1cc6=_0xba34[_0x5afe4d];return _0x2e1cc6;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 4f5b761..8bd75b8 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 _0xc6ac=['./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2bde46,_0x112a03){var _0x564712=function(_0x53bf0d){while(--_0x53bf0d){_0x2bde46['push'](_0x2bde46['shift']());}};_0x564712(++_0x112a03);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2ba2cf,_0x1b822e){_0x2ba2cf=_0x2ba2cf-0x0;var _0x1d1475=_0xc6ac[_0x2ba2cf];return _0x1d1475;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0x12')]('/',auth[_0xcc6a('0xc')](),controller['create']);router[_0xcc6a('0x13')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['update']);router[_0xcc6a('0x14')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x896e=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x896e,0x1e9));var _0xe896=function(_0x38c066,_0x2e6711){_0x38c066=_0x38c066-0x0;var _0x4cd431=_0x896e[_0x38c066];return _0x4cd431;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var fs_extra=require(_0xe896('0x6'));var auth=require(_0xe896('0x7'));var interaction=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var controller=require(_0xe896('0xa'));router[_0xe896('0xb')]('/',auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0xb')](_0xe896('0xd'),auth[_0xe896('0xe')](),controller[_0xe896('0xf')]);router['get'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x11')]);router['post']('/',auth[_0xe896('0xe')](),controller['create']);router[_0xe896('0x12')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x13')]);router[_0xe896('0x14')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x15')]);module[_0xe896('0x16')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index c7e1893..fa8ac86 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 _0x0c68=['ENUM','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0x0c68,0x12f));var _0x80c6=function(_0x55177e,_0x422d75){_0x55177e=_0x55177e-0x0;var _0x4fc697=_0x0c68[_0x55177e];return _0x4fc697;};'use strict';var Sequelize=require(_0x80c6('0x0'));module[_0x80c6('0x1')]={'integration':{'type':Sequelize[_0x80c6('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x80c6('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x80c6('0x3')]},'contacts':{'type':Sequelize[_0x80c6('0x2')]},'uniqueid':{'type':Sequelize[_0x80c6('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x80c6('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x80c6('0x2')]},'membername':{'type':Sequelize[_0x80c6('0x2')]},'agentcalledAt':{'type':Sequelize[_0x80c6('0x4')]},'agentconnectAt':{'type':Sequelize[_0x80c6('0x4')]},'holdtime':{'type':Sequelize[_0x80c6('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x80c6('0x3')]},'agentacw':{'type':Sequelize[_0x80c6('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x80c6('0x3')]},'reason':{'type':Sequelize[_0x80c6('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x80c6('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x80c6('0x4')]},'lastevent':{'type':Sequelize[_0x80c6('0x2')]},'channel':{'type':Sequelize[_0x80c6('0x2')]},'channelstate':{'type':Sequelize[_0x80c6('0x3')]},'channelstatedesc':{'type':Sequelize[_0x80c6('0x2')]},'connectedlinenum':{'type':Sequelize[_0x80c6('0x2')]},'connectedlinename':{'type':Sequelize[_0x80c6('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x80c6('0x2')]},'context':{'type':Sequelize[_0x80c6('0x2')]},'exten':{'type':Sequelize[_0x80c6('0x2')]},'priority':{'type':Sequelize[_0x80c6('0x2')]},'destchannel':{'type':Sequelize[_0x80c6('0x2')]},'destchannelstate':{'type':Sequelize[_0x80c6('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x80c6('0x2')]},'destcalleridnum':{'type':Sequelize[_0x80c6('0x2')]},'destcalleridname':{'type':Sequelize[_0x80c6('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x80c6('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x80c6('0x2')]},'destlanguage':{'type':Sequelize[_0x80c6('0x2')]},'destaccountcode':{'type':Sequelize[_0x80c6('0x2')]},'destcontext':{'type':Sequelize[_0x80c6('0x2')]},'destexten':{'type':Sequelize[_0x80c6('0x2')]},'destpriority':{'type':Sequelize[_0x80c6('0x2')]},'destuniqueid':{'type':Sequelize[_0x80c6('0x2')]},'messageId':{'type':Sequelize[_0x80c6('0x2')]},'inReplyTo':{'type':Sequelize[_0x80c6('0x2')]},'subject':{'type':Sequelize[_0x80c6('0x2')]},'from':{'type':Sequelize[_0x80c6('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x80c6('0x6')]},'html':{'type':Sequelize[_0x80c6('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x80c6('0x7')]('SENT','SENDING',_0x80c6('0x8'),_0x80c6('0x9'))},'url':{'type':Sequelize[_0x80c6('0x2')]},'app':{'type':Sequelize[_0x80c6('0x2')]},'appdata':{'type':Sequelize[_0x80c6('0x2')]},'projectId':{'type':Sequelize[_0x80c6('0x3')]}}; \ No newline at end of file +var _0x83e7=['BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','FAILED','exports','STRING','INTEGER','DATE'];(function(_0xe58522,_0x58638c){var _0x3c229b=function(_0x5f507a){while(--_0x5f507a){_0xe58522['push'](_0xe58522['shift']());}};_0x3c229b(++_0x58638c);}(_0x83e7,0x74));var _0x783e=function(_0x5cc5dc,_0x1af669){_0x5cc5dc=_0x5cc5dc-0x0;var _0x421a9c=_0x83e7[_0x5cc5dc];return _0x421a9c;};'use strict';var Sequelize=require('sequelize');module[_0x783e('0x0')]={'integration':{'type':Sequelize[_0x783e('0x1')]},'eventChannel':{'type':Sequelize[_0x783e('0x1')]},'exitStatus':{'type':Sequelize[_0x783e('0x1')]},'ticketId':{'type':Sequelize[_0x783e('0x1')]},'integrationId':{'type':Sequelize[_0x783e('0x2')]},'contacts':{'type':Sequelize[_0x783e('0x1')]},'uniqueid':{'type':Sequelize[_0x783e('0x1')]},'calleridnum':{'type':Sequelize[_0x783e('0x1')]},'calleridname':{'type':Sequelize[_0x783e('0x1')]},'queue':{'type':Sequelize[_0x783e('0x1')]},'interface':{'type':Sequelize[_0x783e('0x1')]},'membername':{'type':Sequelize[_0x783e('0x1')]},'agentcalledAt':{'type':Sequelize[_0x783e('0x3')]},'agentconnectAt':{'type':Sequelize[_0x783e('0x3')]},'holdtime':{'type':Sequelize[_0x783e('0x2')]},'agentcomplete':{'type':Sequelize[_0x783e('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x783e('0x3')]},'talktime':{'type':Sequelize[_0x783e('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x783e('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x783e('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x783e('0x3')]},'lastevent':{'type':Sequelize[_0x783e('0x1')]},'channel':{'type':Sequelize[_0x783e('0x1')]},'channelstate':{'type':Sequelize[_0x783e('0x2')]},'channelstatedesc':{'type':Sequelize[_0x783e('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x783e('0x1')]},'language':{'type':Sequelize[_0x783e('0x1')]},'accountcode':{'type':Sequelize[_0x783e('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x783e('0x1')]},'priority':{'type':Sequelize[_0x783e('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x783e('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x783e('0x1')]},'destcalleridnum':{'type':Sequelize[_0x783e('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x783e('0x1')]},'destlanguage':{'type':Sequelize[_0x783e('0x1')]},'destaccountcode':{'type':Sequelize[_0x783e('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x783e('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x783e('0x1')]},'inReplyTo':{'type':Sequelize[_0x783e('0x1')]},'subject':{'type':Sequelize[_0x783e('0x1')]},'from':{'type':Sequelize[_0x783e('0x1')]},'to':{'type':Sequelize[_0x783e('0x1')]},'cc':{'type':Sequelize[_0x783e('0x1')]},'attachment':{'type':Sequelize[_0x783e('0x5')]},'html':{'type':Sequelize[_0x783e('0x5')]},'text':{'type':Sequelize[_0x783e('0x5')]},'status':{'type':Sequelize[_0x783e('0x6')]('SENT',_0x783e('0x7'),_0x783e('0x8'),_0x783e('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x783e('0x1')]},'appdata':{'type':Sequelize[_0x783e('0x1')]},'projectId':{'type':Sequelize[_0x783e('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 739e770..7b27e6d 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 _0xb8de=['undefined','limit','count','set','Content-Range','apply','save','update','error','stack','name','send','index','map','IntegrationReport','rawAttributes','type','key','intersection','model','query','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','includeAll','include','then','params','keys','length','create','body','catch','find','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../mysqldb','status','end','json','offset'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0xb8de,0x1cf));var _0xeb8d=function(_0x1a1a79,_0x35116c){_0x1a1a79=_0x1a1a79-0x0;var _0x42c72a=_0xb8de[_0x1a1a79];return _0x42c72a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeb8d('0x0'));var jsonpatch=require(_0xeb8d('0x1'));var rp=require(_0xeb8d('0x2'));var moment=require(_0xeb8d('0x3'));var BPromise=require(_0xeb8d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xeb8d('0x5'));var csv=require(_0xeb8d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb8d('0x7'));var _=require(_0xeb8d('0x8'));var squel=require(_0xeb8d('0x9'));var crypto=require(_0xeb8d('0xa'));var jsforce=require(_0xeb8d('0xb'));var deskjs=require(_0xeb8d('0xc'));var toCsv=require(_0xeb8d('0x6'));var querystring=require(_0xeb8d('0xd'));var Papa=require(_0xeb8d('0xe'));var Redis=require(_0xeb8d('0xf'));var authService=require(_0xeb8d('0x10'));var qs=require(_0xeb8d('0x11'));var as=require(_0xeb8d('0x12'));var hardwareService=require(_0xeb8d('0x13'));var logger=require(_0xeb8d('0x14'))(_0xeb8d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeb8d('0x16'))['db'];function respondWithStatusCode(_0x1c437c,_0x9b47a6){_0x9b47a6=_0x9b47a6||0xcc;return function(_0x2d1e84){if(_0x2d1e84){return _0x1c437c['sendStatus'](_0x9b47a6);}return _0x1c437c[_0xeb8d('0x17')](_0x9b47a6)[_0xeb8d('0x18')]();};}function respondWithResult(_0x2dcbf4,_0x180ff6){_0x180ff6=_0x180ff6||0xc8;return function(_0x3d0f40){if(_0x3d0f40){return _0x2dcbf4['status'](_0x180ff6)[_0xeb8d('0x19')](_0x3d0f40);}};}function respondWithFilteredResult(_0x4d7cc9,_0x12ed99){return function(_0x56e099){if(_0x56e099){var _0x41390d=typeof _0x12ed99[_0xeb8d('0x1a')]===_0xeb8d('0x1b')&&typeof _0x12ed99[_0xeb8d('0x1c')]===_0xeb8d('0x1b');var _0x4510db=_0x56e099['count'];var _0x16ef19=_0x41390d?0x0:_0x12ed99['offset'];var _0x1f3988=_0x41390d?_0x56e099[_0xeb8d('0x1d')]:_0x12ed99['offset']+_0x12ed99[_0xeb8d('0x1c')];var _0x17cad;if(_0x1f3988>=_0x4510db){_0x1f3988=_0x4510db;_0x17cad=0xc8;}else{_0x17cad=0xce;}_0x4d7cc9[_0xeb8d('0x17')](_0x17cad);return _0x4d7cc9[_0xeb8d('0x1e')](_0xeb8d('0x1f'),_0x16ef19+'-'+_0x1f3988+'/'+_0x4510db)[_0xeb8d('0x19')](_0x56e099);}return null;};}function patchUpdates(_0xcfee9c){return function(_0x52ef38){try{jsonpatch[_0xeb8d('0x20')](_0x52ef38,_0xcfee9c,!![]);}catch(_0x24b197){return BPromise['reject'](_0x24b197);}return _0x52ef38[_0xeb8d('0x21')]();};}function saveUpdates(_0x3e1c11,_0x30ec15){return function(_0x150ed0){if(_0x150ed0){return _0x150ed0[_0xeb8d('0x22')](_0x3e1c11)['then'](function(_0x5187f2){return _0x5187f2;});}return null;};}function removeEntity(_0x212cfd,_0x22afc5){return function(_0x212bc4){if(_0x212bc4){return _0x212bc4['destroy']()['then'](function(){_0x212cfd['status'](0xcc)[_0xeb8d('0x18')]();});}};}function handleEntityNotFound(_0x89a499,_0x305bd1){return function(_0x2ff5c8){if(!_0x2ff5c8){_0x89a499['sendStatus'](0x194);}return _0x2ff5c8;};}function handleError(_0x3acc3f,_0x4f419e){_0x4f419e=_0x4f419e||0x1f4;return function(_0x990ba){logger[_0xeb8d('0x23')](_0x990ba[_0xeb8d('0x24')]);if(_0x990ba[_0xeb8d('0x25')]){delete _0x990ba[_0xeb8d('0x25')];}_0x3acc3f[_0xeb8d('0x17')](_0x4f419e)[_0xeb8d('0x26')](_0x990ba);};}exports[_0xeb8d('0x27')]=function(_0x132aa3,_0x4ca083){var _0xa0ed54={},_0x3da26e={},_0x303275={'count':0x0,'rows':[]};var _0x3f297e=_[_0xeb8d('0x28')](db[_0xeb8d('0x29')][_0xeb8d('0x2a')],function(_0x2952cd){return{'name':_0x2952cd['fieldName'],'type':_0x2952cd[_0xeb8d('0x2b')][_0xeb8d('0x2c')]};});_0x3da26e['model']=_[_0xeb8d('0x28')](_0x3f297e,'name');_0x3da26e['query']=_['keys'](_0x132aa3['query']);_0x3da26e['filters']=_[_0xeb8d('0x2d')](_0x3da26e[_0xeb8d('0x2e')],_0x3da26e[_0xeb8d('0x2f')]);_0xa0ed54['attributes']=_[_0xeb8d('0x2d')](_0x3da26e[_0xeb8d('0x2e')],qs[_0xeb8d('0x30')](_0x132aa3['query'][_0xeb8d('0x30')]));_0xa0ed54[_0xeb8d('0x31')]=_0xa0ed54['attributes']['length']?_0xa0ed54[_0xeb8d('0x31')]:_0x3da26e[_0xeb8d('0x2e')];if(!_0x132aa3[_0xeb8d('0x2f')][_0xeb8d('0x32')](_0xeb8d('0x33'))){_0xa0ed54['limit']=qs[_0xeb8d('0x1c')](_0x132aa3[_0xeb8d('0x2f')][_0xeb8d('0x1c')]);_0xa0ed54[_0xeb8d('0x1a')]=qs[_0xeb8d('0x1a')](_0x132aa3[_0xeb8d('0x2f')][_0xeb8d('0x1a')]);}_0xa0ed54['order']=qs['sort'](_0x132aa3[_0xeb8d('0x2f')][_0xeb8d('0x34')]);_0xa0ed54[_0xeb8d('0x35')]=qs['filters'](_[_0xeb8d('0x36')](_0x132aa3[_0xeb8d('0x2f')],_0x3da26e[_0xeb8d('0x37')]),_0x3f297e);if(_0x132aa3[_0xeb8d('0x2f')][_0xeb8d('0x38')]){_0xa0ed54[_0xeb8d('0x35')]=_[_0xeb8d('0x39')](_0xa0ed54[_0xeb8d('0x35')],{'$or':_[_0xeb8d('0x28')](_0x3f297e,function(_0x1c28ed){if(_0x1c28ed[_0xeb8d('0x2b')]!=='VIRTUAL'){var _0x3600bf={};_0x3600bf[_0x1c28ed[_0xeb8d('0x25')]]={'$like':'%'+_0x132aa3['query']['filter']+'%'};return _0x3600bf;}})});}_0xa0ed54=_[_0xeb8d('0x39')]({},_0xa0ed54,_0x132aa3[_0xeb8d('0x3a')]);var _0x187d2c={'where':_0xa0ed54['where']};return db[_0xeb8d('0x29')]['count'](_0x187d2c)['then'](function(_0x17f1c6){_0x303275[_0xeb8d('0x1d')]=_0x17f1c6;if(_0x132aa3[_0xeb8d('0x2f')][_0xeb8d('0x3b')]){_0xa0ed54[_0xeb8d('0x3c')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0xa0ed54);})[_0xeb8d('0x3d')](function(_0x35b001){_0x303275['rows']=_0x35b001;return _0x303275;})[_0xeb8d('0x3d')](respondWithFilteredResult(_0x4ca083,_0xa0ed54))['catch'](handleError(_0x4ca083,null));};exports['show']=function(_0x2899ab,_0x40d0dc){var _0x5cea52={'raw':![],'where':{'id':_0x2899ab[_0xeb8d('0x3e')]['id']}},_0x472cf8={};_0x472cf8[_0xeb8d('0x2e')]=_[_0xeb8d('0x3f')](db[_0xeb8d('0x29')][_0xeb8d('0x2a')]);_0x472cf8['query']=_[_0xeb8d('0x3f')](_0x2899ab['query']);_0x472cf8[_0xeb8d('0x37')]=_['intersection'](_0x472cf8['model'],_0x472cf8[_0xeb8d('0x2f')]);_0x5cea52[_0xeb8d('0x31')]=_[_0xeb8d('0x2d')](_0x472cf8[_0xeb8d('0x2e')],qs[_0xeb8d('0x30')](_0x2899ab[_0xeb8d('0x2f')][_0xeb8d('0x30')]));_0x5cea52[_0xeb8d('0x31')]=_0x5cea52[_0xeb8d('0x31')][_0xeb8d('0x40')]?_0x5cea52[_0xeb8d('0x31')]:_0x472cf8[_0xeb8d('0x2e')];if(_0x2899ab[_0xeb8d('0x2f')][_0xeb8d('0x3b')]){_0x5cea52[_0xeb8d('0x3c')]=[{'all':!![]}];}_0x5cea52=_[_0xeb8d('0x39')]({},_0x5cea52,_0x2899ab[_0xeb8d('0x3a')]);return db[_0xeb8d('0x29')]['find'](_0x5cea52)[_0xeb8d('0x3d')](handleEntityNotFound(_0x40d0dc,null))['then'](respondWithResult(_0x40d0dc,null))['catch'](handleError(_0x40d0dc,null));};exports[_0xeb8d('0x41')]=function(_0x4c4dce,_0x1dddca){return db[_0xeb8d('0x29')][_0xeb8d('0x41')](_0x4c4dce[_0xeb8d('0x42')],{})['then'](respondWithResult(_0x1dddca,0xc9))[_0xeb8d('0x43')](handleError(_0x1dddca,null));};exports[_0xeb8d('0x22')]=function(_0x2d69e2,_0x359a9b){if(_0x2d69e2[_0xeb8d('0x42')]['id']){delete _0x2d69e2[_0xeb8d('0x42')]['id'];}return db[_0xeb8d('0x29')][_0xeb8d('0x44')]({'where':{'id':_0x2d69e2[_0xeb8d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x359a9b,null))[_0xeb8d('0x3d')](saveUpdates(_0x2d69e2['body'],null))['then'](respondWithResult(_0x359a9b,null))[_0xeb8d('0x43')](handleError(_0x359a9b,null));};exports['destroy']=function(_0x5cf762,_0x3ac543){return db['IntegrationReport'][_0xeb8d('0x44')]({'where':{'id':_0x5cf762['params']['id']}})[_0xeb8d('0x3d')](handleEntityNotFound(_0x3ac543,null))['then'](removeEntity(_0x3ac543,null))[_0xeb8d('0x43')](handleError(_0x3ac543,null));};exports[_0xeb8d('0x45')]=function(_0x44317f,_0x39f25b){return db[_0xeb8d('0x29')][_0xeb8d('0x45')]()[_0xeb8d('0x3d')](respondWithResult(_0x39f25b,null))[_0xeb8d('0x43')](handleError(_0x39f25b,null));}; \ No newline at end of file +var _0xd89f=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','error','stack','name','send','map','IntegrationReport','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','destroy','describe','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd89f,0x167));var _0xfd89=function(_0xd890c2,_0x2a7cfa){_0xd890c2=_0xd890c2-0x0;var _0x2710dc=_0xd89f[_0xd890c2];return _0x2710dc;};'use strict';var emlformat=require(_0xfd89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfd89('0x1'));var rp=require(_0xfd89('0x2'));var moment=require('moment');var BPromise=require(_0xfd89('0x3'));var Mustache=require('mustache');var util=require(_0xfd89('0x4'));var path=require(_0xfd89('0x5'));var sox=require(_0xfd89('0x6'));var csv=require(_0xfd89('0x7'));var ejs=require(_0xfd89('0x8'));var fs=require('fs');var fs_extra=require(_0xfd89('0x9'));var _=require(_0xfd89('0xa'));var squel=require(_0xfd89('0xb'));var crypto=require(_0xfd89('0xc'));var jsforce=require(_0xfd89('0xd'));var deskjs=require(_0xfd89('0xe'));var toCsv=require(_0xfd89('0x7'));var querystring=require('querystring');var Papa=require(_0xfd89('0xf'));var Redis=require(_0xfd89('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfd89('0x11'));var as=require(_0xfd89('0x12'));var hardwareService=require(_0xfd89('0x13'));var logger=require(_0xfd89('0x14'))(_0xfd89('0x15'));var utils=require(_0xfd89('0x16'));var config=require(_0xfd89('0x17'));var licenseUtil=require(_0xfd89('0x18'));var db=require(_0xfd89('0x19'))['db'];function respondWithStatusCode(_0x154e21,_0x39fe48){_0x39fe48=_0x39fe48||0xcc;return function(_0x5619c2){if(_0x5619c2){return _0x154e21[_0xfd89('0x1a')](_0x39fe48);}return _0x154e21[_0xfd89('0x1b')](_0x39fe48)[_0xfd89('0x1c')]();};}function respondWithResult(_0x11caba,_0x44000f){_0x44000f=_0x44000f||0xc8;return function(_0x6a6b86){if(_0x6a6b86){return _0x11caba[_0xfd89('0x1b')](_0x44000f)[_0xfd89('0x1d')](_0x6a6b86);}};}function respondWithFilteredResult(_0x54da60,_0x191e10){return function(_0x272590){if(_0x272590){var _0x2f0f5e=typeof _0x191e10[_0xfd89('0x1e')]===_0xfd89('0x1f')&&typeof _0x191e10[_0xfd89('0x20')]===_0xfd89('0x1f');var _0x46dcbe=_0x272590[_0xfd89('0x21')];var _0xc3d179=_0x2f0f5e?0x0:_0x191e10[_0xfd89('0x1e')];var _0x432481=_0x2f0f5e?_0x272590['count']:_0x191e10[_0xfd89('0x1e')]+_0x191e10[_0xfd89('0x20')];var _0x5e9520;if(_0x432481>=_0x46dcbe){_0x432481=_0x46dcbe;_0x5e9520=0xc8;}else{_0x5e9520=0xce;}_0x54da60[_0xfd89('0x1b')](_0x5e9520);return _0x54da60[_0xfd89('0x22')](_0xfd89('0x23'),_0xc3d179+'-'+_0x432481+'/'+_0x46dcbe)[_0xfd89('0x1d')](_0x272590);}return null;};}function patchUpdates(_0x4a8015){return function(_0x1840b9){try{jsonpatch[_0xfd89('0x24')](_0x1840b9,_0x4a8015,!![]);}catch(_0xb89dbf){return BPromise['reject'](_0xb89dbf);}return _0x1840b9['save']();};}function saveUpdates(_0x4984a5,_0x3f5ed9){return function(_0x3489f4){if(_0x3489f4){return _0x3489f4['update'](_0x4984a5)['then'](function(_0x28d5a9){return _0x28d5a9;});}return null;};}function removeEntity(_0x285ded,_0x25befd){return function(_0x34ac96){if(_0x34ac96){return _0x34ac96['destroy']()[_0xfd89('0x25')](function(){_0x285ded[_0xfd89('0x1b')](0xcc)[_0xfd89('0x1c')]();});}};}function handleEntityNotFound(_0x2165c9,_0x1767f9){return function(_0x51ef4b){if(!_0x51ef4b){_0x2165c9[_0xfd89('0x1a')](0x194);}return _0x51ef4b;};}function handleError(_0x2517a0,_0x42f797){_0x42f797=_0x42f797||0x1f4;return function(_0x2499b5){logger[_0xfd89('0x26')](_0x2499b5[_0xfd89('0x27')]);if(_0x2499b5[_0xfd89('0x28')]){delete _0x2499b5[_0xfd89('0x28')];}_0x2517a0['status'](_0x42f797)[_0xfd89('0x29')](_0x2499b5);};}exports['index']=function(_0x383dba,_0xe4d5c2){var _0xa1d8db={},_0x278d3a={},_0x1befb7={'count':0x0,'rows':[]};var _0x3b2274=_[_0xfd89('0x2a')](db[_0xfd89('0x2b')]['rawAttributes'],function(_0x45b26a){return{'name':_0x45b26a['fieldName'],'type':_0x45b26a[_0xfd89('0x2c')][_0xfd89('0x2d')]};});_0x278d3a[_0xfd89('0x2e')]=_[_0xfd89('0x2a')](_0x3b2274,_0xfd89('0x28'));_0x278d3a[_0xfd89('0x2f')]=_['keys'](_0x383dba[_0xfd89('0x2f')]);_0x278d3a[_0xfd89('0x30')]=_[_0xfd89('0x31')](_0x278d3a[_0xfd89('0x2e')],_0x278d3a[_0xfd89('0x2f')]);_0xa1d8db[_0xfd89('0x32')]=_['intersection'](_0x278d3a[_0xfd89('0x2e')],qs[_0xfd89('0x33')](_0x383dba[_0xfd89('0x2f')][_0xfd89('0x33')]));_0xa1d8db[_0xfd89('0x32')]=_0xa1d8db[_0xfd89('0x32')][_0xfd89('0x34')]?_0xa1d8db['attributes']:_0x278d3a[_0xfd89('0x2e')];if(!_0x383dba[_0xfd89('0x2f')][_0xfd89('0x35')](_0xfd89('0x36'))){_0xa1d8db[_0xfd89('0x20')]=qs[_0xfd89('0x20')](_0x383dba[_0xfd89('0x2f')][_0xfd89('0x20')]);_0xa1d8db[_0xfd89('0x1e')]=qs[_0xfd89('0x1e')](_0x383dba[_0xfd89('0x2f')][_0xfd89('0x1e')]);}_0xa1d8db[_0xfd89('0x37')]=qs[_0xfd89('0x38')](_0x383dba[_0xfd89('0x2f')][_0xfd89('0x38')]);_0xa1d8db[_0xfd89('0x39')]=qs[_0xfd89('0x30')](_[_0xfd89('0x3a')](_0x383dba[_0xfd89('0x2f')],_0x278d3a[_0xfd89('0x30')]),_0x3b2274);if(_0x383dba[_0xfd89('0x2f')]['filter']){_0xa1d8db[_0xfd89('0x39')]=_[_0xfd89('0x3b')](_0xa1d8db['where'],{'$or':_[_0xfd89('0x2a')](_0x3b2274,function(_0x4aead3){if(_0x4aead3['type']!==_0xfd89('0x3c')){var _0x552a6f={};_0x552a6f[_0x4aead3[_0xfd89('0x28')]]={'$like':'%'+_0x383dba[_0xfd89('0x2f')][_0xfd89('0x3d')]+'%'};return _0x552a6f;}})});}_0xa1d8db=_['merge']({},_0xa1d8db,_0x383dba[_0xfd89('0x3e')]);var _0x432898={'where':_0xa1d8db['where']};return db[_0xfd89('0x2b')]['count'](_0x432898)['then'](function(_0x5998e3){_0x1befb7[_0xfd89('0x21')]=_0x5998e3;if(_0x383dba[_0xfd89('0x2f')][_0xfd89('0x3f')]){_0xa1d8db['include']=[{'all':!![]}];}return db[_0xfd89('0x2b')][_0xfd89('0x40')](_0xa1d8db);})[_0xfd89('0x25')](function(_0x537f58){_0x1befb7[_0xfd89('0x41')]=_0x537f58;return _0x1befb7;})[_0xfd89('0x25')](respondWithFilteredResult(_0xe4d5c2,_0xa1d8db))[_0xfd89('0x42')](handleError(_0xe4d5c2,null));};exports[_0xfd89('0x43')]=function(_0xf5dcfc,_0x406309){var _0x12af05={'raw':![],'where':{'id':_0xf5dcfc[_0xfd89('0x44')]['id']}},_0x28dd79={};_0x28dd79[_0xfd89('0x2e')]=_[_0xfd89('0x45')](db['IntegrationReport'][_0xfd89('0x46')]);_0x28dd79[_0xfd89('0x2f')]=_[_0xfd89('0x45')](_0xf5dcfc[_0xfd89('0x2f')]);_0x28dd79['filters']=_[_0xfd89('0x31')](_0x28dd79[_0xfd89('0x2e')],_0x28dd79[_0xfd89('0x2f')]);_0x12af05[_0xfd89('0x32')]=_[_0xfd89('0x31')](_0x28dd79[_0xfd89('0x2e')],qs['fields'](_0xf5dcfc[_0xfd89('0x2f')][_0xfd89('0x33')]));_0x12af05[_0xfd89('0x32')]=_0x12af05[_0xfd89('0x32')][_0xfd89('0x34')]?_0x12af05[_0xfd89('0x32')]:_0x28dd79[_0xfd89('0x2e')];if(_0xf5dcfc[_0xfd89('0x2f')][_0xfd89('0x3f')]){_0x12af05[_0xfd89('0x47')]=[{'all':!![]}];}_0x12af05=_['merge']({},_0x12af05,_0xf5dcfc[_0xfd89('0x3e')]);return db[_0xfd89('0x2b')][_0xfd89('0x48')](_0x12af05)[_0xfd89('0x25')](handleEntityNotFound(_0x406309,null))['then'](respondWithResult(_0x406309,null))[_0xfd89('0x42')](handleError(_0x406309,null));};exports[_0xfd89('0x49')]=function(_0x5cde6a,_0x1442b0){return db['IntegrationReport'][_0xfd89('0x49')](_0x5cde6a[_0xfd89('0x4a')],{})[_0xfd89('0x25')](respondWithResult(_0x1442b0,0xc9))[_0xfd89('0x42')](handleError(_0x1442b0,null));};exports['update']=function(_0x29e359,_0x54ede4){if(_0x29e359[_0xfd89('0x4a')]['id']){delete _0x29e359['body']['id'];}return db[_0xfd89('0x2b')][_0xfd89('0x48')]({'where':{'id':_0x29e359[_0xfd89('0x44')]['id']}})['then'](handleEntityNotFound(_0x54ede4,null))[_0xfd89('0x25')](saveUpdates(_0x29e359[_0xfd89('0x4a')],null))[_0xfd89('0x25')](respondWithResult(_0x54ede4,null))[_0xfd89('0x42')](handleError(_0x54ede4,null));};exports[_0xfd89('0x4b')]=function(_0x728589,_0x2c8c23){return db[_0xfd89('0x2b')][_0xfd89('0x48')]({'where':{'id':_0x728589['params']['id']}})['then'](handleEntityNotFound(_0x2c8c23,null))[_0xfd89('0x25')](removeEntity(_0x2c8c23,null))['catch'](handleError(_0x2c8c23,null));};exports[_0xfd89('0x4c')]=function(_0x575c6e,_0x698e4e){return db[_0xfd89('0x2b')][_0xfd89('0x4c')]()[_0xfd89('0x25')](respondWithResult(_0x698e4e,null))[_0xfd89('0x42')](handleError(_0x698e4e,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index b7266cd..3e648a6 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 _0x961b=['bluebird','request-promise','./integrationReport.attributes','exports','define','report_integration','lodash','../../config/logger','api','moment'];(function(_0x521a1c,_0x1510b2){var _0x5dbe62=function(_0x5c2202){while(--_0x5c2202){_0x521a1c['push'](_0x521a1c['shift']());}};_0x5dbe62(++_0x1510b2);}(_0x961b,0x18c));var _0xb961=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0x961b[_0x34bc6c];return _0x168820;};'use strict';var _=require(_0xb961('0x0'));var util=require('util');var logger=require(_0xb961('0x1'))(_0xb961('0x2'));var moment=require(_0xb961('0x3'));var BPromise=require(_0xb961('0x4'));var rp=require(_0xb961('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb961('0x6'));module[_0xb961('0x7')]=function(_0x3fbf50,_0x1c78e0){return _0x3fbf50[_0xb961('0x8')]('IntegrationReport',attributes,{'tableName':_0xb961('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea20=['rimraf','lodash','../../config/logger','api','moment','bluebird'];(function(_0x37ae8e,_0x25821e){var _0x1bc5a2=function(_0x196ab3){while(--_0x196ab3){_0x37ae8e['push'](_0x37ae8e['shift']());}};_0x1bc5a2(++_0x25821e);}(_0xea20,0x85));var _0x0ea2=function(_0x22c800,_0x441cb8){_0x22c800=_0x22c800-0x0;var _0x5abf20=_0xea20[_0x22c800];return _0x5abf20;};'use strict';var _=require(_0x0ea2('0x0'));var util=require('util');var logger=require(_0x0ea2('0x1'))(_0x0ea2('0x2'));var moment=require(_0x0ea2('0x3'));var BPromise=require(_0x0ea2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0ea2('0x5'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module['exports']=function(_0x328ea0,_0x1be372){return _0x328ea0['define']('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index eb02791..3138d03 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 _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x59a230,_0x491399){var _0x52ab4b=function(_0x34a3f2){while(--_0x34a3f2){_0x59a230['push'](_0x59a230['shift']());}};_0x52ab4b(++_0x491399);}(_0x4819,0xcd));var _0x9481=function(_0x1ca741,_0x5c758c){_0x1ca741=_0x1ca741-0x0;var _0x54a577=_0x4819[_0x1ca741];return _0x54a577;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});} \ No newline at end of file +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(_0x32e99c,_0x2c9642){var _0x100550=function(_0x42d27a){while(--_0x42d27a){_0x32e99c['push'](_0x32e99c['shift']());}};_0x100550(++_0x2c9642);}(_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 diff --git a/server/api/interval/index.js b/server/api/interval/index.js index c6f55ac..53c1cb1 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 _0x8f04=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put'];(function(_0x281cf2,_0x2627a4){var _0x5284ec=function(_0x239c36){while(--_0x239c36){_0x281cf2['push'](_0x281cf2['shift']());}};_0x5284ec(++_0x2627a4);}(_0x8f04,0xbc));var _0x48f0=function(_0x1848b5,_0x3e81d9){_0x1848b5=_0x1848b5-0x0;var _0x455dc1=_0x8f04[_0x1848b5];return _0x455dc1;};'use strict';var multer=require(_0x48f0('0x0'));var util=require(_0x48f0('0x1'));var path=require(_0x48f0('0x2'));var timeout=require(_0x48f0('0x3'));var express=require('express');var router=express[_0x48f0('0x4')]();var fs_extra=require(_0x48f0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x48f0('0x6'));var controller=require('./interval.controller');router[_0x48f0('0x7')]('/',auth[_0x48f0('0x8')](),controller[_0x48f0('0x9')]);router[_0x48f0('0x7')](_0x48f0('0xa'),auth[_0x48f0('0x8')](),controller[_0x48f0('0xb')]);router[_0x48f0('0x7')](_0x48f0('0xc'),auth[_0x48f0('0x8')](),controller[_0x48f0('0xd')]);router[_0x48f0('0xe')]('/',auth[_0x48f0('0x8')](),controller[_0x48f0('0xf')]);router['post'](_0x48f0('0xc'),auth['isAuthenticated'](),controller['addInterval']);router[_0x48f0('0xe')](_0x48f0('0x10'),auth[_0x48f0('0x8')](),controller[_0x48f0('0x11')]);router[_0x48f0('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x48f0('0x13')]);router[_0x48f0('0x14')](_0x48f0('0xa'),auth[_0x48f0('0x8')](),controller[_0x48f0('0x15')]);module[_0x48f0('0x16')]=router; \ No newline at end of file +var _0x3471=['isAuthenticated','show','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','/:id'];(function(_0x40baac,_0x45b795){var _0x33f68a=function(_0x1de171){while(--_0x1de171){_0x40baac['push'](_0x40baac['shift']());}};_0x33f68a(++_0x45b795);}(_0x3471,0x106));var _0x1347=function(_0x55f036,_0x540aca){_0x55f036=_0x55f036-0x0;var _0x109c5b=_0x3471[_0x55f036];return _0x109c5b;};'use strict';var multer=require(_0x1347('0x0'));var util=require('util');var path=require(_0x1347('0x1'));var timeout=require(_0x1347('0x2'));var express=require(_0x1347('0x3'));var router=express[_0x1347('0x4')]();var fs_extra=require(_0x1347('0x5'));var auth=require(_0x1347('0x6'));var interaction=require(_0x1347('0x7'));var config=require('../../config/environment');var controller=require(_0x1347('0x8'));router[_0x1347('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1347('0x9')](_0x1347('0xa'),auth[_0x1347('0xb')](),controller[_0x1347('0xc')]);router[_0x1347('0x9')](_0x1347('0xd'),auth[_0x1347('0xb')](),controller[_0x1347('0xe')]);router['post']('/',auth[_0x1347('0xb')](),controller[_0x1347('0xf')]);router[_0x1347('0x10')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x1347('0x11')]);router[_0x1347('0x10')](_0x1347('0x12'),auth[_0x1347('0xb')](),controller[_0x1347('0x13')]);router['put'](_0x1347('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1347('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 9189420..c63c898 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 _0xb9bf=['exports','STRING','sequelize'];(function(_0x56ff47,_0x2da5d2){var _0x5413bd=function(_0x2145d0){while(--_0x2145d0){_0x56ff47['push'](_0x56ff47['shift']());}};_0x5413bd(++_0x2da5d2);}(_0xb9bf,0x179));var _0xfb9b=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xb9bf[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0xfb9b('0x0'));module[_0xfb9b('0x1')]={'name':{'type':Sequelize[_0xfb9b('0x2')]},'description':{'type':Sequelize[_0xfb9b('0x2')]},'interval':{'type':Sequelize[_0xfb9b('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x8024=['exports','STRING','sequelize'];(function(_0x3bf1c,_0x17ad5c){var _0x3a02f1=function(_0x17cc7d){while(--_0x17cc7d){_0x3bf1c['push'](_0x3bf1c['shift']());}};_0x3a02f1(++_0x17ad5c);}(_0x8024,0x16d));var _0x4802=function(_0x4074a1,_0x576808){_0x4074a1=_0x4074a1-0x0;var _0x11a0fb=_0x8024[_0x4074a1];return _0x11a0fb;};'use strict';var Sequelize=require(_0x4802('0x0'));module[_0x4802('0x1')]={'name':{'type':Sequelize[_0x4802('0x2')]},'description':{'type':Sequelize[_0x4802('0x2')]},'interval':{'type':Sequelize[_0x4802('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 7695ca1..695fa1f 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 _0x22a7=['sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','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/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','set','reject','update','then','get','Intervals','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','fieldName','type','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x22a7,0x18c));var _0x722a=function(_0xdef99e,_0x2050b8){_0xdef99e=_0xdef99e-0x0;var _0x395cd8=_0x22a7[_0xdef99e];return _0x395cd8;};'use strict';var emlformat=require(_0x722a('0x0'));var rimraf=require(_0x722a('0x1'));var zipdir=require(_0x722a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x722a('0x3'));var moment=require(_0x722a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x722a('0x5'));var util=require('util');var path=require(_0x722a('0x6'));var sox=require(_0x722a('0x7'));var csv=require(_0x722a('0x8'));var ejs=require(_0x722a('0x9'));var fs=require('fs');var fs_extra=require(_0x722a('0xa'));var _=require(_0x722a('0xb'));var squel=require(_0x722a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x722a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x722a('0xe'));var Papa=require(_0x722a('0xf'));var Redis=require('ioredis');var authService=require(_0x722a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x722a('0x11'));var hardwareService=require(_0x722a('0x12'));var logger=require(_0x722a('0x13'))(_0x722a('0x14'));var utils=require('../../config/utils');var config=require(_0x722a('0x15'));var licenseUtil=require(_0x722a('0x16'));var db=require(_0x722a('0x17'))['db'];var extensions=require(_0x722a('0x18'));function respondWithStatusCode(_0x5df41b,_0x40eb26){_0x40eb26=_0x40eb26||0xcc;return function(_0x4f6799){if(_0x4f6799){return _0x5df41b[_0x722a('0x19')](_0x40eb26);}return _0x5df41b[_0x722a('0x1a')](_0x40eb26)[_0x722a('0x1b')]();};}function respondWithResult(_0x289715,_0x59b432){_0x59b432=_0x59b432||0xc8;return function(_0x3aeea2){if(_0x3aeea2){return _0x289715[_0x722a('0x1a')](_0x59b432)[_0x722a('0x1c')](_0x3aeea2);}};}function respondWithFilteredResult(_0x1240f3,_0x571dc4){return function(_0x1149d3){if(_0x1149d3){var _0x54ba83=typeof _0x571dc4[_0x722a('0x1d')]===_0x722a('0x1e')&&typeof _0x571dc4[_0x722a('0x1f')]===_0x722a('0x1e');var _0x57b546=_0x1149d3['count'];var _0x454a40=_0x54ba83?0x0:_0x571dc4['offset'];var _0x1395c6=_0x54ba83?_0x1149d3['count']:_0x571dc4[_0x722a('0x1d')]+_0x571dc4[_0x722a('0x1f')];var _0x2b8d4c;if(_0x1395c6>=_0x57b546){_0x1395c6=_0x57b546;_0x2b8d4c=0xc8;}else{_0x2b8d4c=0xce;}_0x1240f3[_0x722a('0x1a')](_0x2b8d4c);return _0x1240f3[_0x722a('0x20')]('Content-Range',_0x454a40+'-'+_0x1395c6+'/'+_0x57b546)[_0x722a('0x1c')](_0x1149d3);}return null;};}function patchUpdates(_0x3ff736){return function(_0x459581){try{jsonpatch['apply'](_0x459581,_0x3ff736,!![]);}catch(_0x78144a){return BPromise[_0x722a('0x21')](_0x78144a);}return _0x459581['save']();};}function saveUpdates(_0x3dc85e,_0x49b724){return function(_0x12e5cb){if(_0x12e5cb){return _0x12e5cb[_0x722a('0x22')](_0x3dc85e)[_0x722a('0x23')](function(_0x4f3fb4){return _0x4f3fb4;});}return null;};}function removeEntity(_0x25e952,_0x2d49c7){return function(_0x54bc92){if(_0x54bc92){return _0x54bc92['destroy']()[_0x722a('0x23')](function(){var _0x1cd9d8=_0x54bc92[_0x722a('0x24')]({'plain':!![]});var _0x257643=_0x722a('0x25');return db[_0x722a('0x26')]['destroy']({'where':{'type':_0x257643,'resourceId':_0x1cd9d8['id']}})[_0x722a('0x23')](function(){return _0x54bc92;});})[_0x722a('0x23')](function(){_0x25e952[_0x722a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x337bca,_0x5bdbe5){return function(_0x26b454){if(!_0x26b454){_0x337bca['sendStatus'](0x194);}return _0x26b454;};}function handleError(_0x4ea210,_0x44da09){_0x44da09=_0x44da09||0x1f4;return function(_0x5c17a3){logger[_0x722a('0x27')](_0x5c17a3[_0x722a('0x28')]);if(_0x5c17a3[_0x722a('0x29')]){delete _0x5c17a3['name'];}_0x4ea210[_0x722a('0x1a')](_0x44da09)[_0x722a('0x2a')](_0x5c17a3);};}exports[_0x722a('0x2b')]=function(_0x56164b,_0x5f181a){var _0x4bc800={},_0x4f7274={},_0x14e48d={'count':0x0,'rows':[]};var _0x44f9dc=_['map'](db[_0x722a('0x2c')][_0x722a('0x2d')],function(_0x191728){return{'name':_0x191728[_0x722a('0x2e')],'type':_0x191728[_0x722a('0x2f')]['key']};});_0x4f7274['model']=_[_0x722a('0x30')](_0x44f9dc,'name');_0x4f7274['query']=_['keys'](_0x56164b[_0x722a('0x31')]);_0x4f7274[_0x722a('0x32')]=_[_0x722a('0x33')](_0x4f7274['model'],_0x4f7274[_0x722a('0x31')]);_0x4bc800[_0x722a('0x34')]=_[_0x722a('0x33')](_0x4f7274[_0x722a('0x35')],qs[_0x722a('0x36')](_0x56164b[_0x722a('0x31')]['fields']));_0x4bc800['attributes']=_0x4bc800[_0x722a('0x34')][_0x722a('0x37')]?_0x4bc800[_0x722a('0x34')]:_0x4f7274['model'];if(!_0x56164b[_0x722a('0x31')][_0x722a('0x38')](_0x722a('0x39'))){_0x4bc800[_0x722a('0x1f')]=qs[_0x722a('0x1f')](_0x56164b[_0x722a('0x31')][_0x722a('0x1f')]);_0x4bc800[_0x722a('0x1d')]=qs['offset'](_0x56164b[_0x722a('0x31')]['offset']);}_0x4bc800[_0x722a('0x3a')]=qs[_0x722a('0x3b')](_0x56164b[_0x722a('0x31')]['sort']);_0x4bc800[_0x722a('0x3c')]=qs[_0x722a('0x32')](_[_0x722a('0x3d')](_0x56164b[_0x722a('0x31')],_0x4f7274[_0x722a('0x32')]),_0x44f9dc);if(_0x56164b[_0x722a('0x31')][_0x722a('0x3e')]){_0x4bc800[_0x722a('0x3c')]=_[_0x722a('0x3f')](_0x4bc800[_0x722a('0x3c')],{'$or':_[_0x722a('0x30')](_0x44f9dc,function(_0x1c337c){if(_0x1c337c['type']!==_0x722a('0x40')){var _0x3ebb89={};_0x3ebb89[_0x1c337c[_0x722a('0x29')]]={'$like':'%'+_0x56164b['query'][_0x722a('0x3e')]+'%'};return _0x3ebb89;}})});}_0x4bc800=_[_0x722a('0x3f')]({},_0x4bc800,_0x56164b[_0x722a('0x41')]);var _0x3f1b91={'where':_0x4bc800[_0x722a('0x3c')]};return db[_0x722a('0x2c')]['count'](_0x3f1b91)['then'](function(_0x3ea8e1){_0x14e48d[_0x722a('0x42')]=_0x3ea8e1;if(_0x56164b[_0x722a('0x31')][_0x722a('0x43')]){_0x4bc800[_0x722a('0x44')]=[{'all':!![]}];}return db[_0x722a('0x2c')][_0x722a('0x45')](_0x4bc800);})[_0x722a('0x23')](function(_0x2aa0ab){_0x14e48d['rows']=_0x2aa0ab;return _0x14e48d;})['then'](respondWithFilteredResult(_0x5f181a,_0x4bc800))[_0x722a('0x46')](handleError(_0x5f181a,null));};exports[_0x722a('0x47')]=function(_0x4fd028,_0x47ff00){var _0x115406={'raw':!![],'where':{'id':_0x4fd028[_0x722a('0x48')]['id']}},_0x18d1a5={};_0x18d1a5[_0x722a('0x35')]=_[_0x722a('0x49')](db[_0x722a('0x2c')]['rawAttributes']);_0x18d1a5['query']=_[_0x722a('0x49')](_0x4fd028[_0x722a('0x31')]);_0x18d1a5[_0x722a('0x32')]=_[_0x722a('0x33')](_0x18d1a5['model'],_0x18d1a5[_0x722a('0x31')]);_0x115406['attributes']=_[_0x722a('0x33')](_0x18d1a5[_0x722a('0x35')],qs['fields'](_0x4fd028[_0x722a('0x31')][_0x722a('0x36')]));_0x115406[_0x722a('0x34')]=_0x115406[_0x722a('0x34')][_0x722a('0x37')]?_0x115406[_0x722a('0x34')]:_0x18d1a5[_0x722a('0x35')];if(_0x4fd028['query'][_0x722a('0x43')]){_0x115406[_0x722a('0x44')]=[{'all':!![]}];}_0x115406=_[_0x722a('0x3f')]({},_0x115406,_0x4fd028[_0x722a('0x41')]);return db[_0x722a('0x2c')][_0x722a('0x4a')](_0x115406)[_0x722a('0x23')](handleEntityNotFound(_0x47ff00,null))['then'](respondWithResult(_0x47ff00,null))[_0x722a('0x46')](handleError(_0x47ff00,null));};exports[_0x722a('0x4b')]=function(_0x5d2d0a,_0x2bf0b0){return db[_0x722a('0x2c')]['create'](_0x5d2d0a[_0x722a('0x4c')],{})[_0x722a('0x23')](function(_0x537bf9){var _0x723d50=_0x5d2d0a[_0x722a('0x4d')][_0x722a('0x24')]({'plain':!![]});if(!_0x723d50)throw new Error(_0x722a('0x4e'));if(_0x723d50[_0x722a('0x4f')]==='user'){var _0x2fd4e5=_0x537bf9[_0x722a('0x24')]({'plain':!![]});var _0x10836a=_0x722a('0x25');return db['UserProfileSection'][_0x722a('0x4a')]({'where':{'name':_0x10836a,'userProfileId':_0x723d50[_0x722a('0x50')]},'raw':!![]})['then'](function(_0x53964e){if(_0x53964e&&_0x53964e['autoAssociation']===0x0){return db[_0x722a('0x26')][_0x722a('0x4b')]({'name':_0x2fd4e5[_0x722a('0x29')],'resourceId':_0x2fd4e5['id'],'type':_0x53964e[_0x722a('0x29')],'sectionId':_0x53964e['id']},{})[_0x722a('0x23')](function(){return _0x537bf9;});}else{return _0x537bf9;}})['catch'](function(_0x1117b0){logger[_0x722a('0x27')](_0x722a('0x51'),_0x1117b0);throw _0x1117b0;});}return _0x537bf9;})['then'](respondWithResult(_0x2bf0b0,0xc9))[_0x722a('0x46')](handleError(_0x2bf0b0,null));};exports['update']=function(_0x2928d2,_0x5f0a46){if(_0x2928d2[_0x722a('0x4c')]['id']){delete _0x2928d2[_0x722a('0x4c')]['id'];}return db[_0x722a('0x2c')][_0x722a('0x4a')]({'where':{'id':_0x2928d2[_0x722a('0x48')]['id']}})[_0x722a('0x23')](handleEntityNotFound(_0x5f0a46,null))[_0x722a('0x23')](saveUpdates(_0x2928d2[_0x722a('0x4c')],null))[_0x722a('0x23')](respondWithResult(_0x5f0a46,null))[_0x722a('0x46')](handleError(_0x5f0a46,null));};exports[_0x722a('0x52')]=function(_0x48a58c,_0x120a54){return db[_0x722a('0x2c')]['find']({'where':{'id':_0x48a58c[_0x722a('0x48')]['id']}})['then'](handleEntityNotFound(_0x120a54,null))[_0x722a('0x23')](removeEntity(_0x120a54,null))['catch'](handleError(_0x120a54,null));};exports[_0x722a('0x53')]=function(_0x38f463,_0x3e6c82,_0x1b7093){if(_0x38f463[_0x722a('0x4c')]['id']){delete _0x38f463[_0x722a('0x4c')]['id'];}return db[_0x722a('0x2c')][_0x722a('0x4a')]({'where':{'id':_0x38f463[_0x722a('0x48')]['id']}})['then'](handleEntityNotFound(_0x3e6c82,null))[_0x722a('0x23')](function(_0x10b7fe){if(_0x10b7fe){_0x38f463[_0x722a('0x4c')][_0x722a('0x54')]=_0x10b7fe['id'];return db[_0x722a('0x2c')][_0x722a('0x4b')](_0x38f463[_0x722a('0x4c')]);}})[_0x722a('0x23')](respondWithResult(_0x3e6c82,null))['catch'](handleError(_0x3e6c82,null));};exports[_0x722a('0x55')]=function(_0x491551,_0x270615,_0xbdf41c){var _0x3cdbd9={};var _0x24a4a8={};var _0x37b447;var _0x2c414b;return db[_0x722a('0x2c')][_0x722a('0x56')]({'where':{'id':_0x491551['params']['id']}})[_0x722a('0x23')](handleEntityNotFound(_0x270615,null))[_0x722a('0x23')](function(_0x436f22){if(_0x436f22){_0x37b447=_0x436f22;_0x24a4a8['model']=_[_0x722a('0x49')](db[_0x722a('0x2c')][_0x722a('0x2d')]);_0x24a4a8[_0x722a('0x31')]=_[_0x722a('0x49')](_0x491551[_0x722a('0x31')]);_0x24a4a8[_0x722a('0x32')]=_[_0x722a('0x33')](_0x24a4a8[_0x722a('0x35')],_0x24a4a8[_0x722a('0x31')]);_0x3cdbd9[_0x722a('0x34')]=_[_0x722a('0x33')](_0x24a4a8[_0x722a('0x35')],qs[_0x722a('0x36')](_0x491551[_0x722a('0x31')][_0x722a('0x36')]));_0x3cdbd9['attributes']=_0x3cdbd9['attributes']['length']?_0x3cdbd9[_0x722a('0x34')]:_0x24a4a8[_0x722a('0x35')];_0x3cdbd9[_0x722a('0x3a')]=qs[_0x722a('0x3b')](_0x491551[_0x722a('0x31')][_0x722a('0x3b')]);_0x3cdbd9[_0x722a('0x3c')]=qs[_0x722a('0x32')](_['pick'](_0x491551[_0x722a('0x31')],_0x24a4a8['filters']));if(_0x491551[_0x722a('0x31')][_0x722a('0x3e')]){_0x3cdbd9['where']=_['merge'](_0x3cdbd9[_0x722a('0x3c')],{'$or':_[_0x722a('0x30')](_0x3cdbd9[_0x722a('0x34')],function(_0x4ab318){var _0x3cff64={};_0x3cff64[_0x4ab318]={'$like':'%'+_0x491551[_0x722a('0x31')]['filter']+'%'};return _0x3cff64;})});}_0x3cdbd9=_[_0x722a('0x3f')]({},_0x3cdbd9,_0x491551['options']);return _0x37b447[_0x722a('0x55')](_0x3cdbd9);}})['then'](function(_0x3ae0dc){if(_0x3ae0dc){_0x2c414b=_0x3ae0dc[_0x722a('0x37')];if(!_0x491551[_0x722a('0x31')][_0x722a('0x38')]('nolimit')){_0x3cdbd9[_0x722a('0x1f')]=qs[_0x722a('0x1f')](_0x491551[_0x722a('0x31')][_0x722a('0x1f')]);_0x3cdbd9[_0x722a('0x1d')]=qs['offset'](_0x491551[_0x722a('0x31')][_0x722a('0x1d')]);}return _0x37b447[_0x722a('0x55')](_0x3cdbd9);}})[_0x722a('0x23')](function(_0x3554fe){if(_0x3554fe){return _0x3554fe?{'count':_0x2c414b,'rows':_0x3554fe}:null;}})[_0x722a('0x23')](respondWithResult(_0x270615,null))[_0x722a('0x46')](handleError(_0x270615,null));};exports[_0x722a('0x57')]=function(_0x151192,_0x99593a,_0x1f4ccf){return db[_0x722a('0x2c')][_0x722a('0x56')]({'where':{'id':_0x151192[_0x722a('0x48')]['id']}})[_0x722a('0x23')](handleEntityNotFound(_0x99593a,null))[_0x722a('0x23')](function(_0x2539d4){if(_0x2539d4){return db[_0x722a('0x58')][_0x722a('0x59')](function(_0x5fe5cb){return db[_0x722a('0x2c')][_0x722a('0x52')]({'where':{'IntervalId':_0x151192[_0x722a('0x48')]['id']},'transaction':_0x5fe5cb})[_0x722a('0x23')](function(_0x356e7b){var _0x20ef94=_[_0x722a('0x30')](_0x151192[_0x722a('0x4c')],function(_0x38b252){delete _0x38b252['id'];_0x38b252['IntervalId']=_0x151192['params']['id'];return _0x38b252;});return db['Interval'][_0x722a('0x5a')](_0x20ef94,{'transaction':_0x5fe5cb});});})[_0x722a('0x23')](function(){return db[_0x722a('0x2c')]['findAll']({'where':{'IntervalId':_0x151192[_0x722a('0x48')]['id']}});});}})[_0x722a('0x23')](respondWithResult(_0x99593a,null))[_0x722a('0x46')](handleError(_0x99593a,null));}; \ No newline at end of file +var _0x003e=['Interval','include','findAll','rows','params','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','findOne','getIntervals','addIntervals','sequelize','transaction','bulkCreate','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x003e,0x73));var _0xe003=function(_0x500c0,_0xdb6a03){_0x500c0=_0x500c0-0x0;var _0xdd146f=_0x003e[_0x500c0];return _0xdd146f;};'use strict';var emlformat=require(_0xe003('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe003('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe003('0x2'));var moment=require(_0xe003('0x3'));var BPromise=require(_0xe003('0x4'));var Mustache=require(_0xe003('0x5'));var util=require(_0xe003('0x6'));var path=require(_0xe003('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe003('0x8'));var _=require(_0xe003('0x9'));var squel=require('squel');var crypto=require(_0xe003('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe003('0xb'));var toCsv=require(_0xe003('0xc'));var querystring=require('querystring');var Papa=require(_0xe003('0xd'));var Redis=require(_0xe003('0xe'));var authService=require(_0xe003('0xf'));var qs=require(_0xe003('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe003('0x11'));var logger=require(_0xe003('0x12'))(_0xe003('0x13'));var utils=require(_0xe003('0x14'));var config=require(_0xe003('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe003('0x16'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x2c2927,_0x1d53d4){_0x1d53d4=_0x1d53d4||0xcc;return function(_0x2215bb){if(_0x2215bb){return _0x2c2927[_0xe003('0x17')](_0x1d53d4);}return _0x2c2927[_0xe003('0x18')](_0x1d53d4)['end']();};}function respondWithResult(_0x28cc89,_0x4cfbcf){_0x4cfbcf=_0x4cfbcf||0xc8;return function(_0x14c679){if(_0x14c679){return _0x28cc89[_0xe003('0x18')](_0x4cfbcf)[_0xe003('0x19')](_0x14c679);}};}function respondWithFilteredResult(_0x5edc33,_0x53b230){return function(_0x15e0fa){if(_0x15e0fa){var _0x1f2047=typeof _0x53b230[_0xe003('0x1a')]===_0xe003('0x1b')&&typeof _0x53b230[_0xe003('0x1c')]===_0xe003('0x1b');var _0x53fb56=_0x15e0fa[_0xe003('0x1d')];var _0x34b6e1=_0x1f2047?0x0:_0x53b230[_0xe003('0x1a')];var _0x54004b=_0x1f2047?_0x15e0fa[_0xe003('0x1d')]:_0x53b230[_0xe003('0x1a')]+_0x53b230[_0xe003('0x1c')];var _0x385470;if(_0x54004b>=_0x53fb56){_0x54004b=_0x53fb56;_0x385470=0xc8;}else{_0x385470=0xce;}_0x5edc33[_0xe003('0x18')](_0x385470);return _0x5edc33['set'](_0xe003('0x1e'),_0x34b6e1+'-'+_0x54004b+'/'+_0x53fb56)['json'](_0x15e0fa);}return null;};}function patchUpdates(_0x441b52){return function(_0x580484){try{jsonpatch[_0xe003('0x1f')](_0x580484,_0x441b52,!![]);}catch(_0x486a6f){return BPromise['reject'](_0x486a6f);}return _0x580484[_0xe003('0x20')]();};}function saveUpdates(_0xef2357,_0x5419b7){return function(_0x53b5fb){if(_0x53b5fb){return _0x53b5fb[_0xe003('0x21')](_0xef2357)[_0xe003('0x22')](function(_0x249e02){return _0x249e02;});}return null;};}function removeEntity(_0x115b79,_0x10eb81){return function(_0x1f8e09){if(_0x1f8e09){return _0x1f8e09[_0xe003('0x23')]()[_0xe003('0x22')](function(){var _0x2e7faf=_0x1f8e09[_0xe003('0x24')]({'plain':!![]});var _0x5d6aa1=_0xe003('0x25');return db[_0xe003('0x26')][_0xe003('0x23')]({'where':{'type':_0x5d6aa1,'resourceId':_0x2e7faf['id']}})[_0xe003('0x22')](function(){return _0x1f8e09;});})[_0xe003('0x22')](function(){_0x115b79[_0xe003('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4052d1,_0x1cdcf7){return function(_0x35da34){if(!_0x35da34){_0x4052d1[_0xe003('0x17')](0x194);}return _0x35da34;};}function handleError(_0x47519d,_0x94ceb8){_0x94ceb8=_0x94ceb8||0x1f4;return function(_0x376387){logger[_0xe003('0x27')](_0x376387[_0xe003('0x28')]);if(_0x376387[_0xe003('0x29')]){delete _0x376387[_0xe003('0x29')];}_0x47519d['status'](_0x94ceb8)[_0xe003('0x2a')](_0x376387);};}exports['index']=function(_0x4f08c4,_0x533f6a){var _0xc32e8e={},_0x5121b3={},_0x4f900={'count':0x0,'rows':[]};var _0x3940aa=_[_0xe003('0x2b')](db['Interval'][_0xe003('0x2c')],function(_0x27348f){return{'name':_0x27348f['fieldName'],'type':_0x27348f[_0xe003('0x2d')][_0xe003('0x2e')]};});_0x5121b3['model']=_[_0xe003('0x2b')](_0x3940aa,_0xe003('0x29'));_0x5121b3[_0xe003('0x2f')]=_[_0xe003('0x30')](_0x4f08c4[_0xe003('0x2f')]);_0x5121b3['filters']=_[_0xe003('0x31')](_0x5121b3[_0xe003('0x32')],_0x5121b3[_0xe003('0x2f')]);_0xc32e8e[_0xe003('0x33')]=_[_0xe003('0x31')](_0x5121b3[_0xe003('0x32')],qs[_0xe003('0x34')](_0x4f08c4['query'][_0xe003('0x34')]));_0xc32e8e[_0xe003('0x33')]=_0xc32e8e[_0xe003('0x33')][_0xe003('0x35')]?_0xc32e8e['attributes']:_0x5121b3[_0xe003('0x32')];if(!_0x4f08c4['query'][_0xe003('0x36')](_0xe003('0x37'))){_0xc32e8e[_0xe003('0x1c')]=qs[_0xe003('0x1c')](_0x4f08c4[_0xe003('0x2f')][_0xe003('0x1c')]);_0xc32e8e['offset']=qs[_0xe003('0x1a')](_0x4f08c4[_0xe003('0x2f')][_0xe003('0x1a')]);}_0xc32e8e[_0xe003('0x38')]=qs[_0xe003('0x39')](_0x4f08c4[_0xe003('0x2f')][_0xe003('0x39')]);_0xc32e8e['where']=qs[_0xe003('0x3a')](_[_0xe003('0x3b')](_0x4f08c4[_0xe003('0x2f')],_0x5121b3[_0xe003('0x3a')]),_0x3940aa);if(_0x4f08c4['query'][_0xe003('0x3c')]){_0xc32e8e[_0xe003('0x3d')]=_[_0xe003('0x3e')](_0xc32e8e[_0xe003('0x3d')],{'$or':_[_0xe003('0x2b')](_0x3940aa,function(_0x319e93){if(_0x319e93[_0xe003('0x2d')]!==_0xe003('0x3f')){var _0x1a647e={};_0x1a647e[_0x319e93['name']]={'$like':'%'+_0x4f08c4['query'][_0xe003('0x3c')]+'%'};return _0x1a647e;}})});}_0xc32e8e=_[_0xe003('0x3e')]({},_0xc32e8e,_0x4f08c4[_0xe003('0x40')]);var _0x90447d={'where':_0xc32e8e[_0xe003('0x3d')]};return db[_0xe003('0x41')][_0xe003('0x1d')](_0x90447d)[_0xe003('0x22')](function(_0x2bf37c){_0x4f900['count']=_0x2bf37c;if(_0x4f08c4[_0xe003('0x2f')]['includeAll']){_0xc32e8e[_0xe003('0x42')]=[{'all':!![]}];}return db[_0xe003('0x41')][_0xe003('0x43')](_0xc32e8e);})[_0xe003('0x22')](function(_0x449b5e){_0x4f900[_0xe003('0x44')]=_0x449b5e;return _0x4f900;})[_0xe003('0x22')](respondWithFilteredResult(_0x533f6a,_0xc32e8e))['catch'](handleError(_0x533f6a,null));};exports['show']=function(_0x546cca,_0x173663){var _0x2100c6={'raw':!![],'where':{'id':_0x546cca[_0xe003('0x45')]['id']}},_0x1ba678={};_0x1ba678[_0xe003('0x32')]=_[_0xe003('0x30')](db['Interval'][_0xe003('0x2c')]);_0x1ba678['query']=_['keys'](_0x546cca['query']);_0x1ba678[_0xe003('0x3a')]=_[_0xe003('0x31')](_0x1ba678['model'],_0x1ba678[_0xe003('0x2f')]);_0x2100c6[_0xe003('0x33')]=_['intersection'](_0x1ba678[_0xe003('0x32')],qs['fields'](_0x546cca[_0xe003('0x2f')][_0xe003('0x34')]));_0x2100c6[_0xe003('0x33')]=_0x2100c6[_0xe003('0x33')]['length']?_0x2100c6['attributes']:_0x1ba678[_0xe003('0x32')];if(_0x546cca[_0xe003('0x2f')][_0xe003('0x46')]){_0x2100c6[_0xe003('0x42')]=[{'all':!![]}];}_0x2100c6=_[_0xe003('0x3e')]({},_0x2100c6,_0x546cca[_0xe003('0x40')]);return db['Interval'][_0xe003('0x47')](_0x2100c6)[_0xe003('0x22')](handleEntityNotFound(_0x173663,null))[_0xe003('0x22')](respondWithResult(_0x173663,null))[_0xe003('0x48')](handleError(_0x173663,null));};exports[_0xe003('0x49')]=function(_0x4a9a6a,_0x54a0e3){return db[_0xe003('0x41')][_0xe003('0x49')](_0x4a9a6a[_0xe003('0x4a')],{})[_0xe003('0x22')](function(_0x339d3c){var _0xb057ee=_0x4a9a6a[_0xe003('0x4b')]['get']({'plain':!![]});if(!_0xb057ee)throw new Error(_0xe003('0x4c'));if(_0xb057ee[_0xe003('0x4d')]==='user'){var _0x377f0c=_0x339d3c['get']({'plain':!![]});var _0x574e61='Intervals';return db[_0xe003('0x4e')][_0xe003('0x47')]({'where':{'name':_0x574e61,'userProfileId':_0xb057ee[_0xe003('0x4f')]},'raw':!![]})[_0xe003('0x22')](function(_0x249abc){if(_0x249abc&&_0x249abc[_0xe003('0x50')]===0x0){return db[_0xe003('0x26')][_0xe003('0x49')]({'name':_0x377f0c[_0xe003('0x29')],'resourceId':_0x377f0c['id'],'type':_0x249abc[_0xe003('0x29')],'sectionId':_0x249abc['id']},{})[_0xe003('0x22')](function(){return _0x339d3c;});}else{return _0x339d3c;}})['catch'](function(_0x407f3){logger[_0xe003('0x27')](_0xe003('0x51'),_0x407f3);throw _0x407f3;});}return _0x339d3c;})[_0xe003('0x22')](respondWithResult(_0x54a0e3,0xc9))[_0xe003('0x48')](handleError(_0x54a0e3,null));};exports[_0xe003('0x21')]=function(_0xd8c142,_0x5c19bc){if(_0xd8c142[_0xe003('0x4a')]['id']){delete _0xd8c142[_0xe003('0x4a')]['id'];}return db[_0xe003('0x41')][_0xe003('0x47')]({'where':{'id':_0xd8c142['params']['id']}})['then'](handleEntityNotFound(_0x5c19bc,null))[_0xe003('0x22')](saveUpdates(_0xd8c142[_0xe003('0x4a')],null))[_0xe003('0x22')](respondWithResult(_0x5c19bc,null))[_0xe003('0x48')](handleError(_0x5c19bc,null));};exports[_0xe003('0x23')]=function(_0x387e4a,_0x73437a){return db[_0xe003('0x41')][_0xe003('0x47')]({'where':{'id':_0x387e4a[_0xe003('0x45')]['id']}})[_0xe003('0x22')](handleEntityNotFound(_0x73437a,null))[_0xe003('0x22')](removeEntity(_0x73437a,null))[_0xe003('0x48')](handleError(_0x73437a,null));};exports[_0xe003('0x52')]=function(_0x323962,_0x35ec9c,_0x30aa2b){if(_0x323962[_0xe003('0x4a')]['id']){delete _0x323962[_0xe003('0x4a')]['id'];}return db['Interval']['find']({'where':{'id':_0x323962['params']['id']}})['then'](handleEntityNotFound(_0x35ec9c,null))['then'](function(_0x199d62){if(_0x199d62){_0x323962[_0xe003('0x4a')][_0xe003('0x53')]=_0x199d62['id'];return db[_0xe003('0x41')][_0xe003('0x49')](_0x323962[_0xe003('0x4a')]);}})['then'](respondWithResult(_0x35ec9c,null))['catch'](handleError(_0x35ec9c,null));};exports['getIntervals']=function(_0x112ef0,_0x393d71,_0x3abab5){var _0x41a64b={};var _0x4db1f6={};var _0x4ca50f;var _0x1ddeff;return db[_0xe003('0x41')][_0xe003('0x54')]({'where':{'id':_0x112ef0[_0xe003('0x45')]['id']}})['then'](handleEntityNotFound(_0x393d71,null))[_0xe003('0x22')](function(_0x2cdadd){if(_0x2cdadd){_0x4ca50f=_0x2cdadd;_0x4db1f6[_0xe003('0x32')]=_[_0xe003('0x30')](db[_0xe003('0x41')][_0xe003('0x2c')]);_0x4db1f6[_0xe003('0x2f')]=_[_0xe003('0x30')](_0x112ef0[_0xe003('0x2f')]);_0x4db1f6['filters']=_[_0xe003('0x31')](_0x4db1f6[_0xe003('0x32')],_0x4db1f6['query']);_0x41a64b['attributes']=_['intersection'](_0x4db1f6[_0xe003('0x32')],qs[_0xe003('0x34')](_0x112ef0[_0xe003('0x2f')][_0xe003('0x34')]));_0x41a64b[_0xe003('0x33')]=_0x41a64b[_0xe003('0x33')][_0xe003('0x35')]?_0x41a64b[_0xe003('0x33')]:_0x4db1f6[_0xe003('0x32')];_0x41a64b[_0xe003('0x38')]=qs['sort'](_0x112ef0[_0xe003('0x2f')]['sort']);_0x41a64b[_0xe003('0x3d')]=qs[_0xe003('0x3a')](_[_0xe003('0x3b')](_0x112ef0[_0xe003('0x2f')],_0x4db1f6[_0xe003('0x3a')]));if(_0x112ef0[_0xe003('0x2f')][_0xe003('0x3c')]){_0x41a64b[_0xe003('0x3d')]=_[_0xe003('0x3e')](_0x41a64b[_0xe003('0x3d')],{'$or':_[_0xe003('0x2b')](_0x41a64b[_0xe003('0x33')],function(_0x3621cf){var _0x3e76c3={};_0x3e76c3[_0x3621cf]={'$like':'%'+_0x112ef0[_0xe003('0x2f')]['filter']+'%'};return _0x3e76c3;})});}_0x41a64b=_[_0xe003('0x3e')]({},_0x41a64b,_0x112ef0['options']);return _0x4ca50f[_0xe003('0x55')](_0x41a64b);}})['then'](function(_0x5012dd){if(_0x5012dd){_0x1ddeff=_0x5012dd[_0xe003('0x35')];if(!_0x112ef0[_0xe003('0x2f')]['hasOwnProperty'](_0xe003('0x37'))){_0x41a64b[_0xe003('0x1c')]=qs['limit'](_0x112ef0['query']['limit']);_0x41a64b['offset']=qs[_0xe003('0x1a')](_0x112ef0[_0xe003('0x2f')][_0xe003('0x1a')]);}return _0x4ca50f[_0xe003('0x55')](_0x41a64b);}})[_0xe003('0x22')](function(_0x4456ec){if(_0x4456ec){return _0x4456ec?{'count':_0x1ddeff,'rows':_0x4456ec}:null;}})[_0xe003('0x22')](respondWithResult(_0x393d71,null))[_0xe003('0x48')](handleError(_0x393d71,null));};exports[_0xe003('0x56')]=function(_0x26955c,_0x178650,_0x203c2b){return db[_0xe003('0x41')][_0xe003('0x54')]({'where':{'id':_0x26955c[_0xe003('0x45')]['id']}})['then'](handleEntityNotFound(_0x178650,null))[_0xe003('0x22')](function(_0xd90bcb){if(_0xd90bcb){return db[_0xe003('0x57')][_0xe003('0x58')](function(_0x2e653f){return db['Interval']['destroy']({'where':{'IntervalId':_0x26955c[_0xe003('0x45')]['id']},'transaction':_0x2e653f})[_0xe003('0x22')](function(_0x2b4723){var _0x352b2a=_[_0xe003('0x2b')](_0x26955c['body'],function(_0x38acf3){delete _0x38acf3['id'];_0x38acf3[_0xe003('0x53')]=_0x26955c[_0xe003('0x45')]['id'];return _0x38acf3;});return db['Interval'][_0xe003('0x59')](_0x352b2a,{'transaction':_0x2e653f});});})['then'](function(){return db[_0xe003('0x41')][_0xe003('0x43')]({'where':{'IntervalId':_0x26955c[_0xe003('0x45')]['id']}});});}})['then'](respondWithResult(_0x178650,null))[_0xe003('0x48')](handleError(_0x178650,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 1c453e8..ccdea92 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 _0x6acc=['../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','tools_intervals','rewrite','interval','string','then','map','ifTime','reduce','./interval.attributes'];(function(_0x5a4eee,_0x5ba6f6){var _0x54ae2a=function(_0x20b37c){while(--_0x20b37c){_0x5a4eee['push'](_0x5a4eee['shift']());}};_0x54ae2a(++_0x5ba6f6);}(_0x6acc,0xa7));var _0xc6ac=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x6acc[_0x2dadb9];return _0x2f0097;};'use strict';var attributes=require(_0xc6ac('0x0'));var extensions=require(_0xc6ac('0x1'));var iftime=require(_0xc6ac('0x2'))[_0xc6ac('0x3')];module[_0xc6ac('0x4')]=function(_0x5328ce){return _0x5328ce[_0xc6ac('0x5')]('Interval',attributes,{'tableName':_0xc6ac('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x48323f){extensions[_0xc6ac('0x7')](_0x5328ce,_0x48323f);},'afterBulkCreate':function(_0x2b5cde,_0x23e315,_0x15e296){_0x15e296();extensions['rewrite'](_0x5328ce,_0x2b5cde[0x0]);},'afterUpdate':function(_0x1acca6){extensions[_0xc6ac('0x7')](_0x5328ce,_0x1acca6);},'afterDestroy':function(_0x157339){extensions[_0xc6ac('0x7')](_0x5328ce,_0x157339);}},'instanceMethods':{'ifTime':function(_0x46b622=undefined,_0xdc0c51=new Date()){if(typeof this[_0xc6ac('0x8')]===_0xc6ac('0x9')){return iftime(this['interval'],_0x46b622,_0xdc0c51);}else{return this['getIntervals']()[_0xc6ac('0xa')](function(_0x4d04e5){return Promise['all'](_0x4d04e5[_0xc6ac('0xb')](function(_0x54a472){return _0x54a472[_0xc6ac('0xc')](_0x46b622,_0xdc0c51);}));})[_0xc6ac('0xa')](function(_0x5b8e1f){return _0x5b8e1f[_0xc6ac('0xd')](function(_0x2908ec,_0x123545){return _0x2908ec||_0x123545;},![]);});}}}});}; \ No newline at end of file +var _0xc3f5=['string','getIntervals','then','all','map','ifTime','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','Interval','tools_intervals','rewrite','interval'];(function(_0x1fed80,_0x3e3e3a){var _0x3fc56a=function(_0x5a328a){while(--_0x5a328a){_0x1fed80['push'](_0x1fed80['shift']());}};_0x3fc56a(++_0x3e3e3a);}(_0xc3f5,0x1aa));var _0x5c3f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc3f5[_0x20a584];return _0x4b41a8;};'use strict';var attributes=require(_0x5c3f('0x0'));var extensions=require(_0x5c3f('0x1'));var iftime=require(_0x5c3f('0x2'))[_0x5c3f('0x3')];module[_0x5c3f('0x4')]=function(_0x16ccbf){return _0x16ccbf['define'](_0x5c3f('0x5'),attributes,{'tableName':_0x5c3f('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x522688){extensions['rewrite'](_0x16ccbf,_0x522688);},'afterBulkCreate':function(_0x5cbd0b,_0x561f59,_0x2bbd60){_0x2bbd60();extensions[_0x5c3f('0x7')](_0x16ccbf,_0x5cbd0b[0x0]);},'afterUpdate':function(_0x205017){extensions[_0x5c3f('0x7')](_0x16ccbf,_0x205017);},'afterDestroy':function(_0x53fa23){extensions[_0x5c3f('0x7')](_0x16ccbf,_0x53fa23);}},'instanceMethods':{'ifTime':function(_0x3ef51c=undefined,_0x14a247=new Date()){if(typeof this[_0x5c3f('0x8')]===_0x5c3f('0x9')){return iftime(this['interval'],_0x3ef51c,_0x14a247);}else{return this[_0x5c3f('0xa')]()[_0x5c3f('0xb')](function(_0x3724e2){return Promise[_0x5c3f('0xc')](_0x3724e2[_0x5c3f('0xd')](function(_0x26c5a4){return _0x26c5a4[_0x5c3f('0xe')](_0x3ef51c,_0x14a247);}));})[_0x5c3f('0xb')](function(_0x44e4f3){return _0x44e4f3['reduce'](function(_0x4338a3,_0x2825a1){return _0x4338a3||_0x2825a1;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index f4a3b77..a502ff8 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 _0xe090=['options','raw','where','limit','map','include','model','attributes','then','debug','GetInterval','stringify','catch','message','error','find','info','ShowInterval','all','reduce','format','join','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','ifTime','IntervalIftime','intervalIds','intervals','string','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','isArray','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','Interval','findAll'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xe090,0x1e6));var _0x0e09=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xe090[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x0e09('0x0'));var util=require(_0x0e09('0x1'));var db=require(_0x0e09('0x2'))['db'];var iftime=require(_0x0e09('0x3'))[_0x0e09('0x4')];var logger=require(_0x0e09('0x5'))(_0x0e09('0x6'));exports['GetInterval']=function(_0x1c79ff){var _0x410796=this;return new Promise(function(_0x36706e,_0x36cda1){return db[_0x0e09('0x7')][_0x0e09('0x8')]({'raw':_0x1c79ff[_0x0e09('0x9')]?_0x1c79ff[_0x0e09('0x9')][_0x0e09('0xa')]===undefined?!![]:![]:!![],'where':_0x1c79ff['options']?_0x1c79ff[_0x0e09('0x9')][_0x0e09('0xb')]||null:null,'attributes':_0x1c79ff[_0x0e09('0x9')]?_0x1c79ff[_0x0e09('0x9')]['attributes']||null:null,'limit':_0x1c79ff[_0x0e09('0x9')]?_0x1c79ff[_0x0e09('0x9')][_0x0e09('0xc')]||null:null,'include':_0x1c79ff[_0x0e09('0x9')]?_0x1c79ff['options']['include']?_[_0x0e09('0xd')](_0x1c79ff[_0x0e09('0x9')][_0x0e09('0xe')],function(_0x454856){return{'model':db[_0x454856[_0x0e09('0xf')]],'as':_0x454856['as'],'attributes':_0x454856[_0x0e09('0x10')],'include':_0x454856[_0x0e09('0xe')]?_['map'](_0x454856['include'],function(_0x908d53){return{'model':db[_0x908d53[_0x0e09('0xf')]],'as':_0x908d53['as'],'attributes':_0x908d53[_0x0e09('0x10')],'include':_0x908d53[_0x0e09('0xe')]?_[_0x0e09('0xd')](_0x908d53['include'],function(_0x1182ea){return{'model':db[_0x1182ea[_0x0e09('0xf')]],'as':_0x1182ea['as'],'attributes':_0x1182ea['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e09('0x11')](function(_0x21e93c){logger['info']('GetInterval',_0x1c79ff);logger[_0x0e09('0x12')](_0x0e09('0x13'),_0x1c79ff,JSON[_0x0e09('0x14')](_0x21e93c));_0x36706e(_0x21e93c);})[_0x0e09('0x15')](function(_0x1f86de){logger['error'](_0x0e09('0x13'),_0x1f86de[_0x0e09('0x16')],_0x1c79ff);_0x36cda1(_0x410796[_0x0e09('0x17')](0x1f4,_0x1f86de[_0x0e09('0x16')]));});});};exports['ShowInterval']=function(_0x392527){var _0x27c8eb=this;return new Promise(function(_0x4b339b,_0x10bc38){return db['Interval'][_0x0e09('0x18')]({'raw':_0x392527[_0x0e09('0x9')]?_0x392527[_0x0e09('0x9')][_0x0e09('0xa')]===undefined?!![]:![]:!![],'where':_0x392527[_0x0e09('0x9')]?_0x392527[_0x0e09('0x9')][_0x0e09('0xb')]||null:null,'attributes':_0x392527[_0x0e09('0x9')]?_0x392527['options'][_0x0e09('0x10')]||null:null,'include':_0x392527[_0x0e09('0x9')]?_0x392527[_0x0e09('0x9')][_0x0e09('0xe')]?_[_0x0e09('0xd')](_0x392527[_0x0e09('0x9')][_0x0e09('0xe')],function(_0x37b55f){return{'model':db[_0x37b55f[_0x0e09('0xf')]],'as':_0x37b55f['as'],'attributes':_0x37b55f[_0x0e09('0x10')],'include':_0x37b55f['include']?_[_0x0e09('0xd')](_0x37b55f[_0x0e09('0xe')],function(_0x40d62f){return{'model':db[_0x40d62f[_0x0e09('0xf')]],'as':_0x40d62f['as'],'attributes':_0x40d62f[_0x0e09('0x10')],'include':_0x40d62f[_0x0e09('0xe')]?_[_0x0e09('0xd')](_0x40d62f[_0x0e09('0xe')],function(_0x464f9d){return{'model':db[_0x464f9d['model']],'as':_0x464f9d['as'],'attributes':_0x464f9d['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e09('0x11')](function(_0x2293a6){logger[_0x0e09('0x19')]('ShowInterval',_0x392527);logger[_0x0e09('0x12')](_0x0e09('0x1a'),_0x392527,JSON[_0x0e09('0x14')](_0x2293a6));_0x4b339b(_0x2293a6);})['catch'](function(_0x45b538){logger[_0x0e09('0x17')](_0x0e09('0x1a'),_0x45b538[_0x0e09('0x16')],_0x392527);_0x10bc38(_0x27c8eb[_0x0e09('0x17')](0x1f4,_0x45b538['message']));});});};function checkArrayOfIntervals(_0x515889,_0x481c5d){var _0x418e64=[];return db[_0x0e09('0x7')][_0x0e09('0x8')]({'where':{'id':_0x515889}})[_0x0e09('0x11')](function(_0x1b220b){_0x418e64=_0x1b220b;return Promise[_0x0e09('0x1b')](_0x418e64[_0x0e09('0xd')](function(_0x157477){return _0x157477['ifTime'](_0x481c5d);}));})['then'](function(_0x57280b){var _0x3a4330=_0x57280b[_0x0e09('0x1c')](function(_0x3026eb,_0xe2c139){return _0x3026eb||_0xe2c139;},![]);logger[_0x0e09('0x19')](util[_0x0e09('0x1d')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x418e64[_0x0e09('0xd')](function(_0x44404c){return _0x44404c['name'];})[_0x0e09('0x1e')](',\x20'),_0x418e64[_0x0e09('0xd')](function(_0x1b2e83){return _0x1b2e83['id'];})[_0x0e09('0x1e')](',\x20')));return _0x3a4330;});}function checkSingleInterval(_0x56d72d,_0x4a71aa){return db[_0x0e09('0x7')]['findById'](_0x56d72d)[_0x0e09('0x11')](function(_0x1ffb35){if(_0x1ffb35){logger[_0x0e09('0x19')](util['format'](_0x0e09('0x1f'),_0x1ffb35[_0x0e09('0x20')],_0x1ffb35['id']));return _0x1ffb35[_0x0e09('0x21')](_0x4a71aa);}});}exports[_0x0e09('0x22')]=function(_0x52f297){var _0x39c5c1=_0x52f297[_0x0e09('0x23')];var _0x732103=Array['isArray'](_0x52f297[_0x0e09('0x24')])?_0x52f297[_0x0e09('0x24')]:typeof _0x52f297['intervals']===_0x0e09('0x25')?[_0x52f297[_0x0e09('0x24')]]:[];var _0x377834=_0x52f297['timezone']||undefined;var _0x3079a1=![];if(_0x732103[_0x0e09('0x26')]){logger[_0x0e09('0x19')](util['format'](_0x0e09('0x27'),_0x732103[_0x0e09('0x1e')](';\x20')));}if(_0x377834){logger[_0x0e09('0x19')](util['format'](_0x0e09('0x28'),_0x377834));}logger[_0x0e09('0x12')](_0x0e09('0x29'),_0x3079a1);logger[_0x0e09('0x2a')]('IntervalIftime',_0x52f297);return Promise[_0x0e09('0x2b')]()[_0x0e09('0x11')](function(){if(Array[_0x0e09('0x2c')](_0x39c5c1)){return checkArrayOfIntervals(_0x39c5c1,_0x377834);}else if(_0x39c5c1){return checkSingleInterval(_0x39c5c1,_0x377834);}})[_0x0e09('0x11')](function(_0x30a0ad){var _0x479329=_0x732103[_0x0e09('0x1c')](function(_0x5660e9,_0x1bbfb5){return _0x5660e9||iftime(_0x1bbfb5,_0x377834);},![]);_0x3079a1=_0x30a0ad||_0x479329;return _0x3079a1;})[_0x0e09('0x15')](function(_0x291344){logger[_0x0e09('0x17')](_0x0e09('0x22'),_0x52f297,_0x291344);throw this[_0x0e09('0x17')](0x1f4,_0x291344[_0x0e09('0x16')]);});}; \ No newline at end of file +var _0xed65=['error','ShowInterval','Interval','find','then','ifTime','reduce','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','name','IntervalIftime','intervalIds','intervals','string','timezone','length','format','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly','resolve','isArray','lodash','../../mysqldb','iftime','../../config/logger','rpc','GetInterval','findAll','options','where','attributes','map','include','model','info','debug','catch','message'];(function(_0x581a9a,_0xf08f51){var _0x4bc967=function(_0x3b757f){while(--_0x3b757f){_0x581a9a['push'](_0x581a9a['shift']());}};_0x4bc967(++_0xf08f51);}(_0xed65,0xdf));var _0x5ed6=function(_0x40453a,_0x1ff061){_0x40453a=_0x40453a-0x0;var _0x2da74d=_0xed65[_0x40453a];return _0x2da74d;};'use strict';var _=require(_0x5ed6('0x0'));var util=require('util');var db=require(_0x5ed6('0x1'))['db'];var iftime=require('../../utils/iftime')[_0x5ed6('0x2')];var logger=require(_0x5ed6('0x3'))(_0x5ed6('0x4'));exports[_0x5ed6('0x5')]=function(_0x16e08d){var _0x39e1c2=this;return new Promise(function(_0x898774,_0x49dd2d){return db['Interval'][_0x5ed6('0x6')]({'raw':_0x16e08d[_0x5ed6('0x7')]?_0x16e08d[_0x5ed6('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x16e08d[_0x5ed6('0x7')]?_0x16e08d[_0x5ed6('0x7')][_0x5ed6('0x8')]||null:null,'attributes':_0x16e08d['options']?_0x16e08d[_0x5ed6('0x7')][_0x5ed6('0x9')]||null:null,'limit':_0x16e08d['options']?_0x16e08d['options']['limit']||null:null,'include':_0x16e08d[_0x5ed6('0x7')]?_0x16e08d[_0x5ed6('0x7')]['include']?_[_0x5ed6('0xa')](_0x16e08d[_0x5ed6('0x7')][_0x5ed6('0xb')],function(_0x492eaf){return{'model':db[_0x492eaf[_0x5ed6('0xc')]],'as':_0x492eaf['as'],'attributes':_0x492eaf[_0x5ed6('0x9')],'include':_0x492eaf['include']?_[_0x5ed6('0xa')](_0x492eaf[_0x5ed6('0xb')],function(_0x142424){return{'model':db[_0x142424[_0x5ed6('0xc')]],'as':_0x142424['as'],'attributes':_0x142424[_0x5ed6('0x9')],'include':_0x142424[_0x5ed6('0xb')]?_[_0x5ed6('0xa')](_0x142424[_0x5ed6('0xb')],function(_0xad2b29){return{'model':db[_0xad2b29['model']],'as':_0xad2b29['as'],'attributes':_0xad2b29[_0x5ed6('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x797d67){logger[_0x5ed6('0xd')](_0x5ed6('0x5'),_0x16e08d);logger[_0x5ed6('0xe')]('GetInterval',_0x16e08d,JSON['stringify'](_0x797d67));_0x898774(_0x797d67);})[_0x5ed6('0xf')](function(_0x37f6f7){logger['error']('GetInterval',_0x37f6f7[_0x5ed6('0x10')],_0x16e08d);_0x49dd2d(_0x39e1c2[_0x5ed6('0x11')](0x1f4,_0x37f6f7['message']));});});};exports[_0x5ed6('0x12')]=function(_0x565ae9){var _0x328eda=this;return new Promise(function(_0x680ed2,_0x48551f){return db[_0x5ed6('0x13')][_0x5ed6('0x14')]({'raw':_0x565ae9[_0x5ed6('0x7')]?_0x565ae9[_0x5ed6('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x565ae9['options']?_0x565ae9[_0x5ed6('0x7')][_0x5ed6('0x8')]||null:null,'attributes':_0x565ae9[_0x5ed6('0x7')]?_0x565ae9[_0x5ed6('0x7')][_0x5ed6('0x9')]||null:null,'include':_0x565ae9[_0x5ed6('0x7')]?_0x565ae9[_0x5ed6('0x7')][_0x5ed6('0xb')]?_[_0x5ed6('0xa')](_0x565ae9[_0x5ed6('0x7')][_0x5ed6('0xb')],function(_0x1e1307){return{'model':db[_0x1e1307[_0x5ed6('0xc')]],'as':_0x1e1307['as'],'attributes':_0x1e1307['attributes'],'include':_0x1e1307[_0x5ed6('0xb')]?_[_0x5ed6('0xa')](_0x1e1307[_0x5ed6('0xb')],function(_0xdfb556){return{'model':db[_0xdfb556[_0x5ed6('0xc')]],'as':_0xdfb556['as'],'attributes':_0xdfb556['attributes'],'include':_0xdfb556['include']?_[_0x5ed6('0xa')](_0xdfb556[_0x5ed6('0xb')],function(_0x1da38e){return{'model':db[_0x1da38e[_0x5ed6('0xc')]],'as':_0x1da38e['as'],'attributes':_0x1da38e['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ed6('0x15')](function(_0x3116f2){logger[_0x5ed6('0xd')](_0x5ed6('0x12'),_0x565ae9);logger[_0x5ed6('0xe')](_0x5ed6('0x12'),_0x565ae9,JSON['stringify'](_0x3116f2));_0x680ed2(_0x3116f2);})[_0x5ed6('0xf')](function(_0x3d8808){logger[_0x5ed6('0x11')](_0x5ed6('0x12'),_0x3d8808[_0x5ed6('0x10')],_0x565ae9);_0x48551f(_0x328eda[_0x5ed6('0x11')](0x1f4,_0x3d8808['message']));});});};function checkArrayOfIntervals(_0x394a69,_0x39ca76){var _0x16849b=[];return db[_0x5ed6('0x13')][_0x5ed6('0x6')]({'where':{'id':_0x394a69}})[_0x5ed6('0x15')](function(_0x3c7a32){_0x16849b=_0x3c7a32;return Promise['all'](_0x16849b['map'](function(_0x1fa786){return _0x1fa786[_0x5ed6('0x16')](_0x39ca76);}));})[_0x5ed6('0x15')](function(_0x49a02b){var _0x142e34=_0x49a02b[_0x5ed6('0x17')](function(_0xac1435,_0x5831c5){return _0xac1435||_0x5831c5;},![]);logger[_0x5ed6('0xd')](util['format'](_0x5ed6('0x18'),_0x16849b[_0x5ed6('0xa')](function(_0x2bffa2){return _0x2bffa2['name'];})['join'](',\x20'),_0x16849b['map'](function(_0x32c624){return _0x32c624['id'];})[_0x5ed6('0x19')](',\x20')));return _0x142e34;});}function checkSingleInterval(_0x52fd98,_0xe8d835){return db['Interval'][_0x5ed6('0x1a')](_0x52fd98)[_0x5ed6('0x15')](function(_0xe68b35){if(_0xe68b35){logger[_0x5ed6('0xd')](util['format']('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0xe68b35[_0x5ed6('0x1b')],_0xe68b35['id']));return _0xe68b35[_0x5ed6('0x16')](_0xe8d835);}});}exports[_0x5ed6('0x1c')]=function(_0x1a5684){var _0x4d4b62=_0x1a5684[_0x5ed6('0x1d')];var _0x25b7cf=Array['isArray'](_0x1a5684[_0x5ed6('0x1e')])?_0x1a5684['intervals']:typeof _0x1a5684[_0x5ed6('0x1e')]===_0x5ed6('0x1f')?[_0x1a5684[_0x5ed6('0x1e')]]:[];var _0xd55d08=_0x1a5684[_0x5ed6('0x20')]||undefined;var _0x202c64=![];if(_0x25b7cf[_0x5ed6('0x21')]){logger[_0x5ed6('0xd')](util[_0x5ed6('0x22')](_0x5ed6('0x23'),_0x25b7cf['join'](';\x20')));}if(_0xd55d08){logger['info'](util['format']('IntervalIftime:\x20timezone\x20=\x20%s',_0xd55d08));}logger['debug'](_0x5ed6('0x24'),_0x202c64);logger[_0x5ed6('0x25')]('IntervalIftime',_0x1a5684);return Promise[_0x5ed6('0x26')]()[_0x5ed6('0x15')](function(){if(Array[_0x5ed6('0x27')](_0x4d4b62)){return checkArrayOfIntervals(_0x4d4b62,_0xd55d08);}else if(_0x4d4b62){return checkSingleInterval(_0x4d4b62,_0xd55d08);}})[_0x5ed6('0x15')](function(_0x30edd1){var _0x1b1db3=_0x25b7cf[_0x5ed6('0x17')](function(_0x5c135d,_0x3ff892){return _0x5c135d||iftime(_0x3ff892,_0xd55d08);},![]);_0x202c64=_0x30edd1||_0x1b1db3;return _0x202c64;})[_0x5ed6('0xf')](function(_0x56e2f5){logger[_0x5ed6('0x11')](_0x5ed6('0x1c'),_0x1a5684,_0x56e2f5);throw this[_0x5ed6('0x11')](0x1f4,_0x56e2f5[_0x5ed6('0x10')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 7b04ba4..91535ca 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x433396,_0x3288ae){var _0x2cbbc5=function(_0x2f7b8d){while(--_0x2f7b8d){_0x433396['push'](_0x433396['shift']());}};_0x2cbbc5(++_0x3288ae);}(_0xdb28,0x106));var _0x8db2=function(_0x44e606,_0x1d1132){_0x44e606=_0x44e606-0x0;var _0x169e95=_0xdb28[_0x44e606];return _0x169e95;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file +var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x0b0e,0x187));var _0xe0b0=function(_0x51a85c,_0x2660a3){_0x51a85c=_0x51a85c-0x0;var _0x55001f=_0x0b0e[_0x51a85c];return _0x55001f;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 6c6c9df..5408e8b 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 _0x09c0=['fields','customfield_11500','email','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','base64','request','setEncoding','data','end','json','parse','error','status','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','https','../../config/logger','api','support','3eAmWpBVP0','key','Report','\x20from\x20','stringify','Bug'];(function(_0x2384f4,_0x18b44b){var _0xc31fa4=function(_0x1aff7a){while(--_0x1aff7a){_0x2384f4['push'](_0x2384f4['shift']());}};_0xc31fa4(++_0x18b44b);}(_0x09c0,0x1ee));var _0x009c=function(_0x419267,_0x5f0093){_0x419267=_0x419267-0x0;var _0x3c110c=_0x09c0[_0x419267];return _0x3c110c;};'use strict';var BPromise=require('bluebird');var https=require(_0x009c('0x0'));var logger=require(_0x009c('0x1'))(_0x009c('0x2'));var USERNAME=_0x009c('0x3');var PASSWORD=_0x009c('0x4');function openIssue(_0x5e1253,_0x1daee0){var _0x333ca6={'fields':{'project':{'key':_0x5e1253[_0x009c('0x5')]||'MOTGUI'},'summary':(_0x5e1253['summary']||_0x009c('0x6'))+_0x009c('0x7')+_0x5e1253['ip'],'description':_0x5e1253['description']||JSON[_0x009c('0x8')](_0x5e1253),'issuetype':{'name':_0x5e1253['issuetype']||_0x009c('0x9')}}};_0x333ca6[_0x009c('0xa')][_0x009c('0xb')]=_0x5e1253[_0x009c('0xc')];_0x333ca6[_0x009c('0xa')]['customfield_11501']=_0x5e1253['oldToken'];_0x333ca6[_0x009c('0xa')][_0x009c('0xd')]=_0x5e1253[_0x009c('0xe')];_0x333ca6['fields'][_0x009c('0xf')]=_0x5e1253[_0x009c('0x10')];_0x333ca6[_0x009c('0xa')][_0x009c('0x11')]=_0x5e1253[_0x009c('0x12')];_0x333ca6[_0x009c('0xa')]['customfield_10102']=_0x5e1253['ip'];var _0xf34fa1={'host':_0x009c('0x13'),'port':0x1bb,'path':_0x009c('0x14'),'method':_0x009c('0x15'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x009c('0x16'))}};var _0x547982=JSON[_0x009c('0x8')](_0x333ca6);var _0x30e195=https[_0x009c('0x17')](_0xf34fa1,function(_0x56b92e){_0x56b92e[_0x009c('0x18')]('utf8');var _0x701743='';_0x56b92e['on'](_0x009c('0x19'),function(_0x37739c){_0x701743+=_0x37739c;});_0x56b92e['on'](_0x009c('0x1a'),function(){if(_0x1daee0){return _0x1daee0['status'](_0x56b92e['statusCode'])[_0x009c('0x1b')](JSON[_0x009c('0x1c')](_0x701743));}});});_0x30e195['on'](_0x009c('0x1d'),function(_0x1d677c){if(_0x1daee0){return _0x1daee0[_0x009c('0x1e')](0x1f4)['json']({'errors':[{'message':_0x009c('0x1f'),'type':_0x009c('0x20')}]});}});_0x30e195[_0x009c('0x21')](_0x547982);_0x30e195['end']();}exports[_0x009c('0x22')]=openIssue;exports[_0x009c('0x23')]=function(_0x52ee47,_0x558add){_0x52ee47[_0x009c('0x24')]['ip']=_0x52ee47[_0x009c('0x25')][_0x009c('0x26')]||_0x52ee47[_0x009c('0x27')]['remoteAddress']||_0x52ee47['socket'][_0x009c('0x28')]||_0x52ee47[_0x009c('0x27')][_0x009c('0x29')]['remoteAddress'];return openIssue(_0x52ee47[_0x009c('0x24')],_0x558add);}; \ No newline at end of file +var _0x9d47=['support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','fields','customfield_11502','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','Basic\x20','toString','base64','stringify','request','setEncoding','utf8','data','status','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','connection','socket','../../config/logger','api'];(function(_0x59b472,_0x5edd44){var _0x305bc2=function(_0x120520){while(--_0x120520){_0x59b472['push'](_0x59b472['shift']());}};_0x305bc2(++_0x5edd44);}(_0x9d47,0x184));var _0x79d4=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x9d47[_0x56482c];return _0x5aae7a;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x79d4('0x0'))(_0x79d4('0x1'));var USERNAME=_0x79d4('0x2');var PASSWORD=_0x79d4('0x3');function openIssue(_0x3a3604,_0x509397){var _0x960693={'fields':{'project':{'key':_0x3a3604[_0x79d4('0x4')]||_0x79d4('0x5')},'summary':(_0x3a3604[_0x79d4('0x6')]||'Report')+_0x79d4('0x7')+_0x3a3604['ip'],'description':_0x3a3604['description']||JSON['stringify'](_0x3a3604),'issuetype':{'name':_0x3a3604['issuetype']||'Bug'}}};_0x960693[_0x79d4('0x8')]['customfield_11500']=_0x3a3604['email'];_0x960693['fields']['customfield_11501']=_0x3a3604['oldToken'];_0x960693['fields'][_0x79d4('0x9')]=_0x3a3604['newToken'];_0x960693['fields'][_0x79d4('0xa')]=_0x3a3604[_0x79d4('0xb')];_0x960693[_0x79d4('0x8')]['customfield_11504']=_0x3a3604[_0x79d4('0xc')];_0x960693['fields'][_0x79d4('0xd')]=_0x3a3604['ip'];var _0x28945c={'host':_0x79d4('0xe'),'port':0x1bb,'path':_0x79d4('0xf'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x79d4('0x10')+new Buffer(USERNAME+':'+PASSWORD)[_0x79d4('0x11')](_0x79d4('0x12'))}};var _0x5dd074=JSON[_0x79d4('0x13')](_0x960693);var _0x5971b6=https[_0x79d4('0x14')](_0x28945c,function(_0x12605a){_0x12605a[_0x79d4('0x15')](_0x79d4('0x16'));var _0xdd1ae1='';_0x12605a['on'](_0x79d4('0x17'),function(_0x201b10){_0xdd1ae1+=_0x201b10;});_0x12605a['on']('end',function(){if(_0x509397){return _0x509397[_0x79d4('0x18')](_0x12605a[_0x79d4('0x19')])[_0x79d4('0x1a')](JSON['parse'](_0xdd1ae1));}});});_0x5971b6['on'](_0x79d4('0x1b'),function(_0x104a4f){if(_0x509397){return _0x509397[_0x79d4('0x18')](0x1f4)['json']({'errors':[{'message':_0x79d4('0x1c'),'type':_0x79d4('0x1d')}]});}});_0x5971b6[_0x79d4('0x1e')](_0x5dd074);_0x5971b6['end']();}exports[_0x79d4('0x1f')]=openIssue;exports[_0x79d4('0x20')]=function(_0x4f834d,_0xe24b3e){_0x4f834d[_0x79d4('0x21')]['ip']=_0x4f834d[_0x79d4('0x22')][_0x79d4('0x23')]||_0x4f834d['connection']['remoteAddress']||_0x4f834d['socket'][_0x79d4('0x24')]||_0x4f834d[_0x79d4('0x25')][_0x79d4('0x26')]['remoteAddress'];return openIssue(_0x4f834d[_0x79d4('0x21')],_0xe24b3e);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 721f307..27b2825 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 _0x70e0=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','describe','get','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x5ba23f,_0x6ede91){var _0x528a48=function(_0x81a93a){while(--_0x81a93a){_0x5ba23f['push'](_0x5ba23f['shift']());}};_0x528a48(++_0x6ede91);}(_0x70e0,0x17b));var _0x070e=function(_0x522ec2,_0x1d49b){_0x522ec2=_0x522ec2-0x0;var _0x6c9a10=_0x70e0[_0x522ec2];return _0x6c9a10;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x070e('0xe')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xf')]);router[_0x070e('0x10')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x11')]);module[_0x070e('0x12')]=router; \ No newline at end of file +var _0x6f0d=['post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','get','/describe','describe','show'];(function(_0x5ef0ff,_0x2b97bb){var _0x539f42=function(_0x11b8c7){while(--_0x11b8c7){_0x5ef0ff['push'](_0x5ef0ff['shift']());}};_0x539f42(++_0x2b97bb);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x59dd44,_0x49db1f){_0x59dd44=_0x59dd44-0x0;var _0x58e328=_0x6f0d[_0x59dd44];return _0x58e328;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var fs_extra=require(_0xd6f0('0x4'));var auth=require(_0xd6f0('0x5'));var interaction=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var controller=require(_0xd6f0('0x8'));router['get']('/',auth[_0xd6f0('0x9')](),controller['index']);router[_0xd6f0('0xa')](_0xd6f0('0xb'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xc')]);router['get']('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xd')]);router[_0xd6f0('0xe')]('/',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xf')]);router['put'](_0xd6f0('0x10'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x11')]);router[_0xd6f0('0x12')]('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x13')]);module[_0xd6f0('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index fb80911..82f98cb 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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x7a54,0x106));var _0x47a5=function(_0x46bfc4,_0x135312){_0x46bfc4=_0x46bfc4-0x0;var _0x39a1c2=_0x7a54[_0x46bfc4];return _0x39a1c2;};'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(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7a54,0x106));var _0x47a5=function(_0x52bb0e,_0x1f7b32){_0x52bb0e=_0x52bb0e-0x0;var _0x2c1da9=_0x7a54[_0x52bb0e];return _0x2c1da9;};'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 61109d7..eb50edb 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 _0x9009=['stack','name','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','merge','where','map','VIRTUAL','catch','show','params','includeAll','include','options','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x9009,0x1d4));var _0x9900=function(_0x5b96b2,_0x3b2ded){_0x5b96b2=_0x5b96b2-0x0;var _0x959da6=_0x9009[_0x5b96b2];return _0x959da6;};'use strict';var emlformat=require(_0x9900('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9900('0x1'));var jsonpatch=require(_0x9900('0x2'));var rp=require('request-promise');var moment=require(_0x9900('0x3'));var BPromise=require(_0x9900('0x4'));var Mustache=require(_0x9900('0x5'));var util=require(_0x9900('0x6'));var path=require('path');var sox=require(_0x9900('0x7'));var csv=require(_0x9900('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9900('0x9'));var squel=require(_0x9900('0xa'));var crypto=require('crypto');var jsforce=require(_0x9900('0xb'));var deskjs=require(_0x9900('0xc'));var toCsv=require(_0x9900('0x8'));var querystring=require(_0x9900('0xd'));var Papa=require('papaparse');var Redis=require(_0x9900('0xe'));var authService=require(_0x9900('0xf'));var qs=require(_0x9900('0x10'));var as=require(_0x9900('0x11'));var hardwareService=require(_0x9900('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9900('0x13'));var config=require(_0x9900('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17070a,_0x4e8312){_0x4e8312=_0x4e8312||0xcc;return function(_0x6bd4da){if(_0x6bd4da){return _0x17070a[_0x9900('0x15')](_0x4e8312);}return _0x17070a[_0x9900('0x16')](_0x4e8312)[_0x9900('0x17')]();};}function respondWithResult(_0x318fa5,_0x1014e8){_0x1014e8=_0x1014e8||0xc8;return function(_0x2eaf32){if(_0x2eaf32){return _0x318fa5[_0x9900('0x16')](_0x1014e8)[_0x9900('0x18')](_0x2eaf32);}};}function respondWithFilteredResult(_0x209b4d,_0x375ee0){return function(_0xce2dd6){if(_0xce2dd6){var _0x154e22=typeof _0x375ee0[_0x9900('0x19')]===_0x9900('0x1a')&&typeof _0x375ee0[_0x9900('0x1b')]===_0x9900('0x1a');var _0x5d9ec9=_0xce2dd6['count'];var _0x1017a5=_0x154e22?0x0:_0x375ee0[_0x9900('0x19')];var _0x1bd7a3=_0x154e22?_0xce2dd6[_0x9900('0x1c')]:_0x375ee0['offset']+_0x375ee0[_0x9900('0x1b')];var _0x57ae85;if(_0x1bd7a3>=_0x5d9ec9){_0x1bd7a3=_0x5d9ec9;_0x57ae85=0xc8;}else{_0x57ae85=0xce;}_0x209b4d['status'](_0x57ae85);return _0x209b4d[_0x9900('0x1d')]('Content-Range',_0x1017a5+'-'+_0x1bd7a3+'/'+_0x5d9ec9)[_0x9900('0x18')](_0xce2dd6);}return null;};}function patchUpdates(_0x596eff){return function(_0x48d6df){try{jsonpatch[_0x9900('0x1e')](_0x48d6df,_0x596eff,!![]);}catch(_0x2892ce){return BPromise[_0x9900('0x1f')](_0x2892ce);}return _0x48d6df[_0x9900('0x20')]();};}function saveUpdates(_0x5ee4ad,_0x215bd4){return function(_0x3e4cee){if(_0x3e4cee){return _0x3e4cee[_0x9900('0x21')](_0x5ee4ad)[_0x9900('0x22')](function(_0x45c0d0){return _0x45c0d0;});}return null;};}function removeEntity(_0x5368bf,_0x37842b){return function(_0x218d7e){if(_0x218d7e){return _0x218d7e['destroy']()[_0x9900('0x22')](function(){_0x5368bf[_0x9900('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a015,_0x43ed24){return function(_0x2ac147){if(!_0x2ac147){_0x54a015['sendStatus'](0x194);}return _0x2ac147;};}function handleError(_0x285d51,_0x4507a9){_0x4507a9=_0x4507a9||0x1f4;return function(_0x5e3e21){logger[_0x9900('0x23')](_0x5e3e21[_0x9900('0x24')]);if(_0x5e3e21[_0x9900('0x25')]){delete _0x5e3e21[_0x9900('0x25')];}_0x285d51[_0x9900('0x16')](_0x4507a9)['send'](_0x5e3e21);};}exports[_0x9900('0x26')]=function(_0x44d775,_0x10fbae){var _0x32e343={},_0x3b1b94={},_0x50f16a={'count':0x0,'rows':[]};var _0x4cef1f=_['map'](db[_0x9900('0x27')][_0x9900('0x28')],function(_0x4ef405){return{'name':_0x4ef405[_0x9900('0x29')],'type':_0x4ef405[_0x9900('0x2a')][_0x9900('0x2b')]};});_0x3b1b94['model']=_['map'](_0x4cef1f,_0x9900('0x25'));_0x3b1b94[_0x9900('0x2c')]=_[_0x9900('0x2d')](_0x44d775[_0x9900('0x2c')]);_0x3b1b94['filters']=_['intersection'](_0x3b1b94[_0x9900('0x2e')],_0x3b1b94[_0x9900('0x2c')]);_0x32e343[_0x9900('0x2f')]=_[_0x9900('0x30')](_0x3b1b94[_0x9900('0x2e')],qs[_0x9900('0x31')](_0x44d775[_0x9900('0x2c')][_0x9900('0x31')]));_0x32e343[_0x9900('0x2f')]=_0x32e343[_0x9900('0x2f')][_0x9900('0x32')]?_0x32e343[_0x9900('0x2f')]:_0x3b1b94[_0x9900('0x2e')];if(!_0x44d775['query']['hasOwnProperty'](_0x9900('0x33'))){_0x32e343['limit']=qs[_0x9900('0x1b')](_0x44d775[_0x9900('0x2c')][_0x9900('0x1b')]);_0x32e343[_0x9900('0x19')]=qs[_0x9900('0x19')](_0x44d775[_0x9900('0x2c')][_0x9900('0x19')]);}_0x32e343[_0x9900('0x34')]=qs[_0x9900('0x35')](_0x44d775['query']['sort']);_0x32e343['where']=qs[_0x9900('0x36')](_[_0x9900('0x37')](_0x44d775['query'],_0x3b1b94[_0x9900('0x36')]),_0x4cef1f);if(_0x44d775[_0x9900('0x2c')][_0x9900('0x38')]){_0x32e343['where']=_[_0x9900('0x39')](_0x32e343[_0x9900('0x3a')],{'$or':_[_0x9900('0x3b')](_0x4cef1f,function(_0x141131){if(_0x141131[_0x9900('0x2a')]!==_0x9900('0x3c')){var _0x510d6a={};_0x510d6a[_0x141131[_0x9900('0x25')]]={'$like':'%'+_0x44d775[_0x9900('0x2c')]['filter']+'%'};return _0x510d6a;}})});}_0x32e343=_[_0x9900('0x39')]({},_0x32e343,_0x44d775['options']);var _0x2cee90={'where':_0x32e343[_0x9900('0x3a')]};return db['JscriptyAnswerReport'][_0x9900('0x1c')](_0x2cee90)[_0x9900('0x22')](function(_0x2595cc){_0x50f16a[_0x9900('0x1c')]=_0x2595cc;if(_0x44d775[_0x9900('0x2c')]['includeAll']){_0x32e343['include']=[{'all':!![]}];}return db[_0x9900('0x27')]['findAll'](_0x32e343);})['then'](function(_0x5e2765){_0x50f16a['rows']=_0x5e2765;return _0x50f16a;})['then'](respondWithFilteredResult(_0x10fbae,_0x32e343))[_0x9900('0x3d')](handleError(_0x10fbae,null));};exports[_0x9900('0x3e')]=function(_0x3c8f30,_0x42849a){var _0x31c003={'raw':!![],'where':{'id':_0x3c8f30[_0x9900('0x3f')]['id']}},_0xb94a40={};_0xb94a40[_0x9900('0x2e')]=_['keys'](db[_0x9900('0x27')][_0x9900('0x28')]);_0xb94a40['query']=_['keys'](_0x3c8f30[_0x9900('0x2c')]);_0xb94a40[_0x9900('0x36')]=_[_0x9900('0x30')](_0xb94a40[_0x9900('0x2e')],_0xb94a40[_0x9900('0x2c')]);_0x31c003[_0x9900('0x2f')]=_[_0x9900('0x30')](_0xb94a40[_0x9900('0x2e')],qs['fields'](_0x3c8f30[_0x9900('0x2c')][_0x9900('0x31')]));_0x31c003['attributes']=_0x31c003[_0x9900('0x2f')][_0x9900('0x32')]?_0x31c003[_0x9900('0x2f')]:_0xb94a40[_0x9900('0x2e')];if(_0x3c8f30['query'][_0x9900('0x40')]){_0x31c003[_0x9900('0x41')]=[{'all':!![]}];}_0x31c003=_['merge']({},_0x31c003,_0x3c8f30[_0x9900('0x42')]);return db[_0x9900('0x27')][_0x9900('0x43')](_0x31c003)['then'](handleEntityNotFound(_0x42849a,null))[_0x9900('0x22')](respondWithResult(_0x42849a,null))['catch'](handleError(_0x42849a,null));};exports[_0x9900('0x44')]=function(_0x5ea06a,_0x1409a0){return db[_0x9900('0x27')][_0x9900('0x44')](_0x5ea06a['body'],{})[_0x9900('0x22')](respondWithResult(_0x1409a0,0xc9))['catch'](handleError(_0x1409a0,null));};exports[_0x9900('0x21')]=function(_0x11be07,_0x5ac239){if(_0x11be07[_0x9900('0x45')]['id']){delete _0x11be07[_0x9900('0x45')]['id'];}return db['JscriptyAnswerReport'][_0x9900('0x43')]({'where':{'id':_0x11be07[_0x9900('0x3f')]['id']}})[_0x9900('0x22')](handleEntityNotFound(_0x5ac239,null))[_0x9900('0x22')](saveUpdates(_0x11be07[_0x9900('0x45')],null))['then'](respondWithResult(_0x5ac239,null))['catch'](handleError(_0x5ac239,null));};exports[_0x9900('0x46')]=function(_0x43cf2c,_0x2aa081){return db[_0x9900('0x27')][_0x9900('0x43')]({'where':{'id':_0x43cf2c['params']['id']}})[_0x9900('0x22')](handleEntityNotFound(_0x2aa081,null))[_0x9900('0x22')](removeEntity(_0x2aa081,null))[_0x9900('0x3d')](handleError(_0x2aa081,null));};exports[_0x9900('0x47')]=function(_0x2f7f74,_0xb5512f){return db[_0x9900('0x27')]['describe']()[_0x9900('0x22')](respondWithResult(_0xb5512f,null))['catch'](handleError(_0xb5512f,null));}; \ No newline at end of file +var _0x4491=['path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','JscriptyAnswerReport','includeAll','include','findAll','rows','show','params','find','create','body','catch','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x361833,_0x306590){var _0x6936d5=function(_0x3873f7){while(--_0x3873f7){_0x361833['push'](_0x361833['shift']());}};_0x6936d5(++_0x306590);}(_0x4491,0x1bb));var _0x1449=function(_0x321aee,_0x186c30){_0x321aee=_0x321aee-0x0;var _0x4e3fd7=_0x4491[_0x321aee];return _0x4e3fd7;};'use strict';var emlformat=require(_0x1449('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1449('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1449('0x2'));var moment=require(_0x1449('0x3'));var BPromise=require(_0x1449('0x4'));var Mustache=require(_0x1449('0x5'));var util=require(_0x1449('0x6'));var path=require(_0x1449('0x7'));var sox=require('sox');var csv=require(_0x1449('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1449('0x9'));var _=require(_0x1449('0xa'));var squel=require(_0x1449('0xb'));var crypto=require(_0x1449('0xc'));var jsforce=require(_0x1449('0xd'));var deskjs=require(_0x1449('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1449('0xf'));var Papa=require(_0x1449('0x10'));var Redis=require('ioredis');var authService=require(_0x1449('0x11'));var qs=require(_0x1449('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1449('0x13'));var logger=require(_0x1449('0x14'))('api');var utils=require(_0x1449('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1449('0x16'))['db'];function respondWithStatusCode(_0x3f5424,_0x399815){_0x399815=_0x399815||0xcc;return function(_0x25bce3){if(_0x25bce3){return _0x3f5424[_0x1449('0x17')](_0x399815);}return _0x3f5424[_0x1449('0x18')](_0x399815)[_0x1449('0x19')]();};}function respondWithResult(_0x377c96,_0x267d9a){_0x267d9a=_0x267d9a||0xc8;return function(_0x41b34d){if(_0x41b34d){return _0x377c96[_0x1449('0x18')](_0x267d9a)[_0x1449('0x1a')](_0x41b34d);}};}function respondWithFilteredResult(_0x441344,_0x2cf76c){return function(_0x1ec7e8){if(_0x1ec7e8){var _0x59b128=typeof _0x2cf76c[_0x1449('0x1b')]===_0x1449('0x1c')&&typeof _0x2cf76c['limit']===_0x1449('0x1c');var _0x290b72=_0x1ec7e8[_0x1449('0x1d')];var _0x364878=_0x59b128?0x0:_0x2cf76c[_0x1449('0x1b')];var _0x30a65f=_0x59b128?_0x1ec7e8[_0x1449('0x1d')]:_0x2cf76c[_0x1449('0x1b')]+_0x2cf76c[_0x1449('0x1e')];var _0x2dbae1;if(_0x30a65f>=_0x290b72){_0x30a65f=_0x290b72;_0x2dbae1=0xc8;}else{_0x2dbae1=0xce;}_0x441344[_0x1449('0x18')](_0x2dbae1);return _0x441344[_0x1449('0x1f')](_0x1449('0x20'),_0x364878+'-'+_0x30a65f+'/'+_0x290b72)['json'](_0x1ec7e8);}return null;};}function patchUpdates(_0x108f41){return function(_0x49c4d6){try{jsonpatch[_0x1449('0x21')](_0x49c4d6,_0x108f41,!![]);}catch(_0xaaea1d){return BPromise[_0x1449('0x22')](_0xaaea1d);}return _0x49c4d6[_0x1449('0x23')]();};}function saveUpdates(_0x3a2c85,_0x4dcc1b){return function(_0x4c86b9){if(_0x4c86b9){return _0x4c86b9[_0x1449('0x24')](_0x3a2c85)[_0x1449('0x25')](function(_0x100ac6){return _0x100ac6;});}return null;};}function removeEntity(_0x356d6b,_0x545cee){return function(_0x29e254){if(_0x29e254){return _0x29e254['destroy']()[_0x1449('0x25')](function(){_0x356d6b[_0x1449('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a8cf0,_0x507a14){return function(_0x1ef1e3){if(!_0x1ef1e3){_0x5a8cf0[_0x1449('0x17')](0x194);}return _0x1ef1e3;};}function handleError(_0x39ad3c,_0x529dae){_0x529dae=_0x529dae||0x1f4;return function(_0x40e7d5){logger['error'](_0x40e7d5[_0x1449('0x26')]);if(_0x40e7d5['name']){delete _0x40e7d5['name'];}_0x39ad3c[_0x1449('0x18')](_0x529dae)[_0x1449('0x27')](_0x40e7d5);};}exports['index']=function(_0xe6900c,_0x5c3fdf){var _0x2836a1={},_0x36a74a={},_0x5d51dd={'count':0x0,'rows':[]};var _0x4b6530=_[_0x1449('0x28')](db['JscriptyAnswerReport'][_0x1449('0x29')],function(_0x22b207){return{'name':_0x22b207[_0x1449('0x2a')],'type':_0x22b207[_0x1449('0x2b')][_0x1449('0x2c')]};});_0x36a74a[_0x1449('0x2d')]=_[_0x1449('0x28')](_0x4b6530,_0x1449('0x2e'));_0x36a74a[_0x1449('0x2f')]=_[_0x1449('0x30')](_0xe6900c[_0x1449('0x2f')]);_0x36a74a[_0x1449('0x31')]=_[_0x1449('0x32')](_0x36a74a[_0x1449('0x2d')],_0x36a74a[_0x1449('0x2f')]);_0x2836a1[_0x1449('0x33')]=_[_0x1449('0x32')](_0x36a74a['model'],qs[_0x1449('0x34')](_0xe6900c['query'][_0x1449('0x34')]));_0x2836a1[_0x1449('0x33')]=_0x2836a1[_0x1449('0x33')][_0x1449('0x35')]?_0x2836a1[_0x1449('0x33')]:_0x36a74a[_0x1449('0x2d')];if(!_0xe6900c[_0x1449('0x2f')][_0x1449('0x36')]('nolimit')){_0x2836a1['limit']=qs['limit'](_0xe6900c[_0x1449('0x2f')][_0x1449('0x1e')]);_0x2836a1[_0x1449('0x1b')]=qs[_0x1449('0x1b')](_0xe6900c[_0x1449('0x2f')][_0x1449('0x1b')]);}_0x2836a1[_0x1449('0x37')]=qs[_0x1449('0x38')](_0xe6900c['query'][_0x1449('0x38')]);_0x2836a1[_0x1449('0x39')]=qs[_0x1449('0x31')](_[_0x1449('0x3a')](_0xe6900c[_0x1449('0x2f')],_0x36a74a[_0x1449('0x31')]),_0x4b6530);if(_0xe6900c['query'][_0x1449('0x3b')]){_0x2836a1[_0x1449('0x39')]=_['merge'](_0x2836a1[_0x1449('0x39')],{'$or':_['map'](_0x4b6530,function(_0x2ccb90){if(_0x2ccb90[_0x1449('0x2b')]!==_0x1449('0x3c')){var _0x759c1f={};_0x759c1f[_0x2ccb90['name']]={'$like':'%'+_0xe6900c[_0x1449('0x2f')][_0x1449('0x3b')]+'%'};return _0x759c1f;}})});}_0x2836a1=_[_0x1449('0x3d')]({},_0x2836a1,_0xe6900c[_0x1449('0x3e')]);var _0xcc47b={'where':_0x2836a1[_0x1449('0x39')]};return db[_0x1449('0x3f')][_0x1449('0x1d')](_0xcc47b)[_0x1449('0x25')](function(_0x73e53b){_0x5d51dd['count']=_0x73e53b;if(_0xe6900c[_0x1449('0x2f')][_0x1449('0x40')]){_0x2836a1[_0x1449('0x41')]=[{'all':!![]}];}return db[_0x1449('0x3f')][_0x1449('0x42')](_0x2836a1);})[_0x1449('0x25')](function(_0x599cf1){_0x5d51dd[_0x1449('0x43')]=_0x599cf1;return _0x5d51dd;})[_0x1449('0x25')](respondWithFilteredResult(_0x5c3fdf,_0x2836a1))['catch'](handleError(_0x5c3fdf,null));};exports[_0x1449('0x44')]=function(_0xc6d28a,_0x37cc94){var _0x123a9c={'raw':!![],'where':{'id':_0xc6d28a[_0x1449('0x45')]['id']}},_0xc542dd={};_0xc542dd[_0x1449('0x2d')]=_[_0x1449('0x30')](db['JscriptyAnswerReport']['rawAttributes']);_0xc542dd['query']=_[_0x1449('0x30')](_0xc6d28a[_0x1449('0x2f')]);_0xc542dd['filters']=_[_0x1449('0x32')](_0xc542dd[_0x1449('0x2d')],_0xc542dd[_0x1449('0x2f')]);_0x123a9c[_0x1449('0x33')]=_[_0x1449('0x32')](_0xc542dd[_0x1449('0x2d')],qs[_0x1449('0x34')](_0xc6d28a['query']['fields']));_0x123a9c[_0x1449('0x33')]=_0x123a9c[_0x1449('0x33')][_0x1449('0x35')]?_0x123a9c[_0x1449('0x33')]:_0xc542dd[_0x1449('0x2d')];if(_0xc6d28a[_0x1449('0x2f')][_0x1449('0x40')]){_0x123a9c['include']=[{'all':!![]}];}_0x123a9c=_['merge']({},_0x123a9c,_0xc6d28a['options']);return db[_0x1449('0x3f')][_0x1449('0x46')](_0x123a9c)[_0x1449('0x25')](handleEntityNotFound(_0x37cc94,null))['then'](respondWithResult(_0x37cc94,null))['catch'](handleError(_0x37cc94,null));};exports['create']=function(_0x4354b4,_0x3ea728){return db[_0x1449('0x3f')][_0x1449('0x47')](_0x4354b4[_0x1449('0x48')],{})[_0x1449('0x25')](respondWithResult(_0x3ea728,0xc9))[_0x1449('0x49')](handleError(_0x3ea728,null));};exports[_0x1449('0x24')]=function(_0x521b42,_0x58b2ca){if(_0x521b42['body']['id']){delete _0x521b42[_0x1449('0x48')]['id'];}return db[_0x1449('0x3f')][_0x1449('0x46')]({'where':{'id':_0x521b42[_0x1449('0x45')]['id']}})['then'](handleEntityNotFound(_0x58b2ca,null))[_0x1449('0x25')](saveUpdates(_0x521b42[_0x1449('0x48')],null))['then'](respondWithResult(_0x58b2ca,null))[_0x1449('0x49')](handleError(_0x58b2ca,null));};exports[_0x1449('0x4a')]=function(_0x113165,_0x2125df){return db[_0x1449('0x3f')][_0x1449('0x46')]({'where':{'id':_0x113165[_0x1449('0x45')]['id']}})[_0x1449('0x25')](handleEntityNotFound(_0x2125df,null))[_0x1449('0x25')](removeEntity(_0x2125df,null))[_0x1449('0x49')](handleError(_0x2125df,null));};exports['describe']=function(_0x941737,_0x54e529){return db[_0x1449('0x3f')]['describe']()[_0x1449('0x25')](respondWithResult(_0x54e529,null))[_0x1449('0x49')](handleError(_0x54e529,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index b9cca2d..97092eb 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 _0x7215=['../../config/environment','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x3c18cd,_0x2e9d12){var _0x2005f3=function(_0x1a96ad){while(--_0x1a96ad){_0x3c18cd['push'](_0x3c18cd['shift']());}};_0x2005f3(++_0x2e9d12);}(_0x7215,0x138));var _0x5721=function(_0x2fa2e5,_0x48fa14){_0x2fa2e5=_0x2fa2e5-0x0;var _0x2e6480=_0x7215[_0x2fa2e5];return _0x2e6480;};'use strict';var _=require(_0x5721('0x0'));var util=require(_0x5721('0x1'));var logger=require('../../config/logger')(_0x5721('0x2'));var moment=require(_0x5721('0x3'));var BPromise=require(_0x5721('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5721('0x5'));var rimraf=require(_0x5721('0x6'));var config=require(_0x5721('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x45e2b6,_0x30aac3){return _0x45e2b6[_0x5721('0x8')](_0x5721('0x9'),attributes,{'tableName':_0x5721('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb36=['lodash','util','moment','request-promise','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x2cab87,_0x1b96f1){var _0x16d16c=function(_0x4cf799){while(--_0x4cf799){_0x2cab87['push'](_0x2cab87['shift']());}};_0x16d16c(++_0x1b96f1);}(_0xeb36,0x1c2));var _0x6eb3=function(_0x2a66cf,_0x1065ab){_0x2a66cf=_0x2a66cf-0x0;var _0x41c53f=_0xeb36[_0x2a66cf];return _0x41c53f;};'use strict';var _=require(_0x6eb3('0x0'));var util=require(_0x6eb3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6eb3('0x2'));var BPromise=require('bluebird');var rp=require(_0x6eb3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6eb3('0x4'));var attributes=require(_0x6eb3('0x5'));module['exports']=function(_0x25c59c,_0x23112b){return _0x25c59c[_0x6eb3('0x6')](_0x6eb3('0x7'),attributes,{'tableName':_0x6eb3('0x8'),'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 16f596f..e0b445a 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 _0x924e=['jayson/promise','client','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment'];(function(_0x310673,_0x38b1ed){var _0x2db355=function(_0x587de3){while(--_0x587de3){_0x310673['push'](_0x310673['shift']());}};_0x2db355(++_0x38b1ed);}(_0x924e,0x1c1));var _0xe924=function(_0x409cf8,_0x51102d){_0x409cf8=_0x409cf8-0x0;var _0x27bbae=_0x924e[_0x409cf8];return _0x27bbae;};'use strict';var _=require(_0xe924('0x0'));var util=require('util');var moment=require(_0xe924('0x1'));var BPromise=require(_0xe924('0x2'));var rs=require(_0xe924('0x3'));var fs=require('fs');var Redis=require(_0xe924('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe924('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe924('0x6'));var jayson=require(_0xe924('0x7'));var client=jayson[_0xe924('0x8')][_0xe924('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38697c,_0xd82e04,_0x2d2b66){return new BPromise(function(_0x200388,_0x40ab10){return client['request'](_0x38697c,_0x2d2b66)['then'](function(_0x349619){logger[_0xe924('0xa')](_0xe924('0xb'),_0xd82e04,_0xe924('0xc'));logger[_0xe924('0xd')](_0xe924('0xe'),_0xd82e04,'request\x20sent',JSON[_0xe924('0xf')](_0x349619));if(_0x349619[_0xe924('0x10')]){if(_0x349619['error']['code']===0x1f4){logger[_0xe924('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xd82e04,_0x349619[_0xe924('0x10')][_0xe924('0x11')]);return _0x40ab10(_0x349619[_0xe924('0x10')]['message']);}logger[_0xe924('0x10')](_0xe924('0xb'),_0xd82e04,_0x349619['error'][_0xe924('0x11')]);return _0x200388(_0x349619[_0xe924('0x10')][_0xe924('0x11')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0xd82e04,_0xe924('0xc'));_0x200388(_0x349619[_0xe924('0x12')]['message']);}})['catch'](function(_0x4e0370){logger[_0xe924('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xd82e04,_0x4e0370);_0x40ab10(_0x4e0370);});});} \ No newline at end of file +var _0x51ee=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x51ee,0x1b8));var _0xe51e=function(_0x2648b5,_0x8e3636){_0x2648b5=_0x2648b5-0x0;var _0x351282=_0x51ee[_0x2648b5];return _0x351282;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe51e('0x0'));var BPromise=require(_0xe51e('0x1'));var rs=require(_0xe51e('0x2'));var fs=require('fs');var Redis=require(_0xe51e('0x3'));var db=require(_0xe51e('0x4'))['db'];var utils=require(_0xe51e('0x5'));var logger=require('../../config/logger')(_0xe51e('0x6'));var config=require(_0xe51e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe51e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x98526d,_0x20b7a1,_0x5a6a4f){return new BPromise(function(_0x2d36b1,_0x71419c){return client[_0xe51e('0x9')](_0x98526d,_0x5a6a4f)[_0xe51e('0xa')](function(_0x1ecc1a){logger[_0xe51e('0xb')](_0xe51e('0xc'),_0x20b7a1,_0xe51e('0xd'));logger['debug'](_0xe51e('0xe'),_0x20b7a1,_0xe51e('0xd'),JSON[_0xe51e('0xf')](_0x1ecc1a));if(_0x1ecc1a[_0xe51e('0x10')]){if(_0x1ecc1a[_0xe51e('0x10')][_0xe51e('0x11')]===0x1f4){logger[_0xe51e('0x10')](_0xe51e('0xc'),_0x20b7a1,_0x1ecc1a[_0xe51e('0x10')][_0xe51e('0x12')]);return _0x71419c(_0x1ecc1a[_0xe51e('0x10')][_0xe51e('0x12')]);}logger[_0xe51e('0x10')](_0xe51e('0xc'),_0x20b7a1,_0x1ecc1a['error'][_0xe51e('0x12')]);return _0x2d36b1(_0x1ecc1a[_0xe51e('0x10')][_0xe51e('0x12')]);}else{logger[_0xe51e('0xb')](_0xe51e('0xc'),_0x20b7a1,_0xe51e('0xd'));_0x2d36b1(_0x1ecc1a[_0xe51e('0x13')][_0xe51e('0x12')]);}})['catch'](function(_0x5c68d7){logger['error'](_0xe51e('0xc'),_0x20b7a1,_0x5c68d7);_0x71419c(_0x5c68d7);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 44fe542..b4e26ab 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 _0x6f2c=['/:id','/:id/sessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','create','/:id/clone','clone','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index'];(function(_0x1df8c0,_0x14d7b4){var _0x3c2e77=function(_0x3f8ba5){while(--_0x3f8ba5){_0x1df8c0['push'](_0x1df8c0['shift']());}};_0x3c2e77(++_0x14d7b4);}(_0x6f2c,0xde));var _0xc6f2=function(_0x49ac38,_0x2e7546){_0x49ac38=_0x49ac38-0x0;var _0x347416=_0x6f2c[_0x49ac38];return _0x347416;};'use strict';var multer=require(_0xc6f2('0x0'));var util=require('util');var path=require(_0xc6f2('0x1'));var timeout=require('connect-timeout');var express=require(_0xc6f2('0x2'));var router=express[_0xc6f2('0x3')]();var fs_extra=require(_0xc6f2('0x4'));var auth=require(_0xc6f2('0x5'));var interaction=require(_0xc6f2('0x6'));var config=require(_0xc6f2('0x7'));var controller=require(_0xc6f2('0x8'));router[_0xc6f2('0x9')]('/',auth[_0xc6f2('0xa')](),controller[_0xc6f2('0xb')]);router[_0xc6f2('0x9')](_0xc6f2('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xc6f2('0xd'),auth[_0xc6f2('0xa')](),controller['getSessions']);router['get'](_0xc6f2('0xe'),auth[_0xc6f2('0xa')](),controller[_0xc6f2('0xf')]);router[_0xc6f2('0x9')](_0xc6f2('0x10'),auth[_0xc6f2('0xa')](),timeout(_0xc6f2('0x11')),controller[_0xc6f2('0x12')]);router['post']('/',auth[_0xc6f2('0xa')](),controller[_0xc6f2('0x13')]);router['post'](_0xc6f2('0x14'),auth[_0xc6f2('0xa')](),controller[_0xc6f2('0x15')]);router[_0xc6f2('0x16')]('/:id',auth[_0xc6f2('0xa')](),controller[_0xc6f2('0x17')]);router[_0xc6f2('0x18')](_0xc6f2('0xc'),auth[_0xc6f2('0xa')](),controller[_0xc6f2('0x19')]);module['exports']=router; \ No newline at end of file +var _0x99cf=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','/:id','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x99cf,0x193));var _0xf99c=function(_0x4aebcd,_0x58d5ac){_0x4aebcd=_0x4aebcd-0x0;var _0x29412d=_0x99cf[_0x4aebcd];return _0x29412d;};'use strict';var multer=require(_0xf99c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf99c('0x1'));var express=require(_0xf99c('0x2'));var router=express[_0xf99c('0x3')]();var fs_extra=require(_0xf99c('0x4'));var auth=require(_0xf99c('0x5'));var interaction=require(_0xf99c('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0xf99c('0x7')]('/',auth[_0xf99c('0x8')](),controller['index']);router[_0xf99c('0x7')]('/:id',auth[_0xf99c('0x8')](),controller[_0xf99c('0x9')]);router[_0xf99c('0x7')]('/:id/sessions',auth[_0xf99c('0x8')](),controller[_0xf99c('0xa')]);router[_0xf99c('0x7')](_0xf99c('0xb'),auth[_0xf99c('0x8')](),controller['getAnswers']);router['get'](_0xf99c('0xc'),auth[_0xf99c('0x8')](),timeout(_0xf99c('0xd')),controller[_0xf99c('0xe')]);router[_0xf99c('0xf')]('/',auth[_0xf99c('0x8')](),controller[_0xf99c('0x10')]);router[_0xf99c('0xf')](_0xf99c('0x11'),auth[_0xf99c('0x8')](),controller[_0xf99c('0x12')]);router[_0xf99c('0x13')](_0xf99c('0x14'),auth['isAuthenticated'](),controller[_0xf99c('0x15')]);router[_0xf99c('0x16')](_0xf99c('0x14'),auth['isAuthenticated'](),controller[_0xf99c('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 71f5784..e89831a 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 _0xd485=['isObjectLike','setDataValue','formData','stringify','format','getDataValue','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xd485,0x18d));var _0x5d48=function(_0x35b7b2,_0x437bab){_0x35b7b2=_0x35b7b2-0x0;var _0x488ca0=_0xd485[_0x35b7b2];return _0x488ca0;};'use strict';var Sequelize=require(_0x5d48('0x0'));var _=require(_0x5d48('0x1'));var util=require(_0x5d48('0x2'));module[_0x5d48('0x3')]={'name':{'type':Sequelize[_0x5d48('0x4')],'unique':_0x5d48('0x5')},'description':{'type':Sequelize[_0x5d48('0x4')]},'formData':{'type':Sequelize[_0x5d48('0x6')](_0x5d48('0x7')),'set':function(_0x393903){if(_[_0x5d48('0x8')](_0x393903)){this[_0x5d48('0x9')](_0x5d48('0xa'),JSON[_0x5d48('0xb')](_0x393903));}else if(_['isString'](_0x393903)){this[_0x5d48('0x9')](_0x5d48('0xa'),_0x393903);}else{this[_0x5d48('0x9')](_0x5d48('0xa'),util[_0x5d48('0xc')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x5d48('0xd')](_0x5d48('0x5'))||'',this[_0x5d48('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x5d48('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x5d48('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x3b2c=['setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','lodash','util','exports','STRING','name','long'];(function(_0x399aac,_0x162856){var _0x2b902e=function(_0x5a7115){while(--_0x5a7115){_0x399aac['push'](_0x399aac['shift']());}};_0x2b902e(++_0x162856);}(_0x3b2c,0x1e8));var _0xc3b2=function(_0xcfc33c,_0x121aa8){_0xcfc33c=_0xcfc33c-0x0;var _0x295d21=_0x3b2c[_0xcfc33c];return _0x295d21;};'use strict';var Sequelize=require('sequelize');var _=require(_0xc3b2('0x0'));var util=require(_0xc3b2('0x1'));module[_0xc3b2('0x2')]={'name':{'type':Sequelize[_0xc3b2('0x3')],'unique':_0xc3b2('0x4')},'description':{'type':Sequelize[_0xc3b2('0x3')]},'formData':{'type':Sequelize['TEXT'](_0xc3b2('0x5')),'set':function(_0x131223){if(_['isObjectLike'](_0x131223)){this[_0xc3b2('0x6')](_0xc3b2('0x7'),JSON[_0xc3b2('0x8')](_0x131223));}else if(_['isString'](_0x131223)){this['setDataValue'](_0xc3b2('0x7'),_0x131223);}else{this[_0xc3b2('0x6')](_0xc3b2('0x7'),util[_0xc3b2('0x9')](_0xc3b2('0xa'),this['getDataValue'](_0xc3b2('0x4'))||'',this[_0xc3b2('0xb')](_0xc3b2('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 61fded4..7da7a3d 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 _0x7461=['end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','fields','length','body','user','role','UserProfileSection','find','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','Projects','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7461,0xdb));var _0x1746=function(_0x444990,_0x44196a){_0x444990=_0x444990-0x0;var _0x4b99de=_0x7461[_0x444990];return _0x4b99de;};'use strict';var emlformat=require(_0x1746('0x0'));var rimraf=require(_0x1746('0x1'));var zipdir=require(_0x1746('0x2'));var jsonpatch=require(_0x1746('0x3'));var rp=require(_0x1746('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1746('0x5'));var sox=require(_0x1746('0x6'));var csv=require(_0x1746('0x7'));var ejs=require(_0x1746('0x8'));var fs=require('fs');var fs_extra=require(_0x1746('0x9'));var _=require(_0x1746('0xa'));var squel=require(_0x1746('0xb'));var crypto=require(_0x1746('0xc'));var jsforce=require(_0x1746('0xd'));var deskjs=require(_0x1746('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1746('0xf'));var Papa=require('papaparse');var Redis=require(_0x1746('0x10'));var authService=require(_0x1746('0x11'));var qs=require(_0x1746('0x12'));var as=require(_0x1746('0x13'));var hardwareService=require(_0x1746('0x14'));var logger=require(_0x1746('0x15'))(_0x1746('0x16'));var utils=require(_0x1746('0x17'));var config=require(_0x1746('0x18'));var licenseUtil=require(_0x1746('0x19'));var db=require(_0x1746('0x1a'))['db'];function respondWithStatusCode(_0x39b57e,_0x35f0b0){_0x35f0b0=_0x35f0b0||0xcc;return function(_0x11ea81){if(_0x11ea81){return _0x39b57e[_0x1746('0x1b')](_0x35f0b0);}return _0x39b57e[_0x1746('0x1c')](_0x35f0b0)[_0x1746('0x1d')]();};}function respondWithResult(_0x243cad,_0x2b2ec8){_0x2b2ec8=_0x2b2ec8||0xc8;return function(_0x5654d7){if(_0x5654d7){return _0x243cad[_0x1746('0x1c')](_0x2b2ec8)[_0x1746('0x1e')](_0x5654d7);}};}function respondWithFilteredResult(_0x19f09d,_0x3bb7bd){return function(_0x34880f){if(_0x34880f){var _0x32e67f=typeof _0x3bb7bd['offset']===_0x1746('0x1f')&&typeof _0x3bb7bd[_0x1746('0x20')]===_0x1746('0x1f');var _0x1f4dd5=_0x34880f[_0x1746('0x21')];var _0x47aaf4=_0x32e67f?0x0:_0x3bb7bd[_0x1746('0x22')];var _0x1545c3=_0x32e67f?_0x34880f[_0x1746('0x21')]:_0x3bb7bd[_0x1746('0x22')]+_0x3bb7bd['limit'];var _0x4461f2;if(_0x1545c3>=_0x1f4dd5){_0x1545c3=_0x1f4dd5;_0x4461f2=0xc8;}else{_0x4461f2=0xce;}_0x19f09d[_0x1746('0x1c')](_0x4461f2);return _0x19f09d[_0x1746('0x23')](_0x1746('0x24'),_0x47aaf4+'-'+_0x1545c3+'/'+_0x1f4dd5)[_0x1746('0x1e')](_0x34880f);}return null;};}function patchUpdates(_0xab2a5a){return function(_0x28ecc0){try{jsonpatch[_0x1746('0x25')](_0x28ecc0,_0xab2a5a,!![]);}catch(_0x9e1a77){return BPromise[_0x1746('0x26')](_0x9e1a77);}return _0x28ecc0[_0x1746('0x27')]();};}function saveUpdates(_0x34f0d8,_0xb87d6e){return function(_0x4b737b){if(_0x4b737b){return _0x4b737b[_0x1746('0x28')](_0x34f0d8)['then'](function(_0x16e9dc){return _0x16e9dc;});}return null;};}function removeEntity(_0x51a380,_0x3428be){return function(_0x4b9ab2){if(_0x4b9ab2){return _0x4b9ab2['destroy']()[_0x1746('0x29')](function(){var _0x188e64=_0x4b9ab2[_0x1746('0x2a')]({'plain':!![]});var _0x59fc66='Projects';return db[_0x1746('0x2b')][_0x1746('0x2c')]({'where':{'type':_0x59fc66,'resourceId':_0x188e64['id']}})[_0x1746('0x29')](function(){return _0x4b9ab2;});})['then'](function(){_0x51a380['status'](0xcc)[_0x1746('0x1d')]();});}};}function handleEntityNotFound(_0x513e31,_0x54dc1e){return function(_0x2bbbca){if(!_0x2bbbca){_0x513e31[_0x1746('0x1b')](0x194);}return _0x2bbbca;};}function handleError(_0x20dc43,_0x1c4d47){_0x1c4d47=_0x1c4d47||0x1f4;return function(_0x2124f3){logger[_0x1746('0x2d')](_0x2124f3[_0x1746('0x2e')]);if(_0x2124f3[_0x1746('0x2f')]){delete _0x2124f3['name'];}_0x20dc43[_0x1746('0x1c')](_0x1c4d47)['send'](_0x2124f3);};}exports[_0x1746('0x30')]=function(_0xaea714,_0x6e58c3){var _0x49ba0e={},_0x286396={},_0x21a2d0={'count':0x0,'rows':[]};var _0x1fff91=_[_0x1746('0x31')](db[_0x1746('0x32')][_0x1746('0x33')],function(_0xd7d9c1){return{'name':_0xd7d9c1[_0x1746('0x34')],'type':_0xd7d9c1[_0x1746('0x35')][_0x1746('0x36')]};});_0x286396[_0x1746('0x37')]=_['map'](_0x1fff91,_0x1746('0x2f'));_0x286396[_0x1746('0x38')]=_['keys'](_0xaea714[_0x1746('0x38')]);_0x286396[_0x1746('0x39')]=_[_0x1746('0x3a')](_0x286396[_0x1746('0x37')],_0x286396['query']);_0x49ba0e['attributes']=_['intersection'](_0x286396[_0x1746('0x37')],qs['fields'](_0xaea714['query']['fields']));_0x49ba0e[_0x1746('0x3b')]=_0x49ba0e['attributes']['length']?_0x49ba0e[_0x1746('0x3b')]:_0x286396[_0x1746('0x37')];if(!_0xaea714['query'][_0x1746('0x3c')](_0x1746('0x3d'))){_0x49ba0e[_0x1746('0x20')]=qs[_0x1746('0x20')](_0xaea714[_0x1746('0x38')][_0x1746('0x20')]);_0x49ba0e[_0x1746('0x22')]=qs['offset'](_0xaea714[_0x1746('0x38')][_0x1746('0x22')]);}_0x49ba0e[_0x1746('0x3e')]=qs[_0x1746('0x3f')](_0xaea714[_0x1746('0x38')][_0x1746('0x3f')]);_0x49ba0e[_0x1746('0x40')]=qs[_0x1746('0x39')](_[_0x1746('0x41')](_0xaea714['query'],_0x286396[_0x1746('0x39')]),_0x1fff91);if(_0xaea714[_0x1746('0x38')][_0x1746('0x42')]){_0x49ba0e['where']=_[_0x1746('0x43')](_0x49ba0e[_0x1746('0x40')],{'$or':_[_0x1746('0x31')](_0x1fff91,function(_0x5a5b65){if(_0x5a5b65[_0x1746('0x35')]!==_0x1746('0x44')){var _0x25b757={};_0x25b757[_0x5a5b65[_0x1746('0x2f')]]={'$like':'%'+_0xaea714['query'][_0x1746('0x42')]+'%'};return _0x25b757;}})});}_0x49ba0e=_[_0x1746('0x43')]({},_0x49ba0e,_0xaea714[_0x1746('0x45')]);var _0x2bc28d={'where':_0x49ba0e[_0x1746('0x40')]};return db['JscriptyProject'][_0x1746('0x21')](_0x2bc28d)[_0x1746('0x29')](function(_0x33033b){_0x21a2d0[_0x1746('0x21')]=_0x33033b;if(_0xaea714[_0x1746('0x38')][_0x1746('0x46')]){_0x49ba0e[_0x1746('0x47')]=[{'all':!![]}];}return db[_0x1746('0x32')][_0x1746('0x48')](_0x49ba0e);})['then'](function(_0x1589bd){_0x21a2d0[_0x1746('0x49')]=_0x1589bd;return _0x21a2d0;})['then'](respondWithFilteredResult(_0x6e58c3,_0x49ba0e))[_0x1746('0x4a')](handleError(_0x6e58c3,null));};exports['show']=function(_0x5225ca,_0x20b9d7){var _0x24296a={'raw':![],'where':{'id':_0x5225ca['params']['id']}},_0x3eec47={};_0x3eec47['model']=_['keys'](db['JscriptyProject'][_0x1746('0x33')]);_0x3eec47[_0x1746('0x38')]=_[_0x1746('0x4b')](_0x5225ca[_0x1746('0x38')]);_0x3eec47[_0x1746('0x39')]=_[_0x1746('0x3a')](_0x3eec47[_0x1746('0x37')],_0x3eec47[_0x1746('0x38')]);_0x24296a['attributes']=_['intersection'](_0x3eec47[_0x1746('0x37')],qs[_0x1746('0x4c')](_0x5225ca['query'][_0x1746('0x4c')]));_0x24296a['attributes']=_0x24296a[_0x1746('0x3b')][_0x1746('0x4d')]?_0x24296a[_0x1746('0x3b')]:_0x3eec47[_0x1746('0x37')];if(_0x5225ca[_0x1746('0x38')][_0x1746('0x46')]){_0x24296a[_0x1746('0x47')]=[{'all':!![]}];}_0x24296a=_[_0x1746('0x43')]({},_0x24296a,_0x5225ca['options']);return db[_0x1746('0x32')]['find'](_0x24296a)[_0x1746('0x29')](handleEntityNotFound(_0x20b9d7,null))[_0x1746('0x29')](respondWithResult(_0x20b9d7,null))['catch'](handleError(_0x20b9d7,null));};exports['create']=function(_0xf04149,_0x4eb440){return db[_0x1746('0x32')]['create'](_0xf04149[_0x1746('0x4e')],{})[_0x1746('0x29')](function(_0x57fdaa){var _0xb3c7ef=_0xf04149[_0x1746('0x4f')][_0x1746('0x2a')]({'plain':!![]});if(!_0xb3c7ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb3c7ef[_0x1746('0x50')]===_0x1746('0x4f')){var _0x1441bc=_0x57fdaa[_0x1746('0x2a')]({'plain':!![]});var _0x20962b='Projects';return db[_0x1746('0x51')][_0x1746('0x52')]({'where':{'name':_0x20962b,'userProfileId':_0xb3c7ef[_0x1746('0x53')]},'raw':!![]})[_0x1746('0x29')](function(_0x5a5560){if(_0x5a5560&&_0x5a5560['autoAssociation']===0x0){return db[_0x1746('0x2b')][_0x1746('0x54')]({'name':_0x1441bc[_0x1746('0x2f')],'resourceId':_0x1441bc['id'],'type':_0x5a5560[_0x1746('0x2f')],'sectionId':_0x5a5560['id']},{})[_0x1746('0x29')](function(){return _0x57fdaa;});}else{return _0x57fdaa;}})[_0x1746('0x4a')](function(_0x4a3971){logger[_0x1746('0x2d')](_0x1746('0x55'),_0x4a3971);throw _0x4a3971;});}return _0x57fdaa;})[_0x1746('0x29')](respondWithResult(_0x4eb440,0xc9))[_0x1746('0x4a')](handleError(_0x4eb440,null));};exports[_0x1746('0x56')]=function(_0x2158dc,_0x218e8c){var _0x5ae343={'where':{'id':_0x2158dc[_0x1746('0x57')]['id']}},_0x34f96e={};_0x34f96e['model']=_[_0x1746('0x4b')](db['JscriptyProject'][_0x1746('0x33')]);_0x5ae343['attributes']=_[_0x1746('0x3a')](_0x34f96e[_0x1746('0x37')],qs[_0x1746('0x4c')](_0x2158dc['query'][_0x1746('0x4c')]));_0x5ae343[_0x1746('0x3b')]=_0x5ae343[_0x1746('0x3b')][_0x1746('0x4d')]?_0x5ae343[_0x1746('0x3b')]:_0x34f96e[_0x1746('0x37')];if(_0x2158dc[_0x1746('0x38')][_0x1746('0x46')]){_0x5ae343[_0x1746('0x47')]=[{'all':!![]}];}_0x5ae343=_['merge']({},_0x5ae343,_0x2158dc[_0x1746('0x45')]);return db['JscriptyProject'][_0x1746('0x52')](_0x5ae343)[_0x1746('0x29')](handleEntityNotFound(_0x218e8c,null))['then'](function(_0x1c2c23){if(_0x1c2c23){var _0x14c0cf=_0x1c2c23[_0x1746('0x2a')]({'plain':!![]});_0x14c0cf=qs[_0x1746('0x58')](_0x14c0cf,['id',_0x1746('0x59'),_0x1746('0x5a')]);_0x2158dc[_0x1746('0x4e')]=_[_0x1746('0x58')](_0x2158dc['body'],['id',_0x1746('0x59'),_0x1746('0x5a')]);return db[_0x1746('0x32')][_0x1746('0x54')](_['merge'](_0x14c0cf,_0x2158dc[_0x1746('0x4e')]),{'include':_0x2158dc[_0x1746('0x38')][_0x1746('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x57cac5){var _0x248654=_0x2158dc[_0x1746('0x4f')][_0x1746('0x2a')]({'plain':!![]});if(!_0x248654)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x248654[_0x1746('0x50')]===_0x1746('0x4f')){var _0x46b111=_0x57cac5[_0x1746('0x2a')]({'plain':!![]});var _0x3b591a=_0x1746('0x5b');return db[_0x1746('0x51')][_0x1746('0x52')]({'where':{'name':_0x3b591a,'userProfileId':_0x248654[_0x1746('0x53')]},'raw':!![]})['then'](function(_0x566188){if(_0x566188&&_0x566188['autoAssociation']===0x0){return db[_0x1746('0x2b')][_0x1746('0x54')]({'name':_0x46b111[_0x1746('0x2f')],'resourceId':_0x46b111['id'],'type':_0x566188[_0x1746('0x2f')],'sectionId':_0x566188['id']},{})['then'](function(){return _0x57cac5;});}else{return _0x57cac5;}})[_0x1746('0x4a')](function(_0x4fd808){logger[_0x1746('0x2d')](_0x1746('0x55'),_0x4fd808);throw _0x4fd808;});}return _0x57cac5;});}})[_0x1746('0x29')](respondWithResult(_0x218e8c,0xc9))['catch'](handleError(_0x218e8c,null));};exports[_0x1746('0x28')]=function(_0x4b1e77,_0x42beff){if(_0x4b1e77['body']['id']){delete _0x4b1e77[_0x1746('0x4e')]['id'];}return db['JscriptyProject'][_0x1746('0x52')]({'where':{'id':_0x4b1e77['params']['id']}})[_0x1746('0x29')](handleEntityNotFound(_0x42beff,null))[_0x1746('0x29')](saveUpdates(_0x4b1e77[_0x1746('0x4e')],null))[_0x1746('0x29')](respondWithResult(_0x42beff,null))[_0x1746('0x4a')](handleError(_0x42beff,null));};exports['destroy']=function(_0x4b641a,_0x5dd2cc){return db[_0x1746('0x32')][_0x1746('0x52')]({'where':{'id':_0x4b641a[_0x1746('0x57')]['id']}})[_0x1746('0x29')](handleEntityNotFound(_0x5dd2cc,null))[_0x1746('0x29')](removeEntity(_0x5dd2cc,null))[_0x1746('0x4a')](handleError(_0x5dd2cc,null));};exports[_0x1746('0x5c')]=function(_0x57b391,_0x376bf0,_0x353336){var _0x797f0f={'raw':!![],'where':{}};var _0x221782={};var _0x224d07={'count':0x0,'rows':[]};return db[_0x1746('0x32')][_0x1746('0x5d')]({'where':{'id':_0x57b391[_0x1746('0x57')]['id']}})[_0x1746('0x29')](handleEntityNotFound(_0x376bf0,null))[_0x1746('0x29')](function(_0x145c23){if(_0x145c23){_0x221782['model']=_[_0x1746('0x4b')](db[_0x1746('0x5e')][_0x1746('0x33')]);_0x221782[_0x1746('0x38')]=_[_0x1746('0x4b')](_0x57b391[_0x1746('0x38')]);_0x221782[_0x1746('0x39')]=_[_0x1746('0x3a')](_0x221782[_0x1746('0x37')],_0x221782[_0x1746('0x38')]);_0x797f0f[_0x1746('0x3b')]=_['intersection'](_0x221782['model'],qs['fields'](_0x57b391[_0x1746('0x38')][_0x1746('0x4c')]));_0x797f0f[_0x1746('0x3b')]=_0x797f0f[_0x1746('0x3b')][_0x1746('0x4d')]?_0x797f0f[_0x1746('0x3b')]:_0x221782['model'];if(!_0x57b391[_0x1746('0x38')]['hasOwnProperty'](_0x1746('0x3d'))){_0x797f0f[_0x1746('0x20')]=qs['limit'](_0x57b391['query']['limit']);_0x797f0f[_0x1746('0x22')]=qs[_0x1746('0x22')](_0x57b391[_0x1746('0x38')][_0x1746('0x22')]);}_0x797f0f[_0x1746('0x3e')]=qs['sort'](_0x57b391[_0x1746('0x38')][_0x1746('0x3f')]);_0x797f0f[_0x1746('0x40')]=qs[_0x1746('0x39')](_[_0x1746('0x41')](_0x57b391['query'],_0x221782[_0x1746('0x39')]));_0x797f0f[_0x1746('0x40')][_0x1746('0x5f')]=_0x145c23['id'];if(_0x57b391['query'][_0x1746('0x42')]){_0x797f0f[_0x1746('0x40')]=_['merge'](_0x797f0f['where'],{'$or':_[_0x1746('0x31')](_0x797f0f[_0x1746('0x3b')],function(_0x255f35){var _0x27965c={};_0x27965c[_0x255f35]={'$like':'%'+_0x57b391[_0x1746('0x38')][_0x1746('0x42')]+'%'};return _0x27965c;})});}_0x797f0f=_[_0x1746('0x43')]({},_0x797f0f,_0x57b391[_0x1746('0x45')]);return db[_0x1746('0x5e')][_0x1746('0x21')]({'where':_0x797f0f[_0x1746('0x40')]})[_0x1746('0x29')](function(_0x1054f0){_0x224d07[_0x1746('0x21')]=_0x1054f0;if(_0x57b391[_0x1746('0x38')][_0x1746('0x46')]){_0x797f0f['include']=[{'all':!![]}];}return db[_0x1746('0x5e')]['findAll'](_0x797f0f);})[_0x1746('0x29')](function(_0x16b3c6){_0x224d07[_0x1746('0x49')]=_0x16b3c6;return _0x224d07;});}})['then'](respondWithFilteredResult(_0x376bf0,_0x797f0f))[_0x1746('0x4a')](handleError(_0x376bf0,null));};exports[_0x1746('0x60')]=function(_0x12ec14,_0xa184e5,_0x506fb3){var _0x42523a={'raw':!![],'where':{}};var _0x188e7a={};var _0x491a79={'count':0x0,'rows':[]};return db[_0x1746('0x32')][_0x1746('0x5d')]({'where':{'id':_0x12ec14[_0x1746('0x57')]['id']}})[_0x1746('0x29')](handleEntityNotFound(_0xa184e5,null))[_0x1746('0x29')](function(_0x4cb009){if(_0x4cb009){_0x188e7a[_0x1746('0x37')]=_['keys'](db[_0x1746('0x61')][_0x1746('0x33')]);_0x188e7a['query']=_[_0x1746('0x4b')](_0x12ec14[_0x1746('0x38')]);_0x188e7a[_0x1746('0x39')]=_[_0x1746('0x3a')](_0x188e7a[_0x1746('0x37')],_0x188e7a[_0x1746('0x38')]);_0x42523a['attributes']=_[_0x1746('0x3a')](_0x188e7a['model'],qs[_0x1746('0x4c')](_0x12ec14[_0x1746('0x38')]['fields']));_0x42523a['attributes']=_0x42523a['attributes']['length']?_0x42523a[_0x1746('0x3b')]:_0x188e7a[_0x1746('0x37')];if(!_0x12ec14['query'][_0x1746('0x3c')](_0x1746('0x3d'))){_0x42523a[_0x1746('0x20')]=qs[_0x1746('0x20')](_0x12ec14['query'][_0x1746('0x20')]);_0x42523a[_0x1746('0x22')]=qs[_0x1746('0x22')](_0x12ec14[_0x1746('0x38')]['offset']);}_0x42523a[_0x1746('0x3e')]=qs[_0x1746('0x3f')](_0x12ec14['query'][_0x1746('0x3f')]);_0x42523a[_0x1746('0x40')]=qs[_0x1746('0x39')](_['pick'](_0x12ec14['query'],_0x188e7a['filters']));_0x42523a[_0x1746('0x40')][_0x1746('0x5f')]=_0x4cb009['id'];if(_0x12ec14[_0x1746('0x38')][_0x1746('0x42')]){_0x42523a[_0x1746('0x40')]=_[_0x1746('0x43')](_0x42523a['where'],{'$or':_['map'](_0x42523a[_0x1746('0x3b')],function(_0x76a9b3){var _0x114a0c={};_0x114a0c[_0x76a9b3]={'$like':'%'+_0x12ec14['query']['filter']+'%'};return _0x114a0c;})});}_0x42523a=_[_0x1746('0x43')]({},_0x42523a,_0x12ec14[_0x1746('0x45')]);return db['JscriptyAnswerReport'][_0x1746('0x21')]({'where':_0x42523a[_0x1746('0x40')]})[_0x1746('0x29')](function(_0x4d59de){_0x491a79[_0x1746('0x21')]=_0x4d59de;if(_0x12ec14[_0x1746('0x38')][_0x1746('0x46')]){_0x42523a[_0x1746('0x47')]=[{'all':!![]}];}return db[_0x1746('0x61')]['findAll'](_0x42523a);})[_0x1746('0x29')](function(_0x583731){_0x491a79[_0x1746('0x49')]=_0x583731;return _0x491a79;});}})[_0x1746('0x29')](respondWithFilteredResult(_0xa184e5,_0x42523a))[_0x1746('0x4a')](handleError(_0xa184e5,null));};function char(_0x22f0eb){return _0x1746('0x62')===typeof _0x22f0eb?String[_0x1746('0x63')][_0x1746('0x25')](null,arguments):_0x22f0eb;}function needsEncapsulation(_0x55a4a2){return!!_0x55a4a2&&(_0x55a4a2[_0x1746('0x64')]()[_0x1746('0x65')](char(0xd))>=0x0||_0x55a4a2[_0x1746('0x64')]()['indexOf'](char(0xa))>=0x0||_0x55a4a2[_0x1746('0x64')]()['indexOf'](char(0x2c))>=0x0||_0x55a4a2[_0x1746('0x64')]()[_0x1746('0x65')](char(0x22))>=0x0);}function encapsulate(_0x3568d7){var _0x1750a9=char(0x22),_0x42bd62='\x5c'+char(0x22),_0xf6928a=_0x3568d7['toString']()[_0x1746('0x66')](new RegExp(_0x1750a9,'g'),_0x42bd62);return _0x1750a9+_0xf6928a+_0x1750a9;}exports[_0x1746('0x67')]=function(_0x5c5828,_0x56058b,_0xe6ae7f){var _0x111a26,_0x246f07;var _0xbaba90={'where':{'ProjectId':_0x5c5828[_0x1746('0x57')]['id']}};if(_0x5c5828[_0x1746('0x38')][_0x1746('0x68')]){_0xbaba90[_0x1746('0x40')]['starttime']=JSON[_0x1746('0x69')](_0x5c5828['query']['startTime']);}return db[_0x1746('0x5e')][_0x1746('0x48')](_0xbaba90)['then'](handleEntityNotFound(_0x56058b,null))[_0x1746('0x29')](function(_0x378847){if(_0x378847){_0x111a26=_0x378847;return db[_0x1746('0x6a')][_0x1746('0x48')]({'where':{'SessionId':{'$in':_[_0x1746('0x31')](_0x111a26,'id')},'ProjectId':_0x5c5828[_0x1746('0x57')]['id']},'order':_0x1746('0x6b')});}})[_0x1746('0x29')](handleEntityNotFound(_0x56058b,null))[_0x1746('0x29')](function(_0x2bc6fa){if(_0x2bc6fa){_0x246f07=_0x2bc6fa;var _0x591bae={};for(var _0x37e82c=0x0,_0xe7f2e8=_0x246f07[_0x1746('0x4d')];_0x37e82c<_0xe7f2e8;_0x37e82c++){if(!_0x591bae[_0x1746('0x3c')](_0x246f07[_0x37e82c][_0x1746('0x6c')])){_0x591bae[_0x246f07[_0x37e82c]['questionId']]=needsEncapsulation(_0x246f07[_0x37e82c][_0x1746('0x6d')])?encapsulate(_0x246f07[_0x37e82c][_0x1746('0x6d')]):_0x246f07[_0x37e82c][_0x1746('0x6d')];}}var _0x44a213=[],_0x3de2e8={};for(var _0x40dddd=0x0,_0x4956bf=_0x111a26['length'];_0x40dddd<_0x4956bf;_0x40dddd++){_0x3de2e8={'ProjectId':_0x5c5828['params']['id'],'SessionId':_0x111a26[_0x40dddd]['id'],'StartTime':moment(_0x111a26[_0x40dddd]['starttime'])[_0x1746('0x6e')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x37820f=0x0,_0x21e042=_0x246f07['length'];_0x37820f<_0x21e042;_0x37820f++){if(_0x246f07[_0x37820f]['SessionId']==_0x111a26[_0x40dddd]['id']&&_0x591bae[_0x1746('0x3c')](_0x246f07[_0x37820f][_0x1746('0x6c')])){_0x3de2e8[_0x591bae[_0x246f07[_0x37820f][_0x1746('0x6c')]]]=_0x246f07[_0x37820f][_0x1746('0x6f')];}}for(var _0x3ef419 in _0x591bae){if(!_0x3de2e8[_0x1746('0x3c')](_0x591bae[_0x3ef419])){_0x3de2e8[_0x591bae[_0x3ef419]]=null;}}_0x44a213[_0x1746('0x70')](_0x3de2e8);}return _0x44a213;}})[_0x1746('0x29')](function(_0x17e73b){if(!_[_0x1746('0x71')](_0x17e73b)){var _0x47b794=toCsv(_0x17e73b);var _0x24ca28=Date[_0x1746('0x72')]();fs[_0x1746('0x73')](util[_0x1746('0x6e')](_0x1746('0x74'),_0x5c5828['params']['id'],_0x24ca28),_0x47b794);_0x56058b[_0x1746('0x75')](_0x1746('0x76'),_0x1746('0x77')+util[_0x1746('0x6e')](_0x1746('0x78'),_0x5c5828[_0x1746('0x57')]['id'],_0x24ca28));_0x56058b[_0x1746('0x75')](_0x1746('0x79'),_0x1746('0x7a'));return _0x56058b[_0x1746('0x7b')](util['format'](_0x1746('0x74'),_0x5c5828[_0x1746('0x57')]['id'],_0x24ca28));}else{return _0x56058b['sendStatus'](0xcc);}})[_0x1746('0x4a')](handleError(_0x56058b,null));}; \ No newline at end of file +var _0xa30e=['updatedAt','omit','user','UserProfileResource','getSessions','findOne','JscriptySessionReport','pick','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','question','format','SessionId','questionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Projects','error','stack','name','index','map','JscriptyProject','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','include','findAll','rows','catch','show','rawAttributes','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt'];(function(_0x46a642,_0x49545e){var _0xb8ec98=function(_0x4364a5){while(--_0x4364a5){_0x46a642['push'](_0x46a642['shift']());}};_0xb8ec98(++_0x49545e);}(_0xa30e,0x117));var _0xea30=function(_0x54eab6,_0x5e262f){_0x54eab6=_0x54eab6-0x0;var _0x1e7435=_0xa30e[_0x54eab6];return _0x1e7435;};'use strict';var emlformat=require(_0xea30('0x0'));var rimraf=require(_0xea30('0x1'));var zipdir=require(_0xea30('0x2'));var jsonpatch=require(_0xea30('0x3'));var rp=require(_0xea30('0x4'));var moment=require(_0xea30('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xea30('0x6'));var sox=require(_0xea30('0x7'));var csv=require(_0xea30('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea30('0x9'));var _=require(_0xea30('0xa'));var squel=require(_0xea30('0xb'));var crypto=require(_0xea30('0xc'));var jsforce=require(_0xea30('0xd'));var deskjs=require(_0xea30('0xe'));var toCsv=require(_0xea30('0x8'));var querystring=require(_0xea30('0xf'));var Papa=require(_0xea30('0x10'));var Redis=require(_0xea30('0x11'));var authService=require(_0xea30('0x12'));var qs=require(_0xea30('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xea30('0x14'))(_0xea30('0x15'));var utils=require(_0xea30('0x16'));var config=require(_0xea30('0x17'));var licenseUtil=require(_0xea30('0x18'));var db=require(_0xea30('0x19'))['db'];function respondWithStatusCode(_0x13fb06,_0x26fe96){_0x26fe96=_0x26fe96||0xcc;return function(_0x348aad){if(_0x348aad){return _0x13fb06[_0xea30('0x1a')](_0x26fe96);}return _0x13fb06[_0xea30('0x1b')](_0x26fe96)[_0xea30('0x1c')]();};}function respondWithResult(_0x3a15fc,_0x597009){_0x597009=_0x597009||0xc8;return function(_0x2b0add){if(_0x2b0add){return _0x3a15fc[_0xea30('0x1b')](_0x597009)[_0xea30('0x1d')](_0x2b0add);}};}function respondWithFilteredResult(_0x54235a,_0x27e663){return function(_0x4151a6){if(_0x4151a6){var _0x1e2c8f=typeof _0x27e663[_0xea30('0x1e')]===_0xea30('0x1f')&&typeof _0x27e663[_0xea30('0x20')]===_0xea30('0x1f');var _0x598d66=_0x4151a6[_0xea30('0x21')];var _0x2e7504=_0x1e2c8f?0x0:_0x27e663[_0xea30('0x1e')];var _0x225bb7=_0x1e2c8f?_0x4151a6[_0xea30('0x21')]:_0x27e663[_0xea30('0x1e')]+_0x27e663['limit'];var _0x25eaad;if(_0x225bb7>=_0x598d66){_0x225bb7=_0x598d66;_0x25eaad=0xc8;}else{_0x25eaad=0xce;}_0x54235a[_0xea30('0x1b')](_0x25eaad);return _0x54235a[_0xea30('0x22')](_0xea30('0x23'),_0x2e7504+'-'+_0x225bb7+'/'+_0x598d66)[_0xea30('0x1d')](_0x4151a6);}return null;};}function patchUpdates(_0x2c3cc0){return function(_0x21dd56){try{jsonpatch[_0xea30('0x24')](_0x21dd56,_0x2c3cc0,!![]);}catch(_0x5b4fd7){return BPromise[_0xea30('0x25')](_0x5b4fd7);}return _0x21dd56['save']();};}function saveUpdates(_0x54d817,_0x50951f){return function(_0x2f95e8){if(_0x2f95e8){return _0x2f95e8[_0xea30('0x26')](_0x54d817)[_0xea30('0x27')](function(_0x4345e0){return _0x4345e0;});}return null;};}function removeEntity(_0x23fc0f,_0x527a28){return function(_0x74ceb1){if(_0x74ceb1){return _0x74ceb1[_0xea30('0x28')]()[_0xea30('0x27')](function(){var _0x2b7805=_0x74ceb1[_0xea30('0x29')]({'plain':!![]});var _0x4092a8=_0xea30('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x4092a8,'resourceId':_0x2b7805['id']}})[_0xea30('0x27')](function(){return _0x74ceb1;});})[_0xea30('0x27')](function(){_0x23fc0f[_0xea30('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x203554,_0x3c70dd){return function(_0x2b5b4c){if(!_0x2b5b4c){_0x203554[_0xea30('0x1a')](0x194);}return _0x2b5b4c;};}function handleError(_0x4a256e,_0x593e71){_0x593e71=_0x593e71||0x1f4;return function(_0x32d2f3){logger[_0xea30('0x2b')](_0x32d2f3[_0xea30('0x2c')]);if(_0x32d2f3[_0xea30('0x2d')]){delete _0x32d2f3[_0xea30('0x2d')];}_0x4a256e[_0xea30('0x1b')](_0x593e71)['send'](_0x32d2f3);};}exports[_0xea30('0x2e')]=function(_0xdcf47e,_0x35292c){var _0x2e957a={},_0x43de29={},_0x143f53={'count':0x0,'rows':[]};var _0x2b3396=_[_0xea30('0x2f')](db[_0xea30('0x30')]['rawAttributes'],function(_0x594168){return{'name':_0x594168[_0xea30('0x31')],'type':_0x594168[_0xea30('0x32')]['key']};});_0x43de29['model']=_[_0xea30('0x2f')](_0x2b3396,_0xea30('0x2d'));_0x43de29[_0xea30('0x33')]=_[_0xea30('0x34')](_0xdcf47e[_0xea30('0x33')]);_0x43de29['filters']=_[_0xea30('0x35')](_0x43de29[_0xea30('0x36')],_0x43de29[_0xea30('0x33')]);_0x2e957a[_0xea30('0x37')]=_[_0xea30('0x35')](_0x43de29['model'],qs['fields'](_0xdcf47e[_0xea30('0x33')][_0xea30('0x38')]));_0x2e957a[_0xea30('0x37')]=_0x2e957a[_0xea30('0x37')][_0xea30('0x39')]?_0x2e957a[_0xea30('0x37')]:_0x43de29[_0xea30('0x36')];if(!_0xdcf47e[_0xea30('0x33')][_0xea30('0x3a')](_0xea30('0x3b'))){_0x2e957a[_0xea30('0x20')]=qs[_0xea30('0x20')](_0xdcf47e['query'][_0xea30('0x20')]);_0x2e957a[_0xea30('0x1e')]=qs[_0xea30('0x1e')](_0xdcf47e['query']['offset']);}_0x2e957a[_0xea30('0x3c')]=qs[_0xea30('0x3d')](_0xdcf47e[_0xea30('0x33')][_0xea30('0x3d')]);_0x2e957a[_0xea30('0x3e')]=qs[_0xea30('0x3f')](_['pick'](_0xdcf47e['query'],_0x43de29[_0xea30('0x3f')]),_0x2b3396);if(_0xdcf47e[_0xea30('0x33')]['filter']){_0x2e957a[_0xea30('0x3e')]=_[_0xea30('0x40')](_0x2e957a[_0xea30('0x3e')],{'$or':_['map'](_0x2b3396,function(_0x2e4802){if(_0x2e4802[_0xea30('0x32')]!==_0xea30('0x41')){var _0x1dbd4e={};_0x1dbd4e[_0x2e4802[_0xea30('0x2d')]]={'$like':'%'+_0xdcf47e[_0xea30('0x33')][_0xea30('0x42')]+'%'};return _0x1dbd4e;}})});}_0x2e957a=_[_0xea30('0x40')]({},_0x2e957a,_0xdcf47e['options']);var _0x37a2de={'where':_0x2e957a[_0xea30('0x3e')]};return db[_0xea30('0x30')][_0xea30('0x21')](_0x37a2de)['then'](function(_0x4e2f17){_0x143f53[_0xea30('0x21')]=_0x4e2f17;if(_0xdcf47e[_0xea30('0x33')]['includeAll']){_0x2e957a[_0xea30('0x43')]=[{'all':!![]}];}return db[_0xea30('0x30')][_0xea30('0x44')](_0x2e957a);})[_0xea30('0x27')](function(_0x14a530){_0x143f53[_0xea30('0x45')]=_0x14a530;return _0x143f53;})[_0xea30('0x27')](respondWithFilteredResult(_0x35292c,_0x2e957a))[_0xea30('0x46')](handleError(_0x35292c,null));};exports[_0xea30('0x47')]=function(_0x4ecdef,_0x52e533){var _0x331ccb={'raw':![],'where':{'id':_0x4ecdef['params']['id']}},_0x3e058c={};_0x3e058c[_0xea30('0x36')]=_[_0xea30('0x34')](db[_0xea30('0x30')][_0xea30('0x48')]);_0x3e058c[_0xea30('0x33')]=_[_0xea30('0x34')](_0x4ecdef[_0xea30('0x33')]);_0x3e058c[_0xea30('0x3f')]=_[_0xea30('0x35')](_0x3e058c[_0xea30('0x36')],_0x3e058c[_0xea30('0x33')]);_0x331ccb[_0xea30('0x37')]=_[_0xea30('0x35')](_0x3e058c[_0xea30('0x36')],qs['fields'](_0x4ecdef[_0xea30('0x33')]['fields']));_0x331ccb['attributes']=_0x331ccb[_0xea30('0x37')]['length']?_0x331ccb['attributes']:_0x3e058c[_0xea30('0x36')];if(_0x4ecdef['query'][_0xea30('0x49')]){_0x331ccb[_0xea30('0x43')]=[{'all':!![]}];}_0x331ccb=_[_0xea30('0x40')]({},_0x331ccb,_0x4ecdef[_0xea30('0x4a')]);return db['JscriptyProject'][_0xea30('0x4b')](_0x331ccb)[_0xea30('0x27')](handleEntityNotFound(_0x52e533,null))[_0xea30('0x27')](respondWithResult(_0x52e533,null))[_0xea30('0x46')](handleError(_0x52e533,null));};exports[_0xea30('0x4c')]=function(_0x1c5daf,_0x3bdc06){return db[_0xea30('0x30')][_0xea30('0x4c')](_0x1c5daf[_0xea30('0x4d')],{})[_0xea30('0x27')](function(_0x3757e3){var _0x5266de=_0x1c5daf['user'][_0xea30('0x29')]({'plain':!![]});if(!_0x5266de)throw new Error(_0xea30('0x4e'));if(_0x5266de[_0xea30('0x4f')]==='user'){var _0x1f1e57=_0x3757e3[_0xea30('0x29')]({'plain':!![]});var _0x28b582=_0xea30('0x2a');return db[_0xea30('0x50')][_0xea30('0x4b')]({'where':{'name':_0x28b582,'userProfileId':_0x5266de[_0xea30('0x51')]},'raw':!![]})[_0xea30('0x27')](function(_0x2a9868){if(_0x2a9868&&_0x2a9868[_0xea30('0x52')]===0x0){return db['UserProfileResource'][_0xea30('0x4c')]({'name':_0x1f1e57['name'],'resourceId':_0x1f1e57['id'],'type':_0x2a9868[_0xea30('0x2d')],'sectionId':_0x2a9868['id']},{})[_0xea30('0x27')](function(){return _0x3757e3;});}else{return _0x3757e3;}})['catch'](function(_0x20dce6){logger[_0xea30('0x2b')](_0xea30('0x53'),_0x20dce6);throw _0x20dce6;});}return _0x3757e3;})['then'](respondWithResult(_0x3bdc06,0xc9))[_0xea30('0x46')](handleError(_0x3bdc06,null));};exports[_0xea30('0x54')]=function(_0x5183e5,_0x2ad5b8){var _0x2a4bfb={'where':{'id':_0x5183e5[_0xea30('0x55')]['id']}},_0x35300b={};_0x35300b['model']=_[_0xea30('0x34')](db[_0xea30('0x30')]['rawAttributes']);_0x2a4bfb['attributes']=_['intersection'](_0x35300b[_0xea30('0x36')],qs[_0xea30('0x38')](_0x5183e5['query'][_0xea30('0x38')]));_0x2a4bfb[_0xea30('0x37')]=_0x2a4bfb[_0xea30('0x37')]['length']?_0x2a4bfb[_0xea30('0x37')]:_0x35300b[_0xea30('0x36')];if(_0x5183e5[_0xea30('0x33')][_0xea30('0x49')]){_0x2a4bfb['include']=[{'all':!![]}];}_0x2a4bfb=_['merge']({},_0x2a4bfb,_0x5183e5[_0xea30('0x4a')]);return db['JscriptyProject'][_0xea30('0x4b')](_0x2a4bfb)[_0xea30('0x27')](handleEntityNotFound(_0x2ad5b8,null))['then'](function(_0x9fdc7e){if(_0x9fdc7e){var _0x32e5bb=_0x9fdc7e[_0xea30('0x29')]({'plain':!![]});_0x32e5bb=qs['omit'](_0x32e5bb,['id',_0xea30('0x56'),_0xea30('0x57')]);_0x5183e5[_0xea30('0x4d')]=_[_0xea30('0x58')](_0x5183e5[_0xea30('0x4d')],['id','createdAt',_0xea30('0x57')]);return db['JscriptyProject'][_0xea30('0x4c')](_[_0xea30('0x40')](_0x32e5bb,_0x5183e5['body']),{'include':_0x5183e5[_0xea30('0x33')][_0xea30('0x49')]?[{'all':!![]}]:undefined})[_0xea30('0x27')](function(_0x4ea130){var _0x474180=_0x5183e5[_0xea30('0x59')][_0xea30('0x29')]({'plain':!![]});if(!_0x474180)throw new Error(_0xea30('0x4e'));if(_0x474180[_0xea30('0x4f')]==='user'){var _0xfedf04=_0x4ea130[_0xea30('0x29')]({'plain':!![]});var _0xe72409=_0xea30('0x2a');return db[_0xea30('0x50')][_0xea30('0x4b')]({'where':{'name':_0xe72409,'userProfileId':_0x474180[_0xea30('0x51')]},'raw':!![]})[_0xea30('0x27')](function(_0x24e6ec){if(_0x24e6ec&&_0x24e6ec[_0xea30('0x52')]===0x0){return db[_0xea30('0x5a')][_0xea30('0x4c')]({'name':_0xfedf04[_0xea30('0x2d')],'resourceId':_0xfedf04['id'],'type':_0x24e6ec['name'],'sectionId':_0x24e6ec['id']},{})[_0xea30('0x27')](function(){return _0x4ea130;});}else{return _0x4ea130;}})[_0xea30('0x46')](function(_0x1e3e0b){logger[_0xea30('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e3e0b);throw _0x1e3e0b;});}return _0x4ea130;});}})[_0xea30('0x27')](respondWithResult(_0x2ad5b8,0xc9))['catch'](handleError(_0x2ad5b8,null));};exports[_0xea30('0x26')]=function(_0x41cc6c,_0x1fa9f3){if(_0x41cc6c[_0xea30('0x4d')]['id']){delete _0x41cc6c['body']['id'];}return db[_0xea30('0x30')][_0xea30('0x4b')]({'where':{'id':_0x41cc6c[_0xea30('0x55')]['id']}})['then'](handleEntityNotFound(_0x1fa9f3,null))['then'](saveUpdates(_0x41cc6c[_0xea30('0x4d')],null))['then'](respondWithResult(_0x1fa9f3,null))[_0xea30('0x46')](handleError(_0x1fa9f3,null));};exports[_0xea30('0x28')]=function(_0xfc3c94,_0x43d622){return db[_0xea30('0x30')]['find']({'where':{'id':_0xfc3c94[_0xea30('0x55')]['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x43d622,null))[_0xea30('0x27')](removeEntity(_0x43d622,null))[_0xea30('0x46')](handleError(_0x43d622,null));};exports[_0xea30('0x5b')]=function(_0x4a35b9,_0x52df2c,_0x29ceb8){var _0x573c30={'raw':!![],'where':{}};var _0x49ce5a={};var _0x3ce8ac={'count':0x0,'rows':[]};return db[_0xea30('0x30')][_0xea30('0x5c')]({'where':{'id':_0x4a35b9[_0xea30('0x55')]['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x52df2c,null))['then'](function(_0x40e1c7){if(_0x40e1c7){_0x49ce5a['model']=_[_0xea30('0x34')](db[_0xea30('0x5d')][_0xea30('0x48')]);_0x49ce5a[_0xea30('0x33')]=_[_0xea30('0x34')](_0x4a35b9[_0xea30('0x33')]);_0x49ce5a[_0xea30('0x3f')]=_[_0xea30('0x35')](_0x49ce5a[_0xea30('0x36')],_0x49ce5a['query']);_0x573c30[_0xea30('0x37')]=_[_0xea30('0x35')](_0x49ce5a[_0xea30('0x36')],qs['fields'](_0x4a35b9['query'][_0xea30('0x38')]));_0x573c30[_0xea30('0x37')]=_0x573c30['attributes']['length']?_0x573c30[_0xea30('0x37')]:_0x49ce5a[_0xea30('0x36')];if(!_0x4a35b9[_0xea30('0x33')]['hasOwnProperty']('nolimit')){_0x573c30[_0xea30('0x20')]=qs[_0xea30('0x20')](_0x4a35b9[_0xea30('0x33')]['limit']);_0x573c30['offset']=qs[_0xea30('0x1e')](_0x4a35b9['query'][_0xea30('0x1e')]);}_0x573c30['order']=qs[_0xea30('0x3d')](_0x4a35b9[_0xea30('0x33')][_0xea30('0x3d')]);_0x573c30[_0xea30('0x3e')]=qs[_0xea30('0x3f')](_[_0xea30('0x5e')](_0x4a35b9[_0xea30('0x33')],_0x49ce5a['filters']));_0x573c30[_0xea30('0x3e')][_0xea30('0x5f')]=_0x40e1c7['id'];if(_0x4a35b9['query'][_0xea30('0x42')]){_0x573c30[_0xea30('0x3e')]=_[_0xea30('0x40')](_0x573c30[_0xea30('0x3e')],{'$or':_[_0xea30('0x2f')](_0x573c30[_0xea30('0x37')],function(_0x1d5b86){var _0x5ba113={};_0x5ba113[_0x1d5b86]={'$like':'%'+_0x4a35b9[_0xea30('0x33')][_0xea30('0x42')]+'%'};return _0x5ba113;})});}_0x573c30=_[_0xea30('0x40')]({},_0x573c30,_0x4a35b9[_0xea30('0x4a')]);return db[_0xea30('0x5d')][_0xea30('0x21')]({'where':_0x573c30[_0xea30('0x3e')]})[_0xea30('0x27')](function(_0x39bdaf){_0x3ce8ac[_0xea30('0x21')]=_0x39bdaf;if(_0x4a35b9['query']['includeAll']){_0x573c30['include']=[{'all':!![]}];}return db[_0xea30('0x5d')]['findAll'](_0x573c30);})['then'](function(_0x11ce38){_0x3ce8ac[_0xea30('0x45')]=_0x11ce38;return _0x3ce8ac;});}})[_0xea30('0x27')](respondWithFilteredResult(_0x52df2c,_0x573c30))['catch'](handleError(_0x52df2c,null));};exports[_0xea30('0x60')]=function(_0x165f33,_0x48b03f,_0x392549){var _0x285d43={'raw':!![],'where':{}};var _0x54542a={};var _0x462b3f={'count':0x0,'rows':[]};return db[_0xea30('0x30')][_0xea30('0x5c')]({'where':{'id':_0x165f33[_0xea30('0x55')]['id']}})['then'](handleEntityNotFound(_0x48b03f,null))['then'](function(_0x186ed0){if(_0x186ed0){_0x54542a['model']=_[_0xea30('0x34')](db['JscriptyAnswerReport'][_0xea30('0x48')]);_0x54542a[_0xea30('0x33')]=_[_0xea30('0x34')](_0x165f33[_0xea30('0x33')]);_0x54542a['filters']=_['intersection'](_0x54542a[_0xea30('0x36')],_0x54542a[_0xea30('0x33')]);_0x285d43[_0xea30('0x37')]=_[_0xea30('0x35')](_0x54542a['model'],qs[_0xea30('0x38')](_0x165f33[_0xea30('0x33')][_0xea30('0x38')]));_0x285d43[_0xea30('0x37')]=_0x285d43[_0xea30('0x37')][_0xea30('0x39')]?_0x285d43[_0xea30('0x37')]:_0x54542a[_0xea30('0x36')];if(!_0x165f33[_0xea30('0x33')]['hasOwnProperty'](_0xea30('0x3b'))){_0x285d43[_0xea30('0x20')]=qs['limit'](_0x165f33['query'][_0xea30('0x20')]);_0x285d43[_0xea30('0x1e')]=qs[_0xea30('0x1e')](_0x165f33[_0xea30('0x33')][_0xea30('0x1e')]);}_0x285d43[_0xea30('0x3c')]=qs['sort'](_0x165f33[_0xea30('0x33')][_0xea30('0x3d')]);_0x285d43[_0xea30('0x3e')]=qs[_0xea30('0x3f')](_[_0xea30('0x5e')](_0x165f33[_0xea30('0x33')],_0x54542a[_0xea30('0x3f')]));_0x285d43[_0xea30('0x3e')][_0xea30('0x5f')]=_0x186ed0['id'];if(_0x165f33[_0xea30('0x33')][_0xea30('0x42')]){_0x285d43[_0xea30('0x3e')]=_[_0xea30('0x40')](_0x285d43[_0xea30('0x3e')],{'$or':_[_0xea30('0x2f')](_0x285d43[_0xea30('0x37')],function(_0x5a2b9c){var _0x5cb674={};_0x5cb674[_0x5a2b9c]={'$like':'%'+_0x165f33['query'][_0xea30('0x42')]+'%'};return _0x5cb674;})});}_0x285d43=_['merge']({},_0x285d43,_0x165f33[_0xea30('0x4a')]);return db[_0xea30('0x61')][_0xea30('0x21')]({'where':_0x285d43[_0xea30('0x3e')]})['then'](function(_0x2bd215){_0x462b3f[_0xea30('0x21')]=_0x2bd215;if(_0x165f33[_0xea30('0x33')][_0xea30('0x49')]){_0x285d43[_0xea30('0x43')]=[{'all':!![]}];}return db[_0xea30('0x61')][_0xea30('0x44')](_0x285d43);})[_0xea30('0x27')](function(_0x45c21a){_0x462b3f[_0xea30('0x45')]=_0x45c21a;return _0x462b3f;});}})[_0xea30('0x27')](respondWithFilteredResult(_0x48b03f,_0x285d43))[_0xea30('0x46')](handleError(_0x48b03f,null));};function char(_0x4f0b1f){return _0xea30('0x62')===typeof _0x4f0b1f?String[_0xea30('0x63')][_0xea30('0x24')](null,arguments):_0x4f0b1f;}function needsEncapsulation(_0x546310){return!!_0x546310&&(_0x546310[_0xea30('0x64')]()[_0xea30('0x65')](char(0xd))>=0x0||_0x546310[_0xea30('0x64')]()[_0xea30('0x65')](char(0xa))>=0x0||_0x546310[_0xea30('0x64')]()[_0xea30('0x65')](char(0x2c))>=0x0||_0x546310['toString']()[_0xea30('0x65')](char(0x22))>=0x0);}function encapsulate(_0x5af9f5){var _0xd22563=char(0x22),_0x1cb3df='\x5c'+char(0x22),_0xc1fdbf=_0x5af9f5['toString']()[_0xea30('0x66')](new RegExp(_0xd22563,'g'),_0x1cb3df);return _0xd22563+_0xc1fdbf+_0xd22563;}exports['getSummary']=function(_0x3825cd,_0x477cde,_0x1e0c72){var _0x33cd1e,_0x7e5849;var _0x15966a={'where':{'ProjectId':_0x3825cd['params']['id']}};if(_0x3825cd['query']['startTime']){_0x15966a[_0xea30('0x3e')][_0xea30('0x67')]=JSON[_0xea30('0x68')](_0x3825cd['query'][_0xea30('0x69')]);}return db[_0xea30('0x5d')][_0xea30('0x44')](_0x15966a)[_0xea30('0x27')](handleEntityNotFound(_0x477cde,null))['then'](function(_0x33c465){if(_0x33c465){_0x33cd1e=_0x33c465;return db[_0xea30('0x6a')]['findAll']({'where':{'SessionId':{'$in':_[_0xea30('0x2f')](_0x33cd1e,'id')},'ProjectId':_0x3825cd[_0xea30('0x55')]['id']},'order':_0xea30('0x6b')});}})['then'](handleEntityNotFound(_0x477cde,null))[_0xea30('0x27')](function(_0x349899){if(_0x349899){_0x7e5849=_0x349899;var _0x4046ee={};for(var _0x51aa75=0x0,_0x1c75d1=_0x7e5849[_0xea30('0x39')];_0x51aa75<_0x1c75d1;_0x51aa75++){if(!_0x4046ee[_0xea30('0x3a')](_0x7e5849[_0x51aa75]['questionId'])){_0x4046ee[_0x7e5849[_0x51aa75]['questionId']]=needsEncapsulation(_0x7e5849[_0x51aa75][_0xea30('0x6c')])?encapsulate(_0x7e5849[_0x51aa75]['question']):_0x7e5849[_0x51aa75]['question'];}}var _0x3be27a=[],_0x48363b={};for(var _0x5045a7=0x0,_0xba517f=_0x33cd1e[_0xea30('0x39')];_0x5045a7<_0xba517f;_0x5045a7++){_0x48363b={'ProjectId':_0x3825cd[_0xea30('0x55')]['id'],'SessionId':_0x33cd1e[_0x5045a7]['id'],'StartTime':moment(_0x33cd1e[_0x5045a7][_0xea30('0x67')])[_0xea30('0x6d')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x2e768c=0x0,_0x3d9d5b=_0x7e5849[_0xea30('0x39')];_0x2e768c<_0x3d9d5b;_0x2e768c++){if(_0x7e5849[_0x2e768c][_0xea30('0x6e')]==_0x33cd1e[_0x5045a7]['id']&&_0x4046ee['hasOwnProperty'](_0x7e5849[_0x2e768c][_0xea30('0x6f')])){_0x48363b[_0x4046ee[_0x7e5849[_0x2e768c]['questionId']]]=_0x7e5849[_0x2e768c][_0xea30('0x70')];}}for(var _0x23a939 in _0x4046ee){if(!_0x48363b['hasOwnProperty'](_0x4046ee[_0x23a939])){_0x48363b[_0x4046ee[_0x23a939]]=null;}}_0x3be27a[_0xea30('0x71')](_0x48363b);}return _0x3be27a;}})[_0xea30('0x27')](function(_0x4e1d48){if(!_[_0xea30('0x72')](_0x4e1d48)){var _0x1b08a6=toCsv(_0x4e1d48);var _0x5a6d62=Date[_0xea30('0x73')]();fs[_0xea30('0x74')](util[_0xea30('0x6d')](_0xea30('0x75'),_0x3825cd[_0xea30('0x55')]['id'],_0x5a6d62),_0x1b08a6);_0x477cde[_0xea30('0x76')](_0xea30('0x77'),_0xea30('0x78')+util[_0xea30('0x6d')](_0xea30('0x79'),_0x3825cd['params']['id'],_0x5a6d62));_0x477cde['setHeader']('Content-type','text/csv');return _0x477cde['download'](util[_0xea30('0x6d')](_0xea30('0x75'),_0x3825cd['params']['id'],_0x5a6d62));}else{return _0x477cde[_0xea30('0x1a')](0xcc);}})[_0xea30('0x46')](handleError(_0x477cde,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 92fa5e3..430aef0 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 _0x1a28=['bluebird','rimraf','../../config/environment','./jscriptyProject.attributes','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment'];(function(_0x2f4113,_0x425631){var _0x31b67a=function(_0x39fc88){while(--_0x39fc88){_0x2f4113['push'](_0x2f4113['shift']());}};_0x31b67a(++_0x425631);}(_0x1a28,0x10e));var _0x81a2=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x1a28[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0x81a2('0x0'));var util=require(_0x81a2('0x1'));var logger=require(_0x81a2('0x2'))(_0x81a2('0x3'));var moment=require(_0x81a2('0x4'));var BPromise=require(_0x81a2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x81a2('0x6'));var config=require(_0x81a2('0x7'));var attributes=require(_0x81a2('0x8'));module['exports']=function(_0x4188d7,_0x20dcd4){return _0x4188d7['define'](_0x81a2('0x9'),attributes,{'tableName':_0x81a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5900=['jscripty_projects','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','JscriptyProject'];(function(_0x54aaf5,_0x4bd0ea){var _0x37aa7b=function(_0x331579){while(--_0x331579){_0x54aaf5['push'](_0x54aaf5['shift']());}};_0x37aa7b(++_0x4bd0ea);}(_0x5900,0xd2));var _0x0590=function(_0x1ba88a,_0x30b1d8){_0x1ba88a=_0x1ba88a-0x0;var _0x5d0fe7=_0x5900[_0x1ba88a];return _0x5d0fe7;};'use strict';var _=require('lodash');var util=require(_0x0590('0x0'));var logger=require(_0x0590('0x1'))('api');var moment=require(_0x0590('0x2'));var BPromise=require(_0x0590('0x3'));var rp=require(_0x0590('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0590('0x5'));var config=require(_0x0590('0x6'));var attributes=require('./jscriptyProject.attributes');module[_0x0590('0x7')]=function(_0x1d9927,_0x494b17){return _0x1d9927[_0x0590('0x8')](_0x0590('0x9'),attributes,{'tableName':_0x0590('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 7d55e65..16db43f 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 _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x6d984f,_0x2d2870){var _0x1237ca=function(_0x4b42ed){while(--_0x4b42ed){_0x6d984f['push'](_0x6d984f['shift']());}};_0x1237ca(++_0x2d2870);}(_0x70e0,0x17b));var _0x070e=function(_0x27f54c,_0xb69caf){_0x27f54c=_0x27f54c-0x0;var _0x306bf9=_0x70e0[_0x27f54c];return _0x306bf9;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4bda2d,_0x47f9d4){var _0x358003=function(_0x5a4e04){while(--_0x5a4e04){_0x4bda2d['push'](_0x4bda2d['shift']());}};_0x358003(++_0x47f9d4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 38ab639..c1fbc6f 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 _0xe72f=['./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','create','put','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x182a8f,_0x36edb5){var _0x4f9ee7=function(_0x1168c1){while(--_0x1168c1){_0x182a8f['push'](_0x182a8f['shift']());}};_0x4f9ee7(++_0x36edb5);}(_0xe72f,0x115));var _0xfe72=function(_0x205f75,_0x5cf068){_0x205f75=_0x205f75-0x0;var _0x1fd0c3=_0xe72f[_0x205f75];return _0x1fd0c3;};'use strict';var multer=require('multer');var util=require(_0xfe72('0x0'));var path=require(_0xfe72('0x1'));var timeout=require(_0xfe72('0x2'));var express=require('express');var router=express[_0xfe72('0x3')]();var fs_extra=require(_0xfe72('0x4'));var auth=require(_0xfe72('0x5'));var interaction=require(_0xfe72('0x6'));var config=require(_0xfe72('0x7'));var controller=require(_0xfe72('0x8'));router[_0xfe72('0x9')]('/',auth[_0xfe72('0xa')](),controller[_0xfe72('0xb')]);router[_0xfe72('0x9')](_0xfe72('0xc'),auth[_0xfe72('0xa')](),controller[_0xfe72('0xd')]);router[_0xfe72('0x9')]('/:id',auth[_0xfe72('0xa')](),controller['show']);router['post']('/',auth[_0xfe72('0xa')](),controller[_0xfe72('0xe')]);router[_0xfe72('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xfe72('0x10')]);router[_0xfe72('0x11')]('/:id',auth[_0xfe72('0xa')](),controller[_0xfe72('0x12')]);module['exports']=router; \ No newline at end of file +var _0x1571=['create','put','/:id','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','post'];(function(_0x4c72d0,_0x3e6ac1){var _0x491aa1=function(_0x309f63){while(--_0x309f63){_0x4c72d0['push'](_0x4c72d0['shift']());}};_0x491aa1(++_0x3e6ac1);}(_0x1571,0x1a3));var _0x1157=function(_0x316b13,_0x21c7b3){_0x316b13=_0x316b13-0x0;var _0x29ab59=_0x1571[_0x316b13];return _0x29ab59;};'use strict';var multer=require(_0x1157('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1157('0x1'));var express=require(_0x1157('0x2'));var router=express[_0x1157('0x3')]();var fs_extra=require(_0x1157('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1157('0x5'));var config=require(_0x1157('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x1157('0x7')]('/',auth['isAuthenticated'](),controller[_0x1157('0x8')]);router[_0x1157('0x7')](_0x1157('0x9'),auth[_0x1157('0xa')](),controller[_0x1157('0xb')]);router[_0x1157('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1157('0xc')]('/',auth[_0x1157('0xa')](),controller[_0x1157('0xd')]);router[_0x1157('0xe')](_0x1157('0xf'),auth[_0x1157('0xa')](),controller[_0x1157('0x10')]);router['delete']('/:id',auth[_0x1157('0xa')](),controller[_0x1157('0x11')]);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 df24103..8f889a5 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(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x7a54,0x106));var _0x47a5=function(_0x206064,_0x1d4d51){_0x206064=_0x206064-0x0;var _0x15cc25=_0x7a54[_0x206064];return _0x15cc25;};'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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x5a8bd5,_0xa3d8d9){_0x5a8bd5=_0x5a8bd5-0x0;var _0x5bec7b=_0x7a54[_0x5a8bd5];return _0x5bec7b;};'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 a5f1bc4..a1489b7 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 _0xfa8c=['util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','map','JscriptyQuestionReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','includeAll','findAll','show','params','rawAttributes','include','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x191a03,_0x2b50cd){var _0x152a67=function(_0x40fffc){while(--_0x40fffc){_0x191a03['push'](_0x191a03['shift']());}};_0x152a67(++_0x2b50cd);}(_0xfa8c,0xdf));var _0xcfa8=function(_0x2c77da,_0x42386a){_0x2c77da=_0x2c77da-0x0;var _0x460f6e=_0xfa8c[_0x2c77da];return _0x460f6e;};'use strict';var emlformat=require(_0xcfa8('0x0'));var rimraf=require(_0xcfa8('0x1'));var zipdir=require(_0xcfa8('0x2'));var jsonpatch=require(_0xcfa8('0x3'));var rp=require(_0xcfa8('0x4'));var moment=require(_0xcfa8('0x5'));var BPromise=require(_0xcfa8('0x6'));var Mustache=require(_0xcfa8('0x7'));var util=require(_0xcfa8('0x8'));var path=require(_0xcfa8('0x9'));var sox=require(_0xcfa8('0xa'));var csv=require(_0xcfa8('0xb'));var ejs=require(_0xcfa8('0xc'));var fs=require('fs');var fs_extra=require(_0xcfa8('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcfa8('0xe'));var jsforce=require(_0xcfa8('0xf'));var deskjs=require(_0xcfa8('0x10'));var toCsv=require(_0xcfa8('0xb'));var querystring=require(_0xcfa8('0x11'));var Papa=require(_0xcfa8('0x12'));var Redis=require('ioredis');var authService=require(_0xcfa8('0x13'));var qs=require(_0xcfa8('0x14'));var as=require(_0xcfa8('0x15'));var hardwareService=require(_0xcfa8('0x16'));var logger=require('../../config/logger')(_0xcfa8('0x17'));var utils=require(_0xcfa8('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcfa8('0x19'))['db'];function respondWithStatusCode(_0x348ae3,_0x3aa3b1){_0x3aa3b1=_0x3aa3b1||0xcc;return function(_0x2bfbfd){if(_0x2bfbfd){return _0x348ae3[_0xcfa8('0x1a')](_0x3aa3b1);}return _0x348ae3[_0xcfa8('0x1b')](_0x3aa3b1)[_0xcfa8('0x1c')]();};}function respondWithResult(_0x2b34be,_0x4a3c2d){_0x4a3c2d=_0x4a3c2d||0xc8;return function(_0x52a690){if(_0x52a690){return _0x2b34be[_0xcfa8('0x1b')](_0x4a3c2d)[_0xcfa8('0x1d')](_0x52a690);}};}function respondWithFilteredResult(_0x55a2f5,_0x2fa1d7){return function(_0x1af24d){if(_0x1af24d){var _0x30ade1=typeof _0x2fa1d7[_0xcfa8('0x1e')]===_0xcfa8('0x1f')&&typeof _0x2fa1d7['limit']===_0xcfa8('0x1f');var _0x421059=_0x1af24d[_0xcfa8('0x20')];var _0x20dd20=_0x30ade1?0x0:_0x2fa1d7[_0xcfa8('0x1e')];var _0x5a2aee=_0x30ade1?_0x1af24d[_0xcfa8('0x20')]:_0x2fa1d7[_0xcfa8('0x1e')]+_0x2fa1d7['limit'];var _0x5c0fec;if(_0x5a2aee>=_0x421059){_0x5a2aee=_0x421059;_0x5c0fec=0xc8;}else{_0x5c0fec=0xce;}_0x55a2f5[_0xcfa8('0x1b')](_0x5c0fec);return _0x55a2f5[_0xcfa8('0x21')](_0xcfa8('0x22'),_0x20dd20+'-'+_0x5a2aee+'/'+_0x421059)['json'](_0x1af24d);}return null;};}function patchUpdates(_0x2f61f1){return function(_0x40e014){try{jsonpatch[_0xcfa8('0x23')](_0x40e014,_0x2f61f1,!![]);}catch(_0x653431){return BPromise[_0xcfa8('0x24')](_0x653431);}return _0x40e014[_0xcfa8('0x25')]();};}function saveUpdates(_0x49b228,_0xd9a99){return function(_0x1d2afb){if(_0x1d2afb){return _0x1d2afb[_0xcfa8('0x26')](_0x49b228)['then'](function(_0x614084){return _0x614084;});}return null;};}function removeEntity(_0x5a291d,_0x5c7e70){return function(_0x486e5c){if(_0x486e5c){return _0x486e5c[_0xcfa8('0x27')]()[_0xcfa8('0x28')](function(){_0x5a291d[_0xcfa8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ab9ee,_0x56cc97){return function(_0x43404f){if(!_0x43404f){_0x5ab9ee[_0xcfa8('0x1a')](0x194);}return _0x43404f;};}function handleError(_0x22951b,_0x46234e){_0x46234e=_0x46234e||0x1f4;return function(_0x3e1fc7){logger[_0xcfa8('0x29')](_0x3e1fc7['stack']);if(_0x3e1fc7[_0xcfa8('0x2a')]){delete _0x3e1fc7['name'];}_0x22951b[_0xcfa8('0x1b')](_0x46234e)['send'](_0x3e1fc7);};}exports[_0xcfa8('0x2b')]=function(_0x2b80a4,_0x4bc1c3){var _0x1759d5={},_0x4e6463={},_0xbf397={'count':0x0,'rows':[]};var _0x1ad002=_[_0xcfa8('0x2c')](db[_0xcfa8('0x2d')]['rawAttributes'],function(_0x38dc10){return{'name':_0x38dc10[_0xcfa8('0x2e')],'type':_0x38dc10[_0xcfa8('0x2f')][_0xcfa8('0x30')]};});_0x4e6463['model']=_[_0xcfa8('0x2c')](_0x1ad002,_0xcfa8('0x2a'));_0x4e6463[_0xcfa8('0x31')]=_[_0xcfa8('0x32')](_0x2b80a4[_0xcfa8('0x31')]);_0x4e6463[_0xcfa8('0x33')]=_[_0xcfa8('0x34')](_0x4e6463[_0xcfa8('0x35')],_0x4e6463[_0xcfa8('0x31')]);_0x1759d5[_0xcfa8('0x36')]=_[_0xcfa8('0x34')](_0x4e6463['model'],qs[_0xcfa8('0x37')](_0x2b80a4[_0xcfa8('0x31')][_0xcfa8('0x37')]));_0x1759d5['attributes']=_0x1759d5[_0xcfa8('0x36')][_0xcfa8('0x38')]?_0x1759d5[_0xcfa8('0x36')]:_0x4e6463[_0xcfa8('0x35')];if(!_0x2b80a4[_0xcfa8('0x31')][_0xcfa8('0x39')]('nolimit')){_0x1759d5[_0xcfa8('0x3a')]=qs[_0xcfa8('0x3a')](_0x2b80a4['query'][_0xcfa8('0x3a')]);_0x1759d5[_0xcfa8('0x1e')]=qs['offset'](_0x2b80a4[_0xcfa8('0x31')][_0xcfa8('0x1e')]);}_0x1759d5[_0xcfa8('0x3b')]=qs['sort'](_0x2b80a4[_0xcfa8('0x31')][_0xcfa8('0x3c')]);_0x1759d5[_0xcfa8('0x3d')]=qs[_0xcfa8('0x33')](_[_0xcfa8('0x3e')](_0x2b80a4['query'],_0x4e6463[_0xcfa8('0x33')]),_0x1ad002);if(_0x2b80a4['query'][_0xcfa8('0x3f')]){_0x1759d5[_0xcfa8('0x3d')]=_['merge'](_0x1759d5[_0xcfa8('0x3d')],{'$or':_[_0xcfa8('0x2c')](_0x1ad002,function(_0x20d58e){if(_0x20d58e[_0xcfa8('0x2f')]!=='VIRTUAL'){var _0x8623c0={};_0x8623c0[_0x20d58e[_0xcfa8('0x2a')]]={'$like':'%'+_0x2b80a4[_0xcfa8('0x31')][_0xcfa8('0x3f')]+'%'};return _0x8623c0;}})});}_0x1759d5=_[_0xcfa8('0x40')]({},_0x1759d5,_0x2b80a4['options']);var _0x3360c7={'where':_0x1759d5[_0xcfa8('0x3d')]};return db[_0xcfa8('0x2d')]['count'](_0x3360c7)[_0xcfa8('0x28')](function(_0x1b948b){_0xbf397['count']=_0x1b948b;if(_0x2b80a4[_0xcfa8('0x31')][_0xcfa8('0x41')]){_0x1759d5['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xcfa8('0x42')](_0x1759d5);})[_0xcfa8('0x28')](function(_0x416fdb){_0xbf397['rows']=_0x416fdb;return _0xbf397;})[_0xcfa8('0x28')](respondWithFilteredResult(_0x4bc1c3,_0x1759d5))['catch'](handleError(_0x4bc1c3,null));};exports[_0xcfa8('0x43')]=function(_0x1dc816,_0x445ad1){var _0x2344d9={'raw':!![],'where':{'id':_0x1dc816[_0xcfa8('0x44')]['id']}},_0x2b2954={};_0x2b2954[_0xcfa8('0x35')]=_[_0xcfa8('0x32')](db[_0xcfa8('0x2d')][_0xcfa8('0x45')]);_0x2b2954[_0xcfa8('0x31')]=_[_0xcfa8('0x32')](_0x1dc816[_0xcfa8('0x31')]);_0x2b2954['filters']=_[_0xcfa8('0x34')](_0x2b2954[_0xcfa8('0x35')],_0x2b2954[_0xcfa8('0x31')]);_0x2344d9['attributes']=_[_0xcfa8('0x34')](_0x2b2954[_0xcfa8('0x35')],qs['fields'](_0x1dc816[_0xcfa8('0x31')][_0xcfa8('0x37')]));_0x2344d9[_0xcfa8('0x36')]=_0x2344d9[_0xcfa8('0x36')][_0xcfa8('0x38')]?_0x2344d9[_0xcfa8('0x36')]:_0x2b2954['model'];if(_0x1dc816['query'][_0xcfa8('0x41')]){_0x2344d9[_0xcfa8('0x46')]=[{'all':!![]}];}_0x2344d9=_['merge']({},_0x2344d9,_0x1dc816[_0xcfa8('0x47')]);return db['JscriptyQuestionReport'][_0xcfa8('0x48')](_0x2344d9)[_0xcfa8('0x28')](handleEntityNotFound(_0x445ad1,null))[_0xcfa8('0x28')](respondWithResult(_0x445ad1,null))[_0xcfa8('0x49')](handleError(_0x445ad1,null));};exports[_0xcfa8('0x4a')]=function(_0x57534c,_0x3f54b6){return db[_0xcfa8('0x2d')][_0xcfa8('0x4a')](_0x57534c[_0xcfa8('0x4b')],{})[_0xcfa8('0x28')](respondWithResult(_0x3f54b6,0xc9))[_0xcfa8('0x49')](handleError(_0x3f54b6,null));};exports[_0xcfa8('0x26')]=function(_0x59b06e,_0x1e9eb9){if(_0x59b06e[_0xcfa8('0x4b')]['id']){delete _0x59b06e['body']['id'];}return db[_0xcfa8('0x2d')]['find']({'where':{'id':_0x59b06e[_0xcfa8('0x44')]['id']}})[_0xcfa8('0x28')](handleEntityNotFound(_0x1e9eb9,null))[_0xcfa8('0x28')](saveUpdates(_0x59b06e[_0xcfa8('0x4b')],null))[_0xcfa8('0x28')](respondWithResult(_0x1e9eb9,null))['catch'](handleError(_0x1e9eb9,null));};exports[_0xcfa8('0x27')]=function(_0x3ea1e4,_0x112528){return db[_0xcfa8('0x2d')][_0xcfa8('0x48')]({'where':{'id':_0x3ea1e4['params']['id']}})[_0xcfa8('0x28')](handleEntityNotFound(_0x112528,null))[_0xcfa8('0x28')](removeEntity(_0x112528,null))[_0xcfa8('0x49')](handleError(_0x112528,null));};exports[_0xcfa8('0x4c')]=function(_0x4c00cd,_0x5e7d4e){return db[_0xcfa8('0x2d')][_0xcfa8('0x4c')]()[_0xcfa8('0x28')](respondWithResult(_0x5e7d4e,null))[_0xcfa8('0x49')](handleError(_0x5e7d4e,null));}; \ No newline at end of file +var _0x9afa=['fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs'];(function(_0x3d6b4a,_0x29f823){var _0xbeec49=function(_0x509ffc){while(--_0x509ffc){_0x3d6b4a['push'](_0x3d6b4a['shift']());}};_0xbeec49(++_0x29f823);}(_0x9afa,0xdb));var _0xa9af=function(_0x13ce88,_0x47098f){_0x13ce88=_0x13ce88-0x0;var _0x2ba0fc=_0x9afa[_0x13ce88];return _0x2ba0fc;};'use strict';var emlformat=require(_0xa9af('0x0'));var rimraf=require(_0xa9af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9af('0x2'));var rp=require(_0xa9af('0x3'));var moment=require('moment');var BPromise=require(_0xa9af('0x4'));var Mustache=require(_0xa9af('0x5'));var util=require(_0xa9af('0x6'));var path=require(_0xa9af('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa9af('0x8'));var fs=require('fs');var fs_extra=require(_0xa9af('0x9'));var _=require(_0xa9af('0xa'));var squel=require('squel');var crypto=require(_0xa9af('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa9af('0xc'));var toCsv=require(_0xa9af('0xd'));var querystring=require(_0xa9af('0xe'));var Papa=require(_0xa9af('0xf'));var Redis=require(_0xa9af('0x10'));var authService=require(_0xa9af('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa9af('0x12'));var logger=require(_0xa9af('0x13'))(_0xa9af('0x14'));var utils=require(_0xa9af('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa9af('0x16'));var db=require(_0xa9af('0x17'))['db'];function respondWithStatusCode(_0x1dfd07,_0x4241fc){_0x4241fc=_0x4241fc||0xcc;return function(_0x20dc8e){if(_0x20dc8e){return _0x1dfd07[_0xa9af('0x18')](_0x4241fc);}return _0x1dfd07[_0xa9af('0x19')](_0x4241fc)[_0xa9af('0x1a')]();};}function respondWithResult(_0x433304,_0x991337){_0x991337=_0x991337||0xc8;return function(_0x4d4b66){if(_0x4d4b66){return _0x433304[_0xa9af('0x19')](_0x991337)['json'](_0x4d4b66);}};}function respondWithFilteredResult(_0x4f9e41,_0x2edd7d){return function(_0x2ca7b8){if(_0x2ca7b8){var _0x488ea5=typeof _0x2edd7d[_0xa9af('0x1b')]===_0xa9af('0x1c')&&typeof _0x2edd7d['limit']===_0xa9af('0x1c');var _0x19d02d=_0x2ca7b8[_0xa9af('0x1d')];var _0x3e52e1=_0x488ea5?0x0:_0x2edd7d['offset'];var _0x4824f5=_0x488ea5?_0x2ca7b8['count']:_0x2edd7d[_0xa9af('0x1b')]+_0x2edd7d[_0xa9af('0x1e')];var _0x308d56;if(_0x4824f5>=_0x19d02d){_0x4824f5=_0x19d02d;_0x308d56=0xc8;}else{_0x308d56=0xce;}_0x4f9e41[_0xa9af('0x19')](_0x308d56);return _0x4f9e41[_0xa9af('0x1f')](_0xa9af('0x20'),_0x3e52e1+'-'+_0x4824f5+'/'+_0x19d02d)[_0xa9af('0x21')](_0x2ca7b8);}return null;};}function patchUpdates(_0x1e9c5c){return function(_0x569f40){try{jsonpatch['apply'](_0x569f40,_0x1e9c5c,!![]);}catch(_0x5255df){return BPromise[_0xa9af('0x22')](_0x5255df);}return _0x569f40[_0xa9af('0x23')]();};}function saveUpdates(_0x4cbb7f,_0x4d9879){return function(_0x59ad36){if(_0x59ad36){return _0x59ad36[_0xa9af('0x24')](_0x4cbb7f)[_0xa9af('0x25')](function(_0x3ff908){return _0x3ff908;});}return null;};}function removeEntity(_0x439199,_0x461560){return function(_0x3c6d84){if(_0x3c6d84){return _0x3c6d84[_0xa9af('0x26')]()[_0xa9af('0x25')](function(){_0x439199[_0xa9af('0x19')](0xcc)[_0xa9af('0x1a')]();});}};}function handleEntityNotFound(_0x4da885,_0x52e9db){return function(_0x217abe){if(!_0x217abe){_0x4da885['sendStatus'](0x194);}return _0x217abe;};}function handleError(_0x52c0e2,_0x69939b){_0x69939b=_0x69939b||0x1f4;return function(_0x58e7cc){logger[_0xa9af('0x27')](_0x58e7cc[_0xa9af('0x28')]);if(_0x58e7cc[_0xa9af('0x29')]){delete _0x58e7cc[_0xa9af('0x29')];}_0x52c0e2[_0xa9af('0x19')](_0x69939b)[_0xa9af('0x2a')](_0x58e7cc);};}exports[_0xa9af('0x2b')]=function(_0x2b1f92,_0x17a5c3){var _0x36011a={},_0x42c33b={},_0x22dfca={'count':0x0,'rows':[]};var _0x5a7024=_[_0xa9af('0x2c')](db[_0xa9af('0x2d')]['rawAttributes'],function(_0x1a2b75){return{'name':_0x1a2b75[_0xa9af('0x2e')],'type':_0x1a2b75[_0xa9af('0x2f')][_0xa9af('0x30')]};});_0x42c33b[_0xa9af('0x31')]=_[_0xa9af('0x2c')](_0x5a7024,_0xa9af('0x29'));_0x42c33b['query']=_[_0xa9af('0x32')](_0x2b1f92['query']);_0x42c33b[_0xa9af('0x33')]=_[_0xa9af('0x34')](_0x42c33b['model'],_0x42c33b[_0xa9af('0x35')]);_0x36011a[_0xa9af('0x36')]=_[_0xa9af('0x34')](_0x42c33b[_0xa9af('0x31')],qs[_0xa9af('0x37')](_0x2b1f92[_0xa9af('0x35')][_0xa9af('0x37')]));_0x36011a['attributes']=_0x36011a[_0xa9af('0x36')][_0xa9af('0x38')]?_0x36011a[_0xa9af('0x36')]:_0x42c33b['model'];if(!_0x2b1f92['query'][_0xa9af('0x39')]('nolimit')){_0x36011a[_0xa9af('0x1e')]=qs[_0xa9af('0x1e')](_0x2b1f92['query'][_0xa9af('0x1e')]);_0x36011a['offset']=qs['offset'](_0x2b1f92[_0xa9af('0x35')]['offset']);}_0x36011a[_0xa9af('0x3a')]=qs[_0xa9af('0x3b')](_0x2b1f92['query'][_0xa9af('0x3b')]);_0x36011a[_0xa9af('0x3c')]=qs[_0xa9af('0x33')](_['pick'](_0x2b1f92[_0xa9af('0x35')],_0x42c33b[_0xa9af('0x33')]),_0x5a7024);if(_0x2b1f92[_0xa9af('0x35')][_0xa9af('0x3d')]){_0x36011a['where']=_[_0xa9af('0x3e')](_0x36011a['where'],{'$or':_['map'](_0x5a7024,function(_0xf12288){if(_0xf12288[_0xa9af('0x2f')]!==_0xa9af('0x3f')){var _0x1ee5d1={};_0x1ee5d1[_0xf12288[_0xa9af('0x29')]]={'$like':'%'+_0x2b1f92[_0xa9af('0x35')][_0xa9af('0x3d')]+'%'};return _0x1ee5d1;}})});}_0x36011a=_[_0xa9af('0x3e')]({},_0x36011a,_0x2b1f92['options']);var _0x33f583={'where':_0x36011a['where']};return db[_0xa9af('0x2d')]['count'](_0x33f583)[_0xa9af('0x25')](function(_0x18950f){_0x22dfca[_0xa9af('0x1d')]=_0x18950f;if(_0x2b1f92[_0xa9af('0x35')][_0xa9af('0x40')]){_0x36011a[_0xa9af('0x41')]=[{'all':!![]}];}return db[_0xa9af('0x2d')][_0xa9af('0x42')](_0x36011a);})['then'](function(_0x1e7afe){_0x22dfca[_0xa9af('0x43')]=_0x1e7afe;return _0x22dfca;})[_0xa9af('0x25')](respondWithFilteredResult(_0x17a5c3,_0x36011a))[_0xa9af('0x44')](handleError(_0x17a5c3,null));};exports[_0xa9af('0x45')]=function(_0x205c83,_0x56349a){var _0x316bb9={'raw':!![],'where':{'id':_0x205c83[_0xa9af('0x46')]['id']}},_0x12fcd1={};_0x12fcd1[_0xa9af('0x31')]=_[_0xa9af('0x32')](db['JscriptyQuestionReport'][_0xa9af('0x47')]);_0x12fcd1[_0xa9af('0x35')]=_[_0xa9af('0x32')](_0x205c83[_0xa9af('0x35')]);_0x12fcd1[_0xa9af('0x33')]=_[_0xa9af('0x34')](_0x12fcd1[_0xa9af('0x31')],_0x12fcd1[_0xa9af('0x35')]);_0x316bb9[_0xa9af('0x36')]=_[_0xa9af('0x34')](_0x12fcd1[_0xa9af('0x31')],qs[_0xa9af('0x37')](_0x205c83['query']['fields']));_0x316bb9[_0xa9af('0x36')]=_0x316bb9[_0xa9af('0x36')][_0xa9af('0x38')]?_0x316bb9[_0xa9af('0x36')]:_0x12fcd1[_0xa9af('0x31')];if(_0x205c83[_0xa9af('0x35')][_0xa9af('0x40')]){_0x316bb9['include']=[{'all':!![]}];}_0x316bb9=_[_0xa9af('0x3e')]({},_0x316bb9,_0x205c83[_0xa9af('0x48')]);return db[_0xa9af('0x2d')][_0xa9af('0x49')](_0x316bb9)[_0xa9af('0x25')](handleEntityNotFound(_0x56349a,null))[_0xa9af('0x25')](respondWithResult(_0x56349a,null))[_0xa9af('0x44')](handleError(_0x56349a,null));};exports['create']=function(_0xf91e85,_0x5ada63){return db[_0xa9af('0x2d')]['create'](_0xf91e85[_0xa9af('0x4a')],{})[_0xa9af('0x25')](respondWithResult(_0x5ada63,0xc9))[_0xa9af('0x44')](handleError(_0x5ada63,null));};exports[_0xa9af('0x24')]=function(_0x1e441a,_0xfcf148){if(_0x1e441a[_0xa9af('0x4a')]['id']){delete _0x1e441a['body']['id'];}return db[_0xa9af('0x2d')][_0xa9af('0x49')]({'where':{'id':_0x1e441a['params']['id']}})[_0xa9af('0x25')](handleEntityNotFound(_0xfcf148,null))['then'](saveUpdates(_0x1e441a[_0xa9af('0x4a')],null))['then'](respondWithResult(_0xfcf148,null))[_0xa9af('0x44')](handleError(_0xfcf148,null));};exports[_0xa9af('0x26')]=function(_0x474b07,_0x25a511){return db[_0xa9af('0x2d')][_0xa9af('0x49')]({'where':{'id':_0x474b07['params']['id']}})[_0xa9af('0x25')](handleEntityNotFound(_0x25a511,null))[_0xa9af('0x25')](removeEntity(_0x25a511,null))[_0xa9af('0x44')](handleError(_0x25a511,null));};exports[_0xa9af('0x4b')]=function(_0xa25a8a,_0x2f825b){return db['JscriptyQuestionReport'][_0xa9af('0x4b')]()['then'](respondWithResult(_0x2f825b,null))[_0xa9af('0x44')](handleError(_0x2f825b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 1f2b492..dd1ae67 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 _0xb75b=['report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','JscriptyQuestionReport'];(function(_0xdeefbd,_0x9e1b3d){var _0x4ff63f=function(_0x4b51f9){while(--_0x4b51f9){_0xdeefbd['push'](_0xdeefbd['shift']());}};_0x4ff63f(++_0x9e1b3d);}(_0xb75b,0x187));var _0xbb75=function(_0x58f5c5,_0x71f99a){_0x58f5c5=_0x58f5c5-0x0;var _0x4fef49=_0xb75b[_0x58f5c5];return _0x4fef49;};'use strict';var _=require(_0xbb75('0x0'));var util=require(_0xbb75('0x1'));var logger=require(_0xbb75('0x2'))(_0xbb75('0x3'));var moment=require(_0xbb75('0x4'));var BPromise=require(_0xbb75('0x5'));var rp=require(_0xbb75('0x6'));var fs=require('fs');var path=require(_0xbb75('0x7'));var rimraf=require(_0xbb75('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0xbb75('0x9')]=function(_0x518bfb,_0x45b3b1){return _0x518bfb[_0xbb75('0xa')](_0xbb75('0xb'),attributes,{'tableName':_0xbb75('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd73=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util'];(function(_0x558935,_0x5e1296){var _0x4c286e=function(_0x55734b){while(--_0x55734b){_0x558935['push'](_0x558935['shift']());}};_0x4c286e(++_0x5e1296);}(_0xbd73,0xe8));var _0x3bd7=function(_0x9e47b9,_0x470c70){_0x9e47b9=_0x9e47b9-0x0;var _0x4ef93b=_0xbd73[_0x9e47b9];return _0x4ef93b;};'use strict';var _=require(_0x3bd7('0x0'));var util=require(_0x3bd7('0x1'));var logger=require(_0x3bd7('0x2'))(_0x3bd7('0x3'));var moment=require(_0x3bd7('0x4'));var BPromise=require(_0x3bd7('0x5'));var rp=require(_0x3bd7('0x6'));var fs=require('fs');var path=require(_0x3bd7('0x7'));var rimraf=require('rimraf');var config=require(_0x3bd7('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x3bd7('0x9')]=function(_0x5e024c,_0x39ee7e){return _0x5e024c[_0x3bd7('0xa')](_0x3bd7('0xb'),attributes,{'tableName':_0x3bd7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 229df29..b04e8f7 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 _0x1ea2=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x2c3a47,_0x170687){var _0x1c04de=function(_0x367deb){while(--_0x367deb){_0x2c3a47['push'](_0x2c3a47['shift']());}};_0x1c04de(++_0x170687);}(_0x1ea2,0x1b5));var _0x21ea=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0x1ea2[_0x462999];return _0x4b1366;};'use strict';var _=require(_0x21ea('0x0'));var util=require(_0x21ea('0x1'));var moment=require('moment');var BPromise=require(_0x21ea('0x2'));var rs=require(_0x21ea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x21ea('0x4'))['db'];var utils=require(_0x21ea('0x5'));var logger=require(_0x21ea('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x21ea('0x7'));var client=jayson[_0x21ea('0x8')][_0x21ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x361eea,_0x583d81,_0x54cb13){return new BPromise(function(_0x30dc0d,_0x3179c8){return client[_0x21ea('0xa')](_0x361eea,_0x54cb13)['then'](function(_0x12479c){logger[_0x21ea('0xb')](_0x21ea('0xc'),_0x583d81,_0x21ea('0xd'));logger[_0x21ea('0xe')](_0x21ea('0xf'),_0x583d81,_0x21ea('0xd'),JSON[_0x21ea('0x10')](_0x12479c));if(_0x12479c[_0x21ea('0x11')]){if(_0x12479c[_0x21ea('0x11')]['code']===0x1f4){logger[_0x21ea('0x11')](_0x21ea('0xc'),_0x583d81,_0x12479c[_0x21ea('0x11')][_0x21ea('0x12')]);return _0x3179c8(_0x12479c[_0x21ea('0x11')][_0x21ea('0x12')]);}logger[_0x21ea('0x11')](_0x21ea('0xc'),_0x583d81,_0x12479c[_0x21ea('0x11')]['message']);return _0x30dc0d(_0x12479c['error'][_0x21ea('0x12')]);}else{logger[_0x21ea('0xb')](_0x21ea('0xc'),_0x583d81,'request\x20sent');_0x30dc0d(_0x12479c[_0x21ea('0x13')][_0x21ea('0x12')]);}})[_0x21ea('0x14')](function(_0x4d331a){logger[_0x21ea('0x11')](_0x21ea('0xc'),_0x583d81,_0x4d331a);_0x3179c8(_0x4d331a);});});} \ No newline at end of file +var _0xdd3f=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','info'];(function(_0x33b618,_0x5a2279){var _0x45707e=function(_0x36b9c5){while(--_0x36b9c5){_0x33b618['push'](_0x33b618['shift']());}};_0x45707e(++_0x5a2279);}(_0xdd3f,0x66));var _0xfdd3=function(_0x380eaf,_0x51afb7){_0x380eaf=_0x380eaf-0x0;var _0x58a936=_0xdd3f[_0x380eaf];return _0x58a936;};'use strict';var _=require(_0xfdd3('0x0'));var util=require(_0xfdd3('0x1'));var moment=require('moment');var BPromise=require(_0xfdd3('0x2'));var rs=require(_0xfdd3('0x3'));var fs=require('fs');var Redis=require(_0xfdd3('0x4'));var db=require(_0xfdd3('0x5'))['db'];var utils=require(_0xfdd3('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfdd3('0x7')][_0xfdd3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40ee9b,_0x663e27,_0x4db3d6){return new BPromise(function(_0x3e1d6d,_0x24f90a){return client[_0xfdd3('0x9')](_0x40ee9b,_0x4db3d6)[_0xfdd3('0xa')](function(_0x1aa168){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x663e27,_0xfdd3('0xb'));logger['debug'](_0xfdd3('0xc'),_0x663e27,'request\x20sent',JSON['stringify'](_0x1aa168));if(_0x1aa168[_0xfdd3('0xd')]){if(_0x1aa168['error'][_0xfdd3('0xe')]===0x1f4){logger[_0xfdd3('0xd')](_0xfdd3('0xf'),_0x663e27,_0x1aa168[_0xfdd3('0xd')][_0xfdd3('0x10')]);return _0x24f90a(_0x1aa168[_0xfdd3('0xd')][_0xfdd3('0x10')]);}logger[_0xfdd3('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x663e27,_0x1aa168[_0xfdd3('0xd')][_0xfdd3('0x10')]);return _0x3e1d6d(_0x1aa168['error']['message']);}else{logger[_0xfdd3('0x11')](_0xfdd3('0xf'),_0x663e27,'request\x20sent');_0x3e1d6d(_0x1aa168[_0xfdd3('0x12')][_0xfdd3('0x10')]);}})[_0xfdd3('0x13')](function(_0x124876){logger[_0xfdd3('0xd')](_0xfdd3('0xf'),_0x663e27,_0x124876);_0x24f90a(_0x124876);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index fa4b503..14ee200 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 _0xda6f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','get','/describe','describe','/:id','show','getQuestions','post','put','update','delete','multer'];(function(_0x108b92,_0x162328){var _0x5d4531=function(_0x5c818d){while(--_0x5c818d){_0x108b92['push'](_0x108b92['shift']());}};_0x5d4531(++_0x162328);}(_0xda6f,0x19f));var _0xfda6=function(_0x7625d9,_0x2fea5a){_0x7625d9=_0x7625d9-0x0;var _0x5c6d75=_0xda6f[_0x7625d9];return _0x5c6d75;};'use strict';var multer=require(_0xfda6('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('fs-extra');var auth=require(_0xfda6('0x1'));var interaction=require(_0xfda6('0x2'));var config=require(_0xfda6('0x3'));var controller=require(_0xfda6('0x4'));router['get']('/',auth[_0xfda6('0x5')](),controller['index']);router[_0xfda6('0x6')](_0xfda6('0x7'),auth[_0xfda6('0x5')](),controller[_0xfda6('0x8')]);router[_0xfda6('0x6')](_0xfda6('0x9'),auth[_0xfda6('0x5')](),controller[_0xfda6('0xa')]);router[_0xfda6('0x6')]('/:id/questions',auth[_0xfda6('0x5')](),controller[_0xfda6('0xb')]);router[_0xfda6('0xc')]('/',auth[_0xfda6('0x5')](),controller['create']);router[_0xfda6('0xd')](_0xfda6('0x9'),auth['isAuthenticated'](),controller[_0xfda6('0xe')]);router[_0xfda6('0xf')](_0xfda6('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc692=['update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xc692,0x179));var _0x2c69=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xc692[_0x279d37];return _0x530173;};'use strict';var multer=require(_0x2c69('0x0'));var util=require(_0x2c69('0x1'));var path=require('path');var timeout=require(_0x2c69('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2c69('0x3'));var auth=require(_0x2c69('0x4'));var interaction=require(_0x2c69('0x5'));var config=require(_0x2c69('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0x2c69('0x7')]('/',auth[_0x2c69('0x8')](),controller[_0x2c69('0x9')]);router['get'](_0x2c69('0xa'),auth[_0x2c69('0x8')](),controller[_0x2c69('0xb')]);router['get'](_0x2c69('0xc'),auth[_0x2c69('0x8')](),controller[_0x2c69('0xd')]);router['get'](_0x2c69('0xe'),auth[_0x2c69('0x8')](),controller[_0x2c69('0xf')]);router[_0x2c69('0x10')]('/',auth['isAuthenticated'](),controller[_0x2c69('0x11')]);router[_0x2c69('0x12')](_0x2c69('0xc'),auth[_0x2c69('0x8')](),controller[_0x2c69('0x13')]);router['delete'](_0x2c69('0xc'),auth['isAuthenticated'](),controller[_0x2c69('0x14')]);module[_0x2c69('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 6afbf04..fd19996 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 _0xd08d=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','exports','setDataValue','starttime','endtime','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd08d,0x81));var _0xdd08=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd08d[_0x502c7d];return _0x30b7ed;};'use strict';var moment=require('moment');var Sequelize=require(_0xdd08('0x0'));module[_0xdd08('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x2a44f9){this[_0xdd08('0x2')](_0xdd08('0x3'),_0x2a44f9);this['setDataValue'](_0xdd08('0x4'),moment()[_0xdd08('0x5')](_0xdd08('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xdd08('0x7')]},'projectname':{'type':Sequelize[_0xdd08('0x7')]},'queue':{'type':Sequelize[_0xdd08('0x7')]},'uniqueid':{'type':Sequelize[_0xdd08('0x7')]},'calleridname':{'type':Sequelize[_0xdd08('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xdd08('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x29c7=['exports','DATE','setDataValue','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize'];(function(_0x5b8902,_0x28bf9b){var _0x553ad2=function(_0x465be8){while(--_0x465be8){_0x5b8902['push'](_0x5b8902['shift']());}};_0x553ad2(++_0x28bf9b);}(_0x29c7,0x68));var _0x729c=function(_0x28cebf,_0x539450){_0x28cebf=_0x28cebf-0x0;var _0x42141a=_0x29c7[_0x28cebf];return _0x42141a;};'use strict';var moment=require('moment');var Sequelize=require(_0x729c('0x0'));module[_0x729c('0x1')]={'starttime':{'type':Sequelize[_0x729c('0x2')],'set':function(_0x2b7301){this[_0x729c('0x3')]('starttime',_0x2b7301);this[_0x729c('0x3')]('endtime',moment()['format'](_0x729c('0x4')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x729c('0x5')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x729c('0x5')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x729c('0x5')]},'completed':{'type':Sequelize[_0x729c('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index ab7f627..873b37c 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 _0xd4d9=['count','set','apply','update','then','end','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0x449d15,_0x2d9974){var _0xb952bb=function(_0x3287e7){while(--_0x3287e7){_0x449d15['push'](_0x449d15['shift']());}};_0xb952bb(++_0x2d9974);}(_0xd4d9,0x7e));var _0x9d4d=function(_0x70cb68,_0x655078){_0x70cb68=_0x70cb68-0x0;var _0x7a453c=_0xd4d9[_0x70cb68];return _0x7a453c;};'use strict';var emlformat=require(_0x9d4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9d4d('0x1'));var jsonpatch=require(_0x9d4d('0x2'));var rp=require(_0x9d4d('0x3'));var moment=require('moment');var BPromise=require(_0x9d4d('0x4'));var Mustache=require(_0x9d4d('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9d4d('0x6'));var csv=require(_0x9d4d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9d4d('0x8'));var _=require(_0x9d4d('0x9'));var squel=require(_0x9d4d('0xa'));var crypto=require(_0x9d4d('0xb'));var jsforce=require(_0x9d4d('0xc'));var deskjs=require(_0x9d4d('0xd'));var toCsv=require(_0x9d4d('0x7'));var querystring=require(_0x9d4d('0xe'));var Papa=require(_0x9d4d('0xf'));var Redis=require(_0x9d4d('0x10'));var authService=require(_0x9d4d('0x11'));var qs=require(_0x9d4d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d4d('0x13'));var logger=require(_0x9d4d('0x14'))(_0x9d4d('0x15'));var utils=require(_0x9d4d('0x16'));var config=require(_0x9d4d('0x17'));var licenseUtil=require(_0x9d4d('0x18'));var db=require(_0x9d4d('0x19'))['db'];function respondWithStatusCode(_0x40b80f,_0xcdafc){_0xcdafc=_0xcdafc||0xcc;return function(_0x259fca){if(_0x259fca){return _0x40b80f[_0x9d4d('0x1a')](_0xcdafc);}return _0x40b80f[_0x9d4d('0x1b')](_0xcdafc)['end']();};}function respondWithResult(_0x9e556b,_0x4cbd35){_0x4cbd35=_0x4cbd35||0xc8;return function(_0x28ef45){if(_0x28ef45){return _0x9e556b[_0x9d4d('0x1b')](_0x4cbd35)[_0x9d4d('0x1c')](_0x28ef45);}};}function respondWithFilteredResult(_0x3d1b06,_0x3fc645){return function(_0x1ab8ad){if(_0x1ab8ad){var _0x1f68d8=typeof _0x3fc645[_0x9d4d('0x1d')]===_0x9d4d('0x1e')&&typeof _0x3fc645[_0x9d4d('0x1f')]===_0x9d4d('0x1e');var _0x2d19d2=_0x1ab8ad['count'];var _0xdbb08a=_0x1f68d8?0x0:_0x3fc645[_0x9d4d('0x1d')];var _0x2b3f8=_0x1f68d8?_0x1ab8ad[_0x9d4d('0x20')]:_0x3fc645[_0x9d4d('0x1d')]+_0x3fc645[_0x9d4d('0x1f')];var _0xd2cbad;if(_0x2b3f8>=_0x2d19d2){_0x2b3f8=_0x2d19d2;_0xd2cbad=0xc8;}else{_0xd2cbad=0xce;}_0x3d1b06[_0x9d4d('0x1b')](_0xd2cbad);return _0x3d1b06[_0x9d4d('0x21')]('Content-Range',_0xdbb08a+'-'+_0x2b3f8+'/'+_0x2d19d2)[_0x9d4d('0x1c')](_0x1ab8ad);}return null;};}function patchUpdates(_0x290fc2){return function(_0x2a8c7a){try{jsonpatch[_0x9d4d('0x22')](_0x2a8c7a,_0x290fc2,!![]);}catch(_0x309830){return BPromise['reject'](_0x309830);}return _0x2a8c7a['save']();};}function saveUpdates(_0xe0687f,_0x2b0fdc){return function(_0x3e98a2){if(_0x3e98a2){return _0x3e98a2[_0x9d4d('0x23')](_0xe0687f)[_0x9d4d('0x24')](function(_0x546837){return _0x546837;});}return null;};}function removeEntity(_0x3c7c85,_0x1b22ac){return function(_0x333a12){if(_0x333a12){return _0x333a12['destroy']()[_0x9d4d('0x24')](function(){_0x3c7c85[_0x9d4d('0x1b')](0xcc)[_0x9d4d('0x25')]();});}};}function handleEntityNotFound(_0x522403,_0x487c76){return function(_0xe2732e){if(!_0xe2732e){_0x522403[_0x9d4d('0x1a')](0x194);}return _0xe2732e;};}function handleError(_0x25c729,_0x4de29f){_0x4de29f=_0x4de29f||0x1f4;return function(_0x1d8eb5){logger[_0x9d4d('0x26')](_0x1d8eb5['stack']);if(_0x1d8eb5[_0x9d4d('0x27')]){delete _0x1d8eb5[_0x9d4d('0x27')];}_0x25c729[_0x9d4d('0x1b')](_0x4de29f)[_0x9d4d('0x28')](_0x1d8eb5);};}exports[_0x9d4d('0x29')]=function(_0x1eb9de,_0x5ed2ec){var _0x4a289d={},_0x4613f0={},_0x357c46={'count':0x0,'rows':[]};var _0x1da40b=_[_0x9d4d('0x2a')](db[_0x9d4d('0x2b')][_0x9d4d('0x2c')],function(_0x48f47e){return{'name':_0x48f47e[_0x9d4d('0x2d')],'type':_0x48f47e[_0x9d4d('0x2e')][_0x9d4d('0x2f')]};});_0x4613f0[_0x9d4d('0x30')]=_[_0x9d4d('0x2a')](_0x1da40b,_0x9d4d('0x27'));_0x4613f0['query']=_[_0x9d4d('0x31')](_0x1eb9de[_0x9d4d('0x32')]);_0x4613f0[_0x9d4d('0x33')]=_['intersection'](_0x4613f0[_0x9d4d('0x30')],_0x4613f0[_0x9d4d('0x32')]);_0x4a289d[_0x9d4d('0x34')]=_[_0x9d4d('0x35')](_0x4613f0['model'],qs[_0x9d4d('0x36')](_0x1eb9de[_0x9d4d('0x32')][_0x9d4d('0x36')]));_0x4a289d[_0x9d4d('0x34')]=_0x4a289d[_0x9d4d('0x34')][_0x9d4d('0x37')]?_0x4a289d[_0x9d4d('0x34')]:_0x4613f0['model'];if(!_0x1eb9de[_0x9d4d('0x32')]['hasOwnProperty'](_0x9d4d('0x38'))){_0x4a289d[_0x9d4d('0x1f')]=qs[_0x9d4d('0x1f')](_0x1eb9de['query']['limit']);_0x4a289d['offset']=qs[_0x9d4d('0x1d')](_0x1eb9de['query'][_0x9d4d('0x1d')]);}_0x4a289d[_0x9d4d('0x39')]=qs[_0x9d4d('0x3a')](_0x1eb9de['query']['sort']);_0x4a289d[_0x9d4d('0x3b')]=qs[_0x9d4d('0x33')](_[_0x9d4d('0x3c')](_0x1eb9de[_0x9d4d('0x32')],_0x4613f0[_0x9d4d('0x33')]),_0x1da40b);if(_0x1eb9de[_0x9d4d('0x32')]['filter']){_0x4a289d[_0x9d4d('0x3b')]=_[_0x9d4d('0x3d')](_0x4a289d['where'],{'$or':_[_0x9d4d('0x2a')](_0x1da40b,function(_0xb702ac){if(_0xb702ac[_0x9d4d('0x2e')]!=='VIRTUAL'){var _0x35bcc7={};_0x35bcc7[_0xb702ac[_0x9d4d('0x27')]]={'$like':'%'+_0x1eb9de[_0x9d4d('0x32')][_0x9d4d('0x3e')]+'%'};return _0x35bcc7;}})});}_0x4a289d=_[_0x9d4d('0x3d')]({},_0x4a289d,_0x1eb9de[_0x9d4d('0x3f')]);var _0x4ab929={'where':_0x4a289d['where']};return db[_0x9d4d('0x2b')][_0x9d4d('0x20')](_0x4ab929)[_0x9d4d('0x24')](function(_0x5d9b97){_0x357c46['count']=_0x5d9b97;if(_0x1eb9de[_0x9d4d('0x32')][_0x9d4d('0x40')]){_0x4a289d[_0x9d4d('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x9d4d('0x42')](_0x4a289d);})['then'](function(_0x2a3f79){_0x357c46[_0x9d4d('0x43')]=_0x2a3f79;return _0x357c46;})['then'](respondWithFilteredResult(_0x5ed2ec,_0x4a289d))[_0x9d4d('0x44')](handleError(_0x5ed2ec,null));};exports['show']=function(_0x17d164,_0x473ef6){var _0x571fe1={'raw':!![],'where':{'id':_0x17d164[_0x9d4d('0x45')]['id']}},_0x412cd7={};_0x412cd7[_0x9d4d('0x30')]=_[_0x9d4d('0x31')](db[_0x9d4d('0x2b')][_0x9d4d('0x2c')]);_0x412cd7['query']=_['keys'](_0x17d164[_0x9d4d('0x32')]);_0x412cd7[_0x9d4d('0x33')]=_[_0x9d4d('0x35')](_0x412cd7['model'],_0x412cd7[_0x9d4d('0x32')]);_0x571fe1[_0x9d4d('0x34')]=_[_0x9d4d('0x35')](_0x412cd7[_0x9d4d('0x30')],qs[_0x9d4d('0x36')](_0x17d164['query']['fields']));_0x571fe1['attributes']=_0x571fe1[_0x9d4d('0x34')][_0x9d4d('0x37')]?_0x571fe1['attributes']:_0x412cd7[_0x9d4d('0x30')];if(_0x17d164['query']['includeAll']){_0x571fe1['include']=[{'all':!![]}];}_0x571fe1=_[_0x9d4d('0x3d')]({},_0x571fe1,_0x17d164[_0x9d4d('0x3f')]);return db[_0x9d4d('0x2b')][_0x9d4d('0x46')](_0x571fe1)[_0x9d4d('0x24')](handleEntityNotFound(_0x473ef6,null))[_0x9d4d('0x24')](respondWithResult(_0x473ef6,null))[_0x9d4d('0x44')](handleError(_0x473ef6,null));};exports[_0x9d4d('0x47')]=function(_0x5b31b0,_0x1a897a){return db['JscriptySessionReport']['create'](_0x5b31b0[_0x9d4d('0x48')],{})['then'](respondWithResult(_0x1a897a,0xc9))[_0x9d4d('0x44')](handleError(_0x1a897a,null));};exports[_0x9d4d('0x23')]=function(_0x20dfac,_0x3ea628){if(_0x20dfac[_0x9d4d('0x48')]['id']){delete _0x20dfac[_0x9d4d('0x48')]['id'];}return db[_0x9d4d('0x2b')][_0x9d4d('0x46')]({'where':{'id':_0x20dfac[_0x9d4d('0x45')]['id']}})[_0x9d4d('0x24')](handleEntityNotFound(_0x3ea628,null))[_0x9d4d('0x24')](saveUpdates(_0x20dfac['body'],null))[_0x9d4d('0x24')](respondWithResult(_0x3ea628,null))['catch'](handleError(_0x3ea628,null));};exports['destroy']=function(_0x19da8d,_0x309f79){return db[_0x9d4d('0x2b')]['find']({'where':{'id':_0x19da8d[_0x9d4d('0x45')]['id']}})['then'](handleEntityNotFound(_0x309f79,null))[_0x9d4d('0x24')](removeEntity(_0x309f79,null))[_0x9d4d('0x44')](handleError(_0x309f79,null));};exports[_0x9d4d('0x49')]=function(_0x5d2db8,_0x5c036){return db[_0x9d4d('0x2b')][_0x9d4d('0x49')]()[_0x9d4d('0x24')](respondWithResult(_0x5c036,null))['catch'](handleError(_0x5c036,null));};exports[_0x9d4d('0x4a')]=function(_0x3b40cd,_0x44b543,_0x19c4ff){var _0x2ddfdb={'raw':!![],'where':{}};var _0x59763e={};var _0x6d32a9={'count':0x0,'rows':[]};return db[_0x9d4d('0x2b')][_0x9d4d('0x4b')]({'where':{'id':_0x3b40cd[_0x9d4d('0x45')]['id']}})['then'](handleEntityNotFound(_0x44b543,null))[_0x9d4d('0x24')](function(_0x4d4374){if(_0x4d4374){_0x59763e[_0x9d4d('0x30')]=_[_0x9d4d('0x31')](db[_0x9d4d('0x4c')]['rawAttributes']);_0x59763e[_0x9d4d('0x32')]=_[_0x9d4d('0x31')](_0x3b40cd[_0x9d4d('0x32')]);_0x59763e[_0x9d4d('0x33')]=_[_0x9d4d('0x35')](_0x59763e[_0x9d4d('0x30')],_0x59763e['query']);_0x2ddfdb[_0x9d4d('0x34')]=_['intersection'](_0x59763e[_0x9d4d('0x30')],qs['fields'](_0x3b40cd[_0x9d4d('0x32')][_0x9d4d('0x36')]));_0x2ddfdb['attributes']=_0x2ddfdb[_0x9d4d('0x34')][_0x9d4d('0x37')]?_0x2ddfdb[_0x9d4d('0x34')]:_0x59763e[_0x9d4d('0x30')];if(!_0x3b40cd['query'][_0x9d4d('0x4d')](_0x9d4d('0x38'))){_0x2ddfdb[_0x9d4d('0x1f')]=qs[_0x9d4d('0x1f')](_0x3b40cd['query']['limit']);_0x2ddfdb[_0x9d4d('0x1d')]=qs[_0x9d4d('0x1d')](_0x3b40cd[_0x9d4d('0x32')][_0x9d4d('0x1d')]);}_0x2ddfdb[_0x9d4d('0x39')]=qs[_0x9d4d('0x3a')](_0x3b40cd[_0x9d4d('0x32')][_0x9d4d('0x3a')]);_0x2ddfdb[_0x9d4d('0x3b')]=qs['filters'](_[_0x9d4d('0x3c')](_0x3b40cd[_0x9d4d('0x32')],_0x59763e[_0x9d4d('0x33')]));_0x2ddfdb[_0x9d4d('0x3b')][_0x9d4d('0x4e')]=_0x4d4374['id'];if(_0x3b40cd[_0x9d4d('0x32')][_0x9d4d('0x3e')]){_0x2ddfdb['where']=_[_0x9d4d('0x3d')](_0x2ddfdb[_0x9d4d('0x3b')],{'$or':_[_0x9d4d('0x2a')](_0x2ddfdb[_0x9d4d('0x34')],function(_0x1ce7f8){var _0x14e0a5={};_0x14e0a5[_0x1ce7f8]={'$like':'%'+_0x3b40cd[_0x9d4d('0x32')][_0x9d4d('0x3e')]+'%'};return _0x14e0a5;})});}_0x2ddfdb=_[_0x9d4d('0x3d')]({},_0x2ddfdb,_0x3b40cd[_0x9d4d('0x3f')]);return db[_0x9d4d('0x4c')][_0x9d4d('0x20')]({'where':_0x2ddfdb[_0x9d4d('0x3b')]})[_0x9d4d('0x24')](function(_0x1e6447){_0x6d32a9[_0x9d4d('0x20')]=_0x1e6447;if(_0x3b40cd['query']['includeAll']){_0x2ddfdb[_0x9d4d('0x41')]=[{'all':!![]}];}return db[_0x9d4d('0x4c')][_0x9d4d('0x42')](_0x2ddfdb);})[_0x9d4d('0x24')](function(_0x5afadf){_0x6d32a9['rows']=_0x5afadf;return _0x6d32a9;});}})['then'](respondWithFilteredResult(_0x44b543,_0x2ddfdb))[_0x9d4d('0x44')](handleError(_0x44b543,null));}; \ No newline at end of file +var _0x1e4a=['limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','JscriptySessionReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','getQuestions','findOne','SessionId','JscriptyQuestionReport','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count'];(function(_0x44ef18,_0x1a5d9d){var _0x5e7136=function(_0x28ff9f){while(--_0x28ff9f){_0x44ef18['push'](_0x44ef18['shift']());}};_0x5e7136(++_0x1a5d9d);}(_0x1e4a,0x128));var _0xa1e4=function(_0x3b45e0,_0x391ec4){_0x3b45e0=_0x3b45e0-0x0;var _0x1e4796=_0x1e4a[_0x3b45e0];return _0x1e4796;};'use strict';var emlformat=require(_0xa1e4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa1e4('0x1'));var moment=require(_0xa1e4('0x2'));var BPromise=require(_0xa1e4('0x3'));var Mustache=require(_0xa1e4('0x4'));var util=require(_0xa1e4('0x5'));var path=require(_0xa1e4('0x6'));var sox=require('sox');var csv=require(_0xa1e4('0x7'));var ejs=require(_0xa1e4('0x8'));var fs=require('fs');var fs_extra=require(_0xa1e4('0x9'));var _=require('lodash');var squel=require(_0xa1e4('0xa'));var crypto=require(_0xa1e4('0xb'));var jsforce=require(_0xa1e4('0xc'));var deskjs=require(_0xa1e4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa1e4('0xe'));var Papa=require(_0xa1e4('0xf'));var Redis=require('ioredis');var authService=require(_0xa1e4('0x10'));var qs=require(_0xa1e4('0x11'));var as=require(_0xa1e4('0x12'));var hardwareService=require(_0xa1e4('0x13'));var logger=require('../../config/logger')(_0xa1e4('0x14'));var utils=require(_0xa1e4('0x15'));var config=require(_0xa1e4('0x16'));var licenseUtil=require(_0xa1e4('0x17'));var db=require(_0xa1e4('0x18'))['db'];function respondWithStatusCode(_0x320eee,_0x41538c){_0x41538c=_0x41538c||0xcc;return function(_0x4ef1df){if(_0x4ef1df){return _0x320eee[_0xa1e4('0x19')](_0x41538c);}return _0x320eee[_0xa1e4('0x1a')](_0x41538c)[_0xa1e4('0x1b')]();};}function respondWithResult(_0x187a9d,_0x1f5f51){_0x1f5f51=_0x1f5f51||0xc8;return function(_0x37183a){if(_0x37183a){return _0x187a9d[_0xa1e4('0x1a')](_0x1f5f51)[_0xa1e4('0x1c')](_0x37183a);}};}function respondWithFilteredResult(_0x28e2f2,_0x52b4bc){return function(_0x4f7c6d){if(_0x4f7c6d){var _0x42c57f=typeof _0x52b4bc[_0xa1e4('0x1d')]===_0xa1e4('0x1e')&&typeof _0x52b4bc['limit']===_0xa1e4('0x1e');var _0x25ba62=_0x4f7c6d['count'];var _0x15639f=_0x42c57f?0x0:_0x52b4bc[_0xa1e4('0x1d')];var _0xa9ab92=_0x42c57f?_0x4f7c6d[_0xa1e4('0x1f')]:_0x52b4bc['offset']+_0x52b4bc[_0xa1e4('0x20')];var _0x273b11;if(_0xa9ab92>=_0x25ba62){_0xa9ab92=_0x25ba62;_0x273b11=0xc8;}else{_0x273b11=0xce;}_0x28e2f2[_0xa1e4('0x1a')](_0x273b11);return _0x28e2f2[_0xa1e4('0x21')](_0xa1e4('0x22'),_0x15639f+'-'+_0xa9ab92+'/'+_0x25ba62)[_0xa1e4('0x1c')](_0x4f7c6d);}return null;};}function patchUpdates(_0x3142cc){return function(_0x4cb49){try{jsonpatch[_0xa1e4('0x23')](_0x4cb49,_0x3142cc,!![]);}catch(_0x49649d){return BPromise[_0xa1e4('0x24')](_0x49649d);}return _0x4cb49[_0xa1e4('0x25')]();};}function saveUpdates(_0x2c4ce9,_0x21710d){return function(_0x2bcf96){if(_0x2bcf96){return _0x2bcf96['update'](_0x2c4ce9)[_0xa1e4('0x26')](function(_0x4006cf){return _0x4006cf;});}return null;};}function removeEntity(_0x72ed2,_0x431aa1){return function(_0x30f6fc){if(_0x30f6fc){return _0x30f6fc[_0xa1e4('0x27')]()[_0xa1e4('0x26')](function(){_0x72ed2[_0xa1e4('0x1a')](0xcc)[_0xa1e4('0x1b')]();});}};}function handleEntityNotFound(_0x1bc625,_0x31ccd7){return function(_0x5b4966){if(!_0x5b4966){_0x1bc625[_0xa1e4('0x19')](0x194);}return _0x5b4966;};}function handleError(_0x2cd75c,_0x55abb1){_0x55abb1=_0x55abb1||0x1f4;return function(_0x171adb){logger[_0xa1e4('0x28')](_0x171adb[_0xa1e4('0x29')]);if(_0x171adb[_0xa1e4('0x2a')]){delete _0x171adb['name'];}_0x2cd75c[_0xa1e4('0x1a')](_0x55abb1)[_0xa1e4('0x2b')](_0x171adb);};}exports[_0xa1e4('0x2c')]=function(_0x4ece26,_0x5387a6){var _0x462f16={},_0x5bb47d={},_0x4b8dc7={'count':0x0,'rows':[]};var _0x1d1ee8=_[_0xa1e4('0x2d')](db[_0xa1e4('0x2e')]['rawAttributes'],function(_0x5a8942){return{'name':_0x5a8942[_0xa1e4('0x2f')],'type':_0x5a8942[_0xa1e4('0x30')][_0xa1e4('0x31')]};});_0x5bb47d[_0xa1e4('0x32')]=_[_0xa1e4('0x2d')](_0x1d1ee8,_0xa1e4('0x2a'));_0x5bb47d[_0xa1e4('0x33')]=_[_0xa1e4('0x34')](_0x4ece26[_0xa1e4('0x33')]);_0x5bb47d['filters']=_[_0xa1e4('0x35')](_0x5bb47d[_0xa1e4('0x32')],_0x5bb47d['query']);_0x462f16[_0xa1e4('0x36')]=_[_0xa1e4('0x35')](_0x5bb47d[_0xa1e4('0x32')],qs['fields'](_0x4ece26[_0xa1e4('0x33')][_0xa1e4('0x37')]));_0x462f16[_0xa1e4('0x36')]=_0x462f16[_0xa1e4('0x36')][_0xa1e4('0x38')]?_0x462f16[_0xa1e4('0x36')]:_0x5bb47d[_0xa1e4('0x32')];if(!_0x4ece26[_0xa1e4('0x33')][_0xa1e4('0x39')](_0xa1e4('0x3a'))){_0x462f16[_0xa1e4('0x20')]=qs['limit'](_0x4ece26['query'][_0xa1e4('0x20')]);_0x462f16[_0xa1e4('0x1d')]=qs[_0xa1e4('0x1d')](_0x4ece26[_0xa1e4('0x33')][_0xa1e4('0x1d')]);}_0x462f16['order']=qs[_0xa1e4('0x3b')](_0x4ece26[_0xa1e4('0x33')][_0xa1e4('0x3b')]);_0x462f16[_0xa1e4('0x3c')]=qs[_0xa1e4('0x3d')](_[_0xa1e4('0x3e')](_0x4ece26['query'],_0x5bb47d['filters']),_0x1d1ee8);if(_0x4ece26[_0xa1e4('0x33')][_0xa1e4('0x3f')]){_0x462f16[_0xa1e4('0x3c')]=_[_0xa1e4('0x40')](_0x462f16[_0xa1e4('0x3c')],{'$or':_[_0xa1e4('0x2d')](_0x1d1ee8,function(_0x149934){if(_0x149934['type']!==_0xa1e4('0x41')){var _0x404866={};_0x404866[_0x149934[_0xa1e4('0x2a')]]={'$like':'%'+_0x4ece26[_0xa1e4('0x33')][_0xa1e4('0x3f')]+'%'};return _0x404866;}})});}_0x462f16=_[_0xa1e4('0x40')]({},_0x462f16,_0x4ece26[_0xa1e4('0x42')]);var _0x2dc2cf={'where':_0x462f16[_0xa1e4('0x3c')]};return db[_0xa1e4('0x2e')][_0xa1e4('0x1f')](_0x2dc2cf)[_0xa1e4('0x26')](function(_0x31b546){_0x4b8dc7[_0xa1e4('0x1f')]=_0x31b546;if(_0x4ece26[_0xa1e4('0x33')][_0xa1e4('0x43')]){_0x462f16[_0xa1e4('0x44')]=[{'all':!![]}];}return db[_0xa1e4('0x2e')][_0xa1e4('0x45')](_0x462f16);})[_0xa1e4('0x26')](function(_0x33e9a3){_0x4b8dc7[_0xa1e4('0x46')]=_0x33e9a3;return _0x4b8dc7;})[_0xa1e4('0x26')](respondWithFilteredResult(_0x5387a6,_0x462f16))[_0xa1e4('0x47')](handleError(_0x5387a6,null));};exports['show']=function(_0x32bd14,_0x474536){var _0xb33b0e={'raw':!![],'where':{'id':_0x32bd14[_0xa1e4('0x48')]['id']}},_0x5774c1={};_0x5774c1[_0xa1e4('0x32')]=_[_0xa1e4('0x34')](db['JscriptySessionReport']['rawAttributes']);_0x5774c1[_0xa1e4('0x33')]=_[_0xa1e4('0x34')](_0x32bd14[_0xa1e4('0x33')]);_0x5774c1[_0xa1e4('0x3d')]=_[_0xa1e4('0x35')](_0x5774c1[_0xa1e4('0x32')],_0x5774c1[_0xa1e4('0x33')]);_0xb33b0e[_0xa1e4('0x36')]=_[_0xa1e4('0x35')](_0x5774c1[_0xa1e4('0x32')],qs[_0xa1e4('0x37')](_0x32bd14[_0xa1e4('0x33')][_0xa1e4('0x37')]));_0xb33b0e[_0xa1e4('0x36')]=_0xb33b0e['attributes']['length']?_0xb33b0e['attributes']:_0x5774c1[_0xa1e4('0x32')];if(_0x32bd14[_0xa1e4('0x33')][_0xa1e4('0x43')]){_0xb33b0e[_0xa1e4('0x44')]=[{'all':!![]}];}_0xb33b0e=_[_0xa1e4('0x40')]({},_0xb33b0e,_0x32bd14[_0xa1e4('0x42')]);return db['JscriptySessionReport'][_0xa1e4('0x49')](_0xb33b0e)[_0xa1e4('0x26')](handleEntityNotFound(_0x474536,null))[_0xa1e4('0x26')](respondWithResult(_0x474536,null))[_0xa1e4('0x47')](handleError(_0x474536,null));};exports[_0xa1e4('0x4a')]=function(_0xf91d83,_0x2e6207){return db['JscriptySessionReport'][_0xa1e4('0x4a')](_0xf91d83[_0xa1e4('0x4b')],{})[_0xa1e4('0x26')](respondWithResult(_0x2e6207,0xc9))[_0xa1e4('0x47')](handleError(_0x2e6207,null));};exports[_0xa1e4('0x4c')]=function(_0x54f7fd,_0x3b23cb){if(_0x54f7fd['body']['id']){delete _0x54f7fd[_0xa1e4('0x4b')]['id'];}return db[_0xa1e4('0x2e')][_0xa1e4('0x49')]({'where':{'id':_0x54f7fd[_0xa1e4('0x48')]['id']}})[_0xa1e4('0x26')](handleEntityNotFound(_0x3b23cb,null))[_0xa1e4('0x26')](saveUpdates(_0x54f7fd[_0xa1e4('0x4b')],null))[_0xa1e4('0x26')](respondWithResult(_0x3b23cb,null))[_0xa1e4('0x47')](handleError(_0x3b23cb,null));};exports[_0xa1e4('0x27')]=function(_0x499e49,_0x1461e4){return db[_0xa1e4('0x2e')]['find']({'where':{'id':_0x499e49['params']['id']}})[_0xa1e4('0x26')](handleEntityNotFound(_0x1461e4,null))[_0xa1e4('0x26')](removeEntity(_0x1461e4,null))['catch'](handleError(_0x1461e4,null));};exports['describe']=function(_0x543b1a,_0x401d02){return db['JscriptySessionReport'][_0xa1e4('0x4d')]()[_0xa1e4('0x26')](respondWithResult(_0x401d02,null))[_0xa1e4('0x47')](handleError(_0x401d02,null));};exports[_0xa1e4('0x4e')]=function(_0x2b37a2,_0x5f59ad,_0x47eda4){var _0x4f6c57={'raw':!![],'where':{}};var _0x13f0bd={};var _0x26c8d4={'count':0x0,'rows':[]};return db[_0xa1e4('0x2e')][_0xa1e4('0x4f')]({'where':{'id':_0x2b37a2[_0xa1e4('0x48')]['id']}})[_0xa1e4('0x26')](handleEntityNotFound(_0x5f59ad,null))[_0xa1e4('0x26')](function(_0x9e7a5f){if(_0x9e7a5f){_0x13f0bd[_0xa1e4('0x32')]=_[_0xa1e4('0x34')](db['JscriptyQuestionReport']['rawAttributes']);_0x13f0bd['query']=_[_0xa1e4('0x34')](_0x2b37a2[_0xa1e4('0x33')]);_0x13f0bd[_0xa1e4('0x3d')]=_['intersection'](_0x13f0bd[_0xa1e4('0x32')],_0x13f0bd[_0xa1e4('0x33')]);_0x4f6c57[_0xa1e4('0x36')]=_[_0xa1e4('0x35')](_0x13f0bd[_0xa1e4('0x32')],qs['fields'](_0x2b37a2[_0xa1e4('0x33')]['fields']));_0x4f6c57[_0xa1e4('0x36')]=_0x4f6c57[_0xa1e4('0x36')][_0xa1e4('0x38')]?_0x4f6c57[_0xa1e4('0x36')]:_0x13f0bd['model'];if(!_0x2b37a2[_0xa1e4('0x33')][_0xa1e4('0x39')](_0xa1e4('0x3a'))){_0x4f6c57[_0xa1e4('0x20')]=qs[_0xa1e4('0x20')](_0x2b37a2[_0xa1e4('0x33')]['limit']);_0x4f6c57[_0xa1e4('0x1d')]=qs['offset'](_0x2b37a2[_0xa1e4('0x33')]['offset']);}_0x4f6c57['order']=qs[_0xa1e4('0x3b')](_0x2b37a2[_0xa1e4('0x33')][_0xa1e4('0x3b')]);_0x4f6c57[_0xa1e4('0x3c')]=qs[_0xa1e4('0x3d')](_[_0xa1e4('0x3e')](_0x2b37a2[_0xa1e4('0x33')],_0x13f0bd[_0xa1e4('0x3d')]));_0x4f6c57['where'][_0xa1e4('0x50')]=_0x9e7a5f['id'];if(_0x2b37a2[_0xa1e4('0x33')][_0xa1e4('0x3f')]){_0x4f6c57[_0xa1e4('0x3c')]=_[_0xa1e4('0x40')](_0x4f6c57['where'],{'$or':_[_0xa1e4('0x2d')](_0x4f6c57[_0xa1e4('0x36')],function(_0x8b03f4){var _0x5915a6={};_0x5915a6[_0x8b03f4]={'$like':'%'+_0x2b37a2[_0xa1e4('0x33')][_0xa1e4('0x3f')]+'%'};return _0x5915a6;})});}_0x4f6c57=_['merge']({},_0x4f6c57,_0x2b37a2['options']);return db[_0xa1e4('0x51')][_0xa1e4('0x1f')]({'where':_0x4f6c57[_0xa1e4('0x3c')]})['then'](function(_0x867079){_0x26c8d4[_0xa1e4('0x1f')]=_0x867079;if(_0x2b37a2[_0xa1e4('0x33')]['includeAll']){_0x4f6c57[_0xa1e4('0x44')]=[{'all':!![]}];}return db[_0xa1e4('0x51')][_0xa1e4('0x45')](_0x4f6c57);})[_0xa1e4('0x26')](function(_0x191b22){_0x26c8d4[_0xa1e4('0x46')]=_0x191b22;return _0x26c8d4;});}})['then'](respondWithFilteredResult(_0x5f59ad,_0x4f6c57))[_0xa1e4('0x47')](handleError(_0x5f59ad,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 7da3554..8c8a87c 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 _0xe0ae=['api','bluebird','path','rimraf','./jscriptySessionReport.attributes','define','JscriptySessionReport','report_jscripty_sessions','../../config/logger'];(function(_0x319126,_0x441eb5){var _0x4780aa=function(_0x50beb6){while(--_0x50beb6){_0x319126['push'](_0x319126['shift']());}};_0x4780aa(++_0x441eb5);}(_0xe0ae,0xa1));var _0xee0a=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0xe0ae[_0xdd82b4];return _0x549bb2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xee0a('0x0'))(_0xee0a('0x1'));var moment=require('moment');var BPromise=require(_0xee0a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee0a('0x3'));var rimraf=require(_0xee0a('0x4'));var config=require('../../config/environment');var attributes=require(_0xee0a('0x5'));module['exports']=function(_0x5bef07,_0x39a302){return _0x5bef07[_0xee0a('0x6')](_0xee0a('0x7'),attributes,{'tableName':_0xee0a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c6c=['rimraf','../../config/environment','exports','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x40cd8c,_0x296e01){_0x40cd8c=_0x40cd8c-0x0;var _0x476267=_0x3c6c[_0x40cd8c];return _0x476267;};'use strict';var _=require(_0xc3c6('0x0'));var util=require('util');var logger=require(_0xc3c6('0x1'))(_0xc3c6('0x2'));var moment=require(_0xc3c6('0x3'));var BPromise=require(_0xc3c6('0x4'));var rp=require(_0xc3c6('0x5'));var fs=require('fs');var path=require(_0xc3c6('0x6'));var rimraf=require(_0xc3c6('0x7'));var config=require(_0xc3c6('0x8'));var attributes=require('./jscriptySessionReport.attributes');module[_0xc3c6('0x9')]=function(_0x4a2ca1,_0xe7731e){return _0x4a2ca1['define']('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index e91f730..bacdd2b 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 _0x7278=['debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x9a30bc,_0x2c184b){var _0xd2fa86=function(_0x49fe7b){while(--_0x49fe7b){_0x9a30bc['push'](_0x9a30bc['shift']());}};_0xd2fa86(++_0x2c184b);}(_0x7278,0x161));var _0x8727=function(_0x16295e,_0x2e4976){_0x16295e=_0x16295e-0x0;var _0x4eda03=_0x7278[_0x16295e];return _0x4eda03;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var moment=require(_0x8727('0x2'));var BPromise=require(_0x8727('0x3'));var rs=require(_0x8727('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8727('0x5'))['db'];var utils=require(_0x8727('0x6'));var logger=require(_0x8727('0x7'))(_0x8727('0x8'));var config=require(_0x8727('0x9'));var jayson=require(_0x8727('0xa'));var client=jayson[_0x8727('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfd1902,_0x2f491c,_0xffd783){return new BPromise(function(_0x435911,_0x4160c3){return client['request'](_0xfd1902,_0xffd783)['then'](function(_0x4df6f8){logger[_0x8727('0xc')](_0x8727('0xd'),_0x2f491c,_0x8727('0xe'));logger[_0x8727('0xf')](_0x8727('0x10'),_0x2f491c,_0x8727('0xe'),JSON[_0x8727('0x11')](_0x4df6f8));if(_0x4df6f8[_0x8727('0x12')]){if(_0x4df6f8['error'][_0x8727('0x13')]===0x1f4){logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x4df6f8['error'][_0x8727('0x14')]);return _0x4160c3(_0x4df6f8[_0x8727('0x12')]['message']);}logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x4df6f8[_0x8727('0x12')][_0x8727('0x14')]);return _0x435911(_0x4df6f8[_0x8727('0x12')][_0x8727('0x14')]);}else{logger[_0x8727('0xc')](_0x8727('0xd'),_0x2f491c,_0x8727('0xe'));_0x435911(_0x4df6f8[_0x8727('0x15')]['message']);}})[_0x8727('0x16')](function(_0x1f9538){logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x1f9538);_0x4160c3(_0x1f9538);});});} \ No newline at end of file +var _0x1a37=['rpc','jayson/promise','http','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1d66a0,_0x4cb67e){var _0x520b3d=function(_0x487760){while(--_0x487760){_0x1d66a0['push'](_0x1d66a0['shift']());}};_0x520b3d(++_0x4cb67e);}(_0x1a37,0xb4));var _0x71a3=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x1a37[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45050a,_0x231ea7,_0x2bb6a2){return new BPromise(function(_0x4a9ab2,_0x53b893){return client['request'](_0x45050a,_0x2bb6a2)['then'](function(_0x89da86){logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,_0x71a3('0xe'));logger[_0x71a3('0xf')](_0x71a3('0x10'),_0x231ea7,_0x71a3('0xe'),JSON[_0x71a3('0x11')](_0x89da86));if(_0x89da86['error']){if(_0x89da86['error']['code']===0x1f4){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x53b893(_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);}logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x4a9ab2(_0x89da86[_0x71a3('0x12')]['message']);}else{logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,'request\x20sent');_0x4a9ab2(_0x89da86['result'][_0x71a3('0x13')]);}})[_0x71a3('0x14')](function(_0xee797f){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0xee797f);_0x53b893(_0xee797f);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 43f3252..4ebdf95 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 _0x1aa6=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','put','/:id','isAuthenticated','downloadLogFile','exports','multer','util','path'];(function(_0x58efa6,_0x2c00bd){var _0x5d643c=function(_0x1d1ef2){while(--_0x1d1ef2){_0x58efa6['push'](_0x58efa6['shift']());}};_0x5d643c(++_0x2c00bd);}(_0x1aa6,0xb1));var _0x61aa=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x1aa6[_0x31b5a5];return _0x364cc9;};'use strict';var multer=require(_0x61aa('0x0'));var util=require(_0x61aa('0x1'));var path=require(_0x61aa('0x2'));var timeout=require(_0x61aa('0x3'));var express=require('express');var router=express[_0x61aa('0x4')]();var fs_extra=require(_0x61aa('0x5'));var auth=require(_0x61aa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x61aa('0x7'));var controller=require('./license.controller');router[_0x61aa('0x8')]('/',controller[_0x61aa('0x9')]);router[_0x61aa('0xa')](_0x61aa('0xb'),auth[_0x61aa('0xc')](),controller['update']);router[_0x61aa('0x8')]('/download_log_file',auth[_0x61aa('0xc')](),controller[_0x61aa('0xd')]);module[_0x61aa('0xe')]=router; \ No newline at end of file +var _0x4252=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','update','downloadLogFile'];(function(_0x395c52,_0x2ae6fc){var _0x51bd69=function(_0x17a686){while(--_0x17a686){_0x395c52['push'](_0x395c52['shift']());}};_0x51bd69(++_0x2ae6fc);}(_0x4252,0x181));var _0x2425=function(_0x55f95f,_0x1d1348){_0x55f95f=_0x55f95f-0x0;var _0x9bc8b4=_0x4252[_0x55f95f];return _0x9bc8b4;};'use strict';var multer=require(_0x2425('0x0'));var util=require(_0x2425('0x1'));var path=require(_0x2425('0x2'));var timeout=require('connect-timeout');var express=require(_0x2425('0x3'));var router=express[_0x2425('0x4')]();var fs_extra=require(_0x2425('0x5'));var auth=require(_0x2425('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2425('0x7'));var controller=require(_0x2425('0x8'));router[_0x2425('0x9')]('/',controller[_0x2425('0xa')]);router['put'](_0x2425('0xb'),auth[_0x2425('0xc')](),controller[_0x2425('0xd')]);router[_0x2425('0x9')]('/download_log_file',auth[_0x2425('0xc')](),controller[_0x2425('0xe')]);module[_0x2425('0xf')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 393de2a..e67f0ff 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 _0xed7e=['INTEGER','sequelize','STRING'];(function(_0x498fcb,_0x523e7f){var _0x2ec43e=function(_0x195c89){while(--_0x195c89){_0x498fcb['push'](_0x498fcb['shift']());}};_0x2ec43e(++_0x523e7f);}(_0xed7e,0x11b));var _0xeed7=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xed7e[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0xeed7('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xeed7('0x1')]},'data2':{'type':Sequelize[_0xeed7('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xeed7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdda4=['INTEGER','sequelize','TEXT','STRING'];(function(_0x3b7ab6,_0xc32870){var _0x2a535a=function(_0x2ef4ad){while(--_0x2ef4ad){_0x3b7ab6['push'](_0x3b7ab6['shift']());}};_0x2a535a(++_0xc32870);}(_0xdda4,0x125));var _0x4dda=function(_0x2d2258,_0x2ce510){_0x2d2258=_0x2d2258-0x0;var _0x18e155=_0xdda4[_0x2d2258];return _0x18e155;};'use strict';var Sequelize=require(_0x4dda('0x0'));module['exports']={'license':{'type':Sequelize[_0x4dda('0x1')]},'data1':{'type':Sequelize[_0x4dda('0x2')]},'data2':{'type':Sequelize[_0x4dda('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x4dda('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index c2ef682..1c0d484 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 _0xbd1a=['apply','save','update','destroy','then','error','name','model','keys','License','rawAttributes','query','attributes','fields','options','getLicense','body','find','params','checkLicense','key','demo','catch','license-info.log','join','/var','log','text/plain','download','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xbd1a,0xda));var _0xabd1=function(_0x427128,_0x2d017a){_0x427128=_0x427128-0x0;var _0x2f51c6=_0xbd1a[_0x427128];return _0x2f51c6;};'use strict';var emlformat=require(_0xabd1('0x0'));var rimraf=require(_0xabd1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xabd1('0x2'));var rp=require(_0xabd1('0x3'));var moment=require(_0xabd1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xabd1('0x5'));var path=require(_0xabd1('0x6'));var sox=require('sox');var csv=require(_0xabd1('0x7'));var ejs=require(_0xabd1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xabd1('0x9'));var squel=require(_0xabd1('0xa'));var crypto=require(_0xabd1('0xb'));var jsforce=require(_0xabd1('0xc'));var deskjs=require(_0xabd1('0xd'));var toCsv=require(_0xabd1('0x7'));var querystring=require(_0xabd1('0xe'));var Papa=require(_0xabd1('0xf'));var Redis=require(_0xabd1('0x10'));var authService=require(_0xabd1('0x11'));var qs=require(_0xabd1('0x12'));var as=require(_0xabd1('0x13'));var hardwareService=require(_0xabd1('0x14'));var logger=require(_0xabd1('0x15'))('api');var utils=require(_0xabd1('0x16'));var config=require(_0xabd1('0x17'));var licenseUtil=require(_0xabd1('0x18'));var db=require(_0xabd1('0x19'))['db'];function respondWithStatusCode(_0x2f1b3f,_0x4ad7fd){_0x4ad7fd=_0x4ad7fd||0xcc;return function(_0x290387){if(_0x290387){return _0x2f1b3f[_0xabd1('0x1a')](_0x4ad7fd);}return _0x2f1b3f[_0xabd1('0x1b')](_0x4ad7fd)[_0xabd1('0x1c')]();};}function respondWithResult(_0x35c214,_0x11b482){_0x11b482=_0x11b482||0xc8;return function(_0x2c8a65){if(_0x2c8a65){return _0x35c214[_0xabd1('0x1b')](_0x11b482)[_0xabd1('0x1d')](_0x2c8a65);}};}function respondWithFilteredResult(_0x5eadf0,_0x531491){return function(_0x25a172){if(_0x25a172){var _0x20da41=typeof _0x531491[_0xabd1('0x1e')]===_0xabd1('0x1f')&&typeof _0x531491[_0xabd1('0x20')]===_0xabd1('0x1f');var _0x48ce7b=_0x25a172[_0xabd1('0x21')];var _0x3a2fe2=_0x20da41?0x0:_0x531491['offset'];var _0x478376=_0x20da41?_0x25a172[_0xabd1('0x21')]:_0x531491[_0xabd1('0x1e')]+_0x531491['limit'];var _0x3aca73;if(_0x478376>=_0x48ce7b){_0x478376=_0x48ce7b;_0x3aca73=0xc8;}else{_0x3aca73=0xce;}_0x5eadf0[_0xabd1('0x1b')](_0x3aca73);return _0x5eadf0['set']('Content-Range',_0x3a2fe2+'-'+_0x478376+'/'+_0x48ce7b)[_0xabd1('0x1d')](_0x25a172);}return null;};}function patchUpdates(_0x5a080c){return function(_0x500299){try{jsonpatch[_0xabd1('0x22')](_0x500299,_0x5a080c,!![]);}catch(_0x12e0bc){return BPromise['reject'](_0x12e0bc);}return _0x500299[_0xabd1('0x23')]();};}function saveUpdates(_0x4751e8,_0x4ff1e4){return function(_0x3e462a){if(_0x3e462a){return _0x3e462a[_0xabd1('0x24')](_0x4751e8)['then'](function(_0x5340d1){return _0x5340d1;});}return null;};}function removeEntity(_0x5c483d,_0x389f04){return function(_0x53fde1){if(_0x53fde1){return _0x53fde1[_0xabd1('0x25')]()[_0xabd1('0x26')](function(){_0x5c483d[_0xabd1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d5ea5,_0x415c1e){return function(_0x3d8d9c){if(!_0x3d8d9c){_0x1d5ea5[_0xabd1('0x1a')](0x194);}return _0x3d8d9c;};}function handleError(_0x22738c,_0x180344){_0x180344=_0x180344||0x1f4;return function(_0x4adbf1){logger[_0xabd1('0x27')](_0x4adbf1['stack']);if(_0x4adbf1['name']){delete _0x4adbf1[_0xabd1('0x28')];}_0x22738c[_0xabd1('0x1b')](_0x180344)['send'](_0x4adbf1);};}var utilLicense=require(_0xabd1('0x18'));exports['index']=function(_0x150ac1,_0x3def39){var _0x21c8d3={'raw':!![],'where':{'id':0x1}},_0x3dbfe9={};_0x3dbfe9[_0xabd1('0x29')]=_[_0xabd1('0x2a')](db[_0xabd1('0x2b')][_0xabd1('0x2c')]);_0x3dbfe9['query']=_[_0xabd1('0x2a')](_0x150ac1[_0xabd1('0x2d')]);_0x3dbfe9['filters']=_['intersection'](_0x3dbfe9[_0xabd1('0x29')],_0x3dbfe9['query']);_0x21c8d3[_0xabd1('0x2e')]=_['intersection'](_0x3dbfe9[_0xabd1('0x29')],qs[_0xabd1('0x2f')](_0x150ac1['query']['fields']));_0x21c8d3['attributes']=_0x21c8d3[_0xabd1('0x2e')]['length']?_0x21c8d3[_0xabd1('0x2e')]:_0x3dbfe9[_0xabd1('0x29')];_0x21c8d3=_['merge']({},_0x21c8d3,_0x150ac1[_0xabd1('0x30')]);return utilLicense[_0xabd1('0x31')](_0x21c8d3)[_0xabd1('0x26')](respondWithResult(_0x3def39,null))['catch'](handleError(_0x3def39,null));};exports[_0xabd1('0x24')]=function(_0x2b77d6,_0x2c0776){if(_0x2b77d6['body']['id']){delete _0x2b77d6[_0xabd1('0x32')]['id'];}return db['License'][_0xabd1('0x33')]({'where':{'id':_0x2b77d6[_0xabd1('0x34')]['id']}})[_0xabd1('0x26')](handleEntityNotFound(_0x2c0776,null))[_0xabd1('0x26')](function(_0x249a52){var _0x376d6b=_0x249a52['get']({'plain':!![]});return utilLicense[_0xabd1('0x35')](_0x376d6b,_0x2b77d6[_0xabd1('0x32')][_0xabd1('0x36')]);})['then'](function(_0x2ddff1){if(!_0x2ddff1[_0xabd1('0x37')]){return saveUpdates(_0x2b77d6[_0xabd1('0x32')],null);}return _0x2ddff1;})['then'](respondWithResult(_0x2c0776,null))[_0xabd1('0x38')](handleError(_0x2c0776,null));};exports['downloadLogFile']=function(_0x1ddcb7,_0x3a8569){var _0x30b8c4=_0xabd1('0x39');var _0xe8c9cc=path[_0xabd1('0x3a')](_0xabd1('0x3b'),_0xabd1('0x3c'),'xcally',_0x30b8c4);_0x3a8569['setHeader']('Content-disposition','attachment;\x20filename='+_0x30b8c4);_0x3a8569['set']('Content-Type',_0xabd1('0x3d'));_0x3a8569[_0xabd1('0x3e')](_0xe8c9cc);}; \ No newline at end of file +var _0xcb42=['json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','index','keys','rawAttributes','query','filters','intersection','attributes','model','length','merge','options','getLicense','body','License','find','get','checkLicense','catch','downloadLogFile','license-info.log','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','end','status'];(function(_0x5c66a6,_0x14547e){var _0x1d4206=function(_0x5c11e9){while(--_0x5c11e9){_0x5c66a6['push'](_0x5c66a6['shift']());}};_0x1d4206(++_0x14547e);}(_0xcb42,0xf2));var _0x2cb4=function(_0x332632,_0xf7ad49){_0x332632=_0x332632-0x0;var _0x199ffb=_0xcb42[_0x332632];return _0x199ffb;};'use strict';var emlformat=require(_0x2cb4('0x0'));var rimraf=require(_0x2cb4('0x1'));var zipdir=require(_0x2cb4('0x2'));var jsonpatch=require(_0x2cb4('0x3'));var rp=require(_0x2cb4('0x4'));var moment=require(_0x2cb4('0x5'));var BPromise=require(_0x2cb4('0x6'));var Mustache=require(_0x2cb4('0x7'));var util=require('util');var path=require(_0x2cb4('0x8'));var sox=require(_0x2cb4('0x9'));var csv=require(_0x2cb4('0xa'));var ejs=require(_0x2cb4('0xb'));var fs=require('fs');var fs_extra=require(_0x2cb4('0xc'));var _=require('lodash');var squel=require(_0x2cb4('0xd'));var crypto=require(_0x2cb4('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2cb4('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2cb4('0xf'));var authService=require(_0x2cb4('0x10'));var qs=require(_0x2cb4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2cb4('0x12'));var config=require(_0x2cb4('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b5724,_0x80f74c){_0x80f74c=_0x80f74c||0xcc;return function(_0x1ba126){if(_0x1ba126){return _0x3b5724['sendStatus'](_0x80f74c);}return _0x3b5724['status'](_0x80f74c)[_0x2cb4('0x14')]();};}function respondWithResult(_0xda083c,_0x2181c7){_0x2181c7=_0x2181c7||0xc8;return function(_0x139b11){if(_0x139b11){return _0xda083c[_0x2cb4('0x15')](_0x2181c7)[_0x2cb4('0x16')](_0x139b11);}};}function respondWithFilteredResult(_0x26c153,_0x40d22c){return function(_0x1d1ff8){if(_0x1d1ff8){var _0x42c788=typeof _0x40d22c[_0x2cb4('0x17')]==='undefined'&&typeof _0x40d22c[_0x2cb4('0x18')]===_0x2cb4('0x19');var _0x3bf19b=_0x1d1ff8['count'];var _0x52246a=_0x42c788?0x0:_0x40d22c['offset'];var _0x43dc38=_0x42c788?_0x1d1ff8[_0x2cb4('0x1a')]:_0x40d22c[_0x2cb4('0x17')]+_0x40d22c[_0x2cb4('0x18')];var _0x1f5eca;if(_0x43dc38>=_0x3bf19b){_0x43dc38=_0x3bf19b;_0x1f5eca=0xc8;}else{_0x1f5eca=0xce;}_0x26c153[_0x2cb4('0x15')](_0x1f5eca);return _0x26c153[_0x2cb4('0x1b')]('Content-Range',_0x52246a+'-'+_0x43dc38+'/'+_0x3bf19b)[_0x2cb4('0x16')](_0x1d1ff8);}return null;};}function patchUpdates(_0x383e39){return function(_0x98f9aa){try{jsonpatch[_0x2cb4('0x1c')](_0x98f9aa,_0x383e39,!![]);}catch(_0x203a49){return BPromise[_0x2cb4('0x1d')](_0x203a49);}return _0x98f9aa[_0x2cb4('0x1e')]();};}function saveUpdates(_0x1dbf35,_0xb34bba){return function(_0x551580){if(_0x551580){return _0x551580[_0x2cb4('0x1f')](_0x1dbf35)['then'](function(_0x4bbe7f){return _0x4bbe7f;});}return null;};}function removeEntity(_0x4f7784,_0x46ddfc){return function(_0x302215){if(_0x302215){return _0x302215[_0x2cb4('0x20')]()[_0x2cb4('0x21')](function(){_0x4f7784[_0x2cb4('0x15')](0xcc)[_0x2cb4('0x14')]();});}};}function handleEntityNotFound(_0x2780b9,_0x72b0cf){return function(_0x4271bb){if(!_0x4271bb){_0x2780b9[_0x2cb4('0x22')](0x194);}return _0x4271bb;};}function handleError(_0x196a91,_0x2e1011){_0x2e1011=_0x2e1011||0x1f4;return function(_0x49bf6b){logger[_0x2cb4('0x23')](_0x49bf6b[_0x2cb4('0x24')]);if(_0x49bf6b['name']){delete _0x49bf6b['name'];}_0x196a91[_0x2cb4('0x15')](_0x2e1011)['send'](_0x49bf6b);};}var utilLicense=require('../../config/license/util');exports[_0x2cb4('0x25')]=function(_0x3b252e,_0x10ca12){var _0x22cff1={'raw':!![],'where':{'id':0x1}},_0x5fca51={};_0x5fca51['model']=_[_0x2cb4('0x26')](db['License'][_0x2cb4('0x27')]);_0x5fca51['query']=_[_0x2cb4('0x26')](_0x3b252e[_0x2cb4('0x28')]);_0x5fca51[_0x2cb4('0x29')]=_[_0x2cb4('0x2a')](_0x5fca51['model'],_0x5fca51[_0x2cb4('0x28')]);_0x22cff1[_0x2cb4('0x2b')]=_[_0x2cb4('0x2a')](_0x5fca51[_0x2cb4('0x2c')],qs['fields'](_0x3b252e[_0x2cb4('0x28')]['fields']));_0x22cff1['attributes']=_0x22cff1[_0x2cb4('0x2b')][_0x2cb4('0x2d')]?_0x22cff1[_0x2cb4('0x2b')]:_0x5fca51['model'];_0x22cff1=_[_0x2cb4('0x2e')]({},_0x22cff1,_0x3b252e[_0x2cb4('0x2f')]);return utilLicense[_0x2cb4('0x30')](_0x22cff1)['then'](respondWithResult(_0x10ca12,null))['catch'](handleError(_0x10ca12,null));};exports[_0x2cb4('0x1f')]=function(_0x4994fd,_0x5a6109){if(_0x4994fd[_0x2cb4('0x31')]['id']){delete _0x4994fd[_0x2cb4('0x31')]['id'];}return db[_0x2cb4('0x32')][_0x2cb4('0x33')]({'where':{'id':_0x4994fd['params']['id']}})[_0x2cb4('0x21')](handleEntityNotFound(_0x5a6109,null))[_0x2cb4('0x21')](function(_0x251edc){var _0x3a042d=_0x251edc[_0x2cb4('0x34')]({'plain':!![]});return utilLicense[_0x2cb4('0x35')](_0x3a042d,_0x4994fd['body']['key']);})[_0x2cb4('0x21')](function(_0x482a08){if(!_0x482a08['demo']){return saveUpdates(_0x4994fd[_0x2cb4('0x31')],null);}return _0x482a08;})[_0x2cb4('0x21')](respondWithResult(_0x5a6109,null))[_0x2cb4('0x36')](handleError(_0x5a6109,null));};exports[_0x2cb4('0x37')]=function(_0x19306b,_0x17879e){var _0x3e5541=_0x2cb4('0x38');var _0x43b34e=path['join'](_0x2cb4('0x39'),_0x2cb4('0x3a'),_0x2cb4('0x3b'),_0x3e5541);_0x17879e[_0x2cb4('0x3c')](_0x2cb4('0x3d'),_0x2cb4('0x3e')+_0x3e5541);_0x17879e['set'](_0x2cb4('0x3f'),_0x2cb4('0x40'));_0x17879e[_0x2cb4('0x41')](_0x43b34e);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 5f80d68..f13213e 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 _0x74b5=['request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','lodash','util','../../config/logger','bluebird'];(function(_0xf734c7,_0x2dc079){var _0xea90c6=function(_0x466755){while(--_0x466755){_0xf734c7['push'](_0xf734c7['shift']());}};_0xea90c6(++_0x2dc079);}(_0x74b5,0x1d0));var _0x574b=function(_0x4bbd88,_0x342d64){_0x4bbd88=_0x4bbd88-0x0;var _0x9843e=_0x74b5[_0x4bbd88];return _0x9843e;};'use strict';var _=require(_0x574b('0x0'));var util=require(_0x574b('0x1'));var logger=require(_0x574b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x574b('0x3'));var rp=require(_0x574b('0x4'));var fs=require('fs');var path=require(_0x574b('0x5'));var rimraf=require(_0x574b('0x6'));var config=require(_0x574b('0x7'));var attributes=require(_0x574b('0x8'));module[_0x574b('0x9')]=function(_0x1ec540,_0x23253){return _0x1ec540[_0x574b('0xa')](_0x574b('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3e2=['moment','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','util','../../config/logger','api'];(function(_0x532a1,_0x54f5e1){var _0x553a6a=function(_0x88332a){while(--_0x88332a){_0x532a1['push'](_0x532a1['shift']());}};_0x553a6a(++_0x54f5e1);}(_0xa3e2,0x75));var _0x2a3e=function(_0x4cb231,_0x3d3c5b){_0x4cb231=_0x4cb231-0x0;var _0x4d5063=_0xa3e2[_0x4cb231];return _0x4d5063;};'use strict';var _=require('lodash');var util=require(_0x2a3e('0x0'));var logger=require(_0x2a3e('0x1'))(_0x2a3e('0x2'));var moment=require(_0x2a3e('0x3'));var BPromise=require(_0x2a3e('0x4'));var rp=require(_0x2a3e('0x5'));var fs=require('fs');var path=require(_0x2a3e('0x6'));var rimraf=require('rimraf');var config=require(_0x2a3e('0x7'));var attributes=require(_0x2a3e('0x8'));module[_0x2a3e('0x9')]=function(_0x354493,_0x3c48a2){return _0x354493['define']('License',attributes,{'tableName':'license','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 890e240..d142e14 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 _0xa8e1=['rpc','jayson/promise','http','request','then','info','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x6ef3b6,_0x5628b3){var _0x4dd8db=function(_0x4a565d){while(--_0x4a565d){_0x6ef3b6['push'](_0x6ef3b6['shift']());}};_0x4dd8db(++_0x5628b3);}(_0xa8e1,0x197));var _0x1a8e=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0xa8e1[_0x3b5049];return _0x12454e;};'use strict';var _=require(_0x1a8e('0x0'));var util=require(_0x1a8e('0x1'));var moment=require('moment');var BPromise=require(_0x1a8e('0x2'));var rs=require(_0x1a8e('0x3'));var fs=require('fs');var Redis=require(_0x1a8e('0x4'));var db=require(_0x1a8e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a8e('0x6'))(_0x1a8e('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a8e('0x8'));var client=jayson['client'][_0x1a8e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29db0e,_0x25c742,_0x2f836e){return new BPromise(function(_0x3b7af7,_0x54233f){return client[_0x1a8e('0xa')](_0x29db0e,_0x2f836e)[_0x1a8e('0xb')](function(_0x3c5698){logger[_0x1a8e('0xc')]('License,\x20%s,\x20%s',_0x25c742,'request\x20sent');logger[_0x1a8e('0xd')](_0x1a8e('0xe'),_0x25c742,_0x1a8e('0xf'),JSON[_0x1a8e('0x10')](_0x3c5698));if(_0x3c5698[_0x1a8e('0x11')]){if(_0x3c5698['error'][_0x1a8e('0x12')]===0x1f4){logger[_0x1a8e('0x11')](_0x1a8e('0x13'),_0x25c742,_0x3c5698['error'][_0x1a8e('0x14')]);return _0x54233f(_0x3c5698['error'][_0x1a8e('0x14')]);}logger[_0x1a8e('0x11')](_0x1a8e('0x13'),_0x25c742,_0x3c5698[_0x1a8e('0x11')][_0x1a8e('0x14')]);return _0x3b7af7(_0x3c5698[_0x1a8e('0x11')][_0x1a8e('0x14')]);}else{logger[_0x1a8e('0xc')](_0x1a8e('0x13'),_0x25c742,_0x1a8e('0xf'));_0x3b7af7(_0x3c5698[_0x1a8e('0x15')][_0x1a8e('0x14')]);}})[_0x1a8e('0x16')](function(_0x5d9793){logger['error']('License,\x20%s,\x20%s',_0x25c742,_0x5d9793);_0x54233f(_0x5d9793);});});} \ No newline at end of file +var _0x18d7=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch'];(function(_0x11f31f,_0x9e6e07){var _0x4fbeee=function(_0x3485e1){while(--_0x3485e1){_0x11f31f['push'](_0x11f31f['shift']());}};_0x4fbeee(++_0x9e6e07);}(_0x18d7,0xcf));var _0x718d=function(_0xf23ae0,_0x13041f){_0xf23ae0=_0xf23ae0-0x0;var _0x441c81=_0x18d7[_0xf23ae0];return _0x441c81;};'use strict';var _=require(_0x718d('0x0'));var util=require(_0x718d('0x1'));var moment=require(_0x718d('0x2'));var BPromise=require(_0x718d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x718d('0x4'));var db=require(_0x718d('0x5'))['db'];var utils=require(_0x718d('0x6'));var logger=require(_0x718d('0x7'))(_0x718d('0x8'));var config=require(_0x718d('0x9'));var jayson=require(_0x718d('0xa'));var client=jayson[_0x718d('0xb')][_0x718d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a8139,_0x843057,_0x2c7ecb){return new BPromise(function(_0x375644,_0x798eb7){return client[_0x718d('0xd')](_0x1a8139,_0x2c7ecb)[_0x718d('0xe')](function(_0xa495de){logger[_0x718d('0xf')](_0x718d('0x10'),_0x843057,'request\x20sent');logger['debug'](_0x718d('0x11'),_0x843057,_0x718d('0x12'),JSON[_0x718d('0x13')](_0xa495de));if(_0xa495de[_0x718d('0x14')]){if(_0xa495de[_0x718d('0x14')]['code']===0x1f4){logger[_0x718d('0x14')]('License,\x20%s,\x20%s',_0x843057,_0xa495de[_0x718d('0x14')]['message']);return _0x798eb7(_0xa495de[_0x718d('0x14')][_0x718d('0x15')]);}logger[_0x718d('0x14')](_0x718d('0x10'),_0x843057,_0xa495de[_0x718d('0x14')][_0x718d('0x15')]);return _0x375644(_0xa495de[_0x718d('0x14')][_0x718d('0x15')]);}else{logger[_0x718d('0xf')](_0x718d('0x10'),_0x843057,_0x718d('0x12'));_0x375644(_0xa495de['result'][_0x718d('0x15')]);}})[_0x718d('0x16')](function(_0x3a5424){logger[_0x718d('0x14')](_0x718d('0x10'),_0x843057,_0x3a5424);_0x798eb7(_0x3a5424);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 0008dc6..e99f1ab 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 _0xbee7=['/:id/messages','getMessages','/:id/verify','getAgents','post','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','/:id/applications','addApplications','/:id/send','send','/:id/users','addAgents','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','/:id/interactions','getInteractions','getApplications'];(function(_0xe41517,_0x18e3d8){var _0x4be606=function(_0x3ee30f){while(--_0x3ee30f){_0xe41517['push'](_0xe41517['shift']());}};_0x4be606(++_0x18e3d8);}(_0xbee7,0x133));var _0x7bee=function(_0x479850,_0x57d01b){_0x479850=_0x479850-0x0;var _0x6b2354=_0xbee7[_0x479850];return _0x6b2354;};'use strict';var multer=require('multer');var util=require(_0x7bee('0x0'));var path=require(_0x7bee('0x1'));var timeout=require(_0x7bee('0x2'));var express=require(_0x7bee('0x3'));var router=express[_0x7bee('0x4')]();var fs_extra=require(_0x7bee('0x5'));var auth=require(_0x7bee('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7bee('0x7'));var controller=require(_0x7bee('0x8'));router[_0x7bee('0x9')]('/',auth[_0x7bee('0xa')](),controller[_0x7bee('0xb')]);router['get']('/describe',auth[_0x7bee('0xa')](),controller['describe']);router['get'](_0x7bee('0xc'),auth[_0x7bee('0xa')](),controller['show']);router[_0x7bee('0x9')](_0x7bee('0xd'),auth[_0x7bee('0xa')](),controller[_0x7bee('0xe')]);router[_0x7bee('0x9')](_0x7bee('0xf'),auth[_0x7bee('0xa')](),controller[_0x7bee('0x10')]);router[_0x7bee('0x9')]('/:id/in_servers',auth[_0x7bee('0xa')](),controller[_0x7bee('0x11')]);router[_0x7bee('0x9')](_0x7bee('0x12'),auth[_0x7bee('0xa')](),controller['getSmtp']);router[_0x7bee('0x9')](_0x7bee('0x13'),auth['isAuthenticated'](),controller[_0x7bee('0x14')]);router[_0x7bee('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7bee('0x15')]);router['get'](_0x7bee('0x16'),auth[_0x7bee('0xa')](),controller[_0x7bee('0x17')]);router[_0x7bee('0x9')](_0x7bee('0x18'),auth['isAuthenticated'](),controller['verifySmtp']);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x7bee('0x19')]);router[_0x7bee('0x1a')](_0x7bee('0xd'),auth[_0x7bee('0xa')](),controller['addDisposition']);router[_0x7bee('0x1a')]('/:id/canned_answers',auth[_0x7bee('0xa')](),controller[_0x7bee('0x1b')]);router[_0x7bee('0x1a')]('/',auth[_0x7bee('0xa')](),controller[_0x7bee('0x1c')]);router[_0x7bee('0x1a')](_0x7bee('0x1d'),auth[_0x7bee('0xa')](),controller[_0x7bee('0x1e')]);router['post'](_0x7bee('0x12'),auth['isAuthenticated'](),controller[_0x7bee('0x1f')]);router[_0x7bee('0x1a')](_0x7bee('0x13'),auth['isAuthenticated'](),controller[_0x7bee('0x20')]);router[_0x7bee('0x1a')](_0x7bee('0x21'),auth[_0x7bee('0xa')](),controller[_0x7bee('0x22')]);router[_0x7bee('0x1a')](_0x7bee('0x23'),auth[_0x7bee('0xa')](),controller[_0x7bee('0x24')]);router['post'](_0x7bee('0x25'),auth[_0x7bee('0xa')](),controller[_0x7bee('0x26')]);router['put'](_0x7bee('0xc'),auth[_0x7bee('0xa')](),controller['update']);router[_0x7bee('0x27')](_0x7bee('0xd'),auth[_0x7bee('0xa')](),controller[_0x7bee('0x28')]);router[_0x7bee('0x27')](_0x7bee('0xf'),auth[_0x7bee('0xa')](),controller[_0x7bee('0x29')]);router['delete']('/:id/in_servers',auth[_0x7bee('0xa')](),controller[_0x7bee('0x2a')]);router['delete'](_0x7bee('0x12'),auth[_0x7bee('0xa')](),controller[_0x7bee('0x2b')]);router[_0x7bee('0x27')](_0x7bee('0xc'),auth['isAuthenticated'](),controller[_0x7bee('0x2c')]);router[_0x7bee('0x27')](_0x7bee('0x25'),auth[_0x7bee('0xa')](),controller[_0x7bee('0x2d')]);module[_0x7bee('0x2e')]=router; \ No newline at end of file +var _0xb7af=['getImap','/:id/out_servers','/:id/interactions','getInteractions','getApplications','getMessages','/:id/verify','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','/:id/in_servers','addImap','addInteraction','/:id/applications','addApplications','/:id/send','send','/:id/users','put','delete','removeImap','removeSmtp','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers'];(function(_0x5e14be,_0xd66f29){var _0x38bc41=function(_0x9e0155){while(--_0x9e0155){_0x5e14be['push'](_0x5e14be['shift']());}};_0x38bc41(++_0xd66f29);}(_0xb7af,0x1d0));var _0xfb7a=function(_0x458363,_0x1675db){_0x458363=_0x458363-0x0;var _0x4d0290=_0xb7af[_0x458363];return _0x4d0290;};'use strict';var multer=require(_0xfb7a('0x0'));var util=require(_0xfb7a('0x1'));var path=require(_0xfb7a('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb7a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfb7a('0x4'));var interaction=require(_0xfb7a('0x5'));var config=require(_0xfb7a('0x6'));var controller=require('./mailAccount.controller');router[_0xfb7a('0x7')]('/',auth[_0xfb7a('0x8')](),controller[_0xfb7a('0x9')]);router['get']('/describe',auth[_0xfb7a('0x8')](),controller[_0xfb7a('0xa')]);router[_0xfb7a('0x7')](_0xfb7a('0xb'),auth['isAuthenticated'](),controller[_0xfb7a('0xc')]);router['get'](_0xfb7a('0xd'),auth[_0xfb7a('0x8')](),controller[_0xfb7a('0xe')]);router[_0xfb7a('0x7')]('/:id/canned_answers',auth[_0xfb7a('0x8')](),controller[_0xfb7a('0xf')]);router[_0xfb7a('0x7')]('/:id/in_servers',auth[_0xfb7a('0x8')](),controller[_0xfb7a('0x10')]);router[_0xfb7a('0x7')](_0xfb7a('0x11'),auth[_0xfb7a('0x8')](),controller['getSmtp']);router[_0xfb7a('0x7')](_0xfb7a('0x12'),auth['isAuthenticated'](),controller[_0xfb7a('0x13')]);router['get']('/:id/applications',auth[_0xfb7a('0x8')](),controller[_0xfb7a('0x14')]);router[_0xfb7a('0x7')]('/:id/messages',auth[_0xfb7a('0x8')](),controller[_0xfb7a('0x15')]);router[_0xfb7a('0x7')](_0xfb7a('0x16'),auth[_0xfb7a('0x8')](),controller['verifySmtp']);router[_0xfb7a('0x7')]('/:id/users',auth[_0xfb7a('0x8')](),controller[_0xfb7a('0x17')]);router[_0xfb7a('0x18')](_0xfb7a('0xd'),auth[_0xfb7a('0x8')](),controller[_0xfb7a('0x19')]);router[_0xfb7a('0x18')](_0xfb7a('0x1a'),auth[_0xfb7a('0x8')](),controller[_0xfb7a('0x1b')]);router[_0xfb7a('0x18')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xfb7a('0x1c'),auth[_0xfb7a('0x8')](),controller[_0xfb7a('0x1d')]);router[_0xfb7a('0x18')](_0xfb7a('0x11'),auth[_0xfb7a('0x8')](),controller['addSmtp']);router[_0xfb7a('0x18')](_0xfb7a('0x12'),auth[_0xfb7a('0x8')](),controller[_0xfb7a('0x1e')]);router[_0xfb7a('0x18')](_0xfb7a('0x1f'),auth[_0xfb7a('0x8')](),controller[_0xfb7a('0x20')]);router[_0xfb7a('0x18')](_0xfb7a('0x21'),auth[_0xfb7a('0x8')](),controller[_0xfb7a('0x22')]);router[_0xfb7a('0x18')](_0xfb7a('0x23'),auth['isAuthenticated'](),controller['addAgents']);router[_0xfb7a('0x24')](_0xfb7a('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id/dispositions',auth[_0xfb7a('0x8')](),controller['removeDispositions']);router[_0xfb7a('0x25')](_0xfb7a('0x1a'),auth[_0xfb7a('0x8')](),controller['removeAnswers']);router[_0xfb7a('0x25')](_0xfb7a('0x1c'),auth['isAuthenticated'](),controller[_0xfb7a('0x26')]);router[_0xfb7a('0x25')](_0xfb7a('0x11'),auth[_0xfb7a('0x8')](),controller[_0xfb7a('0x27')]);router[_0xfb7a('0x25')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xfb7a('0x25')](_0xfb7a('0x23'),auth[_0xfb7a('0x8')](),controller['removeAgents']);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 6cbcf88..c51608b 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 _0xb39f=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','ENUM','yahoo','outlook365','provider','custom','getDataValue','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xb39f,0xd5));var _0xfb39=function(_0x2ad615,_0x4c7e5b){_0x2ad615=_0x2ad615-0x0;var _0x1bef11=_0xb39f[_0x2ad615];return _0x1bef11;};'use strict';var Sequelize=require(_0xfb39('0x0'));module[_0xfb39('0x1')]={'description':{'type':Sequelize[_0xfb39('0x2')]},'name':{'type':Sequelize[_0xfb39('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xfb39('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xfb39('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xfb39('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xfb39('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xfb39('0x4')]},'markAsUnread':{'type':Sequelize[_0xfb39('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xfb39('0x2')],'allowNull':![],'defaultValue':_0xfb39('0x5')},'fontSize':{'type':Sequelize[_0xfb39('0x6')](0x2)[_0xfb39('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xfb39('0x8');}},'notificationSound':{'type':Sequelize[_0xfb39('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfb39('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfb39('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfb39('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfb39('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xfb39('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xfb39('0x3')],'defaultValue':![],'comment':_0xfb39('0xa'),'set':function(_0x38586b){if(!_0x38586b)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x38586b);}},'provider':{'type':Sequelize[_0xfb39('0xb')]('gmail','hotmail',_0xfb39('0xc'),_0xfb39('0xd')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0xfb39('0xe')))return _0xfb39('0xf');return this[_0xfb39('0x10')](_0xfb39('0xe'));},'set':function(_0x37c633){if(_0x37c633===_0xfb39('0xf'))_0x37c633=null;return this['setDataValue'](_0xfb39('0xe'),_0x37c633);}}}; \ No newline at end of file +var _0x83b3=['provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','ENUM','gmail','outlook365','getDataValue'];(function(_0x4604b4,_0xa69fdf){var _0x77da48=function(_0x197dd5){while(--_0x197dd5){_0x4604b4['push'](_0x4604b4['shift']());}};_0x77da48(++_0xa69fdf);}(_0x83b3,0x1dd));var _0x383b=function(_0x55f489,_0x193f67){_0x55f489=_0x55f489-0x0;var _0x4c5534=_0x83b3[_0x55f489];return _0x4c5534;};'use strict';var Sequelize=require(_0x383b('0x0'));module[_0x383b('0x1')]={'description':{'type':Sequelize[_0x383b('0x2')]},'name':{'type':Sequelize[_0x383b('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x383b('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x383b('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x383b('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x383b('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x383b('0x4')]},'markAsUnread':{'type':Sequelize[_0x383b('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x383b('0x2')],'allowNull':![],'defaultValue':_0x383b('0x5')},'fontSize':{'type':Sequelize[_0x383b('0x6')](0x2)[_0x383b('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x383b('0x4')],'defaultValue':function(){return _0x383b('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x383b('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x383b('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x383b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x383b('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x383b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x383b('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x383b('0x3')],'defaultValue':![],'comment':_0x383b('0x9'),'set':function(_0x19bc63){if(!_0x19bc63)this['setDataValue'](_0x383b('0xa'),null);this[_0x383b('0xb')](_0x383b('0xc'),_0x19bc63);}},'provider':{'type':Sequelize[_0x383b('0xd')](_0x383b('0xe'),'hotmail','yahoo',_0x383b('0xf')),'defaultValue':null,'get':function(){if(!this[_0x383b('0x10')](_0x383b('0x11')))return _0x383b('0x12');return this[_0x383b('0x10')](_0x383b('0x11'));},'set':function(_0x149474){if(_0x149474===_0x383b('0x12'))_0x149474=null;return this[_0x383b('0xb')](_0x383b('0x11'),_0x149474);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index b7cdd56..2403619 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 _0xfbc9=['intersection','length','include','find','body','provider','custom','params','Mail\x20Account\x20not\x20found','update','describe','addDisposition','MailAccountId','findOne','Disposition','hasOwnProperty','removeDispositions','create','getAnswers','CannedAnswer','removeAnswers','ids','ListId','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','Contact','fullname','internal','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','findAndCountAll','stack','finally','MailApplication','getApplications','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','List','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','format','email','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','CmContact','defaults','messageId','subject','attach','out','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','removeAgents','isArray','userMailAccount:remove','User','getAgents','moment','bluebird','util','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','client','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','destroy','get','MailAccounts','UserProfileResource','name','send','gmail','imap.gmail.com','yahoo','outlook.office365.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','password','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','pass','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','MailAccount','rawAttributes','fieldName','type','key','model','map','keys','query','filters','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','mandatoryDispositionPause'];(function(_0x52af38,_0x3872ca){var _0x3eee25=function(_0x4b1dd1){while(--_0x4b1dd1){_0x52af38['push'](_0x52af38['shift']());}};_0x3eee25(++_0x3872ca);}(_0xfbc9,0x124));var _0x9fbc=function(_0x34e2bd,_0x48c77a){_0x34e2bd=_0x34e2bd-0x0;var _0x364e5c=_0xfbc9[_0x34e2bd];return _0x364e5c;};'use strict';var moment=require(_0x9fbc('0x0'));var BPromise=require(_0x9fbc('0x1'));var util=require(_0x9fbc('0x2'));var path=require('path');var _=require('lodash');var juice=require(_0x9fbc('0x3'));var Redis=require(_0x9fbc('0x4'));var qs=require(_0x9fbc('0x5'));var logger=require(_0x9fbc('0x6'))(_0x9fbc('0x7'));var config=require(_0x9fbc('0x8'));var db=require(_0x9fbc('0x9'))['db'];config[_0x9fbc('0xa')]=_['defaults'](config[_0x9fbc('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9fbc('0xb'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x9fbc('0xc')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9fbc('0xd')]['http']({'port':0x232b});function respondWithRpcPromise(_0x492798,_0x40c7a2,_0x1084a4,_0x456506){return new BPromise(function(_0x526202,_0x4f0867){var _0x4fafc6=_0x456506||client;return _0x4fafc6[_0x9fbc('0xe')](_0x492798,_0x1084a4)[_0x9fbc('0xf')](function(_0x14a55b){logger['info'](_0x9fbc('0x10'),_0x40c7a2,_0x9fbc('0x11'));logger['debug'](_0x9fbc('0x12'),_0x40c7a2,_0x9fbc('0x11'),JSON[_0x9fbc('0x13')](_0x14a55b));if(_0x14a55b['error']){if(_0x14a55b['error'][_0x9fbc('0x14')]===0x1f4){logger[_0x9fbc('0x15')](_0x9fbc('0x10'),_0x40c7a2,_0x14a55b[_0x9fbc('0x15')][_0x9fbc('0x16')]);return _0x4f0867(_0x14a55b[_0x9fbc('0x15')][_0x9fbc('0x16')]);}logger[_0x9fbc('0x15')](_0x9fbc('0x10'),_0x40c7a2,_0x14a55b[_0x9fbc('0x15')][_0x9fbc('0x16')]);return _0x526202(_0x14a55b[_0x9fbc('0x15')][_0x9fbc('0x16')]);}else{logger[_0x9fbc('0x17')]('MailAccount,\x20%s,\x20%s',_0x40c7a2,'request\x20sent');_0x526202(_0x14a55b[_0x9fbc('0x18')]['message']);}})[_0x9fbc('0x19')](function(_0x3c4fcc){logger['error'](_0x9fbc('0x10'),_0x40c7a2,_0x3c4fcc);_0x4f0867(_0x3c4fcc);});});}function respondWithStatusCode(_0x194429,_0x31ea9a){_0x31ea9a=_0x31ea9a||0xcc;return function(_0x3186bc){if(_0x3186bc){return _0x194429[_0x9fbc('0x1a')](_0x31ea9a);}return _0x194429[_0x9fbc('0x1b')](_0x31ea9a)[_0x9fbc('0x1c')]();};}function respondWithResult(_0x4a08f5,_0x46d310){_0x46d310=_0x46d310||0xc8;return function(_0x4740d0){if(_0x4740d0){return _0x4a08f5[_0x9fbc('0x1b')](_0x46d310)[_0x9fbc('0x1d')](_0x4740d0);}};}function respondWithFilteredResult(_0x5223d8,_0x5b0252){return function(_0x279a85){if(_0x279a85){var _0x1e0191=typeof _0x5b0252['offset']==='undefined'&&typeof _0x5b0252[_0x9fbc('0x1e')]===_0x9fbc('0x1f');var _0x2099c3=_0x279a85[_0x9fbc('0x20')];var _0x14d49e=_0x1e0191?0x0:_0x5b0252[_0x9fbc('0x21')];var _0x320bd3=_0x1e0191?_0x279a85['count']:_0x5b0252[_0x9fbc('0x21')]+_0x5b0252[_0x9fbc('0x1e')];var _0x142b39;if(_0x320bd3>=_0x2099c3){_0x320bd3=_0x2099c3;_0x142b39=0xc8;}else{_0x142b39=0xce;}_0x5223d8[_0x9fbc('0x1b')](_0x142b39);return _0x5223d8[_0x9fbc('0x22')](_0x9fbc('0x23'),_0x14d49e+'-'+_0x320bd3+'/'+_0x2099c3)[_0x9fbc('0x1d')](_0x279a85);}return null;};}function saveUpdates(_0x181990){return function(_0x4e754c){if(_0x4e754c){return _0x4e754c['update'](_0x181990)[_0x9fbc('0xf')](function(_0x103296){return _0x103296;});}return null;};}function removeEntity(_0x434f26){return function(_0x4ca8f8){if(_0x4ca8f8){return _0x4ca8f8[_0x9fbc('0x24')]()[_0x9fbc('0xf')](function(){var _0x5e2fb5=_0x4ca8f8[_0x9fbc('0x25')]({'plain':!![]});var _0x3a33d1=_0x9fbc('0x26');return db[_0x9fbc('0x27')]['destroy']({'where':{'type':_0x3a33d1,'resourceId':_0x5e2fb5['id']}})['then'](function(){return _0x4ca8f8;});})[_0x9fbc('0xf')](function(){_0x434f26[_0x9fbc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d3462){return function(_0x5e19cf){if(!_0x5e19cf){_0x4d3462[_0x9fbc('0x1a')](0x194);}return _0x5e19cf;};}function handleError(_0x8bc875,_0xd8193a){_0xd8193a=_0xd8193a||0x1f4;return function(_0x4d3848){logger['error'](_0x4d3848['stack']);if(_0x4d3848[_0x9fbc('0x28')]){delete _0x4d3848[_0x9fbc('0x28')];}_0x8bc875[_0x9fbc('0x1b')](_0xd8193a)[_0x9fbc('0x29')](_0x4d3848);};}function getImapHost(_0x166e15){switch(_0x166e15){case _0x9fbc('0x2a'):return _0x9fbc('0x2b');case _0x9fbc('0x2c'):return'imap.mail.yahoo.com';case'hotmail':return'imap-mail.outlook.com';case'outlook365':return _0x9fbc('0x2d');}throw new Error('Unknown\x20email\x20service\x20provider',_0x166e15);}function getSmtpHost(_0x537573){switch(_0x537573){case _0x9fbc('0x2a'):return'smtp.gmail.com';case'yahoo':return _0x9fbc('0x2e');case'hotmail':return _0x9fbc('0x2f');case _0x9fbc('0x30'):return _0x9fbc('0x31');}throw new Error(_0x9fbc('0x32'),_0x537573);}function getAuthenticationOptions(_0x4ffdd1,_0x132468){var _0x796a38={};var _0x27b4e1={};if(_0x4ffdd1){_0x796a38[_0x9fbc('0x33')]=_0x27b4e1['user']=_0x132468[_0x9fbc('0x34')];_0x796a38[_0x9fbc('0x35')]=_0x27b4e1['pass']=_0x132468[_0x9fbc('0x35')];if(_0x132468[_0x9fbc('0x36')]){_0x796a38['modernAuthentication']=_0x27b4e1[_0x9fbc('0x36')]=!![];_0x796a38[_0x9fbc('0x37')]=_0x27b4e1[_0x9fbc('0x37')]=_0x132468[_0x9fbc('0x37')];_0x796a38[_0x9fbc('0x35')]=_0x27b4e1['pass']=null;}else{_0x796a38[_0x9fbc('0x37')]=_0x27b4e1[_0x9fbc('0x37')]=null;}_0x796a38[_0x9fbc('0x38')]=getImapHost(_0x4ffdd1);_0x796a38['port']=0x3e1;_0x27b4e1['host']=getSmtpHost(_0x4ffdd1);_0x27b4e1[_0x9fbc('0x39')]=0x24b;_0x27b4e1[_0x9fbc('0x3a')]=![];_0x796a38[_0x9fbc('0x3b')]=_0x27b4e1[_0x9fbc('0x3b')]=null;}else{if(_0x132468[_0x9fbc('0x3c')]){_0x796a38[_0x9fbc('0x33')]=_0x27b4e1[_0x9fbc('0x33')]=_0x132468[_0x9fbc('0x34')];_0x796a38[_0x9fbc('0x35')]=_0x27b4e1[_0x9fbc('0x3d')]=_0x132468[_0x9fbc('0x35')];}else{_0x796a38['authentication']=_0x27b4e1[_0x9fbc('0x3c')]=![];_0x796a38[_0x9fbc('0x33')]=_0x27b4e1['user']=null;_0x796a38['password']=_0x27b4e1['pass']=null;}_0x796a38['host']=_0x132468[_0x9fbc('0x3e')][_0x9fbc('0x38')];_0x796a38[_0x9fbc('0x39')]=_0x132468[_0x9fbc('0x3e')][_0x9fbc('0x39')];_0x27b4e1['host']=_0x132468[_0x9fbc('0x3f')][_0x9fbc('0x38')];_0x27b4e1[_0x9fbc('0x39')]=_0x132468['Smtp'][_0x9fbc('0x39')];}return{'Imap':_0x796a38,'Smtp':_0x27b4e1};}exports[_0x9fbc('0x40')]=function(_0x239127,_0xed29e9){var _0xb4b545={'include':[{'model':db[_0x9fbc('0x41')],'as':_0x9fbc('0x3e')},{'model':db[_0x9fbc('0x42')],'as':_0x9fbc('0x3f')},{'model':db[_0x9fbc('0x43')],'as':'mandatoryDispositionPause'}]},_0x1a55ce={},_0x3a7063={'count':0x0,'rows':[]};var _0xaea1be=_['map'](db[_0x9fbc('0x44')][_0x9fbc('0x45')],function(_0x288768){return{'name':_0x288768[_0x9fbc('0x46')],'type':_0x288768[_0x9fbc('0x47')][_0x9fbc('0x48')]};});_0x1a55ce[_0x9fbc('0x49')]=_[_0x9fbc('0x4a')](_0xaea1be,'name');_0x1a55ce['query']=_[_0x9fbc('0x4b')](_0x239127[_0x9fbc('0x4c')]);_0x1a55ce[_0x9fbc('0x4d')]=_['intersection'](_0x1a55ce[_0x9fbc('0x49')],_0x1a55ce[_0x9fbc('0x4c')]);_0xb4b545['attributes']=_['intersection'](_0x1a55ce[_0x9fbc('0x49')],qs['fields'](_0x239127['query'][_0x9fbc('0x4e')]));_0xb4b545[_0x9fbc('0x4f')]=_0xb4b545[_0x9fbc('0x4f')]['length']?_0xb4b545[_0x9fbc('0x4f')]:_0x1a55ce[_0x9fbc('0x49')];if(!_0x239127[_0x9fbc('0x4c')]['hasOwnProperty'](_0x9fbc('0x50'))){_0xb4b545[_0x9fbc('0x1e')]=qs['limit'](_0x239127['query']['limit']);_0xb4b545[_0x9fbc('0x21')]=qs[_0x9fbc('0x21')](_0x239127['query'][_0x9fbc('0x21')]);}_0xb4b545[_0x9fbc('0x51')]=qs[_0x9fbc('0x52')](_0x239127[_0x9fbc('0x4c')][_0x9fbc('0x52')]);_0xb4b545[_0x9fbc('0x53')]=qs[_0x9fbc('0x4d')](_[_0x9fbc('0x54')](_0x239127['query'],_0x1a55ce['filters']),_0xaea1be);if(_0x239127[_0x9fbc('0x4c')][_0x9fbc('0x55')]){_0xb4b545[_0x9fbc('0x53')]=_[_0x9fbc('0x56')](_0xb4b545['where'],{'$or':_['map'](_0xaea1be,function(_0x2ad37d){if(_0x2ad37d[_0x9fbc('0x47')]!==_0x9fbc('0x57')){var _0x53c37b={};_0x53c37b[_0x2ad37d[_0x9fbc('0x28')]]={'$like':'%'+_0x239127['query'][_0x9fbc('0x55')]+'%'};return _0x53c37b;}})});}_0xb4b545=_[_0x9fbc('0x56')]({},_0xb4b545,_0x239127[_0x9fbc('0x58')]);var _0x409ac0={'where':_0xb4b545[_0x9fbc('0x53')]};return db[_0x9fbc('0x44')][_0x9fbc('0x20')](_0x409ac0)[_0x9fbc('0xf')](function(_0x4eee3e){_0x3a7063[_0x9fbc('0x20')]=_0x4eee3e;if(_0x239127[_0x9fbc('0x4c')][_0x9fbc('0x59')]){_0xb4b545['include']=[{'all':!![]}];}return db[_0x9fbc('0x44')][_0x9fbc('0x5a')](_0xb4b545);})[_0x9fbc('0xf')](function(_0x11c801){_0x3a7063[_0x9fbc('0x5b')]=_0x11c801;return _0x3a7063;})['then'](respondWithFilteredResult(_0xed29e9,_0xb4b545))[_0x9fbc('0x19')](handleError(_0xed29e9,null));};exports[_0x9fbc('0x5c')]=function(_0x36ac77,_0x1ec6e5){var _0x16cd7e={'raw':![],'where':{'id':_0x36ac77['params']['id']},'include':[{'model':db[_0x9fbc('0x41')],'as':_0x9fbc('0x3e')},{'model':db[_0x9fbc('0x42')],'as':_0x9fbc('0x3f')},{'model':db[_0x9fbc('0x43')],'as':_0x9fbc('0x5d')}]},_0x1ce7c2={};_0x1ce7c2[_0x9fbc('0x49')]=_[_0x9fbc('0x4b')](db[_0x9fbc('0x44')][_0x9fbc('0x45')]);_0x1ce7c2[_0x9fbc('0x4c')]=_['keys'](_0x36ac77[_0x9fbc('0x4c')]);_0x1ce7c2['filters']=_[_0x9fbc('0x5e')](_0x1ce7c2[_0x9fbc('0x49')],_0x1ce7c2[_0x9fbc('0x4c')]);_0x16cd7e[_0x9fbc('0x4f')]=_['intersection'](_0x1ce7c2[_0x9fbc('0x49')],qs[_0x9fbc('0x4e')](_0x36ac77['query'][_0x9fbc('0x4e')]));_0x16cd7e[_0x9fbc('0x4f')]=_0x16cd7e['attributes'][_0x9fbc('0x5f')]?_0x16cd7e[_0x9fbc('0x4f')]:_0x1ce7c2[_0x9fbc('0x49')];if(_0x36ac77[_0x9fbc('0x4c')][_0x9fbc('0x59')]){_0x16cd7e[_0x9fbc('0x60')]=[{'all':!![]}];}_0x16cd7e=_[_0x9fbc('0x56')]({},_0x16cd7e,_0x36ac77[_0x9fbc('0x58')]);return db[_0x9fbc('0x44')][_0x9fbc('0x61')](_0x16cd7e)[_0x9fbc('0xf')](handleEntityNotFound(_0x1ec6e5,null))['then'](respondWithResult(_0x1ec6e5,null))['catch'](handleError(_0x1ec6e5,null));};exports['update']=function(_0x19f9de,_0x3192ba){if(_0x19f9de['body']['id']){delete _0x19f9de[_0x9fbc('0x62')]['id'];}var _0x483bbf=_0x19f9de[_0x9fbc('0x62')][_0x9fbc('0x63')]===_0x9fbc('0x64')?null:_0x19f9de[_0x9fbc('0x62')][_0x9fbc('0x63')];var _0x3acef5=_0x19f9de[_0x9fbc('0x62')][_0x9fbc('0x3e')]||{};var _0x357f2e=_0x19f9de['body'][_0x9fbc('0x3f')]||{};if(_0x483bbf){_0x3acef5[_0x9fbc('0x38')]=getImapHost(_0x483bbf);_0x3acef5['port']=0x3e1;_0x357f2e['host']=getSmtpHost(_0x483bbf);_0x357f2e[_0x9fbc('0x39')]=0x24b;_0x357f2e[_0x9fbc('0x3a')]=![];}if(_0x357f2e[_0x9fbc('0x36')]){_0x357f2e[_0x9fbc('0x3a')]=![];}else{_0x357f2e['CloudProviderId']=null;}if(!_0x3acef5[_0x9fbc('0x36')])_0x3acef5[_0x9fbc('0x37')]=null;_0x19f9de[_0x9fbc('0x62')][_0x9fbc('0x3e')]=_0x3acef5;_0x19f9de[_0x9fbc('0x62')][_0x9fbc('0x3f')]=_0x357f2e;return db[_0x9fbc('0x44')]['find']({'where':{'id':_0x19f9de[_0x9fbc('0x65')]['id']},'include':[{'model':db[_0x9fbc('0x41')],'as':_0x9fbc('0x3e')},{'model':db['MailServerOut'],'as':_0x9fbc('0x3f')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3192ba,null))[_0x9fbc('0xf')](function(_0x145195){if(!_0x145195)throw new Error(_0x9fbc('0x66'));if(_0x145195[_0x9fbc('0x3b')])delete _0x19f9de[_0x9fbc('0x62')][_0x9fbc('0x3e')];return _0x145195;})[_0x9fbc('0xf')](saveUpdates(_0x19f9de[_0x9fbc('0x62')],null))[_0x9fbc('0xf')](function(_0x1439d0){if(!_0x19f9de[_0x9fbc('0x62')][_0x9fbc('0x3e')])return _0x1439d0;return db[_0x9fbc('0x41')][_0x9fbc('0x67')](_0x19f9de[_0x9fbc('0x62')][_0x9fbc('0x3e')],{'where':{'MailAccountId':_0x1439d0['id']}})[_0x9fbc('0xf')](function(){return _0x1439d0;});})[_0x9fbc('0xf')](function(_0x295c2c){if(!_0x19f9de[_0x9fbc('0x62')][_0x9fbc('0x3f')])return _0x295c2c;return db[_0x9fbc('0x42')][_0x9fbc('0x67')](_0x19f9de['body'][_0x9fbc('0x3f')],{'where':{'MailAccountId':_0x295c2c['id']}})[_0x9fbc('0xf')](function(){return _0x295c2c;});})['then'](respondWithResult(_0x3192ba,null))['catch'](handleError(_0x3192ba,null));};exports[_0x9fbc('0x68')]=function(_0x51f665,_0x14067f){return db[_0x9fbc('0x44')]['describe']()['then'](respondWithResult(_0x14067f,null))[_0x9fbc('0x19')](handleError(_0x14067f,null));};exports[_0x9fbc('0x69')]=function(_0x1794ff,_0x3b2b51){if(_0x1794ff[_0x9fbc('0x62')]['id']){delete _0x1794ff[_0x9fbc('0x62')]['id'];}return db['MailAccount'][_0x9fbc('0x61')]({'where':{'id':_0x1794ff[_0x9fbc('0x65')]['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x3b2b51,null))[_0x9fbc('0xf')](function(_0x3275a2){if(_0x3275a2){_0x1794ff[_0x9fbc('0x62')][_0x9fbc('0x6a')]=_0x3275a2['id'];return db['Disposition']['create'](_0x1794ff[_0x9fbc('0x62')]);}})[_0x9fbc('0xf')](respondWithResult(_0x3b2b51,null))[_0x9fbc('0x19')](handleError(_0x3b2b51,null));};exports['getDispositions']=function(_0x359bcb,_0x3c167e){var _0x5dbeb2={'raw':![],'where':{}};var _0x29950f={};var _0x4a767d={'count':0x0,'rows':[]};return db[_0x9fbc('0x44')][_0x9fbc('0x6b')]({'where':{'id':_0x359bcb[_0x9fbc('0x65')]['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x3c167e,null))[_0x9fbc('0xf')](function(_0x43c54c){if(_0x43c54c){_0x29950f['model']=_[_0x9fbc('0x4b')](db[_0x9fbc('0x6c')]['rawAttributes']);_0x29950f['query']=_['keys'](_0x359bcb['query']);_0x29950f[_0x9fbc('0x4d')]=_[_0x9fbc('0x5e')](_0x29950f[_0x9fbc('0x49')],_0x29950f[_0x9fbc('0x4c')]);_0x5dbeb2[_0x9fbc('0x4f')]=_[_0x9fbc('0x5e')](_0x29950f[_0x9fbc('0x49')],qs[_0x9fbc('0x4e')](_0x359bcb[_0x9fbc('0x4c')][_0x9fbc('0x4e')]));_0x5dbeb2[_0x9fbc('0x4f')]=_0x5dbeb2[_0x9fbc('0x4f')][_0x9fbc('0x5f')]?_0x5dbeb2[_0x9fbc('0x4f')]:_0x29950f[_0x9fbc('0x49')];if(!_0x359bcb[_0x9fbc('0x4c')][_0x9fbc('0x6d')](_0x9fbc('0x50'))){_0x5dbeb2[_0x9fbc('0x1e')]=qs[_0x9fbc('0x1e')](_0x359bcb[_0x9fbc('0x4c')][_0x9fbc('0x1e')]);_0x5dbeb2[_0x9fbc('0x21')]=qs[_0x9fbc('0x21')](_0x359bcb['query'][_0x9fbc('0x21')]);}_0x5dbeb2[_0x9fbc('0x51')]=qs['sort'](_0x359bcb[_0x9fbc('0x4c')]['sort']);_0x5dbeb2['where']=qs[_0x9fbc('0x4d')](_[_0x9fbc('0x54')](_0x359bcb['query'],_0x29950f['filters']));_0x5dbeb2[_0x9fbc('0x53')][_0x9fbc('0x6a')]=_0x43c54c['id'];if(_0x359bcb['query'][_0x9fbc('0x55')]){_0x5dbeb2[_0x9fbc('0x53')]=_[_0x9fbc('0x56')](_0x5dbeb2['where'],{'$or':_[_0x9fbc('0x4a')](_0x5dbeb2[_0x9fbc('0x4f')],function(_0x449f70){var _0x497390={};_0x497390[_0x449f70]={'$like':'%'+_0x359bcb[_0x9fbc('0x4c')][_0x9fbc('0x55')]+'%'};return _0x497390;})});}_0x5dbeb2=_[_0x9fbc('0x56')]({},_0x5dbeb2,_0x359bcb['options']);return db['Disposition'][_0x9fbc('0x20')]({'where':_0x5dbeb2[_0x9fbc('0x53')]})[_0x9fbc('0xf')](function(_0x5262d1){_0x4a767d[_0x9fbc('0x20')]=_0x5262d1;if(_0x359bcb[_0x9fbc('0x4c')][_0x9fbc('0x59')]){_0x5dbeb2['include']=[{'all':!![]}];}return db[_0x9fbc('0x6c')]['findAll'](_0x5dbeb2);})[_0x9fbc('0xf')](function(_0x471503){_0x4a767d[_0x9fbc('0x5b')]=_0x471503;return _0x4a767d;});}})[_0x9fbc('0xf')](respondWithFilteredResult(_0x3c167e,_0x5dbeb2))[_0x9fbc('0x19')](handleError(_0x3c167e,null));};exports[_0x9fbc('0x6e')]=function(_0xe2e162,_0x26ec3e){return db['MailAccount']['find']({'where':{'id':_0xe2e162[_0x9fbc('0x65')]['id']}})['then'](handleEntityNotFound(_0x26ec3e,null))[_0x9fbc('0xf')](function(_0x2fdecb){if(_0x2fdecb){return _0x2fdecb[_0x9fbc('0x6e')](_0xe2e162[_0x9fbc('0x4c')]['ids']);}})['then'](respondWithStatusCode(_0x26ec3e,null))['catch'](handleError(_0x26ec3e,null));};exports['addAnswer']=function(_0x2bc3a6,_0x14e119){if(_0x2bc3a6[_0x9fbc('0x62')]['id']){delete _0x2bc3a6[_0x9fbc('0x62')]['id'];}return db['MailAccount'][_0x9fbc('0x61')]({'where':{'id':_0x2bc3a6[_0x9fbc('0x65')]['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x14e119,null))[_0x9fbc('0xf')](function(_0x356eec){if(_0x356eec){_0x2bc3a6[_0x9fbc('0x62')]['MailAccountId']=_0x356eec['id'];return db['CannedAnswer'][_0x9fbc('0x6f')](_0x2bc3a6[_0x9fbc('0x62')]);}})[_0x9fbc('0xf')](respondWithResult(_0x14e119,null))[_0x9fbc('0x19')](handleError(_0x14e119,null));};exports[_0x9fbc('0x70')]=function(_0x2002e1,_0x22397f){var _0x9fa9bb={'raw':![],'where':{}};var _0x3537b4={};var _0x9b79bd={'count':0x0,'rows':[]};return db['MailAccount'][_0x9fbc('0x6b')]({'where':{'id':_0x2002e1[_0x9fbc('0x65')]['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x22397f,null))[_0x9fbc('0xf')](function(_0x1fbf3a){if(_0x1fbf3a){_0x3537b4[_0x9fbc('0x49')]=_[_0x9fbc('0x4b')](db['CannedAnswer'][_0x9fbc('0x45')]);_0x3537b4[_0x9fbc('0x4c')]=_[_0x9fbc('0x4b')](_0x2002e1[_0x9fbc('0x4c')]);_0x3537b4['filters']=_[_0x9fbc('0x5e')](_0x3537b4['model'],_0x3537b4[_0x9fbc('0x4c')]);_0x9fa9bb['attributes']=_[_0x9fbc('0x5e')](_0x3537b4['model'],qs[_0x9fbc('0x4e')](_0x2002e1[_0x9fbc('0x4c')][_0x9fbc('0x4e')]));_0x9fa9bb['attributes']=_0x9fa9bb[_0x9fbc('0x4f')]['length']?_0x9fa9bb['attributes']:_0x3537b4[_0x9fbc('0x49')];if(!_0x2002e1[_0x9fbc('0x4c')]['hasOwnProperty'](_0x9fbc('0x50'))){_0x9fa9bb[_0x9fbc('0x1e')]=qs[_0x9fbc('0x1e')](_0x2002e1[_0x9fbc('0x4c')][_0x9fbc('0x1e')]);_0x9fa9bb[_0x9fbc('0x21')]=qs[_0x9fbc('0x21')](_0x2002e1['query'][_0x9fbc('0x21')]);}_0x9fa9bb[_0x9fbc('0x51')]=qs[_0x9fbc('0x52')](_0x2002e1[_0x9fbc('0x4c')][_0x9fbc('0x52')]);_0x9fa9bb['where']=qs['filters'](_[_0x9fbc('0x54')](_0x2002e1[_0x9fbc('0x4c')],_0x3537b4[_0x9fbc('0x4d')]));_0x9fa9bb[_0x9fbc('0x53')][_0x9fbc('0x6a')]=_0x1fbf3a['id'];if(_0x2002e1['query']['filter']){_0x9fa9bb[_0x9fbc('0x53')]=_[_0x9fbc('0x56')](_0x9fa9bb[_0x9fbc('0x53')],{'$or':_['map'](_0x9fa9bb[_0x9fbc('0x4f')],function(_0x203b22){var _0x562d5b={};_0x562d5b[_0x203b22]={'$like':'%'+_0x2002e1[_0x9fbc('0x4c')][_0x9fbc('0x55')]+'%'};return _0x562d5b;})});}_0x9fa9bb=_['merge']({},_0x9fa9bb,_0x2002e1[_0x9fbc('0x58')]);return db[_0x9fbc('0x71')][_0x9fbc('0x20')]({'where':_0x9fa9bb['where']})[_0x9fbc('0xf')](function(_0x217466){_0x9b79bd[_0x9fbc('0x20')]=_0x217466;if(_0x2002e1[_0x9fbc('0x4c')]['includeAll']){_0x9fa9bb[_0x9fbc('0x60')]=[{'all':!![]}];}return db[_0x9fbc('0x71')][_0x9fbc('0x5a')](_0x9fa9bb);})[_0x9fbc('0xf')](function(_0x4eaf31){_0x9b79bd[_0x9fbc('0x5b')]=_0x4eaf31;return _0x9b79bd;});}})[_0x9fbc('0xf')](respondWithFilteredResult(_0x22397f,_0x9fa9bb))['catch'](handleError(_0x22397f,null));};exports[_0x9fbc('0x72')]=function(_0x3e8508,_0x32cf01){return db[_0x9fbc('0x44')][_0x9fbc('0x61')]({'where':{'id':_0x3e8508[_0x9fbc('0x65')]['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x32cf01,null))[_0x9fbc('0xf')](function(_0x165fd3){if(_0x165fd3){return _0x165fd3[_0x9fbc('0x72')](_0x3e8508[_0x9fbc('0x4c')][_0x9fbc('0x73')]);}})['then'](respondWithStatusCode(_0x32cf01,null))[_0x9fbc('0x19')](handleError(_0x32cf01,null));};exports[_0x9fbc('0x6f')]=function(_0x26a130,_0x5c70a6){var _0x87c9ee={'name':_0x26a130[_0x9fbc('0x62')]['name'],'key':_0x26a130[_0x9fbc('0x62')][_0x9fbc('0x48')],'provider':_0x26a130[_0x9fbc('0x62')][_0x9fbc('0x63')]===_0x9fbc('0x64')?null:_0x26a130['body'][_0x9fbc('0x63')],'email':_0x26a130['body']['email'],'ListId':_0x26a130['body'][_0x9fbc('0x74')],'active':!_['isNil'](_0x26a130[_0x9fbc('0x62')][_0x9fbc('0x75')])?_0x26a130[_0x9fbc('0x62')][_0x9fbc('0x75')]:!![],'description':_0x26a130[_0x9fbc('0x62')][_0x9fbc('0x76')]||null};var _0x29de3d=getAuthenticationOptions(_0x87c9ee['provider'],_0x26a130[_0x9fbc('0x62')]);_0x87c9ee['Imap']=_0x29de3d[_0x9fbc('0x3e')];_0x87c9ee['Smtp']=_0x29de3d[_0x9fbc('0x3f')];return db[_0x9fbc('0x44')][_0x9fbc('0x6f')](_0x87c9ee,{'include':[{'model':db[_0x9fbc('0x42')],'as':_0x9fbc('0x3f')},{'model':db[_0x9fbc('0x41')],'as':'Imap'}]})[_0x9fbc('0xf')](function(_0x707424){var _0xea2101=_0x26a130['user'][_0x9fbc('0x25')]({'plain':!![]});if(!_0xea2101)throw new Error(_0x9fbc('0x77'));if(_0xea2101[_0x9fbc('0x78')]===_0x9fbc('0x33')){var _0x1d0a6f=_0x707424['get']({'plain':!![]});return db[_0x9fbc('0x79')][_0x9fbc('0x61')]({'where':{'name':_0x9fbc('0x26'),'userProfileId':_0xea2101[_0x9fbc('0x7a')]},'raw':!![]})[_0x9fbc('0xf')](function(_0x444114){if(_0x444114&&_0x444114[_0x9fbc('0x7b')]===0x0){return db[_0x9fbc('0x27')][_0x9fbc('0x6f')]({'name':_0x1d0a6f[_0x9fbc('0x28')],'resourceId':_0x1d0a6f['id'],'type':_0x444114[_0x9fbc('0x28')],'sectionId':_0x444114['id']},{})[_0x9fbc('0xf')](function(){return _0x707424;});}else{return _0x707424;}})[_0x9fbc('0x19')](function(_0x4b7ebc){logger[_0x9fbc('0x15')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b7ebc);throw _0x4b7ebc;});}return _0x707424;})[_0x9fbc('0xf')](respondWithResult(_0x5c70a6,0xc9))['catch'](handleError(_0x5c70a6,null));};exports[_0x9fbc('0x7c')]=function(_0x47427e,_0x346319){return db[_0x9fbc('0x44')][_0x9fbc('0x6b')]({'where':{'id':_0x47427e[_0x9fbc('0x65')]['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x346319,null))[_0x9fbc('0xf')](function(_0x44cc77){if(_0x44cc77){return _0x44cc77['getImap']();}return null;})[_0x9fbc('0xf')](respondWithResult(_0x346319,null))[_0x9fbc('0x19')](handleError(_0x346319,null));};exports[_0x9fbc('0x7d')]=function(_0x37dfce,_0x5c378c){if(_0x37dfce[_0x9fbc('0x62')]['id']){delete _0x37dfce[_0x9fbc('0x62')]['id'];}return db['MailAccount'][_0x9fbc('0x61')]({'where':{'id':_0x37dfce[_0x9fbc('0x65')]['id']}})['then'](handleEntityNotFound(_0x5c378c,null))['then'](function(_0x154842){if(_0x154842){_0x37dfce['body'][_0x9fbc('0x6a')]=_0x154842['id'];return db[_0x9fbc('0x41')]['create'](_0x37dfce['body']);}})[_0x9fbc('0xf')](respondWithResult(_0x5c378c,null))[_0x9fbc('0x19')](handleError(_0x5c378c,null));};exports[_0x9fbc('0x7e')]=function(_0x40f09d,_0x2d20cb){return db[_0x9fbc('0x44')][_0x9fbc('0x6b')]({'where':{'id':_0x40f09d[_0x9fbc('0x65')]['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x2d20cb,null))[_0x9fbc('0xf')](function(_0x2157b9){if(_0x2157b9){return _0x2157b9['setImap'](null);}return null;})[_0x9fbc('0xf')](respondWithStatusCode(_0x2d20cb,null))[_0x9fbc('0x19')](handleError(_0x2d20cb,null));};exports[_0x9fbc('0x7f')]=function(_0x46eb10,_0x268a65){return db[_0x9fbc('0x44')][_0x9fbc('0x6b')]({'where':{'id':_0x46eb10[_0x9fbc('0x65')]['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x268a65,null))[_0x9fbc('0xf')](function(_0x535909){if(_0x535909){return _0x535909[_0x9fbc('0x7f')]();}return null;})[_0x9fbc('0xf')](respondWithResult(_0x268a65,null))[_0x9fbc('0x19')](handleError(_0x268a65,null));};exports[_0x9fbc('0x80')]=function(_0x179416,_0x1eed53){if(_0x179416[_0x9fbc('0x62')]['id']){delete _0x179416['body']['id'];}return db[_0x9fbc('0x44')][_0x9fbc('0x61')]({'where':{'id':_0x179416[_0x9fbc('0x65')]['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x1eed53,null))[_0x9fbc('0xf')](function(_0x3a8be6){if(_0x3a8be6){_0x179416[_0x9fbc('0x62')]['MailAccountId']=_0x3a8be6['id'];return db[_0x9fbc('0x42')][_0x9fbc('0x6f')](_0x179416[_0x9fbc('0x62')]);}})[_0x9fbc('0xf')](respondWithResult(_0x1eed53,null))[_0x9fbc('0x19')](handleError(_0x1eed53,null));};exports[_0x9fbc('0x81')]=function(_0x2f7df9,_0x52e3f3){return db[_0x9fbc('0x44')][_0x9fbc('0x6b')]({'where':{'id':_0x2f7df9[_0x9fbc('0x65')]['id']}})['then'](handleEntityNotFound(_0x52e3f3,null))[_0x9fbc('0xf')](function(_0x5bac86){if(_0x5bac86){return _0x5bac86[_0x9fbc('0x82')](null);}return null;})['then'](respondWithStatusCode(_0x52e3f3,null))[_0x9fbc('0x19')](handleError(_0x52e3f3,null));};exports[_0x9fbc('0x83')]=function(_0x58d922,_0x101d2e){return db[_0x9fbc('0x84')][_0x9fbc('0x61')]({'where':{'id':_0x58d922[_0x9fbc('0x65')]['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x101d2e,null))[_0x9fbc('0xf')](function(_0x2e101a){if(_0x2e101a){return _0x2e101a[_0x9fbc('0x83')](_0x58d922['body']['ids'],_['omit'](_0x58d922[_0x9fbc('0x62')],[_0x9fbc('0x73'),'id'])||{});}})[_0x9fbc('0xf')](respondWithResult(_0x101d2e,null))[_0x9fbc('0x19')](handleError(_0x101d2e,null));};exports[_0x9fbc('0x85')]=function(_0x2f7013,_0x5f5b34){var _0xa8ba8d={'raw':![],'where':{}};var _0x479249={};var _0x35e710={'count':0x0,'rows':[]};return db['MailAccount'][_0x9fbc('0x6b')]({'where':{'id':_0x2f7013['params']['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x5f5b34,null))['then'](function(_0xfc1a68){if(_0xfc1a68){_0x479249[_0x9fbc('0x49')]=_[_0x9fbc('0x4b')](db[_0x9fbc('0x84')][_0x9fbc('0x45')]);_0x479249['query']=_['keys'](_0x2f7013[_0x9fbc('0x4c')]);_0x479249[_0x9fbc('0x4d')]=_[_0x9fbc('0x5e')](_0x479249[_0x9fbc('0x49')],_0x479249[_0x9fbc('0x4c')]);_0xa8ba8d['attributes']=_[_0x9fbc('0x5e')](_0x479249[_0x9fbc('0x49')],qs['fields'](_0x2f7013[_0x9fbc('0x4c')][_0x9fbc('0x4e')]));_0xa8ba8d[_0x9fbc('0x4f')]=_0xa8ba8d[_0x9fbc('0x4f')][_0x9fbc('0x5f')]?_0xa8ba8d[_0x9fbc('0x4f')]:_0x479249['model'];if(!_0x2f7013[_0x9fbc('0x4c')][_0x9fbc('0x6d')](_0x9fbc('0x50'))){_0xa8ba8d[_0x9fbc('0x1e')]=qs[_0x9fbc('0x1e')](_0x2f7013[_0x9fbc('0x4c')][_0x9fbc('0x1e')]);_0xa8ba8d['offset']=qs[_0x9fbc('0x21')](_0x2f7013[_0x9fbc('0x4c')][_0x9fbc('0x21')]);}_0xa8ba8d[_0x9fbc('0x51')]=qs[_0x9fbc('0x52')](_0x2f7013['query'][_0x9fbc('0x52')]);_0xa8ba8d['where']=qs['filters'](_[_0x9fbc('0x54')](_0x2f7013[_0x9fbc('0x4c')],_0x479249[_0x9fbc('0x4d')]));_0xa8ba8d['where'][_0x9fbc('0x6a')]=_0xfc1a68['id'];if(_0x2f7013[_0x9fbc('0x4c')][_0x9fbc('0x55')]){_0xa8ba8d['where']=_[_0x9fbc('0x56')](_0xa8ba8d[_0x9fbc('0x53')],{'$or':_[_0x9fbc('0x4a')](_0xa8ba8d[_0x9fbc('0x4f')],function(_0x58d62e){var _0x36f34a={};_0x36f34a[_0x58d62e]={'$like':'%'+_0x2f7013[_0x9fbc('0x4c')][_0x9fbc('0x55')]+'%'};return _0x36f34a;})});}_0xa8ba8d=_[_0x9fbc('0x56')]({},_0xa8ba8d,_0x2f7013[_0x9fbc('0x58')]);return db[_0x9fbc('0x84')][_0x9fbc('0x20')]({'where':_0xa8ba8d[_0x9fbc('0x53')]})['then'](function(_0x1f7759){_0x35e710[_0x9fbc('0x20')]=_0x1f7759;if(_0x2f7013['query'][_0x9fbc('0x59')]){_0xa8ba8d[_0x9fbc('0x60')]=[{'model':db['CmContact'],'as':_0x9fbc('0x86'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x9fbc('0x87'),_0x9fbc('0x88')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x9fbc('0x28'),_0x9fbc('0x89')],'where':_0x2f7013['query'][_0x9fbc('0x8a')]?{'id':_0x2f7013[_0x9fbc('0x4c')][_0x9fbc('0x8a')]}:undefined,'required':_0x2f7013['query'][_0x9fbc('0x8a')]?!![]:![]}];}return db[_0x9fbc('0x84')]['findAll'](_0xa8ba8d);})[_0x9fbc('0xf')](function(_0x462641){_0x35e710[_0x9fbc('0x5b')]=_0x462641;return _0x35e710;});}})[_0x9fbc('0xf')](respondWithFilteredResult(_0x5f5b34,_0xa8ba8d))[_0x9fbc('0x19')](handleError(_0x5f5b34,null));};exports[_0x9fbc('0x8b')]=function addApplications(_0x35e04e,_0x23d6d8){var _0x3be80c=_0x35e04e[_0x9fbc('0x65')]['id'];var _0x32b7d5=_0x35e04e[_0x9fbc('0x62')];var _0x21e7a9=0xc8;var _0x5a2091=null;return db['sequelize'][_0x9fbc('0x8c')]({'isolationLevel':db[_0x9fbc('0x8d')][_0x9fbc('0x8e')][_0x9fbc('0x8f')]['READ_COMMITTED']},function(_0x4ad12e){return db[_0x9fbc('0x44')]['findOne']({'where':{'id':_0x3be80c},'transaction':_0x4ad12e})[_0x9fbc('0xf')](function(_0x3045d4){if(_0x3045d4){return db['MailApplication'][_0x9fbc('0x24')]({'where':{'MailAccountId':_0x3be80c},'transaction':_0x4ad12e})[_0x9fbc('0xf')](function(){var _0x53a3e6=_[_0x9fbc('0x4a')](_0x32b7d5,function(_0x54554d){_0x54554d['MailAccountId']=_0x3be80c;return _0x54554d;});return db['MailApplication']['bulkCreate'](_0x53a3e6,{'transaction':_0x4ad12e});});}else{_0x21e7a9=0x194;_0x5a2091=[];}});})[_0x9fbc('0xf')](function(){if(_0x21e7a9!==0x194){return db['MailApplication'][_0x9fbc('0x90')]({'where':{'MailAccountId':_0x3be80c},'order':'priority'})[_0x9fbc('0xf')](function(_0x378e2c){_0x5a2091=_0x378e2c;});}})[_0x9fbc('0x19')](function(_0x58c2bd){_0x21e7a9=0x1f4;logger[_0x9fbc('0x15')](_0x58c2bd[_0x9fbc('0x91')]);if(_0x58c2bd['name']){delete _0x58c2bd[_0x9fbc('0x28')];}_0x5a2091=_0x58c2bd;})[_0x9fbc('0x92')](function(){if(_0x5a2091===null){_0x23d6d8[_0x9fbc('0x1a')](_0x21e7a9);}else{if(_0x21e7a9===0x1f4){_0x23d6d8[_0x9fbc('0x1b')](_0x21e7a9)[_0x9fbc('0x29')](_0x5a2091);}else{_0x23d6d8[_0x9fbc('0x1b')](_0x21e7a9)[_0x9fbc('0x1d')](_0x5a2091);}}});};exports['getApplications']=function(_0x1c965c,_0x44105d){var _0xd231c3={};var _0x4af409={};var _0xf03802;var _0x3de82f;return db[_0x9fbc('0x44')][_0x9fbc('0x6b')]({'where':{'id':_0x1c965c[_0x9fbc('0x65')]['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x44105d,null))['then'](function(_0x153032){if(_0x153032){_0xf03802=_0x153032;_0x4af409['model']=_['keys'](db[_0x9fbc('0x93')][_0x9fbc('0x45')]);_0x4af409[_0x9fbc('0x4c')]=_[_0x9fbc('0x4b')](_0x1c965c['query']);_0x4af409[_0x9fbc('0x4d')]=_[_0x9fbc('0x5e')](_0x4af409[_0x9fbc('0x49')],_0x4af409['query']);_0xd231c3[_0x9fbc('0x4f')]=_['intersection'](_0x4af409[_0x9fbc('0x49')],qs[_0x9fbc('0x4e')](_0x1c965c[_0x9fbc('0x4c')]['fields']));_0xd231c3[_0x9fbc('0x4f')]=_0xd231c3[_0x9fbc('0x4f')]['length']?_0xd231c3['attributes']:_0x4af409[_0x9fbc('0x49')];_0xd231c3[_0x9fbc('0x51')]=qs[_0x9fbc('0x52')](_0x1c965c[_0x9fbc('0x4c')][_0x9fbc('0x52')]);_0xd231c3['where']=qs['filters'](_[_0x9fbc('0x54')](_0x1c965c['query'],_0x4af409['filters']));if(_0x1c965c['query'][_0x9fbc('0x55')]){_0xd231c3[_0x9fbc('0x53')]=_[_0x9fbc('0x56')](_0xd231c3['where'],{'$or':_[_0x9fbc('0x4a')](_0xd231c3[_0x9fbc('0x4f')],function(_0x6f5bed){var _0x428948={};_0x428948[_0x6f5bed]={'$like':'%'+_0x1c965c[_0x9fbc('0x4c')]['filter']+'%'};return _0x428948;})});}_0xd231c3=_[_0x9fbc('0x56')]({},_0xd231c3,_0x1c965c[_0x9fbc('0x58')]);return _0xf03802['getApplications'](_0xd231c3);}})[_0x9fbc('0xf')](function(_0x43c5b6){if(_0x43c5b6){_0x3de82f=_0x43c5b6[_0x9fbc('0x5f')];if(!_0x1c965c['query'][_0x9fbc('0x6d')](_0x9fbc('0x50'))){_0xd231c3['limit']=qs[_0x9fbc('0x1e')](_0x1c965c[_0x9fbc('0x4c')][_0x9fbc('0x1e')]);_0xd231c3[_0x9fbc('0x21')]=qs['offset'](_0x1c965c[_0x9fbc('0x4c')][_0x9fbc('0x21')]);}return _0xf03802[_0x9fbc('0x94')](_0xd231c3);}})[_0x9fbc('0xf')](function(_0x1d343c){if(_0x1d343c){return _0x1d343c?{'count':_0x3de82f,'rows':_0x1d343c}:null;}})[_0x9fbc('0xf')](respondWithResult(_0x44105d,null))[_0x9fbc('0x19')](handleError(_0x44105d,null));};exports['getMessages']=function(_0x4470da,_0x74af66){var _0x4b32ea={'raw':!![],'where':{}};var _0x23139f={};var _0x74c7b2={'count':0x0,'rows':[]};return db['MailAccount'][_0x9fbc('0x6b')]({'where':{'id':_0x4470da[_0x9fbc('0x65')]['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x74af66,null))[_0x9fbc('0xf')](function(_0x23c11a){if(_0x23c11a){_0x23139f[_0x9fbc('0x49')]=_[_0x9fbc('0x4b')](db[_0x9fbc('0x95')][_0x9fbc('0x45')]);_0x23139f[_0x9fbc('0x4c')]=_[_0x9fbc('0x4b')](_0x4470da[_0x9fbc('0x4c')]);_0x23139f[_0x9fbc('0x4d')]=_[_0x9fbc('0x5e')](_0x23139f[_0x9fbc('0x49')],_0x23139f['query']);_0x4b32ea[_0x9fbc('0x4f')]=_[_0x9fbc('0x5e')](_0x23139f[_0x9fbc('0x49')],qs[_0x9fbc('0x4e')](_0x4470da[_0x9fbc('0x4c')]['fields']));_0x4b32ea[_0x9fbc('0x4f')]=_0x4b32ea[_0x9fbc('0x4f')][_0x9fbc('0x5f')]?_0x4b32ea[_0x9fbc('0x4f')]:_0x23139f[_0x9fbc('0x49')];if(!_0x4470da[_0x9fbc('0x4c')][_0x9fbc('0x6d')](_0x9fbc('0x50'))){_0x4b32ea[_0x9fbc('0x1e')]=qs[_0x9fbc('0x1e')](_0x4470da['query'][_0x9fbc('0x1e')]);_0x4b32ea['offset']=qs[_0x9fbc('0x21')](_0x4470da[_0x9fbc('0x4c')][_0x9fbc('0x21')]);}_0x4b32ea[_0x9fbc('0x51')]=qs['sort'](_0x4470da[_0x9fbc('0x4c')][_0x9fbc('0x52')]);_0x4b32ea['where']=qs[_0x9fbc('0x4d')](_[_0x9fbc('0x54')](_0x4470da[_0x9fbc('0x4c')],_0x23139f['filters']));_0x4b32ea['where'][_0x9fbc('0x6a')]=_0x23c11a['id'];if(_0x4470da[_0x9fbc('0x4c')][_0x9fbc('0x55')]){_0x4b32ea[_0x9fbc('0x53')]=_['merge'](_0x4b32ea['where'],{'$or':_[_0x9fbc('0x4a')](_0x4b32ea[_0x9fbc('0x4f')],function(_0x203f67){var _0x31f310={};_0x31f310[_0x203f67]={'$like':'%'+_0x4470da[_0x9fbc('0x4c')][_0x9fbc('0x55')]+'%'};return _0x31f310;})});}if(_0x4470da[_0x9fbc('0x4c')][_0x9fbc('0x96')]){var _0x2fda1f=_0x4470da[_0x9fbc('0x4c')]['$gte'][_0x9fbc('0x97')](',');var _0x6fc7fd={};_0x6fc7fd[_0x2fda1f[0x0]]={'$gte':moment(_0x2fda1f[0x1])['format'](_0x9fbc('0x98'))};_0x4b32ea[_0x9fbc('0x53')]=_[_0x9fbc('0x56')](_0x4b32ea['where'],_0x6fc7fd);}_0x4b32ea=_['merge']({},_0x4b32ea,_0x4470da[_0x9fbc('0x58')]);return db[_0x9fbc('0x95')][_0x9fbc('0x20')]({'where':_0x4b32ea['where']})[_0x9fbc('0xf')](function(_0x2331eb){_0x74c7b2[_0x9fbc('0x20')]=_0x2331eb;if(_0x4470da[_0x9fbc('0x4c')][_0x9fbc('0x59')]){_0x4b32ea[_0x9fbc('0x60')]=[{'all':!![]}];}return db[_0x9fbc('0x95')]['findAll'](_0x4b32ea);})[_0x9fbc('0xf')](function(_0x603eb5){if(_0x4470da[_0x9fbc('0x4c')][_0x9fbc('0x99')]===_0x9fbc('0x9a')){for(var _0x52099d=0x0;_0x52099d<_0x603eb5['length'];_0x52099d++){_0x603eb5[_0x52099d][_0x9fbc('0x62')]=juice(_0x603eb5[_0x52099d]['body']);}}_0x74c7b2['rows']=_0x603eb5;return _0x74c7b2;});}})[_0x9fbc('0xf')](respondWithFilteredResult(_0x74af66,_0x4b32ea))[_0x9fbc('0x19')](handleError(_0x74af66,null));};exports[_0x9fbc('0x29')]=function(_0x52a186,_0x59adbf){var _0x4a403a,_0xf8484={},_0x483482;if(_0x52a186['body']['to']){_0x483482=_0x52a186[_0x9fbc('0x62')]['to'][_0x9fbc('0x97')](',')[0x0];}return db[_0x9fbc('0x44')][_0x9fbc('0x61')]({'where':{'id':_0x52a186[_0x9fbc('0x65')]['id']},'include':[{'model':db['CmList'],'as':_0x9fbc('0x9b'),'include':[{'model':db['CmContact'],'as':_0x9fbc('0x9c'),'where':{'email':_0x483482},'limit':0x1,'order':[[_0x9fbc('0x9d'),'DESC']]}]},{'model':db[_0x9fbc('0x42')],'as':_0x9fbc('0x3f'),'raw':!![],'include':[{'model':db[_0x9fbc('0x9e')],'as':_0x9fbc('0x9e'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x59adbf,null))[_0x9fbc('0xf')](function(_0x340b23){if(!_0x340b23)return;_0x4a403a=_0x340b23;if(!_0x340b23[_0x9fbc('0x3f')])throw new Error(_0x9fbc('0x9f'));if(_[_0x9fbc('0xa0')](_0x52a186[_0x9fbc('0x62')][_0x9fbc('0xa1')])){_0x52a186[_0x9fbc('0x62')][_0x9fbc('0xa1')]=util[_0x9fbc('0xa2')]('%s\x20<%s>',_0x340b23[_0x9fbc('0x28')],_0x340b23[_0x9fbc('0xa3')]||_0x340b23[_0x9fbc('0x3f')][_0x9fbc('0x33')]);}if(_0x52a186[_0x9fbc('0x62')][_0x9fbc('0xa4')]&&_0x52a186[_0x9fbc('0x62')]['attachments'][_0x9fbc('0x5f')]){for(var _0x1d5d9f=0x0;_0x1d5d9f<_0x52a186[_0x9fbc('0x62')][_0x9fbc('0xa4')][_0x9fbc('0x5f')];_0x1d5d9f+=0x1){_0x52a186[_0x9fbc('0x62')]['attachments'][_0x1d5d9f]={'filename':_0x52a186[_0x9fbc('0x62')]['attachments'][_0x1d5d9f]['name'],'path':path[_0x9fbc('0xa5')](config[_0x9fbc('0xa6')],_0x9fbc('0xa7'),_0x52a186[_0x9fbc('0x62')][_0x9fbc('0xa4')][_0x1d5d9f][_0x9fbc('0xa8')])};}}var _0x1e12d6=_0x340b23[_0x9fbc('0xa9')]();return respondWithRpcPromise(_0x9fbc('0xaa'),_0x9fbc('0xab'),{'account':_0x1e12d6,'message':_0x52a186['body']});})[_0x9fbc('0xf')](function(_0x3eb38f){if(!_0x3eb38f)return;_0xf8484=_0x3eb38f;if(!_0x4a403a['List'])throw new Error('List\x20not\x20found');if(_0x4a403a['List'][_0x9fbc('0x9c')]['length'])return _0x4a403a['List']['Contacts'][0x0];return db[_0x9fbc('0xac')][_0x9fbc('0x6f')](_[_0x9fbc('0xad')](_0x52a186[_0x9fbc('0x62')],{'firstName':_0x52a186[_0x9fbc('0x62')]['to'],'email':_0x52a186['body']['to'],'phone':_0x52a186[_0x9fbc('0x62')]['to'],'ListId':_0x4a403a[_0x9fbc('0x74')]}));})[_0x9fbc('0xf')](function(_0x55c35b){if(!_0x55c35b)return;var _0x4667dd={'UserId':_0x52a186[_0x9fbc('0x33')]['id'],'ContactId':_0x55c35b['id'],'MailAccountId':_0x4a403a['id'],'inReplyTo':_0xf8484[_0x9fbc('0xae')],'to':_0x52a186[_0x9fbc('0x62')]['from'],'cc':_0x52a186[_0x9fbc('0x62')]['cc'],'subject':_0x52a186['body'][_0x9fbc('0xaf')],'attach':_0x52a186[_0x9fbc('0x62')][_0x9fbc('0xb0')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x9fbc('0xa2')](_0x9fbc('0x98')),'lastMsgDirection':_0x9fbc('0xb1'),'Messages':[_[_0x9fbc('0x56')](_0x52a186[_0x9fbc('0x62')],{'messageId':_0xf8484[_0x9fbc('0xae')],'sentAt':moment()[_0x9fbc('0xa2')](_0x9fbc('0x98')),'read':!![],'MailAccountId':_0x4a403a['id'],'UserId':_0x52a186['user']['id'],'ContactId':_0x55c35b['id']})]};if(_0x52a186[_0x9fbc('0x62')][_0x9fbc('0xb2')]){_0x4667dd=_[_0x9fbc('0x56')](_0x4667dd,_0x52a186['body'][_0x9fbc('0xb2')]);}return db['MailInteraction'][_0x9fbc('0x6f')](_0x4667dd,{'include':[{'model':db[_0x9fbc('0x95')],'as':_0x9fbc('0xb3')}]});})[_0x9fbc('0xf')](respondWithResult(_0x59adbf,null))[_0x9fbc('0x19')](handleError(_0x59adbf,null));};exports[_0x9fbc('0xb4')]=function(_0xc490ee,_0x597e3c){return db[_0x9fbc('0x44')][_0x9fbc('0x61')]({'where':{'id':_0xc490ee[_0x9fbc('0x65')]['id']},'include':[{'model':db[_0x9fbc('0x42')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x9fbc('0xf')](handleEntityNotFound(_0x597e3c,null))['then'](function(_0x373171){if(!_0x373171[_0x9fbc('0x3f')])return;var _0x2e1d61=_0x373171['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x2e1d61});})[_0x9fbc('0xf')](respondWithResult(_0x597e3c,null))['catch'](handleError(_0x597e3c,null));};exports[_0x9fbc('0x24')]=function(_0x4cdba7,_0x431011){return db[_0x9fbc('0x44')][_0x9fbc('0x61')]({'where':{'id':_0x4cdba7['params']['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x431011,null))['then'](function(_0x7883a1){if(_0x7883a1&&_0x7883a1[_0x9fbc('0x3b')]){throw new db[(_0x9fbc('0xb5'))][(_0x9fbc('0xb6'))](_0x9fbc('0xb7'));}return _0x7883a1;})['then'](removeEntity(_0x431011,null))[_0x9fbc('0x19')](handleError(_0x431011,null));};exports[_0x9fbc('0xb8')]=function(_0x21f874,_0x410b74){return db[_0x9fbc('0x44')][_0x9fbc('0x61')]({'where':{'id':_0x21f874[_0x9fbc('0x65')]['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x410b74,null))['then'](function(_0x4ab22e){if(_0x4ab22e){return _0x4ab22e[_0x9fbc('0xb8')](_0x21f874[_0x9fbc('0x62')][_0x9fbc('0x73')],_[_0x9fbc('0xb9')](_0x21f874[_0x9fbc('0x62')],['ids','id'])||{})[_0x9fbc('0xba')](function(_0x56e20d){for(var _0x49ddf9=0x0;_0x49ddf9<_0x21f874[_0x9fbc('0x62')][_0x9fbc('0x73')]['length'];_0x49ddf9+=0x1){socket[_0x9fbc('0xbb')]('userMailAccount:save',{'UserId':Number(_0x21f874[_0x9fbc('0x62')]['ids'][_0x49ddf9]),'MailAccountId':Number(_0x21f874[_0x9fbc('0x65')]['id'])});}return _0x56e20d;});}})[_0x9fbc('0xf')](respondWithResult(_0x410b74,null))[_0x9fbc('0x19')](handleError(_0x410b74,null));};exports[_0x9fbc('0xbc')]=function(_0x338606,_0x1eac96){return db[_0x9fbc('0x44')][_0x9fbc('0x61')]({'where':{'id':_0x338606['params']['id']}})['then'](handleEntityNotFound(_0x1eac96,null))[_0x9fbc('0xf')](function(_0x42e463){if(_0x42e463){return _0x42e463[_0x9fbc('0xbc')](_0x338606['query'][_0x9fbc('0x73')])[_0x9fbc('0xf')](function(){if(_[_0x9fbc('0xbd')](_0x338606['query']['ids'])){for(var _0x4d44e3=0x0;_0x4d44e3<_0x338606[_0x9fbc('0x4c')][_0x9fbc('0x73')]['length'];_0x4d44e3+=0x1){socket[_0x9fbc('0xbb')](_0x9fbc('0xbe'),{'UserId':Number(_0x338606[_0x9fbc('0x4c')][_0x9fbc('0x73')][_0x4d44e3]),'MailAccountId':Number(_0x338606[_0x9fbc('0x65')]['id'])});}}else{socket[_0x9fbc('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x338606[_0x9fbc('0x4c')][_0x9fbc('0x73')]),'MailAccountId':Number(_0x338606['params']['id'])});}});}})[_0x9fbc('0xf')](respondWithStatusCode(_0x1eac96,null))['catch'](handleError(_0x1eac96,null));};exports['getAgents']=function(_0x360c85,_0x59a872){var _0x216674={};var _0x4d5327={};var _0xe037ec;var _0x511e87;return db[_0x9fbc('0x44')][_0x9fbc('0x6b')]({'where':{'id':_0x360c85[_0x9fbc('0x65')]['id']}})[_0x9fbc('0xf')](handleEntityNotFound(_0x59a872,null))['then'](function(_0x544e7a){if(_0x544e7a){_0xe037ec=_0x544e7a;_0x4d5327[_0x9fbc('0x49')]=_[_0x9fbc('0x4b')](db[_0x9fbc('0xbf')][_0x9fbc('0x45')]);_0x4d5327['query']=_['keys'](_0x360c85[_0x9fbc('0x4c')]);_0x4d5327[_0x9fbc('0x4d')]=_[_0x9fbc('0x5e')](_0x4d5327[_0x9fbc('0x49')],_0x4d5327[_0x9fbc('0x4c')]);_0x216674[_0x9fbc('0x4f')]=_[_0x9fbc('0x5e')](_0x4d5327['model'],qs['fields'](_0x360c85[_0x9fbc('0x4c')][_0x9fbc('0x4e')]));_0x216674[_0x9fbc('0x4f')]=_0x216674['attributes'][_0x9fbc('0x5f')]?_0x216674['attributes']:_0x4d5327[_0x9fbc('0x49')];_0x216674[_0x9fbc('0x51')]=qs['sort'](_0x360c85[_0x9fbc('0x4c')][_0x9fbc('0x52')]);_0x216674[_0x9fbc('0x53')]=qs[_0x9fbc('0x4d')](_['pick'](_0x360c85[_0x9fbc('0x4c')],_0x4d5327[_0x9fbc('0x4d')]));if(_0x360c85['query']['filter']){_0x216674[_0x9fbc('0x53')]=_[_0x9fbc('0x56')](_0x216674['where'],{'$or':_[_0x9fbc('0x4a')](_0x216674['attributes'],function(_0x3f6909){var _0x532b8d={};_0x532b8d[_0x3f6909]={'$like':'%'+_0x360c85[_0x9fbc('0x4c')][_0x9fbc('0x55')]+'%'};return _0x532b8d;})});}_0x216674=_[_0x9fbc('0x56')]({},_0x216674,_0x360c85['options']);return _0xe037ec[_0x9fbc('0xc0')](_0x216674);}})['then'](function(_0x218703){if(_0x218703){_0x511e87=_0x218703[_0x9fbc('0x5f')];if(!_0x360c85[_0x9fbc('0x4c')]['hasOwnProperty']('nolimit')){_0x216674[_0x9fbc('0x1e')]=qs[_0x9fbc('0x1e')](_0x360c85[_0x9fbc('0x4c')][_0x9fbc('0x1e')]);_0x216674[_0x9fbc('0x21')]=qs[_0x9fbc('0x21')](_0x360c85[_0x9fbc('0x4c')][_0x9fbc('0x21')]);}return _0xe037ec[_0x9fbc('0xc0')](_0x216674);}})[_0x9fbc('0xf')](function(_0x4eb0ec){if(_0x4eb0ec){return _0x4eb0ec?{'count':_0x511e87,'rows':_0x4eb0ec}:null;}})[_0x9fbc('0xf')](respondWithResult(_0x59a872,null))[_0x9fbc('0x19')](handleError(_0x59a872,null));}; \ No newline at end of file +var _0x44fd=['server/files/attachments','getSmtpOptions','SendMail','sendMail','messageId','subject','attach','out','Interaction','Messages','verifySmtp','ValidationError','addAgents','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','path','lodash','juice','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','update','destroy','MailAccounts','UserProfileResource','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','hotmail','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','user','Imap','Smtp','MailServerIn','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','MailServerOut','options','find','body','custom','provider','Mail\x20Account\x20not\x20found','catch','describe','addDisposition','MailAccountId','create','getDispositions','findOne','Disposition','sort','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','ListId','active','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','Owner','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','email','attachments','join'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x44fd,0x186));var _0xd44f=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0x44fd[_0x1a8ff0];return _0x3588bf;};'use strict';var moment=require(_0xd44f('0x0'));var BPromise=require(_0xd44f('0x1'));var util=require('util');var path=require(_0xd44f('0x2'));var _=require(_0xd44f('0x3'));var juice=require(_0xd44f('0x4'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xd44f('0x5'))(_0xd44f('0x6'));var config=require(_0xd44f('0x7'));var db=require('../../mysqldb')['db'];config[_0xd44f('0x8')]=_[_0xd44f('0x9')](config[_0xd44f('0x8')],{'host':_0xd44f('0xa'),'port':0x18eb});var socket=require(_0xd44f('0xb'))(new Redis(config[_0xd44f('0x8')]));require(_0xd44f('0xc'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xd44f('0xd')]({'port':0x232b});function respondWithRpcPromise(_0x5eafed,_0x2f5ba6,_0x1b67b3,_0x56c0bc){return new BPromise(function(_0x10c452,_0x767bfb){var _0x1d7c62=_0x56c0bc||client;return _0x1d7c62[_0xd44f('0xe')](_0x5eafed,_0x1b67b3)[_0xd44f('0xf')](function(_0x51e52a){logger[_0xd44f('0x10')](_0xd44f('0x11'),_0x2f5ba6,_0xd44f('0x12'));logger[_0xd44f('0x13')](_0xd44f('0x14'),_0x2f5ba6,_0xd44f('0x12'),JSON[_0xd44f('0x15')](_0x51e52a));if(_0x51e52a['error']){if(_0x51e52a[_0xd44f('0x16')]['code']===0x1f4){logger[_0xd44f('0x16')]('MailAccount,\x20%s,\x20%s',_0x2f5ba6,_0x51e52a[_0xd44f('0x16')][_0xd44f('0x17')]);return _0x767bfb(_0x51e52a[_0xd44f('0x16')]['message']);}logger[_0xd44f('0x16')](_0xd44f('0x11'),_0x2f5ba6,_0x51e52a['error'][_0xd44f('0x17')]);return _0x10c452(_0x51e52a[_0xd44f('0x16')]['message']);}else{logger[_0xd44f('0x10')]('MailAccount,\x20%s,\x20%s',_0x2f5ba6,_0xd44f('0x12'));_0x10c452(_0x51e52a[_0xd44f('0x18')][_0xd44f('0x17')]);}})['catch'](function(_0xb9648c){logger[_0xd44f('0x16')](_0xd44f('0x11'),_0x2f5ba6,_0xb9648c);_0x767bfb(_0xb9648c);});});}function respondWithStatusCode(_0x1e1556,_0x1d4718){_0x1d4718=_0x1d4718||0xcc;return function(_0x41ef04){if(_0x41ef04){return _0x1e1556[_0xd44f('0x19')](_0x1d4718);}return _0x1e1556[_0xd44f('0x1a')](_0x1d4718)[_0xd44f('0x1b')]();};}function respondWithResult(_0x33e860,_0x22885d){_0x22885d=_0x22885d||0xc8;return function(_0xe5f0fa){if(_0xe5f0fa){return _0x33e860[_0xd44f('0x1a')](_0x22885d)[_0xd44f('0x1c')](_0xe5f0fa);}};}function respondWithFilteredResult(_0x1d4512,_0x2d3e3b){return function(_0x43c66f){if(_0x43c66f){var _0x1c4960=typeof _0x2d3e3b[_0xd44f('0x1d')]===_0xd44f('0x1e')&&typeof _0x2d3e3b['limit']==='undefined';var _0x48d233=_0x43c66f[_0xd44f('0x1f')];var _0x435e6e=_0x1c4960?0x0:_0x2d3e3b[_0xd44f('0x1d')];var _0x3f24f1=_0x1c4960?_0x43c66f[_0xd44f('0x1f')]:_0x2d3e3b['offset']+_0x2d3e3b[_0xd44f('0x20')];var _0x22fd61;if(_0x3f24f1>=_0x48d233){_0x3f24f1=_0x48d233;_0x22fd61=0xc8;}else{_0x22fd61=0xce;}_0x1d4512[_0xd44f('0x1a')](_0x22fd61);return _0x1d4512[_0xd44f('0x21')]('Content-Range',_0x435e6e+'-'+_0x3f24f1+'/'+_0x48d233)[_0xd44f('0x1c')](_0x43c66f);}return null;};}function saveUpdates(_0x1d1aa3){return function(_0x54a84d){if(_0x54a84d){return _0x54a84d[_0xd44f('0x22')](_0x1d1aa3)[_0xd44f('0xf')](function(_0x501c41){return _0x501c41;});}return null;};}function removeEntity(_0x1dc014){return function(_0x4f8aeb){if(_0x4f8aeb){return _0x4f8aeb[_0xd44f('0x23')]()['then'](function(){var _0x40865a=_0x4f8aeb['get']({'plain':!![]});var _0x1a4904=_0xd44f('0x24');return db[_0xd44f('0x25')][_0xd44f('0x23')]({'where':{'type':_0x1a4904,'resourceId':_0x40865a['id']}})[_0xd44f('0xf')](function(){return _0x4f8aeb;});})['then'](function(){_0x1dc014[_0xd44f('0x1a')](0xcc)[_0xd44f('0x1b')]();});}};}function handleEntityNotFound(_0x1eaefe){return function(_0x5715b8){if(!_0x5715b8){_0x1eaefe['sendStatus'](0x194);}return _0x5715b8;};}function handleError(_0x3f9fde,_0xa4be89){_0xa4be89=_0xa4be89||0x1f4;return function(_0x3f2dfb){logger[_0xd44f('0x16')](_0x3f2dfb[_0xd44f('0x26')]);if(_0x3f2dfb[_0xd44f('0x27')]){delete _0x3f2dfb[_0xd44f('0x27')];}_0x3f9fde['status'](_0xa4be89)[_0xd44f('0x28')](_0x3f2dfb);};}function getImapHost(_0x46d4ed){switch(_0x46d4ed){case _0xd44f('0x29'):return _0xd44f('0x2a');case _0xd44f('0x2b'):return _0xd44f('0x2c');case'hotmail':return _0xd44f('0x2d');case _0xd44f('0x2e'):return _0xd44f('0x2f');}throw new Error(_0xd44f('0x30'),_0x46d4ed);}function getSmtpHost(_0x5398e8){switch(_0x5398e8){case _0xd44f('0x29'):return'smtp.gmail.com';case _0xd44f('0x2b'):return _0xd44f('0x31');case _0xd44f('0x32'):return'smtp-mail.outlook.com';case _0xd44f('0x2e'):return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x5398e8);}function getAuthenticationOptions(_0x2b8559,_0x1ad24b){var _0x19a7cc={};var _0x42a1db={};if(_0x2b8559){_0x19a7cc['user']=_0x42a1db['user']=_0x1ad24b[_0xd44f('0x33')];_0x19a7cc[_0xd44f('0x34')]=_0x42a1db[_0xd44f('0x35')]=_0x1ad24b['password'];if(_0x1ad24b[_0xd44f('0x36')]){_0x19a7cc[_0xd44f('0x36')]=_0x42a1db[_0xd44f('0x36')]=!![];_0x19a7cc['CloudProviderId']=_0x42a1db[_0xd44f('0x37')]=_0x1ad24b['CloudProviderId'];_0x19a7cc[_0xd44f('0x34')]=_0x42a1db[_0xd44f('0x35')]=null;}else{_0x19a7cc[_0xd44f('0x37')]=_0x42a1db['CloudProviderId']=null;}_0x19a7cc[_0xd44f('0x38')]=getImapHost(_0x2b8559);_0x19a7cc['port']=0x3e1;_0x42a1db[_0xd44f('0x38')]=getSmtpHost(_0x2b8559);_0x42a1db[_0xd44f('0x39')]=0x24b;_0x42a1db[_0xd44f('0x3a')]=![];_0x19a7cc[_0xd44f('0x3b')]=_0x42a1db[_0xd44f('0x3b')]=null;}else{if(_0x1ad24b[_0xd44f('0x3c')]){_0x19a7cc[_0xd44f('0x3d')]=_0x42a1db[_0xd44f('0x3d')]=_0x1ad24b[_0xd44f('0x33')];_0x19a7cc['password']=_0x42a1db['pass']=_0x1ad24b[_0xd44f('0x34')];}else{_0x19a7cc[_0xd44f('0x3c')]=_0x42a1db[_0xd44f('0x3c')]=![];_0x19a7cc[_0xd44f('0x3d')]=_0x42a1db['user']=null;_0x19a7cc[_0xd44f('0x34')]=_0x42a1db[_0xd44f('0x35')]=null;}_0x19a7cc['host']=_0x1ad24b[_0xd44f('0x3e')][_0xd44f('0x38')];_0x19a7cc[_0xd44f('0x39')]=_0x1ad24b['Imap'][_0xd44f('0x39')];_0x42a1db['host']=_0x1ad24b[_0xd44f('0x3f')][_0xd44f('0x38')];_0x42a1db['port']=_0x1ad24b[_0xd44f('0x3f')][_0xd44f('0x39')];}return{'Imap':_0x19a7cc,'Smtp':_0x42a1db};}exports['index']=function(_0x284bab,_0x14fa47){var _0x55a7c3={'include':[{'model':db[_0xd44f('0x40')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xd44f('0x3f')},{'model':db[_0xd44f('0x41')],'as':_0xd44f('0x42')}]},_0x1ed2d2={},_0x335ef5={'count':0x0,'rows':[]};var _0x2062ba=_[_0xd44f('0x43')](db[_0xd44f('0x44')][_0xd44f('0x45')],function(_0x10cfb0){return{'name':_0x10cfb0['fieldName'],'type':_0x10cfb0[_0xd44f('0x46')][_0xd44f('0x47')]};});_0x1ed2d2['model']=_[_0xd44f('0x43')](_0x2062ba,'name');_0x1ed2d2[_0xd44f('0x48')]=_[_0xd44f('0x49')](_0x284bab[_0xd44f('0x48')]);_0x1ed2d2[_0xd44f('0x4a')]=_['intersection'](_0x1ed2d2['model'],_0x1ed2d2[_0xd44f('0x48')]);_0x55a7c3[_0xd44f('0x4b')]=_[_0xd44f('0x4c')](_0x1ed2d2[_0xd44f('0x4d')],qs[_0xd44f('0x4e')](_0x284bab['query']['fields']));_0x55a7c3[_0xd44f('0x4b')]=_0x55a7c3[_0xd44f('0x4b')][_0xd44f('0x4f')]?_0x55a7c3[_0xd44f('0x4b')]:_0x1ed2d2['model'];if(!_0x284bab[_0xd44f('0x48')][_0xd44f('0x50')](_0xd44f('0x51'))){_0x55a7c3['limit']=qs[_0xd44f('0x20')](_0x284bab[_0xd44f('0x48')][_0xd44f('0x20')]);_0x55a7c3[_0xd44f('0x1d')]=qs[_0xd44f('0x1d')](_0x284bab[_0xd44f('0x48')][_0xd44f('0x1d')]);}_0x55a7c3[_0xd44f('0x52')]=qs['sort'](_0x284bab['query']['sort']);_0x55a7c3[_0xd44f('0x53')]=qs[_0xd44f('0x4a')](_['pick'](_0x284bab[_0xd44f('0x48')],_0x1ed2d2['filters']),_0x2062ba);if(_0x284bab['query'][_0xd44f('0x54')]){_0x55a7c3['where']=_[_0xd44f('0x55')](_0x55a7c3[_0xd44f('0x53')],{'$or':_[_0xd44f('0x43')](_0x2062ba,function(_0xf13e55){if(_0xf13e55[_0xd44f('0x46')]!==_0xd44f('0x56')){var _0x1389f5={};_0x1389f5[_0xf13e55['name']]={'$like':'%'+_0x284bab[_0xd44f('0x48')]['filter']+'%'};return _0x1389f5;}})});}_0x55a7c3=_[_0xd44f('0x55')]({},_0x55a7c3,_0x284bab['options']);var _0x45e82e={'where':_0x55a7c3[_0xd44f('0x53')]};return db[_0xd44f('0x44')][_0xd44f('0x1f')](_0x45e82e)[_0xd44f('0xf')](function(_0x6498ae){_0x335ef5[_0xd44f('0x1f')]=_0x6498ae;if(_0x284bab[_0xd44f('0x48')][_0xd44f('0x57')]){_0x55a7c3[_0xd44f('0x58')]=[{'all':!![]}];}return db[_0xd44f('0x44')][_0xd44f('0x59')](_0x55a7c3);})[_0xd44f('0xf')](function(_0x1ba1f0){_0x335ef5[_0xd44f('0x5a')]=_0x1ba1f0;return _0x335ef5;})[_0xd44f('0xf')](respondWithFilteredResult(_0x14fa47,_0x55a7c3))['catch'](handleError(_0x14fa47,null));};exports['show']=function(_0x55f99f,_0x261726){var _0x382fbd={'raw':![],'where':{'id':_0x55f99f[_0xd44f('0x5b')]['id']},'include':[{'model':db[_0xd44f('0x40')],'as':'Imap'},{'model':db[_0xd44f('0x5c')],'as':_0xd44f('0x3f')},{'model':db[_0xd44f('0x41')],'as':_0xd44f('0x42')}]},_0x33f5ce={};_0x33f5ce['model']=_[_0xd44f('0x49')](db[_0xd44f('0x44')]['rawAttributes']);_0x33f5ce[_0xd44f('0x48')]=_[_0xd44f('0x49')](_0x55f99f[_0xd44f('0x48')]);_0x33f5ce[_0xd44f('0x4a')]=_[_0xd44f('0x4c')](_0x33f5ce[_0xd44f('0x4d')],_0x33f5ce['query']);_0x382fbd[_0xd44f('0x4b')]=_[_0xd44f('0x4c')](_0x33f5ce['model'],qs[_0xd44f('0x4e')](_0x55f99f[_0xd44f('0x48')][_0xd44f('0x4e')]));_0x382fbd[_0xd44f('0x4b')]=_0x382fbd['attributes'][_0xd44f('0x4f')]?_0x382fbd[_0xd44f('0x4b')]:_0x33f5ce[_0xd44f('0x4d')];if(_0x55f99f[_0xd44f('0x48')]['includeAll']){_0x382fbd[_0xd44f('0x58')]=[{'all':!![]}];}_0x382fbd=_[_0xd44f('0x55')]({},_0x382fbd,_0x55f99f[_0xd44f('0x5d')]);return db[_0xd44f('0x44')][_0xd44f('0x5e')](_0x382fbd)[_0xd44f('0xf')](handleEntityNotFound(_0x261726,null))[_0xd44f('0xf')](respondWithResult(_0x261726,null))['catch'](handleError(_0x261726,null));};exports[_0xd44f('0x22')]=function(_0xbccb2c,_0x51c08b){if(_0xbccb2c['body']['id']){delete _0xbccb2c[_0xd44f('0x5f')]['id'];}var _0x3b2507=_0xbccb2c[_0xd44f('0x5f')]['provider']===_0xd44f('0x60')?null:_0xbccb2c[_0xd44f('0x5f')][_0xd44f('0x61')];var _0x39ea48=_0xbccb2c[_0xd44f('0x5f')][_0xd44f('0x3e')]||{};var _0x829e32=_0xbccb2c['body']['Smtp']||{};if(_0x3b2507){_0x39ea48[_0xd44f('0x38')]=getImapHost(_0x3b2507);_0x39ea48[_0xd44f('0x39')]=0x3e1;_0x829e32['host']=getSmtpHost(_0x3b2507);_0x829e32[_0xd44f('0x39')]=0x24b;_0x829e32['secure']=![];}if(_0x829e32[_0xd44f('0x36')]){_0x829e32['secure']=![];}else{_0x829e32[_0xd44f('0x37')]=null;}if(!_0x39ea48[_0xd44f('0x36')])_0x39ea48[_0xd44f('0x37')]=null;_0xbccb2c['body'][_0xd44f('0x3e')]=_0x39ea48;_0xbccb2c[_0xd44f('0x5f')][_0xd44f('0x3f')]=_0x829e32;return db[_0xd44f('0x44')]['find']({'where':{'id':_0xbccb2c['params']['id']},'include':[{'model':db[_0xd44f('0x40')],'as':_0xd44f('0x3e')},{'model':db[_0xd44f('0x5c')],'as':_0xd44f('0x3f')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xd44f('0xf')](handleEntityNotFound(_0x51c08b,null))[_0xd44f('0xf')](function(_0x253cb3){if(!_0x253cb3)throw new Error(_0xd44f('0x62'));if(_0x253cb3[_0xd44f('0x3b')])delete _0xbccb2c[_0xd44f('0x5f')][_0xd44f('0x3e')];return _0x253cb3;})[_0xd44f('0xf')](saveUpdates(_0xbccb2c[_0xd44f('0x5f')],null))[_0xd44f('0xf')](function(_0x400577){if(!_0xbccb2c['body'][_0xd44f('0x3e')])return _0x400577;return db[_0xd44f('0x40')][_0xd44f('0x22')](_0xbccb2c[_0xd44f('0x5f')][_0xd44f('0x3e')],{'where':{'MailAccountId':_0x400577['id']}})[_0xd44f('0xf')](function(){return _0x400577;});})[_0xd44f('0xf')](function(_0x350ca7){if(!_0xbccb2c['body'][_0xd44f('0x3f')])return _0x350ca7;return db[_0xd44f('0x5c')][_0xd44f('0x22')](_0xbccb2c[_0xd44f('0x5f')][_0xd44f('0x3f')],{'where':{'MailAccountId':_0x350ca7['id']}})[_0xd44f('0xf')](function(){return _0x350ca7;});})[_0xd44f('0xf')](respondWithResult(_0x51c08b,null))[_0xd44f('0x63')](handleError(_0x51c08b,null));};exports[_0xd44f('0x64')]=function(_0x512db4,_0x54fa17){return db[_0xd44f('0x44')][_0xd44f('0x64')]()[_0xd44f('0xf')](respondWithResult(_0x54fa17,null))[_0xd44f('0x63')](handleError(_0x54fa17,null));};exports[_0xd44f('0x65')]=function(_0x2c80cf,_0x25f8ce){if(_0x2c80cf[_0xd44f('0x5f')]['id']){delete _0x2c80cf[_0xd44f('0x5f')]['id'];}return db[_0xd44f('0x44')][_0xd44f('0x5e')]({'where':{'id':_0x2c80cf[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x25f8ce,null))['then'](function(_0x3de866){if(_0x3de866){_0x2c80cf[_0xd44f('0x5f')][_0xd44f('0x66')]=_0x3de866['id'];return db['Disposition'][_0xd44f('0x67')](_0x2c80cf[_0xd44f('0x5f')]);}})['then'](respondWithResult(_0x25f8ce,null))[_0xd44f('0x63')](handleError(_0x25f8ce,null));};exports[_0xd44f('0x68')]=function(_0x51299b,_0x4158cd){var _0x3ef4b0={'raw':![],'where':{}};var _0x4edce2={};var _0xf01080={'count':0x0,'rows':[]};return db[_0xd44f('0x44')][_0xd44f('0x69')]({'where':{'id':_0x51299b[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x4158cd,null))[_0xd44f('0xf')](function(_0x19ab98){if(_0x19ab98){_0x4edce2['model']=_[_0xd44f('0x49')](db[_0xd44f('0x6a')]['rawAttributes']);_0x4edce2[_0xd44f('0x48')]=_[_0xd44f('0x49')](_0x51299b[_0xd44f('0x48')]);_0x4edce2['filters']=_[_0xd44f('0x4c')](_0x4edce2[_0xd44f('0x4d')],_0x4edce2['query']);_0x3ef4b0['attributes']=_[_0xd44f('0x4c')](_0x4edce2[_0xd44f('0x4d')],qs[_0xd44f('0x4e')](_0x51299b[_0xd44f('0x48')]['fields']));_0x3ef4b0[_0xd44f('0x4b')]=_0x3ef4b0[_0xd44f('0x4b')][_0xd44f('0x4f')]?_0x3ef4b0[_0xd44f('0x4b')]:_0x4edce2[_0xd44f('0x4d')];if(!_0x51299b['query']['hasOwnProperty'](_0xd44f('0x51'))){_0x3ef4b0['limit']=qs[_0xd44f('0x20')](_0x51299b[_0xd44f('0x48')]['limit']);_0x3ef4b0[_0xd44f('0x1d')]=qs['offset'](_0x51299b['query']['offset']);}_0x3ef4b0['order']=qs[_0xd44f('0x6b')](_0x51299b[_0xd44f('0x48')][_0xd44f('0x6b')]);_0x3ef4b0['where']=qs['filters'](_[_0xd44f('0x6c')](_0x51299b[_0xd44f('0x48')],_0x4edce2[_0xd44f('0x4a')]));_0x3ef4b0[_0xd44f('0x53')][_0xd44f('0x66')]=_0x19ab98['id'];if(_0x51299b['query'][_0xd44f('0x54')]){_0x3ef4b0[_0xd44f('0x53')]=_[_0xd44f('0x55')](_0x3ef4b0[_0xd44f('0x53')],{'$or':_[_0xd44f('0x43')](_0x3ef4b0['attributes'],function(_0xc02302){var _0x5e7725={};_0x5e7725[_0xc02302]={'$like':'%'+_0x51299b[_0xd44f('0x48')][_0xd44f('0x54')]+'%'};return _0x5e7725;})});}_0x3ef4b0=_[_0xd44f('0x55')]({},_0x3ef4b0,_0x51299b['options']);return db[_0xd44f('0x6a')][_0xd44f('0x1f')]({'where':_0x3ef4b0[_0xd44f('0x53')]})[_0xd44f('0xf')](function(_0x16086f){_0xf01080[_0xd44f('0x1f')]=_0x16086f;if(_0x51299b[_0xd44f('0x48')][_0xd44f('0x57')]){_0x3ef4b0[_0xd44f('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xd44f('0x59')](_0x3ef4b0);})[_0xd44f('0xf')](function(_0x29a10a){_0xf01080[_0xd44f('0x5a')]=_0x29a10a;return _0xf01080;});}})[_0xd44f('0xf')](respondWithFilteredResult(_0x4158cd,_0x3ef4b0))[_0xd44f('0x63')](handleError(_0x4158cd,null));};exports[_0xd44f('0x6d')]=function(_0x1fd9b8,_0x255d05){return db[_0xd44f('0x44')]['find']({'where':{'id':_0x1fd9b8[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x255d05,null))[_0xd44f('0xf')](function(_0x212831){if(_0x212831){return _0x212831[_0xd44f('0x6d')](_0x1fd9b8[_0xd44f('0x48')][_0xd44f('0x6e')]);}})['then'](respondWithStatusCode(_0x255d05,null))[_0xd44f('0x63')](handleError(_0x255d05,null));};exports[_0xd44f('0x6f')]=function(_0x167ba6,_0x1adefc){if(_0x167ba6[_0xd44f('0x5f')]['id']){delete _0x167ba6[_0xd44f('0x5f')]['id'];}return db['MailAccount'][_0xd44f('0x5e')]({'where':{'id':_0x167ba6[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x1adefc,null))[_0xd44f('0xf')](function(_0xf013b3){if(_0xf013b3){_0x167ba6[_0xd44f('0x5f')]['MailAccountId']=_0xf013b3['id'];return db[_0xd44f('0x70')][_0xd44f('0x67')](_0x167ba6[_0xd44f('0x5f')]);}})['then'](respondWithResult(_0x1adefc,null))[_0xd44f('0x63')](handleError(_0x1adefc,null));};exports[_0xd44f('0x71')]=function(_0x4abb79,_0x240477){var _0x42b829={'raw':![],'where':{}};var _0x3e8aa7={};var _0x1cc1a6={'count':0x0,'rows':[]};return db[_0xd44f('0x44')][_0xd44f('0x69')]({'where':{'id':_0x4abb79[_0xd44f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x240477,null))['then'](function(_0x31dd2e){if(_0x31dd2e){_0x3e8aa7[_0xd44f('0x4d')]=_[_0xd44f('0x49')](db[_0xd44f('0x70')][_0xd44f('0x45')]);_0x3e8aa7[_0xd44f('0x48')]=_['keys'](_0x4abb79['query']);_0x3e8aa7[_0xd44f('0x4a')]=_[_0xd44f('0x4c')](_0x3e8aa7['model'],_0x3e8aa7[_0xd44f('0x48')]);_0x42b829[_0xd44f('0x4b')]=_[_0xd44f('0x4c')](_0x3e8aa7[_0xd44f('0x4d')],qs[_0xd44f('0x4e')](_0x4abb79[_0xd44f('0x48')]['fields']));_0x42b829[_0xd44f('0x4b')]=_0x42b829[_0xd44f('0x4b')][_0xd44f('0x4f')]?_0x42b829[_0xd44f('0x4b')]:_0x3e8aa7['model'];if(!_0x4abb79[_0xd44f('0x48')][_0xd44f('0x50')](_0xd44f('0x51'))){_0x42b829[_0xd44f('0x20')]=qs[_0xd44f('0x20')](_0x4abb79['query']['limit']);_0x42b829[_0xd44f('0x1d')]=qs[_0xd44f('0x1d')](_0x4abb79[_0xd44f('0x48')]['offset']);}_0x42b829[_0xd44f('0x52')]=qs[_0xd44f('0x6b')](_0x4abb79[_0xd44f('0x48')]['sort']);_0x42b829[_0xd44f('0x53')]=qs[_0xd44f('0x4a')](_['pick'](_0x4abb79['query'],_0x3e8aa7[_0xd44f('0x4a')]));_0x42b829[_0xd44f('0x53')][_0xd44f('0x66')]=_0x31dd2e['id'];if(_0x4abb79['query'][_0xd44f('0x54')]){_0x42b829[_0xd44f('0x53')]=_[_0xd44f('0x55')](_0x42b829[_0xd44f('0x53')],{'$or':_['map'](_0x42b829['attributes'],function(_0x4b1a7e){var _0x202252={};_0x202252[_0x4b1a7e]={'$like':'%'+_0x4abb79[_0xd44f('0x48')][_0xd44f('0x54')]+'%'};return _0x202252;})});}_0x42b829=_['merge']({},_0x42b829,_0x4abb79[_0xd44f('0x5d')]);return db[_0xd44f('0x70')][_0xd44f('0x1f')]({'where':_0x42b829['where']})[_0xd44f('0xf')](function(_0x430d3c){_0x1cc1a6[_0xd44f('0x1f')]=_0x430d3c;if(_0x4abb79[_0xd44f('0x48')][_0xd44f('0x57')]){_0x42b829['include']=[{'all':!![]}];}return db[_0xd44f('0x70')]['findAll'](_0x42b829);})['then'](function(_0x20b0df){_0x1cc1a6[_0xd44f('0x5a')]=_0x20b0df;return _0x1cc1a6;});}})[_0xd44f('0xf')](respondWithFilteredResult(_0x240477,_0x42b829))[_0xd44f('0x63')](handleError(_0x240477,null));};exports[_0xd44f('0x72')]=function(_0x1201b2,_0x223c4b){return db['MailAccount'][_0xd44f('0x5e')]({'where':{'id':_0x1201b2[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x223c4b,null))[_0xd44f('0xf')](function(_0x1fe283){if(_0x1fe283){return _0x1fe283[_0xd44f('0x72')](_0x1201b2['query'][_0xd44f('0x6e')]);}})['then'](respondWithStatusCode(_0x223c4b,null))[_0xd44f('0x63')](handleError(_0x223c4b,null));};exports['create']=function(_0x11f0ae,_0x3421cf){var _0x4461cc={'name':_0x11f0ae[_0xd44f('0x5f')][_0xd44f('0x27')],'key':_0x11f0ae[_0xd44f('0x5f')][_0xd44f('0x47')],'provider':_0x11f0ae[_0xd44f('0x5f')][_0xd44f('0x61')]===_0xd44f('0x60')?null:_0x11f0ae[_0xd44f('0x5f')][_0xd44f('0x61')],'email':_0x11f0ae[_0xd44f('0x5f')]['email'],'ListId':_0x11f0ae[_0xd44f('0x5f')][_0xd44f('0x73')],'active':!_['isNil'](_0x11f0ae['body'][_0xd44f('0x74')])?_0x11f0ae[_0xd44f('0x5f')]['active']:!![],'description':_0x11f0ae[_0xd44f('0x5f')]['description']||null};var _0x50abef=getAuthenticationOptions(_0x4461cc[_0xd44f('0x61')],_0x11f0ae[_0xd44f('0x5f')]);_0x4461cc[_0xd44f('0x3e')]=_0x50abef[_0xd44f('0x3e')];_0x4461cc[_0xd44f('0x3f')]=_0x50abef[_0xd44f('0x3f')];return db['MailAccount']['create'](_0x4461cc,{'include':[{'model':db[_0xd44f('0x5c')],'as':_0xd44f('0x3f')},{'model':db['MailServerIn'],'as':_0xd44f('0x3e')}]})['then'](function(_0x33e3cb){var _0xca3efc=_0x11f0ae['user'][_0xd44f('0x75')]({'plain':!![]});if(!_0xca3efc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xca3efc['role']===_0xd44f('0x3d')){var _0x172102=_0x33e3cb[_0xd44f('0x75')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xd44f('0x24'),'userProfileId':_0xca3efc[_0xd44f('0x76')]},'raw':!![]})[_0xd44f('0xf')](function(_0x225c59){if(_0x225c59&&_0x225c59[_0xd44f('0x77')]===0x0){return db[_0xd44f('0x25')][_0xd44f('0x67')]({'name':_0x172102[_0xd44f('0x27')],'resourceId':_0x172102['id'],'type':_0x225c59['name'],'sectionId':_0x225c59['id']},{})[_0xd44f('0xf')](function(){return _0x33e3cb;});}else{return _0x33e3cb;}})[_0xd44f('0x63')](function(_0x3633c3){logger['error'](_0xd44f('0x78'),_0x3633c3);throw _0x3633c3;});}return _0x33e3cb;})['then'](respondWithResult(_0x3421cf,0xc9))[_0xd44f('0x63')](handleError(_0x3421cf,null));};exports[_0xd44f('0x79')]=function(_0x1ebc96,_0x888081){return db[_0xd44f('0x44')]['findOne']({'where':{'id':_0x1ebc96[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x888081,null))[_0xd44f('0xf')](function(_0x46a9c9){if(_0x46a9c9){return _0x46a9c9[_0xd44f('0x79')]();}return null;})[_0xd44f('0xf')](respondWithResult(_0x888081,null))['catch'](handleError(_0x888081,null));};exports[_0xd44f('0x7a')]=function(_0x443927,_0x114bc1){if(_0x443927[_0xd44f('0x5f')]['id']){delete _0x443927[_0xd44f('0x5f')]['id'];}return db[_0xd44f('0x44')][_0xd44f('0x5e')]({'where':{'id':_0x443927[_0xd44f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x114bc1,null))[_0xd44f('0xf')](function(_0x4f724e){if(_0x4f724e){_0x443927[_0xd44f('0x5f')][_0xd44f('0x66')]=_0x4f724e['id'];return db[_0xd44f('0x40')][_0xd44f('0x67')](_0x443927[_0xd44f('0x5f')]);}})[_0xd44f('0xf')](respondWithResult(_0x114bc1,null))['catch'](handleError(_0x114bc1,null));};exports['removeImap']=function(_0x167b7d,_0x368d4f){return db[_0xd44f('0x44')][_0xd44f('0x69')]({'where':{'id':_0x167b7d[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x368d4f,null))['then'](function(_0x2d1446){if(_0x2d1446){return _0x2d1446[_0xd44f('0x7b')](null);}return null;})['then'](respondWithStatusCode(_0x368d4f,null))[_0xd44f('0x63')](handleError(_0x368d4f,null));};exports['getSmtp']=function(_0x2761c9,_0x392702){return db[_0xd44f('0x44')][_0xd44f('0x69')]({'where':{'id':_0x2761c9[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x392702,null))[_0xd44f('0xf')](function(_0x1e104d){if(_0x1e104d){return _0x1e104d[_0xd44f('0x7c')]();}return null;})[_0xd44f('0xf')](respondWithResult(_0x392702,null))['catch'](handleError(_0x392702,null));};exports[_0xd44f('0x7d')]=function(_0xec4eca,_0x3bfc0d){if(_0xec4eca['body']['id']){delete _0xec4eca[_0xd44f('0x5f')]['id'];}return db[_0xd44f('0x44')][_0xd44f('0x5e')]({'where':{'id':_0xec4eca[_0xd44f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3bfc0d,null))[_0xd44f('0xf')](function(_0x4d5a95){if(_0x4d5a95){_0xec4eca[_0xd44f('0x5f')][_0xd44f('0x66')]=_0x4d5a95['id'];return db[_0xd44f('0x5c')][_0xd44f('0x67')](_0xec4eca[_0xd44f('0x5f')]);}})['then'](respondWithResult(_0x3bfc0d,null))[_0xd44f('0x63')](handleError(_0x3bfc0d,null));};exports[_0xd44f('0x7e')]=function(_0x1d73a6,_0x89b0ff){return db['MailAccount']['findOne']({'where':{'id':_0x1d73a6[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x89b0ff,null))['then'](function(_0x21a5c3){if(_0x21a5c3){return _0x21a5c3[_0xd44f('0x7f')](null);}return null;})[_0xd44f('0xf')](respondWithStatusCode(_0x89b0ff,null))['catch'](handleError(_0x89b0ff,null));};exports[_0xd44f('0x80')]=function(_0x565f67,_0x59c8b7){return db[_0xd44f('0x81')]['find']({'where':{'id':_0x565f67[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x59c8b7,null))[_0xd44f('0xf')](function(_0x326619){if(_0x326619){return _0x326619[_0xd44f('0x80')](_0x565f67['body'][_0xd44f('0x6e')],_['omit'](_0x565f67[_0xd44f('0x5f')],[_0xd44f('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x59c8b7,null))['catch'](handleError(_0x59c8b7,null));};exports[_0xd44f('0x82')]=function(_0x44eae4,_0x42b8dd){var _0x4b2979={'raw':![],'where':{}};var _0x3b0112={};var _0x373396={'count':0x0,'rows':[]};return db[_0xd44f('0x44')][_0xd44f('0x69')]({'where':{'id':_0x44eae4[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x42b8dd,null))[_0xd44f('0xf')](function(_0x3eacb5){if(_0x3eacb5){_0x3b0112['model']=_[_0xd44f('0x49')](db[_0xd44f('0x81')][_0xd44f('0x45')]);_0x3b0112[_0xd44f('0x48')]=_[_0xd44f('0x49')](_0x44eae4['query']);_0x3b0112[_0xd44f('0x4a')]=_[_0xd44f('0x4c')](_0x3b0112[_0xd44f('0x4d')],_0x3b0112['query']);_0x4b2979['attributes']=_[_0xd44f('0x4c')](_0x3b0112['model'],qs['fields'](_0x44eae4['query'][_0xd44f('0x4e')]));_0x4b2979[_0xd44f('0x4b')]=_0x4b2979['attributes'][_0xd44f('0x4f')]?_0x4b2979['attributes']:_0x3b0112[_0xd44f('0x4d')];if(!_0x44eae4[_0xd44f('0x48')][_0xd44f('0x50')]('nolimit')){_0x4b2979[_0xd44f('0x20')]=qs[_0xd44f('0x20')](_0x44eae4[_0xd44f('0x48')][_0xd44f('0x20')]);_0x4b2979['offset']=qs[_0xd44f('0x1d')](_0x44eae4[_0xd44f('0x48')][_0xd44f('0x1d')]);}_0x4b2979[_0xd44f('0x52')]=qs[_0xd44f('0x6b')](_0x44eae4[_0xd44f('0x48')]['sort']);_0x4b2979[_0xd44f('0x53')]=qs['filters'](_['pick'](_0x44eae4[_0xd44f('0x48')],_0x3b0112[_0xd44f('0x4a')]));_0x4b2979[_0xd44f('0x53')]['MailAccountId']=_0x3eacb5['id'];if(_0x44eae4[_0xd44f('0x48')][_0xd44f('0x54')]){_0x4b2979['where']=_['merge'](_0x4b2979[_0xd44f('0x53')],{'$or':_[_0xd44f('0x43')](_0x4b2979[_0xd44f('0x4b')],function(_0x56fdc0){var _0xa7c783={};_0xa7c783[_0x56fdc0]={'$like':'%'+_0x44eae4['query']['filter']+'%'};return _0xa7c783;})});}_0x4b2979=_[_0xd44f('0x55')]({},_0x4b2979,_0x44eae4['options']);return db[_0xd44f('0x81')]['count']({'where':_0x4b2979[_0xd44f('0x53')]})[_0xd44f('0xf')](function(_0x211734){_0x373396[_0xd44f('0x1f')]=_0x211734;if(_0x44eae4[_0xd44f('0x48')][_0xd44f('0x57')]){_0x4b2979[_0xd44f('0x58')]=[{'model':db[_0xd44f('0x83')],'as':_0xd44f('0x84'),'required':![]},{'model':db['User'],'as':_0xd44f('0x85'),'attributes':[_0xd44f('0x27'),'fullname',_0xd44f('0x86')],'required':![]},{'model':db[_0xd44f('0x87')],'as':_0xd44f('0x88'),'attributes':['id',_0xd44f('0x27'),_0xd44f('0x89')],'where':_0x44eae4[_0xd44f('0x48')][_0xd44f('0x8a')]?{'id':_0x44eae4[_0xd44f('0x48')][_0xd44f('0x8a')]}:undefined,'required':_0x44eae4['query'][_0xd44f('0x8a')]?!![]:![]}];}return db[_0xd44f('0x81')][_0xd44f('0x59')](_0x4b2979);})[_0xd44f('0xf')](function(_0x4d4efa){_0x373396[_0xd44f('0x5a')]=_0x4d4efa;return _0x373396;});}})[_0xd44f('0xf')](respondWithFilteredResult(_0x42b8dd,_0x4b2979))[_0xd44f('0x63')](handleError(_0x42b8dd,null));};exports[_0xd44f('0x8b')]=function addApplications(_0x39a92e,_0x2fddd9){var _0x3f5f23=_0x39a92e[_0xd44f('0x5b')]['id'];var _0x69a058=_0x39a92e[_0xd44f('0x5f')];var _0x511202=0xc8;var _0x883b65=null;return db['sequelize'][_0xd44f('0x8c')]({'isolationLevel':db[_0xd44f('0x8d')]['Transaction']['ISOLATION_LEVELS'][_0xd44f('0x8e')]},function(_0x373689){return db[_0xd44f('0x44')][_0xd44f('0x69')]({'where':{'id':_0x3f5f23},'transaction':_0x373689})[_0xd44f('0xf')](function(_0x1b2690){if(_0x1b2690){return db['MailApplication'][_0xd44f('0x23')]({'where':{'MailAccountId':_0x3f5f23},'transaction':_0x373689})['then'](function(){var _0x5be0b3=_['map'](_0x69a058,function(_0x26ae8f){_0x26ae8f[_0xd44f('0x66')]=_0x3f5f23;return _0x26ae8f;});return db[_0xd44f('0x8f')][_0xd44f('0x90')](_0x5be0b3,{'transaction':_0x373689});});}else{_0x511202=0x194;_0x883b65=[];}});})[_0xd44f('0xf')](function(){if(_0x511202!==0x194){return db[_0xd44f('0x8f')][_0xd44f('0x91')]({'where':{'MailAccountId':_0x3f5f23},'order':_0xd44f('0x92')})['then'](function(_0x36de1d){_0x883b65=_0x36de1d;});}})['catch'](function(_0x4c7011){_0x511202=0x1f4;logger[_0xd44f('0x16')](_0x4c7011[_0xd44f('0x26')]);if(_0x4c7011[_0xd44f('0x27')]){delete _0x4c7011[_0xd44f('0x27')];}_0x883b65=_0x4c7011;})[_0xd44f('0x93')](function(){if(_0x883b65===null){_0x2fddd9[_0xd44f('0x19')](_0x511202);}else{if(_0x511202===0x1f4){_0x2fddd9[_0xd44f('0x1a')](_0x511202)[_0xd44f('0x28')](_0x883b65);}else{_0x2fddd9[_0xd44f('0x1a')](_0x511202)['json'](_0x883b65);}}});};exports[_0xd44f('0x94')]=function(_0x481013,_0x163485){var _0x2ef673={};var _0x497077={};var _0x2925c9;var _0x5cbf5a;return db['MailAccount'][_0xd44f('0x69')]({'where':{'id':_0x481013[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x163485,null))[_0xd44f('0xf')](function(_0x4833dd){if(_0x4833dd){_0x2925c9=_0x4833dd;_0x497077[_0xd44f('0x4d')]=_[_0xd44f('0x49')](db[_0xd44f('0x8f')][_0xd44f('0x45')]);_0x497077[_0xd44f('0x48')]=_[_0xd44f('0x49')](_0x481013['query']);_0x497077[_0xd44f('0x4a')]=_['intersection'](_0x497077[_0xd44f('0x4d')],_0x497077[_0xd44f('0x48')]);_0x2ef673[_0xd44f('0x4b')]=_[_0xd44f('0x4c')](_0x497077[_0xd44f('0x4d')],qs['fields'](_0x481013[_0xd44f('0x48')][_0xd44f('0x4e')]));_0x2ef673[_0xd44f('0x4b')]=_0x2ef673['attributes']['length']?_0x2ef673[_0xd44f('0x4b')]:_0x497077[_0xd44f('0x4d')];_0x2ef673[_0xd44f('0x52')]=qs['sort'](_0x481013[_0xd44f('0x48')][_0xd44f('0x6b')]);_0x2ef673[_0xd44f('0x53')]=qs[_0xd44f('0x4a')](_[_0xd44f('0x6c')](_0x481013['query'],_0x497077[_0xd44f('0x4a')]));if(_0x481013[_0xd44f('0x48')][_0xd44f('0x54')]){_0x2ef673[_0xd44f('0x53')]=_[_0xd44f('0x55')](_0x2ef673['where'],{'$or':_[_0xd44f('0x43')](_0x2ef673[_0xd44f('0x4b')],function(_0x1a6e26){var _0x39c971={};_0x39c971[_0x1a6e26]={'$like':'%'+_0x481013[_0xd44f('0x48')]['filter']+'%'};return _0x39c971;})});}_0x2ef673=_[_0xd44f('0x55')]({},_0x2ef673,_0x481013['options']);return _0x2925c9['getApplications'](_0x2ef673);}})['then'](function(_0x2b283e){if(_0x2b283e){_0x5cbf5a=_0x2b283e[_0xd44f('0x4f')];if(!_0x481013[_0xd44f('0x48')][_0xd44f('0x50')](_0xd44f('0x51'))){_0x2ef673['limit']=qs[_0xd44f('0x20')](_0x481013[_0xd44f('0x48')]['limit']);_0x2ef673[_0xd44f('0x1d')]=qs[_0xd44f('0x1d')](_0x481013[_0xd44f('0x48')]['offset']);}return _0x2925c9[_0xd44f('0x94')](_0x2ef673);}})[_0xd44f('0xf')](function(_0x31538f){if(_0x31538f){return _0x31538f?{'count':_0x5cbf5a,'rows':_0x31538f}:null;}})[_0xd44f('0xf')](respondWithResult(_0x163485,null))['catch'](handleError(_0x163485,null));};exports[_0xd44f('0x95')]=function(_0x249208,_0x31884a){var _0xfd2d77={'raw':!![],'where':{}};var _0x2d6863={};var _0x433166={'count':0x0,'rows':[]};return db[_0xd44f('0x44')][_0xd44f('0x69')]({'where':{'id':_0x249208[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x31884a,null))[_0xd44f('0xf')](function(_0x119cd5){if(_0x119cd5){_0x2d6863['model']=_[_0xd44f('0x49')](db[_0xd44f('0x96')][_0xd44f('0x45')]);_0x2d6863['query']=_[_0xd44f('0x49')](_0x249208[_0xd44f('0x48')]);_0x2d6863['filters']=_[_0xd44f('0x4c')](_0x2d6863['model'],_0x2d6863[_0xd44f('0x48')]);_0xfd2d77[_0xd44f('0x4b')]=_[_0xd44f('0x4c')](_0x2d6863['model'],qs[_0xd44f('0x4e')](_0x249208[_0xd44f('0x48')][_0xd44f('0x4e')]));_0xfd2d77[_0xd44f('0x4b')]=_0xfd2d77['attributes'][_0xd44f('0x4f')]?_0xfd2d77[_0xd44f('0x4b')]:_0x2d6863['model'];if(!_0x249208[_0xd44f('0x48')][_0xd44f('0x50')]('nolimit')){_0xfd2d77[_0xd44f('0x20')]=qs[_0xd44f('0x20')](_0x249208[_0xd44f('0x48')]['limit']);_0xfd2d77[_0xd44f('0x1d')]=qs[_0xd44f('0x1d')](_0x249208['query']['offset']);}_0xfd2d77[_0xd44f('0x52')]=qs[_0xd44f('0x6b')](_0x249208[_0xd44f('0x48')][_0xd44f('0x6b')]);_0xfd2d77['where']=qs['filters'](_[_0xd44f('0x6c')](_0x249208['query'],_0x2d6863['filters']));_0xfd2d77[_0xd44f('0x53')][_0xd44f('0x66')]=_0x119cd5['id'];if(_0x249208[_0xd44f('0x48')][_0xd44f('0x54')]){_0xfd2d77['where']=_[_0xd44f('0x55')](_0xfd2d77[_0xd44f('0x53')],{'$or':_[_0xd44f('0x43')](_0xfd2d77[_0xd44f('0x4b')],function(_0xa59df7){var _0x62122f={};_0x62122f[_0xa59df7]={'$like':'%'+_0x249208[_0xd44f('0x48')]['filter']+'%'};return _0x62122f;})});}if(_0x249208['query']['$gte']){var _0x2ee9b8=_0x249208[_0xd44f('0x48')][_0xd44f('0x97')][_0xd44f('0x98')](',');var _0x36e942={};_0x36e942[_0x2ee9b8[0x0]]={'$gte':moment(_0x2ee9b8[0x1])[_0xd44f('0x99')](_0xd44f('0x9a'))};_0xfd2d77[_0xd44f('0x53')]=_['merge'](_0xfd2d77[_0xd44f('0x53')],_0x36e942);}_0xfd2d77=_[_0xd44f('0x55')]({},_0xfd2d77,_0x249208[_0xd44f('0x5d')]);return db[_0xd44f('0x96')][_0xd44f('0x1f')]({'where':_0xfd2d77[_0xd44f('0x53')]})[_0xd44f('0xf')](function(_0x46e2b6){_0x433166[_0xd44f('0x1f')]=_0x46e2b6;if(_0x249208['query'][_0xd44f('0x57')]){_0xfd2d77[_0xd44f('0x58')]=[{'all':!![]}];}return db[_0xd44f('0x96')][_0xd44f('0x59')](_0xfd2d77);})['then'](function(_0x400eb7){if(_0x249208[_0xd44f('0x48')]['inlineCss']==='true'){for(var _0x5cac41=0x0;_0x5cac41<_0x400eb7[_0xd44f('0x4f')];_0x5cac41++){_0x400eb7[_0x5cac41][_0xd44f('0x5f')]=juice(_0x400eb7[_0x5cac41][_0xd44f('0x5f')]);}}_0x433166['rows']=_0x400eb7;return _0x433166;});}})[_0xd44f('0xf')](respondWithFilteredResult(_0x31884a,_0xfd2d77))[_0xd44f('0x63')](handleError(_0x31884a,null));};exports[_0xd44f('0x28')]=function(_0x4d0c14,_0x7cd53a){var _0x1e0b9b,_0x6d0909={},_0xbc7cad;if(_0x4d0c14[_0xd44f('0x5f')]['to']){_0xbc7cad=_0x4d0c14[_0xd44f('0x5f')]['to'][_0xd44f('0x98')](',')[0x0];}return db[_0xd44f('0x44')]['find']({'where':{'id':_0x4d0c14[_0xd44f('0x5b')]['id']},'include':[{'model':db[_0xd44f('0x9b')],'as':_0xd44f('0x9c'),'include':[{'model':db['CmContact'],'as':_0xd44f('0x9d'),'where':{'email':_0xbc7cad},'limit':0x1,'order':[[_0xd44f('0x9e'),_0xd44f('0x9f')]]}]},{'model':db[_0xd44f('0x5c')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xd44f('0xa0')],'as':_0xd44f('0xa0'),'raw':!![]}]}]})[_0xd44f('0xf')](handleEntityNotFound(_0x7cd53a,null))['then'](function(_0x1dd39c){if(!_0x1dd39c)return;_0x1e0b9b=_0x1dd39c;if(!_0x1dd39c[_0xd44f('0x3f')])throw new Error(_0xd44f('0xa1'));if(_[_0xd44f('0xa2')](_0x4d0c14[_0xd44f('0x5f')]['from'])){_0x4d0c14[_0xd44f('0x5f')][_0xd44f('0xa3')]=util[_0xd44f('0x99')](_0xd44f('0xa4'),_0x1dd39c[_0xd44f('0x27')],_0x1dd39c[_0xd44f('0xa5')]||_0x1dd39c['Smtp'][_0xd44f('0x3d')]);}if(_0x4d0c14['body']['attachments']&&_0x4d0c14[_0xd44f('0x5f')][_0xd44f('0xa6')][_0xd44f('0x4f')]){for(var _0x8151d0=0x0;_0x8151d0<_0x4d0c14['body'][_0xd44f('0xa6')][_0xd44f('0x4f')];_0x8151d0+=0x1){_0x4d0c14[_0xd44f('0x5f')][_0xd44f('0xa6')][_0x8151d0]={'filename':_0x4d0c14[_0xd44f('0x5f')][_0xd44f('0xa6')][_0x8151d0][_0xd44f('0x27')],'path':path[_0xd44f('0xa7')](config['root'],_0xd44f('0xa8'),_0x4d0c14['body'][_0xd44f('0xa6')][_0x8151d0]['basename'])};}}var _0xf94661=_0x1dd39c[_0xd44f('0xa9')]();return respondWithRpcPromise(_0xd44f('0xaa'),_0xd44f('0xab'),{'account':_0xf94661,'message':_0x4d0c14[_0xd44f('0x5f')]});})[_0xd44f('0xf')](function(_0x96ba1){if(!_0x96ba1)return;_0x6d0909=_0x96ba1;if(!_0x1e0b9b['List'])throw new Error('List\x20not\x20found');if(_0x1e0b9b[_0xd44f('0x9c')][_0xd44f('0x9d')][_0xd44f('0x4f')])return _0x1e0b9b['List'][_0xd44f('0x9d')][0x0];return db['CmContact'][_0xd44f('0x67')](_['defaults'](_0x4d0c14[_0xd44f('0x5f')],{'firstName':_0x4d0c14[_0xd44f('0x5f')]['to'],'email':_0x4d0c14[_0xd44f('0x5f')]['to'],'phone':_0x4d0c14[_0xd44f('0x5f')]['to'],'ListId':_0x1e0b9b[_0xd44f('0x73')]}));})[_0xd44f('0xf')](function(_0x5b5d2c){if(!_0x5b5d2c)return;var _0x378b77={'UserId':_0x4d0c14[_0xd44f('0x3d')]['id'],'ContactId':_0x5b5d2c['id'],'MailAccountId':_0x1e0b9b['id'],'inReplyTo':_0x6d0909[_0xd44f('0xac')],'to':_0x4d0c14[_0xd44f('0x5f')]['from'],'cc':_0x4d0c14[_0xd44f('0x5f')]['cc'],'subject':_0x4d0c14[_0xd44f('0x5f')][_0xd44f('0xad')],'attach':_0x4d0c14['body'][_0xd44f('0xae')],'firstMsgDirection':_0xd44f('0xaf'),'lastMsgAt':moment()[_0xd44f('0x99')](_0xd44f('0x9a')),'lastMsgDirection':'out','Messages':[_['merge'](_0x4d0c14[_0xd44f('0x5f')],{'messageId':_0x6d0909[_0xd44f('0xac')],'sentAt':moment()[_0xd44f('0x99')](_0xd44f('0x9a')),'read':!![],'MailAccountId':_0x1e0b9b['id'],'UserId':_0x4d0c14['user']['id'],'ContactId':_0x5b5d2c['id']})]};if(_0x4d0c14[_0xd44f('0x5f')][_0xd44f('0xb0')]){_0x378b77=_[_0xd44f('0x55')](_0x378b77,_0x4d0c14[_0xd44f('0x5f')]['Interaction']);}return db[_0xd44f('0x81')][_0xd44f('0x67')](_0x378b77,{'include':[{'model':db[_0xd44f('0x96')],'as':_0xd44f('0xb1')}]});})[_0xd44f('0xf')](respondWithResult(_0x7cd53a,null))[_0xd44f('0x63')](handleError(_0x7cd53a,null));};exports['verifySmtp']=function(_0x4ae889,_0x50dc19){return db[_0xd44f('0x44')]['find']({'where':{'id':_0x4ae889[_0xd44f('0x5b')]['id']},'include':[{'model':db[_0xd44f('0x5c')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xd44f('0xa0')],'as':_0xd44f('0xa0'),'raw':!![]}]}]})[_0xd44f('0xf')](handleEntityNotFound(_0x50dc19,null))['then'](function(_0x2d1b2b){if(!_0x2d1b2b['Smtp'])return;var _0x340376=_0x2d1b2b[_0xd44f('0xa9')]();return respondWithRpcPromise('VerifySmtp',_0xd44f('0xb2'),{'account':_0x340376});})[_0xd44f('0xf')](respondWithResult(_0x50dc19,null))[_0xd44f('0x63')](handleError(_0x50dc19,null));};exports['destroy']=function(_0x5b6a13,_0x57c5fc){return db[_0xd44f('0x44')][_0xd44f('0x5e')]({'where':{'id':_0x5b6a13[_0xd44f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x57c5fc,null))[_0xd44f('0xf')](function(_0x50bf32){if(_0x50bf32&&_0x50bf32[_0xd44f('0x3b')]){throw new db['Sequelize'][(_0xd44f('0xb3'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x50bf32;})[_0xd44f('0xf')](removeEntity(_0x57c5fc,null))[_0xd44f('0x63')](handleError(_0x57c5fc,null));};exports[_0xd44f('0xb4')]=function(_0x1535a1,_0x2e1825){return db['MailAccount'][_0xd44f('0x5e')]({'where':{'id':_0x1535a1[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x2e1825,null))[_0xd44f('0xf')](function(_0x50f773){if(_0x50f773){return _0x50f773[_0xd44f('0xb4')](_0x1535a1[_0xd44f('0x5f')]['ids'],_['omit'](_0x1535a1[_0xd44f('0x5f')],[_0xd44f('0x6e'),'id'])||{})['spread'](function(_0x56b6e4){for(var _0xe14e87=0x0;_0xe14e87<_0x1535a1['body'][_0xd44f('0x6e')][_0xd44f('0x4f')];_0xe14e87+=0x1){socket[_0xd44f('0xb5')](_0xd44f('0xb6'),{'UserId':Number(_0x1535a1['body']['ids'][_0xe14e87]),'MailAccountId':Number(_0x1535a1[_0xd44f('0x5b')]['id'])});}return _0x56b6e4;});}})[_0xd44f('0xf')](respondWithResult(_0x2e1825,null))[_0xd44f('0x63')](handleError(_0x2e1825,null));};exports[_0xd44f('0xb7')]=function(_0x1ddba1,_0x283159){return db['MailAccount'][_0xd44f('0x5e')]({'where':{'id':_0x1ddba1[_0xd44f('0x5b')]['id']}})[_0xd44f('0xf')](handleEntityNotFound(_0x283159,null))[_0xd44f('0xf')](function(_0x18cecc){if(_0x18cecc){return _0x18cecc[_0xd44f('0xb7')](_0x1ddba1['query'][_0xd44f('0x6e')])['then'](function(){if(_['isArray'](_0x1ddba1['query'][_0xd44f('0x6e')])){for(var _0x483eed=0x0;_0x483eed<_0x1ddba1['query']['ids'][_0xd44f('0x4f')];_0x483eed+=0x1){socket['emit'](_0xd44f('0xb8'),{'UserId':Number(_0x1ddba1[_0xd44f('0x48')]['ids'][_0x483eed]),'MailAccountId':Number(_0x1ddba1['params']['id'])});}}else{socket['emit'](_0xd44f('0xb8'),{'UserId':Number(_0x1ddba1[_0xd44f('0x48')]['ids']),'MailAccountId':Number(_0x1ddba1[_0xd44f('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x283159,null))[_0xd44f('0x63')](handleError(_0x283159,null));};exports[_0xd44f('0xb9')]=function(_0x147b29,_0x314c5f){var _0x2499eb={};var _0x450833={};var _0x576052;var _0x344534;return db['MailAccount'][_0xd44f('0x69')]({'where':{'id':_0x147b29[_0xd44f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x314c5f,null))[_0xd44f('0xf')](function(_0x13f2a1){if(_0x13f2a1){_0x576052=_0x13f2a1;_0x450833[_0xd44f('0x4d')]=_['keys'](db['User'][_0xd44f('0x45')]);_0x450833['query']=_[_0xd44f('0x49')](_0x147b29['query']);_0x450833[_0xd44f('0x4a')]=_[_0xd44f('0x4c')](_0x450833[_0xd44f('0x4d')],_0x450833[_0xd44f('0x48')]);_0x2499eb[_0xd44f('0x4b')]=_[_0xd44f('0x4c')](_0x450833[_0xd44f('0x4d')],qs[_0xd44f('0x4e')](_0x147b29[_0xd44f('0x48')][_0xd44f('0x4e')]));_0x2499eb['attributes']=_0x2499eb[_0xd44f('0x4b')]['length']?_0x2499eb[_0xd44f('0x4b')]:_0x450833[_0xd44f('0x4d')];_0x2499eb[_0xd44f('0x52')]=qs['sort'](_0x147b29[_0xd44f('0x48')][_0xd44f('0x6b')]);_0x2499eb['where']=qs[_0xd44f('0x4a')](_[_0xd44f('0x6c')](_0x147b29['query'],_0x450833[_0xd44f('0x4a')]));if(_0x147b29[_0xd44f('0x48')][_0xd44f('0x54')]){_0x2499eb[_0xd44f('0x53')]=_[_0xd44f('0x55')](_0x2499eb[_0xd44f('0x53')],{'$or':_[_0xd44f('0x43')](_0x2499eb[_0xd44f('0x4b')],function(_0xd03a13){var _0x19eea8={};_0x19eea8[_0xd03a13]={'$like':'%'+_0x147b29['query'][_0xd44f('0x54')]+'%'};return _0x19eea8;})});}_0x2499eb=_[_0xd44f('0x55')]({},_0x2499eb,_0x147b29[_0xd44f('0x5d')]);return _0x576052[_0xd44f('0xb9')](_0x2499eb);}})['then'](function(_0x111c0a){if(_0x111c0a){_0x344534=_0x111c0a[_0xd44f('0x4f')];if(!_0x147b29[_0xd44f('0x48')]['hasOwnProperty'](_0xd44f('0x51'))){_0x2499eb[_0xd44f('0x20')]=qs['limit'](_0x147b29[_0xd44f('0x48')]['limit']);_0x2499eb['offset']=qs[_0xd44f('0x1d')](_0x147b29['query'][_0xd44f('0x1d')]);}return _0x576052[_0xd44f('0xb9')](_0x2499eb);}})['then'](function(_0x16e3cc){if(_0x16e3cc){return _0x16e3cc?{'count':_0x344534,'rows':_0x16e3cc}:null;}})['then'](respondWithResult(_0x314c5f,null))[_0xd44f('0x63')](handleError(_0x314c5f,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 26b0a76..9d9719d 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 _0xee87=['MailAccount','setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x3e9e67,_0x20aadb){var _0x45d328=function(_0x39282e){while(--_0x39282e){_0x3e9e67['push'](_0x3e9e67['shift']());}};_0x45d328(++_0x20aadb);}(_0xee87,0x10d));var _0x7ee8=function(_0x42e520,_0x4ac385){_0x42e520=_0x42e520-0x0;var _0x1d91bc=_0xee87[_0x42e520];return _0x1d91bc;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x7ee8('0x0'))['db'][_0x7ee8('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x7ee8('0x2')](0x0);var events={'afterCreate':_0x7ee8('0x3'),'afterUpdate':_0x7ee8('0x4'),'afterDestroy':_0x7ee8('0x5')};function emitEvent(_0x41c2cc){return function(_0x2f1867,_0x32466c,_0x23a89c){MailAccountEvents['emit'](_0x41c2cc+':'+_0x2f1867['id'],_0x2f1867);MailAccountEvents[_0x7ee8('0x6')](_0x41c2cc,_0x2f1867);_0x23a89c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x7ee8('0x7')](e,emitEvent(event));}}module[_0x7ee8('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x90b1=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','update','remove'];(function(_0x3bf4e8,_0x58c300){var _0x58184c=function(_0xbb5891){while(--_0xbb5891){_0x3bf4e8['push'](_0x3bf4e8['shift']());}};_0x58184c(++_0x58c300);}(_0x90b1,0x1bb));var _0x190b=function(_0x36f47e,_0x1d85cd){_0x36f47e=_0x36f47e-0x0;var _0x4e6a98=_0x90b1[_0x36f47e];return _0x4e6a98;};'use strict';var EventEmitter=require(_0x190b('0x0'));var MailAccount=require(_0x190b('0x1'))['db'][_0x190b('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x190b('0x3'),'afterDestroy':_0x190b('0x4')};function emitEvent(_0xa05468){return function(_0x120ddc,_0x4fbcad,_0x4c355f){MailAccountEvents['emit'](_0xa05468+':'+_0x120ddc['id'],_0x120ddc);MailAccountEvents['emit'](_0xa05468,_0x120ddc);_0x4c355f(null);};}for(var e in events){if(events[_0x190b('0x5')](e)){var event=events[e];MailAccount[_0x190b('0x6')](e,emitEvent(event));}}module[_0x190b('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index d021d7b..9061c74 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 _0xa97a=['pass','./mailAccount.attributes','exports','define','mail_accounts','provider','service','host','Smtp','port','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','CloudProvider','data5','user'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa97a,0x131));var _0xaa97=function(_0x57e5fa,_0x579542){_0x57e5fa=_0x57e5fa-0x0;var _0x4d8b97=_0xa97a[_0x57e5fa];return _0x4d8b97;};'use strict';var attributes=require(_0xaa97('0x0'));module[_0xaa97('0x1')]=function(_0x431128){return _0x431128[_0xaa97('0x2')]('MailAccount',attributes,{'tableName':_0xaa97('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x551621=this;var _0x3075e4={'id':_0x551621['id'],'tls':{'rejectUnauthorized':![]}};if(_0x551621[_0xaa97('0x4')]!=='custom'){_0x3075e4[_0xaa97('0x5')]=_0x551621[_0xaa97('0x4')];}else{_0x3075e4[_0xaa97('0x6')]=_0x551621[_0xaa97('0x7')][_0xaa97('0x6')];_0x3075e4['port']=_0x551621[_0xaa97('0x7')][_0xaa97('0x8')];_0x3075e4[_0xaa97('0x9')]=_0x551621[_0xaa97('0x7')]['secure'];}if(_0x551621[_0xaa97('0x7')][_0xaa97('0xa')]){if(_0x551621['Smtp'][_0xaa97('0xb')]){if(!_0x551621[_0xaa97('0x7')]['CloudProvider'])throw new Error(_0xaa97('0xc'));_0x3075e4[_0xaa97('0xd')]={'type':_0xaa97('0xe'),'user':_0x551621[_0xaa97('0x7')]['user'],'accessToken':_0x551621[_0xaa97('0x7')][_0xaa97('0xf')][_0xaa97('0x10')]};}else{_0x3075e4['auth']={'user':_0x551621[_0xaa97('0x7')][_0xaa97('0x11')],'pass':_0x551621[_0xaa97('0x7')][_0xaa97('0x12')]};}}return _0x3075e4;}}});}; \ No newline at end of file +var _0x0e75=['Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5','pass','./mailAccount.attributes','define','MailAccount','mail_accounts','provider','custom','service','Smtp','host','port','secure','modernAuthentication','CloudProvider'];(function(_0x508c41,_0x27a103){var _0xead227=function(_0x221c3f){while(--_0x221c3f){_0x508c41['push'](_0x508c41['shift']());}};_0xead227(++_0x27a103);}(_0x0e75,0x149));var _0x50e7=function(_0x32e5c3,_0x3fbf14){_0x32e5c3=_0x32e5c3-0x0;var _0x510383=_0x0e75[_0x32e5c3];return _0x510383;};'use strict';var attributes=require(_0x50e7('0x0'));module['exports']=function(_0x456ca3){return _0x456ca3[_0x50e7('0x1')](_0x50e7('0x2'),attributes,{'tableName':_0x50e7('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x22c778=this;var _0x547564={'id':_0x22c778['id'],'tls':{'rejectUnauthorized':![]}};if(_0x22c778[_0x50e7('0x4')]!==_0x50e7('0x5')){_0x547564[_0x50e7('0x6')]=_0x22c778[_0x50e7('0x4')];}else{_0x547564['host']=_0x22c778[_0x50e7('0x7')][_0x50e7('0x8')];_0x547564[_0x50e7('0x9')]=_0x22c778[_0x50e7('0x7')][_0x50e7('0x9')];_0x547564[_0x50e7('0xa')]=_0x22c778[_0x50e7('0x7')]['secure'];}if(_0x22c778[_0x50e7('0x7')]['authentication']){if(_0x22c778['Smtp'][_0x50e7('0xb')]){if(!_0x22c778['Smtp'][_0x50e7('0xc')])throw new Error(_0x50e7('0xd'));_0x547564[_0x50e7('0xe')]={'type':'OAuth2','user':_0x22c778['Smtp'][_0x50e7('0xf')],'accessToken':_0x22c778['Smtp'][_0x50e7('0xc')][_0x50e7('0x10')]};}else{_0x547564[_0x50e7('0xe')]={'user':_0x22c778[_0x50e7('0x7')]['user'],'pass':_0x22c778[_0x50e7('0x7')][_0x50e7('0x11')]};}}return _0x547564;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index ab28500..ba083ba 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 _0x1a85=['getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','body','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','omit','smtpOptions','applications','orderBy','asc','autoclose','push','length','close','*,*,*,*','Contacts','ListId','create','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','Contact\x20not\x20found','update','attach','interaction','get','created','attachments','originCc','bcc','ChatWebsiteId','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','agent','startRouting','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','./mailAccount.socket','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailAccount','findAll','options','where','attributes','map','include','model','GetMailAccount','ShowMailAccount','find','raw'];(function(_0x5aadaf,_0x21dc07){var _0x145748=function(_0x5ac57b){while(--_0x5ac57b){_0x5aadaf['push'](_0x5aadaf['shift']());}};_0x145748(++_0x21dc07);}(_0x1a85,0x178));var _0x51a8=function(_0x432b47,_0x24d3b7){_0x432b47=_0x432b47-0x0;var _0xb74e85=_0x1a85[_0x432b47];return _0xb74e85;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x51a8('0x0'));var rs=require(_0x51a8('0x1'));var Redis=require(_0x51a8('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x51a8('0x3'));var config=require(_0x51a8('0x4'));var jayson=require(_0x51a8('0x5'));var client=jayson['client'][_0x51a8('0x6')]({'port':0x232c});config['redis']=_[_0x51a8('0x7')](config['redis'],{'host':_0x51a8('0x8'),'port':0x18eb});var socket=require(_0x51a8('0x9'))(new Redis(config['redis']));require(_0x51a8('0xa'))['register'](socket);function respondWithRpcPromise(_0x56e1b4,_0x39e06a,_0x2f276b){return new BPromise(function(_0x1a476d,_0x45a3f4){return client[_0x51a8('0xb')](_0x56e1b4,_0x2f276b)[_0x51a8('0xc')](function(_0x3f93c7){logger[_0x51a8('0xd')](_0x51a8('0xe'),_0x39e06a,_0x51a8('0xf'));logger[_0x51a8('0x10')](_0x51a8('0x11'),_0x39e06a,_0x51a8('0xf'),JSON[_0x51a8('0x12')](_0x3f93c7));if(_0x3f93c7[_0x51a8('0x13')]){if(_0x3f93c7[_0x51a8('0x13')][_0x51a8('0x14')]===0x1f4){logger['error'](_0x51a8('0xe'),_0x39e06a,_0x3f93c7[_0x51a8('0x13')][_0x51a8('0x15')]);return _0x45a3f4(_0x3f93c7['error'][_0x51a8('0x15')]);}logger['error'](_0x51a8('0xe'),_0x39e06a,_0x3f93c7[_0x51a8('0x13')][_0x51a8('0x15')]);return _0x1a476d(_0x3f93c7[_0x51a8('0x13')][_0x51a8('0x15')]);}else{logger[_0x51a8('0xd')](_0x51a8('0xe'),_0x39e06a,'request\x20sent');_0x1a476d(_0x3f93c7[_0x51a8('0x16')][_0x51a8('0x15')]);}})[_0x51a8('0x17')](function(_0x23539e){logger[_0x51a8('0x13')](_0x51a8('0xe'),_0x39e06a,_0x23539e);_0x45a3f4(_0x23539e);});});}exports['GetMailAccount']=function(_0x1df8c2){var _0x3b7e7e=this;return new Promise(function(_0x2217ce,_0x2f2681){return db[_0x51a8('0x18')][_0x51a8('0x19')]({'raw':_0x1df8c2[_0x51a8('0x1a')]?_0x1df8c2[_0x51a8('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1df8c2[_0x51a8('0x1a')]?_0x1df8c2['options'][_0x51a8('0x1b')]||null:null,'attributes':_0x1df8c2[_0x51a8('0x1a')]?_0x1df8c2[_0x51a8('0x1a')][_0x51a8('0x1c')]||null:null,'limit':_0x1df8c2['options']?_0x1df8c2[_0x51a8('0x1a')]['limit']||null:null,'include':_0x1df8c2['options']?_0x1df8c2[_0x51a8('0x1a')]['include']?_[_0x51a8('0x1d')](_0x1df8c2[_0x51a8('0x1a')][_0x51a8('0x1e')],function(_0x18e2f3){return{'model':db[_0x18e2f3[_0x51a8('0x1f')]],'as':_0x18e2f3['as'],'attributes':_0x18e2f3[_0x51a8('0x1c')],'include':_0x18e2f3[_0x51a8('0x1e')]?_[_0x51a8('0x1d')](_0x18e2f3['include'],function(_0x273ce2){return{'model':db[_0x273ce2[_0x51a8('0x1f')]],'as':_0x273ce2['as'],'attributes':_0x273ce2[_0x51a8('0x1c')],'include':_0x273ce2[_0x51a8('0x1e')]?_[_0x51a8('0x1d')](_0x273ce2[_0x51a8('0x1e')],function(_0x1a886f){return{'model':db[_0x1a886f[_0x51a8('0x1f')]],'as':_0x1a886f['as'],'attributes':_0x1a886f[_0x51a8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x51a8('0xc')](function(_0x20c6b5){logger[_0x51a8('0xd')]('GetMailAccount',_0x1df8c2);logger[_0x51a8('0x10')]('GetMailAccount',_0x1df8c2,JSON[_0x51a8('0x12')](_0x20c6b5));_0x2217ce(_0x20c6b5);})[_0x51a8('0x17')](function(_0x143f46){logger[_0x51a8('0x13')](_0x51a8('0x20'),_0x143f46['message'],_0x1df8c2);_0x2f2681(_0x3b7e7e[_0x51a8('0x13')](0x1f4,_0x143f46['message']));});});};exports[_0x51a8('0x21')]=function(_0x24b39a){var _0x253a59=this;return new Promise(function(_0x4b19c8,_0x2080a1){return db['MailAccount'][_0x51a8('0x22')]({'raw':_0x24b39a[_0x51a8('0x1a')]?_0x24b39a[_0x51a8('0x1a')][_0x51a8('0x23')]===undefined?!![]:![]:!![],'where':_0x24b39a[_0x51a8('0x1a')]?_0x24b39a['options'][_0x51a8('0x1b')]||null:null,'attributes':_0x24b39a['options']?_0x24b39a[_0x51a8('0x1a')][_0x51a8('0x1c')]||null:null,'include':_0x24b39a[_0x51a8('0x1a')]?_0x24b39a['options'][_0x51a8('0x1e')]?_[_0x51a8('0x1d')](_0x24b39a[_0x51a8('0x1a')][_0x51a8('0x1e')],function(_0x41c020){return{'model':db[_0x41c020['model']],'as':_0x41c020['as'],'attributes':_0x41c020['attributes'],'include':_0x41c020['include']?_[_0x51a8('0x1d')](_0x41c020[_0x51a8('0x1e')],function(_0x4ec1db){return{'model':db[_0x4ec1db[_0x51a8('0x1f')]],'as':_0x4ec1db['as'],'attributes':_0x4ec1db['attributes'],'include':_0x4ec1db[_0x51a8('0x1e')]?_[_0x51a8('0x1d')](_0x4ec1db[_0x51a8('0x1e')],function(_0x1eef9d){return{'model':db[_0x1eef9d[_0x51a8('0x1f')]],'as':_0x1eef9d['as'],'attributes':_0x1eef9d[_0x51a8('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e5566){if(_0x24b39a[_0x51a8('0x1a')]['smtp']===!![])_0x4e5566['setDataValue']('smtpOptions',_0x4e5566[_0x51a8('0x24')]());logger[_0x51a8('0xd')](_0x51a8('0x21'),_0x24b39a);logger['debug'](_0x51a8('0x21'),_0x24b39a,JSON[_0x51a8('0x12')](_0x4e5566));_0x4b19c8(_0x4e5566);})[_0x51a8('0x17')](function(_0x310ad2){logger['error'](_0x51a8('0x21'),_0x310ad2[_0x51a8('0x15')],_0x24b39a);_0x2080a1(_0x253a59[_0x51a8('0x13')](0x1f4,_0x310ad2['message']));});});};exports[_0x51a8('0x25')]=function(_0x51d7bd){var _0x2032c0=this;return new Promise(function(_0x1e637a,_0x2a98bd){var _0x37d50b={'body':_0x51d7bd['body'],'channel':_0x51a8('0x26')};var _0x3da2cf=_[_0x51a8('0x27')](_[_0x51a8('0x28')](db[_0x51a8('0x29')][_0x51a8('0x2a')]),[_0x51a8('0x2b'),_0x51a8('0x2c'),_0x51a8('0x2d'),'ListId']);var _0x22e6e6=![];if(_0x51d7bd[_0x51a8('0x2e')]['id']){delete _0x51d7bd['body']['id'];}if(_['isNil'](_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x2f')])){return _0x2a98bd(_0x2032c0[_0x51a8('0x13')](0x1f4,_0x51a8('0x30')));}if(_[_0x51a8('0x31')](_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x2e')])||_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x2e')]===''){return _0x2a98bd(_0x2032c0[_0x51a8('0x13')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x51a8('0x31')](_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x32')])){return _0x2a98bd(_0x2032c0[_0x51a8('0x13')](0x1f4,_0x51a8('0x33')+_0x3da2cf));}if(!_[_0x51a8('0x34')](_0x3da2cf,_0x51d7bd['body'][_0x51a8('0x32')])){return _0x2a98bd(_0x2032c0['error'](0x1f4,_0x51a8('0x35')+_0x3da2cf));}var _0x3a33f3={};_0x3a33f3[_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x32')]]=_0x51d7bd[_0x51a8('0x2e')]['from'];return db['MailAccount'][_0x51a8('0x22')]({'where':{'id':_0x51d7bd[_0x51a8('0x36')]['id']},'include':[{'model':db[_0x51a8('0x37')],'as':_0x51a8('0x38'),'include':[{'model':db[_0x51a8('0x29')],'as':'Contacts','where':_0x3a33f3,'limit':0x1,'order':[['updatedAt',_0x51a8('0x39')]]}]},{'model':db[_0x51a8('0x3a')],'as':_0x51a8('0x3b')},{'model':db[_0x51a8('0x3c')],'as':_0x51a8('0x3d'),'include':[{'model':db[_0x51a8('0x3e')],'as':_0x51a8('0x3e')}]}]})[_0x51a8('0xc')](function(_0x301578){if(_0x301578&&_0x301578['List']){var _0x5cb2cf=_0x301578['get']({'plain':!![]});_0x37d50b[_0x51a8('0x36')]=_[_0x51a8('0x3f')](_0x5cb2cf,[_0x51a8('0x3b'),'List']);_0x37d50b[_0x51a8('0x36')][_0x51a8('0x40')]=_0x301578['getSmtpOptions']();_0x37d50b[_0x51a8('0x41')]=_0x5cb2cf['Applications'];_0x37d50b['list']=_0x5cb2cf[_0x51a8('0x38')];_0x37d50b[_0x51a8('0x41')]=_[_0x51a8('0x42')](_0x37d50b['applications'],['priority'],[_0x51a8('0x43')]);if(_0x37d50b['account']&&_0x37d50b[_0x51a8('0x36')][_0x51a8('0x44')]){_0x37d50b[_0x51a8('0x41')][_0x51a8('0x45')]({'id':0x0,'priority':_0x37d50b[_0x51a8('0x41')][_0x51a8('0x46')]+0x1,'app':_0x51a8('0x47'),'appdata':_0x51a8('0x44'),'interval':_0x51a8('0x48')});}if(_0x37d50b['account'][_0x51a8('0x3b')]){delete _0x37d50b[_0x51a8('0x36')][_0x51a8('0x3b')];}if(_0x37d50b[_0x51a8('0x36')]['List']){delete _0x37d50b[_0x51a8('0x36')]['List'];}if(_0x5cb2cf[_0x51a8('0x38')][_0x51a8('0x49')]['length']){return _0x5cb2cf['List'][_0x51a8('0x49')][0x0];}var _0x16f124=_[_0x51a8('0x7')](_0x51d7bd[_0x51a8('0x2e')],{'firstName':_0x51d7bd[_0x51a8('0x2e')]['from'],'ListId':_0x5cb2cf[_0x51a8('0x4a')]});_0x16f124[_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x32')]]=_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x2f')];return db['CmContact'][_0x51a8('0x4b')](_0x16f124);}else{throw new Error(_0x51a8('0x4c'));}})[_0x51a8('0xc')](function(_0x3e43cc){_0x37d50b[_0x51a8('0x4d')]=_0x3e43cc;if(_0x3e43cc){if(!_0x51d7bd[_0x51a8('0x2e')]['message']['messageId']){_0x51d7bd['body']['message'][_0x51a8('0x4e')]=rs[_0x51a8('0x4f')]()+'\x20'+_0x51d7bd['body'][_0x51a8('0x15')]['from'];}var _0x41cc00={'ContactId':_0x3e43cc['id'],'MailAccountId':_0x51d7bd['account']['id'],'inReplyTo':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')]['messageId'],'to':_0x51d7bd['body']['message'][_0x51a8('0x2f')],'cc':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')]['cc'],'subject':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x50')],'attach':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')]['attach'],'lastMsgAt':moment()[_0x51a8('0x51')](_0x51a8('0x52')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x51a8('0x22')]({'where':{'closed':![],'MailAccountId':_0x51d7bd[_0x51a8('0x36')]['id']},'include':[{'model':db[_0x51a8('0x53')],'as':_0x51a8('0x54'),'attributes':[_0x51a8('0x4e')],'where':{'messageId':_0x51d7bd[_0x51a8('0x2e')]['message']['inReplyTo']}}]})[_0x51a8('0xc')](function(_0x53f25e){if(_0x53f25e){return[_0x53f25e,![]];}return db['MailInteraction']['create'](_0x41cc00)['then'](function(_0x483a5a){return[_0x483a5a,!![]];});});}else{throw new Error(_0x51a8('0x55'));}})['spread'](function(_0x1477af,_0x4772cd){if(_0x1477af){_0x22e6e6=_0x4772cd;if(!_0x4772cd){return _0x1477af[_0x51a8('0x56')]({'inReplyTo':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x4e')],'to':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x2f')],'cc':_0x51d7bd[_0x51a8('0x2e')]['message']['cc'],'subject':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x50')],'attach':_0x1477af['attach']?_0x1477af['attach']:_0x51d7bd['body'][_0x51a8('0x15')][_0x51a8('0x57')],'substatus':null,'substatusAt':moment()[_0x51a8('0x51')](_0x51a8('0x52')),'lastMsgAt':moment()[_0x51a8('0x51')](_0x51a8('0x52')),'lastMsgDirection':'in'});}else{return _0x1477af;}}})[_0x51a8('0xc')](function(_0x418445){_0x37d50b[_0x51a8('0x58')]=_0x418445[_0x51a8('0x59')]({'plain':!![]});_0x37d50b[_0x51a8('0x58')][_0x51a8('0x5a')]=_0x22e6e6;return db[_0x51a8('0x53')]['create']({'body':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x2e')],'MailAccountId':_0x51d7bd['account']['id'],'MailInteractionId':_0x418445['id'],'direction':'in','ContactId':_0x37d50b[_0x51a8('0x4d')]['id'],'messageId':_0x51d7bd['body']['message']['messageId'],'from':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x2f')],'to':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')]['to'],'cc':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')]['cc'],'subject':_0x51d7bd['body']['message']['subject'],'attach':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x57')],'Attachments':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x5b')],'originTo':_0x51d7bd['body'][_0x51a8('0x15')]['originTo'],'originCc':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x5c')],'bcc':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x5d')],'ChatWebsiteId':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x5e')]||null,'originChannel':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')]['originChannel']||'Email','ChatOfflineMessageId':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x5f')]||null},{'include':[{'model':db[_0x51a8('0x60')],'as':'Attachments'}]});})[_0x51a8('0xc')](function(_0x4d418a){_0x37d50b[_0x51a8('0x15')]=_0x4d418a;if(_0x37d50b[_0x51a8('0x58')][_0x51a8('0x61')]){return db[_0x51a8('0x62')][_0x51a8('0x22')]({'attributes':['id',_0x51a8('0x63')],'where':{'id':_0x37d50b[_0x51a8('0x58')][_0x51a8('0x61')]}})[_0x51a8('0xc')](function(_0x53fc80){if(_0x53fc80){_0x37d50b[_0x51a8('0x41')][_0x51a8('0x64')]({'id':0x0,'priority':0x0,'app':_0x51a8('0x65'),'appdata':_0x53fc80[_0x51a8('0x63')]+','+(_0x37d50b['account']['waitForTheAssignedAgent']||0xa),'interval':_0x51a8('0x48')});}return respondWithRpcPromise('Start','startRouting',_0x37d50b);});}return respondWithRpcPromise('Start',_0x51a8('0x66'),_0x37d50b);})['then'](function(_0x5c7aca){_0x1e637a(_0x5c7aca);})[_0x51a8('0x17')](function(_0x23f82a){_0x2a98bd(_0x2032c0[_0x51a8('0x13')](0x1f4,_0x23f82a['message']));});});}; \ No newline at end of file +var _0x9f0e=['updatedAt','ListId','from','from\x20is\x20mandatory','isNil','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','account','List','Contacts','DESC','Applications','MailServerOut','Smtp','CloudProvider','get','omit','getSmtpOptions','applications','orderBy','asc','autoclose','push','close','*,*,*,*','length','defaults','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','create','Contact\x20not\x20found','update','interaction','created','MailMessage','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','options','where','attributes','limit','include','map','model','debug','ShowMailAccount','find','raw','smtp','setDataValue','smtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact'];(function(_0x40e024,_0x5ce98f){var _0x2cefdb=function(_0x137169){while(--_0x137169){_0x40e024['push'](_0x40e024['shift']());}};_0x2cefdb(++_0x5ce98f);}(_0x9f0e,0x116));var _0xe9f0=function(_0x12e83b,_0x497be9){_0x12e83b=_0x12e83b-0x0;var _0x10d224=_0x9f0e[_0x12e83b];return _0x10d224;};'use strict';var _=require(_0xe9f0('0x0'));var moment=require(_0xe9f0('0x1'));var BPromise=require(_0xe9f0('0x2'));var rs=require(_0xe9f0('0x3'));var Redis=require(_0xe9f0('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xe9f0('0x5'));var config=require(_0xe9f0('0x6'));var jayson=require(_0xe9f0('0x7'));var client=jayson[_0xe9f0('0x8')][_0xe9f0('0x9')]({'port':0x232c});config['redis']=_['defaults'](config[_0xe9f0('0xa')],{'host':_0xe9f0('0xb'),'port':0x18eb});var socket=require(_0xe9f0('0xc'))(new Redis(config['redis']));require(_0xe9f0('0xd'))[_0xe9f0('0xe')](socket);function respondWithRpcPromise(_0x20d602,_0x3386a8,_0xa523c0){return new BPromise(function(_0x240932,_0x807322){return client[_0xe9f0('0xf')](_0x20d602,_0xa523c0)[_0xe9f0('0x10')](function(_0x5352e0){logger[_0xe9f0('0x11')](_0xe9f0('0x12'),_0x3386a8,_0xe9f0('0x13'));logger['debug'](_0xe9f0('0x14'),_0x3386a8,'request\x20sent',JSON[_0xe9f0('0x15')](_0x5352e0));if(_0x5352e0[_0xe9f0('0x16')]){if(_0x5352e0[_0xe9f0('0x16')][_0xe9f0('0x17')]===0x1f4){logger['error'](_0xe9f0('0x12'),_0x3386a8,_0x5352e0['error'][_0xe9f0('0x18')]);return _0x807322(_0x5352e0[_0xe9f0('0x16')][_0xe9f0('0x18')]);}logger['error'](_0xe9f0('0x12'),_0x3386a8,_0x5352e0[_0xe9f0('0x16')][_0xe9f0('0x18')]);return _0x240932(_0x5352e0['error'][_0xe9f0('0x18')]);}else{logger[_0xe9f0('0x11')](_0xe9f0('0x12'),_0x3386a8,_0xe9f0('0x13'));_0x240932(_0x5352e0[_0xe9f0('0x19')][_0xe9f0('0x18')]);}})[_0xe9f0('0x1a')](function(_0x59bf5a){logger[_0xe9f0('0x16')](_0xe9f0('0x12'),_0x3386a8,_0x59bf5a);_0x807322(_0x59bf5a);});});}exports[_0xe9f0('0x1b')]=function(_0x5c4182){var _0x35e841=this;return new Promise(function(_0x30b8c7,_0x1698cf){return db[_0xe9f0('0x1c')]['findAll']({'raw':_0x5c4182[_0xe9f0('0x1d')]?_0x5c4182[_0xe9f0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5c4182['options']?_0x5c4182['options'][_0xe9f0('0x1e')]||null:null,'attributes':_0x5c4182[_0xe9f0('0x1d')]?_0x5c4182[_0xe9f0('0x1d')][_0xe9f0('0x1f')]||null:null,'limit':_0x5c4182[_0xe9f0('0x1d')]?_0x5c4182['options'][_0xe9f0('0x20')]||null:null,'include':_0x5c4182[_0xe9f0('0x1d')]?_0x5c4182[_0xe9f0('0x1d')][_0xe9f0('0x21')]?_[_0xe9f0('0x22')](_0x5c4182[_0xe9f0('0x1d')][_0xe9f0('0x21')],function(_0x1321bb){return{'model':db[_0x1321bb[_0xe9f0('0x23')]],'as':_0x1321bb['as'],'attributes':_0x1321bb[_0xe9f0('0x1f')],'include':_0x1321bb['include']?_[_0xe9f0('0x22')](_0x1321bb[_0xe9f0('0x21')],function(_0x2ddfba){return{'model':db[_0x2ddfba[_0xe9f0('0x23')]],'as':_0x2ddfba['as'],'attributes':_0x2ddfba['attributes'],'include':_0x2ddfba[_0xe9f0('0x21')]?_[_0xe9f0('0x22')](_0x2ddfba[_0xe9f0('0x21')],function(_0x1f98a7){return{'model':db[_0x1f98a7[_0xe9f0('0x23')]],'as':_0x1f98a7['as'],'attributes':_0x1f98a7['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9f0('0x10')](function(_0xdc16bc){logger[_0xe9f0('0x11')](_0xe9f0('0x1b'),_0x5c4182);logger[_0xe9f0('0x24')](_0xe9f0('0x1b'),_0x5c4182,JSON[_0xe9f0('0x15')](_0xdc16bc));_0x30b8c7(_0xdc16bc);})[_0xe9f0('0x1a')](function(_0x2b6503){logger[_0xe9f0('0x16')](_0xe9f0('0x1b'),_0x2b6503[_0xe9f0('0x18')],_0x5c4182);_0x1698cf(_0x35e841[_0xe9f0('0x16')](0x1f4,_0x2b6503[_0xe9f0('0x18')]));});});};exports[_0xe9f0('0x25')]=function(_0x2097c4){var _0x80e3ac=this;return new Promise(function(_0x3e1846,_0x2e7535){return db[_0xe9f0('0x1c')][_0xe9f0('0x26')]({'raw':_0x2097c4[_0xe9f0('0x1d')]?_0x2097c4[_0xe9f0('0x1d')][_0xe9f0('0x27')]===undefined?!![]:![]:!![],'where':_0x2097c4['options']?_0x2097c4['options']['where']||null:null,'attributes':_0x2097c4[_0xe9f0('0x1d')]?_0x2097c4['options'][_0xe9f0('0x1f')]||null:null,'include':_0x2097c4[_0xe9f0('0x1d')]?_0x2097c4['options'][_0xe9f0('0x21')]?_['map'](_0x2097c4['options']['include'],function(_0x165440){return{'model':db[_0x165440[_0xe9f0('0x23')]],'as':_0x165440['as'],'attributes':_0x165440['attributes'],'include':_0x165440[_0xe9f0('0x21')]?_[_0xe9f0('0x22')](_0x165440[_0xe9f0('0x21')],function(_0x4d4186){return{'model':db[_0x4d4186['model']],'as':_0x4d4186['as'],'attributes':_0x4d4186[_0xe9f0('0x1f')],'include':_0x4d4186[_0xe9f0('0x21')]?_[_0xe9f0('0x22')](_0x4d4186['include'],function(_0x3ca032){return{'model':db[_0x3ca032[_0xe9f0('0x23')]],'as':_0x3ca032['as'],'attributes':_0x3ca032[_0xe9f0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe9f0('0x10')](function(_0x2b38de){if(_0x2097c4['options'][_0xe9f0('0x28')]===!![])_0x2b38de[_0xe9f0('0x29')](_0xe9f0('0x2a'),_0x2b38de['getSmtpOptions']());logger[_0xe9f0('0x11')](_0xe9f0('0x25'),_0x2097c4);logger['debug'](_0xe9f0('0x25'),_0x2097c4,JSON['stringify'](_0x2b38de));_0x3e1846(_0x2b38de);})[_0xe9f0('0x1a')](function(_0x55c0bd){logger['error']('ShowMailAccount',_0x55c0bd['message'],_0x2097c4);_0x2e7535(_0x80e3ac['error'](0x1f4,_0x55c0bd[_0xe9f0('0x18')]));});});};exports[_0xe9f0('0x2b')]=function(_0x2d8f93){var _0x40c2c6=this;return new Promise(function(_0x2560c6,_0xd9b61b){var _0x3d4eb7={'body':_0x2d8f93[_0xe9f0('0x2c')],'channel':_0xe9f0('0x2d')};var _0x4e1c68=_[_0xe9f0('0x2e')](_[_0xe9f0('0x2f')](db[_0xe9f0('0x30')]['rawAttributes']),['createdAt',_0xe9f0('0x31'),'CompanyId',_0xe9f0('0x32')]);var _0x52613a=![];if(_0x2d8f93[_0xe9f0('0x2c')]['id']){delete _0x2d8f93[_0xe9f0('0x2c')]['id'];}if(_['isNil'](_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x33')])){return _0xd9b61b(_0x40c2c6[_0xe9f0('0x16')](0x1f4,_0xe9f0('0x34')));}if(_[_0xe9f0('0x35')](_0x2d8f93['body'][_0xe9f0('0x2c')])||_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x2c')]===''){return _0xd9b61b(_0x40c2c6[_0xe9f0('0x16')](0x1f4,_0xe9f0('0x36')));}if(_['isNil'](_0x2d8f93[_0xe9f0('0x2c')]['mapKey'])){return _0xd9b61b(_0x40c2c6['error'](0x1f4,_0xe9f0('0x37')+_0x4e1c68));}if(!_[_0xe9f0('0x38')](_0x4e1c68,_0x2d8f93['body'][_0xe9f0('0x39')])){return _0xd9b61b(_0x40c2c6[_0xe9f0('0x16')](0x1f4,_0xe9f0('0x3a')+_0x4e1c68));}var _0x7b167b={};_0x7b167b[_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x39')]]=_0x2d8f93[_0xe9f0('0x2c')]['from'];return db[_0xe9f0('0x1c')]['find']({'where':{'id':_0x2d8f93[_0xe9f0('0x3b')]['id']},'include':[{'model':db['CmList'],'as':_0xe9f0('0x3c'),'include':[{'model':db['CmContact'],'as':_0xe9f0('0x3d'),'where':_0x7b167b,'limit':0x1,'order':[[_0xe9f0('0x31'),_0xe9f0('0x3e')]]}]},{'model':db['MailApplication'],'as':_0xe9f0('0x3f')},{'model':db[_0xe9f0('0x40')],'as':_0xe9f0('0x41'),'include':[{'model':db[_0xe9f0('0x42')],'as':_0xe9f0('0x42')}]}]})[_0xe9f0('0x10')](function(_0x6ece3f){if(_0x6ece3f&&_0x6ece3f[_0xe9f0('0x3c')]){var _0x18fc2b=_0x6ece3f[_0xe9f0('0x43')]({'plain':!![]});_0x3d4eb7[_0xe9f0('0x3b')]=_[_0xe9f0('0x44')](_0x18fc2b,['Applications','List']);_0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x2a')]=_0x6ece3f[_0xe9f0('0x45')]();_0x3d4eb7['applications']=_0x18fc2b[_0xe9f0('0x3f')];_0x3d4eb7['list']=_0x18fc2b[_0xe9f0('0x3c')];_0x3d4eb7[_0xe9f0('0x46')]=_[_0xe9f0('0x47')](_0x3d4eb7[_0xe9f0('0x46')],['priority'],[_0xe9f0('0x48')]);if(_0x3d4eb7[_0xe9f0('0x3b')]&&_0x3d4eb7['account'][_0xe9f0('0x49')]){_0x3d4eb7[_0xe9f0('0x46')][_0xe9f0('0x4a')]({'id':0x0,'priority':_0x3d4eb7[_0xe9f0('0x46')]['length']+0x1,'app':_0xe9f0('0x4b'),'appdata':_0xe9f0('0x49'),'interval':_0xe9f0('0x4c')});}if(_0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x3f')]){delete _0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x3f')];}if(_0x3d4eb7[_0xe9f0('0x3b')]['List']){delete _0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x3c')];}if(_0x18fc2b[_0xe9f0('0x3c')][_0xe9f0('0x3d')][_0xe9f0('0x4d')]){return _0x18fc2b[_0xe9f0('0x3c')][_0xe9f0('0x3d')][0x0];}var _0xec9b3c=_[_0xe9f0('0x4e')](_0x2d8f93[_0xe9f0('0x2c')],{'firstName':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x33')],'ListId':_0x18fc2b[_0xe9f0('0x32')]});_0xec9b3c[_0x2d8f93[_0xe9f0('0x2c')]['mapKey']]=_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x33')];return db[_0xe9f0('0x30')]['create'](_0xec9b3c);}else{throw new Error('List\x20not\x20found');}})[_0xe9f0('0x10')](function(_0x57b904){_0x3d4eb7[_0xe9f0('0x4f')]=_0x57b904;if(_0x57b904){if(!_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['messageId']){_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x50')]=rs[_0xe9f0('0x51')]()+'\x20'+_0x2d8f93['body'][_0xe9f0('0x18')][_0xe9f0('0x33')];}var _0x28a66e={'ContactId':_0x57b904['id'],'MailAccountId':_0x2d8f93[_0xe9f0('0x3b')]['id'],'inReplyTo':_0x2d8f93['body']['message'][_0xe9f0('0x50')],'to':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x33')],'cc':_0x2d8f93[_0xe9f0('0x2c')]['message']['cc'],'subject':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x52')],'attach':_0x2d8f93['body'][_0xe9f0('0x18')][_0xe9f0('0x53')],'lastMsgAt':moment()[_0xe9f0('0x54')](_0xe9f0('0x55')),'lastMsgDirection':'in'};return db[_0xe9f0('0x56')]['find']({'where':{'closed':![],'MailAccountId':_0x2d8f93['account']['id']},'include':[{'model':db['MailMessage'],'as':_0xe9f0('0x57'),'attributes':[_0xe9f0('0x50')],'where':{'messageId':_0x2d8f93['body'][_0xe9f0('0x18')]['inReplyTo']}}]})['then'](function(_0x156c65){if(_0x156c65){return[_0x156c65,![]];}return db[_0xe9f0('0x56')][_0xe9f0('0x58')](_0x28a66e)[_0xe9f0('0x10')](function(_0x1d2fb2){return[_0x1d2fb2,!![]];});});}else{throw new Error(_0xe9f0('0x59'));}})['spread'](function(_0x5e4ad4,_0x1255e6){if(_0x5e4ad4){_0x52613a=_0x1255e6;if(!_0x1255e6){return _0x5e4ad4[_0xe9f0('0x5a')]({'inReplyTo':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['messageId'],'to':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x33')],'cc':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['cc'],'subject':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x52')],'attach':_0x5e4ad4[_0xe9f0('0x53')]?_0x5e4ad4[_0xe9f0('0x53')]:_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['attach'],'substatus':null,'substatusAt':moment()[_0xe9f0('0x54')](_0xe9f0('0x55')),'lastMsgAt':moment()[_0xe9f0('0x54')](_0xe9f0('0x55')),'lastMsgDirection':'in'});}else{return _0x5e4ad4;}}})[_0xe9f0('0x10')](function(_0x42aab8){_0x3d4eb7[_0xe9f0('0x5b')]=_0x42aab8[_0xe9f0('0x43')]({'plain':!![]});_0x3d4eb7[_0xe9f0('0x5b')][_0xe9f0('0x5c')]=_0x52613a;return db[_0xe9f0('0x5d')][_0xe9f0('0x58')]({'body':_0x2d8f93['body'][_0xe9f0('0x2c')],'MailAccountId':_0x2d8f93[_0xe9f0('0x3b')]['id'],'MailInteractionId':_0x42aab8['id'],'direction':'in','ContactId':_0x3d4eb7[_0xe9f0('0x4f')]['id'],'messageId':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x50')],'from':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x33')],'to':_0x2d8f93[_0xe9f0('0x2c')]['message']['to'],'cc':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['cc'],'subject':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x52')],'attach':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x53')],'Attachments':_0x2d8f93[_0xe9f0('0x2c')]['message']['attachments'],'originTo':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x5e')],'originCc':_0x2d8f93[_0xe9f0('0x2c')]['message'][_0xe9f0('0x5f')],'bcc':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x60')],'ChatWebsiteId':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x61')]||null,'originChannel':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')]['originChannel']||_0xe9f0('0x62'),'ChatOfflineMessageId':_0x2d8f93[_0xe9f0('0x2c')][_0xe9f0('0x18')][_0xe9f0('0x63')]||null},{'include':[{'model':db[_0xe9f0('0x64')],'as':_0xe9f0('0x65')}]});})[_0xe9f0('0x10')](function(_0x114033){_0x3d4eb7['message']=_0x114033;if(_0x3d4eb7[_0xe9f0('0x5b')][_0xe9f0('0x66')]){return db[_0xe9f0('0x67')][_0xe9f0('0x26')]({'attributes':['id',_0xe9f0('0x68')],'where':{'id':_0x3d4eb7[_0xe9f0('0x5b')]['UserId']}})[_0xe9f0('0x10')](function(_0x568a13){if(_0x568a13){_0x3d4eb7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xe9f0('0x69'),'appdata':_0x568a13[_0xe9f0('0x68')]+','+(_0x3d4eb7[_0xe9f0('0x3b')][_0xe9f0('0x6a')]||0xa),'interval':_0xe9f0('0x4c')});}return respondWithRpcPromise(_0xe9f0('0x6b'),_0xe9f0('0x6c'),_0x3d4eb7);});}return respondWithRpcPromise(_0xe9f0('0x6b'),_0xe9f0('0x6c'),_0x3d4eb7);})['then'](function(_0x3b5047){_0x2560c6(_0x3b5047);})[_0xe9f0('0x1a')](function(_0xef6284){_0xd9b61b(_0x40c2c6[_0xe9f0('0x16')](0x1f4,_0xef6284[_0xe9f0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 74895f5..6c11f33 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 _0x593e=['length','save','remove','update','removeListener','register'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x593e,0x193));var _0xe593=function(_0x504998,_0x5b8b77){_0x504998=_0x504998-0x0;var _0x4a88c6=_0x593e[_0x504998];return _0x4a88c6;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xe593('0x0'),_0xe593('0x1'),_0xe593('0x2')];function createListener(_0x2d4feb,_0x5b2f38){return function(_0x458378){_0x5b2f38['emit'](_0x2d4feb,_0x458378);};}function removeListener(_0x17e92e,_0x173d5c){return function(){MailAccountEvents[_0xe593('0x3')](_0x17e92e,_0x173d5c);};}exports[_0xe593('0x4')]=function(_0x162876){for(var _0x1f5776=0x0,_0x2aba5f=events[_0xe593('0x5')];_0x1f5776<_0x2aba5f;_0x1f5776++){var _0x1b885b=events[_0x1f5776];var _0x27afe0=createListener('mailAccount:'+_0x1b885b,_0x162876);MailAccountEvents['on'](_0x1b885b,_0x27afe0);}}; \ No newline at end of file +var _0xa775=['register','./mailAccount.events','remove','emit','removeListener'];(function(_0x535cff,_0x3cbc6f){var _0x51f82a=function(_0x419721){while(--_0x419721){_0x535cff['push'](_0x535cff['shift']());}};_0x51f82a(++_0x3cbc6f);}(_0xa775,0xf6));var _0x5a77=function(_0x1b5b72,_0x3a21f5){_0x1b5b72=_0x1b5b72-0x0;var _0x35921a=_0xa775[_0x1b5b72];return _0x35921a;};'use strict';var MailAccountEvents=require(_0x5a77('0x0'));var events=['save',_0x5a77('0x1'),'update'];function createListener(_0x4ab93f,_0x1815b2){return function(_0x38b776){_0x1815b2[_0x5a77('0x2')](_0x4ab93f,_0x38b776);};}function removeListener(_0xa11657,_0x55f67a){return function(){MailAccountEvents[_0x5a77('0x3')](_0xa11657,_0x55f67a);};}exports[_0x5a77('0x4')]=function(_0x44dbb4){for(var _0x468c4f=0x0,_0x2db8aa=events['length'];_0x468c4f<_0x2db8aa;_0x468c4f++){var _0x4d933c=events[_0x468c4f];var _0x5605a3=createListener('mailAccount:'+_0x4d933c,_0x44dbb4);MailAccountEvents['on'](_0x4d933c,_0x5605a3);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index b397128..46cf2cf 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 _0x038f=['Router','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','put','update','delete','isAuthenticated','destroy','path','express'];(function(_0x3eb5f8,_0x4ba4f7){var _0x5238d3=function(_0x5ea851){while(--_0x5ea851){_0x3eb5f8['push'](_0x3eb5f8['shift']());}};_0x5238d3(++_0x4ba4f7);}(_0x038f,0x1a2));var _0xf038=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0x038f[_0x20e7e3];return _0x14b9de;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf038('0x0'));var timeout=require('connect-timeout');var express=require(_0xf038('0x1'));var router=express[_0xf038('0x2')]();var fs_extra=require(_0xf038('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf038('0x4'));var config=require(_0xf038('0x5'));var controller=require(_0xf038('0x6'));router[_0xf038('0x7')](_0xf038('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xf038('0x9')](_0xf038('0x8'),auth['isAuthenticated'](),controller[_0xf038('0xa')]);router[_0xf038('0xb')](_0xf038('0x8'),auth[_0xf038('0xc')](),controller[_0xf038('0xd')]);module['exports']=router; \ No newline at end of file +var _0x0a9f=['update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','show','put','/:id'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x0a9f,0xe2));var _0xf0a9=function(_0x3fe393,_0x234a3a){_0x3fe393=_0x3fe393-0x0;var _0x534d14=_0x0a9f[_0x3fe393];return _0x534d14;};'use strict';var multer=require(_0xf0a9('0x0'));var util=require(_0xf0a9('0x1'));var path=require(_0xf0a9('0x2'));var timeout=require(_0xf0a9('0x3'));var express=require(_0xf0a9('0x4'));var router=express[_0xf0a9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf0a9('0x6'));var interaction=require(_0xf0a9('0x7'));var config=require(_0xf0a9('0x8'));var controller=require(_0xf0a9('0x9'));router['get']('/:id',auth[_0xf0a9('0xa')](),controller[_0xf0a9('0xb')]);router[_0xf0a9('0xc')](_0xf0a9('0xd'),auth[_0xf0a9('0xa')](),controller[_0xf0a9('0xe')]);router['delete'](_0xf0a9('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xf0a9('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 6606908..92d112d 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 _0x8508=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x595bae,_0x52f914){var _0x21b4f3=function(_0x52e1d7){while(--_0x52e1d7){_0x595bae['push'](_0x595bae['shift']());}};_0x21b4f3(++_0x52f914);}(_0x8508,0xae));var _0x8850=function(_0x29ac7b,_0x2420d5){_0x29ac7b=_0x29ac7b-0x0;var _0x7c47c2=_0x8508[_0x29ac7b];return _0x7c47c2;};'use strict';var Sequelize=require(_0x8850('0x0'));module[_0x8850('0x1')]={'priority':{'type':Sequelize[_0x8850('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8850('0x3')],'allowNull':![],'defaultValue':_0x8850('0x4')},'appdata':{'type':Sequelize[_0x8850('0x5')]()},'description':{'type':Sequelize[_0x8850('0x3')]},'interval':{'type':Sequelize[_0x8850('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x3eed=['TEXT','*,*,*,*','sequelize','STRING','noop'];(function(_0x11b783,_0xb5654a){var _0x413b4d=function(_0x23ecc3){while(--_0x23ecc3){_0x11b783['push'](_0x11b783['shift']());}};_0x413b4d(++_0xb5654a);}(_0x3eed,0xd4));var _0xd3ee=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3eed[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xd3ee('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd3ee('0x1')],'allowNull':![],'defaultValue':_0xd3ee('0x2')},'appdata':{'type':Sequelize[_0xd3ee('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd3ee('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 808db06..a44d977 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 _0xf4eb=['limit','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','params','keys','MailApplication','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','options','find','catch','body','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x155d18,_0x5b4da9){var _0x3cfdc6=function(_0x15e47a){while(--_0x15e47a){_0x155d18['push'](_0x155d18['shift']());}};_0x3cfdc6(++_0x5b4da9);}(_0xf4eb,0xec));var _0xbf4e=function(_0x58dea6,_0xbd27e9){_0x58dea6=_0x58dea6-0x0;var _0x11f25c=_0xf4eb[_0x58dea6];return _0x11f25c;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){_0x51648c[_0xbf4e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x21')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x22')]){delete _0x5bcf71[_0xbf4e('0x22')];}_0x2fb490[_0xbf4e('0x14')](_0x5e08b1)[_0xbf4e('0x23')](_0x5bcf71);};}exports['show']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={'raw':!![],'where':{'id':_0x2d4686[_0xbf4e('0x24')]['id']}},_0x4cd4a1={};_0x4cd4a1['model']=_[_0xbf4e('0x25')](db[_0xbf4e('0x26')][_0xbf4e('0x27')]);_0x4cd4a1['query']=_[_0xbf4e('0x25')](_0x2d4686[_0xbf4e('0x28')]);_0x4cd4a1[_0xbf4e('0x29')]=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],_0x4cd4a1[_0xbf4e('0x28')]);_0x43879d['attributes']=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],qs['fields'](_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2c')]));_0x43879d['attributes']=_0x43879d[_0xbf4e('0x2d')]['length']?_0x43879d[_0xbf4e('0x2d')]:_0x4cd4a1['model'];if(_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2e')]){_0x43879d[_0xbf4e('0x2f')]=[{'all':!![]}];}_0x43879d=_['merge']({},_0x43879d,_0x2d4686[_0xbf4e('0x30')]);return db[_0xbf4e('0x26')][_0xbf4e('0x31')](_0x43879d)[_0xbf4e('0x1f')](handleEntityNotFound(_0x8e0ab5,null))[_0xbf4e('0x1f')](respondWithResult(_0x8e0ab5,null))[_0xbf4e('0x32')](handleError(_0x8e0ab5,null));};exports['update']=function(_0x99b320,_0x3dbb2b){if(_0x99b320[_0xbf4e('0x33')]['id']){delete _0x99b320[_0xbf4e('0x33')]['id'];}return db[_0xbf4e('0x26')]['find']({'where':{'id':_0x99b320['params']['id']}})['then'](handleEntityNotFound(_0x3dbb2b,null))['then'](saveUpdates(_0x99b320[_0xbf4e('0x33')],null))[_0xbf4e('0x1f')](respondWithResult(_0x3dbb2b,null))[_0xbf4e('0x32')](handleError(_0x3dbb2b,null));};exports[_0xbf4e('0x20')]=function(_0x22ddde,_0x257b74){return db[_0xbf4e('0x26')][_0xbf4e('0x31')]({'where':{'id':_0x22ddde[_0xbf4e('0x24')]['id']}})['then'](handleEntityNotFound(_0x257b74,null))['then'](removeEntity(_0x257b74,null))[_0xbf4e('0x32')](handleError(_0x257b74,null));}; \ No newline at end of file +var _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','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','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x10b1c5,_0x1d6b54){var _0x4416dc=function(_0x3a377c){while(--_0x3a377c){_0x10b1c5['push'](_0x10b1c5['shift']());}};_0x4416dc(++_0x1d6b54);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0xcb91[_0x3132e8];return _0x43eb8c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 8430889..a84bc37 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 _0x9d53=['util','../../config/logger','api','request-promise','rimraf','exports','define','mail_applications','utf8mb4','lodash'];(function(_0x1bd7c2,_0x4d83d5){var _0x33a382=function(_0x423693){while(--_0x423693){_0x1bd7c2['push'](_0x1bd7c2['shift']());}};_0x33a382(++_0x4d83d5);}(_0x9d53,0xd1));var _0x39d5=function(_0x276035,_0x3b5058){_0x276035=_0x276035-0x0;var _0x396f9f=_0x9d53[_0x276035];return _0x396f9f;};'use strict';var _=require(_0x39d5('0x0'));var util=require(_0x39d5('0x1'));var logger=require(_0x39d5('0x2'))(_0x39d5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x39d5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39d5('0x5'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x39d5('0x6')]=function(_0x5ef24e,_0x14c107){return _0x5ef24e[_0x39d5('0x7')]('MailApplication',attributes,{'tableName':_0x39d5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x39d5('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0396=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','MailApplication','utf8mb4_unicode_ci','lodash','util'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x0396,0xfa));var _0x6039=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x0396[_0x53cf8e];return _0x459197;};'use strict';var _=require(_0x6039('0x0'));var util=require(_0x6039('0x1'));var logger=require('../../config/logger')(_0x6039('0x2'));var moment=require(_0x6039('0x3'));var BPromise=require(_0x6039('0x4'));var rp=require(_0x6039('0x5'));var fs=require('fs');var path=require(_0x6039('0x6'));var rimraf=require('rimraf');var config=require(_0x6039('0x7'));var attributes=require('./mailApplication.attributes');module[_0x6039('0x8')]=function(_0x361587,_0x21ceb9){return _0x361587[_0x6039('0x9')](_0x6039('0xa'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6039('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index d517ef8..dc36ea0 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 _0xe107=['update','body','options','where','attributes','limit','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','MailApplication,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','catch','UpdateMailApplication','MailApplication'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0xe107,0x14b));var _0x7e10=function(_0x2c0dd9,_0x140359){_0x2c0dd9=_0x2c0dd9-0x0;var _0x28608d=_0xe107[_0x2c0dd9];return _0x28608d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7e10('0x0'));var BPromise=require(_0x7e10('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e10('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e10('0x3'))(_0x7e10('0x4'));var config=require(_0x7e10('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x438084,_0x56f2ca,_0x18c984){return new BPromise(function(_0x1c413a,_0x5de6d8){return client[_0x7e10('0x6')](_0x438084,_0x18c984)[_0x7e10('0x7')](function(_0x1529c9){logger['info'](_0x7e10('0x8'),_0x56f2ca,'request\x20sent');logger[_0x7e10('0x9')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x56f2ca,'request\x20sent',JSON[_0x7e10('0xa')](_0x1529c9));if(_0x1529c9[_0x7e10('0xb')]){if(_0x1529c9[_0x7e10('0xb')][_0x7e10('0xc')]===0x1f4){logger[_0x7e10('0xb')](_0x7e10('0x8'),_0x56f2ca,_0x1529c9[_0x7e10('0xb')][_0x7e10('0xd')]);return _0x5de6d8(_0x1529c9['error'][_0x7e10('0xd')]);}logger[_0x7e10('0xb')](_0x7e10('0x8'),_0x56f2ca,_0x1529c9['error'][_0x7e10('0xd')]);return _0x1c413a(_0x1529c9[_0x7e10('0xb')][_0x7e10('0xd')]);}else{logger[_0x7e10('0xe')](_0x7e10('0x8'),_0x56f2ca,_0x7e10('0xf'));_0x1c413a(_0x1529c9['result'][_0x7e10('0xd')]);}})[_0x7e10('0x10')](function(_0x150c4e){logger[_0x7e10('0xb')]('MailApplication,\x20%s,\x20%s',_0x56f2ca,_0x150c4e);_0x5de6d8(_0x150c4e);});});}exports[_0x7e10('0x11')]=function(_0x1e6fc9){var _0x45ed2e=this;return new Promise(function(_0x175409,_0x2fc853){return db[_0x7e10('0x12')][_0x7e10('0x13')](_0x1e6fc9[_0x7e10('0x14')],{'raw':_0x1e6fc9[_0x7e10('0x15')]?_0x1e6fc9[_0x7e10('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e6fc9[_0x7e10('0x15')]?_0x1e6fc9[_0x7e10('0x15')][_0x7e10('0x16')]||null:null,'attributes':_0x1e6fc9[_0x7e10('0x15')]?_0x1e6fc9[_0x7e10('0x15')][_0x7e10('0x17')]||null:null,'limit':_0x1e6fc9[_0x7e10('0x15')]?_0x1e6fc9[_0x7e10('0x15')][_0x7e10('0x18')]||null:null})[_0x7e10('0x7')](function(_0x187b4a){logger[_0x7e10('0xe')](_0x7e10('0x11'),_0x1e6fc9);logger[_0x7e10('0x9')](_0x7e10('0x11'),_0x1e6fc9,JSON[_0x7e10('0xa')](_0x187b4a));_0x175409(_0x187b4a);})[_0x7e10('0x10')](function(_0x4960a1){logger[_0x7e10('0xb')](_0x7e10('0x11'),_0x4960a1['message'],_0x1e6fc9);_0x2fc853(_0x45ed2e['error'](0x1f4,_0x4960a1[_0x7e10('0xd')]));});});}; \ No newline at end of file +var _0xa919=['randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MailApplication,\x20%s,\x20%s','message','info','catch','UpdateMailApplication','MailApplication','body','options','raw','where','attributes','limit','stringify','lodash','util','bluebird'];(function(_0x4090c2,_0x1f6da9){var _0x14d3dd=function(_0x8d95d2){while(--_0x8d95d2){_0x4090c2['push'](_0x4090c2['shift']());}};_0x14d3dd(++_0x1f6da9);}(_0xa919,0xab));var _0x9a91=function(_0x4657b4,_0x170028){_0x4657b4=_0x4657b4-0x0;var _0x547baf=_0xa919[_0x4657b4];return _0x547baf;};'use strict';var _=require(_0x9a91('0x0'));var util=require(_0x9a91('0x1'));var moment=require('moment');var BPromise=require(_0x9a91('0x2'));var rs=require(_0x9a91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a91('0x4'))['db'];var utils=require(_0x9a91('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9a91('0x6'));var jayson=require(_0x9a91('0x7'));var client=jayson['client'][_0x9a91('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4610f8,_0x1a70c2,_0x2b4539){return new BPromise(function(_0x3b190a,_0x53bb21){return client[_0x9a91('0x9')](_0x4610f8,_0x2b4539)[_0x9a91('0xa')](function(_0x87b462){logger['info']('MailApplication,\x20%s,\x20%s',_0x1a70c2,'request\x20sent');logger[_0x9a91('0xb')](_0x9a91('0xc'),_0x1a70c2,_0x9a91('0xd'),JSON['stringify'](_0x87b462));if(_0x87b462['error']){if(_0x87b462[_0x9a91('0xe')][_0x9a91('0xf')]===0x1f4){logger['error'](_0x9a91('0x10'),_0x1a70c2,_0x87b462['error'][_0x9a91('0x11')]);return _0x53bb21(_0x87b462[_0x9a91('0xe')][_0x9a91('0x11')]);}logger[_0x9a91('0xe')]('MailApplication,\x20%s,\x20%s',_0x1a70c2,_0x87b462[_0x9a91('0xe')][_0x9a91('0x11')]);return _0x3b190a(_0x87b462['error']['message']);}else{logger[_0x9a91('0x12')](_0x9a91('0x10'),_0x1a70c2,_0x9a91('0xd'));_0x3b190a(_0x87b462['result'][_0x9a91('0x11')]);}})[_0x9a91('0x13')](function(_0x1cf027){logger['error'](_0x9a91('0x10'),_0x1a70c2,_0x1cf027);_0x53bb21(_0x1cf027);});});}exports[_0x9a91('0x14')]=function(_0x583075){var _0x18843a=this;return new Promise(function(_0x284afe,_0x391036){return db[_0x9a91('0x15')]['update'](_0x583075[_0x9a91('0x16')],{'raw':_0x583075[_0x9a91('0x17')]?_0x583075[_0x9a91('0x17')][_0x9a91('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x583075[_0x9a91('0x17')]?_0x583075['options'][_0x9a91('0x19')]||null:null,'attributes':_0x583075[_0x9a91('0x17')]?_0x583075[_0x9a91('0x17')][_0x9a91('0x1a')]||null:null,'limit':_0x583075[_0x9a91('0x17')]?_0x583075[_0x9a91('0x17')][_0x9a91('0x1b')]||null:null})[_0x9a91('0xa')](function(_0x7de105){logger[_0x9a91('0x12')](_0x9a91('0x14'),_0x583075);logger[_0x9a91('0xb')](_0x9a91('0x14'),_0x583075,JSON[_0x9a91('0x1c')](_0x7de105));_0x284afe(_0x7de105);})[_0x9a91('0x13')](function(_0x1af095){logger[_0x9a91('0xe')]('UpdateMailApplication',_0x1af095[_0x9a91('0x11')],_0x583075);_0x391036(_0x18843a['error'](0x1f4,_0x1af095[_0x9a91('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 14577d4..8b87147 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 _0xd51b=['addMessage','/:id/tags','tracked','mail','addTags','put','/:id','mailinteraction:update','delete','removeTags','exports','express','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','create','post'];(function(_0x16995f,_0x326c0f){var _0x37931a=function(_0x1b6393){while(--_0x1b6393){_0x16995f['push'](_0x16995f['shift']());}};_0x37931a(++_0x326c0f);}(_0xd51b,0x15d));var _0xbd51=function(_0x4794da,_0x49990d){_0x4794da=_0x4794da-0x0;var _0x3e318a=_0xd51b[_0x4794da];return _0x3e318a;};'use strict';var express=require(_0xbd51('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbd51('0x1'));var controller=require(_0xbd51('0x2'));router[_0xbd51('0x3')]('/',auth[_0xbd51('0x4')](),controller[_0xbd51('0x5')]);router[_0xbd51('0x3')](_0xbd51('0x6'),auth[_0xbd51('0x4')](),controller[_0xbd51('0x7')]);router[_0xbd51('0x3')]('/:id',auth['isAuthenticated'](),controller[_0xbd51('0x8')]);router[_0xbd51('0x3')](_0xbd51('0x9'),auth[_0xbd51('0x4')](),controller[_0xbd51('0xa')]);router[_0xbd51('0x3')](_0xbd51('0xb'),auth['isAuthenticated'](),controller[_0xbd51('0xc')]);router['post']('/',auth[_0xbd51('0x4')](),controller[_0xbd51('0xd')]);router[_0xbd51('0xe')](_0xbd51('0x9'),auth[_0xbd51('0x4')](),controller[_0xbd51('0xf')]);router[_0xbd51('0xe')](_0xbd51('0x10'),auth[_0xbd51('0x4')](),interaction[_0xbd51('0x11')](_0xbd51('0x12'),'mailinteraction:addtags'),controller[_0xbd51('0x13')]);router[_0xbd51('0x14')](_0xbd51('0x15'),auth[_0xbd51('0x4')](),interaction[_0xbd51('0x11')](_0xbd51('0x12'),_0xbd51('0x16')),controller['update']);router['delete'](_0xbd51('0x15'),auth[_0xbd51('0x4')](),interaction[_0xbd51('0x11')](_0xbd51('0x12'),'mailinteraction:destroy'),controller['destroy']);router[_0xbd51('0x17')](_0xbd51('0x10'),auth['isAuthenticated'](),controller[_0xbd51('0x18')]);module[_0xbd51('0x19')]=router; \ No newline at end of file +var _0x5c7e=['/:id/messages','getMessages','/:id/download','post','create','addMessage','tracked','mail','mailinteraction:addtags','put','/:id','mailinteraction:update','update','delete','destroy','/:id/tags','exports','express','Router','../../components/auth/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','show'];(function(_0x23cbf8,_0x1d738b){var _0x37a242=function(_0x3f6264){while(--_0x3f6264){_0x23cbf8['push'](_0x23cbf8['shift']());}};_0x37a242(++_0x1d738b);}(_0x5c7e,0x104));var _0xe5c7=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0x5c7e[_0x1602ef];return _0x5870ee;};'use strict';var express=require(_0xe5c7('0x0'));var router=express[_0xe5c7('0x1')]();var auth=require(_0xe5c7('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0xe5c7('0x3'));router['get']('/',auth[_0xe5c7('0x4')](),controller[_0xe5c7('0x5')]);router[_0xe5c7('0x6')](_0xe5c7('0x7'),auth[_0xe5c7('0x4')](),controller[_0xe5c7('0x8')]);router[_0xe5c7('0x6')]('/:id',auth[_0xe5c7('0x4')](),controller[_0xe5c7('0x9')]);router['get'](_0xe5c7('0xa'),auth[_0xe5c7('0x4')](),controller[_0xe5c7('0xb')]);router[_0xe5c7('0x6')](_0xe5c7('0xc'),auth[_0xe5c7('0x4')](),controller['download']);router[_0xe5c7('0xd')]('/',auth[_0xe5c7('0x4')](),controller[_0xe5c7('0xe')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0xe5c7('0xf')]);router[_0xe5c7('0xd')]('/:id/tags',auth[_0xe5c7('0x4')](),interaction[_0xe5c7('0x10')](_0xe5c7('0x11'),_0xe5c7('0x12')),controller['addTags']);router[_0xe5c7('0x13')](_0xe5c7('0x14'),auth[_0xe5c7('0x4')](),interaction[_0xe5c7('0x10')](_0xe5c7('0x11'),_0xe5c7('0x15')),controller[_0xe5c7('0x16')]);router[_0xe5c7('0x17')](_0xe5c7('0x14'),auth[_0xe5c7('0x4')](),interaction[_0xe5c7('0x10')](_0xe5c7('0x11'),'mailinteraction:destroy'),controller[_0xe5c7('0x18')]);router[_0xe5c7('0x17')](_0xe5c7('0x19'),auth[_0xe5c7('0x4')](),controller['removeTags']);module[_0xe5c7('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 3a0dfc2..de24515 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 _0xbccb=['DATE','ENUM','out','sequelize','iconv','exports','BOOLEAN','STRING','TEXT','long'];(function(_0x282ccc,_0x5d66a1){var _0x27c2dd=function(_0x58431a){while(--_0x58431a){_0x282ccc['push'](_0x282ccc['shift']());}};_0x27c2dd(++_0x5d66a1);}(_0xbccb,0x157));var _0xbbcc=function(_0x3e6a06,_0x5ddcd6){_0x3e6a06=_0x3e6a06-0x0;var _0xcdc571=_0xbccb[_0x3e6a06];return _0xcdc571;};'use strict';var Sequelize=require(_0xbbcc('0x0'));var iconv=require(_0xbbcc('0x1'));module[_0xbbcc('0x2')]={'closed':{'type':Sequelize[_0xbbcc('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xbbcc('0x4')]},'secondDisposition':{'type':Sequelize[_0xbbcc('0x4')]},'thirdDisposition':{'type':Sequelize[_0xbbcc('0x4')]},'note':{'type':Sequelize[_0xbbcc('0x4')]},'inReplyTo':{'type':Sequelize[_0xbbcc('0x4')](0x1fe)},'to':{'type':Sequelize[_0xbbcc('0x4')]},'cc':{'type':Sequelize[_0xbbcc('0x5')](_0xbbcc('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xbbcc('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xbbcc('0x7')]},'substatus':{'type':Sequelize[_0xbbcc('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xbbcc('0x7')]},'firstMsgDirection':{'type':Sequelize[_0xbbcc('0x8')]('in',_0xbbcc('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbbcc('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xbbcc('0x8')]('in',_0xbbcc('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbbcc('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8ff4=['long','ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING','TEXT'];(function(_0x370510,_0x409c36){var _0x30e7d3=function(_0x35c19a){while(--_0x35c19a){_0x370510['push'](_0x370510['shift']());}};_0x30e7d3(++_0x409c36);}(_0x8ff4,0x1b3));var _0x48ff=function(_0x525513,_0x44220c){_0x525513=_0x525513-0x0;var _0x17f77f=_0x8ff4[_0x525513];return _0x17f77f;};'use strict';var Sequelize=require(_0x48ff('0x0'));var iconv=require('iconv');module[_0x48ff('0x1')]={'closed':{'type':Sequelize[_0x48ff('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x48ff('0x3')]},'disposition':{'type':Sequelize[_0x48ff('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x48ff('0x4')]},'inReplyTo':{'type':Sequelize[_0x48ff('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x48ff('0x5')](_0x48ff('0x6'))},'subject':{'type':Sequelize[_0x48ff('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x48ff('0x3')]},'substatus':{'type':Sequelize[_0x48ff('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x48ff('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x48ff('0x7')]('in',_0x48ff('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x48ff('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x48ff('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x48ff('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 736e3e3..9545bed 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 _0xdc80=['include','merge','create','catch','body','find','describe','addMessage','omit','getMessages','findOne','MailMessage','filters','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','format','options','inlineCss','addTags','setTags','ids','emit','mailInteractionTags:save','removeTags','unix','toString','join','root','server','files','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','from','decode','headers','Bcc','existsSync','writeFileSync','message%d.eml','unlinkSync','rimraf','moment','bluebird','lodash','juice','../../components/interaction/service','../../components/parsers/qs','../../config/environment','html-entities','defaults','redis','localhost','./mailInteraction.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','map','MailInteraction','fieldName','type','getOptions','findAll','mail','query','user','show','params','model','keys','rawAttributes','intersection','attributes','fields','length','includeAll'];(function(_0x2eb06c,_0x33ba5b){var _0x2d983d=function(_0x5addf5){while(--_0x5addf5){_0x2eb06c['push'](_0x2eb06c['shift']());}};_0x2d983d(++_0x33ba5b);}(_0xdc80,0xa0));var _0x0dc8=function(_0x4239bd,_0x1f310b){_0x4239bd=_0x4239bd-0x0;var _0x21f061=_0xdc80[_0x4239bd];return _0x21f061;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0dc8('0x0'));var zipdir=require('zip-dir');var moment=require(_0x0dc8('0x1'));var BPromise=require(_0x0dc8('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x0dc8('0x3'));var juice=require(_0x0dc8('0x4'));var Redis=require('ioredis');var interaction=require(_0x0dc8('0x5'));var qs=require(_0x0dc8('0x6'));var logger=require('../../config/logger')('api');var config=require(_0x0dc8('0x7'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x0dc8('0x8'));config['redis']=_[_0x0dc8('0x9')](config[_0x0dc8('0xa')],{'host':_0x0dc8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0dc8('0xa')]));require(_0x0dc8('0xc'))[_0x0dc8('0xd')](socket);function respondWithStatusCode(_0x3683c3,_0x4aba5d){_0x4aba5d=_0x4aba5d||0xcc;return function(_0x577d71){if(_0x577d71){return _0x3683c3[_0x0dc8('0xe')](_0x4aba5d);}return _0x3683c3['status'](_0x4aba5d)[_0x0dc8('0xf')]();};}function respondWithResult(_0x4d1b78,_0x55ab91){_0x55ab91=_0x55ab91||0xc8;return function(_0x222f68){if(_0x222f68){return _0x4d1b78[_0x0dc8('0x10')](_0x55ab91)[_0x0dc8('0x11')](_0x222f68);}};}function respondWithFilteredResult(_0x8cbf13,_0x410b7f){return function(_0x182ce4){if(_0x182ce4){var _0x3a824d=typeof _0x410b7f['offset']===_0x0dc8('0x12')&&typeof _0x410b7f[_0x0dc8('0x13')]===_0x0dc8('0x12');var _0x29658e=_0x182ce4[_0x0dc8('0x14')];var _0x2d85ac=_0x3a824d?0x0:_0x410b7f[_0x0dc8('0x15')];var _0x5c405b=_0x3a824d?_0x182ce4[_0x0dc8('0x14')]:_0x410b7f['offset']+_0x410b7f[_0x0dc8('0x13')];var _0x307573;if(_0x5c405b>=_0x29658e){_0x5c405b=_0x29658e;_0x307573=0xc8;}else{_0x307573=0xce;}_0x8cbf13[_0x0dc8('0x10')](_0x307573);return _0x8cbf13[_0x0dc8('0x16')](_0x0dc8('0x17'),_0x2d85ac+'-'+_0x5c405b+'/'+_0x29658e)[_0x0dc8('0x11')](_0x182ce4);}return null;};}function saveUpdates(_0x145636){return function(_0x5d9221){if(_0x5d9221){return _0x5d9221[_0x0dc8('0x18')](_0x145636)[_0x0dc8('0x19')](function(_0x466ac1){return _0x466ac1;});}return null;};}function removeEntity(_0x4d97f0){return function(_0x3a218f){if(_0x3a218f){return _0x3a218f[_0x0dc8('0x1a')]()[_0x0dc8('0x19')](function(){_0x4d97f0[_0x0dc8('0x10')](0xcc)[_0x0dc8('0xf')]();});}};}function handleEntityNotFound(_0xb8c9f4){return function(_0x25b789){if(!_0x25b789){_0xb8c9f4[_0x0dc8('0xe')](0x194);}return _0x25b789;};}function handleError(_0x486ddc,_0x5120b4){_0x5120b4=_0x5120b4||0x1f4;return function(_0x115886){logger[_0x0dc8('0x1b')](_0x115886[_0x0dc8('0x1c')]);if(_0x115886[_0x0dc8('0x1d')]){delete _0x115886[_0x0dc8('0x1d')];}_0x486ddc[_0x0dc8('0x10')](_0x5120b4)[_0x0dc8('0x1e')](_0x115886);};}exports['index']=function(_0x2fbceb,_0x2e18d6){var _0xc5dfdf={};var _0x1d613a=_[_0x0dc8('0x1f')](db[_0x0dc8('0x20')]['rawAttributes'],function(_0x9a7fed){return{'name':_0x9a7fed[_0x0dc8('0x21')],'type':_0x9a7fed[_0x0dc8('0x22')]['key']};});_0xc5dfdf=qs[_0x0dc8('0x23')](_0x1d613a,_0x2fbceb);return interaction[_0x0dc8('0x24')](_0x0dc8('0x25'),_0x2fbceb[_0x0dc8('0x26')],_0x2fbceb[_0x0dc8('0x27')],_0xc5dfdf,_0x1d613a)[_0x0dc8('0x19')](respondWithFilteredResult(_0x2e18d6,_0xc5dfdf))['catch'](handleError(_0x2e18d6,null));};exports[_0x0dc8('0x28')]=function(_0x1b00ff,_0x2ecd92){var _0x5f19fd={'raw':![],'where':{'id':_0x1b00ff[_0x0dc8('0x29')]['id']}},_0x55e287={};_0x55e287[_0x0dc8('0x2a')]=_[_0x0dc8('0x2b')](db[_0x0dc8('0x20')][_0x0dc8('0x2c')]);_0x55e287['query']=_[_0x0dc8('0x2b')](_0x1b00ff[_0x0dc8('0x26')]);_0x55e287['filters']=_[_0x0dc8('0x2d')](_0x55e287[_0x0dc8('0x2a')],_0x55e287[_0x0dc8('0x26')]);_0x5f19fd[_0x0dc8('0x2e')]=_['intersection'](_0x55e287[_0x0dc8('0x2a')],qs[_0x0dc8('0x2f')](_0x1b00ff[_0x0dc8('0x26')]['fields']));_0x5f19fd[_0x0dc8('0x2e')]=_0x5f19fd['attributes'][_0x0dc8('0x30')]?_0x5f19fd['attributes']:_0x55e287[_0x0dc8('0x2a')];if(_0x1b00ff[_0x0dc8('0x26')][_0x0dc8('0x31')]){_0x5f19fd[_0x0dc8('0x32')]=[{'all':!![]}];}_0x5f19fd=_[_0x0dc8('0x33')]({},_0x5f19fd,_0x1b00ff['options']);return db['MailInteraction']['find'](_0x5f19fd)[_0x0dc8('0x19')](handleEntityNotFound(_0x2ecd92,null))[_0x0dc8('0x19')](respondWithResult(_0x2ecd92,null))['catch'](handleError(_0x2ecd92,null));};exports['create']=function(_0x452002,_0x4debfb){return db['MailInteraction'][_0x0dc8('0x34')](_0x452002['body'],{})['then'](respondWithResult(_0x4debfb,0xc9))[_0x0dc8('0x35')](handleError(_0x4debfb,null));};exports[_0x0dc8('0x18')]=function(_0x30fd1c,_0xf2dab8){if(_0x30fd1c[_0x0dc8('0x36')]['id']){delete _0x30fd1c[_0x0dc8('0x36')]['id'];}return db[_0x0dc8('0x20')][_0x0dc8('0x37')]({'where':{'id':_0x30fd1c[_0x0dc8('0x29')]['id']}})[_0x0dc8('0x19')](handleEntityNotFound(_0xf2dab8,null))[_0x0dc8('0x19')](saveUpdates(_0x30fd1c['body'],null))[_0x0dc8('0x19')](respondWithResult(_0xf2dab8,null))['catch'](handleError(_0xf2dab8,null));};exports[_0x0dc8('0x1a')]=function(_0x246e04,_0x45dae6){return db[_0x0dc8('0x20')][_0x0dc8('0x37')]({'where':{'id':_0x246e04['params']['id']}})[_0x0dc8('0x19')](handleEntityNotFound(_0x45dae6,null))['then'](removeEntity(_0x45dae6,null))['catch'](handleError(_0x45dae6,null));};exports[_0x0dc8('0x38')]=function(_0x51e8d5,_0x20559f){return db[_0x0dc8('0x20')][_0x0dc8('0x38')]()[_0x0dc8('0x19')](respondWithResult(_0x20559f,null))[_0x0dc8('0x35')](handleError(_0x20559f,null));};exports['addMessage']=function(_0x4b1a6b,_0x49264b){return db['MailMessage'][_0x0dc8('0x37')]({'where':{'id':_0x4b1a6b[_0x0dc8('0x29')]['id']}})[_0x0dc8('0x19')](handleEntityNotFound(_0x49264b,null))[_0x0dc8('0x19')](function(_0x554a6a){if(_0x554a6a){return _0x554a6a[_0x0dc8('0x39')](_0x4b1a6b[_0x0dc8('0x36')]['ids'],_[_0x0dc8('0x3a')](_0x4b1a6b['body'],['ids','id'])||{});}})[_0x0dc8('0x19')](respondWithResult(_0x49264b,null))[_0x0dc8('0x35')](handleError(_0x49264b,null));};exports[_0x0dc8('0x3b')]=function(_0x46c4b1,_0x5852e3){var _0x1ef020={'raw':![],'where':{}};var _0x2577ec={};var _0x4b0590={'count':0x0,'rows':[]};return db[_0x0dc8('0x20')][_0x0dc8('0x3c')]({'where':{'id':_0x46c4b1['params']['id']}})[_0x0dc8('0x19')](handleEntityNotFound(_0x5852e3,null))[_0x0dc8('0x19')](function(_0x404457){if(_0x404457){_0x2577ec['model']=_[_0x0dc8('0x2b')](db[_0x0dc8('0x3d')][_0x0dc8('0x2c')]);_0x2577ec[_0x0dc8('0x26')]=_[_0x0dc8('0x2b')](_0x46c4b1['query']);_0x2577ec[_0x0dc8('0x3e')]=_[_0x0dc8('0x2d')](_0x2577ec[_0x0dc8('0x2a')],_0x2577ec[_0x0dc8('0x26')]);_0x1ef020['attributes']=_[_0x0dc8('0x2d')](_0x2577ec[_0x0dc8('0x2a')],qs[_0x0dc8('0x2f')](_0x46c4b1[_0x0dc8('0x26')]['fields']));_0x1ef020[_0x0dc8('0x2e')]=_0x1ef020[_0x0dc8('0x2e')][_0x0dc8('0x30')]?_0x1ef020[_0x0dc8('0x2e')]:_0x2577ec[_0x0dc8('0x2a')];if(!_0x46c4b1[_0x0dc8('0x26')]['hasOwnProperty'](_0x0dc8('0x3f'))){_0x1ef020['limit']=qs[_0x0dc8('0x13')](_0x46c4b1[_0x0dc8('0x26')][_0x0dc8('0x13')]);_0x1ef020['offset']=qs[_0x0dc8('0x15')](_0x46c4b1[_0x0dc8('0x26')][_0x0dc8('0x15')]);}_0x1ef020[_0x0dc8('0x40')]=qs['sort'](_0x46c4b1[_0x0dc8('0x26')][_0x0dc8('0x41')]);_0x1ef020[_0x0dc8('0x42')]=qs[_0x0dc8('0x3e')](_[_0x0dc8('0x43')](_0x46c4b1[_0x0dc8('0x26')],_0x2577ec['filters']));_0x1ef020['where'][_0x0dc8('0x44')]=_0x404457['id'];if(_0x46c4b1[_0x0dc8('0x26')]['filter']){_0x1ef020[_0x0dc8('0x42')]=_['merge'](_0x1ef020[_0x0dc8('0x42')],{'$or':_['map'](_0x1ef020[_0x0dc8('0x2e')],function(_0x4a4a79){var _0x161f18={};_0x161f18[_0x4a4a79]={'$like':'%'+_0x46c4b1[_0x0dc8('0x26')][_0x0dc8('0x45')]+'%'};return _0x161f18;})});}if(_0x46c4b1[_0x0dc8('0x26')][_0x0dc8('0x46')]){var _0x451ce6=_0x46c4b1['query'][_0x0dc8('0x46')]['split'](',');var _0x165778={};_0x165778[_0x451ce6[0x0]]={'$gte':moment(_0x451ce6[0x1])[_0x0dc8('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1ef020[_0x0dc8('0x42')]=_[_0x0dc8('0x33')](_0x1ef020['where'],_0x165778);}_0x1ef020=_[_0x0dc8('0x33')]({},_0x1ef020,_0x46c4b1[_0x0dc8('0x48')]);return db[_0x0dc8('0x3d')][_0x0dc8('0x14')]({'where':_0x1ef020[_0x0dc8('0x42')]})[_0x0dc8('0x19')](function(_0x5a5c5e){_0x4b0590[_0x0dc8('0x14')]=_0x5a5c5e;if(_0x46c4b1[_0x0dc8('0x26')][_0x0dc8('0x31')]){_0x1ef020[_0x0dc8('0x32')]=[{'all':!![]}];}return db[_0x0dc8('0x3d')][_0x0dc8('0x24')](_0x1ef020);})[_0x0dc8('0x19')](function(_0x3eb6d6){if(_0x46c4b1[_0x0dc8('0x26')][_0x0dc8('0x49')]==='true'){for(var _0x484d88=0x0;_0x484d88<_0x3eb6d6[_0x0dc8('0x30')];_0x484d88++){_0x3eb6d6[_0x484d88][_0x0dc8('0x36')]=juice(_0x3eb6d6[_0x484d88][_0x0dc8('0x36')]);}}_0x4b0590['rows']=_0x3eb6d6;return _0x4b0590;});}})['then'](respondWithFilteredResult(_0x5852e3,_0x1ef020))[_0x0dc8('0x35')](handleError(_0x5852e3,null));};exports[_0x0dc8('0x4a')]=function(_0x543f0e,_0x462a7e){return db[_0x0dc8('0x20')][_0x0dc8('0x37')]({'where':{'id':_0x543f0e[_0x0dc8('0x29')]['id']}})[_0x0dc8('0x19')](handleEntityNotFound(_0x462a7e,null))[_0x0dc8('0x19')](function(_0x24cf17){if(_0x24cf17){return _0x24cf17[_0x0dc8('0x4b')](_0x543f0e[_0x0dc8('0x36')][_0x0dc8('0x4c')],_[_0x0dc8('0x3a')](_0x543f0e[_0x0dc8('0x36')],[_0x0dc8('0x4c'),'id'])||{})['spread'](function(){return db['Tag'][_0x0dc8('0x24')]({'attributes':['id',_0x0dc8('0x1d'),'color'],'where':{'id':_0x543f0e[_0x0dc8('0x36')]['ids']}});})[_0x0dc8('0x19')](function(_0x21e067){socket[_0x0dc8('0x4d')](_0x0dc8('0x4e'),{'id':Number(_0x543f0e['params']['id']),'tags':_0x21e067||[]});return{'id':Number(_0x543f0e[_0x0dc8('0x29')]['id']),'tags':_0x21e067||[]};});}})[_0x0dc8('0x19')](respondWithResult(_0x462a7e,null))[_0x0dc8('0x35')](handleError(_0x462a7e,null));};exports[_0x0dc8('0x4f')]=function(_0x2f0e4f,_0x585d6c){return db['MailInteraction'][_0x0dc8('0x37')]({'where':{'id':_0x2f0e4f[_0x0dc8('0x29')]['id']}})['then'](handleEntityNotFound(_0x585d6c,null))['then'](function(_0x356248){if(_0x356248){return _0x356248[_0x0dc8('0x4f')](_0x2f0e4f[_0x0dc8('0x26')][_0x0dc8('0x4c')]);}})[_0x0dc8('0x19')](respondWithStatusCode(_0x585d6c,null))[_0x0dc8('0x35')](handleError(_0x585d6c,null));};exports['download']=function(_0x2b724d,_0x5a0f40){var _0x5db3b9=moment()[_0x0dc8('0x50')]()[_0x0dc8('0x51')]();var _0x106e41=path[_0x0dc8('0x52')](config[_0x0dc8('0x53')],_0x0dc8('0x54'),_0x0dc8('0x55'),'tmp');var _0x370186=path[_0x0dc8('0x52')](config[_0x0dc8('0x53')],_0x0dc8('0x54'),_0x0dc8('0x55'),_0x0dc8('0x56'));var _0x638787=path[_0x0dc8('0x52')](_0x106e41,_0x5db3b9);var _0x10abf8=util['format'](_0x0dc8('0x57'),_0x2b724d[_0x0dc8('0x29')]['id'],_0x5db3b9);var _0x500f58=path[_0x0dc8('0x52')](_0x106e41,_0x10abf8);var _0x93c9f1=[];if(_0x2b724d[_0x0dc8('0x26')][_0x0dc8('0x56')]){_0x93c9f1[_0x0dc8('0x58')]({'model':db[_0x0dc8('0x59')],'as':_0x0dc8('0x5a'),'raw':!![]});}var _0x2e80ff=[{'model':db[_0x0dc8('0x3d')],'as':_0x0dc8('0x5b'),'attributes':['id',_0x0dc8('0x36'),'from','to','cc',_0x0dc8('0x5c'),_0x0dc8('0x5d'),'createdAt'],'where':{'secret':![]},'order':qs[_0x0dc8('0x41')]('id'),'include':_0x93c9f1}];return db[_0x0dc8('0x20')][_0x0dc8('0x37')]({'where':{'id':_0x2b724d[_0x0dc8('0x29')]['id']},'include':_0x2e80ff})[_0x0dc8('0x19')](handleEntityNotFound(_0x5a0f40,null))[_0x0dc8('0x19')](function(_0x5576c2){if(_0x5576c2&&_0x5576c2[_0x0dc8('0x5b')]){var _0x1486f9=_0x5576c2[_0x0dc8('0x5e')]({'plain':!![]});fs[_0x0dc8('0x5f')](_0x638787);return BPromise[_0x0dc8('0x60')](_0x1486f9[_0x0dc8('0x5b')],function(_0x5abbe0,_0x5203d0){var _0x5cab73={'from':_0x5abbe0[_0x0dc8('0x61')],'to':_0x5abbe0['to']||'missing.recipient@your.company.com','subject':_0x5abbe0['subject'],'html':htmlEntities[_0x0dc8('0x62')](_0x5abbe0['body']),'headers':{'Date':moment(_0x5abbe0['createdAt'])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x5abbe0['cc']){_0x5cab73[_0x0dc8('0x63')]['Cc']=_0x5abbe0['cc'];}if(_0x5abbe0[_0x0dc8('0x5c')]){_0x5cab73['headers'][_0x0dc8('0x64')]=_0x5abbe0['bcc'];}return new BPromise(function(_0x318c9c,_0x3363f7){if(_0x5abbe0[_0x0dc8('0x5a')]){for(var _0x3edb82=0x0;_0x3edb82<_0x5abbe0[_0x0dc8('0x5a')][_0x0dc8('0x30')];_0x3edb82++){var _0x4cb0a3=_0x5abbe0[_0x0dc8('0x5a')][_0x3edb82];var _0x400032=path[_0x0dc8('0x52')](_0x370186,_0x4cb0a3['basename']);if(fs[_0x0dc8('0x65')](_0x400032)){_0x5cab73[_0x0dc8('0x56')][_0x0dc8('0x58')]({'name':_0x4cb0a3[_0x0dc8('0x1d')],'contentType':_0x4cb0a3[_0x0dc8('0x22')],'data':fs['readFileSync'](_0x400032)});}}}emlformat['build'](_0x5cab73,function(_0x265d5b,_0x1bb875){if(_0x265d5b)return _0x3363f7(_0x265d5b);fs[_0x0dc8('0x66')](path[_0x0dc8('0x52')](_0x638787,util[_0x0dc8('0x47')](_0x0dc8('0x67'),_0x5203d0)),_0x1bb875);return _0x318c9c(_0x1bb875);});});})[_0x0dc8('0x19')](function(){return new BPromise(function(_0x55abfa,_0x5ef449){zipdir(_0x638787,{'saveTo':_0x500f58},function(_0x3d153c,_0x30d025){if(_0x3d153c)return _0x5ef449(_0x3d153c);return _0x55abfa(_0x30d025);});})[_0x0dc8('0x19')](function(){return new BPromise(function(_0x3d2111,_0x488ce2){rimraf(_0x638787,function(_0x2f0c24){if(_0x2f0c24)_0x488ce2(_0x2f0c24);return _0x3d2111();});});})[_0x0dc8('0x19')](function(){return _0x5a0f40['download'](_0x500f58,_0x10abf8,function(_0x45bf9c){if(!_0x45bf9c)fs[_0x0dc8('0x68')](_0x500f58);});});});}else{return _0x5a0f40[_0x0dc8('0xe')](0xc8);}})[_0x0dc8('0x35')](handleError(_0x5a0f40,null));}; \ No newline at end of file +var _0xa679=['missing.recipient@your.company.com','subject','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','writeFileSync','eml-format','zip-dir','moment','bluebird','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','html-entities','redis','defaults','./mailInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','update','then','error','stack','name','index','map','MailInteraction','rawAttributes','fieldName','type','key','getOptions','query','user','catch','show','params','model','keys','intersection','attributes','fields','length','include','options','find','create','body','destroy','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','filters','hasOwnProperty','nolimit','sort','where','MailInteractionId','filter','merge','$gte','split','format','includeAll','findAll','true','rows','addTags','setTags','spread','Tag','color','removeTags','download','unix','join','root','server','files','tmp','attachments','push','Attachment','Attachments','Messages','from','bcc','get','each'];(function(_0x73bd6c,_0x3451c){var _0x3914fb=function(_0x26b805){while(--_0x26b805){_0x73bd6c['push'](_0x73bd6c['shift']());}};_0x3914fb(++_0x3451c);}(_0xa679,0x155));var _0x9a67=function(_0x50d0b9,_0x105146){_0x50d0b9=_0x50d0b9-0x0;var _0x313049=_0xa679[_0x50d0b9];return _0x313049;};'use strict';var emlformat=require(_0x9a67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a67('0x1'));var moment=require(_0x9a67('0x2'));var BPromise=require(_0x9a67('0x3'));var util=require(_0x9a67('0x4'));var path=require(_0x9a67('0x5'));var fs=require('fs');var _=require(_0x9a67('0x6'));var juice=require('juice');var Redis=require('ioredis');var interaction=require(_0x9a67('0x7'));var qs=require(_0x9a67('0x8'));var logger=require(_0x9a67('0x9'))(_0x9a67('0xa'));var config=require(_0x9a67('0xb'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x9a67('0xc'));config[_0x9a67('0xd')]=_[_0x9a67('0xe')](config[_0x9a67('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9a67('0xf'))[_0x9a67('0x10')](socket);function respondWithStatusCode(_0x25b49a,_0x6c4068){_0x6c4068=_0x6c4068||0xcc;return function(_0x397068){if(_0x397068){return _0x25b49a[_0x9a67('0x11')](_0x6c4068);}return _0x25b49a[_0x9a67('0x12')](_0x6c4068)[_0x9a67('0x13')]();};}function respondWithResult(_0x23c5ee,_0x128287){_0x128287=_0x128287||0xc8;return function(_0x58eb41){if(_0x58eb41){return _0x23c5ee[_0x9a67('0x12')](_0x128287)[_0x9a67('0x14')](_0x58eb41);}};}function respondWithFilteredResult(_0x3537a9,_0x56a6cc){return function(_0x30d330){if(_0x30d330){var _0x552432=typeof _0x56a6cc['offset']===_0x9a67('0x15')&&typeof _0x56a6cc[_0x9a67('0x16')]===_0x9a67('0x15');var _0x134b79=_0x30d330[_0x9a67('0x17')];var _0x3b8f2f=_0x552432?0x0:_0x56a6cc[_0x9a67('0x18')];var _0x40ecb8=_0x552432?_0x30d330[_0x9a67('0x17')]:_0x56a6cc[_0x9a67('0x18')]+_0x56a6cc[_0x9a67('0x16')];var _0x21fa75;if(_0x40ecb8>=_0x134b79){_0x40ecb8=_0x134b79;_0x21fa75=0xc8;}else{_0x21fa75=0xce;}_0x3537a9[_0x9a67('0x12')](_0x21fa75);return _0x3537a9['set']('Content-Range',_0x3b8f2f+'-'+_0x40ecb8+'/'+_0x134b79)[_0x9a67('0x14')](_0x30d330);}return null;};}function saveUpdates(_0x388252){return function(_0x56a565){if(_0x56a565){return _0x56a565[_0x9a67('0x19')](_0x388252)['then'](function(_0x269b9b){return _0x269b9b;});}return null;};}function removeEntity(_0x1c7bf1){return function(_0xe70f96){if(_0xe70f96){return _0xe70f96['destroy']()[_0x9a67('0x1a')](function(){_0x1c7bf1[_0x9a67('0x12')](0xcc)[_0x9a67('0x13')]();});}};}function handleEntityNotFound(_0x144a5f){return function(_0x9ed7c7){if(!_0x9ed7c7){_0x144a5f[_0x9a67('0x11')](0x194);}return _0x9ed7c7;};}function handleError(_0x18dc25,_0x3b3afe){_0x3b3afe=_0x3b3afe||0x1f4;return function(_0xb10b1a){logger[_0x9a67('0x1b')](_0xb10b1a[_0x9a67('0x1c')]);if(_0xb10b1a[_0x9a67('0x1d')]){delete _0xb10b1a['name'];}_0x18dc25['status'](_0x3b3afe)['send'](_0xb10b1a);};}exports[_0x9a67('0x1e')]=function(_0x349891,_0x1b7dce){var _0x34be56={};var _0xc2335c=_[_0x9a67('0x1f')](db[_0x9a67('0x20')][_0x9a67('0x21')],function(_0x5c2e25){return{'name':_0x5c2e25[_0x9a67('0x22')],'type':_0x5c2e25[_0x9a67('0x23')][_0x9a67('0x24')]};});_0x34be56=qs[_0x9a67('0x25')](_0xc2335c,_0x349891);return interaction['findAll']('mail',_0x349891[_0x9a67('0x26')],_0x349891[_0x9a67('0x27')],_0x34be56,_0xc2335c)[_0x9a67('0x1a')](respondWithFilteredResult(_0x1b7dce,_0x34be56))[_0x9a67('0x28')](handleError(_0x1b7dce,null));};exports[_0x9a67('0x29')]=function(_0x41d9d6,_0x205c05){var _0x18bdcd={'raw':![],'where':{'id':_0x41d9d6[_0x9a67('0x2a')]['id']}},_0xef5541={};_0xef5541[_0x9a67('0x2b')]=_[_0x9a67('0x2c')](db[_0x9a67('0x20')]['rawAttributes']);_0xef5541[_0x9a67('0x26')]=_[_0x9a67('0x2c')](_0x41d9d6[_0x9a67('0x26')]);_0xef5541['filters']=_[_0x9a67('0x2d')](_0xef5541['model'],_0xef5541[_0x9a67('0x26')]);_0x18bdcd[_0x9a67('0x2e')]=_[_0x9a67('0x2d')](_0xef5541[_0x9a67('0x2b')],qs[_0x9a67('0x2f')](_0x41d9d6[_0x9a67('0x26')][_0x9a67('0x2f')]));_0x18bdcd[_0x9a67('0x2e')]=_0x18bdcd['attributes'][_0x9a67('0x30')]?_0x18bdcd['attributes']:_0xef5541[_0x9a67('0x2b')];if(_0x41d9d6[_0x9a67('0x26')]['includeAll']){_0x18bdcd[_0x9a67('0x31')]=[{'all':!![]}];}_0x18bdcd=_['merge']({},_0x18bdcd,_0x41d9d6[_0x9a67('0x32')]);return db['MailInteraction'][_0x9a67('0x33')](_0x18bdcd)[_0x9a67('0x1a')](handleEntityNotFound(_0x205c05,null))[_0x9a67('0x1a')](respondWithResult(_0x205c05,null))[_0x9a67('0x28')](handleError(_0x205c05,null));};exports[_0x9a67('0x34')]=function(_0x249430,_0x3ede30){return db[_0x9a67('0x20')][_0x9a67('0x34')](_0x249430[_0x9a67('0x35')],{})['then'](respondWithResult(_0x3ede30,0xc9))[_0x9a67('0x28')](handleError(_0x3ede30,null));};exports['update']=function(_0xca4dea,_0x251350){if(_0xca4dea['body']['id']){delete _0xca4dea['body']['id'];}return db[_0x9a67('0x20')]['find']({'where':{'id':_0xca4dea[_0x9a67('0x2a')]['id']}})['then'](handleEntityNotFound(_0x251350,null))[_0x9a67('0x1a')](saveUpdates(_0xca4dea[_0x9a67('0x35')],null))[_0x9a67('0x1a')](respondWithResult(_0x251350,null))['catch'](handleError(_0x251350,null));};exports[_0x9a67('0x36')]=function(_0x12a426,_0x5d699d){return db[_0x9a67('0x20')][_0x9a67('0x33')]({'where':{'id':_0x12a426['params']['id']}})[_0x9a67('0x1a')](handleEntityNotFound(_0x5d699d,null))[_0x9a67('0x1a')](removeEntity(_0x5d699d,null))[_0x9a67('0x28')](handleError(_0x5d699d,null));};exports[_0x9a67('0x37')]=function(_0x4ac7bb,_0x19d82f){return db[_0x9a67('0x20')][_0x9a67('0x37')]()[_0x9a67('0x1a')](respondWithResult(_0x19d82f,null))[_0x9a67('0x28')](handleError(_0x19d82f,null));};exports[_0x9a67('0x38')]=function(_0x38b679,_0x441eb3){return db[_0x9a67('0x39')][_0x9a67('0x33')]({'where':{'id':_0x38b679[_0x9a67('0x2a')]['id']}})[_0x9a67('0x1a')](handleEntityNotFound(_0x441eb3,null))['then'](function(_0x82a713){if(_0x82a713){return _0x82a713[_0x9a67('0x38')](_0x38b679[_0x9a67('0x35')][_0x9a67('0x3a')],_[_0x9a67('0x3b')](_0x38b679[_0x9a67('0x35')],['ids','id'])||{});}})[_0x9a67('0x1a')](respondWithResult(_0x441eb3,null))[_0x9a67('0x28')](handleError(_0x441eb3,null));};exports[_0x9a67('0x3c')]=function(_0x2ca3de,_0x223c60){var _0x6dbb7a={'raw':![],'where':{}};var _0x40e063={};var _0x1133de={'count':0x0,'rows':[]};return db[_0x9a67('0x20')][_0x9a67('0x3d')]({'where':{'id':_0x2ca3de['params']['id']}})[_0x9a67('0x1a')](handleEntityNotFound(_0x223c60,null))['then'](function(_0x49bb55){if(_0x49bb55){_0x40e063[_0x9a67('0x2b')]=_[_0x9a67('0x2c')](db[_0x9a67('0x39')][_0x9a67('0x21')]);_0x40e063['query']=_[_0x9a67('0x2c')](_0x2ca3de[_0x9a67('0x26')]);_0x40e063[_0x9a67('0x3e')]=_['intersection'](_0x40e063[_0x9a67('0x2b')],_0x40e063[_0x9a67('0x26')]);_0x6dbb7a[_0x9a67('0x2e')]=_['intersection'](_0x40e063[_0x9a67('0x2b')],qs['fields'](_0x2ca3de[_0x9a67('0x26')][_0x9a67('0x2f')]));_0x6dbb7a[_0x9a67('0x2e')]=_0x6dbb7a[_0x9a67('0x2e')][_0x9a67('0x30')]?_0x6dbb7a[_0x9a67('0x2e')]:_0x40e063[_0x9a67('0x2b')];if(!_0x2ca3de[_0x9a67('0x26')][_0x9a67('0x3f')](_0x9a67('0x40'))){_0x6dbb7a[_0x9a67('0x16')]=qs[_0x9a67('0x16')](_0x2ca3de[_0x9a67('0x26')]['limit']);_0x6dbb7a[_0x9a67('0x18')]=qs['offset'](_0x2ca3de[_0x9a67('0x26')][_0x9a67('0x18')]);}_0x6dbb7a['order']=qs[_0x9a67('0x41')](_0x2ca3de[_0x9a67('0x26')]['sort']);_0x6dbb7a[_0x9a67('0x42')]=qs['filters'](_['pick'](_0x2ca3de[_0x9a67('0x26')],_0x40e063['filters']));_0x6dbb7a[_0x9a67('0x42')][_0x9a67('0x43')]=_0x49bb55['id'];if(_0x2ca3de['query'][_0x9a67('0x44')]){_0x6dbb7a['where']=_[_0x9a67('0x45')](_0x6dbb7a['where'],{'$or':_[_0x9a67('0x1f')](_0x6dbb7a['attributes'],function(_0x393ff4){var _0x59baa3={};_0x59baa3[_0x393ff4]={'$like':'%'+_0x2ca3de[_0x9a67('0x26')][_0x9a67('0x44')]+'%'};return _0x59baa3;})});}if(_0x2ca3de[_0x9a67('0x26')][_0x9a67('0x46')]){var _0xf49791=_0x2ca3de[_0x9a67('0x26')][_0x9a67('0x46')][_0x9a67('0x47')](',');var _0x34a84a={};_0x34a84a[_0xf49791[0x0]]={'$gte':moment(_0xf49791[0x1])[_0x9a67('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x6dbb7a[_0x9a67('0x42')]=_['merge'](_0x6dbb7a[_0x9a67('0x42')],_0x34a84a);}_0x6dbb7a=_[_0x9a67('0x45')]({},_0x6dbb7a,_0x2ca3de['options']);return db[_0x9a67('0x39')][_0x9a67('0x17')]({'where':_0x6dbb7a[_0x9a67('0x42')]})[_0x9a67('0x1a')](function(_0x34184e){_0x1133de[_0x9a67('0x17')]=_0x34184e;if(_0x2ca3de[_0x9a67('0x26')][_0x9a67('0x49')]){_0x6dbb7a[_0x9a67('0x31')]=[{'all':!![]}];}return db['MailMessage'][_0x9a67('0x4a')](_0x6dbb7a);})[_0x9a67('0x1a')](function(_0x4564fa){if(_0x2ca3de['query']['inlineCss']===_0x9a67('0x4b')){for(var _0x5b57fe=0x0;_0x5b57fe<_0x4564fa[_0x9a67('0x30')];_0x5b57fe++){_0x4564fa[_0x5b57fe]['body']=juice(_0x4564fa[_0x5b57fe]['body']);}}_0x1133de[_0x9a67('0x4c')]=_0x4564fa;return _0x1133de;});}})[_0x9a67('0x1a')](respondWithFilteredResult(_0x223c60,_0x6dbb7a))[_0x9a67('0x28')](handleError(_0x223c60,null));};exports[_0x9a67('0x4d')]=function(_0x4e39d7,_0x8d4f19){return db['MailInteraction'][_0x9a67('0x33')]({'where':{'id':_0x4e39d7['params']['id']}})[_0x9a67('0x1a')](handleEntityNotFound(_0x8d4f19,null))['then'](function(_0x255324){if(_0x255324){return _0x255324[_0x9a67('0x4e')](_0x4e39d7[_0x9a67('0x35')][_0x9a67('0x3a')],_[_0x9a67('0x3b')](_0x4e39d7[_0x9a67('0x35')],[_0x9a67('0x3a'),'id'])||{})[_0x9a67('0x4f')](function(){return db[_0x9a67('0x50')][_0x9a67('0x4a')]({'attributes':['id',_0x9a67('0x1d'),_0x9a67('0x51')],'where':{'id':_0x4e39d7[_0x9a67('0x35')][_0x9a67('0x3a')]}});})[_0x9a67('0x1a')](function(_0x50a8c0){socket['emit']('mailInteractionTags:save',{'id':Number(_0x4e39d7[_0x9a67('0x2a')]['id']),'tags':_0x50a8c0||[]});return{'id':Number(_0x4e39d7[_0x9a67('0x2a')]['id']),'tags':_0x50a8c0||[]};});}})[_0x9a67('0x1a')](respondWithResult(_0x8d4f19,null))[_0x9a67('0x28')](handleError(_0x8d4f19,null));};exports[_0x9a67('0x52')]=function(_0x18e0cb,_0x28ee98){return db[_0x9a67('0x20')][_0x9a67('0x33')]({'where':{'id':_0x18e0cb[_0x9a67('0x2a')]['id']}})['then'](handleEntityNotFound(_0x28ee98,null))['then'](function(_0x2849ba){if(_0x2849ba){return _0x2849ba[_0x9a67('0x52')](_0x18e0cb[_0x9a67('0x26')][_0x9a67('0x3a')]);}})[_0x9a67('0x1a')](respondWithStatusCode(_0x28ee98,null))['catch'](handleError(_0x28ee98,null));};exports[_0x9a67('0x53')]=function(_0x13e5b4,_0x50e7a4){var _0x528bb0=moment()[_0x9a67('0x54')]()['toString']();var _0x14d64c=path[_0x9a67('0x55')](config[_0x9a67('0x56')],_0x9a67('0x57'),_0x9a67('0x58'),_0x9a67('0x59'));var _0x4c30a8=path[_0x9a67('0x55')](config['root'],_0x9a67('0x57'),_0x9a67('0x58'),_0x9a67('0x5a'));var _0x8e002b=path[_0x9a67('0x55')](_0x14d64c,_0x528bb0);var _0x56513f=util[_0x9a67('0x48')]('transcript-%d-%s.zip',_0x13e5b4[_0x9a67('0x2a')]['id'],_0x528bb0);var _0x168286=path[_0x9a67('0x55')](_0x14d64c,_0x56513f);var _0x12d899=[];if(_0x13e5b4[_0x9a67('0x26')][_0x9a67('0x5a')]){_0x12d899[_0x9a67('0x5b')]({'model':db[_0x9a67('0x5c')],'as':_0x9a67('0x5d'),'raw':!![]});}var _0x38bfa7=[{'model':db[_0x9a67('0x39')],'as':_0x9a67('0x5e'),'attributes':['id','body',_0x9a67('0x5f'),'to','cc',_0x9a67('0x60'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0x9a67('0x41')]('id'),'include':_0x12d899}];return db[_0x9a67('0x20')]['find']({'where':{'id':_0x13e5b4[_0x9a67('0x2a')]['id']},'include':_0x38bfa7})[_0x9a67('0x1a')](handleEntityNotFound(_0x50e7a4,null))[_0x9a67('0x1a')](function(_0x592bb8){if(_0x592bb8&&_0x592bb8[_0x9a67('0x5e')]){var _0x22b9ac=_0x592bb8[_0x9a67('0x61')]({'plain':!![]});fs['mkdirSync'](_0x8e002b);return BPromise[_0x9a67('0x62')](_0x22b9ac[_0x9a67('0x5e')],function(_0xb129b5,_0x20eb27){var _0x18af99={'from':_0xb129b5[_0x9a67('0x5f')],'to':_0xb129b5['to']||_0x9a67('0x63'),'subject':_0xb129b5[_0x9a67('0x64')],'html':htmlEntities[_0x9a67('0x65')](_0xb129b5[_0x9a67('0x35')]),'headers':{'Date':moment(_0xb129b5[_0x9a67('0x66')])['format'](_0x9a67('0x67'))},'attachments':[]};if(_0xb129b5['cc']){_0x18af99[_0x9a67('0x68')]['Cc']=_0xb129b5['cc'];}if(_0xb129b5[_0x9a67('0x60')]){_0x18af99[_0x9a67('0x68')][_0x9a67('0x69')]=_0xb129b5[_0x9a67('0x60')];}return new BPromise(function(_0x1b00cb,_0x219a9a){if(_0xb129b5[_0x9a67('0x5d')]){for(var _0x2361b9=0x0;_0x2361b9<_0xb129b5[_0x9a67('0x5d')][_0x9a67('0x30')];_0x2361b9++){var _0x1f507c=_0xb129b5[_0x9a67('0x5d')][_0x2361b9];var _0x10b1e4=path[_0x9a67('0x55')](_0x4c30a8,_0x1f507c[_0x9a67('0x6a')]);if(fs[_0x9a67('0x6b')](_0x10b1e4)){_0x18af99[_0x9a67('0x5a')][_0x9a67('0x5b')]({'name':_0x1f507c[_0x9a67('0x1d')],'contentType':_0x1f507c[_0x9a67('0x23')],'data':fs[_0x9a67('0x6c')](_0x10b1e4)});}}}emlformat['build'](_0x18af99,function(_0x58847,_0x910a8a){if(_0x58847)return _0x219a9a(_0x58847);fs[_0x9a67('0x6d')](path[_0x9a67('0x55')](_0x8e002b,util[_0x9a67('0x48')]('message%d.eml',_0x20eb27)),_0x910a8a);return _0x1b00cb(_0x910a8a);});});})[_0x9a67('0x1a')](function(){return new BPromise(function(_0x4d9ca3,_0x53622a){zipdir(_0x8e002b,{'saveTo':_0x168286},function(_0x479972,_0x4b619f){if(_0x479972)return _0x53622a(_0x479972);return _0x4d9ca3(_0x4b619f);});})[_0x9a67('0x1a')](function(){return new BPromise(function(_0x548336,_0x394205){rimraf(_0x8e002b,function(_0x53343a){if(_0x53343a)_0x394205(_0x53343a);return _0x548336();});});})[_0x9a67('0x1a')](function(){return _0x50e7a4[_0x9a67('0x53')](_0x168286,_0x56513f,function(_0x2eb7d0){if(!_0x2eb7d0)fs['unlinkSync'](_0x168286);});});});}else{return _0x50e7a4[_0x9a67('0x11')](0xc8);}})[_0x9a67('0x28')](handleError(_0x50e7a4,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index f00c9e6..2a47fa8 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 _0xc2cd=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0xc2cd,0xbc));var _0xdc2c=function(_0x21d21a,_0x46e269){_0x21d21a=_0x21d21a-0x0;var _0x52387d=_0xc2cd[_0x21d21a];return _0x52387d;};'use strict';var EventEmitter=require(_0xdc2c('0x0'));var MailInteraction=require(_0xdc2c('0x1'))['db'][_0xdc2c('0x2')];var MailMessage=require(_0xdc2c('0x1'))['db'][_0xdc2c('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdc2c('0x4'),'afterUpdate':_0xdc2c('0x5'),'afterDestroy':_0xdc2c('0x6')};function emitEvent(_0x456b69){return function(_0x3e6abf,_0x352aaa,_0x39f1d2){_0x3e6abf[_0xdc2c('0x7')]({'attributes':['id'],'raw':!![]})[_0xdc2c('0x8')](function(_0x52910c){_0x3e6abf[_0xdc2c('0x9')](_0xdc2c('0xa'),_0x52910c[_0xdc2c('0xb')](function(_0x59f17e){return{'id':_0x59f17e['id']};}));return MailMessage[_0xdc2c('0xc')]({'where':{'MailInteractionId':_0x3e6abf['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdc2c('0x8')](function(_0x537831){_0x3e6abf[_0xdc2c('0x9')](_0xdc2c('0xd'),_0x537831[_0xdc2c('0xe')]);MailInteractionEvents[_0xdc2c('0xf')](_0x456b69+':'+_0x3e6abf['id'],_0x3e6abf);MailInteractionEvents[_0xdc2c('0xf')](_0x456b69,_0x3e6abf);_0x39f1d2(null);})[_0xdc2c('0x10')](_0x39f1d2(null));};}for(var e in events){if(events[_0xdc2c('0x11')](e)){var event=events[e];MailInteraction[_0xdc2c('0x12')](e,emitEvent(event));}}module[_0xdc2c('0x13')]=MailInteractionEvents; \ No newline at end of file +var _0xb1ed=['setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then'];(function(_0x103294,_0x16eabd){var _0x45ecc5=function(_0x1024db){while(--_0x1024db){_0x103294['push'](_0x103294['shift']());}};_0x45ecc5(++_0x16eabd);}(_0xb1ed,0x75));var _0xdb1e=function(_0x1a2ed5,_0x255d82){_0x1a2ed5=_0x1a2ed5-0x0;var _0x5c9cc1=_0xb1ed[_0x1a2ed5];return _0x5c9cc1;};'use strict';var EventEmitter=require(_0xdb1e('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0xdb1e('0x1'))['db'][_0xdb1e('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xdb1e('0x3')](0x0);var events={'afterCreate':_0xdb1e('0x4'),'afterUpdate':_0xdb1e('0x5'),'afterDestroy':_0xdb1e('0x6')};function emitEvent(_0x54c6e2){return function(_0x48415b,_0x42eddf,_0x59fd1f){_0x48415b[_0xdb1e('0x7')]({'attributes':['id'],'raw':!![]})[_0xdb1e('0x8')](function(_0x76c07){_0x48415b[_0xdb1e('0x9')](_0xdb1e('0xa'),_0x76c07['map'](function(_0x232821){return{'id':_0x232821['id']};}));return MailMessage[_0xdb1e('0xb')]({'where':{'MailInteractionId':_0x48415b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x40f659){_0x48415b[_0xdb1e('0x9')](_0xdb1e('0xc'),_0x40f659[_0xdb1e('0xd')]);MailInteractionEvents[_0xdb1e('0xe')](_0x54c6e2+':'+_0x48415b['id'],_0x48415b);MailInteractionEvents[_0xdb1e('0xe')](_0x54c6e2,_0x48415b);_0x59fd1f(null);})['catch'](_0x59fd1f(null));};}for(var e in events){if(events[_0xdb1e('0xf')](e)){var event=events[e];MailInteraction[_0xdb1e('0x10')](e,emitEvent(event));}}module[_0xdb1e('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 1fcbd71..8bdcc3c 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 _0x40f1=['MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','substatus','changed','models','get','update','then','catch','utf8mb4','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','define'];(function(_0x536919,_0x2d0c68){var _0x3694d9=function(_0xf21223){while(--_0xf21223){_0x536919['push'](_0x536919['shift']());}};_0x3694d9(++_0x2d0c68);}(_0x40f1,0x19a));var _0x140f=function(_0x3eb98f,_0x21ff2c){_0x3eb98f=_0x3eb98f-0x0;var _0x203792=_0x40f1[_0x3eb98f];return _0x203792;};'use strict';var _=require(_0x140f('0x0'));var util=require('util');var logger=require(_0x140f('0x1'))(_0x140f('0x2'));var moment=require(_0x140f('0x3'));var BPromise=require(_0x140f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x140f('0x5'));var rimraf=require(_0x140f('0x6'));var config=require(_0x140f('0x7'));var attributes=require(_0x140f('0x8'));module['exports']=function(_0x565894,_0x27ef79){return _0x565894[_0x140f('0x9')](_0x140f('0xa'),attributes,{'tableName':_0x140f('0xb'),'paranoid':![],'indexes':[{'name':_0x140f('0xc'),'fields':[_0x140f('0xd'),'to'],'type':_0x140f('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1a81ff,_0x2b9210,_0x40b5d7){if(_0x1a81ff['substatus']){_0x1a81ff[_0x140f('0xf')]=moment()[_0x140f('0x10')](_0x140f('0x11'));}if(_0x1a81ff[_0x140f('0x12')]){_0x1a81ff[_0x140f('0x13')]=moment()[_0x140f('0x10')](_0x140f('0x11'));}_0x40b5d7(null,_0x2b9210);},'beforeUpdate':function(_0xe2daaa,_0x1877a,_0x22444e){if(_0xe2daaa['changed'](_0x140f('0x14'))){_0xe2daaa['substatusAt']=_0xe2daaa[_0x140f('0x14')]?moment()[_0x140f('0x10')](_0x140f('0x11')):null;}if(_0xe2daaa[_0x140f('0x15')](_0x140f('0x12'))){_0xe2daaa[_0x140f('0x13')]=moment()[_0x140f('0x10')](_0x140f('0x11'));_0xe2daaa[_0x140f('0x14')]=null;_0xe2daaa['substatusAt']=null;}_0x22444e(null,_0xe2daaa);},'afterUpdate':function(_0x45bc9f,_0x58c190,_0x49900e){var _0x2b9b8c=_0x565894[_0x140f('0x16')];var _0x157d5c=_0x45bc9f[_0x140f('0x17')]({'plain':!![]});if(_0x157d5c[_0x140f('0x12')]){return _0x2b9b8c['MailMessage'][_0x140f('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x157d5c['id']}})[_0x140f('0x19')](function(){_0x49900e();})[_0x140f('0x1a')](function(_0x1a800c){_0x49900e(_0x1a800c);});}else{_0x49900e();}}},'charset':_0x140f('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4da4=['../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','closed','closedAt','changed','YYYY-MM-DD\x20HH:mm:ss','models','get','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x43c2de,_0x42e7d9){var _0xcab02a=function(_0xdc21f3){while(--_0xdc21f3){_0x43c2de['push'](_0x43c2de['shift']());}};_0xcab02a(++_0x42e7d9);}(_0x4da4,0x18f));var _0x44da=function(_0x58675f,_0x390355){_0x58675f=_0x58675f-0x0;var _0x1cc7f0=_0x4da4[_0x58675f];return _0x1cc7f0;};'use strict';var _=require(_0x44da('0x0'));var util=require(_0x44da('0x1'));var logger=require(_0x44da('0x2'))('api');var moment=require(_0x44da('0x3'));var BPromise=require(_0x44da('0x4'));var rp=require(_0x44da('0x5'));var fs=require('fs');var path=require(_0x44da('0x6'));var rimraf=require('rimraf');var config=require(_0x44da('0x7'));var attributes=require(_0x44da('0x8'));module[_0x44da('0x9')]=function(_0x3cbf08,_0x15595f){return _0x3cbf08[_0x44da('0xa')](_0x44da('0xb'),attributes,{'tableName':_0x44da('0xc'),'paranoid':![],'indexes':[{'name':_0x44da('0xd'),'fields':[_0x44da('0xe'),'to'],'type':_0x44da('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x691a08,_0x41760f,_0x5de8dc){if(_0x691a08[_0x44da('0x10')]){_0x691a08[_0x44da('0x11')]=moment()[_0x44da('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x691a08[_0x44da('0x13')]){_0x691a08[_0x44da('0x14')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5de8dc(null,_0x41760f);},'beforeUpdate':function(_0x42199c,_0x1bd0f8,_0x2b291f){if(_0x42199c[_0x44da('0x15')](_0x44da('0x10'))){_0x42199c[_0x44da('0x11')]=_0x42199c[_0x44da('0x10')]?moment()[_0x44da('0x12')](_0x44da('0x16')):null;}if(_0x42199c[_0x44da('0x15')](_0x44da('0x13'))){_0x42199c[_0x44da('0x14')]=moment()[_0x44da('0x12')](_0x44da('0x16'));_0x42199c['substatus']=null;_0x42199c[_0x44da('0x11')]=null;}_0x2b291f(null,_0x42199c);},'afterUpdate':function(_0x3a3812,_0x5ff4b5,_0x1d3475){var _0x3c75a2=_0x3cbf08[_0x44da('0x17')];var _0x9aa85e=_0x3a3812[_0x44da('0x18')]({'plain':!![]});if(_0x9aa85e[_0x44da('0x13')]){return _0x3c75a2['MailMessage'][_0x44da('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x9aa85e['id']}})[_0x44da('0x1a')](function(){_0x1d3475();})['catch'](function(_0x406bf2){_0x1d3475(_0x406bf2);});}else{_0x1d3475();}}},'charset':_0x44da('0x1b'),'collate':_0x44da('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index b869d84..a0a5b7b 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 _0x5707=['stringify','AddTagsToMailInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes'];(function(_0x12a43d,_0x25e8c0){var _0x5b74c1=function(_0x5b417a){while(--_0x5b417a){_0x12a43d['push'](_0x12a43d['shift']());}};_0x5b74c1(++_0x25e8c0);}(_0x5707,0x134));var _0x7570=function(_0x1e73fc,_0x533750){_0x1e73fc=_0x1e73fc-0x0;var _0xeceac4=_0x5707[_0x1e73fc];return _0xeceac4;};'use strict';var _=require(_0x7570('0x0'));var util=require(_0x7570('0x1'));var moment=require(_0x7570('0x2'));var BPromise=require(_0x7570('0x3'));var rs=require(_0x7570('0x4'));var fs=require('fs');var Redis=require(_0x7570('0x5'));var db=require(_0x7570('0x6'))['db'];var utils=require(_0x7570('0x7'));var logger=require(_0x7570('0x8'))(_0x7570('0x9'));var config=require(_0x7570('0xa'));var jayson=require(_0x7570('0xb'));var client=jayson[_0x7570('0xc')][_0x7570('0xd')]({'port':0x232a});config[_0x7570('0xe')]=_[_0x7570('0xf')](config[_0x7570('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7570('0xe')]));require(_0x7570('0x10'))[_0x7570('0x11')](socket);function respondWithRpcPromise(_0x1282a3,_0x16937f,_0x5d75bb){return new BPromise(function(_0x1dc826,_0x4a5676){return client['request'](_0x1282a3,_0x5d75bb)[_0x7570('0x12')](function(_0x2366dc){logger[_0x7570('0x13')](_0x7570('0x14'),_0x16937f,_0x7570('0x15'));logger[_0x7570('0x16')](_0x7570('0x17'),_0x16937f,_0x7570('0x15'),JSON['stringify'](_0x2366dc));if(_0x2366dc['error']){if(_0x2366dc[_0x7570('0x18')]['code']===0x1f4){logger[_0x7570('0x18')](_0x7570('0x14'),_0x16937f,_0x2366dc[_0x7570('0x18')]['message']);return _0x4a5676(_0x2366dc[_0x7570('0x18')][_0x7570('0x19')]);}logger[_0x7570('0x18')]('MailInteraction,\x20%s,\x20%s',_0x16937f,_0x2366dc['error']['message']);return _0x1dc826(_0x2366dc[_0x7570('0x18')][_0x7570('0x19')]);}else{logger[_0x7570('0x13')]('MailInteraction,\x20%s,\x20%s',_0x16937f,_0x7570('0x15'));_0x1dc826(_0x2366dc[_0x7570('0x1a')]['message']);}})[_0x7570('0x1b')](function(_0x323a52){logger[_0x7570('0x18')]('MailInteraction,\x20%s,\x20%s',_0x16937f,_0x323a52);_0x4a5676(_0x323a52);});});}exports[_0x7570('0x1c')]=function(_0x25fc1b){var _0x37e955=this;return new Promise(function(_0x204cf4,_0x4b8e82){return db[_0x7570('0x1d')][_0x7570('0x1e')](_0x25fc1b[_0x7570('0x1f')],{'raw':_0x25fc1b[_0x7570('0x20')]?_0x25fc1b[_0x7570('0x20')][_0x7570('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25fc1b[_0x7570('0x20')]?_0x25fc1b[_0x7570('0x20')][_0x7570('0x22')]||null:null,'attributes':_0x25fc1b[_0x7570('0x20')]?_0x25fc1b[_0x7570('0x20')][_0x7570('0x23')]||null:null,'limit':_0x25fc1b['options']?_0x25fc1b[_0x7570('0x20')]['limit']||null:null})[_0x7570('0x12')](function(_0x91eb37){logger[_0x7570('0x13')](_0x7570('0x1c'),_0x25fc1b);logger[_0x7570('0x16')](_0x7570('0x1c'),_0x25fc1b,JSON[_0x7570('0x24')](_0x91eb37));_0x204cf4(_0x91eb37);})[_0x7570('0x1b')](function(_0xca040d){logger['error'](_0x7570('0x1c'),_0xca040d['message'],_0x25fc1b);_0x4b8e82(_0x37e955[_0x7570('0x18')](0x1f4,_0xca040d[_0x7570('0x19')]));});});};exports[_0x7570('0x25')]=function(_0x4e49a1){return new Promise(function(_0x40d420,_0x592d2a){return db['MailInteraction'][_0x7570('0x26')]({'where':_0x4e49a1[_0x7570('0x20')]?_0x4e49a1[_0x7570('0x20')][_0x7570('0x22')]||null:null})[_0x7570('0x12')](function(_0x2d55e1){if(_0x2d55e1){return _0x2d55e1[_0x7570('0x27')](_0x4e49a1[_0x7570('0x1f')][_0x7570('0x28')],_[_0x7570('0x29')](_0x4e49a1[_0x7570('0x1f')],[_0x7570('0x28'),'id'])||{});}})['spread'](function(_0x31cbd4){logger['info']('AddTags',_0x4e49a1);logger[_0x7570('0x16')](_0x7570('0x2a'),_0x4e49a1,JSON[_0x7570('0x24')](_0x31cbd4));_0x40d420(_0x31cbd4);})['catch'](function(_0x140d02){logger[_0x7570('0x18')](_0x7570('0x2a'),_0x140d02[_0x7570('0x19')],_0x4e49a1);_0x592d2a(_this['error'](0x1f4,_0x140d02['message']));});});}; \ No newline at end of file +var _0xc7bd=['redis','localhost','socket.io-emitter','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','UpdateMailInteraction','options','where','limit','AddTagsToMailInteraction','MailInteraction','find','addTags','body','ids','spread','AddTags','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3b340e,_0x377f61){var _0x688944=function(_0x4201a2){while(--_0x4201a2){_0x3b340e['push'](_0x3b340e['shift']());}};_0x688944(++_0x377f61);}(_0xc7bd,0x86));var _0xdc7b=function(_0x5f70ee,_0x6ef5fd){_0x5f70ee=_0x5f70ee-0x0;var _0x3d3b88=_0xc7bd[_0x5f70ee];return _0x3d3b88;};'use strict';var _=require('lodash');var util=require(_0xdc7b('0x0'));var moment=require(_0xdc7b('0x1'));var BPromise=require('bluebird');var rs=require(_0xdc7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdc7b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc7b('0x4'))(_0xdc7b('0x5'));var config=require(_0xdc7b('0x6'));var jayson=require(_0xdc7b('0x7'));var client=jayson[_0xdc7b('0x8')][_0xdc7b('0x9')]({'port':0x232a});config[_0xdc7b('0xa')]=_['defaults'](config[_0xdc7b('0xa')],{'host':_0xdc7b('0xb'),'port':0x18eb});var socket=require(_0xdc7b('0xc'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0xdc7b('0xd')](socket);function respondWithRpcPromise(_0x316a19,_0x167e40,_0x295800){return new BPromise(function(_0xec8041,_0x44d499){return client['request'](_0x316a19,_0x295800)[_0xdc7b('0xe')](function(_0x359a53){logger[_0xdc7b('0xf')](_0xdc7b('0x10'),_0x167e40,_0xdc7b('0x11'));logger[_0xdc7b('0x12')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x167e40,_0xdc7b('0x11'),JSON[_0xdc7b('0x13')](_0x359a53));if(_0x359a53['error']){if(_0x359a53[_0xdc7b('0x14')]['code']===0x1f4){logger[_0xdc7b('0x14')](_0xdc7b('0x10'),_0x167e40,_0x359a53[_0xdc7b('0x14')][_0xdc7b('0x15')]);return _0x44d499(_0x359a53['error'][_0xdc7b('0x15')]);}logger[_0xdc7b('0x14')]('MailInteraction,\x20%s,\x20%s',_0x167e40,_0x359a53[_0xdc7b('0x14')][_0xdc7b('0x15')]);return _0xec8041(_0x359a53[_0xdc7b('0x14')][_0xdc7b('0x15')]);}else{logger[_0xdc7b('0xf')](_0xdc7b('0x10'),_0x167e40,_0xdc7b('0x11'));_0xec8041(_0x359a53[_0xdc7b('0x16')]['message']);}})[_0xdc7b('0x17')](function(_0x54a99b){logger[_0xdc7b('0x14')]('MailInteraction,\x20%s,\x20%s',_0x167e40,_0x54a99b);_0x44d499(_0x54a99b);});});}exports[_0xdc7b('0x18')]=function(_0x435c3a){var _0x3e8420=this;return new Promise(function(_0x372728,_0x1f516d){return db['MailInteraction']['update'](_0x435c3a['body'],{'raw':_0x435c3a[_0xdc7b('0x19')]?_0x435c3a[_0xdc7b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x435c3a[_0xdc7b('0x19')]?_0x435c3a[_0xdc7b('0x19')][_0xdc7b('0x1a')]||null:null,'attributes':_0x435c3a['options']?_0x435c3a[_0xdc7b('0x19')]['attributes']||null:null,'limit':_0x435c3a[_0xdc7b('0x19')]?_0x435c3a[_0xdc7b('0x19')][_0xdc7b('0x1b')]||null:null})[_0xdc7b('0xe')](function(_0x1ce512){logger[_0xdc7b('0xf')](_0xdc7b('0x18'),_0x435c3a);logger[_0xdc7b('0x12')](_0xdc7b('0x18'),_0x435c3a,JSON['stringify'](_0x1ce512));_0x372728(_0x1ce512);})[_0xdc7b('0x17')](function(_0x48189d){logger[_0xdc7b('0x14')](_0xdc7b('0x18'),_0x48189d['message'],_0x435c3a);_0x1f516d(_0x3e8420[_0xdc7b('0x14')](0x1f4,_0x48189d['message']));});});};exports[_0xdc7b('0x1c')]=function(_0x2c5ec8){return new Promise(function(_0x16f9b0,_0x5bbe04){return db[_0xdc7b('0x1d')][_0xdc7b('0x1e')]({'where':_0x2c5ec8[_0xdc7b('0x19')]?_0x2c5ec8[_0xdc7b('0x19')][_0xdc7b('0x1a')]||null:null})['then'](function(_0x3d3751){if(_0x3d3751){return _0x3d3751[_0xdc7b('0x1f')](_0x2c5ec8[_0xdc7b('0x20')][_0xdc7b('0x21')],_['omit'](_0x2c5ec8[_0xdc7b('0x20')],[_0xdc7b('0x21'),'id'])||{});}})[_0xdc7b('0x22')](function(_0x1d5405){logger['info'](_0xdc7b('0x23'),_0x2c5ec8);logger[_0xdc7b('0x12')](_0xdc7b('0x23'),_0x2c5ec8,JSON[_0xdc7b('0x13')](_0x1d5405));_0x16f9b0(_0x1d5405);})[_0xdc7b('0x17')](function(_0x571e32){logger[_0xdc7b('0x14')]('AddTags',_0x571e32[_0xdc7b('0x15')],_0x2c5ec8);_0x5bbe04(_this[_0xdc7b('0x14')](0x1f4,_0x571e32[_0xdc7b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index fb6c100..3d5f0b8 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 _0x694a=['removeListener','register','length','./mailInteraction.events','remove'];(function(_0x277af0,_0x1f0361){var _0x43bd7c=function(_0x3ad480){while(--_0x3ad480){_0x277af0['push'](_0x277af0['shift']());}};_0x43bd7c(++_0x1f0361);}(_0x694a,0x13e));var _0xa694=function(_0x400001,_0x4b768f){_0x400001=_0x400001-0x0;var _0x343fbe=_0x694a[_0x400001];return _0x343fbe;};'use strict';var MailInteractionEvents=require(_0xa694('0x0'));var events=['save',_0xa694('0x1'),'update'];function createListener(_0x177d78,_0x447a10){return function(_0x5ea5ab){_0x447a10['emit'](_0x177d78,_0x5ea5ab);};}function removeListener(_0x5df5a2,_0x3a83cd){return function(){MailInteractionEvents[_0xa694('0x2')](_0x5df5a2,_0x3a83cd);};}exports[_0xa694('0x3')]=function(_0x9d8cb1){for(var _0x2129c4=0x0,_0xf01c82=events[_0xa694('0x4')];_0x2129c4<_0xf01c82;_0x2129c4++){var _0xdf5e50=events[_0x2129c4];var _0x49c183=createListener('mailInteraction:'+_0xdf5e50,_0x9d8cb1);MailInteractionEvents['on'](_0xdf5e50,_0x49c183);}}; \ No newline at end of file +var _0x74cb=['update','removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x2685a7,_0x450764){var _0x443d29=function(_0x5e41e7){while(--_0x5e41e7){_0x2685a7['push'](_0x2685a7['shift']());}};_0x443d29(++_0x450764);}(_0x74cb,0xbd));var _0xb74c=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x74cb[_0xc6be3a];return _0x56a310;};'use strict';var MailInteractionEvents=require(_0xb74c('0x0'));var events=[_0xb74c('0x1'),_0xb74c('0x2'),_0xb74c('0x3')];function createListener(_0x252d4a,_0x130f8f){return function(_0x292541){_0x130f8f['emit'](_0x252d4a,_0x292541);};}function removeListener(_0x51871f,_0x5bef25){return function(){MailInteractionEvents[_0xb74c('0x4')](_0x51871f,_0x5bef25);};}exports[_0xb74c('0x5')]=function(_0x2de920){for(var _0x4a7f77=0x0,_0x5926cf=events[_0xb74c('0x6')];_0x4a7f77<_0x5926cf;_0x4a7f77++){var _0x28c6b6=events[_0x4a7f77];var _0x5ad435=createListener(_0xb74c('0x7')+_0x28c6b6,_0x2de920);MailInteractionEvents['on'](_0x28c6b6,_0x5ad435);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index e5bfd68..6c8f346 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 _0x2128=['put','update','/:id/accept','accept','reject','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','tracked','mail','mailmessage:create','create'];(function(_0x2f2962,_0x358e66){var _0x47b7eb=function(_0x426a57){while(--_0x426a57){_0x2f2962['push'](_0x2f2962['shift']());}};_0x47b7eb(++_0x358e66);}(_0x2128,0x1c9));var _0x8212=function(_0x5c1c68,_0x4e17ed){_0x5c1c68=_0x5c1c68-0x0;var _0x33d4e0=_0x2128[_0x5c1c68];return _0x33d4e0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8212('0x0'));var express=require(_0x8212('0x1'));var router=express['Router']();var fs_extra=require(_0x8212('0x2'));var auth=require(_0x8212('0x3'));var interaction=require(_0x8212('0x4'));var config=require(_0x8212('0x5'));var controller=require('./mailMessage.controller');router[_0x8212('0x6')]('/',auth[_0x8212('0x7')](),controller['index']);router[_0x8212('0x6')](_0x8212('0x8'),auth[_0x8212('0x7')](),controller[_0x8212('0x9')]);router[_0x8212('0x6')](_0x8212('0xa'),auth[_0x8212('0x7')](),controller[_0x8212('0xb')]);router[_0x8212('0x6')](_0x8212('0xc'),auth[_0x8212('0x7')](),controller[_0x8212('0xd')]);router['post']('/',auth[_0x8212('0x7')](),interaction[_0x8212('0xe')](_0x8212('0xf'),_0x8212('0x10')),controller[_0x8212('0x11')]);router[_0x8212('0x12')]('/:id',auth[_0x8212('0x7')](),controller[_0x8212('0x13')]);router['put'](_0x8212('0x14'),auth[_0x8212('0x7')](),controller[_0x8212('0x15')]);router[_0x8212('0x12')]('/:id/reject',auth['isAuthenticated'](),controller[_0x8212('0x16')]);router['delete'](_0x8212('0xa'),auth[_0x8212('0x7')](),controller[_0x8212('0x17')]);module[_0x8212('0x18')]=router; \ No newline at end of file +var _0xaaff=['index','/describe','describe','/:id','show','download','post','tracked','mail','mailmessage:create','update','put','accept','/:id/reject','reject','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./mailMessage.controller','get','isAuthenticated'];(function(_0x40f33d,_0x4cb5a5){var _0x3d43ee=function(_0x3cf082){while(--_0x3cf082){_0x40f33d['push'](_0x40f33d['shift']());}};_0x3d43ee(++_0x4cb5a5);}(_0xaaff,0xad));var _0xfaaf=function(_0x314972,_0x557a0d){_0x314972=_0x314972-0x0;var _0x1dd1d6=_0xaaff[_0x314972];return _0x1dd1d6;};'use strict';var multer=require('multer');var util=require(_0xfaaf('0x0'));var path=require(_0xfaaf('0x1'));var timeout=require(_0xfaaf('0x2'));var express=require(_0xfaaf('0x3'));var router=express['Router']();var fs_extra=require(_0xfaaf('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfaaf('0x5'));var controller=require(_0xfaaf('0x6'));router[_0xfaaf('0x7')]('/',auth[_0xfaaf('0x8')](),controller[_0xfaaf('0x9')]);router[_0xfaaf('0x7')](_0xfaaf('0xa'),auth[_0xfaaf('0x8')](),controller[_0xfaaf('0xb')]);router[_0xfaaf('0x7')](_0xfaaf('0xc'),auth[_0xfaaf('0x8')](),controller[_0xfaaf('0xd')]);router['get']('/:id/download',auth[_0xfaaf('0x8')](),controller[_0xfaaf('0xe')]);router[_0xfaaf('0xf')]('/',auth[_0xfaaf('0x8')](),interaction[_0xfaaf('0x10')](_0xfaaf('0x11'),_0xfaaf('0x12')),controller['create']);router['put'](_0xfaaf('0xc'),auth[_0xfaaf('0x8')](),controller[_0xfaaf('0x13')]);router[_0xfaaf('0x14')]('/:id/accept',auth[_0xfaaf('0x8')](),controller[_0xfaaf('0x15')]);router[_0xfaaf('0x14')](_0xfaaf('0x16'),auth[_0xfaaf('0x8')](),controller[_0xfaaf('0x17')]);router['delete'](_0xfaaf('0xc'),auth[_0xfaaf('0x8')](),controller[_0xfaaf('0x18')]);module[_0xfaaf('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 2849504..900cd5c 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 _0xc935=['out','STRING','TEXT','DATE','INTEGER','Email','Chat','exports','long','medium','ENUM'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0xc935,0x19e));var _0x5c93=function(_0x348503,_0x1be852){_0x348503=_0x348503-0x0;var _0x21e535=_0xc935[_0x348503];return _0x21e535;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x5c93('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5c93('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x5c93('0x2'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5c93('0x3')]('in',_0x5c93('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x5c93('0x5')]},'to':{'type':Sequelize[_0x5c93('0x6')](_0x5c93('0x1'))},'cc':{'type':Sequelize['TEXT'](_0x5c93('0x1'))},'bcc':{'type':Sequelize[_0x5c93('0x6')](_0x5c93('0x1'))},'subject':{'type':Sequelize[_0x5c93('0x6')]},'sentAt':{'type':Sequelize[_0x5c93('0x7')]},'attach':{'type':Sequelize[_0x5c93('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x5c93('0x7')]},'originTo':{'type':Sequelize[_0x5c93('0x6')](_0x5c93('0x1'))},'originCc':{'type':Sequelize[_0x5c93('0x6')](_0x5c93('0x1'))},'originChannel':{'type':Sequelize['ENUM'](_0x5c93('0x9'),_0x5c93('0xa')),'defaultValue':_0x5c93('0x9'),'allowNull':![]}}; \ No newline at end of file +var _0xa8b0=['lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','Email','sequelize'];(function(_0xa83c0d,_0x4d412b){var _0x991232=function(_0x477f6a){while(--_0x477f6a){_0xa83c0d['push'](_0xa83c0d['shift']());}};_0x991232(++_0x4d412b);}(_0xa8b0,0x1c7));var _0x0a8b=function(_0xf93076,_0x1acb30){_0xf93076=_0xf93076-0x0;var _0x33d1da=_0xa8b0[_0xf93076];return _0x33d1da;};'use strict';var Sequelize=require(_0x0a8b('0x0'));var _=require(_0x0a8b('0x1'));module[_0x0a8b('0x2')]={'body':{'type':Sequelize[_0x0a8b('0x3')](_0x0a8b('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x0a8b('0x5'))},'read':{'type':Sequelize[_0x0a8b('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0a8b('0x7')]('in',_0x0a8b('0x8')),'defaultValue':_0x0a8b('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0a8b('0x9')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0x0a8b('0x4'))},'cc':{'type':Sequelize[_0x0a8b('0x3')](_0x0a8b('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0x0a8b('0x4'))},'subject':{'type':Sequelize[_0x0a8b('0x3')]},'sentAt':{'type':Sequelize[_0x0a8b('0xa')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x0a8b('0xa')]},'originTo':{'type':Sequelize[_0x0a8b('0x3')](_0x0a8b('0x4'))},'originCc':{'type':Sequelize['TEXT'](_0x0a8b('0x4'))},'originChannel':{'type':Sequelize[_0x0a8b('0x7')](_0x0a8b('0xb'),'Chat'),'defaultValue':_0x0a8b('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 bed6a7f..53b6121 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 _0xd147=['count','status','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','body','describe','create','direction','out','secret','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','CmContact','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','UserId','user','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','agent','email','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','mail','RejectMessage','rejectMessage','sequelize','QueryTypes','fullname','download','unix','toString','server','files','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','decode','headers','Bcc','existsSync','readFileSync','build','writeFileSync','moment','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','catch','json','offset','undefined','limit'];(function(_0x4edc08,_0x2febb6){var _0x75be67=function(_0x577029){while(--_0x577029){_0x4edc08['push'](_0x4edc08['shift']());}};_0x75be67(++_0x2febb6);}(_0xd147,0x1c2));var _0x7d14=function(_0x2576a,_0x21b836){_0x2576a=_0x2576a-0x0;var _0x20acdc=_0xd147[_0x2576a];return _0x20acdc;};'use strict';var emlformat=require('eml-format');var moment=require(_0x7d14('0x0'));var BPromise=require('bluebird');var util=require(_0x7d14('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x7d14('0x2'));var Redis=require(_0x7d14('0x3'));var htmlToText=require(_0x7d14('0x4'));var qs=require(_0x7d14('0x5'));var logger=require(_0x7d14('0x6'))(_0x7d14('0x7'));var interaction_log=require(_0x7d14('0x6'))(_0x7d14('0x8'));var config=require(_0x7d14('0x9'));var db=require(_0x7d14('0xa'))['db'];config[_0x7d14('0xb')]=_[_0x7d14('0xc')](config[_0x7d14('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7d14('0xd'))(new Redis(config[_0x7d14('0xb')]));var htmlEntities=require(_0x7d14('0xe'));require(_0x7d14('0xf'))[_0x7d14('0x10')](socket);var jayson=require(_0x7d14('0x11'));var client=jayson[_0x7d14('0x12')][_0x7d14('0x13')]({'port':0x232c});var client9003=jayson['client'][_0x7d14('0x13')]({'port':0x232b});var client9002=jayson[_0x7d14('0x12')][_0x7d14('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x5e4f1f,_0x5b790b,_0x5f1484,_0x270f1d){return new BPromise(function(_0x48131b,_0x1eafe2){var _0xee648c=_0x270f1d||client;return _0xee648c[_0x7d14('0x14')](_0x5e4f1f,_0x5f1484)[_0x7d14('0x15')](function(_0x5d15c0){logger['info'](_0x7d14('0x16'),_0x5b790b,_0x7d14('0x17'));logger[_0x7d14('0x18')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x5b790b,_0x7d14('0x17'),JSON[_0x7d14('0x19')](_0x5d15c0));if(_0x5d15c0['error']){if(_0x5d15c0['error'][_0x7d14('0x1a')]===0x1f4){logger[_0x7d14('0x1b')](_0x7d14('0x16'),_0x5b790b,_0x5d15c0[_0x7d14('0x1b')][_0x7d14('0x1c')]);return _0x1eafe2(_0x5d15c0[_0x7d14('0x1b')][_0x7d14('0x1c')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x5b790b,_0x5d15c0[_0x7d14('0x1b')][_0x7d14('0x1c')]);return _0x48131b(_0x5d15c0['error'][_0x7d14('0x1c')]);}else{logger[_0x7d14('0x1d')](_0x7d14('0x16'),_0x5b790b,_0x7d14('0x17'));_0x48131b(_0x5d15c0[_0x7d14('0x1e')][_0x7d14('0x1c')]);}})[_0x7d14('0x1f')](function(_0x14fdda){logger[_0x7d14('0x1b')](_0x7d14('0x16'),_0x5b790b,_0x14fdda);_0x1eafe2(_0x14fdda);});});}function respondWithResult(_0x16c831,_0x119ef1){_0x119ef1=_0x119ef1||0xc8;return function(_0x3d3253){if(_0x3d3253){return _0x16c831['status'](_0x119ef1)[_0x7d14('0x20')](_0x3d3253);}};}function respondWithFilteredResult(_0x3f76a8,_0x93c53f){return function(_0x43918d){if(_0x43918d){var _0x11748a=typeof _0x93c53f[_0x7d14('0x21')]===_0x7d14('0x22')&&typeof _0x93c53f[_0x7d14('0x23')]===_0x7d14('0x22');var _0xbf54ea=_0x43918d[_0x7d14('0x24')];var _0x24cdeb=_0x11748a?0x0:_0x93c53f[_0x7d14('0x21')];var _0x2de166=_0x11748a?_0x43918d['count']:_0x93c53f[_0x7d14('0x21')]+_0x93c53f[_0x7d14('0x23')];var _0x74158c;if(_0x2de166>=_0xbf54ea){_0x2de166=_0xbf54ea;_0x74158c=0xc8;}else{_0x74158c=0xce;}_0x3f76a8[_0x7d14('0x25')](_0x74158c);return _0x3f76a8['set'](_0x7d14('0x26'),_0x24cdeb+'-'+_0x2de166+'/'+_0xbf54ea)[_0x7d14('0x20')](_0x43918d);}return null;};}function saveUpdates(_0x5299f3){return function(_0x3a1671){if(_0x3a1671){return _0x3a1671[_0x7d14('0x27')](_0x5299f3)[_0x7d14('0x15')](function(_0x574509){return _0x574509;});}return null;};}function removeEntity(_0x2fe03c){return function(_0x50ddc){if(_0x50ddc){return _0x50ddc[_0x7d14('0x28')]()[_0x7d14('0x15')](function(){_0x2fe03c['status'](0xcc)[_0x7d14('0x29')]();});}};}function handleEntityNotFound(_0x27ac83){return function(_0x108881){if(!_0x108881){_0x27ac83[_0x7d14('0x2a')](0x194);}return _0x108881;};}function handleError(_0x391962,_0xac2f30){_0xac2f30=_0xac2f30||0x1f4;return function(_0x5d8049){logger[_0x7d14('0x1b')](_0x5d8049[_0x7d14('0x2b')]);if(_0x5d8049['name']){delete _0x5d8049[_0x7d14('0x2c')];}_0x391962[_0x7d14('0x25')](_0xac2f30)[_0x7d14('0x2d')](_0x5d8049);};}exports[_0x7d14('0x2e')]=function(_0x397c7a,_0x1105f2){var _0x3a7b1b={},_0x7dfbe2={},_0x5a155d={'count':0x0,'rows':[]};var _0x1d6cb1=_[_0x7d14('0x2f')](db[_0x7d14('0x30')][_0x7d14('0x31')],function(_0x41203a){return{'name':_0x41203a[_0x7d14('0x32')],'type':_0x41203a[_0x7d14('0x33')]['key']};});_0x7dfbe2[_0x7d14('0x34')]=_[_0x7d14('0x2f')](_0x1d6cb1,_0x7d14('0x2c'));_0x7dfbe2[_0x7d14('0x35')]=_[_0x7d14('0x36')](_0x397c7a[_0x7d14('0x35')]);_0x7dfbe2[_0x7d14('0x37')]=_[_0x7d14('0x38')](_0x7dfbe2[_0x7d14('0x34')],_0x7dfbe2[_0x7d14('0x35')]);_0x3a7b1b[_0x7d14('0x39')]=_['intersection'](_0x7dfbe2[_0x7d14('0x34')],qs[_0x7d14('0x3a')](_0x397c7a[_0x7d14('0x35')][_0x7d14('0x3a')]));_0x3a7b1b['attributes']=_0x3a7b1b['attributes'][_0x7d14('0x3b')]?_0x3a7b1b[_0x7d14('0x39')]:_0x7dfbe2[_0x7d14('0x34')];if(!_0x397c7a[_0x7d14('0x35')][_0x7d14('0x3c')](_0x7d14('0x3d'))){_0x3a7b1b['limit']=qs[_0x7d14('0x23')](_0x397c7a[_0x7d14('0x35')][_0x7d14('0x23')]);_0x3a7b1b['offset']=qs[_0x7d14('0x21')](_0x397c7a[_0x7d14('0x35')]['offset']);}_0x3a7b1b['order']=qs['sort'](_0x397c7a[_0x7d14('0x35')][_0x7d14('0x3e')]);_0x3a7b1b[_0x7d14('0x3f')]=qs['filters'](_[_0x7d14('0x40')](_0x397c7a[_0x7d14('0x35')],_0x7dfbe2[_0x7d14('0x37')]),_0x1d6cb1);if(_0x397c7a['query'][_0x7d14('0x41')]){_0x3a7b1b[_0x7d14('0x3f')]=_[_0x7d14('0x42')](_0x3a7b1b[_0x7d14('0x3f')],{'$or':_[_0x7d14('0x2f')](_0x1d6cb1,function(_0x44e29){if(_0x44e29['type']!==_0x7d14('0x43')){var _0x4cf18d={};_0x4cf18d[_0x44e29[_0x7d14('0x2c')]]={'$like':'%'+_0x397c7a['query']['filter']+'%'};return _0x4cf18d;}})});}_0x3a7b1b=_[_0x7d14('0x42')]({},_0x3a7b1b,_0x397c7a[_0x7d14('0x44')]);var _0x24e5db={'where':_0x3a7b1b[_0x7d14('0x3f')]};return db['MailMessage'][_0x7d14('0x24')](_0x24e5db)[_0x7d14('0x15')](function(_0x26e74e){_0x5a155d['count']=_0x26e74e;if(_0x397c7a[_0x7d14('0x35')]['includeAll']){_0x3a7b1b[_0x7d14('0x45')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x3a7b1b);})[_0x7d14('0x15')](function(_0x18f4aa){_0x5a155d[_0x7d14('0x46')]=_0x18f4aa;return _0x5a155d;})[_0x7d14('0x15')](respondWithFilteredResult(_0x1105f2,_0x3a7b1b))[_0x7d14('0x1f')](handleError(_0x1105f2,null));};exports[_0x7d14('0x47')]=function(_0x3ff035,_0x4bcb6e){var _0x390aae={'raw':!![],'where':{'id':_0x3ff035[_0x7d14('0x48')]['id']}},_0x4b6fec={};_0x4b6fec['model']=_[_0x7d14('0x36')](db['MailMessage']['rawAttributes']);_0x4b6fec[_0x7d14('0x35')]=_[_0x7d14('0x36')](_0x3ff035[_0x7d14('0x35')]);_0x4b6fec[_0x7d14('0x37')]=_[_0x7d14('0x38')](_0x4b6fec[_0x7d14('0x34')],_0x4b6fec['query']);_0x390aae[_0x7d14('0x39')]=_['intersection'](_0x4b6fec[_0x7d14('0x34')],qs[_0x7d14('0x3a')](_0x3ff035[_0x7d14('0x35')][_0x7d14('0x3a')]));_0x390aae[_0x7d14('0x39')]=_0x390aae[_0x7d14('0x39')]['length']?_0x390aae[_0x7d14('0x39')]:_0x4b6fec[_0x7d14('0x34')];if(_0x3ff035[_0x7d14('0x35')][_0x7d14('0x49')]){_0x390aae[_0x7d14('0x45')]=[{'all':!![]}];}_0x390aae=_['merge']({},_0x390aae,_0x3ff035[_0x7d14('0x44')]);return db[_0x7d14('0x30')][_0x7d14('0x4a')](_0x390aae)[_0x7d14('0x15')](handleEntityNotFound(_0x4bcb6e,null))[_0x7d14('0x15')](respondWithResult(_0x4bcb6e,null))[_0x7d14('0x1f')](handleError(_0x4bcb6e,null));};exports[_0x7d14('0x27')]=function(_0x456f29,_0x40d4aa){if(_0x456f29[_0x7d14('0x4b')]['id']){delete _0x456f29[_0x7d14('0x4b')]['id'];}return db[_0x7d14('0x30')][_0x7d14('0x4a')]({'where':{'id':_0x456f29[_0x7d14('0x48')]['id']}})[_0x7d14('0x15')](handleEntityNotFound(_0x40d4aa,null))[_0x7d14('0x15')](saveUpdates(_0x456f29['body'],null))[_0x7d14('0x15')](respondWithResult(_0x40d4aa,null))[_0x7d14('0x1f')](handleError(_0x40d4aa,null));};exports[_0x7d14('0x28')]=function(_0x544b24,_0x39498b){return db['MailMessage'][_0x7d14('0x4a')]({'where':{'id':_0x544b24[_0x7d14('0x48')]['id']}})['then'](handleEntityNotFound(_0x39498b,null))['then'](removeEntity(_0x39498b,null))[_0x7d14('0x1f')](handleError(_0x39498b,null));};exports['describe']=function(_0x39e6ea,_0x207eea){return db[_0x7d14('0x30')][_0x7d14('0x4c')]()[_0x7d14('0x15')](respondWithResult(_0x207eea,null))['catch'](handleError(_0x207eea,null));};exports[_0x7d14('0x4d')]=function(_0x412779,_0x1a8bae){return db['MailMessage'][_0x7d14('0x4d')](_0x412779[_0x7d14('0x4b')])[_0x7d14('0x15')](function(_0x3c29bd){if(_0x3c29bd){if(_0x3c29bd[_0x7d14('0x4e')]===_0x7d14('0x4f')&&!_0x3c29bd[_0x7d14('0x50')]){var _0x35f2c8,_0x5dcab3,_0x19e444;if(_0x412779['body']['to']){_0x5dcab3=_0x412779['body']['to']['split'](',')[0x0];}return db['MailAccount'][_0x7d14('0x51')]({'where':{'id':_0x3c29bd[_0x7d14('0x52')]},'include':[{'model':db[_0x7d14('0x53')],'as':_0x7d14('0x54'),'include':[{'model':db['CmContact'],'as':_0x7d14('0x55'),'where':{'email':_0x5dcab3},'limit':0x1,'order':[[_0x7d14('0x56'),_0x7d14('0x57')]]}]},{'model':db[_0x7d14('0x58')],'as':_0x7d14('0x59'),'raw':!![],'include':[{'model':db[_0x7d14('0x5a')],'as':_0x7d14('0x5a'),'raw':!![]}]}]})[_0x7d14('0x15')](function(_0x5ce185){_0x35f2c8=_0x5ce185;if(!_0x35f2c8||!_0x35f2c8[_0x7d14('0x59')])return;var _0x16464a=_0x35f2c8[_0x7d14('0x5b')]();if(_0x412779[_0x7d14('0x4b')][_0x7d14('0x5c')]&&_0x412779[_0x7d14('0x4b')][_0x7d14('0x5c')][_0x7d14('0x3b')]){for(var _0x39cb32=0x0;_0x39cb32<_0x412779['body'][_0x7d14('0x5c')]['length'];_0x39cb32+=0x1){_0x412779['body']['attachments'][_0x39cb32]={'filename':_0x412779['body']['attachments'][_0x39cb32][_0x7d14('0x2c')],'path':path[_0x7d14('0x5d')](config[_0x7d14('0x5e')],_0x7d14('0x5f'),_0x412779[_0x7d14('0x4b')][_0x7d14('0x5c')][_0x39cb32][_0x7d14('0x60')])};}}_0x19e444={'account':_0x16464a,'message':_0x412779[_0x7d14('0x4b')]};return;})[_0x7d14('0x15')](function(){if(_0x35f2c8[_0x7d14('0x54')]){if(_0x35f2c8[_0x7d14('0x54')]['Contacts'][_0x7d14('0x3b')]){return _0x35f2c8[_0x7d14('0x54')]['Contacts'][0x0];}else{return db[_0x7d14('0x61')]['create'](_[_0x7d14('0xc')](_0x412779[_0x7d14('0x4b')],{'firstName':_0x412779[_0x7d14('0x4b')]['to'],'email':_0x412779[_0x7d14('0x4b')]['to'],'phone':_0x412779[_0x7d14('0x4b')]['to'],'ListId':_0x35f2c8[_0x7d14('0x62')]}));}}else{throw new Error(_0x7d14('0x63'));}})[_0x7d14('0x15')](function(){if(_0x19e444){return respondWithRpcPromise(_0x7d14('0x64'),_0x7d14('0x65'),_0x19e444,client9003)[_0x7d14('0x15')](function(_0xd6ee0e){return _0x3c29bd['update']({'read':!![],'messageId':_0xd6ee0e[_0x7d14('0x66')],'sentAt':moment()[_0x7d14('0x67')](_0x7d14('0x68'))});})[_0x7d14('0x1f')](function(_0x425901){logger['error']('%s',JSON[_0x7d14('0x19')](_0x425901));return _0x3c29bd;});}return _0x3c29bd;});}return _0x3c29bd;}})[_0x7d14('0x15')](respondWithResult(_0x1a8bae,0xc9))['catch'](handleError(_0x1a8bae,null));};exports[_0x7d14('0x69')]=function(_0x34653f,_0x544302){var _0xd595c3={'agent':{},'channel':'mail'};if(_0x34653f['body']['id']){delete _0x34653f[_0x7d14('0x4b')]['id'];}_0x34653f[_0x7d14('0x4b')][_0x7d14('0x6a')]=!![];_0x34653f[_0x7d14('0x4b')]['readAt']=moment()[_0x7d14('0x67')](_0x7d14('0x68'));_0x34653f[_0x7d14('0x4b')]['UserId']=_0x34653f[_0x7d14('0x4b')][_0x7d14('0x6b')]||_0x34653f[_0x7d14('0x6c')]['id'];_0xd595c3['agent']['id']=_0x34653f[_0x7d14('0x4b')][_0x7d14('0x6b')];return db[_0x7d14('0x30')][_0x7d14('0x4a')]({'where':{'id':_0x34653f[_0x7d14('0x48')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x544302,null))[_0x7d14('0x15')](saveUpdates(_0x34653f[_0x7d14('0x4b')],null))[_0x7d14('0x15')](function(_0x416347){if(_0x416347){_0xd595c3['message']=_0x416347[_0x7d14('0x6d')]({'plain':!![]});return db[_0x7d14('0x6e')][_0x7d14('0x4a')]({'where':{'id':_0x416347[_0x7d14('0x6f')]}});}return null;})[_0x7d14('0x15')](handleEntityNotFound(_0x544302,null))[_0x7d14('0x15')](function(_0x5702c4){if(_0x5702c4){return _0x5702c4[_0x7d14('0x27')]({'UserId':_0x34653f[_0x7d14('0x4b')]['UserId'],'read1stAt':_[_0x7d14('0x70')](_0x5702c4[_0x7d14('0x71')])?moment()[_0x7d14('0x67')](_0x7d14('0x68')):undefined});}return null;})[_0x7d14('0x15')](function(_0x49d89f){if(_0x49d89f){_0xd595c3[_0x7d14('0x72')]=_0x49d89f[_0x7d14('0x6d')]({'plain':!![]});interaction_log[_0x7d14('0x1d')](_0x7d14('0x73'),_0x34653f[_0x7d14('0x6c')]['id'],_0x34653f[_0x7d14('0x6c')][_0x7d14('0x2c')],_0x34653f[_0x7d14('0x6c')][_0x7d14('0x74')],_0xd595c3['interaction']['id'],_0x34653f['body']?JSON[_0x7d14('0x19')](_0x34653f[_0x7d14('0x4b')]):_0x7d14('0x75'));return respondWithRpcPromise(_0x7d14('0x76'),_0x7d14('0x77'),_0xd595c3);}return null;})['then'](function(_0x594628){var _0x198225=_0x7d14('0x78')+_0x594628[_0x7d14('0x1c')][_0x7d14('0x79')];return db['sequelize']['query'](_0x198225,{'type':db[_0x7d14('0x7a')]['QueryTypes'][_0x7d14('0x7b')],'raw':!![]})['then'](function(_0x93219){return _0x93219;});})['then'](function(_0x475ae4){if(_0x475ae4){_0xd595c3[_0x7d14('0x1c')][_0x7d14('0x7c')]=_0x475ae4[0x0];if(!_0x34653f[_0x7d14('0x4b')][_0x7d14('0x6b')])return;return db[_0x7d14('0x7d')][_0x7d14('0x4a')]({'where':{'id':_0x34653f[_0x7d14('0x4b')][_0x7d14('0x6b')],'role':_0x7d14('0x7e')},'attributes':['id',_0x7d14('0x2c'),'fullname',_0x7d14('0x7f'),_0x7d14('0x80')],'raw':!![]});}return null;})[_0x7d14('0x15')](function(_0x3f1507){if(!_0x3f1507)return null;_0xd595c3['message'][_0x7d14('0x7e')]=_0x3f1507;return _0xd595c3;})[_0x7d14('0x15')](function(_0x590b96){if(_0x590b96){if(_0x34653f[_0x7d14('0x4b')][_0x7d14('0x81')]){_0xd595c3[_0x7d14('0x1c')][_0x7d14('0x82')]=util[_0x7d14('0x67')](_0x7d14('0x83'),_0x34653f[_0x7d14('0x6c')]['name']);_0xd595c3[_0x7d14('0x1c')][_0x7d14('0x84')]=_0xd595c3[_0x7d14('0x84')];_0xd595c3['message']['motionChannel']=_0xd595c3[_0x7d14('0x84')];_0xd595c3[_0x7d14('0x1c')][_0x7d14('0x85')]=_0x7d14('0x69');_0xd595c3[_0x7d14('0x1c')][_0x7d14('0x4b')]=htmlToText[_0x7d14('0x86')](_0xd595c3['message'][_0x7d14('0x4b')]);return respondWithRpcPromise(_0x7d14('0x87'),_0x7d14('0x87'),{'event':_0x7d14('0x88'),'message':_0xd595c3[_0x7d14('0x1c')]},client9002)[_0x7d14('0x15')](function(){return _0xd595c3;});}return _0xd595c3;}return null;})[_0x7d14('0x15')](respondWithResult(_0x544302,null))[_0x7d14('0x1f')](handleError(_0x544302,null));};exports['reject']=function(_0x2445f6,_0x56cae2){var _0x37ba93={'agent':{},'channel':_0x7d14('0x89')};if(_0x2445f6[_0x7d14('0x4b')]['id']){delete _0x2445f6['body']['id'];}_0x2445f6[_0x7d14('0x4b')][_0x7d14('0x6b')]=_0x2445f6['body']['UserId']||_0x2445f6[_0x7d14('0x6c')]['id'];_0x37ba93[_0x7d14('0x7e')]['id']=_0x2445f6[_0x7d14('0x4b')][_0x7d14('0x6b')];return db['MailMessage']['find']({'where':{'id':_0x2445f6[_0x7d14('0x48')]['id'],'UserId':null}})[_0x7d14('0x15')](handleEntityNotFound(_0x56cae2,null))[_0x7d14('0x15')](function(_0x31be9a){if(_0x31be9a){_0x37ba93[_0x7d14('0x1c')]=_0x31be9a[_0x7d14('0x6d')]({'plain':!![]});return db[_0x7d14('0x6e')][_0x7d14('0x4a')]({'where':{'id':_0x31be9a[_0x7d14('0x6f')]}});}return null;})[_0x7d14('0x15')](handleEntityNotFound(_0x56cae2,null))['then'](function(_0x21b6ac){if(_0x21b6ac){_0x37ba93[_0x7d14('0x72')]=_0x21b6ac[_0x7d14('0x6d')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2445f6[_0x7d14('0x6c')]['id'],_0x2445f6[_0x7d14('0x6c')][_0x7d14('0x2c')],_0x2445f6['user']['role'],_0x37ba93['interaction']['id'],_0x2445f6[_0x7d14('0x4b')]?JSON[_0x7d14('0x19')](_0x2445f6['body']):'null');return respondWithRpcPromise(_0x7d14('0x8a'),_0x7d14('0x8b'),_0x37ba93);}return null;})[_0x7d14('0x15')](function(_0x3ad470){var _0x19d0f5=_0x7d14('0x78')+_0x3ad470['message']['ContactId'];return db[_0x7d14('0x8c')][_0x7d14('0x35')](_0x19d0f5,{'type':db['Sequelize'][_0x7d14('0x8d')][_0x7d14('0x7b')],'raw':!![]})[_0x7d14('0x15')](function(_0x73cd2){return _0x73cd2;});})[_0x7d14('0x15')](function(_0xddebb3){if(_0xddebb3){_0x37ba93['message']['contact']=_0xddebb3[0x0];if(!_0x2445f6['body'][_0x7d14('0x6b')])return;return db[_0x7d14('0x7d')]['find']({'where':{'id':_0x2445f6[_0x7d14('0x4b')]['UserId'],'role':_0x7d14('0x7e')},'attributes':['id',_0x7d14('0x2c'),_0x7d14('0x8e'),'email','internal'],'raw':!![]});}return null;})[_0x7d14('0x15')](function(_0x498b29){if(!_0x498b29)return null;_0x37ba93['message']['agent']=_0x498b29;return _0x37ba93;})['then'](function(_0x13ccd4){if(_0x13ccd4){_0x13ccd4[_0x7d14('0x1c')][_0x7d14('0x82')]=util[_0x7d14('0x67')](_0x7d14('0x83'),_0x2445f6[_0x7d14('0x6c')][_0x7d14('0x2c')]);_0x13ccd4[_0x7d14('0x1c')]['channel']=_0x37ba93[_0x7d14('0x84')];_0x13ccd4[_0x7d14('0x1c')]['motionChannel']=_0x37ba93[_0x7d14('0x84')];_0x13ccd4['message'][_0x7d14('0x85')]='reject';_0x13ccd4[_0x7d14('0x1c')][_0x7d14('0x4b')]=htmlToText[_0x7d14('0x86')](_0x37ba93[_0x7d14('0x1c')]['body']);respondWithRpcPromise(_0x7d14('0x87'),'EventManager',{'event':'rejectmessage','message':_0x13ccd4['message']},client9002);return _0x37ba93;}return null;})['then'](respondWithResult(_0x56cae2,null))[_0x7d14('0x1f')](handleError(_0x56cae2,null));};exports[_0x7d14('0x8f')]=function(_0x26f1cb,_0x57ab62){var _0x17a81d=moment()[_0x7d14('0x90')]()[_0x7d14('0x91')]();var _0x1ddfb6=path[_0x7d14('0x5d')](config[_0x7d14('0x5e')],_0x7d14('0x92'),_0x7d14('0x93'),'tmp');var _0x4c72f3=path[_0x7d14('0x5d')](config[_0x7d14('0x5e')],_0x7d14('0x92'),'files',_0x7d14('0x5c'));var _0x3c0642=util[_0x7d14('0x67')](_0x7d14('0x94'),_0x17a81d);return db[_0x7d14('0x30')][_0x7d14('0x4a')]({'where':{'id':_0x26f1cb[_0x7d14('0x48')]['id']},'attributes':['id',_0x7d14('0x4b'),'from','to','cc',_0x7d14('0x95'),_0x7d14('0x96'),_0x7d14('0x97')],'include':_0x26f1cb[_0x7d14('0x35')][_0x7d14('0x5c')]?[{'model':db[_0x7d14('0x98')],'as':_0x7d14('0x99')}]:undefined})[_0x7d14('0x15')](handleEntityNotFound(_0x57ab62,null))[_0x7d14('0x15')](function(_0x3164ff){if(_0x3164ff){var _0xd576fb=_0x3164ff;var _0x28a3e2={'from':_0xd576fb[_0x7d14('0x9a')],'to':_0xd576fb['to'],'subject':_0xd576fb['subject'],'html':htmlEntities[_0x7d14('0x9b')](_0xd576fb[_0x7d14('0x4b')]),'headers':{'Date':moment(_0xd576fb['createdAt'])[_0x7d14('0x67')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x3164ff['cc']){_0x28a3e2[_0x7d14('0x9c')]['Cc']=_0x3164ff['cc'];}if(_0x3164ff[_0x7d14('0x95')]){_0x28a3e2['headers'][_0x7d14('0x9d')]=_0x3164ff['bcc'];}return new BPromise(function(_0x3cbd6c,_0xc6a330){if(_0x3164ff['Attachments']){for(var _0x3ecee0=0x0;_0x3ecee0<_0x3164ff[_0x7d14('0x99')][_0x7d14('0x3b')];_0x3ecee0++){var _0x8ca0a4=_0x3164ff[_0x7d14('0x99')][_0x3ecee0];var _0x1815a5=path[_0x7d14('0x5d')](_0x4c72f3,_0x8ca0a4[_0x7d14('0x60')]);if(fs[_0x7d14('0x9e')](_0x1815a5)){_0x28a3e2[_0x7d14('0x5c')]['push']({'name':_0x8ca0a4[_0x7d14('0x2c')],'contentType':_0x8ca0a4[_0x7d14('0x33')],'data':fs[_0x7d14('0x9f')](_0x1815a5)});}}}emlformat[_0x7d14('0xa0')](_0x28a3e2,function(_0x5c016c,_0x3bd75d){if(_0x5c016c)return _0xc6a330(_0x5c016c);fs[_0x7d14('0xa1')](path[_0x7d14('0x5d')](_0x1ddfb6,_0x3c0642),_0x3bd75d);return _0x3cbd6c(_0x3bd75d);});});}})[_0x7d14('0x15')](function(_0x44d2b7){if(_0x44d2b7){return _0x57ab62[_0x7d14('0x8f')](path[_0x7d14('0x5d')](_0x1ddfb6,_0x3c0642),_0x3c0642,function(_0x5d67f9){if(!_0x5d67f9)fs['unlinkSync'](path[_0x7d14('0x5d')](_0x1ddfb6,_0x3c0642));});}})[_0x7d14('0x1f')](handleError(_0x57ab62,null));}; \ No newline at end of file +var _0xbf89=['bluebird','util','path','ioredis','html-to-text','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','body','params','create','out','MailAccount','findOne','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','CmContact','ListId','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','rejectmessage','download','toString','files','tmp','server','message-%s.eml','from','subject','createdAt','Attachment','decode','bcc','headers','Attachments','push','readFileSync','build','writeFileSync','eml-format'];(function(_0x160817,_0x3a7d36){var _0x260566=function(_0x1c337e){while(--_0x1c337e){_0x160817['push'](_0x160817['shift']());}};_0x260566(++_0x3a7d36);}(_0xbf89,0x131));var _0x9bf8=function(_0x4a00d0,_0x56d533){_0x4a00d0=_0x4a00d0-0x0;var _0x6e25bf=_0xbf89[_0x4a00d0];return _0x6e25bf;};'use strict';var emlformat=require(_0x9bf8('0x0'));var moment=require('moment');var BPromise=require(_0x9bf8('0x1'));var util=require(_0x9bf8('0x2'));var path=require(_0x9bf8('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x9bf8('0x4'));var htmlToText=require(_0x9bf8('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x9bf8('0x6'))('api');var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0x9bf8('0x7'));var db=require(_0x9bf8('0x8'))['db'];config[_0x9bf8('0x9')]=_[_0x9bf8('0xa')](config[_0x9bf8('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9bf8('0xb'))(new Redis(config[_0x9bf8('0x9')]));var htmlEntities=require('html-entities');require(_0x9bf8('0xc'))['register'](socket);var jayson=require(_0x9bf8('0xd'));var client=jayson[_0x9bf8('0xe')][_0x9bf8('0xf')]({'port':0x232c});var client9003=jayson[_0x9bf8('0xe')][_0x9bf8('0xf')]({'port':0x232b});var client9002=jayson[_0x9bf8('0xe')][_0x9bf8('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x4df685,_0x3243a9,_0x129f96,_0x4334ac){return new BPromise(function(_0x208bc0,_0xeb042){var _0x7697f3=_0x4334ac||client;return _0x7697f3[_0x9bf8('0x10')](_0x4df685,_0x129f96)[_0x9bf8('0x11')](function(_0x5d94c0){logger[_0x9bf8('0x12')](_0x9bf8('0x13'),_0x3243a9,_0x9bf8('0x14'));logger[_0x9bf8('0x15')](_0x9bf8('0x16'),_0x3243a9,_0x9bf8('0x14'),JSON['stringify'](_0x5d94c0));if(_0x5d94c0[_0x9bf8('0x17')]){if(_0x5d94c0[_0x9bf8('0x17')]['code']===0x1f4){logger[_0x9bf8('0x17')](_0x9bf8('0x13'),_0x3243a9,_0x5d94c0['error'][_0x9bf8('0x18')]);return _0xeb042(_0x5d94c0[_0x9bf8('0x17')][_0x9bf8('0x18')]);}logger[_0x9bf8('0x17')]('MailMessage,\x20%s,\x20%s',_0x3243a9,_0x5d94c0[_0x9bf8('0x17')][_0x9bf8('0x18')]);return _0x208bc0(_0x5d94c0[_0x9bf8('0x17')][_0x9bf8('0x18')]);}else{logger['info'](_0x9bf8('0x13'),_0x3243a9,_0x9bf8('0x14'));_0x208bc0(_0x5d94c0[_0x9bf8('0x19')]['message']);}})[_0x9bf8('0x1a')](function(_0x55300e){logger[_0x9bf8('0x17')](_0x9bf8('0x13'),_0x3243a9,_0x55300e);_0xeb042(_0x55300e);});});}function respondWithResult(_0x1d6618,_0x145262){_0x145262=_0x145262||0xc8;return function(_0x41040f){if(_0x41040f){return _0x1d6618['status'](_0x145262)[_0x9bf8('0x1b')](_0x41040f);}};}function respondWithFilteredResult(_0x308aa2,_0x3cb69b){return function(_0x5561a7){if(_0x5561a7){var _0x43245a=typeof _0x3cb69b[_0x9bf8('0x1c')]===_0x9bf8('0x1d')&&typeof _0x3cb69b[_0x9bf8('0x1e')]===_0x9bf8('0x1d');var _0x5bd2f7=_0x5561a7[_0x9bf8('0x1f')];var _0x5c8fe7=_0x43245a?0x0:_0x3cb69b['offset'];var _0x5488b4=_0x43245a?_0x5561a7['count']:_0x3cb69b[_0x9bf8('0x1c')]+_0x3cb69b[_0x9bf8('0x1e')];var _0x42744f;if(_0x5488b4>=_0x5bd2f7){_0x5488b4=_0x5bd2f7;_0x42744f=0xc8;}else{_0x42744f=0xce;}_0x308aa2[_0x9bf8('0x20')](_0x42744f);return _0x308aa2[_0x9bf8('0x21')](_0x9bf8('0x22'),_0x5c8fe7+'-'+_0x5488b4+'/'+_0x5bd2f7)['json'](_0x5561a7);}return null;};}function saveUpdates(_0x3de61f){return function(_0x1958c6){if(_0x1958c6){return _0x1958c6[_0x9bf8('0x23')](_0x3de61f)[_0x9bf8('0x11')](function(_0x470736){return _0x470736;});}return null;};}function removeEntity(_0x4f7edd){return function(_0x504562){if(_0x504562){return _0x504562[_0x9bf8('0x24')]()[_0x9bf8('0x11')](function(){_0x4f7edd[_0x9bf8('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c9c1f){return function(_0x1087da){if(!_0x1087da){_0x3c9c1f['sendStatus'](0x194);}return _0x1087da;};}function handleError(_0x2db039,_0x215d0b){_0x215d0b=_0x215d0b||0x1f4;return function(_0x58fede){logger[_0x9bf8('0x17')](_0x58fede['stack']);if(_0x58fede['name']){delete _0x58fede[_0x9bf8('0x25')];}_0x2db039[_0x9bf8('0x20')](_0x215d0b)[_0x9bf8('0x26')](_0x58fede);};}exports[_0x9bf8('0x27')]=function(_0x598980,_0x4e7330){var _0x3a6779={},_0x46bd00={},_0x524e85={'count':0x0,'rows':[]};var _0x46c36d=_[_0x9bf8('0x28')](db[_0x9bf8('0x29')][_0x9bf8('0x2a')],function(_0x471320){return{'name':_0x471320[_0x9bf8('0x2b')],'type':_0x471320[_0x9bf8('0x2c')][_0x9bf8('0x2d')]};});_0x46bd00[_0x9bf8('0x2e')]=_[_0x9bf8('0x28')](_0x46c36d,_0x9bf8('0x25'));_0x46bd00[_0x9bf8('0x2f')]=_[_0x9bf8('0x30')](_0x598980[_0x9bf8('0x2f')]);_0x46bd00['filters']=_[_0x9bf8('0x31')](_0x46bd00[_0x9bf8('0x2e')],_0x46bd00[_0x9bf8('0x2f')]);_0x3a6779[_0x9bf8('0x32')]=_[_0x9bf8('0x31')](_0x46bd00[_0x9bf8('0x2e')],qs['fields'](_0x598980[_0x9bf8('0x2f')][_0x9bf8('0x33')]));_0x3a6779[_0x9bf8('0x32')]=_0x3a6779[_0x9bf8('0x32')][_0x9bf8('0x34')]?_0x3a6779[_0x9bf8('0x32')]:_0x46bd00[_0x9bf8('0x2e')];if(!_0x598980[_0x9bf8('0x2f')][_0x9bf8('0x35')](_0x9bf8('0x36'))){_0x3a6779[_0x9bf8('0x1e')]=qs['limit'](_0x598980['query'][_0x9bf8('0x1e')]);_0x3a6779['offset']=qs[_0x9bf8('0x1c')](_0x598980[_0x9bf8('0x2f')][_0x9bf8('0x1c')]);}_0x3a6779[_0x9bf8('0x37')]=qs[_0x9bf8('0x38')](_0x598980[_0x9bf8('0x2f')][_0x9bf8('0x38')]);_0x3a6779[_0x9bf8('0x39')]=qs[_0x9bf8('0x3a')](_[_0x9bf8('0x3b')](_0x598980[_0x9bf8('0x2f')],_0x46bd00['filters']),_0x46c36d);if(_0x598980[_0x9bf8('0x2f')][_0x9bf8('0x3c')]){_0x3a6779['where']=_[_0x9bf8('0x3d')](_0x3a6779[_0x9bf8('0x39')],{'$or':_[_0x9bf8('0x28')](_0x46c36d,function(_0x5003c8){if(_0x5003c8[_0x9bf8('0x2c')]!==_0x9bf8('0x3e')){var _0x2baee8={};_0x2baee8[_0x5003c8[_0x9bf8('0x25')]]={'$like':'%'+_0x598980[_0x9bf8('0x2f')]['filter']+'%'};return _0x2baee8;}})});}_0x3a6779=_[_0x9bf8('0x3d')]({},_0x3a6779,_0x598980[_0x9bf8('0x3f')]);var _0x37201d={'where':_0x3a6779[_0x9bf8('0x39')]};return db[_0x9bf8('0x29')][_0x9bf8('0x1f')](_0x37201d)[_0x9bf8('0x11')](function(_0x2fa444){_0x524e85[_0x9bf8('0x1f')]=_0x2fa444;if(_0x598980[_0x9bf8('0x2f')][_0x9bf8('0x40')]){_0x3a6779[_0x9bf8('0x41')]=[{'all':!![]}];}return db[_0x9bf8('0x29')][_0x9bf8('0x42')](_0x3a6779);})[_0x9bf8('0x11')](function(_0x1f4f0b){_0x524e85[_0x9bf8('0x43')]=_0x1f4f0b;return _0x524e85;})[_0x9bf8('0x11')](respondWithFilteredResult(_0x4e7330,_0x3a6779))[_0x9bf8('0x1a')](handleError(_0x4e7330,null));};exports['show']=function(_0x30ae19,_0xcba73a){var _0x4ce1f5={'raw':!![],'where':{'id':_0x30ae19['params']['id']}},_0x57e02c={};_0x57e02c['model']=_['keys'](db[_0x9bf8('0x29')][_0x9bf8('0x2a')]);_0x57e02c[_0x9bf8('0x2f')]=_[_0x9bf8('0x30')](_0x30ae19['query']);_0x57e02c['filters']=_[_0x9bf8('0x31')](_0x57e02c['model'],_0x57e02c[_0x9bf8('0x2f')]);_0x4ce1f5[_0x9bf8('0x32')]=_[_0x9bf8('0x31')](_0x57e02c[_0x9bf8('0x2e')],qs[_0x9bf8('0x33')](_0x30ae19[_0x9bf8('0x2f')][_0x9bf8('0x33')]));_0x4ce1f5[_0x9bf8('0x32')]=_0x4ce1f5['attributes']['length']?_0x4ce1f5[_0x9bf8('0x32')]:_0x57e02c[_0x9bf8('0x2e')];if(_0x30ae19['query'][_0x9bf8('0x40')]){_0x4ce1f5['include']=[{'all':!![]}];}_0x4ce1f5=_[_0x9bf8('0x3d')]({},_0x4ce1f5,_0x30ae19[_0x9bf8('0x3f')]);return db['MailMessage'][_0x9bf8('0x44')](_0x4ce1f5)[_0x9bf8('0x11')](handleEntityNotFound(_0xcba73a,null))[_0x9bf8('0x11')](respondWithResult(_0xcba73a,null))[_0x9bf8('0x1a')](handleError(_0xcba73a,null));};exports['update']=function(_0x4e2f95,_0x4c3729){if(_0x4e2f95[_0x9bf8('0x45')]['id']){delete _0x4e2f95[_0x9bf8('0x45')]['id'];}return db[_0x9bf8('0x29')][_0x9bf8('0x44')]({'where':{'id':_0x4e2f95[_0x9bf8('0x46')]['id']}})[_0x9bf8('0x11')](handleEntityNotFound(_0x4c3729,null))[_0x9bf8('0x11')](saveUpdates(_0x4e2f95[_0x9bf8('0x45')],null))['then'](respondWithResult(_0x4c3729,null))[_0x9bf8('0x1a')](handleError(_0x4c3729,null));};exports[_0x9bf8('0x24')]=function(_0x3232c8,_0xd31325){return db['MailMessage'][_0x9bf8('0x44')]({'where':{'id':_0x3232c8[_0x9bf8('0x46')]['id']}})['then'](handleEntityNotFound(_0xd31325,null))[_0x9bf8('0x11')](removeEntity(_0xd31325,null))[_0x9bf8('0x1a')](handleError(_0xd31325,null));};exports['describe']=function(_0x22a20b,_0x4ed0e9){return db['MailMessage']['describe']()[_0x9bf8('0x11')](respondWithResult(_0x4ed0e9,null))[_0x9bf8('0x1a')](handleError(_0x4ed0e9,null));};exports[_0x9bf8('0x47')]=function(_0x1907f9,_0x2d7bf9){return db['MailMessage'][_0x9bf8('0x47')](_0x1907f9[_0x9bf8('0x45')])[_0x9bf8('0x11')](function(_0x21aad3){if(_0x21aad3){if(_0x21aad3['direction']===_0x9bf8('0x48')&&!_0x21aad3['secret']){var _0x1a5a93,_0x23d669,_0x514748;if(_0x1907f9['body']['to']){_0x23d669=_0x1907f9[_0x9bf8('0x45')]['to']['split'](',')[0x0];}return db[_0x9bf8('0x49')][_0x9bf8('0x4a')]({'where':{'id':_0x21aad3['MailAccountId']},'include':[{'model':db[_0x9bf8('0x4b')],'as':_0x9bf8('0x4c'),'include':[{'model':db['CmContact'],'as':_0x9bf8('0x4d'),'where':{'email':_0x23d669},'limit':0x1,'order':[[_0x9bf8('0x4e'),_0x9bf8('0x4f')]]}]},{'model':db[_0x9bf8('0x50')],'as':_0x9bf8('0x51'),'raw':!![],'include':[{'model':db[_0x9bf8('0x52')],'as':_0x9bf8('0x52'),'raw':!![]}]}]})[_0x9bf8('0x11')](function(_0x425250){_0x1a5a93=_0x425250;if(!_0x1a5a93||!_0x1a5a93[_0x9bf8('0x51')])return;var _0x1e7d70=_0x1a5a93[_0x9bf8('0x53')]();if(_0x1907f9[_0x9bf8('0x45')][_0x9bf8('0x54')]&&_0x1907f9['body'][_0x9bf8('0x54')][_0x9bf8('0x34')]){for(var _0x5513d7=0x0;_0x5513d7<_0x1907f9[_0x9bf8('0x45')][_0x9bf8('0x54')][_0x9bf8('0x34')];_0x5513d7+=0x1){_0x1907f9[_0x9bf8('0x45')][_0x9bf8('0x54')][_0x5513d7]={'filename':_0x1907f9['body'][_0x9bf8('0x54')][_0x5513d7]['name'],'path':path[_0x9bf8('0x55')](config[_0x9bf8('0x56')],_0x9bf8('0x57'),_0x1907f9[_0x9bf8('0x45')]['attachments'][_0x5513d7][_0x9bf8('0x58')])};}}_0x514748={'account':_0x1e7d70,'message':_0x1907f9[_0x9bf8('0x45')]};return;})[_0x9bf8('0x11')](function(){if(_0x1a5a93[_0x9bf8('0x4c')]){if(_0x1a5a93[_0x9bf8('0x4c')][_0x9bf8('0x4d')]['length']){return _0x1a5a93[_0x9bf8('0x4c')]['Contacts'][0x0];}else{return db[_0x9bf8('0x59')][_0x9bf8('0x47')](_[_0x9bf8('0xa')](_0x1907f9['body'],{'firstName':_0x1907f9['body']['to'],'email':_0x1907f9['body']['to'],'phone':_0x1907f9[_0x9bf8('0x45')]['to'],'ListId':_0x1a5a93[_0x9bf8('0x5a')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x514748){return respondWithRpcPromise(_0x9bf8('0x5b'),_0x9bf8('0x5c'),_0x514748,client9003)[_0x9bf8('0x11')](function(_0x52c921){return _0x21aad3[_0x9bf8('0x23')]({'read':!![],'messageId':_0x52c921['messageId'],'sentAt':moment()[_0x9bf8('0x5d')](_0x9bf8('0x5e'))});})[_0x9bf8('0x1a')](function(_0x49836f){logger[_0x9bf8('0x17')]('%s',JSON[_0x9bf8('0x5f')](_0x49836f));return _0x21aad3;});}return _0x21aad3;});}return _0x21aad3;}})[_0x9bf8('0x11')](respondWithResult(_0x2d7bf9,0xc9))['catch'](handleError(_0x2d7bf9,null));};exports[_0x9bf8('0x60')]=function(_0x25f636,_0x3a3213){var _0xee886c={'agent':{},'channel':'mail'};if(_0x25f636[_0x9bf8('0x45')]['id']){delete _0x25f636[_0x9bf8('0x45')]['id'];}_0x25f636[_0x9bf8('0x45')][_0x9bf8('0x61')]=!![];_0x25f636['body'][_0x9bf8('0x62')]=moment()['format'](_0x9bf8('0x5e'));_0x25f636[_0x9bf8('0x45')][_0x9bf8('0x63')]=_0x25f636['body'][_0x9bf8('0x63')]||_0x25f636['user']['id'];_0xee886c[_0x9bf8('0x64')]['id']=_0x25f636[_0x9bf8('0x45')][_0x9bf8('0x63')];return db['MailMessage'][_0x9bf8('0x44')]({'where':{'id':_0x25f636[_0x9bf8('0x46')]['id'],'UserId':null}})[_0x9bf8('0x11')](handleEntityNotFound(_0x3a3213,null))[_0x9bf8('0x11')](saveUpdates(_0x25f636[_0x9bf8('0x45')],null))[_0x9bf8('0x11')](function(_0x34d896){if(_0x34d896){_0xee886c[_0x9bf8('0x18')]=_0x34d896[_0x9bf8('0x65')]({'plain':!![]});return db[_0x9bf8('0x66')][_0x9bf8('0x44')]({'where':{'id':_0x34d896[_0x9bf8('0x67')]}});}return null;})[_0x9bf8('0x11')](handleEntityNotFound(_0x3a3213,null))[_0x9bf8('0x11')](function(_0x5650cb){if(_0x5650cb){return _0x5650cb[_0x9bf8('0x23')]({'UserId':_0x25f636[_0x9bf8('0x45')][_0x9bf8('0x63')],'read1stAt':_[_0x9bf8('0x68')](_0x5650cb['read1stAt'])?moment()[_0x9bf8('0x5d')](_0x9bf8('0x5e')):undefined});}return null;})[_0x9bf8('0x11')](function(_0x2c1545){if(_0x2c1545){_0xee886c[_0x9bf8('0x69')]=_0x2c1545['get']({'plain':!![]});interaction_log[_0x9bf8('0x12')](_0x9bf8('0x6a'),_0x25f636[_0x9bf8('0x6b')]['id'],_0x25f636['user'][_0x9bf8('0x25')],_0x25f636[_0x9bf8('0x6b')][_0x9bf8('0x6c')],_0xee886c[_0x9bf8('0x69')]['id'],_0x25f636['body']?JSON[_0x9bf8('0x5f')](_0x25f636[_0x9bf8('0x45')]):'null');return respondWithRpcPromise('AcceptMessage',_0x9bf8('0x6d'),_0xee886c);}return null;})[_0x9bf8('0x11')](function(_0xc754ad){var _0x124e6a=_0x9bf8('0x6e')+_0xc754ad[_0x9bf8('0x18')][_0x9bf8('0x6f')];return db[_0x9bf8('0x70')][_0x9bf8('0x2f')](_0x124e6a,{'type':db[_0x9bf8('0x71')][_0x9bf8('0x72')][_0x9bf8('0x73')],'raw':!![]})[_0x9bf8('0x11')](function(_0x33e926){return _0x33e926;});})[_0x9bf8('0x11')](function(_0xf7de12){if(_0xf7de12){_0xee886c[_0x9bf8('0x18')][_0x9bf8('0x74')]=_0xf7de12[0x0];if(!_0x25f636[_0x9bf8('0x45')]['UserId'])return;return db[_0x9bf8('0x75')][_0x9bf8('0x44')]({'where':{'id':_0x25f636[_0x9bf8('0x45')][_0x9bf8('0x63')],'role':_0x9bf8('0x64')},'attributes':['id',_0x9bf8('0x25'),'fullname',_0x9bf8('0x76'),_0x9bf8('0x77')],'raw':!![]});}return null;})[_0x9bf8('0x11')](function(_0x54f3e6){if(!_0x54f3e6)return null;_0xee886c[_0x9bf8('0x18')][_0x9bf8('0x64')]=_0x54f3e6;return _0xee886c;})['then'](function(_0x15e322){if(_0x15e322){if(_0x25f636[_0x9bf8('0x45')][_0x9bf8('0x78')]){_0xee886c[_0x9bf8('0x18')][_0x9bf8('0x79')]=util[_0x9bf8('0x5d')](_0x9bf8('0x7a'),_0x25f636[_0x9bf8('0x6b')][_0x9bf8('0x25')]);_0xee886c['message']['channel']=_0xee886c['channel'];_0xee886c[_0x9bf8('0x18')][_0x9bf8('0x7b')]=_0xee886c[_0x9bf8('0x7c')];_0xee886c[_0x9bf8('0x18')][_0x9bf8('0x7d')]=_0x9bf8('0x60');_0xee886c[_0x9bf8('0x18')][_0x9bf8('0x45')]=htmlToText['fromString'](_0xee886c[_0x9bf8('0x18')][_0x9bf8('0x45')]);return respondWithRpcPromise(_0x9bf8('0x7e'),_0x9bf8('0x7e'),{'event':_0x9bf8('0x7f'),'message':_0xee886c['message']},client9002)['then'](function(){return _0xee886c;});}return _0xee886c;}return null;})['then'](respondWithResult(_0x3a3213,null))[_0x9bf8('0x1a')](handleError(_0x3a3213,null));};exports[_0x9bf8('0x80')]=function(_0x4a52c6,_0x21aed7){var _0x1499ef={'agent':{},'channel':_0x9bf8('0x81')};if(_0x4a52c6[_0x9bf8('0x45')]['id']){delete _0x4a52c6[_0x9bf8('0x45')]['id'];}_0x4a52c6[_0x9bf8('0x45')][_0x9bf8('0x63')]=_0x4a52c6['body'][_0x9bf8('0x63')]||_0x4a52c6[_0x9bf8('0x6b')]['id'];_0x1499ef[_0x9bf8('0x64')]['id']=_0x4a52c6[_0x9bf8('0x45')][_0x9bf8('0x63')];return db[_0x9bf8('0x29')][_0x9bf8('0x44')]({'where':{'id':_0x4a52c6[_0x9bf8('0x46')]['id'],'UserId':null}})[_0x9bf8('0x11')](handleEntityNotFound(_0x21aed7,null))[_0x9bf8('0x11')](function(_0x3bd88f){if(_0x3bd88f){_0x1499ef['message']=_0x3bd88f[_0x9bf8('0x65')]({'plain':!![]});return db['MailInteraction'][_0x9bf8('0x44')]({'where':{'id':_0x3bd88f[_0x9bf8('0x67')]}});}return null;})[_0x9bf8('0x11')](handleEntityNotFound(_0x21aed7,null))[_0x9bf8('0x11')](function(_0x3b4d09){if(_0x3b4d09){_0x1499ef[_0x9bf8('0x69')]=_0x3b4d09[_0x9bf8('0x65')]({'plain':!![]});interaction_log[_0x9bf8('0x12')](_0x9bf8('0x82'),_0x4a52c6[_0x9bf8('0x6b')]['id'],_0x4a52c6[_0x9bf8('0x6b')]['name'],_0x4a52c6[_0x9bf8('0x6b')]['role'],_0x1499ef['interaction']['id'],_0x4a52c6[_0x9bf8('0x45')]?JSON[_0x9bf8('0x5f')](_0x4a52c6[_0x9bf8('0x45')]):'null');return respondWithRpcPromise(_0x9bf8('0x83'),_0x9bf8('0x84'),_0x1499ef);}return null;})['then'](function(_0x400f15){var _0x34fa35=_0x9bf8('0x6e')+_0x400f15[_0x9bf8('0x18')]['ContactId'];return db['sequelize'][_0x9bf8('0x2f')](_0x34fa35,{'type':db[_0x9bf8('0x71')][_0x9bf8('0x72')]['SELECT'],'raw':!![]})[_0x9bf8('0x11')](function(_0xd30698){return _0xd30698;});})[_0x9bf8('0x11')](function(_0x2407a7){if(_0x2407a7){_0x1499ef[_0x9bf8('0x18')][_0x9bf8('0x74')]=_0x2407a7[0x0];if(!_0x4a52c6[_0x9bf8('0x45')]['UserId'])return;return db[_0x9bf8('0x75')][_0x9bf8('0x44')]({'where':{'id':_0x4a52c6[_0x9bf8('0x45')][_0x9bf8('0x63')],'role':_0x9bf8('0x64')},'attributes':['id',_0x9bf8('0x25'),_0x9bf8('0x85'),_0x9bf8('0x76'),'internal'],'raw':!![]});}return null;})['then'](function(_0x44e329){if(!_0x44e329)return null;_0x1499ef[_0x9bf8('0x18')]['agent']=_0x44e329;return _0x1499ef;})[_0x9bf8('0x11')](function(_0x3e4cba){if(_0x3e4cba){_0x3e4cba['message']['interface']=util[_0x9bf8('0x5d')](_0x9bf8('0x7a'),_0x4a52c6[_0x9bf8('0x6b')][_0x9bf8('0x25')]);_0x3e4cba['message'][_0x9bf8('0x7c')]=_0x1499ef['channel'];_0x3e4cba[_0x9bf8('0x18')][_0x9bf8('0x7b')]=_0x1499ef['channel'];_0x3e4cba['message'][_0x9bf8('0x7d')]=_0x9bf8('0x80');_0x3e4cba['message'][_0x9bf8('0x45')]=htmlToText['fromString'](_0x1499ef[_0x9bf8('0x18')][_0x9bf8('0x45')]);respondWithRpcPromise(_0x9bf8('0x7e'),_0x9bf8('0x7e'),{'event':_0x9bf8('0x86'),'message':_0x3e4cba[_0x9bf8('0x18')]},client9002);return _0x1499ef;}return null;})[_0x9bf8('0x11')](respondWithResult(_0x21aed7,null))['catch'](handleError(_0x21aed7,null));};exports[_0x9bf8('0x87')]=function(_0x45ac1b,_0x141993){var _0x49e128=moment()['unix']()[_0x9bf8('0x88')]();var _0x3e05f7=path[_0x9bf8('0x55')](config[_0x9bf8('0x56')],'server',_0x9bf8('0x89'),_0x9bf8('0x8a'));var _0x5f20a0=path['join'](config['root'],_0x9bf8('0x8b'),'files','attachments');var _0x53767a=util[_0x9bf8('0x5d')](_0x9bf8('0x8c'),_0x49e128);return db[_0x9bf8('0x29')]['find']({'where':{'id':_0x45ac1b[_0x9bf8('0x46')]['id']},'attributes':['id','body',_0x9bf8('0x8d'),'to','cc','bcc',_0x9bf8('0x8e'),_0x9bf8('0x8f')],'include':_0x45ac1b[_0x9bf8('0x2f')][_0x9bf8('0x54')]?[{'model':db[_0x9bf8('0x90')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x141993,null))[_0x9bf8('0x11')](function(_0x34d497){if(_0x34d497){var _0x140da7=_0x34d497;var _0x36cdb2={'from':_0x140da7[_0x9bf8('0x8d')],'to':_0x140da7['to'],'subject':_0x140da7[_0x9bf8('0x8e')],'html':htmlEntities[_0x9bf8('0x91')](_0x140da7[_0x9bf8('0x45')]),'headers':{'Date':moment(_0x140da7['createdAt'])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x34d497['cc']){_0x36cdb2['headers']['Cc']=_0x34d497['cc'];}if(_0x34d497[_0x9bf8('0x92')]){_0x36cdb2[_0x9bf8('0x93')]['Bcc']=_0x34d497[_0x9bf8('0x92')];}return new BPromise(function(_0x1a1115,_0x42c7c7){if(_0x34d497[_0x9bf8('0x94')]){for(var _0x529fa0=0x0;_0x529fa0<_0x34d497['Attachments'][_0x9bf8('0x34')];_0x529fa0++){var _0x1744ea=_0x34d497[_0x9bf8('0x94')][_0x529fa0];var _0x2c7ab9=path['join'](_0x5f20a0,_0x1744ea[_0x9bf8('0x58')]);if(fs['existsSync'](_0x2c7ab9)){_0x36cdb2[_0x9bf8('0x54')][_0x9bf8('0x95')]({'name':_0x1744ea[_0x9bf8('0x25')],'contentType':_0x1744ea[_0x9bf8('0x2c')],'data':fs[_0x9bf8('0x96')](_0x2c7ab9)});}}}emlformat[_0x9bf8('0x97')](_0x36cdb2,function(_0x163fb0,_0x328f36){if(_0x163fb0)return _0x42c7c7(_0x163fb0);fs[_0x9bf8('0x98')](path[_0x9bf8('0x55')](_0x3e05f7,_0x53767a),_0x328f36);return _0x1a1115(_0x328f36);});});}})['then'](function(_0x486a1b){if(_0x486a1b){return _0x141993[_0x9bf8('0x87')](path['join'](_0x3e05f7,_0x53767a),_0x53767a,function(_0x1a2f93){if(!_0x1a2f93)fs['unlinkSync'](path[_0x9bf8('0x55')](_0x3e05f7,_0x53767a));});}})[_0x9bf8('0x1a')](handleError(_0x141993,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index f60e656..d7f9190 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 _0x87d5=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','update'];(function(_0x55bfd2,_0xfa52d0){var _0x30eb6a=function(_0x35f280){while(--_0x35f280){_0x55bfd2['push'](_0x55bfd2['shift']());}};_0x30eb6a(++_0xfa52d0);}(_0x87d5,0xa4));var _0x587d=function(_0x3eeba5,_0x11a4ac){_0x3eeba5=_0x3eeba5-0x0;var _0x182f01=_0x87d5[_0x3eeba5];return _0x182f01;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x587d('0x0'))['db'][_0x587d('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x587d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x587d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x30b127){return function(_0x4d469f,_0x2be249,_0x17d863){MailMessageEvents[_0x587d('0x4')](_0x30b127+':'+_0x4d469f['id'],_0x4d469f);MailMessageEvents['emit'](_0x30b127,_0x4d469f);_0x17d863(null);};}for(var e in events){if(events[_0x587d('0x5')](e)){var event=events[e];MailMessage[_0x587d('0x6')](e,emitEvent(event));}}module[_0x587d('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xba2c=['setMaxListeners','emit','hasOwnProperty','MailMessage'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xba2c,0x183));var _0xcba2=function(_0x289cf7,_0x2cb3cc){_0x289cf7=_0x289cf7-0x0;var _0x9977f3=_0xba2c[_0x289cf7];return _0x9977f3;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0xcba2('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xcba2('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x386a62){return function(_0x13843e,_0x1dac19,_0xf9fb59){MailMessageEvents['emit'](_0x386a62+':'+_0x13843e['id'],_0x13843e);MailMessageEvents[_0xcba2('0x2')](_0x386a62,_0x13843e);_0xf9fb59(null);};}for(var e in events){if(events[_0xcba2('0x3')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 4907d5c..d5e56b5 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 _0x493a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','plainBody','fromString','body','models','get','direction','toLowerCase','secret','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0xd580e2,_0x109182){var _0x4d955f=function(_0x568fff){while(--_0x568fff){_0xd580e2['push'](_0xd580e2['shift']());}};_0x4d955f(++_0x109182);}(_0x493a,0xfb));var _0xa493=function(_0x1505e5,_0x5cc291){_0x1505e5=_0x1505e5-0x0;var _0x5b1dcd=_0x493a[_0x1505e5];return _0x5b1dcd;};'use strict';var _=require(_0xa493('0x0'));var util=require(_0xa493('0x1'));var logger=require(_0xa493('0x2'))(_0xa493('0x3'));var moment=require(_0xa493('0x4'));var BPromise=require('bluebird');var rp=require(_0xa493('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xa493('0x6'));var rimraf=require(_0xa493('0x7'));var config=require(_0xa493('0x8'));var attributes=require(_0xa493('0x9'));module[_0xa493('0xa')]=function(_0x309120,_0x3114e6){return _0x309120[_0xa493('0xb')](_0xa493('0xc'),attributes,{'tableName':_0xa493('0xd'),'paranoid':![],'indexes':[{'name':_0xa493('0xe'),'fields':['messageId']},{'name':_0xa493('0xf'),'fields':['plainBody',_0xa493('0x10')],'type':_0xa493('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4700c1,_0x278b0f,_0x43aaf2){if(_0x4700c1['body']){_0x4700c1[_0xa493('0x12')]=htmlToText[_0xa493('0x13')](_0x4700c1[_0xa493('0x14')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x43aaf2(null,_0x278b0f);},'afterCreate':function(_0x322b0f,_0x19744d,_0x2bc2db){var _0x316156=_0x309120[_0xa493('0x15')];var _0x504aac=_0x322b0f[_0xa493('0x16')]({'plain':!![]});if(_0x504aac['direction']['toLowerCase']()==='in'||_0x504aac[_0xa493('0x17')][_0xa493('0x18')]()==='out'&&!_0x504aac[_0xa493('0x19')]&&!_['isNil'](_0x504aac['UserId'])){_0x316156[_0xa493('0x1a')][_0xa493('0x1b')]({'where':{'id':_0x504aac[_0xa493('0x1c')]}})[_0xa493('0x1d')](function(_0x1a9a13){if(_0x1a9a13){_0x1a9a13[_0xa493('0x1e')]({'lastMsgAt':_0x504aac[_0xa493('0x1f')],'lastMsgDirection':_0x504aac[_0xa493('0x17')][_0xa493('0x18')]()});}})[_0xa493('0x20')](function(_0x40b788){console[_0xa493('0x21')](_0x40b788);});}_0x2bc2db();}},'charset':_0xa493('0x22'),'collate':_0xa493('0x23')});}; \ No newline at end of file +var _0x0f29=['then','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','get','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne'];(function(_0x9033c9,_0x519986){var _0x4fe710=function(_0x1e933f){while(--_0x1e933f){_0x9033c9['push'](_0x9033c9['shift']());}};_0x4fe710(++_0x519986);}(_0x0f29,0x14f));var _0x90f2=function(_0x3b06c1,_0x17eba6){_0x3b06c1=_0x3b06c1-0x0;var _0x1b8e9c=_0x0f29[_0x3b06c1];return _0x1b8e9c;};'use strict';var _=require(_0x90f2('0x0'));var util=require(_0x90f2('0x1'));var logger=require(_0x90f2('0x2'))(_0x90f2('0x3'));var moment=require('moment');var BPromise=require(_0x90f2('0x4'));var rp=require(_0x90f2('0x5'));var htmlToText=require(_0x90f2('0x6'));var fs=require('fs');var path=require(_0x90f2('0x7'));var rimraf=require(_0x90f2('0x8'));var config=require(_0x90f2('0x9'));var attributes=require(_0x90f2('0xa'));module['exports']=function(_0x486c51,_0x1762ed){return _0x486c51[_0x90f2('0xb')](_0x90f2('0xc'),attributes,{'tableName':_0x90f2('0xd'),'paranoid':![],'indexes':[{'name':_0x90f2('0xe'),'fields':[_0x90f2('0xe')]},{'name':_0x90f2('0xf'),'fields':[_0x90f2('0x10'),_0x90f2('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x10e246,_0x1e12b1,_0x9be5c7){if(_0x10e246[_0x90f2('0x12')]){_0x10e246[_0x90f2('0x10')]=htmlToText[_0x90f2('0x13')](_0x10e246[_0x90f2('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x9be5c7(null,_0x1e12b1);},'afterCreate':function(_0x1de085,_0x3a809f,_0x22b4ef){var _0x3f1d03=_0x486c51['models'];var _0x9f0b9f=_0x1de085[_0x90f2('0x14')]({'plain':!![]});if(_0x9f0b9f[_0x90f2('0x15')]['toLowerCase']()==='in'||_0x9f0b9f['direction'][_0x90f2('0x16')]()===_0x90f2('0x17')&&!_0x9f0b9f['secret']&&!_[_0x90f2('0x18')](_0x9f0b9f[_0x90f2('0x19')])){_0x3f1d03[_0x90f2('0x1a')][_0x90f2('0x1b')]({'where':{'id':_0x9f0b9f['MailInteractionId']}})[_0x90f2('0x1c')](function(_0x54cdcd){if(_0x54cdcd){_0x54cdcd[_0x90f2('0x1d')]({'lastMsgAt':_0x9f0b9f['createdAt'],'lastMsgDirection':_0x9f0b9f[_0x90f2('0x15')][_0x90f2('0x16')]()});}})[_0x90f2('0x1e')](function(_0x4d7828){console['error'](_0x4d7828);});}_0x22b4ef();}},'charset':_0x90f2('0x1f'),'collate':_0x90f2('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 60259ef..b1ed08f 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 _0xb9be=['redis','localhost','socket.io-emitter','./mailMessage.socket','register','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateMailMessage','MailMessage','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults'];(function(_0x1f1e31,_0x27b5c3){var _0x229b56=function(_0x16db77){while(--_0x16db77){_0x1f1e31['push'](_0x1f1e31['shift']());}};_0x229b56(++_0x27b5c3);}(_0xb9be,0xc5));var _0xeb9b=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0xb9be[_0x2ff762];return _0x158b02;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require(_0xeb9b('0x5'));var db=require(_0xeb9b('0x6'))['db'];var utils=require(_0xeb9b('0x7'));var logger=require(_0xeb9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9b('0x9'));var client=jayson[_0xeb9b('0xa')][_0xeb9b('0xb')]({'port':0x232a});config['redis']=_[_0xeb9b('0xc')](config[_0xeb9b('0xd')],{'host':_0xeb9b('0xe'),'port':0x18eb});var socket=require(_0xeb9b('0xf'))(new Redis(config[_0xeb9b('0xd')]));require(_0xeb9b('0x10'))[_0xeb9b('0x11')](socket);function respondWithRpcPromise(_0x16761a,_0x32f0c4,_0x4f4952){return new BPromise(function(_0x20c855,_0x58d6a4){return client['request'](_0x16761a,_0x4f4952)[_0xeb9b('0x12')](function(_0x4236c0){logger['info'](_0xeb9b('0x13'),_0x32f0c4,_0xeb9b('0x14'));logger[_0xeb9b('0x15')](_0xeb9b('0x16'),_0x32f0c4,'request\x20sent',JSON['stringify'](_0x4236c0));if(_0x4236c0['error']){if(_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x18')]===0x1f4){logger[_0xeb9b('0x17')]('MailMessage,\x20%s,\x20%s',_0x32f0c4,_0x4236c0['error']['message']);return _0x58d6a4(_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x19')]);}logger[_0xeb9b('0x17')](_0xeb9b('0x13'),_0x32f0c4,_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x19')]);return _0x20c855(_0x4236c0[_0xeb9b('0x17')]['message']);}else{logger[_0xeb9b('0x1a')](_0xeb9b('0x13'),_0x32f0c4,_0xeb9b('0x14'));_0x20c855(_0x4236c0[_0xeb9b('0x1b')][_0xeb9b('0x19')]);}})[_0xeb9b('0x1c')](function(_0x21010e){logger[_0xeb9b('0x17')](_0xeb9b('0x13'),_0x32f0c4,_0x21010e);_0x58d6a4(_0x21010e);});});}exports[_0xeb9b('0x1d')]=function(_0x4f436e){var _0x43dc48=this;return new Promise(function(_0x5a7ffd,_0x5d5f54){return db[_0xeb9b('0x1e')][_0xeb9b('0x1f')](_0x4f436e['body'],{'raw':_0x4f436e[_0xeb9b('0x20')]?_0x4f436e[_0xeb9b('0x20')][_0xeb9b('0x21')]===undefined?!![]:![]:!![]})[_0xeb9b('0x12')](function(_0x3c8be7){logger[_0xeb9b('0x1a')](_0xeb9b('0x1d'),_0x4f436e);logger[_0xeb9b('0x15')](_0xeb9b('0x1d'),_0x4f436e,JSON[_0xeb9b('0x22')](_0x3c8be7));_0x5a7ffd(_0x3c8be7);})[_0xeb9b('0x1c')](function(_0x296f95){logger[_0xeb9b('0x17')](_0xeb9b('0x1d'),_0x296f95[_0xeb9b('0x19')],_0x4f436e);_0x5d5f54(_0x43dc48[_0xeb9b('0x17')](0x1f4,_0x296f95['message']));});});}; \ No newline at end of file +var _0x8603=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','./mailMessage.socket','register','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','then','util','moment','bluebird'];(function(_0xab2f5d,_0x178519){var _0x27d439=function(_0x2ed694){while(--_0x2ed694){_0xab2f5d['push'](_0xab2f5d['shift']());}};_0x27d439(++_0x178519);}(_0x8603,0x190));var _0x3860=function(_0x547fcb,_0x8fda67){_0x547fcb=_0x547fcb-0x0;var _0x275d17=_0x8603[_0x547fcb];return _0x275d17;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});config[_0x3860('0x9')]=_[_0x3860('0xa')](config[_0x3860('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3860('0xb'))[_0x3860('0xc')](socket);function respondWithRpcPromise(_0x52c277,_0x2fb169,_0x38737e){return new BPromise(function(_0x5909b8,_0x101263){return client[_0x3860('0xd')](_0x52c277,_0x38737e)['then'](function(_0x365579){logger[_0x3860('0xe')]('MailMessage,\x20%s,\x20%s',_0x2fb169,_0x3860('0xf'));logger[_0x3860('0x10')](_0x3860('0x11'),_0x2fb169,_0x3860('0xf'),JSON[_0x3860('0x12')](_0x365579));if(_0x365579[_0x3860('0x13')]){if(_0x365579[_0x3860('0x13')][_0x3860('0x14')]===0x1f4){logger[_0x3860('0x13')](_0x3860('0x15'),_0x2fb169,_0x365579['error'][_0x3860('0x16')]);return _0x101263(_0x365579[_0x3860('0x13')][_0x3860('0x16')]);}logger[_0x3860('0x13')](_0x3860('0x15'),_0x2fb169,_0x365579[_0x3860('0x13')][_0x3860('0x16')]);return _0x5909b8(_0x365579[_0x3860('0x13')][_0x3860('0x16')]);}else{logger[_0x3860('0xe')](_0x3860('0x15'),_0x2fb169,_0x3860('0xf'));_0x5909b8(_0x365579['result']['message']);}})[_0x3860('0x17')](function(_0x41ce59){logger[_0x3860('0x13')]('MailMessage,\x20%s,\x20%s',_0x2fb169,_0x41ce59);_0x101263(_0x41ce59);});});}exports[_0x3860('0x18')]=function(_0x145b26){var _0x22e873=this;return new Promise(function(_0x3af33a,_0x20a5b0){return db[_0x3860('0x19')][_0x3860('0x1a')](_0x145b26[_0x3860('0x1b')],{'raw':_0x145b26[_0x3860('0x1c')]?_0x145b26[_0x3860('0x1c')][_0x3860('0x1d')]===undefined?!![]:![]:!![]})[_0x3860('0x1e')](function(_0x280ea9){logger[_0x3860('0xe')](_0x3860('0x18'),_0x145b26);logger['debug'](_0x3860('0x18'),_0x145b26,JSON[_0x3860('0x12')](_0x280ea9));_0x3af33a(_0x280ea9);})[_0x3860('0x17')](function(_0x301e03){logger[_0x3860('0x13')]('CreateMailMessage',_0x301e03[_0x3860('0x16')],_0x145b26);_0x20a5b0(_0x22e873['error'](0x1f4,_0x301e03['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 25184a2..2acd3ae 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 _0x0141=['emit','register','mailMessage:','save','remove'];(function(_0x36dade,_0x4c3093){var _0x4b76b3=function(_0x5d9dcb){while(--_0x5d9dcb){_0x36dade['push'](_0x36dade['shift']());}};_0x4b76b3(++_0x4c3093);}(_0x0141,0x107));var _0x1014=function(_0xd9e9,_0x4f1ec9){_0xd9e9=_0xd9e9-0x0;var _0xd0a774=_0x0141[_0xd9e9];return _0xd0a774;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x1014('0x0'),_0x1014('0x1'),'update'];function createListener(_0x533169,_0xb89de7){return function(_0x57e8c2){_0xb89de7[_0x1014('0x2')](_0x533169,_0x57e8c2);};}function removeListener(_0x28e698,_0x5de84a){return function(){MailMessageEvents['removeListener'](_0x28e698,_0x5de84a);};}exports[_0x1014('0x3')]=function(_0x1afa28){for(var _0x52a5d0=0x0,_0x11f9a8=events['length'];_0x52a5d0<_0x11f9a8;_0x52a5d0++){var _0x6d486f=events[_0x52a5d0];var _0x3c613c=createListener(_0x1014('0x4')+_0x6d486f,_0x1afa28);MailMessageEvents['on'](_0x6d486f,_0x3c613c);}}; \ No newline at end of file +var _0x6d0b=['remove','emit','removeListener','length','mailMessage:','./mailMessage.events'];(function(_0x489f4d,_0x52b620){var _0xc535da=function(_0x232ab5){while(--_0x232ab5){_0x489f4d['push'](_0x489f4d['shift']());}};_0xc535da(++_0x52b620);}(_0x6d0b,0x71));var _0xb6d0=function(_0x1e430a,_0x5c1da3){_0x1e430a=_0x1e430a-0x0;var _0x3e19da=_0x6d0b[_0x1e430a];return _0x3e19da;};'use strict';var MailMessageEvents=require(_0xb6d0('0x0'));var events=['save',_0xb6d0('0x1'),'update'];function createListener(_0x15490e,_0x26ff2e){return function(_0x15fea3){_0x26ff2e[_0xb6d0('0x2')](_0x15490e,_0x15fea3);};}function removeListener(_0x293a26,_0x374a27){return function(){MailMessageEvents[_0xb6d0('0x3')](_0x293a26,_0x374a27);};}exports['register']=function(_0x35142b){for(var _0x3612ac=0x0,_0x23217f=events[_0xb6d0('0x4')];_0x3612ac<_0x23217f;_0x3612ac++){var _0x440414=events[_0x3612ac];var _0x2e41cf=createListener(_0xb6d0('0x5')+_0x440414,_0x35142b);MailMessageEvents['on'](_0x440414,_0x2e41cf);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 41c466b..9d484f5 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 _0xe43e=['../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','path','express','../../components/auth/service'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xe43e,0x1d8));var _0xee43=function(_0x51b362,_0x2a3af3){_0x51b362=_0x51b362-0x0;var _0x18bd6=_0xe43e[_0x51b362];return _0x18bd6;};'use strict';var multer=require(_0xee43('0x0'));var util=require('util');var path=require(_0xee43('0x1'));var timeout=require('connect-timeout');var express=require(_0xee43('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xee43('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xee43('0x4'));var controller=require(_0xee43('0x5'));router[_0xee43('0x6')]('/',auth[_0xee43('0x7')](),controller[_0xee43('0x8')]);router[_0xee43('0x6')](_0xee43('0x9'),auth[_0xee43('0x7')](),controller[_0xee43('0xa')]);router[_0xee43('0x6')](_0xee43('0xb'),auth['isAuthenticated'](),controller[_0xee43('0xc')]);router[_0xee43('0x6')](_0xee43('0xd'),auth[_0xee43('0x7')](),controller[_0xee43('0xe')]);router[_0xee43('0x6')](_0xee43('0xf'),auth[_0xee43('0x7')](),controller[_0xee43('0x10')]);router['get'](_0xee43('0x11'),auth[_0xee43('0x7')](),controller['getAgents']);router[_0xee43('0x12')]('/',auth[_0xee43('0x7')](),controller[_0xee43('0x13')]);router[_0xee43('0x12')](_0xee43('0xf'),auth[_0xee43('0x7')](),controller[_0xee43('0x14')]);router[_0xee43('0x12')](_0xee43('0x11'),auth[_0xee43('0x7')](),controller[_0xee43('0x15')]);router[_0xee43('0x16')]('/:id',auth[_0xee43('0x7')](),controller[_0xee43('0x17')]);router[_0xee43('0x18')](_0xee43('0xb'),auth[_0xee43('0x7')](),controller['destroy']);router[_0xee43('0x18')](_0xee43('0xf'),auth[_0xee43('0x7')](),controller[_0xee43('0x19')]);router[_0xee43('0x18')](_0xee43('0x11'),auth[_0xee43('0x7')](),controller[_0xee43('0x1a')]);module[_0xee43('0x1b')]=router; \ No newline at end of file +var _0xd4f5=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','path'];(function(_0x169732,_0x43e683){var _0x43bb67=function(_0x2c3fac){while(--_0x2c3fac){_0x169732['push'](_0x169732['shift']());}};_0x43bb67(++_0x43e683);}(_0xd4f5,0xa6));var _0x5d4f=function(_0xa1e2fd,_0x1c9305){_0xa1e2fd=_0xa1e2fd-0x0;var _0x218880=_0xd4f5[_0xa1e2fd];return _0x218880;};'use strict';var multer=require(_0x5d4f('0x0'));var util=require('util');var path=require(_0x5d4f('0x1'));var timeout=require(_0x5d4f('0x2'));var express=require(_0x5d4f('0x3'));var router=express['Router']();var fs_extra=require(_0x5d4f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5d4f('0x5'));var config=require(_0x5d4f('0x6'));var controller=require('./mailQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5d4f('0x7')]);router['get'](_0x5d4f('0x8'),auth[_0x5d4f('0x9')](),controller[_0x5d4f('0xa')]);router[_0x5d4f('0xb')](_0x5d4f('0xc'),auth[_0x5d4f('0x9')](),controller[_0x5d4f('0xd')]);router[_0x5d4f('0xb')](_0x5d4f('0xe'),auth[_0x5d4f('0x9')](),controller[_0x5d4f('0xf')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0x5d4f('0xb')](_0x5d4f('0x10'),auth['isAuthenticated'](),controller[_0x5d4f('0x11')]);router['post']('/',auth[_0x5d4f('0x9')](),controller['create']);router[_0x5d4f('0x12')](_0x5d4f('0x13'),auth[_0x5d4f('0x9')](),controller[_0x5d4f('0x14')]);router[_0x5d4f('0x12')](_0x5d4f('0x10'),auth[_0x5d4f('0x9')](),controller[_0x5d4f('0x15')]);router[_0x5d4f('0x16')](_0x5d4f('0xc'),auth[_0x5d4f('0x9')](),controller[_0x5d4f('0x17')]);router[_0x5d4f('0x18')](_0x5d4f('0xc'),auth[_0x5d4f('0x9')](),controller['destroy']);router[_0x5d4f('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5d4f('0x19')]);router[_0x5d4f('0x18')](_0x5d4f('0x10'),auth['isAuthenticated'](),controller[_0x5d4f('0x1a')]);module[_0x5d4f('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 3fda637..32221b2 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 _0xe2d0=['name','STRING','INTEGER','ENUM','rrmemory','exports'];(function(_0x5219c0,_0x2fa7ea){var _0x1a4b35=function(_0x3606f5){while(--_0x3606f5){_0x5219c0['push'](_0x5219c0['shift']());}};_0x1a4b35(++_0x2fa7ea);}(_0xe2d0,0xcb));var _0x0e2d=function(_0x27c7df,_0xa21fc0){_0x27c7df=_0x27c7df-0x0;var _0x19851a=_0xe2d0[_0x27c7df];return _0x19851a;};'use strict';var Sequelize=require('sequelize');module[_0x0e2d('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x0e2d('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0e2d('0x2')]},'timeout':{'type':Sequelize[_0x0e2d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0e2d('0x4')](_0x0e2d('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x3a29=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3a29,0x12f));var _0x93a2=function(_0x13a783,_0x356125){_0x13a783=_0x13a783-0x0;var _0x349fe6=_0x3a29[_0x13a783];return _0x349fe6;};'use strict';var Sequelize=require(_0x93a2('0x0'));module[_0x93a2('0x1')]={'name':{'type':Sequelize[_0x93a2('0x2')],'unique':_0x93a2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x93a2('0x2')]},'timeout':{'type':Sequelize[_0x93a2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x93a2('0x5'),_0x93a2('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index a0cce23..98fd78e 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 _0x1bb2=['includeAll','include','find','catch','create','body','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserMailQueue','sort','MailQueueId','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','SIP','getTeams','findOne','hasOwnProperty','ids','Team','Agents','online','voicePause','flatMap','sequelize','transaction','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','union','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','nolimit','order','where','pick','filter','merge','options','findAll','rows','show','params','fields'];(function(_0x3ef63b,_0x44a205){var _0x434220=function(_0x2f91c2){while(--_0x2f91c2){_0x3ef63b['push'](_0x3ef63b['shift']());}};_0x434220(++_0x44a205);}(_0x1bb2,0x152));var _0x21bb=function(_0x396d0a,_0x324fc1){_0x396d0a=_0x396d0a-0x0;var _0x44e447=_0x1bb2[_0x396d0a];return _0x44e447;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x21bb('0x0'));var zipdir=require(_0x21bb('0x1'));var jsonpatch=require(_0x21bb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x21bb('0x3'));var Mustache=require(_0x21bb('0x4'));var util=require(_0x21bb('0x5'));var path=require(_0x21bb('0x6'));var sox=require(_0x21bb('0x7'));var csv=require(_0x21bb('0x8'));var ejs=require(_0x21bb('0x9'));var fs=require('fs');var fs_extra=require(_0x21bb('0xa'));var _=require(_0x21bb('0xb'));var squel=require(_0x21bb('0xc'));var crypto=require(_0x21bb('0xd'));var jsforce=require(_0x21bb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x21bb('0x8'));var querystring=require('querystring');var Papa=require(_0x21bb('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x21bb('0x10'));var as=require(_0x21bb('0x11'));var hardwareService=require(_0x21bb('0x12'));var logger=require(_0x21bb('0x13'))(_0x21bb('0x14'));var utils=require(_0x21bb('0x15'));var config=require(_0x21bb('0x16'));var licenseUtil=require(_0x21bb('0x17'));var db=require('../../mysqldb')['db'];config[_0x21bb('0x18')]=_[_0x21bb('0x19')](config['redis'],{'host':_0x21bb('0x1a'),'port':0x18eb});var socket=require(_0x21bb('0x1b'))(new Redis(config['redis']));require(_0x21bb('0x1c'))[_0x21bb('0x1d')](socket);function respondWithStatusCode(_0x3444e1,_0x3fd2d9){_0x3fd2d9=_0x3fd2d9||0xcc;return function(_0x5a66d5){if(_0x5a66d5){return _0x3444e1[_0x21bb('0x1e')](_0x3fd2d9);}return _0x3444e1['status'](_0x3fd2d9)['end']();};}function respondWithResult(_0x18daa7,_0x1ef9a5){_0x1ef9a5=_0x1ef9a5||0xc8;return function(_0x2a8656){if(_0x2a8656){return _0x18daa7[_0x21bb('0x1f')](_0x1ef9a5)[_0x21bb('0x20')](_0x2a8656);}};}function respondWithFilteredResult(_0x412d50,_0x3497cf){return function(_0x15fc36){if(_0x15fc36){var _0x4393d8=typeof _0x3497cf[_0x21bb('0x21')]===_0x21bb('0x22')&&typeof _0x3497cf['limit']===_0x21bb('0x22');var _0x159ac6=_0x15fc36[_0x21bb('0x23')];var _0x4a2afe=_0x4393d8?0x0:_0x3497cf[_0x21bb('0x21')];var _0x3a5ae2=_0x4393d8?_0x15fc36[_0x21bb('0x23')]:_0x3497cf[_0x21bb('0x21')]+_0x3497cf[_0x21bb('0x24')];var _0x44930d;if(_0x3a5ae2>=_0x159ac6){_0x3a5ae2=_0x159ac6;_0x44930d=0xc8;}else{_0x44930d=0xce;}_0x412d50[_0x21bb('0x1f')](_0x44930d);return _0x412d50[_0x21bb('0x25')](_0x21bb('0x26'),_0x4a2afe+'-'+_0x3a5ae2+'/'+_0x159ac6)[_0x21bb('0x20')](_0x15fc36);}return null;};}function patchUpdates(_0x9f93a7){return function(_0xf209cd){try{jsonpatch['apply'](_0xf209cd,_0x9f93a7,!![]);}catch(_0x353019){return BPromise[_0x21bb('0x27')](_0x353019);}return _0xf209cd[_0x21bb('0x28')]();};}function saveUpdates(_0x490266,_0x35a313){return function(_0x53a3bf){if(_0x53a3bf){return _0x53a3bf[_0x21bb('0x29')](_0x490266)[_0x21bb('0x2a')](function(_0x40d801){return _0x40d801;});}return null;};}function removeEntity(_0x3239e2,_0x112412){return function(_0x14c336){if(_0x14c336){return _0x14c336['destroy']()[_0x21bb('0x2a')](function(){var _0xed3ab2=_0x14c336[_0x21bb('0x2b')]({'plain':!![]});var _0x3d5571='MailQueues';return db[_0x21bb('0x2c')][_0x21bb('0x2d')]({'where':{'type':_0x3d5571,'resourceId':_0xed3ab2['id']}})[_0x21bb('0x2a')](function(){return _0x14c336;});})[_0x21bb('0x2a')](function(){_0x3239e2[_0x21bb('0x1f')](0xcc)[_0x21bb('0x2e')]();});}};}function handleEntityNotFound(_0x20de34,_0x256974){return function(_0x5c5cae){if(!_0x5c5cae){_0x20de34[_0x21bb('0x1e')](0x194);}return _0x5c5cae;};}function handleError(_0xfd3327,_0x4fc34d){_0x4fc34d=_0x4fc34d||0x1f4;return function(_0x75418b){logger[_0x21bb('0x2f')](_0x75418b[_0x21bb('0x30')]);if(_0x75418b['name']){delete _0x75418b[_0x21bb('0x31')];}_0xfd3327['status'](_0x4fc34d)[_0x21bb('0x32')](_0x75418b);};}exports[_0x21bb('0x33')]=function(_0xa113b0,_0x3c58d5){var _0x5713d8={},_0x32b374={},_0x24dac3={'count':0x0,'rows':[]};var _0x496cb9=_[_0x21bb('0x34')](db[_0x21bb('0x35')][_0x21bb('0x36')],function(_0x390fa0){return{'name':_0x390fa0[_0x21bb('0x37')],'type':_0x390fa0[_0x21bb('0x38')]['key']};});_0x32b374[_0x21bb('0x39')]=_[_0x21bb('0x34')](_0x496cb9,'name');_0x32b374[_0x21bb('0x3a')]=_[_0x21bb('0x3b')](_0xa113b0['query']);_0x32b374[_0x21bb('0x3c')]=_[_0x21bb('0x3d')](_0x32b374[_0x21bb('0x39')],_0x32b374[_0x21bb('0x3a')]);_0x5713d8['attributes']=_['intersection'](_0x32b374[_0x21bb('0x39')],qs['fields'](_0xa113b0[_0x21bb('0x3a')]['fields']));_0x5713d8[_0x21bb('0x3e')]=_0x5713d8[_0x21bb('0x3e')][_0x21bb('0x3f')]?_0x5713d8[_0x21bb('0x3e')]:_0x32b374[_0x21bb('0x39')];if(!_0xa113b0['query']['hasOwnProperty'](_0x21bb('0x40'))){_0x5713d8[_0x21bb('0x24')]=qs[_0x21bb('0x24')](_0xa113b0[_0x21bb('0x3a')][_0x21bb('0x24')]);_0x5713d8['offset']=qs['offset'](_0xa113b0[_0x21bb('0x3a')][_0x21bb('0x21')]);}_0x5713d8[_0x21bb('0x41')]=qs['sort'](_0xa113b0[_0x21bb('0x3a')]['sort']);_0x5713d8[_0x21bb('0x42')]=qs[_0x21bb('0x3c')](_[_0x21bb('0x43')](_0xa113b0['query'],_0x32b374['filters']),_0x496cb9);if(_0xa113b0[_0x21bb('0x3a')][_0x21bb('0x44')]){_0x5713d8[_0x21bb('0x42')]=_[_0x21bb('0x45')](_0x5713d8['where'],{'$or':_[_0x21bb('0x34')](_0x496cb9,function(_0x3be21e){if(_0x3be21e['type']!=='VIRTUAL'){var _0x479a5f={};_0x479a5f[_0x3be21e[_0x21bb('0x31')]]={'$like':'%'+_0xa113b0[_0x21bb('0x3a')][_0x21bb('0x44')]+'%'};return _0x479a5f;}})});}_0x5713d8=_[_0x21bb('0x45')]({},_0x5713d8,_0xa113b0[_0x21bb('0x46')]);var _0x13565e={'where':_0x5713d8[_0x21bb('0x42')]};return db[_0x21bb('0x35')][_0x21bb('0x23')](_0x13565e)['then'](function(_0x205814){_0x24dac3[_0x21bb('0x23')]=_0x205814;if(_0xa113b0[_0x21bb('0x3a')]['includeAll']){_0x5713d8['include']=[{'all':!![]}];}return db['MailQueue'][_0x21bb('0x47')](_0x5713d8);})['then'](function(_0x27c5e6){_0x24dac3[_0x21bb('0x48')]=_0x27c5e6;return _0x24dac3;})[_0x21bb('0x2a')](respondWithFilteredResult(_0x3c58d5,_0x5713d8))['catch'](handleError(_0x3c58d5,null));};exports[_0x21bb('0x49')]=function(_0x59d02d,_0x1bb574){var _0x2eed3b={'raw':!![],'where':{'id':_0x59d02d[_0x21bb('0x4a')]['id']}},_0x5c714f={};_0x5c714f[_0x21bb('0x39')]=_[_0x21bb('0x3b')](db[_0x21bb('0x35')][_0x21bb('0x36')]);_0x5c714f[_0x21bb('0x3a')]=_[_0x21bb('0x3b')](_0x59d02d['query']);_0x5c714f[_0x21bb('0x3c')]=_['intersection'](_0x5c714f['model'],_0x5c714f['query']);_0x2eed3b[_0x21bb('0x3e')]=_[_0x21bb('0x3d')](_0x5c714f[_0x21bb('0x39')],qs[_0x21bb('0x4b')](_0x59d02d[_0x21bb('0x3a')][_0x21bb('0x4b')]));_0x2eed3b[_0x21bb('0x3e')]=_0x2eed3b[_0x21bb('0x3e')][_0x21bb('0x3f')]?_0x2eed3b[_0x21bb('0x3e')]:_0x5c714f[_0x21bb('0x39')];if(_0x59d02d['query'][_0x21bb('0x4c')]){_0x2eed3b[_0x21bb('0x4d')]=[{'all':!![]}];}_0x2eed3b=_[_0x21bb('0x45')]({},_0x2eed3b,_0x59d02d[_0x21bb('0x46')]);return db[_0x21bb('0x35')][_0x21bb('0x4e')](_0x2eed3b)[_0x21bb('0x2a')](handleEntityNotFound(_0x1bb574,null))['then'](respondWithResult(_0x1bb574,null))[_0x21bb('0x4f')](handleError(_0x1bb574,null));};exports[_0x21bb('0x50')]=function(_0x2c7e54,_0x20e7ad){return db[_0x21bb('0x35')]['create'](_0x2c7e54[_0x21bb('0x51')],{})[_0x21bb('0x2a')](function(_0x2f40ba){var _0x348c42=_0x2c7e54['user'][_0x21bb('0x2b')]({'plain':!![]});if(!_0x348c42)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x348c42[_0x21bb('0x52')]===_0x21bb('0x53')){var _0xaa8fc2=_0x2f40ba[_0x21bb('0x2b')]({'plain':!![]});var _0xd33150='MailQueues';return db['UserProfileSection'][_0x21bb('0x4e')]({'where':{'name':_0xd33150,'userProfileId':_0x348c42[_0x21bb('0x54')]},'raw':!![]})[_0x21bb('0x2a')](function(_0x150c21){if(_0x150c21&&_0x150c21[_0x21bb('0x55')]===0x0){return db[_0x21bb('0x2c')][_0x21bb('0x50')]({'name':_0xaa8fc2[_0x21bb('0x31')],'resourceId':_0xaa8fc2['id'],'type':_0x150c21[_0x21bb('0x31')],'sectionId':_0x150c21['id']},{})[_0x21bb('0x2a')](function(){return _0x2f40ba;});}else{return _0x2f40ba;}})[_0x21bb('0x4f')](function(_0x5b3a3c){logger[_0x21bb('0x2f')](_0x21bb('0x56'),_0x5b3a3c);throw _0x5b3a3c;});}return _0x2f40ba;})[_0x21bb('0x2a')](respondWithResult(_0x20e7ad,0xc9))[_0x21bb('0x4f')](handleError(_0x20e7ad,null));};exports[_0x21bb('0x29')]=function(_0xf851c6,_0x5eb8cd){if(_0xf851c6[_0x21bb('0x51')]['id']){delete _0xf851c6[_0x21bb('0x51')]['id'];}return db['MailQueue'][_0x21bb('0x4e')]({'where':{'id':_0xf851c6['params']['id']}})[_0x21bb('0x2a')](handleEntityNotFound(_0x5eb8cd,null))[_0x21bb('0x2a')](saveUpdates(_0xf851c6[_0x21bb('0x51')],null))['then'](respondWithResult(_0x5eb8cd,null))[_0x21bb('0x4f')](handleError(_0x5eb8cd,null));};exports[_0x21bb('0x2d')]=function(_0x3c7a93,_0x35aa62){return db[_0x21bb('0x35')][_0x21bb('0x4e')]({'where':{'id':_0x3c7a93[_0x21bb('0x4a')]['id']}})[_0x21bb('0x2a')](handleEntityNotFound(_0x35aa62,null))[_0x21bb('0x2a')](removeEntity(_0x35aa62,null))['catch'](handleError(_0x35aa62,null));};exports[_0x21bb('0x57')]=function(_0x174969,_0x217030){return db[_0x21bb('0x35')][_0x21bb('0x57')]()[_0x21bb('0x2a')](respondWithResult(_0x217030,null))['catch'](handleError(_0x217030,null));};exports['getMembers']=function(_0x14e2f5,_0x23f048,_0x1d83d5){var _0x3bdca4={'raw':!![],'where':{}},_0x5d7bb4={},_0x5e427c;return db[_0x21bb('0x35')]['findOne']({'where':{'id':_0x14e2f5['params']['id']}})[_0x21bb('0x2a')](handleEntityNotFound(_0x23f048,null))[_0x21bb('0x2a')](function(_0x106d69){if(_0x106d69){_0x5e427c=_0x106d69[_0x21bb('0x2b')]({'plain':!![]});_0x5d7bb4[_0x21bb('0x39')]=_[_0x21bb('0x3b')](db[_0x21bb('0x58')]['rawAttributes']);_0x5d7bb4[_0x21bb('0x3a')]=_[_0x21bb('0x3b')](_0x14e2f5[_0x21bb('0x3a')]);_0x5d7bb4['filters']=_['intersection'](_0x5d7bb4[_0x21bb('0x39')],_0x5d7bb4[_0x21bb('0x3a')]);_0x3bdca4[_0x21bb('0x3e')]=_[_0x21bb('0x3d')](_0x5d7bb4['model'],qs[_0x21bb('0x4b')](_0x14e2f5['query']['fields']));_0x3bdca4[_0x21bb('0x3e')]=_0x3bdca4[_0x21bb('0x3e')][_0x21bb('0x3f')]?_0x3bdca4[_0x21bb('0x3e')]:_0x5d7bb4['model'];if(!_0x14e2f5[_0x21bb('0x3a')]['hasOwnProperty'](_0x21bb('0x40'))){_0x3bdca4[_0x21bb('0x24')]=qs[_0x21bb('0x24')](_0x14e2f5[_0x21bb('0x3a')][_0x21bb('0x24')]);_0x3bdca4[_0x21bb('0x21')]=qs[_0x21bb('0x21')](_0x14e2f5[_0x21bb('0x3a')]['offset']);}_0x3bdca4[_0x21bb('0x41')]=qs[_0x21bb('0x59')](_0x14e2f5[_0x21bb('0x3a')]['sort']);_0x3bdca4[_0x21bb('0x42')]=qs['filters'](_[_0x21bb('0x43')](_0x14e2f5[_0x21bb('0x3a')],_0x5d7bb4[_0x21bb('0x3c')]));_0x3bdca4['where'][_0x21bb('0x5a')]=_0x106d69['id'];if(_0x14e2f5[_0x21bb('0x3a')][_0x21bb('0x44')]){_0x3bdca4[_0x21bb('0x42')]=_[_0x21bb('0x45')](_0x3bdca4['where'],{'$or':_['map'](_0x3bdca4[_0x21bb('0x3e')],function(_0x356dd6){var _0x318120={};_0x318120[_0x356dd6]={'$like':'%'+_0x14e2f5[_0x21bb('0x3a')][_0x21bb('0x44')]+'%'};return _0x318120;})});}_0x3bdca4=_['merge']({},_0x3bdca4,_0x14e2f5[_0x21bb('0x46')]);return db[_0x21bb('0x58')][_0x21bb('0x47')](_0x3bdca4);}})[_0x21bb('0x2a')](function(_0x4bb733){if(_0x4bb733){return db[_0x21bb('0x5b')][_0x21bb('0x5c')]({'where':{'id':_[_0x21bb('0x34')](_0x4bb733,_0x21bb('0x5d')),'role':'agent'},'attributes':['id','name',_0x21bb('0x5e'),_0x21bb('0x5f'),_0x21bb('0x60')]});}})['then'](function(_0x265ec2){if(_0x265ec2){return{'count':_0x265ec2[_0x21bb('0x23')],'rows':_[_0x21bb('0x34')](_0x265ec2[_0x21bb('0x48')],function(_0x2b1cf4){return{'membername':_0x2b1cf4['name'],'UserId':_0x2b1cf4['id'],'queue_name':_0x5e427c[_0x21bb('0x31')],'MailQueueId':_0x5e427c['id'],'interface':util['format']('%s/%s',_0x21bb('0x61'),_0x2b1cf4[_0x21bb('0x31')]),'penalty':0x0,'paused':_0x2b1cf4[_0x21bb('0x5e')],'createdAt':_0x2b1cf4[_0x21bb('0x60')],'updatedAt':_0x2b1cf4['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x21bb('0x2a')](respondWithFilteredResult(_0x23f048,_0x3bdca4))['catch'](handleError(_0x23f048,null));};exports[_0x21bb('0x62')]=function(_0x2b1b95,_0x5a5d59,_0x40dafd){var _0x25c725={};var _0x598fbb={};var _0xfac262;var _0x4d329e;return db[_0x21bb('0x35')][_0x21bb('0x63')]({'where':{'id':_0x2b1b95[_0x21bb('0x4a')]['id']}})[_0x21bb('0x2a')](handleEntityNotFound(_0x5a5d59,null))[_0x21bb('0x2a')](function(_0x19ff68){if(_0x19ff68){_0xfac262=_0x19ff68;_0x598fbb['model']=_[_0x21bb('0x3b')](db['Team']['rawAttributes']);_0x598fbb[_0x21bb('0x3a')]=_['keys'](_0x2b1b95[_0x21bb('0x3a')]);_0x598fbb[_0x21bb('0x3c')]=_[_0x21bb('0x3d')](_0x598fbb[_0x21bb('0x39')],_0x598fbb[_0x21bb('0x3a')]);_0x25c725[_0x21bb('0x3e')]=_[_0x21bb('0x3d')](_0x598fbb[_0x21bb('0x39')],qs[_0x21bb('0x4b')](_0x2b1b95[_0x21bb('0x3a')][_0x21bb('0x4b')]));_0x25c725[_0x21bb('0x3e')]=_0x25c725[_0x21bb('0x3e')][_0x21bb('0x3f')]?_0x25c725['attributes']:_0x598fbb[_0x21bb('0x39')];_0x25c725[_0x21bb('0x41')]=qs['sort'](_0x2b1b95[_0x21bb('0x3a')][_0x21bb('0x59')]);_0x25c725[_0x21bb('0x42')]=qs[_0x21bb('0x3c')](_[_0x21bb('0x43')](_0x2b1b95[_0x21bb('0x3a')],_0x598fbb[_0x21bb('0x3c')]));if(_0x2b1b95['query'][_0x21bb('0x44')]){_0x25c725[_0x21bb('0x42')]=_[_0x21bb('0x45')](_0x25c725[_0x21bb('0x42')],{'$or':_[_0x21bb('0x34')](_0x25c725['attributes'],function(_0x4aaae6){var _0x5f3de3={};_0x5f3de3[_0x4aaae6]={'$like':'%'+_0x2b1b95[_0x21bb('0x3a')][_0x21bb('0x44')]+'%'};return _0x5f3de3;})});}_0x25c725=_['merge']({},_0x25c725,_0x2b1b95[_0x21bb('0x46')]);return _0xfac262['getTeams'](_0x25c725);}})[_0x21bb('0x2a')](function(_0x480864){if(_0x480864){_0x4d329e=_0x480864[_0x21bb('0x3f')];if(!_0x2b1b95[_0x21bb('0x3a')][_0x21bb('0x64')](_0x21bb('0x40'))){_0x25c725[_0x21bb('0x24')]=qs[_0x21bb('0x24')](_0x2b1b95['query'][_0x21bb('0x24')]);_0x25c725[_0x21bb('0x21')]=qs[_0x21bb('0x21')](_0x2b1b95[_0x21bb('0x3a')][_0x21bb('0x21')]);}return _0xfac262[_0x21bb('0x62')](_0x25c725);}})[_0x21bb('0x2a')](function(_0x4f384e){if(_0x4f384e){return _0x4f384e?{'count':_0x4d329e,'rows':_0x4f384e}:null;}})[_0x21bb('0x2a')](respondWithResult(_0x5a5d59,null))['catch'](handleError(_0x5a5d59,null));};exports['addTeams']=function(_0x4f90ae,_0xb4a651,_0x300387){var _0x491730=_0x4f90ae[_0x21bb('0x51')][_0x21bb('0x65')];return db[_0x21bb('0x66')][_0x21bb('0x47')]({'where':{'id':_0x491730},'attributes':['id'],'include':[{'model':db[_0x21bb('0x5b')],'as':_0x21bb('0x67'),'attributes':['id',_0x21bb('0x31'),_0x21bb('0x68'),_0x21bb('0x69'),'interface'],'raw':!![]}]})[_0x21bb('0x2a')](function(_0x2c07cc){if(_0x2c07cc){var _0x818fbd=_[_0x21bb('0x6a')](_0x2c07cc,function(_0x38f305){var _0x1fe300=_0x38f305['get']({'plain':!![]});return _0x1fe300[_0x21bb('0x67')];});return db['MailQueue'][_0x21bb('0x4e')]({'where':{'id':_0x4f90ae[_0x21bb('0x4a')]['id']}})['then'](function(_0x1974d9){return db[_0x21bb('0x6b')][_0x21bb('0x6c')](function(_0xf3de70){return _0x1974d9['addTeams'](_0x491730,{'transaction':_0xf3de70})[_0x21bb('0x2a')](function(){return BPromise['each'](_0x818fbd,function(_0x5d5c0e){return db[_0x21bb('0x58')]['findOrCreate']({'where':{'UserId':_0x5d5c0e['id'],'MailQueueId':_0x4f90ae[_0x21bb('0x4a')]['id']},'transaction':_0xf3de70});});})[_0x21bb('0x2a')](function(){_0x818fbd['forEach'](function(_0x31ec14){socket[_0x21bb('0x6d')](_0x21bb('0x6e'),{'UserId':_0x31ec14['id'],'MailQueueId':_0x1974d9['id']});});});});});}})[_0x21bb('0x2a')](respondWithStatusCode(_0xb4a651,null))[_0x21bb('0x4f')](handleError(_0xb4a651,null));};exports[_0x21bb('0x6f')]=function(_0xee5071,_0x3b9bd4,_0x1d2e8d){return db[_0x21bb('0x66')][_0x21bb('0x47')]({'where':{'id':_0xee5071[_0x21bb('0x3a')][_0x21bb('0x65')]},'attributes':['id'],'include':[{'model':db[_0x21bb('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x21bb('0x2a')](handleEntityNotFound(_0x3b9bd4,null))[_0x21bb('0x2a')](function(_0x24c2b3){var _0x4ed386=_[_0x21bb('0x34')](_0x24c2b3,'id');var _0x3161f1=[];var _0x586d6c=[];var _0x13494f=squel[_0x21bb('0x70')]();_0x13494f[_0x21bb('0x71')](_0x21bb('0x72'))[_0x21bb('0x73')](_0x21bb('0x74'),'tq')['join'](_0x21bb('0x75'),'ut',_0x21bb('0x76'))[_0x21bb('0x42')](_0x21bb('0x77'),_0xee5071[_0x21bb('0x4a')]['id']);for(var _0x32a432=0x0;_0x32a432<_0x24c2b3['length'];_0x32a432+=0x1){let _0x460bc6=_0x24c2b3[_0x32a432];for(var _0x1a2f11=0x0;_0x1a2f11<_0x460bc6[_0x21bb('0x67')][_0x21bb('0x3f')];_0x1a2f11+=0x1){let _0x33a233=_0x460bc6['Agents'][_0x1a2f11];var _0x271cda=_0x13494f[_0x21bb('0x78')]();_0x271cda[_0x21bb('0x42')](_0x21bb('0x79'),_0x33a233['id']);_0x586d6c['push'](db[_0x21bb('0x6b')][_0x21bb('0x3a')](_0x271cda['toString'](),{'type':db[_0x21bb('0x6b')][_0x21bb('0x7a')][_0x21bb('0x7b')]})[_0x21bb('0x2a')](function(_0x1ec6f3){if(_0x1ec6f3[_0x21bb('0x3f')]===0x1){return _0x33a233['id'];}else{var _0x15e306=_[_0x21bb('0x7c')](_[_0x21bb('0x34')](_0x1ec6f3,_0x21bb('0x7d')),function(_0x4b9167){return _[_0x21bb('0x7e')](_0x4ed386,_0x4b9167);});if(_0x15e306){return _0x33a233['id'];}}}));}}return BPromise['all'](_0x586d6c)['then'](function(_0x45c5a7){_0x3161f1=_(_0x3161f1)[_0x21bb('0x7f')](_0x45c5a7)['compact']()[_0x21bb('0x80')]();return db[_0x21bb('0x35')][_0x21bb('0x4e')]({'where':{'id':_0xee5071['params']['id']}})[_0x21bb('0x2a')](function(_0x1e5b4c){return db[_0x21bb('0x6b')]['transaction'](function(_0x45f707){return _0x1e5b4c[_0x21bb('0x6f')](_0xee5071[_0x21bb('0x3a')][_0x21bb('0x65')],{'transaction':_0x45f707})[_0x21bb('0x2a')](function(){if(!_[_0x21bb('0x81')](_0x3161f1)){return _0x1e5b4c[_0x21bb('0x82')](_0x3161f1,{'transaction':_0x45f707});}})[_0x21bb('0x2a')](function(){_0x3161f1[_0x21bb('0x83')](function(_0x1a593e){socket[_0x21bb('0x6d')](_0x21bb('0x84'),{'UserId':_0x1a593e,'MailQueueId':_0x1e5b4c['id']});});});});});});})[_0x21bb('0x2a')](respondWithStatusCode(_0x3b9bd4,null))[_0x21bb('0x4f')](handleError(_0x3b9bd4,null));};exports[_0x21bb('0x85')]=function(_0xb518a8,_0x2dc7c6,_0x1890bc){return db[_0x21bb('0x35')][_0x21bb('0x4e')]({'where':{'id':_0xb518a8['params']['id']}})[_0x21bb('0x2a')](handleEntityNotFound(_0x2dc7c6,null))[_0x21bb('0x2a')](function(_0x4ac496){if(_0x4ac496){return _0x4ac496[_0x21bb('0x85')](_0xb518a8['body'][_0x21bb('0x65')],_[_0x21bb('0x86')](_0xb518a8[_0x21bb('0x51')],[_0x21bb('0x65'),'id'])||{})[_0x21bb('0x87')](function(_0x52bc58){for(var _0x4c6996=0x0;_0x4c6996<_0xb518a8[_0x21bb('0x51')][_0x21bb('0x65')][_0x21bb('0x3f')];_0x4c6996+=0x1){socket[_0x21bb('0x6d')](_0x21bb('0x6e'),{'UserId':Number(_0xb518a8['body'][_0x21bb('0x65')][_0x4c6996]),'MailQueueId':Number(_0xb518a8[_0x21bb('0x4a')]['id'])});}return _0x52bc58;});}})[_0x21bb('0x2a')](respondWithResult(_0x2dc7c6,null))[_0x21bb('0x4f')](handleError(_0x2dc7c6,null));};exports[_0x21bb('0x82')]=function(_0x432196,_0x1f4bbb,_0x29202b){return db[_0x21bb('0x35')][_0x21bb('0x4e')]({'where':{'id':_0x432196[_0x21bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1f4bbb,null))[_0x21bb('0x2a')](function(_0x1baee9){if(_0x1baee9){return _0x1baee9[_0x21bb('0x82')](_0x432196[_0x21bb('0x3a')][_0x21bb('0x65')])['then'](function(){if(_[_0x21bb('0x88')](_0x432196[_0x21bb('0x3a')][_0x21bb('0x65')])){for(var _0x5ef5dd=0x0;_0x5ef5dd<_0x432196[_0x21bb('0x3a')][_0x21bb('0x65')][_0x21bb('0x3f')];_0x5ef5dd+=0x1){socket[_0x21bb('0x6d')](_0x21bb('0x84'),{'UserId':Number(_0x432196['query'][_0x21bb('0x65')][_0x5ef5dd]),'MailQueueId':Number(_0x432196['params']['id'])});}}else{socket[_0x21bb('0x6d')](_0x21bb('0x84'),{'UserId':Number(_0x432196['query'][_0x21bb('0x65')]),'MailQueueId':Number(_0x432196['params']['id'])});}});}})[_0x21bb('0x2a')](respondWithStatusCode(_0x1f4bbb,null))[_0x21bb('0x4f')](handleError(_0x1f4bbb,null));};exports[_0x21bb('0x89')]=function(_0x880227,_0x3dc9ba,_0x3b3ed6){var _0x1749b8={};var _0x3e148c={};var _0x5d94b3;var _0x27a6a3;return db[_0x21bb('0x35')]['findOne']({'where':{'id':_0x880227['params']['id']}})[_0x21bb('0x2a')](handleEntityNotFound(_0x3dc9ba,null))[_0x21bb('0x2a')](function(_0x1cb57d){if(_0x1cb57d){_0x5d94b3=_0x1cb57d;_0x3e148c['model']=_[_0x21bb('0x3b')](db[_0x21bb('0x5b')][_0x21bb('0x36')]);_0x3e148c[_0x21bb('0x3a')]=_[_0x21bb('0x3b')](_0x880227[_0x21bb('0x3a')]);_0x3e148c[_0x21bb('0x3c')]=_[_0x21bb('0x3d')](_0x3e148c[_0x21bb('0x39')],_0x3e148c[_0x21bb('0x3a')]);_0x1749b8[_0x21bb('0x3e')]=_[_0x21bb('0x3d')](_0x3e148c[_0x21bb('0x39')],qs['fields'](_0x880227['query'][_0x21bb('0x4b')]));_0x1749b8[_0x21bb('0x3e')]=_0x1749b8[_0x21bb('0x3e')][_0x21bb('0x3f')]?_0x1749b8[_0x21bb('0x3e')]:_0x3e148c[_0x21bb('0x39')];_0x1749b8[_0x21bb('0x41')]=qs[_0x21bb('0x59')](_0x880227[_0x21bb('0x3a')][_0x21bb('0x59')]);_0x1749b8[_0x21bb('0x42')]=qs[_0x21bb('0x3c')](_[_0x21bb('0x43')](_0x880227[_0x21bb('0x3a')],_0x3e148c[_0x21bb('0x3c')]));if(_0x880227['query'][_0x21bb('0x44')]){_0x1749b8[_0x21bb('0x42')]=_[_0x21bb('0x45')](_0x1749b8[_0x21bb('0x42')],{'$or':_[_0x21bb('0x34')](_0x1749b8[_0x21bb('0x3e')],function(_0x55d16d){var _0x3a817f={};_0x3a817f[_0x55d16d]={'$like':'%'+_0x880227['query']['filter']+'%'};return _0x3a817f;})});}_0x1749b8=_['merge']({},_0x1749b8,_0x880227['options']);return _0x5d94b3[_0x21bb('0x89')](_0x1749b8);}})[_0x21bb('0x2a')](function(_0x3fa646){if(_0x3fa646){_0x27a6a3=_0x3fa646[_0x21bb('0x3f')];if(!_0x880227[_0x21bb('0x3a')][_0x21bb('0x64')](_0x21bb('0x40'))){_0x1749b8[_0x21bb('0x24')]=qs[_0x21bb('0x24')](_0x880227[_0x21bb('0x3a')][_0x21bb('0x24')]);_0x1749b8[_0x21bb('0x21')]=qs[_0x21bb('0x21')](_0x880227[_0x21bb('0x3a')][_0x21bb('0x21')]);}return _0x5d94b3[_0x21bb('0x89')](_0x1749b8);}})[_0x21bb('0x2a')](function(_0x2c6df6){if(_0x2c6df6){return _0x2c6df6?{'count':_0x27a6a3,'rows':_0x2c6df6}:null;}})[_0x21bb('0x2a')](respondWithResult(_0x3dc9ba,null))['catch'](handleError(_0x3dc9ba,null));}; \ No newline at end of file +var _0xda65=['tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','includes','union','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userMailQueue:save','removeTeams','select','field'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xda65,0x1d0));var _0x5da6=function(_0x2f0baf,_0x8c9282){_0x2f0baf=_0x2f0baf-0x0;var _0x4454f7=_0xda65[_0x2f0baf];return _0x4454f7;};'use strict';var emlformat=require(_0x5da6('0x0'));var rimraf=require(_0x5da6('0x1'));var zipdir=require(_0x5da6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5da6('0x3'));var moment=require(_0x5da6('0x4'));var BPromise=require(_0x5da6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5da6('0x6'));var sox=require(_0x5da6('0x7'));var csv=require(_0x5da6('0x8'));var ejs=require(_0x5da6('0x9'));var fs=require('fs');var fs_extra=require(_0x5da6('0xa'));var _=require('lodash');var squel=require(_0x5da6('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5da6('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5da6('0xd'));var Papa=require(_0x5da6('0xe'));var Redis=require(_0x5da6('0xf'));var authService=require(_0x5da6('0x10'));var qs=require(_0x5da6('0x11'));var as=require(_0x5da6('0x12'));var hardwareService=require(_0x5da6('0x13'));var logger=require(_0x5da6('0x14'))('api');var utils=require(_0x5da6('0x15'));var config=require(_0x5da6('0x16'));var licenseUtil=require(_0x5da6('0x17'));var db=require(_0x5da6('0x18'))['db'];config[_0x5da6('0x19')]=_[_0x5da6('0x1a')](config[_0x5da6('0x19')],{'host':_0x5da6('0x1b'),'port':0x18eb});var socket=require(_0x5da6('0x1c'))(new Redis(config['redis']));require(_0x5da6('0x1d'))[_0x5da6('0x1e')](socket);function respondWithStatusCode(_0xdb1066,_0x44c6e4){_0x44c6e4=_0x44c6e4||0xcc;return function(_0x2ca041){if(_0x2ca041){return _0xdb1066[_0x5da6('0x1f')](_0x44c6e4);}return _0xdb1066[_0x5da6('0x20')](_0x44c6e4)[_0x5da6('0x21')]();};}function respondWithResult(_0x4f594e,_0x272b50){_0x272b50=_0x272b50||0xc8;return function(_0x478ce5){if(_0x478ce5){return _0x4f594e['status'](_0x272b50)[_0x5da6('0x22')](_0x478ce5);}};}function respondWithFilteredResult(_0x31b743,_0x41534d){return function(_0x4c3b2d){if(_0x4c3b2d){var _0x4bc49a=typeof _0x41534d['offset']===_0x5da6('0x23')&&typeof _0x41534d[_0x5da6('0x24')]===_0x5da6('0x23');var _0x3c93e2=_0x4c3b2d['count'];var _0x46e149=_0x4bc49a?0x0:_0x41534d[_0x5da6('0x25')];var _0x45a282=_0x4bc49a?_0x4c3b2d[_0x5da6('0x26')]:_0x41534d[_0x5da6('0x25')]+_0x41534d[_0x5da6('0x24')];var _0x163f8a;if(_0x45a282>=_0x3c93e2){_0x45a282=_0x3c93e2;_0x163f8a=0xc8;}else{_0x163f8a=0xce;}_0x31b743[_0x5da6('0x20')](_0x163f8a);return _0x31b743['set'](_0x5da6('0x27'),_0x46e149+'-'+_0x45a282+'/'+_0x3c93e2)['json'](_0x4c3b2d);}return null;};}function patchUpdates(_0x92171e){return function(_0x3fbf9c){try{jsonpatch[_0x5da6('0x28')](_0x3fbf9c,_0x92171e,!![]);}catch(_0xdbaece){return BPromise[_0x5da6('0x29')](_0xdbaece);}return _0x3fbf9c[_0x5da6('0x2a')]();};}function saveUpdates(_0x1d394e,_0x2daa71){return function(_0x5dbe79){if(_0x5dbe79){return _0x5dbe79['update'](_0x1d394e)[_0x5da6('0x2b')](function(_0x256073){return _0x256073;});}return null;};}function removeEntity(_0x524c10,_0x559855){return function(_0x2db51e){if(_0x2db51e){return _0x2db51e[_0x5da6('0x2c')]()[_0x5da6('0x2b')](function(){var _0x27a175=_0x2db51e[_0x5da6('0x2d')]({'plain':!![]});var _0x495138=_0x5da6('0x2e');return db[_0x5da6('0x2f')][_0x5da6('0x2c')]({'where':{'type':_0x495138,'resourceId':_0x27a175['id']}})['then'](function(){return _0x2db51e;});})[_0x5da6('0x2b')](function(){_0x524c10[_0x5da6('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1abd20,_0x34545f){return function(_0x440895){if(!_0x440895){_0x1abd20[_0x5da6('0x1f')](0x194);}return _0x440895;};}function handleError(_0x2be5ac,_0x48937c){_0x48937c=_0x48937c||0x1f4;return function(_0x26cb1a){logger[_0x5da6('0x30')](_0x26cb1a[_0x5da6('0x31')]);if(_0x26cb1a[_0x5da6('0x32')]){delete _0x26cb1a[_0x5da6('0x32')];}_0x2be5ac[_0x5da6('0x20')](_0x48937c)[_0x5da6('0x33')](_0x26cb1a);};}exports[_0x5da6('0x34')]=function(_0x5d6b39,_0x42af0d){var _0x1a4327={},_0x4874a9={},_0x50ce40={'count':0x0,'rows':[]};var _0x1a1fb6=_[_0x5da6('0x35')](db[_0x5da6('0x36')][_0x5da6('0x37')],function(_0x123718){return{'name':_0x123718[_0x5da6('0x38')],'type':_0x123718[_0x5da6('0x39')][_0x5da6('0x3a')]};});_0x4874a9[_0x5da6('0x3b')]=_['map'](_0x1a1fb6,'name');_0x4874a9[_0x5da6('0x3c')]=_['keys'](_0x5d6b39['query']);_0x4874a9[_0x5da6('0x3d')]=_[_0x5da6('0x3e')](_0x4874a9['model'],_0x4874a9['query']);_0x1a4327[_0x5da6('0x3f')]=_['intersection'](_0x4874a9['model'],qs[_0x5da6('0x40')](_0x5d6b39[_0x5da6('0x3c')]['fields']));_0x1a4327[_0x5da6('0x3f')]=_0x1a4327[_0x5da6('0x3f')][_0x5da6('0x41')]?_0x1a4327[_0x5da6('0x3f')]:_0x4874a9['model'];if(!_0x5d6b39[_0x5da6('0x3c')][_0x5da6('0x42')](_0x5da6('0x43'))){_0x1a4327['limit']=qs[_0x5da6('0x24')](_0x5d6b39[_0x5da6('0x3c')][_0x5da6('0x24')]);_0x1a4327[_0x5da6('0x25')]=qs[_0x5da6('0x25')](_0x5d6b39[_0x5da6('0x3c')]['offset']);}_0x1a4327[_0x5da6('0x44')]=qs[_0x5da6('0x45')](_0x5d6b39[_0x5da6('0x3c')]['sort']);_0x1a4327['where']=qs['filters'](_[_0x5da6('0x46')](_0x5d6b39['query'],_0x4874a9[_0x5da6('0x3d')]),_0x1a1fb6);if(_0x5d6b39['query'][_0x5da6('0x47')]){_0x1a4327['where']=_[_0x5da6('0x48')](_0x1a4327[_0x5da6('0x49')],{'$or':_['map'](_0x1a1fb6,function(_0x17d7bb){if(_0x17d7bb[_0x5da6('0x39')]!==_0x5da6('0x4a')){var _0x380552={};_0x380552[_0x17d7bb[_0x5da6('0x32')]]={'$like':'%'+_0x5d6b39[_0x5da6('0x3c')][_0x5da6('0x47')]+'%'};return _0x380552;}})});}_0x1a4327=_[_0x5da6('0x48')]({},_0x1a4327,_0x5d6b39[_0x5da6('0x4b')]);var _0x3071ed={'where':_0x1a4327[_0x5da6('0x49')]};return db[_0x5da6('0x36')][_0x5da6('0x26')](_0x3071ed)[_0x5da6('0x2b')](function(_0x9d38b0){_0x50ce40[_0x5da6('0x26')]=_0x9d38b0;if(_0x5d6b39[_0x5da6('0x3c')]['includeAll']){_0x1a4327[_0x5da6('0x4c')]=[{'all':!![]}];}return db[_0x5da6('0x36')][_0x5da6('0x4d')](_0x1a4327);})[_0x5da6('0x2b')](function(_0x5e01d2){_0x50ce40[_0x5da6('0x4e')]=_0x5e01d2;return _0x50ce40;})[_0x5da6('0x2b')](respondWithFilteredResult(_0x42af0d,_0x1a4327))[_0x5da6('0x4f')](handleError(_0x42af0d,null));};exports[_0x5da6('0x50')]=function(_0x4ba139,_0x18278a){var _0x3a2ccf={'raw':!![],'where':{'id':_0x4ba139[_0x5da6('0x51')]['id']}},_0xb8b1df={};_0xb8b1df[_0x5da6('0x3b')]=_[_0x5da6('0x52')](db[_0x5da6('0x36')][_0x5da6('0x37')]);_0xb8b1df[_0x5da6('0x3c')]=_['keys'](_0x4ba139[_0x5da6('0x3c')]);_0xb8b1df[_0x5da6('0x3d')]=_[_0x5da6('0x3e')](_0xb8b1df['model'],_0xb8b1df['query']);_0x3a2ccf[_0x5da6('0x3f')]=_[_0x5da6('0x3e')](_0xb8b1df[_0x5da6('0x3b')],qs[_0x5da6('0x40')](_0x4ba139[_0x5da6('0x3c')]['fields']));_0x3a2ccf['attributes']=_0x3a2ccf['attributes'][_0x5da6('0x41')]?_0x3a2ccf[_0x5da6('0x3f')]:_0xb8b1df[_0x5da6('0x3b')];if(_0x4ba139[_0x5da6('0x3c')][_0x5da6('0x53')]){_0x3a2ccf[_0x5da6('0x4c')]=[{'all':!![]}];}_0x3a2ccf=_['merge']({},_0x3a2ccf,_0x4ba139[_0x5da6('0x4b')]);return db[_0x5da6('0x36')][_0x5da6('0x54')](_0x3a2ccf)['then'](handleEntityNotFound(_0x18278a,null))['then'](respondWithResult(_0x18278a,null))[_0x5da6('0x4f')](handleError(_0x18278a,null));};exports[_0x5da6('0x55')]=function(_0x510051,_0x402e74){return db[_0x5da6('0x36')][_0x5da6('0x55')](_0x510051['body'],{})[_0x5da6('0x2b')](function(_0x57de51){var _0xabf041=_0x510051[_0x5da6('0x56')][_0x5da6('0x2d')]({'plain':!![]});if(!_0xabf041)throw new Error(_0x5da6('0x57'));if(_0xabf041[_0x5da6('0x58')]===_0x5da6('0x56')){var _0x3e936a=_0x57de51[_0x5da6('0x2d')]({'plain':!![]});var _0x18dad6=_0x5da6('0x2e');return db[_0x5da6('0x59')][_0x5da6('0x54')]({'where':{'name':_0x18dad6,'userProfileId':_0xabf041['userProfileId']},'raw':!![]})[_0x5da6('0x2b')](function(_0x467b0e){if(_0x467b0e&&_0x467b0e['autoAssociation']===0x0){return db[_0x5da6('0x2f')][_0x5da6('0x55')]({'name':_0x3e936a[_0x5da6('0x32')],'resourceId':_0x3e936a['id'],'type':_0x467b0e[_0x5da6('0x32')],'sectionId':_0x467b0e['id']},{})['then'](function(){return _0x57de51;});}else{return _0x57de51;}})['catch'](function(_0x4c800f){logger[_0x5da6('0x30')](_0x5da6('0x5a'),_0x4c800f);throw _0x4c800f;});}return _0x57de51;})[_0x5da6('0x2b')](respondWithResult(_0x402e74,0xc9))['catch'](handleError(_0x402e74,null));};exports[_0x5da6('0x5b')]=function(_0x423eb3,_0x3a07d7){if(_0x423eb3[_0x5da6('0x5c')]['id']){delete _0x423eb3[_0x5da6('0x5c')]['id'];}return db[_0x5da6('0x36')]['find']({'where':{'id':_0x423eb3[_0x5da6('0x51')]['id']}})[_0x5da6('0x2b')](handleEntityNotFound(_0x3a07d7,null))[_0x5da6('0x2b')](saveUpdates(_0x423eb3[_0x5da6('0x5c')],null))[_0x5da6('0x2b')](respondWithResult(_0x3a07d7,null))[_0x5da6('0x4f')](handleError(_0x3a07d7,null));};exports[_0x5da6('0x2c')]=function(_0xfccaf6,_0x1d332e){return db['MailQueue']['find']({'where':{'id':_0xfccaf6[_0x5da6('0x51')]['id']}})[_0x5da6('0x2b')](handleEntityNotFound(_0x1d332e,null))['then'](removeEntity(_0x1d332e,null))[_0x5da6('0x4f')](handleError(_0x1d332e,null));};exports[_0x5da6('0x5d')]=function(_0x16840a,_0x33b059){return db[_0x5da6('0x36')]['describe']()['then'](respondWithResult(_0x33b059,null))[_0x5da6('0x4f')](handleError(_0x33b059,null));};exports[_0x5da6('0x5e')]=function(_0x1ccf2e,_0x35b74c,_0x3d0c1d){var _0x1d7547={'raw':!![],'where':{}},_0x298dc4={},_0x1bbe3a;return db[_0x5da6('0x36')][_0x5da6('0x5f')]({'where':{'id':_0x1ccf2e[_0x5da6('0x51')]['id']}})['then'](handleEntityNotFound(_0x35b74c,null))['then'](function(_0x6ed073){if(_0x6ed073){_0x1bbe3a=_0x6ed073[_0x5da6('0x2d')]({'plain':!![]});_0x298dc4[_0x5da6('0x3b')]=_[_0x5da6('0x52')](db[_0x5da6('0x60')][_0x5da6('0x37')]);_0x298dc4[_0x5da6('0x3c')]=_[_0x5da6('0x52')](_0x1ccf2e['query']);_0x298dc4['filters']=_[_0x5da6('0x3e')](_0x298dc4[_0x5da6('0x3b')],_0x298dc4['query']);_0x1d7547[_0x5da6('0x3f')]=_[_0x5da6('0x3e')](_0x298dc4[_0x5da6('0x3b')],qs[_0x5da6('0x40')](_0x1ccf2e[_0x5da6('0x3c')]['fields']));_0x1d7547['attributes']=_0x1d7547['attributes'][_0x5da6('0x41')]?_0x1d7547['attributes']:_0x298dc4['model'];if(!_0x1ccf2e[_0x5da6('0x3c')][_0x5da6('0x42')](_0x5da6('0x43'))){_0x1d7547[_0x5da6('0x24')]=qs[_0x5da6('0x24')](_0x1ccf2e[_0x5da6('0x3c')][_0x5da6('0x24')]);_0x1d7547[_0x5da6('0x25')]=qs['offset'](_0x1ccf2e[_0x5da6('0x3c')]['offset']);}_0x1d7547[_0x5da6('0x44')]=qs[_0x5da6('0x45')](_0x1ccf2e[_0x5da6('0x3c')][_0x5da6('0x45')]);_0x1d7547['where']=qs[_0x5da6('0x3d')](_[_0x5da6('0x46')](_0x1ccf2e['query'],_0x298dc4['filters']));_0x1d7547['where']['MailQueueId']=_0x6ed073['id'];if(_0x1ccf2e[_0x5da6('0x3c')]['filter']){_0x1d7547['where']=_['merge'](_0x1d7547[_0x5da6('0x49')],{'$or':_[_0x5da6('0x35')](_0x1d7547[_0x5da6('0x3f')],function(_0x336864){var _0x4b589c={};_0x4b589c[_0x336864]={'$like':'%'+_0x1ccf2e[_0x5da6('0x3c')][_0x5da6('0x47')]+'%'};return _0x4b589c;})});}_0x1d7547=_[_0x5da6('0x48')]({},_0x1d7547,_0x1ccf2e[_0x5da6('0x4b')]);return db[_0x5da6('0x60')][_0x5da6('0x4d')](_0x1d7547);}})[_0x5da6('0x2b')](function(_0x30a735){if(_0x30a735){return db[_0x5da6('0x61')][_0x5da6('0x62')]({'where':{'id':_[_0x5da6('0x35')](_0x30a735,_0x5da6('0x63')),'role':_0x5da6('0x64')},'attributes':['id',_0x5da6('0x32'),_0x5da6('0x65'),'updatedAt',_0x5da6('0x66')]});}})[_0x5da6('0x2b')](function(_0x2bec75){if(_0x2bec75){return{'count':_0x2bec75[_0x5da6('0x26')],'rows':_[_0x5da6('0x35')](_0x2bec75[_0x5da6('0x4e')],function(_0x276c6e){return{'membername':_0x276c6e[_0x5da6('0x32')],'UserId':_0x276c6e['id'],'queue_name':_0x1bbe3a[_0x5da6('0x32')],'MailQueueId':_0x1bbe3a['id'],'interface':util[_0x5da6('0x67')](_0x5da6('0x68'),_0x5da6('0x69'),_0x276c6e[_0x5da6('0x32')]),'penalty':0x0,'paused':_0x276c6e[_0x5da6('0x65')],'createdAt':_0x276c6e['createdAt'],'updatedAt':_0x276c6e[_0x5da6('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5da6('0x2b')](respondWithFilteredResult(_0x35b74c,_0x1d7547))[_0x5da6('0x4f')](handleError(_0x35b74c,null));};exports[_0x5da6('0x6b')]=function(_0x132ebf,_0x7995bc,_0xa085e1){var _0x35c256={};var _0x4f9970={};var _0x476abe;var _0xbdf618;return db[_0x5da6('0x36')][_0x5da6('0x5f')]({'where':{'id':_0x132ebf[_0x5da6('0x51')]['id']}})['then'](handleEntityNotFound(_0x7995bc,null))[_0x5da6('0x2b')](function(_0x21dbaa){if(_0x21dbaa){_0x476abe=_0x21dbaa;_0x4f9970[_0x5da6('0x3b')]=_[_0x5da6('0x52')](db[_0x5da6('0x6c')][_0x5da6('0x37')]);_0x4f9970['query']=_['keys'](_0x132ebf[_0x5da6('0x3c')]);_0x4f9970[_0x5da6('0x3d')]=_[_0x5da6('0x3e')](_0x4f9970[_0x5da6('0x3b')],_0x4f9970[_0x5da6('0x3c')]);_0x35c256[_0x5da6('0x3f')]=_[_0x5da6('0x3e')](_0x4f9970[_0x5da6('0x3b')],qs[_0x5da6('0x40')](_0x132ebf[_0x5da6('0x3c')][_0x5da6('0x40')]));_0x35c256[_0x5da6('0x3f')]=_0x35c256[_0x5da6('0x3f')][_0x5da6('0x41')]?_0x35c256['attributes']:_0x4f9970[_0x5da6('0x3b')];_0x35c256[_0x5da6('0x44')]=qs['sort'](_0x132ebf['query'][_0x5da6('0x45')]);_0x35c256[_0x5da6('0x49')]=qs[_0x5da6('0x3d')](_[_0x5da6('0x46')](_0x132ebf[_0x5da6('0x3c')],_0x4f9970[_0x5da6('0x3d')]));if(_0x132ebf['query'][_0x5da6('0x47')]){_0x35c256[_0x5da6('0x49')]=_[_0x5da6('0x48')](_0x35c256[_0x5da6('0x49')],{'$or':_['map'](_0x35c256[_0x5da6('0x3f')],function(_0x5b5594){var _0x1fbd3c={};_0x1fbd3c[_0x5b5594]={'$like':'%'+_0x132ebf[_0x5da6('0x3c')][_0x5da6('0x47')]+'%'};return _0x1fbd3c;})});}_0x35c256=_[_0x5da6('0x48')]({},_0x35c256,_0x132ebf['options']);return _0x476abe['getTeams'](_0x35c256);}})[_0x5da6('0x2b')](function(_0x286f8c){if(_0x286f8c){_0xbdf618=_0x286f8c[_0x5da6('0x41')];if(!_0x132ebf[_0x5da6('0x3c')][_0x5da6('0x42')]('nolimit')){_0x35c256[_0x5da6('0x24')]=qs[_0x5da6('0x24')](_0x132ebf[_0x5da6('0x3c')][_0x5da6('0x24')]);_0x35c256[_0x5da6('0x25')]=qs[_0x5da6('0x25')](_0x132ebf[_0x5da6('0x3c')][_0x5da6('0x25')]);}return _0x476abe[_0x5da6('0x6b')](_0x35c256);}})[_0x5da6('0x2b')](function(_0x50429b){if(_0x50429b){return _0x50429b?{'count':_0xbdf618,'rows':_0x50429b}:null;}})['then'](respondWithResult(_0x7995bc,null))[_0x5da6('0x4f')](handleError(_0x7995bc,null));};exports[_0x5da6('0x6d')]=function(_0x20b651,_0x7988cf,_0x21e358){var _0x4bf4b1=_0x20b651[_0x5da6('0x5c')][_0x5da6('0x6e')];return db['Team']['findAll']({'where':{'id':_0x4bf4b1},'attributes':['id'],'include':[{'model':db[_0x5da6('0x61')],'as':_0x5da6('0x6f'),'attributes':['id','name',_0x5da6('0x70'),'voicePause',_0x5da6('0x71')],'raw':!![]}]})['then'](function(_0x3a89a1){if(_0x3a89a1){var _0x1b5c2b=_[_0x5da6('0x72')](_0x3a89a1,function(_0x52f65b){var _0x1fce91=_0x52f65b['get']({'plain':!![]});return _0x1fce91[_0x5da6('0x6f')];});return db[_0x5da6('0x36')]['find']({'where':{'id':_0x20b651[_0x5da6('0x51')]['id']}})['then'](function(_0x53eecb){return db[_0x5da6('0x73')][_0x5da6('0x74')](function(_0xb25ae4){return _0x53eecb[_0x5da6('0x6d')](_0x4bf4b1,{'transaction':_0xb25ae4})[_0x5da6('0x2b')](function(){return BPromise[_0x5da6('0x75')](_0x1b5c2b,function(_0x259fab){return db[_0x5da6('0x60')][_0x5da6('0x76')]({'where':{'UserId':_0x259fab['id'],'MailQueueId':_0x20b651[_0x5da6('0x51')]['id']},'transaction':_0xb25ae4});});})['then'](function(){_0x1b5c2b['forEach'](function(_0x18bdbf){socket[_0x5da6('0x77')](_0x5da6('0x78'),{'UserId':_0x18bdbf['id'],'MailQueueId':_0x53eecb['id']});});});});});}})['then'](respondWithStatusCode(_0x7988cf,null))[_0x5da6('0x4f')](handleError(_0x7988cf,null));};exports[_0x5da6('0x79')]=function(_0x1e2386,_0x14cce7,_0x12385f){return db[_0x5da6('0x6c')]['findAll']({'where':{'id':_0x1e2386[_0x5da6('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5da6('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x5da6('0x2b')](handleEntityNotFound(_0x14cce7,null))[_0x5da6('0x2b')](function(_0x4e5afc){var _0x5b2793=_[_0x5da6('0x35')](_0x4e5afc,'id');var _0x39a1d6=[];var _0x115dcf=[];var _0x253b68=squel[_0x5da6('0x7a')]();_0x253b68[_0x5da6('0x7b')](_0x5da6('0x7c'))[_0x5da6('0x7d')](_0x5da6('0x7e'),'tq')[_0x5da6('0x7f')]('user_has_teams','ut',_0x5da6('0x80'))['where'](_0x5da6('0x81'),_0x1e2386[_0x5da6('0x51')]['id']);for(var _0x19da91=0x0;_0x19da91<_0x4e5afc[_0x5da6('0x41')];_0x19da91+=0x1){let _0x7f127c=_0x4e5afc[_0x19da91];for(var _0x59ba5e=0x0;_0x59ba5e<_0x7f127c['Agents'][_0x5da6('0x41')];_0x59ba5e+=0x1){let _0x5559ee=_0x7f127c[_0x5da6('0x6f')][_0x59ba5e];var _0xdc70a4=_0x253b68[_0x5da6('0x82')]();_0xdc70a4['where']('ut.UserId\x20=\x20?',_0x5559ee['id']);_0x115dcf[_0x5da6('0x83')](db['sequelize'][_0x5da6('0x3c')](_0xdc70a4[_0x5da6('0x84')](),{'type':db[_0x5da6('0x73')][_0x5da6('0x85')][_0x5da6('0x86')]})[_0x5da6('0x2b')](function(_0x46c542){if(_0x46c542['length']===0x1){return _0x5559ee['id'];}else{var _0x3da2ef=_[_0x5da6('0x87')](_['map'](_0x46c542,'TeamId'),function(_0x5751c3){return _[_0x5da6('0x88')](_0x5b2793,_0x5751c3);});if(_0x3da2ef){return _0x5559ee['id'];}}}));}}return BPromise['all'](_0x115dcf)['then'](function(_0x4edd4a){_0x39a1d6=_(_0x39a1d6)[_0x5da6('0x89')](_0x4edd4a)['compact']()['value']();return db['MailQueue'][_0x5da6('0x54')]({'where':{'id':_0x1e2386['params']['id']}})['then'](function(_0x2141d8){return db[_0x5da6('0x73')][_0x5da6('0x74')](function(_0x4c06f2){return _0x2141d8[_0x5da6('0x79')](_0x1e2386[_0x5da6('0x3c')]['ids'],{'transaction':_0x4c06f2})['then'](function(){if(!_[_0x5da6('0x8a')](_0x39a1d6)){return _0x2141d8[_0x5da6('0x8b')](_0x39a1d6,{'transaction':_0x4c06f2});}})[_0x5da6('0x2b')](function(){_0x39a1d6[_0x5da6('0x8c')](function(_0x3ad7d9){socket[_0x5da6('0x77')]('userMailQueue:remove',{'UserId':_0x3ad7d9,'MailQueueId':_0x2141d8['id']});});});});});});})[_0x5da6('0x2b')](respondWithStatusCode(_0x14cce7,null))[_0x5da6('0x4f')](handleError(_0x14cce7,null));};exports[_0x5da6('0x8d')]=function(_0x37eb10,_0xa1e089,_0x5824d7){return db[_0x5da6('0x36')][_0x5da6('0x54')]({'where':{'id':_0x37eb10['params']['id']}})[_0x5da6('0x2b')](handleEntityNotFound(_0xa1e089,null))['then'](function(_0x4580a0){if(_0x4580a0){return _0x4580a0['addAgents'](_0x37eb10[_0x5da6('0x5c')][_0x5da6('0x6e')],_[_0x5da6('0x8e')](_0x37eb10[_0x5da6('0x5c')],[_0x5da6('0x6e'),'id'])||{})[_0x5da6('0x8f')](function(_0x2388ad){for(var _0x3dacf4=0x0;_0x3dacf4<_0x37eb10['body']['ids'][_0x5da6('0x41')];_0x3dacf4+=0x1){socket[_0x5da6('0x77')](_0x5da6('0x78'),{'UserId':Number(_0x37eb10[_0x5da6('0x5c')][_0x5da6('0x6e')][_0x3dacf4]),'MailQueueId':Number(_0x37eb10[_0x5da6('0x51')]['id'])});}return _0x2388ad;});}})['then'](respondWithResult(_0xa1e089,null))[_0x5da6('0x4f')](handleError(_0xa1e089,null));};exports[_0x5da6('0x8b')]=function(_0x3e9354,_0x3117e1,_0x350095){return db[_0x5da6('0x36')][_0x5da6('0x54')]({'where':{'id':_0x3e9354[_0x5da6('0x51')]['id']}})['then'](handleEntityNotFound(_0x3117e1,null))[_0x5da6('0x2b')](function(_0x55df07){if(_0x55df07){return _0x55df07[_0x5da6('0x8b')](_0x3e9354[_0x5da6('0x3c')][_0x5da6('0x6e')])[_0x5da6('0x2b')](function(){if(_[_0x5da6('0x90')](_0x3e9354[_0x5da6('0x3c')][_0x5da6('0x6e')])){for(var _0x225c3c=0x0;_0x225c3c<_0x3e9354[_0x5da6('0x3c')]['ids'][_0x5da6('0x41')];_0x225c3c+=0x1){socket[_0x5da6('0x77')](_0x5da6('0x91'),{'UserId':Number(_0x3e9354[_0x5da6('0x3c')][_0x5da6('0x6e')][_0x225c3c]),'MailQueueId':Number(_0x3e9354[_0x5da6('0x51')]['id'])});}}else{socket[_0x5da6('0x77')]('userMailQueue:remove',{'UserId':Number(_0x3e9354[_0x5da6('0x3c')][_0x5da6('0x6e')]),'MailQueueId':Number(_0x3e9354[_0x5da6('0x51')]['id'])});}});}})[_0x5da6('0x2b')](respondWithStatusCode(_0x3117e1,null))[_0x5da6('0x4f')](handleError(_0x3117e1,null));};exports[_0x5da6('0x92')]=function(_0x4db926,_0x3ea695,_0x3bb873){var _0x307f81={};var _0x502eb4={};var _0x5d088b;var _0x4e06c5;return db['MailQueue']['findOne']({'where':{'id':_0x4db926[_0x5da6('0x51')]['id']}})[_0x5da6('0x2b')](handleEntityNotFound(_0x3ea695,null))['then'](function(_0x1b4285){if(_0x1b4285){_0x5d088b=_0x1b4285;_0x502eb4[_0x5da6('0x3b')]=_['keys'](db[_0x5da6('0x61')][_0x5da6('0x37')]);_0x502eb4[_0x5da6('0x3c')]=_[_0x5da6('0x52')](_0x4db926[_0x5da6('0x3c')]);_0x502eb4['filters']=_['intersection'](_0x502eb4[_0x5da6('0x3b')],_0x502eb4[_0x5da6('0x3c')]);_0x307f81[_0x5da6('0x3f')]=_[_0x5da6('0x3e')](_0x502eb4[_0x5da6('0x3b')],qs[_0x5da6('0x40')](_0x4db926[_0x5da6('0x3c')][_0x5da6('0x40')]));_0x307f81[_0x5da6('0x3f')]=_0x307f81[_0x5da6('0x3f')][_0x5da6('0x41')]?_0x307f81[_0x5da6('0x3f')]:_0x502eb4[_0x5da6('0x3b')];_0x307f81['order']=qs[_0x5da6('0x45')](_0x4db926['query'][_0x5da6('0x45')]);_0x307f81[_0x5da6('0x49')]=qs[_0x5da6('0x3d')](_[_0x5da6('0x46')](_0x4db926[_0x5da6('0x3c')],_0x502eb4[_0x5da6('0x3d')]));if(_0x4db926[_0x5da6('0x3c')][_0x5da6('0x47')]){_0x307f81[_0x5da6('0x49')]=_[_0x5da6('0x48')](_0x307f81[_0x5da6('0x49')],{'$or':_[_0x5da6('0x35')](_0x307f81[_0x5da6('0x3f')],function(_0x2e3281){var _0x26c8a7={};_0x26c8a7[_0x2e3281]={'$like':'%'+_0x4db926[_0x5da6('0x3c')][_0x5da6('0x47')]+'%'};return _0x26c8a7;})});}_0x307f81=_[_0x5da6('0x48')]({},_0x307f81,_0x4db926[_0x5da6('0x4b')]);return _0x5d088b[_0x5da6('0x92')](_0x307f81);}})[_0x5da6('0x2b')](function(_0x4d273a){if(_0x4d273a){_0x4e06c5=_0x4d273a[_0x5da6('0x41')];if(!_0x4db926['query'][_0x5da6('0x42')]('nolimit')){_0x307f81['limit']=qs['limit'](_0x4db926[_0x5da6('0x3c')]['limit']);_0x307f81[_0x5da6('0x25')]=qs[_0x5da6('0x25')](_0x4db926['query'][_0x5da6('0x25')]);}return _0x5d088b[_0x5da6('0x92')](_0x307f81);}})[_0x5da6('0x2b')](function(_0x19788c){if(_0x19788c){return _0x19788c?{'count':_0x4e06c5,'rows':_0x19788c}:null;}})[_0x5da6('0x2b')](respondWithResult(_0x3ea695,null))['catch'](handleError(_0x3ea695,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index f690a7c..8b4f78e 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 _0x8b90=['events','MailQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x8b90,0x180));var _0x08b9=function(_0x22afd5,_0x488d9f){_0x22afd5=_0x22afd5-0x0;var _0x336ebc=_0x8b90[_0x22afd5];return _0x336ebc;};'use strict';var EventEmitter=require(_0x08b9('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x08b9('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x08b9('0x2')](0x0);var events={'afterCreate':_0x08b9('0x3'),'afterUpdate':'update','afterDestroy':_0x08b9('0x4')};function emitEvent(_0x208b2d){return function(_0x13e510,_0x309914,_0x38d299){MailQueueEvents['emit'](_0x208b2d+':'+_0x13e510['id'],_0x13e510);MailQueueEvents[_0x08b9('0x5')](_0x208b2d,_0x13e510);_0x38d299(null);};}for(var e in events){if(events[_0x08b9('0x6')](e)){var event=events[e];MailQueue[_0x08b9('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x6e71=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e71,0xec));var _0x16e7=function(_0x5a33c6,_0x42c547){_0x5a33c6=_0x5a33c6-0x0;var _0x3d55b9=_0x6e71[_0x5a33c6];return _0x3d55b9;};'use strict';var EventEmitter=require(_0x16e7('0x0'));var MailQueue=require(_0x16e7('0x1'))['db'][_0x16e7('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x16e7('0x3')](0x0);var events={'afterCreate':_0x16e7('0x4'),'afterUpdate':_0x16e7('0x5'),'afterDestroy':_0x16e7('0x6')};function emitEvent(_0x12627c){return function(_0x5cd765,_0x50e3bc,_0x47cf99){MailQueueEvents[_0x16e7('0x7')](_0x12627c+':'+_0x5cd765['id'],_0x5cd765);MailQueueEvents[_0x16e7('0x7')](_0x12627c,_0x5cd765);_0x47cf99(null);};}for(var e in events){if(events[_0x16e7('0x8')](e)){var event=events[e];MailQueue[_0x16e7('0x9')](e,emitEvent(event));}}module[_0x16e7('0xa')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index ca66b01..635ca3c 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 _0xb245=['request-promise','path','rimraf','exports','mail_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5ec365,_0x49930c){var _0xab187d=function(_0x4d4bbd){while(--_0x4d4bbd){_0x5ec365['push'](_0x5ec365['shift']());}};_0xab187d(++_0x49930c);}(_0xb245,0x89));var _0x5b24=function(_0x13c0b4,_0x2ce813){_0x13c0b4=_0x13c0b4-0x0;var _0x2b8a2a=_0xb245[_0x13c0b4];return _0x2b8a2a;};'use strict';var _=require(_0x5b24('0x0'));var util=require(_0x5b24('0x1'));var logger=require(_0x5b24('0x2'))(_0x5b24('0x3'));var moment=require(_0x5b24('0x4'));var BPromise=require(_0x5b24('0x5'));var rp=require(_0x5b24('0x6'));var fs=require('fs');var path=require(_0x5b24('0x7'));var rimraf=require(_0x5b24('0x8'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x5b24('0x9')]=function(_0x3acae2,_0x31fbf6){return _0x3acae2['define']('MailQueue',attributes,{'tableName':_0x5b24('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe52e=['path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1cb2a2,_0x3d4c7b){var _0x402ae4=function(_0xee7e4c){while(--_0xee7e4c){_0x1cb2a2['push'](_0x1cb2a2['shift']());}};_0x402ae4(++_0x3d4c7b);}(_0xe52e,0x1a7));var _0xee52=function(_0x5bfb78,_0x22e3ff){_0x5bfb78=_0x5bfb78-0x0;var _0x4efd00=_0xe52e[_0x5bfb78];return _0x4efd00;};'use strict';var _=require(_0xee52('0x0'));var util=require(_0xee52('0x1'));var logger=require(_0xee52('0x2'))(_0xee52('0x3'));var moment=require(_0xee52('0x4'));var BPromise=require(_0xee52('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee52('0x6'));var rimraf=require(_0xee52('0x7'));var config=require(_0xee52('0x8'));var attributes=require('./mailQueue.attributes');module[_0xee52('0x9')]=function(_0x5b0cab,_0x1c98c0){return _0x5b0cab[_0xee52('0xa')]('MailQueue',attributes,{'tableName':'mail_queues','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 8d558b8..a4a30f8 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 _0x9348=['request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetMailQueue','MailQueue','findAll','options','raw','attributes','include','model','map','ShowMailQueue','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','info','MailQueue,\x20%s,\x20%s'];(function(_0x3da707,_0x30c36d){var _0x342ee7=function(_0x175135){while(--_0x175135){_0x3da707['push'](_0x3da707['shift']());}};_0x342ee7(++_0x30c36d);}(_0x9348,0x10d));var _0x8934=function(_0x4af997,_0x482362){_0x4af997=_0x4af997-0x0;var _0x4b79f3=_0x9348[_0x4af997];return _0x4b79f3;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});config[_0x8934('0xc')]=_['defaults'](config[_0x8934('0xc')],{'host':_0x8934('0xd'),'port':0x18eb});var socket=require(_0x8934('0xe'))(new Redis(config['redis']));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x5336f0,_0x2c722b,_0x554432){return new BPromise(function(_0xe1adf4,_0x8a88c0){return client[_0x8934('0xf')](_0x5336f0,_0x554432)[_0x8934('0x10')](function(_0x28b451){logger[_0x8934('0x11')](_0x8934('0x12'),_0x2c722b,_0x8934('0x13'));logger['debug'](_0x8934('0x14'),_0x2c722b,_0x8934('0x13'),JSON[_0x8934('0x15')](_0x28b451));if(_0x28b451[_0x8934('0x16')]){if(_0x28b451[_0x8934('0x16')][_0x8934('0x17')]===0x1f4){logger['error'](_0x8934('0x12'),_0x2c722b,_0x28b451[_0x8934('0x16')][_0x8934('0x18')]);return _0x8a88c0(_0x28b451[_0x8934('0x16')][_0x8934('0x18')]);}logger[_0x8934('0x16')](_0x8934('0x12'),_0x2c722b,_0x28b451[_0x8934('0x16')]['message']);return _0xe1adf4(_0x28b451[_0x8934('0x16')][_0x8934('0x18')]);}else{logger[_0x8934('0x11')]('MailQueue,\x20%s,\x20%s',_0x2c722b,'request\x20sent');_0xe1adf4(_0x28b451['result'][_0x8934('0x18')]);}})['catch'](function(_0xe64ebd){logger[_0x8934('0x16')](_0x8934('0x12'),_0x2c722b,_0xe64ebd);_0x8a88c0(_0xe64ebd);});});}exports[_0x8934('0x19')]=function(_0x1b25ae){var _0x5024e9=this;return new Promise(function(_0xf3998,_0x5ae49f){return db[_0x8934('0x1a')][_0x8934('0x1b')]({'raw':_0x1b25ae[_0x8934('0x1c')]?_0x1b25ae[_0x8934('0x1c')][_0x8934('0x1d')]===undefined?!![]:![]:!![],'where':_0x1b25ae[_0x8934('0x1c')]?_0x1b25ae[_0x8934('0x1c')]['where']||null:null,'attributes':_0x1b25ae[_0x8934('0x1c')]?_0x1b25ae[_0x8934('0x1c')][_0x8934('0x1e')]||null:null,'limit':_0x1b25ae[_0x8934('0x1c')]?_0x1b25ae[_0x8934('0x1c')]['limit']||null:null,'include':_0x1b25ae[_0x8934('0x1c')]?_0x1b25ae[_0x8934('0x1c')][_0x8934('0x1f')]?_['map'](_0x1b25ae[_0x8934('0x1c')]['include'],function(_0x14c5f0){return{'model':db[_0x14c5f0[_0x8934('0x20')]],'as':_0x14c5f0['as'],'attributes':_0x14c5f0[_0x8934('0x1e')],'include':_0x14c5f0['include']?_[_0x8934('0x21')](_0x14c5f0[_0x8934('0x1f')],function(_0x310454){return{'model':db[_0x310454[_0x8934('0x20')]],'as':_0x310454['as'],'attributes':_0x310454['attributes'],'include':_0x310454[_0x8934('0x1f')]?_[_0x8934('0x21')](_0x310454[_0x8934('0x1f')],function(_0x3d93c7){return{'model':db[_0x3d93c7[_0x8934('0x20')]],'as':_0x3d93c7['as'],'attributes':_0x3d93c7[_0x8934('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8934('0x10')](function(_0x457634){logger[_0x8934('0x11')](_0x8934('0x19'),_0x1b25ae);logger['debug'](_0x8934('0x19'),_0x1b25ae,JSON[_0x8934('0x15')](_0x457634));_0xf3998(_0x457634);})['catch'](function(_0x2aa18e){logger[_0x8934('0x16')](_0x8934('0x19'),_0x2aa18e[_0x8934('0x18')],_0x1b25ae);_0x5ae49f(_0x5024e9['error'](0x1f4,_0x2aa18e[_0x8934('0x18')]));});});};exports[_0x8934('0x22')]=function(_0x11844a){var _0x1af54b=this;return new Promise(function(_0x382d81,_0x49c5e2){return db[_0x8934('0x1a')]['find']({'raw':_0x11844a['options']?_0x11844a[_0x8934('0x1c')][_0x8934('0x1d')]===undefined?!![]:![]:!![],'where':_0x11844a[_0x8934('0x1c')]?_0x11844a[_0x8934('0x1c')]['where']||null:null,'attributes':_0x11844a[_0x8934('0x1c')]?_0x11844a[_0x8934('0x1c')][_0x8934('0x1e')]||null:null,'include':_0x11844a[_0x8934('0x1c')]?_0x11844a[_0x8934('0x1c')]['include']?_[_0x8934('0x21')](_0x11844a[_0x8934('0x1c')]['include'],function(_0x5914b9){return{'model':db[_0x5914b9[_0x8934('0x20')]],'as':_0x5914b9['as'],'attributes':_0x5914b9[_0x8934('0x1e')],'include':_0x5914b9['include']?_['map'](_0x5914b9[_0x8934('0x1f')],function(_0x177a57){return{'model':db[_0x177a57[_0x8934('0x20')]],'as':_0x177a57['as'],'attributes':_0x177a57[_0x8934('0x1e')],'include':_0x177a57[_0x8934('0x1f')]?_[_0x8934('0x21')](_0x177a57[_0x8934('0x1f')],function(_0x1bc2d8){return{'model':db[_0x1bc2d8[_0x8934('0x20')]],'as':_0x1bc2d8['as'],'attributes':_0x1bc2d8[_0x8934('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8934('0x10')](function(_0x50b477){logger[_0x8934('0x11')](_0x8934('0x22'),_0x11844a);logger['debug'](_0x8934('0x22'),_0x11844a,JSON[_0x8934('0x15')](_0x50b477));_0x382d81(_0x50b477);})[_0x8934('0x23')](function(_0x40733b){logger[_0x8934('0x16')]('ShowMailQueue',_0x40733b['message'],_0x11844a);_0x49c5e2(_0x1af54b['error'](0x1f4,_0x40733b[_0x8934('0x18')]));});});}; \ No newline at end of file +var _0xc79f=['raw','where','attributes','include','map','model','debug','catch','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./mailQueue.socket','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetMailQueue','MailQueue','findAll','options'];(function(_0x4206f9,_0xbb9cd1){var _0x47cfda=function(_0x13ff31){while(--_0x13ff31){_0x4206f9['push'](_0x4206f9['shift']());}};_0x47cfda(++_0xbb9cd1);}(_0xc79f,0x82));var _0xfc79=function(_0x389b85,_0x243112){_0x389b85=_0x389b85-0x0;var _0x2fd54b=_0xc79f[_0x389b85];return _0x2fd54b;};'use strict';var _=require(_0xfc79('0x0'));var util=require(_0xfc79('0x1'));var moment=require(_0xfc79('0x2'));var BPromise=require(_0xfc79('0x3'));var rs=require(_0xfc79('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc79('0x5'))['db'];var utils=require(_0xfc79('0x6'));var logger=require(_0xfc79('0x7'))(_0xfc79('0x8'));var config=require(_0xfc79('0x9'));var jayson=require(_0xfc79('0xa'));var client=jayson[_0xfc79('0xb')][_0xfc79('0xc')]({'port':0x232a});config[_0xfc79('0xd')]=_['defaults'](config[_0xfc79('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc79('0xe'))(new Redis(config[_0xfc79('0xd')]));require(_0xfc79('0xf'))['register'](socket);function respondWithRpcPromise(_0x3f6163,_0x102dd6,_0x4220cf){return new BPromise(function(_0x2031c7,_0x559cdc){return client[_0xfc79('0x10')](_0x3f6163,_0x4220cf)[_0xfc79('0x11')](function(_0x41ca89){logger['info'](_0xfc79('0x12'),_0x102dd6,_0xfc79('0x13'));logger['debug'](_0xfc79('0x14'),_0x102dd6,'request\x20sent',JSON[_0xfc79('0x15')](_0x41ca89));if(_0x41ca89[_0xfc79('0x16')]){if(_0x41ca89[_0xfc79('0x16')]['code']===0x1f4){logger[_0xfc79('0x16')](_0xfc79('0x12'),_0x102dd6,_0x41ca89[_0xfc79('0x16')][_0xfc79('0x17')]);return _0x559cdc(_0x41ca89[_0xfc79('0x16')][_0xfc79('0x17')]);}logger['error'](_0xfc79('0x12'),_0x102dd6,_0x41ca89[_0xfc79('0x16')][_0xfc79('0x17')]);return _0x2031c7(_0x41ca89[_0xfc79('0x16')]['message']);}else{logger[_0xfc79('0x18')](_0xfc79('0x12'),_0x102dd6,_0xfc79('0x13'));_0x2031c7(_0x41ca89[_0xfc79('0x19')]['message']);}})['catch'](function(_0x305504){logger['error'](_0xfc79('0x12'),_0x102dd6,_0x305504);_0x559cdc(_0x305504);});});}exports[_0xfc79('0x1a')]=function(_0x785ecb){var _0x6781a6=this;return new Promise(function(_0x579ef4,_0x8187e2){return db[_0xfc79('0x1b')][_0xfc79('0x1c')]({'raw':_0x785ecb[_0xfc79('0x1d')]?_0x785ecb[_0xfc79('0x1d')][_0xfc79('0x1e')]===undefined?!![]:![]:!![],'where':_0x785ecb[_0xfc79('0x1d')]?_0x785ecb['options'][_0xfc79('0x1f')]||null:null,'attributes':_0x785ecb[_0xfc79('0x1d')]?_0x785ecb[_0xfc79('0x1d')][_0xfc79('0x20')]||null:null,'limit':_0x785ecb[_0xfc79('0x1d')]?_0x785ecb['options']['limit']||null:null,'include':_0x785ecb['options']?_0x785ecb[_0xfc79('0x1d')][_0xfc79('0x21')]?_[_0xfc79('0x22')](_0x785ecb[_0xfc79('0x1d')]['include'],function(_0x1c152){return{'model':db[_0x1c152['model']],'as':_0x1c152['as'],'attributes':_0x1c152[_0xfc79('0x20')],'include':_0x1c152['include']?_[_0xfc79('0x22')](_0x1c152[_0xfc79('0x21')],function(_0x96ceeb){return{'model':db[_0x96ceeb['model']],'as':_0x96ceeb['as'],'attributes':_0x96ceeb[_0xfc79('0x20')],'include':_0x96ceeb[_0xfc79('0x21')]?_[_0xfc79('0x22')](_0x96ceeb[_0xfc79('0x21')],function(_0x2ae979){return{'model':db[_0x2ae979[_0xfc79('0x23')]],'as':_0x2ae979['as'],'attributes':_0x2ae979[_0xfc79('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa9607){logger[_0xfc79('0x18')](_0xfc79('0x1a'),_0x785ecb);logger[_0xfc79('0x24')]('GetMailQueue',_0x785ecb,JSON[_0xfc79('0x15')](_0xa9607));_0x579ef4(_0xa9607);})[_0xfc79('0x25')](function(_0x184921){logger[_0xfc79('0x16')](_0xfc79('0x1a'),_0x184921[_0xfc79('0x17')],_0x785ecb);_0x8187e2(_0x6781a6['error'](0x1f4,_0x184921['message']));});});};exports[_0xfc79('0x26')]=function(_0x4c7afb){var _0x137420=this;return new Promise(function(_0x324b52,_0x3bac69){return db[_0xfc79('0x1b')][_0xfc79('0x27')]({'raw':_0x4c7afb[_0xfc79('0x1d')]?_0x4c7afb[_0xfc79('0x1d')][_0xfc79('0x1e')]===undefined?!![]:![]:!![],'where':_0x4c7afb[_0xfc79('0x1d')]?_0x4c7afb['options'][_0xfc79('0x1f')]||null:null,'attributes':_0x4c7afb[_0xfc79('0x1d')]?_0x4c7afb[_0xfc79('0x1d')][_0xfc79('0x20')]||null:null,'include':_0x4c7afb[_0xfc79('0x1d')]?_0x4c7afb['options'][_0xfc79('0x21')]?_[_0xfc79('0x22')](_0x4c7afb['options']['include'],function(_0x525c96){return{'model':db[_0x525c96[_0xfc79('0x23')]],'as':_0x525c96['as'],'attributes':_0x525c96[_0xfc79('0x20')],'include':_0x525c96[_0xfc79('0x21')]?_[_0xfc79('0x22')](_0x525c96[_0xfc79('0x21')],function(_0x550ee7){return{'model':db[_0x550ee7[_0xfc79('0x23')]],'as':_0x550ee7['as'],'attributes':_0x550ee7[_0xfc79('0x20')],'include':_0x550ee7[_0xfc79('0x21')]?_['map'](_0x550ee7[_0xfc79('0x21')],function(_0x26632a){return{'model':db[_0x26632a['model']],'as':_0x26632a['as'],'attributes':_0x26632a['attributes']};}):[]};}):[]};}):[]:[]})[_0xfc79('0x11')](function(_0x3f40e8){logger[_0xfc79('0x18')](_0xfc79('0x26'),_0x4c7afb);logger[_0xfc79('0x24')](_0xfc79('0x26'),_0x4c7afb,JSON[_0xfc79('0x15')](_0x3f40e8));_0x324b52(_0x3f40e8);})[_0xfc79('0x25')](function(_0x94c073){logger['error'](_0xfc79('0x26'),_0x94c073[_0xfc79('0x17')],_0x4c7afb);_0x3bac69(_0x137420[_0xfc79('0x16')](0x1f4,_0x94c073['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index ab7d877..765f1c5 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 _0xd763=['register','length','update','emit','removeListener'];(function(_0x24dd09,_0x124407){var _0x191ba8=function(_0x4439c4){while(--_0x4439c4){_0x24dd09['push'](_0x24dd09['shift']());}};_0x191ba8(++_0x124407);}(_0xd763,0x17e));var _0x3d76=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xd763[_0x342baa];return _0x1208f3;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save','remove',_0x3d76('0x0')];function createListener(_0x2eb22c,_0x1f7695){return function(_0x4908a4){_0x1f7695[_0x3d76('0x1')](_0x2eb22c,_0x4908a4);};}function removeListener(_0xe0258f,_0x1568cf){return function(){MailQueueEvents[_0x3d76('0x2')](_0xe0258f,_0x1568cf);};}exports[_0x3d76('0x3')]=function(_0x78edc2){for(var _0x1b94dd=0x0,_0x1ed389=events[_0x3d76('0x4')];_0x1b94dd<_0x1ed389;_0x1b94dd++){var _0x2010f4=events[_0x1b94dd];var _0x5df795=createListener('mailQueue:'+_0x2010f4,_0x78edc2);MailQueueEvents['on'](_0x2010f4,_0x5df795);}}; \ No newline at end of file +var _0x38a5=['emit','removeListener','./mailQueue.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x38a5,0x1da));var _0x538a=function(_0x2eb87c,_0xc575b2){_0x2eb87c=_0x2eb87c-0x0;var _0x1b80f7=_0x38a5[_0x2eb87c];return _0x1b80f7;};'use strict';var MailQueueEvents=require(_0x538a('0x0'));var events=[_0x538a('0x1'),'remove','update'];function createListener(_0x23914c,_0xaf825a){return function(_0x355d1b){_0xaf825a[_0x538a('0x2')](_0x23914c,_0x355d1b);};}function removeListener(_0x3ea88a,_0x479ff5){return function(){MailQueueEvents[_0x538a('0x3')](_0x3ea88a,_0x479ff5);};}exports['register']=function(_0x2b0d72){for(var _0x463796=0x0,_0x5e3418=events['length'];_0x463796<_0x5e3418;_0x463796++){var _0xbc5b3a=events[_0x463796];var _0x1c4db0=createListener('mailQueue:'+_0xbc5b3a,_0x2b0d72);MailQueueEvents['on'](_0xbc5b3a,_0x1c4db0);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index be70780..02927d5 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 _0x8fdf=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','connect-timeout','fs-extra'];(function(_0x2e3715,_0x1c1e1c){var _0x1e7c6f=function(_0x1a13d8){while(--_0x1a13d8){_0x2e3715['push'](_0x2e3715['shift']());}};_0x1e7c6f(++_0x1c1e1c);}(_0x8fdf,0x18e));var _0xf8fd=function(_0x192028,_0x630458){_0x192028=_0x192028-0x0;var _0x1fc90d=_0x8fdf[_0x192028];return _0x1fc90d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf8fd('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf8fd('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0xf8fd('0x2'));var config=require(_0xf8fd('0x3'));var controller=require('./mailQueueReport.controller');router[_0xf8fd('0x4')]('/',auth[_0xf8fd('0x5')](),controller[_0xf8fd('0x6')]);router[_0xf8fd('0x4')](_0xf8fd('0x7'),auth[_0xf8fd('0x5')](),controller[_0xf8fd('0x8')]);router[_0xf8fd('0x4')](_0xf8fd('0x9'),auth['isAuthenticated'](),controller[_0xf8fd('0xa')]);router[_0xf8fd('0xb')]('/',auth[_0xf8fd('0x5')](),controller[_0xf8fd('0xc')]);router['put']('/:id',auth[_0xf8fd('0x5')](),controller[_0xf8fd('0xd')]);router[_0xf8fd('0xe')](_0xf8fd('0x9'),auth[_0xf8fd('0x5')](),controller['destroy']);module[_0xf8fd('0xf')]=router; \ No newline at end of file +var _0x9a78=['fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','describe','get','show','post','put','/:id','update','delete','multer','util','path','Router'];(function(_0x447af3,_0x381c44){var _0x202e95=function(_0x29daef){while(--_0x29daef){_0x447af3['push'](_0x447af3['shift']());}};_0x202e95(++_0x381c44);}(_0x9a78,0xfb));var _0x89a7=function(_0x5e4850,_0x47dd57){_0x5e4850=_0x5e4850-0x0;var _0x2218d9=_0x9a78[_0x5e4850];return _0x2218d9;};'use strict';var multer=require(_0x89a7('0x0'));var util=require(_0x89a7('0x1'));var path=require(_0x89a7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x89a7('0x3')]();var fs_extra=require(_0x89a7('0x4'));var auth=require(_0x89a7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x89a7('0x6'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0x89a7('0x7')](),controller[_0x89a7('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x89a7('0x9')]);router[_0x89a7('0xa')]('/:id',auth[_0x89a7('0x7')](),controller[_0x89a7('0xb')]);router[_0x89a7('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x89a7('0xd')](_0x89a7('0xe'),auth[_0x89a7('0x7')](),controller[_0x89a7('0xf')]);router[_0x89a7('0x10')](_0x89a7('0xe'),auth[_0x89a7('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 23746dc..2043361 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 _0x331b=['DATE','moment','exports','STRING'];(function(_0x25e5fc,_0x311ae6){var _0xca77fb=function(_0x454e74){while(--_0x454e74){_0x25e5fc['push'](_0x25e5fc['shift']());}};_0xca77fb(++_0x311ae6);}(_0x331b,0x149));var _0xb331=function(_0x4bb338,_0x465d68){_0x4bb338=_0x4bb338-0x0;var _0x218d7f=_0x331b[_0x4bb338];return _0x218d7f;};'use strict';var moment=require(_0xb331('0x0'));var Sequelize=require('sequelize');module[_0xb331('0x1')]={'uniqueid':{'type':Sequelize[_0xb331('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xb331('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb331('0x3')]},'acceptAt':{'type':Sequelize[_0xb331('0x3')]},'exitAt':{'type':Sequelize[_0xb331('0x3')]},'reason':{'type':Sequelize[_0xb331('0x2')]}}; \ No newline at end of file +var _0x0f4d=['STRING','DATE'];(function(_0x4e0f47,_0x16d5f5){var _0x5e6029=function(_0x23ada1){while(--_0x23ada1){_0x4e0f47['push'](_0x4e0f47['shift']());}};_0x5e6029(++_0x16d5f5);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x3975a0,_0x44f10b){_0x3975a0=_0x3975a0-0x0;var _0x2bb156=_0x0f4d[_0x3975a0];return _0x2bb156;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xd0f4('0x0')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd0f4('0x1')]},'leaveAt':{'type':Sequelize[_0xd0f4('0x1')]},'acceptAt':{'type':Sequelize[_0xd0f4('0x1')]},'exitAt':{'type':Sequelize[_0xd0f4('0x1')]},'reason':{'type':Sequelize[_0xd0f4('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index c67b4d9..20f57bc 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 _0x4888=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','MailQueueReport','includeAll','include','rows','catch','params','options','create','body','update','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x4888,0x198));var _0x8488=function(_0x434f2e,_0x68493e){_0x434f2e=_0x434f2e-0x0;var _0x76c0b9=_0x4888[_0x434f2e];return _0x76c0b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['MailQueueReport']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':!![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')](_0x52042c[_0x8488('0x42')],{})[_0x8488('0x21')](respondWithResult(_0x1f0516,0xc9))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x43')]=function(_0x299d8e,_0x1bc2e1){if(_0x299d8e[_0x8488('0x42')]['id']){delete _0x299d8e[_0x8488('0x42')]['id'];}return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x299d8e['params']['id']}})['then'](handleEntityNotFound(_0x1bc2e1,null))[_0x8488('0x21')](saveUpdates(_0x299d8e[_0x8488('0x42')],null))[_0x8488('0x21')](respondWithResult(_0x1bc2e1,null))[_0x8488('0x3e')](handleError(_0x1bc2e1,null));};exports[_0x8488('0x45')]=function(_0x22d22c,_0x25f2dc){return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x22d22c['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x25f2dc,null))[_0x8488('0x21')](removeEntity(_0x25f2dc,null))['catch'](handleError(_0x25f2dc,null));};exports[_0x8488('0x46')]=function(_0x313e00,_0x186747){return db[_0x8488('0x3a')]['describe']()[_0x8488('0x21')](respondWithResult(_0x186747,null))[_0x8488('0x3e')](handleError(_0x186747,null));}; \ No newline at end of file +var _0x6d11=['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','MailQueueReport','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','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6d11,0xbf));var _0x16d1=function(_0x3942d3,_0x3e0381){_0x3942d3=_0x3942d3-0x0;var _0xf90e4c=_0x6d11[_0x3942d3];return _0xf90e4c;};'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));};exports[_0x16d1('0x43')]=function(_0xbf100f,_0x39fd41){return db[_0x16d1('0x29')]['describe']()[_0x16d1('0x22')](respondWithResult(_0x39fd41,null))[_0x16d1('0x3f')](handleError(_0x39fd41,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 852fa64..89995fd 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 _0x9d61=['request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2cd796,_0x4935d1){var _0x5a44f0=function(_0x25a2ea){while(--_0x25a2ea){_0x2cd796['push'](_0x2cd796['shift']());}};_0x5a44f0(++_0x4935d1);}(_0x9d61,0xbe));var _0x19d6=function(_0xe5608d,_0x1b41c3){_0xe5608d=_0xe5608d-0x0;var _0xe21ae5=_0x9d61[_0xe5608d];return _0xe21ae5;};'use strict';var _=require(_0x19d6('0x0'));var util=require(_0x19d6('0x1'));var logger=require(_0x19d6('0x2'))('api');var moment=require(_0x19d6('0x3'));var BPromise=require(_0x19d6('0x4'));var rp=require(_0x19d6('0x5'));var fs=require('fs');var path=require(_0x19d6('0x6'));var rimraf=require(_0x19d6('0x7'));var config=require(_0x19d6('0x8'));var attributes=require(_0x19d6('0x9'));module[_0x19d6('0xa')]=function(_0x63c596,_0xfbf25b){return _0x63c596[_0x19d6('0xb')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x19d6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf587=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xf587,0x9b));var _0x7f58=function(_0x5e48c1,_0xa284eb){_0x5e48c1=_0x5e48c1-0x0;var _0xf693b6=_0xf587[_0x5e48c1];return _0xf693b6;};'use strict';var _=require(_0x7f58('0x0'));var util=require(_0x7f58('0x1'));var logger=require(_0x7f58('0x2'))(_0x7f58('0x3'));var moment=require(_0x7f58('0x4'));var BPromise=require(_0x7f58('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7f58('0x6'));var config=require(_0x7f58('0x7'));var attributes=require(_0x7f58('0x8'));module[_0x7f58('0x9')]=function(_0x1c2a89,_0x16f82d){return _0x1c2a89[_0x7f58('0xa')](_0x7f58('0xb'),attributes,{'tableName':_0x7f58('0xc'),'paranoid':![],'indexes':[{'name':_0x7f58('0xd'),'fields':[_0x7f58('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 64db91e..916af78 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(_0xac74c7,_0x3b03b4){var _0x2a0ad2=function(_0x2ef348){while(--_0x2ef348){_0xac74c7['push'](_0xac74c7['shift']());}};_0x2a0ad2(++_0x3b03b4);}(_0x1261,0x144));var _0x1126=function(_0x105c51,_0x412d34){_0x105c51=_0x105c51-0x0;var _0x1f727d=_0x1261[_0x105c51];return _0x1f727d;};'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 _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x5e595f,_0x2c0381){var _0x12040a=function(_0x2597b3){while(--_0x2597b3){_0x5e595f['push'](_0x5e595f['shift']());}};_0x12040a(++_0x2c0381);}(_0x7a54,0x106));var _0x47a5=function(_0xe19965,_0x420425){_0xe19965=_0xe19965-0x0;var _0x59cd80=_0x7a54[_0xe19965];return _0x59cd80;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 29c1af9..19f7ff7 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x31c322,_0x1e8280){var _0x1510e7=function(_0x541b84){while(--_0x541b84){_0x31c322['push'](_0x31c322['shift']());}};_0x1510e7(++_0x1e8280);}(_0xedd9,0xfc));var _0x9edd=function(_0x5fdcd8,_0x320f99){_0x5fdcd8=_0x5fdcd8-0x0;var _0xd8c06f=_0xedd9[_0x5fdcd8];return _0xd8c06f;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xf943ea,_0x26cd18){var _0x5e2976=function(_0x474732){while(--_0x474732){_0xf943ea['push'](_0xf943ea['shift']());}};_0x5e2976(++_0x26cd18);}(_0xe706,0xa3));var _0x6e70=function(_0x1515c9,_0x3db945){_0x1515c9=_0x1515c9-0x0;var _0x3e9c59=_0xe706[_0x1515c9];return _0x3e9c59;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 33e2281..6d0548f 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 _0xc195=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x2afbb6,_0x4292ea){var _0xb30a78=function(_0x19da99){while(--_0x19da99){_0x2afbb6['push'](_0x2afbb6['shift']());}};_0xb30a78(++_0x4292ea);}(_0xc195,0x93));var _0x5c19=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0xc195[_0x4067ac];return _0x53d74d;};'use strict';var Sequelize=require(_0x5c19('0x0'));module[_0x5c19('0x1')]={'description':{'type':Sequelize[_0x5c19('0x2')]},'host':{'type':Sequelize[_0x5c19('0x2')]},'authentication':{'type':Sequelize[_0x5c19('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x5c19('0x2')]},'password':{'type':Sequelize[_0x5c19('0x2')]},'port':{'type':Sequelize[_0x5c19('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x5c19('0x2')],'defaultValue':_0x5c19('0x5')},'connTimeout':{'type':Sequelize[_0x5c19('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x5c19('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x5c19('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x12a1=['INBOX','exports','STRING','BOOLEAN','INTEGER'];(function(_0x474fa7,_0x1b0704){var _0x3b9388=function(_0x1a61a6){while(--_0x1a61a6){_0x474fa7['push'](_0x474fa7['shift']());}};_0x3b9388(++_0x1b0704);}(_0x12a1,0xbf));var _0x112a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x12a1[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x112a('0x0')]={'description':{'type':Sequelize[_0x112a('0x1')]},'host':{'type':Sequelize[_0x112a('0x1')]},'authentication':{'type':Sequelize[_0x112a('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x112a('0x1')]},'password':{'type':Sequelize[_0x112a('0x1')]},'port':{'type':Sequelize[_0x112a('0x3')]},'tls':{'type':Sequelize[_0x112a('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x112a('0x1')],'defaultValue':_0x112a('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x112a('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x112a('0x1')]},'modernAuthentication':{'type':Sequelize[_0x112a('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 f4e3997..cd9633f 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 _0x3e6f=['mail_servers_in','lodash','util','moment','bluebird','request-promise','path','./mailServerIn.attributes','exports','define','MailServerIn'];(function(_0x33c9a5,_0x56a100){var _0x634f31=function(_0x18cc60){while(--_0x18cc60){_0x33c9a5['push'](_0x33c9a5['shift']());}};_0x634f31(++_0x56a100);}(_0x3e6f,0x14b));var _0xf3e6=function(_0x1920be,_0x597680){_0x1920be=_0x1920be-0x0;var _0x13563d=_0x3e6f[_0x1920be];return _0x13563d;};'use strict';var _=require(_0xf3e6('0x0'));var util=require(_0xf3e6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf3e6('0x2'));var BPromise=require(_0xf3e6('0x3'));var rp=require(_0xf3e6('0x4'));var fs=require('fs');var path=require(_0xf3e6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf3e6('0x6'));module[_0xf3e6('0x7')]=function(_0x54ad69,_0x1da9ab){return _0x54ad69[_0xf3e6('0x8')](_0xf3e6('0x9'),attributes,{'tableName':_0xf3e6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9d4=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0xa9d4,0x103));var _0x4a9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4a9d('0x0'));var util=require(_0x4a9d('0x1'));var logger=require(_0x4a9d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4a9d('0x3'));var rp=require(_0x4a9d('0x4'));var fs=require('fs');var path=require(_0x4a9d('0x5'));var rimraf=require(_0x4a9d('0x6'));var config=require(_0x4a9d('0x7'));var attributes=require(_0x4a9d('0x8'));module[_0x4a9d('0x9')]=function(_0x560c5d,_0x221194){return _0x560c5d[_0x4a9d('0xa')](_0x4a9d('0xb'),attributes,{'tableName':_0x4a9d('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 ec00e8e..0ab4ea2 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 _0x4a00=['lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','GetMailServerIn','MailServerIn','findAll','options','raw','limit','include','map','model','attributes','then','debug','stringify'];(function(_0xb2a9f7,_0xa11328){var _0x5d2d87=function(_0x46e7b4){while(--_0x46e7b4){_0xb2a9f7['push'](_0xb2a9f7['shift']());}};_0x5d2d87(++_0xa11328);}(_0x4a00,0xc6));var _0x04a0=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4a00[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x04a0('0x0'));var util=require(_0x04a0('0x1'));var moment=require(_0x04a0('0x2'));var BPromise=require('bluebird');var rs=require(_0x04a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x04a0('0x4'));var logger=require(_0x04a0('0x5'))(_0x04a0('0x6'));var config=require(_0x04a0('0x7'));var jayson=require(_0x04a0('0x8'));var client=jayson[_0x04a0('0x9')][_0x04a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c38da,_0x40126f,_0x519879){return new BPromise(function(_0x13b953,_0x3be55e){return client[_0x04a0('0xb')](_0x3c38da,_0x519879)['then'](function(_0x49829d){logger[_0x04a0('0xc')](_0x04a0('0xd'),_0x40126f,'request\x20sent');logger['debug'](_0x04a0('0xe'),_0x40126f,'request\x20sent',JSON['stringify'](_0x49829d));if(_0x49829d[_0x04a0('0xf')]){if(_0x49829d[_0x04a0('0xf')][_0x04a0('0x10')]===0x1f4){logger[_0x04a0('0xf')]('MailServerIn,\x20%s,\x20%s',_0x40126f,_0x49829d[_0x04a0('0xf')][_0x04a0('0x11')]);return _0x3be55e(_0x49829d[_0x04a0('0xf')]['message']);}logger[_0x04a0('0xf')](_0x04a0('0xd'),_0x40126f,_0x49829d[_0x04a0('0xf')][_0x04a0('0x11')]);return _0x13b953(_0x49829d[_0x04a0('0xf')][_0x04a0('0x11')]);}else{logger[_0x04a0('0xc')](_0x04a0('0xd'),_0x40126f,_0x04a0('0x12'));_0x13b953(_0x49829d['result']['message']);}})[_0x04a0('0x13')](function(_0x9ad3dd){logger[_0x04a0('0xf')](_0x04a0('0xd'),_0x40126f,_0x9ad3dd);_0x3be55e(_0x9ad3dd);});});}exports[_0x04a0('0x14')]=function(_0x5e8470){var _0x186b78=this;return new Promise(function(_0x20b51a,_0xff1ced){return db[_0x04a0('0x15')][_0x04a0('0x16')]({'raw':_0x5e8470[_0x04a0('0x17')]?_0x5e8470['options'][_0x04a0('0x18')]===undefined?!![]:![]:!![],'where':_0x5e8470[_0x04a0('0x17')]?_0x5e8470[_0x04a0('0x17')]['where']||null:null,'attributes':_0x5e8470['options']?_0x5e8470[_0x04a0('0x17')]['attributes']||null:null,'limit':_0x5e8470[_0x04a0('0x17')]?_0x5e8470[_0x04a0('0x17')][_0x04a0('0x19')]||null:null,'include':_0x5e8470[_0x04a0('0x17')]?_0x5e8470[_0x04a0('0x17')][_0x04a0('0x1a')]?_[_0x04a0('0x1b')](_0x5e8470[_0x04a0('0x17')]['include'],function(_0x3376cb){return{'model':db[_0x3376cb[_0x04a0('0x1c')]],'as':_0x3376cb['as'],'attributes':_0x3376cb[_0x04a0('0x1d')],'include':_0x3376cb['include']?_[_0x04a0('0x1b')](_0x3376cb[_0x04a0('0x1a')],function(_0x3fce91){return{'model':db[_0x3fce91[_0x04a0('0x1c')]],'as':_0x3fce91['as'],'attributes':_0x3fce91[_0x04a0('0x1d')],'include':_0x3fce91['include']?_['map'](_0x3fce91[_0x04a0('0x1a')],function(_0x5d3d75){return{'model':db[_0x5d3d75['model']],'as':_0x5d3d75['as'],'attributes':_0x5d3d75[_0x04a0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x04a0('0x1e')](function(_0x391ec0){logger[_0x04a0('0xc')](_0x04a0('0x14'),_0x5e8470);logger[_0x04a0('0x1f')]('GetMailServerIn',_0x5e8470,JSON[_0x04a0('0x20')](_0x391ec0));_0x20b51a(_0x391ec0);})[_0x04a0('0x13')](function(_0x13a1f7){logger[_0x04a0('0xf')](_0x04a0('0x14'),_0x13a1f7[_0x04a0('0x11')],_0x5e8470);_0xff1ced(_0x186b78[_0x04a0('0xf')](0x1f4,_0x13a1f7[_0x04a0('0x11')]));});});}; \ No newline at end of file +var _0x9585=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','info','result','catch','GetMailServerIn','findAll','options','raw','where','attributes','limit','include','model','map','util','bluebird'];(function(_0x49cf7c,_0x162b8d){var _0x356f37=function(_0x1ae290){while(--_0x1ae290){_0x49cf7c['push'](_0x49cf7c['shift']());}};_0x356f37(++_0x162b8d);}(_0x9585,0x15e));var _0x5958=function(_0x43b2f7,_0x4b3d39){_0x43b2f7=_0x43b2f7-0x0;var _0x53a55d=_0x9585[_0x43b2f7];return _0x53a55d;};'use strict';var _=require('lodash');var util=require(_0x5958('0x0'));var moment=require('moment');var BPromise=require(_0x5958('0x1'));var rs=require(_0x5958('0x2'));var fs=require('fs');var Redis=require(_0x5958('0x3'));var db=require(_0x5958('0x4'))['db'];var utils=require(_0x5958('0x5'));var logger=require(_0x5958('0x6'))(_0x5958('0x7'));var config=require(_0x5958('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5958('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc050d5,_0xd655ec,_0x264827){return new BPromise(function(_0x5be2d9,_0x1e2de1){return client['request'](_0xc050d5,_0x264827)[_0x5958('0xa')](function(_0x12aa98){logger['info']('MailServerIn,\x20%s,\x20%s',_0xd655ec,_0x5958('0xb'));logger[_0x5958('0xc')](_0x5958('0xd'),_0xd655ec,_0x5958('0xb'),JSON[_0x5958('0xe')](_0x12aa98));if(_0x12aa98['error']){if(_0x12aa98[_0x5958('0xf')][_0x5958('0x10')]===0x1f4){logger[_0x5958('0xf')](_0x5958('0x11'),_0xd655ec,_0x12aa98[_0x5958('0xf')]['message']);return _0x1e2de1(_0x12aa98['error'][_0x5958('0x12')]);}logger[_0x5958('0xf')](_0x5958('0x11'),_0xd655ec,_0x12aa98['error'][_0x5958('0x12')]);return _0x5be2d9(_0x12aa98[_0x5958('0xf')][_0x5958('0x12')]);}else{logger[_0x5958('0x13')]('MailServerIn,\x20%s,\x20%s',_0xd655ec,_0x5958('0xb'));_0x5be2d9(_0x12aa98[_0x5958('0x14')][_0x5958('0x12')]);}})[_0x5958('0x15')](function(_0x2c9bcf){logger[_0x5958('0xf')]('MailServerIn,\x20%s,\x20%s',_0xd655ec,_0x2c9bcf);_0x1e2de1(_0x2c9bcf);});});}exports[_0x5958('0x16')]=function(_0x7cd01c){var _0x146ef3=this;return new Promise(function(_0x26c29d,_0x394bef){return db['MailServerIn'][_0x5958('0x17')]({'raw':_0x7cd01c[_0x5958('0x18')]?_0x7cd01c[_0x5958('0x18')][_0x5958('0x19')]===undefined?!![]:![]:!![],'where':_0x7cd01c[_0x5958('0x18')]?_0x7cd01c['options'][_0x5958('0x1a')]||null:null,'attributes':_0x7cd01c['options']?_0x7cd01c['options'][_0x5958('0x1b')]||null:null,'limit':_0x7cd01c['options']?_0x7cd01c[_0x5958('0x18')][_0x5958('0x1c')]||null:null,'include':_0x7cd01c[_0x5958('0x18')]?_0x7cd01c[_0x5958('0x18')][_0x5958('0x1d')]?_['map'](_0x7cd01c['options']['include'],function(_0x154aa3){return{'model':db[_0x154aa3[_0x5958('0x1e')]],'as':_0x154aa3['as'],'attributes':_0x154aa3[_0x5958('0x1b')],'include':_0x154aa3[_0x5958('0x1d')]?_['map'](_0x154aa3[_0x5958('0x1d')],function(_0x46888d){return{'model':db[_0x46888d[_0x5958('0x1e')]],'as':_0x46888d['as'],'attributes':_0x46888d['attributes'],'include':_0x46888d[_0x5958('0x1d')]?_[_0x5958('0x1f')](_0x46888d[_0x5958('0x1d')],function(_0x29b7f7){return{'model':db[_0x29b7f7[_0x5958('0x1e')]],'as':_0x29b7f7['as'],'attributes':_0x29b7f7[_0x5958('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5958('0xa')](function(_0x54ab3c){logger['info'](_0x5958('0x16'),_0x7cd01c);logger[_0x5958('0xc')](_0x5958('0x16'),_0x7cd01c,JSON['stringify'](_0x54ab3c));_0x26c29d(_0x54ab3c);})[_0x5958('0x15')](function(_0x388123){logger[_0x5958('0xf')](_0x5958('0x16'),_0x388123[_0x5958('0x12')],_0x7cd01c);_0x394bef(_0x146ef3[_0x5958('0xf')](0x1f4,_0x388123[_0x5958('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 4ad317b..3be7536 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x7a54,0x106));var _0x47a5=function(_0x2ba1a8,_0x51f6cc){_0x2ba1a8=_0x2ba1a8-0x0;var _0x1de8b3=_0x7a54[_0x2ba1a8];return _0x1de8b3;};'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 5239518..0677175 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 _0x3266=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x1bb2e1,_0x13e4ff){var _0xa4d622=function(_0x5295b7){while(--_0x5295b7){_0x1bb2e1['push'](_0x1bb2e1['shift']());}};_0xa4d622(++_0x13e4ff);}(_0x3266,0x6a));var _0x6326=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x3266[_0x32b542];return _0x554d54;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'description':{'type':Sequelize[_0x6326('0x2')]},'host':{'type':Sequelize[_0x6326('0x2')]},'user':{'type':Sequelize[_0x6326('0x2')]},'pass':{'type':Sequelize[_0x6326('0x2')]},'port':{'type':Sequelize[_0x6326('0x3')]},'secure':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x6326('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x6326('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x757a=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x514036,_0x44ac6e){var _0x31ccb3=function(_0x25b3fa){while(--_0x25b3fa){_0x514036['push'](_0x514036['shift']());}};_0x31ccb3(++_0x44ac6e);}(_0x757a,0xde));var _0xa757=function(_0x2fbd1d,_0x580553){_0x2fbd1d=_0x2fbd1d-0x0;var _0x50134d=_0x757a[_0x2fbd1d];return _0x50134d;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'description':{'type':Sequelize[_0xa757('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xa757('0x2')]},'secure':{'type':Sequelize[_0xa757('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xa757('0x1')]},'authentication':{'type':Sequelize[_0xa757('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xa757('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index ee2dd26..3985b28 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 _0x67a4=['rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','keys','include','create','body','params','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','map','MailServerOut'];(function(_0x27a125,_0x330c0e){var _0x36eac1=function(_0x49265f){while(--_0x49265f){_0x27a125['push'](_0x27a125['shift']());}};_0x36eac1(++_0x330c0e);}(_0x67a4,0xae));var _0x467a=function(_0x2b49bc,_0x47b636){_0x2b49bc=_0x2b49bc-0x0;var _0x43cc65=_0x67a4[_0x2b49bc];return _0x43cc65;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x467a('0x0'));var zipdir=require(_0x467a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x467a('0x2'));var BPromise=require(_0x467a('0x3'));var Mustache=require(_0x467a('0x4'));var util=require('util');var path=require(_0x467a('0x5'));var sox=require(_0x467a('0x6'));var csv=require(_0x467a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x467a('0x8'));var _=require('lodash');var squel=require(_0x467a('0x9'));var crypto=require(_0x467a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x467a('0xb'));var toCsv=require(_0x467a('0x7'));var querystring=require(_0x467a('0xc'));var Papa=require(_0x467a('0xd'));var Redis=require(_0x467a('0xe'));var authService=require(_0x467a('0xf'));var qs=require(_0x467a('0x10'));var as=require(_0x467a('0x11'));var hardwareService=require(_0x467a('0x12'));var logger=require('../../config/logger')(_0x467a('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x467a('0x14'));var db=require(_0x467a('0x15'))['db'];function respondWithStatusCode(_0x3e3141,_0x22c72a){_0x22c72a=_0x22c72a||0xcc;return function(_0x381154){if(_0x381154){return _0x3e3141[_0x467a('0x16')](_0x22c72a);}return _0x3e3141[_0x467a('0x17')](_0x22c72a)[_0x467a('0x18')]();};}function respondWithResult(_0x4642fc,_0x390f35){_0x390f35=_0x390f35||0xc8;return function(_0x30f54c){if(_0x30f54c){return _0x4642fc[_0x467a('0x17')](_0x390f35)[_0x467a('0x19')](_0x30f54c);}};}function respondWithFilteredResult(_0x289791,_0x551975){return function(_0x2b98de){if(_0x2b98de){var _0x3f780c=typeof _0x551975[_0x467a('0x1a')]===_0x467a('0x1b')&&typeof _0x551975[_0x467a('0x1c')]===_0x467a('0x1b');var _0x53f0b5=_0x2b98de[_0x467a('0x1d')];var _0x306c8e=_0x3f780c?0x0:_0x551975[_0x467a('0x1a')];var _0x1805ac=_0x3f780c?_0x2b98de[_0x467a('0x1d')]:_0x551975['offset']+_0x551975[_0x467a('0x1c')];var _0x8dbbcf;if(_0x1805ac>=_0x53f0b5){_0x1805ac=_0x53f0b5;_0x8dbbcf=0xc8;}else{_0x8dbbcf=0xce;}_0x289791[_0x467a('0x17')](_0x8dbbcf);return _0x289791[_0x467a('0x1e')]('Content-Range',_0x306c8e+'-'+_0x1805ac+'/'+_0x53f0b5)[_0x467a('0x19')](_0x2b98de);}return null;};}function patchUpdates(_0x458aca){return function(_0x5e4693){try{jsonpatch[_0x467a('0x1f')](_0x5e4693,_0x458aca,!![]);}catch(_0x9a6c0){return BPromise[_0x467a('0x20')](_0x9a6c0);}return _0x5e4693[_0x467a('0x21')]();};}function saveUpdates(_0x1b70e0,_0x1308b5){return function(_0x1f7bc8){if(_0x1f7bc8){return _0x1f7bc8[_0x467a('0x22')](_0x1b70e0)['then'](function(_0x3ba8d1){return _0x3ba8d1;});}return null;};}function removeEntity(_0x883e99,_0x208877){return function(_0x167cb3){if(_0x167cb3){return _0x167cb3['destroy']()[_0x467a('0x23')](function(){_0x883e99['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a16a0,_0x24318c){return function(_0x3a56a1){if(!_0x3a56a1){_0x1a16a0[_0x467a('0x16')](0x194);}return _0x3a56a1;};}function handleError(_0x52fe17,_0x35c485){_0x35c485=_0x35c485||0x1f4;return function(_0x656670){logger['error'](_0x656670[_0x467a('0x24')]);if(_0x656670[_0x467a('0x25')]){delete _0x656670[_0x467a('0x25')];}_0x52fe17[_0x467a('0x17')](_0x35c485)[_0x467a('0x26')](_0x656670);};}exports[_0x467a('0x27')]=function(_0xbfca2f,_0x635ca2){var _0x17e310={},_0x3a0b13={},_0x35470d={'count':0x0,'rows':[]};var _0x22d1db=_[_0x467a('0x28')](db[_0x467a('0x29')][_0x467a('0x2a')],function(_0x3c82ab){return{'name':_0x3c82ab[_0x467a('0x2b')],'type':_0x3c82ab[_0x467a('0x2c')][_0x467a('0x2d')]};});_0x3a0b13['model']=_[_0x467a('0x28')](_0x22d1db,_0x467a('0x25'));_0x3a0b13[_0x467a('0x2e')]=_['keys'](_0xbfca2f['query']);_0x3a0b13['filters']=_[_0x467a('0x2f')](_0x3a0b13[_0x467a('0x30')],_0x3a0b13[_0x467a('0x2e')]);_0x17e310[_0x467a('0x31')]=_[_0x467a('0x2f')](_0x3a0b13['model'],qs[_0x467a('0x32')](_0xbfca2f[_0x467a('0x2e')][_0x467a('0x32')]));_0x17e310[_0x467a('0x31')]=_0x17e310['attributes'][_0x467a('0x33')]?_0x17e310[_0x467a('0x31')]:_0x3a0b13[_0x467a('0x30')];if(!_0xbfca2f[_0x467a('0x2e')]['hasOwnProperty'](_0x467a('0x34'))){_0x17e310[_0x467a('0x1c')]=qs[_0x467a('0x1c')](_0xbfca2f[_0x467a('0x2e')][_0x467a('0x1c')]);_0x17e310['offset']=qs[_0x467a('0x1a')](_0xbfca2f[_0x467a('0x2e')][_0x467a('0x1a')]);}_0x17e310[_0x467a('0x35')]=qs[_0x467a('0x36')](_0xbfca2f[_0x467a('0x2e')][_0x467a('0x36')]);_0x17e310[_0x467a('0x37')]=qs[_0x467a('0x38')](_[_0x467a('0x39')](_0xbfca2f[_0x467a('0x2e')],_0x3a0b13['filters']),_0x22d1db);if(_0xbfca2f[_0x467a('0x2e')][_0x467a('0x3a')]){_0x17e310[_0x467a('0x37')]=_['merge'](_0x17e310['where'],{'$or':_[_0x467a('0x28')](_0x22d1db,function(_0x6c4044){if(_0x6c4044['type']!==_0x467a('0x3b')){var _0x48d549={};_0x48d549[_0x6c4044[_0x467a('0x25')]]={'$like':'%'+_0xbfca2f[_0x467a('0x2e')][_0x467a('0x3a')]+'%'};return _0x48d549;}})});}_0x17e310=_[_0x467a('0x3c')]({},_0x17e310,_0xbfca2f[_0x467a('0x3d')]);var _0x2a9482={'where':_0x17e310[_0x467a('0x37')]};return db[_0x467a('0x29')][_0x467a('0x1d')](_0x2a9482)[_0x467a('0x23')](function(_0xf7c344){_0x35470d[_0x467a('0x1d')]=_0xf7c344;if(_0xbfca2f[_0x467a('0x2e')][_0x467a('0x3e')]){_0x17e310['include']=[{'all':!![]}];}return db[_0x467a('0x29')][_0x467a('0x3f')](_0x17e310);})[_0x467a('0x23')](function(_0x5c7332){_0x35470d[_0x467a('0x40')]=_0x5c7332;return _0x35470d;})['then'](respondWithFilteredResult(_0x635ca2,_0x17e310))[_0x467a('0x41')](handleError(_0x635ca2,null));};exports[_0x467a('0x42')]=function(_0x551f74,_0x277ff4){var _0x4a43db={'raw':!![],'where':{'id':_0x551f74['params']['id']}},_0x265396={};_0x265396[_0x467a('0x30')]=_[_0x467a('0x43')](db[_0x467a('0x29')][_0x467a('0x2a')]);_0x265396[_0x467a('0x2e')]=_[_0x467a('0x43')](_0x551f74['query']);_0x265396[_0x467a('0x38')]=_[_0x467a('0x2f')](_0x265396[_0x467a('0x30')],_0x265396[_0x467a('0x2e')]);_0x4a43db[_0x467a('0x31')]=_['intersection'](_0x265396[_0x467a('0x30')],qs[_0x467a('0x32')](_0x551f74['query'][_0x467a('0x32')]));_0x4a43db[_0x467a('0x31')]=_0x4a43db[_0x467a('0x31')]['length']?_0x4a43db[_0x467a('0x31')]:_0x265396[_0x467a('0x30')];if(_0x551f74[_0x467a('0x2e')][_0x467a('0x3e')]){_0x4a43db[_0x467a('0x44')]=[{'all':!![]}];}_0x4a43db=_[_0x467a('0x3c')]({},_0x4a43db,_0x551f74['options']);return db[_0x467a('0x29')]['find'](_0x4a43db)[_0x467a('0x23')](handleEntityNotFound(_0x277ff4,null))[_0x467a('0x23')](respondWithResult(_0x277ff4,null))[_0x467a('0x41')](handleError(_0x277ff4,null));};exports[_0x467a('0x45')]=function(_0x288f8e,_0xa4f810){return db[_0x467a('0x29')][_0x467a('0x45')](_0x288f8e['body'],{})[_0x467a('0x23')](respondWithResult(_0xa4f810,0xc9))[_0x467a('0x41')](handleError(_0xa4f810,null));};exports['update']=function(_0x256658,_0x58d9e9){if(_0x256658[_0x467a('0x46')]['id']){delete _0x256658['body']['id'];}return db[_0x467a('0x29')]['find']({'where':{'id':_0x256658[_0x467a('0x47')]['id']}})[_0x467a('0x23')](handleEntityNotFound(_0x58d9e9,null))[_0x467a('0x23')](saveUpdates(_0x256658[_0x467a('0x46')],null))[_0x467a('0x23')](respondWithResult(_0x58d9e9,null))[_0x467a('0x41')](handleError(_0x58d9e9,null));};exports['destroy']=function(_0x16c587,_0x3ba046){return db['MailServerOut']['find']({'where':{'id':_0x16c587['params']['id']}})[_0x467a('0x23')](handleEntityNotFound(_0x3ba046,null))[_0x467a('0x23')](removeEntity(_0x3ba046,null))[_0x467a('0x41')](handleError(_0x3ba046,null));}; \ No newline at end of file +var _0x6d57=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','MailServerOut','key','map','query','keys','filters'];(function(_0x53ab02,_0x780c4b){var _0x120bc6=function(_0x3c4b84){while(--_0x3c4b84){_0x53ab02['push'](_0x53ab02['shift']());}};_0x120bc6(++_0x780c4b);}(_0x6d57,0xba));var _0x76d5=function(_0x3da456,_0x1127a8){_0x3da456=_0x3da456-0x0;var _0x41c21e=_0x6d57[_0x3da456];return _0x41c21e;};'use strict';var emlformat=require(_0x76d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76d5('0x1'));var jsonpatch=require(_0x76d5('0x2'));var rp=require(_0x76d5('0x3'));var moment=require(_0x76d5('0x4'));var BPromise=require(_0x76d5('0x5'));var Mustache=require(_0x76d5('0x6'));var util=require(_0x76d5('0x7'));var path=require(_0x76d5('0x8'));var sox=require(_0x76d5('0x9'));var csv=require(_0x76d5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76d5('0xb'));var _=require(_0x76d5('0xc'));var squel=require(_0x76d5('0xd'));var crypto=require(_0x76d5('0xe'));var jsforce=require(_0x76d5('0xf'));var deskjs=require(_0x76d5('0x10'));var toCsv=require(_0x76d5('0xa'));var querystring=require(_0x76d5('0x11'));var Papa=require(_0x76d5('0x12'));var Redis=require(_0x76d5('0x13'));var authService=require(_0x76d5('0x14'));var qs=require(_0x76d5('0x15'));var as=require(_0x76d5('0x16'));var hardwareService=require(_0x76d5('0x17'));var logger=require(_0x76d5('0x18'))(_0x76d5('0x19'));var utils=require('../../config/utils');var config=require(_0x76d5('0x1a'));var licenseUtil=require(_0x76d5('0x1b'));var db=require(_0x76d5('0x1c'))['db'];function respondWithStatusCode(_0x5850df,_0x5624aa){_0x5624aa=_0x5624aa||0xcc;return function(_0xe3c5e7){if(_0xe3c5e7){return _0x5850df[_0x76d5('0x1d')](_0x5624aa);}return _0x5850df[_0x76d5('0x1e')](_0x5624aa)[_0x76d5('0x1f')]();};}function respondWithResult(_0x5dd56d,_0x3123b9){_0x3123b9=_0x3123b9||0xc8;return function(_0x1f83fb){if(_0x1f83fb){return _0x5dd56d['status'](_0x3123b9)[_0x76d5('0x20')](_0x1f83fb);}};}function respondWithFilteredResult(_0x5d2772,_0xb3bb0f){return function(_0x3078a6){if(_0x3078a6){var _0x476746=typeof _0xb3bb0f[_0x76d5('0x21')]===_0x76d5('0x22')&&typeof _0xb3bb0f[_0x76d5('0x23')]==='undefined';var _0x38a35e=_0x3078a6[_0x76d5('0x24')];var _0x1bc802=_0x476746?0x0:_0xb3bb0f[_0x76d5('0x21')];var _0x38f05b=_0x476746?_0x3078a6[_0x76d5('0x24')]:_0xb3bb0f[_0x76d5('0x21')]+_0xb3bb0f[_0x76d5('0x23')];var _0x5659aa;if(_0x38f05b>=_0x38a35e){_0x38f05b=_0x38a35e;_0x5659aa=0xc8;}else{_0x5659aa=0xce;}_0x5d2772[_0x76d5('0x1e')](_0x5659aa);return _0x5d2772[_0x76d5('0x25')]('Content-Range',_0x1bc802+'-'+_0x38f05b+'/'+_0x38a35e)[_0x76d5('0x20')](_0x3078a6);}return null;};}function patchUpdates(_0x428383){return function(_0x3d56f8){try{jsonpatch[_0x76d5('0x26')](_0x3d56f8,_0x428383,!![]);}catch(_0x7a9a8b){return BPromise[_0x76d5('0x27')](_0x7a9a8b);}return _0x3d56f8[_0x76d5('0x28')]();};}function saveUpdates(_0x244344,_0x3d9227){return function(_0x5e4f80){if(_0x5e4f80){return _0x5e4f80[_0x76d5('0x29')](_0x244344)[_0x76d5('0x2a')](function(_0x24216d){return _0x24216d;});}return null;};}function removeEntity(_0x23bce0,_0x34a080){return function(_0x36e847){if(_0x36e847){return _0x36e847[_0x76d5('0x2b')]()[_0x76d5('0x2a')](function(){_0x23bce0['status'](0xcc)[_0x76d5('0x1f')]();});}};}function handleEntityNotFound(_0x194e12,_0x363a62){return function(_0x295d64){if(!_0x295d64){_0x194e12[_0x76d5('0x1d')](0x194);}return _0x295d64;};}function handleError(_0x3972fa,_0x271703){_0x271703=_0x271703||0x1f4;return function(_0x349eae){logger[_0x76d5('0x2c')](_0x349eae[_0x76d5('0x2d')]);if(_0x349eae[_0x76d5('0x2e')]){delete _0x349eae[_0x76d5('0x2e')];}_0x3972fa['status'](_0x271703)['send'](_0x349eae);};}exports[_0x76d5('0x2f')]=function(_0x509e38,_0x19ee75){var _0x58bc77={},_0x34299c={},_0x2683e0={'count':0x0,'rows':[]};var _0x1841de=_['map'](db[_0x76d5('0x30')]['rawAttributes'],function(_0x42dbd6){return{'name':_0x42dbd6['fieldName'],'type':_0x42dbd6['type'][_0x76d5('0x31')]};});_0x34299c['model']=_[_0x76d5('0x32')](_0x1841de,_0x76d5('0x2e'));_0x34299c[_0x76d5('0x33')]=_[_0x76d5('0x34')](_0x509e38['query']);_0x34299c[_0x76d5('0x35')]=_[_0x76d5('0x36')](_0x34299c[_0x76d5('0x37')],_0x34299c[_0x76d5('0x33')]);_0x58bc77[_0x76d5('0x38')]=_[_0x76d5('0x36')](_0x34299c[_0x76d5('0x37')],qs[_0x76d5('0x39')](_0x509e38[_0x76d5('0x33')]['fields']));_0x58bc77[_0x76d5('0x38')]=_0x58bc77['attributes'][_0x76d5('0x3a')]?_0x58bc77[_0x76d5('0x38')]:_0x34299c[_0x76d5('0x37')];if(!_0x509e38[_0x76d5('0x33')][_0x76d5('0x3b')](_0x76d5('0x3c'))){_0x58bc77[_0x76d5('0x23')]=qs[_0x76d5('0x23')](_0x509e38[_0x76d5('0x33')][_0x76d5('0x23')]);_0x58bc77[_0x76d5('0x21')]=qs[_0x76d5('0x21')](_0x509e38[_0x76d5('0x33')]['offset']);}_0x58bc77[_0x76d5('0x3d')]=qs[_0x76d5('0x3e')](_0x509e38['query']['sort']);_0x58bc77[_0x76d5('0x3f')]=qs[_0x76d5('0x35')](_['pick'](_0x509e38['query'],_0x34299c[_0x76d5('0x35')]),_0x1841de);if(_0x509e38[_0x76d5('0x33')][_0x76d5('0x40')]){_0x58bc77[_0x76d5('0x3f')]=_['merge'](_0x58bc77['where'],{'$or':_[_0x76d5('0x32')](_0x1841de,function(_0x12b9be){if(_0x12b9be[_0x76d5('0x41')]!==_0x76d5('0x42')){var _0x540b27={};_0x540b27[_0x12b9be[_0x76d5('0x2e')]]={'$like':'%'+_0x509e38[_0x76d5('0x33')][_0x76d5('0x40')]+'%'};return _0x540b27;}})});}_0x58bc77=_[_0x76d5('0x43')]({},_0x58bc77,_0x509e38[_0x76d5('0x44')]);var _0xe3ce2c={'where':_0x58bc77[_0x76d5('0x3f')]};return db[_0x76d5('0x30')][_0x76d5('0x24')](_0xe3ce2c)['then'](function(_0x211c74){_0x2683e0[_0x76d5('0x24')]=_0x211c74;if(_0x509e38[_0x76d5('0x33')][_0x76d5('0x45')]){_0x58bc77[_0x76d5('0x46')]=[{'all':!![]}];}return db[_0x76d5('0x30')][_0x76d5('0x47')](_0x58bc77);})[_0x76d5('0x2a')](function(_0x3b7a1d){_0x2683e0[_0x76d5('0x48')]=_0x3b7a1d;return _0x2683e0;})[_0x76d5('0x2a')](respondWithFilteredResult(_0x19ee75,_0x58bc77))[_0x76d5('0x49')](handleError(_0x19ee75,null));};exports[_0x76d5('0x4a')]=function(_0xfce8ad,_0x5c6dc0){var _0x5043c6={'raw':!![],'where':{'id':_0xfce8ad[_0x76d5('0x4b')]['id']}},_0x17d426={};_0x17d426[_0x76d5('0x37')]=_['keys'](db['MailServerOut'][_0x76d5('0x4c')]);_0x17d426['query']=_[_0x76d5('0x34')](_0xfce8ad[_0x76d5('0x33')]);_0x17d426[_0x76d5('0x35')]=_[_0x76d5('0x36')](_0x17d426[_0x76d5('0x37')],_0x17d426[_0x76d5('0x33')]);_0x5043c6[_0x76d5('0x38')]=_[_0x76d5('0x36')](_0x17d426[_0x76d5('0x37')],qs[_0x76d5('0x39')](_0xfce8ad[_0x76d5('0x33')]['fields']));_0x5043c6['attributes']=_0x5043c6[_0x76d5('0x38')][_0x76d5('0x3a')]?_0x5043c6[_0x76d5('0x38')]:_0x17d426[_0x76d5('0x37')];if(_0xfce8ad[_0x76d5('0x33')][_0x76d5('0x45')]){_0x5043c6[_0x76d5('0x46')]=[{'all':!![]}];}_0x5043c6=_[_0x76d5('0x43')]({},_0x5043c6,_0xfce8ad['options']);return db[_0x76d5('0x30')][_0x76d5('0x4d')](_0x5043c6)['then'](handleEntityNotFound(_0x5c6dc0,null))[_0x76d5('0x2a')](respondWithResult(_0x5c6dc0,null))['catch'](handleError(_0x5c6dc0,null));};exports[_0x76d5('0x4e')]=function(_0x2f37c3,_0x41d5fc){return db['MailServerOut']['create'](_0x2f37c3[_0x76d5('0x4f')],{})['then'](respondWithResult(_0x41d5fc,0xc9))[_0x76d5('0x49')](handleError(_0x41d5fc,null));};exports[_0x76d5('0x29')]=function(_0x16e9dc,_0x51a586){if(_0x16e9dc[_0x76d5('0x4f')]['id']){delete _0x16e9dc['body']['id'];}return db['MailServerOut']['find']({'where':{'id':_0x16e9dc[_0x76d5('0x4b')]['id']}})[_0x76d5('0x2a')](handleEntityNotFound(_0x51a586,null))[_0x76d5('0x2a')](saveUpdates(_0x16e9dc['body'],null))['then'](respondWithResult(_0x51a586,null))[_0x76d5('0x49')](handleError(_0x51a586,null));};exports['destroy']=function(_0x1522a8,_0x271b21){return db[_0x76d5('0x30')]['find']({'where':{'id':_0x1522a8[_0x76d5('0x4b')]['id']}})[_0x76d5('0x2a')](handleEntityNotFound(_0x271b21,null))['then'](removeEntity(_0x271b21,null))['catch'](handleError(_0x271b21,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index d8ad34a..4f3a247 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 _0x969f=['MailServerOut','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./mailServerOut.attributes','exports','define'];(function(_0x5a80b3,_0x574647){var _0x2ab3c0=function(_0x2b7781){while(--_0x2b7781){_0x5a80b3['push'](_0x5a80b3['shift']());}};_0x2ab3c0(++_0x574647);}(_0x969f,0x10f));var _0xf969=function(_0xfd183f,_0x21bbde){_0xfd183f=_0xfd183f-0x0;var _0x40b42e=_0x969f[_0xfd183f];return _0x40b42e;};'use strict';var _=require(_0xf969('0x0'));var util=require(_0xf969('0x1'));var logger=require(_0xf969('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf969('0x3'));var rp=require(_0xf969('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf969('0x5'));var attributes=require(_0xf969('0x6'));module[_0xf969('0x7')]=function(_0x10ff1b,_0x2e8fc6){return _0x10ff1b[_0xf969('0x8')](_0xf969('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaaa4=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','mail_servers_out'];(function(_0xd202c3,_0x47025b){var _0x2c4a26=function(_0x19cc8d){while(--_0x19cc8d){_0xd202c3['push'](_0xd202c3['shift']());}};_0x2c4a26(++_0x47025b);}(_0xaaa4,0x160));var _0x4aaa=function(_0x3ae6d4,_0x1a781d){_0x3ae6d4=_0x3ae6d4-0x0;var _0x36e6b4=_0xaaa4[_0x3ae6d4];return _0x36e6b4;};'use strict';var _=require('lodash');var util=require(_0x4aaa('0x0'));var logger=require('../../config/logger')(_0x4aaa('0x1'));var moment=require(_0x4aaa('0x2'));var BPromise=require(_0x4aaa('0x3'));var rp=require(_0x4aaa('0x4'));var fs=require('fs');var path=require(_0x4aaa('0x5'));var rimraf=require(_0x4aaa('0x6'));var config=require(_0x4aaa('0x7'));var attributes=require(_0x4aaa('0x8'));module[_0x4aaa('0x9')]=function(_0x4aabc8,_0x5b75d6){return _0x4aabc8['define']('MailServerOut',attributes,{'tableName':_0x4aaa('0xa'),'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 ed1806d..994a4aa 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 _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x45b960,_0x20ac3b){_0x45b960=_0x45b960-0x0;var _0x3b5b9e=_0x7a54[_0x45b960];return _0x3b5b9e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2d583e,_0x46d024){var _0x1e405e=function(_0x272cd8){while(--_0x272cd8){_0x2d583e['push'](_0x2d583e['shift']());}};_0x1e405e(++_0x46d024);}(_0x1261,0x144));var _0x1126=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x1261[_0x174ef5];return _0x1cc379;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 538dc46..5817124 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 _0x082d=['update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x82140,_0x3a9d87){var _0x2b15a6=function(_0x2b565e){while(--_0x2b565e){_0x82140['push'](_0x82140['shift']());}};_0x2b15a6(++_0x3a9d87);}(_0x082d,0x14e));var _0xd082=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0x082d[_0xa60623];return _0x4a6487;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd082('0x0'));var timeout=require('connect-timeout');var express=require(_0xd082('0x1'));var router=express[_0xd082('0x2')]();var fs_extra=require(_0xd082('0x3'));var auth=require(_0xd082('0x4'));var interaction=require(_0xd082('0x5'));var config=require(_0xd082('0x6'));var controller=require(_0xd082('0x7'));router[_0xd082('0x8')]('/',auth['isAuthenticated'](),controller[_0xd082('0x9')]);router[_0xd082('0x8')](_0xd082('0xa'),auth[_0xd082('0xb')](),controller[_0xd082('0xc')]);router['get'](_0xd082('0xd'),auth['isAuthenticated'](),controller[_0xd082('0xe')]);router[_0xd082('0xf')]('/',auth[_0xd082('0xb')](),controller[_0xd082('0x10')]);router[_0xd082('0x11')](_0xd082('0xd'),auth['isAuthenticated'](),controller[_0xd082('0x12')]);router[_0xd082('0x13')](_0xd082('0xd'),auth[_0xd082('0xb')](),controller[_0xd082('0x14')]);module[_0xd082('0x15')]=router; \ No newline at end of file +var _0x27d1=['../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x3e4a07,_0x467f8a){var _0x36e41d=function(_0x2aa618){while(--_0x2aa618){_0x3e4a07['push'](_0x3e4a07['shift']());}};_0x36e41d(++_0x467f8a);}(_0x27d1,0x1c6));var _0x127d=function(_0x15b1fe,_0x39e501){_0x15b1fe=_0x15b1fe-0x0;var _0x17b127=_0x27d1[_0x15b1fe];return _0x17b127;};'use strict';var multer=require(_0x127d('0x0'));var util=require(_0x127d('0x1'));var path=require(_0x127d('0x2'));var timeout=require(_0x127d('0x3'));var express=require('express');var router=express[_0x127d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x127d('0x5'));var interaction=require(_0x127d('0x6'));var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router[_0x127d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x127d('0x8'),auth[_0x127d('0x9')](),controller[_0x127d('0xa')]);router['get'](_0x127d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x127d('0xc')]('/',auth[_0x127d('0x9')](),controller[_0x127d('0xd')]);router[_0x127d('0xe')](_0x127d('0xb'),auth[_0x127d('0x9')](),controller['update']);router[_0x127d('0xf')](_0x127d('0xb'),auth[_0x127d('0x9')](),controller[_0x127d('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index c253e35..6226892 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 _0x4fb4=['name','exports','STRING'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0x4fb4,0x190));var _0x44fb=function(_0x38eb9b,_0x533346){_0x38eb9b=_0x38eb9b-0x0;var _0x36e3bb=_0x4fb4[_0x38eb9b];return _0x36e3bb;};'use strict';var Sequelize=require('sequelize');module[_0x44fb('0x0')]={'name':{'type':Sequelize[_0x44fb('0x1')],'unique':_0x44fb('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x44fb('0x1')]}}; \ No newline at end of file +var _0xdf98=['STRING','sequelize'];(function(_0x9d412b,_0x5e9457){var _0x5c344d=function(_0x5c12a4){while(--_0x5c12a4){_0x9d412b['push'](_0x9d412b['shift']());}};_0x5c344d(++_0x5e9457);}(_0xdf98,0xcf));var _0x8df9=function(_0x5111a9,_0x353fa5){_0x5111a9=_0x5111a9-0x0;var _0x59a15a=_0xdf98[_0x5111a9];return _0x59a15a;};'use strict';var Sequelize=require(_0x8df9('0x0'));module['exports']={'name':{'type':Sequelize[_0x8df9('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 79d9715..0677a04 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 _0xab5d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','offset','limit','undefined','count','Content-Range','json','reject','then','destroy','status','sendStatus','error','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x54dad6,_0xceaf01){var _0x316654=function(_0x265a9b){while(--_0x265a9b){_0x54dad6['push'](_0x54dad6['shift']());}};_0x316654(++_0xceaf01);}(_0xab5d,0xde));var _0xdab5=function(_0x163302,_0x4b4374){_0x163302=_0x163302-0x0;var _0x391f7a=_0xab5d[_0x163302];return _0x391f7a;};'use strict';var emlformat=require(_0xdab5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdab5('0x1'));var jsonpatch=require(_0xdab5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdab5('0x3'));var Mustache=require(_0xdab5('0x4'));var util=require('util');var path=require(_0xdab5('0x5'));var sox=require(_0xdab5('0x6'));var csv=require(_0xdab5('0x7'));var ejs=require(_0xdab5('0x8'));var fs=require('fs');var fs_extra=require(_0xdab5('0x9'));var _=require(_0xdab5('0xa'));var squel=require(_0xdab5('0xb'));var crypto=require(_0xdab5('0xc'));var jsforce=require(_0xdab5('0xd'));var deskjs=require(_0xdab5('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdab5('0xf'));var Papa=require(_0xdab5('0x10'));var Redis=require('ioredis');var authService=require(_0xdab5('0x11'));var qs=require(_0xdab5('0x12'));var as=require(_0xdab5('0x13'));var hardwareService=require(_0xdab5('0x14'));var logger=require(_0xdab5('0x15'))(_0xdab5('0x16'));var utils=require(_0xdab5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdab5('0x18'));var db=require(_0xdab5('0x19'))['db'];function respondWithStatusCode(_0x1ed8f3,_0xbf6379){_0xbf6379=_0xbf6379||0xcc;return function(_0xb367ac){if(_0xb367ac){return _0x1ed8f3['sendStatus'](_0xbf6379);}return _0x1ed8f3['status'](_0xbf6379)[_0xdab5('0x1a')]();};}function respondWithResult(_0x5cd0eb,_0x3891dd){_0x3891dd=_0x3891dd||0xc8;return function(_0x1be5bd){if(_0x1be5bd){return _0x5cd0eb['status'](_0x3891dd)['json'](_0x1be5bd);}};}function respondWithFilteredResult(_0x5af20b,_0x1a6634){return function(_0x21ad09){if(_0x21ad09){var _0x456c48=typeof _0x1a6634[_0xdab5('0x1b')]==='undefined'&&typeof _0x1a6634[_0xdab5('0x1c')]===_0xdab5('0x1d');var _0x1e5662=_0x21ad09[_0xdab5('0x1e')];var _0x49c542=_0x456c48?0x0:_0x1a6634[_0xdab5('0x1b')];var _0x59d555=_0x456c48?_0x21ad09[_0xdab5('0x1e')]:_0x1a6634[_0xdab5('0x1b')]+_0x1a6634[_0xdab5('0x1c')];var _0x52b4af;if(_0x59d555>=_0x1e5662){_0x59d555=_0x1e5662;_0x52b4af=0xc8;}else{_0x52b4af=0xce;}_0x5af20b['status'](_0x52b4af);return _0x5af20b['set'](_0xdab5('0x1f'),_0x49c542+'-'+_0x59d555+'/'+_0x1e5662)[_0xdab5('0x20')](_0x21ad09);}return null;};}function patchUpdates(_0x5ae79e){return function(_0x53220f){try{jsonpatch['apply'](_0x53220f,_0x5ae79e,!![]);}catch(_0x2d46a4){return BPromise[_0xdab5('0x21')](_0x2d46a4);}return _0x53220f['save']();};}function saveUpdates(_0x4eecff,_0xeebad2){return function(_0x3d4aaf){if(_0x3d4aaf){return _0x3d4aaf['update'](_0x4eecff)[_0xdab5('0x22')](function(_0x48e85a){return _0x48e85a;});}return null;};}function removeEntity(_0x281648,_0x8ff9b9){return function(_0x261443){if(_0x261443){return _0x261443[_0xdab5('0x23')]()[_0xdab5('0x22')](function(){_0x281648[_0xdab5('0x24')](0xcc)[_0xdab5('0x1a')]();});}};}function handleEntityNotFound(_0x4999f2,_0x2cd666){return function(_0x2c98ed){if(!_0x2c98ed){_0x4999f2[_0xdab5('0x25')](0x194);}return _0x2c98ed;};}function handleError(_0x3e6d1d,_0x38b8d0){_0x38b8d0=_0x38b8d0||0x1f4;return function(_0x416274){logger[_0xdab5('0x26')](_0x416274['stack']);if(_0x416274[_0xdab5('0x27')]){delete _0x416274[_0xdab5('0x27')];}_0x3e6d1d['status'](_0x38b8d0)[_0xdab5('0x28')](_0x416274);};}exports[_0xdab5('0x29')]=function(_0x2b2e33,_0x5a8937){var _0x3f2362={},_0x54ef02={},_0x3affd2={'count':0x0,'rows':[]};var _0x45aaf0=_[_0xdab5('0x2a')](db[_0xdab5('0x2b')][_0xdab5('0x2c')],function(_0x422bdb){return{'name':_0x422bdb[_0xdab5('0x2d')],'type':_0x422bdb[_0xdab5('0x2e')]['key']};});_0x54ef02[_0xdab5('0x2f')]=_['map'](_0x45aaf0,_0xdab5('0x27'));_0x54ef02['query']=_[_0xdab5('0x30')](_0x2b2e33['query']);_0x54ef02[_0xdab5('0x31')]=_['intersection'](_0x54ef02[_0xdab5('0x2f')],_0x54ef02[_0xdab5('0x32')]);_0x3f2362[_0xdab5('0x33')]=_[_0xdab5('0x34')](_0x54ef02[_0xdab5('0x2f')],qs[_0xdab5('0x35')](_0x2b2e33['query'][_0xdab5('0x35')]));_0x3f2362[_0xdab5('0x33')]=_0x3f2362[_0xdab5('0x33')][_0xdab5('0x36')]?_0x3f2362['attributes']:_0x54ef02[_0xdab5('0x2f')];if(!_0x2b2e33[_0xdab5('0x32')][_0xdab5('0x37')](_0xdab5('0x38'))){_0x3f2362['limit']=qs[_0xdab5('0x1c')](_0x2b2e33[_0xdab5('0x32')][_0xdab5('0x1c')]);_0x3f2362[_0xdab5('0x1b')]=qs[_0xdab5('0x1b')](_0x2b2e33[_0xdab5('0x32')][_0xdab5('0x1b')]);}_0x3f2362[_0xdab5('0x39')]=qs[_0xdab5('0x3a')](_0x2b2e33['query'][_0xdab5('0x3a')]);_0x3f2362[_0xdab5('0x3b')]=qs[_0xdab5('0x31')](_[_0xdab5('0x3c')](_0x2b2e33[_0xdab5('0x32')],_0x54ef02['filters']),_0x45aaf0);if(_0x2b2e33[_0xdab5('0x32')][_0xdab5('0x3d')]){_0x3f2362[_0xdab5('0x3b')]=_[_0xdab5('0x3e')](_0x3f2362['where'],{'$or':_['map'](_0x45aaf0,function(_0xa064ba){if(_0xa064ba[_0xdab5('0x2e')]!==_0xdab5('0x3f')){var _0x9addcd={};_0x9addcd[_0xa064ba[_0xdab5('0x27')]]={'$like':'%'+_0x2b2e33['query'][_0xdab5('0x3d')]+'%'};return _0x9addcd;}})});}_0x3f2362=_[_0xdab5('0x3e')]({},_0x3f2362,_0x2b2e33[_0xdab5('0x40')]);var _0x981c82={'where':_0x3f2362[_0xdab5('0x3b')]};return db['MailSubstatus'][_0xdab5('0x1e')](_0x981c82)[_0xdab5('0x22')](function(_0x5ce289){_0x3affd2[_0xdab5('0x1e')]=_0x5ce289;if(_0x2b2e33[_0xdab5('0x32')][_0xdab5('0x41')]){_0x3f2362[_0xdab5('0x42')]=[{'all':!![]}];}return db[_0xdab5('0x2b')][_0xdab5('0x43')](_0x3f2362);})[_0xdab5('0x22')](function(_0x502844){_0x3affd2[_0xdab5('0x44')]=_0x502844;return _0x3affd2;})[_0xdab5('0x22')](respondWithFilteredResult(_0x5a8937,_0x3f2362))[_0xdab5('0x45')](handleError(_0x5a8937,null));};exports[_0xdab5('0x46')]=function(_0x413fda,_0x597f27){var _0xd233f6={'raw':!![],'where':{'id':_0x413fda[_0xdab5('0x47')]['id']}},_0x55f25e={};_0x55f25e[_0xdab5('0x2f')]=_[_0xdab5('0x30')](db[_0xdab5('0x2b')]['rawAttributes']);_0x55f25e[_0xdab5('0x32')]=_[_0xdab5('0x30')](_0x413fda[_0xdab5('0x32')]);_0x55f25e[_0xdab5('0x31')]=_[_0xdab5('0x34')](_0x55f25e[_0xdab5('0x2f')],_0x55f25e[_0xdab5('0x32')]);_0xd233f6[_0xdab5('0x33')]=_['intersection'](_0x55f25e[_0xdab5('0x2f')],qs['fields'](_0x413fda[_0xdab5('0x32')][_0xdab5('0x35')]));_0xd233f6[_0xdab5('0x33')]=_0xd233f6[_0xdab5('0x33')]['length']?_0xd233f6[_0xdab5('0x33')]:_0x55f25e[_0xdab5('0x2f')];if(_0x413fda[_0xdab5('0x32')]['includeAll']){_0xd233f6[_0xdab5('0x42')]=[{'all':!![]}];}_0xd233f6=_[_0xdab5('0x3e')]({},_0xd233f6,_0x413fda[_0xdab5('0x40')]);return db[_0xdab5('0x2b')]['find'](_0xd233f6)['then'](handleEntityNotFound(_0x597f27,null))[_0xdab5('0x22')](respondWithResult(_0x597f27,null))[_0xdab5('0x45')](handleError(_0x597f27,null));};exports[_0xdab5('0x48')]=function(_0x14094d,_0x58c2b9){return db['MailSubstatus'][_0xdab5('0x48')](_0x14094d[_0xdab5('0x49')],{})['then'](respondWithResult(_0x58c2b9,0xc9))[_0xdab5('0x45')](handleError(_0x58c2b9,null));};exports[_0xdab5('0x4a')]=function(_0x12e066,_0x458598){if(_0x12e066[_0xdab5('0x49')]['id']){delete _0x12e066[_0xdab5('0x49')]['id'];}return db['MailSubstatus'][_0xdab5('0x4b')]({'where':{'id':_0x12e066[_0xdab5('0x47')]['id']}})[_0xdab5('0x22')](handleEntityNotFound(_0x458598,null))[_0xdab5('0x22')](saveUpdates(_0x12e066[_0xdab5('0x49')],null))[_0xdab5('0x22')](respondWithResult(_0x458598,null))['catch'](handleError(_0x458598,null));};exports[_0xdab5('0x23')]=function(_0x1bd959,_0x1ba174){return db[_0xdab5('0x2b')]['find']({'where':{'id':_0x1bd959[_0xdab5('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ba174,null))['then'](removeEntity(_0x1ba174,null))[_0xdab5('0x45')](handleError(_0x1ba174,null));};exports[_0xdab5('0x4c')]=function(_0x4df0a4,_0xd95b6e){return db[_0xdab5('0x2b')]['describe']()[_0xdab5('0x22')](respondWithResult(_0xd95b6e,null))['catch'](handleError(_0xd95b6e,null));}; \ No newline at end of file +var _0x6115=['../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','error','name','index','MailSubstatus','rawAttributes','fieldName','type','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','merge','where','VIRTUAL','options','then','include','findAll','catch','params','includeAll','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4c29f9,_0x5bddd4){var _0x4e17b8=function(_0x12e055){while(--_0x12e055){_0x4c29f9['push'](_0x4c29f9['shift']());}};_0x4e17b8(++_0x5bddd4);}(_0x6115,0x1e9));var _0x5611=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6115[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x5611('0x0'));var rimraf=require(_0x5611('0x1'));var zipdir=require(_0x5611('0x2'));var jsonpatch=require(_0x5611('0x3'));var rp=require(_0x5611('0x4'));var moment=require(_0x5611('0x5'));var BPromise=require(_0x5611('0x6'));var Mustache=require(_0x5611('0x7'));var util=require(_0x5611('0x8'));var path=require('path');var sox=require(_0x5611('0x9'));var csv=require(_0x5611('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5611('0xb'));var _=require('lodash');var squel=require(_0x5611('0xc'));var crypto=require(_0x5611('0xd'));var jsforce=require(_0x5611('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5611('0xa'));var querystring=require(_0x5611('0xf'));var Papa=require(_0x5611('0x10'));var Redis=require(_0x5611('0x11'));var authService=require(_0x5611('0x12'));var qs=require(_0x5611('0x13'));var as=require(_0x5611('0x14'));var hardwareService=require(_0x5611('0x15'));var logger=require(_0x5611('0x16'))(_0x5611('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5611('0x18'));var db=require(_0x5611('0x19'))['db'];function respondWithStatusCode(_0x72accb,_0x3a343c){_0x3a343c=_0x3a343c||0xcc;return function(_0x3c7a8a){if(_0x3c7a8a){return _0x72accb[_0x5611('0x1a')](_0x3a343c);}return _0x72accb[_0x5611('0x1b')](_0x3a343c)['end']();};}function respondWithResult(_0x421ff9,_0x2a4463){_0x2a4463=_0x2a4463||0xc8;return function(_0x37bd24){if(_0x37bd24){return _0x421ff9[_0x5611('0x1b')](_0x2a4463)[_0x5611('0x1c')](_0x37bd24);}};}function respondWithFilteredResult(_0x144fd5,_0x2de0c7){return function(_0x2a31d0){if(_0x2a31d0){var _0x451f2f=typeof _0x2de0c7[_0x5611('0x1d')]===_0x5611('0x1e')&&typeof _0x2de0c7['limit']==='undefined';var _0x3c9bd9=_0x2a31d0[_0x5611('0x1f')];var _0x2c41cd=_0x451f2f?0x0:_0x2de0c7[_0x5611('0x1d')];var _0x47f2f6=_0x451f2f?_0x2a31d0['count']:_0x2de0c7[_0x5611('0x1d')]+_0x2de0c7['limit'];var _0x2ccf35;if(_0x47f2f6>=_0x3c9bd9){_0x47f2f6=_0x3c9bd9;_0x2ccf35=0xc8;}else{_0x2ccf35=0xce;}_0x144fd5['status'](_0x2ccf35);return _0x144fd5['set'](_0x5611('0x20'),_0x2c41cd+'-'+_0x47f2f6+'/'+_0x3c9bd9)[_0x5611('0x1c')](_0x2a31d0);}return null;};}function patchUpdates(_0x345be0){return function(_0x4718ef){try{jsonpatch[_0x5611('0x21')](_0x4718ef,_0x345be0,!![]);}catch(_0x3d77c1){return BPromise[_0x5611('0x22')](_0x3d77c1);}return _0x4718ef[_0x5611('0x23')]();};}function saveUpdates(_0x5ab698,_0x11863d){return function(_0x4b2c19){if(_0x4b2c19){return _0x4b2c19['update'](_0x5ab698)['then'](function(_0x1c0f4c){return _0x1c0f4c;});}return null;};}function removeEntity(_0xa64c24,_0x447353){return function(_0x3f8775){if(_0x3f8775){return _0x3f8775['destroy']()['then'](function(){_0xa64c24['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22b0c3,_0x79bbc){return function(_0x28bedc){if(!_0x28bedc){_0x22b0c3['sendStatus'](0x194);}return _0x28bedc;};}function handleError(_0x494421,_0x411a29){_0x411a29=_0x411a29||0x1f4;return function(_0xeaf2b4){logger[_0x5611('0x24')](_0xeaf2b4['stack']);if(_0xeaf2b4[_0x5611('0x25')]){delete _0xeaf2b4[_0x5611('0x25')];}_0x494421[_0x5611('0x1b')](_0x411a29)['send'](_0xeaf2b4);};}exports[_0x5611('0x26')]=function(_0x46569b,_0x5e4f3d){var _0x2e7825={},_0x1b9be4={},_0x28d09b={'count':0x0,'rows':[]};var _0x2ac43e=_['map'](db[_0x5611('0x27')][_0x5611('0x28')],function(_0x1968d8){return{'name':_0x1968d8[_0x5611('0x29')],'type':_0x1968d8[_0x5611('0x2a')]['key']};});_0x1b9be4[_0x5611('0x2b')]=_[_0x5611('0x2c')](_0x2ac43e,'name');_0x1b9be4['query']=_[_0x5611('0x2d')](_0x46569b['query']);_0x1b9be4[_0x5611('0x2e')]=_[_0x5611('0x2f')](_0x1b9be4[_0x5611('0x2b')],_0x1b9be4[_0x5611('0x30')]);_0x2e7825[_0x5611('0x31')]=_[_0x5611('0x2f')](_0x1b9be4['model'],qs[_0x5611('0x32')](_0x46569b[_0x5611('0x30')]['fields']));_0x2e7825[_0x5611('0x31')]=_0x2e7825[_0x5611('0x31')][_0x5611('0x33')]?_0x2e7825[_0x5611('0x31')]:_0x1b9be4[_0x5611('0x2b')];if(!_0x46569b[_0x5611('0x30')][_0x5611('0x34')](_0x5611('0x35'))){_0x2e7825[_0x5611('0x36')]=qs[_0x5611('0x36')](_0x46569b[_0x5611('0x30')][_0x5611('0x36')]);_0x2e7825[_0x5611('0x1d')]=qs[_0x5611('0x1d')](_0x46569b['query'][_0x5611('0x1d')]);}_0x2e7825['order']=qs[_0x5611('0x37')](_0x46569b['query'][_0x5611('0x37')]);_0x2e7825['where']=qs[_0x5611('0x2e')](_[_0x5611('0x38')](_0x46569b['query'],_0x1b9be4['filters']),_0x2ac43e);if(_0x46569b[_0x5611('0x30')]['filter']){_0x2e7825['where']=_[_0x5611('0x39')](_0x2e7825[_0x5611('0x3a')],{'$or':_[_0x5611('0x2c')](_0x2ac43e,function(_0x3bf1a7){if(_0x3bf1a7[_0x5611('0x2a')]!==_0x5611('0x3b')){var _0x88f42={};_0x88f42[_0x3bf1a7['name']]={'$like':'%'+_0x46569b['query']['filter']+'%'};return _0x88f42;}})});}_0x2e7825=_[_0x5611('0x39')]({},_0x2e7825,_0x46569b[_0x5611('0x3c')]);var _0x43438e={'where':_0x2e7825[_0x5611('0x3a')]};return db['MailSubstatus'][_0x5611('0x1f')](_0x43438e)[_0x5611('0x3d')](function(_0x3c2c6b){_0x28d09b[_0x5611('0x1f')]=_0x3c2c6b;if(_0x46569b[_0x5611('0x30')]['includeAll']){_0x2e7825[_0x5611('0x3e')]=[{'all':!![]}];}return db[_0x5611('0x27')][_0x5611('0x3f')](_0x2e7825);})[_0x5611('0x3d')](function(_0x3a574f){_0x28d09b['rows']=_0x3a574f;return _0x28d09b;})[_0x5611('0x3d')](respondWithFilteredResult(_0x5e4f3d,_0x2e7825))[_0x5611('0x40')](handleError(_0x5e4f3d,null));};exports['show']=function(_0x8f562a,_0x49bb7f){var _0x1b1f26={'raw':!![],'where':{'id':_0x8f562a[_0x5611('0x41')]['id']}},_0x5d066e={};_0x5d066e[_0x5611('0x2b')]=_[_0x5611('0x2d')](db[_0x5611('0x27')][_0x5611('0x28')]);_0x5d066e[_0x5611('0x30')]=_[_0x5611('0x2d')](_0x8f562a['query']);_0x5d066e[_0x5611('0x2e')]=_['intersection'](_0x5d066e[_0x5611('0x2b')],_0x5d066e[_0x5611('0x30')]);_0x1b1f26[_0x5611('0x31')]=_['intersection'](_0x5d066e[_0x5611('0x2b')],qs['fields'](_0x8f562a[_0x5611('0x30')][_0x5611('0x32')]));_0x1b1f26[_0x5611('0x31')]=_0x1b1f26[_0x5611('0x31')][_0x5611('0x33')]?_0x1b1f26['attributes']:_0x5d066e['model'];if(_0x8f562a['query'][_0x5611('0x42')]){_0x1b1f26[_0x5611('0x3e')]=[{'all':!![]}];}_0x1b1f26=_[_0x5611('0x39')]({},_0x1b1f26,_0x8f562a[_0x5611('0x3c')]);return db['MailSubstatus'][_0x5611('0x43')](_0x1b1f26)[_0x5611('0x3d')](handleEntityNotFound(_0x49bb7f,null))[_0x5611('0x3d')](respondWithResult(_0x49bb7f,null))[_0x5611('0x40')](handleError(_0x49bb7f,null));};exports[_0x5611('0x44')]=function(_0x13fc4f,_0x46aaba){return db['MailSubstatus']['create'](_0x13fc4f[_0x5611('0x45')],{})[_0x5611('0x3d')](respondWithResult(_0x46aaba,0xc9))[_0x5611('0x40')](handleError(_0x46aaba,null));};exports[_0x5611('0x46')]=function(_0x18784e,_0x3009d1){if(_0x18784e['body']['id']){delete _0x18784e['body']['id'];}return db[_0x5611('0x27')][_0x5611('0x43')]({'where':{'id':_0x18784e[_0x5611('0x41')]['id']}})[_0x5611('0x3d')](handleEntityNotFound(_0x3009d1,null))['then'](saveUpdates(_0x18784e[_0x5611('0x45')],null))['then'](respondWithResult(_0x3009d1,null))[_0x5611('0x40')](handleError(_0x3009d1,null));};exports[_0x5611('0x47')]=function(_0x3f963a,_0x28f3ef){return db[_0x5611('0x27')][_0x5611('0x43')]({'where':{'id':_0x3f963a[_0x5611('0x41')]['id']}})[_0x5611('0x3d')](handleEntityNotFound(_0x28f3ef,null))[_0x5611('0x3d')](removeEntity(_0x28f3ef,null))[_0x5611('0x40')](handleError(_0x28f3ef,null));};exports[_0x5611('0x48')]=function(_0x3dc3ca,_0x485134){return db['MailSubstatus']['describe']()[_0x5611('0x3d')](respondWithResult(_0x485134,null))[_0x5611('0x40')](handleError(_0x485134,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index fa5ed88..ff6f5ec 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 _0x9a94=['events','MailSubstatus','emit','hasOwnProperty','hook'];(function(_0x147582,_0x4e37fc){var _0x28bf97=function(_0x5b6157){while(--_0x5b6157){_0x147582['push'](_0x147582['shift']());}};_0x28bf97(++_0x4e37fc);}(_0x9a94,0x12c));var _0x49a9=function(_0x4f4757,_0x44241a){_0x4f4757=_0x4f4757-0x0;var _0x549c37=_0x9a94[_0x4f4757];return _0x549c37;};'use strict';var EventEmitter=require(_0x49a9('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x49a9('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x1ac766){return function(_0x4f8deb,_0x159e6a,_0x8e5843){MailSubstatusEvents[_0x49a9('0x2')](_0x1ac766+':'+_0x4f8deb['id'],_0x4f8deb);MailSubstatusEvents['emit'](_0x1ac766,_0x4f8deb);_0x8e5843(null);};}for(var e in events){if(events[_0x49a9('0x3')](e)){var event=events[e];MailSubstatus[_0x49a9('0x4')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0xcc3c=['setMaxListeners','update','emit','hasOwnProperty','events','../../mysqldb','MailSubstatus'];(function(_0x2d789f,_0x15ba8a){var _0x92ed2=function(_0x162fc4){while(--_0x162fc4){_0x2d789f['push'](_0x2d789f['shift']());}};_0x92ed2(++_0x15ba8a);}(_0xcc3c,0xa5));var _0xccc3=function(_0x36ae90,_0x1a8ea5){_0x36ae90=_0x36ae90-0x0;var _0x52b505=_0xcc3c[_0x36ae90];return _0x52b505;};'use strict';var EventEmitter=require(_0xccc3('0x0'));var MailSubstatus=require(_0xccc3('0x1'))['db'][_0xccc3('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xccc3('0x3')](0x0);var events={'afterUpdate':_0xccc3('0x4')};function emitEvent(_0x364b37){return function(_0x82a06c,_0x50e3b9,_0x581db1){MailSubstatusEvents[_0xccc3('0x5')](_0x364b37+':'+_0x82a06c['id'],_0x82a06c);MailSubstatusEvents[_0xccc3('0x5')](_0x364b37,_0x82a06c);_0x581db1(null);};}for(var e in events){if(events[_0xccc3('0x6')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 47f4f15..fb4aaef 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 _0x3fa7=['./mailSubstatus.attributes','exports','models','MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch'];(function(_0x2cc5d2,_0x2e07bd){var _0x165ba1=function(_0x4340be){while(--_0x4340be){_0x2cc5d2['push'](_0x2cc5d2['shift']());}};_0x165ba1(++_0x2e07bd);}(_0x3fa7,0x198));var _0x73fa=function(_0x3dcf7d,_0x27ad77){_0x3dcf7d=_0x3dcf7d-0x0;var _0x166730=_0x3fa7[_0x3dcf7d];return _0x166730;};'use strict';var attributes=require(_0x73fa('0x0'));module[_0x73fa('0x1')]=function(_0x10b906){var _0x27513a=_0x10b906[_0x73fa('0x2')];return _0x10b906['define'](_0x73fa('0x3'),attributes,{'tableName':_0x73fa('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4e9065,_0x168301,_0x6d4e5e){return _0x27513a[_0x73fa('0x5')][_0x73fa('0x6')]({'value':_0x4e9065[_0x73fa('0x7')]},{'where':{'field':_0x73fa('0x8'),'value':_0x4e9065[_0x73fa('0x9')][_0x73fa('0x7')]}})[_0x73fa('0xa')](function(){_0x6d4e5e();})[_0x73fa('0xb')](function(_0x459c41){_0x6d4e5e(_0x459c41);});}}});}; \ No newline at end of file +var _0x3363=['_previousDataValues','then','./mailSubstatus.attributes','models','define','mail_substatuses','Condition','update','name','mailSubstatus'];(function(_0x55593b,_0x5ef210){var _0x25b8d0=function(_0x631836){while(--_0x631836){_0x55593b['push'](_0x55593b['shift']());}};_0x25b8d0(++_0x5ef210);}(_0x3363,0x156));var _0x3336=function(_0x2ec4dd,_0x376ed0){_0x2ec4dd=_0x2ec4dd-0x0;var _0x2b9e16=_0x3363[_0x2ec4dd];return _0x2b9e16;};'use strict';var attributes=require(_0x3336('0x0'));module['exports']=function(_0x415475){var _0x23b59c=_0x415475[_0x3336('0x1')];return _0x415475[_0x3336('0x2')]('MailSubstatus',attributes,{'tableName':_0x3336('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3b5185,_0x55312b,_0x439acc){return _0x23b59c[_0x3336('0x4')][_0x3336('0x5')]({'value':_0x3b5185[_0x3336('0x6')]},{'where':{'field':_0x3336('0x7'),'value':_0x3b5185[_0x3336('0x8')][_0x3336('0x6')]}})[_0x3336('0x9')](function(){_0x439acc();})['catch'](function(_0x3dc6d1){_0x439acc(_0x3dc6d1);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 74fd594..f65df2e 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 _0x31dd=['then','info','request\x20sent','debug','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','http','request'];(function(_0x4da00c,_0x30ad06){var _0x381819=function(_0x1828a5){while(--_0x1828a5){_0x4da00c['push'](_0x4da00c['shift']());}};_0x381819(++_0x30ad06);}(_0x31dd,0x122));var _0xd31d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x31dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd31d('0x0'));var util=require(_0xd31d('0x1'));var moment=require(_0xd31d('0x2'));var BPromise=require(_0xd31d('0x3'));var rs=require(_0xd31d('0x4'));var fs=require('fs');var Redis=require(_0xd31d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd31d('0x6'));var logger=require(_0xd31d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd31d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x150b19,_0x21f4ab,_0x27fdd3){return new BPromise(function(_0x16ff8e,_0x315c50){return client[_0xd31d('0x9')](_0x150b19,_0x27fdd3)[_0xd31d('0xa')](function(_0x3de9ab){logger[_0xd31d('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x21f4ab,_0xd31d('0xc'));logger[_0xd31d('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x21f4ab,'request\x20sent',JSON['stringify'](_0x3de9ab));if(_0x3de9ab[_0xd31d('0xe')]){if(_0x3de9ab['error'][_0xd31d('0xf')]===0x1f4){logger[_0xd31d('0xe')](_0xd31d('0x10'),_0x21f4ab,_0x3de9ab[_0xd31d('0xe')][_0xd31d('0x11')]);return _0x315c50(_0x3de9ab[_0xd31d('0xe')]['message']);}logger[_0xd31d('0xe')](_0xd31d('0x10'),_0x21f4ab,_0x3de9ab[_0xd31d('0xe')]['message']);return _0x16ff8e(_0x3de9ab['error'][_0xd31d('0x11')]);}else{logger[_0xd31d('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x21f4ab,'request\x20sent');_0x16ff8e(_0x3de9ab[_0xd31d('0x12')][_0xd31d('0x11')]);}})[_0xd31d('0x13')](function(_0x49bbad){logger['error'](_0xd31d('0x10'),_0x21f4ab,_0x49bbad);_0x315c50(_0x49bbad);});});} \ No newline at end of file +var _0xa322=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa322,0x18e));var _0x2a32=function(_0x21557d,_0x2bf234){_0x21557d=_0x21557d-0x0;var _0x544a25=_0xa322[_0x21557d];return _0x544a25;};'use strict';var _=require(_0x2a32('0x0'));var util=require(_0x2a32('0x1'));var moment=require(_0x2a32('0x2'));var BPromise=require('bluebird');var rs=require(_0x2a32('0x3'));var fs=require('fs');var Redis=require(_0x2a32('0x4'));var db=require(_0x2a32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a32('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2a32('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed7f1,_0x4d1c48,_0x19b33a){return new BPromise(function(_0x38e201,_0x4c27fa){return client[_0x2a32('0x8')](_0x4ed7f1,_0x19b33a)[_0x2a32('0x9')](function(_0x8e778f){logger[_0x2a32('0xa')](_0x2a32('0xb'),_0x4d1c48,'request\x20sent');logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x4d1c48,_0x2a32('0xc'),JSON['stringify'](_0x8e778f));if(_0x8e778f['error']){if(_0x8e778f[_0x2a32('0xd')][_0x2a32('0xe')]===0x1f4){logger['error'](_0x2a32('0xb'),_0x4d1c48,_0x8e778f[_0x2a32('0xd')][_0x2a32('0xf')]);return _0x4c27fa(_0x8e778f['error'][_0x2a32('0xf')]);}logger[_0x2a32('0xd')](_0x2a32('0xb'),_0x4d1c48,_0x8e778f[_0x2a32('0xd')][_0x2a32('0xf')]);return _0x38e201(_0x8e778f[_0x2a32('0xd')][_0x2a32('0xf')]);}else{logger[_0x2a32('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x4d1c48,'request\x20sent');_0x38e201(_0x8e778f[_0x2a32('0x10')][_0x2a32('0xf')]);}})[_0x2a32('0x11')](function(_0x1f346e){logger[_0x2a32('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x4d1c48,_0x1f346e);_0x4c27fa(_0x1f346e);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 17103c5..7b7e3c5 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 _0x4ab9=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','create','delete','destroy','exports'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x4ab9,0xc6));var _0x94ab=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4ab9[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x94ab('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x94ab('0x1'));var express=require(_0x94ab('0x2'));var router=express[_0x94ab('0x3')]();var fs_extra=require(_0x94ab('0x4'));var auth=require(_0x94ab('0x5'));var interaction=require(_0x94ab('0x6'));var config=require('../../config/environment');var controller=require(_0x94ab('0x7'));router[_0x94ab('0x8')]('/',auth[_0x94ab('0x9')](),controller['index']);router[_0x94ab('0x8')]('/describe',auth[_0x94ab('0x9')](),controller[_0x94ab('0xa')]);router[_0x94ab('0x8')](_0x94ab('0xb'),auth[_0x94ab('0x9')](),controller[_0x94ab('0xc')]);router[_0x94ab('0xd')]('/',auth[_0x94ab('0x9')](),controller[_0x94ab('0xe')]);router['put']('/:id',auth[_0x94ab('0x9')](),controller['update']);router[_0x94ab('0xf')]('/:id',auth[_0x94ab('0x9')](),controller[_0x94ab('0x10')]);module[_0x94ab('0x11')]=router; \ No newline at end of file +var _0x3206=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','multer','util','path'];(function(_0xb143ee,_0x298a94){var _0x44cf57=function(_0x2c534a){while(--_0x2c534a){_0xb143ee['push'](_0xb143ee['shift']());}};_0x44cf57(++_0x298a94);}(_0x3206,0x1dd));var _0x6320=function(_0xe67d1c,_0x1b21d1){_0xe67d1c=_0xe67d1c-0x0;var _0x11673c=_0x3206[_0xe67d1c];return _0x11673c;};'use strict';var multer=require(_0x6320('0x0'));var util=require(_0x6320('0x1'));var path=require(_0x6320('0x2'));var timeout=require(_0x6320('0x3'));var express=require(_0x6320('0x4'));var router=express[_0x6320('0x5')]();var fs_extra=require(_0x6320('0x6'));var auth=require(_0x6320('0x7'));var interaction=require(_0x6320('0x8'));var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router[_0x6320('0x9')]('/',auth[_0x6320('0xa')](),controller[_0x6320('0xb')]);router['get'](_0x6320('0xc'),auth[_0x6320('0xa')](),controller[_0x6320('0xd')]);router[_0x6320('0x9')](_0x6320('0xe'),auth[_0x6320('0xa')](),controller['show']);router['post']('/',auth[_0x6320('0xa')](),controller[_0x6320('0xf')]);router[_0x6320('0x10')](_0x6320('0xe'),auth[_0x6320('0xa')](),controller[_0x6320('0x11')]);router[_0x6320('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x6320('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 885394f..13400f1 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x4c5c97,_0x4f85bf){var _0xd5d2cb=function(_0x1e6100){while(--_0x1e6100){_0x4c5c97['push'](_0x4c5c97['shift']());}};_0xd5d2cb(++_0x4f85bf);}(_0x9bde,0xe1));var _0xe9bd=function(_0x54a164,_0x1948a3){_0x54a164=_0x54a164-0x0;var _0x2a05a5=_0x9bde[_0x54a164];return _0x2a05a5;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x7fc5cf,_0x383bac){var _0x3d6ed0=function(_0x463912){while(--_0x463912){_0x7fc5cf['push'](_0x7fc5cf['shift']());}};_0x3d6ed0(++_0x383bac);}(_0xaa88,0x137));var _0x8aa8=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0xaa88[_0x3eb713];return _0x1d7128;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 8c5a9e2..8c6f357 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 _0x59f8=['nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','update','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','Content-Range','apply','save','then','destroy','end','error','stack','index','map','MailTransferReport','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x2e3545,_0x20a6ec){var _0xcf18f=function(_0x3c85dd){while(--_0x3c85dd){_0x2e3545['push'](_0x2e3545['shift']());}};_0xcf18f(++_0x20a6ec);}(_0x59f8,0x1be));var _0x859f=function(_0x867c5e,_0x21f568){_0x867c5e=_0x867c5e-0x0;var _0x38c628=_0x59f8[_0x867c5e];return _0x38c628;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x859f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x859f('0x1'));var rp=require(_0x859f('0x2'));var moment=require(_0x859f('0x3'));var BPromise=require(_0x859f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x859f('0x5'));var csv=require('to-csv');var ejs=require(_0x859f('0x6'));var fs=require('fs');var fs_extra=require(_0x859f('0x7'));var _=require('lodash');var squel=require(_0x859f('0x8'));var crypto=require(_0x859f('0x9'));var jsforce=require(_0x859f('0xa'));var deskjs=require(_0x859f('0xb'));var toCsv=require(_0x859f('0xc'));var querystring=require(_0x859f('0xd'));var Papa=require(_0x859f('0xe'));var Redis=require(_0x859f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x859f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x859f('0x11'));var utils=require(_0x859f('0x12'));var config=require(_0x859f('0x13'));var licenseUtil=require(_0x859f('0x14'));var db=require(_0x859f('0x15'))['db'];function respondWithStatusCode(_0x43a4ca,_0x3423fb){_0x3423fb=_0x3423fb||0xcc;return function(_0x4f1c44){if(_0x4f1c44){return _0x43a4ca['sendStatus'](_0x3423fb);}return _0x43a4ca['status'](_0x3423fb)['end']();};}function respondWithResult(_0x279991,_0x2958b1){_0x2958b1=_0x2958b1||0xc8;return function(_0xb5388e){if(_0xb5388e){return _0x279991[_0x859f('0x16')](_0x2958b1)[_0x859f('0x17')](_0xb5388e);}};}function respondWithFilteredResult(_0x9f66b2,_0x56e88e){return function(_0x5a1948){if(_0x5a1948){var _0x14d4a5=typeof _0x56e88e['offset']==='undefined'&&typeof _0x56e88e[_0x859f('0x18')]===_0x859f('0x19');var _0x16f5ef=_0x5a1948[_0x859f('0x1a')];var _0x18eb50=_0x14d4a5?0x0:_0x56e88e[_0x859f('0x1b')];var _0x1a278d=_0x14d4a5?_0x5a1948['count']:_0x56e88e[_0x859f('0x1b')]+_0x56e88e[_0x859f('0x18')];var _0x14f8b4;if(_0x1a278d>=_0x16f5ef){_0x1a278d=_0x16f5ef;_0x14f8b4=0xc8;}else{_0x14f8b4=0xce;}_0x9f66b2[_0x859f('0x16')](_0x14f8b4);return _0x9f66b2['set'](_0x859f('0x1c'),_0x18eb50+'-'+_0x1a278d+'/'+_0x16f5ef)[_0x859f('0x17')](_0x5a1948);}return null;};}function patchUpdates(_0x17eda7){return function(_0x10c41c){try{jsonpatch[_0x859f('0x1d')](_0x10c41c,_0x17eda7,!![]);}catch(_0x5a5f34){return BPromise['reject'](_0x5a5f34);}return _0x10c41c[_0x859f('0x1e')]();};}function saveUpdates(_0x3bbe58,_0x2a87e0){return function(_0x45c4fe){if(_0x45c4fe){return _0x45c4fe['update'](_0x3bbe58)[_0x859f('0x1f')](function(_0x210218){return _0x210218;});}return null;};}function removeEntity(_0x388bcc,_0x5b6566){return function(_0x417dca){if(_0x417dca){return _0x417dca[_0x859f('0x20')]()[_0x859f('0x1f')](function(){_0x388bcc['status'](0xcc)[_0x859f('0x21')]();});}};}function handleEntityNotFound(_0x15dae5,_0x51ffe5){return function(_0x121df9){if(!_0x121df9){_0x15dae5['sendStatus'](0x194);}return _0x121df9;};}function handleError(_0x180c75,_0x26b889){_0x26b889=_0x26b889||0x1f4;return function(_0x58aa1f){logger[_0x859f('0x22')](_0x58aa1f[_0x859f('0x23')]);if(_0x58aa1f['name']){delete _0x58aa1f['name'];}_0x180c75[_0x859f('0x16')](_0x26b889)['send'](_0x58aa1f);};}exports[_0x859f('0x24')]=function(_0x263de0,_0x43add2){var _0x1ebd23={},_0x1823c8={},_0x5826bf={'count':0x0,'rows':[]};var _0x2814a9=_[_0x859f('0x25')](db[_0x859f('0x26')]['rawAttributes'],function(_0x4c7481){return{'name':_0x4c7481[_0x859f('0x27')],'type':_0x4c7481[_0x859f('0x28')]['key']};});_0x1823c8[_0x859f('0x29')]=_['map'](_0x2814a9,_0x859f('0x2a'));_0x1823c8[_0x859f('0x2b')]=_[_0x859f('0x2c')](_0x263de0[_0x859f('0x2b')]);_0x1823c8[_0x859f('0x2d')]=_['intersection'](_0x1823c8[_0x859f('0x29')],_0x1823c8['query']);_0x1ebd23['attributes']=_[_0x859f('0x2e')](_0x1823c8[_0x859f('0x29')],qs['fields'](_0x263de0[_0x859f('0x2b')][_0x859f('0x2f')]));_0x1ebd23[_0x859f('0x30')]=_0x1ebd23[_0x859f('0x30')][_0x859f('0x31')]?_0x1ebd23[_0x859f('0x30')]:_0x1823c8['model'];if(!_0x263de0[_0x859f('0x2b')][_0x859f('0x32')](_0x859f('0x33'))){_0x1ebd23[_0x859f('0x18')]=qs[_0x859f('0x18')](_0x263de0[_0x859f('0x2b')][_0x859f('0x18')]);_0x1ebd23[_0x859f('0x1b')]=qs[_0x859f('0x1b')](_0x263de0[_0x859f('0x2b')][_0x859f('0x1b')]);}_0x1ebd23[_0x859f('0x34')]=qs[_0x859f('0x35')](_0x263de0['query'][_0x859f('0x35')]);_0x1ebd23[_0x859f('0x36')]=qs[_0x859f('0x2d')](_[_0x859f('0x37')](_0x263de0['query'],_0x1823c8[_0x859f('0x2d')]),_0x2814a9);if(_0x263de0[_0x859f('0x2b')]['filter']){_0x1ebd23[_0x859f('0x36')]=_[_0x859f('0x38')](_0x1ebd23[_0x859f('0x36')],{'$or':_[_0x859f('0x25')](_0x2814a9,function(_0x3597fe){if(_0x3597fe['type']!==_0x859f('0x39')){var _0x360ef2={};_0x360ef2[_0x3597fe[_0x859f('0x2a')]]={'$like':'%'+_0x263de0[_0x859f('0x2b')][_0x859f('0x3a')]+'%'};return _0x360ef2;}})});}_0x1ebd23=_[_0x859f('0x38')]({},_0x1ebd23,_0x263de0['options']);var _0x13f7ec={'where':_0x1ebd23[_0x859f('0x36')]};return db[_0x859f('0x26')]['count'](_0x13f7ec)[_0x859f('0x1f')](function(_0x3c2dcc){_0x5826bf[_0x859f('0x1a')]=_0x3c2dcc;if(_0x263de0[_0x859f('0x2b')][_0x859f('0x3b')]){_0x1ebd23[_0x859f('0x3c')]=[{'all':!![]}];}return db['MailTransferReport'][_0x859f('0x3d')](_0x1ebd23);})[_0x859f('0x1f')](function(_0x57eedf){_0x5826bf[_0x859f('0x3e')]=_0x57eedf;return _0x5826bf;})[_0x859f('0x1f')](respondWithFilteredResult(_0x43add2,_0x1ebd23))[_0x859f('0x3f')](handleError(_0x43add2,null));};exports['show']=function(_0x8062ac,_0x4b86ae){var _0x3317d6={'raw':!![],'where':{'id':_0x8062ac[_0x859f('0x40')]['id']}},_0x101a51={};_0x101a51[_0x859f('0x29')]=_[_0x859f('0x2c')](db['MailTransferReport'][_0x859f('0x41')]);_0x101a51[_0x859f('0x2b')]=_[_0x859f('0x2c')](_0x8062ac['query']);_0x101a51[_0x859f('0x2d')]=_[_0x859f('0x2e')](_0x101a51['model'],_0x101a51[_0x859f('0x2b')]);_0x3317d6[_0x859f('0x30')]=_[_0x859f('0x2e')](_0x101a51[_0x859f('0x29')],qs[_0x859f('0x2f')](_0x8062ac['query'][_0x859f('0x2f')]));_0x3317d6[_0x859f('0x30')]=_0x3317d6['attributes'][_0x859f('0x31')]?_0x3317d6[_0x859f('0x30')]:_0x101a51[_0x859f('0x29')];if(_0x8062ac['query'][_0x859f('0x3b')]){_0x3317d6[_0x859f('0x3c')]=[{'all':!![]}];}_0x3317d6=_[_0x859f('0x38')]({},_0x3317d6,_0x8062ac['options']);return db[_0x859f('0x26')]['find'](_0x3317d6)[_0x859f('0x1f')](handleEntityNotFound(_0x4b86ae,null))['then'](respondWithResult(_0x4b86ae,null))[_0x859f('0x3f')](handleError(_0x4b86ae,null));};exports[_0x859f('0x42')]=function(_0xa652ff,_0x469090){return db['MailTransferReport'][_0x859f('0x42')](_0xa652ff[_0x859f('0x43')],{})[_0x859f('0x1f')](respondWithResult(_0x469090,0xc9))['catch'](handleError(_0x469090,null));};exports[_0x859f('0x44')]=function(_0x47ccd7,_0x489b44){if(_0x47ccd7[_0x859f('0x43')]['id']){delete _0x47ccd7['body']['id'];}return db[_0x859f('0x26')]['find']({'where':{'id':_0x47ccd7[_0x859f('0x40')]['id']}})[_0x859f('0x1f')](handleEntityNotFound(_0x489b44,null))[_0x859f('0x1f')](saveUpdates(_0x47ccd7[_0x859f('0x43')],null))[_0x859f('0x1f')](respondWithResult(_0x489b44,null))[_0x859f('0x3f')](handleError(_0x489b44,null));};exports[_0x859f('0x20')]=function(_0x402fb1,_0x3d7052){return db[_0x859f('0x26')][_0x859f('0x45')]({'where':{'id':_0x402fb1[_0x859f('0x40')]['id']}})[_0x859f('0x1f')](handleEntityNotFound(_0x3d7052,null))['then'](removeEntity(_0x3d7052,null))[_0x859f('0x3f')](handleError(_0x3d7052,null));};exports[_0x859f('0x46')]=function(_0x33d6ea,_0x9287f){return db[_0x859f('0x26')][_0x859f('0x46')]()['then'](respondWithResult(_0x9287f,null))['catch'](handleError(_0x9287f,null));}; \ No newline at end of file +var _0xf684=['count','set','Content-Range','apply','destroy','then','stack','name','index','map','MailTransferReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit'];(function(_0x3cddd2,_0x29ad30){var _0x2b835b=function(_0x17733e){while(--_0x17733e){_0x3cddd2['push'](_0x3cddd2['shift']());}};_0x2b835b(++_0x29ad30);}(_0xf684,0xb6));var _0x4f68=function(_0x4a1582,_0x3b696a){_0x4a1582=_0x4a1582-0x0;var _0x122f16=_0xf684[_0x4a1582];return _0x122f16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f68('0x0'));var zipdir=require(_0x4f68('0x1'));var jsonpatch=require(_0x4f68('0x2'));var rp=require(_0x4f68('0x3'));var moment=require(_0x4f68('0x4'));var BPromise=require(_0x4f68('0x5'));var Mustache=require(_0x4f68('0x6'));var util=require(_0x4f68('0x7'));var path=require(_0x4f68('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4f68('0x9'));var fs=require('fs');var fs_extra=require(_0x4f68('0xa'));var _=require(_0x4f68('0xb'));var squel=require('squel');var crypto=require(_0x4f68('0xc'));var jsforce=require(_0x4f68('0xd'));var deskjs=require(_0x4f68('0xe'));var toCsv=require(_0x4f68('0xf'));var querystring=require(_0x4f68('0x10'));var Papa=require(_0x4f68('0x11'));var Redis=require('ioredis');var authService=require(_0x4f68('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4f68('0x13'));var hardwareService=require(_0x4f68('0x14'));var logger=require(_0x4f68('0x15'))(_0x4f68('0x16'));var utils=require(_0x4f68('0x17'));var config=require(_0x4f68('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41c014,_0xd0d1d){_0xd0d1d=_0xd0d1d||0xcc;return function(_0x5e9bdc){if(_0x5e9bdc){return _0x41c014[_0x4f68('0x19')](_0xd0d1d);}return _0x41c014['status'](_0xd0d1d)[_0x4f68('0x1a')]();};}function respondWithResult(_0x2a7c2a,_0x111ada){_0x111ada=_0x111ada||0xc8;return function(_0x388c8a){if(_0x388c8a){return _0x2a7c2a[_0x4f68('0x1b')](_0x111ada)['json'](_0x388c8a);}};}function respondWithFilteredResult(_0x5485ea,_0xf8f072){return function(_0x1ae7bf){if(_0x1ae7bf){var _0x221a05=typeof _0xf8f072[_0x4f68('0x1c')]===_0x4f68('0x1d')&&typeof _0xf8f072[_0x4f68('0x1e')]==='undefined';var _0x4f8757=_0x1ae7bf[_0x4f68('0x1f')];var _0xd0e056=_0x221a05?0x0:_0xf8f072[_0x4f68('0x1c')];var _0x2c9298=_0x221a05?_0x1ae7bf[_0x4f68('0x1f')]:_0xf8f072[_0x4f68('0x1c')]+_0xf8f072[_0x4f68('0x1e')];var _0x4b80f9;if(_0x2c9298>=_0x4f8757){_0x2c9298=_0x4f8757;_0x4b80f9=0xc8;}else{_0x4b80f9=0xce;}_0x5485ea[_0x4f68('0x1b')](_0x4b80f9);return _0x5485ea[_0x4f68('0x20')](_0x4f68('0x21'),_0xd0e056+'-'+_0x2c9298+'/'+_0x4f8757)['json'](_0x1ae7bf);}return null;};}function patchUpdates(_0x3baac2){return function(_0x1a93d0){try{jsonpatch[_0x4f68('0x22')](_0x1a93d0,_0x3baac2,!![]);}catch(_0x41764c){return BPromise['reject'](_0x41764c);}return _0x1a93d0['save']();};}function saveUpdates(_0x3a0bfc,_0x300d69){return function(_0x11b6cc){if(_0x11b6cc){return _0x11b6cc['update'](_0x3a0bfc)['then'](function(_0x5c39a0){return _0x5c39a0;});}return null;};}function removeEntity(_0x297d20,_0x56fbb1){return function(_0x48bb87){if(_0x48bb87){return _0x48bb87[_0x4f68('0x23')]()[_0x4f68('0x24')](function(){_0x297d20['status'](0xcc)[_0x4f68('0x1a')]();});}};}function handleEntityNotFound(_0x8b544f,_0x42d23a){return function(_0x227185){if(!_0x227185){_0x8b544f[_0x4f68('0x19')](0x194);}return _0x227185;};}function handleError(_0x3d59f5,_0x447de0){_0x447de0=_0x447de0||0x1f4;return function(_0x4800bd){logger['error'](_0x4800bd[_0x4f68('0x25')]);if(_0x4800bd[_0x4f68('0x26')]){delete _0x4800bd[_0x4f68('0x26')];}_0x3d59f5[_0x4f68('0x1b')](_0x447de0)['send'](_0x4800bd);};}exports[_0x4f68('0x27')]=function(_0x52a27c,_0x3276d4){var _0x8fd83b={},_0x5b9163={},_0x527c2f={'count':0x0,'rows':[]};var _0x33f04c=_[_0x4f68('0x28')](db[_0x4f68('0x29')]['rawAttributes'],function(_0x301f60){return{'name':_0x301f60[_0x4f68('0x2a')],'type':_0x301f60[_0x4f68('0x2b')]['key']};});_0x5b9163[_0x4f68('0x2c')]=_[_0x4f68('0x28')](_0x33f04c,_0x4f68('0x26'));_0x5b9163[_0x4f68('0x2d')]=_[_0x4f68('0x2e')](_0x52a27c[_0x4f68('0x2d')]);_0x5b9163[_0x4f68('0x2f')]=_[_0x4f68('0x30')](_0x5b9163['model'],_0x5b9163['query']);_0x8fd83b[_0x4f68('0x31')]=_['intersection'](_0x5b9163[_0x4f68('0x2c')],qs[_0x4f68('0x32')](_0x52a27c[_0x4f68('0x2d')][_0x4f68('0x32')]));_0x8fd83b[_0x4f68('0x31')]=_0x8fd83b[_0x4f68('0x31')][_0x4f68('0x33')]?_0x8fd83b[_0x4f68('0x31')]:_0x5b9163[_0x4f68('0x2c')];if(!_0x52a27c['query'][_0x4f68('0x34')](_0x4f68('0x35'))){_0x8fd83b[_0x4f68('0x1e')]=qs['limit'](_0x52a27c[_0x4f68('0x2d')]['limit']);_0x8fd83b[_0x4f68('0x1c')]=qs[_0x4f68('0x1c')](_0x52a27c[_0x4f68('0x2d')][_0x4f68('0x1c')]);}_0x8fd83b[_0x4f68('0x36')]=qs[_0x4f68('0x37')](_0x52a27c['query'][_0x4f68('0x37')]);_0x8fd83b['where']=qs[_0x4f68('0x2f')](_['pick'](_0x52a27c[_0x4f68('0x2d')],_0x5b9163[_0x4f68('0x2f')]),_0x33f04c);if(_0x52a27c[_0x4f68('0x2d')][_0x4f68('0x38')]){_0x8fd83b[_0x4f68('0x39')]=_['merge'](_0x8fd83b[_0x4f68('0x39')],{'$or':_[_0x4f68('0x28')](_0x33f04c,function(_0x1be620){if(_0x1be620['type']!==_0x4f68('0x3a')){var _0x290441={};_0x290441[_0x1be620[_0x4f68('0x26')]]={'$like':'%'+_0x52a27c[_0x4f68('0x2d')]['filter']+'%'};return _0x290441;}})});}_0x8fd83b=_['merge']({},_0x8fd83b,_0x52a27c[_0x4f68('0x3b')]);var _0x3fcf0a={'where':_0x8fd83b[_0x4f68('0x39')]};return db[_0x4f68('0x29')][_0x4f68('0x1f')](_0x3fcf0a)[_0x4f68('0x24')](function(_0x5c6082){_0x527c2f[_0x4f68('0x1f')]=_0x5c6082;if(_0x52a27c[_0x4f68('0x2d')][_0x4f68('0x3c')]){_0x8fd83b[_0x4f68('0x3d')]=[{'all':!![]}];}return db[_0x4f68('0x29')][_0x4f68('0x3e')](_0x8fd83b);})[_0x4f68('0x24')](function(_0x4c940d){_0x527c2f[_0x4f68('0x3f')]=_0x4c940d;return _0x527c2f;})[_0x4f68('0x24')](respondWithFilteredResult(_0x3276d4,_0x8fd83b))[_0x4f68('0x40')](handleError(_0x3276d4,null));};exports['show']=function(_0x22681a,_0x55981b){var _0x211689={'raw':!![],'where':{'id':_0x22681a[_0x4f68('0x41')]['id']}},_0x3a12f4={};_0x3a12f4[_0x4f68('0x2c')]=_[_0x4f68('0x2e')](db['MailTransferReport']['rawAttributes']);_0x3a12f4['query']=_[_0x4f68('0x2e')](_0x22681a[_0x4f68('0x2d')]);_0x3a12f4['filters']=_[_0x4f68('0x30')](_0x3a12f4[_0x4f68('0x2c')],_0x3a12f4[_0x4f68('0x2d')]);_0x211689[_0x4f68('0x31')]=_[_0x4f68('0x30')](_0x3a12f4[_0x4f68('0x2c')],qs[_0x4f68('0x32')](_0x22681a['query'][_0x4f68('0x32')]));_0x211689[_0x4f68('0x31')]=_0x211689[_0x4f68('0x31')]['length']?_0x211689[_0x4f68('0x31')]:_0x3a12f4['model'];if(_0x22681a[_0x4f68('0x2d')]['includeAll']){_0x211689['include']=[{'all':!![]}];}_0x211689=_['merge']({},_0x211689,_0x22681a['options']);return db[_0x4f68('0x29')][_0x4f68('0x42')](_0x211689)['then'](handleEntityNotFound(_0x55981b,null))[_0x4f68('0x24')](respondWithResult(_0x55981b,null))['catch'](handleError(_0x55981b,null));};exports['create']=function(_0x5108f3,_0x1da25e){return db['MailTransferReport'][_0x4f68('0x43')](_0x5108f3[_0x4f68('0x44')],{})[_0x4f68('0x24')](respondWithResult(_0x1da25e,0xc9))[_0x4f68('0x40')](handleError(_0x1da25e,null));};exports[_0x4f68('0x45')]=function(_0x4261ca,_0x93ced8){if(_0x4261ca[_0x4f68('0x44')]['id']){delete _0x4261ca[_0x4f68('0x44')]['id'];}return db[_0x4f68('0x29')][_0x4f68('0x42')]({'where':{'id':_0x4261ca[_0x4f68('0x41')]['id']}})[_0x4f68('0x24')](handleEntityNotFound(_0x93ced8,null))[_0x4f68('0x24')](saveUpdates(_0x4261ca[_0x4f68('0x44')],null))['then'](respondWithResult(_0x93ced8,null))['catch'](handleError(_0x93ced8,null));};exports[_0x4f68('0x23')]=function(_0xa63eca,_0x309190){return db[_0x4f68('0x29')][_0x4f68('0x42')]({'where':{'id':_0xa63eca[_0x4f68('0x41')]['id']}})[_0x4f68('0x24')](handleEntityNotFound(_0x309190,null))[_0x4f68('0x24')](removeEntity(_0x309190,null))[_0x4f68('0x40')](handleError(_0x309190,null));};exports[_0x4f68('0x46')]=function(_0xd30f15,_0x1a08fe){return db['MailTransferReport']['describe']()[_0x4f68('0x24')](respondWithResult(_0x1a08fe,null))[_0x4f68('0x40')](handleError(_0x1a08fe,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 6e3231d..e24ad74 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 _0x3c06=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','report_mail_transfer','uniqueid'];(function(_0x1e7634,_0x37d8e2){var _0x50a829=function(_0x3fe890){while(--_0x3fe890){_0x1e7634['push'](_0x1e7634['shift']());}};_0x50a829(++_0x37d8e2);}(_0x3c06,0xf7));var _0x63c0=function(_0x577aa0,_0x7fbcbf){_0x577aa0=_0x577aa0-0x0;var _0x3f8800=_0x3c06[_0x577aa0];return _0x3f8800;};'use strict';var _=require(_0x63c0('0x0'));var util=require(_0x63c0('0x1'));var logger=require(_0x63c0('0x2'))(_0x63c0('0x3'));var moment=require(_0x63c0('0x4'));var BPromise=require(_0x63c0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63c0('0x6'));var rimraf=require(_0x63c0('0x7'));var config=require(_0x63c0('0x8'));var attributes=require(_0x63c0('0x9'));module[_0x63c0('0xa')]=function(_0x4474bd,_0x2fe268){return _0x4474bd['define']('MailTransferReport',attributes,{'tableName':_0x63c0('0xb'),'paranoid':![],'indexes':[{'name':_0x63c0('0xc'),'fields':[_0x63c0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x956a=['report_mail_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','MailTransferReport'];(function(_0x41dfac,_0x278319){var _0x12900b=function(_0x3324cd){while(--_0x3324cd){_0x41dfac['push'](_0x41dfac['shift']());}};_0x12900b(++_0x278319);}(_0x956a,0xb6));var _0xa956=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x956a[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xa956('0x0'));var logger=require(_0xa956('0x1'))(_0xa956('0x2'));var moment=require(_0xa956('0x3'));var BPromise=require(_0xa956('0x4'));var rp=require(_0xa956('0x5'));var fs=require('fs');var path=require(_0xa956('0x6'));var rimraf=require(_0xa956('0x7'));var config=require('../../config/environment');var attributes=require('./mailTransferReport.attributes');module[_0xa956('0x8')]=function(_0x2b9675,_0x2ce2c8){return _0x2b9675['define'](_0xa956('0x9'),attributes,{'tableName':_0xa956('0xa'),'paranoid':![],'indexes':[{'name':_0xa956('0xb'),'fields':[_0xa956('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 944b02c..1986526 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 _0x2844=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailTransferReport,\x20%s,\x20%s','info'];(function(_0x932e07,_0x5d64bf){var _0x48c741=function(_0x36672d){while(--_0x36672d){_0x932e07['push'](_0x932e07['shift']());}};_0x48c741(++_0x5d64bf);}(_0x2844,0x1f0));var _0x4284=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x2844[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x4284('0x0'));var util=require(_0x4284('0x1'));var moment=require(_0x4284('0x2'));var BPromise=require(_0x4284('0x3'));var rs=require(_0x4284('0x4'));var fs=require('fs');var Redis=require(_0x4284('0x5'));var db=require(_0x4284('0x6'))['db'];var utils=require(_0x4284('0x7'));var logger=require(_0x4284('0x8'))(_0x4284('0x9'));var config=require(_0x4284('0xa'));var jayson=require(_0x4284('0xb'));var client=jayson[_0x4284('0xc')][_0x4284('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3392a7,_0x48ffd4,_0x5f2aaf){return new BPromise(function(_0x30e2a8,_0x3acdfc){return client[_0x4284('0xe')](_0x3392a7,_0x5f2aaf)[_0x4284('0xf')](function(_0x42e0c5){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x48ffd4,'request\x20sent');logger[_0x4284('0x10')](_0x4284('0x11'),_0x48ffd4,_0x4284('0x12'),JSON[_0x4284('0x13')](_0x42e0c5));if(_0x42e0c5['error']){if(_0x42e0c5[_0x4284('0x14')]['code']===0x1f4){logger[_0x4284('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x48ffd4,_0x42e0c5[_0x4284('0x14')][_0x4284('0x15')]);return _0x3acdfc(_0x42e0c5['error'][_0x4284('0x15')]);}logger['error'](_0x4284('0x16'),_0x48ffd4,_0x42e0c5[_0x4284('0x14')][_0x4284('0x15')]);return _0x30e2a8(_0x42e0c5[_0x4284('0x14')]['message']);}else{logger[_0x4284('0x17')](_0x4284('0x16'),_0x48ffd4,'request\x20sent');_0x30e2a8(_0x42e0c5[_0x4284('0x18')][_0x4284('0x15')]);}})[_0x4284('0x19')](function(_0x6a0be9){logger[_0x4284('0x14')](_0x4284('0x16'),_0x48ffd4,_0x6a0be9);_0x3acdfc(_0x6a0be9);});});} \ No newline at end of file +var _0x123b=['debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','MailTransferReport,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2bc095,_0x13a945){var _0x5e8a02=function(_0x37e0bb){while(--_0x37e0bb){_0x2bc095['push'](_0x2bc095['shift']());}};_0x5e8a02(++_0x13a945);}(_0x123b,0x191));var _0xb123=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x123b[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xb123('0x0'));var util=require('util');var moment=require(_0xb123('0x1'));var BPromise=require(_0xb123('0x2'));var rs=require(_0xb123('0x3'));var fs=require('fs');var Redis=require(_0xb123('0x4'));var db=require(_0xb123('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb123('0x6'));var config=require(_0xb123('0x7'));var jayson=require(_0xb123('0x8'));var client=jayson[_0xb123('0x9')][_0xb123('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15b1d4,_0x3e3386,_0x1d46c9){return new BPromise(function(_0x197d3d,_0x400756){return client[_0xb123('0xb')](_0x15b1d4,_0x1d46c9)[_0xb123('0xc')](function(_0x4270ff){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x3e3386,'request\x20sent');logger[_0xb123('0xd')](_0xb123('0xe'),_0x3e3386,_0xb123('0xf'),JSON['stringify'](_0x4270ff));if(_0x4270ff['error']){if(_0x4270ff[_0xb123('0x10')][_0xb123('0x11')]===0x1f4){logger[_0xb123('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x3e3386,_0x4270ff['error'][_0xb123('0x12')]);return _0x400756(_0x4270ff[_0xb123('0x10')][_0xb123('0x12')]);}logger['error'](_0xb123('0x13'),_0x3e3386,_0x4270ff[_0xb123('0x10')]['message']);return _0x197d3d(_0x4270ff[_0xb123('0x10')][_0xb123('0x12')]);}else{logger[_0xb123('0x14')](_0xb123('0x13'),_0x3e3386,_0xb123('0xf'));_0x197d3d(_0x4270ff[_0xb123('0x15')]['message']);}})[_0xb123('0x16')](function(_0x4e921d){logger[_0xb123('0x10')](_0xb123('0x13'),_0x3e3386,_0x4e921d);_0x400756(_0x4e921d);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index b59ab20..1cbbd37 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 _0xad7c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0xad7c,0x7a));var _0xcad7=function(_0x5ba0c6,_0x18e4f5){_0x5ba0c6=_0x5ba0c6-0x0;var _0x3fa1df=_0xad7c[_0x5ba0c6];return _0x3fa1df;};'use strict';var multer=require(_0xcad7('0x0'));var util=require(_0xcad7('0x1'));var path=require('path');var timeout=require(_0xcad7('0x2'));var express=require(_0xcad7('0x3'));var router=express[_0xcad7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcad7('0x5'));var interaction=require(_0xcad7('0x6'));var config=require(_0xcad7('0x7'));var controller=require('./memberReport.controller');router[_0xcad7('0x8')]('/',auth[_0xcad7('0x9')](),controller[_0xcad7('0xa')]);router[_0xcad7('0x8')]('/describe',auth[_0xcad7('0x9')](),controller['describe']);router[_0xcad7('0x8')](_0xcad7('0xb'),auth[_0xcad7('0x9')](),controller['show']);router[_0xcad7('0xc')]('/',auth['isAuthenticated'](),controller[_0xcad7('0xd')]);router[_0xcad7('0xe')](_0xcad7('0xb'),auth[_0xcad7('0x9')](),controller[_0xcad7('0xf')]);router[_0xcad7('0x10')](_0xcad7('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xcad7('0x11')]=router; \ No newline at end of file +var _0x346a=['isAuthenticated','index','/describe','describe','show','post','create','delete','/:id','destroy','exports','util','path','connect-timeout','Router','fs-extra','./memberReport.controller','get'];(function(_0x18b477,_0x555d04){var _0x240b92=function(_0x343b06){while(--_0x343b06){_0x18b477['push'](_0x18b477['shift']());}};_0x240b92(++_0x555d04);}(_0x346a,0xd1));var _0xa346=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x346a[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0xa346('0x0'));var path=require(_0xa346('0x1'));var timeout=require(_0xa346('0x2'));var express=require('express');var router=express[_0xa346('0x3')]();var fs_extra=require(_0xa346('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa346('0x5'));router[_0xa346('0x6')]('/',auth[_0xa346('0x7')](),controller[_0xa346('0x8')]);router[_0xa346('0x6')](_0xa346('0x9'),auth[_0xa346('0x7')](),controller[_0xa346('0xa')]);router[_0xa346('0x6')]('/:id',auth[_0xa346('0x7')](),controller[_0xa346('0xb')]);router[_0xa346('0xc')]('/',auth['isAuthenticated'](),controller[_0xa346('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa346('0xe')](_0xa346('0xf'),auth['isAuthenticated'](),controller[_0xa346('0x10')]);module[_0xa346('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index c2e8fa9..329dddb 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 _0x341f=['talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','exitAt','setDataValue','duration','talk:[destination]'];(function(_0x2fadd4,_0x313b40){var _0x34914c=function(_0x3d0de7){while(--_0x3d0de7){_0x2fadd4['push'](_0x2fadd4['shift']());}};_0x34914c(++_0x313b40);}(_0x341f,0xa6));var _0xf341=function(_0xcce37e,_0x2c587f){_0xcce37e=_0xcce37e-0x0;var _0x57ad35=_0x341f[_0xcce37e];return _0x57ad35;};'use strict';var Sequelize=require(_0xf341('0x0'));var moment=require(_0xf341('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf341('0x2')]},'interface':{'type':Sequelize[_0xf341('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xf341('0x3'),'comment':_0xf341('0x4')},'duration':{'type':Sequelize[_0xf341('0x5')]},'enterAt':{'type':Sequelize[_0xf341('0x6')]},'exitAt':{'type':Sequelize[_0xf341('0x6')],'set':function(_0x269f1d){var _0x155b8d=moment(_0x269f1d);var _0x25e929=moment(this['getDataValue'](_0xf341('0x7')));var _0x43702a=_0x155b8d[_0xf341('0x8')](_0x25e929,_0xf341('0x9'));this['setDataValue'](_0xf341('0xa'),_0x269f1d);this[_0xf341('0xb')](_0xf341('0xc'),_0x43702a>=0x0?_0x43702a:null);}},'data1':{'type':Sequelize[_0xf341('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xf341('0x2')],'comment':_0xf341('0xd')},'data4':{'type':Sequelize[_0xf341('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xf341('0x2')],'comment':_0xf341('0xe')},'role':{'type':Sequelize[_0xf341('0x2')]},'internal':{'type':Sequelize[_0xf341('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x676d=['seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','getDataValue','enterAt','diff'];(function(_0x3732ac,_0x1ff4d2){var _0x50aae6=function(_0x5179b2){while(--_0x5179b2){_0x3732ac['push'](_0x3732ac['shift']());}};_0x50aae6(++_0x1ff4d2);}(_0x676d,0x1dc));var _0xd676=function(_0x9fe42d,_0x5c16b7){_0x9fe42d=_0x9fe42d-0x0;var _0x4ca08c=_0x676d[_0x9fe42d];return _0x4ca08c;};'use strict';var Sequelize=require(_0xd676('0x0'));var moment=require(_0xd676('0x1'));module[_0xd676('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xd676('0x3')]},'type':{'type':Sequelize[_0xd676('0x3')],'defaultValue':_0xd676('0x4'),'comment':_0xd676('0x5')},'duration':{'type':Sequelize[_0xd676('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x125e7d){var _0xcdef9e=moment(_0x125e7d);var _0x43f73b=moment(this[_0xd676('0x7')](_0xd676('0x8')));var _0x39a146=_0xcdef9e[_0xd676('0x9')](_0x43f73b,_0xd676('0xa'));this[_0xd676('0xb')](_0xd676('0xc'),_0x125e7d);this[_0xd676('0xb')](_0xd676('0xd'),_0x39a146>=0x0?_0x39a146:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xd676('0xe')},'data2':{'type':Sequelize[_0xd676('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xd676('0x3')],'comment':_0xd676('0xf')},'data4':{'type':Sequelize[_0xd676('0x3')],'comment':_0xd676('0x10')},'data5':{'type':Sequelize['STRING'],'comment':_0xd676('0x11')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xd676('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index dba836f..faad9d3 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 _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(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x34e8,0x12c));var _0x834e=function(_0x556159,_0x306389){_0x556159=_0x556159-0x0;var _0x4b3bcd=_0x34e8[_0x556159];return _0x4b3bcd;};'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 +var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','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'];(function(_0x1ce22c,_0xb3bf9b){var _0x3c14ba=function(_0x4fe6f0){while(--_0x4fe6f0){_0x1ce22c['push'](_0x1ce22c['shift']());}};_0x3c14ba(++_0xb3bf9b);}(_0x008c,0x188));var _0xc008=function(_0x18e80c,_0x4077f7){_0x18e80c=_0x18e80c-0x0;var _0x183ba9=_0x008c[_0x18e80c];return _0x183ba9;};'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')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index a833107..1d801b4 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 _0x2899=['request-promise','path','rimraf','exports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x2899,0xfe));var _0x9289=function(_0x38053e,_0x188198){_0x38053e=_0x38053e-0x0;var _0x3316a6=_0x2899[_0x38053e];return _0x3316a6;};'use strict';var _=require(_0x9289('0x0'));var util=require(_0x9289('0x1'));var logger=require(_0x9289('0x2'))(_0x9289('0x3'));var moment=require(_0x9289('0x4'));var BPromise=require(_0x9289('0x5'));var rp=require(_0x9289('0x6'));var fs=require('fs');var path=require(_0x9289('0x7'));var rimraf=require(_0x9289('0x8'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x9289('0x9')]=function(_0x5bcb8b,_0x200897){return _0x5bcb8b['define']('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x598f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','MemberReport','report_member','membername_interface','interface','lodash','util'];(function(_0x39fca6,_0x252aa7){var _0x3afbc8=function(_0x36e744){while(--_0x36e744){_0x39fca6['push'](_0x39fca6['shift']());}};_0x3afbc8(++_0x252aa7);}(_0x598f,0x1cf));var _0xf598=function(_0x43d426,_0x589cfb){_0x43d426=_0x43d426-0x0;var _0x2c1597=_0x598f[_0x43d426];return _0x2c1597;};'use strict';var _=require(_0xf598('0x0'));var util=require(_0xf598('0x1'));var logger=require(_0xf598('0x2'))(_0xf598('0x3'));var moment=require(_0xf598('0x4'));var BPromise=require(_0xf598('0x5'));var rp=require(_0xf598('0x6'));var fs=require('fs');var path=require(_0xf598('0x7'));var rimraf=require(_0xf598('0x8'));var config=require(_0xf598('0x9'));var attributes=require('./memberReport.attributes');module['exports']=function(_0x41b1f8,_0x32be03){return _0x41b1f8[_0xf598('0xa')](_0xf598('0xb'),attributes,{'tableName':_0xf598('0xc'),'paranoid':![],'indexes':[{'name':_0xf598('0xd'),'fields':['membername',_0xf598('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 58cdbb0..36e4025 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 _0xb7a7=['rpc','jayson/promise','client','http','request','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','attributes','map','model','stringify','CreateMemberReport','create','body','then','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x4d35f9,_0xcfacc9){var _0x30c5d6=function(_0x4cb0e5){while(--_0x4cb0e5){_0x4d35f9['push'](_0x4d35f9['shift']());}};_0x30c5d6(++_0xcfacc9);}(_0xb7a7,0x6e));var _0x7b7a=function(_0x7b8617,_0x407b66){_0x7b8617=_0x7b8617-0x0;var _0x54d6d3=_0xb7a7[_0x7b8617];return _0x54d6d3;};'use strict';var _=require(_0x7b7a('0x0'));var util=require(_0x7b7a('0x1'));var moment=require(_0x7b7a('0x2'));var BPromise=require(_0x7b7a('0x3'));var rs=require(_0x7b7a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7b7a('0x5'));var logger=require(_0x7b7a('0x6'))(_0x7b7a('0x7'));var config=require('../../config/environment');var jayson=require(_0x7b7a('0x8'));var client=jayson[_0x7b7a('0x9')][_0x7b7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf003bc,_0x8e6a84,_0x1ef0f3){return new BPromise(function(_0x27e956,_0x2e09b4){return client[_0x7b7a('0xb')](_0xf003bc,_0x1ef0f3)['then'](function(_0x3f1125){logger['info'](_0x7b7a('0xc'),_0x8e6a84,_0x7b7a('0xd'));logger[_0x7b7a('0xe')](_0x7b7a('0xf'),_0x8e6a84,_0x7b7a('0xd'),JSON['stringify'](_0x3f1125));if(_0x3f1125['error']){if(_0x3f1125['error']['code']===0x1f4){logger[_0x7b7a('0x10')](_0x7b7a('0xc'),_0x8e6a84,_0x3f1125['error'][_0x7b7a('0x11')]);return _0x2e09b4(_0x3f1125[_0x7b7a('0x10')][_0x7b7a('0x11')]);}logger[_0x7b7a('0x10')](_0x7b7a('0xc'),_0x8e6a84,_0x3f1125[_0x7b7a('0x10')][_0x7b7a('0x11')]);return _0x27e956(_0x3f1125[_0x7b7a('0x10')][_0x7b7a('0x11')]);}else{logger[_0x7b7a('0x12')]('MemberReport,\x20%s,\x20%s',_0x8e6a84,'request\x20sent');_0x27e956(_0x3f1125[_0x7b7a('0x13')][_0x7b7a('0x11')]);}})[_0x7b7a('0x14')](function(_0x41f0a8){logger[_0x7b7a('0x10')]('MemberReport,\x20%s,\x20%s',_0x8e6a84,_0x41f0a8);_0x2e09b4(_0x41f0a8);});});}exports[_0x7b7a('0x15')]=function(_0x566e83){var _0x430c11=this;return new Promise(function(_0x763b6,_0x38e20e){return db[_0x7b7a('0x16')][_0x7b7a('0x17')]({'raw':_0x566e83[_0x7b7a('0x18')]?_0x566e83[_0x7b7a('0x18')][_0x7b7a('0x19')]===undefined?!![]:![]:!![],'where':_0x566e83[_0x7b7a('0x18')]?_0x566e83[_0x7b7a('0x18')][_0x7b7a('0x1a')]||null:null,'attributes':_0x566e83[_0x7b7a('0x18')]?_0x566e83['options']['attributes']||null:null,'limit':_0x566e83[_0x7b7a('0x18')]?_0x566e83[_0x7b7a('0x18')][_0x7b7a('0x1b')]||null:null,'include':_0x566e83['options']?_0x566e83[_0x7b7a('0x18')][_0x7b7a('0x1c')]?_['map'](_0x566e83[_0x7b7a('0x18')][_0x7b7a('0x1c')],function(_0x5ea68b){return{'model':db[_0x5ea68b['model']],'as':_0x5ea68b['as'],'attributes':_0x5ea68b[_0x7b7a('0x1d')],'include':_0x5ea68b[_0x7b7a('0x1c')]?_[_0x7b7a('0x1e')](_0x5ea68b[_0x7b7a('0x1c')],function(_0x68966a){return{'model':db[_0x68966a[_0x7b7a('0x1f')]],'as':_0x68966a['as'],'attributes':_0x68966a[_0x7b7a('0x1d')],'include':_0x68966a[_0x7b7a('0x1c')]?_[_0x7b7a('0x1e')](_0x68966a[_0x7b7a('0x1c')],function(_0x2617a7){return{'model':db[_0x2617a7[_0x7b7a('0x1f')]],'as':_0x2617a7['as'],'attributes':_0x2617a7[_0x7b7a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34e123){logger[_0x7b7a('0x12')](_0x7b7a('0x15'),_0x566e83);logger[_0x7b7a('0xe')]('GetMemberReport',_0x566e83,JSON[_0x7b7a('0x20')](_0x34e123));_0x763b6(_0x34e123);})[_0x7b7a('0x14')](function(_0x2c81ca){logger[_0x7b7a('0x10')]('GetMemberReport',_0x2c81ca[_0x7b7a('0x11')],_0x566e83);_0x38e20e(_0x430c11[_0x7b7a('0x10')](0x1f4,_0x2c81ca[_0x7b7a('0x11')]));});});};exports[_0x7b7a('0x21')]=function(_0x98181){var _0x303bd4=this;return new Promise(function(_0x125789,_0x576124){return db[_0x7b7a('0x16')][_0x7b7a('0x22')](_0x98181[_0x7b7a('0x23')],{'raw':_0x98181[_0x7b7a('0x18')]?_0x98181[_0x7b7a('0x18')][_0x7b7a('0x19')]===undefined?!![]:![]:!![]})[_0x7b7a('0x24')](function(_0x5d3ca6){logger[_0x7b7a('0x12')]('CreateMemberReport',_0x98181);logger['debug'](_0x7b7a('0x21'),_0x98181,JSON[_0x7b7a('0x20')](_0x5d3ca6));_0x125789(_0x5d3ca6);})[_0x7b7a('0x14')](function(_0xd76e8f){logger[_0x7b7a('0x10')](_0x7b7a('0x21'),_0xd76e8f[_0x7b7a('0x11')],_0x98181);_0x576124(_0x303bd4[_0x7b7a('0x10')](0x1f4,_0xd76e8f[_0x7b7a('0x11')]));});});};exports[_0x7b7a('0x25')]=function(_0x32e41e){var _0x1d8f36=this;return new Promise(function(_0x3c6549,_0x3c1ea3){return db['MemberReport'][_0x7b7a('0x26')](_0x32e41e[_0x7b7a('0x23')],{'raw':_0x32e41e['options']?_0x32e41e[_0x7b7a('0x18')][_0x7b7a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32e41e[_0x7b7a('0x18')]?_0x32e41e[_0x7b7a('0x18')][_0x7b7a('0x1a')]||null:null,'attributes':_0x32e41e[_0x7b7a('0x18')]?_0x32e41e[_0x7b7a('0x18')][_0x7b7a('0x1d')]||null:null,'limit':_0x32e41e[_0x7b7a('0x18')]?_0x32e41e['options']['limit']||null:null})[_0x7b7a('0x24')](function(_0x26f112){logger['info'](_0x7b7a('0x25'),_0x32e41e);logger[_0x7b7a('0xe')](_0x7b7a('0x25'),_0x32e41e,JSON['stringify'](_0x26f112));_0x3c6549(_0x26f112);})[_0x7b7a('0x14')](function(_0x2b6467){logger['error'](_0x7b7a('0x25'),_0x2b6467[_0x7b7a('0x11')],_0x32e41e);_0x3c1ea3(_0x1d8f36[_0x7b7a('0x10')](0x1f4,_0x2b6467[_0x7b7a('0x11')]));});});}; \ No newline at end of file +var _0xcedf=['message','info','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','include','map','model','attributes','CreateMemberReport','create','body','UpdateMemberReport','update','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5dec2b,_0x275a05){var _0x4aea35=function(_0x482153){while(--_0x482153){_0x5dec2b['push'](_0x5dec2b['shift']());}};_0x4aea35(++_0x275a05);}(_0xcedf,0x1b6));var _0xfced=function(_0x3fcb96,_0x443ee0){_0x3fcb96=_0x3fcb96-0x0;var _0x46fa7=_0xcedf[_0x3fcb96];return _0x46fa7;};'use strict';var _=require(_0xfced('0x0'));var util=require(_0xfced('0x1'));var moment=require(_0xfced('0x2'));var BPromise=require(_0xfced('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfced('0x4'));var db=require(_0xfced('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfced('0x6'));var config=require('../../config/environment');var jayson=require(_0xfced('0x7'));var client=jayson['client'][_0xfced('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x571725,_0x2cc4d1,_0x5bd518){return new BPromise(function(_0x5c6588,_0x27a65b){return client[_0xfced('0x9')](_0x571725,_0x5bd518)[_0xfced('0xa')](function(_0x1479e5){logger['info'](_0xfced('0xb'),_0x2cc4d1,_0xfced('0xc'));logger[_0xfced('0xd')](_0xfced('0xe'),_0x2cc4d1,_0xfced('0xc'),JSON[_0xfced('0xf')](_0x1479e5));if(_0x1479e5[_0xfced('0x10')]){if(_0x1479e5[_0xfced('0x10')][_0xfced('0x11')]===0x1f4){logger['error'](_0xfced('0xb'),_0x2cc4d1,_0x1479e5['error'][_0xfced('0x12')]);return _0x27a65b(_0x1479e5[_0xfced('0x10')][_0xfced('0x12')]);}logger[_0xfced('0x10')]('MemberReport,\x20%s,\x20%s',_0x2cc4d1,_0x1479e5[_0xfced('0x10')][_0xfced('0x12')]);return _0x5c6588(_0x1479e5[_0xfced('0x10')][_0xfced('0x12')]);}else{logger[_0xfced('0x13')](_0xfced('0xb'),_0x2cc4d1,_0xfced('0xc'));_0x5c6588(_0x1479e5[_0xfced('0x14')]['message']);}})[_0xfced('0x15')](function(_0x5f1ac5){logger[_0xfced('0x10')](_0xfced('0xb'),_0x2cc4d1,_0x5f1ac5);_0x27a65b(_0x5f1ac5);});});}exports[_0xfced('0x16')]=function(_0x2d00dc){var _0x38528a=this;return new Promise(function(_0x27e988,_0x3dc86c){return db[_0xfced('0x17')][_0xfced('0x18')]({'raw':_0x2d00dc[_0xfced('0x19')]?_0x2d00dc['options'][_0xfced('0x1a')]===undefined?!![]:![]:!![],'where':_0x2d00dc[_0xfced('0x19')]?_0x2d00dc[_0xfced('0x19')][_0xfced('0x1b')]||null:null,'attributes':_0x2d00dc[_0xfced('0x19')]?_0x2d00dc['options']['attributes']||null:null,'limit':_0x2d00dc[_0xfced('0x19')]?_0x2d00dc[_0xfced('0x19')]['limit']||null:null,'include':_0x2d00dc[_0xfced('0x19')]?_0x2d00dc[_0xfced('0x19')][_0xfced('0x1c')]?_[_0xfced('0x1d')](_0x2d00dc[_0xfced('0x19')][_0xfced('0x1c')],function(_0x4b3547){return{'model':db[_0x4b3547[_0xfced('0x1e')]],'as':_0x4b3547['as'],'attributes':_0x4b3547[_0xfced('0x1f')],'include':_0x4b3547[_0xfced('0x1c')]?_[_0xfced('0x1d')](_0x4b3547[_0xfced('0x1c')],function(_0x56a26e){return{'model':db[_0x56a26e['model']],'as':_0x56a26e['as'],'attributes':_0x56a26e[_0xfced('0x1f')],'include':_0x56a26e[_0xfced('0x1c')]?_[_0xfced('0x1d')](_0x56a26e[_0xfced('0x1c')],function(_0x4d67bf){return{'model':db[_0x4d67bf[_0xfced('0x1e')]],'as':_0x4d67bf['as'],'attributes':_0x4d67bf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x328cf1){logger[_0xfced('0x13')]('GetMemberReport',_0x2d00dc);logger[_0xfced('0xd')]('GetMemberReport',_0x2d00dc,JSON[_0xfced('0xf')](_0x328cf1));_0x27e988(_0x328cf1);})[_0xfced('0x15')](function(_0x419875){logger[_0xfced('0x10')]('GetMemberReport',_0x419875[_0xfced('0x12')],_0x2d00dc);_0x3dc86c(_0x38528a[_0xfced('0x10')](0x1f4,_0x419875[_0xfced('0x12')]));});});};exports[_0xfced('0x20')]=function(_0x54faca){var _0x1fab8d=this;return new Promise(function(_0x2691b4,_0x221dc9){return db['MemberReport'][_0xfced('0x21')](_0x54faca[_0xfced('0x22')],{'raw':_0x54faca[_0xfced('0x19')]?_0x54faca[_0xfced('0x19')][_0xfced('0x1a')]===undefined?!![]:![]:!![]})[_0xfced('0xa')](function(_0x249692){logger[_0xfced('0x13')](_0xfced('0x20'),_0x54faca);logger[_0xfced('0xd')](_0xfced('0x20'),_0x54faca,JSON[_0xfced('0xf')](_0x249692));_0x2691b4(_0x249692);})[_0xfced('0x15')](function(_0x54b077){logger['error']('CreateMemberReport',_0x54b077[_0xfced('0x12')],_0x54faca);_0x221dc9(_0x1fab8d[_0xfced('0x10')](0x1f4,_0x54b077[_0xfced('0x12')]));});});};exports[_0xfced('0x23')]=function(_0xe017fd){var _0x5bba5c=this;return new Promise(function(_0x173c1f,_0x3c1131){return db[_0xfced('0x17')][_0xfced('0x24')](_0xe017fd[_0xfced('0x22')],{'raw':_0xe017fd['options']?_0xe017fd['options'][_0xfced('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe017fd['options']?_0xe017fd[_0xfced('0x19')][_0xfced('0x1b')]||null:null,'attributes':_0xe017fd['options']?_0xe017fd[_0xfced('0x19')]['attributes']||null:null,'limit':_0xe017fd[_0xfced('0x19')]?_0xe017fd[_0xfced('0x19')][_0xfced('0x25')]||null:null})[_0xfced('0xa')](function(_0x22e449){logger[_0xfced('0x13')](_0xfced('0x23'),_0xe017fd);logger[_0xfced('0xd')](_0xfced('0x23'),_0xe017fd,JSON['stringify'](_0x22e449));_0x173c1f(_0x22e449);})[_0xfced('0x15')](function(_0x10276a){logger[_0xfced('0x10')](_0xfced('0x23'),_0x10276a[_0xfced('0x12')],_0xe017fd);_0x3c1131(_0x5bba5c[_0xfced('0x10')](0x1f4,_0x10276a[_0xfced('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 6f10dca..1bb1174 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 _0x3d9f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','exports'];(function(_0x589c2b,_0x49973b){var _0x4b468e=function(_0x5ed116){while(--_0x5ed116){_0x589c2b['push'](_0x589c2b['shift']());}};_0x4b468e(++_0x49973b);}(_0x3d9f,0xd2));var _0xf3d9=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x3d9f[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0xf3d9('0x0'));var util=require(_0xf3d9('0x1'));var path=require(_0xf3d9('0x2'));var timeout=require(_0xf3d9('0x3'));var express=require(_0xf3d9('0x4'));var router=express[_0xf3d9('0x5')]();var fs_extra=require(_0xf3d9('0x6'));var auth=require(_0xf3d9('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./migration.controller');router[_0xf3d9('0x8')]('/',controller['index']);module[_0xf3d9('0x9')]=router; \ No newline at end of file +var _0x0212=['../../components/interaction/service','./migration.controller','get','index','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x270da4,_0x1c3fd8){var _0x275407=function(_0x389e55){while(--_0x389e55){_0x270da4['push'](_0x270da4['shift']());}};_0x275407(++_0x1c3fd8);}(_0x0212,0x170));var _0x2021=function(_0x527d94,_0x50e1c9){_0x527d94=_0x527d94-0x0;var _0x1dac80=_0x0212[_0x527d94];return _0x1dac80;};'use strict';var multer=require(_0x2021('0x0'));var util=require('util');var path=require(_0x2021('0x1'));var timeout=require(_0x2021('0x2'));var express=require('express');var router=express[_0x2021('0x3')]();var fs_extra=require(_0x2021('0x4'));var auth=require(_0x2021('0x5'));var interaction=require(_0x2021('0x6'));var config=require('../../config/environment');var controller=require(_0x2021('0x7'));router[_0x2021('0x8')]('/',controller[_0x2021('0x9')]);module[_0x2021('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 4b7462c..ac3ce38 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 _0xe4a6=['STRING'];(function(_0x43de0f,_0x5bb4a0){var _0x1e6a41=function(_0x5b8ef9){while(--_0x5b8ef9){_0x43de0f['push'](_0x43de0f['shift']());}};_0x1e6a41(++_0x5bb4a0);}(_0xe4a6,0xea));var _0x6e4a=function(_0x3e91a6,_0x3339e8){_0x3e91a6=_0x3e91a6-0x0;var _0x2e6f31=_0xe4a6[_0x3e91a6];return _0x2e6f31;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0x6e4a('0x0')],'unique':'version'}}; \ No newline at end of file +var _0x4da6=['STRING','version'];(function(_0x11f6fe,_0x3535eb){var _0x58f3b2=function(_0x9ecda7){while(--_0x9ecda7){_0x11f6fe['push'](_0x11f6fe['shift']());}};_0x58f3b2(++_0x3535eb);}(_0x4da6,0x116));var _0x64da=function(_0x3fe0aa,_0x2b9090){_0x3fe0aa=_0x3fe0aa-0x0;var _0x2298a2=_0x4da6[_0x3fe0aa];return _0x2298a2;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0x64da('0x0')],'unique':_0x64da('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 82f5fb9..dcb6948 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 _0x183e=['json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','Migration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','then','includeAll','findAll','rows','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x183e,0x17e));var _0xe183=function(_0x1e1405,_0x57c192){_0x1e1405=_0x1e1405-0x0;var _0x30444d=_0x183e[_0x1e1405];return _0x30444d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe183('0x0'));var jsonpatch=require(_0xe183('0x1'));var rp=require(_0xe183('0x2'));var moment=require(_0xe183('0x3'));var BPromise=require(_0xe183('0x4'));var Mustache=require(_0xe183('0x5'));var util=require(_0xe183('0x6'));var path=require('path');var sox=require(_0xe183('0x7'));var csv=require(_0xe183('0x8'));var ejs=require(_0xe183('0x9'));var fs=require('fs');var fs_extra=require(_0xe183('0xa'));var _=require(_0xe183('0xb'));var squel=require(_0xe183('0xc'));var crypto=require(_0xe183('0xd'));var jsforce=require(_0xe183('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe183('0x8'));var querystring=require(_0xe183('0xf'));var Papa=require(_0xe183('0x10'));var Redis=require('ioredis');var authService=require(_0xe183('0x11'));var qs=require(_0xe183('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe183('0x13'))(_0xe183('0x14'));var utils=require('../../config/utils');var config=require(_0xe183('0x15'));var licenseUtil=require(_0xe183('0x16'));var db=require(_0xe183('0x17'))['db'];function respondWithStatusCode(_0x5b1234,_0x199e3d){_0x199e3d=_0x199e3d||0xcc;return function(_0x1ebcfc){if(_0x1ebcfc){return _0x5b1234[_0xe183('0x18')](_0x199e3d);}return _0x5b1234['status'](_0x199e3d)['end']();};}function respondWithResult(_0xfee42b,_0x591f5d){_0x591f5d=_0x591f5d||0xc8;return function(_0x5f0ec9){if(_0x5f0ec9){return _0xfee42b[_0xe183('0x19')](_0x591f5d)[_0xe183('0x1a')](_0x5f0ec9);}};}function respondWithFilteredResult(_0x56bc06,_0x41a2f5){return function(_0xb906d2){if(_0xb906d2){var _0x431271=typeof _0x41a2f5['offset']===_0xe183('0x1b')&&typeof _0x41a2f5[_0xe183('0x1c')]===_0xe183('0x1b');var _0x28e0b9=_0xb906d2[_0xe183('0x1d')];var _0x1e3904=_0x431271?0x0:_0x41a2f5['offset'];var _0x22f1da=_0x431271?_0xb906d2[_0xe183('0x1d')]:_0x41a2f5[_0xe183('0x1e')]+_0x41a2f5[_0xe183('0x1c')];var _0x521cbe;if(_0x22f1da>=_0x28e0b9){_0x22f1da=_0x28e0b9;_0x521cbe=0xc8;}else{_0x521cbe=0xce;}_0x56bc06[_0xe183('0x19')](_0x521cbe);return _0x56bc06['set'](_0xe183('0x1f'),_0x1e3904+'-'+_0x22f1da+'/'+_0x28e0b9)[_0xe183('0x1a')](_0xb906d2);}return null;};}function patchUpdates(_0xbedcf2){return function(_0x17658e){try{jsonpatch[_0xe183('0x20')](_0x17658e,_0xbedcf2,!![]);}catch(_0x3d35bf){return BPromise[_0xe183('0x21')](_0x3d35bf);}return _0x17658e[_0xe183('0x22')]();};}function saveUpdates(_0x102625,_0x1923c0){return function(_0x210534){if(_0x210534){return _0x210534[_0xe183('0x23')](_0x102625)['then'](function(_0x5b6c81){return _0x5b6c81;});}return null;};}function removeEntity(_0x22515c,_0x5e2fd9){return function(_0x3694a9){if(_0x3694a9){return _0x3694a9[_0xe183('0x24')]()['then'](function(){_0x22515c[_0xe183('0x19')](0xcc)[_0xe183('0x25')]();});}};}function handleEntityNotFound(_0x40daf1,_0x28f7d6){return function(_0x517c5a){if(!_0x517c5a){_0x40daf1[_0xe183('0x18')](0x194);}return _0x517c5a;};}function handleError(_0x385173,_0x42c64d){_0x42c64d=_0x42c64d||0x1f4;return function(_0x2230ab){logger['error'](_0x2230ab[_0xe183('0x26')]);if(_0x2230ab['name']){delete _0x2230ab[_0xe183('0x27')];}_0x385173[_0xe183('0x19')](_0x42c64d)[_0xe183('0x28')](_0x2230ab);};}exports['index']=function(_0x42b3ae,_0x305fba){var _0x14a819={},_0x31010b={},_0x5a0f1e={'count':0x0,'rows':[]};var _0x3d7c99=_['map'](db[_0xe183('0x29')][_0xe183('0x2a')],function(_0x10b1c7){return{'name':_0x10b1c7[_0xe183('0x2b')],'type':_0x10b1c7['type'][_0xe183('0x2c')]};});_0x31010b[_0xe183('0x2d')]=_['map'](_0x3d7c99,_0xe183('0x27'));_0x31010b[_0xe183('0x2e')]=_[_0xe183('0x2f')](_0x42b3ae[_0xe183('0x2e')]);_0x31010b[_0xe183('0x30')]=_['intersection'](_0x31010b[_0xe183('0x2d')],_0x31010b[_0xe183('0x2e')]);_0x14a819[_0xe183('0x31')]=_[_0xe183('0x32')](_0x31010b[_0xe183('0x2d')],qs[_0xe183('0x33')](_0x42b3ae[_0xe183('0x2e')][_0xe183('0x33')]));_0x14a819[_0xe183('0x31')]=_0x14a819[_0xe183('0x31')][_0xe183('0x34')]?_0x14a819[_0xe183('0x31')]:_0x31010b[_0xe183('0x2d')];if(!_0x42b3ae[_0xe183('0x2e')][_0xe183('0x35')](_0xe183('0x36'))){_0x14a819['limit']=qs[_0xe183('0x1c')](_0x42b3ae[_0xe183('0x2e')][_0xe183('0x1c')]);_0x14a819[_0xe183('0x1e')]=qs[_0xe183('0x1e')](_0x42b3ae[_0xe183('0x2e')]['offset']);}_0x14a819[_0xe183('0x37')]=qs[_0xe183('0x38')](_0x42b3ae[_0xe183('0x2e')][_0xe183('0x38')]);_0x14a819['where']=qs[_0xe183('0x30')](_[_0xe183('0x39')](_0x42b3ae[_0xe183('0x2e')],_0x31010b[_0xe183('0x30')]),_0x3d7c99);if(_0x42b3ae[_0xe183('0x2e')][_0xe183('0x3a')]){_0x14a819['where']=_[_0xe183('0x3b')](_0x14a819[_0xe183('0x3c')],{'$or':_['map'](_0x3d7c99,function(_0x5663cd){if(_0x5663cd[_0xe183('0x3d')]!=='VIRTUAL'){var _0x115de8={};_0x115de8[_0x5663cd[_0xe183('0x27')]]={'$like':'%'+_0x42b3ae[_0xe183('0x2e')][_0xe183('0x3a')]+'%'};return _0x115de8;}})});}_0x14a819=_[_0xe183('0x3b')]({},_0x14a819,_0x42b3ae[_0xe183('0x3e')]);var _0x538bc9={'where':_0x14a819['where']};return db[_0xe183('0x29')][_0xe183('0x1d')](_0x538bc9)[_0xe183('0x3f')](function(_0xaf012c){_0x5a0f1e[_0xe183('0x1d')]=_0xaf012c;if(_0x42b3ae[_0xe183('0x2e')][_0xe183('0x40')]){_0x14a819['include']=[{'all':!![]}];}return db[_0xe183('0x29')][_0xe183('0x41')](_0x14a819);})['then'](function(_0x378c1a){_0x5a0f1e[_0xe183('0x42')]=_0x378c1a;return _0x5a0f1e;})[_0xe183('0x3f')](respondWithFilteredResult(_0x305fba,_0x14a819))[_0xe183('0x43')](handleError(_0x305fba,null));}; \ No newline at end of file +var _0x5393=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','Migration','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment'];(function(_0x52ece1,_0x425dc5){var _0x329205=function(_0xf76c47){while(--_0xf76c47){_0x52ece1['push'](_0x52ece1['shift']());}};_0x329205(++_0x425dc5);}(_0x5393,0x1ea));var _0x3539=function(_0x545800,_0x92f75){_0x545800=_0x545800-0x0;var _0x2e1b8b=_0x5393[_0x545800];return _0x2e1b8b;};'use strict';var emlformat=require(_0x3539('0x0'));var rimraf=require(_0x3539('0x1'));var zipdir=require(_0x3539('0x2'));var jsonpatch=require(_0x3539('0x3'));var rp=require(_0x3539('0x4'));var moment=require(_0x3539('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3539('0x6'));var util=require(_0x3539('0x7'));var path=require(_0x3539('0x8'));var sox=require(_0x3539('0x9'));var csv=require(_0x3539('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3539('0xb'));var _=require(_0x3539('0xc'));var squel=require(_0x3539('0xd'));var crypto=require(_0x3539('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3539('0xf'));var toCsv=require(_0x3539('0xa'));var querystring=require('querystring');var Papa=require(_0x3539('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3539('0x11'));var as=require(_0x3539('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3539('0x13'));var utils=require(_0x3539('0x14'));var config=require(_0x3539('0x15'));var licenseUtil=require(_0x3539('0x16'));var db=require(_0x3539('0x17'))['db'];function respondWithStatusCode(_0x371bb1,_0x51eac7){_0x51eac7=_0x51eac7||0xcc;return function(_0x291702){if(_0x291702){return _0x371bb1[_0x3539('0x18')](_0x51eac7);}return _0x371bb1[_0x3539('0x19')](_0x51eac7)[_0x3539('0x1a')]();};}function respondWithResult(_0x55369e,_0x529a6c){_0x529a6c=_0x529a6c||0xc8;return function(_0x114819){if(_0x114819){return _0x55369e[_0x3539('0x19')](_0x529a6c)[_0x3539('0x1b')](_0x114819);}};}function respondWithFilteredResult(_0xed207c,_0x3079bd){return function(_0x1f7f25){if(_0x1f7f25){var _0x13dbe0=typeof _0x3079bd[_0x3539('0x1c')]==='undefined'&&typeof _0x3079bd[_0x3539('0x1d')]===_0x3539('0x1e');var _0x29078f=_0x1f7f25[_0x3539('0x1f')];var _0x2f96e9=_0x13dbe0?0x0:_0x3079bd['offset'];var _0x5c38ba=_0x13dbe0?_0x1f7f25[_0x3539('0x1f')]:_0x3079bd['offset']+_0x3079bd[_0x3539('0x1d')];var _0x4c4cf2;if(_0x5c38ba>=_0x29078f){_0x5c38ba=_0x29078f;_0x4c4cf2=0xc8;}else{_0x4c4cf2=0xce;}_0xed207c[_0x3539('0x19')](_0x4c4cf2);return _0xed207c[_0x3539('0x20')]('Content-Range',_0x2f96e9+'-'+_0x5c38ba+'/'+_0x29078f)[_0x3539('0x1b')](_0x1f7f25);}return null;};}function patchUpdates(_0x24f3f8){return function(_0x314d90){try{jsonpatch[_0x3539('0x21')](_0x314d90,_0x24f3f8,!![]);}catch(_0x5e5e7d){return BPromise[_0x3539('0x22')](_0x5e5e7d);}return _0x314d90['save']();};}function saveUpdates(_0x480d5b,_0x29ba56){return function(_0x1b33c2){if(_0x1b33c2){return _0x1b33c2[_0x3539('0x23')](_0x480d5b)[_0x3539('0x24')](function(_0x429fd3){return _0x429fd3;});}return null;};}function removeEntity(_0x4caa15,_0x2d5df6){return function(_0x3f65cd){if(_0x3f65cd){return _0x3f65cd['destroy']()[_0x3539('0x24')](function(){_0x4caa15[_0x3539('0x19')](0xcc)[_0x3539('0x1a')]();});}};}function handleEntityNotFound(_0x412645,_0x448ded){return function(_0x51d822){if(!_0x51d822){_0x412645[_0x3539('0x18')](0x194);}return _0x51d822;};}function handleError(_0x1f3f8b,_0x104635){_0x104635=_0x104635||0x1f4;return function(_0x298096){logger['error'](_0x298096['stack']);if(_0x298096['name']){delete _0x298096['name'];}_0x1f3f8b[_0x3539('0x19')](_0x104635)['send'](_0x298096);};}exports['index']=function(_0x278c45,_0x4ba593){var _0x563ed0={},_0x95e915={},_0x3ebd50={'count':0x0,'rows':[]};var _0x3b22e5=_['map'](db[_0x3539('0x25')][_0x3539('0x26')],function(_0x5a8497){return{'name':_0x5a8497[_0x3539('0x27')],'type':_0x5a8497[_0x3539('0x28')]['key']};});_0x95e915['model']=_['map'](_0x3b22e5,_0x3539('0x29'));_0x95e915[_0x3539('0x2a')]=_[_0x3539('0x2b')](_0x278c45[_0x3539('0x2a')]);_0x95e915[_0x3539('0x2c')]=_[_0x3539('0x2d')](_0x95e915['model'],_0x95e915[_0x3539('0x2a')]);_0x563ed0['attributes']=_[_0x3539('0x2d')](_0x95e915[_0x3539('0x2e')],qs[_0x3539('0x2f')](_0x278c45[_0x3539('0x2a')][_0x3539('0x2f')]));_0x563ed0[_0x3539('0x30')]=_0x563ed0[_0x3539('0x30')][_0x3539('0x31')]?_0x563ed0['attributes']:_0x95e915[_0x3539('0x2e')];if(!_0x278c45[_0x3539('0x2a')][_0x3539('0x32')](_0x3539('0x33'))){_0x563ed0[_0x3539('0x1d')]=qs[_0x3539('0x1d')](_0x278c45[_0x3539('0x2a')]['limit']);_0x563ed0[_0x3539('0x1c')]=qs[_0x3539('0x1c')](_0x278c45[_0x3539('0x2a')][_0x3539('0x1c')]);}_0x563ed0[_0x3539('0x34')]=qs[_0x3539('0x35')](_0x278c45['query'][_0x3539('0x35')]);_0x563ed0[_0x3539('0x36')]=qs[_0x3539('0x2c')](_[_0x3539('0x37')](_0x278c45[_0x3539('0x2a')],_0x95e915[_0x3539('0x2c')]),_0x3b22e5);if(_0x278c45['query'][_0x3539('0x38')]){_0x563ed0[_0x3539('0x36')]=_[_0x3539('0x39')](_0x563ed0[_0x3539('0x36')],{'$or':_[_0x3539('0x3a')](_0x3b22e5,function(_0x3cbd55){if(_0x3cbd55[_0x3539('0x28')]!==_0x3539('0x3b')){var _0x13c862={};_0x13c862[_0x3cbd55[_0x3539('0x29')]]={'$like':'%'+_0x278c45[_0x3539('0x2a')]['filter']+'%'};return _0x13c862;}})});}_0x563ed0=_[_0x3539('0x39')]({},_0x563ed0,_0x278c45[_0x3539('0x3c')]);var _0x179134={'where':_0x563ed0[_0x3539('0x36')]};return db[_0x3539('0x25')][_0x3539('0x1f')](_0x179134)['then'](function(_0x45932c){_0x3ebd50[_0x3539('0x1f')]=_0x45932c;if(_0x278c45[_0x3539('0x2a')][_0x3539('0x3d')]){_0x563ed0[_0x3539('0x3e')]=[{'all':!![]}];}return db[_0x3539('0x25')]['findAll'](_0x563ed0);})[_0x3539('0x24')](function(_0x55d262){_0x3ebd50['rows']=_0x55d262;return _0x3ebd50;})[_0x3539('0x24')](respondWithFilteredResult(_0x4ba593,_0x563ed0))[_0x3539('0x3f')](handleError(_0x4ba593,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 045fe1e..e8de617 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 _0x6881=['define','Migration','migrations','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x6881,0xdb));var _0x1688=function(_0x542d3c,_0xc17bba){_0x542d3c=_0x542d3c-0x0;var _0x10e12f=_0x6881[_0x542d3c];return _0x10e12f;};'use strict';var _=require('lodash');var util=require(_0x1688('0x0'));var logger=require('../../config/logger')(_0x1688('0x1'));var moment=require('moment');var BPromise=require(_0x1688('0x2'));var rp=require(_0x1688('0x3'));var fs=require('fs');var path=require(_0x1688('0x4'));var rimraf=require(_0x1688('0x5'));var config=require(_0x1688('0x6'));var attributes=require(_0x1688('0x7'));module[_0x1688('0x8')]=function(_0x1e0d62,_0x3d01a4){return _0x1e0d62[_0x1688('0x9')](_0x1688('0xa'),attributes,{'tableName':_0x1688('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb935=['path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x446b13,_0x47e58e){var _0x106fb4=function(_0x1ac362){while(--_0x1ac362){_0x446b13['push'](_0x446b13['shift']());}};_0x106fb4(++_0x47e58e);}(_0xb935,0x19b));var _0x5b93=function(_0x578cbb,_0x1cca1d){_0x578cbb=_0x578cbb-0x0;var _0x5e6ff3=_0xb935[_0x578cbb];return _0x5e6ff3;};'use strict';var _=require(_0x5b93('0x0'));var util=require(_0x5b93('0x1'));var logger=require(_0x5b93('0x2'))('api');var moment=require(_0x5b93('0x3'));var BPromise=require(_0x5b93('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b93('0x5'));var rimraf=require(_0x5b93('0x6'));var config=require(_0x5b93('0x7'));var attributes=require(_0x5b93('0x8'));module[_0x5b93('0x9')]=function(_0x2667ef,_0xf08bd6){return _0x2667ef[_0x5b93('0xa')](_0x5b93('0xb'),attributes,{'tableName':_0x5b93('0xc'),'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 2b2057d..21459d5 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 _0x0e35=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1d8b87,_0x32b7ac){var _0xb86d0a=function(_0x312973){while(--_0x312973){_0x1d8b87['push'](_0x1d8b87['shift']());}};_0xb86d0a(++_0x32b7ac);}(_0x0e35,0xc2));var _0x50e3=function(_0x4e812f,_0xb783d0){_0x4e812f=_0x4e812f-0x0;var _0x57388c=_0x0e35[_0x4e812f];return _0x57388c;};'use strict';var _=require(_0x50e3('0x0'));var util=require(_0x50e3('0x1'));var moment=require(_0x50e3('0x2'));var BPromise=require(_0x50e3('0x3'));var rs=require(_0x50e3('0x4'));var fs=require('fs');var Redis=require(_0x50e3('0x5'));var db=require(_0x50e3('0x6'))['db'];var utils=require(_0x50e3('0x7'));var logger=require(_0x50e3('0x8'))(_0x50e3('0x9'));var config=require('../../config/environment');var jayson=require(_0x50e3('0xa'));var client=jayson[_0x50e3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5defe6,_0x2ac084,_0x1ed6ec){return new BPromise(function(_0x57bb5f,_0x48382f){return client[_0x50e3('0xc')](_0x5defe6,_0x1ed6ec)[_0x50e3('0xd')](function(_0x3e0a06){logger[_0x50e3('0xe')](_0x50e3('0xf'),_0x2ac084,_0x50e3('0x10'));logger[_0x50e3('0x11')](_0x50e3('0x12'),_0x2ac084,_0x50e3('0x10'),JSON[_0x50e3('0x13')](_0x3e0a06));if(_0x3e0a06[_0x50e3('0x14')]){if(_0x3e0a06[_0x50e3('0x14')][_0x50e3('0x15')]===0x1f4){logger['error'](_0x50e3('0xf'),_0x2ac084,_0x3e0a06[_0x50e3('0x14')][_0x50e3('0x16')]);return _0x48382f(_0x3e0a06[_0x50e3('0x14')]['message']);}logger[_0x50e3('0x14')](_0x50e3('0xf'),_0x2ac084,_0x3e0a06['error'][_0x50e3('0x16')]);return _0x57bb5f(_0x3e0a06[_0x50e3('0x14')][_0x50e3('0x16')]);}else{logger[_0x50e3('0xe')](_0x50e3('0xf'),_0x2ac084,'request\x20sent');_0x57bb5f(_0x3e0a06[_0x50e3('0x17')]['message']);}})[_0x50e3('0x18')](function(_0x1bf9df){logger[_0x50e3('0x14')]('Migration,\x20%s,\x20%s',_0x2ac084,_0x1bf9df);_0x48382f(_0x1bf9df);});});} \ No newline at end of file +var _0xc298=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4447d2,_0x84265d){var _0x2417cc=function(_0x24da5a){while(--_0x24da5a){_0x4447d2['push'](_0x4447d2['shift']());}};_0x2417cc(++_0x84265d);}(_0xc298,0x143));var _0x8c29=function(_0x3cab1f,_0x2de461){_0x3cab1f=_0x3cab1f-0x0;var _0x2b2b3d=_0xc298[_0x3cab1f];return _0x2b2b3d;};'use strict';var _=require('lodash');var util=require(_0x8c29('0x0'));var moment=require(_0x8c29('0x1'));var BPromise=require(_0x8c29('0x2'));var rs=require(_0x8c29('0x3'));var fs=require('fs');var Redis=require(_0x8c29('0x4'));var db=require(_0x8c29('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c29('0x6'))(_0x8c29('0x7'));var config=require(_0x8c29('0x8'));var jayson=require(_0x8c29('0x9'));var client=jayson[_0x8c29('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1acce8,_0x254d3b,_0x366325){return new BPromise(function(_0xef6e28,_0x29e9e0){return client[_0x8c29('0xb')](_0x1acce8,_0x366325)['then'](function(_0x47bae9){logger['info'](_0x8c29('0xc'),_0x254d3b,_0x8c29('0xd'));logger[_0x8c29('0xe')](_0x8c29('0xf'),_0x254d3b,_0x8c29('0xd'),JSON[_0x8c29('0x10')](_0x47bae9));if(_0x47bae9[_0x8c29('0x11')]){if(_0x47bae9[_0x8c29('0x11')][_0x8c29('0x12')]===0x1f4){logger[_0x8c29('0x11')](_0x8c29('0xc'),_0x254d3b,_0x47bae9[_0x8c29('0x11')][_0x8c29('0x13')]);return _0x29e9e0(_0x47bae9[_0x8c29('0x11')][_0x8c29('0x13')]);}logger[_0x8c29('0x11')]('Migration,\x20%s,\x20%s',_0x254d3b,_0x47bae9[_0x8c29('0x11')][_0x8c29('0x13')]);return _0xef6e28(_0x47bae9['error']['message']);}else{logger[_0x8c29('0x14')](_0x8c29('0xc'),_0x254d3b,'request\x20sent');_0xef6e28(_0x47bae9[_0x8c29('0x15')][_0x8c29('0x13')]);}})[_0x8c29('0x16')](function(_0x5588a8){logger[_0x8c29('0x11')](_0x8c29('0xc'),_0x254d3b,_0x5588a8);_0x29e9e0(_0x5588a8);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 90a3e4e..4fabba5 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 _0xb43c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','show','create','update','delete','multer','util','path','connect-timeout'];(function(_0x188476,_0x54b2e8){var _0x504963=function(_0x43ac90){while(--_0x43ac90){_0x188476['push'](_0x188476['shift']());}};_0x504963(++_0x54b2e8);}(_0xb43c,0x1ea));var _0xcb43=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb43c[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xcb43('0x0'));var util=require(_0xcb43('0x1'));var path=require(_0xcb43('0x2'));var timeout=require(_0xcb43('0x3'));var express=require(_0xcb43('0x4'));var router=express[_0xcb43('0x5')]();var fs_extra=require(_0xcb43('0x6'));var auth=require(_0xcb43('0x7'));var interaction=require(_0xcb43('0x8'));var config=require(_0xcb43('0x9'));var controller=require(_0xcb43('0xa'));router[_0xcb43('0xb')]('/',auth['isAuthenticated'](),controller[_0xcb43('0xc')]);router[_0xcb43('0xb')](_0xcb43('0xd'),auth[_0xcb43('0xe')](),controller[_0xcb43('0xf')]);router['post']('/',auth[_0xcb43('0xe')](),controller[_0xcb43('0x10')]);router['put']('/:id',auth[_0xcb43('0xe')](),controller[_0xcb43('0x11')]);router[_0xcb43('0x12')](_0xcb43('0xd'),auth[_0xcb43('0xe')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1623=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./network.controller','isAuthenticated','index','/:id','show','post','create','put','delete','destroy'];(function(_0x322522,_0x4db288){var _0x293bcf=function(_0xf108b8){while(--_0xf108b8){_0x322522['push'](_0x322522['shift']());}};_0x293bcf(++_0x4db288);}(_0x1623,0xab));var _0x3162=function(_0x2279b2,_0x3af8b7){_0x2279b2=_0x2279b2-0x0;var _0x5dcde0=_0x1623[_0x2279b2];return _0x5dcde0;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')]('/',auth[_0x3162('0x7')](),controller[_0x3162('0xc')]);router[_0x3162('0xd')](_0x3162('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x3162('0xe')](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xf')]);module[_0x3162('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index c010898..c343a15 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 _0xc67b=['ENUM','externip','stun','turn','STRING','sequelize','exports'];(function(_0x6da129,_0x40948d){var _0x1349d6=function(_0x3b1bc){while(--_0x3b1bc){_0x6da129['push'](_0x6da129['shift']());}};_0x1349d6(++_0x40948d);}(_0xc67b,0x124));var _0xbc67=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xc67b[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0xbc67('0x0'));module[_0xbc67('0x1')]={'type':{'type':Sequelize[_0xbc67('0x2')]('localnet',_0xbc67('0x3'),_0xbc67('0x4'),_0xbc67('0x5'))},'value':{'type':Sequelize[_0xbc67('0x6')]},'username':{'type':Sequelize[_0xbc67('0x6')]},'password':{'type':Sequelize[_0xbc67('0x6')]}}; \ No newline at end of file +var _0xa5ed=['STRING','sequelize','exports','ENUM','localnet','externip','turn'];(function(_0x46be17,_0x3674a){var _0x178bbf=function(_0x63166e){while(--_0x63166e){_0x46be17['push'](_0x46be17['shift']());}};_0x178bbf(++_0x3674a);}(_0xa5ed,0x166));var _0xda5e=function(_0x47855a,_0xaf1c09){_0x47855a=_0x47855a-0x0;var _0x36af76=_0xa5ed[_0x47855a];return _0x36af76;};'use strict';var Sequelize=require(_0xda5e('0x0'));module[_0xda5e('0x1')]={'type':{'type':Sequelize[_0xda5e('0x2')](_0xda5e('0x3'),_0xda5e('0x4'),'stun',_0xda5e('0x5'))},'value':{'type':Sequelize[_0xda5e('0x6')]},'username':{'type':Sequelize[_0xda5e('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index b608dfe..28a0491 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 _0x9c1d=['send','map','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','Network','includeAll','rows','show','params','rawAttributes','length','find','create','body','toUpperCase','STUN','readFileSync','join','root','utf8','render','writeFileSync','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','findAll','server/files/templates/stun_multiple.ejs','/etc/asterisk/stun_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','destroy','util','path','ejs','../../components/parsers/qs','../../config/logger','api','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','json','offset','undefined','limit','count','set','Content-Range','update','end','sendStatus','stack','name'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x9c1d,0x1e8));var _0xd9c1=function(_0x2dd8c9,_0x59c2d6){_0x2dd8c9=_0x2dd8c9-0x0;var _0xa2a5c7=_0x9c1d[_0x2dd8c9];return _0xa2a5c7;};'use strict';var util=require(_0xd9c1('0x0'));var path=require(_0xd9c1('0x1'));var ejs=require(_0xd9c1('0x2'));var fs=require('fs');var _=require('lodash');var qs=require(_0xd9c1('0x3'));var logger=require(_0xd9c1('0x4'))(_0xd9c1('0x5'));var config=require('../../config/environment');var db=require(_0xd9c1('0x6'))['db'];var jayson=require(_0xd9c1('0x7'));var client=jayson[_0xd9c1('0x8')][_0xd9c1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x545b2d,_0x33daec,_0x8107b3,_0x3d62ed){return new Promise(function(_0x5acd7c,_0x4f891c){var _0x5790bf=_0x3d62ed||client;return _0x5790bf[_0xd9c1('0xa')](_0x545b2d,_0x8107b3)[_0xd9c1('0xb')](function(_0x380d27){logger[_0xd9c1('0xc')](_0xd9c1('0xd'),_0x33daec,_0xd9c1('0xe'));logger['debug'](_0xd9c1('0xf'),_0x33daec,_0xd9c1('0xe'),JSON[_0xd9c1('0x10')](_0x380d27));if(_0x380d27[_0xd9c1('0x11')]){if(_0x380d27['error'][_0xd9c1('0x12')]===0x1f4){logger[_0xd9c1('0x11')](_0xd9c1('0xd'),_0x33daec,_0x380d27['error'][_0xd9c1('0x13')]);return _0x4f891c(_0x380d27[_0xd9c1('0x11')]['message']);}logger['error'](_0xd9c1('0xd'),_0x33daec,_0x380d27['error'][_0xd9c1('0x13')]);return _0x5acd7c(_0x380d27[_0xd9c1('0x11')]['message']);}else{logger[_0xd9c1('0xc')](_0xd9c1('0xd'),_0x33daec,_0xd9c1('0xe'));_0x5acd7c(_0x380d27[_0xd9c1('0x14')][_0xd9c1('0x13')]);}})[_0xd9c1('0x15')](function(_0x5d0740){logger[_0xd9c1('0x11')](_0xd9c1('0xd'),_0x33daec,_0x5d0740);_0x4f891c(_0x5d0740);});});}function respondWithResult(_0x333b8f,_0x3f36fa){_0x3f36fa=_0x3f36fa||0xc8;return function(_0x14d5fc){if(_0x14d5fc){return _0x333b8f['status'](_0x3f36fa)[_0xd9c1('0x16')](_0x14d5fc);}};}function respondWithFilteredResult(_0x243c29,_0x4a5fba){return function(_0xef2c0c){if(_0xef2c0c){var _0x5bda4c=typeof _0x4a5fba[_0xd9c1('0x17')]===_0xd9c1('0x18')&&typeof _0x4a5fba[_0xd9c1('0x19')]===_0xd9c1('0x18');var _0x3be98e=_0xef2c0c[_0xd9c1('0x1a')];var _0x573791=_0x5bda4c?0x0:_0x4a5fba[_0xd9c1('0x17')];var _0x5d057e=_0x5bda4c?_0xef2c0c['count']:_0x4a5fba[_0xd9c1('0x17')]+_0x4a5fba[_0xd9c1('0x19')];var _0x3f8bf7;if(_0x5d057e>=_0x3be98e){_0x5d057e=_0x3be98e;_0x3f8bf7=0xc8;}else{_0x3f8bf7=0xce;}_0x243c29['status'](_0x3f8bf7);return _0x243c29[_0xd9c1('0x1b')](_0xd9c1('0x1c'),_0x573791+'-'+_0x5d057e+'/'+_0x3be98e)[_0xd9c1('0x16')](_0xef2c0c);}return null;};}function saveUpdates(_0x9bcb1b){return function(_0xced11c){if(_0xced11c){return _0xced11c[_0xd9c1('0x1d')](_0x9bcb1b)[_0xd9c1('0xb')](function(_0x3b80e6){return _0x3b80e6;});}return null;};}function removeEntity(_0xad6aeb){return function(_0x12f1a7){if(_0x12f1a7){return _0x12f1a7['destroy']()[_0xd9c1('0xb')](function(){_0xad6aeb['status'](0xcc)[_0xd9c1('0x1e')]();});}};}function handleEntityNotFound(_0x4cc0ef){return function(_0x316d5f){if(!_0x316d5f){_0x4cc0ef[_0xd9c1('0x1f')](0x194);}return _0x316d5f;};}function handleError(_0x340828,_0x22d6cc){_0x22d6cc=_0x22d6cc||0x1f4;return function(_0x5b6c28){logger[_0xd9c1('0x11')](_0x5b6c28[_0xd9c1('0x20')]);if(_0x5b6c28[_0xd9c1('0x21')]){delete _0x5b6c28[_0xd9c1('0x21')];}_0x340828['status'](_0x22d6cc)[_0xd9c1('0x22')](_0x5b6c28);};}exports['index']=function(_0x16c41f,_0x5e394f){var _0x1f2344={},_0x378b37={},_0x22e772={'count':0x0,'rows':[]};var _0x591f8c=_[_0xd9c1('0x23')](db['Network']['rawAttributes'],function(_0x21f292){return{'name':_0x21f292['fieldName'],'type':_0x21f292['type'][_0xd9c1('0x24')]};});_0x378b37[_0xd9c1('0x25')]=_[_0xd9c1('0x23')](_0x591f8c,_0xd9c1('0x21'));_0x378b37[_0xd9c1('0x26')]=_[_0xd9c1('0x27')](_0x16c41f['query']);_0x378b37['filters']=_[_0xd9c1('0x28')](_0x378b37['model'],_0x378b37[_0xd9c1('0x26')]);_0x1f2344[_0xd9c1('0x29')]=_['intersection'](_0x378b37[_0xd9c1('0x25')],qs[_0xd9c1('0x2a')](_0x16c41f['query'][_0xd9c1('0x2a')]));_0x1f2344[_0xd9c1('0x29')]=_0x1f2344[_0xd9c1('0x29')]['length']?_0x1f2344[_0xd9c1('0x29')]:_0x378b37[_0xd9c1('0x25')];if(!_0x16c41f[_0xd9c1('0x26')][_0xd9c1('0x2b')](_0xd9c1('0x2c'))){_0x1f2344[_0xd9c1('0x19')]=qs[_0xd9c1('0x19')](_0x16c41f[_0xd9c1('0x26')][_0xd9c1('0x19')]);_0x1f2344[_0xd9c1('0x17')]=qs['offset'](_0x16c41f['query'][_0xd9c1('0x17')]);}_0x1f2344[_0xd9c1('0x2d')]=qs[_0xd9c1('0x2e')](_0x16c41f[_0xd9c1('0x26')][_0xd9c1('0x2e')]);_0x1f2344[_0xd9c1('0x2f')]=qs[_0xd9c1('0x30')](_[_0xd9c1('0x31')](_0x16c41f[_0xd9c1('0x26')],_0x378b37[_0xd9c1('0x30')]),_0x591f8c);if(_0x16c41f['query'][_0xd9c1('0x32')]){_0x1f2344[_0xd9c1('0x2f')]=_[_0xd9c1('0x33')](_0x1f2344[_0xd9c1('0x2f')],{'$or':_[_0xd9c1('0x23')](_0x591f8c,function(_0x5ca517){if(_0x5ca517[_0xd9c1('0x34')]!==_0xd9c1('0x35')){var _0x458574={};_0x458574[_0x5ca517['name']]={'$like':'%'+_0x16c41f[_0xd9c1('0x26')][_0xd9c1('0x32')]+'%'};return _0x458574;}})});}_0x1f2344=_[_0xd9c1('0x33')]({},_0x1f2344,_0x16c41f[_0xd9c1('0x36')]);var _0x440c7a={'where':_0x1f2344[_0xd9c1('0x2f')]};return db[_0xd9c1('0x37')][_0xd9c1('0x1a')](_0x440c7a)[_0xd9c1('0xb')](function(_0x25e56c){_0x22e772[_0xd9c1('0x1a')]=_0x25e56c;if(_0x16c41f[_0xd9c1('0x26')][_0xd9c1('0x38')]){_0x1f2344['include']=[{'all':!![]}];}return db[_0xd9c1('0x37')]['findAll'](_0x1f2344);})[_0xd9c1('0xb')](function(_0x28726f){_0x22e772[_0xd9c1('0x39')]=_0x28726f;return _0x22e772;})[_0xd9c1('0xb')](respondWithFilteredResult(_0x5e394f,_0x1f2344))[_0xd9c1('0x15')](handleError(_0x5e394f,null));};exports[_0xd9c1('0x3a')]=function(_0x1b9db4,_0x2f1e47){var _0x2cf340={'raw':!![],'where':{'id':_0x1b9db4[_0xd9c1('0x3b')]['id']}},_0x4b5957={};_0x4b5957[_0xd9c1('0x25')]=_[_0xd9c1('0x27')](db['Network'][_0xd9c1('0x3c')]);_0x4b5957[_0xd9c1('0x26')]=_[_0xd9c1('0x27')](_0x1b9db4[_0xd9c1('0x26')]);_0x4b5957[_0xd9c1('0x30')]=_[_0xd9c1('0x28')](_0x4b5957[_0xd9c1('0x25')],_0x4b5957[_0xd9c1('0x26')]);_0x2cf340[_0xd9c1('0x29')]=_['intersection'](_0x4b5957[_0xd9c1('0x25')],qs['fields'](_0x1b9db4[_0xd9c1('0x26')][_0xd9c1('0x2a')]));_0x2cf340[_0xd9c1('0x29')]=_0x2cf340['attributes'][_0xd9c1('0x3d')]?_0x2cf340[_0xd9c1('0x29')]:_0x4b5957[_0xd9c1('0x25')];if(_0x1b9db4['query'][_0xd9c1('0x38')]){_0x2cf340['include']=[{'all':!![]}];}_0x2cf340=_[_0xd9c1('0x33')]({},_0x2cf340,_0x1b9db4[_0xd9c1('0x36')]);return db[_0xd9c1('0x37')][_0xd9c1('0x3e')](_0x2cf340)[_0xd9c1('0xb')](handleEntityNotFound(_0x2f1e47,null))['then'](respondWithResult(_0x2f1e47,null))[_0xd9c1('0x15')](handleError(_0x2f1e47,null));};exports['create']=function(_0x240034,_0x56c123){var _0x4c1d4c;return db[_0xd9c1('0x37')][_0xd9c1('0x3f')](_0x240034[_0xd9c1('0x40')],{'raw':!![]})[_0xd9c1('0xb')](function(_0x289aef){_0x4c1d4c=_0x289aef;return db[_0xd9c1('0x37')]['findAll']({'where':{'type':_0x240034[_0xd9c1('0x40')][_0xd9c1('0x34')]},'raw':!![]});})['then'](function(_0x62ec9c){if(_0x4c1d4c[_0xd9c1('0x34')][_0xd9c1('0x41')]()==_0xd9c1('0x42')){var _0x45e202=fs[_0xd9c1('0x43')](path[_0xd9c1('0x44')](config[_0xd9c1('0x45')],'server/files/templates/stun_multiple.ejs'),_0xd9c1('0x46'));var _0x3cd4ff=ejs[_0xd9c1('0x47')](_0x45e202,{'networks':_0x62ec9c||[]});fs[_0xd9c1('0x48')]('/etc/asterisk/stun_xcally.conf',_0x3cd4ff);return respondWithRpcPromise(_0xd9c1('0x49'),_0xd9c1('0x3f'),{'module':_0xd9c1('0x4a')});}else if(_0x4c1d4c[_0xd9c1('0x34')][_0xd9c1('0x41')]()==_0xd9c1('0x4b')){var _0x3a0bf4=fs['readFileSync'](path[_0xd9c1('0x44')](config[_0xd9c1('0x45')],_0xd9c1('0x4c')),'utf8');var _0x2535ee=ejs[_0xd9c1('0x47')](_0x3a0bf4,{'networks':_0x62ec9c||[]});fs[_0xd9c1('0x48')](_0xd9c1('0x4d'),_0x2535ee);return respondWithRpcPromise('Reload',_0xd9c1('0x3f'),{'module':_0xd9c1('0x4a')});}else{var _0x259ef9=fs[_0xd9c1('0x43')](path[_0xd9c1('0x44')](config[_0xd9c1('0x45')],_0xd9c1('0x4e')),_0xd9c1('0x46'));var _0x347d47=ejs[_0xd9c1('0x47')](_0x259ef9,{'networks':_0x62ec9c||[]});fs['writeFileSync'](util[_0xd9c1('0x4f')]('/etc/asterisk/sip_xcally_%s.conf',_0x240034['body'][_0xd9c1('0x34')][_0xd9c1('0x50')]()),_0x347d47);return respondWithRpcPromise('Reload',_0xd9c1('0x3f'),{'module':_0xd9c1('0x51')});}})[_0xd9c1('0xb')](function(){return _0x4c1d4c;})[_0xd9c1('0xb')](respondWithResult(_0x56c123,0xc9))[_0xd9c1('0x15')](handleError(_0x56c123,null));};exports[_0xd9c1('0x1d')]=function(_0x1e6170,_0x2f3671){var _0x2ad7bd;return db[_0xd9c1('0x37')][_0xd9c1('0x3e')]({'where':{'id':_0x1e6170['params']['id']}})[_0xd9c1('0xb')](handleEntityNotFound(_0x2f3671,null))[_0xd9c1('0xb')](saveUpdates(_0x1e6170[_0xd9c1('0x40')],null))[_0xd9c1('0xb')](function(_0x3cd19e){if(_0x3cd19e){_0x2ad7bd=_0x3cd19e;return db[_0xd9c1('0x37')][_0xd9c1('0x52')]({'where':{'type':_0x2ad7bd['type']},'raw':!![]});}return null;})['then'](function(_0x2b556b){if(_0x2ad7bd[_0xd9c1('0x34')][_0xd9c1('0x41')]()==_0xd9c1('0x42')){var _0x4ce6c3=fs[_0xd9c1('0x43')](path['join'](config[_0xd9c1('0x45')],_0xd9c1('0x53')),_0xd9c1('0x46'));var _0x283501=ejs[_0xd9c1('0x47')](_0x4ce6c3,{'networks':_0x2b556b||[]});fs['writeFileSync'](_0xd9c1('0x54'),_0x283501);return respondWithRpcPromise('Reload','update',{'module':'res_stun_monitor.so'});}else if(_0x2ad7bd[_0xd9c1('0x34')]['toUpperCase']()==_0xd9c1('0x4b')){var _0x588656=fs[_0xd9c1('0x43')](path['join'](config[_0xd9c1('0x45')],_0xd9c1('0x4c')),'utf8');var _0x2eca54=ejs['render'](_0x588656,{'networks':_0x2b556b||[]});fs[_0xd9c1('0x48')](_0xd9c1('0x4d'),_0x2eca54);return respondWithRpcPromise(_0xd9c1('0x49'),_0xd9c1('0x1d'),{'module':_0xd9c1('0x4a')});}else{var _0xc12f3a=fs['readFileSync'](path[_0xd9c1('0x44')](config[_0xd9c1('0x45')],_0xd9c1('0x4e')),'utf8');var _0xa8f533=ejs[_0xd9c1('0x47')](_0xc12f3a,{'networks':_0x2b556b||[]});fs[_0xd9c1('0x48')](util['format'](_0xd9c1('0x55'),_0x1e6170['body']['type'][_0xd9c1('0x50')]()),_0xa8f533);return respondWithRpcPromise(_0xd9c1('0x49'),'update',{'module':_0xd9c1('0x51')});}})['then'](function(_0x4477ce){if(_0x4477ce){return _0x2ad7bd;}return null;})[_0xd9c1('0xb')](respondWithResult(_0x2f3671,null))[_0xd9c1('0x15')](handleError(_0x2f3671,null));};exports['destroy']=function(_0x44ed12,_0x3879bc){var _0x5271fb;return db[_0xd9c1('0x37')][_0xd9c1('0x3e')]({'where':{'id':_0x44ed12[_0xd9c1('0x3b')]['id']}})[_0xd9c1('0xb')](function(_0x5b5a1e){_0x5271fb=_0x5b5a1e;return _0x5b5a1e;})[_0xd9c1('0xb')](handleEntityNotFound(_0x3879bc,null))['then'](removeEntity(_0x3879bc,null))['then'](function(){if(_0x5271fb){return db[_0xd9c1('0x37')][_0xd9c1('0x52')]({'where':{'type':_0x5271fb[_0xd9c1('0x34')]},'raw':!![]});}})[_0xd9c1('0xb')](function(_0x5a2375){if(_0x5271fb['type']['toUpperCase']()==_0xd9c1('0x42')){var _0xdae6f6=fs[_0xd9c1('0x43')](path[_0xd9c1('0x44')](config[_0xd9c1('0x45')],_0xd9c1('0x53')),_0xd9c1('0x46'));var _0x463a0d=ejs[_0xd9c1('0x47')](_0xdae6f6,{'networks':_0x5a2375||[]});fs[_0xd9c1('0x48')](_0xd9c1('0x54'),_0x463a0d);return respondWithRpcPromise('Reload',_0xd9c1('0x56'),{'module':_0xd9c1('0x4a')});}else if(_0x5271fb['type'][_0xd9c1('0x41')]()==_0xd9c1('0x4b')){var _0x59965a=fs[_0xd9c1('0x43')](path['join'](config[_0xd9c1('0x45')],_0xd9c1('0x4c')),'utf8');var _0x237714=ejs[_0xd9c1('0x47')](_0x59965a,{'networks':_0x5a2375||[]});fs[_0xd9c1('0x48')]('/etc/asterisk/turn_xcally.conf',_0x237714);return respondWithRpcPromise(_0xd9c1('0x49'),_0xd9c1('0x56'),{'module':_0xd9c1('0x4a')});}else{var _0x41ea5c=fs[_0xd9c1('0x43')](path[_0xd9c1('0x44')](config[_0xd9c1('0x45')],'server/files/templates/network.ejs'),_0xd9c1('0x46'));var _0x232af4=ejs[_0xd9c1('0x47')](_0x41ea5c,{'networks':_0x5a2375||[]});fs[_0xd9c1('0x48')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x5271fb[_0xd9c1('0x34')][_0xd9c1('0x50')]()),_0x232af4);return respondWithRpcPromise(_0xd9c1('0x49'),_0xd9c1('0x56'),{'module':'chan_sip.so'});}})[_0xd9c1('0x15')](handleError(_0x3879bc,null));}; \ No newline at end of file +var _0x02ac=['map','Network','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','includeAll','rows','show','params','filters','options','find','create','findAll','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','toLowerCase','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','destroy','util','path','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','update','end','sendStatus','send','index'];(function(_0xc906aa,_0xe924c4){var _0x20e592=function(_0xc02c3a){while(--_0xc02c3a){_0xc906aa['push'](_0xc906aa['shift']());}};_0x20e592(++_0xe924c4);}(_0x02ac,0x183));var _0xc02a=function(_0x43367d,_0x3b769a){_0x43367d=_0x43367d-0x0;var _0x5b44c4=_0x02ac[_0x43367d];return _0x5b44c4;};'use strict';var util=require(_0xc02a('0x0'));var path=require(_0xc02a('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc02a('0x2'));var qs=require(_0xc02a('0x3'));var logger=require(_0xc02a('0x4'))('api');var config=require(_0xc02a('0x5'));var db=require('../../mysqldb')['db'];var jayson=require(_0xc02a('0x6'));var client=jayson[_0xc02a('0x7')][_0xc02a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f38c9,_0x4eda0c,_0x39636b,_0x5563a4){return new Promise(function(_0x151c24,_0x23769d){var _0x1ab894=_0x5563a4||client;return _0x1ab894[_0xc02a('0x9')](_0x1f38c9,_0x39636b)[_0xc02a('0xa')](function(_0x3da849){logger[_0xc02a('0xb')](_0xc02a('0xc'),_0x4eda0c,_0xc02a('0xd'));logger['debug'](_0xc02a('0xe'),_0x4eda0c,_0xc02a('0xd'),JSON['stringify'](_0x3da849));if(_0x3da849[_0xc02a('0xf')]){if(_0x3da849['error'][_0xc02a('0x10')]===0x1f4){logger['error'](_0xc02a('0xc'),_0x4eda0c,_0x3da849[_0xc02a('0xf')][_0xc02a('0x11')]);return _0x23769d(_0x3da849[_0xc02a('0xf')]['message']);}logger[_0xc02a('0xf')](_0xc02a('0xc'),_0x4eda0c,_0x3da849[_0xc02a('0xf')][_0xc02a('0x11')]);return _0x151c24(_0x3da849[_0xc02a('0xf')][_0xc02a('0x11')]);}else{logger[_0xc02a('0xb')](_0xc02a('0xc'),_0x4eda0c,_0xc02a('0xd'));_0x151c24(_0x3da849[_0xc02a('0x12')][_0xc02a('0x11')]);}})[_0xc02a('0x13')](function(_0x53c306){logger[_0xc02a('0xf')]('Network,\x20%s,\x20%s',_0x4eda0c,_0x53c306);_0x23769d(_0x53c306);});});}function respondWithResult(_0x3004ba,_0x34a5f3){_0x34a5f3=_0x34a5f3||0xc8;return function(_0x5109ba){if(_0x5109ba){return _0x3004ba[_0xc02a('0x14')](_0x34a5f3)[_0xc02a('0x15')](_0x5109ba);}};}function respondWithFilteredResult(_0x3dea27,_0x4bdd56){return function(_0x4c9617){if(_0x4c9617){var _0x18722b=typeof _0x4bdd56[_0xc02a('0x16')]===_0xc02a('0x17')&&typeof _0x4bdd56['limit']===_0xc02a('0x17');var _0x3c0b55=_0x4c9617['count'];var _0x232437=_0x18722b?0x0:_0x4bdd56[_0xc02a('0x16')];var _0x18abe6=_0x18722b?_0x4c9617[_0xc02a('0x18')]:_0x4bdd56['offset']+_0x4bdd56[_0xc02a('0x19')];var _0x37bdde;if(_0x18abe6>=_0x3c0b55){_0x18abe6=_0x3c0b55;_0x37bdde=0xc8;}else{_0x37bdde=0xce;}_0x3dea27[_0xc02a('0x14')](_0x37bdde);return _0x3dea27[_0xc02a('0x1a')](_0xc02a('0x1b'),_0x232437+'-'+_0x18abe6+'/'+_0x3c0b55)[_0xc02a('0x15')](_0x4c9617);}return null;};}function saveUpdates(_0x3fa171){return function(_0x1cf800){if(_0x1cf800){return _0x1cf800[_0xc02a('0x1c')](_0x3fa171)['then'](function(_0x3a9cb6){return _0x3a9cb6;});}return null;};}function removeEntity(_0x7c45bb){return function(_0x5dafae){if(_0x5dafae){return _0x5dafae['destroy']()[_0xc02a('0xa')](function(){_0x7c45bb[_0xc02a('0x14')](0xcc)[_0xc02a('0x1d')]();});}};}function handleEntityNotFound(_0x10ee7c){return function(_0xfe2139){if(!_0xfe2139){_0x10ee7c[_0xc02a('0x1e')](0x194);}return _0xfe2139;};}function handleError(_0x46f163,_0x473f8b){_0x473f8b=_0x473f8b||0x1f4;return function(_0x32f15d){logger[_0xc02a('0xf')](_0x32f15d['stack']);if(_0x32f15d['name']){delete _0x32f15d['name'];}_0x46f163[_0xc02a('0x14')](_0x473f8b)[_0xc02a('0x1f')](_0x32f15d);};}exports[_0xc02a('0x20')]=function(_0x3c2e30,_0x3596c0){var _0x4a7a8b={},_0x12b9ce={},_0x3e49f0={'count':0x0,'rows':[]};var _0x2f2719=_[_0xc02a('0x21')](db[_0xc02a('0x22')][_0xc02a('0x23')],function(_0x5b8824){return{'name':_0x5b8824[_0xc02a('0x24')],'type':_0x5b8824[_0xc02a('0x25')][_0xc02a('0x26')]};});_0x12b9ce[_0xc02a('0x27')]=_[_0xc02a('0x21')](_0x2f2719,'name');_0x12b9ce[_0xc02a('0x28')]=_[_0xc02a('0x29')](_0x3c2e30[_0xc02a('0x28')]);_0x12b9ce['filters']=_[_0xc02a('0x2a')](_0x12b9ce[_0xc02a('0x27')],_0x12b9ce[_0xc02a('0x28')]);_0x4a7a8b['attributes']=_[_0xc02a('0x2a')](_0x12b9ce[_0xc02a('0x27')],qs[_0xc02a('0x2b')](_0x3c2e30[_0xc02a('0x28')][_0xc02a('0x2b')]));_0x4a7a8b['attributes']=_0x4a7a8b['attributes'][_0xc02a('0x2c')]?_0x4a7a8b[_0xc02a('0x2d')]:_0x12b9ce[_0xc02a('0x27')];if(!_0x3c2e30['query'][_0xc02a('0x2e')](_0xc02a('0x2f'))){_0x4a7a8b['limit']=qs[_0xc02a('0x19')](_0x3c2e30[_0xc02a('0x28')][_0xc02a('0x19')]);_0x4a7a8b[_0xc02a('0x16')]=qs[_0xc02a('0x16')](_0x3c2e30[_0xc02a('0x28')][_0xc02a('0x16')]);}_0x4a7a8b[_0xc02a('0x30')]=qs[_0xc02a('0x31')](_0x3c2e30['query'][_0xc02a('0x31')]);_0x4a7a8b['where']=qs['filters'](_['pick'](_0x3c2e30['query'],_0x12b9ce['filters']),_0x2f2719);if(_0x3c2e30['query'][_0xc02a('0x32')]){_0x4a7a8b[_0xc02a('0x33')]=_[_0xc02a('0x34')](_0x4a7a8b['where'],{'$or':_[_0xc02a('0x21')](_0x2f2719,function(_0x2950f8){if(_0x2950f8[_0xc02a('0x25')]!=='VIRTUAL'){var _0xa6896d={};_0xa6896d[_0x2950f8['name']]={'$like':'%'+_0x3c2e30['query']['filter']+'%'};return _0xa6896d;}})});}_0x4a7a8b=_[_0xc02a('0x34')]({},_0x4a7a8b,_0x3c2e30['options']);var _0x337cb5={'where':_0x4a7a8b['where']};return db[_0xc02a('0x22')][_0xc02a('0x18')](_0x337cb5)[_0xc02a('0xa')](function(_0x55a0e1){_0x3e49f0[_0xc02a('0x18')]=_0x55a0e1;if(_0x3c2e30['query'][_0xc02a('0x35')]){_0x4a7a8b['include']=[{'all':!![]}];}return db[_0xc02a('0x22')]['findAll'](_0x4a7a8b);})['then'](function(_0x483812){_0x3e49f0[_0xc02a('0x36')]=_0x483812;return _0x3e49f0;})[_0xc02a('0xa')](respondWithFilteredResult(_0x3596c0,_0x4a7a8b))[_0xc02a('0x13')](handleError(_0x3596c0,null));};exports[_0xc02a('0x37')]=function(_0x46dcff,_0x7fcd28){var _0x2cd9c4={'raw':!![],'where':{'id':_0x46dcff[_0xc02a('0x38')]['id']}},_0x40e33b={};_0x40e33b[_0xc02a('0x27')]=_[_0xc02a('0x29')](db[_0xc02a('0x22')][_0xc02a('0x23')]);_0x40e33b[_0xc02a('0x28')]=_[_0xc02a('0x29')](_0x46dcff['query']);_0x40e33b[_0xc02a('0x39')]=_['intersection'](_0x40e33b[_0xc02a('0x27')],_0x40e33b[_0xc02a('0x28')]);_0x2cd9c4[_0xc02a('0x2d')]=_[_0xc02a('0x2a')](_0x40e33b[_0xc02a('0x27')],qs['fields'](_0x46dcff[_0xc02a('0x28')][_0xc02a('0x2b')]));_0x2cd9c4[_0xc02a('0x2d')]=_0x2cd9c4[_0xc02a('0x2d')][_0xc02a('0x2c')]?_0x2cd9c4[_0xc02a('0x2d')]:_0x40e33b[_0xc02a('0x27')];if(_0x46dcff['query'][_0xc02a('0x35')]){_0x2cd9c4['include']=[{'all':!![]}];}_0x2cd9c4=_[_0xc02a('0x34')]({},_0x2cd9c4,_0x46dcff[_0xc02a('0x3a')]);return db[_0xc02a('0x22')][_0xc02a('0x3b')](_0x2cd9c4)[_0xc02a('0xa')](handleEntityNotFound(_0x7fcd28,null))['then'](respondWithResult(_0x7fcd28,null))['catch'](handleError(_0x7fcd28,null));};exports[_0xc02a('0x3c')]=function(_0x19a360,_0x3c1a39){var _0x23d9f3;return db[_0xc02a('0x22')][_0xc02a('0x3c')](_0x19a360['body'],{'raw':!![]})[_0xc02a('0xa')](function(_0x4a1d91){_0x23d9f3=_0x4a1d91;return db[_0xc02a('0x22')][_0xc02a('0x3d')]({'where':{'type':_0x19a360[_0xc02a('0x3e')]['type']},'raw':!![]});})[_0xc02a('0xa')](function(_0x469f41){if(_0x23d9f3[_0xc02a('0x25')][_0xc02a('0x3f')]()==_0xc02a('0x40')){var _0x283f28=fs[_0xc02a('0x41')](path[_0xc02a('0x42')](config[_0xc02a('0x43')],_0xc02a('0x44')),_0xc02a('0x45'));var _0x57dd9b=ejs['render'](_0x283f28,{'networks':_0x469f41||[]});fs[_0xc02a('0x46')](_0xc02a('0x47'),_0x57dd9b);return respondWithRpcPromise(_0xc02a('0x48'),'create',{'module':_0xc02a('0x49')});}else if(_0x23d9f3[_0xc02a('0x25')][_0xc02a('0x3f')]()==_0xc02a('0x4a')){var _0xf4c280=fs[_0xc02a('0x41')](path['join'](config[_0xc02a('0x43')],_0xc02a('0x4b')),_0xc02a('0x45'));var _0x356e06=ejs[_0xc02a('0x4c')](_0xf4c280,{'networks':_0x469f41||[]});fs[_0xc02a('0x46')](_0xc02a('0x4d'),_0x356e06);return respondWithRpcPromise('Reload',_0xc02a('0x3c'),{'module':_0xc02a('0x49')});}else{var _0x3193f5=fs[_0xc02a('0x41')](path[_0xc02a('0x42')](config['root'],_0xc02a('0x4e')),'utf8');var _0x16c17a=ejs[_0xc02a('0x4c')](_0x3193f5,{'networks':_0x469f41||[]});fs[_0xc02a('0x46')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x19a360[_0xc02a('0x3e')][_0xc02a('0x25')][_0xc02a('0x4f')]()),_0x16c17a);return respondWithRpcPromise(_0xc02a('0x48'),_0xc02a('0x3c'),{'module':'chan_sip.so'});}})[_0xc02a('0xa')](function(){return _0x23d9f3;})[_0xc02a('0xa')](respondWithResult(_0x3c1a39,0xc9))[_0xc02a('0x13')](handleError(_0x3c1a39,null));};exports[_0xc02a('0x1c')]=function(_0x43ab0f,_0x639452){var _0x55fa30;return db['Network'][_0xc02a('0x3b')]({'where':{'id':_0x43ab0f[_0xc02a('0x38')]['id']}})[_0xc02a('0xa')](handleEntityNotFound(_0x639452,null))[_0xc02a('0xa')](saveUpdates(_0x43ab0f['body'],null))[_0xc02a('0xa')](function(_0x3bcaf0){if(_0x3bcaf0){_0x55fa30=_0x3bcaf0;return db[_0xc02a('0x22')][_0xc02a('0x3d')]({'where':{'type':_0x55fa30['type']},'raw':!![]});}return null;})[_0xc02a('0xa')](function(_0xa69c4e){if(_0x55fa30[_0xc02a('0x25')][_0xc02a('0x3f')]()=='STUN'){var _0x31e30c=fs['readFileSync'](path[_0xc02a('0x42')](config['root'],_0xc02a('0x44')),_0xc02a('0x45'));var _0x521083=ejs['render'](_0x31e30c,{'networks':_0xa69c4e||[]});fs[_0xc02a('0x46')](_0xc02a('0x47'),_0x521083);return respondWithRpcPromise(_0xc02a('0x48'),_0xc02a('0x1c'),{'module':_0xc02a('0x49')});}else if(_0x55fa30['type'][_0xc02a('0x3f')]()=='TURN'){var _0x5448ab=fs['readFileSync'](path[_0xc02a('0x42')](config[_0xc02a('0x43')],_0xc02a('0x4b')),_0xc02a('0x45'));var _0xe06352=ejs['render'](_0x5448ab,{'networks':_0xa69c4e||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0xe06352);return respondWithRpcPromise(_0xc02a('0x48'),'update',{'module':'res_stun_monitor.so'});}else{var _0x4a6882=fs[_0xc02a('0x41')](path[_0xc02a('0x42')](config['root'],'server/files/templates/network.ejs'),_0xc02a('0x45'));var _0x350265=ejs[_0xc02a('0x4c')](_0x4a6882,{'networks':_0xa69c4e||[]});fs[_0xc02a('0x46')](util[_0xc02a('0x50')](_0xc02a('0x51'),_0x43ab0f[_0xc02a('0x3e')][_0xc02a('0x25')]['toLowerCase']()),_0x350265);return respondWithRpcPromise(_0xc02a('0x48'),_0xc02a('0x1c'),{'module':_0xc02a('0x52')});}})[_0xc02a('0xa')](function(_0x1461a5){if(_0x1461a5){return _0x55fa30;}return null;})[_0xc02a('0xa')](respondWithResult(_0x639452,null))['catch'](handleError(_0x639452,null));};exports[_0xc02a('0x53')]=function(_0x165394,_0x5570dc){var _0xffcecf;return db[_0xc02a('0x22')][_0xc02a('0x3b')]({'where':{'id':_0x165394['params']['id']}})[_0xc02a('0xa')](function(_0x53bcec){_0xffcecf=_0x53bcec;return _0x53bcec;})['then'](handleEntityNotFound(_0x5570dc,null))[_0xc02a('0xa')](removeEntity(_0x5570dc,null))[_0xc02a('0xa')](function(){if(_0xffcecf){return db[_0xc02a('0x22')][_0xc02a('0x3d')]({'where':{'type':_0xffcecf[_0xc02a('0x25')]},'raw':!![]});}})[_0xc02a('0xa')](function(_0x320c70){if(_0xffcecf[_0xc02a('0x25')]['toUpperCase']()==_0xc02a('0x40')){var _0x5ac7c9=fs['readFileSync'](path[_0xc02a('0x42')](config[_0xc02a('0x43')],_0xc02a('0x44')),'utf8');var _0x23b2c6=ejs['render'](_0x5ac7c9,{'networks':_0x320c70||[]});fs[_0xc02a('0x46')](_0xc02a('0x47'),_0x23b2c6);return respondWithRpcPromise(_0xc02a('0x48'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0xffcecf[_0xc02a('0x25')][_0xc02a('0x3f')]()=='TURN'){var _0x1118ad=fs['readFileSync'](path[_0xc02a('0x42')](config[_0xc02a('0x43')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x19df82=ejs[_0xc02a('0x4c')](_0x1118ad,{'networks':_0x320c70||[]});fs['writeFileSync'](_0xc02a('0x4d'),_0x19df82);return respondWithRpcPromise(_0xc02a('0x48'),'destroy',{'module':_0xc02a('0x49')});}else{var _0x1f8174=fs['readFileSync'](path['join'](config[_0xc02a('0x43')],'server/files/templates/network.ejs'),_0xc02a('0x45'));var _0x4b0138=ejs['render'](_0x1f8174,{'networks':_0x320c70||[]});fs[_0xc02a('0x46')](util[_0xc02a('0x50')]('/etc/asterisk/sip_xcally_%s.conf',_0xffcecf[_0xc02a('0x25')][_0xc02a('0x4f')]()),_0x4b0138);return respondWithRpcPromise(_0xc02a('0x48'),_0xc02a('0x53'),{'module':_0xc02a('0x52')});}})[_0xc02a('0x13')](handleError(_0x5570dc,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index d907ce2..30d046a 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 _0xbee3=['define','Network','network','util','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xbee3,0xd5));var _0x3bee=function(_0x437925,_0x1fcfdc){_0x437925=_0x437925-0x0;var _0x2ad813=_0xbee3[_0x437925];return _0x2ad813;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3bee('0x1'));var BPromise=require(_0x3bee('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bee('0x3'));var rimraf=require(_0x3bee('0x4'));var config=require(_0x3bee('0x5'));var attributes=require('./network.attributes');module[_0x3bee('0x6')]=function(_0x3baf77,_0x4c5ef5){return _0x3baf77[_0x3bee('0x7')](_0x3bee('0x8'),attributes,{'tableName':_0x3bee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c2c=['bluebird','path','rimraf','exports','define','Network','network','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc9c2('0x0'));var util=require(_0xc9c2('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc9c2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9c2('0x3'));var rimraf=require(_0xc9c2('0x4'));var config=require('../../config/environment');var attributes=require('./network.attributes');module[_0xc9c2('0x5')]=function(_0x5140a8,_0x30f3d6){return _0x5140a8[_0xc9c2('0x6')](_0xc9c2('0x7'),attributes,{'tableName':_0xc9c2('0x8'),'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 cf5fff9..0540d9e 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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x226222,_0x4f9722){_0x226222=_0x226222-0x0;var _0xf91005=_0x7a54[_0x226222];return _0xf91005;};'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(_0x367347,_0x59f488){var _0x28878f=function(_0x50409e){while(--_0x50409e){_0x367347['push'](_0x367347['shift']());}};_0x28878f(++_0x59f488);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 00beb6b..f415749 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 _0x38e9=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','post','create','addDisposition','addAnswer','/:id/notify','notify','addAgents','send','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x38e9,0xdc));var _0x938e=function(_0x2c9d95,_0xcc4c3){_0x2c9d95=_0x2c9d95-0x0;var _0x1b9a2e=_0x38e9[_0x2c9d95];return _0x1b9a2e;};'use strict';var multer=require(_0x938e('0x0'));var util=require('util');var path=require(_0x938e('0x1'));var timeout=require(_0x938e('0x2'));var express=require(_0x938e('0x3'));var router=express[_0x938e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x938e('0x5'));var interaction=require(_0x938e('0x6'));var config=require(_0x938e('0x7'));var controller=require(_0x938e('0x8'));router[_0x938e('0x9')]('/',auth[_0x938e('0xa')](),controller[_0x938e('0xb')]);router[_0x938e('0x9')]('/describe',auth[_0x938e('0xa')](),controller[_0x938e('0xc')]);router[_0x938e('0x9')](_0x938e('0xd'),auth[_0x938e('0xa')](),controller[_0x938e('0xe')]);router[_0x938e('0x9')](_0x938e('0xf'),auth['isAuthenticated'](),controller[_0x938e('0x10')]);router['get'](_0x938e('0x11'),auth[_0x938e('0xa')](),controller[_0x938e('0x12')]);router['get'](_0x938e('0x13'),auth['isAuthenticated'](),controller[_0x938e('0x14')]);router[_0x938e('0x9')](_0x938e('0x15'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x938e('0x9')](_0x938e('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x938e('0x17')]('/',auth[_0x938e('0xa')](),controller[_0x938e('0x18')]);router[_0x938e('0x17')](_0x938e('0xf'),auth[_0x938e('0xa')](),controller[_0x938e('0x19')]);router['post'](_0x938e('0x11'),auth['isAuthenticated'](),controller[_0x938e('0x1a')]);router[_0x938e('0x17')](_0x938e('0x1b'),controller[_0x938e('0x1c')]);router['post'](_0x938e('0x13'),auth[_0x938e('0xa')](),controller['addApplications']);router[_0x938e('0x17')]('/:id/users',auth[_0x938e('0xa')](),controller[_0x938e('0x1d')]);router[_0x938e('0x17')]('/:id/send',auth[_0x938e('0xa')](),controller[_0x938e('0x1e')]);router['put'](_0x938e('0xd'),auth['isAuthenticated'](),controller[_0x938e('0x1f')]);router[_0x938e('0x20')]('/:id',auth[_0x938e('0xa')](),controller[_0x938e('0x21')]);router[_0x938e('0x20')]('/:id/dispositions',auth[_0x938e('0xa')](),controller[_0x938e('0x22')]);router[_0x938e('0x20')](_0x938e('0x11'),auth[_0x938e('0xa')](),controller[_0x938e('0x23')]);router[_0x938e('0x20')](_0x938e('0x16'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x938e('0x24')]=router; \ No newline at end of file +var _0x4599=['/:id/users','post','create','addDisposition','addAnswer','notify','addAgents','/:id/send','send','update','delete','/:id','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','getInteractions'];(function(_0x226da5,_0x61afce){var _0x186d81=function(_0x1416b9){while(--_0x1416b9){_0x226da5['push'](_0x226da5['shift']());}};_0x186d81(++_0x61afce);}(_0x4599,0x16c));var _0x9459=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4599[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x9459('0x0'));var util=require(_0x9459('0x1'));var path=require(_0x9459('0x2'));var timeout=require(_0x9459('0x3'));var express=require(_0x9459('0x4'));var router=express[_0x9459('0x5')]();var fs_extra=require(_0x9459('0x6'));var auth=require(_0x9459('0x7'));var interaction=require(_0x9459('0x8'));var config=require(_0x9459('0x9'));var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0x9459('0xa')](),controller[_0x9459('0xb')]);router[_0x9459('0xc')](_0x9459('0xd'),auth[_0x9459('0xa')](),controller[_0x9459('0xe')]);router[_0x9459('0xc')]('/:id',auth[_0x9459('0xa')](),controller['show']);router[_0x9459('0xc')](_0x9459('0xf'),auth[_0x9459('0xa')](),controller[_0x9459('0x10')]);router[_0x9459('0xc')](_0x9459('0x11'),auth[_0x9459('0xa')](),controller['getAnswers']);router[_0x9459('0xc')](_0x9459('0x12'),auth[_0x9459('0xa')](),controller[_0x9459('0x13')]);router[_0x9459('0xc')]('/:id/interactions',auth[_0x9459('0xa')](),controller[_0x9459('0x14')]);router[_0x9459('0xc')](_0x9459('0x15'),auth[_0x9459('0xa')](),controller['getAgents']);router[_0x9459('0x16')]('/',auth[_0x9459('0xa')](),controller[_0x9459('0x17')]);router[_0x9459('0x16')](_0x9459('0xf'),auth['isAuthenticated'](),controller[_0x9459('0x18')]);router[_0x9459('0x16')](_0x9459('0x11'),auth[_0x9459('0xa')](),controller[_0x9459('0x19')]);router[_0x9459('0x16')]('/:id/notify',controller[_0x9459('0x1a')]);router[_0x9459('0x16')](_0x9459('0x12'),auth['isAuthenticated'](),controller['addApplications']);router[_0x9459('0x16')](_0x9459('0x15'),auth[_0x9459('0xa')](),controller[_0x9459('0x1b')]);router[_0x9459('0x16')](_0x9459('0x1c'),auth[_0x9459('0xa')](),controller[_0x9459('0x1d')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9459('0x1e')]);router[_0x9459('0x1f')](_0x9459('0x20'),auth[_0x9459('0xa')](),controller['destroy']);router[_0x9459('0x1f')]('/:id/dispositions',auth[_0x9459('0xa')](),controller[_0x9459('0x21')]);router['delete'](_0x9459('0x11'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x9459('0x1f')]('/:id/users',auth[_0x9459('0xa')](),controller['removeAgents']);module[_0x9459('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 28e7492..263a58d 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 _0x5823=['exports','name','STRING','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x3cabb8,_0x307b8b){var _0xd30f11=function(_0x10518d){while(--_0x10518d){_0x3cabb8['push'](_0x3cabb8['shift']());}};_0xd30f11(++_0x307b8b);}(_0x5823,0x106));var _0x3582=function(_0x2abbbe,_0x4a4234){_0x2abbbe=_0x2abbbe-0x0;var _0x4b4b71=_0x5823[_0x2abbbe];return _0x4b4b71;};'use strict';var Sequelize=require(_0x3582('0x0'));var rs=require(_0x3582('0x1'));module[_0x3582('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x3582('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3582('0x4')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x3582('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3582('0x5')],'defaultValue':function(){return _0x3582('0x6');}},'notificationSound':{'type':Sequelize[_0x3582('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3582('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x3582('0x4')]},'queueTransfer':{'type':Sequelize[_0x3582('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3582('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3582('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3582('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3582('0x9'),'set':function(_0x389382){if(!_0x389382)this[_0x3582('0xa')]('mandatoryDispositionPauseId',null);this[_0x3582('0xa')](_0x3582('0xb'),_0x389382);}}}; \ No newline at end of file +var _0x5cf5=['mandatoryDisposition','randomstring','STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue'];(function(_0x192833,_0x22814c){var _0x5514a5=function(_0x25e7e7){while(--_0x25e7e7){_0x192833['push'](_0x192833['shift']());}};_0x5514a5(++_0x22814c);}(_0x5cf5,0x9b));var _0x55cf=function(_0x29a4d5,_0x51eb8a){_0x29a4d5=_0x29a4d5-0x0;var _0xa9e951=_0x5cf5[_0x29a4d5];return _0xa9e951;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x55cf('0x0'));module['exports']={'name':{'type':Sequelize[_0x55cf('0x1')],'unique':_0x55cf('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x55cf('0x1')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x55cf('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x55cf('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x55cf('0x3')],'defaultValue':function(){return _0x55cf('0x4');}},'notificationSound':{'type':Sequelize[_0x55cf('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x55cf('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x55cf('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x55cf('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x55cf('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x55cf('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x55cf('0x5')],'defaultValue':![],'comment':_0x55cf('0x7'),'set':function(_0x2e6784){if(!_0x2e6784)this['setDataValue'](_0x55cf('0x8'),null);this[_0x55cf('0x9')](_0x55cf('0xa'),_0x2e6784);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 71bd5ab..752d75b 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 _0x4499=['type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','options','includeAll','include','findAll','rows','show','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','nolimit','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','openchannel','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','orderBy','priority','asc','CmContact','contact','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','firstName','messageId','update','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','notify','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Owner','fullname','internal','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','dataValues','Messages','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','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','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','undefined','count','offset','limit','set','apply','reject','save','destroy','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName'];(function(_0xfc3499,_0x337228){var _0x273a40=function(_0x365ec5){while(--_0x365ec5){_0xfc3499['push'](_0xfc3499['shift']());}};_0x273a40(++_0x337228);}(_0x4499,0x145));var _0x9449=function(_0x2acb61,_0x4436ab){_0x2acb61=_0x2acb61-0x0;var _0x5361bf=_0x4499[_0x2acb61];return _0x5361bf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9449('0x0'));var jsonpatch=require(_0x9449('0x1'));var rp=require(_0x9449('0x2'));var moment=require(_0x9449('0x3'));var BPromise=require(_0x9449('0x4'));var Mustache=require(_0x9449('0x5'));var util=require('util');var path=require(_0x9449('0x6'));var sox=require(_0x9449('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9449('0x8'));var _=require(_0x9449('0x9'));var squel=require(_0x9449('0xa'));var crypto=require(_0x9449('0xb'));var jsforce=require(_0x9449('0xc'));var deskjs=require(_0x9449('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9449('0xe'));var Papa=require(_0x9449('0xf'));var Redis=require(_0x9449('0x10'));var authService=require(_0x9449('0x11'));var qs=require(_0x9449('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9449('0x13'));var logger=require(_0x9449('0x14'))(_0x9449('0x15'));var utils=require('../../config/utils');var config=require(_0x9449('0x16'));var licenseUtil=require(_0x9449('0x17'));var db=require(_0x9449('0x18'))['db'];config[_0x9449('0x19')]=_[_0x9449('0x1a')](config[_0x9449('0x19')],{'host':_0x9449('0x1b'),'port':0x18eb});var socket=require(_0x9449('0x1c'))(new Redis(config[_0x9449('0x19')]));require(_0x9449('0x1d'))[_0x9449('0x1e')](socket);var jayson=require(_0x9449('0x1f'));var client=jayson[_0x9449('0x20')][_0x9449('0x21')]({'port':0x232c});var client9002=jayson[_0x9449('0x20')][_0x9449('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3ba7eb,_0xd7a953,_0x1e0f97,_0x32a9cb){return new BPromise(function(_0x22a641,_0x5b7ef5){var _0x516f28=_0x32a9cb||client;return _0x516f28[_0x9449('0x22')](_0x3ba7eb,_0x1e0f97)[_0x9449('0x23')](function(_0x4af63e){logger[_0x9449('0x24')](_0x9449('0x25'),_0xd7a953,_0x9449('0x26'));logger[_0x9449('0x27')](_0x9449('0x28'),_0xd7a953,_0x9449('0x26'),JSON[_0x9449('0x29')](_0x4af63e));if(_0x4af63e[_0x9449('0x2a')]){if(_0x4af63e['error']['code']===0x1f4){logger[_0x9449('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0xd7a953,_0x4af63e[_0x9449('0x2a')][_0x9449('0x2b')]);return _0x5b7ef5(_0x4af63e[_0x9449('0x2a')]['message']);}logger[_0x9449('0x2a')](_0x9449('0x25'),_0xd7a953,_0x4af63e[_0x9449('0x2a')]['message']);return _0x22a641(_0x4af63e['error']['message']);}else{logger[_0x9449('0x24')](_0x9449('0x25'),_0xd7a953,_0x9449('0x26'));_0x22a641(_0x4af63e[_0x9449('0x2c')][_0x9449('0x2b')]);}})[_0x9449('0x2d')](function(_0x254886){logger[_0x9449('0x2a')](_0x9449('0x25'),_0xd7a953,_0x254886);_0x5b7ef5(_0x254886);});});}function respondWithStatusCode(_0x3e2131,_0x4edda2){_0x4edda2=_0x4edda2||0xcc;return function(_0x3143a5){if(_0x3143a5){return _0x3e2131['sendStatus'](_0x4edda2);}return _0x3e2131[_0x9449('0x2e')](_0x4edda2)['end']();};}function respondWithResult(_0x2e5d49,_0x29e982){_0x29e982=_0x29e982||0xc8;return function(_0x475ab7){if(_0x475ab7){return _0x2e5d49['status'](_0x29e982)[_0x9449('0x2f')](_0x475ab7);}};}function respondWithFilteredResult(_0xae0cc2,_0x17ce9f){return function(_0xa945ad){if(_0xa945ad){var _0x34a092=typeof _0x17ce9f['offset']===_0x9449('0x30')&&typeof _0x17ce9f['limit']===_0x9449('0x30');var _0x3e0314=_0xa945ad[_0x9449('0x31')];var _0x203924=_0x34a092?0x0:_0x17ce9f[_0x9449('0x32')];var _0x592e42=_0x34a092?_0xa945ad['count']:_0x17ce9f[_0x9449('0x32')]+_0x17ce9f[_0x9449('0x33')];var _0x227dff;if(_0x592e42>=_0x3e0314){_0x592e42=_0x3e0314;_0x227dff=0xc8;}else{_0x227dff=0xce;}_0xae0cc2[_0x9449('0x2e')](_0x227dff);return _0xae0cc2[_0x9449('0x34')]('Content-Range',_0x203924+'-'+_0x592e42+'/'+_0x3e0314)['json'](_0xa945ad);}return null;};}function patchUpdates(_0x54208b){return function(_0x582121){try{jsonpatch[_0x9449('0x35')](_0x582121,_0x54208b,!![]);}catch(_0x22e9c0){return BPromise[_0x9449('0x36')](_0x22e9c0);}return _0x582121[_0x9449('0x37')]();};}function saveUpdates(_0x22d439,_0x3a20c3){return function(_0x17cf00){if(_0x17cf00){return _0x17cf00['update'](_0x22d439)[_0x9449('0x23')](function(_0x4ae12c){return _0x4ae12c;});}return null;};}function removeEntity(_0x42ff03,_0xc357a4){return function(_0x1ed9fe){if(_0x1ed9fe){return _0x1ed9fe[_0x9449('0x38')]()[_0x9449('0x23')](function(){var _0x17f048=_0x1ed9fe['get']({'plain':!![]});var _0x3422e8='OpenchannelAccounts';return db['UserProfileResource'][_0x9449('0x38')]({'where':{'type':_0x3422e8,'resourceId':_0x17f048['id']}})[_0x9449('0x23')](function(){return _0x1ed9fe;});})[_0x9449('0x23')](function(){_0x42ff03[_0x9449('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x280b01,_0x331209){return function(_0x5d7135){if(!_0x5d7135){_0x280b01[_0x9449('0x39')](0x194);}return _0x5d7135;};}function handleError(_0x616732,_0x3b9e54){_0x3b9e54=_0x3b9e54||0x1f4;return function(_0x4d551b){logger[_0x9449('0x2a')](_0x4d551b[_0x9449('0x3a')]);if(_0x4d551b[_0x9449('0x3b')]){delete _0x4d551b[_0x9449('0x3b')];}_0x616732['status'](_0x3b9e54)[_0x9449('0x3c')](_0x4d551b);};}exports[_0x9449('0x3d')]=function(_0x3a881e,_0x1faec8){var _0x2989ae={'include':[{'model':db[_0x9449('0x3e')],'as':_0x9449('0x3f')}]},_0x38033f={},_0x313e4b={'count':0x0,'rows':[]};var _0x5d4ee2=_['map'](db[_0x9449('0x40')][_0x9449('0x41')],function(_0x198b8f){return{'name':_0x198b8f[_0x9449('0x42')],'type':_0x198b8f[_0x9449('0x43')][_0x9449('0x44')]};});_0x38033f[_0x9449('0x45')]=_['map'](_0x5d4ee2,_0x9449('0x3b'));_0x38033f['query']=_['keys'](_0x3a881e['query']);_0x38033f[_0x9449('0x46')]=_[_0x9449('0x47')](_0x38033f[_0x9449('0x45')],_0x38033f[_0x9449('0x48')]);_0x2989ae[_0x9449('0x49')]=_[_0x9449('0x47')](_0x38033f[_0x9449('0x45')],qs[_0x9449('0x4a')](_0x3a881e['query']['fields']));_0x2989ae[_0x9449('0x49')]=_0x2989ae[_0x9449('0x49')][_0x9449('0x4b')]?_0x2989ae['attributes']:_0x38033f[_0x9449('0x45')];if(!_0x3a881e['query'][_0x9449('0x4c')]('nolimit')){_0x2989ae['limit']=qs['limit'](_0x3a881e[_0x9449('0x48')][_0x9449('0x33')]);_0x2989ae[_0x9449('0x32')]=qs[_0x9449('0x32')](_0x3a881e[_0x9449('0x48')][_0x9449('0x32')]);}_0x2989ae[_0x9449('0x4d')]=qs[_0x9449('0x4e')](_0x3a881e[_0x9449('0x48')][_0x9449('0x4e')]);_0x2989ae[_0x9449('0x4f')]=qs[_0x9449('0x46')](_['pick'](_0x3a881e['query'],_0x38033f[_0x9449('0x46')]),_0x5d4ee2);if(_0x3a881e[_0x9449('0x48')][_0x9449('0x50')]){_0x2989ae[_0x9449('0x4f')]=_[_0x9449('0x51')](_0x2989ae[_0x9449('0x4f')],{'$or':_[_0x9449('0x52')](_0x5d4ee2,function(_0x31ccac){if(_0x31ccac[_0x9449('0x43')]!=='VIRTUAL'){var _0x36b302={};_0x36b302[_0x31ccac[_0x9449('0x3b')]]={'$like':'%'+_0x3a881e[_0x9449('0x48')]['filter']+'%'};return _0x36b302;}})});}_0x2989ae=_['merge']({},_0x2989ae,_0x3a881e[_0x9449('0x53')]);var _0xd3750d={'where':_0x2989ae[_0x9449('0x4f')]};return db[_0x9449('0x40')][_0x9449('0x31')](_0xd3750d)[_0x9449('0x23')](function(_0x597a21){_0x313e4b['count']=_0x597a21;if(_0x3a881e[_0x9449('0x48')][_0x9449('0x54')]){_0x2989ae[_0x9449('0x55')]=[{'all':!![]}];}return db[_0x9449('0x40')][_0x9449('0x56')](_0x2989ae);})['then'](function(_0x413a84){_0x313e4b[_0x9449('0x57')]=_0x413a84;return _0x313e4b;})[_0x9449('0x23')](respondWithFilteredResult(_0x1faec8,_0x2989ae))['catch'](handleError(_0x1faec8,null));};exports[_0x9449('0x58')]=function(_0x1a1b97,_0x3ef23c){var _0x5da7de={'raw':![],'where':{'id':_0x1a1b97[_0x9449('0x59')]['id']},'include':[{'model':db[_0x9449('0x3e')],'as':_0x9449('0x3f')}]},_0x10152d={};_0x10152d[_0x9449('0x45')]=_[_0x9449('0x5a')](db[_0x9449('0x40')][_0x9449('0x41')]);_0x10152d[_0x9449('0x48')]=_[_0x9449('0x5a')](_0x1a1b97['query']);_0x10152d[_0x9449('0x46')]=_[_0x9449('0x47')](_0x10152d[_0x9449('0x45')],_0x10152d[_0x9449('0x48')]);_0x5da7de[_0x9449('0x49')]=_[_0x9449('0x47')](_0x10152d['model'],qs['fields'](_0x1a1b97[_0x9449('0x48')][_0x9449('0x4a')]));_0x5da7de[_0x9449('0x49')]=_0x5da7de['attributes'][_0x9449('0x4b')]?_0x5da7de[_0x9449('0x49')]:_0x10152d['model'];if(_0x1a1b97[_0x9449('0x48')]['includeAll']){_0x5da7de[_0x9449('0x55')]=[{'all':!![]}];}_0x5da7de=_[_0x9449('0x51')]({},_0x5da7de,_0x1a1b97[_0x9449('0x53')]);return db['OpenchannelAccount'][_0x9449('0x5b')](_0x5da7de)[_0x9449('0x23')](handleEntityNotFound(_0x3ef23c,null))['then'](respondWithResult(_0x3ef23c,null))[_0x9449('0x2d')](handleError(_0x3ef23c,null));};exports[_0x9449('0x5c')]=function(_0x5da94f,_0x472792){return db[_0x9449('0x40')][_0x9449('0x5c')](_0x5da94f['body'],{})[_0x9449('0x23')](function(_0x17af8a){var _0x5d6f71=_0x5da94f[_0x9449('0x5d')][_0x9449('0x5e')]({'plain':!![]});if(!_0x5d6f71)throw new Error(_0x9449('0x5f'));if(_0x5d6f71[_0x9449('0x60')]===_0x9449('0x5d')){var _0x1eed96=_0x17af8a[_0x9449('0x5e')]({'plain':!![]});var _0x84bdc5='OpenchannelAccounts';return db['UserProfileSection'][_0x9449('0x5b')]({'where':{'name':_0x84bdc5,'userProfileId':_0x5d6f71['userProfileId']},'raw':!![]})[_0x9449('0x23')](function(_0x1cc842){if(_0x1cc842&&_0x1cc842['autoAssociation']===0x0){return db[_0x9449('0x61')][_0x9449('0x5c')]({'name':_0x1eed96['name'],'resourceId':_0x1eed96['id'],'type':_0x1cc842['name'],'sectionId':_0x1cc842['id']},{})[_0x9449('0x23')](function(){return _0x17af8a;});}else{return _0x17af8a;}})[_0x9449('0x2d')](function(_0x5ec31e){logger[_0x9449('0x2a')](_0x9449('0x62'),_0x5ec31e);throw _0x5ec31e;});}return _0x17af8a;})['then'](respondWithResult(_0x472792,0xc9))[_0x9449('0x2d')](handleError(_0x472792,null));};exports['update']=function(_0x464f65,_0x4cb49b){if(_0x464f65[_0x9449('0x63')]['id']){delete _0x464f65[_0x9449('0x63')]['id'];}return db[_0x9449('0x40')][_0x9449('0x5b')]({'where':{'id':_0x464f65[_0x9449('0x59')]['id']},'include':[{'model':db[_0x9449('0x3e')],'as':_0x9449('0x3f')}]})[_0x9449('0x23')](handleEntityNotFound(_0x4cb49b,null))[_0x9449('0x23')](saveUpdates(_0x464f65[_0x9449('0x63')],null))[_0x9449('0x23')](respondWithResult(_0x4cb49b,null))[_0x9449('0x2d')](handleError(_0x4cb49b,null));};exports[_0x9449('0x38')]=function(_0x4167ec,_0x928b4b){return db[_0x9449('0x40')][_0x9449('0x5b')]({'where':{'id':_0x4167ec['params']['id']}})[_0x9449('0x23')](handleEntityNotFound(_0x928b4b,null))[_0x9449('0x23')](removeEntity(_0x928b4b,null))[_0x9449('0x2d')](handleError(_0x928b4b,null));};exports[_0x9449('0x64')]=function(_0x332103,_0x90ebc9){return db[_0x9449('0x40')][_0x9449('0x64')]()[_0x9449('0x23')](respondWithResult(_0x90ebc9,null))[_0x9449('0x2d')](handleError(_0x90ebc9,null));};exports[_0x9449('0x65')]=function(_0x525374,_0x37f84a,_0x32762b){if(_0x525374[_0x9449('0x63')]['id']){delete _0x525374[_0x9449('0x63')]['id'];}return db[_0x9449('0x40')][_0x9449('0x5b')]({'where':{'id':_0x525374[_0x9449('0x59')]['id']}})[_0x9449('0x23')](handleEntityNotFound(_0x37f84a,null))[_0x9449('0x23')](function(_0x18bb4e){if(_0x18bb4e){_0x525374['body'][_0x9449('0x66')]=_0x18bb4e['id'];return db[_0x9449('0x67')][_0x9449('0x5c')](_0x525374[_0x9449('0x63')]);}})[_0x9449('0x23')](respondWithResult(_0x37f84a,null))[_0x9449('0x2d')](handleError(_0x37f84a,null));};exports[_0x9449('0x68')]=function(_0x4ff50d,_0x31119b,_0x3908f3){var _0x5c55ba={'raw':![],'where':{}};var _0x60ee4e={};var _0x54c2c9={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9449('0x69')]({'where':{'id':_0x4ff50d[_0x9449('0x59')]['id']}})[_0x9449('0x23')](handleEntityNotFound(_0x31119b,null))['then'](function(_0x1ecf6a){if(_0x1ecf6a){_0x60ee4e[_0x9449('0x45')]=_[_0x9449('0x5a')](db['Disposition'][_0x9449('0x41')]);_0x60ee4e[_0x9449('0x48')]=_[_0x9449('0x5a')](_0x4ff50d['query']);_0x60ee4e[_0x9449('0x46')]=_[_0x9449('0x47')](_0x60ee4e[_0x9449('0x45')],_0x60ee4e['query']);_0x5c55ba[_0x9449('0x49')]=_[_0x9449('0x47')](_0x60ee4e[_0x9449('0x45')],qs[_0x9449('0x4a')](_0x4ff50d[_0x9449('0x48')][_0x9449('0x4a')]));_0x5c55ba[_0x9449('0x49')]=_0x5c55ba[_0x9449('0x49')][_0x9449('0x4b')]?_0x5c55ba[_0x9449('0x49')]:_0x60ee4e[_0x9449('0x45')];if(!_0x4ff50d[_0x9449('0x48')]['hasOwnProperty'](_0x9449('0x6a'))){_0x5c55ba['limit']=qs[_0x9449('0x33')](_0x4ff50d[_0x9449('0x48')][_0x9449('0x33')]);_0x5c55ba[_0x9449('0x32')]=qs[_0x9449('0x32')](_0x4ff50d[_0x9449('0x48')][_0x9449('0x32')]);}_0x5c55ba[_0x9449('0x4d')]=qs[_0x9449('0x4e')](_0x4ff50d['query'][_0x9449('0x4e')]);_0x5c55ba[_0x9449('0x4f')]=qs[_0x9449('0x46')](_[_0x9449('0x6b')](_0x4ff50d[_0x9449('0x48')],_0x60ee4e[_0x9449('0x46')]));_0x5c55ba[_0x9449('0x4f')]['OpenchannelAccountId']=_0x1ecf6a['id'];if(_0x4ff50d['query'][_0x9449('0x50')]){_0x5c55ba['where']=_[_0x9449('0x51')](_0x5c55ba[_0x9449('0x4f')],{'$or':_['map'](_0x5c55ba['attributes'],function(_0x90e699){var _0x2b5842={};_0x2b5842[_0x90e699]={'$like':'%'+_0x4ff50d[_0x9449('0x48')][_0x9449('0x50')]+'%'};return _0x2b5842;})});}_0x5c55ba=_[_0x9449('0x51')]({},_0x5c55ba,_0x4ff50d['options']);return db[_0x9449('0x67')][_0x9449('0x31')]({'where':_0x5c55ba[_0x9449('0x4f')]})['then'](function(_0x3be82d){_0x54c2c9[_0x9449('0x31')]=_0x3be82d;if(_0x4ff50d[_0x9449('0x48')]['includeAll']){_0x5c55ba['include']=[{'all':!![]}];}return db[_0x9449('0x67')][_0x9449('0x56')](_0x5c55ba);})[_0x9449('0x23')](function(_0x25d266){_0x54c2c9['rows']=_0x25d266;return _0x54c2c9;});}})['then'](respondWithFilteredResult(_0x31119b,_0x5c55ba))[_0x9449('0x2d')](handleError(_0x31119b,null));};exports[_0x9449('0x6c')]=function(_0x476660,_0x348bc7,_0x15f9ea){return db[_0x9449('0x40')][_0x9449('0x5b')]({'where':{'id':_0x476660[_0x9449('0x59')]['id']}})[_0x9449('0x23')](handleEntityNotFound(_0x348bc7,null))['then'](function(_0x1ae58f){if(_0x1ae58f){return _0x1ae58f[_0x9449('0x6c')](_0x476660[_0x9449('0x48')][_0x9449('0x6d')]);}})[_0x9449('0x23')](respondWithStatusCode(_0x348bc7,null))['catch'](handleError(_0x348bc7,null));};exports[_0x9449('0x6e')]=function(_0xcf6d99,_0x43b8df,_0x12fa48){if(_0xcf6d99[_0x9449('0x63')]['id']){delete _0xcf6d99[_0x9449('0x63')]['id'];}return db[_0x9449('0x40')][_0x9449('0x5b')]({'where':{'id':_0xcf6d99[_0x9449('0x59')]['id']}})[_0x9449('0x23')](handleEntityNotFound(_0x43b8df,null))[_0x9449('0x23')](function(_0x58d66e){if(_0x58d66e){_0xcf6d99[_0x9449('0x63')][_0x9449('0x66')]=_0x58d66e['id'];return db[_0x9449('0x6f')][_0x9449('0x5c')](_0xcf6d99[_0x9449('0x63')]);}})[_0x9449('0x23')](respondWithResult(_0x43b8df,null))[_0x9449('0x2d')](handleError(_0x43b8df,null));};exports[_0x9449('0x70')]=function(_0x1f423c,_0x37f6e6,_0x4f2f32){var _0x3a83af={'raw':![],'where':{}};var _0x527420={};var _0x5df435={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x1f423c[_0x9449('0x59')]['id']}})[_0x9449('0x23')](handleEntityNotFound(_0x37f6e6,null))[_0x9449('0x23')](function(_0x5c68bd){if(_0x5c68bd){_0x527420[_0x9449('0x45')]=_['keys'](db[_0x9449('0x6f')][_0x9449('0x41')]);_0x527420[_0x9449('0x48')]=_['keys'](_0x1f423c[_0x9449('0x48')]);_0x527420[_0x9449('0x46')]=_[_0x9449('0x47')](_0x527420[_0x9449('0x45')],_0x527420['query']);_0x3a83af[_0x9449('0x49')]=_[_0x9449('0x47')](_0x527420[_0x9449('0x45')],qs['fields'](_0x1f423c[_0x9449('0x48')]['fields']));_0x3a83af['attributes']=_0x3a83af['attributes'][_0x9449('0x4b')]?_0x3a83af[_0x9449('0x49')]:_0x527420[_0x9449('0x45')];if(!_0x1f423c[_0x9449('0x48')][_0x9449('0x4c')]('nolimit')){_0x3a83af[_0x9449('0x33')]=qs[_0x9449('0x33')](_0x1f423c[_0x9449('0x48')][_0x9449('0x33')]);_0x3a83af[_0x9449('0x32')]=qs[_0x9449('0x32')](_0x1f423c[_0x9449('0x48')][_0x9449('0x32')]);}_0x3a83af[_0x9449('0x4d')]=qs[_0x9449('0x4e')](_0x1f423c[_0x9449('0x48')][_0x9449('0x4e')]);_0x3a83af[_0x9449('0x4f')]=qs[_0x9449('0x46')](_['pick'](_0x1f423c[_0x9449('0x48')],_0x527420[_0x9449('0x46')]));_0x3a83af[_0x9449('0x4f')][_0x9449('0x66')]=_0x5c68bd['id'];if(_0x1f423c[_0x9449('0x48')]['filter']){_0x3a83af[_0x9449('0x4f')]=_['merge'](_0x3a83af[_0x9449('0x4f')],{'$or':_[_0x9449('0x52')](_0x3a83af[_0x9449('0x49')],function(_0x4f5ea8){var _0x53ec96={};_0x53ec96[_0x4f5ea8]={'$like':'%'+_0x1f423c['query'][_0x9449('0x50')]+'%'};return _0x53ec96;})});}_0x3a83af=_['merge']({},_0x3a83af,_0x1f423c[_0x9449('0x53')]);return db[_0x9449('0x6f')][_0x9449('0x31')]({'where':_0x3a83af[_0x9449('0x4f')]})[_0x9449('0x23')](function(_0xf81d09){_0x5df435[_0x9449('0x31')]=_0xf81d09;if(_0x1f423c['query']['includeAll']){_0x3a83af[_0x9449('0x55')]=[{'all':!![]}];}return db[_0x9449('0x6f')][_0x9449('0x56')](_0x3a83af);})[_0x9449('0x23')](function(_0x1d5582){_0x5df435['rows']=_0x1d5582;return _0x5df435;});}})[_0x9449('0x23')](respondWithFilteredResult(_0x37f6e6,_0x3a83af))[_0x9449('0x2d')](handleError(_0x37f6e6,null));};exports[_0x9449('0x71')]=function(_0x5000b7,_0x4726f7,_0x49dcfe){return db['OpenchannelAccount']['find']({'where':{'id':_0x5000b7[_0x9449('0x59')]['id']}})[_0x9449('0x23')](handleEntityNotFound(_0x4726f7,null))['then'](function(_0xf281a0){if(_0xf281a0){return _0xf281a0[_0x9449('0x71')](_0x5000b7['query'][_0x9449('0x6d')]);}})['then'](respondWithStatusCode(_0x4726f7,null))[_0x9449('0x2d')](handleError(_0x4726f7,null));};exports['notify']=function(_0x8df707,_0x352f35,_0x5a2d98){var _0x35848b={'body':_0x8df707[_0x9449('0x63')],'channel':_0x9449('0x72')};var _0x2beb76=[];var _0x8a3e25=[];var _0x96e084={};var _0x1c8b02=![];return db['CmContact'][_0x9449('0x64')]()['then'](function(_0x1273be){if(!_0x1273be){throw new db[(_0x9449('0x73'))][(_0x9449('0x74'))]('no\x20available\x20attributes');}_0x2beb76=_[_0x9449('0x75')](_[_0x9449('0x5a')](_0x1273be),[_0x9449('0x76'),_0x9449('0x77')]);_0x8a3e25=_[_0x9449('0x75')](_[_0x9449('0x5a')](_0x1273be),[_0x9449('0x76'),_0x9449('0x77'),_0x9449('0x78'),_0x9449('0x79')]);if(_0x8df707['body']['id']){delete _0x8df707[_0x9449('0x63')]['id'];}if(_[_0x9449('0x7a')](_0x8df707[_0x9449('0x63')][_0x9449('0x7b')])){throw new db[(_0x9449('0x73'))][(_0x9449('0x74'))](_0x9449('0x7c'));}if(_['isNil'](_0x8df707[_0x9449('0x63')][_0x9449('0x63')])||_0x8df707[_0x9449('0x63')][_0x9449('0x63')]===''){throw new db[(_0x9449('0x73'))][(_0x9449('0x74'))](_0x9449('0x7d'));}if(_[_0x9449('0x7a')](_0x8df707[_0x9449('0x63')][_0x9449('0x7e')])){throw new db[(_0x9449('0x73'))]['ValidationError'](_0x9449('0x7f')+_0x8a3e25);}if(!_[_0x9449('0x80')](_0x8a3e25,_0x8df707[_0x9449('0x63')]['mapKey'])){throw new db[(_0x9449('0x73'))][(_0x9449('0x74'))](_0x9449('0x81')+_0x8a3e25);}_0x96e084[_0x8df707[_0x9449('0x63')][_0x9449('0x7e')]]=_0x8df707[_0x9449('0x63')][_0x9449('0x7b')];})[_0x9449('0x23')](function(){return db[_0x9449('0x40')]['find']({'where':{'id':_0x8df707[_0x9449('0x59')]['id']},'include':[{'model':db[_0x9449('0x82')],'as':_0x9449('0x83'),'include':[{'model':db['CmContact'],'as':_0x9449('0x84'),'where':_0x96e084,'limit':0x1,'order':[[_0x9449('0x77'),_0x9449('0x85')]]}]},{'model':db[_0x9449('0x86')],'as':'Applications'}]});})[_0x9449('0x23')](handleEntityNotFound(_0x352f35,null))[_0x9449('0x23')](function(_0xecd9da){if(_0xecd9da&&_0xecd9da[_0x9449('0x83')]){_0x35848b[_0x9449('0x87')]=_0xecd9da;_0x35848b[_0x9449('0x88')]=_0xecd9da[_0x9449('0x89')];_0x35848b['list']=_0xecd9da[_0x9449('0x83')];_0x35848b[_0x9449('0x88')]=_[_0x9449('0x8a')](_0x35848b[_0x9449('0x88')],[_0x9449('0x8b')],[_0x9449('0x8c')]);if(_0x35848b['account']['Applications']){delete _0x35848b[_0x9449('0x87')]['Applications'];}if(_0x35848b[_0x9449('0x87')][_0x9449('0x83')]&&_0x35848b[_0x9449('0x87')][_0x9449('0x83')][_0x9449('0x84')][_0x9449('0x4b')]){return _0x35848b['account']['List'][_0x9449('0x84')][0x0];}var _0x1a398f=_['defaults'](_0x8df707[_0x9449('0x63')],{'firstName':_0x8df707[_0x9449('0x63')][_0x9449('0x7b')],'ListId':_0xecd9da[_0x9449('0x79')]});_0x1a398f[_0x8df707[_0x9449('0x63')][_0x9449('0x7e')]]=_0x8df707[_0x9449('0x63')][_0x9449('0x7b')];return db[_0x9449('0x8d')][_0x9449('0x5c')](_0x1a398f,{'fields':_0x2beb76,'raw':!![]});}})[_0x9449('0x23')](handleEntityNotFound(_0x352f35,null))[_0x9449('0x23')](function(_0x129479){_0x35848b[_0x9449('0x8e')]=_0x129479;if(_0x129479){var _0x5c6b08={'ContactId':_0x129479['id'],'OpenchannelAccountId':_0x8df707[_0x9449('0x59')]['id'],'from':(_0x129479['firstName']||'')+'\x20'+(_0x129479['lastName']||'')};var _0x38622e={'OpenchannelAccountId':_0x8df707[_0x9449('0x59')]['id'],'closed':![]};if(_0x8df707[_0x9449('0x63')][_0x9449('0x8f')]){_0x38622e[_0x9449('0x8f')]=_0x8df707[_0x9449('0x63')][_0x9449('0x8f')];return db['OpenchannelInteraction'][_0x9449('0x5b')]({'where':_0x38622e})[_0x9449('0x23')](function(_0x1b8106){if(_0x1b8106){return[_0x1b8106,![]];}_0x5c6b08[_0x9449('0x8f')]=_0x8df707['body'][_0x9449('0x8f')];_0x5c6b08[_0x9449('0x90')]=_0x8df707[_0x9449('0x63')][_0x9449('0x90')];return db[_0x9449('0x91')]['create'](_0x5c6b08)[_0x9449('0x23')](function(_0x5caaad){return[_0x5caaad,!![]];});});}else{_0x38622e[_0x9449('0x8f')]=null;}_0x38622e[_0x9449('0x92')]=_0x129479['id'];return db[_0x9449('0x91')]['find']({'where':_0x38622e})[_0x9449('0x23')](function(_0x560c2b){if(_0x560c2b){return[_0x560c2b,![]];}return db['OpenchannelInteraction'][_0x9449('0x5c')](_0x5c6b08)[_0x9449('0x23')](function(_0x158a35){return[_0x158a35,!![]];});});}})[_0x9449('0x93')](function(_0x1d615b,_0x34eca9){if(_0x1d615b){_0x1c8b02=_0x34eca9;if(!_0x34eca9){var _0xc33abf={'from':(_0x35848b['contact'][_0x9449('0x94')]||'')+'\x20'+(_0x35848b['contact']['lastName']||'')};if(_0x8df707['body'][_0x9449('0x8f')]&&_0x8df707[_0x9449('0x63')][_0x9449('0x95')]&&_0x8df707['body'][_0x9449('0x8f')]!=_0x8df707['body'][_0x9449('0x95')]){_0xc33abf[_0x9449('0x8f')]=_0x8df707[_0x9449('0x63')][_0x9449('0x95')];}return _0x1d615b[_0x9449('0x96')](_0xc33abf);}else{return _0x1d615b;}}})['then'](function(_0x125851){_0x35848b[_0x9449('0x97')]=_0x125851[_0x9449('0x5e')]({'plain':!![]});_0x35848b['interaction']['created']=_0x1c8b02;if(_0x35848b[_0x9449('0x97')][_0x9449('0x98')]){if(_0x35848b[_0x9449('0x87')][_0x9449('0x99')]){_0x35848b[_0x9449('0x88')][_0x9449('0x9a')]({'id':0x0,'priority':_0x35848b['applications'][_0x9449('0x4b')]+0x1,'app':_0x9449('0x9b'),'appdata':_0x9449('0x9c'),'interval':_0x9449('0x9d')});}}return db[_0x9449('0x9e')][_0x9449('0x5c')]({'body':_0x8df707[_0x9449('0x63')][_0x9449('0x63')],'OpenchannelAccountId':_0x8df707[_0x9449('0x59')]['id'],'OpenchannelInteractionId':_0x125851['id'],'direction':'in','ContactId':_0x35848b['contact']['id'],'AttachmentId':_0x8df707[_0x9449('0x63')][_0x9449('0x9f')]});})[_0x9449('0x23')](function(_0x1815d9){_0x35848b[_0x9449('0x2b')]=_0x1815d9;if(_0x35848b[_0x9449('0x97')][_0x9449('0xa0')]){return db[_0x9449('0xa1')]['find']({'attributes':['id',_0x9449('0x3b')],'where':{'id':_0x35848b[_0x9449('0x97')][_0x9449('0xa0')]}})[_0x9449('0x23')](function(_0x2ba022){if(_0x2ba022){_0x35848b[_0x9449('0x88')][_0x9449('0xa2')]({'id':0x0,'priority':0x0,'app':_0x9449('0xa3'),'appdata':_0x2ba022[_0x9449('0x3b')]+','+(_0x35848b[_0x9449('0x87')][_0x9449('0xa4')]||0xa),'interval':'*,*,*,*'});_0x35848b[_0x9449('0xa5')]=![];}return respondWithRpcPromise('Start',_0x9449('0xa6'),_0x35848b);});}return respondWithRpcPromise(_0x9449('0xa7'),_0x9449('0xa6'),_0x35848b);})[_0x9449('0x23')](function(_0x19c881){respondWithRpcPromise('EventManager',_0x9449('0xa8'),{'event':_0x9449('0xa9'),'message':_0x19c881},client9002);return _0x19c881;})['then'](respondWithResult(_0x352f35,null))['catch'](handleError(_0x352f35,null));};exports['addApplications']=function(_0x3b56ce,_0x4ae94e){var _0x3bd4fe=_0x3b56ce[_0x9449('0x59')]['id'];var _0xdd1f31=_0x3b56ce['body'];var _0x2fdcec=0xc8;var _0xe2b47a=null;return db[_0x9449('0xaa')][_0x9449('0xab')]({'isolationLevel':db[_0x9449('0xaa')][_0x9449('0xac')][_0x9449('0xad')][_0x9449('0xae')]},function(_0x57fe9a){return db[_0x9449('0x40')][_0x9449('0x69')]({'where':{'id':_0x3bd4fe},'transaction':_0x57fe9a})[_0x9449('0x23')](function(_0x19e0cb){if(_0x19e0cb){return db[_0x9449('0x86')][_0x9449('0x38')]({'where':{'OpenchannelAccountId':_0x3bd4fe},'transaction':_0x57fe9a})[_0x9449('0x23')](function(){var _0x540c71=_['map'](_0xdd1f31,function(_0x91d40a){_0x91d40a[_0x9449('0x66')]=_0x3bd4fe;return _0x91d40a;});return db[_0x9449('0x86')][_0x9449('0xaf')](_0x540c71,{'transaction':_0x57fe9a});});}else{_0x2fdcec=0x194;_0xe2b47a=[];}});})[_0x9449('0x23')](function(){if(_0x2fdcec!==0x194){return db[_0x9449('0x86')][_0x9449('0xb0')]({'where':{'OpenchannelAccountId':_0x3bd4fe},'order':_0x9449('0x8b')})[_0x9449('0x23')](function(_0xa79cc7){_0xe2b47a=_0xa79cc7;});}})[_0x9449('0x2d')](function(_0x4f7619){_0x2fdcec=0x1f4;logger[_0x9449('0x2a')](_0x4f7619[_0x9449('0x3a')]);if(_0x4f7619[_0x9449('0x3b')]){delete _0x4f7619[_0x9449('0x3b')];}_0xe2b47a=_0x4f7619;})[_0x9449('0xb1')](function(){if(_0xe2b47a===null){_0x4ae94e[_0x9449('0x39')](_0x2fdcec);}else{if(_0x2fdcec===0x1f4){_0x4ae94e[_0x9449('0x2e')](_0x2fdcec)['send'](_0xe2b47a);}else{_0x4ae94e[_0x9449('0x2e')](_0x2fdcec)[_0x9449('0x2f')](_0xe2b47a);}}});};exports[_0x9449('0xb2')]=function(_0x1c8812,_0x4ea358,_0x5230a3){var _0x419684={};var _0x255c26={};var _0x1c200a;var _0x2b33c4;return db[_0x9449('0x40')][_0x9449('0x69')]({'where':{'id':_0x1c8812[_0x9449('0x59')]['id']}})[_0x9449('0x23')](handleEntityNotFound(_0x4ea358,null))[_0x9449('0x23')](function(_0xeb6788){if(_0xeb6788){_0x1c200a=_0xeb6788;_0x255c26['model']=_[_0x9449('0x5a')](db[_0x9449('0x86')][_0x9449('0x41')]);_0x255c26['query']=_[_0x9449('0x5a')](_0x1c8812[_0x9449('0x48')]);_0x255c26[_0x9449('0x46')]=_['intersection'](_0x255c26['model'],_0x255c26['query']);_0x419684[_0x9449('0x49')]=_[_0x9449('0x47')](_0x255c26[_0x9449('0x45')],qs[_0x9449('0x4a')](_0x1c8812[_0x9449('0x48')][_0x9449('0x4a')]));_0x419684[_0x9449('0x49')]=_0x419684['attributes'][_0x9449('0x4b')]?_0x419684['attributes']:_0x255c26['model'];_0x419684['order']=qs['sort'](_0x1c8812[_0x9449('0x48')][_0x9449('0x4e')]);_0x419684[_0x9449('0x4f')]=qs['filters'](_[_0x9449('0x6b')](_0x1c8812[_0x9449('0x48')],_0x255c26['filters']));if(_0x1c8812[_0x9449('0x48')]['filter']){_0x419684[_0x9449('0x4f')]=_[_0x9449('0x51')](_0x419684[_0x9449('0x4f')],{'$or':_['map'](_0x419684[_0x9449('0x49')],function(_0x47d9fd){var _0x5d828f={};_0x5d828f[_0x47d9fd]={'$like':'%'+_0x1c8812[_0x9449('0x48')][_0x9449('0x50')]+'%'};return _0x5d828f;})});}_0x419684=_['merge']({},_0x419684,_0x1c8812[_0x9449('0x53')]);return _0x1c200a[_0x9449('0xb2')](_0x419684);}})[_0x9449('0x23')](function(_0x1d5da7){if(_0x1d5da7){_0x2b33c4=_0x1d5da7['length'];if(!_0x1c8812[_0x9449('0x48')]['hasOwnProperty'](_0x9449('0x6a'))){_0x419684['limit']=qs['limit'](_0x1c8812['query'][_0x9449('0x33')]);_0x419684[_0x9449('0x32')]=qs['offset'](_0x1c8812[_0x9449('0x48')][_0x9449('0x32')]);}return _0x1c200a['getApplications'](_0x419684);}})[_0x9449('0x23')](function(_0x3b2eaa){if(_0x3b2eaa){return _0x3b2eaa?{'count':_0x2b33c4,'rows':_0x3b2eaa}:null;}})[_0x9449('0x23')](respondWithResult(_0x4ea358,null))[_0x9449('0x2d')](handleError(_0x4ea358,null));};exports[_0x9449('0xb3')]=function(_0x2fc246,_0x16ff50,_0x590991){var _0x2a3d7={'raw':![],'where':{}};var _0x3d5727={};var _0x5384c={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9449('0x69')]({'where':{'id':_0x2fc246[_0x9449('0x59')]['id']}})['then'](handleEntityNotFound(_0x16ff50,null))[_0x9449('0x23')](function(_0x56e02a){if(_0x56e02a){_0x3d5727[_0x9449('0x45')]=_[_0x9449('0x5a')](db[_0x9449('0x91')][_0x9449('0x41')]);_0x3d5727[_0x9449('0x48')]=_['keys'](_0x2fc246[_0x9449('0x48')]);_0x3d5727[_0x9449('0x46')]=_['intersection'](_0x3d5727[_0x9449('0x45')],_0x3d5727[_0x9449('0x48')]);_0x2a3d7[_0x9449('0x49')]=_['intersection'](_0x3d5727['model'],qs['fields'](_0x2fc246[_0x9449('0x48')]['fields']));_0x2a3d7['attributes']=_0x2a3d7[_0x9449('0x49')][_0x9449('0x4b')]?_0x2a3d7[_0x9449('0x49')]:_0x3d5727[_0x9449('0x45')];if(!_0x2fc246['query'][_0x9449('0x4c')](_0x9449('0x6a'))){_0x2a3d7[_0x9449('0x33')]=qs[_0x9449('0x33')](_0x2fc246[_0x9449('0x48')][_0x9449('0x33')]);_0x2a3d7[_0x9449('0x32')]=qs[_0x9449('0x32')](_0x2fc246[_0x9449('0x48')][_0x9449('0x32')]);}_0x2a3d7[_0x9449('0x4d')]=qs[_0x9449('0x4e')](_0x2fc246['query'][_0x9449('0x4e')]);_0x2a3d7[_0x9449('0x4f')]=qs[_0x9449('0x46')](_['pick'](_0x2fc246[_0x9449('0x48')],_0x3d5727['filters']));_0x2a3d7['where'][_0x9449('0x66')]=_0x56e02a['id'];if(_0x2fc246[_0x9449('0x48')][_0x9449('0x50')]){_0x2a3d7[_0x9449('0x4f')]=_[_0x9449('0x51')](_0x2a3d7[_0x9449('0x4f')],{'$or':_['map'](_0x2a3d7['attributes'],function(_0x2019f6){var _0x428454={};_0x428454[_0x2019f6]={'$like':'%'+_0x2fc246[_0x9449('0x48')][_0x9449('0x50')]+'%'};return _0x428454;})});}_0x2a3d7=_[_0x9449('0x51')]({},_0x2a3d7,_0x2fc246[_0x9449('0x53')]);return db[_0x9449('0x91')][_0x9449('0x31')]({'where':_0x2a3d7[_0x9449('0x4f')]})[_0x9449('0x23')](function(_0x99176f){_0x5384c[_0x9449('0x31')]=_0x99176f;if(_0x2fc246[_0x9449('0x48')][_0x9449('0x54')]){_0x2a3d7[_0x9449('0x55')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x9449('0xa1')],'as':_0x9449('0xb4'),'attributes':[_0x9449('0x3b'),_0x9449('0xb5'),_0x9449('0xb6')],'required':![]},{'model':db['Tag'],'as':_0x9449('0xb7'),'attributes':['id',_0x9449('0x3b'),'color'],'where':_0x2fc246['query'][_0x9449('0xb8')]?{'id':_0x2fc246['query'][_0x9449('0xb8')]}:undefined,'required':_0x2fc246[_0x9449('0x48')]['tag']?!![]:![]}];}return db[_0x9449('0x91')][_0x9449('0x56')](_0x2a3d7);})[_0x9449('0x23')](function(_0x1e08b0){_0x5384c[_0x9449('0x57')]=_0x1e08b0;return _0x5384c;});}})['then'](respondWithFilteredResult(_0x16ff50,_0x2a3d7))[_0x9449('0x2d')](handleError(_0x16ff50,null));};exports[_0x9449('0xb9')]=function(_0x3cfa70,_0x499860,_0x4b0b77){return db[_0x9449('0x40')][_0x9449('0x5b')]({'where':{'id':_0x3cfa70['params']['id']}})['then'](handleEntityNotFound(_0x499860,null))[_0x9449('0x23')](function(_0x10251b){if(_0x10251b){return _0x10251b[_0x9449('0xb9')](_0x3cfa70[_0x9449('0x63')][_0x9449('0x6d')],_[_0x9449('0xba')](_0x3cfa70['body'],[_0x9449('0x6d'),'id'])||{})['spread'](function(_0x451736){for(var _0x52b72b=0x0;_0x52b72b<_0x3cfa70['body'][_0x9449('0x6d')]['length'];_0x52b72b+=0x1){socket[_0x9449('0xbb')](_0x9449('0xbc'),{'UserId':Number(_0x3cfa70[_0x9449('0x63')][_0x9449('0x6d')][_0x52b72b]),'OpenchannelAccountId':Number(_0x3cfa70[_0x9449('0x59')]['id'])});}return _0x451736;});}})['then'](respondWithResult(_0x499860,null))[_0x9449('0x2d')](handleError(_0x499860,null));};exports[_0x9449('0xbd')]=function(_0x93484d,_0x47e5e6,_0x210465){return db['OpenchannelAccount'][_0x9449('0x5b')]({'where':{'id':_0x93484d['params']['id']}})[_0x9449('0x23')](handleEntityNotFound(_0x47e5e6,null))[_0x9449('0x23')](function(_0x44cffa){if(_0x44cffa){return _0x44cffa[_0x9449('0xbd')](_0x93484d[_0x9449('0x48')][_0x9449('0x6d')])[_0x9449('0x23')](function(){if(_[_0x9449('0xbe')](_0x93484d['query'][_0x9449('0x6d')])){for(var _0x12362e=0x0;_0x12362e<_0x93484d[_0x9449('0x48')][_0x9449('0x6d')][_0x9449('0x4b')];_0x12362e+=0x1){socket[_0x9449('0xbb')](_0x9449('0xbf'),{'UserId':Number(_0x93484d[_0x9449('0x48')][_0x9449('0x6d')][_0x12362e]),'OpenchannelAccountId':Number(_0x93484d[_0x9449('0x59')]['id'])});}}else{socket[_0x9449('0xbb')](_0x9449('0xbf'),{'UserId':Number(_0x93484d[_0x9449('0x48')][_0x9449('0x6d')]),'OpenchannelAccountId':Number(_0x93484d[_0x9449('0x59')]['id'])});}});}})[_0x9449('0x23')](respondWithStatusCode(_0x47e5e6,null))['catch'](handleError(_0x47e5e6,null));};exports[_0x9449('0xc0')]=function(_0x38bca4,_0x51b1e5,_0x5eeedc){var _0x48d2bc={};var _0x2aec6c={};var _0x4e2ceb;var _0x2ff488;return db['OpenchannelAccount'][_0x9449('0x69')]({'where':{'id':_0x38bca4[_0x9449('0x59')]['id']}})[_0x9449('0x23')](handleEntityNotFound(_0x51b1e5,null))['then'](function(_0x4155bf){if(_0x4155bf){_0x4e2ceb=_0x4155bf;_0x2aec6c['model']=_['keys'](db[_0x9449('0xa1')][_0x9449('0x41')]);_0x2aec6c['query']=_[_0x9449('0x5a')](_0x38bca4[_0x9449('0x48')]);_0x2aec6c[_0x9449('0x46')]=_[_0x9449('0x47')](_0x2aec6c[_0x9449('0x45')],_0x2aec6c[_0x9449('0x48')]);_0x48d2bc[_0x9449('0x49')]=_['intersection'](_0x2aec6c[_0x9449('0x45')],qs['fields'](_0x38bca4[_0x9449('0x48')][_0x9449('0x4a')]));_0x48d2bc[_0x9449('0x49')]=_0x48d2bc['attributes']['length']?_0x48d2bc[_0x9449('0x49')]:_0x2aec6c['model'];_0x48d2bc['order']=qs[_0x9449('0x4e')](_0x38bca4['query'][_0x9449('0x4e')]);_0x48d2bc[_0x9449('0x4f')]=qs[_0x9449('0x46')](_['pick'](_0x38bca4['query'],_0x2aec6c['filters']));if(_0x38bca4[_0x9449('0x48')][_0x9449('0x50')]){_0x48d2bc[_0x9449('0x4f')]=_[_0x9449('0x51')](_0x48d2bc[_0x9449('0x4f')],{'$or':_[_0x9449('0x52')](_0x48d2bc[_0x9449('0x49')],function(_0x57db1d){var _0xa3624b={};_0xa3624b[_0x57db1d]={'$like':'%'+_0x38bca4['query'][_0x9449('0x50')]+'%'};return _0xa3624b;})});}_0x48d2bc=_[_0x9449('0x51')]({},_0x48d2bc,_0x38bca4['options']);return _0x4e2ceb[_0x9449('0xc0')](_0x48d2bc);}})[_0x9449('0x23')](function(_0x2289a2){if(_0x2289a2){_0x2ff488=_0x2289a2[_0x9449('0x4b')];if(!_0x38bca4[_0x9449('0x48')][_0x9449('0x4c')](_0x9449('0x6a'))){_0x48d2bc[_0x9449('0x33')]=qs['limit'](_0x38bca4[_0x9449('0x48')]['limit']);_0x48d2bc['offset']=qs['offset'](_0x38bca4[_0x9449('0x48')]['offset']);}return _0x4e2ceb[_0x9449('0xc0')](_0x48d2bc);}})[_0x9449('0x23')](function(_0x5bdf4d){if(_0x5bdf4d){return _0x5bdf4d?{'count':_0x2ff488,'rows':_0x5bdf4d}:null;}})[_0x9449('0x23')](respondWithResult(_0x51b1e5,null))[_0x9449('0x2d')](handleError(_0x51b1e5,null));};exports['send']=function(_0x28369d,_0x1262bb,_0x177bbe){var _0x1c9682,_0x2119d2,_0x1ad26a;if(_['isNil'](_0x28369d[_0x9449('0x63')][_0x9449('0x63')])||_0x28369d[_0x9449('0x63')][_0x9449('0x63')]===''){throw new db[(_0x9449('0x73'))][(_0x9449('0x74'))](_0x9449('0x7d'));}if(_[_0x9449('0x7a')](_0x28369d['body']['to'])){}_0x1c9682=_0x28369d[_0x9449('0x63')]['to'];return db[_0x9449('0x40')][_0x9449('0x69')]({'where':{'id':_0x28369d[_0x9449('0x59')]['id']}})[_0x9449('0x23')](handleEntityNotFound(_0x1262bb,null))['then'](function(_0x4dd8c8){if(_0x4dd8c8){return db[_0x9449('0x40')][_0x9449('0x5b')]({'where':{'id':_0x4dd8c8['id']},'include':[{'model':db[_0x9449('0x82')],'as':'List','include':[{'model':db[_0x9449('0x8d')],'as':_0x9449('0x84'),'where':{[_0x4dd8c8[_0x9449('0x7e')]]:_0x1c9682},'limit':0x1,'order':[[_0x9449('0x77'),_0x9449('0x85')]]}]}]})[_0x9449('0x23')](handleEntityNotFound(_0x1262bb,null))[_0x9449('0x23')](function(_0x5e36f8){if(_0x5e36f8&&_0x5e36f8[_0x9449('0x83')]){_0x2119d2=_0x5e36f8['get']({'plain':!![]});if(_0x2119d2[_0x9449('0x83')]&&_0x2119d2['List'][_0x9449('0x84')][_0x9449('0x4b')]){return _0x2119d2[_0x9449('0x83')][_0x9449('0x84')][0x0];}return db['CmContact']['create'](_[_0x9449('0x1a')](_0x28369d['body'],{'firstName':_0x1c9682,[_0x5e36f8[_0x9449('0x7e')]]:_0x1c9682,'phone':_0x1c9682,'ListId':_0x2119d2[_0x9449('0x79')]}));}})[_0x9449('0x23')](handleEntityNotFound(_0x1262bb,null))[_0x9449('0x23')](function(_0x571de1){if(_0x571de1){_0x1ad26a=_0x571de1;return db[_0x9449('0x91')]['find']({'where':{'ContactId':_0x1ad26a['id'],'closed':![],'OpenchannelAccountId':_0x2119d2['id']}})[_0x9449('0x23')](function(_0x37da0b){if(_0x37da0b){return[_0x37da0b,![]];}return db[_0x9449('0x91')][_0x9449('0x5c')]({'UserId':_0x28369d[_0x9449('0x5d')]['id'],'ContactId':_0x1ad26a['id'],'OpenchannelAccountId':_0x2119d2['id'],'lastMsgDirection':'out','firstMsgDirection':_0x9449('0xc1'),'Messages':[_[_0x9449('0x51')](_0x28369d[_0x9449('0x63')],{'read':![],'body':_0x28369d[_0x9449('0x63')][_0x9449('0x63')],'OpenchannelAccountId':_0x2119d2['id'],'UserId':_0x28369d[_0x9449('0x5d')]['id'],'ContactId':_0x1ad26a['id']})]},{'include':[{'model':db[_0x9449('0x9e')],'as':'Messages'}]})['then'](function(_0x42e1cb){return[_0x42e1cb,!![]];});});}})[_0x9449('0x93')](function(_0x35d156,_0x511e2e){if(_0x511e2e){return _0x35d156;}return db[_0x9449('0x9e')][_0x9449('0x5c')](_['merge'](_0x28369d['body'],{'read':![],'body':_0x28369d['body'][_0x9449('0x63')],'OpenchannelAccountId':_0x2119d2['id'],'OpenchannelInteractionId':_0x35d156['id'],'UserId':_0x28369d[_0x9449('0x5d')]['id'],'ContactId':_0x1ad26a['id']}))[_0x9449('0x23')](function(_0x49839d){_0x35d156[_0x9449('0xc2')]['Messages']=[];_0x35d156[_0x9449('0xc2')][_0x9449('0xc3')][_0x9449('0x9a')](_0x49839d['dataValues']);return _0x35d156;});});}})['then'](respondWithResult(_0x1262bb,null))[_0x9449('0x2d')](handleError(_0x1262bb,null));}; \ No newline at end of file +var _0x689c=['client','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','get','UserProfileResource','destroy','name','index','mandatoryDispositionPause','map','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','options','OpenchannelAccount','include','findAll','rows','show','Pause','keys','rawAttributes','includeAll','find','create','body','role','user','OpenchannelAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','removeDispositions','ids','addAnswer','findOne','CannedAnswer','order','removeAnswers','notify','openchannel','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','applications','list','priority','asc','account','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','created','interaction','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelAccountId','bulkCreate','findAndCountAll','send','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','out','Messages','spread','dataValues','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','jayson/promise','http'];(function(_0x7e606f,_0x47cb7a){var _0x478ddd=function(_0x430f06){while(--_0x430f06){_0x7e606f['push'](_0x7e606f['shift']());}};_0x478ddd(++_0x47cb7a);}(_0x689c,0x9e));var _0xc689=function(_0x5200f9,_0x4a0063){_0x5200f9=_0x5200f9-0x0;var _0x540c7a=_0x689c[_0x5200f9];return _0x540c7a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc689('0x0'));var jsonpatch=require(_0xc689('0x1'));var rp=require(_0xc689('0x2'));var moment=require(_0xc689('0x3'));var BPromise=require(_0xc689('0x4'));var Mustache=require(_0xc689('0x5'));var util=require('util');var path=require(_0xc689('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc689('0x7'));var fs=require('fs');var fs_extra=require(_0xc689('0x8'));var _=require(_0xc689('0x9'));var squel=require(_0xc689('0xa'));var crypto=require(_0xc689('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc689('0xc'));var toCsv=require(_0xc689('0xd'));var querystring=require(_0xc689('0xe'));var Papa=require('papaparse');var Redis=require(_0xc689('0xf'));var authService=require(_0xc689('0x10'));var qs=require(_0xc689('0x11'));var as=require(_0xc689('0x12'));var hardwareService=require(_0xc689('0x13'));var logger=require(_0xc689('0x14'))(_0xc689('0x15'));var utils=require(_0xc689('0x16'));var config=require(_0xc689('0x17'));var licenseUtil=require(_0xc689('0x18'));var db=require(_0xc689('0x19'))['db'];config['redis']=_[_0xc689('0x1a')](config['redis'],{'host':_0xc689('0x1b'),'port':0x18eb});var socket=require(_0xc689('0x1c'))(new Redis(config[_0xc689('0x1d')]));require('./openchannelAccount.socket')[_0xc689('0x1e')](socket);var jayson=require(_0xc689('0x1f'));var client=jayson['client'][_0xc689('0x20')]({'port':0x232c});var client9002=jayson[_0xc689('0x21')][_0xc689('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x335e3e,_0x5ec591,_0x5b7eea,_0x141c7c){return new BPromise(function(_0x214ca0,_0x42d12f){var _0x4a1442=_0x141c7c||client;return _0x4a1442['request'](_0x335e3e,_0x5b7eea)[_0xc689('0x22')](function(_0x1edaef){logger[_0xc689('0x23')](_0xc689('0x24'),_0x5ec591,_0xc689('0x25'));logger[_0xc689('0x26')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5ec591,_0xc689('0x25'),JSON[_0xc689('0x27')](_0x1edaef));if(_0x1edaef['error']){if(_0x1edaef['error']['code']===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5ec591,_0x1edaef[_0xc689('0x28')][_0xc689('0x29')]);return _0x42d12f(_0x1edaef[_0xc689('0x28')][_0xc689('0x29')]);}logger[_0xc689('0x28')](_0xc689('0x24'),_0x5ec591,_0x1edaef[_0xc689('0x28')][_0xc689('0x29')]);return _0x214ca0(_0x1edaef[_0xc689('0x28')][_0xc689('0x29')]);}else{logger[_0xc689('0x23')](_0xc689('0x24'),_0x5ec591,_0xc689('0x25'));_0x214ca0(_0x1edaef[_0xc689('0x2a')][_0xc689('0x29')]);}})[_0xc689('0x2b')](function(_0x3bca6d){logger[_0xc689('0x28')](_0xc689('0x24'),_0x5ec591,_0x3bca6d);_0x42d12f(_0x3bca6d);});});}function respondWithStatusCode(_0x28d0b8,_0x55acf3){_0x55acf3=_0x55acf3||0xcc;return function(_0xa8f231){if(_0xa8f231){return _0x28d0b8[_0xc689('0x2c')](_0x55acf3);}return _0x28d0b8['status'](_0x55acf3)[_0xc689('0x2d')]();};}function respondWithResult(_0x1c01a4,_0x35b570){_0x35b570=_0x35b570||0xc8;return function(_0x4644ae){if(_0x4644ae){return _0x1c01a4[_0xc689('0x2e')](_0x35b570)[_0xc689('0x2f')](_0x4644ae);}};}function respondWithFilteredResult(_0x582d76,_0x60afcf){return function(_0x5a9d43){if(_0x5a9d43){var _0x9c114d=typeof _0x60afcf['offset']===_0xc689('0x30')&&typeof _0x60afcf[_0xc689('0x31')]==='undefined';var _0x52bd4b=_0x5a9d43[_0xc689('0x32')];var _0x2ebacf=_0x9c114d?0x0:_0x60afcf[_0xc689('0x33')];var _0x455b33=_0x9c114d?_0x5a9d43[_0xc689('0x32')]:_0x60afcf[_0xc689('0x33')]+_0x60afcf[_0xc689('0x31')];var _0x6af206;if(_0x455b33>=_0x52bd4b){_0x455b33=_0x52bd4b;_0x6af206=0xc8;}else{_0x6af206=0xce;}_0x582d76['status'](_0x6af206);return _0x582d76[_0xc689('0x34')]('Content-Range',_0x2ebacf+'-'+_0x455b33+'/'+_0x52bd4b)['json'](_0x5a9d43);}return null;};}function patchUpdates(_0x49369e){return function(_0x27545a){try{jsonpatch[_0xc689('0x35')](_0x27545a,_0x49369e,!![]);}catch(_0x13727f){return BPromise[_0xc689('0x36')](_0x13727f);}return _0x27545a[_0xc689('0x37')]();};}function saveUpdates(_0x5ca8b9,_0x213877){return function(_0x2bb964){if(_0x2bb964){return _0x2bb964[_0xc689('0x38')](_0x5ca8b9)['then'](function(_0x9bbfaa){return _0x9bbfaa;});}return null;};}function removeEntity(_0x154a39,_0x220746){return function(_0x3c3b35){if(_0x3c3b35){return _0x3c3b35['destroy']()[_0xc689('0x22')](function(){var _0x63b927=_0x3c3b35[_0xc689('0x39')]({'plain':!![]});var _0x2ea698='OpenchannelAccounts';return db[_0xc689('0x3a')][_0xc689('0x3b')]({'where':{'type':_0x2ea698,'resourceId':_0x63b927['id']}})['then'](function(){return _0x3c3b35;});})[_0xc689('0x22')](function(){_0x154a39[_0xc689('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b7348,_0x58337c){return function(_0x4d5c82){if(!_0x4d5c82){_0x4b7348['sendStatus'](0x194);}return _0x4d5c82;};}function handleError(_0x2c5ace,_0xe5b8d0){_0xe5b8d0=_0xe5b8d0||0x1f4;return function(_0x178aa8){logger[_0xc689('0x28')](_0x178aa8['stack']);if(_0x178aa8[_0xc689('0x3c')]){delete _0x178aa8[_0xc689('0x3c')];}_0x2c5ace['status'](_0xe5b8d0)['send'](_0x178aa8);};}exports[_0xc689('0x3d')]=function(_0x4e42f5,_0x2a86ac){var _0x103b75={'include':[{'model':db['Pause'],'as':_0xc689('0x3e')}]},_0x122668={},_0x4ec548={'count':0x0,'rows':[]};var _0x189124=_[_0xc689('0x3f')](db['OpenchannelAccount']['rawAttributes'],function(_0x45f7b1){return{'name':_0x45f7b1[_0xc689('0x40')],'type':_0x45f7b1[_0xc689('0x41')]['key']};});_0x122668[_0xc689('0x42')]=_[_0xc689('0x3f')](_0x189124,_0xc689('0x3c'));_0x122668[_0xc689('0x43')]=_['keys'](_0x4e42f5['query']);_0x122668['filters']=_['intersection'](_0x122668[_0xc689('0x42')],_0x122668[_0xc689('0x43')]);_0x103b75['attributes']=_[_0xc689('0x44')](_0x122668[_0xc689('0x42')],qs[_0xc689('0x45')](_0x4e42f5[_0xc689('0x43')][_0xc689('0x45')]));_0x103b75[_0xc689('0x46')]=_0x103b75[_0xc689('0x46')][_0xc689('0x47')]?_0x103b75['attributes']:_0x122668[_0xc689('0x42')];if(!_0x4e42f5[_0xc689('0x43')][_0xc689('0x48')](_0xc689('0x49'))){_0x103b75['limit']=qs[_0xc689('0x31')](_0x4e42f5[_0xc689('0x43')]['limit']);_0x103b75[_0xc689('0x33')]=qs[_0xc689('0x33')](_0x4e42f5['query'][_0xc689('0x33')]);}_0x103b75['order']=qs[_0xc689('0x4a')](_0x4e42f5['query'][_0xc689('0x4a')]);_0x103b75['where']=qs[_0xc689('0x4b')](_[_0xc689('0x4c')](_0x4e42f5['query'],_0x122668[_0xc689('0x4b')]),_0x189124);if(_0x4e42f5[_0xc689('0x43')][_0xc689('0x4d')]){_0x103b75[_0xc689('0x4e')]=_['merge'](_0x103b75[_0xc689('0x4e')],{'$or':_['map'](_0x189124,function(_0x7a4c8e){if(_0x7a4c8e['type']!==_0xc689('0x4f')){var _0x164561={};_0x164561[_0x7a4c8e[_0xc689('0x3c')]]={'$like':'%'+_0x4e42f5['query'][_0xc689('0x4d')]+'%'};return _0x164561;}})});}_0x103b75=_[_0xc689('0x50')]({},_0x103b75,_0x4e42f5[_0xc689('0x51')]);var _0x2bd467={'where':_0x103b75[_0xc689('0x4e')]};return db[_0xc689('0x52')][_0xc689('0x32')](_0x2bd467)[_0xc689('0x22')](function(_0x2fb387){_0x4ec548[_0xc689('0x32')]=_0x2fb387;if(_0x4e42f5['query']['includeAll']){_0x103b75[_0xc689('0x53')]=[{'all':!![]}];}return db[_0xc689('0x52')][_0xc689('0x54')](_0x103b75);})[_0xc689('0x22')](function(_0x1b5392){_0x4ec548[_0xc689('0x55')]=_0x1b5392;return _0x4ec548;})['then'](respondWithFilteredResult(_0x2a86ac,_0x103b75))[_0xc689('0x2b')](handleError(_0x2a86ac,null));};exports[_0xc689('0x56')]=function(_0x4d6104,_0x255101){var _0x5c1226={'raw':![],'where':{'id':_0x4d6104['params']['id']},'include':[{'model':db[_0xc689('0x57')],'as':_0xc689('0x3e')}]},_0xe9a827={};_0xe9a827[_0xc689('0x42')]=_[_0xc689('0x58')](db[_0xc689('0x52')][_0xc689('0x59')]);_0xe9a827[_0xc689('0x43')]=_['keys'](_0x4d6104['query']);_0xe9a827[_0xc689('0x4b')]=_[_0xc689('0x44')](_0xe9a827['model'],_0xe9a827['query']);_0x5c1226[_0xc689('0x46')]=_['intersection'](_0xe9a827['model'],qs[_0xc689('0x45')](_0x4d6104[_0xc689('0x43')][_0xc689('0x45')]));_0x5c1226[_0xc689('0x46')]=_0x5c1226['attributes'][_0xc689('0x47')]?_0x5c1226[_0xc689('0x46')]:_0xe9a827[_0xc689('0x42')];if(_0x4d6104[_0xc689('0x43')][_0xc689('0x5a')]){_0x5c1226[_0xc689('0x53')]=[{'all':!![]}];}_0x5c1226=_[_0xc689('0x50')]({},_0x5c1226,_0x4d6104[_0xc689('0x51')]);return db[_0xc689('0x52')][_0xc689('0x5b')](_0x5c1226)[_0xc689('0x22')](handleEntityNotFound(_0x255101,null))['then'](respondWithResult(_0x255101,null))['catch'](handleError(_0x255101,null));};exports[_0xc689('0x5c')]=function(_0x56bff9,_0x1427b0){return db['OpenchannelAccount']['create'](_0x56bff9[_0xc689('0x5d')],{})[_0xc689('0x22')](function(_0x46d71d){var _0x5c5564=_0x56bff9['user'][_0xc689('0x39')]({'plain':!![]});if(!_0x5c5564)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c5564[_0xc689('0x5e')]===_0xc689('0x5f')){var _0x1108c7=_0x46d71d[_0xc689('0x39')]({'plain':!![]});var _0x4337c9=_0xc689('0x60');return db['UserProfileSection'][_0xc689('0x5b')]({'where':{'name':_0x4337c9,'userProfileId':_0x5c5564['userProfileId']},'raw':!![]})[_0xc689('0x22')](function(_0x447b35){if(_0x447b35&&_0x447b35[_0xc689('0x61')]===0x0){return db['UserProfileResource'][_0xc689('0x5c')]({'name':_0x1108c7[_0xc689('0x3c')],'resourceId':_0x1108c7['id'],'type':_0x447b35[_0xc689('0x3c')],'sectionId':_0x447b35['id']},{})[_0xc689('0x22')](function(){return _0x46d71d;});}else{return _0x46d71d;}})[_0xc689('0x2b')](function(_0x5bde1a){logger['error'](_0xc689('0x62'),_0x5bde1a);throw _0x5bde1a;});}return _0x46d71d;})[_0xc689('0x22')](respondWithResult(_0x1427b0,0xc9))[_0xc689('0x2b')](handleError(_0x1427b0,null));};exports[_0xc689('0x38')]=function(_0x431110,_0x1cd39a){if(_0x431110[_0xc689('0x5d')]['id']){delete _0x431110['body']['id'];}return db[_0xc689('0x52')][_0xc689('0x5b')]({'where':{'id':_0x431110[_0xc689('0x63')]['id']},'include':[{'model':db['Pause'],'as':_0xc689('0x3e')}]})['then'](handleEntityNotFound(_0x1cd39a,null))[_0xc689('0x22')](saveUpdates(_0x431110[_0xc689('0x5d')],null))[_0xc689('0x22')](respondWithResult(_0x1cd39a,null))[_0xc689('0x2b')](handleError(_0x1cd39a,null));};exports[_0xc689('0x3b')]=function(_0x1a4d14,_0x8a2337){return db[_0xc689('0x52')]['find']({'where':{'id':_0x1a4d14[_0xc689('0x63')]['id']}})[_0xc689('0x22')](handleEntityNotFound(_0x8a2337,null))[_0xc689('0x22')](removeEntity(_0x8a2337,null))[_0xc689('0x2b')](handleError(_0x8a2337,null));};exports[_0xc689('0x64')]=function(_0x2c2512,_0x3e793b){return db[_0xc689('0x52')][_0xc689('0x64')]()[_0xc689('0x22')](respondWithResult(_0x3e793b,null))[_0xc689('0x2b')](handleError(_0x3e793b,null));};exports[_0xc689('0x65')]=function(_0x12840f,_0xdae8e4,_0x4252ea){if(_0x12840f[_0xc689('0x5d')]['id']){delete _0x12840f['body']['id'];}return db['OpenchannelAccount'][_0xc689('0x5b')]({'where':{'id':_0x12840f['params']['id']}})[_0xc689('0x22')](handleEntityNotFound(_0xdae8e4,null))[_0xc689('0x22')](function(_0x4a62cf){if(_0x4a62cf){_0x12840f[_0xc689('0x5d')]['OpenchannelAccountId']=_0x4a62cf['id'];return db[_0xc689('0x66')][_0xc689('0x5c')](_0x12840f[_0xc689('0x5d')]);}})['then'](respondWithResult(_0xdae8e4,null))[_0xc689('0x2b')](handleError(_0xdae8e4,null));};exports[_0xc689('0x67')]=function(_0x1ffab7,_0x55b847,_0x1c6c22){var _0x92329a={'raw':![],'where':{}};var _0x415c50={};var _0x88664d={'count':0x0,'rows':[]};return db[_0xc689('0x52')]['findOne']({'where':{'id':_0x1ffab7[_0xc689('0x63')]['id']}})['then'](handleEntityNotFound(_0x55b847,null))[_0xc689('0x22')](function(_0x2c67c6){if(_0x2c67c6){_0x415c50['model']=_[_0xc689('0x58')](db[_0xc689('0x66')][_0xc689('0x59')]);_0x415c50[_0xc689('0x43')]=_[_0xc689('0x58')](_0x1ffab7[_0xc689('0x43')]);_0x415c50['filters']=_[_0xc689('0x44')](_0x415c50[_0xc689('0x42')],_0x415c50['query']);_0x92329a[_0xc689('0x46')]=_[_0xc689('0x44')](_0x415c50[_0xc689('0x42')],qs['fields'](_0x1ffab7['query']['fields']));_0x92329a[_0xc689('0x46')]=_0x92329a['attributes']['length']?_0x92329a[_0xc689('0x46')]:_0x415c50[_0xc689('0x42')];if(!_0x1ffab7[_0xc689('0x43')]['hasOwnProperty'](_0xc689('0x49'))){_0x92329a[_0xc689('0x31')]=qs[_0xc689('0x31')](_0x1ffab7[_0xc689('0x43')][_0xc689('0x31')]);_0x92329a['offset']=qs[_0xc689('0x33')](_0x1ffab7[_0xc689('0x43')][_0xc689('0x33')]);}_0x92329a['order']=qs['sort'](_0x1ffab7[_0xc689('0x43')][_0xc689('0x4a')]);_0x92329a['where']=qs[_0xc689('0x4b')](_[_0xc689('0x4c')](_0x1ffab7[_0xc689('0x43')],_0x415c50[_0xc689('0x4b')]));_0x92329a['where']['OpenchannelAccountId']=_0x2c67c6['id'];if(_0x1ffab7['query'][_0xc689('0x4d')]){_0x92329a['where']=_[_0xc689('0x50')](_0x92329a[_0xc689('0x4e')],{'$or':_['map'](_0x92329a[_0xc689('0x46')],function(_0x384672){var _0x1ed27b={};_0x1ed27b[_0x384672]={'$like':'%'+_0x1ffab7[_0xc689('0x43')][_0xc689('0x4d')]+'%'};return _0x1ed27b;})});}_0x92329a=_[_0xc689('0x50')]({},_0x92329a,_0x1ffab7[_0xc689('0x51')]);return db['Disposition']['count']({'where':_0x92329a['where']})[_0xc689('0x22')](function(_0x368bd2){_0x88664d[_0xc689('0x32')]=_0x368bd2;if(_0x1ffab7[_0xc689('0x43')][_0xc689('0x5a')]){_0x92329a[_0xc689('0x53')]=[{'all':!![]}];}return db[_0xc689('0x66')][_0xc689('0x54')](_0x92329a);})[_0xc689('0x22')](function(_0x4e5b1b){_0x88664d[_0xc689('0x55')]=_0x4e5b1b;return _0x88664d;});}})[_0xc689('0x22')](respondWithFilteredResult(_0x55b847,_0x92329a))[_0xc689('0x2b')](handleError(_0x55b847,null));};exports[_0xc689('0x68')]=function(_0xb53aea,_0x58fa88,_0x8c9860){return db[_0xc689('0x52')][_0xc689('0x5b')]({'where':{'id':_0xb53aea[_0xc689('0x63')]['id']}})['then'](handleEntityNotFound(_0x58fa88,null))[_0xc689('0x22')](function(_0x4af5dc){if(_0x4af5dc){return _0x4af5dc['removeDispositions'](_0xb53aea[_0xc689('0x43')][_0xc689('0x69')]);}})[_0xc689('0x22')](respondWithStatusCode(_0x58fa88,null))[_0xc689('0x2b')](handleError(_0x58fa88,null));};exports[_0xc689('0x6a')]=function(_0x104af8,_0x2727fe,_0x3ae9fc){if(_0x104af8['body']['id']){delete _0x104af8[_0xc689('0x5d')]['id'];}return db[_0xc689('0x52')][_0xc689('0x5b')]({'where':{'id':_0x104af8[_0xc689('0x63')]['id']}})[_0xc689('0x22')](handleEntityNotFound(_0x2727fe,null))[_0xc689('0x22')](function(_0xf483f5){if(_0xf483f5){_0x104af8[_0xc689('0x5d')]['OpenchannelAccountId']=_0xf483f5['id'];return db['CannedAnswer'][_0xc689('0x5c')](_0x104af8[_0xc689('0x5d')]);}})['then'](respondWithResult(_0x2727fe,null))[_0xc689('0x2b')](handleError(_0x2727fe,null));};exports['getAnswers']=function(_0x215ca4,_0xbd8b5b,_0x1dd5b6){var _0x27c952={'raw':![],'where':{}};var _0x4db96d={};var _0x2b97f={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xc689('0x6b')]({'where':{'id':_0x215ca4[_0xc689('0x63')]['id']}})[_0xc689('0x22')](handleEntityNotFound(_0xbd8b5b,null))['then'](function(_0x3f2eb4){if(_0x3f2eb4){_0x4db96d['model']=_['keys'](db[_0xc689('0x6c')][_0xc689('0x59')]);_0x4db96d[_0xc689('0x43')]=_['keys'](_0x215ca4['query']);_0x4db96d[_0xc689('0x4b')]=_[_0xc689('0x44')](_0x4db96d[_0xc689('0x42')],_0x4db96d[_0xc689('0x43')]);_0x27c952[_0xc689('0x46')]=_['intersection'](_0x4db96d['model'],qs['fields'](_0x215ca4[_0xc689('0x43')]['fields']));_0x27c952[_0xc689('0x46')]=_0x27c952['attributes']['length']?_0x27c952[_0xc689('0x46')]:_0x4db96d[_0xc689('0x42')];if(!_0x215ca4[_0xc689('0x43')][_0xc689('0x48')]('nolimit')){_0x27c952[_0xc689('0x31')]=qs[_0xc689('0x31')](_0x215ca4[_0xc689('0x43')]['limit']);_0x27c952[_0xc689('0x33')]=qs[_0xc689('0x33')](_0x215ca4[_0xc689('0x43')][_0xc689('0x33')]);}_0x27c952[_0xc689('0x6d')]=qs[_0xc689('0x4a')](_0x215ca4[_0xc689('0x43')][_0xc689('0x4a')]);_0x27c952[_0xc689('0x4e')]=qs[_0xc689('0x4b')](_[_0xc689('0x4c')](_0x215ca4[_0xc689('0x43')],_0x4db96d['filters']));_0x27c952[_0xc689('0x4e')]['OpenchannelAccountId']=_0x3f2eb4['id'];if(_0x215ca4[_0xc689('0x43')]['filter']){_0x27c952[_0xc689('0x4e')]=_[_0xc689('0x50')](_0x27c952[_0xc689('0x4e')],{'$or':_[_0xc689('0x3f')](_0x27c952[_0xc689('0x46')],function(_0x504586){var _0x23197e={};_0x23197e[_0x504586]={'$like':'%'+_0x215ca4[_0xc689('0x43')][_0xc689('0x4d')]+'%'};return _0x23197e;})});}_0x27c952=_[_0xc689('0x50')]({},_0x27c952,_0x215ca4[_0xc689('0x51')]);return db[_0xc689('0x6c')][_0xc689('0x32')]({'where':_0x27c952[_0xc689('0x4e')]})[_0xc689('0x22')](function(_0x1fa7e7){_0x2b97f[_0xc689('0x32')]=_0x1fa7e7;if(_0x215ca4['query'][_0xc689('0x5a')]){_0x27c952[_0xc689('0x53')]=[{'all':!![]}];}return db[_0xc689('0x6c')]['findAll'](_0x27c952);})[_0xc689('0x22')](function(_0x12169c){_0x2b97f[_0xc689('0x55')]=_0x12169c;return _0x2b97f;});}})[_0xc689('0x22')](respondWithFilteredResult(_0xbd8b5b,_0x27c952))[_0xc689('0x2b')](handleError(_0xbd8b5b,null));};exports[_0xc689('0x6e')]=function(_0x2a191c,_0x50b68b,_0x215858){return db[_0xc689('0x52')][_0xc689('0x5b')]({'where':{'id':_0x2a191c[_0xc689('0x63')]['id']}})[_0xc689('0x22')](handleEntityNotFound(_0x50b68b,null))[_0xc689('0x22')](function(_0x1dc085){if(_0x1dc085){return _0x1dc085[_0xc689('0x6e')](_0x2a191c[_0xc689('0x43')][_0xc689('0x69')]);}})[_0xc689('0x22')](respondWithStatusCode(_0x50b68b,null))[_0xc689('0x2b')](handleError(_0x50b68b,null));};exports[_0xc689('0x6f')]=function(_0x243d7d,_0x52888e,_0x3c303b){var _0x2a71f7={'body':_0x243d7d[_0xc689('0x5d')],'channel':_0xc689('0x70')};var _0x24bd64=[];var _0x121845=[];var _0x128889={};var _0x1294b6=![];return db['CmContact'][_0xc689('0x64')]()['then'](function(_0x26c317){if(!_0x26c317){throw new db['Sequelize'][(_0xc689('0x71'))](_0xc689('0x72'));}_0x24bd64=_[_0xc689('0x73')](_[_0xc689('0x58')](_0x26c317),[_0xc689('0x74'),_0xc689('0x75')]);_0x121845=_['difference'](_[_0xc689('0x58')](_0x26c317),[_0xc689('0x74'),_0xc689('0x75'),_0xc689('0x76'),'ListId']);if(_0x243d7d[_0xc689('0x5d')]['id']){delete _0x243d7d[_0xc689('0x5d')]['id'];}if(_[_0xc689('0x77')](_0x243d7d[_0xc689('0x5d')]['from'])){throw new db[(_0xc689('0x78'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xc689('0x77')](_0x243d7d['body']['body'])||_0x243d7d[_0xc689('0x5d')][_0xc689('0x5d')]===''){throw new db['Sequelize'][(_0xc689('0x71'))](_0xc689('0x79'));}if(_['isNil'](_0x243d7d[_0xc689('0x5d')][_0xc689('0x7a')])){throw new db[(_0xc689('0x78'))][(_0xc689('0x71'))](_0xc689('0x7b')+_0x121845);}if(!_[_0xc689('0x7c')](_0x121845,_0x243d7d[_0xc689('0x5d')][_0xc689('0x7a')])){throw new db[(_0xc689('0x78'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x121845);}_0x128889[_0x243d7d[_0xc689('0x5d')][_0xc689('0x7a')]]=_0x243d7d[_0xc689('0x5d')][_0xc689('0x7d')];})[_0xc689('0x22')](function(){return db[_0xc689('0x52')][_0xc689('0x5b')]({'where':{'id':_0x243d7d[_0xc689('0x63')]['id']},'include':[{'model':db['CmList'],'as':_0xc689('0x7e'),'include':[{'model':db[_0xc689('0x7f')],'as':_0xc689('0x80'),'where':_0x128889,'limit':0x1,'order':[[_0xc689('0x75'),_0xc689('0x81')]]}]},{'model':db[_0xc689('0x82')],'as':_0xc689('0x83')}]});})[_0xc689('0x22')](handleEntityNotFound(_0x52888e,null))[_0xc689('0x22')](function(_0x167d4f){if(_0x167d4f&&_0x167d4f[_0xc689('0x7e')]){_0x2a71f7['account']=_0x167d4f;_0x2a71f7[_0xc689('0x84')]=_0x167d4f['Applications'];_0x2a71f7[_0xc689('0x85')]=_0x167d4f[_0xc689('0x7e')];_0x2a71f7['applications']=_['orderBy'](_0x2a71f7[_0xc689('0x84')],[_0xc689('0x86')],[_0xc689('0x87')]);if(_0x2a71f7[_0xc689('0x88')]['Applications']){delete _0x2a71f7[_0xc689('0x88')][_0xc689('0x83')];}if(_0x2a71f7[_0xc689('0x88')]['List']&&_0x2a71f7['account'][_0xc689('0x7e')][_0xc689('0x80')][_0xc689('0x47')]){return _0x2a71f7[_0xc689('0x88')][_0xc689('0x7e')]['Contacts'][0x0];}var _0xa369c=_['defaults'](_0x243d7d['body'],{'firstName':_0x243d7d['body'][_0xc689('0x7d')],'ListId':_0x167d4f[_0xc689('0x89')]});_0xa369c[_0x243d7d['body']['mapKey']]=_0x243d7d[_0xc689('0x5d')][_0xc689('0x7d')];return db['CmContact'][_0xc689('0x5c')](_0xa369c,{'fields':_0x24bd64,'raw':!![]});}})[_0xc689('0x22')](handleEntityNotFound(_0x52888e,null))[_0xc689('0x22')](function(_0x34b92c){_0x2a71f7[_0xc689('0x8a')]=_0x34b92c;if(_0x34b92c){var _0x4d2319={'ContactId':_0x34b92c['id'],'OpenchannelAccountId':_0x243d7d[_0xc689('0x63')]['id'],'from':(_0x34b92c[_0xc689('0x8b')]||'')+'\x20'+(_0x34b92c[_0xc689('0x8c')]||'')};var _0x589d05={'OpenchannelAccountId':_0x243d7d['params']['id'],'closed':![]};if(_0x243d7d[_0xc689('0x5d')][_0xc689('0x8d')]){_0x589d05[_0xc689('0x8d')]=_0x243d7d[_0xc689('0x5d')][_0xc689('0x8d')];return db[_0xc689('0x8e')][_0xc689('0x5b')]({'where':_0x589d05})['then'](function(_0x18208e){if(_0x18208e){return[_0x18208e,![]];}_0x4d2319[_0xc689('0x8d')]=_0x243d7d[_0xc689('0x5d')]['threadId'];_0x4d2319[_0xc689('0x8f')]=_0x243d7d[_0xc689('0x5d')][_0xc689('0x8f')];return db[_0xc689('0x8e')][_0xc689('0x5c')](_0x4d2319)[_0xc689('0x22')](function(_0x9d7cad){return[_0x9d7cad,!![]];});});}else{_0x589d05['threadId']=null;}_0x589d05[_0xc689('0x90')]=_0x34b92c['id'];return db[_0xc689('0x8e')][_0xc689('0x5b')]({'where':_0x589d05})['then'](function(_0x33b693){if(_0x33b693){return[_0x33b693,![]];}return db[_0xc689('0x8e')][_0xc689('0x5c')](_0x4d2319)['then'](function(_0xce16f9){return[_0xce16f9,!![]];});});}})['spread'](function(_0xf949de,_0x3af063){if(_0xf949de){_0x1294b6=_0x3af063;if(!_0x3af063){var _0x39fbd9={'from':(_0x2a71f7[_0xc689('0x8a')]['firstName']||'')+'\x20'+(_0x2a71f7['contact'][_0xc689('0x8c')]||'')};if(_0x243d7d['body'][_0xc689('0x8d')]&&_0x243d7d['body'][_0xc689('0x91')]&&_0x243d7d['body'][_0xc689('0x8d')]!=_0x243d7d['body'][_0xc689('0x91')]){_0x39fbd9['threadId']=_0x243d7d[_0xc689('0x5d')]['messageId'];}return _0xf949de[_0xc689('0x38')](_0x39fbd9);}else{return _0xf949de;}}})[_0xc689('0x22')](function(_0x215249){_0x2a71f7['interaction']=_0x215249[_0xc689('0x39')]({'plain':!![]});_0x2a71f7['interaction'][_0xc689('0x92')]=_0x1294b6;if(_0x2a71f7[_0xc689('0x93')][_0xc689('0x92')]){if(_0x2a71f7[_0xc689('0x88')][_0xc689('0x94')]){_0x2a71f7[_0xc689('0x84')][_0xc689('0x95')]({'id':0x0,'priority':_0x2a71f7[_0xc689('0x84')][_0xc689('0x47')]+0x1,'app':_0xc689('0x96'),'appdata':_0xc689('0x97'),'interval':_0xc689('0x98')});}}return db[_0xc689('0x99')][_0xc689('0x5c')]({'body':_0x243d7d[_0xc689('0x5d')]['body'],'OpenchannelAccountId':_0x243d7d[_0xc689('0x63')]['id'],'OpenchannelInteractionId':_0x215249['id'],'direction':'in','ContactId':_0x2a71f7[_0xc689('0x8a')]['id'],'AttachmentId':_0x243d7d[_0xc689('0x5d')]['AttachmentId']});})[_0xc689('0x22')](function(_0x2e26b8){_0x2a71f7[_0xc689('0x29')]=_0x2e26b8;if(_0x2a71f7['interaction'][_0xc689('0x9a')]){return db[_0xc689('0x9b')][_0xc689('0x5b')]({'attributes':['id',_0xc689('0x3c')],'where':{'id':_0x2a71f7['interaction'][_0xc689('0x9a')]}})[_0xc689('0x22')](function(_0xe39712){if(_0xe39712){_0x2a71f7[_0xc689('0x84')]['unshift']({'id':0x0,'priority':0x0,'app':_0xc689('0x9c'),'appdata':_0xe39712[_0xc689('0x3c')]+','+(_0x2a71f7[_0xc689('0x88')][_0xc689('0x9d')]||0xa),'interval':_0xc689('0x98')});_0x2a71f7[_0xc689('0x9e')]=![];}return respondWithRpcPromise('Start',_0xc689('0x9f'),_0x2a71f7);});}return respondWithRpcPromise(_0xc689('0xa0'),_0xc689('0x9f'),_0x2a71f7);})[_0xc689('0x22')](function(_0x5c2967){respondWithRpcPromise(_0xc689('0xa1'),_0xc689('0xa1'),{'event':_0xc689('0x6f'),'message':_0x5c2967},client9002);return _0x5c2967;})[_0xc689('0x22')](respondWithResult(_0x52888e,null))[_0xc689('0x2b')](handleError(_0x52888e,null));};exports[_0xc689('0xa2')]=function(_0x1ba228,_0xb19f14){var _0x54263e=_0x1ba228[_0xc689('0x63')]['id'];var _0x2dbab9=_0x1ba228[_0xc689('0x5d')];var _0x328e45=0xc8;var _0x5db31e=null;return db[_0xc689('0xa3')][_0xc689('0xa4')]({'isolationLevel':db[_0xc689('0xa3')][_0xc689('0xa5')][_0xc689('0xa6')][_0xc689('0xa7')]},function(_0x1f21a2){return db[_0xc689('0x52')][_0xc689('0x6b')]({'where':{'id':_0x54263e},'transaction':_0x1f21a2})[_0xc689('0x22')](function(_0x19d355){if(_0x19d355){return db['OpenchannelApplication'][_0xc689('0x3b')]({'where':{'OpenchannelAccountId':_0x54263e},'transaction':_0x1f21a2})[_0xc689('0x22')](function(){var _0x5c068=_[_0xc689('0x3f')](_0x2dbab9,function(_0x3f2258){_0x3f2258[_0xc689('0xa8')]=_0x54263e;return _0x3f2258;});return db[_0xc689('0x82')][_0xc689('0xa9')](_0x5c068,{'transaction':_0x1f21a2});});}else{_0x328e45=0x194;_0x5db31e=[];}});})['then'](function(){if(_0x328e45!==0x194){return db[_0xc689('0x82')][_0xc689('0xaa')]({'where':{'OpenchannelAccountId':_0x54263e},'order':_0xc689('0x86')})[_0xc689('0x22')](function(_0x3df090){_0x5db31e=_0x3df090;});}})['catch'](function(_0x2103fe){_0x328e45=0x1f4;logger[_0xc689('0x28')](_0x2103fe['stack']);if(_0x2103fe['name']){delete _0x2103fe[_0xc689('0x3c')];}_0x5db31e=_0x2103fe;})['finally'](function(){if(_0x5db31e===null){_0xb19f14['sendStatus'](_0x328e45);}else{if(_0x328e45===0x1f4){_0xb19f14['status'](_0x328e45)[_0xc689('0xab')](_0x5db31e);}else{_0xb19f14[_0xc689('0x2e')](_0x328e45)[_0xc689('0x2f')](_0x5db31e);}}});};exports[_0xc689('0xac')]=function(_0x19f5c9,_0xc0202c,_0x138b76){var _0x212b01={};var _0x5f2e43={};var _0x439d3;var _0x4da568;return db[_0xc689('0x52')][_0xc689('0x6b')]({'where':{'id':_0x19f5c9[_0xc689('0x63')]['id']}})[_0xc689('0x22')](handleEntityNotFound(_0xc0202c,null))[_0xc689('0x22')](function(_0x3e99c3){if(_0x3e99c3){_0x439d3=_0x3e99c3;_0x5f2e43[_0xc689('0x42')]=_[_0xc689('0x58')](db[_0xc689('0x82')][_0xc689('0x59')]);_0x5f2e43[_0xc689('0x43')]=_[_0xc689('0x58')](_0x19f5c9['query']);_0x5f2e43[_0xc689('0x4b')]=_[_0xc689('0x44')](_0x5f2e43[_0xc689('0x42')],_0x5f2e43[_0xc689('0x43')]);_0x212b01[_0xc689('0x46')]=_[_0xc689('0x44')](_0x5f2e43[_0xc689('0x42')],qs[_0xc689('0x45')](_0x19f5c9[_0xc689('0x43')][_0xc689('0x45')]));_0x212b01[_0xc689('0x46')]=_0x212b01['attributes'][_0xc689('0x47')]?_0x212b01[_0xc689('0x46')]:_0x5f2e43['model'];_0x212b01[_0xc689('0x6d')]=qs[_0xc689('0x4a')](_0x19f5c9[_0xc689('0x43')][_0xc689('0x4a')]);_0x212b01[_0xc689('0x4e')]=qs['filters'](_[_0xc689('0x4c')](_0x19f5c9['query'],_0x5f2e43[_0xc689('0x4b')]));if(_0x19f5c9[_0xc689('0x43')][_0xc689('0x4d')]){_0x212b01[_0xc689('0x4e')]=_[_0xc689('0x50')](_0x212b01[_0xc689('0x4e')],{'$or':_[_0xc689('0x3f')](_0x212b01['attributes'],function(_0x2113f8){var _0x46fa2e={};_0x46fa2e[_0x2113f8]={'$like':'%'+_0x19f5c9['query']['filter']+'%'};return _0x46fa2e;})});}_0x212b01=_[_0xc689('0x50')]({},_0x212b01,_0x19f5c9['options']);return _0x439d3[_0xc689('0xac')](_0x212b01);}})[_0xc689('0x22')](function(_0x2ef26c){if(_0x2ef26c){_0x4da568=_0x2ef26c[_0xc689('0x47')];if(!_0x19f5c9[_0xc689('0x43')][_0xc689('0x48')](_0xc689('0x49'))){_0x212b01[_0xc689('0x31')]=qs[_0xc689('0x31')](_0x19f5c9[_0xc689('0x43')][_0xc689('0x31')]);_0x212b01['offset']=qs[_0xc689('0x33')](_0x19f5c9['query'][_0xc689('0x33')]);}return _0x439d3[_0xc689('0xac')](_0x212b01);}})[_0xc689('0x22')](function(_0x144c4a){if(_0x144c4a){return _0x144c4a?{'count':_0x4da568,'rows':_0x144c4a}:null;}})[_0xc689('0x22')](respondWithResult(_0xc0202c,null))['catch'](handleError(_0xc0202c,null));};exports[_0xc689('0xad')]=function(_0x3e611f,_0xfb8bba,_0x2d95fe){var _0x408797={'raw':![],'where':{}};var _0x14c5f9={};var _0x30a9c1={'count':0x0,'rows':[]};return db[_0xc689('0x52')][_0xc689('0x6b')]({'where':{'id':_0x3e611f[_0xc689('0x63')]['id']}})['then'](handleEntityNotFound(_0xfb8bba,null))[_0xc689('0x22')](function(_0x5138a3){if(_0x5138a3){_0x14c5f9[_0xc689('0x42')]=_[_0xc689('0x58')](db[_0xc689('0x8e')][_0xc689('0x59')]);_0x14c5f9[_0xc689('0x43')]=_[_0xc689('0x58')](_0x3e611f[_0xc689('0x43')]);_0x14c5f9[_0xc689('0x4b')]=_[_0xc689('0x44')](_0x14c5f9[_0xc689('0x42')],_0x14c5f9['query']);_0x408797['attributes']=_[_0xc689('0x44')](_0x14c5f9[_0xc689('0x42')],qs[_0xc689('0x45')](_0x3e611f[_0xc689('0x43')]['fields']));_0x408797['attributes']=_0x408797['attributes'][_0xc689('0x47')]?_0x408797[_0xc689('0x46')]:_0x14c5f9['model'];if(!_0x3e611f[_0xc689('0x43')][_0xc689('0x48')](_0xc689('0x49'))){_0x408797['limit']=qs[_0xc689('0x31')](_0x3e611f[_0xc689('0x43')][_0xc689('0x31')]);_0x408797['offset']=qs['offset'](_0x3e611f[_0xc689('0x43')]['offset']);}_0x408797[_0xc689('0x6d')]=qs[_0xc689('0x4a')](_0x3e611f[_0xc689('0x43')]['sort']);_0x408797[_0xc689('0x4e')]=qs[_0xc689('0x4b')](_[_0xc689('0x4c')](_0x3e611f[_0xc689('0x43')],_0x14c5f9[_0xc689('0x4b')]));_0x408797['where'][_0xc689('0xa8')]=_0x5138a3['id'];if(_0x3e611f[_0xc689('0x43')]['filter']){_0x408797['where']=_[_0xc689('0x50')](_0x408797[_0xc689('0x4e')],{'$or':_['map'](_0x408797[_0xc689('0x46')],function(_0xee1775){var _0xc3d7b4={};_0xc3d7b4[_0xee1775]={'$like':'%'+_0x3e611f[_0xc689('0x43')][_0xc689('0x4d')]+'%'};return _0xc3d7b4;})});}_0x408797=_[_0xc689('0x50')]({},_0x408797,_0x3e611f[_0xc689('0x51')]);return db[_0xc689('0x8e')]['count']({'where':_0x408797[_0xc689('0x4e')]})[_0xc689('0x22')](function(_0x11de1c){_0x30a9c1[_0xc689('0x32')]=_0x11de1c;if(_0x3e611f['query']['includeAll']){_0x408797[_0xc689('0x53')]=[{'model':db[_0xc689('0x7f')],'as':_0xc689('0xae'),'required':![]},{'model':db[_0xc689('0x9b')],'as':_0xc689('0xaf'),'attributes':[_0xc689('0x3c'),_0xc689('0xb0'),'internal'],'required':![]},{'model':db[_0xc689('0xb1')],'as':_0xc689('0xb2'),'attributes':['id',_0xc689('0x3c'),_0xc689('0xb3')],'where':_0x3e611f[_0xc689('0x43')][_0xc689('0xb4')]?{'id':_0x3e611f['query'][_0xc689('0xb4')]}:undefined,'required':_0x3e611f[_0xc689('0x43')][_0xc689('0xb4')]?!![]:![]}];}return db[_0xc689('0x8e')][_0xc689('0x54')](_0x408797);})['then'](function(_0x457f4a){_0x30a9c1[_0xc689('0x55')]=_0x457f4a;return _0x30a9c1;});}})[_0xc689('0x22')](respondWithFilteredResult(_0xfb8bba,_0x408797))[_0xc689('0x2b')](handleError(_0xfb8bba,null));};exports[_0xc689('0xb5')]=function(_0x3d38a8,_0x5cb992,_0x4c2fd8){return db[_0xc689('0x52')]['find']({'where':{'id':_0x3d38a8['params']['id']}})['then'](handleEntityNotFound(_0x5cb992,null))[_0xc689('0x22')](function(_0x31d179){if(_0x31d179){return _0x31d179[_0xc689('0xb5')](_0x3d38a8[_0xc689('0x5d')]['ids'],_['omit'](_0x3d38a8[_0xc689('0x5d')],[_0xc689('0x69'),'id'])||{})['spread'](function(_0x290bfc){for(var _0x68e96e=0x0;_0x68e96e<_0x3d38a8[_0xc689('0x5d')]['ids'][_0xc689('0x47')];_0x68e96e+=0x1){socket[_0xc689('0xb6')](_0xc689('0xb7'),{'UserId':Number(_0x3d38a8[_0xc689('0x5d')][_0xc689('0x69')][_0x68e96e]),'OpenchannelAccountId':Number(_0x3d38a8[_0xc689('0x63')]['id'])});}return _0x290bfc;});}})[_0xc689('0x22')](respondWithResult(_0x5cb992,null))[_0xc689('0x2b')](handleError(_0x5cb992,null));};exports[_0xc689('0xb8')]=function(_0x50a1e7,_0x2fb050,_0xd96c46){return db[_0xc689('0x52')][_0xc689('0x5b')]({'where':{'id':_0x50a1e7[_0xc689('0x63')]['id']}})[_0xc689('0x22')](handleEntityNotFound(_0x2fb050,null))['then'](function(_0x4185b0){if(_0x4185b0){return _0x4185b0[_0xc689('0xb8')](_0x50a1e7[_0xc689('0x43')]['ids'])[_0xc689('0x22')](function(){if(_['isArray'](_0x50a1e7[_0xc689('0x43')]['ids'])){for(var _0x549fe3=0x0;_0x549fe3<_0x50a1e7['query'][_0xc689('0x69')][_0xc689('0x47')];_0x549fe3+=0x1){socket[_0xc689('0xb6')](_0xc689('0xb9'),{'UserId':Number(_0x50a1e7[_0xc689('0x43')][_0xc689('0x69')][_0x549fe3]),'OpenchannelAccountId':Number(_0x50a1e7['params']['id'])});}}else{socket[_0xc689('0xb6')](_0xc689('0xb9'),{'UserId':Number(_0x50a1e7[_0xc689('0x43')][_0xc689('0x69')]),'OpenchannelAccountId':Number(_0x50a1e7[_0xc689('0x63')]['id'])});}});}})[_0xc689('0x22')](respondWithStatusCode(_0x2fb050,null))[_0xc689('0x2b')](handleError(_0x2fb050,null));};exports['getAgents']=function(_0x5e21b2,_0x38759b,_0x4d4d08){var _0x2ef30d={};var _0x24b8e5={};var _0x1cd0f8;var _0x34097c;return db[_0xc689('0x52')][_0xc689('0x6b')]({'where':{'id':_0x5e21b2[_0xc689('0x63')]['id']}})[_0xc689('0x22')](handleEntityNotFound(_0x38759b,null))[_0xc689('0x22')](function(_0x42d31c){if(_0x42d31c){_0x1cd0f8=_0x42d31c;_0x24b8e5[_0xc689('0x42')]=_['keys'](db[_0xc689('0x9b')][_0xc689('0x59')]);_0x24b8e5[_0xc689('0x43')]=_[_0xc689('0x58')](_0x5e21b2[_0xc689('0x43')]);_0x24b8e5[_0xc689('0x4b')]=_[_0xc689('0x44')](_0x24b8e5['model'],_0x24b8e5['query']);_0x2ef30d[_0xc689('0x46')]=_[_0xc689('0x44')](_0x24b8e5[_0xc689('0x42')],qs[_0xc689('0x45')](_0x5e21b2[_0xc689('0x43')][_0xc689('0x45')]));_0x2ef30d['attributes']=_0x2ef30d[_0xc689('0x46')]['length']?_0x2ef30d['attributes']:_0x24b8e5[_0xc689('0x42')];_0x2ef30d[_0xc689('0x6d')]=qs[_0xc689('0x4a')](_0x5e21b2[_0xc689('0x43')][_0xc689('0x4a')]);_0x2ef30d[_0xc689('0x4e')]=qs[_0xc689('0x4b')](_[_0xc689('0x4c')](_0x5e21b2[_0xc689('0x43')],_0x24b8e5[_0xc689('0x4b')]));if(_0x5e21b2['query']['filter']){_0x2ef30d[_0xc689('0x4e')]=_[_0xc689('0x50')](_0x2ef30d[_0xc689('0x4e')],{'$or':_[_0xc689('0x3f')](_0x2ef30d['attributes'],function(_0x7f0acf){var _0x1b6c3f={};_0x1b6c3f[_0x7f0acf]={'$like':'%'+_0x5e21b2['query'][_0xc689('0x4d')]+'%'};return _0x1b6c3f;})});}_0x2ef30d=_[_0xc689('0x50')]({},_0x2ef30d,_0x5e21b2[_0xc689('0x51')]);return _0x1cd0f8[_0xc689('0xba')](_0x2ef30d);}})['then'](function(_0x425255){if(_0x425255){_0x34097c=_0x425255[_0xc689('0x47')];if(!_0x5e21b2[_0xc689('0x43')][_0xc689('0x48')]('nolimit')){_0x2ef30d[_0xc689('0x31')]=qs[_0xc689('0x31')](_0x5e21b2[_0xc689('0x43')][_0xc689('0x31')]);_0x2ef30d[_0xc689('0x33')]=qs[_0xc689('0x33')](_0x5e21b2['query'][_0xc689('0x33')]);}return _0x1cd0f8['getAgents'](_0x2ef30d);}})[_0xc689('0x22')](function(_0x3640a5){if(_0x3640a5){return _0x3640a5?{'count':_0x34097c,'rows':_0x3640a5}:null;}})[_0xc689('0x22')](respondWithResult(_0x38759b,null))[_0xc689('0x2b')](handleError(_0x38759b,null));};exports['send']=function(_0xe2b51b,_0x361147,_0x2a2d61){var _0x450b4e,_0x581c1a,_0x2fc695;if(_[_0xc689('0x77')](_0xe2b51b['body']['body'])||_0xe2b51b[_0xc689('0x5d')][_0xc689('0x5d')]===''){throw new db[(_0xc689('0x78'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc689('0x77')](_0xe2b51b['body']['to'])){}_0x450b4e=_0xe2b51b[_0xc689('0x5d')]['to'];return db[_0xc689('0x52')][_0xc689('0x6b')]({'where':{'id':_0xe2b51b[_0xc689('0x63')]['id']}})['then'](handleEntityNotFound(_0x361147,null))['then'](function(_0x3f46c6){if(_0x3f46c6){return db[_0xc689('0x52')]['find']({'where':{'id':_0x3f46c6['id']},'include':[{'model':db['CmList'],'as':_0xc689('0x7e'),'include':[{'model':db[_0xc689('0x7f')],'as':'Contacts','where':{[_0x3f46c6['mapKey']]:_0x450b4e},'limit':0x1,'order':[[_0xc689('0x75'),_0xc689('0x81')]]}]}]})['then'](handleEntityNotFound(_0x361147,null))['then'](function(_0x593ee2){if(_0x593ee2&&_0x593ee2[_0xc689('0x7e')]){_0x581c1a=_0x593ee2[_0xc689('0x39')]({'plain':!![]});if(_0x581c1a[_0xc689('0x7e')]&&_0x581c1a['List'][_0xc689('0x80')][_0xc689('0x47')]){return _0x581c1a[_0xc689('0x7e')][_0xc689('0x80')][0x0];}return db[_0xc689('0x7f')]['create'](_[_0xc689('0x1a')](_0xe2b51b[_0xc689('0x5d')],{'firstName':_0x450b4e,[_0x593ee2[_0xc689('0x7a')]]:_0x450b4e,'phone':_0x450b4e,'ListId':_0x581c1a[_0xc689('0x89')]}));}})[_0xc689('0x22')](handleEntityNotFound(_0x361147,null))[_0xc689('0x22')](function(_0x4ce8a5){if(_0x4ce8a5){_0x2fc695=_0x4ce8a5;return db[_0xc689('0x8e')][_0xc689('0x5b')]({'where':{'ContactId':_0x2fc695['id'],'closed':![],'OpenchannelAccountId':_0x581c1a['id']}})[_0xc689('0x22')](function(_0x10f043){if(_0x10f043){return[_0x10f043,![]];}return db['OpenchannelInteraction'][_0xc689('0x5c')]({'UserId':_0xe2b51b[_0xc689('0x5f')]['id'],'ContactId':_0x2fc695['id'],'OpenchannelAccountId':_0x581c1a['id'],'lastMsgDirection':_0xc689('0xbb'),'firstMsgDirection':_0xc689('0xbb'),'Messages':[_['merge'](_0xe2b51b[_0xc689('0x5d')],{'read':![],'body':_0xe2b51b[_0xc689('0x5d')][_0xc689('0x5d')],'OpenchannelAccountId':_0x581c1a['id'],'UserId':_0xe2b51b[_0xc689('0x5f')]['id'],'ContactId':_0x2fc695['id']})]},{'include':[{'model':db[_0xc689('0x99')],'as':_0xc689('0xbc')}]})[_0xc689('0x22')](function(_0x4e4a03){return[_0x4e4a03,!![]];});});}})[_0xc689('0xbd')](function(_0x252c0e,_0x3a0575){if(_0x3a0575){return _0x252c0e;}return db['OpenchannelMessage'][_0xc689('0x5c')](_['merge'](_0xe2b51b[_0xc689('0x5d')],{'read':![],'body':_0xe2b51b[_0xc689('0x5d')][_0xc689('0x5d')],'OpenchannelAccountId':_0x581c1a['id'],'OpenchannelInteractionId':_0x252c0e['id'],'UserId':_0xe2b51b[_0xc689('0x5f')]['id'],'ContactId':_0x2fc695['id']}))[_0xc689('0x22')](function(_0x2502cd){_0x252c0e[_0xc689('0xbe')]['Messages']=[];_0x252c0e[_0xc689('0xbe')]['Messages'][_0xc689('0x95')](_0x2502cd['dataValues']);return _0x252c0e;});});}})[_0xc689('0x22')](respondWithResult(_0x361147,null))[_0xc689('0x2b')](handleError(_0x361147,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 5242251..a2b1cf7 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 _0x91a7=['../../mysqldb','OpenchannelAccount','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x91a7,0xe7));var _0x791a=function(_0x5c4777,_0x3022fe){_0x5c4777=_0x5c4777-0x0;var _0x3e9643=_0x91a7[_0x5c4777];return _0x3e9643;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x791a('0x0'))['db'][_0x791a('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x791a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x791a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2f6392){return function(_0x535640,_0x50ab29,_0x32fe2b){OpenchannelAccountEvents[_0x791a('0x4')](_0x2f6392+':'+_0x535640['id'],_0x535640);OpenchannelAccountEvents['emit'](_0x2f6392,_0x535640);_0x32fe2b(null);};}for(var e in events){if(events[_0x791a('0x5')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x791a('0x6')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x6f7a=['events','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x5e3f2c,_0x2d645b){_0x5e3f2c=_0x5e3f2c-0x0;var _0x5598a0=_0x6f7a[_0x5e3f2c];return _0x5598a0;};'use strict';var EventEmitter=require(_0xa6f7('0x0'));var OpenchannelAccount=require(_0xa6f7('0x1'))['db'][_0xa6f7('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xa6f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa6f7('0x4'),'afterDestroy':_0xa6f7('0x5')};function emitEvent(_0x12ecb8){return function(_0x1da6dc,_0x22e529,_0x1f5922){OpenchannelAccountEvents[_0xa6f7('0x6')](_0x12ecb8+':'+_0x1da6dc['id'],_0x1da6dc);OpenchannelAccountEvents[_0xa6f7('0x6')](_0x12ecb8,_0x1da6dc);_0x1f5922(null);};}for(var e in events){if(events[_0xa6f7('0x7')](e)){var event=events[e];OpenchannelAccount[_0xa6f7('0x8')](e,emitEvent(event));}}module[_0xa6f7('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index b93039d..be0c57e 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(_0x2ed04e,_0x5ba478){var _0x5417d4=function(_0x1cdfc7){while(--_0x1cdfc7){_0x2ed04e['push'](_0x2ed04e['shift']());}};_0x5417d4(++_0x5ba478);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x361fd7,_0x151846){var _0x5ae213=function(_0x5f107a){while(--_0x5f107a){_0x361fd7['push'](_0x361fd7['shift']());}};_0x5ae213(++_0x151846);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 5aff6e1..0a00521 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 _0x1d2d=['localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5e46dc,_0x5b3fba){var _0x2c9919=function(_0x7e0d9c){while(--_0x7e0d9c){_0x5e46dc['push'](_0x5e46dc['shift']());}};_0x2c9919(++_0x5b3fba);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x4b9600,_0x1ccf67){_0x4b9600=_0x4b9600-0x0;var _0x37aa55=_0x1d2d[_0x4b9600];return _0x37aa55;};'use strict';var _=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var moment=require(_0xd1d2('0x2'));var BPromise=require(_0xd1d2('0x3'));var rs=require(_0xd1d2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd1d2('0x6'));var config=require(_0xd1d2('0x7'));var jayson=require(_0xd1d2('0x8'));var client=jayson[_0xd1d2('0x9')][_0xd1d2('0xa')]({'port':0x232a});config[_0xd1d2('0xb')]=_['defaults'](config[_0xd1d2('0xb')],{'host':_0xd1d2('0xc'),'port':0x18eb});var socket=require(_0xd1d2('0xd'))(new Redis(config[_0xd1d2('0xb')]));require(_0xd1d2('0xe'))[_0xd1d2('0xf')](socket);function respondWithRpcPromise(_0x1dc683,_0x1a6ca4,_0x3ac8c4){return new BPromise(function(_0x353f9b,_0x900ec){return client[_0xd1d2('0x10')](_0x1dc683,_0x3ac8c4)[_0xd1d2('0x11')](function(_0x5b21f4){logger[_0xd1d2('0x12')](_0xd1d2('0x13'),_0x1a6ca4,_0xd1d2('0x14'));logger[_0xd1d2('0x15')](_0xd1d2('0x16'),_0x1a6ca4,_0xd1d2('0x14'),JSON[_0xd1d2('0x17')](_0x5b21f4));if(_0x5b21f4[_0xd1d2('0x18')]){if(_0x5b21f4[_0xd1d2('0x18')][_0xd1d2('0x19')]===0x1f4){logger['error'](_0xd1d2('0x13'),_0x1a6ca4,_0x5b21f4[_0xd1d2('0x18')][_0xd1d2('0x1a')]);return _0x900ec(_0x5b21f4['error'][_0xd1d2('0x1a')]);}logger[_0xd1d2('0x18')](_0xd1d2('0x13'),_0x1a6ca4,_0x5b21f4[_0xd1d2('0x18')][_0xd1d2('0x1a')]);return _0x353f9b(_0x5b21f4[_0xd1d2('0x18')][_0xd1d2('0x1a')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x1a6ca4,_0xd1d2('0x14'));_0x353f9b(_0x5b21f4['result'][_0xd1d2('0x1a')]);}})[_0xd1d2('0x1b')](function(_0x3102c4){logger[_0xd1d2('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x1a6ca4,_0x3102c4);_0x900ec(_0x3102c4);});});} \ No newline at end of file +var _0x34b7=['redis','defaults','localhost','socket.io-emitter','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x2880d8,_0x284ded){var _0x51f5a9=function(_0xafd747){while(--_0xafd747){_0x2880d8['push'](_0x2880d8['shift']());}};_0x51f5a9(++_0x284ded);}(_0x34b7,0x196));var _0x734b=function(_0x16f5d5,_0x184bb0){_0x16f5d5=_0x16f5d5-0x0;var _0x1b9f8c=_0x34b7[_0x16f5d5];return _0x1b9f8c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});config[_0x734b('0xa')]=_[_0x734b('0xb')](config['redis'],{'host':_0x734b('0xc'),'port':0x18eb});var socket=require(_0x734b('0xd'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x19a88e,_0x598dee,_0x43c5e0){return new BPromise(function(_0x333738,_0x2860a2){return client[_0x734b('0xe')](_0x19a88e,_0x43c5e0)[_0x734b('0xf')](function(_0x16e451){logger[_0x734b('0x10')](_0x734b('0x11'),_0x598dee,_0x734b('0x12'));logger[_0x734b('0x13')](_0x734b('0x14'),_0x598dee,_0x734b('0x12'),JSON[_0x734b('0x15')](_0x16e451));if(_0x16e451[_0x734b('0x16')]){if(_0x16e451['error'][_0x734b('0x17')]===0x1f4){logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);return _0x2860a2(_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);}logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);return _0x333738(_0x16e451['error'][_0x734b('0x18')]);}else{logger[_0x734b('0x10')](_0x734b('0x11'),_0x598dee,_0x734b('0x12'));_0x333738(_0x16e451['result']['message']);}})[_0x734b('0x19')](function(_0x3033cd){logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x3033cd);_0x2860a2(_0x3033cd);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 033ef3f..65fb959 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 _0x6d0b=['remove','emit','removeListener','length','openchannelAccount:','./openchannelAccount.events'];(function(_0x204408,_0x2047ed){var _0x2d8622=function(_0x42d2e8){while(--_0x42d2e8){_0x204408['push'](_0x204408['shift']());}};_0x2d8622(++_0x2047ed);}(_0x6d0b,0x71));var _0xb6d0=function(_0x17fbf9,_0x53475d){_0x17fbf9=_0x17fbf9-0x0;var _0x23e7c1=_0x6d0b[_0x17fbf9];return _0x23e7c1;};'use strict';var OpenchannelAccountEvents=require(_0xb6d0('0x0'));var events=['save',_0xb6d0('0x1'),'update'];function createListener(_0x15490e,_0x26ff2e){return function(_0x15fea3){_0x26ff2e[_0xb6d0('0x2')](_0x15490e,_0x15fea3);};}function removeListener(_0x293a26,_0x374a27){return function(){OpenchannelAccountEvents[_0xb6d0('0x3')](_0x293a26,_0x374a27);};}exports['register']=function(_0x35142b){for(var _0x3612ac=0x0,_0x23217f=events[_0xb6d0('0x4')];_0x3612ac<_0x23217f;_0x3612ac++){var _0x440414=events[_0x3612ac];var _0x2e41cf=createListener(_0xb6d0('0x5')+_0x440414,_0x35142b);OpenchannelAccountEvents['on'](_0x440414,_0x2e41cf);}}; \ No newline at end of file +var _0x5ebe=['removeListener','register','length','save','remove','update'];(function(_0x1298a9,_0xe53c9d){var _0x1a5b9d=function(_0x46d1b4){while(--_0x46d1b4){_0x1298a9['push'](_0x1298a9['shift']());}};_0x1a5b9d(++_0xe53c9d);}(_0x5ebe,0x69));var _0xe5eb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5ebe[_0x20a584];return _0x4b41a8;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xe5eb('0x0'),_0xe5eb('0x1'),_0xe5eb('0x2')];function createListener(_0x351ab2,_0x1f85f8){return function(_0x3912d6){_0x1f85f8['emit'](_0x351ab2,_0x3912d6);};}function removeListener(_0x56ef37,_0x465c4e){return function(){OpenchannelAccountEvents[_0xe5eb('0x3')](_0x56ef37,_0x465c4e);};}exports[_0xe5eb('0x4')]=function(_0x1f7414){for(var _0x3055ba=0x0,_0x3ae8d2=events[_0xe5eb('0x5')];_0x3055ba<_0x3ae8d2;_0x3055ba++){var _0x1acd9d=events[_0x3055ba];var _0x5158f0=createListener('openchannelAccount:'+_0x1acd9d,_0x1f7414);OpenchannelAccountEvents['on'](_0x1acd9d,_0x5158f0);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 2b9752c..18ddf69 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 _0x99bb=['isAuthenticated','create','put','delete','/:id','exports','multer','util','path','connect-timeout','fs-extra','./openchannelApplication.controller'];(function(_0x5a6982,_0x31b6a6){var _0x294265=function(_0x3ccc85){while(--_0x3ccc85){_0x5a6982['push'](_0x5a6982['shift']());}};_0x294265(++_0x31b6a6);}(_0x99bb,0x14a));var _0xb99b=function(_0x1d11a3,_0x3982f2){_0x1d11a3=_0x1d11a3-0x0;var _0x17ab57=_0x99bb[_0x1d11a3];return _0x17ab57;};'use strict';var multer=require(_0xb99b('0x0'));var util=require(_0xb99b('0x1'));var path=require(_0xb99b('0x2'));var timeout=require(_0xb99b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb99b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb99b('0x5'));router['get']('/',auth[_0xb99b('0x6')](),controller['index']);router['get']('/:id',auth[_0xb99b('0x6')](),controller['show']);router['post']('/',auth[_0xb99b('0x6')](),controller[_0xb99b('0x7')]);router[_0xb99b('0x8')]('/:id',auth[_0xb99b('0x6')](),controller['update']);router[_0xb99b('0x9')](_0xb99b('0xa'),auth[_0xb99b('0x6')](),controller['destroy']);module[_0xb99b('0xb')]=router; \ No newline at end of file +var _0xd5d0=['update','delete','destroy','exports','multer','path','Router','fs-extra','../../config/environment','./openchannelApplication.controller','isAuthenticated','show','post','create','/:id'];(function(_0x1a3fce,_0x3d70ef){var _0x4b8da7=function(_0x5e4929){while(--_0x5e4929){_0x1a3fce['push'](_0x1a3fce['shift']());}};_0x4b8da7(++_0x3d70ef);}(_0xd5d0,0x1f3));var _0x0d5d=function(_0x23e7f3,_0x26c37a){_0x23e7f3=_0x23e7f3-0x0;var _0x18700b=_0xd5d0[_0x23e7f3];return _0x18700b;};'use strict';var multer=require(_0x0d5d('0x0'));var util=require('util');var path=require(_0x0d5d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d5d('0x2')]();var fs_extra=require(_0x0d5d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0d5d('0x4'));var controller=require(_0x0d5d('0x5'));router['get']('/',auth[_0x0d5d('0x6')](),controller['index']);router['get']('/:id',auth[_0x0d5d('0x6')](),controller[_0x0d5d('0x7')]);router[_0x0d5d('0x8')]('/',auth['isAuthenticated'](),controller[_0x0d5d('0x9')]);router['put'](_0x0d5d('0xa'),auth[_0x0d5d('0x6')](),controller[_0x0d5d('0xb')]);router[_0x0d5d('0xc')](_0x0d5d('0xa'),auth[_0x0d5d('0x6')](),controller[_0x0d5d('0xd')]);module[_0x0d5d('0xe')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index ed68ba8..c4a4b5f 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 _0xe0b1=['INTEGER','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x7880d2,_0x32e7d6){var _0x35ebbe=function(_0x5c27fa){while(--_0x5c27fa){_0x7880d2['push'](_0x7880d2['shift']());}};_0x35ebbe(++_0x32e7d6);}(_0xe0b1,0x178));var _0x1e0b=function(_0x6dfbaa,_0x31eede){_0x6dfbaa=_0x6dfbaa-0x0;var _0xfbe02=_0xe0b1[_0x6dfbaa];return _0xfbe02;};'use strict';var Sequelize=require(_0x1e0b('0x0'));module[_0x1e0b('0x1')]={'priority':{'type':Sequelize[_0x1e0b('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1e0b('0x3')},'appdata':{'type':Sequelize[_0x1e0b('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x1e0b('0x5')}}; \ No newline at end of file +var _0x9e64=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0xf34109,_0x380779){var _0x570bfc=function(_0x1ad086){while(--_0x1ad086){_0xf34109['push'](_0xf34109['shift']());}};_0x570bfc(++_0x380779);}(_0x9e64,0x188));var _0x49e6=function(_0x525e66,_0x3fa5b9){_0x525e66=_0x525e66-0x0;var _0x2e71d3=_0x9e64[_0x525e66];return _0x2e71d3;};'use strict';var Sequelize=require(_0x49e6('0x0'));module[_0x49e6('0x1')]={'priority':{'type':Sequelize[_0x49e6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x49e6('0x3')],'allowNull':![],'defaultValue':_0x49e6('0x4')},'appdata':{'type':Sequelize[_0x49e6('0x5')]()},'description':{'type':Sequelize[_0x49e6('0x3')]},'interval':{'type':Sequelize[_0x49e6('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index f7c41f0..ea4f393 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 _0x9202=['fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','key','model','query','keys','filters','attributes','intersection'];(function(_0x1f41b4,_0x2a3899){var _0x131b99=function(_0x3949cc){while(--_0x3949cc){_0x1f41b4['push'](_0x1f41b4['shift']());}};_0x131b99(++_0x2a3899);}(_0x9202,0x130));var _0x2920=function(_0x5103e9,_0x420916){_0x5103e9=_0x5103e9-0x0;var _0x3bf4aa=_0x9202[_0x5103e9];return _0x3bf4aa;};'use strict';var emlformat=require(_0x2920('0x0'));var rimraf=require(_0x2920('0x1'));var zipdir=require(_0x2920('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2920('0x3'));var BPromise=require(_0x2920('0x4'));var Mustache=require(_0x2920('0x5'));var util=require(_0x2920('0x6'));var path=require(_0x2920('0x7'));var sox=require(_0x2920('0x8'));var csv=require(_0x2920('0x9'));var ejs=require(_0x2920('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2920('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2920('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2920('0x9'));var querystring=require(_0x2920('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2920('0xe'));var hardwareService=require(_0x2920('0xf'));var logger=require(_0x2920('0x10'))(_0x2920('0x11'));var utils=require('../../config/utils');var config=require(_0x2920('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x2920('0x13'))['db'];function respondWithStatusCode(_0x171827,_0x23db17){_0x23db17=_0x23db17||0xcc;return function(_0x214984){if(_0x214984){return _0x171827['sendStatus'](_0x23db17);}return _0x171827[_0x2920('0x14')](_0x23db17)[_0x2920('0x15')]();};}function respondWithResult(_0x2c5e49,_0x1e4d2d){_0x1e4d2d=_0x1e4d2d||0xc8;return function(_0x14ddbf){if(_0x14ddbf){return _0x2c5e49['status'](_0x1e4d2d)[_0x2920('0x16')](_0x14ddbf);}};}function respondWithFilteredResult(_0x130dbc,_0x1c931f){return function(_0x3d10f4){if(_0x3d10f4){var _0x59ac00=typeof _0x1c931f[_0x2920('0x17')]===_0x2920('0x18')&&typeof _0x1c931f[_0x2920('0x19')]===_0x2920('0x18');var _0x771b42=_0x3d10f4[_0x2920('0x1a')];var _0x371568=_0x59ac00?0x0:_0x1c931f[_0x2920('0x17')];var _0x4979d8=_0x59ac00?_0x3d10f4['count']:_0x1c931f[_0x2920('0x17')]+_0x1c931f[_0x2920('0x19')];var _0x226584;if(_0x4979d8>=_0x771b42){_0x4979d8=_0x771b42;_0x226584=0xc8;}else{_0x226584=0xce;}_0x130dbc[_0x2920('0x14')](_0x226584);return _0x130dbc['set'](_0x2920('0x1b'),_0x371568+'-'+_0x4979d8+'/'+_0x771b42)[_0x2920('0x16')](_0x3d10f4);}return null;};}function patchUpdates(_0x1c630d){return function(_0x252e54){try{jsonpatch[_0x2920('0x1c')](_0x252e54,_0x1c630d,!![]);}catch(_0x3d3728){return BPromise[_0x2920('0x1d')](_0x3d3728);}return _0x252e54[_0x2920('0x1e')]();};}function saveUpdates(_0x1247d4,_0x499395){return function(_0x57a670){if(_0x57a670){return _0x57a670[_0x2920('0x1f')](_0x1247d4)[_0x2920('0x20')](function(_0x4d7fa6){return _0x4d7fa6;});}return null;};}function removeEntity(_0x239779,_0x455ff1){return function(_0x372391){if(_0x372391){return _0x372391[_0x2920('0x21')]()[_0x2920('0x20')](function(){_0x239779[_0x2920('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x131511,_0x5b3302){return function(_0x463000){if(!_0x463000){_0x131511[_0x2920('0x22')](0x194);}return _0x463000;};}function handleError(_0x1224b6,_0x5784a3){_0x5784a3=_0x5784a3||0x1f4;return function(_0x23fbaf){logger[_0x2920('0x23')](_0x23fbaf[_0x2920('0x24')]);if(_0x23fbaf[_0x2920('0x25')]){delete _0x23fbaf[_0x2920('0x25')];}_0x1224b6['status'](_0x5784a3)[_0x2920('0x26')](_0x23fbaf);};}exports[_0x2920('0x27')]=function(_0x4391b9,_0x2b43f6){var _0x68e2b5={},_0x209e43={},_0x3b1f7b={'count':0x0,'rows':[]};var _0x57e642=_[_0x2920('0x28')](db[_0x2920('0x29')][_0x2920('0x2a')],function(_0x5f438){return{'name':_0x5f438['fieldName'],'type':_0x5f438[_0x2920('0x2b')][_0x2920('0x2c')]};});_0x209e43[_0x2920('0x2d')]=_[_0x2920('0x28')](_0x57e642,_0x2920('0x25'));_0x209e43[_0x2920('0x2e')]=_[_0x2920('0x2f')](_0x4391b9[_0x2920('0x2e')]);_0x209e43[_0x2920('0x30')]=_['intersection'](_0x209e43[_0x2920('0x2d')],_0x209e43[_0x2920('0x2e')]);_0x68e2b5[_0x2920('0x31')]=_[_0x2920('0x32')](_0x209e43[_0x2920('0x2d')],qs[_0x2920('0x33')](_0x4391b9[_0x2920('0x2e')]['fields']));_0x68e2b5[_0x2920('0x31')]=_0x68e2b5['attributes'][_0x2920('0x34')]?_0x68e2b5[_0x2920('0x31')]:_0x209e43[_0x2920('0x2d')];if(!_0x4391b9['query']['hasOwnProperty'](_0x2920('0x35'))){_0x68e2b5[_0x2920('0x19')]=qs[_0x2920('0x19')](_0x4391b9[_0x2920('0x2e')]['limit']);_0x68e2b5[_0x2920('0x17')]=qs[_0x2920('0x17')](_0x4391b9[_0x2920('0x2e')]['offset']);}_0x68e2b5[_0x2920('0x36')]=qs[_0x2920('0x37')](_0x4391b9[_0x2920('0x2e')][_0x2920('0x37')]);_0x68e2b5['where']=qs[_0x2920('0x30')](_[_0x2920('0x38')](_0x4391b9[_0x2920('0x2e')],_0x209e43['filters']),_0x57e642);if(_0x4391b9[_0x2920('0x2e')][_0x2920('0x39')]){_0x68e2b5[_0x2920('0x3a')]=_[_0x2920('0x3b')](_0x68e2b5[_0x2920('0x3a')],{'$or':_[_0x2920('0x28')](_0x57e642,function(_0x38b68b){if(_0x38b68b[_0x2920('0x2b')]!==_0x2920('0x3c')){var _0x59001d={};_0x59001d[_0x38b68b['name']]={'$like':'%'+_0x4391b9[_0x2920('0x2e')][_0x2920('0x39')]+'%'};return _0x59001d;}})});}_0x68e2b5=_[_0x2920('0x3b')]({},_0x68e2b5,_0x4391b9[_0x2920('0x3d')]);var _0xe04840={'where':_0x68e2b5[_0x2920('0x3a')]};return db[_0x2920('0x29')]['count'](_0xe04840)[_0x2920('0x20')](function(_0x316b87){_0x3b1f7b[_0x2920('0x1a')]=_0x316b87;if(_0x4391b9['query'][_0x2920('0x3e')]){_0x68e2b5[_0x2920('0x3f')]=[{'all':!![]}];}return db[_0x2920('0x29')][_0x2920('0x40')](_0x68e2b5);})[_0x2920('0x20')](function(_0x382705){_0x3b1f7b[_0x2920('0x41')]=_0x382705;return _0x3b1f7b;})[_0x2920('0x20')](respondWithFilteredResult(_0x2b43f6,_0x68e2b5))['catch'](handleError(_0x2b43f6,null));};exports['show']=function(_0x423527,_0x5ecd7e){var _0x2e4b60={'raw':!![],'where':{'id':_0x423527[_0x2920('0x42')]['id']}},_0x3ebef1={};_0x3ebef1['model']=_[_0x2920('0x2f')](db['OpenchannelApplication'][_0x2920('0x2a')]);_0x3ebef1[_0x2920('0x2e')]=_[_0x2920('0x2f')](_0x423527[_0x2920('0x2e')]);_0x3ebef1['filters']=_[_0x2920('0x32')](_0x3ebef1[_0x2920('0x2d')],_0x3ebef1[_0x2920('0x2e')]);_0x2e4b60[_0x2920('0x31')]=_[_0x2920('0x32')](_0x3ebef1[_0x2920('0x2d')],qs['fields'](_0x423527[_0x2920('0x2e')][_0x2920('0x33')]));_0x2e4b60['attributes']=_0x2e4b60['attributes'][_0x2920('0x34')]?_0x2e4b60[_0x2920('0x31')]:_0x3ebef1[_0x2920('0x2d')];if(_0x423527[_0x2920('0x2e')][_0x2920('0x3e')]){_0x2e4b60[_0x2920('0x3f')]=[{'all':!![]}];}_0x2e4b60=_['merge']({},_0x2e4b60,_0x423527[_0x2920('0x3d')]);return db[_0x2920('0x29')][_0x2920('0x43')](_0x2e4b60)['then'](handleEntityNotFound(_0x5ecd7e,null))[_0x2920('0x20')](respondWithResult(_0x5ecd7e,null))[_0x2920('0x44')](handleError(_0x5ecd7e,null));};exports[_0x2920('0x45')]=function(_0xdd59f4,_0x67dba4){return db[_0x2920('0x29')][_0x2920('0x45')](_0xdd59f4[_0x2920('0x46')],{})[_0x2920('0x20')](respondWithResult(_0x67dba4,0xc9))[_0x2920('0x44')](handleError(_0x67dba4,null));};exports[_0x2920('0x1f')]=function(_0x30c353,_0x5dd5eb){if(_0x30c353[_0x2920('0x46')]['id']){delete _0x30c353[_0x2920('0x46')]['id'];}return db[_0x2920('0x29')]['find']({'where':{'id':_0x30c353['params']['id']}})['then'](handleEntityNotFound(_0x5dd5eb,null))[_0x2920('0x20')](saveUpdates(_0x30c353['body'],null))[_0x2920('0x20')](respondWithResult(_0x5dd5eb,null))[_0x2920('0x44')](handleError(_0x5dd5eb,null));};exports[_0x2920('0x21')]=function(_0x5d3854,_0x42e1f5){return db[_0x2920('0x29')][_0x2920('0x43')]({'where':{'id':_0x5d3854['params']['id']}})[_0x2920('0x20')](handleEntityNotFound(_0x42e1f5,null))[_0x2920('0x20')](removeEntity(_0x42e1f5,null))[_0x2920('0x44')](handleError(_0x42e1f5,null));}; \ No newline at end of file +var _0x4984=['jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','OpenchannelApplication','fieldName','type','map','query','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4984,0x164));var _0x4498=function(_0x1ef6a8,_0x340837){_0x1ef6a8=_0x1ef6a8-0x0;var _0x55bad9=_0x4984[_0x1ef6a8];return _0x55bad9;};'use strict';var emlformat=require(_0x4498('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4498('0x1'));var jsonpatch=require(_0x4498('0x2'));var rp=require(_0x4498('0x3'));var moment=require(_0x4498('0x4'));var BPromise=require(_0x4498('0x5'));var Mustache=require(_0x4498('0x6'));var util=require(_0x4498('0x7'));var path=require(_0x4498('0x8'));var sox=require('sox');var csv=require(_0x4498('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4498('0xa'));var _=require(_0x4498('0xb'));var squel=require(_0x4498('0xc'));var crypto=require(_0x4498('0xd'));var jsforce=require(_0x4498('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4498('0xf'));var Redis=require('ioredis');var authService=require(_0x4498('0x10'));var qs=require(_0x4498('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4498('0x12'));var logger=require(_0x4498('0x13'))(_0x4498('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4498('0x15'));var db=require(_0x4498('0x16'))['db'];function respondWithStatusCode(_0x48d0d5,_0x3a3698){_0x3a3698=_0x3a3698||0xcc;return function(_0x8ab7c6){if(_0x8ab7c6){return _0x48d0d5['sendStatus'](_0x3a3698);}return _0x48d0d5[_0x4498('0x17')](_0x3a3698)[_0x4498('0x18')]();};}function respondWithResult(_0x43c500,_0xb37fb0){_0xb37fb0=_0xb37fb0||0xc8;return function(_0x13d036){if(_0x13d036){return _0x43c500['status'](_0xb37fb0)['json'](_0x13d036);}};}function respondWithFilteredResult(_0x1ab9ef,_0x5d969e){return function(_0x1d8e40){if(_0x1d8e40){var _0x12a5a6=typeof _0x5d969e[_0x4498('0x19')]===_0x4498('0x1a')&&typeof _0x5d969e[_0x4498('0x1b')]===_0x4498('0x1a');var _0x590f85=_0x1d8e40[_0x4498('0x1c')];var _0x4a73a3=_0x12a5a6?0x0:_0x5d969e[_0x4498('0x19')];var _0x1aa6c8=_0x12a5a6?_0x1d8e40['count']:_0x5d969e['offset']+_0x5d969e[_0x4498('0x1b')];var _0x33242c;if(_0x1aa6c8>=_0x590f85){_0x1aa6c8=_0x590f85;_0x33242c=0xc8;}else{_0x33242c=0xce;}_0x1ab9ef[_0x4498('0x17')](_0x33242c);return _0x1ab9ef[_0x4498('0x1d')](_0x4498('0x1e'),_0x4a73a3+'-'+_0x1aa6c8+'/'+_0x590f85)[_0x4498('0x1f')](_0x1d8e40);}return null;};}function patchUpdates(_0x370c07){return function(_0x38b2d2){try{jsonpatch[_0x4498('0x20')](_0x38b2d2,_0x370c07,!![]);}catch(_0x108884){return BPromise[_0x4498('0x21')](_0x108884);}return _0x38b2d2[_0x4498('0x22')]();};}function saveUpdates(_0x451ddc,_0x5306d6){return function(_0x116c78){if(_0x116c78){return _0x116c78[_0x4498('0x23')](_0x451ddc)['then'](function(_0x4356be){return _0x4356be;});}return null;};}function removeEntity(_0x5f1a5d,_0x108b20){return function(_0x30bedf){if(_0x30bedf){return _0x30bedf[_0x4498('0x24')]()[_0x4498('0x25')](function(){_0x5f1a5d['status'](0xcc)[_0x4498('0x18')]();});}};}function handleEntityNotFound(_0x598b50,_0x450bf2){return function(_0x18cc33){if(!_0x18cc33){_0x598b50[_0x4498('0x26')](0x194);}return _0x18cc33;};}function handleError(_0x2d7b3b,_0x16c349){_0x16c349=_0x16c349||0x1f4;return function(_0x4eff9a){logger[_0x4498('0x27')](_0x4eff9a[_0x4498('0x28')]);if(_0x4eff9a[_0x4498('0x29')]){delete _0x4eff9a['name'];}_0x2d7b3b[_0x4498('0x17')](_0x16c349)[_0x4498('0x2a')](_0x4eff9a);};}exports['index']=function(_0x20d0a4,_0x302309){var _0x5d1e8a={},_0x4e9c7b={},_0x476a6c={'count':0x0,'rows':[]};var _0x67f72f=_['map'](db[_0x4498('0x2b')]['rawAttributes'],function(_0x587723){return{'name':_0x587723[_0x4498('0x2c')],'type':_0x587723[_0x4498('0x2d')]['key']};});_0x4e9c7b['model']=_[_0x4498('0x2e')](_0x67f72f,_0x4498('0x29'));_0x4e9c7b[_0x4498('0x2f')]=_['keys'](_0x20d0a4[_0x4498('0x2f')]);_0x4e9c7b['filters']=_[_0x4498('0x30')](_0x4e9c7b[_0x4498('0x31')],_0x4e9c7b[_0x4498('0x2f')]);_0x5d1e8a['attributes']=_['intersection'](_0x4e9c7b[_0x4498('0x31')],qs[_0x4498('0x32')](_0x20d0a4[_0x4498('0x2f')][_0x4498('0x32')]));_0x5d1e8a['attributes']=_0x5d1e8a[_0x4498('0x33')][_0x4498('0x34')]?_0x5d1e8a['attributes']:_0x4e9c7b[_0x4498('0x31')];if(!_0x20d0a4['query'][_0x4498('0x35')]('nolimit')){_0x5d1e8a['limit']=qs[_0x4498('0x1b')](_0x20d0a4['query']['limit']);_0x5d1e8a[_0x4498('0x19')]=qs['offset'](_0x20d0a4[_0x4498('0x2f')][_0x4498('0x19')]);}_0x5d1e8a['order']=qs['sort'](_0x20d0a4[_0x4498('0x2f')][_0x4498('0x36')]);_0x5d1e8a[_0x4498('0x37')]=qs[_0x4498('0x38')](_[_0x4498('0x39')](_0x20d0a4['query'],_0x4e9c7b['filters']),_0x67f72f);if(_0x20d0a4[_0x4498('0x2f')][_0x4498('0x3a')]){_0x5d1e8a[_0x4498('0x37')]=_[_0x4498('0x3b')](_0x5d1e8a['where'],{'$or':_['map'](_0x67f72f,function(_0x93fb68){if(_0x93fb68[_0x4498('0x2d')]!==_0x4498('0x3c')){var _0x78cc0b={};_0x78cc0b[_0x93fb68[_0x4498('0x29')]]={'$like':'%'+_0x20d0a4['query'][_0x4498('0x3a')]+'%'};return _0x78cc0b;}})});}_0x5d1e8a=_[_0x4498('0x3b')]({},_0x5d1e8a,_0x20d0a4[_0x4498('0x3d')]);var _0x106d70={'where':_0x5d1e8a['where']};return db[_0x4498('0x2b')][_0x4498('0x1c')](_0x106d70)[_0x4498('0x25')](function(_0x3becef){_0x476a6c[_0x4498('0x1c')]=_0x3becef;if(_0x20d0a4[_0x4498('0x2f')][_0x4498('0x3e')]){_0x5d1e8a[_0x4498('0x3f')]=[{'all':!![]}];}return db[_0x4498('0x2b')][_0x4498('0x40')](_0x5d1e8a);})[_0x4498('0x25')](function(_0x18b97d){_0x476a6c[_0x4498('0x41')]=_0x18b97d;return _0x476a6c;})[_0x4498('0x25')](respondWithFilteredResult(_0x302309,_0x5d1e8a))[_0x4498('0x42')](handleError(_0x302309,null));};exports[_0x4498('0x43')]=function(_0x54c683,_0x1bc947){var _0x59ff6e={'raw':!![],'where':{'id':_0x54c683[_0x4498('0x44')]['id']}},_0x50aa3c={};_0x50aa3c[_0x4498('0x31')]=_[_0x4498('0x45')](db[_0x4498('0x2b')][_0x4498('0x46')]);_0x50aa3c[_0x4498('0x2f')]=_[_0x4498('0x45')](_0x54c683[_0x4498('0x2f')]);_0x50aa3c[_0x4498('0x38')]=_[_0x4498('0x30')](_0x50aa3c['model'],_0x50aa3c[_0x4498('0x2f')]);_0x59ff6e['attributes']=_[_0x4498('0x30')](_0x50aa3c[_0x4498('0x31')],qs['fields'](_0x54c683[_0x4498('0x2f')][_0x4498('0x32')]));_0x59ff6e['attributes']=_0x59ff6e['attributes'][_0x4498('0x34')]?_0x59ff6e[_0x4498('0x33')]:_0x50aa3c['model'];if(_0x54c683[_0x4498('0x2f')][_0x4498('0x3e')]){_0x59ff6e[_0x4498('0x3f')]=[{'all':!![]}];}_0x59ff6e=_['merge']({},_0x59ff6e,_0x54c683[_0x4498('0x3d')]);return db['OpenchannelApplication']['find'](_0x59ff6e)['then'](handleEntityNotFound(_0x1bc947,null))[_0x4498('0x25')](respondWithResult(_0x1bc947,null))[_0x4498('0x42')](handleError(_0x1bc947,null));};exports['create']=function(_0x1ce373,_0x43c4ae){return db[_0x4498('0x2b')][_0x4498('0x47')](_0x1ce373[_0x4498('0x48')],{})['then'](respondWithResult(_0x43c4ae,0xc9))[_0x4498('0x42')](handleError(_0x43c4ae,null));};exports[_0x4498('0x23')]=function(_0x2b8f1b,_0x9fb5e1){if(_0x2b8f1b[_0x4498('0x48')]['id']){delete _0x2b8f1b[_0x4498('0x48')]['id'];}return db[_0x4498('0x2b')][_0x4498('0x49')]({'where':{'id':_0x2b8f1b[_0x4498('0x44')]['id']}})[_0x4498('0x25')](handleEntityNotFound(_0x9fb5e1,null))['then'](saveUpdates(_0x2b8f1b[_0x4498('0x48')],null))['then'](respondWithResult(_0x9fb5e1,null))[_0x4498('0x42')](handleError(_0x9fb5e1,null));};exports[_0x4498('0x24')]=function(_0x36ee30,_0x234ac4){return db['OpenchannelApplication'][_0x4498('0x49')]({'where':{'id':_0x36ee30['params']['id']}})[_0x4498('0x25')](handleEntityNotFound(_0x234ac4,null))[_0x4498('0x25')](removeEntity(_0x234ac4,null))[_0x4498('0x42')](handleError(_0x234ac4,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 391dd27..bcf3fbd 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 _0xc996=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications'];(function(_0x565910,_0x2c2747){var _0x388b44=function(_0x4f5636){while(--_0x4f5636){_0x565910['push'](_0x565910['shift']());}};_0x388b44(++_0x2c2747);}(_0xc996,0x19a));var _0x6c99=function(_0x266de3,_0x54e026){_0x266de3=_0x266de3-0x0;var _0x51bedf=_0xc996[_0x266de3];return _0x51bedf;};'use strict';var _=require(_0x6c99('0x0'));var util=require('util');var logger=require(_0x6c99('0x1'))(_0x6c99('0x2'));var moment=require('moment');var BPromise=require(_0x6c99('0x3'));var rp=require(_0x6c99('0x4'));var fs=require('fs');var path=require(_0x6c99('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6c99('0x6'));module[_0x6c99('0x7')]=function(_0x3e4583,_0x5bdff7){return _0x3e4583['define'](_0x6c99('0x8'),attributes,{'tableName':_0x6c99('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6c99('0xa'),'collate':_0x6c99('0xb')});}; \ No newline at end of file +var _0xd87e=['OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','../../config/environment','exports','define'];(function(_0x1f2a9d,_0x5cc381){var _0x2a622a=function(_0x49420c){while(--_0x49420c){_0x1f2a9d['push'](_0x1f2a9d['shift']());}};_0x2a622a(++_0x5cc381);}(_0xd87e,0xa3));var _0xed87=function(_0x531e48,_0x4bb96b){_0x531e48=_0x531e48-0x0;var _0x202971=_0xd87e[_0x531e48];return _0x202971;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xed87('0x0'))(_0xed87('0x1'));var moment=require(_0xed87('0x2'));var BPromise=require('bluebird');var rp=require(_0xed87('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xed87('0x4'));var attributes=require('./openchannelApplication.attributes');module[_0xed87('0x5')]=function(_0x3f8aa9,_0x1d50e0){return _0x3f8aa9[_0xed87('0x6')](_0xed87('0x7'),attributes,{'tableName':_0xed87('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xed87('0x9')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 417d652..7470c04 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 _0x40dc=['OpenchannelApplication,\x20%s,\x20%s','message','info','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','debug','stringify','error'];(function(_0x32cadd,_0x4d635c){var _0x464740=function(_0x1d2015){while(--_0x1d2015){_0x32cadd['push'](_0x32cadd['shift']());}};_0x464740(++_0x4d635c);}(_0x40dc,0x1a3));var _0xc40d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc40d('0x0'));var util=require(_0xc40d('0x1'));var moment=require(_0xc40d('0x2'));var BPromise=require(_0xc40d('0x3'));var rs=require(_0xc40d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc40d('0x5'))['db'];var utils=require(_0xc40d('0x6'));var logger=require(_0xc40d('0x7'))(_0xc40d('0x8'));var config=require(_0xc40d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc40d('0xa')][_0xc40d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x537018,_0x480758,_0x235f65){return new BPromise(function(_0x228dda,_0x30525c){return client['request'](_0x537018,_0x235f65)['then'](function(_0x3e3c33){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x480758,_0xc40d('0xc'));logger[_0xc40d('0xd')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x480758,'request\x20sent',JSON[_0xc40d('0xe')](_0x3e3c33));if(_0x3e3c33[_0xc40d('0xf')]){if(_0x3e3c33['error']['code']===0x1f4){logger[_0xc40d('0xf')](_0xc40d('0x10'),_0x480758,_0x3e3c33[_0xc40d('0xf')][_0xc40d('0x11')]);return _0x30525c(_0x3e3c33[_0xc40d('0xf')][_0xc40d('0x11')]);}logger['error'](_0xc40d('0x10'),_0x480758,_0x3e3c33[_0xc40d('0xf')][_0xc40d('0x11')]);return _0x228dda(_0x3e3c33[_0xc40d('0xf')][_0xc40d('0x11')]);}else{logger[_0xc40d('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x480758,_0xc40d('0xc'));_0x228dda(_0x3e3c33[_0xc40d('0x13')][_0xc40d('0x11')]);}})[_0xc40d('0x14')](function(_0x50b732){logger[_0xc40d('0xf')](_0xc40d('0x10'),_0x480758,_0x50b732);_0x30525c(_0x50b732);});});}exports[_0xc40d('0x15')]=function(_0x503a8f){var _0xbc2af3=this;return new Promise(function(_0x294572,_0x42397e){return db[_0xc40d('0x16')][_0xc40d('0x17')](_0x503a8f[_0xc40d('0x18')],{'raw':_0x503a8f[_0xc40d('0x19')]?_0x503a8f[_0xc40d('0x19')][_0xc40d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x503a8f['options']?_0x503a8f[_0xc40d('0x19')][_0xc40d('0x1b')]||null:null,'attributes':_0x503a8f[_0xc40d('0x19')]?_0x503a8f[_0xc40d('0x19')]['attributes']||null:null,'limit':_0x503a8f['options']?_0x503a8f['options'][_0xc40d('0x1c')]||null:null})['then'](function(_0x10086e){logger['info'](_0xc40d('0x15'),_0x503a8f);logger['debug'](_0xc40d('0x15'),_0x503a8f,JSON[_0xc40d('0xe')](_0x10086e));_0x294572(_0x10086e);})['catch'](function(_0x487ab0){logger['error'](_0xc40d('0x15'),_0x487ab0[_0xc40d('0x11')],_0x503a8f);_0x42397e(_0xbc2af3['error'](0x1f4,_0x487ab0['message']));});});}; \ No newline at end of file +var _0x1481=['options','raw','where','attributes','limit','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','request\x20sent','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','info','catch','UpdateOpenchannelApplication','OpenchannelApplication'];(function(_0x3fede1,_0x24d8bf){var _0x307e77=function(_0x2a2356){while(--_0x2a2356){_0x3fede1['push'](_0x3fede1['shift']());}};_0x307e77(++_0x24d8bf);}(_0x1481,0x172));var _0x1148=function(_0x30348e,_0x11b0fc){_0x30348e=_0x30348e-0x0;var _0x4c18ee=_0x1481[_0x30348e];return _0x4c18ee;};'use strict';var _=require(_0x1148('0x0'));var util=require(_0x1148('0x1'));var moment=require('moment');var BPromise=require(_0x1148('0x2'));var rs=require(_0x1148('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1148('0x4'))['db'];var utils=require(_0x1148('0x5'));var logger=require('../../config/logger')(_0x1148('0x6'));var config=require(_0x1148('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1148('0x8')][_0x1148('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bf8df,_0x13c835,_0x5087f7){return new BPromise(function(_0x4d4949,_0x49e472){return client[_0x1148('0xa')](_0x2bf8df,_0x5087f7)[_0x1148('0xb')](function(_0x245234){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x13c835,_0x1148('0xc'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x13c835,'request\x20sent',JSON[_0x1148('0xd')](_0x245234));if(_0x245234[_0x1148('0xe')]){if(_0x245234[_0x1148('0xe')][_0x1148('0xf')]===0x1f4){logger['error'](_0x1148('0x10'),_0x13c835,_0x245234['error']['message']);return _0x49e472(_0x245234[_0x1148('0xe')][_0x1148('0x11')]);}logger[_0x1148('0xe')](_0x1148('0x10'),_0x13c835,_0x245234[_0x1148('0xe')][_0x1148('0x11')]);return _0x4d4949(_0x245234['error'][_0x1148('0x11')]);}else{logger[_0x1148('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x13c835,_0x1148('0xc'));_0x4d4949(_0x245234['result'][_0x1148('0x11')]);}})[_0x1148('0x13')](function(_0x556ea9){logger['error'](_0x1148('0x10'),_0x13c835,_0x556ea9);_0x49e472(_0x556ea9);});});}exports[_0x1148('0x14')]=function(_0x3eb611){var _0x31b567=this;return new Promise(function(_0x1b8d0d,_0x238128){return db[_0x1148('0x15')]['update'](_0x3eb611['body'],{'raw':_0x3eb611[_0x1148('0x16')]?_0x3eb611['options'][_0x1148('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3eb611[_0x1148('0x16')]?_0x3eb611[_0x1148('0x16')][_0x1148('0x18')]||null:null,'attributes':_0x3eb611[_0x1148('0x16')]?_0x3eb611[_0x1148('0x16')][_0x1148('0x19')]||null:null,'limit':_0x3eb611['options']?_0x3eb611[_0x1148('0x16')][_0x1148('0x1a')]||null:null})[_0x1148('0xb')](function(_0x11c4a5){logger[_0x1148('0x12')](_0x1148('0x14'),_0x3eb611);logger[_0x1148('0x1b')](_0x1148('0x14'),_0x3eb611,JSON[_0x1148('0xd')](_0x11c4a5));_0x1b8d0d(_0x11c4a5);})[_0x1148('0x13')](function(_0x3abac6){logger[_0x1148('0xe')](_0x1148('0x14'),_0x3abac6[_0x1148('0x11')],_0x3eb611);_0x238128(_0x31b567['error'](0x1f4,_0x3abac6[_0x1148('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index ec6160b..82f24bb 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 _0x149c=['openchannelinteraction:update','update','delete','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','describe','/:id','isAuthenticated','show','getMessages','/:id/download','download','post','openchannel','openchannelinteraction:addtags','put','tracked'];(function(_0x538f7e,_0x3ec8dc){var _0x7915df=function(_0x5b87c9){while(--_0x5b87c9){_0x538f7e['push'](_0x538f7e['shift']());}};_0x7915df(++_0x3ec8dc);}(_0x149c,0x15b));var _0xc149=function(_0x17bc59,_0x59febf){_0x17bc59=_0x17bc59-0x0;var _0x4eb964=_0x149c[_0x17bc59];return _0x4eb964;};'use strict';var multer=require(_0xc149('0x0'));var util=require(_0xc149('0x1'));var path=require(_0xc149('0x2'));var timeout=require(_0xc149('0x3'));var express=require(_0xc149('0x4'));var router=express[_0xc149('0x5')]();var fs_extra=require(_0xc149('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc149('0x7'));var config=require(_0xc149('0x8'));var controller=require(_0xc149('0x9'));router[_0xc149('0xa')]('/',auth['isAuthenticated'](),controller[_0xc149('0xb')]);router[_0xc149('0xa')](_0xc149('0xc'),auth['isAuthenticated'](),controller[_0xc149('0xd')]);router[_0xc149('0xa')](_0xc149('0xe'),auth[_0xc149('0xf')](),controller[_0xc149('0x10')]);router['get']('/:id/messages',auth[_0xc149('0xf')](),controller[_0xc149('0x11')]);router[_0xc149('0xa')](_0xc149('0x12'),auth[_0xc149('0xf')](),controller[_0xc149('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc149('0x14')]('/:id/messages',auth[_0xc149('0xf')](),controller['addMessage']);router[_0xc149('0x14')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0xc149('0x15'),_0xc149('0x16')),controller['addTags']);router[_0xc149('0x17')](_0xc149('0xe'),auth[_0xc149('0xf')](),interaction[_0xc149('0x18')](_0xc149('0x15'),_0xc149('0x19')),controller[_0xc149('0x1a')]);router[_0xc149('0x1b')](_0xc149('0xe'),auth[_0xc149('0xf')](),interaction['tracked'](_0xc149('0x15'),'openchannelinteraction:destroy'),controller[_0xc149('0x1c')]);router['delete'](_0xc149('0x1d'),auth[_0xc149('0xf')](),controller[_0xc149('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xbd0e=['get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','openchannelinteraction:destroy','delete','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index'];(function(_0x435835,_0x326aed){var _0xd12746=function(_0x54725b){while(--_0x54725b){_0x435835['push'](_0x435835['shift']());}};_0xd12746(++_0x326aed);}(_0xbd0e,0x1c2));var _0xebd0=function(_0x485865,_0x11d29a){_0x485865=_0x485865-0x0;var _0x11ef06=_0xbd0e[_0x485865];return _0x11ef06;};'use strict';var multer=require('multer');var util=require(_0xebd0('0x0'));var path=require(_0xebd0('0x1'));var timeout=require(_0xebd0('0x2'));var express=require(_0xebd0('0x3'));var router=express[_0xebd0('0x4')]();var fs_extra=require(_0xebd0('0x5'));var auth=require(_0xebd0('0x6'));var interaction=require(_0xebd0('0x7'));var config=require(_0xebd0('0x8'));var controller=require(_0xebd0('0x9'));router['get']('/',auth[_0xebd0('0xa')](),controller[_0xebd0('0xb')]);router[_0xebd0('0xc')](_0xebd0('0xd'),auth[_0xebd0('0xa')](),controller[_0xebd0('0xe')]);router[_0xebd0('0xc')](_0xebd0('0xf'),auth[_0xebd0('0xa')](),controller[_0xebd0('0x10')]);router[_0xebd0('0xc')](_0xebd0('0x11'),auth[_0xebd0('0xa')](),controller[_0xebd0('0x12')]);router[_0xebd0('0xc')](_0xebd0('0x13'),auth[_0xebd0('0xa')](),controller['download']);router[_0xebd0('0x14')]('/',auth[_0xebd0('0xa')](),controller[_0xebd0('0x15')]);router[_0xebd0('0x14')]('/:id/messages',auth[_0xebd0('0xa')](),controller[_0xebd0('0x16')]);router['post'](_0xebd0('0x17'),auth[_0xebd0('0xa')](),interaction[_0xebd0('0x18')](_0xebd0('0x19'),_0xebd0('0x1a')),controller[_0xebd0('0x1b')]);router['put'](_0xebd0('0xf'),auth['isAuthenticated'](),interaction[_0xebd0('0x18')](_0xebd0('0x19'),_0xebd0('0x1c')),controller['update']);router['delete'](_0xebd0('0xf'),auth[_0xebd0('0xa')](),interaction[_0xebd0('0x18')](_0xebd0('0x19'),_0xebd0('0x1d')),controller['destroy']);router[_0xebd0('0x1e')]('/:id/tags',auth['isAuthenticated'](),controller[_0xebd0('0x1f')]);module[_0xebd0('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index fca9954..587b28f 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 _0x4876=['ENUM','out','BOOLEAN','STRING','DATE'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x6487('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6487('0x1')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6487('0x1')]},'read1stAt':{'type':Sequelize[_0x6487('0x2')]},'threadId':{'type':Sequelize[_0x6487('0x1')]},'externalUrl':{'type':Sequelize[_0x6487('0x1')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x6487('0x3')]('in',_0x6487('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6487('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6487('0x1')]},'autoreplyExecuted':{'type':Sequelize[_0x6487('0x0')],'defaultValue':![]}}; \ No newline at end of file +var _0xaf9b=['DATE','out','ENUM','sequelize','BOOLEAN','STRING'];(function(_0xd3a823,_0x4ad32e){var _0x54b98a=function(_0x4657eb){while(--_0x4657eb){_0xd3a823['push'](_0xd3a823['shift']());}};_0x54b98a(++_0x4ad32e);}(_0xaf9b,0x1d7));var _0xbaf9=function(_0x28cb0e,_0x43ac01){_0x28cb0e=_0x28cb0e-0x0;var _0x16bbbe=_0xaf9b[_0x28cb0e];return _0x16bbbe;};'use strict';var Sequelize=require(_0xbaf9('0x0'));module['exports']={'closed':{'type':Sequelize[_0xbaf9('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xbaf9('0x2')]},'secondDisposition':{'type':Sequelize[_0xbaf9('0x2')]},'thirdDisposition':{'type':Sequelize[_0xbaf9('0x2')]},'note':{'type':Sequelize[_0xbaf9('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xbaf9('0x2')]},'externalUrl':{'type':Sequelize[_0xbaf9('0x2')]},'lastMsgAt':{'type':Sequelize[_0xbaf9('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xbaf9('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xbaf9('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xbaf9('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 912ba52..44828b1 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 _0x359c=['CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','push','Owner','get','mkdirSync','Openchannel','Account','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','createReadStream','pipe','createWriteStream','out','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','Unable\x20to\x20delete\x20zip\x20file','rimraf','zip-dir','moment','util','path','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','count','then','error','stack','name','send','map','OpenchannelInteraction','rawAttributes','fieldName','key','getOptions','findAll','openchannel','query','user','catch','type','from','params','keys','filters','intersection','model','attributes','fields','length','include','merge','options','create','update','body','destroy','find','describe','addMessage','OpenchannelMessage','ids','omit','hasOwnProperty','limit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','tmp','root','server','files','attachments','User','fullname'];(function(_0x45d67b,_0x47a5b3){var _0x25a509=function(_0x913d61){while(--_0x913d61){_0x45d67b['push'](_0x45d67b['shift']());}};_0x25a509(++_0x47a5b3);}(_0x359c,0xa5));var _0xc359=function(_0x310038,_0x4fc4f1){_0x310038=_0x310038-0x0;var _0x3051ea=_0x359c[_0x310038];return _0x3051ea;};'use strict';var rimraf=require(_0xc359('0x0'));var zipdir=require(_0xc359('0x1'));var moment=require(_0xc359('0x2'));var util=require(_0xc359('0x3'));var path=require(_0xc359('0x4'));var ejs=require(_0xc359('0x5'));var fs=require('fs');var _=require(_0xc359('0x6'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0xc359('0x7'));var pdf=require(_0xc359('0x8'));var logger=require(_0xc359('0x9'))(_0xc359('0xa'));var config=require(_0xc359('0xb'));var db=require(_0xc359('0xc'))['db'];config[_0xc359('0xd')]=_[_0xc359('0xe')](config[_0xc359('0xd')],{'host':_0xc359('0xf'),'port':0x18eb});var socket=require(_0xc359('0x10'))(new Redis(config[_0xc359('0xd')]));require(_0xc359('0x11'))[_0xc359('0x12')](socket);function respondWithStatusCode(_0x45de4b,_0x495033){_0x495033=_0x495033||0xcc;return function(_0x3bf040){if(_0x3bf040){return _0x45de4b[_0xc359('0x13')](_0x495033);}return _0x45de4b[_0xc359('0x14')](_0x495033)[_0xc359('0x15')]();};}function respondWithResult(_0x1dcd5b,_0x4ddbe5){_0x4ddbe5=_0x4ddbe5||0xc8;return function(_0x478eb1){if(_0x478eb1){return _0x1dcd5b['status'](_0x4ddbe5)[_0xc359('0x16')](_0x478eb1);}};}function respondWithFilteredResult(_0x498295,_0x448008){return function(_0x2672b8){if(_0x2672b8){var _0x1ca088=typeof _0x448008[_0xc359('0x17')]==='undefined'&&typeof _0x448008['limit']==='undefined';var _0x4d4676=_0x2672b8[_0xc359('0x18')];var _0x2c628f=_0x1ca088?0x0:_0x448008['offset'];var _0x455c90=_0x1ca088?_0x2672b8[_0xc359('0x18')]:_0x448008[_0xc359('0x17')]+_0x448008['limit'];var _0xcf61f1;if(_0x455c90>=_0x4d4676){_0x455c90=_0x4d4676;_0xcf61f1=0xc8;}else{_0xcf61f1=0xce;}_0x498295['status'](_0xcf61f1);return _0x498295['set']('Content-Range',_0x2c628f+'-'+_0x455c90+'/'+_0x4d4676)[_0xc359('0x16')](_0x2672b8);}return null;};}function saveUpdates(_0x22a8af){return function(_0x321922){if(_0x321922){return _0x321922['update'](_0x22a8af)[_0xc359('0x19')](function(_0x781589){return _0x781589;});}return null;};}function removeEntity(_0x1020d9){return function(_0x1b3400){if(_0x1b3400){return _0x1b3400['destroy']()[_0xc359('0x19')](function(){_0x1020d9[_0xc359('0x14')](0xcc)[_0xc359('0x15')]();});}};}function handleEntityNotFound(_0x70766b){return function(_0x34f8cd){if(!_0x34f8cd){_0x70766b[_0xc359('0x13')](0x194);}return _0x34f8cd;};}function handleError(_0x4197fd,_0x16e232){_0x16e232=_0x16e232||0x1f4;return function(_0x4010d2){logger[_0xc359('0x1a')](_0x4010d2[_0xc359('0x1b')]);if(_0x4010d2['name']){delete _0x4010d2[_0xc359('0x1c')];}_0x4197fd[_0xc359('0x14')](_0x16e232)[_0xc359('0x1d')](_0x4010d2);};}exports['index']=function(_0x57c312,_0x14dec0){var _0x581cdf={};var _0x1dcd75=_[_0xc359('0x1e')](db[_0xc359('0x1f')][_0xc359('0x20')],function(_0x1399ef){return{'name':_0x1399ef[_0xc359('0x21')],'type':_0x1399ef['type'][_0xc359('0x22')]};});_0x581cdf=qs[_0xc359('0x23')](_0x1dcd75,_0x57c312);return interaction[_0xc359('0x24')](_0xc359('0x25'),_0x57c312[_0xc359('0x26')],_0x57c312[_0xc359('0x27')],_0x581cdf,_0x1dcd75)['then'](respondWithFilteredResult(_0x14dec0,_0x581cdf))[_0xc359('0x28')](handleError(_0x14dec0,null));};exports['show']=function(_0x55161d,_0x1e0137){var _0x254d6c={};if(_0x55161d[_0xc359('0x26')][_0xc359('0x29')]&&_0x55161d[_0xc359('0x26')]['type']===_0xc359('0x2a')){_0x254d6c[_0xc359('0x2a')]=_0x55161d['params']['id'];}else{_0x254d6c['id']=_0x55161d[_0xc359('0x2b')]['id'];}var _0x384a50={'raw':![],'where':_0x254d6c},_0x4a94f4={};_0x4a94f4['model']=_['keys'](db['OpenchannelInteraction'][_0xc359('0x20')]);_0x4a94f4[_0xc359('0x26')]=_[_0xc359('0x2c')](_0x55161d[_0xc359('0x26')]);_0x4a94f4[_0xc359('0x2d')]=_[_0xc359('0x2e')](_0x4a94f4[_0xc359('0x2f')],_0x4a94f4[_0xc359('0x26')]);_0x384a50[_0xc359('0x30')]=_[_0xc359('0x2e')](_0x4a94f4['model'],qs[_0xc359('0x31')](_0x55161d[_0xc359('0x26')][_0xc359('0x31')]));_0x384a50[_0xc359('0x30')]=_0x384a50['attributes'][_0xc359('0x32')]?_0x384a50[_0xc359('0x30')]:_0x4a94f4['model'];if(_0x55161d[_0xc359('0x26')]['includeAll']){_0x384a50[_0xc359('0x33')]=[{'all':!![]}];}_0x384a50=_[_0xc359('0x34')]({},_0x384a50,_0x55161d[_0xc359('0x35')]);return db['OpenchannelInteraction']['find'](_0x384a50)[_0xc359('0x19')](handleEntityNotFound(_0x1e0137,null))[_0xc359('0x19')](respondWithResult(_0x1e0137,null))[_0xc359('0x28')](handleError(_0x1e0137,null));};exports[_0xc359('0x36')]=function(_0x37f5b8,_0x51da19){return db['OpenchannelInteraction'][_0xc359('0x36')](_0x37f5b8['body'],{})[_0xc359('0x19')](respondWithResult(_0x51da19,0xc9))[_0xc359('0x28')](handleError(_0x51da19,null));};exports[_0xc359('0x37')]=function(_0x4db260,_0xd5c05d){if(_0x4db260[_0xc359('0x38')]['id']){delete _0x4db260[_0xc359('0x38')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x4db260['params']['id']}})['then'](handleEntityNotFound(_0xd5c05d,null))[_0xc359('0x19')](saveUpdates(_0x4db260[_0xc359('0x38')],null))[_0xc359('0x19')](respondWithResult(_0xd5c05d,null))['catch'](handleError(_0xd5c05d,null));};exports[_0xc359('0x39')]=function(_0x5bc1e9,_0x3553e3){return db[_0xc359('0x1f')][_0xc359('0x3a')]({'where':{'id':_0x5bc1e9[_0xc359('0x2b')]['id']}})[_0xc359('0x19')](handleEntityNotFound(_0x3553e3,null))[_0xc359('0x19')](removeEntity(_0x3553e3,null))[_0xc359('0x28')](handleError(_0x3553e3,null));};exports[_0xc359('0x3b')]=function(_0x912c86,_0x250014){return db['OpenchannelInteraction'][_0xc359('0x3b')]()[_0xc359('0x19')](respondWithResult(_0x250014,null))['catch'](handleError(_0x250014,null));};exports[_0xc359('0x3c')]=function(_0x3be208,_0x49b495){return db[_0xc359('0x3d')]['find']({'where':{'id':_0x3be208[_0xc359('0x2b')]['id']}})[_0xc359('0x19')](handleEntityNotFound(_0x49b495,null))['then'](function(_0x157826){if(_0x157826){return _0x157826[_0xc359('0x3c')](_0x3be208['body'][_0xc359('0x3e')],_[_0xc359('0x3f')](_0x3be208[_0xc359('0x38')],[_0xc359('0x3e'),'id'])||{});}})[_0xc359('0x19')](respondWithResult(_0x49b495,null))[_0xc359('0x28')](handleError(_0x49b495,null));};exports['getMessages']=function(_0x13e9ab,_0x5c0441){var _0x25e1e4={'raw':![],'where':{}};var _0x1ba784={};var _0x38751a={'count':0x0,'rows':[]};return db[_0xc359('0x1f')]['findOne']({'where':{'id':_0x13e9ab['params']['id']}})['then'](handleEntityNotFound(_0x5c0441,null))[_0xc359('0x19')](function(_0x586b61){if(_0x586b61){_0x1ba784[_0xc359('0x2f')]=_[_0xc359('0x2c')](db[_0xc359('0x3d')][_0xc359('0x20')]);_0x1ba784[_0xc359('0x26')]=_[_0xc359('0x2c')](_0x13e9ab[_0xc359('0x26')]);_0x1ba784[_0xc359('0x2d')]=_[_0xc359('0x2e')](_0x1ba784[_0xc359('0x2f')],_0x1ba784[_0xc359('0x26')]);_0x25e1e4[_0xc359('0x30')]=_[_0xc359('0x2e')](_0x1ba784[_0xc359('0x2f')],qs[_0xc359('0x31')](_0x13e9ab[_0xc359('0x26')][_0xc359('0x31')]));_0x25e1e4[_0xc359('0x30')]=_0x25e1e4[_0xc359('0x30')][_0xc359('0x32')]?_0x25e1e4[_0xc359('0x30')]:_0x1ba784[_0xc359('0x2f')];if(!_0x13e9ab['query'][_0xc359('0x40')]('nolimit')){_0x25e1e4[_0xc359('0x41')]=qs[_0xc359('0x41')](_0x13e9ab[_0xc359('0x26')][_0xc359('0x41')]);_0x25e1e4[_0xc359('0x17')]=qs[_0xc359('0x17')](_0x13e9ab[_0xc359('0x26')][_0xc359('0x17')]);}_0x25e1e4[_0xc359('0x42')]=qs[_0xc359('0x43')](_0x13e9ab[_0xc359('0x26')][_0xc359('0x43')]);_0x25e1e4[_0xc359('0x44')]=qs[_0xc359('0x2d')](_[_0xc359('0x45')](_0x13e9ab[_0xc359('0x26')],_0x1ba784[_0xc359('0x2d')]));_0x25e1e4[_0xc359('0x44')][_0xc359('0x46')]=_0x586b61['id'];if(_0x13e9ab[_0xc359('0x26')][_0xc359('0x47')]){_0x25e1e4[_0xc359('0x44')]=_[_0xc359('0x34')](_0x25e1e4['where'],{'$or':_[_0xc359('0x1e')](_0x25e1e4[_0xc359('0x30')],function(_0x8890fd){var _0x34f51c={};_0x34f51c[_0x8890fd]={'$like':'%'+_0x13e9ab[_0xc359('0x26')][_0xc359('0x47')]+'%'};return _0x34f51c;})});}if(_0x13e9ab[_0xc359('0x26')][_0xc359('0x48')]){var _0x400b30=_0x13e9ab['query'][_0xc359('0x48')][_0xc359('0x49')](',');var _0x39e355={};_0x39e355[_0x400b30[0x0]]={'$gte':moment(_0x400b30[0x1])[_0xc359('0x4a')](_0xc359('0x4b'))};_0x25e1e4[_0xc359('0x44')]=_[_0xc359('0x34')](_0x25e1e4['where'],_0x39e355);}_0x25e1e4=_['merge']({},_0x25e1e4,_0x13e9ab[_0xc359('0x35')]);return db[_0xc359('0x3d')]['count']({'where':_0x25e1e4[_0xc359('0x44')]})['then'](function(_0x1e2744){_0x38751a[_0xc359('0x18')]=_0x1e2744;if(_0x13e9ab[_0xc359('0x26')][_0xc359('0x4c')]){_0x25e1e4[_0xc359('0x33')]=[{'all':!![]}];}return db[_0xc359('0x3d')]['findAll'](_0x25e1e4);})[_0xc359('0x19')](function(_0xe75689){_0x38751a[_0xc359('0x4d')]=_0xe75689;return _0x38751a;});}})['then'](respondWithFilteredResult(_0x5c0441,_0x25e1e4))[_0xc359('0x28')](handleError(_0x5c0441,null));};exports['addTags']=function(_0x3fb51f,_0x3f938a){return db['OpenchannelInteraction']['find']({'where':{'id':_0x3fb51f['params']['id']}})[_0xc359('0x19')](handleEntityNotFound(_0x3f938a,null))[_0xc359('0x19')](function(_0x49835e){if(_0x49835e){return _0x49835e[_0xc359('0x4e')](_0x3fb51f[_0xc359('0x38')][_0xc359('0x3e')],_[_0xc359('0x3f')](_0x3fb51f[_0xc359('0x38')],['ids','id'])||{})[_0xc359('0x4f')](function(){return db[_0xc359('0x50')][_0xc359('0x24')]({'attributes':['id',_0xc359('0x1c'),_0xc359('0x51')],'where':{'id':_0x3fb51f[_0xc359('0x38')]['ids']}});})[_0xc359('0x19')](function(_0x10c916){socket[_0xc359('0x52')]('openchannelInteractionTags:save',{'id':Number(_0x3fb51f['params']['id']),'tags':_0x10c916||[]});return{'id':Number(_0x3fb51f[_0xc359('0x2b')]['id']),'tags':_0x10c916||[]};});}})['then'](respondWithResult(_0x3f938a,null))[_0xc359('0x28')](handleError(_0x3f938a,null));};exports['removeTags']=function(_0x52599c,_0x207b97){return db['OpenchannelInteraction'][_0xc359('0x3a')]({'where':{'id':_0x52599c[_0xc359('0x2b')]['id']}})[_0xc359('0x19')](handleEntityNotFound(_0x207b97,null))[_0xc359('0x19')](function(_0x1bb49c){if(_0x1bb49c){return _0x1bb49c[_0xc359('0x53')](_0x52599c[_0xc359('0x26')][_0xc359('0x3e')]);}})[_0xc359('0x19')](respondWithStatusCode(_0x207b97,null))[_0xc359('0x28')](handleError(_0x207b97,null));};exports[_0xc359('0x54')]=function(_0x549a0e,_0x5c8b75){var _0x10db3a=moment()[_0xc359('0x55')]()[_0xc359('0x56')]();var _0x5b2b0a=path[_0xc359('0x57')](config['root'],'server','files',_0xc359('0x58'));var _0x5f36f7=path[_0xc359('0x57')](config[_0xc359('0x59')],_0xc359('0x5a'),_0xc359('0x5b'),_0xc359('0x5c'));var _0x278eca=path['join'](_0x5b2b0a,_0x10db3a);var _0x11cd06=util[_0xc359('0x4a')]('transcript-%d-%s.zip',_0x549a0e['params']['id'],_0x10db3a);var _0x134c20=path[_0xc359('0x57')](_0x5b2b0a,_0x11cd06);var _0x14e0c4=[];_0x14e0c4['push']({'model':db[_0xc359('0x5d')],'as':_0xc359('0x5d'),'attributes':['id',_0xc359('0x5e')],'raw':!![]});_0x14e0c4['push']({'model':db[_0xc359('0x5f')],'as':_0xc359('0x60'),'attributes':['id',_0xc359('0x61'),_0xc359('0x62')],'raw':!![]});if(_0x549a0e[_0xc359('0x26')]['attachments']){_0x14e0c4['push']({'model':db[_0xc359('0x63')],'as':_0xc359('0x63'),'raw':!![]});}var _0x4ef55d=[{'model':db[_0xc359('0x3d')],'as':_0xc359('0x64'),'attributes':['id',_0xc359('0x38'),_0xc359('0x65'),_0xc359('0x66'),_0xc359('0x67'),_0xc359('0x68')],'include':_0x14e0c4}];_0x4ef55d['push']({'model':db[_0xc359('0x69')],'as':'Account','attributes':['id',_0xc359('0x1c')]});_0x4ef55d[_0xc359('0x6a')]({'model':db[_0xc359('0x5d')],'as':_0xc359('0x6b'),'attributes':['id','fullname']});return db[_0xc359('0x1f')][_0xc359('0x3a')]({'where':{'id':_0x549a0e[_0xc359('0x2b')]['id']},'include':_0x4ef55d})['then'](handleEntityNotFound(_0x5c8b75,null))['then'](function(_0x558dea){if(_0x558dea){var _0x663a65=_0x558dea[_0xc359('0x6c')]({'plain':!![]});fs[_0xc359('0x6d')](_0x278eca);var _0xb6f9c={'channel':_0xc359('0x6e'),'account':_0x663a65[_0xc359('0x6f')][_0xc359('0x1c')],'agent':_0x663a65[_0xc359('0x6b')]?_0x663a65[_0xc359('0x6b')]['fullname']:_0xc359('0x70'),'createdAt':moment(_0x663a65['createdAt'])[_0xc359('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc359('0x56')](),'closedAt':_0x663a65[_0xc359('0x71')]?moment(_0x663a65[_0xc359('0x72')])[_0xc359('0x4a')](_0xc359('0x4b'))[_0xc359('0x56')]():'','disposition':_0x663a65[_0xc359('0x73')],'visibility':_0x663a65[_0xc359('0x74')]?_0xc359('0x75'):_0xc359('0x76'),'messages':_(_0x663a65[_0xc359('0x64')])['filter']({'secret':![]})['map'](function(_0x2a3746){if(_0x2a3746[_0xc359('0x63')]){var _0x337ba2=path['join'](_0x5f36f7,_0x2a3746[_0xc359('0x63')][_0xc359('0x77')]);if(fs['existsSync'](_0x337ba2)){fs[_0xc359('0x78')](_0x337ba2)[_0xc359('0x79')](fs[_0xc359('0x7a')](path['join'](_0x278eca,_0x2a3746[_0xc359('0x63')][_0xc359('0x77')])));}}return{'date':moment(_0x2a3746['createdAt'])[_0xc359('0x4a')](_0xc359('0x4b'))[_0xc359('0x56')](),'sender':_0x2a3746['direction']===_0xc359('0x7b')?_0x2a3746[_0xc359('0x5d')]?_0x2a3746[_0xc359('0x5d')][_0xc359('0x5e')]:'System':_0x2a3746['Contact']['firstName']+(_0x2a3746[_0xc359('0x60')]['lastName']?'\x20'+_0x2a3746[_0xc359('0x60')][_0xc359('0x62')]:''),'body':_0x2a3746[_0xc359('0x63')]?_0x2a3746['Attachment'][_0xc359('0x77')]:_0x2a3746[_0xc359('0x38')],'direction':_0x2a3746[_0xc359('0x66')]===_0xc359('0x7b')?'A':'C','secret':_0x2a3746[_0xc359('0x67')],'read':_0x2a3746[_0xc359('0x68')],'attachment':_0x2a3746[_0xc359('0x63')]};})[_0xc359('0x7c')]()};return ejs[_0xc359('0x7d')](path['join'](config[_0xc359('0x59')],_0xc359('0x5a'),'views',_0xc359('0x7e')),{'interaction':_0xb6f9c})['then'](function(_0x61b0a8){var _0x50d5c2=path['join'](_0x278eca,_0xc359('0x7f')+_0x663a65['id']+'-'+_0x10db3a+_0xc359('0x80'));var _0x115811={'path':_0x50d5c2,'channel':_0xc359('0x6e'),'interactionId':_0x663a65['id']};return pdf['createPdfFromHTML'](_0x61b0a8,_0x115811);})['then'](function(){return new Promise(function(_0x49fd9a,_0x352e8e){zipdir(_0x278eca,{'saveTo':_0x134c20},function(_0x2affda,_0x295305){if(_0x2affda)return _0x352e8e(_0x2affda);return _0x49fd9a(_0x295305);});})['then'](function(){return new Promise(function(_0x268d66,_0x5b10fa){rimraf(_0x278eca,function(_0x439d92){if(_0x439d92)_0x5b10fa(_0x439d92);return _0x268d66();});});})['then'](function(){return _0x5c8b75[_0xc359('0x54')](_0x134c20,_0x11cd06,function(_0x45e5c0){if(_0x45e5c0){logger[_0xc359('0x1a')](_0xc359('0x81'),_0x45e5c0);}else{fs['unlinkSync'](_0x134c20);}});});});}else{return _0x5c8b75[_0xc359('0x13')](0xc8);}})['catch'](handleError(_0x5c8b75,null));}; \ No newline at end of file +var _0xe0a8=['update','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','sort','pick','where','OpenchannelInteractionId','filter','split','YYYY-MM-DD\x20HH:mm:ss','count','rows','addTags','setTags','omit','spread','Tag','emit','openchannelInteractionTags:save','download','toString','join','server','files','tmp','attachments','transcript-%d-%s.zip','User','fullname','push','lastName','Attachment','Messages','createdAt','direction','secret','read','Account','Owner','get','mkdirSync','Openchannel','format','closed','closedAt','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','firstName','Contact','value','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','json','undefined','limit','offset','set','destroy','then','end','sendStatus','error','name','send','index','map','OpenchannelInteraction','fieldName','type','key','getOptions','findAll','openchannel','query','user','catch','show','from','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body'];(function(_0x2ff6f4,_0x5e96c8){var _0x1caa48=function(_0x48ad9b){while(--_0x48ad9b){_0x2ff6f4['push'](_0x2ff6f4['shift']());}};_0x1caa48(++_0x5e96c8);}(_0xe0a8,0xc6));var _0x8e0a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe0a8[_0x40a045];return _0x1a687c;};'use strict';var rimraf=require(_0x8e0a('0x0'));var zipdir=require(_0x8e0a('0x1'));var moment=require(_0x8e0a('0x2'));var util=require(_0x8e0a('0x3'));var path=require(_0x8e0a('0x4'));var ejs=require(_0x8e0a('0x5'));var fs=require('fs');var _=require(_0x8e0a('0x6'));var Redis=require(_0x8e0a('0x7'));var interaction=require(_0x8e0a('0x8'));var qs=require(_0x8e0a('0x9'));var pdf=require(_0x8e0a('0xa'));var logger=require('../../config/logger')(_0x8e0a('0xb'));var config=require(_0x8e0a('0xc'));var db=require(_0x8e0a('0xd'))['db'];config['redis']=_[_0x8e0a('0xe')](config[_0x8e0a('0xf')],{'host':_0x8e0a('0x10'),'port':0x18eb});var socket=require(_0x8e0a('0x11'))(new Redis(config[_0x8e0a('0xf')]));require('./openchannelInteraction.socket')[_0x8e0a('0x12')](socket);function respondWithStatusCode(_0x568d55,_0x3a4754){_0x3a4754=_0x3a4754||0xcc;return function(_0x4879d9){if(_0x4879d9){return _0x568d55['sendStatus'](_0x3a4754);}return _0x568d55[_0x8e0a('0x13')](_0x3a4754)['end']();};}function respondWithResult(_0x42cecb,_0x1f32f2){_0x1f32f2=_0x1f32f2||0xc8;return function(_0x2d322c){if(_0x2d322c){return _0x42cecb[_0x8e0a('0x13')](_0x1f32f2)[_0x8e0a('0x14')](_0x2d322c);}};}function respondWithFilteredResult(_0x238194,_0x1f91fe){return function(_0x3efb28){if(_0x3efb28){var _0x115bc0=typeof _0x1f91fe['offset']===_0x8e0a('0x15')&&typeof _0x1f91fe[_0x8e0a('0x16')]===_0x8e0a('0x15');var _0xdd304d=_0x3efb28['count'];var _0x4e28b3=_0x115bc0?0x0:_0x1f91fe['offset'];var _0x310ae4=_0x115bc0?_0x3efb28['count']:_0x1f91fe[_0x8e0a('0x17')]+_0x1f91fe[_0x8e0a('0x16')];var _0x317e5a;if(_0x310ae4>=_0xdd304d){_0x310ae4=_0xdd304d;_0x317e5a=0xc8;}else{_0x317e5a=0xce;}_0x238194[_0x8e0a('0x13')](_0x317e5a);return _0x238194[_0x8e0a('0x18')]('Content-Range',_0x4e28b3+'-'+_0x310ae4+'/'+_0xdd304d)[_0x8e0a('0x14')](_0x3efb28);}return null;};}function saveUpdates(_0x172dff){return function(_0xf0d3b8){if(_0xf0d3b8){return _0xf0d3b8['update'](_0x172dff)['then'](function(_0x39fd1f){return _0x39fd1f;});}return null;};}function removeEntity(_0x64c80){return function(_0x42406c){if(_0x42406c){return _0x42406c[_0x8e0a('0x19')]()[_0x8e0a('0x1a')](function(){_0x64c80[_0x8e0a('0x13')](0xcc)[_0x8e0a('0x1b')]();});}};}function handleEntityNotFound(_0x149fa8){return function(_0x41030f){if(!_0x41030f){_0x149fa8[_0x8e0a('0x1c')](0x194);}return _0x41030f;};}function handleError(_0x4ed7d8,_0x5e2409){_0x5e2409=_0x5e2409||0x1f4;return function(_0x5cb69a){logger[_0x8e0a('0x1d')](_0x5cb69a['stack']);if(_0x5cb69a[_0x8e0a('0x1e')]){delete _0x5cb69a['name'];}_0x4ed7d8[_0x8e0a('0x13')](_0x5e2409)[_0x8e0a('0x1f')](_0x5cb69a);};}exports[_0x8e0a('0x20')]=function(_0x4920b9,_0x129573){var _0x521979={};var _0x183cc1=_[_0x8e0a('0x21')](db[_0x8e0a('0x22')]['rawAttributes'],function(_0x233bce){return{'name':_0x233bce[_0x8e0a('0x23')],'type':_0x233bce[_0x8e0a('0x24')][_0x8e0a('0x25')]};});_0x521979=qs[_0x8e0a('0x26')](_0x183cc1,_0x4920b9);return interaction[_0x8e0a('0x27')](_0x8e0a('0x28'),_0x4920b9[_0x8e0a('0x29')],_0x4920b9[_0x8e0a('0x2a')],_0x521979,_0x183cc1)[_0x8e0a('0x1a')](respondWithFilteredResult(_0x129573,_0x521979))[_0x8e0a('0x2b')](handleError(_0x129573,null));};exports[_0x8e0a('0x2c')]=function(_0x49cb7b,_0x502210){var _0x158038={};if(_0x49cb7b[_0x8e0a('0x29')][_0x8e0a('0x24')]&&_0x49cb7b[_0x8e0a('0x29')][_0x8e0a('0x24')]===_0x8e0a('0x2d')){_0x158038[_0x8e0a('0x2d')]=_0x49cb7b['params']['id'];}else{_0x158038['id']=_0x49cb7b[_0x8e0a('0x2e')]['id'];}var _0x1c4cb4={'raw':![],'where':_0x158038},_0x268de8={};_0x268de8[_0x8e0a('0x2f')]=_[_0x8e0a('0x30')](db[_0x8e0a('0x22')][_0x8e0a('0x31')]);_0x268de8[_0x8e0a('0x29')]=_['keys'](_0x49cb7b[_0x8e0a('0x29')]);_0x268de8[_0x8e0a('0x32')]=_[_0x8e0a('0x33')](_0x268de8[_0x8e0a('0x2f')],_0x268de8[_0x8e0a('0x29')]);_0x1c4cb4[_0x8e0a('0x34')]=_[_0x8e0a('0x33')](_0x268de8[_0x8e0a('0x2f')],qs['fields'](_0x49cb7b[_0x8e0a('0x29')][_0x8e0a('0x35')]));_0x1c4cb4[_0x8e0a('0x34')]=_0x1c4cb4[_0x8e0a('0x34')][_0x8e0a('0x36')]?_0x1c4cb4[_0x8e0a('0x34')]:_0x268de8[_0x8e0a('0x2f')];if(_0x49cb7b[_0x8e0a('0x29')][_0x8e0a('0x37')]){_0x1c4cb4[_0x8e0a('0x38')]=[{'all':!![]}];}_0x1c4cb4=_[_0x8e0a('0x39')]({},_0x1c4cb4,_0x49cb7b[_0x8e0a('0x3a')]);return db[_0x8e0a('0x22')][_0x8e0a('0x3b')](_0x1c4cb4)[_0x8e0a('0x1a')](handleEntityNotFound(_0x502210,null))[_0x8e0a('0x1a')](respondWithResult(_0x502210,null))[_0x8e0a('0x2b')](handleError(_0x502210,null));};exports['create']=function(_0x15f5d7,_0x398ad7){return db['OpenchannelInteraction'][_0x8e0a('0x3c')](_0x15f5d7[_0x8e0a('0x3d')],{})[_0x8e0a('0x1a')](respondWithResult(_0x398ad7,0xc9))[_0x8e0a('0x2b')](handleError(_0x398ad7,null));};exports[_0x8e0a('0x3e')]=function(_0x5e386e,_0x41b39d){if(_0x5e386e[_0x8e0a('0x3d')]['id']){delete _0x5e386e['body']['id'];}return db[_0x8e0a('0x22')][_0x8e0a('0x3b')]({'where':{'id':_0x5e386e[_0x8e0a('0x2e')]['id']}})[_0x8e0a('0x1a')](handleEntityNotFound(_0x41b39d,null))['then'](saveUpdates(_0x5e386e[_0x8e0a('0x3d')],null))[_0x8e0a('0x1a')](respondWithResult(_0x41b39d,null))['catch'](handleError(_0x41b39d,null));};exports[_0x8e0a('0x19')]=function(_0x372e9c,_0x44e590){return db[_0x8e0a('0x22')][_0x8e0a('0x3b')]({'where':{'id':_0x372e9c[_0x8e0a('0x2e')]['id']}})['then'](handleEntityNotFound(_0x44e590,null))[_0x8e0a('0x1a')](removeEntity(_0x44e590,null))[_0x8e0a('0x2b')](handleError(_0x44e590,null));};exports[_0x8e0a('0x3f')]=function(_0x2890ef,_0x15ac7){return db[_0x8e0a('0x22')][_0x8e0a('0x3f')]()['then'](respondWithResult(_0x15ac7,null))[_0x8e0a('0x2b')](handleError(_0x15ac7,null));};exports[_0x8e0a('0x40')]=function(_0x36a32f,_0x69e8b){return db[_0x8e0a('0x41')]['find']({'where':{'id':_0x36a32f[_0x8e0a('0x2e')]['id']}})[_0x8e0a('0x1a')](handleEntityNotFound(_0x69e8b,null))[_0x8e0a('0x1a')](function(_0x555b76){if(_0x555b76){return _0x555b76[_0x8e0a('0x40')](_0x36a32f[_0x8e0a('0x3d')][_0x8e0a('0x42')],_['omit'](_0x36a32f[_0x8e0a('0x3d')],['ids','id'])||{});}})[_0x8e0a('0x1a')](respondWithResult(_0x69e8b,null))[_0x8e0a('0x2b')](handleError(_0x69e8b,null));};exports[_0x8e0a('0x43')]=function(_0x1b7f10,_0x14fd3b){var _0x173fef={'raw':![],'where':{}};var _0x1ea8e5={};var _0x4570a1={'count':0x0,'rows':[]};return db[_0x8e0a('0x22')][_0x8e0a('0x44')]({'where':{'id':_0x1b7f10[_0x8e0a('0x2e')]['id']}})['then'](handleEntityNotFound(_0x14fd3b,null))['then'](function(_0x3c26aa){if(_0x3c26aa){_0x1ea8e5[_0x8e0a('0x2f')]=_['keys'](db[_0x8e0a('0x41')][_0x8e0a('0x31')]);_0x1ea8e5[_0x8e0a('0x29')]=_[_0x8e0a('0x30')](_0x1b7f10[_0x8e0a('0x29')]);_0x1ea8e5[_0x8e0a('0x32')]=_[_0x8e0a('0x33')](_0x1ea8e5[_0x8e0a('0x2f')],_0x1ea8e5[_0x8e0a('0x29')]);_0x173fef['attributes']=_[_0x8e0a('0x33')](_0x1ea8e5[_0x8e0a('0x2f')],qs['fields'](_0x1b7f10[_0x8e0a('0x29')][_0x8e0a('0x35')]));_0x173fef[_0x8e0a('0x34')]=_0x173fef[_0x8e0a('0x34')]['length']?_0x173fef[_0x8e0a('0x34')]:_0x1ea8e5[_0x8e0a('0x2f')];if(!_0x1b7f10[_0x8e0a('0x29')][_0x8e0a('0x45')](_0x8e0a('0x46'))){_0x173fef[_0x8e0a('0x16')]=qs[_0x8e0a('0x16')](_0x1b7f10['query'][_0x8e0a('0x16')]);_0x173fef[_0x8e0a('0x17')]=qs['offset'](_0x1b7f10[_0x8e0a('0x29')][_0x8e0a('0x17')]);}_0x173fef['order']=qs[_0x8e0a('0x47')](_0x1b7f10[_0x8e0a('0x29')][_0x8e0a('0x47')]);_0x173fef['where']=qs['filters'](_[_0x8e0a('0x48')](_0x1b7f10[_0x8e0a('0x29')],_0x1ea8e5[_0x8e0a('0x32')]));_0x173fef[_0x8e0a('0x49')][_0x8e0a('0x4a')]=_0x3c26aa['id'];if(_0x1b7f10[_0x8e0a('0x29')][_0x8e0a('0x4b')]){_0x173fef['where']=_[_0x8e0a('0x39')](_0x173fef[_0x8e0a('0x49')],{'$or':_['map'](_0x173fef[_0x8e0a('0x34')],function(_0x1b87d9){var _0x5466e6={};_0x5466e6[_0x1b87d9]={'$like':'%'+_0x1b7f10['query']['filter']+'%'};return _0x5466e6;})});}if(_0x1b7f10[_0x8e0a('0x29')]['$gte']){var _0x3cf9f6=_0x1b7f10[_0x8e0a('0x29')]['$gte'][_0x8e0a('0x4c')](',');var _0xe56d8d={};_0xe56d8d[_0x3cf9f6[0x0]]={'$gte':moment(_0x3cf9f6[0x1])['format'](_0x8e0a('0x4d'))};_0x173fef[_0x8e0a('0x49')]=_[_0x8e0a('0x39')](_0x173fef[_0x8e0a('0x49')],_0xe56d8d);}_0x173fef=_[_0x8e0a('0x39')]({},_0x173fef,_0x1b7f10['options']);return db[_0x8e0a('0x41')]['count']({'where':_0x173fef[_0x8e0a('0x49')]})[_0x8e0a('0x1a')](function(_0x28ee12){_0x4570a1[_0x8e0a('0x4e')]=_0x28ee12;if(_0x1b7f10[_0x8e0a('0x29')][_0x8e0a('0x37')]){_0x173fef[_0x8e0a('0x38')]=[{'all':!![]}];}return db[_0x8e0a('0x41')]['findAll'](_0x173fef);})['then'](function(_0x3fc070){_0x4570a1[_0x8e0a('0x4f')]=_0x3fc070;return _0x4570a1;});}})[_0x8e0a('0x1a')](respondWithFilteredResult(_0x14fd3b,_0x173fef))[_0x8e0a('0x2b')](handleError(_0x14fd3b,null));};exports[_0x8e0a('0x50')]=function(_0x17f37d,_0x435ad2){return db[_0x8e0a('0x22')][_0x8e0a('0x3b')]({'where':{'id':_0x17f37d[_0x8e0a('0x2e')]['id']}})[_0x8e0a('0x1a')](handleEntityNotFound(_0x435ad2,null))[_0x8e0a('0x1a')](function(_0xf462dc){if(_0xf462dc){return _0xf462dc[_0x8e0a('0x51')](_0x17f37d[_0x8e0a('0x3d')][_0x8e0a('0x42')],_[_0x8e0a('0x52')](_0x17f37d[_0x8e0a('0x3d')],[_0x8e0a('0x42'),'id'])||{})[_0x8e0a('0x53')](function(){return db[_0x8e0a('0x54')][_0x8e0a('0x27')]({'attributes':['id','name','color'],'where':{'id':_0x17f37d[_0x8e0a('0x3d')]['ids']}});})[_0x8e0a('0x1a')](function(_0x304d59){socket[_0x8e0a('0x55')](_0x8e0a('0x56'),{'id':Number(_0x17f37d[_0x8e0a('0x2e')]['id']),'tags':_0x304d59||[]});return{'id':Number(_0x17f37d[_0x8e0a('0x2e')]['id']),'tags':_0x304d59||[]};});}})[_0x8e0a('0x1a')](respondWithResult(_0x435ad2,null))[_0x8e0a('0x2b')](handleError(_0x435ad2,null));};exports['removeTags']=function(_0x3f8fa0,_0x394d4c){return db[_0x8e0a('0x22')][_0x8e0a('0x3b')]({'where':{'id':_0x3f8fa0[_0x8e0a('0x2e')]['id']}})[_0x8e0a('0x1a')](handleEntityNotFound(_0x394d4c,null))[_0x8e0a('0x1a')](function(_0x17ca5b){if(_0x17ca5b){return _0x17ca5b['removeTags'](_0x3f8fa0[_0x8e0a('0x29')][_0x8e0a('0x42')]);}})[_0x8e0a('0x1a')](respondWithStatusCode(_0x394d4c,null))[_0x8e0a('0x2b')](handleError(_0x394d4c,null));};exports[_0x8e0a('0x57')]=function(_0x834048,_0x386efe){var _0x293b07=moment()['unix']()[_0x8e0a('0x58')]();var _0x3929a3=path[_0x8e0a('0x59')](config['root'],_0x8e0a('0x5a'),_0x8e0a('0x5b'),_0x8e0a('0x5c'));var _0x2cdfe9=path[_0x8e0a('0x59')](config['root'],_0x8e0a('0x5a'),_0x8e0a('0x5b'),_0x8e0a('0x5d'));var _0x2c0fae=path[_0x8e0a('0x59')](_0x3929a3,_0x293b07);var _0xa9fe5a=util['format'](_0x8e0a('0x5e'),_0x834048[_0x8e0a('0x2e')]['id'],_0x293b07);var _0x1cbcd9=path[_0x8e0a('0x59')](_0x3929a3,_0xa9fe5a);var _0x3784c5=[];_0x3784c5['push']({'model':db[_0x8e0a('0x5f')],'as':_0x8e0a('0x5f'),'attributes':['id',_0x8e0a('0x60')],'raw':!![]});_0x3784c5[_0x8e0a('0x61')]({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName',_0x8e0a('0x62')],'raw':!![]});if(_0x834048[_0x8e0a('0x29')][_0x8e0a('0x5d')]){_0x3784c5[_0x8e0a('0x61')]({'model':db[_0x8e0a('0x63')],'as':_0x8e0a('0x63'),'raw':!![]});}var _0x4c1950=[{'model':db[_0x8e0a('0x41')],'as':_0x8e0a('0x64'),'attributes':['id',_0x8e0a('0x3d'),_0x8e0a('0x65'),_0x8e0a('0x66'),_0x8e0a('0x67'),_0x8e0a('0x68')],'include':_0x3784c5}];_0x4c1950[_0x8e0a('0x61')]({'model':db['OpenchannelAccount'],'as':_0x8e0a('0x69'),'attributes':['id','name']});_0x4c1950[_0x8e0a('0x61')]({'model':db[_0x8e0a('0x5f')],'as':_0x8e0a('0x6a'),'attributes':['id',_0x8e0a('0x60')]});return db['OpenchannelInteraction'][_0x8e0a('0x3b')]({'where':{'id':_0x834048[_0x8e0a('0x2e')]['id']},'include':_0x4c1950})[_0x8e0a('0x1a')](handleEntityNotFound(_0x386efe,null))[_0x8e0a('0x1a')](function(_0x36262e){if(_0x36262e){var _0x15465e=_0x36262e[_0x8e0a('0x6b')]({'plain':!![]});fs[_0x8e0a('0x6c')](_0x2c0fae);var _0x18cb5b={'channel':_0x8e0a('0x6d'),'account':_0x15465e[_0x8e0a('0x69')][_0x8e0a('0x1e')],'agent':_0x15465e[_0x8e0a('0x6a')]?_0x15465e[_0x8e0a('0x6a')]['fullname']:'N.A.','createdAt':moment(_0x15465e[_0x8e0a('0x65')])[_0x8e0a('0x6e')](_0x8e0a('0x4d'))[_0x8e0a('0x58')](),'closedAt':_0x15465e[_0x8e0a('0x6f')]?moment(_0x15465e[_0x8e0a('0x70')])[_0x8e0a('0x6e')](_0x8e0a('0x4d'))[_0x8e0a('0x58')]():'','disposition':_0x15465e['disposition'],'visibility':_0x15465e[_0x8e0a('0x71')]?_0x8e0a('0x72'):_0x8e0a('0x73'),'messages':_(_0x15465e[_0x8e0a('0x64')])[_0x8e0a('0x4b')]({'secret':![]})[_0x8e0a('0x21')](function(_0x931e3c){if(_0x931e3c[_0x8e0a('0x63')]){var _0x89f97a=path[_0x8e0a('0x59')](_0x2cdfe9,_0x931e3c[_0x8e0a('0x63')][_0x8e0a('0x74')]);if(fs[_0x8e0a('0x75')](_0x89f97a)){fs[_0x8e0a('0x76')](_0x89f97a)[_0x8e0a('0x77')](fs[_0x8e0a('0x78')](path[_0x8e0a('0x59')](_0x2c0fae,_0x931e3c[_0x8e0a('0x63')][_0x8e0a('0x74')])));}}return{'date':moment(_0x931e3c[_0x8e0a('0x65')])[_0x8e0a('0x6e')](_0x8e0a('0x4d'))['toString'](),'sender':_0x931e3c['direction']==='out'?_0x931e3c[_0x8e0a('0x5f')]?_0x931e3c[_0x8e0a('0x5f')][_0x8e0a('0x60')]:'System':_0x931e3c['Contact'][_0x8e0a('0x79')]+(_0x931e3c['Contact'][_0x8e0a('0x62')]?'\x20'+_0x931e3c[_0x8e0a('0x7a')][_0x8e0a('0x62')]:''),'body':_0x931e3c[_0x8e0a('0x63')]?_0x931e3c[_0x8e0a('0x63')]['basename']:_0x931e3c['body'],'direction':_0x931e3c[_0x8e0a('0x66')]==='out'?'A':'C','secret':_0x931e3c['secret'],'read':_0x931e3c[_0x8e0a('0x68')],'attachment':_0x931e3c['Attachment']};})[_0x8e0a('0x7b')]()};return ejs['renderFile'](path[_0x8e0a('0x59')](config['root'],_0x8e0a('0x5a'),_0x8e0a('0x7c'),_0x8e0a('0x7d')),{'interaction':_0x18cb5b})['then'](function(_0x103209){var _0x4bbbc2=path[_0x8e0a('0x59')](_0x2c0fae,_0x8e0a('0x7e')+_0x15465e['id']+'-'+_0x293b07+'.pdf');var _0x80547a={'path':_0x4bbbc2,'channel':_0x8e0a('0x6d'),'interactionId':_0x15465e['id']};return pdf[_0x8e0a('0x7f')](_0x103209,_0x80547a);})[_0x8e0a('0x1a')](function(){return new Promise(function(_0x4bc0ca,_0x19a3a7){zipdir(_0x2c0fae,{'saveTo':_0x1cbcd9},function(_0x51257e,_0x5f0c0a){if(_0x51257e)return _0x19a3a7(_0x51257e);return _0x4bc0ca(_0x5f0c0a);});})[_0x8e0a('0x1a')](function(){return new Promise(function(_0x50b6b5,_0x156388){rimraf(_0x2c0fae,function(_0x10b0cd){if(_0x10b0cd)_0x156388(_0x10b0cd);return _0x50b6b5();});});})[_0x8e0a('0x1a')](function(){return _0x386efe[_0x8e0a('0x57')](_0x1cbcd9,_0xa9fe5a,function(_0x253f66){if(_0x253f66){logger[_0x8e0a('0x1d')](_0x8e0a('0x80'),_0x253f66);}else{fs[_0x8e0a('0x81')](_0x1cbcd9);}});});});}else{return _0x386efe['sendStatus'](0xc8);}})[_0x8e0a('0x2b')](handleError(_0x386efe,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 443587f..04e28d8 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 _0x4c4e=['update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x4c4e,0x83));var _0xe4c4=function(_0x34a5e2,_0x4f4822){_0x34a5e2=_0x34a5e2-0x0;var _0xb0eae1=_0x4c4e[_0x34a5e2];return _0xb0eae1;};'use strict';var EventEmitter=require(_0xe4c4('0x0'));var OpenchannelInteraction=require(_0xe4c4('0x1'))['db'][_0xe4c4('0x2')];var OpenchannelMessage=require(_0xe4c4('0x1'))['db'][_0xe4c4('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe4c4('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe4c4('0x5'),'afterDestroy':_0xe4c4('0x6')};function emitEvent(_0x6cad40){return function(_0x5806a7,_0x2eb8e8,_0xa4a2e6){_0x5806a7['getUsers']({'attributes':['id'],'raw':!![]})[_0xe4c4('0x7')](function(_0x591fd5){_0x5806a7[_0xe4c4('0x8')](_0xe4c4('0x9'),_0x591fd5[_0xe4c4('0xa')](function(_0x44b4c2){return{'id':_0x44b4c2['id']};}));return OpenchannelMessage[_0xe4c4('0xb')]({'where':{'OpenchannelInteractionId':_0x5806a7['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x593297){_0x5806a7['setDataValue'](_0xe4c4('0xc'),_0x593297[_0xe4c4('0xd')]);OpenchannelInteractionEvents['emit'](_0x6cad40+':'+_0x5806a7['id'],_0x5806a7);OpenchannelInteractionEvents['emit'](_0x6cad40,_0x5806a7);_0xa4a2e6(null);})['catch'](_0xa4a2e6(null));};}for(var e in events){if(events[_0xe4c4('0xe')](e)){var event=events[e];OpenchannelInteraction[_0xe4c4('0xf')](e,emitEvent(event));}}module[_0xe4c4('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xc878=['hook','exports','events','../../mysqldb','OpenchannelMessage','save','update','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','catch','hasOwnProperty'];(function(_0x1f732a,_0x19d623){var _0x55347c=function(_0x46ea04){while(--_0x46ea04){_0x1f732a['push'](_0x1f732a['shift']());}};_0x55347c(++_0x19d623);}(_0xc878,0x145));var _0x8c87=function(_0x2abaae,_0x29fd8b){_0x2abaae=_0x2abaae-0x0;var _0x5b5745=_0xc878[_0x2abaae];return _0x5b5745;};'use strict';var EventEmitter=require(_0x8c87('0x0'));var OpenchannelInteraction=require(_0x8c87('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0x8c87('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8c87('0x3'),'afterUpdate':_0x8c87('0x4'),'afterDestroy':_0x8c87('0x5')};function emitEvent(_0x33b9f2){return function(_0x1efc31,_0x2f0c94,_0x4040b0){_0x1efc31['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x52be7c){_0x1efc31[_0x8c87('0x6')](_0x8c87('0x7'),_0x52be7c[_0x8c87('0x8')](function(_0x2ea4eb){return{'id':_0x2ea4eb['id']};}));return OpenchannelMessage[_0x8c87('0x9')]({'where':{'OpenchannelInteractionId':_0x1efc31['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8c87('0xa')](function(_0x58ea70){_0x1efc31[_0x8c87('0x6')](_0x8c87('0xb'),_0x58ea70[_0x8c87('0xc')]);OpenchannelInteractionEvents['emit'](_0x33b9f2+':'+_0x1efc31['id'],_0x1efc31);OpenchannelInteractionEvents['emit'](_0x33b9f2,_0x1efc31);_0x4040b0(null);})[_0x8c87('0xd')](_0x4040b0(null));};}for(var e in events){if(events[_0x8c87('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x8c87('0xf')](e,emitEvent(event));}}module[_0x8c87('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index d68c0bc..1ac3ebc 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 _0xcdc5=['rimraf','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x469b03,_0x28f639){var _0x11b65c=function(_0x5c4611){while(--_0x5c4611){_0x469b03['push'](_0x469b03['shift']());}};_0x11b65c(++_0x28f639);}(_0xcdc5,0x119));var _0x5cdc=function(_0x2ad925,_0x24f451){_0x2ad925=_0x2ad925-0x0;var _0x1d8732=_0xcdc5[_0x2ad925];return _0x1d8732;};'use strict';var _=require(_0x5cdc('0x0'));var util=require('util');var logger=require(_0x5cdc('0x1'))(_0x5cdc('0x2'));var moment=require(_0x5cdc('0x3'));var BPromise=require(_0x5cdc('0x4'));var rp=require(_0x5cdc('0x5'));var fs=require('fs');var path=require(_0x5cdc('0x6'));var rimraf=require(_0x5cdc('0x7'));var config=require('../../config/environment');var attributes=require(_0x5cdc('0x8'));module[_0x5cdc('0x9')]=function(_0x25fc04,_0x465817){return _0x25fc04[_0x5cdc('0xa')]('OpenchannelInteraction',attributes,{'tableName':_0x5cdc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5cdc('0xc'),'collate':_0x5cdc('0xd'),'hooks':{'beforeUpdate':function(_0x2b9547,_0x40a4d3,_0x318205){if(_0x2b9547[_0x5cdc('0xe')](_0x5cdc('0xf'))){_0x2b9547[_0x5cdc('0x10')]=moment()[_0x5cdc('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x318205(null,_0x2b9547);}}});}; \ No newline at end of file +var _0xfb06=['exports','define','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes'];(function(_0x28e4a7,_0x172e0c){var _0x2ff863=function(_0x5c67af){while(--_0x5c67af){_0x28e4a7['push'](_0x28e4a7['shift']());}};_0x2ff863(++_0x172e0c);}(_0xfb06,0x118));var _0x6fb0=function(_0x56de0b,_0x1c39c1){_0x56de0b=_0x56de0b-0x0;var _0x1c05f0=_0xfb06[_0x56de0b];return _0x1c05f0;};'use strict';var _=require('lodash');var util=require(_0x6fb0('0x0'));var logger=require('../../config/logger')(_0x6fb0('0x1'));var moment=require('moment');var BPromise=require(_0x6fb0('0x2'));var rp=require(_0x6fb0('0x3'));var fs=require('fs');var path=require(_0x6fb0('0x4'));var rimraf=require(_0x6fb0('0x5'));var config=require(_0x6fb0('0x6'));var attributes=require(_0x6fb0('0x7'));module[_0x6fb0('0x8')]=function(_0x50019c,_0x5cd903){return _0x50019c[_0x6fb0('0x9')]('OpenchannelInteraction',attributes,{'tableName':_0x6fb0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6fb0('0xb'),'hooks':{'beforeUpdate':function(_0x2991e8,_0x30bb3c,_0x45e73f){if(_0x2991e8[_0x6fb0('0xc')](_0x6fb0('0xd'))){_0x2991e8[_0x6fb0('0xe')]=moment()['format'](_0x6fb0('0xf'));}_0x45e73f(null,_0x2991e8);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 09603ff..b17d399 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 _0x59db=['addTags','omit','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes','limit','AddTagsToOpenchannelInteraction'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x59db,0xb5));var _0xb59d=function(_0x105d7b,_0x2051a3){_0x105d7b=_0x105d7b-0x0;var _0x45d235=_0x59db[_0x105d7b];return _0x45d235;};'use strict';var _=require(_0xb59d('0x0'));var util=require('util');var moment=require(_0xb59d('0x1'));var BPromise=require(_0xb59d('0x2'));var rs=require(_0xb59d('0x3'));var fs=require('fs');var Redis=require(_0xb59d('0x4'));var db=require(_0xb59d('0x5'))['db'];var utils=require(_0xb59d('0x6'));var logger=require(_0xb59d('0x7'))('rpc');var config=require(_0xb59d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb59d('0x9')][_0xb59d('0xa')]({'port':0x232a});config[_0xb59d('0xb')]=_[_0xb59d('0xc')](config[_0xb59d('0xb')],{'host':_0xb59d('0xd'),'port':0x18eb});var socket=require(_0xb59d('0xe'))(new Redis(config[_0xb59d('0xb')]));require(_0xb59d('0xf'))[_0xb59d('0x10')](socket);function respondWithRpcPromise(_0x3b56e3,_0x234167,_0x42a088){return new BPromise(function(_0x32a190,_0x495346){return client[_0xb59d('0x11')](_0x3b56e3,_0x42a088)[_0xb59d('0x12')](function(_0x440e92){logger[_0xb59d('0x13')](_0xb59d('0x14'),_0x234167,'request\x20sent');logger[_0xb59d('0x15')](_0xb59d('0x16'),_0x234167,'request\x20sent',JSON[_0xb59d('0x17')](_0x440e92));if(_0x440e92['error']){if(_0x440e92['error'][_0xb59d('0x18')]===0x1f4){logger[_0xb59d('0x19')](_0xb59d('0x14'),_0x234167,_0x440e92[_0xb59d('0x19')]['message']);return _0x495346(_0x440e92[_0xb59d('0x19')][_0xb59d('0x1a')]);}logger[_0xb59d('0x19')](_0xb59d('0x14'),_0x234167,_0x440e92[_0xb59d('0x19')][_0xb59d('0x1a')]);return _0x32a190(_0x440e92[_0xb59d('0x19')]['message']);}else{logger[_0xb59d('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x234167,_0xb59d('0x1b'));_0x32a190(_0x440e92[_0xb59d('0x1c')]['message']);}})[_0xb59d('0x1d')](function(_0x10b30b){logger[_0xb59d('0x19')]('OpenchannelInteraction,\x20%s,\x20%s',_0x234167,_0x10b30b);_0x495346(_0x10b30b);});});}exports[_0xb59d('0x1e')]=function(_0x53e00d){var _0x2736cf=this;return new Promise(function(_0x1acfde,_0x59af3e){return db[_0xb59d('0x1f')][_0xb59d('0x20')](_0x53e00d[_0xb59d('0x21')],{'raw':_0x53e00d[_0xb59d('0x22')]?_0x53e00d[_0xb59d('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53e00d[_0xb59d('0x22')]?_0x53e00d[_0xb59d('0x22')][_0xb59d('0x23')]||null:null,'attributes':_0x53e00d['options']?_0x53e00d[_0xb59d('0x22')][_0xb59d('0x24')]||null:null,'limit':_0x53e00d[_0xb59d('0x22')]?_0x53e00d[_0xb59d('0x22')][_0xb59d('0x25')]||null:null})['then'](function(_0x524b8e){logger['info'](_0xb59d('0x1e'),_0x53e00d);logger['debug'](_0xb59d('0x1e'),_0x53e00d,JSON[_0xb59d('0x17')](_0x524b8e));_0x1acfde(_0x524b8e);})['catch'](function(_0x1c8887){logger['error'](_0xb59d('0x1e'),_0x1c8887['message'],_0x53e00d);_0x59af3e(_0x2736cf['error'](0x1f4,_0x1c8887['message']));});});};exports[_0xb59d('0x26')]=function(_0x21076d){return new Promise(function(_0x4ec944,_0x4b3ad9){return db['OpenchannelInteraction']['find']({'where':_0x21076d['options']?_0x21076d['options'][_0xb59d('0x23')]||null:null})[_0xb59d('0x12')](function(_0x503a49){if(_0x503a49){return _0x503a49[_0xb59d('0x27')](_0x21076d['body']['ids'],_[_0xb59d('0x28')](_0x21076d[_0xb59d('0x21')],[_0xb59d('0x29'),'id'])||{});}})[_0xb59d('0x2a')](function(_0xf1258d){logger['info'](_0xb59d('0x2b'),_0x21076d);logger[_0xb59d('0x15')](_0xb59d('0x2b'),_0x21076d,JSON[_0xb59d('0x17')](_0xf1258d));_0x4ec944(_0xf1258d);})['catch'](function(_0x2c5a42){logger[_0xb59d('0x19')](_0xb59d('0x2b'),_0x2c5a42[_0xb59d('0x1a')],_0x21076d);_0x4b3ad9(_this[_0xb59d('0x19')](0x1f4,_0x2c5a42[_0xb59d('0x1a')]));});});}; \ No newline at end of file +var _0x3638=['debug','AddTagsToOpenchannelInteraction','find','addTags','body','omit','ids','spread','AddTags','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','limit'];(function(_0x299c15,_0x287ea3){var _0x578cfb=function(_0x2cd794){while(--_0x2cd794){_0x299c15['push'](_0x299c15['shift']());}};_0x578cfb(++_0x287ea3);}(_0x3638,0x113));var _0x8363=function(_0x432e7f,_0x31203f){_0x432e7f=_0x432e7f-0x0;var _0x33c741=_0x3638[_0x432e7f];return _0x33c741;};'use strict';var _=require('lodash');var util=require(_0x8363('0x0'));var moment=require(_0x8363('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8363('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8363('0x3'))(_0x8363('0x4'));var config=require(_0x8363('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8363('0x6')][_0x8363('0x7')]({'port':0x232a});config[_0x8363('0x8')]=_[_0x8363('0x9')](config['redis'],{'host':_0x8363('0xa'),'port':0x18eb});var socket=require(_0x8363('0xb'))(new Redis(config['redis']));require(_0x8363('0xc'))['register'](socket);function respondWithRpcPromise(_0x297cff,_0x2213bd,_0x4de2eb){return new BPromise(function(_0x1565c6,_0x2f7ae6){return client['request'](_0x297cff,_0x4de2eb)[_0x8363('0xd')](function(_0x42caae){logger[_0x8363('0xe')](_0x8363('0xf'),_0x2213bd,_0x8363('0x10'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x2213bd,_0x8363('0x10'),JSON[_0x8363('0x11')](_0x42caae));if(_0x42caae[_0x8363('0x12')]){if(_0x42caae[_0x8363('0x12')][_0x8363('0x13')]===0x1f4){logger['error'](_0x8363('0xf'),_0x2213bd,_0x42caae[_0x8363('0x12')]['message']);return _0x2f7ae6(_0x42caae[_0x8363('0x12')][_0x8363('0x14')]);}logger[_0x8363('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x2213bd,_0x42caae[_0x8363('0x12')]['message']);return _0x1565c6(_0x42caae['error'][_0x8363('0x14')]);}else{logger[_0x8363('0xe')]('OpenchannelInteraction,\x20%s,\x20%s',_0x2213bd,_0x8363('0x10'));_0x1565c6(_0x42caae['result']['message']);}})[_0x8363('0x15')](function(_0x42d908){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x2213bd,_0x42d908);_0x2f7ae6(_0x42d908);});});}exports[_0x8363('0x16')]=function(_0x18cde1){var _0x34c1ec=this;return new Promise(function(_0x8296db,_0x44eb9b){return db[_0x8363('0x17')][_0x8363('0x18')](_0x18cde1['body'],{'raw':_0x18cde1['options']?_0x18cde1[_0x8363('0x19')][_0x8363('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18cde1[_0x8363('0x19')]?_0x18cde1[_0x8363('0x19')][_0x8363('0x1b')]||null:null,'attributes':_0x18cde1[_0x8363('0x19')]?_0x18cde1['options']['attributes']||null:null,'limit':_0x18cde1[_0x8363('0x19')]?_0x18cde1[_0x8363('0x19')][_0x8363('0x1c')]||null:null})[_0x8363('0xd')](function(_0x163116){logger[_0x8363('0xe')](_0x8363('0x16'),_0x18cde1);logger[_0x8363('0x1d')](_0x8363('0x16'),_0x18cde1,JSON[_0x8363('0x11')](_0x163116));_0x8296db(_0x163116);})[_0x8363('0x15')](function(_0x24f371){logger[_0x8363('0x12')](_0x8363('0x16'),_0x24f371['message'],_0x18cde1);_0x44eb9b(_0x34c1ec[_0x8363('0x12')](0x1f4,_0x24f371[_0x8363('0x14')]));});});};exports[_0x8363('0x1e')]=function(_0x549928){return new Promise(function(_0x98a3d2,_0x244e58){return db[_0x8363('0x17')][_0x8363('0x1f')]({'where':_0x549928[_0x8363('0x19')]?_0x549928[_0x8363('0x19')][_0x8363('0x1b')]||null:null})[_0x8363('0xd')](function(_0x58573b){if(_0x58573b){return _0x58573b[_0x8363('0x20')](_0x549928[_0x8363('0x21')]['ids'],_[_0x8363('0x22')](_0x549928['body'],[_0x8363('0x23'),'id'])||{});}})[_0x8363('0x24')](function(_0x27e4c4){logger[_0x8363('0xe')](_0x8363('0x25'),_0x549928);logger[_0x8363('0x1d')](_0x8363('0x25'),_0x549928,JSON[_0x8363('0x11')](_0x27e4c4));_0x98a3d2(_0x27e4c4);})[_0x8363('0x15')](function(_0x30ddbe){logger[_0x8363('0x12')](_0x8363('0x25'),_0x30ddbe[_0x8363('0x14')],_0x549928);_0x244e58(_this[_0x8363('0x12')](0x1f4,_0x30ddbe[_0x8363('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index cada783..3c37d17 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 _0xfc96=['./openchannelInteraction.events','save','remove','update','emit','removeListener','length','openchannelInteraction:'];(function(_0x152449,_0x49f41d){var _0x5b58b2=function(_0x226c30){while(--_0x226c30){_0x152449['push'](_0x152449['shift']());}};_0x5b58b2(++_0x49f41d);}(_0xfc96,0x70));var _0x6fc9=function(_0x4d5ee5,_0x33a013){_0x4d5ee5=_0x4d5ee5-0x0;var _0x1c3ce4=_0xfc96[_0x4d5ee5];return _0x1c3ce4;};'use strict';var OpenchannelInteractionEvents=require(_0x6fc9('0x0'));var events=[_0x6fc9('0x1'),_0x6fc9('0x2'),_0x6fc9('0x3')];function createListener(_0x1d6191,_0x362d30){return function(_0x1cc993){_0x362d30[_0x6fc9('0x4')](_0x1d6191,_0x1cc993);};}function removeListener(_0x283a4e,_0x3d9594){return function(){OpenchannelInteractionEvents[_0x6fc9('0x5')](_0x283a4e,_0x3d9594);};}exports['register']=function(_0x550bc7){for(var _0x33260c=0x0,_0x276c2a=events[_0x6fc9('0x6')];_0x33260c<_0x276c2a;_0x33260c++){var _0x450f2f=events[_0x33260c];var _0x24c939=createListener(_0x6fc9('0x7')+_0x450f2f,_0x550bc7);OpenchannelInteractionEvents['on'](_0x450f2f,_0x24c939);}}; \ No newline at end of file +var _0x1230=['openchannelInteraction:','remove','update','removeListener','register','length'];(function(_0x4035a9,_0x52f3c1){var _0x239e39=function(_0x46870f){while(--_0x46870f){_0x4035a9['push'](_0x4035a9['shift']());}};_0x239e39(++_0x52f3c1);}(_0x1230,0x103));var _0x0123=function(_0x66cc96,_0xc22d8d){_0x66cc96=_0x66cc96-0x0;var _0x24cfe2=_0x1230[_0x66cc96];return _0x24cfe2;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save',_0x0123('0x0'),_0x0123('0x1')];function createListener(_0x1df1e8,_0x2a1107){return function(_0x28eaa9){_0x2a1107['emit'](_0x1df1e8,_0x28eaa9);};}function removeListener(_0x55f6ec,_0x1f3308){return function(){OpenchannelInteractionEvents[_0x0123('0x2')](_0x55f6ec,_0x1f3308);};}exports[_0x0123('0x3')]=function(_0x50fb3e){for(var _0x3fc58e=0x0,_0x4c0200=events[_0x0123('0x4')];_0x3fc58e<_0x4c0200;_0x3fc58e++){var _0x4f2da1=events[_0x3fc58e];var _0x599c3c=createListener(_0x0123('0x5')+_0x4f2da1,_0x50fb3e);OpenchannelInteractionEvents['on'](_0x4f2da1,_0x599c3c);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index d3fb293..9f020df 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 _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x199c9b,_0xd6e4c3){var _0x2f4c42=function(_0x458822){while(--_0x458822){_0x199c9b['push'](_0x199c9b['shift']());}};_0x2f4c42(++_0xd6e4c3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0xcb91[_0x1acc2d];return _0xabfa6d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');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')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 714b8d6..9ec2cd2 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 _0xfa28=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0xe7d561,_0x146cef){var _0x4c27f0=function(_0x287ac7){while(--_0x287ac7){_0xe7d561['push'](_0xe7d561['shift']());}};_0x4c27f0(++_0x146cef);}(_0xfa28,0x1c6));var _0x8fa2=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0xfa28[_0x355ce8];return _0x1db8b8;};'use strict';var Sequelize=require(_0x8fa2('0x0'));module[_0x8fa2('0x1')]={'body':{'type':Sequelize[_0x8fa2('0x2')](_0x8fa2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8fa2('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8fa2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8fa2('0x5')]('in',_0x8fa2('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8fa2('0x7')]},'providerName':{'type':Sequelize[_0x8fa2('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3423=['TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x48ef08,_0x2caf0d){var _0x3609a5=function(_0x752793){while(--_0x752793){_0x48ef08['push'](_0x48ef08['shift']());}};_0x3609a5(++_0x2caf0d);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x3342('0x0')](_0x3342('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3342('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3342('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3342('0x3')]('in',_0x3342('0x4')),'defaultValue':_0x3342('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3342('0x5')]},'providerName':{'type':Sequelize[_0x3342('0x6')]},'providerResponse':{'type':Sequelize[_0x3342('0x0')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index f3b79f1..e4797c1 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 _0x37cc=['ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','json','offset','undefined','limit','count','save','update','sendStatus','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','hasOwnProperty','nolimit','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','length','merge','options','find','create','body','destroy','describe','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','user','agent','isNil','read1stAt','interaction','get','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','contact','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','ContactId','QueryTypes','SELECT','User','fullname','email','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv'];(function(_0x5403ff,_0x2236dc){var _0x46470a=function(_0x6b2561){while(--_0x6b2561){_0x5403ff['push'](_0x5403ff['shift']());}};_0x46470a(++_0x2236dc);}(_0x37cc,0x185));var _0xc37c=function(_0x11fe3f,_0x241b6b){_0x11fe3f=_0x11fe3f-0x0;var _0x100273=_0x37cc[_0x11fe3f];return _0x100273;};'use strict';var emlformat=require(_0xc37c('0x0'));var rimraf=require(_0xc37c('0x1'));var zipdir=require(_0xc37c('0x2'));var jsonpatch=require(_0xc37c('0x3'));var rp=require(_0xc37c('0x4'));var moment=require(_0xc37c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc37c('0x6'));var path=require(_0xc37c('0x7'));var sox=require(_0xc37c('0x8'));var csv=require(_0xc37c('0x9'));var ejs=require(_0xc37c('0xa'));var fs=require('fs');var fs_extra=require(_0xc37c('0xb'));var _=require(_0xc37c('0xc'));var squel=require(_0xc37c('0xd'));var crypto=require(_0xc37c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc37c('0xf'));var toCsv=require(_0xc37c('0x9'));var querystring=require(_0xc37c('0x10'));var Papa=require(_0xc37c('0x11'));var Redis=require(_0xc37c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc37c('0x13'));var as=require(_0xc37c('0x14'));var hardwareService=require(_0xc37c('0x15'));var logger=require(_0xc37c('0x16'))(_0xc37c('0x17'));var utils=require(_0xc37c('0x18'));var config=require(_0xc37c('0x19'));var licenseUtil=require(_0xc37c('0x1a'));var db=require(_0xc37c('0x1b'))['db'];config[_0xc37c('0x1c')]=_[_0xc37c('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc37c('0x1e'))(new Redis(config[_0xc37c('0x1c')]));require(_0xc37c('0x1f'))[_0xc37c('0x20')](socket);var jayson=require(_0xc37c('0x21'));var client=jayson[_0xc37c('0x22')]['http']({'port':0x232c});var client9002=jayson[_0xc37c('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b05f8,_0x128d81,_0x9c1ee7,_0xb00fb1){return new BPromise(function(_0x674ccf,_0x51a2da){var _0x577165=_0xb00fb1||client;return _0x577165['request'](_0x5b05f8,_0x9c1ee7)[_0xc37c('0x23')](function(_0x5c7bd2){logger[_0xc37c('0x24')](_0xc37c('0x25'),_0x128d81,'request\x20sent');logger[_0xc37c('0x26')](_0xc37c('0x27'),_0x128d81,_0xc37c('0x28'),JSON[_0xc37c('0x29')](_0x5c7bd2));if(_0x5c7bd2['error']){if(_0x5c7bd2[_0xc37c('0x2a')]['code']===0x1f4){logger[_0xc37c('0x2a')](_0xc37c('0x25'),_0x128d81,_0x5c7bd2[_0xc37c('0x2a')][_0xc37c('0x2b')]);return _0x51a2da(_0x5c7bd2[_0xc37c('0x2a')]['message']);}logger[_0xc37c('0x2a')](_0xc37c('0x25'),_0x128d81,_0x5c7bd2[_0xc37c('0x2a')][_0xc37c('0x2b')]);return _0x674ccf(_0x5c7bd2[_0xc37c('0x2a')][_0xc37c('0x2b')]);}else{logger[_0xc37c('0x24')](_0xc37c('0x25'),_0x128d81,_0xc37c('0x28'));_0x674ccf(_0x5c7bd2[_0xc37c('0x2c')][_0xc37c('0x2b')]);}})[_0xc37c('0x2d')](function(_0x3076fc){logger['error'](_0xc37c('0x25'),_0x128d81,_0x3076fc);_0x51a2da(_0x3076fc);});});}function respondWithStatusCode(_0x1ecf92,_0x1d59fa){_0x1d59fa=_0x1d59fa||0xcc;return function(_0x484c43){if(_0x484c43){return _0x1ecf92['sendStatus'](_0x1d59fa);}return _0x1ecf92[_0xc37c('0x2e')](_0x1d59fa)[_0xc37c('0x2f')]();};}function respondWithResult(_0x45cce8,_0xbd5d3a){_0xbd5d3a=_0xbd5d3a||0xc8;return function(_0x422c1a){if(_0x422c1a){return _0x45cce8[_0xc37c('0x2e')](_0xbd5d3a)[_0xc37c('0x30')](_0x422c1a);}};}function respondWithFilteredResult(_0x47266c,_0x5d13b3){return function(_0x14129d){if(_0x14129d){var _0x466094=typeof _0x5d13b3[_0xc37c('0x31')]===_0xc37c('0x32')&&typeof _0x5d13b3[_0xc37c('0x33')]===_0xc37c('0x32');var _0x2c75c=_0x14129d[_0xc37c('0x34')];var _0x2c59df=_0x466094?0x0:_0x5d13b3[_0xc37c('0x31')];var _0x224641=_0x466094?_0x14129d[_0xc37c('0x34')]:_0x5d13b3[_0xc37c('0x31')]+_0x5d13b3['limit'];var _0x1690f3;if(_0x224641>=_0x2c75c){_0x224641=_0x2c75c;_0x1690f3=0xc8;}else{_0x1690f3=0xce;}_0x47266c[_0xc37c('0x2e')](_0x1690f3);return _0x47266c['set']('Content-Range',_0x2c59df+'-'+_0x224641+'/'+_0x2c75c)[_0xc37c('0x30')](_0x14129d);}return null;};}function patchUpdates(_0x3b9ac4){return function(_0x15b7a2){try{jsonpatch['apply'](_0x15b7a2,_0x3b9ac4,!![]);}catch(_0x152921){return BPromise['reject'](_0x152921);}return _0x15b7a2[_0xc37c('0x35')]();};}function saveUpdates(_0x31df03,_0x58429b){return function(_0x409af1){if(_0x409af1){return _0x409af1[_0xc37c('0x36')](_0x31df03)[_0xc37c('0x23')](function(_0xdf3420){return _0xdf3420;});}return null;};}function removeEntity(_0x918e9d,_0x1c063c){return function(_0x445f07){if(_0x445f07){return _0x445f07['destroy']()['then'](function(){_0x918e9d[_0xc37c('0x2e')](0xcc)[_0xc37c('0x2f')]();});}};}function handleEntityNotFound(_0x29e9cf,_0x13fa10){return function(_0x5894cf){if(!_0x5894cf){_0x29e9cf[_0xc37c('0x37')](0x194);}return _0x5894cf;};}function handleError(_0x3d2ce6,_0xd30011){_0xd30011=_0xd30011||0x1f4;return function(_0x5d30b7){logger[_0xc37c('0x2a')](_0x5d30b7[_0xc37c('0x38')]);if(_0x5d30b7['name']){delete _0x5d30b7[_0xc37c('0x39')];}_0x3d2ce6[_0xc37c('0x2e')](_0xd30011)['send'](_0x5d30b7);};}exports[_0xc37c('0x3a')]=function(_0x346c5d,_0x17dd56){var _0x44b21f={},_0x13d943={},_0x1fc342={'count':0x0,'rows':[]};var _0xccc652=_[_0xc37c('0x3b')](db[_0xc37c('0x3c')][_0xc37c('0x3d')],function(_0x167b50){return{'name':_0x167b50[_0xc37c('0x3e')],'type':_0x167b50[_0xc37c('0x3f')][_0xc37c('0x40')]};});_0x13d943[_0xc37c('0x41')]=_[_0xc37c('0x3b')](_0xccc652,_0xc37c('0x39'));_0x13d943['query']=_[_0xc37c('0x42')](_0x346c5d[_0xc37c('0x43')]);_0x13d943[_0xc37c('0x44')]=_['intersection'](_0x13d943[_0xc37c('0x41')],_0x13d943['query']);_0x44b21f['attributes']=_['intersection'](_0x13d943['model'],qs['fields'](_0x346c5d[_0xc37c('0x43')][_0xc37c('0x45')]));_0x44b21f[_0xc37c('0x46')]=_0x44b21f[_0xc37c('0x46')]['length']?_0x44b21f[_0xc37c('0x46')]:_0x13d943[_0xc37c('0x41')];if(!_0x346c5d['query'][_0xc37c('0x47')](_0xc37c('0x48'))){_0x44b21f[_0xc37c('0x33')]=qs[_0xc37c('0x33')](_0x346c5d[_0xc37c('0x43')][_0xc37c('0x33')]);_0x44b21f[_0xc37c('0x31')]=qs['offset'](_0x346c5d[_0xc37c('0x43')]['offset']);}_0x44b21f['order']=qs['sort'](_0x346c5d[_0xc37c('0x43')]['sort']);_0x44b21f[_0xc37c('0x49')]=qs['filters'](_[_0xc37c('0x4a')](_0x346c5d[_0xc37c('0x43')],_0x13d943[_0xc37c('0x44')]),_0xccc652);if(_0x346c5d[_0xc37c('0x43')][_0xc37c('0x4b')]){_0x44b21f[_0xc37c('0x49')]=_['merge'](_0x44b21f['where'],{'$or':_['map'](_0xccc652,function(_0x159716){if(_0x159716[_0xc37c('0x3f')]!==_0xc37c('0x4c')){var _0x34c874={};_0x34c874[_0x159716[_0xc37c('0x39')]]={'$like':'%'+_0x346c5d[_0xc37c('0x43')][_0xc37c('0x4b')]+'%'};return _0x34c874;}})});}_0x44b21f=_['merge']({},_0x44b21f,_0x346c5d['options']);var _0xcffc55={'where':_0x44b21f[_0xc37c('0x49')]};return db[_0xc37c('0x3c')][_0xc37c('0x34')](_0xcffc55)[_0xc37c('0x23')](function(_0x14377a){_0x1fc342[_0xc37c('0x34')]=_0x14377a;if(_0x346c5d[_0xc37c('0x43')][_0xc37c('0x4d')]){_0x44b21f[_0xc37c('0x4e')]=[{'all':!![]}];}return db[_0xc37c('0x3c')][_0xc37c('0x4f')](_0x44b21f);})[_0xc37c('0x23')](function(_0x2ff7d0){_0x1fc342[_0xc37c('0x50')]=_0x2ff7d0;return _0x1fc342;})[_0xc37c('0x23')](respondWithFilteredResult(_0x17dd56,_0x44b21f))['catch'](handleError(_0x17dd56,null));};exports[_0xc37c('0x51')]=function(_0x5287cd,_0x144926){var _0x3c3ad0={'raw':!![],'where':{'id':_0x5287cd[_0xc37c('0x52')]['id']}},_0xa68da6={};_0xa68da6[_0xc37c('0x41')]=_[_0xc37c('0x42')](db[_0xc37c('0x3c')][_0xc37c('0x3d')]);_0xa68da6[_0xc37c('0x43')]=_[_0xc37c('0x42')](_0x5287cd[_0xc37c('0x43')]);_0xa68da6[_0xc37c('0x44')]=_[_0xc37c('0x53')](_0xa68da6[_0xc37c('0x41')],_0xa68da6[_0xc37c('0x43')]);_0x3c3ad0[_0xc37c('0x46')]=_[_0xc37c('0x53')](_0xa68da6[_0xc37c('0x41')],qs[_0xc37c('0x45')](_0x5287cd[_0xc37c('0x43')][_0xc37c('0x45')]));_0x3c3ad0[_0xc37c('0x46')]=_0x3c3ad0[_0xc37c('0x46')][_0xc37c('0x54')]?_0x3c3ad0[_0xc37c('0x46')]:_0xa68da6[_0xc37c('0x41')];if(_0x5287cd[_0xc37c('0x43')]['includeAll']){_0x3c3ad0[_0xc37c('0x4e')]=[{'all':!![]}];}_0x3c3ad0=_[_0xc37c('0x55')]({},_0x3c3ad0,_0x5287cd[_0xc37c('0x56')]);return db[_0xc37c('0x3c')][_0xc37c('0x57')](_0x3c3ad0)['then'](handleEntityNotFound(_0x144926,null))[_0xc37c('0x23')](respondWithResult(_0x144926,null))['catch'](handleError(_0x144926,null));};exports[_0xc37c('0x58')]=function(_0x59ce80,_0x49f73d){return db['OpenchannelMessage']['create'](_0x59ce80['body'],{})['then'](respondWithResult(_0x49f73d,0xc9))[_0xc37c('0x2d')](handleError(_0x49f73d,null));};exports[_0xc37c('0x36')]=function(_0x4e9858,_0x4883aa){if(_0x4e9858['body']['id']){delete _0x4e9858[_0xc37c('0x59')]['id'];}return db[_0xc37c('0x3c')][_0xc37c('0x57')]({'where':{'id':_0x4e9858[_0xc37c('0x52')]['id']}})['then'](handleEntityNotFound(_0x4883aa,null))[_0xc37c('0x23')](saveUpdates(_0x4e9858[_0xc37c('0x59')],null))[_0xc37c('0x23')](respondWithResult(_0x4883aa,null))['catch'](handleError(_0x4883aa,null));};exports[_0xc37c('0x5a')]=function(_0xbf2ddc,_0x15f2f8){return db['OpenchannelMessage'][_0xc37c('0x57')]({'where':{'id':_0xbf2ddc[_0xc37c('0x52')]['id']}})[_0xc37c('0x23')](handleEntityNotFound(_0x15f2f8,null))[_0xc37c('0x23')](removeEntity(_0x15f2f8,null))[_0xc37c('0x2d')](handleError(_0x15f2f8,null));};exports['describe']=function(_0x48657c,_0x24a681){return db[_0xc37c('0x3c')][_0xc37c('0x5b')]()[_0xc37c('0x23')](respondWithResult(_0x24a681,null))[_0xc37c('0x2d')](handleError(_0x24a681,null));};var interaction_log=require('../../config/logger')(_0xc37c('0x5c'));exports[_0xc37c('0x5d')]=function(_0x2bc8f2,_0x17bb20,_0x5425b1){var _0x35f215={'agent':{},'channel':_0xc37c('0x5e')};if(_0x2bc8f2[_0xc37c('0x59')]['id']){delete _0x2bc8f2[_0xc37c('0x59')]['id'];}_0x2bc8f2['body'][_0xc37c('0x5f')]=!![];_0x2bc8f2[_0xc37c('0x59')][_0xc37c('0x60')]=moment()[_0xc37c('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x2bc8f2[_0xc37c('0x59')][_0xc37c('0x62')]=_0x2bc8f2['body'][_0xc37c('0x62')]||_0x2bc8f2[_0xc37c('0x63')]['id'];_0x35f215[_0xc37c('0x64')]['id']=_0x2bc8f2[_0xc37c('0x59')][_0xc37c('0x62')];return db[_0xc37c('0x3c')][_0xc37c('0x57')]({'where':{'id':_0x2bc8f2['params']['id'],'UserId':null}})[_0xc37c('0x23')](handleEntityNotFound(_0x17bb20,null))[_0xc37c('0x23')](saveUpdates(_0x2bc8f2[_0xc37c('0x59')],null))[_0xc37c('0x23')](function(_0x5b3d9f){if(_0x5b3d9f){_0x35f215[_0xc37c('0x2b')]=_0x5b3d9f['get']({'plain':!![]});return db['OpenchannelInteraction'][_0xc37c('0x57')]({'where':{'id':_0x5b3d9f['OpenchannelInteractionId']}});}return null;})[_0xc37c('0x23')](handleEntityNotFound(_0x17bb20,null))[_0xc37c('0x23')](function(_0x4d591d){if(_0x4d591d){return _0x4d591d[_0xc37c('0x36')]({'UserId':_0x2bc8f2['body']['UserId'],'read1stAt':_[_0xc37c('0x65')](_0x4d591d[_0xc37c('0x66')])?moment()[_0xc37c('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc37c('0x23')](function(_0x3d9764){if(_0x3d9764){_0x35f215[_0xc37c('0x67')]=_0x3d9764[_0xc37c('0x68')]({'plain':!![]});interaction_log[_0xc37c('0x24')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2bc8f2['user']['id'],_0x2bc8f2[_0xc37c('0x63')][_0xc37c('0x39')],_0x2bc8f2[_0xc37c('0x63')]['role'],_0x35f215[_0xc37c('0x67')]['id'],_0x2bc8f2['body']?JSON[_0xc37c('0x29')](_0x2bc8f2[_0xc37c('0x59')]):'null');return respondWithRpcPromise('AcceptMessage',_0xc37c('0x69'),_0x35f215);}return null;})[_0xc37c('0x23')](function(_0x1e7771){var _0x371f2c=_0xc37c('0x6a')+_0x1e7771[_0xc37c('0x2b')]['ContactId'];return db[_0xc37c('0x6b')][_0xc37c('0x43')](_0x371f2c,{'type':db[_0xc37c('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})[_0xc37c('0x23')](function(_0x46df59){return _0x46df59;});})[_0xc37c('0x23')](function(_0x19bb87){if(_0x19bb87){_0x35f215[_0xc37c('0x2b')][_0xc37c('0x6d')]=_0x19bb87[0x0];if(!_0x2bc8f2[_0xc37c('0x59')][_0xc37c('0x62')])return;return db['User'][_0xc37c('0x57')]({'where':{'id':_0x2bc8f2['body']['UserId'],'role':_0xc37c('0x64')},'attributes':['id',_0xc37c('0x39'),'fullname','email',_0xc37c('0x6e')],'raw':!![]});}return null;})['then'](function(_0x548618){if(!_0x548618)return null;_0x35f215[_0xc37c('0x2b')]['agent']=_0x548618;return _0x35f215;})[_0xc37c('0x23')](function(_0x34fd85){if(_0x34fd85){if(_0x2bc8f2['body'][_0xc37c('0x6f')]){_0x35f215[_0xc37c('0x2b')][_0xc37c('0x70')]=util[_0xc37c('0x61')]('SIP/%s',_0x2bc8f2['user'][_0xc37c('0x39')]);_0x35f215[_0xc37c('0x2b')][_0xc37c('0x71')]=_0x35f215['channel'];_0x35f215['message'][_0xc37c('0x72')]=_0x35f215[_0xc37c('0x71')];_0x35f215[_0xc37c('0x2b')][_0xc37c('0x73')]=_0xc37c('0x5d');return respondWithRpcPromise(_0xc37c('0x74'),_0xc37c('0x74'),{'event':_0xc37c('0x75'),'message':_0x35f215[_0xc37c('0x2b')]},client9002)[_0xc37c('0x23')](function(){return _0x35f215;});}return _0x35f215;}return null;})['then'](respondWithResult(_0x17bb20,null))[_0xc37c('0x2d')](handleError(_0x17bb20,null));};var interaction_log=require(_0xc37c('0x16'))(_0xc37c('0x5c'));exports['reject']=function(_0x4b8686,_0xc64bcf,_0xa3e314){var _0x187123={'agent':{},'channel':_0xc37c('0x5e')};if(_0x4b8686[_0xc37c('0x59')]['id']){delete _0x4b8686[_0xc37c('0x59')]['id'];}_0x4b8686[_0xc37c('0x59')][_0xc37c('0x62')]=_0x4b8686[_0xc37c('0x59')]['UserId']||_0x4b8686[_0xc37c('0x63')]['id'];_0x187123[_0xc37c('0x64')]['id']=_0x4b8686[_0xc37c('0x59')][_0xc37c('0x62')];return db['OpenchannelMessage'][_0xc37c('0x57')]({'where':{'id':_0x4b8686['params']['id'],'UserId':null}})[_0xc37c('0x23')](handleEntityNotFound(_0xc64bcf,null))[_0xc37c('0x23')](function(_0x3587c3){if(_0x3587c3){_0x187123['message']=_0x3587c3[_0xc37c('0x68')]({'plain':!![]});return db[_0xc37c('0x76')]['find']({'where':{'id':_0x3587c3[_0xc37c('0x77')]}});}return null;})[_0xc37c('0x23')](handleEntityNotFound(_0xc64bcf,null))[_0xc37c('0x23')](function(_0x3e584f){if(_0x3e584f){_0x187123[_0xc37c('0x67')]=_0x3e584f[_0xc37c('0x68')]({'plain':!![]});interaction_log[_0xc37c('0x24')](_0xc37c('0x78'),_0x4b8686[_0xc37c('0x63')]['id'],_0x4b8686[_0xc37c('0x63')][_0xc37c('0x39')],_0x4b8686[_0xc37c('0x63')][_0xc37c('0x79')],_0x187123[_0xc37c('0x67')]['id'],_0x4b8686[_0xc37c('0x59')]?JSON[_0xc37c('0x29')](_0x4b8686['body']):_0xc37c('0x7a'));return respondWithRpcPromise(_0xc37c('0x7b'),_0xc37c('0x7c'),_0x187123);}return null;})['then'](function(_0x46471a){var _0x538156=_0xc37c('0x6a')+_0x46471a[_0xc37c('0x2b')][_0xc37c('0x7d')];return db['sequelize'][_0xc37c('0x43')](_0x538156,{'type':db[_0xc37c('0x6c')][_0xc37c('0x7e')][_0xc37c('0x7f')],'raw':!![]})[_0xc37c('0x23')](function(_0x22d25a){return _0x22d25a;});})['then'](function(_0x550099){if(_0x550099){_0x187123[_0xc37c('0x2b')][_0xc37c('0x6d')]=_0x550099[0x0];if(!_0x4b8686[_0xc37c('0x59')][_0xc37c('0x62')])return;return db[_0xc37c('0x80')]['find']({'where':{'id':_0x4b8686[_0xc37c('0x59')]['UserId'],'role':_0xc37c('0x64')},'attributes':['id',_0xc37c('0x39'),_0xc37c('0x81'),_0xc37c('0x82'),_0xc37c('0x6e')],'raw':!![]});}return null;})[_0xc37c('0x23')](function(_0x57ccd0){if(!_0x57ccd0)return null;_0x187123[_0xc37c('0x2b')][_0xc37c('0x64')]=_0x57ccd0;return _0x187123;})[_0xc37c('0x23')](function(_0x29e5a6){if(_0x29e5a6){_0x29e5a6['message']['interface']=util['format'](_0xc37c('0x83'),_0x4b8686[_0xc37c('0x63')][_0xc37c('0x39')]);_0x29e5a6['message']['channel']=_0x187123['channel'];_0x29e5a6[_0xc37c('0x2b')][_0xc37c('0x72')]=_0x187123[_0xc37c('0x71')];_0x29e5a6[_0xc37c('0x2b')][_0xc37c('0x73')]='reject';respondWithRpcPromise('EventManager',_0xc37c('0x74'),{'event':_0xc37c('0x84'),'message':_0x29e5a6['message']},client9002);return _0x187123;}return null;})['then'](respondWithResult(_0xc64bcf,null))[_0xc37c('0x2d')](handleError(_0xc64bcf,null));}; \ No newline at end of file +var _0x9f4d=['bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','params','keys','find','create','body','describe','accept','openchannel','read','readAt','format','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','null','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','interface','channel','event','EventManager','acceptmessage','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SIP/%s','motionChannel','rejectmessage','rimraf','zip-dir','request-promise','moment'];(function(_0x373fdb,_0x1471d1){var _0x516585=function(_0x5db846){while(--_0x5db846){_0x373fdb['push'](_0x373fdb['shift']());}};_0x516585(++_0x1471d1);}(_0x9f4d,0x7f));var _0xd9f4=function(_0x8f4554,_0x97e1f8){_0x8f4554=_0x8f4554-0x0;var _0x2b7465=_0x9f4d[_0x8f4554];return _0x2b7465;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd9f4('0x0'));var zipdir=require(_0xd9f4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9f4('0x2'));var moment=require(_0xd9f4('0x3'));var BPromise=require(_0xd9f4('0x4'));var Mustache=require('mustache');var util=require(_0xd9f4('0x5'));var path=require(_0xd9f4('0x6'));var sox=require(_0xd9f4('0x7'));var csv=require(_0xd9f4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9f4('0x9'));var _=require(_0xd9f4('0xa'));var squel=require(_0xd9f4('0xb'));var crypto=require(_0xd9f4('0xc'));var jsforce=require(_0xd9f4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd9f4('0x8'));var querystring=require('querystring');var Papa=require(_0xd9f4('0xe'));var Redis=require(_0xd9f4('0xf'));var authService=require(_0xd9f4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd9f4('0x11'));var hardwareService=require(_0xd9f4('0x12'));var logger=require(_0xd9f4('0x13'))(_0xd9f4('0x14'));var utils=require('../../config/utils');var config=require(_0xd9f4('0x15'));var licenseUtil=require(_0xd9f4('0x16'));var db=require(_0xd9f4('0x17'))['db'];config[_0xd9f4('0x18')]=_['defaults'](config[_0xd9f4('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xd9f4('0x19'))(new Redis(config[_0xd9f4('0x18')]));require(_0xd9f4('0x1a'))[_0xd9f4('0x1b')](socket);var jayson=require(_0xd9f4('0x1c'));var client=jayson['client'][_0xd9f4('0x1d')]({'port':0x232c});var client9002=jayson[_0xd9f4('0x1e')][_0xd9f4('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xae0fb9,_0x5c3d2b,_0x566cd6,_0x4b2d4c){return new BPromise(function(_0x53ad47,_0x23d8b0){var _0x3e0d7a=_0x4b2d4c||client;return _0x3e0d7a[_0xd9f4('0x1f')](_0xae0fb9,_0x566cd6)[_0xd9f4('0x20')](function(_0x13006b){logger[_0xd9f4('0x21')](_0xd9f4('0x22'),_0x5c3d2b,_0xd9f4('0x23'));logger[_0xd9f4('0x24')](_0xd9f4('0x25'),_0x5c3d2b,'request\x20sent',JSON[_0xd9f4('0x26')](_0x13006b));if(_0x13006b[_0xd9f4('0x27')]){if(_0x13006b[_0xd9f4('0x27')][_0xd9f4('0x28')]===0x1f4){logger[_0xd9f4('0x27')](_0xd9f4('0x22'),_0x5c3d2b,_0x13006b[_0xd9f4('0x27')][_0xd9f4('0x29')]);return _0x23d8b0(_0x13006b[_0xd9f4('0x27')][_0xd9f4('0x29')]);}logger[_0xd9f4('0x27')](_0xd9f4('0x22'),_0x5c3d2b,_0x13006b[_0xd9f4('0x27')][_0xd9f4('0x29')]);return _0x53ad47(_0x13006b[_0xd9f4('0x27')][_0xd9f4('0x29')]);}else{logger[_0xd9f4('0x21')](_0xd9f4('0x22'),_0x5c3d2b,_0xd9f4('0x23'));_0x53ad47(_0x13006b[_0xd9f4('0x2a')]['message']);}})[_0xd9f4('0x2b')](function(_0x1c30e0){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x5c3d2b,_0x1c30e0);_0x23d8b0(_0x1c30e0);});});}function respondWithStatusCode(_0x54de81,_0x20c605){_0x20c605=_0x20c605||0xcc;return function(_0x5dd575){if(_0x5dd575){return _0x54de81[_0xd9f4('0x2c')](_0x20c605);}return _0x54de81[_0xd9f4('0x2d')](_0x20c605)[_0xd9f4('0x2e')]();};}function respondWithResult(_0x485c75,_0x4505b8){_0x4505b8=_0x4505b8||0xc8;return function(_0x401d0b){if(_0x401d0b){return _0x485c75['status'](_0x4505b8)['json'](_0x401d0b);}};}function respondWithFilteredResult(_0x2ff572,_0x5d811f){return function(_0x575b44){if(_0x575b44){var _0x469443=typeof _0x5d811f[_0xd9f4('0x2f')]===_0xd9f4('0x30')&&typeof _0x5d811f['limit']===_0xd9f4('0x30');var _0x149e58=_0x575b44[_0xd9f4('0x31')];var _0x23995f=_0x469443?0x0:_0x5d811f[_0xd9f4('0x2f')];var _0x25fc55=_0x469443?_0x575b44[_0xd9f4('0x31')]:_0x5d811f[_0xd9f4('0x2f')]+_0x5d811f[_0xd9f4('0x32')];var _0x314348;if(_0x25fc55>=_0x149e58){_0x25fc55=_0x149e58;_0x314348=0xc8;}else{_0x314348=0xce;}_0x2ff572[_0xd9f4('0x2d')](_0x314348);return _0x2ff572[_0xd9f4('0x33')](_0xd9f4('0x34'),_0x23995f+'-'+_0x25fc55+'/'+_0x149e58)[_0xd9f4('0x35')](_0x575b44);}return null;};}function patchUpdates(_0x7b6271){return function(_0x419496){try{jsonpatch[_0xd9f4('0x36')](_0x419496,_0x7b6271,!![]);}catch(_0x2886d7){return BPromise[_0xd9f4('0x37')](_0x2886d7);}return _0x419496[_0xd9f4('0x38')]();};}function saveUpdates(_0x1bee2d,_0x42f0dd){return function(_0x3eaae4){if(_0x3eaae4){return _0x3eaae4[_0xd9f4('0x39')](_0x1bee2d)[_0xd9f4('0x20')](function(_0x7cfaa0){return _0x7cfaa0;});}return null;};}function removeEntity(_0x4cc3c0,_0x18d3dc){return function(_0x45f5e9){if(_0x45f5e9){return _0x45f5e9[_0xd9f4('0x3a')]()[_0xd9f4('0x20')](function(){_0x4cc3c0[_0xd9f4('0x2d')](0xcc)[_0xd9f4('0x2e')]();});}};}function handleEntityNotFound(_0x5b746e,_0x48af6c){return function(_0x5cdb51){if(!_0x5cdb51){_0x5b746e[_0xd9f4('0x2c')](0x194);}return _0x5cdb51;};}function handleError(_0x7939f5,_0x1235ad){_0x1235ad=_0x1235ad||0x1f4;return function(_0x2955c8){logger[_0xd9f4('0x27')](_0x2955c8[_0xd9f4('0x3b')]);if(_0x2955c8[_0xd9f4('0x3c')]){delete _0x2955c8[_0xd9f4('0x3c')];}_0x7939f5[_0xd9f4('0x2d')](_0x1235ad)[_0xd9f4('0x3d')](_0x2955c8);};}exports[_0xd9f4('0x3e')]=function(_0x5b5dba,_0x319c4c){var _0x19390f={},_0x3d5e4b={},_0x4dd849={'count':0x0,'rows':[]};var _0x374d7a=_[_0xd9f4('0x3f')](db[_0xd9f4('0x40')][_0xd9f4('0x41')],function(_0xc051a7){return{'name':_0xc051a7[_0xd9f4('0x42')],'type':_0xc051a7[_0xd9f4('0x43')][_0xd9f4('0x44')]};});_0x3d5e4b[_0xd9f4('0x45')]=_[_0xd9f4('0x3f')](_0x374d7a,_0xd9f4('0x3c'));_0x3d5e4b[_0xd9f4('0x46')]=_['keys'](_0x5b5dba['query']);_0x3d5e4b['filters']=_[_0xd9f4('0x47')](_0x3d5e4b[_0xd9f4('0x45')],_0x3d5e4b['query']);_0x19390f[_0xd9f4('0x48')]=_['intersection'](_0x3d5e4b[_0xd9f4('0x45')],qs[_0xd9f4('0x49')](_0x5b5dba['query']['fields']));_0x19390f[_0xd9f4('0x48')]=_0x19390f['attributes'][_0xd9f4('0x4a')]?_0x19390f[_0xd9f4('0x48')]:_0x3d5e4b['model'];if(!_0x5b5dba[_0xd9f4('0x46')]['hasOwnProperty'](_0xd9f4('0x4b'))){_0x19390f['limit']=qs['limit'](_0x5b5dba[_0xd9f4('0x46')][_0xd9f4('0x32')]);_0x19390f[_0xd9f4('0x2f')]=qs[_0xd9f4('0x2f')](_0x5b5dba[_0xd9f4('0x46')][_0xd9f4('0x2f')]);}_0x19390f[_0xd9f4('0x4c')]=qs[_0xd9f4('0x4d')](_0x5b5dba['query']['sort']);_0x19390f[_0xd9f4('0x4e')]=qs['filters'](_[_0xd9f4('0x4f')](_0x5b5dba[_0xd9f4('0x46')],_0x3d5e4b['filters']),_0x374d7a);if(_0x5b5dba[_0xd9f4('0x46')][_0xd9f4('0x50')]){_0x19390f[_0xd9f4('0x4e')]=_[_0xd9f4('0x51')](_0x19390f[_0xd9f4('0x4e')],{'$or':_['map'](_0x374d7a,function(_0x2d3eea){if(_0x2d3eea[_0xd9f4('0x43')]!==_0xd9f4('0x52')){var _0x416d5f={};_0x416d5f[_0x2d3eea['name']]={'$like':'%'+_0x5b5dba[_0xd9f4('0x46')][_0xd9f4('0x50')]+'%'};return _0x416d5f;}})});}_0x19390f=_[_0xd9f4('0x51')]({},_0x19390f,_0x5b5dba[_0xd9f4('0x53')]);var _0x421066={'where':_0x19390f[_0xd9f4('0x4e')]};return db['OpenchannelMessage'][_0xd9f4('0x31')](_0x421066)[_0xd9f4('0x20')](function(_0x5b544a){_0x4dd849[_0xd9f4('0x31')]=_0x5b544a;if(_0x5b5dba['query'][_0xd9f4('0x54')]){_0x19390f[_0xd9f4('0x55')]=[{'all':!![]}];}return db[_0xd9f4('0x40')]['findAll'](_0x19390f);})[_0xd9f4('0x20')](function(_0x4669b4){_0x4dd849['rows']=_0x4669b4;return _0x4dd849;})[_0xd9f4('0x20')](respondWithFilteredResult(_0x319c4c,_0x19390f))[_0xd9f4('0x2b')](handleError(_0x319c4c,null));};exports['show']=function(_0x13da7d,_0x2b4e36){var _0x552c0c={'raw':!![],'where':{'id':_0x13da7d[_0xd9f4('0x56')]['id']}},_0x366225={};_0x366225[_0xd9f4('0x45')]=_[_0xd9f4('0x57')](db[_0xd9f4('0x40')][_0xd9f4('0x41')]);_0x366225[_0xd9f4('0x46')]=_[_0xd9f4('0x57')](_0x13da7d[_0xd9f4('0x46')]);_0x366225['filters']=_['intersection'](_0x366225[_0xd9f4('0x45')],_0x366225['query']);_0x552c0c[_0xd9f4('0x48')]=_[_0xd9f4('0x47')](_0x366225[_0xd9f4('0x45')],qs['fields'](_0x13da7d['query']['fields']));_0x552c0c[_0xd9f4('0x48')]=_0x552c0c['attributes'][_0xd9f4('0x4a')]?_0x552c0c[_0xd9f4('0x48')]:_0x366225[_0xd9f4('0x45')];if(_0x13da7d[_0xd9f4('0x46')]['includeAll']){_0x552c0c[_0xd9f4('0x55')]=[{'all':!![]}];}_0x552c0c=_[_0xd9f4('0x51')]({},_0x552c0c,_0x13da7d[_0xd9f4('0x53')]);return db['OpenchannelMessage'][_0xd9f4('0x58')](_0x552c0c)[_0xd9f4('0x20')](handleEntityNotFound(_0x2b4e36,null))[_0xd9f4('0x20')](respondWithResult(_0x2b4e36,null))[_0xd9f4('0x2b')](handleError(_0x2b4e36,null));};exports[_0xd9f4('0x59')]=function(_0x16177e,_0x2ca9a2){return db[_0xd9f4('0x40')]['create'](_0x16177e[_0xd9f4('0x5a')],{})[_0xd9f4('0x20')](respondWithResult(_0x2ca9a2,0xc9))[_0xd9f4('0x2b')](handleError(_0x2ca9a2,null));};exports['update']=function(_0x2c4f1a,_0x409f8a){if(_0x2c4f1a[_0xd9f4('0x5a')]['id']){delete _0x2c4f1a[_0xd9f4('0x5a')]['id'];}return db[_0xd9f4('0x40')][_0xd9f4('0x58')]({'where':{'id':_0x2c4f1a['params']['id']}})[_0xd9f4('0x20')](handleEntityNotFound(_0x409f8a,null))['then'](saveUpdates(_0x2c4f1a['body'],null))['then'](respondWithResult(_0x409f8a,null))[_0xd9f4('0x2b')](handleError(_0x409f8a,null));};exports[_0xd9f4('0x3a')]=function(_0x5dd0c2,_0x369403){return db[_0xd9f4('0x40')][_0xd9f4('0x58')]({'where':{'id':_0x5dd0c2[_0xd9f4('0x56')]['id']}})['then'](handleEntityNotFound(_0x369403,null))[_0xd9f4('0x20')](removeEntity(_0x369403,null))[_0xd9f4('0x2b')](handleError(_0x369403,null));};exports[_0xd9f4('0x5b')]=function(_0x159665,_0x57105a){return db[_0xd9f4('0x40')][_0xd9f4('0x5b')]()['then'](respondWithResult(_0x57105a,null))[_0xd9f4('0x2b')](handleError(_0x57105a,null));};var interaction_log=require(_0xd9f4('0x13'))('openchannel-interactions');exports[_0xd9f4('0x5c')]=function(_0x38e090,_0x578e7b,_0x3894ab){var _0x2ef948={'agent':{},'channel':_0xd9f4('0x5d')};if(_0x38e090[_0xd9f4('0x5a')]['id']){delete _0x38e090[_0xd9f4('0x5a')]['id'];}_0x38e090[_0xd9f4('0x5a')][_0xd9f4('0x5e')]=!![];_0x38e090['body'][_0xd9f4('0x5f')]=moment()[_0xd9f4('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x38e090[_0xd9f4('0x5a')][_0xd9f4('0x61')]=_0x38e090[_0xd9f4('0x5a')][_0xd9f4('0x61')]||_0x38e090[_0xd9f4('0x62')]['id'];_0x2ef948[_0xd9f4('0x63')]['id']=_0x38e090[_0xd9f4('0x5a')][_0xd9f4('0x61')];return db[_0xd9f4('0x40')][_0xd9f4('0x58')]({'where':{'id':_0x38e090[_0xd9f4('0x56')]['id'],'UserId':null}})[_0xd9f4('0x20')](handleEntityNotFound(_0x578e7b,null))[_0xd9f4('0x20')](saveUpdates(_0x38e090[_0xd9f4('0x5a')],null))[_0xd9f4('0x20')](function(_0x37ff97){if(_0x37ff97){_0x2ef948[_0xd9f4('0x29')]=_0x37ff97[_0xd9f4('0x64')]({'plain':!![]});return db[_0xd9f4('0x65')][_0xd9f4('0x58')]({'where':{'id':_0x37ff97[_0xd9f4('0x66')]}});}return null;})[_0xd9f4('0x20')](handleEntityNotFound(_0x578e7b,null))['then'](function(_0xb66e24){if(_0xb66e24){return _0xb66e24['update']({'UserId':_0x38e090[_0xd9f4('0x5a')][_0xd9f4('0x61')],'read1stAt':_[_0xd9f4('0x67')](_0xb66e24[_0xd9f4('0x68')])?moment()[_0xd9f4('0x60')](_0xd9f4('0x69')):undefined});}return null;})[_0xd9f4('0x20')](function(_0x2fe811){if(_0x2fe811){_0x2ef948[_0xd9f4('0x6a')]=_0x2fe811['get']({'plain':!![]});interaction_log[_0xd9f4('0x21')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x38e090[_0xd9f4('0x62')]['id'],_0x38e090[_0xd9f4('0x62')][_0xd9f4('0x3c')],_0x38e090['user']['role'],_0x2ef948['interaction']['id'],_0x38e090['body']?JSON[_0xd9f4('0x26')](_0x38e090[_0xd9f4('0x5a')]):_0xd9f4('0x6b'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x2ef948);}return null;})[_0xd9f4('0x20')](function(_0x404cd9){var _0x569c1d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x404cd9[_0xd9f4('0x29')][_0xd9f4('0x6c')];return db[_0xd9f4('0x6d')][_0xd9f4('0x46')](_0x569c1d,{'type':db[_0xd9f4('0x6e')]['QueryTypes'][_0xd9f4('0x6f')],'raw':!![]})[_0xd9f4('0x20')](function(_0x2bf7c5){return _0x2bf7c5;});})['then'](function(_0x201740){if(_0x201740){_0x2ef948[_0xd9f4('0x29')][_0xd9f4('0x70')]=_0x201740[0x0];if(!_0x38e090[_0xd9f4('0x5a')][_0xd9f4('0x61')])return;return db[_0xd9f4('0x71')]['find']({'where':{'id':_0x38e090[_0xd9f4('0x5a')][_0xd9f4('0x61')],'role':_0xd9f4('0x63')},'attributes':['id','name',_0xd9f4('0x72'),_0xd9f4('0x73'),_0xd9f4('0x74')],'raw':!![]});}return null;})[_0xd9f4('0x20')](function(_0x90e9b4){if(!_0x90e9b4)return null;_0x2ef948[_0xd9f4('0x29')][_0xd9f4('0x63')]=_0x90e9b4;return _0x2ef948;})[_0xd9f4('0x20')](function(_0x2b32c9){if(_0x2b32c9){if(_0x38e090['body']['manual']){_0x2ef948['message'][_0xd9f4('0x75')]=util[_0xd9f4('0x60')]('SIP/%s',_0x38e090[_0xd9f4('0x62')][_0xd9f4('0x3c')]);_0x2ef948[_0xd9f4('0x29')][_0xd9f4('0x76')]=_0x2ef948['channel'];_0x2ef948['message']['motionChannel']=_0x2ef948[_0xd9f4('0x76')];_0x2ef948[_0xd9f4('0x29')][_0xd9f4('0x77')]=_0xd9f4('0x5c');return respondWithRpcPromise(_0xd9f4('0x78'),_0xd9f4('0x78'),{'event':_0xd9f4('0x79'),'message':_0x2ef948[_0xd9f4('0x29')]},client9002)[_0xd9f4('0x20')](function(){return _0x2ef948;});}return _0x2ef948;}return null;})[_0xd9f4('0x20')](respondWithResult(_0x578e7b,null))['catch'](handleError(_0x578e7b,null));};var interaction_log=require('../../config/logger')(_0xd9f4('0x7a'));exports[_0xd9f4('0x37')]=function(_0xf85846,_0x4b4973,_0x854a4a){var _0x3f3ff4={'agent':{},'channel':_0xd9f4('0x5d')};if(_0xf85846[_0xd9f4('0x5a')]['id']){delete _0xf85846[_0xd9f4('0x5a')]['id'];}_0xf85846[_0xd9f4('0x5a')][_0xd9f4('0x61')]=_0xf85846[_0xd9f4('0x5a')][_0xd9f4('0x61')]||_0xf85846['user']['id'];_0x3f3ff4[_0xd9f4('0x63')]['id']=_0xf85846[_0xd9f4('0x5a')][_0xd9f4('0x61')];return db[_0xd9f4('0x40')][_0xd9f4('0x58')]({'where':{'id':_0xf85846['params']['id'],'UserId':null}})[_0xd9f4('0x20')](handleEntityNotFound(_0x4b4973,null))[_0xd9f4('0x20')](function(_0x3ec422){if(_0x3ec422){_0x3f3ff4[_0xd9f4('0x29')]=_0x3ec422['get']({'plain':!![]});return db['OpenchannelInteraction'][_0xd9f4('0x58')]({'where':{'id':_0x3ec422['OpenchannelInteractionId']}});}return null;})[_0xd9f4('0x20')](handleEntityNotFound(_0x4b4973,null))['then'](function(_0x57605a){if(_0x57605a){_0x3f3ff4['interaction']=_0x57605a[_0xd9f4('0x64')]({'plain':!![]});interaction_log[_0xd9f4('0x21')](_0xd9f4('0x7b'),_0xf85846[_0xd9f4('0x62')]['id'],_0xf85846[_0xd9f4('0x62')][_0xd9f4('0x3c')],_0xf85846['user'][_0xd9f4('0x7c')],_0x3f3ff4[_0xd9f4('0x6a')]['id'],_0xf85846['body']?JSON[_0xd9f4('0x26')](_0xf85846[_0xd9f4('0x5a')]):'null');return respondWithRpcPromise(_0xd9f4('0x7d'),'rejectMessage',_0x3f3ff4);}return null;})['then'](function(_0x56734c){var _0x2c8f56=_0xd9f4('0x7e')+_0x56734c['message'][_0xd9f4('0x6c')];return db[_0xd9f4('0x6d')][_0xd9f4('0x46')](_0x2c8f56,{'type':db[_0xd9f4('0x6e')][_0xd9f4('0x7f')][_0xd9f4('0x6f')],'raw':!![]})[_0xd9f4('0x20')](function(_0x5da1b2){return _0x5da1b2;});})[_0xd9f4('0x20')](function(_0x3632f9){if(_0x3632f9){_0x3f3ff4[_0xd9f4('0x29')][_0xd9f4('0x70')]=_0x3632f9[0x0];if(!_0xf85846['body'][_0xd9f4('0x61')])return;return db['User'][_0xd9f4('0x58')]({'where':{'id':_0xf85846[_0xd9f4('0x5a')]['UserId'],'role':_0xd9f4('0x63')},'attributes':['id','name','fullname','email',_0xd9f4('0x74')],'raw':!![]});}return null;})[_0xd9f4('0x20')](function(_0x491598){if(!_0x491598)return null;_0x3f3ff4[_0xd9f4('0x29')][_0xd9f4('0x63')]=_0x491598;return _0x3f3ff4;})[_0xd9f4('0x20')](function(_0x1017a9){if(_0x1017a9){_0x1017a9[_0xd9f4('0x29')]['interface']=util[_0xd9f4('0x60')](_0xd9f4('0x80'),_0xf85846[_0xd9f4('0x62')][_0xd9f4('0x3c')]);_0x1017a9[_0xd9f4('0x29')][_0xd9f4('0x76')]=_0x3f3ff4['channel'];_0x1017a9[_0xd9f4('0x29')][_0xd9f4('0x81')]=_0x3f3ff4[_0xd9f4('0x76')];_0x1017a9['message'][_0xd9f4('0x77')]=_0xd9f4('0x37');respondWithRpcPromise('EventManager',_0xd9f4('0x78'),{'event':_0xd9f4('0x82'),'message':_0x1017a9[_0xd9f4('0x29')]},client9002);return _0x3f3ff4;}return null;})[_0xd9f4('0x20')](respondWithResult(_0x4b4973,null))['catch'](handleError(_0x4b4973,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index dbc79de..66255f8 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 _0x5121=['remove','emit','hook','exports','OpenchannelMessage','save','update'];(function(_0x1a9b10,_0x431c13){var _0x3ef8d1=function(_0x1db391){while(--_0x1db391){_0x1a9b10['push'](_0x1a9b10['shift']());}};_0x3ef8d1(++_0x431c13);}(_0x5121,0x11c));var _0x1512=function(_0x412c8f,_0x11ec94){_0x412c8f=_0x412c8f-0x0;var _0x27c005=_0x5121[_0x412c8f];return _0x27c005;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0x1512('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1512('0x1'),'afterUpdate':_0x1512('0x2'),'afterDestroy':_0x1512('0x3')};function emitEvent(_0x45a099){return function(_0xa3cd0d,_0x57231d,_0x18b0c1){OpenchannelMessageEvents[_0x1512('0x4')](_0x45a099+':'+_0xa3cd0d['id'],_0xa3cd0d);OpenchannelMessageEvents[_0x1512('0x4')](_0x45a099,_0xa3cd0d);_0x18b0c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x1512('0x5')](e,emitEvent(event));}}module[_0x1512('0x6')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x66ac=['remove','emit','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x66ac,0x1f2));var _0xc66a=function(_0x2cafa6,_0x50b34f){_0x2cafa6=_0x2cafa6-0x0;var _0x58718e=_0x66ac[_0x2cafa6];return _0x58718e;};'use strict';var EventEmitter=require(_0xc66a('0x0'));var OpenchannelMessage=require(_0xc66a('0x1'))['db'][_0xc66a('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xc66a('0x3')](0x0);var events={'afterCreate':_0xc66a('0x4'),'afterUpdate':_0xc66a('0x5'),'afterDestroy':_0xc66a('0x6')};function emitEvent(_0x438802){return function(_0x34d3b9,_0x350849,_0x2665a2){OpenchannelMessageEvents[_0xc66a('0x7')](_0x438802+':'+_0x34d3b9['id'],_0x34d3b9);OpenchannelMessageEvents['emit'](_0x438802,_0x34d3b9);_0x2665a2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 2f252c6..455ea54 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 _0x47b5=['path','../../config/environment','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','CmContact','describe','find','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','omit','Contact','method','GET','POST','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','catch','error','inspect','finally','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x58bec1,_0x42c53f){var _0x16439f=function(_0x19b7ec){while(--_0x19b7ec){_0x58bec1['push'](_0x58bec1['shift']());}};_0x16439f(++_0x42c53f);}(_0x47b5,0x18a));var _0x547b=function(_0x2b9c8f,_0x4eef12){_0x2b9c8f=_0x2b9c8f-0x0;var _0x1026f2=_0x47b5[_0x2b9c8f];return _0x1026f2;};'use strict';var _=require(_0x547b('0x0'));var util=require('util');var logger=require(_0x547b('0x1'))(_0x547b('0x2'));var moment=require(_0x547b('0x3'));var BPromise=require(_0x547b('0x4'));var rp=require(_0x547b('0x5'));var fs=require('fs');var path=require(_0x547b('0x6'));var rimraf=require('rimraf');var config=require(_0x547b('0x7'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x34dc87,_0x4bd462){return _0x34dc87['define'](_0x547b('0x8'),attributes,{'tableName':_0x547b('0x9'),'paranoid':![],'indexes':[{'name':_0x547b('0xa'),'fields':[_0x547b('0xb')],'type':_0x547b('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x239c2f,_0x4ae99c,_0x4207d2){var _0xafd965=_0x34dc87['models'];var _0x1d8777=_0x239c2f[_0x547b('0xd')]({'plain':!![]});if(_0x1d8777[_0x547b('0xe')]['toLowerCase']()==='in'||_0x1d8777['direction'][_0x547b('0xf')]()===_0x547b('0x10')&&!_0x1d8777[_0x547b('0x11')]&&!_[_0x547b('0x12')](_0x1d8777[_0x547b('0x13')])){_0xafd965[_0x547b('0x14')][_0x547b('0x15')]({'where':{'id':_0x1d8777[_0x547b('0x16')]}})[_0x547b('0x17')](function(_0x22a68){if(_0x22a68){_0x22a68['update']({'lastMsgAt':_0x1d8777['createdAt'],'lastMsgDirection':_0x1d8777[_0x547b('0xe')]['toLowerCase']()});}})['catch'](function(_0x2470d2){console['error'](_0x2470d2);});}if(_0x1d8777[_0x547b('0xe')]==='out'&&!_0x1d8777[_0x547b('0x11')]){var _0x5a0b0b;_0xafd965[_0x547b('0x18')][_0x547b('0x19')]()[_0x547b('0x17')](function(_0x16b442){return _0xafd965['OpenchannelAccount'][_0x547b('0x1a')]({'where':{'id':_0x1d8777['OpenchannelAccountId']},'include':[{'model':_0xafd965['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x1d8777[_0x547b('0x16')]},'limit':0x1,'include':[{'model':_0xafd965[_0x547b('0x18')],'as':'Contact','attributes':_[_0x547b('0x1b')](_0x16b442)}]}]});})[_0x547b('0x17')](function(_0x4beab5){_0x5a0b0b=_0x4beab5[_0x547b('0xd')]({'plain':!![]});if(_0x5a0b0b&&_0x5a0b0b[_0x547b('0x1c')]){logger[_0x547b('0x1d')](_0x547b('0x1e'),_0x547b('0x1f'),util['format'](_0x547b('0x20'),_0x1d8777['id'],_0x5a0b0b[_0x547b('0x1c')]));if(_0x5a0b0b[_0x547b('0x21')]&&_0x5a0b0b['Interactions'][_0x547b('0x22')]){_0x1d8777['Interaction']=_[_0x547b('0x23')](_0x5a0b0b[_0x547b('0x21')][0x0],_0x547b('0x24'));_0x1d8777[_0x547b('0x24')]=_0x5a0b0b[_0x547b('0x21')][0x0][_0x547b('0x24')];}var _0x4ae99c={'method':'POST','uri':encodeURI(_0x5a0b0b[_0x547b('0x1c')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4ae99c[_0x547b('0x25')]){case _0x547b('0x26'):_0x4ae99c['qs']=_0x1d8777;break;case _0x547b('0x27'):_0x4ae99c[_0x547b('0xb')]=_0x1d8777;break;}return rp(_0x4ae99c)[_0x547b('0x17')](function(_0x10524a){logger[_0x547b('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x547b('0x1f'),util[_0x547b('0x28')](_0x547b('0x29'),_0x1d8777['id'],_0x5a0b0b[_0x547b('0x1c')]));if(_0x10524a[_0x547b('0xb')][_0x547b('0x2a')]&&_0x10524a[_0x547b('0xb')][_0x547b('0x2a')]!=_0x1d8777[_0x547b('0x2b')][_0x547b('0x2a')]){return _0xafd965['OpenchannelInteraction']['update']({'threadId':_0x10524a[_0x547b('0xb')]['threadId']},{'where':{'id':_0x1d8777[_0x547b('0x2b')]['id']}});}else{return;}})[_0x547b('0x17')](function(){return _0x239c2f[_0x547b('0x2c')]({'read':!![]});})[_0x547b('0x2d')](function(_0x38db69){logger[_0x547b('0x2e')](_0x547b('0x1e'),_0x547b('0x1f'),util[_0x547b('0x2f')](_0x38db69,{'showHidden':![],'depth':null}));_0x4207d2();});}else{_0x4207d2();}})[_0x547b('0x30')](function(){_0x4207d2();});}else{_0x4207d2();}}},'charset':'utf8mb4','collate':_0x547b('0x31')});}; \ No newline at end of file +var _0x6d1d=['error','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys','replyUri','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','method','GET','POST','Message\x20%d\x20forwarded\x20to\x20%s','body','threadId','Interaction','OpenchannelMessage,\x20%s,\x20%s','inspect','finally','utf8mb4','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','then','update','createdAt','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6d1d,0xe6));var _0xd6d1=function(_0x2c3f37,_0x5a46b6){_0x2c3f37=_0x2c3f37-0x0;var _0x12a453=_0x6d1d[_0x2c3f37];return _0x12a453;};'use strict';var _=require('lodash');var util=require(_0xd6d1('0x0'));var logger=require(_0xd6d1('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd6d1('0x2'));var rp=require(_0xd6d1('0x3'));var fs=require('fs');var path=require(_0xd6d1('0x4'));var rimraf=require(_0xd6d1('0x5'));var config=require(_0xd6d1('0x6'));var attributes=require(_0xd6d1('0x7'));module[_0xd6d1('0x8')]=function(_0x402087,_0x4606eb){return _0x402087[_0xd6d1('0x9')](_0xd6d1('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xd6d1('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c7d0e,_0x5deba3,_0x593ab6){var _0x3ec319=_0x402087[_0xd6d1('0xc')];var _0x4ce14f=_0x1c7d0e[_0xd6d1('0xd')]({'plain':!![]});if(_0x4ce14f[_0xd6d1('0xe')][_0xd6d1('0xf')]()==='in'||_0x4ce14f[_0xd6d1('0xe')][_0xd6d1('0xf')]()===_0xd6d1('0x10')&&!_0x4ce14f[_0xd6d1('0x11')]&&!_[_0xd6d1('0x12')](_0x4ce14f[_0xd6d1('0x13')])){_0x3ec319[_0xd6d1('0x14')]['findOne']({'where':{'id':_0x4ce14f['OpenchannelInteractionId']}})[_0xd6d1('0x15')](function(_0x8e8f8e){if(_0x8e8f8e){_0x8e8f8e[_0xd6d1('0x16')]({'lastMsgAt':_0x4ce14f[_0xd6d1('0x17')],'lastMsgDirection':_0x4ce14f['direction'][_0xd6d1('0xf')]()});}})[_0xd6d1('0x18')](function(_0x27b99b){console[_0xd6d1('0x19')](_0x27b99b);});}if(_0x4ce14f['direction']===_0xd6d1('0x10')&&!_0x4ce14f[_0xd6d1('0x11')]){var _0x279bd8;_0x3ec319[_0xd6d1('0x1a')]['describe']()[_0xd6d1('0x15')](function(_0x470bfa){return _0x3ec319[_0xd6d1('0x1b')][_0xd6d1('0x1c')]({'where':{'id':_0x4ce14f[_0xd6d1('0x1d')]},'include':[{'model':_0x3ec319[_0xd6d1('0x14')],'as':_0xd6d1('0x1e'),'where':{'id':_0x4ce14f[_0xd6d1('0x1f')]},'limit':0x1,'include':[{'model':_0x3ec319[_0xd6d1('0x1a')],'as':_0xd6d1('0x20'),'attributes':_[_0xd6d1('0x21')](_0x470bfa)}]}]});})[_0xd6d1('0x15')](function(_0x2f1db2){_0x279bd8=_0x2f1db2[_0xd6d1('0xd')]({'plain':!![]});if(_0x279bd8&&_0x279bd8[_0xd6d1('0x22')]){logger[_0xd6d1('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0xd6d1('0x24'),util[_0xd6d1('0x25')](_0xd6d1('0x26'),_0x4ce14f['id'],_0x279bd8[_0xd6d1('0x22')]));if(_0x279bd8['Interactions']&&_0x279bd8[_0xd6d1('0x1e')][_0xd6d1('0x27')]){_0x4ce14f['Interaction']=_['omit'](_0x279bd8[_0xd6d1('0x1e')][0x0],_0xd6d1('0x20'));_0x4ce14f['Contact']=_0x279bd8[_0xd6d1('0x1e')][0x0][_0xd6d1('0x20')];}var _0x5deba3={'method':'POST','uri':encodeURI(_0x279bd8[_0xd6d1('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5deba3[_0xd6d1('0x28')]){case _0xd6d1('0x29'):_0x5deba3['qs']=_0x4ce14f;break;case _0xd6d1('0x2a'):_0x5deba3['body']=_0x4ce14f;break;}return rp(_0x5deba3)[_0xd6d1('0x15')](function(_0x1119a4){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xd6d1('0x24'),util['format'](_0xd6d1('0x2b'),_0x4ce14f['id'],_0x279bd8[_0xd6d1('0x22')]));if(_0x1119a4[_0xd6d1('0x2c')][_0xd6d1('0x2d')]&&_0x1119a4[_0xd6d1('0x2c')][_0xd6d1('0x2d')]!=_0x4ce14f[_0xd6d1('0x2e')]['threadId']){return _0x3ec319[_0xd6d1('0x14')][_0xd6d1('0x16')]({'threadId':_0x1119a4[_0xd6d1('0x2c')][_0xd6d1('0x2d')]},{'where':{'id':_0x4ce14f[_0xd6d1('0x2e')]['id']}});}else{return;}})[_0xd6d1('0x15')](function(){return _0x1c7d0e[_0xd6d1('0x16')]({'read':!![]});})[_0xd6d1('0x18')](function(_0x468947){logger[_0xd6d1('0x19')](_0xd6d1('0x2f'),_0xd6d1('0x24'),util[_0xd6d1('0x30')](_0x468947,{'showHidden':![],'depth':null}));_0x593ab6();});}else{_0x593ab6();}})[_0xd6d1('0x31')](function(){_0x593ab6();});}else{_0x593ab6();}}},'charset':_0xd6d1('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 7373010..bde6320 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x5dce9a,_0x442821){var _0x3f59b5=function(_0x4c08c3){while(--_0x4c08c3){_0x5dce9a['push'](_0x5dce9a['shift']());}};_0x3f59b5(++_0x442821);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4f82ec,_0x195c3a){var _0x13fa87=function(_0x52a270){while(--_0x52a270){_0x4f82ec['push'](_0x4f82ec['shift']());}};_0x13fa87(++_0x195c3a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4e56ce,_0x4383a9){_0x4e56ce=_0x4e56ce-0x0;var _0x37e99e=_0x5f2f[_0x4e56ce];return _0x37e99e;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index d99082e..24f023c 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 _0x00a5=['removeListener','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0xe45948,_0x5eb5e9){var _0x38e52b=function(_0x1a04f9){while(--_0x1a04f9){_0xe45948['push'](_0xe45948['shift']());}};_0x38e52b(++_0x5eb5e9);}(_0x00a5,0x19e));var _0x500a=function(_0x17dfda,_0x808101){_0x17dfda=_0x17dfda-0x0;var _0x4e887b=_0x00a5[_0x17dfda];return _0x4e887b;};'use strict';var OpenchannelMessageEvents=require(_0x500a('0x0'));var events=['save','remove','update'];function createListener(_0x2a6f93,_0xca6fd5){return function(_0x21e0ef){_0xca6fd5['emit'](_0x2a6f93,_0x21e0ef);};}function removeListener(_0x46c695,_0x599909){return function(){OpenchannelMessageEvents[_0x500a('0x1')](_0x46c695,_0x599909);};}exports[_0x500a('0x2')]=function(_0x2812fb){for(var _0x3ce670=0x0,_0x34f8a1=events[_0x500a('0x3')];_0x3ce670<_0x34f8a1;_0x3ce670++){var _0x33587d=events[_0x3ce670];var _0x466b6f=createListener(_0x500a('0x4')+_0x33587d,_0x2812fb);OpenchannelMessageEvents['on'](_0x33587d,_0x466b6f);}}; \ No newline at end of file +var _0xb205=['register','length','openchannelMessage:','./openchannelMessage.events','remove','emit'];(function(_0x252ab6,_0x69db5d){var _0x47005a=function(_0x2e16ec){while(--_0x2e16ec){_0x252ab6['push'](_0x252ab6['shift']());}};_0x47005a(++_0x69db5d);}(_0xb205,0x183));var _0x5b20=function(_0x2444ef,_0xa106c8){_0x2444ef=_0x2444ef-0x0;var _0x41bea0=_0xb205[_0x2444ef];return _0x41bea0;};'use strict';var OpenchannelMessageEvents=require(_0x5b20('0x0'));var events=['save',_0x5b20('0x1'),'update'];function createListener(_0x5cf4eb,_0x489214){return function(_0x3b82a8){_0x489214[_0x5b20('0x2')](_0x5cf4eb,_0x3b82a8);};}function removeListener(_0x4ca9ea,_0x24bccb){return function(){OpenchannelMessageEvents['removeListener'](_0x4ca9ea,_0x24bccb);};}exports[_0x5b20('0x3')]=function(_0x485d92){for(var _0x1440cc=0x0,_0x1feb73=events[_0x5b20('0x4')];_0x1440cc<_0x1feb73;_0x1440cc++){var _0x5b1ed3=events[_0x1440cc];var _0x18d044=createListener(_0x5b20('0x5')+_0x5b1ed3,_0x485d92);OpenchannelMessageEvents['on'](_0x5b1ed3,_0x18d044);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index f00ef2a..8e75365 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 _0xa07d=['create','addTeams','addAgents','put','/:id','destroy','removeTeams','delete','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id/members','/:id/teams','getTeams','/:id/users','post'];(function(_0x3f1615,_0x15fb94){var _0x283cac=function(_0x202609){while(--_0x202609){_0x3f1615['push'](_0x3f1615['shift']());}};_0x283cac(++_0x15fb94);}(_0xa07d,0x133));var _0xda07=function(_0x3e278b,_0x29052c){_0x3e278b=_0x3e278b-0x0;var _0x290160=_0xa07d[_0x3e278b];return _0x290160;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xda07('0x0'));var express=require(_0xda07('0x1'));var router=express[_0xda07('0x2')]();var fs_extra=require(_0xda07('0x3'));var auth=require(_0xda07('0x4'));var interaction=require(_0xda07('0x5'));var config=require(_0xda07('0x6'));var controller=require(_0xda07('0x7'));router[_0xda07('0x8')]('/',auth[_0xda07('0x9')](),controller['index']);router['get'](_0xda07('0xa'),auth[_0xda07('0x9')](),controller[_0xda07('0xb')]);router[_0xda07('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xda07('0x8')](_0xda07('0xc'),auth[_0xda07('0x9')](),controller['getMembers']);router[_0xda07('0x8')](_0xda07('0xd'),auth[_0xda07('0x9')](),controller[_0xda07('0xe')]);router[_0xda07('0x8')](_0xda07('0xf'),auth[_0xda07('0x9')](),controller['getAgents']);router[_0xda07('0x10')]('/',auth[_0xda07('0x9')](),controller[_0xda07('0x11')]);router[_0xda07('0x10')](_0xda07('0xd'),auth[_0xda07('0x9')](),controller[_0xda07('0x12')]);router[_0xda07('0x10')](_0xda07('0xf'),auth['isAuthenticated'](),controller[_0xda07('0x13')]);router[_0xda07('0x14')]('/:id',auth[_0xda07('0x9')](),controller['update']);router['delete'](_0xda07('0x15'),auth['isAuthenticated'](),controller[_0xda07('0x16')]);router['delete'](_0xda07('0xd'),auth[_0xda07('0x9')](),controller[_0xda07('0x17')]);router[_0xda07('0x18')]('/:id/users',auth[_0xda07('0x9')](),controller[_0xda07('0x19')]);module[_0xda07('0x1a')]=router; \ No newline at end of file +var _0x3aca=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','exports','multer','path'];(function(_0x13cf64,_0x596644){var _0x14c102=function(_0x3234df){while(--_0x3234df){_0x13cf64['push'](_0x13cf64['shift']());}};_0x14c102(++_0x596644);}(_0x3aca,0xe6));var _0xa3ac=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0x3aca[_0x1c6ef2];return _0x404b8c;};'use strict';var multer=require(_0xa3ac('0x0'));var util=require('util');var path=require(_0xa3ac('0x1'));var timeout=require(_0xa3ac('0x2'));var express=require(_0xa3ac('0x3'));var router=express['Router']();var fs_extra=require(_0xa3ac('0x4'));var auth=require(_0xa3ac('0x5'));var interaction=require(_0xa3ac('0x6'));var config=require(_0xa3ac('0x7'));var controller=require(_0xa3ac('0x8'));router[_0xa3ac('0x9')]('/',auth[_0xa3ac('0xa')](),controller[_0xa3ac('0xb')]);router[_0xa3ac('0x9')](_0xa3ac('0xc'),auth[_0xa3ac('0xa')](),controller[_0xa3ac('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa3ac('0xe')]);router[_0xa3ac('0x9')](_0xa3ac('0xf'),auth[_0xa3ac('0xa')](),controller[_0xa3ac('0x10')]);router[_0xa3ac('0x9')](_0xa3ac('0x11'),auth[_0xa3ac('0xa')](),controller['getTeams']);router['get'](_0xa3ac('0x12'),auth[_0xa3ac('0xa')](),controller[_0xa3ac('0x13')]);router[_0xa3ac('0x14')]('/',auth[_0xa3ac('0xa')](),controller[_0xa3ac('0x15')]);router[_0xa3ac('0x14')](_0xa3ac('0x11'),auth['isAuthenticated'](),controller[_0xa3ac('0x16')]);router['post']('/:id/users',auth[_0xa3ac('0xa')](),controller[_0xa3ac('0x17')]);router[_0xa3ac('0x18')](_0xa3ac('0x19'),auth[_0xa3ac('0xa')](),controller['update']);router[_0xa3ac('0x1a')](_0xa3ac('0x19'),auth[_0xa3ac('0xa')](),controller[_0xa3ac('0x1b')]);router[_0xa3ac('0x1a')]('/:id/teams',auth[_0xa3ac('0xa')](),controller['removeTeams']);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xa3ac('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 69cb026..781a76c 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 _0x2545=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x11309d,_0x5975ad){var _0xd63b7b=function(_0x5d2bca){while(--_0x5d2bca){_0x11309d['push'](_0x11309d['shift']());}};_0xd63b7b(++_0x5975ad);}(_0x2545,0x1d5));var _0x5254=function(_0x32382f,_0x1c1528){_0x32382f=_0x32382f-0x0;var _0x191978=_0x2545[_0x32382f];return _0x191978;};'use strict';var Sequelize=require(_0x5254('0x0'));module[_0x5254('0x1')]={'name':{'type':Sequelize[_0x5254('0x2')],'unique':_0x5254('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5254('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5254('0x5')](_0x5254('0x6'),_0x5254('0x7'),_0x5254('0x8'))}}; \ No newline at end of file +var _0xa9a5=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x48c4ef,_0x319d44){var _0x435715=function(_0x925d50){while(--_0x925d50){_0x48c4ef['push'](_0x48c4ef['shift']());}};_0x435715(++_0x319d44);}(_0xa9a5,0xd5));var _0x5a9a=function(_0x575d78,_0xf834fc){_0x575d78=_0x575d78-0x0;var _0x466dc8=_0xa9a5[_0x575d78];return _0x466dc8;};'use strict';var Sequelize=require(_0x5a9a('0x0'));module[_0x5a9a('0x1')]={'name':{'type':Sequelize[_0x5a9a('0x2')],'unique':_0x5a9a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5a9a('0x2')]},'timeout':{'type':Sequelize[_0x5a9a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5a9a('0x5')](_0x5a9a('0x6'),_0x5a9a('0x7'),_0x5a9a('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index dadd399..cedf1ff 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 _0x1813=['UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','openchannelPause','getTeams','Team','order','nolimit','addTeams','ids','User','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','field','from','team_has_openchannel_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','includes','union','compact','transaction','removeTeams','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','UserProfileResource','error','name','send','index','OpenchannelQueue','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','rows','show','keys','rawAttributes','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','body','find','params','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAll','findAndCountAll'];(function(_0x3e99ee,_0x268a2e){var _0x816dc3=function(_0x5ac2d4){while(--_0x5ac2d4){_0x3e99ee['push'](_0x3e99ee['shift']());}};_0x816dc3(++_0x268a2e);}(_0x1813,0x147));var _0x3181=function(_0xc50dc,_0x262dc7){_0xc50dc=_0xc50dc-0x0;var _0x1eb7b8=_0x1813[_0xc50dc];return _0x1eb7b8;};'use strict';var emlformat=require(_0x3181('0x0'));var rimraf=require(_0x3181('0x1'));var zipdir=require(_0x3181('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3181('0x3'));var moment=require(_0x3181('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3181('0x5'));var util=require(_0x3181('0x6'));var path=require('path');var sox=require(_0x3181('0x7'));var csv=require(_0x3181('0x8'));var ejs=require(_0x3181('0x9'));var fs=require('fs');var fs_extra=require(_0x3181('0xa'));var _=require(_0x3181('0xb'));var squel=require('squel');var crypto=require(_0x3181('0xc'));var jsforce=require(_0x3181('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3181('0x8'));var querystring=require(_0x3181('0xe'));var Papa=require(_0x3181('0xf'));var Redis=require(_0x3181('0x10'));var authService=require(_0x3181('0x11'));var qs=require(_0x3181('0x12'));var as=require(_0x3181('0x13'));var hardwareService=require(_0x3181('0x14'));var logger=require(_0x3181('0x15'))(_0x3181('0x16'));var utils=require(_0x3181('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3181('0x18'))['db'];config[_0x3181('0x19')]=_['defaults'](config['redis'],{'host':_0x3181('0x1a'),'port':0x18eb});var socket=require(_0x3181('0x1b'))(new Redis(config['redis']));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x496840,_0x2d3585){_0x2d3585=_0x2d3585||0xcc;return function(_0xe89605){if(_0xe89605){return _0x496840[_0x3181('0x1c')](_0x2d3585);}return _0x496840[_0x3181('0x1d')](_0x2d3585)[_0x3181('0x1e')]();};}function respondWithResult(_0x1e9c5f,_0x272437){_0x272437=_0x272437||0xc8;return function(_0x25ab59){if(_0x25ab59){return _0x1e9c5f[_0x3181('0x1d')](_0x272437)['json'](_0x25ab59);}};}function respondWithFilteredResult(_0x5f4b13,_0x15348d){return function(_0xe4f558){if(_0xe4f558){var _0x27e1f6=typeof _0x15348d[_0x3181('0x1f')]===_0x3181('0x20')&&typeof _0x15348d[_0x3181('0x21')]==='undefined';var _0x28ed87=_0xe4f558[_0x3181('0x22')];var _0x102f08=_0x27e1f6?0x0:_0x15348d[_0x3181('0x1f')];var _0x21af04=_0x27e1f6?_0xe4f558[_0x3181('0x22')]:_0x15348d[_0x3181('0x1f')]+_0x15348d[_0x3181('0x21')];var _0xe5e371;if(_0x21af04>=_0x28ed87){_0x21af04=_0x28ed87;_0xe5e371=0xc8;}else{_0xe5e371=0xce;}_0x5f4b13[_0x3181('0x1d')](_0xe5e371);return _0x5f4b13[_0x3181('0x23')]('Content-Range',_0x102f08+'-'+_0x21af04+'/'+_0x28ed87)['json'](_0xe4f558);}return null;};}function patchUpdates(_0x201b47){return function(_0x438950){try{jsonpatch[_0x3181('0x24')](_0x438950,_0x201b47,!![]);}catch(_0x2f4335){return BPromise['reject'](_0x2f4335);}return _0x438950[_0x3181('0x25')]();};}function saveUpdates(_0x4c85b9,_0x425f35){return function(_0x4e3376){if(_0x4e3376){return _0x4e3376[_0x3181('0x26')](_0x4c85b9)[_0x3181('0x27')](function(_0x376614){return _0x376614;});}return null;};}function removeEntity(_0x4d7b61,_0xc202d9){return function(_0x50fd89){if(_0x50fd89){return _0x50fd89[_0x3181('0x28')]()['then'](function(){var _0x2cf5c9=_0x50fd89[_0x3181('0x29')]({'plain':!![]});var _0x5a6ad3='OpenchannelQueues';return db[_0x3181('0x2a')]['destroy']({'where':{'type':_0x5a6ad3,'resourceId':_0x2cf5c9['id']}})[_0x3181('0x27')](function(){return _0x50fd89;});})[_0x3181('0x27')](function(){_0x4d7b61[_0x3181('0x1d')](0xcc)[_0x3181('0x1e')]();});}};}function handleEntityNotFound(_0x19fda8,_0x264931){return function(_0x540dc9){if(!_0x540dc9){_0x19fda8[_0x3181('0x1c')](0x194);}return _0x540dc9;};}function handleError(_0x4f12b3,_0x5f0ffd){_0x5f0ffd=_0x5f0ffd||0x1f4;return function(_0x54e14c){logger[_0x3181('0x2b')](_0x54e14c['stack']);if(_0x54e14c[_0x3181('0x2c')]){delete _0x54e14c['name'];}_0x4f12b3['status'](_0x5f0ffd)[_0x3181('0x2d')](_0x54e14c);};}exports[_0x3181('0x2e')]=function(_0x563e62,_0x5bbd0c){var _0x51e86e={},_0x568b02={},_0x3347f0={'count':0x0,'rows':[]};var _0x4c8678=_['map'](db[_0x3181('0x2f')]['rawAttributes'],function(_0x1b360c){return{'name':_0x1b360c[_0x3181('0x30')],'type':_0x1b360c[_0x3181('0x31')][_0x3181('0x32')]};});_0x568b02[_0x3181('0x33')]=_[_0x3181('0x34')](_0x4c8678,_0x3181('0x2c'));_0x568b02[_0x3181('0x35')]=_['keys'](_0x563e62['query']);_0x568b02[_0x3181('0x36')]=_[_0x3181('0x37')](_0x568b02[_0x3181('0x33')],_0x568b02[_0x3181('0x35')]);_0x51e86e[_0x3181('0x38')]=_['intersection'](_0x568b02[_0x3181('0x33')],qs[_0x3181('0x39')](_0x563e62['query'][_0x3181('0x39')]));_0x51e86e[_0x3181('0x38')]=_0x51e86e['attributes'][_0x3181('0x3a')]?_0x51e86e[_0x3181('0x38')]:_0x568b02['model'];if(!_0x563e62[_0x3181('0x35')][_0x3181('0x3b')]('nolimit')){_0x51e86e[_0x3181('0x21')]=qs['limit'](_0x563e62['query']['limit']);_0x51e86e[_0x3181('0x1f')]=qs[_0x3181('0x1f')](_0x563e62[_0x3181('0x35')][_0x3181('0x1f')]);}_0x51e86e['order']=qs[_0x3181('0x3c')](_0x563e62['query'][_0x3181('0x3c')]);_0x51e86e[_0x3181('0x3d')]=qs[_0x3181('0x36')](_[_0x3181('0x3e')](_0x563e62[_0x3181('0x35')],_0x568b02[_0x3181('0x36')]),_0x4c8678);if(_0x563e62[_0x3181('0x35')]['filter']){_0x51e86e[_0x3181('0x3d')]=_['merge'](_0x51e86e['where'],{'$or':_[_0x3181('0x34')](_0x4c8678,function(_0x1f9f4b){if(_0x1f9f4b['type']!=='VIRTUAL'){var _0x13481d={};_0x13481d[_0x1f9f4b[_0x3181('0x2c')]]={'$like':'%'+_0x563e62['query'][_0x3181('0x3f')]+'%'};return _0x13481d;}})});}_0x51e86e=_[_0x3181('0x40')]({},_0x51e86e,_0x563e62[_0x3181('0x41')]);var _0x4ed592={'where':_0x51e86e[_0x3181('0x3d')]};return db[_0x3181('0x2f')][_0x3181('0x22')](_0x4ed592)[_0x3181('0x27')](function(_0x4871f1){_0x3347f0['count']=_0x4871f1;if(_0x563e62[_0x3181('0x35')][_0x3181('0x42')]){_0x51e86e[_0x3181('0x43')]=[{'all':!![]}];}return db[_0x3181('0x2f')]['findAll'](_0x51e86e);})[_0x3181('0x27')](function(_0x5d8456){_0x3347f0[_0x3181('0x44')]=_0x5d8456;return _0x3347f0;})[_0x3181('0x27')](respondWithFilteredResult(_0x5bbd0c,_0x51e86e))['catch'](handleError(_0x5bbd0c,null));};exports[_0x3181('0x45')]=function(_0x346336,_0x5ea7e7){var _0x19b428={'raw':!![],'where':{'id':_0x346336['params']['id']}},_0x147579={};_0x147579[_0x3181('0x33')]=_[_0x3181('0x46')](db[_0x3181('0x2f')][_0x3181('0x47')]);_0x147579[_0x3181('0x35')]=_[_0x3181('0x46')](_0x346336[_0x3181('0x35')]);_0x147579[_0x3181('0x36')]=_[_0x3181('0x37')](_0x147579[_0x3181('0x33')],_0x147579[_0x3181('0x35')]);_0x19b428[_0x3181('0x38')]=_[_0x3181('0x37')](_0x147579[_0x3181('0x33')],qs[_0x3181('0x39')](_0x346336[_0x3181('0x35')][_0x3181('0x39')]));_0x19b428['attributes']=_0x19b428[_0x3181('0x38')][_0x3181('0x3a')]?_0x19b428[_0x3181('0x38')]:_0x147579['model'];if(_0x346336[_0x3181('0x35')][_0x3181('0x42')]){_0x19b428[_0x3181('0x43')]=[{'all':!![]}];}_0x19b428=_[_0x3181('0x40')]({},_0x19b428,_0x346336['options']);return db[_0x3181('0x2f')]['find'](_0x19b428)[_0x3181('0x27')](handleEntityNotFound(_0x5ea7e7,null))['then'](respondWithResult(_0x5ea7e7,null))[_0x3181('0x48')](handleError(_0x5ea7e7,null));};exports[_0x3181('0x49')]=function(_0x399070,_0x58a065){return db[_0x3181('0x2f')][_0x3181('0x49')](_0x399070['body'],{})[_0x3181('0x27')](function(_0x48b1c8){var _0x399af1=_0x399070['user'][_0x3181('0x29')]({'plain':!![]});if(!_0x399af1)throw new Error(_0x3181('0x4a'));if(_0x399af1[_0x3181('0x4b')]==='user'){var _0x21fb3f=_0x48b1c8['get']({'plain':!![]});var _0x17933e=_0x3181('0x4c');return db[_0x3181('0x4d')]['find']({'where':{'name':_0x17933e,'userProfileId':_0x399af1[_0x3181('0x4e')]},'raw':!![]})[_0x3181('0x27')](function(_0x31056e){if(_0x31056e&&_0x31056e[_0x3181('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x21fb3f['name'],'resourceId':_0x21fb3f['id'],'type':_0x31056e[_0x3181('0x2c')],'sectionId':_0x31056e['id']},{})[_0x3181('0x27')](function(){return _0x48b1c8;});}else{return _0x48b1c8;}})[_0x3181('0x48')](function(_0x5dc4e5){logger[_0x3181('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dc4e5);throw _0x5dc4e5;});}return _0x48b1c8;})[_0x3181('0x27')](respondWithResult(_0x58a065,0xc9))[_0x3181('0x48')](handleError(_0x58a065,null));};exports['update']=function(_0x3286dc,_0x106ea4){if(_0x3286dc[_0x3181('0x50')]['id']){delete _0x3286dc['body']['id'];}return db['OpenchannelQueue'][_0x3181('0x51')]({'where':{'id':_0x3286dc['params']['id']}})[_0x3181('0x27')](handleEntityNotFound(_0x106ea4,null))['then'](saveUpdates(_0x3286dc['body'],null))['then'](respondWithResult(_0x106ea4,null))[_0x3181('0x48')](handleError(_0x106ea4,null));};exports[_0x3181('0x28')]=function(_0x3d9ef1,_0x5f21d3){return db[_0x3181('0x2f')][_0x3181('0x51')]({'where':{'id':_0x3d9ef1[_0x3181('0x52')]['id']}})[_0x3181('0x27')](handleEntityNotFound(_0x5f21d3,null))[_0x3181('0x27')](removeEntity(_0x5f21d3,null))[_0x3181('0x48')](handleError(_0x5f21d3,null));};exports['describe']=function(_0x4ba958,_0x266718){return db[_0x3181('0x2f')][_0x3181('0x53')]()[_0x3181('0x27')](respondWithResult(_0x266718,null))[_0x3181('0x48')](handleError(_0x266718,null));};exports[_0x3181('0x54')]=function(_0x23d9fb,_0x43454e,_0x38303d){var _0x5b7cc9={'raw':!![],'where':{}},_0x242a20={},_0x1139f6;return db['OpenchannelQueue'][_0x3181('0x55')]({'where':{'id':_0x23d9fb[_0x3181('0x52')]['id']}})[_0x3181('0x27')](handleEntityNotFound(_0x43454e,null))['then'](function(_0x252573){if(_0x252573){_0x1139f6=_0x252573[_0x3181('0x29')]({'plain':!![]});_0x242a20[_0x3181('0x33')]=_[_0x3181('0x46')](db[_0x3181('0x56')][_0x3181('0x47')]);_0x242a20['query']=_['keys'](_0x23d9fb['query']);_0x242a20[_0x3181('0x36')]=_[_0x3181('0x37')](_0x242a20[_0x3181('0x33')],_0x242a20['query']);_0x5b7cc9[_0x3181('0x38')]=_[_0x3181('0x37')](_0x242a20[_0x3181('0x33')],qs[_0x3181('0x39')](_0x23d9fb[_0x3181('0x35')]['fields']));_0x5b7cc9[_0x3181('0x38')]=_0x5b7cc9[_0x3181('0x38')]['length']?_0x5b7cc9[_0x3181('0x38')]:_0x242a20[_0x3181('0x33')];if(!_0x23d9fb[_0x3181('0x35')][_0x3181('0x3b')]('nolimit')){_0x5b7cc9[_0x3181('0x21')]=qs[_0x3181('0x21')](_0x23d9fb[_0x3181('0x35')][_0x3181('0x21')]);_0x5b7cc9['offset']=qs[_0x3181('0x1f')](_0x23d9fb[_0x3181('0x35')][_0x3181('0x1f')]);}_0x5b7cc9['order']=qs[_0x3181('0x3c')](_0x23d9fb[_0x3181('0x35')]['sort']);_0x5b7cc9[_0x3181('0x3d')]=qs['filters'](_[_0x3181('0x3e')](_0x23d9fb[_0x3181('0x35')],_0x242a20[_0x3181('0x36')]));_0x5b7cc9[_0x3181('0x3d')][_0x3181('0x57')]=_0x252573['id'];if(_0x23d9fb['query']['filter']){_0x5b7cc9['where']=_[_0x3181('0x40')](_0x5b7cc9[_0x3181('0x3d')],{'$or':_['map'](_0x5b7cc9[_0x3181('0x38')],function(_0x4b71cb){var _0x4c8d36={};_0x4c8d36[_0x4b71cb]={'$like':'%'+_0x23d9fb[_0x3181('0x35')]['filter']+'%'};return _0x4c8d36;})});}_0x5b7cc9=_['merge']({},_0x5b7cc9,_0x23d9fb[_0x3181('0x41')]);return db[_0x3181('0x56')][_0x3181('0x58')](_0x5b7cc9);}})[_0x3181('0x27')](function(_0x3a4e25){if(_0x3a4e25){return db['User'][_0x3181('0x59')]({'where':{'id':_[_0x3181('0x34')](_0x3a4e25,_0x3181('0x5a')),'role':_0x3181('0x5b')},'attributes':['id',_0x3181('0x2c'),'openchannelPause',_0x3181('0x5c'),_0x3181('0x5d')]});}})['then'](function(_0x4de7e0){if(_0x4de7e0){return{'count':_0x4de7e0[_0x3181('0x22')],'rows':_[_0x3181('0x34')](_0x4de7e0[_0x3181('0x44')],function(_0x27fb25){return{'membername':_0x27fb25[_0x3181('0x2c')],'UserId':_0x27fb25['id'],'queue_name':_0x1139f6['name'],'OpenchannelQueueId':_0x1139f6['id'],'interface':util[_0x3181('0x5e')](_0x3181('0x5f'),_0x3181('0x60'),_0x27fb25[_0x3181('0x2c')]),'penalty':0x0,'paused':_0x27fb25[_0x3181('0x61')],'createdAt':_0x27fb25[_0x3181('0x5d')],'updatedAt':_0x27fb25[_0x3181('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3181('0x27')](respondWithFilteredResult(_0x43454e,_0x5b7cc9))[_0x3181('0x48')](handleError(_0x43454e,null));};exports[_0x3181('0x62')]=function(_0x7200cd,_0x3d4913,_0x493c14){var _0x182491={};var _0x1e0f15={};var _0x4aca6a;var _0x2556ec;return db[_0x3181('0x2f')][_0x3181('0x55')]({'where':{'id':_0x7200cd[_0x3181('0x52')]['id']}})[_0x3181('0x27')](handleEntityNotFound(_0x3d4913,null))[_0x3181('0x27')](function(_0x1b4310){if(_0x1b4310){_0x4aca6a=_0x1b4310;_0x1e0f15[_0x3181('0x33')]=_[_0x3181('0x46')](db[_0x3181('0x63')][_0x3181('0x47')]);_0x1e0f15[_0x3181('0x35')]=_[_0x3181('0x46')](_0x7200cd[_0x3181('0x35')]);_0x1e0f15[_0x3181('0x36')]=_['intersection'](_0x1e0f15[_0x3181('0x33')],_0x1e0f15['query']);_0x182491[_0x3181('0x38')]=_[_0x3181('0x37')](_0x1e0f15[_0x3181('0x33')],qs[_0x3181('0x39')](_0x7200cd['query']['fields']));_0x182491[_0x3181('0x38')]=_0x182491[_0x3181('0x38')][_0x3181('0x3a')]?_0x182491['attributes']:_0x1e0f15[_0x3181('0x33')];_0x182491[_0x3181('0x64')]=qs[_0x3181('0x3c')](_0x7200cd[_0x3181('0x35')][_0x3181('0x3c')]);_0x182491['where']=qs['filters'](_[_0x3181('0x3e')](_0x7200cd['query'],_0x1e0f15[_0x3181('0x36')]));if(_0x7200cd[_0x3181('0x35')][_0x3181('0x3f')]){_0x182491[_0x3181('0x3d')]=_['merge'](_0x182491['where'],{'$or':_[_0x3181('0x34')](_0x182491['attributes'],function(_0x47ba64){var _0x15510d={};_0x15510d[_0x47ba64]={'$like':'%'+_0x7200cd[_0x3181('0x35')]['filter']+'%'};return _0x15510d;})});}_0x182491=_['merge']({},_0x182491,_0x7200cd[_0x3181('0x41')]);return _0x4aca6a['getTeams'](_0x182491);}})[_0x3181('0x27')](function(_0x1297e3){if(_0x1297e3){_0x2556ec=_0x1297e3[_0x3181('0x3a')];if(!_0x7200cd['query'][_0x3181('0x3b')](_0x3181('0x65'))){_0x182491['limit']=qs[_0x3181('0x21')](_0x7200cd[_0x3181('0x35')][_0x3181('0x21')]);_0x182491[_0x3181('0x1f')]=qs[_0x3181('0x1f')](_0x7200cd[_0x3181('0x35')][_0x3181('0x1f')]);}return _0x4aca6a[_0x3181('0x62')](_0x182491);}})[_0x3181('0x27')](function(_0x749085){if(_0x749085){return _0x749085?{'count':_0x2556ec,'rows':_0x749085}:null;}})['then'](respondWithResult(_0x3d4913,null))[_0x3181('0x48')](handleError(_0x3d4913,null));};exports[_0x3181('0x66')]=function(_0x43fcc0,_0x411541,_0x33956e){var _0x106a3f=_0x43fcc0[_0x3181('0x50')][_0x3181('0x67')];return db[_0x3181('0x63')][_0x3181('0x58')]({'where':{'id':_0x106a3f},'attributes':['id'],'include':[{'model':db[_0x3181('0x68')],'as':_0x3181('0x69'),'attributes':['id','name','online',_0x3181('0x6a'),_0x3181('0x6b')],'raw':!![]}]})[_0x3181('0x27')](function(_0x43425a){if(_0x43425a){var _0x2759f3=_[_0x3181('0x6c')](_0x43425a,function(_0x490e91){var _0x5395e4=_0x490e91[_0x3181('0x29')]({'plain':!![]});return _0x5395e4[_0x3181('0x69')];});return db[_0x3181('0x2f')][_0x3181('0x51')]({'where':{'id':_0x43fcc0['params']['id']}})[_0x3181('0x27')](function(_0x319867){return db[_0x3181('0x6d')]['transaction'](function(_0xbdea6b){return _0x319867['addTeams'](_0x106a3f,{'transaction':_0xbdea6b})[_0x3181('0x27')](function(){return BPromise[_0x3181('0x6e')](_0x2759f3,function(_0x15ba20){return db[_0x3181('0x56')][_0x3181('0x6f')]({'where':{'UserId':_0x15ba20['id'],'OpenchannelQueueId':_0x43fcc0[_0x3181('0x52')]['id']},'transaction':_0xbdea6b});});})[_0x3181('0x27')](function(){_0x2759f3[_0x3181('0x70')](function(_0x541528){socket[_0x3181('0x71')](_0x3181('0x72'),{'UserId':_0x541528['id'],'OpenchannelQueueId':_0x319867['id']});});});});});}})[_0x3181('0x27')](respondWithStatusCode(_0x411541,null))['catch'](handleError(_0x411541,null));};exports['removeTeams']=function(_0x330802,_0x5746e7,_0x567cca){return db[_0x3181('0x63')]['findAll']({'where':{'id':_0x330802[_0x3181('0x35')][_0x3181('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3181('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5746e7,null))['then'](function(_0x32f63c){var _0x5f5bb3=_[_0x3181('0x34')](_0x32f63c,'id');var _0xddc996=[];var _0x20270d=[];var _0x2aa1d5=squel[_0x3181('0x73')]();_0x2aa1d5[_0x3181('0x74')]('tq.TeamId')[_0x3181('0x75')](_0x3181('0x76'),'tq')[_0x3181('0x77')](_0x3181('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('OpenchannelQueueId\x20=\x20?',_0x330802[_0x3181('0x52')]['id']);for(var _0x4e86d9=0x0;_0x4e86d9<_0x32f63c[_0x3181('0x3a')];_0x4e86d9+=0x1){let _0x201c37=_0x32f63c[_0x4e86d9];for(var _0x3d3abb=0x0;_0x3d3abb<_0x201c37[_0x3181('0x69')][_0x3181('0x3a')];_0x3d3abb+=0x1){let _0x10d958=_0x201c37['Agents'][_0x3d3abb];var _0x42a45e=_0x2aa1d5[_0x3181('0x79')]();_0x42a45e[_0x3181('0x3d')](_0x3181('0x7a'),_0x10d958['id']);_0x20270d[_0x3181('0x7b')](db[_0x3181('0x6d')][_0x3181('0x35')](_0x42a45e[_0x3181('0x7c')](),{'type':db[_0x3181('0x6d')]['QueryTypes'][_0x3181('0x7d')]})['then'](function(_0x282db7){if(_0x282db7[_0x3181('0x3a')]===0x1){return _0x10d958['id'];}else{var _0x88bc47=_[_0x3181('0x7e')](_['map'](_0x282db7,'TeamId'),function(_0x5677a2){return _[_0x3181('0x7f')](_0x5f5bb3,_0x5677a2);});if(_0x88bc47){return _0x10d958['id'];}}}));}}return BPromise['all'](_0x20270d)[_0x3181('0x27')](function(_0x3d7fc7){_0xddc996=_(_0xddc996)[_0x3181('0x80')](_0x3d7fc7)[_0x3181('0x81')]()['value']();return db['OpenchannelQueue'][_0x3181('0x51')]({'where':{'id':_0x330802['params']['id']}})[_0x3181('0x27')](function(_0x1fe153){return db[_0x3181('0x6d')][_0x3181('0x82')](function(_0x2584d3){return _0x1fe153[_0x3181('0x83')](_0x330802[_0x3181('0x35')]['ids'],{'transaction':_0x2584d3})['then'](function(){if(!_[_0x3181('0x84')](_0xddc996)){return _0x1fe153[_0x3181('0x85')](_0xddc996,{'transaction':_0x2584d3});}})[_0x3181('0x27')](function(){_0xddc996[_0x3181('0x70')](function(_0x52c237){socket[_0x3181('0x71')](_0x3181('0x86'),{'UserId':_0x52c237,'OpenchannelQueueId':_0x1fe153['id']});});});});});});})['then'](respondWithStatusCode(_0x5746e7,null))[_0x3181('0x48')](handleError(_0x5746e7,null));};exports[_0x3181('0x87')]=function(_0x39d295,_0x46b4b0,_0x4c9779){return db[_0x3181('0x2f')][_0x3181('0x51')]({'where':{'id':_0x39d295[_0x3181('0x52')]['id']}})[_0x3181('0x27')](handleEntityNotFound(_0x46b4b0,null))[_0x3181('0x27')](function(_0x270eac){if(_0x270eac){return _0x270eac[_0x3181('0x87')](_0x39d295['body'][_0x3181('0x67')],_['omit'](_0x39d295[_0x3181('0x50')],[_0x3181('0x67'),'id'])||{})[_0x3181('0x88')](function(_0x153fcf){for(var _0x153490=0x0;_0x153490<_0x39d295['body']['ids'][_0x3181('0x3a')];_0x153490+=0x1){socket[_0x3181('0x71')](_0x3181('0x72'),{'UserId':Number(_0x39d295[_0x3181('0x50')][_0x3181('0x67')][_0x153490]),'OpenchannelQueueId':Number(_0x39d295[_0x3181('0x52')]['id'])});}return _0x153fcf;});}})[_0x3181('0x27')](respondWithResult(_0x46b4b0,null))[_0x3181('0x48')](handleError(_0x46b4b0,null));};exports[_0x3181('0x85')]=function(_0x594b6e,_0x211baf,_0x2d5e75){return db[_0x3181('0x2f')][_0x3181('0x51')]({'where':{'id':_0x594b6e[_0x3181('0x52')]['id']}})[_0x3181('0x27')](handleEntityNotFound(_0x211baf,null))[_0x3181('0x27')](function(_0x34db1d){if(_0x34db1d){return _0x34db1d[_0x3181('0x85')](_0x594b6e[_0x3181('0x35')][_0x3181('0x67')])[_0x3181('0x27')](function(){if(_[_0x3181('0x89')](_0x594b6e['query'][_0x3181('0x67')])){for(var _0x3fd06f=0x0;_0x3fd06f<_0x594b6e[_0x3181('0x35')][_0x3181('0x67')][_0x3181('0x3a')];_0x3fd06f+=0x1){socket[_0x3181('0x71')](_0x3181('0x86'),{'UserId':Number(_0x594b6e[_0x3181('0x35')][_0x3181('0x67')][_0x3fd06f]),'OpenchannelQueueId':Number(_0x594b6e[_0x3181('0x52')]['id'])});}}else{socket[_0x3181('0x71')](_0x3181('0x86'),{'UserId':Number(_0x594b6e[_0x3181('0x35')][_0x3181('0x67')]),'OpenchannelQueueId':Number(_0x594b6e[_0x3181('0x52')]['id'])});}});}})[_0x3181('0x27')](respondWithStatusCode(_0x211baf,null))[_0x3181('0x48')](handleError(_0x211baf,null));};exports[_0x3181('0x8a')]=function(_0x367802,_0x4ed486,_0x2fbe00){var _0x521587={};var _0x396980={};var _0x548c57;var _0x191610;return db[_0x3181('0x2f')][_0x3181('0x55')]({'where':{'id':_0x367802['params']['id']}})['then'](handleEntityNotFound(_0x4ed486,null))[_0x3181('0x27')](function(_0x433975){if(_0x433975){_0x548c57=_0x433975;_0x396980[_0x3181('0x33')]=_[_0x3181('0x46')](db[_0x3181('0x68')][_0x3181('0x47')]);_0x396980[_0x3181('0x35')]=_[_0x3181('0x46')](_0x367802[_0x3181('0x35')]);_0x396980['filters']=_[_0x3181('0x37')](_0x396980[_0x3181('0x33')],_0x396980['query']);_0x521587[_0x3181('0x38')]=_[_0x3181('0x37')](_0x396980[_0x3181('0x33')],qs[_0x3181('0x39')](_0x367802[_0x3181('0x35')]['fields']));_0x521587[_0x3181('0x38')]=_0x521587[_0x3181('0x38')][_0x3181('0x3a')]?_0x521587[_0x3181('0x38')]:_0x396980[_0x3181('0x33')];_0x521587[_0x3181('0x64')]=qs['sort'](_0x367802['query'][_0x3181('0x3c')]);_0x521587[_0x3181('0x3d')]=qs[_0x3181('0x36')](_[_0x3181('0x3e')](_0x367802[_0x3181('0x35')],_0x396980[_0x3181('0x36')]));if(_0x367802[_0x3181('0x35')]['filter']){_0x521587['where']=_[_0x3181('0x40')](_0x521587[_0x3181('0x3d')],{'$or':_[_0x3181('0x34')](_0x521587['attributes'],function(_0x317d7f){var _0x330d32={};_0x330d32[_0x317d7f]={'$like':'%'+_0x367802[_0x3181('0x35')][_0x3181('0x3f')]+'%'};return _0x330d32;})});}_0x521587=_[_0x3181('0x40')]({},_0x521587,_0x367802[_0x3181('0x41')]);return _0x548c57[_0x3181('0x8a')](_0x521587);}})[_0x3181('0x27')](function(_0x548163){if(_0x548163){_0x191610=_0x548163[_0x3181('0x3a')];if(!_0x367802[_0x3181('0x35')]['hasOwnProperty'](_0x3181('0x65'))){_0x521587[_0x3181('0x21')]=qs[_0x3181('0x21')](_0x367802[_0x3181('0x35')][_0x3181('0x21')]);_0x521587[_0x3181('0x1f')]=qs[_0x3181('0x1f')](_0x367802[_0x3181('0x35')][_0x3181('0x1f')]);}return _0x548c57[_0x3181('0x8a')](_0x521587);}})[_0x3181('0x27')](function(_0x43d97b){if(_0x43d97b){return _0x43d97b?{'count':_0x191610,'rows':_0x43d97b}:null;}})['then'](respondWithResult(_0x4ed486,null))['catch'](handleError(_0x4ed486,null));}; \ No newline at end of file +var _0x2a21=['crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./openchannelQueue.socket','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','get','OpenchannelQueues','destroy','error','stack','name','send','map','OpenchannelQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','rows','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','order','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','userOpenchannelQueue:save','removeAgents','isArray','findOne','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0x14ca77,_0x2afb35){var _0x21561a=function(_0x8d0c89){while(--_0x8d0c89){_0x14ca77['push'](_0x14ca77['shift']());}};_0x21561a(++_0x2afb35);}(_0x2a21,0x7c));var _0x12a2=function(_0x480f6e,_0x2b03cc){_0x480f6e=_0x480f6e-0x0;var _0x3712d0=_0x2a21[_0x480f6e];return _0x3712d0;};'use strict';var emlformat=require(_0x12a2('0x0'));var rimraf=require(_0x12a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x12a2('0x2'));var rp=require(_0x12a2('0x3'));var moment=require(_0x12a2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x12a2('0x5'));var util=require(_0x12a2('0x6'));var path=require(_0x12a2('0x7'));var sox=require(_0x12a2('0x8'));var csv=require(_0x12a2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x12a2('0xa'));var _=require('lodash');var squel=require(_0x12a2('0xb'));var crypto=require(_0x12a2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x12a2('0xd'));var toCsv=require(_0x12a2('0x9'));var querystring=require('querystring');var Papa=require(_0x12a2('0xe'));var Redis=require(_0x12a2('0xf'));var authService=require(_0x12a2('0x10'));var qs=require(_0x12a2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12a2('0x12'));var logger=require(_0x12a2('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x12a2('0x14'));var licenseUtil=require(_0x12a2('0x15'));var db=require(_0x12a2('0x16'))['db'];config[_0x12a2('0x17')]=_[_0x12a2('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12a2('0x17')]));require(_0x12a2('0x19'))['register'](socket);function respondWithStatusCode(_0x228f4f,_0x1b299d){_0x1b299d=_0x1b299d||0xcc;return function(_0x1a6b7e){if(_0x1a6b7e){return _0x228f4f[_0x12a2('0x1a')](_0x1b299d);}return _0x228f4f[_0x12a2('0x1b')](_0x1b299d)[_0x12a2('0x1c')]();};}function respondWithResult(_0x4c3772,_0x495b24){_0x495b24=_0x495b24||0xc8;return function(_0x588495){if(_0x588495){return _0x4c3772[_0x12a2('0x1b')](_0x495b24)[_0x12a2('0x1d')](_0x588495);}};}function respondWithFilteredResult(_0x5245a1,_0x7a75c0){return function(_0x469e30){if(_0x469e30){var _0x2ed472=typeof _0x7a75c0['offset']===_0x12a2('0x1e')&&typeof _0x7a75c0[_0x12a2('0x1f')]==='undefined';var _0x66c9c7=_0x469e30['count'];var _0x54e52e=_0x2ed472?0x0:_0x7a75c0[_0x12a2('0x20')];var _0x1a6a72=_0x2ed472?_0x469e30[_0x12a2('0x21')]:_0x7a75c0[_0x12a2('0x20')]+_0x7a75c0[_0x12a2('0x1f')];var _0x50abeb;if(_0x1a6a72>=_0x66c9c7){_0x1a6a72=_0x66c9c7;_0x50abeb=0xc8;}else{_0x50abeb=0xce;}_0x5245a1[_0x12a2('0x1b')](_0x50abeb);return _0x5245a1[_0x12a2('0x22')](_0x12a2('0x23'),_0x54e52e+'-'+_0x1a6a72+'/'+_0x66c9c7)[_0x12a2('0x1d')](_0x469e30);}return null;};}function patchUpdates(_0x39fae5){return function(_0x5ac81e){try{jsonpatch[_0x12a2('0x24')](_0x5ac81e,_0x39fae5,!![]);}catch(_0x1441ef){return BPromise[_0x12a2('0x25')](_0x1441ef);}return _0x5ac81e['save']();};}function saveUpdates(_0x1a4d4e,_0x4c3f3c){return function(_0x1aafb6){if(_0x1aafb6){return _0x1aafb6[_0x12a2('0x26')](_0x1a4d4e)['then'](function(_0x532a45){return _0x532a45;});}return null;};}function removeEntity(_0x54ad09,_0x3906bf){return function(_0x3a30a4){if(_0x3a30a4){return _0x3a30a4['destroy']()[_0x12a2('0x27')](function(){var _0x39107d=_0x3a30a4[_0x12a2('0x28')]({'plain':!![]});var _0x5cce94=_0x12a2('0x29');return db['UserProfileResource'][_0x12a2('0x2a')]({'where':{'type':_0x5cce94,'resourceId':_0x39107d['id']}})[_0x12a2('0x27')](function(){return _0x3a30a4;});})[_0x12a2('0x27')](function(){_0x54ad09[_0x12a2('0x1b')](0xcc)[_0x12a2('0x1c')]();});}};}function handleEntityNotFound(_0x1a2ae2,_0x5889e1){return function(_0x4e5604){if(!_0x4e5604){_0x1a2ae2[_0x12a2('0x1a')](0x194);}return _0x4e5604;};}function handleError(_0x54b978,_0x20a56c){_0x20a56c=_0x20a56c||0x1f4;return function(_0x22bc74){logger[_0x12a2('0x2b')](_0x22bc74[_0x12a2('0x2c')]);if(_0x22bc74['name']){delete _0x22bc74[_0x12a2('0x2d')];}_0x54b978['status'](_0x20a56c)[_0x12a2('0x2e')](_0x22bc74);};}exports['index']=function(_0x1f5cbe,_0x197c3c){var _0x525e91={},_0x6c21f0={},_0x33f53d={'count':0x0,'rows':[]};var _0x2fe6a2=_[_0x12a2('0x2f')](db[_0x12a2('0x30')][_0x12a2('0x31')],function(_0x115a97){return{'name':_0x115a97[_0x12a2('0x32')],'type':_0x115a97['type'][_0x12a2('0x33')]};});_0x6c21f0[_0x12a2('0x34')]=_[_0x12a2('0x2f')](_0x2fe6a2,'name');_0x6c21f0[_0x12a2('0x35')]=_[_0x12a2('0x36')](_0x1f5cbe['query']);_0x6c21f0[_0x12a2('0x37')]=_[_0x12a2('0x38')](_0x6c21f0[_0x12a2('0x34')],_0x6c21f0[_0x12a2('0x35')]);_0x525e91[_0x12a2('0x39')]=_[_0x12a2('0x38')](_0x6c21f0[_0x12a2('0x34')],qs[_0x12a2('0x3a')](_0x1f5cbe[_0x12a2('0x35')]['fields']));_0x525e91[_0x12a2('0x39')]=_0x525e91[_0x12a2('0x39')][_0x12a2('0x3b')]?_0x525e91['attributes']:_0x6c21f0['model'];if(!_0x1f5cbe[_0x12a2('0x35')][_0x12a2('0x3c')](_0x12a2('0x3d'))){_0x525e91[_0x12a2('0x1f')]=qs[_0x12a2('0x1f')](_0x1f5cbe[_0x12a2('0x35')][_0x12a2('0x1f')]);_0x525e91[_0x12a2('0x20')]=qs[_0x12a2('0x20')](_0x1f5cbe[_0x12a2('0x35')][_0x12a2('0x20')]);}_0x525e91['order']=qs[_0x12a2('0x3e')](_0x1f5cbe[_0x12a2('0x35')]['sort']);_0x525e91[_0x12a2('0x3f')]=qs['filters'](_[_0x12a2('0x40')](_0x1f5cbe['query'],_0x6c21f0[_0x12a2('0x37')]),_0x2fe6a2);if(_0x1f5cbe[_0x12a2('0x35')][_0x12a2('0x41')]){_0x525e91[_0x12a2('0x3f')]=_[_0x12a2('0x42')](_0x525e91[_0x12a2('0x3f')],{'$or':_[_0x12a2('0x2f')](_0x2fe6a2,function(_0x47aa2b){if(_0x47aa2b[_0x12a2('0x43')]!==_0x12a2('0x44')){var _0x58907e={};_0x58907e[_0x47aa2b[_0x12a2('0x2d')]]={'$like':'%'+_0x1f5cbe[_0x12a2('0x35')]['filter']+'%'};return _0x58907e;}})});}_0x525e91=_[_0x12a2('0x42')]({},_0x525e91,_0x1f5cbe[_0x12a2('0x45')]);var _0x8358de={'where':_0x525e91['where']};return db[_0x12a2('0x30')][_0x12a2('0x21')](_0x8358de)[_0x12a2('0x27')](function(_0x523f8a){_0x33f53d[_0x12a2('0x21')]=_0x523f8a;if(_0x1f5cbe[_0x12a2('0x35')]['includeAll']){_0x525e91['include']=[{'all':!![]}];}return db[_0x12a2('0x30')]['findAll'](_0x525e91);})[_0x12a2('0x27')](function(_0x28cd51){_0x33f53d[_0x12a2('0x46')]=_0x28cd51;return _0x33f53d;})['then'](respondWithFilteredResult(_0x197c3c,_0x525e91))[_0x12a2('0x47')](handleError(_0x197c3c,null));};exports['show']=function(_0x648c0,_0x51a843){var _0x31471c={'raw':!![],'where':{'id':_0x648c0[_0x12a2('0x48')]['id']}},_0xb9eace={};_0xb9eace[_0x12a2('0x34')]=_[_0x12a2('0x36')](db[_0x12a2('0x30')][_0x12a2('0x31')]);_0xb9eace[_0x12a2('0x35')]=_[_0x12a2('0x36')](_0x648c0['query']);_0xb9eace[_0x12a2('0x37')]=_[_0x12a2('0x38')](_0xb9eace[_0x12a2('0x34')],_0xb9eace[_0x12a2('0x35')]);_0x31471c['attributes']=_[_0x12a2('0x38')](_0xb9eace[_0x12a2('0x34')],qs[_0x12a2('0x3a')](_0x648c0[_0x12a2('0x35')][_0x12a2('0x3a')]));_0x31471c[_0x12a2('0x39')]=_0x31471c[_0x12a2('0x39')][_0x12a2('0x3b')]?_0x31471c['attributes']:_0xb9eace[_0x12a2('0x34')];if(_0x648c0[_0x12a2('0x35')]['includeAll']){_0x31471c[_0x12a2('0x49')]=[{'all':!![]}];}_0x31471c=_[_0x12a2('0x42')]({},_0x31471c,_0x648c0[_0x12a2('0x45')]);return db[_0x12a2('0x30')][_0x12a2('0x4a')](_0x31471c)[_0x12a2('0x27')](handleEntityNotFound(_0x51a843,null))[_0x12a2('0x27')](respondWithResult(_0x51a843,null))['catch'](handleError(_0x51a843,null));};exports[_0x12a2('0x4b')]=function(_0x72b3fe,_0x49f00d){return db[_0x12a2('0x30')][_0x12a2('0x4b')](_0x72b3fe[_0x12a2('0x4c')],{})[_0x12a2('0x27')](function(_0x152d04){var _0x4ceef2=_0x72b3fe[_0x12a2('0x4d')]['get']({'plain':!![]});if(!_0x4ceef2)throw new Error(_0x12a2('0x4e'));if(_0x4ceef2[_0x12a2('0x4f')]===_0x12a2('0x4d')){var _0x5bbc72=_0x152d04[_0x12a2('0x28')]({'plain':!![]});var _0x4c78cd=_0x12a2('0x29');return db['UserProfileSection'][_0x12a2('0x4a')]({'where':{'name':_0x4c78cd,'userProfileId':_0x4ceef2[_0x12a2('0x50')]},'raw':!![]})[_0x12a2('0x27')](function(_0x4aa0b0){if(_0x4aa0b0&&_0x4aa0b0[_0x12a2('0x51')]===0x0){return db['UserProfileResource'][_0x12a2('0x4b')]({'name':_0x5bbc72[_0x12a2('0x2d')],'resourceId':_0x5bbc72['id'],'type':_0x4aa0b0[_0x12a2('0x2d')],'sectionId':_0x4aa0b0['id']},{})['then'](function(){return _0x152d04;});}else{return _0x152d04;}})['catch'](function(_0x36dd38){logger[_0x12a2('0x2b')](_0x12a2('0x52'),_0x36dd38);throw _0x36dd38;});}return _0x152d04;})[_0x12a2('0x27')](respondWithResult(_0x49f00d,0xc9))[_0x12a2('0x47')](handleError(_0x49f00d,null));};exports[_0x12a2('0x26')]=function(_0x2fde58,_0x1089b9){if(_0x2fde58['body']['id']){delete _0x2fde58['body']['id'];}return db[_0x12a2('0x30')][_0x12a2('0x4a')]({'where':{'id':_0x2fde58[_0x12a2('0x48')]['id']}})['then'](handleEntityNotFound(_0x1089b9,null))[_0x12a2('0x27')](saveUpdates(_0x2fde58[_0x12a2('0x4c')],null))[_0x12a2('0x27')](respondWithResult(_0x1089b9,null))[_0x12a2('0x47')](handleError(_0x1089b9,null));};exports[_0x12a2('0x2a')]=function(_0x3f0443,_0x181740){return db[_0x12a2('0x30')][_0x12a2('0x4a')]({'where':{'id':_0x3f0443[_0x12a2('0x48')]['id']}})[_0x12a2('0x27')](handleEntityNotFound(_0x181740,null))[_0x12a2('0x27')](removeEntity(_0x181740,null))['catch'](handleError(_0x181740,null));};exports[_0x12a2('0x53')]=function(_0x35d5f8,_0x4cc0bd){return db[_0x12a2('0x30')]['describe']()[_0x12a2('0x27')](respondWithResult(_0x4cc0bd,null))[_0x12a2('0x47')](handleError(_0x4cc0bd,null));};exports[_0x12a2('0x54')]=function(_0x5351a8,_0x3fbc8e,_0x3721f1){var _0x220405={'raw':!![],'where':{}},_0x17ea56={},_0x93d4d5;return db[_0x12a2('0x30')]['findOne']({'where':{'id':_0x5351a8['params']['id']}})[_0x12a2('0x27')](handleEntityNotFound(_0x3fbc8e,null))['then'](function(_0x4219c6){if(_0x4219c6){_0x93d4d5=_0x4219c6[_0x12a2('0x28')]({'plain':!![]});_0x17ea56[_0x12a2('0x34')]=_[_0x12a2('0x36')](db[_0x12a2('0x55')]['rawAttributes']);_0x17ea56[_0x12a2('0x35')]=_['keys'](_0x5351a8[_0x12a2('0x35')]);_0x17ea56[_0x12a2('0x37')]=_['intersection'](_0x17ea56[_0x12a2('0x34')],_0x17ea56[_0x12a2('0x35')]);_0x220405[_0x12a2('0x39')]=_[_0x12a2('0x38')](_0x17ea56[_0x12a2('0x34')],qs[_0x12a2('0x3a')](_0x5351a8[_0x12a2('0x35')][_0x12a2('0x3a')]));_0x220405[_0x12a2('0x39')]=_0x220405[_0x12a2('0x39')]['length']?_0x220405[_0x12a2('0x39')]:_0x17ea56[_0x12a2('0x34')];if(!_0x5351a8[_0x12a2('0x35')][_0x12a2('0x3c')]('nolimit')){_0x220405[_0x12a2('0x1f')]=qs['limit'](_0x5351a8[_0x12a2('0x35')][_0x12a2('0x1f')]);_0x220405[_0x12a2('0x20')]=qs[_0x12a2('0x20')](_0x5351a8[_0x12a2('0x35')][_0x12a2('0x20')]);}_0x220405[_0x12a2('0x56')]=qs[_0x12a2('0x3e')](_0x5351a8[_0x12a2('0x35')][_0x12a2('0x3e')]);_0x220405[_0x12a2('0x3f')]=qs[_0x12a2('0x37')](_[_0x12a2('0x40')](_0x5351a8[_0x12a2('0x35')],_0x17ea56[_0x12a2('0x37')]));_0x220405[_0x12a2('0x3f')]['OpenchannelQueueId']=_0x4219c6['id'];if(_0x5351a8[_0x12a2('0x35')]['filter']){_0x220405[_0x12a2('0x3f')]=_[_0x12a2('0x42')](_0x220405[_0x12a2('0x3f')],{'$or':_[_0x12a2('0x2f')](_0x220405[_0x12a2('0x39')],function(_0x4ef68e){var _0x28dab5={};_0x28dab5[_0x4ef68e]={'$like':'%'+_0x5351a8[_0x12a2('0x35')][_0x12a2('0x41')]+'%'};return _0x28dab5;})});}_0x220405=_[_0x12a2('0x42')]({},_0x220405,_0x5351a8[_0x12a2('0x45')]);return db[_0x12a2('0x55')]['findAll'](_0x220405);}})[_0x12a2('0x27')](function(_0x1a8ebd){if(_0x1a8ebd){return db[_0x12a2('0x57')][_0x12a2('0x58')]({'where':{'id':_['map'](_0x1a8ebd,_0x12a2('0x59')),'role':'agent'},'attributes':['id',_0x12a2('0x2d'),_0x12a2('0x5a'),_0x12a2('0x5b'),_0x12a2('0x5c')]});}})[_0x12a2('0x27')](function(_0x5a0803){if(_0x5a0803){return{'count':_0x5a0803[_0x12a2('0x21')],'rows':_[_0x12a2('0x2f')](_0x5a0803['rows'],function(_0x50be6b){return{'membername':_0x50be6b[_0x12a2('0x2d')],'UserId':_0x50be6b['id'],'queue_name':_0x93d4d5[_0x12a2('0x2d')],'OpenchannelQueueId':_0x93d4d5['id'],'interface':util['format']('%s/%s',_0x12a2('0x5d'),_0x50be6b[_0x12a2('0x2d')]),'penalty':0x0,'paused':_0x50be6b[_0x12a2('0x5a')],'createdAt':_0x50be6b[_0x12a2('0x5c')],'updatedAt':_0x50be6b[_0x12a2('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3fbc8e,_0x220405))[_0x12a2('0x47')](handleError(_0x3fbc8e,null));};exports[_0x12a2('0x5e')]=function(_0x48d2e1,_0x5410ff,_0x1c1267){var _0x43a429={};var _0x436333={};var _0x4e7f69;var _0x1facd0;return db[_0x12a2('0x30')]['findOne']({'where':{'id':_0x48d2e1[_0x12a2('0x48')]['id']}})[_0x12a2('0x27')](handleEntityNotFound(_0x5410ff,null))[_0x12a2('0x27')](function(_0x284cc5){if(_0x284cc5){_0x4e7f69=_0x284cc5;_0x436333[_0x12a2('0x34')]=_[_0x12a2('0x36')](db[_0x12a2('0x5f')]['rawAttributes']);_0x436333['query']=_['keys'](_0x48d2e1[_0x12a2('0x35')]);_0x436333[_0x12a2('0x37')]=_[_0x12a2('0x38')](_0x436333['model'],_0x436333['query']);_0x43a429[_0x12a2('0x39')]=_[_0x12a2('0x38')](_0x436333['model'],qs[_0x12a2('0x3a')](_0x48d2e1['query'][_0x12a2('0x3a')]));_0x43a429[_0x12a2('0x39')]=_0x43a429['attributes'][_0x12a2('0x3b')]?_0x43a429[_0x12a2('0x39')]:_0x436333['model'];_0x43a429[_0x12a2('0x56')]=qs['sort'](_0x48d2e1[_0x12a2('0x35')][_0x12a2('0x3e')]);_0x43a429[_0x12a2('0x3f')]=qs[_0x12a2('0x37')](_[_0x12a2('0x40')](_0x48d2e1['query'],_0x436333[_0x12a2('0x37')]));if(_0x48d2e1[_0x12a2('0x35')][_0x12a2('0x41')]){_0x43a429[_0x12a2('0x3f')]=_[_0x12a2('0x42')](_0x43a429[_0x12a2('0x3f')],{'$or':_[_0x12a2('0x2f')](_0x43a429[_0x12a2('0x39')],function(_0x3f52c8){var _0x506af8={};_0x506af8[_0x3f52c8]={'$like':'%'+_0x48d2e1[_0x12a2('0x35')][_0x12a2('0x41')]+'%'};return _0x506af8;})});}_0x43a429=_[_0x12a2('0x42')]({},_0x43a429,_0x48d2e1['options']);return _0x4e7f69[_0x12a2('0x5e')](_0x43a429);}})[_0x12a2('0x27')](function(_0x5a21e2){if(_0x5a21e2){_0x1facd0=_0x5a21e2['length'];if(!_0x48d2e1[_0x12a2('0x35')]['hasOwnProperty'](_0x12a2('0x3d'))){_0x43a429[_0x12a2('0x1f')]=qs[_0x12a2('0x1f')](_0x48d2e1[_0x12a2('0x35')][_0x12a2('0x1f')]);_0x43a429[_0x12a2('0x20')]=qs[_0x12a2('0x20')](_0x48d2e1['query'][_0x12a2('0x20')]);}return _0x4e7f69[_0x12a2('0x5e')](_0x43a429);}})[_0x12a2('0x27')](function(_0x12dc1b){if(_0x12dc1b){return _0x12dc1b?{'count':_0x1facd0,'rows':_0x12dc1b}:null;}})[_0x12a2('0x27')](respondWithResult(_0x5410ff,null))[_0x12a2('0x47')](handleError(_0x5410ff,null));};exports[_0x12a2('0x60')]=function(_0x5b4d16,_0x240fff,_0x4af1b8){var _0x5f3561=_0x5b4d16['body'][_0x12a2('0x61')];return db[_0x12a2('0x5f')][_0x12a2('0x62')]({'where':{'id':_0x5f3561},'attributes':['id'],'include':[{'model':db[_0x12a2('0x57')],'as':_0x12a2('0x63'),'attributes':['id','name',_0x12a2('0x64'),_0x12a2('0x65'),_0x12a2('0x66')],'raw':!![]}]})[_0x12a2('0x27')](function(_0x4f62d4){if(_0x4f62d4){var _0x17faf7=_[_0x12a2('0x67')](_0x4f62d4,function(_0x184d65){var _0x3556a6=_0x184d65[_0x12a2('0x28')]({'plain':!![]});return _0x3556a6[_0x12a2('0x63')];});return db[_0x12a2('0x30')][_0x12a2('0x4a')]({'where':{'id':_0x5b4d16[_0x12a2('0x48')]['id']}})[_0x12a2('0x27')](function(_0x49ae12){return db[_0x12a2('0x68')][_0x12a2('0x69')](function(_0x59be07){return _0x49ae12[_0x12a2('0x60')](_0x5f3561,{'transaction':_0x59be07})[_0x12a2('0x27')](function(){return BPromise[_0x12a2('0x6a')](_0x17faf7,function(_0x2d824a){return db['UserOpenchannelQueue'][_0x12a2('0x6b')]({'where':{'UserId':_0x2d824a['id'],'OpenchannelQueueId':_0x5b4d16[_0x12a2('0x48')]['id']},'transaction':_0x59be07});});})[_0x12a2('0x27')](function(){_0x17faf7['forEach'](function(_0x92ee54){socket[_0x12a2('0x6c')]('userOpenchannelQueue:save',{'UserId':_0x92ee54['id'],'OpenchannelQueueId':_0x49ae12['id']});});});});});}})[_0x12a2('0x27')](respondWithStatusCode(_0x240fff,null))['catch'](handleError(_0x240fff,null));};exports[_0x12a2('0x6d')]=function(_0x1c3adf,_0x29d9d7,_0xb7e727){return db[_0x12a2('0x5f')][_0x12a2('0x62')]({'where':{'id':_0x1c3adf[_0x12a2('0x35')][_0x12a2('0x61')]},'attributes':['id'],'include':[{'model':db[_0x12a2('0x57')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x12a2('0x27')](handleEntityNotFound(_0x29d9d7,null))[_0x12a2('0x27')](function(_0x1d831d){var _0x4ee88c=_[_0x12a2('0x2f')](_0x1d831d,'id');var _0x44481a=[];var _0x2f3499=[];var _0x1612d2=squel[_0x12a2('0x6e')]();_0x1612d2[_0x12a2('0x6f')](_0x12a2('0x70'))[_0x12a2('0x71')]('team_has_openchannel_queues','tq')[_0x12a2('0x72')](_0x12a2('0x73'),'ut',_0x12a2('0x74'))[_0x12a2('0x3f')]('OpenchannelQueueId\x20=\x20?',_0x1c3adf[_0x12a2('0x48')]['id']);for(var _0x3b5e39=0x0;_0x3b5e39<_0x1d831d[_0x12a2('0x3b')];_0x3b5e39+=0x1){let _0x5bdadc=_0x1d831d[_0x3b5e39];for(var _0x5b6039=0x0;_0x5b6039<_0x5bdadc['Agents'][_0x12a2('0x3b')];_0x5b6039+=0x1){let _0x261503=_0x5bdadc[_0x12a2('0x63')][_0x5b6039];var _0x30f410=_0x1612d2[_0x12a2('0x75')]();_0x30f410[_0x12a2('0x3f')](_0x12a2('0x76'),_0x261503['id']);_0x2f3499[_0x12a2('0x77')](db[_0x12a2('0x68')]['query'](_0x30f410['toString'](),{'type':db[_0x12a2('0x68')][_0x12a2('0x78')][_0x12a2('0x79')]})[_0x12a2('0x27')](function(_0x59c882){if(_0x59c882['length']===0x1){return _0x261503['id'];}else{var _0x22303b=_['every'](_[_0x12a2('0x2f')](_0x59c882,_0x12a2('0x7a')),function(_0x4f2ab7){return _[_0x12a2('0x7b')](_0x4ee88c,_0x4f2ab7);});if(_0x22303b){return _0x261503['id'];}}}));}}return BPromise[_0x12a2('0x7c')](_0x2f3499)[_0x12a2('0x27')](function(_0x315286){_0x44481a=_(_0x44481a)['union'](_0x315286)[_0x12a2('0x7d')]()[_0x12a2('0x7e')]();return db[_0x12a2('0x30')][_0x12a2('0x4a')]({'where':{'id':_0x1c3adf[_0x12a2('0x48')]['id']}})[_0x12a2('0x27')](function(_0x3e8f27){return db[_0x12a2('0x68')][_0x12a2('0x69')](function(_0x1f1271){return _0x3e8f27['removeTeams'](_0x1c3adf[_0x12a2('0x35')][_0x12a2('0x61')],{'transaction':_0x1f1271})[_0x12a2('0x27')](function(){if(!_[_0x12a2('0x7f')](_0x44481a)){return _0x3e8f27['removeAgents'](_0x44481a,{'transaction':_0x1f1271});}})['then'](function(){_0x44481a['forEach'](function(_0x586f40){socket[_0x12a2('0x6c')](_0x12a2('0x80'),{'UserId':_0x586f40,'OpenchannelQueueId':_0x3e8f27['id']});});});});});});})[_0x12a2('0x27')](respondWithStatusCode(_0x29d9d7,null))[_0x12a2('0x47')](handleError(_0x29d9d7,null));};exports[_0x12a2('0x81')]=function(_0x43ea50,_0x50e0c8,_0x409436){return db[_0x12a2('0x30')]['find']({'where':{'id':_0x43ea50[_0x12a2('0x48')]['id']}})[_0x12a2('0x27')](handleEntityNotFound(_0x50e0c8,null))[_0x12a2('0x27')](function(_0x9f8340){if(_0x9f8340){return _0x9f8340[_0x12a2('0x81')](_0x43ea50[_0x12a2('0x4c')][_0x12a2('0x61')],_[_0x12a2('0x82')](_0x43ea50[_0x12a2('0x4c')],['ids','id'])||{})['spread'](function(_0x29146d){for(var _0x57442d=0x0;_0x57442d<_0x43ea50['body'][_0x12a2('0x61')][_0x12a2('0x3b')];_0x57442d+=0x1){socket[_0x12a2('0x6c')](_0x12a2('0x83'),{'UserId':Number(_0x43ea50[_0x12a2('0x4c')]['ids'][_0x57442d]),'OpenchannelQueueId':Number(_0x43ea50[_0x12a2('0x48')]['id'])});}return _0x29146d;});}})[_0x12a2('0x27')](respondWithResult(_0x50e0c8,null))[_0x12a2('0x47')](handleError(_0x50e0c8,null));};exports[_0x12a2('0x84')]=function(_0xefaa1b,_0xe5ce6c,_0x6fc389){return db['OpenchannelQueue'][_0x12a2('0x4a')]({'where':{'id':_0xefaa1b[_0x12a2('0x48')]['id']}})[_0x12a2('0x27')](handleEntityNotFound(_0xe5ce6c,null))['then'](function(_0x138df4){if(_0x138df4){return _0x138df4['removeAgents'](_0xefaa1b[_0x12a2('0x35')][_0x12a2('0x61')])[_0x12a2('0x27')](function(){if(_[_0x12a2('0x85')](_0xefaa1b[_0x12a2('0x35')][_0x12a2('0x61')])){for(var _0x5c2b7e=0x0;_0x5c2b7e<_0xefaa1b[_0x12a2('0x35')][_0x12a2('0x61')]['length'];_0x5c2b7e+=0x1){socket[_0x12a2('0x6c')](_0x12a2('0x80'),{'UserId':Number(_0xefaa1b[_0x12a2('0x35')][_0x12a2('0x61')][_0x5c2b7e]),'OpenchannelQueueId':Number(_0xefaa1b[_0x12a2('0x48')]['id'])});}}else{socket[_0x12a2('0x6c')]('userOpenchannelQueue:remove',{'UserId':Number(_0xefaa1b[_0x12a2('0x35')][_0x12a2('0x61')]),'OpenchannelQueueId':Number(_0xefaa1b['params']['id'])});}});}})[_0x12a2('0x27')](respondWithStatusCode(_0xe5ce6c,null))[_0x12a2('0x47')](handleError(_0xe5ce6c,null));};exports['getAgents']=function(_0x13de4d,_0x1d6869,_0x328412){var _0x986a2={};var _0x2def35={};var _0x2d3270;var _0x2222e0;return db[_0x12a2('0x30')][_0x12a2('0x86')]({'where':{'id':_0x13de4d['params']['id']}})[_0x12a2('0x27')](handleEntityNotFound(_0x1d6869,null))[_0x12a2('0x27')](function(_0x2d0fe4){if(_0x2d0fe4){_0x2d3270=_0x2d0fe4;_0x2def35[_0x12a2('0x34')]=_[_0x12a2('0x36')](db[_0x12a2('0x57')]['rawAttributes']);_0x2def35[_0x12a2('0x35')]=_[_0x12a2('0x36')](_0x13de4d[_0x12a2('0x35')]);_0x2def35[_0x12a2('0x37')]=_[_0x12a2('0x38')](_0x2def35[_0x12a2('0x34')],_0x2def35[_0x12a2('0x35')]);_0x986a2[_0x12a2('0x39')]=_[_0x12a2('0x38')](_0x2def35['model'],qs[_0x12a2('0x3a')](_0x13de4d['query'][_0x12a2('0x3a')]));_0x986a2['attributes']=_0x986a2[_0x12a2('0x39')]['length']?_0x986a2[_0x12a2('0x39')]:_0x2def35[_0x12a2('0x34')];_0x986a2[_0x12a2('0x56')]=qs[_0x12a2('0x3e')](_0x13de4d[_0x12a2('0x35')][_0x12a2('0x3e')]);_0x986a2['where']=qs[_0x12a2('0x37')](_[_0x12a2('0x40')](_0x13de4d['query'],_0x2def35[_0x12a2('0x37')]));if(_0x13de4d[_0x12a2('0x35')][_0x12a2('0x41')]){_0x986a2[_0x12a2('0x3f')]=_[_0x12a2('0x42')](_0x986a2[_0x12a2('0x3f')],{'$or':_['map'](_0x986a2[_0x12a2('0x39')],function(_0xeac52a){var _0x142176={};_0x142176[_0xeac52a]={'$like':'%'+_0x13de4d[_0x12a2('0x35')][_0x12a2('0x41')]+'%'};return _0x142176;})});}_0x986a2=_['merge']({},_0x986a2,_0x13de4d[_0x12a2('0x45')]);return _0x2d3270[_0x12a2('0x87')](_0x986a2);}})['then'](function(_0x95ffa){if(_0x95ffa){_0x2222e0=_0x95ffa[_0x12a2('0x3b')];if(!_0x13de4d[_0x12a2('0x35')]['hasOwnProperty'](_0x12a2('0x3d'))){_0x986a2[_0x12a2('0x1f')]=qs[_0x12a2('0x1f')](_0x13de4d[_0x12a2('0x35')][_0x12a2('0x1f')]);_0x986a2['offset']=qs[_0x12a2('0x20')](_0x13de4d[_0x12a2('0x35')][_0x12a2('0x20')]);}return _0x2d3270['getAgents'](_0x986a2);}})[_0x12a2('0x27')](function(_0x5a5f0e){if(_0x5a5f0e){return _0x5a5f0e?{'count':_0x2222e0,'rows':_0x5a5f0e}:null;}})[_0x12a2('0x27')](respondWithResult(_0x1d6869,null))[_0x12a2('0x47')](handleError(_0x1d6869,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index ddc16a0..ce7cacd 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 _0x34c7=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x28f19d,_0x33bb1e){var _0x504a5e=function(_0x54c808){while(--_0x54c808){_0x28f19d['push'](_0x28f19d['shift']());}};_0x504a5e(++_0x33bb1e);}(_0x34c7,0xaa));var _0x734c=function(_0x3236b6,_0x290141){_0x3236b6=_0x3236b6-0x0;var _0x13f66c=_0x34c7[_0x3236b6];return _0x13f66c;};'use strict';var EventEmitter=require(_0x734c('0x0'));var OpenchannelQueue=require(_0x734c('0x1'))['db'][_0x734c('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x734c('0x3')](0x0);var events={'afterCreate':_0x734c('0x4'),'afterUpdate':_0x734c('0x5'),'afterDestroy':_0x734c('0x6')};function emitEvent(_0x199071){return function(_0x258c6c,_0x358979,_0x315c75){OpenchannelQueueEvents['emit'](_0x199071+':'+_0x258c6c['id'],_0x258c6c);OpenchannelQueueEvents['emit'](_0x199071,_0x258c6c);_0x315c75(null);};}for(var e in events){if(events[_0x734c('0x7')](e)){var event=events[e];OpenchannelQueue[_0x734c('0x8')](e,emitEvent(event));}}module[_0x734c('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xa0ac=['hasOwnProperty','hook','events','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa0ac,0xad));var _0xca0a=function(_0x3c528c,_0x213fab){_0x3c528c=_0x3c528c-0x0;var _0x218e13=_0xa0ac[_0x3c528c];return _0x218e13;};'use strict';var EventEmitter=require(_0xca0a('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xca0a('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xca0a('0x2')](0x0);var events={'afterCreate':_0xca0a('0x3'),'afterUpdate':_0xca0a('0x4'),'afterDestroy':_0xca0a('0x5')};function emitEvent(_0x52002e){return function(_0x58b08f,_0x51dcd8,_0x3c0d5a){OpenchannelQueueEvents[_0xca0a('0x6')](_0x52002e+':'+_0x58b08f['id'],_0x58b08f);OpenchannelQueueEvents[_0xca0a('0x6')](_0x52002e,_0x58b08f);_0x3c0d5a(null);};}for(var e in events){if(events[_0xca0a('0x7')](e)){var event=events[e];OpenchannelQueue[_0xca0a('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 08ad7ac..bea266a 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 _0xce57=['rimraf','../../config/environment','define','OpenchannelQueue','openchannel_queues','lodash','util','moment','bluebird','request-promise','path'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xce57,0x89));var _0x7ce5=function(_0x4e0a03,_0x5eb6b0){_0x4e0a03=_0x4e0a03-0x0;var _0x2478fc=_0xce57[_0x4e0a03];return _0x2478fc;};'use strict';var _=require(_0x7ce5('0x0'));var util=require(_0x7ce5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7ce5('0x2'));var BPromise=require(_0x7ce5('0x3'));var rp=require(_0x7ce5('0x4'));var fs=require('fs');var path=require(_0x7ce5('0x5'));var rimraf=require(_0x7ce5('0x6'));var config=require(_0x7ce5('0x7'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x378fb1,_0x134fbc){return _0x378fb1[_0x7ce5('0x8')](_0x7ce5('0x9'),attributes,{'tableName':_0x7ce5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8446=['request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x55db00,_0x5c13d5){var _0x469358=function(_0x33ba88){while(--_0x33ba88){_0x55db00['push'](_0x55db00['shift']());}};_0x469358(++_0x5c13d5);}(_0x8446,0x108));var _0x6844=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0x8446[_0x5756c6];return _0x4b5806;};'use strict';var _=require(_0x6844('0x0'));var util=require(_0x6844('0x1'));var logger=require(_0x6844('0x2'))(_0x6844('0x3'));var moment=require(_0x6844('0x4'));var BPromise=require(_0x6844('0x5'));var rp=require(_0x6844('0x6'));var fs=require('fs');var path=require(_0x6844('0x7'));var rimraf=require(_0x6844('0x8'));var config=require(_0x6844('0x9'));var attributes=require(_0x6844('0xa'));module[_0x6844('0xb')]=function(_0x400a64,_0x2cf981){return _0x400a64[_0x6844('0xc')](_0x6844('0xd'),attributes,{'tableName':_0x6844('0xe'),'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 ac7e1a2..2521946 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 _0xc8b2=['http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','attributes','model','ShowOpenchannelQueue','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5e310f,_0x4a8fd6){var _0x10504d=function(_0x1d96e2){while(--_0x1d96e2){_0x5e310f['push'](_0x5e310f['shift']());}};_0x10504d(++_0x4a8fd6);}(_0xc8b2,0xa1));var _0x2c8b=function(_0x2205a4,_0x1f0c31){_0x2205a4=_0x2205a4-0x0;var _0x473685=_0xc8b2[_0x2205a4];return _0x473685;};'use strict';var _=require(_0x2c8b('0x0'));var util=require(_0x2c8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2c8b('0x2'));var fs=require('fs');var Redis=require(_0x2c8b('0x3'));var db=require(_0x2c8b('0x4'))['db'];var utils=require(_0x2c8b('0x5'));var logger=require(_0x2c8b('0x6'))(_0x2c8b('0x7'));var config=require(_0x2c8b('0x8'));var jayson=require(_0x2c8b('0x9'));var client=jayson[_0x2c8b('0xa')][_0x2c8b('0xb')]({'port':0x232a});config[_0x2c8b('0xc')]=_[_0x2c8b('0xd')](config[_0x2c8b('0xc')],{'host':_0x2c8b('0xe'),'port':0x18eb});var socket=require(_0x2c8b('0xf'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x2c8b('0x10')](socket);function respondWithRpcPromise(_0x339439,_0x1edd54,_0x2d99a7){return new BPromise(function(_0x18848a,_0x1eaf48){return client[_0x2c8b('0x11')](_0x339439,_0x2d99a7)[_0x2c8b('0x12')](function(_0xe9c9a8){logger[_0x2c8b('0x13')](_0x2c8b('0x14'),_0x1edd54,_0x2c8b('0x15'));logger[_0x2c8b('0x16')](_0x2c8b('0x17'),_0x1edd54,'request\x20sent',JSON[_0x2c8b('0x18')](_0xe9c9a8));if(_0xe9c9a8[_0x2c8b('0x19')]){if(_0xe9c9a8[_0x2c8b('0x19')][_0x2c8b('0x1a')]===0x1f4){logger['error'](_0x2c8b('0x14'),_0x1edd54,_0xe9c9a8[_0x2c8b('0x19')]['message']);return _0x1eaf48(_0xe9c9a8[_0x2c8b('0x19')][_0x2c8b('0x1b')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x1edd54,_0xe9c9a8[_0x2c8b('0x19')]['message']);return _0x18848a(_0xe9c9a8[_0x2c8b('0x19')][_0x2c8b('0x1b')]);}else{logger[_0x2c8b('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x1edd54,_0x2c8b('0x15'));_0x18848a(_0xe9c9a8[_0x2c8b('0x1c')][_0x2c8b('0x1b')]);}})[_0x2c8b('0x1d')](function(_0x150465){logger[_0x2c8b('0x19')](_0x2c8b('0x14'),_0x1edd54,_0x150465);_0x1eaf48(_0x150465);});});}exports[_0x2c8b('0x1e')]=function(_0x2ed906){var _0x531db0=this;return new Promise(function(_0x5e20b2,_0xe85b48){return db[_0x2c8b('0x1f')][_0x2c8b('0x20')]({'raw':_0x2ed906[_0x2c8b('0x21')]?_0x2ed906[_0x2c8b('0x21')][_0x2c8b('0x22')]===undefined?!![]:![]:!![],'where':_0x2ed906[_0x2c8b('0x21')]?_0x2ed906['options'][_0x2c8b('0x23')]||null:null,'attributes':_0x2ed906[_0x2c8b('0x21')]?_0x2ed906[_0x2c8b('0x21')]['attributes']||null:null,'limit':_0x2ed906[_0x2c8b('0x21')]?_0x2ed906[_0x2c8b('0x21')][_0x2c8b('0x24')]||null:null,'include':_0x2ed906[_0x2c8b('0x21')]?_0x2ed906[_0x2c8b('0x21')][_0x2c8b('0x25')]?_[_0x2c8b('0x26')](_0x2ed906['options'][_0x2c8b('0x25')],function(_0x5b2f61){return{'model':db[_0x5b2f61['model']],'as':_0x5b2f61['as'],'attributes':_0x5b2f61[_0x2c8b('0x27')],'include':_0x5b2f61[_0x2c8b('0x25')]?_[_0x2c8b('0x26')](_0x5b2f61['include'],function(_0x5727d7){return{'model':db[_0x5727d7['model']],'as':_0x5727d7['as'],'attributes':_0x5727d7['attributes'],'include':_0x5727d7[_0x2c8b('0x25')]?_['map'](_0x5727d7[_0x2c8b('0x25')],function(_0x39b761){return{'model':db[_0x39b761[_0x2c8b('0x28')]],'as':_0x39b761['as'],'attributes':_0x39b761[_0x2c8b('0x27')]};}):[]};}):[]};}):[]:[]})[_0x2c8b('0x12')](function(_0x2f35d2){logger[_0x2c8b('0x13')](_0x2c8b('0x1e'),_0x2ed906);logger[_0x2c8b('0x16')](_0x2c8b('0x1e'),_0x2ed906,JSON[_0x2c8b('0x18')](_0x2f35d2));_0x5e20b2(_0x2f35d2);})[_0x2c8b('0x1d')](function(_0x3c3a50){logger['error'](_0x2c8b('0x1e'),_0x3c3a50[_0x2c8b('0x1b')],_0x2ed906);_0xe85b48(_0x531db0[_0x2c8b('0x19')](0x1f4,_0x3c3a50[_0x2c8b('0x1b')]));});});};exports[_0x2c8b('0x29')]=function(_0x5441c1){var _0x1ea890=this;return new Promise(function(_0x23e29c,_0xffead1){return db[_0x2c8b('0x1f')][_0x2c8b('0x2a')]({'raw':_0x5441c1[_0x2c8b('0x21')]?_0x5441c1[_0x2c8b('0x21')][_0x2c8b('0x22')]===undefined?!![]:![]:!![],'where':_0x5441c1[_0x2c8b('0x21')]?_0x5441c1[_0x2c8b('0x21')][_0x2c8b('0x23')]||null:null,'attributes':_0x5441c1[_0x2c8b('0x21')]?_0x5441c1[_0x2c8b('0x21')][_0x2c8b('0x27')]||null:null,'include':_0x5441c1[_0x2c8b('0x21')]?_0x5441c1[_0x2c8b('0x21')]['include']?_[_0x2c8b('0x26')](_0x5441c1[_0x2c8b('0x21')][_0x2c8b('0x25')],function(_0x465624){return{'model':db[_0x465624['model']],'as':_0x465624['as'],'attributes':_0x465624[_0x2c8b('0x27')],'include':_0x465624[_0x2c8b('0x25')]?_[_0x2c8b('0x26')](_0x465624[_0x2c8b('0x25')],function(_0x2c5288){return{'model':db[_0x2c5288[_0x2c8b('0x28')]],'as':_0x2c5288['as'],'attributes':_0x2c5288[_0x2c8b('0x27')],'include':_0x2c5288[_0x2c8b('0x25')]?_[_0x2c8b('0x26')](_0x2c5288[_0x2c8b('0x25')],function(_0x1ad8b1){return{'model':db[_0x1ad8b1[_0x2c8b('0x28')]],'as':_0x1ad8b1['as'],'attributes':_0x1ad8b1[_0x2c8b('0x27')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x298e69){logger[_0x2c8b('0x13')](_0x2c8b('0x29'),_0x5441c1);logger['debug']('ShowOpenchannelQueue',_0x5441c1,JSON[_0x2c8b('0x18')](_0x298e69));_0x23e29c(_0x298e69);})[_0x2c8b('0x1d')](function(_0xcc6f18){logger[_0x2c8b('0x19')](_0x2c8b('0x29'),_0xcc6f18[_0x2c8b('0x1b')],_0x5441c1);_0xffead1(_0x1ea890['error'](0x1f4,_0xcc6f18['message']));});});}; \ No newline at end of file +var _0x045a=['../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','info','catch','ShowOpenchannelQueue','OpenchannelQueue','find','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x045a,0x19f));var _0xa045=function(_0x1ce694,_0x1e4e89){_0x1ce694=_0x1ce694-0x0;var _0x7b0960=_0x045a[_0x1ce694];return _0x7b0960;};'use strict';var _=require(_0xa045('0x0'));var util=require('util');var moment=require(_0xa045('0x1'));var BPromise=require(_0xa045('0x2'));var rs=require(_0xa045('0x3'));var fs=require('fs');var Redis=require(_0xa045('0x4'));var db=require(_0xa045('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa045('0x6'));var config=require(_0xa045('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa045('0x8')][_0xa045('0x9')]({'port':0x232a});config[_0xa045('0xa')]=_[_0xa045('0xb')](config[_0xa045('0xa')],{'host':_0xa045('0xc'),'port':0x18eb});var socket=require(_0xa045('0xd'))(new Redis(config[_0xa045('0xa')]));require(_0xa045('0xe'))[_0xa045('0xf')](socket);function respondWithRpcPromise(_0x354c2e,_0x146662,_0x5125ba){return new BPromise(function(_0x1512a7,_0x1ddcc9){return client[_0xa045('0x10')](_0x354c2e,_0x5125ba)[_0xa045('0x11')](function(_0x1fd24b){logger['info'](_0xa045('0x12'),_0x146662,_0xa045('0x13'));logger[_0xa045('0x14')](_0xa045('0x15'),_0x146662,'request\x20sent',JSON[_0xa045('0x16')](_0x1fd24b));if(_0x1fd24b['error']){if(_0x1fd24b[_0xa045('0x17')][_0xa045('0x18')]===0x1f4){logger[_0xa045('0x17')](_0xa045('0x12'),_0x146662,_0x1fd24b['error'][_0xa045('0x19')]);return _0x1ddcc9(_0x1fd24b[_0xa045('0x17')]['message']);}logger[_0xa045('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x146662,_0x1fd24b[_0xa045('0x17')][_0xa045('0x19')]);return _0x1512a7(_0x1fd24b[_0xa045('0x17')][_0xa045('0x19')]);}else{logger['info'](_0xa045('0x12'),_0x146662,_0xa045('0x13'));_0x1512a7(_0x1fd24b[_0xa045('0x1a')][_0xa045('0x19')]);}})['catch'](function(_0x4bc689){logger[_0xa045('0x17')](_0xa045('0x12'),_0x146662,_0x4bc689);_0x1ddcc9(_0x4bc689);});});}exports[_0xa045('0x1b')]=function(_0x4e78ec){var _0x56bf35=this;return new Promise(function(_0x2a6009,_0x2e29b6){return db['OpenchannelQueue'][_0xa045('0x1c')]({'raw':_0x4e78ec[_0xa045('0x1d')]?_0x4e78ec['options'][_0xa045('0x1e')]===undefined?!![]:![]:!![],'where':_0x4e78ec[_0xa045('0x1d')]?_0x4e78ec[_0xa045('0x1d')][_0xa045('0x1f')]||null:null,'attributes':_0x4e78ec[_0xa045('0x1d')]?_0x4e78ec['options'][_0xa045('0x20')]||null:null,'limit':_0x4e78ec['options']?_0x4e78ec[_0xa045('0x1d')][_0xa045('0x21')]||null:null,'include':_0x4e78ec[_0xa045('0x1d')]?_0x4e78ec[_0xa045('0x1d')]['include']?_['map'](_0x4e78ec[_0xa045('0x1d')][_0xa045('0x22')],function(_0x42c127){return{'model':db[_0x42c127[_0xa045('0x23')]],'as':_0x42c127['as'],'attributes':_0x42c127[_0xa045('0x20')],'include':_0x42c127[_0xa045('0x22')]?_['map'](_0x42c127['include'],function(_0x3eb4f8){return{'model':db[_0x3eb4f8[_0xa045('0x23')]],'as':_0x3eb4f8['as'],'attributes':_0x3eb4f8[_0xa045('0x20')],'include':_0x3eb4f8[_0xa045('0x22')]?_[_0xa045('0x24')](_0x3eb4f8['include'],function(_0x286354){return{'model':db[_0x286354[_0xa045('0x23')]],'as':_0x286354['as'],'attributes':_0x286354[_0xa045('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x575462){logger[_0xa045('0x25')](_0xa045('0x1b'),_0x4e78ec);logger[_0xa045('0x14')](_0xa045('0x1b'),_0x4e78ec,JSON['stringify'](_0x575462));_0x2a6009(_0x575462);})[_0xa045('0x26')](function(_0x9f2aa7){logger['error']('GetOpenchannelQueue',_0x9f2aa7['message'],_0x4e78ec);_0x2e29b6(_0x56bf35['error'](0x1f4,_0x9f2aa7[_0xa045('0x19')]));});});};exports[_0xa045('0x27')]=function(_0x41625c){var _0x1a8f1f=this;return new Promise(function(_0x4300ed,_0x402358){return db[_0xa045('0x28')][_0xa045('0x29')]({'raw':_0x41625c[_0xa045('0x1d')]?_0x41625c[_0xa045('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x41625c[_0xa045('0x1d')]?_0x41625c[_0xa045('0x1d')][_0xa045('0x1f')]||null:null,'attributes':_0x41625c[_0xa045('0x1d')]?_0x41625c['options']['attributes']||null:null,'include':_0x41625c[_0xa045('0x1d')]?_0x41625c[_0xa045('0x1d')]['include']?_[_0xa045('0x24')](_0x41625c['options'][_0xa045('0x22')],function(_0x33da6e){return{'model':db[_0x33da6e[_0xa045('0x23')]],'as':_0x33da6e['as'],'attributes':_0x33da6e[_0xa045('0x20')],'include':_0x33da6e['include']?_[_0xa045('0x24')](_0x33da6e[_0xa045('0x22')],function(_0x1f3da1){return{'model':db[_0x1f3da1['model']],'as':_0x1f3da1['as'],'attributes':_0x1f3da1[_0xa045('0x20')],'include':_0x1f3da1[_0xa045('0x22')]?_[_0xa045('0x24')](_0x1f3da1[_0xa045('0x22')],function(_0x4d0b7d){return{'model':db[_0x4d0b7d[_0xa045('0x23')]],'as':_0x4d0b7d['as'],'attributes':_0x4d0b7d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xb3e0c5){logger[_0xa045('0x25')](_0xa045('0x27'),_0x41625c);logger[_0xa045('0x14')](_0xa045('0x27'),_0x41625c,JSON[_0xa045('0x16')](_0xb3e0c5));_0x4300ed(_0xb3e0c5);})[_0xa045('0x26')](function(_0x4f61de){logger[_0xa045('0x17')](_0xa045('0x27'),_0x4f61de[_0xa045('0x19')],_0x41625c);_0x402358(_0x1a8f1f['error'](0x1f4,_0x4f61de[_0xa045('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 14fca48..8616502 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 _0xc97f=['length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener','register'];(function(_0x2a2424,_0x2c537b){var _0x3722a7=function(_0x15978b){while(--_0x15978b){_0x2a2424['push'](_0x2a2424['shift']());}};_0x3722a7(++_0x2c537b);}(_0xc97f,0xca));var _0xfc97=function(_0x1252bb,_0x27f681){_0x1252bb=_0x1252bb-0x0;var _0x3cde4c=_0xc97f[_0x1252bb];return _0x3cde4c;};'use strict';var OpenchannelQueueEvents=require(_0xfc97('0x0'));var events=[_0xfc97('0x1'),_0xfc97('0x2'),'update'];function createListener(_0x55d9f6,_0x4cea6e){return function(_0x2d6a46){_0x4cea6e[_0xfc97('0x3')](_0x55d9f6,_0x2d6a46);};}function removeListener(_0x1633e5,_0xabb827){return function(){OpenchannelQueueEvents[_0xfc97('0x4')](_0x1633e5,_0xabb827);};}exports[_0xfc97('0x5')]=function(_0x22fbe5){for(var _0x414c65=0x0,_0x15c48e=events[_0xfc97('0x6')];_0x414c65<_0x15c48e;_0x414c65++){var _0x354ed5=events[_0x414c65];var _0x2ce07e=createListener(_0xfc97('0x7')+_0x354ed5,_0x22fbe5);OpenchannelQueueEvents['on'](_0x354ed5,_0x2ce07e);}}; \ No newline at end of file +var _0x38f9=['openchannelQueue:','remove','update','removeListener','length'];(function(_0x1dee74,_0x3731cd){var _0x477e33=function(_0x21003d){while(--_0x21003d){_0x1dee74['push'](_0x1dee74['shift']());}};_0x477e33(++_0x3731cd);}(_0x38f9,0xd3));var _0x938f=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x38f9[_0x1d6a82];return _0x5834ac;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0x938f('0x0'),_0x938f('0x1')];function createListener(_0x502c36,_0x4b9b44){return function(_0x3c30fa){_0x4b9b44['emit'](_0x502c36,_0x3c30fa);};}function removeListener(_0x5cc294,_0xfb2ab2){return function(){OpenchannelQueueEvents[_0x938f('0x2')](_0x5cc294,_0xfb2ab2);};}exports['register']=function(_0x2959d6){for(var _0x26cbd3=0x0,_0x4b3c40=events[_0x938f('0x3')];_0x26cbd3<_0x4b3c40;_0x26cbd3++){var _0x45e31c=events[_0x26cbd3];var _0x5632f9=createListener(_0x938f('0x4')+_0x45e31c,_0x2959d6);OpenchannelQueueEvents['on'](_0x45e31c,_0x5632f9);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 7726525..0428bd2 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 _0x7613=['index','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated'];(function(_0x5a5d40,_0x1aa300){var _0x9f9fbc=function(_0x296b18){while(--_0x296b18){_0x5a5d40['push'](_0x5a5d40['shift']());}};_0x9f9fbc(++_0x1aa300);}(_0x7613,0x6a));var _0x3761=function(_0x102411,_0x2c0b2b){_0x102411=_0x102411-0x0;var _0x2c904e=_0x7613[_0x102411];return _0x2c904e;};'use strict';var multer=require(_0x3761('0x0'));var util=require('util');var path=require(_0x3761('0x1'));var timeout=require(_0x3761('0x2'));var express=require('express');var router=express[_0x3761('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3761('0x4'));var config=require('../../config/environment');var controller=require(_0x3761('0x5'));router[_0x3761('0x6')]('/',auth[_0x3761('0x7')](),controller[_0x3761('0x8')]);router[_0x3761('0x6')](_0x3761('0x9'),auth[_0x3761('0x7')](),controller[_0x3761('0xa')]);router[_0x3761('0x6')]('/:id',auth[_0x3761('0x7')](),controller[_0x3761('0xb')]);router[_0x3761('0xc')]('/',auth[_0x3761('0x7')](),controller[_0x3761('0xd')]);router[_0x3761('0xe')](_0x3761('0xf'),auth[_0x3761('0x7')](),controller['update']);router[_0x3761('0x10')]('/:id',auth[_0x3761('0x7')](),controller[_0x3761('0x11')]);module[_0x3761('0x12')]=router; \ No newline at end of file +var _0x2706=['isAuthenticated','index','/describe','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get'];(function(_0x4dbb36,_0x1c8672){var _0x12fd61=function(_0x374b83){while(--_0x374b83){_0x4dbb36['push'](_0x4dbb36['shift']());}};_0x12fd61(++_0x1c8672);}(_0x2706,0x107));var _0x6270=function(_0x337e68,_0x4f659d){_0x337e68=_0x337e68-0x0;var _0x40c149=_0x2706[_0x337e68];return _0x40c149;};'use strict';var multer=require('multer');var util=require(_0x6270('0x0'));var path=require(_0x6270('0x1'));var timeout=require(_0x6270('0x2'));var express=require(_0x6270('0x3'));var router=express['Router']();var fs_extra=require(_0x6270('0x4'));var auth=require(_0x6270('0x5'));var interaction=require(_0x6270('0x6'));var config=require(_0x6270('0x7'));var controller=require(_0x6270('0x8'));router[_0x6270('0x9')]('/',auth[_0x6270('0xa')](),controller[_0x6270('0xb')]);router['get'](_0x6270('0xc'),auth[_0x6270('0xa')](),controller['describe']);router[_0x6270('0x9')](_0x6270('0xd'),auth[_0x6270('0xa')](),controller[_0x6270('0xe')]);router[_0x6270('0xf')]('/',auth[_0x6270('0xa')](),controller['create']);router[_0x6270('0x10')](_0x6270('0xd'),auth[_0x6270('0xa')](),controller[_0x6270('0x11')]);router[_0x6270('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x6270('0x13')]);module[_0x6270('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index b6feae4..e1f73ca 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 _0x5a0f=['moment','exports','STRING','DATE'];(function(_0x9914f2,_0x7ddaa4){var _0x1fd042=function(_0x49aa50){while(--_0x49aa50){_0x9914f2['push'](_0x9914f2['shift']());}};_0x1fd042(++_0x7ddaa4);}(_0x5a0f,0x1e4));var _0xf5a0=function(_0x61ab16,_0x3a8018){_0x61ab16=_0x61ab16-0x0;var _0x2b570c=_0x5a0f[_0x61ab16];return _0x2b570c;};'use strict';var moment=require(_0xf5a0('0x0'));var Sequelize=require('sequelize');module[_0xf5a0('0x1')]={'uniqueid':{'type':Sequelize[_0xf5a0('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xf5a0('0x3')]},'exitAt':{'type':Sequelize[_0xf5a0('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb2c0=['moment','exports','STRING','DATE'];(function(_0x34cb63,_0xa811f5){var _0x5e1f10=function(_0x3904bc){while(--_0x3904bc){_0x34cb63['push'](_0x34cb63['shift']());}};_0x5e1f10(++_0xa811f5);}(_0xb2c0,0x110));var _0x0b2c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb2c0[_0x397e5f];return _0x5302b8;};'use strict';var moment=require(_0x0b2c('0x0'));var Sequelize=require('sequelize');module[_0x0b2c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0b2c('0x2')]},'joinAt':{'type':Sequelize[_0x0b2c('0x3')]},'leaveAt':{'type':Sequelize[_0x0b2c('0x3')]},'acceptAt':{'type':Sequelize[_0x0b2c('0x3')]},'exitAt':{'type':Sequelize[_0x0b2c('0x3')]},'reason':{'type':Sequelize[_0x0b2c('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index ce9d841..8af42a5 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 _0xe718=['filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','show','rawAttributes','find','catch','update','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','save','destroy','error','name','send','map','OpenchannelQueueReport','type','key','model','query','keys'];(function(_0x401871,_0x5547e4){var _0x1f73d0=function(_0x509e0b){while(--_0x509e0b){_0x401871['push'](_0x401871['shift']());}};_0x1f73d0(++_0x5547e4);}(_0xe718,0x191));var _0x8e71=function(_0x22cc16,_0x1f4fa2){_0x22cc16=_0x22cc16-0x0;var _0x399b70=_0xe718[_0x22cc16];return _0x399b70;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8e71('0x0'));var zipdir=require(_0x8e71('0x1'));var jsonpatch=require(_0x8e71('0x2'));var rp=require(_0x8e71('0x3'));var moment=require(_0x8e71('0x4'));var BPromise=require(_0x8e71('0x5'));var Mustache=require(_0x8e71('0x6'));var util=require(_0x8e71('0x7'));var path=require(_0x8e71('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8e71('0x9'));var fs=require('fs');var fs_extra=require(_0x8e71('0xa'));var _=require(_0x8e71('0xb'));var squel=require(_0x8e71('0xc'));var crypto=require(_0x8e71('0xd'));var jsforce=require(_0x8e71('0xe'));var deskjs=require(_0x8e71('0xf'));var toCsv=require(_0x8e71('0x10'));var querystring=require('querystring');var Papa=require(_0x8e71('0x11'));var Redis=require('ioredis');var authService=require(_0x8e71('0x12'));var qs=require(_0x8e71('0x13'));var as=require(_0x8e71('0x14'));var hardwareService=require(_0x8e71('0x15'));var logger=require(_0x8e71('0x16'))(_0x8e71('0x17'));var utils=require(_0x8e71('0x18'));var config=require(_0x8e71('0x19'));var licenseUtil=require(_0x8e71('0x1a'));var db=require(_0x8e71('0x1b'))['db'];function respondWithStatusCode(_0x8fef46,_0x2299dc){_0x2299dc=_0x2299dc||0xcc;return function(_0x54cc2e){if(_0x54cc2e){return _0x8fef46[_0x8e71('0x1c')](_0x2299dc);}return _0x8fef46['status'](_0x2299dc)[_0x8e71('0x1d')]();};}function respondWithResult(_0x2d633f,_0xe885d){_0xe885d=_0xe885d||0xc8;return function(_0xf5620d){if(_0xf5620d){return _0x2d633f[_0x8e71('0x1e')](_0xe885d)[_0x8e71('0x1f')](_0xf5620d);}};}function respondWithFilteredResult(_0x5531a9,_0x6078d7){return function(_0x5333dc){if(_0x5333dc){var _0x53676e=typeof _0x6078d7[_0x8e71('0x20')]===_0x8e71('0x21')&&typeof _0x6078d7[_0x8e71('0x22')]===_0x8e71('0x21');var _0x262a07=_0x5333dc[_0x8e71('0x23')];var _0x572762=_0x53676e?0x0:_0x6078d7[_0x8e71('0x20')];var _0x3b0385=_0x53676e?_0x5333dc[_0x8e71('0x23')]:_0x6078d7[_0x8e71('0x20')]+_0x6078d7['limit'];var _0x2066f9;if(_0x3b0385>=_0x262a07){_0x3b0385=_0x262a07;_0x2066f9=0xc8;}else{_0x2066f9=0xce;}_0x5531a9[_0x8e71('0x1e')](_0x2066f9);return _0x5531a9['set'](_0x8e71('0x24'),_0x572762+'-'+_0x3b0385+'/'+_0x262a07)[_0x8e71('0x1f')](_0x5333dc);}return null;};}function patchUpdates(_0x861689){return function(_0x211c59){try{jsonpatch['apply'](_0x211c59,_0x861689,!![]);}catch(_0x2955e1){return BPromise['reject'](_0x2955e1);}return _0x211c59[_0x8e71('0x25')]();};}function saveUpdates(_0x24d279,_0x13853f){return function(_0x3f73de){if(_0x3f73de){return _0x3f73de['update'](_0x24d279)['then'](function(_0x23f53a){return _0x23f53a;});}return null;};}function removeEntity(_0x4e5a2b,_0x405b97){return function(_0x1cdf7e){if(_0x1cdf7e){return _0x1cdf7e[_0x8e71('0x26')]()['then'](function(){_0x4e5a2b[_0x8e71('0x1e')](0xcc)[_0x8e71('0x1d')]();});}};}function handleEntityNotFound(_0x187593,_0x5c7b2a){return function(_0x50c5fe){if(!_0x50c5fe){_0x187593[_0x8e71('0x1c')](0x194);}return _0x50c5fe;};}function handleError(_0x42d500,_0x5e3330){_0x5e3330=_0x5e3330||0x1f4;return function(_0x4d3cf1){logger[_0x8e71('0x27')](_0x4d3cf1['stack']);if(_0x4d3cf1['name']){delete _0x4d3cf1[_0x8e71('0x28')];}_0x42d500[_0x8e71('0x1e')](_0x5e3330)[_0x8e71('0x29')](_0x4d3cf1);};}exports['index']=function(_0x286daa,_0x1356f2){var _0x517b06={},_0x1f31e2={},_0x49eaf2={'count':0x0,'rows':[]};var _0x36c5f8=_[_0x8e71('0x2a')](db[_0x8e71('0x2b')]['rawAttributes'],function(_0x2dcfda){return{'name':_0x2dcfda['fieldName'],'type':_0x2dcfda[_0x8e71('0x2c')][_0x8e71('0x2d')]};});_0x1f31e2[_0x8e71('0x2e')]=_['map'](_0x36c5f8,_0x8e71('0x28'));_0x1f31e2[_0x8e71('0x2f')]=_[_0x8e71('0x30')](_0x286daa['query']);_0x1f31e2[_0x8e71('0x31')]=_[_0x8e71('0x32')](_0x1f31e2[_0x8e71('0x2e')],_0x1f31e2['query']);_0x517b06['attributes']=_[_0x8e71('0x32')](_0x1f31e2[_0x8e71('0x2e')],qs[_0x8e71('0x33')](_0x286daa[_0x8e71('0x2f')][_0x8e71('0x33')]));_0x517b06[_0x8e71('0x34')]=_0x517b06[_0x8e71('0x34')][_0x8e71('0x35')]?_0x517b06[_0x8e71('0x34')]:_0x1f31e2[_0x8e71('0x2e')];if(!_0x286daa[_0x8e71('0x2f')][_0x8e71('0x36')]('nolimit')){_0x517b06[_0x8e71('0x22')]=qs[_0x8e71('0x22')](_0x286daa[_0x8e71('0x2f')][_0x8e71('0x22')]);_0x517b06['offset']=qs[_0x8e71('0x20')](_0x286daa['query']['offset']);}_0x517b06[_0x8e71('0x37')]=qs[_0x8e71('0x38')](_0x286daa['query'][_0x8e71('0x38')]);_0x517b06['where']=qs[_0x8e71('0x31')](_[_0x8e71('0x39')](_0x286daa[_0x8e71('0x2f')],_0x1f31e2['filters']),_0x36c5f8);if(_0x286daa[_0x8e71('0x2f')]['filter']){_0x517b06[_0x8e71('0x3a')]=_[_0x8e71('0x3b')](_0x517b06[_0x8e71('0x3a')],{'$or':_[_0x8e71('0x2a')](_0x36c5f8,function(_0x5df1f7){if(_0x5df1f7[_0x8e71('0x2c')]!==_0x8e71('0x3c')){var _0x5f396c={};_0x5f396c[_0x5df1f7[_0x8e71('0x28')]]={'$like':'%'+_0x286daa[_0x8e71('0x2f')][_0x8e71('0x3d')]+'%'};return _0x5f396c;}})});}_0x517b06=_[_0x8e71('0x3b')]({},_0x517b06,_0x286daa[_0x8e71('0x3e')]);var _0x9d0eeb={'where':_0x517b06[_0x8e71('0x3a')]};return db[_0x8e71('0x2b')][_0x8e71('0x23')](_0x9d0eeb)[_0x8e71('0x3f')](function(_0x25891b){_0x49eaf2[_0x8e71('0x23')]=_0x25891b;if(_0x286daa[_0x8e71('0x2f')][_0x8e71('0x40')]){_0x517b06[_0x8e71('0x41')]=[{'all':!![]}];}return db[_0x8e71('0x2b')][_0x8e71('0x42')](_0x517b06);})['then'](function(_0x236133){_0x49eaf2['rows']=_0x236133;return _0x49eaf2;})[_0x8e71('0x3f')](respondWithFilteredResult(_0x1356f2,_0x517b06))['catch'](handleError(_0x1356f2,null));};exports[_0x8e71('0x43')]=function(_0xf9de5d,_0x397d80){var _0x176283={'raw':!![],'where':{'id':_0xf9de5d['params']['id']}},_0x46ca7e={};_0x46ca7e[_0x8e71('0x2e')]=_['keys'](db[_0x8e71('0x2b')][_0x8e71('0x44')]);_0x46ca7e['query']=_[_0x8e71('0x30')](_0xf9de5d['query']);_0x46ca7e[_0x8e71('0x31')]=_[_0x8e71('0x32')](_0x46ca7e['model'],_0x46ca7e[_0x8e71('0x2f')]);_0x176283[_0x8e71('0x34')]=_[_0x8e71('0x32')](_0x46ca7e[_0x8e71('0x2e')],qs[_0x8e71('0x33')](_0xf9de5d[_0x8e71('0x2f')][_0x8e71('0x33')]));_0x176283[_0x8e71('0x34')]=_0x176283[_0x8e71('0x34')][_0x8e71('0x35')]?_0x176283[_0x8e71('0x34')]:_0x46ca7e[_0x8e71('0x2e')];if(_0xf9de5d[_0x8e71('0x2f')][_0x8e71('0x40')]){_0x176283[_0x8e71('0x41')]=[{'all':!![]}];}_0x176283=_[_0x8e71('0x3b')]({},_0x176283,_0xf9de5d[_0x8e71('0x3e')]);return db[_0x8e71('0x2b')][_0x8e71('0x45')](_0x176283)[_0x8e71('0x3f')](handleEntityNotFound(_0x397d80,null))[_0x8e71('0x3f')](respondWithResult(_0x397d80,null))[_0x8e71('0x46')](handleError(_0x397d80,null));};exports['create']=function(_0x1b7121,_0x47f13c){return db[_0x8e71('0x2b')]['create'](_0x1b7121['body'],{})['then'](respondWithResult(_0x47f13c,0xc9))[_0x8e71('0x46')](handleError(_0x47f13c,null));};exports[_0x8e71('0x47')]=function(_0x2eefe6,_0x4c962a){if(_0x2eefe6[_0x8e71('0x48')]['id']){delete _0x2eefe6['body']['id'];}return db[_0x8e71('0x2b')][_0x8e71('0x45')]({'where':{'id':_0x2eefe6[_0x8e71('0x49')]['id']}})[_0x8e71('0x3f')](handleEntityNotFound(_0x4c962a,null))[_0x8e71('0x3f')](saveUpdates(_0x2eefe6[_0x8e71('0x48')],null))[_0x8e71('0x3f')](respondWithResult(_0x4c962a,null))['catch'](handleError(_0x4c962a,null));};exports[_0x8e71('0x26')]=function(_0x267376,_0x3812fe){return db['OpenchannelQueueReport'][_0x8e71('0x45')]({'where':{'id':_0x267376[_0x8e71('0x49')]['id']}})[_0x8e71('0x3f')](handleEntityNotFound(_0x3812fe,null))[_0x8e71('0x3f')](removeEntity(_0x3812fe,null))['catch'](handleError(_0x3812fe,null));};exports[_0x8e71('0x4a')]=function(_0x145ce8,_0x425e53){return db[_0x8e71('0x2b')][_0x8e71('0x4a')]()['then'](respondWithResult(_0x425e53,null))['catch'](handleError(_0x425e53,null));}; \ No newline at end of file +var _0x670d=['save','destroy','error','stack','name','map','OpenchannelQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','options','find','catch','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x525cc6,_0x5a7e0e){var _0x2427d3=function(_0x1df73b){while(--_0x1df73b){_0x525cc6['push'](_0x525cc6['shift']());}};_0x2427d3(++_0x5a7e0e);}(_0x670d,0x74));var _0xd670=function(_0x227aaf,_0x183de8){_0x227aaf=_0x227aaf-0x0;var _0x2c9746=_0x670d[_0x227aaf];return _0x2c9746;};'use strict';var emlformat=require(_0xd670('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd670('0x1'));var jsonpatch=require(_0xd670('0x2'));var rp=require(_0xd670('0x3'));var moment=require('moment');var BPromise=require(_0xd670('0x4'));var Mustache=require('mustache');var util=require(_0xd670('0x5'));var path=require(_0xd670('0x6'));var sox=require(_0xd670('0x7'));var csv=require(_0xd670('0x8'));var ejs=require(_0xd670('0x9'));var fs=require('fs');var fs_extra=require(_0xd670('0xa'));var _=require('lodash');var squel=require(_0xd670('0xb'));var crypto=require('crypto');var jsforce=require(_0xd670('0xc'));var deskjs=require(_0xd670('0xd'));var toCsv=require(_0xd670('0x8'));var querystring=require('querystring');var Papa=require(_0xd670('0xe'));var Redis=require(_0xd670('0xf'));var authService=require(_0xd670('0x10'));var qs=require(_0xd670('0x11'));var as=require(_0xd670('0x12'));var hardwareService=require(_0xd670('0x13'));var logger=require(_0xd670('0x14'))(_0xd670('0x15'));var utils=require(_0xd670('0x16'));var config=require(_0xd670('0x17'));var licenseUtil=require(_0xd670('0x18'));var db=require(_0xd670('0x19'))['db'];function respondWithStatusCode(_0x42a461,_0x3b4e38){_0x3b4e38=_0x3b4e38||0xcc;return function(_0x545269){if(_0x545269){return _0x42a461[_0xd670('0x1a')](_0x3b4e38);}return _0x42a461[_0xd670('0x1b')](_0x3b4e38)[_0xd670('0x1c')]();};}function respondWithResult(_0xa0ae58,_0x46527a){_0x46527a=_0x46527a||0xc8;return function(_0x43b315){if(_0x43b315){return _0xa0ae58[_0xd670('0x1b')](_0x46527a)[_0xd670('0x1d')](_0x43b315);}};}function respondWithFilteredResult(_0x4572ab,_0x37501e){return function(_0x5e4eb1){if(_0x5e4eb1){var _0x4640f7=typeof _0x37501e[_0xd670('0x1e')]===_0xd670('0x1f')&&typeof _0x37501e['limit']===_0xd670('0x1f');var _0x4ddc8f=_0x5e4eb1['count'];var _0x3e8b4c=_0x4640f7?0x0:_0x37501e[_0xd670('0x1e')];var _0x431942=_0x4640f7?_0x5e4eb1[_0xd670('0x20')]:_0x37501e[_0xd670('0x1e')]+_0x37501e[_0xd670('0x21')];var _0x28978e;if(_0x431942>=_0x4ddc8f){_0x431942=_0x4ddc8f;_0x28978e=0xc8;}else{_0x28978e=0xce;}_0x4572ab[_0xd670('0x1b')](_0x28978e);return _0x4572ab[_0xd670('0x22')](_0xd670('0x23'),_0x3e8b4c+'-'+_0x431942+'/'+_0x4ddc8f)[_0xd670('0x1d')](_0x5e4eb1);}return null;};}function patchUpdates(_0x41fc98){return function(_0x174fb4){try{jsonpatch[_0xd670('0x24')](_0x174fb4,_0x41fc98,!![]);}catch(_0x49a4d9){return BPromise[_0xd670('0x25')](_0x49a4d9);}return _0x174fb4[_0xd670('0x26')]();};}function saveUpdates(_0x2c7018,_0x4d84e7){return function(_0x3890a5){if(_0x3890a5){return _0x3890a5['update'](_0x2c7018)['then'](function(_0x44bfa8){return _0x44bfa8;});}return null;};}function removeEntity(_0x5b8471,_0x10f6c7){return function(_0xd83b5a){if(_0xd83b5a){return _0xd83b5a[_0xd670('0x27')]()['then'](function(){_0x5b8471['status'](0xcc)[_0xd670('0x1c')]();});}};}function handleEntityNotFound(_0x133116,_0x213d9a){return function(_0x4dfed6){if(!_0x4dfed6){_0x133116[_0xd670('0x1a')](0x194);}return _0x4dfed6;};}function handleError(_0x4933a2,_0x27ddf7){_0x27ddf7=_0x27ddf7||0x1f4;return function(_0x5bd429){logger[_0xd670('0x28')](_0x5bd429[_0xd670('0x29')]);if(_0x5bd429[_0xd670('0x2a')]){delete _0x5bd429[_0xd670('0x2a')];}_0x4933a2['status'](_0x27ddf7)['send'](_0x5bd429);};}exports['index']=function(_0x1f3f2d,_0x2bf5c8){var _0x379e4e={},_0x3d6f54={},_0x461169={'count':0x0,'rows':[]};var _0x51b9b7=_[_0xd670('0x2b')](db[_0xd670('0x2c')]['rawAttributes'],function(_0x48307b){return{'name':_0x48307b[_0xd670('0x2d')],'type':_0x48307b[_0xd670('0x2e')][_0xd670('0x2f')]};});_0x3d6f54[_0xd670('0x30')]=_[_0xd670('0x2b')](_0x51b9b7,_0xd670('0x2a'));_0x3d6f54[_0xd670('0x31')]=_[_0xd670('0x32')](_0x1f3f2d['query']);_0x3d6f54[_0xd670('0x33')]=_['intersection'](_0x3d6f54['model'],_0x3d6f54['query']);_0x379e4e['attributes']=_[_0xd670('0x34')](_0x3d6f54[_0xd670('0x30')],qs[_0xd670('0x35')](_0x1f3f2d[_0xd670('0x31')]['fields']));_0x379e4e[_0xd670('0x36')]=_0x379e4e['attributes'][_0xd670('0x37')]?_0x379e4e[_0xd670('0x36')]:_0x3d6f54[_0xd670('0x30')];if(!_0x1f3f2d[_0xd670('0x31')]['hasOwnProperty'](_0xd670('0x38'))){_0x379e4e[_0xd670('0x21')]=qs[_0xd670('0x21')](_0x1f3f2d[_0xd670('0x31')][_0xd670('0x21')]);_0x379e4e[_0xd670('0x1e')]=qs[_0xd670('0x1e')](_0x1f3f2d[_0xd670('0x31')]['offset']);}_0x379e4e['order']=qs['sort'](_0x1f3f2d['query'][_0xd670('0x39')]);_0x379e4e[_0xd670('0x3a')]=qs[_0xd670('0x33')](_[_0xd670('0x3b')](_0x1f3f2d[_0xd670('0x31')],_0x3d6f54[_0xd670('0x33')]),_0x51b9b7);if(_0x1f3f2d['query']['filter']){_0x379e4e[_0xd670('0x3a')]=_[_0xd670('0x3c')](_0x379e4e[_0xd670('0x3a')],{'$or':_[_0xd670('0x2b')](_0x51b9b7,function(_0x38e8b0){if(_0x38e8b0[_0xd670('0x2e')]!==_0xd670('0x3d')){var _0x4f2fa4={};_0x4f2fa4[_0x38e8b0[_0xd670('0x2a')]]={'$like':'%'+_0x1f3f2d['query'][_0xd670('0x3e')]+'%'};return _0x4f2fa4;}})});}_0x379e4e=_[_0xd670('0x3c')]({},_0x379e4e,_0x1f3f2d['options']);var _0x5c6abd={'where':_0x379e4e[_0xd670('0x3a')]};return db[_0xd670('0x2c')]['count'](_0x5c6abd)['then'](function(_0x5b2704){_0x461169[_0xd670('0x20')]=_0x5b2704;if(_0x1f3f2d[_0xd670('0x31')][_0xd670('0x3f')]){_0x379e4e[_0xd670('0x40')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xd670('0x41')](_0x379e4e);})[_0xd670('0x42')](function(_0x49d57c){_0x461169[_0xd670('0x43')]=_0x49d57c;return _0x461169;})[_0xd670('0x42')](respondWithFilteredResult(_0x2bf5c8,_0x379e4e))['catch'](handleError(_0x2bf5c8,null));};exports[_0xd670('0x44')]=function(_0x33a436,_0x45c099){var _0x4af348={'raw':!![],'where':{'id':_0x33a436['params']['id']}},_0x177ec6={};_0x177ec6['model']=_[_0xd670('0x32')](db[_0xd670('0x2c')]['rawAttributes']);_0x177ec6[_0xd670('0x31')]=_[_0xd670('0x32')](_0x33a436['query']);_0x177ec6[_0xd670('0x33')]=_[_0xd670('0x34')](_0x177ec6['model'],_0x177ec6[_0xd670('0x31')]);_0x4af348[_0xd670('0x36')]=_[_0xd670('0x34')](_0x177ec6['model'],qs[_0xd670('0x35')](_0x33a436[_0xd670('0x31')][_0xd670('0x35')]));_0x4af348['attributes']=_0x4af348[_0xd670('0x36')][_0xd670('0x37')]?_0x4af348['attributes']:_0x177ec6['model'];if(_0x33a436['query'][_0xd670('0x3f')]){_0x4af348[_0xd670('0x40')]=[{'all':!![]}];}_0x4af348=_['merge']({},_0x4af348,_0x33a436[_0xd670('0x45')]);return db[_0xd670('0x2c')][_0xd670('0x46')](_0x4af348)[_0xd670('0x42')](handleEntityNotFound(_0x45c099,null))[_0xd670('0x42')](respondWithResult(_0x45c099,null))[_0xd670('0x47')](handleError(_0x45c099,null));};exports[_0xd670('0x48')]=function(_0x25ff3c,_0x572b8a){return db[_0xd670('0x2c')][_0xd670('0x48')](_0x25ff3c[_0xd670('0x49')],{})[_0xd670('0x42')](respondWithResult(_0x572b8a,0xc9))['catch'](handleError(_0x572b8a,null));};exports[_0xd670('0x4a')]=function(_0x288280,_0x50fc45){if(_0x288280[_0xd670('0x49')]['id']){delete _0x288280[_0xd670('0x49')]['id'];}return db[_0xd670('0x2c')][_0xd670('0x46')]({'where':{'id':_0x288280[_0xd670('0x4b')]['id']}})[_0xd670('0x42')](handleEntityNotFound(_0x50fc45,null))[_0xd670('0x42')](saveUpdates(_0x288280[_0xd670('0x49')],null))[_0xd670('0x42')](respondWithResult(_0x50fc45,null))[_0xd670('0x47')](handleError(_0x50fc45,null));};exports[_0xd670('0x27')]=function(_0x5e2d0a,_0x5be2ca){return db[_0xd670('0x2c')][_0xd670('0x46')]({'where':{'id':_0x5e2d0a['params']['id']}})[_0xd670('0x42')](handleEntityNotFound(_0x5be2ca,null))[_0xd670('0x42')](removeEntity(_0x5be2ca,null))[_0xd670('0x47')](handleError(_0x5be2ca,null));};exports[_0xd670('0x4c')]=function(_0x490bea,_0x1873fc){return db['OpenchannelQueueReport'][_0xd670('0x4c')]()['then'](respondWithResult(_0x1873fc,null))[_0xd670('0x47')](handleError(_0x1873fc,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index f8693b1..882c942 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0xac097b,_0x7195f6){var _0x4cb784=function(_0x411414){while(--_0x411414){_0xac097b['push'](_0xac097b['shift']());}};_0x4cb784(++_0x7195f6);}(_0xe14b,0x93));var _0xbe14=function(_0x6cc22a,_0x3e52e2){_0x6cc22a=_0x6cc22a-0x0;var _0x555b0b=_0xe14b[_0x6cc22a];return _0x555b0b;};'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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x814b,0x1a2));var _0xb814=function(_0x580cf8,_0x26751e){_0x580cf8=_0x580cf8-0x0;var _0xcc9a9e=_0x814b[_0x580cf8];return _0xcc9a9e;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 2a2b256..7b0a956 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 _0xd7a0=['where','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','OpenchannelQueueReport,\x20%s,\x20%s','catch','CreateOpenchannelQueueReport','options','raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','body'];(function(_0x5de732,_0x167528){var _0x4fbbce=function(_0x4a6d4b){while(--_0x4a6d4b){_0x5de732['push'](_0x5de732['shift']());}};_0x4fbbce(++_0x167528);}(_0xd7a0,0x163));var _0x0d7a=function(_0x8e7300,_0x3b9a1e){_0x8e7300=_0x8e7300-0x0;var _0x51fe2d=_0xd7a0[_0x8e7300];return _0x51fe2d;};'use strict';var _=require(_0x0d7a('0x0'));var util=require(_0x0d7a('0x1'));var moment=require('moment');var BPromise=require(_0x0d7a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d7a('0x3'));var db=require(_0x0d7a('0x4'))['db'];var utils=require(_0x0d7a('0x5'));var logger=require(_0x0d7a('0x6'))(_0x0d7a('0x7'));var config=require('../../config/environment');var jayson=require(_0x0d7a('0x8'));var client=jayson[_0x0d7a('0x9')][_0x0d7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16461e,_0x22b404,_0x371b7d){return new BPromise(function(_0x1514ae,_0x55d585){return client[_0x0d7a('0xb')](_0x16461e,_0x371b7d)[_0x0d7a('0xc')](function(_0x450d42){logger[_0x0d7a('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x22b404,_0x0d7a('0xe'));logger[_0x0d7a('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x22b404,_0x0d7a('0xe'),JSON[_0x0d7a('0x10')](_0x450d42));if(_0x450d42[_0x0d7a('0x11')]){if(_0x450d42[_0x0d7a('0x11')][_0x0d7a('0x12')]===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x22b404,_0x450d42[_0x0d7a('0x11')][_0x0d7a('0x13')]);return _0x55d585(_0x450d42[_0x0d7a('0x11')]['message']);}logger[_0x0d7a('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x22b404,_0x450d42['error'][_0x0d7a('0x13')]);return _0x1514ae(_0x450d42['error'][_0x0d7a('0x13')]);}else{logger[_0x0d7a('0xd')](_0x0d7a('0x14'),_0x22b404,_0x0d7a('0xe'));_0x1514ae(_0x450d42['result'][_0x0d7a('0x13')]);}})[_0x0d7a('0x15')](function(_0x497cbb){logger[_0x0d7a('0x11')](_0x0d7a('0x14'),_0x22b404,_0x497cbb);_0x55d585(_0x497cbb);});});}exports[_0x0d7a('0x16')]=function(_0x406b0c){var _0x5c54a6=this;return new Promise(function(_0x2180fa,_0x4cfcdc){return db['OpenchannelQueueReport']['create'](_0x406b0c['body'],{'raw':_0x406b0c[_0x0d7a('0x17')]?_0x406b0c['options'][_0x0d7a('0x18')]===undefined?!![]:![]:!![]})[_0x0d7a('0xc')](function(_0x4c997f){logger[_0x0d7a('0xd')](_0x0d7a('0x16'),_0x406b0c);logger[_0x0d7a('0xf')](_0x0d7a('0x16'),_0x406b0c,JSON['stringify'](_0x4c997f));_0x2180fa(_0x4c997f);})[_0x0d7a('0x15')](function(_0x2c11b6){logger[_0x0d7a('0x11')]('CreateOpenchannelQueueReport',_0x2c11b6['message'],_0x406b0c);_0x4cfcdc(_0x5c54a6[_0x0d7a('0x11')](0x1f4,_0x2c11b6[_0x0d7a('0x13')]));});});};exports[_0x0d7a('0x19')]=function(_0x1944ba){var _0x9c73d4=this;return new Promise(function(_0x551171,_0x14670c){return db[_0x0d7a('0x1a')][_0x0d7a('0x1b')](_0x1944ba[_0x0d7a('0x1c')],{'raw':_0x1944ba['options']?_0x1944ba['options'][_0x0d7a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1944ba[_0x0d7a('0x17')]?_0x1944ba[_0x0d7a('0x17')][_0x0d7a('0x1d')]||null:null,'attributes':_0x1944ba[_0x0d7a('0x17')]?_0x1944ba[_0x0d7a('0x17')][_0x0d7a('0x1e')]||null:null,'limit':_0x1944ba[_0x0d7a('0x17')]?_0x1944ba['options'][_0x0d7a('0x1f')]||null:null})['then'](function(_0x33ce6c){logger[_0x0d7a('0xd')](_0x0d7a('0x19'),_0x1944ba);logger[_0x0d7a('0xf')](_0x0d7a('0x19'),_0x1944ba,JSON['stringify'](_0x33ce6c));_0x551171(_0x33ce6c);})[_0x0d7a('0x15')](function(_0xfc200a){logger[_0x0d7a('0x11')]('UpdateOpenchannelQueueReport',_0xfc200a[_0x0d7a('0x13')],_0x1944ba);_0x14670c(_0x9c73d4[_0x0d7a('0x11')](0x1f4,_0xfc200a['message']));});});}; \ No newline at end of file +var _0x594d=['result','create','options','raw','CreateOpenchannelQueueReport','stringify','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','body','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x14cf04,_0x566f9f){var _0x24ec38=function(_0x2bb403){while(--_0x2bb403){_0x14cf04['push'](_0x14cf04['shift']());}};_0x24ec38(++_0x566f9f);}(_0x594d,0x92));var _0xd594=function(_0x2777e3,_0x40733f){_0x2777e3=_0x2777e3-0x0;var _0x2f94ad=_0x594d[_0x2777e3];return _0x2f94ad;};'use strict';var _=require(_0xd594('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd594('0x1'));var rs=require(_0xd594('0x2'));var fs=require('fs');var Redis=require(_0xd594('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd594('0x4'));var logger=require(_0xd594('0x5'))(_0xd594('0x6'));var config=require(_0xd594('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd594('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b1c64,_0x446711,_0xeedad0){return new BPromise(function(_0x20325a,_0x20718a){return client[_0xd594('0x9')](_0x3b1c64,_0xeedad0)[_0xd594('0xa')](function(_0xf3043e){logger[_0xd594('0xb')](_0xd594('0xc'),_0x446711,'request\x20sent');logger[_0xd594('0xd')](_0xd594('0xe'),_0x446711,_0xd594('0xf'),JSON['stringify'](_0xf3043e));if(_0xf3043e[_0xd594('0x10')]){if(_0xf3043e[_0xd594('0x10')][_0xd594('0x11')]===0x1f4){logger[_0xd594('0x10')](_0xd594('0xc'),_0x446711,_0xf3043e[_0xd594('0x10')][_0xd594('0x12')]);return _0x20718a(_0xf3043e['error']['message']);}logger[_0xd594('0x10')](_0xd594('0xc'),_0x446711,_0xf3043e['error'][_0xd594('0x12')]);return _0x20325a(_0xf3043e['error'][_0xd594('0x12')]);}else{logger[_0xd594('0xb')](_0xd594('0xc'),_0x446711,'request\x20sent');_0x20325a(_0xf3043e[_0xd594('0x13')]['message']);}})['catch'](function(_0x2a5f17){logger[_0xd594('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x446711,_0x2a5f17);_0x20718a(_0x2a5f17);});});}exports['CreateOpenchannelQueueReport']=function(_0x232776){var _0x4ea0d5=this;return new Promise(function(_0x54f640,_0x3ae9be){return db['OpenchannelQueueReport'][_0xd594('0x14')](_0x232776['body'],{'raw':_0x232776[_0xd594('0x15')]?_0x232776['options'][_0xd594('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x3b0fda){logger[_0xd594('0xb')](_0xd594('0x17'),_0x232776);logger[_0xd594('0xd')](_0xd594('0x17'),_0x232776,JSON[_0xd594('0x18')](_0x3b0fda));_0x54f640(_0x3b0fda);})[_0xd594('0x19')](function(_0x2b8495){logger[_0xd594('0x10')](_0xd594('0x17'),_0x2b8495[_0xd594('0x12')],_0x232776);_0x3ae9be(_0x4ea0d5[_0xd594('0x10')](0x1f4,_0x2b8495[_0xd594('0x12')]));});});};exports[_0xd594('0x1a')]=function(_0x769cae){var _0x3a6a4e=this;return new Promise(function(_0x16bda7,_0x5c8200){return db[_0xd594('0x1b')][_0xd594('0x1c')](_0x769cae[_0xd594('0x1d')],{'raw':_0x769cae[_0xd594('0x15')]?_0x769cae[_0xd594('0x15')][_0xd594('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x769cae[_0xd594('0x15')]?_0x769cae[_0xd594('0x15')][_0xd594('0x1e')]||null:null,'attributes':_0x769cae['options']?_0x769cae[_0xd594('0x15')][_0xd594('0x1f')]||null:null,'limit':_0x769cae[_0xd594('0x15')]?_0x769cae[_0xd594('0x15')][_0xd594('0x20')]||null:null})[_0xd594('0xa')](function(_0x3cb6b5){logger[_0xd594('0xb')](_0xd594('0x1a'),_0x769cae);logger[_0xd594('0xd')](_0xd594('0x1a'),_0x769cae,JSON[_0xd594('0x18')](_0x3cb6b5));_0x16bda7(_0x3cb6b5);})[_0xd594('0x19')](function(_0x2d93ed){logger[_0xd594('0x10')](_0xd594('0x1a'),_0x2d93ed[_0xd594('0x12')],_0x769cae);_0x5c8200(_0x3a6a4e['error'](0x1f4,_0x2d93ed['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index e7e7677..8c1ae61 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 _0xc030=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','show','post','put','/:id','update','exports','multer'];(function(_0x2ca437,_0x3b4756){var _0x445a98=function(_0x483941){while(--_0x483941){_0x2ca437['push'](_0x2ca437['shift']());}};_0x445a98(++_0x3b4756);}(_0xc030,0xed));var _0x0c03=function(_0x17609f,_0x45c544){_0x17609f=_0x17609f-0x0;var _0x289800=_0xc030[_0x17609f];return _0x289800;};'use strict';var multer=require(_0x0c03('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0c03('0x1'));var express=require(_0x0c03('0x2'));var router=express['Router']();var fs_extra=require(_0x0c03('0x3'));var auth=require(_0x0c03('0x4'));var interaction=require(_0x0c03('0x5'));var config=require(_0x0c03('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0x0c03('0x7')]('/',auth['isAuthenticated'](),controller[_0x0c03('0x8')]);router['get']('/describe',auth[_0x0c03('0x9')](),controller[_0x0c03('0xa')]);router[_0x0c03('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x0c03('0xb')]);router[_0x0c03('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0c03('0xd')](_0x0c03('0xe'),auth[_0x0c03('0x9')](),controller[_0x0c03('0xf')]);router['delete'](_0x0c03('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x0c03('0x10')]=router; \ No newline at end of file +var _0xb4e8=['get','isAuthenticated','index','describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0xb4e8,0x108));var _0x8b4e=function(_0x54c6f7,_0x5ea013){_0x54c6f7=_0x54c6f7-0x0;var _0x1999e0=_0xb4e8[_0x54c6f7];return _0x1999e0;};'use strict';var multer=require('multer');var util=require(_0x8b4e('0x0'));var path=require(_0x8b4e('0x1'));var timeout=require(_0x8b4e('0x2'));var express=require('express');var router=express[_0x8b4e('0x3')]();var fs_extra=require(_0x8b4e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8b4e('0x5'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0x8b4e('0x6')]('/',auth[_0x8b4e('0x7')](),controller[_0x8b4e('0x8')]);router[_0x8b4e('0x6')]('/describe',auth[_0x8b4e('0x7')](),controller[_0x8b4e('0x9')]);router['get'](_0x8b4e('0xa'),auth['isAuthenticated'](),controller[_0x8b4e('0xb')]);router[_0x8b4e('0xc')]('/',auth['isAuthenticated'](),controller[_0x8b4e('0xd')]);router[_0x8b4e('0xe')]('/:id',auth[_0x8b4e('0x7')](),controller['update']);router[_0x8b4e('0xf')](_0x8b4e('0xa'),auth[_0x8b4e('0x7')](),controller[_0x8b4e('0x10')]);module[_0x8b4e('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index cb17311..db9666c 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x4d9412,_0x26ee56){var _0x3f91cb=function(_0x752b85){while(--_0x752b85){_0x4d9412['push'](_0x4d9412['shift']());}};_0x3f91cb(++_0x26ee56);}(_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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x13293a,_0xeb565){var _0x312ddd=function(_0x516dd7){while(--_0x516dd7){_0x13293a['push'](_0x13293a['shift']());}};_0x312ddd(++_0xeb565);}(_0xf4eb,0xec));var _0xbf4e=function(_0x56684e,_0x342eeb){_0x56684e=_0x56684e-0x0;var _0x561c20=_0xf4eb[_0x56684e];return _0x561c20;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 3d61e57..bca8639 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 _0x637d=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','then','destroy','error','stack','name','send','map','OpenchannelTransferReport','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0x637d,0x1e5));var _0xd637=function(_0x25a7c8,_0x922b75){_0x25a7c8=_0x25a7c8-0x0;var _0x44a069=_0x637d[_0x25a7c8];return _0x44a069;};'use strict';var emlformat=require(_0xd637('0x0'));var rimraf=require(_0xd637('0x1'));var zipdir=require(_0xd637('0x2'));var jsonpatch=require(_0xd637('0x3'));var rp=require(_0xd637('0x4'));var moment=require('moment');var BPromise=require(_0xd637('0x5'));var Mustache=require(_0xd637('0x6'));var util=require('util');var path=require(_0xd637('0x7'));var sox=require(_0xd637('0x8'));var csv=require(_0xd637('0x9'));var ejs=require(_0xd637('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd637('0xb'));var squel=require(_0xd637('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd637('0xd'));var toCsv=require(_0xd637('0x9'));var querystring=require(_0xd637('0xe'));var Papa=require(_0xd637('0xf'));var Redis=require('ioredis');var authService=require(_0xd637('0x10'));var qs=require(_0xd637('0x11'));var as=require(_0xd637('0x12'));var hardwareService=require(_0xd637('0x13'));var logger=require(_0xd637('0x14'))(_0xd637('0x15'));var utils=require(_0xd637('0x16'));var config=require(_0xd637('0x17'));var licenseUtil=require(_0xd637('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55bb36,_0x11b39f){_0x11b39f=_0x11b39f||0xcc;return function(_0x37c919){if(_0x37c919){return _0x55bb36['sendStatus'](_0x11b39f);}return _0x55bb36[_0xd637('0x19')](_0x11b39f)[_0xd637('0x1a')]();};}function respondWithResult(_0x564066,_0x59f9fc){_0x59f9fc=_0x59f9fc||0xc8;return function(_0x122eba){if(_0x122eba){return _0x564066[_0xd637('0x19')](_0x59f9fc)[_0xd637('0x1b')](_0x122eba);}};}function respondWithFilteredResult(_0xbcf18c,_0x2fe68b){return function(_0x324152){if(_0x324152){var _0x2511ea=typeof _0x2fe68b[_0xd637('0x1c')]===_0xd637('0x1d')&&typeof _0x2fe68b[_0xd637('0x1e')]===_0xd637('0x1d');var _0x538a8d=_0x324152[_0xd637('0x1f')];var _0x531bfd=_0x2511ea?0x0:_0x2fe68b[_0xd637('0x1c')];var _0x238e71=_0x2511ea?_0x324152[_0xd637('0x1f')]:_0x2fe68b[_0xd637('0x1c')]+_0x2fe68b[_0xd637('0x1e')];var _0x51f682;if(_0x238e71>=_0x538a8d){_0x238e71=_0x538a8d;_0x51f682=0xc8;}else{_0x51f682=0xce;}_0xbcf18c[_0xd637('0x19')](_0x51f682);return _0xbcf18c['set'](_0xd637('0x20'),_0x531bfd+'-'+_0x238e71+'/'+_0x538a8d)[_0xd637('0x1b')](_0x324152);}return null;};}function patchUpdates(_0x5997e0){return function(_0x17f6e1){try{jsonpatch['apply'](_0x17f6e1,_0x5997e0,!![]);}catch(_0x52d12d){return BPromise['reject'](_0x52d12d);}return _0x17f6e1['save']();};}function saveUpdates(_0x37068a,_0x1c462f){return function(_0x3bbe43){if(_0x3bbe43){return _0x3bbe43['update'](_0x37068a)[_0xd637('0x21')](function(_0x194301){return _0x194301;});}return null;};}function removeEntity(_0x499f6e,_0x325fb4){return function(_0x1497a2){if(_0x1497a2){return _0x1497a2[_0xd637('0x22')]()[_0xd637('0x21')](function(){_0x499f6e[_0xd637('0x19')](0xcc)[_0xd637('0x1a')]();});}};}function handleEntityNotFound(_0x3f3d8d,_0x56664c){return function(_0x7c0ac7){if(!_0x7c0ac7){_0x3f3d8d['sendStatus'](0x194);}return _0x7c0ac7;};}function handleError(_0x214648,_0x5c766d){_0x5c766d=_0x5c766d||0x1f4;return function(_0x34925e){logger[_0xd637('0x23')](_0x34925e[_0xd637('0x24')]);if(_0x34925e[_0xd637('0x25')]){delete _0x34925e['name'];}_0x214648[_0xd637('0x19')](_0x5c766d)[_0xd637('0x26')](_0x34925e);};}exports['index']=function(_0x5d3f90,_0xe8ce27){var _0x5e093e={},_0x52f061={},_0x52c2bf={'count':0x0,'rows':[]};var _0x452329=_[_0xd637('0x27')](db[_0xd637('0x28')][_0xd637('0x29')],function(_0x346776){return{'name':_0x346776['fieldName'],'type':_0x346776[_0xd637('0x2a')][_0xd637('0x2b')]};});_0x52f061[_0xd637('0x2c')]=_[_0xd637('0x27')](_0x452329,_0xd637('0x25'));_0x52f061['query']=_[_0xd637('0x2d')](_0x5d3f90[_0xd637('0x2e')]);_0x52f061[_0xd637('0x2f')]=_[_0xd637('0x30')](_0x52f061[_0xd637('0x2c')],_0x52f061[_0xd637('0x2e')]);_0x5e093e['attributes']=_[_0xd637('0x30')](_0x52f061[_0xd637('0x2c')],qs[_0xd637('0x31')](_0x5d3f90[_0xd637('0x2e')]['fields']));_0x5e093e['attributes']=_0x5e093e[_0xd637('0x32')][_0xd637('0x33')]?_0x5e093e[_0xd637('0x32')]:_0x52f061[_0xd637('0x2c')];if(!_0x5d3f90[_0xd637('0x2e')][_0xd637('0x34')](_0xd637('0x35'))){_0x5e093e['limit']=qs['limit'](_0x5d3f90[_0xd637('0x2e')][_0xd637('0x1e')]);_0x5e093e['offset']=qs['offset'](_0x5d3f90['query']['offset']);}_0x5e093e[_0xd637('0x36')]=qs['sort'](_0x5d3f90[_0xd637('0x2e')]['sort']);_0x5e093e['where']=qs[_0xd637('0x2f')](_[_0xd637('0x37')](_0x5d3f90[_0xd637('0x2e')],_0x52f061[_0xd637('0x2f')]),_0x452329);if(_0x5d3f90[_0xd637('0x2e')]['filter']){_0x5e093e[_0xd637('0x38')]=_[_0xd637('0x39')](_0x5e093e[_0xd637('0x38')],{'$or':_['map'](_0x452329,function(_0x212040){if(_0x212040[_0xd637('0x2a')]!=='VIRTUAL'){var _0x5f00ea={};_0x5f00ea[_0x212040[_0xd637('0x25')]]={'$like':'%'+_0x5d3f90[_0xd637('0x2e')][_0xd637('0x3a')]+'%'};return _0x5f00ea;}})});}_0x5e093e=_[_0xd637('0x39')]({},_0x5e093e,_0x5d3f90[_0xd637('0x3b')]);var _0x3ded76={'where':_0x5e093e[_0xd637('0x38')]};return db[_0xd637('0x28')][_0xd637('0x1f')](_0x3ded76)[_0xd637('0x21')](function(_0x56cfa6){_0x52c2bf[_0xd637('0x1f')]=_0x56cfa6;if(_0x5d3f90['query'][_0xd637('0x3c')]){_0x5e093e[_0xd637('0x3d')]=[{'all':!![]}];}return db[_0xd637('0x28')][_0xd637('0x3e')](_0x5e093e);})[_0xd637('0x21')](function(_0x1aac1e){_0x52c2bf[_0xd637('0x3f')]=_0x1aac1e;return _0x52c2bf;})[_0xd637('0x21')](respondWithFilteredResult(_0xe8ce27,_0x5e093e))[_0xd637('0x40')](handleError(_0xe8ce27,null));};exports[_0xd637('0x41')]=function(_0x296912,_0x4c2d68){var _0x4ee79b={'raw':!![],'where':{'id':_0x296912['params']['id']}},_0xc5bfd={};_0xc5bfd[_0xd637('0x2c')]=_[_0xd637('0x2d')](db[_0xd637('0x28')][_0xd637('0x29')]);_0xc5bfd[_0xd637('0x2e')]=_[_0xd637('0x2d')](_0x296912[_0xd637('0x2e')]);_0xc5bfd['filters']=_['intersection'](_0xc5bfd[_0xd637('0x2c')],_0xc5bfd['query']);_0x4ee79b[_0xd637('0x32')]=_[_0xd637('0x30')](_0xc5bfd[_0xd637('0x2c')],qs[_0xd637('0x31')](_0x296912[_0xd637('0x2e')][_0xd637('0x31')]));_0x4ee79b['attributes']=_0x4ee79b['attributes'][_0xd637('0x33')]?_0x4ee79b[_0xd637('0x32')]:_0xc5bfd[_0xd637('0x2c')];if(_0x296912[_0xd637('0x2e')]['includeAll']){_0x4ee79b[_0xd637('0x3d')]=[{'all':!![]}];}_0x4ee79b=_[_0xd637('0x39')]({},_0x4ee79b,_0x296912[_0xd637('0x3b')]);return db[_0xd637('0x28')][_0xd637('0x42')](_0x4ee79b)[_0xd637('0x21')](handleEntityNotFound(_0x4c2d68,null))[_0xd637('0x21')](respondWithResult(_0x4c2d68,null))[_0xd637('0x40')](handleError(_0x4c2d68,null));};exports[_0xd637('0x43')]=function(_0x245e58,_0x7a5988){return db['OpenchannelTransferReport']['create'](_0x245e58[_0xd637('0x44')],{})[_0xd637('0x21')](respondWithResult(_0x7a5988,0xc9))[_0xd637('0x40')](handleError(_0x7a5988,null));};exports[_0xd637('0x45')]=function(_0x33f722,_0x28ab9d){if(_0x33f722[_0xd637('0x44')]['id']){delete _0x33f722[_0xd637('0x44')]['id'];}return db[_0xd637('0x28')][_0xd637('0x42')]({'where':{'id':_0x33f722[_0xd637('0x46')]['id']}})[_0xd637('0x21')](handleEntityNotFound(_0x28ab9d,null))[_0xd637('0x21')](saveUpdates(_0x33f722[_0xd637('0x44')],null))[_0xd637('0x21')](respondWithResult(_0x28ab9d,null))[_0xd637('0x40')](handleError(_0x28ab9d,null));};exports[_0xd637('0x22')]=function(_0x1d67a2,_0x7351f7){return db[_0xd637('0x28')][_0xd637('0x42')]({'where':{'id':_0x1d67a2[_0xd637('0x46')]['id']}})[_0xd637('0x21')](handleEntityNotFound(_0x7351f7,null))[_0xd637('0x21')](removeEntity(_0x7351f7,null))[_0xd637('0x40')](handleError(_0x7351f7,null));};exports[_0xd637('0x47')]=function(_0x4114d8,_0x3a0cf4){return db[_0xd637('0x28')][_0xd637('0x47')]()[_0xd637('0x21')](respondWithResult(_0x3a0cf4,null))[_0xd637('0x40')](handleError(_0x3a0cf4,null));}; \ No newline at end of file +var _0x2a71=['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','sendStatus','status','end','offset','limit','undefined','count','set','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','options','OpenchannelTransferReport','include','findAll','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x4ef2b1,_0x1f4854){var _0x34a4c4=function(_0x3901bd){while(--_0x3901bd){_0x4ef2b1['push'](_0x4ef2b1['shift']());}};_0x34a4c4(++_0x1f4854);}(_0x2a71,0xdc));var _0x12a7=function(_0x295049,_0x59246e){_0x295049=_0x295049-0x0;var _0x4c1452=_0x2a71[_0x295049];return _0x4c1452;};'use strict';var emlformat=require(_0x12a7('0x0'));var rimraf=require(_0x12a7('0x1'));var zipdir=require(_0x12a7('0x2'));var jsonpatch=require(_0x12a7('0x3'));var rp=require(_0x12a7('0x4'));var moment=require(_0x12a7('0x5'));var BPromise=require(_0x12a7('0x6'));var Mustache=require(_0x12a7('0x7'));var util=require(_0x12a7('0x8'));var path=require(_0x12a7('0x9'));var sox=require(_0x12a7('0xa'));var csv=require(_0x12a7('0xb'));var ejs=require(_0x12a7('0xc'));var fs=require('fs');var fs_extra=require(_0x12a7('0xd'));var _=require(_0x12a7('0xe'));var squel=require(_0x12a7('0xf'));var crypto=require('crypto');var jsforce=require(_0x12a7('0x10'));var deskjs=require(_0x12a7('0x11'));var toCsv=require('to-csv');var querystring=require(_0x12a7('0x12'));var Papa=require(_0x12a7('0x13'));var Redis=require(_0x12a7('0x14'));var authService=require(_0x12a7('0x15'));var qs=require(_0x12a7('0x16'));var as=require(_0x12a7('0x17'));var hardwareService=require(_0x12a7('0x18'));var logger=require(_0x12a7('0x19'))(_0x12a7('0x1a'));var utils=require('../../config/utils');var config=require(_0x12a7('0x1b'));var licenseUtil=require(_0x12a7('0x1c'));var db=require(_0x12a7('0x1d'))['db'];function respondWithStatusCode(_0x38790e,_0x5710c7){_0x5710c7=_0x5710c7||0xcc;return function(_0x1fe392){if(_0x1fe392){return _0x38790e[_0x12a7('0x1e')](_0x5710c7);}return _0x38790e[_0x12a7('0x1f')](_0x5710c7)[_0x12a7('0x20')]();};}function respondWithResult(_0x183e01,_0x3349de){_0x3349de=_0x3349de||0xc8;return function(_0x111e55){if(_0x111e55){return _0x183e01[_0x12a7('0x1f')](_0x3349de)['json'](_0x111e55);}};}function respondWithFilteredResult(_0x41cc2c,_0xbb58a5){return function(_0x16bbb9){if(_0x16bbb9){var _0x1ccb3f=typeof _0xbb58a5[_0x12a7('0x21')]==='undefined'&&typeof _0xbb58a5[_0x12a7('0x22')]===_0x12a7('0x23');var _0x50d39c=_0x16bbb9[_0x12a7('0x24')];var _0x27a139=_0x1ccb3f?0x0:_0xbb58a5['offset'];var _0x1b0aab=_0x1ccb3f?_0x16bbb9[_0x12a7('0x24')]:_0xbb58a5[_0x12a7('0x21')]+_0xbb58a5[_0x12a7('0x22')];var _0x5d04a9;if(_0x1b0aab>=_0x50d39c){_0x1b0aab=_0x50d39c;_0x5d04a9=0xc8;}else{_0x5d04a9=0xce;}_0x41cc2c['status'](_0x5d04a9);return _0x41cc2c[_0x12a7('0x25')]('Content-Range',_0x27a139+'-'+_0x1b0aab+'/'+_0x50d39c)['json'](_0x16bbb9);}return null;};}function patchUpdates(_0x4b137a){return function(_0xbfaf33){try{jsonpatch['apply'](_0xbfaf33,_0x4b137a,!![]);}catch(_0x4e62c3){return BPromise['reject'](_0x4e62c3);}return _0xbfaf33[_0x12a7('0x26')]();};}function saveUpdates(_0x572da4,_0xfce2f){return function(_0x2f6085){if(_0x2f6085){return _0x2f6085[_0x12a7('0x27')](_0x572da4)[_0x12a7('0x28')](function(_0x88f4b0){return _0x88f4b0;});}return null;};}function removeEntity(_0x4124ab,_0x38e614){return function(_0x414e43){if(_0x414e43){return _0x414e43[_0x12a7('0x29')]()[_0x12a7('0x28')](function(){_0x4124ab[_0x12a7('0x1f')](0xcc)[_0x12a7('0x20')]();});}};}function handleEntityNotFound(_0x215627,_0x37e334){return function(_0x2b7aad){if(!_0x2b7aad){_0x215627[_0x12a7('0x1e')](0x194);}return _0x2b7aad;};}function handleError(_0x4540ff,_0x267d88){_0x267d88=_0x267d88||0x1f4;return function(_0x4e304e){logger[_0x12a7('0x2a')](_0x4e304e[_0x12a7('0x2b')]);if(_0x4e304e[_0x12a7('0x2c')]){delete _0x4e304e[_0x12a7('0x2c')];}_0x4540ff[_0x12a7('0x1f')](_0x267d88)[_0x12a7('0x2d')](_0x4e304e);};}exports['index']=function(_0x1d09fd,_0xa96ac0){var _0x19bedc={},_0x1ba4ad={},_0x38773f={'count':0x0,'rows':[]};var _0x3ef5c=_[_0x12a7('0x2e')](db['OpenchannelTransferReport'][_0x12a7('0x2f')],function(_0x471479){return{'name':_0x471479['fieldName'],'type':_0x471479[_0x12a7('0x30')][_0x12a7('0x31')]};});_0x1ba4ad[_0x12a7('0x32')]=_[_0x12a7('0x2e')](_0x3ef5c,_0x12a7('0x2c'));_0x1ba4ad[_0x12a7('0x33')]=_['keys'](_0x1d09fd[_0x12a7('0x33')]);_0x1ba4ad['filters']=_['intersection'](_0x1ba4ad[_0x12a7('0x32')],_0x1ba4ad['query']);_0x19bedc[_0x12a7('0x34')]=_['intersection'](_0x1ba4ad[_0x12a7('0x32')],qs[_0x12a7('0x35')](_0x1d09fd[_0x12a7('0x33')][_0x12a7('0x35')]));_0x19bedc[_0x12a7('0x34')]=_0x19bedc['attributes'][_0x12a7('0x36')]?_0x19bedc[_0x12a7('0x34')]:_0x1ba4ad[_0x12a7('0x32')];if(!_0x1d09fd[_0x12a7('0x33')][_0x12a7('0x37')](_0x12a7('0x38'))){_0x19bedc[_0x12a7('0x22')]=qs['limit'](_0x1d09fd[_0x12a7('0x33')]['limit']);_0x19bedc['offset']=qs[_0x12a7('0x21')](_0x1d09fd[_0x12a7('0x33')][_0x12a7('0x21')]);}_0x19bedc[_0x12a7('0x39')]=qs['sort'](_0x1d09fd[_0x12a7('0x33')]['sort']);_0x19bedc['where']=qs[_0x12a7('0x3a')](_[_0x12a7('0x3b')](_0x1d09fd[_0x12a7('0x33')],_0x1ba4ad[_0x12a7('0x3a')]),_0x3ef5c);if(_0x1d09fd[_0x12a7('0x33')][_0x12a7('0x3c')]){_0x19bedc[_0x12a7('0x3d')]=_[_0x12a7('0x3e')](_0x19bedc[_0x12a7('0x3d')],{'$or':_[_0x12a7('0x2e')](_0x3ef5c,function(_0x327140){if(_0x327140['type']!==_0x12a7('0x3f')){var _0x30fd13={};_0x30fd13[_0x327140[_0x12a7('0x2c')]]={'$like':'%'+_0x1d09fd[_0x12a7('0x33')][_0x12a7('0x3c')]+'%'};return _0x30fd13;}})});}_0x19bedc=_['merge']({},_0x19bedc,_0x1d09fd[_0x12a7('0x40')]);var _0x430061={'where':_0x19bedc['where']};return db[_0x12a7('0x41')]['count'](_0x430061)[_0x12a7('0x28')](function(_0x67cc55){_0x38773f['count']=_0x67cc55;if(_0x1d09fd[_0x12a7('0x33')]['includeAll']){_0x19bedc[_0x12a7('0x42')]=[{'all':!![]}];}return db[_0x12a7('0x41')][_0x12a7('0x43')](_0x19bedc);})['then'](function(_0x549e09){_0x38773f['rows']=_0x549e09;return _0x38773f;})['then'](respondWithFilteredResult(_0xa96ac0,_0x19bedc))[_0x12a7('0x44')](handleError(_0xa96ac0,null));};exports[_0x12a7('0x45')]=function(_0x155906,_0xa04c42){var _0x19a6a9={'raw':!![],'where':{'id':_0x155906[_0x12a7('0x46')]['id']}},_0x5c6c35={};_0x5c6c35['model']=_[_0x12a7('0x47')](db[_0x12a7('0x41')][_0x12a7('0x2f')]);_0x5c6c35['query']=_[_0x12a7('0x47')](_0x155906['query']);_0x5c6c35[_0x12a7('0x3a')]=_['intersection'](_0x5c6c35[_0x12a7('0x32')],_0x5c6c35[_0x12a7('0x33')]);_0x19a6a9[_0x12a7('0x34')]=_['intersection'](_0x5c6c35[_0x12a7('0x32')],qs[_0x12a7('0x35')](_0x155906[_0x12a7('0x33')][_0x12a7('0x35')]));_0x19a6a9['attributes']=_0x19a6a9['attributes']['length']?_0x19a6a9['attributes']:_0x5c6c35[_0x12a7('0x32')];if(_0x155906[_0x12a7('0x33')][_0x12a7('0x48')]){_0x19a6a9['include']=[{'all':!![]}];}_0x19a6a9=_[_0x12a7('0x3e')]({},_0x19a6a9,_0x155906[_0x12a7('0x40')]);return db[_0x12a7('0x41')][_0x12a7('0x49')](_0x19a6a9)[_0x12a7('0x28')](handleEntityNotFound(_0xa04c42,null))[_0x12a7('0x28')](respondWithResult(_0xa04c42,null))['catch'](handleError(_0xa04c42,null));};exports[_0x12a7('0x4a')]=function(_0x121186,_0x1cbcbe){return db['OpenchannelTransferReport']['create'](_0x121186[_0x12a7('0x4b')],{})[_0x12a7('0x28')](respondWithResult(_0x1cbcbe,0xc9))[_0x12a7('0x44')](handleError(_0x1cbcbe,null));};exports[_0x12a7('0x27')]=function(_0x3fef79,_0x1818e6){if(_0x3fef79[_0x12a7('0x4b')]['id']){delete _0x3fef79[_0x12a7('0x4b')]['id'];}return db[_0x12a7('0x41')][_0x12a7('0x49')]({'where':{'id':_0x3fef79[_0x12a7('0x46')]['id']}})[_0x12a7('0x28')](handleEntityNotFound(_0x1818e6,null))[_0x12a7('0x28')](saveUpdates(_0x3fef79['body'],null))[_0x12a7('0x28')](respondWithResult(_0x1818e6,null))[_0x12a7('0x44')](handleError(_0x1818e6,null));};exports[_0x12a7('0x29')]=function(_0x20ffdf,_0x34a07b){return db['OpenchannelTransferReport'][_0x12a7('0x49')]({'where':{'id':_0x20ffdf[_0x12a7('0x46')]['id']}})['then'](handleEntityNotFound(_0x34a07b,null))['then'](removeEntity(_0x34a07b,null))[_0x12a7('0x44')](handleError(_0x34a07b,null));};exports[_0x12a7('0x4c')]=function(_0x194e49,_0x2f0ed7){return db[_0x12a7('0x41')][_0x12a7('0x4c')]()[_0x12a7('0x28')](respondWithResult(_0x2f0ed7,null))[_0x12a7('0x44')](handleError(_0x2f0ed7,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 8a2ac7a..945e3a3 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 _0xf8da=['../../config/environment','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x48cd34,_0x2cd750){var _0x590e2a=function(_0x1d2e10){while(--_0x1d2e10){_0x48cd34['push'](_0x48cd34['shift']());}};_0x590e2a(++_0x2cd750);}(_0xf8da,0x9d));var _0xaf8d=function(_0x1991bd,_0x664708){_0x1991bd=_0x1991bd-0x0;var _0x20c045=_0xf8da[_0x1991bd];return _0x20c045;};'use strict';var _=require(_0xaf8d('0x0'));var util=require(_0xaf8d('0x1'));var logger=require(_0xaf8d('0x2'))(_0xaf8d('0x3'));var moment=require(_0xaf8d('0x4'));var BPromise=require(_0xaf8d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf8d('0x6'));var rimraf=require(_0xaf8d('0x7'));var config=require(_0xaf8d('0x8'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x51eadd,_0x3cc7e5){return _0x51eadd['define'](_0xaf8d('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xaf8d('0xa'),'fields':[_0xaf8d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde71=['report_openchannel_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport'];(function(_0x53d2f6,_0x2a467a){var _0x5b6b27=function(_0x18e10c){while(--_0x18e10c){_0x53d2f6['push'](_0x53d2f6['shift']());}};_0x5b6b27(++_0x2a467a);}(_0xde71,0x17c));var _0x1de7=function(_0x46f3f8,_0x12c74b){_0x46f3f8=_0x46f3f8-0x0;var _0xbc57cd=_0xde71[_0x46f3f8];return _0xbc57cd;};'use strict';var _=require(_0x1de7('0x0'));var util=require(_0x1de7('0x1'));var logger=require('../../config/logger')(_0x1de7('0x2'));var moment=require(_0x1de7('0x3'));var BPromise=require(_0x1de7('0x4'));var rp=require(_0x1de7('0x5'));var fs=require('fs');var path=require(_0x1de7('0x6'));var rimraf=require(_0x1de7('0x7'));var config=require(_0x1de7('0x8'));var attributes=require(_0x1de7('0x9'));module[_0x1de7('0xa')]=function(_0x13f34a,_0x120695){return _0x13f34a['define'](_0x1de7('0xb'),attributes,{'tableName':_0x1de7('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1de7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index f451f05..46bf15b 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 _0x3edc=['request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x217139,_0x5cf401){var _0x30ea76=function(_0xc78ec5){while(--_0xc78ec5){_0x217139['push'](_0x217139['shift']());}};_0x30ea76(++_0x5cf401);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x270891,_0xc0f01b){_0x270891=_0x270891-0x0;var _0x1faad7=_0x3edc[_0x270891];return _0x1faad7;};'use strict';var _=require(_0xc3ed('0x0'));var util=require(_0xc3ed('0x1'));var moment=require(_0xc3ed('0x2'));var BPromise=require(_0xc3ed('0x3'));var rs=require(_0xc3ed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3ed('0x6'))(_0xc3ed('0x7'));var config=require(_0xc3ed('0x8'));var jayson=require(_0xc3ed('0x9'));var client=jayson[_0xc3ed('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b28d4,_0x323058,_0x14d194){return new BPromise(function(_0x2f28ce,_0x13999f){return client[_0xc3ed('0xb')](_0x1b28d4,_0x14d194)['then'](function(_0x81590e){logger[_0xc3ed('0xc')](_0xc3ed('0xd'),_0x323058,'request\x20sent');logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x323058,_0xc3ed('0xe'),JSON[_0xc3ed('0xf')](_0x81590e));if(_0x81590e[_0xc3ed('0x10')]){if(_0x81590e[_0xc3ed('0x10')][_0xc3ed('0x11')]===0x1f4){logger[_0xc3ed('0x10')](_0xc3ed('0xd'),_0x323058,_0x81590e[_0xc3ed('0x10')][_0xc3ed('0x12')]);return _0x13999f(_0x81590e[_0xc3ed('0x10')]['message']);}logger[_0xc3ed('0x10')](_0xc3ed('0xd'),_0x323058,_0x81590e[_0xc3ed('0x10')][_0xc3ed('0x12')]);return _0x2f28ce(_0x81590e['error']['message']);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x323058,_0xc3ed('0xe'));_0x2f28ce(_0x81590e[_0xc3ed('0x13')]['message']);}})[_0xc3ed('0x14')](function(_0x15eb2e){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x323058,_0x15eb2e);_0x13999f(_0x15eb2e);});});} \ No newline at end of file +var _0xf776=['error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4bcc4c,_0x2ab231){var _0x4465ec=function(_0x3e0750){while(--_0x3e0750){_0x4bcc4c['push'](_0x4bcc4c['shift']());}};_0x4465ec(++_0x2ab231);}(_0xf776,0x169));var _0x6f77=function(_0x18bfad,_0x2593ff){_0x18bfad=_0x18bfad-0x0;var _0x59ed95=_0xf776[_0x18bfad];return _0x59ed95;};'use strict';var _=require(_0x6f77('0x0'));var util=require('util');var moment=require(_0x6f77('0x1'));var BPromise=require(_0x6f77('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f77('0x3'));var db=require(_0x6f77('0x4'))['db'];var utils=require(_0x6f77('0x5'));var logger=require(_0x6f77('0x6'))('rpc');var config=require(_0x6f77('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6f77('0x8')][_0x6f77('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36ffd2,_0x18a937,_0x545ba9){return new BPromise(function(_0x1dd52f,_0x5a83ba){return client[_0x6f77('0xa')](_0x36ffd2,_0x545ba9)[_0x6f77('0xb')](function(_0x14ea05){logger[_0x6f77('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x18a937,_0x6f77('0xd'));logger[_0x6f77('0xe')](_0x6f77('0xf'),_0x18a937,_0x6f77('0xd'),JSON[_0x6f77('0x10')](_0x14ea05));if(_0x14ea05[_0x6f77('0x11')]){if(_0x14ea05['error'][_0x6f77('0x12')]===0x1f4){logger[_0x6f77('0x11')](_0x6f77('0x13'),_0x18a937,_0x14ea05[_0x6f77('0x11')][_0x6f77('0x14')]);return _0x5a83ba(_0x14ea05[_0x6f77('0x11')][_0x6f77('0x14')]);}logger[_0x6f77('0x11')](_0x6f77('0x13'),_0x18a937,_0x14ea05[_0x6f77('0x11')][_0x6f77('0x14')]);return _0x1dd52f(_0x14ea05[_0x6f77('0x11')]['message']);}else{logger['info'](_0x6f77('0x13'),_0x18a937,_0x6f77('0xd'));_0x1dd52f(_0x14ea05['result'][_0x6f77('0x14')]);}})['catch'](function(_0xf36aa2){logger[_0x6f77('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x18a937,_0xf36aa2);_0x5a83ba(_0xf36aa2);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index bd74572..9916bda 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 _0x6e14=['util','connect-timeout','Router','fs-extra','../../config/environment','./pause.controller','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x274283,_0x2e0d24){var _0x23756a=function(_0x56c153){while(--_0x56c153){_0x274283['push'](_0x274283['shift']());}};_0x23756a(++_0x2e0d24);}(_0x6e14,0x15f));var _0x46e1=function(_0x1c8b8c,_0x742e59){_0x1c8b8c=_0x1c8b8c-0x0;var _0x49bc36=_0x6e14[_0x1c8b8c];return _0x49bc36;};'use strict';var multer=require(_0x46e1('0x0'));var util=require(_0x46e1('0x1'));var path=require('path');var timeout=require(_0x46e1('0x2'));var express=require('express');var router=express[_0x46e1('0x3')]();var fs_extra=require(_0x46e1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x46e1('0x5'));var controller=require(_0x46e1('0x6'));router['get']('/',auth[_0x46e1('0x7')](),controller['index']);router['get'](_0x46e1('0x8'),auth[_0x46e1('0x7')](),controller[_0x46e1('0x9')]);router[_0x46e1('0xa')]('/',auth[_0x46e1('0x7')](),controller['create']);router[_0x46e1('0xb')](_0x46e1('0x8'),auth[_0x46e1('0x7')](),controller[_0x46e1('0xc')]);router[_0x46e1('0xd')](_0x46e1('0x8'),auth[_0x46e1('0x7')](),controller[_0x46e1('0xe')]);module[_0x46e1('0xf')]=router; \ No newline at end of file +var _0xd9ac=['get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment'];(function(_0x3d01e4,_0x41546e){var _0x440197=function(_0x229ab7){while(--_0x229ab7){_0x3d01e4['push'](_0x3d01e4['shift']());}};_0x440197(++_0x41546e);}(_0xd9ac,0xd6));var _0xcd9a=function(_0x24dd6a,_0x2a92a5){_0x24dd6a=_0x24dd6a-0x0;var _0x326f88=_0xd9ac[_0x24dd6a];return _0x326f88;};'use strict';var multer=require(_0xcd9a('0x0'));var util=require(_0xcd9a('0x1'));var path=require(_0xcd9a('0x2'));var timeout=require('connect-timeout');var express=require(_0xcd9a('0x3'));var router=express[_0xcd9a('0x4')]();var fs_extra=require(_0xcd9a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcd9a('0x6'));var controller=require('./pause.controller');router[_0xcd9a('0x7')]('/',auth[_0xcd9a('0x8')](),controller[_0xcd9a('0x9')]);router['get'](_0xcd9a('0xa'),auth[_0xcd9a('0x8')](),controller[_0xcd9a('0xb')]);router[_0xcd9a('0xc')]('/',auth[_0xcd9a('0x8')](),controller[_0xcd9a('0xd')]);router['put'](_0xcd9a('0xa'),auth[_0xcd9a('0x8')](),controller['update']);router[_0xcd9a('0xe')](_0xcd9a('0xa'),auth[_0xcd9a('0x8')](),controller[_0xcd9a('0xf')]);module[_0xcd9a('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 703ecab..1af0c2a 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 _0x07f4=['name','sequelize','exports','STRING'];(function(_0x2d5b1b,_0x41399a){var _0x4a2ee4=function(_0x26a7e1){while(--_0x26a7e1){_0x2d5b1b['push'](_0x2d5b1b['shift']());}};_0x4a2ee4(++_0x41399a);}(_0x07f4,0x189));var _0x407f=function(_0x20ae52,_0x5be870){_0x20ae52=_0x20ae52-0x0;var _0x9de7e8=_0x07f4[_0x20ae52];return _0x9de7e8;};'use strict';var Sequelize=require(_0x407f('0x0'));module[_0x407f('0x1')]={'name':{'type':Sequelize[_0x407f('0x2')],'unique':_0x407f('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5591=['sequelize','STRING','name'];(function(_0x57c1cd,_0x5c02a0){var _0x28556c=function(_0x567119){while(--_0x567119){_0x57c1cd['push'](_0x57c1cd['shift']());}};_0x28556c(++_0x5c02a0);}(_0x5591,0x12f));var _0x1559=function(_0x23e999,_0x11297a){_0x23e999=_0x23e999-0x0;var _0xedb644=_0x5591[_0x23e999];return _0xedb644;};'use strict';var Sequelize=require(_0x1559('0x0'));module['exports']={'name':{'type':Sequelize[_0x1559('0x1')],'unique':_0x1559('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1559('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 9bff91d..d90370e 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 _0xa86b=['find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','stack','send','map','Pause','rawAttributes','fieldName','type','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x359fe4,_0x50f9e4){var _0x32e4a3=function(_0x402764){while(--_0x402764){_0x359fe4['push'](_0x359fe4['shift']());}};_0x32e4a3(++_0x50f9e4);}(_0xa86b,0x1a5));var _0xba86=function(_0x1a5ff1,_0x2f8112){_0x1a5ff1=_0x1a5ff1-0x0;var _0x560120=_0xa86b[_0x1a5ff1];return _0x560120;};'use strict';var emlformat=require(_0xba86('0x0'));var rimraf=require(_0xba86('0x1'));var zipdir=require(_0xba86('0x2'));var jsonpatch=require(_0xba86('0x3'));var rp=require(_0xba86('0x4'));var moment=require(_0xba86('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xba86('0x6'));var util=require(_0xba86('0x7'));var path=require('path');var sox=require(_0xba86('0x8'));var csv=require(_0xba86('0x9'));var ejs=require(_0xba86('0xa'));var fs=require('fs');var fs_extra=require(_0xba86('0xb'));var _=require(_0xba86('0xc'));var squel=require(_0xba86('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba86('0xe'));var toCsv=require(_0xba86('0x9'));var querystring=require(_0xba86('0xf'));var Papa=require(_0xba86('0x10'));var Redis=require(_0xba86('0x11'));var authService=require(_0xba86('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xba86('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba86('0x14'))(_0xba86('0x15'));var utils=require('../../config/utils');var config=require(_0xba86('0x16'));var licenseUtil=require(_0xba86('0x17'));var db=require(_0xba86('0x18'))['db'];function respondWithStatusCode(_0xa47291,_0x105e74){_0x105e74=_0x105e74||0xcc;return function(_0x1c6483){if(_0x1c6483){return _0xa47291[_0xba86('0x19')](_0x105e74);}return _0xa47291[_0xba86('0x1a')](_0x105e74)[_0xba86('0x1b')]();};}function respondWithResult(_0x630762,_0x2120c5){_0x2120c5=_0x2120c5||0xc8;return function(_0x4bdabb){if(_0x4bdabb){return _0x630762[_0xba86('0x1a')](_0x2120c5)['json'](_0x4bdabb);}};}function respondWithFilteredResult(_0x2e0e0e,_0xe03f9){return function(_0xd2f921){if(_0xd2f921){var _0x1a7b3a=typeof _0xe03f9[_0xba86('0x1c')]===_0xba86('0x1d')&&typeof _0xe03f9['limit']==='undefined';var _0x13ec2a=_0xd2f921[_0xba86('0x1e')];var _0x347813=_0x1a7b3a?0x0:_0xe03f9[_0xba86('0x1c')];var _0x174aaf=_0x1a7b3a?_0xd2f921[_0xba86('0x1e')]:_0xe03f9[_0xba86('0x1c')]+_0xe03f9[_0xba86('0x1f')];var _0x58e236;if(_0x174aaf>=_0x13ec2a){_0x174aaf=_0x13ec2a;_0x58e236=0xc8;}else{_0x58e236=0xce;}_0x2e0e0e[_0xba86('0x1a')](_0x58e236);return _0x2e0e0e[_0xba86('0x20')](_0xba86('0x21'),_0x347813+'-'+_0x174aaf+'/'+_0x13ec2a)[_0xba86('0x22')](_0xd2f921);}return null;};}function patchUpdates(_0x3baa13){return function(_0x8f2e37){try{jsonpatch[_0xba86('0x23')](_0x8f2e37,_0x3baa13,!![]);}catch(_0x3bb47c){return BPromise[_0xba86('0x24')](_0x3bb47c);}return _0x8f2e37[_0xba86('0x25')]();};}function saveUpdates(_0x422f37,_0x1c941d){return function(_0x5a18ba){if(_0x5a18ba){return _0x5a18ba[_0xba86('0x26')](_0x422f37)[_0xba86('0x27')](function(_0xb65196){return _0xb65196;});}return null;};}function removeEntity(_0x5cda1b,_0x1bded0){return function(_0x125dfd){if(_0x125dfd){return _0x125dfd[_0xba86('0x28')]()['then'](function(){var _0x56a223=_0x125dfd[_0xba86('0x29')]({'plain':!![]});var _0x45c12c=_0xba86('0x2a');return db[_0xba86('0x2b')][_0xba86('0x28')]({'where':{'type':_0x45c12c,'resourceId':_0x56a223['id']}})['then'](function(){return _0x125dfd;});})[_0xba86('0x27')](function(){_0x5cda1b[_0xba86('0x1a')](0xcc)[_0xba86('0x1b')]();});}};}function handleEntityNotFound(_0x3364de,_0x506888){return function(_0xc0007a){if(!_0xc0007a){_0x3364de[_0xba86('0x19')](0x194);}return _0xc0007a;};}function handleError(_0x382b03,_0x1395a1){_0x1395a1=_0x1395a1||0x1f4;return function(_0x188e3f){logger['error'](_0x188e3f[_0xba86('0x2c')]);if(_0x188e3f['name']){delete _0x188e3f['name'];}_0x382b03[_0xba86('0x1a')](_0x1395a1)[_0xba86('0x2d')](_0x188e3f);};}exports['index']=function(_0x122ef2,_0x14b908){var _0x4ee87f={},_0x1d6b02={},_0x575f1e={'count':0x0,'rows':[]};var _0x175aac=_[_0xba86('0x2e')](db[_0xba86('0x2f')][_0xba86('0x30')],function(_0x40f510){return{'name':_0x40f510[_0xba86('0x31')],'type':_0x40f510[_0xba86('0x32')]['key']};});_0x1d6b02['model']=_[_0xba86('0x2e')](_0x175aac,_0xba86('0x33'));_0x1d6b02[_0xba86('0x34')]=_[_0xba86('0x35')](_0x122ef2[_0xba86('0x34')]);_0x1d6b02[_0xba86('0x36')]=_['intersection'](_0x1d6b02[_0xba86('0x37')],_0x1d6b02['query']);_0x4ee87f[_0xba86('0x38')]=_[_0xba86('0x39')](_0x1d6b02[_0xba86('0x37')],qs['fields'](_0x122ef2[_0xba86('0x34')][_0xba86('0x3a')]));_0x4ee87f[_0xba86('0x38')]=_0x4ee87f['attributes'][_0xba86('0x3b')]?_0x4ee87f[_0xba86('0x38')]:_0x1d6b02['model'];if(!_0x122ef2[_0xba86('0x34')][_0xba86('0x3c')]('nolimit')){_0x4ee87f[_0xba86('0x1f')]=qs['limit'](_0x122ef2['query'][_0xba86('0x1f')]);_0x4ee87f['offset']=qs['offset'](_0x122ef2['query']['offset']);}_0x4ee87f[_0xba86('0x3d')]=qs[_0xba86('0x3e')](_0x122ef2['query'][_0xba86('0x3e')]);_0x4ee87f[_0xba86('0x3f')]=qs['filters'](_[_0xba86('0x40')](_0x122ef2[_0xba86('0x34')],_0x1d6b02[_0xba86('0x36')]),_0x175aac);if(_0x122ef2[_0xba86('0x34')][_0xba86('0x41')]){_0x4ee87f['where']=_[_0xba86('0x42')](_0x4ee87f[_0xba86('0x3f')],{'$or':_[_0xba86('0x2e')](_0x175aac,function(_0x552536){if(_0x552536[_0xba86('0x32')]!==_0xba86('0x43')){var _0x2edcff={};_0x2edcff[_0x552536[_0xba86('0x33')]]={'$like':'%'+_0x122ef2[_0xba86('0x34')][_0xba86('0x41')]+'%'};return _0x2edcff;}})});}_0x4ee87f=_[_0xba86('0x42')]({},_0x4ee87f,_0x122ef2[_0xba86('0x44')]);var _0x1df6a0={'where':_0x4ee87f[_0xba86('0x3f')]};return db[_0xba86('0x2f')]['count'](_0x1df6a0)['then'](function(_0x18107a){_0x575f1e[_0xba86('0x1e')]=_0x18107a;if(_0x122ef2[_0xba86('0x34')][_0xba86('0x45')]){_0x4ee87f[_0xba86('0x46')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x4ee87f);})[_0xba86('0x27')](function(_0x2cf78f){_0x575f1e['rows']=_0x2cf78f;return _0x575f1e;})[_0xba86('0x27')](respondWithFilteredResult(_0x14b908,_0x4ee87f))['catch'](handleError(_0x14b908,null));};exports['show']=function(_0x24f5db,_0x39fbe6){var _0x55324f={'raw':!![],'where':{'id':_0x24f5db['params']['id']}},_0x286e86={};_0x286e86[_0xba86('0x37')]=_['keys'](db[_0xba86('0x2f')]['rawAttributes']);_0x286e86['query']=_[_0xba86('0x35')](_0x24f5db[_0xba86('0x34')]);_0x286e86[_0xba86('0x36')]=_[_0xba86('0x39')](_0x286e86[_0xba86('0x37')],_0x286e86[_0xba86('0x34')]);_0x55324f[_0xba86('0x38')]=_[_0xba86('0x39')](_0x286e86['model'],qs[_0xba86('0x3a')](_0x24f5db[_0xba86('0x34')][_0xba86('0x3a')]));_0x55324f['attributes']=_0x55324f[_0xba86('0x38')]['length']?_0x55324f[_0xba86('0x38')]:_0x286e86['model'];if(_0x24f5db[_0xba86('0x34')]['includeAll']){_0x55324f[_0xba86('0x46')]=[{'all':!![]}];}_0x55324f=_['merge']({},_0x55324f,_0x24f5db[_0xba86('0x44')]);return db[_0xba86('0x2f')][_0xba86('0x47')](_0x55324f)[_0xba86('0x27')](handleEntityNotFound(_0x39fbe6,null))[_0xba86('0x27')](respondWithResult(_0x39fbe6,null))[_0xba86('0x48')](handleError(_0x39fbe6,null));};exports['create']=function(_0x235f45,_0xafe5af){return db['Pause']['create'](_0x235f45[_0xba86('0x49')],{})['then'](function(_0x39c6ac){var _0x2b2dd9=_0x235f45[_0xba86('0x4a')][_0xba86('0x29')]({'plain':!![]});if(!_0x2b2dd9)throw new Error(_0xba86('0x4b'));if(_0x2b2dd9['role']===_0xba86('0x4a')){var _0x52fcd4=_0x39c6ac[_0xba86('0x29')]({'plain':!![]});var _0x4b5248=_0xba86('0x2a');return db[_0xba86('0x4c')][_0xba86('0x47')]({'where':{'name':_0x4b5248,'userProfileId':_0x2b2dd9['userProfileId']},'raw':!![]})['then'](function(_0x3cde35){if(_0x3cde35&&_0x3cde35[_0xba86('0x4d')]===0x0){return db[_0xba86('0x2b')][_0xba86('0x4e')]({'name':_0x52fcd4[_0xba86('0x33')],'resourceId':_0x52fcd4['id'],'type':_0x3cde35[_0xba86('0x33')],'sectionId':_0x3cde35['id']},{})[_0xba86('0x27')](function(){return _0x39c6ac;});}else{return _0x39c6ac;}})['catch'](function(_0x1ca426){logger[_0xba86('0x4f')](_0xba86('0x50'),_0x1ca426);throw _0x1ca426;});}return _0x39c6ac;})[_0xba86('0x27')](respondWithResult(_0xafe5af,0xc9))[_0xba86('0x48')](handleError(_0xafe5af,null));};exports[_0xba86('0x26')]=function(_0x3bcb7d,_0x555935){if(_0x3bcb7d[_0xba86('0x49')]['id']){delete _0x3bcb7d[_0xba86('0x49')]['id'];}return db[_0xba86('0x2f')][_0xba86('0x47')]({'where':{'id':_0x3bcb7d[_0xba86('0x51')]['id']}})[_0xba86('0x27')](handleEntityNotFound(_0x555935,null))[_0xba86('0x27')](saveUpdates(_0x3bcb7d[_0xba86('0x49')],null))[_0xba86('0x27')](respondWithResult(_0x555935,null))[_0xba86('0x48')](handleError(_0x555935,null));};exports['destroy']=function(_0x5113a1,_0x182bb4){return db[_0xba86('0x2f')][_0xba86('0x47')]({'where':{'id':_0x5113a1[_0xba86('0x51')]['id']}})[_0xba86('0x27')](handleEntityNotFound(_0x182bb4,null))[_0xba86('0x27')](removeEntity(_0x182bb4,null))[_0xba86('0x48')](handleError(_0x182bb4,null));}; \ No newline at end of file +var _0xe1e4=['lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','then','Pauses','UserProfileResource','destroy','error','stack','name','Pause','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','count','includeAll','findAll','rows','catch','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','update','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xe1e4,0x1db));var _0x4e1e=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xe1e4[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x4e1e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e1e('0x1'));var jsonpatch=require(_0x4e1e('0x2'));var rp=require(_0x4e1e('0x3'));var moment=require(_0x4e1e('0x4'));var BPromise=require(_0x4e1e('0x5'));var Mustache=require(_0x4e1e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4e1e('0x7'));var csv=require(_0x4e1e('0x8'));var ejs=require(_0x4e1e('0x9'));var fs=require('fs');var fs_extra=require(_0x4e1e('0xa'));var _=require(_0x4e1e('0xb'));var squel=require('squel');var crypto=require(_0x4e1e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4e1e('0xd'));var toCsv=require(_0x4e1e('0x8'));var querystring=require(_0x4e1e('0xe'));var Papa=require(_0x4e1e('0xf'));var Redis=require(_0x4e1e('0x10'));var authService=require(_0x4e1e('0x11'));var qs=require(_0x4e1e('0x12'));var as=require(_0x4e1e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4e1e('0x14'));var utils=require('../../config/utils');var config=require(_0x4e1e('0x15'));var licenseUtil=require(_0x4e1e('0x16'));var db=require(_0x4e1e('0x17'))['db'];function respondWithStatusCode(_0x5b3e95,_0x4f46e3){_0x4f46e3=_0x4f46e3||0xcc;return function(_0x58918a){if(_0x58918a){return _0x5b3e95[_0x4e1e('0x18')](_0x4f46e3);}return _0x5b3e95[_0x4e1e('0x19')](_0x4f46e3)[_0x4e1e('0x1a')]();};}function respondWithResult(_0x4aa959,_0x2dc813){_0x2dc813=_0x2dc813||0xc8;return function(_0x206a51){if(_0x206a51){return _0x4aa959[_0x4e1e('0x19')](_0x2dc813)[_0x4e1e('0x1b')](_0x206a51);}};}function respondWithFilteredResult(_0x10c861,_0x58f3f4){return function(_0x4f9e92){if(_0x4f9e92){var _0x5b5464=typeof _0x58f3f4[_0x4e1e('0x1c')]===_0x4e1e('0x1d')&&typeof _0x58f3f4[_0x4e1e('0x1e')]==='undefined';var _0x1aa873=_0x4f9e92['count'];var _0x4cb45c=_0x5b5464?0x0:_0x58f3f4['offset'];var _0x1a4631=_0x5b5464?_0x4f9e92['count']:_0x58f3f4[_0x4e1e('0x1c')]+_0x58f3f4[_0x4e1e('0x1e')];var _0x5778e2;if(_0x1a4631>=_0x1aa873){_0x1a4631=_0x1aa873;_0x5778e2=0xc8;}else{_0x5778e2=0xce;}_0x10c861[_0x4e1e('0x19')](_0x5778e2);return _0x10c861['set'](_0x4e1e('0x1f'),_0x4cb45c+'-'+_0x1a4631+'/'+_0x1aa873)['json'](_0x4f9e92);}return null;};}function patchUpdates(_0x1b163a){return function(_0xb14a39){try{jsonpatch[_0x4e1e('0x20')](_0xb14a39,_0x1b163a,!![]);}catch(_0x49df7b){return BPromise[_0x4e1e('0x21')](_0x49df7b);}return _0xb14a39[_0x4e1e('0x22')]();};}function saveUpdates(_0x6a22f4,_0x1da023){return function(_0x3e5185){if(_0x3e5185){return _0x3e5185['update'](_0x6a22f4)[_0x4e1e('0x23')](function(_0x3285b9){return _0x3285b9;});}return null;};}function removeEntity(_0x45cc3d,_0xae7272){return function(_0x1d6bf2){if(_0x1d6bf2){return _0x1d6bf2['destroy']()[_0x4e1e('0x23')](function(){var _0x229cb0=_0x1d6bf2['get']({'plain':!![]});var _0x3ae6bb=_0x4e1e('0x24');return db[_0x4e1e('0x25')][_0x4e1e('0x26')]({'where':{'type':_0x3ae6bb,'resourceId':_0x229cb0['id']}})['then'](function(){return _0x1d6bf2;});})[_0x4e1e('0x23')](function(){_0x45cc3d[_0x4e1e('0x19')](0xcc)[_0x4e1e('0x1a')]();});}};}function handleEntityNotFound(_0x45d184,_0x14cb01){return function(_0x33bda3){if(!_0x33bda3){_0x45d184[_0x4e1e('0x18')](0x194);}return _0x33bda3;};}function handleError(_0x42960c,_0x426cf8){_0x426cf8=_0x426cf8||0x1f4;return function(_0x5e2742){logger[_0x4e1e('0x27')](_0x5e2742[_0x4e1e('0x28')]);if(_0x5e2742[_0x4e1e('0x29')]){delete _0x5e2742[_0x4e1e('0x29')];}_0x42960c[_0x4e1e('0x19')](_0x426cf8)['send'](_0x5e2742);};}exports['index']=function(_0xbfd6b3,_0x51dd87){var _0x24ae02={},_0x5aaf55={},_0x4a5cfe={'count':0x0,'rows':[]};var _0x200129=_['map'](db[_0x4e1e('0x2a')][_0x4e1e('0x2b')],function(_0x5813d5){return{'name':_0x5813d5[_0x4e1e('0x2c')],'type':_0x5813d5['type'][_0x4e1e('0x2d')]};});_0x5aaf55['model']=_[_0x4e1e('0x2e')](_0x200129,_0x4e1e('0x29'));_0x5aaf55[_0x4e1e('0x2f')]=_['keys'](_0xbfd6b3[_0x4e1e('0x2f')]);_0x5aaf55[_0x4e1e('0x30')]=_[_0x4e1e('0x31')](_0x5aaf55[_0x4e1e('0x32')],_0x5aaf55['query']);_0x24ae02[_0x4e1e('0x33')]=_[_0x4e1e('0x31')](_0x5aaf55[_0x4e1e('0x32')],qs[_0x4e1e('0x34')](_0xbfd6b3['query']['fields']));_0x24ae02['attributes']=_0x24ae02[_0x4e1e('0x33')]['length']?_0x24ae02['attributes']:_0x5aaf55[_0x4e1e('0x32')];if(!_0xbfd6b3[_0x4e1e('0x2f')][_0x4e1e('0x35')](_0x4e1e('0x36'))){_0x24ae02[_0x4e1e('0x1e')]=qs[_0x4e1e('0x1e')](_0xbfd6b3[_0x4e1e('0x2f')]['limit']);_0x24ae02[_0x4e1e('0x1c')]=qs[_0x4e1e('0x1c')](_0xbfd6b3[_0x4e1e('0x2f')][_0x4e1e('0x1c')]);}_0x24ae02[_0x4e1e('0x37')]=qs[_0x4e1e('0x38')](_0xbfd6b3[_0x4e1e('0x2f')]['sort']);_0x24ae02['where']=qs[_0x4e1e('0x30')](_[_0x4e1e('0x39')](_0xbfd6b3['query'],_0x5aaf55[_0x4e1e('0x30')]),_0x200129);if(_0xbfd6b3[_0x4e1e('0x2f')]['filter']){_0x24ae02[_0x4e1e('0x3a')]=_['merge'](_0x24ae02[_0x4e1e('0x3a')],{'$or':_[_0x4e1e('0x2e')](_0x200129,function(_0x15c514){if(_0x15c514[_0x4e1e('0x3b')]!==_0x4e1e('0x3c')){var _0x10467f={};_0x10467f[_0x15c514[_0x4e1e('0x29')]]={'$like':'%'+_0xbfd6b3['query'][_0x4e1e('0x3d')]+'%'};return _0x10467f;}})});}_0x24ae02=_[_0x4e1e('0x3e')]({},_0x24ae02,_0xbfd6b3[_0x4e1e('0x3f')]);var _0x2f2497={'where':_0x24ae02[_0x4e1e('0x3a')]};return db['Pause'][_0x4e1e('0x40')](_0x2f2497)[_0x4e1e('0x23')](function(_0xc83d7a){_0x4a5cfe[_0x4e1e('0x40')]=_0xc83d7a;if(_0xbfd6b3[_0x4e1e('0x2f')][_0x4e1e('0x41')]){_0x24ae02['include']=[{'all':!![]}];}return db[_0x4e1e('0x2a')][_0x4e1e('0x42')](_0x24ae02);})[_0x4e1e('0x23')](function(_0xb5bddc){_0x4a5cfe[_0x4e1e('0x43')]=_0xb5bddc;return _0x4a5cfe;})[_0x4e1e('0x23')](respondWithFilteredResult(_0x51dd87,_0x24ae02))[_0x4e1e('0x44')](handleError(_0x51dd87,null));};exports['show']=function(_0x31b0f3,_0x343bcf){var _0x1b4d69={'raw':!![],'where':{'id':_0x31b0f3['params']['id']}},_0x2863da={};_0x2863da['model']=_[_0x4e1e('0x45')](db['Pause'][_0x4e1e('0x2b')]);_0x2863da[_0x4e1e('0x2f')]=_[_0x4e1e('0x45')](_0x31b0f3[_0x4e1e('0x2f')]);_0x2863da['filters']=_[_0x4e1e('0x31')](_0x2863da[_0x4e1e('0x32')],_0x2863da[_0x4e1e('0x2f')]);_0x1b4d69[_0x4e1e('0x33')]=_['intersection'](_0x2863da[_0x4e1e('0x32')],qs[_0x4e1e('0x34')](_0x31b0f3[_0x4e1e('0x2f')][_0x4e1e('0x34')]));_0x1b4d69[_0x4e1e('0x33')]=_0x1b4d69['attributes'][_0x4e1e('0x46')]?_0x1b4d69[_0x4e1e('0x33')]:_0x2863da[_0x4e1e('0x32')];if(_0x31b0f3[_0x4e1e('0x2f')][_0x4e1e('0x41')]){_0x1b4d69['include']=[{'all':!![]}];}_0x1b4d69=_[_0x4e1e('0x3e')]({},_0x1b4d69,_0x31b0f3[_0x4e1e('0x3f')]);return db[_0x4e1e('0x2a')][_0x4e1e('0x47')](_0x1b4d69)[_0x4e1e('0x23')](handleEntityNotFound(_0x343bcf,null))[_0x4e1e('0x23')](respondWithResult(_0x343bcf,null))['catch'](handleError(_0x343bcf,null));};exports[_0x4e1e('0x48')]=function(_0x57e157,_0x14924a){return db[_0x4e1e('0x2a')][_0x4e1e('0x48')](_0x57e157['body'],{})['then'](function(_0x436d17){var _0x405b5b=_0x57e157[_0x4e1e('0x49')]['get']({'plain':!![]});if(!_0x405b5b)throw new Error(_0x4e1e('0x4a'));if(_0x405b5b['role']===_0x4e1e('0x49')){var _0x214084=_0x436d17[_0x4e1e('0x4b')]({'plain':!![]});var _0x3768f1=_0x4e1e('0x24');return db[_0x4e1e('0x4c')][_0x4e1e('0x47')]({'where':{'name':_0x3768f1,'userProfileId':_0x405b5b[_0x4e1e('0x4d')]},'raw':!![]})[_0x4e1e('0x23')](function(_0x196c37){if(_0x196c37&&_0x196c37['autoAssociation']===0x0){return db['UserProfileResource'][_0x4e1e('0x48')]({'name':_0x214084['name'],'resourceId':_0x214084['id'],'type':_0x196c37['name'],'sectionId':_0x196c37['id']},{})[_0x4e1e('0x23')](function(){return _0x436d17;});}else{return _0x436d17;}})[_0x4e1e('0x44')](function(_0x553fd4){logger[_0x4e1e('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x553fd4);throw _0x553fd4;});}return _0x436d17;})[_0x4e1e('0x23')](respondWithResult(_0x14924a,0xc9))[_0x4e1e('0x44')](handleError(_0x14924a,null));};exports[_0x4e1e('0x4e')]=function(_0x51b9f2,_0x1dfabd){if(_0x51b9f2[_0x4e1e('0x4f')]['id']){delete _0x51b9f2['body']['id'];}return db[_0x4e1e('0x2a')][_0x4e1e('0x47')]({'where':{'id':_0x51b9f2[_0x4e1e('0x50')]['id']}})[_0x4e1e('0x23')](handleEntityNotFound(_0x1dfabd,null))['then'](saveUpdates(_0x51b9f2[_0x4e1e('0x4f')],null))[_0x4e1e('0x23')](respondWithResult(_0x1dfabd,null))[_0x4e1e('0x44')](handleError(_0x1dfabd,null));};exports[_0x4e1e('0x26')]=function(_0x607532,_0x4a110e){return db[_0x4e1e('0x2a')][_0x4e1e('0x47')]({'where':{'id':_0x607532[_0x4e1e('0x50')]['id']}})[_0x4e1e('0x23')](handleEntityNotFound(_0x4a110e,null))[_0x4e1e('0x23')](removeEntity(_0x4a110e,null))['catch'](handleError(_0x4a110e,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 7906345..9076637 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 _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4678df,_0x1b9132){var _0x1d5b62=function(_0x38fcd2){while(--_0x38fcd2){_0x4678df['push'](_0x4678df['shift']());}};_0x1d5b62(++_0x1b9132);}(_0x1cb9,0x14e));var _0x91cb=function(_0x50bc8a,_0x33b4bb){_0x50bc8a=_0x50bc8a-0x0;var _0x4083fa=_0x1cb9[_0x50bc8a];return _0x4083fa;};'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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0xcedabb,_0x53e66b){var _0x42e0ce=function(_0x4e058e){while(--_0x4e058e){_0xcedabb['push'](_0xcedabb['shift']());}};_0x42e0ce(++_0x53e66b);}(_0x326f,0xd1));var _0xf326=function(_0x51ae05,_0x257d40){_0x51ae05=_0x51ae05-0x0;var _0x4c8ddc=_0x326f[_0x51ae05];return _0x4c8ddc;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 0b88db1..0aa5889 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x5a93e2,_0x1045d5){var _0xe1dc44=function(_0x114b56){while(--_0x114b56){_0x5a93e2['push'](_0x5a93e2['shift']());}};_0xe1dc44(++_0x1045d5);}(_0xb10b,0x12a));var _0xbb10=function(_0x32f2b5,_0x3e7573){_0x32f2b5=_0x32f2b5-0x0;var _0x4acddb=_0xb10b[_0x32f2b5];return _0x4acddb;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x2ca297,_0x3f6336){var _0x3cbab4=function(_0x3ba4fd){while(--_0x3ba4fd){_0x2ca297['push'](_0x2ca297['shift']());}};_0x3cbab4(++_0x3f6336);}(_0x7a54,0x106));var _0x47a5=function(_0x38e13e,_0x1118b7){_0x38e13e=_0x38e13e-0x0;var _0x423cb4=_0x7a54[_0x38e13e];return _0x423cb4;};'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 f798ddc..fd9d80a 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 _0xb43b=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','index','/webhook','webhookGet','get','/:id','isAuthenticated','/:id/download','download','diskStorage','join','server/files/plugins','originalname','format','basename','extname','file','webhookPost','put','delete','exports','multer'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4160fc,_0xf6478d){_0x4160fc=_0x4160fc-0x0;var _0x3c798b=_0xb43b[_0x4160fc];return _0x3c798b;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['get'](_0xbb43('0xa'),controller[_0xbb43('0xb')]);router[_0xbb43('0xc')](_0xbb43('0xd'),auth[_0xbb43('0xe')](),controller['show']);router[_0xbb43('0xc')](_0xbb43('0xf'),auth['isAuthenticated'](),controller[_0xbb43('0x10')]);var upload=multer({'storage':multer[_0xbb43('0x11')]({'destination':function(_0xd37cdf,_0x5e3611,_0xfac791){_0xfac791(null,path[_0xbb43('0x12')](config['root'],_0xbb43('0x13')));},'filename':function(_0x2a5a4d,_0x50e2c0,_0x578392){_0x50e2c0[_0xbb43('0x14')]=_0x50e2c0['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x578392(null,util[_0xbb43('0x15')]('%s-%s%s',path[_0xbb43('0x16')](_0x50e2c0[_0xbb43('0x14')],path['extname'](_0x50e2c0['originalname'])),Date['now'](),path[_0xbb43('0x17')](_0x50e2c0[_0xbb43('0x14')])));}})});router['post']('/',upload['single'](_0xbb43('0x18')),controller['upload']);router['post'](_0xbb43('0xa'),controller[_0xbb43('0x19')]);router[_0xbb43('0x1a')]('/:id',auth[_0xbb43('0xe')](),controller['update']);router[_0xbb43('0x1b')](_0xbb43('0xd'),auth['isAuthenticated'](),controller['delete']);module[_0xbb43('0x1c')]=router; \ No newline at end of file +var _0xbb53=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/webhook','webhookGet','show','/:id/download','download','root','originalname','replace','%s-%s%s','basename','extname','post','single','upload','webhookPost','/:id','update','delete'];(function(_0x2055a7,_0x415a4c){var _0x42a14d=function(_0x83139b){while(--_0x83139b){_0x2055a7['push'](_0x2055a7['shift']());}};_0x42a14d(++_0x415a4c);}(_0xbb53,0x121));var _0x3bb5=function(_0x16e0f6,_0x7c0f64){_0x16e0f6=_0x16e0f6-0x0;var _0x57027d=_0xbb53[_0x16e0f6];return _0x57027d;};'use strict';var multer=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var path=require(_0x3bb5('0x2'));var timeout=require(_0x3bb5('0x3'));var express=require(_0x3bb5('0x4'));var router=express[_0x3bb5('0x5')]();var fs_extra=require(_0x3bb5('0x6'));var auth=require(_0x3bb5('0x7'));var interaction=require(_0x3bb5('0x8'));var config=require(_0x3bb5('0x9'));var controller=require('./plugin.controller');router['get']('/',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0xb')]);router[_0x3bb5('0xc')](_0x3bb5('0xd'),controller[_0x3bb5('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3bb5('0xf')]);router[_0x3bb5('0xc')](_0x3bb5('0x10'),auth['isAuthenticated'](),controller[_0x3bb5('0x11')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53af18,_0xd8d9bf,_0x2b915a){_0x2b915a(null,path['join'](config[_0x3bb5('0x12')],'server/files/plugins'));},'filename':function(_0x69f59a,_0x511bd8,_0x526bf0){_0x511bd8[_0x3bb5('0x13')]=_0x511bd8[_0x3bb5('0x13')][_0x3bb5('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x526bf0(null,util['format'](_0x3bb5('0x15'),path[_0x3bb5('0x16')](_0x511bd8['originalname'],path[_0x3bb5('0x17')](_0x511bd8[_0x3bb5('0x13')])),Date['now'](),path['extname'](_0x511bd8['originalname'])));}})});router[_0x3bb5('0x18')]('/',upload[_0x3bb5('0x19')]('file'),controller[_0x3bb5('0x1a')]);router[_0x3bb5('0x18')](_0x3bb5('0xd'),controller[_0x3bb5('0x1b')]);router['put'](_0x3bb5('0x1c'),auth[_0x3bb5('0xa')](),controller[_0x3bb5('0x1d')]);router['delete']('/:id',auth[_0x3bb5('0xa')](),controller[_0x3bb5('0x1e')]);module[_0x3bb5('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 4086586..29330d1 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 _0x164f=['exports','STRING','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.','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x52589e,_0x2f53a3){var _0x2023fc=function(_0x3f048f){while(--_0x3f048f){_0x52589e['push'](_0x52589e['shift']());}};_0x2023fc(++_0x2f53a3);}(_0x164f,0x19f));var _0xf164=function(_0x12928c,_0xc87569){_0x12928c=_0x12928c-0x0;var _0x4c827c=_0x164f[_0x12928c];return _0x4c827c;};'use strict';var Sequelize=require(_0xf164('0x0'));module[_0xf164('0x1')]={'name':{'type':Sequelize[_0xf164('0x2')]},'type':{'type':Sequelize[_0xf164('0x3')]('html',_0xf164('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xf164('0x5')]},'path':{'type':Sequelize[_0xf164('0x2')],'comment':_0xf164('0x6')},'active':{'type':Sequelize[_0xf164('0x7')],'defaultValue':0x0,'comment':_0xf164('0x8')},'sidebar':{'type':Sequelize[_0xf164('0x3')]('adminOnly',_0xf164('0x9'),_0xf164('0xa'),_0xf164('0xb')),'defaultValue':_0xf164('0xa'),'comment':_0xf164('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xf164('0x2')]},'agentUrl':{'type':Sequelize[_0xf164('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xf164('0x2')]}}; \ No newline at end of file +var _0x5a3b=['STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports'];(function(_0x46612a,_0x94b692){var _0x3a4e1a=function(_0x498fdc){while(--_0x498fdc){_0x46612a['push'](_0x46612a['shift']());}};_0x3a4e1a(++_0x94b692);}(_0x5a3b,0x113));var _0xb5a3=function(_0x505d20,_0x518632){_0x505d20=_0x505d20-0x0;var _0x3ce083=_0x5a3b[_0x505d20];return _0x3ce083;};'use strict';var Sequelize=require('sequelize');module[_0xb5a3('0x0')]={'name':{'type':Sequelize[_0xb5a3('0x1')]},'type':{'type':Sequelize['ENUM'](_0xb5a3('0x2'),_0xb5a3('0x3'))},'description':{'type':Sequelize[_0xb5a3('0x4')]},'version':{'type':Sequelize[_0xb5a3('0x4')]},'path':{'type':Sequelize[_0xb5a3('0x1')],'comment':_0xb5a3('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb5a3('0x6')},'sidebar':{'type':Sequelize[_0xb5a3('0x7')](_0xb5a3('0x8'),'agentOnly',_0xb5a3('0x9'),_0xb5a3('0xa')),'defaultValue':_0xb5a3('0x9'),'comment':_0xb5a3('0xb')},'icon':{'type':Sequelize[_0xb5a3('0x1')]},'adminUrl':{'type':Sequelize[_0xb5a3('0x1')]},'agentUrl':{'type':Sequelize[_0xb5a3('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xb5a3('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index f375a68..01df24c 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 _0x6a67=['../../config/environment','../../config/license/util','redis','defaults','localhost','./plugin.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','merge','VIRTUAL','filter','options','Plugin','includeAll','include','catch','show','params','download','find','join','root','server/files/plugins','basename','createWriteStream','zip','warning','code','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','dirname','node_modules/**/*','finalize','close','Plugin\x20not\x20found','%s.zip','Sequelize','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','filename','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','icon','icon-apps','version','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','userProfileId','role','UserProfileSection','Plugins','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','headers','content-length','content-type','statusCode','\x27PORT\x27\x20parameter\x20not\x20specified','method','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','extract-zip','rimraf','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0xf1402a,_0x187f5c){var _0x4f7ead=function(_0x57dfd9){while(--_0x57dfd9){_0xf1402a['push'](_0xf1402a['shift']());}};_0x4f7ead(++_0x187f5c);}(_0x6a67,0x1d3));var _0x76a6=function(_0x46e182,_0x1046a8){_0x46e182=_0x46e182-0x0;var _0x42ade0=_0x6a67[_0x46e182];return _0x42ade0;};'use strict';var emlformat=require(_0x76a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76a6('0x1'));var jsonpatch=require(_0x76a6('0x2'));var rp=require(_0x76a6('0x3'));var moment=require('moment');var BPromise=require(_0x76a6('0x4'));var Mustache=require(_0x76a6('0x5'));var util=require(_0x76a6('0x6'));var path=require(_0x76a6('0x7'));var sox=require(_0x76a6('0x8'));var csv=require(_0x76a6('0x9'));var ejs=require(_0x76a6('0xa'));var fs=require('fs');var fs_extra=require(_0x76a6('0xb'));var _=require(_0x76a6('0xc'));var squel=require(_0x76a6('0xd'));var crypto=require(_0x76a6('0xe'));var jsforce=require(_0x76a6('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x76a6('0x10'));var Papa=require(_0x76a6('0x11'));var extract=require(_0x76a6('0x12'));var rimraf=require(_0x76a6('0x13'));var archiver=require('archiver');var Redis=require(_0x76a6('0x14'));var authService=require(_0x76a6('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76a6('0x16'));var logger=require(_0x76a6('0x17'))(_0x76a6('0x18'));var utils=require('../../config/utils');var config=require(_0x76a6('0x19'));var licenseUtil=require(_0x76a6('0x1a'));var db=require('../../mysqldb')['db'];config[_0x76a6('0x1b')]=_[_0x76a6('0x1c')](config['redis'],{'host':_0x76a6('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x76a6('0x1b')]));require(_0x76a6('0x1e'))[_0x76a6('0x1f')](socket);function respondWithStatusCode(_0x3e720b,_0x4d3d8a){_0x4d3d8a=_0x4d3d8a||0xcc;return function(_0x24778b){if(_0x24778b){return _0x3e720b[_0x76a6('0x20')](_0x4d3d8a);}return _0x3e720b[_0x76a6('0x21')](_0x4d3d8a)[_0x76a6('0x22')]();};}function respondWithResult(_0x503ed0,_0x2ddfb9){_0x2ddfb9=_0x2ddfb9||0xc8;return function(_0x5e47d7){if(_0x5e47d7){return _0x503ed0[_0x76a6('0x21')](_0x2ddfb9)[_0x76a6('0x23')](_0x5e47d7);}};}function respondWithFilteredResult(_0x219dc4,_0x511ac0){return function(_0x3ace90){if(_0x3ace90){var _0x2556ed=typeof _0x511ac0[_0x76a6('0x24')]==='undefined'&&typeof _0x511ac0[_0x76a6('0x25')]===_0x76a6('0x26');var _0x3f744c=_0x3ace90[_0x76a6('0x27')];var _0x438747=_0x2556ed?0x0:_0x511ac0[_0x76a6('0x24')];var _0x196933=_0x2556ed?_0x3ace90[_0x76a6('0x27')]:_0x511ac0['offset']+_0x511ac0[_0x76a6('0x25')];var _0x770070;if(_0x196933>=_0x3f744c){_0x196933=_0x3f744c;_0x770070=0xc8;}else{_0x770070=0xce;}_0x219dc4[_0x76a6('0x21')](_0x770070);return _0x219dc4[_0x76a6('0x28')](_0x76a6('0x29'),_0x438747+'-'+_0x196933+'/'+_0x3f744c)[_0x76a6('0x23')](_0x3ace90);}return null;};}function patchUpdates(_0x2e847a){return function(_0xbf146e){try{jsonpatch[_0x76a6('0x2a')](_0xbf146e,_0x2e847a,!![]);}catch(_0x3b91df){return BPromise[_0x76a6('0x2b')](_0x3b91df);}return _0xbf146e['save']();};}function saveUpdates(_0x2c4e55,_0x27aafd){return function(_0x42a4da){if(_0x42a4da){return _0x42a4da[_0x76a6('0x2c')](_0x2c4e55)['then'](function(_0x44d491){return _0x44d491;});}return null;};}function removeEntity(_0x5140d4,_0x4a0c6f){return function(_0x8b4f68){if(_0x8b4f68){return _0x8b4f68[_0x76a6('0x2d')]()['then'](function(){var _0xb03460=_0x8b4f68['get']({'plain':!![]});var _0x1fa2c1='Plugins';return db['UserProfileResource'][_0x76a6('0x2d')]({'where':{'type':_0x1fa2c1,'resourceId':_0xb03460['id']}})[_0x76a6('0x2e')](function(){return _0x8b4f68;});})[_0x76a6('0x2e')](function(){_0x5140d4['status'](0xcc)[_0x76a6('0x22')]();});}};}function handleEntityNotFound(_0x4f008,_0x18a46a){return function(_0x29ee61){if(!_0x29ee61){_0x4f008['sendStatus'](0x194);}return _0x29ee61;};}function handleError(_0x17cbb1,_0x5e3fe6){_0x5e3fe6=_0x5e3fe6||0x1f4;return function(_0x1ee5bf){logger[_0x76a6('0x2f')](_0x1ee5bf[_0x76a6('0x30')]);if(_0x1ee5bf['name']){delete _0x1ee5bf[_0x76a6('0x31')];}_0x17cbb1['status'](_0x5e3fe6)[_0x76a6('0x32')](_0x1ee5bf);};}exports['index']=function(_0x49f412,_0x59bc34){var _0x2433b0={},_0x2e4b7e={},_0x18986f={'count':0x0,'rows':[]};var _0x2e80dc=_[_0x76a6('0x33')](db['Plugin'][_0x76a6('0x34')],function(_0x127f27){return{'name':_0x127f27[_0x76a6('0x35')],'type':_0x127f27[_0x76a6('0x36')][_0x76a6('0x37')]};});_0x2e4b7e[_0x76a6('0x38')]=_[_0x76a6('0x33')](_0x2e80dc,'name');_0x2e4b7e[_0x76a6('0x39')]=_[_0x76a6('0x3a')](_0x49f412[_0x76a6('0x39')]);_0x2e4b7e[_0x76a6('0x3b')]=_[_0x76a6('0x3c')](_0x2e4b7e[_0x76a6('0x38')],_0x2e4b7e[_0x76a6('0x39')]);_0x2433b0[_0x76a6('0x3d')]=_['intersection'](_0x2e4b7e[_0x76a6('0x38')],qs[_0x76a6('0x3e')](_0x49f412[_0x76a6('0x39')][_0x76a6('0x3e')]));_0x2433b0[_0x76a6('0x3d')]=_0x2433b0['attributes'][_0x76a6('0x3f')]?_0x2433b0[_0x76a6('0x3d')]:_0x2e4b7e['model'];if(!_0x49f412[_0x76a6('0x39')]['hasOwnProperty']('nolimit')){_0x2433b0['limit']=qs['limit'](_0x49f412['query'][_0x76a6('0x25')]);_0x2433b0['offset']=qs[_0x76a6('0x24')](_0x49f412[_0x76a6('0x39')][_0x76a6('0x24')]);}_0x2433b0['order']=qs['sort'](_0x49f412[_0x76a6('0x39')][_0x76a6('0x40')]);_0x2433b0[_0x76a6('0x41')]=qs[_0x76a6('0x3b')](_['pick'](_0x49f412[_0x76a6('0x39')],_0x2e4b7e['filters']),_0x2e80dc);if(_0x49f412['query']['filter']){_0x2433b0[_0x76a6('0x41')]=_[_0x76a6('0x42')](_0x2433b0[_0x76a6('0x41')],{'$or':_[_0x76a6('0x33')](_0x2e80dc,function(_0xa6ce9e){if(_0xa6ce9e[_0x76a6('0x36')]!==_0x76a6('0x43')){var _0x54c80a={};_0x54c80a[_0xa6ce9e['name']]={'$like':'%'+_0x49f412['query'][_0x76a6('0x44')]+'%'};return _0x54c80a;}})});}_0x2433b0=_[_0x76a6('0x42')]({},_0x2433b0,_0x49f412[_0x76a6('0x45')]);var _0x5e854c={'where':_0x2433b0[_0x76a6('0x41')]};return db[_0x76a6('0x46')][_0x76a6('0x27')](_0x5e854c)[_0x76a6('0x2e')](function(_0x2be4b5){_0x18986f[_0x76a6('0x27')]=_0x2be4b5;if(_0x49f412[_0x76a6('0x39')][_0x76a6('0x47')]){_0x2433b0[_0x76a6('0x48')]=[{'all':!![]}];}return db[_0x76a6('0x46')]['findAll'](_0x2433b0);})[_0x76a6('0x2e')](function(_0x1fab53){_0x18986f['rows']=_0x1fab53;return _0x18986f;})[_0x76a6('0x2e')](respondWithFilteredResult(_0x59bc34,_0x2433b0))[_0x76a6('0x49')](handleError(_0x59bc34,null));};exports[_0x76a6('0x4a')]=function(_0x8ca404,_0x317b80){var _0x251a72={'raw':!![],'where':{'id':_0x8ca404[_0x76a6('0x4b')]['id']}},_0x51b2d8={};_0x51b2d8[_0x76a6('0x38')]=_[_0x76a6('0x3a')](db['Plugin'][_0x76a6('0x34')]);_0x51b2d8[_0x76a6('0x39')]=_['keys'](_0x8ca404[_0x76a6('0x39')]);_0x51b2d8[_0x76a6('0x3b')]=_[_0x76a6('0x3c')](_0x51b2d8[_0x76a6('0x38')],_0x51b2d8[_0x76a6('0x39')]);_0x251a72[_0x76a6('0x3d')]=_[_0x76a6('0x3c')](_0x51b2d8[_0x76a6('0x38')],qs['fields'](_0x8ca404[_0x76a6('0x39')][_0x76a6('0x3e')]));_0x251a72['attributes']=_0x251a72[_0x76a6('0x3d')][_0x76a6('0x3f')]?_0x251a72['attributes']:_0x51b2d8['model'];if(_0x8ca404[_0x76a6('0x39')][_0x76a6('0x47')]){_0x251a72[_0x76a6('0x48')]=[{'all':!![]}];}_0x251a72=_[_0x76a6('0x42')]({},_0x251a72,_0x8ca404[_0x76a6('0x45')]);return db[_0x76a6('0x46')]['find'](_0x251a72)[_0x76a6('0x2e')](handleEntityNotFound(_0x317b80,null))['then'](respondWithResult(_0x317b80,null))[_0x76a6('0x49')](handleError(_0x317b80,null));};exports[_0x76a6('0x4c')]=function(_0x4027b1,_0xfdb50b,_0x367666){return db[_0x76a6('0x46')][_0x76a6('0x4d')]({'where':{'id':_0x4027b1['params']['id']},'attributes':['name','path'],'raw':!![]})[_0x76a6('0x2e')](handleEntityNotFound(_0xfdb50b,null))[_0x76a6('0x2e')](function(_0x1cc8f8){if(_0x1cc8f8){var _0x593f6c=path[_0x76a6('0x4e')](config[_0x76a6('0x4f')],_0x76a6('0x50'),util['format']('%s.zip',path[_0x76a6('0x51')](_0x1cc8f8['path'])));var _0x2f6a85=fs[_0x76a6('0x52')](_0x593f6c);var _0x47831e=archiver(_0x76a6('0x53'),{'zlib':{'level':0x9}});_0x47831e['on'](_0x76a6('0x54'),function(_0x163885){if(_0x163885[_0x76a6('0x55')]===_0x76a6('0x56')){logger[_0x76a6('0x2f')](_0x163885);}else{throw new db['Sequelize']['Error'](_0x76a6('0x57'));}});_0x47831e['on'](_0x76a6('0x2f'),function(_0x572a15){throw new db['Sequelize'][(_0x76a6('0x58'))](_0x76a6('0x57'));});_0x47831e[_0x76a6('0x59')](_0x2f6a85);_0x47831e[_0x76a6('0x5a')]('**/*',{'cwd':path[_0x76a6('0x4e')](config[_0x76a6('0x4f')],'server/files/plugins',path[_0x76a6('0x5b')](_0x1cc8f8[_0x76a6('0x7')])),'ignore':[path[_0x76a6('0x4e')](path[_0x76a6('0x51')](_0x1cc8f8['path']),_0x76a6('0x5c')),path[_0x76a6('0x4e')](path[_0x76a6('0x51')](_0x1cc8f8[_0x76a6('0x7')]),'attachments/**/*')],'nodir':!![]})[_0x76a6('0x5d')]();_0x2f6a85['on'](_0x76a6('0x5e'),function(){if(!fs['existsSync'](_0x593f6c)){throw new db['Sequelize']['Error'](_0x76a6('0x5f'));}return _0xfdb50b[_0x76a6('0x4c')](_0x593f6c,util['format'](_0x76a6('0x60'),path[_0x76a6('0x51')](_0x1cc8f8[_0x76a6('0x7')])),function(_0x28c2e4){if(_0x28c2e4){throw new db[(_0x76a6('0x61'))][(_0x76a6('0x58'))](_0x76a6('0x62'));}fs[_0x76a6('0x63')](_0x593f6c);logger['info']('Download\x20completed');logger[_0x76a6('0x64')](_0x76a6('0x65'));});});}return null;})['catch'](handleError(_0xfdb50b,null));};exports[_0x76a6('0x66')]=function(_0x20af72,_0x2a1643,_0x4755d2){var _0x248b43=path[_0x76a6('0x51')](_0x20af72['file'][_0x76a6('0x67')],path['extname'](_0x20af72[_0x76a6('0x68')][_0x76a6('0x67')]));var _0x5bc242=path[_0x76a6('0x4e')](config['root'],_0x76a6('0x50'),_0x20af72[_0x76a6('0x68')]['filename']);var _0x1c5b2e=path[_0x76a6('0x4e')](config[_0x76a6('0x4f')],'server/files/plugins',_0x248b43);logger[_0x76a6('0x64')](_0x76a6('0x69'),_0x5bc242);logger[_0x76a6('0x64')](_0x76a6('0x6a'),_0x1c5b2e);try{fs[_0x76a6('0x6b')](_0x5bc242,parseInt('0777',0x8));extract(_0x5bc242,{'dir':_0x1c5b2e},function(_0x7be98e){if(_0x7be98e){logger[_0x76a6('0x2f')](_0x7be98e);handleError(_0x7be98e,!![]);};var _0x202061=fs['readdirSync'](_0x1c5b2e);if(_0x202061['length']>0x1){removeReferences(_0x5bc242,_0x1c5b2e);logger[_0x76a6('0x2f')](_0x76a6('0x6c'));return _0x4755d2(new Error(_0x76a6('0x6c')));}var _0x3e9a43=fs[_0x76a6('0x6d')](path[_0x76a6('0x4e')](_0x1c5b2e,_0x202061[0x0]));if(_0x3e9a43[_0x76a6('0x6e')]()){removeReferences(_0x5bc242,_0x1c5b2e);logger[_0x76a6('0x2f')](_0x76a6('0x6c'));return _0x4755d2(new Error('Invalid\x20plugin\x20structure'));}if(_0x3e9a43[_0x76a6('0x6f')]()){var _0x27d2f2=fs[_0x76a6('0x70')](path[_0x76a6('0x4e')](_0x1c5b2e,_0x202061[0x0]));if(_0x27d2f2['length']===0x0){removeReferences(_0x5bc242,_0x1c5b2e);logger[_0x76a6('0x2f')](_0x76a6('0x6c'));return _0x4755d2(new Error('Invalid\x20plugin\x20structure'));}var _0x2313f5=_0x27d2f2['some'](function(_0x520cab){return _0x520cab===_0x76a6('0x71');});if(!_0x2313f5){return _0x4755d2(new Error(_0x76a6('0x72')));}var _0x4d3182=fs[_0x76a6('0x73')](path[_0x76a6('0x4e')](_0x1c5b2e,_0x202061[0x0],_0x76a6('0x71')));var _0x199de8=JSON[_0x76a6('0x74')](_0x4d3182);if('undefined'==typeof _0x199de8[_0x76a6('0x31')]){return _0x4755d2(new Error(_0x76a6('0x75')));}if(_0x76a6('0x26')==typeof _0x199de8[_0x76a6('0x36')]){return _0x4755d2(new Error(_0x76a6('0x76')));}if('undefined'==typeof _0x199de8['version']){return _0x4755d2(new Error(_0x76a6('0x77')));}if(_0x76a6('0x26')==typeof _0x199de8['parameters']){return _0x4755d2(new Error(_0x76a6('0x78')));}if(_0x199de8[_0x76a6('0x36')]===_0x76a6('0x79')){if(_0x76a6('0x26')==typeof _0x199de8[_0x76a6('0x7a')][_0x76a6('0x7b')]){return _0x4755d2(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x76a6('0x26')==typeof _0x199de8[_0x76a6('0x7a')][_0x76a6('0x7b')][_0x76a6('0x7c')]&&_0x76a6('0x26')==typeof _0x199de8[_0x76a6('0x7a')]['views'][_0x76a6('0x7d')]){return _0x4755d2(new Error(_0x76a6('0x7e')));}}else if(_0x199de8[_0x76a6('0x36')]===_0x76a6('0x7f')){if(_0x76a6('0x26')==typeof _0x199de8['parameters']['scriptName']){return _0x4755d2(new Error(_0x76a6('0x80')));}if(_0x76a6('0x26')==typeof _0x199de8[_0x76a6('0x7a')][_0x76a6('0x81')]){return _0x4755d2(new Error(_0x76a6('0x82')));}}else{return _0x4755d2(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x14930d=_0x199de8['name'];var _0x51d3f6=_0x199de8[_0x76a6('0x83')];var _0x23edd0=_0x199de8[_0x76a6('0x36')];var _0x198c8c=_0x199de8['sidebar']?_0x199de8[_0x76a6('0x84')]:'always';var _0xdbc207=_0x199de8['icon']?_0x199de8[_0x76a6('0x85')]:_0x76a6('0x86');var _0x27e541='';var _0x1d734d='';var _0x11ccb6='';var _0x5aee90='';var _0x2d4912=_0x199de8[_0x76a6('0x87')];if(_0x23edd0==='html'){if(_0x76a6('0x26')!=typeof _0x199de8[_0x76a6('0x7a')][_0x76a6('0x7b')][_0x76a6('0x7c')]){var _0x716bfe=_0x199de8[_0x76a6('0x7a')][_0x76a6('0x7b')][_0x76a6('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x76a6('0x88')](_0x716bfe)){_0x27e541=path[_0x76a6('0x4e')]('plugins',_0x248b43,_0x202061[0x0],_0x716bfe);}else{_0x27e541=_0x716bfe;}}else{logger[_0x76a6('0x64')](_0x76a6('0x89'));}if(_0x76a6('0x26')!=typeof _0x199de8[_0x76a6('0x7a')][_0x76a6('0x7b')][_0x76a6('0x7d')]){var _0x5aa974=_0x199de8['parameters'][_0x76a6('0x7b')][_0x76a6('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5aa974)){_0x1d734d=path[_0x76a6('0x4e')](_0x76a6('0x8a'),_0x248b43,_0x202061[0x0],_0x5aa974);}else{_0x1d734d=_0x5aa974;}}else{logger[_0x76a6('0x64')](_0x76a6('0x8b'));}}else if(_0x23edd0===_0x76a6('0x7f')){_0x11ccb6=_0x199de8[_0x76a6('0x7a')][_0x76a6('0x8c')];_0x5aee90=_0x199de8[_0x76a6('0x7a')][_0x76a6('0x81')];if('undefined'!=typeof _0x199de8[_0x76a6('0x7a')][_0x76a6('0x7b')]){if(_0x76a6('0x26')!=typeof _0x199de8[_0x76a6('0x7a')][_0x76a6('0x7b')]['admin']){var _0x716bfe=_0x199de8['parameters'][_0x76a6('0x7b')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x716bfe)){_0x27e541=path[_0x76a6('0x4e')](_0x76a6('0x8a'),_0x248b43,_0x202061[0x0],_0x716bfe);}else{_0x27e541=_0x716bfe;}}if('undefined'!=typeof _0x199de8['parameters'][_0x76a6('0x7b')][_0x76a6('0x7d')]){var _0x5aa974=_0x199de8[_0x76a6('0x7a')][_0x76a6('0x7b')][_0x76a6('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5aa974)){_0x1d734d=path['join']('plugins',_0x248b43,_0x202061[0x0],_0x5aa974);}else{_0x1d734d=_0x5aa974;}}}}var _0x2af386={'name':_0x14930d,'description':_0x51d3f6,'path':path['join'](_0x248b43,_0x202061[0x0]),'type':_0x23edd0,'sidebar':_0x198c8c,'icon':_0xdbc207,'adminUrl':_0x27e541,'agentUrl':_0x1d734d,'scriptName':_0x11ccb6,'scriptPath':_0x5aee90,'version':_0x2d4912};removeReferences(_0x5bc242,null);return db[_0x76a6('0x46')][_0x76a6('0x8d')](_0x2af386)[_0x76a6('0x2e')](function(_0x1c3c81){var _0xdc54f5={'role':_0x20af72[_0x76a6('0x8e')]['role'],'userProfileId':_0x20af72[_0x76a6('0x8e')][_0x76a6('0x8f')]};if(!_0xdc54f5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdc54f5[_0x76a6('0x90')]==='user'){var _0x2d7153=_0x1c3c81['get']({'plain':!![]});return db[_0x76a6('0x91')][_0x76a6('0x4d')]({'where':{'name':_0x76a6('0x92'),'userProfileId':_0xdc54f5[_0x76a6('0x8f')]},'raw':!![]})[_0x76a6('0x2e')](function(_0x36979c){if(_0x36979c&&_0x36979c[_0x76a6('0x93')]===0x0){return db[_0x76a6('0x94')][_0x76a6('0x8d')]({'name':_0x2d7153[_0x76a6('0x31')],'resourceId':_0x2d7153['id'],'type':_0x36979c['name'],'sectionId':_0x36979c['id']},{})[_0x76a6('0x2e')](function(){return _0x1c3c81;});}else{return _0x1c3c81;}})[_0x76a6('0x49')](function(_0x3389a3){logger[_0x76a6('0x2f')](_0x76a6('0x95'),_0x3389a3);throw _0x3389a3;});}return _0x1c3c81;})['then'](respondWithResult(_0x2a1643,null))['catch'](handleError(_0x2a1643,null));}});}catch(_0x568b6d){_0x2a1643[_0x76a6('0x21')](0x1f4)[_0x76a6('0x32')](_0x568b6d);}};function removeReferences(_0x54c139,_0x5dbff9){try{if(_0x54c139){fs[_0x76a6('0x63')](_0x54c139);logger[_0x76a6('0x64')]('Zip\x20archive\x20removed');}if(_0x5dbff9){rimraf(_0x5dbff9,function(){});logger[_0x76a6('0x64')]('Extracted\x20folder\x20removed');}}catch(_0x4320d5){logger['error'](_0x4320d5);}}exports['update']=function(_0x17814d,_0x1c8160,_0x277679){return db[_0x76a6('0x46')][_0x76a6('0x4d')]({'where':{'id':_0x17814d['params']['id']}})[_0x76a6('0x2e')](handleEntityNotFound(_0x1c8160,null))['then'](saveUpdates(_0x17814d[_0x76a6('0x8e')],null))['then'](respondWithResult(_0x1c8160,null))['catch'](handleError(_0x1c8160,null));};exports[_0x76a6('0x96')]=function(_0x4c097b,_0x29baf1,_0x1eaeca){return db[_0x76a6('0x46')]['find']({'where':{'id':_0x4c097b[_0x76a6('0x4b')]['id']}})['then'](function(_0x234bd8){if(_0x234bd8){return _0x234bd8[_0x76a6('0x2d')]();}})[_0x76a6('0x2e')](function(_0x1da8db){rimraf(path[_0x76a6('0x4e')](config[_0x76a6('0x4f')],'server/files/plugins',path['dirname'](_0x1da8db[_0x76a6('0x7')])),function(){});return _0x1da8db;})[_0x76a6('0x2e')](handleEntityNotFound(_0x29baf1,null))[_0x76a6('0x2e')](respondWithStatusCode(_0x29baf1,null))[_0x76a6('0x49')](handleError(_0x29baf1,null));};exports[_0x76a6('0x97')]=function(_0x5cb3cb,_0x3151e5,_0x19bb6d){return BPromise[_0x76a6('0x98')]()[_0x76a6('0x2e')](function(){if(!_0x5cb3cb[_0x76a6('0x39')]['path']){throw new Error(_0x76a6('0x99'));}if(!_0x5cb3cb[_0x76a6('0x39')][_0x76a6('0x9a')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x341e5e=_0x5cb3cb[_0x76a6('0x39')][_0x76a6('0x9b')]?_0x5cb3cb[_0x76a6('0x39')][_0x76a6('0x9b')]+':'+_0x5cb3cb['query'][_0x76a6('0x9a')]:_0x76a6('0x9c')+_0x5cb3cb[_0x76a6('0x39')][_0x76a6('0x9a')];var _0x3fb786=_0x5cb3cb[_0x76a6('0x39')][_0x76a6('0x23')]?_0x5cb3cb['query']['json']:!![];var _0x110c4e=_0x5cb3cb['query'][_0x76a6('0x9d')]?_0x5cb3cb['query'][_0x76a6('0x9d')]:null;var _0x1f8380={'method':_0x5cb3cb['method'],'uri':util['format']('%s%s',_0x341e5e,_0x5cb3cb[_0x76a6('0x39')][_0x76a6('0x7')]),'json':_0x3fb786,'resolveWithFullResponse':!![],'encoding':_0x110c4e,'qs':_0x5cb3cb['query']};if(_0x5cb3cb[_0x76a6('0x9e')]){_0x1f8380['headers']=_0x5cb3cb[_0x76a6('0x9e')];if(_0x1f8380[_0x76a6('0x9e')][_0x76a6('0x9f')]){delete _0x1f8380[_0x76a6('0x9e')][_0x76a6('0x9f')];}}if(_0x1f8380[_0x76a6('0x9e')][_0x76a6('0xa0')]){delete _0x1f8380[_0x76a6('0x9e')][_0x76a6('0xa0')];}return rp(_0x1f8380);})[_0x76a6('0x2e')](function(_0x58ddcc){if(_0x58ddcc){_0x3151e5[_0x76a6('0x28')](_0x58ddcc['headers']);logger[_0x76a6('0x64')](_0x58ddcc[_0x76a6('0x8e')]);if(_['endsWith'](_0x5cb3cb['query'][_0x76a6('0x7')],'download')&&_0x58ddcc[_0x76a6('0xa1')]==0x1f4){return _0x3151e5['sendStatus'](_0x58ddcc['statusCode']);}else{return _0x3151e5[_0x76a6('0x21')](_0x58ddcc[_0x76a6('0xa1')])[_0x76a6('0x32')](_0x58ddcc[_0x76a6('0x8e')]);}}else{return _0x3151e5[_0x76a6('0x20')](0xc8);}})[_0x76a6('0x49')](handleError(_0x3151e5,null));};exports['webhookPost']=function(_0x3ac0a2,_0x230d14,_0x3fbe8c){return BPromise[_0x76a6('0x98')]()['then'](function(){if(!_0x3ac0a2['query'][_0x76a6('0x7')]){throw new Error(_0x76a6('0x99'));}if(!_0x3ac0a2[_0x76a6('0x39')][_0x76a6('0x9a')]){throw new Error(_0x76a6('0xa2'));}var _0x326020=_0x3ac0a2['query']['hostname']?_0x3ac0a2[_0x76a6('0x39')]['hostname']+':'+_0x3ac0a2[_0x76a6('0x39')][_0x76a6('0x9a')]:'http://localhost:'+_0x3ac0a2[_0x76a6('0x39')][_0x76a6('0x9a')];var _0x47e985=_0x3ac0a2[_0x76a6('0x39')][_0x76a6('0x23')]?_0x3ac0a2[_0x76a6('0x39')]['json']:!![];var _0x326179=_0x3ac0a2[_0x76a6('0x39')]['encoding']?_0x3ac0a2['query'][_0x76a6('0x9d')]:null;var _0x16ae96={'method':_0x3ac0a2[_0x76a6('0xa3')],'uri':util['format']('%s%s',_0x326020,_0x3ac0a2[_0x76a6('0x39')][_0x76a6('0x7')]),'json':_0x47e985,'resolveWithFullResponse':!![],'encoding':_0x326179,'body':_0x3ac0a2['body']};if(_0x3ac0a2['headers']){_0x16ae96['headers']=_0x3ac0a2[_0x76a6('0x9e')];if(_0x16ae96['headers'][_0x76a6('0x9f')]){delete _0x16ae96[_0x76a6('0x9e')]['content-length'];}}if(_0x16ae96[_0x76a6('0x9e')][_0x76a6('0xa0')]){delete _0x16ae96[_0x76a6('0x9e')]['content-type'];}return rp(_0x16ae96);})[_0x76a6('0x2e')](function(_0x204f10){if(_0x204f10){_0x230d14[_0x76a6('0x28')](_0x204f10[_0x76a6('0x9e')]);logger[_0x76a6('0x64')](_0x204f10[_0x76a6('0x8e')]);return _0x230d14[_0x76a6('0x21')](_0x204f10[_0x76a6('0xa1')])[_0x76a6('0x32')](_0x204f10[_0x76a6('0x8e')]);}else{return _0x230d14[_0x76a6('0x20')](0xc8);}})[_0x76a6('0x49')](handleError(_0x230d14,null));}; \ No newline at end of file +var _0x17b2=['extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','save','update','then','get','error','stack','name','index','map','Plugin','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','options','includeAll','include','rows','catch','params','keys','rawAttributes','find','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','0777','readdirSync','lstatSync','isFile','Invalid\x20plugin\x20structure','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','script','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','Warning:\x20admin\x20view\x20not\x20specified','agent','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','destroy','webhookGet','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','rimraf','zip-dir','moment','mustache','util','path','sox','lodash','crypto','to-csv','querystring','papaparse'];(function(_0x285a06,_0x344860){var _0x18191c=function(_0x417050){while(--_0x417050){_0x285a06['push'](_0x285a06['shift']());}};_0x18191c(++_0x344860);}(_0x17b2,0x1dd));var _0x217b=function(_0x336461,_0xa764aa){_0x336461=_0x336461-0x0;var _0x256a53=_0x17b2[_0x336461];return _0x256a53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x217b('0x0'));var zipdir=require(_0x217b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x217b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x217b('0x3'));var util=require(_0x217b('0x4'));var path=require(_0x217b('0x5'));var sox=require(_0x217b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x217b('0x7'));var squel=require('squel');var crypto=require(_0x217b('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x217b('0x9'));var querystring=require(_0x217b('0xa'));var Papa=require(_0x217b('0xb'));var extract=require(_0x217b('0xc'));var rimraf=require(_0x217b('0x0'));var archiver=require('archiver');var Redis=require(_0x217b('0xd'));var authService=require(_0x217b('0xe'));var qs=require(_0x217b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x217b('0x10'));var logger=require(_0x217b('0x11'))(_0x217b('0x12'));var utils=require(_0x217b('0x13'));var config=require(_0x217b('0x14'));var licenseUtil=require(_0x217b('0x15'));var db=require(_0x217b('0x16'))['db'];config[_0x217b('0x17')]=_[_0x217b('0x18')](config[_0x217b('0x17')],{'host':_0x217b('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x217b('0x17')]));require('./plugin.socket')[_0x217b('0x1a')](socket);function respondWithStatusCode(_0x3eee70,_0x1cd71f){_0x1cd71f=_0x1cd71f||0xcc;return function(_0x4d82d8){if(_0x4d82d8){return _0x3eee70[_0x217b('0x1b')](_0x1cd71f);}return _0x3eee70[_0x217b('0x1c')](_0x1cd71f)[_0x217b('0x1d')]();};}function respondWithResult(_0x22cb2c,_0x5de611){_0x5de611=_0x5de611||0xc8;return function(_0x2296cc){if(_0x2296cc){return _0x22cb2c[_0x217b('0x1c')](_0x5de611)[_0x217b('0x1e')](_0x2296cc);}};}function respondWithFilteredResult(_0x56418a,_0x531469){return function(_0x270c93){if(_0x270c93){var _0x33928c=typeof _0x531469['offset']===_0x217b('0x1f')&&typeof _0x531469[_0x217b('0x20')]===_0x217b('0x1f');var _0x3aa6a0=_0x270c93['count'];var _0x31ec56=_0x33928c?0x0:_0x531469[_0x217b('0x21')];var _0x5d5632=_0x33928c?_0x270c93[_0x217b('0x22')]:_0x531469['offset']+_0x531469['limit'];var _0xbac649;if(_0x5d5632>=_0x3aa6a0){_0x5d5632=_0x3aa6a0;_0xbac649=0xc8;}else{_0xbac649=0xce;}_0x56418a[_0x217b('0x1c')](_0xbac649);return _0x56418a['set'](_0x217b('0x23'),_0x31ec56+'-'+_0x5d5632+'/'+_0x3aa6a0)[_0x217b('0x1e')](_0x270c93);}return null;};}function patchUpdates(_0x561964){return function(_0x408eed){try{jsonpatch[_0x217b('0x24')](_0x408eed,_0x561964,!![]);}catch(_0x657635){return BPromise['reject'](_0x657635);}return _0x408eed[_0x217b('0x25')]();};}function saveUpdates(_0x45a18b,_0x170fc0){return function(_0x53adde){if(_0x53adde){return _0x53adde[_0x217b('0x26')](_0x45a18b)[_0x217b('0x27')](function(_0x18a218){return _0x18a218;});}return null;};}function removeEntity(_0x3b6ed1,_0x21e37e){return function(_0x5c1ea9){if(_0x5c1ea9){return _0x5c1ea9['destroy']()[_0x217b('0x27')](function(){var _0x4cc562=_0x5c1ea9[_0x217b('0x28')]({'plain':!![]});var _0x1d76e1='Plugins';return db['UserProfileResource']['destroy']({'where':{'type':_0x1d76e1,'resourceId':_0x4cc562['id']}})['then'](function(){return _0x5c1ea9;});})[_0x217b('0x27')](function(){_0x3b6ed1[_0x217b('0x1c')](0xcc)[_0x217b('0x1d')]();});}};}function handleEntityNotFound(_0x574d79,_0x207b47){return function(_0x44801f){if(!_0x44801f){_0x574d79[_0x217b('0x1b')](0x194);}return _0x44801f;};}function handleError(_0x80639b,_0x558e16){_0x558e16=_0x558e16||0x1f4;return function(_0x4821ca){logger[_0x217b('0x29')](_0x4821ca[_0x217b('0x2a')]);if(_0x4821ca[_0x217b('0x2b')]){delete _0x4821ca['name'];}_0x80639b['status'](_0x558e16)['send'](_0x4821ca);};}exports[_0x217b('0x2c')]=function(_0x289770,_0x4532da){var _0x5c7723={},_0x21ef91={},_0x1602d0={'count':0x0,'rows':[]};var _0xe77380=_[_0x217b('0x2d')](db[_0x217b('0x2e')]['rawAttributes'],function(_0x3dd849){return{'name':_0x3dd849[_0x217b('0x2f')],'type':_0x3dd849[_0x217b('0x30')][_0x217b('0x31')]};});_0x21ef91[_0x217b('0x32')]=_[_0x217b('0x2d')](_0xe77380,_0x217b('0x2b'));_0x21ef91[_0x217b('0x33')]=_['keys'](_0x289770['query']);_0x21ef91[_0x217b('0x34')]=_[_0x217b('0x35')](_0x21ef91[_0x217b('0x32')],_0x21ef91[_0x217b('0x33')]);_0x5c7723[_0x217b('0x36')]=_[_0x217b('0x35')](_0x21ef91['model'],qs[_0x217b('0x37')](_0x289770[_0x217b('0x33')][_0x217b('0x37')]));_0x5c7723['attributes']=_0x5c7723[_0x217b('0x36')][_0x217b('0x38')]?_0x5c7723[_0x217b('0x36')]:_0x21ef91['model'];if(!_0x289770[_0x217b('0x33')][_0x217b('0x39')](_0x217b('0x3a'))){_0x5c7723[_0x217b('0x20')]=qs[_0x217b('0x20')](_0x289770[_0x217b('0x33')][_0x217b('0x20')]);_0x5c7723[_0x217b('0x21')]=qs[_0x217b('0x21')](_0x289770[_0x217b('0x33')][_0x217b('0x21')]);}_0x5c7723[_0x217b('0x3b')]=qs['sort'](_0x289770[_0x217b('0x33')]['sort']);_0x5c7723['where']=qs[_0x217b('0x34')](_[_0x217b('0x3c')](_0x289770[_0x217b('0x33')],_0x21ef91['filters']),_0xe77380);if(_0x289770[_0x217b('0x33')][_0x217b('0x3d')]){_0x5c7723['where']=_[_0x217b('0x3e')](_0x5c7723[_0x217b('0x3f')],{'$or':_[_0x217b('0x2d')](_0xe77380,function(_0x498d4a){if(_0x498d4a[_0x217b('0x30')]!=='VIRTUAL'){var _0x738262={};_0x738262[_0x498d4a[_0x217b('0x2b')]]={'$like':'%'+_0x289770[_0x217b('0x33')]['filter']+'%'};return _0x738262;}})});}_0x5c7723=_['merge']({},_0x5c7723,_0x289770[_0x217b('0x40')]);var _0x424692={'where':_0x5c7723['where']};return db[_0x217b('0x2e')][_0x217b('0x22')](_0x424692)['then'](function(_0x1c1968){_0x1602d0[_0x217b('0x22')]=_0x1c1968;if(_0x289770[_0x217b('0x33')][_0x217b('0x41')]){_0x5c7723[_0x217b('0x42')]=[{'all':!![]}];}return db[_0x217b('0x2e')]['findAll'](_0x5c7723);})[_0x217b('0x27')](function(_0x4d2813){_0x1602d0[_0x217b('0x43')]=_0x4d2813;return _0x1602d0;})[_0x217b('0x27')](respondWithFilteredResult(_0x4532da,_0x5c7723))[_0x217b('0x44')](handleError(_0x4532da,null));};exports['show']=function(_0x2b315c,_0x2ae36a){var _0x358240={'raw':!![],'where':{'id':_0x2b315c[_0x217b('0x45')]['id']}},_0x25fdaf={};_0x25fdaf[_0x217b('0x32')]=_[_0x217b('0x46')](db[_0x217b('0x2e')][_0x217b('0x47')]);_0x25fdaf['query']=_['keys'](_0x2b315c[_0x217b('0x33')]);_0x25fdaf[_0x217b('0x34')]=_[_0x217b('0x35')](_0x25fdaf[_0x217b('0x32')],_0x25fdaf['query']);_0x358240[_0x217b('0x36')]=_[_0x217b('0x35')](_0x25fdaf['model'],qs[_0x217b('0x37')](_0x2b315c['query']['fields']));_0x358240['attributes']=_0x358240[_0x217b('0x36')]['length']?_0x358240[_0x217b('0x36')]:_0x25fdaf[_0x217b('0x32')];if(_0x2b315c['query'][_0x217b('0x41')]){_0x358240[_0x217b('0x42')]=[{'all':!![]}];}_0x358240=_[_0x217b('0x3e')]({},_0x358240,_0x2b315c['options']);return db[_0x217b('0x2e')][_0x217b('0x48')](_0x358240)['then'](handleEntityNotFound(_0x2ae36a,null))[_0x217b('0x27')](respondWithResult(_0x2ae36a,null))['catch'](handleError(_0x2ae36a,null));};exports['download']=function(_0x1103ec,_0x286aba,_0x4386da){return db['Plugin']['find']({'where':{'id':_0x1103ec[_0x217b('0x45')]['id']},'attributes':[_0x217b('0x2b'),_0x217b('0x5')],'raw':!![]})[_0x217b('0x27')](handleEntityNotFound(_0x286aba,null))[_0x217b('0x27')](function(_0x48d2e4){if(_0x48d2e4){var _0x316e0e=path[_0x217b('0x49')](config[_0x217b('0x4a')],_0x217b('0x4b'),util[_0x217b('0x4c')](_0x217b('0x4d'),path[_0x217b('0x4e')](_0x48d2e4['path'])));var _0x56081b=fs[_0x217b('0x4f')](_0x316e0e);var _0x13c82e=archiver(_0x217b('0x50'),{'zlib':{'level':0x9}});_0x13c82e['on'](_0x217b('0x51'),function(_0x58614a){if(_0x58614a[_0x217b('0x52')]===_0x217b('0x53')){logger['error'](_0x58614a);}else{throw new db[(_0x217b('0x54'))][(_0x217b('0x55'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x13c82e['on'](_0x217b('0x29'),function(_0x3b4d03){throw new db[(_0x217b('0x54'))][(_0x217b('0x55'))](_0x217b('0x56'));});_0x13c82e['pipe'](_0x56081b);_0x13c82e['glob'](_0x217b('0x57'),{'cwd':path[_0x217b('0x49')](config[_0x217b('0x4a')],_0x217b('0x4b'),path['dirname'](_0x48d2e4[_0x217b('0x5')])),'ignore':[path[_0x217b('0x49')](path[_0x217b('0x4e')](_0x48d2e4['path']),_0x217b('0x58')),path[_0x217b('0x49')](path[_0x217b('0x4e')](_0x48d2e4[_0x217b('0x5')]),_0x217b('0x59'))],'nodir':!![]})[_0x217b('0x5a')]();_0x56081b['on']('close',function(){if(!fs[_0x217b('0x5b')](_0x316e0e)){throw new db[(_0x217b('0x54'))][(_0x217b('0x55'))](_0x217b('0x5c'));}return _0x286aba[_0x217b('0x5d')](_0x316e0e,util['format']('%s.zip',path[_0x217b('0x4e')](_0x48d2e4[_0x217b('0x5')])),function(_0x20a84b){if(_0x20a84b){throw new db[(_0x217b('0x54'))][(_0x217b('0x55'))](_0x217b('0x5e'));}fs[_0x217b('0x5f')](_0x316e0e);logger[_0x217b('0x60')](_0x217b('0x61'));logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0x217b('0x44')](handleError(_0x286aba,null));};exports[_0x217b('0x62')]=function(_0x23806e,_0x5d2a7f,_0x5b0fad){var _0x2f82c3=path[_0x217b('0x4e')](_0x23806e['file'][_0x217b('0x63')],path[_0x217b('0x64')](_0x23806e[_0x217b('0x65')][_0x217b('0x63')]));var _0x31a618=path[_0x217b('0x49')](config[_0x217b('0x4a')],_0x217b('0x4b'),_0x23806e['file']['filename']);var _0x43bf0d=path[_0x217b('0x49')](config['root'],'server/files/plugins',_0x2f82c3);logger['info'](_0x217b('0x66'),_0x31a618);logger[_0x217b('0x60')]('Plugin\x20upload\x20destination:\x20%s',_0x43bf0d);try{fs['chmodSync'](_0x31a618,parseInt(_0x217b('0x67'),0x8));extract(_0x31a618,{'dir':_0x43bf0d},function(_0x245a79){if(_0x245a79){logger[_0x217b('0x29')](_0x245a79);handleError(_0x245a79,!![]);};var _0x78b443=fs[_0x217b('0x68')](_0x43bf0d);if(_0x78b443[_0x217b('0x38')]>0x1){removeReferences(_0x31a618,_0x43bf0d);logger['error']('Invalid\x20plugin\x20structure');return _0x5b0fad(new Error('Invalid\x20plugin\x20structure'));}var _0x1e990c=fs[_0x217b('0x69')](path[_0x217b('0x49')](_0x43bf0d,_0x78b443[0x0]));if(_0x1e990c[_0x217b('0x6a')]()){removeReferences(_0x31a618,_0x43bf0d);logger[_0x217b('0x29')]('Invalid\x20plugin\x20structure');return _0x5b0fad(new Error(_0x217b('0x6b')));}if(_0x1e990c[_0x217b('0x6c')]()){var _0x509d48=fs[_0x217b('0x68')](path[_0x217b('0x49')](_0x43bf0d,_0x78b443[0x0]));if(_0x509d48[_0x217b('0x38')]===0x0){removeReferences(_0x31a618,_0x43bf0d);logger[_0x217b('0x29')](_0x217b('0x6b'));return _0x5b0fad(new Error('Invalid\x20plugin\x20structure'));}var _0x822540=_0x509d48[_0x217b('0x6d')](function(_0x470225){return _0x470225===_0x217b('0x6e');});if(!_0x822540){return _0x5b0fad(new Error(_0x217b('0x6f')));}var _0x28c99a=fs[_0x217b('0x70')](path['join'](_0x43bf0d,_0x78b443[0x0],'manifest.json'));var _0xb978b2=JSON['parse'](_0x28c99a);if('undefined'==typeof _0xb978b2['name']){return _0x5b0fad(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x217b('0x1f')==typeof _0xb978b2[_0x217b('0x30')]){return _0x5b0fad(new Error(_0x217b('0x71')));}if(_0x217b('0x1f')==typeof _0xb978b2[_0x217b('0x72')]){return _0x5b0fad(new Error(_0x217b('0x73')));}if(_0x217b('0x1f')==typeof _0xb978b2[_0x217b('0x74')]){return _0x5b0fad(new Error(_0x217b('0x75')));}if(_0xb978b2[_0x217b('0x30')]===_0x217b('0x76')){if(_0x217b('0x1f')==typeof _0xb978b2[_0x217b('0x74')][_0x217b('0x77')]){return _0x5b0fad(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x217b('0x1f')==typeof _0xb978b2[_0x217b('0x74')][_0x217b('0x77')][_0x217b('0x78')]&&'undefined'==typeof _0xb978b2[_0x217b('0x74')]['views']['agent']){return _0x5b0fad(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0xb978b2[_0x217b('0x30')]===_0x217b('0x79')){if(_0x217b('0x1f')==typeof _0xb978b2[_0x217b('0x74')]['scriptName']){return _0x5b0fad(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x217b('0x1f')==typeof _0xb978b2['parameters'][_0x217b('0x7a')]){return _0x5b0fad(new Error(_0x217b('0x7b')));}}else{return _0x5b0fad(new Error(_0x217b('0x7c')));}var _0x32e012=_0xb978b2['name'];var _0x544a2c=_0xb978b2[_0x217b('0x7d')];var _0x151b53=_0xb978b2[_0x217b('0x30')];var _0x1b8c28=_0xb978b2['sidebar']?_0xb978b2[_0x217b('0x7e')]:_0x217b('0x7f');var _0x53e840=_0xb978b2[_0x217b('0x80')]?_0xb978b2[_0x217b('0x80')]:'icon-apps';var _0x2d5bae='';var _0x41d999='';var _0x1f4e06='';var _0xe87349='';var _0x23d086=_0xb978b2['version'];if(_0x151b53===_0x217b('0x76')){if(_0x217b('0x1f')!=typeof _0xb978b2[_0x217b('0x74')][_0x217b('0x77')][_0x217b('0x78')]){var _0x5825ed=_0xb978b2[_0x217b('0x74')][_0x217b('0x77')][_0x217b('0x78')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5825ed)){_0x2d5bae=path[_0x217b('0x49')]('plugins',_0x2f82c3,_0x78b443[0x0],_0x5825ed);}else{_0x2d5bae=_0x5825ed;}}else{logger[_0x217b('0x60')](_0x217b('0x81'));}if(_0x217b('0x1f')!=typeof _0xb978b2[_0x217b('0x74')][_0x217b('0x77')]['agent']){var _0x2dd350=_0xb978b2[_0x217b('0x74')][_0x217b('0x77')][_0x217b('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x217b('0x83')](_0x2dd350)){_0x41d999=path['join'](_0x217b('0x84'),_0x2f82c3,_0x78b443[0x0],_0x2dd350);}else{_0x41d999=_0x2dd350;}}else{logger['info'](_0x217b('0x85'));}}else if(_0x151b53===_0x217b('0x79')){_0x1f4e06=_0xb978b2[_0x217b('0x74')][_0x217b('0x86')];_0xe87349=_0xb978b2['parameters'][_0x217b('0x7a')];if(_0x217b('0x1f')!=typeof _0xb978b2[_0x217b('0x74')][_0x217b('0x77')]){if(_0x217b('0x1f')!=typeof _0xb978b2['parameters'][_0x217b('0x77')][_0x217b('0x78')]){var _0x5825ed=_0xb978b2['parameters'][_0x217b('0x77')][_0x217b('0x78')];if(!/^(f|ht)tps?:\/\//i[_0x217b('0x83')](_0x5825ed)){_0x2d5bae=path[_0x217b('0x49')](_0x217b('0x84'),_0x2f82c3,_0x78b443[0x0],_0x5825ed);}else{_0x2d5bae=_0x5825ed;}}if(_0x217b('0x1f')!=typeof _0xb978b2[_0x217b('0x74')][_0x217b('0x77')][_0x217b('0x82')]){var _0x2dd350=_0xb978b2[_0x217b('0x74')][_0x217b('0x77')][_0x217b('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x217b('0x83')](_0x2dd350)){_0x41d999=path[_0x217b('0x49')](_0x217b('0x84'),_0x2f82c3,_0x78b443[0x0],_0x2dd350);}else{_0x41d999=_0x2dd350;}}}}var _0x4beabc={'name':_0x32e012,'description':_0x544a2c,'path':path[_0x217b('0x49')](_0x2f82c3,_0x78b443[0x0]),'type':_0x151b53,'sidebar':_0x1b8c28,'icon':_0x53e840,'adminUrl':_0x2d5bae,'agentUrl':_0x41d999,'scriptName':_0x1f4e06,'scriptPath':_0xe87349,'version':_0x23d086};removeReferences(_0x31a618,null);return db[_0x217b('0x2e')][_0x217b('0x87')](_0x4beabc)[_0x217b('0x27')](function(_0x7f5f6d){var _0x454e02={'role':_0x23806e[_0x217b('0x88')][_0x217b('0x89')],'userProfileId':_0x23806e[_0x217b('0x88')][_0x217b('0x8a')]};if(!_0x454e02)throw new Error(_0x217b('0x8b'));if(_0x454e02[_0x217b('0x89')]===_0x217b('0x8c')){var _0xc6437d=_0x7f5f6d[_0x217b('0x28')]({'plain':!![]});return db[_0x217b('0x8d')]['find']({'where':{'name':_0x217b('0x8e'),'userProfileId':_0x454e02[_0x217b('0x8a')]},'raw':!![]})[_0x217b('0x27')](function(_0x435e6b){if(_0x435e6b&&_0x435e6b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xc6437d['name'],'resourceId':_0xc6437d['id'],'type':_0x435e6b[_0x217b('0x2b')],'sectionId':_0x435e6b['id']},{})[_0x217b('0x27')](function(){return _0x7f5f6d;});}else{return _0x7f5f6d;}})[_0x217b('0x44')](function(_0x17a608){logger[_0x217b('0x29')](_0x217b('0x8f'),_0x17a608);throw _0x17a608;});}return _0x7f5f6d;})[_0x217b('0x27')](respondWithResult(_0x5d2a7f,null))[_0x217b('0x44')](handleError(_0x5d2a7f,null));}});}catch(_0x4de3a8){_0x5d2a7f[_0x217b('0x1c')](0x1f4)[_0x217b('0x90')](_0x4de3a8);}};function removeReferences(_0x320f6f,_0x58acbd){try{if(_0x320f6f){fs[_0x217b('0x5f')](_0x320f6f);logger[_0x217b('0x60')](_0x217b('0x91'));}if(_0x58acbd){rimraf(_0x58acbd,function(){});logger[_0x217b('0x60')](_0x217b('0x92'));}}catch(_0x5aaf2a){logger[_0x217b('0x29')](_0x5aaf2a);}}exports[_0x217b('0x26')]=function(_0x1b4527,_0x5cb72f,_0x3753e4){return db[_0x217b('0x2e')][_0x217b('0x48')]({'where':{'id':_0x1b4527['params']['id']}})['then'](handleEntityNotFound(_0x5cb72f,null))[_0x217b('0x27')](saveUpdates(_0x1b4527[_0x217b('0x88')],null))[_0x217b('0x27')](respondWithResult(_0x5cb72f,null))[_0x217b('0x44')](handleError(_0x5cb72f,null));};exports[_0x217b('0x93')]=function(_0x550fa2,_0x506c5c,_0x1acd12){return db[_0x217b('0x2e')][_0x217b('0x48')]({'where':{'id':_0x550fa2['params']['id']}})[_0x217b('0x27')](function(_0x1d84c2){if(_0x1d84c2){return _0x1d84c2[_0x217b('0x94')]();}})['then'](function(_0x5dcf7a){rimraf(path['join'](config['root'],_0x217b('0x4b'),path['dirname'](_0x5dcf7a[_0x217b('0x5')])),function(){});return _0x5dcf7a;})['then'](handleEntityNotFound(_0x506c5c,null))[_0x217b('0x27')](respondWithStatusCode(_0x506c5c,null))['catch'](handleError(_0x506c5c,null));};exports[_0x217b('0x95')]=function(_0x2cd4af,_0x510f23,_0x554a81){return BPromise['resolve']()[_0x217b('0x27')](function(){if(!_0x2cd4af[_0x217b('0x33')][_0x217b('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2cd4af[_0x217b('0x33')][_0x217b('0x96')]){throw new Error(_0x217b('0x97'));}var _0x50d1f7=_0x2cd4af['query'][_0x217b('0x98')]?_0x2cd4af[_0x217b('0x33')][_0x217b('0x98')]+':'+_0x2cd4af[_0x217b('0x33')][_0x217b('0x96')]:_0x217b('0x99')+_0x2cd4af[_0x217b('0x33')][_0x217b('0x96')];var _0x15ac32=_0x2cd4af[_0x217b('0x33')][_0x217b('0x1e')]?_0x2cd4af[_0x217b('0x33')][_0x217b('0x1e')]:!![];var _0x6b089e=_0x2cd4af[_0x217b('0x33')][_0x217b('0x9a')]?_0x2cd4af[_0x217b('0x33')][_0x217b('0x9a')]:null;var _0x319d12={'method':_0x2cd4af[_0x217b('0x9b')],'uri':util[_0x217b('0x4c')]('%s%s',_0x50d1f7,_0x2cd4af[_0x217b('0x33')]['path']),'json':_0x15ac32,'resolveWithFullResponse':!![],'encoding':_0x6b089e,'qs':_0x2cd4af[_0x217b('0x33')]};if(_0x2cd4af[_0x217b('0x9c')]){_0x319d12[_0x217b('0x9c')]=_0x2cd4af[_0x217b('0x9c')];if(_0x319d12['headers']['content-length']){delete _0x319d12[_0x217b('0x9c')][_0x217b('0x9d')];}}if(_0x319d12['headers'][_0x217b('0x9e')]){delete _0x319d12[_0x217b('0x9c')][_0x217b('0x9e')];}return rp(_0x319d12);})[_0x217b('0x27')](function(_0x17682c){if(_0x17682c){_0x510f23['set'](_0x17682c[_0x217b('0x9c')]);logger[_0x217b('0x60')](_0x17682c[_0x217b('0x88')]);if(_['endsWith'](_0x2cd4af[_0x217b('0x33')][_0x217b('0x5')],'download')&&_0x17682c[_0x217b('0x9f')]==0x1f4){return _0x510f23[_0x217b('0x1b')](_0x17682c['statusCode']);}else{return _0x510f23[_0x217b('0x1c')](_0x17682c[_0x217b('0x9f')])[_0x217b('0x90')](_0x17682c['body']);}}else{return _0x510f23['sendStatus'](0xc8);}})[_0x217b('0x44')](handleError(_0x510f23,null));};exports[_0x217b('0xa0')]=function(_0x307f84,_0x2cfc77,_0x44c090){return BPromise['resolve']()['then'](function(){if(!_0x307f84[_0x217b('0x33')][_0x217b('0x5')]){throw new Error(_0x217b('0xa1'));}if(!_0x307f84[_0x217b('0x33')][_0x217b('0x96')]){throw new Error(_0x217b('0x97'));}var _0x32e2e6=_0x307f84[_0x217b('0x33')][_0x217b('0x98')]?_0x307f84['query'][_0x217b('0x98')]+':'+_0x307f84[_0x217b('0x33')][_0x217b('0x96')]:'http://localhost:'+_0x307f84[_0x217b('0x33')][_0x217b('0x96')];var _0x50d993=_0x307f84[_0x217b('0x33')][_0x217b('0x1e')]?_0x307f84[_0x217b('0x33')][_0x217b('0x1e')]:!![];var _0x532b98=_0x307f84[_0x217b('0x33')][_0x217b('0x9a')]?_0x307f84[_0x217b('0x33')][_0x217b('0x9a')]:null;var _0x19a447={'method':_0x307f84['method'],'uri':util[_0x217b('0x4c')](_0x217b('0xa2'),_0x32e2e6,_0x307f84[_0x217b('0x33')][_0x217b('0x5')]),'json':_0x50d993,'resolveWithFullResponse':!![],'encoding':_0x532b98,'body':_0x307f84[_0x217b('0x88')]};if(_0x307f84[_0x217b('0x9c')]){_0x19a447[_0x217b('0x9c')]=_0x307f84[_0x217b('0x9c')];if(_0x19a447[_0x217b('0x9c')][_0x217b('0x9d')]){delete _0x19a447[_0x217b('0x9c')]['content-length'];}}if(_0x19a447[_0x217b('0x9c')][_0x217b('0x9e')]){delete _0x19a447[_0x217b('0x9c')][_0x217b('0x9e')];}return rp(_0x19a447);})[_0x217b('0x27')](function(_0x4fb585){if(_0x4fb585){_0x2cfc77['set'](_0x4fb585['headers']);logger[_0x217b('0x60')](_0x4fb585[_0x217b('0x88')]);return _0x2cfc77[_0x217b('0x1c')](_0x4fb585[_0x217b('0x9f')])['send'](_0x4fb585[_0x217b('0x88')]);}else{return _0x2cfc77['sendStatus'](0xc8);}})[_0x217b('0x44')](handleError(_0x2cfc77,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index d32fc01..1816183 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 _0xcf71=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x3bddc4,_0x62365){var _0x2ecd97=function(_0xbded8b){while(--_0xbded8b){_0x3bddc4['push'](_0x3bddc4['shift']());}};_0x2ecd97(++_0x62365);}(_0xcf71,0xba));var _0x1cf7=function(_0x17174c,_0x266797){_0x17174c=_0x17174c-0x0;var _0x38125a=_0xcf71[_0x17174c];return _0x38125a;};'use strict';var EventEmitter=require(_0x1cf7('0x0'));var Plugin=require(_0x1cf7('0x1'))['db'][_0x1cf7('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x1cf7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1cf7('0x4'),'afterDestroy':_0x1cf7('0x5')};function emitEvent(_0xcc31bf){return function(_0x21307d,_0x11e462,_0x14d074){PluginEvents[_0x1cf7('0x6')](_0xcc31bf+':'+_0x21307d['id'],_0x21307d);PluginEvents[_0x1cf7('0x6')](_0xcc31bf,_0x21307d);_0x14d074(null);};}for(var e in events){if(events[_0x1cf7('0x7')](e)){var event=events[e];Plugin[_0x1cf7('0x8')](e,emitEvent(event));}}module[_0x1cf7('0x9')]=PluginEvents; \ No newline at end of file +var _0x4d87=['../../mysqldb','Plugin','setMaxListeners','update','remove','emit'];(function(_0x2a6b55,_0x572485){var _0x3dd7fd=function(_0x52837f){while(--_0x52837f){_0x2a6b55['push'](_0x2a6b55['shift']());}};_0x3dd7fd(++_0x572485);}(_0x4d87,0xf0));var _0x74d8=function(_0x59ecaa,_0x8bc20a){_0x59ecaa=_0x59ecaa-0x0;var _0x22ddb0=_0x4d87[_0x59ecaa];return _0x22ddb0;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x74d8('0x0'))['db'][_0x74d8('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x74d8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x74d8('0x3'),'afterDestroy':_0x74d8('0x4')};function emitEvent(_0x586bed){return function(_0x58792b,_0x391023,_0x1ec453){PluginEvents[_0x74d8('0x5')](_0x586bed+':'+_0x58792b['id'],_0x58792b);PluginEvents[_0x74d8('0x5')](_0x586bed,_0x58792b);_0x1ec453(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 997d885..fb1dd3c 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 _0xaf6c=['bluebird','request-promise','rimraf','Plugin','plugins','util','../../config/logger','moment'];(function(_0x50cc54,_0x54c15f){var _0x28ecca=function(_0x4eff92){while(--_0x4eff92){_0x50cc54['push'](_0x50cc54['shift']());}};_0x28ecca(++_0x54c15f);}(_0xaf6c,0x13d));var _0xcaf6=function(_0x3903b7,_0x1cac1d){_0x3903b7=_0x3903b7-0x0;var _0x20304c=_0xaf6c[_0x3903b7];return _0x20304c;};'use strict';var _=require('lodash');var util=require(_0xcaf6('0x0'));var logger=require(_0xcaf6('0x1'))('api');var moment=require(_0xcaf6('0x2'));var BPromise=require(_0xcaf6('0x3'));var rp=require(_0xcaf6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaf6('0x5'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module['exports']=function(_0xc1bbf8,_0x168cd1){return _0xc1bbf8['define'](_0xcaf6('0x6'),attributes,{'tableName':_0xcaf6('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa86f=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./plugin.attributes','exports','plugins','lodash'];(function(_0x5b1294,_0xddf710){var _0x458765=function(_0x3b66a6){while(--_0x3b66a6){_0x5b1294['push'](_0x5b1294['shift']());}};_0x458765(++_0xddf710);}(_0xa86f,0x1b7));var _0xfa86=function(_0x352051,_0x3af95c){_0x352051=_0x352051-0x0;var _0xcdf453=_0xa86f[_0x352051];return _0xcdf453;};'use strict';var _=require(_0xfa86('0x0'));var util=require('util');var logger=require(_0xfa86('0x1'))('api');var moment=require(_0xfa86('0x2'));var BPromise=require(_0xfa86('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa86('0x4'));var rimraf=require(_0xfa86('0x5'));var config=require(_0xfa86('0x6'));var attributes=require(_0xfa86('0x7'));module[_0xfa86('0x8')]=function(_0x339931,_0x2d7254){return _0x339931['define']('Plugin',attributes,{'tableName':_0xfa86('0x9'),'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 10caae7..88b3da6 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 _0x6ea9=['debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Plugin','create','body','options','raw','CreatePlugin'];(function(_0xac8e9c,_0x2570bd){var _0x4eab81=function(_0x3acae0){while(--_0x3acae0){_0xac8e9c['push'](_0xac8e9c['shift']());}};_0x4eab81(++_0x2570bd);}(_0x6ea9,0x89));var _0x96ea=function(_0x4215d8,_0x111352){_0x4215d8=_0x4215d8-0x0;var _0x3b7105=_0x6ea9[_0x4215d8];return _0x3b7105;};'use strict';var _=require(_0x96ea('0x0'));var util=require(_0x96ea('0x1'));var moment=require(_0x96ea('0x2'));var BPromise=require(_0x96ea('0x3'));var rs=require(_0x96ea('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96ea('0x5'))['db'];var utils=require(_0x96ea('0x6'));var logger=require(_0x96ea('0x7'))('rpc');var config=require(_0x96ea('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x96ea('0x9')]['http']({'port':0x232a});config[_0x96ea('0xa')]=_['defaults'](config[_0x96ea('0xa')],{'host':_0x96ea('0xb'),'port':0x18eb});var socket=require(_0x96ea('0xc'))(new Redis(config[_0x96ea('0xa')]));require(_0x96ea('0xd'))[_0x96ea('0xe')](socket);function respondWithRpcPromise(_0x542e92,_0x3adb14,_0x446323){return new BPromise(function(_0x17ae72,_0x37d26c){return client[_0x96ea('0xf')](_0x542e92,_0x446323)[_0x96ea('0x10')](function(_0xaa017e){logger[_0x96ea('0x11')](_0x96ea('0x12'),_0x3adb14,_0x96ea('0x13'));logger['debug'](_0x96ea('0x14'),_0x3adb14,'request\x20sent',JSON[_0x96ea('0x15')](_0xaa017e));if(_0xaa017e[_0x96ea('0x16')]){if(_0xaa017e['error'][_0x96ea('0x17')]===0x1f4){logger[_0x96ea('0x16')](_0x96ea('0x12'),_0x3adb14,_0xaa017e[_0x96ea('0x16')][_0x96ea('0x18')]);return _0x37d26c(_0xaa017e[_0x96ea('0x16')][_0x96ea('0x18')]);}logger[_0x96ea('0x16')]('Plugin,\x20%s,\x20%s',_0x3adb14,_0xaa017e[_0x96ea('0x16')]['message']);return _0x17ae72(_0xaa017e['error'][_0x96ea('0x18')]);}else{logger[_0x96ea('0x11')]('Plugin,\x20%s,\x20%s',_0x3adb14,_0x96ea('0x13'));_0x17ae72(_0xaa017e[_0x96ea('0x19')][_0x96ea('0x18')]);}})[_0x96ea('0x1a')](function(_0x23e0f8){logger[_0x96ea('0x16')](_0x96ea('0x12'),_0x3adb14,_0x23e0f8);_0x37d26c(_0x23e0f8);});});}exports['CreatePlugin']=function(_0x4cd61c){var _0x121b7f=this;return new Promise(function(_0x1df70e,_0xfaec11){return db[_0x96ea('0x1b')][_0x96ea('0x1c')](_0x4cd61c[_0x96ea('0x1d')],{'raw':_0x4cd61c[_0x96ea('0x1e')]?_0x4cd61c[_0x96ea('0x1e')][_0x96ea('0x1f')]===undefined?!![]:![]:!![]})[_0x96ea('0x10')](function(_0x3a99f6){logger['info'](_0x96ea('0x20'),_0x4cd61c);logger[_0x96ea('0x21')](_0x96ea('0x20'),_0x4cd61c,JSON[_0x96ea('0x15')](_0x3a99f6));_0x1df70e(_0x3a99f6);})[_0x96ea('0x1a')](function(_0x1676e7){logger['error'](_0x96ea('0x20'),_0x1676e7['message'],_0x4cd61c);_0xfaec11(_0x121b7f[_0x96ea('0x16')](0x1f4,_0x1676e7[_0x96ea('0x18')]));});});}; \ No newline at end of file +var _0xee4f=['bluebird','randomstring','ioredis','../../config/utils','rpc','client','defaults','redis','localhost','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreatePlugin','Plugin','create','body','options','then','stringify','lodash'];(function(_0x451a69,_0x17a8da){var _0x418d46=function(_0x573663){while(--_0x573663){_0x451a69['push'](_0x451a69['shift']());}};_0x418d46(++_0x17a8da);}(_0xee4f,0xad));var _0xfee4=function(_0x1a90a4,_0x407549){_0x1a90a4=_0x1a90a4-0x0;var _0x5803c2=_0xee4f[_0x1a90a4];return _0x5803c2;};'use strict';var _=require(_0xfee4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfee4('0x1'));var rs=require(_0xfee4('0x2'));var fs=require('fs');var Redis=require(_0xfee4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfee4('0x4'));var logger=require('../../config/logger')(_0xfee4('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfee4('0x6')]['http']({'port':0x232a});config['redis']=_[_0xfee4('0x7')](config[_0xfee4('0x8')],{'host':_0xfee4('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfee4('0xa'))[_0xfee4('0xb')](socket);function respondWithRpcPromise(_0xa77876,_0x4dc812,_0x53f260){return new BPromise(function(_0x2ca5f9,_0x1d6855){return client[_0xfee4('0xc')](_0xa77876,_0x53f260)['then'](function(_0x2ef3c3){logger[_0xfee4('0xd')](_0xfee4('0xe'),_0x4dc812,_0xfee4('0xf'));logger[_0xfee4('0x10')](_0xfee4('0x11'),_0x4dc812,_0xfee4('0xf'),JSON['stringify'](_0x2ef3c3));if(_0x2ef3c3[_0xfee4('0x12')]){if(_0x2ef3c3[_0xfee4('0x12')]['code']===0x1f4){logger[_0xfee4('0x12')](_0xfee4('0xe'),_0x4dc812,_0x2ef3c3[_0xfee4('0x12')][_0xfee4('0x13')]);return _0x1d6855(_0x2ef3c3[_0xfee4('0x12')][_0xfee4('0x13')]);}logger[_0xfee4('0x12')]('Plugin,\x20%s,\x20%s',_0x4dc812,_0x2ef3c3[_0xfee4('0x12')][_0xfee4('0x13')]);return _0x2ca5f9(_0x2ef3c3[_0xfee4('0x12')]['message']);}else{logger[_0xfee4('0xd')]('Plugin,\x20%s,\x20%s',_0x4dc812,'request\x20sent');_0x2ca5f9(_0x2ef3c3[_0xfee4('0x14')][_0xfee4('0x13')]);}})[_0xfee4('0x15')](function(_0x44a1ec){logger[_0xfee4('0x12')](_0xfee4('0xe'),_0x4dc812,_0x44a1ec);_0x1d6855(_0x44a1ec);});});}exports[_0xfee4('0x16')]=function(_0x22766){var _0x153649=this;return new Promise(function(_0x5826da,_0x194cd8){return db[_0xfee4('0x17')][_0xfee4('0x18')](_0x22766[_0xfee4('0x19')],{'raw':_0x22766[_0xfee4('0x1a')]?_0x22766[_0xfee4('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xfee4('0x1b')](function(_0xd97878){logger[_0xfee4('0xd')](_0xfee4('0x16'),_0x22766);logger[_0xfee4('0x10')](_0xfee4('0x16'),_0x22766,JSON[_0xfee4('0x1c')](_0xd97878));_0x5826da(_0xd97878);})[_0xfee4('0x15')](function(_0x3ac09a){logger[_0xfee4('0x12')]('CreatePlugin',_0x3ac09a['message'],_0x22766);_0x194cd8(_0x153649['error'](0x1f4,_0x3ac09a['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 4fae6f8..128ef0f 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 _0x0aac=['plugin:','save','emit','register','length'];(function(_0x239d36,_0xf56ab2){var _0x97d06c=function(_0x47af15){while(--_0x47af15){_0x239d36['push'](_0x239d36['shift']());}};_0x97d06c(++_0xf56ab2);}(_0x0aac,0x146));var _0xc0aa=function(_0x1f8e33,_0x300371){_0x1f8e33=_0x1f8e33-0x0;var _0x37b939=_0x0aac[_0x1f8e33];return _0x37b939;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xc0aa('0x0'),'remove','update'];function createListener(_0x7a80b7,_0x19244c){return function(_0x38a9c3){_0x19244c[_0xc0aa('0x1')](_0x7a80b7,_0x38a9c3);};}function removeListener(_0x177a63,_0x40fe98){return function(){PluginEvents['removeListener'](_0x177a63,_0x40fe98);};}exports[_0xc0aa('0x2')]=function(_0x54d82d){for(var _0x21f53a=0x0,_0x219db9=events[_0xc0aa('0x3')];_0x21f53a<_0x219db9;_0x21f53a++){var _0xbd8a56=events[_0x21f53a];var _0x230524=createListener(_0xc0aa('0x4')+_0xbd8a56,_0x54d82d);PluginEvents['on'](_0xbd8a56,_0x230524);}}; \ No newline at end of file +var _0x25c3=['update','removeListener','register','length','plugin:','./plugin.events','save'];(function(_0x3828cf,_0x1579ee){var _0xfcaf5b=function(_0x56747d){while(--_0x56747d){_0x3828cf['push'](_0x3828cf['shift']());}};_0xfcaf5b(++_0x1579ee);}(_0x25c3,0x15c));var _0x325c=function(_0x4d0893,_0x273d32){_0x4d0893=_0x4d0893-0x0;var _0x3fe266=_0x25c3[_0x4d0893];return _0x3fe266;};'use strict';var PluginEvents=require(_0x325c('0x0'));var events=[_0x325c('0x1'),'remove',_0x325c('0x2')];function createListener(_0x3d336e,_0x18ec9b){return function(_0x40cdf5){_0x18ec9b['emit'](_0x3d336e,_0x40cdf5);};}function removeListener(_0x395cf8,_0x2c0712){return function(){PluginEvents[_0x325c('0x3')](_0x395cf8,_0x2c0712);};}exports[_0x325c('0x4')]=function(_0x3c4b10){for(var _0x4af361=0x0,_0x48f344=events[_0x325c('0x5')];_0x4af361<_0x48f344;_0x4af361++){var _0x40f572=events[_0x4af361];var _0x1299d7=createListener(_0x325c('0x6')+_0x40f572,_0x3c4b10);PluginEvents['on'](_0x40f572,_0x1299d7);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 6f8036d..a2e1831 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(_0x3eda3f,_0x590c4a){var _0x33510c=function(_0x5e7921){while(--_0x5e7921){_0x3eda3f['push'](_0x3eda3f['shift']());}};_0x33510c(++_0x590c4a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x40e15b,_0x36f5de){var _0x316e4d=function(_0x35045e){while(--_0x35045e){_0x40e15b['push'](_0x40e15b['shift']());}};_0x316e4d(++_0x36f5de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 d16f2ec..cb43412 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 _0x0102=['length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','destroy','delete','../../config/pm2','../../config/logger','api','path','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','then','reject','express'];(function(_0xd9b42f,_0x17b406){var _0x217fb8=function(_0x4c0182){while(--_0x4c0182){_0xd9b42f['push'](_0xd9b42f['shift']());}};_0x217fb8(++_0x17b406);}(_0x0102,0x186));var _0x2010=function(_0x262104,_0x260de1){_0x262104=_0x262104-0x0;var _0x2e8d40=_0x0102[_0x262104];return _0x2e8d40;};'use strict';var _=require('lodash');var pm2=require(_0x2010('0x0'));var logger=require(_0x2010('0x1'))(_0x2010('0x2'));var path=require(_0x2010('0x3'));var exec=require('child_process')['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x4e30b3,_0x59082d){return function(_0x22e49f){if(!_0x22e49f){_0x4e30b3[_0x2010('0x4')](0x194);;}return _0x22e49f;};}function respondWithResult(_0x130725,_0x304264){_0x304264=_0x304264||0xc8;return function(_0x4eeb67){if(_0x4eeb67){return _0x130725[_0x2010('0x5')](_0x304264)['json'](_0x4eeb67);}return null;};}function handleError(_0x4728c0,_0x160e41){_0x160e41=_0x160e41||0x1f4;return function(_0x48dd91){logger[_0x2010('0x6')](_0x48dd91[_0x2010('0x7')]);if(_0x48dd91[_0x2010('0x8')]){delete _0x48dd91[_0x2010('0x8')];}_0x4728c0[_0x2010('0x5')](_0x160e41)[_0x2010('0x9')](_0x48dd91);};}function execChildProcess(){return new BPromise(function(_0x289ad4,_0x466c71){exec(_0x2010('0xa'),function(_0x39a821,_0x1d3b39,_0x32fe2e){logger[_0x2010('0xb')](_0x1d3b39);logger[_0x2010('0xb')](_0x32fe2e);if(_0x39a821){logger[_0x2010('0x6')](_0x39a821);return _0x466c71(_0x39a821);}return _0x289ad4(_0x1d3b39);});});}exports[_0x2010('0xc')]=function(_0x528a38,_0x579340){return pm2[_0x2010('0xd')]()[_0x2010('0xe')](function(_0x2e8ec2){if(_0x2e8ec2){var _0x10b587=_[_0x2010('0xf')](_0x2e8ec2,function(_0x335be4){return _0x335be4['name']===_0x2010('0x10')||_0x335be4[_0x2010('0x8')]==='motion2';});return{'rows':_0x10b587,'count':_0x10b587[_0x2010('0x11')]};}return null;})[_0x2010('0xe')](respondWithResult(_0x579340,null))[_0x2010('0x12')](handleError(_0x579340,null));};exports[_0x2010('0x13')]=function(_0x2d0bf2,_0x11bd28){return pm2[_0x2010('0x14')](_0x2d0bf2[_0x2010('0x15')]['id'])[_0x2010('0xe')](respondWithResult(_0x11bd28,null))['then'](handleEntityNotFound(_0x11bd28,null))['catch'](handleError(_0x11bd28,null));};exports[_0x2010('0x16')]=function(_0x38a15a,_0x3f9d62){if(_0x38a15a[_0x2010('0x17')]['name']&&_0x38a15a['body'][_0x2010('0x18')]){var _0x171e45=path[_0x2010('0x19')](__dirname,_0x2010('0x1a'),_0x38a15a[_0x2010('0x17')][_0x2010('0x18')]);var _0x4f621c=process[_0x2010('0x1b')]();process[_0x2010('0x1c')](path['dirname'](_0x171e45));return execChildProcess()['then'](function(_0x50aecc){process[_0x2010('0x1c')](_0x4f621c);return pm2['start']({'name':_0x38a15a[_0x2010('0x17')]['name'],'script':_0x171e45});})['then'](function(_0xdb57be){pm2[_0x2010('0x1d')]();return _0xdb57be[0x0];})['then'](respondWithResult(_0x3f9d62,0xc9))[_0x2010('0x12')](handleError(_0x3f9d62,null));}else{return _0x3f9d62['status'](0x1f4)[_0x2010('0x9')]({'message':_0x2010('0x1e')});}};exports[_0x2010('0x1f')]=function(_0x3dcea4,_0x3c5862){if(_0x3dcea4[_0x2010('0x17')]['id']){delete _0x3dcea4[_0x2010('0x17')]['id'];}var _0x3eb4dc={'online':_0x2010('0x20'),'stopped':_0x2010('0x21')};if(_0x3eb4dc[_0x2010('0x22')](_0x3dcea4[_0x2010('0x17')]['status'])){return pm2[_0x3eb4dc[_0x3dcea4[_0x2010('0x17')]['status']]](_0x3dcea4[_0x2010('0x15')]['id'])[_0x2010('0xe')](respondWithResult(_0x3c5862,0xc8))[_0x2010('0x12')](handleError(_0x3c5862,null));}else{return _0x3c5862[_0x2010('0x5')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0x2010('0x23')]=function(_0x48d9f2,_0x2839f2){if(_0x48d9f2[_0x2010('0x17')]['id']){delete _0x48d9f2['body']['id'];}if(_0x48d9f2[_0x2010('0x15')]['id']){return pm2[_0x2010('0x24')](_0x48d9f2[_0x2010('0x15')]['id'])[_0x2010('0xe')](function(_0x692ddc){pm2['dump']();return _0x692ddc[0x0];})[_0x2010('0xe')](respondWithResult(_0x2839f2,null))[_0x2010('0x12')](handleError(_0x2839f2,null));}else{return _0x2839f2[_0x2010('0x5')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xa74f=['child_process','exec','bluebird','status','json','error','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','body','script','cwd','chdir','Missing\x20name\x20and/or\x20path','restart','stop','Unknown\x20status','params','delete','dump','../../config/logger'];(function(_0x43e7fb,_0x37fbf4){var _0x21d13c=function(_0x4f2f19){while(--_0x4f2f19){_0x43e7fb['push'](_0x43e7fb['shift']());}};_0x21d13c(++_0x37fbf4);}(_0xa74f,0x9a));var _0xfa74=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0xa74f[_0x163040];return _0x364667;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0xfa74('0x0'))('api');var path=require('path');var exec=require(_0xfa74('0x1'))[_0xfa74('0x2')];var BPromise=require(_0xfa74('0x3'));function handleEntityNotFound(_0x25a9b7,_0x5b367b){return function(_0x141625){if(!_0x141625){_0x25a9b7['sendStatus'](0x194);;}return _0x141625;};}function respondWithResult(_0x543cfe,_0x43dd2f){_0x43dd2f=_0x43dd2f||0xc8;return function(_0x9ddbd2){if(_0x9ddbd2){return _0x543cfe[_0xfa74('0x4')](_0x43dd2f)[_0xfa74('0x5')](_0x9ddbd2);}return null;};}function handleError(_0x287921,_0x344e04){_0x344e04=_0x344e04||0x1f4;return function(_0x5c0eb2){logger[_0xfa74('0x6')](_0x5c0eb2[_0xfa74('0x7')]);if(_0x5c0eb2[_0xfa74('0x8')]){delete _0x5c0eb2[_0xfa74('0x8')];}_0x287921['status'](_0x344e04)[_0xfa74('0x9')](_0x5c0eb2);};}function execChildProcess(){return new BPromise(function(_0x4f8891,_0x48695c){exec(_0xfa74('0xa'),function(_0x1d919d,_0x30b2d5,_0x307d35){logger['info'](_0x30b2d5);logger[_0xfa74('0xb')](_0x307d35);if(_0x1d919d){logger[_0xfa74('0x6')](_0x1d919d);return _0x48695c(_0x1d919d);}return _0x4f8891(_0x30b2d5);});});}exports[_0xfa74('0xc')]=function(_0x278e8b,_0x4ad407){return pm2[_0xfa74('0xd')]()[_0xfa74('0xe')](function(_0x3eb49b){if(_0x3eb49b){var _0x3947ca=_[_0xfa74('0xf')](_0x3eb49b,function(_0x47c8fb){return _0x47c8fb[_0xfa74('0x8')]===_0xfa74('0x10')||_0x47c8fb[_0xfa74('0x8')]===_0xfa74('0x11');});return{'rows':_0x3947ca,'count':_0x3947ca[_0xfa74('0x12')]};}return null;})[_0xfa74('0xe')](respondWithResult(_0x4ad407,null))[_0xfa74('0x13')](handleError(_0x4ad407,null));};exports['show']=function(_0x58a67a,_0xe0e33d){return pm2['describe'](_0x58a67a['params']['id'])[_0xfa74('0xe')](respondWithResult(_0xe0e33d,null))[_0xfa74('0xe')](handleEntityNotFound(_0xe0e33d,null))[_0xfa74('0x13')](handleError(_0xe0e33d,null));};exports['create']=function(_0x3bede6,_0x2edebb){if(_0x3bede6[_0xfa74('0x14')]['name']&&_0x3bede6[_0xfa74('0x14')][_0xfa74('0x15')]){var _0x2e6c33=path['join'](__dirname,'../../files/plugins',_0x3bede6[_0xfa74('0x14')][_0xfa74('0x15')]);var _0x9932db=process[_0xfa74('0x16')]();process[_0xfa74('0x17')](path['dirname'](_0x2e6c33));return execChildProcess()['then'](function(_0x3721bf){process['chdir'](_0x9932db);return pm2['start']({'name':_0x3bede6['body'][_0xfa74('0x8')],'script':_0x2e6c33});})[_0xfa74('0xe')](function(_0x42d9bf){pm2['dump']();return _0x42d9bf[0x0];})['then'](respondWithResult(_0x2edebb,0xc9))[_0xfa74('0x13')](handleError(_0x2edebb,null));}else{return _0x2edebb[_0xfa74('0x4')](0x1f4)['send']({'message':_0xfa74('0x18')});}};exports['update']=function(_0x1a8cf7,_0x153b2a){if(_0x1a8cf7['body']['id']){delete _0x1a8cf7[_0xfa74('0x14')]['id'];}var _0x1130de={'online':_0xfa74('0x19'),'stopped':_0xfa74('0x1a')};if(_0x1130de['hasOwnProperty'](_0x1a8cf7[_0xfa74('0x14')][_0xfa74('0x4')])){return pm2[_0x1130de[_0x1a8cf7[_0xfa74('0x14')]['status']]](_0x1a8cf7['params']['id'])[_0xfa74('0xe')](respondWithResult(_0x153b2a,0xc8))[_0xfa74('0x13')](handleError(_0x153b2a,null));}else{return _0x153b2a['status'](0x1f4)['send']({'message':_0xfa74('0x1b')});}};exports['destroy']=function(_0x2238d4,_0x4d6d0a){if(_0x2238d4[_0xfa74('0x14')]['id']){delete _0x2238d4[_0xfa74('0x14')]['id'];}if(_0x2238d4[_0xfa74('0x1c')]['id']){return pm2[_0xfa74('0x1d')](_0x2238d4['params']['id'])[_0xfa74('0xe')](function(_0x102d47){pm2[_0xfa74('0x1e')]();return _0x102d47[0x0];})[_0xfa74('0xe')](respondWithResult(_0x4d6d0a,null))[_0xfa74('0x13')](handleError(_0x4d6d0a,null));}else{return _0x4d6d0a[_0xfa74('0x4')](0x1f4)[_0xfa74('0x9')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index c3b223c..8015117 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 _0x034c=['/agents','isAuthenticated','getAgents','getQueues','exports','Router','./realtime.controller','get'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0x034c,0x7d));var _0xc034=function(_0x4a238c,_0x1ff302){_0x4a238c=_0x4a238c-0x0;var _0x424bbe=_0x034c[_0x4a238c];return _0x424bbe;};'use strict';var express=require('express');var router=express[_0xc034('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xc034('0x1'));router[_0xc034('0x2')](_0xc034('0x3'),auth[_0xc034('0x4')](),controller[_0xc034('0x5')]);router[_0xc034('0x2')]('/queues',auth[_0xc034('0x4')](),controller[_0xc034('0x6')]);module[_0xc034('0x7')]=router; \ No newline at end of file +var _0x9e96=['isAuthenticated','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get','/agents','/queues'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9e96,0x1d9));var _0x69e9=function(_0x1abe7c,_0x470b02){_0x1abe7c=_0x1abe7c-0x0;var _0x4481bc=_0x9e96[_0x1abe7c];return _0x4481bc;};'use strict';var express=require(_0x69e9('0x0'));var router=express[_0x69e9('0x1')]();var auth=require(_0x69e9('0x2'));var controller=require(_0x69e9('0x3'));router[_0x69e9('0x4')](_0x69e9('0x5'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x69e9('0x6'),auth[_0x69e9('0x7')](),controller[_0x69e9('0x8')]);module[_0x69e9('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 5407e04..0135d2a 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 _0x5afb=['../../errors/api','undefined','limit','count','offset','getAgents','query','globalStatusFilter','pauseTypeFilter','pause','then','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','fields','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','User','fieldName','key','role','agent','online','getOptions','raw','length','sequelize','literal','FIELD(id,','*pause','push','Pause','forEach','where','merge','user','Agents','extraQueryConditions','assign','UserProfile','findAndCountAll','map','find','filterAgentAttributes','getAgentStatus','Status','sortAgentsByStatus','split','getQueues','resolve','format','startCase','type','name','voice','outbound','dialActive','userProfileId','QueueCampaigns','Queues','filter','getRealtimeQueues','catch','lodash','util','../../components/realtime/agents','../../config/utils','../../mysqldb','APIBadRequestError'];(function(_0x3f6ef0,_0xd32324){var _0x17c1f0=function(_0x9b4222){while(--_0x9b4222){_0x3f6ef0['push'](_0x3f6ef0['shift']());}};_0x17c1f0(++_0xd32324);}(_0x5afb,0x1c8));var _0xb5af=function(_0x3e2789,_0x6d23c6){_0x3e2789=_0x3e2789-0x0;var _0x4371ba=_0x5afb[_0x3e2789];return _0x4371ba;};'use strict';var _=require(_0xb5af('0x0'));var util=require(_0xb5af('0x1'));var rta=require(_0xb5af('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0xb5af('0x3'));var db=require(_0xb5af('0x4'))['db'];var APIBadRequestError=require('../../errors/api')[_0xb5af('0x5')];var APIHandleError=require(_0xb5af('0x6'))['handleError'];function respondWithFilteredResult(_0x3811ef,_0x51d067){return function(_0x2e3180){if(_0x2e3180){var _0x3a01de=typeof _0x51d067['offset']===_0xb5af('0x7')&&typeof _0x51d067[_0xb5af('0x8')]===_0xb5af('0x7');var _0x57a63d=_0x2e3180[_0xb5af('0x9')];var _0x9631fd=_0x3a01de?0x0:_0x51d067['offset'];var _0x124218=_0x3a01de?_0x2e3180[_0xb5af('0x9')]:_0x51d067[_0xb5af('0xa')]+_0x51d067[_0xb5af('0x8')];var _0x236301;if(_0x124218>=_0x57a63d){_0x124218=_0x57a63d;_0x236301=0xc8;}else{_0x236301=0xce;}_0x3811ef['status'](_0x236301);return _0x3811ef['set']('Content-Range',_0x9631fd+'-'+_0x124218+'/'+_0x57a63d)['json'](_0x2e3180);}return null;};}exports[_0xb5af('0xb')]=function(_0x53262d,_0x5aace1){var _0x317411={'count':0x0,'rows':[]};var _0x2dbf72={};var _0x464645;var _0x5fa68=utils['getChannels']();var _0x4a4c16;var _0x211938;var _0x3eede2=_0x53262d[_0xb5af('0xc')]['globalQueueFilter'];var _0x20d1e5=_0x53262d[_0xb5af('0xc')][_0xb5af('0xd')];var _0x1a038b=_0x53262d[_0xb5af('0xc')][_0xb5af('0xe')];var _0x4df08e=_0x20d1e5===_0xb5af('0xf')||_0x20d1e5==='*pause'?!![]:![];var _0x2d8130=[];var _0x21acd4;var _0xaaca6b;Promise['resolve']()[_0xb5af('0x10')](function(){if(_0x53262d['query'][_0xb5af('0x11')]){if(!utils[_0xb5af('0x12')](_0x53262d[_0xb5af('0xc')][_0xb5af('0x11')])){throw new APIBadRequestError(util['format'](_0xb5af('0x13'),_0x53262d[_0xb5af('0xc')][_0xb5af('0x11')]));}_0x464645=_0x53262d['query'][_0xb5af('0x11')][_0xb5af('0x14')]();}if(!_0x53262d[_0xb5af('0xc')]['sort']||!_0x53262d['query'][_0xb5af('0x15')][_0xb5af('0x16')](_0xb5af('0x17'))){_0x53262d[_0xb5af('0xc')]['sort']=rta[_0xb5af('0x18')](_0x53262d[_0xb5af('0xc')][_0xb5af('0x15')]);return;}var _0xb6d9a2=rta['getUpdatedSortOptions'](_0x53262d[_0xb5af('0xc')][_0xb5af('0x15')]);_0x53262d['query'][_0xb5af('0x15')]=_0xb6d9a2[_0xb5af('0x19')]['join'](',');_0x21acd4=_0xb6d9a2[_0xb5af('0x1a')];})[_0xb5af('0x10')](function(){if(!_0x3eede2){return[];}return rta[_0xb5af('0x1b')](_0x3eede2,_0x464645);})['then'](function(_0x457b85){_0x2d8130=_0x457b85;return rta[_0xb5af('0x1c')]();})[_0xb5af('0x10')](function(_0x4ef6a6){_0x211938=_0x4ef6a6[_0xb5af('0x1d')];if((!_0x20d1e5||_0x4df08e)&&!_0x21acd4){return _0x2d8130;}if(_0x21acd4&&!_0x20d1e5){return rta[_0xb5af('0x1e')](_0x211938,_0x2d8130,_0x21acd4);}else{return rta['getAgentIdsByStatus'](_0x211938,_0x2d8130,_0x20d1e5);}})[_0xb5af('0x10')](function(_0x4add79){_0x2d8130=_0x4add79;var _0x1ede56=![];if(_0x2d8130['length']===0x0){if(_0x3eede2||_0x20d1e5){_0x1ede56=!![];}if(_0x4df08e){_0x1ede56=![];}}if(_0x1ede56){return _0x317411;}var _0x3a622e=_['map'](db[_0xb5af('0x1f')]['rawAttributes'],function(_0x438422){return{'name':_0x438422[_0xb5af('0x20')],'type':_0x438422['type'][_0xb5af('0x21')]};});_0x53262d[_0xb5af('0xc')][_0xb5af('0x22')]=_0xb5af('0x23');_0x53262d['query'][_0xb5af('0x24')]=!![];_0x2dbf72=qs[_0xb5af('0x25')](_0x3a622e,_0x53262d);_0x2dbf72[_0xb5af('0x26')]=!![];var _0x180056=[];if(_0x2d8130[_0xb5af('0x27')]>0x0){_0x180056['push']({'id':{'$in':_0x2d8130}});if(_0x21acd4&&!_0x20d1e5){_0xaaca6b=[db[_0xb5af('0x28')][_0xb5af('0x29')](_0xb5af('0x2a')+_0x2d8130+')')];_0x2dbf72[_0xb5af('0x1a')]=_0xaaca6b;}}if(_0x4df08e){_0x5fa68['forEach'](function(_0x16ae66){var _0x2bbdaa=!![];if(_0x20d1e5===_0xb5af('0x2b')&&_0x464645!==_0x16ae66){_0x2bbdaa=![];}_0x180056[_0xb5af('0x2c')]({[_0x16ae66+_0xb5af('0x2d')]:_0x2bbdaa});});if(_0x1a038b){_0x180056['push']({'pauseType':_0x1a038b});}}else if(_0x20d1e5){_0x5fa68[_0xb5af('0x2e')](function(_0x3fcdcb){_0x180056[_0xb5af('0x2c')]({[_0x3fcdcb+_0xb5af('0x2d')]:![]});});}_0x2dbf72[_0xb5af('0x2f')]=_[_0xb5af('0x30')](_0x2dbf72['where'],{'$and':_0x180056});if(_0x53262d['user'][_0xb5af('0x22')]===_0xb5af('0x31')){var _0x45593a={'params':{'id':_0x53262d[_0xb5af('0x31')]['userProfileId']},'query':{'section':_0xb5af('0x32'),'role':_0xb5af('0x23'),'online':!![],'raw':!![],'ids':_0x2d8130,'customSorting':_0xaaca6b}};if(_0x4df08e){_0x45593a[_0xb5af('0xc')][_0xb5af('0x33')]=_0x180056;}_0x45593a[_0xb5af('0xc')]=Object[_0xb5af('0x34')](_0x45593a[_0xb5af('0xc')],_0x53262d[_0xb5af('0xc')]);delete _0x45593a[_0xb5af('0xc')]['id'];return db[_0xb5af('0x35')]['getResources'](_0x45593a);}return db['User'][_0xb5af('0x36')](_0x2dbf72);})[_0xb5af('0x10')](function(_0x4aa048){_0x317411[_0xb5af('0x9')]=_0x4aa048['count'];_0x4a4c16=_0x4aa048[_0xb5af('0x1d')];return _0x4a4c16[_0xb5af('0x37')](function(_0x411cec){var _0x48b084=_[_0xb5af('0x38')](_0x211938,['id',_0x411cec['id']]);if(_0x48b084){var _0x2df06d=rta[_0xb5af('0x39')](_0x48b084);_[_0xb5af('0x30')](_0x411cec,_0x2df06d);}_0x411cec[_0xb5af('0x17')]=rta[_0xb5af('0x3a')](_0x411cec);if(_0x411cec['globalStatus'][_0xb5af('0x16')]('pause')){_0x5fa68[_0xb5af('0x2e')](function(_0x34f464){if(_0x411cec[_0x34f464+_0xb5af('0x2d')]){_0x411cec[_0x34f464+_0xb5af('0x3b')]=_0xb5af('0xf');}});}return _0x411cec;});})[_0xb5af('0x10')](function(_0x50cf5f){if(!_0x21acd4||_0xaaca6b){return _0x50cf5f;}return rta[_0xb5af('0x3c')](_0x50cf5f,_0x21acd4);})[_0xb5af('0x10')](function(_0x185ab4){var _0xd3201d=null;if(_0x53262d[_0xb5af('0xc')][_0xb5af('0x19')]){var _0x447991=_0x53262d[_0xb5af('0xc')]['fields'][_0xb5af('0x3d')](',');_0xd3201d=_0x185ab4[_0xb5af('0x37')](function(_0x474229){return _['pick'](_0x474229,_0x447991);});}_0x317411[_0xb5af('0x1d')]=_0xd3201d||_0x185ab4;return _0x317411;})['then'](respondWithFilteredResult(_0x5aace1,_0x2dbf72))['catch'](APIHandleError(_0x5aace1));};exports[_0xb5af('0x3e')]=function(_0x1ce5dc,_0x314f24){var _0x4ef252={'count':0x0,'rows':[]};var _0x50c6de={};var _0x3b00b1;var _0x517a2d;var _0x447a76;Promise[_0xb5af('0x3f')]()[_0xb5af('0x10')](function(){if(_0x1ce5dc['query'][_0xb5af('0x11')]){if(!utils[_0xb5af('0x12')](_0x1ce5dc['query'][_0xb5af('0x11')])){throw new APIBadRequestError(util[_0xb5af('0x40')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x1ce5dc[_0xb5af('0xc')][_0xb5af('0x11')]));}_0x3b00b1=_0x1ce5dc[_0xb5af('0xc')]['channel'][_0xb5af('0x14')]();}var _0x62ebe1=_[_0xb5af('0x41')](_0x3b00b1)+'Queue';var _0x3acbf6=_[_0xb5af('0x37')](db[_0x62ebe1]['rawAttributes'],function(_0x2ec1a9){return{'name':_0x2ec1a9['fieldName'],'type':_0x2ec1a9[_0xb5af('0x42')]['key']};});if(!_0x1ce5dc[_0xb5af('0xc')][_0xb5af('0x19')]){var _0xb99f65=['id',_0xb5af('0x43')];if(_0x3b00b1===_0xb5af('0x44')){_0xb99f65['push'](_0xb5af('0x42'));if(_0x1ce5dc[_0xb5af('0xc')][_0xb5af('0x42')]===_0xb5af('0x45')){_0xb99f65[_0xb5af('0x2c')]([_0xb5af('0x46'),'dialMethod']);}}_0x1ce5dc['query']['fields']=_0xb99f65['join'](',');}_0x50c6de=qs[_0xb5af('0x25')](_0x3acbf6,_0x1ce5dc);if(_0x1ce5dc[_0xb5af('0x31')]['role']===_0xb5af('0x31')){var _0x4aa28a={'params':{'id':_0x1ce5dc['user'][_0xb5af('0x47')]},'query':{'section':_0x3b00b1===_0xb5af('0x44')&&_0x1ce5dc[_0xb5af('0xc')]['type']===_0xb5af('0x45')?_0xb5af('0x48'):_[_0xb5af('0x41')](_0x3b00b1)+_0xb5af('0x49'),'type':_0x1ce5dc[_0xb5af('0xc')]['type'],'nolimit':!![],'sort':_0xb5af('0x43'),'filter':_0x1ce5dc[_0xb5af('0xc')][_0xb5af('0x4a')]}};return db[_0xb5af('0x35')]['getResources'](_0x4aa28a);}return db[_0x62ebe1][_0xb5af('0x36')](_0x50c6de);})['then'](function(_0x131877){_0x4ef252[_0xb5af('0x9')]=_0x131877[_0xb5af('0x9')];_0x517a2d=_0x131877[_0xb5af('0x1d')];return rtq[_0xb5af('0x4b')](_0x1ce5dc,_0x3b00b1);})[_0xb5af('0x10')](function(_0x4895e3){_0x447a76=_0x4895e3[_0xb5af('0x1d')];return rtq['initializeQueues'](_0x517a2d,_0x447a76,_0x3b00b1,_0x1ce5dc[_0xb5af('0xc')][_0xb5af('0x42')]);})['then'](function(_0x532e4c){_0x4ef252[_0xb5af('0x1d')]=_0x532e4c;return _0x4ef252;})[_0xb5af('0x10')](respondWithFilteredResult(_0x314f24,_0x50c6de))[_0xb5af('0x4c')](APIHandleError(_0x314f24));}; \ No newline at end of file +var _0x8c7a=['push','sequelize','literal','FIELD(id,','forEach','*pause','Pause','where','merge','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','filterAgentAttributes','sortAgentsByStatus','split','pick','catch','resolve','toLowerCase','startCase','rawAttributes','fieldName','name','voice','outbound','dialActive','dialMethod','Queues','filter','initializeQueues','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../mysqldb','../../errors/api','APIBadRequestError','offset','undefined','limit','count','status','set','Content-Range','json','getChannels','query','pauseTypeFilter','pause','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','includes','globalStatus','getUpdatedSortOptions','fields','order','getAgentIdsByQueues','then','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','type','key','role','agent','getOptions'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x8c7a,0x1a9));var _0xa8c7=function(_0x56d854,_0x6a702f){_0x56d854=_0x56d854-0x0;var _0x4101d9=_0x8c7a[_0x56d854];return _0x4101d9;};'use strict';var _=require('lodash');var util=require(_0xa8c7('0x0'));var rta=require(_0xa8c7('0x1'));var rtq=require(_0xa8c7('0x2'));var qs=require(_0xa8c7('0x3'));var utils=require('../../config/utils');var db=require(_0xa8c7('0x4'))['db'];var APIBadRequestError=require(_0xa8c7('0x5'))[_0xa8c7('0x6')];var APIHandleError=require(_0xa8c7('0x5'))['handleError'];function respondWithFilteredResult(_0x4cd156,_0xe3581d){return function(_0x1632a9){if(_0x1632a9){var _0x4afe76=typeof _0xe3581d[_0xa8c7('0x7')]===_0xa8c7('0x8')&&typeof _0xe3581d[_0xa8c7('0x9')]===_0xa8c7('0x8');var _0x4d3227=_0x1632a9[_0xa8c7('0xa')];var _0x2e27a4=_0x4afe76?0x0:_0xe3581d[_0xa8c7('0x7')];var _0x2cb29a=_0x4afe76?_0x1632a9[_0xa8c7('0xa')]:_0xe3581d[_0xa8c7('0x7')]+_0xe3581d['limit'];var _0x11688b;if(_0x2cb29a>=_0x4d3227){_0x2cb29a=_0x4d3227;_0x11688b=0xc8;}else{_0x11688b=0xce;}_0x4cd156[_0xa8c7('0xb')](_0x11688b);return _0x4cd156[_0xa8c7('0xc')](_0xa8c7('0xd'),_0x2e27a4+'-'+_0x2cb29a+'/'+_0x4d3227)[_0xa8c7('0xe')](_0x1632a9);}return null;};}exports['getAgents']=function(_0x4d36bb,_0x282e3b){var _0x1a4dc4={'count':0x0,'rows':[]};var _0x41f84f={};var _0x3ceda3;var _0x3d5086=utils[_0xa8c7('0xf')]();var _0x2732f7;var _0x597028;var _0xb1db68=_0x4d36bb['query']['globalQueueFilter'];var _0x179e9a=_0x4d36bb[_0xa8c7('0x10')]['globalStatusFilter'];var _0x2fbdbb=_0x4d36bb[_0xa8c7('0x10')][_0xa8c7('0x11')];var _0x1ad244=_0x179e9a===_0xa8c7('0x12')||_0x179e9a==='*pause'?!![]:![];var _0x2c1c09=[];var _0x95a524;var _0x55a2c2;Promise['resolve']()['then'](function(){if(_0x4d36bb[_0xa8c7('0x10')][_0xa8c7('0x13')]){if(!utils[_0xa8c7('0x14')](_0x4d36bb[_0xa8c7('0x10')]['channel'])){throw new APIBadRequestError(util[_0xa8c7('0x15')](_0xa8c7('0x16'),_0x4d36bb[_0xa8c7('0x10')]['channel']));}_0x3ceda3=_0x4d36bb['query']['channel']['toLowerCase']();}if(!_0x4d36bb[_0xa8c7('0x10')]['sort']||!_0x4d36bb[_0xa8c7('0x10')][_0xa8c7('0x17')][_0xa8c7('0x18')](_0xa8c7('0x19'))){_0x4d36bb['query']['sort']=rta['validateSortParameter'](_0x4d36bb[_0xa8c7('0x10')][_0xa8c7('0x17')]);return;}var _0x1f702=rta[_0xa8c7('0x1a')](_0x4d36bb[_0xa8c7('0x10')]['sort']);_0x4d36bb[_0xa8c7('0x10')][_0xa8c7('0x17')]=_0x1f702[_0xa8c7('0x1b')]['join'](',');_0x95a524=_0x1f702[_0xa8c7('0x1c')];})['then'](function(){if(!_0xb1db68){return[];}return rta[_0xa8c7('0x1d')](_0xb1db68,_0x3ceda3);})[_0xa8c7('0x1e')](function(_0x532953){_0x2c1c09=_0x532953;return rta[_0xa8c7('0x1f')]();})[_0xa8c7('0x1e')](function(_0x489620){_0x597028=_0x489620[_0xa8c7('0x20')];if((!_0x179e9a||_0x1ad244)&&!_0x95a524){return _0x2c1c09;}if(_0x95a524&&!_0x179e9a){return rta[_0xa8c7('0x21')](_0x597028,_0x2c1c09,_0x95a524);}else{return rta[_0xa8c7('0x22')](_0x597028,_0x2c1c09,_0x179e9a);}})['then'](function(_0x1f0972){_0x2c1c09=_0x1f0972;var _0x52f347=![];if(_0x2c1c09[_0xa8c7('0x23')]===0x0){if(_0xb1db68||_0x179e9a){_0x52f347=!![];}if(_0x1ad244){_0x52f347=![];}}if(_0x52f347){return _0x1a4dc4;}var _0xa74805=_[_0xa8c7('0x24')](db[_0xa8c7('0x25')]['rawAttributes'],function(_0x133315){return{'name':_0x133315['fieldName'],'type':_0x133315[_0xa8c7('0x26')][_0xa8c7('0x27')]};});_0x4d36bb[_0xa8c7('0x10')][_0xa8c7('0x28')]=_0xa8c7('0x29');_0x4d36bb[_0xa8c7('0x10')]['online']=!![];_0x41f84f=qs[_0xa8c7('0x2a')](_0xa74805,_0x4d36bb);_0x41f84f['raw']=!![];var _0x512dd1=[];if(_0x2c1c09[_0xa8c7('0x23')]>0x0){_0x512dd1[_0xa8c7('0x2b')]({'id':{'$in':_0x2c1c09}});if(_0x95a524&&!_0x179e9a){_0x55a2c2=[db[_0xa8c7('0x2c')][_0xa8c7('0x2d')](_0xa8c7('0x2e')+_0x2c1c09+')')];_0x41f84f[_0xa8c7('0x1c')]=_0x55a2c2;}}if(_0x1ad244){_0x3d5086[_0xa8c7('0x2f')](function(_0x40a3c6){var _0x35d111=!![];if(_0x179e9a===_0xa8c7('0x30')&&_0x3ceda3!==_0x40a3c6){_0x35d111=![];}_0x512dd1[_0xa8c7('0x2b')]({[_0x40a3c6+_0xa8c7('0x31')]:_0x35d111});});if(_0x2fbdbb){_0x512dd1[_0xa8c7('0x2b')]({'pauseType':_0x2fbdbb});}}else if(_0x179e9a){_0x3d5086[_0xa8c7('0x2f')](function(_0x11258d){_0x512dd1['push']({[_0x11258d+_0xa8c7('0x31')]:![]});});}_0x41f84f[_0xa8c7('0x32')]=_[_0xa8c7('0x33')](_0x41f84f[_0xa8c7('0x32')],{'$and':_0x512dd1});if(_0x4d36bb[_0xa8c7('0x34')][_0xa8c7('0x28')]===_0xa8c7('0x34')){var _0x5d2d34={'params':{'id':_0x4d36bb[_0xa8c7('0x34')][_0xa8c7('0x35')]},'query':{'section':_0xa8c7('0x36'),'role':_0xa8c7('0x29'),'online':!![],'raw':!![],'ids':_0x2c1c09,'customSorting':_0x55a2c2}};if(_0x1ad244){_0x5d2d34[_0xa8c7('0x10')][_0xa8c7('0x37')]=_0x512dd1;}_0x5d2d34[_0xa8c7('0x10')]=Object[_0xa8c7('0x38')](_0x5d2d34[_0xa8c7('0x10')],_0x4d36bb['query']);delete _0x5d2d34[_0xa8c7('0x10')]['id'];return db[_0xa8c7('0x39')][_0xa8c7('0x3a')](_0x5d2d34);}return db[_0xa8c7('0x25')][_0xa8c7('0x3b')](_0x41f84f);})[_0xa8c7('0x1e')](function(_0x4aa14f){_0x1a4dc4[_0xa8c7('0xa')]=_0x4aa14f[_0xa8c7('0xa')];_0x2732f7=_0x4aa14f[_0xa8c7('0x20')];return _0x2732f7['map'](function(_0x472e28){var _0x59dd46=_['find'](_0x597028,['id',_0x472e28['id']]);if(_0x59dd46){var _0x14cbfe=rta[_0xa8c7('0x3c')](_0x59dd46);_['merge'](_0x472e28,_0x14cbfe);}_0x472e28['globalStatus']=rta['getAgentStatus'](_0x472e28);if(_0x472e28[_0xa8c7('0x19')][_0xa8c7('0x18')]('pause')){_0x3d5086[_0xa8c7('0x2f')](function(_0x4a9a52){if(_0x472e28[_0x4a9a52+_0xa8c7('0x31')]){_0x472e28[_0x4a9a52+'Status']=_0xa8c7('0x12');}});}return _0x472e28;});})['then'](function(_0x9e866b){if(!_0x95a524||_0x55a2c2){return _0x9e866b;}return rta[_0xa8c7('0x3d')](_0x9e866b,_0x95a524);})[_0xa8c7('0x1e')](function(_0x2fe6a0){var _0x2fe935=null;if(_0x4d36bb[_0xa8c7('0x10')][_0xa8c7('0x1b')]){var _0x5376c5=_0x4d36bb[_0xa8c7('0x10')]['fields'][_0xa8c7('0x3e')](',');_0x2fe935=_0x2fe6a0['map'](function(_0x14857f){return _[_0xa8c7('0x3f')](_0x14857f,_0x5376c5);});}_0x1a4dc4[_0xa8c7('0x20')]=_0x2fe935||_0x2fe6a0;return _0x1a4dc4;})['then'](respondWithFilteredResult(_0x282e3b,_0x41f84f))[_0xa8c7('0x40')](APIHandleError(_0x282e3b));};exports['getQueues']=function(_0xd5bce7,_0x2a152e){var _0x28e3f1={'count':0x0,'rows':[]};var _0x23baa4={};var _0x4903a9;var _0xdef494;var _0x26ca97;Promise[_0xa8c7('0x41')]()[_0xa8c7('0x1e')](function(){if(_0xd5bce7[_0xa8c7('0x10')][_0xa8c7('0x13')]){if(!utils['isValidChannel'](_0xd5bce7[_0xa8c7('0x10')][_0xa8c7('0x13')])){throw new APIBadRequestError(util[_0xa8c7('0x15')](_0xa8c7('0x16'),_0xd5bce7[_0xa8c7('0x10')]['channel']));}_0x4903a9=_0xd5bce7[_0xa8c7('0x10')][_0xa8c7('0x13')][_0xa8c7('0x42')]();}var _0x584f43=_[_0xa8c7('0x43')](_0x4903a9)+'Queue';var _0x5a6a28=_[_0xa8c7('0x24')](db[_0x584f43][_0xa8c7('0x44')],function(_0xd70f5a){return{'name':_0xd70f5a[_0xa8c7('0x45')],'type':_0xd70f5a['type']['key']};});if(!_0xd5bce7['query'][_0xa8c7('0x1b')]){var _0x49b2d5=['id',_0xa8c7('0x46')];if(_0x4903a9===_0xa8c7('0x47')){_0x49b2d5[_0xa8c7('0x2b')]('type');if(_0xd5bce7[_0xa8c7('0x10')][_0xa8c7('0x26')]===_0xa8c7('0x48')){_0x49b2d5['push']([_0xa8c7('0x49'),_0xa8c7('0x4a')]);}}_0xd5bce7[_0xa8c7('0x10')][_0xa8c7('0x1b')]=_0x49b2d5['join'](',');}_0x23baa4=qs[_0xa8c7('0x2a')](_0x5a6a28,_0xd5bce7);if(_0xd5bce7[_0xa8c7('0x34')][_0xa8c7('0x28')]===_0xa8c7('0x34')){var _0x2db6f3={'params':{'id':_0xd5bce7[_0xa8c7('0x34')][_0xa8c7('0x35')]},'query':{'section':_0x4903a9==='voice'&&_0xd5bce7['query'][_0xa8c7('0x26')]===_0xa8c7('0x48')?'QueueCampaigns':_[_0xa8c7('0x43')](_0x4903a9)+_0xa8c7('0x4b'),'type':_0xd5bce7[_0xa8c7('0x10')][_0xa8c7('0x26')],'nolimit':!![],'sort':_0xa8c7('0x46'),'filter':_0xd5bce7[_0xa8c7('0x10')][_0xa8c7('0x4c')]}};return db[_0xa8c7('0x39')][_0xa8c7('0x3a')](_0x2db6f3);}return db[_0x584f43]['findAndCountAll'](_0x23baa4);})[_0xa8c7('0x1e')](function(_0x23d2d8){_0x28e3f1[_0xa8c7('0xa')]=_0x23d2d8[_0xa8c7('0xa')];_0xdef494=_0x23d2d8[_0xa8c7('0x20')];return rtq['getRealtimeQueues'](_0xd5bce7,_0x4903a9);})[_0xa8c7('0x1e')](function(_0x3765b3){_0x26ca97=_0x3765b3['rows'];return rtq[_0xa8c7('0x4d')](_0xdef494,_0x26ca97,_0x4903a9,_0xd5bce7[_0xa8c7('0x10')][_0xa8c7('0x26')]);})[_0xa8c7('0x1e')](function(_0x50f74c){_0x28e3f1[_0xa8c7('0x20')]=_0x50f74c;return _0x28e3f1;})[_0xa8c7('0x1e')](respondWithFilteredResult(_0x2a152e,_0x23baa4))[_0xa8c7('0x40')](APIHandleError(_0x2a152e));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 5b77419..884853f 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x239290,_0x5ddec9){var _0x49efcd=function(_0x26f3a6){while(--_0x26f3a6){_0x239290['push'](_0x239290['shift']());}};_0x49efcd(++_0x5ddec9);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x493525,_0x17c4e1){var _0x292857=function(_0x1e335b){while(--_0x1e335b){_0x493525['push'](_0x493525['shift']());}};_0x292857(++_0x17c4e1);}(_0x70e0,0x17b));var _0x070e=function(_0x52a1d1,_0x383f42){_0x52a1d1=_0x52a1d1-0x0;var _0x5252ca=_0x70e0[_0x52a1d1];return _0x5252ca;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index c4cbf54..e73fb8b 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 _0x7163=['STRING','DATE','INTEGER','sequelize'];(function(_0x5352aa,_0x13fbee){var _0x19b8ad=function(_0x482514){while(--_0x482514){_0x5352aa['push'](_0x5352aa['shift']());}};_0x19b8ad(++_0x13fbee);}(_0x7163,0x1ef));var _0x3716=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x7163[_0x342baa];return _0x1208f3;};'use strict';var Sequelize=require(_0x3716('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x3716('0x1')]},'scheduledat':{'type':Sequelize[_0x3716('0x2')]},'uniqueid':{'type':Sequelize[_0x3716('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x3716('0x2')]},'ringtime':{'type':Sequelize[_0x3716('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x3716('0x1')]},'campaigntype':{'type':Sequelize[_0x3716('0x1')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6657=['INTEGER','STRING','DATE','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6657,0x17f));var _0x7665=function(_0x47f84a,_0x33b10f){_0x47f84a=_0x47f84a-0x0;var _0x328233=_0x6657[_0x47f84a];return _0x328233;};'use strict';var Sequelize=require(_0x7665('0x0'));module['exports']={'state':{'type':Sequelize[_0x7665('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x7665('0x2')]},'scheduledat':{'type':Sequelize[_0x7665('0x3')]},'uniqueid':{'type':Sequelize[_0x7665('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x7665('0x3')]},'ringtime':{'type':Sequelize[_0x7665('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7665('0x2')]},'campaigntype':{'type':Sequelize[_0x7665('0x2')]},'membername':{'type':Sequelize[_0x7665('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 8df2f43..b69fb87 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 _0xdfcd=['exports','define','report_agent_preview','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes'];(function(_0x3a8c32,_0x4b025b){var _0x2119f0=function(_0x2d5a43){while(--_0x2d5a43){_0x3a8c32['push'](_0x3a8c32['shift']());}};_0x2119f0(++_0x4b025b);}(_0xdfcd,0x16f));var _0xddfc=function(_0xa7d7ca,_0x2ff08c){_0xa7d7ca=_0xa7d7ca-0x0;var _0xe24fb6=_0xdfcd[_0xa7d7ca];return _0xe24fb6;};'use strict';var _=require(_0xddfc('0x0'));var util=require(_0xddfc('0x1'));var logger=require(_0xddfc('0x2'))(_0xddfc('0x3'));var moment=require(_0xddfc('0x4'));var BPromise=require('bluebird');var rp=require(_0xddfc('0x5'));var fs=require('fs');var path=require(_0xddfc('0x6'));var rimraf=require(_0xddfc('0x7'));var config=require(_0xddfc('0x8'));var attributes=require(_0xddfc('0x9'));module[_0xddfc('0xa')]=function(_0xfb77cd,_0x16d9e3){return _0xfb77cd[_0xddfc('0xb')]('ReportAgentPreview',attributes,{'tableName':_0xddfc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fec=['define','ReportAgentPreview','report_agent_preview','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0fec,0xc6));var _0xc0fe=function(_0x2d1ce6,_0x16024e){_0x2d1ce6=_0x2d1ce6-0x0;var _0x118252=_0x0fec[_0x2d1ce6];return _0x118252;};'use strict';var _=require(_0xc0fe('0x0'));var util=require(_0xc0fe('0x1'));var logger=require('../../config/logger')(_0xc0fe('0x2'));var moment=require(_0xc0fe('0x3'));var BPromise=require('bluebird');var rp=require(_0xc0fe('0x4'));var fs=require('fs');var path=require(_0xc0fe('0x5'));var rimraf=require(_0xc0fe('0x6'));var config=require(_0xc0fe('0x7'));var attributes=require(_0xc0fe('0x8'));module[_0xc0fe('0x9')]=function(_0x3de8b7,_0x1897f0){return _0x3de8b7[_0xc0fe('0xa')](_0xc0fe('0xb'),attributes,{'tableName':_0xc0fe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 8771136..da1d917 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 _0xfe60=['catch','CreateReportAgentPreview','create','options','raw','info','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x37cf41,_0x279318){var _0x36d517=function(_0xf23748){while(--_0xf23748){_0x37cf41['push'](_0x37cf41['shift']());}};_0x36d517(++_0x279318);}(_0xfe60,0x17d));var _0x0fe6=function(_0x15bbd9,_0xeb731c){_0x15bbd9=_0x15bbd9-0x0;var _0x532e75=_0xfe60[_0x15bbd9];return _0x532e75;};'use strict';var _=require(_0x0fe6('0x0'));var util=require(_0x0fe6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0fe6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0fe6('0x3'))['db'];var utils=require(_0x0fe6('0x4'));var logger=require(_0x0fe6('0x5'))(_0x0fe6('0x6'));var config=require(_0x0fe6('0x7'));var jayson=require(_0x0fe6('0x8'));var client=jayson[_0x0fe6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd7cff8,_0x4de948,_0x1b92ad){return new BPromise(function(_0xba8082,_0x44f32f){return client[_0x0fe6('0xa')](_0xd7cff8,_0x1b92ad)[_0x0fe6('0xb')](function(_0x5065e){logger['info'](_0x0fe6('0xc'),_0x4de948,_0x0fe6('0xd'));logger[_0x0fe6('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x4de948,'request\x20sent',JSON[_0x0fe6('0xf')](_0x5065e));if(_0x5065e[_0x0fe6('0x10')]){if(_0x5065e['error']['code']===0x1f4){logger[_0x0fe6('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x4de948,_0x5065e[_0x0fe6('0x10')][_0x0fe6('0x11')]);return _0x44f32f(_0x5065e[_0x0fe6('0x10')][_0x0fe6('0x11')]);}logger['error'](_0x0fe6('0xc'),_0x4de948,_0x5065e['error'][_0x0fe6('0x11')]);return _0xba8082(_0x5065e['error'][_0x0fe6('0x11')]);}else{logger['info'](_0x0fe6('0xc'),_0x4de948,'request\x20sent');_0xba8082(_0x5065e[_0x0fe6('0x12')][_0x0fe6('0x11')]);}})[_0x0fe6('0x13')](function(_0x4d92f4){logger[_0x0fe6('0x10')](_0x0fe6('0xc'),_0x4de948,_0x4d92f4);_0x44f32f(_0x4d92f4);});});}exports[_0x0fe6('0x14')]=function(_0x16267f){var _0x23e8d3=this;return new Promise(function(_0x4925aa,_0xeaee11){return db['ReportAgentPreview'][_0x0fe6('0x15')](_0x16267f['body'],{'raw':_0x16267f[_0x0fe6('0x16')]?_0x16267f[_0x0fe6('0x16')][_0x0fe6('0x17')]===undefined?!![]:![]:!![]})[_0x0fe6('0xb')](function(_0x2657eb){logger[_0x0fe6('0x18')](_0x0fe6('0x14'),_0x16267f);logger[_0x0fe6('0xe')]('CreateReportAgentPreview',_0x16267f,JSON[_0x0fe6('0xf')](_0x2657eb));_0x4925aa(_0x2657eb);})[_0x0fe6('0x13')](function(_0x56e0b8){logger['error'](_0x0fe6('0x14'),_0x56e0b8[_0x0fe6('0x11')],_0x16267f);_0xeaee11(_0x23e8d3[_0x0fe6('0x10')](0x1f4,_0x56e0b8[_0x0fe6('0x11')]));});});}; \ No newline at end of file +var _0x18c4=['code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x18c4,0xf3));var _0x418c=function(_0x53be0d,_0xbb1a39){_0x53be0d=_0x53be0d-0x0;var _0x23fe66=_0x18c4[_0x53be0d];return _0x23fe66;};'use strict';var _=require(_0x418c('0x0'));var util=require(_0x418c('0x1'));var moment=require(_0x418c('0x2'));var BPromise=require('bluebird');var rs=require(_0x418c('0x3'));var fs=require('fs');var Redis=require(_0x418c('0x4'));var db=require(_0x418c('0x5'))['db'];var utils=require(_0x418c('0x6'));var logger=require(_0x418c('0x7'))(_0x418c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x418c('0x9')][_0x418c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49ad4f,_0x3a13a0,_0x4c7e27){return new BPromise(function(_0x5e15ec,_0x57e1f8){return client[_0x418c('0xb')](_0x49ad4f,_0x4c7e27)['then'](function(_0x55faf2){logger[_0x418c('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x3a13a0,_0x418c('0xd'));logger[_0x418c('0xe')](_0x418c('0xf'),_0x3a13a0,_0x418c('0xd'),JSON[_0x418c('0x10')](_0x55faf2));if(_0x55faf2[_0x418c('0x11')]){if(_0x55faf2[_0x418c('0x11')][_0x418c('0x12')]===0x1f4){logger[_0x418c('0x11')](_0x418c('0x13'),_0x3a13a0,_0x55faf2[_0x418c('0x11')]['message']);return _0x57e1f8(_0x55faf2[_0x418c('0x11')][_0x418c('0x14')]);}logger[_0x418c('0x11')](_0x418c('0x13'),_0x3a13a0,_0x55faf2[_0x418c('0x11')][_0x418c('0x14')]);return _0x5e15ec(_0x55faf2['error']['message']);}else{logger[_0x418c('0xc')](_0x418c('0x13'),_0x3a13a0,'request\x20sent');_0x5e15ec(_0x55faf2[_0x418c('0x15')][_0x418c('0x14')]);}})[_0x418c('0x16')](function(_0x5b4bc5){logger[_0x418c('0x11')](_0x418c('0x13'),_0x3a13a0,_0x5b4bc5);_0x57e1f8(_0x5b4bc5);});});}exports[_0x418c('0x17')]=function(_0x3bb4c2){var _0x474f98=this;return new Promise(function(_0x5044d1,_0x2c1540){return db[_0x418c('0x18')]['create'](_0x3bb4c2[_0x418c('0x19')],{'raw':_0x3bb4c2[_0x418c('0x1a')]?_0x3bb4c2[_0x418c('0x1a')][_0x418c('0x1b')]===undefined?!![]:![]:!![]})[_0x418c('0x1c')](function(_0x4c1c47){logger[_0x418c('0xc')]('CreateReportAgentPreview',_0x3bb4c2);logger[_0x418c('0xe')](_0x418c('0x17'),_0x3bb4c2,JSON[_0x418c('0x10')](_0x4c1c47));_0x5044d1(_0x4c1c47);})[_0x418c('0x16')](function(_0x27b369){logger[_0x418c('0x11')](_0x418c('0x17'),_0x27b369['message'],_0x3bb4c2);_0x2c1540(_0x474f98[_0x418c('0x11')](0x1f4,_0x27b369['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index cf1912e..690228c 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 _0xc8f2=['/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','/fax/queues','/voice/queues/preview/:id','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','path','express','Router','get','/voice/channels','isAuthenticated','voiceChannels'];(function(_0x55dbdc,_0x2a203a){var _0x5d7a04=function(_0x44621e){while(--_0x44621e){_0x55dbdc['push'](_0x55dbdc['shift']());}};_0x5d7a04(++_0x2a203a);}(_0xc8f2,0x120));var _0x2c8f=function(_0x5b5e06,_0x4aa5ef){_0x5b5e06=_0x5b5e06-0x0;var _0x482b18=_0xc8f2[_0x5b5e06];return _0x482b18;};'use strict';var multer=require(_0x2c8f('0x0'));var util=require('util');var path=require(_0x2c8f('0x1'));var express=require(_0x2c8f('0x2'));var router=express[_0x2c8f('0x3')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x2c8f('0x4')](_0x2c8f('0x5'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x7')]);router[_0x2c8f('0x4')](_0x2c8f('0x8'),auth[_0x2c8f('0x6')](),controller['voiceChannelMixMonitor']);router[_0x2c8f('0x4')](_0x2c8f('0x9'),auth['isAuthenticated'](),controller[_0x2c8f('0xa')]);router[_0x2c8f('0x4')]('/voice/queues',auth[_0x2c8f('0x6')](),controller['voiceQueues']);router['get']('/chat/queues',auth[_0x2c8f('0x6')](),controller[_0x2c8f('0xb')]);router[_0x2c8f('0x4')](_0x2c8f('0xc'),auth[_0x2c8f('0x6')](),controller['mailQueues']);router[_0x2c8f('0x4')](_0x2c8f('0xd'),auth['isAuthenticated'](),controller[_0x2c8f('0xe')]);router[_0x2c8f('0x4')](_0x2c8f('0xf'),auth['isAuthenticated'](),controller[_0x2c8f('0x10')]);router['get']('/sms/queues',auth['isAuthenticated'](),controller[_0x2c8f('0x11')]);router[_0x2c8f('0x4')](_0x2c8f('0x12'),auth[_0x2c8f('0x6')](),controller['whatsappQueues']);router[_0x2c8f('0x4')](_0x2c8f('0x13'),auth['isAuthenticated'](),controller['faxQueues']);router['get'](_0x2c8f('0x14'),auth[_0x2c8f('0x6')](),controller['voiceQueuesPreview']);router[_0x2c8f('0x4')]('/voice/queues/channels',auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x15')]);router[_0x2c8f('0x4')](_0x2c8f('0x16'),auth[_0x2c8f('0x6')](),controller['voiceQueuesChannel']);router[_0x2c8f('0x4')](_0x2c8f('0x17'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x18')]);router[_0x2c8f('0x4')](_0x2c8f('0x19'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router['get'](_0x2c8f('0x1a'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x1b')]);router[_0x2c8f('0x1c')](_0x2c8f('0x1a'),auth['isAuthenticated'](),controller[_0x2c8f('0x1d')]);router[_0x2c8f('0x4')](_0x2c8f('0x1e'),auth['isAuthenticated'](),controller['outbound']);router[_0x2c8f('0x4')](_0x2c8f('0x1f'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x20')]);router[_0x2c8f('0x4')](_0x2c8f('0x21'),auth[_0x2c8f('0x6')](),controller['agents']);router[_0x2c8f('0x1c')](_0x2c8f('0x22'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x23')]);router[_0x2c8f('0x4')](_0x2c8f('0x24'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x25')]);router[_0x2c8f('0x4')](_0x2c8f('0x26'),auth[_0x2c8f('0x6')](),controller['trunks']);router['get'](_0x2c8f('0x27'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x28')]);router[_0x2c8f('0x4')](_0x2c8f('0x29'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0x2c8f('0x4')](_0x2c8f('0x2a'),auth[_0x2c8f('0x6')](),controller['chatQueuesWaitingInteractions']);router[_0x2c8f('0x4')](_0x2c8f('0x2b'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x2c')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x2d')]);router[_0x2c8f('0x4')](_0x2c8f('0x2e'),auth['isAuthenticated'](),controller[_0x2c8f('0x2f')]);router[_0x2c8f('0x4')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0x2c8f('0x4')](_0x2c8f('0x30'),auth[_0x2c8f('0x6')](),controller['whatsappQueuesWaitingInteractions']);router[_0x2c8f('0x4')](_0x2c8f('0x31'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x32')]);router['post']('/mail/queues/:id/notify',auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x33')](_0x2c8f('0x34')));router['get'](_0x2c8f('0x35'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x36')]);router[_0x2c8f('0x37')]('/chat/queues/:id/notify',auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x33')]('chat'));router[_0x2c8f('0x4')](_0x2c8f('0x38'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x39')]);router[_0x2c8f('0x37')](_0x2c8f('0x3a'),auth[_0x2c8f('0x6')](),controller['queueNotify'](_0x2c8f('0x3b')));router[_0x2c8f('0x4')]('/fax/queues/:id',auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x3c')]);router[_0x2c8f('0x37')]('/openchannel/queues/:id/notify',auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x33')](_0x2c8f('0x3d')));router['get'](_0x2c8f('0x3e'),auth['isAuthenticated'](),controller[_0x2c8f('0x3f')]);router[_0x2c8f('0x37')](_0x2c8f('0x40'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x33')](_0x2c8f('0x41')));router[_0x2c8f('0x37')](_0x2c8f('0x42'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x33')](_0x2c8f('0x43')));router[_0x2c8f('0x4')](_0x2c8f('0x44'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x45')]);router[_0x2c8f('0x4')](_0x2c8f('0x46'),auth[_0x2c8f('0x6')](),controller[_0x2c8f('0x47')]);router[_0x2c8f('0x37')](_0x2c8f('0x48'),auth[_0x2c8f('0x6')](),controller['agentNotify']);module[_0x2c8f('0x49')]=router; \ No newline at end of file +var _0x670c=['/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','Router','../../components/auth/service','./rpc.controller','isAuthenticated','voiceChannels','get','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x670c,0x12c));var _0xc670=function(_0x59b309,_0x4c918c){_0x59b309=_0x59b309-0x0;var _0x325955=_0x670c[_0x59b309];return _0x325955;};'use strict';var multer=require(_0xc670('0x0'));var util=require(_0xc670('0x1'));var path=require('path');var express=require('express');var router=express[_0xc670('0x2')]();var auth=require(_0xc670('0x3'));var controller=require(_0xc670('0x4'));router['get']('/voice/channels',auth[_0xc670('0x5')](),controller[_0xc670('0x6')]);router[_0xc670('0x7')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xc670('0x5')](),controller[_0xc670('0x8')]);router[_0xc670('0x7')](_0xc670('0x9'),auth[_0xc670('0x5')](),controller[_0xc670('0xa')]);router[_0xc670('0x7')]('/voice/queues',auth[_0xc670('0x5')](),controller[_0xc670('0xb')]);router[_0xc670('0x7')](_0xc670('0xc'),auth[_0xc670('0x5')](),controller[_0xc670('0xd')]);router[_0xc670('0x7')](_0xc670('0xe'),auth[_0xc670('0x5')](),controller[_0xc670('0xf')]);router['get'](_0xc670('0x10'),auth[_0xc670('0x5')](),controller[_0xc670('0x11')]);router[_0xc670('0x7')](_0xc670('0x12'),auth[_0xc670('0x5')](),controller[_0xc670('0x13')]);router['get'](_0xc670('0x14'),auth[_0xc670('0x5')](),controller[_0xc670('0x15')]);router[_0xc670('0x7')](_0xc670('0x16'),auth[_0xc670('0x5')](),controller[_0xc670('0x17')]);router[_0xc670('0x7')](_0xc670('0x18'),auth[_0xc670('0x5')](),controller[_0xc670('0x19')]);router[_0xc670('0x7')]('/voice/queues/preview/:id',auth[_0xc670('0x5')](),controller[_0xc670('0x1a')]);router[_0xc670('0x7')](_0xc670('0x1b'),auth[_0xc670('0x5')](),controller[_0xc670('0x1c')]);router['get']('/voice/queues/channels/:uniqueid',auth[_0xc670('0x5')](),controller[_0xc670('0x1d')]);router[_0xc670('0x7')](_0xc670('0x1e'),auth[_0xc670('0x5')](),controller[_0xc670('0x1f')]);router['get'](_0xc670('0x20'),auth[_0xc670('0x5')](),controller[_0xc670('0x21')]);router['get'](_0xc670('0x22'),auth[_0xc670('0x5')](),controller['showVoiceQueues']);router[_0xc670('0x23')]('/voice/queues/:id',auth[_0xc670('0x5')](),controller[_0xc670('0x24')]);router[_0xc670('0x7')]('/outbound',auth['isAuthenticated'](),controller[_0xc670('0x25')]);router['get']('/outbound/channels',auth[_0xc670('0x5')](),controller[_0xc670('0x26')]);router['get'](_0xc670('0x27'),auth[_0xc670('0x5')](),controller[_0xc670('0x28')]);router['put'](_0xc670('0x29'),auth[_0xc670('0x5')](),controller['agentCapacity']);router['get'](_0xc670('0x2a'),auth[_0xc670('0x5')](),controller['telephones']);router[_0xc670('0x7')]('/trunks',auth[_0xc670('0x5')](),controller[_0xc670('0x2b')]);router[_0xc670('0x7')](_0xc670('0x2c'),auth['isAuthenticated'](),controller[_0xc670('0x2d')]);router['get'](_0xc670('0x2e'),auth[_0xc670('0x5')](),controller[_0xc670('0x2f')]);router[_0xc670('0x7')](_0xc670('0x30'),auth['isAuthenticated'](),controller[_0xc670('0x31')]);router[_0xc670('0x7')](_0xc670('0x32'),auth['isAuthenticated'](),controller[_0xc670('0x33')]);router['get'](_0xc670('0x34'),auth[_0xc670('0x5')](),controller[_0xc670('0x35')]);router['get'](_0xc670('0x36'),auth[_0xc670('0x5')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xc670('0x7')]('/sms/queues/waitinginteractions',auth[_0xc670('0x5')](),controller[_0xc670('0x37')]);router[_0xc670('0x7')]('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xc670('0x38')]);router[_0xc670('0x7')](_0xc670('0x39'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0xc670('0x3a')](_0xc670('0x3b'),auth['isAuthenticated'](),controller[_0xc670('0x3c')](_0xc670('0x3d')));router[_0xc670('0x7')](_0xc670('0x3e'),auth[_0xc670('0x5')](),controller[_0xc670('0x3f')]);router[_0xc670('0x3a')](_0xc670('0x40'),auth['isAuthenticated'](),controller[_0xc670('0x3c')]('chat'));router['get'](_0xc670('0x41'),auth[_0xc670('0x5')](),controller[_0xc670('0x42')]);router[_0xc670('0x3a')](_0xc670('0x43'),auth['isAuthenticated'](),controller[_0xc670('0x3c')](_0xc670('0x44')));router[_0xc670('0x7')](_0xc670('0x45'),auth[_0xc670('0x5')](),controller[_0xc670('0x46')]);router[_0xc670('0x3a')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0xc670('0x3c')](_0xc670('0x47')));router[_0xc670('0x7')](_0xc670('0x48'),auth[_0xc670('0x5')](),controller[_0xc670('0x49')]);router[_0xc670('0x3a')](_0xc670('0x4a'),auth[_0xc670('0x5')](),controller['queueNotify'](_0xc670('0x4b')));router[_0xc670('0x3a')]('/whatsapp/queues/:id/notify',auth[_0xc670('0x5')](),controller[_0xc670('0x3c')](_0xc670('0x4c')));router['get'](_0xc670('0x4d'),auth[_0xc670('0x5')](),controller[_0xc670('0x4e')]);router[_0xc670('0x7')](_0xc670('0x4f'),auth['isAuthenticated'](),controller[_0xc670('0x50')]);router[_0xc670('0x3a')](_0xc670('0x51'),auth['isAuthenticated'](),controller[_0xc670('0x52')]);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 a5d4eae..4f5548e 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 _0x8958=['faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','TransferReport','create','agentNotify','channel','Agent\x20not\x20found','Message','Start','agentTransferTimeout','*,*,*,*','moment','api','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','interaction','MemberReport','findAll','user','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions'];(function(_0x577850,_0x2c698f){var _0xf56fa3=function(_0x1d1594){while(--_0x1d1594){_0x577850['push'](_0x577850['shift']());}};_0xf56fa3(++_0x2c698f);}(_0x8958,0x93));var _0x8895=function(_0x294dcb,_0x41fabb){_0x294dcb=_0x294dcb-0x0;var _0x1ec7bf=_0x8958[_0x294dcb];return _0x1ec7bf;};'use strict';var BPromise=require('bluebird');var moment=require(_0x8895('0x0'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x8895('0x1'));var jayson=require('jayson/promise');var amiClient=jayson[_0x8895('0x2')][_0x8895('0x3')]({'port':0x232a});var mailClient=jayson[_0x8895('0x2')]['http']({'port':0x232b});var routingClient=jayson[_0x8895('0x2')][_0x8895('0x3')]({'port':0x232c});function respondWithRpcPromise(_0x124e1e,_0x40cec6,_0x33013a){return new BPromise(function(_0x51376b,_0xe018b8){var _0xc2be9f=_0x33013a?_0x33013a:amiClient;return _0xc2be9f[_0x8895('0x4')](_0x124e1e,_0x40cec6)[_0x8895('0x5')](function(_0x6eab1e){if(_0x6eab1e[_0x8895('0x6')]){if(_0x6eab1e[_0x8895('0x6')][_0x8895('0x7')]===0x1f4){return _0xe018b8(_0x6eab1e[_0x8895('0x6')][_0x8895('0x8')]);}return _0x51376b(_0x6eab1e['error'][_0x8895('0x8')]);}else{_0x51376b(_0x6eab1e[_0x8895('0x9')]);}})[_0x8895('0xa')](function(_0x301bec){_0xe018b8(_0x301bec);});});}function respondWithResult(_0x446e1a,_0xaf93bc){_0xaf93bc=_0xaf93bc||0xc8;return function(_0x5af0ef){if(_0x5af0ef){return _0x446e1a[_0x8895('0xb')](_0xaf93bc)[_0x8895('0xc')](_0x5af0ef);}return _0x446e1a[_0x8895('0xd')](0x194);};}function handleError(_0x57d40a,_0x47b9fe){_0x47b9fe=_0x47b9fe||0x1f4;return function(_0x9191b8){logger['error'](_0x9191b8[_0x8895('0xe')]);if(_0x9191b8[_0x8895('0xf')]){delete _0x9191b8[_0x8895('0xf')];}_0x57d40a[_0x8895('0xb')](_0x47b9fe)[_0x8895('0x10')](_0x9191b8);};}function findById(_0x5b4c2e){return function(_0x4128e2){if(!_[_0x8895('0x11')](_0x5b4c2e)&&!_[_0x8895('0x11')](_0x4128e2)&&!_[_0x8895('0x11')](_0x4128e2[_0x8895('0x12')])){return _[_0x8895('0x13')](_0x4128e2[_0x8895('0x12')],function(_0x26cee0){return _0x26cee0['id']==_0x5b4c2e;});}return null;};}exports[_0x8895('0x14')]=function(_0x2da618,_0x24fef0){return respondWithRpcPromise(_0x8895('0x15'),_0x2da618[_0x8895('0x16')])['then'](respondWithResult(_0x24fef0,null))['catch'](handleError(_0x24fef0,null));};exports['voiceChannelMixMonitor']=function(_0x3daf43,_0x456282){return respondWithRpcPromise(_0x8895('0x17'),_[_0x8895('0x18')](_0x3daf43[_0x8895('0x16')],_0x3daf43[_0x8895('0x19')]))[_0x8895('0x5')](respondWithResult(_0x456282,null))[_0x8895('0xa')](handleError(_0x456282,null));};exports['voiceChannelStopMixMonitor']=function(_0x1a4c5b,_0x5db3a0){return respondWithRpcPromise(_0x8895('0x1a'),_[_0x8895('0x18')](_0x1a4c5b[_0x8895('0x16')],_0x1a4c5b['params']))['then'](respondWithResult(_0x5db3a0,null))[_0x8895('0xa')](handleError(_0x5db3a0,null));};exports[_0x8895('0x1b')]=function(_0x38f7ad,_0x24a376){return respondWithRpcPromise('VoiceQueues',_0x38f7ad[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x24a376,null))[_0x8895('0xa')](handleError(_0x24a376,null));};exports['showVoiceQueues']=function(_0x4aee03,_0x78b57){return respondWithRpcPromise('VoiceQueues',_0x4aee03[_0x8895('0x16')])[_0x8895('0x5')](findById(_0x4aee03[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0x78b57,null))[_0x8895('0xa')](handleError(_0x78b57,null));};exports['updateVoiceQueue']=function(_0x4d567a,_0x6e449d){return respondWithRpcPromise(_0x8895('0x1c'),_[_0x8895('0x18')](_0x4d567a[_0x8895('0x1d')],_0x4d567a[_0x8895('0x19')]))['then'](respondWithResult(_0x6e449d,null))['catch'](handleError(_0x6e449d,null));};exports[_0x8895('0x1e')]=function(_0x848a11,_0x1c16f6){return respondWithRpcPromise(_0x8895('0x1f'),_[_0x8895('0x18')](_0x848a11['query'],_0x848a11[_0x8895('0x19')]))['then'](respondWithResult(_0x1c16f6,null))[_0x8895('0xa')](handleError(_0x1c16f6,null));};exports['voiceQueuesChannels']=function(_0x40ba14,_0x1a3fe5){return respondWithRpcPromise(_0x8895('0x20'),_0x40ba14[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x1a3fe5,null))['catch'](handleError(_0x1a3fe5,null));};exports[_0x8895('0x21')]=function(_0xcba076,_0x1b5359){return respondWithRpcPromise(_0x8895('0x22'),_[_0x8895('0x18')](_0xcba076['query'],_0xcba076[_0x8895('0x19')]))['then'](respondWithResult(_0x1b5359,null))[_0x8895('0xa')](handleError(_0x1b5359,null));};exports['voiceQueuesChannelHangup']=function(_0x21c22b,_0x15a865){return respondWithRpcPromise(_0x8895('0x23'),_[_0x8895('0x18')](_0x21c22b[_0x8895('0x16')],_0x21c22b['params']))[_0x8895('0x5')](respondWithResult(_0x15a865,null))['catch'](handleError(_0x15a865,null));};exports[_0x8895('0x24')]=function(_0xcc735f,_0x36e13b){return respondWithRpcPromise(_0x8895('0x25'),_[_0x8895('0x18')](_0xcc735f[_0x8895('0x16')],_0xcc735f['params']))[_0x8895('0x5')](respondWithResult(_0x36e13b,null))[_0x8895('0xa')](handleError(_0x36e13b,null));};exports['outbound']=function(_0x2557fc,_0x54ca09){return respondWithRpcPromise(_0x8895('0x26'),_0x2557fc[_0x8895('0x16')])['then'](respondWithResult(_0x54ca09,null))[_0x8895('0xa')](handleError(_0x54ca09,null));};exports[_0x8895('0x27')]=function(_0x5b7204,_0x58751a){return respondWithRpcPromise(_0x8895('0x28'),_0x5b7204[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x58751a,null))[_0x8895('0xa')](handleError(_0x58751a,null));};exports[_0x8895('0x29')]=function(_0x4917d1,_0x42ed1f){var _0x25c854;return respondWithRpcPromise(_0x8895('0x2a'),_0x4917d1[_0x8895('0x16')])[_0x8895('0x5')](function(_0x534876){_0x25c854=_0x534876;return respondWithRpcPromise('Agents',_0x4917d1[_0x8895('0x16')],routingClient);})['then'](function(_0x20a521){return _[_0x8895('0x18')]({},_0x20a521,_0x25c854);})['then'](respondWithResult(_0x42ed1f,null))[_0x8895('0xa')](handleError(_0x42ed1f,null));};exports['agentCapacity']=function(_0x1e6395,_0x5e6413){if(_0x1e6395['body']&&_0x1e6395['body']['interaction']&&_0x1e6395['user']&&_0x1e6395['user'][_0x8895('0xf')]){for(var _0x206f57 in _0x1e6395['body']['interaction']){if(_0x1e6395[_0x8895('0x1d')][_0x8895('0x2b')]['hasOwnProperty'](_0x206f57)){db[_0x8895('0x2c')][_0x8895('0x2d')]({'where':{'channel':_0x206f57,'membername':_0x1e6395[_0x8895('0x2e')][_0x8895('0xf')],'type':_0x8895('0x2f'),'exitAt':null,'uniqueid':_0x1e6395['body']['interaction'][_0x206f57]&&_0x1e6395['body'][_0x8895('0x2b')][_0x206f57]['length']?{'$notIn':_0x1e6395[_0x8895('0x1d')][_0x8895('0x2b')][_0x206f57]}:{'$ne':null}}})[_0x8895('0x5')](function(_0x28aaa9){var _0x587ccb=moment()[_0x8895('0x30')](_0x8895('0x31'));for(var _0x3413cd=0x0,_0x167302=_0x28aaa9[_0x8895('0x32')];_0x3413cd<_0x167302;_0x3413cd+=0x1){_0x28aaa9[_0x3413cd][_0x8895('0x33')]({'exitAt':_0x587ccb});}});for(var _0x14295a=0x0;_0x14295a<_0x1e6395[_0x8895('0x1d')]['interaction'][_0x206f57][_0x8895('0x32')];_0x14295a+=0x1){db[_0x8895('0x2c')]['findOrCreate']({'where':{'channel':_0x206f57,'membername':_0x1e6395[_0x8895('0x2e')]['name'],'type':'INTERACTION','uniqueid':_0x1e6395[_0x8895('0x1d')][_0x8895('0x2b')][_0x206f57][_0x14295a],'exitAt':null},'defaults':{'channel':_0x206f57,'membername':_0x1e6395[_0x8895('0x2e')]['name'],'interface':_[_0x8895('0x11')](_0x1e6395['user'][_0x8895('0x34')])?util[_0x8895('0x30')](_0x8895('0x35'),_0x1e6395[_0x8895('0x2e')][_0x8895('0xf')]):_0x1e6395[_0x8895('0x2e')][_0x8895('0x34')],'type':'INTERACTION','enterAt':moment()['format'](_0x8895('0x31')),'role':_0x8895('0x36'),'internal':_0x1e6395['user'][_0x8895('0x37')],'uniqueid':_0x1e6395['body']['interaction'][_0x206f57][_0x14295a]}});}}}}return respondWithRpcPromise(_0x8895('0x38'),{'id':_0x1e6395['params']['id'],'capacity':_0x1e6395[_0x8895('0x1d')][_0x8895('0x39')]},routingClient)[_0x8895('0x5')](respondWithResult(_0x5e6413,null))[_0x8895('0xa')](handleError(_0x5e6413,null));};exports[_0x8895('0x3a')]=function(_0x39a1d9,_0x306481){return respondWithRpcPromise(_0x8895('0x3b'),_0x39a1d9['query'])[_0x8895('0x5')](respondWithResult(_0x306481,null))[_0x8895('0xa')](handleError(_0x306481,null));};exports[_0x8895('0x3c')]=function(_0x5a5bc6,_0x1935aa){return respondWithRpcPromise(_0x8895('0x3d'),_0x5a5bc6[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x1935aa,null))[_0x8895('0xa')](handleError(_0x1935aa,null));};exports[_0x8895('0x3e')]=function(_0x434ab8,_0x216e6e){return respondWithRpcPromise(_0x8895('0x3f'),_0x434ab8[_0x8895('0x16')])['then'](respondWithResult(_0x216e6e,null))[_0x8895('0xa')](handleError(_0x216e6e,null));};exports[_0x8895('0x40')]=function(_0xb3d1ab,_0x10560a){return respondWithRpcPromise(_0x8895('0x41'),_0xb3d1ab['query'],routingClient)[_0x8895('0x5')](respondWithResult(_0x10560a,null))[_0x8895('0xa')](handleError(_0x10560a,null));};exports[_0x8895('0x42')]=function(_0x3d17bd,_0x37a7b4){return respondWithRpcPromise('ChatQueues',_0x3d17bd[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x3d17bd[_0x8895('0x19')]['id']))['then'](respondWithResult(_0x37a7b4,null))[_0x8895('0xa')](handleError(_0x37a7b4,null));};exports[_0x8895('0x43')]=function(_0x2c777b,_0x4ec8eb){return respondWithRpcPromise(_0x8895('0x44'),_0x2c777b[_0x8895('0x16')],routingClient)['then'](respondWithResult(_0x4ec8eb,null))[_0x8895('0xa')](handleError(_0x4ec8eb,null));};exports[_0x8895('0x45')]=function(_0x5198f8,_0x2f990a){return respondWithRpcPromise(_0x8895('0x44'),_0x5198f8[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x5198f8['params']['id']))['then'](respondWithResult(_0x2f990a,null))[_0x8895('0xa')](handleError(_0x2f990a,null));};exports[_0x8895('0x46')]=function(_0x49877,_0x51eb9c){return respondWithRpcPromise(_0x8895('0x47'),_0x49877[_0x8895('0x16')],mailClient)['then'](respondWithResult(_0x51eb9c,null))[_0x8895('0xa')](handleError(_0x51eb9c,null));};exports['openchannelQueues']=function(_0x435e36,_0x2bd955){return respondWithRpcPromise(_0x8895('0x48'),_0x435e36[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0x2bd955,null))['catch'](handleError(_0x2bd955,null));};exports['showOpenchannelQueues']=function(_0x239401,_0x216abb){return respondWithRpcPromise('OpenchannelQueues',_0x239401[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x239401[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0x216abb,null))['catch'](handleError(_0x216abb,null));};exports[_0x8895('0x49')]=function(_0x2d2bf9,_0x1b1bc0){return respondWithRpcPromise(_0x8895('0x4a'),_0x2d2bf9[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0x1b1bc0,null))[_0x8895('0xa')](handleError(_0x1b1bc0,null));};exports[_0x8895('0x4b')]=function(_0x2bffd7,_0x21c7bb){return respondWithRpcPromise(_0x8895('0x4a'),_0x2bffd7[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x2bffd7[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0x21c7bb,null))['catch'](handleError(_0x21c7bb,null));};exports['whatsappQueues']=function(_0x5b96fe,_0x13b143){return respondWithRpcPromise(_0x8895('0x4c'),_0x5b96fe[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0x13b143,null))[_0x8895('0xa')](handleError(_0x13b143,null));};exports['showWhatsappQueues']=function(_0x816803,_0xc6af80){return respondWithRpcPromise('WhatsappQueues',_0x816803[_0x8895('0x16')],routingClient)[_0x8895('0x5')](findById(_0x816803[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0xc6af80,null))[_0x8895('0xa')](handleError(_0xc6af80,null));};exports['faxQueues']=function(_0x6440ea,_0x3c318c){return respondWithRpcPromise(_0x8895('0x4d'),_0x6440ea[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0x3c318c,null))[_0x8895('0xa')](handleError(_0x3c318c,null));};exports[_0x8895('0x4e')]=function(_0x5e7048,_0x10d395){return respondWithRpcPromise(_0x8895('0x4d'),_0x5e7048['query'],routingClient)[_0x8895('0x5')](findById(_0x5e7048[_0x8895('0x19')]['id']))[_0x8895('0x5')](respondWithResult(_0x10d395,null))[_0x8895('0xa')](handleError(_0x10d395,null));};exports[_0x8895('0x4f')]=function(_0x560381,_0x16cd17){return respondWithRpcPromise('FaxAccounts',_0x560381[_0x8895('0x16')])[_0x8895('0x5')](respondWithResult(_0x16cd17,null))['catch'](handleError(_0x16cd17,null));};exports[_0x8895('0x50')]=function(_0x24f1c5,_0x140b2a){return respondWithRpcPromise(_0x8895('0x51'),_0x24f1c5['query'],routingClient)[_0x8895('0x5')](respondWithResult(_0x140b2a,null))['catch'](handleError(_0x140b2a,null));};exports['mailQueuesWaitingInteractions']=function(_0x1a198d,_0x185351){return respondWithRpcPromise(_0x8895('0x52'),_0x1a198d['query'],routingClient)[_0x8895('0x5')](respondWithResult(_0x185351,null))['catch'](handleError(_0x185351,null));};exports[_0x8895('0x53')]=function(_0x930a13,_0x3893fb){return respondWithRpcPromise(_0x8895('0x54'),_0x930a13[_0x8895('0x16')],routingClient)['then'](respondWithResult(_0x3893fb,null))['catch'](handleError(_0x3893fb,null));};exports[_0x8895('0x55')]=function(_0x5517a2,_0x3707a6){return respondWithRpcPromise(_0x8895('0x54'),_0x5517a2['query'],routingClient)[_0x8895('0x5')](function(_0xd9637a){if(_0x5517a2[_0x8895('0x16')][_0x8895('0x56')]!==undefined){var _0x166e9a=_(_0xd9637a['rows'])[_0x8895('0x57')]([_0x5517a2['query']['type'],_0x5517a2[_0x8895('0x19')]['id']])['map'](_0x8895('0x58'))[_0x8895('0x59')]()[_0x8895('0x5a')]();return _0xd9637a[_0x8895('0x12')]['filter'](function(_0x4d802e){return _0x166e9a['indexOf'](_0x4d802e[_0x8895('0x58')])>-0x1;});}else{return _0xd9637a[_0x8895('0x12')][_0x8895('0x57')](function(_0x14fd1f){return _0x14fd1f[_0x8895('0x58')]===parseInt(_0x5517a2[_0x8895('0x19')]['id']);});}})['then'](respondWithResult(_0x3707a6,null))[_0x8895('0xa')](handleError(_0x3707a6,null));};exports[_0x8895('0x5b')]=function(_0x4deccc,_0x584a1f){return respondWithRpcPromise(_0x8895('0x5c'),_0x4deccc['query'],routingClient)[_0x8895('0x5')](respondWithResult(_0x584a1f,null))['catch'](handleError(_0x584a1f,null));};exports[_0x8895('0x5d')]=function(_0x452756,_0x553437){return respondWithRpcPromise(_0x8895('0x5e'),_0x452756[_0x8895('0x16')],routingClient)['then'](respondWithResult(_0x553437,null))[_0x8895('0xa')](handleError(_0x553437,null));};exports[_0x8895('0x5f')]=function(_0x2af98f,_0xef59db){return respondWithRpcPromise(_0x8895('0x60'),_0x2af98f[_0x8895('0x16')],routingClient)[_0x8895('0x5')](respondWithResult(_0xef59db,null))['catch'](handleError(_0xef59db,null));};exports[_0x8895('0x61')]=function(_0x5ada19){return function(_0x330506,_0x1f583a){var _0x32d52c,_0x325597;var _0x4e6691=_[_0x8895('0x62')](_0x5ada19);var _0x1d50f6=_0x5ada19===_0x8895('0x63')?_0x8895('0x64'):_0x8895('0x65');return db[_0x4e6691+_0x8895('0x66')][_0x8895('0x67')]({'raw':!![],'where':{'id':_0x330506[_0x8895('0x19')]['id']}})['then'](function(_0x3b4092){if(_[_0x8895('0x11')](_0x3b4092)){throw new Error(_0x4e6691+'\x20Queue\x20not\x20found');}_0x32d52c=_0x3b4092;return db[_0x4e6691+'Message'][_0x8895('0x67')]({'where':{'id':_0x330506[_0x8895('0x1d')][_0x8895('0x68')]},'include':[{'model':db[_0x4e6691+_0x8895('0x69')],'as':'Interaction'},{'model':db[_0x4e6691+_0x1d50f6],'as':'Account'}]});})[_0x8895('0x5')](function(_0x42ebe2){if(_[_0x8895('0x11')](_0x42ebe2)){throw new Error(_0x4e6691+_0x8895('0x6a'));}_0x325597=_0x42ebe2;return _0x42ebe2[_0x8895('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2cd8b0={'uniqueid':_0x5ada19+'.'+_0x325597['id']+'.'+_0x325597[_0x8895('0x69')]['id'],'FromUserId':_0x330506['user']['id'],'type':_0x8895('0x6c')};_0x2cd8b0[_0x4e6691+_0x8895('0x6d')]=_0x325597['id'];_0x2cd8b0[_0x4e6691+_0x8895('0x6e')]=_0x325597[_0x8895('0x69')]['id'];_0x2cd8b0[_0x8895('0x6f')+_0x4e6691+_0x1d50f6+'Id']=_0x325597[_0x8895('0x65')]['id'];_0x2cd8b0['To'+_0x4e6691+'QueueId']=_0x32d52c['id'];return db[_0x4e6691+_0x8895('0x70')][_0x8895('0x71')](_0x2cd8b0);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x5ada19,'interaction':_0x325597['Interaction'],'message':_0x325597,'account':_0x325597[_0x8895('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8895('0x6c'),'appdata':_0x32d52c['name']+','+(_0x325597[_0x8895('0x65')]['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x1f583a,null))[_0x8895('0xa')](handleError(_0x1f583a,null));};};exports[_0x8895('0x72')]=function(_0x28d7ab,_0x20b607){var _0x605f47,_0x54cf18;if(_[_0x8895('0x11')](_0x28d7ab[_0x8895('0x1d')][_0x8895('0x73')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x4a4d4b=_0x28d7ab['body'][_0x8895('0x73')];var _0x1d796a=_[_0x8895('0x62')](_0x4a4d4b);var _0x2084b1=_0x4a4d4b===_0x8895('0x63')?_0x8895('0x64'):_0x8895('0x65');return db['User'][_0x8895('0x67')]({'raw':!![],'where':{'id':_0x28d7ab['params']['id'],'role':_0x8895('0x36')}})['then'](function(_0x2f2908){if(_[_0x8895('0x11')](_0x2f2908)){throw new Error(_0x8895('0x74'));}_0x605f47=_0x2f2908;return db[_0x1d796a+_0x8895('0x75')][_0x8895('0x67')]({'where':{'id':_0x28d7ab[_0x8895('0x1d')][_0x8895('0x68')]},'include':[{'model':db[_0x1d796a+'Interaction'],'as':_0x8895('0x69')},{'model':db[_0x1d796a+_0x2084b1],'as':_0x8895('0x65')}]});})[_0x8895('0x5')](function(_0x3ce240){if(_[_0x8895('0x11')](_0x3ce240)){throw new Error(_0x1d796a+'\x20Message\x20not\x20found');}_0x54cf18=_0x3ce240;return _0x3ce240[_0x8895('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x20f574={'uniqueid':_0x4a4d4b+'.'+_0x54cf18['id']+'.'+_0x54cf18[_0x8895('0x69')]['id'],'FromUserId':_0x28d7ab[_0x8895('0x2e')]['id'],'type':_0x8895('0x6c'),'ToUserId':_0x605f47['id']};_0x20f574[_0x1d796a+_0x8895('0x6d')]=_0x54cf18['id'];_0x20f574[_0x1d796a+_0x8895('0x6e')]=_0x54cf18[_0x8895('0x69')]['id'];_0x20f574[_0x8895('0x6f')+_0x1d796a+_0x2084b1+'Id']=_0x54cf18[_0x8895('0x65')]['id'];return db[_0x1d796a+'TransferReport'][_0x8895('0x71')](_0x20f574);})['then'](function(){return respondWithRpcPromise(_0x8895('0x76'),{'channel':_0x4a4d4b,'interaction':_0x54cf18[_0x8895('0x69')],'message':_0x54cf18,'account':_0x54cf18[_0x8895('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x605f47[_0x8895('0xf')]+','+(_0x54cf18['Account'][_0x8895('0x77')]||0x12c),'interval':_0x8895('0x78')}]},routingClient);})[_0x8895('0x5')](respondWithResult(_0x20b607,null))[_0x8895('0xa')](handleError(_0x20b607,null));}; \ No newline at end of file +var _0xae24=['InteractionId','From','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Agent\x20not\x20found','bluebird','lodash','../../mysqldb','../../config/logger','client','http','then','error','code','message','result','catch','status','json','sendStatus','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','params','voiceQueuesPreview','VoiceQueuesPreview','merge','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','format','length','updateAttributes','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','OpenchannelQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId'];(function(_0x1091be,_0x455349){var _0xae4368=function(_0x65f009){while(--_0x65f009){_0x1091be['push'](_0x1091be['shift']());}};_0xae4368(++_0x455349);}(_0xae24,0x182));var _0x4ae2=function(_0x269d1b,_0x5baebe){_0x269d1b=_0x269d1b-0x0;var _0x58df11=_0xae24[_0x269d1b];return _0x58df11;};'use strict';var BPromise=require(_0x4ae2('0x0'));var moment=require('moment');var _=require(_0x4ae2('0x1'));var util=require('util');var db=require(_0x4ae2('0x2'))['db'];var logger=require(_0x4ae2('0x3'))('api');var jayson=require('jayson/promise');var amiClient=jayson[_0x4ae2('0x4')]['http']({'port':0x232a});var mailClient=jayson[_0x4ae2('0x4')][_0x4ae2('0x5')]({'port':0x232b});var routingClient=jayson[_0x4ae2('0x4')][_0x4ae2('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x428054,_0x307247,_0x4f2e84){return new BPromise(function(_0x5f589a,_0x41cdf1){var _0x4d3d8a=_0x4f2e84?_0x4f2e84:amiClient;return _0x4d3d8a['request'](_0x428054,_0x307247)[_0x4ae2('0x6')](function(_0xb01e8e){if(_0xb01e8e['error']){if(_0xb01e8e[_0x4ae2('0x7')][_0x4ae2('0x8')]===0x1f4){return _0x41cdf1(_0xb01e8e[_0x4ae2('0x7')][_0x4ae2('0x9')]);}return _0x5f589a(_0xb01e8e['error'][_0x4ae2('0x9')]);}else{_0x5f589a(_0xb01e8e[_0x4ae2('0xa')]);}})[_0x4ae2('0xb')](function(_0x4d7dc3){_0x41cdf1(_0x4d7dc3);});});}function respondWithResult(_0x25d2b4,_0x22ac1e){_0x22ac1e=_0x22ac1e||0xc8;return function(_0x30d6c4){if(_0x30d6c4){return _0x25d2b4[_0x4ae2('0xc')](_0x22ac1e)[_0x4ae2('0xd')](_0x30d6c4);}return _0x25d2b4[_0x4ae2('0xe')](0x194);};}function handleError(_0x145287,_0x3cabc9){_0x3cabc9=_0x3cabc9||0x1f4;return function(_0xd527a0){logger['error'](_0xd527a0['stack']);if(_0xd527a0['name']){delete _0xd527a0[_0x4ae2('0xf')];}_0x145287[_0x4ae2('0xc')](_0x3cabc9)['send'](_0xd527a0);};}function findById(_0x463765){return function(_0x9fb8db){if(!_[_0x4ae2('0x10')](_0x463765)&&!_[_0x4ae2('0x10')](_0x9fb8db)&&!_[_0x4ae2('0x10')](_0x9fb8db[_0x4ae2('0x11')])){return _[_0x4ae2('0x12')](_0x9fb8db[_0x4ae2('0x11')],function(_0x41b672){return _0x41b672['id']==_0x463765;});}return null;};}exports[_0x4ae2('0x13')]=function(_0x4d5071,_0x4a97af){return respondWithRpcPromise(_0x4ae2('0x14'),_0x4d5071[_0x4ae2('0x15')])['then'](respondWithResult(_0x4a97af,null))[_0x4ae2('0xb')](handleError(_0x4a97af,null));};exports[_0x4ae2('0x16')]=function(_0xccb3b,_0x2ad222){return respondWithRpcPromise(_0x4ae2('0x17'),_['merge'](_0xccb3b[_0x4ae2('0x15')],_0xccb3b['params']))['then'](respondWithResult(_0x2ad222,null))[_0x4ae2('0xb')](handleError(_0x2ad222,null));};exports[_0x4ae2('0x18')]=function(_0x802bf0,_0x17041e){return respondWithRpcPromise(_0x4ae2('0x19'),_['merge'](_0x802bf0[_0x4ae2('0x15')],_0x802bf0['params']))[_0x4ae2('0x6')](respondWithResult(_0x17041e,null))[_0x4ae2('0xb')](handleError(_0x17041e,null));};exports[_0x4ae2('0x1a')]=function(_0x57933b,_0x43f112){return respondWithRpcPromise(_0x4ae2('0x1b'),_0x57933b[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x43f112,null))[_0x4ae2('0xb')](handleError(_0x43f112,null));};exports[_0x4ae2('0x1c')]=function(_0x5b2e65,_0x5962b0){return respondWithRpcPromise(_0x4ae2('0x1b'),_0x5b2e65[_0x4ae2('0x15')])[_0x4ae2('0x6')](findById(_0x5b2e65[_0x4ae2('0x1d')]['id']))[_0x4ae2('0x6')](respondWithResult(_0x5962b0,null))[_0x4ae2('0xb')](handleError(_0x5962b0,null));};exports['updateVoiceQueue']=function(_0x5ec1fd,_0x3e2666){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x5ec1fd['body'],_0x5ec1fd[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0x3e2666,null))['catch'](handleError(_0x3e2666,null));};exports[_0x4ae2('0x1e')]=function(_0x37e3e5,_0x3d56ea){return respondWithRpcPromise(_0x4ae2('0x1f'),_[_0x4ae2('0x20')](_0x37e3e5[_0x4ae2('0x15')],_0x37e3e5[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0x3d56ea,null))[_0x4ae2('0xb')](handleError(_0x3d56ea,null));};exports[_0x4ae2('0x21')]=function(_0x386687,_0x12815f){return respondWithRpcPromise(_0x4ae2('0x22'),_0x386687[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x12815f,null))[_0x4ae2('0xb')](handleError(_0x12815f,null));};exports[_0x4ae2('0x23')]=function(_0x4bd47f,_0xdcd11e){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x4ae2('0x20')](_0x4bd47f[_0x4ae2('0x15')],_0x4bd47f['params']))[_0x4ae2('0x6')](respondWithResult(_0xdcd11e,null))[_0x4ae2('0xb')](handleError(_0xdcd11e,null));};exports[_0x4ae2('0x24')]=function(_0x2dde26,_0x5256d3){return respondWithRpcPromise(_0x4ae2('0x25'),_[_0x4ae2('0x20')](_0x2dde26[_0x4ae2('0x15')],_0x2dde26[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0x5256d3,null))[_0x4ae2('0xb')](handleError(_0x5256d3,null));};exports[_0x4ae2('0x26')]=function(_0x46f3a2,_0xe99f9d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x4ae2('0x20')](_0x46f3a2['query'],_0x46f3a2[_0x4ae2('0x1d')]))[_0x4ae2('0x6')](respondWithResult(_0xe99f9d,null))[_0x4ae2('0xb')](handleError(_0xe99f9d,null));};exports[_0x4ae2('0x27')]=function(_0x771c14,_0x129adf){return respondWithRpcPromise('Outbound',_0x771c14[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x129adf,null))[_0x4ae2('0xb')](handleError(_0x129adf,null));};exports[_0x4ae2('0x28')]=function(_0x49baf9,_0x2d4737){return respondWithRpcPromise(_0x4ae2('0x29'),_0x49baf9[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x2d4737,null))[_0x4ae2('0xb')](handleError(_0x2d4737,null));};exports[_0x4ae2('0x2a')]=function(_0x1fdc61,_0x1b04ee){var _0x1d5888;return respondWithRpcPromise(_0x4ae2('0x2b'),_0x1fdc61[_0x4ae2('0x15')])['then'](function(_0x2c3676){_0x1d5888=_0x2c3676;return respondWithRpcPromise(_0x4ae2('0x2b'),_0x1fdc61[_0x4ae2('0x15')],routingClient);})[_0x4ae2('0x6')](function(_0x5bade3){return _['merge']({},_0x5bade3,_0x1d5888);})[_0x4ae2('0x6')](respondWithResult(_0x1b04ee,null))[_0x4ae2('0xb')](handleError(_0x1b04ee,null));};exports[_0x4ae2('0x2c')]=function(_0x3cdf23,_0x567371){if(_0x3cdf23[_0x4ae2('0x2d')]&&_0x3cdf23[_0x4ae2('0x2d')]['interaction']&&_0x3cdf23[_0x4ae2('0x2e')]&&_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')]){for(var _0x5a9126 in _0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')]){if(_0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')][_0x4ae2('0x30')](_0x5a9126)){db[_0x4ae2('0x31')][_0x4ae2('0x32')]({'where':{'channel':_0x5a9126,'membername':_0x3cdf23[_0x4ae2('0x2e')]['name'],'type':_0x4ae2('0x33'),'exitAt':null,'uniqueid':_0x3cdf23[_0x4ae2('0x2d')]['interaction'][_0x5a9126]&&_0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')][_0x5a9126]['length']?{'$notIn':_0x3cdf23[_0x4ae2('0x2d')][_0x4ae2('0x2f')][_0x5a9126]}:{'$ne':null}}})['then'](function(_0x21baf4){var _0x2ab00f=moment()[_0x4ae2('0x34')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4fc82f=0x0,_0x26681b=_0x21baf4[_0x4ae2('0x35')];_0x4fc82f<_0x26681b;_0x4fc82f+=0x1){_0x21baf4[_0x4fc82f][_0x4ae2('0x36')]({'exitAt':_0x2ab00f});}});for(var _0x8a17a4=0x0;_0x8a17a4<_0x3cdf23['body'][_0x4ae2('0x2f')][_0x5a9126][_0x4ae2('0x35')];_0x8a17a4+=0x1){db[_0x4ae2('0x31')]['findOrCreate']({'where':{'channel':_0x5a9126,'membername':_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')],'type':_0x4ae2('0x33'),'uniqueid':_0x3cdf23['body'][_0x4ae2('0x2f')][_0x5a9126][_0x8a17a4],'exitAt':null},'defaults':{'channel':_0x5a9126,'membername':_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')],'interface':_[_0x4ae2('0x10')](_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0x37')])?util[_0x4ae2('0x34')](_0x4ae2('0x38'),_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0xf')]):_0x3cdf23['user'][_0x4ae2('0x37')],'type':_0x4ae2('0x33'),'enterAt':moment()[_0x4ae2('0x34')](_0x4ae2('0x39')),'role':_0x4ae2('0x3a'),'internal':_0x3cdf23[_0x4ae2('0x2e')][_0x4ae2('0x3b')],'uniqueid':_0x3cdf23[_0x4ae2('0x2d')]['interaction'][_0x5a9126][_0x8a17a4]}});}}}}return respondWithRpcPromise(_0x4ae2('0x3c'),{'id':_0x3cdf23[_0x4ae2('0x1d')]['id'],'capacity':_0x3cdf23['body'][_0x4ae2('0x3d')]},routingClient)[_0x4ae2('0x6')](respondWithResult(_0x567371,null))['catch'](handleError(_0x567371,null));};exports[_0x4ae2('0x3e')]=function(_0x4d6560,_0x426d29){return respondWithRpcPromise('Telephones',_0x4d6560[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x426d29,null))[_0x4ae2('0xb')](handleError(_0x426d29,null));};exports[_0x4ae2('0x3f')]=function(_0x8525c4,_0x153673){return respondWithRpcPromise(_0x4ae2('0x40'),_0x8525c4[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x153673,null))['catch'](handleError(_0x153673,null));};exports[_0x4ae2('0x41')]=function(_0x4284b4,_0x825c3a){return respondWithRpcPromise(_0x4ae2('0x42'),_0x4284b4['query'])[_0x4ae2('0x6')](respondWithResult(_0x825c3a,null))[_0x4ae2('0xb')](handleError(_0x825c3a,null));};exports[_0x4ae2('0x43')]=function(_0x49029e,_0x51f845){return respondWithRpcPromise(_0x4ae2('0x44'),_0x49029e[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x51f845,null))[_0x4ae2('0xb')](handleError(_0x51f845,null));};exports[_0x4ae2('0x45')]=function(_0x28d68e,_0x18a8e6){return respondWithRpcPromise(_0x4ae2('0x44'),_0x28d68e[_0x4ae2('0x15')],routingClient)['then'](findById(_0x28d68e[_0x4ae2('0x1d')]['id']))['then'](respondWithResult(_0x18a8e6,null))[_0x4ae2('0xb')](handleError(_0x18a8e6,null));};exports[_0x4ae2('0x46')]=function(_0x28e7a8,_0x2143fe){return respondWithRpcPromise(_0x4ae2('0x47'),_0x28e7a8[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x2143fe,null))[_0x4ae2('0xb')](handleError(_0x2143fe,null));};exports['showMailQueues']=function(_0x496f98,_0x33fb77){return respondWithRpcPromise(_0x4ae2('0x47'),_0x496f98[_0x4ae2('0x15')],routingClient)['then'](findById(_0x496f98['params']['id']))[_0x4ae2('0x6')](respondWithResult(_0x33fb77,null))[_0x4ae2('0xb')](handleError(_0x33fb77,null));};exports[_0x4ae2('0x48')]=function(_0x201b25,_0x41601d){return respondWithRpcPromise('MailAccounts',_0x201b25['query'],mailClient)['then'](respondWithResult(_0x41601d,null))[_0x4ae2('0xb')](handleError(_0x41601d,null));};exports['openchannelQueues']=function(_0x4e54d1,_0x17f023){return respondWithRpcPromise('OpenchannelQueues',_0x4e54d1[_0x4ae2('0x15')],routingClient)['then'](respondWithResult(_0x17f023,null))[_0x4ae2('0xb')](handleError(_0x17f023,null));};exports['showOpenchannelQueues']=function(_0xf417c0,_0x51141d){return respondWithRpcPromise(_0x4ae2('0x49'),_0xf417c0[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](findById(_0xf417c0[_0x4ae2('0x1d')]['id']))[_0x4ae2('0x6')](respondWithResult(_0x51141d,null))['catch'](handleError(_0x51141d,null));};exports['smsQueues']=function(_0x344963,_0x256d2f){return respondWithRpcPromise('SmsQueues',_0x344963[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x256d2f,null))['catch'](handleError(_0x256d2f,null));};exports[_0x4ae2('0x4a')]=function(_0xefd494,_0x49c58c){return respondWithRpcPromise('SmsQueues',_0xefd494[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](findById(_0xefd494['params']['id']))[_0x4ae2('0x6')](respondWithResult(_0x49c58c,null))[_0x4ae2('0xb')](handleError(_0x49c58c,null));};exports[_0x4ae2('0x4b')]=function(_0x30003b,_0x5af418){return respondWithRpcPromise(_0x4ae2('0x4c'),_0x30003b[_0x4ae2('0x15')],routingClient)['then'](respondWithResult(_0x5af418,null))[_0x4ae2('0xb')](handleError(_0x5af418,null));};exports[_0x4ae2('0x4d')]=function(_0x3412a1,_0x525cc5){return respondWithRpcPromise('WhatsappQueues',_0x3412a1[_0x4ae2('0x15')],routingClient)['then'](findById(_0x3412a1[_0x4ae2('0x1d')]['id']))['then'](respondWithResult(_0x525cc5,null))[_0x4ae2('0xb')](handleError(_0x525cc5,null));};exports['faxQueues']=function(_0x2758c0,_0x519763){return respondWithRpcPromise(_0x4ae2('0x4e'),_0x2758c0['query'],routingClient)['then'](respondWithResult(_0x519763,null))[_0x4ae2('0xb')](handleError(_0x519763,null));};exports[_0x4ae2('0x4f')]=function(_0x1a603b,_0xde3aac){return respondWithRpcPromise(_0x4ae2('0x4e'),_0x1a603b[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](findById(_0x1a603b[_0x4ae2('0x1d')]['id']))[_0x4ae2('0x6')](respondWithResult(_0xde3aac,null))[_0x4ae2('0xb')](handleError(_0xde3aac,null));};exports[_0x4ae2('0x50')]=function(_0x4403ed,_0x55f1fe){return respondWithRpcPromise(_0x4ae2('0x51'),_0x4403ed[_0x4ae2('0x15')])[_0x4ae2('0x6')](respondWithResult(_0x55f1fe,null))[_0x4ae2('0xb')](handleError(_0x55f1fe,null));};exports['chatQueuesWaitingInteractions']=function(_0x18f568,_0x5add54){return respondWithRpcPromise(_0x4ae2('0x52'),_0x18f568[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x5add54,null))[_0x4ae2('0xb')](handleError(_0x5add54,null));};exports[_0x4ae2('0x53')]=function(_0x318b4a,_0x4ed285){return respondWithRpcPromise(_0x4ae2('0x54'),_0x318b4a[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x4ed285,null))['catch'](handleError(_0x4ed285,null));};exports[_0x4ae2('0x55')]=function(_0x36f5c4,_0x4082d4){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x36f5c4[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x4082d4,null))[_0x4ae2('0xb')](handleError(_0x4082d4,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x2bb165,_0x278c5e){return respondWithRpcPromise(_0x4ae2('0x56'),_0x2bb165[_0x4ae2('0x15')],routingClient)['then'](function(_0x390c71){if(_0x2bb165[_0x4ae2('0x15')][_0x4ae2('0x57')]!==undefined){var _0x98272b=_(_0x390c71[_0x4ae2('0x11')])[_0x4ae2('0x58')]([_0x2bb165[_0x4ae2('0x15')]['type'],_0x2bb165['params']['id']])[_0x4ae2('0x59')](_0x4ae2('0x5a'))[_0x4ae2('0x5b')]()[_0x4ae2('0x5c')]();return _0x390c71[_0x4ae2('0x11')][_0x4ae2('0x58')](function(_0x4b0606){return _0x98272b[_0x4ae2('0x5d')](_0x4b0606[_0x4ae2('0x5a')])>-0x1;});}else{return _0x390c71[_0x4ae2('0x11')][_0x4ae2('0x58')](function(_0x22a880){return _0x22a880[_0x4ae2('0x5a')]===parseInt(_0x2bb165['params']['id']);});}})[_0x4ae2('0x6')](respondWithResult(_0x278c5e,null))[_0x4ae2('0xb')](handleError(_0x278c5e,null));};exports[_0x4ae2('0x5e')]=function(_0x3a84d7,_0x1bf2a4){return respondWithRpcPromise(_0x4ae2('0x5f'),_0x3a84d7['query'],routingClient)['then'](respondWithResult(_0x1bf2a4,null))[_0x4ae2('0xb')](handleError(_0x1bf2a4,null));};exports[_0x4ae2('0x60')]=function(_0x517ecb,_0x9320c1){return respondWithRpcPromise(_0x4ae2('0x61'),_0x517ecb[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x9320c1,null))[_0x4ae2('0xb')](handleError(_0x9320c1,null));};exports[_0x4ae2('0x62')]=function(_0xc4748b,_0x51cbf9){return respondWithRpcPromise(_0x4ae2('0x63'),_0xc4748b[_0x4ae2('0x15')],routingClient)[_0x4ae2('0x6')](respondWithResult(_0x51cbf9,null))[_0x4ae2('0xb')](handleError(_0x51cbf9,null));};exports[_0x4ae2('0x64')]=function(_0x29b0d0){return function(_0x555d17,_0x2cba96){var _0x417774,_0x17f398;var _0x58474e=_[_0x4ae2('0x65')](_0x29b0d0);var _0x49da03=_0x29b0d0===_0x4ae2('0x66')?_0x4ae2('0x67'):_0x4ae2('0x68');return db[_0x58474e+_0x4ae2('0x69')][_0x4ae2('0x6a')]({'raw':!![],'where':{'id':_0x555d17['params']['id']}})[_0x4ae2('0x6')](function(_0x384c7e){if(_[_0x4ae2('0x10')](_0x384c7e)){throw new Error(_0x58474e+_0x4ae2('0x6b'));}_0x417774=_0x384c7e;return db[_0x58474e+'Message'][_0x4ae2('0x6a')]({'where':{'id':_0x555d17['body'][_0x4ae2('0x6c')]},'include':[{'model':db[_0x58474e+_0x4ae2('0x6d')],'as':'Interaction'},{'model':db[_0x58474e+_0x49da03],'as':_0x4ae2('0x68')}]});})[_0x4ae2('0x6')](function(_0x29eaf4){if(_[_0x4ae2('0x10')](_0x29eaf4)){throw new Error(_0x58474e+_0x4ae2('0x6e'));}_0x17f398=_0x29eaf4;return _0x29eaf4[_0x4ae2('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2f97d7={'uniqueid':_0x29b0d0+'.'+_0x17f398['id']+'.'+_0x17f398['Interaction']['id'],'FromUserId':_0x555d17[_0x4ae2('0x2e')]['id'],'type':_0x4ae2('0x70')};_0x2f97d7[_0x58474e+_0x4ae2('0x71')]=_0x17f398['id'];_0x2f97d7[_0x58474e+_0x4ae2('0x72')]=_0x17f398[_0x4ae2('0x6d')]['id'];_0x2f97d7[_0x4ae2('0x73')+_0x58474e+_0x49da03+'Id']=_0x17f398['Account']['id'];_0x2f97d7['To'+_0x58474e+'QueueId']=_0x417774['id'];return db[_0x58474e+_0x4ae2('0x74')][_0x4ae2('0x75')](_0x2f97d7);})[_0x4ae2('0x6')](function(){return respondWithRpcPromise(_0x4ae2('0x76'),{'channel':_0x29b0d0,'interaction':_0x17f398[_0x4ae2('0x6d')],'message':_0x17f398,'account':_0x17f398[_0x4ae2('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ae2('0x70'),'appdata':_0x417774[_0x4ae2('0xf')]+','+(_0x17f398['Account'][_0x4ae2('0x77')]||0x12c),'interval':_0x4ae2('0x78')}]},routingClient);})[_0x4ae2('0x6')](respondWithResult(_0x2cba96,null))[_0x4ae2('0xb')](handleError(_0x2cba96,null));};};exports[_0x4ae2('0x79')]=function(_0xa79171,_0xa42e4d){var _0x1deb7d,_0x8d0217;if(_[_0x4ae2('0x10')](_0xa79171[_0x4ae2('0x2d')][_0x4ae2('0x7a')])){throw new Error(_0x4ae2('0x7b'));}var _0x310f93=_0xa79171[_0x4ae2('0x2d')][_0x4ae2('0x7a')];var _0x31c1f7=_['capitalize'](_0x310f93);var _0x3de590=_0x310f93===_0x4ae2('0x66')?_0x4ae2('0x67'):'Account';return db['User'][_0x4ae2('0x6a')]({'raw':!![],'where':{'id':_0xa79171[_0x4ae2('0x1d')]['id'],'role':'agent'}})[_0x4ae2('0x6')](function(_0x21c4ec){if(_['isNil'](_0x21c4ec)){throw new Error(_0x4ae2('0x7c'));}_0x1deb7d=_0x21c4ec;return db[_0x31c1f7+'Message']['findOne']({'where':{'id':_0xa79171['body'][_0x4ae2('0x6c')]},'include':[{'model':db[_0x31c1f7+'Interaction'],'as':_0x4ae2('0x6d')},{'model':db[_0x31c1f7+_0x3de590],'as':_0x4ae2('0x68')}]});})[_0x4ae2('0x6')](function(_0x232e64){if(_[_0x4ae2('0x10')](_0x232e64)){throw new Error(_0x31c1f7+_0x4ae2('0x6e'));}_0x8d0217=_0x232e64;return _0x232e64[_0x4ae2('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x4ae2('0x6')](function(){var _0x386c80={'uniqueid':_0x310f93+'.'+_0x8d0217['id']+'.'+_0x8d0217['Interaction']['id'],'FromUserId':_0xa79171[_0x4ae2('0x2e')]['id'],'type':_0x4ae2('0x70'),'ToUserId':_0x1deb7d['id']};_0x386c80[_0x31c1f7+_0x4ae2('0x71')]=_0x8d0217['id'];_0x386c80[_0x31c1f7+_0x4ae2('0x72')]=_0x8d0217['Interaction']['id'];_0x386c80[_0x4ae2('0x73')+_0x31c1f7+_0x3de590+'Id']=_0x8d0217[_0x4ae2('0x68')]['id'];return db[_0x31c1f7+_0x4ae2('0x74')]['create'](_0x386c80);})[_0x4ae2('0x6')](function(){return respondWithRpcPromise(_0x4ae2('0x76'),{'channel':_0x310f93,'interaction':_0x8d0217[_0x4ae2('0x6d')],'message':_0x8d0217,'account':_0x8d0217[_0x4ae2('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ae2('0x3a'),'appdata':_0x1deb7d[_0x4ae2('0xf')]+','+(_0x8d0217[_0x4ae2('0x68')]['agentTransferTimeout']||0x12c),'interval':_0x4ae2('0x78')}]},routingClient);})[_0x4ae2('0x6')](respondWithResult(_0xa42e4d,null))[_0x4ae2('0xb')](handleError(_0xa42e4d,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index ac0604e..8d4a77c 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 _0xb239=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2341ec,_0x4b5c63){var _0x4765b1=function(_0x169c74){while(--_0x169c74){_0x2341ec['push'](_0x2341ec['shift']());}};_0x4765b1(++_0x4b5c63);}(_0xb239,0xba));var _0x9b23=function(_0x490304,_0x5f4e85){_0x490304=_0x490304-0x0;var _0x52c551=_0xb239[_0x490304];return _0x52c551;};'use strict';var multer=require(_0x9b23('0x0'));var util=require(_0x9b23('0x1'));var path=require(_0x9b23('0x2'));var timeout=require(_0x9b23('0x3'));var express=require(_0x9b23('0x4'));var router=express[_0x9b23('0x5')]();var fs_extra=require(_0x9b23('0x6'));var auth=require(_0x9b23('0x7'));var interaction=require(_0x9b23('0x8'));var config=require(_0x9b23('0x9'));var controller=require('./schedule.controller');router[_0x9b23('0xa')]('/',auth[_0x9b23('0xb')](),controller[_0x9b23('0xc')]);router[_0x9b23('0xa')](_0x9b23('0xd'),auth[_0x9b23('0xb')](),controller['show']);router[_0x9b23('0xa')]('/:id/run',auth[_0x9b23('0xb')](),controller['run']);router[_0x9b23('0xe')]('/',auth[_0x9b23('0xb')](),controller[_0x9b23('0xf')]);router[_0x9b23('0x10')](_0x9b23('0xd'),auth[_0x9b23('0xb')](),controller[_0x9b23('0x11')]);router[_0x9b23('0x12')](_0x9b23('0xd'),auth['isAuthenticated'](),controller[_0x9b23('0x13')]);module[_0x9b23('0x14')]=router; \ No newline at end of file +var _0x0aef=['/:id/run','run','post','create','update','delete','/:id','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','show'];(function(_0xca1a21,_0x664ef6){var _0x34c640=function(_0x375379){while(--_0x375379){_0xca1a21['push'](_0xca1a21['shift']());}};_0x34c640(++_0x664ef6);}(_0x0aef,0x95));var _0xf0ae=function(_0x104232,_0x3b49cc){_0x104232=_0x104232-0x0;var _0x5e5ea1=_0x0aef[_0x104232];return _0x5e5ea1;};'use strict';var multer=require('multer');var util=require(_0xf0ae('0x0'));var path=require(_0xf0ae('0x1'));var timeout=require('connect-timeout');var express=require(_0xf0ae('0x2'));var router=express[_0xf0ae('0x3')]();var fs_extra=require(_0xf0ae('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ae('0x5'));var config=require(_0xf0ae('0x6'));var controller=require(_0xf0ae('0x7'));router[_0xf0ae('0x8')]('/',auth[_0xf0ae('0x9')](),controller['index']);router[_0xf0ae('0x8')]('/:id',auth[_0xf0ae('0x9')](),controller[_0xf0ae('0xa')]);router[_0xf0ae('0x8')](_0xf0ae('0xb'),auth[_0xf0ae('0x9')](),controller[_0xf0ae('0xc')]);router[_0xf0ae('0xd')]('/',auth['isAuthenticated'](),controller[_0xf0ae('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf0ae('0xf')]);router[_0xf0ae('0x10')](_0xf0ae('0x11'),auth[_0xf0ae('0x9')](),controller[_0xf0ae('0x12')]);module[_0xf0ae('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 54ea2d0..e9f6fa4 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 _0xb1c9=['csv','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','weeks','hours','minutes','days','pdf','xlsx'];(function(_0x2657fa,_0x12be80){var _0x1962b7=function(_0xcccd5a){while(--_0xcccd5a){_0x2657fa['push'](_0x2657fa['shift']());}};_0x1962b7(++_0x12be80);}(_0xb1c9,0x130));var _0x9b1c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb1c9[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x9b1c('0x0'));module[_0x9b1c('0x1')]={'name':{'type':Sequelize[_0x9b1c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9b1c('0x2')]},'active':{'type':Sequelize[_0x9b1c('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9b1c('0x4')},'startAt':{'type':Sequelize[_0x9b1c('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x9b1c('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9b1c('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9b1c('0x7')](_0x9b1c('0x8'),_0x9b1c('0x9'),'months',_0x9b1c('0xa'),'days',_0x9b1c('0xb'),_0x9b1c('0xc')),'allowNull':![],'defaultValue':_0x9b1c('0xd')},'output':{'type':Sequelize['ENUM']('csv',_0x9b1c('0xe'),_0x9b1c('0xf')),'allowNull':![],'defaultValue':_0x9b1c('0x10')},'type':{'type':Sequelize[_0x9b1c('0x7')](_0x9b1c('0x11'),_0x9b1c('0x12')),'allowNull':![],'defaultValue':_0x9b1c('0x11')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x9b1c('0x2')]},'cc':{'type':Sequelize[_0x9b1c('0x13')]},'bcc':{'type':Sequelize[_0x9b1c('0x13')]},'sendIfEmpty':{'type':Sequelize[_0x9b1c('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xcd35=['hours','minutes','days','pdf','xlsx','csv','custom','default','BOOLEAN','TEXT','sequelize','exports','STRING','DATE','INTEGER','ENUM','quarters','months','weeks'];(function(_0x2ef954,_0x1f4e77){var _0x34bde4=function(_0x44532e){while(--_0x44532e){_0x2ef954['push'](_0x2ef954['shift']());}};_0x34bde4(++_0x1f4e77);}(_0xcd35,0x160));var _0x5cd3=function(_0xf9d99e,_0x5b9ae2){_0xf9d99e=_0xf9d99e-0x0;var _0xbf3870=_0xcd35[_0xf9d99e];return _0xbf3870;};'use strict';var Sequelize=require(_0x5cd3('0x0'));module[_0x5cd3('0x1')]={'name':{'type':Sequelize[_0x5cd3('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5cd3('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x5cd3('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x5cd3('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x5cd3('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x5cd3('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x5cd3('0x5')]('years',_0x5cd3('0x6'),_0x5cd3('0x7'),_0x5cd3('0x8'),'days',_0x5cd3('0x9'),_0x5cd3('0xa')),'allowNull':![],'defaultValue':_0x5cd3('0xb')},'output':{'type':Sequelize[_0x5cd3('0x5')]('csv',_0x5cd3('0xc'),_0x5cd3('0xd')),'allowNull':![],'defaultValue':_0x5cd3('0xe')},'type':{'type':Sequelize['ENUM'](_0x5cd3('0xf'),_0x5cd3('0x10')),'allowNull':![],'defaultValue':_0x5cd3('0xf')},'sendMail':{'type':Sequelize[_0x5cd3('0x11')],'defaultValue':![]},'email':{'type':Sequelize[_0x5cd3('0x2')]},'cc':{'type':Sequelize[_0x5cd3('0x12')]},'bcc':{'type':Sequelize[_0x5cd3('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x5cd3('0x11')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 8e852fc..97197e2 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 _0x149f=['includeAll','include','show','keys','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Scheduler','UserProfileSection','userProfileId','autoAssociation','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','set','json','apply','reject','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','map','Schedule','rawAttributes','fieldName','type','key','model','filters','intersection','query','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count'];(function(_0x569d11,_0x217bc7){var _0x4160c5=function(_0x5b8980){while(--_0x5b8980){_0x569d11['push'](_0x569d11['shift']());}};_0x4160c5(++_0x217bc7);}(_0x149f,0x1ca));var _0xf149=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x149f[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require(_0xf149('0x0'));var rimraf=require(_0xf149('0x1'));var zipdir=require(_0xf149('0x2'));var jsonpatch=require(_0xf149('0x3'));var rp=require(_0xf149('0x4'));var moment=require(_0xf149('0x5'));var BPromise=require(_0xf149('0x6'));var Mustache=require(_0xf149('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf149('0x8'));var csv=require('to-csv');var ejs=require(_0xf149('0x9'));var fs=require('fs');var fs_extra=require(_0xf149('0xa'));var _=require(_0xf149('0xb'));var squel=require(_0xf149('0xc'));var crypto=require(_0xf149('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf149('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf149('0xf'));var Papa=require(_0xf149('0x10'));var Redis=require('ioredis');var authService=require(_0xf149('0x11'));var qs=require(_0xf149('0x12'));var as=require(_0xf149('0x13'));var hardwareService=require(_0xf149('0x14'));var logger=require(_0xf149('0x15'))(_0xf149('0x16'));var utils=require(_0xf149('0x17'));var config=require(_0xf149('0x18'));var licenseUtil=require(_0xf149('0x19'));var db=require(_0xf149('0x1a'))['db'];function respondWithStatusCode(_0x2e3a49,_0x1387ce){_0x1387ce=_0x1387ce||0xcc;return function(_0x4cd848){if(_0x4cd848){return _0x2e3a49[_0xf149('0x1b')](_0x1387ce);}return _0x2e3a49[_0xf149('0x1c')](_0x1387ce)['end']();};}function respondWithResult(_0x1a43c9,_0x1816ab){_0x1816ab=_0x1816ab||0xc8;return function(_0x4ef640){if(_0x4ef640){return _0x1a43c9[_0xf149('0x1c')](_0x1816ab)['json'](_0x4ef640);}};}function respondWithFilteredResult(_0x3c0643,_0x4246a5){return function(_0x3c8e60){if(_0x3c8e60){var _0xf39ac6=typeof _0x4246a5[_0xf149('0x1d')]===_0xf149('0x1e')&&typeof _0x4246a5[_0xf149('0x1f')]==='undefined';var _0x441645=_0x3c8e60['count'];var _0x52db33=_0xf39ac6?0x0:_0x4246a5['offset'];var _0x290d52=_0xf39ac6?_0x3c8e60['count']:_0x4246a5['offset']+_0x4246a5[_0xf149('0x1f')];var _0x3f25b3;if(_0x290d52>=_0x441645){_0x290d52=_0x441645;_0x3f25b3=0xc8;}else{_0x3f25b3=0xce;}_0x3c0643[_0xf149('0x1c')](_0x3f25b3);return _0x3c0643[_0xf149('0x20')]('Content-Range',_0x52db33+'-'+_0x290d52+'/'+_0x441645)[_0xf149('0x21')](_0x3c8e60);}return null;};}function patchUpdates(_0x380d3c){return function(_0x3b1b9d){try{jsonpatch[_0xf149('0x22')](_0x3b1b9d,_0x380d3c,!![]);}catch(_0x262ebe){return BPromise[_0xf149('0x23')](_0x262ebe);}return _0x3b1b9d['save']();};}function saveUpdates(_0x32d2aa,_0x32a1f6){return function(_0x2ec479){if(_0x2ec479){return _0x2ec479[_0xf149('0x24')](_0x32d2aa)[_0xf149('0x25')](function(_0x5125a0){return _0x5125a0;});}return null;};}function removeEntity(_0x25d6c7,_0xaf95ea){return function(_0x41e626){if(_0x41e626){return _0x41e626[_0xf149('0x26')]()['then'](function(){var _0x4ac432=_0x41e626[_0xf149('0x27')]({'plain':!![]});var _0x32505b='Scheduler';return db[_0xf149('0x28')][_0xf149('0x26')]({'where':{'type':_0x32505b,'resourceId':_0x4ac432['id']}})[_0xf149('0x25')](function(){return _0x41e626;});})[_0xf149('0x25')](function(){_0x25d6c7['status'](0xcc)[_0xf149('0x29')]();});}};}function handleEntityNotFound(_0x52e7f2,_0x2d3414){return function(_0x3f9a38){if(!_0x3f9a38){_0x52e7f2[_0xf149('0x1b')](0x194);}return _0x3f9a38;};}function handleError(_0x17722b,_0x33e85c){_0x33e85c=_0x33e85c||0x1f4;return function(_0x5c6ba1){logger[_0xf149('0x2a')](_0x5c6ba1[_0xf149('0x2b')]);if(_0x5c6ba1[_0xf149('0x2c')]){delete _0x5c6ba1[_0xf149('0x2c')];}_0x17722b[_0xf149('0x1c')](_0x33e85c)['send'](_0x5c6ba1);};}exports[_0xf149('0x2d')]=function(_0x2f116a,_0xf76370){var _0x28b9aa={},_0x333fe1={},_0x4519db={'count':0x0,'rows':[]};var _0x564c80=_[_0xf149('0x2e')](db[_0xf149('0x2f')][_0xf149('0x30')],function(_0x413c5e){return{'name':_0x413c5e[_0xf149('0x31')],'type':_0x413c5e[_0xf149('0x32')][_0xf149('0x33')]};});_0x333fe1[_0xf149('0x34')]=_[_0xf149('0x2e')](_0x564c80,_0xf149('0x2c'));_0x333fe1['query']=_['keys'](_0x2f116a['query']);_0x333fe1[_0xf149('0x35')]=_[_0xf149('0x36')](_0x333fe1['model'],_0x333fe1[_0xf149('0x37')]);_0x28b9aa['attributes']=_[_0xf149('0x36')](_0x333fe1['model'],qs['fields'](_0x2f116a[_0xf149('0x37')][_0xf149('0x38')]));_0x28b9aa['attributes']=_0x28b9aa['attributes'][_0xf149('0x39')]?_0x28b9aa[_0xf149('0x3a')]:_0x333fe1[_0xf149('0x34')];if(!_0x2f116a['query'][_0xf149('0x3b')](_0xf149('0x3c'))){_0x28b9aa['limit']=qs[_0xf149('0x1f')](_0x2f116a['query'][_0xf149('0x1f')]);_0x28b9aa['offset']=qs[_0xf149('0x1d')](_0x2f116a['query'][_0xf149('0x1d')]);}_0x28b9aa[_0xf149('0x3d')]=qs[_0xf149('0x3e')](_0x2f116a[_0xf149('0x37')][_0xf149('0x3e')]);_0x28b9aa[_0xf149('0x3f')]=qs['filters'](_[_0xf149('0x40')](_0x2f116a[_0xf149('0x37')],_0x333fe1['filters']),_0x564c80);if(_0x2f116a[_0xf149('0x37')][_0xf149('0x41')]){_0x28b9aa[_0xf149('0x3f')]=_[_0xf149('0x42')](_0x28b9aa[_0xf149('0x3f')],{'$or':_[_0xf149('0x2e')](_0x564c80,function(_0x441aee){if(_0x441aee[_0xf149('0x32')]!==_0xf149('0x43')){var _0x2f7c45={};_0x2f7c45[_0x441aee[_0xf149('0x2c')]]={'$like':'%'+_0x2f116a[_0xf149('0x37')]['filter']+'%'};return _0x2f7c45;}})});}_0x28b9aa=_['merge']({},_0x28b9aa,_0x2f116a[_0xf149('0x44')]);var _0x407a12={'where':_0x28b9aa[_0xf149('0x3f')]};return db['Schedule'][_0xf149('0x45')](_0x407a12)[_0xf149('0x25')](function(_0x26ba89){_0x4519db[_0xf149('0x45')]=_0x26ba89;if(_0x2f116a[_0xf149('0x37')][_0xf149('0x46')]){_0x28b9aa[_0xf149('0x47')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x28b9aa);})[_0xf149('0x25')](function(_0x20bcd3){_0x4519db['rows']=_0x20bcd3;return _0x4519db;})[_0xf149('0x25')](respondWithFilteredResult(_0xf76370,_0x28b9aa))['catch'](handleError(_0xf76370,null));};exports[_0xf149('0x48')]=function(_0x21e246,_0x10958a){var _0x277b33={'raw':![],'where':{'id':_0x21e246['params']['id']}},_0x239897={};_0x239897[_0xf149('0x34')]=_[_0xf149('0x49')](db[_0xf149('0x2f')][_0xf149('0x30')]);_0x239897['query']=_[_0xf149('0x49')](_0x21e246[_0xf149('0x37')]);_0x239897['filters']=_[_0xf149('0x36')](_0x239897['model'],_0x239897['query']);_0x277b33[_0xf149('0x3a')]=_['intersection'](_0x239897['model'],qs[_0xf149('0x38')](_0x21e246[_0xf149('0x37')]['fields']));_0x277b33[_0xf149('0x3a')]=_0x277b33[_0xf149('0x3a')]['length']?_0x277b33[_0xf149('0x3a')]:_0x239897[_0xf149('0x34')];if(_0x21e246[_0xf149('0x37')][_0xf149('0x46')]){_0x277b33[_0xf149('0x47')]=[{'all':!![]}];}_0x277b33=_[_0xf149('0x42')]({},_0x277b33,_0x21e246['options']);return db[_0xf149('0x2f')][_0xf149('0x4a')](_0x277b33)[_0xf149('0x25')](handleEntityNotFound(_0x10958a,null))['then'](respondWithResult(_0x10958a,null))[_0xf149('0x4b')](handleError(_0x10958a,null));};exports['create']=function(_0x54601b,_0x59c0e0){return db[_0xf149('0x2f')][_0xf149('0x4c')](_0x54601b[_0xf149('0x4d')],{})[_0xf149('0x25')](function(_0x41167c){var _0x36cab4=_0x54601b['user']['get']({'plain':!![]});if(!_0x36cab4)throw new Error(_0xf149('0x4e'));if(_0x36cab4[_0xf149('0x4f')]===_0xf149('0x50')){var _0x176eb2=_0x41167c[_0xf149('0x27')]({'plain':!![]});var _0x53c9ac=_0xf149('0x51');return db[_0xf149('0x52')][_0xf149('0x4a')]({'where':{'name':_0x53c9ac,'userProfileId':_0x36cab4[_0xf149('0x53')]},'raw':!![]})['then'](function(_0x32889a){if(_0x32889a&&_0x32889a[_0xf149('0x54')]===0x0){return db[_0xf149('0x28')]['create']({'name':_0x176eb2[_0xf149('0x2c')],'resourceId':_0x176eb2['id'],'type':_0x32889a[_0xf149('0x2c')],'sectionId':_0x32889a['id']},{})['then'](function(){return _0x41167c;});}else{return _0x41167c;}})[_0xf149('0x4b')](function(_0x597449){logger[_0xf149('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x597449);throw _0x597449;});}return _0x41167c;})[_0xf149('0x25')](respondWithResult(_0x59c0e0,0xc9))[_0xf149('0x4b')](handleError(_0x59c0e0,null));};exports[_0xf149('0x24')]=function(_0x246bec,_0x1dae6d){if(_0x246bec[_0xf149('0x4d')]['id']){delete _0x246bec[_0xf149('0x4d')]['id'];}return db[_0xf149('0x2f')]['find']({'where':{'id':_0x246bec[_0xf149('0x55')]['id']}})['then'](handleEntityNotFound(_0x1dae6d,null))[_0xf149('0x25')](saveUpdates(_0x246bec[_0xf149('0x4d')],null))[_0xf149('0x25')](respondWithResult(_0x1dae6d,null))['catch'](handleError(_0x1dae6d,null));};exports[_0xf149('0x26')]=function(_0x4086bd,_0x5bb6dd){return db['Schedule'][_0xf149('0x4a')]({'where':{'id':_0x4086bd['params']['id']}})[_0xf149('0x25')](handleEntityNotFound(_0x5bb6dd,null))[_0xf149('0x25')](removeEntity(_0x5bb6dd,null))[_0xf149('0x4b')](handleError(_0x5bb6dd,null));};exports[_0xf149('0x56')]=function(_0x2d2dcb,_0x55bcbc,_0x325d75){var _0x2e55ba=require(_0xf149('0x57'));return db['Schedule'][_0xf149('0x4a')]({'where':{'id':_0x2d2dcb[_0xf149('0x55')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x55bcbc,null))['then'](function(){_0x2e55ba['run'](_0x2d2dcb[_0xf149('0x55')]['id']);})[_0xf149('0x25')](respondWithStatusCode(_0x55bcbc,null))[_0xf149('0x4b')](handleError(_0x55bcbc,null));}; \ No newline at end of file +var _0xc01b=['rawAttributes','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','VIRTUAL','filter','merge','Schedule','rows','catch','show','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','../../config/schedule','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xc01b,0xcc));var _0xbc01=function(_0x40a45a,_0x1c3551){_0x40a45a=_0x40a45a-0x0;var _0xdea9d8=_0xc01b[_0x40a45a];return _0xdea9d8;};'use strict';var emlformat=require(_0xbc01('0x0'));var rimraf=require(_0xbc01('0x1'));var zipdir=require(_0xbc01('0x2'));var jsonpatch=require(_0xbc01('0x3'));var rp=require(_0xbc01('0x4'));var moment=require('moment');var BPromise=require(_0xbc01('0x5'));var Mustache=require(_0xbc01('0x6'));var util=require('util');var path=require(_0xbc01('0x7'));var sox=require('sox');var csv=require(_0xbc01('0x8'));var ejs=require(_0xbc01('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc01('0xa'));var squel=require(_0xbc01('0xb'));var crypto=require('crypto');var jsforce=require(_0xbc01('0xc'));var deskjs=require(_0xbc01('0xd'));var toCsv=require(_0xbc01('0x8'));var querystring=require(_0xbc01('0xe'));var Papa=require(_0xbc01('0xf'));var Redis=require(_0xbc01('0x10'));var authService=require(_0xbc01('0x11'));var qs=require(_0xbc01('0x12'));var as=require(_0xbc01('0x13'));var hardwareService=require(_0xbc01('0x14'));var logger=require(_0xbc01('0x15'))(_0xbc01('0x16'));var utils=require('../../config/utils');var config=require(_0xbc01('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc01('0x18'))['db'];function respondWithStatusCode(_0x354819,_0x21f49f){_0x21f49f=_0x21f49f||0xcc;return function(_0x57402b){if(_0x57402b){return _0x354819['sendStatus'](_0x21f49f);}return _0x354819[_0xbc01('0x19')](_0x21f49f)[_0xbc01('0x1a')]();};}function respondWithResult(_0x41e799,_0x40b6c9){_0x40b6c9=_0x40b6c9||0xc8;return function(_0x1fd785){if(_0x1fd785){return _0x41e799[_0xbc01('0x19')](_0x40b6c9)[_0xbc01('0x1b')](_0x1fd785);}};}function respondWithFilteredResult(_0x1b2470,_0x1d959b){return function(_0x5962a9){if(_0x5962a9){var _0x5349d9=typeof _0x1d959b['offset']===_0xbc01('0x1c')&&typeof _0x1d959b[_0xbc01('0x1d')]===_0xbc01('0x1c');var _0x284138=_0x5962a9['count'];var _0x2d0b37=_0x5349d9?0x0:_0x1d959b[_0xbc01('0x1e')];var _0xaaa9ba=_0x5349d9?_0x5962a9[_0xbc01('0x1f')]:_0x1d959b['offset']+_0x1d959b[_0xbc01('0x1d')];var _0x27c264;if(_0xaaa9ba>=_0x284138){_0xaaa9ba=_0x284138;_0x27c264=0xc8;}else{_0x27c264=0xce;}_0x1b2470[_0xbc01('0x19')](_0x27c264);return _0x1b2470[_0xbc01('0x20')](_0xbc01('0x21'),_0x2d0b37+'-'+_0xaaa9ba+'/'+_0x284138)[_0xbc01('0x1b')](_0x5962a9);}return null;};}function patchUpdates(_0x413e91){return function(_0x1a29b2){try{jsonpatch[_0xbc01('0x22')](_0x1a29b2,_0x413e91,!![]);}catch(_0x21ff03){return BPromise[_0xbc01('0x23')](_0x21ff03);}return _0x1a29b2['save']();};}function saveUpdates(_0x4b0bfa,_0x2cd369){return function(_0x5b6d57){if(_0x5b6d57){return _0x5b6d57[_0xbc01('0x24')](_0x4b0bfa)[_0xbc01('0x25')](function(_0x41d0f5){return _0x41d0f5;});}return null;};}function removeEntity(_0x56832b,_0x1c0732){return function(_0x7da9c4){if(_0x7da9c4){return _0x7da9c4[_0xbc01('0x26')]()[_0xbc01('0x25')](function(){var _0x1c2aa0=_0x7da9c4[_0xbc01('0x27')]({'plain':!![]});var _0x21034f=_0xbc01('0x28');return db[_0xbc01('0x29')][_0xbc01('0x26')]({'where':{'type':_0x21034f,'resourceId':_0x1c2aa0['id']}})['then'](function(){return _0x7da9c4;});})[_0xbc01('0x25')](function(){_0x56832b[_0xbc01('0x19')](0xcc)[_0xbc01('0x1a')]();});}};}function handleEntityNotFound(_0x5c2c73,_0x692e21){return function(_0x1786ad){if(!_0x1786ad){_0x5c2c73[_0xbc01('0x2a')](0x194);}return _0x1786ad;};}function handleError(_0x4e0138,_0x24bb9f){_0x24bb9f=_0x24bb9f||0x1f4;return function(_0xb02c3c){logger[_0xbc01('0x2b')](_0xb02c3c[_0xbc01('0x2c')]);if(_0xb02c3c['name']){delete _0xb02c3c[_0xbc01('0x2d')];}_0x4e0138[_0xbc01('0x19')](_0x24bb9f)[_0xbc01('0x2e')](_0xb02c3c);};}exports[_0xbc01('0x2f')]=function(_0x28f0e7,_0x47ed9f){var _0x35659d={},_0x2fe832={},_0x550612={'count':0x0,'rows':[]};var _0x5f373b=_['map'](db['Schedule'][_0xbc01('0x30')],function(_0x226f64){return{'name':_0x226f64[_0xbc01('0x31')],'type':_0x226f64[_0xbc01('0x32')]['key']};});_0x2fe832[_0xbc01('0x33')]=_[_0xbc01('0x34')](_0x5f373b,_0xbc01('0x2d'));_0x2fe832['query']=_[_0xbc01('0x35')](_0x28f0e7[_0xbc01('0x36')]);_0x2fe832['filters']=_[_0xbc01('0x37')](_0x2fe832[_0xbc01('0x33')],_0x2fe832[_0xbc01('0x36')]);_0x35659d[_0xbc01('0x38')]=_[_0xbc01('0x37')](_0x2fe832[_0xbc01('0x33')],qs['fields'](_0x28f0e7['query'][_0xbc01('0x39')]));_0x35659d[_0xbc01('0x38')]=_0x35659d[_0xbc01('0x38')][_0xbc01('0x3a')]?_0x35659d['attributes']:_0x2fe832[_0xbc01('0x33')];if(!_0x28f0e7[_0xbc01('0x36')]['hasOwnProperty'](_0xbc01('0x3b'))){_0x35659d[_0xbc01('0x1d')]=qs[_0xbc01('0x1d')](_0x28f0e7[_0xbc01('0x36')]['limit']);_0x35659d[_0xbc01('0x1e')]=qs[_0xbc01('0x1e')](_0x28f0e7[_0xbc01('0x36')][_0xbc01('0x1e')]);}_0x35659d['order']=qs[_0xbc01('0x3c')](_0x28f0e7[_0xbc01('0x36')]['sort']);_0x35659d[_0xbc01('0x3d')]=qs[_0xbc01('0x3e')](_['pick'](_0x28f0e7[_0xbc01('0x36')],_0x2fe832[_0xbc01('0x3e')]),_0x5f373b);if(_0x28f0e7[_0xbc01('0x36')]['filter']){_0x35659d[_0xbc01('0x3d')]=_['merge'](_0x35659d[_0xbc01('0x3d')],{'$or':_[_0xbc01('0x34')](_0x5f373b,function(_0x53fb55){if(_0x53fb55[_0xbc01('0x32')]!==_0xbc01('0x3f')){var _0x244c70={};_0x244c70[_0x53fb55['name']]={'$like':'%'+_0x28f0e7[_0xbc01('0x36')][_0xbc01('0x40')]+'%'};return _0x244c70;}})});}_0x35659d=_[_0xbc01('0x41')]({},_0x35659d,_0x28f0e7['options']);var _0x165945={'where':_0x35659d[_0xbc01('0x3d')]};return db[_0xbc01('0x42')][_0xbc01('0x1f')](_0x165945)[_0xbc01('0x25')](function(_0x289b0d){_0x550612[_0xbc01('0x1f')]=_0x289b0d;if(_0x28f0e7[_0xbc01('0x36')]['includeAll']){_0x35659d['include']=[{'all':!![]}];}return db['Schedule']['findAll'](_0x35659d);})[_0xbc01('0x25')](function(_0x15da42){_0x550612[_0xbc01('0x43')]=_0x15da42;return _0x550612;})[_0xbc01('0x25')](respondWithFilteredResult(_0x47ed9f,_0x35659d))[_0xbc01('0x44')](handleError(_0x47ed9f,null));};exports[_0xbc01('0x45')]=function(_0x4a7604,_0x15deaa){var _0x444928={'raw':![],'where':{'id':_0x4a7604['params']['id']}},_0x3366a2={};_0x3366a2[_0xbc01('0x33')]=_[_0xbc01('0x35')](db[_0xbc01('0x42')][_0xbc01('0x30')]);_0x3366a2['query']=_['keys'](_0x4a7604[_0xbc01('0x36')]);_0x3366a2[_0xbc01('0x3e')]=_[_0xbc01('0x37')](_0x3366a2[_0xbc01('0x33')],_0x3366a2[_0xbc01('0x36')]);_0x444928[_0xbc01('0x38')]=_[_0xbc01('0x37')](_0x3366a2[_0xbc01('0x33')],qs[_0xbc01('0x39')](_0x4a7604[_0xbc01('0x36')][_0xbc01('0x39')]));_0x444928['attributes']=_0x444928[_0xbc01('0x38')]['length']?_0x444928[_0xbc01('0x38')]:_0x3366a2[_0xbc01('0x33')];if(_0x4a7604[_0xbc01('0x36')][_0xbc01('0x46')]){_0x444928['include']=[{'all':!![]}];}_0x444928=_[_0xbc01('0x41')]({},_0x444928,_0x4a7604[_0xbc01('0x47')]);return db[_0xbc01('0x42')][_0xbc01('0x48')](_0x444928)['then'](handleEntityNotFound(_0x15deaa,null))['then'](respondWithResult(_0x15deaa,null))[_0xbc01('0x44')](handleError(_0x15deaa,null));};exports[_0xbc01('0x49')]=function(_0x3bf33e,_0x2b580f){return db[_0xbc01('0x42')]['create'](_0x3bf33e[_0xbc01('0x4a')],{})['then'](function(_0x2b3bcf){var _0xe139ff=_0x3bf33e[_0xbc01('0x4b')][_0xbc01('0x27')]({'plain':!![]});if(!_0xe139ff)throw new Error(_0xbc01('0x4c'));if(_0xe139ff[_0xbc01('0x4d')]===_0xbc01('0x4b')){var _0x5014ff=_0x2b3bcf[_0xbc01('0x27')]({'plain':!![]});var _0x4158ac=_0xbc01('0x28');return db[_0xbc01('0x4e')][_0xbc01('0x48')]({'where':{'name':_0x4158ac,'userProfileId':_0xe139ff[_0xbc01('0x4f')]},'raw':!![]})['then'](function(_0x1e8a2c){if(_0x1e8a2c&&_0x1e8a2c[_0xbc01('0x50')]===0x0){return db[_0xbc01('0x29')][_0xbc01('0x49')]({'name':_0x5014ff[_0xbc01('0x2d')],'resourceId':_0x5014ff['id'],'type':_0x1e8a2c[_0xbc01('0x2d')],'sectionId':_0x1e8a2c['id']},{})['then'](function(){return _0x2b3bcf;});}else{return _0x2b3bcf;}})['catch'](function(_0x5af608){logger[_0xbc01('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5af608);throw _0x5af608;});}return _0x2b3bcf;})['then'](respondWithResult(_0x2b580f,0xc9))[_0xbc01('0x44')](handleError(_0x2b580f,null));};exports['update']=function(_0x3d5e1c,_0x1c4d0b){if(_0x3d5e1c[_0xbc01('0x4a')]['id']){delete _0x3d5e1c[_0xbc01('0x4a')]['id'];}return db[_0xbc01('0x42')]['find']({'where':{'id':_0x3d5e1c[_0xbc01('0x51')]['id']}})[_0xbc01('0x25')](handleEntityNotFound(_0x1c4d0b,null))['then'](saveUpdates(_0x3d5e1c['body'],null))[_0xbc01('0x25')](respondWithResult(_0x1c4d0b,null))[_0xbc01('0x44')](handleError(_0x1c4d0b,null));};exports['destroy']=function(_0x4bf1d3,_0x5195f8){return db[_0xbc01('0x42')][_0xbc01('0x48')]({'where':{'id':_0x4bf1d3['params']['id']}})['then'](handleEntityNotFound(_0x5195f8,null))[_0xbc01('0x25')](removeEntity(_0x5195f8,null))[_0xbc01('0x44')](handleError(_0x5195f8,null));};exports['run']=function(_0x6e4652,_0x481fde,_0x142b0f){var _0x236f7d=require(_0xbc01('0x52'));return db[_0xbc01('0x42')][_0xbc01('0x48')]({'where':{'id':_0x6e4652[_0xbc01('0x51')]['id']},'raw':!![]})[_0xbc01('0x25')](handleEntityNotFound(_0x481fde,null))['then'](function(){_0x236f7d[_0xbc01('0x53')](_0x6e4652['params']['id']);})['then'](respondWithStatusCode(_0x481fde,null))[_0xbc01('0x44')](handleError(_0x481fde,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index e77e469..1f58d86 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 _0xc4d2=['./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x4912ae,_0x440f23){var _0x42c612=function(_0x404249){while(--_0x404249){_0x4912ae['push'](_0x4912ae['shift']());}};_0x42c612(++_0x440f23);}(_0xc4d2,0x18b));var _0x2c4d=function(_0x377de1,_0x227dd2){_0x377de1=_0x377de1-0x0;var _0x4d5dd4=_0xc4d2[_0x377de1];return _0x4d5dd4;};'use strict';var _=require(_0x2c4d('0x0'));var util=require(_0x2c4d('0x1'));var logger=require(_0x2c4d('0x2'))(_0x2c4d('0x3'));var moment=require(_0x2c4d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c4d('0x5'));var rimraf=require(_0x2c4d('0x6'));var config=require(_0x2c4d('0x7'));var attributes=require(_0x2c4d('0x8'));module[_0x2c4d('0x9')]=function(_0x4f010a,_0x4780ae){return _0x4f010a[_0x2c4d('0xa')](_0x2c4d('0xb'),attributes,{'tableName':_0x2c4d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x756c=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules'];(function(_0x4cd297,_0x214715){var _0x1083f4=function(_0x1bc521){while(--_0x1bc521){_0x4cd297['push'](_0x4cd297['shift']());}};_0x1083f4(++_0x214715);}(_0x756c,0x1bc));var _0xc756=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x756c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc756('0x0'));var logger=require(_0xc756('0x1'))('api');var moment=require(_0xc756('0x2'));var BPromise=require('bluebird');var rp=require(_0xc756('0x3'));var fs=require('fs');var path=require(_0xc756('0x4'));var rimraf=require(_0xc756('0x5'));var config=require(_0xc756('0x6'));var attributes=require(_0xc756('0x7'));module[_0xc756('0x8')]=function(_0x53a134,_0xa0b1ba){return _0x53a134[_0xc756('0x9')](_0xc756('0xa'),attributes,{'tableName':_0xc756('0xb'),'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 99bb407..71f4952 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 _0x7f4b=['Schedule,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7f4b,0x165));var _0xb7f4=function(_0x281820,_0x47572b){_0x281820=_0x281820-0x0;var _0x2d05f6=_0x7f4b[_0x281820];return _0x2d05f6;};'use strict';var _=require(_0xb7f4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb7f4('0x1'));var fs=require('fs');var Redis=require(_0xb7f4('0x2'));var db=require(_0xb7f4('0x3'))['db'];var utils=require(_0xb7f4('0x4'));var logger=require(_0xb7f4('0x5'))(_0xb7f4('0x6'));var config=require(_0xb7f4('0x7'));var jayson=require(_0xb7f4('0x8'));var client=jayson[_0xb7f4('0x9')][_0xb7f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1104fb,_0x1c6187,_0x2fe69c){return new BPromise(function(_0x11f000,_0x4961af){return client[_0xb7f4('0xb')](_0x1104fb,_0x2fe69c)[_0xb7f4('0xc')](function(_0x4b43b9){logger[_0xb7f4('0xd')](_0xb7f4('0xe'),_0x1c6187,_0xb7f4('0xf'));logger[_0xb7f4('0x10')](_0xb7f4('0x11'),_0x1c6187,_0xb7f4('0xf'),JSON['stringify'](_0x4b43b9));if(_0x4b43b9[_0xb7f4('0x12')]){if(_0x4b43b9['error'][_0xb7f4('0x13')]===0x1f4){logger[_0xb7f4('0x12')](_0xb7f4('0xe'),_0x1c6187,_0x4b43b9[_0xb7f4('0x12')]['message']);return _0x4961af(_0x4b43b9[_0xb7f4('0x12')][_0xb7f4('0x14')]);}logger[_0xb7f4('0x12')]('Schedule,\x20%s,\x20%s',_0x1c6187,_0x4b43b9[_0xb7f4('0x12')][_0xb7f4('0x14')]);return _0x11f000(_0x4b43b9[_0xb7f4('0x12')]['message']);}else{logger[_0xb7f4('0xd')](_0xb7f4('0xe'),_0x1c6187,'request\x20sent');_0x11f000(_0x4b43b9['result'][_0xb7f4('0x14')]);}})[_0xb7f4('0x15')](function(_0x3d68bc){logger['error'](_0xb7f4('0xe'),_0x1c6187,_0x3d68bc);_0x4961af(_0x3d68bc);});});} \ No newline at end of file +var _0x8cda=['../../config/environment','jayson/promise','client','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x22aecc,_0x49e391){var _0x40ad56=function(_0x1f1542){while(--_0x1f1542){_0x22aecc['push'](_0x22aecc['shift']());}};_0x40ad56(++_0x49e391);}(_0x8cda,0xdd));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa8cd('0x0'));var util=require(_0xa8cd('0x1'));var moment=require('moment');var BPromise=require(_0xa8cd('0x2'));var rs=require(_0xa8cd('0x3'));var fs=require('fs');var Redis=require(_0xa8cd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8cd('0x5'));var logger=require(_0xa8cd('0x6'))('rpc');var config=require(_0xa8cd('0x7'));var jayson=require(_0xa8cd('0x8'));var client=jayson[_0xa8cd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bc4f5,_0x518571,_0x130c31){return new BPromise(function(_0x40160d,_0x20e4fb){return client[_0xa8cd('0xa')](_0x4bc4f5,_0x130c31)['then'](function(_0x244f15){logger[_0xa8cd('0xb')](_0xa8cd('0xc'),_0x518571,_0xa8cd('0xd'));logger[_0xa8cd('0xe')]('Schedule,\x20%s,\x20%s,\x20%s',_0x518571,_0xa8cd('0xd'),JSON['stringify'](_0x244f15));if(_0x244f15[_0xa8cd('0xf')]){if(_0x244f15[_0xa8cd('0xf')][_0xa8cd('0x10')]===0x1f4){logger[_0xa8cd('0xf')](_0xa8cd('0xc'),_0x518571,_0x244f15['error']['message']);return _0x20e4fb(_0x244f15[_0xa8cd('0xf')][_0xa8cd('0x11')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x518571,_0x244f15[_0xa8cd('0xf')]['message']);return _0x40160d(_0x244f15[_0xa8cd('0xf')][_0xa8cd('0x11')]);}else{logger[_0xa8cd('0xb')](_0xa8cd('0xc'),_0x518571,_0xa8cd('0xd'));_0x40160d(_0x244f15['result'][_0xa8cd('0x11')]);}})[_0xa8cd('0x12')](function(_0x455497){logger['error']('Schedule,\x20%s,\x20%s',_0x518571,_0x455497);_0x20e4fb(_0x455497);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 27fe477..f29878f 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 _0x38a5=['index','/describe','describe','/:id','show','/:id/download','post','create','put','destroy','multer','util','path','Router','./screenRecording.controller','get','isAuthenticated'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x38a5,0x12b));var _0x538a=function(_0x32afd4,_0x33a19){_0x32afd4=_0x32afd4-0x0;var _0x1dac0a=_0x38a5[_0x32afd4];return _0x1dac0a;};'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('express');var router=express[_0x538a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x538a('0x4'));router[_0x538a('0x5')]('/',auth[_0x538a('0x6')](),controller[_0x538a('0x7')]);router['get'](_0x538a('0x8'),auth[_0x538a('0x6')](),controller[_0x538a('0x9')]);router['get'](_0x538a('0xa'),auth[_0x538a('0x6')](),controller[_0x538a('0xb')]);router[_0x538a('0x5')](_0x538a('0xc'),auth['isAuthenticated'](),controller['download']);router[_0x538a('0xd')]('/',auth[_0x538a('0x6')](),controller[_0x538a('0xe')]);router[_0x538a('0xf')](_0x538a('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x538a('0xa'),auth[_0x538a('0x6')](),controller[_0x538a('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb2f3=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','get','/describe','describe','/:id','download','post','create','update'];(function(_0x131f4d,_0x934915){var _0x2a8bee=function(_0x416582){while(--_0x416582){_0x131f4d['push'](_0x131f4d['shift']());}};_0x2a8bee(++_0x934915);}(_0xb2f3,0x17e));var _0x3b2f=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xb2f3[_0x819464];return _0x49dcc0;};'use strict';var multer=require('multer');var util=require(_0x3b2f('0x0'));var path=require(_0x3b2f('0x1'));var timeout=require(_0x3b2f('0x2'));var express=require(_0x3b2f('0x3'));var router=express['Router']();var fs_extra=require(_0x3b2f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3b2f('0x5'));var config=require(_0x3b2f('0x6'));var controller=require(_0x3b2f('0x7'));router['get']('/',auth[_0x3b2f('0x8')](),controller['index']);router[_0x3b2f('0x9')](_0x3b2f('0xa'),auth[_0x3b2f('0x8')](),controller[_0x3b2f('0xb')]);router[_0x3b2f('0x9')](_0x3b2f('0xc'),auth[_0x3b2f('0x8')](),controller['show']);router[_0x3b2f('0x9')]('/:id/download',auth[_0x3b2f('0x8')](),controller[_0x3b2f('0xd')]);router[_0x3b2f('0xe')]('/',auth[_0x3b2f('0x8')](),controller[_0x3b2f('0xf')]);router['put'](_0x3b2f('0xc'),auth[_0x3b2f('0x8')](),controller[_0x3b2f('0x10')]);router['delete'](_0x3b2f('0xc'),auth[_0x3b2f('0x8')](),controller[_0x3b2f('0x11')]);module[_0x3b2f('0x12')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 5e68290..4ae72bd 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 _0xbdfb=['STRING','setDataValue','INTEGER','startedAt','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','DATE','createdAt','updatedAt','toString','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname'];(function(_0x408de5,_0x24fa7b){var _0x2015a1=function(_0x13082c){while(--_0x13082c){_0x408de5['push'](_0x408de5['shift']());}};_0x2015a1(++_0x24fa7b);}(_0xbdfb,0x1ef));var _0xbbdf=function(_0x30a528,_0x1d04f2){_0x30a528=_0x30a528-0x0;var _0x3e029c=_0xbdfb[_0x30a528];return _0x3e029c;};'use strict';var Sequelize=require(_0xbbdf('0x0'));var moment=require(_0xbbdf('0x1'));var path=require(_0xbbdf('0x2'));var config=require(_0xbbdf('0x3'));module[_0xbbdf('0x4')]={'format':{'type':Sequelize[_0xbbdf('0x5')],'get':function(){return this[_0xbbdf('0x6')](_0xbbdf('0x7'))?path[_0xbbdf('0x8')](this[_0xbbdf('0x6')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xbbdf('0x9')]},'channel':{'type':Sequelize[_0xbbdf('0x9')]},'value':{'type':Sequelize['STRING'],'set':function(_0x3c930d){var _0x17c835=_0x3c930d['replace'](/\\/g,'/');this[_0xbbdf('0xa')](_0xbbdf('0x7'),_0x17c835);}},'rating':{'type':Sequelize[_0xbbdf('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xbbdf('0xb')],'set':function(_0x4c1436){this[_0xbbdf('0xa')](_0xbbdf('0xc'),moment()['subtract'](_0x4c1436,'ms'));this[_0xbbdf('0xa')](_0xbbdf('0xd'),moment());this[_0xbbdf('0xa')](_0xbbdf('0xe'),_0x4c1436);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xbbdf('0x6')](_0xbbdf('0xc')))[_0xbbdf('0xf')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xbbdf('0xd')))[_0xbbdf('0xf')](_0xbbdf('0x10'))['toString']();}},'createdAt':{'type':Sequelize[_0xbbdf('0x11')],'get':function(){return moment(this[_0xbbdf('0x6')](_0xbbdf('0x12')))[_0xbbdf('0xf')](_0xbbdf('0x10'))['toString']();}},'updatedAt':{'type':Sequelize[_0xbbdf('0x11')],'get':function(){return moment(this[_0xbbdf('0x6')](_0xbbdf('0x13')))['format']('MM-DD-YYYY\x20HH:mm')[_0xbbdf('0x14')]();}}}; \ No newline at end of file +var _0x28f2=['MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format'];(function(_0x25cdb9,_0x4d338f){var _0x2ce804=function(_0xd1eb7e){while(--_0xd1eb7e){_0x25cdb9['push'](_0x25cdb9['shift']());}};_0x2ce804(++_0x4d338f);}(_0x28f2,0x193));var _0x228f=function(_0x361461,_0x4aa846){_0x361461=_0x361461-0x0;var _0xcbc5b9=_0x28f2[_0x361461];return _0xcbc5b9;};'use strict';var Sequelize=require(_0x228f('0x0'));var moment=require(_0x228f('0x1'));var path=require(_0x228f('0x2'));var config=require(_0x228f('0x3'));module[_0x228f('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x228f('0x5')](_0x228f('0x6'))?path[_0x228f('0x7')](this[_0x228f('0x5')](_0x228f('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x228f('0x8')]},'channel':{'type':Sequelize[_0x228f('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x10da58){var _0x4a4a44=_0x10da58[_0x228f('0x9')](/\\/g,'/');this[_0x228f('0xa')](_0x228f('0x6'),_0x4a4a44);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x228f('0xb')],'set':function(_0x4d0038){this[_0x228f('0xa')](_0x228f('0xc'),moment()['subtract'](_0x4d0038,'ms'));this[_0x228f('0xa')](_0x228f('0xd'),moment());this[_0x228f('0xa')](_0x228f('0xe'),_0x4d0038);}},'startedAt':{'type':Sequelize[_0x228f('0xf')],'get':function(){return moment(this['getDataValue'](_0x228f('0xc')))[_0x228f('0x10')](_0x228f('0x11'))[_0x228f('0x12')]();}},'closedAt':{'type':Sequelize[_0x228f('0xf')],'get':function(){return moment(this[_0x228f('0x5')](_0x228f('0xd')))[_0x228f('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x228f('0x12')]();}},'createdAt':{'type':Sequelize[_0x228f('0xf')],'get':function(){return moment(this[_0x228f('0x5')](_0x228f('0x13')))[_0x228f('0x10')](_0x228f('0x11'))[_0x228f('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x228f('0x5')]('updatedAt'))[_0x228f('0x10')](_0x228f('0x11'))[_0x228f('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 834eb7d..9fc823d 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 _0x4c4e=['findAll','rows','catch','params','keys','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','name','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include'];(function(_0x12d6c2,_0x409bc8){var _0x1c9825=function(_0x569f66){while(--_0x569f66){_0x12d6c2['push'](_0x12d6c2['shift']());}};_0x1c9825(++_0x409bc8);}(_0x4c4e,0x152));var _0xe4c4=function(_0x7c0968,_0x53e2c7){_0x7c0968=_0x7c0968-0x0;var _0x64d7c8=_0x4c4e[_0x7c0968];return _0x64d7c8;};'use strict';var emlformat=require(_0xe4c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4c4('0x1'));var jsonpatch=require(_0xe4c4('0x2'));var rp=require(_0xe4c4('0x3'));var moment=require('moment');var BPromise=require(_0xe4c4('0x4'));var Mustache=require(_0xe4c4('0x5'));var util=require(_0xe4c4('0x6'));var path=require('path');var sox=require(_0xe4c4('0x7'));var csv=require('to-csv');var ejs=require(_0xe4c4('0x8'));var fs=require('fs');var fs_extra=require(_0xe4c4('0x9'));var _=require(_0xe4c4('0xa'));var squel=require(_0xe4c4('0xb'));var crypto=require(_0xe4c4('0xc'));var jsforce=require(_0xe4c4('0xd'));var deskjs=require(_0xe4c4('0xe'));var toCsv=require(_0xe4c4('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4c4('0x10'));var authService=require(_0xe4c4('0x11'));var qs=require(_0xe4c4('0x12'));var as=require(_0xe4c4('0x13'));var hardwareService=require(_0xe4c4('0x14'));var logger=require(_0xe4c4('0x15'))('api');var utils=require(_0xe4c4('0x16'));var config=require(_0xe4c4('0x17'));var licenseUtil=require(_0xe4c4('0x18'));var db=require(_0xe4c4('0x19'))['db'];function respondWithStatusCode(_0x50bfab,_0x262083){_0x262083=_0x262083||0xcc;return function(_0x115802){if(_0x115802){return _0x50bfab['sendStatus'](_0x262083);}return _0x50bfab[_0xe4c4('0x1a')](_0x262083)[_0xe4c4('0x1b')]();};}function respondWithResult(_0x5aa89b,_0x42ce9e){_0x42ce9e=_0x42ce9e||0xc8;return function(_0x29766a){if(_0x29766a){return _0x5aa89b['status'](_0x42ce9e)[_0xe4c4('0x1c')](_0x29766a);}};}function respondWithFilteredResult(_0x465c9b,_0x26ea05){return function(_0x40a36e){if(_0x40a36e){var _0x19e59b=typeof _0x26ea05[_0xe4c4('0x1d')]===_0xe4c4('0x1e')&&typeof _0x26ea05[_0xe4c4('0x1f')]===_0xe4c4('0x1e');var _0x36b10c=_0x40a36e[_0xe4c4('0x20')];var _0x42242c=_0x19e59b?0x0:_0x26ea05[_0xe4c4('0x1d')];var _0x43a9ce=_0x19e59b?_0x40a36e[_0xe4c4('0x20')]:_0x26ea05['offset']+_0x26ea05[_0xe4c4('0x1f')];var _0x24f946;if(_0x43a9ce>=_0x36b10c){_0x43a9ce=_0x36b10c;_0x24f946=0xc8;}else{_0x24f946=0xce;}_0x465c9b[_0xe4c4('0x1a')](_0x24f946);return _0x465c9b[_0xe4c4('0x21')]('Content-Range',_0x42242c+'-'+_0x43a9ce+'/'+_0x36b10c)[_0xe4c4('0x1c')](_0x40a36e);}return null;};}function patchUpdates(_0x1cad5d){return function(_0x1727eb){try{jsonpatch[_0xe4c4('0x22')](_0x1727eb,_0x1cad5d,!![]);}catch(_0x2c5aea){return BPromise[_0xe4c4('0x23')](_0x2c5aea);}return _0x1727eb[_0xe4c4('0x24')]();};}function saveUpdates(_0x393c96,_0x21bbb1){return function(_0x1a7690){if(_0x1a7690){return _0x1a7690[_0xe4c4('0x25')](_0x393c96)[_0xe4c4('0x26')](function(_0x138ead){return _0x138ead;});}return null;};}function removeEntity(_0x1db719,_0x15873e){return function(_0x59498e){if(_0x59498e){return _0x59498e['destroy']()[_0xe4c4('0x26')](function(){_0x1db719['status'](0xcc)[_0xe4c4('0x1b')]();});}};}function handleEntityNotFound(_0x5374fd,_0x3adfcb){return function(_0x5efc4c){if(!_0x5efc4c){_0x5374fd[_0xe4c4('0x27')](0x194);}return _0x5efc4c;};}function handleError(_0x583393,_0xba53ef){_0xba53ef=_0xba53ef||0x1f4;return function(_0x4a0199){logger['error'](_0x4a0199['stack']);if(_0x4a0199['name']){delete _0x4a0199[_0xe4c4('0x28')];}_0x583393['status'](_0xba53ef)['send'](_0x4a0199);};}exports[_0xe4c4('0x29')]=function(_0x11deab,_0x4bb911){var _0x57ba43={},_0x7428ad={},_0x33de43={'count':0x0,'rows':[]};var _0x4aa6c1=_[_0xe4c4('0x2a')](db[_0xe4c4('0x2b')][_0xe4c4('0x2c')],function(_0x48060e){return{'name':_0x48060e['fieldName'],'type':_0x48060e[_0xe4c4('0x2d')][_0xe4c4('0x2e')]};});_0x7428ad[_0xe4c4('0x2f')]=_[_0xe4c4('0x30')](_['map'](_0x4aa6c1,'name'),[_0xe4c4('0x31')]);_0x7428ad[_0xe4c4('0x32')]=_['keys'](_0x11deab[_0xe4c4('0x32')]);_0x7428ad[_0xe4c4('0x33')]=_[_0xe4c4('0x34')](_0x7428ad['model'],_0x7428ad[_0xe4c4('0x32')]);_0x57ba43['attributes']=_[_0xe4c4('0x34')](_0x7428ad[_0xe4c4('0x2f')],qs[_0xe4c4('0x35')](_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x35')]));_0x57ba43[_0xe4c4('0x36')]=_0x57ba43[_0xe4c4('0x36')][_0xe4c4('0x37')]?_0x57ba43[_0xe4c4('0x36')]:_0x7428ad[_0xe4c4('0x2f')];if(!_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x38')]('nolimit')){_0x57ba43[_0xe4c4('0x1f')]=qs[_0xe4c4('0x1f')](_0x11deab[_0xe4c4('0x32')]['limit']);_0x57ba43[_0xe4c4('0x1d')]=qs[_0xe4c4('0x1d')](_0x11deab[_0xe4c4('0x32')]['offset']);}_0x57ba43[_0xe4c4('0x39')]=qs[_0xe4c4('0x3a')](_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x3a')]);_0x57ba43[_0xe4c4('0x3b')]=qs[_0xe4c4('0x33')](_[_0xe4c4('0x3c')](_0x11deab[_0xe4c4('0x32')],_0x7428ad[_0xe4c4('0x33')]),_0x4aa6c1);if(_0x11deab[_0xe4c4('0x32')]['filter']){_0x57ba43[_0xe4c4('0x3b')]=_[_0xe4c4('0x3d')](_0x57ba43[_0xe4c4('0x3b')],{'$or':_[_0xe4c4('0x2a')](_0x4aa6c1,function(_0x4c5551){if(_0x4c5551[_0xe4c4('0x2d')]!==_0xe4c4('0x3e')){var _0x4e6bd9={};_0x4e6bd9[_0x4c5551[_0xe4c4('0x28')]]={'$like':'%'+_0x11deab[_0xe4c4('0x32')]['filter']+'%'};return _0x4e6bd9;}})});}_0x57ba43=_[_0xe4c4('0x3d')]({},_0x57ba43,_0x11deab[_0xe4c4('0x3f')]);var _0x127bcd={'where':_0x57ba43[_0xe4c4('0x3b')]};return db[_0xe4c4('0x2b')][_0xe4c4('0x20')](_0x127bcd)[_0xe4c4('0x26')](function(_0x43201e){_0x33de43[_0xe4c4('0x20')]=_0x43201e;if(_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x40')]){_0x57ba43[_0xe4c4('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0xe4c4('0x42')](_0x57ba43);})[_0xe4c4('0x26')](function(_0x2b306d){_0x33de43[_0xe4c4('0x43')]=_0x2b306d;return _0x33de43;})[_0xe4c4('0x26')](respondWithFilteredResult(_0x4bb911,_0x57ba43))[_0xe4c4('0x44')](handleError(_0x4bb911,null));};exports['show']=function(_0x312a49,_0x526bef){var _0xca07dc={'raw':![],'where':{'id':_0x312a49[_0xe4c4('0x45')]['id']}},_0x3c067a={};_0x3c067a[_0xe4c4('0x2f')]=_[_0xe4c4('0x46')](db['ScreenRecording']['rawAttributes']);_0x3c067a[_0xe4c4('0x32')]=_[_0xe4c4('0x46')](_0x312a49[_0xe4c4('0x32')]);_0x3c067a['filters']=_[_0xe4c4('0x34')](_0x3c067a[_0xe4c4('0x2f')],_0x3c067a[_0xe4c4('0x32')]);_0xca07dc[_0xe4c4('0x36')]=_['intersection'](_0x3c067a[_0xe4c4('0x2f')],qs[_0xe4c4('0x35')](_0x312a49[_0xe4c4('0x32')][_0xe4c4('0x35')]));_0xca07dc[_0xe4c4('0x36')]=_0xca07dc[_0xe4c4('0x36')][_0xe4c4('0x37')]?_0xca07dc[_0xe4c4('0x36')]:_0x3c067a[_0xe4c4('0x2f')];if(_0x312a49['query'][_0xe4c4('0x40')]){_0xca07dc['include']=[{'all':!![]}];}_0xca07dc=_[_0xe4c4('0x3d')]({},_0xca07dc,_0x312a49[_0xe4c4('0x3f')]);return db[_0xe4c4('0x2b')][_0xe4c4('0x47')](_0xca07dc)[_0xe4c4('0x26')](handleEntityNotFound(_0x526bef,null))[_0xe4c4('0x26')](respondWithResult(_0x526bef,null))[_0xe4c4('0x44')](handleError(_0x526bef,null));};exports[_0xe4c4('0x48')]=function(_0x36f8ad,_0x18fb82){return db[_0xe4c4('0x2b')][_0xe4c4('0x48')](_0x36f8ad[_0xe4c4('0x49')],{})[_0xe4c4('0x26')](respondWithResult(_0x18fb82,0xc9))['catch'](handleError(_0x18fb82,null));};exports['update']=function(_0xe0e351,_0x198961){if(_0xe0e351['body']['id']){delete _0xe0e351[_0xe4c4('0x49')]['id'];}delete _0xe0e351[_0xe4c4('0x49')][_0xe4c4('0x4a')];delete _0xe0e351[_0xe4c4('0x49')][_0xe4c4('0x4b')];delete _0xe0e351['body'][_0xe4c4('0x4c')];delete _0xe0e351[_0xe4c4('0x49')]['value'];return db[_0xe4c4('0x2b')][_0xe4c4('0x47')]({'where':{'id':_0xe0e351['params']['id']}})[_0xe4c4('0x26')](handleEntityNotFound(_0x198961,null))['then'](saveUpdates(_0xe0e351[_0xe4c4('0x49')],null))[_0xe4c4('0x26')](respondWithResult(_0x198961,null))[_0xe4c4('0x44')](handleError(_0x198961,null));};exports[_0xe4c4('0x4d')]=function(_0x12eaed,_0x525534){return db[_0xe4c4('0x2b')][_0xe4c4('0x4d')]()[_0xe4c4('0x26')](respondWithResult(_0x525534,null))[_0xe4c4('0x44')](handleError(_0x525534,null));};exports[_0xe4c4('0x4e')]=function(_0x32a50e,_0x3ddcbe,_0x3aa205){var _0x1a96ba=require(_0xe4c4('0x4f'));var _0x1fe354=![];var _0x1940e3={};if(_0x32a50e[_0xe4c4('0x32')][_0xe4c4('0x2d')]&&_0x32a50e[_0xe4c4('0x32')][_0xe4c4('0x2d')]==='uniqueid'){_0x1940e3[_0xe4c4('0x50')]=_0x32a50e[_0xe4c4('0x45')]['id'];}else{_0x1940e3['id']=_0x32a50e[_0xe4c4('0x45')]['id'];}return db['ScreenRecording'][_0xe4c4('0x47')]({'where':_0x1940e3,'attributes':['id',_0xe4c4('0x51')],'raw':!![]})[_0xe4c4('0x26')](handleEntityNotFound(_0x3ddcbe,null))['then'](function(_0x45f959){if(_0x45f959){var _0x485c50=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x45f959['value']);var _0x479361=util[_0xe4c4('0x31')](_0xe4c4('0x55'),_0x485c50);if(fs[_0xe4c4('0x56')](_0x479361)){_0x1fe354=!![];return _0x1a96ba['decryptFile'](_0x479361,_0x485c50,config[_0xe4c4('0x57')]['recording'])['then'](function(){return _0x45f959;});}return _0x45f959;}})['then'](function(_0x4e08ec){if(_0x4e08ec){var _0x1ca931=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x4e08ec[_0xe4c4('0x51')]);if(!fs[_0xe4c4('0x56')](_0x1ca931)){throw new db['Sequelize'][(_0xe4c4('0x58'))](_0xe4c4('0x59'));}if(_0x4e08ec[_0xe4c4('0x5a')]){return _0x3ddcbe[_0xe4c4('0x4e')](_0x1ca931,_0x4e08ec[_0xe4c4('0x5a')]+path[_0xe4c4('0x5b')](_0x1ca931),function(){if(_0x1fe354){fs['unlink'](_0x1ca931);}});}else{return _0x3ddcbe['download'](_0x1ca931,function(_0x27599b){if(_0x1fe354){fs[_0xe4c4('0x5c')](_0x1ca931);}});}}})[_0xe4c4('0x44')](function(_0x3c8e44){if(_0x3c8e44[_0xe4c4('0x5d')]===_0xe4c4('0x59')){_0x3ddcbe[_0xe4c4('0x1a')](0x194)[_0xe4c4('0x5e')](_0xe4c4('0x5f'));}else{return handleError(_0x3ddcbe,null);}});};exports['destroy']=function(_0x59f033,_0x5a4138){return db['ScreenRecording'][_0xe4c4('0x47')]({'where':{'id':_0x59f033[_0xe4c4('0x45')]['id']}})[_0xe4c4('0x26')](function(_0x58f2dd){if(_[_0xe4c4('0x60')](_0x58f2dd)){throw new ReferenceError('Entity\x20not\x20found');}return _0x58f2dd;})[_0xe4c4('0x26')](function(_0x56ead3){var _0x5d6c0a=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x56ead3['value']);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x5d6c0a);if(!_[_0xe4c4('0x60')](_0x56ead3[_0xe4c4('0x51')])&&fs['existsSync'](_0x5d6c0a)){logger[_0xe4c4('0x61')](_0xe4c4('0x62')+_0x5d6c0a+_0xe4c4('0x63'));fs['unlinkSync'](_0x5d6c0a);}_0x5d6c0a=_0x5d6c0a+'.cypher';if(!_[_0xe4c4('0x60')](_0x56ead3[_0xe4c4('0x51')])&&fs[_0xe4c4('0x56')](_0x5d6c0a)){logger[_0xe4c4('0x61')](_0xe4c4('0x62')+_0x5d6c0a+_0xe4c4('0x63'));fs['unlinkSync'](_0x5d6c0a);}return _0x56ead3;})[_0xe4c4('0x26')](function(_0x1bddd5){if(!_0x1bddd5)throw new InternalError();return _0x1bddd5[_0xe4c4('0x64')]();})['then'](function(){_0x5a4138[_0xe4c4('0x1a')](0xcc)[_0xe4c4('0x1b')]();})[_0xe4c4('0x44')](handleError(_0x5a4138,null));}; \ No newline at end of file +var _0xb4c7=['rawAttributes','fieldName','type','format','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','params','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','root','ValidationError','download','filename','extname','unlink','message','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording'];(function(_0x34c0bf,_0x3b8460){var _0x315559=function(_0x42f409){while(--_0x42f409){_0x34c0bf['push'](_0x34c0bf['shift']());}};_0x315559(++_0x3b8460);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x5d4402,_0x80c04c){_0x5d4402=_0x5d4402-0x0;var _0xbaf5b2=_0xb4c7[_0x5d4402];return _0xbaf5b2;};'use strict';var emlformat=require(_0x7b4c('0x0'));var rimraf=require(_0x7b4c('0x1'));var zipdir=require(_0x7b4c('0x2'));var jsonpatch=require(_0x7b4c('0x3'));var rp=require(_0x7b4c('0x4'));var moment=require('moment');var BPromise=require(_0x7b4c('0x5'));var Mustache=require(_0x7b4c('0x6'));var util=require(_0x7b4c('0x7'));var path=require(_0x7b4c('0x8'));var sox=require(_0x7b4c('0x9'));var csv=require('to-csv');var ejs=require(_0x7b4c('0xa'));var fs=require('fs');var fs_extra=require(_0x7b4c('0xb'));var _=require(_0x7b4c('0xc'));var squel=require('squel');var crypto=require(_0x7b4c('0xd'));var jsforce=require(_0x7b4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7b4c('0xf'));var querystring=require(_0x7b4c('0x10'));var Papa=require(_0x7b4c('0x11'));var Redis=require(_0x7b4c('0x12'));var authService=require(_0x7b4c('0x13'));var qs=require(_0x7b4c('0x14'));var as=require(_0x7b4c('0x15'));var hardwareService=require(_0x7b4c('0x16'));var logger=require(_0x7b4c('0x17'))(_0x7b4c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b4c('0x19'));var db=require(_0x7b4c('0x1a'))['db'];function respondWithStatusCode(_0x38656b,_0x1722ad){_0x1722ad=_0x1722ad||0xcc;return function(_0x3e1558){if(_0x3e1558){return _0x38656b[_0x7b4c('0x1b')](_0x1722ad);}return _0x38656b[_0x7b4c('0x1c')](_0x1722ad)[_0x7b4c('0x1d')]();};}function respondWithResult(_0x25b90b,_0x387488){_0x387488=_0x387488||0xc8;return function(_0x593a19){if(_0x593a19){return _0x25b90b[_0x7b4c('0x1c')](_0x387488)[_0x7b4c('0x1e')](_0x593a19);}};}function respondWithFilteredResult(_0xdc71cd,_0x2a0e2f){return function(_0xa0a812){if(_0xa0a812){var _0x2471b3=typeof _0x2a0e2f[_0x7b4c('0x1f')]===_0x7b4c('0x20')&&typeof _0x2a0e2f['limit']===_0x7b4c('0x20');var _0xe71d88=_0xa0a812[_0x7b4c('0x21')];var _0x36c02a=_0x2471b3?0x0:_0x2a0e2f['offset'];var _0x3ce10c=_0x2471b3?_0xa0a812[_0x7b4c('0x21')]:_0x2a0e2f[_0x7b4c('0x1f')]+_0x2a0e2f[_0x7b4c('0x22')];var _0x2d4c72;if(_0x3ce10c>=_0xe71d88){_0x3ce10c=_0xe71d88;_0x2d4c72=0xc8;}else{_0x2d4c72=0xce;}_0xdc71cd[_0x7b4c('0x1c')](_0x2d4c72);return _0xdc71cd[_0x7b4c('0x23')](_0x7b4c('0x24'),_0x36c02a+'-'+_0x3ce10c+'/'+_0xe71d88)[_0x7b4c('0x1e')](_0xa0a812);}return null;};}function patchUpdates(_0x55e3df){return function(_0x1f06ec){try{jsonpatch[_0x7b4c('0x25')](_0x1f06ec,_0x55e3df,!![]);}catch(_0x11996d){return BPromise[_0x7b4c('0x26')](_0x11996d);}return _0x1f06ec[_0x7b4c('0x27')]();};}function saveUpdates(_0x168ac9,_0x176704){return function(_0x3d4826){if(_0x3d4826){return _0x3d4826[_0x7b4c('0x28')](_0x168ac9)[_0x7b4c('0x29')](function(_0x5eec1e){return _0x5eec1e;});}return null;};}function removeEntity(_0x45438c,_0x4350c9){return function(_0x276271){if(_0x276271){return _0x276271[_0x7b4c('0x2a')]()[_0x7b4c('0x29')](function(){_0x45438c[_0x7b4c('0x1c')](0xcc)[_0x7b4c('0x1d')]();});}};}function handleEntityNotFound(_0x459eb4,_0x1f311e){return function(_0x1a69db){if(!_0x1a69db){_0x459eb4[_0x7b4c('0x1b')](0x194);}return _0x1a69db;};}function handleError(_0x257da2,_0x316e5f){_0x316e5f=_0x316e5f||0x1f4;return function(_0x501f75){logger[_0x7b4c('0x2b')](_0x501f75[_0x7b4c('0x2c')]);if(_0x501f75[_0x7b4c('0x2d')]){delete _0x501f75[_0x7b4c('0x2d')];}_0x257da2[_0x7b4c('0x1c')](_0x316e5f)[_0x7b4c('0x2e')](_0x501f75);};}exports[_0x7b4c('0x2f')]=function(_0x2552f9,_0x3e4a46){var _0x9a799b={},_0x3585cd={},_0x130ace={'count':0x0,'rows':[]};var _0x3544bc=_[_0x7b4c('0x30')](db[_0x7b4c('0x31')][_0x7b4c('0x32')],function(_0x1d0724){return{'name':_0x1d0724[_0x7b4c('0x33')],'type':_0x1d0724[_0x7b4c('0x34')]['key']};});_0x3585cd['model']=_['differenceBy'](_[_0x7b4c('0x30')](_0x3544bc,_0x7b4c('0x2d')),[_0x7b4c('0x35')]);_0x3585cd[_0x7b4c('0x36')]=_['keys'](_0x2552f9[_0x7b4c('0x36')]);_0x3585cd[_0x7b4c('0x37')]=_['intersection'](_0x3585cd[_0x7b4c('0x38')],_0x3585cd['query']);_0x9a799b[_0x7b4c('0x39')]=_[_0x7b4c('0x3a')](_0x3585cd[_0x7b4c('0x38')],qs['fields'](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x3b')]));_0x9a799b['attributes']=_0x9a799b[_0x7b4c('0x39')][_0x7b4c('0x3c')]?_0x9a799b[_0x7b4c('0x39')]:_0x3585cd[_0x7b4c('0x38')];if(!_0x2552f9['query']['hasOwnProperty'](_0x7b4c('0x3d'))){_0x9a799b[_0x7b4c('0x22')]=qs['limit'](_0x2552f9[_0x7b4c('0x36')]['limit']);_0x9a799b['offset']=qs[_0x7b4c('0x1f')](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x1f')]);}_0x9a799b[_0x7b4c('0x3e')]=qs['sort'](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x3f')]);_0x9a799b[_0x7b4c('0x40')]=qs[_0x7b4c('0x37')](_[_0x7b4c('0x41')](_0x2552f9[_0x7b4c('0x36')],_0x3585cd[_0x7b4c('0x37')]),_0x3544bc);if(_0x2552f9['query']['filter']){_0x9a799b[_0x7b4c('0x40')]=_[_0x7b4c('0x42')](_0x9a799b[_0x7b4c('0x40')],{'$or':_[_0x7b4c('0x30')](_0x3544bc,function(_0xb8486d){if(_0xb8486d['type']!==_0x7b4c('0x43')){var _0x902367={};_0x902367[_0xb8486d[_0x7b4c('0x2d')]]={'$like':'%'+_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x44')]+'%'};return _0x902367;}})});}_0x9a799b=_[_0x7b4c('0x42')]({},_0x9a799b,_0x2552f9[_0x7b4c('0x45')]);var _0x1080fc={'where':_0x9a799b[_0x7b4c('0x40')]};return db['ScreenRecording'][_0x7b4c('0x21')](_0x1080fc)['then'](function(_0x2a3a74){_0x130ace['count']=_0x2a3a74;if(_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x46')]){_0x9a799b['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x7b4c('0x47')](_0x9a799b);})[_0x7b4c('0x29')](function(_0x1def44){_0x130ace[_0x7b4c('0x48')]=_0x1def44;return _0x130ace;})['then'](respondWithFilteredResult(_0x3e4a46,_0x9a799b))[_0x7b4c('0x49')](handleError(_0x3e4a46,null));};exports[_0x7b4c('0x4a')]=function(_0x100774,_0x5d4ed8){var _0x45ad59={'raw':![],'where':{'id':_0x100774['params']['id']}},_0x4b4757={};_0x4b4757[_0x7b4c('0x38')]=_['keys'](db[_0x7b4c('0x31')][_0x7b4c('0x32')]);_0x4b4757[_0x7b4c('0x36')]=_[_0x7b4c('0x4b')](_0x100774[_0x7b4c('0x36')]);_0x4b4757[_0x7b4c('0x37')]=_[_0x7b4c('0x3a')](_0x4b4757[_0x7b4c('0x38')],_0x4b4757[_0x7b4c('0x36')]);_0x45ad59['attributes']=_[_0x7b4c('0x3a')](_0x4b4757['model'],qs['fields'](_0x100774[_0x7b4c('0x36')][_0x7b4c('0x3b')]));_0x45ad59['attributes']=_0x45ad59['attributes'][_0x7b4c('0x3c')]?_0x45ad59[_0x7b4c('0x39')]:_0x4b4757[_0x7b4c('0x38')];if(_0x100774[_0x7b4c('0x36')][_0x7b4c('0x46')]){_0x45ad59[_0x7b4c('0x4c')]=[{'all':!![]}];}_0x45ad59=_[_0x7b4c('0x42')]({},_0x45ad59,_0x100774[_0x7b4c('0x45')]);return db['ScreenRecording'][_0x7b4c('0x4d')](_0x45ad59)[_0x7b4c('0x29')](handleEntityNotFound(_0x5d4ed8,null))[_0x7b4c('0x29')](respondWithResult(_0x5d4ed8,null))[_0x7b4c('0x49')](handleError(_0x5d4ed8,null));};exports[_0x7b4c('0x4e')]=function(_0x379f15,_0x11a6f9){return db[_0x7b4c('0x31')][_0x7b4c('0x4e')](_0x379f15['body'],{})['then'](respondWithResult(_0x11a6f9,0xc9))[_0x7b4c('0x49')](handleError(_0x11a6f9,null));};exports[_0x7b4c('0x28')]=function(_0x97eadf,_0x5d4192){if(_0x97eadf[_0x7b4c('0x4f')]['id']){delete _0x97eadf[_0x7b4c('0x4f')]['id'];}delete _0x97eadf['body'][_0x7b4c('0x50')];delete _0x97eadf['body'][_0x7b4c('0x51')];delete _0x97eadf['body'][_0x7b4c('0x52')];delete _0x97eadf['body'][_0x7b4c('0x53')];return db[_0x7b4c('0x31')]['find']({'where':{'id':_0x97eadf['params']['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x5d4192,null))[_0x7b4c('0x29')](saveUpdates(_0x97eadf[_0x7b4c('0x4f')],null))['then'](respondWithResult(_0x5d4192,null))['catch'](handleError(_0x5d4192,null));};exports[_0x7b4c('0x54')]=function(_0x1c118a,_0x4cbf1b){return db['ScreenRecording'][_0x7b4c('0x54')]()[_0x7b4c('0x29')](respondWithResult(_0x4cbf1b,null))[_0x7b4c('0x49')](handleError(_0x4cbf1b,null));};exports['download']=function(_0x1d017d,_0x2f009a,_0x4aaf57){var _0x484e80=require(_0x7b4c('0x55'));var _0x4d8491=![];var _0x59db20={};if(_0x1d017d[_0x7b4c('0x36')]['type']&&_0x1d017d['query'][_0x7b4c('0x34')]===_0x7b4c('0x56')){_0x59db20[_0x7b4c('0x56')]=_0x1d017d[_0x7b4c('0x57')]['id'];}else{_0x59db20['id']=_0x1d017d['params']['id'];}return db['ScreenRecording'][_0x7b4c('0x4d')]({'where':_0x59db20,'attributes':['id',_0x7b4c('0x53')],'raw':!![]})[_0x7b4c('0x29')](handleEntityNotFound(_0x2f009a,null))['then'](function(_0x255262){if(_0x255262){var _0x3d81fb=path[_0x7b4c('0x58')](config['root'],_0x7b4c('0x59'),_0x255262[_0x7b4c('0x53')]);var _0x529803=util[_0x7b4c('0x35')](_0x7b4c('0x5a'),_0x3d81fb);if(fs[_0x7b4c('0x5b')](_0x529803)){_0x4d8491=!![];return _0x484e80[_0x7b4c('0x5c')](_0x529803,_0x3d81fb,config[_0x7b4c('0x5d')][_0x7b4c('0x5e')])[_0x7b4c('0x29')](function(){return _0x255262;});}return _0x255262;}})['then'](function(_0x4443d0){if(_0x4443d0){var _0x2dc79a=path['join'](config[_0x7b4c('0x5f')],_0x7b4c('0x59'),_0x4443d0[_0x7b4c('0x53')]);if(!fs[_0x7b4c('0x5b')](_0x2dc79a)){throw new db['Sequelize'][(_0x7b4c('0x60'))]('ScreenRecording\x20not\x20found');}if(_0x4443d0['filename']){return _0x2f009a[_0x7b4c('0x61')](_0x2dc79a,_0x4443d0[_0x7b4c('0x62')]+path[_0x7b4c('0x63')](_0x2dc79a),function(){if(_0x4d8491){fs[_0x7b4c('0x64')](_0x2dc79a);}});}else{return _0x2f009a[_0x7b4c('0x61')](_0x2dc79a,function(_0x5b24f6){if(_0x4d8491){fs['unlink'](_0x2dc79a);}});}}})[_0x7b4c('0x49')](function(_0x3c84af){if(_0x3c84af[_0x7b4c('0x65')]==='ScreenRecording\x20not\x20found'){_0x2f009a[_0x7b4c('0x1c')](0x194)[_0x7b4c('0x2e')](_0x7b4c('0x66'));}else{return handleError(_0x2f009a,null);}});};exports['destroy']=function(_0x222b47,_0x3b2144){return db[_0x7b4c('0x31')]['find']({'where':{'id':_0x222b47[_0x7b4c('0x57')]['id']}})[_0x7b4c('0x29')](function(_0x4ac03e){if(_[_0x7b4c('0x67')](_0x4ac03e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4ac03e;})[_0x7b4c('0x29')](function(_0x11ae6e){var _0x3a3713=path['join'](config['root'],_0x7b4c('0x59'),_0x11ae6e[_0x7b4c('0x53')]);logger[_0x7b4c('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x3a3713);if(!_[_0x7b4c('0x67')](_0x11ae6e['value'])&&fs[_0x7b4c('0x5b')](_0x3a3713)){logger[_0x7b4c('0x68')](_0x7b4c('0x69')+_0x3a3713+_0x7b4c('0x6a'));fs[_0x7b4c('0x6b')](_0x3a3713);}_0x3a3713=_0x3a3713+'.cypher';if(!_[_0x7b4c('0x67')](_0x11ae6e[_0x7b4c('0x53')])&&fs['existsSync'](_0x3a3713)){logger[_0x7b4c('0x68')](_0x7b4c('0x69')+_0x3a3713+_0x7b4c('0x6a'));fs[_0x7b4c('0x6b')](_0x3a3713);}return _0x11ae6e;})[_0x7b4c('0x29')](function(_0x2befd7){if(!_0x2befd7)throw new InternalError();return _0x2befd7[_0x7b4c('0x2a')]();})[_0x7b4c('0x29')](function(){_0x3b2144['status'](0xcc)[_0x7b4c('0x1d')]();})[_0x7b4c('0x49')](handleError(_0x3b2144,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 00197a8..26367cc 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 _0x7b15=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','interactionid'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7b15,0x126));var _0x57b1=function(_0x2fd5b8,_0x42a599){_0x2fd5b8=_0x2fd5b8-0x0;var _0x53eada=_0x7b15[_0x2fd5b8];return _0x53eada;};'use strict';var _=require(_0x57b1('0x0'));var util=require(_0x57b1('0x1'));var logger=require(_0x57b1('0x2'))(_0x57b1('0x3'));var moment=require(_0x57b1('0x4'));var BPromise=require('bluebird');var rp=require(_0x57b1('0x5'));var fs=require('fs');var path=require(_0x57b1('0x6'));var rimraf=require(_0x57b1('0x7'));var config=require(_0x57b1('0x8'));var attributes=require(_0x57b1('0x9'));module[_0x57b1('0xa')]=function(_0x91b4d,_0x326f1e){return _0x91b4d[_0x57b1('0xb')](_0x57b1('0xc'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x57b1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x701f=['screen_recordings','interactionid','util','api','bluebird','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define'];(function(_0x141bea,_0x20296d){var _0x537d60=function(_0xd83039){while(--_0xd83039){_0x141bea['push'](_0x141bea['shift']());}};_0x537d60(++_0x20296d);}(_0x701f,0x1ba));var _0xf701=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x701f[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0xf701('0x0'));var logger=require('../../config/logger')(_0xf701('0x1'));var moment=require('moment');var BPromise=require(_0xf701('0x2'));var rp=require(_0xf701('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf701('0x4'));var config=require(_0xf701('0x5'));var attributes=require(_0xf701('0x6'));module[_0xf701('0x7')]=function(_0x5e835f,_0x293391){return _0x5e835f[_0xf701('0x8')]('ScreenRecording',attributes,{'tableName':_0xf701('0x9'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xf701('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 46bfc26..19325ba 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 _0x5a3f=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message'];(function(_0x29c722,_0x40b88f){var _0x22062b=function(_0x4b6de3){while(--_0x4b6de3){_0x29c722['push'](_0x29c722['shift']());}};_0x22062b(++_0x40b88f);}(_0x5a3f,0xe8));var _0xf5a3=function(_0x3435d5,_0x2ddea0){_0x3435d5=_0x3435d5-0x0;var _0xdd259=_0x5a3f[_0x3435d5];return _0xdd259;};'use strict';var _=require(_0xf5a3('0x0'));var util=require(_0xf5a3('0x1'));var moment=require(_0xf5a3('0x2'));var BPromise=require(_0xf5a3('0x3'));var rs=require(_0xf5a3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5a3('0x5'))['db'];var utils=require(_0xf5a3('0x6'));var logger=require(_0xf5a3('0x7'))('rpc');var config=require(_0xf5a3('0x8'));var jayson=require(_0xf5a3('0x9'));var client=jayson[_0xf5a3('0xa')][_0xf5a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bd923,_0x1f6124,_0x3b1f60){return new BPromise(function(_0x2d857b,_0x1b1501){return client[_0xf5a3('0xc')](_0x5bd923,_0x3b1f60)['then'](function(_0x2fb778){logger[_0xf5a3('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x1f6124,_0xf5a3('0xe'));logger[_0xf5a3('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x1f6124,_0xf5a3('0xe'),JSON[_0xf5a3('0x10')](_0x2fb778));if(_0x2fb778['error']){if(_0x2fb778[_0xf5a3('0x11')][_0xf5a3('0x12')]===0x1f4){logger[_0xf5a3('0x11')](_0xf5a3('0x13'),_0x1f6124,_0x2fb778[_0xf5a3('0x11')][_0xf5a3('0x14')]);return _0x1b1501(_0x2fb778[_0xf5a3('0x11')]['message']);}logger['error'](_0xf5a3('0x13'),_0x1f6124,_0x2fb778[_0xf5a3('0x11')][_0xf5a3('0x14')]);return _0x2d857b(_0x2fb778['error'][_0xf5a3('0x14')]);}else{logger[_0xf5a3('0xd')](_0xf5a3('0x13'),_0x1f6124,_0xf5a3('0xe'));_0x2d857b(_0x2fb778[_0xf5a3('0x15')][_0xf5a3('0x14')]);}})[_0xf5a3('0x16')](function(_0x3d2bee){logger[_0xf5a3('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x1f6124,_0x3d2bee);_0x1b1501(_0x3d2bee);});});} \ No newline at end of file +var _0x64b9=['util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','info','catch','lodash'];(function(_0x30ca6f,_0x1546db){var _0x3e8ba0=function(_0x4610a4){while(--_0x4610a4){_0x30ca6f['push'](_0x30ca6f['shift']());}};_0x3e8ba0(++_0x1546db);}(_0x64b9,0x1a1));var _0x964b=function(_0x5336e0,_0x4edcac){_0x5336e0=_0x5336e0-0x0;var _0x16439a=_0x64b9[_0x5336e0];return _0x16439a;};'use strict';var _=require(_0x964b('0x0'));var util=require(_0x964b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x964b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x964b('0x3'))['db'];var utils=require(_0x964b('0x4'));var logger=require(_0x964b('0x5'))(_0x964b('0x6'));var config=require(_0x964b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x964b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa44e28,_0x1cd357,_0x9aee50){return new BPromise(function(_0x115e2f,_0x296ae6){return client[_0x964b('0x9')](_0xa44e28,_0x9aee50)['then'](function(_0x26dc64){logger['info'](_0x964b('0xa'),_0x1cd357,_0x964b('0xb'));logger[_0x964b('0xc')](_0x964b('0xd'),_0x1cd357,_0x964b('0xb'),JSON['stringify'](_0x26dc64));if(_0x26dc64['error']){if(_0x26dc64['error'][_0x964b('0xe')]===0x1f4){logger['error'](_0x964b('0xa'),_0x1cd357,_0x26dc64[_0x964b('0xf')][_0x964b('0x10')]);return _0x296ae6(_0x26dc64[_0x964b('0xf')][_0x964b('0x10')]);}logger[_0x964b('0xf')](_0x964b('0xa'),_0x1cd357,_0x26dc64['error'][_0x964b('0x10')]);return _0x115e2f(_0x26dc64['error'][_0x964b('0x10')]);}else{logger[_0x964b('0x11')](_0x964b('0xa'),_0x1cd357,_0x964b('0xb'));_0x115e2f(_0x26dc64['result'][_0x964b('0x10')]);}})[_0x964b('0x12')](function(_0x26b941){logger[_0x964b('0xf')](_0x964b('0xa'),_0x1cd357,_0x26b941);_0x296ae6(_0x26b941);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 0a0a2d7..360d34b 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 _0x8e41=['/:id','/:id/logo','getLogoLogin','/:id/gdpr','gdpr','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','logo','originalname','post','single','addLogo','format','extname','/:id/logo_login','file','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','isAuthenticated','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./setting.controller','get','index','getDate'];(function(_0x275804,_0x1690bb){var _0x5cf3a4=function(_0x3765e3){while(--_0x3765e3){_0x275804['push'](_0x275804['shift']());}};_0x5cf3a4(++_0x1690bb);}(_0x8e41,0x1ec));var _0x18e4=function(_0x5c2cd5,_0x1c2fbb){_0x5c2cd5=_0x5c2cd5-0x0;var _0x5180e9=_0x8e41[_0x5c2cd5];return _0x5180e9;};'use strict';var multer=require(_0x18e4('0x0'));var util=require(_0x18e4('0x1'));var path=require(_0x18e4('0x2'));var timeout=require(_0x18e4('0x3'));var express=require(_0x18e4('0x4'));var router=express[_0x18e4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x18e4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x18e4('0x7'));var controller=require(_0x18e4('0x8'));router[_0x18e4('0x9')]('/',auth['isAuthenticated'](),controller[_0x18e4('0xa')]);router[_0x18e4('0x9')]('/now',controller[_0x18e4('0xb')]);router[_0x18e4('0x9')](_0x18e4('0xc'),controller['show']);router[_0x18e4('0x9')](_0x18e4('0xd'),controller['getLogo']);router[_0x18e4('0x9')]('/:id/logo_login',controller[_0x18e4('0xe')]);router['get'](_0x18e4('0xf'),controller[_0x18e4('0x10')]);router[_0x18e4('0x9')]('/:id/preferred',controller[_0x18e4('0x11')]);router['get']('/:id/favicon',controller[_0x18e4('0x12')]);var upload=multer({'storage':multer[_0x18e4('0x13')]({'destination':function(_0x217279,_0x2c4a58,_0x79cd11){_0x79cd11(null,path[_0x18e4('0x14')](config[_0x18e4('0x15')],_0x18e4('0x16')));},'filename':function(_0x42f073,_0x41b3b2,_0x4b4e60){_0x4b4e60(null,util['format'](_0x18e4('0x17'),_0x18e4('0x18'),path['extname'](_0x41b3b2[_0x18e4('0x19')])));}})});router[_0x18e4('0x1a')](_0x18e4('0xd'),upload[_0x18e4('0x1b')]('file'),controller[_0x18e4('0x1c')]);var upload=multer({'storage':multer[_0x18e4('0x13')]({'destination':function(_0x26149c,_0x22887d,_0xeed75e){_0xeed75e(null,path[_0x18e4('0x14')](config[_0x18e4('0x15')],_0x18e4('0x16')));},'filename':function(_0x51fc11,_0x16862f,_0x4a376f){_0x4a376f(null,util[_0x18e4('0x1d')](_0x18e4('0x17'),'logologin',path[_0x18e4('0x1e')](_0x16862f[_0x18e4('0x19')])));}})});router[_0x18e4('0x1a')](_0x18e4('0x1f'),upload[_0x18e4('0x1b')](_0x18e4('0x20')),controller[_0x18e4('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x957460,_0x12b398,_0x4bfcdf){_0x4bfcdf(null,path[_0x18e4('0x14')](config[_0x18e4('0x15')],_0x18e4('0x16')));},'filename':function(_0x80e5cc,_0x2e8169,_0x53288e){_0x53288e(null,util[_0x18e4('0x1d')](_0x18e4('0x17'),_0x18e4('0x22'),path[_0x18e4('0x1e')](_0x2e8169[_0x18e4('0x19')])));}})});router[_0x18e4('0x1a')](_0x18e4('0x23'),upload[_0x18e4('0x1b')](_0x18e4('0x20')),controller[_0x18e4('0x24')]);var upload=multer({'storage':multer[_0x18e4('0x13')]({'destination':function(_0x250515,_0x200ffe,_0x168f0f){_0x168f0f(null,path['join'](config['root'],_0x18e4('0x16')));},'filename':function(_0x161c34,_0x218b45,_0x5a10bf){_0x5a10bf(null,util[_0x18e4('0x1d')](_0x18e4('0x17'),_0x18e4('0x25'),path[_0x18e4('0x1e')](_0x218b45[_0x18e4('0x19')])));}})});router[_0x18e4('0x1a')]('/:id/favicon',upload[_0x18e4('0x1b')]('file'),controller[_0x18e4('0x26')]);router[_0x18e4('0x27')](_0x18e4('0xc'),auth[_0x18e4('0x28')](),controller[_0x18e4('0x29')]);module['exports']=router; \ No newline at end of file +var _0x1a08=['getPreferred','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','post','single','file','addLogo','logologin','originalname','/:id/logo_login','addLogoLogin','preferred','favicon','/:id/favicon','addFavicon','/:id','update','exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred'];(function(_0x597834,_0x159bb6){var _0x12da6c=function(_0x161c38){while(--_0x161c38){_0x597834['push'](_0x597834['shift']());}};_0x12da6c(++_0x159bb6);}(_0x1a08,0x6e));var _0x81a0=function(_0x5af59e,_0x3771c1){_0x5af59e=_0x5af59e-0x0;var _0x4240df=_0x1a08[_0x5af59e];return _0x4240df;};'use strict';var multer=require('multer');var util=require(_0x81a0('0x0'));var path=require(_0x81a0('0x1'));var timeout=require(_0x81a0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x81a0('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x81a0('0x4'));var config=require(_0x81a0('0x5'));var controller=require(_0x81a0('0x6'));router[_0x81a0('0x7')]('/',auth[_0x81a0('0x8')](),controller[_0x81a0('0x9')]);router[_0x81a0('0x7')](_0x81a0('0xa'),controller[_0x81a0('0xb')]);router[_0x81a0('0x7')]('/:id',controller[_0x81a0('0xc')]);router['get'](_0x81a0('0xd'),controller[_0x81a0('0xe')]);router[_0x81a0('0x7')]('/:id/logo_login',controller[_0x81a0('0xf')]);router[_0x81a0('0x7')](_0x81a0('0x10'),controller[_0x81a0('0x11')]);router[_0x81a0('0x7')](_0x81a0('0x12'),controller[_0x81a0('0x13')]);router[_0x81a0('0x7')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0x81a0('0x14')]({'destination':function(_0x21cdef,_0x2e53bf,_0x56c2a2){_0x56c2a2(null,path[_0x81a0('0x15')](config[_0x81a0('0x16')],_0x81a0('0x17')));},'filename':function(_0x358dd0,_0x51398a,_0x4db3c8){_0x4db3c8(null,util[_0x81a0('0x18')](_0x81a0('0x19'),_0x81a0('0x1a'),path[_0x81a0('0x1b')](_0x51398a['originalname'])));}})});router[_0x81a0('0x1c')](_0x81a0('0xd'),upload[_0x81a0('0x1d')](_0x81a0('0x1e')),controller[_0x81a0('0x1f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x517c4e,_0xe2ad98,_0x8e5403){_0x8e5403(null,path['join'](config[_0x81a0('0x16')],_0x81a0('0x17')));},'filename':function(_0x2339b9,_0xf3e120,_0x49612a){_0x49612a(null,util[_0x81a0('0x18')](_0x81a0('0x19'),_0x81a0('0x20'),path[_0x81a0('0x1b')](_0xf3e120[_0x81a0('0x21')])));}})});router[_0x81a0('0x1c')](_0x81a0('0x22'),upload[_0x81a0('0x1d')](_0x81a0('0x1e')),controller[_0x81a0('0x23')]);var upload=multer({'storage':multer[_0x81a0('0x14')]({'destination':function(_0x6ca0d1,_0x2320a8,_0x51fbf7){_0x51fbf7(null,path['join'](config[_0x81a0('0x16')],_0x81a0('0x17')));},'filename':function(_0xb0178d,_0x3a7c7c,_0x2b4c7a){_0x2b4c7a(null,util[_0x81a0('0x18')](_0x81a0('0x19'),_0x81a0('0x24'),path[_0x81a0('0x1b')](_0x3a7c7c[_0x81a0('0x21')])));}})});router[_0x81a0('0x1c')](_0x81a0('0x12'),upload[_0x81a0('0x1d')](_0x81a0('0x1e')),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x151c41,_0x445dba,_0x4b191b){_0x4b191b(null,path[_0x81a0('0x15')](config[_0x81a0('0x16')],_0x81a0('0x17')));},'filename':function(_0x1a6aed,_0x26dddc,_0x47ef39){_0x47ef39(null,util[_0x81a0('0x18')]('%s%s',_0x81a0('0x25'),path[_0x81a0('0x1b')](_0x26dddc[_0x81a0('0x21')])));}})});router[_0x81a0('0x1c')](_0x81a0('0x26'),upload[_0x81a0('0x1d')](_0x81a0('0x1e')),controller[_0x81a0('0x27')]);router['put'](_0x81a0('0x28'),auth[_0x81a0('0x8')](),controller[_0x81a0('0x29')]);module[_0x81a0('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 24443ea..4af38ba 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(_0x380b78,_0x22b7af){var _0x8bf673=function(_0x45c68d){while(--_0x45c68d){_0x380b78['push'](_0x380b78['shift']());}};_0x8bf673(++_0x22b7af);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x509af3,_0x3772c8){var _0x95f569=function(_0x276963){while(--_0x276963){_0x509af3['push'](_0x509af3['shift']());}};_0x95f569(++_0x3772c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 799050e..c10ba72 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 _0xa19c=['getLogoLogin','server/files/images/logos','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','defaultPreferred','default_preferred.png','ValidationError','getFavicon','default_favicon.ico','getDate','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Setting','includeAll','include','findAll','rows','catch','show','params','keys','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','download'];(function(_0x20aed7,_0x441459){var _0x4480ae=function(_0x3b6457){while(--_0x3b6457){_0x20aed7['push'](_0x20aed7['shift']());}};_0x4480ae(++_0x441459);}(_0xa19c,0x114));var _0xca19=function(_0x2ca50a,_0x5394d1){_0x2ca50a=_0x2ca50a-0x0;var _0xd0c2e0=_0xa19c[_0x2ca50a];return _0xd0c2e0;};'use strict';var emlformat=require(_0xca19('0x0'));var rimraf=require(_0xca19('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca19('0x2'));var rp=require(_0xca19('0x3'));var moment=require(_0xca19('0x4'));var BPromise=require(_0xca19('0x5'));var Mustache=require(_0xca19('0x6'));var util=require(_0xca19('0x7'));var path=require(_0xca19('0x8'));var sox=require(_0xca19('0x9'));var csv=require(_0xca19('0xa'));var ejs=require(_0xca19('0xb'));var fs=require('fs');var fs_extra=require(_0xca19('0xc'));var _=require(_0xca19('0xd'));var squel=require(_0xca19('0xe'));var crypto=require(_0xca19('0xf'));var jsforce=require(_0xca19('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xca19('0xa'));var querystring=require(_0xca19('0x11'));var Papa=require(_0xca19('0x12'));var Redis=require(_0xca19('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xca19('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca19('0x15'))(_0xca19('0x16'));var utils=require('../../config/utils');var config=require(_0xca19('0x17'));var licenseUtil=require(_0xca19('0x18'));var db=require(_0xca19('0x19'))['db'];var jayson=require(_0xca19('0x1a'));var client=jayson[_0xca19('0x1b')][_0xca19('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x26432b,_0x28f0b5,_0x102702,_0x147325){return new BPromise(function(_0x30b68c,_0x38b9b5){var _0x430eb2=_0x147325||client;return _0x430eb2[_0xca19('0x1d')](_0x26432b,_0x102702)[_0xca19('0x1e')](function(_0x40af66){logger[_0xca19('0x1f')](_0xca19('0x20'),_0x28f0b5,_0xca19('0x21'));logger[_0xca19('0x22')](_0xca19('0x23'),_0x28f0b5,_0xca19('0x21'),JSON['stringify'](_0x40af66));if(_0x40af66[_0xca19('0x24')]){if(_0x40af66['error'][_0xca19('0x25')]===0x1f4){logger[_0xca19('0x24')](_0xca19('0x20'),_0x28f0b5,_0x40af66[_0xca19('0x24')][_0xca19('0x26')]);return _0x38b9b5(_0x40af66[_0xca19('0x24')][_0xca19('0x26')]);}logger['error'](_0xca19('0x20'),_0x28f0b5,_0x40af66['error'][_0xca19('0x26')]);return _0x30b68c(_0x40af66[_0xca19('0x24')]['message']);}else{logger['info'](_0xca19('0x20'),_0x28f0b5,_0xca19('0x21'));_0x30b68c(_0x40af66[_0xca19('0x27')]['message']);}})['catch'](function(_0x42b647){logger[_0xca19('0x24')](_0xca19('0x20'),_0x28f0b5,_0x42b647);_0x38b9b5(_0x42b647);});});}function respondWithStatusCode(_0x23e656,_0x1f4284){_0x1f4284=_0x1f4284||0xcc;return function(_0x26c7f5){if(_0x26c7f5){return _0x23e656[_0xca19('0x28')](_0x1f4284);}return _0x23e656[_0xca19('0x29')](_0x1f4284)[_0xca19('0x2a')]();};}function respondWithResult(_0xe5dbd1,_0x70308b){_0x70308b=_0x70308b||0xc8;return function(_0x24ae9d){if(_0x24ae9d){return _0xe5dbd1['status'](_0x70308b)[_0xca19('0x2b')](_0x24ae9d);}};}function respondWithFilteredResult(_0x2723ec,_0x258dfd){return function(_0x118603){if(_0x118603){var _0x14b373=typeof _0x258dfd[_0xca19('0x2c')]===_0xca19('0x2d')&&typeof _0x258dfd[_0xca19('0x2e')]===_0xca19('0x2d');var _0x2481a0=_0x118603[_0xca19('0x2f')];var _0x450c2c=_0x14b373?0x0:_0x258dfd[_0xca19('0x2c')];var _0x4aa348=_0x14b373?_0x118603[_0xca19('0x2f')]:_0x258dfd[_0xca19('0x2c')]+_0x258dfd['limit'];var _0x4bfb10;if(_0x4aa348>=_0x2481a0){_0x4aa348=_0x2481a0;_0x4bfb10=0xc8;}else{_0x4bfb10=0xce;}_0x2723ec[_0xca19('0x29')](_0x4bfb10);return _0x2723ec[_0xca19('0x30')](_0xca19('0x31'),_0x450c2c+'-'+_0x4aa348+'/'+_0x2481a0)[_0xca19('0x2b')](_0x118603);}return null;};}function patchUpdates(_0x335b39){return function(_0x159f67){try{jsonpatch[_0xca19('0x32')](_0x159f67,_0x335b39,!![]);}catch(_0x4fef2a){return BPromise[_0xca19('0x33')](_0x4fef2a);}return _0x159f67[_0xca19('0x34')]();};}function saveUpdates(_0x3321a1,_0x20199f){return function(_0x33b1fb){if(_0x33b1fb){return _0x33b1fb[_0xca19('0x35')](_0x3321a1)[_0xca19('0x1e')](function(_0x215ce8){return _0x215ce8;});}return null;};}function removeEntity(_0x29efab,_0x25a67f){return function(_0x3c722e){if(_0x3c722e){return _0x3c722e[_0xca19('0x36')]()['then'](function(){_0x29efab[_0xca19('0x29')](0xcc)[_0xca19('0x2a')]();});}};}function handleEntityNotFound(_0x24fe07,_0x4b59c1){return function(_0x5cc966){if(!_0x5cc966){_0x24fe07['sendStatus'](0x194);}return _0x5cc966;};}function handleError(_0x5f550b,_0x441235){_0x441235=_0x441235||0x1f4;return function(_0x1d6c68){logger[_0xca19('0x24')](_0x1d6c68[_0xca19('0x37')]);if(_0x1d6c68[_0xca19('0x38')]){delete _0x1d6c68['name'];}_0x5f550b[_0xca19('0x29')](_0x441235)[_0xca19('0x39')](_0x1d6c68);};}exports[_0xca19('0x3a')]=function(_0x2141f3,_0x25a8c6){var _0xa9378e={},_0x3d4efe={},_0x5ce5aa={'count':0x0,'rows':[]};var _0x464796=_[_0xca19('0x3b')](db['Setting'][_0xca19('0x3c')],function(_0x5f0922){return{'name':_0x5f0922[_0xca19('0x3d')],'type':_0x5f0922[_0xca19('0x3e')]['key']};});_0x3d4efe[_0xca19('0x3f')]=_[_0xca19('0x3b')](_0x464796,_0xca19('0x38'));_0x3d4efe['query']=_['keys'](_0x2141f3[_0xca19('0x40')]);_0x3d4efe[_0xca19('0x41')]=_[_0xca19('0x42')](_0x3d4efe['model'],_0x3d4efe[_0xca19('0x40')]);_0xa9378e[_0xca19('0x43')]=_[_0xca19('0x42')](_0x3d4efe['model'],qs[_0xca19('0x44')](_0x2141f3[_0xca19('0x40')]['fields']));_0xa9378e[_0xca19('0x43')]=_0xa9378e[_0xca19('0x43')][_0xca19('0x45')]?_0xa9378e[_0xca19('0x43')]:_0x3d4efe[_0xca19('0x3f')];if(!_0x2141f3[_0xca19('0x40')][_0xca19('0x46')](_0xca19('0x47'))){_0xa9378e[_0xca19('0x2e')]=qs[_0xca19('0x2e')](_0x2141f3[_0xca19('0x40')][_0xca19('0x2e')]);_0xa9378e['offset']=qs[_0xca19('0x2c')](_0x2141f3['query'][_0xca19('0x2c')]);}_0xa9378e[_0xca19('0x48')]=qs[_0xca19('0x49')](_0x2141f3[_0xca19('0x40')]['sort']);_0xa9378e[_0xca19('0x4a')]=qs[_0xca19('0x41')](_[_0xca19('0x4b')](_0x2141f3[_0xca19('0x40')],_0x3d4efe[_0xca19('0x41')]),_0x464796);if(_0x2141f3['query'][_0xca19('0x4c')]){_0xa9378e[_0xca19('0x4a')]=_[_0xca19('0x4d')](_0xa9378e[_0xca19('0x4a')],{'$or':_['map'](_0x464796,function(_0x3f5d0f){if(_0x3f5d0f[_0xca19('0x3e')]!==_0xca19('0x4e')){var _0x46541e={};_0x46541e[_0x3f5d0f['name']]={'$like':'%'+_0x2141f3['query']['filter']+'%'};return _0x46541e;}})});}_0xa9378e=_['merge']({},_0xa9378e,_0x2141f3[_0xca19('0x4f')]);var _0x148451={'where':_0xa9378e[_0xca19('0x4a')]};return db[_0xca19('0x50')][_0xca19('0x2f')](_0x148451)[_0xca19('0x1e')](function(_0x287421){_0x5ce5aa[_0xca19('0x2f')]=_0x287421;if(_0x2141f3[_0xca19('0x40')][_0xca19('0x51')]){_0xa9378e[_0xca19('0x52')]=[{'all':!![]}];}return db[_0xca19('0x50')][_0xca19('0x53')](_0xa9378e);})[_0xca19('0x1e')](function(_0xd4c52a){_0x5ce5aa[_0xca19('0x54')]=_0xd4c52a;return _0x5ce5aa;})[_0xca19('0x1e')](respondWithFilteredResult(_0x25a8c6,_0xa9378e))[_0xca19('0x55')](handleError(_0x25a8c6,null));};exports[_0xca19('0x56')]=function(_0x316598,_0x2bd366){var _0xd90043={'raw':![],'where':{'id':_0x316598[_0xca19('0x57')]['id']}},_0x3e6c10={};_0x3e6c10['model']=_['keys'](db[_0xca19('0x50')]['rawAttributes']);_0x3e6c10[_0xca19('0x40')]=_[_0xca19('0x58')](_0x316598[_0xca19('0x40')]);_0x3e6c10[_0xca19('0x41')]=_[_0xca19('0x42')](_0x3e6c10['model'],_0x3e6c10[_0xca19('0x40')]);_0xd90043[_0xca19('0x43')]=_[_0xca19('0x42')](_0x3e6c10[_0xca19('0x3f')],qs[_0xca19('0x44')](_0x316598[_0xca19('0x40')][_0xca19('0x44')]));_0xd90043['attributes']=_0xd90043[_0xca19('0x43')][_0xca19('0x45')]?_0xd90043['attributes']:_0x3e6c10[_0xca19('0x3f')];if(_0x316598[_0xca19('0x40')][_0xca19('0x51')]){_0xd90043['include']=[{'all':!![]}];}_0xd90043=_[_0xca19('0x4d')]({},_0xd90043,_0x316598[_0xca19('0x4f')]);return db[_0xca19('0x50')][_0xca19('0x59')](_0xd90043)['then'](handleEntityNotFound(_0x2bd366,null))[_0xca19('0x1e')](respondWithResult(_0x2bd366,null))[_0xca19('0x55')](handleError(_0x2bd366,null));};exports[_0xca19('0x35')]=function(_0x4a3809,_0x1777e3){if(_0x4a3809[_0xca19('0x5a')]['id']){delete _0x4a3809[_0xca19('0x5a')]['id'];}return db['Setting'][_0xca19('0x59')]({'where':{'id':_0x4a3809[_0xca19('0x57')]['id']}})[_0xca19('0x1e')](handleEntityNotFound(_0x1777e3,null))[_0xca19('0x1e')](saveUpdates(_0x4a3809[_0xca19('0x5a')],null))[_0xca19('0x1e')](respondWithResult(_0x1777e3,null))['catch'](handleError(_0x1777e3,null));};exports[_0xca19('0x5b')]=function(_0x5e84d3,_0xe02010,_0x4d886a){if(_0x5e84d3[_0xca19('0x5c')]&&_0x5e84d3[_0xca19('0x5c')][_0xca19('0x5d')]){_0x5e84d3[_0xca19('0x5a')][_0xca19('0x5e')]=_0x5e84d3['file'][_0xca19('0x5d')];}return db[_0xca19('0x50')][_0xca19('0x59')]({'where':{'id':_0x5e84d3[_0xca19('0x57')]['id']}})['then'](handleEntityNotFound(_0xe02010,null))[_0xca19('0x1e')](saveUpdates(_0x5e84d3[_0xca19('0x5a')],null))[_0xca19('0x1e')](respondWithResult(_0xe02010,null))[_0xca19('0x55')](handleError(_0xe02010,null));};exports[_0xca19('0x5f')]=function(_0x3bd6ad,_0x440982,_0x5c3d3a){if(_0x3bd6ad[_0xca19('0x5c')]&&_0x3bd6ad['file'][_0xca19('0x5d')]){_0x3bd6ad[_0xca19('0x5a')][_0xca19('0x60')]=_0x3bd6ad['file']['filename'];}return db['Setting']['find']({'where':{'id':_0x3bd6ad[_0xca19('0x57')]['id']}})[_0xca19('0x1e')](handleEntityNotFound(_0x440982,null))[_0xca19('0x1e')](saveUpdates(_0x3bd6ad[_0xca19('0x5a')],null))[_0xca19('0x1e')](respondWithResult(_0x440982,null))[_0xca19('0x55')](handleError(_0x440982,null));};var utilLicense=require(_0xca19('0x18'));exports[_0xca19('0x61')]=function(_0x27cffd,_0x3c647a,_0x507cbf){var _0x470454='server/files/images/logos';var _0x3c28d3={'custom':![]};return utilLicense[_0xca19('0x62')]()[_0xca19('0x1e')](function(_0x4b0b54){if(_0x4b0b54){_0x3c28d3=_0x4b0b54;}return db['Setting'][_0xca19('0x59')]({'where':{'id':_0x27cffd[_0xca19('0x57')]['id']},'attributes':[_0xca19('0x5e'),_0xca19('0x60'),_0xca19('0x63'),_0xca19('0x64'),_0xca19('0x65'),_0xca19('0x66'),'defaultPreferred',_0xca19('0x67')],'raw':!![]});})['then'](handleEntityNotFound(_0x3c647a,null))[_0xca19('0x1e')](function(_0x5217d8){if(_0x5217d8){var _0x48cfcd=_0x5217d8[_0xca19('0x5e')]&&fs[_0xca19('0x68')](path[_0xca19('0x69')](config['root'],_0x470454,_[_0xca19('0x6a')](_0x5217d8[_0xca19('0x5e')])))?path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x470454,_['toLower'](_0x5217d8['logo'])):path['join'](config['root'],_0x470454,_[_0xca19('0x6a')](_0xca19('0x6c')));var _0x318a12=_0xca19('0x6d')+_[_0xca19('0x6e')](_0xca19('0x5e'));if(_0x5217d8[_0x318a12]||!_0x3c28d3[_0xca19('0x6f')]){_0x48cfcd=path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x470454,_['toLower'](_0xca19('0x6c')));}if(!fs[_0xca19('0x68')](_0x48cfcd)){throw new db[(_0xca19('0x70'))]['ValidationError'](_[_0xca19('0x6e')]('logo')+'\x20not\x20found');}return _0x3c647a[_0xca19('0x71')](_0x48cfcd);}})[_0xca19('0x55')](handleError(_0x3c647a,null));};var utilLicense=require(_0xca19('0x18'));exports[_0xca19('0x72')]=function(_0x5b3390,_0x4f8053,_0x32457e){var _0x5b625a=_0xca19('0x73');var _0x2051d4={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x3ef62d){if(_0x3ef62d){_0x2051d4=_0x3ef62d;}return db['Setting'][_0xca19('0x59')]({'where':{'id':_0x5b3390['params']['id']},'attributes':[_0xca19('0x5e'),_0xca19('0x60'),_0xca19('0x63'),_0xca19('0x64'),_0xca19('0x65'),_0xca19('0x66'),'defaultPreferred',_0xca19('0x67')],'raw':!![]});})['then'](handleEntityNotFound(_0x4f8053,null))[_0xca19('0x1e')](function(_0x44a9da){if(_0x44a9da){var _0x4e2e86=_0x44a9da[_0xca19('0x60')]&&fs[_0xca19('0x68')](path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x5b625a,_['toLower'](_0x44a9da['loginLogo'])))?path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x5b625a,_[_0xca19('0x6a')](_0x44a9da[_0xca19('0x60')])):path[_0xca19('0x69')](config['root'],_0x5b625a,_['toLower']('default_loginLogo.svg'));var _0x2076d5=_0xca19('0x6d')+_[_0xca19('0x6e')](_0xca19('0x60'));if(_0x44a9da[_0x2076d5]||!_0x2051d4[_0xca19('0x6f')]){_0x4e2e86=path['join'](config[_0xca19('0x6b')],_0x5b625a,_[_0xca19('0x6a')]('default_loginLogo.svg'));}if(!fs[_0xca19('0x68')](_0x4e2e86)){throw new db[(_0xca19('0x70'))]['ValidationError'](_[_0xca19('0x6e')](_0xca19('0x60'))+_0xca19('0x74'));}return _0x4f8053[_0xca19('0x71')](_0x4e2e86);}})['catch'](handleError(_0x4f8053,null));};exports[_0xca19('0x75')]=function(_0x2a6c94,_0x4eea6){return db[_0xca19('0x50')][_0xca19('0x59')]({'where':{'id':_0x2a6c94['params']['id']},'attributes':[_0xca19('0x76')]})[_0xca19('0x1e')](respondWithResult(_0x4eea6,null))['catch'](handleError(_0x4eea6,null));};exports[_0xca19('0x77')]=function(_0x3c3e80,_0x294d37,_0x241de6){if(_0x3c3e80[_0xca19('0x5c')]&&_0x3c3e80['file'][_0xca19('0x5d')]){_0x3c3e80[_0xca19('0x5a')][_0xca19('0x63')]=_0x3c3e80[_0xca19('0x5c')][_0xca19('0x5d')];}return db['Setting'][_0xca19('0x59')]({'where':{'id':_0x3c3e80[_0xca19('0x57')]['id']}})[_0xca19('0x1e')](handleEntityNotFound(_0x294d37,null))['then'](saveUpdates(_0x3c3e80[_0xca19('0x5a')],null))[_0xca19('0x1e')](respondWithResult(_0x294d37,null))[_0xca19('0x55')](handleError(_0x294d37,null));};var utilLicense=require('../../config/license/util');exports[_0xca19('0x78')]=function(_0x444c24,_0x4d9901,_0x167270){var _0x312dd0=_0xca19('0x73');var _0x23737c={'custom':![]};return utilLicense[_0xca19('0x62')]()[_0xca19('0x1e')](function(_0x5e3f7a){if(_0x5e3f7a){_0x23737c=_0x5e3f7a;}return db['Setting']['find']({'where':{'id':_0x444c24['params']['id']},'attributes':['logo',_0xca19('0x60'),_0xca19('0x63'),_0xca19('0x64'),_0xca19('0x65'),_0xca19('0x66'),_0xca19('0x79'),_0xca19('0x67')],'raw':!![]});})[_0xca19('0x1e')](handleEntityNotFound(_0x4d9901,null))['then'](function(_0xb7afed){if(_0xb7afed){var _0x58952c=_0xb7afed[_0xca19('0x63')]&&fs['existsSync'](path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x312dd0,_['toLower'](_0xb7afed['preferred'])))?path['join'](config[_0xca19('0x6b')],_0x312dd0,_[_0xca19('0x6a')](_0xb7afed[_0xca19('0x63')])):path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x312dd0,_[_0xca19('0x6a')](_0xca19('0x7a')));var _0x125405=_0xca19('0x6d')+_[_0xca19('0x6e')](_0xca19('0x63'));if(_0xb7afed[_0x125405]||!_0x23737c['custom']||!_0x23737c[_0xca19('0x63')]){_0x58952c=path[_0xca19('0x69')](config['root'],_0x312dd0,_[_0xca19('0x6a')](_0xca19('0x7a')));}if(!fs[_0xca19('0x68')](_0x58952c)){throw new db[(_0xca19('0x70'))][(_0xca19('0x7b'))](_[_0xca19('0x6e')](_0xca19('0x63'))+_0xca19('0x74'));}return _0x4d9901[_0xca19('0x71')](_0x58952c);}})['catch'](handleError(_0x4d9901,null));};exports['addFavicon']=function(_0xc95b75,_0x1fb819,_0x25aa20){if(_0xc95b75[_0xca19('0x5c')]&&_0xc95b75[_0xca19('0x5c')][_0xca19('0x5d')]){_0xc95b75[_0xca19('0x5a')]['favicon']=_0xc95b75['file'][_0xca19('0x5d')];}return db[_0xca19('0x50')][_0xca19('0x59')]({'where':{'id':_0xc95b75[_0xca19('0x57')]['id']}})[_0xca19('0x1e')](handleEntityNotFound(_0x1fb819,null))[_0xca19('0x1e')](saveUpdates(_0xc95b75[_0xca19('0x5a')],null))[_0xca19('0x1e')](respondWithResult(_0x1fb819,null))[_0xca19('0x55')](handleError(_0x1fb819,null));};var utilLicense=require(_0xca19('0x18'));exports[_0xca19('0x7c')]=function(_0x1e3b37,_0x13aaa4,_0x1e81d7){var _0x3d7326='server/files/images/logos';var _0x36c5de={'custom':![]};return utilLicense[_0xca19('0x62')]()[_0xca19('0x1e')](function(_0x395404){if(_0x395404){_0x36c5de=_0x395404;}return db[_0xca19('0x50')][_0xca19('0x59')]({'where':{'id':_0x1e3b37[_0xca19('0x57')]['id']},'attributes':['logo',_0xca19('0x60'),_0xca19('0x63'),_0xca19('0x64'),'defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xca19('0x1e')](handleEntityNotFound(_0x13aaa4,null))['then'](function(_0x42014d){if(_0x42014d){var _0xc5cd1a=_0x42014d[_0xca19('0x64')]&&fs[_0xca19('0x68')](path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x3d7326,_[_0xca19('0x6a')](_0x42014d[_0xca19('0x64')])))?path[_0xca19('0x69')](config[_0xca19('0x6b')],_0x3d7326,_[_0xca19('0x6a')](_0x42014d[_0xca19('0x64')])):path[_0xca19('0x69')](config['root'],_0x3d7326,_[_0xca19('0x6a')](_0xca19('0x7d')));var _0x258225='default'+_[_0xca19('0x6e')]('favicon');if(_0x42014d[_0x258225]||!_0x36c5de[_0xca19('0x6f')]){_0xc5cd1a=path['join'](config[_0xca19('0x6b')],_0x3d7326,_[_0xca19('0x6a')](_0xca19('0x7d')));}if(!fs['existsSync'](_0xc5cd1a)){throw new db['Sequelize'][(_0xca19('0x7b'))](_['upperFirst']('favicon')+'\x20not\x20found');}return _0x13aaa4[_0xca19('0x71')](_0xc5cd1a);}})['catch'](handleError(_0x13aaa4,null));};exports[_0xca19('0x7e')]=function(_0x5cd481,_0x17ef63){var _0x2824ab={'offset':moment()['utcOffset']()};_0x2824ab[_0xca19('0x7f')]=moment()['utcOffset'](_0x2824ab[_0xca19('0x2c')])[_0xca19('0x80')](_0xca19('0x81'));return _0x17ef63[_0xca19('0x29')](0xc8)['send'](_0x2824ab);}; \ No newline at end of file +var _0x3d9f=['then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','count','offset','set','apply','save','update','destroy','end','stack','name','send','map','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','include','rows','show','Setting','includeAll','options','body','find','params','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','download','getLogoLogin','defaultLogo','default','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','utcOffset','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','jayson/promise','client','http','request'];(function(_0x58eca9,_0x219608){var _0x25a12e=function(_0x1d3695){while(--_0x1d3695){_0x58eca9['push'](_0x58eca9['shift']());}};_0x25a12e(++_0x219608);}(_0x3d9f,0xd2));var _0xf3d9=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x3d9f[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require(_0xf3d9('0x0'));var rimraf=require(_0xf3d9('0x1'));var zipdir=require(_0xf3d9('0x2'));var jsonpatch=require(_0xf3d9('0x3'));var rp=require(_0xf3d9('0x4'));var moment=require(_0xf3d9('0x5'));var BPromise=require(_0xf3d9('0x6'));var Mustache=require(_0xf3d9('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf3d9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3d9('0x9'));var _=require(_0xf3d9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf3d9('0xb'));var deskjs=require(_0xf3d9('0xc'));var toCsv=require(_0xf3d9('0x8'));var querystring=require(_0xf3d9('0xd'));var Papa=require(_0xf3d9('0xe'));var Redis=require(_0xf3d9('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf3d9('0x10'));var hardwareService=require(_0xf3d9('0x11'));var logger=require(_0xf3d9('0x12'))(_0xf3d9('0x13'));var utils=require(_0xf3d9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf3d9('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf3d9('0x16'));var client=jayson[_0xf3d9('0x17')][_0xf3d9('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x5f13cd,_0x10fb3d,_0x23114c,_0x898431){return new BPromise(function(_0x15a74e,_0x55e310){var _0x686429=_0x898431||client;return _0x686429[_0xf3d9('0x19')](_0x5f13cd,_0x23114c)[_0xf3d9('0x1a')](function(_0x4a8e70){logger[_0xf3d9('0x1b')](_0xf3d9('0x1c'),_0x10fb3d,_0xf3d9('0x1d'));logger[_0xf3d9('0x1e')](_0xf3d9('0x1f'),_0x10fb3d,'request\x20sent',JSON[_0xf3d9('0x20')](_0x4a8e70));if(_0x4a8e70[_0xf3d9('0x21')]){if(_0x4a8e70[_0xf3d9('0x21')][_0xf3d9('0x22')]===0x1f4){logger[_0xf3d9('0x21')](_0xf3d9('0x1c'),_0x10fb3d,_0x4a8e70[_0xf3d9('0x21')][_0xf3d9('0x23')]);return _0x55e310(_0x4a8e70[_0xf3d9('0x21')][_0xf3d9('0x23')]);}logger[_0xf3d9('0x21')]('Setting,\x20%s,\x20%s',_0x10fb3d,_0x4a8e70['error'][_0xf3d9('0x23')]);return _0x15a74e(_0x4a8e70[_0xf3d9('0x21')][_0xf3d9('0x23')]);}else{logger[_0xf3d9('0x1b')](_0xf3d9('0x1c'),_0x10fb3d,_0xf3d9('0x1d'));_0x15a74e(_0x4a8e70[_0xf3d9('0x24')][_0xf3d9('0x23')]);}})[_0xf3d9('0x25')](function(_0x197cb2){logger[_0xf3d9('0x21')](_0xf3d9('0x1c'),_0x10fb3d,_0x197cb2);_0x55e310(_0x197cb2);});});}function respondWithStatusCode(_0x3aeec9,_0x5aecca){_0x5aecca=_0x5aecca||0xcc;return function(_0x168ca6){if(_0x168ca6){return _0x3aeec9[_0xf3d9('0x26')](_0x5aecca);}return _0x3aeec9[_0xf3d9('0x27')](_0x5aecca)['end']();};}function respondWithResult(_0x11c62a,_0x289d62){_0x289d62=_0x289d62||0xc8;return function(_0x26f206){if(_0x26f206){return _0x11c62a[_0xf3d9('0x27')](_0x289d62)[_0xf3d9('0x28')](_0x26f206);}};}function respondWithFilteredResult(_0x3e1c4d,_0x41a6ac){return function(_0x240c44){if(_0x240c44){var _0x46fb0=typeof _0x41a6ac['offset']===_0xf3d9('0x29')&&typeof _0x41a6ac['limit']===_0xf3d9('0x29');var _0x462ff9=_0x240c44[_0xf3d9('0x2a')];var _0x3d9c23=_0x46fb0?0x0:_0x41a6ac['offset'];var _0x1d51ce=_0x46fb0?_0x240c44[_0xf3d9('0x2a')]:_0x41a6ac[_0xf3d9('0x2b')]+_0x41a6ac['limit'];var _0x1d6080;if(_0x1d51ce>=_0x462ff9){_0x1d51ce=_0x462ff9;_0x1d6080=0xc8;}else{_0x1d6080=0xce;}_0x3e1c4d['status'](_0x1d6080);return _0x3e1c4d[_0xf3d9('0x2c')]('Content-Range',_0x3d9c23+'-'+_0x1d51ce+'/'+_0x462ff9)[_0xf3d9('0x28')](_0x240c44);}return null;};}function patchUpdates(_0x5c7025){return function(_0xeef377){try{jsonpatch[_0xf3d9('0x2d')](_0xeef377,_0x5c7025,!![]);}catch(_0x201dee){return BPromise['reject'](_0x201dee);}return _0xeef377[_0xf3d9('0x2e')]();};}function saveUpdates(_0x524da0,_0x295f3d){return function(_0x1d845c){if(_0x1d845c){return _0x1d845c[_0xf3d9('0x2f')](_0x524da0)[_0xf3d9('0x1a')](function(_0x115c53){return _0x115c53;});}return null;};}function removeEntity(_0x4189ef,_0x1a0860){return function(_0x1831f5){if(_0x1831f5){return _0x1831f5[_0xf3d9('0x30')]()[_0xf3d9('0x1a')](function(){_0x4189ef[_0xf3d9('0x27')](0xcc)[_0xf3d9('0x31')]();});}};}function handleEntityNotFound(_0xab0bd6,_0x5e844b){return function(_0x5802f6){if(!_0x5802f6){_0xab0bd6[_0xf3d9('0x26')](0x194);}return _0x5802f6;};}function handleError(_0x9e1e05,_0x6d116f){_0x6d116f=_0x6d116f||0x1f4;return function(_0x451fbd){logger[_0xf3d9('0x21')](_0x451fbd[_0xf3d9('0x32')]);if(_0x451fbd[_0xf3d9('0x33')]){delete _0x451fbd['name'];}_0x9e1e05[_0xf3d9('0x27')](_0x6d116f)[_0xf3d9('0x34')](_0x451fbd);};}exports['index']=function(_0x4232da,_0x5e2b98){var _0x25ef2d={},_0x164c27={},_0x20d723={'count':0x0,'rows':[]};var _0xe30c35=_[_0xf3d9('0x35')](db['Setting'][_0xf3d9('0x36')],function(_0x3e969e){return{'name':_0x3e969e[_0xf3d9('0x37')],'type':_0x3e969e[_0xf3d9('0x38')]['key']};});_0x164c27[_0xf3d9('0x39')]=_[_0xf3d9('0x35')](_0xe30c35,_0xf3d9('0x33'));_0x164c27[_0xf3d9('0x3a')]=_['keys'](_0x4232da[_0xf3d9('0x3a')]);_0x164c27['filters']=_[_0xf3d9('0x3b')](_0x164c27[_0xf3d9('0x39')],_0x164c27[_0xf3d9('0x3a')]);_0x25ef2d['attributes']=_['intersection'](_0x164c27[_0xf3d9('0x39')],qs[_0xf3d9('0x3c')](_0x4232da[_0xf3d9('0x3a')][_0xf3d9('0x3c')]));_0x25ef2d['attributes']=_0x25ef2d[_0xf3d9('0x3d')][_0xf3d9('0x3e')]?_0x25ef2d['attributes']:_0x164c27[_0xf3d9('0x39')];if(!_0x4232da[_0xf3d9('0x3a')]['hasOwnProperty'](_0xf3d9('0x3f'))){_0x25ef2d[_0xf3d9('0x40')]=qs[_0xf3d9('0x40')](_0x4232da[_0xf3d9('0x3a')]['limit']);_0x25ef2d[_0xf3d9('0x2b')]=qs['offset'](_0x4232da[_0xf3d9('0x3a')][_0xf3d9('0x2b')]);}_0x25ef2d[_0xf3d9('0x41')]=qs['sort'](_0x4232da[_0xf3d9('0x3a')][_0xf3d9('0x42')]);_0x25ef2d[_0xf3d9('0x43')]=qs[_0xf3d9('0x44')](_[_0xf3d9('0x45')](_0x4232da[_0xf3d9('0x3a')],_0x164c27[_0xf3d9('0x44')]),_0xe30c35);if(_0x4232da['query']['filter']){_0x25ef2d[_0xf3d9('0x43')]=_[_0xf3d9('0x46')](_0x25ef2d[_0xf3d9('0x43')],{'$or':_[_0xf3d9('0x35')](_0xe30c35,function(_0x111f6e){if(_0x111f6e['type']!==_0xf3d9('0x47')){var _0x54a8c2={};_0x54a8c2[_0x111f6e['name']]={'$like':'%'+_0x4232da[_0xf3d9('0x3a')][_0xf3d9('0x48')]+'%'};return _0x54a8c2;}})});}_0x25ef2d=_[_0xf3d9('0x46')]({},_0x25ef2d,_0x4232da['options']);var _0x14f84d={'where':_0x25ef2d[_0xf3d9('0x43')]};return db['Setting'][_0xf3d9('0x2a')](_0x14f84d)[_0xf3d9('0x1a')](function(_0x3a8baf){_0x20d723[_0xf3d9('0x2a')]=_0x3a8baf;if(_0x4232da[_0xf3d9('0x3a')]['includeAll']){_0x25ef2d[_0xf3d9('0x49')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x25ef2d);})[_0xf3d9('0x1a')](function(_0x735948){_0x20d723[_0xf3d9('0x4a')]=_0x735948;return _0x20d723;})[_0xf3d9('0x1a')](respondWithFilteredResult(_0x5e2b98,_0x25ef2d))['catch'](handleError(_0x5e2b98,null));};exports[_0xf3d9('0x4b')]=function(_0x13b354,_0x1f8ef0){var _0x3c9eea={'raw':![],'where':{'id':_0x13b354['params']['id']}},_0xb05455={};_0xb05455[_0xf3d9('0x39')]=_['keys'](db[_0xf3d9('0x4c')][_0xf3d9('0x36')]);_0xb05455[_0xf3d9('0x3a')]=_['keys'](_0x13b354[_0xf3d9('0x3a')]);_0xb05455[_0xf3d9('0x44')]=_[_0xf3d9('0x3b')](_0xb05455[_0xf3d9('0x39')],_0xb05455['query']);_0x3c9eea[_0xf3d9('0x3d')]=_[_0xf3d9('0x3b')](_0xb05455[_0xf3d9('0x39')],qs[_0xf3d9('0x3c')](_0x13b354[_0xf3d9('0x3a')][_0xf3d9('0x3c')]));_0x3c9eea['attributes']=_0x3c9eea[_0xf3d9('0x3d')][_0xf3d9('0x3e')]?_0x3c9eea[_0xf3d9('0x3d')]:_0xb05455[_0xf3d9('0x39')];if(_0x13b354['query'][_0xf3d9('0x4d')]){_0x3c9eea['include']=[{'all':!![]}];}_0x3c9eea=_[_0xf3d9('0x46')]({},_0x3c9eea,_0x13b354[_0xf3d9('0x4e')]);return db['Setting']['find'](_0x3c9eea)[_0xf3d9('0x1a')](handleEntityNotFound(_0x1f8ef0,null))['then'](respondWithResult(_0x1f8ef0,null))[_0xf3d9('0x25')](handleError(_0x1f8ef0,null));};exports['update']=function(_0x12bfcb,_0x1be037){if(_0x12bfcb[_0xf3d9('0x4f')]['id']){delete _0x12bfcb[_0xf3d9('0x4f')]['id'];}return db[_0xf3d9('0x4c')][_0xf3d9('0x50')]({'where':{'id':_0x12bfcb[_0xf3d9('0x51')]['id']}})[_0xf3d9('0x1a')](handleEntityNotFound(_0x1be037,null))[_0xf3d9('0x1a')](saveUpdates(_0x12bfcb[_0xf3d9('0x4f')],null))[_0xf3d9('0x1a')](respondWithResult(_0x1be037,null))[_0xf3d9('0x25')](handleError(_0x1be037,null));};exports[_0xf3d9('0x52')]=function(_0x4af31d,_0x249ff5,_0x46f2f8){if(_0x4af31d['file']&&_0x4af31d[_0xf3d9('0x53')][_0xf3d9('0x54')]){_0x4af31d[_0xf3d9('0x4f')]['logo']=_0x4af31d[_0xf3d9('0x53')][_0xf3d9('0x54')];}return db[_0xf3d9('0x4c')][_0xf3d9('0x50')]({'where':{'id':_0x4af31d['params']['id']}})[_0xf3d9('0x1a')](handleEntityNotFound(_0x249ff5,null))[_0xf3d9('0x1a')](saveUpdates(_0x4af31d[_0xf3d9('0x4f')],null))[_0xf3d9('0x1a')](respondWithResult(_0x249ff5,null))[_0xf3d9('0x25')](handleError(_0x249ff5,null));};exports[_0xf3d9('0x55')]=function(_0x25b9a9,_0xe4e2f5,_0x5dcb05){if(_0x25b9a9[_0xf3d9('0x53')]&&_0x25b9a9[_0xf3d9('0x53')][_0xf3d9('0x54')]){_0x25b9a9[_0xf3d9('0x4f')][_0xf3d9('0x56')]=_0x25b9a9[_0xf3d9('0x53')]['filename'];}return db['Setting']['find']({'where':{'id':_0x25b9a9[_0xf3d9('0x51')]['id']}})[_0xf3d9('0x1a')](handleEntityNotFound(_0xe4e2f5,null))['then'](saveUpdates(_0x25b9a9[_0xf3d9('0x4f')],null))[_0xf3d9('0x1a')](respondWithResult(_0xe4e2f5,null))[_0xf3d9('0x25')](handleError(_0xe4e2f5,null));};var utilLicense=require(_0xf3d9('0x15'));exports[_0xf3d9('0x57')]=function(_0x120f6c,_0x29b5e5,_0x203bb1){var _0x3a7308=_0xf3d9('0x58');var _0x3729d6={'custom':![]};return utilLicense[_0xf3d9('0x59')]()['then'](function(_0x131c38){if(_0x131c38){_0x3729d6=_0x131c38;}return db[_0xf3d9('0x4c')]['find']({'where':{'id':_0x120f6c[_0xf3d9('0x51')]['id']},'attributes':[_0xf3d9('0x5a'),_0xf3d9('0x56'),_0xf3d9('0x5b'),_0xf3d9('0x5c'),'defaultLogo',_0xf3d9('0x5d'),_0xf3d9('0x5e'),_0xf3d9('0x5f')],'raw':!![]});})[_0xf3d9('0x1a')](handleEntityNotFound(_0x29b5e5,null))['then'](function(_0x584db6){if(_0x584db6){var _0x11453d=_0x584db6[_0xf3d9('0x5a')]&&fs[_0xf3d9('0x60')](path[_0xf3d9('0x61')](config[_0xf3d9('0x62')],_0x3a7308,_[_0xf3d9('0x63')](_0x584db6[_0xf3d9('0x5a')])))?path[_0xf3d9('0x61')](config[_0xf3d9('0x62')],_0x3a7308,_[_0xf3d9('0x63')](_0x584db6[_0xf3d9('0x5a')])):path[_0xf3d9('0x61')](config[_0xf3d9('0x62')],_0x3a7308,_['toLower'](_0xf3d9('0x64')));var _0x3e0397='default'+_[_0xf3d9('0x65')](_0xf3d9('0x5a'));if(_0x584db6[_0x3e0397]||!_0x3729d6[_0xf3d9('0x66')]){_0x11453d=path['join'](config[_0xf3d9('0x62')],_0x3a7308,_[_0xf3d9('0x63')]('default_logo.svg'));}if(!fs[_0xf3d9('0x60')](_0x11453d)){throw new db[(_0xf3d9('0x67'))][(_0xf3d9('0x68'))](_[_0xf3d9('0x65')](_0xf3d9('0x5a'))+'\x20not\x20found');}return _0x29b5e5[_0xf3d9('0x69')](_0x11453d);}})[_0xf3d9('0x25')](handleError(_0x29b5e5,null));};var utilLicense=require('../../config/license/util');exports[_0xf3d9('0x6a')]=function(_0x4b17a8,_0x5dd6bc,_0x3526c9){var _0x5ea3cc=_0xf3d9('0x58');var _0xdf2a5d={'custom':![]};return utilLicense[_0xf3d9('0x59')]()[_0xf3d9('0x1a')](function(_0x621c58){if(_0x621c58){_0xdf2a5d=_0x621c58;}return db[_0xf3d9('0x4c')][_0xf3d9('0x50')]({'where':{'id':_0x4b17a8[_0xf3d9('0x51')]['id']},'attributes':[_0xf3d9('0x5a'),_0xf3d9('0x56'),_0xf3d9('0x5b'),_0xf3d9('0x5c'),_0xf3d9('0x6b'),'defaultLoginLogo',_0xf3d9('0x5e'),_0xf3d9('0x5f')],'raw':!![]});})[_0xf3d9('0x1a')](handleEntityNotFound(_0x5dd6bc,null))[_0xf3d9('0x1a')](function(_0x48dbab){if(_0x48dbab){var _0x12abf4=_0x48dbab[_0xf3d9('0x56')]&&fs['existsSync'](path[_0xf3d9('0x61')](config[_0xf3d9('0x62')],_0x5ea3cc,_['toLower'](_0x48dbab[_0xf3d9('0x56')])))?path[_0xf3d9('0x61')](config[_0xf3d9('0x62')],_0x5ea3cc,_[_0xf3d9('0x63')](_0x48dbab['loginLogo'])):path['join'](config['root'],_0x5ea3cc,_[_0xf3d9('0x63')]('default_loginLogo.svg'));var _0x5ac1f4=_0xf3d9('0x6c')+_[_0xf3d9('0x65')]('loginLogo');if(_0x48dbab[_0x5ac1f4]||!_0xdf2a5d['custom']){_0x12abf4=path[_0xf3d9('0x61')](config[_0xf3d9('0x62')],_0x5ea3cc,_['toLower']('default_loginLogo.svg'));}if(!fs[_0xf3d9('0x60')](_0x12abf4)){throw new db[(_0xf3d9('0x67'))][(_0xf3d9('0x68'))](_[_0xf3d9('0x65')](_0xf3d9('0x56'))+_0xf3d9('0x6d'));}return _0x5dd6bc[_0xf3d9('0x69')](_0x12abf4);}})[_0xf3d9('0x25')](handleError(_0x5dd6bc,null));};exports[_0xf3d9('0x6e')]=function(_0x141350,_0x2cb8bb){return db['Setting'][_0xf3d9('0x50')]({'where':{'id':_0x141350[_0xf3d9('0x51')]['id']},'attributes':[_0xf3d9('0x6f')]})[_0xf3d9('0x1a')](respondWithResult(_0x2cb8bb,null))[_0xf3d9('0x25')](handleError(_0x2cb8bb,null));};exports[_0xf3d9('0x70')]=function(_0x13ddb0,_0x3b9b1f,_0xe63c1e){if(_0x13ddb0['file']&&_0x13ddb0['file']['filename']){_0x13ddb0[_0xf3d9('0x4f')][_0xf3d9('0x5b')]=_0x13ddb0['file'][_0xf3d9('0x54')];}return db[_0xf3d9('0x4c')][_0xf3d9('0x50')]({'where':{'id':_0x13ddb0['params']['id']}})[_0xf3d9('0x1a')](handleEntityNotFound(_0x3b9b1f,null))[_0xf3d9('0x1a')](saveUpdates(_0x13ddb0[_0xf3d9('0x4f')],null))[_0xf3d9('0x1a')](respondWithResult(_0x3b9b1f,null))['catch'](handleError(_0x3b9b1f,null));};var utilLicense=require(_0xf3d9('0x15'));exports[_0xf3d9('0x71')]=function(_0x2d6dad,_0x965e88,_0x418f77){var _0x43663f=_0xf3d9('0x58');var _0x26f909={'custom':![]};return utilLicense['getLicense']()['then'](function(_0xa815fd){if(_0xa815fd){_0x26f909=_0xa815fd;}return db['Setting'][_0xf3d9('0x50')]({'where':{'id':_0x2d6dad[_0xf3d9('0x51')]['id']},'attributes':['logo','loginLogo',_0xf3d9('0x5b'),_0xf3d9('0x5c'),_0xf3d9('0x6b'),_0xf3d9('0x5d'),_0xf3d9('0x5e'),_0xf3d9('0x5f')],'raw':!![]});})[_0xf3d9('0x1a')](handleEntityNotFound(_0x965e88,null))[_0xf3d9('0x1a')](function(_0x59f4f6){if(_0x59f4f6){var _0x500d4a=_0x59f4f6[_0xf3d9('0x5b')]&&fs['existsSync'](path[_0xf3d9('0x61')](config[_0xf3d9('0x62')],_0x43663f,_[_0xf3d9('0x63')](_0x59f4f6[_0xf3d9('0x5b')])))?path[_0xf3d9('0x61')](config['root'],_0x43663f,_[_0xf3d9('0x63')](_0x59f4f6['preferred'])):path[_0xf3d9('0x61')](config[_0xf3d9('0x62')],_0x43663f,_[_0xf3d9('0x63')](_0xf3d9('0x72')));var _0x276bfb=_0xf3d9('0x6c')+_[_0xf3d9('0x65')](_0xf3d9('0x5b'));if(_0x59f4f6[_0x276bfb]||!_0x26f909[_0xf3d9('0x66')]||!_0x26f909[_0xf3d9('0x5b')]){_0x500d4a=path[_0xf3d9('0x61')](config[_0xf3d9('0x62')],_0x43663f,_[_0xf3d9('0x63')](_0xf3d9('0x72')));}if(!fs['existsSync'](_0x500d4a)){throw new db[(_0xf3d9('0x67'))][(_0xf3d9('0x68'))](_[_0xf3d9('0x65')](_0xf3d9('0x5b'))+_0xf3d9('0x6d'));}return _0x965e88[_0xf3d9('0x69')](_0x500d4a);}})[_0xf3d9('0x25')](handleError(_0x965e88,null));};exports[_0xf3d9('0x73')]=function(_0x239ba9,_0x17c01e,_0x5ed830){if(_0x239ba9[_0xf3d9('0x53')]&&_0x239ba9['file']['filename']){_0x239ba9[_0xf3d9('0x4f')][_0xf3d9('0x5c')]=_0x239ba9[_0xf3d9('0x53')]['filename'];}return db[_0xf3d9('0x4c')]['find']({'where':{'id':_0x239ba9['params']['id']}})[_0xf3d9('0x1a')](handleEntityNotFound(_0x17c01e,null))[_0xf3d9('0x1a')](saveUpdates(_0x239ba9[_0xf3d9('0x4f')],null))[_0xf3d9('0x1a')](respondWithResult(_0x17c01e,null))[_0xf3d9('0x25')](handleError(_0x17c01e,null));};var utilLicense=require(_0xf3d9('0x15'));exports['getFavicon']=function(_0x154b8b,_0x237615,_0x5e0e4f){var _0x1745a6=_0xf3d9('0x58');var _0xb828db={'custom':![]};return utilLicense[_0xf3d9('0x59')]()[_0xf3d9('0x1a')](function(_0x1e8c7e){if(_0x1e8c7e){_0xb828db=_0x1e8c7e;}return db['Setting'][_0xf3d9('0x50')]({'where':{'id':_0x154b8b[_0xf3d9('0x51')]['id']},'attributes':[_0xf3d9('0x5a'),_0xf3d9('0x56'),_0xf3d9('0x5b'),_0xf3d9('0x5c'),_0xf3d9('0x6b'),_0xf3d9('0x5d'),_0xf3d9('0x5e'),_0xf3d9('0x5f')],'raw':!![]});})[_0xf3d9('0x1a')](handleEntityNotFound(_0x237615,null))[_0xf3d9('0x1a')](function(_0x1929a1){if(_0x1929a1){var _0x3eb7c7=_0x1929a1[_0xf3d9('0x5c')]&&fs[_0xf3d9('0x60')](path[_0xf3d9('0x61')](config[_0xf3d9('0x62')],_0x1745a6,_[_0xf3d9('0x63')](_0x1929a1['favicon'])))?path['join'](config['root'],_0x1745a6,_[_0xf3d9('0x63')](_0x1929a1[_0xf3d9('0x5c')])):path[_0xf3d9('0x61')](config['root'],_0x1745a6,_[_0xf3d9('0x63')]('default_favicon.ico'));var _0x259d53='default'+_[_0xf3d9('0x65')]('favicon');if(_0x1929a1[_0x259d53]||!_0xb828db[_0xf3d9('0x66')]){_0x3eb7c7=path['join'](config[_0xf3d9('0x62')],_0x1745a6,_['toLower']('default_favicon.ico'));}if(!fs[_0xf3d9('0x60')](_0x3eb7c7)){throw new db['Sequelize'][(_0xf3d9('0x68'))](_['upperFirst']('favicon')+_0xf3d9('0x6d'));}return _0x237615[_0xf3d9('0x69')](_0x3eb7c7);}})[_0xf3d9('0x25')](handleError(_0x237615,null));};exports['getDate']=function(_0x5daa85,_0x478a7d){var _0xc0881={'offset':moment()['utcOffset']()};_0xc0881['now']=moment()[_0xf3d9('0x74')](_0xc0881[_0xf3d9('0x2b')])['format'](_0xf3d9('0x75'));return _0x478a7d['status'](0xc8)['send'](_0xc0881);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index e8d72a7..99c28cb 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x443587,_0x19facd){var _0x3e645c=function(_0x20d25f){while(--_0x20d25f){_0x443587['push'](_0x443587['shift']());}};_0x3e645c(++_0x19facd);}(_0xedd9,0xfc));var _0x9edd=function(_0xde9484,_0x5ba41d){_0xde9484=_0xde9484-0x0;var _0x3a20a9=_0xedd9[_0xde9484];return _0x3a20a9;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0x7217,0x19e));var _0x7721=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x7217[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 50c76a7..dfa77a8 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 _0xe6b0=['../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Setting','find','options','raw','where','attributes','include','map','model','ShowSetting','lodash','moment'];(function(_0x2264e1,_0x4c5c1c){var _0x508ab2=function(_0x2ed40f){while(--_0x2ed40f){_0x2264e1['push'](_0x2264e1['shift']());}};_0x508ab2(++_0x4c5c1c);}(_0xe6b0,0x1eb));var _0x0e6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0e6b('0x0'));var util=require('util');var moment=require(_0x0e6b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e6b('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0e6b('0x3'));var jayson=require(_0x0e6b('0x4'));var client=jayson[_0x0e6b('0x5')][_0x0e6b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4653e9,_0x53694b,_0x139c4c){return new BPromise(function(_0x250858,_0x4cef6e){return client[_0x0e6b('0x7')](_0x4653e9,_0x139c4c)[_0x0e6b('0x8')](function(_0x27325f){logger[_0x0e6b('0x9')](_0x0e6b('0xa'),_0x53694b,_0x0e6b('0xb'));logger[_0x0e6b('0xc')](_0x0e6b('0xd'),_0x53694b,_0x0e6b('0xb'),JSON[_0x0e6b('0xe')](_0x27325f));if(_0x27325f[_0x0e6b('0xf')]){if(_0x27325f[_0x0e6b('0xf')][_0x0e6b('0x10')]===0x1f4){logger['error'](_0x0e6b('0xa'),_0x53694b,_0x27325f[_0x0e6b('0xf')][_0x0e6b('0x11')]);return _0x4cef6e(_0x27325f['error'][_0x0e6b('0x11')]);}logger['error'](_0x0e6b('0xa'),_0x53694b,_0x27325f[_0x0e6b('0xf')][_0x0e6b('0x11')]);return _0x250858(_0x27325f[_0x0e6b('0xf')]['message']);}else{logger[_0x0e6b('0x9')](_0x0e6b('0xa'),_0x53694b,'request\x20sent');_0x250858(_0x27325f['result'][_0x0e6b('0x11')]);}})[_0x0e6b('0x12')](function(_0x9e8ca9){logger['error'](_0x0e6b('0xa'),_0x53694b,_0x9e8ca9);_0x4cef6e(_0x9e8ca9);});});}exports['ShowSetting']=function(_0x210a7e){var _0x5684ad=this;return new Promise(function(_0x5dd636,_0x36ec73){return db[_0x0e6b('0x13')][_0x0e6b('0x14')]({'raw':_0x210a7e['options']?_0x210a7e[_0x0e6b('0x15')][_0x0e6b('0x16')]===undefined?!![]:![]:!![],'where':_0x210a7e[_0x0e6b('0x15')]?_0x210a7e[_0x0e6b('0x15')][_0x0e6b('0x17')]||null:null,'attributes':_0x210a7e[_0x0e6b('0x15')]?_0x210a7e['options'][_0x0e6b('0x18')]||null:null,'include':_0x210a7e['options']?_0x210a7e[_0x0e6b('0x15')][_0x0e6b('0x19')]?_[_0x0e6b('0x1a')](_0x210a7e['options']['include'],function(_0x56066b){return{'model':db[_0x56066b['model']],'as':_0x56066b['as'],'attributes':_0x56066b[_0x0e6b('0x18')],'include':_0x56066b['include']?_[_0x0e6b('0x1a')](_0x56066b['include'],function(_0x1d5503){return{'model':db[_0x1d5503[_0x0e6b('0x1b')]],'as':_0x1d5503['as'],'attributes':_0x1d5503[_0x0e6b('0x18')],'include':_0x1d5503[_0x0e6b('0x19')]?_[_0x0e6b('0x1a')](_0x1d5503[_0x0e6b('0x19')],function(_0x1b7997){return{'model':db[_0x1b7997[_0x0e6b('0x1b')]],'as':_0x1b7997['as'],'attributes':_0x1b7997[_0x0e6b('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fd09f){logger[_0x0e6b('0x9')](_0x0e6b('0x1c'),_0x210a7e);logger[_0x0e6b('0xc')](_0x0e6b('0x1c'),_0x210a7e,JSON['stringify'](_0x1fd09f));_0x5dd636(_0x1fd09f);})['catch'](function(_0x215e15){logger[_0x0e6b('0xf')](_0x0e6b('0x1c'),_0x215e15[_0x0e6b('0x11')],_0x210a7e);_0x36ec73(_0x5684ad[_0x0e6b('0xf')](0x1f4,_0x215e15[_0x0e6b('0x11')]));});});}; \ No newline at end of file +var _0x6375=['options','where','attributes','map','model','include','stringify','ShowSetting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','find'];(function(_0xc51520,_0x3ea2c9){var _0x3f3282=function(_0x103827){while(--_0x103827){_0xc51520['push'](_0xc51520['shift']());}};_0x3f3282(++_0x3ea2c9);}(_0x6375,0xd4));var _0x5637=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0x6375[_0x30d87a];return _0x48f64b;};'use strict';var _=require(_0x5637('0x0'));var util=require(_0x5637('0x1'));var moment=require(_0x5637('0x2'));var BPromise=require(_0x5637('0x3'));var rs=require(_0x5637('0x4'));var fs=require('fs');var Redis=require(_0x5637('0x5'));var db=require(_0x5637('0x6'))['db'];var utils=require(_0x5637('0x7'));var logger=require(_0x5637('0x8'))(_0x5637('0x9'));var config=require(_0x5637('0xa'));var jayson=require(_0x5637('0xb'));var client=jayson['client'][_0x5637('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d78e0,_0x41c591,_0x3f1c68){return new BPromise(function(_0x1364df,_0x51f457){return client[_0x5637('0xd')](_0x4d78e0,_0x3f1c68)[_0x5637('0xe')](function(_0x52d03b){logger[_0x5637('0xf')](_0x5637('0x10'),_0x41c591,'request\x20sent');logger[_0x5637('0x11')](_0x5637('0x12'),_0x41c591,_0x5637('0x13'),JSON['stringify'](_0x52d03b));if(_0x52d03b['error']){if(_0x52d03b[_0x5637('0x14')][_0x5637('0x15')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x41c591,_0x52d03b[_0x5637('0x14')][_0x5637('0x16')]);return _0x51f457(_0x52d03b[_0x5637('0x14')][_0x5637('0x16')]);}logger[_0x5637('0x14')](_0x5637('0x10'),_0x41c591,_0x52d03b[_0x5637('0x14')][_0x5637('0x16')]);return _0x1364df(_0x52d03b['error'][_0x5637('0x16')]);}else{logger[_0x5637('0xf')](_0x5637('0x10'),_0x41c591,_0x5637('0x13'));_0x1364df(_0x52d03b[_0x5637('0x17')][_0x5637('0x16')]);}})[_0x5637('0x18')](function(_0x182af8){logger[_0x5637('0x14')]('Setting,\x20%s,\x20%s',_0x41c591,_0x182af8);_0x51f457(_0x182af8);});});}exports['ShowSetting']=function(_0x2c33b1){var _0x362e96=this;return new Promise(function(_0x56ae44,_0x36f550){return db['Setting'][_0x5637('0x19')]({'raw':_0x2c33b1[_0x5637('0x1a')]?_0x2c33b1[_0x5637('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2c33b1[_0x5637('0x1a')]?_0x2c33b1['options'][_0x5637('0x1b')]||null:null,'attributes':_0x2c33b1[_0x5637('0x1a')]?_0x2c33b1['options'][_0x5637('0x1c')]||null:null,'include':_0x2c33b1['options']?_0x2c33b1[_0x5637('0x1a')]['include']?_[_0x5637('0x1d')](_0x2c33b1[_0x5637('0x1a')]['include'],function(_0x476c20){return{'model':db[_0x476c20[_0x5637('0x1e')]],'as':_0x476c20['as'],'attributes':_0x476c20['attributes'],'include':_0x476c20[_0x5637('0x1f')]?_['map'](_0x476c20[_0x5637('0x1f')],function(_0x24d577){return{'model':db[_0x24d577[_0x5637('0x1e')]],'as':_0x24d577['as'],'attributes':_0x24d577[_0x5637('0x1c')],'include':_0x24d577[_0x5637('0x1f')]?_[_0x5637('0x1d')](_0x24d577['include'],function(_0x48cb27){return{'model':db[_0x48cb27[_0x5637('0x1e')]],'as':_0x48cb27['as'],'attributes':_0x48cb27['attributes']};}):[]};}):[]};}):[]:[]})[_0x5637('0xe')](function(_0x5681ed){logger[_0x5637('0xf')]('ShowSetting',_0x2c33b1);logger[_0x5637('0x11')]('ShowSetting',_0x2c33b1,JSON[_0x5637('0x20')](_0x5681ed));_0x56ae44(_0x5681ed);})[_0x5637('0x18')](function(_0x11f463){logger[_0x5637('0x14')](_0x5637('0x21'),_0x11f463[_0x5637('0x16')],_0x2c33b1);_0x36f550(_0x362e96[_0x5637('0x14')](0x1f4,_0x11f463[_0x5637('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index b5d9a5f..7512113 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 _0x326f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/status','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0x495984,_0x20ff45){var _0x93c24c=function(_0x48015b){while(--_0x48015b){_0x495984['push'](_0x495984['shift']());}};_0x93c24c(++_0x20ff45);}(_0x326f,0xd1));var _0xf326=function(_0x4ee639,_0xc1fd7a){_0x4ee639=_0x4ee639-0x0;var _0x1c7c33=_0x326f[_0x4ee639];return _0x1c7c33;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['get'](_0xf326('0x12'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x9')]('/:id/interactions',auth[_0xf326('0xa')](),controller[_0xf326('0x14')]);router[_0xf326('0x9')](_0xf326('0x15'),controller['statusGet']);router[_0xf326('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x16')]);router[_0xf326('0x17')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0x18')]);router[_0xf326('0x17')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0x19')]);router['post'](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x1a')]);router[_0xf326('0x17')](_0xf326('0x1b'),controller[_0xf326('0x1c')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xf326('0x1d')]);router[_0xf326('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xf326('0x1e')]);router['post']('/:id/status',controller[_0xf326('0x1f')]);router[_0xf326('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x20')]);router[_0xf326('0x21')]('/:id',auth[_0xf326('0xa')](),controller[_0xf326('0x22')]);router[_0xf326('0x23')](_0xf326('0x24'),auth[_0xf326('0xa')](),controller[_0xf326('0x25')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf326('0x26')]);router[_0xf326('0x23')](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x27')]);router[_0xf326('0x23')]('/:id/users',auth[_0xf326('0xa')](),controller[_0xf326('0x28')]);module[_0xf326('0x29')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x49c4d1,_0x247d67){var _0xb7c65=function(_0xefd5c6){while(--_0xefd5c6){_0x49c4d1['push'](_0x49c4d1['shift']());}};_0xb7c65(++_0x247d67);}(_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/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 9349124..21d65d8 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 _0x3768=['clicksend','plivo','clickatell','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','connectel'];(function(_0x2f037f,_0x2958c5){var _0x2d1573=function(_0x34146e){while(--_0x34146e){_0x2f037f['push'](_0x2f037f['shift']());}};_0x2d1573(++_0x2958c5);}(_0x3768,0x17e));var _0x8376=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0x3768[_0x1af05b];return _0x5be7cc;};'use strict';var Sequelize=require(_0x8376('0x0'));var rs=require(_0x8376('0x1'));module[_0x8376('0x2')]={'name':{'type':Sequelize[_0x8376('0x3')],'unique':_0x8376('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x8376('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8376('0x5')]();}},'phone':{'type':Sequelize[_0x8376('0x3')]},'type':{'type':Sequelize[_0x8376('0x6')](_0x8376('0x7'),'skebby',_0x8376('0x8'),_0x8376('0x9'),_0x8376('0xa'),_0x8376('0xb'),'bandwidth',_0x8376('0xc'),'infobip',_0x8376('0xd'))},'accountSid':{'type':Sequelize[_0x8376('0x3')]},'authId':{'type':Sequelize[_0x8376('0x3')]},'authToken':{'type':Sequelize[_0x8376('0x3')]},'smsMethod':{'type':Sequelize[_0x8376('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x8376('0x3')]},'applicationId':{'type':Sequelize[_0x8376('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x8376('0x3')]},'deliveryReport':{'type':Sequelize[_0x8376('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x8376('0x3')]},'notificationTemplate':{'type':Sequelize[_0x8376('0xf')],'defaultValue':function(){return _0x8376('0x10');}},'notificationSound':{'type':Sequelize[_0x8376('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8376('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8376('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8376('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8376('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8376('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x8376('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x8376('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x8376('0xe')],'defaultValue':![],'comment':_0x8376('0x13'),'set':function(_0x39663f){if(!_0x39663f)this[_0x8376('0x14')](_0x8376('0x15'),null);this['setDataValue'](_0x8376('0x16'),_0x39663f);}}}; \ No newline at end of file +var _0x3afe=['sequelize','randomstring','exports','STRING','name','ENUM','twilio','connectel','clicksend','plivo','csc','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition'];(function(_0x40e6d1,_0x10a7dd){var _0x2a236b=function(_0x5c6b4a){while(--_0x5c6b4a){_0x40e6d1['push'](_0x40e6d1['shift']());}};_0x2a236b(++_0x10a7dd);}(_0x3afe,0x1ee));var _0xe3af=function(_0x44ae0b,_0x3e9865){_0x44ae0b=_0x44ae0b-0x0;var _0x69232a=_0x3afe[_0x44ae0b];return _0x69232a;};'use strict';var Sequelize=require(_0xe3af('0x0'));var rs=require(_0xe3af('0x1'));module[_0xe3af('0x2')]={'name':{'type':Sequelize[_0xe3af('0x3')],'unique':_0xe3af('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xe3af('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xe3af('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xe3af('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xe3af('0x3')]},'type':{'type':Sequelize[_0xe3af('0x5')](_0xe3af('0x6'),'skebby',_0xe3af('0x7'),_0xe3af('0x8'),_0xe3af('0x9'),'clickatell','bandwidth',_0xe3af('0xa'),_0xe3af('0xb'),'intelepeer')},'accountSid':{'type':Sequelize[_0xe3af('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xe3af('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xe3af('0x3')]},'senderString':{'type':Sequelize[_0xe3af('0x3')]},'deliveryReport':{'type':Sequelize[_0xe3af('0xc')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xe3af('0xd')],'defaultValue':function(){return _0xe3af('0xe');}},'notificationSound':{'type':Sequelize[_0xe3af('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe3af('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe3af('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe3af('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe3af('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe3af('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe3af('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xe3af('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe3af('0xf')],'comment':_0xe3af('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xe3af('0x11'),'set':function(_0x16e631){if(!_0x16e631)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0xe3af('0x12'),_0x16e631);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 49b005a..122a25c 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 _0xeb45=['clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','CmContact','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','Content-Type','send','\x0a','addApplications','sequelize','Transaction','SmsApplication','bulkCreate','findAndCountAll','priority','getApplications','nolimit','getInteractions','Contact','User','Owner','Tag','Tags','tag','to\x20is\x20mandatory','List','out','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','bandwidth','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','get','SmsAccounts','UserProfileResource','destroy','stack','name','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','SmsAccount','includeAll','include','rows','show','params','fields','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','sms','account','applications','orderBy','Applications','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel'];(function(_0x2c16d9,_0xd68b7){var _0x3e81b1=function(_0x242700){while(--_0x242700){_0x2c16d9['push'](_0x2c16d9['shift']());}};_0x3e81b1(++_0xd68b7);}(_0xeb45,0x142));var _0x5eb4=function(_0x5daea7,_0x352f72){_0x5daea7=_0x5daea7-0x0;var _0x8d8b63=_0xeb45[_0x5daea7];return _0x8d8b63;};'use strict';var emlformat=require(_0x5eb4('0x0'));var rimraf=require(_0x5eb4('0x1'));var zipdir=require(_0x5eb4('0x2'));var jsonpatch=require(_0x5eb4('0x3'));var rp=require('request-promise');var moment=require(_0x5eb4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5eb4('0x5'));var util=require(_0x5eb4('0x6'));var path=require(_0x5eb4('0x7'));var sox=require('sox');var csv=require(_0x5eb4('0x8'));var ejs=require(_0x5eb4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5eb4('0xa'));var squel=require(_0x5eb4('0xb'));var crypto=require('crypto');var jsforce=require(_0x5eb4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5eb4('0x8'));var querystring=require('querystring');var Papa=require(_0x5eb4('0xd'));var Redis=require(_0x5eb4('0xe'));var authService=require(_0x5eb4('0xf'));var qs=require(_0x5eb4('0x10'));var as=require(_0x5eb4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5eb4('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5eb4('0x13'));var db=require('../../mysqldb')['db'];config[_0x5eb4('0x14')]=_[_0x5eb4('0x15')](config[_0x5eb4('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x5eb4('0x16'))(new Redis(config[_0x5eb4('0x14')]));require(_0x5eb4('0x17'))[_0x5eb4('0x18')](socket);var jayson=require(_0x5eb4('0x19'));var client=jayson['client'][_0x5eb4('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x12aba2,_0x2d96dc,_0x58652b,_0x42c7b9){return new BPromise(function(_0x2da6d7,_0x46712e){var _0x4d0b66=_0x42c7b9||client;return _0x4d0b66[_0x5eb4('0x1b')](_0x12aba2,_0x58652b)[_0x5eb4('0x1c')](function(_0x373274){logger[_0x5eb4('0x1d')](_0x5eb4('0x1e'),_0x2d96dc,_0x5eb4('0x1f'));logger[_0x5eb4('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2d96dc,'request\x20sent',JSON[_0x5eb4('0x21')](_0x373274));if(_0x373274[_0x5eb4('0x22')]){if(_0x373274['error'][_0x5eb4('0x23')]===0x1f4){logger[_0x5eb4('0x22')](_0x5eb4('0x1e'),_0x2d96dc,_0x373274[_0x5eb4('0x22')][_0x5eb4('0x24')]);return _0x46712e(_0x373274[_0x5eb4('0x22')][_0x5eb4('0x24')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x2d96dc,_0x373274['error']['message']);return _0x2da6d7(_0x373274[_0x5eb4('0x22')][_0x5eb4('0x24')]);}else{logger['info'](_0x5eb4('0x1e'),_0x2d96dc,_0x5eb4('0x1f'));_0x2da6d7(_0x373274[_0x5eb4('0x25')][_0x5eb4('0x24')]);}})[_0x5eb4('0x26')](function(_0x549c58){logger['error']('SmsAccount,\x20%s,\x20%s',_0x2d96dc,_0x549c58);_0x46712e(_0x549c58);});});}function respondWithStatusCode(_0xac5f03,_0x193915){_0x193915=_0x193915||0xcc;return function(_0xf3bbfb){if(_0xf3bbfb){return _0xac5f03[_0x5eb4('0x27')](_0x193915);}return _0xac5f03[_0x5eb4('0x28')](_0x193915)[_0x5eb4('0x29')]();};}function respondWithResult(_0x5bbe90,_0x44ced1){_0x44ced1=_0x44ced1||0xc8;return function(_0x280806){if(_0x280806){return _0x5bbe90[_0x5eb4('0x28')](_0x44ced1)[_0x5eb4('0x2a')](_0x280806);}};}function respondWithFilteredResult(_0x50b42b,_0x260814){return function(_0x5221ee){if(_0x5221ee){var _0x2e27db=typeof _0x260814['offset']==='undefined'&&typeof _0x260814[_0x5eb4('0x2b')]===_0x5eb4('0x2c');var _0x3180ba=_0x5221ee[_0x5eb4('0x2d')];var _0x5c497f=_0x2e27db?0x0:_0x260814[_0x5eb4('0x2e')];var _0x51f42c=_0x2e27db?_0x5221ee[_0x5eb4('0x2d')]:_0x260814[_0x5eb4('0x2e')]+_0x260814[_0x5eb4('0x2b')];var _0x1e3068;if(_0x51f42c>=_0x3180ba){_0x51f42c=_0x3180ba;_0x1e3068=0xc8;}else{_0x1e3068=0xce;}_0x50b42b['status'](_0x1e3068);return _0x50b42b['set'](_0x5eb4('0x2f'),_0x5c497f+'-'+_0x51f42c+'/'+_0x3180ba)[_0x5eb4('0x2a')](_0x5221ee);}return null;};}function patchUpdates(_0x159bb5){return function(_0x49e85f){try{jsonpatch[_0x5eb4('0x30')](_0x49e85f,_0x159bb5,!![]);}catch(_0x476118){return BPromise[_0x5eb4('0x31')](_0x476118);}return _0x49e85f[_0x5eb4('0x32')]();};}function saveUpdates(_0x4bd65f,_0x5ed8f2){return function(_0x14d762){if(_0x14d762){return _0x14d762[_0x5eb4('0x33')](_0x4bd65f)['then'](function(_0x13e4ad){return _0x13e4ad;});}return null;};}function removeEntity(_0x3c8c44,_0x5ea823){return function(_0x407468){if(_0x407468){return _0x407468['destroy']()[_0x5eb4('0x1c')](function(){var _0x5235bb=_0x407468[_0x5eb4('0x34')]({'plain':!![]});var _0x49d808=_0x5eb4('0x35');return db[_0x5eb4('0x36')][_0x5eb4('0x37')]({'where':{'type':_0x49d808,'resourceId':_0x5235bb['id']}})[_0x5eb4('0x1c')](function(){return _0x407468;});})[_0x5eb4('0x1c')](function(){_0x3c8c44[_0x5eb4('0x28')](0xcc)[_0x5eb4('0x29')]();});}};}function handleEntityNotFound(_0x4db594,_0x68c913){return function(_0x36a9eb){if(!_0x36a9eb){_0x4db594['sendStatus'](0x194);}return _0x36a9eb;};}function handleError(_0x1c763b,_0x44e294){_0x44e294=_0x44e294||0x1f4;return function(_0x5ad95b){logger[_0x5eb4('0x22')](_0x5ad95b[_0x5eb4('0x38')]);if(_0x5ad95b[_0x5eb4('0x39')]){delete _0x5ad95b[_0x5eb4('0x39')];}_0x1c763b['status'](_0x44e294)['send'](_0x5ad95b);};}exports['index']=function(_0x5e8094,_0x50dcab){var _0x265a2a={'include':[{'model':db[_0x5eb4('0x3a')],'as':_0x5eb4('0x3b')}]},_0x28a4d2={},_0x5e9282={'count':0x0,'rows':[]};var _0x2b04ea=_[_0x5eb4('0x3c')](db['SmsAccount'][_0x5eb4('0x3d')],function(_0x19e3a2){return{'name':_0x19e3a2[_0x5eb4('0x3e')],'type':_0x19e3a2[_0x5eb4('0x3f')][_0x5eb4('0x40')]};});_0x28a4d2[_0x5eb4('0x41')]=_['map'](_0x2b04ea,'name');_0x28a4d2[_0x5eb4('0x42')]=_[_0x5eb4('0x43')](_0x5e8094[_0x5eb4('0x42')]);_0x28a4d2[_0x5eb4('0x44')]=_['intersection'](_0x28a4d2[_0x5eb4('0x41')],_0x28a4d2[_0x5eb4('0x42')]);_0x265a2a[_0x5eb4('0x45')]=_[_0x5eb4('0x46')](_0x28a4d2[_0x5eb4('0x41')],qs['fields'](_0x5e8094[_0x5eb4('0x42')]['fields']));_0x265a2a[_0x5eb4('0x45')]=_0x265a2a[_0x5eb4('0x45')][_0x5eb4('0x47')]?_0x265a2a[_0x5eb4('0x45')]:_0x28a4d2[_0x5eb4('0x41')];if(!_0x5e8094[_0x5eb4('0x42')][_0x5eb4('0x48')]('nolimit')){_0x265a2a[_0x5eb4('0x2b')]=qs[_0x5eb4('0x2b')](_0x5e8094[_0x5eb4('0x42')][_0x5eb4('0x2b')]);_0x265a2a[_0x5eb4('0x2e')]=qs[_0x5eb4('0x2e')](_0x5e8094[_0x5eb4('0x42')][_0x5eb4('0x2e')]);}_0x265a2a['order']=qs[_0x5eb4('0x49')](_0x5e8094[_0x5eb4('0x42')][_0x5eb4('0x49')]);_0x265a2a[_0x5eb4('0x4a')]=qs[_0x5eb4('0x44')](_[_0x5eb4('0x4b')](_0x5e8094[_0x5eb4('0x42')],_0x28a4d2[_0x5eb4('0x44')]),_0x2b04ea);if(_0x5e8094[_0x5eb4('0x42')]['filter']){_0x265a2a['where']=_[_0x5eb4('0x4c')](_0x265a2a[_0x5eb4('0x4a')],{'$or':_[_0x5eb4('0x3c')](_0x2b04ea,function(_0x2372b6){if(_0x2372b6['type']!==_0x5eb4('0x4d')){var _0x20025e={};_0x20025e[_0x2372b6[_0x5eb4('0x39')]]={'$like':'%'+_0x5e8094[_0x5eb4('0x42')][_0x5eb4('0x4e')]+'%'};return _0x20025e;}})});}_0x265a2a=_['merge']({},_0x265a2a,_0x5e8094['options']);var _0x186250={'where':_0x265a2a[_0x5eb4('0x4a')]};return db[_0x5eb4('0x4f')][_0x5eb4('0x2d')](_0x186250)[_0x5eb4('0x1c')](function(_0x420224){_0x5e9282[_0x5eb4('0x2d')]=_0x420224;if(_0x5e8094['query'][_0x5eb4('0x50')]){_0x265a2a[_0x5eb4('0x51')]=[{'all':!![]}];}return db[_0x5eb4('0x4f')]['findAll'](_0x265a2a);})[_0x5eb4('0x1c')](function(_0x4813f4){_0x5e9282[_0x5eb4('0x52')]=_0x4813f4;return _0x5e9282;})[_0x5eb4('0x1c')](respondWithFilteredResult(_0x50dcab,_0x265a2a))[_0x5eb4('0x26')](handleError(_0x50dcab,null));};exports[_0x5eb4('0x53')]=function(_0x110ed9,_0x421682){var _0x21c103={'raw':![],'where':{'id':_0x110ed9[_0x5eb4('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x5eb4('0x3b')}]},_0x906068={};_0x906068['model']=_[_0x5eb4('0x43')](db[_0x5eb4('0x4f')][_0x5eb4('0x3d')]);_0x906068[_0x5eb4('0x42')]=_[_0x5eb4('0x43')](_0x110ed9['query']);_0x906068['filters']=_[_0x5eb4('0x46')](_0x906068['model'],_0x906068[_0x5eb4('0x42')]);_0x21c103[_0x5eb4('0x45')]=_[_0x5eb4('0x46')](_0x906068[_0x5eb4('0x41')],qs[_0x5eb4('0x55')](_0x110ed9[_0x5eb4('0x42')]['fields']));_0x21c103[_0x5eb4('0x45')]=_0x21c103['attributes'][_0x5eb4('0x47')]?_0x21c103[_0x5eb4('0x45')]:_0x906068[_0x5eb4('0x41')];if(_0x110ed9['query'][_0x5eb4('0x50')]){_0x21c103[_0x5eb4('0x51')]=[{'all':!![]}];}_0x21c103=_[_0x5eb4('0x4c')]({},_0x21c103,_0x110ed9[_0x5eb4('0x56')]);return db[_0x5eb4('0x4f')]['find'](_0x21c103)[_0x5eb4('0x1c')](handleEntityNotFound(_0x421682,null))[_0x5eb4('0x1c')](respondWithResult(_0x421682,null))[_0x5eb4('0x26')](handleError(_0x421682,null));};exports['create']=function(_0x4a9069,_0x5116fe){return db[_0x5eb4('0x4f')][_0x5eb4('0x57')](_0x4a9069['body'],{})[_0x5eb4('0x1c')](function(_0x2f30ce){var _0x4133a3=_0x4a9069[_0x5eb4('0x58')][_0x5eb4('0x34')]({'plain':!![]});if(!_0x4133a3)throw new Error(_0x5eb4('0x59'));if(_0x4133a3['role']===_0x5eb4('0x58')){var _0x52de6b=_0x2f30ce[_0x5eb4('0x34')]({'plain':!![]});var _0x498cf5=_0x5eb4('0x35');return db['UserProfileSection']['find']({'where':{'name':_0x498cf5,'userProfileId':_0x4133a3[_0x5eb4('0x5a')]},'raw':!![]})[_0x5eb4('0x1c')](function(_0x534fb6){if(_0x534fb6&&_0x534fb6[_0x5eb4('0x5b')]===0x0){return db['UserProfileResource'][_0x5eb4('0x57')]({'name':_0x52de6b['name'],'resourceId':_0x52de6b['id'],'type':_0x534fb6[_0x5eb4('0x39')],'sectionId':_0x534fb6['id']},{})['then'](function(){return _0x2f30ce;});}else{return _0x2f30ce;}})[_0x5eb4('0x26')](function(_0x5b299c){logger[_0x5eb4('0x22')](_0x5eb4('0x5c'),_0x5b299c);throw _0x5b299c;});}return _0x2f30ce;})[_0x5eb4('0x1c')](respondWithResult(_0x5116fe,0xc9))[_0x5eb4('0x26')](handleError(_0x5116fe,null));};exports[_0x5eb4('0x33')]=function(_0xa93da8,_0x456e24){if(_0xa93da8[_0x5eb4('0x5d')]['id']){delete _0xa93da8[_0x5eb4('0x5d')]['id'];}return db[_0x5eb4('0x4f')][_0x5eb4('0x5e')]({'where':{'id':_0xa93da8[_0x5eb4('0x54')]['id']},'include':[{'model':db[_0x5eb4('0x3a')],'as':_0x5eb4('0x3b')}]})[_0x5eb4('0x1c')](handleEntityNotFound(_0x456e24,null))['then'](saveUpdates(_0xa93da8[_0x5eb4('0x5d')],null))['then'](respondWithResult(_0x456e24,null))[_0x5eb4('0x26')](handleError(_0x456e24,null));};exports[_0x5eb4('0x37')]=function(_0x2a7a84,_0x19f48b){return db['SmsAccount'][_0x5eb4('0x5e')]({'where':{'id':_0x2a7a84['params']['id']}})[_0x5eb4('0x1c')](handleEntityNotFound(_0x19f48b,null))['then'](removeEntity(_0x19f48b,null))['catch'](handleError(_0x19f48b,null));};exports[_0x5eb4('0x5f')]=function(_0x5c5c5e,_0x5cae2c){return db[_0x5eb4('0x4f')][_0x5eb4('0x5f')]()[_0x5eb4('0x1c')](respondWithResult(_0x5cae2c,null))[_0x5eb4('0x26')](handleError(_0x5cae2c,null));};exports[_0x5eb4('0x60')]=function(_0x4e5ead,_0xe5cbd4,_0x406a4b){if(_0x4e5ead[_0x5eb4('0x5d')]['id']){delete _0x4e5ead[_0x5eb4('0x5d')]['id'];}return db[_0x5eb4('0x4f')][_0x5eb4('0x5e')]({'where':{'id':_0x4e5ead['params']['id']}})[_0x5eb4('0x1c')](handleEntityNotFound(_0xe5cbd4,null))['then'](function(_0x4bbe7a){if(_0x4bbe7a){_0x4e5ead[_0x5eb4('0x5d')][_0x5eb4('0x61')]=_0x4bbe7a['id'];return db['Disposition'][_0x5eb4('0x57')](_0x4e5ead[_0x5eb4('0x5d')]);}})[_0x5eb4('0x1c')](respondWithResult(_0xe5cbd4,null))['catch'](handleError(_0xe5cbd4,null));};exports[_0x5eb4('0x62')]=function(_0x5cd6f4,_0x4a1df8,_0x426316){var _0x343c57={'raw':![],'where':{}};var _0x5e2d29={};var _0x554d9d={'count':0x0,'rows':[]};return db[_0x5eb4('0x4f')][_0x5eb4('0x63')]({'where':{'id':_0x5cd6f4[_0x5eb4('0x54')]['id']}})[_0x5eb4('0x1c')](handleEntityNotFound(_0x4a1df8,null))[_0x5eb4('0x1c')](function(_0x3144e0){if(_0x3144e0){_0x5e2d29[_0x5eb4('0x41')]=_[_0x5eb4('0x43')](db[_0x5eb4('0x64')]['rawAttributes']);_0x5e2d29[_0x5eb4('0x42')]=_[_0x5eb4('0x43')](_0x5cd6f4['query']);_0x5e2d29[_0x5eb4('0x44')]=_['intersection'](_0x5e2d29['model'],_0x5e2d29[_0x5eb4('0x42')]);_0x343c57[_0x5eb4('0x45')]=_[_0x5eb4('0x46')](_0x5e2d29[_0x5eb4('0x41')],qs[_0x5eb4('0x55')](_0x5cd6f4[_0x5eb4('0x42')][_0x5eb4('0x55')]));_0x343c57[_0x5eb4('0x45')]=_0x343c57[_0x5eb4('0x45')][_0x5eb4('0x47')]?_0x343c57[_0x5eb4('0x45')]:_0x5e2d29[_0x5eb4('0x41')];if(!_0x5cd6f4[_0x5eb4('0x42')][_0x5eb4('0x48')]('nolimit')){_0x343c57[_0x5eb4('0x2b')]=qs[_0x5eb4('0x2b')](_0x5cd6f4[_0x5eb4('0x42')][_0x5eb4('0x2b')]);_0x343c57[_0x5eb4('0x2e')]=qs[_0x5eb4('0x2e')](_0x5cd6f4[_0x5eb4('0x42')][_0x5eb4('0x2e')]);}_0x343c57[_0x5eb4('0x65')]=qs['sort'](_0x5cd6f4[_0x5eb4('0x42')]['sort']);_0x343c57[_0x5eb4('0x4a')]=qs['filters'](_[_0x5eb4('0x4b')](_0x5cd6f4[_0x5eb4('0x42')],_0x5e2d29[_0x5eb4('0x44')]));_0x343c57[_0x5eb4('0x4a')][_0x5eb4('0x61')]=_0x3144e0['id'];if(_0x5cd6f4[_0x5eb4('0x42')]['filter']){_0x343c57[_0x5eb4('0x4a')]=_[_0x5eb4('0x4c')](_0x343c57[_0x5eb4('0x4a')],{'$or':_['map'](_0x343c57[_0x5eb4('0x45')],function(_0x9cad79){var _0x5b7fcf={};_0x5b7fcf[_0x9cad79]={'$like':'%'+_0x5cd6f4['query'][_0x5eb4('0x4e')]+'%'};return _0x5b7fcf;})});}_0x343c57=_[_0x5eb4('0x4c')]({},_0x343c57,_0x5cd6f4[_0x5eb4('0x56')]);return db[_0x5eb4('0x64')][_0x5eb4('0x2d')]({'where':_0x343c57['where']})[_0x5eb4('0x1c')](function(_0x3d891a){_0x554d9d['count']=_0x3d891a;if(_0x5cd6f4[_0x5eb4('0x42')][_0x5eb4('0x50')]){_0x343c57[_0x5eb4('0x51')]=[{'all':!![]}];}return db[_0x5eb4('0x64')][_0x5eb4('0x66')](_0x343c57);})['then'](function(_0x3d0c19){_0x554d9d['rows']=_0x3d0c19;return _0x554d9d;});}})['then'](respondWithFilteredResult(_0x4a1df8,_0x343c57))[_0x5eb4('0x26')](handleError(_0x4a1df8,null));};exports['removeDispositions']=function(_0x4a2323,_0x170c59,_0x45034c){return db[_0x5eb4('0x4f')]['find']({'where':{'id':_0x4a2323[_0x5eb4('0x54')]['id']}})['then'](handleEntityNotFound(_0x170c59,null))[_0x5eb4('0x1c')](function(_0x4a644f){if(_0x4a644f){return _0x4a644f[_0x5eb4('0x67')](_0x4a2323[_0x5eb4('0x42')][_0x5eb4('0x68')]);}})['then'](respondWithStatusCode(_0x170c59,null))[_0x5eb4('0x26')](handleError(_0x170c59,null));};exports[_0x5eb4('0x69')]=function(_0x454e5c,_0x26060c,_0x3c3e18){if(_0x454e5c[_0x5eb4('0x5d')]['id']){delete _0x454e5c[_0x5eb4('0x5d')]['id'];}return db['SmsAccount'][_0x5eb4('0x5e')]({'where':{'id':_0x454e5c['params']['id']}})[_0x5eb4('0x1c')](handleEntityNotFound(_0x26060c,null))[_0x5eb4('0x1c')](function(_0xa9fb69){if(_0xa9fb69){_0x454e5c[_0x5eb4('0x5d')][_0x5eb4('0x61')]=_0xa9fb69['id'];return db[_0x5eb4('0x6a')][_0x5eb4('0x57')](_0x454e5c[_0x5eb4('0x5d')]);}})[_0x5eb4('0x1c')](respondWithResult(_0x26060c,null))[_0x5eb4('0x26')](handleError(_0x26060c,null));};exports['getAnswers']=function(_0x209c39,_0x506097,_0x15ef73){var _0x285848={'raw':![],'where':{}};var _0x24ad00={};var _0x226f17={'count':0x0,'rows':[]};return db[_0x5eb4('0x4f')][_0x5eb4('0x63')]({'where':{'id':_0x209c39[_0x5eb4('0x54')]['id']}})[_0x5eb4('0x1c')](handleEntityNotFound(_0x506097,null))[_0x5eb4('0x1c')](function(_0x16df61){if(_0x16df61){_0x24ad00[_0x5eb4('0x41')]=_[_0x5eb4('0x43')](db[_0x5eb4('0x6a')][_0x5eb4('0x3d')]);_0x24ad00[_0x5eb4('0x42')]=_[_0x5eb4('0x43')](_0x209c39['query']);_0x24ad00[_0x5eb4('0x44')]=_[_0x5eb4('0x46')](_0x24ad00[_0x5eb4('0x41')],_0x24ad00[_0x5eb4('0x42')]);_0x285848[_0x5eb4('0x45')]=_[_0x5eb4('0x46')](_0x24ad00[_0x5eb4('0x41')],qs[_0x5eb4('0x55')](_0x209c39['query'][_0x5eb4('0x55')]));_0x285848[_0x5eb4('0x45')]=_0x285848[_0x5eb4('0x45')][_0x5eb4('0x47')]?_0x285848[_0x5eb4('0x45')]:_0x24ad00[_0x5eb4('0x41')];if(!_0x209c39[_0x5eb4('0x42')][_0x5eb4('0x48')]('nolimit')){_0x285848[_0x5eb4('0x2b')]=qs[_0x5eb4('0x2b')](_0x209c39[_0x5eb4('0x42')][_0x5eb4('0x2b')]);_0x285848[_0x5eb4('0x2e')]=qs[_0x5eb4('0x2e')](_0x209c39[_0x5eb4('0x42')]['offset']);}_0x285848[_0x5eb4('0x65')]=qs[_0x5eb4('0x49')](_0x209c39[_0x5eb4('0x42')][_0x5eb4('0x49')]);_0x285848['where']=qs[_0x5eb4('0x44')](_['pick'](_0x209c39[_0x5eb4('0x42')],_0x24ad00['filters']));_0x285848[_0x5eb4('0x4a')]['SmsAccountId']=_0x16df61['id'];if(_0x209c39[_0x5eb4('0x42')]['filter']){_0x285848['where']=_[_0x5eb4('0x4c')](_0x285848[_0x5eb4('0x4a')],{'$or':_[_0x5eb4('0x3c')](_0x285848[_0x5eb4('0x45')],function(_0x994737){var _0xff8392={};_0xff8392[_0x994737]={'$like':'%'+_0x209c39[_0x5eb4('0x42')][_0x5eb4('0x4e')]+'%'};return _0xff8392;})});}_0x285848=_[_0x5eb4('0x4c')]({},_0x285848,_0x209c39['options']);return db[_0x5eb4('0x6a')][_0x5eb4('0x2d')]({'where':_0x285848[_0x5eb4('0x4a')]})[_0x5eb4('0x1c')](function(_0x5985a4){_0x226f17[_0x5eb4('0x2d')]=_0x5985a4;if(_0x209c39['query'][_0x5eb4('0x50')]){_0x285848[_0x5eb4('0x51')]=[{'all':!![]}];}return db[_0x5eb4('0x6a')][_0x5eb4('0x66')](_0x285848);})[_0x5eb4('0x1c')](function(_0x59dfd1){_0x226f17[_0x5eb4('0x52')]=_0x59dfd1;return _0x226f17;});}})[_0x5eb4('0x1c')](respondWithFilteredResult(_0x506097,_0x285848))['catch'](handleError(_0x506097,null));};exports['removeAnswers']=function(_0x38e1da,_0x56f35d,_0x2c8d9b){return db[_0x5eb4('0x4f')][_0x5eb4('0x5e')]({'where':{'id':_0x38e1da['params']['id']}})[_0x5eb4('0x1c')](handleEntityNotFound(_0x56f35d,null))[_0x5eb4('0x1c')](function(_0x3333ab){if(_0x3333ab){return _0x3333ab[_0x5eb4('0x6b')](_0x38e1da[_0x5eb4('0x42')][_0x5eb4('0x68')]);}})[_0x5eb4('0x1c')](respondWithStatusCode(_0x56f35d,null))[_0x5eb4('0x26')](handleError(_0x56f35d,null));};exports['notify']=function(_0x310d90,_0x258130,_0x13cac2){var _0x510c6c={'channel':_0x5eb4('0x6c')};var _0x13bc4c=[];var _0x38a108=[];var _0x4cb719={};return db['SmsAccount'][_0x5eb4('0x5e')]({'where':{'id':_0x310d90[_0x5eb4('0x54')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0x5eb4('0x1c')](handleEntityNotFound(_0x258130,null))[_0x5eb4('0x1c')](function(_0x54e5d2){_0x510c6c[_0x5eb4('0x6d')]=_0x54e5d2;_0x510c6c[_0x5eb4('0x6e')]=_[_0x5eb4('0x6f')](_0x54e5d2[_0x5eb4('0x70')],['priority'],[_0x5eb4('0x71')]);if(_0x510c6c[_0x5eb4('0x6d')][_0x5eb4('0x70')]){delete _0x510c6c[_0x5eb4('0x6d')]['Applications'];}return db['CmContact']['describe']();})[_0x5eb4('0x1c')](function(_0x46fec2){if(!_0x46fec2){throw new db[(_0x5eb4('0x72'))][(_0x5eb4('0x73'))](_0x5eb4('0x74'));}_0x13bc4c=_[_0x5eb4('0x75')](_[_0x5eb4('0x43')](_0x46fec2),[_0x5eb4('0x76'),_0x5eb4('0x77')]);_0x38a108=_[_0x5eb4('0x75')](_[_0x5eb4('0x43')](_0x46fec2),[_0x5eb4('0x76'),_0x5eb4('0x77'),'CompanyId',_0x5eb4('0x78')]);_0x510c6c[_0x5eb4('0x5d')]={'mapKey':'mobile'};if(_0x510c6c[_0x5eb4('0x6d')][_0x5eb4('0x3f')]){switch(_0x510c6c[_0x5eb4('0x6d')]['type']){case'twilio':_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x79')]=_0x310d90[_0x5eb4('0x5d')][_0x5eb4('0x7a')];_0x510c6c['body'][_0x5eb4('0x5d')]=_0x310d90[_0x5eb4('0x5d')][_0x5eb4('0x7b')];_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x7c')]=_0x310d90[_0x5eb4('0x5d')][_0x5eb4('0x7d')];break;case _0x5eb4('0x7e'):_0x510c6c['body'][_0x5eb4('0x79')]='+'+_0x310d90[_0x5eb4('0x5d')][_0x5eb4('0x7f')];_0x510c6c['body'][_0x5eb4('0x5d')]=_0x310d90[_0x5eb4('0x5d')][_0x5eb4('0x80')];break;case _0x5eb4('0x81'):_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x79')]=_0x310d90[_0x5eb4('0x5d')][_0x5eb4('0x79')];_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x5d')]=_0x310d90[_0x5eb4('0x5d')]['message'];break;case _0x5eb4('0x82'):_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x79')]=_0x310d90[_0x5eb4('0x5d')][_0x5eb4('0x79')];_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x5d')]=_0x310d90['body'][_0x5eb4('0x5d')];_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x7c')]=_0x310d90[_0x5eb4('0x5d')][_0x5eb4('0x83')];break;case _0x5eb4('0x84'):_0x510c6c['body'][_0x5eb4('0x79')]=_0x310d90[_0x5eb4('0x5d')][_0x5eb4('0x7a')];_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x5d')]=_0x310d90['body'][_0x5eb4('0x85')];_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x7c')]=_0x310d90['body'][_0x5eb4('0x86')];break;case _0x5eb4('0x87'):_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x79')]='+'+_0x310d90['body'][_0x5eb4('0x88')][0x0]['from'];_0x510c6c['body'][_0x5eb4('0x5d')]=_0x310d90[_0x5eb4('0x5d')][_0x5eb4('0x88')][0x0][_0x5eb4('0x80')];_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x7c')]=_0x310d90[_0x5eb4('0x5d')]['results'][0x0]['messageId'];break;case _0x5eb4('0x89'):_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x79')]=_0x310d90[_0x5eb4('0x5d')][_0x5eb4('0x8a')];_0x510c6c['body']['body']=_0x310d90[_0x5eb4('0x5d')][_0x5eb4('0x8b')][_0x5eb4('0x24')];break;case _0x5eb4('0x8c'):_0x510c6c['body']['from']=_0x310d90['body'][_0x5eb4('0x8d')];_0x510c6c[_0x5eb4('0x5d')]['body']=_0x310d90[_0x5eb4('0x5d')][_0x5eb4('0x80')];_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x7c')]=_0x310d90[_0x5eb4('0x5d')]['replyMessageId'];break;case'bandwidth':_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x7c')]=_0x310d90[_0x5eb4('0x5d')][0x0][_0x5eb4('0x24')]['id'];_0x510c6c[_0x5eb4('0x5d')]['from']=_0x310d90[_0x5eb4('0x5d')][0x0]['message'][_0x5eb4('0x79')];_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x5d')]=_0x310d90['body'][0x0][_0x5eb4('0x24')]['text'];break;case _0x5eb4('0x8e'):_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x79')]=_0x310d90[_0x5eb4('0x5d')][_0x5eb4('0x79')];_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x5d')]=_0x310d90['body'][_0x5eb4('0x24')];_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x7c')]=_0x310d90[_0x5eb4('0x5d')]['refid'];break;}}if(_0x510c6c[_0x5eb4('0x5d')]['id']){delete _0x510c6c[_0x5eb4('0x5d')]['id'];}if(_[_0x5eb4('0x8f')](_0x510c6c['body']['from'])){throw new db[(_0x5eb4('0x72'))]['ValidationError'](_0x5eb4('0x90'));}if(_[_0x5eb4('0x8f')](_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x5d')])||_0x510c6c['body'][_0x5eb4('0x5d')]===''){throw new db[(_0x5eb4('0x72'))][(_0x5eb4('0x73'))](_0x5eb4('0x91'));}if(_[_0x5eb4('0x8f')](_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x92')])){throw new db[(_0x5eb4('0x72'))][(_0x5eb4('0x73'))](_0x5eb4('0x93')+_0x38a108);}if(!_[_0x5eb4('0x94')](_0x38a108,_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x92')])){throw new db[(_0x5eb4('0x72'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x38a108);}_0x4cb719[_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x92')]]=_0x510c6c['body'][_0x5eb4('0x79')];return db[_0x5eb4('0x95')][_0x5eb4('0x5e')]({'where':{'id':_0x510c6c[_0x5eb4('0x6d')]['ListId']},'include':[{'model':db[_0x5eb4('0x96')],'as':'Contacts','where':_0x4cb719,'limit':0x1,'order':[['updatedAt',_0x5eb4('0x97')]]}]});})[_0x5eb4('0x1c')](handleEntityNotFound(_0x258130,null))[_0x5eb4('0x1c')](function(_0x155cd5){if(_0x155cd5){_0x510c6c[_0x5eb4('0x98')]=_[_0x5eb4('0x99')](_0x155cd5,[_0x5eb4('0x9a')]);if(_0x155cd5['Contacts'][_0x5eb4('0x47')]){return _0x155cd5[_0x5eb4('0x9a')][0x0];}var _0x16ca4c=_[_0x5eb4('0x15')](_0x510c6c[_0x5eb4('0x5d')],{'firstName':_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x79')],'ListId':_0x155cd5['id']});_0x16ca4c[_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x92')]]=_0x510c6c[_0x5eb4('0x5d')]['from'];return db['CmContact'][_0x5eb4('0x57')](_0x16ca4c,{'fields':_0x13bc4c,'raw':!![]});}})[_0x5eb4('0x1c')](handleEntityNotFound(_0x258130,null))['then'](function(_0x4378d7){if(_0x4378d7){_0x510c6c[_0x5eb4('0x9b')]=_0x4378d7;var _0x10cdf5={'ContactId':_0x4378d7['id'],'phone':_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x79')],'SmsAccountId':_0x310d90[_0x5eb4('0x54')]['id']};var _0x586a66={'ContactId':_0x4378d7['id'],'SmsAccountId':_0x310d90[_0x5eb4('0x54')]['id'],'closed':![]};return db[_0x5eb4('0x9c')][_0x5eb4('0x5e')]({'where':_0x586a66})[_0x5eb4('0x1c')](function(_0x22b447){if(_0x22b447){return[_0x22b447,![]];}return db['SmsInteraction'][_0x5eb4('0x57')](_0x10cdf5)[_0x5eb4('0x1c')](function(_0x33d164){return[_0x33d164,!![]];});});}})[_0x5eb4('0x9d')](function(_0x36adff,_0x59483e){_0x510c6c[_0x5eb4('0x9e')]=_0x36adff['get']({'plain':!![]});_0x510c6c[_0x5eb4('0x9e')][_0x5eb4('0x9f')]=![];if(_0x59483e){if(_0x510c6c['account'][_0x5eb4('0xa0')]){_0x510c6c[_0x5eb4('0x6e')][_0x5eb4('0xa1')]({'id':0x0,'priority':_0x510c6c['applications']['length']+0x1,'app':'close','appdata':_0x5eb4('0xa2'),'interval':_0x5eb4('0xa3')});}_0x510c6c[_0x5eb4('0x9e')]['created']=!![];}return db[_0x5eb4('0xa4')][_0x5eb4('0x57')]({'phone':_0x510c6c['body'][_0x5eb4('0x79')],'messageId':_0x510c6c[_0x5eb4('0x5d')]['messageId'],'body':_0x510c6c[_0x5eb4('0x5d')][_0x5eb4('0x5d')],'SmsAccountId':_0x310d90['params']['id'],'SmsInteractionId':_0x36adff['id'],'direction':'in','ContactId':_0x36adff[_0x5eb4('0xa5')],'AttachmentId':_0x510c6c['body']['AttachmentId']});})['then'](function(_0x14affd){_0x510c6c[_0x5eb4('0x24')]=_0x14affd;if(_0x510c6c[_0x5eb4('0x9e')][_0x5eb4('0xa6')]){return db['User'][_0x5eb4('0x5e')]({'attributes':['id',_0x5eb4('0x39')],'where':{'id':_0x510c6c[_0x5eb4('0x9e')]['UserId']}})[_0x5eb4('0x1c')](function(_0x174b53){if(_0x174b53){_0x510c6c['applications'][_0x5eb4('0xa7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x174b53[_0x5eb4('0x39')]+','+(_0x510c6c[_0x5eb4('0x6d')][_0x5eb4('0xa8')]||0xa),'interval':_0x5eb4('0xa3')});}return respondWithRpcPromise(_0x5eb4('0xa9'),_0x5eb4('0xaa'),_0x510c6c);});}return respondWithRpcPromise(_0x5eb4('0xa9'),_0x5eb4('0xaa'),_0x510c6c);})[_0x5eb4('0x1c')](function(_0x2ab94b){if(_0x2ab94b){var _0x30c4e4=0xc8;var _0x1159b0='receiveMessage';logger['info'](_0x5eb4('0xab'),_0x1159b0,_0x30c4e4,_0x5eb4('0xac'));logger[_0x5eb4('0x20')](_0x5eb4('0xad'),_0x1159b0,_0x30c4e4,'entity\x20found',JSON[_0x5eb4('0x21')](_0x2ab94b));if(_0x510c6c[_0x5eb4('0x6d')][_0x5eb4('0x3f')]===_0x5eb4('0xae')){return _0x258130[_0x5eb4('0x28')](_0x30c4e4)[_0x5eb4('0xaf')](_0x5eb4('0xb0'),'text/xml')[_0x5eb4('0xb1')](_0x5eb4('0xb2'));}else{return _0x258130[_0x5eb4('0x28')](_0x30c4e4)[_0x5eb4('0x2a')](_0x2ab94b);}}})[_0x5eb4('0x26')](handleError(_0x258130,null));};exports[_0x5eb4('0xb3')]=function(_0x59802e,_0x5d07c5){var _0x3312d9=_0x59802e[_0x5eb4('0x54')]['id'];var _0xdde899=_0x59802e[_0x5eb4('0x5d')];var _0xf60907=0xc8;var _0x351b0f=null;return db[_0x5eb4('0xb4')]['transaction']({'isolationLevel':db[_0x5eb4('0xb4')][_0x5eb4('0xb5')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x4b3b8c){return db[_0x5eb4('0x4f')]['findOne']({'where':{'id':_0x3312d9},'transaction':_0x4b3b8c})['then'](function(_0x99bce2){if(_0x99bce2){return db[_0x5eb4('0xb6')][_0x5eb4('0x37')]({'where':{'SmsAccountId':_0x3312d9},'transaction':_0x4b3b8c})[_0x5eb4('0x1c')](function(){var _0x14ef5b=_['map'](_0xdde899,function(_0xa822d8){_0xa822d8[_0x5eb4('0x61')]=_0x3312d9;return _0xa822d8;});return db[_0x5eb4('0xb6')][_0x5eb4('0xb7')](_0x14ef5b,{'transaction':_0x4b3b8c});});}else{_0xf60907=0x194;_0x351b0f=[];}});})[_0x5eb4('0x1c')](function(){if(_0xf60907!==0x194){return db[_0x5eb4('0xb6')][_0x5eb4('0xb8')]({'where':{'SmsAccountId':_0x3312d9},'order':_0x5eb4('0xb9')})[_0x5eb4('0x1c')](function(_0x14c150){_0x351b0f=_0x14c150;});}})[_0x5eb4('0x26')](function(_0x5a7988){_0xf60907=0x1f4;logger['error'](_0x5a7988[_0x5eb4('0x38')]);if(_0x5a7988[_0x5eb4('0x39')]){delete _0x5a7988[_0x5eb4('0x39')];}_0x351b0f=_0x5a7988;})['finally'](function(){if(_0x351b0f===null){_0x5d07c5[_0x5eb4('0x27')](_0xf60907);}else{if(_0xf60907===0x1f4){_0x5d07c5[_0x5eb4('0x28')](_0xf60907)[_0x5eb4('0xb1')](_0x351b0f);}else{_0x5d07c5[_0x5eb4('0x28')](_0xf60907)[_0x5eb4('0x2a')](_0x351b0f);}}});};exports[_0x5eb4('0xba')]=function(_0x1c2c55,_0x16413b,_0x1cfd6e){var _0x3dfe9d={};var _0xf81a43={};var _0x45909c;var _0x18e074;return db[_0x5eb4('0x4f')][_0x5eb4('0x63')]({'where':{'id':_0x1c2c55[_0x5eb4('0x54')]['id']}})[_0x5eb4('0x1c')](handleEntityNotFound(_0x16413b,null))[_0x5eb4('0x1c')](function(_0x5f0eb8){if(_0x5f0eb8){_0x45909c=_0x5f0eb8;_0xf81a43['model']=_[_0x5eb4('0x43')](db[_0x5eb4('0xb6')]['rawAttributes']);_0xf81a43['query']=_[_0x5eb4('0x43')](_0x1c2c55[_0x5eb4('0x42')]);_0xf81a43[_0x5eb4('0x44')]=_[_0x5eb4('0x46')](_0xf81a43['model'],_0xf81a43[_0x5eb4('0x42')]);_0x3dfe9d['attributes']=_[_0x5eb4('0x46')](_0xf81a43[_0x5eb4('0x41')],qs[_0x5eb4('0x55')](_0x1c2c55[_0x5eb4('0x42')][_0x5eb4('0x55')]));_0x3dfe9d[_0x5eb4('0x45')]=_0x3dfe9d[_0x5eb4('0x45')][_0x5eb4('0x47')]?_0x3dfe9d[_0x5eb4('0x45')]:_0xf81a43['model'];_0x3dfe9d['order']=qs[_0x5eb4('0x49')](_0x1c2c55[_0x5eb4('0x42')][_0x5eb4('0x49')]);_0x3dfe9d[_0x5eb4('0x4a')]=qs[_0x5eb4('0x44')](_[_0x5eb4('0x4b')](_0x1c2c55['query'],_0xf81a43[_0x5eb4('0x44')]));if(_0x1c2c55[_0x5eb4('0x42')][_0x5eb4('0x4e')]){_0x3dfe9d[_0x5eb4('0x4a')]=_['merge'](_0x3dfe9d[_0x5eb4('0x4a')],{'$or':_[_0x5eb4('0x3c')](_0x3dfe9d[_0x5eb4('0x45')],function(_0x38ad9a){var _0x1eb0c8={};_0x1eb0c8[_0x38ad9a]={'$like':'%'+_0x1c2c55['query'][_0x5eb4('0x4e')]+'%'};return _0x1eb0c8;})});}_0x3dfe9d=_['merge']({},_0x3dfe9d,_0x1c2c55['options']);return _0x45909c[_0x5eb4('0xba')](_0x3dfe9d);}})[_0x5eb4('0x1c')](function(_0x5aad46){if(_0x5aad46){_0x18e074=_0x5aad46[_0x5eb4('0x47')];if(!_0x1c2c55[_0x5eb4('0x42')][_0x5eb4('0x48')](_0x5eb4('0xbb'))){_0x3dfe9d[_0x5eb4('0x2b')]=qs[_0x5eb4('0x2b')](_0x1c2c55['query'][_0x5eb4('0x2b')]);_0x3dfe9d[_0x5eb4('0x2e')]=qs[_0x5eb4('0x2e')](_0x1c2c55[_0x5eb4('0x42')][_0x5eb4('0x2e')]);}return _0x45909c[_0x5eb4('0xba')](_0x3dfe9d);}})[_0x5eb4('0x1c')](function(_0x1d80e5){if(_0x1d80e5){return _0x1d80e5?{'count':_0x18e074,'rows':_0x1d80e5}:null;}})['then'](respondWithResult(_0x16413b,null))[_0x5eb4('0x26')](handleError(_0x16413b,null));};exports[_0x5eb4('0xbc')]=function(_0x370d88,_0xe988c,_0x4ccae9){var _0x522bab={'raw':![],'where':{}};var _0x2e0b57={};var _0x188d18={'count':0x0,'rows':[]};return db['SmsAccount'][_0x5eb4('0x63')]({'where':{'id':_0x370d88[_0x5eb4('0x54')]['id']}})[_0x5eb4('0x1c')](handleEntityNotFound(_0xe988c,null))[_0x5eb4('0x1c')](function(_0x58a951){if(_0x58a951){_0x2e0b57[_0x5eb4('0x41')]=_[_0x5eb4('0x43')](db[_0x5eb4('0x9c')]['rawAttributes']);_0x2e0b57['query']=_['keys'](_0x370d88['query']);_0x2e0b57['filters']=_[_0x5eb4('0x46')](_0x2e0b57[_0x5eb4('0x41')],_0x2e0b57['query']);_0x522bab['attributes']=_['intersection'](_0x2e0b57[_0x5eb4('0x41')],qs[_0x5eb4('0x55')](_0x370d88[_0x5eb4('0x42')][_0x5eb4('0x55')]));_0x522bab[_0x5eb4('0x45')]=_0x522bab[_0x5eb4('0x45')][_0x5eb4('0x47')]?_0x522bab[_0x5eb4('0x45')]:_0x2e0b57['model'];if(!_0x370d88[_0x5eb4('0x42')]['hasOwnProperty']('nolimit')){_0x522bab[_0x5eb4('0x2b')]=qs[_0x5eb4('0x2b')](_0x370d88[_0x5eb4('0x42')][_0x5eb4('0x2b')]);_0x522bab[_0x5eb4('0x2e')]=qs['offset'](_0x370d88[_0x5eb4('0x42')][_0x5eb4('0x2e')]);}_0x522bab[_0x5eb4('0x65')]=qs[_0x5eb4('0x49')](_0x370d88['query'][_0x5eb4('0x49')]);_0x522bab[_0x5eb4('0x4a')]=qs['filters'](_['pick'](_0x370d88[_0x5eb4('0x42')],_0x2e0b57['filters']));_0x522bab[_0x5eb4('0x4a')][_0x5eb4('0x61')]=_0x58a951['id'];if(_0x370d88[_0x5eb4('0x42')]['filter']){_0x522bab[_0x5eb4('0x4a')]=_[_0x5eb4('0x4c')](_0x522bab[_0x5eb4('0x4a')],{'$or':_[_0x5eb4('0x3c')](_0x522bab[_0x5eb4('0x45')],function(_0x3f0b49){var _0x5c04b9={};_0x5c04b9[_0x3f0b49]={'$like':'%'+_0x370d88['query'][_0x5eb4('0x4e')]+'%'};return _0x5c04b9;})});}_0x522bab=_[_0x5eb4('0x4c')]({},_0x522bab,_0x370d88[_0x5eb4('0x56')]);return db[_0x5eb4('0x9c')][_0x5eb4('0x2d')]({'where':_0x522bab[_0x5eb4('0x4a')]})[_0x5eb4('0x1c')](function(_0x355085){_0x188d18[_0x5eb4('0x2d')]=_0x355085;if(_0x370d88[_0x5eb4('0x42')][_0x5eb4('0x50')]){_0x522bab['include']=[{'model':db[_0x5eb4('0x96')],'as':_0x5eb4('0xbd'),'required':![]},{'model':db[_0x5eb4('0xbe')],'as':_0x5eb4('0xbf'),'attributes':[_0x5eb4('0x39'),'fullname','internal'],'required':![]},{'model':db[_0x5eb4('0xc0')],'as':_0x5eb4('0xc1'),'attributes':['id',_0x5eb4('0x39'),'color'],'where':_0x370d88[_0x5eb4('0x42')]['tag']?{'id':_0x370d88[_0x5eb4('0x42')][_0x5eb4('0xc2')]}:undefined,'required':_0x370d88[_0x5eb4('0x42')][_0x5eb4('0xc2')]?!![]:![]}];}return db['SmsInteraction'][_0x5eb4('0x66')](_0x522bab);})['then'](function(_0x142b00){_0x188d18[_0x5eb4('0x52')]=_0x142b00;return _0x188d18;});}})[_0x5eb4('0x1c')](respondWithFilteredResult(_0xe988c,_0x522bab))['catch'](handleError(_0xe988c,null));};exports[_0x5eb4('0xb1')]=function(_0x3c2668,_0x258d11,_0x2dee31){var _0x17db79,_0x1113c5,_0x2e7212;if(_[_0x5eb4('0x8f')](_0x3c2668[_0x5eb4('0x5d')][_0x5eb4('0x5d')])||_0x3c2668[_0x5eb4('0x5d')]['body']===''){throw new db['Sequelize'][(_0x5eb4('0x73'))](_0x5eb4('0x91'));}if(_['isNil'](_0x3c2668[_0x5eb4('0x5d')]['to'])){throw new db[(_0x5eb4('0x72'))][(_0x5eb4('0x73'))](_0x5eb4('0xc3'));}_0x17db79=_0x3c2668[_0x5eb4('0x5d')]['to'];return db[_0x5eb4('0x4f')][_0x5eb4('0x5e')]({'where':{'id':_0x3c2668[_0x5eb4('0x54')]['id']},'include':[{'model':db[_0x5eb4('0x95')],'as':_0x5eb4('0xc4'),'include':[{'model':db[_0x5eb4('0x96')],'as':'Contacts','where':{'mobile':_0x17db79},'limit':0x1,'order':[[_0x5eb4('0x77'),_0x5eb4('0x97')]]}]}]})[_0x5eb4('0x1c')](handleEntityNotFound(_0x258d11,null))[_0x5eb4('0x1c')](function(_0x359e94){if(_0x359e94&&_0x359e94[_0x5eb4('0xc4')]){_0x1113c5=_0x359e94[_0x5eb4('0x34')]({'plain':!![]});if(_0x1113c5[_0x5eb4('0xc4')]&&_0x1113c5[_0x5eb4('0xc4')][_0x5eb4('0x9a')]['length']){return _0x1113c5[_0x5eb4('0xc4')][_0x5eb4('0x9a')][0x0];}return db[_0x5eb4('0x96')][_0x5eb4('0x57')](_[_0x5eb4('0x15')](_0x3c2668[_0x5eb4('0x5d')],{'firstName':_0x17db79,'mobile':_0x17db79,'phone':_0x17db79,'ListId':_0x1113c5[_0x5eb4('0x78')]}));}})['then'](handleEntityNotFound(_0x258d11,null))[_0x5eb4('0x1c')](function(_0x3a6a1f){if(_0x3a6a1f){_0x2e7212=_0x3a6a1f;return db[_0x5eb4('0x9c')][_0x5eb4('0x5e')]({'where':{'ContactId':_0x2e7212['id'],'closed':![],'SmsAccountId':_0x1113c5['id']}})[_0x5eb4('0x1c')](function(_0x288a3e){if(_0x288a3e){return[_0x288a3e,![]];}return db[_0x5eb4('0x9c')][_0x5eb4('0x57')]({'UserId':_0x3c2668['user']['id'],'ContactId':_0x2e7212['id'],'SmsAccountId':_0x1113c5['id'],'phone':_0x17db79,'firstMsgDirection':_0x5eb4('0xc5'),'Messages':[_[_0x5eb4('0x4c')](_0x3c2668['body'],{'read':![],'body':_0x3c2668[_0x5eb4('0x5d')][_0x5eb4('0x5d')],'phone':_0x17db79,'SmsAccountId':_0x1113c5['id'],'UserId':_0x3c2668[_0x5eb4('0x58')]['id'],'ContactId':_0x2e7212['id']})]},{'include':[{'model':db[_0x5eb4('0xa4')],'as':'Messages'}]})['then'](function(_0x3647d6){return[_0x3647d6,!![]];});});}})[_0x5eb4('0x9d')](function(_0x2abe2a,_0x5382e4){if(_0x5382e4){return _0x2abe2a;}return db['SmsMessage']['create'](_[_0x5eb4('0x4c')](_0x3c2668[_0x5eb4('0x5d')],{'read':![],'body':_0x3c2668[_0x5eb4('0x5d')][_0x5eb4('0x5d')],'phone':_0x17db79,'SmsAccountId':_0x1113c5['id'],'SmsInteractionId':_0x2abe2a['id'],'UserId':_0x3c2668['user']['id'],'ContactId':_0x2e7212['id']}))['then'](function(_0x5bebd0){_0x2abe2a[_0x5eb4('0xc6')][_0x5eb4('0xc7')]=[];_0x2abe2a[_0x5eb4('0xc6')]['Messages'][_0x5eb4('0xa1')](_0x5bebd0[_0x5eb4('0xc6')]);return _0x2abe2a;});})[_0x5eb4('0x1c')](respondWithResult(_0x258d11,null))[_0x5eb4('0x26')](handleError(_0x258d11,null));};exports['status']=function(_0x3ccbd9,_0xef6c11,_0xf02862){if(_0x3ccbd9['body']['id']){delete _0x3ccbd9['body']['id'];}var _0x404920,_0x1f145d,_0x194fee;return db[_0x5eb4('0x4f')]['find']({'where':{'id':_0x3ccbd9[_0x5eb4('0x54')]['id']}})[_0x5eb4('0x1c')](handleEntityNotFound(_0xef6c11,null))[_0x5eb4('0x1c')](function(_0x5ecf99){if(_0x5ecf99){_0x194fee=_0x5ecf99;logger[_0x5eb4('0x20')](_0x5eb4('0xab'),_0x5eb4('0x28'),_0x5eb4('0xc8'),_0x5ecf99[_0x5eb4('0x3f')],util[_0x5eb4('0xc9')](_0x3ccbd9[_0x5eb4('0x5d')],{'showHidden':![],'depth':null}));switch(_0x5ecf99[_0x5eb4('0x3f')]){case _0x5eb4('0x7e'):if(_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0xca')]&&_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0x28')]){_0x1f145d=_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0x28')];return db[_0x5eb4('0xa4')][_0x5eb4('0x5e')]({'where':{'messageId':_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0xca')]}});}break;case _0x5eb4('0x81'):if(_0x3ccbd9['body'][_0x5eb4('0xcb')]&&_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0xcc')]){_0x1f145d=_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0xcc')];return db[_0x5eb4('0xa4')][_0x5eb4('0x5e')]({'where':{'messageId':_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0xcb')]}});}break;case'clicksend':if(_0x3ccbd9['body']['message_id']&&_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0xcd')]){_0x1f145d=_0x3ccbd9['body'][_0x5eb4('0xcd')];return db[_0x5eb4('0xa4')][_0x5eb4('0x5e')]({'where':{'messageId':_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0x83')]}});}break;case'infobip':var _0x32ea00=_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0x88')][0x0];if(_0x32ea00['messageId']&&_0x32ea00[_0x5eb4('0x28')][_0x5eb4('0xce')]===_0x5eb4('0xcf')){_0x1f145d=_0x32ea00['status'][_0x5eb4('0xce')];return db['SmsMessage'][_0x5eb4('0x5e')]({'where':{'messageId':_0x32ea00[_0x5eb4('0x7c')]}});}break;case _0x5eb4('0x8c'):if(_0x3ccbd9[_0x5eb4('0x5d')]['messageId']&&_0x3ccbd9['body']['status']){_0x1f145d=_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0x28')];return db[_0x5eb4('0xa4')][_0x5eb4('0x5e')]({'where':{'messageId':_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0x7c')]}});}break;case _0x5eb4('0xd0'):if(_0x3ccbd9[_0x5eb4('0x5d')][0x0][_0x5eb4('0x24')]['id']){_0x1f145d=_0x3ccbd9[_0x5eb4('0x5d')][0x0][_0x5eb4('0x3f')];return db[_0x5eb4('0xa4')][_0x5eb4('0x5e')]({'where':{'messageId':_0x3ccbd9[_0x5eb4('0x5d')][0x0]['message']['id']}});}break;case _0x5eb4('0x8e'):if(_0x3ccbd9['body'][_0x5eb4('0xd1')]&&_0x3ccbd9[_0x5eb4('0x5d')]['status']){_0x1f145d=_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0x28')];return db[_0x5eb4('0xa4')]['find']({'where':{'messageId':_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0xd1')]}});}break;}}})[_0x5eb4('0x1c')](handleEntityNotFound(_0xef6c11,null))[_0x5eb4('0x1c')](function(_0x5e1774){if(_0x5e1774){_0x404920=_0x5e1774;switch(_0x194fee['type']){case _0x5eb4('0x7e'):if(_0x1f145d===_0x5eb4('0xcf')){return _0x404920['update']({'read':!![]});}else{logger[_0x5eb4('0x22')](_0x5eb4('0xab'),_0x5eb4('0x28'),_0x5eb4('0x7e'),util[_0x5eb4('0xc9')](_0x3ccbd9[_0x5eb4('0x5d')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x1f145d==='1'){return _0x404920[_0x5eb4('0x33')]({'read':!![]});}else{logger[_0x5eb4('0x22')](_0x5eb4('0xab'),'status',_0x5eb4('0x7e'),util['inspect'](_0x3ccbd9[_0x5eb4('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x5eb4('0x82'):if(!_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0xd2')]&&_0x1f145d>=0xc8&&_0x1f145d<=0xce){return _0x404920[_0x5eb4('0x33')]({'read':!![]});}else{logger[_0x5eb4('0x22')](_0x5eb4('0xab'),'status','clicksend',util[_0x5eb4('0xc9')](_0x3ccbd9[_0x5eb4('0x5d')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x222b4c=_0x3ccbd9[_0x5eb4('0x5d')][_0x5eb4('0x88')][0x0];if(_0x222b4c[_0x5eb4('0x28')][_0x5eb4('0xce')]===_0x5eb4('0xcf')){return _0x404920[_0x5eb4('0x33')]({'read':!![]});}else{logger[_0x5eb4('0x22')](_0x5eb4('0xab'),_0x5eb4('0x28'),_0x5eb4('0x87'),util['inspect'](_0x3ccbd9[_0x5eb4('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x5eb4('0x8c'):if(_0x1f145d==_0x5eb4('0xd3')||_0x1f145d==_0x5eb4('0xd4')){return _0x404920[_0x5eb4('0x33')]({'read':!![]});}else{logger[_0x5eb4('0x22')](_0x5eb4('0xab'),_0x5eb4('0x28'),_0x5eb4('0x8c'),util[_0x5eb4('0xc9')](_0x3ccbd9[_0x5eb4('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x5eb4('0xd0'):if(_0x1f145d==_0x5eb4('0xd5')){return _0x404920[_0x5eb4('0x33')]({'read':!![]});}else{logger[_0x5eb4('0x22')](_0x5eb4('0xab'),_0x5eb4('0x28'),_0x5eb4('0xd0'),util[_0x5eb4('0xc9')](_0x3ccbd9[_0x5eb4('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x5eb4('0x8e'):if(_0x1f145d===_0x5eb4('0xd6')||_0x1f145d===_0x5eb4('0xd7')){return _0x404920[_0x5eb4('0x33')]({'read':!![]});}else{logger['error'](_0x5eb4('0xab'),'status',_0x5eb4('0x8e'),util[_0x5eb4('0xc9')](_0x3ccbd9[_0x5eb4('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x404920;}})[_0x5eb4('0x1c')](respondWithResult(_0xef6c11,null))['catch'](handleError(_0xef6c11,null));};exports[_0x5eb4('0xd8')]=function(_0x1b013f,_0x1e649f,_0x3cd88a){var _0x1e461d,_0x2528ab,_0x72f797;return db[_0x5eb4('0x4f')][_0x5eb4('0x5e')]({'where':{'id':_0x1b013f[_0x5eb4('0x54')]['id']}})[_0x5eb4('0x1c')](handleEntityNotFound(_0x1e649f,null))[_0x5eb4('0x1c')](function(_0x176083){if(_0x176083){_0x72f797=_0x176083;logger[_0x5eb4('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5eb4('0x28'),_0x5eb4('0xc8'),_0x176083['type'],util[_0x5eb4('0xc9')](_0x1b013f['query'],{'showHidden':![],'depth':null}));switch(_0x176083[_0x5eb4('0x3f')]){case _0x5eb4('0x89'):if(_0x1b013f['query'][_0x5eb4('0xd9')]&&_0x1b013f[_0x5eb4('0x42')][_0x5eb4('0xda')]){_0x2528ab=_0x1b013f['query'][_0x5eb4('0xda')];return db['SmsMessage'][_0x5eb4('0x5e')]({'where':{'messageId':_0x1b013f[_0x5eb4('0x42')][_0x5eb4('0xd9')]}});}break;}}})[_0x5eb4('0x1c')](handleEntityNotFound(_0x1e649f,null))[_0x5eb4('0x1c')](function(_0x136657){if(_0x136657){_0x1e461d=_0x136657;switch(_0x72f797[_0x5eb4('0x3f')]){case _0x5eb4('0x89'):if(_0x2528ab==='2'||_0x2528ab==='6'){return _0x1e461d[_0x5eb4('0x33')]({'read':!![]});}else{logger[_0x5eb4('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5eb4('0x28'),_0x5eb4('0x89'),util['inspect'](_0x1b013f['query'],{'showHidden':![],'depth':null}));};break;}return _0x1e461d;}})['then'](respondWithResult(_0x1e649f,null))['catch'](handleError(_0x1e649f,null));};exports[_0x5eb4('0xdb')]=function(_0x32f8a3,_0x41a416,_0x36d17b){return db[_0x5eb4('0x4f')][_0x5eb4('0x5e')]({'where':{'id':_0x32f8a3['params']['id']}})[_0x5eb4('0x1c')](handleEntityNotFound(_0x41a416,null))['then'](function(_0x513fb6){if(_0x513fb6){return _0x513fb6['addAgents'](_0x32f8a3['body'][_0x5eb4('0x68')],_[_0x5eb4('0x99')](_0x32f8a3[_0x5eb4('0x5d')],[_0x5eb4('0x68'),'id'])||{})['spread'](function(_0x237ec1){for(var _0x1fff38=0x0;_0x1fff38<_0x32f8a3['body'][_0x5eb4('0x68')][_0x5eb4('0x47')];_0x1fff38+=0x1){socket[_0x5eb4('0xdc')](_0x5eb4('0xdd'),{'UserId':Number(_0x32f8a3[_0x5eb4('0x5d')][_0x5eb4('0x68')][_0x1fff38]),'SmsAccountId':Number(_0x32f8a3[_0x5eb4('0x54')]['id'])});}return _0x237ec1;});}})[_0x5eb4('0x1c')](respondWithResult(_0x41a416,null))[_0x5eb4('0x26')](handleError(_0x41a416,null));};exports[_0x5eb4('0xde')]=function(_0xb2ec0b,_0xb4d50c,_0x20f89e){return db[_0x5eb4('0x4f')][_0x5eb4('0x5e')]({'where':{'id':_0xb2ec0b[_0x5eb4('0x54')]['id']}})['then'](handleEntityNotFound(_0xb4d50c,null))['then'](function(_0x20e9af){if(_0x20e9af){return _0x20e9af[_0x5eb4('0xde')](_0xb2ec0b[_0x5eb4('0x42')][_0x5eb4('0x68')])[_0x5eb4('0x1c')](function(){if(_[_0x5eb4('0xdf')](_0xb2ec0b[_0x5eb4('0x42')][_0x5eb4('0x68')])){for(var _0x2ef2b7=0x0;_0x2ef2b7<_0xb2ec0b[_0x5eb4('0x42')][_0x5eb4('0x68')][_0x5eb4('0x47')];_0x2ef2b7+=0x1){socket[_0x5eb4('0xdc')]('userSmsAccount:remove',{'UserId':Number(_0xb2ec0b[_0x5eb4('0x42')][_0x5eb4('0x68')][_0x2ef2b7]),'SmsAccountId':Number(_0xb2ec0b[_0x5eb4('0x54')]['id'])});}}else{socket['emit'](_0x5eb4('0xe0'),{'UserId':Number(_0xb2ec0b[_0x5eb4('0x42')][_0x5eb4('0x68')]),'SmsAccountId':Number(_0xb2ec0b[_0x5eb4('0x54')]['id'])});}});}})[_0x5eb4('0x1c')](respondWithStatusCode(_0xb4d50c,null))['catch'](handleError(_0xb4d50c,null));};exports[_0x5eb4('0xe1')]=function(_0x25b2c7,_0x27cc7b,_0x2d411c){var _0x38026c={};var _0x462e2b={};var _0x2f6078;var _0x2908b4;return db[_0x5eb4('0x4f')]['findOne']({'where':{'id':_0x25b2c7[_0x5eb4('0x54')]['id']}})['then'](handleEntityNotFound(_0x27cc7b,null))[_0x5eb4('0x1c')](function(_0x514b7c){if(_0x514b7c){_0x2f6078=_0x514b7c;_0x462e2b[_0x5eb4('0x41')]=_[_0x5eb4('0x43')](db['User']['rawAttributes']);_0x462e2b[_0x5eb4('0x42')]=_[_0x5eb4('0x43')](_0x25b2c7[_0x5eb4('0x42')]);_0x462e2b[_0x5eb4('0x44')]=_['intersection'](_0x462e2b[_0x5eb4('0x41')],_0x462e2b[_0x5eb4('0x42')]);_0x38026c[_0x5eb4('0x45')]=_[_0x5eb4('0x46')](_0x462e2b[_0x5eb4('0x41')],qs['fields'](_0x25b2c7[_0x5eb4('0x42')][_0x5eb4('0x55')]));_0x38026c[_0x5eb4('0x45')]=_0x38026c['attributes'][_0x5eb4('0x47')]?_0x38026c[_0x5eb4('0x45')]:_0x462e2b[_0x5eb4('0x41')];_0x38026c[_0x5eb4('0x65')]=qs[_0x5eb4('0x49')](_0x25b2c7[_0x5eb4('0x42')][_0x5eb4('0x49')]);_0x38026c[_0x5eb4('0x4a')]=qs[_0x5eb4('0x44')](_[_0x5eb4('0x4b')](_0x25b2c7['query'],_0x462e2b[_0x5eb4('0x44')]));if(_0x25b2c7[_0x5eb4('0x42')]['filter']){_0x38026c['where']=_[_0x5eb4('0x4c')](_0x38026c[_0x5eb4('0x4a')],{'$or':_['map'](_0x38026c[_0x5eb4('0x45')],function(_0x559903){var _0x1441bf={};_0x1441bf[_0x559903]={'$like':'%'+_0x25b2c7['query'][_0x5eb4('0x4e')]+'%'};return _0x1441bf;})});}_0x38026c=_['merge']({},_0x38026c,_0x25b2c7[_0x5eb4('0x56')]);return _0x2f6078[_0x5eb4('0xe1')](_0x38026c);}})[_0x5eb4('0x1c')](function(_0x57ab24){if(_0x57ab24){_0x2908b4=_0x57ab24[_0x5eb4('0x47')];if(!_0x25b2c7['query'][_0x5eb4('0x48')](_0x5eb4('0xbb'))){_0x38026c['limit']=qs[_0x5eb4('0x2b')](_0x25b2c7[_0x5eb4('0x42')]['limit']);_0x38026c[_0x5eb4('0x2e')]=qs[_0x5eb4('0x2e')](_0x25b2c7['query'][_0x5eb4('0x2e')]);}return _0x2f6078[_0x5eb4('0xe1')](_0x38026c);}})['then'](function(_0xcdb696){if(_0xcdb696){return _0xcdb696?{'count':_0x2908b4,'rows':_0xcdb696}:null;}})['then'](respondWithResult(_0x27cc7b,null))[_0x5eb4('0x26')](handleError(_0x27cc7b,null));}; \ No newline at end of file +var _0x8d44=['agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','Content-Type','text/xml','send','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','finally','getApplications','Contact','Owner','Tag','Tags','color','tag','List','Messages','dataValues','skebby_dispatch_id','statusInt','message_id','status_code','DELIVERED','intelepeer','redif','inspect','error_code','groupName','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','sendStatus','stack','name','index','Pause','map','SmsAccount','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','SmsAccountId','Disposition','getDispositions','findOne','order','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','Applications','account','orderBy','priority','asc','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','skebby','sender','text','connectel','clicksend','plivo','Text','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','SmsMessage','UserId','User','unshift'];(function(_0x4fe5c0,_0xfa2a3a){var _0x2f4af4=function(_0x23e20a){while(--_0x23e20a){_0x4fe5c0['push'](_0x4fe5c0['shift']());}};_0x2f4af4(++_0xfa2a3a);}(_0x8d44,0x11c));var _0x48d4=function(_0x1216c3,_0x1c2b79){_0x1216c3=_0x1216c3-0x0;var _0x48857c=_0x8d44[_0x1216c3];return _0x48857c;};'use strict';var emlformat=require(_0x48d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48d4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48d4('0x2'));var moment=require('moment');var BPromise=require(_0x48d4('0x3'));var Mustache=require(_0x48d4('0x4'));var util=require(_0x48d4('0x5'));var path=require(_0x48d4('0x6'));var sox=require(_0x48d4('0x7'));var csv=require(_0x48d4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x48d4('0x9'));var squel=require(_0x48d4('0xa'));var crypto=require(_0x48d4('0xb'));var jsforce=require(_0x48d4('0xc'));var deskjs=require(_0x48d4('0xd'));var toCsv=require(_0x48d4('0x8'));var querystring=require('querystring');var Papa=require(_0x48d4('0xe'));var Redis=require(_0x48d4('0xf'));var authService=require(_0x48d4('0x10'));var qs=require(_0x48d4('0x11'));var as=require(_0x48d4('0x12'));var hardwareService=require(_0x48d4('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x48d4('0x14'));var config=require(_0x48d4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x48d4('0x16'))['db'];config[_0x48d4('0x17')]=_[_0x48d4('0x18')](config[_0x48d4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x48d4('0x19'))(new Redis(config[_0x48d4('0x17')]));require(_0x48d4('0x1a'))[_0x48d4('0x1b')](socket);var jayson=require(_0x48d4('0x1c'));var client=jayson[_0x48d4('0x1d')][_0x48d4('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x49086a,_0x3a8fdf,_0xe33da9,_0x3f8091){return new BPromise(function(_0x3ea07b,_0x4f5a6d){var _0x13cd68=_0x3f8091||client;return _0x13cd68[_0x48d4('0x1f')](_0x49086a,_0xe33da9)[_0x48d4('0x20')](function(_0x540c94){logger[_0x48d4('0x21')](_0x48d4('0x22'),_0x3a8fdf,_0x48d4('0x23'));logger['debug'](_0x48d4('0x24'),_0x3a8fdf,_0x48d4('0x23'),JSON[_0x48d4('0x25')](_0x540c94));if(_0x540c94['error']){if(_0x540c94[_0x48d4('0x26')][_0x48d4('0x27')]===0x1f4){logger[_0x48d4('0x26')](_0x48d4('0x22'),_0x3a8fdf,_0x540c94[_0x48d4('0x26')]['message']);return _0x4f5a6d(_0x540c94['error']['message']);}logger[_0x48d4('0x26')](_0x48d4('0x22'),_0x3a8fdf,_0x540c94[_0x48d4('0x26')][_0x48d4('0x28')]);return _0x3ea07b(_0x540c94[_0x48d4('0x26')][_0x48d4('0x28')]);}else{logger[_0x48d4('0x21')](_0x48d4('0x22'),_0x3a8fdf,_0x48d4('0x23'));_0x3ea07b(_0x540c94[_0x48d4('0x29')][_0x48d4('0x28')]);}})[_0x48d4('0x2a')](function(_0x4594de){logger[_0x48d4('0x26')]('SmsAccount,\x20%s,\x20%s',_0x3a8fdf,_0x4594de);_0x4f5a6d(_0x4594de);});});}function respondWithStatusCode(_0x339a63,_0x33660d){_0x33660d=_0x33660d||0xcc;return function(_0x3eae53){if(_0x3eae53){return _0x339a63['sendStatus'](_0x33660d);}return _0x339a63[_0x48d4('0x2b')](_0x33660d)[_0x48d4('0x2c')]();};}function respondWithResult(_0x59dc1e,_0x445299){_0x445299=_0x445299||0xc8;return function(_0x254bd3){if(_0x254bd3){return _0x59dc1e['status'](_0x445299)[_0x48d4('0x2d')](_0x254bd3);}};}function respondWithFilteredResult(_0x25f9e0,_0xda08af){return function(_0xe204e3){if(_0xe204e3){var _0x57e5b8=typeof _0xda08af[_0x48d4('0x2e')]==='undefined'&&typeof _0xda08af[_0x48d4('0x2f')]==='undefined';var _0x7e06e3=_0xe204e3[_0x48d4('0x30')];var _0x242b10=_0x57e5b8?0x0:_0xda08af['offset'];var _0x3d2f5e=_0x57e5b8?_0xe204e3['count']:_0xda08af[_0x48d4('0x2e')]+_0xda08af[_0x48d4('0x2f')];var _0x11644e;if(_0x3d2f5e>=_0x7e06e3){_0x3d2f5e=_0x7e06e3;_0x11644e=0xc8;}else{_0x11644e=0xce;}_0x25f9e0[_0x48d4('0x2b')](_0x11644e);return _0x25f9e0[_0x48d4('0x31')](_0x48d4('0x32'),_0x242b10+'-'+_0x3d2f5e+'/'+_0x7e06e3)['json'](_0xe204e3);}return null;};}function patchUpdates(_0x1eaea5){return function(_0x5233a3){try{jsonpatch[_0x48d4('0x33')](_0x5233a3,_0x1eaea5,!![]);}catch(_0x25c8a2){return BPromise[_0x48d4('0x34')](_0x25c8a2);}return _0x5233a3[_0x48d4('0x35')]();};}function saveUpdates(_0x18b655,_0x5b18ef){return function(_0x396a1a){if(_0x396a1a){return _0x396a1a[_0x48d4('0x36')](_0x18b655)[_0x48d4('0x20')](function(_0x2c0514){return _0x2c0514;});}return null;};}function removeEntity(_0x3df49e,_0x103612){return function(_0x1feeb4){if(_0x1feeb4){return _0x1feeb4[_0x48d4('0x37')]()[_0x48d4('0x20')](function(){var _0x42c505=_0x1feeb4[_0x48d4('0x38')]({'plain':!![]});var _0x34684b=_0x48d4('0x39');return db['UserProfileResource']['destroy']({'where':{'type':_0x34684b,'resourceId':_0x42c505['id']}})[_0x48d4('0x20')](function(){return _0x1feeb4;});})[_0x48d4('0x20')](function(){_0x3df49e[_0x48d4('0x2b')](0xcc)[_0x48d4('0x2c')]();});}};}function handleEntityNotFound(_0x25d280,_0x35d407){return function(_0x43a6a1){if(!_0x43a6a1){_0x25d280[_0x48d4('0x3a')](0x194);}return _0x43a6a1;};}function handleError(_0x360ed0,_0x37c5cb){_0x37c5cb=_0x37c5cb||0x1f4;return function(_0x3964b7){logger[_0x48d4('0x26')](_0x3964b7[_0x48d4('0x3b')]);if(_0x3964b7[_0x48d4('0x3c')]){delete _0x3964b7['name'];}_0x360ed0['status'](_0x37c5cb)['send'](_0x3964b7);};}exports[_0x48d4('0x3d')]=function(_0x496694,_0x24dff0){var _0x222415={'include':[{'model':db[_0x48d4('0x3e')],'as':'mandatoryDispositionPause'}]},_0x595c2c={},_0x5f8bad={'count':0x0,'rows':[]};var _0x383ad7=_[_0x48d4('0x3f')](db[_0x48d4('0x40')][_0x48d4('0x41')],function(_0x5bfa6a){return{'name':_0x5bfa6a['fieldName'],'type':_0x5bfa6a[_0x48d4('0x42')][_0x48d4('0x43')]};});_0x595c2c[_0x48d4('0x44')]=_[_0x48d4('0x3f')](_0x383ad7,_0x48d4('0x3c'));_0x595c2c[_0x48d4('0x45')]=_['keys'](_0x496694[_0x48d4('0x45')]);_0x595c2c[_0x48d4('0x46')]=_[_0x48d4('0x47')](_0x595c2c[_0x48d4('0x44')],_0x595c2c[_0x48d4('0x45')]);_0x222415['attributes']=_[_0x48d4('0x47')](_0x595c2c[_0x48d4('0x44')],qs[_0x48d4('0x48')](_0x496694[_0x48d4('0x45')]['fields']));_0x222415[_0x48d4('0x49')]=_0x222415[_0x48d4('0x49')][_0x48d4('0x4a')]?_0x222415[_0x48d4('0x49')]:_0x595c2c[_0x48d4('0x44')];if(!_0x496694[_0x48d4('0x45')][_0x48d4('0x4b')](_0x48d4('0x4c'))){_0x222415[_0x48d4('0x2f')]=qs['limit'](_0x496694[_0x48d4('0x45')][_0x48d4('0x2f')]);_0x222415[_0x48d4('0x2e')]=qs[_0x48d4('0x2e')](_0x496694[_0x48d4('0x45')][_0x48d4('0x2e')]);}_0x222415['order']=qs[_0x48d4('0x4d')](_0x496694[_0x48d4('0x45')][_0x48d4('0x4d')]);_0x222415[_0x48d4('0x4e')]=qs[_0x48d4('0x46')](_['pick'](_0x496694[_0x48d4('0x45')],_0x595c2c[_0x48d4('0x46')]),_0x383ad7);if(_0x496694[_0x48d4('0x45')][_0x48d4('0x4f')]){_0x222415[_0x48d4('0x4e')]=_[_0x48d4('0x50')](_0x222415['where'],{'$or':_[_0x48d4('0x3f')](_0x383ad7,function(_0x49d193){if(_0x49d193[_0x48d4('0x42')]!==_0x48d4('0x51')){var _0x314c65={};_0x314c65[_0x49d193[_0x48d4('0x3c')]]={'$like':'%'+_0x496694[_0x48d4('0x45')][_0x48d4('0x4f')]+'%'};return _0x314c65;}})});}_0x222415=_[_0x48d4('0x50')]({},_0x222415,_0x496694[_0x48d4('0x52')]);var _0x2be367={'where':_0x222415[_0x48d4('0x4e')]};return db[_0x48d4('0x40')][_0x48d4('0x30')](_0x2be367)[_0x48d4('0x20')](function(_0xfa7a23){_0x5f8bad['count']=_0xfa7a23;if(_0x496694[_0x48d4('0x45')][_0x48d4('0x53')]){_0x222415[_0x48d4('0x54')]=[{'all':!![]}];}return db['SmsAccount'][_0x48d4('0x55')](_0x222415);})[_0x48d4('0x20')](function(_0x45eefe){_0x5f8bad[_0x48d4('0x56')]=_0x45eefe;return _0x5f8bad;})['then'](respondWithFilteredResult(_0x24dff0,_0x222415))[_0x48d4('0x2a')](handleError(_0x24dff0,null));};exports[_0x48d4('0x57')]=function(_0x18fe41,_0x527c2b){var _0x316186={'raw':![],'where':{'id':_0x18fe41[_0x48d4('0x58')]['id']},'include':[{'model':db[_0x48d4('0x3e')],'as':'mandatoryDispositionPause'}]},_0x790c19={};_0x790c19[_0x48d4('0x44')]=_[_0x48d4('0x59')](db['SmsAccount'][_0x48d4('0x41')]);_0x790c19[_0x48d4('0x45')]=_[_0x48d4('0x59')](_0x18fe41['query']);_0x790c19[_0x48d4('0x46')]=_['intersection'](_0x790c19[_0x48d4('0x44')],_0x790c19[_0x48d4('0x45')]);_0x316186[_0x48d4('0x49')]=_[_0x48d4('0x47')](_0x790c19[_0x48d4('0x44')],qs['fields'](_0x18fe41[_0x48d4('0x45')][_0x48d4('0x48')]));_0x316186[_0x48d4('0x49')]=_0x316186[_0x48d4('0x49')][_0x48d4('0x4a')]?_0x316186[_0x48d4('0x49')]:_0x790c19[_0x48d4('0x44')];if(_0x18fe41['query'][_0x48d4('0x53')]){_0x316186[_0x48d4('0x54')]=[{'all':!![]}];}_0x316186=_[_0x48d4('0x50')]({},_0x316186,_0x18fe41[_0x48d4('0x52')]);return db[_0x48d4('0x40')][_0x48d4('0x5a')](_0x316186)['then'](handleEntityNotFound(_0x527c2b,null))[_0x48d4('0x20')](respondWithResult(_0x527c2b,null))[_0x48d4('0x2a')](handleError(_0x527c2b,null));};exports[_0x48d4('0x5b')]=function(_0x13ad45,_0x4de0d6){return db[_0x48d4('0x40')][_0x48d4('0x5b')](_0x13ad45[_0x48d4('0x5c')],{})[_0x48d4('0x20')](function(_0x2c4bbf){var _0x335a97=_0x13ad45[_0x48d4('0x5d')][_0x48d4('0x38')]({'plain':!![]});if(!_0x335a97)throw new Error(_0x48d4('0x5e'));if(_0x335a97[_0x48d4('0x5f')]==='user'){var _0x46f34a=_0x2c4bbf[_0x48d4('0x38')]({'plain':!![]});var _0x332f0e='SmsAccounts';return db[_0x48d4('0x60')][_0x48d4('0x5a')]({'where':{'name':_0x332f0e,'userProfileId':_0x335a97[_0x48d4('0x61')]},'raw':!![]})['then'](function(_0x42bc03){if(_0x42bc03&&_0x42bc03[_0x48d4('0x62')]===0x0){return db['UserProfileResource'][_0x48d4('0x5b')]({'name':_0x46f34a[_0x48d4('0x3c')],'resourceId':_0x46f34a['id'],'type':_0x42bc03[_0x48d4('0x3c')],'sectionId':_0x42bc03['id']},{})[_0x48d4('0x20')](function(){return _0x2c4bbf;});}else{return _0x2c4bbf;}})['catch'](function(_0x152f79){logger[_0x48d4('0x26')](_0x48d4('0x63'),_0x152f79);throw _0x152f79;});}return _0x2c4bbf;})[_0x48d4('0x20')](respondWithResult(_0x4de0d6,0xc9))['catch'](handleError(_0x4de0d6,null));};exports[_0x48d4('0x36')]=function(_0x145a24,_0x19e61c){if(_0x145a24['body']['id']){delete _0x145a24[_0x48d4('0x5c')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x145a24[_0x48d4('0x58')]['id']},'include':[{'model':db[_0x48d4('0x3e')],'as':_0x48d4('0x64')}]})[_0x48d4('0x20')](handleEntityNotFound(_0x19e61c,null))[_0x48d4('0x20')](saveUpdates(_0x145a24[_0x48d4('0x5c')],null))[_0x48d4('0x20')](respondWithResult(_0x19e61c,null))[_0x48d4('0x2a')](handleError(_0x19e61c,null));};exports[_0x48d4('0x37')]=function(_0x47afa7,_0x1125e1){return db['SmsAccount'][_0x48d4('0x5a')]({'where':{'id':_0x47afa7[_0x48d4('0x58')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x1125e1,null))[_0x48d4('0x20')](removeEntity(_0x1125e1,null))[_0x48d4('0x2a')](handleError(_0x1125e1,null));};exports['describe']=function(_0x4eeb33,_0x359786){return db[_0x48d4('0x40')]['describe']()[_0x48d4('0x20')](respondWithResult(_0x359786,null))[_0x48d4('0x2a')](handleError(_0x359786,null));};exports['addDisposition']=function(_0x5ebdeb,_0x19a5fa,_0x5b7903){if(_0x5ebdeb[_0x48d4('0x5c')]['id']){delete _0x5ebdeb[_0x48d4('0x5c')]['id'];}return db[_0x48d4('0x40')][_0x48d4('0x5a')]({'where':{'id':_0x5ebdeb[_0x48d4('0x58')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x19a5fa,null))[_0x48d4('0x20')](function(_0x5e376c){if(_0x5e376c){_0x5ebdeb[_0x48d4('0x5c')][_0x48d4('0x65')]=_0x5e376c['id'];return db[_0x48d4('0x66')][_0x48d4('0x5b')](_0x5ebdeb['body']);}})[_0x48d4('0x20')](respondWithResult(_0x19a5fa,null))[_0x48d4('0x2a')](handleError(_0x19a5fa,null));};exports[_0x48d4('0x67')]=function(_0x1f2365,_0x3b02bc,_0x1059fd){var _0x4b71f7={'raw':![],'where':{}};var _0x107888={};var _0x2a4a4d={'count':0x0,'rows':[]};return db[_0x48d4('0x40')][_0x48d4('0x68')]({'where':{'id':_0x1f2365[_0x48d4('0x58')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x3b02bc,null))['then'](function(_0x2815db){if(_0x2815db){_0x107888[_0x48d4('0x44')]=_[_0x48d4('0x59')](db['Disposition'][_0x48d4('0x41')]);_0x107888[_0x48d4('0x45')]=_[_0x48d4('0x59')](_0x1f2365[_0x48d4('0x45')]);_0x107888[_0x48d4('0x46')]=_[_0x48d4('0x47')](_0x107888[_0x48d4('0x44')],_0x107888[_0x48d4('0x45')]);_0x4b71f7['attributes']=_[_0x48d4('0x47')](_0x107888[_0x48d4('0x44')],qs[_0x48d4('0x48')](_0x1f2365[_0x48d4('0x45')]['fields']));_0x4b71f7[_0x48d4('0x49')]=_0x4b71f7[_0x48d4('0x49')][_0x48d4('0x4a')]?_0x4b71f7[_0x48d4('0x49')]:_0x107888[_0x48d4('0x44')];if(!_0x1f2365[_0x48d4('0x45')][_0x48d4('0x4b')](_0x48d4('0x4c'))){_0x4b71f7[_0x48d4('0x2f')]=qs[_0x48d4('0x2f')](_0x1f2365['query'][_0x48d4('0x2f')]);_0x4b71f7[_0x48d4('0x2e')]=qs[_0x48d4('0x2e')](_0x1f2365[_0x48d4('0x45')][_0x48d4('0x2e')]);}_0x4b71f7[_0x48d4('0x69')]=qs[_0x48d4('0x4d')](_0x1f2365['query'][_0x48d4('0x4d')]);_0x4b71f7[_0x48d4('0x4e')]=qs[_0x48d4('0x46')](_[_0x48d4('0x6a')](_0x1f2365[_0x48d4('0x45')],_0x107888[_0x48d4('0x46')]));_0x4b71f7[_0x48d4('0x4e')]['SmsAccountId']=_0x2815db['id'];if(_0x1f2365[_0x48d4('0x45')][_0x48d4('0x4f')]){_0x4b71f7[_0x48d4('0x4e')]=_['merge'](_0x4b71f7['where'],{'$or':_['map'](_0x4b71f7['attributes'],function(_0x3a0298){var _0x30bead={};_0x30bead[_0x3a0298]={'$like':'%'+_0x1f2365[_0x48d4('0x45')][_0x48d4('0x4f')]+'%'};return _0x30bead;})});}_0x4b71f7=_[_0x48d4('0x50')]({},_0x4b71f7,_0x1f2365['options']);return db[_0x48d4('0x66')]['count']({'where':_0x4b71f7[_0x48d4('0x4e')]})[_0x48d4('0x20')](function(_0x138ff6){_0x2a4a4d[_0x48d4('0x30')]=_0x138ff6;if(_0x1f2365[_0x48d4('0x45')][_0x48d4('0x53')]){_0x4b71f7['include']=[{'all':!![]}];}return db[_0x48d4('0x66')][_0x48d4('0x55')](_0x4b71f7);})[_0x48d4('0x20')](function(_0xd65348){_0x2a4a4d[_0x48d4('0x56')]=_0xd65348;return _0x2a4a4d;});}})[_0x48d4('0x20')](respondWithFilteredResult(_0x3b02bc,_0x4b71f7))[_0x48d4('0x2a')](handleError(_0x3b02bc,null));};exports[_0x48d4('0x6b')]=function(_0x2922bb,_0x270387,_0x4f57ea){return db[_0x48d4('0x40')][_0x48d4('0x5a')]({'where':{'id':_0x2922bb[_0x48d4('0x58')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x270387,null))[_0x48d4('0x20')](function(_0x2cdff6){if(_0x2cdff6){return _0x2cdff6[_0x48d4('0x6b')](_0x2922bb[_0x48d4('0x45')][_0x48d4('0x6c')]);}})[_0x48d4('0x20')](respondWithStatusCode(_0x270387,null))[_0x48d4('0x2a')](handleError(_0x270387,null));};exports[_0x48d4('0x6d')]=function(_0x7bd215,_0x372dea,_0x53a54f){if(_0x7bd215[_0x48d4('0x5c')]['id']){delete _0x7bd215[_0x48d4('0x5c')]['id'];}return db[_0x48d4('0x40')]['find']({'where':{'id':_0x7bd215[_0x48d4('0x58')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x372dea,null))['then'](function(_0x2eb916){if(_0x2eb916){_0x7bd215[_0x48d4('0x5c')][_0x48d4('0x65')]=_0x2eb916['id'];return db['CannedAnswer']['create'](_0x7bd215[_0x48d4('0x5c')]);}})[_0x48d4('0x20')](respondWithResult(_0x372dea,null))[_0x48d4('0x2a')](handleError(_0x372dea,null));};exports[_0x48d4('0x6e')]=function(_0xa0625c,_0x5cf7c9,_0x582051){var _0x164953={'raw':![],'where':{}};var _0x2e6f0d={};var _0x2242b9={'count':0x0,'rows':[]};return db[_0x48d4('0x40')][_0x48d4('0x68')]({'where':{'id':_0xa0625c[_0x48d4('0x58')]['id']}})['then'](handleEntityNotFound(_0x5cf7c9,null))[_0x48d4('0x20')](function(_0x217fa2){if(_0x217fa2){_0x2e6f0d['model']=_[_0x48d4('0x59')](db[_0x48d4('0x6f')][_0x48d4('0x41')]);_0x2e6f0d[_0x48d4('0x45')]=_['keys'](_0xa0625c[_0x48d4('0x45')]);_0x2e6f0d[_0x48d4('0x46')]=_[_0x48d4('0x47')](_0x2e6f0d[_0x48d4('0x44')],_0x2e6f0d[_0x48d4('0x45')]);_0x164953[_0x48d4('0x49')]=_[_0x48d4('0x47')](_0x2e6f0d[_0x48d4('0x44')],qs[_0x48d4('0x48')](_0xa0625c[_0x48d4('0x45')][_0x48d4('0x48')]));_0x164953['attributes']=_0x164953[_0x48d4('0x49')]['length']?_0x164953[_0x48d4('0x49')]:_0x2e6f0d['model'];if(!_0xa0625c[_0x48d4('0x45')][_0x48d4('0x4b')](_0x48d4('0x4c'))){_0x164953['limit']=qs['limit'](_0xa0625c[_0x48d4('0x45')]['limit']);_0x164953[_0x48d4('0x2e')]=qs[_0x48d4('0x2e')](_0xa0625c[_0x48d4('0x45')][_0x48d4('0x2e')]);}_0x164953[_0x48d4('0x69')]=qs['sort'](_0xa0625c['query']['sort']);_0x164953[_0x48d4('0x4e')]=qs[_0x48d4('0x46')](_['pick'](_0xa0625c[_0x48d4('0x45')],_0x2e6f0d['filters']));_0x164953[_0x48d4('0x4e')]['SmsAccountId']=_0x217fa2['id'];if(_0xa0625c[_0x48d4('0x45')][_0x48d4('0x4f')]){_0x164953[_0x48d4('0x4e')]=_[_0x48d4('0x50')](_0x164953['where'],{'$or':_[_0x48d4('0x3f')](_0x164953[_0x48d4('0x49')],function(_0xbfec01){var _0x10c08c={};_0x10c08c[_0xbfec01]={'$like':'%'+_0xa0625c[_0x48d4('0x45')][_0x48d4('0x4f')]+'%'};return _0x10c08c;})});}_0x164953=_['merge']({},_0x164953,_0xa0625c['options']);return db[_0x48d4('0x6f')][_0x48d4('0x30')]({'where':_0x164953[_0x48d4('0x4e')]})[_0x48d4('0x20')](function(_0xa322f7){_0x2242b9['count']=_0xa322f7;if(_0xa0625c[_0x48d4('0x45')][_0x48d4('0x53')]){_0x164953['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x48d4('0x55')](_0x164953);})[_0x48d4('0x20')](function(_0x54af7b){_0x2242b9[_0x48d4('0x56')]=_0x54af7b;return _0x2242b9;});}})[_0x48d4('0x20')](respondWithFilteredResult(_0x5cf7c9,_0x164953))[_0x48d4('0x2a')](handleError(_0x5cf7c9,null));};exports[_0x48d4('0x70')]=function(_0xb8f187,_0x30648c,_0x198cd1){return db[_0x48d4('0x40')][_0x48d4('0x5a')]({'where':{'id':_0xb8f187[_0x48d4('0x58')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x30648c,null))[_0x48d4('0x20')](function(_0x4ca773){if(_0x4ca773){return _0x4ca773['removeAnswers'](_0xb8f187[_0x48d4('0x45')][_0x48d4('0x6c')]);}})[_0x48d4('0x20')](respondWithStatusCode(_0x30648c,null))[_0x48d4('0x2a')](handleError(_0x30648c,null));};exports[_0x48d4('0x71')]=function(_0x1d51f2,_0x1f6203,_0x2e63cb){var _0x1a9730={'channel':_0x48d4('0x72')};var _0x1c5728=[];var _0xf591b2=[];var _0x2d0592={};return db[_0x48d4('0x40')][_0x48d4('0x5a')]({'where':{'id':_0x1d51f2['params']['id']},'include':[{'model':db['SmsApplication'],'as':_0x48d4('0x73')}]})[_0x48d4('0x20')](handleEntityNotFound(_0x1f6203,null))['then'](function(_0x51a618){_0x1a9730[_0x48d4('0x74')]=_0x51a618;_0x1a9730['applications']=_[_0x48d4('0x75')](_0x51a618[_0x48d4('0x73')],[_0x48d4('0x76')],[_0x48d4('0x77')]);if(_0x1a9730[_0x48d4('0x74')][_0x48d4('0x73')]){delete _0x1a9730[_0x48d4('0x74')][_0x48d4('0x73')];}return db[_0x48d4('0x78')][_0x48d4('0x79')]();})[_0x48d4('0x20')](function(_0x1296c1){if(!_0x1296c1){throw new db[(_0x48d4('0x7a'))][(_0x48d4('0x7b'))](_0x48d4('0x7c'));}_0x1c5728=_[_0x48d4('0x7d')](_['keys'](_0x1296c1),[_0x48d4('0x7e'),_0x48d4('0x7f')]);_0xf591b2=_[_0x48d4('0x7d')](_[_0x48d4('0x59')](_0x1296c1),[_0x48d4('0x7e'),_0x48d4('0x7f'),_0x48d4('0x80'),_0x48d4('0x81')]);_0x1a9730[_0x48d4('0x5c')]={'mapKey':_0x48d4('0x82')};if(_0x1a9730[_0x48d4('0x74')][_0x48d4('0x42')]){switch(_0x1a9730['account'][_0x48d4('0x42')]){case _0x48d4('0x83'):_0x1a9730['body'][_0x48d4('0x84')]=_0x1d51f2[_0x48d4('0x5c')][_0x48d4('0x85')];_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x5c')]=_0x1d51f2['body'][_0x48d4('0x86')];_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x87')]=_0x1d51f2[_0x48d4('0x5c')]['MessageSid'];break;case _0x48d4('0x88'):_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x84')]='+'+_0x1d51f2['body'][_0x48d4('0x89')];_0x1a9730['body'][_0x48d4('0x5c')]=_0x1d51f2[_0x48d4('0x5c')][_0x48d4('0x8a')];break;case _0x48d4('0x8b'):_0x1a9730['body'][_0x48d4('0x84')]=_0x1d51f2[_0x48d4('0x5c')]['from'];_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x5c')]=_0x1d51f2[_0x48d4('0x5c')][_0x48d4('0x28')];break;case _0x48d4('0x8c'):_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x84')]=_0x1d51f2[_0x48d4('0x5c')][_0x48d4('0x84')];_0x1a9730['body'][_0x48d4('0x5c')]=_0x1d51f2[_0x48d4('0x5c')][_0x48d4('0x5c')];_0x1a9730['body'][_0x48d4('0x87')]=_0x1d51f2[_0x48d4('0x5c')]['message_id'];break;case _0x48d4('0x8d'):_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x84')]=_0x1d51f2[_0x48d4('0x5c')][_0x48d4('0x85')];_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x5c')]=_0x1d51f2['body'][_0x48d4('0x8e')];_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x87')]=_0x1d51f2[_0x48d4('0x5c')]['MessageUUID'];break;case _0x48d4('0x8f'):_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x84')]='+'+_0x1d51f2['body'][_0x48d4('0x90')][0x0][_0x48d4('0x84')];_0x1a9730['body'][_0x48d4('0x5c')]=_0x1d51f2['body'][_0x48d4('0x90')][0x0][_0x48d4('0x8a')];_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x87')]=_0x1d51f2['body'][_0x48d4('0x90')][0x0][_0x48d4('0x87')];break;case _0x48d4('0x91'):_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x84')]=_0x1d51f2['body'][_0x48d4('0x92')];_0x1a9730[_0x48d4('0x5c')]['body']=_0x1d51f2['body'][_0x48d4('0x93')][_0x48d4('0x28')];break;case _0x48d4('0x94'):_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x84')]=_0x1d51f2[_0x48d4('0x5c')][_0x48d4('0x95')];_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x5c')]=_0x1d51f2[_0x48d4('0x5c')][_0x48d4('0x8a')];_0x1a9730['body'][_0x48d4('0x87')]=_0x1d51f2[_0x48d4('0x5c')][_0x48d4('0x96')];break;case _0x48d4('0x97'):_0x1a9730['body']['messageId']=_0x1d51f2['body'][0x0][_0x48d4('0x28')]['id'];_0x1a9730[_0x48d4('0x5c')]['from']=_0x1d51f2[_0x48d4('0x5c')][0x0][_0x48d4('0x28')][_0x48d4('0x84')];_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x5c')]=_0x1d51f2[_0x48d4('0x5c')][0x0][_0x48d4('0x28')][_0x48d4('0x8a')];break;case'intelepeer':_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x84')]=_0x1d51f2[_0x48d4('0x5c')][_0x48d4('0x84')];_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x5c')]=_0x1d51f2[_0x48d4('0x5c')][_0x48d4('0x28')];_0x1a9730['body'][_0x48d4('0x87')]=_0x1d51f2[_0x48d4('0x5c')][_0x48d4('0x98')];break;}}if(_0x1a9730[_0x48d4('0x5c')]['id']){delete _0x1a9730['body']['id'];}if(_[_0x48d4('0x99')](_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x84')])){throw new db['Sequelize'][(_0x48d4('0x7b'))](_0x48d4('0x9a'));}if(_[_0x48d4('0x99')](_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x5c')])||_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x5c')]===''){throw new db['Sequelize']['ValidationError'](_0x48d4('0x9b'));}if(_[_0x48d4('0x99')](_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x9c')])){throw new db['Sequelize'][(_0x48d4('0x7b'))](_0x48d4('0x9d')+_0xf591b2);}if(!_[_0x48d4('0x9e')](_0xf591b2,_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x9c')])){throw new db[(_0x48d4('0x7a'))][(_0x48d4('0x7b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf591b2);}_0x2d0592[_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x9c')]]=_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x84')];return db[_0x48d4('0x9f')][_0x48d4('0x5a')]({'where':{'id':_0x1a9730[_0x48d4('0x74')][_0x48d4('0x81')]},'include':[{'model':db[_0x48d4('0x78')],'as':_0x48d4('0xa0'),'where':_0x2d0592,'limit':0x1,'order':[['updatedAt',_0x48d4('0xa1')]]}]});})[_0x48d4('0x20')](handleEntityNotFound(_0x1f6203,null))[_0x48d4('0x20')](function(_0x331ccc){if(_0x331ccc){_0x1a9730[_0x48d4('0xa2')]=_[_0x48d4('0xa3')](_0x331ccc,[_0x48d4('0xa0')]);if(_0x331ccc[_0x48d4('0xa0')][_0x48d4('0x4a')]){return _0x331ccc[_0x48d4('0xa0')][0x0];}var _0x46f1c5=_['defaults'](_0x1a9730[_0x48d4('0x5c')],{'firstName':_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x84')],'ListId':_0x331ccc['id']});_0x46f1c5[_0x1a9730['body']['mapKey']]=_0x1a9730[_0x48d4('0x5c')]['from'];return db[_0x48d4('0x78')][_0x48d4('0x5b')](_0x46f1c5,{'fields':_0x1c5728,'raw':!![]});}})['then'](handleEntityNotFound(_0x1f6203,null))[_0x48d4('0x20')](function(_0x3fcf5e){if(_0x3fcf5e){_0x1a9730['contact']=_0x3fcf5e;var _0x35d18b={'ContactId':_0x3fcf5e['id'],'phone':_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x84')],'SmsAccountId':_0x1d51f2[_0x48d4('0x58')]['id']};var _0x5e4e50={'ContactId':_0x3fcf5e['id'],'SmsAccountId':_0x1d51f2[_0x48d4('0x58')]['id'],'closed':![]};return db[_0x48d4('0xa4')][_0x48d4('0x5a')]({'where':_0x5e4e50})[_0x48d4('0x20')](function(_0x22de15){if(_0x22de15){return[_0x22de15,![]];}return db[_0x48d4('0xa4')][_0x48d4('0x5b')](_0x35d18b)[_0x48d4('0x20')](function(_0x5d2715){return[_0x5d2715,!![]];});});}})[_0x48d4('0xa5')](function(_0x21ecec,_0xd8fc12){_0x1a9730['interaction']=_0x21ecec[_0x48d4('0x38')]({'plain':!![]});_0x1a9730[_0x48d4('0xa6')][_0x48d4('0xa7')]=![];if(_0xd8fc12){if(_0x1a9730[_0x48d4('0x74')][_0x48d4('0xa8')]){_0x1a9730[_0x48d4('0xa9')][_0x48d4('0xaa')]({'id':0x0,'priority':_0x1a9730[_0x48d4('0xa9')][_0x48d4('0x4a')]+0x1,'app':_0x48d4('0xab'),'appdata':_0x48d4('0xac'),'interval':_0x48d4('0xad')});}_0x1a9730[_0x48d4('0xa6')][_0x48d4('0xa7')]=!![];}return db[_0x48d4('0xae')][_0x48d4('0x5b')]({'phone':_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x84')],'messageId':_0x1a9730['body']['messageId'],'body':_0x1a9730[_0x48d4('0x5c')][_0x48d4('0x5c')],'SmsAccountId':_0x1d51f2[_0x48d4('0x58')]['id'],'SmsInteractionId':_0x21ecec['id'],'direction':'in','ContactId':_0x21ecec['ContactId'],'AttachmentId':_0x1a9730[_0x48d4('0x5c')]['AttachmentId']});})[_0x48d4('0x20')](function(_0x88014f){_0x1a9730['message']=_0x88014f;if(_0x1a9730[_0x48d4('0xa6')][_0x48d4('0xaf')]){return db[_0x48d4('0xb0')][_0x48d4('0x5a')]({'attributes':['id',_0x48d4('0x3c')],'where':{'id':_0x1a9730[_0x48d4('0xa6')][_0x48d4('0xaf')]}})[_0x48d4('0x20')](function(_0x31b300){if(_0x31b300){_0x1a9730[_0x48d4('0xa9')][_0x48d4('0xb1')]({'id':0x0,'priority':0x0,'app':_0x48d4('0xb2'),'appdata':_0x31b300[_0x48d4('0x3c')]+','+(_0x1a9730[_0x48d4('0x74')][_0x48d4('0xb3')]||0xa),'interval':_0x48d4('0xad')});}return respondWithRpcPromise(_0x48d4('0xb4'),'startRouting',_0x1a9730);});}return respondWithRpcPromise('Start',_0x48d4('0xb5'),_0x1a9730);})[_0x48d4('0x20')](function(_0x24f067){if(_0x24f067){var _0xe164ce=0xc8;var _0x281ce6=_0x48d4('0xb6');logger['info'](_0x48d4('0x24'),_0x281ce6,_0xe164ce,_0x48d4('0xb7'));logger[_0x48d4('0xb8')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x281ce6,_0xe164ce,_0x48d4('0xb7'),JSON[_0x48d4('0x25')](_0x24f067));if(_0x1a9730[_0x48d4('0x74')]['type']===_0x48d4('0x83')){return _0x1f6203[_0x48d4('0x2b')](_0xe164ce)[_0x48d4('0x31')](_0x48d4('0xb9'),_0x48d4('0xba'))[_0x48d4('0xbb')]('\x0a');}else{return _0x1f6203[_0x48d4('0x2b')](_0xe164ce)[_0x48d4('0x2d')](_0x24f067);}}})[_0x48d4('0x2a')](handleError(_0x1f6203,null));};exports[_0x48d4('0xbc')]=function(_0xec4ae3,_0x402900){var _0x5d3173=_0xec4ae3[_0x48d4('0x58')]['id'];var _0x42d86c=_0xec4ae3[_0x48d4('0x5c')];var _0x2e7503=0xc8;var _0x4dc6b3=null;return db[_0x48d4('0xbd')][_0x48d4('0xbe')]({'isolationLevel':db[_0x48d4('0xbd')]['Transaction'][_0x48d4('0xbf')][_0x48d4('0xc0')]},function(_0xd37bac){return db['SmsAccount'][_0x48d4('0x68')]({'where':{'id':_0x5d3173},'transaction':_0xd37bac})['then'](function(_0x45b7bb){if(_0x45b7bb){return db[_0x48d4('0xc1')]['destroy']({'where':{'SmsAccountId':_0x5d3173},'transaction':_0xd37bac})['then'](function(){var _0x242c3d=_[_0x48d4('0x3f')](_0x42d86c,function(_0x2aeed8){_0x2aeed8[_0x48d4('0x65')]=_0x5d3173;return _0x2aeed8;});return db[_0x48d4('0xc1')][_0x48d4('0xc2')](_0x242c3d,{'transaction':_0xd37bac});});}else{_0x2e7503=0x194;_0x4dc6b3=[];}});})[_0x48d4('0x20')](function(){if(_0x2e7503!==0x194){return db['SmsApplication'][_0x48d4('0xc3')]({'where':{'SmsAccountId':_0x5d3173},'order':'priority'})[_0x48d4('0x20')](function(_0x1d94ff){_0x4dc6b3=_0x1d94ff;});}})[_0x48d4('0x2a')](function(_0x582a88){_0x2e7503=0x1f4;logger['error'](_0x582a88[_0x48d4('0x3b')]);if(_0x582a88[_0x48d4('0x3c')]){delete _0x582a88[_0x48d4('0x3c')];}_0x4dc6b3=_0x582a88;})[_0x48d4('0xc4')](function(){if(_0x4dc6b3===null){_0x402900[_0x48d4('0x3a')](_0x2e7503);}else{if(_0x2e7503===0x1f4){_0x402900[_0x48d4('0x2b')](_0x2e7503)[_0x48d4('0xbb')](_0x4dc6b3);}else{_0x402900[_0x48d4('0x2b')](_0x2e7503)[_0x48d4('0x2d')](_0x4dc6b3);}}});};exports[_0x48d4('0xc5')]=function(_0x9c094c,_0x171e17,_0x46a188){var _0x3b716a={};var _0x314067={};var _0x493ce1;var _0x41da2e;return db['SmsAccount']['findOne']({'where':{'id':_0x9c094c['params']['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x171e17,null))[_0x48d4('0x20')](function(_0x10f1ca){if(_0x10f1ca){_0x493ce1=_0x10f1ca;_0x314067[_0x48d4('0x44')]=_['keys'](db[_0x48d4('0xc1')]['rawAttributes']);_0x314067[_0x48d4('0x45')]=_[_0x48d4('0x59')](_0x9c094c['query']);_0x314067[_0x48d4('0x46')]=_[_0x48d4('0x47')](_0x314067['model'],_0x314067['query']);_0x3b716a[_0x48d4('0x49')]=_[_0x48d4('0x47')](_0x314067[_0x48d4('0x44')],qs[_0x48d4('0x48')](_0x9c094c['query'][_0x48d4('0x48')]));_0x3b716a[_0x48d4('0x49')]=_0x3b716a['attributes']['length']?_0x3b716a['attributes']:_0x314067[_0x48d4('0x44')];_0x3b716a[_0x48d4('0x69')]=qs[_0x48d4('0x4d')](_0x9c094c[_0x48d4('0x45')][_0x48d4('0x4d')]);_0x3b716a[_0x48d4('0x4e')]=qs[_0x48d4('0x46')](_[_0x48d4('0x6a')](_0x9c094c['query'],_0x314067[_0x48d4('0x46')]));if(_0x9c094c[_0x48d4('0x45')]['filter']){_0x3b716a[_0x48d4('0x4e')]=_['merge'](_0x3b716a[_0x48d4('0x4e')],{'$or':_[_0x48d4('0x3f')](_0x3b716a[_0x48d4('0x49')],function(_0x341ddf){var _0x18fbad={};_0x18fbad[_0x341ddf]={'$like':'%'+_0x9c094c[_0x48d4('0x45')]['filter']+'%'};return _0x18fbad;})});}_0x3b716a=_[_0x48d4('0x50')]({},_0x3b716a,_0x9c094c[_0x48d4('0x52')]);return _0x493ce1[_0x48d4('0xc5')](_0x3b716a);}})['then'](function(_0x878f9d){if(_0x878f9d){_0x41da2e=_0x878f9d[_0x48d4('0x4a')];if(!_0x9c094c['query'][_0x48d4('0x4b')](_0x48d4('0x4c'))){_0x3b716a['limit']=qs[_0x48d4('0x2f')](_0x9c094c[_0x48d4('0x45')][_0x48d4('0x2f')]);_0x3b716a[_0x48d4('0x2e')]=qs[_0x48d4('0x2e')](_0x9c094c['query']['offset']);}return _0x493ce1['getApplications'](_0x3b716a);}})[_0x48d4('0x20')](function(_0x1c845b){if(_0x1c845b){return _0x1c845b?{'count':_0x41da2e,'rows':_0x1c845b}:null;}})[_0x48d4('0x20')](respondWithResult(_0x171e17,null))[_0x48d4('0x2a')](handleError(_0x171e17,null));};exports['getInteractions']=function(_0x20a953,_0x16394b,_0x3a115c){var _0x6984c6={'raw':![],'where':{}};var _0x26000e={};var _0x129e95={'count':0x0,'rows':[]};return db[_0x48d4('0x40')][_0x48d4('0x68')]({'where':{'id':_0x20a953[_0x48d4('0x58')]['id']}})['then'](handleEntityNotFound(_0x16394b,null))[_0x48d4('0x20')](function(_0x38df19){if(_0x38df19){_0x26000e['model']=_[_0x48d4('0x59')](db[_0x48d4('0xa4')][_0x48d4('0x41')]);_0x26000e['query']=_['keys'](_0x20a953[_0x48d4('0x45')]);_0x26000e['filters']=_[_0x48d4('0x47')](_0x26000e['model'],_0x26000e[_0x48d4('0x45')]);_0x6984c6[_0x48d4('0x49')]=_['intersection'](_0x26000e[_0x48d4('0x44')],qs[_0x48d4('0x48')](_0x20a953[_0x48d4('0x45')][_0x48d4('0x48')]));_0x6984c6[_0x48d4('0x49')]=_0x6984c6[_0x48d4('0x49')][_0x48d4('0x4a')]?_0x6984c6[_0x48d4('0x49')]:_0x26000e[_0x48d4('0x44')];if(!_0x20a953[_0x48d4('0x45')]['hasOwnProperty'](_0x48d4('0x4c'))){_0x6984c6[_0x48d4('0x2f')]=qs['limit'](_0x20a953[_0x48d4('0x45')][_0x48d4('0x2f')]);_0x6984c6[_0x48d4('0x2e')]=qs[_0x48d4('0x2e')](_0x20a953[_0x48d4('0x45')]['offset']);}_0x6984c6[_0x48d4('0x69')]=qs[_0x48d4('0x4d')](_0x20a953[_0x48d4('0x45')]['sort']);_0x6984c6[_0x48d4('0x4e')]=qs[_0x48d4('0x46')](_[_0x48d4('0x6a')](_0x20a953[_0x48d4('0x45')],_0x26000e[_0x48d4('0x46')]));_0x6984c6[_0x48d4('0x4e')]['SmsAccountId']=_0x38df19['id'];if(_0x20a953[_0x48d4('0x45')]['filter']){_0x6984c6[_0x48d4('0x4e')]=_['merge'](_0x6984c6[_0x48d4('0x4e')],{'$or':_[_0x48d4('0x3f')](_0x6984c6['attributes'],function(_0x245ae9){var _0x1792f8={};_0x1792f8[_0x245ae9]={'$like':'%'+_0x20a953[_0x48d4('0x45')]['filter']+'%'};return _0x1792f8;})});}_0x6984c6=_['merge']({},_0x6984c6,_0x20a953['options']);return db[_0x48d4('0xa4')][_0x48d4('0x30')]({'where':_0x6984c6[_0x48d4('0x4e')]})[_0x48d4('0x20')](function(_0xf7dcc4){_0x129e95[_0x48d4('0x30')]=_0xf7dcc4;if(_0x20a953[_0x48d4('0x45')]['includeAll']){_0x6984c6[_0x48d4('0x54')]=[{'model':db['CmContact'],'as':_0x48d4('0xc6'),'required':![]},{'model':db[_0x48d4('0xb0')],'as':_0x48d4('0xc7'),'attributes':[_0x48d4('0x3c'),'fullname','internal'],'required':![]},{'model':db[_0x48d4('0xc8')],'as':_0x48d4('0xc9'),'attributes':['id','name',_0x48d4('0xca')],'where':_0x20a953['query'][_0x48d4('0xcb')]?{'id':_0x20a953[_0x48d4('0x45')][_0x48d4('0xcb')]}:undefined,'required':_0x20a953[_0x48d4('0x45')][_0x48d4('0xcb')]?!![]:![]}];}return db[_0x48d4('0xa4')][_0x48d4('0x55')](_0x6984c6);})[_0x48d4('0x20')](function(_0x2cae2a){_0x129e95[_0x48d4('0x56')]=_0x2cae2a;return _0x129e95;});}})[_0x48d4('0x20')](respondWithFilteredResult(_0x16394b,_0x6984c6))[_0x48d4('0x2a')](handleError(_0x16394b,null));};exports['send']=function(_0x145256,_0x3a6902,_0x1e156e){var _0x528d4a,_0x30405a,_0x306f89;if(_[_0x48d4('0x99')](_0x145256[_0x48d4('0x5c')][_0x48d4('0x5c')])||_0x145256[_0x48d4('0x5c')][_0x48d4('0x5c')]===''){throw new db[(_0x48d4('0x7a'))][(_0x48d4('0x7b'))](_0x48d4('0x9b'));}if(_[_0x48d4('0x99')](_0x145256[_0x48d4('0x5c')]['to'])){throw new db[(_0x48d4('0x7a'))][(_0x48d4('0x7b'))]('to\x20is\x20mandatory');}_0x528d4a=_0x145256[_0x48d4('0x5c')]['to'];return db[_0x48d4('0x40')][_0x48d4('0x5a')]({'where':{'id':_0x145256[_0x48d4('0x58')]['id']},'include':[{'model':db[_0x48d4('0x9f')],'as':_0x48d4('0xcc'),'include':[{'model':db['CmContact'],'as':_0x48d4('0xa0'),'where':{'mobile':_0x528d4a},'limit':0x1,'order':[[_0x48d4('0x7f'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x3a6902,null))[_0x48d4('0x20')](function(_0x2a5a01){if(_0x2a5a01&&_0x2a5a01[_0x48d4('0xcc')]){_0x30405a=_0x2a5a01[_0x48d4('0x38')]({'plain':!![]});if(_0x30405a[_0x48d4('0xcc')]&&_0x30405a[_0x48d4('0xcc')]['Contacts']['length']){return _0x30405a['List'][_0x48d4('0xa0')][0x0];}return db[_0x48d4('0x78')][_0x48d4('0x5b')](_[_0x48d4('0x18')](_0x145256['body'],{'firstName':_0x528d4a,'mobile':_0x528d4a,'phone':_0x528d4a,'ListId':_0x30405a[_0x48d4('0x81')]}));}})[_0x48d4('0x20')](handleEntityNotFound(_0x3a6902,null))[_0x48d4('0x20')](function(_0x456e03){if(_0x456e03){_0x306f89=_0x456e03;return db[_0x48d4('0xa4')][_0x48d4('0x5a')]({'where':{'ContactId':_0x306f89['id'],'closed':![],'SmsAccountId':_0x30405a['id']}})[_0x48d4('0x20')](function(_0xf6f55){if(_0xf6f55){return[_0xf6f55,![]];}return db[_0x48d4('0xa4')][_0x48d4('0x5b')]({'UserId':_0x145256['user']['id'],'ContactId':_0x306f89['id'],'SmsAccountId':_0x30405a['id'],'phone':_0x528d4a,'firstMsgDirection':'out','Messages':[_[_0x48d4('0x50')](_0x145256[_0x48d4('0x5c')],{'read':![],'body':_0x145256[_0x48d4('0x5c')][_0x48d4('0x5c')],'phone':_0x528d4a,'SmsAccountId':_0x30405a['id'],'UserId':_0x145256[_0x48d4('0x5d')]['id'],'ContactId':_0x306f89['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x48d4('0xcd')}]})[_0x48d4('0x20')](function(_0x38a401){return[_0x38a401,!![]];});});}})[_0x48d4('0xa5')](function(_0x552378,_0x5ed02c){if(_0x5ed02c){return _0x552378;}return db[_0x48d4('0xae')]['create'](_['merge'](_0x145256[_0x48d4('0x5c')],{'read':![],'body':_0x145256[_0x48d4('0x5c')][_0x48d4('0x5c')],'phone':_0x528d4a,'SmsAccountId':_0x30405a['id'],'SmsInteractionId':_0x552378['id'],'UserId':_0x145256[_0x48d4('0x5d')]['id'],'ContactId':_0x306f89['id']}))[_0x48d4('0x20')](function(_0x3d3286){_0x552378[_0x48d4('0xce')]['Messages']=[];_0x552378[_0x48d4('0xce')][_0x48d4('0xcd')][_0x48d4('0xaa')](_0x3d3286['dataValues']);return _0x552378;});})[_0x48d4('0x20')](respondWithResult(_0x3a6902,null))[_0x48d4('0x2a')](handleError(_0x3a6902,null));};exports['status']=function(_0x23b8c5,_0x40f63b,_0xc7535e){if(_0x23b8c5[_0x48d4('0x5c')]['id']){delete _0x23b8c5['body']['id'];}var _0x2ab9aa,_0x52dba9,_0x1ae089;return db[_0x48d4('0x40')][_0x48d4('0x5a')]({'where':{'id':_0x23b8c5[_0x48d4('0x58')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x40f63b,null))[_0x48d4('0x20')](function(_0x373d75){if(_0x373d75){_0x1ae089=_0x373d75;logger['debug'](_0x48d4('0x24'),_0x48d4('0x2b'),'received\x20delivery\x20report\x20from',_0x373d75['type'],util['inspect'](_0x23b8c5['body'],{'showHidden':![],'depth':null}));switch(_0x373d75[_0x48d4('0x42')]){case'skebby':if(_0x23b8c5[_0x48d4('0x5c')][_0x48d4('0xcf')]&&_0x23b8c5[_0x48d4('0x5c')][_0x48d4('0x2b')]){_0x52dba9=_0x23b8c5['body'][_0x48d4('0x2b')];return db[_0x48d4('0xae')][_0x48d4('0x5a')]({'where':{'messageId':_0x23b8c5[_0x48d4('0x5c')]['skebby_dispatch_id']}});}break;case _0x48d4('0x8b'):if(_0x23b8c5[_0x48d4('0x5c')]['requestid']&&_0x23b8c5[_0x48d4('0x5c')][_0x48d4('0xd0')]){_0x52dba9=_0x23b8c5['body'][_0x48d4('0xd0')];return db['SmsMessage'][_0x48d4('0x5a')]({'where':{'messageId':_0x23b8c5[_0x48d4('0x5c')]['requestid']}});}break;case _0x48d4('0x8c'):if(_0x23b8c5[_0x48d4('0x5c')][_0x48d4('0xd1')]&&_0x23b8c5[_0x48d4('0x5c')][_0x48d4('0xd2')]){_0x52dba9=_0x23b8c5[_0x48d4('0x5c')][_0x48d4('0xd2')];return db[_0x48d4('0xae')]['find']({'where':{'messageId':_0x23b8c5[_0x48d4('0x5c')]['message_id']}});}break;case _0x48d4('0x8f'):var _0x32ccf7=_0x23b8c5['body'][_0x48d4('0x90')][0x0];if(_0x32ccf7[_0x48d4('0x87')]&&_0x32ccf7['status']['groupName']===_0x48d4('0xd3')){_0x52dba9=_0x32ccf7[_0x48d4('0x2b')]['groupName'];return db[_0x48d4('0xae')][_0x48d4('0x5a')]({'where':{'messageId':_0x32ccf7[_0x48d4('0x87')]}});}break;case _0x48d4('0x94'):if(_0x23b8c5[_0x48d4('0x5c')][_0x48d4('0x87')]&&_0x23b8c5[_0x48d4('0x5c')][_0x48d4('0x2b')]){_0x52dba9=_0x23b8c5[_0x48d4('0x5c')][_0x48d4('0x2b')];return db[_0x48d4('0xae')][_0x48d4('0x5a')]({'where':{'messageId':_0x23b8c5[_0x48d4('0x5c')][_0x48d4('0x87')]}});}break;case _0x48d4('0x97'):if(_0x23b8c5['body'][0x0][_0x48d4('0x28')]['id']){_0x52dba9=_0x23b8c5[_0x48d4('0x5c')][0x0][_0x48d4('0x42')];return db[_0x48d4('0xae')][_0x48d4('0x5a')]({'where':{'messageId':_0x23b8c5[_0x48d4('0x5c')][0x0]['message']['id']}});}break;case _0x48d4('0xd4'):if(_0x23b8c5[_0x48d4('0x5c')][_0x48d4('0xd5')]&&_0x23b8c5['body'][_0x48d4('0x2b')]){_0x52dba9=_0x23b8c5['body'][_0x48d4('0x2b')];return db[_0x48d4('0xae')][_0x48d4('0x5a')]({'where':{'messageId':_0x23b8c5[_0x48d4('0x5c')][_0x48d4('0xd5')]}});}break;}}})['then'](handleEntityNotFound(_0x40f63b,null))[_0x48d4('0x20')](function(_0x8e9076){if(_0x8e9076){_0x2ab9aa=_0x8e9076;switch(_0x1ae089[_0x48d4('0x42')]){case _0x48d4('0x88'):if(_0x52dba9===_0x48d4('0xd3')){return _0x2ab9aa['update']({'read':!![]});}else{logger[_0x48d4('0x26')](_0x48d4('0x24'),_0x48d4('0x2b'),_0x48d4('0x88'),util['inspect'](_0x23b8c5['body'],{'showHidden':![],'depth':null}));}break;case _0x48d4('0x8b'):if(_0x52dba9==='1'){return _0x2ab9aa['update']({'read':!![]});}else{logger[_0x48d4('0x26')](_0x48d4('0x24'),'status',_0x48d4('0x88'),util[_0x48d4('0xd6')](_0x23b8c5[_0x48d4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x48d4('0x8c'):if(!_0x23b8c5['body'][_0x48d4('0xd7')]&&_0x52dba9>=0xc8&&_0x52dba9<=0xce){return _0x2ab9aa[_0x48d4('0x36')]({'read':!![]});}else{logger[_0x48d4('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x48d4('0x8c'),util[_0x48d4('0xd6')](_0x23b8c5[_0x48d4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x48d4('0x8f'):var _0x59fb6c=_0x23b8c5[_0x48d4('0x5c')][_0x48d4('0x90')][0x0];if(_0x59fb6c[_0x48d4('0x2b')][_0x48d4('0xd8')]===_0x48d4('0xd3')){return _0x2ab9aa['update']({'read':!![]});}else{logger[_0x48d4('0x26')](_0x48d4('0x24'),'status','infobip',util['inspect'](_0x23b8c5[_0x48d4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x48d4('0x94'):if(_0x52dba9==_0x48d4('0xd9')||_0x52dba9=='RECEIVED_BY_RECIPIENT'){return _0x2ab9aa[_0x48d4('0x36')]({'read':!![]});}else{logger[_0x48d4('0x26')](_0x48d4('0x24'),_0x48d4('0x2b'),_0x48d4('0x94'),util['inspect'](_0x23b8c5[_0x48d4('0x5c')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x52dba9==_0x48d4('0xda')){return _0x2ab9aa[_0x48d4('0x36')]({'read':!![]});}else{logger[_0x48d4('0x26')](_0x48d4('0x24'),'status',_0x48d4('0x97'),util[_0x48d4('0xd6')](_0x23b8c5[_0x48d4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x48d4('0xd4'):if(_0x52dba9===_0x48d4('0xdb')||_0x52dba9===_0x48d4('0xdc')){return _0x2ab9aa[_0x48d4('0x36')]({'read':!![]});}else{logger['error'](_0x48d4('0x24'),_0x48d4('0x2b'),_0x48d4('0xd4'),util['inspect'](_0x23b8c5[_0x48d4('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x2ab9aa;}})[_0x48d4('0x20')](respondWithResult(_0x40f63b,null))[_0x48d4('0x2a')](handleError(_0x40f63b,null));};exports['statusGet']=function(_0xfc34fe,_0x30f8cf,_0x2d1078){var _0x3f79b7,_0x2ce135,_0x2ba074;return db[_0x48d4('0x40')][_0x48d4('0x5a')]({'where':{'id':_0xfc34fe['params']['id']}})['then'](handleEntityNotFound(_0x30f8cf,null))['then'](function(_0x3cad43){if(_0x3cad43){_0x2ba074=_0x3cad43;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x48d4('0x2b'),_0x48d4('0xdd'),_0x3cad43['type'],util['inspect'](_0xfc34fe[_0x48d4('0x45')],{'showHidden':![],'depth':null}));switch(_0x3cad43['type']){case _0x48d4('0x91'):if(_0xfc34fe[_0x48d4('0x45')][_0x48d4('0xde')]&&_0xfc34fe[_0x48d4('0x45')][_0x48d4('0xdf')]){_0x2ce135=_0xfc34fe['query'][_0x48d4('0xdf')];return db[_0x48d4('0xae')][_0x48d4('0x5a')]({'where':{'messageId':_0xfc34fe['query']['message-id']}});}break;}}})[_0x48d4('0x20')](handleEntityNotFound(_0x30f8cf,null))[_0x48d4('0x20')](function(_0x51295b){if(_0x51295b){_0x3f79b7=_0x51295b;switch(_0x2ba074['type']){case'csc':if(_0x2ce135==='2'||_0x2ce135==='6'){return _0x3f79b7[_0x48d4('0x36')]({'read':!![]});}else{logger[_0x48d4('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x48d4('0x91'),util[_0x48d4('0xd6')](_0xfc34fe[_0x48d4('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x3f79b7;}})[_0x48d4('0x20')](respondWithResult(_0x30f8cf,null))[_0x48d4('0x2a')](handleError(_0x30f8cf,null));};exports[_0x48d4('0xe0')]=function(_0x57564a,_0x3cfd92,_0x440fb9){return db['SmsAccount'][_0x48d4('0x5a')]({'where':{'id':_0x57564a[_0x48d4('0x58')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x3cfd92,null))[_0x48d4('0x20')](function(_0x417db2){if(_0x417db2){return _0x417db2[_0x48d4('0xe0')](_0x57564a[_0x48d4('0x5c')][_0x48d4('0x6c')],_[_0x48d4('0xa3')](_0x57564a[_0x48d4('0x5c')],[_0x48d4('0x6c'),'id'])||{})[_0x48d4('0xa5')](function(_0x1c84ff){for(var _0x23bca9=0x0;_0x23bca9<_0x57564a[_0x48d4('0x5c')][_0x48d4('0x6c')][_0x48d4('0x4a')];_0x23bca9+=0x1){socket[_0x48d4('0xe1')](_0x48d4('0xe2'),{'UserId':Number(_0x57564a[_0x48d4('0x5c')][_0x48d4('0x6c')][_0x23bca9]),'SmsAccountId':Number(_0x57564a[_0x48d4('0x58')]['id'])});}return _0x1c84ff;});}})['then'](respondWithResult(_0x3cfd92,null))[_0x48d4('0x2a')](handleError(_0x3cfd92,null));};exports[_0x48d4('0xe3')]=function(_0x4403ce,_0xdae808,_0x4a70b9){return db['SmsAccount']['find']({'where':{'id':_0x4403ce[_0x48d4('0x58')]['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0xdae808,null))[_0x48d4('0x20')](function(_0x4a16ee){if(_0x4a16ee){return _0x4a16ee[_0x48d4('0xe3')](_0x4403ce[_0x48d4('0x45')][_0x48d4('0x6c')])[_0x48d4('0x20')](function(){if(_[_0x48d4('0xe4')](_0x4403ce[_0x48d4('0x45')][_0x48d4('0x6c')])){for(var _0x1445fa=0x0;_0x1445fa<_0x4403ce[_0x48d4('0x45')][_0x48d4('0x6c')][_0x48d4('0x4a')];_0x1445fa+=0x1){socket['emit'](_0x48d4('0xe5'),{'UserId':Number(_0x4403ce[_0x48d4('0x45')][_0x48d4('0x6c')][_0x1445fa]),'SmsAccountId':Number(_0x4403ce['params']['id'])});}}else{socket[_0x48d4('0xe1')](_0x48d4('0xe5'),{'UserId':Number(_0x4403ce[_0x48d4('0x45')][_0x48d4('0x6c')]),'SmsAccountId':Number(_0x4403ce['params']['id'])});}});}})[_0x48d4('0x20')](respondWithStatusCode(_0xdae808,null))[_0x48d4('0x2a')](handleError(_0xdae808,null));};exports['getAgents']=function(_0x6fb1a2,_0x52a6d7,_0x2e84fc){var _0x57edc8={};var _0x259229={};var _0x561bbe;var _0x480f1c;return db[_0x48d4('0x40')]['findOne']({'where':{'id':_0x6fb1a2['params']['id']}})[_0x48d4('0x20')](handleEntityNotFound(_0x52a6d7,null))[_0x48d4('0x20')](function(_0x3f37aa){if(_0x3f37aa){_0x561bbe=_0x3f37aa;_0x259229[_0x48d4('0x44')]=_[_0x48d4('0x59')](db[_0x48d4('0xb0')]['rawAttributes']);_0x259229[_0x48d4('0x45')]=_[_0x48d4('0x59')](_0x6fb1a2[_0x48d4('0x45')]);_0x259229['filters']=_['intersection'](_0x259229[_0x48d4('0x44')],_0x259229[_0x48d4('0x45')]);_0x57edc8['attributes']=_[_0x48d4('0x47')](_0x259229[_0x48d4('0x44')],qs[_0x48d4('0x48')](_0x6fb1a2[_0x48d4('0x45')]['fields']));_0x57edc8[_0x48d4('0x49')]=_0x57edc8[_0x48d4('0x49')][_0x48d4('0x4a')]?_0x57edc8[_0x48d4('0x49')]:_0x259229['model'];_0x57edc8['order']=qs[_0x48d4('0x4d')](_0x6fb1a2[_0x48d4('0x45')]['sort']);_0x57edc8[_0x48d4('0x4e')]=qs[_0x48d4('0x46')](_['pick'](_0x6fb1a2['query'],_0x259229['filters']));if(_0x6fb1a2[_0x48d4('0x45')]['filter']){_0x57edc8['where']=_[_0x48d4('0x50')](_0x57edc8[_0x48d4('0x4e')],{'$or':_['map'](_0x57edc8[_0x48d4('0x49')],function(_0x33bbf0){var _0x86ff72={};_0x86ff72[_0x33bbf0]={'$like':'%'+_0x6fb1a2[_0x48d4('0x45')]['filter']+'%'};return _0x86ff72;})});}_0x57edc8=_[_0x48d4('0x50')]({},_0x57edc8,_0x6fb1a2[_0x48d4('0x52')]);return _0x561bbe[_0x48d4('0xe6')](_0x57edc8);}})[_0x48d4('0x20')](function(_0x564210){if(_0x564210){_0x480f1c=_0x564210['length'];if(!_0x6fb1a2[_0x48d4('0x45')]['hasOwnProperty'](_0x48d4('0x4c'))){_0x57edc8[_0x48d4('0x2f')]=qs[_0x48d4('0x2f')](_0x6fb1a2[_0x48d4('0x45')][_0x48d4('0x2f')]);_0x57edc8['offset']=qs['offset'](_0x6fb1a2['query'][_0x48d4('0x2e')]);}return _0x561bbe['getAgents'](_0x57edc8);}})[_0x48d4('0x20')](function(_0x3b27aa){if(_0x3b27aa){return _0x3b27aa?{'count':_0x480f1c,'rows':_0x3b27aa}:null;}})[_0x48d4('0x20')](respondWithResult(_0x52a6d7,null))[_0x48d4('0x2a')](handleError(_0x52a6d7,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index e51bf4c..d37f6fb 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 _0x8c63=['events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2d91c6,_0x10ae0e){var _0x3a8d19=function(_0x27a3ce){while(--_0x27a3ce){_0x2d91c6['push'](_0x2d91c6['shift']());}};_0x3a8d19(++_0x10ae0e);}(_0x8c63,0x160));var _0x38c6=function(_0x2dd85b,_0x272fa9){_0x2dd85b=_0x2dd85b-0x0;var _0x465b19=_0x8c63[_0x2dd85b];return _0x465b19;};'use strict';var EventEmitter=require(_0x38c6('0x0'));var SmsAccount=require(_0x38c6('0x1'))['db'][_0x38c6('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x38c6('0x3')](0x0);var events={'afterCreate':_0x38c6('0x4'),'afterUpdate':_0x38c6('0x5'),'afterDestroy':_0x38c6('0x6')};function emitEvent(_0x54afb1){return function(_0x4b60f7,_0x200484,_0x3eb55f){SmsAccountEvents[_0x38c6('0x7')](_0x54afb1+':'+_0x4b60f7['id'],_0x4b60f7);SmsAccountEvents[_0x38c6('0x7')](_0x54afb1,_0x4b60f7);_0x3eb55f(null);};}for(var e in events){if(events[_0x38c6('0x8')](e)){var event=events[e];SmsAccount[_0x38c6('0x9')](e,emitEvent(event));}}module[_0x38c6('0xa')]=SmsAccountEvents; \ No newline at end of file +var _0x5eb4=['events','../../mysqldb','setMaxListeners','update','hasOwnProperty','exports'];(function(_0x1c5037,_0x52e4d0){var _0x1e6ead=function(_0x24ed26){while(--_0x24ed26){_0x1c5037['push'](_0x1c5037['shift']());}};_0x1e6ead(++_0x52e4d0);}(_0x5eb4,0xa8));var _0x45eb=function(_0x4a1cd5,_0x376dd5){_0x4a1cd5=_0x4a1cd5-0x0;var _0x4461ef=_0x5eb4[_0x4a1cd5];return _0x4461ef;};'use strict';var EventEmitter=require(_0x45eb('0x0'));var SmsAccount=require(_0x45eb('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x45eb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x45eb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3749bf){return function(_0x54d64b,_0x4adb0a,_0x5d4615){SmsAccountEvents['emit'](_0x3749bf+':'+_0x54d64b['id'],_0x54d64b);SmsAccountEvents['emit'](_0x3749bf,_0x54d64b);_0x5d4615(null);};}for(var e in events){if(events[_0x45eb('0x4')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x45eb('0x5')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index d772776..f72678e 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 _0x3a58=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','api'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3a58,0xea));var _0x83a5=function(_0x5b67bb,_0x4e510c){_0x5b67bb=_0x5b67bb-0x0;var _0x1cd183=_0x3a58[_0x5b67bb];return _0x1cd183;};'use strict';var _=require(_0x83a5('0x0'));var util=require(_0x83a5('0x1'));var logger=require(_0x83a5('0x2'))(_0x83a5('0x3'));var moment=require(_0x83a5('0x4'));var BPromise=require(_0x83a5('0x5'));var rp=require(_0x83a5('0x6'));var fs=require('fs');var path=require(_0x83a5('0x7'));var rimraf=require(_0x83a5('0x8'));var config=require(_0x83a5('0x9'));var attributes=require(_0x83a5('0xa'));module[_0x83a5('0xb')]=function(_0x55435b,_0x472ec6){return _0x55435b[_0x83a5('0xc')](_0x83a5('0xd'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3766=['SmsAccount','sms_accounts','lodash','util','bluebird','request-promise','path','rimraf','exports'];(function(_0x5d3e72,_0x838c6b){var _0x42342d=function(_0x4b52f2){while(--_0x4b52f2){_0x5d3e72['push'](_0x5d3e72['shift']());}};_0x42342d(++_0x838c6b);}(_0x3766,0xd1));var _0x6376=function(_0x47d56f,_0x4115dc){_0x47d56f=_0x47d56f-0x0;var _0x4c66a1=_0x3766[_0x47d56f];return _0x4c66a1;};'use strict';var _=require(_0x6376('0x0'));var util=require(_0x6376('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6376('0x2'));var rp=require(_0x6376('0x3'));var fs=require('fs');var path=require(_0x6376('0x4'));var rimraf=require(_0x6376('0x5'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x6376('0x6')]=function(_0x57fa35,_0x3b1b91){return _0x57fa35['define'](_0x6376('0x7'),attributes,{'tableName':_0x6376('0x8'),'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 71465b2..e9c9fcb 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 _0x55d9=['stringify','error','code','message','catch','ShowSmsAccount','SmsAccount','find','options','raw','include','map','model','attributes','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2616a5,_0x16564c){var _0x594e2b=function(_0x1178d4){while(--_0x1178d4){_0x2616a5['push'](_0x2616a5['shift']());}};_0x594e2b(++_0x16564c);}(_0x55d9,0x80));var _0x955d=function(_0x17676d,_0x455155){_0x17676d=_0x17676d-0x0;var _0x29bd4a=_0x55d9[_0x17676d];return _0x29bd4a;};'use strict';var _=require('lodash');var util=require(_0x955d('0x0'));var moment=require('moment');var BPromise=require(_0x955d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x955d('0x2'));var db=require(_0x955d('0x3'))['db'];var utils=require(_0x955d('0x4'));var logger=require(_0x955d('0x5'))(_0x955d('0x6'));var config=require(_0x955d('0x7'));var jayson=require(_0x955d('0x8'));var client=jayson[_0x955d('0x9')][_0x955d('0xa')]({'port':0x232a});config['redis']=_[_0x955d('0xb')](config[_0x955d('0xc')],{'host':_0x955d('0xd'),'port':0x18eb});var socket=require(_0x955d('0xe'))(new Redis(config[_0x955d('0xc')]));require(_0x955d('0xf'))[_0x955d('0x10')](socket);function respondWithRpcPromise(_0x3ce31c,_0x5f1d2f,_0x2c8104){return new BPromise(function(_0x4bb839,_0x57643f){return client[_0x955d('0x11')](_0x3ce31c,_0x2c8104)[_0x955d('0x12')](function(_0xe35f9e){logger[_0x955d('0x13')](_0x955d('0x14'),_0x5f1d2f,_0x955d('0x15'));logger[_0x955d('0x16')](_0x955d('0x17'),_0x5f1d2f,_0x955d('0x15'),JSON[_0x955d('0x18')](_0xe35f9e));if(_0xe35f9e['error']){if(_0xe35f9e[_0x955d('0x19')][_0x955d('0x1a')]===0x1f4){logger[_0x955d('0x19')](_0x955d('0x14'),_0x5f1d2f,_0xe35f9e['error']['message']);return _0x57643f(_0xe35f9e[_0x955d('0x19')][_0x955d('0x1b')]);}logger[_0x955d('0x19')](_0x955d('0x14'),_0x5f1d2f,_0xe35f9e[_0x955d('0x19')][_0x955d('0x1b')]);return _0x4bb839(_0xe35f9e['error'][_0x955d('0x1b')]);}else{logger['info'](_0x955d('0x14'),_0x5f1d2f,_0x955d('0x15'));_0x4bb839(_0xe35f9e['result'][_0x955d('0x1b')]);}})[_0x955d('0x1c')](function(_0x1c8fa1){logger['error']('SmsAccount,\x20%s,\x20%s',_0x5f1d2f,_0x1c8fa1);_0x57643f(_0x1c8fa1);});});}exports[_0x955d('0x1d')]=function(_0x5bca92){var _0xa1b2e8=this;return new Promise(function(_0x141b75,_0x5e949a){return db[_0x955d('0x1e')][_0x955d('0x1f')]({'raw':_0x5bca92[_0x955d('0x20')]?_0x5bca92[_0x955d('0x20')][_0x955d('0x21')]===undefined?!![]:![]:!![],'where':_0x5bca92[_0x955d('0x20')]?_0x5bca92[_0x955d('0x20')]['where']||null:null,'attributes':_0x5bca92[_0x955d('0x20')]?_0x5bca92['options']['attributes']||null:null,'include':_0x5bca92[_0x955d('0x20')]?_0x5bca92[_0x955d('0x20')][_0x955d('0x22')]?_[_0x955d('0x23')](_0x5bca92['options'][_0x955d('0x22')],function(_0x3091d6){return{'model':db[_0x3091d6[_0x955d('0x24')]],'as':_0x3091d6['as'],'attributes':_0x3091d6[_0x955d('0x25')],'include':_0x3091d6['include']?_[_0x955d('0x23')](_0x3091d6[_0x955d('0x22')],function(_0x3df821){return{'model':db[_0x3df821[_0x955d('0x24')]],'as':_0x3df821['as'],'attributes':_0x3df821[_0x955d('0x25')],'include':_0x3df821[_0x955d('0x22')]?_[_0x955d('0x23')](_0x3df821[_0x955d('0x22')],function(_0x3e9146){return{'model':db[_0x3e9146[_0x955d('0x24')]],'as':_0x3e9146['as'],'attributes':_0x3e9146[_0x955d('0x25')]};}):[]};}):[]};}):[]:[]})[_0x955d('0x12')](function(_0x526d0b){logger[_0x955d('0x13')](_0x955d('0x1d'),_0x5bca92);logger[_0x955d('0x16')](_0x955d('0x1d'),_0x5bca92,JSON[_0x955d('0x18')](_0x526d0b));_0x141b75(_0x526d0b);})[_0x955d('0x1c')](function(_0x25ee6a){logger[_0x955d('0x19')](_0x955d('0x1d'),_0x25ee6a[_0x955d('0x1b')],_0x5bca92);_0x5e949a(_0xa1b2e8[_0x955d('0x19')](0x1f4,_0x25ee6a[_0x955d('0x1b')]));});});}; \ No newline at end of file +var _0xf84c=['SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','options','where','attributes','include','map','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../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'];(function(_0x2685a0,_0x1cfd66){var _0x53d59b=function(_0x1160ea){while(--_0x1160ea){_0x2685a0['push'](_0x2685a0['shift']());}};_0x53d59b(++_0x1cfd66);}(_0xf84c,0x12b));var _0xcf84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf84c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xcf84('0x0'));var moment=require(_0xcf84('0x1'));var BPromise=require(_0xcf84('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf84('0x3'));var db=require(_0xcf84('0x4'))['db'];var utils=require(_0xcf84('0x5'));var logger=require(_0xcf84('0x6'))(_0xcf84('0x7'));var config=require(_0xcf84('0x8'));var jayson=require(_0xcf84('0x9'));var client=jayson[_0xcf84('0xa')][_0xcf84('0xb')]({'port':0x232a});config[_0xcf84('0xc')]=_[_0xcf84('0xd')](config['redis'],{'host':_0xcf84('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf84('0xc')]));require(_0xcf84('0xf'))[_0xcf84('0x10')](socket);function respondWithRpcPromise(_0x57547a,_0x574417,_0x246e85){return new BPromise(function(_0x5b63b3,_0x111281){return client[_0xcf84('0x11')](_0x57547a,_0x246e85)[_0xcf84('0x12')](function(_0x49c58e){logger[_0xcf84('0x13')]('SmsAccount,\x20%s,\x20%s',_0x574417,_0xcf84('0x14'));logger[_0xcf84('0x15')](_0xcf84('0x16'),_0x574417,_0xcf84('0x14'),JSON[_0xcf84('0x17')](_0x49c58e));if(_0x49c58e[_0xcf84('0x18')]){if(_0x49c58e['error']['code']===0x1f4){logger['error'](_0xcf84('0x19'),_0x574417,_0x49c58e[_0xcf84('0x18')]['message']);return _0x111281(_0x49c58e[_0xcf84('0x18')][_0xcf84('0x1a')]);}logger[_0xcf84('0x18')](_0xcf84('0x19'),_0x574417,_0x49c58e[_0xcf84('0x18')][_0xcf84('0x1a')]);return _0x5b63b3(_0x49c58e[_0xcf84('0x18')][_0xcf84('0x1a')]);}else{logger['info'](_0xcf84('0x19'),_0x574417,_0xcf84('0x14'));_0x5b63b3(_0x49c58e[_0xcf84('0x1b')][_0xcf84('0x1a')]);}})[_0xcf84('0x1c')](function(_0x4ae7ee){logger[_0xcf84('0x18')](_0xcf84('0x19'),_0x574417,_0x4ae7ee);_0x111281(_0x4ae7ee);});});}exports[_0xcf84('0x1d')]=function(_0x4b1c1e){var _0x14e7d8=this;return new Promise(function(_0x1ba4c4,_0x3f8aa5){return db['SmsAccount']['find']({'raw':_0x4b1c1e['options']?_0x4b1c1e[_0xcf84('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4b1c1e['options']?_0x4b1c1e[_0xcf84('0x1e')][_0xcf84('0x1f')]||null:null,'attributes':_0x4b1c1e['options']?_0x4b1c1e['options'][_0xcf84('0x20')]||null:null,'include':_0x4b1c1e[_0xcf84('0x1e')]?_0x4b1c1e[_0xcf84('0x1e')][_0xcf84('0x21')]?_[_0xcf84('0x22')](_0x4b1c1e['options'][_0xcf84('0x21')],function(_0x4f7312){return{'model':db[_0x4f7312[_0xcf84('0x23')]],'as':_0x4f7312['as'],'attributes':_0x4f7312['attributes'],'include':_0x4f7312['include']?_[_0xcf84('0x22')](_0x4f7312[_0xcf84('0x21')],function(_0x3f0a3e){return{'model':db[_0x3f0a3e[_0xcf84('0x23')]],'as':_0x3f0a3e['as'],'attributes':_0x3f0a3e['attributes'],'include':_0x3f0a3e[_0xcf84('0x21')]?_['map'](_0x3f0a3e['include'],function(_0x312f20){return{'model':db[_0x312f20['model']],'as':_0x312f20['as'],'attributes':_0x312f20[_0xcf84('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a2cc7){logger[_0xcf84('0x13')](_0xcf84('0x1d'),_0x4b1c1e);logger[_0xcf84('0x15')](_0xcf84('0x1d'),_0x4b1c1e,JSON[_0xcf84('0x17')](_0x4a2cc7));_0x1ba4c4(_0x4a2cc7);})[_0xcf84('0x1c')](function(_0x21df87){logger[_0xcf84('0x18')](_0xcf84('0x1d'),_0x21df87[_0xcf84('0x1a')],_0x4b1c1e);_0x3f8aa5(_0x14e7d8[_0xcf84('0x18')](0x1f4,_0x21df87[_0xcf84('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index c334291..665ec6a 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 d0c489f..0022e1a 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 _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x70eeec,_0x2ae036){var _0x4d4472=function(_0x5e07eb){while(--_0x5e07eb){_0x70eeec['push'](_0x70eeec['shift']());}};_0x4d4472(++_0x2ae036);}(_0x008c,0x188));var _0xc008=function(_0x2a99e2,_0x1803e4){_0x2a99e2=_0x2a99e2-0x0;var _0x23fb5f=_0x008c[_0x2a99e2];return _0x23fb5f;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=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(_0x1c389f,_0x26254f){var _0x435f65=function(_0x3cab40){while(--_0x3cab40){_0x1c389f['push'](_0x1c389f['shift']());}};_0x435f65(++_0x26254f);}(_0xedd9,0xfc));var _0x9edd=function(_0xf9eaef,_0x162735){_0xf9eaef=_0xf9eaef-0x0;var _0x2a3705=_0xedd9[_0xf9eaef];return _0x2a3705;};'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 84bc28b..ff9b66b 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 _0xbc7f=['STRING','*,*,*,*','exports','INTEGER','noop'];(function(_0x3e5bc8,_0x457d89){var _0xfd84bc=function(_0x1a766c){while(--_0x1a766c){_0x3e5bc8['push'](_0x3e5bc8['shift']());}};_0xfd84bc(++_0x457d89);}(_0xbc7f,0x110));var _0xfbc7=function(_0x12e9cf,_0x390d13){_0x12e9cf=_0x12e9cf-0x0;var _0x20b263=_0xbc7f[_0x12e9cf];return _0x20b263;};'use strict';var Sequelize=require('sequelize');module[_0xfbc7('0x0')]={'priority':{'type':Sequelize[_0xfbc7('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfbc7('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xfbc7('0x3')]},'interval':{'type':Sequelize[_0xfbc7('0x3')],'defaultValue':_0xfbc7('0x4')}}; \ No newline at end of file +var _0x0346=['STRING','*,*,*,*','exports','INTEGER','noop'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x0346,0x13d));var _0x6034=function(_0x21b366,_0xd72590){_0x21b366=_0x21b366-0x0;var _0xb4f54b=_0x0346[_0x21b366];return _0xb4f54b;};'use strict';var Sequelize=require('sequelize');module[_0x6034('0x0')]={'priority':{'type':Sequelize[_0x6034('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6034('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6034('0x3')],'defaultValue':_0x6034('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 6203508..9b0dc27 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 _0x3cf0=['params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','keys','find','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cf0,0xe5));var _0x03cf=function(_0x56a585,_0x1d3e03){_0x56a585=_0x56a585-0x0;var _0xb1a7fa=_0x3cf0[_0x56a585];return _0xb1a7fa;};'use strict';var emlformat=require(_0x03cf('0x0'));var rimraf=require(_0x03cf('0x1'));var zipdir=require(_0x03cf('0x2'));var jsonpatch=require(_0x03cf('0x3'));var rp=require(_0x03cf('0x4'));var moment=require(_0x03cf('0x5'));var BPromise=require(_0x03cf('0x6'));var Mustache=require(_0x03cf('0x7'));var util=require(_0x03cf('0x8'));var path=require(_0x03cf('0x9'));var sox=require(_0x03cf('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03cf('0xb'));var _=require(_0x03cf('0xc'));var squel=require(_0x03cf('0xd'));var crypto=require(_0x03cf('0xe'));var jsforce=require(_0x03cf('0xf'));var deskjs=require(_0x03cf('0x10'));var toCsv=require(_0x03cf('0x11'));var querystring=require('querystring');var Papa=require(_0x03cf('0x12'));var Redis=require(_0x03cf('0x13'));var authService=require(_0x03cf('0x14'));var qs=require(_0x03cf('0x15'));var as=require(_0x03cf('0x16'));var hardwareService=require(_0x03cf('0x17'));var logger=require(_0x03cf('0x18'))(_0x03cf('0x19'));var utils=require('../../config/utils');var config=require(_0x03cf('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x03cf('0x1b'))['db'];function respondWithStatusCode(_0x16d81a,_0xcf88db){_0xcf88db=_0xcf88db||0xcc;return function(_0x736859){if(_0x736859){return _0x16d81a['sendStatus'](_0xcf88db);}return _0x16d81a[_0x03cf('0x1c')](_0xcf88db)['end']();};}function respondWithResult(_0x43e11a,_0x5960f7){_0x5960f7=_0x5960f7||0xc8;return function(_0x24f9cd){if(_0x24f9cd){return _0x43e11a[_0x03cf('0x1c')](_0x5960f7)[_0x03cf('0x1d')](_0x24f9cd);}};}function respondWithFilteredResult(_0xeb828c,_0x54c79b){return function(_0x546b27){if(_0x546b27){var _0x16df30=typeof _0x54c79b['offset']===_0x03cf('0x1e')&&typeof _0x54c79b[_0x03cf('0x1f')]==='undefined';var _0x5d188c=_0x546b27[_0x03cf('0x20')];var _0x2ef054=_0x16df30?0x0:_0x54c79b['offset'];var _0x5ce642=_0x16df30?_0x546b27['count']:_0x54c79b[_0x03cf('0x21')]+_0x54c79b[_0x03cf('0x1f')];var _0x2a8282;if(_0x5ce642>=_0x5d188c){_0x5ce642=_0x5d188c;_0x2a8282=0xc8;}else{_0x2a8282=0xce;}_0xeb828c[_0x03cf('0x1c')](_0x2a8282);return _0xeb828c[_0x03cf('0x22')](_0x03cf('0x23'),_0x2ef054+'-'+_0x5ce642+'/'+_0x5d188c)[_0x03cf('0x1d')](_0x546b27);}return null;};}function patchUpdates(_0xb7f836){return function(_0x4a21c4){try{jsonpatch[_0x03cf('0x24')](_0x4a21c4,_0xb7f836,!![]);}catch(_0x4f7a61){return BPromise[_0x03cf('0x25')](_0x4f7a61);}return _0x4a21c4['save']();};}function saveUpdates(_0x38e8c0,_0x58e6bb){return function(_0x3dde36){if(_0x3dde36){return _0x3dde36[_0x03cf('0x26')](_0x38e8c0)[_0x03cf('0x27')](function(_0x4a4deb){return _0x4a4deb;});}return null;};}function removeEntity(_0x277b12,_0x237275){return function(_0x24bca6){if(_0x24bca6){return _0x24bca6[_0x03cf('0x28')]()['then'](function(){_0x277b12['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x377820,_0x284b68){return function(_0x1a40dd){if(!_0x1a40dd){_0x377820[_0x03cf('0x29')](0x194);}return _0x1a40dd;};}function handleError(_0x43d012,_0x5f1da7){_0x5f1da7=_0x5f1da7||0x1f4;return function(_0xf144c6){logger[_0x03cf('0x2a')](_0xf144c6[_0x03cf('0x2b')]);if(_0xf144c6[_0x03cf('0x2c')]){delete _0xf144c6[_0x03cf('0x2c')];}_0x43d012['status'](_0x5f1da7)[_0x03cf('0x2d')](_0xf144c6);};}exports[_0x03cf('0x2e')]=function(_0x5b58c8,_0x170d9b){var _0x391b6b={},_0x224953={},_0x4d56c2={'count':0x0,'rows':[]};var _0x5f3542=_[_0x03cf('0x2f')](db[_0x03cf('0x30')][_0x03cf('0x31')],function(_0x2eaab3){return{'name':_0x2eaab3[_0x03cf('0x32')],'type':_0x2eaab3[_0x03cf('0x33')]['key']};});_0x224953[_0x03cf('0x34')]=_[_0x03cf('0x2f')](_0x5f3542,_0x03cf('0x2c'));_0x224953[_0x03cf('0x35')]=_['keys'](_0x5b58c8['query']);_0x224953[_0x03cf('0x36')]=_[_0x03cf('0x37')](_0x224953['model'],_0x224953[_0x03cf('0x35')]);_0x391b6b[_0x03cf('0x38')]=_[_0x03cf('0x37')](_0x224953['model'],qs[_0x03cf('0x39')](_0x5b58c8[_0x03cf('0x35')]['fields']));_0x391b6b[_0x03cf('0x38')]=_0x391b6b[_0x03cf('0x38')][_0x03cf('0x3a')]?_0x391b6b[_0x03cf('0x38')]:_0x224953[_0x03cf('0x34')];if(!_0x5b58c8[_0x03cf('0x35')][_0x03cf('0x3b')]('nolimit')){_0x391b6b[_0x03cf('0x1f')]=qs[_0x03cf('0x1f')](_0x5b58c8['query'][_0x03cf('0x1f')]);_0x391b6b[_0x03cf('0x21')]=qs[_0x03cf('0x21')](_0x5b58c8[_0x03cf('0x35')][_0x03cf('0x21')]);}_0x391b6b[_0x03cf('0x3c')]=qs[_0x03cf('0x3d')](_0x5b58c8[_0x03cf('0x35')][_0x03cf('0x3d')]);_0x391b6b[_0x03cf('0x3e')]=qs['filters'](_[_0x03cf('0x3f')](_0x5b58c8[_0x03cf('0x35')],_0x224953[_0x03cf('0x36')]),_0x5f3542);if(_0x5b58c8['query'][_0x03cf('0x40')]){_0x391b6b[_0x03cf('0x3e')]=_[_0x03cf('0x41')](_0x391b6b[_0x03cf('0x3e')],{'$or':_[_0x03cf('0x2f')](_0x5f3542,function(_0x506534){if(_0x506534[_0x03cf('0x33')]!==_0x03cf('0x42')){var _0x3cc8e4={};_0x3cc8e4[_0x506534[_0x03cf('0x2c')]]={'$like':'%'+_0x5b58c8['query']['filter']+'%'};return _0x3cc8e4;}})});}_0x391b6b=_['merge']({},_0x391b6b,_0x5b58c8[_0x03cf('0x43')]);var _0x22f5cc={'where':_0x391b6b['where']};return db[_0x03cf('0x30')][_0x03cf('0x20')](_0x22f5cc)[_0x03cf('0x27')](function(_0x15eb66){_0x4d56c2[_0x03cf('0x20')]=_0x15eb66;if(_0x5b58c8[_0x03cf('0x35')][_0x03cf('0x44')]){_0x391b6b['include']=[{'all':!![]}];}return db[_0x03cf('0x30')][_0x03cf('0x45')](_0x391b6b);})[_0x03cf('0x27')](function(_0x24ff4d){_0x4d56c2['rows']=_0x24ff4d;return _0x4d56c2;})['then'](respondWithFilteredResult(_0x170d9b,_0x391b6b))[_0x03cf('0x46')](handleError(_0x170d9b,null));};exports['show']=function(_0x3111fb,_0x2fb354){var _0x17aecf={'raw':!![],'where':{'id':_0x3111fb['params']['id']}},_0x438b0c={};_0x438b0c[_0x03cf('0x34')]=_[_0x03cf('0x47')](db[_0x03cf('0x30')]['rawAttributes']);_0x438b0c[_0x03cf('0x35')]=_['keys'](_0x3111fb[_0x03cf('0x35')]);_0x438b0c['filters']=_[_0x03cf('0x37')](_0x438b0c['model'],_0x438b0c[_0x03cf('0x35')]);_0x17aecf['attributes']=_[_0x03cf('0x37')](_0x438b0c['model'],qs['fields'](_0x3111fb[_0x03cf('0x35')]['fields']));_0x17aecf[_0x03cf('0x38')]=_0x17aecf[_0x03cf('0x38')][_0x03cf('0x3a')]?_0x17aecf[_0x03cf('0x38')]:_0x438b0c[_0x03cf('0x34')];if(_0x3111fb[_0x03cf('0x35')]['includeAll']){_0x17aecf['include']=[{'all':!![]}];}_0x17aecf=_[_0x03cf('0x41')]({},_0x17aecf,_0x3111fb[_0x03cf('0x43')]);return db[_0x03cf('0x30')][_0x03cf('0x48')](_0x17aecf)[_0x03cf('0x27')](handleEntityNotFound(_0x2fb354,null))[_0x03cf('0x27')](respondWithResult(_0x2fb354,null))[_0x03cf('0x46')](handleError(_0x2fb354,null));};exports[_0x03cf('0x49')]=function(_0x3c473a,_0x527836){return db[_0x03cf('0x30')][_0x03cf('0x49')](_0x3c473a[_0x03cf('0x4a')],{})[_0x03cf('0x27')](respondWithResult(_0x527836,0xc9))[_0x03cf('0x46')](handleError(_0x527836,null));};exports[_0x03cf('0x26')]=function(_0x18f4ea,_0x1605ee){if(_0x18f4ea[_0x03cf('0x4a')]['id']){delete _0x18f4ea[_0x03cf('0x4a')]['id'];}return db[_0x03cf('0x30')][_0x03cf('0x48')]({'where':{'id':_0x18f4ea[_0x03cf('0x4b')]['id']}})[_0x03cf('0x27')](handleEntityNotFound(_0x1605ee,null))['then'](saveUpdates(_0x18f4ea[_0x03cf('0x4a')],null))[_0x03cf('0x27')](respondWithResult(_0x1605ee,null))[_0x03cf('0x46')](handleError(_0x1605ee,null));};exports['destroy']=function(_0x6c6bdc,_0x37eac1){return db[_0x03cf('0x30')]['find']({'where':{'id':_0x6c6bdc[_0x03cf('0x4b')]['id']}})[_0x03cf('0x27')](handleEntityNotFound(_0x37eac1,null))[_0x03cf('0x27')](removeEntity(_0x37eac1,null))[_0x03cf('0x46')](handleError(_0x37eac1,null));}; \ No newline at end of file +var _0x11e7=['to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SmsApplication','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x2e75af,_0x238d0f){var _0xee7299=function(_0x4487f7){while(--_0x4487f7){_0x2e75af['push'](_0x2e75af['shift']());}};_0xee7299(++_0x238d0f);}(_0x11e7,0x1e1));var _0x711e=function(_0x2b5dbd,_0xf786ac){_0x2b5dbd=_0x2b5dbd-0x0;var _0x4d39d7=_0x11e7[_0x2b5dbd];return _0x4d39d7;};'use strict';var emlformat=require(_0x711e('0x0'));var rimraf=require(_0x711e('0x1'));var zipdir=require(_0x711e('0x2'));var jsonpatch=require(_0x711e('0x3'));var rp=require(_0x711e('0x4'));var moment=require(_0x711e('0x5'));var BPromise=require(_0x711e('0x6'));var Mustache=require(_0x711e('0x7'));var util=require(_0x711e('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x711e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x711e('0xa'));var _=require(_0x711e('0xb'));var squel=require(_0x711e('0xc'));var crypto=require('crypto');var jsforce=require(_0x711e('0xd'));var deskjs=require(_0x711e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x711e('0xf'));var Papa=require(_0x711e('0x10'));var Redis=require(_0x711e('0x11'));var authService=require(_0x711e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x711e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x711e('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x711e('0x15'));var db=require(_0x711e('0x16'))['db'];function respondWithStatusCode(_0x28c654,_0xf852c7){_0xf852c7=_0xf852c7||0xcc;return function(_0x16fddc){if(_0x16fddc){return _0x28c654['sendStatus'](_0xf852c7);}return _0x28c654[_0x711e('0x17')](_0xf852c7)['end']();};}function respondWithResult(_0x584d04,_0x3fafd2){_0x3fafd2=_0x3fafd2||0xc8;return function(_0x27d658){if(_0x27d658){return _0x584d04[_0x711e('0x17')](_0x3fafd2)[_0x711e('0x18')](_0x27d658);}};}function respondWithFilteredResult(_0x5b4c03,_0x294cce){return function(_0x137c65){if(_0x137c65){var _0x36cec7=typeof _0x294cce[_0x711e('0x19')]==='undefined'&&typeof _0x294cce[_0x711e('0x1a')]==='undefined';var _0x54e812=_0x137c65[_0x711e('0x1b')];var _0x2d2be4=_0x36cec7?0x0:_0x294cce[_0x711e('0x19')];var _0x32ab8b=_0x36cec7?_0x137c65[_0x711e('0x1b')]:_0x294cce[_0x711e('0x19')]+_0x294cce[_0x711e('0x1a')];var _0x7bf5cb;if(_0x32ab8b>=_0x54e812){_0x32ab8b=_0x54e812;_0x7bf5cb=0xc8;}else{_0x7bf5cb=0xce;}_0x5b4c03[_0x711e('0x17')](_0x7bf5cb);return _0x5b4c03[_0x711e('0x1c')](_0x711e('0x1d'),_0x2d2be4+'-'+_0x32ab8b+'/'+_0x54e812)[_0x711e('0x18')](_0x137c65);}return null;};}function patchUpdates(_0x776d61){return function(_0x351667){try{jsonpatch['apply'](_0x351667,_0x776d61,!![]);}catch(_0x36f4d2){return BPromise['reject'](_0x36f4d2);}return _0x351667['save']();};}function saveUpdates(_0x29190e,_0x3a4e2d){return function(_0xe9da6f){if(_0xe9da6f){return _0xe9da6f[_0x711e('0x1e')](_0x29190e)[_0x711e('0x1f')](function(_0x5ae394){return _0x5ae394;});}return null;};}function removeEntity(_0x3d4eec,_0x2c4fdb){return function(_0x32f008){if(_0x32f008){return _0x32f008[_0x711e('0x20')]()[_0x711e('0x1f')](function(){_0x3d4eec['status'](0xcc)[_0x711e('0x21')]();});}};}function handleEntityNotFound(_0x49abe5,_0x59b947){return function(_0x5ba616){if(!_0x5ba616){_0x49abe5['sendStatus'](0x194);}return _0x5ba616;};}function handleError(_0x568f83,_0x27da8c){_0x27da8c=_0x27da8c||0x1f4;return function(_0x56e2fc){logger[_0x711e('0x22')](_0x56e2fc['stack']);if(_0x56e2fc[_0x711e('0x23')]){delete _0x56e2fc['name'];}_0x568f83[_0x711e('0x17')](_0x27da8c)[_0x711e('0x24')](_0x56e2fc);};}exports[_0x711e('0x25')]=function(_0x225b8b,_0x37f6be){var _0x9e8674={},_0x2e2c47={},_0x4a03f9={'count':0x0,'rows':[]};var _0x4f9b4d=_[_0x711e('0x26')](db['SmsApplication'][_0x711e('0x27')],function(_0x29a090){return{'name':_0x29a090[_0x711e('0x28')],'type':_0x29a090[_0x711e('0x29')][_0x711e('0x2a')]};});_0x2e2c47[_0x711e('0x2b')]=_[_0x711e('0x26')](_0x4f9b4d,_0x711e('0x23'));_0x2e2c47[_0x711e('0x2c')]=_[_0x711e('0x2d')](_0x225b8b[_0x711e('0x2c')]);_0x2e2c47[_0x711e('0x2e')]=_[_0x711e('0x2f')](_0x2e2c47[_0x711e('0x2b')],_0x2e2c47['query']);_0x9e8674['attributes']=_[_0x711e('0x2f')](_0x2e2c47[_0x711e('0x2b')],qs[_0x711e('0x30')](_0x225b8b[_0x711e('0x2c')][_0x711e('0x30')]));_0x9e8674[_0x711e('0x31')]=_0x9e8674[_0x711e('0x31')][_0x711e('0x32')]?_0x9e8674[_0x711e('0x31')]:_0x2e2c47[_0x711e('0x2b')];if(!_0x225b8b['query'][_0x711e('0x33')](_0x711e('0x34'))){_0x9e8674['limit']=qs[_0x711e('0x1a')](_0x225b8b[_0x711e('0x2c')]['limit']);_0x9e8674[_0x711e('0x19')]=qs[_0x711e('0x19')](_0x225b8b[_0x711e('0x2c')]['offset']);}_0x9e8674['order']=qs[_0x711e('0x35')](_0x225b8b[_0x711e('0x2c')][_0x711e('0x35')]);_0x9e8674[_0x711e('0x36')]=qs[_0x711e('0x2e')](_[_0x711e('0x37')](_0x225b8b[_0x711e('0x2c')],_0x2e2c47[_0x711e('0x2e')]),_0x4f9b4d);if(_0x225b8b[_0x711e('0x2c')][_0x711e('0x38')]){_0x9e8674['where']=_[_0x711e('0x39')](_0x9e8674[_0x711e('0x36')],{'$or':_[_0x711e('0x26')](_0x4f9b4d,function(_0x201d29){if(_0x201d29[_0x711e('0x29')]!==_0x711e('0x3a')){var _0x15917e={};_0x15917e[_0x201d29[_0x711e('0x23')]]={'$like':'%'+_0x225b8b['query'][_0x711e('0x38')]+'%'};return _0x15917e;}})});}_0x9e8674=_[_0x711e('0x39')]({},_0x9e8674,_0x225b8b[_0x711e('0x3b')]);var _0x2987fb={'where':_0x9e8674[_0x711e('0x36')]};return db[_0x711e('0x3c')]['count'](_0x2987fb)[_0x711e('0x1f')](function(_0x1a74cf){_0x4a03f9[_0x711e('0x1b')]=_0x1a74cf;if(_0x225b8b[_0x711e('0x2c')][_0x711e('0x3d')]){_0x9e8674[_0x711e('0x3e')]=[{'all':!![]}];}return db['SmsApplication'][_0x711e('0x3f')](_0x9e8674);})[_0x711e('0x1f')](function(_0x527538){_0x4a03f9['rows']=_0x527538;return _0x4a03f9;})['then'](respondWithFilteredResult(_0x37f6be,_0x9e8674))[_0x711e('0x40')](handleError(_0x37f6be,null));};exports[_0x711e('0x41')]=function(_0x39b959,_0x2402d){var _0x1da06c={'raw':!![],'where':{'id':_0x39b959[_0x711e('0x42')]['id']}},_0x3a91d7={};_0x3a91d7[_0x711e('0x2b')]=_[_0x711e('0x2d')](db[_0x711e('0x3c')]['rawAttributes']);_0x3a91d7['query']=_[_0x711e('0x2d')](_0x39b959[_0x711e('0x2c')]);_0x3a91d7[_0x711e('0x2e')]=_[_0x711e('0x2f')](_0x3a91d7[_0x711e('0x2b')],_0x3a91d7[_0x711e('0x2c')]);_0x1da06c[_0x711e('0x31')]=_[_0x711e('0x2f')](_0x3a91d7['model'],qs[_0x711e('0x30')](_0x39b959[_0x711e('0x2c')][_0x711e('0x30')]));_0x1da06c['attributes']=_0x1da06c[_0x711e('0x31')][_0x711e('0x32')]?_0x1da06c['attributes']:_0x3a91d7['model'];if(_0x39b959['query'][_0x711e('0x3d')]){_0x1da06c[_0x711e('0x3e')]=[{'all':!![]}];}_0x1da06c=_['merge']({},_0x1da06c,_0x39b959['options']);return db[_0x711e('0x3c')][_0x711e('0x43')](_0x1da06c)[_0x711e('0x1f')](handleEntityNotFound(_0x2402d,null))[_0x711e('0x1f')](respondWithResult(_0x2402d,null))['catch'](handleError(_0x2402d,null));};exports[_0x711e('0x44')]=function(_0x1f4b3a,_0xb8956){return db['SmsApplication'][_0x711e('0x44')](_0x1f4b3a[_0x711e('0x45')],{})['then'](respondWithResult(_0xb8956,0xc9))[_0x711e('0x40')](handleError(_0xb8956,null));};exports['update']=function(_0x138c63,_0x130660){if(_0x138c63[_0x711e('0x45')]['id']){delete _0x138c63[_0x711e('0x45')]['id'];}return db[_0x711e('0x3c')][_0x711e('0x43')]({'where':{'id':_0x138c63['params']['id']}})[_0x711e('0x1f')](handleEntityNotFound(_0x130660,null))[_0x711e('0x1f')](saveUpdates(_0x138c63['body'],null))['then'](respondWithResult(_0x130660,null))[_0x711e('0x40')](handleError(_0x130660,null));};exports[_0x711e('0x20')]=function(_0x240e06,_0x509c86){return db[_0x711e('0x3c')][_0x711e('0x43')]({'where':{'id':_0x240e06[_0x711e('0x42')]['id']}})[_0x711e('0x1f')](handleEntityNotFound(_0x509c86,null))['then'](removeEntity(_0x509c86,null))['catch'](handleError(_0x509c86,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index e3143e8..7896afc 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 _0xdb93=['lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','SmsApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4defd6,_0x37bbd3){var _0x4c9276=function(_0x1d7a3d){while(--_0x1d7a3d){_0x4defd6['push'](_0x4defd6['shift']());}};_0x4c9276(++_0x37bbd3);}(_0xdb93,0x12c));var _0x3db9=function(_0x20a001,_0x326e17){_0x20a001=_0x20a001-0x0;var _0x3d0500=_0xdb93[_0x20a001];return _0x3d0500;};'use strict';var _=require(_0x3db9('0x0'));var util=require('util');var logger=require(_0x3db9('0x1'))(_0x3db9('0x2'));var moment=require(_0x3db9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3db9('0x4'));var rimraf=require(_0x3db9('0x5'));var config=require(_0x3db9('0x6'));var attributes=require('./smsApplication.attributes');module['exports']=function(_0xa64bc2,_0x303e52){return _0xa64bc2['define'](_0x3db9('0x7'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3db9('0x8'),'collate':_0x3db9('0x9')});}; \ No newline at end of file +var _0x305f=['rimraf','../../config/environment','./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path'];(function(_0x1c4a09,_0x48db3f){var _0x5baaab=function(_0x27206f){while(--_0x27206f){_0x1c4a09['push'](_0x1c4a09['shift']());}};_0x5baaab(++_0x48db3f);}(_0x305f,0x97));var _0xf305=function(_0x4cba77,_0x4f4f45){_0x4cba77=_0x4cba77-0x0;var _0x2dacd3=_0x305f[_0x4cba77];return _0x2dacd3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf305('0x0'))(_0xf305('0x1'));var moment=require(_0xf305('0x2'));var BPromise=require(_0xf305('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf305('0x4'));var rimraf=require(_0xf305('0x5'));var config=require(_0xf305('0x6'));var attributes=require(_0xf305('0x7'));module[_0xf305('0x8')]=function(_0x27a140,_0x272e9e){return _0x27a140['define'](_0xf305('0x9'),attributes,{'tableName':_0xf305('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf305('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 255baa9..797df47 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 _0x85f8=['jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x85f8,0xd7));var _0x885f=function(_0x22d92f,_0x476749){_0x22d92f=_0x22d92f-0x0;var _0x46962a=_0x85f8[_0x22d92f];return _0x46962a;};'use strict';var _=require(_0x885f('0x0'));var util=require(_0x885f('0x1'));var moment=require(_0x885f('0x2'));var BPromise=require(_0x885f('0x3'));var rs=require(_0x885f('0x4'));var fs=require('fs');var Redis=require(_0x885f('0x5'));var db=require(_0x885f('0x6'))['db'];var utils=require(_0x885f('0x7'));var logger=require('../../config/logger')(_0x885f('0x8'));var config=require(_0x885f('0x9'));var jayson=require(_0x885f('0xa'));var client=jayson['client'][_0x885f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x270c84,_0x38da33,_0xc3ac){return new BPromise(function(_0x35e2be,_0x188593){return client[_0x885f('0xc')](_0x270c84,_0xc3ac)[_0x885f('0xd')](function(_0xece628){logger[_0x885f('0xe')](_0x885f('0xf'),_0x38da33,_0x885f('0x10'));logger[_0x885f('0x11')](_0x885f('0x12'),_0x38da33,'request\x20sent',JSON[_0x885f('0x13')](_0xece628));if(_0xece628[_0x885f('0x14')]){if(_0xece628[_0x885f('0x14')][_0x885f('0x15')]===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x38da33,_0xece628['error'][_0x885f('0x16')]);return _0x188593(_0xece628[_0x885f('0x14')][_0x885f('0x16')]);}logger['error'](_0x885f('0xf'),_0x38da33,_0xece628[_0x885f('0x14')][_0x885f('0x16')]);return _0x35e2be(_0xece628[_0x885f('0x14')][_0x885f('0x16')]);}else{logger[_0x885f('0xe')](_0x885f('0xf'),_0x38da33,'request\x20sent');_0x35e2be(_0xece628[_0x885f('0x17')][_0x885f('0x16')]);}})[_0x885f('0x18')](function(_0x3b05a3){logger[_0x885f('0x14')](_0x885f('0xf'),_0x38da33,_0x3b05a3);_0x188593(_0x3b05a3);});});} \ No newline at end of file +var _0x5eed=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2e6c0a,_0x21948e){var _0x5bb477=function(_0xbfaeec){while(--_0xbfaeec){_0x2e6c0a['push'](_0x2e6c0a['shift']());}};_0x5bb477(++_0x21948e);}(_0x5eed,0x10a));var _0xd5ee=function(_0x6824dd,_0x1d414c){_0x6824dd=_0x6824dd-0x0;var _0x30ca93=_0x5eed[_0x6824dd];return _0x30ca93;};'use strict';var _=require(_0xd5ee('0x0'));var util=require(_0xd5ee('0x1'));var moment=require(_0xd5ee('0x2'));var BPromise=require(_0xd5ee('0x3'));var rs=require(_0xd5ee('0x4'));var fs=require('fs');var Redis=require(_0xd5ee('0x5'));var db=require(_0xd5ee('0x6'))['db'];var utils=require(_0xd5ee('0x7'));var logger=require(_0xd5ee('0x8'))(_0xd5ee('0x9'));var config=require('../../config/environment');var jayson=require(_0xd5ee('0xa'));var client=jayson[_0xd5ee('0xb')][_0xd5ee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38b0e3,_0x458212,_0x181790){return new BPromise(function(_0x162bb5,_0x217e70){return client['request'](_0x38b0e3,_0x181790)['then'](function(_0x4e6495){logger[_0xd5ee('0xd')](_0xd5ee('0xe'),_0x458212,_0xd5ee('0xf'));logger[_0xd5ee('0x10')](_0xd5ee('0x11'),_0x458212,_0xd5ee('0xf'),JSON[_0xd5ee('0x12')](_0x4e6495));if(_0x4e6495[_0xd5ee('0x13')]){if(_0x4e6495['error'][_0xd5ee('0x14')]===0x1f4){logger[_0xd5ee('0x13')]('SmsApplication,\x20%s,\x20%s',_0x458212,_0x4e6495[_0xd5ee('0x13')][_0xd5ee('0x15')]);return _0x217e70(_0x4e6495[_0xd5ee('0x13')][_0xd5ee('0x15')]);}logger[_0xd5ee('0x13')]('SmsApplication,\x20%s,\x20%s',_0x458212,_0x4e6495['error']['message']);return _0x162bb5(_0x4e6495[_0xd5ee('0x13')][_0xd5ee('0x15')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x458212,_0xd5ee('0xf'));_0x162bb5(_0x4e6495[_0xd5ee('0x16')]['message']);}})[_0xd5ee('0x17')](function(_0x460f22){logger[_0xd5ee('0x13')](_0xd5ee('0xe'),_0x458212,_0x460f22);_0x217e70(_0x460f22);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 3e61cc1..4055aeb 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 _0x1eba=['put','/:id','update','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags'];(function(_0xe406e8,_0x2dbfd8){var _0x3f8fbe=function(_0x967a30){while(--_0x967a30){_0xe406e8['push'](_0xe406e8['shift']());}};_0x3f8fbe(++_0x2dbfd8);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0x1eba[_0x34bc6c];return _0x168820;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa1eb('0x5'));var interaction=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var controller=require(_0xa1eb('0x8'));router[_0xa1eb('0x9')]('/',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xb')]);router[_0xa1eb('0x9')](_0xa1eb('0xc'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xd')]);router[_0xa1eb('0x9')]('/:id',auth[_0xa1eb('0xa')](),controller['show']);router[_0xa1eb('0x9')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['getMessages']);router[_0xa1eb('0x9')]('/:id/download',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xe')]);router[_0xa1eb('0xf')]('/',auth['isAuthenticated'](),controller[_0xa1eb('0x10')]);router[_0xa1eb('0xf')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['addMessage']);router['post'](_0xa1eb('0x11'),auth['isAuthenticated'](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),_0xa1eb('0x14')),controller[_0xa1eb('0x15')]);router[_0xa1eb('0x16')](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:update'),controller[_0xa1eb('0x18')]);router['delete'](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:destroy'),controller[_0xa1eb('0x19')]);router[_0xa1eb('0x1a')](_0xa1eb('0x11'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0x1b')]);module[_0xa1eb('0x1c')]=router; \ No newline at end of file +var _0x955f=['fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0x3f7243,_0x57fb89){var _0x168a41=function(_0x13d105){while(--_0x13d105){_0x3f7243['push'](_0x3f7243['shift']());}};_0x168a41(++_0x57fb89);}(_0x955f,0x1eb));var _0xf955=function(_0x23acde,_0x5c5d62){_0x23acde=_0x23acde-0x0;var _0x43fc0a=_0x955f[_0x23acde];return _0x43fc0a;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./smsInteraction.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0x7')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller['getMessages']);router[_0xf955('0x7')]('/:id/download',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router[_0xf955('0xf')]('/',auth['isAuthenticated'](),controller[_0xf955('0x10')]);router['post'](_0xf955('0xd'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);router[_0xf955('0xf')](_0xf955('0x12'),auth[_0xf955('0x8')](),interaction[_0xf955('0x13')](_0xf955('0x14'),_0xf955('0x15')),controller[_0xf955('0x16')]);router[_0xf955('0x17')](_0xf955('0xb'),auth['isAuthenticated'](),interaction[_0xf955('0x13')]('sms',_0xf955('0x18')),controller[_0xf955('0x19')]);router[_0xf955('0x1a')](_0xf955('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0xf955('0x14'),_0xf955('0x1b')),controller[_0xf955('0x1c')]);router['delete'](_0xf955('0x12'),auth[_0xf955('0x8')](),controller[_0xf955('0x1d')]);module[_0xf955('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 945fb0e..9193218 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 _0x0eb2=['DATE','STRING','out','ENUM','sequelize','exports','BOOLEAN'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0x0eb2,0x11c));var _0x20eb=function(_0x14b62e,_0x3b8096){_0x14b62e=_0x14b62e-0x0;var _0x42ad69=_0x0eb2[_0x14b62e];return _0x42ad69;};'use strict';var Sequelize=require(_0x20eb('0x0'));var moment=require('moment');module[_0x20eb('0x1')]={'closed':{'type':Sequelize[_0x20eb('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x20eb('0x3')]},'disposition':{'type':Sequelize[_0x20eb('0x4')]},'secondDisposition':{'type':Sequelize[_0x20eb('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x20eb('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x20eb('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x20eb('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x20eb('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x20eb('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xfcbe=['BOOLEAN','DATE','STRING','moment','exports'];(function(_0x57180,_0x11f5b5){var _0x537eed=function(_0x430dad){while(--_0x430dad){_0x57180['push'](_0x57180['shift']());}};_0x537eed(++_0x11f5b5);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x4fc896,_0x46d23f){_0x4fc896=_0x4fc896-0x0;var _0x573fbf=_0xfcbe[_0x4fc896];return _0x573fbf;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xefcb('0x0'));module[_0xefcb('0x1')]={'closed':{'type':Sequelize[_0xefcb('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xefcb('0x3')]},'disposition':{'type':Sequelize[_0xefcb('0x4')]},'secondDisposition':{'type':Sequelize[_0xefcb('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xefcb('0x4')]},'phone':{'type':Sequelize[_0xefcb('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xefcb('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xefcb('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 5db2415..25bcde8 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 _0x9aa9=['where','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','server','tmp','push','User','fullname','CmContact','firstName','lastName','Messages','direction','secret','read','Account','Owner','get','mkdirSync','Sms','N.A.','createdAt','closedAt','filter','out','System','Contact','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','unlinkSync','rimraf','moment','bluebird','util','ejs','lodash','../../components/interaction/service','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','undefined','limit','count','offset','status','set','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','user','show','model','SmsInteraction','filters','intersection','fields','attributes','includeAll','include','merge','options','find','create','body','catch','params','describe','addMessage','SmsMessage','ids','findOne','keys','length','hasOwnProperty','nolimit','sort','pick'];(function(_0xb518e5,_0x5b627c){var _0x59c78e=function(_0x8edb1c){while(--_0x8edb1c){_0xb518e5['push'](_0xb518e5['shift']());}};_0x59c78e(++_0x5b627c);}(_0x9aa9,0x193));var _0x99aa=function(_0x4bd8a3,_0x452c5c){_0x4bd8a3=_0x4bd8a3-0x0;var _0x4eaf3c=_0x9aa9[_0x4bd8a3];return _0x4eaf3c;};'use strict';var rimraf=require(_0x99aa('0x0'));var zipdir=require('zip-dir');var moment=require(_0x99aa('0x1'));var BPromise=require(_0x99aa('0x2'));var util=require(_0x99aa('0x3'));var path=require('path');var ejs=require(_0x99aa('0x4'));var fs=require('fs');var _=require(_0x99aa('0x5'));var Redis=require('ioredis');var interaction=require(_0x99aa('0x6'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x99aa('0x7'))(_0x99aa('0x8'));var config=require(_0x99aa('0x9'));var db=require('../../mysqldb')['db'];config[_0x99aa('0xa')]=_[_0x99aa('0xb')](config['redis'],{'host':_0x99aa('0xc'),'port':0x18eb});var socket=require(_0x99aa('0xd'))(new Redis(config[_0x99aa('0xa')]));require('./smsInteraction.socket')[_0x99aa('0xe')](socket);function respondWithStatusCode(_0x495a4a,_0x23e600){_0x23e600=_0x23e600||0xcc;return function(_0x7b001b){if(_0x7b001b){return _0x495a4a[_0x99aa('0xf')](_0x23e600);}return _0x495a4a['status'](_0x23e600)[_0x99aa('0x10')]();};}function respondWithResult(_0x415ff0,_0xffdb1d){_0xffdb1d=_0xffdb1d||0xc8;return function(_0x1affce){if(_0x1affce){return _0x415ff0['status'](_0xffdb1d)[_0x99aa('0x11')](_0x1affce);}};}function respondWithFilteredResult(_0x136612,_0x4e0348){return function(_0x7e131d){if(_0x7e131d){var _0x79e4e3=typeof _0x4e0348['offset']===_0x99aa('0x12')&&typeof _0x4e0348[_0x99aa('0x13')]===_0x99aa('0x12');var _0x35f00c=_0x7e131d[_0x99aa('0x14')];var _0x39c67c=_0x79e4e3?0x0:_0x4e0348[_0x99aa('0x15')];var _0x7c2c38=_0x79e4e3?_0x7e131d['count']:_0x4e0348[_0x99aa('0x15')]+_0x4e0348[_0x99aa('0x13')];var _0x18a55f;if(_0x7c2c38>=_0x35f00c){_0x7c2c38=_0x35f00c;_0x18a55f=0xc8;}else{_0x18a55f=0xce;}_0x136612[_0x99aa('0x16')](_0x18a55f);return _0x136612[_0x99aa('0x17')]('Content-Range',_0x39c67c+'-'+_0x7c2c38+'/'+_0x35f00c)[_0x99aa('0x11')](_0x7e131d);}return null;};}function saveUpdates(_0xd2675){return function(_0x3db4e7){if(_0x3db4e7){return _0x3db4e7[_0x99aa('0x18')](_0xd2675)[_0x99aa('0x19')](function(_0x5ce3a1){return _0x5ce3a1;});}return null;};}function removeEntity(_0x3c20be){return function(_0x1b3db9){if(_0x1b3db9){return _0x1b3db9[_0x99aa('0x1a')]()[_0x99aa('0x19')](function(){_0x3c20be[_0x99aa('0x16')](0xcc)[_0x99aa('0x10')]();});}};}function handleEntityNotFound(_0x18a310){return function(_0xc3b245){if(!_0xc3b245){_0x18a310[_0x99aa('0xf')](0x194);}return _0xc3b245;};}function handleError(_0x1ac1db,_0x44a02f){_0x44a02f=_0x44a02f||0x1f4;return function(_0x441ff1){logger[_0x99aa('0x1b')](_0x441ff1[_0x99aa('0x1c')]);if(_0x441ff1[_0x99aa('0x1d')]){delete _0x441ff1[_0x99aa('0x1d')];}_0x1ac1db['status'](_0x44a02f)[_0x99aa('0x1e')](_0x441ff1);};}exports[_0x99aa('0x1f')]=function(_0x339ba6,_0x182c05){var _0x2086a5={};var _0x15375c=_[_0x99aa('0x20')](db['SmsInteraction'][_0x99aa('0x21')],function(_0x525c95){return{'name':_0x525c95[_0x99aa('0x22')],'type':_0x525c95[_0x99aa('0x23')][_0x99aa('0x24')]};});_0x2086a5=qs[_0x99aa('0x25')](_0x15375c,_0x339ba6);return interaction[_0x99aa('0x26')](_0x99aa('0x27'),_0x339ba6[_0x99aa('0x28')],_0x339ba6[_0x99aa('0x29')],_0x2086a5,_0x15375c)['then'](respondWithFilteredResult(_0x182c05,_0x2086a5))['catch'](handleError(_0x182c05,null));};exports[_0x99aa('0x2a')]=function(_0x1f8eec,_0x2c4c5d){var _0x82941e={'raw':![],'where':{'id':_0x1f8eec['params']['id']}},_0x3aaf8b={};_0x3aaf8b[_0x99aa('0x2b')]=_['keys'](db[_0x99aa('0x2c')][_0x99aa('0x21')]);_0x3aaf8b[_0x99aa('0x28')]=_['keys'](_0x1f8eec[_0x99aa('0x28')]);_0x3aaf8b[_0x99aa('0x2d')]=_[_0x99aa('0x2e')](_0x3aaf8b[_0x99aa('0x2b')],_0x3aaf8b['query']);_0x82941e['attributes']=_[_0x99aa('0x2e')](_0x3aaf8b[_0x99aa('0x2b')],qs[_0x99aa('0x2f')](_0x1f8eec[_0x99aa('0x28')][_0x99aa('0x2f')]));_0x82941e[_0x99aa('0x30')]=_0x82941e[_0x99aa('0x30')]['length']?_0x82941e['attributes']:_0x3aaf8b[_0x99aa('0x2b')];if(_0x1f8eec[_0x99aa('0x28')][_0x99aa('0x31')]){_0x82941e[_0x99aa('0x32')]=[{'all':!![]}];}_0x82941e=_[_0x99aa('0x33')]({},_0x82941e,_0x1f8eec[_0x99aa('0x34')]);return db[_0x99aa('0x2c')][_0x99aa('0x35')](_0x82941e)['then'](handleEntityNotFound(_0x2c4c5d,null))[_0x99aa('0x19')](respondWithResult(_0x2c4c5d,null))['catch'](handleError(_0x2c4c5d,null));};exports[_0x99aa('0x36')]=function(_0x40f21d,_0x524883){return db[_0x99aa('0x2c')]['create'](_0x40f21d[_0x99aa('0x37')],{})['then'](respondWithResult(_0x524883,0xc9))[_0x99aa('0x38')](handleError(_0x524883,null));};exports[_0x99aa('0x18')]=function(_0x5b3fbf,_0x40cdda){if(_0x5b3fbf[_0x99aa('0x37')]['id']){delete _0x5b3fbf['body']['id'];}return db['SmsInteraction'][_0x99aa('0x35')]({'where':{'id':_0x5b3fbf['params']['id']}})[_0x99aa('0x19')](handleEntityNotFound(_0x40cdda,null))[_0x99aa('0x19')](saveUpdates(_0x5b3fbf[_0x99aa('0x37')],null))[_0x99aa('0x19')](respondWithResult(_0x40cdda,null))['catch'](handleError(_0x40cdda,null));};exports[_0x99aa('0x1a')]=function(_0x52ca43,_0x4bf332){return db[_0x99aa('0x2c')][_0x99aa('0x35')]({'where':{'id':_0x52ca43[_0x99aa('0x39')]['id']}})['then'](handleEntityNotFound(_0x4bf332,null))['then'](removeEntity(_0x4bf332,null))['catch'](handleError(_0x4bf332,null));};exports[_0x99aa('0x3a')]=function(_0x298e3e,_0x5ecefa){return db[_0x99aa('0x2c')][_0x99aa('0x3a')]()[_0x99aa('0x19')](respondWithResult(_0x5ecefa,null))[_0x99aa('0x38')](handleError(_0x5ecefa,null));};exports[_0x99aa('0x3b')]=function(_0x1a2243,_0x2633ca){return db[_0x99aa('0x3c')][_0x99aa('0x35')]({'where':{'id':_0x1a2243[_0x99aa('0x39')]['id']}})[_0x99aa('0x19')](handleEntityNotFound(_0x2633ca,null))[_0x99aa('0x19')](function(_0x2c8c92){if(_0x2c8c92){return _0x2c8c92['addMessage'](_0x1a2243['body'][_0x99aa('0x3d')],_['omit'](_0x1a2243[_0x99aa('0x37')],[_0x99aa('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x2633ca,null))['catch'](handleError(_0x2633ca,null));};exports['getMessages']=function(_0x915570,_0x11d720){var _0x36ae0c={'raw':![],'where':{}};var _0x1b3ea4={};var _0x16dda3={'count':0x0,'rows':[]};return db[_0x99aa('0x2c')][_0x99aa('0x3e')]({'where':{'id':_0x915570[_0x99aa('0x39')]['id']}})[_0x99aa('0x19')](handleEntityNotFound(_0x11d720,null))['then'](function(_0x397341){if(_0x397341){_0x1b3ea4['model']=_[_0x99aa('0x3f')](db[_0x99aa('0x3c')][_0x99aa('0x21')]);_0x1b3ea4[_0x99aa('0x28')]=_['keys'](_0x915570[_0x99aa('0x28')]);_0x1b3ea4[_0x99aa('0x2d')]=_[_0x99aa('0x2e')](_0x1b3ea4[_0x99aa('0x2b')],_0x1b3ea4[_0x99aa('0x28')]);_0x36ae0c[_0x99aa('0x30')]=_[_0x99aa('0x2e')](_0x1b3ea4[_0x99aa('0x2b')],qs['fields'](_0x915570[_0x99aa('0x28')][_0x99aa('0x2f')]));_0x36ae0c[_0x99aa('0x30')]=_0x36ae0c[_0x99aa('0x30')][_0x99aa('0x40')]?_0x36ae0c[_0x99aa('0x30')]:_0x1b3ea4['model'];if(!_0x915570[_0x99aa('0x28')][_0x99aa('0x41')](_0x99aa('0x42'))){_0x36ae0c['limit']=qs[_0x99aa('0x13')](_0x915570['query'][_0x99aa('0x13')]);_0x36ae0c[_0x99aa('0x15')]=qs['offset'](_0x915570['query']['offset']);}_0x36ae0c['order']=qs[_0x99aa('0x43')](_0x915570[_0x99aa('0x28')][_0x99aa('0x43')]);_0x36ae0c['where']=qs[_0x99aa('0x2d')](_[_0x99aa('0x44')](_0x915570[_0x99aa('0x28')],_0x1b3ea4[_0x99aa('0x2d')]));_0x36ae0c[_0x99aa('0x45')]['SmsInteractionId']=_0x397341['id'];if(_0x915570['query']['filter']){_0x36ae0c['where']=_[_0x99aa('0x33')](_0x36ae0c[_0x99aa('0x45')],{'$or':_[_0x99aa('0x20')](_0x36ae0c[_0x99aa('0x30')],function(_0x2a43ae){var _0x4d04c0={};_0x4d04c0[_0x2a43ae]={'$like':'%'+_0x915570[_0x99aa('0x28')]['filter']+'%'};return _0x4d04c0;})});}if(_0x915570[_0x99aa('0x28')]['$gte']){var _0x51b1b2=_0x915570[_0x99aa('0x28')][_0x99aa('0x46')][_0x99aa('0x47')](',');var _0x1feb26={};_0x1feb26[_0x51b1b2[0x0]]={'$gte':moment(_0x51b1b2[0x1])[_0x99aa('0x48')](_0x99aa('0x49'))};_0x36ae0c['where']=_[_0x99aa('0x33')](_0x36ae0c['where'],_0x1feb26);}_0x36ae0c=_[_0x99aa('0x33')]({},_0x36ae0c,_0x915570[_0x99aa('0x34')]);return db[_0x99aa('0x3c')][_0x99aa('0x14')]({'where':_0x36ae0c[_0x99aa('0x45')]})['then'](function(_0x590048){_0x16dda3['count']=_0x590048;if(_0x915570['query']['includeAll']){_0x36ae0c[_0x99aa('0x32')]=[{'all':!![]}];}return db[_0x99aa('0x3c')][_0x99aa('0x26')](_0x36ae0c);})[_0x99aa('0x19')](function(_0x505ba1){_0x16dda3[_0x99aa('0x4a')]=_0x505ba1;return _0x16dda3;});}})[_0x99aa('0x19')](respondWithFilteredResult(_0x11d720,_0x36ae0c))[_0x99aa('0x38')](handleError(_0x11d720,null));};exports[_0x99aa('0x4b')]=function(_0x4f8c1b,_0x47ce09){return db[_0x99aa('0x2c')][_0x99aa('0x35')]({'where':{'id':_0x4f8c1b[_0x99aa('0x39')]['id']}})[_0x99aa('0x19')](handleEntityNotFound(_0x47ce09,null))['then'](function(_0x4c5aee){if(_0x4c5aee){return _0x4c5aee[_0x99aa('0x4c')](_0x4f8c1b[_0x99aa('0x37')][_0x99aa('0x3d')],_[_0x99aa('0x4d')](_0x4f8c1b[_0x99aa('0x37')],[_0x99aa('0x3d'),'id'])||{})[_0x99aa('0x4e')](function(){return db[_0x99aa('0x4f')][_0x99aa('0x26')]({'attributes':['id',_0x99aa('0x1d'),_0x99aa('0x50')],'where':{'id':_0x4f8c1b[_0x99aa('0x37')][_0x99aa('0x3d')]}});})['then'](function(_0x5df2a6){socket[_0x99aa('0x51')]('smsInteractionTags:save',{'id':Number(_0x4f8c1b['params']['id']),'tags':_0x5df2a6||[]});return{'id':Number(_0x4f8c1b[_0x99aa('0x39')]['id']),'tags':_0x5df2a6||[]};});}})[_0x99aa('0x19')](respondWithResult(_0x47ce09,null))[_0x99aa('0x38')](handleError(_0x47ce09,null));};exports[_0x99aa('0x52')]=function(_0x358229,_0x1aaec7){return db[_0x99aa('0x2c')][_0x99aa('0x35')]({'where':{'id':_0x358229['params']['id']}})['then'](handleEntityNotFound(_0x1aaec7,null))['then'](function(_0x2add97){if(_0x2add97){return _0x2add97['removeTags'](_0x358229[_0x99aa('0x28')]['ids']);}})[_0x99aa('0x19')](respondWithStatusCode(_0x1aaec7,null))['catch'](handleError(_0x1aaec7,null));};exports[_0x99aa('0x53')]=function(_0x1ba3df,_0x2867c0){var _0x4ebfaa=moment()[_0x99aa('0x54')]()[_0x99aa('0x55')]();var _0x5855c0=path[_0x99aa('0x56')](config[_0x99aa('0x57')],_0x99aa('0x58'),'files',_0x99aa('0x59'));var _0x4ecd05=path[_0x99aa('0x56')](_0x5855c0,_0x4ebfaa);var _0xe20013=util['format']('transcript-%d-%s.zip',_0x1ba3df[_0x99aa('0x39')]['id'],_0x4ebfaa);var _0x103342=path[_0x99aa('0x56')](_0x5855c0,_0xe20013);var _0x26810d=[];_0x26810d[_0x99aa('0x5a')]({'model':db[_0x99aa('0x5b')],'as':_0x99aa('0x5b'),'attributes':['id',_0x99aa('0x5c')],'raw':!![]});_0x26810d['push']({'model':db[_0x99aa('0x5d')],'as':'Contact','attributes':['id',_0x99aa('0x5e'),_0x99aa('0x5f')],'raw':!![]});var _0x89c72=[{'model':db[_0x99aa('0x3c')],'as':_0x99aa('0x60'),'attributes':['id',_0x99aa('0x37'),'createdAt',_0x99aa('0x61'),_0x99aa('0x62'),_0x99aa('0x63')],'include':_0x26810d}];_0x89c72[_0x99aa('0x5a')]({'model':db['SmsAccount'],'as':_0x99aa('0x64'),'attributes':['id','name']});_0x89c72['push']({'model':db[_0x99aa('0x5b')],'as':_0x99aa('0x65'),'attributes':['id',_0x99aa('0x5c')]});return db[_0x99aa('0x2c')][_0x99aa('0x35')]({'where':{'id':_0x1ba3df[_0x99aa('0x39')]['id']},'include':_0x89c72})[_0x99aa('0x19')](handleEntityNotFound(_0x2867c0,null))['then'](function(_0x41267e){if(_0x41267e){var _0x417832=_0x41267e[_0x99aa('0x66')]({'plain':!![]});fs[_0x99aa('0x67')](_0x4ecd05);var _0xee53ae={'channel':_0x99aa('0x68'),'account':_0x417832[_0x99aa('0x64')][_0x99aa('0x1d')],'agent':_0x417832[_0x99aa('0x65')]?_0x417832[_0x99aa('0x65')][_0x99aa('0x5c')]:_0x99aa('0x69'),'createdAt':moment(_0x417832[_0x99aa('0x6a')])['format'](_0x99aa('0x49'))['toString'](),'closedAt':_0x417832['closed']?moment(_0x417832[_0x99aa('0x6b')])[_0x99aa('0x48')](_0x99aa('0x49'))[_0x99aa('0x55')]():'','disposition':_0x417832['disposition'],'messages':_(_0x417832[_0x99aa('0x60')])[_0x99aa('0x6c')]({'secret':![]})[_0x99aa('0x20')](function(_0x559f11){return{'date':moment(_0x559f11[_0x99aa('0x6a')])[_0x99aa('0x48')](_0x99aa('0x49'))['toString'](),'sender':_0x559f11[_0x99aa('0x61')]===_0x99aa('0x6d')?_0x559f11[_0x99aa('0x5b')]?_0x559f11[_0x99aa('0x5b')][_0x99aa('0x5c')]:_0x99aa('0x6e'):_0x559f11[_0x99aa('0x6f')][_0x99aa('0x5e')]+(_0x559f11[_0x99aa('0x6f')]['lastName']?'\x20'+_0x559f11[_0x99aa('0x6f')]['lastName']:''),'body':_0x559f11['body'],'direction':_0x559f11[_0x99aa('0x61')]===_0x99aa('0x6d')?'A':'C','secret':_0x559f11['secret'],'read':_0x559f11[_0x99aa('0x63')]};})['value']()};return ejs[_0x99aa('0x70')](path[_0x99aa('0x56')](config[_0x99aa('0x57')],_0x99aa('0x58'),_0x99aa('0x71'),_0x99aa('0x72')),{'interaction':_0xee53ae})[_0x99aa('0x19')](function(_0x375099){var _0x49ec77=path[_0x99aa('0x56')](_0x4ecd05,_0x99aa('0x73')+_0x417832['id']+'-'+_0x4ebfaa+'.pdf');var _0x1414ab={'path':_0x49ec77,'channel':_0x99aa('0x68'),'interactionId':_0x417832['id']};return pdf[_0x99aa('0x74')](_0x375099,_0x1414ab);})[_0x99aa('0x19')](function(){return new BPromise(function(_0x5b1003,_0x2adf15){zipdir(_0x4ecd05,{'saveTo':_0x103342},function(_0x12d355,_0x4d680d){if(_0x12d355)return _0x2adf15(_0x12d355);return _0x5b1003(_0x4d680d);});})[_0x99aa('0x19')](function(){return new BPromise(function(_0x49305a,_0x3890c3){rimraf(_0x4ecd05,function(_0x73b166){if(_0x73b166)_0x3890c3(_0x73b166);return _0x49305a();});});})[_0x99aa('0x19')](function(){return _0x2867c0[_0x99aa('0x53')](_0x103342,_0xe20013,function(_0x39e75b){if(_0x39e75b){console['log']('err',_0x39e75b);}else{fs[_0x99aa('0x75')](_0x103342);}});});});}else{return _0x2867c0[_0x99aa('0xf')](0xc8);}})['catch'](handleError(_0x2867c0,null));}; \ No newline at end of file +var _0xc342=['update','params','describe','SmsMessage','addMessage','omit','ids','findOne','fields','nolimit','order','sort','pick','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','addTags','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Owner','fullname','get','Sms','closed','disposition','value','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','status','end','offset','undefined','limit','count','set','then','destroy','sendStatus','error','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','findAll','sms','query','catch','show','model','keys','filters','intersection','attributes','length','includeAll','include','merge','find','create','body'];(function(_0x334e99,_0x34b383){var _0x46d6a2=function(_0x1faeb1){while(--_0x1faeb1){_0x334e99['push'](_0x334e99['shift']());}};_0x46d6a2(++_0x34b383);}(_0xc342,0x12d));var _0x2c34=function(_0x32e649,_0x228649){_0x32e649=_0x32e649-0x0;var _0x14d386=_0xc342[_0x32e649];return _0x14d386;};'use strict';var rimraf=require(_0x2c34('0x0'));var zipdir=require(_0x2c34('0x1'));var moment=require(_0x2c34('0x2'));var BPromise=require(_0x2c34('0x3'));var util=require(_0x2c34('0x4'));var path=require(_0x2c34('0x5'));var ejs=require(_0x2c34('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x2c34('0x7'));var interaction=require(_0x2c34('0x8'));var qs=require(_0x2c34('0x9'));var pdf=require(_0x2c34('0xa'));var logger=require(_0x2c34('0xb'))(_0x2c34('0xc'));var config=require(_0x2c34('0xd'));var db=require(_0x2c34('0xe'))['db'];config[_0x2c34('0xf')]=_[_0x2c34('0x10')](config[_0x2c34('0xf')],{'host':_0x2c34('0x11'),'port':0x18eb});var socket=require(_0x2c34('0x12'))(new Redis(config[_0x2c34('0xf')]));require(_0x2c34('0x13'))['register'](socket);function respondWithStatusCode(_0x3f38d1,_0x400d71){_0x400d71=_0x400d71||0xcc;return function(_0x5dc379){if(_0x5dc379){return _0x3f38d1['sendStatus'](_0x400d71);}return _0x3f38d1[_0x2c34('0x14')](_0x400d71)[_0x2c34('0x15')]();};}function respondWithResult(_0x3d6033,_0x32ba59){_0x32ba59=_0x32ba59||0xc8;return function(_0x23b3d6){if(_0x23b3d6){return _0x3d6033['status'](_0x32ba59)['json'](_0x23b3d6);}};}function respondWithFilteredResult(_0x1a25a9,_0x12eb5c){return function(_0x34f850){if(_0x34f850){var _0x7602e0=typeof _0x12eb5c[_0x2c34('0x16')]===_0x2c34('0x17')&&typeof _0x12eb5c[_0x2c34('0x18')]==='undefined';var _0x29b23e=_0x34f850['count'];var _0x3bf7e1=_0x7602e0?0x0:_0x12eb5c[_0x2c34('0x16')];var _0x1adce1=_0x7602e0?_0x34f850[_0x2c34('0x19')]:_0x12eb5c[_0x2c34('0x16')]+_0x12eb5c['limit'];var _0x246b66;if(_0x1adce1>=_0x29b23e){_0x1adce1=_0x29b23e;_0x246b66=0xc8;}else{_0x246b66=0xce;}_0x1a25a9[_0x2c34('0x14')](_0x246b66);return _0x1a25a9[_0x2c34('0x1a')]('Content-Range',_0x3bf7e1+'-'+_0x1adce1+'/'+_0x29b23e)['json'](_0x34f850);}return null;};}function saveUpdates(_0x80d0d0){return function(_0x590a04){if(_0x590a04){return _0x590a04['update'](_0x80d0d0)[_0x2c34('0x1b')](function(_0xb59296){return _0xb59296;});}return null;};}function removeEntity(_0x5ae242){return function(_0x25cf0d){if(_0x25cf0d){return _0x25cf0d[_0x2c34('0x1c')]()[_0x2c34('0x1b')](function(){_0x5ae242[_0x2c34('0x14')](0xcc)[_0x2c34('0x15')]();});}};}function handleEntityNotFound(_0x449cfa){return function(_0x3e33c6){if(!_0x3e33c6){_0x449cfa[_0x2c34('0x1d')](0x194);}return _0x3e33c6;};}function handleError(_0x5af2a3,_0x3f1abd){_0x3f1abd=_0x3f1abd||0x1f4;return function(_0x5c2b6c){logger[_0x2c34('0x1e')](_0x5c2b6c['stack']);if(_0x5c2b6c[_0x2c34('0x1f')]){delete _0x5c2b6c[_0x2c34('0x1f')];}_0x5af2a3[_0x2c34('0x14')](_0x3f1abd)[_0x2c34('0x20')](_0x5c2b6c);};}exports[_0x2c34('0x21')]=function(_0x1db59a,_0x20b8a6){var _0x557f21={};var _0x588612=_[_0x2c34('0x22')](db[_0x2c34('0x23')][_0x2c34('0x24')],function(_0xc5aa21){return{'name':_0xc5aa21[_0x2c34('0x25')],'type':_0xc5aa21[_0x2c34('0x26')]['key']};});_0x557f21=qs['getOptions'](_0x588612,_0x1db59a);return interaction[_0x2c34('0x27')](_0x2c34('0x28'),_0x1db59a[_0x2c34('0x29')],_0x1db59a['user'],_0x557f21,_0x588612)[_0x2c34('0x1b')](respondWithFilteredResult(_0x20b8a6,_0x557f21))[_0x2c34('0x2a')](handleError(_0x20b8a6,null));};exports[_0x2c34('0x2b')]=function(_0x1fc19e,_0x4c1c4a){var _0x4d3161={'raw':![],'where':{'id':_0x1fc19e['params']['id']}},_0x1fe415={};_0x1fe415[_0x2c34('0x2c')]=_['keys'](db[_0x2c34('0x23')][_0x2c34('0x24')]);_0x1fe415[_0x2c34('0x29')]=_[_0x2c34('0x2d')](_0x1fc19e['query']);_0x1fe415[_0x2c34('0x2e')]=_[_0x2c34('0x2f')](_0x1fe415[_0x2c34('0x2c')],_0x1fe415['query']);_0x4d3161[_0x2c34('0x30')]=_['intersection'](_0x1fe415['model'],qs['fields'](_0x1fc19e['query']['fields']));_0x4d3161[_0x2c34('0x30')]=_0x4d3161[_0x2c34('0x30')][_0x2c34('0x31')]?_0x4d3161[_0x2c34('0x30')]:_0x1fe415[_0x2c34('0x2c')];if(_0x1fc19e[_0x2c34('0x29')][_0x2c34('0x32')]){_0x4d3161[_0x2c34('0x33')]=[{'all':!![]}];}_0x4d3161=_[_0x2c34('0x34')]({},_0x4d3161,_0x1fc19e['options']);return db['SmsInteraction'][_0x2c34('0x35')](_0x4d3161)[_0x2c34('0x1b')](handleEntityNotFound(_0x4c1c4a,null))[_0x2c34('0x1b')](respondWithResult(_0x4c1c4a,null))[_0x2c34('0x2a')](handleError(_0x4c1c4a,null));};exports[_0x2c34('0x36')]=function(_0x50333c,_0x1a9106){return db[_0x2c34('0x23')]['create'](_0x50333c[_0x2c34('0x37')],{})[_0x2c34('0x1b')](respondWithResult(_0x1a9106,0xc9))[_0x2c34('0x2a')](handleError(_0x1a9106,null));};exports[_0x2c34('0x38')]=function(_0x502c42,_0x569af3){if(_0x502c42['body']['id']){delete _0x502c42[_0x2c34('0x37')]['id'];}return db[_0x2c34('0x23')][_0x2c34('0x35')]({'where':{'id':_0x502c42[_0x2c34('0x39')]['id']}})['then'](handleEntityNotFound(_0x569af3,null))['then'](saveUpdates(_0x502c42[_0x2c34('0x37')],null))[_0x2c34('0x1b')](respondWithResult(_0x569af3,null))['catch'](handleError(_0x569af3,null));};exports['destroy']=function(_0x26038b,_0x51c9c1){return db[_0x2c34('0x23')]['find']({'where':{'id':_0x26038b[_0x2c34('0x39')]['id']}})['then'](handleEntityNotFound(_0x51c9c1,null))[_0x2c34('0x1b')](removeEntity(_0x51c9c1,null))[_0x2c34('0x2a')](handleError(_0x51c9c1,null));};exports[_0x2c34('0x3a')]=function(_0x378d49,_0x583975){return db[_0x2c34('0x23')][_0x2c34('0x3a')]()[_0x2c34('0x1b')](respondWithResult(_0x583975,null))[_0x2c34('0x2a')](handleError(_0x583975,null));};exports['addMessage']=function(_0x1724d4,_0x408e2e){return db[_0x2c34('0x3b')][_0x2c34('0x35')]({'where':{'id':_0x1724d4[_0x2c34('0x39')]['id']}})[_0x2c34('0x1b')](handleEntityNotFound(_0x408e2e,null))[_0x2c34('0x1b')](function(_0x2ea96a){if(_0x2ea96a){return _0x2ea96a[_0x2c34('0x3c')](_0x1724d4['body']['ids'],_[_0x2c34('0x3d')](_0x1724d4['body'],[_0x2c34('0x3e'),'id'])||{});}})[_0x2c34('0x1b')](respondWithResult(_0x408e2e,null))[_0x2c34('0x2a')](handleError(_0x408e2e,null));};exports['getMessages']=function(_0x4b5ed8,_0x2e3e11){var _0x133129={'raw':![],'where':{}};var _0x4c801f={};var _0x356334={'count':0x0,'rows':[]};return db[_0x2c34('0x23')][_0x2c34('0x3f')]({'where':{'id':_0x4b5ed8['params']['id']}})['then'](handleEntityNotFound(_0x2e3e11,null))[_0x2c34('0x1b')](function(_0x4d9f0a){if(_0x4d9f0a){_0x4c801f[_0x2c34('0x2c')]=_[_0x2c34('0x2d')](db[_0x2c34('0x3b')][_0x2c34('0x24')]);_0x4c801f[_0x2c34('0x29')]=_['keys'](_0x4b5ed8[_0x2c34('0x29')]);_0x4c801f[_0x2c34('0x2e')]=_[_0x2c34('0x2f')](_0x4c801f['model'],_0x4c801f['query']);_0x133129['attributes']=_['intersection'](_0x4c801f['model'],qs[_0x2c34('0x40')](_0x4b5ed8[_0x2c34('0x29')][_0x2c34('0x40')]));_0x133129['attributes']=_0x133129[_0x2c34('0x30')][_0x2c34('0x31')]?_0x133129['attributes']:_0x4c801f['model'];if(!_0x4b5ed8[_0x2c34('0x29')]['hasOwnProperty'](_0x2c34('0x41'))){_0x133129[_0x2c34('0x18')]=qs[_0x2c34('0x18')](_0x4b5ed8[_0x2c34('0x29')][_0x2c34('0x18')]);_0x133129[_0x2c34('0x16')]=qs['offset'](_0x4b5ed8[_0x2c34('0x29')][_0x2c34('0x16')]);}_0x133129[_0x2c34('0x42')]=qs[_0x2c34('0x43')](_0x4b5ed8[_0x2c34('0x29')][_0x2c34('0x43')]);_0x133129['where']=qs['filters'](_[_0x2c34('0x44')](_0x4b5ed8[_0x2c34('0x29')],_0x4c801f[_0x2c34('0x2e')]));_0x133129[_0x2c34('0x45')][_0x2c34('0x46')]=_0x4d9f0a['id'];if(_0x4b5ed8[_0x2c34('0x29')][_0x2c34('0x47')]){_0x133129[_0x2c34('0x45')]=_[_0x2c34('0x34')](_0x133129[_0x2c34('0x45')],{'$or':_[_0x2c34('0x22')](_0x133129['attributes'],function(_0x5a315e){var _0x3d1ab0={};_0x3d1ab0[_0x5a315e]={'$like':'%'+_0x4b5ed8[_0x2c34('0x29')][_0x2c34('0x47')]+'%'};return _0x3d1ab0;})});}if(_0x4b5ed8[_0x2c34('0x29')][_0x2c34('0x48')]){var _0x453753=_0x4b5ed8[_0x2c34('0x29')][_0x2c34('0x48')][_0x2c34('0x49')](',');var _0x38b094={};_0x38b094[_0x453753[0x0]]={'$gte':moment(_0x453753[0x1])[_0x2c34('0x4a')](_0x2c34('0x4b'))};_0x133129[_0x2c34('0x45')]=_[_0x2c34('0x34')](_0x133129[_0x2c34('0x45')],_0x38b094);}_0x133129=_[_0x2c34('0x34')]({},_0x133129,_0x4b5ed8[_0x2c34('0x4c')]);return db['SmsMessage'][_0x2c34('0x19')]({'where':_0x133129[_0x2c34('0x45')]})[_0x2c34('0x1b')](function(_0xc91cd7){_0x356334[_0x2c34('0x19')]=_0xc91cd7;if(_0x4b5ed8[_0x2c34('0x29')]['includeAll']){_0x133129[_0x2c34('0x33')]=[{'all':!![]}];}return db['SmsMessage'][_0x2c34('0x27')](_0x133129);})[_0x2c34('0x1b')](function(_0x13b0b2){_0x356334['rows']=_0x13b0b2;return _0x356334;});}})[_0x2c34('0x1b')](respondWithFilteredResult(_0x2e3e11,_0x133129))[_0x2c34('0x2a')](handleError(_0x2e3e11,null));};exports[_0x2c34('0x4d')]=function(_0x42d314,_0x371092){return db[_0x2c34('0x23')][_0x2c34('0x35')]({'where':{'id':_0x42d314[_0x2c34('0x39')]['id']}})[_0x2c34('0x1b')](handleEntityNotFound(_0x371092,null))[_0x2c34('0x1b')](function(_0x12ee60){if(_0x12ee60){return _0x12ee60[_0x2c34('0x4e')](_0x42d314[_0x2c34('0x37')]['ids'],_[_0x2c34('0x3d')](_0x42d314[_0x2c34('0x37')],[_0x2c34('0x3e'),'id'])||{})[_0x2c34('0x4f')](function(){return db[_0x2c34('0x50')][_0x2c34('0x27')]({'attributes':['id',_0x2c34('0x1f'),_0x2c34('0x51')],'where':{'id':_0x42d314['body'][_0x2c34('0x3e')]}});})['then'](function(_0x5f47bd){socket[_0x2c34('0x52')](_0x2c34('0x53'),{'id':Number(_0x42d314['params']['id']),'tags':_0x5f47bd||[]});return{'id':Number(_0x42d314[_0x2c34('0x39')]['id']),'tags':_0x5f47bd||[]};});}})[_0x2c34('0x1b')](respondWithResult(_0x371092,null))[_0x2c34('0x2a')](handleError(_0x371092,null));};exports[_0x2c34('0x54')]=function(_0x38d880,_0x3fdb4d){return db[_0x2c34('0x23')][_0x2c34('0x35')]({'where':{'id':_0x38d880['params']['id']}})[_0x2c34('0x1b')](handleEntityNotFound(_0x3fdb4d,null))[_0x2c34('0x1b')](function(_0x586691){if(_0x586691){return _0x586691[_0x2c34('0x54')](_0x38d880[_0x2c34('0x29')][_0x2c34('0x3e')]);}})[_0x2c34('0x1b')](respondWithStatusCode(_0x3fdb4d,null))['catch'](handleError(_0x3fdb4d,null));};exports[_0x2c34('0x55')]=function(_0x18c163,_0x37324b){var _0x506612=moment()[_0x2c34('0x56')]()[_0x2c34('0x57')]();var _0x28a860=path[_0x2c34('0x58')](config[_0x2c34('0x59')],_0x2c34('0x5a'),_0x2c34('0x5b'),'tmp');var _0xdf4d48=path['join'](_0x28a860,_0x506612);var _0x516925=util[_0x2c34('0x4a')](_0x2c34('0x5c'),_0x18c163[_0x2c34('0x39')]['id'],_0x506612);var _0x5f2c34=path[_0x2c34('0x58')](_0x28a860,_0x516925);var _0x44a2fa=[];_0x44a2fa[_0x2c34('0x5d')]({'model':db[_0x2c34('0x5e')],'as':_0x2c34('0x5e'),'attributes':['id','fullname'],'raw':!![]});_0x44a2fa[_0x2c34('0x5d')]({'model':db[_0x2c34('0x5f')],'as':_0x2c34('0x60'),'attributes':['id',_0x2c34('0x61'),_0x2c34('0x62')],'raw':!![]});var _0x5b184e=[{'model':db[_0x2c34('0x3b')],'as':_0x2c34('0x63'),'attributes':['id',_0x2c34('0x37'),_0x2c34('0x64'),_0x2c34('0x65'),_0x2c34('0x66'),_0x2c34('0x67')],'include':_0x44a2fa}];_0x5b184e[_0x2c34('0x5d')]({'model':db[_0x2c34('0x68')],'as':'Account','attributes':['id',_0x2c34('0x1f')]});_0x5b184e[_0x2c34('0x5d')]({'model':db[_0x2c34('0x5e')],'as':_0x2c34('0x69'),'attributes':['id',_0x2c34('0x6a')]});return db['SmsInteraction'][_0x2c34('0x35')]({'where':{'id':_0x18c163[_0x2c34('0x39')]['id']},'include':_0x5b184e})[_0x2c34('0x1b')](handleEntityNotFound(_0x37324b,null))[_0x2c34('0x1b')](function(_0x178183){if(_0x178183){var _0x22b65a=_0x178183[_0x2c34('0x6b')]({'plain':!![]});fs['mkdirSync'](_0xdf4d48);var _0x54c427={'channel':_0x2c34('0x6c'),'account':_0x22b65a['Account'][_0x2c34('0x1f')],'agent':_0x22b65a[_0x2c34('0x69')]?_0x22b65a['Owner'][_0x2c34('0x6a')]:'N.A.','createdAt':moment(_0x22b65a['createdAt'])[_0x2c34('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2c34('0x57')](),'closedAt':_0x22b65a[_0x2c34('0x6d')]?moment(_0x22b65a['closedAt'])[_0x2c34('0x4a')](_0x2c34('0x4b'))[_0x2c34('0x57')]():'','disposition':_0x22b65a[_0x2c34('0x6e')],'messages':_(_0x22b65a['Messages'])[_0x2c34('0x47')]({'secret':![]})[_0x2c34('0x22')](function(_0x163a67){return{'date':moment(_0x163a67['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x2c34('0x57')](),'sender':_0x163a67['direction']==='out'?_0x163a67[_0x2c34('0x5e')]?_0x163a67[_0x2c34('0x5e')][_0x2c34('0x6a')]:'System':_0x163a67['Contact'][_0x2c34('0x61')]+(_0x163a67[_0x2c34('0x60')][_0x2c34('0x62')]?'\x20'+_0x163a67[_0x2c34('0x60')][_0x2c34('0x62')]:''),'body':_0x163a67[_0x2c34('0x37')],'direction':_0x163a67[_0x2c34('0x65')]==='out'?'A':'C','secret':_0x163a67['secret'],'read':_0x163a67[_0x2c34('0x67')]};})[_0x2c34('0x6f')]()};return ejs[_0x2c34('0x70')](path[_0x2c34('0x58')](config[_0x2c34('0x59')],_0x2c34('0x5a'),'views',_0x2c34('0x71')),{'interaction':_0x54c427})[_0x2c34('0x1b')](function(_0x14b12d){var _0x287c26=path[_0x2c34('0x58')](_0xdf4d48,_0x2c34('0x72')+_0x22b65a['id']+'-'+_0x506612+'.pdf');var _0x1fddb6={'path':_0x287c26,'channel':_0x2c34('0x6c'),'interactionId':_0x22b65a['id']};return pdf[_0x2c34('0x73')](_0x14b12d,_0x1fddb6);})[_0x2c34('0x1b')](function(){return new BPromise(function(_0x5d5ed4,_0x92d67d){zipdir(_0xdf4d48,{'saveTo':_0x5f2c34},function(_0x5db293,_0x2e90cc){if(_0x5db293)return _0x92d67d(_0x5db293);return _0x5d5ed4(_0x2e90cc);});})[_0x2c34('0x1b')](function(){return new BPromise(function(_0x39f6b4,_0x484e0d){rimraf(_0xdf4d48,function(_0x139e48){if(_0x139e48)_0x484e0d(_0x139e48);return _0x39f6b4();});});})[_0x2c34('0x1b')](function(){return _0x37324b['download'](_0x5f2c34,_0x516925,function(_0x1ee652){if(_0x1ee652){console[_0x2c34('0x74')](_0x2c34('0x75'),_0x1ee652);}else{fs[_0x2c34('0x76')](_0x5f2c34);}});});});}else{return _0x37324b['sendStatus'](0xc8);}})[_0x2c34('0x2a')](handleError(_0x37324b,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 601066b..34ecc78 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 _0x32f4=['remove','setDataValue','map','findAll','then','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save'];(function(_0x3d0496,_0x1e2bdb){var _0x4308a2=function(_0x57ff7c){while(--_0x57ff7c){_0x3d0496['push'](_0x3d0496['shift']());}};_0x4308a2(++_0x1e2bdb);}(_0x32f4,0x154));var _0x432f=function(_0x5c89b9,_0x2bda51){_0x5c89b9=_0x5c89b9-0x0;var _0x2995b7=_0x32f4[_0x5c89b9];return _0x2995b7;};'use strict';var EventEmitter=require(_0x432f('0x0'));var SmsInteraction=require(_0x432f('0x1'))['db'][_0x432f('0x2')];var SmsMessage=require(_0x432f('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x432f('0x3')](0x0);var events={'afterCreate':_0x432f('0x4'),'afterUpdate':'update','afterDestroy':_0x432f('0x5')};function emitEvent(_0x1eabac){return function(_0x344a29,_0x355b02,_0x2f5f03){_0x344a29['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2f66fd){_0x344a29[_0x432f('0x6')]('Users',_0x2f66fd[_0x432f('0x7')](function(_0x5aaf1a){return{'id':_0x5aaf1a['id']};}));return SmsMessage[_0x432f('0x8')]({'where':{'SmsInteractionId':_0x344a29['id'],'direction':'in','read':![]},'raw':!![]});})[_0x432f('0x9')](function(_0x3a0d4b){_0x344a29[_0x432f('0x6')](_0x432f('0xa'),_0x3a0d4b['length']);SmsInteractionEvents[_0x432f('0xb')](_0x1eabac+':'+_0x344a29['id'],_0x344a29);SmsInteractionEvents['emit'](_0x1eabac,_0x344a29);_0x2f5f03(null);})[_0x432f('0xc')](_0x2f5f03(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x432f('0xd')](e,emitEvent(event));}}module[_0x432f('0xe')]=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(_0x2b7043,_0x4bdd76){var _0x54afbf=function(_0x593dc5){while(--_0x593dc5){_0x2b7043['push'](_0x2b7043['shift']());}};_0x54afbf(++_0x4bdd76);}(_0xadb5,0xad));var _0x5adb=function(_0x1833b0,_0x2f40c2){_0x1833b0=_0x1833b0-0x0;var _0x5cf441=_0xadb5[_0x1833b0];return _0x5cf441;};'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 25ad784..2b46554 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 _0x1eb1=['lodash','util','../../config/logger','api','moment','request-promise','path','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1eb1,0xe1));var _0x11eb=function(_0x2b0167,_0x507236){_0x2b0167=_0x2b0167-0x0;var _0xc06cb0=_0x1eb1[_0x2b0167];return _0xc06cb0;};'use strict';var _=require(_0x11eb('0x0'));var util=require(_0x11eb('0x1'));var logger=require(_0x11eb('0x2'))(_0x11eb('0x3'));var moment=require(_0x11eb('0x4'));var BPromise=require('bluebird');var rp=require(_0x11eb('0x5'));var fs=require('fs');var path=require(_0x11eb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x11eb('0x7'));module[_0x11eb('0x8')]=function(_0x49d274,_0x4fffe6){return _0x49d274[_0x11eb('0x9')](_0x11eb('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2370ac,_0x43cce9,_0xae708d){if(_0x2370ac[_0x11eb('0xb')]('closed')){_0x2370ac[_0x11eb('0xc')]=moment()[_0x11eb('0xd')](_0x11eb('0xe'));}_0xae708d(null,_0x2370ac);}}});}; \ No newline at end of file +var _0x9585=['exports','SmsInteraction','sms_interactions','closed','format','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x56a267,_0x17d06c){var _0x40ac38=function(_0x190dfa){while(--_0x190dfa){_0x56a267['push'](_0x56a267['shift']());}};_0x40ac38(++_0x17d06c);}(_0x9585,0x1f3));var _0x5958=function(_0x10fc86,_0x5ecca7){_0x10fc86=_0x10fc86-0x0;var _0x55ebab=_0x9585[_0x10fc86];return _0x55ebab;};'use strict';var _=require('lodash');var util=require(_0x5958('0x0'));var logger=require(_0x5958('0x1'))('api');var moment=require(_0x5958('0x2'));var BPromise=require(_0x5958('0x3'));var rp=require(_0x5958('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5958('0x5'));var config=require(_0x5958('0x6'));var attributes=require(_0x5958('0x7'));module[_0x5958('0x8')]=function(_0x2770d8,_0x153458){return _0x2770d8['define'](_0x5958('0x9'),attributes,{'tableName':_0x5958('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3367f,_0x569cb7,_0x165ee1){if(_0x3367f['changed'](_0x5958('0xb'))){_0x3367f['closedAt']=moment()[_0x5958('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x165ee1(null,_0x3367f);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 157549b..52a29e9 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 _0xf303=['debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','update','body','options','raw','where','attributes','SmsInteraction','find','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0xf303,0x95));var _0x3f30=function(_0x1579c0,_0x2ba92b){_0x1579c0=_0x1579c0-0x0;var _0x42a963=_0xf303[_0x1579c0];return _0x42a963;};'use strict';var _=require(_0x3f30('0x0'));var util=require(_0x3f30('0x1'));var moment=require('moment');var BPromise=require(_0x3f30('0x2'));var rs=require(_0x3f30('0x3'));var fs=require('fs');var Redis=require(_0x3f30('0x4'));var db=require(_0x3f30('0x5'))['db'];var utils=require(_0x3f30('0x6'));var logger=require(_0x3f30('0x7'))(_0x3f30('0x8'));var config=require(_0x3f30('0x9'));var jayson=require(_0x3f30('0xa'));var client=jayson[_0x3f30('0xb')][_0x3f30('0xc')]({'port':0x232a});config[_0x3f30('0xd')]=_[_0x3f30('0xe')](config[_0x3f30('0xd')],{'host':_0x3f30('0xf'),'port':0x18eb});var socket=require(_0x3f30('0x10'))(new Redis(config[_0x3f30('0xd')]));require('./smsInteraction.socket')[_0x3f30('0x11')](socket);function respondWithRpcPromise(_0x526b97,_0x496b89,_0x21073e){return new BPromise(function(_0xae3906,_0x1151bc){return client[_0x3f30('0x12')](_0x526b97,_0x21073e)[_0x3f30('0x13')](function(_0x10aafa){logger[_0x3f30('0x14')](_0x3f30('0x15'),_0x496b89,_0x3f30('0x16'));logger[_0x3f30('0x17')](_0x3f30('0x18'),_0x496b89,_0x3f30('0x16'),JSON[_0x3f30('0x19')](_0x10aafa));if(_0x10aafa[_0x3f30('0x1a')]){if(_0x10aafa[_0x3f30('0x1a')][_0x3f30('0x1b')]===0x1f4){logger[_0x3f30('0x1a')](_0x3f30('0x15'),_0x496b89,_0x10aafa['error'][_0x3f30('0x1c')]);return _0x1151bc(_0x10aafa[_0x3f30('0x1a')][_0x3f30('0x1c')]);}logger[_0x3f30('0x1a')](_0x3f30('0x15'),_0x496b89,_0x10aafa['error'][_0x3f30('0x1c')]);return _0xae3906(_0x10aafa['error'][_0x3f30('0x1c')]);}else{logger[_0x3f30('0x14')](_0x3f30('0x15'),_0x496b89,'request\x20sent');_0xae3906(_0x10aafa[_0x3f30('0x1d')][_0x3f30('0x1c')]);}})[_0x3f30('0x1e')](function(_0x57fe6c){logger[_0x3f30('0x1a')](_0x3f30('0x15'),_0x496b89,_0x57fe6c);_0x1151bc(_0x57fe6c);});});}exports[_0x3f30('0x1f')]=function(_0x498667){var _0x4add24=this;return new Promise(function(_0x15125e,_0x52541e){return db['SmsInteraction'][_0x3f30('0x20')](_0x498667[_0x3f30('0x21')],{'raw':_0x498667[_0x3f30('0x22')]?_0x498667[_0x3f30('0x22')][_0x3f30('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x498667[_0x3f30('0x22')]?_0x498667['options'][_0x3f30('0x24')]||null:null,'attributes':_0x498667[_0x3f30('0x22')]?_0x498667[_0x3f30('0x22')][_0x3f30('0x25')]||null:null,'limit':_0x498667[_0x3f30('0x22')]?_0x498667[_0x3f30('0x22')]['limit']||null:null})[_0x3f30('0x13')](function(_0x3c7b87){logger[_0x3f30('0x14')]('UpdateSmsInteraction',_0x498667);logger[_0x3f30('0x17')]('UpdateSmsInteraction',_0x498667,JSON[_0x3f30('0x19')](_0x3c7b87));_0x15125e(_0x3c7b87);})['catch'](function(_0x42e2bd){logger['error'](_0x3f30('0x1f'),_0x42e2bd[_0x3f30('0x1c')],_0x498667);_0x52541e(_0x4add24[_0x3f30('0x1a')](0x1f4,_0x42e2bd[_0x3f30('0x1c')]));});});};exports['AddTagsToSmsInteraction']=function(_0x5c27b6){return new Promise(function(_0x564b5e,_0x258713){return db[_0x3f30('0x26')][_0x3f30('0x27')]({'where':_0x5c27b6['options']?_0x5c27b6['options']['where']||null:null})[_0x3f30('0x13')](function(_0x47ac7f){if(_0x47ac7f){return _0x47ac7f['addTags'](_0x5c27b6[_0x3f30('0x21')]['ids'],_[_0x3f30('0x28')](_0x5c27b6['body'],['ids','id'])||{});}})[_0x3f30('0x29')](function(_0x1f33b1){logger[_0x3f30('0x14')](_0x3f30('0x2a'),_0x5c27b6);logger[_0x3f30('0x17')]('AddTags',_0x5c27b6,JSON[_0x3f30('0x19')](_0x1f33b1));_0x564b5e(_0x1f33b1);})['catch'](function(_0x125efb){logger['error'](_0x3f30('0x2a'),_0x125efb[_0x3f30('0x1c')],_0x5c27b6);_0x258713(_this[_0x3f30('0x1a')](0x1f4,_0x125efb['message']));});});}; \ No newline at end of file +var _0x1bf8=['rpc','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','AddTagsToSmsInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1bf8,0x75));var _0x81bf=function(_0x4aa400,_0x47b336){_0x4aa400=_0x4aa400-0x0;var _0x34566d=_0x1bf8[_0x4aa400];return _0x34566d;};'use strict';var _=require(_0x81bf('0x0'));var util=require(_0x81bf('0x1'));var moment=require('moment');var BPromise=require(_0x81bf('0x2'));var rs=require(_0x81bf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81bf('0x4'))['db'];var utils=require(_0x81bf('0x5'));var logger=require('../../config/logger')(_0x81bf('0x6'));var config=require('../../config/environment');var jayson=require(_0x81bf('0x7'));var client=jayson['client'][_0x81bf('0x8')]({'port':0x232a});config['redis']=_[_0x81bf('0x9')](config['redis'],{'host':_0x81bf('0xa'),'port':0x18eb});var socket=require(_0x81bf('0xb'))(new Redis(config[_0x81bf('0xc')]));require(_0x81bf('0xd'))[_0x81bf('0xe')](socket);function respondWithRpcPromise(_0xd7c60b,_0x1fa36d,_0x81ae39){return new BPromise(function(_0x13f9c6,_0x10fce5){return client[_0x81bf('0xf')](_0xd7c60b,_0x81ae39)[_0x81bf('0x10')](function(_0x41db86){logger[_0x81bf('0x11')](_0x81bf('0x12'),_0x1fa36d,_0x81bf('0x13'));logger[_0x81bf('0x14')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x1fa36d,_0x81bf('0x13'),JSON[_0x81bf('0x15')](_0x41db86));if(_0x41db86[_0x81bf('0x16')]){if(_0x41db86[_0x81bf('0x16')][_0x81bf('0x17')]===0x1f4){logger[_0x81bf('0x16')](_0x81bf('0x12'),_0x1fa36d,_0x41db86['error'][_0x81bf('0x18')]);return _0x10fce5(_0x41db86[_0x81bf('0x16')][_0x81bf('0x18')]);}logger[_0x81bf('0x16')](_0x81bf('0x12'),_0x1fa36d,_0x41db86[_0x81bf('0x16')][_0x81bf('0x18')]);return _0x13f9c6(_0x41db86['error'][_0x81bf('0x18')]);}else{logger[_0x81bf('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x1fa36d,_0x81bf('0x13'));_0x13f9c6(_0x41db86[_0x81bf('0x19')][_0x81bf('0x18')]);}})[_0x81bf('0x1a')](function(_0x1c9927){logger[_0x81bf('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x1fa36d,_0x1c9927);_0x10fce5(_0x1c9927);});});}exports[_0x81bf('0x1b')]=function(_0x366ea9){var _0x4df741=this;return new Promise(function(_0x3d1a4f,_0x2cc235){return db[_0x81bf('0x1c')][_0x81bf('0x1d')](_0x366ea9[_0x81bf('0x1e')],{'raw':_0x366ea9[_0x81bf('0x1f')]?_0x366ea9[_0x81bf('0x1f')][_0x81bf('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x366ea9[_0x81bf('0x1f')]?_0x366ea9[_0x81bf('0x1f')][_0x81bf('0x21')]||null:null,'attributes':_0x366ea9[_0x81bf('0x1f')]?_0x366ea9[_0x81bf('0x1f')]['attributes']||null:null,'limit':_0x366ea9['options']?_0x366ea9[_0x81bf('0x1f')][_0x81bf('0x22')]||null:null})[_0x81bf('0x10')](function(_0x259042){logger[_0x81bf('0x11')](_0x81bf('0x1b'),_0x366ea9);logger[_0x81bf('0x14')]('UpdateSmsInteraction',_0x366ea9,JSON[_0x81bf('0x15')](_0x259042));_0x3d1a4f(_0x259042);})[_0x81bf('0x1a')](function(_0x3763c4){logger[_0x81bf('0x16')](_0x81bf('0x1b'),_0x3763c4[_0x81bf('0x18')],_0x366ea9);_0x2cc235(_0x4df741[_0x81bf('0x16')](0x1f4,_0x3763c4[_0x81bf('0x18')]));});});};exports[_0x81bf('0x23')]=function(_0x534e27){return new Promise(function(_0x5172f9,_0x2b16d8){return db['SmsInteraction']['find']({'where':_0x534e27['options']?_0x534e27[_0x81bf('0x1f')]['where']||null:null})['then'](function(_0x404a2f){if(_0x404a2f){return _0x404a2f[_0x81bf('0x24')](_0x534e27[_0x81bf('0x1e')][_0x81bf('0x25')],_[_0x81bf('0x26')](_0x534e27[_0x81bf('0x1e')],[_0x81bf('0x25'),'id'])||{});}})[_0x81bf('0x27')](function(_0x2cd51c){logger[_0x81bf('0x11')](_0x81bf('0x28'),_0x534e27);logger[_0x81bf('0x14')]('AddTags',_0x534e27,JSON[_0x81bf('0x15')](_0x2cd51c));_0x5172f9(_0x2cd51c);})['catch'](function(_0x1162d9){logger['error'](_0x81bf('0x28'),_0x1162d9['message'],_0x534e27);_0x2b16d8(_this[_0x81bf('0x16')](0x1f4,_0x1162d9[_0x81bf('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index ec3e0c0..6cd1624 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 _0xc59e=['save','update','removeListener','smsInteraction:','./smsInteraction.events'];(function(_0x454d5a,_0x46e282){var _0xd9ee5c=function(_0x13f954){while(--_0x13f954){_0x454d5a['push'](_0x454d5a['shift']());}};_0xd9ee5c(++_0x46e282);}(_0xc59e,0x1d5));var _0xec59=function(_0x2fbf1f,_0x87cd09){_0x2fbf1f=_0x2fbf1f-0x0;var _0x52ae9e=_0xc59e[_0x2fbf1f];return _0x52ae9e;};'use strict';var SmsInteractionEvents=require(_0xec59('0x0'));var events=[_0xec59('0x1'),'remove',_0xec59('0x2')];function createListener(_0x182108,_0x1ab077){return function(_0x25862d){_0x1ab077['emit'](_0x182108,_0x25862d);};}function removeListener(_0x28b154,_0x2effae){return function(){SmsInteractionEvents[_0xec59('0x3')](_0x28b154,_0x2effae);};}exports['register']=function(_0x18de1c){for(var _0x2dacc0=0x0,_0x2382a1=events['length'];_0x2dacc0<_0x2382a1;_0x2dacc0++){var _0x5c9ab8=events[_0x2dacc0];var _0x3cbc6f=createListener(_0xec59('0x4')+_0x5c9ab8,_0x18de1c);SmsInteractionEvents['on'](_0x5c9ab8,_0x3cbc6f);}}; \ No newline at end of file +var _0xc305=['removeListener','length','smsInteraction:','./smsInteraction.events','remove','update','emit'];(function(_0x3238ea,_0x91809d){var _0x4aaac2=function(_0xc5b102){while(--_0xc5b102){_0x3238ea['push'](_0x3238ea['shift']());}};_0x4aaac2(++_0x91809d);}(_0xc305,0x88));var _0x5c30=function(_0x2e53e1,_0x12aed1){_0x2e53e1=_0x2e53e1-0x0;var _0x3a23de=_0xc305[_0x2e53e1];return _0x3a23de;};'use strict';var SmsInteractionEvents=require(_0x5c30('0x0'));var events=['save',_0x5c30('0x1'),_0x5c30('0x2')];function createListener(_0x19eb13,_0x1679cc){return function(_0x557331){_0x1679cc[_0x5c30('0x3')](_0x19eb13,_0x557331);};}function removeListener(_0xeddb9e,_0x22437e){return function(){SmsInteractionEvents[_0x5c30('0x4')](_0xeddb9e,_0x22437e);};}exports['register']=function(_0x4c5275){for(var _0x4491f9=0x0,_0x4787f3=events[_0x5c30('0x5')];_0x4491f9<_0x4787f3;_0x4491f9++){var _0x18fa0c=events[_0x4491f9];var _0x11913c=createListener(_0x5c30('0x6')+_0x18fa0c,_0x4c5275);SmsInteractionEvents['on'](_0x18fa0c,_0x11913c);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 4d504fd..670a315 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 _0x22f3=['../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x289e47,_0x236017){var _0xcd70a2=function(_0x3b2087){while(--_0x3b2087){_0x289e47['push'](_0x289e47['shift']());}};_0xcd70a2(++_0x236017);}(_0x22f3,0x155));var _0x322f=function(_0x574b4d,_0x3b6ffb){_0x574b4d=_0x574b4d-0x0;var _0x467a23=_0x22f3[_0x574b4d];return _0x467a23;};'use strict';var multer=require(_0x322f('0x0'));var util=require(_0x322f('0x1'));var path=require(_0x322f('0x2'));var timeout=require(_0x322f('0x3'));var express=require(_0x322f('0x4'));var router=express['Router']();var fs_extra=require(_0x322f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x322f('0x6'));var config=require(_0x322f('0x7'));var controller=require('./smsMessage.controller');router[_0x322f('0x8')]('/',auth['isAuthenticated'](),controller[_0x322f('0x9')]);router['get'](_0x322f('0xa'),auth['isAuthenticated'](),controller[_0x322f('0xb')]);router[_0x322f('0x8')](_0x322f('0xc'),auth[_0x322f('0xd')](),controller[_0x322f('0xe')]);router[_0x322f('0xf')]('/',auth[_0x322f('0xd')](),interaction[_0x322f('0x10')](_0x322f('0x11'),_0x322f('0x12')),controller[_0x322f('0x13')]);router['post'](_0x322f('0x14'),controller[_0x322f('0x15')]);router[_0x322f('0x16')](_0x322f('0xc'),auth[_0x322f('0xd')](),controller[_0x322f('0x17')]);router[_0x322f('0x16')]('/:id/accept',auth[_0x322f('0xd')](),controller[_0x322f('0x18')]);router[_0x322f('0x16')](_0x322f('0x19'),auth[_0x322f('0xd')](),controller[_0x322f('0x1a')]);router[_0x322f('0x1b')](_0x322f('0xc'),auth['isAuthenticated'](),controller[_0x322f('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xed27=['/:id/status','status','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','smsmessage:create','create','post'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0xed27,0x183));var _0x7ed2=function(_0xd75ceb,_0x40b50f){_0xd75ceb=_0xd75ceb-0x0;var _0xeef392=_0xed27[_0xd75ceb];return _0xeef392;};'use strict';var multer=require(_0x7ed2('0x0'));var util=require(_0x7ed2('0x1'));var path=require(_0x7ed2('0x2'));var timeout=require('connect-timeout');var express=require(_0x7ed2('0x3'));var router=express[_0x7ed2('0x4')]();var fs_extra=require(_0x7ed2('0x5'));var auth=require(_0x7ed2('0x6'));var interaction=require(_0x7ed2('0x7'));var config=require('../../config/environment');var controller=require(_0x7ed2('0x8'));router[_0x7ed2('0x9')]('/',auth[_0x7ed2('0xa')](),controller[_0x7ed2('0xb')]);router[_0x7ed2('0x9')](_0x7ed2('0xc'),auth[_0x7ed2('0xa')](),controller[_0x7ed2('0xd')]);router[_0x7ed2('0x9')](_0x7ed2('0xe'),auth['isAuthenticated'](),controller[_0x7ed2('0xf')]);router['post']('/',auth[_0x7ed2('0xa')](),interaction['tracked']('sms',_0x7ed2('0x10')),controller[_0x7ed2('0x11')]);router[_0x7ed2('0x12')](_0x7ed2('0x13'),controller[_0x7ed2('0x14')]);router[_0x7ed2('0x15')](_0x7ed2('0xe'),auth[_0x7ed2('0xa')](),controller[_0x7ed2('0x16')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x7ed2('0x17')]);router[_0x7ed2('0x15')](_0x7ed2('0x18'),auth[_0x7ed2('0xa')](),controller[_0x7ed2('0x19')]);router[_0x7ed2('0x1a')](_0x7ed2('0xe'),auth['isAuthenticated'](),controller[_0x7ed2('0x1b')]);module[_0x7ed2('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 3c2ccd4..fd63234 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 _0xb6b3=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','TEXT'];(function(_0xc7494a,_0xf880f9){var _0x486975=function(_0x508ac0){while(--_0x508ac0){_0xc7494a['push'](_0xc7494a['shift']());}};_0x486975(++_0xf880f9);}(_0xb6b3,0x12e));var _0x3b6b=function(_0x4b3828,_0x4cbda4){_0x4b3828=_0x4b3828-0x0;var _0x780ecb=_0xb6b3[_0x4b3828];return _0x780ecb;};'use strict';var Sequelize=require(_0x3b6b('0x0'));module['exports']={'body':{'type':Sequelize[_0x3b6b('0x1')](_0x3b6b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3b6b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3b6b('0x4')]('in','out'),'defaultValue':_0x3b6b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3b6b('0x6')](0xbe)},'phone':{'type':Sequelize[_0x3b6b('0x6')]},'readAt':{'type':Sequelize[_0x3b6b('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3b6b('0x6')]},'providerResponse':{'type':Sequelize[_0x3b6b('0x1')]}}; \ No newline at end of file +var _0x9981=['out','STRING','BOOLEAN','TEXT'];(function(_0x2fcf23,_0x19c646){var _0x58ba5a=function(_0x51bbd2){while(--_0x51bbd2){_0x2fcf23['push'](_0x2fcf23['shift']());}};_0x58ba5a(++_0x19c646);}(_0x9981,0x163));var _0x1998=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9981[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x1998('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1998('0x1')),'defaultValue':_0x1998('0x1'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1998('0x2')](0xbe)},'phone':{'type':Sequelize[_0x1998('0x2')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x1998('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x1998('0x0')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index b535301..d868f34 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 _0xa9c7=['acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','RejectMessage','rejectMessage','sequelize','Sequelize','User','event','rejectmessage','SmsAccount','SmsAccountId','debug','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','eml-format','fast-json-patch','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','keys','filters','intersection','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','isNil','interaction','get','role','null'];(function(_0x2542d1,_0xdb7645){var _0xec2ce7=function(_0x27c486){while(--_0x27c486){_0x2542d1['push'](_0x2542d1['shift']());}};_0xec2ce7(++_0xdb7645);}(_0xa9c7,0x148));var _0x7a9c=function(_0x3fe393,_0x234a3a){_0x3fe393=_0x3fe393-0x0;var _0x534d14=_0xa9c7[_0x3fe393];return _0x534d14;};'use strict';var emlformat=require(_0x7a9c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7a9c('0x1'));var rp=require('request-promise');var moment=require(_0x7a9c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7a9c('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7a9c('0x4'));var ejs=require(_0x7a9c('0x5'));var fs=require('fs');var fs_extra=require(_0x7a9c('0x6'));var _=require(_0x7a9c('0x7'));var squel=require(_0x7a9c('0x8'));var crypto=require(_0x7a9c('0x9'));var jsforce=require(_0x7a9c('0xa'));var deskjs=require(_0x7a9c('0xb'));var toCsv=require(_0x7a9c('0x4'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7a9c('0xc'));var authService=require(_0x7a9c('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x7a9c('0xe'));var hardwareService=require(_0x7a9c('0xf'));var logger=require(_0x7a9c('0x10'))(_0x7a9c('0x11'));var utils=require(_0x7a9c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7a9c('0x13'));var db=require(_0x7a9c('0x14'))['db'];config[_0x7a9c('0x15')]=_[_0x7a9c('0x16')](config[_0x7a9c('0x15')],{'host':_0x7a9c('0x17'),'port':0x18eb});var socket=require(_0x7a9c('0x18'))(new Redis(config[_0x7a9c('0x15')]));require('./smsMessage.socket')[_0x7a9c('0x19')](socket);var jayson=require(_0x7a9c('0x1a'));var client=jayson[_0x7a9c('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x7a9c('0x1b')][_0x7a9c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x467baf,_0xec55d8,_0x449339,_0x34ecde){return new BPromise(function(_0x2e1ca4,_0x18f04d){var _0x3ab83f=_0x34ecde||client;return _0x3ab83f[_0x7a9c('0x1d')](_0x467baf,_0x449339)[_0x7a9c('0x1e')](function(_0x219dcb){logger[_0x7a9c('0x1f')](_0x7a9c('0x20'),_0xec55d8,_0x7a9c('0x21'));logger['debug'](_0x7a9c('0x22'),_0xec55d8,_0x7a9c('0x21'),JSON[_0x7a9c('0x23')](_0x219dcb));if(_0x219dcb[_0x7a9c('0x24')]){if(_0x219dcb[_0x7a9c('0x24')]['code']===0x1f4){logger[_0x7a9c('0x24')](_0x7a9c('0x20'),_0xec55d8,_0x219dcb['error'][_0x7a9c('0x25')]);return _0x18f04d(_0x219dcb[_0x7a9c('0x24')][_0x7a9c('0x25')]);}logger[_0x7a9c('0x24')]('SmsMessage,\x20%s,\x20%s',_0xec55d8,_0x219dcb[_0x7a9c('0x24')][_0x7a9c('0x25')]);return _0x2e1ca4(_0x219dcb[_0x7a9c('0x24')][_0x7a9c('0x25')]);}else{logger[_0x7a9c('0x1f')](_0x7a9c('0x20'),_0xec55d8,_0x7a9c('0x21'));_0x2e1ca4(_0x219dcb[_0x7a9c('0x26')][_0x7a9c('0x25')]);}})[_0x7a9c('0x27')](function(_0x3f1e5c){logger[_0x7a9c('0x24')](_0x7a9c('0x20'),_0xec55d8,_0x3f1e5c);_0x18f04d(_0x3f1e5c);});});}function respondWithStatusCode(_0x55c4ea,_0x3a7796){_0x3a7796=_0x3a7796||0xcc;return function(_0x23db8c){if(_0x23db8c){return _0x55c4ea['sendStatus'](_0x3a7796);}return _0x55c4ea[_0x7a9c('0x28')](_0x3a7796)[_0x7a9c('0x29')]();};}function respondWithResult(_0x1e6ef7,_0x5e8ac6){_0x5e8ac6=_0x5e8ac6||0xc8;return function(_0x58e89e){if(_0x58e89e){return _0x1e6ef7[_0x7a9c('0x28')](_0x5e8ac6)[_0x7a9c('0x2a')](_0x58e89e);}};}function respondWithFilteredResult(_0xf205c9,_0x7a25e1){return function(_0x57c1c7){if(_0x57c1c7){var _0x25c36d=typeof _0x7a25e1[_0x7a9c('0x2b')]===_0x7a9c('0x2c')&&typeof _0x7a25e1[_0x7a9c('0x2d')]===_0x7a9c('0x2c');var _0x2e4b87=_0x57c1c7[_0x7a9c('0x2e')];var _0x180e7a=_0x25c36d?0x0:_0x7a25e1[_0x7a9c('0x2b')];var _0x595e64=_0x25c36d?_0x57c1c7[_0x7a9c('0x2e')]:_0x7a25e1[_0x7a9c('0x2b')]+_0x7a25e1[_0x7a9c('0x2d')];var _0x449223;if(_0x595e64>=_0x2e4b87){_0x595e64=_0x2e4b87;_0x449223=0xc8;}else{_0x449223=0xce;}_0xf205c9['status'](_0x449223);return _0xf205c9[_0x7a9c('0x2f')](_0x7a9c('0x30'),_0x180e7a+'-'+_0x595e64+'/'+_0x2e4b87)[_0x7a9c('0x2a')](_0x57c1c7);}return null;};}function patchUpdates(_0x143b56){return function(_0x1c1a9c){try{jsonpatch['apply'](_0x1c1a9c,_0x143b56,!![]);}catch(_0x4b082f){return BPromise[_0x7a9c('0x31')](_0x4b082f);}return _0x1c1a9c[_0x7a9c('0x32')]();};}function saveUpdates(_0x2cfd0b,_0x30df5a){return function(_0x52d7b7){if(_0x52d7b7){return _0x52d7b7[_0x7a9c('0x33')](_0x2cfd0b)[_0x7a9c('0x1e')](function(_0xef6bd9){return _0xef6bd9;});}return null;};}function removeEntity(_0x1145c9,_0x4897e0){return function(_0x5d63e){if(_0x5d63e){return _0x5d63e[_0x7a9c('0x34')]()[_0x7a9c('0x1e')](function(){_0x1145c9[_0x7a9c('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c3f4c,_0x233c8d){return function(_0x33f706){if(!_0x33f706){_0x2c3f4c['sendStatus'](0x194);}return _0x33f706;};}function handleError(_0x45de47,_0x11ae62){_0x11ae62=_0x11ae62||0x1f4;return function(_0x24aa94){logger[_0x7a9c('0x24')](_0x24aa94[_0x7a9c('0x35')]);if(_0x24aa94[_0x7a9c('0x36')]){delete _0x24aa94[_0x7a9c('0x36')];}_0x45de47[_0x7a9c('0x28')](_0x11ae62)[_0x7a9c('0x37')](_0x24aa94);};}exports[_0x7a9c('0x38')]=function(_0x12c423,_0x4ad10d){var _0x57bc47={},_0x562c66={},_0xeb785c={'count':0x0,'rows':[]};var _0x424557=_[_0x7a9c('0x39')](db[_0x7a9c('0x3a')][_0x7a9c('0x3b')],function(_0x404383){return{'name':_0x404383[_0x7a9c('0x3c')],'type':_0x404383['type'][_0x7a9c('0x3d')]};});_0x562c66[_0x7a9c('0x3e')]=_[_0x7a9c('0x39')](_0x424557,_0x7a9c('0x36'));_0x562c66[_0x7a9c('0x3f')]=_['keys'](_0x12c423[_0x7a9c('0x3f')]);_0x562c66['filters']=_['intersection'](_0x562c66[_0x7a9c('0x3e')],_0x562c66[_0x7a9c('0x3f')]);_0x57bc47[_0x7a9c('0x40')]=_['intersection'](_0x562c66[_0x7a9c('0x3e')],qs[_0x7a9c('0x41')](_0x12c423[_0x7a9c('0x3f')][_0x7a9c('0x41')]));_0x57bc47['attributes']=_0x57bc47[_0x7a9c('0x40')][_0x7a9c('0x42')]?_0x57bc47[_0x7a9c('0x40')]:_0x562c66[_0x7a9c('0x3e')];if(!_0x12c423[_0x7a9c('0x3f')][_0x7a9c('0x43')](_0x7a9c('0x44'))){_0x57bc47[_0x7a9c('0x2d')]=qs[_0x7a9c('0x2d')](_0x12c423[_0x7a9c('0x3f')]['limit']);_0x57bc47[_0x7a9c('0x2b')]=qs[_0x7a9c('0x2b')](_0x12c423['query'][_0x7a9c('0x2b')]);}_0x57bc47['order']=qs[_0x7a9c('0x45')](_0x12c423[_0x7a9c('0x3f')][_0x7a9c('0x45')]);_0x57bc47[_0x7a9c('0x46')]=qs['filters'](_['pick'](_0x12c423['query'],_0x562c66['filters']),_0x424557);if(_0x12c423[_0x7a9c('0x3f')][_0x7a9c('0x47')]){_0x57bc47[_0x7a9c('0x46')]=_[_0x7a9c('0x48')](_0x57bc47[_0x7a9c('0x46')],{'$or':_[_0x7a9c('0x39')](_0x424557,function(_0x36694f){if(_0x36694f[_0x7a9c('0x49')]!==_0x7a9c('0x4a')){var _0x16a483={};_0x16a483[_0x36694f[_0x7a9c('0x36')]]={'$like':'%'+_0x12c423[_0x7a9c('0x3f')]['filter']+'%'};return _0x16a483;}})});}_0x57bc47=_['merge']({},_0x57bc47,_0x12c423[_0x7a9c('0x4b')]);var _0x168ad5={'where':_0x57bc47[_0x7a9c('0x46')]};return db[_0x7a9c('0x3a')]['count'](_0x168ad5)[_0x7a9c('0x1e')](function(_0x5c6533){_0xeb785c['count']=_0x5c6533;if(_0x12c423[_0x7a9c('0x3f')][_0x7a9c('0x4c')]){_0x57bc47[_0x7a9c('0x4d')]=[{'all':!![]}];}return db[_0x7a9c('0x3a')]['findAll'](_0x57bc47);})[_0x7a9c('0x1e')](function(_0x21a376){_0xeb785c[_0x7a9c('0x4e')]=_0x21a376;return _0xeb785c;})[_0x7a9c('0x1e')](respondWithFilteredResult(_0x4ad10d,_0x57bc47))['catch'](handleError(_0x4ad10d,null));};exports[_0x7a9c('0x4f')]=function(_0x8b57b3,_0x5a1dc3){var _0x17f631={'raw':!![],'where':{'id':_0x8b57b3[_0x7a9c('0x50')]['id']}},_0x134a23={};_0x134a23['model']=_['keys'](db[_0x7a9c('0x3a')][_0x7a9c('0x3b')]);_0x134a23['query']=_[_0x7a9c('0x51')](_0x8b57b3[_0x7a9c('0x3f')]);_0x134a23[_0x7a9c('0x52')]=_[_0x7a9c('0x53')](_0x134a23['model'],_0x134a23[_0x7a9c('0x3f')]);_0x17f631[_0x7a9c('0x40')]=_[_0x7a9c('0x53')](_0x134a23[_0x7a9c('0x3e')],qs[_0x7a9c('0x41')](_0x8b57b3['query'][_0x7a9c('0x41')]));_0x17f631[_0x7a9c('0x40')]=_0x17f631[_0x7a9c('0x40')][_0x7a9c('0x42')]?_0x17f631[_0x7a9c('0x40')]:_0x134a23[_0x7a9c('0x3e')];if(_0x8b57b3[_0x7a9c('0x3f')]['includeAll']){_0x17f631[_0x7a9c('0x4d')]=[{'all':!![]}];}_0x17f631=_[_0x7a9c('0x48')]({},_0x17f631,_0x8b57b3[_0x7a9c('0x4b')]);return db[_0x7a9c('0x3a')][_0x7a9c('0x54')](_0x17f631)[_0x7a9c('0x1e')](handleEntityNotFound(_0x5a1dc3,null))[_0x7a9c('0x1e')](respondWithResult(_0x5a1dc3,null))[_0x7a9c('0x27')](handleError(_0x5a1dc3,null));};exports[_0x7a9c('0x55')]=function(_0x58619a,_0x55b571){return db[_0x7a9c('0x3a')][_0x7a9c('0x55')](_0x58619a['body'],{})[_0x7a9c('0x1e')](respondWithResult(_0x55b571,0xc9))['catch'](handleError(_0x55b571,null));};exports[_0x7a9c('0x33')]=function(_0x6375ba,_0xa8b3c1){if(_0x6375ba[_0x7a9c('0x56')]['id']){delete _0x6375ba[_0x7a9c('0x56')]['id'];}return db[_0x7a9c('0x3a')][_0x7a9c('0x54')]({'where':{'id':_0x6375ba[_0x7a9c('0x50')]['id']}})['then'](handleEntityNotFound(_0xa8b3c1,null))['then'](saveUpdates(_0x6375ba[_0x7a9c('0x56')],null))[_0x7a9c('0x1e')](respondWithResult(_0xa8b3c1,null))['catch'](handleError(_0xa8b3c1,null));};exports[_0x7a9c('0x34')]=function(_0x253305,_0x20a88b){return db[_0x7a9c('0x3a')][_0x7a9c('0x54')]({'where':{'id':_0x253305['params']['id']}})[_0x7a9c('0x1e')](handleEntityNotFound(_0x20a88b,null))[_0x7a9c('0x1e')](removeEntity(_0x20a88b,null))[_0x7a9c('0x27')](handleError(_0x20a88b,null));};exports[_0x7a9c('0x57')]=function(_0x549b32,_0x12b645){return db['SmsMessage'][_0x7a9c('0x57')]()[_0x7a9c('0x1e')](respondWithResult(_0x12b645,null))[_0x7a9c('0x27')](handleError(_0x12b645,null));};var interaction_log=require(_0x7a9c('0x10'))(_0x7a9c('0x58'));exports[_0x7a9c('0x59')]=function(_0x2efd04,_0x33aca2,_0x283377){var _0x4da3db={'agent':{},'channel':_0x7a9c('0x5a')};if(_0x2efd04[_0x7a9c('0x56')]['id']){delete _0x2efd04[_0x7a9c('0x56')]['id'];}_0x2efd04[_0x7a9c('0x56')][_0x7a9c('0x5b')]=!![];_0x2efd04[_0x7a9c('0x56')][_0x7a9c('0x5c')]=moment()[_0x7a9c('0x5d')](_0x7a9c('0x5e'));_0x2efd04[_0x7a9c('0x56')][_0x7a9c('0x5f')]=_0x2efd04[_0x7a9c('0x56')][_0x7a9c('0x5f')]||_0x2efd04[_0x7a9c('0x60')]['id'];_0x4da3db[_0x7a9c('0x61')]['id']=_0x2efd04[_0x7a9c('0x56')][_0x7a9c('0x5f')];return db['SmsMessage'][_0x7a9c('0x54')]({'where':{'id':_0x2efd04[_0x7a9c('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x33aca2,null))[_0x7a9c('0x1e')](saveUpdates(_0x2efd04[_0x7a9c('0x56')],null))[_0x7a9c('0x1e')](function(_0x1d53cb){if(_0x1d53cb){_0x4da3db[_0x7a9c('0x25')]=_0x1d53cb['get']({'plain':!![]});return db[_0x7a9c('0x62')][_0x7a9c('0x54')]({'where':{'id':_0x1d53cb['SmsInteractionId']}});}return null;})[_0x7a9c('0x1e')](handleEntityNotFound(_0x33aca2,null))['then'](function(_0x1d3c75){if(_0x1d3c75){return _0x1d3c75[_0x7a9c('0x33')]({'UserId':_0x2efd04[_0x7a9c('0x56')][_0x7a9c('0x5f')],'read1stAt':_[_0x7a9c('0x63')](_0x1d3c75['read1stAt'])?moment()[_0x7a9c('0x5d')](_0x7a9c('0x5e')):undefined});}return null;})[_0x7a9c('0x1e')](function(_0x589e7f){if(_0x589e7f){_0x4da3db[_0x7a9c('0x64')]=_0x589e7f[_0x7a9c('0x65')]({'plain':!![]});interaction_log[_0x7a9c('0x1f')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2efd04['user']['id'],_0x2efd04[_0x7a9c('0x60')]['name'],_0x2efd04[_0x7a9c('0x60')][_0x7a9c('0x66')],_0x4da3db[_0x7a9c('0x64')]['id'],_0x2efd04[_0x7a9c('0x56')]?JSON[_0x7a9c('0x23')](_0x2efd04[_0x7a9c('0x56')]):_0x7a9c('0x67'));return respondWithRpcPromise('AcceptMessage',_0x7a9c('0x68'),_0x4da3db);}return null;})[_0x7a9c('0x1e')](function(_0xaf9eb4){var _0x108c7b=_0x7a9c('0x69')+_0xaf9eb4['message'][_0x7a9c('0x6a')];return db['sequelize'][_0x7a9c('0x3f')](_0x108c7b,{'type':db['Sequelize'][_0x7a9c('0x6b')][_0x7a9c('0x6c')],'raw':!![]})[_0x7a9c('0x1e')](function(_0x4a9082){return _0x4a9082;});})[_0x7a9c('0x1e')](function(_0x3e415d){if(_0x3e415d){_0x4da3db['message'][_0x7a9c('0x6d')]=_0x3e415d[0x0];if(!_0x2efd04[_0x7a9c('0x56')][_0x7a9c('0x5f')])return;return db['User']['find']({'where':{'id':_0x2efd04[_0x7a9c('0x56')][_0x7a9c('0x5f')],'role':_0x7a9c('0x61')},'attributes':['id',_0x7a9c('0x36'),_0x7a9c('0x6e'),_0x7a9c('0x6f'),_0x7a9c('0x70')],'raw':!![]});}return null;})[_0x7a9c('0x1e')](function(_0x33ea04){if(!_0x33ea04)return null;_0x4da3db[_0x7a9c('0x25')][_0x7a9c('0x61')]=_0x33ea04;return _0x4da3db;})[_0x7a9c('0x1e')](function(_0x568784){if(_0x568784){if(_0x2efd04[_0x7a9c('0x56')][_0x7a9c('0x71')]){_0x4da3db[_0x7a9c('0x25')][_0x7a9c('0x72')]=util['format'](_0x7a9c('0x73'),_0x2efd04[_0x7a9c('0x60')][_0x7a9c('0x36')]);_0x4da3db[_0x7a9c('0x25')][_0x7a9c('0x74')]=_0x4da3db[_0x7a9c('0x74')];_0x4da3db[_0x7a9c('0x25')][_0x7a9c('0x75')]=_0x4da3db['channel'];_0x4da3db[_0x7a9c('0x25')]['event']='accept';return respondWithRpcPromise(_0x7a9c('0x76'),_0x7a9c('0x76'),{'event':'acceptmessage','message':_0x4da3db['message']},client9002)['then'](function(){return _0x4da3db;});}return _0x4da3db;}return null;})[_0x7a9c('0x1e')](respondWithResult(_0x33aca2,null))[_0x7a9c('0x27')](handleError(_0x33aca2,null));};var interaction_log=require(_0x7a9c('0x10'))(_0x7a9c('0x58'));exports[_0x7a9c('0x31')]=function(_0x368498,_0x3c87cd,_0x1ba7b6){var _0x3ebba8={'agent':{},'channel':_0x7a9c('0x5a')};if(_0x368498['body']['id']){delete _0x368498[_0x7a9c('0x56')]['id'];}_0x368498[_0x7a9c('0x56')][_0x7a9c('0x5f')]=_0x368498[_0x7a9c('0x56')][_0x7a9c('0x5f')]||_0x368498[_0x7a9c('0x60')]['id'];_0x3ebba8['agent']['id']=_0x368498['body'][_0x7a9c('0x5f')];return db[_0x7a9c('0x3a')][_0x7a9c('0x54')]({'where':{'id':_0x368498[_0x7a9c('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c87cd,null))['then'](function(_0x36e518){if(_0x36e518){_0x3ebba8[_0x7a9c('0x25')]=_0x36e518['get']({'plain':!![]});return db[_0x7a9c('0x62')][_0x7a9c('0x54')]({'where':{'id':_0x36e518['SmsInteractionId']}});}return null;})[_0x7a9c('0x1e')](handleEntityNotFound(_0x3c87cd,null))[_0x7a9c('0x1e')](function(_0x25789d){if(_0x25789d){_0x3ebba8['interaction']=_0x25789d[_0x7a9c('0x65')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x368498['user']['id'],_0x368498[_0x7a9c('0x60')]['name'],_0x368498[_0x7a9c('0x60')][_0x7a9c('0x66')],_0x3ebba8['interaction']['id'],_0x368498['body']?JSON[_0x7a9c('0x23')](_0x368498[_0x7a9c('0x56')]):'null');return respondWithRpcPromise(_0x7a9c('0x77'),_0x7a9c('0x78'),_0x3ebba8);}return null;})['then'](function(_0x5a2acd){var _0xa74e37=_0x7a9c('0x69')+_0x5a2acd[_0x7a9c('0x25')][_0x7a9c('0x6a')];return db[_0x7a9c('0x79')][_0x7a9c('0x3f')](_0xa74e37,{'type':db[_0x7a9c('0x7a')][_0x7a9c('0x6b')]['SELECT'],'raw':!![]})[_0x7a9c('0x1e')](function(_0x1188a6){return _0x1188a6;});})[_0x7a9c('0x1e')](function(_0x3b16af){if(_0x3b16af){_0x3ebba8[_0x7a9c('0x25')][_0x7a9c('0x6d')]=_0x3b16af[0x0];if(!_0x368498[_0x7a9c('0x56')][_0x7a9c('0x5f')])return;return db[_0x7a9c('0x7b')]['find']({'where':{'id':_0x368498[_0x7a9c('0x56')][_0x7a9c('0x5f')],'role':_0x7a9c('0x61')},'attributes':['id',_0x7a9c('0x36'),_0x7a9c('0x6e'),_0x7a9c('0x6f'),_0x7a9c('0x70')],'raw':!![]});}return null;})[_0x7a9c('0x1e')](function(_0x3aedb7){if(!_0x3aedb7)return null;_0x3ebba8['message'][_0x7a9c('0x61')]=_0x3aedb7;return _0x3ebba8;})[_0x7a9c('0x1e')](function(_0x58e053){if(_0x58e053){_0x58e053[_0x7a9c('0x25')][_0x7a9c('0x72')]=util['format'](_0x7a9c('0x73'),_0x368498[_0x7a9c('0x60')]['name']);_0x58e053[_0x7a9c('0x25')][_0x7a9c('0x74')]=_0x3ebba8[_0x7a9c('0x74')];_0x58e053[_0x7a9c('0x25')][_0x7a9c('0x75')]=_0x3ebba8['channel'];_0x58e053[_0x7a9c('0x25')][_0x7a9c('0x7c')]=_0x7a9c('0x31');respondWithRpcPromise(_0x7a9c('0x76'),'EventManager',{'event':_0x7a9c('0x7d'),'message':_0x58e053['message']},client9002);return _0x3ebba8;}return null;})['then'](respondWithResult(_0x3c87cd,null))[_0x7a9c('0x27')](handleError(_0x3c87cd,null));};exports[_0x7a9c('0x28')]=function(_0x80c3ca,_0x4d6204,_0x5f1fdb){if(_0x80c3ca['body']['id']){delete _0x80c3ca[_0x7a9c('0x56')]['id'];}var _0x5012f2;return db[_0x7a9c('0x3a')][_0x7a9c('0x54')]({'where':{'id':_0x80c3ca[_0x7a9c('0x50')]['id']}})[_0x7a9c('0x1e')](handleEntityNotFound(_0x4d6204,null))[_0x7a9c('0x1e')](function(_0x31a06e){if(_0x31a06e){_0x5012f2=_0x31a06e;return db[_0x7a9c('0x7e')]['find']({'where':{'id':_0x31a06e[_0x7a9c('0x7f')]}});}})[_0x7a9c('0x1e')](handleEntityNotFound(_0x4d6204,null))[_0x7a9c('0x1e')](function(_0x7c602e){if(_0x7c602e){logger[_0x7a9c('0x80')](_0x7a9c('0x22'),_0x7a9c('0x28'),'received\x20delivery\x20report\x20from',_0x7c602e[_0x7a9c('0x49')],util[_0x7a9c('0x81')](_0x80c3ca[_0x7a9c('0x56')],{'showHidden':![],'depth':null}));switch(_0x7c602e[_0x7a9c('0x49')]){case _0x7a9c('0x82'):if(_0x80c3ca[_0x7a9c('0x56')][_0x7a9c('0x83')]&&_0x80c3ca[_0x7a9c('0x56')][_0x7a9c('0x83')]===_0x5012f2[_0x7a9c('0x84')]){return _0x5012f2['update']({'read':!![]});}else{logger['error'](_0x7a9c('0x85'),_0x7a9c('0x28'),_0x7a9c('0x82'),util['inspect'](_0x80c3ca[_0x7a9c('0x56')],{'showHidden':![],'depth':null}));}break;case _0x7a9c('0x86'):if(_0x80c3ca[_0x7a9c('0x56')][_0x7a9c('0x87')]&&_0x80c3ca[_0x7a9c('0x56')][_0x7a9c('0x87')]===_0x5012f2[_0x7a9c('0x84')]&&_[_0x7a9c('0x88')]([_0x7a9c('0x89'),_0x7a9c('0x8a')],_0x80c3ca[_0x7a9c('0x56')][_0x7a9c('0x8b')])>=0x0){return _0x5012f2['update']({'read':!![]});}else{logger[_0x7a9c('0x24')](_0x7a9c('0x85'),_0x7a9c('0x28'),_0x7a9c('0x8c'),util[_0x7a9c('0x81')](_0x80c3ca[_0x7a9c('0x56')],{'showHidden':![],'depth':null}));}break;case _0x7a9c('0x8d'):var _0x5d3fe7=_0x80c3ca[_0x7a9c('0x56')][_0x7a9c('0x8e')][0x0];if(_0x5d3fe7[_0x7a9c('0x28')][_0x7a9c('0x8f')]==='DELIVERED'){return _0x5012f2[_0x7a9c('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7a9c('0x28'),'infobip',util[_0x7a9c('0x81')](_0x80c3ca['body'],{'showHidden':![],'depth':null}));}break;}return _0x5012f2;}})[_0x7a9c('0x1e')](respondWithResult(_0x4d6204,null))[_0x7a9c('0x27')](handleError(_0x4d6204,null));}; \ No newline at end of file +var _0x4f3d=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','params','keys','include','find','create','body','update','sms-interactions','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','manual','format','channel','motionChannel','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','contact','internal','interface','event','rejectmessage','SmsAccount','SmsAccountId','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','messageId','delivered','Status','plivio','infobip','groupName','DELIVERED','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','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','undefined','limit','count','offset','set','Content-Range','reject','save','stack','name','send','index','SmsMessage','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields'];(function(_0x33d5bf,_0x13b051){var _0x38864c=function(_0x348a23){while(--_0x348a23){_0x33d5bf['push'](_0x33d5bf['shift']());}};_0x38864c(++_0x13b051);}(_0x4f3d,0x171));var _0xd4f3=function(_0x112226,_0x2a8a20){_0x112226=_0x112226-0x0;var _0x1104d5=_0x4f3d[_0x112226];return _0x1104d5;};'use strict';var emlformat=require(_0xd4f3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd4f3('0x1'));var jsonpatch=require(_0xd4f3('0x2'));var rp=require(_0xd4f3('0x3'));var moment=require(_0xd4f3('0x4'));var BPromise=require(_0xd4f3('0x5'));var Mustache=require('mustache');var util=require(_0xd4f3('0x6'));var path=require(_0xd4f3('0x7'));var sox=require(_0xd4f3('0x8'));var csv=require(_0xd4f3('0x9'));var ejs=require(_0xd4f3('0xa'));var fs=require('fs');var fs_extra=require(_0xd4f3('0xb'));var _=require(_0xd4f3('0xc'));var squel=require(_0xd4f3('0xd'));var crypto=require('crypto');var jsforce=require(_0xd4f3('0xe'));var deskjs=require(_0xd4f3('0xf'));var toCsv=require(_0xd4f3('0x9'));var querystring=require(_0xd4f3('0x10'));var Papa=require(_0xd4f3('0x11'));var Redis=require(_0xd4f3('0x12'));var authService=require(_0xd4f3('0x13'));var qs=require(_0xd4f3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4f3('0x15'));var logger=require(_0xd4f3('0x16'))('api');var utils=require(_0xd4f3('0x17'));var config=require(_0xd4f3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd4f3('0x19'))['db'];config[_0xd4f3('0x1a')]=_['defaults'](config['redis'],{'host':_0xd4f3('0x1b'),'port':0x18eb});var socket=require(_0xd4f3('0x1c'))(new Redis(config['redis']));require(_0xd4f3('0x1d'))[_0xd4f3('0x1e')](socket);var jayson=require(_0xd4f3('0x1f'));var client=jayson[_0xd4f3('0x20')]['http']({'port':0x232c});var client9002=jayson[_0xd4f3('0x20')][_0xd4f3('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xdee08d,_0x25a89d,_0x340498,_0x3d64a6){return new BPromise(function(_0x2b3a23,_0x2ad6e2){var _0x2c0292=_0x3d64a6||client;return _0x2c0292['request'](_0xdee08d,_0x340498)[_0xd4f3('0x22')](function(_0x566e40){logger[_0xd4f3('0x23')](_0xd4f3('0x24'),_0x25a89d,_0xd4f3('0x25'));logger[_0xd4f3('0x26')](_0xd4f3('0x27'),_0x25a89d,_0xd4f3('0x25'),JSON['stringify'](_0x566e40));if(_0x566e40[_0xd4f3('0x28')]){if(_0x566e40[_0xd4f3('0x28')][_0xd4f3('0x29')]===0x1f4){logger[_0xd4f3('0x28')](_0xd4f3('0x24'),_0x25a89d,_0x566e40['error']['message']);return _0x2ad6e2(_0x566e40['error']['message']);}logger['error'](_0xd4f3('0x24'),_0x25a89d,_0x566e40[_0xd4f3('0x28')]['message']);return _0x2b3a23(_0x566e40[_0xd4f3('0x28')][_0xd4f3('0x2a')]);}else{logger['info'](_0xd4f3('0x24'),_0x25a89d,_0xd4f3('0x25'));_0x2b3a23(_0x566e40[_0xd4f3('0x2b')][_0xd4f3('0x2a')]);}})[_0xd4f3('0x2c')](function(_0x31da07){logger[_0xd4f3('0x28')]('SmsMessage,\x20%s,\x20%s',_0x25a89d,_0x31da07);_0x2ad6e2(_0x31da07);});});}function respondWithStatusCode(_0x1aac38,_0x38dff7){_0x38dff7=_0x38dff7||0xcc;return function(_0x55278c){if(_0x55278c){return _0x1aac38[_0xd4f3('0x2d')](_0x38dff7);}return _0x1aac38[_0xd4f3('0x2e')](_0x38dff7)[_0xd4f3('0x2f')]();};}function respondWithResult(_0x2e6172,_0x53ac0c){_0x53ac0c=_0x53ac0c||0xc8;return function(_0x58dd3f){if(_0x58dd3f){return _0x2e6172['status'](_0x53ac0c)[_0xd4f3('0x30')](_0x58dd3f);}};}function respondWithFilteredResult(_0x560bb3,_0x907989){return function(_0x567404){if(_0x567404){var _0x152426=typeof _0x907989['offset']===_0xd4f3('0x31')&&typeof _0x907989[_0xd4f3('0x32')]==='undefined';var _0x258788=_0x567404[_0xd4f3('0x33')];var _0x447b86=_0x152426?0x0:_0x907989[_0xd4f3('0x34')];var _0x3c4c49=_0x152426?_0x567404[_0xd4f3('0x33')]:_0x907989[_0xd4f3('0x34')]+_0x907989[_0xd4f3('0x32')];var _0x21c129;if(_0x3c4c49>=_0x258788){_0x3c4c49=_0x258788;_0x21c129=0xc8;}else{_0x21c129=0xce;}_0x560bb3[_0xd4f3('0x2e')](_0x21c129);return _0x560bb3[_0xd4f3('0x35')](_0xd4f3('0x36'),_0x447b86+'-'+_0x3c4c49+'/'+_0x258788)['json'](_0x567404);}return null;};}function patchUpdates(_0x3f5aa0){return function(_0x32edc9){try{jsonpatch['apply'](_0x32edc9,_0x3f5aa0,!![]);}catch(_0x399dff){return BPromise[_0xd4f3('0x37')](_0x399dff);}return _0x32edc9[_0xd4f3('0x38')]();};}function saveUpdates(_0xe995b4,_0xf317f7){return function(_0x4c37f7){if(_0x4c37f7){return _0x4c37f7['update'](_0xe995b4)['then'](function(_0x17d39b){return _0x17d39b;});}return null;};}function removeEntity(_0xd5a9be,_0x580fc9){return function(_0x255cdb){if(_0x255cdb){return _0x255cdb['destroy']()[_0xd4f3('0x22')](function(){_0xd5a9be[_0xd4f3('0x2e')](0xcc)[_0xd4f3('0x2f')]();});}};}function handleEntityNotFound(_0x4ea095,_0x466620){return function(_0x4c5473){if(!_0x4c5473){_0x4ea095[_0xd4f3('0x2d')](0x194);}return _0x4c5473;};}function handleError(_0x17de9a,_0x388217){_0x388217=_0x388217||0x1f4;return function(_0x5274aa){logger[_0xd4f3('0x28')](_0x5274aa[_0xd4f3('0x39')]);if(_0x5274aa[_0xd4f3('0x3a')]){delete _0x5274aa[_0xd4f3('0x3a')];}_0x17de9a[_0xd4f3('0x2e')](_0x388217)[_0xd4f3('0x3b')](_0x5274aa);};}exports[_0xd4f3('0x3c')]=function(_0x41d25f,_0x187814){var _0x4a2e62={},_0x18aa55={},_0x44068e={'count':0x0,'rows':[]};var _0x4978af=_['map'](db[_0xd4f3('0x3d')][_0xd4f3('0x3e')],function(_0x30cf0b){return{'name':_0x30cf0b['fieldName'],'type':_0x30cf0b[_0xd4f3('0x3f')][_0xd4f3('0x40')]};});_0x18aa55[_0xd4f3('0x41')]=_[_0xd4f3('0x42')](_0x4978af,_0xd4f3('0x3a'));_0x18aa55[_0xd4f3('0x43')]=_['keys'](_0x41d25f[_0xd4f3('0x43')]);_0x18aa55[_0xd4f3('0x44')]=_[_0xd4f3('0x45')](_0x18aa55[_0xd4f3('0x41')],_0x18aa55[_0xd4f3('0x43')]);_0x4a2e62[_0xd4f3('0x46')]=_['intersection'](_0x18aa55[_0xd4f3('0x41')],qs[_0xd4f3('0x47')](_0x41d25f[_0xd4f3('0x43')][_0xd4f3('0x47')]));_0x4a2e62[_0xd4f3('0x46')]=_0x4a2e62['attributes'][_0xd4f3('0x48')]?_0x4a2e62[_0xd4f3('0x46')]:_0x18aa55[_0xd4f3('0x41')];if(!_0x41d25f[_0xd4f3('0x43')][_0xd4f3('0x49')](_0xd4f3('0x4a'))){_0x4a2e62['limit']=qs[_0xd4f3('0x32')](_0x41d25f['query'][_0xd4f3('0x32')]);_0x4a2e62[_0xd4f3('0x34')]=qs[_0xd4f3('0x34')](_0x41d25f[_0xd4f3('0x43')][_0xd4f3('0x34')]);}_0x4a2e62[_0xd4f3('0x4b')]=qs[_0xd4f3('0x4c')](_0x41d25f[_0xd4f3('0x43')][_0xd4f3('0x4c')]);_0x4a2e62[_0xd4f3('0x4d')]=qs['filters'](_[_0xd4f3('0x4e')](_0x41d25f[_0xd4f3('0x43')],_0x18aa55['filters']),_0x4978af);if(_0x41d25f[_0xd4f3('0x43')][_0xd4f3('0x4f')]){_0x4a2e62['where']=_['merge'](_0x4a2e62[_0xd4f3('0x4d')],{'$or':_[_0xd4f3('0x42')](_0x4978af,function(_0x274ef6){if(_0x274ef6[_0xd4f3('0x3f')]!=='VIRTUAL'){var _0x291f9b={};_0x291f9b[_0x274ef6[_0xd4f3('0x3a')]]={'$like':'%'+_0x41d25f[_0xd4f3('0x43')][_0xd4f3('0x4f')]+'%'};return _0x291f9b;}})});}_0x4a2e62=_[_0xd4f3('0x50')]({},_0x4a2e62,_0x41d25f[_0xd4f3('0x51')]);var _0x458938={'where':_0x4a2e62[_0xd4f3('0x4d')]};return db[_0xd4f3('0x3d')][_0xd4f3('0x33')](_0x458938)[_0xd4f3('0x22')](function(_0x20968b){_0x44068e[_0xd4f3('0x33')]=_0x20968b;if(_0x41d25f['query'][_0xd4f3('0x52')]){_0x4a2e62['include']=[{'all':!![]}];}return db[_0xd4f3('0x3d')][_0xd4f3('0x53')](_0x4a2e62);})['then'](function(_0x3f9841){_0x44068e['rows']=_0x3f9841;return _0x44068e;})[_0xd4f3('0x22')](respondWithFilteredResult(_0x187814,_0x4a2e62))[_0xd4f3('0x2c')](handleError(_0x187814,null));};exports['show']=function(_0x225972,_0x15c6f4){var _0x28085f={'raw':!![],'where':{'id':_0x225972[_0xd4f3('0x54')]['id']}},_0x49ce83={};_0x49ce83[_0xd4f3('0x41')]=_[_0xd4f3('0x55')](db['SmsMessage']['rawAttributes']);_0x49ce83['query']=_[_0xd4f3('0x55')](_0x225972['query']);_0x49ce83[_0xd4f3('0x44')]=_[_0xd4f3('0x45')](_0x49ce83['model'],_0x49ce83[_0xd4f3('0x43')]);_0x28085f[_0xd4f3('0x46')]=_[_0xd4f3('0x45')](_0x49ce83['model'],qs[_0xd4f3('0x47')](_0x225972[_0xd4f3('0x43')][_0xd4f3('0x47')]));_0x28085f['attributes']=_0x28085f[_0xd4f3('0x46')][_0xd4f3('0x48')]?_0x28085f[_0xd4f3('0x46')]:_0x49ce83[_0xd4f3('0x41')];if(_0x225972['query'][_0xd4f3('0x52')]){_0x28085f[_0xd4f3('0x56')]=[{'all':!![]}];}_0x28085f=_['merge']({},_0x28085f,_0x225972[_0xd4f3('0x51')]);return db[_0xd4f3('0x3d')][_0xd4f3('0x57')](_0x28085f)[_0xd4f3('0x22')](handleEntityNotFound(_0x15c6f4,null))[_0xd4f3('0x22')](respondWithResult(_0x15c6f4,null))[_0xd4f3('0x2c')](handleError(_0x15c6f4,null));};exports[_0xd4f3('0x58')]=function(_0x492772,_0xfce22e){return db[_0xd4f3('0x3d')][_0xd4f3('0x58')](_0x492772[_0xd4f3('0x59')],{})['then'](respondWithResult(_0xfce22e,0xc9))[_0xd4f3('0x2c')](handleError(_0xfce22e,null));};exports[_0xd4f3('0x5a')]=function(_0x205e54,_0x357ada){if(_0x205e54[_0xd4f3('0x59')]['id']){delete _0x205e54[_0xd4f3('0x59')]['id'];}return db[_0xd4f3('0x3d')][_0xd4f3('0x57')]({'where':{'id':_0x205e54[_0xd4f3('0x54')]['id']}})[_0xd4f3('0x22')](handleEntityNotFound(_0x357ada,null))[_0xd4f3('0x22')](saveUpdates(_0x205e54[_0xd4f3('0x59')],null))['then'](respondWithResult(_0x357ada,null))[_0xd4f3('0x2c')](handleError(_0x357ada,null));};exports['destroy']=function(_0x19ddcd,_0x4bb8e5){return db[_0xd4f3('0x3d')][_0xd4f3('0x57')]({'where':{'id':_0x19ddcd['params']['id']}})[_0xd4f3('0x22')](handleEntityNotFound(_0x4bb8e5,null))['then'](removeEntity(_0x4bb8e5,null))[_0xd4f3('0x2c')](handleError(_0x4bb8e5,null));};exports['describe']=function(_0x3df7d6,_0x35064a){return db[_0xd4f3('0x3d')]['describe']()['then'](respondWithResult(_0x35064a,null))[_0xd4f3('0x2c')](handleError(_0x35064a,null));};var interaction_log=require(_0xd4f3('0x16'))(_0xd4f3('0x5b'));exports[_0xd4f3('0x5c')]=function(_0x1042a2,_0x4b0a9c,_0x21c490){var _0x4f1550={'agent':{},'channel':_0xd4f3('0x5d')};if(_0x1042a2[_0xd4f3('0x59')]['id']){delete _0x1042a2['body']['id'];}_0x1042a2[_0xd4f3('0x59')][_0xd4f3('0x5e')]=!![];_0x1042a2[_0xd4f3('0x59')][_0xd4f3('0x5f')]=moment()['format'](_0xd4f3('0x60'));_0x1042a2['body'][_0xd4f3('0x61')]=_0x1042a2['body'][_0xd4f3('0x61')]||_0x1042a2[_0xd4f3('0x62')]['id'];_0x4f1550[_0xd4f3('0x63')]['id']=_0x1042a2[_0xd4f3('0x59')][_0xd4f3('0x61')];return db['SmsMessage'][_0xd4f3('0x57')]({'where':{'id':_0x1042a2['params']['id'],'UserId':null}})[_0xd4f3('0x22')](handleEntityNotFound(_0x4b0a9c,null))[_0xd4f3('0x22')](saveUpdates(_0x1042a2[_0xd4f3('0x59')],null))[_0xd4f3('0x22')](function(_0x2dd888){if(_0x2dd888){_0x4f1550['message']=_0x2dd888['get']({'plain':!![]});return db[_0xd4f3('0x64')][_0xd4f3('0x57')]({'where':{'id':_0x2dd888[_0xd4f3('0x65')]}});}return null;})[_0xd4f3('0x22')](handleEntityNotFound(_0x4b0a9c,null))['then'](function(_0x3d6ca4){if(_0x3d6ca4){return _0x3d6ca4[_0xd4f3('0x5a')]({'UserId':_0x1042a2[_0xd4f3('0x59')][_0xd4f3('0x61')],'read1stAt':_['isNil'](_0x3d6ca4[_0xd4f3('0x66')])?moment()['format'](_0xd4f3('0x60')):undefined});}return null;})['then'](function(_0x1ac7c7){if(_0x1ac7c7){_0x4f1550[_0xd4f3('0x67')]=_0x1ac7c7[_0xd4f3('0x68')]({'plain':!![]});interaction_log[_0xd4f3('0x23')](_0xd4f3('0x69'),_0x1042a2[_0xd4f3('0x62')]['id'],_0x1042a2[_0xd4f3('0x62')][_0xd4f3('0x3a')],_0x1042a2['user'][_0xd4f3('0x6a')],_0x4f1550['interaction']['id'],_0x1042a2[_0xd4f3('0x59')]?JSON[_0xd4f3('0x6b')](_0x1042a2[_0xd4f3('0x59')]):_0xd4f3('0x6c'));return respondWithRpcPromise(_0xd4f3('0x6d'),_0xd4f3('0x6e'),_0x4f1550);}return null;})[_0xd4f3('0x22')](function(_0x158703){var _0x79b057=_0xd4f3('0x6f')+_0x158703[_0xd4f3('0x2a')]['ContactId'];return db[_0xd4f3('0x70')][_0xd4f3('0x43')](_0x79b057,{'type':db[_0xd4f3('0x71')][_0xd4f3('0x72')][_0xd4f3('0x73')],'raw':!![]})[_0xd4f3('0x22')](function(_0x27aee1){return _0x27aee1;});})[_0xd4f3('0x22')](function(_0x1662ea){if(_0x1662ea){_0x4f1550['message']['contact']=_0x1662ea[0x0];if(!_0x1042a2[_0xd4f3('0x59')][_0xd4f3('0x61')])return;return db['User'][_0xd4f3('0x57')]({'where':{'id':_0x1042a2[_0xd4f3('0x59')]['UserId'],'role':_0xd4f3('0x63')},'attributes':['id','name',_0xd4f3('0x74'),_0xd4f3('0x75'),'internal'],'raw':!![]});}return null;})[_0xd4f3('0x22')](function(_0x26625c){if(!_0x26625c)return null;_0x4f1550[_0xd4f3('0x2a')][_0xd4f3('0x63')]=_0x26625c;return _0x4f1550;})[_0xd4f3('0x22')](function(_0x429bff){if(_0x429bff){if(_0x1042a2[_0xd4f3('0x59')][_0xd4f3('0x76')]){_0x4f1550['message']['interface']=util[_0xd4f3('0x77')]('SIP/%s',_0x1042a2[_0xd4f3('0x62')]['name']);_0x4f1550['message'][_0xd4f3('0x78')]=_0x4f1550['channel'];_0x4f1550[_0xd4f3('0x2a')][_0xd4f3('0x79')]=_0x4f1550['channel'];_0x4f1550[_0xd4f3('0x2a')]['event']=_0xd4f3('0x5c');return respondWithRpcPromise(_0xd4f3('0x7a'),_0xd4f3('0x7a'),{'event':_0xd4f3('0x7b'),'message':_0x4f1550[_0xd4f3('0x2a')]},client9002)[_0xd4f3('0x22')](function(){return _0x4f1550;});}return _0x4f1550;}return null;})[_0xd4f3('0x22')](respondWithResult(_0x4b0a9c,null))[_0xd4f3('0x2c')](handleError(_0x4b0a9c,null));};var interaction_log=require(_0xd4f3('0x16'))(_0xd4f3('0x5b'));exports[_0xd4f3('0x37')]=function(_0x236d3e,_0x1e814c,_0x198c8e){var _0x18c573={'agent':{},'channel':'sms'};if(_0x236d3e[_0xd4f3('0x59')]['id']){delete _0x236d3e[_0xd4f3('0x59')]['id'];}_0x236d3e[_0xd4f3('0x59')][_0xd4f3('0x61')]=_0x236d3e[_0xd4f3('0x59')][_0xd4f3('0x61')]||_0x236d3e[_0xd4f3('0x62')]['id'];_0x18c573[_0xd4f3('0x63')]['id']=_0x236d3e['body'][_0xd4f3('0x61')];return db[_0xd4f3('0x3d')][_0xd4f3('0x57')]({'where':{'id':_0x236d3e['params']['id'],'UserId':null}})[_0xd4f3('0x22')](handleEntityNotFound(_0x1e814c,null))[_0xd4f3('0x22')](function(_0x56b628){if(_0x56b628){_0x18c573[_0xd4f3('0x2a')]=_0x56b628[_0xd4f3('0x68')]({'plain':!![]});return db[_0xd4f3('0x64')][_0xd4f3('0x57')]({'where':{'id':_0x56b628[_0xd4f3('0x65')]}});}return null;})[_0xd4f3('0x22')](handleEntityNotFound(_0x1e814c,null))['then'](function(_0x49a706){if(_0x49a706){_0x18c573[_0xd4f3('0x67')]=_0x49a706[_0xd4f3('0x68')]({'plain':!![]});interaction_log[_0xd4f3('0x23')](_0xd4f3('0x7c'),_0x236d3e[_0xd4f3('0x62')]['id'],_0x236d3e[_0xd4f3('0x62')]['name'],_0x236d3e[_0xd4f3('0x62')][_0xd4f3('0x6a')],_0x18c573[_0xd4f3('0x67')]['id'],_0x236d3e[_0xd4f3('0x59')]?JSON[_0xd4f3('0x6b')](_0x236d3e['body']):_0xd4f3('0x6c'));return respondWithRpcPromise(_0xd4f3('0x7d'),_0xd4f3('0x7e'),_0x18c573);}return null;})['then'](function(_0x531836){var _0x19f112='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x531836[_0xd4f3('0x2a')][_0xd4f3('0x7f')];return db[_0xd4f3('0x70')]['query'](_0x19f112,{'type':db['Sequelize'][_0xd4f3('0x72')]['SELECT'],'raw':!![]})[_0xd4f3('0x22')](function(_0x21416f){return _0x21416f;});})[_0xd4f3('0x22')](function(_0x21fd43){if(_0x21fd43){_0x18c573[_0xd4f3('0x2a')][_0xd4f3('0x80')]=_0x21fd43[0x0];if(!_0x236d3e[_0xd4f3('0x59')][_0xd4f3('0x61')])return;return db['User'][_0xd4f3('0x57')]({'where':{'id':_0x236d3e['body'][_0xd4f3('0x61')],'role':_0xd4f3('0x63')},'attributes':['id',_0xd4f3('0x3a'),_0xd4f3('0x74'),_0xd4f3('0x75'),_0xd4f3('0x81')],'raw':!![]});}return null;})[_0xd4f3('0x22')](function(_0x470e01){if(!_0x470e01)return null;_0x18c573[_0xd4f3('0x2a')][_0xd4f3('0x63')]=_0x470e01;return _0x18c573;})[_0xd4f3('0x22')](function(_0x3888ea){if(_0x3888ea){_0x3888ea[_0xd4f3('0x2a')][_0xd4f3('0x82')]=util[_0xd4f3('0x77')]('SIP/%s',_0x236d3e[_0xd4f3('0x62')][_0xd4f3('0x3a')]);_0x3888ea['message'][_0xd4f3('0x78')]=_0x18c573[_0xd4f3('0x78')];_0x3888ea['message'][_0xd4f3('0x79')]=_0x18c573[_0xd4f3('0x78')];_0x3888ea['message'][_0xd4f3('0x83')]=_0xd4f3('0x37');respondWithRpcPromise(_0xd4f3('0x7a'),_0xd4f3('0x7a'),{'event':_0xd4f3('0x84'),'message':_0x3888ea[_0xd4f3('0x2a')]},client9002);return _0x18c573;}return null;})[_0xd4f3('0x22')](respondWithResult(_0x1e814c,null))[_0xd4f3('0x2c')](handleError(_0x1e814c,null));};exports[_0xd4f3('0x2e')]=function(_0x2e6c3a,_0x4804f9,_0x4a7026){if(_0x2e6c3a[_0xd4f3('0x59')]['id']){delete _0x2e6c3a[_0xd4f3('0x59')]['id'];}var _0x1a0926;return db[_0xd4f3('0x3d')][_0xd4f3('0x57')]({'where':{'id':_0x2e6c3a[_0xd4f3('0x54')]['id']}})[_0xd4f3('0x22')](handleEntityNotFound(_0x4804f9,null))['then'](function(_0x4df32f){if(_0x4df32f){_0x1a0926=_0x4df32f;return db[_0xd4f3('0x85')][_0xd4f3('0x57')]({'where':{'id':_0x4df32f[_0xd4f3('0x86')]}});}})[_0xd4f3('0x22')](handleEntityNotFound(_0x4804f9,null))[_0xd4f3('0x22')](function(_0x283e96){if(_0x283e96){logger[_0xd4f3('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x283e96['type'],util['inspect'](_0x2e6c3a['body'],{'showHidden':![],'depth':null}));switch(_0x283e96[_0xd4f3('0x3f')]){case'twilio':if(_0x2e6c3a[_0xd4f3('0x59')][_0xd4f3('0x87')]&&_0x2e6c3a[_0xd4f3('0x59')][_0xd4f3('0x87')]===_0x1a0926['messageId']){return _0x1a0926['update']({'read':!![]});}else{logger[_0xd4f3('0x28')](_0xd4f3('0x88'),_0xd4f3('0x2e'),'twilio',util[_0xd4f3('0x89')](_0x2e6c3a[_0xd4f3('0x59')],{'showHidden':![],'depth':null}));}break;case _0xd4f3('0x8a'):if(_0x2e6c3a['body'][_0xd4f3('0x8b')]&&_0x2e6c3a[_0xd4f3('0x59')][_0xd4f3('0x8b')]===_0x1a0926[_0xd4f3('0x8c')]&&_['indexOf'](['sent',_0xd4f3('0x8d')],_0x2e6c3a['body'][_0xd4f3('0x8e')])>=0x0){return _0x1a0926[_0xd4f3('0x5a')]({'read':!![]});}else{logger[_0xd4f3('0x28')](_0xd4f3('0x88'),_0xd4f3('0x2e'),_0xd4f3('0x8f'),util['inspect'](_0x2e6c3a[_0xd4f3('0x59')],{'showHidden':![],'depth':null}));}break;case _0xd4f3('0x90'):var _0x38f872=_0x2e6c3a[_0xd4f3('0x59')]['results'][0x0];if(_0x38f872['status'][_0xd4f3('0x91')]===_0xd4f3('0x92')){return _0x1a0926['update']({'read':!![]});}else{logger[_0xd4f3('0x28')](_0xd4f3('0x88'),_0xd4f3('0x2e'),_0xd4f3('0x90'),util[_0xd4f3('0x89')](_0x2e6c3a[_0xd4f3('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x1a0926;}})[_0xd4f3('0x22')](respondWithResult(_0x4804f9,null))['catch'](handleError(_0x4804f9,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index d618d3e..12a5696 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 _0x80cc=['save','remove','emit','hook','exports','../../mysqldb'];(function(_0x330642,_0x562c27){var _0x3380c7=function(_0x4d5559){while(--_0x4d5559){_0x330642['push'](_0x330642['shift']());}};_0x3380c7(++_0x562c27);}(_0x80cc,0x185));var _0xc80c=function(_0x335ce6,_0x5e253c){_0x335ce6=_0x335ce6-0x0;var _0x3855d4=_0x80cc[_0x335ce6];return _0x3855d4;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xc80c('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc80c('0x1'),'afterUpdate':'update','afterDestroy':_0xc80c('0x2')};function emitEvent(_0x156691){return function(_0x12a0c2,_0x225bb9,_0x5c315d){SmsMessageEvents['emit'](_0x156691+':'+_0x12a0c2['id'],_0x12a0c2);SmsMessageEvents[_0xc80c('0x3')](_0x156691,_0x12a0c2);_0x5c315d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xc80c('0x4')](e,emitEvent(event));}}module[_0xc80c('0x5')]=SmsMessageEvents; \ No newline at end of file +var _0x3e23=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x561885,_0x2b3224){var _0x3a9250=function(_0x31820e){while(--_0x31820e){_0x561885['push'](_0x561885['shift']());}};_0x3a9250(++_0x2b3224);}(_0x3e23,0x1ea));var _0x33e2=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0x3e23[_0x2c6810];return _0x213881;};'use strict';var EventEmitter=require(_0x33e2('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x33e2('0x1')](0x0);var events={'afterCreate':_0x33e2('0x2'),'afterUpdate':_0x33e2('0x3'),'afterDestroy':_0x33e2('0x4')};function emitEvent(_0x50bf8d){return function(_0x47d46d,_0x2b5f1f,_0x35fda8){SmsMessageEvents['emit'](_0x50bf8d+':'+_0x47d46d['id'],_0x47d46d);SmsMessageEvents[_0x33e2('0x5')](_0x50bf8d,_0x47d46d);_0x35fda8(null);};}for(var e in events){if(events[_0x33e2('0x6')](e)){var event=events[e];SmsMessage[_0x33e2('0x7')](e,emitEvent(event));}}module[_0x33e2('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index f4b58aa..8905161 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 _0x75e8=['https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','text','timestamp','keys','createHash','md5','digest','hex','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','%s:%s','https://messaging.bandwidth.com/api/v2/users/','accountId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','SmsMessage','sms_messages','messageId','fti_sms_messages','models','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','update','catch','error','SmsAccount','find','then','type','twilio','accountSid','authToken','messages','create','body','phone','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','GET','split','sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','read','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format'];(function(_0x1168a1,_0xa0d8c9){var _0xcc5ad8=function(_0x217dc3){while(--_0x217dc3){_0x1168a1['push'](_0x1168a1['shift']());}};_0xcc5ad8(++_0xa0d8c9);}(_0x75e8,0x1ac));var _0x875e=function(_0x406407,_0x72fc4c){_0x406407=_0x406407-0x0;var _0x50397f=_0x75e8[_0x406407];return _0x50397f;};'use strict';var _=require(_0x875e('0x0'));var util=require('util');var logger=require(_0x875e('0x1'))(_0x875e('0x2'));var moment=require(_0x875e('0x3'));var BPromise=require(_0x875e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x875e('0x5'));var rimraf=require(_0x875e('0x6'));var config=require(_0x875e('0x7'));var attributes=require(_0x875e('0x8'));module['exports']=function(_0x1ecbf6,_0x2c94c6){return _0x1ecbf6['define'](_0x875e('0x9'),attributes,{'tableName':_0x875e('0xa'),'paranoid':![],'indexes':[{'name':_0x875e('0xb'),'fields':[_0x875e('0xb')]},{'name':_0x875e('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e22f4,_0x46008c,_0x2c5500){var _0x31da09=_0x1ecbf6[_0x875e('0xd')];var _0x5a39ba=_0x3e22f4[_0x875e('0xe')]({'plain':!![]});if(_0x5a39ba[_0x875e('0xf')]['toLowerCase']()==='in'||_0x5a39ba[_0x875e('0xf')][_0x875e('0x10')]()===_0x875e('0x11')&&!_0x5a39ba[_0x875e('0x12')]&&!_[_0x875e('0x13')](_0x5a39ba['UserId'])&&!_[_0x875e('0x13')](_0x5a39ba[_0x875e('0x14')])){_0x31da09[_0x875e('0x15')][_0x875e('0x16')]({'where':{'id':_0x5a39ba[_0x875e('0x14')]}})['then'](function(_0x465441){if(_0x465441){_0x465441[_0x875e('0x17')]({'lastMsgAt':_0x5a39ba['createdAt'],'lastMsgDirection':_0x5a39ba[_0x875e('0xf')][_0x875e('0x10')]()});}})[_0x875e('0x18')](function(_0x325aad){console[_0x875e('0x19')](_0x325aad);});}if(_0x5a39ba['direction']===_0x875e('0x11')&&!_0x5a39ba['secret']){var _0x2fea60;_0x31da09[_0x875e('0x1a')][_0x875e('0x1b')]({'where':{'id':_0x5a39ba['SmsAccountId']},'raw':!![]})[_0x875e('0x1c')](function(_0x573ec8){_0x2fea60=_0x573ec8;if(_0x2fea60&&_0x2fea60[_0x875e('0x1d')]){switch(_0x2fea60[_0x875e('0x1d')]){case _0x875e('0x1e'):var _0x3f205c=require('twilio');if(_0x2fea60[_0x875e('0x1f')]&&_0x2fea60[_0x875e('0x20')]&&_0x2fea60['phone']){var _0x439942=new _0x3f205c(_0x2fea60['accountSid'],_0x2fea60[_0x875e('0x20')]);_0x439942[_0x875e('0x21')][_0x875e('0x22')]({'body':_0x5a39ba[_0x875e('0x23')],'to':_0x5a39ba[_0x875e('0x24')],'from':_0x2fea60[_0x875e('0x24')],'statusCallback':_0x2fea60[_0x875e('0x25')]+_0x875e('0x26')+_0x5a39ba['id']+_0x875e('0x27')+_0x2fea60[_0x875e('0x28')]})[_0x875e('0x1c')](function(_0x3067e1){if(_0x3067e1[_0x875e('0x29')]){return _0x3e22f4[_0x875e('0x17')]({'messageId':_0x3067e1[_0x875e('0x29')]});}})[_0x875e('0x18')](function(_0x2af636){logger['error'](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x1e'),util[_0x875e('0x2c')](_0x2af636,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x875e('0x2b'),_0x875e('0x1e'),_0x875e('0x2d'));}break;case _0x875e('0x2e'):var _0x7b7206=_0x875e('0x2f');if(_0x2fea60[_0x875e('0x30')]&&_0x2fea60[_0x875e('0x31')]){var _0x108937={'recipient':[_0x5a39ba[_0x875e('0x24')]],'message':_0x5a39ba['body'],'message_type':_0x2fea60[_0x875e('0x32')]};if(_0x2fea60[_0x875e('0x32')]&&_0x2fea60[_0x875e('0x32')]!=='SI'){_0x108937[_0x875e('0x33')]=_0x2fea60[_0x875e('0x24')];}var _0x5d7449={'url':_0x7b7206+_0x875e('0x34')+_0x2fea60[_0x875e('0x30')]+'&password='+_0x2fea60[_0x875e('0x31')],'method':_0x875e('0x35')};rp(_0x5d7449)[_0x875e('0x1c')](function(_0x530cff){var _0x314878=_0x530cff[_0x875e('0x36')](';');var _0x311cda={'user_key':_0x314878[0x0],'session_key':_0x314878[0x1]};_0x5d7449={'url':_0x7b7206+_0x875e('0x37'),'method':'POST','headers':{'user_key':_0x311cda[_0x875e('0x38')],'Session_key':_0x311cda[_0x875e('0x39')]},'json':!![],'body':_0x108937};return rp(_0x5d7449);})['then'](function(_0xd226a3){if(_0xd226a3[_0x875e('0x3a')]>=0x1){var _0xb407ad={'messageId':_0xd226a3[_0x875e('0x3b')]};if(_0x2fea60[_0x875e('0x32')]!=='GP'||!_0x2fea60[_0x875e('0x3c')]){_0xb407ad['read']=!![];}return _0x3e22f4['update'](_0xb407ad);}else{return logger[_0x875e('0x19')](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x2e'),util[_0x875e('0x2c')](_0xd226a3,{'showHidden':![],'depth':null}));}})['catch'](function(_0x31b884){return logger[_0x875e('0x19')](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x2e'),util[_0x875e('0x2c')](_0x31b884,{'showHidden':![],'depth':null}));});}else{logger[_0x875e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x875e('0x2b'),'skebby',_0x875e('0x3d'));}break;case'connectel':if(_0x2fea60[_0x875e('0x20')]){var _0x4a1280={'recipient':_0x5a39ba[_0x875e('0x24')],'message':_0x5a39ba[_0x875e('0x23')],'sender':_0x2fea60[_0x875e('0x3e')]||_0x2fea60[_0x875e('0x24')],'authorization':_0x2fea60[_0x875e('0x20')]};var _0x46008c={'method':_0x875e('0x3f'),'uri':_0x875e('0x40'),'body':_0x4a1280,'json':!![]};rp(_0x46008c)[_0x875e('0x1c')](function(_0x1e975e){var _0x1683b1={'messageId':_0x1e975e[_0x875e('0x41')]};if(!_0x2fea60[_0x875e('0x3c')]){_0x1683b1[_0x875e('0x42')]=!![];}return _0x3e22f4[_0x875e('0x17')](_0x1683b1);})[_0x875e('0x18')](function(_0x21cf76){logger[_0x875e('0x19')](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x43'),util[_0x875e('0x2c')](_0x21cf76,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x43'),_0x875e('0x44'));}break;case _0x875e('0x45'):if(_0x2fea60['username']&&_0x2fea60[_0x875e('0x31')]){var _0x4a1280={'messages':[{'source':_0x875e('0x46'),'to':_0x5a39ba[_0x875e('0x24')],'body':_0x5a39ba[_0x875e('0x23')],'from':_0x2fea60[_0x875e('0x3e')]||_0x2fea60[_0x875e('0x24')]}]};var _0x1abce3=util[_0x875e('0x47')]('%s:%s',_0x2fea60[_0x875e('0x30')],_0x2fea60[_0x875e('0x31')]);var _0x46008c={'method':_0x875e('0x3f'),'uri':_0x875e('0x48'),'body':_0x4a1280,'headers':{'Authorization':util[_0x875e('0x47')](_0x875e('0x49'),new Buffer(_0x1abce3)[_0x875e('0x4a')]('base64'))},'json':!![]};rp(_0x46008c)[_0x875e('0x1c')](function(_0x1552ac){if(_0x1552ac[_0x875e('0x4b')]>=0xc8&&_0x1552ac['http_code']<=0xce){if(_0x1552ac['data']&&_0x1552ac[_0x875e('0x4c')][_0x875e('0x4d')]>0x0){var _0xce563f=_[_0x875e('0x4e')](_0x1552ac[_0x875e('0x4c')][_0x875e('0x21')]);var _0x26ae21={'messageId':_0xce563f[_0x875e('0x4f')]};if(!_0x2fea60[_0x875e('0x3c')]){_0x26ae21['read']=!![];}return _0x3e22f4[_0x875e('0x17')](_0x26ae21);}else{logger[_0x875e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x875e('0x2b'),_0x875e('0x50'),util[_0x875e('0x2c')](_0x1552ac,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x875e('0x50'),util[_0x875e('0x2c')](_0x1552ac,{'showHidden':![],'depth':null}));}})[_0x875e('0x18')](function(_0x5929eb){logger[_0x875e('0x19')](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x50'),util[_0x875e('0x2c')](_0x5929eb,{'showHidden':![],'depth':null}));});}else{logger[_0x875e('0x19')](_0x875e('0x2a'),'afterCreate',_0x875e('0x50'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x875e('0x51'):if(_0x2fea60[_0x875e('0x52')]&&_0x2fea60[_0x875e('0x20')]){var _0x4a1280={'dst':_0x5a39ba[_0x875e('0x24')],'text':_0x5a39ba[_0x875e('0x23')],'src':_0x2fea60[_0x875e('0x3e')]||_0x2fea60[_0x875e('0x24')],'url':_0x2fea60[_0x875e('0x25')]+'/api/sms/messages/'+_0x5a39ba['id']+_0x875e('0x27')+_0x2fea60[_0x875e('0x28')]};var _0x1abce3=util[_0x875e('0x47')]('%s:%s',_0x2fea60[_0x875e('0x52')],_0x2fea60[_0x875e('0x20')]);var _0x46008c={'method':_0x875e('0x3f'),'uri':util[_0x875e('0x47')](_0x875e('0x53'),_0x2fea60['authId']),'body':_0x4a1280,'headers':{'Authorization':util[_0x875e('0x47')](_0x875e('0x49'),new Buffer(_0x1abce3)[_0x875e('0x4a')](_0x875e('0x54')))},'json':!![]};rp(_0x46008c)[_0x875e('0x1c')](function(_0x5f2fdb){var _0x4a585c={'messageId':_0x5f2fdb[_0x875e('0x55')][0x0]};return _0x3e22f4['update'](_0x4a585c);})[_0x875e('0x18')](function(_0x52c114){logger['error'](_0x875e('0x2a'),'afterCreate',_0x875e('0x51'),util[_0x875e('0x2c')](_0x52c114,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x875e('0x2a'),_0x875e('0x2b'),'plivo',_0x875e('0x56'));}break;case _0x875e('0x57'):if(_0x2fea60['username']&&_0x2fea60['password']){if(_0x2fea60['baseUrl']){var _0x1a705c={'method':_0x875e('0x3f'),'uri':_0x2fea60[_0x875e('0x58')]+_0x875e('0x59'),'body':{'username':_0x2fea60[_0x875e('0x30')],'password':_0x2fea60[_0x875e('0x31')]},'json':!![]};return rp(_0x1a705c)[_0x875e('0x1c')](function(_0x30a538){var _0x2a19ae={'method':_0x875e('0x3f'),'uri':_0x2fea60[_0x875e('0x58')]+_0x875e('0x5a'),'body':{'messages':[{'from':_0x2fea60['phone'],'destinations':[{'to':_0x5a39ba[_0x875e('0x24')]}],'text':_0x5a39ba['body'],'notifyUrl':_0x2fea60[_0x875e('0x25')]+_0x875e('0x26')+_0x5a39ba['id']+_0x875e('0x27')+_0x2fea60['token'],'notifyContentType':_0x875e('0x5b'),'callbackData':_0x2fea60[_0x875e('0x24')]+';'+_0x5a39ba['body']}]},'headers':{'Authorization':_0x875e('0x5c')+_0x30a538[_0x875e('0x28')]},'json':!![]};return rp(_0x2a19ae)[_0x875e('0x1c')](function(_0x130b1a){if(_0x130b1a[_0x875e('0x21')]){var _0x588489={'messageId':_0x130b1a[_0x875e('0x21')][0x0][_0x875e('0xb')]};if(!_0x2fea60[_0x875e('0x3c')]){_0x588489[_0x875e('0x42')]=!![];}return _0x3e22f4[_0x875e('0x17')](_0x588489);}else{return logger['error'](_0x875e('0x2a'),_0x875e('0x2b'),'infobip',util[_0x875e('0x2c')](_0x130b1a,{'showHidden':![],'depth':null}));}});})[_0x875e('0x18')](function(_0x3debbb){return logger['error'](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x57'),util[_0x875e('0x2c')](_0x3debbb,{'showHidden':![],'depth':null}));});}else{logger[_0x875e('0x19')](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x57'),_0x875e('0x5d'));}}else{logger[_0x875e('0x19')](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x57'),_0x875e('0x3d'));}break;case _0x875e('0x5e'):var _0x53365b=require('crypto');if(_0x2fea60[_0x875e('0x5f')]){var _0x32d054={};_0x32d054['login']=_0x2fea60[_0x875e('0x30')];_0x32d054[_0x875e('0x24')]=_0x5a39ba['phone'];_0x32d054[_0x875e('0x33')]=_0x2fea60['phone'];_0x32d054[_0x875e('0x60')]=_0x5a39ba[_0x875e('0x23')];_0x32d054[_0x875e('0x61')]=+new Date();var _0x14a92f='';var _0x5be80f='';var _0x19c683=Object[_0x875e('0x62')](_0x32d054);_0x19c683['sort']();for(var _0x3805a6=0x0;_0x3805a6<_0x19c683['length'];_0x3805a6++){if(_0x14a92f!=''){_0x14a92f+='&';}_0x14a92f+=_0x19c683[_0x3805a6]+'='+encodeURIComponent(_0x32d054[_0x19c683[_0x3805a6]]);_0x5be80f+=_0x32d054[_0x19c683[_0x3805a6]];}_0x5be80f+=_0x2fea60[_0x875e('0x5f')];_0x5be80f=_0x53365b[_0x875e('0x63')](_0x875e('0x64'))[_0x875e('0x17')](_0x5be80f)[_0x875e('0x65')](_0x875e('0x66'));if(_0x14a92f!==''){_0x14a92f+='&';}_0x14a92f+='signature='+_0x5be80f;var _0x5d7449={'method':'GET','uri':_0x2fea60[_0x875e('0x58')]+_0x875e('0x67')+_0x14a92f,'json':!![]};return rp(_0x5d7449)[_0x875e('0x1c')](function(_0x24cb31){var _0x19e3c5=Object[_0x875e('0x62')](_0x24cb31);if(_0x24cb31[_0x19e3c5[0x0]][_0x875e('0x19')]&&parseInt(_0x24cb31[_0x19e3c5[0x0]][_0x875e('0x19')])===0x0){var _0x29b017={'messageId':_0x24cb31[_0x19e3c5[0x0]][_0x875e('0x68')]};if(!_0x2fea60['deliveryReport']){_0x29b017[_0x875e('0x42')]=!![];}return _0x3e22f4['update'](_0x29b017);}else{return logger[_0x875e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x875e('0x2b'),_0x875e('0x5e'),util[_0x875e('0x2c')](_0x24cb31['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x10265a){return logger[_0x875e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x875e('0x2b'),_0x875e('0x5e'),util[_0x875e('0x2c')](_0x10265a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x875e('0x2a'),'afterCreate','csc','Missing\x20parameters:\x20apiKey');}break;case _0x875e('0x69'):if(_0x2fea60[_0x875e('0x5f')]){var _0x324b44={'method':'POST','uri':_0x875e('0x6a'),'headers':{'Authorization':_0x2fea60['apiKey']},'body':{'content':_0x5a39ba[_0x875e('0x23')],'to':[_0x5a39ba['phone']],'from':_0x2fea60[_0x875e('0x24')],'binary':![],'clientMessageId':_0x875e('0x6b'),'charset':_0x875e('0x6c')},'json':!![]};rp(_0x324b44)[_0x875e('0x1c')](function(_0x58b474){if(!_0x58b474[_0x875e('0x19')]){var _0x2d397d={'messageId':_0x58b474[_0x875e('0x21')][0x0][_0x875e('0x6d')]};if(!_0x2fea60[_0x875e('0x3c')]){_0x2d397d[_0x875e('0x42')]=!![];}return _0x3e22f4[_0x875e('0x17')](_0x2d397d);}else{return logger['error'](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x69'),util[_0x875e('0x2c')](_0x58b474[_0x875e('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x53b7e2){return logger[_0x875e('0x19')](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x69'),util[_0x875e('0x2c')](_0x53b7e2,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x69'),'Missing\x20parameters:\x20apiKey');}break;case _0x875e('0x6e'):if(_0x2fea60[_0x875e('0x30')]&&_0x2fea60[_0x875e('0x31')]){var _0x1abce3=util[_0x875e('0x47')](_0x875e('0x6f'),_0x2fea60[_0x875e('0x30')],_0x2fea60[_0x875e('0x31')]);var _0x46008c={'method':_0x875e('0x3f'),'uri':_0x875e('0x70')+_0x2fea60[_0x875e('0x71')]+'/messages','body':{'to':[_0x5a39ba[_0x875e('0x24')]],'text':_0x5a39ba[_0x875e('0x23')],'from':_0x2fea60[_0x875e('0x24')],'applicationId':_0x2fea60['applicationId']},'headers':{'Authorization':util[_0x875e('0x47')](_0x875e('0x49'),new Buffer(_0x1abce3)[_0x875e('0x4a')](_0x875e('0x54')))},'json':!![]};rp(_0x46008c)['then'](function(_0x53a8bf){if(_0x53a8bf['id']){var _0x3bf0e0={'messageId':_0x53a8bf['id']};return _0x3e22f4[_0x875e('0x17')](_0x3bf0e0);}else{logger['error'](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x6e'),util['inspect'](_0x53a8bf,{'showHidden':![],'depth':null}));}})['catch'](function(_0x320156){logger[_0x875e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x875e('0x6e'),util[_0x875e('0x2c')](_0x320156,{'showHidden':![],'depth':null}));});}else{logger[_0x875e('0x19')](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x6e'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x2fea60[_0x875e('0x5f')]){var _0x1bf3be={};var _0x5d7449={'method':_0x875e('0x3f'),'uri':_0x875e('0x72'),'headers':{'Authorization':_0x875e('0x73')+_0x2fea60[_0x875e('0x5f')],'Content-Type':_0x875e('0x5b')},'body':{'from':_0x2fea60['phone'],'to':_0x5a39ba['phone'],'text':_0x5a39ba['body']},'json':!![]};return rp(_0x5d7449)[_0x875e('0x1c')](function(_0x4a9a2d){if(_0x4a9a2d[_0x875e('0x74')]==0xca){_0x1bf3be[_0x875e('0x75')]=_0x4a9a2d;var _0x404155={'method':'POST','uri':_0x875e('0x76'),'headers':{'Authorization':'Bearer\x20'+_0x2fea60[_0x875e('0x5f')],'Content-Type':'application/json'},'body':{'refid':_0x1bf3be[_0x875e('0x75')][_0x875e('0x77')]},'json':!![]};return rp(_0x404155)[_0x875e('0x1c')](function(_0x4abf26){_0x1bf3be[_0x875e('0x78')]=_0x4abf26;var _0x2bda1f={'messageId':_0x1bf3be['message']['refid'],'read':!![]};return _0x3e22f4[_0x875e('0x17')](_0x2bda1f);});}else{return logger[_0x875e('0x19')](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x79'),util[_0x875e('0x2c')](_0x4a9a2d,{'showHidden':![],'depth':null}));}})[_0x875e('0x18')](function(_0x3b0b6e){return logger[_0x875e('0x19')](_0x875e('0x2a'),_0x875e('0x2b'),_0x875e('0x79'),util['inspect'](_0x3b0b6e,{'showHidden':![],'depth':null}));});}else{return logger[_0x875e('0x19')](_0x875e('0x2a'),_0x875e('0x2b'),'intelepeer','Token\x20not\x20received');}break;}}})[_0x875e('0x7a')](function(){_0x2c5500();});}else{_0x2c5500();}}},'charset':_0x875e('0x7b'),'collate':_0x875e('0x7c')});}; \ No newline at end of file +var _0x8ef9=['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','&password=','sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','POST','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','username','xCALLY\x20Motion','senderString','format','%s:%s','Basic\x20%s','toString','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','sort','length','apiKey','createHash','md5','hex','signature=','GET','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','bandwidth','accountId','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','createdAt','catch','error','SmsAccount','find','type','twilio','accountSid','authToken','phone','messages','body','remote','/api/sms/messages/','/status?token=','token','sid'];(function(_0xc84cea,_0x7058f1){var _0x572c6c=function(_0x512a34){while(--_0x512a34){_0xc84cea['push'](_0xc84cea['shift']());}};_0x572c6c(++_0x7058f1);}(_0x8ef9,0x1ca));var _0x98ef=function(_0x653439,_0x2d2e3c){_0x653439=_0x653439-0x0;var _0x4a5ecc=_0x8ef9[_0x653439];return _0x4a5ecc;};'use strict';var _=require(_0x98ef('0x0'));var util=require(_0x98ef('0x1'));var logger=require('../../config/logger')(_0x98ef('0x2'));var moment=require('moment');var BPromise=require(_0x98ef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98ef('0x4'));var rimraf=require(_0x98ef('0x5'));var config=require(_0x98ef('0x6'));var attributes=require(_0x98ef('0x7'));module[_0x98ef('0x8')]=function(_0x58aa6b,_0x479d99){return _0x58aa6b['define'](_0x98ef('0x9'),attributes,{'tableName':_0x98ef('0xa'),'paranoid':![],'indexes':[{'name':_0x98ef('0xb'),'fields':[_0x98ef('0xb')]},{'name':_0x98ef('0xc'),'fields':['body'],'type':_0x98ef('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x485153,_0x1a0dc8,_0x42acdd){var _0xcb5cf2=_0x58aa6b['models'];var _0x85bc2b=_0x485153[_0x98ef('0xe')]({'plain':!![]});if(_0x85bc2b[_0x98ef('0xf')][_0x98ef('0x10')]()==='in'||_0x85bc2b[_0x98ef('0xf')][_0x98ef('0x10')]()===_0x98ef('0x11')&&!_0x85bc2b[_0x98ef('0x12')]&&!_[_0x98ef('0x13')](_0x85bc2b[_0x98ef('0x14')])&&!_[_0x98ef('0x13')](_0x85bc2b['SmsInteractionId'])){_0xcb5cf2[_0x98ef('0x15')][_0x98ef('0x16')]({'where':{'id':_0x85bc2b[_0x98ef('0x17')]}})[_0x98ef('0x18')](function(_0x2fcacc){if(_0x2fcacc){_0x2fcacc['update']({'lastMsgAt':_0x85bc2b[_0x98ef('0x19')],'lastMsgDirection':_0x85bc2b['direction'][_0x98ef('0x10')]()});}})[_0x98ef('0x1a')](function(_0x615917){console[_0x98ef('0x1b')](_0x615917);});}if(_0x85bc2b['direction']===_0x98ef('0x11')&&!_0x85bc2b[_0x98ef('0x12')]){var _0x14946;_0xcb5cf2[_0x98ef('0x1c')][_0x98ef('0x1d')]({'where':{'id':_0x85bc2b['SmsAccountId']},'raw':!![]})[_0x98ef('0x18')](function(_0x3aaea5){_0x14946=_0x3aaea5;if(_0x14946&&_0x14946[_0x98ef('0x1e')]){switch(_0x14946[_0x98ef('0x1e')]){case'twilio':var _0xadd2f4=require(_0x98ef('0x1f'));if(_0x14946[_0x98ef('0x20')]&&_0x14946[_0x98ef('0x21')]&&_0x14946[_0x98ef('0x22')]){var _0x55dca9=new _0xadd2f4(_0x14946[_0x98ef('0x20')],_0x14946['authToken']);_0x55dca9[_0x98ef('0x23')]['create']({'body':_0x85bc2b[_0x98ef('0x24')],'to':_0x85bc2b[_0x98ef('0x22')],'from':_0x14946[_0x98ef('0x22')],'statusCallback':_0x14946[_0x98ef('0x25')]+_0x98ef('0x26')+_0x85bc2b['id']+_0x98ef('0x27')+_0x14946[_0x98ef('0x28')]})[_0x98ef('0x18')](function(_0x5e9b92){if(_0x5e9b92[_0x98ef('0x29')]){return _0x485153[_0x98ef('0x2a')]({'messageId':_0x5e9b92[_0x98ef('0x29')]});}})[_0x98ef('0x1a')](function(_0x70c58c){logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x1f'),util[_0x98ef('0x2d')](_0x70c58c,{'showHidden':![],'depth':null}));});}else{logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x1f'),_0x98ef('0x2e'));}break;case _0x98ef('0x2f'):var _0x41c644=_0x98ef('0x30');if(_0x14946['username']&&_0x14946[_0x98ef('0x31')]){var _0x562e31={'recipient':[_0x85bc2b[_0x98ef('0x22')]],'message':_0x85bc2b[_0x98ef('0x24')],'message_type':_0x14946[_0x98ef('0x32')]};if(_0x14946['smsMethod']&&_0x14946[_0x98ef('0x32')]!=='SI'){_0x562e31['sender']=_0x14946[_0x98ef('0x22')];}var _0xbaf01e={'url':_0x41c644+'login?username='+_0x14946['username']+_0x98ef('0x33')+_0x14946[_0x98ef('0x31')],'method':'GET'};rp(_0xbaf01e)['then'](function(_0x396f13){var _0x5bdbbb=_0x396f13['split'](';');var _0x19e862={'user_key':_0x5bdbbb[0x0],'session_key':_0x5bdbbb[0x1]};_0xbaf01e={'url':_0x41c644+_0x98ef('0x34'),'method':'POST','headers':{'user_key':_0x19e862[_0x98ef('0x35')],'Session_key':_0x19e862[_0x98ef('0x36')]},'json':!![],'body':_0x562e31};return rp(_0xbaf01e);})[_0x98ef('0x18')](function(_0x177c6a){if(_0x177c6a[_0x98ef('0x37')]>=0x1){var _0x3c72e5={'messageId':_0x177c6a[_0x98ef('0x38')]};if(_0x14946[_0x98ef('0x32')]!=='GP'||!_0x14946[_0x98ef('0x39')]){_0x3c72e5[_0x98ef('0x3a')]=!![];}return _0x485153[_0x98ef('0x2a')](_0x3c72e5);}else{return logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x2f'),util[_0x98ef('0x2d')](_0x177c6a,{'showHidden':![],'depth':null}));}})[_0x98ef('0x1a')](function(_0xcebf3d){return logger[_0x98ef('0x1b')](_0x98ef('0x2b'),'afterCreate',_0x98ef('0x2f'),util[_0x98ef('0x2d')](_0xcebf3d,{'showHidden':![],'depth':null}));});}else{logger[_0x98ef('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x98ef('0x2f'),_0x98ef('0x3b'));}break;case _0x98ef('0x3c'):if(_0x14946[_0x98ef('0x21')]){var _0x55c276={'recipient':_0x85bc2b[_0x98ef('0x22')],'message':_0x85bc2b['body'],'sender':_0x14946['senderString']||_0x14946['phone'],'authorization':_0x14946[_0x98ef('0x21')]};var _0x1a0dc8={'method':_0x98ef('0x3d'),'uri':_0x98ef('0x3e'),'body':_0x55c276,'json':!![]};rp(_0x1a0dc8)[_0x98ef('0x18')](function(_0x112461){var _0x4f99ff={'messageId':_0x112461[_0x98ef('0x3f')]};if(!_0x14946[_0x98ef('0x39')]){_0x4f99ff[_0x98ef('0x3a')]=!![];}return _0x485153[_0x98ef('0x2a')](_0x4f99ff);})[_0x98ef('0x1a')](function(_0x3d309b){logger['error'](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x3c'),util[_0x98ef('0x2d')](_0x3d309b,{'showHidden':![],'depth':null}));});}else{logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x3c'),_0x98ef('0x40'));}break;case'clicksend':if(_0x14946[_0x98ef('0x41')]&&_0x14946['password']){var _0x55c276={'messages':[{'source':_0x98ef('0x42'),'to':_0x85bc2b[_0x98ef('0x22')],'body':_0x85bc2b[_0x98ef('0x24')],'from':_0x14946[_0x98ef('0x43')]||_0x14946[_0x98ef('0x22')]}]};var _0x3d858a=util[_0x98ef('0x44')](_0x98ef('0x45'),_0x14946[_0x98ef('0x41')],_0x14946['password']);var _0x1a0dc8={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x55c276,'headers':{'Authorization':util[_0x98ef('0x44')](_0x98ef('0x46'),new Buffer(_0x3d858a)[_0x98ef('0x47')]('base64'))},'json':!![]};rp(_0x1a0dc8)[_0x98ef('0x18')](function(_0x5e0cbe){if(_0x5e0cbe['http_code']>=0xc8&&_0x5e0cbe[_0x98ef('0x48')]<=0xce){if(_0x5e0cbe[_0x98ef('0x49')]&&_0x5e0cbe[_0x98ef('0x49')][_0x98ef('0x4a')]>0x0){var _0x2ab645=_[_0x98ef('0x4b')](_0x5e0cbe[_0x98ef('0x49')][_0x98ef('0x23')]);var _0x367ce7={'messageId':_0x2ab645[_0x98ef('0x4c')]};if(!_0x14946['deliveryReport']){_0x367ce7[_0x98ef('0x3a')]=!![];}return _0x485153['update'](_0x367ce7);}else{logger[_0x98ef('0x1b')](_0x98ef('0x2b'),'afterCreate','clickSend',util[_0x98ef('0x2d')](_0x5e0cbe,{'showHidden':![],'depth':null}));}}else{logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x4d'),util[_0x98ef('0x2d')](_0x5e0cbe,{'showHidden':![],'depth':null}));}})[_0x98ef('0x1a')](function(_0x15b460){logger[_0x98ef('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x98ef('0x2c'),_0x98ef('0x4d'),util[_0x98ef('0x2d')](_0x15b460,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x4d'),_0x98ef('0x3b'));}break;case _0x98ef('0x4e'):if(_0x14946[_0x98ef('0x4f')]&&_0x14946[_0x98ef('0x21')]){var _0x55c276={'dst':_0x85bc2b[_0x98ef('0x22')],'text':_0x85bc2b[_0x98ef('0x24')],'src':_0x14946['senderString']||_0x14946[_0x98ef('0x22')],'url':_0x14946[_0x98ef('0x25')]+_0x98ef('0x26')+_0x85bc2b['id']+_0x98ef('0x27')+_0x14946[_0x98ef('0x28')]};var _0x3d858a=util[_0x98ef('0x44')](_0x98ef('0x45'),_0x14946[_0x98ef('0x4f')],_0x14946[_0x98ef('0x21')]);var _0x1a0dc8={'method':_0x98ef('0x3d'),'uri':util[_0x98ef('0x44')](_0x98ef('0x50'),_0x14946[_0x98ef('0x4f')]),'body':_0x55c276,'headers':{'Authorization':util[_0x98ef('0x44')]('Basic\x20%s',new Buffer(_0x3d858a)[_0x98ef('0x47')](_0x98ef('0x51')))},'json':!![]};rp(_0x1a0dc8)[_0x98ef('0x18')](function(_0x1e051b){var _0x6edaca={'messageId':_0x1e051b[_0x98ef('0x52')][0x0]};return _0x485153['update'](_0x6edaca);})[_0x98ef('0x1a')](function(_0x2deb19){logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x4e'),util['inspect'](_0x2deb19,{'showHidden':![],'depth':null}));});}else{logger[_0x98ef('0x1b')](_0x98ef('0x2b'),'afterCreate',_0x98ef('0x4e'),_0x98ef('0x53'));}break;case _0x98ef('0x54'):if(_0x14946[_0x98ef('0x41')]&&_0x14946[_0x98ef('0x31')]){if(_0x14946[_0x98ef('0x55')]){var _0x5b82d7={'method':'POST','uri':_0x14946[_0x98ef('0x55')]+_0x98ef('0x56'),'body':{'username':_0x14946['username'],'password':_0x14946[_0x98ef('0x31')]},'json':!![]};return rp(_0x5b82d7)['then'](function(_0x1441ff){var _0x3eca1c={'method':'POST','uri':_0x14946[_0x98ef('0x55')]+_0x98ef('0x57'),'body':{'messages':[{'from':_0x14946[_0x98ef('0x22')],'destinations':[{'to':_0x85bc2b['phone']}],'text':_0x85bc2b[_0x98ef('0x24')],'notifyUrl':_0x14946[_0x98ef('0x25')]+_0x98ef('0x26')+_0x85bc2b['id']+_0x98ef('0x27')+_0x14946['token'],'notifyContentType':_0x98ef('0x58'),'callbackData':_0x14946[_0x98ef('0x22')]+';'+_0x85bc2b[_0x98ef('0x24')]}]},'headers':{'Authorization':_0x98ef('0x59')+_0x1441ff[_0x98ef('0x28')]},'json':!![]};return rp(_0x3eca1c)['then'](function(_0x36b7d2){if(_0x36b7d2['messages']){var _0xaf8849={'messageId':_0x36b7d2[_0x98ef('0x23')][0x0][_0x98ef('0xb')]};if(!_0x14946['deliveryReport']){_0xaf8849['read']=!![];}return _0x485153[_0x98ef('0x2a')](_0xaf8849);}else{return logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x54'),util[_0x98ef('0x2d')](_0x36b7d2,{'showHidden':![],'depth':null}));}});})['catch'](function(_0xc1ad2f){return logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),'infobip',util[_0x98ef('0x2d')](_0xc1ad2f,{'showHidden':![],'depth':null}));});}else{logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x54'),_0x98ef('0x5a'));}}else{logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x54'),_0x98ef('0x3b'));}break;case _0x98ef('0x5b'):var _0x177bfc=require(_0x98ef('0x5c'));if(_0x14946['apiKey']){var _0xbb67b6={};_0xbb67b6[_0x98ef('0x5d')]=_0x14946['username'];_0xbb67b6[_0x98ef('0x22')]=_0x85bc2b[_0x98ef('0x22')];_0xbb67b6['sender']=_0x14946[_0x98ef('0x22')];_0xbb67b6[_0x98ef('0x5e')]=_0x85bc2b[_0x98ef('0x24')];_0xbb67b6[_0x98ef('0x5f')]=+new Date();var _0xcac5df='';var _0x456dac='';var _0x3b4236=Object['keys'](_0xbb67b6);_0x3b4236[_0x98ef('0x60')]();for(var _0x491c83=0x0;_0x491c83<_0x3b4236[_0x98ef('0x61')];_0x491c83++){if(_0xcac5df!=''){_0xcac5df+='&';}_0xcac5df+=_0x3b4236[_0x491c83]+'='+encodeURIComponent(_0xbb67b6[_0x3b4236[_0x491c83]]);_0x456dac+=_0xbb67b6[_0x3b4236[_0x491c83]];}_0x456dac+=_0x14946[_0x98ef('0x62')];_0x456dac=_0x177bfc[_0x98ef('0x63')](_0x98ef('0x64'))[_0x98ef('0x2a')](_0x456dac)['digest'](_0x98ef('0x65'));if(_0xcac5df!==''){_0xcac5df+='&';}_0xcac5df+=_0x98ef('0x66')+_0x456dac;var _0xbaf01e={'method':_0x98ef('0x67'),'uri':_0x14946['baseUrl']+'/external/get/send.php?'+_0xcac5df,'json':!![]};return rp(_0xbaf01e)[_0x98ef('0x18')](function(_0x4435ee){var _0x414638=Object[_0x98ef('0x68')](_0x4435ee);if(_0x4435ee[_0x414638[0x0]][_0x98ef('0x1b')]&&parseInt(_0x4435ee[_0x414638[0x0]][_0x98ef('0x1b')])===0x0){var _0x5a728f={'messageId':_0x4435ee[_0x414638[0x0]][_0x98ef('0x69')]};if(!_0x14946[_0x98ef('0x39')]){_0x5a728f[_0x98ef('0x3a')]=!![];}return _0x485153[_0x98ef('0x2a')](_0x5a728f);}else{return logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x5b'),util[_0x98ef('0x2d')](_0x4435ee[_0x98ef('0x1b')],{'showHidden':![],'depth':null}));}})[_0x98ef('0x1a')](function(_0x27e84b){return logger['error'](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x5b'),util[_0x98ef('0x2d')](_0x27e84b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x98ef('0x2b'),'afterCreate',_0x98ef('0x5b'),_0x98ef('0x6a'));}break;case _0x98ef('0x6b'):if(_0x14946['apiKey']){var _0x549927={'method':_0x98ef('0x3d'),'uri':_0x98ef('0x6c'),'headers':{'Authorization':_0x14946[_0x98ef('0x62')]},'body':{'content':_0x85bc2b[_0x98ef('0x24')],'to':[_0x85bc2b[_0x98ef('0x22')]],'from':_0x14946[_0x98ef('0x22')],'binary':![],'clientMessageId':_0x98ef('0x6d'),'charset':'UTF-8'},'json':!![]};rp(_0x549927)[_0x98ef('0x18')](function(_0x464618){if(!_0x464618[_0x98ef('0x1b')]){var _0x137972={'messageId':_0x464618[_0x98ef('0x23')][0x0]['apiMessageId']};if(!_0x14946['deliveryReport']){_0x137972[_0x98ef('0x3a')]=!![];}return _0x485153[_0x98ef('0x2a')](_0x137972);}else{return logger['error'](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x6b'),util[_0x98ef('0x2d')](_0x464618[_0x98ef('0x1b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3bc2aa){return logger[_0x98ef('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x98ef('0x6b'),util[_0x98ef('0x2d')](_0x3bc2aa,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x98ef('0x2b'),_0x98ef('0x2c'),'clickatell',_0x98ef('0x6a'));}break;case _0x98ef('0x6e'):if(_0x14946[_0x98ef('0x41')]&&_0x14946['password']){var _0x3d858a=util[_0x98ef('0x44')]('%s:%s',_0x14946['username'],_0x14946[_0x98ef('0x31')]);var _0x1a0dc8={'method':_0x98ef('0x3d'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x14946[_0x98ef('0x6f')]+'/messages','body':{'to':[_0x85bc2b[_0x98ef('0x22')]],'text':_0x85bc2b[_0x98ef('0x24')],'from':_0x14946[_0x98ef('0x22')],'applicationId':_0x14946[_0x98ef('0x70')]},'headers':{'Authorization':util[_0x98ef('0x44')](_0x98ef('0x46'),new Buffer(_0x3d858a)[_0x98ef('0x47')](_0x98ef('0x51')))},'json':!![]};rp(_0x1a0dc8)[_0x98ef('0x18')](function(_0x59bd28){if(_0x59bd28['id']){var _0x1f14b6={'messageId':_0x59bd28['id']};return _0x485153[_0x98ef('0x2a')](_0x1f14b6);}else{logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x6e'),util[_0x98ef('0x2d')](_0x59bd28,{'showHidden':![],'depth':null}));}})[_0x98ef('0x1a')](function(_0x32d073){logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x6e'),util[_0x98ef('0x2d')](_0x32d073,{'showHidden':![],'depth':null}));});}else{logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x6e'),_0x98ef('0x3b'));}break;case'intelepeer':if(_0x14946['apiKey']){var _0x4033af={};var _0xbaf01e={'method':'POST','uri':_0x98ef('0x71'),'headers':{'Authorization':_0x98ef('0x72')+_0x14946['apiKey'],'Content-Type':_0x98ef('0x58')},'body':{'from':_0x14946[_0x98ef('0x22')],'to':_0x85bc2b['phone'],'text':_0x85bc2b[_0x98ef('0x24')]},'json':!![]};return rp(_0xbaf01e)[_0x98ef('0x18')](function(_0x361856){if(_0x361856[_0x98ef('0x73')]==0xca){_0x4033af[_0x98ef('0x74')]=_0x361856;var _0x413da9={'method':_0x98ef('0x3d'),'uri':_0x98ef('0x75'),'headers':{'Authorization':_0x98ef('0x72')+_0x14946[_0x98ef('0x62')],'Content-Type':_0x98ef('0x58')},'body':{'refid':_0x4033af['message']['refid']},'json':!![]};return rp(_0x413da9)[_0x98ef('0x18')](function(_0x34d0d4){_0x4033af[_0x98ef('0x76')]=_0x34d0d4;var _0x31bcc2={'messageId':_0x4033af[_0x98ef('0x74')][_0x98ef('0x77')],'read':!![]};return _0x485153[_0x98ef('0x2a')](_0x31bcc2);});}else{return logger[_0x98ef('0x1b')](_0x98ef('0x2b'),'afterCreate',_0x98ef('0x78'),util['inspect'](_0x361856,{'showHidden':![],'depth':null}));}})[_0x98ef('0x1a')](function(_0x5e3295){return logger[_0x98ef('0x1b')](_0x98ef('0x2b'),_0x98ef('0x2c'),_0x98ef('0x78'),util[_0x98ef('0x2d')](_0x5e3295,{'showHidden':![],'depth':null}));});}else{return logger[_0x98ef('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x98ef('0x2c'),_0x98ef('0x78'),_0x98ef('0x79'));}break;}}})[_0x98ef('0x7a')](function(){_0x42acdd();});}else{_0x42acdd();}}},'charset':_0x98ef('0x7b'),'collate':_0x98ef('0x7c')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 920e3d9..78e3b82 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 _0xef5f=['debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','options','raw'];(function(_0x3b918b,_0x2edc55){var _0x57d988=function(_0x1a4463){while(--_0x1a4463){_0x3b918b['push'](_0x3b918b['shift']());}};_0x57d988(++_0x2edc55);}(_0xef5f,0x6d));var _0xfef5=function(_0x32c467,_0x2ddaf4){_0x32c467=_0x32c467-0x0;var _0x65b387=_0xef5f[_0x32c467];return _0x65b387;};'use strict';var _=require(_0xfef5('0x0'));var util=require(_0xfef5('0x1'));var moment=require(_0xfef5('0x2'));var BPromise=require(_0xfef5('0x3'));var rs=require(_0xfef5('0x4'));var fs=require('fs');var Redis=require(_0xfef5('0x5'));var db=require(_0xfef5('0x6'))['db'];var utils=require(_0xfef5('0x7'));var logger=require(_0xfef5('0x8'))('rpc');var config=require(_0xfef5('0x9'));var jayson=require(_0xfef5('0xa'));var client=jayson[_0xfef5('0xb')][_0xfef5('0xc')]({'port':0x232a});config['redis']=_[_0xfef5('0xd')](config[_0xfef5('0xe')],{'host':_0xfef5('0xf'),'port':0x18eb});var socket=require(_0xfef5('0x10'))(new Redis(config['redis']));require('./smsMessage.socket')[_0xfef5('0x11')](socket);function respondWithRpcPromise(_0x26b603,_0x3d2cb3,_0x52835c){return new BPromise(function(_0x182c40,_0x319eee){return client[_0xfef5('0x12')](_0x26b603,_0x52835c)[_0xfef5('0x13')](function(_0x7fde63){logger[_0xfef5('0x14')](_0xfef5('0x15'),_0x3d2cb3,_0xfef5('0x16'));logger['debug'](_0xfef5('0x17'),_0x3d2cb3,_0xfef5('0x16'),JSON[_0xfef5('0x18')](_0x7fde63));if(_0x7fde63[_0xfef5('0x19')]){if(_0x7fde63['error'][_0xfef5('0x1a')]===0x1f4){logger[_0xfef5('0x19')](_0xfef5('0x15'),_0x3d2cb3,_0x7fde63[_0xfef5('0x19')]['message']);return _0x319eee(_0x7fde63[_0xfef5('0x19')]['message']);}logger[_0xfef5('0x19')](_0xfef5('0x15'),_0x3d2cb3,_0x7fde63[_0xfef5('0x19')][_0xfef5('0x1b')]);return _0x182c40(_0x7fde63['error']['message']);}else{logger[_0xfef5('0x14')](_0xfef5('0x15'),_0x3d2cb3,_0xfef5('0x16'));_0x182c40(_0x7fde63[_0xfef5('0x1c')]['message']);}})[_0xfef5('0x1d')](function(_0x38ece2){logger['error']('SmsMessage,\x20%s,\x20%s',_0x3d2cb3,_0x38ece2);_0x319eee(_0x38ece2);});});}exports[_0xfef5('0x1e')]=function(_0x3af11a){var _0x9b08d7=this;return new Promise(function(_0x5d852f,_0x2a5a76){return db[_0xfef5('0x1f')][_0xfef5('0x20')](_0x3af11a['body'],{'raw':_0x3af11a['options']?_0x3af11a[_0xfef5('0x21')][_0xfef5('0x22')]===undefined?!![]:![]:!![]})[_0xfef5('0x13')](function(_0x11e0c5){logger[_0xfef5('0x14')](_0xfef5('0x1e'),_0x3af11a);logger[_0xfef5('0x23')](_0xfef5('0x1e'),_0x3af11a,JSON['stringify'](_0x11e0c5));_0x5d852f(_0x11e0c5);})[_0xfef5('0x1d')](function(_0x37f56c){logger[_0xfef5('0x19')]('CreateSmsMessage',_0x37f56c[_0xfef5('0x1b')],_0x3af11a);_0x2a5a76(_0x9b08d7[_0xfef5('0x19')](0x1f4,_0x37f56c[_0xfef5('0x1b')]));});});}; \ No newline at end of file +var _0x37fd=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','./smsMessage.socket','request','info','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','then','stringify','lodash','moment','randomstring'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0x37fd,0x176));var _0xd37f=function(_0x5326df,_0x4babd6){_0x5326df=_0x5326df-0x0;var _0x6a86fd=_0x37fd[_0x5326df];return _0x6a86fd;};'use strict';var _=require(_0xd37f('0x0'));var util=require('util');var moment=require(_0xd37f('0x1'));var BPromise=require('bluebird');var rs=require(_0xd37f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd37f('0x3'))['db'];var utils=require(_0xd37f('0x4'));var logger=require(_0xd37f('0x5'))('rpc');var config=require(_0xd37f('0x6'));var jayson=require(_0xd37f('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xd37f('0x8')]=_[_0xd37f('0x9')](config[_0xd37f('0x8')],{'host':_0xd37f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd37f('0x8')]));require(_0xd37f('0xb'))['register'](socket);function respondWithRpcPromise(_0xabb00c,_0x337d8c,_0x3de32a){return new BPromise(function(_0x2673a1,_0x503add){return client[_0xd37f('0xc')](_0xabb00c,_0x3de32a)['then'](function(_0x181787){logger[_0xd37f('0xd')](_0xd37f('0xe'),_0x337d8c,'request\x20sent');logger[_0xd37f('0xf')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x337d8c,_0xd37f('0x10'),JSON['stringify'](_0x181787));if(_0x181787[_0xd37f('0x11')]){if(_0x181787[_0xd37f('0x11')][_0xd37f('0x12')]===0x1f4){logger['error'](_0xd37f('0xe'),_0x337d8c,_0x181787['error']['message']);return _0x503add(_0x181787[_0xd37f('0x11')][_0xd37f('0x13')]);}logger[_0xd37f('0x11')]('SmsMessage,\x20%s,\x20%s',_0x337d8c,_0x181787[_0xd37f('0x11')][_0xd37f('0x13')]);return _0x2673a1(_0x181787[_0xd37f('0x11')][_0xd37f('0x13')]);}else{logger['info'](_0xd37f('0xe'),_0x337d8c,_0xd37f('0x10'));_0x2673a1(_0x181787[_0xd37f('0x14')]['message']);}})[_0xd37f('0x15')](function(_0x3e1dc3){logger[_0xd37f('0x11')](_0xd37f('0xe'),_0x337d8c,_0x3e1dc3);_0x503add(_0x3e1dc3);});});}exports[_0xd37f('0x16')]=function(_0x5ae34){var _0x2eb1dd=this;return new Promise(function(_0x36b137,_0x391106){return db[_0xd37f('0x17')][_0xd37f('0x18')](_0x5ae34[_0xd37f('0x19')],{'raw':_0x5ae34['options']?_0x5ae34[_0xd37f('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xd37f('0x1b')](function(_0x2b66e6){logger[_0xd37f('0xd')]('CreateSmsMessage',_0x5ae34);logger[_0xd37f('0xf')](_0xd37f('0x16'),_0x5ae34,JSON[_0xd37f('0x1c')](_0x2b66e6));_0x36b137(_0x2b66e6);})['catch'](function(_0x39ff73){logger[_0xd37f('0x11')](_0xd37f('0x16'),_0x39ff73[_0xd37f('0x13')],_0x5ae34);_0x391106(_0x2eb1dd[_0xd37f('0x11')](0x1f4,_0x39ff73['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 930183a..c2b113e 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 _0xed66=['save','remove','update','emit','register','length','smsMessage:'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xed66,0x77));var _0x6ed6=function(_0x4ec9e3,_0x15fbf4){_0x4ec9e3=_0x4ec9e3-0x0;var _0x2883ce=_0xed66[_0x4ec9e3];return _0x2883ce;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x6ed6('0x0'),_0x6ed6('0x1'),_0x6ed6('0x2')];function createListener(_0x15f4da,_0x130291){return function(_0x4eba2d){_0x130291[_0x6ed6('0x3')](_0x15f4da,_0x4eba2d);};}function removeListener(_0x50598d,_0x51e4fa){return function(){SmsMessageEvents['removeListener'](_0x50598d,_0x51e4fa);};}exports[_0x6ed6('0x4')]=function(_0x22f5c0){for(var _0x4535e1=0x0,_0x5a1f05=events[_0x6ed6('0x5')];_0x4535e1<_0x5a1f05;_0x4535e1++){var _0x28521e=events[_0x4535e1];var _0x9cd73d=createListener(_0x6ed6('0x6')+_0x28521e,_0x22f5c0);SmsMessageEvents['on'](_0x28521e,_0x9cd73d);}}; \ No newline at end of file +var _0xb102=['register','length','./smsMessage.events','save','update','emit'];(function(_0x990ab3,_0x4209e9){var _0x22eb51=function(_0x4191eb){while(--_0x4191eb){_0x990ab3['push'](_0x990ab3['shift']());}};_0x22eb51(++_0x4209e9);}(_0xb102,0x74));var _0x2b10=function(_0x83e4d9,_0x3b9bb6){_0x83e4d9=_0x83e4d9-0x0;var _0x36a145=_0xb102[_0x83e4d9];return _0x36a145;};'use strict';var SmsMessageEvents=require(_0x2b10('0x0'));var events=[_0x2b10('0x1'),'remove',_0x2b10('0x2')];function createListener(_0x4346ba,_0x1bcdb3){return function(_0x4ed36f){_0x1bcdb3[_0x2b10('0x3')](_0x4346ba,_0x4ed36f);};}function removeListener(_0x4fe24f,_0x29fae8){return function(){SmsMessageEvents['removeListener'](_0x4fe24f,_0x29fae8);};}exports[_0x2b10('0x4')]=function(_0x2be8e6){for(var _0x535fa8=0x0,_0x162ec7=events[_0x2b10('0x5')];_0x535fa8<_0x162ec7;_0x535fa8++){var _0x5dd8b3=events[_0x535fa8];var _0x46cb4b=createListener('smsMessage:'+_0x5dd8b3,_0x2be8e6);SmsMessageEvents['on'](_0x5dd8b3,_0x46cb4b);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index b638931..47d8ab4 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 _0x8a74=['../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','delete','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x54b395,_0x1333c4){var _0x103c21=function(_0x285a4e){while(--_0x285a4e){_0x54b395['push'](_0x54b395['shift']());}};_0x103c21(++_0x1333c4);}(_0x8a74,0x1a9));var _0x48a7=function(_0x16a423,_0x4a69e3){_0x16a423=_0x16a423-0x0;var _0xc6ece2=_0x8a74[_0x16a423];return _0xc6ece2;};'use strict';var multer=require(_0x48a7('0x0'));var util=require(_0x48a7('0x1'));var path=require(_0x48a7('0x2'));var timeout=require('connect-timeout');var express=require(_0x48a7('0x3'));var router=express[_0x48a7('0x4')]();var fs_extra=require(_0x48a7('0x5'));var auth=require(_0x48a7('0x6'));var interaction=require(_0x48a7('0x7'));var config=require(_0x48a7('0x8'));var controller=require(_0x48a7('0x9'));router[_0x48a7('0xa')]('/',auth[_0x48a7('0xb')](),controller[_0x48a7('0xc')]);router[_0x48a7('0xa')](_0x48a7('0xd'),auth[_0x48a7('0xb')](),controller[_0x48a7('0xe')]);router[_0x48a7('0xa')](_0x48a7('0xf'),auth[_0x48a7('0xb')](),controller['show']);router['get'](_0x48a7('0x10'),auth[_0x48a7('0xb')](),controller['getMembers']);router[_0x48a7('0xa')](_0x48a7('0x11'),auth[_0x48a7('0xb')](),controller[_0x48a7('0x12')]);router[_0x48a7('0xa')](_0x48a7('0x13'),auth[_0x48a7('0xb')](),controller[_0x48a7('0x14')]);router[_0x48a7('0x15')]('/',auth[_0x48a7('0xb')](),controller[_0x48a7('0x16')]);router[_0x48a7('0x15')](_0x48a7('0x11'),auth[_0x48a7('0xb')](),controller['addTeams']);router[_0x48a7('0x15')](_0x48a7('0x13'),auth[_0x48a7('0xb')](),controller[_0x48a7('0x17')]);router['put'](_0x48a7('0xf'),auth[_0x48a7('0xb')](),controller['update']);router[_0x48a7('0x18')]('/:id',auth[_0x48a7('0xb')](),controller['destroy']);router[_0x48a7('0x18')](_0x48a7('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x48a7('0x18')](_0x48a7('0x13'),auth[_0x48a7('0xb')](),controller[_0x48a7('0x19')]);module[_0x48a7('0x1a')]=router; \ No newline at end of file +var _0x5ef3=['getTeams','/:id/users','isAuthenticated','getAgents','post','create','addTeams','addAgents','put','/:id','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index','/describe','describe','show','/:id/members','getMembers','/:id/teams'];(function(_0x4a4d41,_0x58b083){var _0x45fb8d=function(_0x1ae4d0){while(--_0x1ae4d0){_0x4a4d41['push'](_0x4a4d41['shift']());}};_0x45fb8d(++_0x58b083);}(_0x5ef3,0x94));var _0x35ef=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5ef3[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x35ef('0x0'));var util=require(_0x35ef('0x1'));var path=require('path');var timeout=require(_0x35ef('0x2'));var express=require(_0x35ef('0x3'));var router=express[_0x35ef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x35ef('0x5'));var interaction=require(_0x35ef('0x6'));var config=require(_0x35ef('0x7'));var controller=require(_0x35ef('0x8'));router[_0x35ef('0x9')]('/',auth['isAuthenticated'](),controller[_0x35ef('0xa')]);router[_0x35ef('0x9')](_0x35ef('0xb'),auth['isAuthenticated'](),controller[_0x35ef('0xc')]);router[_0x35ef('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x35ef('0xd')]);router[_0x35ef('0x9')](_0x35ef('0xe'),auth['isAuthenticated'](),controller[_0x35ef('0xf')]);router[_0x35ef('0x9')](_0x35ef('0x10'),auth['isAuthenticated'](),controller[_0x35ef('0x11')]);router['get'](_0x35ef('0x12'),auth[_0x35ef('0x13')](),controller[_0x35ef('0x14')]);router[_0x35ef('0x15')]('/',auth[_0x35ef('0x13')](),controller[_0x35ef('0x16')]);router[_0x35ef('0x15')](_0x35ef('0x10'),auth[_0x35ef('0x13')](),controller[_0x35ef('0x17')]);router[_0x35ef('0x15')](_0x35ef('0x12'),auth['isAuthenticated'](),controller[_0x35ef('0x18')]);router[_0x35ef('0x19')](_0x35ef('0x1a'),auth['isAuthenticated'](),controller[_0x35ef('0x1b')]);router['delete'](_0x35ef('0x1a'),auth[_0x35ef('0x13')](),controller[_0x35ef('0x1c')]);router[_0x35ef('0x1d')]('/:id/teams',auth[_0x35ef('0x13')](),controller[_0x35ef('0x1e')]);router['delete']('/:id/users',auth[_0x35ef('0x13')](),controller[_0x35ef('0x1f')]);module[_0x35ef('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index c12c139..ea0b5e4 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 _0x3664=['name','INTEGER','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x3b56ab,_0x21e638){var _0x189e3c=function(_0x26c623){while(--_0x26c623){_0x3b56ab['push'](_0x3b56ab['shift']());}};_0x189e3c(++_0x21e638);}(_0x3664,0x9e));var _0x4366=function(_0x38ca49,_0x321153){_0x38ca49=_0x38ca49-0x0;var _0x274c3e=_0x3664[_0x38ca49];return _0x274c3e;};'use strict';var Sequelize=require(_0x4366('0x0'));module[_0x4366('0x1')]={'name':{'type':Sequelize[_0x4366('0x2')],'unique':_0x4366('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4366('0x2')]},'timeout':{'type':Sequelize[_0x4366('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x4366('0x5'),_0x4366('0x6'))}}; \ No newline at end of file +var _0xf282=['INTEGER','ENUM','rrmemory','beepall','exports','STRING','name'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf282,0xe4));var _0x2f28=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xf282[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require('sequelize');module[_0x2f28('0x0')]={'name':{'type':Sequelize[_0x2f28('0x1')],'unique':_0x2f28('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2f28('0x1')]},'timeout':{'type':Sequelize[_0x2f28('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2f28('0x4')](_0x2f28('0x5'),_0x2f28('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 3283e1c..d0eb5f4 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 _0x11e3=['redis','./smsQueue.socket','register','sendStatus','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','get','SmsQueues','UserProfileResource','status','end','error','stack','name','send','index','map','SmsQueue','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','catch','show','params','keys','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','SmsQueueId','findAll','User','smsPause','format','%s/%s','createdAt','updatedAt','getTeams','ids','Team','online','voicePause','flatMap','Agents','addTeams','UserSmsQueue','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','includes','union','compact','value','isEmpty','removeAgents','omit','spread','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','socket.io-emitter'];(function(_0x2fb26c,_0x41607d){var _0x4c063d=function(_0x1967e7){while(--_0x1967e7){_0x2fb26c['push'](_0x2fb26c['shift']());}};_0x4c063d(++_0x41607d);}(_0x11e3,0x6f));var _0x311e=function(_0x2d1e16,_0x45a3b6){_0x2d1e16=_0x2d1e16-0x0;var _0x3b2ba7=_0x11e3[_0x2d1e16];return _0x3b2ba7;};'use strict';var emlformat=require(_0x311e('0x0'));var rimraf=require(_0x311e('0x1'));var zipdir=require(_0x311e('0x2'));var jsonpatch=require(_0x311e('0x3'));var rp=require('request-promise');var moment=require(_0x311e('0x4'));var BPromise=require(_0x311e('0x5'));var Mustache=require('mustache');var util=require(_0x311e('0x6'));var path=require(_0x311e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x311e('0x8'));var fs=require('fs');var fs_extra=require(_0x311e('0x9'));var _=require(_0x311e('0xa'));var squel=require(_0x311e('0xb'));var crypto=require(_0x311e('0xc'));var jsforce=require(_0x311e('0xd'));var deskjs=require(_0x311e('0xe'));var toCsv=require(_0x311e('0xf'));var querystring=require(_0x311e('0x10'));var Papa=require(_0x311e('0x11'));var Redis=require(_0x311e('0x12'));var authService=require(_0x311e('0x13'));var qs=require(_0x311e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x311e('0x15'));var logger=require('../../config/logger')(_0x311e('0x16'));var utils=require(_0x311e('0x17'));var config=require(_0x311e('0x18'));var licenseUtil=require(_0x311e('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x311e('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x311e('0x1b'))(new Redis(config[_0x311e('0x1c')]));require(_0x311e('0x1d'))[_0x311e('0x1e')](socket);function respondWithStatusCode(_0x191a06,_0x25919f){_0x25919f=_0x25919f||0xcc;return function(_0x5dc587){if(_0x5dc587){return _0x191a06[_0x311e('0x1f')](_0x25919f);}return _0x191a06['status'](_0x25919f)['end']();};}function respondWithResult(_0x16663c,_0x4e6108){_0x4e6108=_0x4e6108||0xc8;return function(_0xaa6bc0){if(_0xaa6bc0){return _0x16663c['status'](_0x4e6108)[_0x311e('0x20')](_0xaa6bc0);}};}function respondWithFilteredResult(_0x1505fe,_0x5a6779){return function(_0x406e67){if(_0x406e67){var _0x3ccc33=typeof _0x5a6779[_0x311e('0x21')]==='undefined'&&typeof _0x5a6779[_0x311e('0x22')]===_0x311e('0x23');var _0x11b27a=_0x406e67[_0x311e('0x24')];var _0x399fc2=_0x3ccc33?0x0:_0x5a6779['offset'];var _0x3a6ccd=_0x3ccc33?_0x406e67['count']:_0x5a6779[_0x311e('0x21')]+_0x5a6779[_0x311e('0x22')];var _0x23db9a;if(_0x3a6ccd>=_0x11b27a){_0x3a6ccd=_0x11b27a;_0x23db9a=0xc8;}else{_0x23db9a=0xce;}_0x1505fe['status'](_0x23db9a);return _0x1505fe[_0x311e('0x25')]('Content-Range',_0x399fc2+'-'+_0x3a6ccd+'/'+_0x11b27a)[_0x311e('0x20')](_0x406e67);}return null;};}function patchUpdates(_0x28d8e3){return function(_0x314c85){try{jsonpatch[_0x311e('0x26')](_0x314c85,_0x28d8e3,!![]);}catch(_0x22cb91){return BPromise[_0x311e('0x27')](_0x22cb91);}return _0x314c85['save']();};}function saveUpdates(_0x3e2ae7,_0x573bbb){return function(_0x3f14e7){if(_0x3f14e7){return _0x3f14e7[_0x311e('0x28')](_0x3e2ae7)[_0x311e('0x29')](function(_0x17d1d8){return _0x17d1d8;});}return null;};}function removeEntity(_0x521ea1,_0x45c3b6){return function(_0x4eec5e){if(_0x4eec5e){return _0x4eec5e[_0x311e('0x2a')]()['then'](function(){var _0x109a9c=_0x4eec5e[_0x311e('0x2b')]({'plain':!![]});var _0x5e9fe2=_0x311e('0x2c');return db[_0x311e('0x2d')][_0x311e('0x2a')]({'where':{'type':_0x5e9fe2,'resourceId':_0x109a9c['id']}})[_0x311e('0x29')](function(){return _0x4eec5e;});})[_0x311e('0x29')](function(){_0x521ea1[_0x311e('0x2e')](0xcc)[_0x311e('0x2f')]();});}};}function handleEntityNotFound(_0x1e6989,_0x547df8){return function(_0x3ae602){if(!_0x3ae602){_0x1e6989[_0x311e('0x1f')](0x194);}return _0x3ae602;};}function handleError(_0x36a7a7,_0x1af721){_0x1af721=_0x1af721||0x1f4;return function(_0x1c5b0b){logger[_0x311e('0x30')](_0x1c5b0b[_0x311e('0x31')]);if(_0x1c5b0b[_0x311e('0x32')]){delete _0x1c5b0b[_0x311e('0x32')];}_0x36a7a7[_0x311e('0x2e')](_0x1af721)[_0x311e('0x33')](_0x1c5b0b);};}exports[_0x311e('0x34')]=function(_0x4193d6,_0x595730){var _0xa3139f={},_0x31ce52={},_0x3cd5da={'count':0x0,'rows':[]};var _0x272684=_[_0x311e('0x35')](db[_0x311e('0x36')][_0x311e('0x37')],function(_0x498c41){return{'name':_0x498c41['fieldName'],'type':_0x498c41[_0x311e('0x38')]['key']};});_0x31ce52[_0x311e('0x39')]=_[_0x311e('0x35')](_0x272684,_0x311e('0x32'));_0x31ce52[_0x311e('0x3a')]=_['keys'](_0x4193d6[_0x311e('0x3a')]);_0x31ce52[_0x311e('0x3b')]=_[_0x311e('0x3c')](_0x31ce52[_0x311e('0x39')],_0x31ce52['query']);_0xa3139f[_0x311e('0x3d')]=_[_0x311e('0x3c')](_0x31ce52[_0x311e('0x39')],qs[_0x311e('0x3e')](_0x4193d6[_0x311e('0x3a')][_0x311e('0x3e')]));_0xa3139f[_0x311e('0x3d')]=_0xa3139f['attributes'][_0x311e('0x3f')]?_0xa3139f[_0x311e('0x3d')]:_0x31ce52[_0x311e('0x39')];if(!_0x4193d6['query'][_0x311e('0x40')](_0x311e('0x41'))){_0xa3139f[_0x311e('0x22')]=qs[_0x311e('0x22')](_0x4193d6[_0x311e('0x3a')][_0x311e('0x22')]);_0xa3139f[_0x311e('0x21')]=qs[_0x311e('0x21')](_0x4193d6[_0x311e('0x3a')]['offset']);}_0xa3139f[_0x311e('0x42')]=qs[_0x311e('0x43')](_0x4193d6[_0x311e('0x3a')][_0x311e('0x43')]);_0xa3139f['where']=qs['filters'](_[_0x311e('0x44')](_0x4193d6[_0x311e('0x3a')],_0x31ce52[_0x311e('0x3b')]),_0x272684);if(_0x4193d6['query'][_0x311e('0x45')]){_0xa3139f[_0x311e('0x46')]=_[_0x311e('0x47')](_0xa3139f['where'],{'$or':_[_0x311e('0x35')](_0x272684,function(_0x16c96b){if(_0x16c96b[_0x311e('0x38')]!=='VIRTUAL'){var _0x2fac24={};_0x2fac24[_0x16c96b[_0x311e('0x32')]]={'$like':'%'+_0x4193d6[_0x311e('0x3a')][_0x311e('0x45')]+'%'};return _0x2fac24;}})});}_0xa3139f=_[_0x311e('0x47')]({},_0xa3139f,_0x4193d6[_0x311e('0x48')]);var _0x5778c6={'where':_0xa3139f[_0x311e('0x46')]};return db[_0x311e('0x36')][_0x311e('0x24')](_0x5778c6)[_0x311e('0x29')](function(_0x1a55ab){_0x3cd5da['count']=_0x1a55ab;if(_0x4193d6[_0x311e('0x3a')][_0x311e('0x49')]){_0xa3139f[_0x311e('0x4a')]=[{'all':!![]}];}return db[_0x311e('0x36')]['findAll'](_0xa3139f);})['then'](function(_0x5eb6d8){_0x3cd5da['rows']=_0x5eb6d8;return _0x3cd5da;})[_0x311e('0x29')](respondWithFilteredResult(_0x595730,_0xa3139f))[_0x311e('0x4b')](handleError(_0x595730,null));};exports[_0x311e('0x4c')]=function(_0x367b79,_0x30ad42){var _0x408b0c={'raw':!![],'where':{'id':_0x367b79[_0x311e('0x4d')]['id']}},_0xaa0c8e={};_0xaa0c8e['model']=_['keys'](db[_0x311e('0x36')][_0x311e('0x37')]);_0xaa0c8e['query']=_[_0x311e('0x4e')](_0x367b79[_0x311e('0x3a')]);_0xaa0c8e['filters']=_[_0x311e('0x3c')](_0xaa0c8e[_0x311e('0x39')],_0xaa0c8e['query']);_0x408b0c['attributes']=_[_0x311e('0x3c')](_0xaa0c8e[_0x311e('0x39')],qs[_0x311e('0x3e')](_0x367b79['query'][_0x311e('0x3e')]));_0x408b0c[_0x311e('0x3d')]=_0x408b0c['attributes']['length']?_0x408b0c[_0x311e('0x3d')]:_0xaa0c8e[_0x311e('0x39')];if(_0x367b79[_0x311e('0x3a')]['includeAll']){_0x408b0c[_0x311e('0x4a')]=[{'all':!![]}];}_0x408b0c=_[_0x311e('0x47')]({},_0x408b0c,_0x367b79['options']);return db[_0x311e('0x36')]['find'](_0x408b0c)['then'](handleEntityNotFound(_0x30ad42,null))[_0x311e('0x29')](respondWithResult(_0x30ad42,null))['catch'](handleError(_0x30ad42,null));};exports['create']=function(_0x3cc7b2,_0x120c10){return db[_0x311e('0x36')]['create'](_0x3cc7b2[_0x311e('0x4f')],{})[_0x311e('0x29')](function(_0x1da146){var _0x2240de=_0x3cc7b2[_0x311e('0x50')][_0x311e('0x2b')]({'plain':!![]});if(!_0x2240de)throw new Error(_0x311e('0x51'));if(_0x2240de[_0x311e('0x52')]===_0x311e('0x50')){var _0x51a26b=_0x1da146[_0x311e('0x2b')]({'plain':!![]});var _0x119cf2=_0x311e('0x2c');return db[_0x311e('0x53')][_0x311e('0x54')]({'where':{'name':_0x119cf2,'userProfileId':_0x2240de[_0x311e('0x55')]},'raw':!![]})[_0x311e('0x29')](function(_0x9a6019){if(_0x9a6019&&_0x9a6019[_0x311e('0x56')]===0x0){return db[_0x311e('0x2d')][_0x311e('0x57')]({'name':_0x51a26b[_0x311e('0x32')],'resourceId':_0x51a26b['id'],'type':_0x9a6019['name'],'sectionId':_0x9a6019['id']},{})['then'](function(){return _0x1da146;});}else{return _0x1da146;}})['catch'](function(_0x4ac698){logger['error'](_0x311e('0x58'),_0x4ac698);throw _0x4ac698;});}return _0x1da146;})[_0x311e('0x29')](respondWithResult(_0x120c10,0xc9))[_0x311e('0x4b')](handleError(_0x120c10,null));};exports['update']=function(_0x29c622,_0x47669d){if(_0x29c622[_0x311e('0x4f')]['id']){delete _0x29c622[_0x311e('0x4f')]['id'];}return db[_0x311e('0x36')][_0x311e('0x54')]({'where':{'id':_0x29c622[_0x311e('0x4d')]['id']}})[_0x311e('0x29')](handleEntityNotFound(_0x47669d,null))[_0x311e('0x29')](saveUpdates(_0x29c622[_0x311e('0x4f')],null))['then'](respondWithResult(_0x47669d,null))['catch'](handleError(_0x47669d,null));};exports[_0x311e('0x2a')]=function(_0x26ea8b,_0xa3c10c){return db[_0x311e('0x36')][_0x311e('0x54')]({'where':{'id':_0x26ea8b[_0x311e('0x4d')]['id']}})[_0x311e('0x29')](handleEntityNotFound(_0xa3c10c,null))[_0x311e('0x29')](removeEntity(_0xa3c10c,null))['catch'](handleError(_0xa3c10c,null));};exports[_0x311e('0x59')]=function(_0x46ec0c,_0x9a371b){return db[_0x311e('0x36')][_0x311e('0x59')]()[_0x311e('0x29')](respondWithResult(_0x9a371b,null))[_0x311e('0x4b')](handleError(_0x9a371b,null));};exports[_0x311e('0x5a')]=function(_0x528c0d,_0x1246a0,_0x35c1c2){var _0x483328={'raw':!![],'where':{}},_0x24b001={},_0x1ac98e;return db[_0x311e('0x36')][_0x311e('0x5b')]({'where':{'id':_0x528c0d['params']['id']}})[_0x311e('0x29')](handleEntityNotFound(_0x1246a0,null))[_0x311e('0x29')](function(_0x1bd72e){if(_0x1bd72e){_0x1ac98e=_0x1bd72e['get']({'plain':!![]});_0x24b001[_0x311e('0x39')]=_['keys'](db['UserSmsQueue']['rawAttributes']);_0x24b001[_0x311e('0x3a')]=_[_0x311e('0x4e')](_0x528c0d[_0x311e('0x3a')]);_0x24b001[_0x311e('0x3b')]=_['intersection'](_0x24b001['model'],_0x24b001['query']);_0x483328[_0x311e('0x3d')]=_['intersection'](_0x24b001[_0x311e('0x39')],qs[_0x311e('0x3e')](_0x528c0d[_0x311e('0x3a')][_0x311e('0x3e')]));_0x483328[_0x311e('0x3d')]=_0x483328['attributes'][_0x311e('0x3f')]?_0x483328[_0x311e('0x3d')]:_0x24b001[_0x311e('0x39')];if(!_0x528c0d[_0x311e('0x3a')]['hasOwnProperty']('nolimit')){_0x483328[_0x311e('0x22')]=qs['limit'](_0x528c0d[_0x311e('0x3a')]['limit']);_0x483328[_0x311e('0x21')]=qs[_0x311e('0x21')](_0x528c0d[_0x311e('0x3a')][_0x311e('0x21')]);}_0x483328['order']=qs[_0x311e('0x43')](_0x528c0d[_0x311e('0x3a')][_0x311e('0x43')]);_0x483328[_0x311e('0x46')]=qs['filters'](_[_0x311e('0x44')](_0x528c0d[_0x311e('0x3a')],_0x24b001[_0x311e('0x3b')]));_0x483328[_0x311e('0x46')][_0x311e('0x5c')]=_0x1bd72e['id'];if(_0x528c0d['query'][_0x311e('0x45')]){_0x483328['where']=_['merge'](_0x483328[_0x311e('0x46')],{'$or':_[_0x311e('0x35')](_0x483328[_0x311e('0x3d')],function(_0x351366){var _0x46de0e={};_0x46de0e[_0x351366]={'$like':'%'+_0x528c0d[_0x311e('0x3a')][_0x311e('0x45')]+'%'};return _0x46de0e;})});}_0x483328=_[_0x311e('0x47')]({},_0x483328,_0x528c0d[_0x311e('0x48')]);return db['UserSmsQueue'][_0x311e('0x5d')](_0x483328);}})[_0x311e('0x29')](function(_0x57640d){if(_0x57640d){return db[_0x311e('0x5e')]['findAndCountAll']({'where':{'id':_[_0x311e('0x35')](_0x57640d,'UserId'),'role':'agent'},'attributes':['id',_0x311e('0x32'),_0x311e('0x5f'),'updatedAt','createdAt']});}})['then'](function(_0x42d4b3){if(_0x42d4b3){return{'count':_0x42d4b3[_0x311e('0x24')],'rows':_['map'](_0x42d4b3['rows'],function(_0x5417a8){return{'membername':_0x5417a8['name'],'UserId':_0x5417a8['id'],'queue_name':_0x1ac98e['name'],'SmsQueueId':_0x1ac98e['id'],'interface':util[_0x311e('0x60')](_0x311e('0x61'),'SIP',_0x5417a8[_0x311e('0x32')]),'penalty':0x0,'paused':_0x5417a8[_0x311e('0x5f')],'createdAt':_0x5417a8[_0x311e('0x62')],'updatedAt':_0x5417a8[_0x311e('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1246a0,_0x483328))[_0x311e('0x4b')](handleError(_0x1246a0,null));};exports[_0x311e('0x64')]=function(_0x1abbed,_0x3baa12,_0x21a90e){var _0x1503bb={};var _0x2129c2={};var _0x10c924;var _0x373e15;return db[_0x311e('0x36')][_0x311e('0x5b')]({'where':{'id':_0x1abbed['params']['id']}})[_0x311e('0x29')](handleEntityNotFound(_0x3baa12,null))[_0x311e('0x29')](function(_0x138d63){if(_0x138d63){_0x10c924=_0x138d63;_0x2129c2['model']=_[_0x311e('0x4e')](db['Team']['rawAttributes']);_0x2129c2[_0x311e('0x3a')]=_['keys'](_0x1abbed['query']);_0x2129c2['filters']=_['intersection'](_0x2129c2[_0x311e('0x39')],_0x2129c2['query']);_0x1503bb[_0x311e('0x3d')]=_[_0x311e('0x3c')](_0x2129c2[_0x311e('0x39')],qs[_0x311e('0x3e')](_0x1abbed[_0x311e('0x3a')][_0x311e('0x3e')]));_0x1503bb['attributes']=_0x1503bb['attributes']['length']?_0x1503bb[_0x311e('0x3d')]:_0x2129c2[_0x311e('0x39')];_0x1503bb[_0x311e('0x42')]=qs[_0x311e('0x43')](_0x1abbed[_0x311e('0x3a')][_0x311e('0x43')]);_0x1503bb[_0x311e('0x46')]=qs[_0x311e('0x3b')](_[_0x311e('0x44')](_0x1abbed[_0x311e('0x3a')],_0x2129c2[_0x311e('0x3b')]));if(_0x1abbed[_0x311e('0x3a')][_0x311e('0x45')]){_0x1503bb[_0x311e('0x46')]=_[_0x311e('0x47')](_0x1503bb[_0x311e('0x46')],{'$or':_[_0x311e('0x35')](_0x1503bb['attributes'],function(_0x4e28ee){var _0x442c80={};_0x442c80[_0x4e28ee]={'$like':'%'+_0x1abbed[_0x311e('0x3a')][_0x311e('0x45')]+'%'};return _0x442c80;})});}_0x1503bb=_[_0x311e('0x47')]({},_0x1503bb,_0x1abbed[_0x311e('0x48')]);return _0x10c924['getTeams'](_0x1503bb);}})[_0x311e('0x29')](function(_0x362185){if(_0x362185){_0x373e15=_0x362185[_0x311e('0x3f')];if(!_0x1abbed[_0x311e('0x3a')][_0x311e('0x40')]('nolimit')){_0x1503bb[_0x311e('0x22')]=qs['limit'](_0x1abbed['query'][_0x311e('0x22')]);_0x1503bb[_0x311e('0x21')]=qs[_0x311e('0x21')](_0x1abbed[_0x311e('0x3a')]['offset']);}return _0x10c924[_0x311e('0x64')](_0x1503bb);}})['then'](function(_0x4de8bd){if(_0x4de8bd){return _0x4de8bd?{'count':_0x373e15,'rows':_0x4de8bd}:null;}})[_0x311e('0x29')](respondWithResult(_0x3baa12,null))['catch'](handleError(_0x3baa12,null));};exports['addTeams']=function(_0x400c4f,_0xcdbf1a,_0x1867d2){var _0x349dea=_0x400c4f[_0x311e('0x4f')][_0x311e('0x65')];return db[_0x311e('0x66')][_0x311e('0x5d')]({'where':{'id':_0x349dea},'attributes':['id'],'include':[{'model':db[_0x311e('0x5e')],'as':'Agents','attributes':['id',_0x311e('0x32'),_0x311e('0x67'),_0x311e('0x68'),'interface'],'raw':!![]}]})[_0x311e('0x29')](function(_0x2094f9){if(_0x2094f9){var _0x449103=_[_0x311e('0x69')](_0x2094f9,function(_0x14ab6d){var _0x543f5c=_0x14ab6d[_0x311e('0x2b')]({'plain':!![]});return _0x543f5c[_0x311e('0x6a')];});return db[_0x311e('0x36')][_0x311e('0x54')]({'where':{'id':_0x400c4f[_0x311e('0x4d')]['id']}})[_0x311e('0x29')](function(_0x36df17){return db['sequelize']['transaction'](function(_0x5d9384){return _0x36df17[_0x311e('0x6b')](_0x349dea,{'transaction':_0x5d9384})[_0x311e('0x29')](function(){return BPromise['each'](_0x449103,function(_0x44ebde){return db[_0x311e('0x6c')][_0x311e('0x6d')]({'where':{'UserId':_0x44ebde['id'],'SmsQueueId':_0x400c4f[_0x311e('0x4d')]['id']},'transaction':_0x5d9384});});})[_0x311e('0x29')](function(){_0x449103[_0x311e('0x6e')](function(_0x17d1ce){socket[_0x311e('0x6f')]('userSmsQueue:save',{'UserId':_0x17d1ce['id'],'SmsQueueId':_0x36df17['id']});});});});});}})[_0x311e('0x29')](respondWithStatusCode(_0xcdbf1a,null))[_0x311e('0x4b')](handleError(_0xcdbf1a,null));};exports[_0x311e('0x70')]=function(_0x99f249,_0x468480,_0x30c94b){return db[_0x311e('0x66')][_0x311e('0x5d')]({'where':{'id':_0x99f249[_0x311e('0x3a')][_0x311e('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x311e('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x311e('0x29')](handleEntityNotFound(_0x468480,null))[_0x311e('0x29')](function(_0x5cf6d3){var _0x2a05c7=_[_0x311e('0x35')](_0x5cf6d3,'id');var _0x76a82=[];var _0x36dfc0=[];var _0x4d42d5=squel[_0x311e('0x71')]();_0x4d42d5[_0x311e('0x72')](_0x311e('0x73'))[_0x311e('0x74')](_0x311e('0x75'),'tq')[_0x311e('0x76')](_0x311e('0x77'),'ut',_0x311e('0x78'))[_0x311e('0x46')](_0x311e('0x79'),_0x99f249[_0x311e('0x4d')]['id']);for(var _0xa5d14a=0x0;_0xa5d14a<_0x5cf6d3['length'];_0xa5d14a+=0x1){let _0x5be57f=_0x5cf6d3[_0xa5d14a];for(var _0x586928=0x0;_0x586928<_0x5be57f['Agents'][_0x311e('0x3f')];_0x586928+=0x1){let _0x185b3a=_0x5be57f[_0x311e('0x6a')][_0x586928];var _0x251552=_0x4d42d5[_0x311e('0x7a')]();_0x251552['where'](_0x311e('0x7b'),_0x185b3a['id']);_0x36dfc0[_0x311e('0x7c')](db[_0x311e('0x7d')][_0x311e('0x3a')](_0x251552[_0x311e('0x7e')](),{'type':db[_0x311e('0x7d')][_0x311e('0x7f')]['SELECT']})[_0x311e('0x29')](function(_0x394d1e){if(_0x394d1e['length']===0x1){return _0x185b3a['id'];}else{var _0x5aead3=_[_0x311e('0x80')](_[_0x311e('0x35')](_0x394d1e,'TeamId'),function(_0x7eed78){return _[_0x311e('0x81')](_0x2a05c7,_0x7eed78);});if(_0x5aead3){return _0x185b3a['id'];}}}));}}return BPromise['all'](_0x36dfc0)[_0x311e('0x29')](function(_0x13f99d){_0x76a82=_(_0x76a82)[_0x311e('0x82')](_0x13f99d)[_0x311e('0x83')]()[_0x311e('0x84')]();return db[_0x311e('0x36')][_0x311e('0x54')]({'where':{'id':_0x99f249[_0x311e('0x4d')]['id']}})[_0x311e('0x29')](function(_0x59188b){return db[_0x311e('0x7d')]['transaction'](function(_0x12b7d0){return _0x59188b[_0x311e('0x70')](_0x99f249[_0x311e('0x3a')]['ids'],{'transaction':_0x12b7d0})['then'](function(){if(!_[_0x311e('0x85')](_0x76a82)){return _0x59188b[_0x311e('0x86')](_0x76a82,{'transaction':_0x12b7d0});}})[_0x311e('0x29')](function(){_0x76a82[_0x311e('0x6e')](function(_0x199d31){socket['emit']('userSmsQueue:remove',{'UserId':_0x199d31,'SmsQueueId':_0x59188b['id']});});});});});});})[_0x311e('0x29')](respondWithStatusCode(_0x468480,null))[_0x311e('0x4b')](handleError(_0x468480,null));};exports['addAgents']=function(_0x235ea2,_0x48c76b,_0x5b9357){return db[_0x311e('0x36')][_0x311e('0x54')]({'where':{'id':_0x235ea2[_0x311e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x48c76b,null))[_0x311e('0x29')](function(_0x358bad){if(_0x358bad){return _0x358bad['addAgents'](_0x235ea2[_0x311e('0x4f')][_0x311e('0x65')],_[_0x311e('0x87')](_0x235ea2[_0x311e('0x4f')],[_0x311e('0x65'),'id'])||{})[_0x311e('0x88')](function(_0x47538b){for(var _0x2d7fd2=0x0;_0x2d7fd2<_0x235ea2[_0x311e('0x4f')][_0x311e('0x65')][_0x311e('0x3f')];_0x2d7fd2+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0x235ea2['body']['ids'][_0x2d7fd2]),'SmsQueueId':Number(_0x235ea2[_0x311e('0x4d')]['id'])});}return _0x47538b;});}})['then'](respondWithResult(_0x48c76b,null))[_0x311e('0x4b')](handleError(_0x48c76b,null));};exports[_0x311e('0x86')]=function(_0x5da9d2,_0x5e41d1,_0x42cf28){return db[_0x311e('0x36')][_0x311e('0x54')]({'where':{'id':_0x5da9d2[_0x311e('0x4d')]['id']}})[_0x311e('0x29')](handleEntityNotFound(_0x5e41d1,null))[_0x311e('0x29')](function(_0x1c0e38){if(_0x1c0e38){return _0x1c0e38[_0x311e('0x86')](_0x5da9d2[_0x311e('0x3a')][_0x311e('0x65')])['then'](function(){if(_['isArray'](_0x5da9d2[_0x311e('0x3a')]['ids'])){for(var _0x7c4063=0x0;_0x7c4063<_0x5da9d2[_0x311e('0x3a')]['ids'][_0x311e('0x3f')];_0x7c4063+=0x1){socket[_0x311e('0x6f')](_0x311e('0x89'),{'UserId':Number(_0x5da9d2[_0x311e('0x3a')][_0x311e('0x65')][_0x7c4063]),'SmsQueueId':Number(_0x5da9d2['params']['id'])});}}else{socket[_0x311e('0x6f')](_0x311e('0x89'),{'UserId':Number(_0x5da9d2['query'][_0x311e('0x65')]),'SmsQueueId':Number(_0x5da9d2['params']['id'])});}});}})[_0x311e('0x29')](respondWithStatusCode(_0x5e41d1,null))[_0x311e('0x4b')](handleError(_0x5e41d1,null));};exports[_0x311e('0x8a')]=function(_0x318d51,_0x567200,_0x4521e5){var _0x192b4e={};var _0x2d9a43={};var _0x38ab37;var _0x3cfbc8;return db[_0x311e('0x36')][_0x311e('0x5b')]({'where':{'id':_0x318d51[_0x311e('0x4d')]['id']}})[_0x311e('0x29')](handleEntityNotFound(_0x567200,null))[_0x311e('0x29')](function(_0x74e252){if(_0x74e252){_0x38ab37=_0x74e252;_0x2d9a43[_0x311e('0x39')]=_['keys'](db[_0x311e('0x5e')][_0x311e('0x37')]);_0x2d9a43['query']=_[_0x311e('0x4e')](_0x318d51['query']);_0x2d9a43['filters']=_[_0x311e('0x3c')](_0x2d9a43[_0x311e('0x39')],_0x2d9a43['query']);_0x192b4e[_0x311e('0x3d')]=_[_0x311e('0x3c')](_0x2d9a43[_0x311e('0x39')],qs[_0x311e('0x3e')](_0x318d51['query'][_0x311e('0x3e')]));_0x192b4e['attributes']=_0x192b4e[_0x311e('0x3d')][_0x311e('0x3f')]?_0x192b4e[_0x311e('0x3d')]:_0x2d9a43['model'];_0x192b4e['order']=qs[_0x311e('0x43')](_0x318d51['query'][_0x311e('0x43')]);_0x192b4e[_0x311e('0x46')]=qs[_0x311e('0x3b')](_['pick'](_0x318d51[_0x311e('0x3a')],_0x2d9a43[_0x311e('0x3b')]));if(_0x318d51[_0x311e('0x3a')]['filter']){_0x192b4e['where']=_[_0x311e('0x47')](_0x192b4e[_0x311e('0x46')],{'$or':_['map'](_0x192b4e[_0x311e('0x3d')],function(_0x17965f){var _0x2c9b11={};_0x2c9b11[_0x17965f]={'$like':'%'+_0x318d51[_0x311e('0x3a')][_0x311e('0x45')]+'%'};return _0x2c9b11;})});}_0x192b4e=_[_0x311e('0x47')]({},_0x192b4e,_0x318d51['options']);return _0x38ab37[_0x311e('0x8a')](_0x192b4e);}})[_0x311e('0x29')](function(_0x1a8c11){if(_0x1a8c11){_0x3cfbc8=_0x1a8c11[_0x311e('0x3f')];if(!_0x318d51['query'][_0x311e('0x40')]('nolimit')){_0x192b4e[_0x311e('0x22')]=qs[_0x311e('0x22')](_0x318d51[_0x311e('0x3a')][_0x311e('0x22')]);_0x192b4e[_0x311e('0x21')]=qs[_0x311e('0x21')](_0x318d51['query'][_0x311e('0x21')]);}return _0x38ab37[_0x311e('0x8a')](_0x192b4e);}})[_0x311e('0x29')](function(_0x4a5d0c){if(_0x4a5d0c){return _0x4a5d0c?{'count':_0x3cfbc8,'rows':_0x4a5d0c}:null;}})['then'](respondWithResult(_0x567200,null))['catch'](handleError(_0x567200,null));}; \ No newline at end of file +var _0x0e2a=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','create','error','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','SIP','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','compact','transaction','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../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','./smsQueue.socket','register','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','SmsQueues','destroy','sendStatus','name','index','map','SmsQueue','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','body'];(function(_0x2e7b19,_0x10eaa2){var _0x137bd2=function(_0x2d67ff){while(--_0x2d67ff){_0x2e7b19['push'](_0x2e7b19['shift']());}};_0x137bd2(++_0x10eaa2);}(_0x0e2a,0x154));var _0xa0e2=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x0e2a[_0x10f6e8];return _0x35bb3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa0e2('0x0'));var zipdir=require(_0xa0e2('0x1'));var jsonpatch=require(_0xa0e2('0x2'));var rp=require(_0xa0e2('0x3'));var moment=require('moment');var BPromise=require(_0xa0e2('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa0e2('0x5'));var sox=require(_0xa0e2('0x6'));var csv=require(_0xa0e2('0x7'));var ejs=require(_0xa0e2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0e2('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa0e2('0xa'));var toCsv=require(_0xa0e2('0x7'));var querystring=require(_0xa0e2('0xb'));var Papa=require(_0xa0e2('0xc'));var Redis=require(_0xa0e2('0xd'));var authService=require(_0xa0e2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa0e2('0xf'));var hardwareService=require(_0xa0e2('0x10'));var logger=require(_0xa0e2('0x11'))('api');var utils=require(_0xa0e2('0x12'));var config=require(_0xa0e2('0x13'));var licenseUtil=require(_0xa0e2('0x14'));var db=require(_0xa0e2('0x15'))['db'];config[_0xa0e2('0x16')]=_[_0xa0e2('0x17')](config[_0xa0e2('0x16')],{'host':_0xa0e2('0x18'),'port':0x18eb});var socket=require(_0xa0e2('0x19'))(new Redis(config['redis']));require(_0xa0e2('0x1a'))[_0xa0e2('0x1b')](socket);function respondWithStatusCode(_0x1bc648,_0x45736e){_0x45736e=_0x45736e||0xcc;return function(_0x34576f){if(_0x34576f){return _0x1bc648['sendStatus'](_0x45736e);}return _0x1bc648[_0xa0e2('0x1c')](_0x45736e)[_0xa0e2('0x1d')]();};}function respondWithResult(_0x12c3b2,_0x48f8c2){_0x48f8c2=_0x48f8c2||0xc8;return function(_0x4a861a){if(_0x4a861a){return _0x12c3b2['status'](_0x48f8c2)[_0xa0e2('0x1e')](_0x4a861a);}};}function respondWithFilteredResult(_0x124da1,_0x1631a3){return function(_0x221b70){if(_0x221b70){var _0x42aba5=typeof _0x1631a3[_0xa0e2('0x1f')]===_0xa0e2('0x20')&&typeof _0x1631a3['limit']===_0xa0e2('0x20');var _0x2180f2=_0x221b70[_0xa0e2('0x21')];var _0xfc3e2a=_0x42aba5?0x0:_0x1631a3[_0xa0e2('0x1f')];var _0x59f341=_0x42aba5?_0x221b70[_0xa0e2('0x21')]:_0x1631a3['offset']+_0x1631a3['limit'];var _0x2b1af2;if(_0x59f341>=_0x2180f2){_0x59f341=_0x2180f2;_0x2b1af2=0xc8;}else{_0x2b1af2=0xce;}_0x124da1[_0xa0e2('0x1c')](_0x2b1af2);return _0x124da1['set'](_0xa0e2('0x22'),_0xfc3e2a+'-'+_0x59f341+'/'+_0x2180f2)[_0xa0e2('0x1e')](_0x221b70);}return null;};}function patchUpdates(_0x196fe8){return function(_0x971683){try{jsonpatch[_0xa0e2('0x23')](_0x971683,_0x196fe8,!![]);}catch(_0x2a9a43){return BPromise[_0xa0e2('0x24')](_0x2a9a43);}return _0x971683[_0xa0e2('0x25')]();};}function saveUpdates(_0x18ff62,_0x1d5820){return function(_0x294fca){if(_0x294fca){return _0x294fca[_0xa0e2('0x26')](_0x18ff62)[_0xa0e2('0x27')](function(_0x241d9e){return _0x241d9e;});}return null;};}function removeEntity(_0x25c1b2,_0x247511){return function(_0x2a0186){if(_0x2a0186){return _0x2a0186['destroy']()['then'](function(){var _0x1d25ed=_0x2a0186['get']({'plain':!![]});var _0x2a2e84=_0xa0e2('0x28');return db['UserProfileResource'][_0xa0e2('0x29')]({'where':{'type':_0x2a2e84,'resourceId':_0x1d25ed['id']}})[_0xa0e2('0x27')](function(){return _0x2a0186;});})[_0xa0e2('0x27')](function(){_0x25c1b2[_0xa0e2('0x1c')](0xcc)[_0xa0e2('0x1d')]();});}};}function handleEntityNotFound(_0x3547d3,_0x4455b9){return function(_0x571379){if(!_0x571379){_0x3547d3[_0xa0e2('0x2a')](0x194);}return _0x571379;};}function handleError(_0x1a9c3a,_0x45ffe7){_0x45ffe7=_0x45ffe7||0x1f4;return function(_0x3f742b){logger['error'](_0x3f742b['stack']);if(_0x3f742b[_0xa0e2('0x2b')]){delete _0x3f742b[_0xa0e2('0x2b')];}_0x1a9c3a[_0xa0e2('0x1c')](_0x45ffe7)['send'](_0x3f742b);};}exports[_0xa0e2('0x2c')]=function(_0x1416ba,_0x2e69a6){var _0x54c15c={},_0x282691={},_0x174d92={'count':0x0,'rows':[]};var _0x110813=_[_0xa0e2('0x2d')](db[_0xa0e2('0x2e')]['rawAttributes'],function(_0x9ac959){return{'name':_0x9ac959['fieldName'],'type':_0x9ac959['type'][_0xa0e2('0x2f')]};});_0x282691[_0xa0e2('0x30')]=_['map'](_0x110813,_0xa0e2('0x2b'));_0x282691[_0xa0e2('0x31')]=_[_0xa0e2('0x32')](_0x1416ba[_0xa0e2('0x31')]);_0x282691[_0xa0e2('0x33')]=_[_0xa0e2('0x34')](_0x282691[_0xa0e2('0x30')],_0x282691[_0xa0e2('0x31')]);_0x54c15c[_0xa0e2('0x35')]=_['intersection'](_0x282691[_0xa0e2('0x30')],qs[_0xa0e2('0x36')](_0x1416ba[_0xa0e2('0x31')][_0xa0e2('0x36')]));_0x54c15c[_0xa0e2('0x35')]=_0x54c15c[_0xa0e2('0x35')][_0xa0e2('0x37')]?_0x54c15c[_0xa0e2('0x35')]:_0x282691[_0xa0e2('0x30')];if(!_0x1416ba['query'][_0xa0e2('0x38')](_0xa0e2('0x39'))){_0x54c15c[_0xa0e2('0x3a')]=qs['limit'](_0x1416ba[_0xa0e2('0x31')][_0xa0e2('0x3a')]);_0x54c15c[_0xa0e2('0x1f')]=qs[_0xa0e2('0x1f')](_0x1416ba[_0xa0e2('0x31')][_0xa0e2('0x1f')]);}_0x54c15c[_0xa0e2('0x3b')]=qs[_0xa0e2('0x3c')](_0x1416ba[_0xa0e2('0x31')][_0xa0e2('0x3c')]);_0x54c15c['where']=qs[_0xa0e2('0x33')](_[_0xa0e2('0x3d')](_0x1416ba[_0xa0e2('0x31')],_0x282691[_0xa0e2('0x33')]),_0x110813);if(_0x1416ba['query'][_0xa0e2('0x3e')]){_0x54c15c[_0xa0e2('0x3f')]=_[_0xa0e2('0x40')](_0x54c15c[_0xa0e2('0x3f')],{'$or':_[_0xa0e2('0x2d')](_0x110813,function(_0x2b5ce0){if(_0x2b5ce0[_0xa0e2('0x41')]!=='VIRTUAL'){var _0x525622={};_0x525622[_0x2b5ce0[_0xa0e2('0x2b')]]={'$like':'%'+_0x1416ba[_0xa0e2('0x31')][_0xa0e2('0x3e')]+'%'};return _0x525622;}})});}_0x54c15c=_['merge']({},_0x54c15c,_0x1416ba[_0xa0e2('0x42')]);var _0x32b980={'where':_0x54c15c[_0xa0e2('0x3f')]};return db[_0xa0e2('0x2e')]['count'](_0x32b980)[_0xa0e2('0x27')](function(_0x1a3597){_0x174d92['count']=_0x1a3597;if(_0x1416ba['query']['includeAll']){_0x54c15c[_0xa0e2('0x43')]=[{'all':!![]}];}return db[_0xa0e2('0x2e')][_0xa0e2('0x44')](_0x54c15c);})[_0xa0e2('0x27')](function(_0x2819a0){_0x174d92[_0xa0e2('0x45')]=_0x2819a0;return _0x174d92;})[_0xa0e2('0x27')](respondWithFilteredResult(_0x2e69a6,_0x54c15c))[_0xa0e2('0x46')](handleError(_0x2e69a6,null));};exports[_0xa0e2('0x47')]=function(_0x162875,_0x28d8af){var _0x204d12={'raw':!![],'where':{'id':_0x162875[_0xa0e2('0x48')]['id']}},_0x5b7f50={};_0x5b7f50['model']=_['keys'](db[_0xa0e2('0x2e')][_0xa0e2('0x49')]);_0x5b7f50[_0xa0e2('0x31')]=_[_0xa0e2('0x32')](_0x162875[_0xa0e2('0x31')]);_0x5b7f50[_0xa0e2('0x33')]=_[_0xa0e2('0x34')](_0x5b7f50['model'],_0x5b7f50['query']);_0x204d12[_0xa0e2('0x35')]=_['intersection'](_0x5b7f50[_0xa0e2('0x30')],qs[_0xa0e2('0x36')](_0x162875['query'][_0xa0e2('0x36')]));_0x204d12[_0xa0e2('0x35')]=_0x204d12[_0xa0e2('0x35')][_0xa0e2('0x37')]?_0x204d12['attributes']:_0x5b7f50[_0xa0e2('0x30')];if(_0x162875['query'][_0xa0e2('0x4a')]){_0x204d12[_0xa0e2('0x43')]=[{'all':!![]}];}_0x204d12=_[_0xa0e2('0x40')]({},_0x204d12,_0x162875['options']);return db['SmsQueue'][_0xa0e2('0x4b')](_0x204d12)[_0xa0e2('0x27')](handleEntityNotFound(_0x28d8af,null))[_0xa0e2('0x27')](respondWithResult(_0x28d8af,null))[_0xa0e2('0x46')](handleError(_0x28d8af,null));};exports['create']=function(_0x1ad821,_0x2e8dd8){return db[_0xa0e2('0x2e')]['create'](_0x1ad821[_0xa0e2('0x4c')],{})[_0xa0e2('0x27')](function(_0x236d4e){var _0x3b7e4a=_0x1ad821[_0xa0e2('0x4d')][_0xa0e2('0x4e')]({'plain':!![]});if(!_0x3b7e4a)throw new Error(_0xa0e2('0x4f'));if(_0x3b7e4a['role']==='user'){var _0x425162=_0x236d4e[_0xa0e2('0x4e')]({'plain':!![]});var _0x214156='SmsQueues';return db['UserProfileSection'][_0xa0e2('0x4b')]({'where':{'name':_0x214156,'userProfileId':_0x3b7e4a[_0xa0e2('0x50')]},'raw':!![]})[_0xa0e2('0x27')](function(_0xa13008){if(_0xa13008&&_0xa13008[_0xa0e2('0x51')]===0x0){return db['UserProfileResource'][_0xa0e2('0x52')]({'name':_0x425162[_0xa0e2('0x2b')],'resourceId':_0x425162['id'],'type':_0xa13008[_0xa0e2('0x2b')],'sectionId':_0xa13008['id']},{})['then'](function(){return _0x236d4e;});}else{return _0x236d4e;}})[_0xa0e2('0x46')](function(_0x1b6e19){logger[_0xa0e2('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b6e19);throw _0x1b6e19;});}return _0x236d4e;})[_0xa0e2('0x27')](respondWithResult(_0x2e8dd8,0xc9))[_0xa0e2('0x46')](handleError(_0x2e8dd8,null));};exports[_0xa0e2('0x26')]=function(_0x5058c6,_0x3e01cb){if(_0x5058c6['body']['id']){delete _0x5058c6[_0xa0e2('0x4c')]['id'];}return db[_0xa0e2('0x2e')][_0xa0e2('0x4b')]({'where':{'id':_0x5058c6[_0xa0e2('0x48')]['id']}})['then'](handleEntityNotFound(_0x3e01cb,null))['then'](saveUpdates(_0x5058c6[_0xa0e2('0x4c')],null))[_0xa0e2('0x27')](respondWithResult(_0x3e01cb,null))[_0xa0e2('0x46')](handleError(_0x3e01cb,null));};exports[_0xa0e2('0x29')]=function(_0x3f2fa5,_0x5d2a03){return db['SmsQueue'][_0xa0e2('0x4b')]({'where':{'id':_0x3f2fa5[_0xa0e2('0x48')]['id']}})[_0xa0e2('0x27')](handleEntityNotFound(_0x5d2a03,null))[_0xa0e2('0x27')](removeEntity(_0x5d2a03,null))[_0xa0e2('0x46')](handleError(_0x5d2a03,null));};exports[_0xa0e2('0x54')]=function(_0x468e73,_0x30b0ac){return db[_0xa0e2('0x2e')][_0xa0e2('0x54')]()['then'](respondWithResult(_0x30b0ac,null))[_0xa0e2('0x46')](handleError(_0x30b0ac,null));};exports[_0xa0e2('0x55')]=function(_0x16441f,_0x41ecac,_0x3e4db5){var _0x542bc9={'raw':!![],'where':{}},_0x97c4d8={},_0x2d53ef;return db[_0xa0e2('0x2e')][_0xa0e2('0x56')]({'where':{'id':_0x16441f[_0xa0e2('0x48')]['id']}})[_0xa0e2('0x27')](handleEntityNotFound(_0x41ecac,null))['then'](function(_0x2a1a76){if(_0x2a1a76){_0x2d53ef=_0x2a1a76[_0xa0e2('0x4e')]({'plain':!![]});_0x97c4d8[_0xa0e2('0x30')]=_[_0xa0e2('0x32')](db[_0xa0e2('0x57')]['rawAttributes']);_0x97c4d8[_0xa0e2('0x31')]=_[_0xa0e2('0x32')](_0x16441f[_0xa0e2('0x31')]);_0x97c4d8[_0xa0e2('0x33')]=_[_0xa0e2('0x34')](_0x97c4d8[_0xa0e2('0x30')],_0x97c4d8[_0xa0e2('0x31')]);_0x542bc9['attributes']=_['intersection'](_0x97c4d8[_0xa0e2('0x30')],qs[_0xa0e2('0x36')](_0x16441f['query'][_0xa0e2('0x36')]));_0x542bc9[_0xa0e2('0x35')]=_0x542bc9[_0xa0e2('0x35')][_0xa0e2('0x37')]?_0x542bc9[_0xa0e2('0x35')]:_0x97c4d8[_0xa0e2('0x30')];if(!_0x16441f[_0xa0e2('0x31')]['hasOwnProperty']('nolimit')){_0x542bc9['limit']=qs[_0xa0e2('0x3a')](_0x16441f['query']['limit']);_0x542bc9['offset']=qs['offset'](_0x16441f['query'][_0xa0e2('0x1f')]);}_0x542bc9['order']=qs[_0xa0e2('0x3c')](_0x16441f['query']['sort']);_0x542bc9[_0xa0e2('0x3f')]=qs[_0xa0e2('0x33')](_[_0xa0e2('0x3d')](_0x16441f[_0xa0e2('0x31')],_0x97c4d8['filters']));_0x542bc9['where'][_0xa0e2('0x58')]=_0x2a1a76['id'];if(_0x16441f[_0xa0e2('0x31')][_0xa0e2('0x3e')]){_0x542bc9[_0xa0e2('0x3f')]=_['merge'](_0x542bc9[_0xa0e2('0x3f')],{'$or':_[_0xa0e2('0x2d')](_0x542bc9[_0xa0e2('0x35')],function(_0x28cb61){var _0x5bd830={};_0x5bd830[_0x28cb61]={'$like':'%'+_0x16441f[_0xa0e2('0x31')][_0xa0e2('0x3e')]+'%'};return _0x5bd830;})});}_0x542bc9=_['merge']({},_0x542bc9,_0x16441f[_0xa0e2('0x42')]);return db['UserSmsQueue'][_0xa0e2('0x44')](_0x542bc9);}})[_0xa0e2('0x27')](function(_0x306360){if(_0x306360){return db['User'][_0xa0e2('0x59')]({'where':{'id':_['map'](_0x306360,_0xa0e2('0x5a')),'role':_0xa0e2('0x5b')},'attributes':['id',_0xa0e2('0x2b'),_0xa0e2('0x5c'),_0xa0e2('0x5d'),_0xa0e2('0x5e')]});}})[_0xa0e2('0x27')](function(_0x2922e1){if(_0x2922e1){return{'count':_0x2922e1[_0xa0e2('0x21')],'rows':_['map'](_0x2922e1[_0xa0e2('0x45')],function(_0x3005a2){return{'membername':_0x3005a2[_0xa0e2('0x2b')],'UserId':_0x3005a2['id'],'queue_name':_0x2d53ef[_0xa0e2('0x2b')],'SmsQueueId':_0x2d53ef['id'],'interface':util[_0xa0e2('0x5f')]('%s/%s',_0xa0e2('0x60'),_0x3005a2[_0xa0e2('0x2b')]),'penalty':0x0,'paused':_0x3005a2[_0xa0e2('0x5c')],'createdAt':_0x3005a2[_0xa0e2('0x5e')],'updatedAt':_0x3005a2[_0xa0e2('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa0e2('0x27')](respondWithFilteredResult(_0x41ecac,_0x542bc9))['catch'](handleError(_0x41ecac,null));};exports['getTeams']=function(_0x12b3ce,_0x193a50,_0x8d7d37){var _0x2f0044={};var _0x3c725d={};var _0x4f82fa;var _0xf7c3ef;return db[_0xa0e2('0x2e')][_0xa0e2('0x56')]({'where':{'id':_0x12b3ce[_0xa0e2('0x48')]['id']}})[_0xa0e2('0x27')](handleEntityNotFound(_0x193a50,null))['then'](function(_0x4efcee){if(_0x4efcee){_0x4f82fa=_0x4efcee;_0x3c725d[_0xa0e2('0x30')]=_[_0xa0e2('0x32')](db[_0xa0e2('0x61')]['rawAttributes']);_0x3c725d[_0xa0e2('0x31')]=_['keys'](_0x12b3ce[_0xa0e2('0x31')]);_0x3c725d['filters']=_[_0xa0e2('0x34')](_0x3c725d[_0xa0e2('0x30')],_0x3c725d['query']);_0x2f0044['attributes']=_['intersection'](_0x3c725d[_0xa0e2('0x30')],qs[_0xa0e2('0x36')](_0x12b3ce['query'][_0xa0e2('0x36')]));_0x2f0044['attributes']=_0x2f0044[_0xa0e2('0x35')][_0xa0e2('0x37')]?_0x2f0044[_0xa0e2('0x35')]:_0x3c725d[_0xa0e2('0x30')];_0x2f0044[_0xa0e2('0x3b')]=qs[_0xa0e2('0x3c')](_0x12b3ce[_0xa0e2('0x31')][_0xa0e2('0x3c')]);_0x2f0044[_0xa0e2('0x3f')]=qs[_0xa0e2('0x33')](_[_0xa0e2('0x3d')](_0x12b3ce[_0xa0e2('0x31')],_0x3c725d[_0xa0e2('0x33')]));if(_0x12b3ce['query'][_0xa0e2('0x3e')]){_0x2f0044[_0xa0e2('0x3f')]=_[_0xa0e2('0x40')](_0x2f0044[_0xa0e2('0x3f')],{'$or':_['map'](_0x2f0044[_0xa0e2('0x35')],function(_0x3f9fe2){var _0x10389b={};_0x10389b[_0x3f9fe2]={'$like':'%'+_0x12b3ce['query'][_0xa0e2('0x3e')]+'%'};return _0x10389b;})});}_0x2f0044=_[_0xa0e2('0x40')]({},_0x2f0044,_0x12b3ce['options']);return _0x4f82fa['getTeams'](_0x2f0044);}})[_0xa0e2('0x27')](function(_0x29904e){if(_0x29904e){_0xf7c3ef=_0x29904e[_0xa0e2('0x37')];if(!_0x12b3ce['query'][_0xa0e2('0x38')](_0xa0e2('0x39'))){_0x2f0044[_0xa0e2('0x3a')]=qs['limit'](_0x12b3ce[_0xa0e2('0x31')][_0xa0e2('0x3a')]);_0x2f0044['offset']=qs[_0xa0e2('0x1f')](_0x12b3ce['query'][_0xa0e2('0x1f')]);}return _0x4f82fa['getTeams'](_0x2f0044);}})[_0xa0e2('0x27')](function(_0x23d43d){if(_0x23d43d){return _0x23d43d?{'count':_0xf7c3ef,'rows':_0x23d43d}:null;}})[_0xa0e2('0x27')](respondWithResult(_0x193a50,null))[_0xa0e2('0x46')](handleError(_0x193a50,null));};exports[_0xa0e2('0x62')]=function(_0x18129d,_0x1dfcfb,_0x466364){var _0x481757=_0x18129d[_0xa0e2('0x4c')][_0xa0e2('0x63')];return db[_0xa0e2('0x61')][_0xa0e2('0x44')]({'where':{'id':_0x481757},'attributes':['id'],'include':[{'model':db[_0xa0e2('0x64')],'as':_0xa0e2('0x65'),'attributes':['id',_0xa0e2('0x2b'),_0xa0e2('0x66'),_0xa0e2('0x67'),_0xa0e2('0x68')],'raw':!![]}]})[_0xa0e2('0x27')](function(_0x762be8){if(_0x762be8){var _0x427346=_[_0xa0e2('0x69')](_0x762be8,function(_0x9a47ea){var _0x56d57b=_0x9a47ea['get']({'plain':!![]});return _0x56d57b[_0xa0e2('0x65')];});return db[_0xa0e2('0x2e')][_0xa0e2('0x4b')]({'where':{'id':_0x18129d[_0xa0e2('0x48')]['id']}})[_0xa0e2('0x27')](function(_0x4dc6d4){return db['sequelize']['transaction'](function(_0x275f46){return _0x4dc6d4[_0xa0e2('0x62')](_0x481757,{'transaction':_0x275f46})['then'](function(){return BPromise[_0xa0e2('0x6a')](_0x427346,function(_0x32a75d){return db['UserSmsQueue'][_0xa0e2('0x6b')]({'where':{'UserId':_0x32a75d['id'],'SmsQueueId':_0x18129d[_0xa0e2('0x48')]['id']},'transaction':_0x275f46});});})[_0xa0e2('0x27')](function(){_0x427346[_0xa0e2('0x6c')](function(_0x197153){socket[_0xa0e2('0x6d')]('userSmsQueue:save',{'UserId':_0x197153['id'],'SmsQueueId':_0x4dc6d4['id']});});});});});}})[_0xa0e2('0x27')](respondWithStatusCode(_0x1dfcfb,null))[_0xa0e2('0x46')](handleError(_0x1dfcfb,null));};exports[_0xa0e2('0x6e')]=function(_0x5d15f1,_0x391b19,_0x3ba2eb){return db['Team'][_0xa0e2('0x44')]({'where':{'id':_0x5d15f1[_0xa0e2('0x31')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa0e2('0x64')],'as':_0xa0e2('0x65'),'attributes':['id'],'raw':!![]}]})[_0xa0e2('0x27')](handleEntityNotFound(_0x391b19,null))['then'](function(_0x5b5c5e){var _0x3b2dd8=_[_0xa0e2('0x2d')](_0x5b5c5e,'id');var _0x3381da=[];var _0x554936=[];var _0x451fd4=squel[_0xa0e2('0x6f')]();_0x451fd4['field'](_0xa0e2('0x70'))[_0xa0e2('0x71')](_0xa0e2('0x72'),'tq')[_0xa0e2('0x73')](_0xa0e2('0x74'),'ut',_0xa0e2('0x75'))[_0xa0e2('0x3f')](_0xa0e2('0x76'),_0x5d15f1[_0xa0e2('0x48')]['id']);for(var _0x53b146=0x0;_0x53b146<_0x5b5c5e[_0xa0e2('0x37')];_0x53b146+=0x1){let _0x25c9b3=_0x5b5c5e[_0x53b146];for(var _0x294527=0x0;_0x294527<_0x25c9b3[_0xa0e2('0x65')][_0xa0e2('0x37')];_0x294527+=0x1){let _0x2d3368=_0x25c9b3['Agents'][_0x294527];var _0x280cd5=_0x451fd4[_0xa0e2('0x77')]();_0x280cd5[_0xa0e2('0x3f')](_0xa0e2('0x78'),_0x2d3368['id']);_0x554936[_0xa0e2('0x79')](db[_0xa0e2('0x7a')][_0xa0e2('0x31')](_0x280cd5[_0xa0e2('0x7b')](),{'type':db[_0xa0e2('0x7a')][_0xa0e2('0x7c')]['SELECT']})[_0xa0e2('0x27')](function(_0x251a35){if(_0x251a35['length']===0x1){return _0x2d3368['id'];}else{var _0xec1a96=_[_0xa0e2('0x7d')](_['map'](_0x251a35,_0xa0e2('0x7e')),function(_0x7e3a25){return _[_0xa0e2('0x7f')](_0x3b2dd8,_0x7e3a25);});if(_0xec1a96){return _0x2d3368['id'];}}}));}}return BPromise[_0xa0e2('0x80')](_0x554936)['then'](function(_0x494d18){_0x3381da=_(_0x3381da)[_0xa0e2('0x81')](_0x494d18)[_0xa0e2('0x82')]()['value']();return db[_0xa0e2('0x2e')][_0xa0e2('0x4b')]({'where':{'id':_0x5d15f1[_0xa0e2('0x48')]['id']}})[_0xa0e2('0x27')](function(_0x297e86){return db[_0xa0e2('0x7a')][_0xa0e2('0x83')](function(_0x29c20c){return _0x297e86[_0xa0e2('0x6e')](_0x5d15f1['query']['ids'],{'transaction':_0x29c20c})[_0xa0e2('0x27')](function(){if(!_['isEmpty'](_0x3381da)){return _0x297e86['removeAgents'](_0x3381da,{'transaction':_0x29c20c});}})[_0xa0e2('0x27')](function(){_0x3381da[_0xa0e2('0x6c')](function(_0x4793e1){socket[_0xa0e2('0x6d')](_0xa0e2('0x84'),{'UserId':_0x4793e1,'SmsQueueId':_0x297e86['id']});});});});});});})['then'](respondWithStatusCode(_0x391b19,null))[_0xa0e2('0x46')](handleError(_0x391b19,null));};exports[_0xa0e2('0x85')]=function(_0x395da6,_0x3ba46b,_0x35f366){return db[_0xa0e2('0x2e')][_0xa0e2('0x4b')]({'where':{'id':_0x395da6[_0xa0e2('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ba46b,null))[_0xa0e2('0x27')](function(_0x175e68){if(_0x175e68){return _0x175e68[_0xa0e2('0x85')](_0x395da6[_0xa0e2('0x4c')][_0xa0e2('0x63')],_[_0xa0e2('0x86')](_0x395da6['body'],[_0xa0e2('0x63'),'id'])||{})[_0xa0e2('0x87')](function(_0x56ba65){for(var _0x4db872=0x0;_0x4db872<_0x395da6['body'][_0xa0e2('0x63')]['length'];_0x4db872+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0x395da6['body']['ids'][_0x4db872]),'SmsQueueId':Number(_0x395da6[_0xa0e2('0x48')]['id'])});}return _0x56ba65;});}})[_0xa0e2('0x27')](respondWithResult(_0x3ba46b,null))[_0xa0e2('0x46')](handleError(_0x3ba46b,null));};exports[_0xa0e2('0x88')]=function(_0x5500d4,_0x1cb894,_0x486e92){return db[_0xa0e2('0x2e')][_0xa0e2('0x4b')]({'where':{'id':_0x5500d4[_0xa0e2('0x48')]['id']}})[_0xa0e2('0x27')](handleEntityNotFound(_0x1cb894,null))[_0xa0e2('0x27')](function(_0x397ce2){if(_0x397ce2){return _0x397ce2[_0xa0e2('0x88')](_0x5500d4[_0xa0e2('0x31')][_0xa0e2('0x63')])['then'](function(){if(_[_0xa0e2('0x89')](_0x5500d4['query'][_0xa0e2('0x63')])){for(var _0x342dfc=0x0;_0x342dfc<_0x5500d4['query'][_0xa0e2('0x63')][_0xa0e2('0x37')];_0x342dfc+=0x1){socket['emit'](_0xa0e2('0x84'),{'UserId':Number(_0x5500d4[_0xa0e2('0x31')][_0xa0e2('0x63')][_0x342dfc]),'SmsQueueId':Number(_0x5500d4['params']['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x5500d4['query'][_0xa0e2('0x63')]),'SmsQueueId':Number(_0x5500d4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1cb894,null))['catch'](handleError(_0x1cb894,null));};exports['getAgents']=function(_0x3e8b55,_0x4ed46b,_0xde9e00){var _0x193704={};var _0x46bedd={};var _0x4c8e8c;var _0x10b892;return db[_0xa0e2('0x2e')][_0xa0e2('0x56')]({'where':{'id':_0x3e8b55[_0xa0e2('0x48')]['id']}})[_0xa0e2('0x27')](handleEntityNotFound(_0x4ed46b,null))['then'](function(_0x2e9114){if(_0x2e9114){_0x4c8e8c=_0x2e9114;_0x46bedd[_0xa0e2('0x30')]=_['keys'](db[_0xa0e2('0x64')][_0xa0e2('0x49')]);_0x46bedd[_0xa0e2('0x31')]=_[_0xa0e2('0x32')](_0x3e8b55[_0xa0e2('0x31')]);_0x46bedd[_0xa0e2('0x33')]=_['intersection'](_0x46bedd[_0xa0e2('0x30')],_0x46bedd['query']);_0x193704['attributes']=_[_0xa0e2('0x34')](_0x46bedd[_0xa0e2('0x30')],qs[_0xa0e2('0x36')](_0x3e8b55[_0xa0e2('0x31')][_0xa0e2('0x36')]));_0x193704[_0xa0e2('0x35')]=_0x193704[_0xa0e2('0x35')][_0xa0e2('0x37')]?_0x193704[_0xa0e2('0x35')]:_0x46bedd['model'];_0x193704[_0xa0e2('0x3b')]=qs[_0xa0e2('0x3c')](_0x3e8b55['query']['sort']);_0x193704[_0xa0e2('0x3f')]=qs['filters'](_[_0xa0e2('0x3d')](_0x3e8b55['query'],_0x46bedd[_0xa0e2('0x33')]));if(_0x3e8b55[_0xa0e2('0x31')]['filter']){_0x193704[_0xa0e2('0x3f')]=_[_0xa0e2('0x40')](_0x193704[_0xa0e2('0x3f')],{'$or':_['map'](_0x193704[_0xa0e2('0x35')],function(_0x4d311f){var _0x2dac46={};_0x2dac46[_0x4d311f]={'$like':'%'+_0x3e8b55[_0xa0e2('0x31')][_0xa0e2('0x3e')]+'%'};return _0x2dac46;})});}_0x193704=_[_0xa0e2('0x40')]({},_0x193704,_0x3e8b55[_0xa0e2('0x42')]);return _0x4c8e8c['getAgents'](_0x193704);}})[_0xa0e2('0x27')](function(_0x14bcc1){if(_0x14bcc1){_0x10b892=_0x14bcc1[_0xa0e2('0x37')];if(!_0x3e8b55['query'][_0xa0e2('0x38')](_0xa0e2('0x39'))){_0x193704[_0xa0e2('0x3a')]=qs[_0xa0e2('0x3a')](_0x3e8b55[_0xa0e2('0x31')][_0xa0e2('0x3a')]);_0x193704[_0xa0e2('0x1f')]=qs[_0xa0e2('0x1f')](_0x3e8b55[_0xa0e2('0x31')][_0xa0e2('0x1f')]);}return _0x4c8e8c[_0xa0e2('0x8a')](_0x193704);}})[_0xa0e2('0x27')](function(_0x13e10f){if(_0x13e10f){return _0x13e10f?{'count':_0x10b892,'rows':_0x13e10f}:null;}})[_0xa0e2('0x27')](respondWithResult(_0x4ed46b,null))[_0xa0e2('0x46')](handleError(_0x4ed46b,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 1b94397..9b383ab 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 _0x8f01=['../../mysqldb','SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x25d1c0,_0x3d69ff){var _0x35233a=function(_0x14731c){while(--_0x14731c){_0x25d1c0['push'](_0x25d1c0['shift']());}};_0x35233a(++_0x3d69ff);}(_0x8f01,0x143));var _0x18f0=function(_0x23e6bb,_0x5c2d69){_0x23e6bb=_0x23e6bb-0x0;var _0x1e3b4c=_0x8f01[_0x23e6bb];return _0x1e3b4c;};'use strict';var EventEmitter=require(_0x18f0('0x0'));var SmsQueue=require(_0x18f0('0x1'))['db'][_0x18f0('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x18f0('0x3')](0x0);var events={'afterCreate':_0x18f0('0x4'),'afterUpdate':'update','afterDestroy':_0x18f0('0x5')};function emitEvent(_0x590ab6){return function(_0xc275b7,_0x4db2e0,_0x328807){SmsQueueEvents[_0x18f0('0x6')](_0x590ab6+':'+_0xc275b7['id'],_0xc275b7);SmsQueueEvents['emit'](_0x590ab6,_0xc275b7);_0x328807(null);};}for(var e in events){if(events[_0x18f0('0x7')](e)){var event=events[e];SmsQueue[_0x18f0('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x806c=['../../mysqldb','SmsQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4a0c8d,_0x404644){var _0x84c411=function(_0x3839f3){while(--_0x3839f3){_0x4a0c8d['push'](_0x4a0c8d['shift']());}};_0x84c411(++_0x404644);}(_0x806c,0x17b));var _0xc806=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x806c[_0x2a6809];return _0x11c371;};'use strict';var EventEmitter=require(_0xc806('0x0'));var SmsQueue=require(_0xc806('0x1'))['db'][_0xc806('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc806('0x3'),'afterUpdate':_0xc806('0x4'),'afterDestroy':_0xc806('0x5')};function emitEvent(_0x1a47f7){return function(_0x5786e7,_0x299768,_0x456633){SmsQueueEvents[_0xc806('0x6')](_0x1a47f7+':'+_0x5786e7['id'],_0x5786e7);SmsQueueEvents[_0xc806('0x6')](_0x1a47f7,_0x5786e7);_0x456633(null);};}for(var e in events){if(events[_0xc806('0x7')](e)){var event=events[e];SmsQueue[_0xc806('0x8')](e,emitEvent(event));}}module[_0xc806('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index bf1934e..65d9d35 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 _0x6488=['../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','api','request-promise'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0x6488,0x165));var _0x8648=function(_0x14ca26,_0xf6f7c2){_0x14ca26=_0x14ca26-0x0;var _0x2061e9=_0x6488[_0x14ca26];return _0x2061e9;};'use strict';var _=require(_0x8648('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8648('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8648('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8648('0x3'));var attributes=require(_0x8648('0x4'));module[_0x8648('0x5')]=function(_0x3a46ab,_0x334d8e){return _0x3a46ab[_0x8648('0x6')](_0x8648('0x7'),attributes,{'tableName':_0x8648('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47a3=['SmsQueue','sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./smsQueue.attributes','exports','define'];(function(_0x2c4440,_0x4fe366){var _0x20f1dd=function(_0x7495a5){while(--_0x7495a5){_0x2c4440['push'](_0x2c4440['shift']());}};_0x20f1dd(++_0x4fe366);}(_0x47a3,0x13a));var _0x347a=function(_0x4f161b,_0x25c9a5){_0x4f161b=_0x4f161b-0x0;var _0x5d83da=_0x47a3[_0x4f161b];return _0x5d83da;};'use strict';var _=require(_0x347a('0x0'));var util=require('util');var logger=require(_0x347a('0x1'))(_0x347a('0x2'));var moment=require(_0x347a('0x3'));var BPromise=require(_0x347a('0x4'));var rp=require(_0x347a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x347a('0x6'));var config=require('../../config/environment');var attributes=require(_0x347a('0x7'));module[_0x347a('0x8')]=function(_0x428b88,_0x3318c2){return _0x428b88[_0x347a('0x9')](_0x347a('0xa'),attributes,{'tableName':_0x347a('0xb'),'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 5995908..b9b4d62 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 _0x5952=['then','ShowSmsQueue','SmsQueue','find','raw','where','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','localhost','redis','register','request','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetSmsQueue','findAll','options','attributes','limit','include','model','map'];(function(_0x569caa,_0x5174ce){var _0x44cb5a=function(_0x456df4){while(--_0x456df4){_0x569caa['push'](_0x569caa['shift']());}};_0x44cb5a(++_0x5174ce);}(_0x5952,0x192));var _0x2595=function(_0x50e93c,_0xe8be2d){_0x50e93c=_0x50e93c-0x0;var _0x43766c=_0x5952[_0x50e93c];return _0x43766c;};'use strict';var _=require('lodash');var util=require(_0x2595('0x0'));var moment=require(_0x2595('0x1'));var BPromise=require(_0x2595('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2595('0x3'));var logger=require(_0x2595('0x4'))(_0x2595('0x5'));var config=require(_0x2595('0x6'));var jayson=require(_0x2595('0x7'));var client=jayson[_0x2595('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x2595('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2595('0xa')]));require('./smsQueue.socket')[_0x2595('0xb')](socket);function respondWithRpcPromise(_0xa586cb,_0x54ef4,_0x329ecd){return new BPromise(function(_0x5d0e4b,_0x2281db){return client[_0x2595('0xc')](_0xa586cb,_0x329ecd)['then'](function(_0x52914f){logger['info'](_0x2595('0xd'),_0x54ef4,_0x2595('0xe'));logger[_0x2595('0xf')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x54ef4,'request\x20sent',JSON[_0x2595('0x10')](_0x52914f));if(_0x52914f[_0x2595('0x11')]){if(_0x52914f[_0x2595('0x11')]['code']===0x1f4){logger[_0x2595('0x11')](_0x2595('0xd'),_0x54ef4,_0x52914f['error'][_0x2595('0x12')]);return _0x2281db(_0x52914f['error']['message']);}logger[_0x2595('0x11')](_0x2595('0xd'),_0x54ef4,_0x52914f[_0x2595('0x11')][_0x2595('0x12')]);return _0x5d0e4b(_0x52914f[_0x2595('0x11')]['message']);}else{logger[_0x2595('0x13')]('SmsQueue,\x20%s,\x20%s',_0x54ef4,'request\x20sent');_0x5d0e4b(_0x52914f[_0x2595('0x14')][_0x2595('0x12')]);}})[_0x2595('0x15')](function(_0x19cb28){logger[_0x2595('0x11')]('SmsQueue,\x20%s,\x20%s',_0x54ef4,_0x19cb28);_0x2281db(_0x19cb28);});});}exports[_0x2595('0x16')]=function(_0x2b29eb){var _0x3cb413=this;return new Promise(function(_0x1fda07,_0x475c31){return db['SmsQueue'][_0x2595('0x17')]({'raw':_0x2b29eb[_0x2595('0x18')]?_0x2b29eb[_0x2595('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2b29eb['options']?_0x2b29eb[_0x2595('0x18')]['where']||null:null,'attributes':_0x2b29eb[_0x2595('0x18')]?_0x2b29eb[_0x2595('0x18')][_0x2595('0x19')]||null:null,'limit':_0x2b29eb[_0x2595('0x18')]?_0x2b29eb[_0x2595('0x18')][_0x2595('0x1a')]||null:null,'include':_0x2b29eb['options']?_0x2b29eb[_0x2595('0x18')][_0x2595('0x1b')]?_['map'](_0x2b29eb[_0x2595('0x18')][_0x2595('0x1b')],function(_0x3b6182){return{'model':db[_0x3b6182[_0x2595('0x1c')]],'as':_0x3b6182['as'],'attributes':_0x3b6182['attributes'],'include':_0x3b6182[_0x2595('0x1b')]?_[_0x2595('0x1d')](_0x3b6182['include'],function(_0x1ba9ae){return{'model':db[_0x1ba9ae[_0x2595('0x1c')]],'as':_0x1ba9ae['as'],'attributes':_0x1ba9ae[_0x2595('0x19')],'include':_0x1ba9ae[_0x2595('0x1b')]?_[_0x2595('0x1d')](_0x1ba9ae[_0x2595('0x1b')],function(_0x18c137){return{'model':db[_0x18c137['model']],'as':_0x18c137['as'],'attributes':_0x18c137[_0x2595('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2595('0x1e')](function(_0x4ab40e){logger[_0x2595('0x13')](_0x2595('0x16'),_0x2b29eb);logger[_0x2595('0xf')](_0x2595('0x16'),_0x2b29eb,JSON['stringify'](_0x4ab40e));_0x1fda07(_0x4ab40e);})[_0x2595('0x15')](function(_0x4d798a){logger[_0x2595('0x11')](_0x2595('0x16'),_0x4d798a['message'],_0x2b29eb);_0x475c31(_0x3cb413[_0x2595('0x11')](0x1f4,_0x4d798a['message']));});});};exports[_0x2595('0x1f')]=function(_0x399dd5){var _0x3969a9=this;return new Promise(function(_0x52b3a8,_0x43e8f8){return db[_0x2595('0x20')][_0x2595('0x21')]({'raw':_0x399dd5[_0x2595('0x18')]?_0x399dd5[_0x2595('0x18')][_0x2595('0x22')]===undefined?!![]:![]:!![],'where':_0x399dd5['options']?_0x399dd5[_0x2595('0x18')][_0x2595('0x23')]||null:null,'attributes':_0x399dd5[_0x2595('0x18')]?_0x399dd5['options'][_0x2595('0x19')]||null:null,'include':_0x399dd5[_0x2595('0x18')]?_0x399dd5[_0x2595('0x18')]['include']?_[_0x2595('0x1d')](_0x399dd5['options'][_0x2595('0x1b')],function(_0x15db09){return{'model':db[_0x15db09[_0x2595('0x1c')]],'as':_0x15db09['as'],'attributes':_0x15db09[_0x2595('0x19')],'include':_0x15db09[_0x2595('0x1b')]?_[_0x2595('0x1d')](_0x15db09[_0x2595('0x1b')],function(_0x2d5261){return{'model':db[_0x2d5261['model']],'as':_0x2d5261['as'],'attributes':_0x2d5261[_0x2595('0x19')],'include':_0x2d5261[_0x2595('0x1b')]?_['map'](_0x2d5261['include'],function(_0x43aabb){return{'model':db[_0x43aabb[_0x2595('0x1c')]],'as':_0x43aabb['as'],'attributes':_0x43aabb[_0x2595('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2595('0x1e')](function(_0x9223f2){logger[_0x2595('0x13')](_0x2595('0x1f'),_0x399dd5);logger['debug'](_0x2595('0x1f'),_0x399dd5,JSON[_0x2595('0x10')](_0x9223f2));_0x52b3a8(_0x9223f2);})[_0x2595('0x15')](function(_0x4da382){logger['error']('ShowSmsQueue',_0x4da382[_0x2595('0x12')],_0x399dd5);_0x43e8f8(_0x3969a9['error'](0x1f4,_0x4da382[_0x2595('0x12')]));});});}; \ No newline at end of file +var _0x5aab=['http','redis','defaults','register','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','info','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','ShowSmsQueue','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x548f68,_0x2db63e){var _0x1adf80=function(_0x5b08e6){while(--_0x5b08e6){_0x548f68['push'](_0x548f68['shift']());}};_0x1adf80(++_0x2db63e);}(_0x5aab,0x154));var _0xb5aa=function(_0x11c7bc,_0x5a7b4c){_0x11c7bc=_0x11c7bc-0x0;var _0x1289df=_0x5aab[_0x11c7bc];return _0x1289df;};'use strict';var _=require(_0xb5aa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb5aa('0x1'));var rs=require(_0xb5aa('0x2'));var fs=require('fs');var Redis=require(_0xb5aa('0x3'));var db=require(_0xb5aa('0x4'))['db'];var utils=require(_0xb5aa('0x5'));var logger=require(_0xb5aa('0x6'))(_0xb5aa('0x7'));var config=require(_0xb5aa('0x8'));var jayson=require(_0xb5aa('0x9'));var client=jayson[_0xb5aa('0xa')][_0xb5aa('0xb')]({'port':0x232a});config[_0xb5aa('0xc')]=_[_0xb5aa('0xd')](config[_0xb5aa('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb5aa('0xc')]));require('./smsQueue.socket')[_0xb5aa('0xe')](socket);function respondWithRpcPromise(_0xf768c2,_0x2091d5,_0xf33f7b){return new BPromise(function(_0x3ce25c,_0x206b28){return client['request'](_0xf768c2,_0xf33f7b)['then'](function(_0x6ca673){logger['info']('SmsQueue,\x20%s,\x20%s',_0x2091d5,_0xb5aa('0xf'));logger[_0xb5aa('0x10')](_0xb5aa('0x11'),_0x2091d5,_0xb5aa('0xf'),JSON[_0xb5aa('0x12')](_0x6ca673));if(_0x6ca673[_0xb5aa('0x13')]){if(_0x6ca673['error'][_0xb5aa('0x14')]===0x1f4){logger[_0xb5aa('0x13')](_0xb5aa('0x15'),_0x2091d5,_0x6ca673[_0xb5aa('0x13')][_0xb5aa('0x16')]);return _0x206b28(_0x6ca673[_0xb5aa('0x13')][_0xb5aa('0x16')]);}logger[_0xb5aa('0x13')](_0xb5aa('0x15'),_0x2091d5,_0x6ca673[_0xb5aa('0x13')][_0xb5aa('0x16')]);return _0x3ce25c(_0x6ca673['error'][_0xb5aa('0x16')]);}else{logger[_0xb5aa('0x17')](_0xb5aa('0x15'),_0x2091d5,_0xb5aa('0xf'));_0x3ce25c(_0x6ca673['result'][_0xb5aa('0x16')]);}})[_0xb5aa('0x18')](function(_0x324d51){logger['error'](_0xb5aa('0x15'),_0x2091d5,_0x324d51);_0x206b28(_0x324d51);});});}exports[_0xb5aa('0x19')]=function(_0x178c37){var _0x4b0696=this;return new Promise(function(_0x3dd0d5,_0x1ec3f0){return db[_0xb5aa('0x1a')][_0xb5aa('0x1b')]({'raw':_0x178c37['options']?_0x178c37[_0xb5aa('0x1c')][_0xb5aa('0x1d')]===undefined?!![]:![]:!![],'where':_0x178c37['options']?_0x178c37[_0xb5aa('0x1c')][_0xb5aa('0x1e')]||null:null,'attributes':_0x178c37['options']?_0x178c37['options']['attributes']||null:null,'limit':_0x178c37[_0xb5aa('0x1c')]?_0x178c37[_0xb5aa('0x1c')][_0xb5aa('0x1f')]||null:null,'include':_0x178c37[_0xb5aa('0x1c')]?_0x178c37[_0xb5aa('0x1c')][_0xb5aa('0x20')]?_[_0xb5aa('0x21')](_0x178c37['options'][_0xb5aa('0x20')],function(_0xf0ffb4){return{'model':db[_0xf0ffb4[_0xb5aa('0x22')]],'as':_0xf0ffb4['as'],'attributes':_0xf0ffb4[_0xb5aa('0x23')],'include':_0xf0ffb4[_0xb5aa('0x20')]?_['map'](_0xf0ffb4[_0xb5aa('0x20')],function(_0x127148){return{'model':db[_0x127148[_0xb5aa('0x22')]],'as':_0x127148['as'],'attributes':_0x127148[_0xb5aa('0x23')],'include':_0x127148[_0xb5aa('0x20')]?_[_0xb5aa('0x21')](_0x127148[_0xb5aa('0x20')],function(_0x35388c){return{'model':db[_0x35388c[_0xb5aa('0x22')]],'as':_0x35388c['as'],'attributes':_0x35388c['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5aa('0x24')](function(_0x4b0db9){logger[_0xb5aa('0x17')](_0xb5aa('0x19'),_0x178c37);logger[_0xb5aa('0x10')](_0xb5aa('0x19'),_0x178c37,JSON['stringify'](_0x4b0db9));_0x3dd0d5(_0x4b0db9);})[_0xb5aa('0x18')](function(_0x1e4bad){logger[_0xb5aa('0x13')](_0xb5aa('0x19'),_0x1e4bad['message'],_0x178c37);_0x1ec3f0(_0x4b0696[_0xb5aa('0x13')](0x1f4,_0x1e4bad['message']));});});};exports[_0xb5aa('0x25')]=function(_0x3ecb9d){var _0x3136a3=this;return new Promise(function(_0x2d0823,_0xf3bdc3){return db['SmsQueue'][_0xb5aa('0x26')]({'raw':_0x3ecb9d[_0xb5aa('0x1c')]?_0x3ecb9d[_0xb5aa('0x1c')][_0xb5aa('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ecb9d[_0xb5aa('0x1c')]?_0x3ecb9d['options'][_0xb5aa('0x1e')]||null:null,'attributes':_0x3ecb9d[_0xb5aa('0x1c')]?_0x3ecb9d[_0xb5aa('0x1c')][_0xb5aa('0x23')]||null:null,'include':_0x3ecb9d[_0xb5aa('0x1c')]?_0x3ecb9d['options'][_0xb5aa('0x20')]?_[_0xb5aa('0x21')](_0x3ecb9d[_0xb5aa('0x1c')][_0xb5aa('0x20')],function(_0xfe5594){return{'model':db[_0xfe5594[_0xb5aa('0x22')]],'as':_0xfe5594['as'],'attributes':_0xfe5594[_0xb5aa('0x23')],'include':_0xfe5594['include']?_['map'](_0xfe5594[_0xb5aa('0x20')],function(_0x33cbe0){return{'model':db[_0x33cbe0[_0xb5aa('0x22')]],'as':_0x33cbe0['as'],'attributes':_0x33cbe0['attributes'],'include':_0x33cbe0['include']?_[_0xb5aa('0x21')](_0x33cbe0[_0xb5aa('0x20')],function(_0x1d9d21){return{'model':db[_0x1d9d21[_0xb5aa('0x22')]],'as':_0x1d9d21['as'],'attributes':_0x1d9d21[_0xb5aa('0x23')]};}):[]};}):[]};}):[]:[]})[_0xb5aa('0x24')](function(_0x306dc4){logger[_0xb5aa('0x17')](_0xb5aa('0x25'),_0x3ecb9d);logger[_0xb5aa('0x10')](_0xb5aa('0x25'),_0x3ecb9d,JSON[_0xb5aa('0x12')](_0x306dc4));_0x2d0823(_0x306dc4);})[_0xb5aa('0x18')](function(_0x42f387){logger[_0xb5aa('0x13')](_0xb5aa('0x25'),_0x42f387[_0xb5aa('0x16')],_0x3ecb9d);_0xf3bdc3(_0x3136a3[_0xb5aa('0x13')](0x1f4,_0x42f387[_0xb5aa('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index d1ce061..446058b 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 _0x50e5=['update','emit','removeListener','register','length','smsQueue:','save','remove'];(function(_0x481ddc,_0x1517cf){var _0x449c7f=function(_0x5ccb21){while(--_0x5ccb21){_0x481ddc['push'](_0x481ddc['shift']());}};_0x449c7f(++_0x1517cf);}(_0x50e5,0xe6));var _0x550e=function(_0x4a3457,_0x235beb){_0x4a3457=_0x4a3457-0x0;var _0x4e37d4=_0x50e5[_0x4a3457];return _0x4e37d4;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x550e('0x0'),_0x550e('0x1'),_0x550e('0x2')];function createListener(_0x3bfd25,_0x3ef920){return function(_0x38d364){_0x3ef920[_0x550e('0x3')](_0x3bfd25,_0x38d364);};}function removeListener(_0x24f9c0,_0xb7ba86){return function(){SmsQueueEvents[_0x550e('0x4')](_0x24f9c0,_0xb7ba86);};}exports[_0x550e('0x5')]=function(_0x412286){for(var _0xf7ce95=0x0,_0x327a63=events[_0x550e('0x6')];_0xf7ce95<_0x327a63;_0xf7ce95++){var _0x5128e1=events[_0xf7ce95];var _0x1d685e=createListener(_0x550e('0x7')+_0x5128e1,_0x412286);SmsQueueEvents['on'](_0x5128e1,_0x1d685e);}}; \ No newline at end of file +var _0x794f=['removeListener','register','length','./smsQueue.events','save','update','emit'];(function(_0x5c29a7,_0x32c104){var _0x4e0a60=function(_0x3f01b4){while(--_0x3f01b4){_0x5c29a7['push'](_0x5c29a7['shift']());}};_0x4e0a60(++_0x32c104);}(_0x794f,0x1d8));var _0xf794=function(_0x545c61,_0x98f72d){_0x545c61=_0x545c61-0x0;var _0xf3b0b1=_0x794f[_0x545c61];return _0xf3b0b1;};'use strict';var SmsQueueEvents=require(_0xf794('0x0'));var events=[_0xf794('0x1'),'remove',_0xf794('0x2')];function createListener(_0x4a4aef,_0x2d3ae2){return function(_0x50ce52){_0x2d3ae2[_0xf794('0x3')](_0x4a4aef,_0x50ce52);};}function removeListener(_0x512831,_0x4d2860){return function(){SmsQueueEvents[_0xf794('0x4')](_0x512831,_0x4d2860);};}exports[_0xf794('0x5')]=function(_0x3cacb7){for(var _0x25370d=0x0,_0x4da621=events[_0xf794('0x6')];_0x25370d<_0x4da621;_0x25370d++){var _0x235abf=events[_0x25370d];var _0x304e97=createListener('smsQueue:'+_0x235abf,_0x3cacb7);SmsQueueEvents['on'](_0x235abf,_0x304e97);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index bf67b3e..68164f9 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 _0x27bd=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','destroy','multer','express'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0x27bd,0x11e));var _0xd27b=function(_0x4f425d,_0xab48f2){_0x4f425d=_0x4f425d-0x0;var _0x1e62df=_0x27bd[_0x4f425d];return _0x1e62df;};'use strict';var multer=require(_0xd27b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd27b('0x1'));var router=express[_0xd27b('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd27b('0x3'));var config=require(_0xd27b('0x4'));var controller=require('./smsQueueReport.controller');router[_0xd27b('0x5')]('/',auth[_0xd27b('0x6')](),controller[_0xd27b('0x7')]);router['get'](_0xd27b('0x8'),auth['isAuthenticated'](),controller[_0xd27b('0x9')]);router['get'](_0xd27b('0xa'),auth[_0xd27b('0x6')](),controller['show']);router[_0xd27b('0xb')]('/',auth[_0xd27b('0x6')](),controller[_0xd27b('0xc')]);router[_0xd27b('0xd')](_0xd27b('0xa'),auth[_0xd27b('0x6')](),controller['update']);router[_0xd27b('0xe')](_0xd27b('0xa'),auth[_0xd27b('0x6')](),controller[_0xd27b('0xf')]);module['exports']=router; \ No newline at end of file +var _0xc8ba=['../../components/interaction/service','./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xc8ba,0x186));var _0xac8b=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0xc8ba[_0x2fb87c];return _0x43038b;};'use strict';var multer=require(_0xac8b('0x0'));var util=require(_0xac8b('0x1'));var path=require(_0xac8b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xac8b('0x3')]();var fs_extra=require(_0xac8b('0x4'));var auth=require(_0xac8b('0x5'));var interaction=require(_0xac8b('0x6'));var config=require('../../config/environment');var controller=require(_0xac8b('0x7'));router[_0xac8b('0x8')]('/',auth['isAuthenticated'](),controller[_0xac8b('0x9')]);router['get'](_0xac8b('0xa'),auth[_0xac8b('0xb')](),controller[_0xac8b('0xc')]);router['get'](_0xac8b('0xd'),auth[_0xac8b('0xb')](),controller[_0xac8b('0xe')]);router[_0xac8b('0xf')]('/',auth[_0xac8b('0xb')](),controller[_0xac8b('0x10')]);router[_0xac8b('0x11')](_0xac8b('0xd'),auth[_0xac8b('0xb')](),controller[_0xac8b('0x12')]);router[_0xac8b('0x13')](_0xac8b('0xd'),auth['isAuthenticated'](),controller[_0xac8b('0x14')]);module[_0xac8b('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 1e98639..56f7568 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 _0x2c1a=['STRING','DATE','moment','sequelize'];(function(_0x20229e,_0xa59f8a){var _0x317377=function(_0x290697){while(--_0x290697){_0x20229e['push'](_0x20229e['shift']());}};_0x317377(++_0xa59f8a);}(_0x2c1a,0x96));var _0xa2c1=function(_0x5efa49,_0x474f64){_0x5efa49=_0x5efa49-0x0;var _0x2ff7f0=_0x2c1a[_0x5efa49];return _0x2ff7f0;};'use strict';var moment=require(_0xa2c1('0x0'));var Sequelize=require(_0xa2c1('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xa2c1('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa2c1('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa2c1('0x2')]}}; \ No newline at end of file +var _0x6b27=['STRING','DATE','moment','sequelize'];(function(_0x3805a4,_0x535964){var _0x5b4a36=function(_0x42cb87){while(--_0x42cb87){_0x3805a4['push'](_0x3805a4['shift']());}};_0x5b4a36(++_0x535964);}(_0x6b27,0x176));var _0x76b2=function(_0xb3b609,_0x32de47){_0xb3b609=_0xb3b609-0x0;var _0x14fd01=_0x6b27[_0xb3b609];return _0x14fd01;};'use strict';var moment=require(_0x76b2('0x0'));var Sequelize=require(_0x76b2('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x76b2('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x76b2('0x2')]},'joinAt':{'type':Sequelize[_0x76b2('0x3')]},'leaveAt':{'type':Sequelize[_0x76b2('0x3')]},'acceptAt':{'type':Sequelize[_0x76b2('0x3')]},'exitAt':{'type':Sequelize[_0x76b2('0x3')]},'reason':{'type':Sequelize[_0x76b2('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index b19360d..6a1a66c 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 _0x1abf=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x1abf,0x122));var _0xf1ab=function(_0x360bb0,_0x1fdae7){_0x360bb0=_0x360bb0-0x0;var _0x4b6684=_0x1abf[_0x360bb0];return _0x4b6684;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1ab('0x0'));var zipdir=require(_0xf1ab('0x1'));var jsonpatch=require(_0xf1ab('0x2'));var rp=require(_0xf1ab('0x3'));var moment=require(_0xf1ab('0x4'));var BPromise=require(_0xf1ab('0x5'));var Mustache=require(_0xf1ab('0x6'));var util=require(_0xf1ab('0x7'));var path=require(_0xf1ab('0x8'));var sox=require(_0xf1ab('0x9'));var csv=require('to-csv');var ejs=require(_0xf1ab('0xa'));var fs=require('fs');var fs_extra=require(_0xf1ab('0xb'));var _=require(_0xf1ab('0xc'));var squel=require(_0xf1ab('0xd'));var crypto=require(_0xf1ab('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf1ab('0xf'));var toCsv=require(_0xf1ab('0x10'));var querystring=require('querystring');var Papa=require(_0xf1ab('0x11'));var Redis=require(_0xf1ab('0x12'));var authService=require(_0xf1ab('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf1ab('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1ab('0x15'))(_0xf1ab('0x16'));var utils=require(_0xf1ab('0x17'));var config=require(_0xf1ab('0x18'));var licenseUtil=require(_0xf1ab('0x19'));var db=require(_0xf1ab('0x1a'))['db'];function respondWithStatusCode(_0x2070ac,_0x5e54dd){_0x5e54dd=_0x5e54dd||0xcc;return function(_0x3f2a43){if(_0x3f2a43){return _0x2070ac[_0xf1ab('0x1b')](_0x5e54dd);}return _0x2070ac[_0xf1ab('0x1c')](_0x5e54dd)[_0xf1ab('0x1d')]();};}function respondWithResult(_0x5dda49,_0x2e24c0){_0x2e24c0=_0x2e24c0||0xc8;return function(_0x583e98){if(_0x583e98){return _0x5dda49[_0xf1ab('0x1c')](_0x2e24c0)[_0xf1ab('0x1e')](_0x583e98);}};}function respondWithFilteredResult(_0x406bb7,_0x5c5650){return function(_0x3b28ab){if(_0x3b28ab){var _0x1b8113=typeof _0x5c5650[_0xf1ab('0x1f')]===_0xf1ab('0x20')&&typeof _0x5c5650[_0xf1ab('0x21')]===_0xf1ab('0x20');var _0x237d25=_0x3b28ab[_0xf1ab('0x22')];var _0x551f91=_0x1b8113?0x0:_0x5c5650[_0xf1ab('0x1f')];var _0xcfb462=_0x1b8113?_0x3b28ab['count']:_0x5c5650[_0xf1ab('0x1f')]+_0x5c5650[_0xf1ab('0x21')];var _0x5a6b50;if(_0xcfb462>=_0x237d25){_0xcfb462=_0x237d25;_0x5a6b50=0xc8;}else{_0x5a6b50=0xce;}_0x406bb7[_0xf1ab('0x1c')](_0x5a6b50);return _0x406bb7[_0xf1ab('0x23')](_0xf1ab('0x24'),_0x551f91+'-'+_0xcfb462+'/'+_0x237d25)[_0xf1ab('0x1e')](_0x3b28ab);}return null;};}function patchUpdates(_0x4b0b4d){return function(_0x22c1ba){try{jsonpatch[_0xf1ab('0x25')](_0x22c1ba,_0x4b0b4d,!![]);}catch(_0x1f403e){return BPromise[_0xf1ab('0x26')](_0x1f403e);}return _0x22c1ba['save']();};}function saveUpdates(_0x2067e7,_0x14520d){return function(_0x37b11c){if(_0x37b11c){return _0x37b11c['update'](_0x2067e7)[_0xf1ab('0x27')](function(_0x5608e8){return _0x5608e8;});}return null;};}function removeEntity(_0xabdc11,_0x1c081b){return function(_0x24ed3b){if(_0x24ed3b){return _0x24ed3b['destroy']()[_0xf1ab('0x27')](function(){_0xabdc11['status'](0xcc)[_0xf1ab('0x1d')]();});}};}function handleEntityNotFound(_0x2dd927,_0x2bc6ba){return function(_0x13a3e4){if(!_0x13a3e4){_0x2dd927[_0xf1ab('0x1b')](0x194);}return _0x13a3e4;};}function handleError(_0x1ac480,_0x5a222b){_0x5a222b=_0x5a222b||0x1f4;return function(_0x389a2c){logger[_0xf1ab('0x28')](_0x389a2c[_0xf1ab('0x29')]);if(_0x389a2c[_0xf1ab('0x2a')]){delete _0x389a2c['name'];}_0x1ac480[_0xf1ab('0x1c')](_0x5a222b)[_0xf1ab('0x2b')](_0x389a2c);};}exports[_0xf1ab('0x2c')]=function(_0x1fc3c9,_0x1212fd){var _0x38023d={},_0x4ab17a={},_0x47c51f={'count':0x0,'rows':[]};var _0x37fc18=_['map'](db[_0xf1ab('0x2d')][_0xf1ab('0x2e')],function(_0x451a43){return{'name':_0x451a43[_0xf1ab('0x2f')],'type':_0x451a43[_0xf1ab('0x30')]['key']};});_0x4ab17a[_0xf1ab('0x31')]=_['map'](_0x37fc18,_0xf1ab('0x2a'));_0x4ab17a[_0xf1ab('0x32')]=_['keys'](_0x1fc3c9[_0xf1ab('0x32')]);_0x4ab17a[_0xf1ab('0x33')]=_[_0xf1ab('0x34')](_0x4ab17a[_0xf1ab('0x31')],_0x4ab17a['query']);_0x38023d[_0xf1ab('0x35')]=_[_0xf1ab('0x34')](_0x4ab17a['model'],qs[_0xf1ab('0x36')](_0x1fc3c9[_0xf1ab('0x32')]['fields']));_0x38023d[_0xf1ab('0x35')]=_0x38023d['attributes']['length']?_0x38023d['attributes']:_0x4ab17a['model'];if(!_0x1fc3c9[_0xf1ab('0x32')][_0xf1ab('0x37')](_0xf1ab('0x38'))){_0x38023d[_0xf1ab('0x21')]=qs['limit'](_0x1fc3c9[_0xf1ab('0x32')]['limit']);_0x38023d[_0xf1ab('0x1f')]=qs['offset'](_0x1fc3c9[_0xf1ab('0x32')]['offset']);}_0x38023d['order']=qs['sort'](_0x1fc3c9[_0xf1ab('0x32')][_0xf1ab('0x39')]);_0x38023d[_0xf1ab('0x3a')]=qs[_0xf1ab('0x33')](_[_0xf1ab('0x3b')](_0x1fc3c9['query'],_0x4ab17a[_0xf1ab('0x33')]),_0x37fc18);if(_0x1fc3c9['query']['filter']){_0x38023d[_0xf1ab('0x3a')]=_[_0xf1ab('0x3c')](_0x38023d[_0xf1ab('0x3a')],{'$or':_[_0xf1ab('0x3d')](_0x37fc18,function(_0x55ebcb){if(_0x55ebcb[_0xf1ab('0x30')]!==_0xf1ab('0x3e')){var _0x1a4583={};_0x1a4583[_0x55ebcb[_0xf1ab('0x2a')]]={'$like':'%'+_0x1fc3c9[_0xf1ab('0x32')]['filter']+'%'};return _0x1a4583;}})});}_0x38023d=_[_0xf1ab('0x3c')]({},_0x38023d,_0x1fc3c9[_0xf1ab('0x3f')]);var _0x54f0cd={'where':_0x38023d['where']};return db[_0xf1ab('0x2d')][_0xf1ab('0x22')](_0x54f0cd)[_0xf1ab('0x27')](function(_0x10ba69){_0x47c51f[_0xf1ab('0x22')]=_0x10ba69;if(_0x1fc3c9['query'][_0xf1ab('0x40')]){_0x38023d[_0xf1ab('0x41')]=[{'all':!![]}];}return db[_0xf1ab('0x2d')][_0xf1ab('0x42')](_0x38023d);})[_0xf1ab('0x27')](function(_0x561421){_0x47c51f[_0xf1ab('0x43')]=_0x561421;return _0x47c51f;})[_0xf1ab('0x27')](respondWithFilteredResult(_0x1212fd,_0x38023d))[_0xf1ab('0x44')](handleError(_0x1212fd,null));};exports['show']=function(_0x27573b,_0x15139a){var _0x5136a8={'raw':!![],'where':{'id':_0x27573b[_0xf1ab('0x45')]['id']}},_0x33dcf2={};_0x33dcf2[_0xf1ab('0x31')]=_[_0xf1ab('0x46')](db['SmsQueueReport']['rawAttributes']);_0x33dcf2[_0xf1ab('0x32')]=_[_0xf1ab('0x46')](_0x27573b['query']);_0x33dcf2['filters']=_['intersection'](_0x33dcf2[_0xf1ab('0x31')],_0x33dcf2[_0xf1ab('0x32')]);_0x5136a8[_0xf1ab('0x35')]=_[_0xf1ab('0x34')](_0x33dcf2[_0xf1ab('0x31')],qs['fields'](_0x27573b[_0xf1ab('0x32')]['fields']));_0x5136a8[_0xf1ab('0x35')]=_0x5136a8['attributes'][_0xf1ab('0x47')]?_0x5136a8[_0xf1ab('0x35')]:_0x33dcf2['model'];if(_0x27573b['query'][_0xf1ab('0x40')]){_0x5136a8[_0xf1ab('0x41')]=[{'all':!![]}];}_0x5136a8=_[_0xf1ab('0x3c')]({},_0x5136a8,_0x27573b['options']);return db['SmsQueueReport'][_0xf1ab('0x48')](_0x5136a8)[_0xf1ab('0x27')](handleEntityNotFound(_0x15139a,null))[_0xf1ab('0x27')](respondWithResult(_0x15139a,null))[_0xf1ab('0x44')](handleError(_0x15139a,null));};exports[_0xf1ab('0x49')]=function(_0x4daefd,_0x44095d){return db[_0xf1ab('0x2d')][_0xf1ab('0x49')](_0x4daefd[_0xf1ab('0x4a')],{})['then'](respondWithResult(_0x44095d,0xc9))[_0xf1ab('0x44')](handleError(_0x44095d,null));};exports[_0xf1ab('0x4b')]=function(_0x1374fa,_0x4d7527){if(_0x1374fa[_0xf1ab('0x4a')]['id']){delete _0x1374fa[_0xf1ab('0x4a')]['id'];}return db[_0xf1ab('0x2d')][_0xf1ab('0x48')]({'where':{'id':_0x1374fa[_0xf1ab('0x45')]['id']}})['then'](handleEntityNotFound(_0x4d7527,null))['then'](saveUpdates(_0x1374fa[_0xf1ab('0x4a')],null))['then'](respondWithResult(_0x4d7527,null))[_0xf1ab('0x44')](handleError(_0x4d7527,null));};exports[_0xf1ab('0x4c')]=function(_0x8335c5,_0x804610){return db[_0xf1ab('0x2d')]['find']({'where':{'id':_0x8335c5[_0xf1ab('0x45')]['id']}})[_0xf1ab('0x27')](handleEntityNotFound(_0x804610,null))['then'](removeEntity(_0x804610,null))[_0xf1ab('0x44')](handleError(_0x804610,null));};exports[_0xf1ab('0x4d')]=function(_0x2aa8c7,_0x25c4e2){return db[_0xf1ab('0x2d')][_0xf1ab('0x4d')]()[_0xf1ab('0x27')](respondWithResult(_0x25c4e2,null))['catch'](handleError(_0x25c4e2,null));}; \ No newline at end of file +var _0xe541=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','end','stack','name','send','map','SmsQueueReport','fieldName','key','query','attributes','intersection','fields','model','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x493c97,_0x3dcbc7){var _0x38f6fb=function(_0x23e68d){while(--_0x23e68d){_0x493c97['push'](_0x493c97['shift']());}};_0x38f6fb(++_0x3dcbc7);}(_0xe541,0x7d));var _0x1e54=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0xe541[_0x5774be];return _0x4914b4;};'use strict';var emlformat=require(_0x1e54('0x0'));var rimraf=require(_0x1e54('0x1'));var zipdir=require(_0x1e54('0x2'));var jsonpatch=require(_0x1e54('0x3'));var rp=require('request-promise');var moment=require(_0x1e54('0x4'));var BPromise=require(_0x1e54('0x5'));var Mustache=require(_0x1e54('0x6'));var util=require(_0x1e54('0x7'));var path=require('path');var sox=require(_0x1e54('0x8'));var csv=require(_0x1e54('0x9'));var ejs=require(_0x1e54('0xa'));var fs=require('fs');var fs_extra=require(_0x1e54('0xb'));var _=require(_0x1e54('0xc'));var squel=require(_0x1e54('0xd'));var crypto=require(_0x1e54('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1e54('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1e54('0x10'));var Papa=require(_0x1e54('0x11'));var Redis=require('ioredis');var authService=require(_0x1e54('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1e54('0x13'));var hardwareService=require(_0x1e54('0x14'));var logger=require(_0x1e54('0x15'))(_0x1e54('0x16'));var utils=require(_0x1e54('0x17'));var config=require(_0x1e54('0x18'));var licenseUtil=require(_0x1e54('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b063e,_0x1e1ee4){_0x1e1ee4=_0x1e1ee4||0xcc;return function(_0x60ae06){if(_0x60ae06){return _0x4b063e[_0x1e54('0x1a')](_0x1e1ee4);}return _0x4b063e[_0x1e54('0x1b')](_0x1e1ee4)['end']();};}function respondWithResult(_0x4bdfdf,_0x52785f){_0x52785f=_0x52785f||0xc8;return function(_0x172790){if(_0x172790){return _0x4bdfdf[_0x1e54('0x1b')](_0x52785f)[_0x1e54('0x1c')](_0x172790);}};}function respondWithFilteredResult(_0x4baa31,_0x21c4f0){return function(_0x2b3ac2){if(_0x2b3ac2){var _0x4144e7=typeof _0x21c4f0['offset']===_0x1e54('0x1d')&&typeof _0x21c4f0[_0x1e54('0x1e')]==='undefined';var _0x564d3c=_0x2b3ac2['count'];var _0x49f835=_0x4144e7?0x0:_0x21c4f0['offset'];var _0x291365=_0x4144e7?_0x2b3ac2[_0x1e54('0x1f')]:_0x21c4f0[_0x1e54('0x20')]+_0x21c4f0[_0x1e54('0x1e')];var _0x6a878f;if(_0x291365>=_0x564d3c){_0x291365=_0x564d3c;_0x6a878f=0xc8;}else{_0x6a878f=0xce;}_0x4baa31[_0x1e54('0x1b')](_0x6a878f);return _0x4baa31['set'](_0x1e54('0x21'),_0x49f835+'-'+_0x291365+'/'+_0x564d3c)[_0x1e54('0x1c')](_0x2b3ac2);}return null;};}function patchUpdates(_0x1dde39){return function(_0x102e27){try{jsonpatch[_0x1e54('0x22')](_0x102e27,_0x1dde39,!![]);}catch(_0x33890f){return BPromise['reject'](_0x33890f);}return _0x102e27[_0x1e54('0x23')]();};}function saveUpdates(_0x563b30,_0x2acf41){return function(_0x252174){if(_0x252174){return _0x252174[_0x1e54('0x24')](_0x563b30)[_0x1e54('0x25')](function(_0x406ad9){return _0x406ad9;});}return null;};}function removeEntity(_0x5c95d6,_0x545255){return function(_0x492efa){if(_0x492efa){return _0x492efa[_0x1e54('0x26')]()[_0x1e54('0x25')](function(){_0x5c95d6[_0x1e54('0x1b')](0xcc)[_0x1e54('0x27')]();});}};}function handleEntityNotFound(_0x3d4e04,_0x496294){return function(_0x3efe52){if(!_0x3efe52){_0x3d4e04[_0x1e54('0x1a')](0x194);}return _0x3efe52;};}function handleError(_0x5b5574,_0x3e1f67){_0x3e1f67=_0x3e1f67||0x1f4;return function(_0x86f023){logger['error'](_0x86f023[_0x1e54('0x28')]);if(_0x86f023['name']){delete _0x86f023[_0x1e54('0x29')];}_0x5b5574[_0x1e54('0x1b')](_0x3e1f67)[_0x1e54('0x2a')](_0x86f023);};}exports['index']=function(_0x282865,_0x3812a2){var _0x328eac={},_0x5e509c={},_0x25dd3f={'count':0x0,'rows':[]};var _0x1ddab2=_[_0x1e54('0x2b')](db[_0x1e54('0x2c')]['rawAttributes'],function(_0x589d95){return{'name':_0x589d95[_0x1e54('0x2d')],'type':_0x589d95['type'][_0x1e54('0x2e')]};});_0x5e509c['model']=_[_0x1e54('0x2b')](_0x1ddab2,_0x1e54('0x29'));_0x5e509c[_0x1e54('0x2f')]=_['keys'](_0x282865[_0x1e54('0x2f')]);_0x5e509c['filters']=_['intersection'](_0x5e509c['model'],_0x5e509c[_0x1e54('0x2f')]);_0x328eac[_0x1e54('0x30')]=_[_0x1e54('0x31')](_0x5e509c['model'],qs['fields'](_0x282865[_0x1e54('0x2f')][_0x1e54('0x32')]));_0x328eac[_0x1e54('0x30')]=_0x328eac[_0x1e54('0x30')]['length']?_0x328eac[_0x1e54('0x30')]:_0x5e509c[_0x1e54('0x33')];if(!_0x282865[_0x1e54('0x2f')]['hasOwnProperty'](_0x1e54('0x34'))){_0x328eac[_0x1e54('0x1e')]=qs[_0x1e54('0x1e')](_0x282865[_0x1e54('0x2f')][_0x1e54('0x1e')]);_0x328eac[_0x1e54('0x20')]=qs[_0x1e54('0x20')](_0x282865['query'][_0x1e54('0x20')]);}_0x328eac['order']=qs['sort'](_0x282865['query'][_0x1e54('0x35')]);_0x328eac[_0x1e54('0x36')]=qs[_0x1e54('0x37')](_[_0x1e54('0x38')](_0x282865[_0x1e54('0x2f')],_0x5e509c[_0x1e54('0x37')]),_0x1ddab2);if(_0x282865['query'][_0x1e54('0x39')]){_0x328eac['where']=_[_0x1e54('0x3a')](_0x328eac[_0x1e54('0x36')],{'$or':_[_0x1e54('0x2b')](_0x1ddab2,function(_0x26fa95){if(_0x26fa95[_0x1e54('0x3b')]!==_0x1e54('0x3c')){var _0x14aff6={};_0x14aff6[_0x26fa95[_0x1e54('0x29')]]={'$like':'%'+_0x282865[_0x1e54('0x2f')][_0x1e54('0x39')]+'%'};return _0x14aff6;}})});}_0x328eac=_[_0x1e54('0x3a')]({},_0x328eac,_0x282865['options']);var _0x2ec18b={'where':_0x328eac[_0x1e54('0x36')]};return db[_0x1e54('0x2c')]['count'](_0x2ec18b)[_0x1e54('0x25')](function(_0x49dfcb){_0x25dd3f[_0x1e54('0x1f')]=_0x49dfcb;if(_0x282865[_0x1e54('0x2f')]['includeAll']){_0x328eac[_0x1e54('0x3d')]=[{'all':!![]}];}return db[_0x1e54('0x2c')][_0x1e54('0x3e')](_0x328eac);})[_0x1e54('0x25')](function(_0x3abe91){_0x25dd3f[_0x1e54('0x3f')]=_0x3abe91;return _0x25dd3f;})['then'](respondWithFilteredResult(_0x3812a2,_0x328eac))[_0x1e54('0x40')](handleError(_0x3812a2,null));};exports[_0x1e54('0x41')]=function(_0xa4edf5,_0x2a3ea7){var _0x5b17ee={'raw':!![],'where':{'id':_0xa4edf5['params']['id']}},_0x32cee4={};_0x32cee4['model']=_[_0x1e54('0x42')](db[_0x1e54('0x2c')]['rawAttributes']);_0x32cee4[_0x1e54('0x2f')]=_[_0x1e54('0x42')](_0xa4edf5[_0x1e54('0x2f')]);_0x32cee4[_0x1e54('0x37')]=_['intersection'](_0x32cee4[_0x1e54('0x33')],_0x32cee4['query']);_0x5b17ee[_0x1e54('0x30')]=_[_0x1e54('0x31')](_0x32cee4['model'],qs[_0x1e54('0x32')](_0xa4edf5[_0x1e54('0x2f')][_0x1e54('0x32')]));_0x5b17ee[_0x1e54('0x30')]=_0x5b17ee[_0x1e54('0x30')][_0x1e54('0x43')]?_0x5b17ee[_0x1e54('0x30')]:_0x32cee4['model'];if(_0xa4edf5['query'][_0x1e54('0x44')]){_0x5b17ee[_0x1e54('0x3d')]=[{'all':!![]}];}_0x5b17ee=_[_0x1e54('0x3a')]({},_0x5b17ee,_0xa4edf5['options']);return db[_0x1e54('0x2c')][_0x1e54('0x45')](_0x5b17ee)['then'](handleEntityNotFound(_0x2a3ea7,null))[_0x1e54('0x25')](respondWithResult(_0x2a3ea7,null))[_0x1e54('0x40')](handleError(_0x2a3ea7,null));};exports[_0x1e54('0x46')]=function(_0x293f8f,_0x2b062b){return db[_0x1e54('0x2c')][_0x1e54('0x46')](_0x293f8f[_0x1e54('0x47')],{})[_0x1e54('0x25')](respondWithResult(_0x2b062b,0xc9))[_0x1e54('0x40')](handleError(_0x2b062b,null));};exports[_0x1e54('0x24')]=function(_0x14cbe9,_0xd05676){if(_0x14cbe9[_0x1e54('0x47')]['id']){delete _0x14cbe9[_0x1e54('0x47')]['id'];}return db[_0x1e54('0x2c')][_0x1e54('0x45')]({'where':{'id':_0x14cbe9[_0x1e54('0x48')]['id']}})[_0x1e54('0x25')](handleEntityNotFound(_0xd05676,null))[_0x1e54('0x25')](saveUpdates(_0x14cbe9['body'],null))[_0x1e54('0x25')](respondWithResult(_0xd05676,null))[_0x1e54('0x40')](handleError(_0xd05676,null));};exports[_0x1e54('0x26')]=function(_0x20e831,_0x572e5){return db['SmsQueueReport'][_0x1e54('0x45')]({'where':{'id':_0x20e831[_0x1e54('0x48')]['id']}})[_0x1e54('0x25')](handleEntityNotFound(_0x572e5,null))[_0x1e54('0x25')](removeEntity(_0x572e5,null))[_0x1e54('0x40')](handleError(_0x572e5,null));};exports[_0x1e54('0x49')]=function(_0x449ee4,_0x185272){return db[_0x1e54('0x2c')][_0x1e54('0x49')]()[_0x1e54('0x25')](respondWithResult(_0x185272,null))['catch'](handleError(_0x185272,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index bf063fd..b63a87a 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x1eb8d0,_0x27e99f){var _0x33913e=function(_0x350e82){while(--_0x350e82){_0x1eb8d0['push'](_0x1eb8d0['shift']());}};_0x33913e(++_0x27e99f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x142020,_0x1f7233){_0x142020=_0x142020-0x0;var _0x40da8f=_0xcb91[_0x142020];return _0x40da8f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x3d383a,_0xa447e){var _0x3d0539=function(_0x315387){while(--_0x315387){_0x3d383a['push'](_0x3d383a['shift']());}};_0x3d0539(++_0xa447e);}(_0x70e0,0x17b));var _0x070e=function(_0x4be5ad,_0xfa59cd){_0x4be5ad=_0x4be5ad-0x0;var _0x57f47d=_0x70e0[_0x4be5ad];return _0x57f47d;};'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']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index a32ae9c..1a79a41 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 _0x2754=['info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','create','body','options','CreateSmsQueueReport','stringify','SmsQueueReport','update','limit','then','UpdateSmsQueueReport','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x2754,0x86));var _0x4275=function(_0x472a98,_0x3152bf){_0x472a98=_0x472a98-0x0;var _0xa9234a=_0x2754[_0x472a98];return _0xa9234a;};'use strict';var _=require(_0x4275('0x0'));var util=require('util');var moment=require(_0x4275('0x1'));var BPromise=require('bluebird');var rs=require(_0x4275('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4275('0x3'))['db'];var utils=require(_0x4275('0x4'));var logger=require(_0x4275('0x5'))(_0x4275('0x6'));var config=require(_0x4275('0x7'));var jayson=require(_0x4275('0x8'));var client=jayson[_0x4275('0x9')][_0x4275('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e0c83,_0xd13178,_0x553fa5){return new BPromise(function(_0x277dd6,_0x4fb282){return client['request'](_0x1e0c83,_0x553fa5)['then'](function(_0x14d2de){logger[_0x4275('0xb')](_0x4275('0xc'),_0xd13178,_0x4275('0xd'));logger[_0x4275('0xe')](_0x4275('0xf'),_0xd13178,_0x4275('0xd'),JSON['stringify'](_0x14d2de));if(_0x14d2de[_0x4275('0x10')]){if(_0x14d2de[_0x4275('0x10')]['code']===0x1f4){logger[_0x4275('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0xd13178,_0x14d2de[_0x4275('0x10')]['message']);return _0x4fb282(_0x14d2de['error']['message']);}logger[_0x4275('0x10')](_0x4275('0xc'),_0xd13178,_0x14d2de['error'][_0x4275('0x11')]);return _0x277dd6(_0x14d2de['error'][_0x4275('0x11')]);}else{logger[_0x4275('0xb')](_0x4275('0xc'),_0xd13178,_0x4275('0xd'));_0x277dd6(_0x14d2de[_0x4275('0x12')][_0x4275('0x11')]);}})['catch'](function(_0x5c636a){logger[_0x4275('0x10')](_0x4275('0xc'),_0xd13178,_0x5c636a);_0x4fb282(_0x5c636a);});});}exports['CreateSmsQueueReport']=function(_0x572aff){var _0x14cd16=this;return new Promise(function(_0x93ef28,_0x30cd14){return db['SmsQueueReport'][_0x4275('0x13')](_0x572aff[_0x4275('0x14')],{'raw':_0x572aff[_0x4275('0x15')]?_0x572aff['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x348a15){logger[_0x4275('0xb')](_0x4275('0x16'),_0x572aff);logger['debug'](_0x4275('0x16'),_0x572aff,JSON[_0x4275('0x17')](_0x348a15));_0x93ef28(_0x348a15);})['catch'](function(_0x28870c){logger[_0x4275('0x10')](_0x4275('0x16'),_0x28870c['message'],_0x572aff);_0x30cd14(_0x14cd16['error'](0x1f4,_0x28870c['message']));});});};exports['UpdateSmsQueueReport']=function(_0x1576ff){var _0x6fbf2c=this;return new Promise(function(_0xe56e2b,_0x3b9473){return db[_0x4275('0x18')][_0x4275('0x19')](_0x1576ff[_0x4275('0x14')],{'raw':_0x1576ff[_0x4275('0x15')]?_0x1576ff[_0x4275('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1576ff[_0x4275('0x15')]?_0x1576ff[_0x4275('0x15')]['where']||null:null,'attributes':_0x1576ff[_0x4275('0x15')]?_0x1576ff['options']['attributes']||null:null,'limit':_0x1576ff[_0x4275('0x15')]?_0x1576ff[_0x4275('0x15')][_0x4275('0x1a')]||null:null})[_0x4275('0x1b')](function(_0x381242){logger['info']('UpdateSmsQueueReport',_0x1576ff);logger['debug'](_0x4275('0x1c'),_0x1576ff,JSON[_0x4275('0x17')](_0x381242));_0xe56e2b(_0x381242);})['catch'](function(_0x253162){logger[_0x4275('0x10')](_0x4275('0x1c'),_0x253162[_0x4275('0x11')],_0x1576ff);_0x3b9473(_0x6fbf2c['error'](0x1f4,_0x253162[_0x4275('0x11')]));});});}; \ No newline at end of file +var _0x82c4=['stringify','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','update','body','where','attributes','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x21ed53,_0x2b61af){var _0xcf4e54=function(_0x2ad1a7){while(--_0x2ad1a7){_0x21ed53['push'](_0x21ed53['shift']());}};_0xcf4e54(++_0x2b61af);}(_0x82c4,0xbe));var _0x482c=function(_0x318256,_0xa773f3){_0x318256=_0x318256-0x0;var _0xb1e352=_0x82c4[_0x318256];return _0xb1e352;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var moment=require(_0x482c('0x2'));var BPromise=require(_0x482c('0x3'));var rs=require(_0x482c('0x4'));var fs=require('fs');var Redis=require(_0x482c('0x5'));var db=require(_0x482c('0x6'))['db'];var utils=require(_0x482c('0x7'));var logger=require(_0x482c('0x8'))(_0x482c('0x9'));var config=require(_0x482c('0xa'));var jayson=require(_0x482c('0xb'));var client=jayson[_0x482c('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f1896,_0x1bedf6,_0x6ed5eb){return new BPromise(function(_0x7373d0,_0x5c9312){return client[_0x482c('0xd')](_0x4f1896,_0x6ed5eb)[_0x482c('0xe')](function(_0x2e3943){logger[_0x482c('0xf')](_0x482c('0x10'),_0x1bedf6,_0x482c('0x11'));logger[_0x482c('0x12')](_0x482c('0x13'),_0x1bedf6,_0x482c('0x11'),JSON[_0x482c('0x14')](_0x2e3943));if(_0x2e3943[_0x482c('0x15')]){if(_0x2e3943[_0x482c('0x15')]['code']===0x1f4){logger['error'](_0x482c('0x10'),_0x1bedf6,_0x2e3943['error'][_0x482c('0x16')]);return _0x5c9312(_0x2e3943['error'][_0x482c('0x16')]);}logger[_0x482c('0x15')](_0x482c('0x10'),_0x1bedf6,_0x2e3943[_0x482c('0x15')][_0x482c('0x16')]);return _0x7373d0(_0x2e3943[_0x482c('0x15')][_0x482c('0x16')]);}else{logger[_0x482c('0xf')](_0x482c('0x10'),_0x1bedf6,_0x482c('0x11'));_0x7373d0(_0x2e3943[_0x482c('0x17')][_0x482c('0x16')]);}})[_0x482c('0x18')](function(_0x3ebfb9){logger['error'](_0x482c('0x10'),_0x1bedf6,_0x3ebfb9);_0x5c9312(_0x3ebfb9);});});}exports[_0x482c('0x19')]=function(_0x4d41fc){var _0x4566f9=this;return new Promise(function(_0x4e6523,_0x27ffd4){return db[_0x482c('0x1a')][_0x482c('0x1b')](_0x4d41fc['body'],{'raw':_0x4d41fc[_0x482c('0x1c')]?_0x4d41fc[_0x482c('0x1c')][_0x482c('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x578028){logger[_0x482c('0xf')](_0x482c('0x19'),_0x4d41fc);logger[_0x482c('0x12')](_0x482c('0x19'),_0x4d41fc,JSON[_0x482c('0x14')](_0x578028));_0x4e6523(_0x578028);})['catch'](function(_0x2b0973){logger['error'](_0x482c('0x19'),_0x2b0973[_0x482c('0x16')],_0x4d41fc);_0x27ffd4(_0x4566f9[_0x482c('0x15')](0x1f4,_0x2b0973[_0x482c('0x16')]));});});};exports['UpdateSmsQueueReport']=function(_0xbddf93){var _0x16ed52=this;return new Promise(function(_0x53f9a9,_0x276bee){return db[_0x482c('0x1a')][_0x482c('0x1e')](_0xbddf93[_0x482c('0x1f')],{'raw':_0xbddf93[_0x482c('0x1c')]?_0xbddf93['options'][_0x482c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbddf93[_0x482c('0x1c')]?_0xbddf93['options'][_0x482c('0x20')]||null:null,'attributes':_0xbddf93[_0x482c('0x1c')]?_0xbddf93[_0x482c('0x1c')][_0x482c('0x21')]||null:null,'limit':_0xbddf93['options']?_0xbddf93[_0x482c('0x1c')]['limit']||null:null})[_0x482c('0xe')](function(_0xb540db){logger['info'](_0x482c('0x22'),_0xbddf93);logger[_0x482c('0x12')]('UpdateSmsQueueReport',_0xbddf93,JSON[_0x482c('0x14')](_0xb540db));_0x53f9a9(_0xb540db);})[_0x482c('0x18')](function(_0x52eb80){logger[_0x482c('0x15')](_0x482c('0x22'),_0x52eb80[_0x482c('0x16')],_0xbddf93);_0x276bee(_0x16ed52[_0x482c('0x15')](0x1f4,_0x52eb80['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 5cd6834..99e45f2 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 _0x60c2=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x514e39,_0x4d7c22){var _0x1a39f8=function(_0x45b227){while(--_0x45b227){_0x514e39['push'](_0x514e39['shift']());}};_0x1a39f8(++_0x4d7c22);}(_0x60c2,0x8f));var _0x260c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x60c2[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x260c('0x0'));var path=require(_0x260c('0x1'));var timeout=require(_0x260c('0x2'));var express=require(_0x260c('0x3'));var router=express[_0x260c('0x4')]();var fs_extra=require(_0x260c('0x5'));var auth=require(_0x260c('0x6'));var interaction=require(_0x260c('0x7'));var config=require(_0x260c('0x8'));var controller=require(_0x260c('0x9'));router[_0x260c('0xa')]('/',auth[_0x260c('0xb')](),controller['index']);router[_0x260c('0xa')](_0x260c('0xc'),auth[_0x260c('0xb')](),controller[_0x260c('0xd')]);router['get'](_0x260c('0xe'),auth[_0x260c('0xb')](),controller[_0x260c('0xf')]);router[_0x260c('0x10')]('/',auth[_0x260c('0xb')](),controller[_0x260c('0x11')]);router[_0x260c('0x12')]('/:id',auth[_0x260c('0xb')](),controller[_0x260c('0x13')]);router[_0x260c('0x14')]('/:id',auth[_0x260c('0xb')](),controller[_0x260c('0x15')]);module[_0x260c('0x16')]=router; \ No newline at end of file +var _0xbacd=['get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xbacd,0x1c5));var _0xdbac=function(_0x2ad1bd,_0x53ba40){_0x2ad1bd=_0x2ad1bd-0x0;var _0x3be077=_0xbacd[_0x2ad1bd];return _0x3be077;};'use strict';var multer=require(_0xdbac('0x0'));var util=require(_0xdbac('0x1'));var path=require('path');var timeout=require(_0xdbac('0x2'));var express=require(_0xdbac('0x3'));var router=express[_0xdbac('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdbac('0x5'));var interaction=require(_0xdbac('0x6'));var config=require(_0xdbac('0x7'));var controller=require(_0xdbac('0x8'));router[_0xdbac('0x9')]('/',auth[_0xdbac('0xa')](),controller[_0xdbac('0xb')]);router[_0xdbac('0x9')](_0xdbac('0xc'),auth[_0xdbac('0xa')](),controller[_0xdbac('0xd')]);router[_0xdbac('0x9')](_0xdbac('0xe'),auth[_0xdbac('0xa')](),controller[_0xdbac('0xf')]);router['post']('/',auth[_0xdbac('0xa')](),controller[_0xdbac('0x10')]);router['put'](_0xdbac('0xe'),auth['isAuthenticated'](),controller[_0xdbac('0x11')]);router[_0xdbac('0x12')](_0xdbac('0xe'),auth[_0xdbac('0xa')](),controller[_0xdbac('0x13')]);module[_0xdbac('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 6e2abfa..d169dd2 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x135ffe,_0x56ee80){var _0x1ae1e9=function(_0xfd1f3e){while(--_0xfd1f3e){_0x135ffe['push'](_0x135ffe['shift']());}};_0x1ae1e9(++_0x56ee80);}(_0xe706,0xa3));var _0x6e70=function(_0x53fb63,_0x2497b0){_0x53fb63=_0x53fb63-0x0;var _0x3fd488=_0xe706[_0x53fb63];return _0x3fd488;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x3d41f1,_0x4dc763){var _0x2fefe9=function(_0x57f382){while(--_0x57f382){_0x3d41f1['push'](_0x3d41f1['shift']());}};_0x2fefe9(++_0x4dc763);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0xf3cd[_0x2212d1];return _0x15eec5;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 940c995..790a3e8 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 _0x06b8=['squel','jsforce','desk.js','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','apply','update','destroy','then','error','map','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','SmsTransferReport','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash'];(function(_0x3720c7,_0x1d660c){var _0x2c50a8=function(_0x53c51e){while(--_0x53c51e){_0x3720c7['push'](_0x3720c7['shift']());}};_0x2c50a8(++_0x1d660c);}(_0x06b8,0x19f));var _0x806b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x06b8[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x806b('0x0'));var rimraf=require(_0x806b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x806b('0x2'));var moment=require(_0x806b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x806b('0x4'));var util=require(_0x806b('0x5'));var path=require(_0x806b('0x6'));var sox=require(_0x806b('0x7'));var csv=require('to-csv');var ejs=require(_0x806b('0x8'));var fs=require('fs');var fs_extra=require(_0x806b('0x9'));var _=require(_0x806b('0xa'));var squel=require(_0x806b('0xb'));var crypto=require('crypto');var jsforce=require(_0x806b('0xc'));var deskjs=require(_0x806b('0xd'));var toCsv=require(_0x806b('0xe'));var querystring=require('querystring');var Papa=require(_0x806b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x806b('0x10'));var hardwareService=require(_0x806b('0x11'));var logger=require(_0x806b('0x12'))(_0x806b('0x13'));var utils=require(_0x806b('0x14'));var config=require(_0x806b('0x15'));var licenseUtil=require(_0x806b('0x16'));var db=require(_0x806b('0x17'))['db'];function respondWithStatusCode(_0xd8076e,_0x5d4e01){_0x5d4e01=_0x5d4e01||0xcc;return function(_0xb47c7e){if(_0xb47c7e){return _0xd8076e[_0x806b('0x18')](_0x5d4e01);}return _0xd8076e[_0x806b('0x19')](_0x5d4e01)[_0x806b('0x1a')]();};}function respondWithResult(_0x2ee2af,_0x5918fc){_0x5918fc=_0x5918fc||0xc8;return function(_0x8a6f14){if(_0x8a6f14){return _0x2ee2af[_0x806b('0x19')](_0x5918fc)[_0x806b('0x1b')](_0x8a6f14);}};}function respondWithFilteredResult(_0x220503,_0x4369a4){return function(_0x161956){if(_0x161956){var _0x205282=typeof _0x4369a4['offset']===_0x806b('0x1c')&&typeof _0x4369a4[_0x806b('0x1d')]===_0x806b('0x1c');var _0x1108cd=_0x161956['count'];var _0x3874cc=_0x205282?0x0:_0x4369a4[_0x806b('0x1e')];var _0x6f886e=_0x205282?_0x161956['count']:_0x4369a4[_0x806b('0x1e')]+_0x4369a4['limit'];var _0x12cb6b;if(_0x6f886e>=_0x1108cd){_0x6f886e=_0x1108cd;_0x12cb6b=0xc8;}else{_0x12cb6b=0xce;}_0x220503[_0x806b('0x19')](_0x12cb6b);return _0x220503['set']('Content-Range',_0x3874cc+'-'+_0x6f886e+'/'+_0x1108cd)[_0x806b('0x1b')](_0x161956);}return null;};}function patchUpdates(_0x50be98){return function(_0xb8f479){try{jsonpatch[_0x806b('0x1f')](_0xb8f479,_0x50be98,!![]);}catch(_0x1cb262){return BPromise['reject'](_0x1cb262);}return _0xb8f479['save']();};}function saveUpdates(_0x402a08,_0x2dda88){return function(_0xd2654a){if(_0xd2654a){return _0xd2654a[_0x806b('0x20')](_0x402a08)['then'](function(_0xdb9257){return _0xdb9257;});}return null;};}function removeEntity(_0xddb0e2,_0x3df5cc){return function(_0x902ec8){if(_0x902ec8){return _0x902ec8[_0x806b('0x21')]()[_0x806b('0x22')](function(){_0xddb0e2['status'](0xcc)[_0x806b('0x1a')]();});}};}function handleEntityNotFound(_0x4d77d0,_0x105538){return function(_0x1143d6){if(!_0x1143d6){_0x4d77d0[_0x806b('0x18')](0x194);}return _0x1143d6;};}function handleError(_0x372cbc,_0x59f894){_0x59f894=_0x59f894||0x1f4;return function(_0x52001e){logger[_0x806b('0x23')](_0x52001e['stack']);if(_0x52001e['name']){delete _0x52001e['name'];}_0x372cbc['status'](_0x59f894)['send'](_0x52001e);};}exports['index']=function(_0xa84f93,_0x8a85ca){var _0x21f60f={},_0x493bfb={},_0x18b075={'count':0x0,'rows':[]};var _0x5807ed=_[_0x806b('0x24')](db['SmsTransferReport']['rawAttributes'],function(_0x5f00f7){return{'name':_0x5f00f7[_0x806b('0x25')],'type':_0x5f00f7['type'][_0x806b('0x26')]};});_0x493bfb[_0x806b('0x27')]=_[_0x806b('0x24')](_0x5807ed,_0x806b('0x28'));_0x493bfb[_0x806b('0x29')]=_[_0x806b('0x2a')](_0xa84f93[_0x806b('0x29')]);_0x493bfb[_0x806b('0x2b')]=_[_0x806b('0x2c')](_0x493bfb[_0x806b('0x27')],_0x493bfb[_0x806b('0x29')]);_0x21f60f[_0x806b('0x2d')]=_[_0x806b('0x2c')](_0x493bfb[_0x806b('0x27')],qs[_0x806b('0x2e')](_0xa84f93[_0x806b('0x29')]['fields']));_0x21f60f[_0x806b('0x2d')]=_0x21f60f[_0x806b('0x2d')][_0x806b('0x2f')]?_0x21f60f[_0x806b('0x2d')]:_0x493bfb[_0x806b('0x27')];if(!_0xa84f93[_0x806b('0x29')][_0x806b('0x30')]('nolimit')){_0x21f60f['limit']=qs[_0x806b('0x1d')](_0xa84f93[_0x806b('0x29')][_0x806b('0x1d')]);_0x21f60f[_0x806b('0x1e')]=qs[_0x806b('0x1e')](_0xa84f93[_0x806b('0x29')][_0x806b('0x1e')]);}_0x21f60f[_0x806b('0x31')]=qs['sort'](_0xa84f93[_0x806b('0x29')][_0x806b('0x32')]);_0x21f60f[_0x806b('0x33')]=qs[_0x806b('0x2b')](_[_0x806b('0x34')](_0xa84f93[_0x806b('0x29')],_0x493bfb[_0x806b('0x2b')]),_0x5807ed);if(_0xa84f93['query'][_0x806b('0x35')]){_0x21f60f[_0x806b('0x33')]=_[_0x806b('0x36')](_0x21f60f[_0x806b('0x33')],{'$or':_[_0x806b('0x24')](_0x5807ed,function(_0x495a70){if(_0x495a70[_0x806b('0x37')]!==_0x806b('0x38')){var _0x5b7e30={};_0x5b7e30[_0x495a70[_0x806b('0x28')]]={'$like':'%'+_0xa84f93[_0x806b('0x29')][_0x806b('0x35')]+'%'};return _0x5b7e30;}})});}_0x21f60f=_[_0x806b('0x36')]({},_0x21f60f,_0xa84f93[_0x806b('0x39')]);var _0x3a1566={'where':_0x21f60f['where']};return db['SmsTransferReport'][_0x806b('0x3a')](_0x3a1566)[_0x806b('0x22')](function(_0x363b58){_0x18b075['count']=_0x363b58;if(_0xa84f93[_0x806b('0x29')][_0x806b('0x3b')]){_0x21f60f[_0x806b('0x3c')]=[{'all':!![]}];}return db[_0x806b('0x3d')]['findAll'](_0x21f60f);})[_0x806b('0x22')](function(_0x33e59f){_0x18b075[_0x806b('0x3e')]=_0x33e59f;return _0x18b075;})['then'](respondWithFilteredResult(_0x8a85ca,_0x21f60f))[_0x806b('0x3f')](handleError(_0x8a85ca,null));};exports[_0x806b('0x40')]=function(_0x1fd5df,_0x2e3236){var _0x2889b6={'raw':!![],'where':{'id':_0x1fd5df[_0x806b('0x41')]['id']}},_0x1b7b98={};_0x1b7b98['model']=_[_0x806b('0x2a')](db['SmsTransferReport'][_0x806b('0x42')]);_0x1b7b98['query']=_['keys'](_0x1fd5df['query']);_0x1b7b98[_0x806b('0x2b')]=_[_0x806b('0x2c')](_0x1b7b98[_0x806b('0x27')],_0x1b7b98[_0x806b('0x29')]);_0x2889b6[_0x806b('0x2d')]=_['intersection'](_0x1b7b98[_0x806b('0x27')],qs[_0x806b('0x2e')](_0x1fd5df[_0x806b('0x29')][_0x806b('0x2e')]));_0x2889b6['attributes']=_0x2889b6[_0x806b('0x2d')][_0x806b('0x2f')]?_0x2889b6[_0x806b('0x2d')]:_0x1b7b98[_0x806b('0x27')];if(_0x1fd5df['query'][_0x806b('0x3b')]){_0x2889b6[_0x806b('0x3c')]=[{'all':!![]}];}_0x2889b6=_[_0x806b('0x36')]({},_0x2889b6,_0x1fd5df[_0x806b('0x39')]);return db['SmsTransferReport'][_0x806b('0x43')](_0x2889b6)[_0x806b('0x22')](handleEntityNotFound(_0x2e3236,null))[_0x806b('0x22')](respondWithResult(_0x2e3236,null))['catch'](handleError(_0x2e3236,null));};exports[_0x806b('0x44')]=function(_0x1c2824,_0x41a989){return db['SmsTransferReport'][_0x806b('0x44')](_0x1c2824[_0x806b('0x45')],{})['then'](respondWithResult(_0x41a989,0xc9))[_0x806b('0x3f')](handleError(_0x41a989,null));};exports[_0x806b('0x20')]=function(_0x491a56,_0xcd059d){if(_0x491a56[_0x806b('0x45')]['id']){delete _0x491a56[_0x806b('0x45')]['id'];}return db['SmsTransferReport'][_0x806b('0x43')]({'where':{'id':_0x491a56[_0x806b('0x41')]['id']}})['then'](handleEntityNotFound(_0xcd059d,null))[_0x806b('0x22')](saveUpdates(_0x491a56[_0x806b('0x45')],null))[_0x806b('0x22')](respondWithResult(_0xcd059d,null))[_0x806b('0x3f')](handleError(_0xcd059d,null));};exports['destroy']=function(_0x58e4d9,_0x319732){return db[_0x806b('0x3d')][_0x806b('0x43')]({'where':{'id':_0x58e4d9[_0x806b('0x41')]['id']}})[_0x806b('0x22')](handleEntityNotFound(_0x319732,null))[_0x806b('0x22')](removeEntity(_0x319732,null))['catch'](handleError(_0x319732,null));};exports[_0x806b('0x46')]=function(_0x368036,_0x549d7a){return db[_0x806b('0x3d')]['describe']()['then'](respondWithResult(_0x549d7a,null))[_0x806b('0x3f')](handleError(_0x549d7a,null));}; \ No newline at end of file +var _0xbf30=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','index','SmsTransferReport'];(function(_0x2e1c21,_0x3873fc){var _0x35cfc7=function(_0x43722e){while(--_0x43722e){_0x2e1c21['push'](_0x2e1c21['shift']());}};_0x35cfc7(++_0x3873fc);}(_0xbf30,0x1de));var _0x0bf3=function(_0x25210a,_0xfdda84){_0x25210a=_0x25210a-0x0;var _0x4c1bd9=_0xbf30[_0x25210a];return _0x4c1bd9;};'use strict';var emlformat=require(_0x0bf3('0x0'));var rimraf=require(_0x0bf3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0bf3('0x2'));var moment=require(_0x0bf3('0x3'));var BPromise=require(_0x0bf3('0x4'));var Mustache=require(_0x0bf3('0x5'));var util=require(_0x0bf3('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bf3('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0bf3('0x8'));var crypto=require(_0x0bf3('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0bf3('0xa'));var toCsv=require('to-csv');var querystring=require(_0x0bf3('0xb'));var Papa=require(_0x0bf3('0xc'));var Redis=require(_0x0bf3('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0bf3('0xe'));var hardwareService=require(_0x0bf3('0xf'));var logger=require(_0x0bf3('0x10'))(_0x0bf3('0x11'));var utils=require(_0x0bf3('0x12'));var config=require(_0x0bf3('0x13'));var licenseUtil=require(_0x0bf3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e7db3,_0x1af62a){_0x1af62a=_0x1af62a||0xcc;return function(_0x172e72){if(_0x172e72){return _0x1e7db3['sendStatus'](_0x1af62a);}return _0x1e7db3['status'](_0x1af62a)[_0x0bf3('0x15')]();};}function respondWithResult(_0x22ce05,_0x5d0cf3){_0x5d0cf3=_0x5d0cf3||0xc8;return function(_0xe723b4){if(_0xe723b4){return _0x22ce05['status'](_0x5d0cf3)[_0x0bf3('0x16')](_0xe723b4);}};}function respondWithFilteredResult(_0x1ca19c,_0x2e7a9b){return function(_0xce254d){if(_0xce254d){var _0x11e380=typeof _0x2e7a9b[_0x0bf3('0x17')]===_0x0bf3('0x18')&&typeof _0x2e7a9b['limit']===_0x0bf3('0x18');var _0xd5f018=_0xce254d[_0x0bf3('0x19')];var _0x25a1fb=_0x11e380?0x0:_0x2e7a9b['offset'];var _0x1e761d=_0x11e380?_0xce254d['count']:_0x2e7a9b[_0x0bf3('0x17')]+_0x2e7a9b[_0x0bf3('0x1a')];var _0x37e9b4;if(_0x1e761d>=_0xd5f018){_0x1e761d=_0xd5f018;_0x37e9b4=0xc8;}else{_0x37e9b4=0xce;}_0x1ca19c[_0x0bf3('0x1b')](_0x37e9b4);return _0x1ca19c[_0x0bf3('0x1c')](_0x0bf3('0x1d'),_0x25a1fb+'-'+_0x1e761d+'/'+_0xd5f018)[_0x0bf3('0x16')](_0xce254d);}return null;};}function patchUpdates(_0x4eaa04){return function(_0x4c4ff8){try{jsonpatch[_0x0bf3('0x1e')](_0x4c4ff8,_0x4eaa04,!![]);}catch(_0x3bc916){return BPromise['reject'](_0x3bc916);}return _0x4c4ff8[_0x0bf3('0x1f')]();};}function saveUpdates(_0x4d706d,_0x21cacf){return function(_0x28bfc6){if(_0x28bfc6){return _0x28bfc6[_0x0bf3('0x20')](_0x4d706d)[_0x0bf3('0x21')](function(_0x23a967){return _0x23a967;});}return null;};}function removeEntity(_0x2f89f7,_0x44fb1d){return function(_0x14c950){if(_0x14c950){return _0x14c950[_0x0bf3('0x22')]()[_0x0bf3('0x21')](function(){_0x2f89f7[_0x0bf3('0x1b')](0xcc)[_0x0bf3('0x15')]();});}};}function handleEntityNotFound(_0x5369a8,_0x4fe233){return function(_0x544920){if(!_0x544920){_0x5369a8[_0x0bf3('0x23')](0x194);}return _0x544920;};}function handleError(_0x161c5b,_0x3baa04){_0x3baa04=_0x3baa04||0x1f4;return function(_0x4d631f){logger[_0x0bf3('0x24')](_0x4d631f['stack']);if(_0x4d631f[_0x0bf3('0x25')]){delete _0x4d631f[_0x0bf3('0x25')];}_0x161c5b['status'](_0x3baa04)['send'](_0x4d631f);};}exports[_0x0bf3('0x26')]=function(_0x4f5793,_0x40706e){var _0x14b0ce={},_0x2a235c={},_0x1c7a7e={'count':0x0,'rows':[]};var _0x3881b9=_['map'](db[_0x0bf3('0x27')][_0x0bf3('0x28')],function(_0x2e04ff){return{'name':_0x2e04ff[_0x0bf3('0x29')],'type':_0x2e04ff[_0x0bf3('0x2a')][_0x0bf3('0x2b')]};});_0x2a235c[_0x0bf3('0x2c')]=_['map'](_0x3881b9,'name');_0x2a235c[_0x0bf3('0x2d')]=_[_0x0bf3('0x2e')](_0x4f5793[_0x0bf3('0x2d')]);_0x2a235c[_0x0bf3('0x2f')]=_[_0x0bf3('0x30')](_0x2a235c[_0x0bf3('0x2c')],_0x2a235c[_0x0bf3('0x2d')]);_0x14b0ce[_0x0bf3('0x31')]=_[_0x0bf3('0x30')](_0x2a235c[_0x0bf3('0x2c')],qs[_0x0bf3('0x32')](_0x4f5793[_0x0bf3('0x2d')][_0x0bf3('0x32')]));_0x14b0ce[_0x0bf3('0x31')]=_0x14b0ce['attributes'][_0x0bf3('0x33')]?_0x14b0ce['attributes']:_0x2a235c[_0x0bf3('0x2c')];if(!_0x4f5793[_0x0bf3('0x2d')][_0x0bf3('0x34')](_0x0bf3('0x35'))){_0x14b0ce[_0x0bf3('0x1a')]=qs[_0x0bf3('0x1a')](_0x4f5793[_0x0bf3('0x2d')]['limit']);_0x14b0ce['offset']=qs[_0x0bf3('0x17')](_0x4f5793[_0x0bf3('0x2d')][_0x0bf3('0x17')]);}_0x14b0ce[_0x0bf3('0x36')]=qs[_0x0bf3('0x37')](_0x4f5793[_0x0bf3('0x2d')][_0x0bf3('0x37')]);_0x14b0ce['where']=qs[_0x0bf3('0x2f')](_[_0x0bf3('0x38')](_0x4f5793[_0x0bf3('0x2d')],_0x2a235c[_0x0bf3('0x2f')]),_0x3881b9);if(_0x4f5793['query'][_0x0bf3('0x39')]){_0x14b0ce[_0x0bf3('0x3a')]=_[_0x0bf3('0x3b')](_0x14b0ce[_0x0bf3('0x3a')],{'$or':_[_0x0bf3('0x3c')](_0x3881b9,function(_0x2bf6d1){if(_0x2bf6d1[_0x0bf3('0x2a')]!==_0x0bf3('0x3d')){var _0x4a69ea={};_0x4a69ea[_0x2bf6d1[_0x0bf3('0x25')]]={'$like':'%'+_0x4f5793[_0x0bf3('0x2d')][_0x0bf3('0x39')]+'%'};return _0x4a69ea;}})});}_0x14b0ce=_[_0x0bf3('0x3b')]({},_0x14b0ce,_0x4f5793[_0x0bf3('0x3e')]);var _0x1c2f9b={'where':_0x14b0ce[_0x0bf3('0x3a')]};return db[_0x0bf3('0x27')][_0x0bf3('0x19')](_0x1c2f9b)[_0x0bf3('0x21')](function(_0x311082){_0x1c7a7e[_0x0bf3('0x19')]=_0x311082;if(_0x4f5793[_0x0bf3('0x2d')][_0x0bf3('0x3f')]){_0x14b0ce[_0x0bf3('0x40')]=[{'all':!![]}];}return db[_0x0bf3('0x27')][_0x0bf3('0x41')](_0x14b0ce);})['then'](function(_0x28c879){_0x1c7a7e[_0x0bf3('0x42')]=_0x28c879;return _0x1c7a7e;})[_0x0bf3('0x21')](respondWithFilteredResult(_0x40706e,_0x14b0ce))[_0x0bf3('0x43')](handleError(_0x40706e,null));};exports[_0x0bf3('0x44')]=function(_0x309798,_0x271aad){var _0x48d8bf={'raw':!![],'where':{'id':_0x309798[_0x0bf3('0x45')]['id']}},_0x424813={};_0x424813[_0x0bf3('0x2c')]=_['keys'](db[_0x0bf3('0x27')][_0x0bf3('0x28')]);_0x424813[_0x0bf3('0x2d')]=_['keys'](_0x309798[_0x0bf3('0x2d')]);_0x424813[_0x0bf3('0x2f')]=_['intersection'](_0x424813[_0x0bf3('0x2c')],_0x424813[_0x0bf3('0x2d')]);_0x48d8bf[_0x0bf3('0x31')]=_['intersection'](_0x424813[_0x0bf3('0x2c')],qs[_0x0bf3('0x32')](_0x309798[_0x0bf3('0x2d')]['fields']));_0x48d8bf[_0x0bf3('0x31')]=_0x48d8bf[_0x0bf3('0x31')][_0x0bf3('0x33')]?_0x48d8bf['attributes']:_0x424813[_0x0bf3('0x2c')];if(_0x309798['query'][_0x0bf3('0x3f')]){_0x48d8bf[_0x0bf3('0x40')]=[{'all':!![]}];}_0x48d8bf=_['merge']({},_0x48d8bf,_0x309798[_0x0bf3('0x3e')]);return db[_0x0bf3('0x27')][_0x0bf3('0x46')](_0x48d8bf)[_0x0bf3('0x21')](handleEntityNotFound(_0x271aad,null))[_0x0bf3('0x21')](respondWithResult(_0x271aad,null))[_0x0bf3('0x43')](handleError(_0x271aad,null));};exports[_0x0bf3('0x47')]=function(_0x5cb8c7,_0xdfd79c){return db[_0x0bf3('0x27')][_0x0bf3('0x47')](_0x5cb8c7[_0x0bf3('0x48')],{})[_0x0bf3('0x21')](respondWithResult(_0xdfd79c,0xc9))[_0x0bf3('0x43')](handleError(_0xdfd79c,null));};exports[_0x0bf3('0x20')]=function(_0x27d32e,_0x7fabaf){if(_0x27d32e['body']['id']){delete _0x27d32e[_0x0bf3('0x48')]['id'];}return db['SmsTransferReport'][_0x0bf3('0x46')]({'where':{'id':_0x27d32e[_0x0bf3('0x45')]['id']}})[_0x0bf3('0x21')](handleEntityNotFound(_0x7fabaf,null))[_0x0bf3('0x21')](saveUpdates(_0x27d32e[_0x0bf3('0x48')],null))[_0x0bf3('0x21')](respondWithResult(_0x7fabaf,null))[_0x0bf3('0x43')](handleError(_0x7fabaf,null));};exports[_0x0bf3('0x22')]=function(_0x15f34b,_0x241172){return db[_0x0bf3('0x27')]['find']({'where':{'id':_0x15f34b[_0x0bf3('0x45')]['id']}})[_0x0bf3('0x21')](handleEntityNotFound(_0x241172,null))[_0x0bf3('0x21')](removeEntity(_0x241172,null))[_0x0bf3('0x43')](handleError(_0x241172,null));};exports[_0x0bf3('0x49')]=function(_0x3dbb57,_0x12c840){return db[_0x0bf3('0x27')][_0x0bf3('0x49')]()[_0x0bf3('0x21')](respondWithResult(_0x12c840,null))[_0x0bf3('0x43')](handleError(_0x12c840,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 18ac389..52a80b4 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 _0x25ca=['rimraf','../../config/environment','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5c0017,_0x35bce6){var _0x5d2ce7=function(_0x31339f){while(--_0x31339f){_0x5c0017['push'](_0x5c0017['shift']());}};_0x5d2ce7(++_0x35bce6);}(_0x25ca,0xf0));var _0xa25c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x25ca[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xa25c('0x0'));var util=require(_0xa25c('0x1'));var logger=require(_0xa25c('0x2'))(_0xa25c('0x3'));var moment=require(_0xa25c('0x4'));var BPromise=require(_0xa25c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa25c('0x6'));var rimraf=require(_0xa25c('0x7'));var config=require(_0xa25c('0x8'));var attributes=require(_0xa25c('0x9'));module['exports']=function(_0xd32f0a,_0x5529ba){return _0xd32f0a['define'](_0xa25c('0xa'),attributes,{'tableName':_0xa25c('0xb'),'paranoid':![],'indexes':[{'name':_0xa25c('0xc'),'fields':[_0xa25c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x170d=['define','SmsTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./smsTransferReport.attributes','exports'];(function(_0x2b86a6,_0x37d942){var _0x311e35=function(_0x5c1139){while(--_0x5c1139){_0x2b86a6['push'](_0x2b86a6['shift']());}};_0x311e35(++_0x37d942);}(_0x170d,0x13b));var _0xd170=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x170d[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xd170('0x0'));var util=require(_0xd170('0x1'));var logger=require(_0xd170('0x2'))(_0xd170('0x3'));var moment=require(_0xd170('0x4'));var BPromise=require(_0xd170('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd170('0x6'));var config=require('../../config/environment');var attributes=require(_0xd170('0x7'));module[_0xd170('0x8')]=function(_0x2a4857,_0x3c2a02){return _0x2a4857[_0xd170('0x9')](_0xd170('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xd170('0xb'),'fields':[_0xd170('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index b811bce..8882652 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 _0x0309=['error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x361489,_0x399b94){var _0xd9ce0b=function(_0xc1b922){while(--_0xc1b922){_0x361489['push'](_0x361489['shift']());}};_0xd9ce0b(++_0x399b94);}(_0x0309,0x165));var _0x9030=function(_0x5ddef4,_0x6e80ae){_0x5ddef4=_0x5ddef4-0x0;var _0x2b91b0=_0x0309[_0x5ddef4];return _0x2b91b0;};'use strict';var _=require(_0x9030('0x0'));var util=require('util');var moment=require(_0x9030('0x1'));var BPromise=require('bluebird');var rs=require(_0x9030('0x2'));var fs=require('fs');var Redis=require(_0x9030('0x3'));var db=require(_0x9030('0x4'))['db'];var utils=require(_0x9030('0x5'));var logger=require(_0x9030('0x6'))(_0x9030('0x7'));var config=require(_0x9030('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9030('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x105c15,_0x4f2d84,_0xb53eb4){return new BPromise(function(_0x4e6c7b,_0x1e2360){return client[_0x9030('0xa')](_0x105c15,_0xb53eb4)[_0x9030('0xb')](function(_0x5711b4){logger[_0x9030('0xc')](_0x9030('0xd'),_0x4f2d84,_0x9030('0xe'));logger['debug'](_0x9030('0xf'),_0x4f2d84,_0x9030('0xe'),JSON[_0x9030('0x10')](_0x5711b4));if(_0x5711b4[_0x9030('0x11')]){if(_0x5711b4[_0x9030('0x11')][_0x9030('0x12')]===0x1f4){logger[_0x9030('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4f2d84,_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);return _0x1e2360(_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);}logger['error'](_0x9030('0xd'),_0x4f2d84,_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);return _0x4e6c7b(_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);}else{logger[_0x9030('0xc')](_0x9030('0xd'),_0x4f2d84,_0x9030('0xe'));_0x4e6c7b(_0x5711b4[_0x9030('0x14')]['message']);}})[_0x9030('0x15')](function(_0x17e80d){logger[_0x9030('0x11')](_0x9030('0xd'),_0x4f2d84,_0x17e80d);_0x1e2360(_0x17e80d);});});} \ No newline at end of file +var _0x1b69=['message','info','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2804d7,_0x2d8d6c){var _0x4a84e7=function(_0x3a03e9){while(--_0x3a03e9){_0x2804d7['push'](_0x2804d7['shift']());}};_0x4a84e7(++_0x2d8d6c);}(_0x1b69,0x190));var _0x91b6=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x1b69[_0x1694f5];return _0x5b4321;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x91b6('0x0'));var rs=require(_0x91b6('0x1'));var fs=require('fs');var Redis=require(_0x91b6('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x91b6('0x3'));var logger=require(_0x91b6('0x4'))(_0x91b6('0x5'));var config=require(_0x91b6('0x6'));var jayson=require(_0x91b6('0x7'));var client=jayson[_0x91b6('0x8')][_0x91b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x407d3e,_0x169a4a,_0x455203){return new BPromise(function(_0xabc083,_0x1ef7ff){return client[_0x91b6('0xa')](_0x407d3e,_0x455203)[_0x91b6('0xb')](function(_0x564e34){logger['info'](_0x91b6('0xc'),_0x169a4a,_0x91b6('0xd'));logger[_0x91b6('0xe')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x169a4a,_0x91b6('0xd'),JSON[_0x91b6('0xf')](_0x564e34));if(_0x564e34[_0x91b6('0x10')]){if(_0x564e34[_0x91b6('0x10')][_0x91b6('0x11')]===0x1f4){logger[_0x91b6('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x169a4a,_0x564e34[_0x91b6('0x10')]['message']);return _0x1ef7ff(_0x564e34[_0x91b6('0x10')][_0x91b6('0x12')]);}logger[_0x91b6('0x10')](_0x91b6('0xc'),_0x169a4a,_0x564e34['error'][_0x91b6('0x12')]);return _0xabc083(_0x564e34[_0x91b6('0x10')][_0x91b6('0x12')]);}else{logger[_0x91b6('0x13')](_0x91b6('0xc'),_0x169a4a,'request\x20sent');_0xabc083(_0x564e34[_0x91b6('0x14')][_0x91b6('0x12')]);}})[_0x91b6('0x15')](function(_0x15791c){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x169a4a,_0x15791c);_0x1ef7ff(_0x15791c);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 3961b76..cf43f0e 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 _0x8502=['basename','extname','post','single','file','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s'];(function(_0x1f1eee,_0x2f10af){var _0x325e75=function(_0x5b049b){while(--_0x5b049b){_0x1f1eee['push'](_0x1f1eee['shift']());}};_0x325e75(++_0x2f10af);}(_0x8502,0xd1));var _0x2850=function(_0x25df80,_0xa2aec5){_0x25df80=_0x25df80-0x0;var _0x17b6d0=_0x8502[_0x25df80];return _0x17b6d0;};'use strict';var multer=require(_0x2850('0x0'));var util=require(_0x2850('0x1'));var path=require(_0x2850('0x2'));var timeout=require(_0x2850('0x3'));var express=require(_0x2850('0x4'));var router=express[_0x2850('0x5')]();var fs_extra=require(_0x2850('0x6'));var auth=require(_0x2850('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2850('0x8'));var controller=require('./sound.controller');router[_0x2850('0x9')]('/',auth['isAuthenticated'](),controller[_0x2850('0xa')]);router[_0x2850('0x9')]('/:id',auth[_0x2850('0xb')](),controller[_0x2850('0xc')]);router['get'](_0x2850('0xd'),auth[_0x2850('0xb')](),controller[_0x2850('0xe')]);var upload=multer({'storage':multer[_0x2850('0xf')]({'destination':function(_0x39a5ad,_0x36ffde,_0x1552e4){_0x1552e4(null,path['join'](config[_0x2850('0x10')],_0x2850('0x11')));},'filename':function(_0x1d3dea,_0x16905d,_0x42b534){_0x16905d['originalname']=_0x16905d[_0x2850('0x12')][_0x2850('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x42b534(null,util[_0x2850('0x14')](_0x2850('0x15'),path[_0x2850('0x16')](_0x16905d[_0x2850('0x12')],path[_0x2850('0x17')](_0x16905d['originalname'])),Date['now'](),path[_0x2850('0x17')](_0x16905d[_0x2850('0x12')])));}})});router[_0x2850('0x18')]('/',upload[_0x2850('0x19')](_0x2850('0x1a')),controller[_0x2850('0x1b')]);router[_0x2850('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x2850('0x1d')]);router[_0x2850('0x1e')](_0x2850('0x1f'),auth[_0x2850('0xb')](),controller[_0x2850('0x1e')]);module[_0x2850('0x20')]=router; \ No newline at end of file +var _0x500c=['basename','originalname','now','post','single','file','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','index','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','replace','format','%s-%s%s'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x500c,0x8a));var _0xc500=function(_0x4a28d4,_0x3b73b4){_0x4a28d4=_0x4a28d4-0x0;var _0x40e0f6=_0x500c[_0x4a28d4];return _0x40e0f6;};'use strict';var multer=require(_0xc500('0x0'));var util=require(_0xc500('0x1'));var path=require('path');var timeout=require(_0xc500('0x2'));var express=require(_0xc500('0x3'));var router=express[_0xc500('0x4')]();var fs_extra=require(_0xc500('0x5'));var auth=require(_0xc500('0x6'));var interaction=require(_0xc500('0x7'));var config=require(_0xc500('0x8'));var controller=require(_0xc500('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xc500('0xa')]);router['get'](_0xc500('0xb'),auth[_0xc500('0xc')](),controller[_0xc500('0xd')]);router['get'](_0xc500('0xe'),auth[_0xc500('0xc')](),controller[_0xc500('0xf')]);var upload=multer({'storage':multer[_0xc500('0x10')]({'destination':function(_0x3783df,_0xf2eab8,_0x5f0ef7){_0x5f0ef7(null,path[_0xc500('0x11')](config['root'],_0xc500('0x12')));},'filename':function(_0x3076e8,_0x1e16c9,_0x4668f0){_0x1e16c9['originalname']=_0x1e16c9['originalname'][_0xc500('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4668f0(null,util[_0xc500('0x14')](_0xc500('0x15'),path[_0xc500('0x16')](_0x1e16c9[_0xc500('0x17')],path['extname'](_0x1e16c9[_0xc500('0x17')])),Date[_0xc500('0x18')](),path['extname'](_0x1e16c9[_0xc500('0x17')])));}})});router[_0xc500('0x19')]('/',upload[_0xc500('0x1a')](_0xc500('0x1b')),controller[_0xc500('0x1c')]);router[_0xc500('0x1d')](_0xc500('0xb'),auth[_0xc500('0xc')](),controller[_0xc500('0x1e')]);router[_0xc500('0x1f')](_0xc500('0xb'),auth[_0xc500('0xc')](),controller[_0xc500('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 477d7cf..f99f68e 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 _0xdcdc=['STRING','name','FLOAT','BIGINT','INTEGER','exports'];(function(_0x15106b,_0x4d96f6){var _0x521203=function(_0x4dbe23){while(--_0x4dbe23){_0x15106b['push'](_0x15106b['shift']());}};_0x521203(++_0x4d96f6);}(_0xdcdc,0x8f));var _0xcdcd=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xdcdc[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0xcdcd('0x0')]={'name':{'type':Sequelize[_0xcdcd('0x1')],'unique':_0xcdcd('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xcdcd('0x1')]},'display_name':{'type':Sequelize[_0xcdcd('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xcdcd('0x1')]},'original_format':{'type':Sequelize[_0xcdcd('0x1')]},'original_duration':{'type':Sequelize[_0xcdcd('0x3')]},'original_sampleCount':{'type':Sequelize[_0xcdcd('0x4')]},'original_channelCount':{'type':Sequelize[_0xcdcd('0x5')]},'original_bitRate':{'type':Sequelize[_0xcdcd('0x4')]},'original_sampleRate':{'type':Sequelize[_0xcdcd('0x5')]},'converted_format':{'type':Sequelize[_0xcdcd('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xcdcd('0x5')]},'converted_bitRate':{'type':Sequelize[_0xcdcd('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xcdcd('0x5')]}}; \ No newline at end of file +var _0x4bde=['STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x28d984,_0xc128a){var _0x13ad90=function(_0x131a5b){while(--_0x131a5b){_0x28d984['push'](_0x28d984['shift']());}};_0x13ad90(++_0xc128a);}(_0x4bde,0x14a));var _0xe4bd=function(_0x3b4144,_0x477c1f){_0x3b4144=_0x3b4144-0x0;var _0x3cabf7=_0x4bde[_0x3b4144];return _0x3cabf7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe4bd('0x0')],'unique':_0xe4bd('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xe4bd('0x0')]},'display_name':{'type':Sequelize[_0xe4bd('0x0')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xe4bd('0x0')]},'original_duration':{'type':Sequelize[_0xe4bd('0x2')]},'original_sampleCount':{'type':Sequelize[_0xe4bd('0x3')]},'original_channelCount':{'type':Sequelize[_0xe4bd('0x4')]},'original_bitRate':{'type':Sequelize[_0xe4bd('0x3')]},'original_sampleRate':{'type':Sequelize[_0xe4bd('0x4')]},'converted_format':{'type':Sequelize[_0xe4bd('0x0')]},'converted_duration':{'type':Sequelize[_0xe4bd('0x2')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xe4bd('0x4')]},'converted_bitRate':{'type':Sequelize[_0xe4bd('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index a4af3a7..9fb8248 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 _0x12a8=['converted_bitRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','start','send','description','delete','format','original_format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','Sounds','error','stack','name','index','map','Sound','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','attributes','options','find','catch','download','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','%s.%s','create','basename','extname','originalname','file','filename','substring','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount'];(function(_0x50e0b4,_0x1057f7){var _0x2fa8b0=function(_0x3766bc){while(--_0x3766bc){_0x50e0b4['push'](_0x50e0b4['shift']());}};_0x2fa8b0(++_0x1057f7);}(_0x12a8,0x8c));var _0x812a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x12a8[_0xfae23b];return _0x200640;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x812a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x812a('0x1'));var rp=require(_0x812a('0x2'));var moment=require(_0x812a('0x3'));var BPromise=require(_0x812a('0x4'));var Mustache=require(_0x812a('0x5'));var util=require(_0x812a('0x6'));var path=require('path');var sox=require(_0x812a('0x7'));var csv=require(_0x812a('0x8'));var ejs=require(_0x812a('0x9'));var fs=require('fs');var fs_extra=require(_0x812a('0xa'));var _=require('lodash');var squel=require(_0x812a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x812a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x812a('0xd'));var Papa=require('papaparse');var Redis=require(_0x812a('0xe'));var authService=require(_0x812a('0xf'));var qs=require(_0x812a('0x10'));var as=require(_0x812a('0x11'));var hardwareService=require(_0x812a('0x12'));var logger=require('../../config/logger')(_0x812a('0x13'));var utils=require(_0x812a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x812a('0x15'));var db=require(_0x812a('0x16'))['db'];function respondWithStatusCode(_0x405c8e,_0x168b91){_0x168b91=_0x168b91||0xcc;return function(_0x316d80){if(_0x316d80){return _0x405c8e[_0x812a('0x17')](_0x168b91);}return _0x405c8e['status'](_0x168b91)[_0x812a('0x18')]();};}function respondWithResult(_0x3f5bf7,_0xaa64bc){_0xaa64bc=_0xaa64bc||0xc8;return function(_0x41e20c){if(_0x41e20c){return _0x3f5bf7[_0x812a('0x19')](_0xaa64bc)[_0x812a('0x1a')](_0x41e20c);}};}function respondWithFilteredResult(_0x12fdf9,_0x1a3706){return function(_0x27d70f){if(_0x27d70f){var _0x615496=typeof _0x1a3706[_0x812a('0x1b')]===_0x812a('0x1c')&&typeof _0x1a3706[_0x812a('0x1d')]===_0x812a('0x1c');var _0x144ada=_0x27d70f[_0x812a('0x1e')];var _0x105918=_0x615496?0x0:_0x1a3706[_0x812a('0x1b')];var _0x5ac93a=_0x615496?_0x27d70f[_0x812a('0x1e')]:_0x1a3706[_0x812a('0x1b')]+_0x1a3706[_0x812a('0x1d')];var _0x5c0e67;if(_0x5ac93a>=_0x144ada){_0x5ac93a=_0x144ada;_0x5c0e67=0xc8;}else{_0x5c0e67=0xce;}_0x12fdf9[_0x812a('0x19')](_0x5c0e67);return _0x12fdf9[_0x812a('0x1f')](_0x812a('0x20'),_0x105918+'-'+_0x5ac93a+'/'+_0x144ada)[_0x812a('0x1a')](_0x27d70f);}return null;};}function patchUpdates(_0x2f4552){return function(_0xa81080){try{jsonpatch[_0x812a('0x21')](_0xa81080,_0x2f4552,!![]);}catch(_0x4d5c1b){return BPromise[_0x812a('0x22')](_0x4d5c1b);}return _0xa81080['save']();};}function saveUpdates(_0x52c1cc,_0x13c76e){return function(_0xb237c9){if(_0xb237c9){return _0xb237c9[_0x812a('0x23')](_0x52c1cc)['then'](function(_0x4319b4){return _0x4319b4;});}return null;};}function removeEntity(_0x3fc8b7,_0x248ca4){return function(_0x3608ce){if(_0x3608ce){return _0x3608ce[_0x812a('0x24')]()[_0x812a('0x25')](function(){var _0x225bae=_0x3608ce[_0x812a('0x26')]({'plain':!![]});var _0x354b12=_0x812a('0x27');return db['UserProfileResource'][_0x812a('0x24')]({'where':{'type':_0x354b12,'resourceId':_0x225bae['id']}})['then'](function(){return _0x3608ce;});})['then'](function(){_0x3fc8b7[_0x812a('0x19')](0xcc)[_0x812a('0x18')]();});}};}function handleEntityNotFound(_0x4380fc,_0x3e77e7){return function(_0x45d3de){if(!_0x45d3de){_0x4380fc[_0x812a('0x17')](0x194);}return _0x45d3de;};}function handleError(_0x1f86cb,_0x22d168){_0x22d168=_0x22d168||0x1f4;return function(_0x1d2adb){logger[_0x812a('0x28')](_0x1d2adb[_0x812a('0x29')]);if(_0x1d2adb['name']){delete _0x1d2adb[_0x812a('0x2a')];}_0x1f86cb[_0x812a('0x19')](_0x22d168)['send'](_0x1d2adb);};}exports[_0x812a('0x2b')]=function(_0x49c5b5,_0x3d217e){var _0x100c2f={},_0x36ed10={},_0x348521={'count':0x0,'rows':[]};var _0x2c09de=_[_0x812a('0x2c')](db[_0x812a('0x2d')][_0x812a('0x2e')],function(_0x56ccfc){return{'name':_0x56ccfc[_0x812a('0x2f')],'type':_0x56ccfc['type'][_0x812a('0x30')]};});_0x36ed10[_0x812a('0x31')]=_[_0x812a('0x2c')](_0x2c09de,_0x812a('0x2a'));_0x36ed10[_0x812a('0x32')]=_[_0x812a('0x33')](_0x49c5b5[_0x812a('0x32')]);_0x36ed10[_0x812a('0x34')]=_[_0x812a('0x35')](_0x36ed10[_0x812a('0x31')],_0x36ed10[_0x812a('0x32')]);_0x100c2f['attributes']=_[_0x812a('0x35')](_0x36ed10['model'],qs[_0x812a('0x36')](_0x49c5b5['query'][_0x812a('0x36')]));_0x100c2f['attributes']=_0x100c2f['attributes'][_0x812a('0x37')]?_0x100c2f['attributes']:_0x36ed10['model'];if(!_0x49c5b5[_0x812a('0x32')][_0x812a('0x38')]('nolimit')){_0x100c2f['limit']=qs[_0x812a('0x1d')](_0x49c5b5[_0x812a('0x32')][_0x812a('0x1d')]);_0x100c2f[_0x812a('0x1b')]=qs[_0x812a('0x1b')](_0x49c5b5[_0x812a('0x32')]['offset']);}_0x100c2f['order']=qs['sort'](_0x49c5b5[_0x812a('0x32')][_0x812a('0x39')]);_0x100c2f[_0x812a('0x3a')]=qs[_0x812a('0x34')](_[_0x812a('0x3b')](_0x49c5b5[_0x812a('0x32')],_0x36ed10[_0x812a('0x34')]),_0x2c09de);if(_0x49c5b5[_0x812a('0x32')][_0x812a('0x3c')]){_0x100c2f[_0x812a('0x3a')]=_['merge'](_0x100c2f[_0x812a('0x3a')],{'$or':_[_0x812a('0x2c')](_0x2c09de,function(_0x473bde){if(_0x473bde[_0x812a('0x3d')]!==_0x812a('0x3e')){var _0x2fb8ae={};_0x2fb8ae[_0x473bde[_0x812a('0x2a')]]={'$like':'%'+_0x49c5b5[_0x812a('0x32')][_0x812a('0x3c')]+'%'};return _0x2fb8ae;}})});}_0x100c2f=_[_0x812a('0x3f')]({},_0x100c2f,_0x49c5b5['options']);var _0x5a90b5={'where':_0x100c2f[_0x812a('0x3a')]};return db[_0x812a('0x2d')][_0x812a('0x1e')](_0x5a90b5)['then'](function(_0x329b02){_0x348521[_0x812a('0x1e')]=_0x329b02;if(_0x49c5b5[_0x812a('0x32')][_0x812a('0x40')]){_0x100c2f[_0x812a('0x41')]=[{'all':!![]}];}return db[_0x812a('0x2d')][_0x812a('0x42')](_0x100c2f);})[_0x812a('0x25')](function(_0x1e2d73){_0x348521[_0x812a('0x43')]=_0x1e2d73;return _0x348521;})[_0x812a('0x25')](respondWithFilteredResult(_0x3d217e,_0x100c2f))['catch'](handleError(_0x3d217e,null));};exports[_0x812a('0x44')]=function(_0x6a3efc,_0x54300e){var _0x416cec={'raw':!![],'where':{'id':_0x6a3efc[_0x812a('0x45')]['id']}},_0x55454c={};_0x55454c[_0x812a('0x31')]=_[_0x812a('0x33')](db['Sound'][_0x812a('0x2e')]);_0x55454c[_0x812a('0x32')]=_[_0x812a('0x33')](_0x6a3efc['query']);_0x55454c['filters']=_['intersection'](_0x55454c[_0x812a('0x31')],_0x55454c[_0x812a('0x32')]);_0x416cec[_0x812a('0x46')]=_[_0x812a('0x35')](_0x55454c[_0x812a('0x31')],qs[_0x812a('0x36')](_0x6a3efc[_0x812a('0x32')][_0x812a('0x36')]));_0x416cec['attributes']=_0x416cec['attributes']['length']?_0x416cec[_0x812a('0x46')]:_0x55454c[_0x812a('0x31')];if(_0x6a3efc['query'][_0x812a('0x40')]){_0x416cec[_0x812a('0x41')]=[{'all':!![]}];}_0x416cec=_[_0x812a('0x3f')]({},_0x416cec,_0x6a3efc[_0x812a('0x47')]);return db[_0x812a('0x2d')][_0x812a('0x48')](_0x416cec)[_0x812a('0x25')](handleEntityNotFound(_0x54300e,null))[_0x812a('0x25')](respondWithResult(_0x54300e,null))[_0x812a('0x49')](handleError(_0x54300e,null));};exports[_0x812a('0x4a')]=function(_0x149d34,_0x39e6f7,_0x583d0e){return db['Sound'][_0x812a('0x48')]({'where':{'id':_0x149d34[_0x812a('0x45')]['id']},'attributes':[_0x812a('0x2a'),_0x812a('0x4b'),_0x812a('0x4c')],'raw':!![]})[_0x812a('0x25')](handleEntityNotFound(_0x39e6f7,null))[_0x812a('0x25')](function(_0x32041c){if(_0x32041c){if(!fs[_0x812a('0x4d')](path[_0x812a('0x4e')](config[_0x812a('0x4f')],'server/files/sounds/converted',_0x32041c[_0x812a('0x4b')]+'.'+_0x32041c[_0x812a('0x4c')]))){throw new db[(_0x812a('0x50'))][(_0x812a('0x51'))](_0x812a('0x52'));}return _0x39e6f7[_0x812a('0x4a')](path[_0x812a('0x4e')](config[_0x812a('0x4f')],_0x812a('0x53'),util['format'](_0x812a('0x54'),_0x32041c[_0x812a('0x4b')],_0x32041c[_0x812a('0x4c')])),util['format'](_0x812a('0x54'),_0x32041c[_0x812a('0x2a')],_0x32041c[_0x812a('0x4c')]));}return null;})[_0x812a('0x49')](handleError(_0x39e6f7,null));};exports[_0x812a('0x55')]=function(_0x53602b,_0x1fb7ed,_0xd25e13){var _0xe9fd89={'name':path[_0x812a('0x56')](_0x53602b['file']['originalname'],path[_0x812a('0x57')](_0x53602b['file'][_0x812a('0x58')])),'save_name':path[_0x812a('0x56')](_0x53602b[_0x812a('0x59')][_0x812a('0x5a')],path[_0x812a('0x57')](_0x53602b[_0x812a('0x59')][_0x812a('0x5a')])),'original_format':path[_0x812a('0x57')](_0x53602b['file'][_0x812a('0x58')])[_0x812a('0x5b')](0x1),'converted_format':'wav'};var _0x426f88=path[_0x812a('0x4e')](config['root'],'server/files/sounds/original',_0x53602b[_0x812a('0x59')][_0x812a('0x5a')]);var _0x8d9855=path[_0x812a('0x4e')](config[_0x812a('0x4f')],_0x812a('0x53'),util['format'](_0x812a('0x54'),path[_0x812a('0x56')](_0x53602b[_0x812a('0x59')][_0x812a('0x5a')],path['extname'](_0x53602b[_0x812a('0x59')][_0x812a('0x5a')])),_0xe9fd89[_0x812a('0x4c')]));logger[_0x812a('0x5c')](_0x812a('0x5d'),_0x426f88);logger[_0x812a('0x5c')](_0x812a('0x5e'),_0x8d9855);try{fs[_0x812a('0x5f')](_0x426f88,parseInt(_0x812a('0x60'),0x8));var _0x167347=sox[_0x812a('0x61')](_0x426f88,_0x8d9855,{'sampleRate':0x1f40,'format':_0x812a('0x62'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x167347['on'](_0x812a('0x28'),function(_0x4fc246){fs[_0x812a('0x63')](_0x426f88);_0x1fb7ed[_0x812a('0x19')](0x1f4)['send'](_0x4fc246);});_0x167347['on']('src',function(_0xabbf00){_0xe9fd89['original_duration']=isNaN(_0xabbf00[_0x812a('0x64')])?null:_0xabbf00[_0x812a('0x64')]*0x3e8;_0xe9fd89[_0x812a('0x65')]=isNaN(_0xabbf00['sampleCount'])?null:_0xabbf00[_0x812a('0x66')];_0xe9fd89['original_channelCount']=isNaN(_0xabbf00[_0x812a('0x67')])?null:_0xabbf00[_0x812a('0x67')];_0xe9fd89[_0x812a('0x68')]=isNaN(_0xabbf00['bitRate'])?null:_0xabbf00[_0x812a('0x69')];_0xe9fd89[_0x812a('0x6a')]=isNaN(_0xabbf00[_0x812a('0x6b')])?null:_0xabbf00[_0x812a('0x6b')];});_0x167347['on'](_0x812a('0x6c'),function(_0x226ee){_0xe9fd89[_0x812a('0x6d')]=isNaN(_0x226ee[_0x812a('0x64')])?null:_0x226ee[_0x812a('0x64')]*0x3e8;_0xe9fd89[_0x812a('0x6e')]=isNaN(_0x226ee[_0x812a('0x66')])?null:_0x226ee[_0x812a('0x66')];_0xe9fd89[_0x812a('0x6f')]=isNaN(_0x226ee['channelCount'])?null:_0x226ee[_0x812a('0x67')];_0xe9fd89[_0x812a('0x70')]=isNaN(_0x226ee[_0x812a('0x69')])?null:_0x226ee[_0x812a('0x69')];_0xe9fd89['converted_sampleRate']=isNaN(_0x226ee[_0x812a('0x6b')])?null:_0x226ee[_0x812a('0x6b')];});_0x167347['on'](_0x812a('0x18'),function(){fs[_0x812a('0x5f')](_0x8d9855,parseInt(_0x812a('0x60'),0x8));return db[_0x812a('0x2d')][_0x812a('0x55')](_0xe9fd89)[_0x812a('0x25')](function(_0x381e7a){var _0x4a7fc7={'role':_0x53602b['body'][_0x812a('0x71')],'userProfileId':_0x53602b[_0x812a('0x72')][_0x812a('0x73')]};if(!_0x4a7fc7)throw new Error(_0x812a('0x74'));if(_0x4a7fc7[_0x812a('0x71')]===_0x812a('0x75')){var _0x1252ef=_0x381e7a[_0x812a('0x26')]({'plain':!![]});return db[_0x812a('0x76')]['find']({'where':{'name':_0x812a('0x27'),'userProfileId':_0x4a7fc7['userProfileId']},'raw':!![]})['then'](function(_0x119386){if(_0x119386&&_0x119386[_0x812a('0x77')]===0x0){return db['UserProfileResource'][_0x812a('0x55')]({'name':_0x1252ef[_0x812a('0x2a')],'resourceId':_0x1252ef['id'],'type':_0x119386['name'],'sectionId':_0x119386['id']},{})[_0x812a('0x25')](function(){return _0x381e7a;});}else{return _0x381e7a;}})[_0x812a('0x49')](function(_0x1845d8){logger[_0x812a('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1845d8);throw _0x1845d8;});}return _0x381e7a;})[_0x812a('0x25')](respondWithResult(_0x1fb7ed,null))[_0x812a('0x49')](handleError(_0x1fb7ed,null));});_0x167347[_0x812a('0x78')]();}catch(_0x4758bf){_0x1fb7ed['status'](0x1f4)[_0x812a('0x79')](_0x4758bf);}};exports['update']=function(_0x39c8f6,_0x15bca0,_0x4c35af){return db[_0x812a('0x2d')][_0x812a('0x48')]({'where':{'id':_0x39c8f6[_0x812a('0x45')]['id']}})[_0x812a('0x25')](handleEntityNotFound(_0x15bca0,null))[_0x812a('0x25')](saveUpdates(_['pick'](_0x39c8f6['body'],['name',_0x812a('0x7a')]),null))[_0x812a('0x25')](respondWithResult(_0x15bca0,null))[_0x812a('0x49')](handleError(_0x15bca0,null));};exports[_0x812a('0x7b')]=function(_0x498a5a,_0x1224fd,_0x43bc82){return db[_0x812a('0x2d')][_0x812a('0x48')]({'where':{'id':_0x498a5a[_0x812a('0x45')]['id']}})['then'](function(_0x2746bf){if(_0x2746bf){return _0x2746bf[_0x812a('0x24')]();}})[_0x812a('0x25')](function(_0x45dfc2){var _0x23f545=path['join'](config['root'],'server/files/sounds/original',util[_0x812a('0x7c')]('%s.%s',_0x45dfc2['save_name'],_0x45dfc2[_0x812a('0x7d')]));var _0x39010d=path[_0x812a('0x4e')](config['root'],'server/files/sounds/converted',util[_0x812a('0x7c')]('%s.%s',_0x45dfc2[_0x812a('0x4b')],_0x45dfc2[_0x812a('0x4c')]));fs[_0x812a('0x63')](_0x23f545);fs[_0x812a('0x63')](_0x39010d);return _0x45dfc2;})[_0x812a('0x25')](function(_0x497930){if(_0x497930){return _0x1224fd[_0x812a('0x19')](0xcc)[_0x812a('0x18')]();}})['then'](handleEntityNotFound(_0x1224fd,null))['catch'](handleError(_0x1224fd,null));}; \ No newline at end of file +var _0xebd1=['limit','count','set','apply','reject','save','then','destroy','UserProfileResource','error','stack','name','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','VIRTUAL','filter','merge','options','include','findAll','includeAll','find','params','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','download','format','%s.%s','create','basename','originalname','file','filename','substring','wav','server/files/sounds/original','join','extname','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','0777','transcode','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','Sounds','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','send','update','pick','description','delete','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined'];(function(_0x2b8e06,_0x103245){var _0x222aec=function(_0x1a02f1){while(--_0x1a02f1){_0x2b8e06['push'](_0x2b8e06['shift']());}};_0x222aec(++_0x103245);}(_0xebd1,0x168));var _0x1ebd=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0xebd1[_0x36f243];return _0x426436;};'use strict';var emlformat=require(_0x1ebd('0x0'));var rimraf=require(_0x1ebd('0x1'));var zipdir=require(_0x1ebd('0x2'));var jsonpatch=require(_0x1ebd('0x3'));var rp=require('request-promise');var moment=require(_0x1ebd('0x4'));var BPromise=require(_0x1ebd('0x5'));var Mustache=require(_0x1ebd('0x6'));var util=require(_0x1ebd('0x7'));var path=require(_0x1ebd('0x8'));var sox=require(_0x1ebd('0x9'));var csv=require(_0x1ebd('0xa'));var ejs=require(_0x1ebd('0xb'));var fs=require('fs');var fs_extra=require(_0x1ebd('0xc'));var _=require(_0x1ebd('0xd'));var squel=require(_0x1ebd('0xe'));var crypto=require(_0x1ebd('0xf'));var jsforce=require(_0x1ebd('0x10'));var deskjs=require(_0x1ebd('0x11'));var toCsv=require('to-csv');var querystring=require(_0x1ebd('0x12'));var Papa=require(_0x1ebd('0x13'));var Redis=require(_0x1ebd('0x14'));var authService=require(_0x1ebd('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ebd('0x16'));var logger=require(_0x1ebd('0x17'))('api');var utils=require(_0x1ebd('0x18'));var config=require(_0x1ebd('0x19'));var licenseUtil=require(_0x1ebd('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4caf8c,_0xf54bd9){_0xf54bd9=_0xf54bd9||0xcc;return function(_0x2dad06){if(_0x2dad06){return _0x4caf8c[_0x1ebd('0x1b')](_0xf54bd9);}return _0x4caf8c[_0x1ebd('0x1c')](_0xf54bd9)[_0x1ebd('0x1d')]();};}function respondWithResult(_0x103da9,_0xdbb80e){_0xdbb80e=_0xdbb80e||0xc8;return function(_0x48549b){if(_0x48549b){return _0x103da9[_0x1ebd('0x1c')](_0xdbb80e)[_0x1ebd('0x1e')](_0x48549b);}};}function respondWithFilteredResult(_0x38229e,_0x5b420e){return function(_0x54e5dd){if(_0x54e5dd){var _0x2b103f=typeof _0x5b420e[_0x1ebd('0x1f')]===_0x1ebd('0x20')&&typeof _0x5b420e[_0x1ebd('0x21')]===_0x1ebd('0x20');var _0x34997b=_0x54e5dd[_0x1ebd('0x22')];var _0x1af067=_0x2b103f?0x0:_0x5b420e['offset'];var _0x565f52=_0x2b103f?_0x54e5dd[_0x1ebd('0x22')]:_0x5b420e['offset']+_0x5b420e['limit'];var _0x599871;if(_0x565f52>=_0x34997b){_0x565f52=_0x34997b;_0x599871=0xc8;}else{_0x599871=0xce;}_0x38229e[_0x1ebd('0x1c')](_0x599871);return _0x38229e[_0x1ebd('0x23')]('Content-Range',_0x1af067+'-'+_0x565f52+'/'+_0x34997b)[_0x1ebd('0x1e')](_0x54e5dd);}return null;};}function patchUpdates(_0x53ec40){return function(_0x2eb2da){try{jsonpatch[_0x1ebd('0x24')](_0x2eb2da,_0x53ec40,!![]);}catch(_0x16955d){return BPromise[_0x1ebd('0x25')](_0x16955d);}return _0x2eb2da[_0x1ebd('0x26')]();};}function saveUpdates(_0x1d0853,_0x48a9c5){return function(_0x1bc64c){if(_0x1bc64c){return _0x1bc64c['update'](_0x1d0853)[_0x1ebd('0x27')](function(_0x13d2f0){return _0x13d2f0;});}return null;};}function removeEntity(_0x134592,_0x322ea7){return function(_0x3c8b62){if(_0x3c8b62){return _0x3c8b62[_0x1ebd('0x28')]()[_0x1ebd('0x27')](function(){var _0x5d0d92=_0x3c8b62['get']({'plain':!![]});var _0x10773b='Sounds';return db[_0x1ebd('0x29')][_0x1ebd('0x28')]({'where':{'type':_0x10773b,'resourceId':_0x5d0d92['id']}})[_0x1ebd('0x27')](function(){return _0x3c8b62;});})[_0x1ebd('0x27')](function(){_0x134592[_0x1ebd('0x1c')](0xcc)[_0x1ebd('0x1d')]();});}};}function handleEntityNotFound(_0x13346b,_0x2f74a6){return function(_0x359a4a){if(!_0x359a4a){_0x13346b[_0x1ebd('0x1b')](0x194);}return _0x359a4a;};}function handleError(_0x144b9b,_0x5b52c4){_0x5b52c4=_0x5b52c4||0x1f4;return function(_0x1df846){logger[_0x1ebd('0x2a')](_0x1df846[_0x1ebd('0x2b')]);if(_0x1df846['name']){delete _0x1df846[_0x1ebd('0x2c')];}_0x144b9b[_0x1ebd('0x1c')](_0x5b52c4)['send'](_0x1df846);};}exports['index']=function(_0x1edf52,_0x10ec32){var _0x161ffd={},_0x27d553={},_0x232881={'count':0x0,'rows':[]};var _0x3ad8a9=_[_0x1ebd('0x2d')](db[_0x1ebd('0x2e')][_0x1ebd('0x2f')],function(_0x51e095){return{'name':_0x51e095[_0x1ebd('0x30')],'type':_0x51e095[_0x1ebd('0x31')][_0x1ebd('0x32')]};});_0x27d553[_0x1ebd('0x33')]=_[_0x1ebd('0x2d')](_0x3ad8a9,'name');_0x27d553[_0x1ebd('0x34')]=_[_0x1ebd('0x35')](_0x1edf52[_0x1ebd('0x34')]);_0x27d553['filters']=_[_0x1ebd('0x36')](_0x27d553[_0x1ebd('0x33')],_0x27d553[_0x1ebd('0x34')]);_0x161ffd[_0x1ebd('0x37')]=_['intersection'](_0x27d553['model'],qs[_0x1ebd('0x38')](_0x1edf52[_0x1ebd('0x34')][_0x1ebd('0x38')]));_0x161ffd[_0x1ebd('0x37')]=_0x161ffd[_0x1ebd('0x37')][_0x1ebd('0x39')]?_0x161ffd['attributes']:_0x27d553['model'];if(!_0x1edf52[_0x1ebd('0x34')]['hasOwnProperty']('nolimit')){_0x161ffd['limit']=qs[_0x1ebd('0x21')](_0x1edf52[_0x1ebd('0x34')][_0x1ebd('0x21')]);_0x161ffd['offset']=qs[_0x1ebd('0x1f')](_0x1edf52[_0x1ebd('0x34')][_0x1ebd('0x1f')]);}_0x161ffd[_0x1ebd('0x3a')]=qs[_0x1ebd('0x3b')](_0x1edf52[_0x1ebd('0x34')][_0x1ebd('0x3b')]);_0x161ffd[_0x1ebd('0x3c')]=qs[_0x1ebd('0x3d')](_['pick'](_0x1edf52['query'],_0x27d553[_0x1ebd('0x3d')]),_0x3ad8a9);if(_0x1edf52['query']['filter']){_0x161ffd[_0x1ebd('0x3c')]=_['merge'](_0x161ffd[_0x1ebd('0x3c')],{'$or':_[_0x1ebd('0x2d')](_0x3ad8a9,function(_0x19b923){if(_0x19b923[_0x1ebd('0x31')]!==_0x1ebd('0x3e')){var _0x11fb1a={};_0x11fb1a[_0x19b923['name']]={'$like':'%'+_0x1edf52[_0x1ebd('0x34')][_0x1ebd('0x3f')]+'%'};return _0x11fb1a;}})});}_0x161ffd=_[_0x1ebd('0x40')]({},_0x161ffd,_0x1edf52[_0x1ebd('0x41')]);var _0x4f36e4={'where':_0x161ffd[_0x1ebd('0x3c')]};return db[_0x1ebd('0x2e')][_0x1ebd('0x22')](_0x4f36e4)[_0x1ebd('0x27')](function(_0x3618cc){_0x232881[_0x1ebd('0x22')]=_0x3618cc;if(_0x1edf52[_0x1ebd('0x34')]['includeAll']){_0x161ffd[_0x1ebd('0x42')]=[{'all':!![]}];}return db['Sound'][_0x1ebd('0x43')](_0x161ffd);})[_0x1ebd('0x27')](function(_0x4924cc){_0x232881['rows']=_0x4924cc;return _0x232881;})['then'](respondWithFilteredResult(_0x10ec32,_0x161ffd))['catch'](handleError(_0x10ec32,null));};exports['show']=function(_0x95c8b3,_0x59056e){var _0x1a1760={'raw':!![],'where':{'id':_0x95c8b3['params']['id']}},_0x5ede24={};_0x5ede24[_0x1ebd('0x33')]=_['keys'](db[_0x1ebd('0x2e')][_0x1ebd('0x2f')]);_0x5ede24['query']=_[_0x1ebd('0x35')](_0x95c8b3['query']);_0x5ede24[_0x1ebd('0x3d')]=_['intersection'](_0x5ede24[_0x1ebd('0x33')],_0x5ede24['query']);_0x1a1760[_0x1ebd('0x37')]=_['intersection'](_0x5ede24[_0x1ebd('0x33')],qs[_0x1ebd('0x38')](_0x95c8b3[_0x1ebd('0x34')][_0x1ebd('0x38')]));_0x1a1760[_0x1ebd('0x37')]=_0x1a1760[_0x1ebd('0x37')][_0x1ebd('0x39')]?_0x1a1760[_0x1ebd('0x37')]:_0x5ede24['model'];if(_0x95c8b3['query'][_0x1ebd('0x44')]){_0x1a1760[_0x1ebd('0x42')]=[{'all':!![]}];}_0x1a1760=_['merge']({},_0x1a1760,_0x95c8b3[_0x1ebd('0x41')]);return db[_0x1ebd('0x2e')]['find'](_0x1a1760)['then'](handleEntityNotFound(_0x59056e,null))[_0x1ebd('0x27')](respondWithResult(_0x59056e,null))['catch'](handleError(_0x59056e,null));};exports['download']=function(_0x375aed,_0xc6c1eb,_0x197fe4){return db['Sound'][_0x1ebd('0x45')]({'where':{'id':_0x375aed[_0x1ebd('0x46')]['id']},'attributes':['name',_0x1ebd('0x47'),_0x1ebd('0x48')],'raw':!![]})[_0x1ebd('0x27')](handleEntityNotFound(_0xc6c1eb,null))['then'](function(_0x11558f){if(_0x11558f){if(!fs[_0x1ebd('0x49')](path['join'](config[_0x1ebd('0x4a')],_0x1ebd('0x4b'),_0x11558f['save_name']+'.'+_0x11558f[_0x1ebd('0x48')]))){throw new db[(_0x1ebd('0x4c'))][(_0x1ebd('0x4d'))](_0x1ebd('0x4e'));}return _0xc6c1eb[_0x1ebd('0x4f')](path['join'](config[_0x1ebd('0x4a')],_0x1ebd('0x4b'),util[_0x1ebd('0x50')](_0x1ebd('0x51'),_0x11558f[_0x1ebd('0x47')],_0x11558f[_0x1ebd('0x48')])),util['format'](_0x1ebd('0x51'),_0x11558f['name'],_0x11558f[_0x1ebd('0x48')]));}return null;})['catch'](handleError(_0xc6c1eb,null));};exports[_0x1ebd('0x52')]=function(_0x3fc4f6,_0x3901ca,_0x30bc21){var _0x575597={'name':path[_0x1ebd('0x53')](_0x3fc4f6['file'][_0x1ebd('0x54')],path['extname'](_0x3fc4f6[_0x1ebd('0x55')]['originalname'])),'save_name':path[_0x1ebd('0x53')](_0x3fc4f6[_0x1ebd('0x55')][_0x1ebd('0x56')],path['extname'](_0x3fc4f6[_0x1ebd('0x55')][_0x1ebd('0x56')])),'original_format':path['extname'](_0x3fc4f6[_0x1ebd('0x55')][_0x1ebd('0x54')])[_0x1ebd('0x57')](0x1),'converted_format':_0x1ebd('0x58')};var _0x2c7edf=path['join'](config[_0x1ebd('0x4a')],_0x1ebd('0x59'),_0x3fc4f6['file']['filename']);var _0x51c31=path[_0x1ebd('0x5a')](config[_0x1ebd('0x4a')],_0x1ebd('0x4b'),util[_0x1ebd('0x50')](_0x1ebd('0x51'),path['basename'](_0x3fc4f6['file']['filename'],path[_0x1ebd('0x5b')](_0x3fc4f6[_0x1ebd('0x55')]['filename'])),_0x575597[_0x1ebd('0x48')]));logger['info'](_0x1ebd('0x5c'),_0x2c7edf);logger[_0x1ebd('0x5d')](_0x1ebd('0x5e'),_0x51c31);try{fs['chmodSync'](_0x2c7edf,parseInt(_0x1ebd('0x5f'),0x8));var _0x10b056=sox[_0x1ebd('0x60')](_0x2c7edf,_0x51c31,{'sampleRate':0x1f40,'format':_0x1ebd('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x10b056['on'](_0x1ebd('0x2a'),function(_0x594097){fs['unlinkSync'](_0x2c7edf);_0x3901ca[_0x1ebd('0x1c')](0x1f4)['send'](_0x594097);});_0x10b056['on'](_0x1ebd('0x61'),function(_0x5c21df){_0x575597[_0x1ebd('0x62')]=isNaN(_0x5c21df['duration'])?null:_0x5c21df[_0x1ebd('0x63')]*0x3e8;_0x575597['original_sampleCount']=isNaN(_0x5c21df[_0x1ebd('0x64')])?null:_0x5c21df['sampleCount'];_0x575597[_0x1ebd('0x65')]=isNaN(_0x5c21df[_0x1ebd('0x66')])?null:_0x5c21df[_0x1ebd('0x66')];_0x575597[_0x1ebd('0x67')]=isNaN(_0x5c21df['bitRate'])?null:_0x5c21df[_0x1ebd('0x68')];_0x575597[_0x1ebd('0x69')]=isNaN(_0x5c21df[_0x1ebd('0x6a')])?null:_0x5c21df[_0x1ebd('0x6a')];});_0x10b056['on'](_0x1ebd('0x6b'),function(_0x76d5d6){_0x575597[_0x1ebd('0x6c')]=isNaN(_0x76d5d6[_0x1ebd('0x63')])?null:_0x76d5d6[_0x1ebd('0x63')]*0x3e8;_0x575597[_0x1ebd('0x6d')]=isNaN(_0x76d5d6[_0x1ebd('0x64')])?null:_0x76d5d6[_0x1ebd('0x64')];_0x575597[_0x1ebd('0x6e')]=isNaN(_0x76d5d6[_0x1ebd('0x66')])?null:_0x76d5d6[_0x1ebd('0x66')];_0x575597[_0x1ebd('0x6f')]=isNaN(_0x76d5d6[_0x1ebd('0x68')])?null:_0x76d5d6[_0x1ebd('0x68')];_0x575597[_0x1ebd('0x70')]=isNaN(_0x76d5d6['sampleRate'])?null:_0x76d5d6['sampleRate'];});_0x10b056['on']('end',function(){fs['chmodSync'](_0x51c31,parseInt('0777',0x8));return db[_0x1ebd('0x2e')][_0x1ebd('0x52')](_0x575597)[_0x1ebd('0x27')](function(_0x186068){var _0x3c9baf={'role':_0x3fc4f6[_0x1ebd('0x71')]['role'],'userProfileId':_0x3fc4f6[_0x1ebd('0x71')][_0x1ebd('0x72')]};if(!_0x3c9baf)throw new Error(_0x1ebd('0x73'));if(_0x3c9baf[_0x1ebd('0x74')]===_0x1ebd('0x75')){var _0x84755a=_0x186068[_0x1ebd('0x76')]({'plain':!![]});return db[_0x1ebd('0x77')][_0x1ebd('0x45')]({'where':{'name':_0x1ebd('0x78'),'userProfileId':_0x3c9baf[_0x1ebd('0x72')]},'raw':!![]})['then'](function(_0x162743){if(_0x162743&&_0x162743[_0x1ebd('0x79')]===0x0){return db['UserProfileResource'][_0x1ebd('0x52')]({'name':_0x84755a[_0x1ebd('0x2c')],'resourceId':_0x84755a['id'],'type':_0x162743[_0x1ebd('0x2c')],'sectionId':_0x162743['id']},{})[_0x1ebd('0x27')](function(){return _0x186068;});}else{return _0x186068;}})[_0x1ebd('0x7a')](function(_0x4e25e3){logger['error'](_0x1ebd('0x7b'),_0x4e25e3);throw _0x4e25e3;});}return _0x186068;})[_0x1ebd('0x27')](respondWithResult(_0x3901ca,null))[_0x1ebd('0x7a')](handleError(_0x3901ca,null));});_0x10b056[_0x1ebd('0x7c')]();}catch(_0x56c0ff){_0x3901ca[_0x1ebd('0x1c')](0x1f4)[_0x1ebd('0x7d')](_0x56c0ff);}};exports[_0x1ebd('0x7e')]=function(_0x4b3d3a,_0x1f70db,_0x283c0c){return db[_0x1ebd('0x2e')][_0x1ebd('0x45')]({'where':{'id':_0x4b3d3a[_0x1ebd('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f70db,null))['then'](saveUpdates(_[_0x1ebd('0x7f')](_0x4b3d3a['body'],['name',_0x1ebd('0x80')]),null))['then'](respondWithResult(_0x1f70db,null))[_0x1ebd('0x7a')](handleError(_0x1f70db,null));};exports[_0x1ebd('0x81')]=function(_0x1ceee6,_0x2029a1,_0xf7c8b4){return db['Sound'][_0x1ebd('0x45')]({'where':{'id':_0x1ceee6['params']['id']}})['then'](function(_0x57795d){if(_0x57795d){return _0x57795d[_0x1ebd('0x28')]();}})[_0x1ebd('0x27')](function(_0x902ad7){var _0x22b17e=path[_0x1ebd('0x5a')](config[_0x1ebd('0x4a')],_0x1ebd('0x59'),util['format'](_0x1ebd('0x51'),_0x902ad7['save_name'],_0x902ad7['original_format']));var _0x47a6d8=path['join'](config[_0x1ebd('0x4a')],_0x1ebd('0x4b'),util[_0x1ebd('0x50')](_0x1ebd('0x51'),_0x902ad7[_0x1ebd('0x47')],_0x902ad7[_0x1ebd('0x48')]));fs[_0x1ebd('0x82')](_0x22b17e);fs['unlinkSync'](_0x47a6d8);return _0x902ad7;})[_0x1ebd('0x27')](function(_0x570c68){if(_0x570c68){return _0x2029a1['status'](0xcc)[_0x1ebd('0x1d')]();}})[_0x1ebd('0x27')](handleEntityNotFound(_0x2029a1,null))[_0x1ebd('0x7a')](handleError(_0x2029a1,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index c2dfb1a..fbd5589 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 _0xb2a9=['../../config/environment','./sound.attributes','Sound','tools_sounds','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb2a9,0x13c));var _0x9b2a=function(_0x180b72,_0x36f63d){_0x180b72=_0x180b72-0x0;var _0x41dcaf=_0xb2a9[_0x180b72];return _0x41dcaf;};'use strict';var _=require(_0x9b2a('0x0'));var util=require(_0x9b2a('0x1'));var logger=require(_0x9b2a('0x2'))(_0x9b2a('0x3'));var moment=require('moment');var BPromise=require(_0x9b2a('0x4'));var rp=require(_0x9b2a('0x5'));var fs=require('fs');var path=require(_0x9b2a('0x6'));var rimraf=require(_0x9b2a('0x7'));var config=require(_0x9b2a('0x8'));var attributes=require(_0x9b2a('0x9'));module['exports']=function(_0x113ce4,_0x1b51a1){return _0x113ce4['define'](_0x9b2a('0xa'),attributes,{'tableName':_0x9b2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6eef=['rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3ed0c3,_0x4a8864){var _0x20ea68=function(_0x41cdc2){while(--_0x41cdc2){_0x3ed0c3['push'](_0x3ed0c3['shift']());}};_0x20ea68(++_0x4a8864);}(_0x6eef,0x173));var _0xf6ee=function(_0xf363f0,_0x3b5eeb){_0xf363f0=_0xf363f0-0x0;var _0x55a386=_0x6eef[_0xf363f0];return _0x55a386;};'use strict';var _=require(_0xf6ee('0x0'));var util=require(_0xf6ee('0x1'));var logger=require(_0xf6ee('0x2'))(_0xf6ee('0x3'));var moment=require(_0xf6ee('0x4'));var BPromise=require(_0xf6ee('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf6ee('0x6'));var rimraf=require(_0xf6ee('0x7'));var config=require(_0xf6ee('0x8'));var attributes=require(_0xf6ee('0x9'));module[_0xf6ee('0xa')]=function(_0x21f68b,_0x2cf9cc){return _0x21f68b[_0xf6ee('0xb')](_0xf6ee('0xc'),attributes,{'tableName':_0xf6ee('0xd'),'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 586ea98..86a23a1 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 _0x4e11=['http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSound','Sound','find','options','where','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x2f4ebb,_0x3d8f4e){var _0x5c141a=function(_0x29b11e){while(--_0x29b11e){_0x2f4ebb['push'](_0x2f4ebb['shift']());}};_0x5c141a(++_0x3d8f4e);}(_0x4e11,0xa5));var _0x14e1=function(_0x3f8f4b,_0x468f9f){_0x3f8f4b=_0x3f8f4b-0x0;var _0x43135c=_0x4e11[_0x3f8f4b];return _0x43135c;};'use strict';var _=require('lodash');var util=require(_0x14e1('0x0'));var moment=require(_0x14e1('0x1'));var BPromise=require(_0x14e1('0x2'));var rs=require(_0x14e1('0x3'));var fs=require('fs');var Redis=require(_0x14e1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x14e1('0x5'))('rpc');var config=require(_0x14e1('0x6'));var jayson=require(_0x14e1('0x7'));var client=jayson[_0x14e1('0x8')][_0x14e1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x496fc5,_0x44d47d,_0x21f846){return new BPromise(function(_0x3a7ee3,_0x2cad64){return client[_0x14e1('0xa')](_0x496fc5,_0x21f846)['then'](function(_0x3725ca){logger[_0x14e1('0xb')](_0x14e1('0xc'),_0x44d47d,_0x14e1('0xd'));logger[_0x14e1('0xe')](_0x14e1('0xf'),_0x44d47d,_0x14e1('0xd'),JSON[_0x14e1('0x10')](_0x3725ca));if(_0x3725ca['error']){if(_0x3725ca[_0x14e1('0x11')]['code']===0x1f4){logger['error'](_0x14e1('0xc'),_0x44d47d,_0x3725ca[_0x14e1('0x11')][_0x14e1('0x12')]);return _0x2cad64(_0x3725ca[_0x14e1('0x11')][_0x14e1('0x12')]);}logger[_0x14e1('0x11')]('Sound,\x20%s,\x20%s',_0x44d47d,_0x3725ca[_0x14e1('0x11')][_0x14e1('0x12')]);return _0x3a7ee3(_0x3725ca[_0x14e1('0x11')][_0x14e1('0x12')]);}else{logger[_0x14e1('0xb')](_0x14e1('0xc'),_0x44d47d,_0x14e1('0xd'));_0x3a7ee3(_0x3725ca['result']['message']);}})[_0x14e1('0x13')](function(_0x34b203){logger[_0x14e1('0x11')](_0x14e1('0xc'),_0x44d47d,_0x34b203);_0x2cad64(_0x34b203);});});}exports[_0x14e1('0x14')]=function(_0x510017){var _0x149485=this;return new Promise(function(_0x254566,_0x12f0ea){return db[_0x14e1('0x15')][_0x14e1('0x16')]({'raw':_0x510017[_0x14e1('0x17')]?_0x510017[_0x14e1('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x510017[_0x14e1('0x17')]?_0x510017[_0x14e1('0x17')][_0x14e1('0x18')]||null:null,'attributes':_0x510017[_0x14e1('0x17')]?_0x510017[_0x14e1('0x17')][_0x14e1('0x19')]||null:null,'include':_0x510017['options']?_0x510017[_0x14e1('0x17')][_0x14e1('0x1a')]?_[_0x14e1('0x1b')](_0x510017['options']['include'],function(_0x386200){return{'model':db[_0x386200[_0x14e1('0x1c')]],'as':_0x386200['as'],'attributes':_0x386200[_0x14e1('0x19')],'include':_0x386200[_0x14e1('0x1a')]?_[_0x14e1('0x1b')](_0x386200[_0x14e1('0x1a')],function(_0x44538f){return{'model':db[_0x44538f['model']],'as':_0x44538f['as'],'attributes':_0x44538f[_0x14e1('0x19')],'include':_0x44538f[_0x14e1('0x1a')]?_[_0x14e1('0x1b')](_0x44538f[_0x14e1('0x1a')],function(_0x3821c6){return{'model':db[_0x3821c6[_0x14e1('0x1c')]],'as':_0x3821c6['as'],'attributes':_0x3821c6[_0x14e1('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8804c4){logger['info'](_0x14e1('0x14'),_0x510017);logger['debug'](_0x14e1('0x14'),_0x510017,JSON['stringify'](_0x8804c4));_0x254566(_0x8804c4);})[_0x14e1('0x13')](function(_0x251857){logger[_0x14e1('0x11')](_0x14e1('0x14'),_0x251857['message'],_0x510017);_0x12f0ea(_0x149485[_0x14e1('0x11')](0x1f4,_0x251857[_0x14e1('0x12')]));});});}; \ No newline at end of file +var _0x4af0=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','code','Sound,\x20%s,\x20%s','message','ShowSound','Sound','find','raw','options','where','attributes','include','map','model','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x42cf7f,_0x1f9bf9){var _0x5008f6=function(_0x1b8a5a){while(--_0x1b8a5a){_0x42cf7f['push'](_0x42cf7f['shift']());}};_0x5008f6(++_0x1f9bf9);}(_0x4af0,0x109));var _0x04af=function(_0x20895b,_0x198888){_0x20895b=_0x20895b-0x0;var _0x4147ab=_0x4af0[_0x20895b];return _0x4147ab;};'use strict';var _=require(_0x04af('0x0'));var util=require(_0x04af('0x1'));var moment=require(_0x04af('0x2'));var BPromise=require(_0x04af('0x3'));var rs=require(_0x04af('0x4'));var fs=require('fs');var Redis=require(_0x04af('0x5'));var db=require(_0x04af('0x6'))['db'];var utils=require(_0x04af('0x7'));var logger=require('../../config/logger')(_0x04af('0x8'));var config=require(_0x04af('0x9'));var jayson=require(_0x04af('0xa'));var client=jayson[_0x04af('0xb')][_0x04af('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53a4e3,_0x5216a0,_0x538bf8){return new BPromise(function(_0x5457f1,_0x4d164d){return client['request'](_0x53a4e3,_0x538bf8)[_0x04af('0xd')](function(_0x1aacc1){logger[_0x04af('0xe')]('Sound,\x20%s,\x20%s',_0x5216a0,_0x04af('0xf'));logger['debug'](_0x04af('0x10'),_0x5216a0,'request\x20sent',JSON['stringify'](_0x1aacc1));if(_0x1aacc1[_0x04af('0x11')]){if(_0x1aacc1[_0x04af('0x11')][_0x04af('0x12')]===0x1f4){logger['error'](_0x04af('0x13'),_0x5216a0,_0x1aacc1['error']['message']);return _0x4d164d(_0x1aacc1[_0x04af('0x11')][_0x04af('0x14')]);}logger[_0x04af('0x11')](_0x04af('0x13'),_0x5216a0,_0x1aacc1[_0x04af('0x11')][_0x04af('0x14')]);return _0x5457f1(_0x1aacc1[_0x04af('0x11')][_0x04af('0x14')]);}else{logger[_0x04af('0xe')](_0x04af('0x13'),_0x5216a0,'request\x20sent');_0x5457f1(_0x1aacc1['result'][_0x04af('0x14')]);}})['catch'](function(_0x4b5e1e){logger[_0x04af('0x11')](_0x04af('0x13'),_0x5216a0,_0x4b5e1e);_0x4d164d(_0x4b5e1e);});});}exports[_0x04af('0x15')]=function(_0x3a6bf3){var _0x1db4a8=this;return new Promise(function(_0x465a9b,_0x3bc1ba){return db[_0x04af('0x16')][_0x04af('0x17')]({'raw':_0x3a6bf3['options']?_0x3a6bf3['options'][_0x04af('0x18')]===undefined?!![]:![]:!![],'where':_0x3a6bf3[_0x04af('0x19')]?_0x3a6bf3[_0x04af('0x19')][_0x04af('0x1a')]||null:null,'attributes':_0x3a6bf3[_0x04af('0x19')]?_0x3a6bf3[_0x04af('0x19')][_0x04af('0x1b')]||null:null,'include':_0x3a6bf3['options']?_0x3a6bf3[_0x04af('0x19')][_0x04af('0x1c')]?_[_0x04af('0x1d')](_0x3a6bf3[_0x04af('0x19')][_0x04af('0x1c')],function(_0x1ed560){return{'model':db[_0x1ed560[_0x04af('0x1e')]],'as':_0x1ed560['as'],'attributes':_0x1ed560[_0x04af('0x1b')],'include':_0x1ed560['include']?_['map'](_0x1ed560[_0x04af('0x1c')],function(_0x486ef2){return{'model':db[_0x486ef2[_0x04af('0x1e')]],'as':_0x486ef2['as'],'attributes':_0x486ef2['attributes'],'include':_0x486ef2[_0x04af('0x1c')]?_[_0x04af('0x1d')](_0x486ef2[_0x04af('0x1c')],function(_0x2894e2){return{'model':db[_0x2894e2[_0x04af('0x1e')]],'as':_0x2894e2['as'],'attributes':_0x2894e2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fd2c7){logger['info'](_0x04af('0x15'),_0x3a6bf3);logger[_0x04af('0x1f')](_0x04af('0x15'),_0x3a6bf3,JSON[_0x04af('0x20')](_0x1fd2c7));_0x465a9b(_0x1fd2c7);})[_0x04af('0x21')](function(_0x5e79aa){logger[_0x04af('0x11')](_0x04af('0x15'),_0x5e79aa[_0x04af('0x14')],_0x3a6bf3);_0x3bc1ba(_0x1db4a8[_0x04af('0x11')](0x1f4,_0x5e79aa[_0x04af('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 0bd356a..cf3f0e3 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 _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x4bb12c,_0x41734f){var _0x4c18de=function(_0x8ead4b){while(--_0x8ead4b){_0x4bb12c['push'](_0x4bb12c['shift']());}};_0x4c18de(++_0x41734f);}(_0x5eb8,0xb0));var _0x85eb=function(_0x171fdc,_0x16ae91){_0x171fdc=_0x171fdc-0x0;var _0x3782ea=_0x5eb8[_0x171fdc];return _0x3782ea;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file +var _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x599e0a,_0x3162d9){var _0x3ac3e0=function(_0x4aad77){while(--_0x4aad77){_0x599e0a['push'](_0x599e0a['shift']());}};_0x3ac3e0(++_0x3162d9);}(_0x5eb8,0xb0));var _0x85eb=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x5eb8[_0x295a3d];return _0x23a732;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('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 ff8d186..51ccce9 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 _0xea03=['STRING','TEXT','ENUM','out','exports'];(function(_0x253ec2,_0x3a5ac6){var _0x5c58b7=function(_0x2f5e03){while(--_0x2f5e03){_0x253ec2['push'](_0x253ec2['shift']());}};_0x5c58b7(++_0x3a5ac6);}(_0xea03,0x1e4));var _0x3ea0=function(_0x321421,_0x555332){_0x321421=_0x321421-0x0;var _0x5374a4=_0xea03[_0x321421];return _0x5374a4;};'use strict';var Sequelize=require('sequelize');module[_0x3ea0('0x0')]={'uniqueid':{'type':Sequelize[_0x3ea0('0x1')]},'body':{'type':Sequelize[_0x3ea0('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x3ea0('0x3')]('in','out'),'defaultValue':_0x3ea0('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x3ea0('0x1')]},'providerResponse':{'type':Sequelize[_0x3ea0('0x2')]}}; \ No newline at end of file +var _0x5572=['TEXT','medium','ENUM','out','sequelize','STRING'];(function(_0x1a3d07,_0x105a71){var _0xd0058a=function(_0x213e53){while(--_0x213e53){_0x1a3d07['push'](_0x1a3d07['shift']());}};_0xd0058a(++_0x105a71);}(_0x5572,0x8e));var _0x2557=function(_0x53b716,_0x2079f2){_0x53b716=_0x53b716-0x0;var _0x3b400=_0x5572[_0x53b716];return _0x3b400;};'use strict';var Sequelize=require(_0x2557('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2557('0x1')]},'body':{'type':Sequelize[_0x2557('0x2')](_0x2557('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x2557('0x4')]('in',_0x2557('0x5')),'defaultValue':_0x2557('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x2557('0x1')]},'providerResponse':{'type':Sequelize[_0x2557('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 67ca0ad..46b8175 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 _0x4138=['mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','stack','name','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SquareMessage','includeAll','include','findAll','rows','catch','show','find','create','body','params','zip-dir','request-promise','moment','bluebird'];(function(_0x3809dd,_0x4203d3){var _0x1420b1=function(_0x198c23){while(--_0x198c23){_0x3809dd['push'](_0x3809dd['shift']());}};_0x1420b1(++_0x4203d3);}(_0x4138,0xce));var _0x8413=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x4138[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8413('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8413('0x1'));var moment=require(_0x8413('0x2'));var BPromise=require(_0x8413('0x3'));var Mustache=require(_0x8413('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8413('0x5'));var ejs=require(_0x8413('0x6'));var fs=require('fs');var fs_extra=require(_0x8413('0x7'));var _=require('lodash');var squel=require(_0x8413('0x8'));var crypto=require(_0x8413('0x9'));var jsforce=require(_0x8413('0xa'));var deskjs=require(_0x8413('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8413('0xc'));var Papa=require(_0x8413('0xd'));var Redis=require('ioredis');var authService=require(_0x8413('0xe'));var qs=require(_0x8413('0xf'));var as=require(_0x8413('0x10'));var hardwareService=require(_0x8413('0x11'));var logger=require(_0x8413('0x12'))('api');var utils=require(_0x8413('0x13'));var config=require(_0x8413('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8413('0x15'))['db'];function respondWithStatusCode(_0xf10f14,_0x44a506){_0x44a506=_0x44a506||0xcc;return function(_0x447d44){if(_0x447d44){return _0xf10f14[_0x8413('0x16')](_0x44a506);}return _0xf10f14[_0x8413('0x17')](_0x44a506)[_0x8413('0x18')]();};}function respondWithResult(_0x3320c8,_0xff64dc){_0xff64dc=_0xff64dc||0xc8;return function(_0x163176){if(_0x163176){return _0x3320c8['status'](_0xff64dc)[_0x8413('0x19')](_0x163176);}};}function respondWithFilteredResult(_0x3b0256,_0x72ff42){return function(_0x39f0ff){if(_0x39f0ff){var _0x285db0=typeof _0x72ff42[_0x8413('0x1a')]==='undefined'&&typeof _0x72ff42[_0x8413('0x1b')]===_0x8413('0x1c');var _0x581bc8=_0x39f0ff[_0x8413('0x1d')];var _0x506a41=_0x285db0?0x0:_0x72ff42[_0x8413('0x1a')];var _0x4b47a2=_0x285db0?_0x39f0ff[_0x8413('0x1d')]:_0x72ff42[_0x8413('0x1a')]+_0x72ff42[_0x8413('0x1b')];var _0x312bb7;if(_0x4b47a2>=_0x581bc8){_0x4b47a2=_0x581bc8;_0x312bb7=0xc8;}else{_0x312bb7=0xce;}_0x3b0256[_0x8413('0x17')](_0x312bb7);return _0x3b0256[_0x8413('0x1e')]('Content-Range',_0x506a41+'-'+_0x4b47a2+'/'+_0x581bc8)['json'](_0x39f0ff);}return null;};}function patchUpdates(_0x9ea2d3){return function(_0x29e318){try{jsonpatch[_0x8413('0x1f')](_0x29e318,_0x9ea2d3,!![]);}catch(_0x5a5645){return BPromise[_0x8413('0x20')](_0x5a5645);}return _0x29e318['save']();};}function saveUpdates(_0x33f9c4,_0x108f17){return function(_0x11587c){if(_0x11587c){return _0x11587c[_0x8413('0x21')](_0x33f9c4)[_0x8413('0x22')](function(_0x3953c8){return _0x3953c8;});}return null;};}function removeEntity(_0x45cf4b,_0x352fea){return function(_0x2c57ff){if(_0x2c57ff){return _0x2c57ff['destroy']()['then'](function(){_0x45cf4b[_0x8413('0x17')](0xcc)[_0x8413('0x18')]();});}};}function handleEntityNotFound(_0x57c3df,_0x400cee){return function(_0x3b421e){if(!_0x3b421e){_0x57c3df[_0x8413('0x16')](0x194);}return _0x3b421e;};}function handleError(_0x49ddb8,_0x17a08f){_0x17a08f=_0x17a08f||0x1f4;return function(_0x1d6d1){logger['error'](_0x1d6d1[_0x8413('0x23')]);if(_0x1d6d1[_0x8413('0x24')]){delete _0x1d6d1[_0x8413('0x24')];}_0x49ddb8[_0x8413('0x17')](_0x17a08f)['send'](_0x1d6d1);};}exports['index']=function(_0x19513b,_0x5b4cb3){var _0x173d42={},_0x19cc20={},_0x2ba2fc={'count':0x0,'rows':[]};var _0x15c274=_[_0x8413('0x25')](db['SquareMessage'][_0x8413('0x26')],function(_0x32bcb2){return{'name':_0x32bcb2['fieldName'],'type':_0x32bcb2[_0x8413('0x27')][_0x8413('0x28')]};});_0x19cc20[_0x8413('0x29')]=_['map'](_0x15c274,_0x8413('0x24'));_0x19cc20[_0x8413('0x2a')]=_[_0x8413('0x2b')](_0x19513b[_0x8413('0x2a')]);_0x19cc20[_0x8413('0x2c')]=_[_0x8413('0x2d')](_0x19cc20['model'],_0x19cc20[_0x8413('0x2a')]);_0x173d42[_0x8413('0x2e')]=_[_0x8413('0x2d')](_0x19cc20['model'],qs[_0x8413('0x2f')](_0x19513b[_0x8413('0x2a')]['fields']));_0x173d42[_0x8413('0x2e')]=_0x173d42['attributes'][_0x8413('0x30')]?_0x173d42[_0x8413('0x2e')]:_0x19cc20[_0x8413('0x29')];if(!_0x19513b[_0x8413('0x2a')][_0x8413('0x31')](_0x8413('0x32'))){_0x173d42[_0x8413('0x1b')]=qs['limit'](_0x19513b[_0x8413('0x2a')][_0x8413('0x1b')]);_0x173d42[_0x8413('0x1a')]=qs['offset'](_0x19513b[_0x8413('0x2a')]['offset']);}_0x173d42[_0x8413('0x33')]=qs[_0x8413('0x34')](_0x19513b[_0x8413('0x2a')]['sort']);_0x173d42[_0x8413('0x35')]=qs[_0x8413('0x2c')](_[_0x8413('0x36')](_0x19513b['query'],_0x19cc20[_0x8413('0x2c')]),_0x15c274);if(_0x19513b['query']['filter']){_0x173d42[_0x8413('0x35')]=_[_0x8413('0x37')](_0x173d42[_0x8413('0x35')],{'$or':_['map'](_0x15c274,function(_0x39f110){if(_0x39f110[_0x8413('0x27')]!==_0x8413('0x38')){var _0x244529={};_0x244529[_0x39f110['name']]={'$like':'%'+_0x19513b[_0x8413('0x2a')][_0x8413('0x39')]+'%'};return _0x244529;}})});}_0x173d42=_['merge']({},_0x173d42,_0x19513b[_0x8413('0x3a')]);var _0x145d2f={'where':_0x173d42['where']};return db[_0x8413('0x3b')][_0x8413('0x1d')](_0x145d2f)[_0x8413('0x22')](function(_0x3abc31){_0x2ba2fc[_0x8413('0x1d')]=_0x3abc31;if(_0x19513b[_0x8413('0x2a')][_0x8413('0x3c')]){_0x173d42[_0x8413('0x3d')]=[{'all':!![]}];}return db[_0x8413('0x3b')][_0x8413('0x3e')](_0x173d42);})[_0x8413('0x22')](function(_0x4b56a4){_0x2ba2fc[_0x8413('0x3f')]=_0x4b56a4;return _0x2ba2fc;})[_0x8413('0x22')](respondWithFilteredResult(_0x5b4cb3,_0x173d42))[_0x8413('0x40')](handleError(_0x5b4cb3,null));};exports[_0x8413('0x41')]=function(_0x4b19d2,_0x4ae845){var _0x481a2f={'raw':!![],'where':{'id':_0x4b19d2['params']['id']}},_0xdc1ed8={};_0xdc1ed8[_0x8413('0x29')]=_['keys'](db['SquareMessage']['rawAttributes']);_0xdc1ed8['query']=_[_0x8413('0x2b')](_0x4b19d2[_0x8413('0x2a')]);_0xdc1ed8['filters']=_[_0x8413('0x2d')](_0xdc1ed8[_0x8413('0x29')],_0xdc1ed8[_0x8413('0x2a')]);_0x481a2f[_0x8413('0x2e')]=_[_0x8413('0x2d')](_0xdc1ed8[_0x8413('0x29')],qs[_0x8413('0x2f')](_0x4b19d2[_0x8413('0x2a')][_0x8413('0x2f')]));_0x481a2f[_0x8413('0x2e')]=_0x481a2f[_0x8413('0x2e')][_0x8413('0x30')]?_0x481a2f[_0x8413('0x2e')]:_0xdc1ed8[_0x8413('0x29')];if(_0x4b19d2[_0x8413('0x2a')][_0x8413('0x3c')]){_0x481a2f['include']=[{'all':!![]}];}_0x481a2f=_[_0x8413('0x37')]({},_0x481a2f,_0x4b19d2[_0x8413('0x3a')]);return db[_0x8413('0x3b')][_0x8413('0x42')](_0x481a2f)[_0x8413('0x22')](handleEntityNotFound(_0x4ae845,null))[_0x8413('0x22')](respondWithResult(_0x4ae845,null))[_0x8413('0x40')](handleError(_0x4ae845,null));};exports[_0x8413('0x43')]=function(_0x3d4c34,_0x10dd4a){return db['SquareMessage']['create'](_0x3d4c34[_0x8413('0x44')],{})[_0x8413('0x22')](respondWithResult(_0x10dd4a,0xc9))['catch'](handleError(_0x10dd4a,null));};exports[_0x8413('0x21')]=function(_0x330819,_0x3ca352){if(_0x330819['body']['id']){delete _0x330819[_0x8413('0x44')]['id'];}return db[_0x8413('0x3b')][_0x8413('0x42')]({'where':{'id':_0x330819[_0x8413('0x45')]['id']}})[_0x8413('0x22')](handleEntityNotFound(_0x3ca352,null))[_0x8413('0x22')](saveUpdates(_0x330819[_0x8413('0x44')],null))[_0x8413('0x22')](respondWithResult(_0x3ca352,null))[_0x8413('0x40')](handleError(_0x3ca352,null));};exports['destroy']=function(_0x34a008,_0x10a3c1){return db[_0x8413('0x3b')][_0x8413('0x42')]({'where':{'id':_0x34a008[_0x8413('0x45')]['id']}})[_0x8413('0x22')](handleEntityNotFound(_0x10a3c1,null))[_0x8413('0x22')](removeEntity(_0x10a3c1,null))[_0x8413('0x40')](handleError(_0x10a3c1,null));}; \ No newline at end of file +var _0x40e8=['index','map','SquareMessage','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','reject','save','update','then','destroy','error','name','send'];(function(_0x23bb8e,_0x2395f5){var _0x3e5930=function(_0x1f011b){while(--_0x1f011b){_0x23bb8e['push'](_0x23bb8e['shift']());}};_0x3e5930(++_0x2395f5);}(_0x40e8,0x1d5));var _0x840e=function(_0x1b6563,_0x3bf0f1){_0x1b6563=_0x1b6563-0x0;var _0xdea7b8=_0x40e8[_0x1b6563];return _0xdea7b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x840e('0x0'));var zipdir=require(_0x840e('0x1'));var jsonpatch=require(_0x840e('0x2'));var rp=require('request-promise');var moment=require(_0x840e('0x3'));var BPromise=require(_0x840e('0x4'));var Mustache=require(_0x840e('0x5'));var util=require(_0x840e('0x6'));var path=require(_0x840e('0x7'));var sox=require('sox');var csv=require(_0x840e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x840e('0x9'));var _=require(_0x840e('0xa'));var squel=require(_0x840e('0xb'));var crypto=require(_0x840e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x840e('0xd'));var toCsv=require(_0x840e('0x8'));var querystring=require('querystring');var Papa=require(_0x840e('0xe'));var Redis=require(_0x840e('0xf'));var authService=require(_0x840e('0x10'));var qs=require(_0x840e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x840e('0x12'));var logger=require(_0x840e('0x13'))(_0x840e('0x14'));var utils=require(_0x840e('0x15'));var config=require(_0x840e('0x16'));var licenseUtil=require(_0x840e('0x17'));var db=require(_0x840e('0x18'))['db'];function respondWithStatusCode(_0x4990a2,_0x5060d8){_0x5060d8=_0x5060d8||0xcc;return function(_0x37599e){if(_0x37599e){return _0x4990a2[_0x840e('0x19')](_0x5060d8);}return _0x4990a2['status'](_0x5060d8)[_0x840e('0x1a')]();};}function respondWithResult(_0x35b95c,_0x11348b){_0x11348b=_0x11348b||0xc8;return function(_0x5e1769){if(_0x5e1769){return _0x35b95c['status'](_0x11348b)[_0x840e('0x1b')](_0x5e1769);}};}function respondWithFilteredResult(_0x5dac74,_0x40b980){return function(_0x1cab67){if(_0x1cab67){var _0x1cd735=typeof _0x40b980[_0x840e('0x1c')]===_0x840e('0x1d')&&typeof _0x40b980[_0x840e('0x1e')]===_0x840e('0x1d');var _0x4b7616=_0x1cab67[_0x840e('0x1f')];var _0x322813=_0x1cd735?0x0:_0x40b980[_0x840e('0x1c')];var _0x3e3429=_0x1cd735?_0x1cab67[_0x840e('0x1f')]:_0x40b980[_0x840e('0x1c')]+_0x40b980[_0x840e('0x1e')];var _0x3c4ffa;if(_0x3e3429>=_0x4b7616){_0x3e3429=_0x4b7616;_0x3c4ffa=0xc8;}else{_0x3c4ffa=0xce;}_0x5dac74[_0x840e('0x20')](_0x3c4ffa);return _0x5dac74['set'](_0x840e('0x21'),_0x322813+'-'+_0x3e3429+'/'+_0x4b7616)[_0x840e('0x1b')](_0x1cab67);}return null;};}function patchUpdates(_0x3ef1e8){return function(_0x18f08a){try{jsonpatch['apply'](_0x18f08a,_0x3ef1e8,!![]);}catch(_0x3a9381){return BPromise[_0x840e('0x22')](_0x3a9381);}return _0x18f08a[_0x840e('0x23')]();};}function saveUpdates(_0x1a18e4,_0x4ddb71){return function(_0x844547){if(_0x844547){return _0x844547[_0x840e('0x24')](_0x1a18e4)[_0x840e('0x25')](function(_0x2f81bc){return _0x2f81bc;});}return null;};}function removeEntity(_0x17ff2f,_0x4c8875){return function(_0x5a79c6){if(_0x5a79c6){return _0x5a79c6[_0x840e('0x26')]()[_0x840e('0x25')](function(){_0x17ff2f[_0x840e('0x20')](0xcc)[_0x840e('0x1a')]();});}};}function handleEntityNotFound(_0x35500b,_0x64644a){return function(_0x3eb0b1){if(!_0x3eb0b1){_0x35500b[_0x840e('0x19')](0x194);}return _0x3eb0b1;};}function handleError(_0x4efd91,_0x49c29b){_0x49c29b=_0x49c29b||0x1f4;return function(_0x2eb394){logger[_0x840e('0x27')](_0x2eb394['stack']);if(_0x2eb394[_0x840e('0x28')]){delete _0x2eb394[_0x840e('0x28')];}_0x4efd91[_0x840e('0x20')](_0x49c29b)[_0x840e('0x29')](_0x2eb394);};}exports[_0x840e('0x2a')]=function(_0x3597e3,_0xb54044){var _0x16d919={},_0x37677b={},_0x3f4122={'count':0x0,'rows':[]};var _0x1f4b82=_[_0x840e('0x2b')](db[_0x840e('0x2c')][_0x840e('0x2d')],function(_0x1fba54){return{'name':_0x1fba54[_0x840e('0x2e')],'type':_0x1fba54[_0x840e('0x2f')]['key']};});_0x37677b['model']=_[_0x840e('0x2b')](_0x1f4b82,_0x840e('0x28'));_0x37677b[_0x840e('0x30')]=_[_0x840e('0x31')](_0x3597e3['query']);_0x37677b[_0x840e('0x32')]=_[_0x840e('0x33')](_0x37677b[_0x840e('0x34')],_0x37677b[_0x840e('0x30')]);_0x16d919[_0x840e('0x35')]=_['intersection'](_0x37677b[_0x840e('0x34')],qs[_0x840e('0x36')](_0x3597e3[_0x840e('0x30')][_0x840e('0x36')]));_0x16d919[_0x840e('0x35')]=_0x16d919[_0x840e('0x35')][_0x840e('0x37')]?_0x16d919['attributes']:_0x37677b['model'];if(!_0x3597e3['query']['hasOwnProperty'](_0x840e('0x38'))){_0x16d919[_0x840e('0x1e')]=qs['limit'](_0x3597e3[_0x840e('0x30')][_0x840e('0x1e')]);_0x16d919[_0x840e('0x1c')]=qs['offset'](_0x3597e3[_0x840e('0x30')][_0x840e('0x1c')]);}_0x16d919[_0x840e('0x39')]=qs['sort'](_0x3597e3[_0x840e('0x30')]['sort']);_0x16d919[_0x840e('0x3a')]=qs[_0x840e('0x32')](_['pick'](_0x3597e3['query'],_0x37677b[_0x840e('0x32')]),_0x1f4b82);if(_0x3597e3[_0x840e('0x30')][_0x840e('0x3b')]){_0x16d919[_0x840e('0x3a')]=_['merge'](_0x16d919['where'],{'$or':_['map'](_0x1f4b82,function(_0x3e0d45){if(_0x3e0d45[_0x840e('0x2f')]!==_0x840e('0x3c')){var _0x268e00={};_0x268e00[_0x3e0d45['name']]={'$like':'%'+_0x3597e3[_0x840e('0x30')][_0x840e('0x3b')]+'%'};return _0x268e00;}})});}_0x16d919=_[_0x840e('0x3d')]({},_0x16d919,_0x3597e3[_0x840e('0x3e')]);var _0x609f2e={'where':_0x16d919[_0x840e('0x3a')]};return db['SquareMessage'][_0x840e('0x1f')](_0x609f2e)[_0x840e('0x25')](function(_0x31604f){_0x3f4122['count']=_0x31604f;if(_0x3597e3['query'][_0x840e('0x3f')]){_0x16d919[_0x840e('0x40')]=[{'all':!![]}];}return db['SquareMessage'][_0x840e('0x41')](_0x16d919);})[_0x840e('0x25')](function(_0x3ce966){_0x3f4122[_0x840e('0x42')]=_0x3ce966;return _0x3f4122;})[_0x840e('0x25')](respondWithFilteredResult(_0xb54044,_0x16d919))[_0x840e('0x43')](handleError(_0xb54044,null));};exports[_0x840e('0x44')]=function(_0xa7b7db,_0x293d90){var _0x18aa4f={'raw':!![],'where':{'id':_0xa7b7db['params']['id']}},_0xf0e793={};_0xf0e793[_0x840e('0x34')]=_[_0x840e('0x31')](db[_0x840e('0x2c')][_0x840e('0x2d')]);_0xf0e793[_0x840e('0x30')]=_[_0x840e('0x31')](_0xa7b7db[_0x840e('0x30')]);_0xf0e793[_0x840e('0x32')]=_['intersection'](_0xf0e793[_0x840e('0x34')],_0xf0e793[_0x840e('0x30')]);_0x18aa4f[_0x840e('0x35')]=_[_0x840e('0x33')](_0xf0e793[_0x840e('0x34')],qs[_0x840e('0x36')](_0xa7b7db[_0x840e('0x30')][_0x840e('0x36')]));_0x18aa4f[_0x840e('0x35')]=_0x18aa4f[_0x840e('0x35')]['length']?_0x18aa4f['attributes']:_0xf0e793['model'];if(_0xa7b7db[_0x840e('0x30')][_0x840e('0x3f')]){_0x18aa4f[_0x840e('0x40')]=[{'all':!![]}];}_0x18aa4f=_[_0x840e('0x3d')]({},_0x18aa4f,_0xa7b7db['options']);return db['SquareMessage'][_0x840e('0x45')](_0x18aa4f)[_0x840e('0x25')](handleEntityNotFound(_0x293d90,null))[_0x840e('0x25')](respondWithResult(_0x293d90,null))[_0x840e('0x43')](handleError(_0x293d90,null));};exports[_0x840e('0x46')]=function(_0x1695cf,_0x1a923f){return db[_0x840e('0x2c')][_0x840e('0x46')](_0x1695cf[_0x840e('0x47')],{})[_0x840e('0x25')](respondWithResult(_0x1a923f,0xc9))[_0x840e('0x43')](handleError(_0x1a923f,null));};exports['update']=function(_0x1824c0,_0x345c44){if(_0x1824c0[_0x840e('0x47')]['id']){delete _0x1824c0[_0x840e('0x47')]['id'];}return db[_0x840e('0x2c')][_0x840e('0x45')]({'where':{'id':_0x1824c0[_0x840e('0x48')]['id']}})[_0x840e('0x25')](handleEntityNotFound(_0x345c44,null))[_0x840e('0x25')](saveUpdates(_0x1824c0[_0x840e('0x47')],null))[_0x840e('0x25')](respondWithResult(_0x345c44,null))[_0x840e('0x43')](handleError(_0x345c44,null));};exports[_0x840e('0x26')]=function(_0x508ba1,_0x5011ed){return db[_0x840e('0x2c')][_0x840e('0x45')]({'where':{'id':_0x508ba1['params']['id']}})[_0x840e('0x25')](handleEntityNotFound(_0x5011ed,null))[_0x840e('0x25')](removeEntity(_0x5011ed,null))[_0x840e('0x43')](handleError(_0x5011ed,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 3ce3bd3..e357782 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 _0xf106=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','lodash','util'];(function(_0x1f71f3,_0x4f8c06){var _0x41dbdc=function(_0x330491){while(--_0x330491){_0x1f71f3['push'](_0x1f71f3['shift']());}};_0x41dbdc(++_0x4f8c06);}(_0xf106,0x7c));var _0x6f10=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0xf106[_0x36c6eb];return _0x30675b;};'use strict';var _=require(_0x6f10('0x0'));var util=require(_0x6f10('0x1'));var logger=require(_0x6f10('0x2'))(_0x6f10('0x3'));var moment=require(_0x6f10('0x4'));var BPromise=require(_0x6f10('0x5'));var rp=require(_0x6f10('0x6'));var fs=require('fs');var path=require(_0x6f10('0x7'));var rimraf=require(_0x6f10('0x8'));var config=require(_0x6f10('0x9'));var attributes=require(_0x6f10('0xa'));module[_0x6f10('0xb')]=function(_0x19c51f,_0x2a98a3){return _0x19c51f[_0x6f10('0xc')](_0x6f10('0xd'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd91=['request-promise','path','rimraf','../../config/environment','exports','define','SquareMessage','square_messages','../../config/logger','api','moment'];(function(_0x31a82e,_0x25cbdd){var _0x4c33cb=function(_0x372f74){while(--_0x372f74){_0x31a82e['push'](_0x31a82e['shift']());}};_0x4c33cb(++_0x25cbdd);}(_0xdd91,0x168));var _0x1dd9=function(_0x1b928a,_0x8f7944){_0x1b928a=_0x1b928a-0x0;var _0x2d2f5e=_0xdd91[_0x1b928a];return _0x2d2f5e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1dd9('0x0'))(_0x1dd9('0x1'));var moment=require(_0x1dd9('0x2'));var BPromise=require('bluebird');var rp=require(_0x1dd9('0x3'));var fs=require('fs');var path=require(_0x1dd9('0x4'));var rimraf=require(_0x1dd9('0x5'));var config=require(_0x1dd9('0x6'));var attributes=require('./squareMessage.attributes');module[_0x1dd9('0x7')]=function(_0x699c07,_0xf606a8){return _0x699c07[_0x1dd9('0x8')](_0x1dd9('0x9'),attributes,{'tableName':_0x1dd9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 16b280e..f7c0cf1 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 _0x7ad4=['raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareMessage','create','body','options'];(function(_0x10e73e,_0x1f6b20){var _0x1ddf27=function(_0x2bf3a2){while(--_0x2bf3a2){_0x10e73e['push'](_0x10e73e['shift']());}};_0x1ddf27(++_0x1f6b20);}(_0x7ad4,0xf4));var _0x47ad=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7ad4[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x47ad('0x0'));var util=require('util');var moment=require(_0x47ad('0x1'));var BPromise=require('bluebird');var rs=require(_0x47ad('0x2'));var fs=require('fs');var Redis=require(_0x47ad('0x3'));var db=require(_0x47ad('0x4'))['db'];var utils=require(_0x47ad('0x5'));var logger=require('../../config/logger')(_0x47ad('0x6'));var config=require(_0x47ad('0x7'));var jayson=require(_0x47ad('0x8'));var client=jayson[_0x47ad('0x9')][_0x47ad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5becbe,_0x234242,_0x37c7dd){return new BPromise(function(_0x5e83ba,_0x552f9c){return client[_0x47ad('0xb')](_0x5becbe,_0x37c7dd)[_0x47ad('0xc')](function(_0x1c35fb){logger[_0x47ad('0xd')](_0x47ad('0xe'),_0x234242,_0x47ad('0xf'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x234242,_0x47ad('0xf'),JSON[_0x47ad('0x10')](_0x1c35fb));if(_0x1c35fb[_0x47ad('0x11')]){if(_0x1c35fb[_0x47ad('0x11')][_0x47ad('0x12')]===0x1f4){logger[_0x47ad('0x11')](_0x47ad('0xe'),_0x234242,_0x1c35fb[_0x47ad('0x11')][_0x47ad('0x13')]);return _0x552f9c(_0x1c35fb[_0x47ad('0x11')][_0x47ad('0x13')]);}logger[_0x47ad('0x11')](_0x47ad('0xe'),_0x234242,_0x1c35fb[_0x47ad('0x11')][_0x47ad('0x13')]);return _0x5e83ba(_0x1c35fb[_0x47ad('0x11')][_0x47ad('0x13')]);}else{logger['info'](_0x47ad('0xe'),_0x234242,_0x47ad('0xf'));_0x5e83ba(_0x1c35fb[_0x47ad('0x14')]['message']);}})[_0x47ad('0x15')](function(_0x1ecb07){logger['error']('SquareMessage,\x20%s,\x20%s',_0x234242,_0x1ecb07);_0x552f9c(_0x1ecb07);});});}exports[_0x47ad('0x16')]=function(_0x149d27){var _0x1cacca=this;return new Promise(function(_0x143b78,_0x2bb60f){return db['SquareMessage'][_0x47ad('0x17')](_0x149d27[_0x47ad('0x18')],{'raw':_0x149d27['options']?_0x149d27[_0x47ad('0x19')][_0x47ad('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x43c8bb){logger[_0x47ad('0xd')](_0x47ad('0x16'),_0x149d27);logger['debug']('CreateSquareMessage',_0x149d27,JSON['stringify'](_0x43c8bb));_0x143b78(_0x43c8bb);})['catch'](function(_0x19fa51){logger[_0x47ad('0x11')](_0x47ad('0x16'),_0x19fa51[_0x47ad('0x13')],_0x149d27);_0x2bb60f(_0x1cacca[_0x47ad('0x11')](0x1f4,_0x19fa51[_0x47ad('0x13')]));});});}; \ No newline at end of file +var _0xa3ee=['code','message','result','SquareMessage','body','options','raw','CreateSquareMessage','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x50e7a4,_0x35bfbf){var _0x35c692=function(_0xcfe583){while(--_0xcfe583){_0x50e7a4['push'](_0x50e7a4['shift']());}};_0x35c692(++_0x35bfbf);}(_0xa3ee,0x117));var _0xea3e=function(_0x562b91,_0x529a38){_0x562b91=_0x562b91-0x0;var _0x4399cd=_0xa3ee[_0x562b91];return _0x4399cd;};'use strict';var _=require(_0xea3e('0x0'));var util=require(_0xea3e('0x1'));var moment=require(_0xea3e('0x2'));var BPromise=require(_0xea3e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea3e('0x4'));var db=require(_0xea3e('0x5'))['db'];var utils=require(_0xea3e('0x6'));var logger=require(_0xea3e('0x7'))('rpc');var config=require(_0xea3e('0x8'));var jayson=require(_0xea3e('0x9'));var client=jayson[_0xea3e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c702d,_0x1f194b,_0xb7e1ca){return new BPromise(function(_0x541275,_0x153fa4){return client['request'](_0x3c702d,_0xb7e1ca)[_0xea3e('0xb')](function(_0xc13da5){logger[_0xea3e('0xc')](_0xea3e('0xd'),_0x1f194b,'request\x20sent');logger['debug'](_0xea3e('0xe'),_0x1f194b,_0xea3e('0xf'),JSON[_0xea3e('0x10')](_0xc13da5));if(_0xc13da5[_0xea3e('0x11')]){if(_0xc13da5[_0xea3e('0x11')][_0xea3e('0x12')]===0x1f4){logger[_0xea3e('0x11')]('SquareMessage,\x20%s,\x20%s',_0x1f194b,_0xc13da5['error']['message']);return _0x153fa4(_0xc13da5[_0xea3e('0x11')]['message']);}logger[_0xea3e('0x11')](_0xea3e('0xd'),_0x1f194b,_0xc13da5['error']['message']);return _0x541275(_0xc13da5[_0xea3e('0x11')][_0xea3e('0x13')]);}else{logger[_0xea3e('0xc')]('SquareMessage,\x20%s,\x20%s',_0x1f194b,'request\x20sent');_0x541275(_0xc13da5[_0xea3e('0x14')][_0xea3e('0x13')]);}})['catch'](function(_0x4674c2){logger[_0xea3e('0x11')]('SquareMessage,\x20%s,\x20%s',_0x1f194b,_0x4674c2);_0x153fa4(_0x4674c2);});});}exports['CreateSquareMessage']=function(_0x9418bb){var _0x5b3d0c=this;return new Promise(function(_0x541b6f,_0x318567){return db[_0xea3e('0x15')]['create'](_0x9418bb[_0xea3e('0x16')],{'raw':_0x9418bb['options']?_0x9418bb[_0xea3e('0x17')][_0xea3e('0x18')]===undefined?!![]:![]:!![]})[_0xea3e('0xb')](function(_0x4319ed){logger[_0xea3e('0xc')](_0xea3e('0x19'),_0x9418bb);logger[_0xea3e('0x1a')](_0xea3e('0x19'),_0x9418bb,JSON[_0xea3e('0x10')](_0x4319ed));_0x541b6f(_0x4319ed);})['catch'](function(_0x225b57){logger['error']('CreateSquareMessage',_0x225b57[_0xea3e('0x13')],_0x9418bb);_0x318567(_0x5b3d0c['error'](0x1f4,_0x225b57[_0xea3e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 8f874dd..0eb0853 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 _0x327f=['post','create','put','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/test','test'];(function(_0x3c4087,_0x5c764b){var _0x23ad1f=function(_0x39bf1c){while(--_0x39bf1c){_0x3c4087['push'](_0x3c4087['shift']());}};_0x23ad1f(++_0x5c764b);}(_0x327f,0x1a7));var _0xf327=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x327f[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xf327('0x0'));var util=require('util');var path=require(_0xf327('0x1'));var timeout=require('connect-timeout');var express=require(_0xf327('0x2'));var router=express[_0xf327('0x3')]();var fs_extra=require(_0xf327('0x4'));var auth=require(_0xf327('0x5'));var interaction=require(_0xf327('0x6'));var config=require(_0xf327('0x7'));var controller=require('./squareOdbc.controller');router['get']('/',auth[_0xf327('0x8')](),controller['index']);router[_0xf327('0x9')](_0xf327('0xa'),auth[_0xf327('0x8')](),controller[_0xf327('0xb')]);router[_0xf327('0x9')](_0xf327('0xc'),auth[_0xf327('0x8')](),timeout('15s'),controller[_0xf327('0xd')]);router[_0xf327('0xe')]('/',auth[_0xf327('0x8')](),controller[_0xf327('0xf')]);router[_0xf327('0x10')](_0xf327('0xa'),auth[_0xf327('0x8')](),controller['update']);router[_0xf327('0x11')](_0xf327('0xa'),auth['isAuthenticated'](),controller[_0xf327('0x12')]);module['exports']=router; \ No newline at end of file +var _0x513e=['/:id/test','15s','test','post','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show'];(function(_0x416a0a,_0x24f91f){var _0x574c9f=function(_0x44b83e){while(--_0x44b83e){_0x416a0a['push'](_0x416a0a['shift']());}};_0x574c9f(++_0x24f91f);}(_0x513e,0xa2));var _0xe513=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x513e[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xe513('0x0'));var util=require('util');var path=require(_0xe513('0x1'));var timeout=require(_0xe513('0x2'));var express=require(_0xe513('0x3'));var router=express[_0xe513('0x4')]();var fs_extra=require(_0xe513('0x5'));var auth=require(_0xe513('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe513('0x7'));var controller=require(_0xe513('0x8'));router[_0xe513('0x9')]('/',auth[_0xe513('0xa')](),controller[_0xe513('0xb')]);router[_0xe513('0x9')](_0xe513('0xc'),auth[_0xe513('0xa')](),controller[_0xe513('0xd')]);router[_0xe513('0x9')](_0xe513('0xe'),auth[_0xe513('0xa')](),timeout(_0xe513('0xf')),controller[_0xe513('0x10')]);router[_0xe513('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe513('0x12')](_0xe513('0xc'),auth[_0xe513('0xa')](),controller[_0xe513('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe513('0x14')]);module[_0xe513('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index ed20840..d4efd57 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 _0xa9c4=['STRING','exports','name'];(function(_0x5d2243,_0x1dea4c){var _0x35f2a5=function(_0x42e0df){while(--_0x42e0df){_0x5d2243['push'](_0x5d2243['shift']());}};_0x35f2a5(++_0x1dea4c);}(_0xa9c4,0x151));var _0x4a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x4a9c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x4a9c('0x1'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4a9c('0x2')]}}; \ No newline at end of file +var _0xcb0b=['STRING','name','sequelize','exports'];(function(_0x4ce82b,_0x57492b){var _0x54572f=function(_0x18bb11){while(--_0x18bb11){_0x4ce82b['push'](_0x4ce82b['shift']());}};_0x54572f(++_0x57492b);}(_0xcb0b,0xea));var _0xbcb0=function(_0x250146,_0x339aae){_0x250146=_0x250146-0x0;var _0x12401f=_0xcb0b[_0x250146];return _0x12401f;};'use strict';var Sequelize=require(_0xbcb0('0x0'));module[_0xbcb0('0x1')]={'name':{'type':Sequelize[_0xbcb0('0x2')],'unique':_0xbcb0('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xbcb0('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 e8c8614..2d6d9c1 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 _0x17ef=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','then','get','ODBC','UserProfileResource','error','stack','name','send','map','SquareOdbc','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','rawAttributes','include','options','catch','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','find','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x19201b,_0x216e48){var _0x2a13e2=function(_0x35112f){while(--_0x35112f){_0x19201b['push'](_0x19201b['shift']());}};_0x2a13e2(++_0x216e48);}(_0x17ef,0x15c));var _0xf17e=function(_0x54bbf0,_0x218cef){_0x54bbf0=_0x54bbf0-0x0;var _0x1e54ac=_0x17ef[_0x54bbf0];return _0x1e54ac;};'use strict';var emlformat=require(_0xf17e('0x0'));var rimraf=require(_0xf17e('0x1'));var zipdir=require(_0xf17e('0x2'));var jsonpatch=require(_0xf17e('0x3'));var rp=require(_0xf17e('0x4'));var moment=require(_0xf17e('0x5'));var BPromise=require(_0xf17e('0x6'));var Mustache=require('mustache');var util=require(_0xf17e('0x7'));var path=require(_0xf17e('0x8'));var sox=require(_0xf17e('0x9'));var csv=require(_0xf17e('0xa'));var ejs=require(_0xf17e('0xb'));var fs=require('fs');var fs_extra=require(_0xf17e('0xc'));var _=require(_0xf17e('0xd'));var squel=require(_0xf17e('0xe'));var crypto=require(_0xf17e('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xf17e('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf17e('0x11'));var Papa=require(_0xf17e('0x12'));var Redis=require(_0xf17e('0x13'));var authService=require(_0xf17e('0x14'));var qs=require(_0xf17e('0x15'));var as=require(_0xf17e('0x16'));var hardwareService=require(_0xf17e('0x17'));var logger=require(_0xf17e('0x18'))(_0xf17e('0x19'));var utils=require(_0xf17e('0x1a'));var config=require(_0xf17e('0x1b'));var licenseUtil=require(_0xf17e('0x1c'));var db=require(_0xf17e('0x1d'))['db'];function respondWithStatusCode(_0x1970d9,_0x178e76){_0x178e76=_0x178e76||0xcc;return function(_0x2fe350){if(_0x2fe350){return _0x1970d9[_0xf17e('0x1e')](_0x178e76);}return _0x1970d9[_0xf17e('0x1f')](_0x178e76)[_0xf17e('0x20')]();};}function respondWithResult(_0x1771f8,_0x1ada4b){_0x1ada4b=_0x1ada4b||0xc8;return function(_0x102795){if(_0x102795){return _0x1771f8[_0xf17e('0x1f')](_0x1ada4b)['json'](_0x102795);}};}function respondWithFilteredResult(_0x3d6e41,_0x129a9d){return function(_0x5de417){if(_0x5de417){var _0x3fdd8f=typeof _0x129a9d['offset']===_0xf17e('0x21')&&typeof _0x129a9d[_0xf17e('0x22')]===_0xf17e('0x21');var _0x37486c=_0x5de417[_0xf17e('0x23')];var _0x47e777=_0x3fdd8f?0x0:_0x129a9d[_0xf17e('0x24')];var _0x32a080=_0x3fdd8f?_0x5de417['count']:_0x129a9d[_0xf17e('0x24')]+_0x129a9d[_0xf17e('0x22')];var _0xc29228;if(_0x32a080>=_0x37486c){_0x32a080=_0x37486c;_0xc29228=0xc8;}else{_0xc29228=0xce;}_0x3d6e41[_0xf17e('0x1f')](_0xc29228);return _0x3d6e41['set'](_0xf17e('0x25'),_0x47e777+'-'+_0x32a080+'/'+_0x37486c)[_0xf17e('0x26')](_0x5de417);}return null;};}function patchUpdates(_0x26e5d4){return function(_0xe4a86){try{jsonpatch[_0xf17e('0x27')](_0xe4a86,_0x26e5d4,!![]);}catch(_0x2719f2){return BPromise[_0xf17e('0x28')](_0x2719f2);}return _0xe4a86[_0xf17e('0x29')]();};}function saveUpdates(_0x13b5d5,_0xeeee4){return function(_0x46bd75){if(_0x46bd75){return _0x46bd75['update'](_0x13b5d5)['then'](function(_0x2a1185){return _0x2a1185;});}return null;};}function removeEntity(_0x4ff8d5,_0xa9b1eb){return function(_0x229187){if(_0x229187){return _0x229187['destroy']()[_0xf17e('0x2a')](function(){var _0x4071f4=_0x229187[_0xf17e('0x2b')]({'plain':!![]});var _0x198a7f=_0xf17e('0x2c');return db[_0xf17e('0x2d')]['destroy']({'where':{'type':_0x198a7f,'resourceId':_0x4071f4['id']}})['then'](function(){return _0x229187;});})[_0xf17e('0x2a')](function(){_0x4ff8d5[_0xf17e('0x1f')](0xcc)[_0xf17e('0x20')]();});}};}function handleEntityNotFound(_0x36ba7e,_0x5c75b3){return function(_0x21a468){if(!_0x21a468){_0x36ba7e[_0xf17e('0x1e')](0x194);}return _0x21a468;};}function handleError(_0x1573d7,_0x1bdd2a){_0x1bdd2a=_0x1bdd2a||0x1f4;return function(_0x5cc0d7){logger[_0xf17e('0x2e')](_0x5cc0d7[_0xf17e('0x2f')]);if(_0x5cc0d7['name']){delete _0x5cc0d7[_0xf17e('0x30')];}_0x1573d7[_0xf17e('0x1f')](_0x1bdd2a)[_0xf17e('0x31')](_0x5cc0d7);};}exports['index']=function(_0x6d7d7e,_0x1aaaa6){var _0x2418b3={},_0x16ddb9={},_0x275a58={'count':0x0,'rows':[]};var _0xe1fb8=_[_0xf17e('0x32')](db[_0xf17e('0x33')]['rawAttributes'],function(_0x314e55){return{'name':_0x314e55[_0xf17e('0x34')],'type':_0x314e55[_0xf17e('0x35')]['key']};});_0x16ddb9['model']=_['map'](_0xe1fb8,'name');_0x16ddb9[_0xf17e('0x36')]=_[_0xf17e('0x37')](_0x6d7d7e['query']);_0x16ddb9['filters']=_[_0xf17e('0x38')](_0x16ddb9[_0xf17e('0x39')],_0x16ddb9[_0xf17e('0x36')]);_0x2418b3[_0xf17e('0x3a')]=_[_0xf17e('0x38')](_0x16ddb9[_0xf17e('0x39')],qs[_0xf17e('0x3b')](_0x6d7d7e[_0xf17e('0x36')][_0xf17e('0x3b')]));_0x2418b3[_0xf17e('0x3a')]=_0x2418b3[_0xf17e('0x3a')][_0xf17e('0x3c')]?_0x2418b3[_0xf17e('0x3a')]:_0x16ddb9['model'];if(!_0x6d7d7e[_0xf17e('0x36')][_0xf17e('0x3d')](_0xf17e('0x3e'))){_0x2418b3[_0xf17e('0x22')]=qs[_0xf17e('0x22')](_0x6d7d7e[_0xf17e('0x36')]['limit']);_0x2418b3[_0xf17e('0x24')]=qs[_0xf17e('0x24')](_0x6d7d7e[_0xf17e('0x36')]['offset']);}_0x2418b3[_0xf17e('0x3f')]=qs[_0xf17e('0x40')](_0x6d7d7e['query']['sort']);_0x2418b3[_0xf17e('0x41')]=qs[_0xf17e('0x42')](_[_0xf17e('0x43')](_0x6d7d7e[_0xf17e('0x36')],_0x16ddb9[_0xf17e('0x42')]),_0xe1fb8);if(_0x6d7d7e[_0xf17e('0x36')][_0xf17e('0x44')]){_0x2418b3['where']=_['merge'](_0x2418b3[_0xf17e('0x41')],{'$or':_[_0xf17e('0x32')](_0xe1fb8,function(_0x4688a0){if(_0x4688a0[_0xf17e('0x35')]!==_0xf17e('0x45')){var _0x2f21e3={};_0x2f21e3[_0x4688a0[_0xf17e('0x30')]]={'$like':'%'+_0x6d7d7e[_0xf17e('0x36')][_0xf17e('0x44')]+'%'};return _0x2f21e3;}})});}_0x2418b3=_[_0xf17e('0x46')]({},_0x2418b3,_0x6d7d7e['options']);var _0x75c515={'where':_0x2418b3[_0xf17e('0x41')]};return db[_0xf17e('0x33')][_0xf17e('0x23')](_0x75c515)[_0xf17e('0x2a')](function(_0x3987d6){_0x275a58['count']=_0x3987d6;if(_0x6d7d7e['query'][_0xf17e('0x47')]){_0x2418b3['include']=[{'all':!![]}];}return db[_0xf17e('0x33')][_0xf17e('0x48')](_0x2418b3);})[_0xf17e('0x2a')](function(_0x4c15d7){_0x275a58[_0xf17e('0x49')]=_0x4c15d7;return _0x275a58;})[_0xf17e('0x2a')](respondWithFilteredResult(_0x1aaaa6,_0x2418b3))['catch'](handleError(_0x1aaaa6,null));};exports[_0xf17e('0x4a')]=function(_0x5644f1,_0x25040d){var _0x55e8f6={'raw':!![],'where':{'id':_0x5644f1[_0xf17e('0x4b')]['id']}},_0xb76414={};_0xb76414[_0xf17e('0x39')]=_[_0xf17e('0x37')](db[_0xf17e('0x33')][_0xf17e('0x4c')]);_0xb76414[_0xf17e('0x36')]=_['keys'](_0x5644f1[_0xf17e('0x36')]);_0xb76414[_0xf17e('0x42')]=_['intersection'](_0xb76414[_0xf17e('0x39')],_0xb76414[_0xf17e('0x36')]);_0x55e8f6['attributes']=_['intersection'](_0xb76414[_0xf17e('0x39')],qs['fields'](_0x5644f1[_0xf17e('0x36')][_0xf17e('0x3b')]));_0x55e8f6[_0xf17e('0x3a')]=_0x55e8f6['attributes'][_0xf17e('0x3c')]?_0x55e8f6['attributes']:_0xb76414['model'];if(_0x5644f1[_0xf17e('0x36')][_0xf17e('0x47')]){_0x55e8f6[_0xf17e('0x4d')]=[{'all':!![]}];}_0x55e8f6=_['merge']({},_0x55e8f6,_0x5644f1[_0xf17e('0x4e')]);return db[_0xf17e('0x33')]['find'](_0x55e8f6)[_0xf17e('0x2a')](handleEntityNotFound(_0x25040d,null))['then'](respondWithResult(_0x25040d,null))[_0xf17e('0x4f')](handleError(_0x25040d,null));};exports['create']=function(_0x1729f1,_0x11d2f3){return db['SquareOdbc'][_0xf17e('0x50')](_0x1729f1[_0xf17e('0x51')],{})[_0xf17e('0x2a')](function(_0x24286c){var _0x2beb5a=_0x1729f1[_0xf17e('0x52')]['get']({'plain':!![]});if(!_0x2beb5a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2beb5a[_0xf17e('0x53')]===_0xf17e('0x52')){var _0x548d88=_0x24286c[_0xf17e('0x2b')]({'plain':!![]});var _0x1139b1=_0xf17e('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x1139b1,'userProfileId':_0x2beb5a[_0xf17e('0x54')]},'raw':!![]})[_0xf17e('0x2a')](function(_0x43f706){if(_0x43f706&&_0x43f706[_0xf17e('0x55')]===0x0){return db[_0xf17e('0x2d')][_0xf17e('0x50')]({'name':_0x548d88['name'],'resourceId':_0x548d88['id'],'type':_0x43f706[_0xf17e('0x30')],'sectionId':_0x43f706['id']},{})['then'](function(){return _0x24286c;});}else{return _0x24286c;}})[_0xf17e('0x4f')](function(_0x4ce532){logger[_0xf17e('0x2e')](_0xf17e('0x56'),_0x4ce532);throw _0x4ce532;});}return _0x24286c;})[_0xf17e('0x2a')](respondWithResult(_0x11d2f3,0xc9))[_0xf17e('0x4f')](handleError(_0x11d2f3,null));};exports[_0xf17e('0x57')]=function(_0x33e984,_0xc36672){if(_0x33e984[_0xf17e('0x51')]['id']){delete _0x33e984[_0xf17e('0x51')]['id'];}return db[_0xf17e('0x33')]['find']({'where':{'id':_0x33e984[_0xf17e('0x4b')]['id']}})[_0xf17e('0x2a')](handleEntityNotFound(_0xc36672,null))[_0xf17e('0x2a')](saveUpdates(_0x33e984['body'],null))['then'](respondWithResult(_0xc36672,null))[_0xf17e('0x4f')](handleError(_0xc36672,null));};exports['destroy']=function(_0x4da487,_0x185911){return db['SquareOdbc']['find']({'where':{'id':_0x4da487[_0xf17e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x185911,null))[_0xf17e('0x2a')](removeEntity(_0x185911,null))['catch'](handleError(_0x185911,null));};exports[_0xf17e('0x58')]=function(_0xb3a7f3,_0x3ba65f,_0x592265){var _0x8a2638;return db[_0xf17e('0x33')][_0xf17e('0x59')]({'where':{'id':_0xb3a7f3[_0xf17e('0x4b')]['id']},'attributes':['id',_0xf17e('0x5a')]})[_0xf17e('0x2a')](handleEntityNotFound(_0x3ba65f,null))[_0xf17e('0x2a')](function(_0x50ad07){if(_0x50ad07){var _0x228405=require('odbc')();_0x228405['openSync'](_0x50ad07['dsn']);_0x228405[_0xf17e('0x5b')]();return _0x50ad07;}})[_0xf17e('0x2a')](respondWithResult(_0x3ba65f,null))[_0xf17e('0x4f')](handleError(_0x3ba65f,null));}; \ No newline at end of file +var _0xa55f=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','error','stack','name','send','SquareOdbc','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','includeAll','findAll','rows','catch','keys','length','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','test','dsn','openSync','closeSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x659004,_0x4f3962){var _0x539c22=function(_0x39d6d5){while(--_0x39d6d5){_0x659004['push'](_0x659004['shift']());}};_0x539c22(++_0x4f3962);}(_0xa55f,0x1ea));var _0xfa55=function(_0x2f8507,_0x2c0357){_0x2f8507=_0x2f8507-0x0;var _0x3c91ee=_0xa55f[_0x2f8507];return _0x3c91ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfa55('0x0'));var zipdir=require(_0xfa55('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa55('0x2'));var moment=require(_0xfa55('0x3'));var BPromise=require(_0xfa55('0x4'));var Mustache=require(_0xfa55('0x5'));var util=require(_0xfa55('0x6'));var path=require(_0xfa55('0x7'));var sox=require('sox');var csv=require(_0xfa55('0x8'));var ejs=require(_0xfa55('0x9'));var fs=require('fs');var fs_extra=require(_0xfa55('0xa'));var _=require('lodash');var squel=require(_0xfa55('0xb'));var crypto=require(_0xfa55('0xc'));var jsforce=require(_0xfa55('0xd'));var deskjs=require(_0xfa55('0xe'));var toCsv=require(_0xfa55('0x8'));var querystring=require(_0xfa55('0xf'));var Papa=require('papaparse');var Redis=require(_0xfa55('0x10'));var authService=require(_0xfa55('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfa55('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfa55('0x13'));var utils=require(_0xfa55('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfa55('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc7cae4,_0x36a7d9){_0x36a7d9=_0x36a7d9||0xcc;return function(_0x131c52){if(_0x131c52){return _0xc7cae4[_0xfa55('0x16')](_0x36a7d9);}return _0xc7cae4[_0xfa55('0x17')](_0x36a7d9)[_0xfa55('0x18')]();};}function respondWithResult(_0x23fc82,_0x449a65){_0x449a65=_0x449a65||0xc8;return function(_0x4ddd5c){if(_0x4ddd5c){return _0x23fc82['status'](_0x449a65)[_0xfa55('0x19')](_0x4ddd5c);}};}function respondWithFilteredResult(_0x44901e,_0x34fd49){return function(_0x4a34cf){if(_0x4a34cf){var _0x4ac1b2=typeof _0x34fd49[_0xfa55('0x1a')]===_0xfa55('0x1b')&&typeof _0x34fd49[_0xfa55('0x1c')]===_0xfa55('0x1b');var _0x416bb7=_0x4a34cf[_0xfa55('0x1d')];var _0x48de6b=_0x4ac1b2?0x0:_0x34fd49[_0xfa55('0x1a')];var _0x4cccba=_0x4ac1b2?_0x4a34cf[_0xfa55('0x1d')]:_0x34fd49[_0xfa55('0x1a')]+_0x34fd49[_0xfa55('0x1c')];var _0xa7af54;if(_0x4cccba>=_0x416bb7){_0x4cccba=_0x416bb7;_0xa7af54=0xc8;}else{_0xa7af54=0xce;}_0x44901e[_0xfa55('0x17')](_0xa7af54);return _0x44901e[_0xfa55('0x1e')](_0xfa55('0x1f'),_0x48de6b+'-'+_0x4cccba+'/'+_0x416bb7)['json'](_0x4a34cf);}return null;};}function patchUpdates(_0xe060f0){return function(_0x35121d){try{jsonpatch[_0xfa55('0x20')](_0x35121d,_0xe060f0,!![]);}catch(_0x32c9fd){return BPromise[_0xfa55('0x21')](_0x32c9fd);}return _0x35121d[_0xfa55('0x22')]();};}function saveUpdates(_0x5bf8da,_0x38064a){return function(_0x6ca9dc){if(_0x6ca9dc){return _0x6ca9dc['update'](_0x5bf8da)[_0xfa55('0x23')](function(_0x47415f){return _0x47415f;});}return null;};}function removeEntity(_0x3b7a72,_0x211f80){return function(_0x2d025d){if(_0x2d025d){return _0x2d025d[_0xfa55('0x24')]()[_0xfa55('0x23')](function(){var _0x3a360f=_0x2d025d['get']({'plain':!![]});var _0x5147a3='ODBC';return db[_0xfa55('0x25')][_0xfa55('0x24')]({'where':{'type':_0x5147a3,'resourceId':_0x3a360f['id']}})['then'](function(){return _0x2d025d;});})[_0xfa55('0x23')](function(){_0x3b7a72[_0xfa55('0x17')](0xcc)[_0xfa55('0x18')]();});}};}function handleEntityNotFound(_0x4f87c9,_0x533956){return function(_0x21357a){if(!_0x21357a){_0x4f87c9['sendStatus'](0x194);}return _0x21357a;};}function handleError(_0x5631fb,_0x29ced4){_0x29ced4=_0x29ced4||0x1f4;return function(_0x3dd24d){logger[_0xfa55('0x26')](_0x3dd24d[_0xfa55('0x27')]);if(_0x3dd24d['name']){delete _0x3dd24d[_0xfa55('0x28')];}_0x5631fb[_0xfa55('0x17')](_0x29ced4)[_0xfa55('0x29')](_0x3dd24d);};}exports['index']=function(_0x3da8b3,_0x4d4320){var _0x432c15={},_0x4917da={},_0xfaf293={'count':0x0,'rows':[]};var _0x1ac70a=_['map'](db[_0xfa55('0x2a')][_0xfa55('0x2b')],function(_0x431446){return{'name':_0x431446[_0xfa55('0x2c')],'type':_0x431446[_0xfa55('0x2d')]['key']};});_0x4917da['model']=_['map'](_0x1ac70a,_0xfa55('0x28'));_0x4917da['query']=_['keys'](_0x3da8b3[_0xfa55('0x2e')]);_0x4917da[_0xfa55('0x2f')]=_['intersection'](_0x4917da[_0xfa55('0x30')],_0x4917da[_0xfa55('0x2e')]);_0x432c15[_0xfa55('0x31')]=_[_0xfa55('0x32')](_0x4917da[_0xfa55('0x30')],qs[_0xfa55('0x33')](_0x3da8b3[_0xfa55('0x2e')][_0xfa55('0x33')]));_0x432c15[_0xfa55('0x31')]=_0x432c15[_0xfa55('0x31')]['length']?_0x432c15['attributes']:_0x4917da[_0xfa55('0x30')];if(!_0x3da8b3[_0xfa55('0x2e')][_0xfa55('0x34')]('nolimit')){_0x432c15['limit']=qs[_0xfa55('0x1c')](_0x3da8b3['query']['limit']);_0x432c15[_0xfa55('0x1a')]=qs[_0xfa55('0x1a')](_0x3da8b3[_0xfa55('0x2e')][_0xfa55('0x1a')]);}_0x432c15['order']=qs['sort'](_0x3da8b3['query'][_0xfa55('0x35')]);_0x432c15['where']=qs['filters'](_[_0xfa55('0x36')](_0x3da8b3[_0xfa55('0x2e')],_0x4917da[_0xfa55('0x2f')]),_0x1ac70a);if(_0x3da8b3[_0xfa55('0x2e')][_0xfa55('0x37')]){_0x432c15[_0xfa55('0x38')]=_['merge'](_0x432c15['where'],{'$or':_[_0xfa55('0x39')](_0x1ac70a,function(_0x4e6ed9){if(_0x4e6ed9[_0xfa55('0x2d')]!==_0xfa55('0x3a')){var _0x334513={};_0x334513[_0x4e6ed9[_0xfa55('0x28')]]={'$like':'%'+_0x3da8b3['query'][_0xfa55('0x37')]+'%'};return _0x334513;}})});}_0x432c15=_['merge']({},_0x432c15,_0x3da8b3[_0xfa55('0x3b')]);var _0x1d9d60={'where':_0x432c15[_0xfa55('0x38')]};return db[_0xfa55('0x2a')]['count'](_0x1d9d60)[_0xfa55('0x23')](function(_0x5a8c01){_0xfaf293[_0xfa55('0x1d')]=_0x5a8c01;if(_0x3da8b3[_0xfa55('0x2e')][_0xfa55('0x3c')]){_0x432c15['include']=[{'all':!![]}];}return db[_0xfa55('0x2a')][_0xfa55('0x3d')](_0x432c15);})[_0xfa55('0x23')](function(_0x4127c1){_0xfaf293[_0xfa55('0x3e')]=_0x4127c1;return _0xfaf293;})[_0xfa55('0x23')](respondWithFilteredResult(_0x4d4320,_0x432c15))[_0xfa55('0x3f')](handleError(_0x4d4320,null));};exports['show']=function(_0x1ff7cd,_0x4b978a){var _0x4ce094={'raw':!![],'where':{'id':_0x1ff7cd['params']['id']}},_0x26c449={};_0x26c449[_0xfa55('0x30')]=_[_0xfa55('0x40')](db['SquareOdbc'][_0xfa55('0x2b')]);_0x26c449[_0xfa55('0x2e')]=_[_0xfa55('0x40')](_0x1ff7cd[_0xfa55('0x2e')]);_0x26c449['filters']=_[_0xfa55('0x32')](_0x26c449[_0xfa55('0x30')],_0x26c449[_0xfa55('0x2e')]);_0x4ce094[_0xfa55('0x31')]=_['intersection'](_0x26c449[_0xfa55('0x30')],qs[_0xfa55('0x33')](_0x1ff7cd[_0xfa55('0x2e')]['fields']));_0x4ce094['attributes']=_0x4ce094['attributes'][_0xfa55('0x41')]?_0x4ce094[_0xfa55('0x31')]:_0x26c449[_0xfa55('0x30')];if(_0x1ff7cd[_0xfa55('0x2e')][_0xfa55('0x3c')]){_0x4ce094[_0xfa55('0x42')]=[{'all':!![]}];}_0x4ce094=_['merge']({},_0x4ce094,_0x1ff7cd[_0xfa55('0x3b')]);return db['SquareOdbc']['find'](_0x4ce094)['then'](handleEntityNotFound(_0x4b978a,null))['then'](respondWithResult(_0x4b978a,null))[_0xfa55('0x3f')](handleError(_0x4b978a,null));};exports[_0xfa55('0x43')]=function(_0x51a747,_0x1ac18a){return db[_0xfa55('0x2a')][_0xfa55('0x43')](_0x51a747[_0xfa55('0x44')],{})[_0xfa55('0x23')](function(_0x4fd6d2){var _0x5434c6=_0x51a747[_0xfa55('0x45')][_0xfa55('0x46')]({'plain':!![]});if(!_0x5434c6)throw new Error(_0xfa55('0x47'));if(_0x5434c6[_0xfa55('0x48')]===_0xfa55('0x45')){var _0x29e7c1=_0x4fd6d2[_0xfa55('0x46')]({'plain':!![]});var _0x2fb67e=_0xfa55('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x2fb67e,'userProfileId':_0x5434c6[_0xfa55('0x4a')]},'raw':!![]})['then'](function(_0x5bf7a4){if(_0x5bf7a4&&_0x5bf7a4[_0xfa55('0x4b')]===0x0){return db[_0xfa55('0x25')][_0xfa55('0x43')]({'name':_0x29e7c1[_0xfa55('0x28')],'resourceId':_0x29e7c1['id'],'type':_0x5bf7a4[_0xfa55('0x28')],'sectionId':_0x5bf7a4['id']},{})['then'](function(){return _0x4fd6d2;});}else{return _0x4fd6d2;}})[_0xfa55('0x3f')](function(_0x21555d){logger[_0xfa55('0x26')](_0xfa55('0x4c'),_0x21555d);throw _0x21555d;});}return _0x4fd6d2;})['then'](respondWithResult(_0x1ac18a,0xc9))[_0xfa55('0x3f')](handleError(_0x1ac18a,null));};exports['update']=function(_0x5e7986,_0x2ed0db){if(_0x5e7986[_0xfa55('0x44')]['id']){delete _0x5e7986[_0xfa55('0x44')]['id'];}return db[_0xfa55('0x2a')][_0xfa55('0x4d')]({'where':{'id':_0x5e7986['params']['id']}})['then'](handleEntityNotFound(_0x2ed0db,null))['then'](saveUpdates(_0x5e7986['body'],null))[_0xfa55('0x23')](respondWithResult(_0x2ed0db,null))[_0xfa55('0x3f')](handleError(_0x2ed0db,null));};exports[_0xfa55('0x24')]=function(_0x498038,_0x5e1888){return db[_0xfa55('0x2a')]['find']({'where':{'id':_0x498038[_0xfa55('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5e1888,null))[_0xfa55('0x23')](removeEntity(_0x5e1888,null))[_0xfa55('0x3f')](handleError(_0x5e1888,null));};exports[_0xfa55('0x4f')]=function(_0xa74175,_0x5437d6,_0x18495c){var _0x5245b;return db[_0xfa55('0x2a')]['find']({'where':{'id':_0xa74175[_0xfa55('0x4e')]['id']},'attributes':['id',_0xfa55('0x50')]})[_0xfa55('0x23')](handleEntityNotFound(_0x5437d6,null))[_0xfa55('0x23')](function(_0x16d212){if(_0x16d212){var _0x4beca0=require('odbc')();_0x4beca0[_0xfa55('0x51')](_0x16d212[_0xfa55('0x50')]);_0x4beca0[_0xfa55('0x52')]();return _0x16d212;}})['then'](respondWithResult(_0x5437d6,null))[_0xfa55('0x3f')](handleError(_0x5437d6,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 27b8a69..ece0980 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 _0xcfb0=['path','rimraf','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2073f8,_0x34a29d){var _0x11c069=function(_0x1c49ab){while(--_0x1c49ab){_0x2073f8['push'](_0x2073f8['shift']());}};_0x11c069(++_0x34a29d);}(_0xcfb0,0x14b));var _0x0cfb=function(_0x3dffe3,_0x2a432a){_0x3dffe3=_0x3dffe3-0x0;var _0x2e015f=_0xcfb0[_0x3dffe3];return _0x2e015f;};'use strict';var _=require(_0x0cfb('0x0'));var util=require(_0x0cfb('0x1'));var logger=require(_0x0cfb('0x2'))(_0x0cfb('0x3'));var moment=require(_0x0cfb('0x4'));var BPromise=require(_0x0cfb('0x5'));var rp=require(_0x0cfb('0x6'));var fs=require('fs');var path=require(_0x0cfb('0x7'));var rimraf=require(_0x0cfb('0x8'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0x0cfb('0x9')]=function(_0x2f82ce,_0x2684ba){return _0x2f82ce[_0x0cfb('0xa')](_0x0cfb('0xb'),attributes,{'tableName':_0x0cfb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8711=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util'];(function(_0x207cf1,_0x14e106){var _0x5e52a2=function(_0xee691f){while(--_0xee691f){_0x207cf1['push'](_0x207cf1['shift']());}};_0x5e52a2(++_0x14e106);}(_0x8711,0x1de));var _0x1871=function(_0x3afae7,_0x1f224f){_0x3afae7=_0x3afae7-0x0;var _0x45e4ac=_0x8711[_0x3afae7];return _0x45e4ac;};'use strict';var _=require(_0x1871('0x0'));var util=require(_0x1871('0x1'));var logger=require(_0x1871('0x2'))(_0x1871('0x3'));var moment=require(_0x1871('0x4'));var BPromise=require(_0x1871('0x5'));var rp=require(_0x1871('0x6'));var fs=require('fs');var path=require(_0x1871('0x7'));var rimraf=require(_0x1871('0x8'));var config=require(_0x1871('0x9'));var attributes=require(_0x1871('0xa'));module[_0x1871('0xb')]=function(_0x2245dc,_0x36b594){return _0x2245dc[_0x1871('0xc')](_0x1871('0xd'),attributes,{'tableName':_0x1871('0xe'),'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 d482c46..714669f 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 _0xe1aa=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','catch','ShowSquareOdbc','find','options','attributes','include','model','map','then','info','lodash','util','moment','bluebird','randomstring'];(function(_0x107464,_0x1c5318){var _0x220dbd=function(_0x5f229d){while(--_0x5f229d){_0x107464['push'](_0x107464['shift']());}};_0x220dbd(++_0x1c5318);}(_0xe1aa,0x1bb));var _0xae1a=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xe1aa[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xae1a('0x0'));var util=require(_0xae1a('0x1'));var moment=require(_0xae1a('0x2'));var BPromise=require(_0xae1a('0x3'));var rs=require(_0xae1a('0x4'));var fs=require('fs');var Redis=require(_0xae1a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xae1a('0x6'));var logger=require(_0xae1a('0x7'))(_0xae1a('0x8'));var config=require(_0xae1a('0x9'));var jayson=require(_0xae1a('0xa'));var client=jayson[_0xae1a('0xb')][_0xae1a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a4c35,_0x579045,_0x16dd95){return new BPromise(function(_0x1f4389,_0x2081a4){return client[_0xae1a('0xd')](_0x5a4c35,_0x16dd95)['then'](function(_0x566af3){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x579045,_0xae1a('0xe'));logger[_0xae1a('0xf')](_0xae1a('0x10'),_0x579045,_0xae1a('0xe'),JSON[_0xae1a('0x11')](_0x566af3));if(_0x566af3[_0xae1a('0x12')]){if(_0x566af3['error'][_0xae1a('0x13')]===0x1f4){logger['error'](_0xae1a('0x14'),_0x579045,_0x566af3['error'][_0xae1a('0x15')]);return _0x2081a4(_0x566af3[_0xae1a('0x12')][_0xae1a('0x15')]);}logger[_0xae1a('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x579045,_0x566af3[_0xae1a('0x12')][_0xae1a('0x15')]);return _0x1f4389(_0x566af3[_0xae1a('0x12')][_0xae1a('0x15')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x579045,_0xae1a('0xe'));_0x1f4389(_0x566af3['result']['message']);}})[_0xae1a('0x16')](function(_0x2344e1){logger[_0xae1a('0x12')](_0xae1a('0x14'),_0x579045,_0x2344e1);_0x2081a4(_0x2344e1);});});}exports[_0xae1a('0x17')]=function(_0x3b239a){var _0x49578f=this;return new Promise(function(_0x49645a,_0x240aa8){return db['SquareOdbc'][_0xae1a('0x18')]({'raw':_0x3b239a[_0xae1a('0x19')]?_0x3b239a[_0xae1a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3b239a[_0xae1a('0x19')]?_0x3b239a['options']['where']||null:null,'attributes':_0x3b239a[_0xae1a('0x19')]?_0x3b239a[_0xae1a('0x19')][_0xae1a('0x1a')]||null:null,'include':_0x3b239a[_0xae1a('0x19')]?_0x3b239a[_0xae1a('0x19')][_0xae1a('0x1b')]?_['map'](_0x3b239a['options']['include'],function(_0x3800bb){return{'model':db[_0x3800bb[_0xae1a('0x1c')]],'as':_0x3800bb['as'],'attributes':_0x3800bb['attributes'],'include':_0x3800bb['include']?_[_0xae1a('0x1d')](_0x3800bb[_0xae1a('0x1b')],function(_0x27ea1d){return{'model':db[_0x27ea1d[_0xae1a('0x1c')]],'as':_0x27ea1d['as'],'attributes':_0x27ea1d[_0xae1a('0x1a')],'include':_0x27ea1d[_0xae1a('0x1b')]?_[_0xae1a('0x1d')](_0x27ea1d[_0xae1a('0x1b')],function(_0x1cdeef){return{'model':db[_0x1cdeef['model']],'as':_0x1cdeef['as'],'attributes':_0x1cdeef['attributes']};}):[]};}):[]};}):[]:[]})[_0xae1a('0x1e')](function(_0x5db020){logger[_0xae1a('0x1f')](_0xae1a('0x17'),_0x3b239a);logger[_0xae1a('0xf')](_0xae1a('0x17'),_0x3b239a,JSON[_0xae1a('0x11')](_0x5db020));_0x49645a(_0x5db020);})[_0xae1a('0x16')](function(_0x20e694){logger[_0xae1a('0x12')](_0xae1a('0x17'),_0x20e694[_0xae1a('0x15')],_0x3b239a);_0x240aa8(_0x49578f[_0xae1a('0x12')](0x1f4,_0x20e694[_0xae1a('0x15')]));});});}; \ No newline at end of file +var _0xf1e9=['request\x20sent','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','catch','ShowSquareOdbc','SquareOdbc','find','options','where','attributes','include','map','model','then','debug','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x22b338,_0x20106a){var _0x304779=function(_0x21134a){while(--_0x21134a){_0x22b338['push'](_0x22b338['shift']());}};_0x304779(++_0x20106a);}(_0xf1e9,0x6d));var _0x9f1e=function(_0x1a71bf,_0x28302a){_0x1a71bf=_0x1a71bf-0x0;var _0x1bbb1b=_0xf1e9[_0x1a71bf];return _0x1bbb1b;};'use strict';var _=require('lodash');var util=require(_0x9f1e('0x0'));var moment=require(_0x9f1e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f1e('0x2'));var db=require(_0x9f1e('0x3'))['db'];var utils=require(_0x9f1e('0x4'));var logger=require('../../config/logger')(_0x9f1e('0x5'));var config=require(_0x9f1e('0x6'));var jayson=require(_0x9f1e('0x7'));var client=jayson[_0x9f1e('0x8')][_0x9f1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b97e0,_0x1a45b1,_0x390795){return new BPromise(function(_0x3d049f,_0x59cf86){return client['request'](_0x4b97e0,_0x390795)['then'](function(_0x47613c){logger[_0x9f1e('0xa')]('SquareOdbc,\x20%s,\x20%s',_0x1a45b1,_0x9f1e('0xb'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x1a45b1,_0x9f1e('0xb'),JSON[_0x9f1e('0xc')](_0x47613c));if(_0x47613c[_0x9f1e('0xd')]){if(_0x47613c['error'][_0x9f1e('0xe')]===0x1f4){logger[_0x9f1e('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x1a45b1,_0x47613c[_0x9f1e('0xd')]['message']);return _0x59cf86(_0x47613c[_0x9f1e('0xd')][_0x9f1e('0xf')]);}logger['error'](_0x9f1e('0x10'),_0x1a45b1,_0x47613c[_0x9f1e('0xd')][_0x9f1e('0xf')]);return _0x3d049f(_0x47613c[_0x9f1e('0xd')][_0x9f1e('0xf')]);}else{logger[_0x9f1e('0xa')](_0x9f1e('0x10'),_0x1a45b1,'request\x20sent');_0x3d049f(_0x47613c[_0x9f1e('0x11')][_0x9f1e('0xf')]);}})[_0x9f1e('0x12')](function(_0x46ecde){logger[_0x9f1e('0xd')](_0x9f1e('0x10'),_0x1a45b1,_0x46ecde);_0x59cf86(_0x46ecde);});});}exports[_0x9f1e('0x13')]=function(_0x541f4e){var _0x10e84a=this;return new Promise(function(_0x5760d3,_0x60d84){return db[_0x9f1e('0x14')][_0x9f1e('0x15')]({'raw':_0x541f4e[_0x9f1e('0x16')]?_0x541f4e[_0x9f1e('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x541f4e[_0x9f1e('0x16')]?_0x541f4e[_0x9f1e('0x16')][_0x9f1e('0x17')]||null:null,'attributes':_0x541f4e[_0x9f1e('0x16')]?_0x541f4e['options'][_0x9f1e('0x18')]||null:null,'include':_0x541f4e[_0x9f1e('0x16')]?_0x541f4e[_0x9f1e('0x16')][_0x9f1e('0x19')]?_[_0x9f1e('0x1a')](_0x541f4e[_0x9f1e('0x16')][_0x9f1e('0x19')],function(_0x3ca5d5){return{'model':db[_0x3ca5d5[_0x9f1e('0x1b')]],'as':_0x3ca5d5['as'],'attributes':_0x3ca5d5[_0x9f1e('0x18')],'include':_0x3ca5d5[_0x9f1e('0x19')]?_[_0x9f1e('0x1a')](_0x3ca5d5[_0x9f1e('0x19')],function(_0x472429){return{'model':db[_0x472429[_0x9f1e('0x1b')]],'as':_0x472429['as'],'attributes':_0x472429['attributes'],'include':_0x472429[_0x9f1e('0x19')]?_[_0x9f1e('0x1a')](_0x472429['include'],function(_0x55fa81){return{'model':db[_0x55fa81['model']],'as':_0x55fa81['as'],'attributes':_0x55fa81[_0x9f1e('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9f1e('0x1c')](function(_0x5ace2f){logger[_0x9f1e('0xa')](_0x9f1e('0x13'),_0x541f4e);logger[_0x9f1e('0x1d')](_0x9f1e('0x13'),_0x541f4e,JSON['stringify'](_0x5ace2f));_0x5760d3(_0x5ace2f);})[_0x9f1e('0x12')](function(_0x2ca337){logger[_0x9f1e('0xd')](_0x9f1e('0x13'),_0x2ca337[_0x9f1e('0xf')],_0x541f4e);_0x60d84(_0x10e84a['error'](0x1f4,_0x2ca337['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 11f60fc..443cb92 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 _0x1f3c=['show','post','isAuthenticated','create','put','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','index','/:id'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x1f3c,0xa0));var _0xc1f3=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x1f3c[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0xc1f3('0x0'));var util=require('util');var path=require(_0xc1f3('0x1'));var timeout=require('connect-timeout');var express=require(_0xc1f3('0x2'));var router=express['Router']();var fs_extra=require(_0xc1f3('0x3'));var auth=require(_0xc1f3('0x4'));var interaction=require(_0xc1f3('0x5'));var config=require(_0xc1f3('0x6'));var controller=require(_0xc1f3('0x7'));router[_0xc1f3('0x8')]('/',auth['isAuthenticated'](),controller[_0xc1f3('0x9')]);router[_0xc1f3('0x8')](_0xc1f3('0xa'),auth['isAuthenticated'](),controller[_0xc1f3('0xb')]);router[_0xc1f3('0xc')]('/',auth[_0xc1f3('0xd')](),controller[_0xc1f3('0xe')]);router[_0xc1f3('0xf')](_0xc1f3('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc1f3('0x10')](_0xc1f3('0xa'),auth[_0xc1f3('0xd')](),controller[_0xc1f3('0x11')]);module[_0xc1f3('0x12')]=router; \ No newline at end of file +var _0x50c0=['express','Router','../../components/auth/service','../../config/environment','./squareProject.controller','get','/:id','isAuthenticated','show','post','create','put','update','destroy','path','connect-timeout'];(function(_0x5466e0,_0x586206){var _0xf32c89=function(_0x68e0e9){while(--_0x68e0e9){_0x5466e0['push'](_0x5466e0['shift']());}};_0xf32c89(++_0x586206);}(_0x50c0,0x1be));var _0x050c=function(_0x205b46,_0x3ca65b){_0x205b46=_0x205b46-0x0;var _0x2b6ae8=_0x50c0[_0x205b46];return _0x2b6ae8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x050c('0x0'));var timeout=require(_0x050c('0x1'));var express=require(_0x050c('0x2'));var router=express[_0x050c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x050c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x050c('0x5'));var controller=require(_0x050c('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x050c('0x7')](_0x050c('0x8'),auth[_0x050c('0x9')](),controller[_0x050c('0xa')]);router[_0x050c('0xb')]('/',auth[_0x050c('0x9')](),controller[_0x050c('0xc')]);router[_0x050c('0xd')](_0x050c('0x8'),auth[_0x050c('0x9')](),controller[_0x050c('0xe')]);router['delete']('/:id',auth[_0x050c('0x9')](),controller[_0x050c('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index b3de75a..e00a257 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 _0x6aba=['toString','utf8','production','DATE','sequelize','STRING','TEXT','BLOB','long','getDataValue','preproduction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6aba,0x1e8));var _0xa6ab=function(_0xa99932,_0x474c57){_0xa99932=_0xa99932-0x0;var _0x23988a=_0x6aba[_0xa99932];return _0x23988a;};'use strict';var Sequelize=require(_0xa6ab('0x0'));module['exports']={'name':{'type':Sequelize[_0xa6ab('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xa6ab('0x1')]},'notes':{'type':Sequelize[_0xa6ab('0x2')]},'preproduction':{'type':Sequelize[_0xa6ab('0x3')](_0xa6ab('0x4')),'get':function(){if(this[_0xa6ab('0x5')](_0xa6ab('0x6'))){return this['getDataValue'](_0xa6ab('0x6'))[_0xa6ab('0x7')](_0xa6ab('0x8'));}}},'production':{'type':Sequelize[_0xa6ab('0x3')](_0xa6ab('0x4')),'get':function(){if(this[_0xa6ab('0x5')](_0xa6ab('0x9'))){return this[_0xa6ab('0x5')]('production')[_0xa6ab('0x7')](_0xa6ab('0x8'));}}},'savedAt':{'type':Sequelize[_0xa6ab('0xa')]},'publishedAt':{'type':Sequelize[_0xa6ab('0xa')]}}; \ No newline at end of file +var _0x22ea=['name','TEXT','long','getDataValue','preproduction','BLOB','production','toString','utf8','DATE','sequelize','exports','STRING'];(function(_0x240618,_0x4f2f56){var _0x546fe0=function(_0x515f09){while(--_0x515f09){_0x240618['push'](_0x240618['shift']());}};_0x546fe0(++_0x4f2f56);}(_0x22ea,0xb3));var _0xa22e=function(_0x49d0da,_0x1bd55b){_0x49d0da=_0x49d0da-0x0;var _0x49b451=_0x22ea[_0x49d0da];return _0x49b451;};'use strict';var Sequelize=require(_0xa22e('0x0'));module[_0xa22e('0x1')]={'name':{'type':Sequelize[_0xa22e('0x2')],'unique':_0xa22e('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xa22e('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0xa22e('0x5')),'get':function(){if(this[_0xa22e('0x6')](_0xa22e('0x7'))){return this[_0xa22e('0x6')](_0xa22e('0x7'))['toString']('utf8');}}},'production':{'type':Sequelize[_0xa22e('0x8')](_0xa22e('0x5')),'get':function(){if(this[_0xa22e('0x6')](_0xa22e('0x9'))){return this[_0xa22e('0x6')](_0xa22e('0x9'))[_0xa22e('0xa')](_0xa22e('0xb'));}}},'savedAt':{'type':Sequelize[_0xa22e('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index c863357..c01ee17 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 _0x7b1a=['catch','show','params','length','options','create','body','user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','publish','production','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./squareProject.socket','register','status','json','offset','undefined','count','then','destroy','get','SquareProjects','UserProfileResource','agi','end','sendStatus','error','stack','name','map','SquareProject','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x7b1a,0x1ce));var _0xa7b1=function(_0x4901ef,_0x4dc90b){_0x4901ef=_0x4901ef-0x0;var _0x4b471c=_0x7b1a[_0x4901ef];return _0x4b471c;};'use strict';var _=require(_0xa7b1('0x0'));var Redis=require(_0xa7b1('0x1'));var qs=require(_0xa7b1('0x2'));var logger=require('../../config/logger')(_0xa7b1('0x3'));var config=require(_0xa7b1('0x4'));var db=require(_0xa7b1('0x5'))['db'];config[_0xa7b1('0x6')]=_[_0xa7b1('0x7')](config[_0xa7b1('0x6')],{'host':_0xa7b1('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7b1('0x6')]));require(_0xa7b1('0x9'))[_0xa7b1('0xa')](socket);function respondWithResult(_0x561b04,_0x3a143a){_0x3a143a=_0x3a143a||0xc8;return function(_0x323ddb){if(_0x323ddb){return _0x561b04[_0xa7b1('0xb')](_0x3a143a)[_0xa7b1('0xc')](_0x323ddb);}};}function respondWithFilteredResult(_0x39f542,_0x369dd2){return function(_0x5816a2){if(_0x5816a2){var _0x5ab707=typeof _0x369dd2[_0xa7b1('0xd')]===_0xa7b1('0xe')&&typeof _0x369dd2['limit']===_0xa7b1('0xe');var _0x4e135d=_0x5816a2[_0xa7b1('0xf')];var _0x22b552=_0x5ab707?0x0:_0x369dd2['offset'];var _0x59e6b3=_0x5ab707?_0x5816a2[_0xa7b1('0xf')]:_0x369dd2['offset']+_0x369dd2['limit'];var _0x5ddba1;if(_0x59e6b3>=_0x4e135d){_0x59e6b3=_0x4e135d;_0x5ddba1=0xc8;}else{_0x5ddba1=0xce;}_0x39f542[_0xa7b1('0xb')](_0x5ddba1);return _0x39f542['set']('Content-Range',_0x22b552+'-'+_0x59e6b3+'/'+_0x4e135d)[_0xa7b1('0xc')](_0x5816a2);}return null;};}function saveUpdates(_0x673e66){return function(_0x4274d4){if(_0x4274d4){return _0x4274d4['update'](_0x673e66)[_0xa7b1('0x10')](function(_0x596816){return _0x596816;});}return null;};}function removeEntity(_0x42a0b1){return function(_0x5138f1){if(_0x5138f1){return _0x5138f1[_0xa7b1('0x11')]()[_0xa7b1('0x10')](function(){var _0x3c5b86=_0x5138f1[_0xa7b1('0x12')]({'plain':!![]});var _0x415462=_0xa7b1('0x13');return db[_0xa7b1('0x14')][_0xa7b1('0x11')]({'where':{'type':_0x415462,'resourceId':_0x3c5b86['id']}})['then'](function(){return _0x5138f1;});})[_0xa7b1('0x10')](function(){var _0x372250=new Redis(config[_0xa7b1('0x6')]);_0x372250['publish'](_0xa7b1('0x15'),JSON['stringify']({'id':_0x5138f1['id'],'deleted':!![]}));})[_0xa7b1('0x10')](function(){_0x42a0b1[_0xa7b1('0xb')](0xcc)[_0xa7b1('0x16')]();});}};}function handleEntityNotFound(_0x4004ed){return function(_0x497241){if(!_0x497241){_0x4004ed[_0xa7b1('0x17')](0x194);}return _0x497241;};}function handleError(_0x4b79df,_0x9003e2){_0x9003e2=_0x9003e2||0x1f4;return function(_0x184859){logger[_0xa7b1('0x18')](_0x184859[_0xa7b1('0x19')]);if(_0x184859['name']){delete _0x184859[_0xa7b1('0x1a')];}_0x4b79df[_0xa7b1('0xb')](_0x9003e2)['send'](_0x184859);};}exports['index']=function(_0x4d6a14,_0x39fc01){var _0xc07a3f={},_0x55e6ed={},_0x31ea72={'count':0x0,'rows':[]};var _0x49e54f=_[_0xa7b1('0x1b')](db[_0xa7b1('0x1c')][_0xa7b1('0x1d')],function(_0x57d442){return{'name':_0x57d442[_0xa7b1('0x1e')],'type':_0x57d442['type'][_0xa7b1('0x1f')]};});_0x55e6ed[_0xa7b1('0x20')]=_[_0xa7b1('0x1b')](_0x49e54f,_0xa7b1('0x1a'));_0x55e6ed[_0xa7b1('0x21')]=_[_0xa7b1('0x22')](_0x4d6a14[_0xa7b1('0x21')]);_0x55e6ed['filters']=_[_0xa7b1('0x23')](_0x55e6ed[_0xa7b1('0x20')],_0x55e6ed[_0xa7b1('0x21')]);_0xc07a3f[_0xa7b1('0x24')]=_['intersection'](_0x55e6ed[_0xa7b1('0x20')],qs['fields'](_0x4d6a14[_0xa7b1('0x21')]['fields']));_0xc07a3f[_0xa7b1('0x24')]=_0xc07a3f['attributes']['length']?_0xc07a3f[_0xa7b1('0x24')]:_0x55e6ed[_0xa7b1('0x20')];if(!_0x4d6a14[_0xa7b1('0x21')][_0xa7b1('0x25')](_0xa7b1('0x26'))){_0xc07a3f[_0xa7b1('0x27')]=qs['limit'](_0x4d6a14[_0xa7b1('0x21')][_0xa7b1('0x27')]);_0xc07a3f['offset']=qs['offset'](_0x4d6a14[_0xa7b1('0x21')][_0xa7b1('0xd')]);}_0xc07a3f['order']=qs[_0xa7b1('0x28')](_0x4d6a14[_0xa7b1('0x21')][_0xa7b1('0x28')]);_0xc07a3f[_0xa7b1('0x29')]=qs['filters'](_[_0xa7b1('0x2a')](_0x4d6a14[_0xa7b1('0x21')],_0x55e6ed[_0xa7b1('0x2b')]),_0x49e54f);if(_0x4d6a14['query'][_0xa7b1('0x2c')]){_0xc07a3f[_0xa7b1('0x29')]=_[_0xa7b1('0x2d')](_0xc07a3f[_0xa7b1('0x29')],{'$or':_[_0xa7b1('0x1b')](_0x49e54f,function(_0x1b2dd3){if(_0x1b2dd3['type']!=='VIRTUAL'){var _0x3970b8={};_0x3970b8[_0x1b2dd3[_0xa7b1('0x1a')]]={'$like':'%'+_0x4d6a14[_0xa7b1('0x21')][_0xa7b1('0x2c')]+'%'};return _0x3970b8;}})});}_0xc07a3f=_['merge']({},_0xc07a3f,_0x4d6a14['options']);var _0x4c7609={'where':_0xc07a3f['where']};return db[_0xa7b1('0x1c')]['count'](_0x4c7609)[_0xa7b1('0x10')](function(_0x219858){_0x31ea72[_0xa7b1('0xf')]=_0x219858;if(_0x4d6a14['query'][_0xa7b1('0x2e')]){_0xc07a3f[_0xa7b1('0x2f')]=[{'all':!![]}];}return db[_0xa7b1('0x1c')][_0xa7b1('0x30')](_0xc07a3f);})[_0xa7b1('0x10')](function(_0x14e36f){_0x31ea72[_0xa7b1('0x31')]=_0x14e36f;return _0x31ea72;})[_0xa7b1('0x10')](respondWithFilteredResult(_0x39fc01,_0xc07a3f))[_0xa7b1('0x32')](handleError(_0x39fc01,null));};exports[_0xa7b1('0x33')]=function(_0x1d5212,_0x1cb9ee){var _0x370c12={'raw':![],'where':{'id':_0x1d5212[_0xa7b1('0x34')]['id']}},_0x4dd13={};_0x4dd13['model']=_[_0xa7b1('0x22')](db['SquareProject'][_0xa7b1('0x1d')]);_0x4dd13[_0xa7b1('0x21')]=_['keys'](_0x1d5212[_0xa7b1('0x21')]);_0x4dd13[_0xa7b1('0x2b')]=_[_0xa7b1('0x23')](_0x4dd13[_0xa7b1('0x20')],_0x4dd13['query']);_0x370c12[_0xa7b1('0x24')]=_[_0xa7b1('0x23')](_0x4dd13[_0xa7b1('0x20')],qs['fields'](_0x1d5212[_0xa7b1('0x21')]['fields']));_0x370c12[_0xa7b1('0x24')]=_0x370c12[_0xa7b1('0x24')][_0xa7b1('0x35')]?_0x370c12['attributes']:_0x4dd13[_0xa7b1('0x20')];if(_0x1d5212[_0xa7b1('0x21')][_0xa7b1('0x2e')]){_0x370c12[_0xa7b1('0x2f')]=[{'all':!![]}];}_0x370c12=_[_0xa7b1('0x2d')]({},_0x370c12,_0x1d5212[_0xa7b1('0x36')]);return db[_0xa7b1('0x1c')]['find'](_0x370c12)[_0xa7b1('0x10')](handleEntityNotFound(_0x1cb9ee,null))[_0xa7b1('0x10')](respondWithResult(_0x1cb9ee,null))[_0xa7b1('0x32')](handleError(_0x1cb9ee,null));};exports[_0xa7b1('0x37')]=function(_0x2b1ac8,_0x360a57){return db['SquareProject'][_0xa7b1('0x37')](_0x2b1ac8[_0xa7b1('0x38')],{})[_0xa7b1('0x10')](function(_0x1eb3c1){var _0x3fd936=_0x2b1ac8[_0xa7b1('0x39')][_0xa7b1('0x12')]({'plain':!![]});if(!_0x3fd936)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fd936[_0xa7b1('0x3a')]===_0xa7b1('0x39')){var _0x5e6180=_0x1eb3c1[_0xa7b1('0x12')]({'plain':!![]});var _0x209816=_0xa7b1('0x13');return db['UserProfileSection'][_0xa7b1('0x3b')]({'where':{'name':_0x209816,'userProfileId':_0x3fd936[_0xa7b1('0x3c')]},'raw':!![]})[_0xa7b1('0x10')](function(_0x2aefcd){if(_0x2aefcd&&_0x2aefcd['autoAssociation']===0x0){return db[_0xa7b1('0x14')][_0xa7b1('0x37')]({'name':_0x5e6180[_0xa7b1('0x1a')],'resourceId':_0x5e6180['id'],'type':_0x2aefcd[_0xa7b1('0x1a')],'sectionId':_0x2aefcd['id']},{})[_0xa7b1('0x10')](function(){return _0x1eb3c1;});}else{return _0x1eb3c1;}})['catch'](function(_0x54977e){logger[_0xa7b1('0x18')](_0xa7b1('0x3d'),_0x54977e);throw _0x54977e;});}return _0x1eb3c1;})['then'](respondWithResult(_0x360a57,0xc9))['catch'](handleError(_0x360a57,null));};exports['update']=function(_0x47cab8,_0xcd0782){if(_0x47cab8[_0xa7b1('0x38')]['id']){delete _0x47cab8['body']['id'];}return db[_0xa7b1('0x1c')][_0xa7b1('0x3b')]({'where':{'id':_0x47cab8[_0xa7b1('0x34')]['id']}})['then'](handleEntityNotFound(_0xcd0782,null))[_0xa7b1('0x10')](saveUpdates(_0x47cab8['body'],null))[_0xa7b1('0x10')](function(_0x32da3d){if(!_0x32da3d)return;var _0x505639=_0x32da3d[_0xa7b1('0x12')]({'plain':!![]});return _0x505639;})[_0xa7b1('0x10')](function(_0x1b98bc){var _0x3c2ede=new Redis(config[_0xa7b1('0x6')]);_0x3c2ede[_0xa7b1('0x3e')](_0xa7b1('0x15'),JSON['stringify'](_[_0xa7b1('0x2a')](_0x1b98bc,['id',_0xa7b1('0x1a'),_0xa7b1('0x3f')])));return _0x1b98bc;})[_0xa7b1('0x10')](respondWithResult(_0xcd0782,null))[_0xa7b1('0x32')](handleError(_0xcd0782,null));};exports[_0xa7b1('0x11')]=function(_0xd711cb,_0x3a7c4e){return db[_0xa7b1('0x1c')][_0xa7b1('0x3b')]({'where':{'id':_0xd711cb[_0xa7b1('0x34')]['id']}})[_0xa7b1('0x10')](handleEntityNotFound(_0x3a7c4e,null))[_0xa7b1('0x10')](removeEntity(_0x3a7c4e,null))['catch'](handleError(_0x3a7c4e,null));}; \ No newline at end of file +var _0xd65f=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','pick','production','destroy','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','offset','undefined','limit','count','Content-Range','json','update','then','SquareProjects','UserProfileResource','publish','agi','stringify','end','sendStatus','error','stack','name','index','map','SquareProject','fieldName','type','key','keys','query','filters','model','attributes','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','intersection','include','find','create','body','get','role','UserProfileSection','userProfileId'];(function(_0x59c6bb,_0x38c933){var _0x30cfc9=function(_0x544559){while(--_0x544559){_0x59c6bb['push'](_0x59c6bb['shift']());}};_0x30cfc9(++_0x38c933);}(_0xd65f,0xd5));var _0xfd65=function(_0x2b6f49,_0x3f5a45){_0x2b6f49=_0x2b6f49-0x0;var _0x26d444=_0xd65f[_0x2b6f49];return _0x26d444;};'use strict';var _=require(_0xfd65('0x0'));var Redis=require(_0xfd65('0x1'));var qs=require(_0xfd65('0x2'));var logger=require(_0xfd65('0x3'))('api');var config=require(_0xfd65('0x4'));var db=require('../../mysqldb')['db'];config[_0xfd65('0x5')]=_['defaults'](config[_0xfd65('0x5')],{'host':_0xfd65('0x6'),'port':0x18eb});var socket=require(_0xfd65('0x7'))(new Redis(config['redis']));require(_0xfd65('0x8'))[_0xfd65('0x9')](socket);function respondWithResult(_0x4be40e,_0x1e6bff){_0x1e6bff=_0x1e6bff||0xc8;return function(_0x1a50f6){if(_0x1a50f6){return _0x4be40e[_0xfd65('0xa')](_0x1e6bff)['json'](_0x1a50f6);}};}function respondWithFilteredResult(_0x6a5183,_0x1cb13f){return function(_0x20d9b9){if(_0x20d9b9){var _0x5794a2=typeof _0x1cb13f[_0xfd65('0xb')]===_0xfd65('0xc')&&typeof _0x1cb13f[_0xfd65('0xd')]===_0xfd65('0xc');var _0x1aee8f=_0x20d9b9[_0xfd65('0xe')];var _0x4b41a5=_0x5794a2?0x0:_0x1cb13f['offset'];var _0x57ceaa=_0x5794a2?_0x20d9b9['count']:_0x1cb13f['offset']+_0x1cb13f[_0xfd65('0xd')];var _0x57e9d7;if(_0x57ceaa>=_0x1aee8f){_0x57ceaa=_0x1aee8f;_0x57e9d7=0xc8;}else{_0x57e9d7=0xce;}_0x6a5183[_0xfd65('0xa')](_0x57e9d7);return _0x6a5183['set'](_0xfd65('0xf'),_0x4b41a5+'-'+_0x57ceaa+'/'+_0x1aee8f)[_0xfd65('0x10')](_0x20d9b9);}return null;};}function saveUpdates(_0x1bfd0b){return function(_0x1f2c75){if(_0x1f2c75){return _0x1f2c75[_0xfd65('0x11')](_0x1bfd0b)[_0xfd65('0x12')](function(_0x3cb600){return _0x3cb600;});}return null;};}function removeEntity(_0x18608f){return function(_0x4f6c3b){if(_0x4f6c3b){return _0x4f6c3b['destroy']()[_0xfd65('0x12')](function(){var _0x11db5c=_0x4f6c3b['get']({'plain':!![]});var _0x11c41=_0xfd65('0x13');return db[_0xfd65('0x14')]['destroy']({'where':{'type':_0x11c41,'resourceId':_0x11db5c['id']}})[_0xfd65('0x12')](function(){return _0x4f6c3b;});})[_0xfd65('0x12')](function(){var _0x58a0bb=new Redis(config[_0xfd65('0x5')]);_0x58a0bb[_0xfd65('0x15')](_0xfd65('0x16'),JSON[_0xfd65('0x17')]({'id':_0x4f6c3b['id'],'deleted':!![]}));})[_0xfd65('0x12')](function(){_0x18608f[_0xfd65('0xa')](0xcc)[_0xfd65('0x18')]();});}};}function handleEntityNotFound(_0x4d1cce){return function(_0x4d9750){if(!_0x4d9750){_0x4d1cce[_0xfd65('0x19')](0x194);}return _0x4d9750;};}function handleError(_0xa95689,_0x6a2fee){_0x6a2fee=_0x6a2fee||0x1f4;return function(_0xbb77c0){logger[_0xfd65('0x1a')](_0xbb77c0[_0xfd65('0x1b')]);if(_0xbb77c0['name']){delete _0xbb77c0[_0xfd65('0x1c')];}_0xa95689[_0xfd65('0xa')](_0x6a2fee)['send'](_0xbb77c0);};}exports[_0xfd65('0x1d')]=function(_0x59a93d,_0x36a6c4){var _0x41244d={},_0x195b73={},_0x41ca2f={'count':0x0,'rows':[]};var _0x2b2469=_[_0xfd65('0x1e')](db[_0xfd65('0x1f')]['rawAttributes'],function(_0x131e40){return{'name':_0x131e40[_0xfd65('0x20')],'type':_0x131e40[_0xfd65('0x21')][_0xfd65('0x22')]};});_0x195b73['model']=_[_0xfd65('0x1e')](_0x2b2469,'name');_0x195b73['query']=_[_0xfd65('0x23')](_0x59a93d[_0xfd65('0x24')]);_0x195b73[_0xfd65('0x25')]=_['intersection'](_0x195b73[_0xfd65('0x26')],_0x195b73['query']);_0x41244d[_0xfd65('0x27')]=_['intersection'](_0x195b73[_0xfd65('0x26')],qs[_0xfd65('0x28')](_0x59a93d['query'][_0xfd65('0x28')]));_0x41244d[_0xfd65('0x27')]=_0x41244d[_0xfd65('0x27')]['length']?_0x41244d[_0xfd65('0x27')]:_0x195b73['model'];if(!_0x59a93d['query'][_0xfd65('0x29')]('nolimit')){_0x41244d[_0xfd65('0xd')]=qs[_0xfd65('0xd')](_0x59a93d[_0xfd65('0x24')][_0xfd65('0xd')]);_0x41244d[_0xfd65('0xb')]=qs[_0xfd65('0xb')](_0x59a93d[_0xfd65('0x24')][_0xfd65('0xb')]);}_0x41244d['order']=qs['sort'](_0x59a93d['query'][_0xfd65('0x2a')]);_0x41244d[_0xfd65('0x2b')]=qs['filters'](_['pick'](_0x59a93d[_0xfd65('0x24')],_0x195b73['filters']),_0x2b2469);if(_0x59a93d[_0xfd65('0x24')][_0xfd65('0x2c')]){_0x41244d[_0xfd65('0x2b')]=_[_0xfd65('0x2d')](_0x41244d[_0xfd65('0x2b')],{'$or':_[_0xfd65('0x1e')](_0x2b2469,function(_0x325df1){if(_0x325df1[_0xfd65('0x21')]!==_0xfd65('0x2e')){var _0x1219a4={};_0x1219a4[_0x325df1['name']]={'$like':'%'+_0x59a93d[_0xfd65('0x24')][_0xfd65('0x2c')]+'%'};return _0x1219a4;}})});}_0x41244d=_[_0xfd65('0x2d')]({},_0x41244d,_0x59a93d[_0xfd65('0x2f')]);var _0x55244e={'where':_0x41244d['where']};return db[_0xfd65('0x1f')]['count'](_0x55244e)[_0xfd65('0x12')](function(_0x5982d6){_0x41ca2f[_0xfd65('0xe')]=_0x5982d6;if(_0x59a93d[_0xfd65('0x24')][_0xfd65('0x30')]){_0x41244d['include']=[{'all':!![]}];}return db[_0xfd65('0x1f')][_0xfd65('0x31')](_0x41244d);})['then'](function(_0xe944f9){_0x41ca2f[_0xfd65('0x32')]=_0xe944f9;return _0x41ca2f;})[_0xfd65('0x12')](respondWithFilteredResult(_0x36a6c4,_0x41244d))[_0xfd65('0x33')](handleError(_0x36a6c4,null));};exports[_0xfd65('0x34')]=function(_0x89ceb2,_0x515011){var _0x45645b={'raw':![],'where':{'id':_0x89ceb2['params']['id']}},_0x31c474={};_0x31c474[_0xfd65('0x26')]=_[_0xfd65('0x23')](db['SquareProject'][_0xfd65('0x35')]);_0x31c474[_0xfd65('0x24')]=_[_0xfd65('0x23')](_0x89ceb2[_0xfd65('0x24')]);_0x31c474['filters']=_[_0xfd65('0x36')](_0x31c474['model'],_0x31c474[_0xfd65('0x24')]);_0x45645b[_0xfd65('0x27')]=_[_0xfd65('0x36')](_0x31c474['model'],qs[_0xfd65('0x28')](_0x89ceb2[_0xfd65('0x24')][_0xfd65('0x28')]));_0x45645b[_0xfd65('0x27')]=_0x45645b[_0xfd65('0x27')]['length']?_0x45645b[_0xfd65('0x27')]:_0x31c474[_0xfd65('0x26')];if(_0x89ceb2[_0xfd65('0x24')][_0xfd65('0x30')]){_0x45645b[_0xfd65('0x37')]=[{'all':!![]}];}_0x45645b=_['merge']({},_0x45645b,_0x89ceb2[_0xfd65('0x2f')]);return db[_0xfd65('0x1f')][_0xfd65('0x38')](_0x45645b)[_0xfd65('0x12')](handleEntityNotFound(_0x515011,null))[_0xfd65('0x12')](respondWithResult(_0x515011,null))[_0xfd65('0x33')](handleError(_0x515011,null));};exports[_0xfd65('0x39')]=function(_0x2cb58d,_0x4150e0){return db[_0xfd65('0x1f')][_0xfd65('0x39')](_0x2cb58d[_0xfd65('0x3a')],{})['then'](function(_0x41c6bd){var _0x2fbaf8=_0x2cb58d['user'][_0xfd65('0x3b')]({'plain':!![]});if(!_0x2fbaf8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fbaf8[_0xfd65('0x3c')]==='user'){var _0x2c3bc0=_0x41c6bd['get']({'plain':!![]});var _0x486289='SquareProjects';return db[_0xfd65('0x3d')]['find']({'where':{'name':_0x486289,'userProfileId':_0x2fbaf8[_0xfd65('0x3e')]},'raw':!![]})[_0xfd65('0x12')](function(_0x2dc450){if(_0x2dc450&&_0x2dc450[_0xfd65('0x3f')]===0x0){return db[_0xfd65('0x14')][_0xfd65('0x39')]({'name':_0x2c3bc0[_0xfd65('0x1c')],'resourceId':_0x2c3bc0['id'],'type':_0x2dc450[_0xfd65('0x1c')],'sectionId':_0x2dc450['id']},{})[_0xfd65('0x12')](function(){return _0x41c6bd;});}else{return _0x41c6bd;}})[_0xfd65('0x33')](function(_0x383656){logger[_0xfd65('0x1a')](_0xfd65('0x40'),_0x383656);throw _0x383656;});}return _0x41c6bd;})[_0xfd65('0x12')](respondWithResult(_0x4150e0,0xc9))[_0xfd65('0x33')](handleError(_0x4150e0,null));};exports[_0xfd65('0x11')]=function(_0x16d620,_0x506d8e){if(_0x16d620[_0xfd65('0x3a')]['id']){delete _0x16d620[_0xfd65('0x3a')]['id'];}return db['SquareProject'][_0xfd65('0x38')]({'where':{'id':_0x16d620[_0xfd65('0x41')]['id']}})[_0xfd65('0x12')](handleEntityNotFound(_0x506d8e,null))[_0xfd65('0x12')](saveUpdates(_0x16d620[_0xfd65('0x3a')],null))[_0xfd65('0x12')](function(_0x394235){if(!_0x394235)return;var _0x2ad6d0=_0x394235[_0xfd65('0x3b')]({'plain':!![]});return _0x2ad6d0;})[_0xfd65('0x12')](function(_0x22f847){var _0x13b993=new Redis(config[_0xfd65('0x5')]);_0x13b993[_0xfd65('0x15')](_0xfd65('0x16'),JSON[_0xfd65('0x17')](_[_0xfd65('0x42')](_0x22f847,['id',_0xfd65('0x1c'),_0xfd65('0x43')])));return _0x22f847;})[_0xfd65('0x12')](respondWithResult(_0x506d8e,null))[_0xfd65('0x33')](handleError(_0x506d8e,null));};exports[_0xfd65('0x44')]=function(_0x3b40f9,_0x2320a5){return db['SquareProject']['find']({'where':{'id':_0x3b40f9[_0xfd65('0x41')]['id']}})['then'](handleEntityNotFound(_0x2320a5,null))[_0xfd65('0x12')](removeEntity(_0x2320a5,null))[_0xfd65('0x33')](handleError(_0x2320a5,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index a94dec3..8de999d 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 _0x1f3a=['../../mysqldb','setMaxListeners','save','update','hasOwnProperty','exports'];(function(_0x330868,_0x3b213d){var _0x42edc6=function(_0x3751b3){while(--_0x3751b3){_0x330868['push'](_0x330868['shift']());}};_0x42edc6(++_0x3b213d);}(_0x1f3a,0x1b6));var _0xa1f3=function(_0x3c56ca,_0x4751cd){_0x3c56ca=_0x3c56ca-0x0;var _0x52ab7a=_0x1f3a[_0x3c56ca];return _0x52ab7a;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xa1f3('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xa1f3('0x1')](0x0);var events={'afterCreate':_0xa1f3('0x2'),'afterUpdate':_0xa1f3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x522e71){return function(_0x19791e,_0x5b438f,_0x52897d){SquareProjectEvents['emit'](_0x522e71+':'+_0x19791e['id'],_0x19791e);SquareProjectEvents['emit'](_0x522e71,_0x19791e);_0x52897d(null);};}for(var e in events){if(events[_0xa1f3('0x4')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xa1f3('0x5')]=SquareProjectEvents; \ No newline at end of file +var _0x6fbc=['remove','emit','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0x16929c,_0x24dbff){var _0x5d93f4=function(_0x38b4be){while(--_0x38b4be){_0x16929c['push'](_0x16929c['shift']());}};_0x5d93f4(++_0x24dbff);}(_0x6fbc,0x11c));var _0xc6fb=function(_0x52a917,_0x15d07d){_0x52a917=_0x52a917-0x0;var _0x27158b=_0x6fbc[_0x52a917];return _0x27158b;};'use strict';var EventEmitter=require(_0xc6fb('0x0'));var SquareProject=require(_0xc6fb('0x1'))['db'][_0xc6fb('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xc6fb('0x3')](0x0);var events={'afterCreate':_0xc6fb('0x4'),'afterUpdate':_0xc6fb('0x5'),'afterDestroy':_0xc6fb('0x6')};function emitEvent(_0x4e4b98){return function(_0x50aae2,_0x2e38b3,_0x2a6aef){SquareProjectEvents[_0xc6fb('0x7')](_0x4e4b98+':'+_0x50aae2['id'],_0x50aae2);SquareProjectEvents['emit'](_0x4e4b98,_0x50aae2);_0x2a6aef(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xc6fb('0x8')](e,emitEvent(event));}}module[_0xc6fb('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index b75651e..8a55f50 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 _0x7d5a=['api','moment','request-promise','rimraf','../../config/environment','exports','define','SquareProject','square_projects','changed','savedAt','format','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x55bc6c,_0x1f7ab1){var _0x5300ec=function(_0x486f49){while(--_0x486f49){_0x55bc6c['push'](_0x55bc6c['shift']());}};_0x5300ec(++_0x1f7ab1);}(_0x7d5a,0xb8));var _0xa7d5=function(_0x2cffd7,_0x3562f4){_0x2cffd7=_0x2cffd7-0x0;var _0x137fd7=_0x7d5a[_0x2cffd7];return _0x137fd7;};'use strict';var _=require(_0xa7d5('0x0'));var util=require(_0xa7d5('0x1'));var logger=require(_0xa7d5('0x2'))(_0xa7d5('0x3'));var moment=require(_0xa7d5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa7d5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa7d5('0x6'));var config=require(_0xa7d5('0x7'));var attributes=require('./squareProject.attributes');module[_0xa7d5('0x8')]=function(_0x341a42,_0x1a003e){return _0x341a42[_0xa7d5('0x9')](_0xa7d5('0xa'),attributes,{'tableName':_0xa7d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2ca993,_0x97c1a9,_0x5162f6){if(_0x2ca993[_0xa7d5('0xc')]('preproduction')){_0x2ca993[_0xa7d5('0xd')]=moment()[_0xa7d5('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2ca993[_0xa7d5('0xc')]('production')){_0x2ca993[_0xa7d5('0xf')]=moment()[_0xa7d5('0xe')](_0xa7d5('0x10'));}_0x5162f6(null,_0x2ca993);}}});}; \ No newline at end of file +var _0x3504=['./squareProject.attributes','exports','define','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x31c376,_0x45287a){var _0x2f9f42=function(_0x2d8838){while(--_0x2d8838){_0x31c376['push'](_0x31c376['shift']());}};_0x2f9f42(++_0x45287a);}(_0x3504,0x70));var _0x4350=function(_0x9be062,_0x44ad9a){_0x9be062=_0x9be062-0x0;var _0x48b8e5=_0x3504[_0x9be062];return _0x48b8e5;};'use strict';var _=require(_0x4350('0x0'));var util=require(_0x4350('0x1'));var logger=require(_0x4350('0x2'))(_0x4350('0x3'));var moment=require('moment');var BPromise=require(_0x4350('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4350('0x5'));var rimraf=require('rimraf');var config=require(_0x4350('0x6'));var attributes=require(_0x4350('0x7'));module[_0x4350('0x8')]=function(_0x3e4f2a,_0x397512){return _0x3e4f2a[_0x4350('0x9')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f147c,_0x190e78,_0x9d072){if(_0x2f147c[_0x4350('0xa')](_0x4350('0xb'))){_0x2f147c[_0x4350('0xc')]=moment()[_0x4350('0xd')](_0x4350('0xe'));}if(_0x2f147c[_0x4350('0xa')](_0x4350('0xf'))){_0x2f147c[_0x4350('0x10')]=moment()[_0x4350('0xd')](_0x4350('0xe'));}_0x9d072(null,_0x2f147c);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 6a34b42..bd942b2 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 _0x7c43=['limit','map','include','model','then','debug','stringify','catch','error','message','SquareProject','find','ShowSquareProject','lodash','ioredis','../../config/logger','rpc','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','options','raw','where','attributes'];(function(_0x1551b6,_0x278954){var _0x1c0b77=function(_0x252ba8){while(--_0x252ba8){_0x1551b6['push'](_0x1551b6['shift']());}};_0x1c0b77(++_0x278954);}(_0x7c43,0xb5));var _0x37c4=function(_0xa4793e,_0x54dea4){_0xa4793e=_0xa4793e-0x0;var _0x4e03bf=_0x7c43[_0xa4793e];return _0x4e03bf;};'use strict';var _=require(_0x37c4('0x0'));var Redis=require(_0x37c4('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x37c4('0x2'))(_0x37c4('0x3'));var config=require('../../config/environment');config['redis']=_[_0x37c4('0x4')](config[_0x37c4('0x5')],{'host':_0x37c4('0x6'),'port':0x18eb});var socket=require(_0x37c4('0x7'))(new Redis(config[_0x37c4('0x5')]));require(_0x37c4('0x8'))[_0x37c4('0x9')](socket);exports[_0x37c4('0xa')]=function(_0x44d461){var _0x472b4d=this;return new Promise(function(_0xa66881,_0x49583e){return db['SquareProject']['findAll']({'raw':_0x44d461[_0x37c4('0xb')]?_0x44d461[_0x37c4('0xb')][_0x37c4('0xc')]===undefined?!![]:![]:!![],'where':_0x44d461['options']?_0x44d461[_0x37c4('0xb')][_0x37c4('0xd')]||null:null,'attributes':_0x44d461[_0x37c4('0xb')]?_0x44d461[_0x37c4('0xb')][_0x37c4('0xe')]||null:null,'limit':_0x44d461[_0x37c4('0xb')]?_0x44d461[_0x37c4('0xb')][_0x37c4('0xf')]||null:null,'include':_0x44d461[_0x37c4('0xb')]?_0x44d461['options']['include']?_[_0x37c4('0x10')](_0x44d461[_0x37c4('0xb')][_0x37c4('0x11')],function(_0x3ecfa1){return{'model':db[_0x3ecfa1[_0x37c4('0x12')]],'as':_0x3ecfa1['as'],'attributes':_0x3ecfa1[_0x37c4('0xe')],'include':_0x3ecfa1['include']?_[_0x37c4('0x10')](_0x3ecfa1['include'],function(_0x5a21ac){return{'model':db[_0x5a21ac[_0x37c4('0x12')]],'as':_0x5a21ac['as'],'attributes':_0x5a21ac[_0x37c4('0xe')],'include':_0x5a21ac[_0x37c4('0x11')]?_[_0x37c4('0x10')](_0x5a21ac[_0x37c4('0x11')],function(_0x51572f){return{'model':db[_0x51572f['model']],'as':_0x51572f['as'],'attributes':_0x51572f[_0x37c4('0xe')]};}):[]};}):[]};}):[]:[]})[_0x37c4('0x13')](function(_0x496338){logger['info'](_0x37c4('0xa'),_0x44d461);logger[_0x37c4('0x14')](_0x37c4('0xa'),_0x44d461,JSON[_0x37c4('0x15')](_0x496338));_0xa66881(_0x496338);})[_0x37c4('0x16')](function(_0x271b7e){logger[_0x37c4('0x17')](_0x37c4('0xa'),_0x271b7e[_0x37c4('0x18')],_0x44d461);_0x49583e(_0x472b4d[_0x37c4('0x17')](0x1f4,_0x271b7e[_0x37c4('0x18')]));});});};exports['ShowSquareProject']=function(_0x4b8d90){var _0x57e44f=this;return new Promise(function(_0x3fba18,_0x53268b){return db[_0x37c4('0x19')][_0x37c4('0x1a')]({'raw':_0x4b8d90[_0x37c4('0xb')]?_0x4b8d90[_0x37c4('0xb')][_0x37c4('0xc')]===undefined?!![]:![]:!![],'where':_0x4b8d90[_0x37c4('0xb')]?_0x4b8d90[_0x37c4('0xb')]['where']||null:null,'attributes':_0x4b8d90[_0x37c4('0xb')]?_0x4b8d90[_0x37c4('0xb')][_0x37c4('0xe')]||null:null,'include':_0x4b8d90[_0x37c4('0xb')]?_0x4b8d90[_0x37c4('0xb')][_0x37c4('0x11')]?_[_0x37c4('0x10')](_0x4b8d90[_0x37c4('0xb')][_0x37c4('0x11')],function(_0x8a9ad5){return{'model':db[_0x8a9ad5[_0x37c4('0x12')]],'as':_0x8a9ad5['as'],'attributes':_0x8a9ad5[_0x37c4('0xe')],'include':_0x8a9ad5['include']?_[_0x37c4('0x10')](_0x8a9ad5[_0x37c4('0x11')],function(_0xf5453d){return{'model':db[_0xf5453d[_0x37c4('0x12')]],'as':_0xf5453d['as'],'attributes':_0xf5453d[_0x37c4('0xe')],'include':_0xf5453d['include']?_[_0x37c4('0x10')](_0xf5453d[_0x37c4('0x11')],function(_0x4e496c){return{'model':db[_0x4e496c['model']],'as':_0x4e496c['as'],'attributes':_0x4e496c[_0x37c4('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53c05e){logger['info'](_0x37c4('0x1b'),_0x4b8d90);logger[_0x37c4('0x14')]('ShowSquareProject',_0x4b8d90,JSON[_0x37c4('0x15')](_0x53c05e));_0x3fba18(_0x53c05e);})['catch'](function(_0x2e4a40){logger['error'](_0x37c4('0x1b'),_0x2e4a40[_0x37c4('0x18')],_0x4b8d90);_0x53268b(_0x57e44f[_0x37c4('0x17')](0x1f4,_0x2e4a40[_0x37c4('0x18')]));});});}; \ No newline at end of file +var _0xfcbe=['attributes','include','model','map','then','info','debug','stringify','catch','error','message','ShowSquareProject','lodash','ioredis','../../mysqldb','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where'];(function(_0x5d641e,_0x239fac){var _0x12fd4e=function(_0x51e0ee){while(--_0x51e0ee){_0x5d641e['push'](_0x5d641e['shift']());}};_0x12fd4e(++_0x239fac);}(_0xfcbe,0x1bf));var _0xefcb=function(_0x35523f,_0x464772){_0x35523f=_0x35523f-0x0;var _0x381dea=_0xfcbe[_0x35523f];return _0x381dea;};'use strict';var _=require(_0xefcb('0x0'));var Redis=require(_0xefcb('0x1'));var db=require(_0xefcb('0x2'))['db'];var logger=require('../../config/logger')(_0xefcb('0x3'));var config=require(_0xefcb('0x4'));config['redis']=_[_0xefcb('0x5')](config[_0xefcb('0x6')],{'host':_0xefcb('0x7'),'port':0x18eb});var socket=require(_0xefcb('0x8'))(new Redis(config[_0xefcb('0x6')]));require(_0xefcb('0x9'))[_0xefcb('0xa')](socket);exports[_0xefcb('0xb')]=function(_0x48b864){var _0x1be56b=this;return new Promise(function(_0x12c8bb,_0x1f35b1){return db[_0xefcb('0xc')][_0xefcb('0xd')]({'raw':_0x48b864['options']?_0x48b864[_0xefcb('0xe')][_0xefcb('0xf')]===undefined?!![]:![]:!![],'where':_0x48b864[_0xefcb('0xe')]?_0x48b864[_0xefcb('0xe')][_0xefcb('0x10')]||null:null,'attributes':_0x48b864[_0xefcb('0xe')]?_0x48b864[_0xefcb('0xe')][_0xefcb('0x11')]||null:null,'limit':_0x48b864['options']?_0x48b864[_0xefcb('0xe')]['limit']||null:null,'include':_0x48b864[_0xefcb('0xe')]?_0x48b864[_0xefcb('0xe')][_0xefcb('0x12')]?_['map'](_0x48b864[_0xefcb('0xe')][_0xefcb('0x12')],function(_0xc71ba7){return{'model':db[_0xc71ba7[_0xefcb('0x13')]],'as':_0xc71ba7['as'],'attributes':_0xc71ba7[_0xefcb('0x11')],'include':_0xc71ba7[_0xefcb('0x12')]?_[_0xefcb('0x14')](_0xc71ba7['include'],function(_0x30d524){return{'model':db[_0x30d524[_0xefcb('0x13')]],'as':_0x30d524['as'],'attributes':_0x30d524['attributes'],'include':_0x30d524[_0xefcb('0x12')]?_['map'](_0x30d524[_0xefcb('0x12')],function(_0x1b907c){return{'model':db[_0x1b907c[_0xefcb('0x13')]],'as':_0x1b907c['as'],'attributes':_0x1b907c[_0xefcb('0x11')]};}):[]};}):[]};}):[]:[]})[_0xefcb('0x15')](function(_0x43b037){logger[_0xefcb('0x16')](_0xefcb('0xb'),_0x48b864);logger[_0xefcb('0x17')](_0xefcb('0xb'),_0x48b864,JSON[_0xefcb('0x18')](_0x43b037));_0x12c8bb(_0x43b037);})[_0xefcb('0x19')](function(_0x3507c6){logger[_0xefcb('0x1a')](_0xefcb('0xb'),_0x3507c6[_0xefcb('0x1b')],_0x48b864);_0x1f35b1(_0x1be56b[_0xefcb('0x1a')](0x1f4,_0x3507c6[_0xefcb('0x1b')]));});});};exports[_0xefcb('0x1c')]=function(_0xdf2b71){var _0x178be3=this;return new Promise(function(_0x424697,_0x16deac){return db[_0xefcb('0xc')]['find']({'raw':_0xdf2b71[_0xefcb('0xe')]?_0xdf2b71[_0xefcb('0xe')][_0xefcb('0xf')]===undefined?!![]:![]:!![],'where':_0xdf2b71['options']?_0xdf2b71['options'][_0xefcb('0x10')]||null:null,'attributes':_0xdf2b71[_0xefcb('0xe')]?_0xdf2b71[_0xefcb('0xe')][_0xefcb('0x11')]||null:null,'include':_0xdf2b71[_0xefcb('0xe')]?_0xdf2b71['options'][_0xefcb('0x12')]?_[_0xefcb('0x14')](_0xdf2b71[_0xefcb('0xe')][_0xefcb('0x12')],function(_0x4ba1f3){return{'model':db[_0x4ba1f3[_0xefcb('0x13')]],'as':_0x4ba1f3['as'],'attributes':_0x4ba1f3[_0xefcb('0x11')],'include':_0x4ba1f3[_0xefcb('0x12')]?_[_0xefcb('0x14')](_0x4ba1f3[_0xefcb('0x12')],function(_0x2a8851){return{'model':db[_0x2a8851[_0xefcb('0x13')]],'as':_0x2a8851['as'],'attributes':_0x2a8851['attributes'],'include':_0x2a8851[_0xefcb('0x12')]?_[_0xefcb('0x14')](_0x2a8851[_0xefcb('0x12')],function(_0x4d6aed){return{'model':db[_0x4d6aed[_0xefcb('0x13')]],'as':_0x4d6aed['as'],'attributes':_0x4d6aed['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x32e6a4){logger['info'](_0xefcb('0x1c'),_0xdf2b71);logger[_0xefcb('0x17')](_0xefcb('0x1c'),_0xdf2b71,JSON['stringify'](_0x32e6a4));_0x424697(_0x32e6a4);})[_0xefcb('0x19')](function(_0x4ee578){logger[_0xefcb('0x1a')]('ShowSquareProject',_0x4ee578[_0xefcb('0x1b')],_0xdf2b71);_0x16deac(_0x178be3['error'](0x1f4,_0x4ee578[_0xefcb('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index ad35244..72ee6f0 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 _0xe5fc=['emit','removeListener','squareProject:','save','remove'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0xe5fc,0x125));var _0xce5f=function(_0x2cf579,_0x410fac){_0x2cf579=_0x2cf579-0x0;var _0x5195cf=_0xe5fc[_0x2cf579];return _0x5195cf;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xce5f('0x0'),_0xce5f('0x1'),'update'];function createListener(_0xdc1488,_0x5463c8){return function(_0x30e528){_0x5463c8[_0xce5f('0x2')](_0xdc1488,_0x30e528);};}function removeListener(_0x57a310,_0x53f3c0){return function(){SquareProjectEvents[_0xce5f('0x3')](_0x57a310,_0x53f3c0);};}exports['register']=function(_0x26a384){for(var _0x3b504b=0x0,_0x25c0dd=events['length'];_0x3b504b<_0x25c0dd;_0x3b504b++){var _0x15a50c=events[_0x3b504b];var _0x1df871=createListener(_0xce5f('0x4')+_0x15a50c,_0x26a384);SquareProjectEvents['on'](_0x15a50c,_0x1df871);}}; \ No newline at end of file +var _0xa76e=['./squareProject.events','remove','update','removeListener','register','length','squareProject:'];(function(_0x1fd73f,_0x5ea13c){var _0xc562b4=function(_0x232b0d){while(--_0x232b0d){_0x1fd73f['push'](_0x1fd73f['shift']());}};_0xc562b4(++_0x5ea13c);}(_0xa76e,0x70));var _0xea76=function(_0x3ccdf8,_0x584ceb){_0x3ccdf8=_0x3ccdf8-0x0;var _0x243dab=_0xa76e[_0x3ccdf8];return _0x243dab;};'use strict';var SquareProjectEvents=require(_0xea76('0x0'));var events=['save',_0xea76('0x1'),_0xea76('0x2')];function createListener(_0x3aaa6a,_0x28d17c){return function(_0x4735b1){_0x28d17c['emit'](_0x3aaa6a,_0x4735b1);};}function removeListener(_0x27b1aa,_0x1b2325){return function(){SquareProjectEvents[_0xea76('0x3')](_0x27b1aa,_0x1b2325);};}exports[_0xea76('0x4')]=function(_0x5075b4){for(var _0x1c1e15=0x0,_0x35682d=events[_0xea76('0x5')];_0x1c1e15<_0x35682d;_0x1c1e15++){var _0x207986=events[_0x1c1e15];var _0x104959=createListener(_0xea76('0x6')+_0x207986,_0x5075b4);SquareProjectEvents['on'](_0x207986,_0x104959);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 97fd49c..ea4967d 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x52f57a,_0x4b5ed4){var _0x37d2cf=function(_0xf65ea5){while(--_0xf65ea5){_0x52f57a['push'](_0x52f57a['shift']());}};_0x37d2cf(++_0x4b5ed4);}(_0x7a54,0x106));var _0x47a5=function(_0x476e17,_0x32aa05){_0x476e17=_0x476e17-0x0;var _0x595d2f=_0x7a54[_0x476e17];return _0x595d2f;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file +var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x4e7fc1,_0x100df3){var _0x5db4a4=function(_0x229dde){while(--_0x229dde){_0x4e7fc1['push'](_0x4e7fc1['shift']());}};_0x5db4a4(++_0x100df3);}(_0x326f,0xd1));var _0xf326=function(_0x41e048,_0x33c31c){_0x41e048=_0x41e048-0x0;var _0x163beb=_0x326f[_0x41e048];return _0x163beb;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 9aaa80f..2e1a476 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 _0x55ca=['sequelize','exports','STRING','VIRTUAL','getDataValue','substring','lastIndexOf'];(function(_0xb61065,_0x159992){var _0x3f3fcb=function(_0x3aa3f4){while(--_0x3aa3f4){_0xb61065['push'](_0xb61065['shift']());}};_0x3f3fcb(++_0x159992);}(_0x55ca,0x126));var _0xa55c=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0x55ca[_0x4cc492];return _0x1f36b9;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa55c('0x2')]},'extension':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'dnid':{'type':Sequelize[_0xa55c('0x2')]},'projectName':{'type':Sequelize[_0xa55c('0x2')]},'saveName':{'type':Sequelize[_0xa55c('0x2')]},'filename':{'type':Sequelize[_0xa55c('0x2')]},'savePath':{'type':Sequelize[_0xa55c('0x2')]},'format':{'type':Sequelize[_0xa55c('0x3')],'get':function(){var _0x4d0624='';var _0x2121fd=this[_0xa55c('0x4')]('savePath');if(_0x2121fd){_0x4d0624=_0x2121fd[_0xa55c('0x5')](_0x2121fd[_0xa55c('0x6')]('.'));}return _0x4d0624;}}}; \ No newline at end of file +var _0xf2ca=['getDataValue','substring','sequelize','exports','STRING','VIRTUAL'];(function(_0xbcb0ed,_0x21bfec){var _0x58c8cc=function(_0x4027f4){while(--_0x4027f4){_0xbcb0ed['push'](_0xbcb0ed['shift']());}};_0x58c8cc(++_0x21bfec);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x2ab365,_0xa3812e){_0x2ab365=_0x2ab365-0x0;var _0x49fef3=_0xf2ca[_0x2ab365];return _0x49fef3;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'uniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xaf2c('0x2')]},'context':{'type':Sequelize[_0xaf2c('0x2')]},'extension':{'type':Sequelize[_0xaf2c('0x2')]},'priority':{'type':Sequelize[_0xaf2c('0x2')]},'accountcode':{'type':Sequelize[_0xaf2c('0x2')]},'dnid':{'type':Sequelize[_0xaf2c('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xaf2c('0x2')]},'filename':{'type':Sequelize[_0xaf2c('0x2')]},'savePath':{'type':Sequelize[_0xaf2c('0x2')]},'format':{'type':Sequelize[_0xaf2c('0x3')],'get':function(){var _0x58351f='';var _0x37fedd=this[_0xaf2c('0x4')]('savePath');if(_0x37fedd){_0x58351f=_0x37fedd[_0xaf2c('0x5')](_0x37fedd['lastIndexOf']('.'));}return _0x58351f;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 3faaf70..2495a6f 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 _0x07cf=['../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','then','includeAll','include','findAll','rows','catch','show','merge','options','find','create','body','update','uniqueid','params','savePath','filename','format','existsSync','decryptFile','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','message','Not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0x07cf,0x1c9));var _0xf07c=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0x07cf[_0x51e79c];return _0x2467be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf07c('0x0'));var zipdir=require(_0xf07c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf07c('0x2'));var moment=require('moment');var BPromise=require(_0xf07c('0x3'));var Mustache=require(_0xf07c('0x4'));var util=require(_0xf07c('0x5'));var path=require(_0xf07c('0x6'));var sox=require(_0xf07c('0x7'));var csv=require('to-csv');var ejs=require(_0xf07c('0x8'));var fs=require('fs');var fs_extra=require(_0xf07c('0x9'));var _=require('lodash');var squel=require(_0xf07c('0xa'));var crypto=require('crypto');var jsforce=require(_0xf07c('0xb'));var deskjs=require(_0xf07c('0xc'));var toCsv=require(_0xf07c('0xd'));var querystring=require('querystring');var Papa=require(_0xf07c('0xe'));var Redis=require(_0xf07c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf07c('0x10'));var hardwareService=require(_0xf07c('0x11'));var logger=require(_0xf07c('0x12'))(_0xf07c('0x13'));var utils=require(_0xf07c('0x14'));var config=require(_0xf07c('0x15'));var licenseUtil=require(_0xf07c('0x16'));var db=require(_0xf07c('0x17'))['db'];function respondWithStatusCode(_0x3d715c,_0x2cf85f){_0x2cf85f=_0x2cf85f||0xcc;return function(_0x5e6b99){if(_0x5e6b99){return _0x3d715c['sendStatus'](_0x2cf85f);}return _0x3d715c[_0xf07c('0x18')](_0x2cf85f)[_0xf07c('0x19')]();};}function respondWithResult(_0x4d7bb4,_0x3ca16a){_0x3ca16a=_0x3ca16a||0xc8;return function(_0x4761fd){if(_0x4761fd){return _0x4d7bb4['status'](_0x3ca16a)['json'](_0x4761fd);}};}function respondWithFilteredResult(_0x595a0e,_0x27d80f){return function(_0x445cc9){if(_0x445cc9){var _0x1ce664=typeof _0x27d80f[_0xf07c('0x1a')]===_0xf07c('0x1b')&&typeof _0x27d80f[_0xf07c('0x1c')]==='undefined';var _0x42358c=_0x445cc9[_0xf07c('0x1d')];var _0x2e2b4b=_0x1ce664?0x0:_0x27d80f['offset'];var _0x3190ad=_0x1ce664?_0x445cc9['count']:_0x27d80f[_0xf07c('0x1a')]+_0x27d80f[_0xf07c('0x1c')];var _0x41463c;if(_0x3190ad>=_0x42358c){_0x3190ad=_0x42358c;_0x41463c=0xc8;}else{_0x41463c=0xce;}_0x595a0e[_0xf07c('0x18')](_0x41463c);return _0x595a0e['set'](_0xf07c('0x1e'),_0x2e2b4b+'-'+_0x3190ad+'/'+_0x42358c)[_0xf07c('0x1f')](_0x445cc9);}return null;};}function patchUpdates(_0x142443){return function(_0x352653){try{jsonpatch[_0xf07c('0x20')](_0x352653,_0x142443,!![]);}catch(_0xd154e5){return BPromise[_0xf07c('0x21')](_0xd154e5);}return _0x352653[_0xf07c('0x22')]();};}function saveUpdates(_0x50df70,_0x5a4cdd){return function(_0x45e7dd){if(_0x45e7dd){return _0x45e7dd['update'](_0x50df70)['then'](function(_0x2fff89){return _0x2fff89;});}return null;};}function removeEntity(_0xf95865,_0x22d43e){return function(_0x262c3e){if(_0x262c3e){return _0x262c3e['destroy']()['then'](function(){_0xf95865[_0xf07c('0x18')](0xcc)[_0xf07c('0x19')]();});}};}function handleEntityNotFound(_0x3a2ad3,_0x54bf07){return function(_0x5b6404){if(!_0x5b6404){_0x3a2ad3['sendStatus'](0x194);}return _0x5b6404;};}function handleError(_0x29da46,_0x122f7c){_0x122f7c=_0x122f7c||0x1f4;return function(_0x22d70b){logger['error'](_0x22d70b[_0xf07c('0x23')]);if(_0x22d70b['name']){delete _0x22d70b[_0xf07c('0x24')];}_0x29da46['status'](_0x122f7c)[_0xf07c('0x25')](_0x22d70b);};}exports[_0xf07c('0x26')]=function(_0x576c49,_0x328649){var _0x4e5dc9={},_0x3fb624={},_0x4cdacc={'count':0x0,'rows':[]};var _0x41fd7d=_[_0xf07c('0x27')](db[_0xf07c('0x28')][_0xf07c('0x29')],function(_0x498ad1){return{'name':_0x498ad1[_0xf07c('0x2a')],'type':_0x498ad1[_0xf07c('0x2b')]['key']};});_0x3fb624[_0xf07c('0x2c')]=_['map'](_0x41fd7d,_0xf07c('0x24'));_0x3fb624[_0xf07c('0x2d')]=_[_0xf07c('0x2e')](_0x576c49[_0xf07c('0x2d')]);_0x3fb624[_0xf07c('0x2f')]=_[_0xf07c('0x30')](_0x3fb624[_0xf07c('0x2c')],_0x3fb624[_0xf07c('0x2d')]);_0x4e5dc9[_0xf07c('0x31')]=_[_0xf07c('0x30')](_0x3fb624[_0xf07c('0x2c')],qs[_0xf07c('0x32')](_0x576c49[_0xf07c('0x2d')][_0xf07c('0x32')]));_0x4e5dc9['attributes']=_0x4e5dc9[_0xf07c('0x31')][_0xf07c('0x33')]?_0x4e5dc9[_0xf07c('0x31')]:_0x3fb624[_0xf07c('0x2c')];if(!_0x576c49[_0xf07c('0x2d')][_0xf07c('0x34')](_0xf07c('0x35'))){_0x4e5dc9['limit']=qs['limit'](_0x576c49[_0xf07c('0x2d')][_0xf07c('0x1c')]);_0x4e5dc9['offset']=qs['offset'](_0x576c49[_0xf07c('0x2d')][_0xf07c('0x1a')]);}_0x4e5dc9[_0xf07c('0x36')]=qs[_0xf07c('0x37')](_0x576c49[_0xf07c('0x2d')][_0xf07c('0x37')]);_0x4e5dc9['where']=qs[_0xf07c('0x2f')](_[_0xf07c('0x38')](_0x576c49[_0xf07c('0x2d')],_0x3fb624['filters']),_0x41fd7d);if(_0x576c49[_0xf07c('0x2d')]['filter']){_0x4e5dc9[_0xf07c('0x39')]=_['merge'](_0x4e5dc9[_0xf07c('0x39')],{'$or':_['map'](_0x41fd7d,function(_0x41dc69){if(_0x41dc69['type']!==_0xf07c('0x3a')){var _0x4768c2={};_0x4768c2[_0x41dc69[_0xf07c('0x24')]]={'$like':'%'+_0x576c49[_0xf07c('0x2d')][_0xf07c('0x3b')]+'%'};return _0x4768c2;}})});}_0x4e5dc9=_['merge']({},_0x4e5dc9,_0x576c49['options']);var _0x5a7cd1={'where':_0x4e5dc9['where']};return db[_0xf07c('0x28')][_0xf07c('0x1d')](_0x5a7cd1)[_0xf07c('0x3c')](function(_0x2add2e){_0x4cdacc['count']=_0x2add2e;if(_0x576c49[_0xf07c('0x2d')][_0xf07c('0x3d')]){_0x4e5dc9[_0xf07c('0x3e')]=[{'all':!![]}];}return db[_0xf07c('0x28')][_0xf07c('0x3f')](_0x4e5dc9);})[_0xf07c('0x3c')](function(_0x2cfbf1){_0x4cdacc[_0xf07c('0x40')]=_0x2cfbf1;return _0x4cdacc;})[_0xf07c('0x3c')](respondWithFilteredResult(_0x328649,_0x4e5dc9))[_0xf07c('0x41')](handleError(_0x328649,null));};exports[_0xf07c('0x42')]=function(_0x4d0e8d,_0x1ee76c){var _0x3a4930={'raw':!![],'where':{'id':_0x4d0e8d['params']['id']}},_0x46f832={};_0x46f832[_0xf07c('0x2c')]=_['keys'](db[_0xf07c('0x28')][_0xf07c('0x29')]);_0x46f832['query']=_[_0xf07c('0x2e')](_0x4d0e8d[_0xf07c('0x2d')]);_0x46f832[_0xf07c('0x2f')]=_[_0xf07c('0x30')](_0x46f832['model'],_0x46f832[_0xf07c('0x2d')]);_0x3a4930['attributes']=_[_0xf07c('0x30')](_0x46f832[_0xf07c('0x2c')],qs[_0xf07c('0x32')](_0x4d0e8d[_0xf07c('0x2d')]['fields']));_0x3a4930[_0xf07c('0x31')]=_0x3a4930['attributes']['length']?_0x3a4930[_0xf07c('0x31')]:_0x46f832[_0xf07c('0x2c')];if(_0x4d0e8d[_0xf07c('0x2d')][_0xf07c('0x3d')]){_0x3a4930[_0xf07c('0x3e')]=[{'all':!![]}];}_0x3a4930=_[_0xf07c('0x43')]({},_0x3a4930,_0x4d0e8d[_0xf07c('0x44')]);return db['SquareRecording'][_0xf07c('0x45')](_0x3a4930)[_0xf07c('0x3c')](handleEntityNotFound(_0x1ee76c,null))[_0xf07c('0x3c')](respondWithResult(_0x1ee76c,null))[_0xf07c('0x41')](handleError(_0x1ee76c,null));};exports[_0xf07c('0x46')]=function(_0x39f522,_0x553422){return db['SquareRecording']['create'](_0x39f522[_0xf07c('0x47')],{})['then'](respondWithResult(_0x553422,0xc9))[_0xf07c('0x41')](handleError(_0x553422,null));};exports[_0xf07c('0x48')]=function(_0x32074d,_0x24896c){if(_0x32074d[_0xf07c('0x47')]['id']){delete _0x32074d[_0xf07c('0x47')]['id'];}return db['SquareRecording'][_0xf07c('0x45')]({'where':{'id':_0x32074d['params']['id']}})['then'](handleEntityNotFound(_0x24896c,null))[_0xf07c('0x3c')](saveUpdates(_0x32074d[_0xf07c('0x47')],null))[_0xf07c('0x3c')](respondWithResult(_0x24896c,null))[_0xf07c('0x41')](handleError(_0x24896c,null));};exports['download']=function(_0x1dfbeb,_0x40430c,_0x4a99c7){var _0x361e94=require('../../components/encryptor');var _0x188ac6=![];var _0xb219d3={};if(_0x1dfbeb[_0xf07c('0x2d')][_0xf07c('0x2b')]&&_0x1dfbeb[_0xf07c('0x2d')][_0xf07c('0x2b')]===_0xf07c('0x49')){_0xb219d3[_0xf07c('0x49')]=_0x1dfbeb[_0xf07c('0x4a')]['id'];}else{_0xb219d3['id']=_0x1dfbeb['params']['id'];}return db[_0xf07c('0x28')][_0xf07c('0x45')]({'where':_0xb219d3,'attributes':['id',_0xf07c('0x4b'),_0xf07c('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x40430c,null))[_0xf07c('0x3c')](function(_0x521ecd){if(_0x521ecd){var _0x16a00d=_0x521ecd[_0xf07c('0x4b')];var _0x1e4ad2=util[_0xf07c('0x4d')]('%s.cypher',_0x16a00d);if(fs[_0xf07c('0x4e')](_0x1e4ad2)){_0x188ac6=!![];return _0x361e94[_0xf07c('0x4f')](_0x1e4ad2,_0x16a00d,config['secrets']['recording'])[_0xf07c('0x3c')](function(){return _0x521ecd;});}return _0x521ecd;}})[_0xf07c('0x3c')](function(_0x430aec){if(_0x430aec){var _0x3821d1=_0x430aec['savePath'];if(!fs[_0xf07c('0x4e')](_0x3821d1)){throw new db[(_0xf07c('0x50'))][(_0xf07c('0x51'))](_0xf07c('0x52'));}if(_0x430aec[_0xf07c('0x4c')]){return _0x40430c[_0xf07c('0x53')](_0x3821d1,_0x430aec[_0xf07c('0x4c')]+path[_0xf07c('0x54')](_0x3821d1),function(){if(_0x188ac6){fs['unlink'](_0x3821d1);}});}else{return _0x40430c['download'](_0x3821d1,function(_0x357929){if(_0x188ac6){fs['unlink'](_0x3821d1);}});}}})[_0xf07c('0x41')](function(_0x505552){if(_0x505552[_0xf07c('0x55')]===_0xf07c('0x52')){_0x40430c['status'](0x194)[_0xf07c('0x25')](_0xf07c('0x56'));}else{return handleError(_0x40430c,null);}});};exports[_0xf07c('0x57')]=function(_0x397ef2,_0x59539a){return db[_0xf07c('0x28')][_0xf07c('0x45')]({'where':{'id':_0x397ef2['params']['id']}})[_0xf07c('0x3c')](function(_0x25b454){if(_['isNil'](_0x25b454)){throw new ReferenceError(_0xf07c('0x58'));}return _0x25b454;})[_0xf07c('0x3c')](function(_0x9577e7){var _0x257e23=_0x9577e7[_0xf07c('0x4b')];logger[_0xf07c('0x59')](_0xf07c('0x5a'),_0x257e23);if(!_[_0xf07c('0x5b')](_0x9577e7[_0xf07c('0x4b')])&&fs[_0xf07c('0x4e')](_0x257e23)){logger['info'](_0xf07c('0x5c')+_0x257e23+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xf07c('0x5d')](_0x257e23);}_0x257e23=_0x257e23+_0xf07c('0x5e');if(!_[_0xf07c('0x5b')](_0x9577e7[_0xf07c('0x4b')])&&fs[_0xf07c('0x4e')](_0x257e23)){logger[_0xf07c('0x59')]('File:\x20\x22'+_0x257e23+_0xf07c('0x5f'));fs[_0xf07c('0x5d')](_0x257e23);}return _0x9577e7;})['then'](function(_0x42ee8d){if(!_0x42ee8d)throw new InternalError();return _0x42ee8d[_0xf07c('0x57')]();})[_0xf07c('0x3c')](function(){_0x59539a[_0xf07c('0x18')](0xcc)['end']();})['catch'](handleError(_0x59539a,null));}; \ No newline at end of file +var _0x8d26=['jsforce','desk.js','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','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','index','map','SquareRecording','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','catch','keys','include','options','create','body','find','params','download','../../components/encryptor','savePath','filename','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x8d26,0x174));var _0x68d2=function(_0x39cdb8,_0x15ee98){_0x39cdb8=_0x39cdb8-0x0;var _0x44bbc9=_0x8d26[_0x39cdb8];return _0x44bbc9;};'use strict';var emlformat=require(_0x68d2('0x0'));var rimraf=require(_0x68d2('0x1'));var zipdir=require(_0x68d2('0x2'));var jsonpatch=require(_0x68d2('0x3'));var rp=require(_0x68d2('0x4'));var moment=require(_0x68d2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x68d2('0x6'));var util=require('util');var path=require(_0x68d2('0x7'));var sox=require('sox');var csv=require(_0x68d2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68d2('0x9'));var _=require(_0x68d2('0xa'));var squel=require(_0x68d2('0xb'));var crypto=require('crypto');var jsforce=require(_0x68d2('0xc'));var deskjs=require(_0x68d2('0xd'));var toCsv=require(_0x68d2('0x8'));var querystring=require(_0x68d2('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x68d2('0xf'));var qs=require(_0x68d2('0x10'));var as=require(_0x68d2('0x11'));var hardwareService=require(_0x68d2('0x12'));var logger=require(_0x68d2('0x13'))(_0x68d2('0x14'));var utils=require(_0x68d2('0x15'));var config=require(_0x68d2('0x16'));var licenseUtil=require(_0x68d2('0x17'));var db=require(_0x68d2('0x18'))['db'];function respondWithStatusCode(_0x2aaa8c,_0x5f17fc){_0x5f17fc=_0x5f17fc||0xcc;return function(_0x1a4c2a){if(_0x1a4c2a){return _0x2aaa8c[_0x68d2('0x19')](_0x5f17fc);}return _0x2aaa8c[_0x68d2('0x1a')](_0x5f17fc)['end']();};}function respondWithResult(_0x5f0692,_0x43baa1){_0x43baa1=_0x43baa1||0xc8;return function(_0x480d73){if(_0x480d73){return _0x5f0692[_0x68d2('0x1a')](_0x43baa1)[_0x68d2('0x1b')](_0x480d73);}};}function respondWithFilteredResult(_0x586d8b,_0x27d79d){return function(_0x5bf5d9){if(_0x5bf5d9){var _0x1693ef=typeof _0x27d79d[_0x68d2('0x1c')]===_0x68d2('0x1d')&&typeof _0x27d79d['limit']==='undefined';var _0x113def=_0x5bf5d9[_0x68d2('0x1e')];var _0x4e0142=_0x1693ef?0x0:_0x27d79d[_0x68d2('0x1c')];var _0x8c65d5=_0x1693ef?_0x5bf5d9[_0x68d2('0x1e')]:_0x27d79d[_0x68d2('0x1c')]+_0x27d79d[_0x68d2('0x1f')];var _0x4e3eb4;if(_0x8c65d5>=_0x113def){_0x8c65d5=_0x113def;_0x4e3eb4=0xc8;}else{_0x4e3eb4=0xce;}_0x586d8b['status'](_0x4e3eb4);return _0x586d8b[_0x68d2('0x20')](_0x68d2('0x21'),_0x4e0142+'-'+_0x8c65d5+'/'+_0x113def)[_0x68d2('0x1b')](_0x5bf5d9);}return null;};}function patchUpdates(_0x224e5e){return function(_0x3594e3){try{jsonpatch[_0x68d2('0x22')](_0x3594e3,_0x224e5e,!![]);}catch(_0x4c40e9){return BPromise[_0x68d2('0x23')](_0x4c40e9);}return _0x3594e3[_0x68d2('0x24')]();};}function saveUpdates(_0x5ace2a,_0x59bd87){return function(_0x222438){if(_0x222438){return _0x222438['update'](_0x5ace2a)[_0x68d2('0x25')](function(_0x3086f0){return _0x3086f0;});}return null;};}function removeEntity(_0x5a7d0d,_0x1ed483){return function(_0x31e68a){if(_0x31e68a){return _0x31e68a[_0x68d2('0x26')]()[_0x68d2('0x25')](function(){_0x5a7d0d[_0x68d2('0x1a')](0xcc)[_0x68d2('0x27')]();});}};}function handleEntityNotFound(_0x5d6dfd,_0x20d170){return function(_0x1ca002){if(!_0x1ca002){_0x5d6dfd[_0x68d2('0x19')](0x194);}return _0x1ca002;};}function handleError(_0x5e35e9,_0x5a730f){_0x5a730f=_0x5a730f||0x1f4;return function(_0xac564d){logger['error'](_0xac564d[_0x68d2('0x28')]);if(_0xac564d[_0x68d2('0x29')]){delete _0xac564d[_0x68d2('0x29')];}_0x5e35e9[_0x68d2('0x1a')](_0x5a730f)[_0x68d2('0x2a')](_0xac564d);};}exports[_0x68d2('0x2b')]=function(_0x27ee7a,_0xc678a8){var _0x31a3e7={},_0x2d3507={},_0x548f6c={'count':0x0,'rows':[]};var _0x391d70=_[_0x68d2('0x2c')](db[_0x68d2('0x2d')][_0x68d2('0x2e')],function(_0x370562){return{'name':_0x370562['fieldName'],'type':_0x370562[_0x68d2('0x2f')]['key']};});_0x2d3507[_0x68d2('0x30')]=_['map'](_0x391d70,_0x68d2('0x29'));_0x2d3507[_0x68d2('0x31')]=_['keys'](_0x27ee7a[_0x68d2('0x31')]);_0x2d3507[_0x68d2('0x32')]=_[_0x68d2('0x33')](_0x2d3507[_0x68d2('0x30')],_0x2d3507[_0x68d2('0x31')]);_0x31a3e7[_0x68d2('0x34')]=_['intersection'](_0x2d3507[_0x68d2('0x30')],qs[_0x68d2('0x35')](_0x27ee7a[_0x68d2('0x31')][_0x68d2('0x35')]));_0x31a3e7[_0x68d2('0x34')]=_0x31a3e7['attributes'][_0x68d2('0x36')]?_0x31a3e7[_0x68d2('0x34')]:_0x2d3507[_0x68d2('0x30')];if(!_0x27ee7a['query'][_0x68d2('0x37')](_0x68d2('0x38'))){_0x31a3e7['limit']=qs[_0x68d2('0x1f')](_0x27ee7a['query'][_0x68d2('0x1f')]);_0x31a3e7['offset']=qs[_0x68d2('0x1c')](_0x27ee7a[_0x68d2('0x31')]['offset']);}_0x31a3e7[_0x68d2('0x39')]=qs['sort'](_0x27ee7a[_0x68d2('0x31')][_0x68d2('0x3a')]);_0x31a3e7[_0x68d2('0x3b')]=qs['filters'](_[_0x68d2('0x3c')](_0x27ee7a['query'],_0x2d3507[_0x68d2('0x32')]),_0x391d70);if(_0x27ee7a[_0x68d2('0x31')][_0x68d2('0x3d')]){_0x31a3e7[_0x68d2('0x3b')]=_['merge'](_0x31a3e7[_0x68d2('0x3b')],{'$or':_[_0x68d2('0x2c')](_0x391d70,function(_0x2dadcb){if(_0x2dadcb[_0x68d2('0x2f')]!==_0x68d2('0x3e')){var _0x4db809={};_0x4db809[_0x2dadcb[_0x68d2('0x29')]]={'$like':'%'+_0x27ee7a[_0x68d2('0x31')][_0x68d2('0x3d')]+'%'};return _0x4db809;}})});}_0x31a3e7=_[_0x68d2('0x3f')]({},_0x31a3e7,_0x27ee7a['options']);var _0x5c9146={'where':_0x31a3e7[_0x68d2('0x3b')]};return db[_0x68d2('0x2d')][_0x68d2('0x1e')](_0x5c9146)['then'](function(_0x499770){_0x548f6c[_0x68d2('0x1e')]=_0x499770;if(_0x27ee7a[_0x68d2('0x31')][_0x68d2('0x40')]){_0x31a3e7['include']=[{'all':!![]}];}return db[_0x68d2('0x2d')][_0x68d2('0x41')](_0x31a3e7);})[_0x68d2('0x25')](function(_0x3a4837){_0x548f6c['rows']=_0x3a4837;return _0x548f6c;})[_0x68d2('0x25')](respondWithFilteredResult(_0xc678a8,_0x31a3e7))[_0x68d2('0x42')](handleError(_0xc678a8,null));};exports['show']=function(_0x1eb53a,_0x595fd3){var _0x4c08bc={'raw':!![],'where':{'id':_0x1eb53a['params']['id']}},_0x28f186={};_0x28f186[_0x68d2('0x30')]=_[_0x68d2('0x43')](db[_0x68d2('0x2d')]['rawAttributes']);_0x28f186['query']=_['keys'](_0x1eb53a[_0x68d2('0x31')]);_0x28f186[_0x68d2('0x32')]=_[_0x68d2('0x33')](_0x28f186[_0x68d2('0x30')],_0x28f186[_0x68d2('0x31')]);_0x4c08bc[_0x68d2('0x34')]=_[_0x68d2('0x33')](_0x28f186[_0x68d2('0x30')],qs[_0x68d2('0x35')](_0x1eb53a['query'][_0x68d2('0x35')]));_0x4c08bc[_0x68d2('0x34')]=_0x4c08bc[_0x68d2('0x34')][_0x68d2('0x36')]?_0x4c08bc[_0x68d2('0x34')]:_0x28f186[_0x68d2('0x30')];if(_0x1eb53a[_0x68d2('0x31')][_0x68d2('0x40')]){_0x4c08bc[_0x68d2('0x44')]=[{'all':!![]}];}_0x4c08bc=_['merge']({},_0x4c08bc,_0x1eb53a[_0x68d2('0x45')]);return db['SquareRecording']['find'](_0x4c08bc)[_0x68d2('0x25')](handleEntityNotFound(_0x595fd3,null))[_0x68d2('0x25')](respondWithResult(_0x595fd3,null))[_0x68d2('0x42')](handleError(_0x595fd3,null));};exports[_0x68d2('0x46')]=function(_0xdb191,_0xce9273){return db['SquareRecording'][_0x68d2('0x46')](_0xdb191[_0x68d2('0x47')],{})[_0x68d2('0x25')](respondWithResult(_0xce9273,0xc9))[_0x68d2('0x42')](handleError(_0xce9273,null));};exports['update']=function(_0xa24f0,_0x5065bb){if(_0xa24f0['body']['id']){delete _0xa24f0[_0x68d2('0x47')]['id'];}return db[_0x68d2('0x2d')][_0x68d2('0x48')]({'where':{'id':_0xa24f0[_0x68d2('0x49')]['id']}})[_0x68d2('0x25')](handleEntityNotFound(_0x5065bb,null))[_0x68d2('0x25')](saveUpdates(_0xa24f0['body'],null))[_0x68d2('0x25')](respondWithResult(_0x5065bb,null))[_0x68d2('0x42')](handleError(_0x5065bb,null));};exports[_0x68d2('0x4a')]=function(_0x1f9456,_0x60bbc0,_0x444abd){var _0x59f421=require(_0x68d2('0x4b'));var _0x290c1c=![];var _0xb98387={};if(_0x1f9456[_0x68d2('0x31')][_0x68d2('0x2f')]&&_0x1f9456[_0x68d2('0x31')][_0x68d2('0x2f')]==='uniqueid'){_0xb98387['uniqueid']=_0x1f9456[_0x68d2('0x49')]['id'];}else{_0xb98387['id']=_0x1f9456[_0x68d2('0x49')]['id'];}return db[_0x68d2('0x2d')][_0x68d2('0x48')]({'where':_0xb98387,'attributes':['id',_0x68d2('0x4c'),_0x68d2('0x4d')],'raw':!![]})[_0x68d2('0x25')](handleEntityNotFound(_0x60bbc0,null))[_0x68d2('0x25')](function(_0x13d6da){if(_0x13d6da){var _0x1d0249=_0x13d6da[_0x68d2('0x4c')];var _0x2c0436=util['format'](_0x68d2('0x4e'),_0x1d0249);if(fs[_0x68d2('0x4f')](_0x2c0436)){_0x290c1c=!![];return _0x59f421[_0x68d2('0x50')](_0x2c0436,_0x1d0249,config[_0x68d2('0x51')][_0x68d2('0x52')])[_0x68d2('0x25')](function(){return _0x13d6da;});}return _0x13d6da;}})[_0x68d2('0x25')](function(_0x109d94){if(_0x109d94){var _0x1d2605=_0x109d94[_0x68d2('0x4c')];if(!fs[_0x68d2('0x4f')](_0x1d2605)){throw new db[(_0x68d2('0x53'))][(_0x68d2('0x54'))](_0x68d2('0x55'));}if(_0x109d94[_0x68d2('0x4d')]){return _0x60bbc0[_0x68d2('0x4a')](_0x1d2605,_0x109d94[_0x68d2('0x4d')]+path['extname'](_0x1d2605),function(){if(_0x290c1c){fs[_0x68d2('0x56')](_0x1d2605);}});}else{return _0x60bbc0['download'](_0x1d2605,function(_0x16cdfe){if(_0x290c1c){fs[_0x68d2('0x56')](_0x1d2605);}});}}})[_0x68d2('0x42')](function(_0x4dc754){if(_0x4dc754['message']===_0x68d2('0x55')){_0x60bbc0['status'](0x194)['send'](_0x68d2('0x57'));}else{return handleError(_0x60bbc0,null);}});};exports[_0x68d2('0x26')]=function(_0x54435b,_0x5a599a){return db['SquareRecording']['find']({'where':{'id':_0x54435b[_0x68d2('0x49')]['id']}})[_0x68d2('0x25')](function(_0x195276){if(_['isNil'](_0x195276)){throw new ReferenceError(_0x68d2('0x58'));}return _0x195276;})[_0x68d2('0x25')](function(_0x4b0962){var _0x5c6ed9=_0x4b0962[_0x68d2('0x4c')];logger[_0x68d2('0x59')](_0x68d2('0x5a'),_0x5c6ed9);if(!_['isNil'](_0x4b0962[_0x68d2('0x4c')])&&fs[_0x68d2('0x4f')](_0x5c6ed9)){logger[_0x68d2('0x59')](_0x68d2('0x5b')+_0x5c6ed9+_0x68d2('0x5c'));fs[_0x68d2('0x5d')](_0x5c6ed9);}_0x5c6ed9=_0x5c6ed9+_0x68d2('0x5e');if(!_[_0x68d2('0x5f')](_0x4b0962[_0x68d2('0x4c')])&&fs[_0x68d2('0x4f')](_0x5c6ed9)){logger[_0x68d2('0x59')](_0x68d2('0x5b')+_0x5c6ed9+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x68d2('0x5d')](_0x5c6ed9);}return _0x4b0962;})[_0x68d2('0x25')](function(_0x5c126b){if(!_0x5c126b)throw new InternalError();return _0x5c126b[_0x68d2('0x26')]();})[_0x68d2('0x25')](function(){_0x5a599a[_0x68d2('0x1a')](0xcc)[_0x68d2('0x27')]();})[_0x68d2('0x42')](handleError(_0x5a599a,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index a0fa59d..65773ab 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 _0x4317=['./squareRecording.attributes','define','SquareRecording','square_recordings','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x8c90b1,_0x2579ab){var _0x4f1f9c=function(_0x948f53){while(--_0x948f53){_0x8c90b1['push'](_0x8c90b1['shift']());}};_0x4f1f9c(++_0x2579ab);}(_0x4317,0x7c));var _0x7431=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4317[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x7431('0x0'));var logger=require(_0x7431('0x1'))(_0x7431('0x2'));var moment=require('moment');var BPromise=require(_0x7431('0x3'));var rp=require(_0x7431('0x4'));var fs=require('fs');var path=require(_0x7431('0x5'));var rimraf=require(_0x7431('0x6'));var config=require(_0x7431('0x7'));var attributes=require(_0x7431('0x8'));module['exports']=function(_0x57adc1,_0x1e1f35){return _0x57adc1[_0x7431('0x9')](_0x7431('0xa'),attributes,{'tableName':_0x7431('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb091=['moment','request-promise','../../config/environment','./squareRecording.attributes','define','square_recordings','util','../../config/logger','api'];(function(_0x5954b8,_0x58bb3c){var _0x53df44=function(_0x48c744){while(--_0x48c744){_0x5954b8['push'](_0x5954b8['shift']());}};_0x53df44(++_0x58bb3c);}(_0xb091,0x16e));var _0x1b09=function(_0x164e3e,_0x537b6f){_0x164e3e=_0x164e3e-0x0;var _0x507a26=_0xb091[_0x164e3e];return _0x507a26;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var logger=require(_0x1b09('0x1'))(_0x1b09('0x2'));var moment=require(_0x1b09('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b09('0x5'));var attributes=require(_0x1b09('0x6'));module['exports']=function(_0xda8caa,_0x5fa348){return _0xda8caa[_0x1b09('0x7')]('SquareRecording',attributes,{'tableName':_0x1b09('0x8'),'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 97d39ad..d83c1bb 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 _0x9ba6=['request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareRecording','SquareRecording','create','options','raw','debug','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s'];(function(_0x1fbc6e,_0x304c17){var _0x1bcaeb=function(_0x15704f){while(--_0x15704f){_0x1fbc6e['push'](_0x1fbc6e['shift']());}};_0x1bcaeb(++_0x304c17);}(_0x9ba6,0x111));var _0x69ba=function(_0x49f85b,_0x2bb355){_0x49f85b=_0x49f85b-0x0;var _0x14d06b=_0x9ba6[_0x49f85b];return _0x14d06b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x69ba('0x0'));var BPromise=require(_0x69ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69ba('0x2'));var db=require(_0x69ba('0x3'))['db'];var utils=require(_0x69ba('0x4'));var logger=require(_0x69ba('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x69ba('0x6'));var client=jayson[_0x69ba('0x7')][_0x69ba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ee523,_0x9b88db,_0x136b23){return new BPromise(function(_0x492a82,_0x11da3a){return client[_0x69ba('0x9')](_0x5ee523,_0x136b23)[_0x69ba('0xa')](function(_0x18de4d){logger[_0x69ba('0xb')](_0x69ba('0xc'),_0x9b88db,_0x69ba('0xd'));logger['debug'](_0x69ba('0xe'),_0x9b88db,'request\x20sent',JSON[_0x69ba('0xf')](_0x18de4d));if(_0x18de4d[_0x69ba('0x10')]){if(_0x18de4d[_0x69ba('0x10')][_0x69ba('0x11')]===0x1f4){logger[_0x69ba('0x10')](_0x69ba('0xc'),_0x9b88db,_0x18de4d['error'][_0x69ba('0x12')]);return _0x11da3a(_0x18de4d['error'][_0x69ba('0x12')]);}logger[_0x69ba('0x10')]('SquareRecording,\x20%s,\x20%s',_0x9b88db,_0x18de4d[_0x69ba('0x10')]['message']);return _0x492a82(_0x18de4d[_0x69ba('0x10')][_0x69ba('0x12')]);}else{logger['info'](_0x69ba('0xc'),_0x9b88db,_0x69ba('0xd'));_0x492a82(_0x18de4d[_0x69ba('0x13')][_0x69ba('0x12')]);}})['catch'](function(_0x36dba0){logger[_0x69ba('0x10')](_0x69ba('0xc'),_0x9b88db,_0x36dba0);_0x11da3a(_0x36dba0);});});}exports[_0x69ba('0x14')]=function(_0x501733){var _0x44887a=this;return new Promise(function(_0x1f53d9,_0x4089ce){return db[_0x69ba('0x15')][_0x69ba('0x16')](_0x501733['body'],{'raw':_0x501733[_0x69ba('0x17')]?_0x501733['options'][_0x69ba('0x18')]===undefined?!![]:![]:!![]})[_0x69ba('0xa')](function(_0x156606){logger['info'](_0x69ba('0x14'),_0x501733);logger[_0x69ba('0x19')](_0x69ba('0x14'),_0x501733,JSON[_0x69ba('0xf')](_0x156606));_0x1f53d9(_0x156606);})['catch'](function(_0x4d1426){logger[_0x69ba('0x10')](_0x69ba('0x14'),_0x4d1426[_0x69ba('0x12')],_0x501733);_0x4089ce(_0x44887a[_0x69ba('0x10')](0x1f4,_0x4d1426['message']));});});}; \ No newline at end of file +var _0xc7fc=['catch','SquareRecording','body','options','CreateSquareRecording','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xc7fc,0xf9));var _0xcc7f=function(_0x145435,_0x326220){_0x145435=_0x145435-0x0;var _0x55a234=_0xc7fc[_0x145435];return _0x55a234;};'use strict';var _=require('lodash');var util=require(_0xcc7f('0x0'));var moment=require(_0xcc7f('0x1'));var BPromise=require(_0xcc7f('0x2'));var rs=require(_0xcc7f('0x3'));var fs=require('fs');var Redis=require(_0xcc7f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc7f('0x5'));var logger=require(_0xcc7f('0x6'))(_0xcc7f('0x7'));var config=require(_0xcc7f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcc7f('0x9')][_0xcc7f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ea0a2,_0x492498,_0xad2b39){return new BPromise(function(_0xa0fb75,_0x265a02){return client[_0xcc7f('0xb')](_0x3ea0a2,_0xad2b39)[_0xcc7f('0xc')](function(_0x38bc0e){logger[_0xcc7f('0xd')]('SquareRecording,\x20%s,\x20%s',_0x492498,_0xcc7f('0xe'));logger['debug'](_0xcc7f('0xf'),_0x492498,_0xcc7f('0xe'),JSON[_0xcc7f('0x10')](_0x38bc0e));if(_0x38bc0e[_0xcc7f('0x11')]){if(_0x38bc0e['error'][_0xcc7f('0x12')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x492498,_0x38bc0e[_0xcc7f('0x11')][_0xcc7f('0x13')]);return _0x265a02(_0x38bc0e[_0xcc7f('0x11')]['message']);}logger[_0xcc7f('0x11')]('SquareRecording,\x20%s,\x20%s',_0x492498,_0x38bc0e[_0xcc7f('0x11')][_0xcc7f('0x13')]);return _0xa0fb75(_0x38bc0e['error'][_0xcc7f('0x13')]);}else{logger[_0xcc7f('0xd')]('SquareRecording,\x20%s,\x20%s',_0x492498,_0xcc7f('0xe'));_0xa0fb75(_0x38bc0e[_0xcc7f('0x14')][_0xcc7f('0x13')]);}})[_0xcc7f('0x15')](function(_0x4c5274){logger['error']('SquareRecording,\x20%s,\x20%s',_0x492498,_0x4c5274);_0x265a02(_0x4c5274);});});}exports['CreateSquareRecording']=function(_0x5f41d4){var _0x48c347=this;return new Promise(function(_0x250349,_0x16004c){return db[_0xcc7f('0x16')]['create'](_0x5f41d4[_0xcc7f('0x17')],{'raw':_0x5f41d4[_0xcc7f('0x18')]?_0x5f41d4[_0xcc7f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xcc7f('0xc')](function(_0x3caaee){logger[_0xcc7f('0xd')](_0xcc7f('0x19'),_0x5f41d4);logger[_0xcc7f('0x1a')](_0xcc7f('0x19'),_0x5f41d4,JSON[_0xcc7f('0x10')](_0x3caaee));_0x250349(_0x3caaee);})[_0xcc7f('0x15')](function(_0x1cf687){logger['error']('CreateSquareRecording',_0x1cf687[_0xcc7f('0x13')],_0x5f41d4);_0x16004c(_0x48c347['error'](0x1f4,_0x1cf687[_0xcc7f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 0b0a776..f8020f4 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 +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(_0x556346,_0xc56cc4){var _0x3ab62c=function(_0x2ad166){while(--_0x2ad166){_0x556346['push'](_0x556346['shift']());}};_0x3ab62c(++_0xc56cc4);}(_0xe706,0xa3));var _0x6e70=function(_0x33de88,_0x581346){_0x33de88=_0x33de88-0x0;var _0x105957=_0xe706[_0x33de88];return _0x105957;};'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 83afe43..355e294 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 _0x0506=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x11f744,_0x26fafc){var _0xfc414d=function(_0x265ea6){while(--_0x265ea6){_0x11f744['push'](_0x11f744['shift']());}};_0xfc414d(++_0x26fafc);}(_0x0506,0x1c3));var _0x6050=function(_0x3810d0,_0xb3a4c4){_0x3810d0=_0x3810d0-0x0;var _0x22289=_0x0506[_0x3810d0];return _0x22289;};'use strict';var Sequelize=require(_0x6050('0x0'));module[_0x6050('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x6050('0x2')]},'request':{'type':Sequelize[_0x6050('0x2')]},'channel':{'type':Sequelize[_0x6050('0x2')]},'language':{'type':Sequelize[_0x6050('0x2')]},'type':{'type':Sequelize[_0x6050('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x6050('0x2')]},'callerid':{'type':Sequelize[_0x6050('0x2')]},'calleridname':{'type':Sequelize[_0x6050('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x6050('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x6050('0x2')]},'dnid':{'type':Sequelize[_0x6050('0x2')]},'rdnis':{'type':Sequelize[_0x6050('0x2')]},'context':{'type':Sequelize[_0x6050('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6050('0x2')]},'enhanced':{'type':Sequelize[_0x6050('0x2')]},'accountcode':{'type':Sequelize[_0x6050('0x2')]},'threadid':{'type':Sequelize[_0x6050('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6050('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x6050('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x8aea=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8aea,0x7a));var _0xa8ae=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8aea[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xa8ae('0x0'));module[_0xa8ae('0x1')]={'network':{'type':Sequelize[_0xa8ae('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xa8ae('0x2')]},'channel':{'type':Sequelize[_0xa8ae('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa8ae('0x2')]},'uniqueid':{'type':Sequelize[_0xa8ae('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa8ae('0x2')]},'calleridname':{'type':Sequelize[_0xa8ae('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xa8ae('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xa8ae('0x2')]},'dnid':{'type':Sequelize[_0xa8ae('0x2')]},'rdnis':{'type':Sequelize[_0xa8ae('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xa8ae('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xa8ae('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xa8ae('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa8ae('0x3')]},'leaveAt':{'type':Sequelize[_0xa8ae('0x3')]},'bot':{'type':Sequelize[_0xa8ae('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index b1d4982..cff759c 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 _0xce8a=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x18b2a3,_0x322f6c){var _0x1152f5=function(_0x5292c2){while(--_0x5292c2){_0x18b2a3['push'](_0x18b2a3['shift']());}};_0x1152f5(++_0x322f6c);}(_0xce8a,0x7f));var _0xace8=function(_0x166d5a,_0x49f250){_0x166d5a=_0x166d5a-0x0;var _0x126ef5=_0xce8a[_0x166d5a];return _0x126ef5;};'use strict';var emlformat=require(_0xace8('0x0'));var rimraf=require(_0xace8('0x1'));var zipdir=require(_0xace8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xace8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xace8('0x4'));var util=require(_0xace8('0x5'));var path=require(_0xace8('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xace8('0x7'));var _=require(_0xace8('0x8'));var squel=require(_0xace8('0x9'));var crypto=require(_0xace8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xace8('0xb'));var toCsv=require(_0xace8('0xc'));var querystring=require(_0xace8('0xd'));var Papa=require(_0xace8('0xe'));var Redis=require(_0xace8('0xf'));var authService=require(_0xace8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xace8('0x11'));var hardwareService=require(_0xace8('0x12'));var logger=require('../../config/logger')(_0xace8('0x13'));var utils=require(_0xace8('0x14'));var config=require(_0xace8('0x15'));var licenseUtil=require(_0xace8('0x16'));var db=require(_0xace8('0x17'))['db'];function respondWithStatusCode(_0x26d57d,_0x2ff0ca){_0x2ff0ca=_0x2ff0ca||0xcc;return function(_0xa08f05){if(_0xa08f05){return _0x26d57d[_0xace8('0x18')](_0x2ff0ca);}return _0x26d57d[_0xace8('0x19')](_0x2ff0ca)[_0xace8('0x1a')]();};}function respondWithResult(_0x248e1f,_0x3b664f){_0x3b664f=_0x3b664f||0xc8;return function(_0x77a4c1){if(_0x77a4c1){return _0x248e1f[_0xace8('0x19')](_0x3b664f)[_0xace8('0x1b')](_0x77a4c1);}};}function respondWithFilteredResult(_0x4aa796,_0x4c409b){return function(_0x5373a4){if(_0x5373a4){var _0x5e79c0=typeof _0x4c409b[_0xace8('0x1c')]===_0xace8('0x1d')&&typeof _0x4c409b[_0xace8('0x1e')]===_0xace8('0x1d');var _0x4383c2=_0x5373a4['count'];var _0x11344a=_0x5e79c0?0x0:_0x4c409b['offset'];var _0x3e4822=_0x5e79c0?_0x5373a4[_0xace8('0x1f')]:_0x4c409b[_0xace8('0x1c')]+_0x4c409b[_0xace8('0x1e')];var _0x5ce4d4;if(_0x3e4822>=_0x4383c2){_0x3e4822=_0x4383c2;_0x5ce4d4=0xc8;}else{_0x5ce4d4=0xce;}_0x4aa796[_0xace8('0x19')](_0x5ce4d4);return _0x4aa796[_0xace8('0x20')](_0xace8('0x21'),_0x11344a+'-'+_0x3e4822+'/'+_0x4383c2)[_0xace8('0x1b')](_0x5373a4);}return null;};}function patchUpdates(_0x19a976){return function(_0x6926f1){try{jsonpatch[_0xace8('0x22')](_0x6926f1,_0x19a976,!![]);}catch(_0x40e4ae){return BPromise[_0xace8('0x23')](_0x40e4ae);}return _0x6926f1['save']();};}function saveUpdates(_0x27ff3c,_0x4cbe2c){return function(_0x3bb395){if(_0x3bb395){return _0x3bb395[_0xace8('0x24')](_0x27ff3c)[_0xace8('0x25')](function(_0x47de0a){return _0x47de0a;});}return null;};}function removeEntity(_0x23d922,_0x572d7d){return function(_0x224e96){if(_0x224e96){return _0x224e96[_0xace8('0x26')]()[_0xace8('0x25')](function(){_0x23d922['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55ec90,_0x21281c){return function(_0x4d7c78){if(!_0x4d7c78){_0x55ec90[_0xace8('0x18')](0x194);}return _0x4d7c78;};}function handleError(_0x59d8e9,_0x1d08e9){_0x1d08e9=_0x1d08e9||0x1f4;return function(_0xe3e83b){logger['error'](_0xe3e83b[_0xace8('0x27')]);if(_0xe3e83b[_0xace8('0x28')]){delete _0xe3e83b[_0xace8('0x28')];}_0x59d8e9[_0xace8('0x19')](_0x1d08e9)[_0xace8('0x29')](_0xe3e83b);};}exports[_0xace8('0x2a')]=function(_0x5095c8,_0x39a911){var _0x24d012={},_0x16dff8={},_0x3fbba6={'count':0x0,'rows':[]};var _0x4f46fc=_[_0xace8('0x2b')](db[_0xace8('0x2c')][_0xace8('0x2d')],function(_0xec040d){return{'name':_0xec040d[_0xace8('0x2e')],'type':_0xec040d[_0xace8('0x2f')][_0xace8('0x30')]};});_0x16dff8[_0xace8('0x31')]=_[_0xace8('0x2b')](_0x4f46fc,_0xace8('0x28'));_0x16dff8[_0xace8('0x32')]=_[_0xace8('0x33')](_0x5095c8[_0xace8('0x32')]);_0x16dff8[_0xace8('0x34')]=_[_0xace8('0x35')](_0x16dff8['model'],_0x16dff8['query']);_0x24d012[_0xace8('0x36')]=_[_0xace8('0x35')](_0x16dff8['model'],qs[_0xace8('0x37')](_0x5095c8[_0xace8('0x32')][_0xace8('0x37')]));_0x24d012[_0xace8('0x36')]=_0x24d012['attributes']['length']?_0x24d012['attributes']:_0x16dff8[_0xace8('0x31')];if(!_0x5095c8[_0xace8('0x32')][_0xace8('0x38')](_0xace8('0x39'))){_0x24d012[_0xace8('0x1e')]=qs[_0xace8('0x1e')](_0x5095c8[_0xace8('0x32')]['limit']);_0x24d012['offset']=qs[_0xace8('0x1c')](_0x5095c8[_0xace8('0x32')][_0xace8('0x1c')]);}_0x24d012[_0xace8('0x3a')]=qs[_0xace8('0x3b')](_0x5095c8[_0xace8('0x32')][_0xace8('0x3b')]);_0x24d012[_0xace8('0x3c')]=qs['filters'](_['pick'](_0x5095c8[_0xace8('0x32')],_0x16dff8[_0xace8('0x34')]),_0x4f46fc);if(_0x5095c8[_0xace8('0x32')][_0xace8('0x3d')]){_0x24d012['where']=_[_0xace8('0x3e')](_0x24d012[_0xace8('0x3c')],{'$or':_['map'](_0x4f46fc,function(_0x3bb65d){if(_0x3bb65d[_0xace8('0x2f')]!==_0xace8('0x3f')){var _0x55a2e4={};_0x55a2e4[_0x3bb65d[_0xace8('0x28')]]={'$like':'%'+_0x5095c8[_0xace8('0x32')][_0xace8('0x3d')]+'%'};return _0x55a2e4;}})});}_0x24d012=_[_0xace8('0x3e')]({},_0x24d012,_0x5095c8[_0xace8('0x40')]);var _0x4630bf={'where':_0x24d012[_0xace8('0x3c')]};return db[_0xace8('0x2c')][_0xace8('0x1f')](_0x4630bf)[_0xace8('0x25')](function(_0x51bb68){_0x3fbba6[_0xace8('0x1f')]=_0x51bb68;if(_0x5095c8[_0xace8('0x32')][_0xace8('0x41')]){_0x24d012[_0xace8('0x42')]=[{'all':!![]}];}return db[_0xace8('0x2c')][_0xace8('0x43')](_0x24d012);})[_0xace8('0x25')](function(_0x474922){_0x3fbba6[_0xace8('0x44')]=_0x474922;return _0x3fbba6;})['then'](respondWithFilteredResult(_0x39a911,_0x24d012))[_0xace8('0x45')](handleError(_0x39a911,null));};exports[_0xace8('0x46')]=function(_0x3f0bc4,_0x5d75eb){var _0x4b3e86={'raw':!![],'where':{'id':_0x3f0bc4['params']['id']}},_0x370532={};_0x370532['model']=_[_0xace8('0x33')](db[_0xace8('0x2c')][_0xace8('0x2d')]);_0x370532['query']=_[_0xace8('0x33')](_0x3f0bc4[_0xace8('0x32')]);_0x370532['filters']=_[_0xace8('0x35')](_0x370532[_0xace8('0x31')],_0x370532[_0xace8('0x32')]);_0x4b3e86[_0xace8('0x36')]=_['intersection'](_0x370532[_0xace8('0x31')],qs[_0xace8('0x37')](_0x3f0bc4[_0xace8('0x32')][_0xace8('0x37')]));_0x4b3e86[_0xace8('0x36')]=_0x4b3e86[_0xace8('0x36')][_0xace8('0x47')]?_0x4b3e86['attributes']:_0x370532[_0xace8('0x31')];if(_0x3f0bc4['query']['includeAll']){_0x4b3e86[_0xace8('0x42')]=[{'all':!![]}];}_0x4b3e86=_[_0xace8('0x3e')]({},_0x4b3e86,_0x3f0bc4['options']);return db[_0xace8('0x2c')][_0xace8('0x48')](_0x4b3e86)['then'](handleEntityNotFound(_0x5d75eb,null))[_0xace8('0x25')](respondWithResult(_0x5d75eb,null))[_0xace8('0x45')](handleError(_0x5d75eb,null));};exports[_0xace8('0x49')]=function(_0x50432c,_0x5b91d1){return db[_0xace8('0x2c')][_0xace8('0x49')](_0x50432c[_0xace8('0x4a')],{})[_0xace8('0x25')](respondWithResult(_0x5b91d1,0xc9))['catch'](handleError(_0x5b91d1,null));};exports[_0xace8('0x24')]=function(_0x1c5833,_0x34ab11){if(_0x1c5833[_0xace8('0x4a')]['id']){delete _0x1c5833[_0xace8('0x4a')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x1c5833[_0xace8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x34ab11,null))[_0xace8('0x25')](saveUpdates(_0x1c5833[_0xace8('0x4a')],null))[_0xace8('0x25')](respondWithResult(_0x34ab11,null))[_0xace8('0x45')](handleError(_0x34ab11,null));};exports[_0xace8('0x26')]=function(_0x3f50ec,_0x48ed3e){return db['SquareReport'][_0xace8('0x48')]({'where':{'id':_0x3f50ec['params']['id']}})[_0xace8('0x25')](handleEntityNotFound(_0x48ed3e,null))[_0xace8('0x25')](removeEntity(_0x48ed3e,null))[_0xace8('0x45')](handleError(_0x48ed3e,null));};exports[_0xace8('0x4c')]=function(_0x4a217a,_0x9c9993){return db[_0xace8('0x2c')][_0xace8('0x4c')]()[_0xace8('0x25')](respondWithResult(_0x9c9993,null))[_0xace8('0x45')](handleError(_0x9c9993,null));}; \ No newline at end of file +var _0x3df3=['api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','set','apply','save','update','then','destroy','end','stack','name','index','map','SquareReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','type','includeAll','include','show','params','rawAttributes','find','catch','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3df3,0xbe));var _0x33df=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x3df3[_0xe30e17];return _0x2342c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x33df('0x0'));var zipdir=require(_0x33df('0x1'));var jsonpatch=require(_0x33df('0x2'));var rp=require(_0x33df('0x3'));var moment=require(_0x33df('0x4'));var BPromise=require(_0x33df('0x5'));var Mustache=require(_0x33df('0x6'));var util=require(_0x33df('0x7'));var path=require(_0x33df('0x8'));var sox=require('sox');var csv=require(_0x33df('0x9'));var ejs=require(_0x33df('0xa'));var fs=require('fs');var fs_extra=require(_0x33df('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x33df('0xc'));var jsforce=require(_0x33df('0xd'));var deskjs=require(_0x33df('0xe'));var toCsv=require('to-csv');var querystring=require(_0x33df('0xf'));var Papa=require(_0x33df('0x10'));var Redis=require('ioredis');var authService=require(_0x33df('0x11'));var qs=require(_0x33df('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x33df('0x13'))(_0x33df('0x14'));var utils=require(_0x33df('0x15'));var config=require(_0x33df('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ddc71,_0xaece08){_0xaece08=_0xaece08||0xcc;return function(_0x22e814){if(_0x22e814){return _0x5ddc71[_0x33df('0x17')](_0xaece08);}return _0x5ddc71[_0x33df('0x18')](_0xaece08)['end']();};}function respondWithResult(_0x1ccf52,_0x49a0b5){_0x49a0b5=_0x49a0b5||0xc8;return function(_0x142950){if(_0x142950){return _0x1ccf52[_0x33df('0x18')](_0x49a0b5)[_0x33df('0x19')](_0x142950);}};}function respondWithFilteredResult(_0x57019e,_0x59e314){return function(_0x2ef2f3){if(_0x2ef2f3){var _0x31d5cf=typeof _0x59e314['offset']===_0x33df('0x1a')&&typeof _0x59e314[_0x33df('0x1b')]===_0x33df('0x1a');var _0xabea87=_0x2ef2f3[_0x33df('0x1c')];var _0x13f9d3=_0x31d5cf?0x0:_0x59e314['offset'];var _0x51c7f0=_0x31d5cf?_0x2ef2f3[_0x33df('0x1c')]:_0x59e314['offset']+_0x59e314['limit'];var _0x2ec657;if(_0x51c7f0>=_0xabea87){_0x51c7f0=_0xabea87;_0x2ec657=0xc8;}else{_0x2ec657=0xce;}_0x57019e[_0x33df('0x18')](_0x2ec657);return _0x57019e[_0x33df('0x1d')]('Content-Range',_0x13f9d3+'-'+_0x51c7f0+'/'+_0xabea87)['json'](_0x2ef2f3);}return null;};}function patchUpdates(_0x52a32e){return function(_0x505369){try{jsonpatch[_0x33df('0x1e')](_0x505369,_0x52a32e,!![]);}catch(_0x2f7e6e){return BPromise['reject'](_0x2f7e6e);}return _0x505369[_0x33df('0x1f')]();};}function saveUpdates(_0x480860,_0x57e186){return function(_0x44dab4){if(_0x44dab4){return _0x44dab4[_0x33df('0x20')](_0x480860)[_0x33df('0x21')](function(_0x13ae94){return _0x13ae94;});}return null;};}function removeEntity(_0x1d960f,_0x55a681){return function(_0x4f9711){if(_0x4f9711){return _0x4f9711[_0x33df('0x22')]()[_0x33df('0x21')](function(){_0x1d960f[_0x33df('0x18')](0xcc)[_0x33df('0x23')]();});}};}function handleEntityNotFound(_0x285603,_0x5df498){return function(_0x4f393d){if(!_0x4f393d){_0x285603['sendStatus'](0x194);}return _0x4f393d;};}function handleError(_0x1e33c7,_0xf57718){_0xf57718=_0xf57718||0x1f4;return function(_0x50ed77){logger['error'](_0x50ed77[_0x33df('0x24')]);if(_0x50ed77['name']){delete _0x50ed77[_0x33df('0x25')];}_0x1e33c7[_0x33df('0x18')](_0xf57718)['send'](_0x50ed77);};}exports[_0x33df('0x26')]=function(_0x5c2896,_0x5f33e4){var _0x16c48e={},_0x4f297b={},_0xea8fc={'count':0x0,'rows':[]};var _0x5c1972=_[_0x33df('0x27')](db[_0x33df('0x28')]['rawAttributes'],function(_0x3967ae){return{'name':_0x3967ae[_0x33df('0x29')],'type':_0x3967ae['type'][_0x33df('0x2a')]};});_0x4f297b[_0x33df('0x2b')]=_[_0x33df('0x27')](_0x5c1972,_0x33df('0x25'));_0x4f297b[_0x33df('0x2c')]=_[_0x33df('0x2d')](_0x5c2896['query']);_0x4f297b[_0x33df('0x2e')]=_[_0x33df('0x2f')](_0x4f297b[_0x33df('0x2b')],_0x4f297b[_0x33df('0x2c')]);_0x16c48e[_0x33df('0x30')]=_['intersection'](_0x4f297b[_0x33df('0x2b')],qs['fields'](_0x5c2896[_0x33df('0x2c')][_0x33df('0x31')]));_0x16c48e['attributes']=_0x16c48e[_0x33df('0x30')][_0x33df('0x32')]?_0x16c48e[_0x33df('0x30')]:_0x4f297b[_0x33df('0x2b')];if(!_0x5c2896['query'][_0x33df('0x33')](_0x33df('0x34'))){_0x16c48e['limit']=qs[_0x33df('0x1b')](_0x5c2896[_0x33df('0x2c')][_0x33df('0x1b')]);_0x16c48e['offset']=qs['offset'](_0x5c2896[_0x33df('0x2c')][_0x33df('0x35')]);}_0x16c48e[_0x33df('0x36')]=qs[_0x33df('0x37')](_0x5c2896['query'][_0x33df('0x37')]);_0x16c48e['where']=qs[_0x33df('0x2e')](_[_0x33df('0x38')](_0x5c2896[_0x33df('0x2c')],_0x4f297b[_0x33df('0x2e')]),_0x5c1972);if(_0x5c2896['query'][_0x33df('0x39')]){_0x16c48e[_0x33df('0x3a')]=_[_0x33df('0x3b')](_0x16c48e[_0x33df('0x3a')],{'$or':_[_0x33df('0x27')](_0x5c1972,function(_0x194b17){if(_0x194b17[_0x33df('0x3c')]!=='VIRTUAL'){var _0x2281a5={};_0x2281a5[_0x194b17[_0x33df('0x25')]]={'$like':'%'+_0x5c2896['query']['filter']+'%'};return _0x2281a5;}})});}_0x16c48e=_[_0x33df('0x3b')]({},_0x16c48e,_0x5c2896['options']);var _0x2fc2b5={'where':_0x16c48e['where']};return db[_0x33df('0x28')][_0x33df('0x1c')](_0x2fc2b5)[_0x33df('0x21')](function(_0x5a62a9){_0xea8fc[_0x33df('0x1c')]=_0x5a62a9;if(_0x5c2896[_0x33df('0x2c')][_0x33df('0x3d')]){_0x16c48e[_0x33df('0x3e')]=[{'all':!![]}];}return db[_0x33df('0x28')]['findAll'](_0x16c48e);})[_0x33df('0x21')](function(_0x1c1c04){_0xea8fc['rows']=_0x1c1c04;return _0xea8fc;})['then'](respondWithFilteredResult(_0x5f33e4,_0x16c48e))['catch'](handleError(_0x5f33e4,null));};exports[_0x33df('0x3f')]=function(_0xfd1dfa,_0x355be9){var _0x86fd0c={'raw':!![],'where':{'id':_0xfd1dfa[_0x33df('0x40')]['id']}},_0x334880={};_0x334880[_0x33df('0x2b')]=_[_0x33df('0x2d')](db['SquareReport'][_0x33df('0x41')]);_0x334880[_0x33df('0x2c')]=_[_0x33df('0x2d')](_0xfd1dfa[_0x33df('0x2c')]);_0x334880['filters']=_[_0x33df('0x2f')](_0x334880[_0x33df('0x2b')],_0x334880['query']);_0x86fd0c[_0x33df('0x30')]=_['intersection'](_0x334880['model'],qs[_0x33df('0x31')](_0xfd1dfa[_0x33df('0x2c')]['fields']));_0x86fd0c[_0x33df('0x30')]=_0x86fd0c[_0x33df('0x30')][_0x33df('0x32')]?_0x86fd0c[_0x33df('0x30')]:_0x334880['model'];if(_0xfd1dfa['query']['includeAll']){_0x86fd0c['include']=[{'all':!![]}];}_0x86fd0c=_[_0x33df('0x3b')]({},_0x86fd0c,_0xfd1dfa['options']);return db[_0x33df('0x28')][_0x33df('0x42')](_0x86fd0c)['then'](handleEntityNotFound(_0x355be9,null))[_0x33df('0x21')](respondWithResult(_0x355be9,null))[_0x33df('0x43')](handleError(_0x355be9,null));};exports['create']=function(_0x3b7952,_0x2374e4){return db['SquareReport']['create'](_0x3b7952[_0x33df('0x44')],{})[_0x33df('0x21')](respondWithResult(_0x2374e4,0xc9))[_0x33df('0x43')](handleError(_0x2374e4,null));};exports[_0x33df('0x20')]=function(_0x4ba16f,_0x49b15b){if(_0x4ba16f['body']['id']){delete _0x4ba16f[_0x33df('0x44')]['id'];}return db[_0x33df('0x28')][_0x33df('0x42')]({'where':{'id':_0x4ba16f[_0x33df('0x40')]['id']}})[_0x33df('0x21')](handleEntityNotFound(_0x49b15b,null))[_0x33df('0x21')](saveUpdates(_0x4ba16f[_0x33df('0x44')],null))[_0x33df('0x21')](respondWithResult(_0x49b15b,null))[_0x33df('0x43')](handleError(_0x49b15b,null));};exports[_0x33df('0x22')]=function(_0x4bbdf0,_0x201d08){return db[_0x33df('0x28')]['find']({'where':{'id':_0x4bbdf0['params']['id']}})[_0x33df('0x21')](handleEntityNotFound(_0x201d08,null))[_0x33df('0x21')](removeEntity(_0x201d08,null))[_0x33df('0x43')](handleError(_0x201d08,null));};exports[_0x33df('0x45')]=function(_0x453751,_0x190364){return db[_0x33df('0x28')]['describe']()[_0x33df('0x21')](respondWithResult(_0x190364,null))['catch'](handleError(_0x190364,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index b846ed4..f446e16 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 _0x5563=['../../config/logger','moment','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','report_square','uid_pname','uniqueid','leaveAt','lodash','util'];(function(_0x2093f0,_0x1f903c){var _0x37829f=function(_0x27d3bc){while(--_0x27d3bc){_0x2093f0['push'](_0x2093f0['shift']());}};_0x37829f(++_0x1f903c);}(_0x5563,0x14e));var _0x3556=function(_0x328f30,_0x5d3ca1){_0x328f30=_0x328f30-0x0;var _0x5bb043=_0x5563[_0x328f30];return _0x5bb043;};'use strict';var _=require(_0x3556('0x0'));var util=require(_0x3556('0x1'));var logger=require(_0x3556('0x2'))('api');var moment=require(_0x3556('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3556('0x4'));var rimraf=require(_0x3556('0x5'));var config=require(_0x3556('0x6'));var attributes=require(_0x3556('0x7'));module[_0x3556('0x8')]=function(_0x4aa297,_0x307729){return _0x4aa297[_0x3556('0x9')]('SquareReport',attributes,{'tableName':_0x3556('0xa'),'paranoid':![],'indexes':[{'name':_0x3556('0xb'),'fields':[_0x3556('0xc'),'project_name']},{'name':_0x3556('0xd'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8dac=['SquareReport','report_square','uid_pname','project_name','leaveAt','util','../../config/logger','moment','request-promise','path','rimraf','./squareReport.attributes','exports'];(function(_0x15ca1a,_0x30fc82){var _0x507626=function(_0x14c9bc){while(--_0x14c9bc){_0x15ca1a['push'](_0x15ca1a['shift']());}};_0x507626(++_0x30fc82);}(_0x8dac,0x157));var _0xc8da=function(_0x2c0822,_0x6de0ef){_0x2c0822=_0x2c0822-0x0;var _0x7e9725=_0x8dac[_0x2c0822];return _0x7e9725;};'use strict';var _=require('lodash');var util=require(_0xc8da('0x0'));var logger=require(_0xc8da('0x1'))('api');var moment=require(_0xc8da('0x2'));var BPromise=require('bluebird');var rp=require(_0xc8da('0x3'));var fs=require('fs');var path=require(_0xc8da('0x4'));var rimraf=require(_0xc8da('0x5'));var config=require('../../config/environment');var attributes=require(_0xc8da('0x6'));module[_0xc8da('0x7')]=function(_0x2a0f2e,_0x756587){return _0x2a0f2e['define'](_0xc8da('0x8'),attributes,{'tableName':_0xc8da('0x9'),'paranoid':![],'indexes':[{'name':_0xc8da('0xa'),'fields':['uniqueid',_0xc8da('0xb')]},{'name':'leaveAt','fields':[_0xc8da('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 62e932b..890b031 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 _0xf3fe=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','options','raw','UpdateSquareReport','update','body','where','attributes','limit','then'];(function(_0x53e357,_0x300786){var _0x21a738=function(_0x4a49f5){while(--_0x4a49f5){_0x53e357['push'](_0x53e357['shift']());}};_0x21a738(++_0x300786);}(_0xf3fe,0xa5));var _0xef3f=function(_0x3f4458,_0x4f31ad){_0x3f4458=_0x3f4458-0x0;var _0x395098=_0xf3fe[_0x3f4458];return _0x395098;};'use strict';var _=require(_0xef3f('0x0'));var util=require(_0xef3f('0x1'));var moment=require(_0xef3f('0x2'));var BPromise=require(_0xef3f('0x3'));var rs=require(_0xef3f('0x4'));var fs=require('fs');var Redis=require(_0xef3f('0x5'));var db=require(_0xef3f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xef3f('0x7'))('rpc');var config=require(_0xef3f('0x8'));var jayson=require(_0xef3f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x686838,_0x31eeae,_0x2e413d){return new BPromise(function(_0x16ee4b,_0x1de634){return client['request'](_0x686838,_0x2e413d)['then'](function(_0x243856){logger[_0xef3f('0xa')](_0xef3f('0xb'),_0x31eeae,_0xef3f('0xc'));logger[_0xef3f('0xd')](_0xef3f('0xe'),_0x31eeae,_0xef3f('0xc'),JSON[_0xef3f('0xf')](_0x243856));if(_0x243856[_0xef3f('0x10')]){if(_0x243856[_0xef3f('0x10')][_0xef3f('0x11')]===0x1f4){logger[_0xef3f('0x10')](_0xef3f('0xb'),_0x31eeae,_0x243856[_0xef3f('0x10')][_0xef3f('0x12')]);return _0x1de634(_0x243856['error'][_0xef3f('0x12')]);}logger[_0xef3f('0x10')](_0xef3f('0xb'),_0x31eeae,_0x243856[_0xef3f('0x10')][_0xef3f('0x12')]);return _0x16ee4b(_0x243856[_0xef3f('0x10')][_0xef3f('0x12')]);}else{logger[_0xef3f('0xa')](_0xef3f('0xb'),_0x31eeae,_0xef3f('0xc'));_0x16ee4b(_0x243856[_0xef3f('0x13')]['message']);}})[_0xef3f('0x14')](function(_0x1b2bf5){logger[_0xef3f('0x10')]('SquareReport,\x20%s,\x20%s',_0x31eeae,_0x1b2bf5);_0x1de634(_0x1b2bf5);});});}exports[_0xef3f('0x15')]=function(_0x1c84cc){var _0x5283b7=this;return new Promise(function(_0x1c7e7c,_0x26032b){return db[_0xef3f('0x16')][_0xef3f('0x17')](_0x1c84cc['body'],{'raw':_0x1c84cc[_0xef3f('0x18')]?_0x1c84cc[_0xef3f('0x18')][_0xef3f('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x46ac51){logger[_0xef3f('0xa')](_0xef3f('0x15'),_0x1c84cc);logger[_0xef3f('0xd')](_0xef3f('0x15'),_0x1c84cc,JSON[_0xef3f('0xf')](_0x46ac51));_0x1c7e7c(_0x46ac51);})[_0xef3f('0x14')](function(_0x3e905e){logger['error'](_0xef3f('0x15'),_0x3e905e[_0xef3f('0x12')],_0x1c84cc);_0x26032b(_0x5283b7[_0xef3f('0x10')](0x1f4,_0x3e905e[_0xef3f('0x12')]));});});};exports[_0xef3f('0x1a')]=function(_0x1f537f){var _0x26108a=this;return new Promise(function(_0x6807fb,_0x4994dc){return db[_0xef3f('0x16')][_0xef3f('0x1b')](_0x1f537f[_0xef3f('0x1c')],{'raw':_0x1f537f['options']?_0x1f537f[_0xef3f('0x18')][_0xef3f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f537f[_0xef3f('0x18')]?_0x1f537f[_0xef3f('0x18')][_0xef3f('0x1d')]||null:null,'attributes':_0x1f537f['options']?_0x1f537f[_0xef3f('0x18')][_0xef3f('0x1e')]||null:null,'limit':_0x1f537f[_0xef3f('0x18')]?_0x1f537f['options'][_0xef3f('0x1f')]||null:null})[_0xef3f('0x20')](function(_0x4908bf){logger[_0xef3f('0xa')]('UpdateSquareReport',_0x1f537f);logger[_0xef3f('0xd')](_0xef3f('0x1a'),_0x1f537f,JSON[_0xef3f('0xf')](_0x4908bf));_0x6807fb(_0x4908bf);})['catch'](function(_0x58b6f8){logger[_0xef3f('0x10')](_0xef3f('0x1a'),_0x58b6f8[_0xef3f('0x12')],_0x1f537f);_0x4994dc(_0x26108a[_0xef3f('0x10')](0x1f4,_0x58b6f8[_0xef3f('0x12')]));});});}; \ No newline at end of file +var _0x6430=['limit','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareReport','body','options','raw','CreateSquareReport','UpdateSquareReport','where'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x6430,0x141));var _0x0643=function(_0x57ebb0,_0x13243e){_0x57ebb0=_0x57ebb0-0x0;var _0x369709=_0x6430[_0x57ebb0];return _0x369709;};'use strict';var _=require(_0x0643('0x0'));var util=require(_0x0643('0x1'));var moment=require(_0x0643('0x2'));var BPromise=require(_0x0643('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0643('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0643('0x5'))(_0x0643('0x6'));var config=require(_0x0643('0x7'));var jayson=require(_0x0643('0x8'));var client=jayson[_0x0643('0x9')][_0x0643('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x523967,_0x51f17c,_0x203dd3){return new BPromise(function(_0x3479b2,_0x5b9a65){return client[_0x0643('0xb')](_0x523967,_0x203dd3)[_0x0643('0xc')](function(_0x208e21){logger[_0x0643('0xd')](_0x0643('0xe'),_0x51f17c,_0x0643('0xf'));logger[_0x0643('0x10')](_0x0643('0x11'),_0x51f17c,_0x0643('0xf'),JSON[_0x0643('0x12')](_0x208e21));if(_0x208e21[_0x0643('0x13')]){if(_0x208e21['error'][_0x0643('0x14')]===0x1f4){logger[_0x0643('0x13')]('SquareReport,\x20%s,\x20%s',_0x51f17c,_0x208e21[_0x0643('0x13')][_0x0643('0x15')]);return _0x5b9a65(_0x208e21[_0x0643('0x13')]['message']);}logger[_0x0643('0x13')](_0x0643('0xe'),_0x51f17c,_0x208e21[_0x0643('0x13')][_0x0643('0x15')]);return _0x3479b2(_0x208e21[_0x0643('0x13')][_0x0643('0x15')]);}else{logger[_0x0643('0xd')](_0x0643('0xe'),_0x51f17c,'request\x20sent');_0x3479b2(_0x208e21[_0x0643('0x16')][_0x0643('0x15')]);}})[_0x0643('0x17')](function(_0x58ccb1){logger[_0x0643('0x13')](_0x0643('0xe'),_0x51f17c,_0x58ccb1);_0x5b9a65(_0x58ccb1);});});}exports['CreateSquareReport']=function(_0x21a668){var _0x2e93c7=this;return new Promise(function(_0x5d3002,_0x1cf302){return db[_0x0643('0x18')]['create'](_0x21a668[_0x0643('0x19')],{'raw':_0x21a668[_0x0643('0x1a')]?_0x21a668['options'][_0x0643('0x1b')]===undefined?!![]:![]:!![]})[_0x0643('0xc')](function(_0x34659e){logger[_0x0643('0xd')](_0x0643('0x1c'),_0x21a668);logger['debug']('CreateSquareReport',_0x21a668,JSON[_0x0643('0x12')](_0x34659e));_0x5d3002(_0x34659e);})[_0x0643('0x17')](function(_0x36baa4){logger['error']('CreateSquareReport',_0x36baa4[_0x0643('0x15')],_0x21a668);_0x1cf302(_0x2e93c7['error'](0x1f4,_0x36baa4[_0x0643('0x15')]));});});};exports[_0x0643('0x1d')]=function(_0x45278d){var _0x545eab=this;return new Promise(function(_0x5bc447,_0xe74f2e){return db[_0x0643('0x18')]['update'](_0x45278d[_0x0643('0x19')],{'raw':_0x45278d[_0x0643('0x1a')]?_0x45278d['options'][_0x0643('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45278d[_0x0643('0x1a')]?_0x45278d[_0x0643('0x1a')][_0x0643('0x1e')]||null:null,'attributes':_0x45278d['options']?_0x45278d[_0x0643('0x1a')]['attributes']||null:null,'limit':_0x45278d['options']?_0x45278d[_0x0643('0x1a')][_0x0643('0x1f')]||null:null})[_0x0643('0xc')](function(_0x46a2e1){logger[_0x0643('0xd')](_0x0643('0x1d'),_0x45278d);logger[_0x0643('0x10')]('UpdateSquareReport',_0x45278d,JSON[_0x0643('0x12')](_0x46a2e1));_0x5bc447(_0x46a2e1);})[_0x0643('0x17')](function(_0x35ce32){logger[_0x0643('0x13')](_0x0643('0x1d'),_0x35ce32[_0x0643('0x15')],_0x45278d);_0xe74f2e(_0x545eab[_0x0643('0x13')](0x1f4,_0x35ce32[_0x0643('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 766f4af..83f50b5 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 _0x7340=['index','/describe','describe','show','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x597e38,_0x551ac2){var _0x5305d2=function(_0x47dc5e){while(--_0x47dc5e){_0x597e38['push'](_0x597e38['shift']());}};_0x5305d2(++_0x551ac2);}(_0x7340,0x16f));var _0x0734=function(_0x578fba,_0x1bf2e4){_0x578fba=_0x578fba-0x0;var _0x317f27=_0x7340[_0x578fba];return _0x317f27;};'use strict';var multer=require(_0x0734('0x0'));var util=require(_0x0734('0x1'));var path=require(_0x0734('0x2'));var timeout=require(_0x0734('0x3'));var express=require(_0x0734('0x4'));var router=express[_0x0734('0x5')]();var fs_extra=require(_0x0734('0x6'));var auth=require(_0x0734('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0734('0x8'));var controller=require('./squareReportDetail.controller');router[_0x0734('0x9')]('/',auth[_0x0734('0xa')](),controller[_0x0734('0xb')]);router[_0x0734('0x9')](_0x0734('0xc'),auth[_0x0734('0xa')](),controller[_0x0734('0xd')]);router['get']('/:id',auth[_0x0734('0xa')](),controller[_0x0734('0xe')]);router[_0x0734('0xf')]('/',auth[_0x0734('0xa')](),controller[_0x0734('0x10')]);router[_0x0734('0x11')](_0x0734('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x0734('0x13')](_0x0734('0x12'),auth[_0x0734('0xa')](),controller[_0x0734('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa3b2=['util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','index','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x357b6b,_0x249fe6){var _0x3f30ac=function(_0x1d5bbe){while(--_0x1d5bbe){_0x357b6b['push'](_0x357b6b['shift']());}};_0x3f30ac(++_0x249fe6);}(_0xa3b2,0xc7));var _0x2a3b=function(_0x3c3a03,_0x3c0da1){_0x3c3a03=_0x3c3a03-0x0;var _0x57ff53=_0xa3b2[_0x3c3a03];return _0x57ff53;};'use strict';var multer=require(_0x2a3b('0x0'));var util=require(_0x2a3b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2a3b('0x2'));var router=express[_0x2a3b('0x3')]();var fs_extra=require(_0x2a3b('0x4'));var auth=require(_0x2a3b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2a3b('0x6'));var controller=require(_0x2a3b('0x7'));router[_0x2a3b('0x8')]('/',auth['isAuthenticated'](),controller[_0x2a3b('0x9')]);router[_0x2a3b('0x8')]('/describe',auth[_0x2a3b('0xa')](),controller['describe']);router['get'](_0x2a3b('0xb'),auth[_0x2a3b('0xa')](),controller[_0x2a3b('0xc')]);router[_0x2a3b('0xd')]('/',auth[_0x2a3b('0xa')](),controller[_0x2a3b('0xe')]);router[_0x2a3b('0xf')](_0x2a3b('0xb'),auth[_0x2a3b('0xa')](),controller[_0x2a3b('0x10')]);router[_0x2a3b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x2a3b('0x12')]);module[_0x2a3b('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index bf093ca..98aa858 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 _0xcf88=['STRING','TEXT'];(function(_0x389a9e,_0x41f259){var _0x39c6ce=function(_0x26aa47){while(--_0x26aa47){_0x389a9e['push'](_0x389a9e['shift']());}};_0x39c6ce(++_0x41f259);}(_0xcf88,0x106));var _0x8cf8=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xcf88[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x8cf8('0x0')]},'node':{'type':Sequelize[_0x8cf8('0x0')]},'application':{'type':Sequelize[_0x8cf8('0x0')]},'data':{'type':Sequelize[_0x8cf8('0x1')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8714=['TEXT','sequelize','exports','STRING'];(function(_0x126c0d,_0x1644a5){var _0x299c58=function(_0x2f5a42){while(--_0x2f5a42){_0x126c0d['push'](_0x126c0d['shift']());}};_0x299c58(++_0x1644a5);}(_0x8714,0x8d));var _0x4871=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x8714[_0x2576d7];return _0x16a08c;};'use strict';var Sequelize=require(_0x4871('0x0'));module[_0x4871('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x4871('0x2')]},'data':{'type':Sequelize[_0x4871('0x3')]},'project_name':{'type':Sequelize[_0x4871('0x2')]},'callerid':{'type':Sequelize[_0x4871('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 1f342a1..0940a07 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 _0xb34d=['fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','where','merge','type','filter','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','SquareDetailsReport','rawAttributes'];(function(_0x64a51,_0x1c61b7){var _0x1eba45=function(_0x230cf8){while(--_0x230cf8){_0x64a51['push'](_0x64a51['shift']());}};_0x1eba45(++_0x1c61b7);}(_0xb34d,0x14f));var _0xdb34=function(_0x58c1d4,_0x50b6cf){_0x58c1d4=_0x58c1d4-0x0;var _0x537b7c=_0xb34d[_0x58c1d4];return _0x537b7c;};'use strict';var emlformat=require(_0xdb34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb34('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb34('0x2'));var moment=require(_0xdb34('0x3'));var BPromise=require(_0xdb34('0x4'));var Mustache=require(_0xdb34('0x5'));var util=require(_0xdb34('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xdb34('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb34('0x8'));var squel=require(_0xdb34('0x9'));var crypto=require(_0xdb34('0xa'));var jsforce=require(_0xdb34('0xb'));var deskjs=require(_0xdb34('0xc'));var toCsv=require(_0xdb34('0x7'));var querystring=require(_0xdb34('0xd'));var Papa=require(_0xdb34('0xe'));var Redis=require(_0xdb34('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdb34('0x10'));var as=require(_0xdb34('0x11'));var hardwareService=require(_0xdb34('0x12'));var logger=require(_0xdb34('0x13'))(_0xdb34('0x14'));var utils=require(_0xdb34('0x15'));var config=require(_0xdb34('0x16'));var licenseUtil=require(_0xdb34('0x17'));var db=require(_0xdb34('0x18'))['db'];function respondWithStatusCode(_0x529c62,_0xd88cee){_0xd88cee=_0xd88cee||0xcc;return function(_0x27a8af){if(_0x27a8af){return _0x529c62['sendStatus'](_0xd88cee);}return _0x529c62[_0xdb34('0x19')](_0xd88cee)[_0xdb34('0x1a')]();};}function respondWithResult(_0x960b6,_0x17c95f){_0x17c95f=_0x17c95f||0xc8;return function(_0x2d3607){if(_0x2d3607){return _0x960b6[_0xdb34('0x19')](_0x17c95f)[_0xdb34('0x1b')](_0x2d3607);}};}function respondWithFilteredResult(_0x55b9a6,_0x11ec1b){return function(_0x45b398){if(_0x45b398){var _0x3761a6=typeof _0x11ec1b[_0xdb34('0x1c')]===_0xdb34('0x1d')&&typeof _0x11ec1b[_0xdb34('0x1e')]===_0xdb34('0x1d');var _0x2423a9=_0x45b398[_0xdb34('0x1f')];var _0x3774b7=_0x3761a6?0x0:_0x11ec1b[_0xdb34('0x1c')];var _0x143c5b=_0x3761a6?_0x45b398['count']:_0x11ec1b[_0xdb34('0x1c')]+_0x11ec1b[_0xdb34('0x1e')];var _0x3cd9f6;if(_0x143c5b>=_0x2423a9){_0x143c5b=_0x2423a9;_0x3cd9f6=0xc8;}else{_0x3cd9f6=0xce;}_0x55b9a6[_0xdb34('0x19')](_0x3cd9f6);return _0x55b9a6[_0xdb34('0x20')](_0xdb34('0x21'),_0x3774b7+'-'+_0x143c5b+'/'+_0x2423a9)[_0xdb34('0x1b')](_0x45b398);}return null;};}function patchUpdates(_0x5da372){return function(_0x7db880){try{jsonpatch[_0xdb34('0x22')](_0x7db880,_0x5da372,!![]);}catch(_0x5bfc6e){return BPromise['reject'](_0x5bfc6e);}return _0x7db880[_0xdb34('0x23')]();};}function saveUpdates(_0x1c301c,_0x1f26f3){return function(_0x48079c){if(_0x48079c){return _0x48079c[_0xdb34('0x24')](_0x1c301c)[_0xdb34('0x25')](function(_0x16761c){return _0x16761c;});}return null;};}function removeEntity(_0x322dfc,_0x5502e9){return function(_0xfda6b7){if(_0xfda6b7){return _0xfda6b7[_0xdb34('0x26')]()[_0xdb34('0x25')](function(){_0x322dfc[_0xdb34('0x19')](0xcc)[_0xdb34('0x1a')]();});}};}function handleEntityNotFound(_0x1a453e,_0x2ea3f3){return function(_0x51723d){if(!_0x51723d){_0x1a453e['sendStatus'](0x194);}return _0x51723d;};}function handleError(_0x1da754,_0x249fca){_0x249fca=_0x249fca||0x1f4;return function(_0x452068){logger[_0xdb34('0x27')](_0x452068['stack']);if(_0x452068[_0xdb34('0x28')]){delete _0x452068[_0xdb34('0x28')];}_0x1da754[_0xdb34('0x19')](_0x249fca)[_0xdb34('0x29')](_0x452068);};}exports[_0xdb34('0x2a')]=function(_0x4fee01,_0x8147d7){var _0x54338d={},_0xae7d45={},_0x1ecf6e={'count':0x0,'rows':[]};var _0x507dad=_['map'](db[_0xdb34('0x2b')][_0xdb34('0x2c')],function(_0x49e1ee){return{'name':_0x49e1ee[_0xdb34('0x2d')],'type':_0x49e1ee['type'][_0xdb34('0x2e')]};});_0xae7d45[_0xdb34('0x2f')]=_[_0xdb34('0x30')](_0x507dad,_0xdb34('0x28'));_0xae7d45[_0xdb34('0x31')]=_[_0xdb34('0x32')](_0x4fee01[_0xdb34('0x31')]);_0xae7d45[_0xdb34('0x33')]=_[_0xdb34('0x34')](_0xae7d45[_0xdb34('0x2f')],_0xae7d45['query']);_0x54338d[_0xdb34('0x35')]=_[_0xdb34('0x34')](_0xae7d45['model'],qs[_0xdb34('0x36')](_0x4fee01[_0xdb34('0x31')][_0xdb34('0x36')]));_0x54338d[_0xdb34('0x35')]=_0x54338d[_0xdb34('0x35')]['length']?_0x54338d[_0xdb34('0x35')]:_0xae7d45[_0xdb34('0x2f')];if(!_0x4fee01[_0xdb34('0x31')][_0xdb34('0x37')](_0xdb34('0x38'))){_0x54338d[_0xdb34('0x1e')]=qs['limit'](_0x4fee01[_0xdb34('0x31')][_0xdb34('0x1e')]);_0x54338d['offset']=qs[_0xdb34('0x1c')](_0x4fee01['query']['offset']);}_0x54338d[_0xdb34('0x39')]=qs['sort'](_0x4fee01[_0xdb34('0x31')]['sort']);_0x54338d['where']=qs[_0xdb34('0x33')](_[_0xdb34('0x3a')](_0x4fee01[_0xdb34('0x31')],_0xae7d45[_0xdb34('0x33')]),_0x507dad);if(_0x4fee01[_0xdb34('0x31')]['filter']){_0x54338d[_0xdb34('0x3b')]=_[_0xdb34('0x3c')](_0x54338d['where'],{'$or':_[_0xdb34('0x30')](_0x507dad,function(_0x33694c){if(_0x33694c[_0xdb34('0x3d')]!=='VIRTUAL'){var _0x341586={};_0x341586[_0x33694c[_0xdb34('0x28')]]={'$like':'%'+_0x4fee01[_0xdb34('0x31')][_0xdb34('0x3e')]+'%'};return _0x341586;}})});}_0x54338d=_[_0xdb34('0x3c')]({},_0x54338d,_0x4fee01[_0xdb34('0x3f')]);var _0x4c761d={'where':_0x54338d[_0xdb34('0x3b')]};return db[_0xdb34('0x2b')][_0xdb34('0x1f')](_0x4c761d)['then'](function(_0x4609e2){_0x1ecf6e[_0xdb34('0x1f')]=_0x4609e2;if(_0x4fee01[_0xdb34('0x31')][_0xdb34('0x40')]){_0x54338d['include']=[{'all':!![]}];}return db[_0xdb34('0x2b')][_0xdb34('0x41')](_0x54338d);})['then'](function(_0x5366f0){_0x1ecf6e[_0xdb34('0x42')]=_0x5366f0;return _0x1ecf6e;})[_0xdb34('0x25')](respondWithFilteredResult(_0x8147d7,_0x54338d))[_0xdb34('0x43')](handleError(_0x8147d7,null));};exports[_0xdb34('0x44')]=function(_0x22c011,_0x5cec81){var _0x451921={'raw':!![],'where':{'id':_0x22c011[_0xdb34('0x45')]['id']}},_0x2da868={};_0x2da868[_0xdb34('0x2f')]=_[_0xdb34('0x32')](db['SquareDetailsReport'][_0xdb34('0x2c')]);_0x2da868[_0xdb34('0x31')]=_[_0xdb34('0x32')](_0x22c011['query']);_0x2da868[_0xdb34('0x33')]=_[_0xdb34('0x34')](_0x2da868[_0xdb34('0x2f')],_0x2da868[_0xdb34('0x31')]);_0x451921[_0xdb34('0x35')]=_['intersection'](_0x2da868[_0xdb34('0x2f')],qs['fields'](_0x22c011[_0xdb34('0x31')][_0xdb34('0x36')]));_0x451921['attributes']=_0x451921[_0xdb34('0x35')][_0xdb34('0x46')]?_0x451921[_0xdb34('0x35')]:_0x2da868['model'];if(_0x22c011['query'][_0xdb34('0x40')]){_0x451921[_0xdb34('0x47')]=[{'all':!![]}];}_0x451921=_[_0xdb34('0x3c')]({},_0x451921,_0x22c011[_0xdb34('0x3f')]);return db[_0xdb34('0x2b')][_0xdb34('0x48')](_0x451921)[_0xdb34('0x25')](handleEntityNotFound(_0x5cec81,null))[_0xdb34('0x25')](respondWithResult(_0x5cec81,null))[_0xdb34('0x43')](handleError(_0x5cec81,null));};exports[_0xdb34('0x49')]=function(_0x576d64,_0x559607){return db['SquareDetailsReport']['create'](_0x576d64['body'],{})['then'](respondWithResult(_0x559607,0xc9))['catch'](handleError(_0x559607,null));};exports[_0xdb34('0x24')]=function(_0x406f77,_0x5ed5b9){if(_0x406f77[_0xdb34('0x4a')]['id']){delete _0x406f77[_0xdb34('0x4a')]['id'];}return db[_0xdb34('0x2b')]['find']({'where':{'id':_0x406f77['params']['id']}})[_0xdb34('0x25')](handleEntityNotFound(_0x5ed5b9,null))[_0xdb34('0x25')](saveUpdates(_0x406f77['body'],null))[_0xdb34('0x25')](respondWithResult(_0x5ed5b9,null))['catch'](handleError(_0x5ed5b9,null));};exports[_0xdb34('0x26')]=function(_0x3bf56d,_0x575291){return db[_0xdb34('0x2b')][_0xdb34('0x48')]({'where':{'id':_0x3bf56d[_0xdb34('0x45')]['id']}})[_0xdb34('0x25')](handleEntityNotFound(_0x575291,null))[_0xdb34('0x25')](removeEntity(_0x575291,null))[_0xdb34('0x43')](handleError(_0x575291,null));};exports[_0xdb34('0x4b')]=function(_0x3cd493,_0x3bd44a){return db['SquareDetailsReport']['describe']()['then'](respondWithResult(_0x3bd44a,null))['catch'](handleError(_0x3bd44a,null));}; \ No newline at end of file +var _0xbca8=['mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count','offset','apply','reject','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','query','filters','model','attributes','intersection','fields','length','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','SquareDetailsReport','include','rows','catch','show','params','keys','includeAll','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xbca8,0xcc));var _0x8bca=function(_0x58ba4f,_0x430dee){_0x58ba4f=_0x58ba4f-0x0;var _0x4da18e=_0xbca8[_0x58ba4f];return _0x4da18e;};'use strict';var emlformat=require(_0x8bca('0x0'));var rimraf=require(_0x8bca('0x1'));var zipdir=require(_0x8bca('0x2'));var jsonpatch=require(_0x8bca('0x3'));var rp=require(_0x8bca('0x4'));var moment=require('moment');var BPromise=require(_0x8bca('0x5'));var Mustache=require(_0x8bca('0x6'));var util=require(_0x8bca('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8bca('0x8'));var ejs=require(_0x8bca('0x9'));var fs=require('fs');var fs_extra=require(_0x8bca('0xa'));var _=require(_0x8bca('0xb'));var squel=require('squel');var crypto=require(_0x8bca('0xc'));var jsforce=require(_0x8bca('0xd'));var deskjs=require(_0x8bca('0xe'));var toCsv=require(_0x8bca('0x8'));var querystring=require(_0x8bca('0xf'));var Papa=require(_0x8bca('0x10'));var Redis=require(_0x8bca('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8bca('0x12'));var hardwareService=require(_0x8bca('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x8bca('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8bca('0x15'));var db=require(_0x8bca('0x16'))['db'];function respondWithStatusCode(_0x5eec01,_0x62c6d1){_0x62c6d1=_0x62c6d1||0xcc;return function(_0x1fe1b5){if(_0x1fe1b5){return _0x5eec01[_0x8bca('0x17')](_0x62c6d1);}return _0x5eec01[_0x8bca('0x18')](_0x62c6d1)['end']();};}function respondWithResult(_0x4bbf5c,_0x250d09){_0x250d09=_0x250d09||0xc8;return function(_0x59b65b){if(_0x59b65b){return _0x4bbf5c[_0x8bca('0x18')](_0x250d09)[_0x8bca('0x19')](_0x59b65b);}};}function respondWithFilteredResult(_0x145cfd,_0x2e3633){return function(_0x1c3590){if(_0x1c3590){var _0x1c78d5=typeof _0x2e3633['offset']==='undefined'&&typeof _0x2e3633[_0x8bca('0x1a')]==='undefined';var _0x2bd7b1=_0x1c3590[_0x8bca('0x1b')];var _0x4e24c8=_0x1c78d5?0x0:_0x2e3633['offset'];var _0x5622ba=_0x1c78d5?_0x1c3590[_0x8bca('0x1b')]:_0x2e3633[_0x8bca('0x1c')]+_0x2e3633['limit'];var _0x1a834c;if(_0x5622ba>=_0x2bd7b1){_0x5622ba=_0x2bd7b1;_0x1a834c=0xc8;}else{_0x1a834c=0xce;}_0x145cfd['status'](_0x1a834c);return _0x145cfd['set']('Content-Range',_0x4e24c8+'-'+_0x5622ba+'/'+_0x2bd7b1)[_0x8bca('0x19')](_0x1c3590);}return null;};}function patchUpdates(_0x17046f){return function(_0xdafaa1){try{jsonpatch[_0x8bca('0x1d')](_0xdafaa1,_0x17046f,!![]);}catch(_0x2d64cd){return BPromise[_0x8bca('0x1e')](_0x2d64cd);}return _0xdafaa1['save']();};}function saveUpdates(_0x315a59,_0x20dc10){return function(_0xf3296b){if(_0xf3296b){return _0xf3296b['update'](_0x315a59)[_0x8bca('0x1f')](function(_0x5ac207){return _0x5ac207;});}return null;};}function removeEntity(_0x1f014d,_0x4e4bff){return function(_0x2e3522){if(_0x2e3522){return _0x2e3522[_0x8bca('0x20')]()[_0x8bca('0x1f')](function(){_0x1f014d[_0x8bca('0x18')](0xcc)[_0x8bca('0x21')]();});}};}function handleEntityNotFound(_0x3a7498,_0x2dc5c8){return function(_0x5f056b){if(!_0x5f056b){_0x3a7498['sendStatus'](0x194);}return _0x5f056b;};}function handleError(_0x1e911a,_0x1feba3){_0x1feba3=_0x1feba3||0x1f4;return function(_0x4c10db){logger[_0x8bca('0x22')](_0x4c10db[_0x8bca('0x23')]);if(_0x4c10db[_0x8bca('0x24')]){delete _0x4c10db[_0x8bca('0x24')];}_0x1e911a[_0x8bca('0x18')](_0x1feba3)['send'](_0x4c10db);};}exports[_0x8bca('0x25')]=function(_0x58bfda,_0x18c7f2){var _0x4e8525={},_0x18ff94={},_0x134f1d={'count':0x0,'rows':[]};var _0x1405a2=_[_0x8bca('0x26')](db['SquareDetailsReport'][_0x8bca('0x27')],function(_0x429c3a){return{'name':_0x429c3a[_0x8bca('0x28')],'type':_0x429c3a['type']['key']};});_0x18ff94['model']=_[_0x8bca('0x26')](_0x1405a2,_0x8bca('0x24'));_0x18ff94[_0x8bca('0x29')]=_['keys'](_0x58bfda[_0x8bca('0x29')]);_0x18ff94[_0x8bca('0x2a')]=_['intersection'](_0x18ff94[_0x8bca('0x2b')],_0x18ff94[_0x8bca('0x29')]);_0x4e8525[_0x8bca('0x2c')]=_[_0x8bca('0x2d')](_0x18ff94[_0x8bca('0x2b')],qs['fields'](_0x58bfda[_0x8bca('0x29')][_0x8bca('0x2e')]));_0x4e8525[_0x8bca('0x2c')]=_0x4e8525[_0x8bca('0x2c')][_0x8bca('0x2f')]?_0x4e8525['attributes']:_0x18ff94[_0x8bca('0x2b')];if(!_0x58bfda['query']['hasOwnProperty'](_0x8bca('0x30'))){_0x4e8525[_0x8bca('0x1a')]=qs['limit'](_0x58bfda['query'][_0x8bca('0x1a')]);_0x4e8525[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x58bfda['query'][_0x8bca('0x1c')]);}_0x4e8525['order']=qs[_0x8bca('0x31')](_0x58bfda[_0x8bca('0x29')]['sort']);_0x4e8525[_0x8bca('0x32')]=qs[_0x8bca('0x2a')](_[_0x8bca('0x33')](_0x58bfda['query'],_0x18ff94[_0x8bca('0x2a')]),_0x1405a2);if(_0x58bfda[_0x8bca('0x29')]['filter']){_0x4e8525['where']=_[_0x8bca('0x34')](_0x4e8525[_0x8bca('0x32')],{'$or':_['map'](_0x1405a2,function(_0x549c7b){if(_0x549c7b[_0x8bca('0x35')]!==_0x8bca('0x36')){var _0x38bf1d={};_0x38bf1d[_0x549c7b[_0x8bca('0x24')]]={'$like':'%'+_0x58bfda[_0x8bca('0x29')][_0x8bca('0x37')]+'%'};return _0x38bf1d;}})});}_0x4e8525=_['merge']({},_0x4e8525,_0x58bfda[_0x8bca('0x38')]);var _0x1eabe2={'where':_0x4e8525[_0x8bca('0x32')]};return db[_0x8bca('0x39')][_0x8bca('0x1b')](_0x1eabe2)[_0x8bca('0x1f')](function(_0x3f4e52){_0x134f1d[_0x8bca('0x1b')]=_0x3f4e52;if(_0x58bfda['query']['includeAll']){_0x4e8525[_0x8bca('0x3a')]=[{'all':!![]}];}return db[_0x8bca('0x39')]['findAll'](_0x4e8525);})[_0x8bca('0x1f')](function(_0x2bc3ff){_0x134f1d[_0x8bca('0x3b')]=_0x2bc3ff;return _0x134f1d;})[_0x8bca('0x1f')](respondWithFilteredResult(_0x18c7f2,_0x4e8525))[_0x8bca('0x3c')](handleError(_0x18c7f2,null));};exports[_0x8bca('0x3d')]=function(_0x237584,_0x44d2af){var _0x19dbfe={'raw':!![],'where':{'id':_0x237584[_0x8bca('0x3e')]['id']}},_0x4b2839={};_0x4b2839['model']=_[_0x8bca('0x3f')](db[_0x8bca('0x39')][_0x8bca('0x27')]);_0x4b2839[_0x8bca('0x29')]=_[_0x8bca('0x3f')](_0x237584[_0x8bca('0x29')]);_0x4b2839['filters']=_[_0x8bca('0x2d')](_0x4b2839[_0x8bca('0x2b')],_0x4b2839['query']);_0x19dbfe[_0x8bca('0x2c')]=_['intersection'](_0x4b2839['model'],qs['fields'](_0x237584['query'][_0x8bca('0x2e')]));_0x19dbfe[_0x8bca('0x2c')]=_0x19dbfe[_0x8bca('0x2c')][_0x8bca('0x2f')]?_0x19dbfe['attributes']:_0x4b2839[_0x8bca('0x2b')];if(_0x237584[_0x8bca('0x29')][_0x8bca('0x40')]){_0x19dbfe[_0x8bca('0x3a')]=[{'all':!![]}];}_0x19dbfe=_['merge']({},_0x19dbfe,_0x237584[_0x8bca('0x38')]);return db[_0x8bca('0x39')][_0x8bca('0x41')](_0x19dbfe)[_0x8bca('0x1f')](handleEntityNotFound(_0x44d2af,null))[_0x8bca('0x1f')](respondWithResult(_0x44d2af,null))[_0x8bca('0x3c')](handleError(_0x44d2af,null));};exports[_0x8bca('0x42')]=function(_0x30c781,_0x4b8ce1){return db[_0x8bca('0x39')][_0x8bca('0x42')](_0x30c781['body'],{})['then'](respondWithResult(_0x4b8ce1,0xc9))[_0x8bca('0x3c')](handleError(_0x4b8ce1,null));};exports[_0x8bca('0x43')]=function(_0x41379f,_0x58a6c0){if(_0x41379f[_0x8bca('0x44')]['id']){delete _0x41379f[_0x8bca('0x44')]['id'];}return db['SquareDetailsReport'][_0x8bca('0x41')]({'where':{'id':_0x41379f[_0x8bca('0x3e')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x58a6c0,null))[_0x8bca('0x1f')](saveUpdates(_0x41379f['body'],null))[_0x8bca('0x1f')](respondWithResult(_0x58a6c0,null))[_0x8bca('0x3c')](handleError(_0x58a6c0,null));};exports['destroy']=function(_0x3174b0,_0x1eae5a){return db[_0x8bca('0x39')]['find']({'where':{'id':_0x3174b0['params']['id']}})['then'](handleEntityNotFound(_0x1eae5a,null))[_0x8bca('0x1f')](removeEntity(_0x1eae5a,null))['catch'](handleError(_0x1eae5a,null));};exports[_0x8bca('0x45')]=function(_0x3927db,_0x598708){return db[_0x8bca('0x39')][_0x8bca('0x45')]()['then'](respondWithResult(_0x598708,null))[_0x8bca('0x3c')](handleError(_0x598708,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 1e1306d..0039f07 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 _0x6684=['../../config/environment','exports','define','SquareDetailsReport','report_square_details','util','request-promise','rimraf'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x6684,0x1ad));var _0x4668=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0x6684[_0x476c7];return _0x47ae56;};'use strict';var _=require('lodash');var util=require(_0x4668('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4668('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4668('0x2'));var config=require(_0x4668('0x3'));var attributes=require('./squareReportDetail.attributes');module[_0x4668('0x4')]=function(_0x2723cb,_0xff9617){return _0x2723cb[_0x4668('0x5')](_0x4668('0x6'),attributes,{'tableName':_0x4668('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc43=['define','SquareDetailsReport','report_square_details','lodash','util','api','moment','bluebird','request-promise','path','./squareReportDetail.attributes','exports'];(function(_0x338d60,_0x3ae251){var _0x1bc68c=function(_0x4574a3){while(--_0x4574a3){_0x338d60['push'](_0x338d60['shift']());}};_0x1bc68c(++_0x3ae251);}(_0xbc43,0xf3));var _0x3bc4=function(_0xec306d,_0x2c44af){_0xec306d=_0xec306d-0x0;var _0x4fd78a=_0xbc43[_0xec306d];return _0x4fd78a;};'use strict';var _=require(_0x3bc4('0x0'));var util=require(_0x3bc4('0x1'));var logger=require('../../config/logger')(_0x3bc4('0x2'));var moment=require(_0x3bc4('0x3'));var BPromise=require(_0x3bc4('0x4'));var rp=require(_0x3bc4('0x5'));var fs=require('fs');var path=require(_0x3bc4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3bc4('0x7'));module[_0x3bc4('0x8')]=function(_0x576859,_0x40ebae){return _0x576859[_0x3bc4('0x9')](_0x3bc4('0xa'),attributes,{'tableName':_0x3bc4('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 38e78bf..3e37d1c 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 _0x2884=['then','info','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','body','options','raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x1f4026,_0x5ef5a4){var _0x5f5525=function(_0xacc1bb){while(--_0xacc1bb){_0x1f4026['push'](_0x1f4026['shift']());}};_0x5f5525(++_0x5ef5a4);}(_0x2884,0x1eb));var _0x4288=function(_0x1bf639,_0x864d54){_0x1bf639=_0x1bf639-0x0;var _0x553079=_0x2884[_0x1bf639];return _0x553079;};'use strict';var _=require(_0x4288('0x0'));var util=require('util');var moment=require(_0x4288('0x1'));var BPromise=require(_0x4288('0x2'));var rs=require(_0x4288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4288('0x4'))['db'];var utils=require(_0x4288('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4288('0x6'));var jayson=require(_0x4288('0x7'));var client=jayson[_0x4288('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x526a07,_0x3a930e,_0x5e4cfc){return new BPromise(function(_0x25023a,_0x237b02){return client['request'](_0x526a07,_0x5e4cfc)[_0x4288('0x9')](function(_0x3c8d6e){logger[_0x4288('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x3a930e,'request\x20sent');logger[_0x4288('0xb')](_0x4288('0xc'),_0x3a930e,_0x4288('0xd'),JSON[_0x4288('0xe')](_0x3c8d6e));if(_0x3c8d6e[_0x4288('0xf')]){if(_0x3c8d6e[_0x4288('0xf')][_0x4288('0x10')]===0x1f4){logger['error'](_0x4288('0x11'),_0x3a930e,_0x3c8d6e[_0x4288('0xf')][_0x4288('0x12')]);return _0x237b02(_0x3c8d6e[_0x4288('0xf')]['message']);}logger[_0x4288('0xf')](_0x4288('0x11'),_0x3a930e,_0x3c8d6e['error'][_0x4288('0x12')]);return _0x25023a(_0x3c8d6e['error'][_0x4288('0x12')]);}else{logger['info'](_0x4288('0x11'),_0x3a930e,_0x4288('0xd'));_0x25023a(_0x3c8d6e[_0x4288('0x13')][_0x4288('0x12')]);}})[_0x4288('0x14')](function(_0x1db33b){logger[_0x4288('0xf')](_0x4288('0x11'),_0x3a930e,_0x1db33b);_0x237b02(_0x1db33b);});});}exports[_0x4288('0x15')]=function(_0x53fb81){var _0x199919=this;return new Promise(function(_0xde03f4,_0x5e6de1){return db['SquareDetailsReport']['create'](_0x53fb81[_0x4288('0x16')],{'raw':_0x53fb81[_0x4288('0x17')]?_0x53fb81['options'][_0x4288('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x865365){logger[_0x4288('0xa')](_0x4288('0x15'),_0x53fb81);logger['debug'](_0x4288('0x15'),_0x53fb81,JSON[_0x4288('0xe')](_0x865365));_0xde03f4(_0x865365);})[_0x4288('0x14')](function(_0x4b9cda){logger['error'](_0x4288('0x15'),_0x4b9cda[_0x4288('0x12')],_0x53fb81);_0x5e6de1(_0x199919[_0x4288('0xf')](0x1f4,_0x4b9cda[_0x4288('0x12')]));});});}; \ No newline at end of file +var _0x8f4c=['SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x160984,_0x4e036e){var _0x3d13d6=function(_0x4f881a){while(--_0x4f881a){_0x160984['push'](_0x160984['shift']());}};_0x3d13d6(++_0x4e036e);}(_0x8f4c,0x113));var _0xc8f4=function(_0x598be5,_0x5745b8){_0x598be5=_0x598be5-0x0;var _0x12672a=_0x8f4c[_0x598be5];return _0x12672a;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));var BPromise=require(_0xc8f4('0x3'));var rs=require(_0xc8f4('0x4'));var fs=require('fs');var Redis=require(_0xc8f4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8f4('0x6'));var logger=require(_0xc8f4('0x7'))(_0xc8f4('0x8'));var config=require('../../config/environment');var jayson=require(_0xc8f4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x520063,_0x373506,_0x48c39d){return new BPromise(function(_0x3ea9a2,_0x3a9ab1){return client[_0xc8f4('0xa')](_0x520063,_0x48c39d)[_0xc8f4('0xb')](function(_0x34f05f){logger['info'](_0xc8f4('0xc'),_0x373506,_0xc8f4('0xd'));logger[_0xc8f4('0xe')](_0xc8f4('0xf'),_0x373506,'request\x20sent',JSON[_0xc8f4('0x10')](_0x34f05f));if(_0x34f05f['error']){if(_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x12')]===0x1f4){logger[_0xc8f4('0x11')](_0xc8f4('0xc'),_0x373506,_0x34f05f[_0xc8f4('0x11')]['message']);return _0x3a9ab1(_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x13')]);}logger[_0xc8f4('0x11')](_0xc8f4('0xc'),_0x373506,_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x13')]);return _0x3ea9a2(_0x34f05f['error'][_0xc8f4('0x13')]);}else{logger[_0xc8f4('0x14')](_0xc8f4('0xc'),_0x373506,_0xc8f4('0xd'));_0x3ea9a2(_0x34f05f[_0xc8f4('0x15')]['message']);}})[_0xc8f4('0x16')](function(_0x4d2b77){logger['error'](_0xc8f4('0xc'),_0x373506,_0x4d2b77);_0x3a9ab1(_0x4d2b77);});});}exports[_0xc8f4('0x17')]=function(_0x108076){var _0x7bb973=this;return new Promise(function(_0x4763c1,_0x374761){return db[_0xc8f4('0x18')][_0xc8f4('0x19')](_0x108076[_0xc8f4('0x1a')],{'raw':_0x108076[_0xc8f4('0x1b')]?_0x108076[_0xc8f4('0x1b')][_0xc8f4('0x1c')]===undefined?!![]:![]:!![]})[_0xc8f4('0xb')](function(_0x5f3264){logger[_0xc8f4('0x14')](_0xc8f4('0x17'),_0x108076);logger[_0xc8f4('0xe')](_0xc8f4('0x17'),_0x108076,JSON[_0xc8f4('0x10')](_0x5f3264));_0x4763c1(_0x5f3264);})[_0xc8f4('0x16')](function(_0xaeee7d){logger[_0xc8f4('0x11')]('CreateSquareDetailsReport',_0xaeee7d[_0xc8f4('0x13')],_0x108076);_0x374761(_0x7bb973[_0xc8f4('0x11')](0x1f4,_0xaeee7d[_0xc8f4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 0e7e9eb..779218e 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 _0x6cdd=['../../components/auth/service','./system.controller','index','get','/process/:pid/kill','isAuthenticated','killProcess','express'];(function(_0x2eff1f,_0x35c0cc){var _0x4de64a=function(_0x43a03e){while(--_0x43a03e){_0x2eff1f['push'](_0x2eff1f['shift']());}};_0x4de64a(++_0x35c0cc);}(_0x6cdd,0x1a7));var _0xd6cd=function(_0x53bc8c,_0x59ac9a){_0x53bc8c=_0x53bc8c-0x0;var _0x318950=_0x6cdd[_0x53bc8c];return _0x318950;};'use strict';var express=require(_0xd6cd('0x0'));var router=express['Router']();var auth=require(_0xd6cd('0x1'));var controller=require(_0xd6cd('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0xd6cd('0x3')]);router[_0xd6cd('0x4')](_0xd6cd('0x5'),auth[_0xd6cd('0x6')](),controller[_0xd6cd('0x7')]);module['exports']=router; \ No newline at end of file +var _0x7ad9=['express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x7ad9,0x1f4));var _0x97ad=function(_0x1a4876,_0x244b5c){_0x1a4876=_0x1a4876-0x0;var _0x457bcc=_0x7ad9[_0x1a4876];return _0x457bcc;};'use strict';var express=require(_0x97ad('0x0'));var router=express[_0x97ad('0x1')]();var auth=require(_0x97ad('0x2'));var controller=require(_0x97ad('0x3'));router[_0x97ad('0x4')]('/',auth[_0x97ad('0x5')](),controller[_0x97ad('0x6')]);router[_0x97ad('0x4')](_0x97ad('0x7'),auth[_0x97ad('0x5')](),controller[_0x97ad('0x8')]);module[_0x97ad('0x9')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index a52e732..85b8085 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 _0x8248=['../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','then','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','json','systeminformation','exec'];(function(_0x262329,_0x265c32){var _0x4310c1=function(_0x16a642){while(--_0x16a642){_0x262329['push'](_0x262329['shift']());}};_0x4310c1(++_0x265c32);}(_0x8248,0x116));var _0x8824=function(_0x3bf806,_0x104f43){_0x3bf806=_0x3bf806-0x0;var _0x1ffb67=_0x8248[_0x3bf806];return _0x1ffb67;};'use strict';var info=require(_0x8824('0x0'));var exec=require('child_process')[_0x8824('0x1')];var logger=require(_0x8824('0x2'))(_0x8824('0x3'));var util=require(_0x8824('0x4'));var BPromise=require(_0x8824('0x5'));var _=require(_0x8824('0x6'));function handleError(_0x2112c5,_0x4f5f86,_0x3351e2){_0x4f5f86=_0x4f5f86||0x1f4;return function(_0x4a11d3){logger[_0x8824('0x7')](_0x8824('0x8'),_0x3351e2,_0x4f5f86,util[_0x8824('0x9')](_0x4a11d3,{'showHidden':![],'depth':null}));delete _0x4a11d3[_0x8824('0xa')];_0x2112c5[_0x8824('0xb')](_0x4f5f86)[_0x8824('0xc')](_0x4a11d3);};}exports[_0x8824('0xd')]=function(_0x1c0379,_0x208c11){return info['getAllData']()[_0x8824('0xe')](function(_0x3d1662){return _0x208c11[_0x8824('0xb')](0xc8)['json'](_0x3d1662);})[_0x8824('0xf')](function(_0x486e02){return _0x208c11['status'](0x1f4)['json'](_0x486e02);});};exports[_0x8824('0x10')]=function(_0x5a4534,_0x188e6e){var _0x1d77a7=[_0x8824('0x11')];return new BPromise(function(_0x3a1260,_0x54c82e){return exec(util['format'](_0x8824('0x12'),_0x5a4534[_0x8824('0x13')][_0x8824('0x14')]),function(_0x38c62f,_0x39e973,_0x3a2218){if(_0x38c62f){return _0x54c82e(_0x38c62f);}return _0x3a1260(_0x39e973);});})['then'](function(_0x52d9ee){var _0x429ab8=![];var _0x14474a=_0x52d9ee[_0x8824('0x15')](/\n/);for(var _0x19fd2b=0x0,_0x343a5e=_0x1d77a7[_0x8824('0x16')];_0x19fd2b<_0x343a5e,_0x429ab8===![];_0x19fd2b+=0x1){if(_0x52d9ee['indexOf'](_0x1d77a7[_0x19fd2b])>=0x0){_0x429ab8=!![];}}if(!_0x429ab8){throw new Error(util[_0x8824('0x17')](_0x8824('0x18'),_0x5a4534[_0x8824('0x13')][_0x8824('0x14')]));}process[_0x8824('0x19')](_0x5a4534[_0x8824('0x13')][_0x8824('0x14')],_0x8824('0x1a'));return _0x188e6e[_0x8824('0xb')](0xc8)[_0x8824('0x1b')]({'message':util[_0x8824('0x17')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x5a4534[_0x8824('0x13')][_0x8824('0x14')])});})[_0x8824('0xf')](handleError(_0x188e6e,null,'killProcess'));}; \ No newline at end of file +var _0x4ed8=['send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status'];(function(_0x19a7f6,_0x3abadc){var _0x5831b8=function(_0x555adc){while(--_0x555adc){_0x19a7f6['push'](_0x19a7f6['shift']());}};_0x5831b8(++_0x3abadc);}(_0x4ed8,0x1a8));var _0x84ed=function(_0x13bcdc,_0x5ba593){_0x13bcdc=_0x13bcdc-0x0;var _0x585495=_0x4ed8[_0x13bcdc];return _0x585495;};'use strict';var info=require(_0x84ed('0x0'));var exec=require(_0x84ed('0x1'))['exec'];var logger=require(_0x84ed('0x2'))(_0x84ed('0x3'));var util=require('util');var BPromise=require(_0x84ed('0x4'));var _=require(_0x84ed('0x5'));function handleError(_0x1b1a27,_0x259be5,_0x500317){_0x259be5=_0x259be5||0x1f4;return function(_0x4709e8){logger[_0x84ed('0x6')](_0x84ed('0x7'),_0x500317,_0x259be5,util[_0x84ed('0x8')](_0x4709e8,{'showHidden':![],'depth':null}));delete _0x4709e8[_0x84ed('0x9')];_0x1b1a27[_0x84ed('0xa')](_0x259be5)[_0x84ed('0xb')](_0x4709e8);};}exports[_0x84ed('0xc')]=function(_0x550497,_0xf36d80){return info[_0x84ed('0xd')]()[_0x84ed('0xe')](function(_0x3d253c){return _0xf36d80['status'](0xc8)[_0x84ed('0xf')](_0x3d253c);})[_0x84ed('0x10')](function(_0x2ea61e){return _0xf36d80['status'](0x1f4)[_0x84ed('0xf')](_0x2ea61e);});};exports[_0x84ed('0x11')]=function(_0x3cfd67,_0x3bb069){var _0x2af1b6=[_0x84ed('0x12')];return new BPromise(function(_0x13d6c4,_0x16d402){return exec(util[_0x84ed('0x13')](_0x84ed('0x14'),_0x3cfd67[_0x84ed('0x15')][_0x84ed('0x16')]),function(_0x281129,_0x40ec0c,_0x7ccfcb){if(_0x281129){return _0x16d402(_0x281129);}return _0x13d6c4(_0x40ec0c);});})[_0x84ed('0xe')](function(_0x5548b5){var _0x4344c1=![];var _0x2da4b2=_0x5548b5[_0x84ed('0x17')](/\n/);for(var _0x2c4f5a=0x0,_0x9329=_0x2af1b6['length'];_0x2c4f5a<_0x9329,_0x4344c1===![];_0x2c4f5a+=0x1){if(_0x5548b5[_0x84ed('0x18')](_0x2af1b6[_0x2c4f5a])>=0x0){_0x4344c1=!![];}}if(!_0x4344c1){throw new Error(util[_0x84ed('0x13')](_0x84ed('0x19'),_0x3cfd67[_0x84ed('0x15')]['pid']));}process[_0x84ed('0x1a')](_0x3cfd67[_0x84ed('0x15')][_0x84ed('0x16')],_0x84ed('0x1b'));return _0x3bb069[_0x84ed('0xa')](0xc8)[_0x84ed('0xf')]({'message':util[_0x84ed('0x13')](_0x84ed('0x1c'),_0x3cfd67[_0x84ed('0x15')]['pid'])});})['catch'](handleError(_0x3bb069,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 5fb10d0..f5c5c77 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 _0x16a8=['multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x1f83a5,_0x59843f){var _0x45edf0=function(_0x431e25){while(--_0x431e25){_0x1f83a5['push'](_0x1f83a5['shift']());}};_0x45edf0(++_0x59843f);}(_0x16a8,0xb4));var _0x816a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x16a8[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0x816a('0x0'));var util=require('util');var path=require(_0x816a('0x1'));var timeout=require(_0x816a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x816a('0x3'));var auth=require(_0x816a('0x4'));var interaction=require(_0x816a('0x5'));var config=require(_0x816a('0x6'));var controller=require(_0x816a('0x7'));router[_0x816a('0x8')]('/',auth[_0x816a('0x9')](),controller[_0x816a('0xa')]);router[_0x816a('0x8')]('/:id',auth[_0x816a('0x9')](),controller[_0x816a('0xb')]);router[_0x816a('0xc')]('/',auth[_0x816a('0x9')](),controller[_0x816a('0xd')]);router[_0x816a('0xe')](_0x816a('0xf'),auth[_0x816a('0x9')](),controller[_0x816a('0x10')]);router[_0x816a('0x11')](_0x816a('0xf'),auth['isAuthenticated'](),controller[_0x816a('0x12')]);module[_0x816a('0x13')]=router; \ No newline at end of file +var _0xe062=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','show','post','put','/:id','update'];(function(_0x37dabd,_0x238162){var _0x5d699a=function(_0x5666e8){while(--_0x5666e8){_0x37dabd['push'](_0x37dabd['shift']());}};_0x5d699a(++_0x238162);}(_0xe062,0x1b8));var _0x2e06=function(_0x123765,_0x2ea510){_0x123765=_0x123765-0x0;var _0x5dc406=_0xe062[_0x123765];return _0x5dc406;};'use strict';var multer=require(_0x2e06('0x0'));var util=require(_0x2e06('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2e06('0x2'));var router=express[_0x2e06('0x3')]();var fs_extra=require(_0x2e06('0x4'));var auth=require(_0x2e06('0x5'));var interaction=require(_0x2e06('0x6'));var config=require(_0x2e06('0x7'));var controller=require(_0x2e06('0x8'));router[_0x2e06('0x9')]('/',auth[_0x2e06('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2e06('0xb')]);router[_0x2e06('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2e06('0xd')](_0x2e06('0xe'),auth[_0x2e06('0xa')](),controller[_0x2e06('0xf')]);router[_0x2e06('0x10')](_0x2e06('0xe'),auth[_0x2e06('0xa')](),controller[_0x2e06('0x11')]);module[_0x2e06('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index fe31734..852aaf4 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 _0x132f=['#0091EA','sequelize','exports','STRING','name'];(function(_0x1383af,_0x29d2c3){var _0xbc03df=function(_0x2cf5cf){while(--_0x2cf5cf){_0x1383af['push'](_0x1383af['shift']());}};_0xbc03df(++_0x29d2c3);}(_0x132f,0x182));var _0xf132=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x132f[_0x4099ee];return _0x1b7bfc;};'use strict';var Sequelize=require(_0xf132('0x0'));module[_0xf132('0x1')]={'name':{'type':Sequelize[_0xf132('0x2')],'unique':_0xf132('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf132('0x2')],'defaultValue':_0xf132('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6b20=['exports','name','#0091EA','STRING','sequelize'];(function(_0xf2e0c5,_0x460e89){var _0x277da5=function(_0x3b0b80){while(--_0x3b0b80){_0xf2e0c5['push'](_0xf2e0c5['shift']());}};_0x277da5(++_0x460e89);}(_0x6b20,0xd1));var _0x06b2=function(_0x437d8d,_0x56f968){_0x437d8d=_0x437d8d-0x0;var _0x525177=_0x6b20[_0x437d8d];return _0x525177;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x06b2('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x06b2('0x3')},'description':{'type':Sequelize[_0x06b2('0x4')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index b25b184..d415bd1 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 _0x61a5=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Tags','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x36192c,_0x477d47){var _0x130a0e=function(_0x36506f){while(--_0x36506f){_0x36192c['push'](_0x36192c['shift']());}};_0x130a0e(++_0x477d47);}(_0x61a5,0xf0));var _0x561a=function(_0x549b29,_0x2e2b00){_0x549b29=_0x549b29-0x0;var _0x2b813f=_0x61a5[_0x549b29];return _0x2b813f;};'use strict';var emlformat=require(_0x561a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x561a('0x1'));var jsonpatch=require(_0x561a('0x2'));var rp=require(_0x561a('0x3'));var moment=require(_0x561a('0x4'));var BPromise=require(_0x561a('0x5'));var Mustache=require('mustache');var util=require(_0x561a('0x6'));var path=require(_0x561a('0x7'));var sox=require('sox');var csv=require(_0x561a('0x8'));var ejs=require(_0x561a('0x9'));var fs=require('fs');var fs_extra=require(_0x561a('0xa'));var _=require(_0x561a('0xb'));var squel=require(_0x561a('0xc'));var crypto=require(_0x561a('0xd'));var jsforce=require(_0x561a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x561a('0x8'));var querystring=require('querystring');var Papa=require(_0x561a('0xf'));var Redis=require(_0x561a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x561a('0x11'));var as=require(_0x561a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x561a('0x13'))('api');var utils=require(_0x561a('0x14'));var config=require(_0x561a('0x15'));var licenseUtil=require(_0x561a('0x16'));var db=require(_0x561a('0x17'))['db'];function respondWithStatusCode(_0x2777c6,_0x3dfa9f){_0x3dfa9f=_0x3dfa9f||0xcc;return function(_0x136465){if(_0x136465){return _0x2777c6[_0x561a('0x18')](_0x3dfa9f);}return _0x2777c6[_0x561a('0x19')](_0x3dfa9f)[_0x561a('0x1a')]();};}function respondWithResult(_0x2a332e,_0x28638b){_0x28638b=_0x28638b||0xc8;return function(_0x5696b9){if(_0x5696b9){return _0x2a332e[_0x561a('0x19')](_0x28638b)[_0x561a('0x1b')](_0x5696b9);}};}function respondWithFilteredResult(_0x1ab5ae,_0xecbcc4){return function(_0xd7f0fb){if(_0xd7f0fb){var _0x28ad8b=typeof _0xecbcc4[_0x561a('0x1c')]===_0x561a('0x1d')&&typeof _0xecbcc4[_0x561a('0x1e')]===_0x561a('0x1d');var _0x19870a=_0xd7f0fb['count'];var _0x43c5aa=_0x28ad8b?0x0:_0xecbcc4[_0x561a('0x1c')];var _0x533d95=_0x28ad8b?_0xd7f0fb[_0x561a('0x1f')]:_0xecbcc4[_0x561a('0x1c')]+_0xecbcc4['limit'];var _0x22c72a;if(_0x533d95>=_0x19870a){_0x533d95=_0x19870a;_0x22c72a=0xc8;}else{_0x22c72a=0xce;}_0x1ab5ae['status'](_0x22c72a);return _0x1ab5ae['set'](_0x561a('0x20'),_0x43c5aa+'-'+_0x533d95+'/'+_0x19870a)[_0x561a('0x1b')](_0xd7f0fb);}return null;};}function patchUpdates(_0x5ca8e9){return function(_0x432b33){try{jsonpatch[_0x561a('0x21')](_0x432b33,_0x5ca8e9,!![]);}catch(_0x1367e2){return BPromise[_0x561a('0x22')](_0x1367e2);}return _0x432b33[_0x561a('0x23')]();};}function saveUpdates(_0x1bb8df,_0x4f9c3a){return function(_0x3e5509){if(_0x3e5509){return _0x3e5509[_0x561a('0x24')](_0x1bb8df)[_0x561a('0x25')](function(_0x527207){return _0x527207;});}return null;};}function removeEntity(_0x58c32f,_0x25b53c){return function(_0x1d29d6){if(_0x1d29d6){return _0x1d29d6[_0x561a('0x26')]()[_0x561a('0x25')](function(){var _0x234771=_0x1d29d6[_0x561a('0x27')]({'plain':!![]});var _0x259963=_0x561a('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x259963,'resourceId':_0x234771['id']}})[_0x561a('0x25')](function(){return _0x1d29d6;});})[_0x561a('0x25')](function(){_0x58c32f[_0x561a('0x19')](0xcc)[_0x561a('0x1a')]();});}};}function handleEntityNotFound(_0x5a0acd,_0x186862){return function(_0x3f0789){if(!_0x3f0789){_0x5a0acd[_0x561a('0x18')](0x194);}return _0x3f0789;};}function handleError(_0x23b489,_0x3bdfa9){_0x3bdfa9=_0x3bdfa9||0x1f4;return function(_0x47f93a){logger[_0x561a('0x29')](_0x47f93a[_0x561a('0x2a')]);if(_0x47f93a['name']){delete _0x47f93a[_0x561a('0x2b')];}_0x23b489[_0x561a('0x19')](_0x3bdfa9)['send'](_0x47f93a);};}exports[_0x561a('0x2c')]=function(_0x591737,_0x54a47a){var _0x3633d2={},_0x3d3cc8={},_0x4e0042={'count':0x0,'rows':[]};var _0x10c24b=_[_0x561a('0x2d')](db[_0x561a('0x2e')][_0x561a('0x2f')],function(_0x169243){return{'name':_0x169243[_0x561a('0x30')],'type':_0x169243[_0x561a('0x31')][_0x561a('0x32')]};});_0x3d3cc8['model']=_[_0x561a('0x2d')](_0x10c24b,_0x561a('0x2b'));_0x3d3cc8[_0x561a('0x33')]=_[_0x561a('0x34')](_0x591737[_0x561a('0x33')]);_0x3d3cc8['filters']=_[_0x561a('0x35')](_0x3d3cc8[_0x561a('0x36')],_0x3d3cc8[_0x561a('0x33')]);_0x3633d2[_0x561a('0x37')]=_['intersection'](_0x3d3cc8[_0x561a('0x36')],qs[_0x561a('0x38')](_0x591737[_0x561a('0x33')]['fields']));_0x3633d2['attributes']=_0x3633d2[_0x561a('0x37')]['length']?_0x3633d2['attributes']:_0x3d3cc8['model'];if(!_0x591737[_0x561a('0x33')][_0x561a('0x39')](_0x561a('0x3a'))){_0x3633d2[_0x561a('0x1e')]=qs[_0x561a('0x1e')](_0x591737[_0x561a('0x33')]['limit']);_0x3633d2['offset']=qs[_0x561a('0x1c')](_0x591737[_0x561a('0x33')][_0x561a('0x1c')]);}_0x3633d2[_0x561a('0x3b')]=qs[_0x561a('0x3c')](_0x591737[_0x561a('0x33')][_0x561a('0x3c')]);_0x3633d2[_0x561a('0x3d')]=qs['filters'](_[_0x561a('0x3e')](_0x591737[_0x561a('0x33')],_0x3d3cc8[_0x561a('0x3f')]),_0x10c24b);if(_0x591737[_0x561a('0x33')]['filter']){_0x3633d2[_0x561a('0x3d')]=_[_0x561a('0x40')](_0x3633d2[_0x561a('0x3d')],{'$or':_['map'](_0x10c24b,function(_0x3ebf2b){if(_0x3ebf2b[_0x561a('0x31')]!==_0x561a('0x41')){var _0x16779d={};_0x16779d[_0x3ebf2b[_0x561a('0x2b')]]={'$like':'%'+_0x591737[_0x561a('0x33')][_0x561a('0x42')]+'%'};return _0x16779d;}})});}_0x3633d2=_['merge']({},_0x3633d2,_0x591737[_0x561a('0x43')]);var _0x2cdad6={'where':_0x3633d2[_0x561a('0x3d')]};return db[_0x561a('0x2e')][_0x561a('0x1f')](_0x2cdad6)[_0x561a('0x25')](function(_0x51e29e){_0x4e0042[_0x561a('0x1f')]=_0x51e29e;if(_0x591737[_0x561a('0x33')][_0x561a('0x44')]){_0x3633d2[_0x561a('0x45')]=[{'all':!![]}];}return db[_0x561a('0x2e')][_0x561a('0x46')](_0x3633d2);})[_0x561a('0x25')](function(_0x32f8bd){_0x4e0042[_0x561a('0x47')]=_0x32f8bd;return _0x4e0042;})['then'](respondWithFilteredResult(_0x54a47a,_0x3633d2))[_0x561a('0x48')](handleError(_0x54a47a,null));};exports[_0x561a('0x49')]=function(_0x5197b1,_0x2eda67){var _0x4b8a16={'raw':!![],'where':{'id':_0x5197b1[_0x561a('0x4a')]['id']}},_0x141971={};_0x141971[_0x561a('0x36')]=_[_0x561a('0x34')](db[_0x561a('0x2e')]['rawAttributes']);_0x141971[_0x561a('0x33')]=_[_0x561a('0x34')](_0x5197b1[_0x561a('0x33')]);_0x141971[_0x561a('0x3f')]=_[_0x561a('0x35')](_0x141971[_0x561a('0x36')],_0x141971['query']);_0x4b8a16['attributes']=_[_0x561a('0x35')](_0x141971['model'],qs['fields'](_0x5197b1['query']['fields']));_0x4b8a16['attributes']=_0x4b8a16[_0x561a('0x37')][_0x561a('0x4b')]?_0x4b8a16[_0x561a('0x37')]:_0x141971['model'];if(_0x5197b1[_0x561a('0x33')]['includeAll']){_0x4b8a16['include']=[{'all':!![]}];}_0x4b8a16=_[_0x561a('0x40')]({},_0x4b8a16,_0x5197b1[_0x561a('0x43')]);return db[_0x561a('0x2e')]['find'](_0x4b8a16)[_0x561a('0x25')](handleEntityNotFound(_0x2eda67,null))['then'](respondWithResult(_0x2eda67,null))[_0x561a('0x48')](handleError(_0x2eda67,null));};exports['create']=function(_0x1bd3df,_0x43d557){return db[_0x561a('0x2e')][_0x561a('0x4c')](_0x1bd3df[_0x561a('0x4d')],{})[_0x561a('0x25')](function(_0x355d4f){var _0x25aaf6=_0x1bd3df[_0x561a('0x4e')]['get']({'plain':!![]});if(!_0x25aaf6)throw new Error(_0x561a('0x4f'));if(_0x25aaf6[_0x561a('0x50')]===_0x561a('0x4e')){var _0x48ed34=_0x355d4f[_0x561a('0x27')]({'plain':!![]});var _0x4583b1='Tags';return db[_0x561a('0x51')][_0x561a('0x52')]({'where':{'name':_0x4583b1,'userProfileId':_0x25aaf6[_0x561a('0x53')]},'raw':!![]})['then'](function(_0x1161e3){if(_0x1161e3&&_0x1161e3[_0x561a('0x54')]===0x0){return db[_0x561a('0x55')][_0x561a('0x4c')]({'name':_0x48ed34[_0x561a('0x2b')],'resourceId':_0x48ed34['id'],'type':_0x1161e3[_0x561a('0x2b')],'sectionId':_0x1161e3['id']},{})[_0x561a('0x25')](function(){return _0x355d4f;});}else{return _0x355d4f;}})['catch'](function(_0x14c7bd){logger[_0x561a('0x29')](_0x561a('0x56'),_0x14c7bd);throw _0x14c7bd;});}return _0x355d4f;})[_0x561a('0x25')](respondWithResult(_0x43d557,0xc9))[_0x561a('0x48')](handleError(_0x43d557,null));};exports[_0x561a('0x24')]=function(_0x3b0a93,_0x5783af){if(_0x3b0a93[_0x561a('0x4d')]['id']){delete _0x3b0a93[_0x561a('0x4d')]['id'];}return db[_0x561a('0x2e')]['find']({'where':{'id':_0x3b0a93[_0x561a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5783af,null))[_0x561a('0x25')](saveUpdates(_0x3b0a93[_0x561a('0x4d')],null))[_0x561a('0x25')](respondWithResult(_0x5783af,null))[_0x561a('0x48')](handleError(_0x5783af,null));};exports[_0x561a('0x26')]=function(_0x27b10c,_0x29d981){return db['Tag']['find']({'where':{'id':_0x27b10c[_0x561a('0x4a')]['id']}})[_0x561a('0x25')](handleEntityNotFound(_0x29d981,null))[_0x561a('0x25')](removeEntity(_0x29d981,null))[_0x561a('0x48')](handleError(_0x29d981,null));}; \ No newline at end of file +var _0x524a=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','Tags','UserProfileResource','destroy','stack','name','index','map','Tag','fieldName','model','query','filters','attributes','intersection','fields','length','limit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format'];(function(_0x5a2299,_0x3e2922){var _0xedff0f=function(_0x1624cb){while(--_0x1624cb){_0x5a2299['push'](_0x5a2299['shift']());}};_0xedff0f(++_0x3e2922);}(_0x524a,0xf5));var _0xa524=function(_0x4e61cf,_0x117ee6){_0x4e61cf=_0x4e61cf-0x0;var _0x127763=_0x524a[_0x4e61cf];return _0x127763;};'use strict';var emlformat=require(_0xa524('0x0'));var rimraf=require(_0xa524('0x1'));var zipdir=require(_0xa524('0x2'));var jsonpatch=require(_0xa524('0x3'));var rp=require('request-promise');var moment=require(_0xa524('0x4'));var BPromise=require(_0xa524('0x5'));var Mustache=require(_0xa524('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa524('0x7'));var csv=require(_0xa524('0x8'));var ejs=require(_0xa524('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa524('0xa'));var squel=require('squel');var crypto=require(_0xa524('0xb'));var jsforce=require(_0xa524('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa524('0x8'));var querystring=require(_0xa524('0xd'));var Papa=require(_0xa524('0xe'));var Redis=require(_0xa524('0xf'));var authService=require(_0xa524('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa524('0x11'));var hardwareService=require(_0xa524('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xa524('0x13'));var config=require(_0xa524('0x14'));var licenseUtil=require(_0xa524('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55117f,_0x14a0d6){_0x14a0d6=_0x14a0d6||0xcc;return function(_0x4aa46d){if(_0x4aa46d){return _0x55117f[_0xa524('0x16')](_0x14a0d6);}return _0x55117f['status'](_0x14a0d6)[_0xa524('0x17')]();};}function respondWithResult(_0x5c7e6a,_0x75bfe8){_0x75bfe8=_0x75bfe8||0xc8;return function(_0x281137){if(_0x281137){return _0x5c7e6a['status'](_0x75bfe8)[_0xa524('0x18')](_0x281137);}};}function respondWithFilteredResult(_0x15b14c,_0xe85361){return function(_0x1de01e){if(_0x1de01e){var _0x45347f=typeof _0xe85361[_0xa524('0x19')]===_0xa524('0x1a')&&typeof _0xe85361['limit']===_0xa524('0x1a');var _0x3d8494=_0x1de01e[_0xa524('0x1b')];var _0x3d6a0d=_0x45347f?0x0:_0xe85361[_0xa524('0x19')];var _0x805b93=_0x45347f?_0x1de01e[_0xa524('0x1b')]:_0xe85361[_0xa524('0x19')]+_0xe85361['limit'];var _0x304dea;if(_0x805b93>=_0x3d8494){_0x805b93=_0x3d8494;_0x304dea=0xc8;}else{_0x304dea=0xce;}_0x15b14c[_0xa524('0x1c')](_0x304dea);return _0x15b14c[_0xa524('0x1d')](_0xa524('0x1e'),_0x3d6a0d+'-'+_0x805b93+'/'+_0x3d8494)['json'](_0x1de01e);}return null;};}function patchUpdates(_0x5510fa){return function(_0x40f4bd){try{jsonpatch[_0xa524('0x1f')](_0x40f4bd,_0x5510fa,!![]);}catch(_0x21e114){return BPromise[_0xa524('0x20')](_0x21e114);}return _0x40f4bd[_0xa524('0x21')]();};}function saveUpdates(_0x3866e2,_0x4abffe){return function(_0x262eac){if(_0x262eac){return _0x262eac[_0xa524('0x22')](_0x3866e2)[_0xa524('0x23')](function(_0x40fb4b){return _0x40fb4b;});}return null;};}function removeEntity(_0x226784,_0x45cdcc){return function(_0x26e931){if(_0x26e931){return _0x26e931['destroy']()[_0xa524('0x23')](function(){var _0x221bf=_0x26e931['get']({'plain':!![]});var _0x47efb3=_0xa524('0x24');return db[_0xa524('0x25')][_0xa524('0x26')]({'where':{'type':_0x47efb3,'resourceId':_0x221bf['id']}})[_0xa524('0x23')](function(){return _0x26e931;});})[_0xa524('0x23')](function(){_0x226784['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aeabc,_0x869b22){return function(_0x1582fa){if(!_0x1582fa){_0x1aeabc[_0xa524('0x16')](0x194);}return _0x1582fa;};}function handleError(_0x505c42,_0x1c84c6){_0x1c84c6=_0x1c84c6||0x1f4;return function(_0x32ba03){logger['error'](_0x32ba03[_0xa524('0x27')]);if(_0x32ba03[_0xa524('0x28')]){delete _0x32ba03['name'];}_0x505c42[_0xa524('0x1c')](_0x1c84c6)['send'](_0x32ba03);};}exports[_0xa524('0x29')]=function(_0x38e051,_0x45b846){var _0x238133={},_0x136e83={},_0x1c706b={'count':0x0,'rows':[]};var _0x4f6133=_[_0xa524('0x2a')](db[_0xa524('0x2b')]['rawAttributes'],function(_0x535e41){return{'name':_0x535e41[_0xa524('0x2c')],'type':_0x535e41['type']['key']};});_0x136e83[_0xa524('0x2d')]=_[_0xa524('0x2a')](_0x4f6133,_0xa524('0x28'));_0x136e83[_0xa524('0x2e')]=_['keys'](_0x38e051['query']);_0x136e83[_0xa524('0x2f')]=_['intersection'](_0x136e83['model'],_0x136e83[_0xa524('0x2e')]);_0x238133[_0xa524('0x30')]=_[_0xa524('0x31')](_0x136e83[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x38e051[_0xa524('0x2e')][_0xa524('0x32')]));_0x238133[_0xa524('0x30')]=_0x238133[_0xa524('0x30')][_0xa524('0x33')]?_0x238133[_0xa524('0x30')]:_0x136e83[_0xa524('0x2d')];if(!_0x38e051['query']['hasOwnProperty']('nolimit')){_0x238133[_0xa524('0x34')]=qs[_0xa524('0x34')](_0x38e051['query'][_0xa524('0x34')]);_0x238133['offset']=qs[_0xa524('0x19')](_0x38e051[_0xa524('0x2e')]['offset']);}_0x238133[_0xa524('0x35')]=qs[_0xa524('0x36')](_0x38e051[_0xa524('0x2e')]['sort']);_0x238133[_0xa524('0x37')]=qs[_0xa524('0x2f')](_['pick'](_0x38e051[_0xa524('0x2e')],_0x136e83[_0xa524('0x2f')]),_0x4f6133);if(_0x38e051['query'][_0xa524('0x38')]){_0x238133[_0xa524('0x37')]=_['merge'](_0x238133[_0xa524('0x37')],{'$or':_[_0xa524('0x2a')](_0x4f6133,function(_0x186395){if(_0x186395[_0xa524('0x39')]!==_0xa524('0x3a')){var _0x38f87a={};_0x38f87a[_0x186395[_0xa524('0x28')]]={'$like':'%'+_0x38e051[_0xa524('0x2e')][_0xa524('0x38')]+'%'};return _0x38f87a;}})});}_0x238133=_[_0xa524('0x3b')]({},_0x238133,_0x38e051[_0xa524('0x3c')]);var _0x51cd09={'where':_0x238133[_0xa524('0x37')]};return db['Tag'][_0xa524('0x1b')](_0x51cd09)[_0xa524('0x23')](function(_0x35d92d){_0x1c706b[_0xa524('0x1b')]=_0x35d92d;if(_0x38e051[_0xa524('0x2e')][_0xa524('0x3d')]){_0x238133[_0xa524('0x3e')]=[{'all':!![]}];}return db[_0xa524('0x2b')][_0xa524('0x3f')](_0x238133);})[_0xa524('0x23')](function(_0x4a87d4){_0x1c706b[_0xa524('0x40')]=_0x4a87d4;return _0x1c706b;})[_0xa524('0x23')](respondWithFilteredResult(_0x45b846,_0x238133))['catch'](handleError(_0x45b846,null));};exports[_0xa524('0x41')]=function(_0x3f5564,_0x4885a4){var _0x492851={'raw':!![],'where':{'id':_0x3f5564['params']['id']}},_0x4dff4b={};_0x4dff4b['model']=_[_0xa524('0x42')](db[_0xa524('0x2b')][_0xa524('0x43')]);_0x4dff4b[_0xa524('0x2e')]=_['keys'](_0x3f5564[_0xa524('0x2e')]);_0x4dff4b[_0xa524('0x2f')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],_0x4dff4b['query']);_0x492851[_0xa524('0x30')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x3f5564[_0xa524('0x2e')]['fields']));_0x492851[_0xa524('0x30')]=_0x492851[_0xa524('0x30')][_0xa524('0x33')]?_0x492851[_0xa524('0x30')]:_0x4dff4b[_0xa524('0x2d')];if(_0x3f5564[_0xa524('0x2e')][_0xa524('0x3d')]){_0x492851[_0xa524('0x3e')]=[{'all':!![]}];}_0x492851=_[_0xa524('0x3b')]({},_0x492851,_0x3f5564['options']);return db['Tag'][_0xa524('0x44')](_0x492851)[_0xa524('0x23')](handleEntityNotFound(_0x4885a4,null))[_0xa524('0x23')](respondWithResult(_0x4885a4,null))[_0xa524('0x45')](handleError(_0x4885a4,null));};exports[_0xa524('0x46')]=function(_0xddc80,_0x56e570){return db[_0xa524('0x2b')][_0xa524('0x46')](_0xddc80[_0xa524('0x47')],{})[_0xa524('0x23')](function(_0x24c7ef){var _0x451bbe=_0xddc80['user'][_0xa524('0x48')]({'plain':!![]});if(!_0x451bbe)throw new Error(_0xa524('0x49'));if(_0x451bbe[_0xa524('0x4a')]===_0xa524('0x4b')){var _0x25ffbd=_0x24c7ef[_0xa524('0x48')]({'plain':!![]});var _0xef18b7=_0xa524('0x24');return db[_0xa524('0x4c')][_0xa524('0x44')]({'where':{'name':_0xef18b7,'userProfileId':_0x451bbe[_0xa524('0x4d')]},'raw':!![]})[_0xa524('0x23')](function(_0x3a374f){if(_0x3a374f&&_0x3a374f[_0xa524('0x4e')]===0x0){return db[_0xa524('0x25')]['create']({'name':_0x25ffbd[_0xa524('0x28')],'resourceId':_0x25ffbd['id'],'type':_0x3a374f[_0xa524('0x28')],'sectionId':_0x3a374f['id']},{})['then'](function(){return _0x24c7ef;});}else{return _0x24c7ef;}})['catch'](function(_0x32844c){logger[_0xa524('0x4f')](_0xa524('0x50'),_0x32844c);throw _0x32844c;});}return _0x24c7ef;})[_0xa524('0x23')](respondWithResult(_0x56e570,0xc9))[_0xa524('0x45')](handleError(_0x56e570,null));};exports[_0xa524('0x22')]=function(_0x121fc5,_0x4e3709){if(_0x121fc5[_0xa524('0x47')]['id']){delete _0x121fc5[_0xa524('0x47')]['id'];}return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x121fc5[_0xa524('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e3709,null))[_0xa524('0x23')](saveUpdates(_0x121fc5['body'],null))[_0xa524('0x23')](respondWithResult(_0x4e3709,null))[_0xa524('0x45')](handleError(_0x4e3709,null));};exports[_0xa524('0x26')]=function(_0x3f5694,_0x161393){return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x3f5694['params']['id']}})['then'](handleEntityNotFound(_0x161393,null))[_0xa524('0x23')](removeEntity(_0x161393,null))[_0xa524('0x45')](handleError(_0x161393,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 208f156..47d089c 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 _0xb90a=['./tag.attributes','exports','define','Tag','tools_tags','lodash','util','api','path','rimraf','../../config/environment'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xb90a,0xec));var _0xab90=function(_0x4f1755,_0xaee50a){_0x4f1755=_0x4f1755-0x0;var _0x246b40=_0xb90a[_0x4f1755];return _0x246b40;};'use strict';var _=require(_0xab90('0x0'));var util=require(_0xab90('0x1'));var logger=require('../../config/logger')(_0xab90('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xab90('0x3'));var rimraf=require(_0xab90('0x4'));var config=require(_0xab90('0x5'));var attributes=require(_0xab90('0x6'));module[_0xab90('0x7')]=function(_0x53cd40,_0x4d5717){return _0x53cd40[_0xab90('0x8')](_0xab90('0x9'),attributes,{'tableName':_0xab90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40f6=['rimraf','./tag.attributes','exports','Tag','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1cc9f1,_0xb3462d){var _0x1099d4=function(_0x586b66){while(--_0x586b66){_0x1cc9f1['push'](_0x1cc9f1['shift']());}};_0x1099d4(++_0xb3462d);}(_0x40f6,0x1e8));var _0x640f=function(_0x5254a2,_0x3be47a){_0x5254a2=_0x5254a2-0x0;var _0x2847f6=_0x40f6[_0x5254a2];return _0x2847f6;};'use strict';var _=require(_0x640f('0x0'));var util=require(_0x640f('0x1'));var logger=require(_0x640f('0x2'))(_0x640f('0x3'));var moment=require(_0x640f('0x4'));var BPromise=require(_0x640f('0x5'));var rp=require(_0x640f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x640f('0x7'));var config=require('../../config/environment');var attributes=require(_0x640f('0x8'));module[_0x640f('0x9')]=function(_0x39bdde,_0x10cec9){return _0x39bdde['define'](_0x640f('0xa'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index c4c3322..b0a4384 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 _0xd13e=['Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2ed421,_0x4696ac){var _0x406c2d=function(_0x28c63d){while(--_0x28c63d){_0x2ed421['push'](_0x2ed421['shift']());}};_0x406c2d(++_0x4696ac);}(_0xd13e,0x193));var _0xed13=function(_0x1b9185,_0x4e8174){_0x1b9185=_0x1b9185-0x0;var _0x476395=_0xd13e[_0x1b9185];return _0x476395;};'use strict';var _=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var moment=require(_0xed13('0x2'));var BPromise=require(_0xed13('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed13('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed13('0x5'));var logger=require('../../config/logger')(_0xed13('0x6'));var config=require(_0xed13('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x95ff4c,_0x134929,_0xab0fff){return new BPromise(function(_0x3b3984,_0x369798){return client[_0xed13('0x8')](_0x95ff4c,_0xab0fff)[_0xed13('0x9')](function(_0x9bc191){logger[_0xed13('0xa')]('Tag,\x20%s,\x20%s',_0x134929,_0xed13('0xb'));logger[_0xed13('0xc')](_0xed13('0xd'),_0x134929,_0xed13('0xb'),JSON[_0xed13('0xe')](_0x9bc191));if(_0x9bc191['error']){if(_0x9bc191[_0xed13('0xf')][_0xed13('0x10')]===0x1f4){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x9bc191[_0xed13('0xf')][_0xed13('0x12')]);return _0x369798(_0x9bc191['error'][_0xed13('0x12')]);}logger['error'](_0xed13('0x11'),_0x134929,_0x9bc191['error'][_0xed13('0x12')]);return _0x3b3984(_0x9bc191['error'][_0xed13('0x12')]);}else{logger['info'](_0xed13('0x11'),_0x134929,_0xed13('0xb'));_0x3b3984(_0x9bc191[_0xed13('0x13')][_0xed13('0x12')]);}})[_0xed13('0x14')](function(_0x1f8585){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x1f8585);_0x369798(_0x1f8585);});});} \ No newline at end of file +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x266476,_0x98086f){var _0x454519=function(_0x954d0d){while(--_0x954d0d){_0x266476['push'](_0x266476['shift']());}};_0x454519(++_0x98086f);}(_0x34e8,0x12c));var _0x834e=function(_0x268a1a,_0x428eec){_0x268a1a=_0x268a1a-0x0;var _0x34e32e=_0x34e8[_0x268a1a];return _0x34e32e;};'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')]('Tag,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('Tag,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 7c5d937..f9fa1bb 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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 a7fff93..f5ca1e8 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(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x592c81,_0x34fc76){var _0x242329=function(_0x5a33e0){while(--_0x5a33e0){_0x592c81['push'](_0x592c81['shift']());}};_0x242329(++_0x34fc76);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 7063095..72dc387 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 _0x4e9b=['Queue:save','online','interface','UserVoiceQueueRt','upsert','isNil','format','voicePause','all','removeAgents','isArray','Queue:remove','getAgents','length','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','send','index','Team','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','params','keys','rawAttributes','includeAll','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','transaction','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','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','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','findOne','isValidChannel','ValidationError','Unknown\x20channel','capitalize','channel','toLowerCase','pick','Queues','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','emit'];(function(_0x44f8d6,_0x4c6739){var _0x9fe276=function(_0x5ca8d4){while(--_0x5ca8d4){_0x44f8d6['push'](_0x44f8d6['shift']());}};_0x9fe276(++_0x4c6739);}(_0x4e9b,0xa4));var _0xb4e9=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x4e9b[_0x47fd36];return _0x21a0fc;};'use strict';var emlformat=require(_0xb4e9('0x0'));var rimraf=require(_0xb4e9('0x1'));var zipdir=require(_0xb4e9('0x2'));var jsonpatch=require(_0xb4e9('0x3'));var rp=require(_0xb4e9('0x4'));var moment=require('moment');var BPromise=require(_0xb4e9('0x5'));var Mustache=require(_0xb4e9('0x6'));var util=require('util');var path=require(_0xb4e9('0x7'));var sox=require(_0xb4e9('0x8'));var csv=require(_0xb4e9('0x9'));var ejs=require(_0xb4e9('0xa'));var fs=require('fs');var fs_extra=require(_0xb4e9('0xb'));var _=require('lodash');var squel=require(_0xb4e9('0xc'));var crypto=require(_0xb4e9('0xd'));var jsforce=require(_0xb4e9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb4e9('0x9'));var querystring=require('querystring');var Papa=require(_0xb4e9('0xf'));var Redis=require(_0xb4e9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb4e9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4e9('0x12'));var logger=require(_0xb4e9('0x13'))('api');var utils=require(_0xb4e9('0x14'));var config=require(_0xb4e9('0x15'));var licenseUtil=require(_0xb4e9('0x16'));var db=require(_0xb4e9('0x17'))['db'];config[_0xb4e9('0x18')]=_[_0xb4e9('0x19')](config[_0xb4e9('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb4e9('0x1a'))(new Redis(config[_0xb4e9('0x18')]));require(_0xb4e9('0x1b'))['register'](socket);function respondWithStatusCode(_0x50fcc2,_0x380dc9){_0x380dc9=_0x380dc9||0xcc;return function(_0x26a60a){if(_0x26a60a){return _0x50fcc2['sendStatus'](_0x380dc9);}return _0x50fcc2['status'](_0x380dc9)[_0xb4e9('0x1c')]();};}function respondWithResult(_0x4cca71,_0x3edd6c){_0x3edd6c=_0x3edd6c||0xc8;return function(_0x47e755){if(_0x47e755){return _0x4cca71[_0xb4e9('0x1d')](_0x3edd6c)['json'](_0x47e755);}};}function respondWithFilteredResult(_0x126fbb,_0x52a021){return function(_0x205541){if(_0x205541){var _0x2ea6e1=typeof _0x52a021[_0xb4e9('0x1e')]===_0xb4e9('0x1f')&&typeof _0x52a021[_0xb4e9('0x20')]==='undefined';var _0x1dd961=_0x205541[_0xb4e9('0x21')];var _0x4b9676=_0x2ea6e1?0x0:_0x52a021[_0xb4e9('0x1e')];var _0x2e6453=_0x2ea6e1?_0x205541['count']:_0x52a021['offset']+_0x52a021['limit'];var _0xdc499c;if(_0x2e6453>=_0x1dd961){_0x2e6453=_0x1dd961;_0xdc499c=0xc8;}else{_0xdc499c=0xce;}_0x126fbb[_0xb4e9('0x1d')](_0xdc499c);return _0x126fbb[_0xb4e9('0x22')](_0xb4e9('0x23'),_0x4b9676+'-'+_0x2e6453+'/'+_0x1dd961)[_0xb4e9('0x24')](_0x205541);}return null;};}function patchUpdates(_0x16a17f){return function(_0x207cca){try{jsonpatch[_0xb4e9('0x25')](_0x207cca,_0x16a17f,!![]);}catch(_0x2c4bef){return BPromise['reject'](_0x2c4bef);}return _0x207cca[_0xb4e9('0x26')]();};}function saveUpdates(_0x1c6dc7,_0x4459ce){return function(_0x355bd9){if(_0x355bd9){return _0x355bd9[_0xb4e9('0x27')](_0x1c6dc7)[_0xb4e9('0x28')](function(_0x32529f){return _0x32529f;});}return null;};}function handleEntityNotFound(_0x511dc3,_0x31d3ac){return function(_0x553e6d){if(!_0x553e6d){_0x511dc3[_0xb4e9('0x29')](0x194);}return _0x553e6d;};}function handleError(_0x1eeb36,_0x388248){_0x388248=_0x388248||0x1f4;return function(_0x5c5d42){logger[_0xb4e9('0x2a')](_0x5c5d42[_0xb4e9('0x2b')]);if(_0x5c5d42['name']){delete _0x5c5d42[_0xb4e9('0x2c')];}_0x1eeb36['status'](_0x388248)[_0xb4e9('0x2d')](_0x5c5d42);};}exports[_0xb4e9('0x2e')]=function(_0x454b3f,_0x53fed7){var _0x4ea7ee={},_0x29369e={},_0x9fee01={'count':0x0,'rows':[]};var _0x3c7591=_['map'](db[_0xb4e9('0x2f')]['rawAttributes'],function(_0xd6bc98){return{'name':_0xd6bc98[_0xb4e9('0x30')],'type':_0xd6bc98[_0xb4e9('0x31')][_0xb4e9('0x32')]};});_0x29369e['model']=_[_0xb4e9('0x33')](_0x3c7591,_0xb4e9('0x2c'));_0x29369e['query']=_['keys'](_0x454b3f[_0xb4e9('0x34')]);_0x29369e[_0xb4e9('0x35')]=_[_0xb4e9('0x36')](_0x29369e[_0xb4e9('0x37')],_0x29369e['query']);_0x4ea7ee['attributes']=_[_0xb4e9('0x36')](_0x29369e[_0xb4e9('0x37')],qs[_0xb4e9('0x38')](_0x454b3f[_0xb4e9('0x34')]['fields']));_0x4ea7ee[_0xb4e9('0x39')]=_0x4ea7ee[_0xb4e9('0x39')]['length']?_0x4ea7ee[_0xb4e9('0x39')]:_0x29369e[_0xb4e9('0x37')];if(!_0x454b3f[_0xb4e9('0x34')][_0xb4e9('0x3a')](_0xb4e9('0x3b'))){_0x4ea7ee['limit']=qs['limit'](_0x454b3f[_0xb4e9('0x34')][_0xb4e9('0x20')]);_0x4ea7ee[_0xb4e9('0x1e')]=qs[_0xb4e9('0x1e')](_0x454b3f[_0xb4e9('0x34')][_0xb4e9('0x1e')]);}_0x4ea7ee[_0xb4e9('0x3c')]=qs[_0xb4e9('0x3d')](_0x454b3f[_0xb4e9('0x34')][_0xb4e9('0x3d')]);_0x4ea7ee[_0xb4e9('0x3e')]=qs[_0xb4e9('0x35')](_['pick'](_0x454b3f['query'],_0x29369e['filters']),_0x3c7591);if(_0x454b3f[_0xb4e9('0x34')][_0xb4e9('0x3f')]){_0x4ea7ee[_0xb4e9('0x3e')]=_[_0xb4e9('0x40')](_0x4ea7ee['where'],{'$or':_['map'](_0x3c7591,function(_0x11f044){if(_0x11f044[_0xb4e9('0x31')]!==_0xb4e9('0x41')){var _0x3fbe34={};_0x3fbe34[_0x11f044['name']]={'$like':'%'+_0x454b3f[_0xb4e9('0x34')][_0xb4e9('0x3f')]+'%'};return _0x3fbe34;}})});}_0x4ea7ee=_['merge']({},_0x4ea7ee,_0x454b3f[_0xb4e9('0x42')]);var _0x23dfaa={'where':_0x4ea7ee[_0xb4e9('0x3e')]};return db['Team']['count'](_0x23dfaa)['then'](function(_0x395d99){_0x9fee01[_0xb4e9('0x21')]=_0x395d99;if(_0x454b3f[_0xb4e9('0x34')]['includeAll']){_0x4ea7ee[_0xb4e9('0x43')]=[{'all':!![]}];}return db[_0xb4e9('0x2f')]['findAll'](_0x4ea7ee);})['then'](function(_0x1866c2){_0x9fee01[_0xb4e9('0x44')]=_0x1866c2;return _0x9fee01;})[_0xb4e9('0x28')](respondWithFilteredResult(_0x53fed7,_0x4ea7ee))[_0xb4e9('0x45')](handleError(_0x53fed7,null));};exports['show']=function(_0x2baa69,_0x46d5fd){var _0x3e1464={'raw':![],'where':{'id':_0x2baa69[_0xb4e9('0x46')]['id']}},_0xe3b10e={};_0xe3b10e[_0xb4e9('0x37')]=_[_0xb4e9('0x47')](db[_0xb4e9('0x2f')][_0xb4e9('0x48')]);_0xe3b10e['query']=_['keys'](_0x2baa69[_0xb4e9('0x34')]);_0xe3b10e['filters']=_[_0xb4e9('0x36')](_0xe3b10e['model'],_0xe3b10e[_0xb4e9('0x34')]);_0x3e1464['attributes']=_[_0xb4e9('0x36')](_0xe3b10e[_0xb4e9('0x37')],qs[_0xb4e9('0x38')](_0x2baa69[_0xb4e9('0x34')][_0xb4e9('0x38')]));_0x3e1464[_0xb4e9('0x39')]=_0x3e1464[_0xb4e9('0x39')]['length']?_0x3e1464['attributes']:_0xe3b10e[_0xb4e9('0x37')];if(_0x2baa69[_0xb4e9('0x34')][_0xb4e9('0x49')]){_0x3e1464[_0xb4e9('0x43')]=[{'all':!![]}];}_0x3e1464=_[_0xb4e9('0x40')]({},_0x3e1464,_0x2baa69[_0xb4e9('0x42')]);return db[_0xb4e9('0x2f')]['find'](_0x3e1464)[_0xb4e9('0x28')](handleEntityNotFound(_0x46d5fd,null))[_0xb4e9('0x28')](respondWithResult(_0x46d5fd,null))[_0xb4e9('0x45')](handleError(_0x46d5fd,null));};exports[_0xb4e9('0x4a')]=function(_0x8372df,_0x44fdaa){return db[_0xb4e9('0x2f')]['create'](_0x8372df['body'],{})[_0xb4e9('0x28')](function(_0x35aa5a){var _0x29d1ba=_0x8372df[_0xb4e9('0x4b')][_0xb4e9('0x4c')]({'plain':!![]});if(!_0x29d1ba)throw new Error(_0xb4e9('0x4d'));if(_0x29d1ba[_0xb4e9('0x4e')]==='user'){var _0x12197c=_0x35aa5a[_0xb4e9('0x4c')]({'plain':!![]});var _0x248e5f=_0xb4e9('0x4f');return db[_0xb4e9('0x50')][_0xb4e9('0x51')]({'where':{'name':_0x248e5f,'userProfileId':_0x29d1ba[_0xb4e9('0x52')]},'raw':!![]})['then'](function(_0x938ede){if(_0x938ede&&_0x938ede[_0xb4e9('0x53')]===0x0){return db[_0xb4e9('0x54')][_0xb4e9('0x4a')]({'name':_0x12197c[_0xb4e9('0x2c')],'resourceId':_0x12197c['id'],'type':_0x938ede['name'],'sectionId':_0x938ede['id']},{})[_0xb4e9('0x28')](function(){return _0x35aa5a;});}else{return _0x35aa5a;}})[_0xb4e9('0x45')](function(_0x136724){logger[_0xb4e9('0x2a')](_0xb4e9('0x55'),_0x136724);throw _0x136724;});}return _0x35aa5a;})['then'](respondWithResult(_0x44fdaa,0xc9))[_0xb4e9('0x45')](handleError(_0x44fdaa,null));};exports[_0xb4e9('0x27')]=function(_0x4a3fd0,_0x48962c){if(_0x4a3fd0['body']['id']){delete _0x4a3fd0['body']['id'];}return db[_0xb4e9('0x2f')][_0xb4e9('0x51')]({'where':{'id':_0x4a3fd0[_0xb4e9('0x46')]['id']}})['then'](handleEntityNotFound(_0x48962c,null))[_0xb4e9('0x28')](saveUpdates(_0x4a3fd0[_0xb4e9('0x56')],null))[_0xb4e9('0x28')](respondWithResult(_0x48962c,null))['catch'](handleError(_0x48962c,null));};exports[_0xb4e9('0x57')]=function(_0x2559c5,_0x36ded6){var _0x105d3f=_0x2559c5[_0xb4e9('0x46')]['id'];var _0x111a79=[];return db[_0xb4e9('0x58')][_0xb4e9('0x59')](function(_0x56037e){var _0x1d0e11='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x105d3f;return db['sequelize'][_0xb4e9('0x34')](_0x1d0e11,{'type':db[_0xb4e9('0x5a')][_0xb4e9('0x5b')][_0xb4e9('0x5c')],'raw':!![],'transaction':_0x56037e})[_0xb4e9('0x28')](function(_0x1968ee){_0x111a79=_['map'](_0x1968ee,function(_0x46817f){return Number(_0x46817f['UserId']);});})[_0xb4e9('0x28')](function(){var _0x2cec8f=_0xb4e9('0x5d')+_0x105d3f;return db['sequelize'][_0xb4e9('0x34')](_0x2cec8f,{'type':db[_0xb4e9('0x5a')][_0xb4e9('0x5b')]['SELECT'],'raw':!![],'transaction':_0x56037e});})[_0xb4e9('0x28')](function(_0x58552b){var _0x26d75d=_['map'](_0x58552b,function(_0x1d5eb6){return Number(_0x1d5eb6['VoiceQueueId']);});return db[_0xb4e9('0x5e')][_0xb4e9('0x57')]({'where':{'UserId':{'$in':_0x111a79},'VoiceQueueId':{'$in':_0x26d75d}},'transaction':_0x56037e});})[_0xb4e9('0x28')](function(){var _0x4e7d64=_0xb4e9('0x5f')+_0x105d3f;return db[_0xb4e9('0x58')][_0xb4e9('0x34')](_0x4e7d64,{'type':db[_0xb4e9('0x5a')][_0xb4e9('0x5b')][_0xb4e9('0x5c')],'raw':!![],'transaction':_0x56037e});})['then'](function(_0x41aa37){var _0x22f899=_[_0xb4e9('0x33')](_0x41aa37,function(_0x4d004c){return Number(_0x4d004c[_0xb4e9('0x60')]);});return db['UserMailQueue'][_0xb4e9('0x57')]({'where':{'UserId':{'$in':_0x111a79},'MailQueueId':{'$in':_0x22f899}},'transaction':_0x56037e});})[_0xb4e9('0x28')](function(){var _0x5c14df='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x105d3f;return db[_0xb4e9('0x58')]['query'](_0x5c14df,{'type':db[_0xb4e9('0x5a')]['QueryTypes'][_0xb4e9('0x5c')],'raw':!![],'transaction':_0x56037e});})[_0xb4e9('0x28')](function(_0x34e610){var _0xbeb687=_[_0xb4e9('0x33')](_0x34e610,function(_0x466475){return Number(_0x466475[_0xb4e9('0x61')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x111a79},'SmsQueueId':{'$in':_0xbeb687}},'transaction':_0x56037e});})['then'](function(){var _0x422fee=_0xb4e9('0x62')+_0x105d3f;return db[_0xb4e9('0x58')][_0xb4e9('0x34')](_0x422fee,{'type':db[_0xb4e9('0x5a')][_0xb4e9('0x5b')][_0xb4e9('0x5c')],'raw':!![],'transaction':_0x56037e});})[_0xb4e9('0x28')](function(_0x28899a){var _0x559d16=_['map'](_0x28899a,function(_0x644e80){return Number(_0x644e80[_0xb4e9('0x63')]);});return db[_0xb4e9('0x64')][_0xb4e9('0x57')]({'where':{'UserId':{'$in':_0x111a79},'ChatQueueId':{'$in':_0x559d16}},'transaction':_0x56037e});})['then'](function(){var _0x4065e0='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x105d3f;return db[_0xb4e9('0x58')][_0xb4e9('0x34')](_0x4065e0,{'type':db[_0xb4e9('0x5a')][_0xb4e9('0x5b')][_0xb4e9('0x5c')],'raw':!![],'transaction':_0x56037e});})[_0xb4e9('0x28')](function(_0x3bbf24){var _0x182c88=_['map'](_0x3bbf24,function(_0x32eea9){return Number(_0x32eea9[_0xb4e9('0x65')]);});return db[_0xb4e9('0x66')]['destroy']({'where':{'UserId':{'$in':_0x111a79},'FaxQueueId':{'$in':_0x182c88}},'transaction':_0x56037e});})[_0xb4e9('0x28')](function(){var _0x2cb3cb=_0xb4e9('0x67')+_0x105d3f;return db[_0xb4e9('0x58')][_0xb4e9('0x34')](_0x2cb3cb,{'type':db[_0xb4e9('0x5a')][_0xb4e9('0x5b')]['SELECT'],'raw':!![],'transaction':_0x56037e});})[_0xb4e9('0x28')](function(_0x225350){var _0x401836=_[_0xb4e9('0x33')](_0x225350,function(_0x52870f){return Number(_0x52870f['OpenchannelQueueId']);});return db[_0xb4e9('0x68')][_0xb4e9('0x57')]({'where':{'UserId':{'$in':_0x111a79},'OpenchannelQueueId':{'$in':_0x401836}},'transaction':_0x56037e});})['then'](function(){var _0x3c19d4=_0xb4e9('0x69')+_0x105d3f;return db['sequelize'][_0xb4e9('0x34')](_0x3c19d4,{'type':db[_0xb4e9('0x5a')][_0xb4e9('0x5b')][_0xb4e9('0x5c')],'raw':!![],'transaction':_0x56037e});})[_0xb4e9('0x28')](function(_0xdb230){var _0x126a2e=_['map'](_0xdb230,function(_0x5c01f8){return Number(_0x5c01f8['WhatsappQueueId']);});return db['UserWhatsappQueue'][_0xb4e9('0x57')]({'where':{'UserId':{'$in':_0x111a79},'WhatsappQueueId':{'$in':_0x126a2e}},'transaction':_0x56037e});})[_0xb4e9('0x28')](function(){return db[_0xb4e9('0x6a')][_0xb4e9('0x51')]({'where':{'TeamId':_0x105d3f}});})['then'](function(_0x4d243b){if(_0x4d243b===null){return;}return db[_0xb4e9('0x6b')][_0xb4e9('0x57')]({'where':{'UserId':{'$in':_0x111a79},'VoicePrefixId':_0x4d243b[_0xb4e9('0x6c')]},'transaction':_0x56037e});})[_0xb4e9('0x28')](function(){return db[_0xb4e9('0x2f')]['destroy']({'where':{'id':_0x105d3f},'cascade':!![],'transaction':_0x56037e});})['then'](function(_0x4c22ff){if(_0x4c22ff===0x0){_0x36ded6[_0xb4e9('0x29')](0x194);}else{return db[_0xb4e9('0x54')][_0xb4e9('0x57')]({'where':{'type':_0xb4e9('0x4f'),'resourceId':_0x105d3f},'cascade':!![],'transaction':_0x56037e})['then'](function(){_0x36ded6[_0xb4e9('0x1d')](0xcc)[_0xb4e9('0x1c')]();});}})[_0xb4e9('0x45')](function(_0x102df6){_0x36ded6[_0xb4e9('0x1d')](0x1f4)[_0xb4e9('0x2d')](_0x102df6);});});};exports['getQueues']=function(_0x46e1ef,_0x2fa681,_0x39a456){return db[_0xb4e9('0x2f')][_0xb4e9('0x6d')]({'where':{'id':_0x46e1ef[_0xb4e9('0x46')]['id']}})[_0xb4e9('0x28')](handleEntityNotFound(_0x2fa681,null))['then'](function(_0x31234b){if(!_0x46e1ef[_0xb4e9('0x34')]['channel']||!utils[_0xb4e9('0x6e')](_0x46e1ef[_0xb4e9('0x34')]['channel'])){throw new db[(_0xb4e9('0x5a'))][(_0xb4e9('0x6f'))](_0xb4e9('0x70'));}var _0x107191={};var _0x1c130e={};_0x1c130e[_0xb4e9('0x37')]=_[_0xb4e9('0x47')](db[_[_0xb4e9('0x71')](_0x46e1ef[_0xb4e9('0x34')][_0xb4e9('0x72')][_0xb4e9('0x73')]())+'Queue'][_0xb4e9('0x48')]);_0x1c130e[_0xb4e9('0x34')]=_[_0xb4e9('0x47')](_0x46e1ef[_0xb4e9('0x34')]);_0x1c130e[_0xb4e9('0x35')]=_[_0xb4e9('0x36')](_0x1c130e[_0xb4e9('0x37')],_0x1c130e[_0xb4e9('0x34')]);_0x107191[_0xb4e9('0x39')]=_[_0xb4e9('0x36')](_0x1c130e[_0xb4e9('0x37')],qs[_0xb4e9('0x38')](_0x46e1ef[_0xb4e9('0x34')]['fields']));_0x107191[_0xb4e9('0x39')]=_0x107191[_0xb4e9('0x39')]['length']?_0x107191['attributes']:_0x1c130e['model'];_0x107191[_0xb4e9('0x20')]=qs['limit'](_0x46e1ef['query'][_0xb4e9('0x20')]);_0x107191['offset']=qs['offset'](_0x46e1ef[_0xb4e9('0x34')][_0xb4e9('0x1e')]);_0x107191[_0xb4e9('0x3c')]=qs[_0xb4e9('0x3d')](_0x46e1ef[_0xb4e9('0x34')]['sort']);_0x107191[_0xb4e9('0x3e')]=qs[_0xb4e9('0x35')](_[_0xb4e9('0x74')](_0x46e1ef[_0xb4e9('0x34')],_0x1c130e['filters']));_0x107191=_[_0xb4e9('0x40')]({},_0x107191,_0x46e1ef[_0xb4e9('0x42')]);return _0x31234b[_0xb4e9('0x4c')+_[_0xb4e9('0x71')](_0x46e1ef[_0xb4e9('0x34')][_0xb4e9('0x72')][_0xb4e9('0x73')]())+_0xb4e9('0x75')](_0x107191);})['then'](respondWithResult(_0x2fa681,null))[_0xb4e9('0x45')](handleError(_0x2fa681,null));};exports['addQueues']=function(_0x55728c,_0xc0de23,_0xd6fc71){return db[_0xb4e9('0x2f')]['findOne']({'where':{'id':_0x55728c[_0xb4e9('0x46')]['id']}})['then'](function(_0x22fdd3){if(_0x22fdd3){if(!_0x55728c[_0xb4e9('0x56')][_0xb4e9('0x72')]||!utils[_0xb4e9('0x6e')](_0x55728c['body'][_0xb4e9('0x72')])){throw new db['Sequelize'][(_0xb4e9('0x6f'))]('Unknown\x20channel');}return _0x22fdd3['add'+_[_0xb4e9('0x71')](_0x55728c[_0xb4e9('0x56')][_0xb4e9('0x72')][_0xb4e9('0x73')]())+_0xb4e9('0x75')](_0x55728c[_0xb4e9('0x56')][_0xb4e9('0x76')]);}return null;})['then'](handleEntityNotFound(_0xc0de23,null))['then'](respondWithStatusCode(_0xc0de23,null))[_0xb4e9('0x45')](handleError(_0xc0de23,null));};exports[_0xb4e9('0x77')]=function(_0x39a002,_0x5a0a68,_0xe57409){return db[_0xb4e9('0x2f')]['findOne']({'where':{'id':_0x39a002[_0xb4e9('0x46')]['id']}})[_0xb4e9('0x28')](function(_0x47608c){if(_0x47608c){if(!_0x39a002[_0xb4e9('0x34')][_0xb4e9('0x72')]||!utils['isValidChannel'](_0x39a002[_0xb4e9('0x34')][_0xb4e9('0x72')])){throw new db[(_0xb4e9('0x5a'))]['ValidationError'](_0xb4e9('0x70'));}return _0x47608c[_0xb4e9('0x78')+_[_0xb4e9('0x71')](_0x39a002[_0xb4e9('0x34')][_0xb4e9('0x72')]['toLowerCase']())+_0xb4e9('0x75')](_0x39a002[_0xb4e9('0x34')][_0xb4e9('0x76')]);}return null;})[_0xb4e9('0x28')](handleEntityNotFound(_0x5a0a68,null))[_0xb4e9('0x28')](respondWithStatusCode(_0x5a0a68,null))[_0xb4e9('0x45')](handleError(_0x5a0a68,null));};exports[_0xb4e9('0x79')]=function(_0x291ea1,_0x155498){var _0x53f55f=_['isArray'](_0x291ea1[_0xb4e9('0x56')][_0xb4e9('0x76')])?_0x291ea1['body'][_0xb4e9('0x76')]:[_0x291ea1[_0xb4e9('0x56')][_0xb4e9('0x76')]];var _0x1982fc=_0x291ea1[_0xb4e9('0x46')]['id'];return db['Team'][_0xb4e9('0x51')]({'where':{'id':_0x1982fc}})[_0xb4e9('0x28')](handleEntityNotFound(_0x155498,null))[_0xb4e9('0x28')](function(_0x11a3ec){if(_0x11a3ec){var _0x2f682d=[_0xb4e9('0x7a'),_0xb4e9('0x7b'),_0xb4e9('0x7c'),'Sms',_0xb4e9('0x7d'),_0xb4e9('0x7e'),_0xb4e9('0x7f')];return db[_0xb4e9('0x58')][_0xb4e9('0x59')](function(_0x4eb962){var _0x438223=_['map'](_0x2f682d,function(_0x5cbb5c){var _0x2d6b6f={'attributes':['id','name']};if(_0x5cbb5c===_0xb4e9('0x7a')){_0x2d6b6f[_0xb4e9('0x80')]={'attributes':[_0xb4e9('0x81')]};}return _0x11a3ec[_0xb4e9('0x4c')+_0x5cbb5c+_0xb4e9('0x75')](_0x2d6b6f)['then'](function(_0x328bf2){var _0x3811d6=_[_0xb4e9('0x33')](_0x328bf2,function(_0x3df4d6){var _0x1fd0ae=_[_0xb4e9('0x33')](_0x53f55f,function(_0x2027c9){var _0x17ce70={'where':{'UserId':_0x2027c9,[_0x5cbb5c+_0xb4e9('0x82')]:_0x3df4d6['id']},'transaction':_0x4eb962};if(_0x5cbb5c==='Voice'){_0x17ce70['defaults']={'penalty':_0x3df4d6[_0xb4e9('0x83')][_0xb4e9('0x81')]};}return db[_0xb4e9('0x84')+_0x5cbb5c+_0xb4e9('0x85')][_0xb4e9('0x86')](_0x17ce70)['then'](function(){socket[_0xb4e9('0x87')](_0xb4e9('0x4b')+_0x5cbb5c+_0xb4e9('0x88'),{'UserId':_0x2027c9,[_0x5cbb5c+_0xb4e9('0x82')]:_0x3df4d6['id']});if(_0x5cbb5c!==_0xb4e9('0x7a')){return;}return db[_0xb4e9('0x84')]['findAll']({'where':{'id':_0x53f55f,'online':0x1},'attributes':['id',_0xb4e9('0x2c'),_0xb4e9('0x89'),'voicePause',_0xb4e9('0x8a')],'raw':!![]})['then'](function(_0x22a35c){var _0x33a1d5=_[_0xb4e9('0x33')](_0x22a35c,function(_0x574866){return db[_0xb4e9('0x8b')][_0xb4e9('0x8c')]({'membername':_0x574866[_0xb4e9('0x2c')],'UserId':_0x574866['id'],'queue_name':_0x3df4d6['name'],'VoiceQueueId':_0x3df4d6['id'],'interface':_[_0xb4e9('0x8d')](_0x574866[_0xb4e9('0x8a')])?util[_0xb4e9('0x8e')]('SIP/%s',_0x574866[_0xb4e9('0x2c')]):_0x574866[_0xb4e9('0x8a')],'paused':_0x574866[_0xb4e9('0x8f')]||![],'penalty':_0x3df4d6[_0xb4e9('0x83')][_0xb4e9('0x81')]},{'transaction':_0x4eb962});});return Promise[_0xb4e9('0x90')](_0x33a1d5);});});});return Promise[_0xb4e9('0x90')](_0x1fd0ae);});return Promise[_0xb4e9('0x90')](_0x3811d6);})[_0xb4e9('0x28')](function(){return db[_0xb4e9('0x6a')][_0xb4e9('0x6d')]({'where':{'teamId':_0x1982fc}})[_0xb4e9('0x28')](function(_0x3e4afb){if(_0x3e4afb){var _0x346274=_[_0xb4e9('0x33')](_0x53f55f,function(_0xfa8c83){db[_0xb4e9('0x6b')][_0xb4e9('0x8c')]({'UserId':_0xfa8c83,'VoicePrefixId':_0x3e4afb[_0xb4e9('0x6c')]});});return Promise[_0xb4e9('0x90')](_0x346274);}});});});return Promise[_0xb4e9('0x90')](_0x438223)['then'](function(){return _0x11a3ec[_0xb4e9('0x79')](_0x53f55f,{'transaction':_0x4eb962})['spread'](function(_0x51421e){return _0x51421e;});});});}})[_0xb4e9('0x28')](respondWithResult(_0x155498,null))[_0xb4e9('0x45')](handleError(_0x155498,null));};exports[_0xb4e9('0x91')]=function(_0x2eb635,_0x4453c6){var _0x4752f1=_[_0xb4e9('0x92')](_0x2eb635['query'][_0xb4e9('0x76')])?_0x2eb635[_0xb4e9('0x34')][_0xb4e9('0x76')]:[_0x2eb635[_0xb4e9('0x34')][_0xb4e9('0x76')]];var _0x467260=_0x2eb635[_0xb4e9('0x46')]['id'];return db[_0xb4e9('0x2f')][_0xb4e9('0x51')]({'where':{'id':_0x467260}})[_0xb4e9('0x28')](handleEntityNotFound(_0x4453c6,null))[_0xb4e9('0x28')](function(_0x32a7b7){if(_0x32a7b7){var _0x2cb774=[_0xb4e9('0x7a'),_0xb4e9('0x7b'),_0xb4e9('0x7c'),'Sms','Fax',_0xb4e9('0x7e'),'Whatsapp'];return db[_0xb4e9('0x58')]['transaction'](function(_0x397047){var _0x1ff0bb=_['map'](_0x2cb774,function(_0x2a961b){var _0x266c01={'attributes':['id',_0xb4e9('0x2c')]};return _0x32a7b7[_0xb4e9('0x4c')+_0x2a961b+_0xb4e9('0x75')](_0x266c01)[_0xb4e9('0x28')](function(_0x4ce408){var _0x5b71ac=_[_0xb4e9('0x33')](_0x4ce408,function(_0x36fd9e){return _0x36fd9e[_0xb4e9('0x91')](_0x4752f1,{'transaction':_0x397047})['then'](function(){var _0x128df5=_['map'](_0x4752f1,function(_0x5b0261){socket[_0xb4e9('0x87')]('user'+_0x2a961b+_0xb4e9('0x93'),{'UserId':Number(_0x5b0261),[_0x2a961b+'QueueId']:_0x36fd9e['id']});if(_0x2a961b!=='Voice'){return;}return db[_0xb4e9('0x8b')][_0xb4e9('0x57')]({'where':{'VoiceQueueId':_0x36fd9e['id'],'UserId':_0x5b0261},'transaction':_0x397047});});return Promise[_0xb4e9('0x90')](_0x128df5);});});return Promise[_0xb4e9('0x90')](_0x5b71ac);});});return Promise[_0xb4e9('0x90')](_0x1ff0bb)[_0xb4e9('0x28')](function(){return _0x32a7b7[_0xb4e9('0x91')](_0x4752f1,{'transaction':_0x397047});})[_0xb4e9('0x28')](function(){return db[_0xb4e9('0x6a')][_0xb4e9('0x6d')]({'where':{'teamId':_0x467260}})['then'](function(_0x4fa232){if(_0x4fa232){var _0x467ac1=_[_0xb4e9('0x33')](_0x4752f1,function(_0x216010){db[_0xb4e9('0x6b')]['destroy']({'where':{'UserId':_0x216010,'VoicePrefixId':_0x4fa232[_0xb4e9('0x6c')]}});});return Promise['all'](_0x467ac1);}});});});}})[_0xb4e9('0x28')](respondWithStatusCode(_0x4453c6,null))[_0xb4e9('0x45')](handleError(_0x4453c6,null));};exports[_0xb4e9('0x94')]=function(_0x4c5648,_0x16a213,_0x2d4423){var _0x311efb={};var _0x557474={};var _0x22e737;var _0x2b60ac;return db[_0xb4e9('0x2f')][_0xb4e9('0x6d')]({'where':{'id':_0x4c5648['params']['id']}})[_0xb4e9('0x28')](handleEntityNotFound(_0x16a213,null))[_0xb4e9('0x28')](function(_0x4a2d29){if(_0x4a2d29){_0x22e737=_0x4a2d29;_0x557474['model']=_[_0xb4e9('0x47')](db[_0xb4e9('0x84')][_0xb4e9('0x48')]);_0x557474['query']=_[_0xb4e9('0x47')](_0x4c5648[_0xb4e9('0x34')]);_0x557474['filters']=_[_0xb4e9('0x36')](_0x557474[_0xb4e9('0x37')],_0x557474['query']);_0x311efb['attributes']=_[_0xb4e9('0x36')](_0x557474[_0xb4e9('0x37')],qs[_0xb4e9('0x38')](_0x4c5648['query'][_0xb4e9('0x38')]));_0x311efb['attributes']=_0x311efb[_0xb4e9('0x39')]['length']?_0x311efb[_0xb4e9('0x39')]:_0x557474[_0xb4e9('0x37')];_0x311efb['order']=qs['sort'](_0x4c5648[_0xb4e9('0x34')][_0xb4e9('0x3d')]);_0x311efb['where']=qs[_0xb4e9('0x35')](_['pick'](_0x4c5648[_0xb4e9('0x34')],_0x557474['filters']));if(_0x4c5648[_0xb4e9('0x34')][_0xb4e9('0x3f')]){_0x311efb[_0xb4e9('0x3e')]=_[_0xb4e9('0x40')](_0x311efb[_0xb4e9('0x3e')],{'$or':_['map'](_0x311efb[_0xb4e9('0x39')],function(_0x1fa667){var _0x187064={};_0x187064[_0x1fa667]={'$like':'%'+_0x4c5648[_0xb4e9('0x34')]['filter']+'%'};return _0x187064;})});}_0x311efb=_[_0xb4e9('0x40')]({},_0x311efb,_0x4c5648[_0xb4e9('0x42')]);return _0x22e737[_0xb4e9('0x94')](_0x311efb);}})['then'](function(_0x1d7062){if(_0x1d7062){_0x2b60ac=_0x1d7062[_0xb4e9('0x95')];if(!_0x4c5648[_0xb4e9('0x34')][_0xb4e9('0x3a')]('nolimit')){_0x311efb[_0xb4e9('0x20')]=qs[_0xb4e9('0x20')](_0x4c5648[_0xb4e9('0x34')]['limit']);_0x311efb['offset']=qs[_0xb4e9('0x1e')](_0x4c5648[_0xb4e9('0x34')]['offset']);}return _0x22e737[_0xb4e9('0x94')](_0x311efb);}})[_0xb4e9('0x28')](function(_0x130aaf){if(_0x130aaf){return _0x130aaf?{'count':_0x2b60ac,'rows':_0x130aaf}:null;}})['then'](respondWithResult(_0x16a213,null))[_0xb4e9('0x45')](handleError(_0x16a213,null));}; \ No newline at end of file +var _0x7e15=['Teams','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','QueryTypes','UserSmsQueue','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','channel','isValidChannel','ValidationError','capitalize','toLowerCase','Queue','Queues','addQueues','Unknown\x20channel','ids','removeQueues','findOne','remove','addAgents','isArray','Voice','Chat','Sms','Fax','Openchannel','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','voicePause','interface','upsert','format','SIP/%s','all','spread','removeAgents','Mail','Queue:remove','UserVoiceQueueRt','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./team.socket','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','catch','show','params','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x1c34c5,_0x4c7e70){var _0x5c3e2d=function(_0x4970c1){while(--_0x4970c1){_0x1c34c5['push'](_0x1c34c5['shift']());}};_0x5c3e2d(++_0x4c7e70);}(_0x7e15,0xda));var _0x57e1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7e15[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x57e1('0x0'));var rimraf=require(_0x57e1('0x1'));var zipdir=require(_0x57e1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x57e1('0x3'));var moment=require(_0x57e1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x57e1('0x5'));var util=require(_0x57e1('0x6'));var path=require(_0x57e1('0x7'));var sox=require('sox');var csv=require(_0x57e1('0x8'));var ejs=require(_0x57e1('0x9'));var fs=require('fs');var fs_extra=require(_0x57e1('0xa'));var _=require('lodash');var squel=require(_0x57e1('0xb'));var crypto=require(_0x57e1('0xc'));var jsforce=require(_0x57e1('0xd'));var deskjs=require(_0x57e1('0xe'));var toCsv=require(_0x57e1('0x8'));var querystring=require(_0x57e1('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x57e1('0x10'));var qs=require(_0x57e1('0x11'));var as=require(_0x57e1('0x12'));var hardwareService=require(_0x57e1('0x13'));var logger=require(_0x57e1('0x14'))('api');var utils=require(_0x57e1('0x15'));var config=require(_0x57e1('0x16'));var licenseUtil=require(_0x57e1('0x17'));var db=require('../../mysqldb')['db'];config[_0x57e1('0x18')]=_[_0x57e1('0x19')](config[_0x57e1('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x57e1('0x1a'))(new Redis(config[_0x57e1('0x18')]));require(_0x57e1('0x1b'))['register'](socket);function respondWithStatusCode(_0x1b8aa4,_0x41f67d){_0x41f67d=_0x41f67d||0xcc;return function(_0x53810f){if(_0x53810f){return _0x1b8aa4['sendStatus'](_0x41f67d);}return _0x1b8aa4[_0x57e1('0x1c')](_0x41f67d)[_0x57e1('0x1d')]();};}function respondWithResult(_0x45c8b3,_0x2cea7b){_0x2cea7b=_0x2cea7b||0xc8;return function(_0x300972){if(_0x300972){return _0x45c8b3[_0x57e1('0x1c')](_0x2cea7b)[_0x57e1('0x1e')](_0x300972);}};}function respondWithFilteredResult(_0x1ca975,_0x524457){return function(_0x5a54a4){if(_0x5a54a4){var _0x1236fd=typeof _0x524457[_0x57e1('0x1f')]==='undefined'&&typeof _0x524457[_0x57e1('0x20')]===_0x57e1('0x21');var _0x1f8591=_0x5a54a4[_0x57e1('0x22')];var _0xdb904e=_0x1236fd?0x0:_0x524457['offset'];var _0xdf2857=_0x1236fd?_0x5a54a4[_0x57e1('0x22')]:_0x524457[_0x57e1('0x1f')]+_0x524457[_0x57e1('0x20')];var _0x513156;if(_0xdf2857>=_0x1f8591){_0xdf2857=_0x1f8591;_0x513156=0xc8;}else{_0x513156=0xce;}_0x1ca975[_0x57e1('0x1c')](_0x513156);return _0x1ca975[_0x57e1('0x23')](_0x57e1('0x24'),_0xdb904e+'-'+_0xdf2857+'/'+_0x1f8591)[_0x57e1('0x1e')](_0x5a54a4);}return null;};}function patchUpdates(_0x507ee7){return function(_0x59aeb3){try{jsonpatch[_0x57e1('0x25')](_0x59aeb3,_0x507ee7,!![]);}catch(_0x37df64){return BPromise[_0x57e1('0x26')](_0x37df64);}return _0x59aeb3[_0x57e1('0x27')]();};}function saveUpdates(_0x5430ba,_0x10abb8){return function(_0x50f78c){if(_0x50f78c){return _0x50f78c[_0x57e1('0x28')](_0x5430ba)[_0x57e1('0x29')](function(_0x46bac0){return _0x46bac0;});}return null;};}function handleEntityNotFound(_0x41c5c7,_0x4aa962){return function(_0x398183){if(!_0x398183){_0x41c5c7[_0x57e1('0x2a')](0x194);}return _0x398183;};}function handleError(_0x490e96,_0x1d0bd5){_0x1d0bd5=_0x1d0bd5||0x1f4;return function(_0x26874b){logger[_0x57e1('0x2b')](_0x26874b[_0x57e1('0x2c')]);if(_0x26874b[_0x57e1('0x2d')]){delete _0x26874b[_0x57e1('0x2d')];}_0x490e96[_0x57e1('0x1c')](_0x1d0bd5)[_0x57e1('0x2e')](_0x26874b);};}exports[_0x57e1('0x2f')]=function(_0x1dcc50,_0x356111){var _0x4e5bdc={},_0x24d061={},_0x5001f9={'count':0x0,'rows':[]};var _0x38d426=_[_0x57e1('0x30')](db[_0x57e1('0x31')][_0x57e1('0x32')],function(_0x5658c0){return{'name':_0x5658c0[_0x57e1('0x33')],'type':_0x5658c0[_0x57e1('0x34')][_0x57e1('0x35')]};});_0x24d061['model']=_['map'](_0x38d426,_0x57e1('0x2d'));_0x24d061[_0x57e1('0x36')]=_[_0x57e1('0x37')](_0x1dcc50['query']);_0x24d061[_0x57e1('0x38')]=_[_0x57e1('0x39')](_0x24d061[_0x57e1('0x3a')],_0x24d061['query']);_0x4e5bdc[_0x57e1('0x3b')]=_[_0x57e1('0x39')](_0x24d061['model'],qs[_0x57e1('0x3c')](_0x1dcc50[_0x57e1('0x36')][_0x57e1('0x3c')]));_0x4e5bdc[_0x57e1('0x3b')]=_0x4e5bdc['attributes'][_0x57e1('0x3d')]?_0x4e5bdc[_0x57e1('0x3b')]:_0x24d061[_0x57e1('0x3a')];if(!_0x1dcc50['query']['hasOwnProperty'](_0x57e1('0x3e'))){_0x4e5bdc[_0x57e1('0x20')]=qs[_0x57e1('0x20')](_0x1dcc50[_0x57e1('0x36')][_0x57e1('0x20')]);_0x4e5bdc[_0x57e1('0x1f')]=qs['offset'](_0x1dcc50[_0x57e1('0x36')][_0x57e1('0x1f')]);}_0x4e5bdc[_0x57e1('0x3f')]=qs[_0x57e1('0x40')](_0x1dcc50[_0x57e1('0x36')][_0x57e1('0x40')]);_0x4e5bdc[_0x57e1('0x41')]=qs[_0x57e1('0x38')](_[_0x57e1('0x42')](_0x1dcc50[_0x57e1('0x36')],_0x24d061[_0x57e1('0x38')]),_0x38d426);if(_0x1dcc50[_0x57e1('0x36')][_0x57e1('0x43')]){_0x4e5bdc[_0x57e1('0x41')]=_['merge'](_0x4e5bdc['where'],{'$or':_[_0x57e1('0x30')](_0x38d426,function(_0x21aeac){if(_0x21aeac[_0x57e1('0x34')]!==_0x57e1('0x44')){var _0x2f23c7={};_0x2f23c7[_0x21aeac[_0x57e1('0x2d')]]={'$like':'%'+_0x1dcc50[_0x57e1('0x36')][_0x57e1('0x43')]+'%'};return _0x2f23c7;}})});}_0x4e5bdc=_[_0x57e1('0x45')]({},_0x4e5bdc,_0x1dcc50[_0x57e1('0x46')]);var _0x4be5b8={'where':_0x4e5bdc[_0x57e1('0x41')]};return db['Team']['count'](_0x4be5b8)[_0x57e1('0x29')](function(_0x16b99c){_0x5001f9[_0x57e1('0x22')]=_0x16b99c;if(_0x1dcc50['query']['includeAll']){_0x4e5bdc['include']=[{'all':!![]}];}return db['Team'][_0x57e1('0x47')](_0x4e5bdc);})[_0x57e1('0x29')](function(_0x41d19d){_0x5001f9['rows']=_0x41d19d;return _0x5001f9;})[_0x57e1('0x29')](respondWithFilteredResult(_0x356111,_0x4e5bdc))[_0x57e1('0x48')](handleError(_0x356111,null));};exports[_0x57e1('0x49')]=function(_0x2254b4,_0x14d690){var _0x3fc89c={'raw':![],'where':{'id':_0x2254b4[_0x57e1('0x4a')]['id']}},_0x2b5897={};_0x2b5897[_0x57e1('0x3a')]=_[_0x57e1('0x37')](db[_0x57e1('0x31')]['rawAttributes']);_0x2b5897[_0x57e1('0x36')]=_[_0x57e1('0x37')](_0x2254b4[_0x57e1('0x36')]);_0x2b5897['filters']=_[_0x57e1('0x39')](_0x2b5897[_0x57e1('0x3a')],_0x2b5897[_0x57e1('0x36')]);_0x3fc89c[_0x57e1('0x3b')]=_[_0x57e1('0x39')](_0x2b5897[_0x57e1('0x3a')],qs['fields'](_0x2254b4[_0x57e1('0x36')][_0x57e1('0x3c')]));_0x3fc89c[_0x57e1('0x3b')]=_0x3fc89c['attributes'][_0x57e1('0x3d')]?_0x3fc89c[_0x57e1('0x3b')]:_0x2b5897['model'];if(_0x2254b4[_0x57e1('0x36')]['includeAll']){_0x3fc89c[_0x57e1('0x4b')]=[{'all':!![]}];}_0x3fc89c=_[_0x57e1('0x45')]({},_0x3fc89c,_0x2254b4[_0x57e1('0x46')]);return db[_0x57e1('0x31')][_0x57e1('0x4c')](_0x3fc89c)['then'](handleEntityNotFound(_0x14d690,null))[_0x57e1('0x29')](respondWithResult(_0x14d690,null))[_0x57e1('0x48')](handleError(_0x14d690,null));};exports[_0x57e1('0x4d')]=function(_0x2e6cfa,_0x41999b){return db[_0x57e1('0x31')][_0x57e1('0x4d')](_0x2e6cfa['body'],{})[_0x57e1('0x29')](function(_0x10a773){var _0xe2743c=_0x2e6cfa[_0x57e1('0x4e')][_0x57e1('0x4f')]({'plain':!![]});if(!_0xe2743c)throw new Error(_0x57e1('0x50'));if(_0xe2743c[_0x57e1('0x51')]===_0x57e1('0x4e')){var _0x390d85=_0x10a773['get']({'plain':!![]});var _0x5588a6=_0x57e1('0x52');return db['UserProfileSection'][_0x57e1('0x4c')]({'where':{'name':_0x5588a6,'userProfileId':_0xe2743c[_0x57e1('0x53')]},'raw':!![]})[_0x57e1('0x29')](function(_0x36bb56){if(_0x36bb56&&_0x36bb56['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x390d85[_0x57e1('0x2d')],'resourceId':_0x390d85['id'],'type':_0x36bb56[_0x57e1('0x2d')],'sectionId':_0x36bb56['id']},{})[_0x57e1('0x29')](function(){return _0x10a773;});}else{return _0x10a773;}})[_0x57e1('0x48')](function(_0xaee0f0){logger[_0x57e1('0x2b')](_0x57e1('0x54'),_0xaee0f0);throw _0xaee0f0;});}return _0x10a773;})[_0x57e1('0x29')](respondWithResult(_0x41999b,0xc9))[_0x57e1('0x48')](handleError(_0x41999b,null));};exports['update']=function(_0x37ab4d,_0x4a41ad){if(_0x37ab4d[_0x57e1('0x55')]['id']){delete _0x37ab4d['body']['id'];}return db[_0x57e1('0x31')]['find']({'where':{'id':_0x37ab4d['params']['id']}})[_0x57e1('0x29')](handleEntityNotFound(_0x4a41ad,null))[_0x57e1('0x29')](saveUpdates(_0x37ab4d[_0x57e1('0x55')],null))[_0x57e1('0x29')](respondWithResult(_0x4a41ad,null))['catch'](handleError(_0x4a41ad,null));};exports[_0x57e1('0x56')]=function(_0x431b3f,_0x2c3e34){var _0x14a45a=_0x431b3f[_0x57e1('0x4a')]['id'];var _0x33c476=[];return db[_0x57e1('0x57')][_0x57e1('0x58')](function(_0x363a9c){var _0x5952e9=_0x57e1('0x59')+_0x14a45a;return db[_0x57e1('0x57')][_0x57e1('0x36')](_0x5952e9,{'type':db[_0x57e1('0x5a')]['QueryTypes'][_0x57e1('0x5b')],'raw':!![],'transaction':_0x363a9c})[_0x57e1('0x29')](function(_0x2bef86){_0x33c476=_['map'](_0x2bef86,function(_0x437427){return Number(_0x437427[_0x57e1('0x5c')]);});})[_0x57e1('0x29')](function(){var _0x566ce9=_0x57e1('0x5d')+_0x14a45a;return db['sequelize'][_0x57e1('0x36')](_0x566ce9,{'type':db[_0x57e1('0x5a')]['QueryTypes'][_0x57e1('0x5b')],'raw':!![],'transaction':_0x363a9c});})['then'](function(_0x335a2c){var _0x41e066=_['map'](_0x335a2c,function(_0x54a8c8){return Number(_0x54a8c8[_0x57e1('0x5e')]);});return db['UserVoiceQueue'][_0x57e1('0x56')]({'where':{'UserId':{'$in':_0x33c476},'VoiceQueueId':{'$in':_0x41e066}},'transaction':_0x363a9c});})[_0x57e1('0x29')](function(){var _0x362165=_0x57e1('0x5f')+_0x14a45a;return db['sequelize'][_0x57e1('0x36')](_0x362165,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x363a9c});})[_0x57e1('0x29')](function(_0x222f02){var _0x278a46=_[_0x57e1('0x30')](_0x222f02,function(_0x42a2a9){return Number(_0x42a2a9['MailQueueId']);});return db[_0x57e1('0x60')]['destroy']({'where':{'UserId':{'$in':_0x33c476},'MailQueueId':{'$in':_0x278a46}},'transaction':_0x363a9c});})['then'](function(){var _0xaab01a='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x14a45a;return db[_0x57e1('0x57')][_0x57e1('0x36')](_0xaab01a,{'type':db[_0x57e1('0x5a')][_0x57e1('0x61')][_0x57e1('0x5b')],'raw':!![],'transaction':_0x363a9c});})[_0x57e1('0x29')](function(_0x59261f){var _0x5e39e0=_['map'](_0x59261f,function(_0x7eb89b){return Number(_0x7eb89b['SmsQueueId']);});return db[_0x57e1('0x62')][_0x57e1('0x56')]({'where':{'UserId':{'$in':_0x33c476},'SmsQueueId':{'$in':_0x5e39e0}},'transaction':_0x363a9c});})[_0x57e1('0x29')](function(){var _0x292447='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x14a45a;return db[_0x57e1('0x57')][_0x57e1('0x36')](_0x292447,{'type':db[_0x57e1('0x5a')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x363a9c});})['then'](function(_0x57749c){var _0x7238e=_[_0x57e1('0x30')](_0x57749c,function(_0x147df6){return Number(_0x147df6[_0x57e1('0x63')]);});return db['UserChatQueue'][_0x57e1('0x56')]({'where':{'UserId':{'$in':_0x33c476},'ChatQueueId':{'$in':_0x7238e}},'transaction':_0x363a9c});})['then'](function(){var _0x67364b=_0x57e1('0x64')+_0x14a45a;return db[_0x57e1('0x57')][_0x57e1('0x36')](_0x67364b,{'type':db[_0x57e1('0x5a')][_0x57e1('0x61')][_0x57e1('0x5b')],'raw':!![],'transaction':_0x363a9c});})[_0x57e1('0x29')](function(_0x337261){var _0x40b71e=_['map'](_0x337261,function(_0x4e7af3){return Number(_0x4e7af3['FaxQueueId']);});return db[_0x57e1('0x65')][_0x57e1('0x56')]({'where':{'UserId':{'$in':_0x33c476},'FaxQueueId':{'$in':_0x40b71e}},'transaction':_0x363a9c});})[_0x57e1('0x29')](function(){var _0x5efc18=_0x57e1('0x66')+_0x14a45a;return db[_0x57e1('0x57')][_0x57e1('0x36')](_0x5efc18,{'type':db[_0x57e1('0x5a')][_0x57e1('0x61')]['SELECT'],'raw':!![],'transaction':_0x363a9c});})[_0x57e1('0x29')](function(_0x92ec94){var _0x2c6b2e=_[_0x57e1('0x30')](_0x92ec94,function(_0x517da6){return Number(_0x517da6[_0x57e1('0x67')]);});return db[_0x57e1('0x68')]['destroy']({'where':{'UserId':{'$in':_0x33c476},'OpenchannelQueueId':{'$in':_0x2c6b2e}},'transaction':_0x363a9c});})[_0x57e1('0x29')](function(){var _0x839a8a='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x14a45a;return db[_0x57e1('0x57')][_0x57e1('0x36')](_0x839a8a,{'type':db[_0x57e1('0x5a')]['QueryTypes'][_0x57e1('0x5b')],'raw':!![],'transaction':_0x363a9c});})[_0x57e1('0x29')](function(_0x5e9bc6){var _0x32c7c3=_['map'](_0x5e9bc6,function(_0x160da6){return Number(_0x160da6[_0x57e1('0x69')]);});return db['UserWhatsappQueue'][_0x57e1('0x56')]({'where':{'UserId':{'$in':_0x33c476},'WhatsappQueueId':{'$in':_0x32c7c3}},'transaction':_0x363a9c});})[_0x57e1('0x29')](function(){return db[_0x57e1('0x6a')][_0x57e1('0x4c')]({'where':{'TeamId':_0x14a45a}});})[_0x57e1('0x29')](function(_0x3dbcf3){if(_0x3dbcf3===null){return;}return db[_0x57e1('0x6b')][_0x57e1('0x56')]({'where':{'UserId':{'$in':_0x33c476},'VoicePrefixId':_0x3dbcf3[_0x57e1('0x6c')]},'transaction':_0x363a9c});})[_0x57e1('0x29')](function(){return db[_0x57e1('0x31')][_0x57e1('0x56')]({'where':{'id':_0x14a45a},'cascade':!![],'transaction':_0x363a9c});})['then'](function(_0x2de53a){if(_0x2de53a===0x0){_0x2c3e34[_0x57e1('0x2a')](0x194);}else{return db['UserProfileResource'][_0x57e1('0x56')]({'where':{'type':_0x57e1('0x52'),'resourceId':_0x14a45a},'cascade':!![],'transaction':_0x363a9c})[_0x57e1('0x29')](function(){_0x2c3e34[_0x57e1('0x1c')](0xcc)[_0x57e1('0x1d')]();});}})[_0x57e1('0x48')](function(_0x45cca4){_0x2c3e34['status'](0x1f4)['send'](_0x45cca4);});});};exports['getQueues']=function(_0x3b9f41,_0x42024a,_0x3391a5){return db[_0x57e1('0x31')]['findOne']({'where':{'id':_0x3b9f41[_0x57e1('0x4a')]['id']}})[_0x57e1('0x29')](handleEntityNotFound(_0x42024a,null))[_0x57e1('0x29')](function(_0x5cfd0d){if(!_0x3b9f41[_0x57e1('0x36')][_0x57e1('0x6d')]||!utils[_0x57e1('0x6e')](_0x3b9f41['query'][_0x57e1('0x6d')])){throw new db['Sequelize'][(_0x57e1('0x6f'))]('Unknown\x20channel');}var _0x410ec1={};var _0x265134={};_0x265134[_0x57e1('0x3a')]=_['keys'](db[_[_0x57e1('0x70')](_0x3b9f41[_0x57e1('0x36')][_0x57e1('0x6d')][_0x57e1('0x71')]())+_0x57e1('0x72')][_0x57e1('0x32')]);_0x265134[_0x57e1('0x36')]=_[_0x57e1('0x37')](_0x3b9f41[_0x57e1('0x36')]);_0x265134[_0x57e1('0x38')]=_['intersection'](_0x265134[_0x57e1('0x3a')],_0x265134[_0x57e1('0x36')]);_0x410ec1[_0x57e1('0x3b')]=_[_0x57e1('0x39')](_0x265134['model'],qs[_0x57e1('0x3c')](_0x3b9f41['query'][_0x57e1('0x3c')]));_0x410ec1[_0x57e1('0x3b')]=_0x410ec1[_0x57e1('0x3b')][_0x57e1('0x3d')]?_0x410ec1[_0x57e1('0x3b')]:_0x265134['model'];_0x410ec1[_0x57e1('0x20')]=qs[_0x57e1('0x20')](_0x3b9f41['query'][_0x57e1('0x20')]);_0x410ec1[_0x57e1('0x1f')]=qs[_0x57e1('0x1f')](_0x3b9f41['query']['offset']);_0x410ec1['order']=qs[_0x57e1('0x40')](_0x3b9f41[_0x57e1('0x36')]['sort']);_0x410ec1['where']=qs['filters'](_[_0x57e1('0x42')](_0x3b9f41['query'],_0x265134[_0x57e1('0x38')]));_0x410ec1=_[_0x57e1('0x45')]({},_0x410ec1,_0x3b9f41[_0x57e1('0x46')]);return _0x5cfd0d[_0x57e1('0x4f')+_[_0x57e1('0x70')](_0x3b9f41[_0x57e1('0x36')][_0x57e1('0x6d')][_0x57e1('0x71')]())+_0x57e1('0x73')](_0x410ec1);})[_0x57e1('0x29')](respondWithResult(_0x42024a,null))[_0x57e1('0x48')](handleError(_0x42024a,null));};exports[_0x57e1('0x74')]=function(_0x192ebe,_0x933d22,_0x4cb1d4){return db['Team']['findOne']({'where':{'id':_0x192ebe['params']['id']}})['then'](function(_0x25b194){if(_0x25b194){if(!_0x192ebe['body']['channel']||!utils['isValidChannel'](_0x192ebe[_0x57e1('0x55')]['channel'])){throw new db[(_0x57e1('0x5a'))][(_0x57e1('0x6f'))](_0x57e1('0x75'));}return _0x25b194['add'+_[_0x57e1('0x70')](_0x192ebe['body'][_0x57e1('0x6d')]['toLowerCase']())+_0x57e1('0x73')](_0x192ebe[_0x57e1('0x55')][_0x57e1('0x76')]);}return null;})[_0x57e1('0x29')](handleEntityNotFound(_0x933d22,null))[_0x57e1('0x29')](respondWithStatusCode(_0x933d22,null))[_0x57e1('0x48')](handleError(_0x933d22,null));};exports[_0x57e1('0x77')]=function(_0x19e40a,_0x3a3077,_0x2727c6){return db[_0x57e1('0x31')][_0x57e1('0x78')]({'where':{'id':_0x19e40a[_0x57e1('0x4a')]['id']}})[_0x57e1('0x29')](function(_0x4f7b2b){if(_0x4f7b2b){if(!_0x19e40a[_0x57e1('0x36')][_0x57e1('0x6d')]||!utils[_0x57e1('0x6e')](_0x19e40a[_0x57e1('0x36')][_0x57e1('0x6d')])){throw new db['Sequelize'][(_0x57e1('0x6f'))]('Unknown\x20channel');}return _0x4f7b2b[_0x57e1('0x79')+_[_0x57e1('0x70')](_0x19e40a['query']['channel'][_0x57e1('0x71')]())+'Queues'](_0x19e40a[_0x57e1('0x36')][_0x57e1('0x76')]);}return null;})['then'](handleEntityNotFound(_0x3a3077,null))[_0x57e1('0x29')](respondWithStatusCode(_0x3a3077,null))[_0x57e1('0x48')](handleError(_0x3a3077,null));};exports[_0x57e1('0x7a')]=function(_0x10d9f7,_0x3cb9c3){var _0x12db46=_[_0x57e1('0x7b')](_0x10d9f7[_0x57e1('0x55')][_0x57e1('0x76')])?_0x10d9f7['body'][_0x57e1('0x76')]:[_0x10d9f7[_0x57e1('0x55')][_0x57e1('0x76')]];var _0x53f148=_0x10d9f7['params']['id'];return db[_0x57e1('0x31')]['find']({'where':{'id':_0x53f148}})[_0x57e1('0x29')](handleEntityNotFound(_0x3cb9c3,null))[_0x57e1('0x29')](function(_0x3ff4a8){if(_0x3ff4a8){var _0x4d7950=[_0x57e1('0x7c'),_0x57e1('0x7d'),'Mail',_0x57e1('0x7e'),_0x57e1('0x7f'),_0x57e1('0x80'),'Whatsapp'];return db[_0x57e1('0x57')][_0x57e1('0x58')](function(_0x12aef5){var _0x77a76e=_[_0x57e1('0x30')](_0x4d7950,function(_0xbc657a){var _0x49b2fe={'attributes':['id',_0x57e1('0x2d')]};if(_0xbc657a===_0x57e1('0x7c')){_0x49b2fe[_0x57e1('0x81')]={'attributes':[_0x57e1('0x82')]};}return _0x3ff4a8[_0x57e1('0x4f')+_0xbc657a+_0x57e1('0x73')](_0x49b2fe)[_0x57e1('0x29')](function(_0xfb3a03){var _0x5357e5=_[_0x57e1('0x30')](_0xfb3a03,function(_0xf52e35){var _0x559f76=_['map'](_0x12db46,function(_0xc699a3){var _0x134343={'where':{'UserId':_0xc699a3,[_0xbc657a+_0x57e1('0x83')]:_0xf52e35['id']},'transaction':_0x12aef5};if(_0xbc657a===_0x57e1('0x7c')){_0x134343[_0x57e1('0x19')]={'penalty':_0xf52e35[_0x57e1('0x84')][_0x57e1('0x82')]};}return db[_0x57e1('0x85')+_0xbc657a+_0x57e1('0x72')][_0x57e1('0x86')](_0x134343)[_0x57e1('0x29')](function(){socket[_0x57e1('0x87')](_0x57e1('0x4e')+_0xbc657a+_0x57e1('0x88'),{'UserId':_0xc699a3,[_0xbc657a+_0x57e1('0x83')]:_0xf52e35['id']});if(_0xbc657a!==_0x57e1('0x7c')){return;}return db['User']['findAll']({'where':{'id':_0x12db46,'online':0x1},'attributes':['id',_0x57e1('0x2d'),'online',_0x57e1('0x89'),_0x57e1('0x8a')],'raw':!![]})['then'](function(_0x3639d9){var _0x5db41c=_[_0x57e1('0x30')](_0x3639d9,function(_0x41ae9e){return db['UserVoiceQueueRt'][_0x57e1('0x8b')]({'membername':_0x41ae9e['name'],'UserId':_0x41ae9e['id'],'queue_name':_0xf52e35[_0x57e1('0x2d')],'VoiceQueueId':_0xf52e35['id'],'interface':_['isNil'](_0x41ae9e[_0x57e1('0x8a')])?util[_0x57e1('0x8c')](_0x57e1('0x8d'),_0x41ae9e[_0x57e1('0x2d')]):_0x41ae9e[_0x57e1('0x8a')],'paused':_0x41ae9e[_0x57e1('0x89')]||![],'penalty':_0xf52e35[_0x57e1('0x84')][_0x57e1('0x82')]},{'transaction':_0x12aef5});});return Promise[_0x57e1('0x8e')](_0x5db41c);});});});return Promise[_0x57e1('0x8e')](_0x559f76);});return Promise[_0x57e1('0x8e')](_0x5357e5);})[_0x57e1('0x29')](function(){return db[_0x57e1('0x6a')][_0x57e1('0x78')]({'where':{'teamId':_0x53f148}})[_0x57e1('0x29')](function(_0x39b5b8){if(_0x39b5b8){var _0x6bfa=_[_0x57e1('0x30')](_0x12db46,function(_0x2fc309){db[_0x57e1('0x6b')][_0x57e1('0x8b')]({'UserId':_0x2fc309,'VoicePrefixId':_0x39b5b8[_0x57e1('0x6c')]});});return Promise[_0x57e1('0x8e')](_0x6bfa);}});});});return Promise[_0x57e1('0x8e')](_0x77a76e)[_0x57e1('0x29')](function(){return _0x3ff4a8['addAgents'](_0x12db46,{'transaction':_0x12aef5})[_0x57e1('0x8f')](function(_0x3af05a){return _0x3af05a;});});});}})[_0x57e1('0x29')](respondWithResult(_0x3cb9c3,null))['catch'](handleError(_0x3cb9c3,null));};exports[_0x57e1('0x90')]=function(_0x4714cb,_0x444751){var _0x42447d=_[_0x57e1('0x7b')](_0x4714cb[_0x57e1('0x36')][_0x57e1('0x76')])?_0x4714cb[_0x57e1('0x36')]['ids']:[_0x4714cb['query'][_0x57e1('0x76')]];var _0x1c6c12=_0x4714cb[_0x57e1('0x4a')]['id'];return db[_0x57e1('0x31')][_0x57e1('0x4c')]({'where':{'id':_0x1c6c12}})[_0x57e1('0x29')](handleEntityNotFound(_0x444751,null))[_0x57e1('0x29')](function(_0x4073b0){if(_0x4073b0){var _0x1c015a=[_0x57e1('0x7c'),_0x57e1('0x7d'),_0x57e1('0x91'),_0x57e1('0x7e'),_0x57e1('0x7f'),_0x57e1('0x80'),'Whatsapp'];return db[_0x57e1('0x57')][_0x57e1('0x58')](function(_0x59ce72){var _0x371418=_[_0x57e1('0x30')](_0x1c015a,function(_0x2c4235){var _0x587b55={'attributes':['id',_0x57e1('0x2d')]};return _0x4073b0[_0x57e1('0x4f')+_0x2c4235+'Queues'](_0x587b55)['then'](function(_0x4ec2d3){var _0x76537b=_['map'](_0x4ec2d3,function(_0x4cee2e){return _0x4cee2e[_0x57e1('0x90')](_0x42447d,{'transaction':_0x59ce72})[_0x57e1('0x29')](function(){var _0x3305eb=_[_0x57e1('0x30')](_0x42447d,function(_0x48c31c){socket[_0x57e1('0x87')]('user'+_0x2c4235+_0x57e1('0x92'),{'UserId':Number(_0x48c31c),[_0x2c4235+_0x57e1('0x83')]:_0x4cee2e['id']});if(_0x2c4235!==_0x57e1('0x7c')){return;}return db[_0x57e1('0x93')][_0x57e1('0x56')]({'where':{'VoiceQueueId':_0x4cee2e['id'],'UserId':_0x48c31c},'transaction':_0x59ce72});});return Promise[_0x57e1('0x8e')](_0x3305eb);});});return Promise[_0x57e1('0x8e')](_0x76537b);});});return Promise[_0x57e1('0x8e')](_0x371418)['then'](function(){return _0x4073b0[_0x57e1('0x90')](_0x42447d,{'transaction':_0x59ce72});})[_0x57e1('0x29')](function(){return db[_0x57e1('0x6a')]['findOne']({'where':{'teamId':_0x1c6c12}})[_0x57e1('0x29')](function(_0x783d7d){if(_0x783d7d){var _0x5254a8=_[_0x57e1('0x30')](_0x42447d,function(_0x4f7943){db[_0x57e1('0x6b')][_0x57e1('0x56')]({'where':{'UserId':_0x4f7943,'VoicePrefixId':_0x783d7d[_0x57e1('0x6c')]}});});return Promise[_0x57e1('0x8e')](_0x5254a8);}});});});}})['then'](respondWithStatusCode(_0x444751,null))['catch'](handleError(_0x444751,null));};exports['getAgents']=function(_0x487e06,_0x39d839,_0x44e04b){var _0x24f22a={};var _0x47bca4={};var _0x29fe96;var _0x38a2c5;return db[_0x57e1('0x31')]['findOne']({'where':{'id':_0x487e06[_0x57e1('0x4a')]['id']}})[_0x57e1('0x29')](handleEntityNotFound(_0x39d839,null))[_0x57e1('0x29')](function(_0x1b97b0){if(_0x1b97b0){_0x29fe96=_0x1b97b0;_0x47bca4['model']=_['keys'](db[_0x57e1('0x85')][_0x57e1('0x32')]);_0x47bca4['query']=_['keys'](_0x487e06['query']);_0x47bca4[_0x57e1('0x38')]=_[_0x57e1('0x39')](_0x47bca4[_0x57e1('0x3a')],_0x47bca4[_0x57e1('0x36')]);_0x24f22a[_0x57e1('0x3b')]=_[_0x57e1('0x39')](_0x47bca4[_0x57e1('0x3a')],qs[_0x57e1('0x3c')](_0x487e06[_0x57e1('0x36')]['fields']));_0x24f22a[_0x57e1('0x3b')]=_0x24f22a[_0x57e1('0x3b')][_0x57e1('0x3d')]?_0x24f22a['attributes']:_0x47bca4[_0x57e1('0x3a')];_0x24f22a[_0x57e1('0x3f')]=qs['sort'](_0x487e06[_0x57e1('0x36')][_0x57e1('0x40')]);_0x24f22a[_0x57e1('0x41')]=qs[_0x57e1('0x38')](_[_0x57e1('0x42')](_0x487e06[_0x57e1('0x36')],_0x47bca4[_0x57e1('0x38')]));if(_0x487e06[_0x57e1('0x36')]['filter']){_0x24f22a[_0x57e1('0x41')]=_[_0x57e1('0x45')](_0x24f22a[_0x57e1('0x41')],{'$or':_[_0x57e1('0x30')](_0x24f22a[_0x57e1('0x3b')],function(_0x2cbabf){var _0x442f8e={};_0x442f8e[_0x2cbabf]={'$like':'%'+_0x487e06[_0x57e1('0x36')][_0x57e1('0x43')]+'%'};return _0x442f8e;})});}_0x24f22a=_[_0x57e1('0x45')]({},_0x24f22a,_0x487e06[_0x57e1('0x46')]);return _0x29fe96[_0x57e1('0x94')](_0x24f22a);}})[_0x57e1('0x29')](function(_0x2a9ec1){if(_0x2a9ec1){_0x38a2c5=_0x2a9ec1[_0x57e1('0x3d')];if(!_0x487e06[_0x57e1('0x36')][_0x57e1('0x95')](_0x57e1('0x3e'))){_0x24f22a[_0x57e1('0x20')]=qs['limit'](_0x487e06[_0x57e1('0x36')][_0x57e1('0x20')]);_0x24f22a['offset']=qs[_0x57e1('0x1f')](_0x487e06[_0x57e1('0x36')]['offset']);}return _0x29fe96[_0x57e1('0x94')](_0x24f22a);}})[_0x57e1('0x29')](function(_0x14e942){if(_0x14e942){return _0x14e942?{'count':_0x38a2c5,'rows':_0x14e942}:null;}})[_0x57e1('0x29')](respondWithResult(_0x39d839,null))[_0x57e1('0x48')](handleError(_0x39d839,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index b3ffd45..2a1941c 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 _0x35ae=['setMaxListeners','emit','hook','exports','events','../../mysqldb','Team'];(function(_0x43e1e9,_0x31a26b){var _0x4a98a9=function(_0x50bfc0){while(--_0x50bfc0){_0x43e1e9['push'](_0x43e1e9['shift']());}};_0x4a98a9(++_0x31a26b);}(_0x35ae,0x13f));var _0xe35a=function(_0x341634,_0x437194){_0x341634=_0x341634-0x0;var _0x59b584=_0x35ae[_0x341634];return _0x59b584;};'use strict';var EventEmitter=require(_0xe35a('0x0'));var Team=require(_0xe35a('0x1'))['db'][_0xe35a('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xe35a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x114031){return function(_0x4765d5,_0x5d3c02,_0x3820eb){TeamEvents[_0xe35a('0x4')](_0x114031+':'+_0x4765d5['id'],_0x4765d5);TeamEvents[_0xe35a('0x4')](_0x114031,_0x4765d5);_0x3820eb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xe35a('0x5')](e,emitEvent(event));}}module[_0xe35a('0x6')]=TeamEvents; \ No newline at end of file +var _0xaa50=['Team','setMaxListeners','update','emit','hasOwnProperty','../../mysqldb'];(function(_0x437ee9,_0x392761){var _0x4e66c4=function(_0xa9722d){while(--_0xa9722d){_0x437ee9['push'](_0x437ee9['shift']());}};_0x4e66c4(++_0x392761);}(_0xaa50,0x19d));var _0x0aa5=function(_0x30ebbc,_0x481b0f){_0x30ebbc=_0x30ebbc-0x0;var _0x2fd850=_0xaa50[_0x30ebbc];return _0x2fd850;};'use strict';var EventEmitter=require('events');var Team=require(_0x0aa5('0x0'))['db'][_0x0aa5('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x0aa5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0aa5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x278823){return function(_0x248a3c,_0x2612a0,_0xa5e1f6){TeamEvents[_0x0aa5('0x4')](_0x278823+':'+_0x248a3c['id'],_0x248a3c);TeamEvents[_0x0aa5('0x4')](_0x278823,_0x248a3c);_0xa5e1f6(null);};}for(var e in events){if(events[_0x0aa5('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index a3f8495..30396ff 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 _0x88ca=['map','setDataValue','channel','exports','define','teams','Chat','Fax','Mail','Openchannel','Voice','all','catch','./team.attributes','get','Queues','then'];(function(_0x4fd1bf,_0xcfdab2){var _0x1d980a=function(_0x4677f4){while(--_0x4677f4){_0x4fd1bf['push'](_0x4fd1bf['shift']());}};_0x1d980a(++_0xcfdab2);}(_0x88ca,0x194));var _0xa88c=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x88ca[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require('lodash');var attributes=require(_0xa88c('0x0'));function getQueuesByChannel(_0x449ace,_0x45fba6){var _0xcadfd8=_0xa88c('0x1')+_0x45fba6+_0xa88c('0x2');return _0x449ace[_0xcadfd8]()[_0xa88c('0x3')](function(_0xc114cc){return _[_0xa88c('0x4')](_0xc114cc,function(_0x46b464){_0x46b464[_0xa88c('0x5')](_0xa88c('0x6'),_0x45fba6);return _0x46b464;});})['catch'](function(_0x5f526c){throw _0x5f526c;});}module[_0xa88c('0x7')]=function(_0x394626){return _0x394626[_0xa88c('0x8')]('Team',attributes,{'tableName':_0xa88c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x3f3b6a=this;var _0x50a8d4=[_0xa88c('0xa'),_0xa88c('0xb'),_0xa88c('0xc'),_0xa88c('0xd'),'Sms',_0xa88c('0xe'),'Whatsapp'];return Promise['resolve']()[_0xa88c('0x3')](function(){var _0x191b7e=_['map'](_0x50a8d4,function(_0xc21949){return getQueuesByChannel(_0x3f3b6a,_0xc21949);});return Promise[_0xa88c('0xf')](_0x191b7e);})[_0xa88c('0x10')](function(_0x29b46e){throw _0x29b46e;});}}});}; \ No newline at end of file +var _0xb2b4=['exports','Team','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','lodash','./team.attributes','get','Queues','then','map','catch'];(function(_0xa84f2,_0x2874de){var _0x1ae706=function(_0x50db96){while(--_0x50db96){_0xa84f2['push'](_0xa84f2['shift']());}};_0x1ae706(++_0x2874de);}(_0xb2b4,0xbc));var _0x4b2b=function(_0x4e0eb6,_0x240784){_0x4e0eb6=_0x4e0eb6-0x0;var _0x46e432=_0xb2b4[_0x4e0eb6];return _0x46e432;};'use strict';var _=require(_0x4b2b('0x0'));var attributes=require(_0x4b2b('0x1'));function getQueuesByChannel(_0x1ca645,_0x448df6){var _0x36df16=_0x4b2b('0x2')+_0x448df6+_0x4b2b('0x3');return _0x1ca645[_0x36df16]()[_0x4b2b('0x4')](function(_0x4ea346){return _[_0x4b2b('0x5')](_0x4ea346,function(_0x5953df){_0x5953df['setDataValue']('channel',_0x448df6);return _0x5953df;});})[_0x4b2b('0x6')](function(_0x4bae3c){throw _0x4bae3c;});}module[_0x4b2b('0x7')]=function(_0x12b20e){return _0x12b20e['define'](_0x4b2b('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x457148=this;var _0x2ac3b7=['Chat',_0x4b2b('0x9'),_0x4b2b('0xa'),_0x4b2b('0xb'),_0x4b2b('0xc'),_0x4b2b('0xd'),_0x4b2b('0xe')];return Promise['resolve']()[_0x4b2b('0x4')](function(){var _0x46bcd7=_['map'](_0x2ac3b7,function(_0x1fe309){return getQueuesByChannel(_0x457148,_0x1fe309);});return Promise['all'](_0x46bcd7);})[_0x4b2b('0x6')](function(_0x8d1bc5){throw _0x8d1bc5;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 4400d38..18f86f9 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 _0xe733=['Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./team.socket','request','then'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe733,0xb3));var _0x3e73=function(_0x500b35,_0x4cca81){_0x500b35=_0x500b35-0x0;var _0x2cd764=_0xe733[_0x500b35];return _0x2cd764;};'use strict';var _=require(_0x3e73('0x0'));var util=require(_0x3e73('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3e73('0x2'));var fs=require('fs');var Redis=require(_0x3e73('0x3'));var db=require(_0x3e73('0x4'))['db'];var utils=require(_0x3e73('0x5'));var logger=require(_0x3e73('0x6'))(_0x3e73('0x7'));var config=require('../../config/environment');var jayson=require(_0x3e73('0x8'));var client=jayson[_0x3e73('0x9')]['http']({'port':0x232a});config[_0x3e73('0xa')]=_[_0x3e73('0xb')](config[_0x3e73('0xa')],{'host':_0x3e73('0xc'),'port':0x18eb});var socket=require(_0x3e73('0xd'))(new Redis(config[_0x3e73('0xa')]));require(_0x3e73('0xe'))['register'](socket);function respondWithRpcPromise(_0x89553c,_0x3cb30f,_0xd64afb){return new BPromise(function(_0x2e183b,_0x4f4c9d){return client[_0x3e73('0xf')](_0x89553c,_0xd64afb)[_0x3e73('0x10')](function(_0x3c17fd){logger['info'](_0x3e73('0x11'),_0x3cb30f,'request\x20sent');logger[_0x3e73('0x12')](_0x3e73('0x13'),_0x3cb30f,_0x3e73('0x14'),JSON[_0x3e73('0x15')](_0x3c17fd));if(_0x3c17fd[_0x3e73('0x16')]){if(_0x3c17fd[_0x3e73('0x16')][_0x3e73('0x17')]===0x1f4){logger[_0x3e73('0x16')](_0x3e73('0x11'),_0x3cb30f,_0x3c17fd[_0x3e73('0x16')][_0x3e73('0x18')]);return _0x4f4c9d(_0x3c17fd[_0x3e73('0x16')][_0x3e73('0x18')]);}logger[_0x3e73('0x16')](_0x3e73('0x11'),_0x3cb30f,_0x3c17fd[_0x3e73('0x16')][_0x3e73('0x18')]);return _0x2e183b(_0x3c17fd[_0x3e73('0x16')][_0x3e73('0x18')]);}else{logger[_0x3e73('0x19')](_0x3e73('0x11'),_0x3cb30f,'request\x20sent');_0x2e183b(_0x3c17fd[_0x3e73('0x1a')][_0x3e73('0x18')]);}})[_0x3e73('0x1b')](function(_0x4288c3){logger[_0x3e73('0x16')]('Team,\x20%s,\x20%s',_0x3cb30f,_0x4288c3);_0x4f4c9d(_0x4288c3);});});} \ No newline at end of file +var _0xfff3=['localhost','socket.io-emitter','./team.socket','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis'];(function(_0x4ec926,_0x273d7f){var _0x1c352d=function(_0x292f9b){while(--_0x292f9b){_0x4ec926['push'](_0x4ec926['shift']());}};_0x1c352d(++_0x273d7f);}(_0xfff3,0x79));var _0x3fff=function(_0x416226,_0x5970b0){_0x416226=_0x416226-0x0;var _0x1d55f3=_0xfff3[_0x416226];return _0x1d55f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3fff('0x0'));var BPromise=require(_0x3fff('0x1'));var rs=require(_0x3fff('0x2'));var fs=require('fs');var Redis=require(_0x3fff('0x3'));var db=require(_0x3fff('0x4'))['db'];var utils=require(_0x3fff('0x5'));var logger=require(_0x3fff('0x6'))(_0x3fff('0x7'));var config=require(_0x3fff('0x8'));var jayson=require(_0x3fff('0x9'));var client=jayson[_0x3fff('0xa')][_0x3fff('0xb')]({'port':0x232a});config['redis']=_[_0x3fff('0xc')](config[_0x3fff('0xd')],{'host':_0x3fff('0xe'),'port':0x18eb});var socket=require(_0x3fff('0xf'))(new Redis(config[_0x3fff('0xd')]));require(_0x3fff('0x10'))['register'](socket);function respondWithRpcPromise(_0x376346,_0x3a73ac,_0x45ce4c){return new BPromise(function(_0xf04304,_0x3b14f5){return client[_0x3fff('0x11')](_0x376346,_0x45ce4c)[_0x3fff('0x12')](function(_0x32ecaf){logger[_0x3fff('0x13')](_0x3fff('0x14'),_0x3a73ac,_0x3fff('0x15'));logger[_0x3fff('0x16')](_0x3fff('0x17'),_0x3a73ac,'request\x20sent',JSON['stringify'](_0x32ecaf));if(_0x32ecaf['error']){if(_0x32ecaf[_0x3fff('0x18')][_0x3fff('0x19')]===0x1f4){logger[_0x3fff('0x18')](_0x3fff('0x14'),_0x3a73ac,_0x32ecaf[_0x3fff('0x18')][_0x3fff('0x1a')]);return _0x3b14f5(_0x32ecaf[_0x3fff('0x18')][_0x3fff('0x1a')]);}logger[_0x3fff('0x18')](_0x3fff('0x14'),_0x3a73ac,_0x32ecaf[_0x3fff('0x18')][_0x3fff('0x1a')]);return _0xf04304(_0x32ecaf[_0x3fff('0x18')][_0x3fff('0x1a')]);}else{logger['info'](_0x3fff('0x14'),_0x3a73ac,_0x3fff('0x15'));_0xf04304(_0x32ecaf['result'][_0x3fff('0x1a')]);}})['catch'](function(_0x3fdf3e){logger['error']('Team,\x20%s,\x20%s',_0x3a73ac,_0x3fdf3e);_0x3b14f5(_0x3fdf3e);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 3daa99e..6176cc3 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 _0x5a97=['team:','./team.events','save','update','emit','removeListener','register','length'];(function(_0x30853f,_0x4aa320){var _0x3c416d=function(_0x15d3d2){while(--_0x15d3d2){_0x30853f['push'](_0x30853f['shift']());}};_0x3c416d(++_0x4aa320);}(_0x5a97,0x69));var _0x75a9=function(_0x1ac9f4,_0x13c4a3){_0x1ac9f4=_0x1ac9f4-0x0;var _0x1426f4=_0x5a97[_0x1ac9f4];return _0x1426f4;};'use strict';var TeamEvents=require(_0x75a9('0x0'));var events=[_0x75a9('0x1'),'remove',_0x75a9('0x2')];function createListener(_0x21b5a4,_0x4141c1){return function(_0x387249){_0x4141c1[_0x75a9('0x3')](_0x21b5a4,_0x387249);};}function removeListener(_0x9838b9,_0xe4b618){return function(){TeamEvents[_0x75a9('0x4')](_0x9838b9,_0xe4b618);};}exports[_0x75a9('0x5')]=function(_0x1fc109){for(var _0x1b5db2=0x0,_0x384d9f=events[_0x75a9('0x6')];_0x1b5db2<_0x384d9f;_0x1b5db2++){var _0x255df2=events[_0x1b5db2];var _0x3c4f34=createListener(_0x75a9('0x7')+_0x255df2,_0x1fc109);TeamEvents['on'](_0x255df2,_0x3c4f34);}}; \ No newline at end of file +var _0xa902=['update','removeListener','register','./team.events','save','remove'];(function(_0x20d7a4,_0x9b5654){var _0x37f2c1=function(_0x598d87){while(--_0x598d87){_0x20d7a4['push'](_0x20d7a4['shift']());}};_0x37f2c1(++_0x9b5654);}(_0xa902,0x8d));var _0x2a90=function(_0x5cce57,_0x3cbadd){_0x5cce57=_0x5cce57-0x0;var _0x114fc2=_0xa902[_0x5cce57];return _0x114fc2;};'use strict';var TeamEvents=require(_0x2a90('0x0'));var events=[_0x2a90('0x1'),_0x2a90('0x2'),_0x2a90('0x3')];function createListener(_0x1b4117,_0x4983a4){return function(_0x2da982){_0x4983a4['emit'](_0x1b4117,_0x2da982);};}function removeListener(_0x4961c2,_0x169808){return function(){TeamEvents[_0x2a90('0x4')](_0x4961c2,_0x169808);};}exports[_0x2a90('0x5')]=function(_0x21e1d2){for(var _0x4a32c7=0x0,_0x25bcfc=events['length'];_0x4a32c7<_0x25bcfc;_0x4a32c7++){var _0x4109e6=events[_0x4a32c7];var _0x570659=createListener('team:'+_0x4109e6,_0x21e1d2);TeamEvents['on'](_0x4109e6,_0x570659);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index c369c2e..9642048 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 _0x6719=['sequelize','exports','INTEGER'];(function(_0xf4038e,_0x3efff8){var _0xd5a995=function(_0x217fc9){while(--_0x217fc9){_0xf4038e['push'](_0xf4038e['shift']());}};_0xd5a995(++_0x3efff8);}(_0x6719,0xf6));var _0x9671=function(_0x1ac6e5,_0x40f47f){_0x1ac6e5=_0x1ac6e5-0x0;var _0x5877dc=_0x6719[_0x1ac6e5];return _0x5877dc;};'use strict';var Sequelize=require(_0x9671('0x0'));module[_0x9671('0x1')]={'TeamId':{'type':Sequelize[_0x9671('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x9671('0x2')]}}; \ No newline at end of file +var _0x827a=['INTEGER','sequelize'];(function(_0x57c1e5,_0x17238d){var _0x4d1bcf=function(_0x432f7f){while(--_0x432f7f){_0x57c1e5['push'](_0x57c1e5['shift']());}};_0x4d1bcf(++_0x17238d);}(_0x827a,0x167));var _0xa827=function(_0x36e848,_0xa42928){_0x36e848=_0x36e848-0x0;var _0x206de8=_0x827a[_0x36e848];return _0x206de8;};'use strict';var Sequelize=require(_0xa827('0x0'));module['exports']={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xa827('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 37961fc..db9f7dd 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 _0x4d41=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','lodash'];(function(_0x95bcee,_0x520010){var _0x42bfaa=function(_0x1bfa11){while(--_0x1bfa11){_0x95bcee['push'](_0x95bcee['shift']());}};_0x42bfaa(++_0x520010);}(_0x4d41,0x153));var _0x14d4=function(_0xe51964,_0x433b90){_0xe51964=_0xe51964-0x0;var _0x2c2366=_0x4d41[_0xe51964];return _0x2c2366;};'use strict';var _=require(_0x14d4('0x0'));var util=require(_0x14d4('0x1'));var logger=require(_0x14d4('0x2'))('api');var moment=require(_0x14d4('0x3'));var BPromise=require(_0x14d4('0x4'));var rp=require(_0x14d4('0x5'));var fs=require('fs');var path=require(_0x14d4('0x6'));var rimraf=require(_0x14d4('0x7'));var config=require(_0x14d4('0x8'));var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x21f1f2,_0x35eabb){return _0x21f1f2[_0x14d4('0x9')]('TeamVoicePrefix',attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56dc=['team_has_voice_prefixes','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix'];(function(_0x4bfedd,_0xddfbf8){var _0x2e925c=function(_0x3937da){while(--_0x3937da){_0x4bfedd['push'](_0x4bfedd['shift']());}};_0x2e925c(++_0xddfbf8);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc56d('0x0'));var util=require('util');var logger=require(_0xc56d('0x1'))(_0xc56d('0x2'));var moment=require(_0xc56d('0x3'));var BPromise=require(_0xc56d('0x4'));var rp=require(_0xc56d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc56d('0x6'));var config=require(_0xc56d('0x7'));var attributes=require(_0xc56d('0x8'));module[_0xc56d('0x9')]=function(_0x3eb4ed,_0x3e68f4){return _0x3eb4ed['define'](_0xc56d('0xa'),attributes,{'tableName':_0xc56d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 43f27be..776549b 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x22c09a,_0x25c985){var _0x538892=function(_0x2fb989){while(--_0x2fb989){_0x22c09a['push'](_0x22c09a['shift']());}};_0x538892(++_0x25c985);}(_0xedd9,0xfc));var _0x9edd=function(_0x535e3e,_0xca3409){_0x535e3e=_0x535e3e-0x0;var _0x48459f=_0xedd9[_0x535e3e];return _0x48459f;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x55a777,_0x2c95f7){var _0x8ca6a1=function(_0x3cc973){while(--_0x3cc973){_0x55a777['push'](_0x55a777['shift']());}};_0x8ca6a1(++_0x2c95f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 0c5b7f3..bf17b6e 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 _0xf920=['INTEGER','exports'];(function(_0x49f276,_0x53cbd4){var _0x5c257f=function(_0x15e7a8){while(--_0x15e7a8){_0x49f276['push'](_0x49f276['shift']());}};_0x5c257f(++_0x53cbd4);}(_0xf920,0x1a7));var _0x0f92=function(_0x4371a8,_0x3ac39){_0x4371a8=_0x4371a8-0x0;var _0x110901=_0xf920[_0x4371a8];return _0x110901;};'use strict';var Sequelize=require('sequelize');module[_0x0f92('0x0')]={'penalty':{'type':Sequelize[_0x0f92('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe3c5=['sequelize','exports','INTEGER'];(function(_0x1758bc,_0x4582e2){var _0x3a5d89=function(_0x2f18b5){while(--_0x2f18b5){_0x1758bc['push'](_0x1758bc['shift']());}};_0x3a5d89(++_0x4582e2);}(_0xe3c5,0x17d));var _0x5e3c=function(_0x3ba57e,_0x2e6810){_0x3ba57e=_0x3ba57e-0x0;var _0x5d95cf=_0xe3c5[_0x3ba57e];return _0x5d95cf;};'use strict';var Sequelize=require(_0x5e3c('0x0'));module[_0x5e3c('0x1')]={'penalty':{'type':Sequelize[_0x5e3c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 79f28af..b12d26b 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 _0x562d=['path','../../config/environment','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x3b29cd,_0x1f7d63){var _0x43630f=function(_0x4356d5){while(--_0x4356d5){_0x3b29cd['push'](_0x3b29cd['shift']());}};_0x43630f(++_0x1f7d63);}(_0x562d,0xe1));var _0xd562=function(_0x877e,_0x1249a6){_0x877e=_0x877e-0x0;var _0x658f1c=_0x562d[_0x877e];return _0x658f1c;};'use strict';var _=require(_0xd562('0x0'));var util=require(_0xd562('0x1'));var logger=require(_0xd562('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd562('0x3'));var rp=require(_0xd562('0x4'));var fs=require('fs');var path=require(_0xd562('0x5'));var rimraf=require('rimraf');var config=require(_0xd562('0x6'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x1d05e9,_0x46bf9b){return _0x1d05e9[_0xd562('0x7')](_0xd562('0x8'),attributes,{'tableName':_0xd562('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe06f=['../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x1a0600,_0x41feef){var _0x734670=function(_0x2da4e4){while(--_0x2da4e4){_0x1a0600['push'](_0x1a0600['shift']());}};_0x734670(++_0x41feef);}(_0xe06f,0x65));var _0xfe06=function(_0x48db1e,_0x4c6319){_0x48db1e=_0x48db1e-0x0;var _0x677122=_0xe06f[_0x48db1e];return _0x677122;};'use strict';var _=require(_0xfe06('0x0'));var util=require(_0xfe06('0x1'));var logger=require('../../config/logger')(_0xfe06('0x2'));var moment=require('moment');var BPromise=require(_0xfe06('0x3'));var rp=require(_0xfe06('0x4'));var fs=require('fs');var path=require(_0xfe06('0x5'));var rimraf=require(_0xfe06('0x6'));var config=require(_0xfe06('0x7'));var attributes=require(_0xfe06('0x8'));module['exports']=function(_0x4b4be6,_0x530973){return _0x4b4be6[_0xfe06('0x9')](_0xfe06('0xa'),attributes,{'tableName':_0xfe06('0xb'),'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 8e553f7..f28cecb 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 _0xa952=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x1f678d,_0x437f07){var _0x17f8c8=function(_0x12e56e){while(--_0x12e56e){_0x1f678d['push'](_0x1f678d['shift']());}};_0x17f8c8(++_0x437f07);}(_0xa952,0x7c));var _0x2a95=function(_0x9da886,_0x4ad4fa){_0x9da886=_0x9da886-0x0;var _0x279f29=_0xa952[_0x9da886];return _0x279f29;};'use strict';var _=require(_0x2a95('0x0'));var util=require(_0x2a95('0x1'));var moment=require(_0x2a95('0x2'));var BPromise=require(_0x2a95('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a95('0x4'));var db=require(_0x2a95('0x5'))['db'];var utils=require(_0x2a95('0x6'));var logger=require('../../config/logger')(_0x2a95('0x7'));var config=require(_0x2a95('0x8'));var jayson=require(_0x2a95('0x9'));var client=jayson[_0x2a95('0xa')][_0x2a95('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x104a49,_0x11469a,_0x582c29){return new BPromise(function(_0x574567,_0x10c102){return client['request'](_0x104a49,_0x582c29)['then'](function(_0x294eac){logger[_0x2a95('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x11469a,_0x2a95('0xd'));logger['debug'](_0x2a95('0xe'),_0x11469a,_0x2a95('0xd'),JSON[_0x2a95('0xf')](_0x294eac));if(_0x294eac[_0x2a95('0x10')]){if(_0x294eac[_0x2a95('0x10')][_0x2a95('0x11')]===0x1f4){logger[_0x2a95('0x10')](_0x2a95('0x12'),_0x11469a,_0x294eac[_0x2a95('0x10')][_0x2a95('0x13')]);return _0x10c102(_0x294eac[_0x2a95('0x10')]['message']);}logger[_0x2a95('0x10')](_0x2a95('0x12'),_0x11469a,_0x294eac[_0x2a95('0x10')][_0x2a95('0x13')]);return _0x574567(_0x294eac[_0x2a95('0x10')][_0x2a95('0x13')]);}else{logger[_0x2a95('0xc')](_0x2a95('0x12'),_0x11469a,_0x2a95('0xd'));_0x574567(_0x294eac['result'][_0x2a95('0x13')]);}})[_0x2a95('0x14')](function(_0x1c21ca){logger['error'](_0x2a95('0x12'),_0x11469a,_0x1c21ca);_0x10c102(_0x1c21ca);});});} \ No newline at end of file +var _0xac92=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment'];(function(_0x572717,_0x33ef1f){var _0x46ac6e=function(_0x4a144c){while(--_0x4a144c){_0x572717['push'](_0x572717['shift']());}};_0x46ac6e(++_0x33ef1f);}(_0xac92,0x7b));var _0x2ac9=function(_0xd9f8be,_0x34b8a9){_0xd9f8be=_0xd9f8be-0x0;var _0x496027=_0xac92[_0xd9f8be];return _0x496027;};'use strict';var _=require(_0x2ac9('0x0'));var util=require(_0x2ac9('0x1'));var moment=require(_0x2ac9('0x2'));var BPromise=require(_0x2ac9('0x3'));var rs=require(_0x2ac9('0x4'));var fs=require('fs');var Redis=require(_0x2ac9('0x5'));var db=require(_0x2ac9('0x6'))['db'];var utils=require(_0x2ac9('0x7'));var logger=require('../../config/logger')(_0x2ac9('0x8'));var config=require(_0x2ac9('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14108f,_0x2246d9,_0x177a22){return new BPromise(function(_0x24edb4,_0x26f9c8){return client[_0x2ac9('0xa')](_0x14108f,_0x177a22)[_0x2ac9('0xb')](function(_0x4dfc91){logger[_0x2ac9('0xc')](_0x2ac9('0xd'),_0x2246d9,_0x2ac9('0xe'));logger[_0x2ac9('0xf')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2246d9,'request\x20sent',JSON[_0x2ac9('0x10')](_0x4dfc91));if(_0x4dfc91['error']){if(_0x4dfc91[_0x2ac9('0x11')][_0x2ac9('0x12')]===0x1f4){logger[_0x2ac9('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2246d9,_0x4dfc91[_0x2ac9('0x11')][_0x2ac9('0x13')]);return _0x26f9c8(_0x4dfc91[_0x2ac9('0x11')]['message']);}logger[_0x2ac9('0x11')](_0x2ac9('0xd'),_0x2246d9,_0x4dfc91[_0x2ac9('0x11')][_0x2ac9('0x13')]);return _0x24edb4(_0x4dfc91[_0x2ac9('0x11')]['message']);}else{logger[_0x2ac9('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2246d9,_0x2ac9('0xe'));_0x24edb4(_0x4dfc91[_0x2ac9('0x14')][_0x2ac9('0x13')]);}})['catch'](function(_0x22d971){logger[_0x2ac9('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2246d9,_0x22d971);_0x26f9c8(_0x22d971);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 38c51da..569b29f 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 _0xfa4d=['multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xfa4d,0x90));var _0xdfa4=function(_0x33b949,_0x302755){_0x33b949=_0x33b949-0x0;var _0x11449a=_0xfa4d[_0x33b949];return _0x11449a;};'use strict';var multer=require(_0xdfa4('0x0'));var util=require(_0xdfa4('0x1'));var path=require('path');var timeout=require(_0xdfa4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdfa4('0x3'));var interaction=require(_0xdfa4('0x4'));var config=require(_0xdfa4('0x5'));var controller=require(_0xdfa4('0x6'));router[_0xdfa4('0x7')]('/',auth[_0xdfa4('0x8')](),controller[_0xdfa4('0x9')]);router[_0xdfa4('0x7')](_0xdfa4('0xa'),auth[_0xdfa4('0x8')](),controller[_0xdfa4('0xb')]);router[_0xdfa4('0xc')]('/',auth[_0xdfa4('0x8')](),controller[_0xdfa4('0xd')]);router[_0xdfa4('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xdfa4('0xf')]);router[_0xdfa4('0x10')]('/:id',auth[_0xdfa4('0x8')](),controller['destroy']);module[_0xdfa4('0x11')]=router; \ No newline at end of file +var _0x3e0c=['isAuthenticated','show','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','/:id'];(function(_0x57b432,_0x1589a0){var _0x2edf2a=function(_0x20edfc){while(--_0x20edfc){_0x57b432['push'](_0x57b432['shift']());}};_0x2edf2a(++_0x1589a0);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x3eef0d,_0x38a38b){_0x3eef0d=_0x3eef0d-0x0;var _0x2c78fc=_0x3e0c[_0x3eef0d];return _0x2c78fc;};'use strict';var multer=require(_0xc3e0('0x0'));var util=require(_0xc3e0('0x1'));var path=require(_0xc3e0('0x2'));var timeout=require('connect-timeout');var express=require(_0xc3e0('0x3'));var router=express[_0xc3e0('0x4')]();var fs_extra=require(_0xc3e0('0x5'));var auth=require(_0xc3e0('0x6'));var interaction=require(_0xc3e0('0x7'));var config=require('../../config/environment');var controller=require(_0xc3e0('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc3e0('0x9'),auth[_0xc3e0('0xa')](),controller[_0xc3e0('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc3e0('0x9'),auth[_0xc3e0('0xa')](),controller[_0xc3e0('0xc')]);router[_0xc3e0('0xd')](_0xc3e0('0x9'),auth[_0xc3e0('0xa')](),controller[_0xc3e0('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index a59130f..df23489 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 _0x1137=['sequelize','exports','STRING','TEXT'];(function(_0x1d3b20,_0x23b446){var _0x138364=function(_0x543719){while(--_0x543719){_0x1d3b20['push'](_0x1d3b20['shift']());}};_0x138364(++_0x23b446);}(_0x1137,0x13c));var _0x7113=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x1137[_0x49052b];return _0x48c045;};'use strict';var Sequelize=require(_0x7113('0x0'));module[_0x7113('0x1')]={'name':{'type':Sequelize[_0x7113('0x2')]},'description':{'type':Sequelize[_0x7113('0x2')]},'html':{'type':Sequelize[_0x7113('0x3')]}}; \ No newline at end of file +var _0xf7fd=['exports','STRING','TEXT','sequelize'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xf7fd,0xdb));var _0xdf7f=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xf7fd[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require(_0xdf7f('0x0'));module[_0xdf7f('0x1')]={'name':{'type':Sequelize[_0xdf7f('0x2')]},'description':{'type':Sequelize[_0xdf7f('0x2')]},'html':{'type':Sequelize[_0xdf7f('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 725ffe8..659ff81 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 _0xe502=['then','destroy','get','Templates','error','stack','name','send','index','Template','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save'];(function(_0x381372,_0xf0a5a){var _0x4e959a=function(_0x25a897){while(--_0x25a897){_0x381372['push'](_0x381372['shift']());}};_0x4e959a(++_0xf0a5a);}(_0xe502,0x133));var _0x2e50=function(_0x4f3a79,_0x4e6bda){_0x4f3a79=_0x4f3a79-0x0;var _0x498d85=_0xe502[_0x4f3a79];return _0x498d85;};'use strict';var emlformat=require(_0x2e50('0x0'));var rimraf=require(_0x2e50('0x1'));var zipdir=require(_0x2e50('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e50('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2e50('0x4'));var util=require(_0x2e50('0x5'));var path=require(_0x2e50('0x6'));var sox=require(_0x2e50('0x7'));var csv=require(_0x2e50('0x8'));var ejs=require(_0x2e50('0x9'));var fs=require('fs');var fs_extra=require(_0x2e50('0xa'));var _=require('lodash');var squel=require(_0x2e50('0xb'));var crypto=require(_0x2e50('0xc'));var jsforce=require(_0x2e50('0xd'));var deskjs=require(_0x2e50('0xe'));var toCsv=require(_0x2e50('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2e50('0xf'));var authService=require(_0x2e50('0x10'));var qs=require(_0x2e50('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e50('0x12'));var logger=require(_0x2e50('0x13'))(_0x2e50('0x14'));var utils=require(_0x2e50('0x15'));var config=require(_0x2e50('0x16'));var licenseUtil=require(_0x2e50('0x17'));var db=require(_0x2e50('0x18'))['db'];function respondWithStatusCode(_0x14d37f,_0x148be8){_0x148be8=_0x148be8||0xcc;return function(_0x20e9ad){if(_0x20e9ad){return _0x14d37f[_0x2e50('0x19')](_0x148be8);}return _0x14d37f[_0x2e50('0x1a')](_0x148be8)[_0x2e50('0x1b')]();};}function respondWithResult(_0x8fbaf4,_0x57551f){_0x57551f=_0x57551f||0xc8;return function(_0x18e055){if(_0x18e055){return _0x8fbaf4['status'](_0x57551f)[_0x2e50('0x1c')](_0x18e055);}};}function respondWithFilteredResult(_0xd452d7,_0x3c6944){return function(_0x125807){if(_0x125807){var _0x372509=typeof _0x3c6944[_0x2e50('0x1d')]===_0x2e50('0x1e')&&typeof _0x3c6944[_0x2e50('0x1f')]===_0x2e50('0x1e');var _0x57f04b=_0x125807[_0x2e50('0x20')];var _0x275fae=_0x372509?0x0:_0x3c6944[_0x2e50('0x1d')];var _0x249126=_0x372509?_0x125807[_0x2e50('0x20')]:_0x3c6944['offset']+_0x3c6944[_0x2e50('0x1f')];var _0x7d52c0;if(_0x249126>=_0x57f04b){_0x249126=_0x57f04b;_0x7d52c0=0xc8;}else{_0x7d52c0=0xce;}_0xd452d7['status'](_0x7d52c0);return _0xd452d7[_0x2e50('0x21')](_0x2e50('0x22'),_0x275fae+'-'+_0x249126+'/'+_0x57f04b)[_0x2e50('0x1c')](_0x125807);}return null;};}function patchUpdates(_0x9a6691){return function(_0x2567ba){try{jsonpatch['apply'](_0x2567ba,_0x9a6691,!![]);}catch(_0x4c3ec5){return BPromise[_0x2e50('0x23')](_0x4c3ec5);}return _0x2567ba[_0x2e50('0x24')]();};}function saveUpdates(_0x5a6103,_0x26d377){return function(_0x40cfa1){if(_0x40cfa1){return _0x40cfa1['update'](_0x5a6103)[_0x2e50('0x25')](function(_0x327e68){return _0x327e68;});}return null;};}function removeEntity(_0x4aed4c,_0x208afe){return function(_0x32af84){if(_0x32af84){return _0x32af84[_0x2e50('0x26')]()['then'](function(){var _0x35a4a0=_0x32af84[_0x2e50('0x27')]({'plain':!![]});var _0x45e0de=_0x2e50('0x28');return db['UserProfileResource'][_0x2e50('0x26')]({'where':{'type':_0x45e0de,'resourceId':_0x35a4a0['id']}})['then'](function(){return _0x32af84;});})[_0x2e50('0x25')](function(){_0x4aed4c['status'](0xcc)[_0x2e50('0x1b')]();});}};}function handleEntityNotFound(_0x509e51,_0x520e58){return function(_0x34f72d){if(!_0x34f72d){_0x509e51[_0x2e50('0x19')](0x194);}return _0x34f72d;};}function handleError(_0xbf5721,_0x2112f6){_0x2112f6=_0x2112f6||0x1f4;return function(_0xe12573){logger[_0x2e50('0x29')](_0xe12573[_0x2e50('0x2a')]);if(_0xe12573[_0x2e50('0x2b')]){delete _0xe12573['name'];}_0xbf5721[_0x2e50('0x1a')](_0x2112f6)[_0x2e50('0x2c')](_0xe12573);};}exports[_0x2e50('0x2d')]=function(_0x3e97f9,_0x360233){var _0x14dcd6={},_0x5e04fe={},_0x415e54={'count':0x0,'rows':[]};var _0x77df62=_['map'](db[_0x2e50('0x2e')][_0x2e50('0x2f')],function(_0xf2f1cf){return{'name':_0xf2f1cf['fieldName'],'type':_0xf2f1cf[_0x2e50('0x30')][_0x2e50('0x31')]};});_0x5e04fe[_0x2e50('0x32')]=_[_0x2e50('0x33')](_0x77df62,_0x2e50('0x2b'));_0x5e04fe[_0x2e50('0x34')]=_['keys'](_0x3e97f9[_0x2e50('0x34')]);_0x5e04fe[_0x2e50('0x35')]=_[_0x2e50('0x36')](_0x5e04fe[_0x2e50('0x32')],_0x5e04fe[_0x2e50('0x34')]);_0x14dcd6[_0x2e50('0x37')]=_[_0x2e50('0x36')](_0x5e04fe[_0x2e50('0x32')],qs[_0x2e50('0x38')](_0x3e97f9['query'][_0x2e50('0x38')]));_0x14dcd6[_0x2e50('0x37')]=_0x14dcd6[_0x2e50('0x37')][_0x2e50('0x39')]?_0x14dcd6['attributes']:_0x5e04fe[_0x2e50('0x32')];if(!_0x3e97f9[_0x2e50('0x34')][_0x2e50('0x3a')](_0x2e50('0x3b'))){_0x14dcd6[_0x2e50('0x1f')]=qs[_0x2e50('0x1f')](_0x3e97f9[_0x2e50('0x34')]['limit']);_0x14dcd6[_0x2e50('0x1d')]=qs[_0x2e50('0x1d')](_0x3e97f9[_0x2e50('0x34')][_0x2e50('0x1d')]);}_0x14dcd6[_0x2e50('0x3c')]=qs[_0x2e50('0x3d')](_0x3e97f9[_0x2e50('0x34')][_0x2e50('0x3d')]);_0x14dcd6[_0x2e50('0x3e')]=qs['filters'](_[_0x2e50('0x3f')](_0x3e97f9[_0x2e50('0x34')],_0x5e04fe['filters']),_0x77df62);if(_0x3e97f9[_0x2e50('0x34')]['filter']){_0x14dcd6[_0x2e50('0x3e')]=_[_0x2e50('0x40')](_0x14dcd6[_0x2e50('0x3e')],{'$or':_[_0x2e50('0x33')](_0x77df62,function(_0x3287c7){if(_0x3287c7[_0x2e50('0x30')]!=='VIRTUAL'){var _0x1c5b33={};_0x1c5b33[_0x3287c7['name']]={'$like':'%'+_0x3e97f9[_0x2e50('0x34')][_0x2e50('0x41')]+'%'};return _0x1c5b33;}})});}_0x14dcd6=_[_0x2e50('0x40')]({},_0x14dcd6,_0x3e97f9[_0x2e50('0x42')]);var _0x38da08={'where':_0x14dcd6['where']};return db[_0x2e50('0x2e')]['count'](_0x38da08)[_0x2e50('0x25')](function(_0xbe8023){_0x415e54[_0x2e50('0x20')]=_0xbe8023;if(_0x3e97f9['query'][_0x2e50('0x43')]){_0x14dcd6[_0x2e50('0x44')]=[{'all':!![]}];}return db[_0x2e50('0x2e')][_0x2e50('0x45')](_0x14dcd6);})[_0x2e50('0x25')](function(_0x3a0557){_0x415e54[_0x2e50('0x46')]=_0x3a0557;return _0x415e54;})[_0x2e50('0x25')](respondWithFilteredResult(_0x360233,_0x14dcd6))[_0x2e50('0x47')](handleError(_0x360233,null));};exports[_0x2e50('0x48')]=function(_0x30ee27,_0x20a5c7){var _0x330987={'raw':!![],'where':{'id':_0x30ee27['params']['id']}},_0x1dc745={};_0x1dc745[_0x2e50('0x32')]=_['keys'](db[_0x2e50('0x2e')][_0x2e50('0x2f')]);_0x1dc745[_0x2e50('0x34')]=_['keys'](_0x30ee27[_0x2e50('0x34')]);_0x1dc745[_0x2e50('0x35')]=_[_0x2e50('0x36')](_0x1dc745[_0x2e50('0x32')],_0x1dc745[_0x2e50('0x34')]);_0x330987[_0x2e50('0x37')]=_[_0x2e50('0x36')](_0x1dc745[_0x2e50('0x32')],qs[_0x2e50('0x38')](_0x30ee27[_0x2e50('0x34')]['fields']));_0x330987[_0x2e50('0x37')]=_0x330987[_0x2e50('0x37')][_0x2e50('0x39')]?_0x330987[_0x2e50('0x37')]:_0x1dc745['model'];if(_0x30ee27[_0x2e50('0x34')][_0x2e50('0x43')]){_0x330987['include']=[{'all':!![]}];}_0x330987=_[_0x2e50('0x40')]({},_0x330987,_0x30ee27[_0x2e50('0x42')]);return db['Template'][_0x2e50('0x49')](_0x330987)[_0x2e50('0x25')](handleEntityNotFound(_0x20a5c7,null))[_0x2e50('0x25')](respondWithResult(_0x20a5c7,null))['catch'](handleError(_0x20a5c7,null));};exports['create']=function(_0x246091,_0x49b664){return db[_0x2e50('0x2e')][_0x2e50('0x4a')](_0x246091[_0x2e50('0x4b')],{})[_0x2e50('0x25')](function(_0x188348){var _0x52add7=_0x246091[_0x2e50('0x4c')][_0x2e50('0x27')]({'plain':!![]});if(!_0x52add7)throw new Error(_0x2e50('0x4d'));if(_0x52add7[_0x2e50('0x4e')]===_0x2e50('0x4c')){var _0x2c35dc=_0x188348[_0x2e50('0x27')]({'plain':!![]});var _0x3151a6=_0x2e50('0x28');return db[_0x2e50('0x4f')][_0x2e50('0x49')]({'where':{'name':_0x3151a6,'userProfileId':_0x52add7[_0x2e50('0x50')]},'raw':!![]})[_0x2e50('0x25')](function(_0x22dddd){if(_0x22dddd&&_0x22dddd[_0x2e50('0x51')]===0x0){return db[_0x2e50('0x52')][_0x2e50('0x4a')]({'name':_0x2c35dc[_0x2e50('0x2b')],'resourceId':_0x2c35dc['id'],'type':_0x22dddd[_0x2e50('0x2b')],'sectionId':_0x22dddd['id']},{})['then'](function(){return _0x188348;});}else{return _0x188348;}})[_0x2e50('0x47')](function(_0xd2856f){logger[_0x2e50('0x29')](_0x2e50('0x53'),_0xd2856f);throw _0xd2856f;});}return _0x188348;})[_0x2e50('0x25')](respondWithResult(_0x49b664,0xc9))['catch'](handleError(_0x49b664,null));};exports[_0x2e50('0x54')]=function(_0x262544,_0x2abab0){if(_0x262544[_0x2e50('0x4b')]['id']){delete _0x262544[_0x2e50('0x4b')]['id'];}return db['Template'][_0x2e50('0x49')]({'where':{'id':_0x262544[_0x2e50('0x55')]['id']}})[_0x2e50('0x25')](handleEntityNotFound(_0x2abab0,null))[_0x2e50('0x25')](saveUpdates(_0x262544['body'],null))[_0x2e50('0x25')](respondWithResult(_0x2abab0,null))['catch'](handleError(_0x2abab0,null));};exports[_0x2e50('0x26')]=function(_0x2c953a,_0x4f9179){return db[_0x2e50('0x2e')][_0x2e50('0x49')]({'where':{'id':_0x2c953a['params']['id']}})[_0x2e50('0x25')](handleEntityNotFound(_0x4f9179,null))[_0x2e50('0x25')](removeEntity(_0x4f9179,null))[_0x2e50('0x47')](handleError(_0x4f9179,null));}; \ No newline at end of file +var _0x1eab=['eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','count','set','apply','reject','update','then','destroy','get','end','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find'];(function(_0x127771,_0x497e31){var _0x1f0261=function(_0x29f9ae){while(--_0x29f9ae){_0x127771['push'](_0x127771['shift']());}};_0x1f0261(++_0x497e31);}(_0x1eab,0xfc));var _0xb1ea=function(_0x2493db,_0x546e5f){_0x2493db=_0x2493db-0x0;var _0x2c48c5=_0x1eab[_0x2493db];return _0x2c48c5;};'use strict';var emlformat=require(_0xb1ea('0x0'));var rimraf=require(_0xb1ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb1ea('0x2'));var moment=require(_0xb1ea('0x3'));var BPromise=require(_0xb1ea('0x4'));var Mustache=require(_0xb1ea('0x5'));var util=require(_0xb1ea('0x6'));var path=require(_0xb1ea('0x7'));var sox=require(_0xb1ea('0x8'));var csv=require(_0xb1ea('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1ea('0xa'));var _=require(_0xb1ea('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb1ea('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb1ea('0xd'));var Papa=require(_0xb1ea('0xe'));var Redis=require(_0xb1ea('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb1ea('0x10'));var as=require(_0xb1ea('0x11'));var hardwareService=require(_0xb1ea('0x12'));var logger=require(_0xb1ea('0x13'))(_0xb1ea('0x14'));var utils=require('../../config/utils');var config=require(_0xb1ea('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb1ea('0x16'))['db'];function respondWithStatusCode(_0x5ae351,_0x35e886){_0x35e886=_0x35e886||0xcc;return function(_0xebc65d){if(_0xebc65d){return _0x5ae351[_0xb1ea('0x17')](_0x35e886);}return _0x5ae351[_0xb1ea('0x18')](_0x35e886)['end']();};}function respondWithResult(_0x3356f7,_0x59779c){_0x59779c=_0x59779c||0xc8;return function(_0x58d7ee){if(_0x58d7ee){return _0x3356f7[_0xb1ea('0x18')](_0x59779c)[_0xb1ea('0x19')](_0x58d7ee);}};}function respondWithFilteredResult(_0x2097cc,_0x5bc1c6){return function(_0x213f57){if(_0x213f57){var _0x480ec9=typeof _0x5bc1c6[_0xb1ea('0x1a')]==='undefined'&&typeof _0x5bc1c6[_0xb1ea('0x1b')]==='undefined';var _0x1fe0b2=_0x213f57[_0xb1ea('0x1c')];var _0x59a55f=_0x480ec9?0x0:_0x5bc1c6[_0xb1ea('0x1a')];var _0x27690b=_0x480ec9?_0x213f57[_0xb1ea('0x1c')]:_0x5bc1c6['offset']+_0x5bc1c6[_0xb1ea('0x1b')];var _0x4c8823;if(_0x27690b>=_0x1fe0b2){_0x27690b=_0x1fe0b2;_0x4c8823=0xc8;}else{_0x4c8823=0xce;}_0x2097cc[_0xb1ea('0x18')](_0x4c8823);return _0x2097cc[_0xb1ea('0x1d')]('Content-Range',_0x59a55f+'-'+_0x27690b+'/'+_0x1fe0b2)[_0xb1ea('0x19')](_0x213f57);}return null;};}function patchUpdates(_0x1831ba){return function(_0x758975){try{jsonpatch[_0xb1ea('0x1e')](_0x758975,_0x1831ba,!![]);}catch(_0x4bfdd4){return BPromise[_0xb1ea('0x1f')](_0x4bfdd4);}return _0x758975['save']();};}function saveUpdates(_0x4843af,_0x50c6c8){return function(_0x3096c5){if(_0x3096c5){return _0x3096c5[_0xb1ea('0x20')](_0x4843af)[_0xb1ea('0x21')](function(_0x1e620c){return _0x1e620c;});}return null;};}function removeEntity(_0x3e679b,_0x218732){return function(_0x2cf163){if(_0x2cf163){return _0x2cf163[_0xb1ea('0x22')]()[_0xb1ea('0x21')](function(){var _0x501747=_0x2cf163[_0xb1ea('0x23')]({'plain':!![]});var _0x5d8c96='Templates';return db['UserProfileResource']['destroy']({'where':{'type':_0x5d8c96,'resourceId':_0x501747['id']}})[_0xb1ea('0x21')](function(){return _0x2cf163;});})[_0xb1ea('0x21')](function(){_0x3e679b[_0xb1ea('0x18')](0xcc)[_0xb1ea('0x24')]();});}};}function handleEntityNotFound(_0x9f5ebe,_0x32497a){return function(_0x252ff8){if(!_0x252ff8){_0x9f5ebe[_0xb1ea('0x17')](0x194);}return _0x252ff8;};}function handleError(_0x22195f,_0x57abda){_0x57abda=_0x57abda||0x1f4;return function(_0x5bd0ac){logger[_0xb1ea('0x25')](_0x5bd0ac[_0xb1ea('0x26')]);if(_0x5bd0ac['name']){delete _0x5bd0ac[_0xb1ea('0x27')];}_0x22195f[_0xb1ea('0x18')](_0x57abda)[_0xb1ea('0x28')](_0x5bd0ac);};}exports[_0xb1ea('0x29')]=function(_0x6980b1,_0x330b84){var _0x53f18e={},_0xdfe9c2={},_0x534d3e={'count':0x0,'rows':[]};var _0x51a4d0=_[_0xb1ea('0x2a')](db[_0xb1ea('0x2b')][_0xb1ea('0x2c')],function(_0x6be786){return{'name':_0x6be786[_0xb1ea('0x2d')],'type':_0x6be786[_0xb1ea('0x2e')][_0xb1ea('0x2f')]};});_0xdfe9c2[_0xb1ea('0x30')]=_[_0xb1ea('0x2a')](_0x51a4d0,_0xb1ea('0x27'));_0xdfe9c2[_0xb1ea('0x31')]=_['keys'](_0x6980b1[_0xb1ea('0x31')]);_0xdfe9c2[_0xb1ea('0x32')]=_['intersection'](_0xdfe9c2['model'],_0xdfe9c2[_0xb1ea('0x31')]);_0x53f18e[_0xb1ea('0x33')]=_[_0xb1ea('0x34')](_0xdfe9c2['model'],qs[_0xb1ea('0x35')](_0x6980b1['query'][_0xb1ea('0x35')]));_0x53f18e['attributes']=_0x53f18e[_0xb1ea('0x33')][_0xb1ea('0x36')]?_0x53f18e[_0xb1ea('0x33')]:_0xdfe9c2['model'];if(!_0x6980b1[_0xb1ea('0x31')][_0xb1ea('0x37')](_0xb1ea('0x38'))){_0x53f18e[_0xb1ea('0x1b')]=qs[_0xb1ea('0x1b')](_0x6980b1[_0xb1ea('0x31')]['limit']);_0x53f18e[_0xb1ea('0x1a')]=qs[_0xb1ea('0x1a')](_0x6980b1['query'][_0xb1ea('0x1a')]);}_0x53f18e[_0xb1ea('0x39')]=qs[_0xb1ea('0x3a')](_0x6980b1[_0xb1ea('0x31')]['sort']);_0x53f18e[_0xb1ea('0x3b')]=qs[_0xb1ea('0x32')](_['pick'](_0x6980b1[_0xb1ea('0x31')],_0xdfe9c2[_0xb1ea('0x32')]),_0x51a4d0);if(_0x6980b1[_0xb1ea('0x31')][_0xb1ea('0x3c')]){_0x53f18e[_0xb1ea('0x3b')]=_[_0xb1ea('0x3d')](_0x53f18e[_0xb1ea('0x3b')],{'$or':_[_0xb1ea('0x2a')](_0x51a4d0,function(_0x182d9e){if(_0x182d9e[_0xb1ea('0x2e')]!==_0xb1ea('0x3e')){var _0x2b09fc={};_0x2b09fc[_0x182d9e['name']]={'$like':'%'+_0x6980b1[_0xb1ea('0x31')][_0xb1ea('0x3c')]+'%'};return _0x2b09fc;}})});}_0x53f18e=_['merge']({},_0x53f18e,_0x6980b1[_0xb1ea('0x3f')]);var _0x4b9776={'where':_0x53f18e['where']};return db['Template']['count'](_0x4b9776)['then'](function(_0x297ca2){_0x534d3e[_0xb1ea('0x1c')]=_0x297ca2;if(_0x6980b1[_0xb1ea('0x31')]['includeAll']){_0x53f18e[_0xb1ea('0x40')]=[{'all':!![]}];}return db[_0xb1ea('0x2b')][_0xb1ea('0x41')](_0x53f18e);})[_0xb1ea('0x21')](function(_0x5536b3){_0x534d3e[_0xb1ea('0x42')]=_0x5536b3;return _0x534d3e;})[_0xb1ea('0x21')](respondWithFilteredResult(_0x330b84,_0x53f18e))[_0xb1ea('0x43')](handleError(_0x330b84,null));};exports[_0xb1ea('0x44')]=function(_0x310e9c,_0x33038e){var _0x533145={'raw':!![],'where':{'id':_0x310e9c[_0xb1ea('0x45')]['id']}},_0x164767={};_0x164767[_0xb1ea('0x30')]=_[_0xb1ea('0x46')](db['Template'][_0xb1ea('0x2c')]);_0x164767[_0xb1ea('0x31')]=_[_0xb1ea('0x46')](_0x310e9c[_0xb1ea('0x31')]);_0x164767[_0xb1ea('0x32')]=_[_0xb1ea('0x34')](_0x164767[_0xb1ea('0x30')],_0x164767[_0xb1ea('0x31')]);_0x533145[_0xb1ea('0x33')]=_[_0xb1ea('0x34')](_0x164767[_0xb1ea('0x30')],qs['fields'](_0x310e9c[_0xb1ea('0x31')][_0xb1ea('0x35')]));_0x533145[_0xb1ea('0x33')]=_0x533145['attributes']['length']?_0x533145['attributes']:_0x164767['model'];if(_0x310e9c[_0xb1ea('0x31')][_0xb1ea('0x47')]){_0x533145[_0xb1ea('0x40')]=[{'all':!![]}];}_0x533145=_['merge']({},_0x533145,_0x310e9c[_0xb1ea('0x3f')]);return db[_0xb1ea('0x2b')]['find'](_0x533145)[_0xb1ea('0x21')](handleEntityNotFound(_0x33038e,null))[_0xb1ea('0x21')](respondWithResult(_0x33038e,null))['catch'](handleError(_0x33038e,null));};exports['create']=function(_0x5ed455,_0x587cea){return db['Template']['create'](_0x5ed455[_0xb1ea('0x48')],{})['then'](function(_0x28f5c1){var _0x49ae91=_0x5ed455[_0xb1ea('0x49')]['get']({'plain':!![]});if(!_0x49ae91)throw new Error(_0xb1ea('0x4a'));if(_0x49ae91[_0xb1ea('0x4b')]===_0xb1ea('0x49')){var _0x11dda3=_0x28f5c1[_0xb1ea('0x23')]({'plain':!![]});var _0x3f67ce=_0xb1ea('0x4c');return db[_0xb1ea('0x4d')]['find']({'where':{'name':_0x3f67ce,'userProfileId':_0x49ae91[_0xb1ea('0x4e')]},'raw':!![]})[_0xb1ea('0x21')](function(_0x26e96a){if(_0x26e96a&&_0x26e96a[_0xb1ea('0x4f')]===0x0){return db[_0xb1ea('0x50')][_0xb1ea('0x51')]({'name':_0x11dda3['name'],'resourceId':_0x11dda3['id'],'type':_0x26e96a[_0xb1ea('0x27')],'sectionId':_0x26e96a['id']},{})[_0xb1ea('0x21')](function(){return _0x28f5c1;});}else{return _0x28f5c1;}})[_0xb1ea('0x43')](function(_0x555c1d){logger[_0xb1ea('0x25')](_0xb1ea('0x52'),_0x555c1d);throw _0x555c1d;});}return _0x28f5c1;})[_0xb1ea('0x21')](respondWithResult(_0x587cea,0xc9))['catch'](handleError(_0x587cea,null));};exports[_0xb1ea('0x20')]=function(_0x588f46,_0x34ad89){if(_0x588f46['body']['id']){delete _0x588f46[_0xb1ea('0x48')]['id'];}return db['Template'][_0xb1ea('0x53')]({'where':{'id':_0x588f46[_0xb1ea('0x45')]['id']}})[_0xb1ea('0x21')](handleEntityNotFound(_0x34ad89,null))[_0xb1ea('0x21')](saveUpdates(_0x588f46[_0xb1ea('0x48')],null))['then'](respondWithResult(_0x34ad89,null))[_0xb1ea('0x43')](handleError(_0x34ad89,null));};exports[_0xb1ea('0x22')]=function(_0x340e05,_0x415757){return db['Template'][_0xb1ea('0x53')]({'where':{'id':_0x340e05[_0xb1ea('0x45')]['id']}})[_0xb1ea('0x21')](handleEntityNotFound(_0x415757,null))[_0xb1ea('0x21')](removeEntity(_0x415757,null))['catch'](handleError(_0x415757,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index a75a8ef..86478e3 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 _0x827c=['lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template'];(function(_0x501c07,_0x1ab123){var _0x73f130=function(_0x2469b7){while(--_0x2469b7){_0x501c07['push'](_0x501c07['shift']());}};_0x73f130(++_0x1ab123);}(_0x827c,0xb0));var _0xc827=function(_0x5f17ed,_0x3624d7){_0x5f17ed=_0x5f17ed-0x0;var _0x9a0f7b=_0x827c[_0x5f17ed];return _0x9a0f7b;};'use strict';var _=require(_0xc827('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc827('0x1'));var BPromise=require(_0xc827('0x2'));var rp=require(_0xc827('0x3'));var fs=require('fs');var path=require(_0xc827('0x4'));var rimraf=require(_0xc827('0x5'));var config=require(_0xc827('0x6'));var attributes=require(_0xc827('0x7'));module[_0xc827('0x8')]=function(_0x23a297,_0x414ade){return _0x23a297[_0xc827('0x9')](_0xc827('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c35=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','define','Template','tools_templates','lodash'];(function(_0x277096,_0x5702ba){var _0x46642b=function(_0x221a7d){while(--_0x221a7d){_0x277096['push'](_0x277096['shift']());}};_0x46642b(++_0x5702ba);}(_0x0c35,0x12a));var _0x50c3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0c35[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x50c3('0x0'));var util=require(_0x50c3('0x1'));var logger=require(_0x50c3('0x2'))(_0x50c3('0x3'));var moment=require('moment');var BPromise=require(_0x50c3('0x4'));var rp=require(_0x50c3('0x5'));var fs=require('fs');var path=require(_0x50c3('0x6'));var rimraf=require(_0x50c3('0x7'));var config=require(_0x50c3('0x8'));var attributes=require(_0x50c3('0x9'));module['exports']=function(_0x270184,_0x35852b){return _0x270184[_0x50c3('0xa')](_0x50c3('0xb'),attributes,{'tableName':_0x50c3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index f592761..7102709 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 _0x2739=['message','result','catch','GetTemplate','Template','findAll','raw','options','where','attributes','include','map','model','then','info','lodash','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x2739,0x8b));var _0x9273=function(_0x43c00e,_0x1a5541){_0x43c00e=_0x43c00e-0x0;var _0x1c1151=_0x2739[_0x43c00e];return _0x1c1151;};'use strict';var _=require(_0x9273('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9273('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9273('0x2'));var logger=require(_0x9273('0x3'))('rpc');var config=require(_0x9273('0x4'));var jayson=require(_0x9273('0x5'));var client=jayson[_0x9273('0x6')][_0x9273('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfe2742,_0x2f56cb,_0x63aa14){return new BPromise(function(_0x5287b2,_0x82109d){return client[_0x9273('0x8')](_0xfe2742,_0x63aa14)['then'](function(_0x538c6f){logger['info'](_0x9273('0x9'),_0x2f56cb,_0x9273('0xa'));logger[_0x9273('0xb')](_0x9273('0xc'),_0x2f56cb,_0x9273('0xa'),JSON[_0x9273('0xd')](_0x538c6f));if(_0x538c6f[_0x9273('0xe')]){if(_0x538c6f[_0x9273('0xe')][_0x9273('0xf')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x2f56cb,_0x538c6f[_0x9273('0xe')][_0x9273('0x10')]);return _0x82109d(_0x538c6f[_0x9273('0xe')]['message']);}logger[_0x9273('0xe')]('Template,\x20%s,\x20%s',_0x2f56cb,_0x538c6f['error'][_0x9273('0x10')]);return _0x5287b2(_0x538c6f[_0x9273('0xe')][_0x9273('0x10')]);}else{logger['info'](_0x9273('0x9'),_0x2f56cb,_0x9273('0xa'));_0x5287b2(_0x538c6f[_0x9273('0x11')][_0x9273('0x10')]);}})[_0x9273('0x12')](function(_0x19cfa7){logger[_0x9273('0xe')](_0x9273('0x9'),_0x2f56cb,_0x19cfa7);_0x82109d(_0x19cfa7);});});}exports[_0x9273('0x13')]=function(_0x541da4){var _0x3f555a=this;return new Promise(function(_0x4f33df,_0x399cf4){return db[_0x9273('0x14')][_0x9273('0x15')]({'raw':_0x541da4['options']?_0x541da4['options'][_0x9273('0x16')]===undefined?!![]:![]:!![],'where':_0x541da4['options']?_0x541da4[_0x9273('0x17')][_0x9273('0x18')]||null:null,'attributes':_0x541da4['options']?_0x541da4['options'][_0x9273('0x19')]||null:null,'limit':_0x541da4[_0x9273('0x17')]?_0x541da4[_0x9273('0x17')]['limit']||null:null,'include':_0x541da4['options']?_0x541da4[_0x9273('0x17')][_0x9273('0x1a')]?_[_0x9273('0x1b')](_0x541da4[_0x9273('0x17')][_0x9273('0x1a')],function(_0x201ae6){return{'model':db[_0x201ae6[_0x9273('0x1c')]],'as':_0x201ae6['as'],'attributes':_0x201ae6[_0x9273('0x19')],'include':_0x201ae6[_0x9273('0x1a')]?_['map'](_0x201ae6[_0x9273('0x1a')],function(_0x2c9607){return{'model':db[_0x2c9607['model']],'as':_0x2c9607['as'],'attributes':_0x2c9607[_0x9273('0x19')],'include':_0x2c9607[_0x9273('0x1a')]?_[_0x9273('0x1b')](_0x2c9607[_0x9273('0x1a')],function(_0x1c6dcb){return{'model':db[_0x1c6dcb[_0x9273('0x1c')]],'as':_0x1c6dcb['as'],'attributes':_0x1c6dcb['attributes']};}):[]};}):[]};}):[]:[]})[_0x9273('0x1d')](function(_0x392ea6){logger[_0x9273('0x1e')]('GetTemplate',_0x541da4);logger[_0x9273('0xb')](_0x9273('0x13'),_0x541da4,JSON[_0x9273('0xd')](_0x392ea6));_0x4f33df(_0x392ea6);})[_0x9273('0x12')](function(_0x13bdeb){logger[_0x9273('0xe')](_0x9273('0x13'),_0x13bdeb[_0x9273('0x10')],_0x541da4);_0x399cf4(_0x3f555a[_0x9273('0xe')](0x1f4,_0x13bdeb[_0x9273('0x10')]));});});}; \ No newline at end of file +var _0xdb76=['client','http','request','then','info','request\x20sent','Template,\x20%s,\x20%s,\x20%s','error','code','message','Template,\x20%s,\x20%s','result','Template','options','raw','attributes','limit','include','map','model','GetTemplate','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x39154b,_0x2180cd){var _0x7ace85=function(_0x4d9cf8){while(--_0x4d9cf8){_0x39154b['push'](_0x39154b['shift']());}};_0x7ace85(++_0x2180cd);}(_0xdb76,0x1f4));var _0x6db7=function(_0x2d8429,_0x2a6c57){_0x2d8429=_0x2d8429-0x0;var _0x4a889e=_0xdb76[_0x2d8429];return _0x4a889e;};'use strict';var _=require(_0x6db7('0x0'));var util=require(_0x6db7('0x1'));var moment=require(_0x6db7('0x2'));var BPromise=require(_0x6db7('0x3'));var rs=require(_0x6db7('0x4'));var fs=require('fs');var Redis=require(_0x6db7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6db7('0x6'));var logger=require(_0x6db7('0x7'))(_0x6db7('0x8'));var config=require(_0x6db7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6db7('0xa')][_0x6db7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9ff5,_0xd96c54,_0x58bc89){return new BPromise(function(_0x4c77f6,_0x5c9ad5){return client[_0x6db7('0xc')](_0x9ff5,_0x58bc89)[_0x6db7('0xd')](function(_0x40c9d8){logger[_0x6db7('0xe')]('Template,\x20%s,\x20%s',_0xd96c54,_0x6db7('0xf'));logger['debug'](_0x6db7('0x10'),_0xd96c54,'request\x20sent',JSON['stringify'](_0x40c9d8));if(_0x40c9d8[_0x6db7('0x11')]){if(_0x40c9d8[_0x6db7('0x11')][_0x6db7('0x12')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0xd96c54,_0x40c9d8[_0x6db7('0x11')][_0x6db7('0x13')]);return _0x5c9ad5(_0x40c9d8['error'][_0x6db7('0x13')]);}logger[_0x6db7('0x11')](_0x6db7('0x14'),_0xd96c54,_0x40c9d8[_0x6db7('0x11')][_0x6db7('0x13')]);return _0x4c77f6(_0x40c9d8[_0x6db7('0x11')][_0x6db7('0x13')]);}else{logger[_0x6db7('0xe')](_0x6db7('0x14'),_0xd96c54,_0x6db7('0xf'));_0x4c77f6(_0x40c9d8[_0x6db7('0x15')][_0x6db7('0x13')]);}})['catch'](function(_0x2df971){logger[_0x6db7('0x11')](_0x6db7('0x14'),_0xd96c54,_0x2df971);_0x5c9ad5(_0x2df971);});});}exports['GetTemplate']=function(_0x175dbd){var _0x1ad0f1=this;return new Promise(function(_0x1343e8,_0x5e9d85){return db[_0x6db7('0x16')]['findAll']({'raw':_0x175dbd[_0x6db7('0x17')]?_0x175dbd[_0x6db7('0x17')][_0x6db7('0x18')]===undefined?!![]:![]:!![],'where':_0x175dbd['options']?_0x175dbd[_0x6db7('0x17')]['where']||null:null,'attributes':_0x175dbd[_0x6db7('0x17')]?_0x175dbd[_0x6db7('0x17')][_0x6db7('0x19')]||null:null,'limit':_0x175dbd[_0x6db7('0x17')]?_0x175dbd[_0x6db7('0x17')][_0x6db7('0x1a')]||null:null,'include':_0x175dbd[_0x6db7('0x17')]?_0x175dbd['options'][_0x6db7('0x1b')]?_[_0x6db7('0x1c')](_0x175dbd[_0x6db7('0x17')][_0x6db7('0x1b')],function(_0x4e24e5){return{'model':db[_0x4e24e5[_0x6db7('0x1d')]],'as':_0x4e24e5['as'],'attributes':_0x4e24e5[_0x6db7('0x19')],'include':_0x4e24e5[_0x6db7('0x1b')]?_[_0x6db7('0x1c')](_0x4e24e5[_0x6db7('0x1b')],function(_0x576c38){return{'model':db[_0x576c38[_0x6db7('0x1d')]],'as':_0x576c38['as'],'attributes':_0x576c38[_0x6db7('0x19')],'include':_0x576c38[_0x6db7('0x1b')]?_[_0x6db7('0x1c')](_0x576c38['include'],function(_0x5ebb1b){return{'model':db[_0x5ebb1b['model']],'as':_0x5ebb1b['as'],'attributes':_0x5ebb1b[_0x6db7('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6db7('0xd')](function(_0xf87272){logger[_0x6db7('0xe')](_0x6db7('0x1e'),_0x175dbd);logger[_0x6db7('0x1f')](_0x6db7('0x1e'),_0x175dbd,JSON[_0x6db7('0x20')](_0xf87272));_0x1343e8(_0xf87272);})[_0x6db7('0x21')](function(_0x5bf6cf){logger[_0x6db7('0x11')](_0x6db7('0x1e'),_0x5bf6cf[_0x6db7('0x13')],_0x175dbd);_0x5e9d85(_0x1ad0f1[_0x6db7('0x11')](0x1f4,_0x5bf6cf[_0x6db7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 784c384..0a414ea 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 _0x8130=['isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','post','create','addAllCondition','/:id/actions','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','index','get','/:id'];(function(_0x2e9abb,_0x2874f2){var _0x138d9f=function(_0xa7a99d){while(--_0xa7a99d){_0x2e9abb['push'](_0x2e9abb['shift']());}};_0x138d9f(++_0x2874f2);}(_0x8130,0x146));var _0x0813=function(_0x5d1dbe,_0x2b7039){_0x5d1dbe=_0x5d1dbe-0x0;var _0x42a5df=_0x8130[_0x5d1dbe];return _0x42a5df;};'use strict';var multer=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var path=require('path');var timeout=require(_0x0813('0x2'));var express=require(_0x0813('0x3'));var router=express[_0x0813('0x4')]();var fs_extra=require(_0x0813('0x5'));var auth=require(_0x0813('0x6'));var interaction=require(_0x0813('0x7'));var config=require('../../config/environment');var controller=require(_0x0813('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0813('0x9')]);router[_0x0813('0xa')](_0x0813('0xb'),auth[_0x0813('0xc')](),controller[_0x0813('0xd')]);router[_0x0813('0xa')](_0x0813('0xe'),auth['isAuthenticated'](),controller[_0x0813('0xf')]);router[_0x0813('0xa')](_0x0813('0x10'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0x0813('0xa')]('/:id/actions',auth[_0x0813('0xc')](),controller['getActions']);router[_0x0813('0x11')]('/',auth[_0x0813('0xc')](),controller[_0x0813('0x12')]);router[_0x0813('0x11')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x0813('0x13')]);router[_0x0813('0x11')]('/:id/any_conditions',auth[_0x0813('0xc')](),controller['addAnyCondition']);router['post'](_0x0813('0x14'),auth[_0x0813('0xc')](),controller['addAction']);router[_0x0813('0x15')]('/:id',auth[_0x0813('0xc')](),controller[_0x0813('0x16')]);router[_0x0813('0x17')](_0x0813('0xb'),auth[_0x0813('0xc')](),controller[_0x0813('0x18')]);module[_0x0813('0x19')]=router; \ No newline at end of file +var _0x6333=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions','post','addAllCondition','/:id/any_conditions','addAnyCondition','/:id/actions','addAction','put','update','delete','destroy','exports','multer','util','path'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x6333,0x185));var _0x3633=function(_0x4e9d54,_0x7c5f23){_0x4e9d54=_0x4e9d54-0x0;var _0x52b194=_0x6333[_0x4e9d54];return _0x52b194;};'use strict';var multer=require(_0x3633('0x0'));var util=require(_0x3633('0x1'));var path=require(_0x3633('0x2'));var timeout=require('connect-timeout');var express=require(_0x3633('0x3'));var router=express[_0x3633('0x4')]();var fs_extra=require(_0x3633('0x5'));var auth=require(_0x3633('0x6'));var interaction=require(_0x3633('0x7'));var config=require(_0x3633('0x8'));var controller=require(_0x3633('0x9'));router[_0x3633('0xa')]('/',auth[_0x3633('0xb')](),controller['index']);router[_0x3633('0xa')](_0x3633('0xc'),auth['isAuthenticated'](),controller[_0x3633('0xd')]);router['get'](_0x3633('0xe'),auth[_0x3633('0xb')](),controller[_0x3633('0xf')]);router[_0x3633('0xa')]('/:id/any_conditions',auth[_0x3633('0xb')](),controller[_0x3633('0x10')]);router[_0x3633('0xa')]('/:id/actions',auth[_0x3633('0xb')](),controller['getActions']);router[_0x3633('0x11')]('/',auth[_0x3633('0xb')](),controller['create']);router[_0x3633('0x11')](_0x3633('0xe'),auth[_0x3633('0xb')](),controller[_0x3633('0x12')]);router[_0x3633('0x11')](_0x3633('0x13'),auth[_0x3633('0xb')](),controller[_0x3633('0x14')]);router[_0x3633('0x11')](_0x3633('0x15'),auth[_0x3633('0xb')](),controller[_0x3633('0x16')]);router[_0x3633('0x17')](_0x3633('0xc'),auth[_0x3633('0xb')](),controller[_0x3633('0x18')]);router[_0x3633('0x19')](_0x3633('0xc'),auth['isAuthenticated'](),controller[_0x3633('0x1a')]);module[_0x3633('0x1b')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index ce61ba4..04ea87e 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 _0xfe6b=['STRING'];(function(_0x64930,_0x36a168){var _0x4e996f=function(_0x348303){while(--_0x348303){_0x64930['push'](_0x64930['shift']());}};_0x4e996f(++_0x36a168);}(_0xfe6b,0xb6));var _0xbfe6=function(_0x38dcfe,_0x1b9f72){_0x38dcfe=_0x38dcfe-0x0;var _0x1964d8=_0xfe6b[_0x38dcfe];return _0x1964d8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbfe6('0x0')]},'channel':{'type':Sequelize[_0xbfe6('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xcda3=['BOOLEAN','sequelize','STRING'];(function(_0x16823f,_0x3bb8a7){var _0x3e7ce7=function(_0x1128d6){while(--_0x1128d6){_0x16823f['push'](_0x16823f['shift']());}};_0x3e7ce7(++_0x3bb8a7);}(_0xcda3,0xb2));var _0x3cda=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xcda3[_0x454018];return _0x24697d;};'use strict';var Sequelize=require(_0x3cda('0x0'));module['exports']={'name':{'type':Sequelize[_0x3cda('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3cda('0x1')]},'status':{'type':Sequelize[_0x3cda('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 1caabb0..9b35766 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 _0xf03c=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','Trigger','include','rows','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','order','getAnyConditions','pick','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x45b4dc,_0x41b915){var _0x3f62ea=function(_0x46807d){while(--_0x46807d){_0x45b4dc['push'](_0x45b4dc['shift']());}};_0x3f62ea(++_0x41b915);}(_0xf03c,0x1d9));var _0xcf03=function(_0x5b289b,_0xe24f0b){_0x5b289b=_0x5b289b-0x0;var _0x414064=_0xf03c[_0x5b289b];return _0x414064;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf03('0x0'));var zipdir=require(_0xcf03('0x1'));var jsonpatch=require(_0xcf03('0x2'));var rp=require('request-promise');var moment=require(_0xcf03('0x3'));var BPromise=require(_0xcf03('0x4'));var Mustache=require(_0xcf03('0x5'));var util=require('util');var path=require(_0xcf03('0x6'));var sox=require(_0xcf03('0x7'));var csv=require('to-csv');var ejs=require(_0xcf03('0x8'));var fs=require('fs');var fs_extra=require(_0xcf03('0x9'));var _=require(_0xcf03('0xa'));var squel=require('squel');var crypto=require(_0xcf03('0xb'));var jsforce=require(_0xcf03('0xc'));var deskjs=require(_0xcf03('0xd'));var toCsv=require(_0xcf03('0xe'));var querystring=require(_0xcf03('0xf'));var Papa=require(_0xcf03('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf03('0x11'));var as=require(_0xcf03('0x12'));var hardwareService=require(_0xcf03('0x13'));var logger=require(_0xcf03('0x14'))(_0xcf03('0x15'));var utils=require(_0xcf03('0x16'));var config=require(_0xcf03('0x17'));var licenseUtil=require(_0xcf03('0x18'));var db=require(_0xcf03('0x19'))['db'];function respondWithStatusCode(_0x588812,_0x1b7f32){_0x1b7f32=_0x1b7f32||0xcc;return function(_0x5481ac){if(_0x5481ac){return _0x588812[_0xcf03('0x1a')](_0x1b7f32);}return _0x588812[_0xcf03('0x1b')](_0x1b7f32)[_0xcf03('0x1c')]();};}function respondWithResult(_0x1786b8,_0x163b1c){_0x163b1c=_0x163b1c||0xc8;return function(_0x448c4e){if(_0x448c4e){return _0x1786b8[_0xcf03('0x1b')](_0x163b1c)[_0xcf03('0x1d')](_0x448c4e);}};}function respondWithFilteredResult(_0x4538b6,_0x1408d6){return function(_0x3c31d3){if(_0x3c31d3){var _0x21d340=typeof _0x1408d6['offset']===_0xcf03('0x1e')&&typeof _0x1408d6['limit']===_0xcf03('0x1e');var _0x548522=_0x3c31d3[_0xcf03('0x1f')];var _0x12a7e6=_0x21d340?0x0:_0x1408d6[_0xcf03('0x20')];var _0x45dde3=_0x21d340?_0x3c31d3['count']:_0x1408d6[_0xcf03('0x20')]+_0x1408d6[_0xcf03('0x21')];var _0x4f55fe;if(_0x45dde3>=_0x548522){_0x45dde3=_0x548522;_0x4f55fe=0xc8;}else{_0x4f55fe=0xce;}_0x4538b6[_0xcf03('0x1b')](_0x4f55fe);return _0x4538b6[_0xcf03('0x22')](_0xcf03('0x23'),_0x12a7e6+'-'+_0x45dde3+'/'+_0x548522)[_0xcf03('0x1d')](_0x3c31d3);}return null;};}function patchUpdates(_0x4cc1bf){return function(_0x326d19){try{jsonpatch[_0xcf03('0x24')](_0x326d19,_0x4cc1bf,!![]);}catch(_0x1bfc6e){return BPromise['reject'](_0x1bfc6e);}return _0x326d19[_0xcf03('0x25')]();};}function saveUpdates(_0x5dcbae,_0x51d08e){return function(_0x13eae2){if(_0x13eae2){return _0x13eae2[_0xcf03('0x26')](_0x5dcbae)[_0xcf03('0x27')](function(_0x476e1b){return _0x476e1b;});}return null;};}function removeEntity(_0x6c4bb4,_0x4fef14){return function(_0x3b1a4c){if(_0x3b1a4c){return _0x3b1a4c[_0xcf03('0x28')]()[_0xcf03('0x27')](function(){var _0x3e4d05=_0x3b1a4c[_0xcf03('0x29')]({'plain':!![]});var _0x371c1a='Triggers';return db[_0xcf03('0x2a')][_0xcf03('0x28')]({'where':{'type':_0x371c1a,'resourceId':_0x3e4d05['id']}})['then'](function(){return _0x3b1a4c;});})[_0xcf03('0x27')](function(){_0x6c4bb4[_0xcf03('0x1b')](0xcc)[_0xcf03('0x1c')]();});}};}function handleEntityNotFound(_0x55931c,_0x2b24f1){return function(_0x4bf544){if(!_0x4bf544){_0x55931c[_0xcf03('0x1a')](0x194);}return _0x4bf544;};}function handleError(_0x45819f,_0x7b1984){_0x7b1984=_0x7b1984||0x1f4;return function(_0x4b9c91){logger[_0xcf03('0x2b')](_0x4b9c91[_0xcf03('0x2c')]);if(_0x4b9c91['name']){delete _0x4b9c91[_0xcf03('0x2d')];}_0x45819f[_0xcf03('0x1b')](_0x7b1984)[_0xcf03('0x2e')](_0x4b9c91);};}exports[_0xcf03('0x2f')]=function(_0x356488,_0x53aafe){var _0x23f65a={},_0x54dd41={},_0x839e97={'count':0x0,'rows':[]};var _0x3836ef=_[_0xcf03('0x30')](db['Trigger'][_0xcf03('0x31')],function(_0x47d11e){return{'name':_0x47d11e['fieldName'],'type':_0x47d11e[_0xcf03('0x32')][_0xcf03('0x33')]};});_0x54dd41[_0xcf03('0x34')]=_[_0xcf03('0x30')](_0x3836ef,_0xcf03('0x2d'));_0x54dd41[_0xcf03('0x35')]=_[_0xcf03('0x36')](_0x356488[_0xcf03('0x35')]);_0x54dd41[_0xcf03('0x37')]=_[_0xcf03('0x38')](_0x54dd41['model'],_0x54dd41[_0xcf03('0x35')]);_0x23f65a['attributes']=_[_0xcf03('0x38')](_0x54dd41['model'],qs[_0xcf03('0x39')](_0x356488[_0xcf03('0x35')][_0xcf03('0x39')]));_0x23f65a[_0xcf03('0x3a')]=_0x23f65a[_0xcf03('0x3a')][_0xcf03('0x3b')]?_0x23f65a[_0xcf03('0x3a')]:_0x54dd41[_0xcf03('0x34')];if(!_0x356488[_0xcf03('0x35')][_0xcf03('0x3c')](_0xcf03('0x3d'))){_0x23f65a[_0xcf03('0x21')]=qs[_0xcf03('0x21')](_0x356488[_0xcf03('0x35')]['limit']);_0x23f65a[_0xcf03('0x20')]=qs[_0xcf03('0x20')](_0x356488[_0xcf03('0x35')]['offset']);}_0x23f65a['order']=qs[_0xcf03('0x3e')](_0x356488[_0xcf03('0x35')][_0xcf03('0x3e')]);_0x23f65a[_0xcf03('0x3f')]=qs[_0xcf03('0x37')](_['pick'](_0x356488[_0xcf03('0x35')],_0x54dd41[_0xcf03('0x37')]),_0x3836ef);if(_0x356488[_0xcf03('0x35')]['filter']){_0x23f65a[_0xcf03('0x3f')]=_[_0xcf03('0x40')](_0x23f65a[_0xcf03('0x3f')],{'$or':_[_0xcf03('0x30')](_0x3836ef,function(_0x3f402c){if(_0x3f402c['type']!==_0xcf03('0x41')){var _0xf9654f={};_0xf9654f[_0x3f402c['name']]={'$like':'%'+_0x356488[_0xcf03('0x35')][_0xcf03('0x42')]+'%'};return _0xf9654f;}})});}_0x23f65a=_[_0xcf03('0x40')]({},_0x23f65a,_0x356488[_0xcf03('0x43')]);var _0x52c0c9={'where':_0x23f65a[_0xcf03('0x3f')]};return db[_0xcf03('0x44')][_0xcf03('0x1f')](_0x52c0c9)[_0xcf03('0x27')](function(_0x15a2a4){_0x839e97['count']=_0x15a2a4;if(_0x356488[_0xcf03('0x35')]['includeAll']){_0x23f65a[_0xcf03('0x45')]=[{'all':!![]}];}return db[_0xcf03('0x44')]['findAll'](_0x23f65a);})['then'](function(_0x41b006){_0x839e97[_0xcf03('0x46')]=_0x41b006;return _0x839e97;})[_0xcf03('0x27')](respondWithFilteredResult(_0x53aafe,_0x23f65a))[_0xcf03('0x47')](handleError(_0x53aafe,null));};exports[_0xcf03('0x48')]=function(_0xc82333,_0x2885bc){var _0x5167b1={'raw':![],'where':{'id':_0xc82333['params']['id']}},_0x9b18bd={};_0x9b18bd['model']=_[_0xcf03('0x36')](db[_0xcf03('0x44')][_0xcf03('0x31')]);_0x9b18bd['query']=_[_0xcf03('0x36')](_0xc82333[_0xcf03('0x35')]);_0x9b18bd[_0xcf03('0x37')]=_[_0xcf03('0x38')](_0x9b18bd[_0xcf03('0x34')],_0x9b18bd[_0xcf03('0x35')]);_0x5167b1[_0xcf03('0x3a')]=_['intersection'](_0x9b18bd[_0xcf03('0x34')],qs[_0xcf03('0x39')](_0xc82333[_0xcf03('0x35')]['fields']));_0x5167b1[_0xcf03('0x3a')]=_0x5167b1['attributes']['length']?_0x5167b1[_0xcf03('0x3a')]:_0x9b18bd['model'];if(_0xc82333[_0xcf03('0x35')][_0xcf03('0x49')]){_0x5167b1['include']=[{'all':!![]}];}_0x5167b1=_[_0xcf03('0x40')]({},_0x5167b1,_0xc82333[_0xcf03('0x43')]);return db[_0xcf03('0x44')][_0xcf03('0x4a')](_0x5167b1)[_0xcf03('0x27')](handleEntityNotFound(_0x2885bc,null))['then'](respondWithResult(_0x2885bc,null))[_0xcf03('0x47')](handleError(_0x2885bc,null));};exports[_0xcf03('0x4b')]=function(_0x2dfdd7,_0x32bb82){return db[_0xcf03('0x44')]['create'](_0x2dfdd7[_0xcf03('0x4c')],{})[_0xcf03('0x27')](function(_0x43bd5e){var _0x20c933=_0x2dfdd7[_0xcf03('0x4d')][_0xcf03('0x29')]({'plain':!![]});if(!_0x20c933)throw new Error(_0xcf03('0x4e'));if(_0x20c933[_0xcf03('0x4f')]===_0xcf03('0x4d')){var _0xf11646=_0x43bd5e[_0xcf03('0x29')]({'plain':!![]});var _0x25af6d=_0xcf03('0x50');return db[_0xcf03('0x51')][_0xcf03('0x4a')]({'where':{'name':_0x25af6d,'userProfileId':_0x20c933[_0xcf03('0x52')]},'raw':!![]})[_0xcf03('0x27')](function(_0x172e5d){if(_0x172e5d&&_0x172e5d['autoAssociation']===0x0){return db['UserProfileResource'][_0xcf03('0x4b')]({'name':_0xf11646['name'],'resourceId':_0xf11646['id'],'type':_0x172e5d[_0xcf03('0x2d')],'sectionId':_0x172e5d['id']},{})[_0xcf03('0x27')](function(){return _0x43bd5e;});}else{return _0x43bd5e;}})[_0xcf03('0x47')](function(_0x25cd05){logger[_0xcf03('0x2b')](_0xcf03('0x53'),_0x25cd05);throw _0x25cd05;});}return _0x43bd5e;})[_0xcf03('0x27')](respondWithResult(_0x32bb82,0xc9))[_0xcf03('0x47')](handleError(_0x32bb82,null));};exports[_0xcf03('0x26')]=function(_0x216e74,_0xf74afb){if(_0x216e74[_0xcf03('0x4c')]['id']){delete _0x216e74[_0xcf03('0x4c')]['id'];}return db['Trigger'][_0xcf03('0x4a')]({'where':{'id':_0x216e74[_0xcf03('0x54')]['id']}})[_0xcf03('0x27')](handleEntityNotFound(_0xf74afb,null))[_0xcf03('0x27')](saveUpdates(_0x216e74[_0xcf03('0x4c')],null))['then'](respondWithResult(_0xf74afb,null))[_0xcf03('0x47')](handleError(_0xf74afb,null));};exports['destroy']=function(_0x232730,_0x381715){return db[_0xcf03('0x44')]['find']({'where':{'id':_0x232730['params']['id']}})[_0xcf03('0x27')](handleEntityNotFound(_0x381715,null))[_0xcf03('0x27')](removeEntity(_0x381715,null))[_0xcf03('0x47')](handleError(_0x381715,null));};exports[_0xcf03('0x55')]=function(_0x3721ae,_0x1eb5f7,_0x27d3e1){if(_0x3721ae[_0xcf03('0x4c')]['id']){delete _0x3721ae['body']['id'];}return db['Trigger'][_0xcf03('0x4a')]({'where':{'id':_0x3721ae[_0xcf03('0x54')]['id']}})[_0xcf03('0x27')](handleEntityNotFound(_0x1eb5f7,null))[_0xcf03('0x27')](function(_0xf26a68){if(_0xf26a68){_0x3721ae[_0xcf03('0x4c')][_0xcf03('0x56')]=_0xf26a68['id'];return db[_0xcf03('0x57')][_0xcf03('0x4b')](_0x3721ae[_0xcf03('0x4c')]);}})[_0xcf03('0x27')](respondWithResult(_0x1eb5f7,null))[_0xcf03('0x47')](handleError(_0x1eb5f7,null));};exports[_0xcf03('0x58')]=function(_0x5f1424,_0x5689ca,_0xb1ab5f){if(_0x5f1424['body']['id']){delete _0x5f1424[_0xcf03('0x4c')]['id'];}return db['Trigger'][_0xcf03('0x4a')]({'where':{'id':_0x5f1424[_0xcf03('0x54')]['id']}})[_0xcf03('0x27')](handleEntityNotFound(_0x5689ca,null))[_0xcf03('0x27')](function(_0x496257){if(_0x496257){_0x5f1424['body'][_0xcf03('0x59')]=_0x496257['id'];return db['Condition'][_0xcf03('0x4b')](_0x5f1424[_0xcf03('0x4c')]);}})[_0xcf03('0x27')](respondWithResult(_0x5689ca,null))[_0xcf03('0x47')](handleError(_0x5689ca,null));};exports[_0xcf03('0x5a')]=function(_0x2f10e0,_0x4d05dc,_0x387c5c){var _0x3c3b34={};var _0x3ccda7={};var _0x299ee1;var _0x590ae3;return db[_0xcf03('0x44')][_0xcf03('0x5b')]({'where':{'id':_0x2f10e0[_0xcf03('0x54')]['id']}})[_0xcf03('0x27')](handleEntityNotFound(_0x4d05dc,null))[_0xcf03('0x27')](function(_0xb2027){if(_0xb2027){_0x299ee1=_0xb2027;_0x3ccda7[_0xcf03('0x34')]=_[_0xcf03('0x36')](db['Condition'][_0xcf03('0x31')]);_0x3ccda7[_0xcf03('0x35')]=_[_0xcf03('0x36')](_0x2f10e0[_0xcf03('0x35')]);_0x3ccda7['filters']=_[_0xcf03('0x38')](_0x3ccda7['model'],_0x3ccda7['query']);_0x3c3b34['attributes']=_[_0xcf03('0x38')](_0x3ccda7[_0xcf03('0x34')],qs[_0xcf03('0x39')](_0x2f10e0['query'][_0xcf03('0x39')]));_0x3c3b34[_0xcf03('0x3a')]=_0x3c3b34['attributes'][_0xcf03('0x3b')]?_0x3c3b34['attributes']:_0x3ccda7[_0xcf03('0x34')];_0x3c3b34[_0xcf03('0x5c')]=qs[_0xcf03('0x3e')](_0x2f10e0[_0xcf03('0x35')][_0xcf03('0x3e')]);_0x3c3b34[_0xcf03('0x3f')]=qs[_0xcf03('0x37')](_['pick'](_0x2f10e0['query'],_0x3ccda7[_0xcf03('0x37')]));if(_0x2f10e0['query'][_0xcf03('0x42')]){_0x3c3b34[_0xcf03('0x3f')]=_[_0xcf03('0x40')](_0x3c3b34['where'],{'$or':_[_0xcf03('0x30')](_0x3c3b34[_0xcf03('0x3a')],function(_0x2863c3){var _0x50e381={};_0x50e381[_0x2863c3]={'$like':'%'+_0x2f10e0[_0xcf03('0x35')]['filter']+'%'};return _0x50e381;})});}_0x3c3b34=_[_0xcf03('0x40')]({},_0x3c3b34,_0x2f10e0[_0xcf03('0x43')]);return _0x299ee1[_0xcf03('0x5a')](_0x3c3b34);}})[_0xcf03('0x27')](function(_0x3add1d){if(_0x3add1d){_0x590ae3=_0x3add1d[_0xcf03('0x3b')];if(!_0x2f10e0[_0xcf03('0x35')][_0xcf03('0x3c')]('nolimit')){_0x3c3b34[_0xcf03('0x21')]=qs[_0xcf03('0x21')](_0x2f10e0[_0xcf03('0x35')][_0xcf03('0x21')]);_0x3c3b34[_0xcf03('0x20')]=qs[_0xcf03('0x20')](_0x2f10e0['query'][_0xcf03('0x20')]);}return _0x299ee1[_0xcf03('0x5a')](_0x3c3b34);}})[_0xcf03('0x27')](function(_0x377fb4){if(_0x377fb4){return _0x377fb4?{'count':_0x590ae3,'rows':_0x377fb4}:null;}})[_0xcf03('0x27')](respondWithResult(_0x4d05dc,null))[_0xcf03('0x47')](handleError(_0x4d05dc,null));};exports[_0xcf03('0x5d')]=function(_0x5a58c7,_0x19312b,_0x3aae06){var _0x571696={};var _0x43d786={};var _0x136491;var _0x4acd52;return db[_0xcf03('0x44')][_0xcf03('0x5b')]({'where':{'id':_0x5a58c7[_0xcf03('0x54')]['id']}})[_0xcf03('0x27')](handleEntityNotFound(_0x19312b,null))[_0xcf03('0x27')](function(_0x56583a){if(_0x56583a){_0x136491=_0x56583a;_0x43d786[_0xcf03('0x34')]=_[_0xcf03('0x36')](db[_0xcf03('0x57')]['rawAttributes']);_0x43d786[_0xcf03('0x35')]=_['keys'](_0x5a58c7[_0xcf03('0x35')]);_0x43d786[_0xcf03('0x37')]=_[_0xcf03('0x38')](_0x43d786[_0xcf03('0x34')],_0x43d786[_0xcf03('0x35')]);_0x571696[_0xcf03('0x3a')]=_[_0xcf03('0x38')](_0x43d786[_0xcf03('0x34')],qs[_0xcf03('0x39')](_0x5a58c7[_0xcf03('0x35')][_0xcf03('0x39')]));_0x571696[_0xcf03('0x3a')]=_0x571696[_0xcf03('0x3a')][_0xcf03('0x3b')]?_0x571696[_0xcf03('0x3a')]:_0x43d786[_0xcf03('0x34')];_0x571696[_0xcf03('0x5c')]=qs[_0xcf03('0x3e')](_0x5a58c7[_0xcf03('0x35')]['sort']);_0x571696[_0xcf03('0x3f')]=qs[_0xcf03('0x37')](_[_0xcf03('0x5e')](_0x5a58c7[_0xcf03('0x35')],_0x43d786[_0xcf03('0x37')]));if(_0x5a58c7[_0xcf03('0x35')][_0xcf03('0x42')]){_0x571696['where']=_[_0xcf03('0x40')](_0x571696[_0xcf03('0x3f')],{'$or':_[_0xcf03('0x30')](_0x571696[_0xcf03('0x3a')],function(_0x404439){var _0x189079={};_0x189079[_0x404439]={'$like':'%'+_0x5a58c7[_0xcf03('0x35')][_0xcf03('0x42')]+'%'};return _0x189079;})});}_0x571696=_['merge']({},_0x571696,_0x5a58c7['options']);return _0x136491[_0xcf03('0x5d')](_0x571696);}})[_0xcf03('0x27')](function(_0x1ae3f0){if(_0x1ae3f0){_0x4acd52=_0x1ae3f0['length'];if(!_0x5a58c7[_0xcf03('0x35')][_0xcf03('0x3c')](_0xcf03('0x3d'))){_0x571696[_0xcf03('0x21')]=qs[_0xcf03('0x21')](_0x5a58c7[_0xcf03('0x35')]['limit']);_0x571696['offset']=qs[_0xcf03('0x20')](_0x5a58c7['query'][_0xcf03('0x20')]);}return _0x136491[_0xcf03('0x5d')](_0x571696);}})[_0xcf03('0x27')](function(_0x18c939){if(_0x18c939){return _0x18c939?{'count':_0x4acd52,'rows':_0x18c939}:null;}})[_0xcf03('0x27')](respondWithResult(_0x19312b,null))[_0xcf03('0x47')](handleError(_0x19312b,null));};exports[_0xcf03('0x5f')]=function(_0x1d71f4,_0xfe4022,_0x444530){if(_0x1d71f4[_0xcf03('0x4c')]['id']){delete _0x1d71f4[_0xcf03('0x4c')]['id'];}return db['Trigger'][_0xcf03('0x4a')]({'where':{'id':_0x1d71f4[_0xcf03('0x54')]['id']}})[_0xcf03('0x27')](handleEntityNotFound(_0xfe4022,null))['then'](function(_0x4292ba){if(_0x4292ba){_0x1d71f4[_0xcf03('0x4c')][_0xcf03('0x60')]=_0x4292ba['id'];return db[_0xcf03('0x61')][_0xcf03('0x4b')](_0x1d71f4['body']);}})[_0xcf03('0x27')](respondWithResult(_0xfe4022,null))[_0xcf03('0x47')](handleError(_0xfe4022,null));};exports[_0xcf03('0x62')]=function(_0x4335b4,_0x4ce02c,_0xb2a2fb){var _0x3320ec={};var _0x226b81={};var _0x256f03;var _0x110c63;return db[_0xcf03('0x44')][_0xcf03('0x5b')]({'where':{'id':_0x4335b4[_0xcf03('0x54')]['id']}})['then'](handleEntityNotFound(_0x4ce02c,null))[_0xcf03('0x27')](function(_0x33db53){if(_0x33db53){_0x256f03=_0x33db53;_0x226b81['model']=_[_0xcf03('0x36')](db[_0xcf03('0x61')][_0xcf03('0x31')]);_0x226b81[_0xcf03('0x35')]=_[_0xcf03('0x36')](_0x4335b4['query']);_0x226b81['filters']=_[_0xcf03('0x38')](_0x226b81[_0xcf03('0x34')],_0x226b81[_0xcf03('0x35')]);_0x3320ec[_0xcf03('0x3a')]=_['intersection'](_0x226b81['model'],qs[_0xcf03('0x39')](_0x4335b4[_0xcf03('0x35')][_0xcf03('0x39')]));_0x3320ec[_0xcf03('0x3a')]=_0x3320ec[_0xcf03('0x3a')][_0xcf03('0x3b')]?_0x3320ec['attributes']:_0x226b81[_0xcf03('0x34')];_0x3320ec['order']=qs[_0xcf03('0x3e')](_0x4335b4['query'][_0xcf03('0x3e')]);_0x3320ec[_0xcf03('0x3f')]=qs[_0xcf03('0x37')](_['pick'](_0x4335b4['query'],_0x226b81[_0xcf03('0x37')]));if(_0x4335b4['query'][_0xcf03('0x42')]){_0x3320ec[_0xcf03('0x3f')]=_[_0xcf03('0x40')](_0x3320ec[_0xcf03('0x3f')],{'$or':_[_0xcf03('0x30')](_0x3320ec[_0xcf03('0x3a')],function(_0x573460){var _0x1895bf={};_0x1895bf[_0x573460]={'$like':'%'+_0x4335b4[_0xcf03('0x35')][_0xcf03('0x42')]+'%'};return _0x1895bf;})});}_0x3320ec=_[_0xcf03('0x40')]({},_0x3320ec,_0x4335b4[_0xcf03('0x43')]);return _0x256f03['getActions'](_0x3320ec);}})[_0xcf03('0x27')](function(_0x45504f){if(_0x45504f){_0x110c63=_0x45504f[_0xcf03('0x3b')];if(!_0x4335b4[_0xcf03('0x35')][_0xcf03('0x3c')](_0xcf03('0x3d'))){_0x3320ec[_0xcf03('0x21')]=qs[_0xcf03('0x21')](_0x4335b4[_0xcf03('0x35')][_0xcf03('0x21')]);_0x3320ec[_0xcf03('0x20')]=qs[_0xcf03('0x20')](_0x4335b4['query'][_0xcf03('0x20')]);}return _0x256f03[_0xcf03('0x62')](_0x3320ec);}})['then'](function(_0xf95ff6){if(_0xf95ff6){return _0xf95ff6?{'count':_0x110c63,'rows':_0xf95ff6}:null;}})[_0xcf03('0x27')](respondWithResult(_0x4ce02c,null))[_0xcf03('0x47')](handleError(_0x4ce02c,null));}; \ No newline at end of file +var _0xb8b9=['sendStatus','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','get','Triggers','UserProfileResource','status','end','error','stack','name','send','index','Trigger','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','getAnyConditions','hasOwnProperty','addAction','TriggerId','Action','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x16b9fc,_0x1e33b8){var _0x2b7d22=function(_0x692166){while(--_0x692166){_0x16b9fc['push'](_0x16b9fc['shift']());}};_0x2b7d22(++_0x1e33b8);}(_0xb8b9,0x1be));var _0x9b8b=function(_0x2360ea,_0x8e8f30){_0x2360ea=_0x2360ea-0x0;var _0x5d86b6=_0xb8b9[_0x2360ea];return _0x5d86b6;};'use strict';var emlformat=require(_0x9b8b('0x0'));var rimraf=require(_0x9b8b('0x1'));var zipdir=require(_0x9b8b('0x2'));var jsonpatch=require(_0x9b8b('0x3'));var rp=require(_0x9b8b('0x4'));var moment=require(_0x9b8b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9b8b('0x6'));var util=require(_0x9b8b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9b8b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b8b('0x9'));var _=require(_0x9b8b('0xa'));var squel=require('squel');var crypto=require(_0x9b8b('0xb'));var jsforce=require(_0x9b8b('0xc'));var deskjs=require(_0x9b8b('0xd'));var toCsv=require(_0x9b8b('0x8'));var querystring=require(_0x9b8b('0xe'));var Papa=require(_0x9b8b('0xf'));var Redis=require(_0x9b8b('0x10'));var authService=require(_0x9b8b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9b8b('0x12'));var hardwareService=require(_0x9b8b('0x13'));var logger=require(_0x9b8b('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x9b8b('0x15'));var licenseUtil=require(_0x9b8b('0x16'));var db=require(_0x9b8b('0x17'))['db'];function respondWithStatusCode(_0x5d388e,_0xf46845){_0xf46845=_0xf46845||0xcc;return function(_0x584b31){if(_0x584b31){return _0x5d388e[_0x9b8b('0x18')](_0xf46845);}return _0x5d388e['status'](_0xf46845)['end']();};}function respondWithResult(_0x12057a,_0x37fd22){_0x37fd22=_0x37fd22||0xc8;return function(_0x2b4fab){if(_0x2b4fab){return _0x12057a['status'](_0x37fd22)[_0x9b8b('0x19')](_0x2b4fab);}};}function respondWithFilteredResult(_0x49d28e,_0x4eb898){return function(_0x14ff40){if(_0x14ff40){var _0x539f02=typeof _0x4eb898[_0x9b8b('0x1a')]==='undefined'&&typeof _0x4eb898[_0x9b8b('0x1b')]==='undefined';var _0x5b6fd8=_0x14ff40['count'];var _0xaa38b7=_0x539f02?0x0:_0x4eb898['offset'];var _0x3365ef=_0x539f02?_0x14ff40[_0x9b8b('0x1c')]:_0x4eb898['offset']+_0x4eb898[_0x9b8b('0x1b')];var _0x4baed9;if(_0x3365ef>=_0x5b6fd8){_0x3365ef=_0x5b6fd8;_0x4baed9=0xc8;}else{_0x4baed9=0xce;}_0x49d28e['status'](_0x4baed9);return _0x49d28e['set'](_0x9b8b('0x1d'),_0xaa38b7+'-'+_0x3365ef+'/'+_0x5b6fd8)[_0x9b8b('0x19')](_0x14ff40);}return null;};}function patchUpdates(_0x172992){return function(_0x179e70){try{jsonpatch['apply'](_0x179e70,_0x172992,!![]);}catch(_0x4b11ff){return BPromise[_0x9b8b('0x1e')](_0x4b11ff);}return _0x179e70[_0x9b8b('0x1f')]();};}function saveUpdates(_0x2ce410,_0x416efc){return function(_0x31025d){if(_0x31025d){return _0x31025d[_0x9b8b('0x20')](_0x2ce410)[_0x9b8b('0x21')](function(_0x1d651e){return _0x1d651e;});}return null;};}function removeEntity(_0x2bfc43,_0x23b846){return function(_0x339a40){if(_0x339a40){return _0x339a40[_0x9b8b('0x22')]()[_0x9b8b('0x21')](function(){var _0x2ab33a=_0x339a40[_0x9b8b('0x23')]({'plain':!![]});var _0x2442d3=_0x9b8b('0x24');return db[_0x9b8b('0x25')]['destroy']({'where':{'type':_0x2442d3,'resourceId':_0x2ab33a['id']}})[_0x9b8b('0x21')](function(){return _0x339a40;});})[_0x9b8b('0x21')](function(){_0x2bfc43[_0x9b8b('0x26')](0xcc)[_0x9b8b('0x27')]();});}};}function handleEntityNotFound(_0x105374,_0x434746){return function(_0x2f0f7d){if(!_0x2f0f7d){_0x105374[_0x9b8b('0x18')](0x194);}return _0x2f0f7d;};}function handleError(_0x513246,_0x157447){_0x157447=_0x157447||0x1f4;return function(_0x141795){logger[_0x9b8b('0x28')](_0x141795[_0x9b8b('0x29')]);if(_0x141795[_0x9b8b('0x2a')]){delete _0x141795[_0x9b8b('0x2a')];}_0x513246[_0x9b8b('0x26')](_0x157447)[_0x9b8b('0x2b')](_0x141795);};}exports[_0x9b8b('0x2c')]=function(_0x3e442b,_0x1e8a6e){var _0x1dfce8={},_0x4f5a06={},_0x880208={'count':0x0,'rows':[]};var _0x1969d=_['map'](db[_0x9b8b('0x2d')][_0x9b8b('0x2e')],function(_0x2d933f){return{'name':_0x2d933f['fieldName'],'type':_0x2d933f[_0x9b8b('0x2f')][_0x9b8b('0x30')]};});_0x4f5a06[_0x9b8b('0x31')]=_[_0x9b8b('0x32')](_0x1969d,_0x9b8b('0x2a'));_0x4f5a06[_0x9b8b('0x33')]=_[_0x9b8b('0x34')](_0x3e442b[_0x9b8b('0x33')]);_0x4f5a06[_0x9b8b('0x35')]=_[_0x9b8b('0x36')](_0x4f5a06['model'],_0x4f5a06[_0x9b8b('0x33')]);_0x1dfce8[_0x9b8b('0x37')]=_[_0x9b8b('0x36')](_0x4f5a06[_0x9b8b('0x31')],qs['fields'](_0x3e442b[_0x9b8b('0x33')][_0x9b8b('0x38')]));_0x1dfce8['attributes']=_0x1dfce8[_0x9b8b('0x37')]['length']?_0x1dfce8[_0x9b8b('0x37')]:_0x4f5a06['model'];if(!_0x3e442b[_0x9b8b('0x33')]['hasOwnProperty'](_0x9b8b('0x39'))){_0x1dfce8[_0x9b8b('0x1b')]=qs[_0x9b8b('0x1b')](_0x3e442b[_0x9b8b('0x33')][_0x9b8b('0x1b')]);_0x1dfce8['offset']=qs[_0x9b8b('0x1a')](_0x3e442b[_0x9b8b('0x33')][_0x9b8b('0x1a')]);}_0x1dfce8[_0x9b8b('0x3a')]=qs[_0x9b8b('0x3b')](_0x3e442b[_0x9b8b('0x33')][_0x9b8b('0x3b')]);_0x1dfce8[_0x9b8b('0x3c')]=qs[_0x9b8b('0x35')](_[_0x9b8b('0x3d')](_0x3e442b[_0x9b8b('0x33')],_0x4f5a06[_0x9b8b('0x35')]),_0x1969d);if(_0x3e442b[_0x9b8b('0x33')]['filter']){_0x1dfce8[_0x9b8b('0x3c')]=_[_0x9b8b('0x3e')](_0x1dfce8[_0x9b8b('0x3c')],{'$or':_['map'](_0x1969d,function(_0xb5043f){if(_0xb5043f[_0x9b8b('0x2f')]!=='VIRTUAL'){var _0x358a11={};_0x358a11[_0xb5043f[_0x9b8b('0x2a')]]={'$like':'%'+_0x3e442b[_0x9b8b('0x33')][_0x9b8b('0x3f')]+'%'};return _0x358a11;}})});}_0x1dfce8=_[_0x9b8b('0x3e')]({},_0x1dfce8,_0x3e442b['options']);var _0x5bdf0d={'where':_0x1dfce8[_0x9b8b('0x3c')]};return db[_0x9b8b('0x2d')][_0x9b8b('0x1c')](_0x5bdf0d)['then'](function(_0x406910){_0x880208[_0x9b8b('0x1c')]=_0x406910;if(_0x3e442b[_0x9b8b('0x33')][_0x9b8b('0x40')]){_0x1dfce8[_0x9b8b('0x41')]=[{'all':!![]}];}return db['Trigger'][_0x9b8b('0x42')](_0x1dfce8);})[_0x9b8b('0x21')](function(_0x281557){_0x880208[_0x9b8b('0x43')]=_0x281557;return _0x880208;})[_0x9b8b('0x21')](respondWithFilteredResult(_0x1e8a6e,_0x1dfce8))[_0x9b8b('0x44')](handleError(_0x1e8a6e,null));};exports[_0x9b8b('0x45')]=function(_0x563186,_0x3437c4){var _0x839439={'raw':![],'where':{'id':_0x563186[_0x9b8b('0x46')]['id']}},_0x26c12c={};_0x26c12c[_0x9b8b('0x31')]=_[_0x9b8b('0x34')](db['Trigger'][_0x9b8b('0x2e')]);_0x26c12c[_0x9b8b('0x33')]=_[_0x9b8b('0x34')](_0x563186[_0x9b8b('0x33')]);_0x26c12c[_0x9b8b('0x35')]=_[_0x9b8b('0x36')](_0x26c12c['model'],_0x26c12c[_0x9b8b('0x33')]);_0x839439[_0x9b8b('0x37')]=_[_0x9b8b('0x36')](_0x26c12c[_0x9b8b('0x31')],qs[_0x9b8b('0x38')](_0x563186[_0x9b8b('0x33')]['fields']));_0x839439['attributes']=_0x839439[_0x9b8b('0x37')][_0x9b8b('0x47')]?_0x839439[_0x9b8b('0x37')]:_0x26c12c[_0x9b8b('0x31')];if(_0x563186[_0x9b8b('0x33')][_0x9b8b('0x40')]){_0x839439['include']=[{'all':!![]}];}_0x839439=_[_0x9b8b('0x3e')]({},_0x839439,_0x563186[_0x9b8b('0x48')]);return db[_0x9b8b('0x2d')]['find'](_0x839439)[_0x9b8b('0x21')](handleEntityNotFound(_0x3437c4,null))[_0x9b8b('0x21')](respondWithResult(_0x3437c4,null))[_0x9b8b('0x44')](handleError(_0x3437c4,null));};exports[_0x9b8b('0x49')]=function(_0x3eedac,_0x1ecc07){return db[_0x9b8b('0x2d')][_0x9b8b('0x49')](_0x3eedac[_0x9b8b('0x4a')],{})[_0x9b8b('0x21')](function(_0x172ad6){var _0x466c7f=_0x3eedac['user']['get']({'plain':!![]});if(!_0x466c7f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x466c7f[_0x9b8b('0x4b')]===_0x9b8b('0x4c')){var _0x4e73cf=_0x172ad6[_0x9b8b('0x23')]({'plain':!![]});var _0x2fd830=_0x9b8b('0x24');return db[_0x9b8b('0x4d')][_0x9b8b('0x4e')]({'where':{'name':_0x2fd830,'userProfileId':_0x466c7f[_0x9b8b('0x4f')]},'raw':!![]})[_0x9b8b('0x21')](function(_0x23c9e7){if(_0x23c9e7&&_0x23c9e7[_0x9b8b('0x50')]===0x0){return db['UserProfileResource'][_0x9b8b('0x49')]({'name':_0x4e73cf[_0x9b8b('0x2a')],'resourceId':_0x4e73cf['id'],'type':_0x23c9e7[_0x9b8b('0x2a')],'sectionId':_0x23c9e7['id']},{})[_0x9b8b('0x21')](function(){return _0x172ad6;});}else{return _0x172ad6;}})[_0x9b8b('0x44')](function(_0x261afe){logger[_0x9b8b('0x28')](_0x9b8b('0x51'),_0x261afe);throw _0x261afe;});}return _0x172ad6;})[_0x9b8b('0x21')](respondWithResult(_0x1ecc07,0xc9))[_0x9b8b('0x44')](handleError(_0x1ecc07,null));};exports['update']=function(_0x59d654,_0x13dbab){if(_0x59d654[_0x9b8b('0x4a')]['id']){delete _0x59d654[_0x9b8b('0x4a')]['id'];}return db[_0x9b8b('0x2d')]['find']({'where':{'id':_0x59d654['params']['id']}})[_0x9b8b('0x21')](handleEntityNotFound(_0x13dbab,null))[_0x9b8b('0x21')](saveUpdates(_0x59d654[_0x9b8b('0x4a')],null))[_0x9b8b('0x21')](respondWithResult(_0x13dbab,null))[_0x9b8b('0x44')](handleError(_0x13dbab,null));};exports[_0x9b8b('0x22')]=function(_0x27c6f3,_0x26cf49){return db[_0x9b8b('0x2d')][_0x9b8b('0x4e')]({'where':{'id':_0x27c6f3[_0x9b8b('0x46')]['id']}})[_0x9b8b('0x21')](handleEntityNotFound(_0x26cf49,null))[_0x9b8b('0x21')](removeEntity(_0x26cf49,null))[_0x9b8b('0x44')](handleError(_0x26cf49,null));};exports[_0x9b8b('0x52')]=function(_0x301628,_0x367b98,_0x248aac){if(_0x301628[_0x9b8b('0x4a')]['id']){delete _0x301628[_0x9b8b('0x4a')]['id'];}return db[_0x9b8b('0x2d')][_0x9b8b('0x4e')]({'where':{'id':_0x301628[_0x9b8b('0x46')]['id']}})[_0x9b8b('0x21')](handleEntityNotFound(_0x367b98,null))[_0x9b8b('0x21')](function(_0x106b67){if(_0x106b67){_0x301628[_0x9b8b('0x4a')][_0x9b8b('0x53')]=_0x106b67['id'];return db[_0x9b8b('0x54')][_0x9b8b('0x49')](_0x301628['body']);}})[_0x9b8b('0x21')](respondWithResult(_0x367b98,null))[_0x9b8b('0x44')](handleError(_0x367b98,null));};exports['addAnyCondition']=function(_0x12943c,_0x162874,_0x13d7b7){if(_0x12943c[_0x9b8b('0x4a')]['id']){delete _0x12943c[_0x9b8b('0x4a')]['id'];}return db[_0x9b8b('0x2d')][_0x9b8b('0x4e')]({'where':{'id':_0x12943c['params']['id']}})[_0x9b8b('0x21')](handleEntityNotFound(_0x162874,null))[_0x9b8b('0x21')](function(_0x102750){if(_0x102750){_0x12943c[_0x9b8b('0x4a')][_0x9b8b('0x55')]=_0x102750['id'];return db[_0x9b8b('0x54')][_0x9b8b('0x49')](_0x12943c['body']);}})[_0x9b8b('0x21')](respondWithResult(_0x162874,null))['catch'](handleError(_0x162874,null));};exports[_0x9b8b('0x56')]=function(_0x265d79,_0x37fb0e,_0x3f1343){var _0x319c4f={};var _0x147769={};var _0x353ed1;var _0xe7fe77;return db['Trigger']['findOne']({'where':{'id':_0x265d79['params']['id']}})['then'](handleEntityNotFound(_0x37fb0e,null))[_0x9b8b('0x21')](function(_0x741c52){if(_0x741c52){_0x353ed1=_0x741c52;_0x147769[_0x9b8b('0x31')]=_[_0x9b8b('0x34')](db['Condition']['rawAttributes']);_0x147769['query']=_[_0x9b8b('0x34')](_0x265d79[_0x9b8b('0x33')]);_0x147769[_0x9b8b('0x35')]=_['intersection'](_0x147769[_0x9b8b('0x31')],_0x147769['query']);_0x319c4f[_0x9b8b('0x37')]=_[_0x9b8b('0x36')](_0x147769[_0x9b8b('0x31')],qs[_0x9b8b('0x38')](_0x265d79[_0x9b8b('0x33')][_0x9b8b('0x38')]));_0x319c4f[_0x9b8b('0x37')]=_0x319c4f[_0x9b8b('0x37')][_0x9b8b('0x47')]?_0x319c4f[_0x9b8b('0x37')]:_0x147769[_0x9b8b('0x31')];_0x319c4f[_0x9b8b('0x3a')]=qs['sort'](_0x265d79[_0x9b8b('0x33')][_0x9b8b('0x3b')]);_0x319c4f[_0x9b8b('0x3c')]=qs[_0x9b8b('0x35')](_[_0x9b8b('0x3d')](_0x265d79['query'],_0x147769[_0x9b8b('0x35')]));if(_0x265d79[_0x9b8b('0x33')]['filter']){_0x319c4f[_0x9b8b('0x3c')]=_[_0x9b8b('0x3e')](_0x319c4f[_0x9b8b('0x3c')],{'$or':_[_0x9b8b('0x32')](_0x319c4f[_0x9b8b('0x37')],function(_0x44a8d1){var _0x4cbedb={};_0x4cbedb[_0x44a8d1]={'$like':'%'+_0x265d79[_0x9b8b('0x33')]['filter']+'%'};return _0x4cbedb;})});}_0x319c4f=_[_0x9b8b('0x3e')]({},_0x319c4f,_0x265d79[_0x9b8b('0x48')]);return _0x353ed1[_0x9b8b('0x56')](_0x319c4f);}})[_0x9b8b('0x21')](function(_0x4a08db){if(_0x4a08db){_0xe7fe77=_0x4a08db[_0x9b8b('0x47')];if(!_0x265d79[_0x9b8b('0x33')]['hasOwnProperty'](_0x9b8b('0x39'))){_0x319c4f['limit']=qs['limit'](_0x265d79[_0x9b8b('0x33')][_0x9b8b('0x1b')]);_0x319c4f[_0x9b8b('0x1a')]=qs['offset'](_0x265d79[_0x9b8b('0x33')]['offset']);}return _0x353ed1[_0x9b8b('0x56')](_0x319c4f);}})['then'](function(_0x3cf571){if(_0x3cf571){return _0x3cf571?{'count':_0xe7fe77,'rows':_0x3cf571}:null;}})[_0x9b8b('0x21')](respondWithResult(_0x37fb0e,null))[_0x9b8b('0x44')](handleError(_0x37fb0e,null));};exports['getAnyConditions']=function(_0x37cfb3,_0x1e74ac,_0x2b03fd){var _0x4d6ba1={};var _0x1d4215={};var _0x2cbd5e;var _0x4f7edc;return db['Trigger']['findOne']({'where':{'id':_0x37cfb3[_0x9b8b('0x46')]['id']}})[_0x9b8b('0x21')](handleEntityNotFound(_0x1e74ac,null))[_0x9b8b('0x21')](function(_0x3a66dc){if(_0x3a66dc){_0x2cbd5e=_0x3a66dc;_0x1d4215['model']=_['keys'](db[_0x9b8b('0x54')][_0x9b8b('0x2e')]);_0x1d4215['query']=_[_0x9b8b('0x34')](_0x37cfb3['query']);_0x1d4215[_0x9b8b('0x35')]=_[_0x9b8b('0x36')](_0x1d4215['model'],_0x1d4215[_0x9b8b('0x33')]);_0x4d6ba1[_0x9b8b('0x37')]=_['intersection'](_0x1d4215[_0x9b8b('0x31')],qs[_0x9b8b('0x38')](_0x37cfb3[_0x9b8b('0x33')][_0x9b8b('0x38')]));_0x4d6ba1[_0x9b8b('0x37')]=_0x4d6ba1[_0x9b8b('0x37')][_0x9b8b('0x47')]?_0x4d6ba1[_0x9b8b('0x37')]:_0x1d4215[_0x9b8b('0x31')];_0x4d6ba1[_0x9b8b('0x3a')]=qs[_0x9b8b('0x3b')](_0x37cfb3[_0x9b8b('0x33')][_0x9b8b('0x3b')]);_0x4d6ba1['where']=qs[_0x9b8b('0x35')](_['pick'](_0x37cfb3[_0x9b8b('0x33')],_0x1d4215['filters']));if(_0x37cfb3[_0x9b8b('0x33')][_0x9b8b('0x3f')]){_0x4d6ba1[_0x9b8b('0x3c')]=_[_0x9b8b('0x3e')](_0x4d6ba1[_0x9b8b('0x3c')],{'$or':_[_0x9b8b('0x32')](_0x4d6ba1['attributes'],function(_0x4cae65){var _0x1ebca0={};_0x1ebca0[_0x4cae65]={'$like':'%'+_0x37cfb3['query'][_0x9b8b('0x3f')]+'%'};return _0x1ebca0;})});}_0x4d6ba1=_[_0x9b8b('0x3e')]({},_0x4d6ba1,_0x37cfb3[_0x9b8b('0x48')]);return _0x2cbd5e[_0x9b8b('0x57')](_0x4d6ba1);}})[_0x9b8b('0x21')](function(_0x1a2045){if(_0x1a2045){_0x4f7edc=_0x1a2045[_0x9b8b('0x47')];if(!_0x37cfb3[_0x9b8b('0x33')][_0x9b8b('0x58')](_0x9b8b('0x39'))){_0x4d6ba1[_0x9b8b('0x1b')]=qs[_0x9b8b('0x1b')](_0x37cfb3[_0x9b8b('0x33')][_0x9b8b('0x1b')]);_0x4d6ba1['offset']=qs[_0x9b8b('0x1a')](_0x37cfb3[_0x9b8b('0x33')][_0x9b8b('0x1a')]);}return _0x2cbd5e[_0x9b8b('0x57')](_0x4d6ba1);}})['then'](function(_0x21b436){if(_0x21b436){return _0x21b436?{'count':_0x4f7edc,'rows':_0x21b436}:null;}})[_0x9b8b('0x21')](respondWithResult(_0x1e74ac,null))[_0x9b8b('0x44')](handleError(_0x1e74ac,null));};exports[_0x9b8b('0x59')]=function(_0x382132,_0xfaa376,_0x4f2943){if(_0x382132[_0x9b8b('0x4a')]['id']){delete _0x382132[_0x9b8b('0x4a')]['id'];}return db['Trigger'][_0x9b8b('0x4e')]({'where':{'id':_0x382132['params']['id']}})[_0x9b8b('0x21')](handleEntityNotFound(_0xfaa376,null))[_0x9b8b('0x21')](function(_0xf5175a){if(_0xf5175a){_0x382132[_0x9b8b('0x4a')][_0x9b8b('0x5a')]=_0xf5175a['id'];return db[_0x9b8b('0x5b')]['create'](_0x382132[_0x9b8b('0x4a')]);}})['then'](respondWithResult(_0xfaa376,null))[_0x9b8b('0x44')](handleError(_0xfaa376,null));};exports[_0x9b8b('0x5c')]=function(_0x428cf4,_0x3f8e43,_0x28cc78){var _0x5af0ce={};var _0x38d779={};var _0x2a5664;var _0x16943d;return db[_0x9b8b('0x2d')][_0x9b8b('0x5d')]({'where':{'id':_0x428cf4[_0x9b8b('0x46')]['id']}})[_0x9b8b('0x21')](handleEntityNotFound(_0x3f8e43,null))[_0x9b8b('0x21')](function(_0x8fb34e){if(_0x8fb34e){_0x2a5664=_0x8fb34e;_0x38d779[_0x9b8b('0x31')]=_[_0x9b8b('0x34')](db[_0x9b8b('0x5b')][_0x9b8b('0x2e')]);_0x38d779['query']=_['keys'](_0x428cf4[_0x9b8b('0x33')]);_0x38d779[_0x9b8b('0x35')]=_[_0x9b8b('0x36')](_0x38d779[_0x9b8b('0x31')],_0x38d779[_0x9b8b('0x33')]);_0x5af0ce[_0x9b8b('0x37')]=_['intersection'](_0x38d779[_0x9b8b('0x31')],qs['fields'](_0x428cf4[_0x9b8b('0x33')][_0x9b8b('0x38')]));_0x5af0ce[_0x9b8b('0x37')]=_0x5af0ce[_0x9b8b('0x37')][_0x9b8b('0x47')]?_0x5af0ce[_0x9b8b('0x37')]:_0x38d779['model'];_0x5af0ce[_0x9b8b('0x3a')]=qs[_0x9b8b('0x3b')](_0x428cf4[_0x9b8b('0x33')][_0x9b8b('0x3b')]);_0x5af0ce[_0x9b8b('0x3c')]=qs[_0x9b8b('0x35')](_[_0x9b8b('0x3d')](_0x428cf4[_0x9b8b('0x33')],_0x38d779[_0x9b8b('0x35')]));if(_0x428cf4[_0x9b8b('0x33')]['filter']){_0x5af0ce[_0x9b8b('0x3c')]=_[_0x9b8b('0x3e')](_0x5af0ce[_0x9b8b('0x3c')],{'$or':_[_0x9b8b('0x32')](_0x5af0ce[_0x9b8b('0x37')],function(_0x1561db){var _0x557d0e={};_0x557d0e[_0x1561db]={'$like':'%'+_0x428cf4[_0x9b8b('0x33')][_0x9b8b('0x3f')]+'%'};return _0x557d0e;})});}_0x5af0ce=_[_0x9b8b('0x3e')]({},_0x5af0ce,_0x428cf4[_0x9b8b('0x48')]);return _0x2a5664[_0x9b8b('0x5c')](_0x5af0ce);}})[_0x9b8b('0x21')](function(_0x4c8ae0){if(_0x4c8ae0){_0x16943d=_0x4c8ae0[_0x9b8b('0x47')];if(!_0x428cf4['query']['hasOwnProperty'](_0x9b8b('0x39'))){_0x5af0ce[_0x9b8b('0x1b')]=qs[_0x9b8b('0x1b')](_0x428cf4[_0x9b8b('0x33')][_0x9b8b('0x1b')]);_0x5af0ce['offset']=qs[_0x9b8b('0x1a')](_0x428cf4[_0x9b8b('0x33')][_0x9b8b('0x1a')]);}return _0x2a5664[_0x9b8b('0x5c')](_0x5af0ce);}})[_0x9b8b('0x21')](function(_0x4ad1d8){if(_0x4ad1d8){return _0x4ad1d8?{'count':_0x16943d,'rows':_0x4ad1d8}:null;}})[_0x9b8b('0x21')](respondWithResult(_0x3f8e43,null))[_0x9b8b('0x44')](handleError(_0x3f8e43,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 03ce03f..13baaa3 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 _0xe35c=['Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./trigger.attributes','exports','define'];(function(_0x42d5f0,_0x151b49){var _0x5d008f=function(_0x1a17ca){while(--_0x1a17ca){_0x42d5f0['push'](_0x42d5f0['shift']());}};_0x5d008f(++_0x151b49);}(_0xe35c,0x146));var _0xce35=function(_0x493dd1,_0x44a630){_0x493dd1=_0x493dd1-0x0;var _0x5922f9=_0xe35c[_0x493dd1];return _0x5922f9;};'use strict';var _=require(_0xce35('0x0'));var util=require(_0xce35('0x1'));var logger=require(_0xce35('0x2'))(_0xce35('0x3'));var moment=require(_0xce35('0x4'));var BPromise=require(_0xce35('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xce35('0x6'));var config=require('../../config/environment');var attributes=require(_0xce35('0x7'));module[_0xce35('0x8')]=function(_0x3a4bb,_0x47e53c){return _0x3a4bb[_0xce35('0x9')](_0xce35('0xa'),attributes,{'tableName':_0xce35('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7c8=['request-promise','path','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','util','../../config/logger','api','moment','bluebird'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xb7c8,0x119));var _0x8b7c=function(_0x2de486,_0x428bda){_0x2de486=_0x2de486-0x0;var _0x426582=_0xb7c8[_0x2de486];return _0x426582;};'use strict';var _=require('lodash');var util=require(_0x8b7c('0x0'));var logger=require(_0x8b7c('0x1'))(_0x8b7c('0x2'));var moment=require(_0x8b7c('0x3'));var BPromise=require(_0x8b7c('0x4'));var rp=require(_0x8b7c('0x5'));var fs=require('fs');var path=require(_0x8b7c('0x6'));var rimraf=require('rimraf');var config=require(_0x8b7c('0x7'));var attributes=require(_0x8b7c('0x8'));module[_0x8b7c('0x9')]=function(_0x440900,_0x107428){return _0x440900[_0x8b7c('0xa')](_0x8b7c('0xb'),attributes,{'tableName':_0x8b7c('0xc'),'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 9955354..42a6f62 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 _0xf403=['raw','attributes','include','map','model','stringify','ShowTrigger','find','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTrigger','Trigger','options'];(function(_0x51e136,_0x4eecfd){var _0x52b4f3=function(_0x2d0029){while(--_0x2d0029){_0x51e136['push'](_0x51e136['shift']());}};_0x52b4f3(++_0x4eecfd);}(_0xf403,0x173));var _0x3f40=function(_0x160f22,_0x76672a){_0x160f22=_0x160f22-0x0;var _0x4217cc=_0xf403[_0x160f22];return _0x4217cc;};'use strict';var _=require(_0x3f40('0x0'));var util=require(_0x3f40('0x1'));var moment=require(_0x3f40('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f40('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f40('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f40('0x5'))(_0x3f40('0x6'));var config=require(_0x3f40('0x7'));var jayson=require(_0x3f40('0x8'));var client=jayson['client'][_0x3f40('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27fdb6,_0x337d42,_0x5af12b){return new BPromise(function(_0x351446,_0x5c91f9){return client[_0x3f40('0xa')](_0x27fdb6,_0x5af12b)[_0x3f40('0xb')](function(_0x508f52){logger[_0x3f40('0xc')](_0x3f40('0xd'),_0x337d42,_0x3f40('0xe'));logger[_0x3f40('0xf')](_0x3f40('0x10'),_0x337d42,_0x3f40('0xe'),JSON['stringify'](_0x508f52));if(_0x508f52[_0x3f40('0x11')]){if(_0x508f52[_0x3f40('0x11')][_0x3f40('0x12')]===0x1f4){logger[_0x3f40('0x11')](_0x3f40('0xd'),_0x337d42,_0x508f52[_0x3f40('0x11')][_0x3f40('0x13')]);return _0x5c91f9(_0x508f52[_0x3f40('0x11')][_0x3f40('0x13')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x337d42,_0x508f52['error']['message']);return _0x351446(_0x508f52['error'][_0x3f40('0x13')]);}else{logger[_0x3f40('0xc')](_0x3f40('0xd'),_0x337d42,_0x3f40('0xe'));_0x351446(_0x508f52[_0x3f40('0x14')][_0x3f40('0x13')]);}})[_0x3f40('0x15')](function(_0x133214){logger[_0x3f40('0x11')](_0x3f40('0xd'),_0x337d42,_0x133214);_0x5c91f9(_0x133214);});});}exports[_0x3f40('0x16')]=function(_0x1fd95d){var _0x1211ed=this;return new Promise(function(_0x44b699,_0x2441f3){return db[_0x3f40('0x17')]['findAll']({'raw':_0x1fd95d[_0x3f40('0x18')]?_0x1fd95d[_0x3f40('0x18')][_0x3f40('0x19')]===undefined?!![]:![]:!![],'where':_0x1fd95d[_0x3f40('0x18')]?_0x1fd95d[_0x3f40('0x18')]['where']||null:null,'attributes':_0x1fd95d['options']?_0x1fd95d[_0x3f40('0x18')][_0x3f40('0x1a')]||null:null,'limit':_0x1fd95d['options']?_0x1fd95d[_0x3f40('0x18')]['limit']||null:null,'include':_0x1fd95d['options']?_0x1fd95d[_0x3f40('0x18')][_0x3f40('0x1b')]?_[_0x3f40('0x1c')](_0x1fd95d[_0x3f40('0x18')]['include'],function(_0x2c90f9){return{'model':db[_0x2c90f9[_0x3f40('0x1d')]],'as':_0x2c90f9['as'],'attributes':_0x2c90f9[_0x3f40('0x1a')],'include':_0x2c90f9['include']?_[_0x3f40('0x1c')](_0x2c90f9['include'],function(_0x576ea1){return{'model':db[_0x576ea1[_0x3f40('0x1d')]],'as':_0x576ea1['as'],'attributes':_0x576ea1[_0x3f40('0x1a')],'include':_0x576ea1[_0x3f40('0x1b')]?_[_0x3f40('0x1c')](_0x576ea1[_0x3f40('0x1b')],function(_0x4b43da){return{'model':db[_0x4b43da[_0x3f40('0x1d')]],'as':_0x4b43da['as'],'attributes':_0x4b43da[_0x3f40('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3f40('0xb')](function(_0x449980){logger[_0x3f40('0xc')]('GetTrigger',_0x1fd95d);logger[_0x3f40('0xf')](_0x3f40('0x16'),_0x1fd95d,JSON[_0x3f40('0x1e')](_0x449980));_0x44b699(_0x449980);})[_0x3f40('0x15')](function(_0x36b678){logger['error'](_0x3f40('0x16'),_0x36b678[_0x3f40('0x13')],_0x1fd95d);_0x2441f3(_0x1211ed[_0x3f40('0x11')](0x1f4,_0x36b678['message']));});});};exports[_0x3f40('0x1f')]=function(_0x4bcb20){var _0x570753=this;return new Promise(function(_0x1308ab,_0x56467c){return db[_0x3f40('0x17')][_0x3f40('0x20')]({'raw':_0x4bcb20[_0x3f40('0x18')]?_0x4bcb20['options']['raw']===undefined?!![]:![]:!![],'where':_0x4bcb20[_0x3f40('0x18')]?_0x4bcb20[_0x3f40('0x18')]['where']||null:null,'attributes':_0x4bcb20['options']?_0x4bcb20[_0x3f40('0x18')][_0x3f40('0x1a')]||null:null,'include':_0x4bcb20['options']?_0x4bcb20['options']['include']?_[_0x3f40('0x1c')](_0x4bcb20[_0x3f40('0x18')][_0x3f40('0x1b')],function(_0x975c50){return{'model':db[_0x975c50['model']],'as':_0x975c50['as'],'attributes':_0x975c50[_0x3f40('0x1a')],'include':_0x975c50[_0x3f40('0x1b')]?_['map'](_0x975c50[_0x3f40('0x1b')],function(_0x565aaa){return{'model':db[_0x565aaa[_0x3f40('0x1d')]],'as':_0x565aaa['as'],'attributes':_0x565aaa[_0x3f40('0x1a')],'include':_0x565aaa[_0x3f40('0x1b')]?_[_0x3f40('0x1c')](_0x565aaa[_0x3f40('0x1b')],function(_0x51d16e){return{'model':db[_0x51d16e[_0x3f40('0x1d')]],'as':_0x51d16e['as'],'attributes':_0x51d16e[_0x3f40('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x126737){logger[_0x3f40('0xc')](_0x3f40('0x1f'),_0x4bcb20);logger[_0x3f40('0xf')](_0x3f40('0x1f'),_0x4bcb20,JSON['stringify'](_0x126737));_0x1308ab(_0x126737);})[_0x3f40('0x15')](function(_0x206f87){logger[_0x3f40('0x11')](_0x3f40('0x1f'),_0x206f87['message'],_0x4bcb20);_0x56467c(_0x570753[_0x3f40('0x11')](0x1f4,_0x206f87[_0x3f40('0x13')]));});});}; \ No newline at end of file +var _0xaa30=['model','ShowTrigger','find','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','Trigger','options','where','limit','map','include','attributes'];(function(_0x18bbbd,_0x223005){var _0x40c08f=function(_0x44edcd){while(--_0x44edcd){_0x18bbbd['push'](_0x18bbbd['shift']());}};_0x40c08f(++_0x223005);}(_0xaa30,0xfa));var _0x0aa3=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xaa30[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require('lodash');var util=require(_0x0aa3('0x0'));var moment=require(_0x0aa3('0x1'));var BPromise=require(_0x0aa3('0x2'));var rs=require(_0x0aa3('0x3'));var fs=require('fs');var Redis=require(_0x0aa3('0x4'));var db=require(_0x0aa3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0aa3('0x6'))(_0x0aa3('0x7'));var config=require(_0x0aa3('0x8'));var jayson=require(_0x0aa3('0x9'));var client=jayson[_0x0aa3('0xa')][_0x0aa3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15a4b5,_0x1a1663,_0x17bda6){return new BPromise(function(_0x2bcfdb,_0x1fa985){return client['request'](_0x15a4b5,_0x17bda6)['then'](function(_0x28ad28){logger[_0x0aa3('0xc')](_0x0aa3('0xd'),_0x1a1663,_0x0aa3('0xe'));logger[_0x0aa3('0xf')](_0x0aa3('0x10'),_0x1a1663,_0x0aa3('0xe'),JSON[_0x0aa3('0x11')](_0x28ad28));if(_0x28ad28['error']){if(_0x28ad28[_0x0aa3('0x12')][_0x0aa3('0x13')]===0x1f4){logger[_0x0aa3('0x12')](_0x0aa3('0xd'),_0x1a1663,_0x28ad28[_0x0aa3('0x12')][_0x0aa3('0x14')]);return _0x1fa985(_0x28ad28['error'][_0x0aa3('0x14')]);}logger[_0x0aa3('0x12')](_0x0aa3('0xd'),_0x1a1663,_0x28ad28['error'][_0x0aa3('0x14')]);return _0x2bcfdb(_0x28ad28[_0x0aa3('0x12')][_0x0aa3('0x14')]);}else{logger[_0x0aa3('0xc')]('Trigger,\x20%s,\x20%s',_0x1a1663,_0x0aa3('0xe'));_0x2bcfdb(_0x28ad28['result']['message']);}})[_0x0aa3('0x15')](function(_0x42402a){logger[_0x0aa3('0x12')](_0x0aa3('0xd'),_0x1a1663,_0x42402a);_0x1fa985(_0x42402a);});});}exports[_0x0aa3('0x16')]=function(_0x117546){var _0x258502=this;return new Promise(function(_0x4eb3bb,_0x246593){return db[_0x0aa3('0x17')]['findAll']({'raw':_0x117546[_0x0aa3('0x18')]?_0x117546[_0x0aa3('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x117546[_0x0aa3('0x18')]?_0x117546[_0x0aa3('0x18')][_0x0aa3('0x19')]||null:null,'attributes':_0x117546[_0x0aa3('0x18')]?_0x117546[_0x0aa3('0x18')]['attributes']||null:null,'limit':_0x117546[_0x0aa3('0x18')]?_0x117546[_0x0aa3('0x18')][_0x0aa3('0x1a')]||null:null,'include':_0x117546[_0x0aa3('0x18')]?_0x117546[_0x0aa3('0x18')]['include']?_[_0x0aa3('0x1b')](_0x117546[_0x0aa3('0x18')][_0x0aa3('0x1c')],function(_0x3ee0e8){return{'model':db[_0x3ee0e8['model']],'as':_0x3ee0e8['as'],'attributes':_0x3ee0e8[_0x0aa3('0x1d')],'include':_0x3ee0e8[_0x0aa3('0x1c')]?_[_0x0aa3('0x1b')](_0x3ee0e8[_0x0aa3('0x1c')],function(_0x2dcec9){return{'model':db[_0x2dcec9['model']],'as':_0x2dcec9['as'],'attributes':_0x2dcec9['attributes'],'include':_0x2dcec9['include']?_['map'](_0x2dcec9[_0x0aa3('0x1c')],function(_0x3b01a2){return{'model':db[_0x3b01a2[_0x0aa3('0x1e')]],'as':_0x3b01a2['as'],'attributes':_0x3b01a2[_0x0aa3('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x305900){logger['info'](_0x0aa3('0x16'),_0x117546);logger['debug'](_0x0aa3('0x16'),_0x117546,JSON[_0x0aa3('0x11')](_0x305900));_0x4eb3bb(_0x305900);})['catch'](function(_0x5eeea6){logger[_0x0aa3('0x12')](_0x0aa3('0x16'),_0x5eeea6[_0x0aa3('0x14')],_0x117546);_0x246593(_0x258502['error'](0x1f4,_0x5eeea6[_0x0aa3('0x14')]));});});};exports[_0x0aa3('0x1f')]=function(_0x3dfd90){var _0x18e8ac=this;return new Promise(function(_0x2a2d4a,_0x278554){return db[_0x0aa3('0x17')][_0x0aa3('0x20')]({'raw':_0x3dfd90[_0x0aa3('0x18')]?_0x3dfd90['options'][_0x0aa3('0x21')]===undefined?!![]:![]:!![],'where':_0x3dfd90['options']?_0x3dfd90[_0x0aa3('0x18')][_0x0aa3('0x19')]||null:null,'attributes':_0x3dfd90['options']?_0x3dfd90[_0x0aa3('0x18')][_0x0aa3('0x1d')]||null:null,'include':_0x3dfd90['options']?_0x3dfd90[_0x0aa3('0x18')]['include']?_[_0x0aa3('0x1b')](_0x3dfd90['options'][_0x0aa3('0x1c')],function(_0x429bba){return{'model':db[_0x429bba[_0x0aa3('0x1e')]],'as':_0x429bba['as'],'attributes':_0x429bba[_0x0aa3('0x1d')],'include':_0x429bba['include']?_[_0x0aa3('0x1b')](_0x429bba[_0x0aa3('0x1c')],function(_0x51007d){return{'model':db[_0x51007d['model']],'as':_0x51007d['as'],'attributes':_0x51007d['attributes'],'include':_0x51007d['include']?_['map'](_0x51007d[_0x0aa3('0x1c')],function(_0x2bc4a6){return{'model':db[_0x2bc4a6[_0x0aa3('0x1e')]],'as':_0x2bc4a6['as'],'attributes':_0x2bc4a6[_0x0aa3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0aa3('0x22')](function(_0x132a5d){logger['info']('ShowTrigger',_0x3dfd90);logger[_0x0aa3('0xf')](_0x0aa3('0x1f'),_0x3dfd90,JSON[_0x0aa3('0x11')](_0x132a5d));_0x2a2d4a(_0x132a5d);})[_0x0aa3('0x15')](function(_0x2e0cea){logger['error']('ShowTrigger',_0x2e0cea[_0x0aa3('0x14')],_0x3dfd90);_0x278554(_0x18e8ac['error'](0x1f4,_0x2e0cea[_0x0aa3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 0696897..e7a2d68 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 _0xf653=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','clone','update','delete','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf653,0x188));var _0x3f65=function(_0x24194b,_0x531f7d){_0x24194b=_0x24194b-0x0;var _0x9f0e72=_0xf653[_0x24194b];return _0x9f0e72;};'use strict';var multer=require(_0x3f65('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3f65('0x1'));var express=require(_0x3f65('0x2'));var router=express[_0x3f65('0x3')]();var fs_extra=require(_0x3f65('0x4'));var auth=require(_0x3f65('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3f65('0x6'));var controller=require('./trunk.controller');router[_0x3f65('0x7')]('/',auth[_0x3f65('0x8')](),controller['index']);router[_0x3f65('0x7')](_0x3f65('0x9'),auth[_0x3f65('0x8')](),controller[_0x3f65('0xa')]);router[_0x3f65('0xb')]('/:id/clone',auth[_0x3f65('0x8')](),controller[_0x3f65('0xc')]);router[_0x3f65('0xb')]('/',auth[_0x3f65('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3f65('0xd')]);router[_0x3f65('0xe')]('/:id',auth[_0x3f65('0x8')](),controller[_0x3f65('0xf')]);module[_0x3f65('0x10')]=router; \ No newline at end of file +var _0xa6ee=['put','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','isAuthenticated','show','post','/:id/clone','clone','create'];(function(_0x4e5587,_0x5a18fe){var _0xe632e2=function(_0x2a6d9f){while(--_0x2a6d9f){_0x4e5587['push'](_0x4e5587['shift']());}};_0xe632e2(++_0x5a18fe);}(_0xa6ee,0x131));var _0xea6e=function(_0x347826,_0x3a7212){_0x347826=_0x347826-0x0;var _0x6fd1a8=_0xa6ee[_0x347826];return _0x6fd1a8;};'use strict';var multer=require(_0xea6e('0x0'));var util=require(_0xea6e('0x1'));var path=require('path');var timeout=require(_0xea6e('0x2'));var express=require('express');var router=express[_0xea6e('0x3')]();var fs_extra=require(_0xea6e('0x4'));var auth=require(_0xea6e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea6e('0x6'));var controller=require(_0xea6e('0x7'));router[_0xea6e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xea6e('0x9')](),controller[_0xea6e('0xa')]);router[_0xea6e('0xb')](_0xea6e('0xc'),auth['isAuthenticated'](),controller[_0xea6e('0xd')]);router[_0xea6e('0xb')]('/',auth['isAuthenticated'](),controller[_0xea6e('0xe')]);router[_0xea6e('0xf')]('/:id',auth[_0xea6e('0x9')](),controller['update']);router[_0xea6e('0x10')](_0xea6e('0x11'),auth[_0xea6e('0x9')](),controller[_0xea6e('0x12')]);module[_0xea6e('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 692e61f..7a25a1c 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 _0xbbf0=['getDataValue','split','rfc2833','info','inband','yes','nonat','update','outgoing','force_rport,comedia','join','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','originate','uac','uas','pai','fingerprint','passive','actpass','dynamic','BOOLEAN','sequelize','exports','STRING','name','ENUM','user','peer','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0xbbf0,0x11f));var _0x0bbf=function(_0x25a59c,_0x10d5a7){_0x25a59c=_0x25a59c-0x0;var _0x15eb2f=_0xbbf0[_0x25a59c];return _0x15eb2f;};'use strict';var Sequelize=require(_0x0bbf('0x0'));module[_0x0bbf('0x1')]={'name':{'type':Sequelize[_0x0bbf('0x2')],'allowNull':![],'unique':_0x0bbf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0bbf('0x4')]('friend',_0x0bbf('0x5'),_0x0bbf('0x6')),'allowNull':![],'defaultValue':_0x0bbf('0x7')},'context':{'type':Sequelize[_0x0bbf('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0x0bbf('0x8'),_0x0bbf('0x9'),_0x0bbf('0xa'),_0x0bbf('0xb'),_0x0bbf('0xc'),_0x0bbf('0xd'),_0x0bbf('0xe'),_0x0bbf('0xf'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x0bbf('0x2')]},'secret':{'type':Sequelize[_0x0bbf('0x2')]},'md5secret':{'type':Sequelize[_0x0bbf('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x0bbf('0x2')],'defaultValue':_0x0bbf('0x10'),'set':function(_0x475498){this[_0x0bbf('0x11')](_0x0bbf('0x12'),_0x475498?_0x475498['join'](','):null);},'get':function(){return this[_0x0bbf('0x13')](_0x0bbf('0x12'))?this[_0x0bbf('0x13')](_0x0bbf('0x12'))[_0x0bbf('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x0bbf('0x15'),_0x0bbf('0x16'),'shortinfo',_0x0bbf('0x17'),'auto'),'defaultValue':_0x0bbf('0x15')},'directmedia':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no',_0x0bbf('0x19'),_0x0bbf('0x1a'),_0x0bbf('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x0bbf('0x1c'),'set':function(_0x483d40){this[_0x0bbf('0x11')]('nat',_0x483d40?_0x483d40[_0x0bbf('0x1d')](','):null);},'get':function(){return this[_0x0bbf('0x13')]('nat')?this['getDataValue'](_0x0bbf('0x1e'))[_0x0bbf('0x14')](','):null;},'comment':_0x0bbf('0x1f')},'callgroup':{'type':Sequelize[_0x0bbf('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0bbf('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x0bbf('0x2')]},'language':{'type':Sequelize[_0x0bbf('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0bbf('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0bbf('0x2')],'defaultValue':_0x0bbf('0x20')},'allow':{'type':Sequelize[_0x0bbf('0x2')],'allowNull':![],'defaultValue':_0x0bbf('0x21'),'set':function(_0x244f8a){this[_0x0bbf('0x11')](_0x0bbf('0x22'),_0x244f8a?_0x244f8a[_0x0bbf('0x1d')](';'):_0x0bbf('0x21'));},'get':function(){return this[_0x0bbf('0x13')](_0x0bbf('0x22'))?this[_0x0bbf('0x13')](_0x0bbf('0x22'))[_0x0bbf('0x14')](';'):null;},'comment':_0x0bbf('0x23')},'autoframing':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no')},'insecure':{'type':Sequelize[_0x0bbf('0x2')],'defaultValue':_0x0bbf('0x24'),'set':function(_0x5c925b){this[_0x0bbf('0x11')]('insecure',_0x5c925b?_0x5c925b[_0x0bbf('0x1d')](','):null);},'get':function(){return this['getDataValue'](_0x0bbf('0x25'))?this[_0x0bbf('0x13')](_0x0bbf('0x25'))[_0x0bbf('0x14')](','):null;},'comment':_0x0bbf('0x26')},'trustrpid':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no',_0x0bbf('0x27'))},'promiscredir':{'type':Sequelize[_0x0bbf('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0bbf('0x2')],'defaultValue':_0x0bbf('0x28')},'amaflags':{'type':Sequelize[_0x0bbf('0x2')]},'callcounter':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no'),'defaultValue':_0x0bbf('0x18')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x0bbf('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x0bbf('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0bbf('0x29')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no')},'mailbox':{'type':Sequelize[_0x0bbf('0x2')]},'session_timers':{'type':Sequelize['ENUM']('accept','refuse',_0x0bbf('0x2a'))},'session_expires':{'type':Sequelize[_0x0bbf('0x29')](0xb)},'session_minse':{'type':Sequelize[_0x0bbf('0x29')](0xb)},'session_refresher':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x2b'),'uas'),'defaultValue':_0x0bbf('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x0bbf('0x2')]},'regexten':{'type':Sequelize[_0x0bbf('0x2')]},'fromdomain':{'type':Sequelize[_0x0bbf('0x2')]},'fromuser':{'type':Sequelize[_0x0bbf('0x2')]},'port':{'type':Sequelize[_0x0bbf('0x29')](0x5)},'qualify':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0bbf('0x29')](0xb)},'defaultip':{'type':Sequelize[_0x0bbf('0x2')]},'defaultuser':{'type':Sequelize[_0x0bbf('0x2')]},'rtptimeout':{'type':Sequelize[_0x0bbf('0x29')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0bbf('0x29')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0bbf('0x29')](0xb)},'sendrpid':{'type':Sequelize[_0x0bbf('0x4')]('yes','no',_0x0bbf('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0bbf('0x2')]},'callbackextension':{'type':Sequelize[_0x0bbf('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x0bbf('0x29')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x0bbf('0x2')]},'contactdeny':{'type':Sequelize[_0x0bbf('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x0bbf('0x2')]},'use_q850_reason':{'type':Sequelize[_0x0bbf('0x2')]},'maxforwards':{'type':Sequelize[_0x0bbf('0x29')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x0bbf('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no')},'force_avp':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no')},'icesupport':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x0bbf('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no',_0x0bbf('0x2e'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x0bbf('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x0bbf('0x2')]},'dtlscipher':{'type':Sequelize[_0x0bbf('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x0bbf('0x2')]},'dtlssetup':{'type':Sequelize[_0x0bbf('0x4')]('active',_0x0bbf('0x2f'),_0x0bbf('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0bbf('0x2')]},'recordofffeature':{'type':Sequelize[_0x0bbf('0x2')]},'call_limit':{'type':Sequelize[_0x0bbf('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x0bbf('0x2')]},'mohinterpret':{'type':Sequelize[_0x0bbf('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0bbf('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x0bbf('0x31')},'canreinvite':{'type':Sequelize[_0x0bbf('0x4')](_0x0bbf('0x18'),'no',_0x0bbf('0x19'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0bbf('0x2')]},'otherFields':{'type':Sequelize[_0x0bbf('0x2')]},'active':{'type':Sequelize[_0x0bbf('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0bbf('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xce0d=['insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','INTEGER','refuse','originate','uas','pai','certificate','passive','dynamic','update,nonat','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','inband','auto','rfc2833','yes','nonat','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite'];(function(_0x34ece1,_0x413d66){var _0x18eb9b=function(_0xff3acc){while(--_0xff3acc){_0x34ece1['push'](_0x34ece1['shift']());}};_0x18eb9b(++_0x413d66);}(_0xce0d,0x16c));var _0xdce0=function(_0x5f584a,_0x47f064){_0x5f584a=_0x5f584a-0x0;var _0x3788d9=_0xce0d[_0x5f584a];return _0x3788d9;};'use strict';var Sequelize=require(_0xdce0('0x0'));module[_0xdce0('0x1')]={'name':{'type':Sequelize[_0xdce0('0x2')],'allowNull':![],'unique':_0xdce0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xdce0('0x4')](_0xdce0('0x5'),_0xdce0('0x6'),_0xdce0('0x7')),'allowNull':![],'defaultValue':_0xdce0('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdce0('0x8')},'callingpres':{'type':Sequelize[_0xdce0('0x4')]('ALLOWED_NOT_SCREENED',_0xdce0('0x9'),_0xdce0('0xa'),_0xdce0('0xb'),_0xdce0('0xc'),'PROHIB_PASSED_SCREEN',_0xdce0('0xd'),_0xdce0('0xe'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xdce0('0x2')]},'md5secret':{'type':Sequelize[_0xdce0('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xdce0('0x2')],'defaultValue':_0xdce0('0xf'),'set':function(_0x236dd6){this[_0xdce0('0x10')](_0xdce0('0x11'),_0x236dd6?_0x236dd6[_0xdce0('0x12')](','):null);},'get':function(){return this[_0xdce0('0x13')](_0xdce0('0x11'))?this['getDataValue'](_0xdce0('0x11'))[_0xdce0('0x14')](','):null;},'comment':_0xdce0('0x15')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xdce0('0x16'),'shortinfo',_0xdce0('0x17'),_0xdce0('0x18')),'defaultValue':_0xdce0('0x19')},'directmedia':{'type':Sequelize[_0xdce0('0x4')](_0xdce0('0x1a'),'no',_0xdce0('0x1b'),_0xdce0('0x1c'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xdce0('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xdce0('0x2')]},'directmediadeny':{'type':Sequelize[_0xdce0('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x22f233){this[_0xdce0('0x10')](_0xdce0('0x1d'),_0x22f233?_0x22f233[_0xdce0('0x12')](','):null);},'get':function(){return this[_0xdce0('0x13')]('nat')?this[_0xdce0('0x13')](_0xdce0('0x1d'))[_0xdce0('0x14')](','):null;},'comment':_0xdce0('0x1e')},'callgroup':{'type':Sequelize[_0xdce0('0x2')]},'namedcallgroup':{'type':Sequelize[_0xdce0('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xdce0('0x2')]},'language':{'type':Sequelize[_0xdce0('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xdce0('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xdce0('0x2')],'defaultValue':_0xdce0('0x1f')},'allow':{'type':Sequelize[_0xdce0('0x2')],'allowNull':![],'defaultValue':_0xdce0('0x20'),'set':function(_0x4dbd39){this[_0xdce0('0x10')](_0xdce0('0x21'),_0x4dbd39?_0x4dbd39[_0xdce0('0x12')](';'):_0xdce0('0x20'));},'get':function(){return this['getDataValue'](_0xdce0('0x21'))?this[_0xdce0('0x13')](_0xdce0('0x21'))[_0xdce0('0x14')](';'):null;},'comment':_0xdce0('0x22')},'autoframing':{'type':Sequelize[_0xdce0('0x4')](_0xdce0('0x1a'),'no')},'insecure':{'type':Sequelize[_0xdce0('0x2')],'defaultValue':_0xdce0('0x23'),'set':function(_0x2db2e4){this[_0xdce0('0x10')]('insecure',_0x2db2e4?_0x2db2e4['join'](','):null);},'get':function(){return this[_0xdce0('0x13')](_0xdce0('0x24'))?this[_0xdce0('0x13')](_0xdce0('0x24'))[_0xdce0('0x14')](','):null;},'comment':_0xdce0('0x25')},'trustrpid':{'type':Sequelize[_0xdce0('0x4')](_0xdce0('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xdce0('0x4')](_0xdce0('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0xdce0('0x26'))},'promiscredir':{'type':Sequelize[_0xdce0('0x4')](_0xdce0('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xdce0('0x1a'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xdce0('0x2')]},'callerid':{'type':Sequelize[_0xdce0('0x2')],'defaultValue':_0xdce0('0x27')},'amaflags':{'type':Sequelize[_0xdce0('0x2')]},'callcounter':{'type':Sequelize[_0xdce0('0x4')](_0xdce0('0x1a'),'no'),'defaultValue':_0xdce0('0x1a')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xdce0('0x4')](_0xdce0('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xdce0('0x4')](_0xdce0('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xdce0('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xdce0('0x4')](_0xdce0('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xdce0('0x2')]},'template':{'type':Sequelize[_0xdce0('0x2')]},'videosupport':{'type':Sequelize[_0xdce0('0x4')](_0xdce0('0x1a'),'no',_0xdce0('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xdce0('0x29')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xdce0('0x1a'),'no')},'mailbox':{'type':Sequelize[_0xdce0('0x2')]},'session_timers':{'type':Sequelize[_0xdce0('0x4')]('accept',_0xdce0('0x2a'),_0xdce0('0x2b'))},'session_expires':{'type':Sequelize[_0xdce0('0x29')](0xb)},'session_minse':{'type':Sequelize[_0xdce0('0x29')](0xb)},'session_refresher':{'type':Sequelize[_0xdce0('0x4')]('uac','uas'),'defaultValue':_0xdce0('0x2c')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xdce0('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xdce0('0x29')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xdce0('0x1a')},'keepalive':{'type':Sequelize[_0xdce0('0x29')](0xb)},'defaultip':{'type':Sequelize[_0xdce0('0x2')]},'defaultuser':{'type':Sequelize[_0xdce0('0x2')]},'rtptimeout':{'type':Sequelize[_0xdce0('0x29')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xdce0('0x29')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xdce0('0x29')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0xdce0('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xdce0('0x29')](0xb)},'qualifyfreq':{'type':Sequelize[_0xdce0('0x29')](0xb)},'contactpermit':{'type':Sequelize[_0xdce0('0x2')]},'contactdeny':{'type':Sequelize[_0xdce0('0x2')]},'contactacl':{'type':Sequelize[_0xdce0('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xdce0('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xdce0('0x29')](0xb)},'encryption':{'type':Sequelize[_0xdce0('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xdce0('0x4')]('yes','no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0xdce0('0x4')](_0xdce0('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0xdce0('0x4')](_0xdce0('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xdce0('0x4')]('yes','no','fingerprint',_0xdce0('0x2e'))},'dtlsrekey':{'type':Sequelize[_0xdce0('0x29')](0xb)},'dtlscertfile':{'type':Sequelize[_0xdce0('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xdce0('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xdce0('0x2')]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0xdce0('0x2f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xdce0('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0xdce0('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xdce0('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xdce0('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xdce0('0x4')](_0xdce0('0x1a'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xdce0('0x1a'),'no')},'vmexten':{'type':Sequelize[_0xdce0('0x2')]},'mohinterpret':{'type':Sequelize[_0xdce0('0x2')]},'mohsuggest':{'type':Sequelize[_0xdce0('0x2')]},'parkinglot':{'type':Sequelize[_0xdce0('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xdce0('0x2')],'defaultValue':_0xdce0('0x30')},'canreinvite':{'type':Sequelize[_0xdce0('0x4')]('yes','no',_0xdce0('0x1b'),_0xdce0('0x1c'),_0xdce0('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xdce0('0x2')]},'otherFields':{'type':Sequelize[_0xdce0('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'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 adf9aa1..d516b69 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 _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(_0x43a725,_0x485821){var _0x4d7252=function(_0x534994){while(--_0x534994){_0x43a725['push'](_0x43a725['shift']());}};_0x4d7252(++_0x485821);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x55c8da,_0x39657c){_0x55c8da=_0x55c8da-0x0;var _0x10c620=_0xd6d6[_0x55c8da];return _0x10c620;};'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 +var _0xf2ca=['omit','createdAt','body','updatedAt','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','Unable\x20to\x20retrieve\x20the\x20current\x20user','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','get','Trunks','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','show','params','Trunk','find','clone'];(function(_0x3d43be,_0x496751){var _0x39c091=function(_0x4eed94){while(--_0x4eed94){_0x3d43be['push'](_0x3d43be['shift']());}};_0x39c091(++_0x496751);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x51f4fc,_0x1fe3ef){_0x51f4fc=_0x51f4fc-0x0;var _0x4d96fc=_0xf2ca[_0x51f4fc];return _0x4d96fc;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];var jayson=require(_0xaf2c('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15ccb4,_0x8eaf9b,_0x935959,_0x18a8a5){return new BPromise(function(_0x293ca6,_0x152c73){var _0x214f47=_0x18a8a5||client;return _0x214f47[_0xaf2c('0x19')](_0x15ccb4,_0x935959)[_0xaf2c('0x1a')](function(_0x1d0633){logger[_0xaf2c('0x1b')](_0xaf2c('0x1c'),_0x8eaf9b,_0xaf2c('0x1d'));logger[_0xaf2c('0x1e')](_0xaf2c('0x1f'),_0x8eaf9b,'request\x20sent',JSON[_0xaf2c('0x20')](_0x1d0633));if(_0x1d0633['error']){if(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x22')]===0x1f4){logger[_0xaf2c('0x21')]('Trunk,\x20%s,\x20%s',_0x8eaf9b,_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);return _0x152c73(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);}logger[_0xaf2c('0x21')](_0xaf2c('0x1c'),_0x8eaf9b,_0x1d0633['error'][_0xaf2c('0x23')]);return _0x293ca6(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);}else{logger[_0xaf2c('0x1b')](_0xaf2c('0x1c'),_0x8eaf9b,'request\x20sent');_0x293ca6(_0x1d0633[_0xaf2c('0x24')][_0xaf2c('0x23')]);}})[_0xaf2c('0x25')](function(_0x4be6ed){logger['error'](_0xaf2c('0x1c'),_0x8eaf9b,_0x4be6ed);_0x152c73(_0x4be6ed);});});}function respondWithStatusCode(_0x303546,_0x1cafad){_0x1cafad=_0x1cafad||0xcc;return function(_0x99f78d){if(_0x99f78d){return _0x303546['sendStatus'](_0x1cafad);}return _0x303546[_0xaf2c('0x26')](_0x1cafad)[_0xaf2c('0x27')]();};}function respondWithResult(_0x3a0145,_0x3c1ae6){_0x3c1ae6=_0x3c1ae6||0xc8;return function(_0xe929b5){if(_0xe929b5){return _0x3a0145[_0xaf2c('0x26')](_0x3c1ae6)[_0xaf2c('0x28')](_0xe929b5);}};}function respondWithFilteredResult(_0x4a8dd8,_0x29f8b0){return function(_0x2051be){if(_0x2051be){var _0x36f37c=typeof _0x29f8b0[_0xaf2c('0x29')]==='undefined'&&typeof _0x29f8b0[_0xaf2c('0x2a')]==='undefined';var _0x38db1b=_0x2051be[_0xaf2c('0x2b')];var _0x15466b=_0x36f37c?0x0:_0x29f8b0['offset'];var _0x2747bb=_0x36f37c?_0x2051be[_0xaf2c('0x2b')]:_0x29f8b0[_0xaf2c('0x29')]+_0x29f8b0['limit'];var _0xe18ba7;if(_0x2747bb>=_0x38db1b){_0x2747bb=_0x38db1b;_0xe18ba7=0xc8;}else{_0xe18ba7=0xce;}_0x4a8dd8[_0xaf2c('0x26')](_0xe18ba7);return _0x4a8dd8[_0xaf2c('0x2c')](_0xaf2c('0x2d'),_0x15466b+'-'+_0x2747bb+'/'+_0x38db1b)['json'](_0x2051be);}return null;};}function patchUpdates(_0x3da072){return function(_0x4072ff){try{jsonpatch[_0xaf2c('0x2e')](_0x4072ff,_0x3da072,!![]);}catch(_0x51a49c){return BPromise['reject'](_0x51a49c);}return _0x4072ff[_0xaf2c('0x2f')]();};}function saveUpdates(_0x4c9b4f,_0x39c0ed){return function(_0x5e7247){if(_0x5e7247){return _0x5e7247[_0xaf2c('0x30')](_0x4c9b4f)[_0xaf2c('0x1a')](function(_0x4ffbb9){return _0x4ffbb9;});}return null;};}function removeEntity(_0x1408e3,_0x5403f8){return function(_0x54db57){if(_0x54db57){return _0x54db57[_0xaf2c('0x31')]()[_0xaf2c('0x1a')](function(){var _0x211a69=_0x54db57[_0xaf2c('0x32')]({'plain':!![]});var _0x2d6ed7=_0xaf2c('0x33');return db['UserProfileResource'][_0xaf2c('0x31')]({'where':{'type':_0x2d6ed7,'resourceId':_0x211a69['id']}})['then'](function(){return _0x54db57;});})[_0xaf2c('0x1a')](function(){_0x1408e3['status'](0xcc)[_0xaf2c('0x27')]();});}};}function handleEntityNotFound(_0x59f686,_0x2f3d16){return function(_0x4e877e){if(!_0x4e877e){_0x59f686[_0xaf2c('0x34')](0x194);}return _0x4e877e;};}function handleError(_0x4b9c6b,_0x30fd87){_0x30fd87=_0x30fd87||0x1f4;return function(_0x356402){logger[_0xaf2c('0x21')](_0x356402[_0xaf2c('0x35')]);if(_0x356402[_0xaf2c('0x36')]){delete _0x356402['name'];}_0x4b9c6b['status'](_0x30fd87)[_0xaf2c('0x37')](_0x356402);};}exports[_0xaf2c('0x38')]=function(_0x409700,_0xa44813){var _0x4eeecf={},_0x316238={},_0x573db3={'count':0x0,'rows':[]};var _0xa1248e=_[_0xaf2c('0x39')](db['Trunk'][_0xaf2c('0x3a')],function(_0x24668d){return{'name':_0x24668d[_0xaf2c('0x3b')],'type':_0x24668d[_0xaf2c('0x3c')][_0xaf2c('0x3d')]};});_0x316238[_0xaf2c('0x3e')]=_[_0xaf2c('0x39')](_0xa1248e,_0xaf2c('0x36'));_0x316238[_0xaf2c('0x3f')]=_[_0xaf2c('0x40')](_0x409700[_0xaf2c('0x3f')]);_0x316238[_0xaf2c('0x41')]=_[_0xaf2c('0x42')](_0x316238['model'],_0x316238['query']);_0x4eeecf['attributes']=_[_0xaf2c('0x42')](_0x316238[_0xaf2c('0x3e')],qs[_0xaf2c('0x43')](_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x4eeecf[_0xaf2c('0x44')]=_0x4eeecf['attributes'][_0xaf2c('0x45')]?_0x4eeecf[_0xaf2c('0x44')]:_0x316238[_0xaf2c('0x3e')];if(!_0x409700['query']['hasOwnProperty'](_0xaf2c('0x46'))){_0x4eeecf['limit']=qs[_0xaf2c('0x2a')](_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x2a')]);_0x4eeecf[_0xaf2c('0x29')]=qs['offset'](_0x409700[_0xaf2c('0x3f')]['offset']);}_0x4eeecf[_0xaf2c('0x47')]=qs[_0xaf2c('0x48')](_0x409700['query'][_0xaf2c('0x48')]);_0x4eeecf['where']=qs[_0xaf2c('0x41')](_[_0xaf2c('0x49')](_0x409700[_0xaf2c('0x3f')],_0x316238[_0xaf2c('0x41')]),_0xa1248e);if(_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4a')]){_0x4eeecf[_0xaf2c('0x4b')]=_[_0xaf2c('0x4c')](_0x4eeecf[_0xaf2c('0x4b')],{'$or':_['map'](_0xa1248e,function(_0x51d751){if(_0x51d751[_0xaf2c('0x3c')]!=='VIRTUAL'){var _0x4ad36e={};_0x4ad36e[_0x51d751['name']]={'$like':'%'+_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4a')]+'%'};return _0x4ad36e;}})});}_0x4eeecf=_[_0xaf2c('0x4c')]({},_0x4eeecf,_0x409700[_0xaf2c('0x4d')]);var _0x599b2d={'where':_0x4eeecf[_0xaf2c('0x4b')]};return db['Trunk'][_0xaf2c('0x2b')](_0x599b2d)['then'](function(_0x166c26){_0x573db3[_0xaf2c('0x2b')]=_0x166c26;if(_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x4eeecf[_0xaf2c('0x4f')]=[{'all':!![]}];}return db['Trunk'][_0xaf2c('0x50')](_0x4eeecf);})[_0xaf2c('0x1a')](function(_0x4b3ca4){_0x573db3['rows']=_0x4b3ca4;return _0x573db3;})[_0xaf2c('0x1a')](respondWithFilteredResult(_0xa44813,_0x4eeecf))['catch'](handleError(_0xa44813,null));};exports[_0xaf2c('0x51')]=function(_0x23642b,_0x17b9ec){var _0x315b9f={'raw':![],'where':{'id':_0x23642b[_0xaf2c('0x52')]['id']}},_0x367112={};_0x367112[_0xaf2c('0x3e')]=_[_0xaf2c('0x40')](db[_0xaf2c('0x53')][_0xaf2c('0x3a')]);_0x367112[_0xaf2c('0x3f')]=_['keys'](_0x23642b[_0xaf2c('0x3f')]);_0x367112[_0xaf2c('0x41')]=_['intersection'](_0x367112['model'],_0x367112['query']);_0x315b9f[_0xaf2c('0x44')]=_[_0xaf2c('0x42')](_0x367112['model'],qs[_0xaf2c('0x43')](_0x23642b[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x315b9f[_0xaf2c('0x44')]=_0x315b9f[_0xaf2c('0x44')][_0xaf2c('0x45')]?_0x315b9f[_0xaf2c('0x44')]:_0x367112['model'];if(_0x23642b[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x315b9f['include']=[{'all':!![]}];}_0x315b9f=_[_0xaf2c('0x4c')]({},_0x315b9f,_0x23642b[_0xaf2c('0x4d')]);return db[_0xaf2c('0x53')][_0xaf2c('0x54')](_0x315b9f)[_0xaf2c('0x1a')](handleEntityNotFound(_0x17b9ec,null))[_0xaf2c('0x1a')](respondWithResult(_0x17b9ec,null))[_0xaf2c('0x25')](handleError(_0x17b9ec,null));};exports[_0xaf2c('0x55')]=function(_0x19b82d,_0x300254){var _0x133678={'where':{'id':_0x19b82d[_0xaf2c('0x52')]['id']}},_0x10a270={};_0x10a270[_0xaf2c('0x3e')]=_[_0xaf2c('0x40')](db[_0xaf2c('0x53')][_0xaf2c('0x3a')]);_0x133678[_0xaf2c('0x44')]=_[_0xaf2c('0x42')](_0x10a270[_0xaf2c('0x3e')],qs['fields'](_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x133678[_0xaf2c('0x44')]=_0x133678['attributes'][_0xaf2c('0x45')]?_0x133678['attributes']:_0x10a270[_0xaf2c('0x3e')];if(_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x133678[_0xaf2c('0x4f')]=[{'all':!![]}];}_0x133678=_[_0xaf2c('0x4c')]({},_0x133678,_0x19b82d[_0xaf2c('0x4d')]);return db[_0xaf2c('0x53')][_0xaf2c('0x54')](_0x133678)[_0xaf2c('0x1a')](handleEntityNotFound(_0x300254,null))['then'](function(_0x41d08b){if(_0x41d08b){var _0x400dcd=_0x41d08b[_0xaf2c('0x32')]({'plain':!![]});_0x400dcd=qs[_0xaf2c('0x56')](_0x400dcd,['id',_0xaf2c('0x57'),'updatedAt']);_0x19b82d[_0xaf2c('0x58')]=_[_0xaf2c('0x56')](_0x19b82d['body'],['id',_0xaf2c('0x57'),_0xaf2c('0x59')]);return db['Trunk']['create'](_[_0xaf2c('0x4c')](_0x400dcd,_0x19b82d[_0xaf2c('0x58')]),{'include':_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x36b6f0){var _0x3f48f1=_0x19b82d['user'][_0xaf2c('0x32')]({'plain':!![]});if(!_0x3f48f1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f48f1[_0xaf2c('0x5a')]===_0xaf2c('0x5b')){var _0x16e9f4=_0x36b6f0[_0xaf2c('0x32')]({'plain':!![]});var _0x1a297e=_0xaf2c('0x33');return db[_0xaf2c('0x5c')][_0xaf2c('0x54')]({'where':{'name':_0x1a297e,'userProfileId':_0x3f48f1[_0xaf2c('0x5d')]},'raw':!![]})[_0xaf2c('0x1a')](function(_0x53ba41){if(_0x53ba41&&_0x53ba41[_0xaf2c('0x5e')]===0x0){return db[_0xaf2c('0x5f')][_0xaf2c('0x60')]({'name':_0x16e9f4[_0xaf2c('0x36')],'resourceId':_0x16e9f4['id'],'type':_0x53ba41[_0xaf2c('0x36')],'sectionId':_0x53ba41['id']},{})['then'](function(){return _0x36b6f0;});}else{return _0x36b6f0;}})[_0xaf2c('0x25')](function(_0x28b09f){logger[_0xaf2c('0x21')](_0xaf2c('0x61'),_0x28b09f);throw _0x28b09f;});}return _0x36b6f0;});}})[_0xaf2c('0x1a')](respondWithResult(_0x300254,0xc9))['catch'](handleError(_0x300254,null));};exports['create']=function(_0x1166c9,_0x1ead61,_0x5849f8){var _0xf96361;return db[_0xaf2c('0x53')][_0xaf2c('0x60')](_0x1166c9['body'],{'raw':!![]})[_0xaf2c('0x1a')](function(_0x2bd845){_0xf96361=_0x2bd845;return db[_0xaf2c('0x53')][_0xaf2c('0x50')]({'raw':!![]});})['then'](function(_0x32d552){var _0x26129c=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x2767c7=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],'server/files/templates/registry.ejs'),_0xaf2c('0x66'));var _0x5d965c=ejs[_0xaf2c('0x67')](_0x26129c,{'trunks':_0x32d552||[]});fs[_0xaf2c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5d965c);if(_0xf96361[_0xaf2c('0x69')]){var _0x5a95ac=ejs['render'](_0x2767c7,{'trunks':_0x32d552||[]});fs[_0xaf2c('0x68')](_0xaf2c('0x6a'),_0x5a95ac);}})[_0xaf2c('0x1a')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0xaf2c('0x1a')](function(){var _0x3e972c=_0x1166c9['user'][_0xaf2c('0x32')]({'plain':!![]});if(!_0x3e972c)throw new Error(_0xaf2c('0x6b'));if(_0x3e972c[_0xaf2c('0x5a')]===_0xaf2c('0x5b')){var _0x6e1837=_0xf96361[_0xaf2c('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xaf2c('0x54')]({'where':{'name':_0xaf2c('0x33'),'userProfileId':_0x3e972c[_0xaf2c('0x5d')]},'raw':!![]})['then'](function(_0xc9dd21){if(_0xc9dd21&&_0xc9dd21[_0xaf2c('0x5e')]===0x0){return db[_0xaf2c('0x5f')]['create']({'name':_0x6e1837[_0xaf2c('0x36')],'resourceId':_0x6e1837['id'],'type':_0xc9dd21[_0xaf2c('0x36')],'sectionId':_0xc9dd21['id']},{})[_0xaf2c('0x1a')](function(){return _0xf96361;});}else{return _0xf96361;}})[_0xaf2c('0x25')](function(_0x491160){logger[_0xaf2c('0x21')](_0xaf2c('0x61'),_0x491160);throw _0x491160;});}return _0xf96361;})[_0xaf2c('0x1a')](respondWithResult(_0x1ead61,0xc9))['catch'](handleError(_0x1ead61,null));};exports['update']=function(_0x427ece,_0x1b7dc1,_0x5571eb){var _0x3675d9;return db[_0xaf2c('0x53')]['find']({'where':{'id':_0x427ece[_0xaf2c('0x52')]['id']}})[_0xaf2c('0x1a')](handleEntityNotFound(_0x1b7dc1,null))[_0xaf2c('0x1a')](saveUpdates(_0x427ece[_0xaf2c('0x58')],null))[_0xaf2c('0x1a')](function(_0x4af252){if(_0x4af252){_0x3675d9=_0x4af252;return db['Trunk'][_0xaf2c('0x50')]({'raw':!![]});}})[_0xaf2c('0x1a')](function(_0x55b568){if(_0x55b568){var _0x4f378e=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x4b9fdc=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x6c')),_0xaf2c('0x66'));var _0x41c707=ejs['render'](_0x4f378e,{'trunks':_0x55b568||[]});fs[_0xaf2c('0x68')](_0xaf2c('0x6d'),_0x41c707);var _0x483774=ejs['render'](_0x4b9fdc,{'trunks':_0x55b568||[]});fs['writeFileSync'](_0xaf2c('0x6a'),_0x483774);return respondWithRpcPromise(_0xaf2c('0x6e'),_0xaf2c('0x30'),{'module':_0xaf2c('0x6f')});}return null;})['then'](function(_0x19fbd5){if(_0x19fbd5){return _0x3675d9;}})[_0xaf2c('0x1a')](respondWithResult(_0x1b7dc1,null))[_0xaf2c('0x25')](handleError(_0x1b7dc1,null));};exports[_0xaf2c('0x31')]=function(_0x4ddf95,_0x1e8fc0,_0x23aeac){var _0x41590;return db[_0xaf2c('0x53')][_0xaf2c('0x54')]({'where':{'id':_0x4ddf95['params']['id']}})[_0xaf2c('0x1a')](handleEntityNotFound(_0x1e8fc0,null))[_0xaf2c('0x1a')](removeEntity(_0x1e8fc0,null))['then'](function(){return db['Trunk'][_0xaf2c('0x50')]({'raw':!![]});})[_0xaf2c('0x1a')](function(_0x5bce65){var _0x1e6a12=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x2a3cb4=fs[_0xaf2c('0x62')](path['join'](config[_0xaf2c('0x64')],'server/files/templates/registry.ejs'),_0xaf2c('0x66'));var _0x7724cc=ejs['render'](_0x1e6a12,{'trunks':_0x5bce65});var _0x4a9ea8=ejs[_0xaf2c('0x67')](_0x2a3cb4,{'trunks':_0x5bce65});fs[_0xaf2c('0x68')](_0xaf2c('0x6d'),_0x7724cc);fs['writeFileSync'](_0xaf2c('0x6a'),_0x4a9ea8);return respondWithRpcPromise(_0xaf2c('0x6e'),_0xaf2c('0x31'),{'module':'chan_sip.so'});})['catch'](handleError(_0x1e8fc0,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index f3d8f76..d6ca88a 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 _0x854f=['util','api','moment','request-promise','path','rimraf','../../config/environment','./trunk.attributes','define','Trunk','tools_trunks','lodash'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x854f,0x1c7));var _0xf854=function(_0x32d7ff,_0x55c1a5){_0x32d7ff=_0x32d7ff-0x0;var _0x61bcbb=_0x854f[_0x32d7ff];return _0x61bcbb;};'use strict';var _=require(_0xf854('0x0'));var util=require(_0xf854('0x1'));var logger=require('../../config/logger')(_0xf854('0x2'));var moment=require(_0xf854('0x3'));var BPromise=require('bluebird');var rp=require(_0xf854('0x4'));var fs=require('fs');var path=require(_0xf854('0x5'));var rimraf=require(_0xf854('0x6'));var config=require(_0xf854('0x7'));var attributes=require(_0xf854('0x8'));module['exports']=function(_0x17f2ed,_0x37e6d2){return _0x17f2ed[_0xf854('0x9')](_0xf854('0xa'),attributes,{'tableName':_0xf854('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60bc=['../../config/logger','api','moment','request-promise','path','rimraf','./trunk.attributes','Trunk','tools_trunks','lodash','util'];(function(_0x43ddb5,_0x2eafc0){var _0x540961=function(_0x22ee63){while(--_0x22ee63){_0x43ddb5['push'](_0x43ddb5['shift']());}};_0x540961(++_0x2eafc0);}(_0x60bc,0x1ed));var _0xc60b=function(_0x3a83c8,_0x489ffd){_0x3a83c8=_0x3a83c8-0x0;var _0x5c89db=_0x60bc[_0x3a83c8];return _0x5c89db;};'use strict';var _=require(_0xc60b('0x0'));var util=require(_0xc60b('0x1'));var logger=require(_0xc60b('0x2'))(_0xc60b('0x3'));var moment=require(_0xc60b('0x4'));var BPromise=require('bluebird');var rp=require(_0xc60b('0x5'));var fs=require('fs');var path=require(_0xc60b('0x6'));var rimraf=require(_0xc60b('0x7'));var config=require('../../config/environment');var attributes=require(_0xc60b('0x8'));module['exports']=function(_0x4f69d5,_0x1b798c){return _0x4f69d5['define'](_0xc60b('0x9'),attributes,{'tableName':_0xc60b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 566b188..4c73107 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 _0x5f13=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','GetTrunk','findAll','options','raw','attributes','limit','include','map','model','stringify','catch','ShowTrunk','Trunk','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0xd9cb77,_0x23885c){var _0x553a41=function(_0x503f21){while(--_0x503f21){_0xd9cb77['push'](_0xd9cb77['shift']());}};_0x553a41(++_0x23885c);}(_0x5f13,0x1b6));var _0x35f1=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5f13[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x35f1('0x0'));var util=require(_0x35f1('0x1'));var moment=require(_0x35f1('0x2'));var BPromise=require(_0x35f1('0x3'));var rs=require(_0x35f1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35f1('0x5'))['db'];var utils=require(_0x35f1('0x6'));var logger=require(_0x35f1('0x7'))(_0x35f1('0x8'));var config=require(_0x35f1('0x9'));var jayson=require(_0x35f1('0xa'));var client=jayson['client'][_0x35f1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2146ba,_0xa4cc87,_0x51a8d3){return new BPromise(function(_0x35caab,_0x20e82f){return client[_0x35f1('0xc')](_0x2146ba,_0x51a8d3)[_0x35f1('0xd')](function(_0x28e3af){logger[_0x35f1('0xe')](_0x35f1('0xf'),_0xa4cc87,_0x35f1('0x10'));logger[_0x35f1('0x11')](_0x35f1('0x12'),_0xa4cc87,_0x35f1('0x10'),JSON['stringify'](_0x28e3af));if(_0x28e3af[_0x35f1('0x13')]){if(_0x28e3af[_0x35f1('0x13')][_0x35f1('0x14')]===0x1f4){logger[_0x35f1('0x13')](_0x35f1('0xf'),_0xa4cc87,_0x28e3af[_0x35f1('0x13')][_0x35f1('0x15')]);return _0x20e82f(_0x28e3af[_0x35f1('0x13')][_0x35f1('0x15')]);}logger[_0x35f1('0x13')](_0x35f1('0xf'),_0xa4cc87,_0x28e3af[_0x35f1('0x13')][_0x35f1('0x15')]);return _0x35caab(_0x28e3af[_0x35f1('0x13')]['message']);}else{logger[_0x35f1('0xe')](_0x35f1('0xf'),_0xa4cc87,'request\x20sent');_0x35caab(_0x28e3af['result'][_0x35f1('0x15')]);}})['catch'](function(_0x39aed4){logger['error'](_0x35f1('0xf'),_0xa4cc87,_0x39aed4);_0x20e82f(_0x39aed4);});});}exports[_0x35f1('0x16')]=function(_0x2494d5){var _0x560871=this;return new Promise(function(_0x3cdebc,_0x19642a){return db['Trunk'][_0x35f1('0x17')]({'raw':_0x2494d5[_0x35f1('0x18')]?_0x2494d5[_0x35f1('0x18')][_0x35f1('0x19')]===undefined?!![]:![]:!![],'where':_0x2494d5[_0x35f1('0x18')]?_0x2494d5[_0x35f1('0x18')]['where']||null:null,'attributes':_0x2494d5[_0x35f1('0x18')]?_0x2494d5[_0x35f1('0x18')][_0x35f1('0x1a')]||null:null,'limit':_0x2494d5['options']?_0x2494d5[_0x35f1('0x18')][_0x35f1('0x1b')]||null:null,'include':_0x2494d5[_0x35f1('0x18')]?_0x2494d5[_0x35f1('0x18')][_0x35f1('0x1c')]?_[_0x35f1('0x1d')](_0x2494d5[_0x35f1('0x18')][_0x35f1('0x1c')],function(_0x1515f0){return{'model':db[_0x1515f0['model']],'as':_0x1515f0['as'],'attributes':_0x1515f0[_0x35f1('0x1a')],'include':_0x1515f0[_0x35f1('0x1c')]?_[_0x35f1('0x1d')](_0x1515f0[_0x35f1('0x1c')],function(_0x7e26d9){return{'model':db[_0x7e26d9[_0x35f1('0x1e')]],'as':_0x7e26d9['as'],'attributes':_0x7e26d9['attributes'],'include':_0x7e26d9[_0x35f1('0x1c')]?_['map'](_0x7e26d9[_0x35f1('0x1c')],function(_0x105ad0){return{'model':db[_0x105ad0[_0x35f1('0x1e')]],'as':_0x105ad0['as'],'attributes':_0x105ad0['attributes']};}):[]};}):[]};}):[]:[]})[_0x35f1('0xd')](function(_0x5a30bb){logger[_0x35f1('0xe')](_0x35f1('0x16'),_0x2494d5);logger['debug'](_0x35f1('0x16'),_0x2494d5,JSON[_0x35f1('0x1f')](_0x5a30bb));_0x3cdebc(_0x5a30bb);})[_0x35f1('0x20')](function(_0x4fb4e4){logger[_0x35f1('0x13')]('GetTrunk',_0x4fb4e4['message'],_0x2494d5);_0x19642a(_0x560871['error'](0x1f4,_0x4fb4e4[_0x35f1('0x15')]));});});};exports[_0x35f1('0x21')]=function(_0x4cee43){var _0x171683=this;return new Promise(function(_0x56dba5,_0x38344e){return db[_0x35f1('0x22')][_0x35f1('0x23')]({'raw':_0x4cee43[_0x35f1('0x18')]?_0x4cee43[_0x35f1('0x18')][_0x35f1('0x19')]===undefined?!![]:![]:!![],'where':_0x4cee43[_0x35f1('0x18')]?_0x4cee43['options'][_0x35f1('0x24')]||null:null,'attributes':_0x4cee43[_0x35f1('0x18')]?_0x4cee43[_0x35f1('0x18')][_0x35f1('0x1a')]||null:null,'include':_0x4cee43['options']?_0x4cee43[_0x35f1('0x18')][_0x35f1('0x1c')]?_[_0x35f1('0x1d')](_0x4cee43['options'][_0x35f1('0x1c')],function(_0xec1eaf){return{'model':db[_0xec1eaf[_0x35f1('0x1e')]],'as':_0xec1eaf['as'],'attributes':_0xec1eaf['attributes'],'include':_0xec1eaf['include']?_[_0x35f1('0x1d')](_0xec1eaf[_0x35f1('0x1c')],function(_0x334a12){return{'model':db[_0x334a12['model']],'as':_0x334a12['as'],'attributes':_0x334a12['attributes'],'include':_0x334a12[_0x35f1('0x1c')]?_['map'](_0x334a12['include'],function(_0x1e3055){return{'model':db[_0x1e3055[_0x35f1('0x1e')]],'as':_0x1e3055['as'],'attributes':_0x1e3055[_0x35f1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35f1('0xd')](function(_0x5e553e){logger[_0x35f1('0xe')](_0x35f1('0x21'),_0x4cee43);logger['debug'](_0x35f1('0x21'),_0x4cee43,JSON['stringify'](_0x5e553e));_0x56dba5(_0x5e553e);})[_0x35f1('0x20')](function(_0x57b9af){logger[_0x35f1('0x13')]('ShowTrunk',_0x57b9af[_0x35f1('0x15')],_0x4cee43);_0x38344e(_0x171683['error'](0x1f4,_0x57b9af[_0x35f1('0x15')]));});});}; \ No newline at end of file +var _0x04ec=['catch','GetTrunk','Trunk','findAll','options','raw','where','limit','include','attributes','map','model','ShowTrunk','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x04ec,0x18d));var _0xc04e=function(_0x1d3a5d,_0x17fc32){_0x1d3a5d=_0x1d3a5d-0x0;var _0x257078=_0x04ec[_0x1d3a5d];return _0x257078;};'use strict';var _=require(_0xc04e('0x0'));var util=require(_0xc04e('0x1'));var moment=require(_0xc04e('0x2'));var BPromise=require(_0xc04e('0x3'));var rs=require(_0xc04e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc04e('0x5'))('rpc');var config=require(_0xc04e('0x6'));var jayson=require(_0xc04e('0x7'));var client=jayson['client'][_0xc04e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x438bc1,_0x148e91,_0x11242f){return new BPromise(function(_0x2f4b0a,_0x5da3f8){return client[_0xc04e('0x9')](_0x438bc1,_0x11242f)[_0xc04e('0xa')](function(_0x2b17be){logger[_0xc04e('0xb')](_0xc04e('0xc'),_0x148e91,'request\x20sent');logger[_0xc04e('0xd')](_0xc04e('0xe'),_0x148e91,_0xc04e('0xf'),JSON[_0xc04e('0x10')](_0x2b17be));if(_0x2b17be[_0xc04e('0x11')]){if(_0x2b17be[_0xc04e('0x11')]['code']===0x1f4){logger[_0xc04e('0x11')](_0xc04e('0xc'),_0x148e91,_0x2b17be[_0xc04e('0x11')][_0xc04e('0x12')]);return _0x5da3f8(_0x2b17be[_0xc04e('0x11')][_0xc04e('0x12')]);}logger[_0xc04e('0x11')]('Trunk,\x20%s,\x20%s',_0x148e91,_0x2b17be[_0xc04e('0x11')][_0xc04e('0x12')]);return _0x2f4b0a(_0x2b17be[_0xc04e('0x11')]['message']);}else{logger[_0xc04e('0xb')](_0xc04e('0xc'),_0x148e91,_0xc04e('0xf'));_0x2f4b0a(_0x2b17be['result'][_0xc04e('0x12')]);}})[_0xc04e('0x13')](function(_0x3b1440){logger[_0xc04e('0x11')]('Trunk,\x20%s,\x20%s',_0x148e91,_0x3b1440);_0x5da3f8(_0x3b1440);});});}exports[_0xc04e('0x14')]=function(_0x5ac0fb){var _0x11d4ee=this;return new Promise(function(_0x1aa4a6,_0x2fedd3){return db[_0xc04e('0x15')][_0xc04e('0x16')]({'raw':_0x5ac0fb[_0xc04e('0x17')]?_0x5ac0fb[_0xc04e('0x17')][_0xc04e('0x18')]===undefined?!![]:![]:!![],'where':_0x5ac0fb[_0xc04e('0x17')]?_0x5ac0fb[_0xc04e('0x17')][_0xc04e('0x19')]||null:null,'attributes':_0x5ac0fb['options']?_0x5ac0fb[_0xc04e('0x17')]['attributes']||null:null,'limit':_0x5ac0fb[_0xc04e('0x17')]?_0x5ac0fb[_0xc04e('0x17')][_0xc04e('0x1a')]||null:null,'include':_0x5ac0fb['options']?_0x5ac0fb['options']['include']?_['map'](_0x5ac0fb[_0xc04e('0x17')][_0xc04e('0x1b')],function(_0x1c52c0){return{'model':db[_0x1c52c0['model']],'as':_0x1c52c0['as'],'attributes':_0x1c52c0[_0xc04e('0x1c')],'include':_0x1c52c0['include']?_['map'](_0x1c52c0[_0xc04e('0x1b')],function(_0x4bb7f0){return{'model':db[_0x4bb7f0['model']],'as':_0x4bb7f0['as'],'attributes':_0x4bb7f0[_0xc04e('0x1c')],'include':_0x4bb7f0[_0xc04e('0x1b')]?_[_0xc04e('0x1d')](_0x4bb7f0[_0xc04e('0x1b')],function(_0x527938){return{'model':db[_0x527938['model']],'as':_0x527938['as'],'attributes':_0x527938['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xab4318){logger['info'](_0xc04e('0x14'),_0x5ac0fb);logger[_0xc04e('0xd')](_0xc04e('0x14'),_0x5ac0fb,JSON['stringify'](_0xab4318));_0x1aa4a6(_0xab4318);})['catch'](function(_0x206269){logger['error'](_0xc04e('0x14'),_0x206269[_0xc04e('0x12')],_0x5ac0fb);_0x2fedd3(_0x11d4ee[_0xc04e('0x11')](0x1f4,_0x206269[_0xc04e('0x12')]));});});};exports['ShowTrunk']=function(_0x4e371d){var _0x232490=this;return new Promise(function(_0xeb62b,_0xf37105){return db[_0xc04e('0x15')]['find']({'raw':_0x4e371d[_0xc04e('0x17')]?_0x4e371d[_0xc04e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4e371d[_0xc04e('0x17')]?_0x4e371d[_0xc04e('0x17')]['where']||null:null,'attributes':_0x4e371d[_0xc04e('0x17')]?_0x4e371d['options'][_0xc04e('0x1c')]||null:null,'include':_0x4e371d['options']?_0x4e371d[_0xc04e('0x17')][_0xc04e('0x1b')]?_[_0xc04e('0x1d')](_0x4e371d['options'][_0xc04e('0x1b')],function(_0x5b10fa){return{'model':db[_0x5b10fa[_0xc04e('0x1e')]],'as':_0x5b10fa['as'],'attributes':_0x5b10fa[_0xc04e('0x1c')],'include':_0x5b10fa[_0xc04e('0x1b')]?_['map'](_0x5b10fa[_0xc04e('0x1b')],function(_0x1057ef){return{'model':db[_0x1057ef['model']],'as':_0x1057ef['as'],'attributes':_0x1057ef[_0xc04e('0x1c')],'include':_0x1057ef[_0xc04e('0x1b')]?_[_0xc04e('0x1d')](_0x1057ef[_0xc04e('0x1b')],function(_0x1acf29){return{'model':db[_0x1acf29[_0xc04e('0x1e')]],'as':_0x1acf29['as'],'attributes':_0x1acf29[_0xc04e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc04e('0xa')](function(_0x3b1d45){logger['info'](_0xc04e('0x1f'),_0x4e371d);logger['debug'](_0xc04e('0x1f'),_0x4e371d,JSON[_0xc04e('0x10')](_0x3b1d45));_0xeb62b(_0x3b1d45);})[_0xc04e('0x13')](function(_0x14b7b7){logger['error'](_0xc04e('0x1f'),_0x14b7b7['message'],_0x4e371d);_0xf37105(_0x232490[_0xc04e('0x11')](0x1f4,_0x14b7b7[_0xc04e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 7f73c24..8a26992 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 _0x9525=['isAuthenticated','update','exports','express','../../components/auth/service','put','/:id'];(function(_0x1cd42b,_0x1a750f){var _0x1ce986=function(_0x565893){while(--_0x565893){_0x1cd42b['push'](_0x1cd42b['shift']());}};_0x1ce986(++_0x1a750f);}(_0x9525,0x137));var _0x5952=function(_0x3bbf1,_0x3ced07){_0x3bbf1=_0x3bbf1-0x0;var _0x1e7a89=_0x9525[_0x3bbf1];return _0x1e7a89;};'use strict';var express=require(_0x5952('0x0'));var router=express['Router']();var auth=require(_0x5952('0x1'));var controller=require('./user-setting.controller');router[_0x5952('0x2')](_0x5952('0x3'),auth[_0x5952('0x4')](),controller[_0x5952('0x5')]);module[_0x5952('0x6')]=router; \ No newline at end of file +var _0xccf4=['isAuthenticated','update','exports','express','../../components/auth/service','put','/:id'];(function(_0x1fd441,_0x2629bf){var _0x411a91=function(_0x5d14e3){while(--_0x5d14e3){_0x1fd441['push'](_0x1fd441['shift']());}};_0x411a91(++_0x2629bf);}(_0xccf4,0x161));var _0x4ccf=function(_0x3379a9,_0x857fc3){_0x3379a9=_0x3379a9-0x0;var _0x2e4dfa=_0xccf4[_0x3379a9];return _0x2e4dfa;};'use strict';var express=require(_0x4ccf('0x0'));var router=express['Router']();var auth=require(_0x4ccf('0x1'));var controller=require('./user-setting.controller');router[_0x4ccf('0x2')](_0x4ccf('0x3'),auth[_0x4ccf('0x4')](),controller[_0x4ccf('0x5')]);module[_0x4ccf('0x6')]=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 594dc03..4622b98 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 _0xeb5f=['ENUM','error','BOOLEAN','TEXT','DATE','sequelize','info','debug','exports'];(function(_0x484a7f,_0x134958){var _0x22d8e1=function(_0x587f43){while(--_0x587f43){_0x484a7f['push'](_0x484a7f['shift']());}};_0x22d8e1(++_0x134958);}(_0xeb5f,0xef));var _0xfeb5=function(_0x3a70c9,_0x56e6c5){_0x3a70c9=_0x3a70c9-0x0;var _0x3b185d=_0xeb5f[_0x3a70c9];return _0x3b185d;};'use strict';var Sequelize=require(_0xfeb5('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error','warning',_0xfeb5('0x1'),_0xfeb5('0x2')];module[_0xfeb5('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0xfeb5('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xfeb5('0x5'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xfeb5('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xfeb5('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xfeb5('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file +var _0x0d23=['INTEGER','UserId','sequelize','warning','debug','ENUM','error','BOOLEAN','DATE'];(function(_0x2ba3c3,_0x43a558){var _0x12f920=function(_0x862e84){while(--_0x862e84){_0x2ba3c3['push'](_0x2ba3c3['shift']());}};_0x12f920(++_0x43a558);}(_0x0d23,0x1cd));var _0x30d2=function(_0x5e57d4,_0x126055){_0x5e57d4=_0x5e57d4-0x0;var _0x4aae74=_0x0d23[_0x5e57d4];return _0x4aae74;};'use strict';var Sequelize=require(_0x30d2('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x30d2('0x1'),'info',_0x30d2('0x2')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x30d2('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x30d2('0x4'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x30d2('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x30d2('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x30d2('0x7')],'unique':_0x30d2('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 5f43737..bf4161f 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 _0x6b61=['role','Unauthorized','lodash','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','status','json','then','sendStatus','error','send','update','user'];(function(_0x7d2d51,_0x5578ae){var _0x4861b1=function(_0x5be0cb){while(--_0x5be0cb){_0x7d2d51['push'](_0x7d2d51['shift']());}};_0x4861b1(++_0x5578ae);}(_0x6b61,0x16a));var _0x16b6=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0x6b61[_0x3cea78];return _0x33b66b;};'use strict';var _=require(_0x16b6('0x0'));var Redis=require('ioredis');var logger=require(_0x16b6('0x1'))(_0x16b6('0x2'));var config=require(_0x16b6('0x3'));var db=require(_0x16b6('0x4'))['db'];var socket=require(_0x16b6('0x5'))(new Redis(config[_0x16b6('0x6')]));require(_0x16b6('0x7'))[_0x16b6('0x8')](socket);config['redis']=_[_0x16b6('0x9')](config[_0x16b6('0x6')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x3d06d6,_0x268d89){_0x268d89=_0x268d89||0xc8;return function(_0x59552d){if(_0x59552d){return _0x3d06d6[_0x16b6('0xa')](_0x268d89)[_0x16b6('0xb')](_0x59552d);}};}function saveUpdates(_0x5bb5f3){return function(_0x59dcad){if(_0x59dcad){return _0x59dcad['update'](_0x5bb5f3)[_0x16b6('0xc')](function(_0x4cdac4){return _0x4cdac4;});}return null;};}function handleEntityNotFound(_0x95f3c5){return function(_0x33f15f){if(!_0x33f15f){_0x95f3c5[_0x16b6('0xd')](0x194);}return _0x33f15f;};}function handleError(_0x2e0cae,_0x3c93a4){_0x3c93a4=_0x3c93a4||0x1f4;return function(_0x2114e4){logger[_0x16b6('0xe')](_0x2114e4['stack']);if(_0x2114e4['name']){delete _0x2114e4['name'];}_0x2e0cae[_0x16b6('0xa')](_0x3c93a4)[_0x16b6('0xf')](_0x2114e4);};}exports[_0x16b6('0x10')]=function(_0x250b7b,_0x132d71){if(_0x250b7b[_0x16b6('0x11')][_0x16b6('0x12')]!=='admin')throw new Error(_0x16b6('0x13'));if(isNaN(Number(_0x250b7b['params']['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db['UserSetting']['find']({'where':{'id':_0x250b7b['params']['id']}})['then'](handleEntityNotFound(_0x132d71,null))[_0x16b6('0xc')](saveUpdates(_0x250b7b['body'],null))['then'](respondWithResult(_0x132d71,null))['catch'](handleError(_0x132d71,null));}; \ No newline at end of file +var _0x5a01=['ioredis','../../config/logger','../../mysqldb','socket.io-emitter','./user-setting.socket','register','redis','localhost','status','json','update','sendStatus','error','stack','name','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','then','catch','lodash'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x5a01,0x1af));var _0x15a0=function(_0x536068,_0x3de52c){_0x536068=_0x536068-0x0;var _0x4a5db2=_0x5a01[_0x536068];return _0x4a5db2;};'use strict';var _=require(_0x15a0('0x0'));var Redis=require(_0x15a0('0x1'));var logger=require(_0x15a0('0x2'))('api');var config=require('../../config/environment');var db=require(_0x15a0('0x3'))['db'];var socket=require(_0x15a0('0x4'))(new Redis(config['redis']));require(_0x15a0('0x5'))[_0x15a0('0x6')](socket);config[_0x15a0('0x7')]=_['defaults'](config['redis'],{'host':_0x15a0('0x8'),'port':0x18eb});function respondWithResult(_0x52ab0,_0x40fd51){_0x40fd51=_0x40fd51||0xc8;return function(_0x502248){if(_0x502248){return _0x52ab0[_0x15a0('0x9')](_0x40fd51)[_0x15a0('0xa')](_0x502248);}};}function saveUpdates(_0x251c9c){return function(_0x374049){if(_0x374049){return _0x374049[_0x15a0('0xb')](_0x251c9c)['then'](function(_0x4be840){return _0x4be840;});}return null;};}function handleEntityNotFound(_0x339f74){return function(_0x4541a0){if(!_0x4541a0){_0x339f74[_0x15a0('0xc')](0x194);}return _0x4541a0;};}function handleError(_0x24497a,_0x2bd954){_0x2bd954=_0x2bd954||0x1f4;return function(_0x19cad2){logger[_0x15a0('0xd')](_0x19cad2[_0x15a0('0xe')]);if(_0x19cad2[_0x15a0('0xf')]){delete _0x19cad2[_0x15a0('0xf')];}_0x24497a[_0x15a0('0x9')](_0x2bd954)[_0x15a0('0x10')](_0x19cad2);};}exports['update']=function(_0x520a82,_0x3d80e9){if(_0x520a82[_0x15a0('0x11')][_0x15a0('0x12')]!==_0x15a0('0x13'))throw new Error(_0x15a0('0x14'));if(isNaN(Number(_0x520a82[_0x15a0('0x15')]['id'])))throw new Error(_0x15a0('0x16'));return db[_0x15a0('0x17')][_0x15a0('0x18')]({'where':{'id':_0x520a82['params']['id']}})[_0x15a0('0x19')](handleEntityNotFound(_0x3d80e9,null))['then'](saveUpdates(_0x520a82['body'],null))[_0x15a0('0x19')](respondWithResult(_0x3d80e9,null))[_0x15a0('0x1a')](handleError(_0x3d80e9,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 077cb85..ddb0b38 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 _0x38fa=['update','remove','emit','hook','exports','events','../../mysqldb','UserSetting','setMaxListeners','save'];(function(_0x3369fc,_0x3098e1){var _0x365605=function(_0x568991){while(--_0x568991){_0x3369fc['push'](_0x3369fc['shift']());}};_0x365605(++_0x3098e1);}(_0x38fa,0x16d));var _0xa38f=function(_0x2f8fc5,_0x5804a7){_0x2f8fc5=_0x2f8fc5-0x0;var _0x392d45=_0x38fa[_0x2f8fc5];return _0x392d45;};'use strict';var EventEmitter=require(_0xa38f('0x0'));var UserSetting=require(_0xa38f('0x1'))['db'][_0xa38f('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xa38f('0x3')](0x0);var events={'afterCreate':_0xa38f('0x4'),'afterUpdate':_0xa38f('0x5'),'afterDestroy':_0xa38f('0x6')};function emitEvent(_0x5da500){return function(_0x2a88db,_0x2ce3a7,_0x502929){UserSettingEvents[_0xa38f('0x7')](_0x5da500+':'+_0x2a88db['id'],_0x2a88db);UserSettingEvents[_0xa38f('0x7')](_0x5da500,_0x2a88db);_0x502929(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xa38f('0x8')](e,emitEvent(event));}}module[_0xa38f('0x9')]=UserSettingEvents; \ No newline at end of file +var _0x113c=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x12cf12,_0x49428f){var _0x29ffaf=function(_0x5f4003){while(--_0x5f4003){_0x12cf12['push'](_0x12cf12['shift']());}};_0x29ffaf(++_0x49428f);}(_0x113c,0x66));var _0xc113=function(_0x3e311f,_0x19c0ce){_0x3e311f=_0x3e311f-0x0;var _0x501a48=_0x113c[_0x3e311f];return _0x501a48;};'use strict';var EventEmitter=require(_0xc113('0x0'));var UserSetting=require(_0xc113('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc113('0x2'),'afterUpdate':_0xc113('0x3'),'afterDestroy':_0xc113('0x4')};function emitEvent(_0x2a4c42){return function(_0x374c09,_0xcb92bc,_0x39cabd){UserSettingEvents[_0xc113('0x5')](_0x2a4c42+':'+_0x374c09['id'],_0x374c09);UserSettingEvents[_0xc113('0x5')](_0x2a4c42,_0x374c09);_0x39cabd(null);};}for(var e in events){if(events[_0xc113('0x6')](e)){var event=events[e];UserSetting[_0xc113('0x7')](e,emitEvent(event));}}module[_0xc113('0x8')]=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 59e2b76..70e2bfb 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 _0x4dd2=['clientSideLoggingEnabledSince','exports','define','user_settings','clientSideLoggingEnabled'];(function(_0x288e31,_0x4ded42){var _0x7ae398=function(_0x3ace50){while(--_0x3ace50){_0x288e31['push'](_0x288e31['shift']());}};_0x7ae398(++_0x4ded42);}(_0x4dd2,0xf1));var _0x24dd=function(_0x5a2d3f,_0x27b04e){_0x5a2d3f=_0x5a2d3f-0x0;var _0x5c65d8=_0x4dd2[_0x5a2d3f];return _0x5c65d8;};'use strict';var attributes=require('./user-setting.attributes');module[_0x24dd('0x0')]=function(_0x2ee27b){return _0x2ee27b[_0x24dd('0x1')]('UserSetting',attributes,{'tableName':_0x24dd('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c459c){if(!_0x5c459c[_0x24dd('0x3')])_0x5c459c['clientSideLoggingEnabledSince']=null;else if(_0x5c459c[_0x24dd('0x4')]===null)_0x5c459c[_0x24dd('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x4bde=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting','user_settings','clientSideLoggingEnabled'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x1b2130,_0x2046b4){_0x1b2130=_0x1b2130-0x0;var _0x586b3c=_0x4bde[_0x1b2130];return _0x586b3c;};'use strict';var attributes=require(_0xe4bd('0x0'));module[_0xe4bd('0x1')]=function(_0x611407){return _0x611407['define'](_0xe4bd('0x2'),attributes,{'tableName':_0xe4bd('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x416389){if(!_0x416389[_0xe4bd('0x4')])_0x416389['clientSideLoggingEnabledSince']=null;else if(_0x416389[_0xe4bd('0x5')]===null)_0x416389[_0xe4bd('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 59b2ce4..5d69ba3 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 _0x92e9=['user-setting:update:user-','UserId','length','user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update'];(function(_0x4eab22,_0x383052){var _0x4b062b=function(_0x235d37){while(--_0x235d37){_0x4eab22['push'](_0x4eab22['shift']());}};_0x4b062b(++_0x383052);}(_0x92e9,0x1d0));var _0x992e=function(_0x73c43f,_0x2509c0){_0x73c43f=_0x73c43f-0x0;var _0x5190c0=_0x92e9[_0x73c43f];return _0x5190c0;};'use strict';var UserSettingEvents=require(_0x992e('0x0'));var events=[_0x992e('0x1'),_0x992e('0x2'),_0x992e('0x3')];function createListener(_0x545130,_0x47dc30){return function(_0x57c6d2){_0x47dc30[_0x992e('0x4')](_0x545130,_0x57c6d2);if(_0x545130===_0x992e('0x5')){_0x47dc30[_0x992e('0x4')](_0x992e('0x6')+_0x57c6d2[_0x992e('0x7')],_0x57c6d2);}};}exports['register']=function(_0xb49a3c){for(var _0x2654c1=0x0,_0x36510e=events[_0x992e('0x8')];_0x2654c1<_0x36510e;_0x2654c1++){var _0x15f73d=events[_0x2654c1];var _0x68f9cc=createListener(_0x992e('0x9')+_0x15f73d,_0xb49a3c);UserSettingEvents['on'](_0x15f73d,_0x68f9cc);}}; \ No newline at end of file +var _0xeb01=['length','./user-setting.events','save','remove','update','user-setting:update','user-setting:update:user-','UserId','register'];(function(_0x1a5c16,_0x299e9a){var _0x5a5d85=function(_0x514a26){while(--_0x514a26){_0x1a5c16['push'](_0x1a5c16['shift']());}};_0x5a5d85(++_0x299e9a);}(_0xeb01,0x17b));var _0x1eb0=function(_0x15b9c8,_0x35fb37){_0x15b9c8=_0x15b9c8-0x0;var _0x129d89=_0xeb01[_0x15b9c8];return _0x129d89;};'use strict';var UserSettingEvents=require(_0x1eb0('0x0'));var events=[_0x1eb0('0x1'),_0x1eb0('0x2'),_0x1eb0('0x3')];function createListener(_0x3b570e,_0x4b2b26){return function(_0x259245){_0x4b2b26['emit'](_0x3b570e,_0x259245);if(_0x3b570e===_0x1eb0('0x4')){_0x4b2b26['emit'](_0x1eb0('0x5')+_0x259245[_0x1eb0('0x6')],_0x259245);}};}exports[_0x1eb0('0x7')]=function(_0x500dc7){for(var _0x2ff56c=0x0,_0x5a300=events[_0x1eb0('0x8')];_0x2ff56c<_0x5a300;_0x2ff56c++){var _0xbe7dc4=events[_0x2ff56c];var _0x26c1d0=createListener('user-setting:'+_0xbe7dc4,_0x500dc7);UserSettingEvents['on'](_0xbe7dc4,_0x26c1d0);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index cb9b2de..a275e43 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 _0xe3c8=['update','put','removeQueues','delete','destroy','removeFaxInteractions','removeSmsInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','/presence','getPresence','/:id','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/api_key','getApiKey','post','addContacts','/create_many','bulkCreate','root','server/files/images/','format','now','originalname','/:id/avatar','single','file','/:id/logout','logout','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey'];(function(_0xc2d576,_0x384c4b){var _0x2b5764=function(_0x4eb532){while(--_0x4eb532){_0xc2d576['push'](_0xc2d576['shift']());}};_0x2b5764(++_0x384c4b);}(_0xe3c8,0x145));var _0x8e3c=function(_0x989506,_0x546398){_0x989506=_0x989506-0x0;var _0x29cc96=_0xe3c8[_0x989506];return _0x29cc96;};'use strict';var multer=require(_0x8e3c('0x0'));var util=require(_0x8e3c('0x1'));var path=require(_0x8e3c('0x2'));var timeout=require(_0x8e3c('0x3'));var express=require(_0x8e3c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8e3c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8e3c('0x6'));var controller=require(_0x8e3c('0x7'));router[_0x8e3c('0x8')]('/',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0xa')]);router['get'](_0x8e3c('0xb'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0xc')]);router[_0x8e3c('0x8')](_0x8e3c('0xd'),auth['isAuthenticated'](),controller['whoami']);router[_0x8e3c('0x8')](_0x8e3c('0xe'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0xf')]);router[_0x8e3c('0x8')](_0x8e3c('0x10'),auth[_0x8e3c('0x9')](),controller['show']);router[_0x8e3c('0x8')]('/:id/avatar',controller[_0x8e3c('0x11')]);router[_0x8e3c('0x8')]('/:id/open_tabs',auth[_0x8e3c('0x9')](),controller['getOpenTabs']);router['get'](_0x8e3c('0x12'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x13')]);router['get'](_0x8e3c('0x14'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x15')]);router[_0x8e3c('0x8')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x8e3c('0x16')]);router['get'](_0x8e3c('0x17'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x18')]);router[_0x8e3c('0x8')]('/:id/recordings',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x19')]);router[_0x8e3c('0x8')](_0x8e3c('0x1a'),auth['isAuthenticated'](),controller[_0x8e3c('0x1b')]);router[_0x8e3c('0x8')]('/:id/chat/interactions',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x1c')]);router[_0x8e3c('0x8')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x8e3c('0x1d')]);router[_0x8e3c('0x8')]('/:id/mail/interactions',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x1e')]);router[_0x8e3c('0x8')]('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0x8e3c('0x1f')]);router[_0x8e3c('0x8')](_0x8e3c('0x20'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x8e3c('0x8')]('/:id/whatsapp/interactions',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x21')]);router[_0x8e3c('0x8')](_0x8e3c('0x22'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x23')]);router['get'](_0x8e3c('0x24'),auth['isAuthenticated'](),controller['getLists']);router[_0x8e3c('0x8')](_0x8e3c('0x25'),auth[_0x8e3c('0x9')](),controller['getAgents']);router[_0x8e3c('0x8')](_0x8e3c('0x26'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x27')]);router['get'](_0x8e3c('0x28'),auth[_0x8e3c('0x9')](),controller['getFaxAccounts']);router[_0x8e3c('0x8')](_0x8e3c('0x29'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x2a')]);router[_0x8e3c('0x8')](_0x8e3c('0x2b'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x2c')]);router[_0x8e3c('0x8')](_0x8e3c('0x2d'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x2e')]);router[_0x8e3c('0x8')](_0x8e3c('0x2f'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x30')]);router[_0x8e3c('0x8')]('/:id/whatsapp_accounts',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x31')]);router[_0x8e3c('0x8')]('/:id/scheduled_calls',auth[_0x8e3c('0x9')](),controller['getScheduledCalls']);router[_0x8e3c('0x8')](_0x8e3c('0x32'),auth['isAuthenticated'](),controller[_0x8e3c('0x33')]);router[_0x8e3c('0x34')](_0x8e3c('0x12'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x35')]);router[_0x8e3c('0x34')]('/',auth[_0x8e3c('0x9')](),controller['create']);router[_0x8e3c('0x34')](_0x8e3c('0x36'),auth['isAuthenticated'](),controller[_0x8e3c('0x37')]);router[_0x8e3c('0x34')](_0x8e3c('0x14'),auth[_0x8e3c('0x9')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56b0a7,_0x51fd9e,_0x45c01c){_0x45c01c(null,path['join'](config[_0x8e3c('0x38')],_0x8e3c('0x39')));},'filename':function(_0xa7d8c6,_0x428a81,_0x2c5dbd){_0x2c5dbd(null,util[_0x8e3c('0x3a')]('%s-%s',Date[_0x8e3c('0x3b')](),_0x428a81[_0x8e3c('0x3c')]));}})});router[_0x8e3c('0x34')](_0x8e3c('0x3d'),upload[_0x8e3c('0x3e')](_0x8e3c('0x3f')),controller['addAvatar']);router[_0x8e3c('0x34')]('/:id/login',auth[_0x8e3c('0x9')](),controller['login']);router[_0x8e3c('0x34')](_0x8e3c('0x40'),auth['isAuthenticated'](),controller[_0x8e3c('0x41')]);router[_0x8e3c('0x34')]('/:id/pause',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x42')]);router[_0x8e3c('0x34')](_0x8e3c('0x43'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x44')]);router[_0x8e3c('0x34')](_0x8e3c('0x22'),auth[_0x8e3c('0x9')](),controller['addTeams']);router[_0x8e3c('0x34')](_0x8e3c('0x45'),auth['isAuthenticated'](),controller[_0x8e3c('0x46')]);router[_0x8e3c('0x34')](_0x8e3c('0x47'),auth['isAuthenticated'](),controller[_0x8e3c('0x48')]);router[_0x8e3c('0x34')](_0x8e3c('0x49'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x4a')]);router['post'](_0x8e3c('0x4b'),auth['isAuthenticated'](),controller[_0x8e3c('0x4c')]);router['post'](_0x8e3c('0x4d'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x4e')]);router[_0x8e3c('0x34')]('/:id/whatsapp_interactions',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x4f')]);router[_0x8e3c('0x34')]('/:id/fax_accounts',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x50')]);router[_0x8e3c('0x34')](_0x8e3c('0x29'),auth[_0x8e3c('0x9')](),controller['addMailAccounts']);router[_0x8e3c('0x34')](_0x8e3c('0x2b'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x51')]);router[_0x8e3c('0x34')](_0x8e3c('0x2d'),auth['isAuthenticated'](),controller[_0x8e3c('0x52')]);router[_0x8e3c('0x34')]('/:id/chat_websites',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x53')]);router[_0x8e3c('0x34')](_0x8e3c('0x54'),auth['isAuthenticated'](),controller[_0x8e3c('0x55')]);router['post'](_0x8e3c('0x32'),auth['isAuthenticated'](),controller[_0x8e3c('0x56')]);router['put'](_0x8e3c('0x10'),auth['isAuthenticated'](),controller[_0x8e3c('0x57')]);router[_0x8e3c('0x58')]('/:id/password',auth[_0x8e3c('0x9')](),controller['changePassword']);router['delete']('/:id/queues',auth['isAuthenticated'](),controller[_0x8e3c('0x59')]);router[_0x8e3c('0x5a')](_0x8e3c('0x22'),auth[_0x8e3c('0x9')](),controller['removeTeams']);router[_0x8e3c('0x5a')](_0x8e3c('0x10'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x5b')]);router[_0x8e3c('0x5a')]('/:id/chat_interactions',auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x8e3c('0x5a')](_0x8e3c('0x47'),auth[_0x8e3c('0x9')](),controller['removeMailInteractions']);router[_0x8e3c('0x5a')](_0x8e3c('0x49'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x5c')]);router[_0x8e3c('0x5a')](_0x8e3c('0x4b'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x5d')]);router['delete'](_0x8e3c('0x4d'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0x8e3c('0x5a')](_0x8e3c('0x5e'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x5f')]);router['delete'](_0x8e3c('0x28'),auth[_0x8e3c('0x9')](),controller['removeFaxAccounts']);router[_0x8e3c('0x5a')](_0x8e3c('0x29'),auth['isAuthenticated'](),controller[_0x8e3c('0x60')]);router[_0x8e3c('0x5a')](_0x8e3c('0x2b'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x61')]);router['delete']('/:id/sms_accounts',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x62')]);router[_0x8e3c('0x5a')]('/:id/chat_websites',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x63')]);router[_0x8e3c('0x5a')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x8e3c('0x64')]);router[_0x8e3c('0x5a')](_0x8e3c('0x32'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x65')]);module[_0x8e3c('0x66')]=router; \ No newline at end of file +var _0x2fe3=['addMailAccounts','addOpenchannelAccounts','/:id/chat_websites','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey','update','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','/:id/mail_accounts','removeMailAccounts','removeChatWebsites','removeWhatsappAccounts','exports','multer','util','express','fs-extra','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','whoami','getPresence','/:id','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','getWhatsappAccounts','/:id/scheduled_calls','/:id/api_key','post','addContacts','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','originalname','/:id/avatar','file','addAvatar','login','logout','/:id/pause','pause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2fe3,0x87));var _0x32fe=function(_0xa19d58,_0x268c39){_0xa19d58=_0xa19d58-0x0;var _0x1561bb=_0x2fe3[_0xa19d58];return _0x1561bb;};'use strict';var multer=require(_0x32fe('0x0'));var util=require(_0x32fe('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x32fe('0x2'));var router=express['Router']();var fs_extra=require(_0x32fe('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x32fe('0x4'));var controller=require(_0x32fe('0x5'));router['get']('/',auth[_0x32fe('0x6')](),controller[_0x32fe('0x7')]);router[_0x32fe('0x8')](_0x32fe('0x9'),auth[_0x32fe('0x6')](),controller[_0x32fe('0xa')]);router['get'](_0x32fe('0xb'),auth[_0x32fe('0x6')](),controller[_0x32fe('0xc')]);router[_0x32fe('0x8')]('/presence',auth['isAuthenticated'](),controller[_0x32fe('0xd')]);router[_0x32fe('0x8')](_0x32fe('0xe'),auth[_0x32fe('0x6')](),controller['show']);router[_0x32fe('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x32fe('0x8')](_0x32fe('0xf'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x10')]);router[_0x32fe('0x8')](_0x32fe('0x11'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x12')]);router[_0x32fe('0x8')](_0x32fe('0x13'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x14')]);router[_0x32fe('0x8')](_0x32fe('0x15'),auth[_0x32fe('0x6')](),controller['getVoiceQueuesRt']);router['get'](_0x32fe('0x16'),auth[_0x32fe('0x6')](),controller['getGroups']);router[_0x32fe('0x8')](_0x32fe('0x17'),auth[_0x32fe('0x6')](),controller['getRecordings']);router[_0x32fe('0x8')](_0x32fe('0x18'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x19')]);router['get'](_0x32fe('0x1a'),auth['isAuthenticated'](),controller[_0x32fe('0x1b')]);router[_0x32fe('0x8')](_0x32fe('0x1c'),auth[_0x32fe('0x6')](),controller['getOpenchannelInteractions']);router['get'](_0x32fe('0x1d'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x1e')]);router[_0x32fe('0x8')](_0x32fe('0x1f'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x20')]);router[_0x32fe('0x8')]('/:id/fax/interactions',auth[_0x32fe('0x6')](),controller['getFaxInteractions']);router[_0x32fe('0x8')](_0x32fe('0x21'),auth['isAuthenticated'](),controller[_0x32fe('0x22')]);router[_0x32fe('0x8')](_0x32fe('0x23'),auth[_0x32fe('0x6')](),controller['getTeams']);router['get'](_0x32fe('0x24'),auth['isAuthenticated'](),controller['getLists']);router[_0x32fe('0x8')]('/:id/agents',auth[_0x32fe('0x6')](),controller[_0x32fe('0x25')]);router[_0x32fe('0x8')](_0x32fe('0x26'),auth['isAuthenticated'](),controller[_0x32fe('0x27')]);router['get'](_0x32fe('0x28'),auth['isAuthenticated'](),controller['getFaxAccounts']);router[_0x32fe('0x8')]('/:id/mail_accounts',auth[_0x32fe('0x6')](),controller['getMailAccounts']);router[_0x32fe('0x8')](_0x32fe('0x29'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x2a')]);router[_0x32fe('0x8')](_0x32fe('0x2b'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x2c')]);router[_0x32fe('0x8')]('/:id/chat_websites',auth[_0x32fe('0x6')](),controller[_0x32fe('0x2d')]);router[_0x32fe('0x8')]('/:id/whatsapp_accounts',auth[_0x32fe('0x6')](),controller[_0x32fe('0x2e')]);router[_0x32fe('0x8')](_0x32fe('0x2f'),auth[_0x32fe('0x6')](),controller['getScheduledCalls']);router['get'](_0x32fe('0x30'),auth[_0x32fe('0x6')](),controller['getApiKey']);router[_0x32fe('0x31')](_0x32fe('0x11'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x32')]);router[_0x32fe('0x31')]('/',auth[_0x32fe('0x6')](),controller['create']);router[_0x32fe('0x31')](_0x32fe('0x33'),auth['isAuthenticated'](),controller[_0x32fe('0x34')]);router[_0x32fe('0x31')](_0x32fe('0x13'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x35')]);var upload=multer({'storage':multer[_0x32fe('0x36')]({'destination':function(_0x28ac9d,_0x70a4f1,_0x1b79b4){_0x1b79b4(null,path[_0x32fe('0x37')](config[_0x32fe('0x38')],_0x32fe('0x39')));},'filename':function(_0x5c4b09,_0x1cc2a3,_0x49a2d8){_0x49a2d8(null,util['format'](_0x32fe('0x3a'),Date[_0x32fe('0x3b')](),_0x1cc2a3[_0x32fe('0x3c')]));}})});router['post'](_0x32fe('0x3d'),upload['single'](_0x32fe('0x3e')),controller[_0x32fe('0x3f')]);router[_0x32fe('0x31')]('/:id/login',auth['isAuthenticated'](),controller[_0x32fe('0x40')]);router[_0x32fe('0x31')]('/:id/logout',auth['isAuthenticated'](),controller[_0x32fe('0x41')]);router[_0x32fe('0x31')](_0x32fe('0x42'),auth['isAuthenticated'](),controller[_0x32fe('0x43')]);router[_0x32fe('0x31')]('/:id/unpause',auth[_0x32fe('0x6')](),controller['unpause']);router[_0x32fe('0x31')]('/:id/teams',auth['isAuthenticated'](),controller[_0x32fe('0x44')]);router['post']('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x32fe('0x45')]);router[_0x32fe('0x31')](_0x32fe('0x46'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x47')]);router[_0x32fe('0x31')](_0x32fe('0x48'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x49')]);router[_0x32fe('0x31')](_0x32fe('0x4a'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x4b')]);router[_0x32fe('0x31')](_0x32fe('0x4c'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x4d')]);router[_0x32fe('0x31')](_0x32fe('0x4e'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x4f')]);router[_0x32fe('0x31')]('/:id/fax_accounts',auth[_0x32fe('0x6')](),controller[_0x32fe('0x50')]);router[_0x32fe('0x31')]('/:id/mail_accounts',auth[_0x32fe('0x6')](),controller[_0x32fe('0x51')]);router[_0x32fe('0x31')](_0x32fe('0x29'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x52')]);router['post'](_0x32fe('0x2b'),auth[_0x32fe('0x6')](),controller['addSmsAccounts']);router[_0x32fe('0x31')](_0x32fe('0x53'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x54')]);router[_0x32fe('0x31')](_0x32fe('0x55'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x56')]);router[_0x32fe('0x31')](_0x32fe('0x30'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x57')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x32fe('0x58')]);router[_0x32fe('0x59')](_0x32fe('0x5a'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x5b')]);router[_0x32fe('0x5c')]('/:id/queues',auth['isAuthenticated'](),controller[_0x32fe('0x5d')]);router[_0x32fe('0x5c')](_0x32fe('0x23'),auth['isAuthenticated'](),controller[_0x32fe('0x5e')]);router[_0x32fe('0x5c')]('/:id',auth[_0x32fe('0x6')](),controller[_0x32fe('0x5f')]);router[_0x32fe('0x5c')](_0x32fe('0x60'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x61')]);router['delete'](_0x32fe('0x46'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x62')]);router[_0x32fe('0x5c')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x32fe('0x63')]);router[_0x32fe('0x5c')](_0x32fe('0x4a'),auth[_0x32fe('0x6')](),controller['removeSmsInteractions']);router[_0x32fe('0x5c')](_0x32fe('0x4c'),auth['isAuthenticated'](),controller[_0x32fe('0x64')]);router[_0x32fe('0x5c')](_0x32fe('0x4e'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x65')]);router['delete']('/:id/fax_accounts',auth[_0x32fe('0x6')](),controller[_0x32fe('0x66')]);router['delete'](_0x32fe('0x67'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x68')]);router[_0x32fe('0x5c')](_0x32fe('0x29'),auth[_0x32fe('0x6')](),controller['removeOpenchannelAccounts']);router[_0x32fe('0x5c')](_0x32fe('0x2b'),auth[_0x32fe('0x6')](),controller['removeSmsAccounts']);router[_0x32fe('0x5c')](_0x32fe('0x53'),auth[_0x32fe('0x6')](),controller[_0x32fe('0x69')]);router[_0x32fe('0x5c')]('/:id/whatsapp_accounts',auth[_0x32fe('0x6')](),controller[_0x32fe('0x6a')]);router[_0x32fe('0x5c')](_0x32fe('0x30'),auth[_0x32fe('0x6')](),controller['removeApiKey']);module[_0x32fe('0x6b')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 8cef199..8591585 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 _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(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'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 +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(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'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 6922b84..10efc38 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 _0xb168=['openTabs','true','chat','dataValues','fax','mail','whatsapp','all','show','params','model','differenceBy','keys','filters','intersection','fields','length','UserSetting','merge','options','sms','openchannel','body','describe','addContacts','ids','findById','securePassword','validatePasswordPattern','max','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)','SELECT','from','voicemail','mailbox','VoiceMail','fullname','permissions','101','102','104','105','106','107','108','109','100','114','115','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','create','userProfileId','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','newPassword','ValidationError','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','updatePasswordsHistory','channel','loginInPause','interface','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queues','spread','QueueId','Queue:save','VoiceQueue','voice','format','SIP/%s','voicePause','penalty','upsert','removeQueues','isArray','Queue:remove','addAvatar','userpic','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','getOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','findOne','order','sort','pick','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','limit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','UserVoiceQueueRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','mobile','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE','bulkCreate','MemberReport','pause','online','QueuePause','type','DEFAULT\x20PAUSE','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','unpause','getTeams','addTeams','Team','getAssociatedQueues','flattenDeep','addAgent','Voice','TeamVoicePrefix','UserVoicePrefix','getDataValue','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','removeAgent','VoicePrefixId','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','omit','user_has_chat_interactions:save','removeChatInteractions','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','$and','$or','$gte','$lt','$not','$between','$notBetween','$notIn','$like','$notLike','$notILike','$contains','$contained','$any','CmHopper','firstName','lastName','phone','Contact','dialActive','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','resolve','getUserSetting','getPresence','teams','queues','flatten','col','toString','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','busy','slice','charAt','select','field','ui.','InteractionId','user_has_','ui.UserId\x20=\x20?','util','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range','update','role','agent','emit','userNotification:recalc:','destroy','get','Users','user','Agents','Telephones','telephone','filter','map','value','includes','find','name','UserProfileResource','index','User','rawAttributes','fieldName','key','password','salt','where','query','includeAll','include','userSetting','attributes','push','findAll','rows'];(function(_0x3ca3b9,_0x4c9e8e){var _0x8a8fa4=function(_0x556f09){while(--_0x556f09){_0x3ca3b9['push'](_0x3ca3b9['shift']());}};_0x8a8fa4(++_0x4c9e8e);}(_0xb168,0x140));var _0x8b16=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xb168[_0x36ed3c];return _0x52a2e0;};'use strict';var moment=require('moment');var util=require(_0x8b16('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require('squel');var jayson=require('jayson/promise');var Redis=require(_0x8b16('0x1'));var authService=require(_0x8b16('0x2'));var qs=require(_0x8b16('0x3'));var logger=require(_0x8b16('0x4'))(_0x8b16('0x5'));var utils=require(_0x8b16('0x6'));var config=require(_0x8b16('0x7'));var licenseUtil=require(_0x8b16('0x8'));var APIBadRequestError=require(_0x8b16('0x9'))[_0x8b16('0xa')];var APINotFoundError=require('../../errors/api')[_0x8b16('0xb')];var APIHandleError=require(_0x8b16('0x9'))[_0x8b16('0xc')];var db=require(_0x8b16('0xd'))['db'];var socket=require(_0x8b16('0xe'))(new Redis(config[_0x8b16('0xf')]));require(_0x8b16('0x10'))[_0x8b16('0x11')](socket);config['redis']=_[_0x8b16('0x12')](config[_0x8b16('0xf')],{'host':_0x8b16('0x13'),'port':0x18eb});var amiClient=jayson[_0x8b16('0x14')][_0x8b16('0x15')]({'port':0x232a});var values;function respondWithRpcPromise(_0x270f6e,_0x35f6a4,_0x53191b,_0x3352c3){return new Promise(function(_0x17605c,_0x149426){var _0x1c6604=_0x3352c3||amiClient;return _0x1c6604[_0x8b16('0x16')](_0x270f6e,_0x53191b)[_0x8b16('0x17')](function(_0x1d8257){logger[_0x8b16('0x18')](_0x8b16('0x19'),_0x35f6a4,'request\x20sent');logger[_0x8b16('0x1a')](_0x8b16('0x1b'),_0x35f6a4,_0x8b16('0x1c'),JSON[_0x8b16('0x1d')](_0x1d8257));if(_0x1d8257['error']){if(_0x1d8257[_0x8b16('0x1e')][_0x8b16('0x1f')]===0x1f4){logger[_0x8b16('0x1e')](_0x8b16('0x19'),_0x35f6a4,_0x1d8257['error'][_0x8b16('0x20')]);return _0x149426(_0x1d8257[_0x8b16('0x1e')]['message']);}logger['error'](_0x8b16('0x19'),_0x35f6a4,_0x1d8257[_0x8b16('0x1e')][_0x8b16('0x20')]);return _0x17605c(_0x1d8257['error'][_0x8b16('0x20')]);}else{logger[_0x8b16('0x18')]('User,\x20%s,\x20%s',_0x35f6a4,_0x8b16('0x1c'));_0x17605c(_0x1d8257[_0x8b16('0x21')]['message']);}})[_0x8b16('0x22')](function(_0x4cf075){logger['error'](_0x8b16('0x19'),_0x35f6a4,_0x4cf075);_0x149426(_0x4cf075);});});}function respondWithStatusCode(_0x333296,_0x4f8e8b){_0x4f8e8b=_0x4f8e8b||0xcc;return function(_0x252b75){if(_0x252b75){return _0x333296[_0x8b16('0x23')](_0x4f8e8b);}return _0x333296[_0x8b16('0x24')](_0x4f8e8b)[_0x8b16('0x25')]();};}function respondWithResult(_0x2a23a1,_0x516d02){_0x516d02=_0x516d02||0xc8;return function(_0x41b70a){if(_0x41b70a){return _0x2a23a1['status'](_0x516d02)[_0x8b16('0x26')](_0x41b70a);}};}function respondWithFilteredResult(_0x598a9c,_0x5534bb){return function(_0x3c9c3b){if(_0x3c9c3b){var _0x253f3d=typeof _0x5534bb[_0x8b16('0x27')]===_0x8b16('0x28')&&typeof _0x5534bb['limit']===_0x8b16('0x28');var _0x20c856=_0x3c9c3b['count'];var _0x1ae417=_0x253f3d?0x0:_0x5534bb[_0x8b16('0x27')];var _0x3e4b74=_0x253f3d?_0x3c9c3b[_0x8b16('0x29')]:_0x5534bb[_0x8b16('0x27')]+_0x5534bb['limit'];var _0x39735f;if(_0x3e4b74>=_0x20c856){_0x3e4b74=_0x20c856;_0x39735f=0xc8;}else{_0x39735f=0xce;}_0x598a9c[_0x8b16('0x24')](_0x39735f);return _0x598a9c['set'](_0x8b16('0x2a'),_0x1ae417+'-'+_0x3e4b74+'/'+_0x20c856)['json'](_0x3c9c3b);}return null;};}function saveUpdates(_0x2ff96e){return function(_0x4f1409){if(_0x4f1409){return _0x4f1409[_0x8b16('0x2b')](_0x2ff96e)['then'](function(_0x143492){if(_0x143492[_0x8b16('0x2c')]===_0x8b16('0x2d')){socket[_0x8b16('0x2e')](_0x8b16('0x2f')+_0x143492['id'],_0x143492);}return _0x143492;});}return null;};}function removeEntity(_0x5cdbdf){return function(_0x28c6be){if(_0x28c6be){return _0x28c6be[_0x8b16('0x30')]()['then'](function(){var _0x330ce2=_0x28c6be[_0x8b16('0x31')]({'plain':!![]});if(_0x330ce2[_0x8b16('0x2c')]==='admin')return;var _0x2633d3=[{'name':_0x8b16('0x32'),'value':_0x8b16('0x33'),'ignore':!![]},{'name':_0x8b16('0x34'),'value':_0x8b16('0x2d'),'ignore':![]},{'name':_0x8b16('0x35'),'value':_0x8b16('0x36'),'ignore':![]}];var _0x40e1b4=_(_0x2633d3)[_0x8b16('0x37')]('ignore')[_0x8b16('0x38')](_0x8b16('0x39'))['value']();if(_[_0x8b16('0x3a')](_0x40e1b4,_0x330ce2['role'])){return;}var _0x2e7f5b=_[_0x8b16('0x3b')](_0x2633d3,[_0x8b16('0x39'),_0x330ce2[_0x8b16('0x2c')]])[_0x8b16('0x3c')];return db[_0x8b16('0x3d')][_0x8b16('0x30')]({'where':{'type':_0x2e7f5b,'resourceId':_0x330ce2['id']}})['then'](function(){return _0x28c6be;});})[_0x8b16('0x17')](function(){_0x5cdbdf[_0x8b16('0x24')](0xcc)[_0x8b16('0x25')]();});}};}function handleEntityNotFound(_0x37ee60){return function(_0x419d6d){if(!_0x419d6d){_0x37ee60['sendStatus'](0x194);}return _0x419d6d;};}function handleError(_0x2f13e6,_0x4dc588){_0x4dc588=_0x4dc588||0x1f4;return function(_0x42ff97){logger[_0x8b16('0x1e')](_0x42ff97['stack']);if(_0x42ff97['name']){delete _0x42ff97[_0x8b16('0x3c')];}_0x2f13e6[_0x8b16('0x24')](_0x4dc588)['send'](_0x42ff97);};}exports[_0x8b16('0x3e')]=function(_0x29bf91,_0x73755a){var _0x4d2449={},_0x3d68a0={'count':0x0,'rows':[]};var _0x4f400a=_(db[_0x8b16('0x3f')][_0x8b16('0x40')])[_0x8b16('0x38')](function(_0x256f8c){return{'name':_0x256f8c[_0x8b16('0x41')],'type':_0x256f8c['type'][_0x8b16('0x42')]};})[_0x8b16('0x37')](function(_0x9849a3){return!_[_0x8b16('0x3a')]([_0x8b16('0x43'),_0x8b16('0x44')],_0x9849a3[_0x8b16('0x3c')]);})[_0x8b16('0x39')]();_0x4d2449=qs['getOptions'](_0x4f400a,_0x29bf91);var _0x52e627={'where':_0x4d2449[_0x8b16('0x45')]};return db[_0x8b16('0x3f')][_0x8b16('0x29')](_0x52e627)[_0x8b16('0x17')](function(_0x2a987e){_0x3d68a0[_0x8b16('0x29')]=_0x2a987e;if(_0x29bf91[_0x8b16('0x46')][_0x8b16('0x47')]){_0x4d2449[_0x8b16('0x48')]=[{'all':!![]}];}if(_0x29bf91[_0x8b16('0x46')][_0x8b16('0x49')]==='true'){_0x4d2449[_0x8b16('0x48')]=[{'model':db['UserSetting'],'as':_0x8b16('0x49')}];}if(!_['includes'](_0x4d2449[_0x8b16('0x4a')],'id')){_0x4d2449[_0x8b16('0x4a')][_0x8b16('0x4b')]('id');}return db[_0x8b16('0x3f')][_0x8b16('0x4c')](_0x4d2449);})['then'](function(_0x19c18a){_0x3d68a0[_0x8b16('0x4d')]=_0x19c18a;if(_0x29bf91[_0x8b16('0x46')][_0x8b16('0x4e')]===_0x8b16('0x4f')){var _0x298b85=[];for(var _0x4d97aa=0x0;_0x4d97aa<_0x3d68a0['rows']['length'];_0x4d97aa++){_0x298b85[_0x8b16('0x4b')](get_open_tabs(_0x8b16('0x50'),_0x3d68a0[_0x8b16('0x4d')][_0x4d97aa][_0x8b16('0x51')]));_0x298b85[_0x8b16('0x4b')](get_open_tabs('sms',_0x3d68a0[_0x8b16('0x4d')][_0x4d97aa][_0x8b16('0x51')]));_0x298b85[_0x8b16('0x4b')](get_open_tabs(_0x8b16('0x52'),_0x3d68a0[_0x8b16('0x4d')][_0x4d97aa]['dataValues']));_0x298b85[_0x8b16('0x4b')](get_open_tabs(_0x8b16('0x53'),_0x3d68a0[_0x8b16('0x4d')][_0x4d97aa][_0x8b16('0x51')]));_0x298b85['push'](get_open_tabs('openchannel',_0x3d68a0['rows'][_0x4d97aa]['dataValues']));_0x298b85[_0x8b16('0x4b')](get_open_tabs(_0x8b16('0x54'),_0x3d68a0[_0x8b16('0x4d')][_0x4d97aa]['dataValues']));}return Promise[_0x8b16('0x55')](_0x298b85)[_0x8b16('0x17')](function(){return _0x3d68a0;});}else{return _0x3d68a0;}})['then'](respondWithFilteredResult(_0x73755a,_0x4d2449))[_0x8b16('0x22')](handleError(_0x73755a,null));};exports[_0x8b16('0x56')]=function(_0x3f267e,_0x35fb21){var _0x3bb7fd={'raw':![],'where':{'id':_0x3f267e[_0x8b16('0x57')]['id']}},_0x4df6fa={};_0x4df6fa[_0x8b16('0x58')]=_[_0x8b16('0x59')](_['keys'](db[_0x8b16('0x3f')][_0x8b16('0x40')]),[_0x8b16('0x43'),'salt']);_0x4df6fa['query']=_[_0x8b16('0x5a')](_0x3f267e[_0x8b16('0x46')]);_0x4df6fa[_0x8b16('0x5b')]=_['intersection'](_0x4df6fa[_0x8b16('0x58')],_0x4df6fa['query']);_0x3bb7fd[_0x8b16('0x4a')]=_[_0x8b16('0x5c')](_0x4df6fa['model'],qs[_0x8b16('0x5d')](_0x3f267e[_0x8b16('0x46')]['fields']));_0x3bb7fd[_0x8b16('0x4a')]=_0x3bb7fd[_0x8b16('0x4a')][_0x8b16('0x5e')]?_0x3bb7fd[_0x8b16('0x4a')]:_0x4df6fa[_0x8b16('0x58')];if(_0x3f267e[_0x8b16('0x46')][_0x8b16('0x47')]){_0x3bb7fd[_0x8b16('0x48')]=[{'all':!![]}];}if(_0x3f267e[_0x8b16('0x46')]['userSetting']===_0x8b16('0x4f')){_0x3bb7fd[_0x8b16('0x48')]=[{'model':db[_0x8b16('0x5f')],'as':_0x8b16('0x49')}];}_0x3bb7fd=_[_0x8b16('0x60')]({},_0x3bb7fd,_0x3f267e[_0x8b16('0x61')]);if(!_[_0x8b16('0x3a')](_0x3bb7fd[_0x8b16('0x4a')],'id')){_0x3bb7fd[_0x8b16('0x4a')][_0x8b16('0x4b')]('id');}return db[_0x8b16('0x3f')]['find'](_0x3bb7fd)[_0x8b16('0x17')](handleEntityNotFound(_0x35fb21,null))[_0x8b16('0x17')](function(_0x5d9bf2){var _0x39bf56=[];values=_0x5d9bf2;if(_0x3f267e[_0x8b16('0x46')][_0x8b16('0x4e')]==='true'){_0x39bf56[_0x8b16('0x4b')](get_open_tabs('chat',_0x5d9bf2[_0x8b16('0x51')]));_0x39bf56[_0x8b16('0x4b')](get_open_tabs(_0x8b16('0x62'),_0x5d9bf2[_0x8b16('0x51')]));_0x39bf56['push'](get_open_tabs(_0x8b16('0x63'),_0x5d9bf2['dataValues']));_0x39bf56[_0x8b16('0x4b')](get_open_tabs(_0x8b16('0x54'),_0x5d9bf2['dataValues']));_0x39bf56[_0x8b16('0x4b')](get_open_tabs(_0x8b16('0x52'),_0x5d9bf2['dataValues']));_0x39bf56['push'](get_open_tabs(_0x8b16('0x53'),_0x5d9bf2[_0x8b16('0x51')]));return Promise[_0x8b16('0x55')](_0x39bf56);}else{return values;}})['then'](function(){return values;})[_0x8b16('0x17')](respondWithResult(_0x35fb21,null))[_0x8b16('0x22')](handleError(_0x35fb21,null));};exports[_0x8b16('0x2b')]=function(_0x279d02,_0x41582d){if(_0x279d02['body']['id']){delete _0x279d02['body']['id'];}delete _0x279d02[_0x8b16('0x64')][_0x8b16('0x2c')];return db[_0x8b16('0x3f')][_0x8b16('0x3b')]({'where':{'id':_0x279d02[_0x8b16('0x57')]['id']}})[_0x8b16('0x17')](handleEntityNotFound(_0x41582d,null))['then'](saveUpdates(_0x279d02['body'],null))[_0x8b16('0x17')](respondWithResult(_0x41582d,null))['catch'](handleError(_0x41582d,null));};exports['describe']=function(_0x40506c,_0xc237d7){return db['User'][_0x8b16('0x65')]()['then'](respondWithResult(_0xc237d7,null))[_0x8b16('0x22')](handleError(_0xc237d7,null));};exports['addContacts']=function(_0x295b13,_0x383095){return db[_0x8b16('0x3f')][_0x8b16('0x3b')]({'where':{'id':_0x295b13[_0x8b16('0x57')]['id']}})[_0x8b16('0x17')](handleEntityNotFound(_0x383095,null))[_0x8b16('0x17')](function(_0x132264){if(_0x132264){return _0x132264[_0x8b16('0x66')](_0x295b13['body'][_0x8b16('0x67')],_['omit'](_0x295b13[_0x8b16('0x64')],[_0x8b16('0x67'),'id'])||{});}})[_0x8b16('0x17')](respondWithResult(_0x383095,null))[_0x8b16('0x22')](handleError(_0x383095,null));};function validateUser(_0x43d3df){return new Promise(function(_0x255ca7,_0x8bf4be){if(_0x43d3df['internal'])return _0x255ca7(_0x43d3df);return db['Setting'][_0x8b16('0x68')](0x1)[_0x8b16('0x17')](function(_0x15c270){if(_0x15c270[_0x8b16('0x69')])authService[_0x8b16('0x6a')](_0x43d3df['password']);db['User'][_0x8b16('0x6b')](_0x8b16('0x6c'))[_0x8b16('0x17')](function(_0x309d8a){if(_[_0x8b16('0x6d')](_0x309d8a)){_0x43d3df[_0x8b16('0x6c')]=_0x15c270[_0x8b16('0x6e')]||0x1;return;}if(_[_0x8b16('0x6d')](_0x15c270[_0x8b16('0x6e')])||_0x15c270[_0x8b16('0x6e')]===_0x309d8a){_0x43d3df[_0x8b16('0x6c')]=_0x309d8a+0x1;return;}if(_0x15c270[_0x8b16('0x6e')]>_0x309d8a){_0x43d3df[_0x8b16('0x6c')]=_0x15c270['min_internal'];return;}return db[_0x8b16('0x6f')][_0x8b16('0x46')](_0x8b16('0x70'),{'type':db[_0x8b16('0x6f')]['QueryTypes'][_0x8b16('0x71')]})[_0x8b16('0x17')](function(_0xc3a8e5){if(_0xc3a8e5&&_0xc3a8e5[_0x8b16('0x5e')]){for(var _0x1d80b7=0x0,_0x3f1821=_0xc3a8e5['length'];_0x1d80b7<_0x3f1821&&_[_0x8b16('0x6d')](_0x43d3df[_0x8b16('0x6c')]);_0x1d80b7++){if(_0x15c270[_0x8b16('0x6e')]<=_0xc3a8e5[_0x1d80b7][_0x8b16('0x72')]){_0x43d3df[_0x8b16('0x6c')]=_0xc3a8e5[_0x1d80b7]['from'];}else if(_0x15c270[_0x8b16('0x6e')]>_0xc3a8e5[_0x1d80b7][_0x8b16('0x72')]&&_0x15c270['min_internal']<=_0xc3a8e5[_0x1d80b7]['to']){_0x43d3df[_0x8b16('0x6c')]=_0x15c270[_0x8b16('0x6e')];}}}if(_[_0x8b16('0x6d')](_0x43d3df[_0x8b16('0x6c')])){_0x43d3df[_0x8b16('0x6c')]=_0x309d8a+0x1;}return _0x255ca7(_0x43d3df);});});})[_0x8b16('0x22')](function(_0x307422){_0x8bf4be(_0x307422);});});}function updateUser(_0x3e72cc){return new Promise(function(_0x34836f,_0x500298){try{if(_0x3e72cc[_0x8b16('0x73')]){_0x3e72cc[_0x8b16('0x74')]=_0x3e72cc[_0x8b16('0x6c')];_0x3e72cc[_0x8b16('0x75')]={'mailbox':_0x3e72cc[_0x8b16('0x6c')],'password':_0x3e72cc[_0x8b16('0x43')],'fullname':_0x3e72cc[_0x8b16('0x76')],'email':_0x3e72cc['email']};}if(_0x3e72cc[_0x8b16('0x2c')]===_0x8b16('0x2d')){if(!_0x3e72cc[_0x8b16('0x77')])_0x3e72cc[_0x8b16('0x77')]=[_0x8b16('0x78'),_0x8b16('0x79'),'103','113','110',_0x8b16('0x7a'),_0x8b16('0x7b'),_0x8b16('0x7c'),_0x8b16('0x7d'),_0x8b16('0x7e'),_0x8b16('0x7f'),_0x8b16('0x80'),'111',_0x8b16('0x81'),_0x8b16('0x82')];}_0x34836f(_0x3e72cc);}catch(_0x8aab13){_0x500298(_0x8aab13);}});}exports['create']=function(_0x58e48d,_0x27fc2c){if(_0x58e48d['user'][_0x8b16('0x2c')]==='agent')throw new Error(_0x8b16('0x83'));if(_0x58e48d['body'][_0x8b16('0x2c')]===_0x8b16('0x33')&&_0x58e48d['user'][_0x8b16('0x2c')]!==_0x8b16('0x84')){throw new Error(_0x8b16('0x85'));}if(_0x58e48d[_0x8b16('0x64')][_0x8b16('0x2c')]===_0x8b16('0x84')&&_0x58e48d['user']['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x8b16('0x86')]([_0x58e48d['body']])['then'](function(){return validateUser(_0x58e48d['body']);})['then'](function(_0x1c0701){return updateUser(_0x1c0701)[_0x8b16('0x17')](function(_0x36055f){if(_0x36055f['role']===_0x8b16('0x84')){_0x36055f[_0x8b16('0x87')]=_0x58e48d[_0x8b16('0x33')]['settingsEnabled'];delete _0x36055f['userProfileId'];}return _0x36055f;});})['then'](function(_0x42b90d){return db[_0x8b16('0x3f')][_0x8b16('0x88')](_0x42b90d,{'include':[{'model':db[_0x8b16('0x75')],'as':_0x8b16('0x75')}]});})[_0x8b16('0x17')](function(_0x524e2f){if(_0x58e48d[_0x8b16('0x64')][_0x8b16('0x2c')]===_0x8b16('0x33'))return _0x524e2f;if(_0x58e48d['user'][_0x8b16('0x2c')]!=='user')return _0x524e2f;return db['UserProfileSection'][_0x8b16('0x3b')]({'where':{'name':_0x524e2f[_0x8b16('0x2c')]===_0x8b16('0x2d')?_0x8b16('0x34'):_0x8b16('0x35'),'userProfileId':_0x58e48d['user'][_0x8b16('0x89')]},'raw':!![]})['then'](function(_0x38f76c){if(!_0x38f76c||_0x38f76c[_0x8b16('0x8a')]!=0x0)return _0x524e2f;return db[_0x8b16('0x3d')][_0x8b16('0x88')]({'name':_0x524e2f[_0x8b16('0x3c')],'resourceId':_0x524e2f['id'],'type':_0x38f76c[_0x8b16('0x3c')],'sectionId':_0x38f76c['id']},{})['then'](function(){return _0x524e2f;});})[_0x8b16('0x22')](function(_0x5da198){logger[_0x8b16('0x1e')](_0x8b16('0x8b'),_0x5da198);throw _0x5da198;});})[_0x8b16('0x17')](respondWithResult(_0x27fc2c,0xc9))[_0x8b16('0x22')](handleError(_0x27fc2c,null));};exports['bulkCreate']=function(_0x11a461,_0xe95e48){var _0x58f5a5=_0x11a461['body'];var _0x475685=[];if(_0x11a461['user'][_0x8b16('0x2c')]===_0x8b16('0x2d'))throw new Error(_0x8b16('0x83'));if(_['some'](_0x58f5a5,[_0x8b16('0x2c'),_0x8b16('0x33')])&&_0x11a461['user'][_0x8b16('0x2c')]!=='admin'){throw new Error(_0x8b16('0x85'));}if(_[_0x8b16('0x8c')](_0x58f5a5,[_0x8b16('0x2c'),'admin'])&&_0x11a461[_0x8b16('0x33')][_0x8b16('0x2c')]!==_0x8b16('0x84')){throw new Error(_0x8b16('0x8d'));}return licenseUtil[_0x8b16('0x86')](_0x58f5a5)[_0x8b16('0x17')](function(){return validateUser(_0x58f5a5[0x0]);})['then'](function(){for(var _0x366224=0x1;_0x366224<_0x58f5a5[_0x8b16('0x5e')];_0x366224++){var _0x3194c4=_0x58f5a5[_0x366224-0x1][_0x8b16('0x6c')];if(!_0x58f5a5[_0x366224][_0x8b16('0x6c')])_0x58f5a5[_0x366224][_0x8b16('0x6c')]=_0x3194c4+0x1;_0x475685[_0x8b16('0x4b')](validateUser(_0x58f5a5[_0x366224]));}return Promise[_0x8b16('0x55')](_0x475685);})['then'](function(){_0x475685=[];for(var _0x1c5b54=0x0;_0x1c5b54<_0x58f5a5[_0x8b16('0x5e')];_0x1c5b54++){_0x475685[_0x8b16('0x4b')](updateUser(_0x58f5a5[_0x1c5b54]));}return Promise[_0x8b16('0x55')](_0x475685);})[_0x8b16('0x17')](function(){_0x475685=_0x58f5a5[_0x8b16('0x38')](function(_0x19bf1b){return db[_0x8b16('0x3f')][_0x8b16('0x88')](_0x19bf1b,{'include':[{'model':db[_0x8b16('0x75')],'as':'VoiceMail'}]})[_0x8b16('0x17')](function(_0x2896d1){_0x19bf1b['id']=_0x2896d1['id'];return _0x19bf1b;});});return Promise[_0x8b16('0x55')](_0x475685);})[_0x8b16('0x17')](function(_0x59e4cd){if(_0x11a461[_0x8b16('0x64')][_0x8b16('0x2c')]==='user')return _0x59e4cd;if(_0x11a461[_0x8b16('0x33')]['role']!==_0x8b16('0x33'))return _0x59e4cd;var _0x518726=_['some'](_0x59e4cd,function(_0x439515){return _0x439515[_0x8b16('0x2c')]===_0x8b16('0x2d')||_0x439515[_0x8b16('0x2c')]===_0x8b16('0x36');});if(!_0x518726)return _0x59e4cd;return db['UserProfileSection'][_0x8b16('0x4c')]({'where':{'name':{'$or':['Agents',_0x8b16('0x35')]},'userProfileId':_0x11a461[_0x8b16('0x33')][_0x8b16('0x89')]},'raw':!![]})[_0x8b16('0x17')](function(_0x520368){if(_[_0x8b16('0x8e')](_0x520368)||!_['some'](_0x520368,[_0x8b16('0x8a'),0x0]))return _0x59e4cd;_0x475685=[];var _0x378e74=_(_0x520368)[_0x8b16('0x38')](function(_0x1c2caa){if(_0x1c2caa[_0x8b16('0x8a')]===0x1)return;return _0x1c2caa[_0x8b16('0x3c')]===_0x8b16('0x34')?_0x8b16('0x2d'):_0x8b16('0x36');})[_0x8b16('0x8f')]()[_0x8b16('0x39')]();for(var _0x32a96b=0x0;_0x32a96b<_0x59e4cd[_0x8b16('0x5e')];_0x32a96b++){if(!_[_0x8b16('0x3a')](_0x378e74,_0x59e4cd[_0x32a96b]['role']))return;var _0x512ab2=_0x59e4cd[_0x32a96b][_0x8b16('0x2c')]===_0x8b16('0x2d')?_0x8b16('0x34'):_0x8b16('0x35');_0x475685[_0x8b16('0x4b')](db[_0x8b16('0x3d')]['create']({'name':_0x59e4cd[_0x32a96b][_0x8b16('0x3c')],'resourceId':_0x59e4cd[_0x32a96b]['id'],'type':_0x512ab2,'sectionId':_[_0x8b16('0x3b')](_0x520368,[_0x8b16('0x3c'),_0x512ab2])['id']},{}));}return Promise[_0x8b16('0x55')](_0x475685);});})[_0x8b16('0x17')](respondWithResult(_0xe95e48,0xc9))[_0x8b16('0x22')](handleError(_0xe95e48,null));};exports[_0x8b16('0x90')]=function(_0x35e4b3,_0x47c52c){if(_0x35e4b3[_0x8b16('0x64')]['id']){delete _0x35e4b3['body']['id'];}return db['User'][_0x8b16('0x3b')]({'where':{'id':_0x35e4b3[_0x8b16('0x57')]['id']}})['then'](function(_0x55ac48){if(!_0x55ac48)return null;if(_0x55ac48['id']===_0x35e4b3[_0x8b16('0x33')]['id']){if(!_0x35e4b3[_0x8b16('0x64')][_0x8b16('0x91')]||!_0x35e4b3[_0x8b16('0x64')][_0x8b16('0x92')]){throw new db['Sequelize'][(_0x8b16('0x93'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x55ac48['authenticate'](_0x35e4b3[_0x8b16('0x64')][_0x8b16('0x91')])){throw new db[(_0x8b16('0x94'))][(_0x8b16('0x93'))](_0x8b16('0x95'));}if(_0x35e4b3[_0x8b16('0x64')][_0x8b16('0x91')]===_0x35e4b3[_0x8b16('0x64')][_0x8b16('0x92')]){throw new db[(_0x8b16('0x94'))][(_0x8b16('0x93'))](_0x8b16('0x96'));}}else if(_0x35e4b3[_0x8b16('0x33')][_0x8b16('0x2c')]==='admin'){if(!_0x35e4b3['body'][_0x8b16('0x92')]){throw new db[(_0x8b16('0x94'))][(_0x8b16('0x93'))](_0x8b16('0x97'));}}else if(_0x35e4b3['user']['role']==='user'){if(!_0x35e4b3[_0x8b16('0x64')][_0x8b16('0x92')]){throw new db['Sequelize'][(_0x8b16('0x93'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x55ac48[_0x8b16('0x2c')]!==_0x8b16('0x2d')){throw new db[(_0x8b16('0x94'))]['ValidationError'](_0x8b16('0x83'));}}else{throw new db[(_0x8b16('0x94'))][(_0x8b16('0x93'))](_0x8b16('0x83'));}return _0x55ac48;})[_0x8b16('0x17')](handleEntityNotFound(_0x47c52c,null))[_0x8b16('0x17')](function(_0x193d87){return db[_0x8b16('0x98')]['findOne']({'attributes':['id',_0x8b16('0x69'),_0x8b16('0x99'),'passwordHistoryLimit']})['then'](function(_0x282058){if(_0x282058[_0x8b16('0x69')])authService[_0x8b16('0x6a')](_0x35e4b3['body'][_0x8b16('0x92')]);if(!_0x282058[_0x8b16('0x99')]||!_0x193d87['previousPasswords'])return _0x193d87;authService[_0x8b16('0x9a')](_0x35e4b3['body'][_0x8b16('0x92')],_0x193d87[_0x8b16('0x9b')],_0x282058[_0x8b16('0x9c')]);return _0x193d87;})[_0x8b16('0x17')](saveUpdates({'password':_0x35e4b3[_0x8b16('0x64')][_0x8b16('0x92')],'passwordResetAt':_0x35e4b3[_0x8b16('0x33')]['id']==_0x35e4b3[_0x8b16('0x57')]['id']?moment():null,'previousPasswords':authService[_0x8b16('0x9d')](_0x35e4b3['body'][_0x8b16('0x92')],_0x193d87[_0x8b16('0x9b')])},null));})[_0x8b16('0x17')](respondWithResult(_0x47c52c,null))[_0x8b16('0x22')](handleError(_0x47c52c,null));};exports['addQueues']=function(_0xbab9c9,_0x430eed){var _0x2ae078=_0xbab9c9[_0x8b16('0x64')][_0x8b16('0x9e')];return db[_0x8b16('0x3f')][_0x8b16('0x3b')]({'where':{'id':_0xbab9c9[_0x8b16('0x57')]['id']},'attributes':['id',_0x8b16('0x3c'),_0x8b16('0x2c'),'online',_0x8b16('0x9f'),'voicePause',_0x8b16('0xa0')]})['then'](handleEntityNotFound(_0x430eed,null))[_0x8b16('0x17')](function(_0x224f6e){if(_0x224f6e){if(!utils[_0x8b16('0xa1')](_0x2ae078)){throw new db['Sequelize']['ValidationError'](_0x8b16('0xa2'));}return _0x224f6e['add'+_[_0x8b16('0xa3')](_0x2ae078[_0x8b16('0xa4')]())+_0x8b16('0xa5')](_0xbab9c9[_0x8b16('0x64')][_0x8b16('0x67')],{'penalty':_0xbab9c9['body']['penalty']||0x0})[_0x8b16('0xa6')](function(_0x371e7b){for(var _0x242f15=0x0;_0x242f15<_0xbab9c9[_0x8b16('0x64')][_0x8b16('0x67')][_0x8b16('0x5e')];_0x242f15+=0x1){var _0x4280a7={'UserId':Number(_0xbab9c9[_0x8b16('0x57')]['id'])};_0x4280a7[_[_0x8b16('0xa3')](_0x2ae078[_0x8b16('0xa4')]())+_0x8b16('0xa7')]=Number(_0xbab9c9[_0x8b16('0x64')][_0x8b16('0x67')][_0x242f15]);socket[_0x8b16('0x2e')](_0x8b16('0x33')+_['capitalize'](_0x2ae078['toLowerCase']())+_0x8b16('0xa8'),_0x4280a7);}return _0x371e7b;})['then'](function(){if(_0x2ae078==='voice'){return db[_0x8b16('0xa9')][_0x8b16('0x4c')]({'where':{'id':_0xbab9c9[_0x8b16('0x64')][_0x8b16('0x67')]||[]},'raw':!![],'attributes':['id',_0x8b16('0x3c')]});}})[_0x8b16('0x17')](function(_0x5a3a4c){var _0x2c70f3=_0x224f6e[_0x8b16('0x31')]({'plain':!![]});var _0x4edae9=[];if(_0x2ae078===_0x8b16('0xaa')&&_0x2c70f3['role']===_0x8b16('0x2d')&&_0x2c70f3['online']){for(let _0x1f55ce=0x0;_0x1f55ce<_0x5a3a4c[_0x8b16('0x5e')];_0x1f55ce+=0x1){_0x4edae9[_0x8b16('0x4b')]({'membername':_0x2c70f3[_0x8b16('0x3c')],'UserId':_0x2c70f3['id'],'queue_name':_0x5a3a4c[_0x1f55ce][_0x8b16('0x3c')],'VoiceQueueId':_0x5a3a4c[_0x1f55ce]['id'],'interface':_[_0x8b16('0x6d')](_0x2c70f3[_0x8b16('0xa0')])?util[_0x8b16('0xab')](_0x8b16('0xac'),_0x2c70f3['name']):_0x2c70f3[_0x8b16('0xa0')],'paused':_0x2c70f3[_0x8b16('0xad')]||![],'penalty':_0xbab9c9[_0x8b16('0x64')][_0x8b16('0xae')]||0x0});}return Promise['all'](_0x4edae9[_0x8b16('0x38')](function(_0x2d9d1c){return db['UserVoiceQueueRt'][_0x8b16('0xaf')](_0x2d9d1c);}));}return _0x224f6e;});}})[_0x8b16('0x17')](respondWithStatusCode(_0x430eed,null))[_0x8b16('0x22')](handleError(_0x430eed,null));};exports[_0x8b16('0xb0')]=function(_0x3efa2d,_0x19de4d){var _0x597abb,_0x20dbe0;return db[_0x8b16('0x3f')][_0x8b16('0x3b')]({'where':{'id':_0x3efa2d[_0x8b16('0x57')]['id']},'attributes':['id',_0x8b16('0x3c'),_0x8b16('0x2c')]})[_0x8b16('0x17')](handleEntityNotFound(_0x19de4d,null))[_0x8b16('0x17')](function(_0x28ad91){if(_0x28ad91){_0x597abb=_0x28ad91;if(!_0x3efa2d[_0x8b16('0x46')]['channel']||!utils['isValidChannel'](_0x3efa2d['query'][_0x8b16('0x9e')])){throw new db[(_0x8b16('0x94'))][(_0x8b16('0x93'))](_0x8b16('0xa2'));}return _0x28ad91['remove'+_['capitalize'](_0x3efa2d[_0x8b16('0x46')][_0x8b16('0x9e')][_0x8b16('0xa4')]())+'Queues'](_0x3efa2d[_0x8b16('0x46')]['ids']);}})['then'](function(_0x4912d4){if(_[_0x8b16('0xb1')](_0x3efa2d[_0x8b16('0x46')][_0x8b16('0x67')])){for(var _0x59f2aa=0x0;_0x59f2aa<_0x3efa2d[_0x8b16('0x46')][_0x8b16('0x67')][_0x8b16('0x5e')];_0x59f2aa+=0x1){_0x20dbe0={'UserId':Number(_0x3efa2d[_0x8b16('0x57')]['id'])};_0x20dbe0[_['capitalize'](_0x3efa2d[_0x8b16('0x46')]['channel']['toLowerCase']())+_0x8b16('0xa7')]=Number(_0x3efa2d[_0x8b16('0x46')]['ids'][_0x59f2aa]);socket['emit'](_0x8b16('0x33')+_[_0x8b16('0xa3')](_0x3efa2d['query'][_0x8b16('0x9e')][_0x8b16('0xa4')]())+_0x8b16('0xb2'),_0x20dbe0);}}else{_0x20dbe0={'UserId':Number(_0x3efa2d[_0x8b16('0x57')]['id'])};_0x20dbe0[_['capitalize'](_0x3efa2d[_0x8b16('0x46')][_0x8b16('0x9e')][_0x8b16('0xa4')]())+_0x8b16('0xa7')]=Number(_0x3efa2d[_0x8b16('0x46')]['ids']);socket[_0x8b16('0x2e')]('user'+_[_0x8b16('0xa3')](_0x3efa2d[_0x8b16('0x46')][_0x8b16('0x9e')][_0x8b16('0xa4')]())+_0x8b16('0xb2'),_0x20dbe0);}return _0x4912d4;})[_0x8b16('0x17')](function(){if(_0x3efa2d[_0x8b16('0x46')][_0x8b16('0x9e')]==='voice'){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x3efa2d[_0x8b16('0x57')]['id'],'VoiceQueueId':_0x3efa2d[_0x8b16('0x46')]['ids']},'individualHooks':!![]})['then'](function(){return _0x597abb;});}return _0x597abb;})[_0x8b16('0x17')](respondWithStatusCode(_0x19de4d,null))['catch'](handleError(_0x19de4d,null));};exports[_0x8b16('0xb3')]=function(_0x21c3c9,_0x42555d){_0x21c3c9[_0x8b16('0x64')][_0x8b16('0xb4')]=_0x21c3c9['file'][_0x8b16('0xb5')];return db[_0x8b16('0x3f')][_0x8b16('0x3b')]({'where':{'id':_0x21c3c9[_0x8b16('0x57')]['id']}})['then'](handleEntityNotFound(_0x42555d,null))['then'](saveUpdates(_0x21c3c9['body'],null))['then'](respondWithResult(_0x42555d,null))['catch'](handleError(_0x42555d,null));};exports[_0x8b16('0xb6')]=function(_0xfe3ff7,_0x453c6d){var _0x599e09=path[_0x8b16('0xb7')](config['root'],_0x8b16('0xb8'));return db[_0x8b16('0x3f')][_0x8b16('0x3b')]({'where':{'id':_0xfe3ff7[_0x8b16('0x57')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x8b16('0x17')](handleEntityNotFound(_0x453c6d,null))['then'](function(_0x547795){if(_0x547795){if(_[_0x8b16('0x6d')](_0x547795[_0x8b16('0xb4')])){return _0x453c6d[_0x8b16('0xb9')](_0x599e09);}else{if(!fs[_0x8b16('0xba')](path['join'](config[_0x8b16('0xbb')],_0x8b16('0xbc'),_0x547795[_0x8b16('0xb4')]))){return _0x453c6d['download'](_0x599e09);}return _0x453c6d['download'](path['join'](config['root'],_0x8b16('0xbc'),_0x547795[_0x8b16('0xb4')]));}}})[_0x8b16('0x22')](handleError(_0x453c6d,null));};exports[_0x8b16('0xbd')]=function(_0x261b06,_0x36f936){return db[_0x8b16('0x3f')][_0x8b16('0x3b')]({'where':{'id':_0x261b06[_0x8b16('0x57')]['id']},'attributes':['id']})[_0x8b16('0x17')](handleEntityNotFound(_0x36f936,null))[_0x8b16('0x17')](function(_0x55374b){var _0x50504b=[];values=_0x55374b['dataValues'];_0x50504b[_0x8b16('0x4b')](get_open_tabs('chat',_0x55374b[_0x8b16('0x51')]));_0x50504b[_0x8b16('0x4b')](get_open_tabs(_0x8b16('0x62'),_0x55374b[_0x8b16('0x51')]));_0x50504b[_0x8b16('0x4b')](get_open_tabs('openchannel',_0x55374b[_0x8b16('0x51')]));_0x50504b['push'](get_open_tabs(_0x8b16('0x54'),_0x55374b['dataValues']));_0x50504b[_0x8b16('0x4b')](get_open_tabs(_0x8b16('0x52'),_0x55374b[_0x8b16('0x51')]));_0x50504b[_0x8b16('0x4b')](get_open_tabs(_0x8b16('0x53'),_0x55374b['dataValues']));return Promise[_0x8b16('0x55')](_0x50504b);})[_0x8b16('0x17')](function(_0x5dc430){if(_0x5dc430){var _0x36a493=_[_0x8b16('0x38')](values['ChatOpenTabs'],function(_0x137854){return{'channel':_0x8b16('0xbe'),'id':_0x137854['id'],'createdAt':_0x137854[_0x8b16('0xbf')]};});var _0x2d5898=_[_0x8b16('0x38')](values['FaxOpenTabs'],function(_0x2fc7b1){return{'channel':_0x8b16('0xc0'),'id':_0x2fc7b1['id'],'createdAt':_0x2fc7b1['createdAt']};});var _0x2edebe=_[_0x8b16('0x38')](values[_0x8b16('0xc1')],function(_0x3d645d){return{'channel':'OPENCHANNEL','id':_0x3d645d['id'],'createdAt':_0x3d645d[_0x8b16('0xbf')]};});var _0x294bd9=_[_0x8b16('0x38')](values[_0x8b16('0xc2')],function(_0x53a785){return{'channel':_0x8b16('0xc3'),'id':_0x53a785['id'],'createdAt':_0x53a785[_0x8b16('0xbf')]};});var _0x2b9990=_[_0x8b16('0x38')](values['SmsOpenTabs'],function(_0x483678){return{'channel':_0x8b16('0xc4'),'id':_0x483678['id'],'createdAt':_0x483678['createdAt']};});var _0x36748a=_['map'](values[_0x8b16('0xc5')],function(_0x1076b1){return{'channel':_0x8b16('0xc6'),'id':_0x1076b1['id'],'createdAt':_0x1076b1[_0x8b16('0xbf')]};});var _0x5ba90b=_[_0x8b16('0xc7')](_0x36a493,_0x2d5898,_0x2edebe,_0x294bd9,_0x2b9990,_0x36748a);var _0x4cfbe5={'count':_0x5ba90b[_0x8b16('0x5e')],'rows':_0x5ba90b};return _0x4cfbe5;}else return null;})['then'](respondWithResult(_0x36f936,null))[_0x8b16('0x22')](handleError(_0x36f936,null));};exports[_0x8b16('0xc8')]=function(_0x52e57b,_0xcf41b1){var _0x365591={};var _0x5f0da6={};var _0x30cfe8;var _0x3715d9;return db[_0x8b16('0x3f')][_0x8b16('0xc9')]({'where':{'id':_0x52e57b[_0x8b16('0x57')]['id']}})[_0x8b16('0x17')](handleEntityNotFound(_0xcf41b1,null))[_0x8b16('0x17')](function(_0x584982){if(_0x584982){_0x30cfe8=_0x584982;_0x5f0da6[_0x8b16('0x58')]=_['keys'](db['CmContact'][_0x8b16('0x40')]);_0x5f0da6[_0x8b16('0x46')]=_['keys'](_0x52e57b[_0x8b16('0x46')]);_0x5f0da6[_0x8b16('0x5b')]=_[_0x8b16('0x5c')](_0x5f0da6[_0x8b16('0x58')],_0x5f0da6['query']);_0x365591[_0x8b16('0x4a')]=_['intersection'](_0x5f0da6[_0x8b16('0x58')],qs[_0x8b16('0x5d')](_0x52e57b[_0x8b16('0x46')][_0x8b16('0x5d')]));_0x365591[_0x8b16('0x4a')]=_0x365591['attributes']['length']?_0x365591['attributes']:_0x5f0da6['model'];_0x365591[_0x8b16('0xca')]=qs[_0x8b16('0xcb')](_0x52e57b[_0x8b16('0x46')][_0x8b16('0xcb')]);_0x365591['where']=qs[_0x8b16('0x5b')](_[_0x8b16('0xcc')](_0x52e57b[_0x8b16('0x46')],_0x5f0da6[_0x8b16('0x5b')]));if(_0x52e57b[_0x8b16('0x46')][_0x8b16('0x37')]){_0x365591[_0x8b16('0x45')]=_[_0x8b16('0x60')](_0x365591[_0x8b16('0x45')],{'$or':_['map'](_0x365591[_0x8b16('0x4a')],function(_0x263c71){var _0x59d186={};_0x59d186[_0x263c71]={'$like':'%'+_0x52e57b[_0x8b16('0x46')]['filter']+'%'};return _0x59d186;})});}_0x365591=_[_0x8b16('0x60')]({},_0x365591,_0x52e57b[_0x8b16('0x61')]);return _0x30cfe8[_0x8b16('0xc8')](_0x365591);}})[_0x8b16('0x17')](function(_0xe35a55){if(_0xe35a55){_0x3715d9=_0xe35a55[_0x8b16('0x5e')];if(_0x52e57b['query'][_0x8b16('0xcd')]('includeAll')){_0x365591[_0x8b16('0x48')]=[{'model':db[_0x8b16('0xce')],'as':_0x8b16('0xcf'),'required':![]},{'model':db[_0x8b16('0xd0')],'as':_0x8b16('0xd1'),'attributes':['id',_0x8b16('0x3c'),_0x8b16('0xd2')],'where':_0x52e57b[_0x8b16('0x46')]['tag']?{'id':_0x52e57b[_0x8b16('0x46')][_0x8b16('0xd3')]}:undefined,'required':_0x52e57b[_0x8b16('0x46')][_0x8b16('0xd3')]?!![]:![]}];}if(!_0x52e57b[_0x8b16('0x46')][_0x8b16('0xcd')](_0x8b16('0xd4'))){_0x365591[_0x8b16('0xd5')]=qs['limit'](_0x52e57b[_0x8b16('0x46')][_0x8b16('0xd5')]);_0x365591[_0x8b16('0x27')]=qs[_0x8b16('0x27')](_0x52e57b[_0x8b16('0x46')][_0x8b16('0x27')]);}return _0x30cfe8['getContacts'](_0x365591);}})[_0x8b16('0x17')](function(_0x561596){if(_0x561596){return _0x561596?{'count':_0x3715d9,'rows':_0x561596}:null;}})[_0x8b16('0x17')](respondWithResult(_0xcf41b1,null))['catch'](handleError(_0xcf41b1,null));};exports[_0x8b16('0xd6')]=function(_0x343e2d,_0x35a480){var _0xf8421a;var _0x34d7eb={};var _0x1f2198;return db[_0x8b16('0x3f')][_0x8b16('0xc9')]({'where':{'id':_0x343e2d[_0x8b16('0x57')]['id']},'attributes':['id',_0x8b16('0x3c'),'role']})[_0x8b16('0x17')](handleEntityNotFound(_0x35a480,null))[_0x8b16('0x17')](function(_0x175dce){if(!utils[_0x8b16('0xa1')](_0x343e2d[_0x8b16('0x46')]['channel'])){throw new db[(_0x8b16('0x94'))][(_0x8b16('0x93'))](_0x8b16('0xa2'));}_0xf8421a=_0x175dce;var _0x47e3b4={};_0x47e3b4[_0x8b16('0x58')]=_[_0x8b16('0x5a')](db[_['capitalize'](_0x343e2d['query']['channel'])+_0x8b16('0xd7')][_0x8b16('0x40')]);_0x47e3b4[_0x8b16('0x46')]=_[_0x8b16('0x5a')](_0x343e2d['query']);_0x47e3b4['filters']=_['intersection'](_0x47e3b4[_0x8b16('0x58')],_0x47e3b4['query']);_0x34d7eb[_0x8b16('0x4a')]=_[_0x8b16('0x5c')](_0x47e3b4[_0x8b16('0x58')],qs[_0x8b16('0x5d')](_0x343e2d[_0x8b16('0x46')][_0x8b16('0x5d')]));_0x34d7eb[_0x8b16('0x4a')]=_0x34d7eb[_0x8b16('0x4a')][_0x8b16('0x5e')]?_0x34d7eb[_0x8b16('0x4a')]:_0x47e3b4[_0x8b16('0x58')];_0x34d7eb['order']=qs[_0x8b16('0xcb')](_0x343e2d[_0x8b16('0x46')][_0x8b16('0xcb')]);_0x34d7eb[_0x8b16('0x45')]=qs[_0x8b16('0x5b')](_[_0x8b16('0xcc')](_0x343e2d[_0x8b16('0x46')],_0x47e3b4[_0x8b16('0x5b')]));if(_0x343e2d[_0x8b16('0x46')][_0x8b16('0x37')]){_0x34d7eb[_0x8b16('0x45')]=_['merge'](_0x34d7eb[_0x8b16('0x45')],{'$or':_[_0x8b16('0x38')](_0x34d7eb[_0x8b16('0x4a')],function(_0x2bc5a0){var _0x4dca1f={};_0x4dca1f[_0x2bc5a0]={'$like':'%'+_0x343e2d[_0x8b16('0x46')][_0x8b16('0x37')]+'%'};return _0x4dca1f;})});}_0x34d7eb=_['merge']({},_0x34d7eb,_0x343e2d[_0x8b16('0x61')]);switch(_0xf8421a[_0x8b16('0x2c')]){case _0x8b16('0x84'):return db[_[_0x8b16('0xa3')](_0x343e2d[_0x8b16('0x46')]['channel'])+_0x8b16('0xd7')][_0x8b16('0x4c')](_0x34d7eb);case _0x8b16('0x33'):case _0x8b16('0x2d'):return _0xf8421a[_0x8b16('0x31')+_[_0x8b16('0xa3')](_0x343e2d[_0x8b16('0x46')][_0x8b16('0x9e')])+'Queues'](_0x34d7eb);default:throw new db[(_0x8b16('0x94'))][(_0x8b16('0x93'))](_0x8b16('0xd8'));}})['then'](function(_0x3f01e8){_0x1f2198=_0x3f01e8[_0x8b16('0x5e')];if(!_0x343e2d[_0x8b16('0x46')][_0x8b16('0xcd')](_0x8b16('0xd4'))){_0x34d7eb[_0x8b16('0xd5')]=qs[_0x8b16('0xd5')](_0x343e2d['query']['limit']);_0x34d7eb[_0x8b16('0x27')]=qs['offset'](_0x343e2d['query']['offset']);}switch(_0xf8421a[_0x8b16('0x2c')]){case _0x8b16('0x84'):return db[_[_0x8b16('0xa3')](_0x343e2d[_0x8b16('0x46')][_0x8b16('0x9e')])+_0x8b16('0xd7')]['findAll'](_0x34d7eb);case _0x8b16('0x33'):case _0x8b16('0x2d'):return _0xf8421a['get'+_[_0x8b16('0xa3')](_0x343e2d['query'][_0x8b16('0x9e')])+_0x8b16('0xa5')](_0x34d7eb);}})[_0x8b16('0x17')](function(_0x545e06){return{'count':_0x1f2198,'rows':_0x545e06};})[_0x8b16('0x17')](respondWithResult(_0x35a480,null))[_0x8b16('0x22')](handleError(_0x35a480,null));};exports[_0x8b16('0xd9')]=function(_0x53bfe6,_0x2d6518){var _0x12c0bc={};var _0x4d2952={};var _0x1fb03b;var _0x5e6dda;return db['User'][_0x8b16('0xc9')]({'where':{'id':_0x53bfe6['params']['id']}})['then'](handleEntityNotFound(_0x2d6518,null))['then'](function(_0x371c1){if(_0x371c1){_0x1fb03b=_0x371c1;_0x4d2952[_0x8b16('0x58')]=_[_0x8b16('0x5a')](db[_0x8b16('0xda')]['rawAttributes']);_0x4d2952[_0x8b16('0x46')]=_[_0x8b16('0x5a')](_0x53bfe6[_0x8b16('0x46')]);_0x4d2952['filters']=_['intersection'](_0x4d2952[_0x8b16('0x58')],_0x4d2952[_0x8b16('0x46')]);_0x12c0bc[_0x8b16('0x4a')]=_[_0x8b16('0x5c')](_0x4d2952[_0x8b16('0x58')],qs['fields'](_0x53bfe6['query'][_0x8b16('0x5d')]));_0x12c0bc[_0x8b16('0x4a')]=_0x12c0bc['attributes']['length']?_0x12c0bc[_0x8b16('0x4a')]:_0x4d2952[_0x8b16('0x58')];_0x12c0bc[_0x8b16('0xca')]=qs[_0x8b16('0xcb')](_0x53bfe6['query']['sort']);_0x12c0bc[_0x8b16('0x45')]=qs[_0x8b16('0x5b')](_[_0x8b16('0xcc')](_0x53bfe6[_0x8b16('0x46')],_0x4d2952[_0x8b16('0x5b')]));if(_0x53bfe6[_0x8b16('0x46')]['filter']){_0x12c0bc[_0x8b16('0x45')]=_['merge'](_0x12c0bc[_0x8b16('0x45')],{'$or':_['map'](_0x12c0bc['attributes'],function(_0x540019){var _0x5955cc={};_0x5955cc[_0x540019]={'$like':'%'+_0x53bfe6['query'][_0x8b16('0x37')]+'%'};return _0x5955cc;})});}_0x12c0bc=_[_0x8b16('0x60')]({},_0x12c0bc,_0x53bfe6['options']);return _0x1fb03b[_0x8b16('0xd9')](_0x12c0bc);}})[_0x8b16('0x17')](function(_0xe8fb52){if(_0xe8fb52){_0x5e6dda=_0xe8fb52[_0x8b16('0x5e')];if(!_0x53bfe6[_0x8b16('0x46')][_0x8b16('0xcd')](_0x8b16('0xd4'))){_0x12c0bc['limit']=qs[_0x8b16('0xd5')](_0x53bfe6[_0x8b16('0x46')][_0x8b16('0xd5')]);_0x12c0bc['offset']=qs[_0x8b16('0x27')](_0x53bfe6[_0x8b16('0x46')][_0x8b16('0x27')]);}return _0x1fb03b['getVoiceQueuesRt'](_0x12c0bc);}})[_0x8b16('0x17')](function(_0x2f11cc){if(_0x2f11cc){return _0x2f11cc?{'count':_0x5e6dda,'rows':_0x2f11cc}:null;}})[_0x8b16('0x17')](respondWithResult(_0x2d6518,null))[_0x8b16('0x22')](handleError(_0x2d6518,null));};exports[_0x8b16('0xdb')]=function(_0x4817f4,_0x4c2158){var _0x609c6d={};var _0x9d3f7={};var _0xc31b18;var _0x58f757;return db[_0x8b16('0x3f')][_0x8b16('0xc9')]({'where':{'id':_0x4817f4['params']['id']}})['then'](handleEntityNotFound(_0x4c2158,null))['then'](function(_0x45adad){if(_0x45adad){_0xc31b18=_0x45adad;_0x9d3f7[_0x8b16('0x58')]=_['keys'](db[_0x8b16('0xdc')][_0x8b16('0x40')]);_0x9d3f7[_0x8b16('0x46')]=_[_0x8b16('0x5a')](_0x4817f4[_0x8b16('0x46')]);_0x9d3f7['filters']=_[_0x8b16('0x5c')](_0x9d3f7[_0x8b16('0x58')],_0x9d3f7['query']);_0x609c6d[_0x8b16('0x4a')]=_[_0x8b16('0x5c')](_0x9d3f7['model'],qs['fields'](_0x4817f4[_0x8b16('0x46')][_0x8b16('0x5d')]));_0x609c6d[_0x8b16('0x4a')]=_0x609c6d['attributes'][_0x8b16('0x5e')]?_0x609c6d[_0x8b16('0x4a')]:_0x9d3f7[_0x8b16('0x58')];_0x609c6d[_0x8b16('0xca')]=qs['sort'](_0x4817f4[_0x8b16('0x46')][_0x8b16('0xcb')]);_0x609c6d['where']=qs['filters'](_['pick'](_0x4817f4[_0x8b16('0x46')],_0x9d3f7[_0x8b16('0x5b')]));if(_0x4817f4[_0x8b16('0x46')]['filter']){_0x609c6d[_0x8b16('0x45')]=_[_0x8b16('0x60')](_0x609c6d[_0x8b16('0x45')],{'$or':_[_0x8b16('0x38')](_0x609c6d[_0x8b16('0x4a')],function(_0x53ed3b){var _0x2de183={};_0x2de183[_0x53ed3b]={'$like':'%'+_0x4817f4[_0x8b16('0x46')][_0x8b16('0x37')]+'%'};return _0x2de183;})});}_0x609c6d=_[_0x8b16('0x60')]({},_0x609c6d,_0x4817f4[_0x8b16('0x61')]);return _0xc31b18[_0x8b16('0xdb')](_0x609c6d);}})[_0x8b16('0x17')](function(_0x3cec25){if(_0x3cec25){_0x58f757=_0x3cec25[_0x8b16('0x5e')];if(!_0x4817f4[_0x8b16('0x46')]['hasOwnProperty'](_0x8b16('0xd4'))){_0x609c6d['limit']=qs[_0x8b16('0xd5')](_0x4817f4['query'][_0x8b16('0xd5')]);_0x609c6d[_0x8b16('0x27')]=qs[_0x8b16('0x27')](_0x4817f4[_0x8b16('0x46')][_0x8b16('0x27')]);}return _0xc31b18[_0x8b16('0xdb')](_0x609c6d);}})[_0x8b16('0x17')](function(_0x298cb9){if(_0x298cb9){return _0x298cb9?{'count':_0x58f757,'rows':_0x298cb9}:null;}})[_0x8b16('0x17')](respondWithResult(_0x4c2158,null))[_0x8b16('0x22')](handleError(_0x4c2158,null));};exports[_0x8b16('0xdd')]=function(_0x48b6cc,_0x5d1db3){var _0x7fcea7={'raw':!![],'where':{}};var _0x33a17c={};var _0x3fde78={'count':0x0,'rows':[]};return db[_0x8b16('0x3f')]['findOne']({'where':{'id':_0x48b6cc[_0x8b16('0x57')]['id']}})[_0x8b16('0x17')](handleEntityNotFound(_0x5d1db3,null))['then'](function(_0x1639c9){if(_0x1639c9){_0x33a17c[_0x8b16('0x58')]=_[_0x8b16('0x5a')](db[_0x8b16('0xde')]['rawAttributes']);_0x33a17c[_0x8b16('0x46')]=_[_0x8b16('0x5a')](_0x48b6cc[_0x8b16('0x46')]);_0x33a17c[_0x8b16('0x5b')]=_['intersection'](_0x33a17c[_0x8b16('0x58')],_0x33a17c[_0x8b16('0x46')]);_0x7fcea7[_0x8b16('0x4a')]=_['intersection'](_0x33a17c['model'],qs[_0x8b16('0x5d')](_0x48b6cc[_0x8b16('0x46')][_0x8b16('0x5d')]));_0x7fcea7['attributes']=_0x7fcea7[_0x8b16('0x4a')]['length']?_0x7fcea7[_0x8b16('0x4a')]:_0x33a17c[_0x8b16('0x58')];if(!_0x48b6cc[_0x8b16('0x46')]['hasOwnProperty'](_0x8b16('0xd4'))){_0x7fcea7[_0x8b16('0xd5')]=qs[_0x8b16('0xd5')](_0x48b6cc[_0x8b16('0x46')][_0x8b16('0xd5')]);_0x7fcea7[_0x8b16('0x27')]=qs[_0x8b16('0x27')](_0x48b6cc[_0x8b16('0x46')][_0x8b16('0x27')]);}_0x7fcea7[_0x8b16('0xca')]=qs[_0x8b16('0xcb')](_0x48b6cc[_0x8b16('0x46')][_0x8b16('0xcb')]);_0x7fcea7[_0x8b16('0x45')]=qs[_0x8b16('0x5b')](_[_0x8b16('0xcc')](_0x48b6cc['query'],_0x33a17c['filters']));_0x7fcea7[_0x8b16('0x45')][_0x8b16('0xdf')]=_0x1639c9['id'];if(_0x48b6cc[_0x8b16('0x46')][_0x8b16('0x37')]){_0x7fcea7[_0x8b16('0x45')]=_[_0x8b16('0x60')](_0x7fcea7['where'],{'$or':_[_0x8b16('0x38')](_0x7fcea7['attributes'],function(_0x26be96){var _0x50b044={};_0x50b044[_0x26be96]={'$like':'%'+_0x48b6cc[_0x8b16('0x46')]['filter']+'%'};return _0x50b044;})});}_0x7fcea7=_['merge']({},_0x7fcea7,_0x48b6cc['options']);return db[_0x8b16('0xde')][_0x8b16('0x29')]({'where':_0x7fcea7[_0x8b16('0x45')]})[_0x8b16('0x17')](function(_0x291c8a){_0x3fde78['count']=_0x291c8a;if(_0x48b6cc[_0x8b16('0x46')][_0x8b16('0x47')]){_0x7fcea7[_0x8b16('0x48')]=[{'all':!![]}];}return db['VoiceRecording'][_0x8b16('0x4c')](_0x7fcea7);})[_0x8b16('0x17')](function(_0x5a130a){_0x3fde78[_0x8b16('0x4d')]=_0x5a130a;return _0x3fde78;});}})[_0x8b16('0x17')](respondWithFilteredResult(_0x5d1db3,_0x7fcea7))[_0x8b16('0x22')](handleError(_0x5d1db3,null));};exports[_0x8b16('0xe0')]=function(_0xa508c4,_0x43e89a){var _0x562f44={'raw':!![],'where':{}};var _0x28d2e6={};var _0x80c3de={'count':0x0,'rows':[]};return db[_0x8b16('0x3f')][_0x8b16('0xc9')]({'where':{'id':_0xa508c4['params']['id']}})[_0x8b16('0x17')](handleEntityNotFound(_0x43e89a,null))['then'](function(_0x438e4f){if(_0x438e4f){_0x28d2e6['model']=_[_0x8b16('0x5a')](db[_0x8b16('0xe1')][_0x8b16('0x40')]);_0x28d2e6[_0x8b16('0x46')]=_[_0x8b16('0x5a')](_0xa508c4[_0x8b16('0x46')]);_0x28d2e6[_0x8b16('0x5b')]=_[_0x8b16('0x5c')](_0x28d2e6['model'],_0x28d2e6['query']);_0x562f44[_0x8b16('0x4a')]=_[_0x8b16('0x5c')](_0x28d2e6[_0x8b16('0x58')],qs['fields'](_0xa508c4[_0x8b16('0x46')][_0x8b16('0x5d')]));_0x562f44[_0x8b16('0x4a')]=_0x562f44[_0x8b16('0x4a')][_0x8b16('0x5e')]?_0x562f44[_0x8b16('0x4a')]:_0x28d2e6[_0x8b16('0x58')];if(!_0xa508c4[_0x8b16('0x46')][_0x8b16('0xcd')]('nolimit')){_0x562f44[_0x8b16('0xd5')]=qs[_0x8b16('0xd5')](_0xa508c4[_0x8b16('0x46')][_0x8b16('0xd5')]);_0x562f44[_0x8b16('0x27')]=qs[_0x8b16('0x27')](_0xa508c4[_0x8b16('0x46')][_0x8b16('0x27')]);}_0x562f44[_0x8b16('0xca')]=qs['sort'](_0xa508c4[_0x8b16('0x46')][_0x8b16('0xcb')]);_0x562f44['where']=qs['filters'](_[_0x8b16('0xcc')](_0xa508c4['query'],_0x28d2e6['filters']));_0x562f44[_0x8b16('0x45')]['UserId']=_0x438e4f['id'];if(_0xa508c4[_0x8b16('0x46')][_0x8b16('0x37')]){_0x562f44['where']=_[_0x8b16('0x60')](_0x562f44[_0x8b16('0x45')],{'$or':_[_0x8b16('0x38')](_0x562f44[_0x8b16('0x4a')],function(_0xb8e6c){var _0x86b17d={};_0x86b17d[_0xb8e6c]={'$like':'%'+_0xa508c4['query'][_0x8b16('0x37')]+'%'};return _0x86b17d;})});}_0x562f44=_[_0x8b16('0x60')]({},_0x562f44,_0xa508c4[_0x8b16('0x61')]);return db[_0x8b16('0xe1')][_0x8b16('0x29')]({'where':_0x562f44[_0x8b16('0x45')]})[_0x8b16('0x17')](function(_0x12d50b){_0x80c3de['count']=_0x12d50b;if(_0xa508c4[_0x8b16('0x46')][_0x8b16('0x47')]){_0x562f44['include']=[{'all':!![]}];}return db[_0x8b16('0xe1')][_0x8b16('0x4c')](_0x562f44);})[_0x8b16('0x17')](function(_0x341e1b){_0x80c3de[_0x8b16('0x4d')]=_0x341e1b;return _0x80c3de;});}})[_0x8b16('0x17')](respondWithFilteredResult(_0x43e89a,_0x562f44))['catch'](handleError(_0x43e89a,null));};exports['getChatInteractions']=function(_0x3fd72a,_0x4b0290){var _0x304dfe={};var _0x22a5ec={};var _0xe67e60;var _0x407526;return db[_0x8b16('0x3f')][_0x8b16('0xc9')]({'where':{'id':_0x3fd72a['params']['id']}})[_0x8b16('0x17')](handleEntityNotFound(_0x4b0290,null))[_0x8b16('0x17')](function(_0x3490e4){if(_0x3490e4){_0xe67e60=_0x3490e4;_0x22a5ec[_0x8b16('0x58')]=_['keys'](db[_0x8b16('0xe2')][_0x8b16('0x40')]);_0x22a5ec[_0x8b16('0x46')]=_[_0x8b16('0x5a')](_0x3fd72a['query']);_0x22a5ec[_0x8b16('0x5b')]=_[_0x8b16('0x5c')](_0x22a5ec['model'],_0x22a5ec[_0x8b16('0x46')]);_0x304dfe[_0x8b16('0x4a')]=_[_0x8b16('0x5c')](_0x22a5ec[_0x8b16('0x58')],qs[_0x8b16('0x5d')](_0x3fd72a['query'][_0x8b16('0x5d')]));_0x304dfe[_0x8b16('0x4a')]=_0x304dfe['attributes']['length']?_0x304dfe[_0x8b16('0x4a')]:_0x22a5ec['model'];_0x304dfe['order']=qs[_0x8b16('0xcb')](_0x3fd72a[_0x8b16('0x46')][_0x8b16('0xcb')]);_0x304dfe[_0x8b16('0x45')]=qs['filters'](_[_0x8b16('0xcc')](_0x3fd72a['query'],_0x22a5ec['filters']));if(_0x3fd72a[_0x8b16('0x46')][_0x8b16('0x37')]){_0x304dfe['where']=_[_0x8b16('0x60')](_0x304dfe[_0x8b16('0x45')],{'$or':_[_0x8b16('0x38')](_0x304dfe[_0x8b16('0x4a')],function(_0x20271f){var _0xb5a80e={};_0xb5a80e[_0x20271f]={'$like':'%'+_0x3fd72a['query']['filter']+'%'};return _0xb5a80e;})});}_0x304dfe=_[_0x8b16('0x60')]({},_0x304dfe,_0x3fd72a['options']);return _0xe67e60[_0x8b16('0xe3')](_0x304dfe);}})[_0x8b16('0x17')](function(_0x128c91){if(_0x128c91){_0x407526=_0x128c91[_0x8b16('0x5e')];if(!_0x3fd72a[_0x8b16('0x46')]['hasOwnProperty'](_0x8b16('0xd4'))){_0x304dfe[_0x8b16('0xd5')]=qs['limit'](_0x3fd72a['query'][_0x8b16('0xd5')]);_0x304dfe['offset']=qs[_0x8b16('0x27')](_0x3fd72a[_0x8b16('0x46')][_0x8b16('0x27')]);}return _0xe67e60[_0x8b16('0xe3')](_0x304dfe);}})[_0x8b16('0x17')](function(_0x20e952){if(_0x20e952){return _0x20e952?{'count':_0x407526,'rows':_0x20e952}:null;}})['then'](respondWithResult(_0x4b0290,null))[_0x8b16('0x22')](handleError(_0x4b0290,null));};exports[_0x8b16('0xe4')]=function(_0x53c9f6,_0x5d34a1){var _0x4c4263={};var _0x309527={};var _0x1df6ab;var _0x327f99;return db[_0x8b16('0x3f')][_0x8b16('0xc9')]({'where':{'id':_0x53c9f6[_0x8b16('0x57')]['id']}})[_0x8b16('0x17')](handleEntityNotFound(_0x5d34a1,null))[_0x8b16('0x17')](function(_0x562572){if(_0x562572){_0x1df6ab=_0x562572;_0x309527['model']=_['keys'](db[_0x8b16('0xe5')][_0x8b16('0x40')]);_0x309527['query']=_[_0x8b16('0x5a')](_0x53c9f6[_0x8b16('0x46')]);_0x309527['filters']=_[_0x8b16('0x5c')](_0x309527['model'],_0x309527['query']);_0x4c4263[_0x8b16('0x4a')]=_[_0x8b16('0x5c')](_0x309527[_0x8b16('0x58')],qs['fields'](_0x53c9f6[_0x8b16('0x46')][_0x8b16('0x5d')]));_0x4c4263[_0x8b16('0x4a')]=_0x4c4263[_0x8b16('0x4a')][_0x8b16('0x5e')]?_0x4c4263[_0x8b16('0x4a')]:_0x309527[_0x8b16('0x58')];_0x4c4263['order']=qs['sort'](_0x53c9f6[_0x8b16('0x46')]['sort']);_0x4c4263[_0x8b16('0x45')]=qs[_0x8b16('0x5b')](_[_0x8b16('0xcc')](_0x53c9f6['query'],_0x309527[_0x8b16('0x5b')]));if(_0x53c9f6[_0x8b16('0x46')]['filter']){_0x4c4263[_0x8b16('0x45')]=_[_0x8b16('0x60')](_0x4c4263[_0x8b16('0x45')],{'$or':_[_0x8b16('0x38')](_0x4c4263[_0x8b16('0x4a')],function(_0x3f26d0){var _0xf3b88c={};_0xf3b88c[_0x3f26d0]={'$like':'%'+_0x53c9f6[_0x8b16('0x46')][_0x8b16('0x37')]+'%'};return _0xf3b88c;})});}_0x4c4263=_[_0x8b16('0x60')]({},_0x4c4263,_0x53c9f6[_0x8b16('0x61')]);return _0x1df6ab['getOpenchannelInteractions'](_0x4c4263);}})[_0x8b16('0x17')](function(_0x581acf){if(_0x581acf){_0x327f99=_0x581acf[_0x8b16('0x5e')];if(!_0x53c9f6[_0x8b16('0x46')]['hasOwnProperty']('nolimit')){_0x4c4263[_0x8b16('0xd5')]=qs[_0x8b16('0xd5')](_0x53c9f6[_0x8b16('0x46')][_0x8b16('0xd5')]);_0x4c4263[_0x8b16('0x27')]=qs[_0x8b16('0x27')](_0x53c9f6['query'][_0x8b16('0x27')]);}return _0x1df6ab[_0x8b16('0xe4')](_0x4c4263);}})[_0x8b16('0x17')](function(_0x2cbc5a){if(_0x2cbc5a){return _0x2cbc5a?{'count':_0x327f99,'rows':_0x2cbc5a}:null;}})[_0x8b16('0x17')](respondWithResult(_0x5d34a1,null))[_0x8b16('0x22')](handleError(_0x5d34a1,null));};exports[_0x8b16('0xe6')]=function(_0xf22b95,_0x2027f0){var _0xaf6d6f={'raw':!![],'where':{}};var _0x5c3f69={};var _0x251043={'count':0x0,'rows':[]};return db[_0x8b16('0x3f')][_0x8b16('0xc9')]({'where':{'id':_0xf22b95[_0x8b16('0x57')]['id']}})[_0x8b16('0x17')](handleEntityNotFound(_0x2027f0,null))['then'](function(_0x505727){if(_0x505727){_0x5c3f69[_0x8b16('0x58')]=_[_0x8b16('0x5a')](db['MailInteraction'][_0x8b16('0x40')]);_0x5c3f69[_0x8b16('0x46')]=_[_0x8b16('0x5a')](_0xf22b95[_0x8b16('0x46')]);_0x5c3f69[_0x8b16('0x5b')]=_[_0x8b16('0x5c')](_0x5c3f69[_0x8b16('0x58')],_0x5c3f69[_0x8b16('0x46')]);_0xaf6d6f[_0x8b16('0x4a')]=_['intersection'](_0x5c3f69[_0x8b16('0x58')],qs['fields'](_0xf22b95[_0x8b16('0x46')][_0x8b16('0x5d')]));_0xaf6d6f['attributes']=_0xaf6d6f[_0x8b16('0x4a')][_0x8b16('0x5e')]?_0xaf6d6f[_0x8b16('0x4a')]:_0x5c3f69[_0x8b16('0x58')];if(!_0xf22b95['query'][_0x8b16('0xcd')](_0x8b16('0xd4'))){_0xaf6d6f[_0x8b16('0xd5')]=qs[_0x8b16('0xd5')](_0xf22b95[_0x8b16('0x46')][_0x8b16('0xd5')]);_0xaf6d6f['offset']=qs[_0x8b16('0x27')](_0xf22b95[_0x8b16('0x46')][_0x8b16('0x27')]);}_0xaf6d6f['order']=qs[_0x8b16('0xcb')](_0xf22b95[_0x8b16('0x46')][_0x8b16('0xcb')]);_0xaf6d6f[_0x8b16('0x45')]=qs['filters'](_['pick'](_0xf22b95['query'],_0x5c3f69[_0x8b16('0x5b')]));_0xaf6d6f[_0x8b16('0x45')][_0x8b16('0xdf')]=_0x505727['id'];if(_0xf22b95['query'][_0x8b16('0x37')]){_0xaf6d6f[_0x8b16('0x45')]=_[_0x8b16('0x60')](_0xaf6d6f[_0x8b16('0x45')],{'$or':_['map'](_0xaf6d6f['attributes'],function(_0x292291){var _0x1169b4={};_0x1169b4[_0x292291]={'$like':'%'+_0xf22b95['query'][_0x8b16('0x37')]+'%'};return _0x1169b4;})});}_0xaf6d6f=_['merge']({},_0xaf6d6f,_0xf22b95[_0x8b16('0x61')]);return db['MailInteraction'][_0x8b16('0x29')]({'where':_0xaf6d6f[_0x8b16('0x45')]})[_0x8b16('0x17')](function(_0x34c036){_0x251043[_0x8b16('0x29')]=_0x34c036;if(_0xf22b95[_0x8b16('0x46')][_0x8b16('0x47')]){_0xaf6d6f[_0x8b16('0x48')]=[{'all':!![]}];}return db[_0x8b16('0xe7')][_0x8b16('0x4c')](_0xaf6d6f);})[_0x8b16('0x17')](function(_0x3d6184){_0x251043['rows']=_0x3d6184;return _0x251043;});}})['then'](respondWithFilteredResult(_0x2027f0,_0xaf6d6f))[_0x8b16('0x22')](handleError(_0x2027f0,null));};exports[_0x8b16('0xe8')]=function(_0x3bbd48,_0x5caba3){var _0x3d4b63={};var _0x5acbbe={};var _0x3869de;var _0x1954ab;return db[_0x8b16('0x3f')][_0x8b16('0xc9')]({'where':{'id':_0x3bbd48[_0x8b16('0x57')]['id']}})['then'](handleEntityNotFound(_0x5caba3,null))[_0x8b16('0x17')](function(_0x21e39a){if(_0x21e39a){_0x3869de=_0x21e39a;_0x5acbbe[_0x8b16('0x58')]=_[_0x8b16('0x5a')](db[_0x8b16('0xe9')][_0x8b16('0x40')]);_0x5acbbe[_0x8b16('0x46')]=_[_0x8b16('0x5a')](_0x3bbd48[_0x8b16('0x46')]);_0x5acbbe['filters']=_[_0x8b16('0x5c')](_0x5acbbe[_0x8b16('0x58')],_0x5acbbe[_0x8b16('0x46')]);_0x3d4b63[_0x8b16('0x4a')]=_[_0x8b16('0x5c')](_0x5acbbe[_0x8b16('0x58')],qs['fields'](_0x3bbd48[_0x8b16('0x46')][_0x8b16('0x5d')]));_0x3d4b63[_0x8b16('0x4a')]=_0x3d4b63[_0x8b16('0x4a')][_0x8b16('0x5e')]?_0x3d4b63[_0x8b16('0x4a')]:_0x5acbbe[_0x8b16('0x58')];_0x3d4b63[_0x8b16('0xca')]=qs[_0x8b16('0xcb')](_0x3bbd48['query']['sort']);_0x3d4b63[_0x8b16('0x45')]=qs[_0x8b16('0x5b')](_['pick'](_0x3bbd48[_0x8b16('0x46')],_0x5acbbe['filters']));if(_0x3bbd48[_0x8b16('0x46')][_0x8b16('0x37')]){_0x3d4b63[_0x8b16('0x45')]=_[_0x8b16('0x60')](_0x3d4b63[_0x8b16('0x45')],{'$or':_['map'](_0x3d4b63[_0x8b16('0x4a')],function(_0x1bbb9b){var _0x1b218c={};_0x1b218c[_0x1bbb9b]={'$like':'%'+_0x3bbd48[_0x8b16('0x46')][_0x8b16('0x37')]+'%'};return _0x1b218c;})});}_0x3d4b63=_['merge']({},_0x3d4b63,_0x3bbd48[_0x8b16('0x61')]);return _0x3869de[_0x8b16('0xe8')](_0x3d4b63);}})[_0x8b16('0x17')](function(_0x1c31c6){if(_0x1c31c6){_0x1954ab=_0x1c31c6['length'];if(!_0x3bbd48['query'][_0x8b16('0xcd')](_0x8b16('0xd4'))){_0x3d4b63['limit']=qs[_0x8b16('0xd5')](_0x3bbd48['query'][_0x8b16('0xd5')]);_0x3d4b63[_0x8b16('0x27')]=qs[_0x8b16('0x27')](_0x3bbd48['query'][_0x8b16('0x27')]);}return _0x3869de['getSmsInteractions'](_0x3d4b63);}})[_0x8b16('0x17')](function(_0x2d97c9){if(_0x2d97c9){return _0x2d97c9?{'count':_0x1954ab,'rows':_0x2d97c9}:null;}})[_0x8b16('0x17')](respondWithResult(_0x5caba3,null))[_0x8b16('0x22')](handleError(_0x5caba3,null));};exports[_0x8b16('0xea')]=function(_0x3ea7f7,_0x18dadd){var _0xecc681={};var _0x5a38ba={};var _0x4bf012;var _0x800978;return db[_0x8b16('0x3f')][_0x8b16('0xc9')]({'where':{'id':_0x3ea7f7[_0x8b16('0x57')]['id']}})['then'](handleEntityNotFound(_0x18dadd,null))[_0x8b16('0x17')](function(_0x4d7a5b){if(_0x4d7a5b){_0x4bf012=_0x4d7a5b;_0x5a38ba['model']=_[_0x8b16('0x5a')](db[_0x8b16('0xeb')][_0x8b16('0x40')]);_0x5a38ba['query']=_[_0x8b16('0x5a')](_0x3ea7f7[_0x8b16('0x46')]);_0x5a38ba[_0x8b16('0x5b')]=_[_0x8b16('0x5c')](_0x5a38ba['model'],_0x5a38ba['query']);_0xecc681[_0x8b16('0x4a')]=_[_0x8b16('0x5c')](_0x5a38ba['model'],qs[_0x8b16('0x5d')](_0x3ea7f7['query'][_0x8b16('0x5d')]));_0xecc681[_0x8b16('0x4a')]=_0xecc681['attributes'][_0x8b16('0x5e')]?_0xecc681[_0x8b16('0x4a')]:_0x5a38ba[_0x8b16('0x58')];_0xecc681['order']=qs[_0x8b16('0xcb')](_0x3ea7f7['query']['sort']);_0xecc681['where']=qs[_0x8b16('0x5b')](_[_0x8b16('0xcc')](_0x3ea7f7['query'],_0x5a38ba[_0x8b16('0x5b')]));if(_0x3ea7f7['query']['filter']){_0xecc681['where']=_[_0x8b16('0x60')](_0xecc681['where'],{'$or':_['map'](_0xecc681[_0x8b16('0x4a')],function(_0x3fb039){var _0x467bb6={};_0x467bb6[_0x3fb039]={'$like':'%'+_0x3ea7f7[_0x8b16('0x46')][_0x8b16('0x37')]+'%'};return _0x467bb6;})});}_0xecc681=_[_0x8b16('0x60')]({},_0xecc681,_0x3ea7f7[_0x8b16('0x61')]);return _0x4bf012[_0x8b16('0xea')](_0xecc681);}})[_0x8b16('0x17')](function(_0x43e692){if(_0x43e692){_0x800978=_0x43e692['length'];if(!_0x3ea7f7[_0x8b16('0x46')][_0x8b16('0xcd')]('nolimit')){_0xecc681['limit']=qs[_0x8b16('0xd5')](_0x3ea7f7[_0x8b16('0x46')]['limit']);_0xecc681[_0x8b16('0x27')]=qs['offset'](_0x3ea7f7[_0x8b16('0x46')][_0x8b16('0x27')]);}return _0x4bf012['getFaxInteractions'](_0xecc681);}})[_0x8b16('0x17')](function(_0x3f4dd7){if(_0x3f4dd7){return _0x3f4dd7?{'count':_0x800978,'rows':_0x3f4dd7}:null;}})[_0x8b16('0x17')](respondWithResult(_0x18dadd,null))[_0x8b16('0x22')](handleError(_0x18dadd,null));};exports['getWhatsappInteractions']=function(_0x35889b,_0x32c200){var _0x12469e={};var _0x17c8f2={};var _0x30b08d;var _0x5c0d38;return db['User']['findOne']({'where':{'id':_0x35889b[_0x8b16('0x57')]['id']}})[_0x8b16('0x17')](handleEntityNotFound(_0x32c200,null))[_0x8b16('0x17')](function(_0x15f09b){if(_0x15f09b){_0x30b08d=_0x15f09b;_0x17c8f2['model']=_[_0x8b16('0x5a')](db['WhatsappInteraction'][_0x8b16('0x40')]);_0x17c8f2[_0x8b16('0x46')]=_[_0x8b16('0x5a')](_0x35889b[_0x8b16('0x46')]);_0x17c8f2[_0x8b16('0x5b')]=_[_0x8b16('0x5c')](_0x17c8f2[_0x8b16('0x58')],_0x17c8f2[_0x8b16('0x46')]);_0x12469e[_0x8b16('0x4a')]=_[_0x8b16('0x5c')](_0x17c8f2[_0x8b16('0x58')],qs[_0x8b16('0x5d')](_0x35889b[_0x8b16('0x46')]['fields']));_0x12469e['attributes']=_0x12469e[_0x8b16('0x4a')][_0x8b16('0x5e')]?_0x12469e[_0x8b16('0x4a')]:_0x17c8f2[_0x8b16('0x58')];_0x12469e[_0x8b16('0xca')]=qs['sort'](_0x35889b[_0x8b16('0x46')][_0x8b16('0xcb')]);_0x12469e[_0x8b16('0x45')]=qs['filters'](_['pick'](_0x35889b['query'],_0x17c8f2[_0x8b16('0x5b')]));if(_0x35889b['query']['filter']){_0x12469e['where']=_[_0x8b16('0x60')](_0x12469e[_0x8b16('0x45')],{'$or':_[_0x8b16('0x38')](_0x12469e[_0x8b16('0x4a')],function(_0x43cb06){var _0x163f7f={};_0x163f7f[_0x43cb06]={'$like':'%'+_0x35889b[_0x8b16('0x46')][_0x8b16('0x37')]+'%'};return _0x163f7f;})});}_0x12469e=_['merge']({},_0x12469e,_0x35889b[_0x8b16('0x61')]);return _0x30b08d[_0x8b16('0xec')](_0x12469e);}})['then'](function(_0x236109){if(_0x236109){_0x5c0d38=_0x236109['length'];if(!_0x35889b[_0x8b16('0x46')][_0x8b16('0xcd')]('nolimit')){_0x12469e[_0x8b16('0xd5')]=qs[_0x8b16('0xd5')](_0x35889b[_0x8b16('0x46')][_0x8b16('0xd5')]);_0x12469e[_0x8b16('0x27')]=qs[_0x8b16('0x27')](_0x35889b['query'][_0x8b16('0x27')]);}return _0x30b08d[_0x8b16('0xec')](_0x12469e);}})[_0x8b16('0x17')](function(_0xafc7a2){if(_0xafc7a2){return _0xafc7a2?{'count':_0x5c0d38,'rows':_0xafc7a2}:null;}})[_0x8b16('0x17')](respondWithResult(_0x32c200,null))[_0x8b16('0x22')](handleError(_0x32c200,null));};exports[_0x8b16('0xed')]=function(_0xfbcba1,_0x19cf3e,_0x1aaf73){var _0x27577d;var _0x128d75;var _0x5cc4bf;var _0x354fd0=!_[_0x8b16('0x6d')](_0xfbcba1[_0x8b16('0x57')]['id'])?_0xfbcba1[_0x8b16('0x57')]['id']:!_['isNil'](_0xfbcba1[_0x8b16('0x33')]['id'])?_0xfbcba1[_0x8b16('0x33')]['id']:null;return db[_0x8b16('0x3f')][_0x8b16('0x3b')]({'where':{'id':_0x354fd0,'role':{'$or':[_0x8b16('0x84'),_0x8b16('0x33'),_0x8b16('0x2d')]}},'attributes':['id',_0x8b16('0x3c'),'phone',_0x8b16('0xee'),'role','internal','loginInPause']})[_0x8b16('0x17')](function(_0x1d3f39){if(_0x1d3f39){if(_0x1d3f39[_0x8b16('0x2c')]==='agent'){_0x27577d=_0x1d3f39;if(_0xfbcba1[_0x8b16('0x64')]['interface']){_0x5cc4bf=util[_0x8b16('0xab')](_0x8b16('0xef'),_0x27577d[_0xfbcba1[_0x8b16('0x64')][_0x8b16('0xa0')]]);}else if(_0xfbcba1[_0x8b16('0x64')][_0x8b16('0xf0')]){_0x5cc4bf=util['format'](_0x8b16('0xac'),_0xfbcba1[_0x8b16('0x64')][_0x8b16('0xf0')]);}else{_0x5cc4bf=util['format']('SIP/%s',_0x27577d[_0x8b16('0x3c')]);}socket['to'](util[_0x8b16('0xab')]('user:%s',_0x27577d[_0x8b16('0x3c')]))[_0x8b16('0x2e')](_0x8b16('0xf1'),{'user':{'id':_0x27577d['id'],'name':_0x27577d[_0x8b16('0x3c')]},'ip':_0xfbcba1[_0x8b16('0xf2')][_0x8b16('0xf3')]||_0xfbcba1[_0x8b16('0xf4')][_0x8b16('0xf5')]||_0xfbcba1[_0x8b16('0xf6')][_0x8b16('0xf5')]||_0xfbcba1[_0x8b16('0xf4')][_0x8b16('0xf6')][_0x8b16('0xf5')]});return db[_0x8b16('0xda')][_0x8b16('0x30')]({'where':{'membername':_0x27577d['name']},'individualHooks':!![]});}}else{throw new db[(_0x8b16('0x94'))][(_0x8b16('0x93'))](_0x8b16('0xf7'));}})[_0x8b16('0x17')](function(){if(_0x27577d){return _0x27577d[_0x8b16('0xf8')]({'raw':!![]});}})[_0x8b16('0x17')](function(_0x585fcf){if(_0x27577d){if(_0x585fcf){_0x128d75=_0x585fcf;if(_0x128d75['length']){var _0x5835da=_0x128d75[_0x8b16('0x38')](function(_0x378711){var _0x145f37={'membername':_0x27577d[_0x8b16('0x3c')],'UserId':_0x27577d['id'],'queue_name':_0x378711[_0x8b16('0x3c')],'VoiceQueueId':_0x378711['id'],'interface':_0x5cc4bf,'paused':_0x27577d[_0x8b16('0x9f')]||![],'penalty':_0x378711[_0x8b16('0xf9')]||0x0};return db[_0x8b16('0xda')][_0x8b16('0xaf')](_0x145f37);});return Promise['all'](_0x5835da);}}}})['then'](function(){if(_0x27577d){return db['MemberReport'][_0x8b16('0x4c')]({'where':{'membername':_0x27577d[_0x8b16('0x3c')],'exitAt':null}});}})['then'](function(_0x2de2db){if(_0x27577d){var _0x16f87e=[];_0x2de2db['forEach'](function(_0x217a13){_0x16f87e[_0x8b16('0x4b')](_0x217a13[_0x8b16('0x2b')]({'exitAt':moment()[_0x8b16('0xab')](_0x8b16('0xfa'))}));});return Promise[_0x8b16('0x55')](_0x16f87e);}})[_0x8b16('0x17')](function(){if(_0x27577d){var _0x539722=[];var _0xccecb=[];var _0x5d4f83=utils[_0x8b16('0xfb')]();var _0x5cc5d6={'membername':_0x27577d[_0x8b16('0x3c')],'interface':_0x5cc4bf,'enterAt':moment()[_0x8b16('0xab')](_0x8b16('0xfa')),'role':_0x27577d[_0x8b16('0x2c')],'internal':_0x27577d[_0x8b16('0x6c')]};_0x5d4f83[_0x8b16('0xfc')](function(_0x2b11a8){_0x539722['push'](_[_0x8b16('0x60')]({'channel':_0x2b11a8,'type':_0x8b16('0xfd'),'data1':_0xfbcba1['body'][_0x8b16('0xfe')],'data2':_0x5cc4bf},_0x5cc5d6));if(_0x27577d[_0x8b16('0x9f')]){_0xccecb['push'](_[_0x8b16('0x60')]({'channel':_0x2b11a8,'type':_0x8b16('0xff'),'data1':_0x8b16('0x100')},_0x5cc5d6));}});return db['MemberReport'][_0x8b16('0x101')](_0x539722[_0x8b16('0xc7')](_0xccecb),{'individualHooks':!![]});}})[_0x8b16('0x17')](function(){if(_0x27577d){return _0x27577d[_0x8b16('0x2b')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x27577d['loginInPause']||![],'mailPause':_0x27577d[_0x8b16('0x9f')]||![],'chatPause':_0x27577d[_0x8b16('0x9f')]||![],'faxPause':_0x27577d[_0x8b16('0x9f')]||![],'smsPause':_0x27577d[_0x8b16('0x9f')]||![],'openchannelPause':_0x27577d[_0x8b16('0x9f')]||![],'whatsappPause':_0x27577d['loginInPause']||![],'pauseType':_0x27577d[_0x8b16('0x9f')]?_0x8b16('0x100'):null,'interface':_0x5cc4bf,'lastPauseAt':moment()[_0x8b16('0xab')](_0x8b16('0xfa'))});}})[_0x8b16('0x17')](function(_0x212f33){if(_0xfbcba1['isMiddleware']){return _0x1aaf73();}else{return Promise['resolve'](_0x212f33)[_0x8b16('0x17')](respondWithResult(_0x19cf3e,null));}})[_0x8b16('0x22')](handleError(_0x19cf3e,null));};exports['logout']=function(_0x594875,_0x190a8b){var _0x290560;return db[_0x8b16('0x3f')][_0x8b16('0x3b')]({'where':{'id':_0x594875['params']['id'],'role':_0x8b16('0x2d')},'attributes':['id','name',_0x8b16('0x2c')]})[_0x8b16('0x17')](handleEntityNotFound(_0x190a8b,null))[_0x8b16('0x17')](function(_0x1c415c){if(_0x1c415c){_0x290560=_0x1c415c;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x290560[_0x8b16('0x3c')]},'individualHooks':!![]});}})['then'](function(){return db[_0x8b16('0x102')][_0x8b16('0x4c')]({'where':{'membername':_0x290560[_0x8b16('0x3c')],'exitAt':null}});})[_0x8b16('0x17')](function(_0x351d07){var _0x31463a=[];_0x351d07[_0x8b16('0xfc')](function(_0x2f8765){_0x31463a[_0x8b16('0x4b')](_0x2f8765[_0x8b16('0x2b')]({'exitAt':moment()[_0x8b16('0xab')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x31463a);})[_0x8b16('0x17')](function(){return _0x290560[_0x8b16('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x8b16('0x17')](respondWithResult(_0x190a8b,null))[_0x8b16('0x22')](handleError(_0x190a8b,null));};exports[_0x8b16('0x103')]=function(_0x289bb3,_0x5e1083){var _0x4013c2;return db[_0x8b16('0xda')][_0x8b16('0x2b')]({'paused':0x1},{'where':{'UserId':_0x289bb3[_0x8b16('0x57')]['id']},'individualHooks':!![]})[_0x8b16('0x17')](function(){return db[_0x8b16('0x3f')][_0x8b16('0x3b')]({'where':{'id':_0x289bb3[_0x8b16('0x57')]['id'],'role':_0x8b16('0x2d')},'attributes':['id',_0x8b16('0x3c'),'role',_0x8b16('0x6c'),'interface',_0x8b16('0x104')]});})[_0x8b16('0x17')](handleEntityNotFound(_0x5e1083,null))[_0x8b16('0x17')](function(_0x2f6fd1){if(_0x2f6fd1){_0x4013c2=_0x2f6fd1;return respondWithRpcPromise(_0x8b16('0x105'),_0x8b16('0x103'),{'id':_0x4013c2['id'],'name':_0x4013c2['name'],'pause':!![]});}})[_0x8b16('0x17')](function(){if(_0x4013c2){return db[_0x8b16('0x102')]['findAll']({'where':{'membername':_0x4013c2[_0x8b16('0x3c')],'type':_0x8b16('0xff'),'exitAt':null}});}})[_0x8b16('0x17')](function(_0xe905a8){if(_0xe905a8[_0x8b16('0x5e')]){var _0x42bb0c=moment()[_0x8b16('0xab')](_0x8b16('0xfa'));for(var _0x58892f=0x0,_0x210106=_0xe905a8[_0x8b16('0x5e')];_0x58892f<_0x210106;_0x58892f++){_0xe905a8[_0x58892f]['updateAttributes']({'exitAt':_0x42bb0c});}}})[_0x8b16('0x17')](function(){var _0x12826d=[];var _0x18171a=utils[_0x8b16('0xfb')]();_0x18171a['forEach'](function(_0xc8a33e){_0x12826d[_0x8b16('0x4b')]({'channel':_0xc8a33e,'membername':_0x4013c2['name'],'interface':_[_0x8b16('0x6d')](_0x4013c2[_0x8b16('0xa0')])?util[_0x8b16('0xab')]('SIP/%s',_0x4013c2[_0x8b16('0x3c')]):_0x4013c2[_0x8b16('0xa0')],'type':_0x8b16('0xff'),'enterAt':moment()[_0x8b16('0xab')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x289bb3[_0x8b16('0x64')][_0x8b16('0x106')]||'DEFAULT\x20PAUSE','role':_0x4013c2[_0x8b16('0x2c')],'internal':_0x4013c2[_0x8b16('0x6c')]});});return db[_0x8b16('0x102')][_0x8b16('0x101')](_0x12826d,{'individualHooks':!![]});})[_0x8b16('0x17')](function(){return _0x4013c2[_0x8b16('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x289bb3[_0x8b16('0x64')][_0x8b16('0x106')]||_0x8b16('0x107'),'lastPauseAt':moment()[_0x8b16('0xab')](_0x8b16('0xfa'))});})['then'](respondWithResult(_0x5e1083,null))[_0x8b16('0x22')](handleError(_0x5e1083,null));};exports['unpause']=function(_0x1f0877,_0x5153b6){if(_0x1f0877['body']['channel']&&!utils['isValidChannel'](_0x1f0877['body'][_0x8b16('0x9e')])){throw new APIBadRequestError(util[_0x8b16('0xab')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x1f0877['body'][_0x8b16('0x9e')]));}return db[_0x8b16('0x3f')][_0x8b16('0x3b')]({'where':{'id':_0x1f0877[_0x8b16('0x57')]['id']},'attributes':['id',_0x8b16('0x3c'),_0x8b16('0x2c'),_0x8b16('0x6c'),_0x8b16('0xa0'),'online','voicePause',_0x8b16('0x108'),_0x8b16('0x109'),_0x8b16('0x10a'),_0x8b16('0x10b'),_0x8b16('0x10c'),_0x8b16('0x10d'),_0x8b16('0x10e'),_0x8b16('0x10f')]})['then'](function(_0x183e50){if(!_0x183e50){throw new APINotFoundError(util['format'](_0x8b16('0x110'),_0x1f0877[_0x8b16('0x57')]['id']));}return _0x183e50[_0x8b16('0x111')](_0x1f0877[_0x8b16('0x64')][_0x8b16('0x9e')]);})[_0x8b16('0x17')](respondWithResult(_0x5153b6,null))[_0x8b16('0x22')](APIHandleError(_0x5153b6));};exports['getTeams']=function(_0x36878f,_0x5840ec){var _0x295310={};var _0x3ba3ce={};var _0x3f40a3;var _0x372b;return db[_0x8b16('0x3f')][_0x8b16('0xc9')]({'where':{'id':_0x36878f[_0x8b16('0x57')]['id']}})['then'](handleEntityNotFound(_0x5840ec,null))['then'](function(_0x1afc3b){if(_0x1afc3b){_0x3f40a3=_0x1afc3b;_0x3ba3ce[_0x8b16('0x58')]=_['keys'](db['Team'][_0x8b16('0x40')]);_0x3ba3ce[_0x8b16('0x46')]=_[_0x8b16('0x5a')](_0x36878f[_0x8b16('0x46')]);_0x3ba3ce[_0x8b16('0x5b')]=_['intersection'](_0x3ba3ce[_0x8b16('0x58')],_0x3ba3ce[_0x8b16('0x46')]);_0x295310[_0x8b16('0x4a')]=_['intersection'](_0x3ba3ce[_0x8b16('0x58')],qs[_0x8b16('0x5d')](_0x36878f['query'][_0x8b16('0x5d')]));_0x295310[_0x8b16('0x4a')]=_0x295310[_0x8b16('0x4a')][_0x8b16('0x5e')]?_0x295310[_0x8b16('0x4a')]:_0x3ba3ce[_0x8b16('0x58')];_0x295310[_0x8b16('0xca')]=qs[_0x8b16('0xcb')](_0x36878f[_0x8b16('0x46')]['sort']);_0x295310[_0x8b16('0x45')]=qs[_0x8b16('0x5b')](_['pick'](_0x36878f[_0x8b16('0x46')],_0x3ba3ce['filters']));if(_0x36878f[_0x8b16('0x46')]['filter']){_0x295310[_0x8b16('0x45')]=_[_0x8b16('0x60')](_0x295310[_0x8b16('0x45')],{'$or':_[_0x8b16('0x38')](_0x295310['attributes'],function(_0x2dd3ca){var _0xa1204c={};_0xa1204c[_0x2dd3ca]={'$like':'%'+_0x36878f[_0x8b16('0x46')][_0x8b16('0x37')]+'%'};return _0xa1204c;})});}_0x295310=_[_0x8b16('0x60')]({},_0x295310,_0x36878f[_0x8b16('0x61')]);return _0x3f40a3[_0x8b16('0x112')](_0x295310);}})['then'](function(_0x11e81b){if(_0x11e81b){_0x372b=_0x11e81b[_0x8b16('0x5e')];if(!_0x36878f['query']['hasOwnProperty'](_0x8b16('0xd4'))){_0x295310[_0x8b16('0xd5')]=qs[_0x8b16('0xd5')](_0x36878f[_0x8b16('0x46')][_0x8b16('0xd5')]);_0x295310[_0x8b16('0x27')]=qs[_0x8b16('0x27')](_0x36878f['query']['offset']);}return _0x3f40a3[_0x8b16('0x112')](_0x295310);}})[_0x8b16('0x17')](function(_0xca4df9){if(_0xca4df9){return _0xca4df9?{'count':_0x372b,'rows':_0xca4df9}:null;}})[_0x8b16('0x17')](respondWithResult(_0x5840ec,null))[_0x8b16('0x22')](handleError(_0x5840ec,null));};exports[_0x8b16('0x113')]=function(_0x681dd9,_0x3254d3){var _0x3451e1=_0x681dd9[_0x8b16('0x57')]['id'];var _0x1acba2=_0x681dd9['body']?_0x681dd9[_0x8b16('0x64')]['ids']:null;var _0x43b544=[];return Promise['resolve']()[_0x8b16('0x17')](function(){if(!_0x1acba2)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x8b16('0x17')](function(){return db[_0x8b16('0x3f')][_0x8b16('0xc9')]({'where':{'id':_0x3451e1}});})[_0x8b16('0x17')](function(_0x473113){if(!_0x473113)throw new APINotFoundError(util[_0x8b16('0xab')]('User\x20with\x20id\x20%s\x20not\x20found',_0x681dd9[_0x8b16('0x57')]['id']));return db[_0x8b16('0x6f')]['transaction'](function(_0x357c7e){return _0x473113['addTeams'](_0x1acba2,{'transaction':_0x357c7e})[_0x8b16('0x17')](function(){return db[_0x8b16('0x114')][_0x8b16('0x4c')]({'where':{'id':{'$in':_0x1acba2}}});})[_0x8b16('0x17')](function(_0x185598){var _0x270729=_[_0x8b16('0x38')](_0x185598,function(_0x315709){return _0x315709[_0x8b16('0x115')]();});return Promise[_0x8b16('0x55')](_0x270729);})[_0x8b16('0x17')](function(_0x15162f){_0x43b544=_[_0x8b16('0x116')](_0x15162f);var _0x3458b0=_['map'](_0x43b544,function(_0x4dc1a9){return _0x4dc1a9[_0x8b16('0x117')](_0x473113['id'],{'transaction':_0x357c7e});});return Promise[_0x8b16('0x55')](_0x3458b0);})[_0x8b16('0x17')](function(){if(!_0x473113['online'])return;var _0x414e50=_[_0x8b16('0x37')](_0x43b544,function(_0xecfd9d){return _0xecfd9d['getDataValue'](_0x8b16('0x9e'))===_0x8b16('0x118');});var _0x51c44e=_['map'](_0x414e50,function(_0x42e804){return db[_0x8b16('0xda')]['upsert']({'membername':_0x473113['name'],'UserId':_0x473113['id'],'queue_name':_0x42e804[_0x8b16('0x3c')],'VoiceQueueId':_0x42e804['id'],'interface':_['isNil'](_0x473113['interface'])?util['format'](_0x8b16('0xac'),_0x473113['name']):_0x473113[_0x8b16('0xa0')],'paused':_0x473113['voicePause']||![],'penalty':_0x473113[_0x8b16('0xae')]},{'transaction':_0x357c7e});});return Promise[_0x8b16('0x55')](_0x51c44e);})['then'](function(){return db[_0x8b16('0x119')][_0x8b16('0x4c')]({'where':{'teamId':{'$in':_0x1acba2}}});})['then'](function(_0x4b99fc){var _0x3da7f7=_[_0x8b16('0x38')](_0x4b99fc,function(_0x2dec06){return db[_0x8b16('0x11a')]['create']({'UserId':_0x473113['id'],'VoicePrefixId':_0x2dec06['VoicePrefixId']},{'transaction':_0x357c7e});});return Promise[_0x8b16('0x55')](_0x3da7f7);});});})[_0x8b16('0x17')](function(){for(var _0x25181a=0x0;_0x25181a<_0x43b544[_0x8b16('0x5e')];_0x25181a++){var _0x1fbbb7=_0x43b544[_0x25181a][_0x8b16('0x11b')](_0x8b16('0x9e'));var _0x3a7fd7=_0x1fbbb7+'QueueId';socket[_0x8b16('0x2e')](_0x8b16('0x33')+_0x1fbbb7+_0x8b16('0xa8'),{'UserId':_0x3451e1,['queueField']:_0x43b544[_0x25181a]['id']});}})[_0x8b16('0x17')](respondWithStatusCode(_0x3254d3,null))[_0x8b16('0x22')](APIHandleError(_0x3254d3));};exports['removeTeams']=function(_0x2c2b79,_0x459289){var _0x3a8f30=_0x2c2b79[_0x8b16('0x57')]['id'];var _0x25f719=null;if(_0x2c2b79[_0x8b16('0x46')][_0x8b16('0x67')]){_0x25f719=_['isArray'](_0x2c2b79[_0x8b16('0x46')][_0x8b16('0x67')])?_0x2c2b79[_0x8b16('0x46')][_0x8b16('0x67')]:[_0x2c2b79[_0x8b16('0x46')][_0x8b16('0x67')]];}var _0x5090ee=[];return Promise['resolve']()[_0x8b16('0x17')](function(){if(!_0x25f719)throw new APIBadRequestError(_0x8b16('0x11c'));})['then'](function(){return db[_0x8b16('0x3f')][_0x8b16('0xc9')]({'where':{'id':_0x3a8f30}});})[_0x8b16('0x17')](function(_0x37e6c2){if(!_0x37e6c2)throw new APINotFoundError(util[_0x8b16('0xab')](_0x8b16('0x110'),_0x2c2b79[_0x8b16('0x57')]['id']));return db['sequelize'][_0x8b16('0x11d')](function(_0x214972){return _0x37e6c2['removeTeams'](_0x25f719,{'transaction':_0x214972})[_0x8b16('0x17')](function(){return db[_0x8b16('0x114')]['findAll']({'where':{'id':{'$in':_0x25f719}}});})[_0x8b16('0x17')](function(_0x485cca){var _0x4861af=_['map'](_0x485cca,function(_0x15a67c){return _0x15a67c[_0x8b16('0x115')]();});return Promise[_0x8b16('0x55')](_0x4861af);})[_0x8b16('0x17')](function(_0x4428a8){_0x5090ee=_[_0x8b16('0x116')](_0x4428a8);var _0x459e03=_[_0x8b16('0x38')](_0x5090ee,function(_0x5eae64){return _0x5eae64[_0x8b16('0x11e')](_0x37e6c2['id'],{'transaction':_0x214972});});return Promise['all'](_0x459e03);})[_0x8b16('0x17')](function(){if(!_0x37e6c2['online'])return;var _0x557fd2=_[_0x8b16('0x37')](_0x5090ee,function(_0x3d16c8){return _0x3d16c8[_0x8b16('0x11b')](_0x8b16('0x9e'))===_0x8b16('0x118');});var _0xba8783=_[_0x8b16('0x38')](_0x557fd2,function(_0x1e1b58){return db[_0x8b16('0xda')][_0x8b16('0x30')]({'where':{'VoiceQueueId':_0x1e1b58['id'],'UserId':_0x37e6c2['id']},'transaction':_0x214972});});return Promise[_0x8b16('0x55')](_0xba8783);})[_0x8b16('0x17')](function(){return db[_0x8b16('0x119')][_0x8b16('0x4c')]({'where':{'teamId':{'$in':_0x25f719}}});})['then'](function(_0x581f4e){var _0x91907=_['map'](_0x581f4e,function(_0xaec126){return db[_0x8b16('0x11a')]['destroy']({'where':{'UserId':_0x37e6c2['id'],'VoicePrefixId':_0xaec126[_0x8b16('0x11f')]}},{'transaction':_0x214972});});return Promise[_0x8b16('0x55')](_0x91907);});});})['then'](function(){for(var _0x3db2a5=0x0;_0x3db2a5<_0x5090ee[_0x8b16('0x5e')];_0x3db2a5++){var _0x5e45a8=_0x5090ee[_0x3db2a5][_0x8b16('0x11b')]('channel');var _0x49f82a=_0x5e45a8+_0x8b16('0xa7');socket[_0x8b16('0x2e')](_0x8b16('0x33')+_0x5e45a8+_0x8b16('0xb2'),{'UserId':_0x3a8f30,['queueField']:_0x5090ee[_0x3db2a5]['id']});}})[_0x8b16('0x17')](respondWithStatusCode(_0x459289,null))['catch'](APIHandleError(_0x459289));};exports[_0x8b16('0x120')]=function(_0x16e2b5,_0x5be680){var _0x3a8655={};var _0x32ced3={};var _0x56ad74;var _0x474ab3;return db[_0x8b16('0x3f')]['findOne']({'where':{'id':_0x16e2b5[_0x8b16('0x57')]['id']}})['then'](handleEntityNotFound(_0x5be680,null))[_0x8b16('0x17')](function(_0x4d8eeb){if(_0x4d8eeb){_0x56ad74=_0x4d8eeb;_0x32ced3[_0x8b16('0x58')]=_[_0x8b16('0x5a')](db[_0x8b16('0xce')][_0x8b16('0x40')]);_0x32ced3[_0x8b16('0x46')]=_[_0x8b16('0x5a')](_0x16e2b5[_0x8b16('0x46')]);_0x32ced3[_0x8b16('0x5b')]=_[_0x8b16('0x5c')](_0x32ced3['model'],_0x32ced3[_0x8b16('0x46')]);_0x3a8655['attributes']=_[_0x8b16('0x5c')](_0x32ced3[_0x8b16('0x58')],qs['fields'](_0x16e2b5['query'][_0x8b16('0x5d')]));_0x3a8655[_0x8b16('0x4a')]=_0x3a8655['attributes'][_0x8b16('0x5e')]?_0x3a8655[_0x8b16('0x4a')]:_0x32ced3[_0x8b16('0x58')];_0x3a8655[_0x8b16('0xca')]=qs[_0x8b16('0xcb')](_0x16e2b5[_0x8b16('0x46')][_0x8b16('0xcb')]);_0x3a8655[_0x8b16('0x45')]=qs[_0x8b16('0x5b')](_['pick'](_0x16e2b5[_0x8b16('0x46')],_0x32ced3[_0x8b16('0x5b')]));if(_0x16e2b5[_0x8b16('0x46')]['filter']){_0x3a8655[_0x8b16('0x45')]=_[_0x8b16('0x60')](_0x3a8655[_0x8b16('0x45')],{'$or':_[_0x8b16('0x38')](_0x3a8655['attributes'],function(_0x678c61){var _0x475a77={};_0x475a77[_0x678c61]={'$like':'%'+_0x16e2b5[_0x8b16('0x46')][_0x8b16('0x37')]+'%'};return _0x475a77;})});}_0x3a8655=_['merge']({},_0x3a8655,_0x16e2b5['options']);return _0x56ad74[_0x8b16('0x120')](_0x3a8655);}})[_0x8b16('0x17')](function(_0x5934cf){if(_0x5934cf){_0x474ab3=_0x5934cf[_0x8b16('0x5e')];if(!_0x16e2b5[_0x8b16('0x46')][_0x8b16('0xcd')](_0x8b16('0xd4'))){_0x3a8655[_0x8b16('0xd5')]=qs[_0x8b16('0xd5')](_0x16e2b5[_0x8b16('0x46')][_0x8b16('0xd5')]);_0x3a8655[_0x8b16('0x27')]=qs['offset'](_0x16e2b5[_0x8b16('0x46')][_0x8b16('0x27')]);}return _0x56ad74[_0x8b16('0x120')](_0x3a8655);}})[_0x8b16('0x17')](function(_0x2e3788){if(_0x2e3788){return _0x2e3788?{'count':_0x474ab3,'rows':_0x2e3788}:null;}})[_0x8b16('0x17')](respondWithResult(_0x5be680,null))[_0x8b16('0x22')](handleError(_0x5be680,null));};exports[_0x8b16('0x121')]=function(_0x404462,_0x4a3d55){var _0x3d6eb8={};var _0x1a8b7f={};var _0x5d2845;return db[_0x8b16('0x3f')]['findOne']({'where':{'id':_0x404462[_0x8b16('0x57')]['id']}})[_0x8b16('0x17')](handleEntityNotFound(_0x4a3d55,null))[_0x8b16('0x17')](function(_0xe541b){if(_0xe541b){_0x5d2845=_0xe541b;_0x1a8b7f['model']=_['keys'](db[_0x8b16('0x3f')][_0x8b16('0x40')]);_0x1a8b7f[_0x8b16('0x46')]=_[_0x8b16('0x5a')](_0x404462[_0x8b16('0x46')]);_0x1a8b7f[_0x8b16('0x5b')]=_[_0x8b16('0x5c')](_0x1a8b7f[_0x8b16('0x58')],_0x1a8b7f[_0x8b16('0x46')]);_0x3d6eb8[_0x8b16('0x4a')]=_[_0x8b16('0x5c')](_0x1a8b7f[_0x8b16('0x58')],qs['fields'](_0x404462[_0x8b16('0x46')]['fields']));_0x3d6eb8['attributes']=_0x3d6eb8[_0x8b16('0x4a')][_0x8b16('0x5e')]?_0x3d6eb8[_0x8b16('0x4a')]:_0x1a8b7f[_0x8b16('0x58')];_0x3d6eb8[_0x8b16('0xca')]=qs[_0x8b16('0xcb')](_0x404462[_0x8b16('0x46')][_0x8b16('0xcb')]);_0x3d6eb8[_0x8b16('0x45')]=qs[_0x8b16('0x5b')](_[_0x8b16('0xcc')](_0x404462[_0x8b16('0x46')],_0x1a8b7f[_0x8b16('0x5b')]));if(_0x404462[_0x8b16('0x46')]['filter']){_0x3d6eb8[_0x8b16('0x45')]=_['merge'](_0x3d6eb8[_0x8b16('0x45')],{'$or':_['map'](_0x3d6eb8[_0x8b16('0x4a')],function(_0x340b3c){var _0x332f86={};_0x332f86[_0x340b3c]={'$like':'%'+_0x404462[_0x8b16('0x46')][_0x8b16('0x37')]+'%'};return _0x332f86;})});}_0x3d6eb8[_0x8b16('0x58')]=db[_0x8b16('0x3f')];_0x3d6eb8['as']=_0x8b16('0x34');_0x3d6eb8=_[_0x8b16('0x60')]({},_0x3d6eb8,_0x404462[_0x8b16('0x61')]);return _0x5d2845[_0x8b16('0xf8')]({'include':[_0x3d6eb8]});}})[_0x8b16('0x17')](function(_0x27609b){if(_0x27609b){var _0xcd9627={},_0x3d776e=[];for(var _0x25a316=0x0;_0x25a316<_0x27609b[_0x8b16('0x5e')];_0x25a316+=0x1){for(var _0x3a2edb=0x0,_0x4d2120;_0x3a2edb<_0x27609b[_0x25a316][_0x8b16('0x34')]['length'];_0x3a2edb+=0x1){_0x4d2120=_0x27609b[_0x25a316][_0x8b16('0x34')][_0x3a2edb][_0x8b16('0x31')]({'plain':!![]});_0xcd9627[_0x4d2120['id']]=_0x4d2120;}}_0xcd9627=_[_0x8b16('0x122')](_0xcd9627);for(var _0x53c321=qs[_0x8b16('0x27')](_0x404462['query'][_0x8b16('0x27')]);_0x53c321<_0xcd9627[_0x8b16('0x5e')]&&_0x3d776e[_0x8b16('0x5e')]=_0x1a57d9){_0x491e62=_0x1a57d9;_0x5222a4=0xc8;}else{_0x5222a4=0xce;}_0x4f663e[_0x34de('0x1f')](_0x5222a4);return _0x4f663e[_0x34de('0x26')](_0x34de('0x27'),_0x3bad31+'-'+_0x491e62+'/'+_0x1a57d9)[_0x34de('0x21')](_0x2081f3);}return null;};}function saveUpdates(_0x65d71d){return function(_0x64afe0){if(_0x64afe0){return _0x64afe0[_0x34de('0x28')](_0x65d71d)[_0x34de('0x15')](function(_0x2abeb9){if(_0x2abeb9[_0x34de('0x29')]===_0x34de('0x2a')){socket[_0x34de('0x2b')]('userNotification:recalc:'+_0x2abeb9['id'],_0x2abeb9);}return _0x2abeb9;});}return null;};}function removeEntity(_0x2487ae){return function(_0x4c7ed2){if(_0x4c7ed2){return _0x4c7ed2[_0x34de('0x2c')]()[_0x34de('0x15')](function(){var _0x3d2490=_0x4c7ed2[_0x34de('0x2d')]({'plain':!![]});if(_0x3d2490[_0x34de('0x29')]==='admin')return;var _0x4346a4=[{'name':_0x34de('0x2e'),'value':'user','ignore':!![]},{'name':_0x34de('0x2f'),'value':_0x34de('0x2a'),'ignore':![]},{'name':'Telephones','value':_0x34de('0x30'),'ignore':![]}];var _0x2f5ba6=_(_0x4346a4)[_0x34de('0x31')]('ignore')[_0x34de('0x32')](_0x34de('0x33'))[_0x34de('0x33')]();if(_['includes'](_0x2f5ba6,_0x3d2490[_0x34de('0x29')])){return;}var _0x921075=_[_0x34de('0x34')](_0x4346a4,[_0x34de('0x33'),_0x3d2490[_0x34de('0x29')]])[_0x34de('0x35')];return db[_0x34de('0x36')]['destroy']({'where':{'type':_0x921075,'resourceId':_0x3d2490['id']}})['then'](function(){return _0x4c7ed2;});})[_0x34de('0x15')](function(){_0x2487ae[_0x34de('0x1f')](0xcc)[_0x34de('0x20')]();});}};}function handleEntityNotFound(_0x274d2c){return function(_0x412370){if(!_0x412370){_0x274d2c['sendStatus'](0x194);}return _0x412370;};}function handleError(_0x4a01ee,_0x3a37eb){_0x3a37eb=_0x3a37eb||0x1f4;return function(_0x433246){logger[_0x34de('0x19')](_0x433246[_0x34de('0x37')]);if(_0x433246['name']){delete _0x433246[_0x34de('0x35')];}_0x4a01ee['status'](_0x3a37eb)[_0x34de('0x38')](_0x433246);};}exports[_0x34de('0x39')]=function(_0x14a7dc,_0xf7551){var _0x189afb={},_0x46199d={'count':0x0,'rows':[]};var _0x17d46b=_(db[_0x34de('0x3a')][_0x34de('0x3b')])['map'](function(_0xf24148){return{'name':_0xf24148[_0x34de('0x3c')],'type':_0xf24148['type'][_0x34de('0x3d')]};})[_0x34de('0x31')](function(_0x298908){return!_[_0x34de('0x3e')](['password',_0x34de('0x3f')],_0x298908[_0x34de('0x35')]);})[_0x34de('0x33')]();_0x189afb=qs[_0x34de('0x40')](_0x17d46b,_0x14a7dc);var _0x3a2826={'where':_0x189afb[_0x34de('0x41')]};return db[_0x34de('0x3a')][_0x34de('0x23')](_0x3a2826)[_0x34de('0x15')](function(_0x5c4d19){_0x46199d[_0x34de('0x23')]=_0x5c4d19;if(_0x14a7dc[_0x34de('0x42')][_0x34de('0x43')]){_0x189afb['include']=[{'all':!![]}];}if(_0x14a7dc['query'][_0x34de('0x44')]==='true'){_0x189afb[_0x34de('0x45')]=[{'model':db[_0x34de('0x46')],'as':'userSetting'}];}if(!_['includes'](_0x189afb[_0x34de('0x47')],'id')){_0x189afb['attributes'][_0x34de('0x48')]('id');}return db[_0x34de('0x3a')][_0x34de('0x49')](_0x189afb);})[_0x34de('0x15')](function(_0x443827){_0x46199d[_0x34de('0x4a')]=_0x443827;if(_0x14a7dc[_0x34de('0x42')][_0x34de('0x4b')]==='true'){var _0x57269=[];for(var _0x37fa5d=0x0;_0x37fa5d<_0x46199d['rows'][_0x34de('0x4c')];_0x37fa5d++){_0x57269[_0x34de('0x48')](get_open_tabs('chat',_0x46199d['rows'][_0x37fa5d][_0x34de('0x4d')]));_0x57269[_0x34de('0x48')](get_open_tabs(_0x34de('0x4e'),_0x46199d[_0x34de('0x4a')][_0x37fa5d][_0x34de('0x4d')]));_0x57269[_0x34de('0x48')](get_open_tabs(_0x34de('0x4f'),_0x46199d[_0x34de('0x4a')][_0x37fa5d][_0x34de('0x4d')]));_0x57269[_0x34de('0x48')](get_open_tabs('mail',_0x46199d[_0x34de('0x4a')][_0x37fa5d]['dataValues']));_0x57269['push'](get_open_tabs(_0x34de('0x50'),_0x46199d[_0x34de('0x4a')][_0x37fa5d][_0x34de('0x4d')]));_0x57269[_0x34de('0x48')](get_open_tabs('whatsapp',_0x46199d[_0x34de('0x4a')][_0x37fa5d]['dataValues']));}return Promise[_0x34de('0x51')](_0x57269)['then'](function(){return _0x46199d;});}else{return _0x46199d;}})['then'](respondWithFilteredResult(_0xf7551,_0x189afb))[_0x34de('0x52')](handleError(_0xf7551,null));};exports[_0x34de('0x53')]=function(_0x24a347,_0x3a81df){var _0x26fe22={'raw':![],'where':{'id':_0x24a347['params']['id']}},_0x409ce8={};_0x409ce8[_0x34de('0x54')]=_[_0x34de('0x55')](_['keys'](db[_0x34de('0x3a')][_0x34de('0x3b')]),[_0x34de('0x56'),_0x34de('0x3f')]);_0x409ce8['query']=_[_0x34de('0x57')](_0x24a347['query']);_0x409ce8[_0x34de('0x58')]=_[_0x34de('0x59')](_0x409ce8['model'],_0x409ce8[_0x34de('0x42')]);_0x26fe22[_0x34de('0x47')]=_[_0x34de('0x59')](_0x409ce8[_0x34de('0x54')],qs[_0x34de('0x5a')](_0x24a347[_0x34de('0x42')]['fields']));_0x26fe22['attributes']=_0x26fe22[_0x34de('0x47')][_0x34de('0x4c')]?_0x26fe22[_0x34de('0x47')]:_0x409ce8[_0x34de('0x54')];if(_0x24a347[_0x34de('0x42')]['includeAll']){_0x26fe22[_0x34de('0x45')]=[{'all':!![]}];}if(_0x24a347['query'][_0x34de('0x44')]===_0x34de('0x5b')){_0x26fe22[_0x34de('0x45')]=[{'model':db[_0x34de('0x46')],'as':'userSetting'}];}_0x26fe22=_['merge']({},_0x26fe22,_0x24a347[_0x34de('0x5c')]);if(!_['includes'](_0x26fe22[_0x34de('0x47')],'id')){_0x26fe22['attributes'][_0x34de('0x48')]('id');}return db[_0x34de('0x3a')][_0x34de('0x34')](_0x26fe22)['then'](handleEntityNotFound(_0x3a81df,null))[_0x34de('0x15')](function(_0x443f74){var _0xd1ff79=[];values=_0x443f74;if(_0x24a347[_0x34de('0x42')][_0x34de('0x4b')]===_0x34de('0x5b')){_0xd1ff79[_0x34de('0x48')](get_open_tabs('chat',_0x443f74[_0x34de('0x4d')]));_0xd1ff79[_0x34de('0x48')](get_open_tabs('sms',_0x443f74['dataValues']));_0xd1ff79[_0x34de('0x48')](get_open_tabs(_0x34de('0x50'),_0x443f74[_0x34de('0x4d')]));_0xd1ff79['push'](get_open_tabs('whatsapp',_0x443f74['dataValues']));_0xd1ff79['push'](get_open_tabs(_0x34de('0x4f'),_0x443f74[_0x34de('0x4d')]));_0xd1ff79[_0x34de('0x48')](get_open_tabs(_0x34de('0x5d'),_0x443f74[_0x34de('0x4d')]));return Promise[_0x34de('0x51')](_0xd1ff79);}else{return values;}})[_0x34de('0x15')](function(){return values;})[_0x34de('0x15')](respondWithResult(_0x3a81df,null))[_0x34de('0x52')](handleError(_0x3a81df,null));};exports['update']=function(_0x50a255,_0x816379){if(_0x50a255['body']['id']){delete _0x50a255[_0x34de('0x5e')]['id'];}delete _0x50a255[_0x34de('0x5e')][_0x34de('0x29')];return db[_0x34de('0x3a')][_0x34de('0x34')]({'where':{'id':_0x50a255['params']['id']}})[_0x34de('0x15')](handleEntityNotFound(_0x816379,null))[_0x34de('0x15')](saveUpdates(_0x50a255[_0x34de('0x5e')],null))[_0x34de('0x15')](respondWithResult(_0x816379,null))[_0x34de('0x52')](handleError(_0x816379,null));};exports[_0x34de('0x5f')]=function(_0x2377a1,_0x4a655d){return db[_0x34de('0x3a')][_0x34de('0x5f')]()[_0x34de('0x15')](respondWithResult(_0x4a655d,null))[_0x34de('0x52')](handleError(_0x4a655d,null));};exports[_0x34de('0x60')]=function(_0xd42207,_0x56515c){return db[_0x34de('0x3a')]['find']({'where':{'id':_0xd42207[_0x34de('0x61')]['id']}})['then'](handleEntityNotFound(_0x56515c,null))[_0x34de('0x15')](function(_0x431adb){if(_0x431adb){return _0x431adb[_0x34de('0x60')](_0xd42207[_0x34de('0x5e')][_0x34de('0x62')],_['omit'](_0xd42207['body'],[_0x34de('0x62'),'id'])||{});}})['then'](respondWithResult(_0x56515c,null))[_0x34de('0x52')](handleError(_0x56515c,null));};function validateUser(_0x220962){return new Promise(function(_0x30ca33,_0x1e2529){if(_0x220962['internal'])return _0x30ca33(_0x220962);return db[_0x34de('0x63')]['findById'](0x1)[_0x34de('0x15')](function(_0x221049){if(_0x221049['securePassword'])authService[_0x34de('0x64')](_0x220962[_0x34de('0x56')]);db[_0x34de('0x3a')][_0x34de('0x65')](_0x34de('0x66'))[_0x34de('0x15')](function(_0x338b37){if(_[_0x34de('0x67')](_0x338b37)){_0x220962[_0x34de('0x66')]=_0x221049[_0x34de('0x68')]||0x1;return;}if(_[_0x34de('0x67')](_0x221049[_0x34de('0x68')])||_0x221049['min_internal']===_0x338b37){_0x220962['internal']=_0x338b37+0x1;return;}if(_0x221049[_0x34de('0x68')]>_0x338b37){_0x220962[_0x34de('0x66')]=_0x221049[_0x34de('0x68')];return;}return db[_0x34de('0x69')]['query'](_0x34de('0x6a'),{'type':db[_0x34de('0x69')][_0x34de('0x6b')][_0x34de('0x6c')]})[_0x34de('0x15')](function(_0x5622b0){if(_0x5622b0&&_0x5622b0[_0x34de('0x4c')]){for(var _0x33996b=0x0,_0x1a9fb8=_0x5622b0[_0x34de('0x4c')];_0x33996b<_0x1a9fb8&&_['isNil'](_0x220962['internal']);_0x33996b++){if(_0x221049[_0x34de('0x68')]<=_0x5622b0[_0x33996b][_0x34de('0x6d')]){_0x220962[_0x34de('0x66')]=_0x5622b0[_0x33996b][_0x34de('0x6d')];}else if(_0x221049['min_internal']>_0x5622b0[_0x33996b]['from']&&_0x221049['min_internal']<=_0x5622b0[_0x33996b]['to']){_0x220962[_0x34de('0x66')]=_0x221049[_0x34de('0x68')];}}}if(_[_0x34de('0x67')](_0x220962[_0x34de('0x66')])){_0x220962['internal']=_0x338b37+0x1;}return _0x30ca33(_0x220962);});});})[_0x34de('0x52')](function(_0x2fb017){_0x1e2529(_0x2fb017);});});}function updateUser(_0x33c944){return new Promise(function(_0x46a48e,_0x63c35f){try{if(_0x33c944['voicemail']){_0x33c944['mailbox']=_0x33c944[_0x34de('0x66')];_0x33c944['VoiceMail']={'mailbox':_0x33c944[_0x34de('0x66')],'password':_0x33c944[_0x34de('0x56')],'fullname':_0x33c944[_0x34de('0x6e')],'email':_0x33c944[_0x34de('0x6f')]};}if(_0x33c944['role']===_0x34de('0x2a')){if(!_0x33c944[_0x34de('0x70')])_0x33c944[_0x34de('0x70')]=['101','102',_0x34de('0x71'),'113',_0x34de('0x72'),'104',_0x34de('0x73'),_0x34de('0x74'),_0x34de('0x75'),'108',_0x34de('0x76'),_0x34de('0x77'),'111','114','115'];}_0x46a48e(_0x33c944);}catch(_0x2fb9e1){_0x63c35f(_0x2fb9e1);}});}exports[_0x34de('0x78')]=function(_0x582c90,_0x5e462d){if(_0x582c90['user'][_0x34de('0x29')]===_0x34de('0x2a'))throw new Error(_0x34de('0x79'));if(_0x582c90[_0x34de('0x5e')][_0x34de('0x29')]===_0x34de('0x7a')&&_0x582c90[_0x34de('0x7a')]['role']!==_0x34de('0x7b')){throw new Error(_0x34de('0x7c'));}if(_0x582c90[_0x34de('0x5e')]['role']===_0x34de('0x7b')&&_0x582c90[_0x34de('0x7a')][_0x34de('0x29')]!==_0x34de('0x7b')){throw new Error(_0x34de('0x7d'));}return licenseUtil[_0x34de('0x7e')]([_0x582c90['body']])['then'](function(){return validateUser(_0x582c90[_0x34de('0x5e')]);})[_0x34de('0x15')](function(_0x1ed10){return updateUser(_0x1ed10)[_0x34de('0x15')](function(_0x27ba79){if(_0x27ba79['role']===_0x34de('0x7b')){_0x27ba79['settingsEnabled']=_0x582c90[_0x34de('0x7a')][_0x34de('0x7f')];delete _0x27ba79[_0x34de('0x80')];}return _0x27ba79;});})[_0x34de('0x15')](function(_0x1f990e){return db[_0x34de('0x3a')][_0x34de('0x78')](_0x1f990e,{'include':[{'model':db['VoiceMail'],'as':_0x34de('0x81')}]});})[_0x34de('0x15')](function(_0x3d9190){if(_0x582c90[_0x34de('0x5e')]['role']===_0x34de('0x7a'))return _0x3d9190;if(_0x582c90[_0x34de('0x7a')][_0x34de('0x29')]!==_0x34de('0x7a'))return _0x3d9190;return db['UserProfileSection'][_0x34de('0x34')]({'where':{'name':_0x3d9190['role']===_0x34de('0x2a')?_0x34de('0x2f'):_0x34de('0x82'),'userProfileId':_0x582c90['user'][_0x34de('0x80')]},'raw':!![]})[_0x34de('0x15')](function(_0xac3222){if(!_0xac3222||_0xac3222[_0x34de('0x83')]!=0x0)return _0x3d9190;return db[_0x34de('0x36')][_0x34de('0x78')]({'name':_0x3d9190[_0x34de('0x35')],'resourceId':_0x3d9190['id'],'type':_0xac3222[_0x34de('0x35')],'sectionId':_0xac3222['id']},{})[_0x34de('0x15')](function(){return _0x3d9190;});})['catch'](function(_0x4a7783){logger['error'](_0x34de('0x84'),_0x4a7783);throw _0x4a7783;});})[_0x34de('0x15')](respondWithResult(_0x5e462d,0xc9))[_0x34de('0x52')](handleError(_0x5e462d,null));};exports[_0x34de('0x85')]=function(_0xd6e7b5,_0x11b2ec){var _0x387559=_0xd6e7b5[_0x34de('0x5e')];var _0x3ac087=[];if(_0xd6e7b5[_0x34de('0x7a')][_0x34de('0x29')]===_0x34de('0x2a'))throw new Error('Unauthorized');if(_[_0x34de('0x86')](_0x387559,[_0x34de('0x29'),_0x34de('0x7a')])&&_0xd6e7b5[_0x34de('0x7a')]['role']!==_0x34de('0x7b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x34de('0x86')](_0x387559,[_0x34de('0x29'),'admin'])&&_0xd6e7b5[_0x34de('0x7a')][_0x34de('0x29')]!==_0x34de('0x7b')){throw new Error(_0x34de('0x87'));}return licenseUtil[_0x34de('0x7e')](_0x387559)['then'](function(){return validateUser(_0x387559[0x0]);})['then'](function(){for(var _0x59ce04=0x1;_0x59ce04<_0x387559[_0x34de('0x4c')];_0x59ce04++){var _0x1eda11=_0x387559[_0x59ce04-0x1][_0x34de('0x66')];if(!_0x387559[_0x59ce04]['internal'])_0x387559[_0x59ce04][_0x34de('0x66')]=_0x1eda11+0x1;_0x3ac087['push'](validateUser(_0x387559[_0x59ce04]));}return Promise[_0x34de('0x51')](_0x3ac087);})['then'](function(){_0x3ac087=[];for(var _0x563270=0x0;_0x563270<_0x387559[_0x34de('0x4c')];_0x563270++){_0x3ac087[_0x34de('0x48')](updateUser(_0x387559[_0x563270]));}return Promise[_0x34de('0x51')](_0x3ac087);})[_0x34de('0x15')](function(){_0x3ac087=_0x387559[_0x34de('0x32')](function(_0x253adb){return db[_0x34de('0x3a')][_0x34de('0x78')](_0x253adb,{'include':[{'model':db[_0x34de('0x81')],'as':_0x34de('0x81')}]})[_0x34de('0x15')](function(_0x5eed54){_0x253adb['id']=_0x5eed54['id'];return _0x253adb;});});return Promise[_0x34de('0x51')](_0x3ac087);})[_0x34de('0x15')](function(_0x68ae06){if(_0xd6e7b5[_0x34de('0x5e')]['role']===_0x34de('0x7a'))return _0x68ae06;if(_0xd6e7b5['user']['role']!=='user')return _0x68ae06;var _0x3590ee=_[_0x34de('0x86')](_0x68ae06,function(_0x378c15){return _0x378c15['role']===_0x34de('0x2a')||_0x378c15[_0x34de('0x29')]===_0x34de('0x30');});if(!_0x3590ee)return _0x68ae06;return db[_0x34de('0x88')][_0x34de('0x49')]({'where':{'name':{'$or':[_0x34de('0x2f'),_0x34de('0x82')]},'userProfileId':_0xd6e7b5[_0x34de('0x7a')][_0x34de('0x80')]},'raw':!![]})[_0x34de('0x15')](function(_0x46bea9){if(_[_0x34de('0x89')](_0x46bea9)||!_[_0x34de('0x86')](_0x46bea9,[_0x34de('0x83'),0x0]))return _0x68ae06;_0x3ac087=[];var _0x919bb8=_(_0x46bea9)[_0x34de('0x32')](function(_0x9254b8){if(_0x9254b8['autoAssociation']===0x1)return;return _0x9254b8[_0x34de('0x35')]==='Agents'?_0x34de('0x2a'):'telephone';})[_0x34de('0x8a')]()[_0x34de('0x33')]();for(var _0x3408c4=0x0;_0x3408c4<_0x68ae06[_0x34de('0x4c')];_0x3408c4++){if(!_[_0x34de('0x3e')](_0x919bb8,_0x68ae06[_0x3408c4][_0x34de('0x29')]))return;var _0x5b306e=_0x68ae06[_0x3408c4][_0x34de('0x29')]==='agent'?_0x34de('0x2f'):_0x34de('0x82');_0x3ac087[_0x34de('0x48')](db[_0x34de('0x36')][_0x34de('0x78')]({'name':_0x68ae06[_0x3408c4]['name'],'resourceId':_0x68ae06[_0x3408c4]['id'],'type':_0x5b306e,'sectionId':_['find'](_0x46bea9,[_0x34de('0x35'),_0x5b306e])['id']},{}));}return Promise[_0x34de('0x51')](_0x3ac087);});})[_0x34de('0x15')](respondWithResult(_0x11b2ec,0xc9))[_0x34de('0x52')](handleError(_0x11b2ec,null));};exports[_0x34de('0x8b')]=function(_0xf7207d,_0x59e4fe){if(_0xf7207d['body']['id']){delete _0xf7207d[_0x34de('0x5e')]['id'];}return db[_0x34de('0x3a')][_0x34de('0x34')]({'where':{'id':_0xf7207d[_0x34de('0x61')]['id']}})['then'](function(_0x205e8c){if(!_0x205e8c)return null;if(_0x205e8c['id']===_0xf7207d[_0x34de('0x7a')]['id']){if(!_0xf7207d[_0x34de('0x5e')]['oldPassword']||!_0xf7207d[_0x34de('0x5e')][_0x34de('0x8c')]){throw new db['Sequelize']['ValidationError'](_0x34de('0x8d'));}if(!_0x205e8c['authenticate'](_0xf7207d[_0x34de('0x5e')][_0x34de('0x8e')])){throw new db[(_0x34de('0x8f'))][(_0x34de('0x90'))](_0x34de('0x91'));}if(_0xf7207d['body']['oldPassword']===_0xf7207d['body']['newPassword']){throw new db[(_0x34de('0x8f'))][(_0x34de('0x90'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0xf7207d['user']['role']==='admin'){if(!_0xf7207d[_0x34de('0x5e')][_0x34de('0x8c')]){throw new db[(_0x34de('0x8f'))][(_0x34de('0x90'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0xf7207d[_0x34de('0x7a')][_0x34de('0x29')]===_0x34de('0x7a')){if(!_0xf7207d[_0x34de('0x5e')][_0x34de('0x8c')]){throw new db[(_0x34de('0x8f'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x205e8c[_0x34de('0x29')]!==_0x34de('0x2a')){throw new db['Sequelize'][(_0x34de('0x90'))](_0x34de('0x79'));}}else{throw new db['Sequelize'][(_0x34de('0x90'))](_0x34de('0x79'));}return _0x205e8c;})[_0x34de('0x15')](handleEntityNotFound(_0x59e4fe,null))[_0x34de('0x15')](function(_0xa79365){return db[_0x34de('0x63')][_0x34de('0x92')]({'attributes':['id',_0x34de('0x93'),_0x34de('0x94'),_0x34de('0x95')]})['then'](function(_0x56411c){if(_0x56411c['securePassword'])authService['validatePasswordPattern'](_0xf7207d[_0x34de('0x5e')]['newPassword']);if(!_0x56411c[_0x34de('0x94')]||!_0xa79365[_0x34de('0x96')])return _0xa79365;authService[_0x34de('0x97')](_0xf7207d[_0x34de('0x5e')][_0x34de('0x8c')],_0xa79365['previousPasswords'],_0x56411c[_0x34de('0x95')]);return _0xa79365;})[_0x34de('0x15')](saveUpdates({'password':_0xf7207d[_0x34de('0x5e')]['newPassword'],'passwordResetAt':_0xf7207d[_0x34de('0x7a')]['id']==_0xf7207d[_0x34de('0x61')]['id']?moment():null,'previousPasswords':authService[_0x34de('0x98')](_0xf7207d[_0x34de('0x5e')][_0x34de('0x8c')],_0xa79365[_0x34de('0x96')])},null));})[_0x34de('0x15')](respondWithResult(_0x59e4fe,null))[_0x34de('0x52')](handleError(_0x59e4fe,null));};exports[_0x34de('0x99')]=function(_0x45b219,_0x33e48a){var _0x445768=_0x45b219[_0x34de('0x5e')][_0x34de('0x9a')];return db['User']['find']({'where':{'id':_0x45b219['params']['id']},'attributes':['id',_0x34de('0x35'),_0x34de('0x29'),_0x34de('0x9b'),'loginInPause','voicePause',_0x34de('0x9c')]})[_0x34de('0x15')](handleEntityNotFound(_0x33e48a,null))['then'](function(_0x11f2fe){if(_0x11f2fe){if(!utils[_0x34de('0x9d')](_0x445768)){throw new db[(_0x34de('0x8f'))][(_0x34de('0x90'))](_0x34de('0x9e'));}return _0x11f2fe[_0x34de('0x9f')+_['capitalize'](_0x445768[_0x34de('0xa0')]())+_0x34de('0xa1')](_0x45b219[_0x34de('0x5e')][_0x34de('0x62')],{'penalty':_0x45b219[_0x34de('0x5e')][_0x34de('0xa2')]||0x0})[_0x34de('0xa3')](function(_0x29800e){for(var _0x31ed45=0x0;_0x31ed45<_0x45b219[_0x34de('0x5e')][_0x34de('0x62')][_0x34de('0x4c')];_0x31ed45+=0x1){var _0x1a1b75={'UserId':Number(_0x45b219['params']['id'])};_0x1a1b75[_[_0x34de('0xa4')](_0x445768[_0x34de('0xa0')]())+_0x34de('0xa5')]=Number(_0x45b219[_0x34de('0x5e')][_0x34de('0x62')][_0x31ed45]);socket[_0x34de('0x2b')](_0x34de('0x7a')+_[_0x34de('0xa4')](_0x445768[_0x34de('0xa0')]())+_0x34de('0xa6'),_0x1a1b75);}return _0x29800e;})['then'](function(){if(_0x445768===_0x34de('0xa7')){return db[_0x34de('0xa8')][_0x34de('0x49')]({'where':{'id':_0x45b219['body'][_0x34de('0x62')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x34de('0x15')](function(_0x76888c){var _0x489572=_0x11f2fe[_0x34de('0x2d')]({'plain':!![]});var _0xe01c73=[];if(_0x445768===_0x34de('0xa7')&&_0x489572['role']===_0x34de('0x2a')&&_0x489572[_0x34de('0x9b')]){for(let _0x272c96=0x0;_0x272c96<_0x76888c[_0x34de('0x4c')];_0x272c96+=0x1){_0xe01c73['push']({'membername':_0x489572[_0x34de('0x35')],'UserId':_0x489572['id'],'queue_name':_0x76888c[_0x272c96][_0x34de('0x35')],'VoiceQueueId':_0x76888c[_0x272c96]['id'],'interface':_['isNil'](_0x489572[_0x34de('0x9c')])?util[_0x34de('0xa9')](_0x34de('0xaa'),_0x489572['name']):_0x489572[_0x34de('0x9c')],'paused':_0x489572[_0x34de('0xab')]||![],'penalty':_0x45b219[_0x34de('0x5e')]['penalty']||0x0});}return Promise['all'](_0xe01c73[_0x34de('0x32')](function(_0x339b26){return db[_0x34de('0xac')][_0x34de('0xad')](_0x339b26);}));}return _0x11f2fe;});}})[_0x34de('0x15')](respondWithStatusCode(_0x33e48a,null))[_0x34de('0x52')](handleError(_0x33e48a,null));};exports[_0x34de('0xae')]=function(_0x15a962,_0x27f3f8){var _0x1d4462,_0x37a532;return db[_0x34de('0x3a')][_0x34de('0x34')]({'where':{'id':_0x15a962['params']['id']},'attributes':['id',_0x34de('0x35'),'role']})[_0x34de('0x15')](handleEntityNotFound(_0x27f3f8,null))[_0x34de('0x15')](function(_0x4b08d3){if(_0x4b08d3){_0x1d4462=_0x4b08d3;if(!_0x15a962[_0x34de('0x42')]['channel']||!utils[_0x34de('0x9d')](_0x15a962['query'][_0x34de('0x9a')])){throw new db[(_0x34de('0x8f'))][(_0x34de('0x90'))]('Unknown\x20channel');}return _0x4b08d3[_0x34de('0xaf')+_['capitalize'](_0x15a962[_0x34de('0x42')][_0x34de('0x9a')][_0x34de('0xa0')]())+_0x34de('0xa1')](_0x15a962[_0x34de('0x42')][_0x34de('0x62')]);}})[_0x34de('0x15')](function(_0x5dd2e4){if(_[_0x34de('0xb0')](_0x15a962[_0x34de('0x42')][_0x34de('0x62')])){for(var _0x29f2dc=0x0;_0x29f2dc<_0x15a962['query'][_0x34de('0x62')][_0x34de('0x4c')];_0x29f2dc+=0x1){_0x37a532={'UserId':Number(_0x15a962[_0x34de('0x61')]['id'])};_0x37a532[_['capitalize'](_0x15a962[_0x34de('0x42')][_0x34de('0x9a')][_0x34de('0xa0')]())+_0x34de('0xa5')]=Number(_0x15a962['query']['ids'][_0x29f2dc]);socket[_0x34de('0x2b')](_0x34de('0x7a')+_[_0x34de('0xa4')](_0x15a962['query']['channel'][_0x34de('0xa0')]())+_0x34de('0xb1'),_0x37a532);}}else{_0x37a532={'UserId':Number(_0x15a962[_0x34de('0x61')]['id'])};_0x37a532[_[_0x34de('0xa4')](_0x15a962['query']['channel'][_0x34de('0xa0')]())+_0x34de('0xa5')]=Number(_0x15a962[_0x34de('0x42')][_0x34de('0x62')]);socket['emit']('user'+_['capitalize'](_0x15a962[_0x34de('0x42')][_0x34de('0x9a')][_0x34de('0xa0')]())+_0x34de('0xb1'),_0x37a532);}return _0x5dd2e4;})[_0x34de('0x15')](function(){if(_0x15a962[_0x34de('0x42')][_0x34de('0x9a')]===_0x34de('0xa7')){return db['UserVoiceQueueRt'][_0x34de('0x2c')]({'where':{'UserId':_0x15a962['params']['id'],'VoiceQueueId':_0x15a962[_0x34de('0x42')][_0x34de('0x62')]},'individualHooks':!![]})[_0x34de('0x15')](function(){return _0x1d4462;});}return _0x1d4462;})['then'](respondWithStatusCode(_0x27f3f8,null))[_0x34de('0x52')](handleError(_0x27f3f8,null));};exports[_0x34de('0xb2')]=function(_0x27b0b8,_0x4fc5a7){_0x27b0b8[_0x34de('0x5e')]['userpic']=_0x27b0b8[_0x34de('0xb3')][_0x34de('0xb4')];return db[_0x34de('0x3a')][_0x34de('0x34')]({'where':{'id':_0x27b0b8[_0x34de('0x61')]['id']}})['then'](handleEntityNotFound(_0x4fc5a7,null))[_0x34de('0x15')](saveUpdates(_0x27b0b8[_0x34de('0x5e')],null))[_0x34de('0x15')](respondWithResult(_0x4fc5a7,null))[_0x34de('0x52')](handleError(_0x4fc5a7,null));};exports[_0x34de('0xb5')]=function(_0x261eee,_0x378939){var _0xf59fef=path[_0x34de('0xb6')](config['root'],'server/files/images/logos/default_profile.png');return db[_0x34de('0x3a')][_0x34de('0x34')]({'where':{'id':_0x261eee[_0x34de('0x61')]['id']},'attributes':['id',_0x34de('0xb7')],'raw':!![]})[_0x34de('0x15')](handleEntityNotFound(_0x378939,null))[_0x34de('0x15')](function(_0x1dc178){if(_0x1dc178){if(_[_0x34de('0x67')](_0x1dc178[_0x34de('0xb7')])){return _0x378939[_0x34de('0xb8')](_0xf59fef);}else{if(!fs[_0x34de('0xb9')](path[_0x34de('0xb6')](config['root'],_0x34de('0xba'),_0x1dc178[_0x34de('0xb7')]))){return _0x378939[_0x34de('0xb8')](_0xf59fef);}return _0x378939[_0x34de('0xb8')](path[_0x34de('0xb6')](config[_0x34de('0xbb')],_0x34de('0xba'),_0x1dc178[_0x34de('0xb7')]));}}})[_0x34de('0x52')](handleError(_0x378939,null));};exports[_0x34de('0xbc')]=function(_0x5e91a4,_0x378e2e){return db[_0x34de('0x3a')][_0x34de('0x34')]({'where':{'id':_0x5e91a4['params']['id']},'attributes':['id']})[_0x34de('0x15')](handleEntityNotFound(_0x378e2e,null))['then'](function(_0x48f6dd){var _0x4a35e7=[];values=_0x48f6dd[_0x34de('0x4d')];_0x4a35e7[_0x34de('0x48')](get_open_tabs(_0x34de('0xbd'),_0x48f6dd[_0x34de('0x4d')]));_0x4a35e7[_0x34de('0x48')](get_open_tabs(_0x34de('0x4e'),_0x48f6dd[_0x34de('0x4d')]));_0x4a35e7[_0x34de('0x48')](get_open_tabs(_0x34de('0x50'),_0x48f6dd[_0x34de('0x4d')]));_0x4a35e7[_0x34de('0x48')](get_open_tabs(_0x34de('0xbe'),_0x48f6dd[_0x34de('0x4d')]));_0x4a35e7[_0x34de('0x48')](get_open_tabs(_0x34de('0x4f'),_0x48f6dd[_0x34de('0x4d')]));_0x4a35e7['push'](get_open_tabs(_0x34de('0x5d'),_0x48f6dd[_0x34de('0x4d')]));return Promise['all'](_0x4a35e7);})[_0x34de('0x15')](function(_0x2d088a){if(_0x2d088a){var _0x1557df=_[_0x34de('0x32')](values[_0x34de('0xbf')],function(_0x274638){return{'channel':_0x34de('0xc0'),'id':_0x274638['id'],'createdAt':_0x274638[_0x34de('0xc1')]};});var _0x594a3a=_[_0x34de('0x32')](values['FaxOpenTabs'],function(_0x4bd076){return{'channel':'FAX','id':_0x4bd076['id'],'createdAt':_0x4bd076[_0x34de('0xc1')]};});var _0xb706ec=_[_0x34de('0x32')](values[_0x34de('0xc2')],function(_0x3c66e0){return{'channel':'OPENCHANNEL','id':_0x3c66e0['id'],'createdAt':_0x3c66e0[_0x34de('0xc1')]};});var _0x1d1a43=_[_0x34de('0x32')](values[_0x34de('0xc3')],function(_0x37c8c5){return{'channel':_0x34de('0xc4'),'id':_0x37c8c5['id'],'createdAt':_0x37c8c5[_0x34de('0xc1')]};});var _0x16e62b=_[_0x34de('0x32')](values[_0x34de('0xc5')],function(_0x3aea18){return{'channel':_0x34de('0xc6'),'id':_0x3aea18['id'],'createdAt':_0x3aea18[_0x34de('0xc1')]};});var _0xc2bb37=_[_0x34de('0x32')](values['WhatsappOpenTabs'],function(_0x5409ef){return{'channel':'WHATSAPP','id':_0x5409ef['id'],'createdAt':_0x5409ef[_0x34de('0xc1')]};});var _0x30cf52=_['concat'](_0x1557df,_0x594a3a,_0xb706ec,_0x1d1a43,_0x16e62b,_0xc2bb37);var _0x505e0b={'count':_0x30cf52[_0x34de('0x4c')],'rows':_0x30cf52};return _0x505e0b;}else return null;})['then'](respondWithResult(_0x378e2e,null))[_0x34de('0x52')](handleError(_0x378e2e,null));};exports[_0x34de('0xc7')]=function(_0x358c72,_0x4d516b){var _0x3abb3e={};var _0x234adb={};var _0x8bf66e;var _0x4e2c73;return db[_0x34de('0x3a')][_0x34de('0x92')]({'where':{'id':_0x358c72[_0x34de('0x61')]['id']}})[_0x34de('0x15')](handleEntityNotFound(_0x4d516b,null))[_0x34de('0x15')](function(_0x39b86b){if(_0x39b86b){_0x8bf66e=_0x39b86b;_0x234adb[_0x34de('0x54')]=_[_0x34de('0x57')](db[_0x34de('0xc8')]['rawAttributes']);_0x234adb[_0x34de('0x42')]=_[_0x34de('0x57')](_0x358c72[_0x34de('0x42')]);_0x234adb[_0x34de('0x58')]=_[_0x34de('0x59')](_0x234adb[_0x34de('0x54')],_0x234adb[_0x34de('0x42')]);_0x3abb3e[_0x34de('0x47')]=_[_0x34de('0x59')](_0x234adb[_0x34de('0x54')],qs[_0x34de('0x5a')](_0x358c72[_0x34de('0x42')][_0x34de('0x5a')]));_0x3abb3e[_0x34de('0x47')]=_0x3abb3e['attributes'][_0x34de('0x4c')]?_0x3abb3e[_0x34de('0x47')]:_0x234adb[_0x34de('0x54')];_0x3abb3e[_0x34de('0xc9')]=qs[_0x34de('0xca')](_0x358c72[_0x34de('0x42')][_0x34de('0xca')]);_0x3abb3e[_0x34de('0x41')]=qs[_0x34de('0x58')](_[_0x34de('0xcb')](_0x358c72[_0x34de('0x42')],_0x234adb[_0x34de('0x58')]));if(_0x358c72[_0x34de('0x42')]['filter']){_0x3abb3e[_0x34de('0x41')]=_[_0x34de('0xcc')](_0x3abb3e[_0x34de('0x41')],{'$or':_[_0x34de('0x32')](_0x3abb3e['attributes'],function(_0x47ffb8){var _0x3764f3={};_0x3764f3[_0x47ffb8]={'$like':'%'+_0x358c72[_0x34de('0x42')][_0x34de('0x31')]+'%'};return _0x3764f3;})});}_0x3abb3e=_['merge']({},_0x3abb3e,_0x358c72['options']);return _0x8bf66e['getContacts'](_0x3abb3e);}})['then'](function(_0x21ffb2){if(_0x21ffb2){_0x4e2c73=_0x21ffb2[_0x34de('0x4c')];if(_0x358c72[_0x34de('0x42')][_0x34de('0xcd')](_0x34de('0x43'))){_0x3abb3e['include']=[{'model':db[_0x34de('0xce')],'as':_0x34de('0xcf'),'required':![]},{'model':db[_0x34de('0xd0')],'as':_0x34de('0xd1'),'attributes':['id',_0x34de('0x35'),_0x34de('0xd2')],'where':_0x358c72[_0x34de('0x42')][_0x34de('0xd3')]?{'id':_0x358c72[_0x34de('0x42')][_0x34de('0xd3')]}:undefined,'required':_0x358c72['query'][_0x34de('0xd3')]?!![]:![]}];}if(!_0x358c72[_0x34de('0x42')][_0x34de('0xcd')](_0x34de('0xd4'))){_0x3abb3e[_0x34de('0x25')]=qs[_0x34de('0x25')](_0x358c72['query']['limit']);_0x3abb3e[_0x34de('0x24')]=qs[_0x34de('0x24')](_0x358c72[_0x34de('0x42')]['offset']);}return _0x8bf66e[_0x34de('0xc7')](_0x3abb3e);}})['then'](function(_0x1f7080){if(_0x1f7080){return _0x1f7080?{'count':_0x4e2c73,'rows':_0x1f7080}:null;}})[_0x34de('0x15')](respondWithResult(_0x4d516b,null))[_0x34de('0x52')](handleError(_0x4d516b,null));};exports[_0x34de('0xd5')]=function(_0x16dc07,_0x1e8797){var _0xbb396f;var _0x1e1e06={};var _0x4ce529;return db[_0x34de('0x3a')][_0x34de('0x92')]({'where':{'id':_0x16dc07[_0x34de('0x61')]['id']},'attributes':['id','name',_0x34de('0x29')]})['then'](handleEntityNotFound(_0x1e8797,null))[_0x34de('0x15')](function(_0x466c7c){if(!utils[_0x34de('0x9d')](_0x16dc07[_0x34de('0x42')][_0x34de('0x9a')])){throw new db['Sequelize']['ValidationError'](_0x34de('0x9e'));}_0xbb396f=_0x466c7c;var _0xfb764f={};_0xfb764f['model']=_[_0x34de('0x57')](db[_['capitalize'](_0x16dc07[_0x34de('0x42')][_0x34de('0x9a')])+_0x34de('0xd6')][_0x34de('0x3b')]);_0xfb764f[_0x34de('0x42')]=_['keys'](_0x16dc07[_0x34de('0x42')]);_0xfb764f[_0x34de('0x58')]=_['intersection'](_0xfb764f[_0x34de('0x54')],_0xfb764f[_0x34de('0x42')]);_0x1e1e06[_0x34de('0x47')]=_[_0x34de('0x59')](_0xfb764f[_0x34de('0x54')],qs[_0x34de('0x5a')](_0x16dc07[_0x34de('0x42')][_0x34de('0x5a')]));_0x1e1e06['attributes']=_0x1e1e06[_0x34de('0x47')][_0x34de('0x4c')]?_0x1e1e06[_0x34de('0x47')]:_0xfb764f[_0x34de('0x54')];_0x1e1e06[_0x34de('0xc9')]=qs[_0x34de('0xca')](_0x16dc07[_0x34de('0x42')][_0x34de('0xca')]);_0x1e1e06[_0x34de('0x41')]=qs[_0x34de('0x58')](_[_0x34de('0xcb')](_0x16dc07[_0x34de('0x42')],_0xfb764f[_0x34de('0x58')]));if(_0x16dc07[_0x34de('0x42')][_0x34de('0x31')]){_0x1e1e06['where']=_[_0x34de('0xcc')](_0x1e1e06[_0x34de('0x41')],{'$or':_[_0x34de('0x32')](_0x1e1e06[_0x34de('0x47')],function(_0x20132f){var _0x1341d6={};_0x1341d6[_0x20132f]={'$like':'%'+_0x16dc07['query'][_0x34de('0x31')]+'%'};return _0x1341d6;})});}_0x1e1e06=_[_0x34de('0xcc')]({},_0x1e1e06,_0x16dc07[_0x34de('0x5c')]);switch(_0xbb396f[_0x34de('0x29')]){case _0x34de('0x7b'):return db[_[_0x34de('0xa4')](_0x16dc07[_0x34de('0x42')][_0x34de('0x9a')])+_0x34de('0xd6')][_0x34de('0x49')](_0x1e1e06);case _0x34de('0x7a'):case _0x34de('0x2a'):return _0xbb396f[_0x34de('0x2d')+_[_0x34de('0xa4')](_0x16dc07['query'][_0x34de('0x9a')])+'Queues'](_0x1e1e06);default:throw new db['Sequelize'][(_0x34de('0x90'))]('Unknown\x20role');}})[_0x34de('0x15')](function(_0x3060ba){_0x4ce529=_0x3060ba['length'];if(!_0x16dc07[_0x34de('0x42')]['hasOwnProperty'](_0x34de('0xd4'))){_0x1e1e06['limit']=qs[_0x34de('0x25')](_0x16dc07[_0x34de('0x42')]['limit']);_0x1e1e06[_0x34de('0x24')]=qs[_0x34de('0x24')](_0x16dc07[_0x34de('0x42')][_0x34de('0x24')]);}switch(_0xbb396f[_0x34de('0x29')]){case _0x34de('0x7b'):return db[_[_0x34de('0xa4')](_0x16dc07['query'][_0x34de('0x9a')])+'Queue'][_0x34de('0x49')](_0x1e1e06);case _0x34de('0x7a'):case _0x34de('0x2a'):return _0xbb396f['get'+_[_0x34de('0xa4')](_0x16dc07['query'][_0x34de('0x9a')])+_0x34de('0xa1')](_0x1e1e06);}})[_0x34de('0x15')](function(_0xdeb964){return{'count':_0x4ce529,'rows':_0xdeb964};})[_0x34de('0x15')](respondWithResult(_0x1e8797,null))[_0x34de('0x52')](handleError(_0x1e8797,null));};exports[_0x34de('0xd7')]=function(_0xc09263,_0x5e396e){var _0x14a8de={};var _0x14891d={};var _0x127521;var _0x4e6b98;return db[_0x34de('0x3a')]['findOne']({'where':{'id':_0xc09263[_0x34de('0x61')]['id']}})[_0x34de('0x15')](handleEntityNotFound(_0x5e396e,null))['then'](function(_0x48de1b){if(_0x48de1b){_0x127521=_0x48de1b;_0x14891d['model']=_[_0x34de('0x57')](db[_0x34de('0xac')][_0x34de('0x3b')]);_0x14891d[_0x34de('0x42')]=_[_0x34de('0x57')](_0xc09263[_0x34de('0x42')]);_0x14891d[_0x34de('0x58')]=_['intersection'](_0x14891d[_0x34de('0x54')],_0x14891d[_0x34de('0x42')]);_0x14a8de[_0x34de('0x47')]=_[_0x34de('0x59')](_0x14891d[_0x34de('0x54')],qs[_0x34de('0x5a')](_0xc09263[_0x34de('0x42')][_0x34de('0x5a')]));_0x14a8de['attributes']=_0x14a8de['attributes'][_0x34de('0x4c')]?_0x14a8de[_0x34de('0x47')]:_0x14891d[_0x34de('0x54')];_0x14a8de[_0x34de('0xc9')]=qs[_0x34de('0xca')](_0xc09263[_0x34de('0x42')][_0x34de('0xca')]);_0x14a8de[_0x34de('0x41')]=qs[_0x34de('0x58')](_[_0x34de('0xcb')](_0xc09263[_0x34de('0x42')],_0x14891d[_0x34de('0x58')]));if(_0xc09263[_0x34de('0x42')][_0x34de('0x31')]){_0x14a8de[_0x34de('0x41')]=_[_0x34de('0xcc')](_0x14a8de[_0x34de('0x41')],{'$or':_[_0x34de('0x32')](_0x14a8de[_0x34de('0x47')],function(_0x38eff7){var _0x5aa2ac={};_0x5aa2ac[_0x38eff7]={'$like':'%'+_0xc09263['query'][_0x34de('0x31')]+'%'};return _0x5aa2ac;})});}_0x14a8de=_['merge']({},_0x14a8de,_0xc09263[_0x34de('0x5c')]);return _0x127521[_0x34de('0xd7')](_0x14a8de);}})['then'](function(_0x2cfb73){if(_0x2cfb73){_0x4e6b98=_0x2cfb73[_0x34de('0x4c')];if(!_0xc09263[_0x34de('0x42')][_0x34de('0xcd')](_0x34de('0xd4'))){_0x14a8de[_0x34de('0x25')]=qs[_0x34de('0x25')](_0xc09263[_0x34de('0x42')]['limit']);_0x14a8de[_0x34de('0x24')]=qs['offset'](_0xc09263[_0x34de('0x42')]['offset']);}return _0x127521[_0x34de('0xd7')](_0x14a8de);}})[_0x34de('0x15')](function(_0x3aaab3){if(_0x3aaab3){return _0x3aaab3?{'count':_0x4e6b98,'rows':_0x3aaab3}:null;}})['then'](respondWithResult(_0x5e396e,null))[_0x34de('0x52')](handleError(_0x5e396e,null));};exports['getGroups']=function(_0x388657,_0x1a855d){var _0x4cfe54={};var _0x395c48={};var _0x47378e;var _0x3fcc27;return db['User'][_0x34de('0x92')]({'where':{'id':_0x388657['params']['id']}})[_0x34de('0x15')](handleEntityNotFound(_0x1a855d,null))['then'](function(_0x50fb20){if(_0x50fb20){_0x47378e=_0x50fb20;_0x395c48[_0x34de('0x54')]=_['keys'](db[_0x34de('0xd8')][_0x34de('0x3b')]);_0x395c48['query']=_[_0x34de('0x57')](_0x388657[_0x34de('0x42')]);_0x395c48['filters']=_[_0x34de('0x59')](_0x395c48['model'],_0x395c48[_0x34de('0x42')]);_0x4cfe54[_0x34de('0x47')]=_[_0x34de('0x59')](_0x395c48[_0x34de('0x54')],qs[_0x34de('0x5a')](_0x388657[_0x34de('0x42')][_0x34de('0x5a')]));_0x4cfe54[_0x34de('0x47')]=_0x4cfe54[_0x34de('0x47')][_0x34de('0x4c')]?_0x4cfe54[_0x34de('0x47')]:_0x395c48['model'];_0x4cfe54[_0x34de('0xc9')]=qs[_0x34de('0xca')](_0x388657[_0x34de('0x42')][_0x34de('0xca')]);_0x4cfe54[_0x34de('0x41')]=qs[_0x34de('0x58')](_[_0x34de('0xcb')](_0x388657[_0x34de('0x42')],_0x395c48[_0x34de('0x58')]));if(_0x388657[_0x34de('0x42')]['filter']){_0x4cfe54[_0x34de('0x41')]=_[_0x34de('0xcc')](_0x4cfe54[_0x34de('0x41')],{'$or':_[_0x34de('0x32')](_0x4cfe54[_0x34de('0x47')],function(_0x509b78){var _0x3b7f3f={};_0x3b7f3f[_0x509b78]={'$like':'%'+_0x388657['query']['filter']+'%'};return _0x3b7f3f;})});}_0x4cfe54=_[_0x34de('0xcc')]({},_0x4cfe54,_0x388657[_0x34de('0x5c')]);return _0x47378e[_0x34de('0xd9')](_0x4cfe54);}})[_0x34de('0x15')](function(_0x37fcf6){if(_0x37fcf6){_0x3fcc27=_0x37fcf6[_0x34de('0x4c')];if(!_0x388657[_0x34de('0x42')][_0x34de('0xcd')](_0x34de('0xd4'))){_0x4cfe54[_0x34de('0x25')]=qs[_0x34de('0x25')](_0x388657[_0x34de('0x42')][_0x34de('0x25')]);_0x4cfe54[_0x34de('0x24')]=qs[_0x34de('0x24')](_0x388657['query']['offset']);}return _0x47378e[_0x34de('0xd9')](_0x4cfe54);}})[_0x34de('0x15')](function(_0x3ec665){if(_0x3ec665){return _0x3ec665?{'count':_0x3fcc27,'rows':_0x3ec665}:null;}})[_0x34de('0x15')](respondWithResult(_0x1a855d,null))[_0x34de('0x52')](handleError(_0x1a855d,null));};exports['getRecordings']=function(_0x2031a9,_0x2e954d){var _0x137d37={'raw':!![],'where':{}};var _0x4e2fe7={};var _0x15f51e={'count':0x0,'rows':[]};return db[_0x34de('0x3a')][_0x34de('0x92')]({'where':{'id':_0x2031a9[_0x34de('0x61')]['id']}})['then'](handleEntityNotFound(_0x2e954d,null))[_0x34de('0x15')](function(_0x340147){if(_0x340147){_0x4e2fe7[_0x34de('0x54')]=_['keys'](db[_0x34de('0xda')][_0x34de('0x3b')]);_0x4e2fe7[_0x34de('0x42')]=_[_0x34de('0x57')](_0x2031a9[_0x34de('0x42')]);_0x4e2fe7[_0x34de('0x58')]=_[_0x34de('0x59')](_0x4e2fe7[_0x34de('0x54')],_0x4e2fe7[_0x34de('0x42')]);_0x137d37[_0x34de('0x47')]=_['intersection'](_0x4e2fe7[_0x34de('0x54')],qs[_0x34de('0x5a')](_0x2031a9[_0x34de('0x42')][_0x34de('0x5a')]));_0x137d37[_0x34de('0x47')]=_0x137d37[_0x34de('0x47')]['length']?_0x137d37[_0x34de('0x47')]:_0x4e2fe7[_0x34de('0x54')];if(!_0x2031a9[_0x34de('0x42')]['hasOwnProperty'](_0x34de('0xd4'))){_0x137d37[_0x34de('0x25')]=qs[_0x34de('0x25')](_0x2031a9[_0x34de('0x42')][_0x34de('0x25')]);_0x137d37[_0x34de('0x24')]=qs[_0x34de('0x24')](_0x2031a9[_0x34de('0x42')][_0x34de('0x24')]);}_0x137d37['order']=qs['sort'](_0x2031a9['query'][_0x34de('0xca')]);_0x137d37[_0x34de('0x41')]=qs[_0x34de('0x58')](_['pick'](_0x2031a9['query'],_0x4e2fe7['filters']));_0x137d37[_0x34de('0x41')]['UserId']=_0x340147['id'];if(_0x2031a9[_0x34de('0x42')][_0x34de('0x31')]){_0x137d37[_0x34de('0x41')]=_['merge'](_0x137d37[_0x34de('0x41')],{'$or':_[_0x34de('0x32')](_0x137d37['attributes'],function(_0x2a62f7){var _0x54eb83={};_0x54eb83[_0x2a62f7]={'$like':'%'+_0x2031a9[_0x34de('0x42')]['filter']+'%'};return _0x54eb83;})});}_0x137d37=_['merge']({},_0x137d37,_0x2031a9[_0x34de('0x5c')]);return db[_0x34de('0xda')][_0x34de('0x23')]({'where':_0x137d37[_0x34de('0x41')]})['then'](function(_0x45868a){_0x15f51e[_0x34de('0x23')]=_0x45868a;if(_0x2031a9[_0x34de('0x42')][_0x34de('0x43')]){_0x137d37[_0x34de('0x45')]=[{'all':!![]}];}return db[_0x34de('0xda')][_0x34de('0x49')](_0x137d37);})[_0x34de('0x15')](function(_0x107a3b){_0x15f51e[_0x34de('0x4a')]=_0x107a3b;return _0x15f51e;});}})[_0x34de('0x15')](respondWithFilteredResult(_0x2e954d,_0x137d37))[_0x34de('0x52')](handleError(_0x2e954d,null));};exports['getScreenRecordings']=function(_0x322d2e,_0x5c4bf0){var _0x146ced={'raw':!![],'where':{}};var _0x7dd10b={};var _0x3b92b3={'count':0x0,'rows':[]};return db[_0x34de('0x3a')][_0x34de('0x92')]({'where':{'id':_0x322d2e[_0x34de('0x61')]['id']}})[_0x34de('0x15')](handleEntityNotFound(_0x5c4bf0,null))[_0x34de('0x15')](function(_0x3a898e){if(_0x3a898e){_0x7dd10b[_0x34de('0x54')]=_[_0x34de('0x57')](db['ScreenRecording'][_0x34de('0x3b')]);_0x7dd10b['query']=_[_0x34de('0x57')](_0x322d2e[_0x34de('0x42')]);_0x7dd10b['filters']=_['intersection'](_0x7dd10b[_0x34de('0x54')],_0x7dd10b['query']);_0x146ced[_0x34de('0x47')]=_[_0x34de('0x59')](_0x7dd10b[_0x34de('0x54')],qs['fields'](_0x322d2e[_0x34de('0x42')][_0x34de('0x5a')]));_0x146ced['attributes']=_0x146ced[_0x34de('0x47')][_0x34de('0x4c')]?_0x146ced['attributes']:_0x7dd10b['model'];if(!_0x322d2e[_0x34de('0x42')][_0x34de('0xcd')](_0x34de('0xd4'))){_0x146ced['limit']=qs[_0x34de('0x25')](_0x322d2e[_0x34de('0x42')][_0x34de('0x25')]);_0x146ced[_0x34de('0x24')]=qs[_0x34de('0x24')](_0x322d2e[_0x34de('0x42')][_0x34de('0x24')]);}_0x146ced[_0x34de('0xc9')]=qs['sort'](_0x322d2e['query'][_0x34de('0xca')]);_0x146ced['where']=qs[_0x34de('0x58')](_[_0x34de('0xcb')](_0x322d2e['query'],_0x7dd10b[_0x34de('0x58')]));_0x146ced[_0x34de('0x41')][_0x34de('0xdb')]=_0x3a898e['id'];if(_0x322d2e['query'][_0x34de('0x31')]){_0x146ced[_0x34de('0x41')]=_[_0x34de('0xcc')](_0x146ced[_0x34de('0x41')],{'$or':_[_0x34de('0x32')](_0x146ced[_0x34de('0x47')],function(_0x5e5200){var _0x323e18={};_0x323e18[_0x5e5200]={'$like':'%'+_0x322d2e['query'][_0x34de('0x31')]+'%'};return _0x323e18;})});}_0x146ced=_[_0x34de('0xcc')]({},_0x146ced,_0x322d2e['options']);return db['ScreenRecording']['count']({'where':_0x146ced[_0x34de('0x41')]})[_0x34de('0x15')](function(_0x450f3e){_0x3b92b3[_0x34de('0x23')]=_0x450f3e;if(_0x322d2e['query'][_0x34de('0x43')]){_0x146ced[_0x34de('0x45')]=[{'all':!![]}];}return db[_0x34de('0xdc')][_0x34de('0x49')](_0x146ced);})[_0x34de('0x15')](function(_0x1cf24a){_0x3b92b3[_0x34de('0x4a')]=_0x1cf24a;return _0x3b92b3;});}})[_0x34de('0x15')](respondWithFilteredResult(_0x5c4bf0,_0x146ced))['catch'](handleError(_0x5c4bf0,null));};exports[_0x34de('0xdd')]=function(_0x274155,_0x43c6fb){var _0x16f05c={};var _0x5cdace={};var _0xeb4d3d;var _0x39630c;return db['User'][_0x34de('0x92')]({'where':{'id':_0x274155[_0x34de('0x61')]['id']}})[_0x34de('0x15')](handleEntityNotFound(_0x43c6fb,null))[_0x34de('0x15')](function(_0x660b36){if(_0x660b36){_0xeb4d3d=_0x660b36;_0x5cdace[_0x34de('0x54')]=_[_0x34de('0x57')](db['ChatInteraction'][_0x34de('0x3b')]);_0x5cdace[_0x34de('0x42')]=_[_0x34de('0x57')](_0x274155['query']);_0x5cdace[_0x34de('0x58')]=_[_0x34de('0x59')](_0x5cdace['model'],_0x5cdace['query']);_0x16f05c[_0x34de('0x47')]=_[_0x34de('0x59')](_0x5cdace['model'],qs['fields'](_0x274155['query'][_0x34de('0x5a')]));_0x16f05c[_0x34de('0x47')]=_0x16f05c[_0x34de('0x47')][_0x34de('0x4c')]?_0x16f05c[_0x34de('0x47')]:_0x5cdace[_0x34de('0x54')];_0x16f05c['order']=qs[_0x34de('0xca')](_0x274155[_0x34de('0x42')][_0x34de('0xca')]);_0x16f05c[_0x34de('0x41')]=qs[_0x34de('0x58')](_[_0x34de('0xcb')](_0x274155['query'],_0x5cdace[_0x34de('0x58')]));if(_0x274155[_0x34de('0x42')][_0x34de('0x31')]){_0x16f05c[_0x34de('0x41')]=_['merge'](_0x16f05c[_0x34de('0x41')],{'$or':_['map'](_0x16f05c[_0x34de('0x47')],function(_0xbb92f2){var _0x40bfb7={};_0x40bfb7[_0xbb92f2]={'$like':'%'+_0x274155['query']['filter']+'%'};return _0x40bfb7;})});}_0x16f05c=_[_0x34de('0xcc')]({},_0x16f05c,_0x274155['options']);return _0xeb4d3d[_0x34de('0xdd')](_0x16f05c);}})['then'](function(_0x4de8ea){if(_0x4de8ea){_0x39630c=_0x4de8ea[_0x34de('0x4c')];if(!_0x274155['query']['hasOwnProperty'](_0x34de('0xd4'))){_0x16f05c[_0x34de('0x25')]=qs[_0x34de('0x25')](_0x274155[_0x34de('0x42')][_0x34de('0x25')]);_0x16f05c[_0x34de('0x24')]=qs['offset'](_0x274155[_0x34de('0x42')][_0x34de('0x24')]);}return _0xeb4d3d[_0x34de('0xdd')](_0x16f05c);}})[_0x34de('0x15')](function(_0x1ad08c){if(_0x1ad08c){return _0x1ad08c?{'count':_0x39630c,'rows':_0x1ad08c}:null;}})[_0x34de('0x15')](respondWithResult(_0x43c6fb,null))['catch'](handleError(_0x43c6fb,null));};exports[_0x34de('0xde')]=function(_0xf0d88c,_0x257e4d){var _0xb85a9c={};var _0xe019cd={};var _0x13baf6;var _0x26f8f0;return db[_0x34de('0x3a')][_0x34de('0x92')]({'where':{'id':_0xf0d88c['params']['id']}})['then'](handleEntityNotFound(_0x257e4d,null))[_0x34de('0x15')](function(_0x37d42e){if(_0x37d42e){_0x13baf6=_0x37d42e;_0xe019cd[_0x34de('0x54')]=_[_0x34de('0x57')](db[_0x34de('0xdf')][_0x34de('0x3b')]);_0xe019cd[_0x34de('0x42')]=_[_0x34de('0x57')](_0xf0d88c[_0x34de('0x42')]);_0xe019cd[_0x34de('0x58')]=_[_0x34de('0x59')](_0xe019cd[_0x34de('0x54')],_0xe019cd['query']);_0xb85a9c['attributes']=_[_0x34de('0x59')](_0xe019cd['model'],qs[_0x34de('0x5a')](_0xf0d88c[_0x34de('0x42')]['fields']));_0xb85a9c[_0x34de('0x47')]=_0xb85a9c[_0x34de('0x47')][_0x34de('0x4c')]?_0xb85a9c[_0x34de('0x47')]:_0xe019cd['model'];_0xb85a9c['order']=qs[_0x34de('0xca')](_0xf0d88c[_0x34de('0x42')]['sort']);_0xb85a9c['where']=qs['filters'](_['pick'](_0xf0d88c[_0x34de('0x42')],_0xe019cd['filters']));if(_0xf0d88c['query'][_0x34de('0x31')]){_0xb85a9c[_0x34de('0x41')]=_[_0x34de('0xcc')](_0xb85a9c[_0x34de('0x41')],{'$or':_['map'](_0xb85a9c[_0x34de('0x47')],function(_0x549f91){var _0x5b10f3={};_0x5b10f3[_0x549f91]={'$like':'%'+_0xf0d88c[_0x34de('0x42')][_0x34de('0x31')]+'%'};return _0x5b10f3;})});}_0xb85a9c=_['merge']({},_0xb85a9c,_0xf0d88c[_0x34de('0x5c')]);return _0x13baf6[_0x34de('0xde')](_0xb85a9c);}})[_0x34de('0x15')](function(_0x5959a6){if(_0x5959a6){_0x26f8f0=_0x5959a6['length'];if(!_0xf0d88c[_0x34de('0x42')]['hasOwnProperty'](_0x34de('0xd4'))){_0xb85a9c[_0x34de('0x25')]=qs[_0x34de('0x25')](_0xf0d88c[_0x34de('0x42')]['limit']);_0xb85a9c[_0x34de('0x24')]=qs['offset'](_0xf0d88c[_0x34de('0x42')][_0x34de('0x24')]);}return _0x13baf6['getOpenchannelInteractions'](_0xb85a9c);}})['then'](function(_0x43e319){if(_0x43e319){return _0x43e319?{'count':_0x26f8f0,'rows':_0x43e319}:null;}})[_0x34de('0x15')](respondWithResult(_0x257e4d,null))[_0x34de('0x52')](handleError(_0x257e4d,null));};exports['getMailInteractions']=function(_0x58094f,_0x19efef){var _0x117ad7={'raw':!![],'where':{}};var _0x2036d4={};var _0x1f8253={'count':0x0,'rows':[]};return db[_0x34de('0x3a')][_0x34de('0x92')]({'where':{'id':_0x58094f[_0x34de('0x61')]['id']}})[_0x34de('0x15')](handleEntityNotFound(_0x19efef,null))[_0x34de('0x15')](function(_0x50a363){if(_0x50a363){_0x2036d4[_0x34de('0x54')]=_[_0x34de('0x57')](db['MailInteraction'][_0x34de('0x3b')]);_0x2036d4[_0x34de('0x42')]=_[_0x34de('0x57')](_0x58094f['query']);_0x2036d4[_0x34de('0x58')]=_['intersection'](_0x2036d4[_0x34de('0x54')],_0x2036d4[_0x34de('0x42')]);_0x117ad7[_0x34de('0x47')]=_['intersection'](_0x2036d4[_0x34de('0x54')],qs['fields'](_0x58094f[_0x34de('0x42')][_0x34de('0x5a')]));_0x117ad7[_0x34de('0x47')]=_0x117ad7[_0x34de('0x47')][_0x34de('0x4c')]?_0x117ad7[_0x34de('0x47')]:_0x2036d4['model'];if(!_0x58094f[_0x34de('0x42')][_0x34de('0xcd')](_0x34de('0xd4'))){_0x117ad7[_0x34de('0x25')]=qs[_0x34de('0x25')](_0x58094f['query'][_0x34de('0x25')]);_0x117ad7[_0x34de('0x24')]=qs[_0x34de('0x24')](_0x58094f[_0x34de('0x42')]['offset']);}_0x117ad7[_0x34de('0xc9')]=qs[_0x34de('0xca')](_0x58094f[_0x34de('0x42')][_0x34de('0xca')]);_0x117ad7['where']=qs[_0x34de('0x58')](_[_0x34de('0xcb')](_0x58094f[_0x34de('0x42')],_0x2036d4[_0x34de('0x58')]));_0x117ad7[_0x34de('0x41')][_0x34de('0xdb')]=_0x50a363['id'];if(_0x58094f[_0x34de('0x42')][_0x34de('0x31')]){_0x117ad7[_0x34de('0x41')]=_[_0x34de('0xcc')](_0x117ad7['where'],{'$or':_[_0x34de('0x32')](_0x117ad7[_0x34de('0x47')],function(_0x53d38c){var _0x46fc91={};_0x46fc91[_0x53d38c]={'$like':'%'+_0x58094f['query'][_0x34de('0x31')]+'%'};return _0x46fc91;})});}_0x117ad7=_[_0x34de('0xcc')]({},_0x117ad7,_0x58094f['options']);return db[_0x34de('0xe0')][_0x34de('0x23')]({'where':_0x117ad7[_0x34de('0x41')]})['then'](function(_0xb18cb8){_0x1f8253[_0x34de('0x23')]=_0xb18cb8;if(_0x58094f['query'][_0x34de('0x43')]){_0x117ad7[_0x34de('0x45')]=[{'all':!![]}];}return db[_0x34de('0xe0')][_0x34de('0x49')](_0x117ad7);})['then'](function(_0x207a4d){_0x1f8253['rows']=_0x207a4d;return _0x1f8253;});}})[_0x34de('0x15')](respondWithFilteredResult(_0x19efef,_0x117ad7))[_0x34de('0x52')](handleError(_0x19efef,null));};exports[_0x34de('0xe1')]=function(_0x371c77,_0x5b555f){var _0x21bebd={};var _0x128ebc={};var _0x131e05;var _0x27b326;return db[_0x34de('0x3a')][_0x34de('0x92')]({'where':{'id':_0x371c77[_0x34de('0x61')]['id']}})['then'](handleEntityNotFound(_0x5b555f,null))[_0x34de('0x15')](function(_0x278849){if(_0x278849){_0x131e05=_0x278849;_0x128ebc[_0x34de('0x54')]=_[_0x34de('0x57')](db[_0x34de('0xe2')][_0x34de('0x3b')]);_0x128ebc[_0x34de('0x42')]=_[_0x34de('0x57')](_0x371c77[_0x34de('0x42')]);_0x128ebc[_0x34de('0x58')]=_[_0x34de('0x59')](_0x128ebc['model'],_0x128ebc['query']);_0x21bebd[_0x34de('0x47')]=_[_0x34de('0x59')](_0x128ebc['model'],qs[_0x34de('0x5a')](_0x371c77[_0x34de('0x42')]['fields']));_0x21bebd[_0x34de('0x47')]=_0x21bebd[_0x34de('0x47')]['length']?_0x21bebd[_0x34de('0x47')]:_0x128ebc[_0x34de('0x54')];_0x21bebd[_0x34de('0xc9')]=qs[_0x34de('0xca')](_0x371c77['query'][_0x34de('0xca')]);_0x21bebd[_0x34de('0x41')]=qs[_0x34de('0x58')](_['pick'](_0x371c77['query'],_0x128ebc[_0x34de('0x58')]));if(_0x371c77['query']['filter']){_0x21bebd[_0x34de('0x41')]=_[_0x34de('0xcc')](_0x21bebd[_0x34de('0x41')],{'$or':_['map'](_0x21bebd[_0x34de('0x47')],function(_0x325242){var _0x2273bf={};_0x2273bf[_0x325242]={'$like':'%'+_0x371c77['query']['filter']+'%'};return _0x2273bf;})});}_0x21bebd=_[_0x34de('0xcc')]({},_0x21bebd,_0x371c77[_0x34de('0x5c')]);return _0x131e05[_0x34de('0xe1')](_0x21bebd);}})[_0x34de('0x15')](function(_0x55789e){if(_0x55789e){_0x27b326=_0x55789e[_0x34de('0x4c')];if(!_0x371c77[_0x34de('0x42')][_0x34de('0xcd')](_0x34de('0xd4'))){_0x21bebd[_0x34de('0x25')]=qs[_0x34de('0x25')](_0x371c77[_0x34de('0x42')][_0x34de('0x25')]);_0x21bebd[_0x34de('0x24')]=qs[_0x34de('0x24')](_0x371c77[_0x34de('0x42')][_0x34de('0x24')]);}return _0x131e05['getSmsInteractions'](_0x21bebd);}})[_0x34de('0x15')](function(_0x51cc48){if(_0x51cc48){return _0x51cc48?{'count':_0x27b326,'rows':_0x51cc48}:null;}})[_0x34de('0x15')](respondWithResult(_0x5b555f,null))[_0x34de('0x52')](handleError(_0x5b555f,null));};exports[_0x34de('0xe3')]=function(_0x25e9dd,_0x23127c){var _0x188c6f={};var _0x2fd1cd={};var _0x4bcf58;var _0xa6cd6e;return db[_0x34de('0x3a')][_0x34de('0x92')]({'where':{'id':_0x25e9dd[_0x34de('0x61')]['id']}})[_0x34de('0x15')](handleEntityNotFound(_0x23127c,null))[_0x34de('0x15')](function(_0x2d9036){if(_0x2d9036){_0x4bcf58=_0x2d9036;_0x2fd1cd[_0x34de('0x54')]=_['keys'](db[_0x34de('0xe4')][_0x34de('0x3b')]);_0x2fd1cd[_0x34de('0x42')]=_[_0x34de('0x57')](_0x25e9dd[_0x34de('0x42')]);_0x2fd1cd[_0x34de('0x58')]=_[_0x34de('0x59')](_0x2fd1cd[_0x34de('0x54')],_0x2fd1cd[_0x34de('0x42')]);_0x188c6f[_0x34de('0x47')]=_[_0x34de('0x59')](_0x2fd1cd[_0x34de('0x54')],qs[_0x34de('0x5a')](_0x25e9dd[_0x34de('0x42')][_0x34de('0x5a')]));_0x188c6f[_0x34de('0x47')]=_0x188c6f[_0x34de('0x47')]['length']?_0x188c6f[_0x34de('0x47')]:_0x2fd1cd[_0x34de('0x54')];_0x188c6f[_0x34de('0xc9')]=qs[_0x34de('0xca')](_0x25e9dd[_0x34de('0x42')][_0x34de('0xca')]);_0x188c6f[_0x34de('0x41')]=qs['filters'](_[_0x34de('0xcb')](_0x25e9dd[_0x34de('0x42')],_0x2fd1cd[_0x34de('0x58')]));if(_0x25e9dd[_0x34de('0x42')][_0x34de('0x31')]){_0x188c6f[_0x34de('0x41')]=_[_0x34de('0xcc')](_0x188c6f['where'],{'$or':_[_0x34de('0x32')](_0x188c6f[_0x34de('0x47')],function(_0x171d96){var _0x287230={};_0x287230[_0x171d96]={'$like':'%'+_0x25e9dd[_0x34de('0x42')][_0x34de('0x31')]+'%'};return _0x287230;})});}_0x188c6f=_[_0x34de('0xcc')]({},_0x188c6f,_0x25e9dd['options']);return _0x4bcf58[_0x34de('0xe3')](_0x188c6f);}})[_0x34de('0x15')](function(_0x1d6295){if(_0x1d6295){_0xa6cd6e=_0x1d6295[_0x34de('0x4c')];if(!_0x25e9dd['query']['hasOwnProperty'](_0x34de('0xd4'))){_0x188c6f['limit']=qs['limit'](_0x25e9dd[_0x34de('0x42')]['limit']);_0x188c6f[_0x34de('0x24')]=qs[_0x34de('0x24')](_0x25e9dd[_0x34de('0x42')][_0x34de('0x24')]);}return _0x4bcf58[_0x34de('0xe3')](_0x188c6f);}})['then'](function(_0xf359c6){if(_0xf359c6){return _0xf359c6?{'count':_0xa6cd6e,'rows':_0xf359c6}:null;}})[_0x34de('0x15')](respondWithResult(_0x23127c,null))[_0x34de('0x52')](handleError(_0x23127c,null));};exports[_0x34de('0xe5')]=function(_0x1e898a,_0x4e3a30){var _0x2dc30e={};var _0x2756c6={};var _0x5f2aad;var _0xa882e4;return db[_0x34de('0x3a')][_0x34de('0x92')]({'where':{'id':_0x1e898a[_0x34de('0x61')]['id']}})['then'](handleEntityNotFound(_0x4e3a30,null))[_0x34de('0x15')](function(_0x37b8f4){if(_0x37b8f4){_0x5f2aad=_0x37b8f4;_0x2756c6['model']=_[_0x34de('0x57')](db[_0x34de('0xe6')][_0x34de('0x3b')]);_0x2756c6['query']=_[_0x34de('0x57')](_0x1e898a['query']);_0x2756c6[_0x34de('0x58')]=_['intersection'](_0x2756c6[_0x34de('0x54')],_0x2756c6['query']);_0x2dc30e[_0x34de('0x47')]=_[_0x34de('0x59')](_0x2756c6[_0x34de('0x54')],qs[_0x34de('0x5a')](_0x1e898a[_0x34de('0x42')][_0x34de('0x5a')]));_0x2dc30e[_0x34de('0x47')]=_0x2dc30e[_0x34de('0x47')][_0x34de('0x4c')]?_0x2dc30e[_0x34de('0x47')]:_0x2756c6[_0x34de('0x54')];_0x2dc30e[_0x34de('0xc9')]=qs[_0x34de('0xca')](_0x1e898a['query']['sort']);_0x2dc30e[_0x34de('0x41')]=qs['filters'](_[_0x34de('0xcb')](_0x1e898a[_0x34de('0x42')],_0x2756c6[_0x34de('0x58')]));if(_0x1e898a['query'][_0x34de('0x31')]){_0x2dc30e['where']=_[_0x34de('0xcc')](_0x2dc30e['where'],{'$or':_[_0x34de('0x32')](_0x2dc30e[_0x34de('0x47')],function(_0x542d1f){var _0xc9d28e={};_0xc9d28e[_0x542d1f]={'$like':'%'+_0x1e898a[_0x34de('0x42')][_0x34de('0x31')]+'%'};return _0xc9d28e;})});}_0x2dc30e=_[_0x34de('0xcc')]({},_0x2dc30e,_0x1e898a[_0x34de('0x5c')]);return _0x5f2aad[_0x34de('0xe5')](_0x2dc30e);}})[_0x34de('0x15')](function(_0x3d2071){if(_0x3d2071){_0xa882e4=_0x3d2071['length'];if(!_0x1e898a[_0x34de('0x42')][_0x34de('0xcd')](_0x34de('0xd4'))){_0x2dc30e[_0x34de('0x25')]=qs[_0x34de('0x25')](_0x1e898a[_0x34de('0x42')][_0x34de('0x25')]);_0x2dc30e[_0x34de('0x24')]=qs['offset'](_0x1e898a[_0x34de('0x42')][_0x34de('0x24')]);}return _0x5f2aad['getWhatsappInteractions'](_0x2dc30e);}})[_0x34de('0x15')](function(_0xffe68){if(_0xffe68){return _0xffe68?{'count':_0xa882e4,'rows':_0xffe68}:null;}})['then'](respondWithResult(_0x4e3a30,null))['catch'](handleError(_0x4e3a30,null));};exports[_0x34de('0xe7')]=function(_0x5aa325,_0x46948a,_0x219a6a){var _0x13ab62;var _0x19e89a;var _0x5d8ae4;var _0x5c7274=!_['isNil'](_0x5aa325[_0x34de('0x61')]['id'])?_0x5aa325[_0x34de('0x61')]['id']:!_[_0x34de('0x67')](_0x5aa325[_0x34de('0x7a')]['id'])?_0x5aa325[_0x34de('0x7a')]['id']:null;return db[_0x34de('0x3a')][_0x34de('0x34')]({'where':{'id':_0x5c7274,'role':{'$or':['admin',_0x34de('0x7a'),'agent']}},'attributes':['id',_0x34de('0x35'),_0x34de('0xe8'),'mobile',_0x34de('0x29'),_0x34de('0x66'),_0x34de('0xe9')]})[_0x34de('0x15')](function(_0x41303d){if(_0x41303d){if(_0x41303d[_0x34de('0x29')]===_0x34de('0x2a')){_0x13ab62=_0x41303d;if(_0x5aa325[_0x34de('0x5e')]['interface']){_0x5d8ae4=util['format'](_0x34de('0xea'),_0x13ab62[_0x5aa325[_0x34de('0x5e')][_0x34de('0x9c')]]);}else if(_0x5aa325['body']['intrf']){_0x5d8ae4=util['format'](_0x34de('0xaa'),_0x5aa325[_0x34de('0x5e')]['intrf']);}else{_0x5d8ae4=util[_0x34de('0xa9')](_0x34de('0xaa'),_0x13ab62[_0x34de('0x35')]);}socket['to'](util['format']('user:%s',_0x13ab62['name']))[_0x34de('0x2b')]('user:forcelogout',{'user':{'id':_0x13ab62['id'],'name':_0x13ab62['name']},'ip':_0x5aa325[_0x34de('0xeb')]['x-forwarded-for']||_0x5aa325['connection'][_0x34de('0xec')]||_0x5aa325['socket'][_0x34de('0xec')]||_0x5aa325['connection'][_0x34de('0xed')][_0x34de('0xec')]});return db[_0x34de('0xac')][_0x34de('0x2c')]({'where':{'membername':_0x13ab62['name']},'individualHooks':!![]});}}else{throw new db[(_0x34de('0x8f'))][(_0x34de('0x90'))](_0x34de('0xee'));}})['then'](function(){if(_0x13ab62){return _0x13ab62[_0x34de('0xef')]({'raw':!![]});}})[_0x34de('0x15')](function(_0x3d2fb1){if(_0x13ab62){if(_0x3d2fb1){_0x19e89a=_0x3d2fb1;if(_0x19e89a['length']){var _0x4a5447=_0x19e89a['map'](function(_0x446f0f){var _0x4225fd={'membername':_0x13ab62[_0x34de('0x35')],'UserId':_0x13ab62['id'],'queue_name':_0x446f0f['name'],'VoiceQueueId':_0x446f0f['id'],'interface':_0x5d8ae4,'paused':_0x13ab62['loginInPause']||![],'penalty':_0x446f0f[_0x34de('0xf0')]||0x0};return db['UserVoiceQueueRt']['upsert'](_0x4225fd);});return Promise['all'](_0x4a5447);}}}})[_0x34de('0x15')](function(){if(_0x13ab62){return db['MemberReport'][_0x34de('0x49')]({'where':{'membername':_0x13ab62['name'],'exitAt':null}});}})[_0x34de('0x15')](function(_0x1a3910){if(_0x13ab62){var _0x113c58=[];_0x1a3910[_0x34de('0xf1')](function(_0x12d98d){_0x113c58[_0x34de('0x48')](_0x12d98d['update']({'exitAt':moment()[_0x34de('0xa9')](_0x34de('0xf2'))}));});return Promise[_0x34de('0x51')](_0x113c58);}})[_0x34de('0x15')](function(){if(_0x13ab62){var _0x112d8f=[];var _0x56b36f=[];var _0x4ba214=utils[_0x34de('0xf3')]();var _0x1848e3={'membername':_0x13ab62['name'],'interface':_0x5d8ae4,'enterAt':moment()[_0x34de('0xa9')](_0x34de('0xf2')),'role':_0x13ab62[_0x34de('0x29')],'internal':_0x13ab62[_0x34de('0x66')]};_0x4ba214['forEach'](function(_0x49c475){_0x112d8f[_0x34de('0x48')](_[_0x34de('0xcc')]({'channel':_0x49c475,'type':'LOGIN','data1':_0x5aa325[_0x34de('0x5e')][_0x34de('0xf4')],'data2':_0x5d8ae4},_0x1848e3));if(_0x13ab62[_0x34de('0xe9')]){_0x56b36f[_0x34de('0x48')](_[_0x34de('0xcc')]({'channel':_0x49c475,'type':'PAUSE','data1':_0x34de('0xf5')},_0x1848e3));}});return db[_0x34de('0xf6')][_0x34de('0x85')](_0x112d8f[_0x34de('0xf7')](_0x56b36f),{'individualHooks':!![]});}})['then'](function(){if(_0x13ab62){return _0x13ab62[_0x34de('0x28')]({'online':!![],'lastLoginAt':moment()['format'](_0x34de('0xf2')),'voicePause':_0x13ab62[_0x34de('0xe9')]||![],'mailPause':_0x13ab62[_0x34de('0xe9')]||![],'chatPause':_0x13ab62[_0x34de('0xe9')]||![],'faxPause':_0x13ab62[_0x34de('0xe9')]||![],'smsPause':_0x13ab62['loginInPause']||![],'openchannelPause':_0x13ab62[_0x34de('0xe9')]||![],'whatsappPause':_0x13ab62[_0x34de('0xe9')]||![],'pauseType':_0x13ab62[_0x34de('0xe9')]?_0x34de('0xf5'):null,'interface':_0x5d8ae4,'lastPauseAt':moment()[_0x34de('0xa9')](_0x34de('0xf2'))});}})['then'](function(_0x2a3980){if(_0x5aa325[_0x34de('0xf8')]){return _0x219a6a();}else{return Promise[_0x34de('0xf9')](_0x2a3980)[_0x34de('0x15')](respondWithResult(_0x46948a,null));}})[_0x34de('0x52')](handleError(_0x46948a,null));};exports['logout']=function(_0x237d40,_0x4a7a66){var _0x3fceeb;return db[_0x34de('0x3a')]['find']({'where':{'id':_0x237d40[_0x34de('0x61')]['id'],'role':_0x34de('0x2a')},'attributes':['id',_0x34de('0x35'),_0x34de('0x29')]})[_0x34de('0x15')](handleEntityNotFound(_0x4a7a66,null))[_0x34de('0x15')](function(_0x37c1bc){if(_0x37c1bc){_0x3fceeb=_0x37c1bc;return db['UserVoiceQueueRt'][_0x34de('0x2c')]({'where':{'membername':_0x3fceeb[_0x34de('0x35')]},'individualHooks':!![]});}})[_0x34de('0x15')](function(){return db['MemberReport'][_0x34de('0x49')]({'where':{'membername':_0x3fceeb[_0x34de('0x35')],'exitAt':null}});})[_0x34de('0x15')](function(_0x3c5ff0){var _0x1ea011=[];_0x3c5ff0[_0x34de('0xf1')](function(_0xf80933){_0x1ea011[_0x34de('0x48')](_0xf80933[_0x34de('0x28')]({'exitAt':moment()['format'](_0x34de('0xf2'))}));});return Promise[_0x34de('0x51')](_0x1ea011);})[_0x34de('0x15')](function(){return _0x3fceeb[_0x34de('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x34de('0x15')](respondWithResult(_0x4a7a66,null))[_0x34de('0x52')](handleError(_0x4a7a66,null));};exports['pause']=function(_0x267df8,_0x4a7213){var _0x2c7cca;return db[_0x34de('0xac')][_0x34de('0x28')]({'paused':0x1},{'where':{'UserId':_0x267df8[_0x34de('0x61')]['id']},'individualHooks':!![]})[_0x34de('0x15')](function(){return db[_0x34de('0x3a')][_0x34de('0x34')]({'where':{'id':_0x267df8[_0x34de('0x61')]['id'],'role':_0x34de('0x2a')},'attributes':['id','name',_0x34de('0x29'),'internal','interface',_0x34de('0x9b')]});})[_0x34de('0x15')](handleEntityNotFound(_0x4a7213,null))[_0x34de('0x15')](function(_0x22ffda){if(_0x22ffda){_0x2c7cca=_0x22ffda;return respondWithRpcPromise(_0x34de('0xfa'),_0x34de('0xfb'),{'id':_0x2c7cca['id'],'name':_0x2c7cca[_0x34de('0x35')],'pause':!![]});}})[_0x34de('0x15')](function(){if(_0x2c7cca){return db[_0x34de('0xf6')]['findAll']({'where':{'membername':_0x2c7cca['name'],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x5b06c1){if(_0x5b06c1['length']){var _0x9d50fc=moment()[_0x34de('0xa9')](_0x34de('0xf2'));for(var _0x4c1d3c=0x0,_0x1a620d=_0x5b06c1[_0x34de('0x4c')];_0x4c1d3c<_0x1a620d;_0x4c1d3c++){_0x5b06c1[_0x4c1d3c][_0x34de('0xfc')]({'exitAt':_0x9d50fc});}}})[_0x34de('0x15')](function(){var _0x255812=[];var _0x23a183=utils[_0x34de('0xf3')]();_0x23a183['forEach'](function(_0x956641){_0x255812[_0x34de('0x48')]({'channel':_0x956641,'membername':_0x2c7cca[_0x34de('0x35')],'interface':_['isNil'](_0x2c7cca[_0x34de('0x9c')])?util[_0x34de('0xa9')]('SIP/%s',_0x2c7cca[_0x34de('0x35')]):_0x2c7cca['interface'],'type':_0x34de('0xfd'),'enterAt':moment()[_0x34de('0xa9')](_0x34de('0xf2')),'data1':_0x267df8[_0x34de('0x5e')][_0x34de('0xfe')]||_0x34de('0xff'),'role':_0x2c7cca[_0x34de('0x29')],'internal':_0x2c7cca[_0x34de('0x66')]});});return db[_0x34de('0xf6')][_0x34de('0x85')](_0x255812,{'individualHooks':!![]});})[_0x34de('0x15')](function(){return _0x2c7cca[_0x34de('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x267df8[_0x34de('0x5e')]['type']||_0x34de('0xff'),'lastPauseAt':moment()[_0x34de('0xa9')](_0x34de('0xf2'))});})[_0x34de('0x15')](respondWithResult(_0x4a7213,null))[_0x34de('0x52')](handleError(_0x4a7213,null));};exports[_0x34de('0x100')]=function(_0x346fc9,_0x5c9503){if(_0x346fc9[_0x34de('0x5e')][_0x34de('0x9a')]&&!utils[_0x34de('0x9d')](_0x346fc9[_0x34de('0x5e')][_0x34de('0x9a')])){throw new APIBadRequestError(util[_0x34de('0xa9')](_0x34de('0x101'),_0x346fc9['body'][_0x34de('0x9a')]));}return db[_0x34de('0x3a')]['find']({'where':{'id':_0x346fc9[_0x34de('0x61')]['id']},'attributes':['id',_0x34de('0x35'),_0x34de('0x29'),_0x34de('0x66'),'interface',_0x34de('0x9b'),_0x34de('0xab'),_0x34de('0x102'),_0x34de('0x103'),'faxPause',_0x34de('0x104'),_0x34de('0x105'),_0x34de('0x106'),_0x34de('0x107'),_0x34de('0x108')]})['then'](function(_0x5127cb){if(!_0x5127cb){throw new APINotFoundError(util[_0x34de('0xa9')](_0x34de('0x109'),_0x346fc9[_0x34de('0x61')]['id']));}return _0x5127cb['unpause'](_0x346fc9[_0x34de('0x5e')]['channel']);})[_0x34de('0x15')](respondWithResult(_0x5c9503,null))[_0x34de('0x52')](APIHandleError(_0x5c9503));};exports[_0x34de('0x10a')]=function(_0x580c04,_0x20ea7f){var _0x5eff38={};var _0x2c8590={};var _0x4ca034;var _0x557e87;return db[_0x34de('0x3a')]['findOne']({'where':{'id':_0x580c04[_0x34de('0x61')]['id']}})['then'](handleEntityNotFound(_0x20ea7f,null))[_0x34de('0x15')](function(_0x402ab2){if(_0x402ab2){_0x4ca034=_0x402ab2;_0x2c8590[_0x34de('0x54')]=_[_0x34de('0x57')](db[_0x34de('0x10b')][_0x34de('0x3b')]);_0x2c8590[_0x34de('0x42')]=_[_0x34de('0x57')](_0x580c04[_0x34de('0x42')]);_0x2c8590[_0x34de('0x58')]=_[_0x34de('0x59')](_0x2c8590[_0x34de('0x54')],_0x2c8590[_0x34de('0x42')]);_0x5eff38[_0x34de('0x47')]=_[_0x34de('0x59')](_0x2c8590[_0x34de('0x54')],qs[_0x34de('0x5a')](_0x580c04[_0x34de('0x42')][_0x34de('0x5a')]));_0x5eff38['attributes']=_0x5eff38['attributes'][_0x34de('0x4c')]?_0x5eff38[_0x34de('0x47')]:_0x2c8590[_0x34de('0x54')];_0x5eff38['order']=qs['sort'](_0x580c04[_0x34de('0x42')][_0x34de('0xca')]);_0x5eff38[_0x34de('0x41')]=qs[_0x34de('0x58')](_[_0x34de('0xcb')](_0x580c04[_0x34de('0x42')],_0x2c8590['filters']));if(_0x580c04[_0x34de('0x42')][_0x34de('0x31')]){_0x5eff38['where']=_[_0x34de('0xcc')](_0x5eff38[_0x34de('0x41')],{'$or':_[_0x34de('0x32')](_0x5eff38[_0x34de('0x47')],function(_0x315dcb){var _0xdb5326={};_0xdb5326[_0x315dcb]={'$like':'%'+_0x580c04[_0x34de('0x42')][_0x34de('0x31')]+'%'};return _0xdb5326;})});}_0x5eff38=_[_0x34de('0xcc')]({},_0x5eff38,_0x580c04[_0x34de('0x5c')]);return _0x4ca034[_0x34de('0x10a')](_0x5eff38);}})['then'](function(_0x48d5ed){if(_0x48d5ed){_0x557e87=_0x48d5ed[_0x34de('0x4c')];if(!_0x580c04[_0x34de('0x42')][_0x34de('0xcd')]('nolimit')){_0x5eff38[_0x34de('0x25')]=qs[_0x34de('0x25')](_0x580c04[_0x34de('0x42')][_0x34de('0x25')]);_0x5eff38['offset']=qs[_0x34de('0x24')](_0x580c04[_0x34de('0x42')][_0x34de('0x24')]);}return _0x4ca034[_0x34de('0x10a')](_0x5eff38);}})[_0x34de('0x15')](function(_0x326b3a){if(_0x326b3a){return _0x326b3a?{'count':_0x557e87,'rows':_0x326b3a}:null;}})[_0x34de('0x15')](respondWithResult(_0x20ea7f,null))[_0x34de('0x52')](handleError(_0x20ea7f,null));};exports[_0x34de('0x10c')]=function(_0x428e76,_0x266eb8){var _0x8f1ed1=_0x428e76[_0x34de('0x61')]['id'];var _0x2c3f42=_0x428e76[_0x34de('0x5e')]?_0x428e76[_0x34de('0x5e')]['ids']:null;var _0x5d78e0=[];return Promise[_0x34de('0xf9')]()[_0x34de('0x15')](function(){if(!_0x2c3f42)throw new APIBadRequestError(_0x34de('0x10d'));})[_0x34de('0x15')](function(){return db[_0x34de('0x3a')][_0x34de('0x92')]({'where':{'id':_0x8f1ed1}});})[_0x34de('0x15')](function(_0x4c2e51){if(!_0x4c2e51)throw new APINotFoundError(util[_0x34de('0xa9')](_0x34de('0x109'),_0x428e76[_0x34de('0x61')]['id']));return db['sequelize'][_0x34de('0x10e')](function(_0xe4535c){return _0x4c2e51[_0x34de('0x10c')](_0x2c3f42,{'transaction':_0xe4535c})['then'](function(){return db['Team'][_0x34de('0x49')]({'where':{'id':{'$in':_0x2c3f42}}});})[_0x34de('0x15')](function(_0x55bc9f){var _0x3539e9=_['map'](_0x55bc9f,function(_0xe9427a){return _0xe9427a['getAssociatedQueues']();});return Promise[_0x34de('0x51')](_0x3539e9);})[_0x34de('0x15')](function(_0x527d27){_0x5d78e0=_['flattenDeep'](_0x527d27);var _0x53e8f1=_[_0x34de('0x32')](_0x5d78e0,function(_0x11c581){return _0x11c581[_0x34de('0x10f')](_0x4c2e51['id'],{'transaction':_0xe4535c});});return Promise[_0x34de('0x51')](_0x53e8f1);})['then'](function(){if(!_0x4c2e51['online'])return;var _0x18577f=_[_0x34de('0x31')](_0x5d78e0,function(_0x4fd476){return _0x4fd476['getDataValue'](_0x34de('0x9a'))===_0x34de('0x110');});var _0x9776c4=_[_0x34de('0x32')](_0x18577f,function(_0x470077){return db['UserVoiceQueueRt'][_0x34de('0xad')]({'membername':_0x4c2e51[_0x34de('0x35')],'UserId':_0x4c2e51['id'],'queue_name':_0x470077['name'],'VoiceQueueId':_0x470077['id'],'interface':_[_0x34de('0x67')](_0x4c2e51['interface'])?util[_0x34de('0xa9')](_0x34de('0xaa'),_0x4c2e51[_0x34de('0x35')]):_0x4c2e51[_0x34de('0x9c')],'paused':_0x4c2e51[_0x34de('0xab')]||![],'penalty':_0x4c2e51['penalty']},{'transaction':_0xe4535c});});return Promise[_0x34de('0x51')](_0x9776c4);})[_0x34de('0x15')](function(){return db['TeamVoicePrefix'][_0x34de('0x49')]({'where':{'teamId':{'$in':_0x2c3f42}}});})['then'](function(_0x5fdb21){var _0x407abd=_[_0x34de('0x32')](_0x5fdb21,function(_0x40679f){return db[_0x34de('0x111')][_0x34de('0x78')]({'UserId':_0x4c2e51['id'],'VoicePrefixId':_0x40679f[_0x34de('0x112')]},{'transaction':_0xe4535c});});return Promise[_0x34de('0x51')](_0x407abd);});});})[_0x34de('0x15')](function(){for(var _0x4abd09=0x0;_0x4abd09<_0x5d78e0[_0x34de('0x4c')];_0x4abd09++){var _0x14acbb=_0x5d78e0[_0x4abd09]['getDataValue']('channel');var _0x3bdc78=_0x14acbb+_0x34de('0xa5');socket[_0x34de('0x2b')](_0x34de('0x7a')+_0x14acbb+_0x34de('0xa6'),{'UserId':_0x8f1ed1,['queueField']:_0x5d78e0[_0x4abd09]['id']});}})[_0x34de('0x15')](respondWithStatusCode(_0x266eb8,null))['catch'](APIHandleError(_0x266eb8));};exports['removeTeams']=function(_0x3a3891,_0x5f3528){var _0x2035a3=_0x3a3891['params']['id'];var _0x1e523f=null;if(_0x3a3891['query'][_0x34de('0x62')]){_0x1e523f=_[_0x34de('0xb0')](_0x3a3891[_0x34de('0x42')][_0x34de('0x62')])?_0x3a3891['query'][_0x34de('0x62')]:[_0x3a3891[_0x34de('0x42')][_0x34de('0x62')]];}var _0x2fdf71=[];return Promise[_0x34de('0xf9')]()[_0x34de('0x15')](function(){if(!_0x1e523f)throw new APIBadRequestError(_0x34de('0x113'));})[_0x34de('0x15')](function(){return db[_0x34de('0x3a')][_0x34de('0x92')]({'where':{'id':_0x2035a3}});})[_0x34de('0x15')](function(_0x30b038){if(!_0x30b038)throw new APINotFoundError(util[_0x34de('0xa9')]('User\x20with\x20id\x20%s\x20not\x20found',_0x3a3891[_0x34de('0x61')]['id']));return db[_0x34de('0x69')][_0x34de('0x10e')](function(_0x2a3106){return _0x30b038[_0x34de('0x114')](_0x1e523f,{'transaction':_0x2a3106})[_0x34de('0x15')](function(){return db[_0x34de('0x10b')]['findAll']({'where':{'id':{'$in':_0x1e523f}}});})[_0x34de('0x15')](function(_0xd0807b){var _0x403e17=_[_0x34de('0x32')](_0xd0807b,function(_0x3fed9b){return _0x3fed9b['getAssociatedQueues']();});return Promise[_0x34de('0x51')](_0x403e17);})[_0x34de('0x15')](function(_0x52547a){_0x2fdf71=_['flattenDeep'](_0x52547a);var _0x58685d=_[_0x34de('0x32')](_0x2fdf71,function(_0x15a147){return _0x15a147[_0x34de('0x115')](_0x30b038['id'],{'transaction':_0x2a3106});});return Promise[_0x34de('0x51')](_0x58685d);})[_0x34de('0x15')](function(){if(!_0x30b038[_0x34de('0x9b')])return;var _0x34f998=_[_0x34de('0x31')](_0x2fdf71,function(_0x132bb3){return _0x132bb3[_0x34de('0x116')]('channel')==='Voice';});var _0x32c24e=_[_0x34de('0x32')](_0x34f998,function(_0x183461){return db['UserVoiceQueueRt'][_0x34de('0x2c')]({'where':{'VoiceQueueId':_0x183461['id'],'UserId':_0x30b038['id']},'transaction':_0x2a3106});});return Promise['all'](_0x32c24e);})[_0x34de('0x15')](function(){return db[_0x34de('0x117')][_0x34de('0x49')]({'where':{'teamId':{'$in':_0x1e523f}}});})['then'](function(_0x369084){var _0x31a8f0=_[_0x34de('0x32')](_0x369084,function(_0x11de8c){return db[_0x34de('0x111')]['destroy']({'where':{'UserId':_0x30b038['id'],'VoicePrefixId':_0x11de8c[_0x34de('0x112')]}},{'transaction':_0x2a3106});});return Promise[_0x34de('0x51')](_0x31a8f0);});});})['then'](function(){for(var _0x47ce5e=0x0;_0x47ce5e<_0x2fdf71[_0x34de('0x4c')];_0x47ce5e++){var _0x1767b0=_0x2fdf71[_0x47ce5e][_0x34de('0x116')]('channel');var _0x2df731=_0x1767b0+'QueueId';socket[_0x34de('0x2b')](_0x34de('0x7a')+_0x1767b0+_0x34de('0xb1'),{'UserId':_0x2035a3,['queueField']:_0x2fdf71[_0x47ce5e]['id']});}})['then'](respondWithStatusCode(_0x5f3528,null))[_0x34de('0x52')](APIHandleError(_0x5f3528));};exports[_0x34de('0x118')]=function(_0x313d34,_0x49b51e){var _0x4ab301={};var _0x4b4cef={};var _0x1469cc;var _0x41cadc;return db[_0x34de('0x3a')]['findOne']({'where':{'id':_0x313d34[_0x34de('0x61')]['id']}})['then'](handleEntityNotFound(_0x49b51e,null))[_0x34de('0x15')](function(_0x2f07cb){if(_0x2f07cb){_0x1469cc=_0x2f07cb;_0x4b4cef[_0x34de('0x54')]=_['keys'](db[_0x34de('0xce')][_0x34de('0x3b')]);_0x4b4cef[_0x34de('0x42')]=_[_0x34de('0x57')](_0x313d34[_0x34de('0x42')]);_0x4b4cef[_0x34de('0x58')]=_[_0x34de('0x59')](_0x4b4cef[_0x34de('0x54')],_0x4b4cef[_0x34de('0x42')]);_0x4ab301[_0x34de('0x47')]=_[_0x34de('0x59')](_0x4b4cef[_0x34de('0x54')],qs[_0x34de('0x5a')](_0x313d34[_0x34de('0x42')]['fields']));_0x4ab301[_0x34de('0x47')]=_0x4ab301[_0x34de('0x47')][_0x34de('0x4c')]?_0x4ab301[_0x34de('0x47')]:_0x4b4cef['model'];_0x4ab301[_0x34de('0xc9')]=qs[_0x34de('0xca')](_0x313d34[_0x34de('0x42')][_0x34de('0xca')]);_0x4ab301[_0x34de('0x41')]=qs[_0x34de('0x58')](_[_0x34de('0xcb')](_0x313d34[_0x34de('0x42')],_0x4b4cef['filters']));if(_0x313d34[_0x34de('0x42')][_0x34de('0x31')]){_0x4ab301['where']=_[_0x34de('0xcc')](_0x4ab301['where'],{'$or':_[_0x34de('0x32')](_0x4ab301[_0x34de('0x47')],function(_0x36c2fb){var _0x3237ee={};_0x3237ee[_0x36c2fb]={'$like':'%'+_0x313d34[_0x34de('0x42')][_0x34de('0x31')]+'%'};return _0x3237ee;})});}_0x4ab301=_[_0x34de('0xcc')]({},_0x4ab301,_0x313d34[_0x34de('0x5c')]);return _0x1469cc[_0x34de('0x118')](_0x4ab301);}})[_0x34de('0x15')](function(_0x176d3d){if(_0x176d3d){_0x41cadc=_0x176d3d[_0x34de('0x4c')];if(!_0x313d34[_0x34de('0x42')][_0x34de('0xcd')](_0x34de('0xd4'))){_0x4ab301[_0x34de('0x25')]=qs[_0x34de('0x25')](_0x313d34[_0x34de('0x42')][_0x34de('0x25')]);_0x4ab301[_0x34de('0x24')]=qs['offset'](_0x313d34[_0x34de('0x42')][_0x34de('0x24')]);}return _0x1469cc['getLists'](_0x4ab301);}})[_0x34de('0x15')](function(_0x4e3494){if(_0x4e3494){return _0x4e3494?{'count':_0x41cadc,'rows':_0x4e3494}:null;}})[_0x34de('0x15')](respondWithResult(_0x49b51e,null))[_0x34de('0x52')](handleError(_0x49b51e,null));};exports[_0x34de('0x119')]=function(_0x2bd0fd,_0x486413){var _0x2590e7={};var _0x55f400={};var _0x35f099;return db['User'][_0x34de('0x92')]({'where':{'id':_0x2bd0fd[_0x34de('0x61')]['id']}})[_0x34de('0x15')](handleEntityNotFound(_0x486413,null))[_0x34de('0x15')](function(_0x201a99){if(_0x201a99){_0x35f099=_0x201a99;_0x55f400['model']=_[_0x34de('0x57')](db[_0x34de('0x3a')]['rawAttributes']);_0x55f400['query']=_['keys'](_0x2bd0fd[_0x34de('0x42')]);_0x55f400['filters']=_['intersection'](_0x55f400[_0x34de('0x54')],_0x55f400['query']);_0x2590e7['attributes']=_[_0x34de('0x59')](_0x55f400[_0x34de('0x54')],qs[_0x34de('0x5a')](_0x2bd0fd['query'][_0x34de('0x5a')]));_0x2590e7[_0x34de('0x47')]=_0x2590e7[_0x34de('0x47')][_0x34de('0x4c')]?_0x2590e7[_0x34de('0x47')]:_0x55f400['model'];_0x2590e7[_0x34de('0xc9')]=qs[_0x34de('0xca')](_0x2bd0fd['query']['sort']);_0x2590e7[_0x34de('0x41')]=qs[_0x34de('0x58')](_[_0x34de('0xcb')](_0x2bd0fd['query'],_0x55f400[_0x34de('0x58')]));if(_0x2bd0fd[_0x34de('0x42')]['filter']){_0x2590e7['where']=_['merge'](_0x2590e7[_0x34de('0x41')],{'$or':_[_0x34de('0x32')](_0x2590e7[_0x34de('0x47')],function(_0x59bf84){var _0x5736ad={};_0x5736ad[_0x59bf84]={'$like':'%'+_0x2bd0fd[_0x34de('0x42')][_0x34de('0x31')]+'%'};return _0x5736ad;})});}_0x2590e7[_0x34de('0x54')]=db[_0x34de('0x3a')];_0x2590e7['as']=_0x34de('0x2f');_0x2590e7=_['merge']({},_0x2590e7,_0x2bd0fd[_0x34de('0x5c')]);return _0x35f099[_0x34de('0xef')]({'include':[_0x2590e7]});}})['then'](function(_0x204acf){if(_0x204acf){var _0x5cb91f={},_0xa64c67=[];for(var _0x199880=0x0;_0x199880<_0x204acf[_0x34de('0x4c')];_0x199880+=0x1){for(var _0x20d2c7=0x0,_0x3a2c4d;_0x20d2c7<_0x204acf[_0x199880][_0x34de('0x2f')][_0x34de('0x4c')];_0x20d2c7+=0x1){_0x3a2c4d=_0x204acf[_0x199880][_0x34de('0x2f')][_0x20d2c7]['get']({'plain':!![]});_0x5cb91f[_0x3a2c4d['id']]=_0x3a2c4d;}}_0x5cb91f=_[_0x34de('0x11a')](_0x5cb91f);for(var _0x12cc00=qs[_0x34de('0x24')](_0x2bd0fd[_0x34de('0x42')][_0x34de('0x24')]);_0x12cc00<_0x5cb91f[_0x34de('0x4c')]&&_0xa64c67[_0x34de('0x4c')]=_0x532dec[_0x1bf4('0x4b')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x1bf4('0x15')](function(){if(_0x140ccb){return db[_0x1bf4('0x43')]['destroy']({'where':{'membername':_0x140ccb[_0x1bf4('0x1e')]},'individualHooks':!![]});}})['then'](function(){if(_0x140ccb){return _0x140ccb[_0x1bf4('0x4c')]({'raw':!![]});}})[_0x1bf4('0x15')](function(_0x40885c){if(_0x140ccb){if(_0x40885c){var _0x386b7f=[];_0x2d0e7c=_0x40885c;if(_0x2d0e7c[_0x1bf4('0x27')]){for(var _0x11728c=0x0;_0x11728c<_0x2d0e7c[_0x1bf4('0x27')];_0x11728c++){_0x386b7f['push'](db[_0x1bf4('0x43')][_0x1bf4('0x4d')]({'membername':_0x140ccb['name'],'UserId':_0x140ccb['id'],'queue_name':_0x2d0e7c[_0x11728c][_0x1bf4('0x1e')],'VoiceQueueId':_0x2d0e7c[_0x11728c]['id'],'interface':_0x10d096,'paused':_0x140ccb['loginInPause']||![],'penalty':_0x2d0e7c[_0x11728c][_0x1bf4('0x4e')]||0x0}));}return BPromise[_0x1bf4('0x4f')](_0x386b7f);}}}})['then'](function(){if(_0x140ccb){return db[_0x1bf4('0x31')][_0x1bf4('0xc')]({'where':{'membername':_0x140ccb['name'],'exitAt':null}});}})[_0x1bf4('0x15')](function(_0x1dbee7){if(_0x140ccb){if(_0x1dbee7&&_0x1dbee7[_0x1bf4('0x27')]){var _0x4ef94f=[];_0x1dbee7[_0x1bf4('0x29')](function(_0x24b261){_0x4ef94f[_0x1bf4('0x2a')](_0x24b261[_0x1bf4('0x25')]({'exitAt':moment()[_0x1bf4('0x22')](_0x1bf4('0x28'))}));});return BPromise['all'](_0x4ef94f);}}})['then'](function(){if(_0x140ccb){var _0x53a707=[];var _0x4cec1e=[];var _0x33eabb=utils[_0x1bf4('0x50')]();var _0x55fa8d={'membername':_0x140ccb[_0x1bf4('0x1e')],'interface':_0x10d096,'enterAt':moment()[_0x1bf4('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x140ccb[_0x1bf4('0x1f')],'internal':_0x140ccb[_0x1bf4('0x20')]};_0x33eabb[_0x1bf4('0x29')](function(_0x2c5766){_0x53a707['push'](_[_0x1bf4('0x51')]({'channel':_0x2c5766,'type':_0x1bf4('0x52'),'data1':_0x1bf4('0x53'),'data2':_0x10d096},_0x55fa8d));if(_0x140ccb['loginInPause']){_0x4cec1e[_0x1bf4('0x2a')](_[_0x1bf4('0x51')]({'channel':_0x2c5766,'type':_0x1bf4('0x26'),'data1':'LOGININPAUSE'},_0x55fa8d));}});return db[_0x1bf4('0x31')][_0x1bf4('0x32')](_0x53a707[_0x1bf4('0x54')](_0x4cec1e),{'individualHooks':!![]});}})['then'](function(){if(_0x140ccb){return _0x140ccb[_0x1bf4('0x25')]({'online':!![],'lastLoginAt':moment()[_0x1bf4('0x22')](_0x1bf4('0x28')),'voicePause':_0x140ccb['loginInPause']||![],'mailPause':_0x140ccb['loginInPause']||![],'chatPause':_0x140ccb[_0x1bf4('0x47')]||![],'faxPause':_0x140ccb[_0x1bf4('0x47')]||![],'smsPause':_0x140ccb[_0x1bf4('0x47')]||![],'openchannelPause':_0x140ccb[_0x1bf4('0x47')]||![],'pauseType':_0x140ccb[_0x1bf4('0x47')]?_0x1bf4('0x55'):null,'lastPauseAt':moment()[_0x1bf4('0x22')](_0x1bf4('0x28')),'interface':_0x10d096});}})[_0x1bf4('0x15')](function(_0x39efba){_0x2e4da9(_0x39efba);})['catch'](function(_0x60689b){_0x3418ff(_0x520382[_0x1bf4('0x18')](0x1f4,_0x60689b[_0x1bf4('0x1c')]));});});}; \ No newline at end of file +var _0x3029=['rpc','../../config/environment','redis','defaults','localhost','./user.socket','GetUser','User','findAll','options','raw','attributes','limit','include','map','model','info','debug','stringify','catch','error','message','ShowUser','find','where','then','PauseUser','name','role','interface','format','params','UserVoiceQueueRt','update','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','SIP/%s','body','type','internal','uniqueid','bulkCreate','UnpauseUser','resolve','isValidChannel','channel','findOne','voicePause','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','unpause','LogoutUser','destroy','all','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','LOGIN','merge','LOGININPAUSE','lodash','bluebird','../../mysqldb','../../config/logger'];(function(_0x367735,_0x175ec7){var _0x3dd210=function(_0x1b156e){while(--_0x1b156e){_0x367735['push'](_0x367735['shift']());}};_0x3dd210(++_0x175ec7);}(_0x3029,0xf8));var _0x9302=function(_0x2257c3,_0x38dc9b){_0x2257c3=_0x2257c3-0x0;var _0x53638c=_0x3029[_0x2257c3];return _0x53638c;};'use strict';var _=require(_0x9302('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9302('0x1'));var Redis=require('ioredis');var db=require(_0x9302('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x9302('0x3'))(_0x9302('0x4'));var config=require(_0x9302('0x5'));config[_0x9302('0x6')]=_[_0x9302('0x7')](config[_0x9302('0x6')],{'host':_0x9302('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9302('0x6')]));require(_0x9302('0x9'))['register'](socket);exports[_0x9302('0xa')]=function(_0x178e72){var _0x3f664a=this;return new Promise(function(_0x403aed,_0x2d3289){return db[_0x9302('0xb')][_0x9302('0xc')]({'raw':_0x178e72['options']?_0x178e72[_0x9302('0xd')][_0x9302('0xe')]===undefined?!![]:![]:!![],'where':_0x178e72[_0x9302('0xd')]?_0x178e72['options']['where']||null:null,'attributes':_0x178e72['options']?_0x178e72[_0x9302('0xd')][_0x9302('0xf')]||null:null,'limit':_0x178e72[_0x9302('0xd')]?_0x178e72[_0x9302('0xd')][_0x9302('0x10')]||null:null,'include':_0x178e72[_0x9302('0xd')]?_0x178e72[_0x9302('0xd')][_0x9302('0x11')]?_[_0x9302('0x12')](_0x178e72[_0x9302('0xd')]['include'],function(_0x5c0570){return{'model':db[_0x5c0570[_0x9302('0x13')]],'as':_0x5c0570['as'],'attributes':_0x5c0570['attributes'],'include':_0x5c0570['include']?_['map'](_0x5c0570[_0x9302('0x11')],function(_0xfb8ea6){return{'model':db[_0xfb8ea6[_0x9302('0x13')]],'as':_0xfb8ea6['as'],'attributes':_0xfb8ea6[_0x9302('0xf')],'include':_0xfb8ea6[_0x9302('0x11')]?_[_0x9302('0x12')](_0xfb8ea6[_0x9302('0x11')],function(_0x5d801d){return{'model':db[_0x5d801d[_0x9302('0x13')]],'as':_0x5d801d['as'],'attributes':_0x5d801d[_0x9302('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4880ce){logger[_0x9302('0x14')](_0x9302('0xa'),_0x178e72);logger[_0x9302('0x15')](_0x9302('0xa'),_0x178e72,JSON[_0x9302('0x16')](_0x4880ce));_0x403aed(_0x4880ce);})[_0x9302('0x17')](function(_0x596abd){logger[_0x9302('0x18')]('GetUser',_0x596abd[_0x9302('0x19')],_0x178e72);_0x2d3289(_0x3f664a[_0x9302('0x18')](0x1f4,_0x596abd['message']));});});};exports[_0x9302('0x1a')]=function(_0x446087){var _0x1fc21e=this;return new Promise(function(_0x2e436a,_0x484063){return db['User'][_0x9302('0x1b')]({'raw':_0x446087[_0x9302('0xd')]?_0x446087[_0x9302('0xd')][_0x9302('0xe')]===undefined?!![]:![]:!![],'where':_0x446087['options']?_0x446087['options'][_0x9302('0x1c')]||null:null,'attributes':_0x446087[_0x9302('0xd')]?_0x446087[_0x9302('0xd')]['attributes']||null:null,'include':_0x446087[_0x9302('0xd')]?_0x446087[_0x9302('0xd')][_0x9302('0x11')]?_[_0x9302('0x12')](_0x446087[_0x9302('0xd')][_0x9302('0x11')],function(_0x231e5a){return{'model':db[_0x231e5a[_0x9302('0x13')]],'as':_0x231e5a['as'],'attributes':_0x231e5a['attributes'],'include':_0x231e5a[_0x9302('0x11')]?_[_0x9302('0x12')](_0x231e5a['include'],function(_0x4d5214){return{'model':db[_0x4d5214['model']],'as':_0x4d5214['as'],'attributes':_0x4d5214['attributes'],'include':_0x4d5214['include']?_[_0x9302('0x12')](_0x4d5214['include'],function(_0x51d83f){return{'model':db[_0x51d83f[_0x9302('0x13')]],'as':_0x51d83f['as'],'attributes':_0x51d83f['attributes']};}):[]};}):[]};}):[]:[]})[_0x9302('0x1d')](function(_0xd26504){logger[_0x9302('0x14')](_0x9302('0x1a'),_0x446087);logger[_0x9302('0x15')]('ShowUser',_0x446087,JSON[_0x9302('0x16')](_0xd26504));_0x2e436a(_0xd26504);})[_0x9302('0x17')](function(_0x57eba4){logger[_0x9302('0x18')](_0x9302('0x1a'),_0x57eba4['message'],_0x446087);_0x484063(_0x1fc21e['error'](0x1f4,_0x57eba4['message']));});});};exports[_0x9302('0x1e')]=function(_0x2f712f){var _0x1e107c;return db['User'][_0x9302('0x1b')]({'where':_0x2f712f[_0x9302('0xd')][_0x9302('0x1c')]||{},'attributes':['id',_0x9302('0x1f'),_0x9302('0x20'),'internal',_0x9302('0x21')]})[_0x9302('0x1d')](function(_0x5678b7){if(!_0x5678b7){throw new Error(util[_0x9302('0x22')]('User\x20with\x20id\x20%s\x20not\x20found',_0x2f712f[_0x9302('0x23')]['id']));}_0x1e107c=_0x5678b7;return db[_0x9302('0x24')][_0x9302('0x25')]({'paused':0x1},{'where':{'UserId':_0x1e107c['id']},'individualHooks':!![]});})['then'](function(){return db[_0x9302('0x26')][_0x9302('0xc')]({'where':{'membername':_0x1e107c[_0x9302('0x1f')],'type':_0x9302('0x27'),'exitAt':null}});})[_0x9302('0x1d')](function(_0x25e42f){if(_0x25e42f&&_0x25e42f[_0x9302('0x28')]){var _0x5a7c53=moment()[_0x9302('0x22')](_0x9302('0x29'));for(var _0x5c4a36=0x0,_0xfa01b5=_0x25e42f['length'];_0x5c4a36<_0xfa01b5;_0x5c4a36++){_0x25e42f[_0x5c4a36][_0x9302('0x2a')]({'exitAt':_0x5a7c53});}}})[_0x9302('0x1d')](function(){var _0x1f20fd=[];var _0x51c4c5=utils[_0x9302('0x2b')]();_0x51c4c5[_0x9302('0x2c')](function(_0x39fdea){_0x1f20fd[_0x9302('0x2d')]({'channel':_0x39fdea,'membername':_0x1e107c[_0x9302('0x1f')],'interface':_['isNil'](_0x1e107c[_0x9302('0x21')])?util[_0x9302('0x22')](_0x9302('0x2e'),_0x1e107c[_0x9302('0x1f')]):_0x1e107c[_0x9302('0x21')],'type':_0x9302('0x27'),'enterAt':moment()[_0x9302('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2f712f[_0x9302('0x2f')][_0x9302('0x30')]||'DEFAULT\x20PAUSE','role':_0x1e107c[_0x9302('0x20')],'internal':_0x1e107c[_0x9302('0x31')],'uniqueid':_0x2f712f['body'][_0x9302('0x32')]||null});});return db[_0x9302('0x26')][_0x9302('0x33')](_0x1f20fd,{'individualHooks':!![]});})['then'](function(){return _0x1e107c[_0x9302('0x25')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2f712f[_0x9302('0x2f')][_0x9302('0x30')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x9302('0x17')](function(_0x4f15dd){throw _0x4f15dd;});};exports[_0x9302('0x34')]=function(_0x111f21){return Promise[_0x9302('0x35')]()[_0x9302('0x1d')](function(){if(_0x111f21[_0x9302('0x2f')]['channel']&&!utils[_0x9302('0x36')](_0x111f21['body'][_0x9302('0x37')])){throw new Error(util[_0x9302('0x22')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x111f21['body'][_0x9302('0x37')]));}return db[_0x9302('0xb')][_0x9302('0x38')]({'where':_0x111f21[_0x9302('0xd')][_0x9302('0x1c')]||{},'attributes':['id',_0x9302('0x1f'),_0x9302('0x20'),'internal','interface','online',_0x9302('0x39'),_0x9302('0x3a'),'chatPause',_0x9302('0x3b'),_0x9302('0x3c'),_0x9302('0x3d'),_0x9302('0x3e'),_0x9302('0x3f'),_0x9302('0x40')]});})[_0x9302('0x1d')](function(_0x2b369f){if(!_0x2b369f){throw new Error(util['format'](_0x9302('0x41'),_0x111f21[_0x9302('0x23')]['id']));}return _0x2b369f[_0x9302('0x42')](_0x111f21[_0x9302('0x2f')][_0x9302('0x37')],'system');})[_0x9302('0x17')](function(_0x594f1b){throw _0x594f1b;});};exports[_0x9302('0x43')]=function(_0x1d3b43){var _0x456121=this;return new Promise(function(_0x4218b1,_0x37379d){var _0x22086f;return db[_0x9302('0xb')]['findOne']({'where':_0x1d3b43['options'][_0x9302('0x1c')]||{},'attributes':['id',_0x9302('0x1f')]})[_0x9302('0x1d')](function(_0x3bdcaf){if(_0x3bdcaf){_0x22086f=_0x3bdcaf;return db['UserVoiceQueueRt'][_0x9302('0x44')]({'where':{'membername':_0x22086f['name']},'individualHooks':!![]});}})[_0x9302('0x1d')](function(){if(_0x22086f){return db[_0x9302('0x26')][_0x9302('0xc')]({'where':{'membername':_0x22086f[_0x9302('0x1f')],'exitAt':null}});}})[_0x9302('0x1d')](function(_0x3e5ca9){if(_0x22086f){if(_0x3e5ca9&&_0x3e5ca9[_0x9302('0x28')]){var _0x34ae16=[];_0x3e5ca9['forEach'](function(_0x165729){_0x34ae16[_0x9302('0x2d')](_0x165729[_0x9302('0x25')]({'exitAt':moment()[_0x9302('0x22')](_0x9302('0x29'))}));});return BPromise[_0x9302('0x45')](_0x34ae16);}}})[_0x9302('0x1d')](function(){if(_0x22086f){return _0x22086f[_0x9302('0x25')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x449648){_0x4218b1(_0x449648);})[_0x9302('0x17')](function(_0x5c761e){_0x37379d(_0x456121[_0x9302('0x18')](0x1f4,_0x5c761e[_0x9302('0x19')]));});});};exports[_0x9302('0x46')]=function(_0xb0cb9a){var _0x335aca=this;return new Promise(function(_0x44c32a,_0x2e2ea3){var _0x5ec500;var _0x31f731;var _0x5e942a;var _0x22e455;return db['User'][_0x9302('0x38')]({'where':_0xb0cb9a[_0x9302('0xd')][_0x9302('0x1c')]||{},'attributes':['id',_0x9302('0x1f'),_0x9302('0x20'),_0x9302('0x47'),_0x9302('0x48'),_0x9302('0x31'),_0x9302('0x49'),_0x9302('0x21')]})['then'](function(_0x14a9f1){if(_0x14a9f1){_0x5ec500=_0x14a9f1;_0x22e455=_0xb0cb9a[_0x9302('0x2f')][_0x9302('0x21')]?_0xb0cb9a[_0x9302('0x2f')][_0x9302('0x21')]:util[_0x9302('0x22')](_0x9302('0x2e'),_0x5ec500[_0x9302('0x1f')]);return db['User'][_0x9302('0x4a')]({'where':{'role':_0x9302('0x4b'),'online':!![],'id':{'$ne':_0x5ec500['id']}}});}})['then'](function(_0x2a10f3){if(_0x2a10f3){_0x5e942a=_0x2a10f3;return require(_0x9302('0x4c'))['getLicense']();}})[_0x9302('0x1d')](function(_0x4ad564){if(_0x4ad564&&_0x4ad564[_0x9302('0x4d')]&&_0x5e942a>=_0x4ad564[_0x9302('0x4d')]){throw new Error(_0x9302('0x4e'));}})[_0x9302('0x1d')](function(){if(_0x5ec500){return db['UserVoiceQueueRt'][_0x9302('0x44')]({'where':{'membername':_0x5ec500[_0x9302('0x1f')]},'individualHooks':!![]});}})[_0x9302('0x1d')](function(){if(_0x5ec500){return _0x5ec500[_0x9302('0x4f')]({'raw':!![]});}})[_0x9302('0x1d')](function(_0x29e23c){if(_0x5ec500){if(_0x29e23c){var _0x4bd3f2=[];_0x31f731=_0x29e23c;if(_0x31f731['length']){for(var _0x51f9e5=0x0;_0x51f9e5<_0x31f731[_0x9302('0x28')];_0x51f9e5++){_0x4bd3f2[_0x9302('0x2d')](db[_0x9302('0x24')][_0x9302('0x50')]({'membername':_0x5ec500['name'],'UserId':_0x5ec500['id'],'queue_name':_0x31f731[_0x51f9e5][_0x9302('0x1f')],'VoiceQueueId':_0x31f731[_0x51f9e5]['id'],'interface':_0x22e455,'paused':_0x5ec500[_0x9302('0x49')]||![],'penalty':_0x31f731[_0x51f9e5]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x9302('0x45')](_0x4bd3f2);}}}})[_0x9302('0x1d')](function(){if(_0x5ec500){return db['MemberReport']['findAll']({'where':{'membername':_0x5ec500[_0x9302('0x1f')],'exitAt':null}});}})[_0x9302('0x1d')](function(_0x616c6c){if(_0x5ec500){if(_0x616c6c&&_0x616c6c[_0x9302('0x28')]){var _0x12bfa2=[];_0x616c6c[_0x9302('0x2c')](function(_0x4e43e0){_0x12bfa2[_0x9302('0x2d')](_0x4e43e0[_0x9302('0x25')]({'exitAt':moment()[_0x9302('0x22')](_0x9302('0x29'))}));});return BPromise['all'](_0x12bfa2);}}})['then'](function(){if(_0x5ec500){var _0x1bc5bc=[];var _0x35b1e4=[];var _0x511fc1=utils[_0x9302('0x2b')]();var _0x430ad2={'membername':_0x5ec500[_0x9302('0x1f')],'interface':_0x22e455,'enterAt':moment()['format'](_0x9302('0x29')),'role':_0x5ec500[_0x9302('0x20')],'internal':_0x5ec500[_0x9302('0x31')]};_0x511fc1[_0x9302('0x2c')](function(_0x1528b7){_0x1bc5bc[_0x9302('0x2d')](_['merge']({'channel':_0x1528b7,'type':_0x9302('0x51'),'data1':'callysquare','data2':_0x22e455},_0x430ad2));if(_0x5ec500[_0x9302('0x49')]){_0x35b1e4[_0x9302('0x2d')](_[_0x9302('0x52')]({'channel':_0x1528b7,'type':'PAUSE','data1':_0x9302('0x53')},_0x430ad2));}});return db[_0x9302('0x26')][_0x9302('0x33')](_0x1bc5bc['concat'](_0x35b1e4),{'individualHooks':!![]});}})[_0x9302('0x1d')](function(){if(_0x5ec500){return _0x5ec500[_0x9302('0x25')]({'online':!![],'lastLoginAt':moment()[_0x9302('0x22')](_0x9302('0x29')),'voicePause':_0x5ec500['loginInPause']||![],'mailPause':_0x5ec500[_0x9302('0x49')]||![],'chatPause':_0x5ec500[_0x9302('0x49')]||![],'faxPause':_0x5ec500[_0x9302('0x49')]||![],'smsPause':_0x5ec500[_0x9302('0x49')]||![],'openchannelPause':_0x5ec500[_0x9302('0x49')]||![],'pauseType':_0x5ec500[_0x9302('0x49')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x9302('0x29')),'interface':_0x22e455});}})[_0x9302('0x1d')](function(_0xcaf85a){_0x44c32a(_0xcaf85a);})[_0x9302('0x17')](function(_0x3a69cd){_0x2e2ea3(_0x335aca[_0x9302('0x18')](0x1f4,_0x3a69cd[_0x9302('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 4e601a7..4134799 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 _0x6800=['save','remove','emit','register','./user.events'];(function(_0xe7d899,_0x1e84d7){var _0x4c6d56=function(_0x5d1ec5){while(--_0x5d1ec5){_0xe7d899['push'](_0xe7d899['shift']());}};_0x4c6d56(++_0x1e84d7);}(_0x6800,0xb8));var _0x0680=function(_0x52cb84,_0x4992a8){_0x52cb84=_0x52cb84-0x0;var _0x542310=_0x6800[_0x52cb84];return _0x542310;};'use strict';var UserEvents=require(_0x0680('0x0'));var events=[_0x0680('0x1'),_0x0680('0x2'),'update'];function createListener(_0xc6481d,_0x3af775){return function(_0x490d83){_0x3af775[_0x0680('0x3')](_0xc6481d,_0x490d83);};}function removeListener(_0x150482,_0x341370){return function(){UserEvents['removeListener'](_0x150482,_0x341370);};}exports[_0x0680('0x4')]=function(_0x2d2647){for(var _0x2a9d09=0x0,_0x4e91bc=events['length'];_0x2a9d09<_0x4e91bc;_0x2a9d09++){var _0x3978b9=events[_0x2a9d09];var _0x3f14fa=createListener('user:'+_0x3978b9,_0x2d2647);UserEvents['on'](_0x3978b9,_0x3f14fa);}}; \ No newline at end of file +var _0x9132=['emit','removeListener','register','length','user:','./user.events','save','remove','update'];(function(_0x5f4fb4,_0x2dd9aa){var _0x535ee3=function(_0x137d2b){while(--_0x137d2b){_0x5f4fb4['push'](_0x5f4fb4['shift']());}};_0x535ee3(++_0x2dd9aa);}(_0x9132,0x16d));var _0x2913=function(_0x4c03ba,_0x2a9459){_0x4c03ba=_0x4c03ba-0x0;var _0x1641de=_0x9132[_0x4c03ba];return _0x1641de;};'use strict';var UserEvents=require(_0x2913('0x0'));var events=[_0x2913('0x1'),_0x2913('0x2'),_0x2913('0x3')];function createListener(_0x170926,_0x57d772){return function(_0x3360aa){_0x57d772[_0x2913('0x4')](_0x170926,_0x3360aa);};}function removeListener(_0x27b75c,_0x1a6fc0){return function(){UserEvents[_0x2913('0x5')](_0x27b75c,_0x1a6fc0);};}exports[_0x2913('0x6')]=function(_0x8a6934){for(var _0x5d184e=0x0,_0x5292b9=events[_0x2913('0x7')];_0x5d184e<_0x5292b9;_0x5d184e++){var _0x52a098=events[_0x5d184e];var _0x270cd3=createListener(_0x2913('0x8')+_0x52a098,_0x8a6934);UserEvents['on'](_0x52a098,_0x270cd3);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index fdf23ef..f6c21a1 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x86128f,_0x415af6){var _0x2c1a26=function(_0x3314ef){while(--_0x3314ef){_0x86128f['push'](_0x86128f['shift']());}};_0x2c1a26(++_0x415af6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2b1551,_0x1776fe){_0x2b1551=_0x2b1551-0x0;var _0x2fc2a1=_0xcb91[_0x2b1551];return _0x2fc2a1;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2ad789,_0x522b98){var _0x3ccdfa=function(_0x264f70){while(--_0x264f70){_0x2ad789['push'](_0x2ad789['shift']());}};_0x3ccdfa(++_0x522b98);}(_0x70e0,0x17b));var _0x070e=function(_0x5e4d7c,_0x5c3b83){_0x5e4d7c=_0x5e4d7c-0x0;var _0x3be094=_0x70e0[_0x5e4d7c];return _0x3be094;};'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 d23b806..25614cd 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 _0xa12b=['exports','sequelize'];(function(_0x4b9f37,_0x3d05b0){var _0x4fb98c=function(_0xa54ab){while(--_0xa54ab){_0x4b9f37['push'](_0x4b9f37['shift']());}};_0x4fb98c(++_0x3d05b0);}(_0xa12b,0x175));var _0xba12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa12b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xba12('0x0'));module[_0xba12('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7e7a=['INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e7a,0xb8));var _0xa7e7=function(_0x34315c,_0x54fa87){_0x34315c=_0x34315c-0x0;var _0x51b3df=_0x7e7a[_0x34315c];return _0x51b3df;};'use strict';var Sequelize=require(_0xa7e7('0x0'));module[_0xa7e7('0x1')]={'penalty':{'type':Sequelize[_0xa7e7('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 0f26cd2..c2c60a7 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 _0x0b20=['define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./userChatQueue.attributes','exports'];(function(_0x5d8c3a,_0x52c448){var _0x5fbe1b=function(_0x5a07b4){while(--_0x5a07b4){_0x5d8c3a['push'](_0x5d8c3a['shift']());}};_0x5fbe1b(++_0x52c448);}(_0x0b20,0x12c));var _0x00b2=function(_0x3150d7,_0x5011e1){_0x3150d7=_0x3150d7-0x0;var _0x4f8785=_0x0b20[_0x3150d7];return _0x4f8785;};'use strict';var _=require(_0x00b2('0x0'));var util=require(_0x00b2('0x1'));var logger=require(_0x00b2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x00b2('0x3'));var rp=require(_0x00b2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00b2('0x5'));var config=require('../../config/environment');var attributes=require(_0x00b2('0x6'));module[_0x00b2('0x7')]=function(_0xd0cb6,_0x1b900f){return _0xd0cb6[_0x00b2('0x8')](_0x00b2('0x9'),attributes,{'tableName':_0x00b2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30e0=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0x30e0,0x111));var _0x030e=function(_0x5ebecf,_0x5f4996){_0x5ebecf=_0x5ebecf-0x0;var _0x3c98a3=_0x30e0[_0x5ebecf];return _0x3c98a3;};'use strict';var _=require(_0x030e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x030e('0x1'));var moment=require(_0x030e('0x2'));var BPromise=require(_0x030e('0x3'));var rp=require(_0x030e('0x4'));var fs=require('fs');var path=require(_0x030e('0x5'));var rimraf=require(_0x030e('0x6'));var config=require(_0x030e('0x7'));var attributes=require(_0x030e('0x8'));module[_0x030e('0x9')]=function(_0x20e9b6,_0x2a3215){return _0x20e9b6[_0x030e('0xa')](_0x030e('0xb'),attributes,{'tableName':_0x030e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 263ffff..cf072f1 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 _0x5988=['ioredis','../../mysqldb','../../config/utils','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','randomstring'];(function(_0x4b6fad,_0x2c9f02){var _0x18f75e=function(_0x16a20e){while(--_0x16a20e){_0x4b6fad['push'](_0x4b6fad['shift']());}};_0x18f75e(++_0x2c9f02);}(_0x5988,0x1bf));var _0x8598=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x5988[_0x45b034];return _0x509cb0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8598('0x0'));var BPromise=require(_0x8598('0x1'));var rs=require(_0x8598('0x2'));var fs=require('fs');var Redis=require(_0x8598('0x3'));var db=require(_0x8598('0x4'))['db'];var utils=require(_0x8598('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8598('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x17c8ed,_0x1270c3,_0xbbfa74){return new BPromise(function(_0x1cd249,_0x32635c){return client[_0x8598('0x7')](_0x17c8ed,_0xbbfa74)[_0x8598('0x8')](function(_0x2c5785){logger[_0x8598('0x9')](_0x8598('0xa'),_0x1270c3,'request\x20sent');logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x1270c3,_0x8598('0xb'),JSON[_0x8598('0xc')](_0x2c5785));if(_0x2c5785[_0x8598('0xd')]){if(_0x2c5785[_0x8598('0xd')][_0x8598('0xe')]===0x1f4){logger[_0x8598('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x1270c3,_0x2c5785['error'][_0x8598('0xf')]);return _0x32635c(_0x2c5785[_0x8598('0xd')][_0x8598('0xf')]);}logger[_0x8598('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x1270c3,_0x2c5785[_0x8598('0xd')]['message']);return _0x1cd249(_0x2c5785[_0x8598('0xd')]['message']);}else{logger[_0x8598('0x9')](_0x8598('0xa'),_0x1270c3,_0x8598('0xb'));_0x1cd249(_0x2c5785[_0x8598('0x10')][_0x8598('0xf')]);}})[_0x8598('0x11')](function(_0x402271){logger['error'](_0x8598('0xa'),_0x1270c3,_0x402271);_0x32635c(_0x402271);});});} \ No newline at end of file +var _0xe460=['jayson/promise','client','request','info','UserChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2f31bd,_0x45d349){var _0x517ad8=function(_0x1e6691){while(--_0x1e6691){_0x2f31bd['push'](_0x2f31bd['shift']());}};_0x517ad8(++_0x45d349);}(_0xe460,0x162));var _0x0e46=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xe460[_0x53abe5];return _0xc1c37e;};'use strict';var _=require(_0x0e46('0x0'));var util=require(_0x0e46('0x1'));var moment=require(_0x0e46('0x2'));var BPromise=require('bluebird');var rs=require(_0x0e46('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0e46('0x4'));var logger=require(_0x0e46('0x5'))('rpc');var config=require(_0x0e46('0x6'));var jayson=require(_0x0e46('0x7'));var client=jayson[_0x0e46('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a3a8a,_0x118b3b,_0x28f839){return new BPromise(function(_0x520778,_0xd3a5a0){return client[_0x0e46('0x9')](_0x5a3a8a,_0x28f839)['then'](function(_0x5e7efb){logger[_0x0e46('0xa')](_0x0e46('0xb'),_0x118b3b,'request\x20sent');logger[_0x0e46('0xc')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x118b3b,_0x0e46('0xd'),JSON[_0x0e46('0xe')](_0x5e7efb));if(_0x5e7efb['error']){if(_0x5e7efb[_0x0e46('0xf')]['code']===0x1f4){logger['error'](_0x0e46('0xb'),_0x118b3b,_0x5e7efb['error'][_0x0e46('0x10')]);return _0xd3a5a0(_0x5e7efb[_0x0e46('0xf')][_0x0e46('0x10')]);}logger[_0x0e46('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x118b3b,_0x5e7efb[_0x0e46('0xf')][_0x0e46('0x10')]);return _0x520778(_0x5e7efb[_0x0e46('0xf')][_0x0e46('0x10')]);}else{logger[_0x0e46('0xa')](_0x0e46('0xb'),_0x118b3b,_0x0e46('0xd'));_0x520778(_0x5e7efb[_0x0e46('0x11')]['message']);}})[_0x0e46('0x12')](function(_0x4c9a0b){logger[_0x0e46('0xf')](_0x0e46('0xb'),_0x118b3b,_0x4c9a0b);_0xd3a5a0(_0x4c9a0b);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index c719101..6cea132 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(_0x5f3450,_0x21d23a){var _0x58db0d=function(_0x16efc9){while(--_0x16efc9){_0x5f3450['push'](_0x5f3450['shift']());}};_0x58db0d(++_0x21d23a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x592524,_0x30dd18){var _0x162bf7=function(_0x3a7728){while(--_0x3a7728){_0x592524['push'](_0x592524['shift']());}};_0x162bf7(++_0x30dd18);}(_0x70e0,0x17b));var _0x070e=function(_0x3e2b37,_0x247316){_0x3e2b37=_0x3e2b37-0x0;var _0x367c6d=_0x70e0[_0x3e2b37];return _0x367c6d;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index bb18431..819422c 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 _0x7389=['STRING','sequelize','exports','INTEGER'];(function(_0x5ccb43,_0x30858c){var _0x5f68b2=function(_0x4f96cb){while(--_0x4f96cb){_0x5ccb43['push'](_0x5ccb43['shift']());}};_0x5f68b2(++_0x30858c);}(_0x7389,0x1ed));var _0x9738=function(_0x59f074,_0x53dcf4){_0x59f074=_0x59f074-0x0;var _0x524656=_0x7389[_0x59f074];return _0x524656;};'use strict';var Sequelize=require(_0x9738('0x0'));module[_0x9738('0x1')]={'penalty':{'type':Sequelize[_0x9738('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x9738('0x3')]}}; \ No newline at end of file +var _0x89c5=['INTEGER','sequelize','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x89c5,0x1a5));var _0x589c=function(_0x5bc0f6,_0x45f73c){_0x5bc0f6=_0x5bc0f6-0x0;var _0x4fea37=_0x89c5[_0x5bc0f6];return _0x4fea37;};'use strict';var Sequelize=require(_0x589c('0x0'));module[_0x589c('0x1')]={'penalty':{'type':Sequelize[_0x589c('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x589c('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 7e3cbc3..8ec0328 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 _0x7d48=['./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x41a39e,_0x209590){var _0x422968=function(_0xd442b1){while(--_0xd442b1){_0x41a39e['push'](_0x41a39e['shift']());}};_0x422968(++_0x209590);}(_0x7d48,0x67));var _0x87d4=function(_0x5f2cfa,_0x1d599e){_0x5f2cfa=_0x5f2cfa-0x0;var _0x80322a=_0x7d48[_0x5f2cfa];return _0x80322a;};'use strict';var _=require('lodash');var util=require(_0x87d4('0x0'));var logger=require(_0x87d4('0x1'))(_0x87d4('0x2'));var moment=require(_0x87d4('0x3'));var BPromise=require(_0x87d4('0x4'));var rp=require(_0x87d4('0x5'));var fs=require('fs');var path=require(_0x87d4('0x6'));var rimraf=require(_0x87d4('0x7'));var config=require(_0x87d4('0x8'));var attributes=require(_0x87d4('0x9'));module[_0x87d4('0xa')]=function(_0x396291,_0x292624){return _0x396291[_0x87d4('0xb')](_0x87d4('0xc'),attributes,{'tableName':_0x87d4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc13=['path','rimraf','define','UserFaxQueue','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x191cc2,_0x5c0b6b){var _0x33288e=function(_0x510fd9){while(--_0x510fd9){_0x191cc2['push'](_0x191cc2['shift']());}};_0x33288e(++_0x5c0b6b);}(_0xcc13,0x72));var _0x3cc1=function(_0x591f59,_0x58ae57){_0x591f59=_0x591f59-0x0;var _0x4b3db4=_0xcc13[_0x591f59];return _0x4b3db4;};'use strict';var _=require(_0x3cc1('0x0'));var util=require(_0x3cc1('0x1'));var logger=require(_0x3cc1('0x2'))('api');var moment=require(_0x3cc1('0x3'));var BPromise=require(_0x3cc1('0x4'));var rp=require(_0x3cc1('0x5'));var fs=require('fs');var path=require(_0x3cc1('0x6'));var rimraf=require(_0x3cc1('0x7'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x158247,_0x1ff2b8){return _0x158247[_0x3cc1('0x8')](_0x3cc1('0x9'),attributes,{'tableName':'user_has_fax_queues','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 9c219b0..891665b 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 _0x6202=['error','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x19517a,_0x31a29d){var _0x32405f=function(_0x470b28){while(--_0x470b28){_0x19517a['push'](_0x19517a['shift']());}};_0x32405f(++_0x31a29d);}(_0x6202,0x1bd));var _0x2620=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x6202[_0x1e500e];return _0x10dc5e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2620('0x0'));var BPromise=require('bluebird');var rs=require(_0x2620('0x1'));var fs=require('fs');var Redis=require(_0x2620('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2620('0x3'));var logger=require(_0x2620('0x4'))(_0x2620('0x5'));var config=require(_0x2620('0x6'));var jayson=require(_0x2620('0x7'));var client=jayson[_0x2620('0x8')][_0x2620('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x183fed,_0x2121fd,_0x1f792b){return new BPromise(function(_0x3a7ca8,_0x268202){return client[_0x2620('0xa')](_0x183fed,_0x1f792b)[_0x2620('0xb')](function(_0x1a01f0){logger[_0x2620('0xc')](_0x2620('0xd'),_0x2121fd,_0x2620('0xe'));logger[_0x2620('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x2121fd,_0x2620('0xe'),JSON[_0x2620('0x10')](_0x1a01f0));if(_0x1a01f0[_0x2620('0x11')]){if(_0x1a01f0[_0x2620('0x11')]['code']===0x1f4){logger[_0x2620('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x2121fd,_0x1a01f0[_0x2620('0x11')][_0x2620('0x12')]);return _0x268202(_0x1a01f0['error'][_0x2620('0x12')]);}logger[_0x2620('0x11')](_0x2620('0xd'),_0x2121fd,_0x1a01f0[_0x2620('0x11')][_0x2620('0x12')]);return _0x3a7ca8(_0x1a01f0[_0x2620('0x11')]['message']);}else{logger[_0x2620('0xc')](_0x2620('0xd'),_0x2121fd,_0x2620('0xe'));_0x3a7ca8(_0x1a01f0[_0x2620('0x13')][_0x2620('0x12')]);}})[_0x2620('0x14')](function(_0x458055){logger[_0x2620('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x2121fd,_0x458055);_0x268202(_0x458055);});});} \ No newline at end of file +var _0x8bb3=['util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x7cb10c,_0x2fcc3a){var _0x11df59=function(_0x75305f){while(--_0x75305f){_0x7cb10c['push'](_0x7cb10c['shift']());}};_0x11df59(++_0x2fcc3a);}(_0x8bb3,0x149));var _0x38bb=function(_0xff1836,_0x1dc03f){_0xff1836=_0xff1836-0x0;var _0x8e7741=_0x8bb3[_0xff1836];return _0x8e7741;};'use strict';var _=require(_0x38bb('0x0'));var util=require(_0x38bb('0x1'));var moment=require(_0x38bb('0x2'));var BPromise=require(_0x38bb('0x3'));var rs=require(_0x38bb('0x4'));var fs=require('fs');var Redis=require(_0x38bb('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x38bb('0x6'))('rpc');var config=require(_0x38bb('0x7'));var jayson=require(_0x38bb('0x8'));var client=jayson[_0x38bb('0x9')][_0x38bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a1f77,_0x459dd3,_0x281c65){return new BPromise(function(_0x591636,_0xeeb83e){return client[_0x38bb('0xb')](_0x1a1f77,_0x281c65)[_0x38bb('0xc')](function(_0x46f6b1){logger[_0x38bb('0xd')](_0x38bb('0xe'),_0x459dd3,_0x38bb('0xf'));logger[_0x38bb('0x10')](_0x38bb('0x11'),_0x459dd3,_0x38bb('0xf'),JSON[_0x38bb('0x12')](_0x46f6b1));if(_0x46f6b1[_0x38bb('0x13')]){if(_0x46f6b1['error']['code']===0x1f4){logger[_0x38bb('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x459dd3,_0x46f6b1[_0x38bb('0x13')][_0x38bb('0x14')]);return _0xeeb83e(_0x46f6b1[_0x38bb('0x13')][_0x38bb('0x14')]);}logger[_0x38bb('0x13')](_0x38bb('0xe'),_0x459dd3,_0x46f6b1[_0x38bb('0x13')][_0x38bb('0x14')]);return _0x591636(_0x46f6b1['error']['message']);}else{logger[_0x38bb('0xd')](_0x38bb('0xe'),_0x459dd3,_0x38bb('0xf'));_0x591636(_0x46f6b1[_0x38bb('0x15')][_0x38bb('0x14')]);}})['catch'](function(_0x2132c3){logger['error'](_0x38bb('0xe'),_0x459dd3,_0x2132c3);_0xeeb83e(_0x2132c3);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index e5da16e..f438b42 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x38b777,_0x58b31e){var _0x41da2c=function(_0x1e929a){while(--_0x1e929a){_0x38b777['push'](_0x38b777['shift']());}};_0x41da2c(++_0x58b31e);}(_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 +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x432b47,_0x24d3b7){var _0xb74e85=function(_0x333c4f){while(--_0x333c4f){_0x432b47['push'](_0x432b47['shift']());}};_0xb74e85(++_0x24d3b7);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'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 5a7691d..abe9c3e 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 _0x1bdc=['INTEGER','sequelize','exports'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x1bdc,0x1db));var _0xc1bd=function(_0x510fd8,_0x57ccdf){_0x510fd8=_0x510fd8-0x0;var _0x211a2f=_0x1bdc[_0x510fd8];return _0x211a2f;};'use strict';var Sequelize=require(_0xc1bd('0x0'));module[_0xc1bd('0x1')]={'penalty':{'type':Sequelize[_0xc1bd('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1427=['INTEGER','exports'];(function(_0x397ecb,_0x411b9b){var _0x3e9af1=function(_0x5e6871){while(--_0x5e6871){_0x397ecb['push'](_0x397ecb['shift']());}};_0x3e9af1(++_0x411b9b);}(_0x1427,0x7b));var _0x7142=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1427[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7142('0x0')]={'penalty':{'type':Sequelize[_0x7142('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 6c9c792..0134a65 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 _0xf5e8=['../../config/environment','define','user_has_mail_queues','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x185aca,_0x3b01a4){var _0x7fb55a=function(_0x549aaf){while(--_0x549aaf){_0x185aca['push'](_0x185aca['shift']());}};_0x7fb55a(++_0x3b01a4);}(_0xf5e8,0x12f));var _0x8f5e=function(_0x3f6e26,_0x811a34){_0x3f6e26=_0x3f6e26-0x0;var _0x474345=_0xf5e8[_0x3f6e26];return _0x474345;};'use strict';var _=require(_0x8f5e('0x0'));var util=require(_0x8f5e('0x1'));var logger=require(_0x8f5e('0x2'))(_0x8f5e('0x3'));var moment=require(_0x8f5e('0x4'));var BPromise=require('bluebird');var rp=require(_0x8f5e('0x5'));var fs=require('fs');var path=require(_0x8f5e('0x6'));var rimraf=require('rimraf');var config=require(_0x8f5e('0x7'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x230cf8,_0x595002){return _0x230cf8[_0x8f5e('0x8')]('UserMailQueue',attributes,{'tableName':_0x8f5e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x765e=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','UserMailQueue','user_has_mail_queues'];(function(_0x2e07d8,_0x56261e){var _0x2f3ec9=function(_0x2e44fa){while(--_0x2e44fa){_0x2e07d8['push'](_0x2e07d8['shift']());}};_0x2f3ec9(++_0x56261e);}(_0x765e,0x9c));var _0xe765=function(_0x30f6cd,_0x465b52){_0x30f6cd=_0x30f6cd-0x0;var _0x914e17=_0x765e[_0x30f6cd];return _0x914e17;};'use strict';var _=require(_0xe765('0x0'));var util=require(_0xe765('0x1'));var logger=require(_0xe765('0x2'))(_0xe765('0x3'));var moment=require(_0xe765('0x4'));var BPromise=require(_0xe765('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe765('0x6'));var rimraf=require('rimraf');var config=require(_0xe765('0x7'));var attributes=require('./userMailQueue.attributes');module[_0xe765('0x8')]=function(_0x1432c4,_0x46635f){return _0x1432c4[_0xe765('0x9')](_0xe765('0xa'),attributes,{'tableName':_0xe765('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index e38c088..b4cb025 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 _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0xb928f2,_0x8792e7){var _0x43d31d=function(_0x3e27e2){while(--_0x3e27e2){_0xb928f2['push'](_0xb928f2['shift']());}};_0x43d31d(++_0x8792e7);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4d8dc3,_0x585fd1){_0x4d8dc3=_0x4d8dc3-0x0;var _0x9b03d9=_0x4b84[_0x4d8dc3];return _0x9b03d9;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x7217,0x19e));var _0x7721=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x7217[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index fa3188f..2656d7a 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 _0xb4a3=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x2e6dc9,_0x4fa2e1){var _0x26029d=function(_0x1d85cc){while(--_0x1d85cc){_0x2e6dc9['push'](_0x2e6dc9['shift']());}};_0x26029d(++_0x4fa2e1);}(_0xb4a3,0xf1));var _0x3b4a=function(_0x348652,_0x1ab849){_0x348652=_0x348652-0x0;var _0x18a9ea=_0xb4a3[_0x348652];return _0x18a9ea;};'use strict';var multer=require(_0x3b4a('0x0'));var util=require(_0x3b4a('0x1'));var path=require('path');var timeout=require(_0x3b4a('0x2'));var express=require('express');var router=express[_0x3b4a('0x3')]();var fs_extra=require(_0x3b4a('0x4'));var auth=require(_0x3b4a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3b4a('0x6'));var controller=require('./userNotification.controller');router[_0x3b4a('0x7')]('/',auth[_0x3b4a('0x8')](),controller[_0x3b4a('0x9')]);module[_0x3b4a('0xa')]=router; \ No newline at end of file +var _0xb96f=['fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','util','connect-timeout','express'];(function(_0x20f700,_0x17f520){var _0x58e517=function(_0x2150da){while(--_0x2150da){_0x20f700['push'](_0x20f700['shift']());}};_0x58e517(++_0x17f520);}(_0xb96f,0x93));var _0xfb96=function(_0x3c971b,_0x5a8028){_0x3c971b=_0x3c971b-0x0;var _0x4883d1=_0xb96f[_0x3c971b];return _0x4883d1;};'use strict';var multer=require('multer');var util=require(_0xfb96('0x0'));var path=require('path');var timeout=require(_0xfb96('0x1'));var express=require(_0xfb96('0x2'));var router=express['Router']();var fs_extra=require(_0xfb96('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfb96('0x4'));var config=require(_0xfb96('0x5'));var controller=require(_0xfb96('0x6'));router[_0xfb96('0x7')]('/',auth[_0xfb96('0x8')](),controller['sendUserNotification']);module[_0xfb96('0x9')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 89fa263..a3d03dc 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 _0x4e96=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x427367,_0xb3014a){var _0x402566=function(_0x139289){while(--_0x139289){_0x427367['push'](_0x427367['shift']());}};_0x402566(++_0xb3014a);}(_0x4e96,0xc3));var _0x64e9=function(_0x18040e,_0x115de3){_0x18040e=_0x18040e-0x0;var _0x101956=_0x4e96[_0x18040e];return _0x101956;};'use strict';var Sequelize=require(_0x64e9('0x0'));module[_0x64e9('0x1')]={'body':{'type':Sequelize[_0x64e9('0x2')]},'senderName':{'type':Sequelize[_0x64e9('0x3')]},'recipientsId':{'type':Sequelize[_0x64e9('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x64e9('0x4')]}}; \ No newline at end of file +var _0x019e=['STRING','BOOLEAN','TEXT'];(function(_0x2f1bce,_0x4c9d95){var _0x3c305b=function(_0x203ea6){while(--_0x203ea6){_0x2f1bce['push'](_0x2f1bce['shift']());}};_0x3c305b(++_0x4c9d95);}(_0x019e,0xfe));var _0xe019=function(_0x3234bd,_0x561f1c){_0x3234bd=_0x3234bd-0x0;var _0x5c591b=_0x019e[_0x3234bd];return _0x5c591b;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xe019('0x0')]},'senderName':{'type':Sequelize[_0xe019('0x1')]},'recipientsId':{'type':Sequelize[_0xe019('0x0')]},'recipientsDescription':{'type':Sequelize[_0xe019('0x1')]},'beep':{'type':Sequelize[_0xe019('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index f125898..9a03b03 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 _0xf266=['senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','view','startCase','User','union','ids','queue','Queue','push','all','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','sendUserNotification','hasOwnProperty','body','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','recipients','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','user','some','includes','model'];(function(_0x79c24f,_0x18517b){var _0x1ffb70=function(_0x5a09db){while(--_0x5a09db){_0x79c24f['push'](_0x79c24f['shift']());}};_0x1ffb70(++_0x18517b);}(_0xf266,0x148));var _0x6f26=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xf266[_0x21aec3];return _0x288bbc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f26('0x0'));var zipdir=require(_0x6f26('0x1'));var jsonpatch=require(_0x6f26('0x2'));var rp=require(_0x6f26('0x3'));var moment=require(_0x6f26('0x4'));var BPromise=require(_0x6f26('0x5'));var Mustache=require(_0x6f26('0x6'));var util=require('util');var path=require(_0x6f26('0x7'));var sox=require('sox');var csv=require(_0x6f26('0x8'));var ejs=require(_0x6f26('0x9'));var fs=require('fs');var fs_extra=require(_0x6f26('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6f26('0xb'));var jsforce=require(_0x6f26('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6f26('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6f26('0xd'));var authService=require(_0x6f26('0xe'));var qs=require(_0x6f26('0xf'));var as=require(_0x6f26('0x10'));var hardwareService=require(_0x6f26('0x11'));var logger=require(_0x6f26('0x12'))('api');var utils=require(_0x6f26('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6f26('0x14'))['db'];config[_0x6f26('0x15')]=_['defaults'](config[_0x6f26('0x15')],{'host':_0x6f26('0x16'),'port':0x18eb});var socket=require(_0x6f26('0x17'))(new Redis(config[_0x6f26('0x15')]));require('./userNotification.socket')[_0x6f26('0x18')](socket);function respondWithStatusCode(_0x5889c0,_0x3efdfa){_0x3efdfa=_0x3efdfa||0xcc;return function(_0x5e40a2){if(_0x5e40a2){return _0x5889c0[_0x6f26('0x19')](_0x3efdfa);}return _0x5889c0['status'](_0x3efdfa)[_0x6f26('0x1a')]();};}function respondWithResult(_0x284ec8,_0x3f6a57){_0x3f6a57=_0x3f6a57||0xc8;return function(_0x45dacc){if(_0x45dacc){return _0x284ec8[_0x6f26('0x1b')](_0x3f6a57)[_0x6f26('0x1c')](_0x45dacc);}};}function respondWithFilteredResult(_0x16d44f,_0x2d3794){return function(_0x18cb08){if(_0x18cb08){var _0x2e1fda=typeof _0x2d3794[_0x6f26('0x1d')]===_0x6f26('0x1e')&&typeof _0x2d3794[_0x6f26('0x1f')]==='undefined';var _0x1f05ed=_0x18cb08['count'];var _0x5d1ba4=_0x2e1fda?0x0:_0x2d3794[_0x6f26('0x1d')];var _0x310c98=_0x2e1fda?_0x18cb08[_0x6f26('0x20')]:_0x2d3794[_0x6f26('0x1d')]+_0x2d3794['limit'];var _0x5a0a7d;if(_0x310c98>=_0x1f05ed){_0x310c98=_0x1f05ed;_0x5a0a7d=0xc8;}else{_0x5a0a7d=0xce;}_0x16d44f[_0x6f26('0x1b')](_0x5a0a7d);return _0x16d44f[_0x6f26('0x21')](_0x6f26('0x22'),_0x5d1ba4+'-'+_0x310c98+'/'+_0x1f05ed)[_0x6f26('0x1c')](_0x18cb08);}return null;};}function patchUpdates(_0x3417bd){return function(_0x310be9){try{jsonpatch[_0x6f26('0x23')](_0x310be9,_0x3417bd,!![]);}catch(_0x57544b){return BPromise[_0x6f26('0x24')](_0x57544b);}return _0x310be9[_0x6f26('0x25')]();};}function saveUpdates(_0x2ff154,_0x6c4ec3){return function(_0x2f831a){if(_0x2f831a){return _0x2f831a['update'](_0x2ff154)[_0x6f26('0x26')](function(_0x57eef3){return _0x57eef3;});}return null;};}function removeEntity(_0x30efd7,_0x248ed1){return function(_0xb3af78){if(_0xb3af78){return _0xb3af78[_0x6f26('0x27')]()[_0x6f26('0x26')](function(){_0x30efd7['status'](0xcc)[_0x6f26('0x1a')]();});}};}function handleEntityNotFound(_0x43e243,_0x4bbdf8){return function(_0x33f1c5){if(!_0x33f1c5){_0x43e243[_0x6f26('0x19')](0x194);}return _0x33f1c5;};}function handleError(_0x591bca,_0x197099){_0x197099=_0x197099||0x1f4;return function(_0x5b7325){logger['error'](_0x5b7325[_0x6f26('0x28')]);if(_0x5b7325['name']){delete _0x5b7325[_0x6f26('0x29')];}_0x591bca['status'](_0x197099)[_0x6f26('0x2a')](_0x5b7325);};}exports[_0x6f26('0x2b')]=function(_0x4a8d0d,_0x454bc2,_0x4c623a){if(!_0x4a8d0d['body'][_0x6f26('0x2c')]('text')&&!_0x4a8d0d[_0x6f26('0x2d')][_0x6f26('0x2c')](_0x6f26('0x2e'))){throw new db[(_0x6f26('0x2f'))][(_0x6f26('0x30'))](_0x6f26('0x31'));}else{if(_0x4a8d0d['body'][_0x6f26('0x2c')](_0x6f26('0x2e'))&&!_0x4a8d0d[_0x6f26('0x2d')]['hasOwnProperty']('view')){throw new db[(_0x6f26('0x2f'))][(_0x6f26('0x30'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x4a8d0d[_0x6f26('0x2d')]['hasOwnProperty'](_0x6f26('0x32'))){throw new db[(_0x6f26('0x2f'))][(_0x6f26('0x30'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x50b3b9=JSON[_0x6f26('0x33')](_0x4a8d0d['body'][_0x6f26('0x32')]);}catch(_0x4c90fc){logger[_0x6f26('0x34')](_0x4c90fc);throw new db['Sequelize'][(_0x6f26('0x30'))](_0x6f26('0x35'));}var _0x3581a3=[_0x6f26('0x36'),_0x6f26('0x37'),_0x6f26('0x38'),_0x6f26('0x39'),_0x6f26('0x3a'),_0x6f26('0x3b'),'whatsappqueue','team',_0x6f26('0x3c')];if(_[_0x6f26('0x3d')](_0x50b3b9,function(_0x3cbe95){return!_[_0x6f26('0x3e')](_0x3581a3,_0x3cbe95[_0x6f26('0x3f')]['toLowerCase']());})){throw new db['Sequelize'][(_0x6f26('0x30'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x33fad2={};_0x33fad2[_0x6f26('0x40')]=_0x4a8d0d[_0x6f26('0x2d')]['hasOwnProperty'](_0x6f26('0x40'))?_0x4a8d0d[_0x6f26('0x2d')][_0x6f26('0x40')]:_0x4a8d0d[_0x6f26('0x3c')][_0x6f26('0x41')];_0x33fad2['recipientsDescription']=_['isEmpty'](_0x4a8d0d[_0x6f26('0x2d')]['recipientsDescription'])?null:_0x4a8d0d[_0x6f26('0x2d')][_0x6f26('0x42')];_0x33fad2[_0x6f26('0x43')]=_0x4a8d0d[_0x6f26('0x2d')][_0x6f26('0x43')]||![];_0x33fad2[_0x6f26('0x44')]=_0x4a8d0d[_0x6f26('0x3c')]['id'];return getContent(_0x4a8d0d[_0x6f26('0x2d')])['then'](function(_0x4d32ec){_0x33fad2[_0x6f26('0x2d')]=_0x4d32ec;return getRecipients(_0x50b3b9);})[_0x6f26('0x26')](function(_0x4b8aff){_0x33fad2[_0x6f26('0x45')]=_[_0x6f26('0x46')](_0x4b8aff)[_0x6f26('0x47')](',');return db[_0x6f26('0x48')][_0x6f26('0x49')](function(_0xa5ca91){return db[_0x6f26('0x4a')][_0x6f26('0x4b')](_0x33fad2,{'raw':!![],'transaction':_0xa5ca91})[_0x6f26('0x26')](function(_0x5c77a9){var _0x598ef3={'sender':_0x33fad2[_0x6f26('0x40')],'description':_0x33fad2['recipientsDescription'],'content':_0x33fad2['body'],'beep':_0x33fad2[_0x6f26('0x43')]};_0x4b8aff[_0x6f26('0x4c')](function(_0x47c033){_0x598ef3[_0x6f26('0x4d')]=_0x47c033;socket[_0x6f26('0x4e')](_0x6f26('0x4f'),_0x598ef3);});return _0x5c77a9;});});})[_0x6f26('0x26')](respondWithResult(_0x454bc2,0xc9))[_0x6f26('0x50')](handleError(_0x454bc2,null));};function getContent(_0x1d5c71){return new BPromise(function(_0xa5ff83,_0x3e16ec){if(_0x1d5c71[_0x6f26('0x51')]){_0xa5ff83(_0x1d5c71['text']);return;}return db[_0x6f26('0x52')][_0x6f26('0x53')]({'attributes':[_0x6f26('0x54')],'where':{'id':_0x1d5c71[_0x6f26('0x2e')]},'raw':!![]})[_0x6f26('0x26')](function(_0x217e0){if(!_0x217e0)throw new db['Sequelize']['ValidationError'](_0x6f26('0x55'));var _0x14642a=Mustache['render'](_0x217e0['html'],_0x1d5c71[_0x6f26('0x56')]);_0xa5ff83(_0x14642a);})['catch'](function(_0x4b7d50){_0x3e16ec(_0x4b7d50);});});}function getRecipients(_0x129f1c){return new BPromise(function(_0x31f840,_0x21c4ed){var _0x1d4f97=[];var _0xae7406=[];_0x129f1c[_0x6f26('0x4c')](function(_0xa2b36e){var _0x3e3fda=_[_0x6f26('0x57')](_0xa2b36e[_0x6f26('0x3f')]['toLowerCase']());if(_0x3e3fda===_0x6f26('0x58')){_0x1d4f97=_[_0x6f26('0x59')](_0x1d4f97,_0xa2b36e[_0x6f26('0x5a')]);}else{if(_[_0x6f26('0x3e')](_0x3e3fda,'queue'))_0x3e3fda=_0x3e3fda['replace'](_0x6f26('0x5b'),_0x6f26('0x5c'));_0xa2b36e[_0x6f26('0x5a')][_0x6f26('0x4c')](function(_0x2cbd43){_0xae7406[_0x6f26('0x5d')](getAgents(_0x3e3fda,_0x2cbd43));});}});return BPromise[_0x6f26('0x5e')](_0xae7406)[_0x6f26('0x26')](function(_0x471519){_0x1d4f97=_[_0x6f26('0x59')](_0x1d4f97,_[_0x6f26('0x5f')](_0x471519));_0x31f840(_0x1d4f97);})[_0x6f26('0x50')](function(_0x3fd0e8){_0x21c4ed(_0x3fd0e8);});});}function getAgents(_0x152e07,_0x4b4eab){return new BPromise(function(_0x5a38cc,_0x2756a9){return db[_0x152e07][_0x6f26('0x53')]({'where':{'id':_0x4b4eab}})[_0x6f26('0x26')](function(_0x510817){return _0x510817[_0x6f26('0x60')]({'attributes':['id'],'raw':!![]})[_0x6f26('0x26')](function(_0x18e793){var _0x5a8c89=_[_0x6f26('0x61')](_0x18e793,'id');_0x5a38cc(_0x5a8c89);});})[_0x6f26('0x50')](function(_0x58c43d){_0x2756a9(_0x58c43d);});});} \ No newline at end of file +var _0xde4e=['flatten','getAgents','map','eml-format','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','localhost','./userNotification.socket','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','team','user','some','includes','model','toLowerCase','senderName','recipientsDescription','isEmpty','beep','SenderId','sortBy','join','sequelize','transaction','UserNotification','forEach','recipient','emit','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','User','union','ids','push','all'];(function(_0x14e785,_0x11138c){var _0x30cd2b=function(_0x1c6745){while(--_0x1c6745){_0x14e785['push'](_0x14e785['shift']());}};_0x30cd2b(++_0x11138c);}(_0xde4e,0x1e8));var _0xede4=function(_0x533cdf,_0x15fa9f){_0x533cdf=_0x533cdf-0x0;var _0x4bde88=_0xde4e[_0x533cdf];return _0x4bde88;};'use strict';var emlformat=require(_0xede4('0x0'));var rimraf=require(_0xede4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xede4('0x2'));var rp=require(_0xede4('0x3'));var moment=require(_0xede4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xede4('0x5'));var util=require(_0xede4('0x6'));var path=require(_0xede4('0x7'));var sox=require('sox');var csv=require(_0xede4('0x8'));var ejs=require(_0xede4('0x9'));var fs=require('fs');var fs_extra=require(_0xede4('0xa'));var _=require(_0xede4('0xb'));var squel=require(_0xede4('0xc'));var crypto=require(_0xede4('0xd'));var jsforce=require(_0xede4('0xe'));var deskjs=require(_0xede4('0xf'));var toCsv=require(_0xede4('0x8'));var querystring=require(_0xede4('0x10'));var Papa=require(_0xede4('0x11'));var Redis=require(_0xede4('0x12'));var authService=require(_0xede4('0x13'));var qs=require(_0xede4('0x14'));var as=require(_0xede4('0x15'));var hardwareService=require(_0xede4('0x16'));var logger=require(_0xede4('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xede4('0x18'));var licenseUtil=require(_0xede4('0x19'));var db=require('../../mysqldb')['db'];config[_0xede4('0x1a')]=_['defaults'](config[_0xede4('0x1a')],{'host':_0xede4('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xede4('0x1a')]));require(_0xede4('0x1c'))['register'](socket);function respondWithStatusCode(_0x55ef4b,_0x938058){_0x938058=_0x938058||0xcc;return function(_0x31c1ac){if(_0x31c1ac){return _0x55ef4b['sendStatus'](_0x938058);}return _0x55ef4b[_0xede4('0x1d')](_0x938058)[_0xede4('0x1e')]();};}function respondWithResult(_0x339eeb,_0x25e4d6){_0x25e4d6=_0x25e4d6||0xc8;return function(_0x5e026b){if(_0x5e026b){return _0x339eeb[_0xede4('0x1d')](_0x25e4d6)[_0xede4('0x1f')](_0x5e026b);}};}function respondWithFilteredResult(_0xa233b9,_0x15fa24){return function(_0x495a63){if(_0x495a63){var _0x135aa7=typeof _0x15fa24[_0xede4('0x20')]===_0xede4('0x21')&&typeof _0x15fa24[_0xede4('0x22')]===_0xede4('0x21');var _0x14701e=_0x495a63['count'];var _0x395b21=_0x135aa7?0x0:_0x15fa24['offset'];var _0x3c6c9a=_0x135aa7?_0x495a63['count']:_0x15fa24['offset']+_0x15fa24[_0xede4('0x22')];var _0x1bf36f;if(_0x3c6c9a>=_0x14701e){_0x3c6c9a=_0x14701e;_0x1bf36f=0xc8;}else{_0x1bf36f=0xce;}_0xa233b9['status'](_0x1bf36f);return _0xa233b9[_0xede4('0x23')](_0xede4('0x24'),_0x395b21+'-'+_0x3c6c9a+'/'+_0x14701e)[_0xede4('0x1f')](_0x495a63);}return null;};}function patchUpdates(_0x92f0de){return function(_0x5aba39){try{jsonpatch[_0xede4('0x25')](_0x5aba39,_0x92f0de,!![]);}catch(_0x3b881b){return BPromise[_0xede4('0x26')](_0x3b881b);}return _0x5aba39[_0xede4('0x27')]();};}function saveUpdates(_0xf97535,_0x29aff8){return function(_0x432c32){if(_0x432c32){return _0x432c32[_0xede4('0x28')](_0xf97535)[_0xede4('0x29')](function(_0x911a6d){return _0x911a6d;});}return null;};}function removeEntity(_0x29fce8,_0x49f2a8){return function(_0xa8acea){if(_0xa8acea){return _0xa8acea[_0xede4('0x2a')]()[_0xede4('0x29')](function(){_0x29fce8['status'](0xcc)[_0xede4('0x1e')]();});}};}function handleEntityNotFound(_0x4dbca2,_0x25343d){return function(_0x42037c){if(!_0x42037c){_0x4dbca2['sendStatus'](0x194);}return _0x42037c;};}function handleError(_0x58fbcb,_0x19aa5f){_0x19aa5f=_0x19aa5f||0x1f4;return function(_0x1e2054){logger['error'](_0x1e2054[_0xede4('0x2b')]);if(_0x1e2054['name']){delete _0x1e2054['name'];}_0x58fbcb['status'](_0x19aa5f)[_0xede4('0x2c')](_0x1e2054);};}exports[_0xede4('0x2d')]=function(_0x47afff,_0x54dba3,_0x332988){if(!_0x47afff[_0xede4('0x2e')][_0xede4('0x2f')](_0xede4('0x30'))&&!_0x47afff[_0xede4('0x2e')][_0xede4('0x2f')](_0xede4('0x31'))){throw new db[(_0xede4('0x32'))]['ValidationError'](_0xede4('0x33'));}else{if(_0x47afff[_0xede4('0x2e')][_0xede4('0x2f')](_0xede4('0x31'))&&!_0x47afff['body'][_0xede4('0x2f')](_0xede4('0x34'))){throw new db[(_0xede4('0x32'))][(_0xede4('0x35'))](_0xede4('0x36'));}if(!_0x47afff['body'][_0xede4('0x2f')](_0xede4('0x37'))){throw new db[(_0xede4('0x32'))][(_0xede4('0x35'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0xc0611a=JSON[_0xede4('0x38')](_0x47afff[_0xede4('0x2e')][_0xede4('0x37')]);}catch(_0x486e96){logger[_0xede4('0x39')](_0x486e96);throw new db[(_0xede4('0x32'))][(_0xede4('0x35'))](_0xede4('0x3a'));}var _0x10cf4b=[_0xede4('0x3b'),_0xede4('0x3c'),'mailqueue',_0xede4('0x3d'),_0xede4('0x3e'),_0xede4('0x3f'),'whatsappqueue',_0xede4('0x40'),_0xede4('0x41')];if(_[_0xede4('0x42')](_0xc0611a,function(_0x31c644){return!_[_0xede4('0x43')](_0x10cf4b,_0x31c644[_0xede4('0x44')][_0xede4('0x45')]());})){throw new db[(_0xede4('0x32'))][(_0xede4('0x35'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x5461a9={};_0x5461a9['senderName']=_0x47afff[_0xede4('0x2e')][_0xede4('0x2f')]('senderName')?_0x47afff[_0xede4('0x2e')][_0xede4('0x46')]:_0x47afff['user']['fullname'];_0x5461a9[_0xede4('0x47')]=_[_0xede4('0x48')](_0x47afff[_0xede4('0x2e')]['recipientsDescription'])?null:_0x47afff['body'][_0xede4('0x47')];_0x5461a9[_0xede4('0x49')]=_0x47afff[_0xede4('0x2e')]['beep']||![];_0x5461a9[_0xede4('0x4a')]=_0x47afff[_0xede4('0x41')]['id'];return getContent(_0x47afff['body'])['then'](function(_0x5d2b99){_0x5461a9[_0xede4('0x2e')]=_0x5d2b99;return getRecipients(_0xc0611a);})[_0xede4('0x29')](function(_0x168ede){_0x5461a9['recipientsId']=_[_0xede4('0x4b')](_0x168ede)[_0xede4('0x4c')](',');return db[_0xede4('0x4d')][_0xede4('0x4e')](function(_0x2c13f6){return db[_0xede4('0x4f')]['create'](_0x5461a9,{'raw':!![],'transaction':_0x2c13f6})[_0xede4('0x29')](function(_0x179236){var _0x41049c={'sender':_0x5461a9[_0xede4('0x46')],'description':_0x5461a9['recipientsDescription'],'content':_0x5461a9['body'],'beep':_0x5461a9['beep']};_0x168ede[_0xede4('0x50')](function(_0x41c384){_0x41049c[_0xede4('0x51')]=_0x41c384;socket[_0xede4('0x52')]('userNotification:send',_0x41049c);});return _0x179236;});});})['then'](respondWithResult(_0x54dba3,0xc9))[_0xede4('0x53')](handleError(_0x54dba3,null));};function getContent(_0x5f4097){return new BPromise(function(_0x4d9876,_0xd2b96e){if(_0x5f4097[_0xede4('0x30')]){_0x4d9876(_0x5f4097[_0xede4('0x30')]);return;}return db[_0xede4('0x54')][_0xede4('0x55')]({'attributes':['html'],'where':{'id':_0x5f4097['TemplateId']},'raw':!![]})['then'](function(_0x373935){if(!_0x373935)throw new db[(_0xede4('0x32'))][(_0xede4('0x35'))](_0xede4('0x56'));var _0x6eae89=Mustache[_0xede4('0x57')](_0x373935[_0xede4('0x58')],_0x5f4097[_0xede4('0x34')]);_0x4d9876(_0x6eae89);})[_0xede4('0x53')](function(_0x4a27dd){_0xd2b96e(_0x4a27dd);});});}function getRecipients(_0x141318){return new BPromise(function(_0x2a617e,_0xfef9f5){var _0x40363d=[];var _0x15a4c9=[];_0x141318[_0xede4('0x50')](function(_0x139cce){var _0x46cad1=_['startCase'](_0x139cce[_0xede4('0x44')]['toLowerCase']());if(_0x46cad1===_0xede4('0x59')){_0x40363d=_[_0xede4('0x5a')](_0x40363d,_0x139cce[_0xede4('0x5b')]);}else{if(_[_0xede4('0x43')](_0x46cad1,'queue'))_0x46cad1=_0x46cad1['replace']('queue','Queue');_0x139cce[_0xede4('0x5b')][_0xede4('0x50')](function(_0x8e6a36){_0x15a4c9[_0xede4('0x5c')](getAgents(_0x46cad1,_0x8e6a36));});}});return BPromise[_0xede4('0x5d')](_0x15a4c9)[_0xede4('0x29')](function(_0x2dfda8){_0x40363d=_[_0xede4('0x5a')](_0x40363d,_[_0xede4('0x5e')](_0x2dfda8));_0x2a617e(_0x40363d);})[_0xede4('0x53')](function(_0x19ef14){_0xfef9f5(_0x19ef14);});});}function getAgents(_0x2de635,_0x13bf8f){return new BPromise(function(_0x2d538e,_0x2e5413){return db[_0x2de635][_0xede4('0x55')]({'where':{'id':_0x13bf8f}})[_0xede4('0x29')](function(_0x45e571){return _0x45e571[_0xede4('0x5f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x568596){var _0x198384=_[_0xede4('0x60')](_0x568596,'id');_0x2d538e(_0x198384);});})[_0xede4('0x53')](function(_0x432771){_0x2e5413(_0x432771);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 2c39199..429d935 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 _0x4d8c=['hasOwnProperty','../../mysqldb','save','update','remove','emit'];(function(_0x246116,_0x2330f5){var _0x5ab8e4=function(_0x2a965f){while(--_0x2a965f){_0x246116['push'](_0x246116['shift']());}};_0x5ab8e4(++_0x2330f5);}(_0x4d8c,0x1a5));var _0xc4d8=function(_0x38909a,_0x19b2ec){_0x38909a=_0x38909a-0x0;var _0x13db91=_0x4d8c[_0x38909a];return _0x13db91;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xc4d8('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc4d8('0x1'),'afterUpdate':_0xc4d8('0x2'),'afterDestroy':_0xc4d8('0x3')};function emitEvent(_0x84ea63){return function(_0x2d5a35,_0x2cc850,_0x6b2672){UserNotificationEvents[_0xc4d8('0x4')](_0x84ea63+':'+_0x2d5a35['id'],_0x2d5a35);UserNotificationEvents[_0xc4d8('0x4')](_0x84ea63,_0x2d5a35);_0x6b2672(null);};}for(var e in events){if(events[_0xc4d8('0x5')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0xb958=['../../mysqldb','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x25e227,_0x56dbc0){var _0x3df0c2=function(_0x4a694f){while(--_0x4a694f){_0x25e227['push'](_0x25e227['shift']());}};_0x3df0c2(++_0x56dbc0);}(_0xb958,0x97));var _0x8b95=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xb958[_0x10004e];return _0x5af990;};'use strict';var EventEmitter=require(_0x8b95('0x0'));var UserNotification=require(_0x8b95('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8b95('0x2'),'afterUpdate':_0x8b95('0x3'),'afterDestroy':_0x8b95('0x4')};function emitEvent(_0x236609){return function(_0x4a388d,_0x4a0a97,_0x13d9ea){UserNotificationEvents[_0x8b95('0x5')](_0x236609+':'+_0x4a388d['id'],_0x4a388d);UserNotificationEvents[_0x8b95('0x5')](_0x236609,_0x4a388d);_0x13d9ea(null);};}for(var e in events){if(events[_0x8b95('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x8b95('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index afb1859..a5907fc 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 _0x7788=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification'];(function(_0x60df74,_0x458e29){var _0x5ee872=function(_0x356888){while(--_0x356888){_0x60df74['push'](_0x60df74['shift']());}};_0x5ee872(++_0x458e29);}(_0x7788,0x13c));var _0x8778=function(_0x57f8c0,_0x136cf6){_0x57f8c0=_0x57f8c0-0x0;var _0x117f08=_0x7788[_0x57f8c0];return _0x117f08;};'use strict';var _=require(_0x8778('0x0'));var util=require(_0x8778('0x1'));var logger=require(_0x8778('0x2'))(_0x8778('0x3'));var moment=require(_0x8778('0x4'));var BPromise=require(_0x8778('0x5'));var rp=require(_0x8778('0x6'));var fs=require('fs');var path=require(_0x8778('0x7'));var rimraf=require(_0x8778('0x8'));var config=require(_0x8778('0x9'));var attributes=require(_0x8778('0xa'));module[_0x8778('0xb')]=function(_0x3e4b76,_0x5bc4f0){return _0x3e4b76[_0x8778('0xc')](_0x8778('0xd'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8778('0xe')});}; \ No newline at end of file +var _0xcb2d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','userNotifications','lodash','../../config/logger'];(function(_0x5c468f,_0x2e5c25){var _0x2136b0=function(_0x56b8a4){while(--_0x56b8a4){_0x5c468f['push'](_0x5c468f['shift']());}};_0x2136b0(++_0x2e5c25);}(_0xcb2d,0x106));var _0xdcb2=function(_0x41fb42,_0x365de7){_0x41fb42=_0x41fb42-0x0;var _0x3a9ac1=_0xcb2d[_0x41fb42];return _0x3a9ac1;};'use strict';var _=require(_0xdcb2('0x0'));var util=require('util');var logger=require(_0xdcb2('0x1'))(_0xdcb2('0x2'));var moment=require(_0xdcb2('0x3'));var BPromise=require(_0xdcb2('0x4'));var rp=require(_0xdcb2('0x5'));var fs=require('fs');var path=require(_0xdcb2('0x6'));var rimraf=require(_0xdcb2('0x7'));var config=require(_0xdcb2('0x8'));var attributes=require(_0xdcb2('0x9'));module['exports']=function(_0xdc1ed6,_0x5e6b5b){return _0xdc1ed6['define']('UserNotification',attributes,{'tableName':_0xdcb2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index fecf246..0f02de8 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 _0xe9df=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird'];(function(_0x4a8168,_0x1bc785){var _0x151a28=function(_0x370b19){while(--_0x370b19){_0x4a8168['push'](_0x4a8168['shift']());}};_0x151a28(++_0x1bc785);}(_0xe9df,0x128));var _0xfe9d=function(_0xae4429,_0xe2082a){_0xae4429=_0xae4429-0x0;var _0x554179=_0xe9df[_0xae4429];return _0x554179;};'use strict';var _=require(_0xfe9d('0x0'));var util=require(_0xfe9d('0x1'));var moment=require(_0xfe9d('0x2'));var BPromise=require(_0xfe9d('0x3'));var rs=require(_0xfe9d('0x4'));var fs=require('fs');var Redis=require(_0xfe9d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe9d('0x6'));var logger=require(_0xfe9d('0x7'))(_0xfe9d('0x8'));var config=require(_0xfe9d('0x9'));var jayson=require(_0xfe9d('0xa'));var client=jayson[_0xfe9d('0xb')][_0xfe9d('0xc')]({'port':0x232a});config[_0xfe9d('0xd')]=_[_0xfe9d('0xe')](config[_0xfe9d('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xfe9d('0xf'))(new Redis(config['redis']));require(_0xfe9d('0x10'))[_0xfe9d('0x11')](socket);function respondWithRpcPromise(_0x1179ba,_0x1eece4,_0xaab444){return new BPromise(function(_0x589e80,_0x1010cb){return client[_0xfe9d('0x12')](_0x1179ba,_0xaab444)[_0xfe9d('0x13')](function(_0x52f6db){logger['info'](_0xfe9d('0x14'),_0x1eece4,_0xfe9d('0x15'));logger[_0xfe9d('0x16')](_0xfe9d('0x17'),_0x1eece4,_0xfe9d('0x15'),JSON[_0xfe9d('0x18')](_0x52f6db));if(_0x52f6db[_0xfe9d('0x19')]){if(_0x52f6db[_0xfe9d('0x19')][_0xfe9d('0x1a')]===0x1f4){logger[_0xfe9d('0x19')](_0xfe9d('0x14'),_0x1eece4,_0x52f6db[_0xfe9d('0x19')][_0xfe9d('0x1b')]);return _0x1010cb(_0x52f6db[_0xfe9d('0x19')][_0xfe9d('0x1b')]);}logger[_0xfe9d('0x19')](_0xfe9d('0x14'),_0x1eece4,_0x52f6db[_0xfe9d('0x19')]['message']);return _0x589e80(_0x52f6db[_0xfe9d('0x19')]['message']);}else{logger[_0xfe9d('0x1c')]('UserNotification,\x20%s,\x20%s',_0x1eece4,_0xfe9d('0x15'));_0x589e80(_0x52f6db['result'][_0xfe9d('0x1b')]);}})[_0xfe9d('0x1d')](function(_0x415f4a){logger['error'](_0xfe9d('0x14'),_0x1eece4,_0x415f4a);_0x1010cb(_0x415f4a);});});} \ No newline at end of file +var _0xebc2=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','then','info','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis'];(function(_0x54856c,_0xfa85b){var _0x2ca74b=function(_0x33ed88){while(--_0x33ed88){_0x54856c['push'](_0x54856c['shift']());}};_0x2ca74b(++_0xfa85b);}(_0xebc2,0x1a0));var _0x2ebc=function(_0x2b8894,_0x2aa8e8){_0x2b8894=_0x2b8894-0x0;var _0x389679=_0xebc2[_0x2b8894];return _0x389679;};'use strict';var _=require('lodash');var util=require(_0x2ebc('0x0'));var moment=require(_0x2ebc('0x1'));var BPromise=require(_0x2ebc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ebc('0x3'));var db=require(_0x2ebc('0x4'))['db'];var utils=require(_0x2ebc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2ebc('0x6'));var jayson=require(_0x2ebc('0x7'));var client=jayson[_0x2ebc('0x8')][_0x2ebc('0x9')]({'port':0x232a});config['redis']=_[_0x2ebc('0xa')](config[_0x2ebc('0xb')],{'host':_0x2ebc('0xc'),'port':0x18eb});var socket=require(_0x2ebc('0xd'))(new Redis(config[_0x2ebc('0xb')]));require(_0x2ebc('0xe'))[_0x2ebc('0xf')](socket);function respondWithRpcPromise(_0x428085,_0x2a7d80,_0x19fced){return new BPromise(function(_0x20eef3,_0x30c8f8){return client['request'](_0x428085,_0x19fced)[_0x2ebc('0x10')](function(_0x407b92){logger[_0x2ebc('0x11')]('UserNotification,\x20%s,\x20%s',_0x2a7d80,'request\x20sent');logger[_0x2ebc('0x12')](_0x2ebc('0x13'),_0x2a7d80,_0x2ebc('0x14'),JSON[_0x2ebc('0x15')](_0x407b92));if(_0x407b92[_0x2ebc('0x16')]){if(_0x407b92['error'][_0x2ebc('0x17')]===0x1f4){logger[_0x2ebc('0x16')](_0x2ebc('0x18'),_0x2a7d80,_0x407b92[_0x2ebc('0x16')][_0x2ebc('0x19')]);return _0x30c8f8(_0x407b92[_0x2ebc('0x16')][_0x2ebc('0x19')]);}logger['error']('UserNotification,\x20%s,\x20%s',_0x2a7d80,_0x407b92[_0x2ebc('0x16')]['message']);return _0x20eef3(_0x407b92[_0x2ebc('0x16')][_0x2ebc('0x19')]);}else{logger['info'](_0x2ebc('0x18'),_0x2a7d80,_0x2ebc('0x14'));_0x20eef3(_0x407b92[_0x2ebc('0x1a')][_0x2ebc('0x19')]);}})[_0x2ebc('0x1b')](function(_0x5ec751){logger[_0x2ebc('0x16')](_0x2ebc('0x18'),_0x2a7d80,_0x5ec751);_0x30c8f8(_0x5ec751);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index f2a0165..eae451b 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 _0x225c=['length','userNotification:','./userNotification.events','update','emit','removeListener','register'];(function(_0x4ec612,_0x57dfd6){var _0x52a015=function(_0x2771d1){while(--_0x2771d1){_0x4ec612['push'](_0x4ec612['shift']());}};_0x52a015(++_0x57dfd6);}(_0x225c,0x1c9));var _0xc225=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x225c[_0x20a584];return _0x4b41a8;};'use strict';var UserNotificationEvents=require(_0xc225('0x0'));var events=['save','remove',_0xc225('0x1')];function createListener(_0x308e60,_0x25e0c5){return function(_0x36b52c){_0x25e0c5[_0xc225('0x2')](_0x308e60,_0x36b52c);};}function removeListener(_0x540d59,_0xf5baa6){return function(){UserNotificationEvents[_0xc225('0x3')](_0x540d59,_0xf5baa6);};}exports[_0xc225('0x4')]=function(_0x244187){for(var _0x464a55=0x0,_0x5e5755=events[_0xc225('0x5')];_0x464a55<_0x5e5755;_0x464a55++){var _0xe11c74=events[_0x464a55];var _0x1276c2=createListener(_0xc225('0x6')+_0xe11c74,_0x244187);UserNotificationEvents['on'](_0xe11c74,_0x1276c2);}}; \ No newline at end of file +var _0x3784=['emit','removeListener','register','length','./userNotification.events','save','remove','update'];(function(_0x42d5a8,_0x5c8015){var _0x4c6b9c=function(_0x591f15){while(--_0x591f15){_0x42d5a8['push'](_0x42d5a8['shift']());}};_0x4c6b9c(++_0x5c8015);}(_0x3784,0x64));var _0x4378=function(_0x4b9a1b,_0x5d368c){_0x4b9a1b=_0x4b9a1b-0x0;var _0x4465e8=_0x3784[_0x4b9a1b];return _0x4465e8;};'use strict';var UserNotificationEvents=require(_0x4378('0x0'));var events=[_0x4378('0x1'),_0x4378('0x2'),_0x4378('0x3')];function createListener(_0x4bf5f1,_0x161aad){return function(_0x45c1d3){_0x161aad[_0x4378('0x4')](_0x4bf5f1,_0x45c1d3);};}function removeListener(_0x5ac788,_0x4a4e9e){return function(){UserNotificationEvents[_0x4378('0x5')](_0x5ac788,_0x4a4e9e);};}exports[_0x4378('0x6')]=function(_0x5f0821){for(var _0x53416e=0x0,_0x4a8746=events[_0x4378('0x7')];_0x53416e<_0x4a8746;_0x53416e++){var _0x1ea726=events[_0x53416e];var _0x1573a6=createListener('userNotification:'+_0x1ea726,_0x5f0821);UserNotificationEvents['on'](_0x1ea726,_0x1573a6);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 8271b93..7d75965 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3a8746,_0x2a6512){var _0x3b349c=function(_0x39ae27){while(--_0x39ae27){_0x3a8746['push'](_0x3a8746['shift']());}};_0x3b349c(++_0x2a6512);}(_0xedd9,0xfc));var _0x9edd=function(_0x21925a,_0x66d7bf){_0x21925a=_0x21925a-0x0;var _0x581f85=_0xedd9[_0x21925a];return _0x581f85;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x201c79,_0x479c1b){var _0x5620b5=function(_0x3c8b78){while(--_0x3c8b78){_0x201c79['push'](_0x201c79['shift']());}};_0x5620b5(++_0x479c1b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0xcb91[_0x1bc0ae];return _0x501104;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 4634050..89f8d80 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 _0x7b34=['exports','sequelize'];(function(_0x5db178,_0x2aa450){var _0x4b9ae6=function(_0x44cd40){while(--_0x44cd40){_0x5db178['push'](_0x5db178['shift']());}};_0x4b9ae6(++_0x2aa450);}(_0x7b34,0x13f));var _0x47b3=function(_0x19c007,_0x57f24e){_0x19c007=_0x19c007-0x0;var _0x345156=_0x7b34[_0x19c007];return _0x345156;};'use strict';var Sequelize=require(_0x47b3('0x0'));module[_0x47b3('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa82a=['INTEGER','sequelize','exports'];(function(_0x34ac05,_0x108ef2){var _0x33f687=function(_0x1cb90e){while(--_0x1cb90e){_0x34ac05['push'](_0x34ac05['shift']());}};_0x33f687(++_0x108ef2);}(_0xa82a,0x1e7));var _0xaa82=function(_0x269c28,_0x388c4b){_0x269c28=_0x269c28-0x0;var _0x74c33e=_0xa82a[_0x269c28];return _0x74c33e;};'use strict';var Sequelize=require(_0xaa82('0x0'));module[_0xaa82('0x1')]={'penalty':{'type':Sequelize[_0xaa82('0x2')],'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 72768d7..e7b2015 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 _0x0e12=['exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x446789,_0x40aa74){var _0x534e45=function(_0x3b9809){while(--_0x3b9809){_0x446789['push'](_0x446789['shift']());}};_0x534e45(++_0x40aa74);}(_0x0e12,0x130));var _0x20e1=function(_0xa3c06b,_0x490f99){_0xa3c06b=_0xa3c06b-0x0;var _0x33aa1d=_0x0e12[_0xa3c06b];return _0x33aa1d;};'use strict';var _=require(_0x20e1('0x0'));var util=require(_0x20e1('0x1'));var logger=require(_0x20e1('0x2'))(_0x20e1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x20e1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20e1('0x5'));var config=require(_0x20e1('0x6'));var attributes=require(_0x20e1('0x7'));module[_0x20e1('0x8')]=function(_0x35cb73,_0x1cf47d){return _0x35cb73[_0x20e1('0x9')](_0x20e1('0xa'),attributes,{'tableName':_0x20e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6c4=['user_has_openchannel_queues','util','../../config/logger','api','path','rimraf','../../config/environment','exports'];(function(_0xed06aa,_0x47f7ca){var _0x566ed7=function(_0x3c907b){while(--_0x3c907b){_0xed06aa['push'](_0xed06aa['shift']());}};_0x566ed7(++_0x47f7ca);}(_0xb6c4,0x1b9));var _0x4b6c=function(_0x1842a0,_0x35a340){_0x1842a0=_0x1842a0-0x0;var _0x3fbaa6=_0xb6c4[_0x1842a0];return _0x3fbaa6;};'use strict';var _=require('lodash');var util=require(_0x4b6c('0x0'));var logger=require(_0x4b6c('0x1'))(_0x4b6c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b6c('0x3'));var rimraf=require(_0x4b6c('0x4'));var config=require(_0x4b6c('0x5'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x4b6c('0x6')]=function(_0x410425,_0xe22357){return _0x410425['define']('UserOpenchannelQueue',attributes,{'tableName':_0x4b6c('0x7'),'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 f6c263e..2e6799c 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 _0xc690=['error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','code'];(function(_0xeaa4d5,_0x51b48b){var _0x38a7da=function(_0x2eaec3){while(--_0x2eaec3){_0xeaa4d5['push'](_0xeaa4d5['shift']());}};_0x38a7da(++_0x51b48b);}(_0xc690,0x146));var _0x0c69=function(_0xdc43c7,_0x39ff1a){_0xdc43c7=_0xdc43c7-0x0;var _0x1d1da0=_0xc690[_0xdc43c7];return _0x1d1da0;};'use strict';var _=require(_0x0c69('0x0'));var util=require(_0x0c69('0x1'));var moment=require(_0x0c69('0x2'));var BPromise=require(_0x0c69('0x3'));var rs=require(_0x0c69('0x4'));var fs=require('fs');var Redis=require(_0x0c69('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c69('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0c69('0x7'));var jayson=require(_0x0c69('0x8'));var client=jayson['client'][_0x0c69('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f7235,_0x1fa985,_0x93b571){return new BPromise(function(_0x5c6592,_0x2b4bb0){return client[_0x0c69('0xa')](_0x3f7235,_0x93b571)['then'](function(_0x10e351){logger[_0x0c69('0xb')](_0x0c69('0xc'),_0x1fa985,_0x0c69('0xd'));logger['debug'](_0x0c69('0xe'),_0x1fa985,_0x0c69('0xd'),JSON['stringify'](_0x10e351));if(_0x10e351['error']){if(_0x10e351['error'][_0x0c69('0xf')]===0x1f4){logger[_0x0c69('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1fa985,_0x10e351[_0x0c69('0x10')][_0x0c69('0x11')]);return _0x2b4bb0(_0x10e351[_0x0c69('0x10')]['message']);}logger['error'](_0x0c69('0xc'),_0x1fa985,_0x10e351[_0x0c69('0x10')][_0x0c69('0x11')]);return _0x5c6592(_0x10e351[_0x0c69('0x10')][_0x0c69('0x11')]);}else{logger[_0x0c69('0xb')](_0x0c69('0xc'),_0x1fa985,_0x0c69('0xd'));_0x5c6592(_0x10e351[_0x0c69('0x12')]['message']);}})['catch'](function(_0x48257a){logger[_0x0c69('0x10')](_0x0c69('0xc'),_0x1fa985,_0x48257a);_0x2b4bb0(_0x48257a);});});} \ No newline at end of file +var _0xd0d9=['jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1ef20f,_0x14d924){var _0x589016=function(_0x900d7e){while(--_0x900d7e){_0x1ef20f['push'](_0x1ef20f['shift']());}};_0x589016(++_0x14d924);}(_0xd0d9,0x75));var _0x9d0d=function(_0x51310b,_0x55f4f6){_0x51310b=_0x51310b-0x0;var _0x3e2c0c=_0xd0d9[_0x51310b];return _0x3e2c0c;};'use strict';var _=require(_0x9d0d('0x0'));var util=require(_0x9d0d('0x1'));var moment=require(_0x9d0d('0x2'));var BPromise=require(_0x9d0d('0x3'));var rs=require(_0x9d0d('0x4'));var fs=require('fs');var Redis=require(_0x9d0d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d0d('0x6'));var logger=require(_0x9d0d('0x7'))('rpc');var config=require(_0x9d0d('0x8'));var jayson=require(_0x9d0d('0x9'));var client=jayson[_0x9d0d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42c727,_0x5aea60,_0xa65841){return new BPromise(function(_0x475264,_0x3c6f5c){return client[_0x9d0d('0xb')](_0x42c727,_0xa65841)[_0x9d0d('0xc')](function(_0x2389a8){logger[_0x9d0d('0xd')](_0x9d0d('0xe'),_0x5aea60,'request\x20sent');logger[_0x9d0d('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5aea60,'request\x20sent',JSON[_0x9d0d('0x10')](_0x2389a8));if(_0x2389a8[_0x9d0d('0x11')]){if(_0x2389a8[_0x9d0d('0x11')]['code']===0x1f4){logger[_0x9d0d('0x11')](_0x9d0d('0xe'),_0x5aea60,_0x2389a8[_0x9d0d('0x11')][_0x9d0d('0x12')]);return _0x3c6f5c(_0x2389a8[_0x9d0d('0x11')][_0x9d0d('0x12')]);}logger[_0x9d0d('0x11')](_0x9d0d('0xe'),_0x5aea60,_0x2389a8[_0x9d0d('0x11')][_0x9d0d('0x12')]);return _0x475264(_0x2389a8[_0x9d0d('0x11')]['message']);}else{logger[_0x9d0d('0xd')](_0x9d0d('0xe'),_0x5aea60,'request\x20sent');_0x475264(_0x2389a8[_0x9d0d('0x13')][_0x9d0d('0x12')]);}})[_0x9d0d('0x14')](function(_0xe1fb06){logger[_0x9d0d('0x11')](_0x9d0d('0xe'),_0x5aea60,_0xe1fb06);_0x3c6f5c(_0xe1fb06);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index fa357f0..2c34784 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 _0xbf9d=['/:id','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addResources','update','delete','destroy','removeSections','removeResources','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','isAuthenticated'];(function(_0x15dbd6,_0x2b67e9){var _0x598e01=function(_0x1b9f69){while(--_0x1b9f69){_0x15dbd6['push'](_0x15dbd6['shift']());}};_0x598e01(++_0x2b67e9);}(_0xbf9d,0x1c9));var _0xdbf9=function(_0x5e1e1b,_0x298762){_0x5e1e1b=_0x5e1e1b-0x0;var _0x179180=_0xbf9d[_0x5e1e1b];return _0x179180;};'use strict';var multer=require('multer');var util=require(_0xdbf9('0x0'));var path=require('path');var timeout=require(_0xdbf9('0x1'));var express=require(_0xdbf9('0x2'));var router=express[_0xdbf9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdbf9('0x4'));var interaction=require(_0xdbf9('0x5'));var config=require(_0xdbf9('0x6'));var controller=require(_0xdbf9('0x7'));router[_0xdbf9('0x8')]('/',auth['isAuthenticated'](),controller[_0xdbf9('0x9')]);router[_0xdbf9('0x8')]('/describe',auth[_0xdbf9('0xa')](),controller['describe']);router['get'](_0xdbf9('0xb'),auth[_0xdbf9('0xa')](),controller['show']);router[_0xdbf9('0x8')](_0xdbf9('0xc'),auth[_0xdbf9('0xa')](),controller[_0xdbf9('0xd')]);router[_0xdbf9('0x8')](_0xdbf9('0xe'),auth['isAuthenticated'](),controller[_0xdbf9('0xf')]);router[_0xdbf9('0x10')]('/',auth[_0xdbf9('0xa')](),controller[_0xdbf9('0x11')]);router[_0xdbf9('0x10')](_0xdbf9('0x12'),auth[_0xdbf9('0xa')](),controller[_0xdbf9('0x13')]);router[_0xdbf9('0x10')](_0xdbf9('0xc'),auth[_0xdbf9('0xa')](),controller['addSections']);router[_0xdbf9('0x10')]('/:id/resources',auth['isAuthenticated'](),controller[_0xdbf9('0x14')]);router['put'](_0xdbf9('0xb'),auth[_0xdbf9('0xa')](),controller[_0xdbf9('0x15')]);router[_0xdbf9('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xdbf9('0x17')]);router[_0xdbf9('0x16')]('/:id/sections',auth[_0xdbf9('0xa')](),controller[_0xdbf9('0x18')]);router[_0xdbf9('0x16')](_0xdbf9('0xe'),auth[_0xdbf9('0xa')](),controller[_0xdbf9('0x19')]);module['exports']=router; \ No newline at end of file +var _0xc1ec=['isAuthenticated','index','get','describe','/:id','/:id/sections','getResources','post','create','/:id/clone','addSections','/:id/resources','addResources','put','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc1ec,0x165));var _0xcc1e=function(_0x28a164,_0x25d0a2){_0x28a164=_0x28a164-0x0;var _0x440c8c=_0xc1ec[_0x28a164];return _0x440c8c;};'use strict';var multer=require(_0xcc1e('0x0'));var util=require(_0xcc1e('0x1'));var path=require(_0xcc1e('0x2'));var timeout=require(_0xcc1e('0x3'));var express=require(_0xcc1e('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcc1e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcc1e('0x6'));var controller=require('./userProfile.controller');router['get']('/',auth[_0xcc1e('0x7')](),controller[_0xcc1e('0x8')]);router[_0xcc1e('0x9')]('/describe',auth[_0xcc1e('0x7')](),controller[_0xcc1e('0xa')]);router[_0xcc1e('0x9')](_0xcc1e('0xb'),auth[_0xcc1e('0x7')](),controller['show']);router['get'](_0xcc1e('0xc'),auth['isAuthenticated'](),controller['getSections']);router[_0xcc1e('0x9')]('/:id/resources',auth[_0xcc1e('0x7')](),controller[_0xcc1e('0xd')]);router[_0xcc1e('0xe')]('/',auth['isAuthenticated'](),controller[_0xcc1e('0xf')]);router[_0xcc1e('0xe')](_0xcc1e('0x10'),auth['isAuthenticated'](),controller['clone']);router[_0xcc1e('0xe')]('/:id/sections',auth[_0xcc1e('0x7')](),controller[_0xcc1e('0x11')]);router[_0xcc1e('0xe')](_0xcc1e('0x12'),auth[_0xcc1e('0x7')](),controller[_0xcc1e('0x13')]);router[_0xcc1e('0x14')](_0xcc1e('0xb'),auth[_0xcc1e('0x7')](),controller['update']);router[_0xcc1e('0x15')](_0xcc1e('0xb'),auth[_0xcc1e('0x7')](),controller[_0xcc1e('0x16')]);router[_0xcc1e('0x15')](_0xcc1e('0xc'),auth[_0xcc1e('0x7')](),controller[_0xcc1e('0x17')]);router[_0xcc1e('0x15')](_0xcc1e('0x12'),auth[_0xcc1e('0x7')](),controller[_0xcc1e('0x18')]);module[_0xcc1e('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index e2ee0ea..560cd05 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 _0xb37d=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','crudPermissions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb37d,0xdc));var _0xdb37=function(_0x2d0a6f,_0x325711){_0x2d0a6f=_0x2d0a6f-0x0;var _0x66f641=_0xb37d[_0x2d0a6f];return _0x66f641;};'use strict';var Sequelize=require(_0xdb37('0x0'));module[_0xdb37('0x1')]={'name':{'type':Sequelize[_0xdb37('0x2')],'allowNull':![],'unique':_0xdb37('0x3')},'crudPermissions':{'type':Sequelize[_0xdb37('0x2')],'set':function(_0x431d80){this['setDataValue'](_0xdb37('0x4'),_0x431d80?_0x431d80[_0xdb37('0x5')](''):[]);},'get':function(){return this[_0xdb37('0x6')](_0xdb37('0x4'))?this[_0xdb37('0x6')](_0xdb37('0x4'))[_0xdb37('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xdb37('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xdb37('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xdb37('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xdb37('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xdb37('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xdb37('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xd4b9=['sequelize','STRING','name','setDataValue','join','getDataValue','crudPermissions','split','BOOLEAN'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd4b9,0x183));var _0x9d4b=function(_0x537ba6,_0x2be8be){_0x537ba6=_0x537ba6-0x0;var _0x5d5326=_0xd4b9[_0x537ba6];return _0x5d5326;};'use strict';var Sequelize=require(_0x9d4b('0x0'));module['exports']={'name':{'type':Sequelize[_0x9d4b('0x1')],'allowNull':![],'unique':_0x9d4b('0x2')},'crudPermissions':{'type':Sequelize[_0x9d4b('0x1')],'set':function(_0x25e054){this[_0x9d4b('0x3')]('crudPermissions',_0x25e054?_0x25e054[_0x9d4b('0x4')](''):[]);},'get':function(){return this[_0x9d4b('0x5')](_0x9d4b('0x6'))?this[_0x9d4b('0x5')](_0x9d4b('0x6'))[_0x9d4b('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x9d4b('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x9d4b('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x9d4b('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x9d4b('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x9d4b('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x9d4b('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9d4b('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9d4b('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index ac1c1e5..6da14c1 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 _0xa01c=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','keys','create','body','clone','find','get','omit','createdAt','updatedAt','sequelize','each','autoAssociation','UserProfileResource','Resources','UserProfileSection','params','describe','addSections','transaction','sectionId','userProfileId','push','removeSections','getSections','enabled','includes','isEmpty','subsections','concat','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','then','error','stack','name','send','index','map','UserProfile','rawAttributes','key','model','query','filters','attributes','intersection'];(function(_0x3c50c1,_0x5b10d3){var _0x2aab9b=function(_0x45c212){while(--_0x45c212){_0x3c50c1['push'](_0x3c50c1['shift']());}};_0x2aab9b(++_0x5b10d3);}(_0xa01c,0x1f1));var _0xca01=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa01c[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xca01('0x0'));var rimraf=require(_0xca01('0x1'));var zipdir=require(_0xca01('0x2'));var jsonpatch=require(_0xca01('0x3'));var rp=require('request-promise');var moment=require(_0xca01('0x4'));var BPromise=require(_0xca01('0x5'));var Mustache=require(_0xca01('0x6'));var util=require(_0xca01('0x7'));var path=require(_0xca01('0x8'));var sox=require(_0xca01('0x9'));var csv=require(_0xca01('0xa'));var ejs=require(_0xca01('0xb'));var fs=require('fs');var fs_extra=require(_0xca01('0xc'));var _=require(_0xca01('0xd'));var squel=require('squel');var crypto=require(_0xca01('0xe'));var jsforce=require(_0xca01('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xca01('0xa'));var querystring=require(_0xca01('0x10'));var Papa=require('papaparse');var Redis=require(_0xca01('0x11'));var authService=require(_0xca01('0x12'));var qs=require(_0xca01('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca01('0x14'));var logger=require(_0xca01('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xca01('0x16')]=_[_0xca01('0x17')](config[_0xca01('0x16')],{'host':_0xca01('0x18'),'port':0x18eb});var socket=require(_0xca01('0x19'))(new Redis(config[_0xca01('0x16')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x43664f,_0x8e3060){_0x8e3060=_0x8e3060||0xcc;return function(_0x1833b1){if(_0x1833b1){return _0x43664f[_0xca01('0x1a')](_0x8e3060);}return _0x43664f[_0xca01('0x1b')](_0x8e3060)[_0xca01('0x1c')]();};}function respondWithResult(_0x55fbf4,_0x6f7df7){_0x6f7df7=_0x6f7df7||0xc8;return function(_0x117d5f){if(_0x117d5f){return _0x55fbf4[_0xca01('0x1b')](_0x6f7df7)[_0xca01('0x1d')](_0x117d5f);}};}function respondWithFilteredResult(_0x278a76,_0x598a30){return function(_0x16303c){if(_0x16303c){var _0x393d02=typeof _0x598a30[_0xca01('0x1e')]==='undefined'&&typeof _0x598a30[_0xca01('0x1f')]===_0xca01('0x20');var _0x664687=_0x16303c[_0xca01('0x21')];var _0x489245=_0x393d02?0x0:_0x598a30[_0xca01('0x1e')];var _0x190ba1=_0x393d02?_0x16303c[_0xca01('0x21')]:_0x598a30['offset']+_0x598a30[_0xca01('0x1f')];var _0x263356;if(_0x190ba1>=_0x664687){_0x190ba1=_0x664687;_0x263356=0xc8;}else{_0x263356=0xce;}_0x278a76[_0xca01('0x1b')](_0x263356);return _0x278a76[_0xca01('0x22')](_0xca01('0x23'),_0x489245+'-'+_0x190ba1+'/'+_0x664687)[_0xca01('0x1d')](_0x16303c);}return null;};}function patchUpdates(_0x56a0f3){return function(_0x2c435d){try{jsonpatch['apply'](_0x2c435d,_0x56a0f3,!![]);}catch(_0x34c48e){return BPromise['reject'](_0x34c48e);}return _0x2c435d['save']();};}function saveUpdates(_0x341d73,_0xdbb500){return function(_0x3e6b86){if(_0x3e6b86){return _0x3e6b86[_0xca01('0x24')](_0x341d73)['then'](function(_0x3da7fe){return _0x3da7fe;});}return null;};}function removeEntity(_0x1adcc8,_0x3d075a){return function(_0x5f08d8){if(_0x5f08d8){return _0x5f08d8[_0xca01('0x25')]()[_0xca01('0x26')](function(){_0x1adcc8['status'](0xcc)[_0xca01('0x1c')]();});}};}function handleEntityNotFound(_0xdeae48,_0x1c01f5){return function(_0x1403ad){if(!_0x1403ad){_0xdeae48['sendStatus'](0x194);}return _0x1403ad;};}function handleError(_0x3229bb,_0x19138f){_0x19138f=_0x19138f||0x1f4;return function(_0x384df6){logger[_0xca01('0x27')](_0x384df6[_0xca01('0x28')]);if(_0x384df6[_0xca01('0x29')]){delete _0x384df6[_0xca01('0x29')];}_0x3229bb[_0xca01('0x1b')](_0x19138f)[_0xca01('0x2a')](_0x384df6);};}exports[_0xca01('0x2b')]=function(_0x536432,_0x3675ce){var _0x250a5d={},_0x3190c5={},_0x5e1ea0={'count':0x0,'rows':[]};var _0x244451=_[_0xca01('0x2c')](db[_0xca01('0x2d')][_0xca01('0x2e')],function(_0x46e946){return{'name':_0x46e946['fieldName'],'type':_0x46e946['type'][_0xca01('0x2f')]};});_0x3190c5[_0xca01('0x30')]=_[_0xca01('0x2c')](_0x244451,_0xca01('0x29'));_0x3190c5[_0xca01('0x31')]=_['keys'](_0x536432[_0xca01('0x31')]);_0x3190c5[_0xca01('0x32')]=_['intersection'](_0x3190c5[_0xca01('0x30')],_0x3190c5['query']);_0x250a5d[_0xca01('0x33')]=_[_0xca01('0x34')](_0x3190c5[_0xca01('0x30')],qs[_0xca01('0x35')](_0x536432[_0xca01('0x31')][_0xca01('0x35')]));_0x250a5d[_0xca01('0x33')]=_0x250a5d['attributes'][_0xca01('0x36')]?_0x250a5d[_0xca01('0x33')]:_0x3190c5[_0xca01('0x30')];if(!_0x536432[_0xca01('0x31')][_0xca01('0x37')](_0xca01('0x38'))){_0x250a5d[_0xca01('0x1f')]=qs[_0xca01('0x1f')](_0x536432[_0xca01('0x31')][_0xca01('0x1f')]);_0x250a5d[_0xca01('0x1e')]=qs[_0xca01('0x1e')](_0x536432[_0xca01('0x31')][_0xca01('0x1e')]);}_0x250a5d[_0xca01('0x39')]=qs[_0xca01('0x3a')](_0x536432[_0xca01('0x31')][_0xca01('0x3a')]);_0x250a5d[_0xca01('0x3b')]=qs[_0xca01('0x32')](_[_0xca01('0x3c')](_0x536432[_0xca01('0x31')],_0x3190c5[_0xca01('0x32')]),_0x244451);if(_0x536432[_0xca01('0x31')][_0xca01('0x3d')]){_0x250a5d[_0xca01('0x3b')]=_[_0xca01('0x3e')](_0x250a5d[_0xca01('0x3b')],{'$or':_[_0xca01('0x2c')](_0x244451,function(_0x152847){if(_0x152847['type']!=='VIRTUAL'){var _0x4eeba4={};_0x4eeba4[_0x152847['name']]={'$like':'%'+_0x536432[_0xca01('0x31')]['filter']+'%'};return _0x4eeba4;}})});}_0x250a5d=_[_0xca01('0x3e')]({},_0x250a5d,_0x536432[_0xca01('0x3f')]);var _0x107fca={'where':_0x250a5d['where']};return db[_0xca01('0x2d')]['count'](_0x107fca)[_0xca01('0x26')](function(_0x1ea22c){_0x5e1ea0[_0xca01('0x21')]=_0x1ea22c;if(_0x536432[_0xca01('0x31')][_0xca01('0x40')]){_0x250a5d[_0xca01('0x41')]=[{'all':!![]}];}return db['UserProfile'][_0xca01('0x42')](_0x250a5d);})['then'](function(_0x3b3131){_0x5e1ea0['rows']=_0x3b3131;return _0x5e1ea0;})[_0xca01('0x26')](respondWithFilteredResult(_0x3675ce,_0x250a5d))[_0xca01('0x43')](handleError(_0x3675ce,null));};exports[_0xca01('0x44')]=function(_0x160b5e,_0x9a0e7f){var _0x31470c={'raw':![],'where':{'id':_0x160b5e['params']['id']}},_0x552ae5={};_0x552ae5[_0xca01('0x30')]=_['keys'](db[_0xca01('0x2d')][_0xca01('0x2e')]);_0x552ae5[_0xca01('0x31')]=_[_0xca01('0x45')](_0x160b5e[_0xca01('0x31')]);_0x552ae5[_0xca01('0x32')]=_[_0xca01('0x34')](_0x552ae5[_0xca01('0x30')],_0x552ae5[_0xca01('0x31')]);_0x31470c[_0xca01('0x33')]=_[_0xca01('0x34')](_0x552ae5['model'],qs['fields'](_0x160b5e[_0xca01('0x31')][_0xca01('0x35')]));_0x31470c[_0xca01('0x33')]=_0x31470c['attributes'][_0xca01('0x36')]?_0x31470c[_0xca01('0x33')]:_0x552ae5[_0xca01('0x30')];if(_0x160b5e['query']['includeAll']){_0x31470c[_0xca01('0x41')]=[{'all':!![]}];}_0x31470c=_['merge']({},_0x31470c,_0x160b5e[_0xca01('0x3f')]);return db[_0xca01('0x2d')]['find'](_0x31470c)[_0xca01('0x26')](handleEntityNotFound(_0x9a0e7f,null))[_0xca01('0x26')](respondWithResult(_0x9a0e7f,null))[_0xca01('0x43')](handleError(_0x9a0e7f,null));};exports['create']=function(_0x2455b6,_0x872631){return db[_0xca01('0x2d')][_0xca01('0x46')](_0x2455b6[_0xca01('0x47')],{})[_0xca01('0x26')](respondWithResult(_0x872631,0xc9))[_0xca01('0x43')](handleError(_0x872631,null));};exports[_0xca01('0x48')]=function(_0xc18680,_0x18ef96){var _0x194be0={'where':{'id':_0xc18680['params']['id']}},_0x502bbe={};_0x502bbe[_0xca01('0x30')]=_['keys'](db[_0xca01('0x2d')][_0xca01('0x2e')]);_0x194be0[_0xca01('0x33')]=_['intersection'](_0x502bbe[_0xca01('0x30')],qs[_0xca01('0x35')](_0xc18680[_0xca01('0x31')][_0xca01('0x35')]));_0x194be0[_0xca01('0x33')]=_0x194be0[_0xca01('0x33')][_0xca01('0x36')]?_0x194be0[_0xca01('0x33')]:_0x502bbe['model'];if(_0xc18680[_0xca01('0x31')][_0xca01('0x40')]){_0x194be0['include']=[{'all':!![]}];}_0x194be0=_[_0xca01('0x3e')]({},_0x194be0,_0xc18680[_0xca01('0x3f')]);return db[_0xca01('0x2d')][_0xca01('0x49')](_0x194be0)[_0xca01('0x26')](handleEntityNotFound(_0x18ef96,null))['then'](function(_0x541a4f){if(_0x541a4f){var _0x5d2d69=_0x541a4f[_0xca01('0x4a')]({'plain':!![]});_0x5d2d69=qs[_0xca01('0x4b')](_0x5d2d69,['id',_0xca01('0x4c'),'updatedAt','crudPermissions']);_0xc18680[_0xca01('0x47')]=_[_0xca01('0x4b')](_0xc18680[_0xca01('0x47')],['id','createdAt',_0xca01('0x4d')]);return db[_0xca01('0x4e')]['transaction'](function(_0x4abc10){return db[_0xca01('0x2d')][_0xca01('0x46')](_[_0xca01('0x3e')](_0x5d2d69,_0xc18680[_0xca01('0x47')]),{'include':_0xc18680[_0xca01('0x31')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x4abc10})['then'](function(_0x32e2e3){var _0x538e63=_0x32e2e3[_0xca01('0x4a')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0xc18680['params']['id']},'raw':!![]})[_0xca01('0x26')](function(_0x510507){if(_0x510507){return BPromise[_0xca01('0x4f')](_0x510507,function(_0x1d6240){return new BPromise(function(_0x580155,_0x83a1cf){if(_0x1d6240[_0xca01('0x50')]===null||_0x1d6240[_0xca01('0x50')]===0x1)_0x580155(null);return db[_0xca01('0x51')]['findAll']({'where':{'sectionId':_0x1d6240['id']},'raw':!![]})[_0xca01('0x26')](function(_0x306ccb){var _0x13a751=_[_0xca01('0x2c')](_0x306ccb,function(_0x19b3af){return qs[_0xca01('0x4b')](_0x19b3af,['id',_0xca01('0x4c'),_0xca01('0x4d'),'sectionId']);});_0x580155(_0x13a751);})[_0xca01('0x43')](function(_0x240633){_0x83a1cf(_0x240633);});})['then'](function(_0x43e007){var _0x4b03d3=qs[_0xca01('0x4b')](_0x1d6240,['id',_0xca01('0x4c'),_0xca01('0x4d')]);_0x4b03d3['userProfileId']=_0x538e63['id'];if(_0x43e007)_0x4b03d3[_0xca01('0x52')]=_0x43e007;return _0x4b03d3;})[_0xca01('0x26')](function(_0x7a399){return db[_0xca01('0x53')][_0xca01('0x46')](_0x7a399,{'include':[{'model':db[_0xca01('0x51')],'as':_0xca01('0x52')}],'raw':!![],'transaction':_0x4abc10});});})[_0xca01('0x26')](function(){return _0x538e63;});}});});});}})[_0xca01('0x26')](respondWithResult(_0x18ef96,0xc9))[_0xca01('0x43')](handleError(_0x18ef96,null));};exports['update']=function(_0x29bff9,_0x1406c8){if(_0x29bff9[_0xca01('0x47')]['id']){delete _0x29bff9[_0xca01('0x47')]['id'];}return db[_0xca01('0x2d')][_0xca01('0x49')]({'where':{'id':_0x29bff9[_0xca01('0x54')]['id']}})[_0xca01('0x26')](handleEntityNotFound(_0x1406c8,null))[_0xca01('0x26')](saveUpdates(_0x29bff9[_0xca01('0x47')],null))[_0xca01('0x26')](respondWithResult(_0x1406c8,null))[_0xca01('0x43')](handleError(_0x1406c8,null));};exports[_0xca01('0x25')]=function(_0x465b77,_0x446be4){return db[_0xca01('0x2d')]['find']({'where':{'id':_0x465b77['params']['id']}})[_0xca01('0x26')](handleEntityNotFound(_0x446be4,null))[_0xca01('0x26')](removeEntity(_0x446be4,null))[_0xca01('0x43')](handleError(_0x446be4,null));};exports[_0xca01('0x55')]=function(_0x2c5ae2,_0x5258fd){return db[_0xca01('0x2d')]['describe']()[_0xca01('0x26')](respondWithResult(_0x5258fd,null))[_0xca01('0x43')](handleError(_0x5258fd,null));};exports[_0xca01('0x56')]=function(_0x292062,_0x449457){var _0x4aba40=_0x292062[_0xca01('0x47')];return db[_0xca01('0x2d')][_0xca01('0x49')]({'where':{'id':_0x292062[_0xca01('0x54')]['id']}})[_0xca01('0x26')](handleEntityNotFound(_0x449457,null))['then'](function(_0x4f378e){if(_0x4f378e){return db['sequelize'][_0xca01('0x57')](function(_0x39ebc0){return db['UserProfileSection'][_0xca01('0x25')]({'where':{'userProfileId':_0x292062[_0xca01('0x54')]['id'],'sectionId':_[_0xca01('0x2c')](_0x4aba40,function(_0x49ba4f){return _0x49ba4f[_0xca01('0x58')];})},'transaction':_0x39ebc0})['then'](function(){var _0x706873=_['map'](_0x4aba40,function(_0x3f2c26){_0x3f2c26[_0xca01('0x59')]=_0x292062[_0xca01('0x54')]['id'];return _0x3f2c26;});var _0x2d0064=[];return BPromise['each'](_0x706873,function(_0x12ee85){return db[_0xca01('0x53')]['create'](_0x12ee85,{'include':[{'model':db['UserProfileResource'],'as':_0xca01('0x52')}],'raw':!![],'transaction':_0x39ebc0})['then'](function(_0xfc12c5){_0x2d0064[_0xca01('0x5a')](_0xfc12c5[_0xca01('0x4a')]({'plain':!![]}));});})['then'](function(){return _0x2d0064;});});});}})[_0xca01('0x26')](function(_0x5b211a){return _0x5b211a;})[_0xca01('0x26')](respondWithResult(_0x449457,null))[_0xca01('0x43')](handleError(_0x449457,null));};exports[_0xca01('0x5b')]=function(_0x117db8,_0x173335){var _0x4cfbe8;return db[_0xca01('0x2d')][_0xca01('0x49')]({'where':{'id':_0x117db8[_0xca01('0x54')]['id']},'attributes':['id',_0xca01('0x29')]})[_0xca01('0x26')](handleEntityNotFound(_0x173335,null))[_0xca01('0x26')](function(_0x5d50dd){if(_0x5d50dd){_0x4cfbe8=_0x5d50dd;return db[_0xca01('0x53')][_0xca01('0x25')]({'where':{'userProfileId':_0x117db8[_0xca01('0x54')]['id'],'sectionId':_0x117db8[_0xca01('0x31')]['ids']}});}})[_0xca01('0x26')](function(){return _0x4cfbe8;})['then'](respondWithStatusCode(_0x173335,null))[_0xca01('0x43')](handleError(_0x173335,null));};exports[_0xca01('0x5c')]=function(_0x2c7b22,_0x527ee1){var _0x4332cc=[];var _0x29251f=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x2c7b22[_0xca01('0x54')]['id']},'raw':!![]})[_0xca01('0x26')](function(_0x37aa47){_0x4332cc=_[_0xca01('0x3d')](_0x37aa47,function(_0x3fa7bb){return _0x3fa7bb[_0xca01('0x5d')]===0x1||_[_0xca01('0x5e')]([0x3eb,0x709],_0x3fa7bb[_0xca01('0x58')]);});if(!_[_0xca01('0x5f')](_0x4332cc)){return _[_0xca01('0x2c')](_0x4332cc,function(_0x547240){return _0x547240['sectionId'];});}else{return;}})['then'](function(_0x8e49ee){if(_0x8e49ee)_0x29251f=_0x8e49ee;if(_[_0xca01('0x5e')](_0x29251f,0x64)){var _0x8ceb98=_[_0xca01('0x49')](_0x4332cc,{'sectionId':0x64});return hasDefaultDashboard(_0x8ceb98)[_0xca01('0x26')](function(_0x3e841f){return _['map'](_0x4332cc,function(_0x552658){if(_0x552658['sectionId']===0x64){_0x552658[_0xca01('0x60')]=_0x3e841f;}return _0x552658;});});}else{return;}})['then'](function(_0x4b4e7e){if(_0x4b4e7e)_0x4332cc=_0x4b4e7e;if(_[_0xca01('0x5e')](_0x29251f,0x3eb)){var _0x34ac5f=_[_0xca01('0x49')](_0x4332cc,{'sectionId':0x3eb});return getCustomDashboards(_0x34ac5f)[_0xca01('0x26')](function(_0x5ede93){return _[_0xca01('0x2c')](_0x4332cc,function(_0xdc7ef9){if(_0x34ac5f[_0xca01('0x5d')]){if(_0xdc7ef9[_0xca01('0x58')]===0x3eb){_0xdc7ef9[_0xca01('0x60')]=_0x5ede93;}}else{if(_0xdc7ef9[_0xca01('0x58')]===0x64){if(!_0xdc7ef9[_0xca01('0x60')]){_0xdc7ef9[_0xca01('0x60')]=[];}_0xdc7ef9['subsections']=_0xdc7ef9[_0xca01('0x60')][_0xca01('0x61')](_0x5ede93);}}return _0xdc7ef9;});});}else{return;}})['then'](function(_0x586be0){if(_0x586be0)_0x4332cc=_0x586be0;if(_[_0xca01('0x5e')](_0x29251f,0x709)){var _0x35ddef=_['find'](_0x4332cc,{'sectionId':0x709});return getPlugins(_0x35ddef)['then'](function(_0x322749){if(_0x35ddef[_0xca01('0x5d')]){return _['map'](_0x4332cc,function(_0x3331ab){if(_0x3331ab[_0xca01('0x58')]===0x709){_0x3331ab[_0xca01('0x60')]=_0x322749;}return _0x3331ab;});}else{var _0x1eeeb2={'sectionId':0x76c,'enabled':0x1,'subsections':_0x322749};var _0x465045=_[_0xca01('0x2c')](_0x4332cc);_0x465045[_0xca01('0x5a')](_0x1eeeb2);return _0x465045;}});}else{return;}})[_0xca01('0x26')](function(_0x57c524){if(_0x57c524)_0x4332cc=_0x57c524;return _['filter'](_0x4332cc,[_0xca01('0x5d'),0x1]);})[_0xca01('0x26')](respondWithResult(_0x527ee1,null))[_0xca01('0x43')](handleError(_0x527ee1,null));};function hasDefaultDashboard(_0x31cbb3){var _0x1530a7=[0x65];return new BPromise(function(_0x28b452,_0x1e6e6a){try{if(_0x31cbb3[_0xca01('0x50')]){_0x28b452(_0x1530a7);}else{return db[_0xca01('0x51')]['findOne']({'where':{'sectionId':_0x31cbb3['id']},'raw':!![]})[_0xca01('0x26')](function(_0x43d6d2){_0x43d6d2?_0x28b452(_0x1530a7):_0x28b452();});}}catch(_0x1cfd27){_0x1e6e6a(_0x1cfd27);}});}function getCustomDashboards(_0x4da35f){var _0x5a94ac=[];return new BPromise(function(_0x2f54ef,_0x363919){try{if(_0x4da35f['autoAssociation']){return db[_0xca01('0x62')][_0xca01('0x42')]({'raw':!![]})[_0xca01('0x26')](function(_0x28bb53){_0x28bb53[_0xca01('0x63')](function(_0x62c925){_0x5a94ac[_0xca01('0x5a')](_0x62c925['id']+0x1869f);});_0x2f54ef(_0x5a94ac);});}else{return db[_0xca01('0x51')][_0xca01('0x42')]({'where':{'sectionId':_0x4da35f['id']},'raw':!![]})['then'](function(_0x48f542){_0x48f542[_0xca01('0x63')](function(_0x332246){_0x5a94ac[_0xca01('0x5a')](_0x332246[_0xca01('0x64')]+0x1869f);});_0x2f54ef(_0x5a94ac);});}}catch(_0x27490e){_0x363919(_0x27490e);}});}function getPlugins(_0x1b0fc0){var _0x46e0a7=[];return new BPromise(function(_0x11bab3,_0x10ec5f){try{if(_0x1b0fc0[_0xca01('0x50')]){return db[_0xca01('0x65')][_0xca01('0x42')]({'raw':!![]})[_0xca01('0x26')](function(_0xee7aa3){_0xee7aa3[_0xca01('0x63')](function(_0x2a6ffd){_0x46e0a7[_0xca01('0x5a')](_0x2a6ffd['id']+0x15b38);});_0x11bab3(_0x46e0a7);});}else{return db[_0xca01('0x51')][_0xca01('0x42')]({'where':{'sectionId':_0x1b0fc0['id']},'raw':!![]})[_0xca01('0x26')](function(_0x536cb8){_0x536cb8['forEach'](function(_0x296f89){_0x46e0a7[_0xca01('0x5a')](_0x296f89[_0xca01('0x64')]+0x15b38);});_0x11bab3(_0x46e0a7);});}}catch(_0x447d7b){_0x10ec5f(_0x447d7b);}});}exports[_0xca01('0x66')]=function(_0x54b394,_0x4b4018){return db[_0xca01('0x2d')]['find']({'where':{'id':_0x54b394[_0xca01('0x54')]['id']}})[_0xca01('0x26')](handleEntityNotFound(_0x4b4018,null))[_0xca01('0x26')](function(_0x49d620){if(_0x49d620){return db[_0xca01('0x4e')]['transaction'](function(_0x20e176){return db[_0xca01('0x53')]['findAll']({'where':{'userProfileId':_0x54b394[_0xca01('0x54')]['id']},'attributes':['id'],'raw':!![]})[_0xca01('0x26')](function(_0xb50b17){if(_0xb50b17){return db[_0xca01('0x53')]['destroy']({'where':{'userProfileId':_0x54b394[_0xca01('0x54')]['id'],'id':_[_0xca01('0x2c')](_0xb50b17,function(_0x483241){return _0x483241['id'];})},'transaction':_0x20e176});}})['then'](function(_0x37e8af){var _0x4fc012=_['map'](_0x54b394[_0xca01('0x47')],function(_0x4382d1){_0x4382d1['userProfileId']=_0x54b394[_0xca01('0x54')]['id'];return _0x4382d1;});return db[_0xca01('0x53')][_0xca01('0x67')](_0x4fc012,{'raw':!![],'transaction':_0x20e176});})['then'](function(_0x5bdeb1){var _0x450650=_[_0xca01('0x3d')](_[_0xca01('0x2c')](_0x5bdeb1,function(_0x25cf22){return _0x25cf22[_0xca01('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x450650){return db[_0xca01('0x53')][_0xca01('0x42')]({'where':{'userProfileId':_0x54b394[_0xca01('0x54')]['id'],'sectionId':_['map'](_0x450650,function(_0x228127){return _0x228127[_0xca01('0x58')];})},'attributes':['id',_0xca01('0x58')],'raw':!![]})['then'](function(_0x2306b3){var _0x43f805=_['map'](_0x54b394[_0xca01('0x47')],function(_0xefb8b5){_0xefb8b5[_0xca01('0x59')]=_0x54b394['params']['id'];return _0xefb8b5;});return db['UserProfileResource'][_0xca01('0x67')](_0x43f805,{'raw':!![],'transaction':_0x20e176});});}})[_0xca01('0x43')](handleError(_0x4b4018,null));});}})[_0xca01('0x26')](function(_0x2f377c){var _0x38fe9f=_[_0xca01('0x2c')](_0x2f377c,function(_0x433818){return _0x433818['get']({'plain':!![]});});})[_0xca01('0x26')](respondWithResult(_0x4b4018,null))[_0xca01('0x43')](handleError(_0x4b4018,null));};exports[_0xca01('0x68')]=function(_0x5981e3,_0x42369d,_0x161cce){return db[_0xca01('0x2d')][_0xca01('0x49')]({'where':{'id':_0x5981e3['params']['id']}})[_0xca01('0x26')](handleEntityNotFound(_0x42369d,null))[_0xca01('0x26')](function(_0x48bdf9){if(_0x48bdf9){return _0x48bdf9[_0xca01('0x68')](_0x5981e3[_0xca01('0x31')][_0xca01('0x69')]);}})[_0xca01('0x26')](respondWithStatusCode(_0x42369d,null))[_0xca01('0x43')](handleError(_0x42369d,null));};exports[_0xca01('0x6a')]=function(_0x32a52f,_0x5753cc){var _0x39a8ef={};if(!_0x32a52f['query'][_0xca01('0x6b')])throw new Error(_0xca01('0x6c'));if(!_0x32a52f[_0xca01('0x31')]['hasOwnProperty']('nolimit')){_0x39a8ef[_0xca01('0x1f')]=qs['limit'](_0x32a52f['query'][_0xca01('0x1f')]);_0x39a8ef['offset']=qs[_0xca01('0x1e')](_0x32a52f[_0xca01('0x31')][_0xca01('0x1e')]);}return db['UserProfile'][_0xca01('0x49')]({'where':{'id':_0x32a52f[_0xca01('0x54')]['id']}})[_0xca01('0x26')](function(_0x30c527){if(!_0x30c527)throw new Error(_0xca01('0x6d')+_0x32a52f['params']['id']);return db[_0xca01('0x2d')][_0xca01('0x6a')](_0x32a52f);})[_0xca01('0x26')](respondWithFilteredResult(_0x5753cc,_0x39a8ef))['catch'](handleError(_0x5753cc,null));}; \ No newline at end of file +var _0xf406=['addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','nolimit','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfile','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','show','params','keys','intersection','find','catch','create','body','clone','get','omit','createdAt','updatedAt','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','userProfileId','Resources','describe','addSections','sectionId','each','push','removeSections','ids','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','resourceId','forEach'];(function(_0x15e1be,_0xa9e646){var _0x2d9a0a=function(_0xa5cd55){while(--_0xa5cd55){_0x15e1be['push'](_0x15e1be['shift']());}};_0x2d9a0a(++_0xa9e646);}(_0xf406,0x1db));var _0x6f40=function(_0x59ad93,_0x5ae764){_0x59ad93=_0x59ad93-0x0;var _0x5614bc=_0xf406[_0x59ad93];return _0x5614bc;};'use strict';var emlformat=require(_0x6f40('0x0'));var rimraf=require(_0x6f40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f40('0x2'));var rp=require(_0x6f40('0x3'));var moment=require('moment');var BPromise=require(_0x6f40('0x4'));var Mustache=require(_0x6f40('0x5'));var util=require(_0x6f40('0x6'));var path=require(_0x6f40('0x7'));var sox=require(_0x6f40('0x8'));var csv=require(_0x6f40('0x9'));var ejs=require(_0x6f40('0xa'));var fs=require('fs');var fs_extra=require(_0x6f40('0xb'));var _=require('lodash');var squel=require(_0x6f40('0xc'));var crypto=require(_0x6f40('0xd'));var jsforce=require(_0x6f40('0xe'));var deskjs=require(_0x6f40('0xf'));var toCsv=require(_0x6f40('0x9'));var querystring=require(_0x6f40('0x10'));var Papa=require(_0x6f40('0x11'));var Redis=require(_0x6f40('0x12'));var authService=require(_0x6f40('0x13'));var qs=require(_0x6f40('0x14'));var as=require(_0x6f40('0x15'));var hardwareService=require(_0x6f40('0x16'));var logger=require(_0x6f40('0x17'))(_0x6f40('0x18'));var utils=require('../../config/utils');var config=require(_0x6f40('0x19'));var licenseUtil=require(_0x6f40('0x1a'));var db=require(_0x6f40('0x1b'))['db'];config[_0x6f40('0x1c')]=_['defaults'](config['redis'],{'host':_0x6f40('0x1d'),'port':0x18eb});var socket=require(_0x6f40('0x1e'))(new Redis(config['redis']));require(_0x6f40('0x1f'))[_0x6f40('0x20')](socket);function respondWithStatusCode(_0xa3eee7,_0x2e5540){_0x2e5540=_0x2e5540||0xcc;return function(_0x3fe74b){if(_0x3fe74b){return _0xa3eee7[_0x6f40('0x21')](_0x2e5540);}return _0xa3eee7[_0x6f40('0x22')](_0x2e5540)[_0x6f40('0x23')]();};}function respondWithResult(_0x48a3d9,_0x61ac64){_0x61ac64=_0x61ac64||0xc8;return function(_0x1555ca){if(_0x1555ca){return _0x48a3d9[_0x6f40('0x22')](_0x61ac64)[_0x6f40('0x24')](_0x1555ca);}};}function respondWithFilteredResult(_0x5ce0df,_0x53488b){return function(_0x4f4109){if(_0x4f4109){var _0x5b5280=typeof _0x53488b['offset']===_0x6f40('0x25')&&typeof _0x53488b[_0x6f40('0x26')]===_0x6f40('0x25');var _0x25ab03=_0x4f4109[_0x6f40('0x27')];var _0x82c634=_0x5b5280?0x0:_0x53488b[_0x6f40('0x28')];var _0x1a39e3=_0x5b5280?_0x4f4109[_0x6f40('0x27')]:_0x53488b['offset']+_0x53488b[_0x6f40('0x26')];var _0x1a4e88;if(_0x1a39e3>=_0x25ab03){_0x1a39e3=_0x25ab03;_0x1a4e88=0xc8;}else{_0x1a4e88=0xce;}_0x5ce0df['status'](_0x1a4e88);return _0x5ce0df[_0x6f40('0x29')]('Content-Range',_0x82c634+'-'+_0x1a39e3+'/'+_0x25ab03)['json'](_0x4f4109);}return null;};}function patchUpdates(_0x1b807f){return function(_0x378bc6){try{jsonpatch[_0x6f40('0x2a')](_0x378bc6,_0x1b807f,!![]);}catch(_0x196744){return BPromise[_0x6f40('0x2b')](_0x196744);}return _0x378bc6[_0x6f40('0x2c')]();};}function saveUpdates(_0x7de6b5,_0x1b0593){return function(_0x2f2cc8){if(_0x2f2cc8){return _0x2f2cc8[_0x6f40('0x2d')](_0x7de6b5)[_0x6f40('0x2e')](function(_0x32ec6e){return _0x32ec6e;});}return null;};}function removeEntity(_0x309802,_0xf2b59b){return function(_0x43326f){if(_0x43326f){return _0x43326f[_0x6f40('0x2f')]()[_0x6f40('0x2e')](function(){_0x309802[_0x6f40('0x22')](0xcc)[_0x6f40('0x23')]();});}};}function handleEntityNotFound(_0x4b08bd,_0x37b4){return function(_0xe5a552){if(!_0xe5a552){_0x4b08bd[_0x6f40('0x21')](0x194);}return _0xe5a552;};}function handleError(_0x3c029b,_0x554cd9){_0x554cd9=_0x554cd9||0x1f4;return function(_0x5c2281){logger[_0x6f40('0x30')](_0x5c2281[_0x6f40('0x31')]);if(_0x5c2281[_0x6f40('0x32')]){delete _0x5c2281['name'];}_0x3c029b[_0x6f40('0x22')](_0x554cd9)[_0x6f40('0x33')](_0x5c2281);};}exports['index']=function(_0x4a392e,_0x1659b7){var _0x4c2b9c={},_0x5ac01a={},_0x49626b={'count':0x0,'rows':[]};var _0x45c69d=_[_0x6f40('0x34')](db[_0x6f40('0x35')][_0x6f40('0x36')],function(_0x343045){return{'name':_0x343045['fieldName'],'type':_0x343045[_0x6f40('0x37')][_0x6f40('0x38')]};});_0x5ac01a[_0x6f40('0x39')]=_['map'](_0x45c69d,'name');_0x5ac01a[_0x6f40('0x3a')]=_['keys'](_0x4a392e[_0x6f40('0x3a')]);_0x5ac01a['filters']=_['intersection'](_0x5ac01a[_0x6f40('0x39')],_0x5ac01a[_0x6f40('0x3a')]);_0x4c2b9c[_0x6f40('0x3b')]=_['intersection'](_0x5ac01a['model'],qs[_0x6f40('0x3c')](_0x4a392e['query']['fields']));_0x4c2b9c[_0x6f40('0x3b')]=_0x4c2b9c[_0x6f40('0x3b')][_0x6f40('0x3d')]?_0x4c2b9c['attributes']:_0x5ac01a[_0x6f40('0x39')];if(!_0x4a392e[_0x6f40('0x3a')][_0x6f40('0x3e')]('nolimit')){_0x4c2b9c[_0x6f40('0x26')]=qs['limit'](_0x4a392e[_0x6f40('0x3a')]['limit']);_0x4c2b9c[_0x6f40('0x28')]=qs[_0x6f40('0x28')](_0x4a392e[_0x6f40('0x3a')][_0x6f40('0x28')]);}_0x4c2b9c[_0x6f40('0x3f')]=qs[_0x6f40('0x40')](_0x4a392e[_0x6f40('0x3a')]['sort']);_0x4c2b9c[_0x6f40('0x41')]=qs[_0x6f40('0x42')](_[_0x6f40('0x43')](_0x4a392e[_0x6f40('0x3a')],_0x5ac01a[_0x6f40('0x42')]),_0x45c69d);if(_0x4a392e[_0x6f40('0x3a')][_0x6f40('0x44')]){_0x4c2b9c[_0x6f40('0x41')]=_[_0x6f40('0x45')](_0x4c2b9c[_0x6f40('0x41')],{'$or':_[_0x6f40('0x34')](_0x45c69d,function(_0x3cbabd){if(_0x3cbabd['type']!=='VIRTUAL'){var _0x5035dd={};_0x5035dd[_0x3cbabd[_0x6f40('0x32')]]={'$like':'%'+_0x4a392e[_0x6f40('0x3a')][_0x6f40('0x44')]+'%'};return _0x5035dd;}})});}_0x4c2b9c=_['merge']({},_0x4c2b9c,_0x4a392e[_0x6f40('0x46')]);var _0x2f6f90={'where':_0x4c2b9c['where']};return db['UserProfile'][_0x6f40('0x27')](_0x2f6f90)[_0x6f40('0x2e')](function(_0x5a4611){_0x49626b[_0x6f40('0x27')]=_0x5a4611;if(_0x4a392e['query'][_0x6f40('0x47')]){_0x4c2b9c[_0x6f40('0x48')]=[{'all':!![]}];}return db[_0x6f40('0x35')][_0x6f40('0x49')](_0x4c2b9c);})[_0x6f40('0x2e')](function(_0x30644a){_0x49626b['rows']=_0x30644a;return _0x49626b;})[_0x6f40('0x2e')](respondWithFilteredResult(_0x1659b7,_0x4c2b9c))['catch'](handleError(_0x1659b7,null));};exports[_0x6f40('0x4a')]=function(_0x5c31a3,_0x47d90a){var _0x14659b={'raw':![],'where':{'id':_0x5c31a3[_0x6f40('0x4b')]['id']}},_0xbaf779={};_0xbaf779['model']=_[_0x6f40('0x4c')](db[_0x6f40('0x35')][_0x6f40('0x36')]);_0xbaf779[_0x6f40('0x3a')]=_['keys'](_0x5c31a3[_0x6f40('0x3a')]);_0xbaf779[_0x6f40('0x42')]=_['intersection'](_0xbaf779[_0x6f40('0x39')],_0xbaf779[_0x6f40('0x3a')]);_0x14659b[_0x6f40('0x3b')]=_[_0x6f40('0x4d')](_0xbaf779[_0x6f40('0x39')],qs[_0x6f40('0x3c')](_0x5c31a3[_0x6f40('0x3a')]['fields']));_0x14659b[_0x6f40('0x3b')]=_0x14659b['attributes'][_0x6f40('0x3d')]?_0x14659b[_0x6f40('0x3b')]:_0xbaf779[_0x6f40('0x39')];if(_0x5c31a3[_0x6f40('0x3a')][_0x6f40('0x47')]){_0x14659b[_0x6f40('0x48')]=[{'all':!![]}];}_0x14659b=_[_0x6f40('0x45')]({},_0x14659b,_0x5c31a3['options']);return db[_0x6f40('0x35')][_0x6f40('0x4e')](_0x14659b)[_0x6f40('0x2e')](handleEntityNotFound(_0x47d90a,null))[_0x6f40('0x2e')](respondWithResult(_0x47d90a,null))[_0x6f40('0x4f')](handleError(_0x47d90a,null));};exports[_0x6f40('0x50')]=function(_0x2d4733,_0x3232f0){return db[_0x6f40('0x35')]['create'](_0x2d4733[_0x6f40('0x51')],{})[_0x6f40('0x2e')](respondWithResult(_0x3232f0,0xc9))[_0x6f40('0x4f')](handleError(_0x3232f0,null));};exports[_0x6f40('0x52')]=function(_0x15e4a8,_0x26e5f9){var _0x498ca4={'where':{'id':_0x15e4a8[_0x6f40('0x4b')]['id']}},_0xc3694d={};_0xc3694d[_0x6f40('0x39')]=_[_0x6f40('0x4c')](db[_0x6f40('0x35')][_0x6f40('0x36')]);_0x498ca4[_0x6f40('0x3b')]=_['intersection'](_0xc3694d[_0x6f40('0x39')],qs['fields'](_0x15e4a8['query'][_0x6f40('0x3c')]));_0x498ca4[_0x6f40('0x3b')]=_0x498ca4[_0x6f40('0x3b')]['length']?_0x498ca4[_0x6f40('0x3b')]:_0xc3694d[_0x6f40('0x39')];if(_0x15e4a8['query'][_0x6f40('0x47')]){_0x498ca4[_0x6f40('0x48')]=[{'all':!![]}];}_0x498ca4=_[_0x6f40('0x45')]({},_0x498ca4,_0x15e4a8[_0x6f40('0x46')]);return db[_0x6f40('0x35')][_0x6f40('0x4e')](_0x498ca4)['then'](handleEntityNotFound(_0x26e5f9,null))[_0x6f40('0x2e')](function(_0x57e666){if(_0x57e666){var _0x48598c=_0x57e666[_0x6f40('0x53')]({'plain':!![]});_0x48598c=qs[_0x6f40('0x54')](_0x48598c,['id',_0x6f40('0x55'),'updatedAt','crudPermissions']);_0x15e4a8[_0x6f40('0x51')]=_['omit'](_0x15e4a8['body'],['id','createdAt',_0x6f40('0x56')]);return db[_0x6f40('0x57')][_0x6f40('0x58')](function(_0x400cd9){return db[_0x6f40('0x35')][_0x6f40('0x50')](_[_0x6f40('0x45')](_0x48598c,_0x15e4a8[_0x6f40('0x51')]),{'include':_0x15e4a8[_0x6f40('0x3a')][_0x6f40('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x400cd9})[_0x6f40('0x2e')](function(_0x54f68f){var _0x6d3cb=_0x54f68f[_0x6f40('0x53')]({'plain':!![]});return db[_0x6f40('0x59')][_0x6f40('0x49')]({'where':{'userProfileId':_0x15e4a8[_0x6f40('0x4b')]['id']},'raw':!![]})[_0x6f40('0x2e')](function(_0xf02676){if(_0xf02676){return BPromise['each'](_0xf02676,function(_0x4c5a05){return new BPromise(function(_0x1edadd,_0xaf3235){if(_0x4c5a05['autoAssociation']===null||_0x4c5a05[_0x6f40('0x5a')]===0x1)_0x1edadd(null);return db[_0x6f40('0x5b')][_0x6f40('0x49')]({'where':{'sectionId':_0x4c5a05['id']},'raw':!![]})['then'](function(_0x4b9a61){var _0xe20834=_['map'](_0x4b9a61,function(_0x41b9e5){return qs['omit'](_0x41b9e5,['id','createdAt',_0x6f40('0x56'),'sectionId']);});_0x1edadd(_0xe20834);})[_0x6f40('0x4f')](function(_0x3861b4){_0xaf3235(_0x3861b4);});})[_0x6f40('0x2e')](function(_0x2c7117){var _0x40e041=qs[_0x6f40('0x54')](_0x4c5a05,['id',_0x6f40('0x55'),_0x6f40('0x56')]);_0x40e041[_0x6f40('0x5c')]=_0x6d3cb['id'];if(_0x2c7117)_0x40e041[_0x6f40('0x5d')]=_0x2c7117;return _0x40e041;})['then'](function(_0x2bf625){return db[_0x6f40('0x59')]['create'](_0x2bf625,{'include':[{'model':db[_0x6f40('0x5b')],'as':'Resources'}],'raw':!![],'transaction':_0x400cd9});});})[_0x6f40('0x2e')](function(){return _0x6d3cb;});}});});});}})[_0x6f40('0x2e')](respondWithResult(_0x26e5f9,0xc9))[_0x6f40('0x4f')](handleError(_0x26e5f9,null));};exports[_0x6f40('0x2d')]=function(_0x24818f,_0x507697){if(_0x24818f[_0x6f40('0x51')]['id']){delete _0x24818f[_0x6f40('0x51')]['id'];}return db[_0x6f40('0x35')][_0x6f40('0x4e')]({'where':{'id':_0x24818f[_0x6f40('0x4b')]['id']}})['then'](handleEntityNotFound(_0x507697,null))['then'](saveUpdates(_0x24818f[_0x6f40('0x51')],null))[_0x6f40('0x2e')](respondWithResult(_0x507697,null))[_0x6f40('0x4f')](handleError(_0x507697,null));};exports[_0x6f40('0x2f')]=function(_0x125c03,_0x40d4a2){return db[_0x6f40('0x35')][_0x6f40('0x4e')]({'where':{'id':_0x125c03['params']['id']}})[_0x6f40('0x2e')](handleEntityNotFound(_0x40d4a2,null))['then'](removeEntity(_0x40d4a2,null))[_0x6f40('0x4f')](handleError(_0x40d4a2,null));};exports[_0x6f40('0x5e')]=function(_0x2de6aa,_0x296421){return db['UserProfile'][_0x6f40('0x5e')]()[_0x6f40('0x2e')](respondWithResult(_0x296421,null))[_0x6f40('0x4f')](handleError(_0x296421,null));};exports[_0x6f40('0x5f')]=function(_0x4f3d49,_0x24a88f){var _0x206ea4=_0x4f3d49['body'];return db[_0x6f40('0x35')][_0x6f40('0x4e')]({'where':{'id':_0x4f3d49[_0x6f40('0x4b')]['id']}})[_0x6f40('0x2e')](handleEntityNotFound(_0x24a88f,null))[_0x6f40('0x2e')](function(_0x2dcb1e){if(_0x2dcb1e){return db[_0x6f40('0x57')][_0x6f40('0x58')](function(_0x4e6a82){return db[_0x6f40('0x59')][_0x6f40('0x2f')]({'where':{'userProfileId':_0x4f3d49['params']['id'],'sectionId':_[_0x6f40('0x34')](_0x206ea4,function(_0x3ab588){return _0x3ab588[_0x6f40('0x60')];})},'transaction':_0x4e6a82})[_0x6f40('0x2e')](function(){var _0x8644db=_[_0x6f40('0x34')](_0x206ea4,function(_0x3e7910){_0x3e7910[_0x6f40('0x5c')]=_0x4f3d49[_0x6f40('0x4b')]['id'];return _0x3e7910;});var _0x36f7da=[];return BPromise[_0x6f40('0x61')](_0x8644db,function(_0x39aad4){return db[_0x6f40('0x59')][_0x6f40('0x50')](_0x39aad4,{'include':[{'model':db[_0x6f40('0x5b')],'as':'Resources'}],'raw':!![],'transaction':_0x4e6a82})['then'](function(_0x105768){_0x36f7da[_0x6f40('0x62')](_0x105768[_0x6f40('0x53')]({'plain':!![]}));});})[_0x6f40('0x2e')](function(){return _0x36f7da;});});});}})[_0x6f40('0x2e')](function(_0x250498){return _0x250498;})[_0x6f40('0x2e')](respondWithResult(_0x24a88f,null))[_0x6f40('0x4f')](handleError(_0x24a88f,null));};exports[_0x6f40('0x63')]=function(_0x5a34c1,_0x2d2517){var _0x89e35;return db[_0x6f40('0x35')][_0x6f40('0x4e')]({'where':{'id':_0x5a34c1[_0x6f40('0x4b')]['id']},'attributes':['id',_0x6f40('0x32')]})[_0x6f40('0x2e')](handleEntityNotFound(_0x2d2517,null))[_0x6f40('0x2e')](function(_0xfb19){if(_0xfb19){_0x89e35=_0xfb19;return db[_0x6f40('0x59')][_0x6f40('0x2f')]({'where':{'userProfileId':_0x5a34c1[_0x6f40('0x4b')]['id'],'sectionId':_0x5a34c1[_0x6f40('0x3a')][_0x6f40('0x64')]}});}})[_0x6f40('0x2e')](function(){return _0x89e35;})[_0x6f40('0x2e')](respondWithStatusCode(_0x2d2517,null))[_0x6f40('0x4f')](handleError(_0x2d2517,null));};exports['getSections']=function(_0x275ccb,_0x69f4e5){var _0x28f20a=[];var _0x1bd770=[];return db[_0x6f40('0x59')][_0x6f40('0x49')]({'where':{'userProfileId':_0x275ccb[_0x6f40('0x4b')]['id']},'raw':!![]})[_0x6f40('0x2e')](function(_0xf56b13){_0x28f20a=_[_0x6f40('0x44')](_0xf56b13,function(_0x5ea972){return _0x5ea972[_0x6f40('0x65')]===0x1||_[_0x6f40('0x66')]([0x3eb,0x709],_0x5ea972[_0x6f40('0x60')]);});if(!_[_0x6f40('0x67')](_0x28f20a)){return _[_0x6f40('0x34')](_0x28f20a,function(_0x56ee5c){return _0x56ee5c[_0x6f40('0x60')];});}else{return;}})[_0x6f40('0x2e')](function(_0x50fe9d){if(_0x50fe9d)_0x1bd770=_0x50fe9d;if(_['includes'](_0x1bd770,0x64)){var _0x106ab3=_['find'](_0x28f20a,{'sectionId':0x64});return hasDefaultDashboard(_0x106ab3)['then'](function(_0x29a696){return _['map'](_0x28f20a,function(_0x23b31b){if(_0x23b31b[_0x6f40('0x60')]===0x64){_0x23b31b[_0x6f40('0x68')]=_0x29a696;}return _0x23b31b;});});}else{return;}})['then'](function(_0xed7d24){if(_0xed7d24)_0x28f20a=_0xed7d24;if(_[_0x6f40('0x66')](_0x1bd770,0x3eb)){var _0x2afdb5=_['find'](_0x28f20a,{'sectionId':0x3eb});return getCustomDashboards(_0x2afdb5)[_0x6f40('0x2e')](function(_0x4df64e){return _[_0x6f40('0x34')](_0x28f20a,function(_0x17c8aa){if(_0x2afdb5[_0x6f40('0x65')]){if(_0x17c8aa[_0x6f40('0x60')]===0x3eb){_0x17c8aa[_0x6f40('0x68')]=_0x4df64e;}}else{if(_0x17c8aa[_0x6f40('0x60')]===0x64){if(!_0x17c8aa[_0x6f40('0x68')]){_0x17c8aa[_0x6f40('0x68')]=[];}_0x17c8aa[_0x6f40('0x68')]=_0x17c8aa['subsections'][_0x6f40('0x69')](_0x4df64e);}}return _0x17c8aa;});});}else{return;}})[_0x6f40('0x2e')](function(_0x2f2b5a){if(_0x2f2b5a)_0x28f20a=_0x2f2b5a;if(_['includes'](_0x1bd770,0x709)){var _0x42bcb7=_[_0x6f40('0x4e')](_0x28f20a,{'sectionId':0x709});return getPlugins(_0x42bcb7)[_0x6f40('0x2e')](function(_0x1343c2){if(_0x42bcb7[_0x6f40('0x65')]){return _[_0x6f40('0x34')](_0x28f20a,function(_0x535a6a){if(_0x535a6a[_0x6f40('0x60')]===0x709){_0x535a6a[_0x6f40('0x68')]=_0x1343c2;}return _0x535a6a;});}else{var _0x542221={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1343c2};var _0x3bcd8a=_['map'](_0x28f20a);_0x3bcd8a[_0x6f40('0x62')](_0x542221);return _0x3bcd8a;}});}else{return;}})[_0x6f40('0x2e')](function(_0x4dd2f3){if(_0x4dd2f3)_0x28f20a=_0x4dd2f3;return _[_0x6f40('0x44')](_0x28f20a,['enabled',0x1]);})['then'](respondWithResult(_0x69f4e5,null))['catch'](handleError(_0x69f4e5,null));};function hasDefaultDashboard(_0x915702){var _0x3a999d=[0x65];return new BPromise(function(_0x3279bc,_0x28fced){try{if(_0x915702[_0x6f40('0x5a')]){_0x3279bc(_0x3a999d);}else{return db[_0x6f40('0x5b')][_0x6f40('0x6a')]({'where':{'sectionId':_0x915702['id']},'raw':!![]})[_0x6f40('0x2e')](function(_0x55fcfe){_0x55fcfe?_0x3279bc(_0x3a999d):_0x3279bc();});}}catch(_0x27e9a3){_0x28fced(_0x27e9a3);}});}function getCustomDashboards(_0x5508c5){var _0x29bca2=[];return new BPromise(function(_0x305730,_0x4e554e){try{if(_0x5508c5['autoAssociation']){return db[_0x6f40('0x6b')][_0x6f40('0x49')]({'raw':!![]})['then'](function(_0x3b7018){_0x3b7018['forEach'](function(_0x2a5c5d){_0x29bca2[_0x6f40('0x62')](_0x2a5c5d['id']+0x1869f);});_0x305730(_0x29bca2);});}else{return db[_0x6f40('0x5b')]['findAll']({'where':{'sectionId':_0x5508c5['id']},'raw':!![]})[_0x6f40('0x2e')](function(_0xd88a78){_0xd88a78['forEach'](function(_0x57ef66){_0x29bca2['push'](_0x57ef66[_0x6f40('0x6c')]+0x1869f);});_0x305730(_0x29bca2);});}}catch(_0x47a97a){_0x4e554e(_0x47a97a);}});}function getPlugins(_0x148fc3){var _0x56dec7=[];return new BPromise(function(_0x5d0d79,_0x1ecc69){try{if(_0x148fc3[_0x6f40('0x5a')]){return db['Plugin']['findAll']({'raw':!![]})[_0x6f40('0x2e')](function(_0xaadae9){_0xaadae9[_0x6f40('0x6d')](function(_0xc03008){_0x56dec7[_0x6f40('0x62')](_0xc03008['id']+0x15b38);});_0x5d0d79(_0x56dec7);});}else{return db[_0x6f40('0x5b')][_0x6f40('0x49')]({'where':{'sectionId':_0x148fc3['id']},'raw':!![]})[_0x6f40('0x2e')](function(_0x2785e1){_0x2785e1['forEach'](function(_0x303c78){_0x56dec7[_0x6f40('0x62')](_0x303c78[_0x6f40('0x6c')]+0x15b38);});_0x5d0d79(_0x56dec7);});}}catch(_0x36e985){_0x1ecc69(_0x36e985);}});}exports[_0x6f40('0x6e')]=function(_0x4fde05,_0x282da3){return db[_0x6f40('0x35')][_0x6f40('0x4e')]({'where':{'id':_0x4fde05[_0x6f40('0x4b')]['id']}})['then'](handleEntityNotFound(_0x282da3,null))[_0x6f40('0x2e')](function(_0x14d317){if(_0x14d317){return db[_0x6f40('0x57')][_0x6f40('0x58')](function(_0x4a13bb){return db[_0x6f40('0x59')][_0x6f40('0x49')]({'where':{'userProfileId':_0x4fde05['params']['id']},'attributes':['id'],'raw':!![]})[_0x6f40('0x2e')](function(_0x4939d5){if(_0x4939d5){return db['UserProfileSection'][_0x6f40('0x2f')]({'where':{'userProfileId':_0x4fde05['params']['id'],'id':_[_0x6f40('0x34')](_0x4939d5,function(_0x4b92c9){return _0x4b92c9['id'];})},'transaction':_0x4a13bb});}})[_0x6f40('0x2e')](function(_0x58f710){var _0xd6ffc8=_[_0x6f40('0x34')](_0x4fde05[_0x6f40('0x51')],function(_0x8dfe5a){_0x8dfe5a[_0x6f40('0x5c')]=_0x4fde05['params']['id'];return _0x8dfe5a;});return db[_0x6f40('0x59')][_0x6f40('0x6f')](_0xd6ffc8,{'raw':!![],'transaction':_0x4a13bb});})['then'](function(_0x1dee37){var _0xc68774=_[_0x6f40('0x44')](_[_0x6f40('0x34')](_0x1dee37,function(_0x4c88f6){return _0x4c88f6[_0x6f40('0x53')]({'plain':!![]});}),{'includeAll':![]});if(_0xc68774){return db[_0x6f40('0x59')][_0x6f40('0x49')]({'where':{'userProfileId':_0x4fde05['params']['id'],'sectionId':_[_0x6f40('0x34')](_0xc68774,function(_0x4d23c9){return _0x4d23c9[_0x6f40('0x60')];})},'attributes':['id',_0x6f40('0x60')],'raw':!![]})[_0x6f40('0x2e')](function(_0x3c1f94){var _0x26ddc7=_[_0x6f40('0x34')](_0x4fde05[_0x6f40('0x51')],function(_0x24082d){_0x24082d[_0x6f40('0x5c')]=_0x4fde05['params']['id'];return _0x24082d;});return db['UserProfileResource'][_0x6f40('0x6f')](_0x26ddc7,{'raw':!![],'transaction':_0x4a13bb});});}})[_0x6f40('0x4f')](handleError(_0x282da3,null));});}})[_0x6f40('0x2e')](function(_0x4b66fc){var _0x43e4bf=_[_0x6f40('0x34')](_0x4b66fc,function(_0x3f025d){return _0x3f025d[_0x6f40('0x53')]({'plain':!![]});});})['then'](respondWithResult(_0x282da3,null))[_0x6f40('0x4f')](handleError(_0x282da3,null));};exports[_0x6f40('0x70')]=function(_0x3b37ad,_0x3243c3,_0x25a453){return db[_0x6f40('0x35')][_0x6f40('0x4e')]({'where':{'id':_0x3b37ad['params']['id']}})[_0x6f40('0x2e')](handleEntityNotFound(_0x3243c3,null))[_0x6f40('0x2e')](function(_0x2b6a33){if(_0x2b6a33){return _0x2b6a33[_0x6f40('0x70')](_0x3b37ad[_0x6f40('0x3a')][_0x6f40('0x64')]);}})[_0x6f40('0x2e')](respondWithStatusCode(_0x3243c3,null))[_0x6f40('0x4f')](handleError(_0x3243c3,null));};exports[_0x6f40('0x71')]=function(_0x4749f9,_0x4de4e1){var _0x15ed86={};if(!_0x4749f9[_0x6f40('0x3a')][_0x6f40('0x72')])throw new Error(_0x6f40('0x73'));if(!_0x4749f9[_0x6f40('0x3a')]['hasOwnProperty'](_0x6f40('0x74'))){_0x15ed86[_0x6f40('0x26')]=qs[_0x6f40('0x26')](_0x4749f9[_0x6f40('0x3a')][_0x6f40('0x26')]);_0x15ed86[_0x6f40('0x28')]=qs[_0x6f40('0x28')](_0x4749f9[_0x6f40('0x3a')][_0x6f40('0x28')]);}return db['UserProfile'][_0x6f40('0x4e')]({'where':{'id':_0x4749f9[_0x6f40('0x4b')]['id']}})['then'](function(_0x3fbbdc){if(!_0x3fbbdc)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x4749f9['params']['id']);return db['UserProfile'][_0x6f40('0x71')](_0x4749f9);})[_0x6f40('0x2e')](respondWithFilteredResult(_0x4de4e1,_0x15ed86))[_0x6f40('0x4f')](handleError(_0x4de4e1,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index d196a0c..d9dd3d9 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 _0x627e=['events','../../mysqldb','UserProfile','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x627e,0x14a));var _0xe627=function(_0xd7c52d,_0x4c7ef4){_0xd7c52d=_0xd7c52d-0x0;var _0x141ddd=_0x627e[_0xd7c52d];return _0x141ddd;};'use strict';var EventEmitter=require(_0xe627('0x0'));var UserProfile=require(_0xe627('0x1'))['db'][_0xe627('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xe627('0x3')](0x0);var events={'afterCreate':_0xe627('0x4'),'afterUpdate':'update','afterDestroy':_0xe627('0x5')};function emitEvent(_0x328881){return function(_0x2abdc7,_0x59a2c8,_0x52923f){UserProfileEvents['emit'](_0x328881+':'+_0x2abdc7['id'],_0x2abdc7);UserProfileEvents[_0xe627('0x6')](_0x328881,_0x2abdc7);_0x52923f(null);};}for(var e in events){if(events[_0xe627('0x7')](e)){var event=events[e];UserProfile[_0xe627('0x8')](e,emitEvent(event));}}module[_0xe627('0x9')]=UserProfileEvents; \ No newline at end of file +var _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0xadb5,0xad));var _0x5adb=function(_0x4700e5,_0x4b0dce){_0x4700e5=_0x4700e5-0x0;var _0x9e87fa=_0xadb5[_0x4700e5];return _0x9e87fa;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x5adb('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){UserProfileEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);UserProfileEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];UserProfile[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 96155c6..2036040 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 _0x24a8=['where','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','params','all','ignore','union','push','autoAssociation','model','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','includeAll','include','Tags','color','tag','ThroughTags','openTabs','true','dataValues','sms','fax','mail','whatsapp','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','map','catch','associatedResources','name','UserProfileResource','AnalyticExtractedReport','resourceId','squareprojects','SquareProject','odbc','childModel','SquareOdbc','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','ListId','lists','CmList','CmCompany','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','internalroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','Agents','membername','User','role','agent','Telephones','VoiceQueues','queue','type','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','VoicePrefix','ivrcampaigns','MailQueue','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','admin','user','zendeskaccounts','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','pauses','Pause','Schedule','sounds','Sound','tags','Tag','templates','triggers','trunks','Trunk','variables','plugins','Plugin','Reports','reportId','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions'];(function(_0x339d3c,_0x1a9760){var _0xc5f118=function(_0x54cb02){while(--_0x54cb02){_0x339d3c['push'](_0x339d3c['shift']());}};_0xc5f118(++_0x1a9760);}(_0x24a8,0xf9));var _0x824a=function(_0x5730d5,_0x44fea4){_0x5730d5=_0x5730d5-0x0;var _0x27abe7=_0x24a8[_0x5730d5];return _0x27abe7;};'use strict';var _=require('lodash');var attributes=require('./userProfile.attributes');var qs=require(_0x824a('0x0'));var squel=require(_0x824a('0x1'));module[_0x824a('0x2')]=function(_0x51848e){var _0x3806ac=_0x51848e[_0x824a('0x3')];function _0x4407ab(_0x385dea,_0x237a27){return new Promise(function(_0x3fcfc5,_0x5aad7a){if(!_0x237a27)return _0x3fcfc5(null);var _0x55abd3=_0x237a27[_0x824a('0x4')]?{[_0x237a27[_0x824a('0x4')][_0x824a('0x5')]]:_0x237a27[_0x824a('0x4')][_0x824a('0x6')]}:undefined;return _0x3806ac[_0x385dea][_0x824a('0x7')]({'where':_0x55abd3,'raw':!![]})[_0x824a('0x8')](function(_0x3ee472){_0x237a27['associatedResources']=_[_0x824a('0x9')](_0x3ee472,'id');_0x3fcfc5(_0x237a27);})[_0x824a('0xa')](function(_0x470625){_0x5aad7a(_0x470625);});});}function _0x54c153(_0x3d5515,_0x26d1fe){return new Promise(function(_0x22a70c,_0x5065a2){var _0x4e1625=_0x3d5515[_0x824a('0x4')]?{[_0x3d5515[_0x824a('0x4')][_0x824a('0x5')]]:_0x3d5515[_0x824a('0x4')][_0x824a('0x6')]}:undefined;return _0x3806ac[_0x3d5515['model']]['findAll']({'where':_0x4e1625,'raw':!![]})['then'](function(_0x44c887){_0x26d1fe[_0x824a('0xb')]=_['map'](_0x44c887,function(_0x34c164){return _0x34c164[_0x824a('0xc')];});_0x22a70c(_0x26d1fe);})['catch'](function(_0x269b88){_0x5065a2(_0x269b88);});});}function _0xd51c05(_0x381ab1,_0x317c5c,_0xe5f224){if(!_0x317c5c)return Promise['resolve'](null);return new Promise(function(_0x4ed02c,_0x171533){return _0x3806ac[_0x824a('0xd')]['findAll']({'where':{'sectionId':_0x317c5c['id']},'raw':!![]})[_0x824a('0x8')](function(_0x44c506){if(_0x381ab1[_0x824a('0x5')]&&_0x381ab1[_0x824a('0x5')]!=='id'){_0x317c5c[_0x824a('0xb')]=_['map'](_0x44c506,function(_0x3169bb){return _0x3169bb[_0x381ab1['field']];});}else{if(_0xe5f224===_0x824a('0xe')){_0x317c5c['associatedResources']=_['map'](_0x44c506,function(_0x39e77c){return{'id':_0x39e77c[_0x824a('0xf')],'type':_0x39e77c['type']};});}else{_0x317c5c[_0x824a('0xb')]=_['map'](_0x44c506,function(_0x35cddb){return _0x35cddb[_0x824a('0xf')];});}}_0x4ed02c(_0x317c5c);})['catch'](function(_0xaba491){_0x171533(_0xaba491);});});}function _0xac75d(_0x1c3bab,_0x35bb09){var _0x58c65c={'parentSections':[]};switch(_0x1c3bab['toLowerCase']()){case _0x824a('0x10'):_0x58c65c['childModel']=_0x824a('0x11');break;case _0x824a('0x12'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x14');break;case'squarerecordings':_0x58c65c[_0x824a('0x13')]=_0x824a('0x15');_0x58c65c[_0x824a('0x16')]=[{'name':_0x824a('0x17'),'field':'name','foreignKey':'projectName'}];break;case _0x824a('0x18'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x19');break;case _0x824a('0x1a'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x1b');_0x58c65c[_0x824a('0x16')]=[{'name':'Lists','field':'id','foreignKey':_0x824a('0x1c')}];break;case _0x824a('0x1d'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x1e');break;case'companies':_0x58c65c[_0x824a('0x13')]=_0x824a('0x1f');break;case'globalcustomfields':_0x58c65c[_0x824a('0x13')]='CmCustomField';break;case _0x824a('0x20'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x21');break;case _0x824a('0x22'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x23');break;case _0x824a('0x24'):_0x58c65c[_0x824a('0x13')]='FaxQueue';break;case _0x824a('0x25'):_0x58c65c[_0x824a('0x13')]='FaxAccount';break;case'inboundroutes':case _0x824a('0x26'):case'outboundroutes':_0x58c65c['childModel']=_0x824a('0x27');break;case _0x824a('0x28'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x29');break;case'voicemails':_0x58c65c['childModel']=_0x824a('0x2a');break;case _0x824a('0x2b'):_0x58c65c['childModel']='VoiceRecording';_0x58c65c[_0x824a('0x16')]=[{'name':_0x824a('0x2c'),'field':_0x824a('0xc'),'foreignKey':_0x824a('0x2d'),'model':_0x824a('0x2e'),'filter':{'field':_0x824a('0x2f'),'value':[_0x824a('0x30')]}},{'name':_0x824a('0x31'),'field':'name','foreignKey':_0x824a('0x2d'),'model':_0x824a('0x2e'),'filter':{'field':_0x824a('0x2f'),'value':['telephone']}},{'name':_0x824a('0x32'),'field':'name','foreignKey':_0x824a('0x33'),'model':'VoiceQueue','filter':{'field':_0x824a('0x34'),'value':[_0x824a('0x35')]}},{'name':_0x824a('0x36'),'field':_0x824a('0xc'),'foreignKey':_0x824a('0x33'),'model':_0x824a('0x37'),'filter':{'field':_0x824a('0x34'),'value':[_0x824a('0x38')]}}];break;case _0x824a('0x39'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x3a');break;case'chanspies':_0x58c65c[_0x824a('0x13')]=_0x824a('0x3b');break;case'voiceprefixes':_0x58c65c['childModel']=_0x824a('0x3c');break;case _0x824a('0x3d'):_0x58c65c[_0x824a('0x13')]='Campaign';break;case'mailqueues':_0x58c65c[_0x824a('0x13')]=_0x824a('0x3e');break;case'mailaccounts':_0x58c65c[_0x824a('0x13')]=_0x824a('0x3f');break;case _0x824a('0x40'):_0x58c65c[_0x824a('0x13')]='MailSubstatus';break;case _0x824a('0x41'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x42');break;case'openchannelaccounts':_0x58c65c[_0x824a('0x13')]=_0x824a('0x43');break;case _0x824a('0x44'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x45');break;case _0x824a('0x46'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x47');break;case'whatsappqueues':_0x58c65c['childModel']='WhatsappQueue';break;case _0x824a('0x48'):_0x58c65c['childModel']='WhatsappAccount';break;case _0x824a('0x49'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x4a');break;case _0x824a('0x4b'):case _0x824a('0x4c'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x37');if(_0x35bb09){_0x58c65c[_0x824a('0x16')]=[{'name':_0x824a('0x32')},{'name':_0x824a('0x36')}];}break;case _0x824a('0x4d'):case _0x824a('0x4e'):case _0x824a('0x4f'):_0x58c65c['childModel']=_0x824a('0x2e');if(_0x35bb09){_0x58c65c[_0x824a('0x16')]=[{'name':'Users','filter':{'field':_0x824a('0x2f'),'value':[_0x824a('0x50'),_0x824a('0x51')]},'ignore':!![]},{'name':_0x824a('0x2c')},{'name':_0x824a('0x31')}];}break;case _0x824a('0x52'):_0x58c65c[_0x824a('0x13')]='ZendeskAccount';break;case _0x824a('0x53'):_0x58c65c[_0x824a('0x13')]='SalesforceAccount';break;case _0x824a('0x54'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x55');break;case _0x824a('0x56'):_0x58c65c['childModel']=_0x824a('0x57');break;case _0x824a('0x58'):_0x58c65c['childModel']=_0x824a('0x59');break;case _0x824a('0x5a'):_0x58c65c[_0x824a('0x13')]='ZohoAccount';break;case'vtigeraccounts':_0x58c65c[_0x824a('0x13')]=_0x824a('0x2e');break;case _0x824a('0x5b'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x5c');break;case _0x824a('0x5d'):_0x58c65c['childModel']=_0x824a('0x5e');break;case'customdashboards':_0x58c65c[_0x824a('0x13')]=_0x824a('0x5f');break;case _0x824a('0x60'):_0x58c65c[_0x824a('0x13')]='Interval';break;case _0x824a('0x61'):_0x58c65c['childModel']=_0x824a('0x62');break;case'scheduler':_0x58c65c[_0x824a('0x13')]=_0x824a('0x63');break;case _0x824a('0x64'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x65');break;case _0x824a('0x66'):_0x58c65c[_0x824a('0x13')]=_0x824a('0x67');break;case _0x824a('0x68'):_0x58c65c['childModel']='Template';break;case _0x824a('0x69'):_0x58c65c['childModel']='Trigger';break;case _0x824a('0x6a'):_0x58c65c['childModel']=_0x824a('0x6b');break;case _0x824a('0x6c'):_0x58c65c[_0x824a('0x13')]='Variable';break;case _0x824a('0x6d'):_0x58c65c['childModel']=_0x824a('0x6e');break;case'extractedreports':_0x58c65c['childModel']=_0x824a('0xe');_0x58c65c['parentSections']=[{'name':_0x824a('0x6f'),'field':'id','foreignKey':_0x824a('0x70')}];break;case'metrics':_0x58c65c[_0x824a('0x13')]='AnalyticMetric';break;}return _0x58c65c;}function _0x2aaadc(_0x48d9fb,_0x1c3078){var _0x3d9e2c=_0x48d9fb[_0x824a('0x71')](0x0)[_0x824a('0x72')]()+_0x48d9fb[_0x824a('0x73')](0x1);var _0x4a2ab1={'type':_0x3806ac[_0x824a('0x74')][_0x824a('0x75')][_0x824a('0x76')],'raw':!![]};return new Promise(function(_0x494dab,_0x37ff48){var _0x579086=squel['select']()[_0x824a('0x5')](_0x824a('0x77')+_0x3d9e2c+_0x824a('0x78'),'id')[_0x824a('0x5')](_0x824a('0x79'))[_0x824a('0x7a')](_0x824a('0x7b')+_0x48d9fb+_0x824a('0x7c'),'ui')[_0x824a('0x7d')](_0x824a('0x7e'),_0x1c3078['id']);return _0x3806ac[_0x824a('0x7f')][_0x824a('0x80')](_0x579086[_0x824a('0x81')](),_0x4a2ab1)[_0x824a('0x8')](function(_0x4a87a4){_0x1c3078[_0x3d9e2c+'OpenTabs']=_0x4a87a4;_0x494dab(_0x4a87a4);})[_0x824a('0xa')](function(_0x327bcb){_0x37ff48(_0x327bcb);});});}return _0x51848e[_0x824a('0x82')](_0x824a('0x83'),attributes,{'tableName':_0x824a('0x84'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4110ab){var _0x51058b={'raw':_0x4110ab[_0x824a('0x80')][_0x824a('0x85')],'where':{}};var _0x30b4e0={};var _0x5498eb={'count':0x0,'rows':[]};var _0x58447a=_0x4110ab[_0x824a('0x80')][_0x824a('0x86')];var _0x1afbca=_0x4110ab[_0x824a('0x80')][_0x824a('0x87')]||![];var _0x5459ff=_0xac75d(_0x58447a,_0x1afbca);if(!_0x5459ff[_0x824a('0x13')])throw new Error(_0x824a('0x88')+_0x58447a+'\x27');var _0x2e8417=[{'name':_0x58447a}];if(!_[_0x824a('0x89')](_0x5459ff[_0x824a('0x16')]))_0x2e8417=_0x5459ff[_0x824a('0x16')];var _0x35a56d=[];for(var _0x301dd9=0x0;_0x301dd9<_0x2e8417[_0x824a('0x8a')];_0x301dd9++){_0x35a56d['push'](_0x3806ac[_0x824a('0x8b')][_0x824a('0x8c')]({'where':{'userProfileId':_0x4110ab[_0x824a('0x8d')]['id'],'name':_0x2e8417[_0x301dd9][_0x824a('0xc')]},'raw':!![]}));}return Promise[_0x824a('0x8e')](_0x35a56d)['then'](function(_0x46c684){var _0x8ad4dc=_['filter'](_0x46c684,function(_0x190328){return _0x190328?_0x190328:undefined;});var _0x358d9b=_['filter'](_0x2e8417,[_0x824a('0x8f'),!![]]);var _0x2ec809=_[_0x824a('0x89')](_0x8ad4dc)&&_[_0x824a('0x89')](_0x358d9b)?null:_[_0x824a('0x90')](_0x358d9b,_0x8ad4dc);if(!_0x2ec809)return null;var _0x37bd64=[];for(var _0x3b8cd9=0x0;_0x3b8cd9<_0x2ec809[_0x824a('0x8a')];_0x3b8cd9++){var _0x26cd1b=_[_0x824a('0x8c')](_0x2e8417,function(_0x2ed28c){return _0x2ec809[_0x3b8cd9]?_0x2ed28c[_0x824a('0xc')]===_0x2ec809[_0x3b8cd9][_0x824a('0xc')]:null;});if(_0x26cd1b){if(_0x2ec809[_0x3b8cd9][_0x824a('0x8f')]){_0x37bd64[_0x824a('0x91')](_0x4407ab(_0x5459ff['childModel'],_0x2ec809[_0x3b8cd9]));}else{if(!_0x2ec809[_0x3b8cd9][_0x824a('0x92')]){_0x37bd64['push'](_0xd51c05(_0x26cd1b,_0x2ec809[_0x3b8cd9],_0x5459ff[_0x824a('0x13')]));}else{if(_0x26cd1b[_0x824a('0x93')]){_0x37bd64[_0x824a('0x91')](_0x54c153(_0x26cd1b,_0x2ec809[_0x3b8cd9]));}}}}}return Promise['all'](_0x37bd64);})['then'](function(_0x195d71){var _0x16be70=_0x195d71;var _0x299942=null;if(_0x16be70){_0x299942=_0x16be70[_0x824a('0x8a')]===0x1?_0x16be70[0x0]:null;}if(!_0x299942&&!_0x16be70)return _0x5498eb;var _0x32f66f=_0x3806ac[_0x5459ff['childModel']][_0x824a('0x94')];_0x30b4e0[_0x824a('0x93')]=_[_0x824a('0x95')](_0x32f66f);_0x30b4e0[_0x824a('0x80')]=_[_0x824a('0x95')](_0x4110ab[_0x824a('0x80')]);_0x30b4e0[_0x824a('0x96')]=_[_0x824a('0x97')](_0x30b4e0['model'],_0x30b4e0[_0x824a('0x80')]);_0x51058b[_0x824a('0x98')]=_[_0x824a('0x97')](_0x30b4e0[_0x824a('0x93')],qs['fields'](_0x4110ab[_0x824a('0x80')][_0x824a('0x99')]));_0x51058b[_0x824a('0x98')]=_0x51058b[_0x824a('0x98')][_0x824a('0x8a')]?_0x51058b[_0x824a('0x98')]:_0x30b4e0[_0x824a('0x93')];if(!_0x4110ab[_0x824a('0x80')][_0x824a('0x9a')](_0x824a('0x9b'))){_0x51058b[_0x824a('0x9c')]=qs['limit'](_0x4110ab[_0x824a('0x80')][_0x824a('0x9c')]);_0x51058b['offset']=qs[_0x824a('0x9d')](_0x4110ab[_0x824a('0x80')]['offset']);}_0x51058b[_0x824a('0x9e')]=qs['sort'](_0x4110ab[_0x824a('0x80')][_0x824a('0x9f')]);_0x51058b[_0x824a('0x7d')]=qs['filters'](_['pick'](_0x4110ab['query'],_0x30b4e0[_0x824a('0x96')]));if(_0x4110ab['query']['filter']){_0x51058b[_0x824a('0x7d')]=_[_0x824a('0xa0')](_0x51058b[_0x824a('0x7d')],{'$or':_[_0x824a('0x9')](_0x32f66f,function(_0xc2cdcb){if(_0xc2cdcb[_0x824a('0x34')][_0x824a('0xa1')]!==_0x824a('0xa2')){var _0x5f44a8={};_0x5f44a8[_0xc2cdcb[_0x824a('0x5')]]={'$like':'%'+_0x4110ab[_0x824a('0x80')][_0x824a('0x4')]+'%'};return _0x5f44a8;}})});}var _0x2fd767=[];var _0x6f44af=null;var _0x563190={};if(_0x299942){_0x6f44af=_[_0x824a('0x8c')](_0x2e8417,[_0x824a('0xc'),_0x299942[_0x824a('0xc')]]);if(_0x6f44af[_0x824a('0x5')]){_0x563190={};if(_0x5459ff[_0x824a('0x13')]==='AnalyticExtractedReport'){_0x563190[_0x6f44af[_0x824a('0xa3')]]=_[_0x824a('0x9')](_0x299942[_0x824a('0xb')],'id');}else{_0x563190[_0x6f44af[_0x824a('0xa3')]]=_0x299942[_0x824a('0xb')];}_0x2fd767['push'](_0x563190);}else{_0x51058b[_0x824a('0x7d')]['id']=_0x299942[_0x824a('0xb')];}}else{for(var _0x79b255=0x0;_0x79b255<_0x16be70['length'];_0x79b255++){_0x6f44af=_['find'](_0x2e8417,[_0x824a('0xc'),_0x16be70[_0x79b255]['name']]);if(_0x6f44af['field']){_0x563190={};_0x563190[_0x6f44af[_0x824a('0xa3')]]=_0x16be70[_0x79b255]['associatedResources'];_0x2fd767['push'](_0x563190);}else{if(!_0x51058b['where']['id'])_0x51058b[_0x824a('0x7d')]['id']=[];_0x16be70[_0x79b255]['associatedResources'][_0x824a('0xa4')](function(_0x5e9127){_0x51058b[_0x824a('0x7d')]['id'][_0x824a('0x91')](_0x5e9127);});}}}if(!_[_0x824a('0x89')](_0x2fd767)){_0x51058b[_0x824a('0x7d')]=_[_0x824a('0xa0')](_0x51058b[_0x824a('0x7d')],{'$and':{'$or':_0x2fd767}});}_0x51058b=_[_0x824a('0xa0')]({},_0x51058b,_0x4110ab[_0x824a('0xa5')]);if(_0x299942&&!_0x299942[_0x824a('0x92')]&&_0x5459ff['childModel']===_0x824a('0xe')){if(_0x4110ab[_0x824a('0x80')]['includeAll']){_0x51058b['include']=[{'all':!![]}];}return _0x3806ac[_0x5459ff['childModel']][_0x824a('0x7')](_0x51058b)[_0x824a('0x8')](function(_0x3e6959){var _0x27ec4c=[];_0x3e6959[_0x824a('0xa4')](function(_0x255791){var _0x5b194f;switch(_0x255791['reportType']){case'default':_0x5b194f=_['find'](_0x299942[_0x824a('0xb')],function(_0x4c8e3a){return _0x4c8e3a['id']===_0x255791[_0x824a('0x70')]&&_0x4c8e3a[_0x824a('0x34')]===_0x824a('0xa6');});break;case _0x824a('0xa7'):_0x5b194f=_['find'](_0x299942[_0x824a('0xb')],function(_0x4619f0){return _0x4619f0['id']===_0x255791[_0x824a('0x70')]&&_0x4619f0[_0x824a('0x34')]===_0x824a('0xa8');});break;}if(_0x5b194f)_0x27ec4c[_0x824a('0x91')](_0x255791);});_0x5498eb[_0x824a('0xa9')]=_0x27ec4c[_0x824a('0x8a')];_0x5498eb[_0x824a('0xaa')]=_0x27ec4c;return _0x5498eb;});}else{if(!_[_0x824a('0x89')](_0x4110ab[_0x824a('0x80')][_0x824a('0xab')])){_0x51058b[_0x824a('0x7d')]['id']=_0x51058b[_0x824a('0x7d')]['id']?_[_0x824a('0x97')](_0x51058b['where']['id'],_0x4110ab[_0x824a('0x80')][_0x824a('0xab')]):_0x4110ab[_0x824a('0x80')][_0x824a('0xab')];if(_0x4110ab[_0x824a('0x80')][_0x824a('0xac')]){_0x51058b['order']=_0x4110ab[_0x824a('0x80')][_0x824a('0xac')];}}if(_0x4110ab[_0x824a('0x80')]['extraQueryConditions']){_0x51058b['where']=_[_0x824a('0xa0')](_0x51058b[_0x824a('0x7d')],{'$and':_0x4110ab[_0x824a('0x80')][_0x824a('0xad')]});}return _0x3806ac[_0x5459ff[_0x824a('0x13')]][_0x824a('0xa9')]({'where':_0x51058b[_0x824a('0x7d')]})[_0x824a('0x8')](function(_0x5c8042){_0x5498eb[_0x824a('0xa9')]=_0x5c8042;if(_0x4110ab[_0x824a('0x80')][_0x824a('0xae')]){if(_0x5459ff[_0x824a('0x13')]==='CmContact'){_0x51058b[_0x824a('0xaf')]=[{'model':_0x3806ac[_0x824a('0x67')],'as':_0x824a('0xb0'),'attributes':['id','name',_0x824a('0xb1')],'required':_0x4110ab['query'][_0x824a('0xb2')]?!![]:![]},{'model':_0x3806ac['Tag'],'as':_0x824a('0xb3'),'attributes':['id',_0x824a('0xc'),_0x824a('0xb1')],'through':_0x4110ab[_0x824a('0x80')]['tag']?{'attributes':[],'where':{'TagId':_0x4110ab['query']['tag']||undefined}}:{},'required':_0x4110ab[_0x824a('0x80')][_0x824a('0xb2')]?!![]:![]}];}else{_0x51058b['include']=[{'all':!![]}];}}return _0x3806ac[_0x5459ff[_0x824a('0x13')]][_0x824a('0x7')](_0x51058b);})['then'](function(_0x66c588){_0x5498eb[_0x824a('0xaa')]=_0x66c588;if(_0x58447a===_0x824a('0x2c')&&_0x4110ab['query'][_0x824a('0xb4')]===_0x824a('0xb5')){var _0x1d1bca=[];for(var _0x23f047=0x0;_0x23f047<_0x5498eb[_0x824a('0xaa')][_0x824a('0x8a')];_0x23f047++){_0x1d1bca[_0x824a('0x91')](_0x2aaadc('chat',_0x5498eb[_0x824a('0xaa')][_0x23f047][_0x824a('0xb6')]));_0x1d1bca[_0x824a('0x91')](_0x2aaadc(_0x824a('0xb7'),_0x5498eb[_0x824a('0xaa')][_0x23f047][_0x824a('0xb6')]));_0x1d1bca[_0x824a('0x91')](_0x2aaadc(_0x824a('0xb8'),_0x5498eb['rows'][_0x23f047]['dataValues']));_0x1d1bca[_0x824a('0x91')](_0x2aaadc(_0x824a('0xb9'),_0x5498eb[_0x824a('0xaa')][_0x23f047]['dataValues']));_0x1d1bca[_0x824a('0x91')](_0x2aaadc('openchannel',_0x5498eb[_0x824a('0xaa')][_0x23f047]['dataValues']));_0x1d1bca[_0x824a('0x91')](_0x2aaadc(_0x824a('0xba'),_0x5498eb['rows'][_0x23f047][_0x824a('0xb6')]));}return Promise[_0x824a('0x8e')](_0x1d1bca)[_0x824a('0x8')](function(){return _0x5498eb;});}return _0x5498eb;});}});}}});}; \ No newline at end of file +var _0x8649=['MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','voicequeues','queuecampaigns','VoiceQueues','telephones','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','extractedreports','Reports','reportId','AnalyticMetric','charAt','slice','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','isEmpty','length','UserProfileSection','params','all','ignore','find','autoAssociation','push','model','rawAttributes','keys','filters','intersection','fields','attributes','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','Tags','color','tag','ThroughTags','openTabs','true','dataValues','sms','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','models','filter','field','value','findAll','then','associatedResources','map','name','resolve','UserProfileResource','AnalyticExtractedReport','type','resourceId','catch','toLowerCase','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','parentSections','Agents','membername','User','role','agent','Telephones','telephone','queue','VoiceQueue','inbound','outbound','VoiceMusicOnHold','chanspies','VoicePrefix','Campaign','mailqueues'];(function(_0x2e2e6f,_0x20666f){var _0x125719=function(_0x1eea9e){while(--_0x1eea9e){_0x2e2e6f['push'](_0x2e2e6f['shift']());}};_0x125719(++_0x20666f);}(_0x8649,0x80));var _0x9864=function(_0x17c636,_0x14bfc3){_0x17c636=_0x17c636-0x0;var _0x41e0e7=_0x8649[_0x17c636];return _0x41e0e7;};'use strict';var _=require(_0x9864('0x0'));var attributes=require(_0x9864('0x1'));var qs=require(_0x9864('0x2'));var squel=require('squel');module['exports']=function(_0x5d919a){var _0xff120f=_0x5d919a[_0x9864('0x3')];function _0x3a2ec5(_0x1deb45,_0x53e97f){return new Promise(function(_0x4846fd,_0x5daa99){if(!_0x53e97f)return _0x4846fd(null);var _0x2180c3=_0x53e97f[_0x9864('0x4')]?{[_0x53e97f[_0x9864('0x4')][_0x9864('0x5')]]:_0x53e97f[_0x9864('0x4')][_0x9864('0x6')]}:undefined;return _0xff120f[_0x1deb45][_0x9864('0x7')]({'where':_0x2180c3,'raw':!![]})[_0x9864('0x8')](function(_0x56b645){_0x53e97f[_0x9864('0x9')]=_[_0x9864('0xa')](_0x56b645,'id');_0x4846fd(_0x53e97f);})['catch'](function(_0x3fdab0){_0x5daa99(_0x3fdab0);});});}function _0x141fba(_0x23a97f,_0x5be64a){return new Promise(function(_0x2c730a,_0x42da33){var _0x1ae16a=_0x23a97f[_0x9864('0x4')]?{[_0x23a97f['filter'][_0x9864('0x5')]]:_0x23a97f[_0x9864('0x4')]['value']}:undefined;return _0xff120f[_0x23a97f['model']][_0x9864('0x7')]({'where':_0x1ae16a,'raw':!![]})[_0x9864('0x8')](function(_0x115ea3){_0x5be64a['associatedResources']=_[_0x9864('0xa')](_0x115ea3,function(_0x345110){return _0x345110[_0x9864('0xb')];});_0x2c730a(_0x5be64a);})['catch'](function(_0x49ad30){_0x42da33(_0x49ad30);});});}function _0x2d3578(_0x212df6,_0x577dad,_0x40f07f){if(!_0x577dad)return Promise[_0x9864('0xc')](null);return new Promise(function(_0x3edba3,_0x151225){return _0xff120f[_0x9864('0xd')][_0x9864('0x7')]({'where':{'sectionId':_0x577dad['id']},'raw':!![]})[_0x9864('0x8')](function(_0x2f196c){if(_0x212df6[_0x9864('0x5')]&&_0x212df6[_0x9864('0x5')]!=='id'){_0x577dad[_0x9864('0x9')]=_[_0x9864('0xa')](_0x2f196c,function(_0xcdcff0){return _0xcdcff0[_0x212df6['field']];});}else{if(_0x40f07f===_0x9864('0xe')){_0x577dad[_0x9864('0x9')]=_[_0x9864('0xa')](_0x2f196c,function(_0x1a973d){return{'id':_0x1a973d['resourceId'],'type':_0x1a973d[_0x9864('0xf')]};});}else{_0x577dad[_0x9864('0x9')]=_[_0x9864('0xa')](_0x2f196c,function(_0x186014){return _0x186014[_0x9864('0x10')];});}}_0x3edba3(_0x577dad);})[_0x9864('0x11')](function(_0x3b46b7){_0x151225(_0x3b46b7);});});}function _0x4d0ae8(_0x6c3a5f,_0x4b081b){var _0x678ee3={'parentSections':[]};switch(_0x6c3a5f[_0x9864('0x12')]()){case'squareprojects':_0x678ee3[_0x9864('0x13')]='SquareProject';break;case _0x9864('0x14'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x15');break;case _0x9864('0x16'):_0x678ee3['childModel']=_0x9864('0x17');_0x678ee3['parentSections']=[{'name':_0x9864('0x18'),'field':'name','foreignKey':'projectName'}];break;case _0x9864('0x19'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x1a');break;case _0x9864('0x1b'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x1c');_0x678ee3['parentSections']=[{'name':_0x9864('0x1d'),'field':'id','foreignKey':_0x9864('0x1e')}];break;case'lists':_0x678ee3[_0x9864('0x13')]=_0x9864('0x1f');break;case _0x9864('0x20'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x21');break;case _0x9864('0x22'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x23');break;case _0x9864('0x24'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x25');break;case _0x9864('0x26'):_0x678ee3['childModel']='ChatWebsite';break;case'faxqueues':_0x678ee3['childModel']=_0x9864('0x27');break;case _0x9864('0x28'):_0x678ee3[_0x9864('0x13')]='FaxAccount';break;case _0x9864('0x29'):case _0x9864('0x2a'):case _0x9864('0x2b'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x2c');break;case _0x9864('0x2d'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x2e');break;case _0x9864('0x2f'):_0x678ee3['childModel']='VoiceMail';break;case _0x9864('0x30'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x31');_0x678ee3[_0x9864('0x32')]=[{'name':_0x9864('0x33'),'field':_0x9864('0xb'),'foreignKey':_0x9864('0x34'),'model':_0x9864('0x35'),'filter':{'field':_0x9864('0x36'),'value':[_0x9864('0x37')]}},{'name':_0x9864('0x38'),'field':'name','foreignKey':_0x9864('0x34'),'model':'User','filter':{'field':'role','value':[_0x9864('0x39')]}},{'name':'VoiceQueues','field':_0x9864('0xb'),'foreignKey':_0x9864('0x3a'),'model':_0x9864('0x3b'),'filter':{'field':_0x9864('0xf'),'value':[_0x9864('0x3c')]}},{'name':'QueueCampaigns','field':_0x9864('0xb'),'foreignKey':_0x9864('0x3a'),'model':_0x9864('0x3b'),'filter':{'field':'type','value':[_0x9864('0x3d')]}}];break;case'musiconholds':_0x678ee3[_0x9864('0x13')]=_0x9864('0x3e');break;case _0x9864('0x3f'):_0x678ee3['childModel']='VoiceChanSpy';break;case'voiceprefixes':_0x678ee3[_0x9864('0x13')]=_0x9864('0x40');break;case'ivrcampaigns':_0x678ee3['childModel']=_0x9864('0x41');break;case _0x9864('0x42'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x43');break;case _0x9864('0x44'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x45');break;case _0x9864('0x46'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x47');break;case _0x9864('0x48'):_0x678ee3['childModel']=_0x9864('0x49');break;case _0x9864('0x4a'):_0x678ee3[_0x9864('0x13')]='OpenchannelAccount';break;case _0x9864('0x4b'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x4c');break;case _0x9864('0x4d'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x4e');break;case'whatsappqueues':_0x678ee3[_0x9864('0x13')]=_0x9864('0x4f');break;case _0x9864('0x50'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x51');break;case'teams':_0x678ee3['childModel']=_0x9864('0x52');break;case _0x9864('0x53'):case _0x9864('0x54'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x3b');if(_0x4b081b){_0x678ee3['parentSections']=[{'name':_0x9864('0x55')},{'name':'QueueCampaigns'}];}break;case'users':case'agents':case _0x9864('0x56'):_0x678ee3['childModel']=_0x9864('0x35');if(_0x4b081b){_0x678ee3[_0x9864('0x32')]=[{'name':'Users','filter':{'field':_0x9864('0x36'),'value':[_0x9864('0x57'),_0x9864('0x58')]},'ignore':!![]},{'name':_0x9864('0x33')},{'name':_0x9864('0x38')}];}break;case _0x9864('0x59'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x5a');break;case _0x9864('0x5b'):_0x678ee3['childModel']='SalesforceAccount';break;case _0x9864('0x5c'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x5d');break;case _0x9864('0x5e'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x5f');break;case _0x9864('0x60'):_0x678ee3[_0x9864('0x13')]='DeskAccount';break;case _0x9864('0x61'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x62');break;case'vtigeraccounts':_0x678ee3[_0x9864('0x13')]=_0x9864('0x35');break;case _0x9864('0x63'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x64');break;case _0x9864('0x65'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x66');break;case _0x9864('0x67'):_0x678ee3['childModel']=_0x9864('0x68');break;case'intervals':_0x678ee3['childModel']='Interval';break;case _0x9864('0x69'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x6a');break;case _0x9864('0x6b'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x6c');break;case _0x9864('0x6d'):_0x678ee3['childModel']=_0x9864('0x6e');break;case _0x9864('0x6f'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x70');break;case _0x9864('0x71'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x72');break;case _0x9864('0x73'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x74');break;case'trunks':_0x678ee3[_0x9864('0x13')]=_0x9864('0x75');break;case _0x9864('0x76'):_0x678ee3[_0x9864('0x13')]=_0x9864('0x77');break;case _0x9864('0x78'):_0x678ee3['childModel']='Plugin';break;case _0x9864('0x79'):_0x678ee3['childModel']='AnalyticExtractedReport';_0x678ee3[_0x9864('0x32')]=[{'name':_0x9864('0x7a'),'field':'id','foreignKey':_0x9864('0x7b')}];break;case'metrics':_0x678ee3['childModel']=_0x9864('0x7c');break;}return _0x678ee3;}function _0x563d86(_0x39fa20,_0x41708f){var _0x175bfe=_0x39fa20[_0x9864('0x7d')](0x0)['toUpperCase']()+_0x39fa20[_0x9864('0x7e')](0x1);var _0x471a61={'type':_0xff120f['Sequelize'][_0x9864('0x7f')][_0x9864('0x80')],'raw':!![]};return new Promise(function(_0x2e5a5b,_0x461096){var _0x418eea=squel[_0x9864('0x81')]()[_0x9864('0x5')](_0x9864('0x82')+_0x175bfe+_0x9864('0x83'),'id')[_0x9864('0x5')](_0x9864('0x84'))[_0x9864('0x85')](_0x9864('0x86')+_0x39fa20+_0x9864('0x87'),'ui')[_0x9864('0x88')](_0x9864('0x89'),_0x41708f['id']);return _0xff120f['sequelize'][_0x9864('0x8a')](_0x418eea[_0x9864('0x8b')](),_0x471a61)[_0x9864('0x8')](function(_0x3eab45){_0x41708f[_0x175bfe+_0x9864('0x8c')]=_0x3eab45;_0x2e5a5b(_0x3eab45);})[_0x9864('0x11')](function(_0x4f6281){_0x461096(_0x4f6281);});});}return _0x5d919a[_0x9864('0x8d')](_0x9864('0x8e'),attributes,{'tableName':_0x9864('0x8f'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4583ee){var _0x1c9415={'raw':_0x4583ee['query'][_0x9864('0x90')],'where':{}};var _0x5b6dfd={};var _0x286a56={'count':0x0,'rows':[]};var _0x2a3ea2=_0x4583ee['query'][_0x9864('0x91')];var _0x2f4a59=_0x4583ee['query'][_0x9864('0x92')]||![];var _0x3405ad=_0x4d0ae8(_0x2a3ea2,_0x2f4a59);if(!_0x3405ad['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x2a3ea2+'\x27');var _0x118d2a=[{'name':_0x2a3ea2}];if(!_[_0x9864('0x93')](_0x3405ad[_0x9864('0x32')]))_0x118d2a=_0x3405ad[_0x9864('0x32')];var _0x28f90c=[];for(var _0x2fff51=0x0;_0x2fff51<_0x118d2a[_0x9864('0x94')];_0x2fff51++){_0x28f90c['push'](_0xff120f[_0x9864('0x95')]['find']({'where':{'userProfileId':_0x4583ee[_0x9864('0x96')]['id'],'name':_0x118d2a[_0x2fff51][_0x9864('0xb')]},'raw':!![]}));}return Promise[_0x9864('0x97')](_0x28f90c)[_0x9864('0x8')](function(_0x1cb35f){var _0x4ca3a9=_['filter'](_0x1cb35f,function(_0x41ff82){return _0x41ff82?_0x41ff82:undefined;});var _0x416af5=_['filter'](_0x118d2a,[_0x9864('0x98'),!![]]);var _0x557dcd=_[_0x9864('0x93')](_0x4ca3a9)&&_[_0x9864('0x93')](_0x416af5)?null:_['union'](_0x416af5,_0x4ca3a9);if(!_0x557dcd)return null;var _0x195cbb=[];for(var _0x54b36d=0x0;_0x54b36d<_0x557dcd[_0x9864('0x94')];_0x54b36d++){var _0x120bcf=_[_0x9864('0x99')](_0x118d2a,function(_0x5745cd){return _0x557dcd[_0x54b36d]?_0x5745cd[_0x9864('0xb')]===_0x557dcd[_0x54b36d][_0x9864('0xb')]:null;});if(_0x120bcf){if(_0x557dcd[_0x54b36d][_0x9864('0x98')]){_0x195cbb['push'](_0x3a2ec5(_0x3405ad['childModel'],_0x557dcd[_0x54b36d]));}else{if(!_0x557dcd[_0x54b36d][_0x9864('0x9a')]){_0x195cbb[_0x9864('0x9b')](_0x2d3578(_0x120bcf,_0x557dcd[_0x54b36d],_0x3405ad[_0x9864('0x13')]));}else{if(_0x120bcf[_0x9864('0x9c')]){_0x195cbb['push'](_0x141fba(_0x120bcf,_0x557dcd[_0x54b36d]));}}}}}return Promise[_0x9864('0x97')](_0x195cbb);})[_0x9864('0x8')](function(_0x280df6){var _0x67a718=_0x280df6;var _0x1943fc=null;if(_0x67a718){_0x1943fc=_0x67a718[_0x9864('0x94')]===0x1?_0x67a718[0x0]:null;}if(!_0x1943fc&&!_0x67a718)return _0x286a56;var _0x312ba9=_0xff120f[_0x3405ad[_0x9864('0x13')]][_0x9864('0x9d')];_0x5b6dfd['model']=_['keys'](_0x312ba9);_0x5b6dfd[_0x9864('0x8a')]=_[_0x9864('0x9e')](_0x4583ee[_0x9864('0x8a')]);_0x5b6dfd[_0x9864('0x9f')]=_['intersection'](_0x5b6dfd[_0x9864('0x9c')],_0x5b6dfd['query']);_0x1c9415['attributes']=_[_0x9864('0xa0')](_0x5b6dfd['model'],qs[_0x9864('0xa1')](_0x4583ee['query'][_0x9864('0xa1')]));_0x1c9415['attributes']=_0x1c9415[_0x9864('0xa2')][_0x9864('0x94')]?_0x1c9415[_0x9864('0xa2')]:_0x5b6dfd['model'];if(!_0x4583ee['query']['hasOwnProperty'](_0x9864('0xa3'))){_0x1c9415[_0x9864('0xa4')]=qs[_0x9864('0xa4')](_0x4583ee['query'][_0x9864('0xa4')]);_0x1c9415[_0x9864('0xa5')]=qs[_0x9864('0xa5')](_0x4583ee['query'][_0x9864('0xa5')]);}_0x1c9415[_0x9864('0xa6')]=qs[_0x9864('0xa7')](_0x4583ee['query']['sort']);_0x1c9415[_0x9864('0x88')]=qs[_0x9864('0x9f')](_[_0x9864('0xa8')](_0x4583ee[_0x9864('0x8a')],_0x5b6dfd['filters']));if(_0x4583ee[_0x9864('0x8a')]['filter']){_0x1c9415[_0x9864('0x88')]=_[_0x9864('0xa9')](_0x1c9415['where'],{'$or':_[_0x9864('0xa')](_0x312ba9,function(_0x52e17b){if(_0x52e17b[_0x9864('0xf')][_0x9864('0xaa')]!==_0x9864('0xab')){var _0x5b157a={};_0x5b157a[_0x52e17b['field']]={'$like':'%'+_0x4583ee['query']['filter']+'%'};return _0x5b157a;}})});}var _0x285dd5=[];var _0x5da54f=null;var _0x27896f={};if(_0x1943fc){_0x5da54f=_[_0x9864('0x99')](_0x118d2a,['name',_0x1943fc[_0x9864('0xb')]]);if(_0x5da54f[_0x9864('0x5')]){_0x27896f={};if(_0x3405ad[_0x9864('0x13')]==='AnalyticExtractedReport'){_0x27896f[_0x5da54f[_0x9864('0xac')]]=_['map'](_0x1943fc[_0x9864('0x9')],'id');}else{_0x27896f[_0x5da54f[_0x9864('0xac')]]=_0x1943fc[_0x9864('0x9')];}_0x285dd5[_0x9864('0x9b')](_0x27896f);}else{_0x1c9415[_0x9864('0x88')]['id']=_0x1943fc['associatedResources'];}}else{for(var _0x49cc30=0x0;_0x49cc30<_0x67a718[_0x9864('0x94')];_0x49cc30++){_0x5da54f=_[_0x9864('0x99')](_0x118d2a,[_0x9864('0xb'),_0x67a718[_0x49cc30][_0x9864('0xb')]]);if(_0x5da54f[_0x9864('0x5')]){_0x27896f={};_0x27896f[_0x5da54f['foreignKey']]=_0x67a718[_0x49cc30][_0x9864('0x9')];_0x285dd5[_0x9864('0x9b')](_0x27896f);}else{if(!_0x1c9415[_0x9864('0x88')]['id'])_0x1c9415['where']['id']=[];_0x67a718[_0x49cc30][_0x9864('0x9')][_0x9864('0xad')](function(_0x1b2586){_0x1c9415[_0x9864('0x88')]['id'][_0x9864('0x9b')](_0x1b2586);});}}}if(!_['isEmpty'](_0x285dd5)){_0x1c9415[_0x9864('0x88')]=_[_0x9864('0xa9')](_0x1c9415['where'],{'$and':{'$or':_0x285dd5}});}_0x1c9415=_[_0x9864('0xa9')]({},_0x1c9415,_0x4583ee[_0x9864('0xae')]);if(_0x1943fc&&!_0x1943fc['autoAssociation']&&_0x3405ad[_0x9864('0x13')]===_0x9864('0xe')){if(_0x4583ee[_0x9864('0x8a')][_0x9864('0xaf')]){_0x1c9415[_0x9864('0xb0')]=[{'all':!![]}];}return _0xff120f[_0x3405ad[_0x9864('0x13')]][_0x9864('0x7')](_0x1c9415)[_0x9864('0x8')](function(_0x3880fa){var _0x3d000f=[];_0x3880fa[_0x9864('0xad')](function(_0x2fa45f){var _0x3e5f57;switch(_0x2fa45f[_0x9864('0xb1')]){case'default':_0x3e5f57=_[_0x9864('0x99')](_0x1943fc[_0x9864('0x9')],function(_0x591657){return _0x591657['id']===_0x2fa45f[_0x9864('0x7b')]&&_0x591657[_0x9864('0xf')]===_0x9864('0xb2');});break;case _0x9864('0xb3'):_0x3e5f57=_['find'](_0x1943fc[_0x9864('0x9')],function(_0x3805b3){return _0x3805b3['id']===_0x2fa45f['reportId']&&_0x3805b3[_0x9864('0xf')]===_0x9864('0xb4');});break;}if(_0x3e5f57)_0x3d000f[_0x9864('0x9b')](_0x2fa45f);});_0x286a56[_0x9864('0xb5')]=_0x3d000f[_0x9864('0x94')];_0x286a56[_0x9864('0xb6')]=_0x3d000f;return _0x286a56;});}else{if(!_[_0x9864('0x93')](_0x4583ee['query'][_0x9864('0xb7')])){_0x1c9415[_0x9864('0x88')]['id']=_0x1c9415[_0x9864('0x88')]['id']?_[_0x9864('0xa0')](_0x1c9415[_0x9864('0x88')]['id'],_0x4583ee[_0x9864('0x8a')][_0x9864('0xb7')]):_0x4583ee['query'][_0x9864('0xb7')];if(_0x4583ee['query'][_0x9864('0xb8')]){_0x1c9415[_0x9864('0xa6')]=_0x4583ee[_0x9864('0x8a')][_0x9864('0xb8')];}}if(_0x4583ee['query'][_0x9864('0xb9')]){_0x1c9415['where']=_['merge'](_0x1c9415['where'],{'$and':_0x4583ee['query'][_0x9864('0xb9')]});}return _0xff120f[_0x3405ad[_0x9864('0x13')]][_0x9864('0xb5')]({'where':_0x1c9415[_0x9864('0x88')]})[_0x9864('0x8')](function(_0x726e44){_0x286a56[_0x9864('0xb5')]=_0x726e44;if(_0x4583ee['query'][_0x9864('0xaf')]){if(_0x3405ad['childModel']===_0x9864('0x1c')){_0x1c9415[_0x9864('0xb0')]=[{'model':_0xff120f[_0x9864('0x70')],'as':_0x9864('0xba'),'attributes':['id','name',_0x9864('0xbb')],'required':_0x4583ee[_0x9864('0x8a')][_0x9864('0xbc')]?!![]:![]},{'model':_0xff120f[_0x9864('0x70')],'as':_0x9864('0xbd'),'attributes':['id',_0x9864('0xb'),_0x9864('0xbb')],'through':_0x4583ee[_0x9864('0x8a')][_0x9864('0xbc')]?{'attributes':[],'where':{'TagId':_0x4583ee['query'][_0x9864('0xbc')]||undefined}}:{},'required':_0x4583ee[_0x9864('0x8a')]['tag']?!![]:![]}];}else{_0x1c9415[_0x9864('0xb0')]=[{'all':!![]}];}}return _0xff120f[_0x3405ad['childModel']][_0x9864('0x7')](_0x1c9415);})['then'](function(_0xd8197f){_0x286a56[_0x9864('0xb6')]=_0xd8197f;if(_0x2a3ea2==='Agents'&&_0x4583ee[_0x9864('0x8a')][_0x9864('0xbe')]===_0x9864('0xbf')){var _0x185df0=[];for(var _0x40f415=0x0;_0x40f415<_0x286a56['rows'][_0x9864('0x94')];_0x40f415++){_0x185df0[_0x9864('0x9b')](_0x563d86('chat',_0x286a56[_0x9864('0xb6')][_0x40f415][_0x9864('0xc0')]));_0x185df0['push'](_0x563d86(_0x9864('0xc1'),_0x286a56[_0x9864('0xb6')][_0x40f415][_0x9864('0xc0')]));_0x185df0['push'](_0x563d86('fax',_0x286a56[_0x9864('0xb6')][_0x40f415][_0x9864('0xc0')]));_0x185df0['push'](_0x563d86('mail',_0x286a56[_0x9864('0xb6')][_0x40f415][_0x9864('0xc0')]));_0x185df0[_0x9864('0x9b')](_0x563d86(_0x9864('0xc2'),_0x286a56[_0x9864('0xb6')][_0x40f415][_0x9864('0xc0')]));_0x185df0['push'](_0x563d86('whatsapp',_0x286a56[_0x9864('0xb6')][_0x40f415][_0x9864('0xc0')]));}return Promise[_0x9864('0x97')](_0x185df0)['then'](function(){return _0x286a56;});}return _0x286a56;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index bea5e98..e9a7662 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 _0xd386=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserProfile,\x20%s,\x20%s','message','info','catch','lodash','util'];(function(_0x3d8ef7,_0x25f8b0){var _0x509073=function(_0x23f7c7){while(--_0x23f7c7){_0x3d8ef7['push'](_0x3d8ef7['shift']());}};_0x509073(++_0x25f8b0);}(_0xd386,0x10c));var _0x6d38=function(_0x7f6e9,_0x2cf772){_0x7f6e9=_0x7f6e9-0x0;var _0x5a3124=_0xd386[_0x7f6e9];return _0x5a3124;};'use strict';var _=require(_0x6d38('0x0'));var util=require(_0x6d38('0x1'));var moment=require(_0x6d38('0x2'));var BPromise=require('bluebird');var rs=require(_0x6d38('0x3'));var fs=require('fs');var Redis=require(_0x6d38('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d38('0x5'));var logger=require(_0x6d38('0x6'))(_0x6d38('0x7'));var config=require(_0x6d38('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6d38('0x9')][_0x6d38('0xa')]({'port':0x232a});config[_0x6d38('0xb')]=_[_0x6d38('0xc')](config[_0x6d38('0xb')],{'host':_0x6d38('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6d38('0xb')]));require('./userProfile.socket')[_0x6d38('0xe')](socket);function respondWithRpcPromise(_0x4909e0,_0x171f76,_0x29c14b){return new BPromise(function(_0x23c9ba,_0x5dfc29){return client[_0x6d38('0xf')](_0x4909e0,_0x29c14b)[_0x6d38('0x10')](function(_0x404a35){logger['info']('UserProfile,\x20%s,\x20%s',_0x171f76,'request\x20sent');logger[_0x6d38('0x11')](_0x6d38('0x12'),_0x171f76,_0x6d38('0x13'),JSON[_0x6d38('0x14')](_0x404a35));if(_0x404a35[_0x6d38('0x15')]){if(_0x404a35['error'][_0x6d38('0x16')]===0x1f4){logger[_0x6d38('0x15')](_0x6d38('0x17'),_0x171f76,_0x404a35[_0x6d38('0x15')][_0x6d38('0x18')]);return _0x5dfc29(_0x404a35[_0x6d38('0x15')][_0x6d38('0x18')]);}logger['error']('UserProfile,\x20%s,\x20%s',_0x171f76,_0x404a35['error'][_0x6d38('0x18')]);return _0x23c9ba(_0x404a35[_0x6d38('0x15')][_0x6d38('0x18')]);}else{logger[_0x6d38('0x19')](_0x6d38('0x17'),_0x171f76,_0x6d38('0x13'));_0x23c9ba(_0x404a35['result'][_0x6d38('0x18')]);}})[_0x6d38('0x1a')](function(_0x364d22){logger[_0x6d38('0x15')](_0x6d38('0x17'),_0x171f76,_0x364d22);_0x5dfc29(_0x364d22);});});} \ No newline at end of file +var _0xc7bd=['redis','localhost','socket.io-emitter','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x47d2b0,_0x2df54d){var _0x332f8a=function(_0xbb960f){while(--_0xbb960f){_0x47d2b0['push'](_0x47d2b0['shift']());}};_0x332f8a(++_0x2df54d);}(_0xc7bd,0x86));var _0xdc7b=function(_0x2a6e62,_0xa82f7d){_0x2a6e62=_0x2a6e62-0x0;var _0x2e0cf9=_0xc7bd[_0x2a6e62];return _0x2e0cf9;};'use strict';var _=require('lodash');var util=require(_0xdc7b('0x0'));var moment=require(_0xdc7b('0x1'));var BPromise=require('bluebird');var rs=require(_0xdc7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdc7b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc7b('0x4'))(_0xdc7b('0x5'));var config=require(_0xdc7b('0x6'));var jayson=require(_0xdc7b('0x7'));var client=jayson[_0xdc7b('0x8')][_0xdc7b('0x9')]({'port':0x232a});config[_0xdc7b('0xa')]=_['defaults'](config[_0xdc7b('0xa')],{'host':_0xdc7b('0xb'),'port':0x18eb});var socket=require(_0xdc7b('0xc'))(new Redis(config['redis']));require('./userProfile.socket')[_0xdc7b('0xd')](socket);function respondWithRpcPromise(_0x316a19,_0x167e40,_0x295800){return new BPromise(function(_0xec8041,_0x44d499){return client['request'](_0x316a19,_0x295800)[_0xdc7b('0xe')](function(_0x359a53){logger[_0xdc7b('0xf')](_0xdc7b('0x10'),_0x167e40,_0xdc7b('0x11'));logger[_0xdc7b('0x12')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x167e40,_0xdc7b('0x11'),JSON[_0xdc7b('0x13')](_0x359a53));if(_0x359a53['error']){if(_0x359a53[_0xdc7b('0x14')]['code']===0x1f4){logger[_0xdc7b('0x14')](_0xdc7b('0x10'),_0x167e40,_0x359a53[_0xdc7b('0x14')][_0xdc7b('0x15')]);return _0x44d499(_0x359a53['error'][_0xdc7b('0x15')]);}logger[_0xdc7b('0x14')]('UserProfile,\x20%s,\x20%s',_0x167e40,_0x359a53[_0xdc7b('0x14')][_0xdc7b('0x15')]);return _0xec8041(_0x359a53[_0xdc7b('0x14')][_0xdc7b('0x15')]);}else{logger[_0xdc7b('0xf')](_0xdc7b('0x10'),_0x167e40,_0xdc7b('0x11'));_0xec8041(_0x359a53[_0xdc7b('0x16')]['message']);}})[_0xdc7b('0x17')](function(_0x54a99b){logger[_0xdc7b('0x14')]('UserProfile,\x20%s,\x20%s',_0x167e40,_0x54a99b);_0x44d499(_0x54a99b);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 5ce6e2c..30c79ee 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 _0x243f=['./userProfile.events','save','remove','emit','removeListener','length'];(function(_0x249764,_0xc48bc3){var _0x1f4fd9=function(_0x4b15d0){while(--_0x4b15d0){_0x249764['push'](_0x249764['shift']());}};_0x1f4fd9(++_0xc48bc3);}(_0x243f,0x114));var _0xf243=function(_0x3e3221,_0x392851){_0x3e3221=_0x3e3221-0x0;var _0x190da4=_0x243f[_0x3e3221];return _0x190da4;};'use strict';var UserProfileEvents=require(_0xf243('0x0'));var events=[_0xf243('0x1'),_0xf243('0x2'),'update'];function createListener(_0x2c5e84,_0x330e1c){return function(_0x48316d){_0x330e1c[_0xf243('0x3')](_0x2c5e84,_0x48316d);};}function removeListener(_0x304275,_0xb19824){return function(){UserProfileEvents[_0xf243('0x4')](_0x304275,_0xb19824);};}exports['register']=function(_0x1cbf5e){for(var _0x8b42d2=0x0,_0x4ed5d3=events[_0xf243('0x5')];_0x8b42d2<_0x4ed5d3;_0x8b42d2++){var _0x5d52a9=events[_0x8b42d2];var _0x5558b3=createListener('userProfile:'+_0x5d52a9,_0x1cbf5e);UserProfileEvents['on'](_0x5d52a9,_0x5558b3);}}; \ No newline at end of file +var _0x56a2=['emit','removeListener','register','length','userProfile:','./userProfile.events','save','remove'];(function(_0x26a1c1,_0x4eb2c1){var _0x4923b3=function(_0x48aa9b){while(--_0x48aa9b){_0x26a1c1['push'](_0x26a1c1['shift']());}};_0x4923b3(++_0x4eb2c1);}(_0x56a2,0x14d));var _0x256a=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0x56a2[_0xdd82b4];return _0x549bb2;};'use strict';var UserProfileEvents=require(_0x256a('0x0'));var events=[_0x256a('0x1'),_0x256a('0x2'),'update'];function createListener(_0x1a575e,_0x4c39f8){return function(_0x1736c9){_0x4c39f8[_0x256a('0x3')](_0x1a575e,_0x1736c9);};}function removeListener(_0x38a428,_0x1d5296){return function(){UserProfileEvents[_0x256a('0x4')](_0x38a428,_0x1d5296);};}exports[_0x256a('0x5')]=function(_0x5b9211){for(var _0x4b40be=0x0,_0x5507c5=events[_0x256a('0x6')];_0x4b40be<_0x5507c5;_0x4b40be++){var _0x3f85b9=events[_0x4b40be];var _0x5985a2=createListener(_0x256a('0x7')+_0x3f85b9,_0x5b9211);UserProfileEvents['on'](_0x3f85b9,_0x5985a2);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 5c65874..6a37841 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 _0x89d3=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4d72a1,_0x388d6e){var _0x1dbe63=function(_0x410b24){while(--_0x410b24){_0x4d72a1['push'](_0x4d72a1['shift']());}};_0x1dbe63(++_0x388d6e);}(_0x89d3,0x13f));var _0x389d=function(_0x2b9d5c,_0x173518){_0x2b9d5c=_0x2b9d5c-0x0;var _0x37bb93=_0x89d3[_0x2b9d5c];return _0x37bb93;};'use strict';var multer=require(_0x389d('0x0'));var util=require(_0x389d('0x1'));var path=require(_0x389d('0x2'));var timeout=require(_0x389d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x389d('0x4'));var interaction=require(_0x389d('0x5'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0x389d('0x6')]('/',auth[_0x389d('0x7')](),controller[_0x389d('0x8')]);router['get'](_0x389d('0x9'),auth[_0x389d('0x7')](),controller[_0x389d('0xa')]);router['get'](_0x389d('0xb'),auth[_0x389d('0x7')](),controller[_0x389d('0xc')]);router[_0x389d('0xd')]('/',auth[_0x389d('0x7')](),controller['create']);router['put']('/:id',auth[_0x389d('0x7')](),controller[_0x389d('0xe')]);router['delete'](_0x389d('0xb'),auth[_0x389d('0x7')](),controller[_0x389d('0xf')]);module[_0x389d('0x10')]=router; \ No newline at end of file +var _0xb894=['../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0xb894,0x8b));var _0x4b89=function(_0x4aaebf,_0x44b5b4){_0x4aaebf=_0x4aaebf-0x0;var _0x4c42ae=_0xb894[_0x4aaebf];return _0x4c42ae;};'use strict';var multer=require(_0x4b89('0x0'));var util=require(_0x4b89('0x1'));var path=require(_0x4b89('0x2'));var timeout=require(_0x4b89('0x3'));var express=require(_0x4b89('0x4'));var router=express[_0x4b89('0x5')]();var fs_extra=require(_0x4b89('0x6'));var auth=require(_0x4b89('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4b89('0x8'));var controller=require(_0x4b89('0x9'));router[_0x4b89('0xa')]('/',auth['isAuthenticated'](),controller[_0x4b89('0xb')]);router['get'](_0x4b89('0xc'),auth[_0x4b89('0xd')](),controller[_0x4b89('0xe')]);router[_0x4b89('0xa')](_0x4b89('0xf'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x4b89('0xd')](),controller[_0x4b89('0x10')]);router['put'](_0x4b89('0xf'),auth[_0x4b89('0xd')](),controller[_0x4b89('0x11')]);router[_0x4b89('0x12')](_0x4b89('0xf'),auth[_0x4b89('0xd')](),controller[_0x4b89('0x13')]);module[_0x4b89('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 936cfbd..0e1fa0b 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 _0x8ee6=['INTEGER','sequelize','exports','STRING'];(function(_0x42d15,_0x4835a8){var _0xbb558f=function(_0x47b6a3){while(--_0x47b6a3){_0x42d15['push'](_0x42d15['shift']());}};_0xbb558f(++_0x4835a8);}(_0x8ee6,0xe9));var _0x68ee=function(_0x3582ce,_0x118d8b){_0x3582ce=_0x3582ce-0x0;var _0x31bc42=_0x8ee6[_0x3582ce];return _0x31bc42;};'use strict';var Sequelize=require(_0x68ee('0x0'));module[_0x68ee('0x1')]={'name':{'type':Sequelize[_0x68ee('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x68ee('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x68ee('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x4ac5=['STRING','INTEGER','sequelize','exports'];(function(_0x1d7cbd,_0x1811b3){var _0x134586=function(_0x3ffd93){while(--_0x3ffd93){_0x1d7cbd['push'](_0x1d7cbd['shift']());}};_0x134586(++_0x1811b3);}(_0x4ac5,0x112));var _0x54ac=function(_0x2f1a6e,_0x3082cb){_0x2f1a6e=_0x2f1a6e-0x0;var _0x5865e5=_0x4ac5[_0x2f1a6e];return _0x5865e5;};'use strict';var Sequelize=require(_0x54ac('0x0'));module[_0x54ac('0x1')]={'name':{'type':Sequelize[_0x54ac('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x54ac('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x54ac('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 34b99ac..84eb10a 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 _0x5496=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x19b9c1,_0x16ae0a){var _0x45b8f2=function(_0x39a56f){while(--_0x39a56f){_0x19b9c1['push'](_0x19b9c1['shift']());}};_0x45b8f2(++_0x16ae0a);}(_0x5496,0x175));var _0x6549=function(_0x45cd48,_0x9c3392){_0x45cd48=_0x45cd48-0x0;var _0x13c8d3=_0x5496[_0x45cd48];return _0x13c8d3;};'use strict';var emlformat=require(_0x6549('0x0'));var rimraf=require(_0x6549('0x1'));var zipdir=require(_0x6549('0x2'));var jsonpatch=require(_0x6549('0x3'));var rp=require(_0x6549('0x4'));var moment=require('moment');var BPromise=require(_0x6549('0x5'));var Mustache=require('mustache');var util=require(_0x6549('0x6'));var path=require(_0x6549('0x7'));var sox=require(_0x6549('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6549('0x9'));var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var licenseUtil=require(_0x6549('0x17'));var db=require(_0x6549('0x18'))['db'];function respondWithStatusCode(_0x5bc018,_0x4dfb06){_0x4dfb06=_0x4dfb06||0xcc;return function(_0x3f844f){if(_0x3f844f){return _0x5bc018[_0x6549('0x19')](_0x4dfb06);}return _0x5bc018['status'](_0x4dfb06)[_0x6549('0x1a')]();};}function respondWithResult(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xc8;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25)[_0x6549('0x1c')](_0x12b068);}};}function respondWithFilteredResult(_0x55c112,_0x5db86d){return function(_0x384f75){if(_0x384f75){var _0x25da29=typeof _0x5db86d['offset']===_0x6549('0x1d')&&typeof _0x5db86d[_0x6549('0x1e')]===_0x6549('0x1d');var _0x387e60=_0x384f75[_0x6549('0x1f')];var _0x53b12b=_0x25da29?0x0:_0x5db86d['offset'];var _0x26a212=_0x25da29?_0x384f75['count']:_0x5db86d['offset']+_0x5db86d[_0x6549('0x1e')];var _0x1e5079;if(_0x26a212>=_0x387e60){_0x26a212=_0x387e60;_0x1e5079=0xc8;}else{_0x1e5079=0xce;}_0x55c112[_0x6549('0x1b')](_0x1e5079);return _0x55c112[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x26a212+'/'+_0x387e60)['json'](_0x384f75);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1b')](_0xfb51a1)['send'](_0x14de1f);};}exports[_0x6549('0x2a')]=function(_0x136518,_0x17fdfb){var _0x4c605c={},_0x3f1502={},_0x4acaf5={'count':0x0,'rows':[]};var _0x4f0ad1=_['map'](db[_0x6549('0x2b')][_0x6549('0x2c')],function(_0x4f3069){return{'name':_0x4f3069[_0x6549('0x2d')],'type':_0x4f3069[_0x6549('0x2e')][_0x6549('0x2f')]};});_0x3f1502[_0x6549('0x30')]=_[_0x6549('0x31')](_0x4f0ad1,_0x6549('0x29'));_0x3f1502[_0x6549('0x32')]=_['keys'](_0x136518[_0x6549('0x32')]);_0x3f1502[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3f1502[_0x6549('0x30')],_0x3f1502[_0x6549('0x32')]);_0x4c605c[_0x6549('0x35')]=_['intersection'](_0x3f1502[_0x6549('0x30')],qs['fields'](_0x136518[_0x6549('0x32')]['fields']));_0x4c605c[_0x6549('0x35')]=_0x4c605c[_0x6549('0x35')][_0x6549('0x36')]?_0x4c605c['attributes']:_0x3f1502[_0x6549('0x30')];if(!_0x136518[_0x6549('0x32')][_0x6549('0x37')](_0x6549('0x38'))){_0x4c605c['limit']=qs['limit'](_0x136518['query'][_0x6549('0x1e')]);_0x4c605c[_0x6549('0x39')]=qs['offset'](_0x136518[_0x6549('0x32')][_0x6549('0x39')]);}_0x4c605c[_0x6549('0x3a')]=qs[_0x6549('0x3b')](_0x136518[_0x6549('0x32')]['sort']);_0x4c605c['where']=qs[_0x6549('0x33')](_[_0x6549('0x3c')](_0x136518[_0x6549('0x32')],_0x3f1502[_0x6549('0x33')]),_0x4f0ad1);if(_0x136518[_0x6549('0x32')][_0x6549('0x3d')]){_0x4c605c[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x4c605c[_0x6549('0x3e')],{'$or':_[_0x6549('0x31')](_0x4f0ad1,function(_0x525f82){if(_0x525f82[_0x6549('0x2e')]!==_0x6549('0x40')){var _0x2ea977={};_0x2ea977[_0x525f82[_0x6549('0x29')]]={'$like':'%'+_0x136518[_0x6549('0x32')]['filter']+'%'};return _0x2ea977;}})});}_0x4c605c=_['merge']({},_0x4c605c,_0x136518['options']);var _0x22b919={'where':_0x4c605c[_0x6549('0x3e')]};return db[_0x6549('0x2b')][_0x6549('0x1f')](_0x22b919)['then'](function(_0x56ce9f){_0x4acaf5[_0x6549('0x1f')]=_0x56ce9f;if(_0x136518[_0x6549('0x32')][_0x6549('0x41')]){_0x4c605c['include']=[{'all':!![]}];}return db[_0x6549('0x2b')]['findAll'](_0x4c605c);})[_0x6549('0x26')](function(_0x2ec614){_0x4acaf5[_0x6549('0x42')]=_0x2ec614;return _0x4acaf5;})[_0x6549('0x26')](respondWithFilteredResult(_0x17fdfb,_0x4c605c))[_0x6549('0x43')](handleError(_0x17fdfb,null));};exports[_0x6549('0x44')]=function(_0xbbfdc9,_0x4deaab){var _0x132625={'raw':![],'where':{'id':_0xbbfdc9[_0x6549('0x45')]['id']}},_0x309f45={};_0x309f45[_0x6549('0x30')]=_[_0x6549('0x46')](db[_0x6549('0x2b')][_0x6549('0x2c')]);_0x309f45[_0x6549('0x32')]=_[_0x6549('0x46')](_0xbbfdc9[_0x6549('0x32')]);_0x309f45[_0x6549('0x33')]=_[_0x6549('0x34')](_0x309f45[_0x6549('0x30')],_0x309f45[_0x6549('0x32')]);_0x132625[_0x6549('0x35')]=_[_0x6549('0x34')](_0x309f45['model'],qs[_0x6549('0x47')](_0xbbfdc9[_0x6549('0x32')][_0x6549('0x47')]));_0x132625[_0x6549('0x35')]=_0x132625['attributes'][_0x6549('0x36')]?_0x132625['attributes']:_0x309f45[_0x6549('0x30')];if(_0xbbfdc9[_0x6549('0x32')]['includeAll']){_0x132625[_0x6549('0x48')]=[{'all':!![]}];}_0x132625=_[_0x6549('0x3f')]({},_0x132625,_0xbbfdc9[_0x6549('0x49')]);return db[_0x6549('0x2b')][_0x6549('0x4a')](_0x132625)['then'](handleEntityNotFound(_0x4deaab,null))['then'](respondWithResult(_0x4deaab,null))[_0x6549('0x43')](handleError(_0x4deaab,null));};exports[_0x6549('0x4b')]=function(_0x41d675,_0x1712f3){return db[_0x6549('0x2b')]['create'](_0x41d675[_0x6549('0x4c')],{})[_0x6549('0x26')](respondWithResult(_0x1712f3,0xc9))[_0x6549('0x43')](handleError(_0x1712f3,null));};exports[_0x6549('0x25')]=function(_0xa4c650,_0x25a6ee){if(_0xa4c650[_0x6549('0x4c')]['id']){delete _0xa4c650[_0x6549('0x4c')]['id'];}return db['UserProfileResource'][_0x6549('0x4a')]({'where':{'id':_0xa4c650['params']['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x25a6ee,null))[_0x6549('0x26')](saveUpdates(_0xa4c650[_0x6549('0x4c')],null))['then'](respondWithResult(_0x25a6ee,null))[_0x6549('0x43')](handleError(_0x25a6ee,null));};exports[_0x6549('0x4d')]=function(_0x2ef4d2,_0x5300c8){return db[_0x6549('0x2b')][_0x6549('0x4a')]({'where':{'id':_0x2ef4d2[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x5300c8,null))[_0x6549('0x26')](removeEntity(_0x5300c8,null))[_0x6549('0x43')](handleError(_0x5300c8,null));};exports['describe']=function(_0x28af00,_0x4bbc61){return db[_0x6549('0x2b')][_0x6549('0x4e')]()[_0x6549('0x26')](respondWithResult(_0x4bbc61,null))[_0x6549('0x43')](handleError(_0x4bbc61,null));}; \ No newline at end of file +var _0x187d=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','UserProfileResource','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','create','body','describe','eml-format'];(function(_0x953733,_0x5f38e8){var _0x5c6231=function(_0xe47e1c){while(--_0xe47e1c){_0x953733['push'](_0x953733['shift']());}};_0x5c6231(++_0x5f38e8);}(_0x187d,0x93));var _0xd187=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x187d[_0x3c4737];return _0x2bb926;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')](_0x3ce4a1[_0xd187('0x48')],{})['then'](respondWithResult(_0x3f5def,0xc9))[_0xd187('0x41')](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x4523c8,_0x1449d7){if(_0x4523c8[_0xd187('0x48')]['id']){delete _0x4523c8['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x4523c8['params']['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x1449d7,null))[_0xd187('0x3f')](saveUpdates(_0x4523c8['body'],null))['then'](respondWithResult(_0x1449d7,null))['catch'](handleError(_0x1449d7,null));};exports['destroy']=function(_0x473bef,_0x22f432){return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x473bef[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x22f432,null))[_0xd187('0x3f')](removeEntity(_0x22f432,null))['catch'](handleError(_0x22f432,null));};exports[_0xd187('0x49')]=function(_0x3aaeaa,_0x1b12c4){return db[_0xd187('0x2d')]['describe']()[_0xd187('0x3f')](respondWithResult(_0x1b12c4,null))['catch'](handleError(_0x1b12c4,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 16a92d8..d4ddad4 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 _0xfb2a=['resourceId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','compositeIndex'];(function(_0x1699e9,_0x1f2652){var _0x14b104=function(_0x319079){while(--_0x319079){_0x1699e9['push'](_0x1699e9['shift']());}};_0x14b104(++_0x1f2652);}(_0xfb2a,0x1a1));var _0xafb2=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xfb2a[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xafb2('0x0'));var util=require(_0xafb2('0x1'));var logger=require(_0xafb2('0x2'))(_0xafb2('0x3'));var moment=require(_0xafb2('0x4'));var BPromise=require(_0xafb2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xafb2('0x6'));var rimraf=require(_0xafb2('0x7'));var config=require(_0xafb2('0x8'));var attributes=require(_0xafb2('0x9'));module[_0xafb2('0xa')]=function(_0x3943ed,_0x2b833f){return _0x3943ed['define']('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xafb2('0xb'),'fields':[_0xafb2('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x40ae=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userProfileResource.attributes','exports','compositeIndex','resourceId','sectionId','lodash'];(function(_0x20b631,_0x1d27ac){var _0x33cfb4=function(_0x42327b){while(--_0x42327b){_0x20b631['push'](_0x20b631['shift']());}};_0x33cfb4(++_0x1d27ac);}(_0x40ae,0x110));var _0xe40a=function(_0x317ff0,_0x3ba246){_0x317ff0=_0x317ff0-0x0;var _0x1af765=_0x40ae[_0x317ff0];return _0x1af765;};'use strict';var _=require(_0xe40a('0x0'));var util=require('util');var logger=require(_0xe40a('0x1'))(_0xe40a('0x2'));var moment=require(_0xe40a('0x3'));var BPromise=require(_0xe40a('0x4'));var rp=require(_0xe40a('0x5'));var fs=require('fs');var path=require(_0xe40a('0x6'));var rimraf=require(_0xe40a('0x7'));var config=require('../../config/environment');var attributes=require(_0xe40a('0x8'));module[_0xe40a('0x9')]=function(_0x3d210f,_0x56df7b){return _0x3d210f['define']('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xe40a('0xa'),'fields':[_0xe40a('0xb'),_0xe40a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 65906f1..f90cb9d 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 _0x6581=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x6581,0x155));var _0x1658=function(_0x22095d,_0x235455){_0x22095d=_0x22095d-0x0;var _0x4c3ff5=_0x6581[_0x22095d];return _0x4c3ff5;};'use strict';var _=require('lodash');var util=require(_0x1658('0x0'));var moment=require(_0x1658('0x1'));var BPromise=require(_0x1658('0x2'));var rs=require(_0x1658('0x3'));var fs=require('fs');var Redis=require(_0x1658('0x4'));var db=require(_0x1658('0x5'))['db'];var utils=require(_0x1658('0x6'));var logger=require('../../config/logger')(_0x1658('0x7'));var config=require(_0x1658('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1658('0x9')][_0x1658('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a6f1,_0x1761e2,_0x420e19){return new BPromise(function(_0x3b8ef3,_0x1403bf){return client[_0x1658('0xb')](_0x35a6f1,_0x420e19)[_0x1658('0xc')](function(_0x4440bf){logger[_0x1658('0xd')](_0x1658('0xe'),_0x1761e2,_0x1658('0xf'));logger[_0x1658('0x10')](_0x1658('0x11'),_0x1761e2,_0x1658('0xf'),JSON[_0x1658('0x12')](_0x4440bf));if(_0x4440bf[_0x1658('0x13')]){if(_0x4440bf[_0x1658('0x13')]['code']===0x1f4){logger['error'](_0x1658('0xe'),_0x1761e2,_0x4440bf[_0x1658('0x13')][_0x1658('0x14')]);return _0x1403bf(_0x4440bf[_0x1658('0x13')][_0x1658('0x14')]);}logger[_0x1658('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x1761e2,_0x4440bf[_0x1658('0x13')]['message']);return _0x3b8ef3(_0x4440bf[_0x1658('0x13')][_0x1658('0x14')]);}else{logger[_0x1658('0xd')](_0x1658('0xe'),_0x1761e2,_0x1658('0xf'));_0x3b8ef3(_0x4440bf[_0x1658('0x15')][_0x1658('0x14')]);}})[_0x1658('0x16')](function(_0x3e5f5f){logger['error'](_0x1658('0xe'),_0x1761e2,_0x3e5f5f);_0x1403bf(_0x3e5f5f);});});} \ No newline at end of file +var _0xcac6=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','message','UserProfileResource,\x20%s,\x20%s','result','catch'];(function(_0x2c40ea,_0x22f0e3){var _0x516e39=function(_0x2a0c3e){while(--_0x2a0c3e){_0x2c40ea['push'](_0x2c40ea['shift']());}};_0x516e39(++_0x22f0e3);}(_0xcac6,0xd2));var _0x6cac=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcac6[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6cac('0x0'));var util=require('util');var moment=require(_0x6cac('0x1'));var BPromise=require(_0x6cac('0x2'));var rs=require(_0x6cac('0x3'));var fs=require('fs');var Redis=require(_0x6cac('0x4'));var db=require(_0x6cac('0x5'))['db'];var utils=require(_0x6cac('0x6'));var logger=require('../../config/logger')(_0x6cac('0x7'));var config=require('../../config/environment');var jayson=require(_0x6cac('0x8'));var client=jayson[_0x6cac('0x9')][_0x6cac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bdacd,_0x4d9e30,_0x8d459b){return new BPromise(function(_0x133052,_0x2970e2){return client['request'](_0x3bdacd,_0x8d459b)[_0x6cac('0xb')](function(_0x17a562){logger[_0x6cac('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x4d9e30,_0x6cac('0xd'));logger[_0x6cac('0xe')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x4d9e30,_0x6cac('0xd'),JSON[_0x6cac('0xf')](_0x17a562));if(_0x17a562[_0x6cac('0x10')]){if(_0x17a562[_0x6cac('0x10')]['code']===0x1f4){logger[_0x6cac('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x4d9e30,_0x17a562[_0x6cac('0x10')][_0x6cac('0x11')]);return _0x2970e2(_0x17a562[_0x6cac('0x10')][_0x6cac('0x11')]);}logger[_0x6cac('0x10')](_0x6cac('0x12'),_0x4d9e30,_0x17a562[_0x6cac('0x10')][_0x6cac('0x11')]);return _0x133052(_0x17a562[_0x6cac('0x10')][_0x6cac('0x11')]);}else{logger[_0x6cac('0xc')](_0x6cac('0x12'),_0x4d9e30,_0x6cac('0xd'));_0x133052(_0x17a562[_0x6cac('0x13')][_0x6cac('0x11')]);}})[_0x6cac('0x14')](function(_0xe0913d){logger[_0x6cac('0x10')](_0x6cac('0x12'),_0x4d9e30,_0xe0913d);_0x2970e2(_0xe0913d);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index ec58f6b..23c34ff 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 _0xe6ee=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy'];(function(_0x2f7571,_0x352fab){var _0x45245d=function(_0x377ec8){while(--_0x377ec8){_0x2f7571['push'](_0x2f7571['shift']());}};_0x45245d(++_0x352fab);}(_0xe6ee,0x190));var _0xee6e=function(_0x13facf,_0x12edf4){_0x13facf=_0x13facf-0x0;var _0x1ae876=_0xe6ee[_0x13facf];return _0x1ae876;};'use strict';var multer=require(_0xee6e('0x0'));var util=require('util');var path=require(_0xee6e('0x1'));var timeout=require(_0xee6e('0x2'));var express=require(_0xee6e('0x3'));var router=express[_0xee6e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xee6e('0x5'));var interaction=require(_0xee6e('0x6'));var config=require(_0xee6e('0x7'));var controller=require(_0xee6e('0x8'));router[_0xee6e('0x9')]('/',auth['isAuthenticated'](),controller[_0xee6e('0xa')]);router[_0xee6e('0x9')]('/describe',auth[_0xee6e('0xb')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xee6e('0xc')]);router[_0xee6e('0xd')]('/',auth[_0xee6e('0xb')](),controller[_0xee6e('0xe')]);router[_0xee6e('0xf')](_0xee6e('0x10'),auth['isAuthenticated'](),controller[_0xee6e('0x11')]);router[_0xee6e('0x12')](_0xee6e('0x10'),auth[_0xee6e('0xb')](),controller[_0xee6e('0x13')]);module[_0xee6e('0x14')]=router; \ No newline at end of file +var _0x9250=['../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x580977,_0x4d55b1){var _0x54a30c=function(_0x54d59c){while(--_0x54d59c){_0x580977['push'](_0x580977['shift']());}};_0x54a30c(++_0x4d55b1);}(_0x9250,0x13a));var _0x0925=function(_0x115bae,_0x1c82d2){_0x115bae=_0x115bae-0x0;var _0x1fd22f=_0x9250[_0x115bae];return _0x1fd22f;};'use strict';var multer=require(_0x0925('0x0'));var util=require('util');var path=require(_0x0925('0x1'));var timeout=require(_0x0925('0x2'));var express=require('express');var router=express[_0x0925('0x3')]();var fs_extra=require(_0x0925('0x4'));var auth=require(_0x0925('0x5'));var interaction=require(_0x0925('0x6'));var config=require(_0x0925('0x7'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x0925('0x8')](),controller['index']);router[_0x0925('0x9')](_0x0925('0xa'),auth[_0x0925('0x8')](),controller[_0x0925('0xb')]);router[_0x0925('0x9')](_0x0925('0xc'),auth[_0x0925('0x8')](),controller[_0x0925('0xd')]);router[_0x0925('0xe')]('/',auth[_0x0925('0x8')](),controller['create']);router[_0x0925('0xf')](_0x0925('0xc'),auth[_0x0925('0x8')](),controller[_0x0925('0x10')]);router[_0x0925('0x11')](_0x0925('0xc'),auth[_0x0925('0x8')](),controller[_0x0925('0x12')]);module[_0x0925('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 233bf72..1ecbdab 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 _0x8f59=['INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','sequelize','exports','STRING'];(function(_0x548e95,_0x1d1247){var _0x1c687b=function(_0x4df838){while(--_0x4df838){_0x548e95['push'](_0x548e95['shift']());}};_0x1c687b(++_0x1d1247);}(_0x8f59,0x11d));var _0x98f5=function(_0x394c2e,_0x436edd){_0x394c2e=_0x394c2e-0x0;var _0x2907aa=_0x8f59[_0x394c2e];return _0x2907aa;};'use strict';var Sequelize=require(_0x98f5('0x0'));module[_0x98f5('0x1')]={'name':{'type':Sequelize[_0x98f5('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x98f5('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x98f5('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x98f5('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x98f5('0x2')],'set':function(_0x320235){this[_0x98f5('0x5')](_0x98f5('0x6'),_0x320235?_0x320235['join'](''):[]);},'get':function(){return this[_0x98f5('0x7')](_0x98f5('0x6'))?this[_0x98f5('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file +var _0x13f6=['INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','sequelize','exports'];(function(_0x52b794,_0x6bb727){var _0x52ed0d=function(_0xbb591e){while(--_0xbb591e){_0x52b794['push'](_0x52b794['shift']());}};_0x52ed0d(++_0x6bb727);}(_0x13f6,0x124));var _0x613f=function(_0x22cfcb,_0x1219cb){_0x22cfcb=_0x22cfcb-0x0;var _0x22fd48=_0x13f6[_0x22cfcb];return _0x22fd48;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x613f('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x613f('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x613f('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x179f6e){this[_0x613f('0x4')](_0x613f('0x5'),_0x179f6e?_0x179f6e['join'](''):[]);},'get':function(){return this[_0x613f('0x6')](_0x613f('0x5'))?this['getDataValue']('crudPermissions')['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index d33b656..ea50407 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 _0xc4ce=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','then','error','stack','name','send','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3199af,_0x339560){var _0x5aa4d0=function(_0x1cb5f0){while(--_0x1cb5f0){_0x3199af['push'](_0x3199af['shift']());}};_0x5aa4d0(++_0x339560);}(_0xc4ce,0xca));var _0xec4c=function(_0x5d4d47,_0x182a7d){_0x5d4d47=_0x5d4d47-0x0;var _0x1f8bdb=_0xc4ce[_0x5d4d47];return _0x1f8bdb;};'use strict';var emlformat=require(_0xec4c('0x0'));var rimraf=require(_0xec4c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xec4c('0x2'));var moment=require('moment');var BPromise=require(_0xec4c('0x3'));var Mustache=require(_0xec4c('0x4'));var util=require('util');var path=require(_0xec4c('0x5'));var sox=require(_0xec4c('0x6'));var csv=require(_0xec4c('0x7'));var ejs=require(_0xec4c('0x8'));var fs=require('fs');var fs_extra=require(_0xec4c('0x9'));var _=require(_0xec4c('0xa'));var squel=require(_0xec4c('0xb'));var crypto=require(_0xec4c('0xc'));var jsforce=require(_0xec4c('0xd'));var deskjs=require(_0xec4c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xec4c('0xf'));var Papa=require('papaparse');var Redis=require(_0xec4c('0x10'));var authService=require(_0xec4c('0x11'));var qs=require(_0xec4c('0x12'));var as=require(_0xec4c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec4c('0x14'))(_0xec4c('0x15'));var utils=require('../../config/utils');var config=require(_0xec4c('0x16'));var licenseUtil=require(_0xec4c('0x17'));var db=require(_0xec4c('0x18'))['db'];function respondWithStatusCode(_0x5f59ba,_0x5de11f){_0x5de11f=_0x5de11f||0xcc;return function(_0x364dba){if(_0x364dba){return _0x5f59ba[_0xec4c('0x19')](_0x5de11f);}return _0x5f59ba['status'](_0x5de11f)[_0xec4c('0x1a')]();};}function respondWithResult(_0x32b12a,_0x42d791){_0x42d791=_0x42d791||0xc8;return function(_0x5ecf49){if(_0x5ecf49){return _0x32b12a[_0xec4c('0x1b')](_0x42d791)['json'](_0x5ecf49);}};}function respondWithFilteredResult(_0x2c4aad,_0x2e5594){return function(_0xb9d11b){if(_0xb9d11b){var _0x3b36ad=typeof _0x2e5594[_0xec4c('0x1c')]===_0xec4c('0x1d')&&typeof _0x2e5594[_0xec4c('0x1e')]===_0xec4c('0x1d');var _0x2a2216=_0xb9d11b[_0xec4c('0x1f')];var _0x51f5a3=_0x3b36ad?0x0:_0x2e5594['offset'];var _0x1ef5b9=_0x3b36ad?_0xb9d11b[_0xec4c('0x1f')]:_0x2e5594[_0xec4c('0x1c')]+_0x2e5594[_0xec4c('0x1e')];var _0x25d21a;if(_0x1ef5b9>=_0x2a2216){_0x1ef5b9=_0x2a2216;_0x25d21a=0xc8;}else{_0x25d21a=0xce;}_0x2c4aad[_0xec4c('0x1b')](_0x25d21a);return _0x2c4aad[_0xec4c('0x20')](_0xec4c('0x21'),_0x51f5a3+'-'+_0x1ef5b9+'/'+_0x2a2216)[_0xec4c('0x22')](_0xb9d11b);}return null;};}function patchUpdates(_0x3268f6){return function(_0x1cd535){try{jsonpatch['apply'](_0x1cd535,_0x3268f6,!![]);}catch(_0x1f085c){return BPromise[_0xec4c('0x23')](_0x1f085c);}return _0x1cd535[_0xec4c('0x24')]();};}function saveUpdates(_0x4e025b,_0x243723){return function(_0x40bf6e){if(_0x40bf6e){return _0x40bf6e['update'](_0x4e025b)['then'](function(_0x14cc9b){return _0x14cc9b;});}return null;};}function removeEntity(_0x246cde,_0x5b94c2){return function(_0x18db11){if(_0x18db11){return _0x18db11[_0xec4c('0x25')]()[_0xec4c('0x26')](function(){_0x246cde[_0xec4c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x406d60,_0x1f23cc){return function(_0x38fb01){if(!_0x38fb01){_0x406d60[_0xec4c('0x19')](0x194);}return _0x38fb01;};}function handleError(_0x4e2d9a,_0x357f59){_0x357f59=_0x357f59||0x1f4;return function(_0x5c45ba){logger[_0xec4c('0x27')](_0x5c45ba[_0xec4c('0x28')]);if(_0x5c45ba['name']){delete _0x5c45ba[_0xec4c('0x29')];}_0x4e2d9a['status'](_0x357f59)[_0xec4c('0x2a')](_0x5c45ba);};}exports['index']=function(_0x29a882,_0x3c84e2){var _0x213ed8={},_0x5f5a68={},_0x30546c={'count':0x0,'rows':[]};var _0x1ff60c=_[_0xec4c('0x2b')](db[_0xec4c('0x2c')][_0xec4c('0x2d')],function(_0x41d90d){return{'name':_0x41d90d[_0xec4c('0x2e')],'type':_0x41d90d[_0xec4c('0x2f')][_0xec4c('0x30')]};});_0x5f5a68[_0xec4c('0x31')]=_[_0xec4c('0x2b')](_0x1ff60c,'name');_0x5f5a68[_0xec4c('0x32')]=_[_0xec4c('0x33')](_0x29a882[_0xec4c('0x32')]);_0x5f5a68[_0xec4c('0x34')]=_['intersection'](_0x5f5a68[_0xec4c('0x31')],_0x5f5a68[_0xec4c('0x32')]);_0x213ed8['attributes']=_['intersection'](_0x5f5a68[_0xec4c('0x31')],qs[_0xec4c('0x35')](_0x29a882[_0xec4c('0x32')][_0xec4c('0x35')]));_0x213ed8[_0xec4c('0x36')]=_0x213ed8[_0xec4c('0x36')][_0xec4c('0x37')]?_0x213ed8['attributes']:_0x5f5a68['model'];if(!_0x29a882[_0xec4c('0x32')]['hasOwnProperty'](_0xec4c('0x38'))){_0x213ed8[_0xec4c('0x1e')]=qs[_0xec4c('0x1e')](_0x29a882[_0xec4c('0x32')][_0xec4c('0x1e')]);_0x213ed8[_0xec4c('0x1c')]=qs[_0xec4c('0x1c')](_0x29a882[_0xec4c('0x32')]['offset']);}_0x213ed8[_0xec4c('0x39')]=qs[_0xec4c('0x3a')](_0x29a882[_0xec4c('0x32')][_0xec4c('0x3a')]);_0x213ed8['where']=qs[_0xec4c('0x34')](_['pick'](_0x29a882[_0xec4c('0x32')],_0x5f5a68['filters']),_0x1ff60c);if(_0x29a882[_0xec4c('0x32')][_0xec4c('0x3b')]){_0x213ed8[_0xec4c('0x3c')]=_[_0xec4c('0x3d')](_0x213ed8[_0xec4c('0x3c')],{'$or':_[_0xec4c('0x2b')](_0x1ff60c,function(_0x1742e8){if(_0x1742e8[_0xec4c('0x2f')]!=='VIRTUAL'){var _0x3c5c68={};_0x3c5c68[_0x1742e8['name']]={'$like':'%'+_0x29a882[_0xec4c('0x32')][_0xec4c('0x3b')]+'%'};return _0x3c5c68;}})});}_0x213ed8=_[_0xec4c('0x3d')]({},_0x213ed8,_0x29a882[_0xec4c('0x3e')]);var _0x1fbac0={'where':_0x213ed8[_0xec4c('0x3c')]};return db['UserProfileSection']['count'](_0x1fbac0)['then'](function(_0x235735){_0x30546c[_0xec4c('0x1f')]=_0x235735;if(_0x29a882[_0xec4c('0x32')][_0xec4c('0x3f')]){_0x213ed8[_0xec4c('0x40')]=[{'all':!![]}];}return db[_0xec4c('0x2c')][_0xec4c('0x41')](_0x213ed8);})[_0xec4c('0x26')](function(_0x1c79ef){_0x30546c[_0xec4c('0x42')]=_0x1c79ef;return _0x30546c;})[_0xec4c('0x26')](respondWithFilteredResult(_0x3c84e2,_0x213ed8))[_0xec4c('0x43')](handleError(_0x3c84e2,null));};exports['show']=function(_0x564433,_0x5ea820){var _0x1cc44e={'raw':![],'where':{'id':_0x564433[_0xec4c('0x44')]['id']}},_0x996d18={};_0x996d18[_0xec4c('0x31')]=_[_0xec4c('0x33')](db[_0xec4c('0x2c')]['rawAttributes']);_0x996d18[_0xec4c('0x32')]=_['keys'](_0x564433[_0xec4c('0x32')]);_0x996d18[_0xec4c('0x34')]=_[_0xec4c('0x45')](_0x996d18[_0xec4c('0x31')],_0x996d18['query']);_0x1cc44e['attributes']=_[_0xec4c('0x45')](_0x996d18[_0xec4c('0x31')],qs['fields'](_0x564433[_0xec4c('0x32')][_0xec4c('0x35')]));_0x1cc44e['attributes']=_0x1cc44e[_0xec4c('0x36')][_0xec4c('0x37')]?_0x1cc44e[_0xec4c('0x36')]:_0x996d18[_0xec4c('0x31')];if(_0x564433['query'][_0xec4c('0x3f')]){_0x1cc44e[_0xec4c('0x40')]=[{'all':!![]}];}_0x1cc44e=_['merge']({},_0x1cc44e,_0x564433['options']);return db[_0xec4c('0x2c')][_0xec4c('0x46')](_0x1cc44e)[_0xec4c('0x26')](handleEntityNotFound(_0x5ea820,null))['then'](respondWithResult(_0x5ea820,null))[_0xec4c('0x43')](handleError(_0x5ea820,null));};exports[_0xec4c('0x47')]=function(_0x4a0e6f,_0x4a8f68){return db[_0xec4c('0x2c')]['create'](_0x4a0e6f[_0xec4c('0x48')],{})[_0xec4c('0x26')](respondWithResult(_0x4a8f68,0xc9))[_0xec4c('0x43')](handleError(_0x4a8f68,null));};exports['update']=function(_0x1019f9,_0xea439a){if(_0x1019f9['body']['id']){delete _0x1019f9[_0xec4c('0x48')]['id'];}return db[_0xec4c('0x2c')][_0xec4c('0x46')]({'where':{'id':_0x1019f9['params']['id']}})[_0xec4c('0x26')](handleEntityNotFound(_0xea439a,null))[_0xec4c('0x26')](saveUpdates(_0x1019f9['body'],null))['then'](respondWithResult(_0xea439a,null))[_0xec4c('0x43')](handleError(_0xea439a,null));};exports[_0xec4c('0x25')]=function(_0x3a0d95,_0x3d87d6){return db['UserProfileSection']['find']({'where':{'id':_0x3a0d95['params']['id']}})[_0xec4c('0x26')](handleEntityNotFound(_0x3d87d6,null))[_0xec4c('0x26')](removeEntity(_0x3d87d6,null))[_0xec4c('0x43')](handleError(_0x3d87d6,null));};exports[_0xec4c('0x49')]=function(_0x14b61b,_0x38009c){return db[_0xec4c('0x2c')][_0xec4c('0x49')]()['then'](respondWithResult(_0x38009c,null))['catch'](handleError(_0x38009c,null));}; \ No newline at end of file +var _0x3585=['map','UserProfileSection','fieldName','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','set','apply','reject','save','update','then','stack','name','send','index'];(function(_0x44defb,_0x42256e){var _0x146a99=function(_0x1d8021){while(--_0x1d8021){_0x44defb['push'](_0x44defb['shift']());}};_0x146a99(++_0x42256e);}(_0x3585,0x6f));var _0x5358=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3585[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5358('0x0'));var zipdir=require(_0x5358('0x1'));var jsonpatch=require(_0x5358('0x2'));var rp=require(_0x5358('0x3'));var moment=require(_0x5358('0x4'));var BPromise=require(_0x5358('0x5'));var Mustache=require(_0x5358('0x6'));var util=require(_0x5358('0x7'));var path=require(_0x5358('0x8'));var sox=require('sox');var csv=require(_0x5358('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5358('0xa'));var _=require(_0x5358('0xb'));var squel=require(_0x5358('0xc'));var crypto=require(_0x5358('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5358('0x9'));var querystring=require('querystring');var Papa=require(_0x5358('0xe'));var Redis=require('ioredis');var authService=require(_0x5358('0xf'));var qs=require(_0x5358('0x10'));var as=require(_0x5358('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5358('0x12'))(_0x5358('0x13'));var utils=require(_0x5358('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5358('0x15'));var db=require(_0x5358('0x16'))['db'];function respondWithStatusCode(_0x2148e3,_0x1e9384){_0x1e9384=_0x1e9384||0xcc;return function(_0x4bd8e8){if(_0x4bd8e8){return _0x2148e3[_0x5358('0x17')](_0x1e9384);}return _0x2148e3[_0x5358('0x18')](_0x1e9384)[_0x5358('0x19')]();};}function respondWithResult(_0xfdbd1e,_0xd8f6a){_0xd8f6a=_0xd8f6a||0xc8;return function(_0x231e4b){if(_0x231e4b){return _0xfdbd1e[_0x5358('0x18')](_0xd8f6a)['json'](_0x231e4b);}};}function respondWithFilteredResult(_0x7a1cb0,_0x7406b7){return function(_0x355eb5){if(_0x355eb5){var _0x332952=typeof _0x7406b7['offset']===_0x5358('0x1a')&&typeof _0x7406b7['limit']===_0x5358('0x1a');var _0x4463fa=_0x355eb5[_0x5358('0x1b')];var _0x45b059=_0x332952?0x0:_0x7406b7['offset'];var _0x51f622=_0x332952?_0x355eb5[_0x5358('0x1b')]:_0x7406b7[_0x5358('0x1c')]+_0x7406b7['limit'];var _0x4cdf68;if(_0x51f622>=_0x4463fa){_0x51f622=_0x4463fa;_0x4cdf68=0xc8;}else{_0x4cdf68=0xce;}_0x7a1cb0['status'](_0x4cdf68);return _0x7a1cb0[_0x5358('0x1d')]('Content-Range',_0x45b059+'-'+_0x51f622+'/'+_0x4463fa)['json'](_0x355eb5);}return null;};}function patchUpdates(_0x40db8d){return function(_0x104c8b){try{jsonpatch[_0x5358('0x1e')](_0x104c8b,_0x40db8d,!![]);}catch(_0x45fe10){return BPromise[_0x5358('0x1f')](_0x45fe10);}return _0x104c8b[_0x5358('0x20')]();};}function saveUpdates(_0x583e7d,_0x1e2fc2){return function(_0x2ed0cf){if(_0x2ed0cf){return _0x2ed0cf[_0x5358('0x21')](_0x583e7d)['then'](function(_0x3c2f37){return _0x3c2f37;});}return null;};}function removeEntity(_0x2873a0,_0x427a27){return function(_0x39707f){if(_0x39707f){return _0x39707f['destroy']()[_0x5358('0x22')](function(){_0x2873a0[_0x5358('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18ca88,_0x216d36){return function(_0x5a9d00){if(!_0x5a9d00){_0x18ca88[_0x5358('0x17')](0x194);}return _0x5a9d00;};}function handleError(_0x283fbf,_0x48983a){_0x48983a=_0x48983a||0x1f4;return function(_0xa2b39b){logger['error'](_0xa2b39b[_0x5358('0x23')]);if(_0xa2b39b[_0x5358('0x24')]){delete _0xa2b39b[_0x5358('0x24')];}_0x283fbf[_0x5358('0x18')](_0x48983a)[_0x5358('0x25')](_0xa2b39b);};}exports[_0x5358('0x26')]=function(_0x2067e1,_0x5c4877){var _0x4b5822={},_0x4e6d89={},_0x493b11={'count':0x0,'rows':[]};var _0x521ea8=_[_0x5358('0x27')](db[_0x5358('0x28')]['rawAttributes'],function(_0xe6503a){return{'name':_0xe6503a[_0x5358('0x29')],'type':_0xe6503a['type'][_0x5358('0x2a')]};});_0x4e6d89[_0x5358('0x2b')]=_['map'](_0x521ea8,'name');_0x4e6d89['query']=_[_0x5358('0x2c')](_0x2067e1['query']);_0x4e6d89[_0x5358('0x2d')]=_['intersection'](_0x4e6d89[_0x5358('0x2b')],_0x4e6d89[_0x5358('0x2e')]);_0x4b5822[_0x5358('0x2f')]=_[_0x5358('0x30')](_0x4e6d89[_0x5358('0x2b')],qs[_0x5358('0x31')](_0x2067e1[_0x5358('0x2e')]['fields']));_0x4b5822[_0x5358('0x2f')]=_0x4b5822[_0x5358('0x2f')][_0x5358('0x32')]?_0x4b5822[_0x5358('0x2f')]:_0x4e6d89[_0x5358('0x2b')];if(!_0x2067e1['query'][_0x5358('0x33')](_0x5358('0x34'))){_0x4b5822['limit']=qs['limit'](_0x2067e1['query'][_0x5358('0x35')]);_0x4b5822['offset']=qs[_0x5358('0x1c')](_0x2067e1['query'][_0x5358('0x1c')]);}_0x4b5822[_0x5358('0x36')]=qs[_0x5358('0x37')](_0x2067e1[_0x5358('0x2e')][_0x5358('0x37')]);_0x4b5822['where']=qs['filters'](_[_0x5358('0x38')](_0x2067e1[_0x5358('0x2e')],_0x4e6d89[_0x5358('0x2d')]),_0x521ea8);if(_0x2067e1[_0x5358('0x2e')]['filter']){_0x4b5822[_0x5358('0x39')]=_[_0x5358('0x3a')](_0x4b5822[_0x5358('0x39')],{'$or':_['map'](_0x521ea8,function(_0x3e0533){if(_0x3e0533[_0x5358('0x3b')]!==_0x5358('0x3c')){var _0x2f5274={};_0x2f5274[_0x3e0533[_0x5358('0x24')]]={'$like':'%'+_0x2067e1[_0x5358('0x2e')][_0x5358('0x3d')]+'%'};return _0x2f5274;}})});}_0x4b5822=_[_0x5358('0x3a')]({},_0x4b5822,_0x2067e1[_0x5358('0x3e')]);var _0x10ec21={'where':_0x4b5822[_0x5358('0x39')]};return db['UserProfileSection'][_0x5358('0x1b')](_0x10ec21)[_0x5358('0x22')](function(_0xf0e4c7){_0x493b11[_0x5358('0x1b')]=_0xf0e4c7;if(_0x2067e1[_0x5358('0x2e')]['includeAll']){_0x4b5822[_0x5358('0x3f')]=[{'all':!![]}];}return db[_0x5358('0x28')][_0x5358('0x40')](_0x4b5822);})[_0x5358('0x22')](function(_0x3b7449){_0x493b11[_0x5358('0x41')]=_0x3b7449;return _0x493b11;})[_0x5358('0x22')](respondWithFilteredResult(_0x5c4877,_0x4b5822))[_0x5358('0x42')](handleError(_0x5c4877,null));};exports[_0x5358('0x43')]=function(_0x27b215,_0x5145bd){var _0x4c72de={'raw':![],'where':{'id':_0x27b215[_0x5358('0x44')]['id']}},_0x410ce4={};_0x410ce4[_0x5358('0x2b')]=_[_0x5358('0x2c')](db[_0x5358('0x28')]['rawAttributes']);_0x410ce4[_0x5358('0x2e')]=_[_0x5358('0x2c')](_0x27b215['query']);_0x410ce4[_0x5358('0x2d')]=_[_0x5358('0x30')](_0x410ce4[_0x5358('0x2b')],_0x410ce4[_0x5358('0x2e')]);_0x4c72de['attributes']=_['intersection'](_0x410ce4[_0x5358('0x2b')],qs[_0x5358('0x31')](_0x27b215[_0x5358('0x2e')][_0x5358('0x31')]));_0x4c72de[_0x5358('0x2f')]=_0x4c72de[_0x5358('0x2f')][_0x5358('0x32')]?_0x4c72de['attributes']:_0x410ce4[_0x5358('0x2b')];if(_0x27b215[_0x5358('0x2e')][_0x5358('0x45')]){_0x4c72de[_0x5358('0x3f')]=[{'all':!![]}];}_0x4c72de=_['merge']({},_0x4c72de,_0x27b215['options']);return db[_0x5358('0x28')][_0x5358('0x46')](_0x4c72de)[_0x5358('0x22')](handleEntityNotFound(_0x5145bd,null))['then'](respondWithResult(_0x5145bd,null))['catch'](handleError(_0x5145bd,null));};exports['create']=function(_0x38b9aa,_0x486b8a){return db[_0x5358('0x28')][_0x5358('0x47')](_0x38b9aa['body'],{})[_0x5358('0x22')](respondWithResult(_0x486b8a,0xc9))[_0x5358('0x42')](handleError(_0x486b8a,null));};exports[_0x5358('0x21')]=function(_0x362f60,_0x1573a5){if(_0x362f60[_0x5358('0x48')]['id']){delete _0x362f60[_0x5358('0x48')]['id'];}return db['UserProfileSection'][_0x5358('0x46')]({'where':{'id':_0x362f60[_0x5358('0x44')]['id']}})[_0x5358('0x22')](handleEntityNotFound(_0x1573a5,null))[_0x5358('0x22')](saveUpdates(_0x362f60['body'],null))[_0x5358('0x22')](respondWithResult(_0x1573a5,null))[_0x5358('0x42')](handleError(_0x1573a5,null));};exports[_0x5358('0x49')]=function(_0x4a4272,_0x1f01bc){return db[_0x5358('0x28')][_0x5358('0x46')]({'where':{'id':_0x4a4272[_0x5358('0x44')]['id']}})[_0x5358('0x22')](handleEntityNotFound(_0x1f01bc,null))[_0x5358('0x22')](removeEntity(_0x1f01bc,null))[_0x5358('0x42')](handleError(_0x1f01bc,null));};exports[_0x5358('0x4a')]=function(_0x2b0caa,_0x19f1fa){return db[_0x5358('0x28')]['describe']()[_0x5358('0x22')](respondWithResult(_0x19f1fa,null))[_0x5358('0x42')](handleError(_0x19f1fa,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index d3f0ca0..4d08b65 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 _0x4e28=['api','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','compositeIndex','sectionId','userProfileId','lodash','../../config/logger'];(function(_0x125eee,_0x588e5d){var _0x20cef1=function(_0x3faa7a){while(--_0x3faa7a){_0x125eee['push'](_0x125eee['shift']());}};_0x20cef1(++_0x588e5d);}(_0x4e28,0xde));var _0x84e2=function(_0x440518,_0x17f619){_0x440518=_0x440518-0x0;var _0x5c217e=_0x4e28[_0x440518];return _0x5c217e;};'use strict';var _=require(_0x84e2('0x0'));var util=require('util');var logger=require(_0x84e2('0x1'))(_0x84e2('0x2'));var moment=require('moment');var BPromise=require(_0x84e2('0x3'));var rp=require(_0x84e2('0x4'));var fs=require('fs');var path=require(_0x84e2('0x5'));var rimraf=require(_0x84e2('0x6'));var config=require(_0x84e2('0x7'));var attributes=require(_0x84e2('0x8'));module[_0x84e2('0x9')]=function(_0x1425fa,_0x473951){return _0x1425fa[_0x84e2('0xa')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x84e2('0xb'),'fields':[_0x84e2('0xc'),_0x84e2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x79d1=['compositeIndex','userProfileId','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections'];(function(_0x2e85e4,_0x3c39d1){var _0x22da11=function(_0x475510){while(--_0x475510){_0x2e85e4['push'](_0x2e85e4['shift']());}};_0x22da11(++_0x3c39d1);}(_0x79d1,0x9c));var _0x179d=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x79d1[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x179d('0x0'))(_0x179d('0x1'));var moment=require(_0x179d('0x2'));var BPromise=require(_0x179d('0x3'));var rp=require(_0x179d('0x4'));var fs=require('fs');var path=require(_0x179d('0x5'));var rimraf=require('rimraf');var config=require(_0x179d('0x6'));var attributes=require(_0x179d('0x7'));module[_0x179d('0x8')]=function(_0x5adf6a,_0x18672a){return _0x5adf6a[_0x179d('0x9')](_0x179d('0xa'),attributes,{'tableName':_0x179d('0xb'),'paranoid':![],'indexes':[{'name':_0x179d('0xc'),'fields':['sectionId',_0x179d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index dff65de..8132fb0 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 _0xc932=['result','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x14e393,_0x5ef7b3){var _0x5b5ffa=function(_0x133c89){while(--_0x133c89){_0x14e393['push'](_0x14e393['shift']());}};_0x5b5ffa(++_0x5ef7b3);}(_0xc932,0x9b));var _0x2c93=function(_0xb77dfe,_0x39c4c7){_0xb77dfe=_0xb77dfe-0x0;var _0x5e4f5d=_0xc932[_0xb77dfe];return _0x5e4f5d;};'use strict';var _=require(_0x2c93('0x0'));var util=require(_0x2c93('0x1'));var moment=require(_0x2c93('0x2'));var BPromise=require('bluebird');var rs=require(_0x2c93('0x3'));var fs=require('fs');var Redis=require(_0x2c93('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2c93('0x5'))(_0x2c93('0x6'));var config=require(_0x2c93('0x7'));var jayson=require(_0x2c93('0x8'));var client=jayson[_0x2c93('0x9')][_0x2c93('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e0bd4,_0x8da6b3,_0x408580){return new BPromise(function(_0x4e7f29,_0x5e184f){return client[_0x2c93('0xb')](_0x4e0bd4,_0x408580)[_0x2c93('0xc')](function(_0x44d6c2){logger['info'](_0x2c93('0xd'),_0x8da6b3,_0x2c93('0xe'));logger[_0x2c93('0xf')](_0x2c93('0x10'),_0x8da6b3,_0x2c93('0xe'),JSON[_0x2c93('0x11')](_0x44d6c2));if(_0x44d6c2['error']){if(_0x44d6c2[_0x2c93('0x12')][_0x2c93('0x13')]===0x1f4){logger['error'](_0x2c93('0xd'),_0x8da6b3,_0x44d6c2[_0x2c93('0x12')][_0x2c93('0x14')]);return _0x5e184f(_0x44d6c2[_0x2c93('0x12')][_0x2c93('0x14')]);}logger['error'](_0x2c93('0xd'),_0x8da6b3,_0x44d6c2[_0x2c93('0x12')][_0x2c93('0x14')]);return _0x4e7f29(_0x44d6c2[_0x2c93('0x12')][_0x2c93('0x14')]);}else{logger['info'](_0x2c93('0xd'),_0x8da6b3,_0x2c93('0xe'));_0x4e7f29(_0x44d6c2[_0x2c93('0x15')]['message']);}})['catch'](function(_0x19b779){logger['error'](_0x2c93('0xd'),_0x8da6b3,_0x19b779);_0x5e184f(_0x19b779);});});} \ No newline at end of file +var _0xd90d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','bluebird','ioredis'];(function(_0x31cd7a,_0xbc2f48){var _0x4fbdff=function(_0x162d89){while(--_0x162d89){_0x31cd7a['push'](_0x31cd7a['shift']());}};_0x4fbdff(++_0xbc2f48);}(_0xd90d,0x165));var _0xdd90=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0xd90d[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0xdd90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdd90('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd90('0x2'));var db=require(_0xdd90('0x3'))['db'];var utils=require(_0xdd90('0x4'));var logger=require(_0xdd90('0x5'))(_0xdd90('0x6'));var config=require(_0xdd90('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd90('0x8')][_0xdd90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c55f4,_0x2f9429,_0x452e1d){return new BPromise(function(_0xb0a0a4,_0x3aaea1){return client[_0xdd90('0xa')](_0x2c55f4,_0x452e1d)['then'](function(_0x115fd7){logger[_0xdd90('0xb')](_0xdd90('0xc'),_0x2f9429,_0xdd90('0xd'));logger['debug'](_0xdd90('0xe'),_0x2f9429,_0xdd90('0xd'),JSON['stringify'](_0x115fd7));if(_0x115fd7[_0xdd90('0xf')]){if(_0x115fd7[_0xdd90('0xf')]['code']===0x1f4){logger[_0xdd90('0xf')](_0xdd90('0xc'),_0x2f9429,_0x115fd7['error'][_0xdd90('0x10')]);return _0x3aaea1(_0x115fd7[_0xdd90('0xf')][_0xdd90('0x10')]);}logger[_0xdd90('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x2f9429,_0x115fd7[_0xdd90('0xf')][_0xdd90('0x10')]);return _0xb0a0a4(_0x115fd7[_0xdd90('0xf')][_0xdd90('0x10')]);}else{logger[_0xdd90('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x2f9429,_0xdd90('0xd'));_0xb0a0a4(_0x115fd7['result']['message']);}})[_0xdd90('0x11')](function(_0x7c0d5d){logger[_0xdd90('0xf')](_0xdd90('0xc'),_0x2f9429,_0x7c0d5d);_0x3aaea1(_0x7c0d5d);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c9199c2..0e07462 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x21984d,_0x28d25a){var _0x4ef5b8=function(_0x2d5ae3){while(--_0x2d5ae3){_0x21984d['push'](_0x21984d['shift']());}};_0x4ef5b8(++_0x28d25a);}(_0xe706,0xa3));var _0x6e70=function(_0x3357b8,_0xeb406){_0x3357b8=_0x3357b8-0x0;var _0x50737a=_0xe706[_0x3357b8];return _0x50737a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x152d1c,_0x253137){var _0x320a8d=function(_0x53a6b6){while(--_0x53a6b6){_0x152d1c['push'](_0x152d1c['shift']());}};_0x320a8d(++_0x253137);}(_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 633c656..34d3678 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 _0xfe65=['sequelize','exports'];(function(_0x119684,_0x1105b8){var _0xdd391b=function(_0x5282eb){while(--_0x5282eb){_0x119684['push'](_0x119684['shift']());}};_0xdd391b(++_0x1105b8);}(_0xfe65,0xc4));var _0x5fe6=function(_0x178815,_0x1149f0){_0x178815=_0x178815-0x0;var _0x2f5fdd=_0xfe65[_0x178815];return _0x2f5fdd;};'use strict';var Sequelize=require(_0x5fe6('0x0'));module[_0x5fe6('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x02a6=['sequelize','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x02a6,0x72));var _0x602a=function(_0xf888d5,_0x2a2535){_0xf888d5=_0xf888d5-0x0;var _0x4149b6=_0x02a6[_0xf888d5];return _0x4149b6;};'use strict';var Sequelize=require(_0x602a('0x0'));module[_0x602a('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 5e8647d..935bc34 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 _0xeda8=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xeda8,0x104));var _0x8eda=function(_0x487020,_0x450d4a){_0x487020=_0x487020-0x0;var _0xe45c39=_0xeda8[_0x487020];return _0xe45c39;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('UserSmsQueue',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6363=['define','UserSmsQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x324f7a,_0x5b3aac){var _0x3100b5=function(_0x3e49b5){while(--_0x3e49b5){_0x324f7a['push'](_0x324f7a['shift']());}};_0x3100b5(++_0x5b3aac);}(_0x6363,0x13a));var _0x3636=function(_0xdbb58d,_0x3f5000){_0xdbb58d=_0xdbb58d-0x0;var _0x2ae21a=_0x6363[_0xdbb58d];return _0x2ae21a;};'use strict';var _=require(_0x3636('0x0'));var util=require('util');var logger=require(_0x3636('0x1'))(_0x3636('0x2'));var moment=require(_0x3636('0x3'));var BPromise=require(_0x3636('0x4'));var rp=require(_0x3636('0x5'));var fs=require('fs');var path=require(_0x3636('0x6'));var rimraf=require(_0x3636('0x7'));var config=require(_0x3636('0x8'));var attributes=require(_0x3636('0x9'));module[_0x3636('0xa')]=function(_0x15728f,_0x1f94ef){return _0x15728f[_0x3636('0xb')](_0x3636('0xc'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 79ac6cc..2e1b9fd 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 _0x2874=['error','code','UserSmsQueue,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x31f9c7,_0x1d5f54){var _0x46c5b3=function(_0x3180e3){while(--_0x3180e3){_0x31f9c7['push'](_0x31f9c7['shift']());}};_0x46c5b3(++_0x1d5f54);}(_0x2874,0x10d));var _0x4287=function(_0x2d4a54,_0x1f759f){_0x2d4a54=_0x2d4a54-0x0;var _0x489a0f=_0x2874[_0x2d4a54];return _0x489a0f;};'use strict';var _=require(_0x4287('0x0'));var util=require('util');var moment=require(_0x4287('0x1'));var BPromise=require(_0x4287('0x2'));var rs=require(_0x4287('0x3'));var fs=require('fs');var Redis=require(_0x4287('0x4'));var db=require(_0x4287('0x5'))['db'];var utils=require(_0x4287('0x6'));var logger=require(_0x4287('0x7'))(_0x4287('0x8'));var config=require('../../config/environment');var jayson=require(_0x4287('0x9'));var client=jayson['client'][_0x4287('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2786a9,_0x363ad5,_0x770bc1){return new BPromise(function(_0xf8205,_0x40686b){return client[_0x4287('0xb')](_0x2786a9,_0x770bc1)[_0x4287('0xc')](function(_0x4cab21){logger[_0x4287('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x363ad5,_0x4287('0xe'));logger[_0x4287('0xf')](_0x4287('0x10'),_0x363ad5,_0x4287('0xe'),JSON['stringify'](_0x4cab21));if(_0x4cab21[_0x4287('0x11')]){if(_0x4cab21[_0x4287('0x11')][_0x4287('0x12')]===0x1f4){logger[_0x4287('0x11')](_0x4287('0x13'),_0x363ad5,_0x4cab21['error'][_0x4287('0x14')]);return _0x40686b(_0x4cab21[_0x4287('0x11')][_0x4287('0x14')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x363ad5,_0x4cab21[_0x4287('0x11')][_0x4287('0x14')]);return _0xf8205(_0x4cab21[_0x4287('0x11')][_0x4287('0x14')]);}else{logger[_0x4287('0xd')](_0x4287('0x13'),_0x363ad5,_0x4287('0xe'));_0xf8205(_0x4cab21['result'][_0x4287('0x14')]);}})[_0x4287('0x15')](function(_0x582351){logger[_0x4287('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x363ad5,_0x582351);_0x40686b(_0x582351);});});} \ No newline at end of file +var _0x9484=['rpc','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x28a82f,_0x4853fc){var _0x12b298=function(_0x4a4554){while(--_0x4a4554){_0x28a82f['push'](_0x28a82f['shift']());}};_0x12b298(++_0x4853fc);}(_0x9484,0x151));var _0x4948=function(_0x5c18ef,_0xa2e81d){_0x5c18ef=_0x5c18ef-0x0;var _0x33789d=_0x9484[_0x5c18ef];return _0x33789d;};'use strict';var _=require(_0x4948('0x0'));var util=require(_0x4948('0x1'));var moment=require(_0x4948('0x2'));var BPromise=require(_0x4948('0x3'));var rs=require(_0x4948('0x4'));var fs=require('fs');var Redis=require(_0x4948('0x5'));var db=require(_0x4948('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4948('0x7'))(_0x4948('0x8'));var config=require(_0x4948('0x9'));var jayson=require(_0x4948('0xa'));var client=jayson['client'][_0x4948('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x341535,_0x5c43e4,_0x54b8e8){return new BPromise(function(_0x2489d7,_0x34b51e){return client[_0x4948('0xc')](_0x341535,_0x54b8e8)[_0x4948('0xd')](function(_0x2985ec){logger[_0x4948('0xe')](_0x4948('0xf'),_0x5c43e4,_0x4948('0x10'));logger['debug'](_0x4948('0x11'),_0x5c43e4,'request\x20sent',JSON['stringify'](_0x2985ec));if(_0x2985ec[_0x4948('0x12')]){if(_0x2985ec[_0x4948('0x12')][_0x4948('0x13')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x5c43e4,_0x2985ec[_0x4948('0x12')]['message']);return _0x34b51e(_0x2985ec[_0x4948('0x12')][_0x4948('0x14')]);}logger[_0x4948('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x5c43e4,_0x2985ec[_0x4948('0x12')]['message']);return _0x2489d7(_0x2985ec[_0x4948('0x12')][_0x4948('0x14')]);}else{logger[_0x4948('0xe')](_0x4948('0xf'),_0x5c43e4,'request\x20sent');_0x2489d7(_0x2985ec[_0x4948('0x15')][_0x4948('0x14')]);}})[_0x4948('0x16')](function(_0x5af759){logger[_0x4948('0x12')](_0x4948('0xf'),_0x5c43e4,_0x5af759);_0x34b51e(_0x5af759);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 6af9dba..85242b4 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 _0x1f57=['sequelize','exports','INTEGER'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x1f57,0xf3));var _0x71f5=function(_0x36dc60,_0x333826){_0x36dc60=_0x36dc60-0x0;var _0x8bd0ce=_0x1f57[_0x36dc60];return _0x8bd0ce;};'use strict';var Sequelize=require(_0x71f5('0x0'));module[_0x71f5('0x1')]={'UserId':{'type':Sequelize[_0x71f5('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x71f5('0x2')]}}; \ No newline at end of file +var _0x72c7=['sequelize','exports'];(function(_0x382d8e,_0x2a5761){var _0x23993d=function(_0x1f491c){while(--_0x1f491c){_0x382d8e['push'](_0x382d8e['shift']());}};_0x23993d(++_0x2a5761);}(_0x72c7,0xbc));var _0x772c=function(_0x33269b,_0x1b93aa){_0x33269b=_0x33269b-0x0;var _0x157b82=_0x72c7[_0x33269b];return _0x157b82;};'use strict';var Sequelize=require(_0x772c('0x0'));module[_0x772c('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index be06b8c..72b1ec5 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(_0xa19263,_0x5313e4){var _0x2c8854=function(_0x183179){while(--_0x183179){_0xa19263['push'](_0xa19263['shift']());}};_0x2c8854(++_0x5313e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_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(_0xb79d0d,_0x2bce3f){var _0x82ff52=function(_0x46673b){while(--_0x46673b){_0xb79d0d['push'](_0xb79d0d['shift']());}};_0x82ff52(++_0x2bce3f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 21a592c..1c1bc75 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(_0x193271,_0x2e8656){var _0x420932=function(_0x1a8dfe){while(--_0x1a8dfe){_0x193271['push'](_0x193271['shift']());}};_0x420932(++_0x2e8656);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x323d87,_0x4ef3f9){_0x323d87=_0x323d87-0x0;var _0x5e8f74=_0xcb91[_0x323d87];return _0x5e8f74;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x207061,_0xe38cda){var _0x4a2833=function(_0x16906e){while(--_0x16906e){_0x207061['push'](_0x207061['shift']());}};_0x4a2833(++_0xe38cda);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 47d02f6..9fb2b30 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 _0xa265=['exports','INTEGER','sequelize'];(function(_0x2b98dc,_0x21c843){var _0x3f969b=function(_0x241425){while(--_0x241425){_0x2b98dc['push'](_0x2b98dc['shift']());}};_0x3f969b(++_0x21c843);}(_0xa265,0x18b));var _0x5a26=function(_0x15fdfc,_0x1b522e){_0x15fdfc=_0x15fdfc-0x0;var _0x542d9f=_0xa265[_0x15fdfc];return _0x542d9f;};'use strict';var Sequelize=require(_0x5a26('0x0'));module[_0x5a26('0x1')]={'penalty':{'type':Sequelize[_0x5a26('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa022=['INTEGER','sequelize','exports'];(function(_0x4b0182,_0x3be539){var _0x73ed23=function(_0x54be9f){while(--_0x54be9f){_0x4b0182['push'](_0x4b0182['shift']());}};_0x73ed23(++_0x3be539);}(_0xa022,0x1e7));var _0x2a02=function(_0x36940e,_0x11f338){_0x36940e=_0x36940e-0x0;var _0x3283f2=_0xa022[_0x36940e];return _0x3283f2;};'use strict';var Sequelize=require(_0x2a02('0x0'));module[_0x2a02('0x1')]={'penalty':{'type':Sequelize[_0x2a02('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 357e584..d3cdbb4 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 _0x07cb=['bluebird','request-promise','path','../../config/environment','UserVoiceQueue','user_has_voice_queues','lodash','api'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0x07cb,0x1be));var _0xb07c=function(_0x428ec2,_0x150404){_0x428ec2=_0x428ec2-0x0;var _0x1654d6=_0x07cb[_0x428ec2];return _0x1654d6;};'use strict';var _=require(_0xb07c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb07c('0x1'));var moment=require('moment');var BPromise=require(_0xb07c('0x2'));var rp=require(_0xb07c('0x3'));var fs=require('fs');var path=require(_0xb07c('0x4'));var rimraf=require('rimraf');var config=require(_0xb07c('0x5'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x4e9449,_0x5d0e44){return _0x4e9449['define'](_0xb07c('0x6'),attributes,{'tableName':_0xb07c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7703=['rimraf','./userVoiceQueue.attributes','exports','define','user_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x7703,0x1d9));var _0x3770=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x7703[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0x3770('0x0'));var util=require(_0x3770('0x1'));var logger=require(_0x3770('0x2'))(_0x3770('0x3'));var moment=require(_0x3770('0x4'));var BPromise=require('bluebird');var rp=require(_0x3770('0x5'));var fs=require('fs');var path=require(_0x3770('0x6'));var rimraf=require(_0x3770('0x7'));var config=require('../../config/environment');var attributes=require(_0x3770('0x8'));module[_0x3770('0x9')]=function(_0x5317b2,_0x5cd4de){return _0x5317b2[_0x3770('0xa')]('UserVoiceQueue',attributes,{'tableName':_0x3770('0xb'),'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 2f00f94..e9062e7 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 _0x88a7=['stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x135fa5,_0x5068d7){var _0x40789f=function(_0x280a2d){while(--_0x280a2d){_0x135fa5['push'](_0x135fa5['shift']());}};_0x40789f(++_0x5068d7);}(_0x88a7,0xbf));var _0x788a=function(_0x5bf7bd,_0x52d967){_0x5bf7bd=_0x5bf7bd-0x0;var _0x4d3227=_0x88a7[_0x5bf7bd];return _0x4d3227;};'use strict';var _=require(_0x788a('0x0'));var util=require('util');var moment=require(_0x788a('0x1'));var BPromise=require('bluebird');var rs=require(_0x788a('0x2'));var fs=require('fs');var Redis=require(_0x788a('0x3'));var db=require(_0x788a('0x4'))['db'];var utils=require(_0x788a('0x5'));var logger=require(_0x788a('0x6'))(_0x788a('0x7'));var config=require(_0x788a('0x8'));var jayson=require(_0x788a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1090f0,_0x12231c,_0x4cee5a){return new BPromise(function(_0x1aa3b4,_0xc97d95){return client[_0x788a('0xa')](_0x1090f0,_0x4cee5a)[_0x788a('0xb')](function(_0x870d1a){logger[_0x788a('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x12231c,'request\x20sent');logger[_0x788a('0xd')](_0x788a('0xe'),_0x12231c,_0x788a('0xf'),JSON[_0x788a('0x10')](_0x870d1a));if(_0x870d1a[_0x788a('0x11')]){if(_0x870d1a[_0x788a('0x11')][_0x788a('0x12')]===0x1f4){logger[_0x788a('0x11')](_0x788a('0x13'),_0x12231c,_0x870d1a[_0x788a('0x11')][_0x788a('0x14')]);return _0xc97d95(_0x870d1a[_0x788a('0x11')][_0x788a('0x14')]);}logger[_0x788a('0x11')](_0x788a('0x13'),_0x12231c,_0x870d1a[_0x788a('0x11')][_0x788a('0x14')]);return _0x1aa3b4(_0x870d1a['error'][_0x788a('0x14')]);}else{logger['info'](_0x788a('0x13'),_0x12231c,'request\x20sent');_0x1aa3b4(_0x870d1a[_0x788a('0x15')][_0x788a('0x14')]);}})[_0x788a('0x16')](function(_0x2779c5){logger['error'](_0x788a('0x13'),_0x12231c,_0x2779c5);_0xc97d95(_0x2779c5);});});} \ No newline at end of file +var _0xb95b=['info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5860eb,_0x1c55f1){var _0xcb2136=function(_0x11ef40){while(--_0x11ef40){_0x5860eb['push'](_0x5860eb['shift']());}};_0xcb2136(++_0x1c55f1);}(_0xb95b,0xfb));var _0xbb95=function(_0x2a8780,_0x1b5c4c){_0x2a8780=_0x2a8780-0x0;var _0x5c9dad=_0xb95b[_0x2a8780];return _0x5c9dad;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xbb95('0x0'));var rs=require(_0xbb95('0x1'));var fs=require('fs');var Redis=require(_0xbb95('0x2'));var db=require(_0xbb95('0x3'))['db'];var utils=require(_0xbb95('0x4'));var logger=require(_0xbb95('0x5'))(_0xbb95('0x6'));var config=require(_0xbb95('0x7'));var jayson=require(_0xbb95('0x8'));var client=jayson[_0xbb95('0x9')][_0xbb95('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x478935,_0x53c543,_0x5c93be){return new BPromise(function(_0x5c9e5c,_0x3b9f96){return client[_0xbb95('0xb')](_0x478935,_0x5c93be)[_0xbb95('0xc')](function(_0x312a45){logger[_0xbb95('0xd')](_0xbb95('0xe'),_0x53c543,_0xbb95('0xf'));logger['debug'](_0xbb95('0x10'),_0x53c543,'request\x20sent',JSON[_0xbb95('0x11')](_0x312a45));if(_0x312a45[_0xbb95('0x12')]){if(_0x312a45[_0xbb95('0x12')]['code']===0x1f4){logger[_0xbb95('0x12')](_0xbb95('0xe'),_0x53c543,_0x312a45[_0xbb95('0x12')][_0xbb95('0x13')]);return _0x3b9f96(_0x312a45[_0xbb95('0x12')][_0xbb95('0x13')]);}logger[_0xbb95('0x12')](_0xbb95('0xe'),_0x53c543,_0x312a45[_0xbb95('0x12')][_0xbb95('0x13')]);return _0x5c9e5c(_0x312a45[_0xbb95('0x12')]['message']);}else{logger[_0xbb95('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x53c543,_0xbb95('0xf'));_0x5c9e5c(_0x312a45[_0xbb95('0x14')][_0xbb95('0x13')]);}})[_0xbb95('0x15')](function(_0x4eceea){logger['error'](_0xbb95('0xe'),_0x53c543,_0x4eceea);_0x3b9f96(_0x4eceea);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index fd06199..2fcdff4 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(_0x231539,_0x1af76f){var _0x49d79e=function(_0x2839e2){while(--_0x2839e2){_0x231539['push'](_0x231539['shift']());}};_0x49d79e(++_0x1af76f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x40be86,_0x68fe5d){_0x40be86=_0x40be86-0x0;var _0xda3c3b=_0xcb91[_0x40be86];return _0xda3c3b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xc3555a,_0x599225){var _0x5b6b8a=function(_0x2551a1){while(--_0x2551a1){_0xc3555a['push'](_0xc3555a['shift']());}};_0x5b6b8a(++_0x599225);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index ebf497b..a1ee25f 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 _0x4da5=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','exports'];(function(_0xfcc030,_0x3ec053){var _0x5caa66=function(_0xf2e6d2){while(--_0xf2e6d2){_0xfcc030['push'](_0xfcc030['shift']());}};_0x5caa66(++_0x3ec053);}(_0x4da5,0x1b7));var _0x54da=function(_0x1df137,_0x588bd3){_0x1df137=_0x1df137-0x0;var _0xb39c89=_0x4da5[_0x1df137];return _0xb39c89;};'use strict';var Sequelize=require('sequelize');module[_0x54da('0x0')]={'uniqueid':{'type':Sequelize[_0x54da('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x54da('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x54da('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x54da('0x3')],'allowNull':![],'unique':_0x54da('0x4'),'comment':_0x54da('0x2')},'VoiceQueueId':{'type':Sequelize[_0x54da('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x54da('0x4'),'comment':_0x54da('0x2')},'penalty':{'type':Sequelize[_0x54da('0x1')](0xb),'defaultValue':0x0,'comment':_0x54da('0x2')},'paused':{'type':Sequelize[_0x54da('0x1')](0xb),'defaultValue':0x0,'comment':_0x54da('0x2')}}; \ No newline at end of file +var _0xd17f=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x5c42b3,_0x13dd09){var _0x18da81=function(_0x11bbbe){while(--_0x11bbbe){_0x5c42b3['push'](_0x5c42b3['shift']());}};_0x18da81(++_0x13dd09);}(_0xd17f,0x10e));var _0xfd17=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd17f[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xfd17('0x0'));module[_0xfd17('0x1')]={'uniqueid':{'type':Sequelize[_0xfd17('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xfd17('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xfd17('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xfd17('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0xfd17('0x3')},'VoiceQueueId':{'type':Sequelize[_0xfd17('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xfd17('0x4')],'allowNull':![],'unique':_0xfd17('0x5'),'comment':_0xfd17('0x3')},'penalty':{'type':Sequelize[_0xfd17('0x2')](0xb),'defaultValue':0x0,'comment':_0xfd17('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xfd17('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index cbb712e..5f0d5b2 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 _0x148f=['exports','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x233eba,_0x3dc416){var _0x40efa3=function(_0xc07c57){while(--_0xc07c57){_0x233eba['push'](_0x233eba['shift']());}};_0x40efa3(++_0x3dc416);}(_0x148f,0xa9));var _0xf148=function(_0x5652e3,_0x5d1a11){_0x5652e3=_0x5652e3-0x0;var _0x1b31c0=_0x148f[_0x5652e3];return _0x1b31c0;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xf148('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xf148('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf148('0x2'),'afterDestroy':_0xf148('0x3')};function emitEvent(_0x1535c6){return function(_0x43b867,_0x49779f,_0x1d0a0a){UserVoiceQueueRtEvents[_0xf148('0x4')](_0x1535c6+':'+_0x43b867['id'],_0x43b867);UserVoiceQueueRtEvents[_0xf148('0x4')](_0x1535c6,_0x43b867);_0x1d0a0a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xf148('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x58da=['exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','emit','hasOwnProperty'];(function(_0x3835b6,_0x4477f3){var _0x20e8f1=function(_0x246200){while(--_0x246200){_0x3835b6['push'](_0x3835b6['shift']());}};_0x20e8f1(++_0x4477f3);}(_0x58da,0x1c9));var _0xa58d=function(_0x4443f0,_0x2c7e2f){_0x4443f0=_0x4443f0-0x0;var _0x4eb758=_0x58da[_0x4443f0];return _0x4eb758;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xa58d('0x0'))['db'][_0xa58d('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa58d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3289bb){return function(_0x2036a1,_0x3592a4,_0x219e48){UserVoiceQueueRtEvents[_0xa58d('0x3')](_0x3289bb+':'+_0x2036a1['id'],_0x2036a1);UserVoiceQueueRtEvents['emit'](_0x3289bb,_0x2036a1);_0x219e48(null);};}for(var e in events){if(events[_0xa58d('0x4')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xa58d('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 7704621..74fbb45 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 _0x8982=['moment','bluebird','request-promise','path','rimraf','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger'];(function(_0x3b52eb,_0x4e6484){var _0x21ca76=function(_0x28f84e){while(--_0x28f84e){_0x3b52eb['push'](_0x3b52eb['shift']());}};_0x21ca76(++_0x4e6484);}(_0x8982,0x8c));var _0x2898=function(_0x1250c9,_0x4034c2){_0x1250c9=_0x1250c9-0x0;var _0x6fbaa=_0x8982[_0x1250c9];return _0x6fbaa;};'use strict';var _=require(_0x2898('0x0'));var util=require(_0x2898('0x1'));var logger=require(_0x2898('0x2'))('api');var moment=require(_0x2898('0x3'));var BPromise=require(_0x2898('0x4'));var rp=require(_0x2898('0x5'));var fs=require('fs');var path=require(_0x2898('0x6'));var rimraf=require(_0x2898('0x7'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x55cf2d,_0x5ac6a2){return _0x55cf2d[_0x2898('0x8')](_0x2898('0x9'),attributes,{'tableName':_0x2898('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3162=['api','bluebird','../../config/environment','exports','define','user_has_voice_queues_rt','util','../../config/logger'];(function(_0x19085d,_0x5d8bc0){var _0xdb3f69=function(_0x3009c8){while(--_0x3009c8){_0x19085d['push'](_0x19085d['shift']());}};_0xdb3f69(++_0x5d8bc0);}(_0x3162,0x17e));var _0x2316=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0x3162[_0x4b12ae];return _0x16957b;};'use strict';var _=require('lodash');var util=require(_0x2316('0x0'));var logger=require(_0x2316('0x1'))(_0x2316('0x2'));var moment=require('moment');var BPromise=require(_0x2316('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2316('0x4'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x2316('0x5')]=function(_0x4d670d,_0x572fdf){return _0x4d670d[_0x2316('0x6')]('UserVoiceQueueRt',attributes,{'tableName':_0x2316('0x7'),'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 98a9a3b..0b3a7ea 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 _0x71b8=['defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis'];(function(_0x14286b,_0x29e206){var _0x18ee17=function(_0x46b51a){while(--_0x46b51a){_0x14286b['push'](_0x14286b['shift']());}};_0x18ee17(++_0x29e206);}(_0x71b8,0x90));var _0x871b=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x71b8[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x871b('0x0'));var util=require(_0x871b('0x1'));var moment=require(_0x871b('0x2'));var BPromise=require(_0x871b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x871b('0x4'));var db=require(_0x871b('0x5'))['db'];var utils=require(_0x871b('0x6'));var logger=require(_0x871b('0x7'))('rpc');var config=require(_0x871b('0x8'));var jayson=require(_0x871b('0x9'));var client=jayson['client'][_0x871b('0xa')]({'port':0x232a});config[_0x871b('0xb')]=_[_0x871b('0xc')](config[_0x871b('0xb')],{'host':_0x871b('0xd'),'port':0x18eb});var socket=require(_0x871b('0xe'))(new Redis(config[_0x871b('0xb')]));require(_0x871b('0xf'))['register'](socket);function respondWithRpcPromise(_0x687da9,_0x48bccd,_0x44c777){return new BPromise(function(_0x36205f,_0x1eea07){return client[_0x871b('0x10')](_0x687da9,_0x44c777)['then'](function(_0xa6d086){logger[_0x871b('0x11')](_0x871b('0x12'),_0x48bccd,_0x871b('0x13'));logger[_0x871b('0x14')](_0x871b('0x15'),_0x48bccd,_0x871b('0x13'),JSON[_0x871b('0x16')](_0xa6d086));if(_0xa6d086[_0x871b('0x17')]){if(_0xa6d086['error'][_0x871b('0x18')]===0x1f4){logger[_0x871b('0x17')](_0x871b('0x12'),_0x48bccd,_0xa6d086[_0x871b('0x17')][_0x871b('0x19')]);return _0x1eea07(_0xa6d086[_0x871b('0x17')][_0x871b('0x19')]);}logger[_0x871b('0x17')](_0x871b('0x12'),_0x48bccd,_0xa6d086[_0x871b('0x17')][_0x871b('0x19')]);return _0x36205f(_0xa6d086[_0x871b('0x17')][_0x871b('0x19')]);}else{logger['info'](_0x871b('0x12'),_0x48bccd,_0x871b('0x13'));_0x36205f(_0xa6d086[_0x871b('0x1a')][_0x871b('0x19')]);}})[_0x871b('0x1b')](function(_0x4210d0){logger[_0x871b('0x17')](_0x871b('0x12'),_0x48bccd,_0x4210d0);_0x1eea07(_0x4210d0);});});}exports[_0x871b('0x1c')]=function(_0x5303f6){var _0x58f31d=this;return new Promise(function(_0x4391ce,_0x579bc2){return db[_0x871b('0x1d')][_0x871b('0x1e')]({'raw':_0x5303f6['options']?_0x5303f6[_0x871b('0x1f')][_0x871b('0x20')]===undefined?!![]:![]:!![],'where':_0x5303f6['options']?_0x5303f6[_0x871b('0x1f')][_0x871b('0x21')]||null:null,'attributes':[[db[_0x871b('0x22')]['fn']('COUNT',db[_0x871b('0x22')]['fn']('IF',db['sequelize'][_0x871b('0x23')](_0x871b('0x24')))),_0x871b('0x25')]]})[_0x871b('0x26')](function(_0x317f79){logger['info'](_0x871b('0x1c'),_0x5303f6);logger[_0x871b('0x14')]('GetVoiceQueueRtPauses',_0x5303f6,JSON[_0x871b('0x16')](_0x317f79));_0x4391ce(_0x317f79);})[_0x871b('0x1b')](function(_0x12b69c){logger[_0x871b('0x17')](_0x871b('0x1c'),_0x12b69c[_0x871b('0x19')],_0x5303f6);_0x579bc2(_0x58f31d[_0x871b('0x17')](0x1f4,_0x12b69c[_0x871b('0x19')]));});});}; \ No newline at end of file +var _0x9b5a=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','catch','util','moment','ioredis','../../config/utils','rpc'];(function(_0x44216d,_0x4938a7){var _0xeca523=function(_0x11faf1){while(--_0x11faf1){_0x44216d['push'](_0x44216d['shift']());}};_0xeca523(++_0x4938a7);}(_0x9b5a,0x148));var _0xa9b5=function(_0x5812c3,_0x3009c3){_0x5812c3=_0x5812c3-0x0;var _0x5ea060=_0x9b5a[_0x5812c3];return _0x5ea060;};'use strict';var _=require('lodash');var util=require(_0xa9b5('0x0'));var moment=require(_0xa9b5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9b5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9b5('0x3'));var logger=require('../../config/logger')(_0xa9b5('0x4'));var config=require(_0xa9b5('0x5'));var jayson=require(_0xa9b5('0x6'));var client=jayson[_0xa9b5('0x7')][_0xa9b5('0x8')]({'port':0x232a});config[_0xa9b5('0x9')]=_[_0xa9b5('0xa')](config[_0xa9b5('0x9')],{'host':_0xa9b5('0xb'),'port':0x18eb});var socket=require(_0xa9b5('0xc'))(new Redis(config[_0xa9b5('0x9')]));require(_0xa9b5('0xd'))[_0xa9b5('0xe')](socket);function respondWithRpcPromise(_0x4fba72,_0x25c8f7,_0x3a611d){return new BPromise(function(_0x2fc8c5,_0x31321d){return client[_0xa9b5('0xf')](_0x4fba72,_0x3a611d)[_0xa9b5('0x10')](function(_0x41d564){logger[_0xa9b5('0x11')](_0xa9b5('0x12'),_0x25c8f7,_0xa9b5('0x13'));logger[_0xa9b5('0x14')](_0xa9b5('0x15'),_0x25c8f7,'request\x20sent',JSON[_0xa9b5('0x16')](_0x41d564));if(_0x41d564['error']){if(_0x41d564[_0xa9b5('0x17')][_0xa9b5('0x18')]===0x1f4){logger[_0xa9b5('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x25c8f7,_0x41d564[_0xa9b5('0x17')]['message']);return _0x31321d(_0x41d564['error']['message']);}logger[_0xa9b5('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x25c8f7,_0x41d564['error'][_0xa9b5('0x19')]);return _0x2fc8c5(_0x41d564[_0xa9b5('0x17')]['message']);}else{logger[_0xa9b5('0x11')](_0xa9b5('0x12'),_0x25c8f7,_0xa9b5('0x13'));_0x2fc8c5(_0x41d564[_0xa9b5('0x1a')][_0xa9b5('0x19')]);}})['catch'](function(_0x240389){logger[_0xa9b5('0x17')](_0xa9b5('0x12'),_0x25c8f7,_0x240389);_0x31321d(_0x240389);});});}exports[_0xa9b5('0x1b')]=function(_0x4b6a28){var _0x323513=this;return new Promise(function(_0x4b5ff7,_0x5c6425){return db[_0xa9b5('0x1c')][_0xa9b5('0x1d')]({'raw':_0x4b6a28['options']?_0x4b6a28[_0xa9b5('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4b6a28[_0xa9b5('0x1e')]?_0x4b6a28['options'][_0xa9b5('0x1f')]||null:null,'attributes':[[db[_0xa9b5('0x20')]['fn'](_0xa9b5('0x21'),db['sequelize']['fn']('IF',db[_0xa9b5('0x20')][_0xa9b5('0x22')](_0xa9b5('0x23')))),'outboundQueuePauses']]})[_0xa9b5('0x10')](function(_0x4d361d){logger[_0xa9b5('0x11')]('GetVoiceQueueRtPauses',_0x4b6a28);logger[_0xa9b5('0x14')](_0xa9b5('0x1b'),_0x4b6a28,JSON['stringify'](_0x4d361d));_0x4b5ff7(_0x4d361d);})[_0xa9b5('0x24')](function(_0x559859){logger['error'](_0xa9b5('0x1b'),_0x559859[_0xa9b5('0x19')],_0x4b6a28);_0x5c6425(_0x323513[_0xa9b5('0x17')](0x1f4,_0x559859[_0xa9b5('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 7b9b6c3..e519c33 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 _0x41d9=['remove','update','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x4b0455,_0x3f4abd){var _0x36d431=function(_0x2f7f42){while(--_0x2f7f42){_0x4b0455['push'](_0x4b0455['shift']());}};_0x36d431(++_0x3f4abd);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0x941d('0x0'));var events=[_0x941d('0x1'),_0x941d('0x2'),_0x941d('0x3')];function createListener(_0x29bc6a,_0x17cec5){return function(_0x202bd8){_0x17cec5['emit'](_0x29bc6a,_0x202bd8);};}function removeListener(_0x446c52,_0x832a33){return function(){UserVoiceQueueRtEvents['removeListener'](_0x446c52,_0x832a33);};}exports[_0x941d('0x4')]=function(_0x19dd41){for(var _0x56e384=0x0,_0x179094=events['length'];_0x56e384<_0x179094;_0x56e384++){var _0x3825df=events[_0x56e384];var _0xa9021c=createListener(_0x941d('0x5')+_0x3825df,_0x19dd41);UserVoiceQueueRtEvents['on'](_0x3825df,_0xa9021c);}}; \ No newline at end of file +var _0x0845=['update','emit','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0845,0x125));var _0x5084=function(_0x5beb27,_0x200408){_0x5beb27=_0x5beb27-0x0;var _0x78ff38=_0x0845[_0x5beb27];return _0x78ff38;};'use strict';var UserVoiceQueueRtEvents=require(_0x5084('0x0'));var events=['save','remove',_0x5084('0x1')];function createListener(_0x321a97,_0x14b480){return function(_0x5954ea){_0x14b480[_0x5084('0x2')](_0x321a97,_0x5954ea);};}function removeListener(_0x26a738,_0x4ec3e3){return function(){UserVoiceQueueRtEvents[_0x5084('0x3')](_0x26a738,_0x4ec3e3);};}exports[_0x5084('0x4')]=function(_0x28f869){for(var _0x5820a0=0x0,_0x5f3d8f=events['length'];_0x5820a0<_0x5f3d8f;_0x5820a0++){var _0x212120=events[_0x5820a0];var _0x439176=createListener(_0x5084('0x5')+_0x212120,_0x28f869);UserVoiceQueueRtEvents['on'](_0x212120,_0x439176);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 11ae90f..9d6840d 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x14baef,_0x4a60b0){var _0x1a4c1f=function(_0x38e220){while(--_0x38e220){_0x14baef['push'](_0x14baef['shift']());}};_0x1a4c1f(++_0x4a60b0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x29db66,_0x1ac56a){var _0x5651a2=function(_0x2a66c1){while(--_0x2a66c1){_0x29db66['push'](_0x29db66['shift']());}};_0x5651a2(++_0x1ac56a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 0133314..7b43340 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 _0x94c8=['sequelize','exports'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0x94c8,0x92));var _0x894c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x94c8[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x894c('0x0'));module[_0x894c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4062=['exports'];(function(_0x2386ad,_0x109d2b){var _0x545e2e=function(_0x29c377){while(--_0x29c377){_0x2386ad['push'](_0x2386ad['shift']());}};_0x545e2e(++_0x109d2b);}(_0x4062,0x1ae));var _0x2406=function(_0x1ed54d,_0x13273a){_0x1ed54d=_0x1ed54d-0x0;var _0x364251=_0x4062[_0x1ed54d];return _0x364251;};'use strict';var Sequelize=require('sequelize');module[_0x2406('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 4145911..8079bea 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 _0xc9cc=['exports','define','UserWhatsappQueue','user_has_whatsapp_queues','../../config/logger','api','moment','request-promise','path','rimraf','./userWhatsappQueue.attributes'];(function(_0x5b6a59,_0x3f751d){var _0x28a759=function(_0xccc978){while(--_0xccc978){_0x5b6a59['push'](_0x5b6a59['shift']());}};_0x28a759(++_0x3f751d);}(_0xc9cc,0xca));var _0xcc9c=function(_0x3cc70d,_0x85564a){_0x3cc70d=_0x3cc70d-0x0;var _0x2e35b7=_0xc9cc[_0x3cc70d];return _0x2e35b7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcc9c('0x0'))(_0xcc9c('0x1'));var moment=require(_0xcc9c('0x2'));var BPromise=require('bluebird');var rp=require(_0xcc9c('0x3'));var fs=require('fs');var path=require(_0xcc9c('0x4'));var rimraf=require(_0xcc9c('0x5'));var config=require('../../config/environment');var attributes=require(_0xcc9c('0x6'));module[_0xcc9c('0x7')]=function(_0x5a416e,_0x3997fe){return _0x5a416e[_0xcc9c('0x8')](_0xcc9c('0x9'),attributes,{'tableName':_0xcc9c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77a0=['api','moment','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','define','lodash','../../config/logger'];(function(_0x43cd9f,_0x57d758){var _0x5cf244=function(_0xb0bd94){while(--_0xb0bd94){_0x43cd9f['push'](_0x43cd9f['shift']());}};_0x5cf244(++_0x57d758);}(_0x77a0,0x80));var _0x077a=function(_0x2e1a9d,_0x432be1){_0x2e1a9d=_0x2e1a9d-0x0;var _0x27d0e0=_0x77a0[_0x2e1a9d];return _0x27d0e0;};'use strict';var _=require(_0x077a('0x0'));var util=require('util');var logger=require(_0x077a('0x1'))(_0x077a('0x2'));var moment=require(_0x077a('0x3'));var BPromise=require('bluebird');var rp=require(_0x077a('0x4'));var fs=require('fs');var path=require(_0x077a('0x5'));var rimraf=require(_0x077a('0x6'));var config=require('../../config/environment');var attributes=require(_0x077a('0x7'));module[_0x077a('0x8')]=function(_0x3c7541,_0x56941b){return _0x3c7541[_0x077a('0x9')]('UserWhatsappQueue',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 450d94b..15a5e93 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 _0xc928=['bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','info','UserWhatsappQueue,\x20%s,\x20%s','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','moment'];(function(_0x3a6396,_0x574026){var _0x17df6a=function(_0x1581aa){while(--_0x1581aa){_0x3a6396['push'](_0x3a6396['shift']());}};_0x17df6a(++_0x574026);}(_0xc928,0x1c6));var _0x8c92=function(_0xb59e54,_0x280cff){_0xb59e54=_0xb59e54-0x0;var _0x3a6583=_0xc928[_0xb59e54];return _0x3a6583;};'use strict';var _=require(_0x8c92('0x0'));var util=require('util');var moment=require(_0x8c92('0x1'));var BPromise=require(_0x8c92('0x2'));var rs=require(_0x8c92('0x3'));var fs=require('fs');var Redis=require(_0x8c92('0x4'));var db=require(_0x8c92('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8c92('0x6'));var jayson=require(_0x8c92('0x7'));var client=jayson[_0x8c92('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14d43e,_0x5cec65,_0x59adbf){return new BPromise(function(_0x572eba,_0x203408){return client[_0x8c92('0x9')](_0x14d43e,_0x59adbf)['then'](function(_0x4440d7){logger[_0x8c92('0xa')](_0x8c92('0xb'),_0x5cec65,'request\x20sent');logger['debug'](_0x8c92('0xc'),_0x5cec65,'request\x20sent',JSON['stringify'](_0x4440d7));if(_0x4440d7[_0x8c92('0xd')]){if(_0x4440d7[_0x8c92('0xd')][_0x8c92('0xe')]===0x1f4){logger[_0x8c92('0xd')](_0x8c92('0xb'),_0x5cec65,_0x4440d7['error']['message']);return _0x203408(_0x4440d7[_0x8c92('0xd')][_0x8c92('0xf')]);}logger[_0x8c92('0xd')](_0x8c92('0xb'),_0x5cec65,_0x4440d7['error'][_0x8c92('0xf')]);return _0x572eba(_0x4440d7[_0x8c92('0xd')]['message']);}else{logger[_0x8c92('0xa')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5cec65,_0x8c92('0x10'));_0x572eba(_0x4440d7[_0x8c92('0x11')][_0x8c92('0xf')]);}})[_0x8c92('0x12')](function(_0x4de23f){logger[_0x8c92('0xd')](_0x8c92('0xb'),_0x5cec65,_0x4de23f);_0x203408(_0x4de23f);});});} \ No newline at end of file +var _0x4120=['message','catch','util','moment','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x23866e,_0x594bc7){var _0x2ce57f=function(_0x112c79){while(--_0x112c79){_0x23866e['push'](_0x23866e['shift']());}};_0x2ce57f(++_0x594bc7);}(_0x4120,0xad));var _0x0412=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x4120[_0x550d12];return _0x12103d;};'use strict';var _=require('lodash');var util=require(_0x0412('0x0'));var moment=require(_0x0412('0x1'));var BPromise=require('bluebird');var rs=require(_0x0412('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0412('0x3'))(_0x0412('0x4'));var config=require('../../config/environment');var jayson=require(_0x0412('0x5'));var client=jayson[_0x0412('0x6')][_0x0412('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4872a4,_0x81ad6d,_0x1cbf5d){return new BPromise(function(_0xc0721d,_0xe1ac12){return client[_0x0412('0x8')](_0x4872a4,_0x1cbf5d)[_0x0412('0x9')](function(_0x360500){logger[_0x0412('0xa')](_0x0412('0xb'),_0x81ad6d,'request\x20sent');logger['debug'](_0x0412('0xc'),_0x81ad6d,_0x0412('0xd'),JSON[_0x0412('0xe')](_0x360500));if(_0x360500[_0x0412('0xf')]){if(_0x360500[_0x0412('0xf')][_0x0412('0x10')]===0x1f4){logger['error'](_0x0412('0xb'),_0x81ad6d,_0x360500['error'][_0x0412('0x11')]);return _0xe1ac12(_0x360500[_0x0412('0xf')][_0x0412('0x11')]);}logger[_0x0412('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x81ad6d,_0x360500[_0x0412('0xf')][_0x0412('0x11')]);return _0xc0721d(_0x360500[_0x0412('0xf')]['message']);}else{logger[_0x0412('0xa')](_0x0412('0xb'),_0x81ad6d,_0x0412('0xd'));_0xc0721d(_0x360500['result'][_0x0412('0x11')]);}})[_0x0412('0x12')](function(_0x3172e2){logger[_0x0412('0xf')](_0x0412('0xb'),_0x81ad6d,_0x3172e2);_0xe1ac12(_0x3172e2);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 3a2de6e..dbfff88 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 _0xcb81=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','index','isAuthenticated','show','post','create','update','delete','/:id','destroy','exports','multer','util'];(function(_0x40b944,_0x112d71){var _0x34a3f2=function(_0xd3f18b){while(--_0xd3f18b){_0x40b944['push'](_0x40b944['shift']());}};_0x34a3f2(++_0x112d71);}(_0xcb81,0x154));var _0x1cb8=function(_0x154cb5,_0x1a8d5a){_0x154cb5=_0x154cb5-0x0;var _0x3f574f=_0xcb81[_0x154cb5];return _0x3f574f;};'use strict';var multer=require(_0x1cb8('0x0'));var util=require(_0x1cb8('0x1'));var path=require('path');var timeout=require(_0x1cb8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1cb8('0x3'));var interaction=require(_0x1cb8('0x4'));var config=require(_0x1cb8('0x5'));var controller=require(_0x1cb8('0x6'));router[_0x1cb8('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb8('0x8')]);router[_0x1cb8('0x7')]('/:id',auth[_0x1cb8('0x9')](),controller[_0x1cb8('0xa')]);router[_0x1cb8('0xb')]('/',auth['isAuthenticated'](),controller[_0x1cb8('0xc')]);router['put']('/:id',auth[_0x1cb8('0x9')](),controller[_0x1cb8('0xd')]);router[_0x1cb8('0xe')](_0x1cb8('0xf'),auth[_0x1cb8('0x9')](),controller[_0x1cb8('0x10')]);module[_0x1cb8('0x11')]=router; \ No newline at end of file +var _0xbf83=['connect-timeout','express','Router','fs-extra','../../config/environment','./variable.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0xbf83,0x11e));var _0x3bf8=function(_0x16f3d7,_0x3d8d0b){_0x16f3d7=_0x16f3d7-0x0;var _0x4552de=_0xbf83[_0x16f3d7];return _0x4552de;};'use strict';var multer=require(_0x3bf8('0x0'));var util=require('util');var path=require(_0x3bf8('0x1'));var timeout=require(_0x3bf8('0x2'));var express=require(_0x3bf8('0x3'));var router=express[_0x3bf8('0x4')]();var fs_extra=require(_0x3bf8('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3bf8('0x6'));var controller=require(_0x3bf8('0x7'));router[_0x3bf8('0x8')]('/',auth[_0x3bf8('0x9')](),controller['index']);router['get'](_0x3bf8('0xa'),auth[_0x3bf8('0x9')](),controller['show']);router[_0x3bf8('0xb')]('/',auth['isAuthenticated'](),controller[_0x3bf8('0xc')]);router[_0x3bf8('0xd')](_0x3bf8('0xa'),auth[_0x3bf8('0x9')](),controller[_0x3bf8('0xe')]);router[_0x3bf8('0xf')](_0x3bf8('0xa'),auth['isAuthenticated'](),controller[_0x3bf8('0x10')]);module[_0x3bf8('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 44f0bc4..f665bf0 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 _0xbbd8=['sequelize','exports','STRING','name'];(function(_0xb0c31b,_0x2b1095){var _0x2465f8=function(_0x4dc02b){while(--_0x4dc02b){_0xb0c31b['push'](_0xb0c31b['shift']());}};_0x2465f8(++_0x2b1095);}(_0xbbd8,0x174));var _0x8bbd=function(_0x56df16,_0x4a11eb){_0x56df16=_0x56df16-0x0;var _0x54eb68=_0xbbd8[_0x56df16];return _0x54eb68;};'use strict';var Sequelize=require(_0x8bbd('0x0'));module[_0x8bbd('0x1')]={'name':{'type':Sequelize[_0x8bbd('0x2')],'unique':_0x8bbd('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8bbd('0x2')]}}; \ No newline at end of file +var _0xb0bf=['exports','STRING'];(function(_0x32d006,_0x1d5f9a){var _0x5616f5=function(_0x5ed32f){while(--_0x5ed32f){_0x32d006['push'](_0x32d006['shift']());}};_0x5616f5(++_0x1d5f9a);}(_0xb0bf,0xf4));var _0xfb0b=function(_0x5a5326,_0x29991a){_0x5a5326=_0x5a5326-0x0;var _0x37c270=_0xb0bf[_0x5a5326];return _0x37c270;};'use strict';var Sequelize=require('sequelize');module[_0xfb0b('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfb0b('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index bf0bc7a..30766be 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 _0x6340=['fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','get','Variables','UserProfileResource','end','error','name','send','index','map','Variable','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir'];(function(_0xe36749,_0x2a45c8){var _0x5d86b7=function(_0x1219e5){while(--_0x1219e5){_0xe36749['push'](_0xe36749['shift']());}};_0x5d86b7(++_0x2a45c8);}(_0x6340,0x1de));var _0x0634=function(_0x48783c,_0x1f986b){_0x48783c=_0x48783c-0x0;var _0x2ce586=_0x6340[_0x48783c];return _0x2ce586;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0634('0x0'));var zipdir=require(_0x0634('0x1'));var jsonpatch=require(_0x0634('0x2'));var rp=require(_0x0634('0x3'));var moment=require(_0x0634('0x4'));var BPromise=require(_0x0634('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0634('0x6'));var ejs=require(_0x0634('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0634('0x8'));var squel=require(_0x0634('0x9'));var crypto=require(_0x0634('0xa'));var jsforce=require(_0x0634('0xb'));var deskjs=require(_0x0634('0xc'));var toCsv=require(_0x0634('0x6'));var querystring=require(_0x0634('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0634('0xe'));var as=require(_0x0634('0xf'));var hardwareService=require(_0x0634('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x0634('0x11'));var config=require(_0x0634('0x12'));var licenseUtil=require(_0x0634('0x13'));var db=require(_0x0634('0x14'))['db'];function respondWithStatusCode(_0xbdd1f1,_0x1a1fd2){_0x1a1fd2=_0x1a1fd2||0xcc;return function(_0x3aff0f){if(_0x3aff0f){return _0xbdd1f1[_0x0634('0x15')](_0x1a1fd2);}return _0xbdd1f1['status'](_0x1a1fd2)['end']();};}function respondWithResult(_0x3c2bb0,_0x3c216c){_0x3c216c=_0x3c216c||0xc8;return function(_0x11368d){if(_0x11368d){return _0x3c2bb0[_0x0634('0x16')](_0x3c216c)[_0x0634('0x17')](_0x11368d);}};}function respondWithFilteredResult(_0x594336,_0x5076e8){return function(_0x27e320){if(_0x27e320){var _0x45d943=typeof _0x5076e8['offset']==='undefined'&&typeof _0x5076e8[_0x0634('0x18')]===_0x0634('0x19');var _0xfba278=_0x27e320[_0x0634('0x1a')];var _0x224278=_0x45d943?0x0:_0x5076e8[_0x0634('0x1b')];var _0x5845e2=_0x45d943?_0x27e320[_0x0634('0x1a')]:_0x5076e8['offset']+_0x5076e8['limit'];var _0x3172c0;if(_0x5845e2>=_0xfba278){_0x5845e2=_0xfba278;_0x3172c0=0xc8;}else{_0x3172c0=0xce;}_0x594336[_0x0634('0x16')](_0x3172c0);return _0x594336['set'](_0x0634('0x1c'),_0x224278+'-'+_0x5845e2+'/'+_0xfba278)[_0x0634('0x17')](_0x27e320);}return null;};}function patchUpdates(_0x2c93af){return function(_0x4a96bd){try{jsonpatch['apply'](_0x4a96bd,_0x2c93af,!![]);}catch(_0x3e6e0f){return BPromise[_0x0634('0x1d')](_0x3e6e0f);}return _0x4a96bd[_0x0634('0x1e')]();};}function saveUpdates(_0x4fa898,_0x4344ef){return function(_0x26a178){if(_0x26a178){return _0x26a178[_0x0634('0x1f')](_0x4fa898)[_0x0634('0x20')](function(_0x358b51){return _0x358b51;});}return null;};}function removeEntity(_0x2d9f8e,_0x53a754){return function(_0xd36d92){if(_0xd36d92){return _0xd36d92[_0x0634('0x21')]()['then'](function(){var _0x2025c2=_0xd36d92[_0x0634('0x22')]({'plain':!![]});var _0x301190=_0x0634('0x23');return db[_0x0634('0x24')]['destroy']({'where':{'type':_0x301190,'resourceId':_0x2025c2['id']}})[_0x0634('0x20')](function(){return _0xd36d92;});})[_0x0634('0x20')](function(){_0x2d9f8e[_0x0634('0x16')](0xcc)[_0x0634('0x25')]();});}};}function handleEntityNotFound(_0x133bfc,_0x8a445c){return function(_0x146b9e){if(!_0x146b9e){_0x133bfc[_0x0634('0x15')](0x194);}return _0x146b9e;};}function handleError(_0x9cfd8a,_0x26b755){_0x26b755=_0x26b755||0x1f4;return function(_0x108c15){logger[_0x0634('0x26')](_0x108c15['stack']);if(_0x108c15[_0x0634('0x27')]){delete _0x108c15[_0x0634('0x27')];}_0x9cfd8a[_0x0634('0x16')](_0x26b755)[_0x0634('0x28')](_0x108c15);};}exports[_0x0634('0x29')]=function(_0x2988e4,_0x296d02){var _0x4144db={},_0x391f44={},_0x32ece7={'count':0x0,'rows':[]};var _0x45ae7a=_[_0x0634('0x2a')](db[_0x0634('0x2b')]['rawAttributes'],function(_0x138bf7){return{'name':_0x138bf7[_0x0634('0x2c')],'type':_0x138bf7[_0x0634('0x2d')][_0x0634('0x2e')]};});_0x391f44[_0x0634('0x2f')]=_[_0x0634('0x2a')](_0x45ae7a,_0x0634('0x27'));_0x391f44[_0x0634('0x30')]=_[_0x0634('0x31')](_0x2988e4[_0x0634('0x30')]);_0x391f44['filters']=_['intersection'](_0x391f44[_0x0634('0x2f')],_0x391f44[_0x0634('0x30')]);_0x4144db[_0x0634('0x32')]=_[_0x0634('0x33')](_0x391f44['model'],qs[_0x0634('0x34')](_0x2988e4[_0x0634('0x30')][_0x0634('0x34')]));_0x4144db[_0x0634('0x32')]=_0x4144db[_0x0634('0x32')][_0x0634('0x35')]?_0x4144db[_0x0634('0x32')]:_0x391f44[_0x0634('0x2f')];if(!_0x2988e4[_0x0634('0x30')][_0x0634('0x36')](_0x0634('0x37'))){_0x4144db[_0x0634('0x18')]=qs[_0x0634('0x18')](_0x2988e4[_0x0634('0x30')]['limit']);_0x4144db['offset']=qs[_0x0634('0x1b')](_0x2988e4['query']['offset']);}_0x4144db['order']=qs[_0x0634('0x38')](_0x2988e4['query'][_0x0634('0x38')]);_0x4144db['where']=qs[_0x0634('0x39')](_[_0x0634('0x3a')](_0x2988e4[_0x0634('0x30')],_0x391f44['filters']),_0x45ae7a);if(_0x2988e4[_0x0634('0x30')][_0x0634('0x3b')]){_0x4144db[_0x0634('0x3c')]=_[_0x0634('0x3d')](_0x4144db['where'],{'$or':_[_0x0634('0x2a')](_0x45ae7a,function(_0x3cf433){if(_0x3cf433[_0x0634('0x2d')]!==_0x0634('0x3e')){var _0x1a4967={};_0x1a4967[_0x3cf433['name']]={'$like':'%'+_0x2988e4[_0x0634('0x30')][_0x0634('0x3b')]+'%'};return _0x1a4967;}})});}_0x4144db=_[_0x0634('0x3d')]({},_0x4144db,_0x2988e4[_0x0634('0x3f')]);var _0x153f53={'where':_0x4144db[_0x0634('0x3c')]};return db[_0x0634('0x2b')][_0x0634('0x1a')](_0x153f53)[_0x0634('0x20')](function(_0x3ba1fc){_0x32ece7[_0x0634('0x1a')]=_0x3ba1fc;if(_0x2988e4[_0x0634('0x30')][_0x0634('0x40')]){_0x4144db[_0x0634('0x41')]=[{'all':!![]}];}return db['Variable'][_0x0634('0x42')](_0x4144db);})['then'](function(_0x15b821){_0x32ece7['rows']=_0x15b821;return _0x32ece7;})['then'](respondWithFilteredResult(_0x296d02,_0x4144db))[_0x0634('0x43')](handleError(_0x296d02,null));};exports[_0x0634('0x44')]=function(_0x5b2ce4,_0x15c267){var _0x2ae907={'raw':!![],'where':{'id':_0x5b2ce4[_0x0634('0x45')]['id']}},_0x531e51={};_0x531e51['model']=_['keys'](db['Variable'][_0x0634('0x46')]);_0x531e51[_0x0634('0x30')]=_[_0x0634('0x31')](_0x5b2ce4['query']);_0x531e51[_0x0634('0x39')]=_['intersection'](_0x531e51[_0x0634('0x2f')],_0x531e51['query']);_0x2ae907[_0x0634('0x32')]=_[_0x0634('0x33')](_0x531e51[_0x0634('0x2f')],qs[_0x0634('0x34')](_0x5b2ce4[_0x0634('0x30')][_0x0634('0x34')]));_0x2ae907[_0x0634('0x32')]=_0x2ae907[_0x0634('0x32')]['length']?_0x2ae907[_0x0634('0x32')]:_0x531e51[_0x0634('0x2f')];if(_0x5b2ce4[_0x0634('0x30')][_0x0634('0x40')]){_0x2ae907[_0x0634('0x41')]=[{'all':!![]}];}_0x2ae907=_[_0x0634('0x3d')]({},_0x2ae907,_0x5b2ce4['options']);return db[_0x0634('0x2b')][_0x0634('0x47')](_0x2ae907)[_0x0634('0x20')](handleEntityNotFound(_0x15c267,null))[_0x0634('0x20')](respondWithResult(_0x15c267,null))[_0x0634('0x43')](handleError(_0x15c267,null));};exports[_0x0634('0x48')]=function(_0x34fec5,_0x15df69){return db[_0x0634('0x2b')][_0x0634('0x48')](_0x34fec5[_0x0634('0x49')],{})[_0x0634('0x20')](function(_0xec26aa){var _0x35be11=_0x34fec5['user']['get']({'plain':!![]});if(!_0x35be11)throw new Error(_0x0634('0x4a'));if(_0x35be11['role']===_0x0634('0x4b')){var _0x43f05d=_0xec26aa[_0x0634('0x22')]({'plain':!![]});var _0x4da8a2=_0x0634('0x23');return db[_0x0634('0x4c')]['find']({'where':{'name':_0x4da8a2,'userProfileId':_0x35be11[_0x0634('0x4d')]},'raw':!![]})[_0x0634('0x20')](function(_0x39d09a){if(_0x39d09a&&_0x39d09a[_0x0634('0x4e')]===0x0){return db[_0x0634('0x24')][_0x0634('0x48')]({'name':_0x43f05d['name'],'resourceId':_0x43f05d['id'],'type':_0x39d09a[_0x0634('0x27')],'sectionId':_0x39d09a['id']},{})['then'](function(){return _0xec26aa;});}else{return _0xec26aa;}})[_0x0634('0x43')](function(_0x3b3160){logger[_0x0634('0x26')](_0x0634('0x4f'),_0x3b3160);throw _0x3b3160;});}return _0xec26aa;})[_0x0634('0x20')](respondWithResult(_0x15df69,0xc9))[_0x0634('0x43')](handleError(_0x15df69,null));};exports['update']=function(_0x5b5d55,_0x2cba4d){if(_0x5b5d55['body']['id']){delete _0x5b5d55[_0x0634('0x49')]['id'];}return db[_0x0634('0x2b')][_0x0634('0x47')]({'where':{'id':_0x5b5d55[_0x0634('0x45')]['id']}})[_0x0634('0x20')](handleEntityNotFound(_0x2cba4d,null))[_0x0634('0x20')](saveUpdates(_0x5b5d55[_0x0634('0x49')],null))['then'](respondWithResult(_0x2cba4d,null))[_0x0634('0x43')](handleError(_0x2cba4d,null));};exports[_0x0634('0x21')]=function(_0xf3711a,_0x1c026c){return db[_0x0634('0x2b')]['find']({'where':{'id':_0xf3711a[_0x0634('0x45')]['id']}})[_0x0634('0x20')](handleEntityNotFound(_0x1c026c,null))[_0x0634('0x20')](removeEntity(_0x1c026c,null))[_0x0634('0x43')](handleError(_0x1c026c,null));}; \ No newline at end of file +var _0x8eb4=['util','path','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','name','index','Variable','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','map','VIRTUAL','filter','merge','options','includeAll','include','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x8eb4,0xe2));var _0x48eb=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0x8eb4[_0x256d6a];return _0x460058;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x48eb('0x0'));var zipdir=require(_0x48eb('0x1'));var jsonpatch=require(_0x48eb('0x2'));var rp=require(_0x48eb('0x3'));var moment=require(_0x48eb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x48eb('0x5'));var path=require(_0x48eb('0x6'));var sox=require('sox');var csv=require(_0x48eb('0x7'));var ejs=require(_0x48eb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x48eb('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x48eb('0xa'));var toCsv=require('to-csv');var querystring=require(_0x48eb('0xb'));var Papa=require(_0x48eb('0xc'));var Redis=require(_0x48eb('0xd'));var authService=require(_0x48eb('0xe'));var qs=require(_0x48eb('0xf'));var as=require(_0x48eb('0x10'));var hardwareService=require(_0x48eb('0x11'));var logger=require(_0x48eb('0x12'))('api');var utils=require(_0x48eb('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x48eb('0x14'))['db'];function respondWithStatusCode(_0x2181e7,_0x469991){_0x469991=_0x469991||0xcc;return function(_0x4bf8b3){if(_0x4bf8b3){return _0x2181e7[_0x48eb('0x15')](_0x469991);}return _0x2181e7[_0x48eb('0x16')](_0x469991)['end']();};}function respondWithResult(_0xce80b6,_0x383d55){_0x383d55=_0x383d55||0xc8;return function(_0x1bd6ad){if(_0x1bd6ad){return _0xce80b6['status'](_0x383d55)['json'](_0x1bd6ad);}};}function respondWithFilteredResult(_0x5a0b95,_0x4e33a1){return function(_0x61a093){if(_0x61a093){var _0x2cbcb7=typeof _0x4e33a1[_0x48eb('0x17')]===_0x48eb('0x18')&&typeof _0x4e33a1[_0x48eb('0x19')]===_0x48eb('0x18');var _0x3df7a8=_0x61a093[_0x48eb('0x1a')];var _0x3f9217=_0x2cbcb7?0x0:_0x4e33a1[_0x48eb('0x17')];var _0x4f47fb=_0x2cbcb7?_0x61a093[_0x48eb('0x1a')]:_0x4e33a1['offset']+_0x4e33a1[_0x48eb('0x19')];var _0x184492;if(_0x4f47fb>=_0x3df7a8){_0x4f47fb=_0x3df7a8;_0x184492=0xc8;}else{_0x184492=0xce;}_0x5a0b95['status'](_0x184492);return _0x5a0b95['set']('Content-Range',_0x3f9217+'-'+_0x4f47fb+'/'+_0x3df7a8)[_0x48eb('0x1b')](_0x61a093);}return null;};}function patchUpdates(_0x560092){return function(_0xea1b20){try{jsonpatch[_0x48eb('0x1c')](_0xea1b20,_0x560092,!![]);}catch(_0x21124c){return BPromise[_0x48eb('0x1d')](_0x21124c);}return _0xea1b20[_0x48eb('0x1e')]();};}function saveUpdates(_0x5e1d8e,_0x2d20fd){return function(_0x478ea3){if(_0x478ea3){return _0x478ea3[_0x48eb('0x1f')](_0x5e1d8e)[_0x48eb('0x20')](function(_0x5a2b0c){return _0x5a2b0c;});}return null;};}function removeEntity(_0x288866,_0x41be9d){return function(_0x2e76bd){if(_0x2e76bd){return _0x2e76bd[_0x48eb('0x21')]()[_0x48eb('0x20')](function(){var _0x3261f6=_0x2e76bd[_0x48eb('0x22')]({'plain':!![]});var _0x5eff68=_0x48eb('0x23');return db[_0x48eb('0x24')][_0x48eb('0x21')]({'where':{'type':_0x5eff68,'resourceId':_0x3261f6['id']}})[_0x48eb('0x20')](function(){return _0x2e76bd;});})[_0x48eb('0x20')](function(){_0x288866[_0x48eb('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x299bfa,_0x34983b){return function(_0x3deeb1){if(!_0x3deeb1){_0x299bfa[_0x48eb('0x15')](0x194);}return _0x3deeb1;};}function handleError(_0x3f7a40,_0x5c66fd){_0x5c66fd=_0x5c66fd||0x1f4;return function(_0x307df4){logger['error'](_0x307df4['stack']);if(_0x307df4[_0x48eb('0x25')]){delete _0x307df4[_0x48eb('0x25')];}_0x3f7a40[_0x48eb('0x16')](_0x5c66fd)['send'](_0x307df4);};}exports[_0x48eb('0x26')]=function(_0x2266a1,_0x1e126f){var _0x4de1e2={},_0x2895f7={},_0x482825={'count':0x0,'rows':[]};var _0x2e3b08=_['map'](db[_0x48eb('0x27')][_0x48eb('0x28')],function(_0x13bc68){return{'name':_0x13bc68[_0x48eb('0x29')],'type':_0x13bc68[_0x48eb('0x2a')]['key']};});_0x2895f7[_0x48eb('0x2b')]=_['map'](_0x2e3b08,'name');_0x2895f7[_0x48eb('0x2c')]=_[_0x48eb('0x2d')](_0x2266a1['query']);_0x2895f7['filters']=_[_0x48eb('0x2e')](_0x2895f7[_0x48eb('0x2b')],_0x2895f7[_0x48eb('0x2c')]);_0x4de1e2['attributes']=_[_0x48eb('0x2e')](_0x2895f7[_0x48eb('0x2b')],qs[_0x48eb('0x2f')](_0x2266a1[_0x48eb('0x2c')][_0x48eb('0x2f')]));_0x4de1e2['attributes']=_0x4de1e2[_0x48eb('0x30')][_0x48eb('0x31')]?_0x4de1e2['attributes']:_0x2895f7['model'];if(!_0x2266a1[_0x48eb('0x2c')][_0x48eb('0x32')](_0x48eb('0x33'))){_0x4de1e2['limit']=qs[_0x48eb('0x19')](_0x2266a1[_0x48eb('0x2c')][_0x48eb('0x19')]);_0x4de1e2[_0x48eb('0x17')]=qs['offset'](_0x2266a1[_0x48eb('0x2c')][_0x48eb('0x17')]);}_0x4de1e2[_0x48eb('0x34')]=qs[_0x48eb('0x35')](_0x2266a1[_0x48eb('0x2c')]['sort']);_0x4de1e2[_0x48eb('0x36')]=qs[_0x48eb('0x37')](_[_0x48eb('0x38')](_0x2266a1[_0x48eb('0x2c')],_0x2895f7[_0x48eb('0x37')]),_0x2e3b08);if(_0x2266a1[_0x48eb('0x2c')]['filter']){_0x4de1e2[_0x48eb('0x36')]=_['merge'](_0x4de1e2[_0x48eb('0x36')],{'$or':_[_0x48eb('0x39')](_0x2e3b08,function(_0x192ab1){if(_0x192ab1[_0x48eb('0x2a')]!==_0x48eb('0x3a')){var _0x509e3e={};_0x509e3e[_0x192ab1['name']]={'$like':'%'+_0x2266a1['query'][_0x48eb('0x3b')]+'%'};return _0x509e3e;}})});}_0x4de1e2=_[_0x48eb('0x3c')]({},_0x4de1e2,_0x2266a1[_0x48eb('0x3d')]);var _0x33c98b={'where':_0x4de1e2[_0x48eb('0x36')]};return db[_0x48eb('0x27')][_0x48eb('0x1a')](_0x33c98b)[_0x48eb('0x20')](function(_0x2ca311){_0x482825[_0x48eb('0x1a')]=_0x2ca311;if(_0x2266a1['query'][_0x48eb('0x3e')]){_0x4de1e2[_0x48eb('0x3f')]=[{'all':!![]}];}return db[_0x48eb('0x27')]['findAll'](_0x4de1e2);})[_0x48eb('0x20')](function(_0x29eb22){_0x482825['rows']=_0x29eb22;return _0x482825;})[_0x48eb('0x20')](respondWithFilteredResult(_0x1e126f,_0x4de1e2))[_0x48eb('0x40')](handleError(_0x1e126f,null));};exports[_0x48eb('0x41')]=function(_0x2090c6,_0x2b6b9e){var _0x10e3ad={'raw':!![],'where':{'id':_0x2090c6['params']['id']}},_0x28ae12={};_0x28ae12[_0x48eb('0x2b')]=_['keys'](db['Variable'][_0x48eb('0x28')]);_0x28ae12[_0x48eb('0x2c')]=_[_0x48eb('0x2d')](_0x2090c6[_0x48eb('0x2c')]);_0x28ae12[_0x48eb('0x37')]=_['intersection'](_0x28ae12[_0x48eb('0x2b')],_0x28ae12['query']);_0x10e3ad['attributes']=_[_0x48eb('0x2e')](_0x28ae12[_0x48eb('0x2b')],qs[_0x48eb('0x2f')](_0x2090c6[_0x48eb('0x2c')][_0x48eb('0x2f')]));_0x10e3ad[_0x48eb('0x30')]=_0x10e3ad[_0x48eb('0x30')][_0x48eb('0x31')]?_0x10e3ad[_0x48eb('0x30')]:_0x28ae12[_0x48eb('0x2b')];if(_0x2090c6[_0x48eb('0x2c')][_0x48eb('0x3e')]){_0x10e3ad[_0x48eb('0x3f')]=[{'all':!![]}];}_0x10e3ad=_[_0x48eb('0x3c')]({},_0x10e3ad,_0x2090c6['options']);return db['Variable'][_0x48eb('0x42')](_0x10e3ad)[_0x48eb('0x20')](handleEntityNotFound(_0x2b6b9e,null))[_0x48eb('0x20')](respondWithResult(_0x2b6b9e,null))[_0x48eb('0x40')](handleError(_0x2b6b9e,null));};exports[_0x48eb('0x43')]=function(_0x3b6465,_0x338e6b){return db[_0x48eb('0x27')][_0x48eb('0x43')](_0x3b6465[_0x48eb('0x44')],{})[_0x48eb('0x20')](function(_0x148af3){var _0x59c907=_0x3b6465['user'][_0x48eb('0x22')]({'plain':!![]});if(!_0x59c907)throw new Error(_0x48eb('0x45'));if(_0x59c907[_0x48eb('0x46')]===_0x48eb('0x47')){var _0x3d78c1=_0x148af3['get']({'plain':!![]});var _0x30f97b='Variables';return db[_0x48eb('0x48')][_0x48eb('0x42')]({'where':{'name':_0x30f97b,'userProfileId':_0x59c907[_0x48eb('0x49')]},'raw':!![]})['then'](function(_0xb5942a){if(_0xb5942a&&_0xb5942a[_0x48eb('0x4a')]===0x0){return db[_0x48eb('0x24')][_0x48eb('0x43')]({'name':_0x3d78c1[_0x48eb('0x25')],'resourceId':_0x3d78c1['id'],'type':_0xb5942a['name'],'sectionId':_0xb5942a['id']},{})['then'](function(){return _0x148af3;});}else{return _0x148af3;}})[_0x48eb('0x40')](function(_0x207841){logger['error'](_0x48eb('0x4b'),_0x207841);throw _0x207841;});}return _0x148af3;})[_0x48eb('0x20')](respondWithResult(_0x338e6b,0xc9))[_0x48eb('0x40')](handleError(_0x338e6b,null));};exports['update']=function(_0x1f02ca,_0x2564c4){if(_0x1f02ca[_0x48eb('0x44')]['id']){delete _0x1f02ca[_0x48eb('0x44')]['id'];}return db[_0x48eb('0x27')][_0x48eb('0x42')]({'where':{'id':_0x1f02ca[_0x48eb('0x4c')]['id']}})[_0x48eb('0x20')](handleEntityNotFound(_0x2564c4,null))[_0x48eb('0x20')](saveUpdates(_0x1f02ca[_0x48eb('0x44')],null))[_0x48eb('0x20')](respondWithResult(_0x2564c4,null))['catch'](handleError(_0x2564c4,null));};exports[_0x48eb('0x21')]=function(_0x3f02e3,_0x177ee8){return db['Variable'][_0x48eb('0x42')]({'where':{'id':_0x3f02e3['params']['id']}})[_0x48eb('0x20')](handleEntityNotFound(_0x177ee8,null))[_0x48eb('0x20')](removeEntity(_0x177ee8,null))['catch'](handleError(_0x177ee8,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index fe1eb5b..eaa00c8 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 _0xa4b1=['path','rimraf','./variable.attributes','exports','define','Variable','tools_variables','lodash','../../config/logger','api'];(function(_0x1e1bb5,_0x23b4e9){var _0x413b4c=function(_0x1483c1){while(--_0x1483c1){_0x1e1bb5['push'](_0x1e1bb5['shift']());}};_0x413b4c(++_0x23b4e9);}(_0xa4b1,0x101));var _0x1a4b=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xa4b1[_0x42f009];return _0x22a1e0;};'use strict';var _=require(_0x1a4b('0x0'));var util=require('util');var logger=require(_0x1a4b('0x1'))(_0x1a4b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a4b('0x3'));var rimraf=require(_0x1a4b('0x4'));var config=require('../../config/environment');var attributes=require(_0x1a4b('0x5'));module[_0x1a4b('0x6')]=function(_0x730f92,_0x853475){return _0x730f92[_0x1a4b('0x7')](_0x1a4b('0x8'),attributes,{'tableName':_0x1a4b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd061=['rimraf','./variable.attributes','Variable','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4eeca4,_0x5901c9){var _0x430031=function(_0x237ed7){while(--_0x237ed7){_0x4eeca4['push'](_0x4eeca4['shift']());}};_0x430031(++_0x5901c9);}(_0xd061,0x1a7));var _0x1d06=function(_0x2abe32,_0x4552e3){_0x2abe32=_0x2abe32-0x0;var _0x10e780=_0xd061[_0x2abe32];return _0x10e780;};'use strict';var _=require(_0x1d06('0x0'));var util=require('util');var logger=require(_0x1d06('0x1'))(_0x1d06('0x2'));var moment=require(_0x1d06('0x3'));var BPromise=require(_0x1d06('0x4'));var rp=require(_0x1d06('0x5'));var fs=require('fs');var path=require(_0x1d06('0x6'));var rimraf=require(_0x1d06('0x7'));var config=require('../../config/environment');var attributes=require(_0x1d06('0x8'));module['exports']=function(_0x266731,_0xcefa7f){return _0x266731['define'](_0x1d06('0x9'),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 51a4ee1..01addd0 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0xcf5935,_0x224ee5){var _0x390f65=function(_0x11f77d){while(--_0x11f77d){_0xcf5935['push'](_0xcf5935['shift']());}};_0x390f65(++_0x224ee5);}(_0x814b,0x1a2));var _0xb814=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0x814b[_0x2d982d];return _0x4f36b0;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file +var _0x7fbe=['stringify','error','code','message','result','catch','Variable','find','options','where','attributes','include','map','model','info','ShowVariable','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0xc1a76b,_0x2f5e83){var _0x537b78=function(_0x4491db){while(--_0x4491db){_0xc1a76b['push'](_0xc1a76b['shift']());}};_0x537b78(++_0x2f5e83);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2014e7,_0x2bd284){_0x2014e7=_0x2014e7-0x0;var _0x29452d=_0x7fbe[_0x2014e7];return _0x29452d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}exports['ShowVariable']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')]({'raw':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]||null:null,'attributes':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1c')]||null:null,'include':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1d')]?_[_0xe7fb('0x1e')](_0x293a47['options'][_0xe7fb('0x1d')],function(_0x469ead){return{'model':db[_0x469ead['model']],'as':_0x469ead['as'],'attributes':_0x469ead['attributes'],'include':_0x469ead['include']?_[_0xe7fb('0x1e')](_0x469ead['include'],function(_0x49b219){return{'model':db[_0x49b219[_0xe7fb('0x1f')]],'as':_0x49b219['as'],'attributes':_0x49b219[_0xe7fb('0x1c')],'include':_0x49b219[_0xe7fb('0x1d')]?_['map'](_0x49b219[_0xe7fb('0x1d')],function(_0x2b69c4){return{'model':db[_0x2b69c4[_0xe7fb('0x1f')]],'as':_0x2b69c4['as'],'attributes':_0x2b69c4[_0xe7fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe7fb('0xd')](function(_0x16237a){logger[_0xe7fb('0x20')]('ShowVariable',_0x293a47);logger['debug'](_0xe7fb('0x21'),_0x293a47,JSON[_0xe7fb('0x12')](_0x16237a));_0x1e77fd(_0x16237a);})[_0xe7fb('0x17')](function(_0x4fd290){logger[_0xe7fb('0x13')](_0xe7fb('0x21'),_0x4fd290[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463[_0xe7fb('0x13')](0x1f4,_0x4fd290[_0xe7fb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 73d2dde..16523fd 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 _0x2d27=['/migrations','exports','express','../../components/auth/service','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','/restart'];(function(_0x3c85b4,_0x42a8b9){var _0x25ddc2=function(_0x184a6e){while(--_0x184a6e){_0x3c85b4['push'](_0x3c85b4['shift']());}};_0x25ddc2(++_0x42a8b9);}(_0x2d27,0x113));var _0x72d2=function(_0x2845e9,_0x2be5bd){_0x2845e9=_0x2845e9-0x0;var _0x1f62d8=_0x2d27[_0x2845e9];return _0x1f62d8;};'use strict';var express=require(_0x72d2('0x0'));var router=express['Router']();var auth=require(_0x72d2('0x1'));var controller=require('./version.controller');router[_0x72d2('0x2')]('/',controller['index']);router[_0x72d2('0x2')](_0x72d2('0x3'),auth[_0x72d2('0x4')](),auth[_0x72d2('0x5')](),controller[_0x72d2('0x6')]);router['get'](_0x72d2('0x7'),auth[_0x72d2('0x4')](),auth['canUpdate'](),controller[_0x72d2('0x8')]);router[_0x72d2('0x2')](_0x72d2('0x9'),auth[_0x72d2('0x4')](),auth[_0x72d2('0x5')](),controller['pull']);router['get'](_0x72d2('0xa'),auth[_0x72d2('0x4')](),controller['restart']);router[_0x72d2('0x2')](_0x72d2('0xb'),controller['migrations']);module[_0x72d2('0xc')]=router; \ No newline at end of file +var _0xbaf4=['restart','/migrations','migrations','exports','express','Router','../../components/auth/service','get','index','/fetch','isAuthenticated','canUpdate','/reset','pull'];(function(_0x8d3b4b,_0xd1db47){var _0x509753=function(_0x2e5ef8){while(--_0x2e5ef8){_0x8d3b4b['push'](_0x8d3b4b['shift']());}};_0x509753(++_0xd1db47);}(_0xbaf4,0x17e));var _0x4baf=function(_0x589576,_0x1660e3){_0x589576=_0x589576-0x0;var _0x506c93=_0xbaf4[_0x589576];return _0x506c93;};'use strict';var express=require(_0x4baf('0x0'));var router=express[_0x4baf('0x1')]();var auth=require(_0x4baf('0x2'));var controller=require('./version.controller');router[_0x4baf('0x3')]('/',controller[_0x4baf('0x4')]);router[_0x4baf('0x3')](_0x4baf('0x5'),auth[_0x4baf('0x6')](),auth[_0x4baf('0x7')](),controller['fetch']);router['get'](_0x4baf('0x8'),auth['isAuthenticated'](),auth['canUpdate'](),controller['reset']);router['get']('/pull',auth[_0x4baf('0x6')](),auth['canUpdate'](),controller[_0x4baf('0x9')]);router['get']('/restart',auth[_0x4baf('0x6')](),controller[_0x4baf('0xa')]);router[_0x4baf('0x3')](_0x4baf('0xb'),controller[_0x4baf('0xc')]);module[_0x4baf('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index cfa9944..e702288 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 _0xd04d=['.js','push','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','exports','version','query','latest','tags','2.0.0','status','fetch','origin','master','error','json','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','length'];(function(_0x5695c7,_0x5db4a8){var _0x15e927=function(_0x85bf04){while(--_0x85bf04){_0x5695c7['push'](_0x5695c7['shift']());}};_0x15e927(++_0x5db4a8);}(_0xd04d,0x75));var _0xdd04=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd04d[_0xfae23b];return _0x200640;};'use strict';var Umzug=require(_0xdd04('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xdd04('0x1'))(module,'version');var compareVersions=require(_0xdd04('0x2'));var exec=require(_0xdd04('0x3'))[_0xdd04('0x4')];var db=require(_0xdd04('0x5'))['db'];var config=require(_0xdd04('0x6'));var pm2=require(_0xdd04('0x7'));var logger=require(_0xdd04('0x8'))(_0xdd04('0x9'));var git=require(_0xdd04('0xa'))(config[_0xdd04('0xb')]);exports['index']=function(_0x5db079,_0x236daf){var _0xb14fca={'current':module[_0xdd04('0xc')][_0xdd04('0xd')],'phonebar':0x2};if(_0x5db079['query']&&_0x5db079[_0xdd04('0xe')][_0xdd04('0xf')]){return git['fetch']()[_0xdd04('0x10')](function(_0x445eab,_0x46531a){_0xb14fca['latest']=(_0x445eab?module[_0xdd04('0xc')][_0xdd04('0xd')]:_0x46531a[_0xdd04('0xf')])||_0xdd04('0x11');return _0x236daf[_0xdd04('0x12')](0xc8)['json'](_0xb14fca);});}else{return _0x236daf[_0xdd04('0x12')](0xc8)['json'](_0xb14fca);}};exports[_0xdd04('0x13')]=function(_0x28fc6d,_0x6f381b){return git[_0xdd04('0x13')]([_0xdd04('0x14'),_0xdd04('0x15')],function(_0x71d950){if(_0x71d950){logger[_0xdd04('0x16')](_0x71d950);return _0x6f381b['status'](0x1f4)[_0xdd04('0x17')](_0x71d950);}logger[_0xdd04('0x18')]('git\x20fetch');return _0x6f381b['status'](0xc8)[_0xdd04('0x17')]({'output':_0xdd04('0x19')});});};exports['reset']=function(_0x7dd409,_0x346643){return git[_0xdd04('0x1a')]([_0xdd04('0x1b'),_0xdd04('0x1c')],function(_0xb4fbef){if(_0xb4fbef){logger[_0xdd04('0x16')](_0xb4fbef);return _0x346643[_0xdd04('0x12')](0x1f4)[_0xdd04('0x17')](_0xb4fbef);}logger[_0xdd04('0x18')](_0xdd04('0x1d'));return _0x346643[_0xdd04('0x12')](0xc8)[_0xdd04('0x17')]({'output':_0xdd04('0x1e')});});};exports['pull']=function(_0x7f62c2,_0x4822e2){exec('npm\x20install\x20--production',function(_0x5121e1,_0x37511b,_0x5e0213){logger[_0xdd04('0x18')](_0x37511b);logger['info'](_0x5e0213);if(_0x5121e1){logger[_0xdd04('0x16')](_0x5121e1);return _0x4822e2[_0xdd04('0x12')](0x1f4)[_0xdd04('0x17')](_0x5121e1);}return _0x4822e2[_0xdd04('0x12')](0xc8)[_0xdd04('0x17')]({'output':_0x37511b});});};exports[_0xdd04('0x1f')]=function(_0x23aa68,_0x690214){return pm2[_0xdd04('0x1f')](_0xdd04('0x20'))[_0xdd04('0x21')](function(_0x102345){logger[_0xdd04('0x18')](_0xdd04('0x22'),_0x102345);return _0x690214[_0xdd04('0x12')](0xc8)[_0xdd04('0x17')]({'output':_0xdd04('0x23')});})[_0xdd04('0x24')](function(_0x570922){logger[_0xdd04('0x16')](_0x570922);return _0x690214['status'](0x1f4)[_0xdd04('0x17')](_0x570922);});};exports['migrations']=function(_0x3de381,_0xe113d1){var _0x1c0263=fs[_0xdd04('0x25')](path[_0xdd04('0x26')](config[_0xdd04('0xb')],_0xdd04('0x27'),_0xdd04('0x28')));var _0x537c9f=[];for(var _0x3497dc=0x0;_0x3497dc<_0x1c0263[_0xdd04('0x29')];_0x3497dc++){var _0x31a718=_0x1c0263[_0x3497dc]['replace'](_0xdd04('0x2a'),'');if(compareVersions(module['exports'][_0xdd04('0xd')],_0x31a718)===-0x1){_0x537c9f[_0xdd04('0x2b')](_0x31a718);}}if(_0x537c9f['length']){var _0x6aac4=_0x537c9f[_0xdd04('0x2c')](compareVersions);var _0x3a6998=new Umzug({'storage':_0xdd04('0x2d'),'storageOptions':{'model':db[_0xdd04('0x2e')],'modelName':_0xdd04('0x2e'),'columnName':_0xdd04('0xd')},'migrations':{'params':[db[_0xdd04('0x2d')][_0xdd04('0x2f')](),db[_0xdd04('0x2d')]['constructor'],function(){throw new Error(_0xdd04('0x30'));}],'path':path[_0xdd04('0x26')](config[_0xdd04('0xb')],_0xdd04('0x27'),_0xdd04('0x28')),'pattern':/\.js$/}});_0x3a6998['up']({'migrations':_[_0xdd04('0x31')](_0x6aac4,function(_0x341fb5){return _0x341fb5+_0xdd04('0x2a');})})[_0xdd04('0x21')](function(){return _0xe113d1[_0xdd04('0x12')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xdd04('0xc')]['version']+_0xdd04('0x32')+_['last'](_0x6aac4),'migrations':_['join'](_0x6aac4)});})[_0xdd04('0x24')](function(_0x23d532){if(_0x23d532 instanceof db[_0xdd04('0x2d')][_0xdd04('0x33')]){return _0xe113d1['status'](0xc8)[_0xdd04('0x17')]({'output':_0xdd04('0x34')});}else{return _0xe113d1[_0xdd04('0x12')](0x1f4)[_0xdd04('0x17')](_0x23d532);}});}else{return _0xe113d1['status'](0xc8)[_0xdd04('0x17')]({'output':_0xdd04('0x34')});}}; \ No newline at end of file +var _0x2064=['last','UniqueConstraintError','umzug','lodash','version','compare-versions','child_process','../../mysqldb','../../config/pm2','../../config/logger','update','index','exports','query','latest','fetch','2.0.0','json','status','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','pm2\x20restart\x20motion\x20%s','catch','readdirSync','join','root','server','migrations','length','replace','.js','push','sort','Migration','sequelize','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20'];(function(_0x2b9be1,_0xc8c362){var _0xf2a6da=function(_0x478aa8){while(--_0x478aa8){_0x2b9be1['push'](_0x2b9be1['shift']());}};_0xf2a6da(++_0xc8c362);}(_0x2064,0x1bb));var _0x4206=function(_0x132913,_0x1895b3){_0x132913=_0x132913-0x0;var _0x30506f=_0x2064[_0x132913];return _0x30506f;};'use strict';var Umzug=require(_0x4206('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x4206('0x1'));var pkginfo=require('pkginfo')(module,_0x4206('0x2'));var compareVersions=require(_0x4206('0x3'));var exec=require(_0x4206('0x4'))['exec'];var db=require(_0x4206('0x5'))['db'];var config=require('../../config/environment');var pm2=require(_0x4206('0x6'));var logger=require(_0x4206('0x7'))(_0x4206('0x8'));var git=require('simple-git')(config['root']);exports[_0x4206('0x9')]=function(_0x488231,_0x3dd3f5){var _0x261466={'current':module[_0x4206('0xa')]['version'],'phonebar':0x2};if(_0x488231[_0x4206('0xb')]&&_0x488231[_0x4206('0xb')][_0x4206('0xc')]){return git[_0x4206('0xd')]()['tags'](function(_0x25cfdb,_0x4a222b){_0x261466[_0x4206('0xc')]=(_0x25cfdb?module['exports']['version']:_0x4a222b[_0x4206('0xc')])||_0x4206('0xe');return _0x3dd3f5['status'](0xc8)[_0x4206('0xf')](_0x261466);});}else{return _0x3dd3f5[_0x4206('0x10')](0xc8)[_0x4206('0xf')](_0x261466);}};exports[_0x4206('0xd')]=function(_0x148dba,_0x5838ed){return git[_0x4206('0xd')]([_0x4206('0x11'),'master'],function(_0x202093){if(_0x202093){logger[_0x4206('0x12')](_0x202093);return _0x5838ed[_0x4206('0x10')](0x1f4)['json'](_0x202093);}logger[_0x4206('0x13')](_0x4206('0x14'));return _0x5838ed[_0x4206('0x10')](0xc8)[_0x4206('0xf')]({'output':_0x4206('0x15')});});};exports[_0x4206('0x16')]=function(_0x111eb0,_0x5ae082){return git['reset']([_0x4206('0x17'),'FETCH_HEAD'],function(_0x184843){if(_0x184843){logger['error'](_0x184843);return _0x5ae082[_0x4206('0x10')](0x1f4)['json'](_0x184843);}logger[_0x4206('0x13')](_0x4206('0x18'));return _0x5ae082['status'](0xc8)[_0x4206('0xf')]({'output':_0x4206('0x19')});});};exports[_0x4206('0x1a')]=function(_0x33b995,_0x566d7b){exec('npm\x20install\x20--production',function(_0x3e4b26,_0x1c3f60,_0x3647e7){logger[_0x4206('0x13')](_0x1c3f60);logger['info'](_0x3647e7);if(_0x3e4b26){logger[_0x4206('0x12')](_0x3e4b26);return _0x566d7b[_0x4206('0x10')](0x1f4)[_0x4206('0xf')](_0x3e4b26);}return _0x566d7b[_0x4206('0x10')](0xc8)[_0x4206('0xf')]({'output':_0x1c3f60});});};exports[_0x4206('0x1b')]=function(_0x109c8a,_0x354b58){return pm2[_0x4206('0x1b')]('motion2')['then'](function(_0x5ac3ef){logger['info'](_0x4206('0x1c'),_0x5ac3ef);return _0x354b58[_0x4206('0x10')](0xc8)[_0x4206('0xf')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x4206('0x1d')](function(_0xf4d88d){logger[_0x4206('0x12')](_0xf4d88d);return _0x354b58['status'](0x1f4)[_0x4206('0xf')](_0xf4d88d);});};exports['migrations']=function(_0xb689e4,_0x2dd7a8){var _0x190d91=fs[_0x4206('0x1e')](path[_0x4206('0x1f')](config[_0x4206('0x20')],_0x4206('0x21'),_0x4206('0x22')));var _0x4a586b=[];for(var _0x2775aa=0x0;_0x2775aa<_0x190d91[_0x4206('0x23')];_0x2775aa++){var _0x34e731=_0x190d91[_0x2775aa][_0x4206('0x24')](_0x4206('0x25'),'');if(compareVersions(module['exports'][_0x4206('0x2')],_0x34e731)===-0x1){_0x4a586b[_0x4206('0x26')](_0x34e731);}}if(_0x4a586b[_0x4206('0x23')]){var _0x292329=_0x4a586b[_0x4206('0x27')](compareVersions);var _0x473df4=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x4206('0x28')],'modelName':_0x4206('0x28'),'columnName':'version'},'migrations':{'params':[db[_0x4206('0x29')][_0x4206('0x2a')](),db[_0x4206('0x29')]['constructor'],function(){throw new Error(_0x4206('0x2b'));}],'path':path['join'](config[_0x4206('0x20')],'server',_0x4206('0x22')),'pattern':/\.js$/}});_0x473df4['up']({'migrations':_[_0x4206('0x2c')](_0x292329,function(_0x27dbc5){return _0x27dbc5+'.js';})})[_0x4206('0x2d')](function(){return _0x2dd7a8[_0x4206('0x10')](0xc8)[_0x4206('0xf')]({'output':_0x4206('0x2e')+module[_0x4206('0xa')][_0x4206('0x2')]+'\x20to\x20'+_[_0x4206('0x2f')](_0x292329),'migrations':_[_0x4206('0x1f')](_0x292329)});})[_0x4206('0x1d')](function(_0x2a27dc){if(_0x2a27dc instanceof db[_0x4206('0x29')][_0x4206('0x30')]){return _0x2dd7a8[_0x4206('0x10')](0xc8)[_0x4206('0xf')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x2dd7a8[_0x4206('0x10')](0x1f4)[_0x4206('0xf')](_0x2a27dc);}});}else{return _0x2dd7a8[_0x4206('0x10')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index cad987d..b348073 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 _0xf389=['/describe','describe','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get'];(function(_0x28508b,_0x48ef76){var _0x2e2f33=function(_0x249b0b){while(--_0x249b0b){_0x28508b['push'](_0x28508b['shift']());}};_0x2e2f33(++_0x48ef76);}(_0xf389,0x11d));var _0x9f38=function(_0x38fe3d,_0x3d52e9){_0x38fe3d=_0x38fe3d-0x0;var _0x42232a=_0xf389[_0x38fe3d];return _0x42232a;};'use strict';var multer=require(_0x9f38('0x0'));var util=require(_0x9f38('0x1'));var path=require(_0x9f38('0x2'));var timeout=require(_0x9f38('0x3'));var express=require(_0x9f38('0x4'));var router=express[_0x9f38('0x5')]();var fs_extra=require(_0x9f38('0x6'));var auth=require(_0x9f38('0x7'));var interaction=require(_0x9f38('0x8'));var config=require(_0x9f38('0x9'));var controller=require(_0x9f38('0xa'));router['get']('/',auth[_0x9f38('0xb')](),controller[_0x9f38('0xc')]);router[_0x9f38('0xd')](_0x9f38('0xe'),auth['isAuthenticated'](),controller[_0x9f38('0xf')]);router['get'](_0x9f38('0x10'),auth[_0x9f38('0xb')](),controller[_0x9f38('0x11')]);router[_0x9f38('0x12')]('/',auth[_0x9f38('0xb')](),controller[_0x9f38('0x13')]);router['put'](_0x9f38('0x10'),auth[_0x9f38('0xb')](),controller[_0x9f38('0x14')]);router[_0x9f38('0x15')](_0x9f38('0x10'),auth[_0x9f38('0xb')](),controller[_0x9f38('0x16')]);module['exports']=router; \ No newline at end of file +var _0x6eaf=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','destroy','exports','multer','util'];(function(_0x5d23b2,_0x12e4f0){var _0x291b82=function(_0x4d046b){while(--_0x4d046b){_0x5d23b2['push'](_0x5d23b2['shift']());}};_0x291b82(++_0x12e4f0);}(_0x6eaf,0xa6));var _0xf6ea=function(_0x5a1184,_0x2e79b5){_0x5a1184=_0x5a1184-0x0;var _0x542cac=_0x6eaf[_0x5a1184];return _0x542cac;};'use strict';var multer=require(_0xf6ea('0x0'));var util=require(_0xf6ea('0x1'));var path=require(_0xf6ea('0x2'));var timeout=require('connect-timeout');var express=require(_0xf6ea('0x3'));var router=express[_0xf6ea('0x4')]();var fs_extra=require(_0xf6ea('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf6ea('0x6'));var config=require(_0xf6ea('0x7'));var controller=require(_0xf6ea('0x8'));router[_0xf6ea('0x9')]('/',auth['isAuthenticated'](),controller[_0xf6ea('0xa')]);router[_0xf6ea('0x9')](_0xf6ea('0xb'),auth[_0xf6ea('0xc')](),controller[_0xf6ea('0xd')]);router[_0xf6ea('0x9')](_0xf6ea('0xe'),auth[_0xf6ea('0xc')](),controller[_0xf6ea('0xf')]);router[_0xf6ea('0x10')]('/',auth['isAuthenticated'](),controller[_0xf6ea('0x11')]);router[_0xf6ea('0x12')](_0xf6ea('0xe'),auth[_0xf6ea('0xc')](),controller['update']);router['delete']('/:id',auth[_0xf6ea('0xc')](),controller[_0xf6ea('0x13')]);module[_0xf6ea('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 48055b9..87b6110 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 _0x174b=['DATE','INTEGER','BOOLEAN','sequelize','STRING'];(function(_0xfd397,_0x5a3d96){var _0x172ea0=function(_0x7ee305){while(--_0x7ee305){_0xfd397['push'](_0xfd397['shift']());}};_0x172ea0(++_0x5a3d96);}(_0x174b,0x19d));var _0xb174=function(_0x551d24,_0x1e93cb){_0x551d24=_0x551d24-0x0;var _0x13a7da=_0x174b[_0x551d24];return _0x13a7da;};'use strict';var Sequelize=require(_0xb174('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb174('0x1')]},'calleridnum':{'type':Sequelize[_0xb174('0x1')]},'calleridname':{'type':Sequelize[_0xb174('0x1')]},'queue':{'type':Sequelize[_0xb174('0x1')]},'interface':{'type':Sequelize[_0xb174('0x1')]},'membername':{'type':Sequelize[_0xb174('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xb174('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xb174('0x2')]},'agentdumpAt':{'type':Sequelize[_0xb174('0x2')]},'holdtime':{'type':Sequelize[_0xb174('0x3')]},'agentcomplete':{'type':Sequelize[_0xb174('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xb174('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xb174('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb174('0x3')]},'agentacw':{'type':Sequelize[_0xb174('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb174('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xb174('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xb174('0x3')]},'channelstatedesc':{'type':Sequelize[_0xb174('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb174('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb174('0x1')]},'context':{'type':Sequelize[_0xb174('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb174('0x1')]},'destchannel':{'type':Sequelize[_0xb174('0x1')]},'destchannelstate':{'type':Sequelize[_0xb174('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xb174('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xb174('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xb174('0x1')]},'destlanguage':{'type':Sequelize[_0xb174('0x1')]},'destaccountcode':{'type':Sequelize[_0xb174('0x1')]},'destcontext':{'type':Sequelize[_0xb174('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb174('0x1')]},'destuniqueid':{'type':Sequelize[_0xb174('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb174('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xb174('0x1')]},'transfer':{'type':Sequelize[_0xb174('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb174('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4f7b=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x461d06,_0x600f63){var _0x392947=function(_0x55b2c6){while(--_0x55b2c6){_0x461d06['push'](_0x461d06['shift']());}};_0x392947(++_0x600f63);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x594110,_0xb121b1){_0x594110=_0x594110-0x0;var _0x49ec2a=_0x4f7b[_0x594110];return _0x49ec2a;};'use strict';var Sequelize=require(_0xb4f7('0x0'));module[_0xb4f7('0x1')]={'type':{'type':Sequelize[_0xb4f7('0x2')]},'uniqueid':{'type':Sequelize[_0xb4f7('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb4f7('0x2')]},'queue':{'type':Sequelize[_0xb4f7('0x2')]},'interface':{'type':Sequelize[_0xb4f7('0x2')]},'membername':{'type':Sequelize[_0xb4f7('0x2')]},'agentcalledAt':{'type':Sequelize[_0xb4f7('0x3')]},'agentconnectAt':{'type':Sequelize[_0xb4f7('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xb4f7('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xb4f7('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xb4f7('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xb4f7('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xb4f7('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb4f7('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb4f7('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xb4f7('0x2')]},'channel':{'type':Sequelize[_0xb4f7('0x2')]},'channelstate':{'type':Sequelize[_0xb4f7('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb4f7('0x2')]},'connectedlinename':{'type':Sequelize[_0xb4f7('0x2')]},'language':{'type':Sequelize[_0xb4f7('0x2')]},'accountcode':{'type':Sequelize[_0xb4f7('0x2')]},'context':{'type':Sequelize[_0xb4f7('0x2')]},'exten':{'type':Sequelize[_0xb4f7('0x2')]},'priority':{'type':Sequelize[_0xb4f7('0x2')]},'destchannel':{'type':Sequelize[_0xb4f7('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xb4f7('0x2')]},'destcalleridnum':{'type':Sequelize[_0xb4f7('0x2')]},'destcalleridname':{'type':Sequelize[_0xb4f7('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xb4f7('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb4f7('0x2')]},'destlanguage':{'type':Sequelize[_0xb4f7('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xb4f7('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb4f7('0x2')]},'destuniqueid':{'type':Sequelize[_0xb4f7('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb4f7('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xb4f7('0x2')]},'transfer':{'type':Sequelize[_0xb4f7('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb4f7('0x2')],'comment':_0xb4f7('0x6')},'transferexten':{'type':Sequelize[_0xb4f7('0x2')]},'transferuniqueid':{'type':Sequelize[_0xb4f7('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'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 1d75248..3c9f9b6 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(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 308bdb5..0ff88b5 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 _0xfd0f=['api','moment','bluebird','path','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x55729c,_0x313b1c){_0x55729c=_0x55729c-0x0;var _0x4a5d63=_0xfd0f[_0x55729c];return _0x4a5d63;};'use strict';var _=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var logger=require('../../config/logger')(_0xffd0('0x2'));var moment=require(_0xffd0('0x3'));var BPromise=require(_0xffd0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xffd0('0x5'));var rimraf=require('rimraf');var config=require(_0xffd0('0x6'));var attributes=require(_0xffd0('0x7'));module[_0xffd0('0x8')]=function(_0x9e9c1f,_0xd7f075){return _0x9e9c1f[_0xffd0('0x9')](_0xffd0('0xa'),attributes,{'tableName':_0xffd0('0xb'),'paranoid':![],'indexes':[{'fields':[_0xffd0('0xc'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa566=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','report_agent','destuniqueid','lodash','util'];(function(_0x2030b1,_0x197c43){var _0x420e0f=function(_0x5a3d48){while(--_0x5a3d48){_0x2030b1['push'](_0x2030b1['shift']());}};_0x420e0f(++_0x197c43);}(_0xa566,0x1c1));var _0x6a56=function(_0xc04082,_0x1de0e9){_0xc04082=_0xc04082-0x0;var _0x720081=_0xa566[_0xc04082];return _0x720081;};'use strict';var _=require(_0x6a56('0x0'));var util=require(_0x6a56('0x1'));var logger=require(_0x6a56('0x2'))('api');var moment=require(_0x6a56('0x3'));var BPromise=require(_0x6a56('0x4'));var rp=require(_0x6a56('0x5'));var fs=require('fs');var path=require(_0x6a56('0x6'));var rimraf=require('rimraf');var config=require(_0x6a56('0x7'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x4c58b0,_0x47ecb8){return _0x4c58b0[_0x6a56('0x8')]('VoiceAgentReport',attributes,{'tableName':_0x6a56('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x6a56('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index deda228..b85853c 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 _0xd7d0=['limit','UpdateVoiceAgentReport','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceAgentReport','create','options','raw','CreateVoiceAgentReport','update','body','where'];(function(_0x59ac9a,_0x3dbf43){var _0x2d2a66=function(_0x27f29c){while(--_0x27f29c){_0x59ac9a['push'](_0x59ac9a['shift']());}};_0x2d2a66(++_0x3dbf43);}(_0xd7d0,0x182));var _0x0d7d=function(_0x4664f2,_0x2b0027){_0x4664f2=_0x4664f2-0x0;var _0x12e5f6=_0xd7d0[_0x4664f2];return _0x12e5f6;};'use strict';var _=require(_0x0d7d('0x0'));var util=require(_0x0d7d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0d7d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d7d('0x3'))['db'];var utils=require(_0x0d7d('0x4'));var logger=require('../../config/logger')(_0x0d7d('0x5'));var config=require(_0x0d7d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0d7d('0x7')][_0x0d7d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb20d3b,_0x1f55b2,_0x32bc03){return new BPromise(function(_0x49bfb4,_0x33190c){return client[_0x0d7d('0x9')](_0xb20d3b,_0x32bc03)[_0x0d7d('0xa')](function(_0x265f46){logger[_0x0d7d('0xb')](_0x0d7d('0xc'),_0x1f55b2,_0x0d7d('0xd'));logger[_0x0d7d('0xe')](_0x0d7d('0xf'),_0x1f55b2,_0x0d7d('0xd'),JSON[_0x0d7d('0x10')](_0x265f46));if(_0x265f46[_0x0d7d('0x11')]){if(_0x265f46['error'][_0x0d7d('0x12')]===0x1f4){logger['error'](_0x0d7d('0xc'),_0x1f55b2,_0x265f46['error'][_0x0d7d('0x13')]);return _0x33190c(_0x265f46['error'][_0x0d7d('0x13')]);}logger['error'](_0x0d7d('0xc'),_0x1f55b2,_0x265f46[_0x0d7d('0x11')][_0x0d7d('0x13')]);return _0x49bfb4(_0x265f46[_0x0d7d('0x11')][_0x0d7d('0x13')]);}else{logger[_0x0d7d('0xb')](_0x0d7d('0xc'),_0x1f55b2,_0x0d7d('0xd'));_0x49bfb4(_0x265f46[_0x0d7d('0x14')]['message']);}})[_0x0d7d('0x15')](function(_0x3357c5){logger[_0x0d7d('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x1f55b2,_0x3357c5);_0x33190c(_0x3357c5);});});}exports['CreateVoiceAgentReport']=function(_0x328935){var _0x2f941e=this;return new Promise(function(_0x39b9af,_0x3ad0e0){return db[_0x0d7d('0x16')][_0x0d7d('0x17')](_0x328935['body'],{'raw':_0x328935[_0x0d7d('0x18')]?_0x328935['options'][_0x0d7d('0x19')]===undefined?!![]:![]:!![]})[_0x0d7d('0xa')](function(_0x157e73){logger[_0x0d7d('0xb')]('CreateVoiceAgentReport',_0x328935);logger[_0x0d7d('0xe')](_0x0d7d('0x1a'),_0x328935,JSON[_0x0d7d('0x10')](_0x157e73));_0x39b9af(_0x157e73);})[_0x0d7d('0x15')](function(_0x559604){logger['error'](_0x0d7d('0x1a'),_0x559604[_0x0d7d('0x13')],_0x328935);_0x3ad0e0(_0x2f941e[_0x0d7d('0x11')](0x1f4,_0x559604[_0x0d7d('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0x139d6b){var _0x25153d=this;return new Promise(function(_0x4beb1c,_0x5a72a4){return db['VoiceAgentReport'][_0x0d7d('0x1b')](_0x139d6b[_0x0d7d('0x1c')],{'raw':_0x139d6b[_0x0d7d('0x18')]?_0x139d6b[_0x0d7d('0x18')][_0x0d7d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x139d6b[_0x0d7d('0x18')]?_0x139d6b[_0x0d7d('0x18')][_0x0d7d('0x1d')]||null:null,'attributes':_0x139d6b[_0x0d7d('0x18')]?_0x139d6b[_0x0d7d('0x18')]['attributes']||null:null,'limit':_0x139d6b[_0x0d7d('0x18')]?_0x139d6b['options'][_0x0d7d('0x1e')]||null:null})[_0x0d7d('0xa')](function(_0x17611a){logger[_0x0d7d('0xb')](_0x0d7d('0x1f'),_0x139d6b);logger[_0x0d7d('0xe')](_0x0d7d('0x1f'),_0x139d6b,JSON[_0x0d7d('0x10')](_0x17611a));_0x4beb1c(_0x17611a);})['catch'](function(_0x1989cf){logger[_0x0d7d('0x11')](_0x0d7d('0x1f'),_0x1989cf[_0x0d7d('0x13')],_0x139d6b);_0x5a72a4(_0x25153d['error'](0x1f4,_0x1989cf[_0x0d7d('0x13')]));});});}; \ No newline at end of file +var _0x4500=['../../config/environment','jayson/promise','request','then','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','update','where','limit','UpdateVoiceAgentReport','stringify','catch','lodash','moment','randomstring','ioredis','../../config/utils'];(function(_0x194aef,_0xe5b97){var _0x23f2bf=function(_0x364852){while(--_0x364852){_0x194aef['push'](_0x194aef['shift']());}};_0x23f2bf(++_0xe5b97);}(_0x4500,0x13a));var _0x0450=function(_0x54d164,_0x3be5ba){_0x54d164=_0x54d164-0x0;var _0xf58243=_0x4500[_0x54d164];return _0xf58243;};'use strict';var _=require(_0x0450('0x0'));var util=require('util');var moment=require(_0x0450('0x1'));var BPromise=require('bluebird');var rs=require(_0x0450('0x2'));var fs=require('fs');var Redis=require(_0x0450('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0450('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x0450('0x5'));var jayson=require(_0x0450('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x590a31,_0x5d69aa,_0x354f4d){return new BPromise(function(_0x26bb09,_0x4c0139){return client[_0x0450('0x7')](_0x590a31,_0x354f4d)[_0x0450('0x8')](function(_0x110984){logger['info'](_0x0450('0x9'),_0x5d69aa,'request\x20sent');logger[_0x0450('0xa')](_0x0450('0xb'),_0x5d69aa,_0x0450('0xc'),JSON['stringify'](_0x110984));if(_0x110984[_0x0450('0xd')]){if(_0x110984[_0x0450('0xd')][_0x0450('0xe')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x5d69aa,_0x110984[_0x0450('0xd')][_0x0450('0xf')]);return _0x4c0139(_0x110984[_0x0450('0xd')][_0x0450('0xf')]);}logger['error'](_0x0450('0x9'),_0x5d69aa,_0x110984[_0x0450('0xd')][_0x0450('0xf')]);return _0x26bb09(_0x110984[_0x0450('0xd')][_0x0450('0xf')]);}else{logger[_0x0450('0x10')](_0x0450('0x9'),_0x5d69aa,_0x0450('0xc'));_0x26bb09(_0x110984['result'][_0x0450('0xf')]);}})['catch'](function(_0x37687c){logger[_0x0450('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x5d69aa,_0x37687c);_0x4c0139(_0x37687c);});});}exports[_0x0450('0x11')]=function(_0x6416c3){var _0x295489=this;return new Promise(function(_0x2547c5,_0x5222cd){return db[_0x0450('0x12')][_0x0450('0x13')](_0x6416c3[_0x0450('0x14')],{'raw':_0x6416c3['options']?_0x6416c3[_0x0450('0x15')][_0x0450('0x16')]===undefined?!![]:![]:!![]})[_0x0450('0x8')](function(_0x402e17){logger[_0x0450('0x10')](_0x0450('0x11'),_0x6416c3);logger[_0x0450('0xa')](_0x0450('0x11'),_0x6416c3,JSON['stringify'](_0x402e17));_0x2547c5(_0x402e17);})['catch'](function(_0x358afa){logger['error'](_0x0450('0x11'),_0x358afa[_0x0450('0xf')],_0x6416c3);_0x5222cd(_0x295489['error'](0x1f4,_0x358afa['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x36d4d9){var _0xec52fc=this;return new Promise(function(_0x416c16,_0xc0bf41){return db['VoiceAgentReport'][_0x0450('0x17')](_0x36d4d9[_0x0450('0x14')],{'raw':_0x36d4d9[_0x0450('0x15')]?_0x36d4d9['options'][_0x0450('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36d4d9[_0x0450('0x15')]?_0x36d4d9['options'][_0x0450('0x18')]||null:null,'attributes':_0x36d4d9['options']?_0x36d4d9[_0x0450('0x15')]['attributes']||null:null,'limit':_0x36d4d9['options']?_0x36d4d9[_0x0450('0x15')][_0x0450('0x19')]||null:null})[_0x0450('0x8')](function(_0x34590d){logger[_0x0450('0x10')](_0x0450('0x1a'),_0x36d4d9);logger[_0x0450('0xa')](_0x0450('0x1a'),_0x36d4d9,JSON[_0x0450('0x1b')](_0x34590d));_0x416c16(_0x34590d);})[_0x0450('0x1c')](function(_0xf770a7){logger[_0x0450('0xd')](_0x0450('0x1a'),_0xf770a7[_0x0450('0xf')],_0x36d4d9);_0xc0bf41(_0xec52fc[_0x0450('0xd')](0x1f4,_0xf770a7[_0x0450('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index b9eb317..df42c47 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 _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','/describe','describe','/:id','delete','destroy'];(function(_0x370e01,_0x3de05f){var _0x58a4a7=function(_0xe4e6f2){while(--_0xe4e6f2){_0x370e01['push'](_0x370e01['shift']());}};_0x58a4a7(++_0x3de05f);}(_0x2bd8,0x130));var _0x82bd=function(_0x49122d,_0x5a9cba){_0x49122d=_0x49122d-0x0;var _0x262719=_0x2bd8[_0x49122d];return _0x262719;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')]('/',auth[_0x82bd('0xa')](),controller['index']);router[_0x82bd('0x9')](_0x82bd('0xb'),auth[_0x82bd('0xa')](),controller[_0x82bd('0xc')]);router['get'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x82bd('0xa')](),controller['create']);router['put'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x82bd('0xe')](_0x82bd('0xd'),auth['isAuthenticated'](),controller[_0x82bd('0xf')]);module['exports']=router; \ No newline at end of file +var _0x6f47=['path','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','util'];(function(_0x5d5e3b,_0xc516c3){var _0x4d559d=function(_0x3a25ed){while(--_0x3a25ed){_0x5d5e3b['push'](_0x5d5e3b['shift']());}};_0x4d559d(++_0xc516c3);}(_0x6f47,0xc7));var _0x76f4=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x6f47[_0x47a349];return _0x18ab75;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/',auth['isAuthenticated'](),controller[_0x76f4('0x8')]);router[_0x76f4('0x7')](_0x76f4('0x9'),auth['isAuthenticated'](),controller[_0x76f4('0xa')]);router[_0x76f4('0x7')](_0x76f4('0xb'),auth[_0x76f4('0xc')](),controller[_0x76f4('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x76f4('0xe')]);router[_0x76f4('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x76f4('0x10')]);router[_0x76f4('0x11')](_0x76f4('0xb'),auth[_0x76f4('0xc')](),controller[_0x76f4('0x12')]);module[_0x76f4('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 9589838..d5fc08c 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 _0x9beb=['inbound','internal','inbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x42da0f,_0x2ae292){var _0xf63df4=function(_0x27494e){while(--_0x27494e){_0x42da0f['push'](_0x42da0f['shift']());}};_0xf63df4(++_0x2ae292);}(_0x9beb,0x151));var _0xb9be=function(_0x29ab5f,_0x4d454a){_0x29ab5f=_0x29ab5f-0x0;var _0x1b36e6=_0x9beb[_0x29ab5f];return _0x1b36e6;};'use strict';var Sequelize=require(_0xb9be('0x0'));module[_0xb9be('0x1')]={'uniqueid':{'type':Sequelize[_0xb9be('0x2')]},'type':{'type':Sequelize[_0xb9be('0x3')](_0xb9be('0x4'),_0xb9be('0x5'),'outbound',_0xb9be('0x6'),'outbound-fax',_0xb9be('0x7'))},'tag':{'type':Sequelize[_0xb9be('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xb9be('0x2')]},'destination':{'type':Sequelize[_0xb9be('0x2')]},'destinationcontext':{'type':Sequelize[_0xb9be('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb9be('0x2')]},'destinationchannel':{'type':Sequelize[_0xb9be('0x2')]},'lastapplication':{'type':Sequelize[_0xb9be('0x2')]},'lastdata':{'type':Sequelize[_0xb9be('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xb9be('0x9')]},'answertime':{'type':Sequelize[_0xb9be('0x9')]},'endtime':{'type':Sequelize[_0xb9be('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xb9be('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xb9be('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xb9be('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xb9be('0x2')]},'note':{'type':Sequelize[_0xb9be('0x2')]},'prefix':{'type':Sequelize[_0xb9be('0x2')]},'routeid':{'type':Sequelize[_0xb9be('0xa')]},'sipcallid':{'type':Sequelize[_0xb9be('0x2')]}}; \ No newline at end of file +var _0xc3b7=['exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER'];(function(_0x217d4,_0x388eeb){var _0x515be2=function(_0x418741){while(--_0x418741){_0x217d4['push'](_0x217d4['shift']());}};_0x515be2(++_0x388eeb);}(_0xc3b7,0xb4));var _0x7c3b=function(_0x32490f,_0x5ad3d1){_0x32490f=_0x32490f-0x0;var _0x4fd586=_0xc3b7[_0x32490f];return _0x4fd586;};'use strict';var Sequelize=require('sequelize');module[_0x7c3b('0x0')]={'uniqueid':{'type':Sequelize[_0x7c3b('0x1')]},'type':{'type':Sequelize[_0x7c3b('0x2')](_0x7c3b('0x3'),_0x7c3b('0x4'),_0x7c3b('0x5'),_0x7c3b('0x6'),_0x7c3b('0x7'),_0x7c3b('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x7c3b('0x1')]},'destination':{'type':Sequelize[_0x7c3b('0x1')]},'destinationcontext':{'type':Sequelize[_0x7c3b('0x1')]},'callerid':{'type':Sequelize[_0x7c3b('0x1')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7c3b('0x1')]},'lastapplication':{'type':Sequelize[_0x7c3b('0x1')]},'lastdata':{'type':Sequelize[_0x7c3b('0x9')]},'starttime':{'type':Sequelize[_0x7c3b('0xa')]},'systemanswertime':{'type':Sequelize[_0x7c3b('0xa')]},'answertime':{'type':Sequelize[_0x7c3b('0xa')]},'endtime':{'type':Sequelize[_0x7c3b('0xa')]},'duration':{'type':Sequelize[_0x7c3b('0xb')]},'billableseconds':{'type':Sequelize[_0x7c3b('0xb')]},'mohtime':{'type':Sequelize[_0x7c3b('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7c3b('0x1')]},'amaflags':{'type':Sequelize[_0x7c3b('0x1')]},'userfield':{'type':Sequelize[_0x7c3b('0x1')]},'userDisposition':{'type':Sequelize[_0x7c3b('0x1')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x7c3b('0x1')]},'note':{'type':Sequelize[_0x7c3b('0x1')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x7c3b('0xb')]},'sipcallid':{'type':Sequelize[_0x7c3b('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index fe809d6..8ef0884 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 _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x5ca52d,_0x3a4a22){var _0x89e54e=function(_0x54bdf4){while(--_0x54bdf4){_0x5ca52d['push'](_0x5ca52d['shift']());}};_0x89e54e(++_0x3a4a22);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4457b0,_0x4ed7e6){_0x4457b0=_0x4457b0-0x0;var _0x19f04a=_0x5f2f[_0x4457b0];return _0x19f04a;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index ff7c247..ca7b2fe 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 _0x765e=['./voiceCallReport.attributes','exports','define','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1874ec,_0x599576){var _0x2e6308=function(_0x5a8d5f){while(--_0x5a8d5f){_0x1874ec['push'](_0x1874ec['shift']());}};_0x2e6308(++_0x599576);}(_0x765e,0x131));var _0xe765=function(_0x175e75,_0x5f2ddd){_0x175e75=_0x175e75-0x0;var _0x2b04e7=_0x765e[_0x175e75];return _0x2b04e7;};'use strict';var _=require(_0xe765('0x0'));var util=require(_0xe765('0x1'));var logger=require(_0xe765('0x2'))(_0xe765('0x3'));var moment=require(_0xe765('0x4'));var BPromise=require(_0xe765('0x5'));var rp=require(_0xe765('0x6'));var fs=require('fs');var path=require(_0xe765('0x7'));var rimraf=require(_0xe765('0x8'));var config=require(_0xe765('0x9'));var attributes=require(_0xe765('0xa'));module[_0xe765('0xb')]=function(_0x40ac5e,_0xdcac86){return _0x40ac5e[_0xe765('0xc')]('VoiceCallReport',attributes,{'tableName':_0xe765('0xd'),'paranoid':![],'indexes':[{'fields':[_0xe765('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7153=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','report_call','uniqueid','util','../../config/logger'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x7153,0x136));var _0x3715=function(_0x45b29d,_0x44ce43){_0x45b29d=_0x45b29d-0x0;var _0x32d74=_0x7153[_0x45b29d];return _0x32d74;};'use strict';var _=require('lodash');var util=require(_0x3715('0x0'));var logger=require(_0x3715('0x1'))(_0x3715('0x2'));var moment=require(_0x3715('0x3'));var BPromise=require(_0x3715('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3715('0x5'));var rimraf=require(_0x3715('0x6'));var config=require(_0x3715('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0x3715('0x8')]=function(_0x20c0cd,_0x3b2636){return _0x20c0cd[_0x3715('0x9')]('VoiceCallReport',attributes,{'tableName':_0x3715('0xa'),'paranoid':![],'indexes':[{'fields':[_0x3715('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index dd08978..eea976e 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 _0x790b=['code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','limit','include','map','model','attributes','CreateVoiceCallReport','create','body','update','UpdateVoiceCallReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x790b,0x160));var _0xb790=function(_0x23c174,_0x2045d9){_0x23c174=_0x23c174-0x0;var _0x2d70ca=_0x790b[_0x23c174];return _0x2d70ca;};'use strict';var _=require(_0xb790('0x0'));var util=require('util');var moment=require(_0xb790('0x1'));var BPromise=require(_0xb790('0x2'));var rs=require(_0xb790('0x3'));var fs=require('fs');var Redis=require(_0xb790('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb790('0x5'));var logger=require('../../config/logger')(_0xb790('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb790('0x7')][_0xb790('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e98e6,_0x3ffdf6,_0x3ae3f9){return new BPromise(function(_0x161e0b,_0xc74651){return client[_0xb790('0x9')](_0x2e98e6,_0x3ae3f9)[_0xb790('0xa')](function(_0x7f1c0b){logger[_0xb790('0xb')](_0xb790('0xc'),_0x3ffdf6,_0xb790('0xd'));logger[_0xb790('0xe')](_0xb790('0xf'),_0x3ffdf6,_0xb790('0xd'),JSON[_0xb790('0x10')](_0x7f1c0b));if(_0x7f1c0b['error']){if(_0x7f1c0b[_0xb790('0x11')][_0xb790('0x12')]===0x1f4){logger[_0xb790('0x11')](_0xb790('0xc'),_0x3ffdf6,_0x7f1c0b[_0xb790('0x11')]['message']);return _0xc74651(_0x7f1c0b[_0xb790('0x11')][_0xb790('0x13')]);}logger['error'](_0xb790('0xc'),_0x3ffdf6,_0x7f1c0b[_0xb790('0x11')][_0xb790('0x13')]);return _0x161e0b(_0x7f1c0b[_0xb790('0x11')][_0xb790('0x13')]);}else{logger[_0xb790('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x3ffdf6,_0xb790('0xd'));_0x161e0b(_0x7f1c0b[_0xb790('0x14')]['message']);}})[_0xb790('0x15')](function(_0x4ff391){logger[_0xb790('0x11')](_0xb790('0xc'),_0x3ffdf6,_0x4ff391);_0xc74651(_0x4ff391);});});}exports[_0xb790('0x16')]=function(_0x30d911){var _0x4657bb=this;return new Promise(function(_0x502694,_0x30f15c){return db[_0xb790('0x17')][_0xb790('0x18')]({'raw':_0x30d911[_0xb790('0x19')]?_0x30d911[_0xb790('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x30d911[_0xb790('0x19')]?_0x30d911['options'][_0xb790('0x1a')]||null:null,'attributes':_0x30d911[_0xb790('0x19')]?_0x30d911[_0xb790('0x19')]['attributes']||null:null,'limit':_0x30d911['options']?_0x30d911['options'][_0xb790('0x1b')]||null:null,'include':_0x30d911['options']?_0x30d911[_0xb790('0x19')][_0xb790('0x1c')]?_[_0xb790('0x1d')](_0x30d911['options'][_0xb790('0x1c')],function(_0x54246d){return{'model':db[_0x54246d[_0xb790('0x1e')]],'as':_0x54246d['as'],'attributes':_0x54246d['attributes'],'include':_0x54246d[_0xb790('0x1c')]?_['map'](_0x54246d[_0xb790('0x1c')],function(_0x40b988){return{'model':db[_0x40b988['model']],'as':_0x40b988['as'],'attributes':_0x40b988['attributes'],'include':_0x40b988[_0xb790('0x1c')]?_[_0xb790('0x1d')](_0x40b988[_0xb790('0x1c')],function(_0x1b6c6b){return{'model':db[_0x1b6c6b[_0xb790('0x1e')]],'as':_0x1b6c6b['as'],'attributes':_0x1b6c6b[_0xb790('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb790('0xa')](function(_0x1c1abb){logger[_0xb790('0xb')]('GetVoiceCallReport',_0x30d911);logger['debug'](_0xb790('0x16'),_0x30d911,JSON['stringify'](_0x1c1abb));_0x502694(_0x1c1abb);})['catch'](function(_0x3a370b){logger['error']('GetVoiceCallReport',_0x3a370b['message'],_0x30d911);_0x30f15c(_0x4657bb['error'](0x1f4,_0x3a370b['message']));});});};exports[_0xb790('0x20')]=function(_0x5ce36e){var _0x5df0bb=this;return new Promise(function(_0x4c6119,_0x111e8e){return db[_0xb790('0x17')][_0xb790('0x21')](_0x5ce36e[_0xb790('0x22')],{'raw':_0x5ce36e[_0xb790('0x19')]?_0x5ce36e[_0xb790('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xb790('0xa')](function(_0x2bedcc){logger[_0xb790('0xb')](_0xb790('0x20'),_0x5ce36e);logger[_0xb790('0xe')](_0xb790('0x20'),_0x5ce36e,JSON[_0xb790('0x10')](_0x2bedcc));_0x4c6119(_0x2bedcc);})['catch'](function(_0x2d59c7){logger[_0xb790('0x11')](_0xb790('0x20'),_0x2d59c7[_0xb790('0x13')],_0x5ce36e);_0x111e8e(_0x5df0bb[_0xb790('0x11')](0x1f4,_0x2d59c7[_0xb790('0x13')]));});});};exports['UpdateVoiceCallReport']=function(_0x540084){var _0x39e6fc=this;return new Promise(function(_0x573723,_0x2c20fd){return db['VoiceCallReport'][_0xb790('0x23')](_0x540084['body'],{'raw':_0x540084[_0xb790('0x19')]?_0x540084[_0xb790('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540084[_0xb790('0x19')]?_0x540084[_0xb790('0x19')]['where']||null:null,'attributes':_0x540084['options']?_0x540084['options'][_0xb790('0x1f')]||null:null,'limit':_0x540084['options']?_0x540084[_0xb790('0x19')][_0xb790('0x1b')]||null:null})[_0xb790('0xa')](function(_0x4b0fb8){logger['info'](_0xb790('0x24'),_0x540084);logger['debug']('UpdateVoiceCallReport',_0x540084,JSON['stringify'](_0x4b0fb8));_0x573723(_0x4b0fb8);})[_0xb790('0x15')](function(_0x681a67){logger['error'](_0xb790('0x24'),_0x681a67[_0xb790('0x13')],_0x540084);_0x2c20fd(_0x39e6fc[_0xb790('0x11')](0x1f4,_0x681a67['message']));});});}; \ No newline at end of file +var _0xc6ea=['include','map','attributes','model','debug','VoiceCallReport','CreateVoiceCallReport','UpdateVoiceCallReport','update','body','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVoiceCallReport','options','raw','where','limit'];(function(_0x433fa5,_0x884980){var _0x36b69b=function(_0x152567){while(--_0x152567){_0x433fa5['push'](_0x433fa5['shift']());}};_0x36b69b(++_0x884980);}(_0xc6ea,0xbe));var _0xac6e=function(_0x2e8eab,_0x26aafc){_0x2e8eab=_0x2e8eab-0x0;var _0x3d60ac=_0xc6ea[_0x2e8eab];return _0x3d60ac;};'use strict';var _=require(_0xac6e('0x0'));var util=require('util');var moment=require(_0xac6e('0x1'));var BPromise=require(_0xac6e('0x2'));var rs=require(_0xac6e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac6e('0x4'))['db'];var utils=require(_0xac6e('0x5'));var logger=require(_0xac6e('0x6'))(_0xac6e('0x7'));var config=require(_0xac6e('0x8'));var jayson=require(_0xac6e('0x9'));var client=jayson['client'][_0xac6e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e381,_0x5e5041,_0x10f920){return new BPromise(function(_0x4ab567,_0x45b267){return client[_0xac6e('0xb')](_0x45e381,_0x10f920)[_0xac6e('0xc')](function(_0x446dc5){logger[_0xac6e('0xd')](_0xac6e('0xe'),_0x5e5041,_0xac6e('0xf'));logger['debug'](_0xac6e('0x10'),_0x5e5041,_0xac6e('0xf'),JSON[_0xac6e('0x11')](_0x446dc5));if(_0x446dc5[_0xac6e('0x12')]){if(_0x446dc5['error']['code']===0x1f4){logger[_0xac6e('0x12')](_0xac6e('0xe'),_0x5e5041,_0x446dc5[_0xac6e('0x12')]['message']);return _0x45b267(_0x446dc5[_0xac6e('0x12')][_0xac6e('0x13')]);}logger[_0xac6e('0x12')](_0xac6e('0xe'),_0x5e5041,_0x446dc5[_0xac6e('0x12')][_0xac6e('0x13')]);return _0x4ab567(_0x446dc5['error'][_0xac6e('0x13')]);}else{logger[_0xac6e('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x5e5041,_0xac6e('0xf'));_0x4ab567(_0x446dc5['result'][_0xac6e('0x13')]);}})[_0xac6e('0x14')](function(_0x56fbd4){logger[_0xac6e('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x5e5041,_0x56fbd4);_0x45b267(_0x56fbd4);});});}exports[_0xac6e('0x15')]=function(_0x588600){var _0x4a2b87=this;return new Promise(function(_0x7d8e3,_0x262191){return db['VoiceCallReport']['findAll']({'raw':_0x588600[_0xac6e('0x16')]?_0x588600['options'][_0xac6e('0x17')]===undefined?!![]:![]:!![],'where':_0x588600['options']?_0x588600[_0xac6e('0x16')][_0xac6e('0x18')]||null:null,'attributes':_0x588600[_0xac6e('0x16')]?_0x588600[_0xac6e('0x16')]['attributes']||null:null,'limit':_0x588600[_0xac6e('0x16')]?_0x588600['options'][_0xac6e('0x19')]||null:null,'include':_0x588600['options']?_0x588600[_0xac6e('0x16')][_0xac6e('0x1a')]?_[_0xac6e('0x1b')](_0x588600[_0xac6e('0x16')][_0xac6e('0x1a')],function(_0x396276){return{'model':db[_0x396276['model']],'as':_0x396276['as'],'attributes':_0x396276[_0xac6e('0x1c')],'include':_0x396276[_0xac6e('0x1a')]?_['map'](_0x396276[_0xac6e('0x1a')],function(_0x4d1cda){return{'model':db[_0x4d1cda[_0xac6e('0x1d')]],'as':_0x4d1cda['as'],'attributes':_0x4d1cda[_0xac6e('0x1c')],'include':_0x4d1cda[_0xac6e('0x1a')]?_[_0xac6e('0x1b')](_0x4d1cda[_0xac6e('0x1a')],function(_0x33e9f3){return{'model':db[_0x33e9f3[_0xac6e('0x1d')]],'as':_0x33e9f3['as'],'attributes':_0x33e9f3[_0xac6e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f481d){logger[_0xac6e('0xd')](_0xac6e('0x15'),_0x588600);logger[_0xac6e('0x1e')](_0xac6e('0x15'),_0x588600,JSON[_0xac6e('0x11')](_0x1f481d));_0x7d8e3(_0x1f481d);})[_0xac6e('0x14')](function(_0x1ea77e){logger[_0xac6e('0x12')](_0xac6e('0x15'),_0x1ea77e[_0xac6e('0x13')],_0x588600);_0x262191(_0x4a2b87[_0xac6e('0x12')](0x1f4,_0x1ea77e[_0xac6e('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x3d3fb9){var _0xac8cbc=this;return new Promise(function(_0x41bbd5,_0x3149d5){return db[_0xac6e('0x1f')]['create'](_0x3d3fb9['body'],{'raw':_0x3d3fb9['options']?_0x3d3fb9[_0xac6e('0x16')][_0xac6e('0x17')]===undefined?!![]:![]:!![]})[_0xac6e('0xc')](function(_0xd7f1e5){logger[_0xac6e('0xd')](_0xac6e('0x20'),_0x3d3fb9);logger[_0xac6e('0x1e')](_0xac6e('0x20'),_0x3d3fb9,JSON[_0xac6e('0x11')](_0xd7f1e5));_0x41bbd5(_0xd7f1e5);})[_0xac6e('0x14')](function(_0x40ccea){logger['error'](_0xac6e('0x20'),_0x40ccea[_0xac6e('0x13')],_0x3d3fb9);_0x3149d5(_0xac8cbc[_0xac6e('0x12')](0x1f4,_0x40ccea[_0xac6e('0x13')]));});});};exports[_0xac6e('0x21')]=function(_0x3de9b2){var _0xc3f220=this;return new Promise(function(_0x525a88,_0x42e85b){return db['VoiceCallReport'][_0xac6e('0x22')](_0x3de9b2[_0xac6e('0x23')],{'raw':_0x3de9b2[_0xac6e('0x16')]?_0x3de9b2[_0xac6e('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3de9b2['options']?_0x3de9b2[_0xac6e('0x16')][_0xac6e('0x18')]||null:null,'attributes':_0x3de9b2['options']?_0x3de9b2[_0xac6e('0x16')]['attributes']||null:null,'limit':_0x3de9b2[_0xac6e('0x16')]?_0x3de9b2[_0xac6e('0x16')][_0xac6e('0x19')]||null:null})[_0xac6e('0xc')](function(_0x517cf1){logger['info'](_0xac6e('0x21'),_0x3de9b2);logger[_0xac6e('0x1e')](_0xac6e('0x21'),_0x3de9b2,JSON[_0xac6e('0x11')](_0x517cf1));_0x525a88(_0x517cf1);})['catch'](function(_0x117621){logger[_0xac6e('0x12')]('UpdateVoiceCallReport',_0x117621[_0xac6e('0x13')],_0x3de9b2);_0x42e85b(_0xc3f220[_0xac6e('0x12')](0x1f4,_0x117621[_0xac6e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index fbf07f2..f2bc936 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 _0xf2ca=['../../components/auth/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','get','/:id','show','post','put','update','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x49c4e9,_0x3233b8){var _0xd4ba51=function(_0x5aa6fe){while(--_0x5aa6fe){_0x49c4e9['push'](_0x49c4e9['shift']());}};_0xd4ba51(++_0x3233b8);}(_0xf2ca,0x163));var _0xaf2c=function(_0x3e5bc8,_0x457d89){_0x3e5bc8=_0x3e5bc8-0x0;var _0xfd84bc=_0xf2ca[_0x3e5bc8];return _0xfd84bc;};'use strict';var multer=require('multer');var util=require(_0xaf2c('0x0'));var path=require(_0xaf2c('0x1'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x2'));var router=express[_0xaf2c('0x3')]();var fs_extra=require(_0xaf2c('0x4'));var auth=require(_0xaf2c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaf2c('0x6'));var controller=require(_0xaf2c('0x7'));router['get']('/',auth[_0xaf2c('0x8')](),controller[_0xaf2c('0x9')]);router[_0xaf2c('0xa')](_0xaf2c('0xb'),auth[_0xaf2c('0x8')](),controller[_0xaf2c('0xc')]);router[_0xaf2c('0xd')]('/',auth[_0xaf2c('0x8')](),controller['create']);router[_0xaf2c('0xe')](_0xaf2c('0xb'),auth[_0xaf2c('0x8')](),controller[_0xaf2c('0xf')]);router['delete'](_0xaf2c('0xb'),auth['isAuthenticated'](),controller[_0xaf2c('0x10')]);module[_0xaf2c('0x11')]=router; \ No newline at end of file +var _0x4208=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','util'];(function(_0x3b5dc3,_0x16618d){var _0x3360ba=function(_0x4bd9c8){while(--_0x4bd9c8){_0x3b5dc3['push'](_0x3b5dc3['shift']());}};_0x3360ba(++_0x16618d);}(_0x4208,0x83));var _0x8420=function(_0x5b6fe5,_0x5ddf47){_0x5b6fe5=_0x5b6fe5-0x0;var _0x5928d4=_0x4208[_0x5b6fe5];return _0x5928d4;};'use strict';var multer=require(_0x8420('0x0'));var util=require(_0x8420('0x1'));var path=require(_0x8420('0x2'));var timeout=require('connect-timeout');var express=require(_0x8420('0x3'));var router=express[_0x8420('0x4')]();var fs_extra=require(_0x8420('0x5'));var auth=require(_0x8420('0x6'));var interaction=require(_0x8420('0x7'));var config=require('../../config/environment');var controller=require(_0x8420('0x8'));router[_0x8420('0x9')]('/',auth['isAuthenticated'](),controller[_0x8420('0xa')]);router[_0x8420('0x9')](_0x8420('0xb'),auth[_0x8420('0xc')](),controller['show']);router[_0x8420('0xd')]('/',auth[_0x8420('0xc')](),controller[_0x8420('0xe')]);router['put'](_0x8420('0xb'),auth[_0x8420('0xc')](),controller[_0x8420('0xf')]);router[_0x8420('0x10')]('/:id',auth[_0x8420('0xc')](),controller[_0x8420('0x11')]);module[_0x8420('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 1c59e3b..3dc6444 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 _0xef05=['name','setDataValue','join','getDataValue','options','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x109ca9,_0x153588){var _0x5e1383=function(_0x22bc5a){while(--_0x22bc5a){_0x109ca9['push'](_0x109ca9['shift']());}};_0x5e1383(++_0x153588);}(_0xef05,0x115));var _0x5ef0=function(_0x5c2a69,_0x2e9a75){_0x5c2a69=_0x5c2a69-0x0;var _0x23a4eb=_0xef05[_0x5c2a69];return _0x23a4eb;};'use strict';var Sequelize=require(_0x5ef0('0x0'));module[_0x5ef0('0x1')]={'name':{'type':Sequelize[_0x5ef0('0x2')]},'prefix':{'type':Sequelize[_0x5ef0('0x2')],'unique':_0x5ef0('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x5ef0('0x2')],'set':function(_0x2537ad){this[_0x5ef0('0x4')]('options',_0x2537ad?_0x2537ad[_0x5ef0('0x5')](''):[]);},'get':function(){return this[_0x5ef0('0x6')](_0x5ef0('0x7'))?this[_0x5ef0('0x6')](_0x5ef0('0x7'))[_0x5ef0('0x8')](''):[];}},'auth':{'type':Sequelize[_0x5ef0('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x5ef0('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x5ef0('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1e18=['split','BOOLEAN','STRING','name','options','join','getDataValue'];(function(_0x127d7e,_0x4563e6){var _0xd168bb=function(_0x4e794c){while(--_0x4e794c){_0x127d7e['push'](_0x127d7e['shift']());}};_0xd168bb(++_0x4563e6);}(_0x1e18,0x79));var _0x81e1=function(_0x53080e,_0x252127){_0x53080e=_0x53080e-0x0;var _0x1a0c14=_0x1e18[_0x53080e];return _0x1a0c14;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x81e1('0x0')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x81e1('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0x81e1('0x0')],'set':function(_0x346814){this['setDataValue'](_0x81e1('0x2'),_0x346814?_0x346814[_0x81e1('0x3')](''):[]);},'get':function(){return this[_0x81e1('0x4')](_0x81e1('0x2'))?this['getDataValue']('options')[_0x81e1('0x5')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x81e1('0x0')]},'record':{'type':Sequelize[_0x81e1('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x81e1('0x0')]},'description':{'type':Sequelize[_0x81e1('0x0')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 832fefd..f8c95a4 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 _0x47fd=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','VoiceChanSpy','findAll','rows','catch','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','querystring','papaparse'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0x47fd,0x13c));var _0xd47f=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0x47fd[_0x3e0b8f];return _0x22f742;};'use strict';var emlformat=require(_0xd47f('0x0'));var rimraf=require(_0xd47f('0x1'));var zipdir=require(_0xd47f('0x2'));var jsonpatch=require(_0xd47f('0x3'));var rp=require(_0xd47f('0x4'));var moment=require(_0xd47f('0x5'));var BPromise=require(_0xd47f('0x6'));var Mustache=require(_0xd47f('0x7'));var util=require(_0xd47f('0x8'));var path=require(_0xd47f('0x9'));var sox=require('sox');var csv=require(_0xd47f('0xa'));var ejs=require(_0xd47f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd47f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd47f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd47f('0xe'));var Papa=require(_0xd47f('0xf'));var Redis=require(_0xd47f('0x10'));var authService=require(_0xd47f('0x11'));var qs=require(_0xd47f('0x12'));var as=require(_0xd47f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd47f('0x14'))(_0xd47f('0x15'));var utils=require('../../config/utils');var config=require(_0xd47f('0x16'));var licenseUtil=require(_0xd47f('0x17'));var db=require(_0xd47f('0x18'))['db'];function respondWithStatusCode(_0x392009,_0x2aca02){_0x2aca02=_0x2aca02||0xcc;return function(_0x3fa73b){if(_0x3fa73b){return _0x392009['sendStatus'](_0x2aca02);}return _0x392009[_0xd47f('0x19')](_0x2aca02)[_0xd47f('0x1a')]();};}function respondWithResult(_0x18e12f,_0x38038f){_0x38038f=_0x38038f||0xc8;return function(_0xd6bb87){if(_0xd6bb87){return _0x18e12f[_0xd47f('0x19')](_0x38038f)[_0xd47f('0x1b')](_0xd6bb87);}};}function respondWithFilteredResult(_0x68fbd2,_0x3e1558){return function(_0x567f43){if(_0x567f43){var _0x4a1a6c=typeof _0x3e1558[_0xd47f('0x1c')]===_0xd47f('0x1d')&&typeof _0x3e1558['limit']===_0xd47f('0x1d');var _0x44973a=_0x567f43[_0xd47f('0x1e')];var _0x40c533=_0x4a1a6c?0x0:_0x3e1558[_0xd47f('0x1c')];var _0x5e5cf6=_0x4a1a6c?_0x567f43[_0xd47f('0x1e')]:_0x3e1558[_0xd47f('0x1c')]+_0x3e1558[_0xd47f('0x1f')];var _0x77e050;if(_0x5e5cf6>=_0x44973a){_0x5e5cf6=_0x44973a;_0x77e050=0xc8;}else{_0x77e050=0xce;}_0x68fbd2[_0xd47f('0x19')](_0x77e050);return _0x68fbd2[_0xd47f('0x20')](_0xd47f('0x21'),_0x40c533+'-'+_0x5e5cf6+'/'+_0x44973a)[_0xd47f('0x1b')](_0x567f43);}return null;};}function patchUpdates(_0x3663d3){return function(_0x1b93d3){try{jsonpatch[_0xd47f('0x22')](_0x1b93d3,_0x3663d3,!![]);}catch(_0x3f2e37){return BPromise[_0xd47f('0x23')](_0x3f2e37);}return _0x1b93d3['save']();};}function saveUpdates(_0x50f3f6,_0x336e1){return function(_0x58ee0b){if(_0x58ee0b){return _0x58ee0b[_0xd47f('0x24')](_0x50f3f6)[_0xd47f('0x25')](function(_0x117d9b){return _0x117d9b;});}return null;};}function removeEntity(_0x5695c5,_0x53a538){return function(_0x50b1d6){if(_0x50b1d6){return _0x50b1d6[_0xd47f('0x26')]()[_0xd47f('0x25')](function(){var _0x42873c=_0x50b1d6[_0xd47f('0x27')]({'plain':!![]});var _0x3f55b0='ChanSpies';return db[_0xd47f('0x28')]['destroy']({'where':{'type':_0x3f55b0,'resourceId':_0x42873c['id']}})['then'](function(){return _0x50b1d6;});})['then'](function(){_0x5695c5['status'](0xcc)[_0xd47f('0x1a')]();});}};}function handleEntityNotFound(_0x37e027,_0x5e2514){return function(_0x597440){if(!_0x597440){_0x37e027[_0xd47f('0x29')](0x194);}return _0x597440;};}function handleError(_0xcd94c7,_0x4da007){_0x4da007=_0x4da007||0x1f4;return function(_0x18d261){logger[_0xd47f('0x2a')](_0x18d261[_0xd47f('0x2b')]);if(_0x18d261[_0xd47f('0x2c')]){delete _0x18d261[_0xd47f('0x2c')];}_0xcd94c7[_0xd47f('0x19')](_0x4da007)['send'](_0x18d261);};}exports[_0xd47f('0x2d')]=function(_0x591042,_0x3f82b7){var _0x5df182={},_0x219a96={},_0x462e3d={'count':0x0,'rows':[]};var _0xd12466=_['map'](db['VoiceChanSpy'][_0xd47f('0x2e')],function(_0x20125a){return{'name':_0x20125a[_0xd47f('0x2f')],'type':_0x20125a[_0xd47f('0x30')][_0xd47f('0x31')]};});_0x219a96[_0xd47f('0x32')]=_[_0xd47f('0x33')](_0xd12466,_0xd47f('0x2c'));_0x219a96['query']=_[_0xd47f('0x34')](_0x591042[_0xd47f('0x35')]);_0x219a96[_0xd47f('0x36')]=_[_0xd47f('0x37')](_0x219a96[_0xd47f('0x32')],_0x219a96[_0xd47f('0x35')]);_0x5df182['attributes']=_[_0xd47f('0x37')](_0x219a96[_0xd47f('0x32')],qs[_0xd47f('0x38')](_0x591042[_0xd47f('0x35')]['fields']));_0x5df182[_0xd47f('0x39')]=_0x5df182[_0xd47f('0x39')][_0xd47f('0x3a')]?_0x5df182['attributes']:_0x219a96['model'];if(!_0x591042[_0xd47f('0x35')][_0xd47f('0x3b')](_0xd47f('0x3c'))){_0x5df182['limit']=qs[_0xd47f('0x1f')](_0x591042['query'][_0xd47f('0x1f')]);_0x5df182[_0xd47f('0x1c')]=qs[_0xd47f('0x1c')](_0x591042[_0xd47f('0x35')][_0xd47f('0x1c')]);}_0x5df182['order']=qs['sort'](_0x591042[_0xd47f('0x35')][_0xd47f('0x3d')]);_0x5df182[_0xd47f('0x3e')]=qs['filters'](_[_0xd47f('0x3f')](_0x591042[_0xd47f('0x35')],_0x219a96[_0xd47f('0x36')]),_0xd12466);if(_0x591042[_0xd47f('0x35')][_0xd47f('0x40')]){_0x5df182[_0xd47f('0x3e')]=_['merge'](_0x5df182[_0xd47f('0x3e')],{'$or':_[_0xd47f('0x33')](_0xd12466,function(_0x55c647){if(_0x55c647['type']!==_0xd47f('0x41')){var _0x5d866f={};_0x5d866f[_0x55c647[_0xd47f('0x2c')]]={'$like':'%'+_0x591042[_0xd47f('0x35')]['filter']+'%'};return _0x5d866f;}})});}_0x5df182=_[_0xd47f('0x42')]({},_0x5df182,_0x591042[_0xd47f('0x43')]);var _0x3803fc={'where':_0x5df182[_0xd47f('0x3e')]};return db[_0xd47f('0x44')]['count'](_0x3803fc)[_0xd47f('0x25')](function(_0x544a7e){_0x462e3d[_0xd47f('0x1e')]=_0x544a7e;if(_0x591042[_0xd47f('0x35')]['includeAll']){_0x5df182['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0xd47f('0x45')](_0x5df182);})[_0xd47f('0x25')](function(_0x5567e5){_0x462e3d[_0xd47f('0x46')]=_0x5567e5;return _0x462e3d;})[_0xd47f('0x25')](respondWithFilteredResult(_0x3f82b7,_0x5df182))[_0xd47f('0x47')](handleError(_0x3f82b7,null));};exports['show']=function(_0x413134,_0x6c7382){var _0x33ebf4={'raw':![],'where':{'id':_0x413134['params']['id']}},_0x2a4a6e={};_0x2a4a6e[_0xd47f('0x32')]=_['keys'](db[_0xd47f('0x44')][_0xd47f('0x2e')]);_0x2a4a6e['query']=_[_0xd47f('0x34')](_0x413134[_0xd47f('0x35')]);_0x2a4a6e[_0xd47f('0x36')]=_[_0xd47f('0x37')](_0x2a4a6e[_0xd47f('0x32')],_0x2a4a6e[_0xd47f('0x35')]);_0x33ebf4[_0xd47f('0x39')]=_[_0xd47f('0x37')](_0x2a4a6e[_0xd47f('0x32')],qs[_0xd47f('0x38')](_0x413134['query']['fields']));_0x33ebf4[_0xd47f('0x39')]=_0x33ebf4[_0xd47f('0x39')]['length']?_0x33ebf4[_0xd47f('0x39')]:_0x2a4a6e[_0xd47f('0x32')];if(_0x413134['query'][_0xd47f('0x48')]){_0x33ebf4[_0xd47f('0x49')]=[{'all':!![]}];}_0x33ebf4=_[_0xd47f('0x42')]({},_0x33ebf4,_0x413134[_0xd47f('0x43')]);return db[_0xd47f('0x44')][_0xd47f('0x4a')](_0x33ebf4)['then'](handleEntityNotFound(_0x6c7382,null))[_0xd47f('0x25')](respondWithResult(_0x6c7382,null))[_0xd47f('0x47')](handleError(_0x6c7382,null));};exports['create']=function(_0x532c08,_0x174c65){return db['VoiceChanSpy'][_0xd47f('0x4b')](_0x532c08[_0xd47f('0x4c')],{})[_0xd47f('0x25')](function(_0x2f5038){var _0x4814bd=_0x532c08['user']['get']({'plain':!![]});if(!_0x4814bd)throw new Error(_0xd47f('0x4d'));if(_0x4814bd['role']==='user'){var _0x335968=_0x2f5038['get']({'plain':!![]});var _0x57bfae=_0xd47f('0x4e');return db[_0xd47f('0x4f')][_0xd47f('0x4a')]({'where':{'name':_0x57bfae,'userProfileId':_0x4814bd[_0xd47f('0x50')]},'raw':!![]})['then'](function(_0x513d34){if(_0x513d34&&_0x513d34[_0xd47f('0x51')]===0x0){return db['UserProfileResource'][_0xd47f('0x4b')]({'name':_0x335968['name'],'resourceId':_0x335968['id'],'type':_0x513d34[_0xd47f('0x2c')],'sectionId':_0x513d34['id']},{})['then'](function(){return _0x2f5038;});}else{return _0x2f5038;}})[_0xd47f('0x47')](function(_0xaac4f4){logger[_0xd47f('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xaac4f4);throw _0xaac4f4;});}return _0x2f5038;})[_0xd47f('0x25')](respondWithResult(_0x174c65,0xc9))[_0xd47f('0x47')](handleError(_0x174c65,null));};exports[_0xd47f('0x24')]=function(_0x3ac703,_0x58f343){if(_0x3ac703[_0xd47f('0x4c')]['id']){delete _0x3ac703[_0xd47f('0x4c')]['id'];}return db[_0xd47f('0x44')]['find']({'where':{'id':_0x3ac703['params']['id']}})[_0xd47f('0x25')](handleEntityNotFound(_0x58f343,null))[_0xd47f('0x25')](saveUpdates(_0x3ac703['body'],null))[_0xd47f('0x25')](respondWithResult(_0x58f343,null))[_0xd47f('0x47')](handleError(_0x58f343,null));};exports[_0xd47f('0x26')]=function(_0x444724,_0x49087d){return db['VoiceChanSpy'][_0xd47f('0x4a')]({'where':{'id':_0x444724[_0xd47f('0x52')]['id']}})[_0xd47f('0x25')](handleEntityNotFound(_0x49087d,null))[_0xd47f('0x25')](removeEntity(_0x49087d,null))['catch'](handleError(_0x49087d,null));}; \ No newline at end of file +var _0x9d02=['save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','VoiceChanSpy','type','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','include','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChanSpies','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','squel','crypto','desk.js','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','count','limit','set','Content-Range','apply','reject'];(function(_0x5cca31,_0x17e88f){var _0x3bddc6=function(_0x3b50ee){while(--_0x3b50ee){_0x5cca31['push'](_0x5cca31['shift']());}};_0x3bddc6(++_0x17e88f);}(_0x9d02,0x118));var _0x29d0=function(_0x39cc88,_0x16ebe4){_0x39cc88=_0x39cc88-0x0;var _0x4256fa=_0x9d02[_0x39cc88];return _0x4256fa;};'use strict';var emlformat=require(_0x29d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x29d0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29d0('0x2'));var moment=require('moment');var BPromise=require(_0x29d0('0x3'));var Mustache=require(_0x29d0('0x4'));var util=require('util');var path=require(_0x29d0('0x5'));var sox=require(_0x29d0('0x6'));var csv=require(_0x29d0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x29d0('0x8'));var crypto=require(_0x29d0('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x29d0('0xa'));var toCsv=require(_0x29d0('0x7'));var querystring=require('querystring');var Papa=require(_0x29d0('0xb'));var Redis=require(_0x29d0('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x29d0('0xd'));var as=require(_0x29d0('0xe'));var hardwareService=require(_0x29d0('0xf'));var logger=require(_0x29d0('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x29d0('0x11'));var licenseUtil=require(_0x29d0('0x12'));var db=require(_0x29d0('0x13'))['db'];function respondWithStatusCode(_0x1413fd,_0x12cba7){_0x12cba7=_0x12cba7||0xcc;return function(_0x357120){if(_0x357120){return _0x1413fd[_0x29d0('0x14')](_0x12cba7);}return _0x1413fd[_0x29d0('0x15')](_0x12cba7)[_0x29d0('0x16')]();};}function respondWithResult(_0x4c5eed,_0x22903c){_0x22903c=_0x22903c||0xc8;return function(_0x2474b3){if(_0x2474b3){return _0x4c5eed[_0x29d0('0x15')](_0x22903c)[_0x29d0('0x17')](_0x2474b3);}};}function respondWithFilteredResult(_0x120c96,_0xa0b9dc){return function(_0x55ba12){if(_0x55ba12){var _0x24562f=typeof _0xa0b9dc[_0x29d0('0x18')]===_0x29d0('0x19')&&typeof _0xa0b9dc['limit']===_0x29d0('0x19');var _0x6964fa=_0x55ba12[_0x29d0('0x1a')];var _0x443031=_0x24562f?0x0:_0xa0b9dc[_0x29d0('0x18')];var _0x28c0ee=_0x24562f?_0x55ba12['count']:_0xa0b9dc[_0x29d0('0x18')]+_0xa0b9dc[_0x29d0('0x1b')];var _0x1135f6;if(_0x28c0ee>=_0x6964fa){_0x28c0ee=_0x6964fa;_0x1135f6=0xc8;}else{_0x1135f6=0xce;}_0x120c96[_0x29d0('0x15')](_0x1135f6);return _0x120c96[_0x29d0('0x1c')](_0x29d0('0x1d'),_0x443031+'-'+_0x28c0ee+'/'+_0x6964fa)['json'](_0x55ba12);}return null;};}function patchUpdates(_0x385e63){return function(_0x170993){try{jsonpatch[_0x29d0('0x1e')](_0x170993,_0x385e63,!![]);}catch(_0x4d981a){return BPromise[_0x29d0('0x1f')](_0x4d981a);}return _0x170993[_0x29d0('0x20')]();};}function saveUpdates(_0x1f9e73,_0x4179a0){return function(_0x5cf0dc){if(_0x5cf0dc){return _0x5cf0dc[_0x29d0('0x21')](_0x1f9e73)[_0x29d0('0x22')](function(_0x47302e){return _0x47302e;});}return null;};}function removeEntity(_0x5aed48,_0x40da12){return function(_0x1c80f2){if(_0x1c80f2){return _0x1c80f2[_0x29d0('0x23')]()[_0x29d0('0x22')](function(){var _0x2a976d=_0x1c80f2[_0x29d0('0x24')]({'plain':!![]});var _0x39037a='ChanSpies';return db[_0x29d0('0x25')][_0x29d0('0x23')]({'where':{'type':_0x39037a,'resourceId':_0x2a976d['id']}})[_0x29d0('0x22')](function(){return _0x1c80f2;});})[_0x29d0('0x22')](function(){_0x5aed48[_0x29d0('0x15')](0xcc)[_0x29d0('0x16')]();});}};}function handleEntityNotFound(_0x5c4be8,_0x342a0d){return function(_0x4b6012){if(!_0x4b6012){_0x5c4be8[_0x29d0('0x14')](0x194);}return _0x4b6012;};}function handleError(_0x579948,_0x123637){_0x123637=_0x123637||0x1f4;return function(_0x275f80){logger[_0x29d0('0x26')](_0x275f80[_0x29d0('0x27')]);if(_0x275f80[_0x29d0('0x28')]){delete _0x275f80[_0x29d0('0x28')];}_0x579948[_0x29d0('0x15')](_0x123637)[_0x29d0('0x29')](_0x275f80);};}exports[_0x29d0('0x2a')]=function(_0x3f7809,_0x15bb23){var _0x5aeee9={},_0x308e22={},_0x1df4b3={'count':0x0,'rows':[]};var _0x1d4d3d=_['map'](db[_0x29d0('0x2b')]['rawAttributes'],function(_0x345ce9){return{'name':_0x345ce9['fieldName'],'type':_0x345ce9[_0x29d0('0x2c')]['key']};});_0x308e22[_0x29d0('0x2d')]=_['map'](_0x1d4d3d,_0x29d0('0x28'));_0x308e22[_0x29d0('0x2e')]=_[_0x29d0('0x2f')](_0x3f7809[_0x29d0('0x2e')]);_0x308e22[_0x29d0('0x30')]=_['intersection'](_0x308e22[_0x29d0('0x2d')],_0x308e22[_0x29d0('0x2e')]);_0x5aeee9['attributes']=_['intersection'](_0x308e22['model'],qs['fields'](_0x3f7809[_0x29d0('0x2e')]['fields']));_0x5aeee9[_0x29d0('0x31')]=_0x5aeee9[_0x29d0('0x31')][_0x29d0('0x32')]?_0x5aeee9[_0x29d0('0x31')]:_0x308e22['model'];if(!_0x3f7809[_0x29d0('0x2e')][_0x29d0('0x33')](_0x29d0('0x34'))){_0x5aeee9['limit']=qs['limit'](_0x3f7809['query']['limit']);_0x5aeee9[_0x29d0('0x18')]=qs[_0x29d0('0x18')](_0x3f7809[_0x29d0('0x2e')][_0x29d0('0x18')]);}_0x5aeee9[_0x29d0('0x35')]=qs[_0x29d0('0x36')](_0x3f7809[_0x29d0('0x2e')]['sort']);_0x5aeee9[_0x29d0('0x37')]=qs[_0x29d0('0x30')](_[_0x29d0('0x38')](_0x3f7809['query'],_0x308e22[_0x29d0('0x30')]),_0x1d4d3d);if(_0x3f7809['query'][_0x29d0('0x39')]){_0x5aeee9['where']=_['merge'](_0x5aeee9[_0x29d0('0x37')],{'$or':_[_0x29d0('0x3a')](_0x1d4d3d,function(_0x3ffece){if(_0x3ffece['type']!==_0x29d0('0x3b')){var _0x1076e0={};_0x1076e0[_0x3ffece[_0x29d0('0x28')]]={'$like':'%'+_0x3f7809[_0x29d0('0x2e')][_0x29d0('0x39')]+'%'};return _0x1076e0;}})});}_0x5aeee9=_[_0x29d0('0x3c')]({},_0x5aeee9,_0x3f7809[_0x29d0('0x3d')]);var _0x539190={'where':_0x5aeee9['where']};return db[_0x29d0('0x2b')]['count'](_0x539190)[_0x29d0('0x22')](function(_0x3f95db){_0x1df4b3[_0x29d0('0x1a')]=_0x3f95db;if(_0x3f7809[_0x29d0('0x2e')][_0x29d0('0x3e')]){_0x5aeee9['include']=[{'all':!![]}];}return db[_0x29d0('0x2b')][_0x29d0('0x3f')](_0x5aeee9);})[_0x29d0('0x22')](function(_0x3370dc){_0x1df4b3['rows']=_0x3370dc;return _0x1df4b3;})[_0x29d0('0x22')](respondWithFilteredResult(_0x15bb23,_0x5aeee9))[_0x29d0('0x40')](handleError(_0x15bb23,null));};exports[_0x29d0('0x41')]=function(_0x35b606,_0x3e42c0){var _0x23eebf={'raw':![],'where':{'id':_0x35b606[_0x29d0('0x42')]['id']}},_0x33ca2f={};_0x33ca2f[_0x29d0('0x2d')]=_[_0x29d0('0x2f')](db[_0x29d0('0x2b')][_0x29d0('0x43')]);_0x33ca2f[_0x29d0('0x2e')]=_[_0x29d0('0x2f')](_0x35b606['query']);_0x33ca2f[_0x29d0('0x30')]=_['intersection'](_0x33ca2f[_0x29d0('0x2d')],_0x33ca2f[_0x29d0('0x2e')]);_0x23eebf[_0x29d0('0x31')]=_['intersection'](_0x33ca2f['model'],qs[_0x29d0('0x44')](_0x35b606[_0x29d0('0x2e')][_0x29d0('0x44')]));_0x23eebf[_0x29d0('0x31')]=_0x23eebf['attributes'][_0x29d0('0x32')]?_0x23eebf[_0x29d0('0x31')]:_0x33ca2f[_0x29d0('0x2d')];if(_0x35b606[_0x29d0('0x2e')][_0x29d0('0x3e')]){_0x23eebf[_0x29d0('0x45')]=[{'all':!![]}];}_0x23eebf=_[_0x29d0('0x3c')]({},_0x23eebf,_0x35b606['options']);return db['VoiceChanSpy'][_0x29d0('0x46')](_0x23eebf)[_0x29d0('0x22')](handleEntityNotFound(_0x3e42c0,null))['then'](respondWithResult(_0x3e42c0,null))[_0x29d0('0x40')](handleError(_0x3e42c0,null));};exports['create']=function(_0x418761,_0x1ceb93){return db[_0x29d0('0x2b')]['create'](_0x418761['body'],{})[_0x29d0('0x22')](function(_0x84156b){var _0x364302=_0x418761['user']['get']({'plain':!![]});if(!_0x364302)throw new Error(_0x29d0('0x47'));if(_0x364302['role']===_0x29d0('0x48')){var _0x1e1dc2=_0x84156b['get']({'plain':!![]});var _0x430830=_0x29d0('0x49');return db[_0x29d0('0x4a')][_0x29d0('0x46')]({'where':{'name':_0x430830,'userProfileId':_0x364302['userProfileId']},'raw':!![]})[_0x29d0('0x22')](function(_0x3435c6){if(_0x3435c6&&_0x3435c6[_0x29d0('0x4b')]===0x0){return db[_0x29d0('0x25')]['create']({'name':_0x1e1dc2['name'],'resourceId':_0x1e1dc2['id'],'type':_0x3435c6[_0x29d0('0x28')],'sectionId':_0x3435c6['id']},{})[_0x29d0('0x22')](function(){return _0x84156b;});}else{return _0x84156b;}})[_0x29d0('0x40')](function(_0x30502b){logger[_0x29d0('0x26')](_0x29d0('0x4c'),_0x30502b);throw _0x30502b;});}return _0x84156b;})[_0x29d0('0x22')](respondWithResult(_0x1ceb93,0xc9))[_0x29d0('0x40')](handleError(_0x1ceb93,null));};exports['update']=function(_0x81a61e,_0x978177){if(_0x81a61e['body']['id']){delete _0x81a61e[_0x29d0('0x4d')]['id'];}return db[_0x29d0('0x2b')][_0x29d0('0x46')]({'where':{'id':_0x81a61e['params']['id']}})['then'](handleEntityNotFound(_0x978177,null))[_0x29d0('0x22')](saveUpdates(_0x81a61e[_0x29d0('0x4d')],null))[_0x29d0('0x22')](respondWithResult(_0x978177,null))[_0x29d0('0x40')](handleError(_0x978177,null));};exports['destroy']=function(_0x2f3566,_0x31b1b8){return db[_0x29d0('0x2b')]['find']({'where':{'id':_0x2f3566[_0x29d0('0x42')]['id']}})[_0x29d0('0x22')](handleEntityNotFound(_0x31b1b8,null))['then'](removeEntity(_0x31b1b8,null))[_0x29d0('0x40')](handleError(_0x31b1b8,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 20ef785..e707380 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 _0x44b5=['VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','context','from-sip','%s%s','prefix','system','push','merge','format','CDR(type)=%s','record','Authenticate','SIP/%s,%s','name','options','length','internal','User','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x44b5,0x99));var _0x544b=function(_0x2606ad,_0x145fa2){_0x2606ad=_0x2606ad-0x0;var _0x550264=_0x44b5[_0x2606ad];return _0x550264;};'use strict';var _=require(_0x544b('0x0'));var util=require(_0x544b('0x1'));var BPromise=require(_0x544b('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x2dc3b0,_0x59eb78,_0x5a3d69){var _0x2909a4=0x1;var _0x1aaa4e=[];var _0x4d558f={'context':_0x59eb78[_0x544b('0x3')]||_0x544b('0x4'),'exten':util['format'](_0x544b('0x5'),_0x2dc3b0[_0x544b('0x6')],_0x5a3d69),'type':_0x544b('0x7'),'isApp':![],'ChanSpyId':_0x2dc3b0['id'],'UserId':_0x59eb78['id']};_0x1aaa4e[_0x544b('0x8')](_[_0x544b('0x9')]({'app':'Set','appdata':util[_0x544b('0xa')](_0x544b('0xb'),'chanspy'),'priority':_0x2909a4++},_0x4d558f));if(_0x2dc3b0[_0x544b('0xc')]){_0x1aaa4e['push'](_[_0x544b('0x9')]({'app':'MixMonitor','appdata':util[_0x544b('0xa')]('${UNIQUEID}.%s,a',_0x2dc3b0['recordingFormat']),'priority':_0x2909a4++},_0x4d558f));}if(_0x2dc3b0['auth']){_0x1aaa4e[_0x544b('0x8')](_[_0x544b('0x9')]({'app':_0x544b('0xd'),'appdata':_0x2dc3b0['password'],'priority':_0x2909a4++},_0x4d558f));}_0x1aaa4e[_0x544b('0x8')](_['merge']({'app':'ChanSpy','appdata':util[_0x544b('0xa')](_0x544b('0xe'),_0x59eb78[_0x544b('0xf')],_0x2dc3b0[_0x544b('0x10')]?_0x2dc3b0[_0x544b('0x10')]['join'](''):''),'priority':_0x2909a4++},_0x4d558f));if(_0x2dc3b0[_0x544b('0xc')]){_0x1aaa4e[_0x544b('0x8')](_[_0x544b('0x9')]({'app':'StopMixMonitor','priority':_0x2909a4++},_0x4d558f));}return _0x1aaa4e;};var getChanSpyApplications=function(_0x3b660e,_0x379d6e){var _0x4e9df0=[];for(var _0x122b8f=0x0,_0x242abf=0x1;_0x122b8f<_0x379d6e[_0x544b('0x11')];_0x122b8f++,_0x242abf=0x1){_0x4e9df0=_0x4e9df0['concat'](getUserApplications(_0x3b660e,_0x379d6e[_0x122b8f],_0x379d6e[_0x122b8f][_0x544b('0x12')]));if(_0x379d6e[_0x122b8f][_0x544b('0x12')]!=_0x379d6e[_0x122b8f][_0x544b('0xf')]){_0x4e9df0=_0x4e9df0['concat'](getUserApplications(_0x3b660e,_0x379d6e[_0x122b8f],_0x379d6e[_0x122b8f][_0x544b('0xf')]));}}return _0x4e9df0;};var getChanSpyPromise=function(_0x5d20da,_0x5356dd){return new BPromise(function(_0x5b490b,_0x83ebc7){return _0x5d20da[_0x544b('0x13')]['findAll']({'attributes':['id',_0x544b('0xf'),_0x544b('0x12')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x544b('0x14')](function(_0x48f97b){if(_0x48f97b){return _0x5b490b(getChanSpyApplications(_0x5356dd,_0x48f97b));}return _0x5b490b([]);})[_0x544b('0x15')](function(_0x25789e){_0x83ebc7(_0x25789e);});});};module[_0x544b('0x16')]=function(_0x166bea,_0x5a7e94){var _0x5a9523=_0x166bea[_0x544b('0x17')];return _0x166bea[_0x544b('0x18')](_0x544b('0x19'),attributes,{'tableName':_0x544b('0x1a'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1b0b65,_0x5f483b,_0x30463e){return getChanSpyPromise(_0x5a9523,_0x1b0b65)[_0x544b('0x14')](function(_0xd0f287){if(_0xd0f287&&_0xd0f287[_0x544b('0x11')]){return _0x5a9523[_0x544b('0x1b')][_0x544b('0x1c')](_0xd0f287);}})['then'](function(){_0x30463e();})[_0x544b('0x15')](function(_0x98fc4a){_0x30463e(_0x98fc4a);});},'afterUpdate':function(_0x70b440,_0x7c0b2e,_0x5d6cd3){return _0x5a9523[_0x544b('0x1b')]['destroy']({'where':{'ChanSpyId':_0x70b440['id']}})[_0x544b('0x14')](function(){return getChanSpyPromise(_0x5a9523,_0x70b440);})[_0x544b('0x14')](function(_0x2bfa10){if(_0x2bfa10&&_0x2bfa10[_0x544b('0x11')]){return _0x5a9523[_0x544b('0x1b')][_0x544b('0x1c')](_0x2bfa10);}})[_0x544b('0x14')](function(){_0x5d6cd3();})[_0x544b('0x15')](function(_0x227ac6){_0x5d6cd3(_0x227ac6);});},'afterDestroy':function(_0xf49e4b,_0x2bb5f2,_0x3c9801){return _0x5a9523[_0x544b('0x1b')][_0x544b('0x1d')]({'where':{'ChanSpyId':_0xf49e4b['id']}})[_0x544b('0x14')](function(){_0x3c9801();})[_0x544b('0x15')](function(_0x7102d3){_0x3c9801(_0x7102d3);});}}});}; \ No newline at end of file +var _0x2c38=['prefix','push','Set','chanspy','record','merge','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','concat','internal','findAll','agent','catch','exports','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','destroy','length','lodash','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s'];(function(_0x30c28e,_0x33b898){var _0x4e9795=function(_0xb0b7ad){while(--_0xb0b7ad){_0x30c28e['push'](_0x30c28e['shift']());}};_0x4e9795(++_0x33b898);}(_0x2c38,0x112));var _0x82c3=function(_0x5ad3d3,_0x2d400c){_0x5ad3d3=_0x5ad3d3-0x0;var _0x4344e7=_0x2c38[_0x5ad3d3];return _0x4344e7;};'use strict';var _=require(_0x82c3('0x0'));var util=require('util');var BPromise=require(_0x82c3('0x1'));var attributes=require(_0x82c3('0x2'));var getUserApplications=function(_0x582d8b,_0x5bffe3,_0x1e2e3e){var _0x1b18f4=0x1;var _0x962ab1=[];var _0x484a58={'context':_0x5bffe3['context']||_0x82c3('0x3'),'exten':util[_0x82c3('0x4')](_0x82c3('0x5'),_0x582d8b[_0x82c3('0x6')],_0x1e2e3e),'type':'system','isApp':![],'ChanSpyId':_0x582d8b['id'],'UserId':_0x5bffe3['id']};_0x962ab1[_0x82c3('0x7')](_['merge']({'app':_0x82c3('0x8'),'appdata':util['format']('CDR(type)=%s',_0x82c3('0x9')),'priority':_0x1b18f4++},_0x484a58));if(_0x582d8b[_0x82c3('0xa')]){_0x962ab1[_0x82c3('0x7')](_[_0x82c3('0xb')]({'app':'MixMonitor','appdata':util['format'](_0x82c3('0xc'),_0x582d8b[_0x82c3('0xd')]),'priority':_0x1b18f4++},_0x484a58));}if(_0x582d8b[_0x82c3('0xe')]){_0x962ab1[_0x82c3('0x7')](_['merge']({'app':_0x82c3('0xf'),'appdata':_0x582d8b[_0x82c3('0x10')],'priority':_0x1b18f4++},_0x484a58));}_0x962ab1[_0x82c3('0x7')](_['merge']({'app':_0x82c3('0x11'),'appdata':util['format'](_0x82c3('0x12'),_0x5bffe3[_0x82c3('0x13')],_0x582d8b[_0x82c3('0x14')]?_0x582d8b[_0x82c3('0x14')]['join'](''):''),'priority':_0x1b18f4++},_0x484a58));if(_0x582d8b[_0x82c3('0xa')]){_0x962ab1[_0x82c3('0x7')](_[_0x82c3('0xb')]({'app':_0x82c3('0x15'),'priority':_0x1b18f4++},_0x484a58));}return _0x962ab1;};var getChanSpyApplications=function(_0x17d2f4,_0x4e7c13){var _0x39dd09=[];for(var _0x522a2c=0x0,_0x3ca38f=0x1;_0x522a2c<_0x4e7c13['length'];_0x522a2c++,_0x3ca38f=0x1){_0x39dd09=_0x39dd09[_0x82c3('0x16')](getUserApplications(_0x17d2f4,_0x4e7c13[_0x522a2c],_0x4e7c13[_0x522a2c][_0x82c3('0x17')]));if(_0x4e7c13[_0x522a2c][_0x82c3('0x17')]!=_0x4e7c13[_0x522a2c]['name']){_0x39dd09=_0x39dd09[_0x82c3('0x16')](getUserApplications(_0x17d2f4,_0x4e7c13[_0x522a2c],_0x4e7c13[_0x522a2c][_0x82c3('0x13')]));}}return _0x39dd09;};var getChanSpyPromise=function(_0x2deb06,_0x1dcfc1){return new BPromise(function(_0x279995,_0x53d5a2){return _0x2deb06['User'][_0x82c3('0x18')]({'attributes':['id','name','internal'],'where':{'role':_0x82c3('0x19'),'chanspy':!![]},'raw':!![]})['then'](function(_0x2ca01b){if(_0x2ca01b){return _0x279995(getChanSpyApplications(_0x1dcfc1,_0x2ca01b));}return _0x279995([]);})[_0x82c3('0x1a')](function(_0x24ebe1){_0x53d5a2(_0x24ebe1);});});};module[_0x82c3('0x1b')]=function(_0xceb851,_0x1dafa5){var _0x12cad0=_0xceb851['models'];return _0xceb851[_0x82c3('0x1c')](_0x82c3('0x1d'),attributes,{'tableName':_0x82c3('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x17843c,_0x127daf,_0x126628){return getChanSpyPromise(_0x12cad0,_0x17843c)[_0x82c3('0x1f')](function(_0x465fd0){if(_0x465fd0&&_0x465fd0['length']){return _0x12cad0[_0x82c3('0x20')]['bulkCreate'](_0x465fd0);}})['then'](function(){_0x126628();})['catch'](function(_0x4e12c8){_0x126628(_0x4e12c8);});},'afterUpdate':function(_0x551388,_0x5bbdac,_0x342611){return _0x12cad0[_0x82c3('0x20')][_0x82c3('0x21')]({'where':{'ChanSpyId':_0x551388['id']}})[_0x82c3('0x1f')](function(){return getChanSpyPromise(_0x12cad0,_0x551388);})[_0x82c3('0x1f')](function(_0x13de01){if(_0x13de01&&_0x13de01[_0x82c3('0x22')]){return _0x12cad0[_0x82c3('0x20')]['bulkCreate'](_0x13de01);}})[_0x82c3('0x1f')](function(){_0x342611();})[_0x82c3('0x1a')](function(_0x5234e7){_0x342611(_0x5234e7);});},'afterDestroy':function(_0x1d4cbf,_0x2bf691,_0x1ff34d){return _0x12cad0[_0x82c3('0x20')][_0x82c3('0x21')]({'where':{'ChanSpyId':_0x1d4cbf['id']}})[_0x82c3('0x1f')](function(){_0x1ff34d();})[_0x82c3('0x1a')](function(_0x10bdc1){_0x1ff34d(_0x10bdc1);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 96a753f..671ac65 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 _0x3e5c=['info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\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','client','http','request','then'];(function(_0x27ba70,_0x220665){var _0x8d9ba4=function(_0xfe5275){while(--_0xfe5275){_0x27ba70['push'](_0x27ba70['shift']());}};_0x8d9ba4(++_0x220665);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x2fe600,_0x5179de){_0x2fe600=_0x2fe600-0x0;var _0x218701=_0x3e5c[_0x2fe600];return _0x218701;};'use strict';var _=require(_0xc3e5('0x0'));var util=require(_0xc3e5('0x1'));var moment=require(_0xc3e5('0x2'));var BPromise=require(_0xc3e5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3e5('0x4'));var db=require(_0xc3e5('0x5'))['db'];var utils=require(_0xc3e5('0x6'));var logger=require(_0xc3e5('0x7'))(_0xc3e5('0x8'));var config=require(_0xc3e5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3e5('0xa')][_0xc3e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d6089,_0xcbbec0,_0x2d580e){return new BPromise(function(_0x4864a2,_0x196f3a){return client[_0xc3e5('0xc')](_0x2d6089,_0x2d580e)[_0xc3e5('0xd')](function(_0x19813b){logger[_0xc3e5('0xe')](_0xc3e5('0xf'),_0xcbbec0,_0xc3e5('0x10'));logger['debug'](_0xc3e5('0x11'),_0xcbbec0,_0xc3e5('0x10'),JSON[_0xc3e5('0x12')](_0x19813b));if(_0x19813b[_0xc3e5('0x13')]){if(_0x19813b['error'][_0xc3e5('0x14')]===0x1f4){logger[_0xc3e5('0x13')](_0xc3e5('0xf'),_0xcbbec0,_0x19813b[_0xc3e5('0x13')][_0xc3e5('0x15')]);return _0x196f3a(_0x19813b[_0xc3e5('0x13')]['message']);}logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0xcbbec0,_0x19813b[_0xc3e5('0x13')]['message']);return _0x4864a2(_0x19813b[_0xc3e5('0x13')][_0xc3e5('0x15')]);}else{logger['info'](_0xc3e5('0xf'),_0xcbbec0,_0xc3e5('0x10'));_0x4864a2(_0x19813b[_0xc3e5('0x16')][_0xc3e5('0x15')]);}})[_0xc3e5('0x17')](function(_0x47cfd8){logger[_0xc3e5('0x13')](_0xc3e5('0xf'),_0xcbbec0,_0x47cfd8);_0x196f3a(_0x47cfd8);});});} \ No newline at end of file +var _0xca66=['http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x5085d6,_0x3a72fc){var _0x29d829=function(_0x1cbd40){while(--_0x1cbd40){_0x5085d6['push'](_0x5085d6['shift']());}};_0x29d829(++_0x3a72fc);}(_0xca66,0x8b));var _0x6ca6=function(_0x40ea0e,_0x5cdf8d){_0x40ea0e=_0x40ea0e-0x0;var _0x590ee6=_0xca66[_0x40ea0e];return _0x590ee6;};'use strict';var _=require(_0x6ca6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ca6('0x1'));var rs=require(_0x6ca6('0x2'));var fs=require('fs');var Redis=require(_0x6ca6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ca6('0x4'));var logger=require('../../config/logger')(_0x6ca6('0x5'));var config=require('../../config/environment');var jayson=require(_0x6ca6('0x6'));var client=jayson[_0x6ca6('0x7')][_0x6ca6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44019c,_0x407e66,_0x27a210){return new BPromise(function(_0x27d280,_0x4f5651){return client[_0x6ca6('0x9')](_0x44019c,_0x27a210)[_0x6ca6('0xa')](function(_0x34b71b){logger[_0x6ca6('0xb')](_0x6ca6('0xc'),_0x407e66,_0x6ca6('0xd'));logger[_0x6ca6('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x407e66,_0x6ca6('0xd'),JSON[_0x6ca6('0xf')](_0x34b71b));if(_0x34b71b[_0x6ca6('0x10')]){if(_0x34b71b[_0x6ca6('0x10')][_0x6ca6('0x11')]===0x1f4){logger[_0x6ca6('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x407e66,_0x34b71b[_0x6ca6('0x10')][_0x6ca6('0x12')]);return _0x4f5651(_0x34b71b['error'][_0x6ca6('0x12')]);}logger[_0x6ca6('0x10')](_0x6ca6('0xc'),_0x407e66,_0x34b71b[_0x6ca6('0x10')][_0x6ca6('0x12')]);return _0x27d280(_0x34b71b[_0x6ca6('0x10')]['message']);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x407e66,_0x6ca6('0xd'));_0x27d280(_0x34b71b[_0x6ca6('0x13')][_0x6ca6('0x12')]);}})[_0x6ca6('0x14')](function(_0x2c4a5c){logger[_0x6ca6('0x10')](_0x6ca6('0xc'),_0x407e66,_0x2c4a5c);_0x4f5651(_0x2c4a5c);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index f82e54b..1698edb 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 _0x3b90=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','isAuthenticated','show','post','create','put','/:id','delete','exports','path'];(function(_0x52e770,_0x464eb9){var _0x55f877=function(_0x4fa581){while(--_0x4fa581){_0x52e770['push'](_0x52e770['shift']());}};_0x55f877(++_0x464eb9);}(_0x3b90,0x12f));var _0x03b9=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x3b90[_0x1b6c6d];return _0x290d9d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x03b9('0x0'));var timeout=require(_0x03b9('0x1'));var express=require(_0x03b9('0x2'));var router=express[_0x03b9('0x3')]();var fs_extra=require(_0x03b9('0x4'));var auth=require(_0x03b9('0x5'));var interaction=require(_0x03b9('0x6'));var config=require(_0x03b9('0x7'));var controller=require(_0x03b9('0x8'));router[_0x03b9('0x9')]('/',auth['isAuthenticated'](),controller[_0x03b9('0xa')]);router['get']('/:id',auth[_0x03b9('0xb')](),controller[_0x03b9('0xc')]);router[_0x03b9('0xd')]('/',auth[_0x03b9('0xb')](),controller[_0x03b9('0xe')]);router[_0x03b9('0xf')](_0x03b9('0x10'),auth[_0x03b9('0xb')](),controller['update']);router[_0x03b9('0x11')]('/:id',auth[_0x03b9('0xb')](),controller['destroy']);module[_0x03b9('0x12')]=router; \ No newline at end of file +var _0xf76e=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','post','create','put','update','delete','exports','multer','util','path'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xf76e,0x10b));var _0xef76=function(_0x14cad1,_0x40786d){_0x14cad1=_0x14cad1-0x0;var _0x708810=_0xf76e[_0x14cad1];return _0x708810;};'use strict';var multer=require(_0xef76('0x0'));var util=require(_0xef76('0x1'));var path=require(_0xef76('0x2'));var timeout=require(_0xef76('0x3'));var express=require('express');var router=express[_0xef76('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xef76('0x5'));var interaction=require(_0xef76('0x6'));var config=require(_0xef76('0x7'));var controller=require(_0xef76('0x8'));router[_0xef76('0x9')]('/',auth[_0xef76('0xa')](),controller[_0xef76('0xb')]);router[_0xef76('0x9')]('/:id',auth[_0xef76('0xa')](),controller['show']);router[_0xef76('0xc')]('/',auth[_0xef76('0xa')](),controller[_0xef76('0xd')]);router[_0xef76('0xe')]('/:id',auth[_0xef76('0xa')](),controller[_0xef76('0xf')]);router[_0xef76('0x10')]('/:id',auth[_0xef76('0xa')](),controller['destroy']);module[_0xef76('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index c235c4f..e347387 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 _0xd125=['STRING','name','BOOLEAN','sequelize'];(function(_0x340907,_0x4a9781){var _0x1cd555=function(_0x29b4b5){while(--_0x29b4b5){_0x340907['push'](_0x340907['shift']());}};_0x1cd555(++_0x4a9781);}(_0xd125,0x177));var _0x5d12=function(_0x2242f2,_0x11d5b0){_0x2242f2=_0x2242f2-0x0;var _0x11c75f=_0xd125[_0x2242f2];return _0x11c75f;};'use strict';var Sequelize=require(_0x5d12('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d12('0x1')],'unique':_0x5d12('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x5d12('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc522=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x3b09a7,_0x1af8d2){var _0x32a573=function(_0x235e54){while(--_0x235e54){_0x3b09a7['push'](_0x3b09a7['shift']());}};_0x32a573(++_0x1af8d2);}(_0xc522,0x128));var _0x2c52=function(_0x2144bd,_0x3d3fbd){_0x2144bd=_0x2144bd-0x0;var _0x78b508=_0xc522[_0x2144bd];return _0x78b508;};'use strict';var Sequelize=require(_0x2c52('0x0'));module[_0x2c52('0x1')]={'name':{'type':Sequelize[_0x2c52('0x2')],'unique':_0x2c52('0x3')},'description':{'type':Sequelize[_0x2c52('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x2c52('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index aec2f74..25a1be6 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 _0x7424=['params','length','options','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/extensions_xcally_contexts.conf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','count','limit','apply','save','update','get','Contexts','UserProfileResource','destroy','stack','name','send','index','map','VoiceContext','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','includeAll','include','findAll','catch'];(function(_0x5da4a3,_0x169e9d){var _0x5bd151=function(_0x2f89c0){while(--_0x2f89c0){_0x5da4a3['push'](_0x5da4a3['shift']());}};_0x5bd151(++_0x169e9d);}(_0x7424,0xdc));var _0x4742=function(_0x1d57d1,_0x3a6a09){_0x1d57d1=_0x1d57d1-0x0;var _0x728751=_0x7424[_0x1d57d1];return _0x728751;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4742('0x0'));var zipdir=require(_0x4742('0x1'));var jsonpatch=require(_0x4742('0x2'));var rp=require(_0x4742('0x3'));var moment=require(_0x4742('0x4'));var BPromise=require(_0x4742('0x5'));var Mustache=require('mustache');var util=require(_0x4742('0x6'));var path=require(_0x4742('0x7'));var sox=require('sox');var csv=require(_0x4742('0x8'));var ejs=require(_0x4742('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4742('0xa'));var squel=require(_0x4742('0xb'));var crypto=require(_0x4742('0xc'));var jsforce=require(_0x4742('0xd'));var deskjs=require(_0x4742('0xe'));var toCsv=require(_0x4742('0x8'));var querystring=require(_0x4742('0xf'));var Papa=require('papaparse');var Redis=require(_0x4742('0x10'));var authService=require(_0x4742('0x11'));var qs=require(_0x4742('0x12'));var as=require(_0x4742('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4742('0x14'))(_0x4742('0x15'));var utils=require(_0x4742('0x16'));var config=require(_0x4742('0x17'));var licenseUtil=require(_0x4742('0x18'));var db=require(_0x4742('0x19'))['db'];var jayson=require(_0x4742('0x1a'));var client=jayson[_0x4742('0x1b')][_0x4742('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4053e3,_0x5e6a20,_0x48d062,_0x3f5516){return new BPromise(function(_0x16b800,_0xc8b6ed){var _0x2342f3=_0x3f5516||client;return _0x2342f3[_0x4742('0x1d')](_0x4053e3,_0x48d062)[_0x4742('0x1e')](function(_0x532ff3){logger[_0x4742('0x1f')](_0x4742('0x20'),_0x5e6a20,_0x4742('0x21'));logger[_0x4742('0x22')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5e6a20,_0x4742('0x21'),JSON[_0x4742('0x23')](_0x532ff3));if(_0x532ff3[_0x4742('0x24')]){if(_0x532ff3['error']['code']===0x1f4){logger[_0x4742('0x24')]('VoiceContext,\x20%s,\x20%s',_0x5e6a20,_0x532ff3['error'][_0x4742('0x25')]);return _0xc8b6ed(_0x532ff3[_0x4742('0x24')][_0x4742('0x25')]);}logger[_0x4742('0x24')](_0x4742('0x20'),_0x5e6a20,_0x532ff3['error'][_0x4742('0x25')]);return _0x16b800(_0x532ff3[_0x4742('0x24')][_0x4742('0x25')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x5e6a20,_0x4742('0x21'));_0x16b800(_0x532ff3[_0x4742('0x26')][_0x4742('0x25')]);}})['catch'](function(_0x3da1db){logger[_0x4742('0x24')](_0x4742('0x20'),_0x5e6a20,_0x3da1db);_0xc8b6ed(_0x3da1db);});});}function respondWithStatusCode(_0x38900a,_0x1604b0){_0x1604b0=_0x1604b0||0xcc;return function(_0x536160){if(_0x536160){return _0x38900a[_0x4742('0x27')](_0x1604b0);}return _0x38900a[_0x4742('0x28')](_0x1604b0)[_0x4742('0x29')]();};}function respondWithResult(_0x58dde6,_0x517b52){_0x517b52=_0x517b52||0xc8;return function(_0x572793){if(_0x572793){return _0x58dde6[_0x4742('0x28')](_0x517b52)[_0x4742('0x2a')](_0x572793);}};}function respondWithFilteredResult(_0x30055e,_0x1aeb29){return function(_0x4da2cc){if(_0x4da2cc){var _0x42ee87=typeof _0x1aeb29[_0x4742('0x2b')]===_0x4742('0x2c')&&typeof _0x1aeb29['limit']===_0x4742('0x2c');var _0x3f1546=_0x4da2cc[_0x4742('0x2d')];var _0x15abd6=_0x42ee87?0x0:_0x1aeb29[_0x4742('0x2b')];var _0x12708e=_0x42ee87?_0x4da2cc[_0x4742('0x2d')]:_0x1aeb29[_0x4742('0x2b')]+_0x1aeb29[_0x4742('0x2e')];var _0x338b9c;if(_0x12708e>=_0x3f1546){_0x12708e=_0x3f1546;_0x338b9c=0xc8;}else{_0x338b9c=0xce;}_0x30055e[_0x4742('0x28')](_0x338b9c);return _0x30055e['set']('Content-Range',_0x15abd6+'-'+_0x12708e+'/'+_0x3f1546)[_0x4742('0x2a')](_0x4da2cc);}return null;};}function patchUpdates(_0x596c52){return function(_0x1069ef){try{jsonpatch[_0x4742('0x2f')](_0x1069ef,_0x596c52,!![]);}catch(_0x5b5555){return BPromise['reject'](_0x5b5555);}return _0x1069ef[_0x4742('0x30')]();};}function saveUpdates(_0x424155,_0x13917d){return function(_0x4bfc6f){if(_0x4bfc6f){return _0x4bfc6f[_0x4742('0x31')](_0x424155)[_0x4742('0x1e')](function(_0x369d43){return _0x369d43;});}return null;};}function removeEntity(_0x364e97,_0x204397){return function(_0x219550){if(_0x219550){return _0x219550['destroy']()[_0x4742('0x1e')](function(){var _0xb15f8f=_0x219550[_0x4742('0x32')]({'plain':!![]});var _0x3ab1fa=_0x4742('0x33');return db[_0x4742('0x34')][_0x4742('0x35')]({'where':{'type':_0x3ab1fa,'resourceId':_0xb15f8f['id']}})[_0x4742('0x1e')](function(){return _0x219550;});})['then'](function(){_0x364e97[_0x4742('0x28')](0xcc)[_0x4742('0x29')]();});}};}function handleEntityNotFound(_0x49ef67,_0x3c063a){return function(_0x155023){if(!_0x155023){_0x49ef67[_0x4742('0x27')](0x194);}return _0x155023;};}function handleError(_0x24a70b,_0x4d096e){_0x4d096e=_0x4d096e||0x1f4;return function(_0xcb0158){logger[_0x4742('0x24')](_0xcb0158[_0x4742('0x36')]);if(_0xcb0158[_0x4742('0x37')]){delete _0xcb0158[_0x4742('0x37')];}_0x24a70b[_0x4742('0x28')](_0x4d096e)[_0x4742('0x38')](_0xcb0158);};}exports[_0x4742('0x39')]=function(_0x4514f4,_0x3721c9){var _0x45d7c={},_0x315eac={},_0x8c82a0={'count':0x0,'rows':[]};var _0x55a1b7=_[_0x4742('0x3a')](db[_0x4742('0x3b')][_0x4742('0x3c')],function(_0x1e2052){return{'name':_0x1e2052['fieldName'],'type':_0x1e2052[_0x4742('0x3d')][_0x4742('0x3e')]};});_0x315eac['model']=_[_0x4742('0x3a')](_0x55a1b7,_0x4742('0x37'));_0x315eac['query']=_[_0x4742('0x3f')](_0x4514f4[_0x4742('0x40')]);_0x315eac[_0x4742('0x41')]=_[_0x4742('0x42')](_0x315eac[_0x4742('0x43')],_0x315eac[_0x4742('0x40')]);_0x45d7c[_0x4742('0x44')]=_[_0x4742('0x42')](_0x315eac[_0x4742('0x43')],qs[_0x4742('0x45')](_0x4514f4[_0x4742('0x40')]['fields']));_0x45d7c[_0x4742('0x44')]=_0x45d7c[_0x4742('0x44')]['length']?_0x45d7c[_0x4742('0x44')]:_0x315eac['model'];if(!_0x4514f4[_0x4742('0x40')][_0x4742('0x46')](_0x4742('0x47'))){_0x45d7c[_0x4742('0x2e')]=qs[_0x4742('0x2e')](_0x4514f4[_0x4742('0x40')][_0x4742('0x2e')]);_0x45d7c[_0x4742('0x2b')]=qs['offset'](_0x4514f4[_0x4742('0x40')]['offset']);}_0x45d7c['order']=qs[_0x4742('0x48')](_0x4514f4[_0x4742('0x40')]['sort']);_0x45d7c[_0x4742('0x49')]=qs[_0x4742('0x41')](_['pick'](_0x4514f4[_0x4742('0x40')],_0x315eac[_0x4742('0x41')]),_0x55a1b7);if(_0x4514f4['query'][_0x4742('0x4a')]){_0x45d7c[_0x4742('0x49')]=_[_0x4742('0x4b')](_0x45d7c[_0x4742('0x49')],{'$or':_[_0x4742('0x3a')](_0x55a1b7,function(_0x228276){if(_0x228276['type']!=='VIRTUAL'){var _0x20fb8e={};_0x20fb8e[_0x228276[_0x4742('0x37')]]={'$like':'%'+_0x4514f4[_0x4742('0x40')][_0x4742('0x4a')]+'%'};return _0x20fb8e;}})});}_0x45d7c=_[_0x4742('0x4b')]({},_0x45d7c,_0x4514f4['options']);var _0x17b24f={'where':_0x45d7c[_0x4742('0x49')]};return db['VoiceContext'][_0x4742('0x2d')](_0x17b24f)[_0x4742('0x1e')](function(_0x533b7a){_0x8c82a0[_0x4742('0x2d')]=_0x533b7a;if(_0x4514f4['query'][_0x4742('0x4c')]){_0x45d7c[_0x4742('0x4d')]=[{'all':!![]}];}return db[_0x4742('0x3b')][_0x4742('0x4e')](_0x45d7c);})[_0x4742('0x1e')](function(_0x3efa62){_0x8c82a0['rows']=_0x3efa62;return _0x8c82a0;})['then'](respondWithFilteredResult(_0x3721c9,_0x45d7c))[_0x4742('0x4f')](handleError(_0x3721c9,null));};exports['show']=function(_0xda6d27,_0x3d756e){var _0x26122a={'raw':![],'where':{'id':_0xda6d27[_0x4742('0x50')]['id']}},_0x13757a={};_0x13757a['model']=_['keys'](db['VoiceContext'][_0x4742('0x3c')]);_0x13757a['query']=_[_0x4742('0x3f')](_0xda6d27[_0x4742('0x40')]);_0x13757a[_0x4742('0x41')]=_['intersection'](_0x13757a['model'],_0x13757a[_0x4742('0x40')]);_0x26122a[_0x4742('0x44')]=_[_0x4742('0x42')](_0x13757a[_0x4742('0x43')],qs[_0x4742('0x45')](_0xda6d27[_0x4742('0x40')][_0x4742('0x45')]));_0x26122a['attributes']=_0x26122a[_0x4742('0x44')][_0x4742('0x51')]?_0x26122a[_0x4742('0x44')]:_0x13757a['model'];if(_0xda6d27[_0x4742('0x40')][_0x4742('0x4c')]){_0x26122a['include']=[{'all':!![]}];}_0x26122a=_['merge']({},_0x26122a,_0xda6d27[_0x4742('0x52')]);return db[_0x4742('0x3b')]['find'](_0x26122a)[_0x4742('0x1e')](handleEntityNotFound(_0x3d756e,null))[_0x4742('0x1e')](respondWithResult(_0x3d756e,null))[_0x4742('0x4f')](handleError(_0x3d756e,null));};exports[_0x4742('0x53')]=function(_0xbb48b0,_0x6160e8,_0x3a03cf){var _0x19333b;return db[_0x4742('0x3b')]['create'](_0xbb48b0[_0x4742('0x54')],{'raw':!![]})[_0x4742('0x1e')](function(_0x5ee86a){_0x19333b=_0x5ee86a;return db['VoiceContext'][_0x4742('0x4e')]({'raw':!![]});})[_0x4742('0x1e')](function(_0xf262c0){var _0x7a8a5b=fs[_0x4742('0x55')](path[_0x4742('0x56')](config[_0x4742('0x57')],_0x4742('0x58')),_0x4742('0x59'));var _0x31c0c0=ejs[_0x4742('0x5a')](_0x7a8a5b,{'contexts':_0xf262c0||[]});fs[_0x4742('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x31c0c0);})[_0x4742('0x1e')](function(){return respondWithRpcPromise(_0x4742('0x5c'),_0x4742('0x53'),{'module':_0x4742('0x5d')});})[_0x4742('0x1e')](function(){var _0x227685=_0xbb48b0[_0x4742('0x5e')][_0x4742('0x32')]({'plain':!![]});if(!_0x227685)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x227685[_0x4742('0x5f')]===_0x4742('0x5e')){var _0xdd1bb1=_0x19333b['get']({'plain':!![]});return db['UserProfileSection'][_0x4742('0x60')]({'where':{'name':_0x4742('0x33'),'userProfileId':_0x227685['userProfileId']},'raw':!![]})[_0x4742('0x1e')](function(_0xb8fabb){if(_0xb8fabb&&_0xb8fabb[_0x4742('0x61')]===0x0){return db['UserProfileResource'][_0x4742('0x53')]({'name':_0xdd1bb1[_0x4742('0x37')],'resourceId':_0xdd1bb1['id'],'type':_0xb8fabb[_0x4742('0x37')],'sectionId':_0xb8fabb['id']},{})[_0x4742('0x1e')](function(){return _0x19333b;});}else{return _0x19333b;}})['catch'](function(_0x2f1c3b){logger[_0x4742('0x24')](_0x4742('0x62'),_0x2f1c3b);throw _0x2f1c3b;});}return _0x19333b;})[_0x4742('0x1e')](respondWithResult(_0x6160e8,0xc9))['catch'](handleError(_0x6160e8,null));};exports[_0x4742('0x31')]=function(_0x2fd389,_0x3e150b,_0x5f1730){var _0x43abac;return db[_0x4742('0x3b')][_0x4742('0x60')]({'where':{'id':_0x2fd389[_0x4742('0x50')]['id']}})[_0x4742('0x1e')](handleEntityNotFound(_0x3e150b,null))[_0x4742('0x1e')](saveUpdates(_0x2fd389[_0x4742('0x54')],null))[_0x4742('0x1e')](function(_0x3fb7b8){if(_0x3fb7b8){_0x43abac=_0x3fb7b8;return db[_0x4742('0x3b')][_0x4742('0x4e')]({'raw':!![]});}})['then'](function(_0x40d126){var _0x3951b2=fs[_0x4742('0x55')](path[_0x4742('0x56')](config[_0x4742('0x57')],'server/files/templates/context.ejs'),_0x4742('0x59'));var _0x4cf25f=ejs[_0x4742('0x5a')](_0x3951b2,{'contexts':_0x40d126||[]});fs[_0x4742('0x5b')](_0x4742('0x63'),_0x4cf25f);})[_0x4742('0x1e')](function(){return respondWithRpcPromise('Reload',_0x4742('0x31'),{'module':_0x4742('0x5d')});})['then'](function(){return _0x43abac;})[_0x4742('0x1e')](respondWithResult(_0x3e150b,null))[_0x4742('0x4f')](handleError(_0x3e150b,null));};exports['destroy']=function(_0x272164,_0x4c07c9,_0x438243){var _0x25e3d1;return db[_0x4742('0x3b')][_0x4742('0x60')]({'where':{'id':_0x272164[_0x4742('0x50')]['id']}})[_0x4742('0x1e')](handleEntityNotFound(_0x4c07c9,null))[_0x4742('0x1e')](removeEntity(_0x4c07c9,null))[_0x4742('0x1e')](function(){return db[_0x4742('0x3b')]['findAll']({'raw':!![]});})['then'](function(_0x1cec9d){var _0x191c40=fs['readFileSync'](path[_0x4742('0x56')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x40001d=ejs['render'](_0x191c40,{'contexts':_0x1cec9d});fs['writeFileSync'](_0x4742('0x63'),_0x40001d);return respondWithRpcPromise(_0x4742('0x5c'),_0x4742('0x35'),{'module':'chan_sip.so'});})[_0x4742('0x4f')](handleError(_0x4c07c9,null));}; \ No newline at end of file +var _0x5076=['chan_sip.so','role','UserProfileSection','Contexts','userProfileId','utf8','writeFileSync','Reload','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','client','http','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','includeAll','find','create','readFileSync','join','root','server/files/templates/context.ejs','render','/etc/asterisk/extensions_xcally_contexts.conf'];(function(_0x21f07f,_0x5c5ae1){var _0x4dd94c=function(_0xf4e022){while(--_0xf4e022){_0x21f07f['push'](_0x21f07f['shift']());}};_0x4dd94c(++_0x5c5ae1);}(_0x5076,0x140));var _0x6507=function(_0x54beb0,_0x5623ad){_0x54beb0=_0x54beb0-0x0;var _0xefc804=_0x5076[_0x54beb0];return _0xefc804;};'use strict';var emlformat=require(_0x6507('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6507('0x1'));var jsonpatch=require(_0x6507('0x2'));var rp=require(_0x6507('0x3'));var moment=require(_0x6507('0x4'));var BPromise=require(_0x6507('0x5'));var Mustache=require(_0x6507('0x6'));var util=require(_0x6507('0x7'));var path=require(_0x6507('0x8'));var sox=require('sox');var csv=require(_0x6507('0x9'));var ejs=require(_0x6507('0xa'));var fs=require('fs');var fs_extra=require(_0x6507('0xb'));var _=require(_0x6507('0xc'));var squel=require('squel');var crypto=require(_0x6507('0xd'));var jsforce=require(_0x6507('0xe'));var deskjs=require(_0x6507('0xf'));var toCsv=require(_0x6507('0x9'));var querystring=require(_0x6507('0x10'));var Papa=require(_0x6507('0x11'));var Redis=require('ioredis');var authService=require(_0x6507('0x12'));var qs=require(_0x6507('0x13'));var as=require(_0x6507('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6507('0x15'))(_0x6507('0x16'));var utils=require('../../config/utils');var config=require(_0x6507('0x17'));var licenseUtil=require(_0x6507('0x18'));var db=require(_0x6507('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x6507('0x1a')][_0x6507('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xe8eb30,_0x4359c9,_0x28acff,_0x461f21){return new BPromise(function(_0x54d4d9,_0x2df7d6){var _0x56e6f9=_0x461f21||client;return _0x56e6f9['request'](_0xe8eb30,_0x28acff)[_0x6507('0x1c')](function(_0x552859){logger[_0x6507('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x4359c9,_0x6507('0x1e'));logger['debug'](_0x6507('0x1f'),_0x4359c9,_0x6507('0x1e'),JSON[_0x6507('0x20')](_0x552859));if(_0x552859[_0x6507('0x21')]){if(_0x552859[_0x6507('0x21')][_0x6507('0x22')]===0x1f4){logger[_0x6507('0x21')](_0x6507('0x23'),_0x4359c9,_0x552859[_0x6507('0x21')][_0x6507('0x24')]);return _0x2df7d6(_0x552859[_0x6507('0x21')][_0x6507('0x24')]);}logger[_0x6507('0x21')](_0x6507('0x23'),_0x4359c9,_0x552859['error']['message']);return _0x54d4d9(_0x552859[_0x6507('0x21')][_0x6507('0x24')]);}else{logger[_0x6507('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x4359c9,_0x6507('0x1e'));_0x54d4d9(_0x552859[_0x6507('0x25')]['message']);}})[_0x6507('0x26')](function(_0x1e446d){logger[_0x6507('0x21')](_0x6507('0x23'),_0x4359c9,_0x1e446d);_0x2df7d6(_0x1e446d);});});}function respondWithStatusCode(_0x4a3e10,_0x4cff80){_0x4cff80=_0x4cff80||0xcc;return function(_0x2f2f36){if(_0x2f2f36){return _0x4a3e10[_0x6507('0x27')](_0x4cff80);}return _0x4a3e10['status'](_0x4cff80)[_0x6507('0x28')]();};}function respondWithResult(_0x3ea624,_0x489934){_0x489934=_0x489934||0xc8;return function(_0x5a89ff){if(_0x5a89ff){return _0x3ea624[_0x6507('0x29')](_0x489934)[_0x6507('0x2a')](_0x5a89ff);}};}function respondWithFilteredResult(_0x18b7dc,_0x38c82a){return function(_0x1df850){if(_0x1df850){var _0x30d615=typeof _0x38c82a[_0x6507('0x2b')]===_0x6507('0x2c')&&typeof _0x38c82a[_0x6507('0x2d')]===_0x6507('0x2c');var _0x357297=_0x1df850[_0x6507('0x2e')];var _0x16b2d3=_0x30d615?0x0:_0x38c82a['offset'];var _0x11ce25=_0x30d615?_0x1df850[_0x6507('0x2e')]:_0x38c82a[_0x6507('0x2b')]+_0x38c82a[_0x6507('0x2d')];var _0x505908;if(_0x11ce25>=_0x357297){_0x11ce25=_0x357297;_0x505908=0xc8;}else{_0x505908=0xce;}_0x18b7dc[_0x6507('0x29')](_0x505908);return _0x18b7dc[_0x6507('0x2f')](_0x6507('0x30'),_0x16b2d3+'-'+_0x11ce25+'/'+_0x357297)['json'](_0x1df850);}return null;};}function patchUpdates(_0x371c45){return function(_0x1b4b43){try{jsonpatch[_0x6507('0x31')](_0x1b4b43,_0x371c45,!![]);}catch(_0x487080){return BPromise[_0x6507('0x32')](_0x487080);}return _0x1b4b43['save']();};}function saveUpdates(_0x4de2a4,_0x2333f1){return function(_0x426d1a){if(_0x426d1a){return _0x426d1a[_0x6507('0x33')](_0x4de2a4)[_0x6507('0x1c')](function(_0x7c98df){return _0x7c98df;});}return null;};}function removeEntity(_0x46c6eb,_0x5a1e8e){return function(_0x28d8f6){if(_0x28d8f6){return _0x28d8f6[_0x6507('0x34')]()[_0x6507('0x1c')](function(){var _0x42872a=_0x28d8f6[_0x6507('0x35')]({'plain':!![]});var _0x2827c4='Contexts';return db[_0x6507('0x36')][_0x6507('0x34')]({'where':{'type':_0x2827c4,'resourceId':_0x42872a['id']}})[_0x6507('0x1c')](function(){return _0x28d8f6;});})[_0x6507('0x1c')](function(){_0x46c6eb[_0x6507('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ea89b,_0x1ad662){return function(_0x2a97fc){if(!_0x2a97fc){_0x4ea89b['sendStatus'](0x194);}return _0x2a97fc;};}function handleError(_0x5cc930,_0x602607){_0x602607=_0x602607||0x1f4;return function(_0x4acbfc){logger[_0x6507('0x21')](_0x4acbfc[_0x6507('0x37')]);if(_0x4acbfc[_0x6507('0x38')]){delete _0x4acbfc[_0x6507('0x38')];}_0x5cc930[_0x6507('0x29')](_0x602607)[_0x6507('0x39')](_0x4acbfc);};}exports[_0x6507('0x3a')]=function(_0x45a947,_0x252702){var _0x10f98c={},_0x4b6907={},_0x237994={'count':0x0,'rows':[]};var _0x5ca757=_[_0x6507('0x3b')](db[_0x6507('0x3c')][_0x6507('0x3d')],function(_0x4b6ee3){return{'name':_0x4b6ee3[_0x6507('0x3e')],'type':_0x4b6ee3[_0x6507('0x3f')]['key']};});_0x4b6907[_0x6507('0x40')]=_[_0x6507('0x3b')](_0x5ca757,'name');_0x4b6907[_0x6507('0x41')]=_[_0x6507('0x42')](_0x45a947[_0x6507('0x41')]);_0x4b6907[_0x6507('0x43')]=_[_0x6507('0x44')](_0x4b6907[_0x6507('0x40')],_0x4b6907[_0x6507('0x41')]);_0x10f98c[_0x6507('0x45')]=_[_0x6507('0x44')](_0x4b6907[_0x6507('0x40')],qs['fields'](_0x45a947[_0x6507('0x41')][_0x6507('0x46')]));_0x10f98c[_0x6507('0x45')]=_0x10f98c[_0x6507('0x45')][_0x6507('0x47')]?_0x10f98c[_0x6507('0x45')]:_0x4b6907[_0x6507('0x40')];if(!_0x45a947[_0x6507('0x41')][_0x6507('0x48')](_0x6507('0x49'))){_0x10f98c[_0x6507('0x2d')]=qs['limit'](_0x45a947[_0x6507('0x41')][_0x6507('0x2d')]);_0x10f98c['offset']=qs[_0x6507('0x2b')](_0x45a947[_0x6507('0x41')]['offset']);}_0x10f98c[_0x6507('0x4a')]=qs['sort'](_0x45a947['query'][_0x6507('0x4b')]);_0x10f98c['where']=qs[_0x6507('0x43')](_[_0x6507('0x4c')](_0x45a947[_0x6507('0x41')],_0x4b6907[_0x6507('0x43')]),_0x5ca757);if(_0x45a947['query']['filter']){_0x10f98c[_0x6507('0x4d')]=_[_0x6507('0x4e')](_0x10f98c[_0x6507('0x4d')],{'$or':_[_0x6507('0x3b')](_0x5ca757,function(_0x53a88b){if(_0x53a88b['type']!==_0x6507('0x4f')){var _0x1e8e34={};_0x1e8e34[_0x53a88b[_0x6507('0x38')]]={'$like':'%'+_0x45a947['query'][_0x6507('0x50')]+'%'};return _0x1e8e34;}})});}_0x10f98c=_[_0x6507('0x4e')]({},_0x10f98c,_0x45a947[_0x6507('0x51')]);var _0x7f2f0c={'where':_0x10f98c[_0x6507('0x4d')]};return db[_0x6507('0x3c')][_0x6507('0x2e')](_0x7f2f0c)[_0x6507('0x1c')](function(_0xbe3b0b){_0x237994[_0x6507('0x2e')]=_0xbe3b0b;if(_0x45a947['query']['includeAll']){_0x10f98c[_0x6507('0x52')]=[{'all':!![]}];}return db[_0x6507('0x3c')][_0x6507('0x53')](_0x10f98c);})['then'](function(_0x4679d1){_0x237994[_0x6507('0x54')]=_0x4679d1;return _0x237994;})['then'](respondWithFilteredResult(_0x252702,_0x10f98c))[_0x6507('0x26')](handleError(_0x252702,null));};exports[_0x6507('0x55')]=function(_0x27bc1a,_0x383d32){var _0x31b662={'raw':![],'where':{'id':_0x27bc1a[_0x6507('0x56')]['id']}},_0x4bc101={};_0x4bc101[_0x6507('0x40')]=_[_0x6507('0x42')](db['VoiceContext'][_0x6507('0x3d')]);_0x4bc101['query']=_[_0x6507('0x42')](_0x27bc1a[_0x6507('0x41')]);_0x4bc101[_0x6507('0x43')]=_['intersection'](_0x4bc101[_0x6507('0x40')],_0x4bc101['query']);_0x31b662[_0x6507('0x45')]=_[_0x6507('0x44')](_0x4bc101[_0x6507('0x40')],qs[_0x6507('0x46')](_0x27bc1a['query'][_0x6507('0x46')]));_0x31b662[_0x6507('0x45')]=_0x31b662[_0x6507('0x45')]['length']?_0x31b662['attributes']:_0x4bc101[_0x6507('0x40')];if(_0x27bc1a[_0x6507('0x41')][_0x6507('0x57')]){_0x31b662[_0x6507('0x52')]=[{'all':!![]}];}_0x31b662=_[_0x6507('0x4e')]({},_0x31b662,_0x27bc1a[_0x6507('0x51')]);return db[_0x6507('0x3c')][_0x6507('0x58')](_0x31b662)[_0x6507('0x1c')](handleEntityNotFound(_0x383d32,null))['then'](respondWithResult(_0x383d32,null))['catch'](handleError(_0x383d32,null));};exports[_0x6507('0x59')]=function(_0x445b7d,_0x39a405,_0x10e6c7){var _0x53438f;return db[_0x6507('0x3c')][_0x6507('0x59')](_0x445b7d['body'],{'raw':!![]})['then'](function(_0x4d7529){_0x53438f=_0x4d7529;return db[_0x6507('0x3c')]['findAll']({'raw':!![]});})[_0x6507('0x1c')](function(_0x266f2c){var _0x36246e=fs[_0x6507('0x5a')](path[_0x6507('0x5b')](config[_0x6507('0x5c')],_0x6507('0x5d')),'utf8');var _0x2808e7=ejs[_0x6507('0x5e')](_0x36246e,{'contexts':_0x266f2c||[]});fs['writeFileSync'](_0x6507('0x5f'),_0x2808e7);})[_0x6507('0x1c')](function(){return respondWithRpcPromise('Reload',_0x6507('0x59'),{'module':_0x6507('0x60')});})[_0x6507('0x1c')](function(){var _0x499f21=_0x445b7d['user'][_0x6507('0x35')]({'plain':!![]});if(!_0x499f21)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x499f21[_0x6507('0x61')]==='user'){var _0x549c4f=_0x53438f[_0x6507('0x35')]({'plain':!![]});return db[_0x6507('0x62')][_0x6507('0x58')]({'where':{'name':_0x6507('0x63'),'userProfileId':_0x499f21[_0x6507('0x64')]},'raw':!![]})['then'](function(_0x25e036){if(_0x25e036&&_0x25e036['autoAssociation']===0x0){return db[_0x6507('0x36')][_0x6507('0x59')]({'name':_0x549c4f[_0x6507('0x38')],'resourceId':_0x549c4f['id'],'type':_0x25e036['name'],'sectionId':_0x25e036['id']},{})[_0x6507('0x1c')](function(){return _0x53438f;});}else{return _0x53438f;}})['catch'](function(_0x5ec6ec){logger[_0x6507('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ec6ec);throw _0x5ec6ec;});}return _0x53438f;})[_0x6507('0x1c')](respondWithResult(_0x39a405,0xc9))[_0x6507('0x26')](handleError(_0x39a405,null));};exports['update']=function(_0x38bfcf,_0x2c4f92,_0x2a51a7){var _0x285a2a;return db[_0x6507('0x3c')][_0x6507('0x58')]({'where':{'id':_0x38bfcf[_0x6507('0x56')]['id']}})['then'](handleEntityNotFound(_0x2c4f92,null))[_0x6507('0x1c')](saveUpdates(_0x38bfcf['body'],null))[_0x6507('0x1c')](function(_0x457ff9){if(_0x457ff9){_0x285a2a=_0x457ff9;return db['VoiceContext'][_0x6507('0x53')]({'raw':!![]});}})['then'](function(_0x2bf28f){var _0x25746e=fs[_0x6507('0x5a')](path['join'](config[_0x6507('0x5c')],_0x6507('0x5d')),_0x6507('0x65'));var _0x55b52=ejs[_0x6507('0x5e')](_0x25746e,{'contexts':_0x2bf28f||[]});fs[_0x6507('0x66')](_0x6507('0x5f'),_0x55b52);})[_0x6507('0x1c')](function(){return respondWithRpcPromise(_0x6507('0x67'),_0x6507('0x33'),{'module':_0x6507('0x60')});})[_0x6507('0x1c')](function(){return _0x285a2a;})[_0x6507('0x1c')](respondWithResult(_0x2c4f92,null))[_0x6507('0x26')](handleError(_0x2c4f92,null));};exports[_0x6507('0x34')]=function(_0x2cc2b9,_0x1dae5e,_0x2405d4){var _0x4a0e1d;return db[_0x6507('0x3c')][_0x6507('0x58')]({'where':{'id':_0x2cc2b9[_0x6507('0x56')]['id']}})[_0x6507('0x1c')](handleEntityNotFound(_0x1dae5e,null))[_0x6507('0x1c')](removeEntity(_0x1dae5e,null))[_0x6507('0x1c')](function(){return db[_0x6507('0x3c')][_0x6507('0x53')]({'raw':!![]});})[_0x6507('0x1c')](function(_0x240462){var _0x3d93ef=fs[_0x6507('0x5a')](path[_0x6507('0x5b')](config[_0x6507('0x5c')],_0x6507('0x5d')),_0x6507('0x65'));var _0x3d4a84=ejs[_0x6507('0x5e')](_0x3d93ef,{'contexts':_0x240462});fs['writeFileSync'](_0x6507('0x5f'),_0x3d4a84);return respondWithRpcPromise(_0x6507('0x67'),_0x6507('0x34'),{'module':'chan_sip.so'});})[_0x6507('0x26')](handleError(_0x1dae5e,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index bc45032..35142e3 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 _0x1607=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','VoiceContext','voice_contexts','lodash'];(function(_0x442894,_0x1aef56){var _0x32f0d8=function(_0x11c78a){while(--_0x11c78a){_0x442894['push'](_0x442894['shift']());}};_0x32f0d8(++_0x1aef56);}(_0x1607,0x8e));var _0x7160=function(_0x49c898,_0x13476e){_0x49c898=_0x49c898-0x0;var _0x1faebb=_0x1607[_0x49c898];return _0x1faebb;};'use strict';var _=require(_0x7160('0x0'));var util=require(_0x7160('0x1'));var logger=require(_0x7160('0x2'))(_0x7160('0x3'));var moment=require('moment');var BPromise=require(_0x7160('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7160('0x5'));var rimraf=require(_0x7160('0x6'));var config=require(_0x7160('0x7'));var attributes=require(_0x7160('0x8'));module['exports']=function(_0x5329d5,_0x895934){return _0x5329d5['define'](_0x7160('0x9'),attributes,{'tableName':_0x7160('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4acc=['exports','define','VoiceContext','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x32d414,_0x4d23da){var _0x4e0bca=function(_0x15d397){while(--_0x15d397){_0x32d414['push'](_0x32d414['shift']());}};_0x4e0bca(++_0x4d23da);}(_0x4acc,0x111));var _0xc4ac=function(_0x551920,_0x46f783){_0x551920=_0x551920-0x0;var _0x184443=_0x4acc[_0x551920];return _0x184443;};'use strict';var _=require(_0xc4ac('0x0'));var util=require('util');var logger=require(_0xc4ac('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc4ac('0x2'));var rp=require(_0xc4ac('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc4ac('0x4'));var config=require(_0xc4ac('0x5'));var attributes=require(_0xc4ac('0x6'));module[_0xc4ac('0x7')]=function(_0x16f576,_0x3f22cb){return _0x16f576[_0xc4ac('0x8')](_0xc4ac('0x9'),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 3d04e44..b26ce58 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 _0xae1b=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x5968aa,_0xe0e979){var _0x2e0499=function(_0xa0512d){while(--_0xa0512d){_0x5968aa['push'](_0x5968aa['shift']());}};_0x2e0499(++_0xe0e979);}(_0xae1b,0x96));var _0xbae1=function(_0x4d35d3,_0x5b167f){_0x4d35d3=_0x4d35d3-0x0;var _0x4dd761=_0xae1b[_0x4d35d3];return _0x4dd761;};'use strict';var _=require('lodash');var util=require(_0xbae1('0x0'));var moment=require('moment');var BPromise=require(_0xbae1('0x1'));var rs=require(_0xbae1('0x2'));var fs=require('fs');var Redis=require(_0xbae1('0x3'));var db=require(_0xbae1('0x4'))['db'];var utils=require(_0xbae1('0x5'));var logger=require(_0xbae1('0x6'))('rpc');var config=require(_0xbae1('0x7'));var jayson=require(_0xbae1('0x8'));var client=jayson['client'][_0xbae1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d7130,_0xac9c47,_0x54ba1f){return new BPromise(function(_0x3f0ff5,_0x340ff9){return client['request'](_0x5d7130,_0x54ba1f)[_0xbae1('0xa')](function(_0x366106){logger[_0xbae1('0xb')](_0xbae1('0xc'),_0xac9c47,_0xbae1('0xd'));logger[_0xbae1('0xe')](_0xbae1('0xf'),_0xac9c47,_0xbae1('0xd'),JSON[_0xbae1('0x10')](_0x366106));if(_0x366106[_0xbae1('0x11')]){if(_0x366106[_0xbae1('0x11')][_0xbae1('0x12')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0xac9c47,_0x366106['error']['message']);return _0x340ff9(_0x366106[_0xbae1('0x11')][_0xbae1('0x13')]);}logger[_0xbae1('0x11')](_0xbae1('0xc'),_0xac9c47,_0x366106[_0xbae1('0x11')]['message']);return _0x3f0ff5(_0x366106[_0xbae1('0x11')][_0xbae1('0x13')]);}else{logger[_0xbae1('0xb')]('VoiceContext,\x20%s,\x20%s',_0xac9c47,_0xbae1('0xd'));_0x3f0ff5(_0x366106[_0xbae1('0x14')][_0xbae1('0x13')]);}})[_0xbae1('0x15')](function(_0x7d92b7){logger[_0xbae1('0x11')](_0xbae1('0xc'),_0xac9c47,_0x7d92b7);_0x340ff9(_0x7d92b7);});});} \ No newline at end of file +var _0x8768=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result'];(function(_0x3bb5cb,_0x2c2cc5){var _0x27f864=function(_0x552333){while(--_0x552333){_0x3bb5cb['push'](_0x3bb5cb['shift']());}};_0x27f864(++_0x2c2cc5);}(_0x8768,0xa1));var _0x8876=function(_0x76bcbf,_0x26f34b){_0x76bcbf=_0x76bcbf-0x0;var _0x2a4393=_0x8768[_0x76bcbf];return _0x2a4393;};'use strict';var _=require(_0x8876('0x0'));var util=require(_0x8876('0x1'));var moment=require(_0x8876('0x2'));var BPromise=require(_0x8876('0x3'));var rs=require(_0x8876('0x4'));var fs=require('fs');var Redis=require(_0x8876('0x5'));var db=require(_0x8876('0x6'))['db'];var utils=require(_0x8876('0x7'));var logger=require(_0x8876('0x8'))(_0x8876('0x9'));var config=require(_0x8876('0xa'));var jayson=require(_0x8876('0xb'));var client=jayson[_0x8876('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x473704,_0x563355,_0x42dbda){return new BPromise(function(_0x26bd0e,_0x3d1170){return client['request'](_0x473704,_0x42dbda)['then'](function(_0xa6742b){logger[_0x8876('0xd')]('VoiceContext,\x20%s,\x20%s',_0x563355,'request\x20sent');logger[_0x8876('0xe')](_0x8876('0xf'),_0x563355,_0x8876('0x10'),JSON[_0x8876('0x11')](_0xa6742b));if(_0xa6742b[_0x8876('0x12')]){if(_0xa6742b[_0x8876('0x12')][_0x8876('0x13')]===0x1f4){logger[_0x8876('0x12')](_0x8876('0x14'),_0x563355,_0xa6742b[_0x8876('0x12')]['message']);return _0x3d1170(_0xa6742b[_0x8876('0x12')][_0x8876('0x15')]);}logger[_0x8876('0x12')](_0x8876('0x14'),_0x563355,_0xa6742b[_0x8876('0x12')]['message']);return _0x26bd0e(_0xa6742b[_0x8876('0x12')][_0x8876('0x15')]);}else{logger[_0x8876('0xd')](_0x8876('0x14'),_0x563355,_0x8876('0x10'));_0x26bd0e(_0xa6742b[_0x8876('0x16')][_0x8876('0x15')]);}})['catch'](function(_0x204f5a){logger[_0x8876('0x12')](_0x8876('0x14'),_0x563355,_0x204f5a);_0x3d1170(_0x204f5a);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 1bf697f..4cfac66 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 _0x354c=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','index','get','/describe','isAuthenticated','/:id','post','create'];(function(_0x35d84e,_0x42e818){var _0x285ec3=function(_0x47d17f){while(--_0x47d17f){_0x35d84e['push'](_0x35d84e['shift']());}};_0x285ec3(++_0x42e818);}(_0x354c,0x1e4));var _0xc354=function(_0x329655,_0x28bb8e){_0x329655=_0x329655-0x0;var _0x44b0ca=_0x354c[_0x329655];return _0x44b0ca;};'use strict';var multer=require(_0xc354('0x0'));var util=require(_0xc354('0x1'));var path=require(_0xc354('0x2'));var timeout=require(_0xc354('0x3'));var express=require('express');var router=express[_0xc354('0x4')]();var fs_extra=require(_0xc354('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc354('0x6'));var config=require(_0xc354('0x7'));var controller=require(_0xc354('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc354('0x9')]);router[_0xc354('0xa')](_0xc354('0xb'),auth[_0xc354('0xc')](),controller['describe']);router[_0xc354('0xa')](_0xc354('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xc354('0xe')]('/',auth['isAuthenticated'](),controller[_0xc354('0xf')]);router[_0xc354('0x10')]('/:id',auth[_0xc354('0xc')](),controller[_0xc354('0x11')]);router['delete'](_0xc354('0xd'),auth['isAuthenticated'](),controller[_0xc354('0x12')]);module[_0xc354('0x13')]=router; \ No newline at end of file +var _0x02e7=['put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x2f4434,_0x3070ae){var _0x47ee84=function(_0x28f967){while(--_0x28f967){_0x2f4434['push'](_0x2f4434['shift']());}};_0x47ee84(++_0x3070ae);}(_0x02e7,0x146));var _0x702e=function(_0xa68724,_0x2305eb){_0xa68724=_0xa68724-0x0;var _0x16f17e=_0x02e7[_0xa68724];return _0x16f17e;};'use strict';var multer=require(_0x702e('0x0'));var util=require('util');var path=require(_0x702e('0x1'));var timeout=require(_0x702e('0x2'));var express=require(_0x702e('0x3'));var router=express[_0x702e('0x4')]();var fs_extra=require(_0x702e('0x5'));var auth=require(_0x702e('0x6'));var interaction=require(_0x702e('0x7'));var config=require(_0x702e('0x8'));var controller=require(_0x702e('0x9'));router[_0x702e('0xa')]('/',auth[_0x702e('0xb')](),controller[_0x702e('0xc')]);router[_0x702e('0xa')](_0x702e('0xd'),auth[_0x702e('0xb')](),controller[_0x702e('0xe')]);router[_0x702e('0xa')](_0x702e('0xf'),auth[_0x702e('0xb')](),controller[_0x702e('0x10')]);router[_0x702e('0x11')]('/',auth[_0x702e('0xb')](),controller[_0x702e('0x12')]);router[_0x702e('0x13')](_0x702e('0xf'),auth['isAuthenticated'](),controller[_0x702e('0x14')]);router[_0x702e('0x15')](_0x702e('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x702e('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index eb3bd35..d0faf5d 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x4ce8d4,_0x125379){var _0x5caa8b=function(_0x144fd9){while(--_0x144fd9){_0x4ce8d4['push'](_0x4ce8d4['shift']());}};_0x5caa8b(++_0x125379);}(_0xa41a,0x6b));var _0xaa41=function(_0x37ed02,_0x4755ba){_0x37ed02=_0x37ed02-0x0;var _0x1dc09d=_0xa41a[_0x37ed02];return _0x1dc09d;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x2')]},'channelstate':{'type':Sequelize[_0xaa41('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'calleridnum':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'language':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xaa41('0x2')]},'exten':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaa41('0x2')]},'destchannel':{'type':Sequelize[_0xaa41('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridnum':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridname':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'destlanguage':{'type':Sequelize[_0xaa41('0x2')]},'destaccountcode':{'type':Sequelize[_0xaa41('0x2')]},'destcontext':{'type':Sequelize[_0xaa41('0x2')]},'destexten':{'type':Sequelize[_0xaa41('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaa41('0x2')]},'destlinkedid':{'type':Sequelize[_0xaa41('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaa41('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xaa41('0x4')]},'lastevent':{'type':Sequelize[_0xaa41('0x2')],'comment':_0xaa41('0x5')},'routeId':{'type':Sequelize[_0xaa41('0x3')]},'duration':{'type':Sequelize[_0xaa41('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xaa41('0x3')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x5d2ad5,_0x1ba87f){var _0x5becfb=function(_0x327024){while(--_0x327024){_0x5d2ad5['push'](_0x5d2ad5['shift']());}};_0x5becfb(++_0x1ba87f);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x39d6a8,_0xc9c91a){_0x39d6a8=_0x39d6a8-0x0;var _0x93f3db=_0xf3cd[_0x39d6a8];return _0x93f3db;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'privilege':{'type':Sequelize[_0xdf3c('0x2')]},'channel':{'type':Sequelize[_0xdf3c('0x2')]},'channelstate':{'type':Sequelize[_0xdf3c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdf3c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinename':{'type':Sequelize[_0xdf3c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdf3c('0x2')]},'context':{'type':Sequelize[_0xdf3c('0x2')]},'exten':{'type':Sequelize[_0xdf3c('0x2')]},'priority':{'type':Sequelize[_0xdf3c('0x3')]},'uniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'linkedid':{'type':Sequelize[_0xdf3c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdf3c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xdf3c('0x2')]},'destaccountcode':{'type':Sequelize[_0xdf3c('0x2')]},'destcontext':{'type':Sequelize[_0xdf3c('0x2')]},'destexten':{'type':Sequelize[_0xdf3c('0x2')]},'destpriority':{'type':Sequelize[_0xdf3c('0x3')]},'destuniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'destlinkedid':{'type':Sequelize[_0xdf3c('0x2')]},'dialstring':{'type':Sequelize[_0xdf3c('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdf3c('0x4')]},'answertime':{'type':Sequelize[_0xdf3c('0x4')]},'endtime':{'type':Sequelize[_0xdf3c('0x4')]},'lastevent':{'type':Sequelize[_0xdf3c('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xdf3c('0x3')]},'duration':{'type':Sequelize[_0xdf3c('0x3')]},'holdtime':{'type':Sequelize[_0xdf3c('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index d6fa75d..0844ff5 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 _0x2c1a=['includeAll','include','findAll','rows','catch','show','params','find','create','body','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../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','VoiceDialReport','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x50f02b,_0x4ae317){var _0xc2d1f4=function(_0xd99028){while(--_0xd99028){_0x50f02b['push'](_0x50f02b['shift']());}};_0xc2d1f4(++_0x4ae317);}(_0x2c1a,0x192));var _0xa2c1=function(_0xfdb240,_0x516ecd){_0xfdb240=_0xfdb240-0x0;var _0x401957=_0x2c1a[_0xfdb240];return _0x401957;};'use strict';var emlformat=require(_0xa2c1('0x0'));var rimraf=require(_0xa2c1('0x1'));var zipdir=require(_0xa2c1('0x2'));var jsonpatch=require(_0xa2c1('0x3'));var rp=require(_0xa2c1('0x4'));var moment=require('moment');var BPromise=require(_0xa2c1('0x5'));var Mustache=require(_0xa2c1('0x6'));var util=require(_0xa2c1('0x7'));var path=require(_0xa2c1('0x8'));var sox=require(_0xa2c1('0x9'));var csv=require(_0xa2c1('0xa'));var ejs=require(_0xa2c1('0xb'));var fs=require('fs');var fs_extra=require(_0xa2c1('0xc'));var _=require(_0xa2c1('0xd'));var squel=require(_0xa2c1('0xe'));var crypto=require(_0xa2c1('0xf'));var jsforce=require(_0xa2c1('0x10'));var deskjs=require(_0xa2c1('0x11'));var toCsv=require(_0xa2c1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa2c1('0x12'));var authService=require(_0xa2c1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa2c1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2c1('0x15'))(_0xa2c1('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa2c1('0x17'));var db=require(_0xa2c1('0x18'))['db'];function respondWithStatusCode(_0x2643e1,_0x2a19da){_0x2a19da=_0x2a19da||0xcc;return function(_0x233998){if(_0x233998){return _0x2643e1[_0xa2c1('0x19')](_0x2a19da);}return _0x2643e1[_0xa2c1('0x1a')](_0x2a19da)[_0xa2c1('0x1b')]();};}function respondWithResult(_0x113db1,_0x3ebada){_0x3ebada=_0x3ebada||0xc8;return function(_0x5061da){if(_0x5061da){return _0x113db1[_0xa2c1('0x1a')](_0x3ebada)[_0xa2c1('0x1c')](_0x5061da);}};}function respondWithFilteredResult(_0x361c0b,_0x4b7f05){return function(_0x33976c){if(_0x33976c){var _0x38a09e=typeof _0x4b7f05[_0xa2c1('0x1d')]===_0xa2c1('0x1e')&&typeof _0x4b7f05[_0xa2c1('0x1f')]===_0xa2c1('0x1e');var _0x31c711=_0x33976c[_0xa2c1('0x20')];var _0xc9fa5e=_0x38a09e?0x0:_0x4b7f05[_0xa2c1('0x1d')];var _0x48e6ee=_0x38a09e?_0x33976c[_0xa2c1('0x20')]:_0x4b7f05['offset']+_0x4b7f05[_0xa2c1('0x1f')];var _0x4a041d;if(_0x48e6ee>=_0x31c711){_0x48e6ee=_0x31c711;_0x4a041d=0xc8;}else{_0x4a041d=0xce;}_0x361c0b[_0xa2c1('0x1a')](_0x4a041d);return _0x361c0b[_0xa2c1('0x21')](_0xa2c1('0x22'),_0xc9fa5e+'-'+_0x48e6ee+'/'+_0x31c711)[_0xa2c1('0x1c')](_0x33976c);}return null;};}function patchUpdates(_0x10461e){return function(_0x220c8d){try{jsonpatch[_0xa2c1('0x23')](_0x220c8d,_0x10461e,!![]);}catch(_0x567e1d){return BPromise['reject'](_0x567e1d);}return _0x220c8d[_0xa2c1('0x24')]();};}function saveUpdates(_0x360ef8,_0xcca5d6){return function(_0x1f7782){if(_0x1f7782){return _0x1f7782[_0xa2c1('0x25')](_0x360ef8)[_0xa2c1('0x26')](function(_0x1e9bbe){return _0x1e9bbe;});}return null;};}function removeEntity(_0xc1f3d7,_0x4c4ab6){return function(_0x44356a){if(_0x44356a){return _0x44356a['destroy']()[_0xa2c1('0x26')](function(){_0xc1f3d7[_0xa2c1('0x1a')](0xcc)[_0xa2c1('0x1b')]();});}};}function handleEntityNotFound(_0x59bd37,_0x40b421){return function(_0x134b4c){if(!_0x134b4c){_0x59bd37[_0xa2c1('0x19')](0x194);}return _0x134b4c;};}function handleError(_0x33b010,_0x1435a1){_0x1435a1=_0x1435a1||0x1f4;return function(_0xfc420d){logger[_0xa2c1('0x27')](_0xfc420d[_0xa2c1('0x28')]);if(_0xfc420d[_0xa2c1('0x29')]){delete _0xfc420d[_0xa2c1('0x29')];}_0x33b010['status'](_0x1435a1)[_0xa2c1('0x2a')](_0xfc420d);};}exports[_0xa2c1('0x2b')]=function(_0x27fbed,_0x227471){var _0x1b8720={},_0xbf0cfc={},_0x978653={'count':0x0,'rows':[]};var _0xe79abf=_[_0xa2c1('0x2c')](db[_0xa2c1('0x2d')]['rawAttributes'],function(_0x2b5c1d){return{'name':_0x2b5c1d['fieldName'],'type':_0x2b5c1d[_0xa2c1('0x2e')][_0xa2c1('0x2f')]};});_0xbf0cfc[_0xa2c1('0x30')]=_[_0xa2c1('0x2c')](_0xe79abf,_0xa2c1('0x29'));_0xbf0cfc[_0xa2c1('0x31')]=_[_0xa2c1('0x32')](_0x27fbed[_0xa2c1('0x31')]);_0xbf0cfc[_0xa2c1('0x33')]=_['intersection'](_0xbf0cfc[_0xa2c1('0x30')],_0xbf0cfc['query']);_0x1b8720['attributes']=_[_0xa2c1('0x34')](_0xbf0cfc[_0xa2c1('0x30')],qs[_0xa2c1('0x35')](_0x27fbed[_0xa2c1('0x31')][_0xa2c1('0x35')]));_0x1b8720[_0xa2c1('0x36')]=_0x1b8720['attributes'][_0xa2c1('0x37')]?_0x1b8720[_0xa2c1('0x36')]:_0xbf0cfc[_0xa2c1('0x30')];if(!_0x27fbed[_0xa2c1('0x31')][_0xa2c1('0x38')](_0xa2c1('0x39'))){_0x1b8720[_0xa2c1('0x1f')]=qs[_0xa2c1('0x1f')](_0x27fbed[_0xa2c1('0x31')][_0xa2c1('0x1f')]);_0x1b8720[_0xa2c1('0x1d')]=qs['offset'](_0x27fbed['query'][_0xa2c1('0x1d')]);}_0x1b8720[_0xa2c1('0x3a')]=qs[_0xa2c1('0x3b')](_0x27fbed[_0xa2c1('0x31')][_0xa2c1('0x3b')]);_0x1b8720[_0xa2c1('0x3c')]=qs[_0xa2c1('0x33')](_[_0xa2c1('0x3d')](_0x27fbed[_0xa2c1('0x31')],_0xbf0cfc[_0xa2c1('0x33')]),_0xe79abf);if(_0x27fbed[_0xa2c1('0x31')][_0xa2c1('0x3e')]){_0x1b8720[_0xa2c1('0x3c')]=_[_0xa2c1('0x3f')](_0x1b8720[_0xa2c1('0x3c')],{'$or':_[_0xa2c1('0x2c')](_0xe79abf,function(_0x41a0c0){if(_0x41a0c0[_0xa2c1('0x2e')]!==_0xa2c1('0x40')){var _0x573089={};_0x573089[_0x41a0c0[_0xa2c1('0x29')]]={'$like':'%'+_0x27fbed[_0xa2c1('0x31')][_0xa2c1('0x3e')]+'%'};return _0x573089;}})});}_0x1b8720=_[_0xa2c1('0x3f')]({},_0x1b8720,_0x27fbed[_0xa2c1('0x41')]);var _0x5a88bd={'where':_0x1b8720[_0xa2c1('0x3c')]};return db[_0xa2c1('0x2d')]['count'](_0x5a88bd)[_0xa2c1('0x26')](function(_0x3bfe4c){_0x978653[_0xa2c1('0x20')]=_0x3bfe4c;if(_0x27fbed[_0xa2c1('0x31')][_0xa2c1('0x42')]){_0x1b8720[_0xa2c1('0x43')]=[{'all':!![]}];}return db[_0xa2c1('0x2d')][_0xa2c1('0x44')](_0x1b8720);})['then'](function(_0x12a056){_0x978653[_0xa2c1('0x45')]=_0x12a056;return _0x978653;})[_0xa2c1('0x26')](respondWithFilteredResult(_0x227471,_0x1b8720))[_0xa2c1('0x46')](handleError(_0x227471,null));};exports[_0xa2c1('0x47')]=function(_0x3114b0,_0x28bfd8){var _0x4e387f={'raw':!![],'where':{'id':_0x3114b0[_0xa2c1('0x48')]['id']}},_0x478a2e={};_0x478a2e[_0xa2c1('0x30')]=_[_0xa2c1('0x32')](db['VoiceDialReport']['rawAttributes']);_0x478a2e[_0xa2c1('0x31')]=_[_0xa2c1('0x32')](_0x3114b0[_0xa2c1('0x31')]);_0x478a2e['filters']=_[_0xa2c1('0x34')](_0x478a2e[_0xa2c1('0x30')],_0x478a2e[_0xa2c1('0x31')]);_0x4e387f[_0xa2c1('0x36')]=_['intersection'](_0x478a2e[_0xa2c1('0x30')],qs[_0xa2c1('0x35')](_0x3114b0[_0xa2c1('0x31')][_0xa2c1('0x35')]));_0x4e387f['attributes']=_0x4e387f[_0xa2c1('0x36')]['length']?_0x4e387f['attributes']:_0x478a2e[_0xa2c1('0x30')];if(_0x3114b0[_0xa2c1('0x31')][_0xa2c1('0x42')]){_0x4e387f['include']=[{'all':!![]}];}_0x4e387f=_[_0xa2c1('0x3f')]({},_0x4e387f,_0x3114b0[_0xa2c1('0x41')]);return db[_0xa2c1('0x2d')][_0xa2c1('0x49')](_0x4e387f)[_0xa2c1('0x26')](handleEntityNotFound(_0x28bfd8,null))[_0xa2c1('0x26')](respondWithResult(_0x28bfd8,null))[_0xa2c1('0x46')](handleError(_0x28bfd8,null));};exports['create']=function(_0x5b0ef1,_0x1e4909){return db[_0xa2c1('0x2d')][_0xa2c1('0x4a')](_0x5b0ef1[_0xa2c1('0x4b')],{})[_0xa2c1('0x26')](respondWithResult(_0x1e4909,0xc9))['catch'](handleError(_0x1e4909,null));};exports[_0xa2c1('0x25')]=function(_0x6164c8,_0x3fcc20){if(_0x6164c8['body']['id']){delete _0x6164c8['body']['id'];}return db[_0xa2c1('0x2d')][_0xa2c1('0x49')]({'where':{'id':_0x6164c8[_0xa2c1('0x48')]['id']}})[_0xa2c1('0x26')](handleEntityNotFound(_0x3fcc20,null))['then'](saveUpdates(_0x6164c8[_0xa2c1('0x4b')],null))[_0xa2c1('0x26')](respondWithResult(_0x3fcc20,null))[_0xa2c1('0x46')](handleError(_0x3fcc20,null));};exports[_0xa2c1('0x4c')]=function(_0x4aede3,_0x302293){return db['VoiceDialReport'][_0xa2c1('0x49')]({'where':{'id':_0x4aede3['params']['id']}})[_0xa2c1('0x26')](handleEntityNotFound(_0x302293,null))[_0xa2c1('0x26')](removeEntity(_0x302293,null))[_0xa2c1('0x46')](handleError(_0x302293,null));};exports[_0xa2c1('0x4d')]=function(_0xd4cce5,_0x59bfed){return db[_0xa2c1('0x2d')][_0xa2c1('0x4d')]()[_0xa2c1('0x26')](respondWithResult(_0x59bfed,null))[_0xa2c1('0x46')](handleError(_0x59bfed,null));}; \ No newline at end of file +var _0x8882=['offset','undefined','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','VoiceDialReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json'];(function(_0x20beae,_0x5eac6d){var _0xf5725=function(_0x926a3b){while(--_0x926a3b){_0x20beae['push'](_0x20beae['shift']());}};_0xf5725(++_0x5eac6d);}(_0x8882,0x11e));var _0x2888=function(_0x2b026c,_0x4cf3c5){_0x2b026c=_0x2b026c-0x0;var _0x12d562=_0x8882[_0x2b026c];return _0x12d562;};'use strict';var emlformat=require(_0x2888('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2888('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2888('0x2'));var moment=require(_0x2888('0x3'));var BPromise=require(_0x2888('0x4'));var Mustache=require(_0x2888('0x5'));var util=require(_0x2888('0x6'));var path=require(_0x2888('0x7'));var sox=require(_0x2888('0x8'));var csv=require('to-csv');var ejs=require(_0x2888('0x9'));var fs=require('fs');var fs_extra=require(_0x2888('0xa'));var _=require(_0x2888('0xb'));var squel=require(_0x2888('0xc'));var crypto=require(_0x2888('0xd'));var jsforce=require(_0x2888('0xe'));var deskjs=require(_0x2888('0xf'));var toCsv=require(_0x2888('0x10'));var querystring=require(_0x2888('0x11'));var Papa=require(_0x2888('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2888('0x13'));var as=require(_0x2888('0x14'));var hardwareService=require(_0x2888('0x15'));var logger=require('../../config/logger')(_0x2888('0x16'));var utils=require(_0x2888('0x17'));var config=require(_0x2888('0x18'));var licenseUtil=require(_0x2888('0x19'));var db=require(_0x2888('0x1a'))['db'];function respondWithStatusCode(_0x277dae,_0x3af7bf){_0x3af7bf=_0x3af7bf||0xcc;return function(_0x10662e){if(_0x10662e){return _0x277dae[_0x2888('0x1b')](_0x3af7bf);}return _0x277dae['status'](_0x3af7bf)[_0x2888('0x1c')]();};}function respondWithResult(_0x8af948,_0x57f84){_0x57f84=_0x57f84||0xc8;return function(_0x5edead){if(_0x5edead){return _0x8af948['status'](_0x57f84)[_0x2888('0x1d')](_0x5edead);}};}function respondWithFilteredResult(_0x3fcfda,_0x343e2f){return function(_0x3cde2f){if(_0x3cde2f){var _0x1078e2=typeof _0x343e2f[_0x2888('0x1e')]===_0x2888('0x1f')&&typeof _0x343e2f['limit']==='undefined';var _0x105c67=_0x3cde2f['count'];var _0x5019c8=_0x1078e2?0x0:_0x343e2f['offset'];var _0x22507d=_0x1078e2?_0x3cde2f['count']:_0x343e2f[_0x2888('0x1e')]+_0x343e2f['limit'];var _0x49fe57;if(_0x22507d>=_0x105c67){_0x22507d=_0x105c67;_0x49fe57=0xc8;}else{_0x49fe57=0xce;}_0x3fcfda[_0x2888('0x20')](_0x49fe57);return _0x3fcfda[_0x2888('0x21')](_0x2888('0x22'),_0x5019c8+'-'+_0x22507d+'/'+_0x105c67)[_0x2888('0x1d')](_0x3cde2f);}return null;};}function patchUpdates(_0x49b5f0){return function(_0x5e6f2c){try{jsonpatch['apply'](_0x5e6f2c,_0x49b5f0,!![]);}catch(_0xb69742){return BPromise[_0x2888('0x23')](_0xb69742);}return _0x5e6f2c[_0x2888('0x24')]();};}function saveUpdates(_0x3676f2,_0x516011){return function(_0x57de95){if(_0x57de95){return _0x57de95[_0x2888('0x25')](_0x3676f2)[_0x2888('0x26')](function(_0xa49472){return _0xa49472;});}return null;};}function removeEntity(_0x156281,_0x51ec38){return function(_0x879b4a){if(_0x879b4a){return _0x879b4a[_0x2888('0x27')]()['then'](function(){_0x156281[_0x2888('0x20')](0xcc)[_0x2888('0x1c')]();});}};}function handleEntityNotFound(_0x802f28,_0x17e9c0){return function(_0x28af37){if(!_0x28af37){_0x802f28['sendStatus'](0x194);}return _0x28af37;};}function handleError(_0x4b68b4,_0x2f2a55){_0x2f2a55=_0x2f2a55||0x1f4;return function(_0xaf7d0c){logger[_0x2888('0x28')](_0xaf7d0c[_0x2888('0x29')]);if(_0xaf7d0c[_0x2888('0x2a')]){delete _0xaf7d0c[_0x2888('0x2a')];}_0x4b68b4['status'](_0x2f2a55)['send'](_0xaf7d0c);};}exports[_0x2888('0x2b')]=function(_0x2ad8b9,_0xb28985){var _0x15ad0f={},_0x45f67a={},_0x574293={'count':0x0,'rows':[]};var _0x294bfe=_[_0x2888('0x2c')](db[_0x2888('0x2d')]['rawAttributes'],function(_0x358306){return{'name':_0x358306[_0x2888('0x2e')],'type':_0x358306[_0x2888('0x2f')][_0x2888('0x30')]};});_0x45f67a[_0x2888('0x31')]=_['map'](_0x294bfe,'name');_0x45f67a['query']=_[_0x2888('0x32')](_0x2ad8b9[_0x2888('0x33')]);_0x45f67a[_0x2888('0x34')]=_[_0x2888('0x35')](_0x45f67a[_0x2888('0x31')],_0x45f67a[_0x2888('0x33')]);_0x15ad0f[_0x2888('0x36')]=_[_0x2888('0x35')](_0x45f67a[_0x2888('0x31')],qs[_0x2888('0x37')](_0x2ad8b9[_0x2888('0x33')][_0x2888('0x37')]));_0x15ad0f[_0x2888('0x36')]=_0x15ad0f[_0x2888('0x36')][_0x2888('0x38')]?_0x15ad0f[_0x2888('0x36')]:_0x45f67a[_0x2888('0x31')];if(!_0x2ad8b9[_0x2888('0x33')][_0x2888('0x39')](_0x2888('0x3a'))){_0x15ad0f[_0x2888('0x3b')]=qs[_0x2888('0x3b')](_0x2ad8b9[_0x2888('0x33')][_0x2888('0x3b')]);_0x15ad0f[_0x2888('0x1e')]=qs[_0x2888('0x1e')](_0x2ad8b9[_0x2888('0x33')][_0x2888('0x1e')]);}_0x15ad0f['order']=qs[_0x2888('0x3c')](_0x2ad8b9['query'][_0x2888('0x3c')]);_0x15ad0f[_0x2888('0x3d')]=qs['filters'](_[_0x2888('0x3e')](_0x2ad8b9[_0x2888('0x33')],_0x45f67a[_0x2888('0x34')]),_0x294bfe);if(_0x2ad8b9[_0x2888('0x33')][_0x2888('0x3f')]){_0x15ad0f[_0x2888('0x3d')]=_[_0x2888('0x40')](_0x15ad0f['where'],{'$or':_['map'](_0x294bfe,function(_0x23dada){if(_0x23dada[_0x2888('0x2f')]!=='VIRTUAL'){var _0x435379={};_0x435379[_0x23dada[_0x2888('0x2a')]]={'$like':'%'+_0x2ad8b9[_0x2888('0x33')]['filter']+'%'};return _0x435379;}})});}_0x15ad0f=_[_0x2888('0x40')]({},_0x15ad0f,_0x2ad8b9[_0x2888('0x41')]);var _0x113ff2={'where':_0x15ad0f[_0x2888('0x3d')]};return db[_0x2888('0x2d')][_0x2888('0x42')](_0x113ff2)[_0x2888('0x26')](function(_0x24f5be){_0x574293['count']=_0x24f5be;if(_0x2ad8b9[_0x2888('0x33')][_0x2888('0x43')]){_0x15ad0f['include']=[{'all':!![]}];}return db[_0x2888('0x2d')][_0x2888('0x44')](_0x15ad0f);})[_0x2888('0x26')](function(_0xc53e2c){_0x574293[_0x2888('0x45')]=_0xc53e2c;return _0x574293;})['then'](respondWithFilteredResult(_0xb28985,_0x15ad0f))[_0x2888('0x46')](handleError(_0xb28985,null));};exports[_0x2888('0x47')]=function(_0x148838,_0x39e507){var _0x4318e5={'raw':!![],'where':{'id':_0x148838[_0x2888('0x48')]['id']}},_0x27508e={};_0x27508e[_0x2888('0x31')]=_[_0x2888('0x32')](db['VoiceDialReport'][_0x2888('0x49')]);_0x27508e[_0x2888('0x33')]=_[_0x2888('0x32')](_0x148838[_0x2888('0x33')]);_0x27508e[_0x2888('0x34')]=_[_0x2888('0x35')](_0x27508e[_0x2888('0x31')],_0x27508e['query']);_0x4318e5[_0x2888('0x36')]=_[_0x2888('0x35')](_0x27508e[_0x2888('0x31')],qs['fields'](_0x148838[_0x2888('0x33')][_0x2888('0x37')]));_0x4318e5[_0x2888('0x36')]=_0x4318e5[_0x2888('0x36')]['length']?_0x4318e5[_0x2888('0x36')]:_0x27508e['model'];if(_0x148838[_0x2888('0x33')][_0x2888('0x43')]){_0x4318e5[_0x2888('0x4a')]=[{'all':!![]}];}_0x4318e5=_[_0x2888('0x40')]({},_0x4318e5,_0x148838['options']);return db['VoiceDialReport'][_0x2888('0x4b')](_0x4318e5)[_0x2888('0x26')](handleEntityNotFound(_0x39e507,null))['then'](respondWithResult(_0x39e507,null))[_0x2888('0x46')](handleError(_0x39e507,null));};exports[_0x2888('0x4c')]=function(_0x365407,_0x272885){return db[_0x2888('0x2d')][_0x2888('0x4c')](_0x365407[_0x2888('0x4d')],{})[_0x2888('0x26')](respondWithResult(_0x272885,0xc9))['catch'](handleError(_0x272885,null));};exports[_0x2888('0x25')]=function(_0x5e924f,_0x1433d1){if(_0x5e924f[_0x2888('0x4d')]['id']){delete _0x5e924f[_0x2888('0x4d')]['id'];}return db[_0x2888('0x2d')]['find']({'where':{'id':_0x5e924f[_0x2888('0x48')]['id']}})[_0x2888('0x26')](handleEntityNotFound(_0x1433d1,null))[_0x2888('0x26')](saveUpdates(_0x5e924f[_0x2888('0x4d')],null))[_0x2888('0x26')](respondWithResult(_0x1433d1,null))['catch'](handleError(_0x1433d1,null));};exports['destroy']=function(_0x280a77,_0x34436d){return db[_0x2888('0x2d')][_0x2888('0x4b')]({'where':{'id':_0x280a77[_0x2888('0x48')]['id']}})[_0x2888('0x26')](handleEntityNotFound(_0x34436d,null))[_0x2888('0x26')](removeEntity(_0x34436d,null))[_0x2888('0x46')](handleError(_0x34436d,null));};exports[_0x2888('0x4e')]=function(_0x25baf6,_0x188bd3){return db[_0x2888('0x2d')][_0x2888('0x4e')]()[_0x2888('0x26')](respondWithResult(_0x188bd3,null))[_0x2888('0x46')](handleError(_0x188bd3,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 692e8c4..4f44c54 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 _0xbdb0=['VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceDialReport.attributes','define'];(function(_0x5e9e03,_0x2f44a8){var _0x553e3e=function(_0x42d005){while(--_0x42d005){_0x5e9e03['push'](_0x5e9e03['shift']());}};_0x553e3e(++_0x2f44a8);}(_0xbdb0,0x189));var _0x0bdb=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xbdb0[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0x0bdb('0x0'));var util=require(_0x0bdb('0x1'));var logger=require(_0x0bdb('0x2'))('api');var moment=require(_0x0bdb('0x3'));var BPromise=require(_0x0bdb('0x4'));var rp=require(_0x0bdb('0x5'));var fs=require('fs');var path=require(_0x0bdb('0x6'));var rimraf=require(_0x0bdb('0x7'));var config=require('../../config/environment');var attributes=require(_0x0bdb('0x8'));module['exports']=function(_0x168689,_0x5254ca){return _0x168689[_0x0bdb('0x9')](_0x0bdb('0xa'),attributes,{'tableName':_0x0bdb('0xb'),'paranoid':![],'indexes':[{'fields':[_0x0bdb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf711=['path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x890bb8,_0x1570cc){var _0x368242=function(_0x535f4c){while(--_0x535f4c){_0x890bb8['push'](_0x890bb8['shift']());}};_0x368242(++_0x1570cc);}(_0xf711,0xf9));var _0x1f71=function(_0x48a107,_0x348359){_0x48a107=_0x48a107-0x0;var _0x254479=_0xf711[_0x48a107];return _0x254479;};'use strict';var _=require(_0x1f71('0x0'));var util=require(_0x1f71('0x1'));var logger=require(_0x1f71('0x2'))(_0x1f71('0x3'));var moment=require('moment');var BPromise=require(_0x1f71('0x4'));var rp=require(_0x1f71('0x5'));var fs=require('fs');var path=require(_0x1f71('0x6'));var rimraf=require(_0x1f71('0x7'));var config=require(_0x1f71('0x8'));var attributes=require(_0x1f71('0x9'));module[_0x1f71('0xa')]=function(_0x2acf6c,_0x47e710){return _0x2acf6c[_0x1f71('0xb')](_0x1f71('0xc'),attributes,{'tableName':_0x1f71('0xd'),'paranoid':![],'indexes':[{'fields':[_0x1f71('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 186bf23..5562695 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 _0x26d1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','create','body','options','raw','then','CreateVoiceDialReport','catch','UpdateVoiceDialReport','VoiceDialReport','limit','lodash','util','bluebird','randomstring','ioredis'];(function(_0x1205c8,_0x29f9ea){var _0x2c48ef=function(_0x1a18f4){while(--_0x1a18f4){_0x1205c8['push'](_0x1205c8['shift']());}};_0x2c48ef(++_0x29f9ea);}(_0x26d1,0x112));var _0x126d=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x26d1[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x126d('0x0'));var util=require(_0x126d('0x1'));var moment=require('moment');var BPromise=require(_0x126d('0x2'));var rs=require(_0x126d('0x3'));var fs=require('fs');var Redis=require(_0x126d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x126d('0x5'));var logger=require(_0x126d('0x6'))(_0x126d('0x7'));var config=require(_0x126d('0x8'));var jayson=require(_0x126d('0x9'));var client=jayson[_0x126d('0xa')][_0x126d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47647d,_0x1c6b21,_0x3cacbf){return new BPromise(function(_0x19cc1c,_0x1dc829){return client[_0x126d('0xc')](_0x47647d,_0x3cacbf)['then'](function(_0x2f497c){logger[_0x126d('0xd')](_0x126d('0xe'),_0x1c6b21,_0x126d('0xf'));logger[_0x126d('0x10')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x1c6b21,'request\x20sent',JSON[_0x126d('0x11')](_0x2f497c));if(_0x2f497c[_0x126d('0x12')]){if(_0x2f497c[_0x126d('0x12')]['code']===0x1f4){logger[_0x126d('0x12')](_0x126d('0xe'),_0x1c6b21,_0x2f497c[_0x126d('0x12')][_0x126d('0x13')]);return _0x1dc829(_0x2f497c[_0x126d('0x12')]['message']);}logger[_0x126d('0x12')](_0x126d('0xe'),_0x1c6b21,_0x2f497c[_0x126d('0x12')]['message']);return _0x19cc1c(_0x2f497c[_0x126d('0x12')][_0x126d('0x13')]);}else{logger[_0x126d('0xd')](_0x126d('0xe'),_0x1c6b21,_0x126d('0xf'));_0x19cc1c(_0x2f497c[_0x126d('0x14')]['message']);}})['catch'](function(_0x2bd81f){logger[_0x126d('0x12')](_0x126d('0xe'),_0x1c6b21,_0x2bd81f);_0x1dc829(_0x2bd81f);});});}exports['CreateVoiceDialReport']=function(_0x3103b8){var _0x4f55e2=this;return new Promise(function(_0x45d427,_0x91f4cb){return db['VoiceDialReport'][_0x126d('0x15')](_0x3103b8[_0x126d('0x16')],{'raw':_0x3103b8['options']?_0x3103b8[_0x126d('0x17')][_0x126d('0x18')]===undefined?!![]:![]:!![]})[_0x126d('0x19')](function(_0x4dea48){logger[_0x126d('0xd')](_0x126d('0x1a'),_0x3103b8);logger['debug'](_0x126d('0x1a'),_0x3103b8,JSON[_0x126d('0x11')](_0x4dea48));_0x45d427(_0x4dea48);})[_0x126d('0x1b')](function(_0x4a91e1){logger['error']('CreateVoiceDialReport',_0x4a91e1['message'],_0x3103b8);_0x91f4cb(_0x4f55e2[_0x126d('0x12')](0x1f4,_0x4a91e1['message']));});});};exports[_0x126d('0x1c')]=function(_0x20fead){var _0x8eb4b6=this;return new Promise(function(_0x2e7c42,_0x18ff10){return db[_0x126d('0x1d')]['update'](_0x20fead['body'],{'raw':_0x20fead['options']?_0x20fead['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20fead['options']?_0x20fead[_0x126d('0x17')]['where']||null:null,'attributes':_0x20fead[_0x126d('0x17')]?_0x20fead[_0x126d('0x17')]['attributes']||null:null,'limit':_0x20fead[_0x126d('0x17')]?_0x20fead[_0x126d('0x17')][_0x126d('0x1e')]||null:null})['then'](function(_0x713acd){logger['info']('UpdateVoiceDialReport',_0x20fead);logger[_0x126d('0x10')](_0x126d('0x1c'),_0x20fead,JSON[_0x126d('0x11')](_0x713acd));_0x2e7c42(_0x713acd);})[_0x126d('0x1b')](function(_0x2019ee){logger[_0x126d('0x12')]('UpdateVoiceDialReport',_0x2019ee[_0x126d('0x13')],_0x20fead);_0x18ff10(_0x8eb4b6[_0x126d('0x12')](0x1f4,_0x2019ee[_0x126d('0x13')]));});});}; \ No newline at end of file +var _0xc826=['VoiceDialReport','body','options','raw','CreateVoiceDialReport','debug','UpdateVoiceDialReport','update','where','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0xc826,0x102));var _0x6c82=function(_0x228944,_0x2f9e47){_0x228944=_0x228944-0x0;var _0x5ce913=_0xc826[_0x228944];return _0x5ce913;};'use strict';var _=require('lodash');var util=require(_0x6c82('0x0'));var moment=require('moment');var BPromise=require(_0x6c82('0x1'));var rs=require(_0x6c82('0x2'));var fs=require('fs');var Redis=require(_0x6c82('0x3'));var db=require(_0x6c82('0x4'))['db'];var utils=require(_0x6c82('0x5'));var logger=require(_0x6c82('0x6'))(_0x6c82('0x7'));var config=require('../../config/environment');var jayson=require(_0x6c82('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42aabb,_0x4210af,_0x1e4028){return new BPromise(function(_0x1e1ec7,_0x1e75d4){return client[_0x6c82('0x9')](_0x42aabb,_0x1e4028)[_0x6c82('0xa')](function(_0x1211d4){logger[_0x6c82('0xb')](_0x6c82('0xc'),_0x4210af,_0x6c82('0xd'));logger['debug'](_0x6c82('0xe'),_0x4210af,_0x6c82('0xd'),JSON[_0x6c82('0xf')](_0x1211d4));if(_0x1211d4[_0x6c82('0x10')]){if(_0x1211d4[_0x6c82('0x10')][_0x6c82('0x11')]===0x1f4){logger[_0x6c82('0x10')](_0x6c82('0xc'),_0x4210af,_0x1211d4[_0x6c82('0x10')][_0x6c82('0x12')]);return _0x1e75d4(_0x1211d4[_0x6c82('0x10')][_0x6c82('0x12')]);}logger[_0x6c82('0x10')](_0x6c82('0xc'),_0x4210af,_0x1211d4[_0x6c82('0x10')][_0x6c82('0x12')]);return _0x1e1ec7(_0x1211d4[_0x6c82('0x10')]['message']);}else{logger[_0x6c82('0xb')](_0x6c82('0xc'),_0x4210af,'request\x20sent');_0x1e1ec7(_0x1211d4[_0x6c82('0x13')][_0x6c82('0x12')]);}})[_0x6c82('0x14')](function(_0x580725){logger[_0x6c82('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x4210af,_0x580725);_0x1e75d4(_0x580725);});});}exports['CreateVoiceDialReport']=function(_0x14c642){var _0x5701a9=this;return new Promise(function(_0x2f7e98,_0x497ef6){return db[_0x6c82('0x15')]['create'](_0x14c642[_0x6c82('0x16')],{'raw':_0x14c642[_0x6c82('0x17')]?_0x14c642['options'][_0x6c82('0x18')]===undefined?!![]:![]:!![]})[_0x6c82('0xa')](function(_0x106f63){logger[_0x6c82('0xb')](_0x6c82('0x19'),_0x14c642);logger[_0x6c82('0x1a')](_0x6c82('0x19'),_0x14c642,JSON[_0x6c82('0xf')](_0x106f63));_0x2f7e98(_0x106f63);})[_0x6c82('0x14')](function(_0x566c19){logger['error'](_0x6c82('0x19'),_0x566c19[_0x6c82('0x12')],_0x14c642);_0x497ef6(_0x5701a9[_0x6c82('0x10')](0x1f4,_0x566c19['message']));});});};exports[_0x6c82('0x1b')]=function(_0x242376){var _0x3c1591=this;return new Promise(function(_0xc0cc68,_0x2e0448){return db[_0x6c82('0x15')][_0x6c82('0x1c')](_0x242376[_0x6c82('0x16')],{'raw':_0x242376[_0x6c82('0x17')]?_0x242376[_0x6c82('0x17')][_0x6c82('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x242376['options']?_0x242376[_0x6c82('0x17')][_0x6c82('0x1d')]||null:null,'attributes':_0x242376[_0x6c82('0x17')]?_0x242376[_0x6c82('0x17')]['attributes']||null:null,'limit':_0x242376[_0x6c82('0x17')]?_0x242376[_0x6c82('0x17')][_0x6c82('0x1e')]||null:null})[_0x6c82('0xa')](function(_0x246c35){logger[_0x6c82('0xb')](_0x6c82('0x1b'),_0x242376);logger[_0x6c82('0x1a')](_0x6c82('0x1b'),_0x242376,JSON[_0x6c82('0xf')](_0x246c35));_0xc0cc68(_0x246c35);})[_0x6c82('0x14')](function(_0x3ebf3b){logger[_0x6c82('0x10')](_0x6c82('0x1b'),_0x3ebf3b[_0x6c82('0x12')],_0x242376);_0x2e0448(_0x3c1591['error'](0x1f4,_0x3ebf3b[_0x6c82('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 5e653e6..043408a 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 _0x0538=['index','get','show','post','/:id/applications','put','/:id','delete','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x1f92ed,_0x5dcd67){var _0x576816=function(_0x4d5d81){while(--_0x4d5d81){_0x1f92ed['push'](_0x1f92ed['shift']());}};_0x576816(++_0x5dcd67);}(_0x0538,0xda));var _0x8053=function(_0x531e48,_0x4bb96b){_0x531e48=_0x531e48-0x0;var _0x202971=_0x0538[_0x531e48];return _0x202971;};'use strict';var multer=require(_0x8053('0x0'));var util=require(_0x8053('0x1'));var path=require('path');var timeout=require(_0x8053('0x2'));var express=require(_0x8053('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8053('0x4'));var config=require(_0x8053('0x5'));var controller=require('./voiceExtension.controller');router['get']('/',auth[_0x8053('0x6')](),controller[_0x8053('0x7')]);router[_0x8053('0x8')]('/:id',auth[_0x8053('0x6')](),controller[_0x8053('0x9')]);router[_0x8053('0xa')]('/',auth[_0x8053('0x6')](),controller['create']);router['post'](_0x8053('0xb'),auth['isAuthenticated'](),controller['addApplications']);router[_0x8053('0xc')](_0x8053('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x8053('0xe')]('/:id',auth[_0x8053('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x08fe=['show','post','isAuthenticated','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','index','get','/:id'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x08fe,0x136));var _0xe08f=function(_0x4a96ca,_0x13754e){_0x4a96ca=_0x4a96ca-0x0;var _0x2aed48=_0x08fe[_0x4a96ca];return _0x2aed48;};'use strict';var multer=require(_0xe08f('0x0'));var util=require(_0xe08f('0x1'));var path=require(_0xe08f('0x2'));var timeout=require('connect-timeout');var express=require(_0xe08f('0x3'));var router=express[_0xe08f('0x4')]();var fs_extra=require(_0xe08f('0x5'));var auth=require(_0xe08f('0x6'));var interaction=require(_0xe08f('0x7'));var config=require('../../config/environment');var controller=require(_0xe08f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe08f('0x9')]);router[_0xe08f('0xa')](_0xe08f('0xb'),auth['isAuthenticated'](),controller[_0xe08f('0xc')]);router[_0xe08f('0xd')]('/',auth[_0xe08f('0xe')](),controller[_0xe08f('0xf')]);router[_0xe08f('0xd')](_0xe08f('0x10'),auth[_0xe08f('0xe')](),controller[_0xe08f('0x11')]);router[_0xe08f('0x12')](_0xe08f('0xb'),auth['isAuthenticated'](),controller[_0xe08f('0x13')]);router[_0xe08f('0x14')](_0xe08f('0xb'),auth[_0xe08f('0xe')](),controller[_0xe08f('0x15')]);module[_0xe08f('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 9565cde..76b2300 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 _0x4e09=['inbound','internal','inbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM'];(function(_0x1f1e31,_0x27b5c3){var _0x229b56=function(_0x16db77){while(--_0x16db77){_0x1f1e31['push'](_0x1f1e31['shift']());}};_0x229b56(++_0x27b5c3);}(_0x4e09,0x1ba));var _0x94e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4e09[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x94e0('0x0'));module[_0x94e0('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x94e0('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x94e0('0x3')],'allowNull':![],'unique':_0x94e0('0x2')},'priority':{'type':Sequelize[_0x94e0('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x94e0('0x2')},'tag':{'type':Sequelize[_0x94e0('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x94e0('0x3')],'allowNull':![],'defaultValue':_0x94e0('0x4')},'appdata':{'type':Sequelize[_0x94e0('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x94e0('0x5')](_0x94e0('0x6'),'outbound',_0x94e0('0x7'),_0x94e0('0x8'),'outbound-fax',_0x94e0('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x94e0('0x3')]},'interval':{'type':Sequelize[_0x94e0('0x3')],'allowNull':![],'defaultValue':_0x94e0('0xa')},'IntervalId':{'type':Sequelize[_0x94e0('0xb')]},'isApp':{'type':Sequelize[_0x94e0('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x94e0('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x94e0('0x3')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x94e0('0xb')]},'recordingFormat':{'type':Sequelize[_0x94e0('0x3')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x94e0('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x94e0('0xd')],'get':function(_0x3afc76){return this[_0x94e0('0xe')](_0x94e0('0xf'));}},'alias':{'type':Sequelize[_0x94e0('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0x912f=['wav','getDataValue','compositeIndex','STRING','NoOp','ENUM','inbound','inbound-fax','outbound-fax','system','INTEGER','BOOLEAN'];(function(_0x54605a,_0xc67e48){var _0x48429f=function(_0xa059cf){while(--_0xa059cf){_0x54605a['push'](_0x54605a['shift']());}};_0x48429f(++_0xc67e48);}(_0x912f,0x122));var _0xf912=function(_0x184ebd,_0x1a5a66){_0x184ebd=_0x184ebd-0x0;var _0x1b3dfe=_0x912f[_0x184ebd];return _0x1b3dfe;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf912('0x0'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf912('0x0')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xf912('0x0')},'tag':{'type':Sequelize[_0xf912('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xf912('0x1')],'allowNull':![],'defaultValue':_0xf912('0x2')},'appdata':{'type':Sequelize[_0xf912('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xf912('0x3')](_0xf912('0x4'),'outbound','internal',_0xf912('0x5'),_0xf912('0x6'),_0xf912('0x7'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf912('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xf912('0x8')]},'isApp':{'type':Sequelize[_0xf912('0x9')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xf912('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xf912('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xf912('0x1')],'defaultValue':_0xf912('0xa')},'answer':{'type':Sequelize[_0xf912('0x9')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x29bdaa){return this[_0xf912('0xb')]('exten');}},'alias':{'type':Sequelize[_0xf912('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index fdcaece..ef92fe5 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 _0x09e6=['inbound','outbound','InternalRoutes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','isApp','createRouting','findAndCountAll','finally','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','InboundRoutes','OutboundRoutes','internal','ignore','value','includes','type','find','name','UserProfileResource','error','stack','index','map','VoiceExtension','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','rawAttributes','length','includeAll','params','create','body','startsWith','exten','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x320666,_0xe645b5){var _0x8596e0=function(_0x14e398){while(--_0x14e398){_0x320666['push'](_0x320666['shift']());}};_0x8596e0(++_0xe645b5);}(_0x09e6,0x74));var _0x609e=function(_0x503bd4,_0x20cfd8){_0x503bd4=_0x503bd4-0x0;var _0x37e91d=_0x09e6[_0x503bd4];return _0x37e91d;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x609e('0x0'));var logger=require(_0x609e('0x1'))('api');var config=require(_0x609e('0x2'));var db=require(_0x609e('0x3'))['db'];config[_0x609e('0x4')]=_[_0x609e('0x5')](config[_0x609e('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0x609e('0x6'))(new Redis(config[_0x609e('0x4')]));require(_0x609e('0x7'))[_0x609e('0x8')](socket);function respondWithStatusCode(_0xb32333,_0x3dea93){_0x3dea93=_0x3dea93||0xcc;return function(_0x311dd2){if(_0x311dd2){return _0xb32333[_0x609e('0x9')](_0x3dea93);}return _0xb32333['status'](_0x3dea93)[_0x609e('0xa')]();};}function respondWithResult(_0x59498a,_0x3b88a6){_0x3b88a6=_0x3b88a6||0xc8;return function(_0x52e344){if(_0x52e344){return _0x59498a[_0x609e('0xb')](_0x3b88a6)[_0x609e('0xc')](_0x52e344);}};}function respondWithFilteredResult(_0x9979ef,_0x44eabd){return function(_0x491e3d){if(_0x491e3d){var _0x3cf070=typeof _0x44eabd[_0x609e('0xd')]===_0x609e('0xe')&&typeof _0x44eabd[_0x609e('0xf')]===_0x609e('0xe');var _0x5a6674=_0x491e3d[_0x609e('0x10')];var _0x4ad871=_0x3cf070?0x0:_0x44eabd[_0x609e('0xd')];var _0xd6f4f=_0x3cf070?_0x491e3d[_0x609e('0x10')]:_0x44eabd[_0x609e('0xd')]+_0x44eabd[_0x609e('0xf')];var _0x19b023;if(_0xd6f4f>=_0x5a6674){_0xd6f4f=_0x5a6674;_0x19b023=0xc8;}else{_0x19b023=0xce;}_0x9979ef[_0x609e('0xb')](_0x19b023);return _0x9979ef[_0x609e('0x11')](_0x609e('0x12'),_0x4ad871+'-'+_0xd6f4f+'/'+_0x5a6674)[_0x609e('0xc')](_0x491e3d);}return null;};}function removeEntity(_0x24828b){return function(_0x246f28){if(_0x246f28){return _0x246f28[_0x609e('0x13')]()[_0x609e('0x14')](function(){var _0x3ba38c=_0x246f28['get']({'plain':!![]});var _0x173279=[{'name':_0x609e('0x15'),'value':'inbound','ignore':![]},{'name':_0x609e('0x16'),'value':'outbound','ignore':![]},{'name':'InternalRoutes','value':_0x609e('0x17'),'ignore':![]}];var _0x291b86=_(_0x173279)['filter'](_0x609e('0x18'))['map'](_0x609e('0x19'))[_0x609e('0x19')]();if(_[_0x609e('0x1a')](_0x291b86,_0x3ba38c[_0x609e('0x1b')])){return;}var _0x142787=_[_0x609e('0x1c')](_0x173279,[_0x609e('0x19'),_0x3ba38c[_0x609e('0x1b')]])[_0x609e('0x1d')];return db[_0x609e('0x1e')]['destroy']({'where':{'type':_0x142787,'resourceId':_0x3ba38c['id']}})[_0x609e('0x14')](function(){return _0x246f28;});})[_0x609e('0x14')](function(){_0x24828b[_0x609e('0xb')](0xcc)[_0x609e('0xa')]();});}};}function handleEntityNotFound(_0x5843c1){return function(_0x4f7f85){if(!_0x4f7f85){_0x5843c1['sendStatus'](0x194);}return _0x4f7f85;};}function handleError(_0x4ed682,_0x4c85f9){_0x4c85f9=_0x4c85f9||0x1f4;return function(_0x226794){logger[_0x609e('0x1f')](_0x226794[_0x609e('0x20')]);if(_0x226794[_0x609e('0x1d')]){delete _0x226794[_0x609e('0x1d')];}_0x4ed682[_0x609e('0xb')](_0x4c85f9)['send'](_0x226794);};}exports[_0x609e('0x21')]=function(_0x445a40,_0x4fb8ca){var _0x24cd22={},_0x7e38ed={},_0xbafc45={'count':0x0,'rows':[]};var _0x233678=_[_0x609e('0x22')](db[_0x609e('0x23')]['rawAttributes'],function(_0x2a906b){return{'name':_0x2a906b[_0x609e('0x24')],'type':_0x2a906b[_0x609e('0x1b')][_0x609e('0x25')]};});_0x7e38ed[_0x609e('0x26')]=_['map'](_0x233678,_0x609e('0x1d'));_0x7e38ed[_0x609e('0x27')]=_[_0x609e('0x28')](_0x445a40['query']);_0x7e38ed[_0x609e('0x29')]=_[_0x609e('0x2a')](_0x7e38ed['model'],_0x7e38ed[_0x609e('0x27')]);_0x24cd22[_0x609e('0x2b')]=_['intersection'](_0x7e38ed[_0x609e('0x26')],qs[_0x609e('0x2c')](_0x445a40[_0x609e('0x27')][_0x609e('0x2c')]));_0x24cd22['attributes']=_0x24cd22[_0x609e('0x2b')]['length']?_0x24cd22['attributes']:_0x7e38ed[_0x609e('0x26')];if(!_0x445a40[_0x609e('0x27')][_0x609e('0x2d')]('nolimit')){_0x24cd22[_0x609e('0xf')]=qs['limit'](_0x445a40[_0x609e('0x27')][_0x609e('0xf')]);_0x24cd22[_0x609e('0xd')]=qs[_0x609e('0xd')](_0x445a40[_0x609e('0x27')]['offset']);}_0x24cd22[_0x609e('0x2e')]=qs[_0x609e('0x2f')](_0x445a40[_0x609e('0x27')][_0x609e('0x2f')]);_0x24cd22[_0x609e('0x30')]=qs[_0x609e('0x29')](_[_0x609e('0x31')](_0x445a40['query'],_0x7e38ed[_0x609e('0x29')]),_0x233678);if(_0x445a40[_0x609e('0x27')][_0x609e('0x32')]){_0x24cd22['where']=_[_0x609e('0x33')](_0x24cd22[_0x609e('0x30')],{'$or':_[_0x609e('0x22')](_0x233678,function(_0x4d21ca){if(_0x4d21ca[_0x609e('0x1b')]!==_0x609e('0x34')){var _0x4f792e={};_0x4f792e[_0x4d21ca[_0x609e('0x1d')]]={'$like':'%'+_0x445a40[_0x609e('0x27')][_0x609e('0x32')]+'%'};return _0x4f792e;}})});}_0x24cd22=_[_0x609e('0x33')]({},_0x24cd22,_0x445a40[_0x609e('0x35')]);var _0x2e2a2c={'where':_0x24cd22[_0x609e('0x30')]};return db['VoiceExtension'][_0x609e('0x10')](_0x2e2a2c)[_0x609e('0x14')](function(_0x1f6d34){_0xbafc45['count']=_0x1f6d34;if(_0x445a40['query']['includeAll']){_0x24cd22['include']=[{'all':!![]}];}return db[_0x609e('0x23')][_0x609e('0x36')](_0x24cd22);})[_0x609e('0x14')](function(_0x9915f){_0xbafc45['rows']=_0x9915f;return _0xbafc45;})[_0x609e('0x14')](respondWithFilteredResult(_0x4fb8ca,_0x24cd22))[_0x609e('0x37')](handleError(_0x4fb8ca,null));};exports[_0x609e('0x38')]=function(_0x482eb9,_0x563693){var _0x3f00a7={'raw':![],'where':{'id':_0x482eb9['params']['id']}},_0x344de3={};_0x344de3[_0x609e('0x26')]=_[_0x609e('0x28')](db[_0x609e('0x23')][_0x609e('0x39')]);_0x344de3['query']=_[_0x609e('0x28')](_0x482eb9[_0x609e('0x27')]);_0x344de3[_0x609e('0x29')]=_[_0x609e('0x2a')](_0x344de3[_0x609e('0x26')],_0x344de3[_0x609e('0x27')]);_0x3f00a7[_0x609e('0x2b')]=_[_0x609e('0x2a')](_0x344de3['model'],qs[_0x609e('0x2c')](_0x482eb9[_0x609e('0x27')][_0x609e('0x2c')]));_0x3f00a7[_0x609e('0x2b')]=_0x3f00a7[_0x609e('0x2b')][_0x609e('0x3a')]?_0x3f00a7[_0x609e('0x2b')]:_0x344de3['model'];if(_0x482eb9['query'][_0x609e('0x3b')]){_0x3f00a7['include']=[{'all':!![]}];}_0x3f00a7=_[_0x609e('0x33')]({},_0x3f00a7,_0x482eb9['options']);return db[_0x609e('0x23')][_0x609e('0x1c')](_0x3f00a7)['then'](handleEntityNotFound(_0x563693,null))[_0x609e('0x14')](respondWithResult(_0x563693,null))[_0x609e('0x37')](handleError(_0x563693,null));};exports[_0x609e('0x13')]=function(_0x38d905,_0x16d951){return db[_0x609e('0x23')]['find']({'where':{'id':_0x38d905[_0x609e('0x3c')]['id']}})[_0x609e('0x14')](handleEntityNotFound(_0x16d951,null))[_0x609e('0x14')](removeEntity(_0x16d951,null))[_0x609e('0x37')](handleError(_0x16d951,null));};exports[_0x609e('0x3d')]=function(_0xec27c7,_0xfaca00){if(_0xec27c7[_0x609e('0x3e')][_0x609e('0x1b')]==='outbound'&&!_[_0x609e('0x3f')](_0xec27c7[_0x609e('0x3e')][_0x609e('0x40')],'_')){_0xec27c7['body'][_0x609e('0x40')]='_'['concat'](_0xec27c7[_0x609e('0x3e')][_0x609e('0x40')]);}return db['VoiceExtension'][_0x609e('0x3d')](_0xec27c7[_0x609e('0x3e')],{'raw':![]})[_0x609e('0x14')](function(_0xda7a4a){var _0x1f4eb2=_0xec27c7['user'][_0x609e('0x41')]({'plain':!![]});if(!_0x1f4eb2)throw new Error(_0x609e('0x42'));if(_0x1f4eb2['role']===_0x609e('0x43')){var _0x54f745=_0xda7a4a[_0x609e('0x41')]({'plain':!![]});var _0x5c274a=[{'name':_0x609e('0x15'),'value':_0x609e('0x44')},{'name':_0x609e('0x16'),'value':_0x609e('0x45')},{'name':_0x609e('0x46'),'value':_0x609e('0x17')}];var _0x38221a=_[_0x609e('0x1c')](_0x5c274a,[_0x609e('0x19'),_0x54f745[_0x609e('0x1b')]])['name'];return db[_0x609e('0x47')]['find']({'where':{'name':_0x38221a,'userProfileId':_0x1f4eb2['userProfileId']},'raw':!![]})[_0x609e('0x14')](function(_0x4c7a12){if(_0x4c7a12&&_0x4c7a12[_0x609e('0x48')]===0x0){return db[_0x609e('0x1e')][_0x609e('0x3d')]({'name':_0x54f745[_0x609e('0x1d')],'resourceId':_0x54f745['id'],'type':_0x4c7a12[_0x609e('0x1d')],'sectionId':_0x4c7a12['id']},{})[_0x609e('0x14')](function(){return _0xda7a4a;});}else{return _0xda7a4a;}})[_0x609e('0x37')](function(_0x538cd1){logger['error'](_0x609e('0x49'),_0x538cd1);throw _0x538cd1;});}return _0xda7a4a;})['then'](respondWithResult(_0xfaca00,0xc9))[_0x609e('0x37')](handleError(_0xfaca00,null));};exports[_0x609e('0x4a')]=function(_0x6a780d,_0x44725a){if(_0x6a780d[_0x609e('0x3e')]['id']){delete _0x6a780d[_0x609e('0x3e')]['id'];}return db[_0x609e('0x23')][_0x609e('0x1c')]({'where':{'id':_0x6a780d[_0x609e('0x3c')]['id']}})[_0x609e('0x14')](handleEntityNotFound(_0x44725a,null))['then'](function(_0x70a33d){if(_0x70a33d){return db['VoiceExtension'][_0x609e('0x4a')](_['pick'](_0x6a780d[_0x609e('0x3e')],[_0x609e('0x40'),_0x609e('0x4b'),_0x609e('0x4c'),_0x609e('0x4d'),_0x609e('0x4e'),_0x609e('0x4f'),_0x609e('0x50')]),{'where':{'context':_0x70a33d[_0x609e('0x4b')],'exten':_0x70a33d['exten']},'individualHooks':!![]})['then'](function(_0x186b20){return _0x186b20;});}return null;})['then'](respondWithStatusCode(_0x44725a,null))['catch'](handleError(_0x44725a,null));};exports[_0x609e('0x51')]=function(_0x490a09,_0xda83bd){var _0x439e85=_0x490a09[_0x609e('0x3c')]['id'];var _0x5ebab0=_0x490a09[_0x609e('0x3e')];var _0x4a24a1=0xc8;var _0x3cf32b=null;return db[_0x609e('0x52')][_0x609e('0x53')]({'isolationLevel':db[_0x609e('0x52')][_0x609e('0x54')][_0x609e('0x55')][_0x609e('0x56')]},function(_0x7d17cc){return db['VoiceExtension']['findOne']({'where':{'id':_0x439e85},'transaction':_0x7d17cc})[_0x609e('0x14')](function(_0x50df3c){if(_0x50df3c){return db[_0x609e('0x23')][_0x609e('0x13')]({'where':{'VoiceExtensionId':_0x439e85},'transaction':_0x7d17cc})['then'](function(){var _0x2847df=_['map'](_0x5ebab0,function(_0x5c7c61){_0x5c7c61[_0x609e('0x57')]=_0x439e85;_0x5c7c61[_0x609e('0x58')]=!![];return _0x5c7c61;});return _0x50df3c[_0x609e('0x59')](_0x2847df);})['then'](function(_0x16cc65){return db[_0x609e('0x23')]['bulkCreate'](_0x16cc65,{'transaction':_0x7d17cc});});}else{_0x4a24a1=0x194;_0x3cf32b=[];}});})['then'](function(){if(_0x4a24a1!==0x194){return db[_0x609e('0x23')][_0x609e('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x439e85},'order':'cast(priority\x20as\x20unsigned)'})[_0x609e('0x14')](function(_0x576c6c){_0x3cf32b=_0x576c6c;});}})[_0x609e('0x37')](function(_0x137737){_0x4a24a1=0x1f4;logger[_0x609e('0x1f')](_0x137737[_0x609e('0x20')]);if(_0x137737[_0x609e('0x1d')]){delete _0x137737[_0x609e('0x1d')];}_0x3cf32b=_0x137737;})[_0x609e('0x5b')](function(){if(_0x3cf32b===null){_0xda83bd[_0x609e('0x9')](_0x4a24a1);}else{if(_0x4a24a1===0x1f4){_0xda83bd['status'](_0x4a24a1)['send'](_0x3cf32b);}else{_0xda83bd[_0x609e('0xb')](_0x4a24a1)[_0x609e('0xc')](_0x3cf32b);}}});}; \ No newline at end of file +var _0xc304=['exten','concat','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition','context','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','finally','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','offset','undefined','limit','count','json','destroy','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','UserProfileResource','then','error','name','send','index','VoiceExtension','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','params','create','body','startsWith'];(function(_0xc3d0c3,_0x435d4f){var _0x1e5245=function(_0x4e1919){while(--_0x4e1919){_0xc3d0c3['push'](_0xc3d0c3['shift']());}};_0x1e5245(++_0x435d4f);}(_0xc304,0x186));var _0x4c30=function(_0x53f04f,_0x419aa8){_0x53f04f=_0x53f04f-0x0;var _0x16a824=_0xc304[_0x53f04f];return _0x16a824;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x4c30('0x0'));var config=require(_0x4c30('0x1'));var db=require(_0x4c30('0x2'))['db'];config[_0x4c30('0x3')]=_[_0x4c30('0x4')](config[_0x4c30('0x3')],{'host':'localhost','port':0x18eb});var socket=require(_0x4c30('0x5'))(new Redis(config[_0x4c30('0x3')]));require(_0x4c30('0x6'))[_0x4c30('0x7')](socket);function respondWithStatusCode(_0x3b572f,_0x2cd8e0){_0x2cd8e0=_0x2cd8e0||0xcc;return function(_0x41fcd8){if(_0x41fcd8){return _0x3b572f[_0x4c30('0x8')](_0x2cd8e0);}return _0x3b572f['status'](_0x2cd8e0)[_0x4c30('0x9')]();};}function respondWithResult(_0x390751,_0x19bf91){_0x19bf91=_0x19bf91||0xc8;return function(_0x3338f3){if(_0x3338f3){return _0x390751[_0x4c30('0xa')](_0x19bf91)['json'](_0x3338f3);}};}function respondWithFilteredResult(_0x36b3d5,_0x612d18){return function(_0x4e9ac1){if(_0x4e9ac1){var _0x5dc8ca=typeof _0x612d18[_0x4c30('0xb')]===_0x4c30('0xc')&&typeof _0x612d18[_0x4c30('0xd')]===_0x4c30('0xc');var _0x4c07c3=_0x4e9ac1[_0x4c30('0xe')];var _0x36cdb6=_0x5dc8ca?0x0:_0x612d18[_0x4c30('0xb')];var _0xbc7a27=_0x5dc8ca?_0x4e9ac1[_0x4c30('0xe')]:_0x612d18['offset']+_0x612d18[_0x4c30('0xd')];var _0xcd2751;if(_0xbc7a27>=_0x4c07c3){_0xbc7a27=_0x4c07c3;_0xcd2751=0xc8;}else{_0xcd2751=0xce;}_0x36b3d5[_0x4c30('0xa')](_0xcd2751);return _0x36b3d5['set']('Content-Range',_0x36cdb6+'-'+_0xbc7a27+'/'+_0x4c07c3)[_0x4c30('0xf')](_0x4e9ac1);}return null;};}function removeEntity(_0x4a559c){return function(_0x211686){if(_0x211686){return _0x211686[_0x4c30('0x10')]()['then'](function(){var _0x3ed41c=_0x211686['get']({'plain':!![]});var _0x573eb7=[{'name':_0x4c30('0x11'),'value':_0x4c30('0x12'),'ignore':![]},{'name':_0x4c30('0x13'),'value':_0x4c30('0x14'),'ignore':![]},{'name':_0x4c30('0x15'),'value':_0x4c30('0x16'),'ignore':![]}];var _0x414395=_(_0x573eb7)[_0x4c30('0x17')](_0x4c30('0x18'))[_0x4c30('0x19')](_0x4c30('0x1a'))[_0x4c30('0x1a')]();if(_[_0x4c30('0x1b')](_0x414395,_0x3ed41c[_0x4c30('0x1c')])){return;}var _0x2731ab=_['find'](_0x573eb7,[_0x4c30('0x1a'),_0x3ed41c[_0x4c30('0x1c')]])['name'];return db[_0x4c30('0x1d')][_0x4c30('0x10')]({'where':{'type':_0x2731ab,'resourceId':_0x3ed41c['id']}})[_0x4c30('0x1e')](function(){return _0x211686;});})[_0x4c30('0x1e')](function(){_0x4a559c['status'](0xcc)[_0x4c30('0x9')]();});}};}function handleEntityNotFound(_0x948ffb){return function(_0x2abb16){if(!_0x2abb16){_0x948ffb[_0x4c30('0x8')](0x194);}return _0x2abb16;};}function handleError(_0x31d557,_0x590f72){_0x590f72=_0x590f72||0x1f4;return function(_0x1e33df){logger[_0x4c30('0x1f')](_0x1e33df['stack']);if(_0x1e33df['name']){delete _0x1e33df[_0x4c30('0x20')];}_0x31d557['status'](_0x590f72)[_0x4c30('0x21')](_0x1e33df);};}exports[_0x4c30('0x22')]=function(_0x19113e,_0x3ed750){var _0x5e1f4c={},_0x226112={},_0x5abb01={'count':0x0,'rows':[]};var _0x3f399b=_[_0x4c30('0x19')](db[_0x4c30('0x23')][_0x4c30('0x24')],function(_0x51d301){return{'name':_0x51d301['fieldName'],'type':_0x51d301['type']['key']};});_0x226112[_0x4c30('0x25')]=_['map'](_0x3f399b,_0x4c30('0x20'));_0x226112[_0x4c30('0x26')]=_['keys'](_0x19113e[_0x4c30('0x26')]);_0x226112[_0x4c30('0x27')]=_[_0x4c30('0x28')](_0x226112[_0x4c30('0x25')],_0x226112[_0x4c30('0x26')]);_0x5e1f4c[_0x4c30('0x29')]=_['intersection'](_0x226112[_0x4c30('0x25')],qs[_0x4c30('0x2a')](_0x19113e[_0x4c30('0x26')][_0x4c30('0x2a')]));_0x5e1f4c[_0x4c30('0x29')]=_0x5e1f4c[_0x4c30('0x29')][_0x4c30('0x2b')]?_0x5e1f4c['attributes']:_0x226112[_0x4c30('0x25')];if(!_0x19113e[_0x4c30('0x26')][_0x4c30('0x2c')](_0x4c30('0x2d'))){_0x5e1f4c['limit']=qs[_0x4c30('0xd')](_0x19113e['query'][_0x4c30('0xd')]);_0x5e1f4c[_0x4c30('0xb')]=qs['offset'](_0x19113e[_0x4c30('0x26')][_0x4c30('0xb')]);}_0x5e1f4c[_0x4c30('0x2e')]=qs[_0x4c30('0x2f')](_0x19113e[_0x4c30('0x26')][_0x4c30('0x2f')]);_0x5e1f4c[_0x4c30('0x30')]=qs['filters'](_[_0x4c30('0x31')](_0x19113e[_0x4c30('0x26')],_0x226112[_0x4c30('0x27')]),_0x3f399b);if(_0x19113e[_0x4c30('0x26')][_0x4c30('0x17')]){_0x5e1f4c[_0x4c30('0x30')]=_['merge'](_0x5e1f4c[_0x4c30('0x30')],{'$or':_[_0x4c30('0x19')](_0x3f399b,function(_0xe79f77){if(_0xe79f77['type']!==_0x4c30('0x32')){var _0x1b76ca={};_0x1b76ca[_0xe79f77[_0x4c30('0x20')]]={'$like':'%'+_0x19113e[_0x4c30('0x26')]['filter']+'%'};return _0x1b76ca;}})});}_0x5e1f4c=_[_0x4c30('0x33')]({},_0x5e1f4c,_0x19113e[_0x4c30('0x34')]);var _0x5a82aa={'where':_0x5e1f4c[_0x4c30('0x30')]};return db[_0x4c30('0x23')]['count'](_0x5a82aa)[_0x4c30('0x1e')](function(_0x2649f3){_0x5abb01[_0x4c30('0xe')]=_0x2649f3;if(_0x19113e[_0x4c30('0x26')][_0x4c30('0x35')]){_0x5e1f4c[_0x4c30('0x36')]=[{'all':!![]}];}return db[_0x4c30('0x23')][_0x4c30('0x37')](_0x5e1f4c);})[_0x4c30('0x1e')](function(_0x3d0ea1){_0x5abb01[_0x4c30('0x38')]=_0x3d0ea1;return _0x5abb01;})['then'](respondWithFilteredResult(_0x3ed750,_0x5e1f4c))[_0x4c30('0x39')](handleError(_0x3ed750,null));};exports[_0x4c30('0x3a')]=function(_0x150c5b,_0x5b8660){var _0x3a30d2={'raw':![],'where':{'id':_0x150c5b['params']['id']}},_0x2800b8={};_0x2800b8['model']=_[_0x4c30('0x3b')](db[_0x4c30('0x23')][_0x4c30('0x24')]);_0x2800b8[_0x4c30('0x26')]=_[_0x4c30('0x3b')](_0x150c5b['query']);_0x2800b8['filters']=_['intersection'](_0x2800b8[_0x4c30('0x25')],_0x2800b8[_0x4c30('0x26')]);_0x3a30d2['attributes']=_[_0x4c30('0x28')](_0x2800b8[_0x4c30('0x25')],qs[_0x4c30('0x2a')](_0x150c5b['query']['fields']));_0x3a30d2[_0x4c30('0x29')]=_0x3a30d2['attributes']['length']?_0x3a30d2[_0x4c30('0x29')]:_0x2800b8[_0x4c30('0x25')];if(_0x150c5b['query'][_0x4c30('0x35')]){_0x3a30d2[_0x4c30('0x36')]=[{'all':!![]}];}_0x3a30d2=_[_0x4c30('0x33')]({},_0x3a30d2,_0x150c5b[_0x4c30('0x34')]);return db[_0x4c30('0x23')][_0x4c30('0x3c')](_0x3a30d2)[_0x4c30('0x1e')](handleEntityNotFound(_0x5b8660,null))[_0x4c30('0x1e')](respondWithResult(_0x5b8660,null))[_0x4c30('0x39')](handleError(_0x5b8660,null));};exports[_0x4c30('0x10')]=function(_0x1a7f1d,_0x4331d3){return db[_0x4c30('0x23')]['find']({'where':{'id':_0x1a7f1d[_0x4c30('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4331d3,null))[_0x4c30('0x1e')](removeEntity(_0x4331d3,null))['catch'](handleError(_0x4331d3,null));};exports[_0x4c30('0x3e')]=function(_0x4a63e5,_0x5d1247){if(_0x4a63e5[_0x4c30('0x3f')][_0x4c30('0x1c')]===_0x4c30('0x14')&&!_[_0x4c30('0x40')](_0x4a63e5[_0x4c30('0x3f')][_0x4c30('0x41')],'_')){_0x4a63e5['body'][_0x4c30('0x41')]='_'[_0x4c30('0x42')](_0x4a63e5[_0x4c30('0x3f')][_0x4c30('0x41')]);}return db[_0x4c30('0x23')][_0x4c30('0x3e')](_0x4a63e5[_0x4c30('0x3f')],{'raw':![]})[_0x4c30('0x1e')](function(_0x5ae243){var _0x58d329=_0x4a63e5['user']['get']({'plain':!![]});if(!_0x58d329)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58d329[_0x4c30('0x43')]==='user'){var _0x3fc2cb=_0x5ae243[_0x4c30('0x44')]({'plain':!![]});var _0x4e656b=[{'name':_0x4c30('0x11'),'value':'inbound'},{'name':_0x4c30('0x13'),'value':_0x4c30('0x14')},{'name':_0x4c30('0x15'),'value':_0x4c30('0x16')}];var _0x4e8e33=_[_0x4c30('0x3c')](_0x4e656b,[_0x4c30('0x1a'),_0x3fc2cb[_0x4c30('0x1c')]])[_0x4c30('0x20')];return db['UserProfileSection'][_0x4c30('0x3c')]({'where':{'name':_0x4e8e33,'userProfileId':_0x58d329[_0x4c30('0x45')]},'raw':!![]})[_0x4c30('0x1e')](function(_0x1e1d2c){if(_0x1e1d2c&&_0x1e1d2c[_0x4c30('0x46')]===0x0){return db['UserProfileResource'][_0x4c30('0x3e')]({'name':_0x3fc2cb['name'],'resourceId':_0x3fc2cb['id'],'type':_0x1e1d2c[_0x4c30('0x20')],'sectionId':_0x1e1d2c['id']},{})[_0x4c30('0x1e')](function(){return _0x5ae243;});}else{return _0x5ae243;}})[_0x4c30('0x39')](function(_0x11071e){logger[_0x4c30('0x1f')](_0x4c30('0x47'),_0x11071e);throw _0x11071e;});}return _0x5ae243;})['then'](respondWithResult(_0x5d1247,0xc9))['catch'](handleError(_0x5d1247,null));};exports[_0x4c30('0x48')]=function(_0x2e084b,_0x139319){if(_0x2e084b[_0x4c30('0x3f')]['id']){delete _0x2e084b[_0x4c30('0x3f')]['id'];}return db[_0x4c30('0x23')][_0x4c30('0x3c')]({'where':{'id':_0x2e084b[_0x4c30('0x3d')]['id']}})[_0x4c30('0x1e')](handleEntityNotFound(_0x139319,null))[_0x4c30('0x1e')](function(_0x2ff395){if(_0x2ff395){return db[_0x4c30('0x23')][_0x4c30('0x48')](_[_0x4c30('0x31')](_0x2e084b[_0x4c30('0x3f')],[_0x4c30('0x41'),'context',_0x4c30('0x49'),_0x4c30('0x4a'),_0x4c30('0x4b'),_0x4c30('0x4c'),'alias']),{'where':{'context':_0x2ff395[_0x4c30('0x4d')],'exten':_0x2ff395[_0x4c30('0x41')]},'individualHooks':!![]})[_0x4c30('0x1e')](function(_0x2fa468){return _0x2fa468;});}return null;})[_0x4c30('0x1e')](respondWithStatusCode(_0x139319,null))['catch'](handleError(_0x139319,null));};exports[_0x4c30('0x4e')]=function(_0x486472,_0x2824b6){var _0x12a764=_0x486472[_0x4c30('0x3d')]['id'];var _0x262cb0=_0x486472[_0x4c30('0x3f')];var _0x394fb1=0xc8;var _0x47e08c=null;return db[_0x4c30('0x4f')][_0x4c30('0x50')]({'isolationLevel':db[_0x4c30('0x4f')][_0x4c30('0x51')]['ISOLATION_LEVELS'][_0x4c30('0x52')]},function(_0x200998){return db[_0x4c30('0x23')]['findOne']({'where':{'id':_0x12a764},'transaction':_0x200998})[_0x4c30('0x1e')](function(_0x69d17a){if(_0x69d17a){return db[_0x4c30('0x23')]['destroy']({'where':{'VoiceExtensionId':_0x12a764},'transaction':_0x200998})['then'](function(){var _0xf0e4c9=_[_0x4c30('0x19')](_0x262cb0,function(_0x136f8f){_0x136f8f[_0x4c30('0x53')]=_0x12a764;_0x136f8f[_0x4c30('0x54')]=!![];return _0x136f8f;});return _0x69d17a[_0x4c30('0x55')](_0xf0e4c9);})[_0x4c30('0x1e')](function(_0x3889be){return db[_0x4c30('0x23')][_0x4c30('0x56')](_0x3889be,{'transaction':_0x200998});});}else{_0x394fb1=0x194;_0x47e08c=[];}});})[_0x4c30('0x1e')](function(){if(_0x394fb1!==0x194){return db[_0x4c30('0x23')][_0x4c30('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x12a764},'order':_0x4c30('0x58')})[_0x4c30('0x1e')](function(_0x30f5e6){_0x47e08c=_0x30f5e6;});}})['catch'](function(_0x3a61d7){_0x394fb1=0x1f4;logger['error'](_0x3a61d7[_0x4c30('0x59')]);if(_0x3a61d7[_0x4c30('0x20')]){delete _0x3a61d7[_0x4c30('0x20')];}_0x47e08c=_0x3a61d7;})[_0x4c30('0x5a')](function(){if(_0x47e08c===null){_0x2824b6[_0x4c30('0x8')](_0x394fb1);}else{if(_0x394fb1===0x1f4){_0x2824b6['status'](_0x394fb1)['send'](_0x47e08c);}else{_0x2824b6[_0x4c30('0xa')](_0x394fb1)[_0x4c30('0xf')](_0x47e08c);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index ceca540..11e9983 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 _0xe9b1=['save','update','remove','emit','hasOwnProperty','exports','events','VoiceExtension','setMaxListeners'];(function(_0x27c539,_0x143796){var _0x49e903=function(_0x181639){while(--_0x181639){_0x27c539['push'](_0x27c539['shift']());}};_0x49e903(++_0x143796);}(_0xe9b1,0xc3));var _0x1e9b=function(_0x2247ab,_0x3f4162){_0x2247ab=_0x2247ab-0x0;var _0x430062=_0xe9b1[_0x2247ab];return _0x430062;};'use strict';var EventEmitter=require(_0x1e9b('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x1e9b('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x1e9b('0x2')](0x0);var events={'afterCreate':_0x1e9b('0x3'),'afterUpdate':_0x1e9b('0x4'),'afterDestroy':_0x1e9b('0x5')};function emitEvent(_0x55f3b5){return function(_0x2a7c75,_0x4180ad,_0x2feb6b){VoiceExtensionEvents[_0x1e9b('0x6')](_0x55f3b5+':'+_0x2a7c75['id'],_0x2a7c75);VoiceExtensionEvents[_0x1e9b('0x6')](_0x55f3b5,_0x2a7c75);_0x2feb6b(null);};}for(var e in events){if(events[_0x1e9b('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x1e9b('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xd688=['events','../../mysqldb','VoiceExtension','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xd29892,_0x2b67b9){var _0x293dfd=function(_0x22f177){while(--_0x22f177){_0xd29892['push'](_0xd29892['shift']());}};_0x293dfd(++_0x2b67b9);}(_0xd688,0x12c));var _0x8d68=function(_0xc563c0,_0x43cd8c){_0xc563c0=_0xc563c0-0x0;var _0x254edb=_0xd688[_0xc563c0];return _0x254edb;};'use strict';var EventEmitter=require(_0x8d68('0x0'));var VoiceExtension=require(_0x8d68('0x1'))['db'][_0x8d68('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8d68('0x3'),'afterUpdate':_0x8d68('0x4'),'afterDestroy':_0x8d68('0x5')};function emitEvent(_0x43ba4f){return function(_0x322db1,_0xa5ffc4,_0x4fa417){VoiceExtensionEvents[_0x8d68('0x6')](_0x43ba4f+':'+_0x322db1['id'],_0x322db1);VoiceExtensionEvents[_0x8d68('0x6')](_0x43ba4f,_0x322db1);_0x4fa417(null);};}for(var e in events){if(events[_0x8d68('0x7')](e)){var event=events[e];VoiceExtension[_0x8d68('0x8')](e,emitEvent(event));}}module[_0x8d68('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 2f87997..cb9cedf 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 _0x5d87=['split','prefix','${EXTEN}','SIP','join','U(xcally-mixmonitor-context)','isEmpty','findAll','interval','*,*,*,*','filter','IntervalId','toLowerCase','CDR(tag)=','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','intervals','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appdata','last','concat','priority','catch','define','VoiceExtension','voice_extensions','get','then','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','options','url','length','name','trunk','param','phone'];(function(_0x3df3ea,_0x2ba8b9){var _0x24ef0c=function(_0x5d9c5c){while(--_0x5d9c5c){_0x3df3ea['push'](_0x3df3ea['shift']());}};_0x24ef0c(++_0x2ba8b9);}(_0x5d87,0x16b));var _0x75d8=function(_0x23fce0,_0x1d55a6){_0x23fce0=_0x23fce0-0x0;var _0xd06946=_0x5d87[_0x23fce0];return _0xd06946;};'use strict';var _=require(_0x75d8('0x0'));var attributes=require(_0x75d8('0x1'));module[_0x75d8('0x2')]=function(_0x20f009){var _0x244b76=_0x20f009[_0x75d8('0x3')];function _0x59aced(_0x286986){var _0x2c7f0e=0x2;var _0x498621=[{'type':_0x286986[_0x75d8('0x4')],'app':_0x75d8('0x5'),'appdata':_0x75d8('0x6')+_0x286986[_0x75d8('0x4')],'context':_0x286986[_0x75d8('0x7')],'exten':_0x286986[_0x75d8('0x8')],'priority':_0x2c7f0e++,'VoiceExtensionId':_0x286986['id']},{'type':_0x286986[_0x75d8('0x4')],'app':_0x286986[_0x75d8('0x9')]?'Set':'NoOp','appdata':_0x286986['alias']?_0x75d8('0xa')+_0x286986[_0x75d8('0x9')]:'No\x20alias\x20set','context':_0x286986[_0x75d8('0x7')],'exten':_0x286986[_0x75d8('0x8')],'priority':_0x2c7f0e++,'VoiceExtensionId':_0x286986['id']}];if(_0x286986[_0x75d8('0x4')]===_0x75d8('0xb')){_0x498621[_0x75d8('0xc')]({'type':_0x75d8('0xb'),'app':_0x75d8('0x5'),'appdata':_0x75d8('0xd')+_0x286986['id'],'context':_0x286986[_0x75d8('0x7')],'exten':_0x286986[_0x75d8('0x8')],'priority':_0x2c7f0e++,'VoiceExtensionId':_0x286986['id']});}_0x498621['push']({'type':_0x286986[_0x75d8('0x4')],'app':'Set','appdata':_0x75d8('0xe'),'context':_0x286986[_0x75d8('0x7')],'exten':_0x286986['exten'],'priority':_0x2c7f0e++,'VoiceExtensionId':_0x286986['id']},{'type':_0x286986['type'],'app':_0x75d8('0x5'),'appdata':_0x75d8('0xf'),'context':_0x286986['context'],'exten':_0x286986['exten'],'priority':_0x2c7f0e++,'VoiceExtensionId':_0x286986['id']},{'type':_0x286986[_0x75d8('0x4')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x286986[_0x75d8('0x7')],'exten':_0x286986['exten'],'priority':_0x2c7f0e++,'VoiceExtensionId':_0x286986['id']});return _0x498621;}function _0x180916(_0x346f38){var _0x216201=0x2;var _0x23350b=[{'type':_0x75d8('0x10'),'app':'Set','appdata':_0x75d8('0x11'),'context':_0x346f38['context'],'exten':_0x346f38[_0x75d8('0x8')],'priority':_0x216201++,'VoiceExtensionId':_0x346f38['id']},{'type':_0x75d8('0x10'),'app':_0x346f38[_0x75d8('0x9')]?_0x75d8('0x5'):'NoOp','appdata':_0x346f38[_0x75d8('0x9')]?_0x75d8('0xa')+_0x346f38[_0x75d8('0x9')]:'No\x20alias\x20set','context':_0x346f38[_0x75d8('0x7')],'exten':_0x346f38[_0x75d8('0x8')],'priority':_0x216201++,'VoiceExtensionId':_0x346f38['id']},{'type':_0x75d8('0x10'),'app':_0x75d8('0x5'),'appdata':_0x75d8('0x12')+(_0x346f38[_0x75d8('0x13')]?_0x75d8('0x14')+_0x346f38['cutdigits']+'}':'${EXTEN}'),'context':_0x346f38[_0x75d8('0x7')],'exten':_0x346f38['exten'],'priority':_0x216201++,'VoiceExtensionId':_0x346f38['id']},{'type':'outbound','app':_0x75d8('0x5'),'appdata':_0x75d8('0xd')+_0x346f38['id'],'context':_0x346f38['context'],'exten':_0x346f38['exten'],'priority':_0x216201++,'VoiceExtensionId':_0x346f38['id']},{'type':'outbound','app':_0x75d8('0x15'),'appdata':_0x75d8('0x16')+(_0x216201+0x2)+_0x75d8('0x17')+(_0x216201+0x1)+')','context':_0x346f38[_0x75d8('0x7')],'exten':_0x346f38[_0x75d8('0x8')],'priority':_0x216201++,'VoiceExtensionId':_0x346f38['id']},{'type':'outbound','app':'Set','appdata':_0x346f38[_0x75d8('0x13')]?_0x75d8('0x18')+_0x346f38[_0x75d8('0x13')]+'}':'CDR(prefix)=noprefix','context':_0x346f38[_0x75d8('0x7')],'exten':_0x346f38[_0x75d8('0x8')],'priority':_0x216201++,'VoiceExtensionId':_0x346f38['id']},{'type':_0x75d8('0x10'),'app':_0x75d8('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x346f38[_0x75d8('0x7')],'exten':_0x346f38[_0x75d8('0x8')],'priority':_0x216201++,'VoiceExtensionId':_0x346f38['id']},{'type':_0x75d8('0x10'),'app':_0x75d8('0x5'),'appdata':_0x75d8('0xf'),'context':_0x346f38['context'],'exten':_0x346f38[_0x75d8('0x8')],'priority':_0x216201++,'VoiceExtensionId':_0x346f38['id']},{'type':_0x75d8('0x10'),'app':_0x75d8('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x346f38[_0x75d8('0x7')],'exten':_0x346f38[_0x75d8('0x8')],'priority':_0x216201++,'VoiceExtensionId':_0x346f38['id']},{'type':_0x75d8('0x10'),'app':_0x75d8('0x5'),'appdata':'outboundrouteid='+_0x346f38['id'],'context':_0x346f38['context'],'exten':_0x346f38[_0x75d8('0x8')],'priority':_0x216201++,'VoiceExtensionId':_0x346f38['id']}];if(_0x346f38[_0x75d8('0x19')](_0x75d8('0x1a'))&&_0x346f38['recordingFormat']!==_0x75d8('0x1b')){_0x23350b[_0x75d8('0xc')]({'type':_0x75d8('0x10'),'app':_0x75d8('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x346f38['context'],'exten':_0x346f38[_0x75d8('0x8')],'priority':_0x216201++,'VoiceExtensionId':_0x346f38['id']},{'type':'outbound','app':'Set','appdata':_0x75d8('0x1c')+_0x346f38[_0x75d8('0x1a')]||_0x75d8('0x1d'),'context':_0x346f38[_0x75d8('0x7')],'exten':_0x346f38[_0x75d8('0x8')],'priority':_0x216201++,'VoiceExtensionId':_0x346f38['id']});}return _0x23350b;}function _0x51bbb1(_0x4b45a7,_0x27a910){var _0x5acee0=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0x75d8('0x1e'),'param':0x2},{'name':_0x75d8('0x1f'),'param':0x3}];var _0xdca5b={};var _0x223074=_0x27a910['split'](',');var _0x20e670=[];for(var _0x22af19=0x0;_0x22af19<_0x5acee0[_0x75d8('0x20')];_0x22af19++){switch(_0x5acee0[_0x22af19][_0x75d8('0x21')]){case _0x75d8('0x22'):_0xdca5b[_0x75d8('0x22')]=_0x223074[_0x5acee0[_0x22af19][_0x75d8('0x23')]]['split']('/')[0x1];_0xdca5b[_0x75d8('0x24')]=_0x223074[_0x5acee0[_0x22af19]['param']][_0x75d8('0x25')]('/')[0x2];_0xdca5b[_0x75d8('0x26')]=_0xdca5b['phone']?_0xdca5b['phone'][_0x75d8('0x25')]('$')[0x0]:undefined;_0xdca5b[_0x75d8('0x24')]=_0x4b45a7[_0x75d8('0x13')]?(_0xdca5b[_0x75d8('0x26')]||'')+_0x75d8('0x14')+_0x4b45a7[_0x75d8('0x13')]+'}':(_0xdca5b['prefix']||'')+_0x75d8('0x27');_0x20e670[_0x5acee0[_0x22af19][_0x75d8('0x23')]]=[_0x75d8('0x28'),_0xdca5b[_0x75d8('0x22')],_0xdca5b[_0x75d8('0x24')]][_0x75d8('0x29')]('/');break;case _0x75d8('0x1e'):_0xdca5b[_0x75d8('0x1e')]=_0x223074[_0x5acee0[_0x22af19][_0x75d8('0x23')]];if(_0x4b45a7['recordingFormat']!==_0x75d8('0x1b')){if(_0xdca5b['options']['indexOf'](_0x75d8('0x2a'))<0x0){_0xdca5b[_0x75d8('0x1e')]+=_0x75d8('0x2a');}}else{_0xdca5b[_0x75d8('0x1e')]=_0xdca5b[_0x75d8('0x1e')]['replace']('U(xcally-mixmonitor-context)','');}_0x20e670[_0x5acee0[_0x22af19][_0x75d8('0x23')]]=_0xdca5b[_0x75d8('0x1e')];break;default:_0x20e670[_0x5acee0[_0x22af19][_0x75d8('0x23')]]=_0x223074[_0x5acee0[_0x22af19][_0x75d8('0x23')]];}}return _0x20e670[_0x75d8('0x29')](',');}function _0x367c4b(_0x127833,_0x11f19e,_0x3df811){return new Promise(function(_0x28098a,_0x3d2574){var _0xd73f2c=[];if(_[_0x75d8('0x2b')](_0x11f19e))return _0x28098a(_0xd73f2c);_0x244b76['Interval'][_0x75d8('0x2c')]({'attributes':['id',_0x75d8('0x2d'),'IntervalId'],'raw':!![]})['then'](function(_0x2893ef){for(var _0x46d4a2=0x0,_0x209398=0x0;_0x46d4a2<_0x11f19e[_0x75d8('0x20')];_0x46d4a2++,_0x209398=0x0){var _0x31e26d=_0x11f19e[_0x46d4a2];var _0x181131=[];var _0x1632f7=[];delete _0x31e26d['id'];if(_0x31e26d[_0x75d8('0x2d')]!==_0x75d8('0x2e')){_0x31e26d['intervals']=[_0x31e26d['interval']];}else{_0x31e26d['intervals']=_0x31e26d['IntervalId']?_['map'](_[_0x75d8('0x2f')](_0x2893ef,{'IntervalId':_0x31e26d[_0x75d8('0x30')]}),_0x75d8('0x2d')):[];}_0x31e26d['context']=_0x127833[_0x75d8('0x7')];_0x31e26d[_0x75d8('0x8')]=_0x127833[_0x75d8('0x8')];if(_0x31e26d[_0x75d8('0x4')])_0x31e26d[_0x75d8('0x4')]=_0x31e26d[_0x75d8('0x4')][_0x75d8('0x31')]();if(_0x127833[_0x75d8('0x4')]===_0x75d8('0x10')){if(_0x31e26d[_0x75d8('0x19')]('tag')&&_0x31e26d['tag']&&_0x31e26d['tag']!=='--'){_0x181131[_0x75d8('0xc')]({'type':_0x31e26d[_0x75d8('0x4')]['toLowerCase'](),'app':'Set','appdata':_0x75d8('0x32')+_0x31e26d[_0x75d8('0x33')],'context':_0x127833[_0x75d8('0x7')],'exten':_0x127833['exten'],'priority':_0x31e26d['intervals'][_0x75d8('0x20')]+_0x3df811+_0x209398++,'VoiceExtensionId':_0x127833['id']});}_0x181131[_0x75d8('0xc')]({'type':_0x31e26d[_0x75d8('0x4')][_0x75d8('0x31')](),'app':_0x75d8('0x15'),'appdata':_0x75d8('0x34')+(_0x31e26d[_0x75d8('0x35')]?_0x75d8('0x36')+_0x31e26d[_0x75d8('0x35')]+')':_0x75d8('0x37')),'context':_0x127833[_0x75d8('0x7')],'exten':_0x127833[_0x75d8('0x8')],'priority':_0x31e26d[_0x75d8('0x38')][_0x75d8('0x20')]+_0x3df811+_0x209398++,'VoiceExtensionId':_0x127833['id']});}else{if(_0x31e26d[_0x75d8('0x19')](_0x75d8('0x39'))){if([_0x75d8('0x3a'),_0x75d8('0x3b')][_0x75d8('0x3c')](_0x31e26d[_0x75d8('0x3d')][_0x75d8('0x31')]())&&_0x31e26d[_0x75d8('0x3e')]!==_0x75d8('0x3f')){if(_0x31e26d[_0x75d8('0x39')]){_0x181131[_0x75d8('0xc')]({'type':_0x31e26d[_0x75d8('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':_0x75d8('0x40'),'context':_0x127833['context'],'exten':_0x127833['exten'],'priority':_0x31e26d[_0x75d8('0x38')][_0x75d8('0x20')]+_0x3df811+_0x209398++,'VoiceExtensionId':_0x127833['id']});_0x181131[_0x75d8('0xc')]({'type':_0x31e26d[_0x75d8('0x4')][_0x75d8('0x31')](),'app':_0x75d8('0x5'),'appdata':_0x75d8('0x41'),'context':_0x127833[_0x75d8('0x7')],'exten':_0x127833[_0x75d8('0x8')],'priority':_0x31e26d[_0x75d8('0x38')]['length']+_0x3df811+_0x209398++,'VoiceExtensionId':_0x127833['id']});}else{_0x181131[_0x75d8('0xc')]({'type':_0x31e26d['type'][_0x75d8('0x31')](),'app':'ExecIf','appdata':_0x75d8('0x42'),'context':_0x127833[_0x75d8('0x7')],'exten':_0x127833['exten'],'priority':_0x31e26d[_0x75d8('0x38')][_0x75d8('0x20')]+_0x3df811+_0x209398++,'VoiceExtensionId':_0x127833['id']});_0x181131[_0x75d8('0xc')]({'type':_0x31e26d[_0x75d8('0x4')][_0x75d8('0x31')](),'app':'Set','appdata':_0x75d8('0x43'),'context':_0x127833[_0x75d8('0x7')],'exten':_0x127833[_0x75d8('0x8')],'priority':_0x31e26d[_0x75d8('0x38')][_0x75d8('0x20')]+_0x3df811+_0x209398++,'VoiceExtensionId':_0x127833['id']});}}}}for(var _0x59230e=0x0;_0x59230e<_0x31e26d[_0x75d8('0x38')][_0x75d8('0x20')];_0x59230e++){var _0x4079b0=_0x3df811+_0x31e26d[_0x75d8('0x38')][_0x75d8('0x20')];var _0x271af0=_0x59230e===_0x31e26d[_0x75d8('0x38')]['length']-0x1?_0x3df811+_0x181131[_0x75d8('0x20')]+_0x1632f7[_0x75d8('0x20')]+0x2:_0x3df811+_0x59230e+0x1;_0x181131[_0x75d8('0x44')](_0x59230e,0x0,{'type':_0x127833[_0x75d8('0x4')],'app':'GotoIfTime','appdata':_0x31e26d['intervals'][_0x59230e]+'?'+_0x127833[_0x75d8('0x7')]+_0x75d8('0x45')+_0x4079b0+':'+_0x127833[_0x75d8('0x7')]+',${EXTEN},'+_0x271af0,'exten':_0x127833[_0x75d8('0x8')],'context':_0x127833[_0x75d8('0x7')],'priority':_0x3df811+_0x59230e,'VoiceExtensionId':_0x127833['id']});}if(_0x31e26d['appType']==='outboundDial')_0x31e26d[_0x75d8('0x46')]=_0x51bbb1(_0x127833,_0x31e26d[_0x75d8('0x46')]);_0x31e26d['priority']=_0x181131[_0x75d8('0x20')]?_[_0x75d8('0x47')](_0x181131)['priority']+0x1:_0x3df811;_0xd73f2c=_[_0x75d8('0x48')](_0xd73f2c,_0x181131,[_0x31e26d],_0x1632f7);_0x3df811=_['last'](_0xd73f2c)[_0x75d8('0x49')]+0x1;}return _0x28098a(_0xd73f2c);})[_0x75d8('0x4a')](function(_0x219de5){_0x3d2574(_0x219de5);});});}return _0x20f009[_0x75d8('0x4b')](_0x75d8('0x4c'),attributes,{'tableName':_0x75d8('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x194799){var _0x43468a=this[_0x75d8('0x4e')]({'plain':!![]});var _0x280073=_0x43468a['type']===_0x75d8('0x10')?_0x180916(_0x43468a):_0x59aced(_0x43468a);return _0x367c4b(_0x43468a,_0x194799,_['last'](_0x280073)[_0x75d8('0x49')]+0x1)[_0x75d8('0x4f')](function(_0x77877d){var _0x372f3a=_[_0x75d8('0x48')](_0x280073,_0x77877d);_0x372f3a['push']({'type':_0x43468a[_0x75d8('0x4')],'app':'Hangup','exten':_0x43468a[_0x75d8('0x8')],'context':_0x43468a[_0x75d8('0x7')],'priority':_[_0x75d8('0x47')](_0x372f3a)['priority']+0x1,'VoiceExtensionId':_0x43468a['id']});return _0x372f3a;});}}});}; \ No newline at end of file +var _0x88ff=['Hangup','lodash','./voiceExtension.attributes','exports','models','Set','CDR(type)=','type','context','exten','NoOp','CDR(routeAlias)=','alias','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url','split','name','param','prefix','phone','none','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','then','length','intervals','map','filter','IntervalId','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','define','VoiceExtension','voice_extensions','concat'];(function(_0x143a91,_0x235332){var _0x1906f5=function(_0xd27eeb){while(--_0xd27eeb){_0x143a91['push'](_0x143a91['shift']());}};_0x1906f5(++_0x235332);}(_0x88ff,0x196));var _0xf88f=function(_0x1f39f9,_0x343948){_0x1f39f9=_0x1f39f9-0x0;var _0x4dec0d=_0x88ff[_0x1f39f9];return _0x4dec0d;};'use strict';var _=require(_0xf88f('0x0'));var attributes=require(_0xf88f('0x1'));module[_0xf88f('0x2')]=function(_0x81aba5){var _0x474775=_0x81aba5[_0xf88f('0x3')];function _0x5b92c3(_0x1350be){var _0x581915=0x2;var _0x54158f=[{'type':_0x1350be['type'],'app':_0xf88f('0x4'),'appdata':_0xf88f('0x5')+_0x1350be[_0xf88f('0x6')],'context':_0x1350be[_0xf88f('0x7')],'exten':_0x1350be[_0xf88f('0x8')],'priority':_0x581915++,'VoiceExtensionId':_0x1350be['id']},{'type':_0x1350be[_0xf88f('0x6')],'app':_0x1350be['alias']?'Set':_0xf88f('0x9'),'appdata':_0x1350be['alias']?_0xf88f('0xa')+_0x1350be[_0xf88f('0xb')]:_0xf88f('0xc'),'context':_0x1350be['context'],'exten':_0x1350be[_0xf88f('0x8')],'priority':_0x581915++,'VoiceExtensionId':_0x1350be['id']}];if(_0x1350be[_0xf88f('0x6')]===_0xf88f('0xd')){_0x54158f['push']({'type':_0xf88f('0xd'),'app':_0xf88f('0x4'),'appdata':_0xf88f('0xe')+_0x1350be['id'],'context':_0x1350be[_0xf88f('0x7')],'exten':_0x1350be[_0xf88f('0x8')],'priority':_0x581915++,'VoiceExtensionId':_0x1350be['id']});}_0x54158f[_0xf88f('0xf')]({'type':_0x1350be[_0xf88f('0x6')],'app':_0xf88f('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1350be['context'],'exten':_0x1350be[_0xf88f('0x8')],'priority':_0x581915++,'VoiceExtensionId':_0x1350be['id']},{'type':_0x1350be[_0xf88f('0x6')],'app':'Set','appdata':_0xf88f('0x10'),'context':_0x1350be['context'],'exten':_0x1350be[_0xf88f('0x8')],'priority':_0x581915++,'VoiceExtensionId':_0x1350be['id']},{'type':_0x1350be[_0xf88f('0x6')],'app':_0xf88f('0x4'),'appdata':_0xf88f('0x11'),'context':_0x1350be[_0xf88f('0x7')],'exten':_0x1350be[_0xf88f('0x8')],'priority':_0x581915++,'VoiceExtensionId':_0x1350be['id']});return _0x54158f;}function _0x41b06e(_0x50fd47){var _0x3432cc=0x2;var _0x43b569=[{'type':_0xf88f('0x12'),'app':'Set','appdata':_0xf88f('0x13'),'context':_0x50fd47[_0xf88f('0x7')],'exten':_0x50fd47['exten'],'priority':_0x3432cc++,'VoiceExtensionId':_0x50fd47['id']},{'type':_0xf88f('0x12'),'app':_0x50fd47['alias']?_0xf88f('0x4'):'NoOp','appdata':_0x50fd47[_0xf88f('0xb')]?_0xf88f('0xa')+_0x50fd47['alias']:_0xf88f('0xc'),'context':_0x50fd47[_0xf88f('0x7')],'exten':_0x50fd47[_0xf88f('0x8')],'priority':_0x3432cc++,'VoiceExtensionId':_0x50fd47['id']},{'type':_0xf88f('0x12'),'app':_0xf88f('0x4'),'appdata':'CDR(destination)='+(_0x50fd47[_0xf88f('0x14')]?'${EXTEN:'+_0x50fd47[_0xf88f('0x14')]+'}':_0xf88f('0x15')),'context':_0x50fd47[_0xf88f('0x7')],'exten':_0x50fd47[_0xf88f('0x8')],'priority':_0x3432cc++,'VoiceExtensionId':_0x50fd47['id']},{'type':_0xf88f('0x12'),'app':_0xf88f('0x4'),'appdata':_0xf88f('0xe')+_0x50fd47['id'],'context':_0x50fd47[_0xf88f('0x7')],'exten':_0x50fd47[_0xf88f('0x8')],'priority':_0x3432cc++,'VoiceExtensionId':_0x50fd47['id']},{'type':_0xf88f('0x12'),'app':'ExecIf','appdata':_0xf88f('0x16')+(_0x3432cc+0x2)+_0xf88f('0x17')+(_0x3432cc+0x1)+')','context':_0x50fd47[_0xf88f('0x7')],'exten':_0x50fd47[_0xf88f('0x8')],'priority':_0x3432cc++,'VoiceExtensionId':_0x50fd47['id']},{'type':_0xf88f('0x12'),'app':_0xf88f('0x4'),'appdata':_0x50fd47[_0xf88f('0x14')]?_0xf88f('0x18')+_0x50fd47['cutdigits']+'}':_0xf88f('0x19'),'context':_0x50fd47[_0xf88f('0x7')],'exten':_0x50fd47[_0xf88f('0x8')],'priority':_0x3432cc++,'VoiceExtensionId':_0x50fd47['id']},{'type':_0xf88f('0x12'),'app':_0xf88f('0x4'),'appdata':_0xf88f('0x1a'),'context':_0x50fd47[_0xf88f('0x7')],'exten':_0x50fd47['exten'],'priority':_0x3432cc++,'VoiceExtensionId':_0x50fd47['id']},{'type':_0xf88f('0x12'),'app':_0xf88f('0x4'),'appdata':_0xf88f('0x10'),'context':_0x50fd47['context'],'exten':_0x50fd47[_0xf88f('0x8')],'priority':_0x3432cc++,'VoiceExtensionId':_0x50fd47['id']},{'type':_0xf88f('0x12'),'app':_0xf88f('0x4'),'appdata':_0xf88f('0x11'),'context':_0x50fd47[_0xf88f('0x7')],'exten':_0x50fd47[_0xf88f('0x8')],'priority':_0x3432cc++,'VoiceExtensionId':_0x50fd47['id']},{'type':_0xf88f('0x12'),'app':_0xf88f('0x4'),'appdata':'outboundrouteid='+_0x50fd47['id'],'context':_0x50fd47[_0xf88f('0x7')],'exten':_0x50fd47[_0xf88f('0x8')],'priority':_0x3432cc++,'VoiceExtensionId':_0x50fd47['id']}];if(_0x50fd47[_0xf88f('0x1b')](_0xf88f('0x1c'))&&_0x50fd47[_0xf88f('0x1c')]!=='none'){_0x43b569[_0xf88f('0xf')]({'type':_0xf88f('0x12'),'app':_0xf88f('0x4'),'appdata':_0xf88f('0x1d'),'context':_0x50fd47[_0xf88f('0x7')],'exten':_0x50fd47[_0xf88f('0x8')],'priority':_0x3432cc++,'VoiceExtensionId':_0x50fd47['id']},{'type':_0xf88f('0x12'),'app':'Set','appdata':_0xf88f('0x1e')+_0x50fd47['recordingFormat']||_0xf88f('0x1f'),'context':_0x50fd47[_0xf88f('0x7')],'exten':_0x50fd47[_0xf88f('0x8')],'priority':_0x3432cc++,'VoiceExtensionId':_0x50fd47['id']});}return _0x43b569;}function _0x52ccb6(_0x4cfefe,_0x330079){var _0xca59b2=[{'name':_0xf88f('0x20'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0xf88f('0x21'),'param':0x2},{'name':_0xf88f('0x22'),'param':0x3}];var _0x2fbd3e={};var _0x2bee12=_0x330079[_0xf88f('0x23')](',');var _0x3787ff=[];for(var _0x4b2cc4=0x0;_0x4b2cc4<_0xca59b2['length'];_0x4b2cc4++){switch(_0xca59b2[_0x4b2cc4][_0xf88f('0x24')]){case _0xf88f('0x20'):_0x2fbd3e[_0xf88f('0x20')]=_0x2bee12[_0xca59b2[_0x4b2cc4][_0xf88f('0x25')]][_0xf88f('0x23')]('/')[0x1];_0x2fbd3e['phone']=_0x2bee12[_0xca59b2[_0x4b2cc4][_0xf88f('0x25')]]['split']('/')[0x2];_0x2fbd3e[_0xf88f('0x26')]=_0x2fbd3e[_0xf88f('0x27')]?_0x2fbd3e[_0xf88f('0x27')][_0xf88f('0x23')]('$')[0x0]:undefined;_0x2fbd3e[_0xf88f('0x27')]=_0x4cfefe['cutdigits']?(_0x2fbd3e[_0xf88f('0x26')]||'')+'${EXTEN:'+_0x4cfefe[_0xf88f('0x14')]+'}':(_0x2fbd3e[_0xf88f('0x26')]||'')+_0xf88f('0x15');_0x3787ff[_0xca59b2[_0x4b2cc4][_0xf88f('0x25')]]=['SIP',_0x2fbd3e[_0xf88f('0x20')],_0x2fbd3e[_0xf88f('0x27')]]['join']('/');break;case'options':_0x2fbd3e[_0xf88f('0x21')]=_0x2bee12[_0xca59b2[_0x4b2cc4][_0xf88f('0x25')]];if(_0x4cfefe[_0xf88f('0x1c')]!==_0xf88f('0x28')){if(_0x2fbd3e[_0xf88f('0x21')][_0xf88f('0x29')](_0xf88f('0x2a'))<0x0){_0x2fbd3e[_0xf88f('0x21')]+=_0xf88f('0x2a');}}else{_0x2fbd3e[_0xf88f('0x21')]=_0x2fbd3e[_0xf88f('0x21')][_0xf88f('0x2b')](_0xf88f('0x2a'),'');}_0x3787ff[_0xca59b2[_0x4b2cc4]['param']]=_0x2fbd3e[_0xf88f('0x21')];break;default:_0x3787ff[_0xca59b2[_0x4b2cc4][_0xf88f('0x25')]]=_0x2bee12[_0xca59b2[_0x4b2cc4][_0xf88f('0x25')]];}}return _0x3787ff[_0xf88f('0x2c')](',');}function _0x2b1db0(_0x358b76,_0x5c6740,_0x331f8a){return new Promise(function(_0x2d94cf,_0x268f36){var _0x5a5c61=[];if(_[_0xf88f('0x2d')](_0x5c6740))return _0x2d94cf(_0x5a5c61);_0x474775[_0xf88f('0x2e')][_0xf88f('0x2f')]({'attributes':['id',_0xf88f('0x30'),'IntervalId'],'raw':!![]})[_0xf88f('0x31')](function(_0x3e6c30){for(var _0x40be69=0x0,_0x4aef21=0x0;_0x40be69<_0x5c6740[_0xf88f('0x32')];_0x40be69++,_0x4aef21=0x0){var _0x2a50c5=_0x5c6740[_0x40be69];var _0x42c5fc=[];var _0xe51e4d=[];delete _0x2a50c5['id'];if(_0x2a50c5[_0xf88f('0x30')]!=='*,*,*,*'){_0x2a50c5[_0xf88f('0x33')]=[_0x2a50c5['interval']];}else{_0x2a50c5['intervals']=_0x2a50c5['IntervalId']?_[_0xf88f('0x34')](_[_0xf88f('0x35')](_0x3e6c30,{'IntervalId':_0x2a50c5[_0xf88f('0x36')]}),'interval'):[];}_0x2a50c5['context']=_0x358b76[_0xf88f('0x7')];_0x2a50c5[_0xf88f('0x8')]=_0x358b76[_0xf88f('0x8')];if(_0x2a50c5[_0xf88f('0x6')])_0x2a50c5[_0xf88f('0x6')]=_0x2a50c5[_0xf88f('0x6')][_0xf88f('0x37')]();if(_0x358b76[_0xf88f('0x6')]===_0xf88f('0x12')){if(_0x2a50c5[_0xf88f('0x1b')](_0xf88f('0x38'))&&_0x2a50c5[_0xf88f('0x38')]&&_0x2a50c5['tag']!=='--'){_0x42c5fc[_0xf88f('0xf')]({'type':_0x2a50c5['type'][_0xf88f('0x37')](),'app':_0xf88f('0x4'),'appdata':_0xf88f('0x39')+_0x2a50c5['tag'],'context':_0x358b76['context'],'exten':_0x358b76['exten'],'priority':_0x2a50c5['intervals'][_0xf88f('0x32')]+_0x331f8a+_0x4aef21++,'VoiceExtensionId':_0x358b76['id']});}_0x42c5fc[_0xf88f('0xf')]({'type':_0x2a50c5[_0xf88f('0x6')][_0xf88f('0x37')](),'app':'ExecIf','appdata':_0xf88f('0x3a')+(_0x2a50c5[_0xf88f('0x3b')]?'Set(CALLERID(all)='+_0x2a50c5[_0xf88f('0x3b')]+')':_0xf88f('0x3c')),'context':_0x358b76[_0xf88f('0x7')],'exten':_0x358b76[_0xf88f('0x8')],'priority':_0x2a50c5[_0xf88f('0x33')]['length']+_0x331f8a+_0x4aef21++,'VoiceExtensionId':_0x358b76['id']});}else{if(_0x2a50c5[_0xf88f('0x1b')](_0xf88f('0x3d'))){if(['queue',_0xf88f('0x3e')][_0xf88f('0x3f')](_0x2a50c5[_0xf88f('0x40')]['toLowerCase']())&&_0x2a50c5[_0xf88f('0x41')]!==_0xf88f('0x42')){if(_0x2a50c5[_0xf88f('0x3d')]){_0x42c5fc['push']({'type':_0x2a50c5[_0xf88f('0x6')][_0xf88f('0x37')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x358b76[_0xf88f('0x7')],'exten':_0x358b76[_0xf88f('0x8')],'priority':_0x2a50c5[_0xf88f('0x33')][_0xf88f('0x32')]+_0x331f8a+_0x4aef21++,'VoiceExtensionId':_0x358b76['id']});_0x42c5fc[_0xf88f('0xf')]({'type':_0x2a50c5[_0xf88f('0x6')][_0xf88f('0x37')](),'app':_0xf88f('0x4'),'appdata':_0xf88f('0x43'),'context':_0x358b76['context'],'exten':_0x358b76[_0xf88f('0x8')],'priority':_0x2a50c5[_0xf88f('0x33')][_0xf88f('0x32')]+_0x331f8a+_0x4aef21++,'VoiceExtensionId':_0x358b76['id']});}else{_0x42c5fc[_0xf88f('0xf')]({'type':_0x2a50c5['type'][_0xf88f('0x37')](),'app':'ExecIf','appdata':_0xf88f('0x44'),'context':_0x358b76[_0xf88f('0x7')],'exten':_0x358b76[_0xf88f('0x8')],'priority':_0x2a50c5[_0xf88f('0x33')]['length']+_0x331f8a+_0x4aef21++,'VoiceExtensionId':_0x358b76['id']});_0x42c5fc[_0xf88f('0xf')]({'type':_0x2a50c5['type'][_0xf88f('0x37')](),'app':'Set','appdata':_0xf88f('0x45'),'context':_0x358b76[_0xf88f('0x7')],'exten':_0x358b76['exten'],'priority':_0x2a50c5[_0xf88f('0x33')][_0xf88f('0x32')]+_0x331f8a+_0x4aef21++,'VoiceExtensionId':_0x358b76['id']});}}}}for(var _0x1a10db=0x0;_0x1a10db<_0x2a50c5[_0xf88f('0x33')][_0xf88f('0x32')];_0x1a10db++){var _0x54ca85=_0x331f8a+_0x2a50c5[_0xf88f('0x33')]['length'];var _0x2a169c=_0x1a10db===_0x2a50c5[_0xf88f('0x33')][_0xf88f('0x32')]-0x1?_0x331f8a+_0x42c5fc['length']+_0xe51e4d[_0xf88f('0x32')]+0x2:_0x331f8a+_0x1a10db+0x1;_0x42c5fc[_0xf88f('0x46')](_0x1a10db,0x0,{'type':_0x358b76['type'],'app':_0xf88f('0x47'),'appdata':_0x2a50c5['intervals'][_0x1a10db]+'?'+_0x358b76[_0xf88f('0x7')]+_0xf88f('0x48')+_0x54ca85+':'+_0x358b76[_0xf88f('0x7')]+_0xf88f('0x48')+_0x2a169c,'exten':_0x358b76[_0xf88f('0x8')],'context':_0x358b76[_0xf88f('0x7')],'priority':_0x331f8a+_0x1a10db,'VoiceExtensionId':_0x358b76['id']});}if(_0x2a50c5[_0xf88f('0x41')]==='outboundDial')_0x2a50c5['appdata']=_0x52ccb6(_0x358b76,_0x2a50c5[_0xf88f('0x49')]);_0x2a50c5[_0xf88f('0x4a')]=_0x42c5fc[_0xf88f('0x32')]?_['last'](_0x42c5fc)[_0xf88f('0x4a')]+0x1:_0x331f8a;_0x5a5c61=_['concat'](_0x5a5c61,_0x42c5fc,[_0x2a50c5],_0xe51e4d);_0x331f8a=_[_0xf88f('0x4b')](_0x5a5c61)[_0xf88f('0x4a')]+0x1;}return _0x2d94cf(_0x5a5c61);})['catch'](function(_0x2f10a4){_0x268f36(_0x2f10a4);});});}return _0x81aba5[_0xf88f('0x4c')](_0xf88f('0x4d'),attributes,{'tableName':_0xf88f('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x223c53){var _0x48533a=this['get']({'plain':!![]});var _0x4b6be4=_0x48533a[_0xf88f('0x6')]===_0xf88f('0x12')?_0x41b06e(_0x48533a):_0x5b92c3(_0x48533a);return _0x2b1db0(_0x48533a,_0x223c53,_['last'](_0x4b6be4)[_0xf88f('0x4a')]+0x1)[_0xf88f('0x31')](function(_0x3a1c15){var _0x199d69=_[_0xf88f('0x4f')](_0x4b6be4,_0x3a1c15);_0x199d69['push']({'type':_0x48533a[_0xf88f('0x6')],'app':_0xf88f('0x50'),'exten':_0x48533a[_0xf88f('0x8')],'context':_0x48533a[_0xf88f('0x7')],'priority':_[_0xf88f('0x4b')](_0x199d69)['priority']+0x1,'VoiceExtensionId':_0x48533a['id']});return _0x199d69;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index f67cc22..3611a13 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 _0xe5e0=['localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceExtension,\x20%s,\x20%s','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis'];(function(_0x58e30a,_0x28871d){var _0x39c82f=function(_0x1f9acc){while(--_0x1f9acc){_0x58e30a['push'](_0x58e30a['shift']());}};_0x39c82f(++_0x28871d);}(_0xe5e0,0x123));var _0x0e5e=function(_0x2efd8b,_0x9feb9d){_0x2efd8b=_0x2efd8b-0x0;var _0xab31df=_0xe5e0[_0x2efd8b];return _0xab31df;};'use strict';var _=require(_0x0e5e('0x0'));var util=require(_0x0e5e('0x1'));var moment=require(_0x0e5e('0x2'));var BPromise=require(_0x0e5e('0x3'));var rs=require(_0x0e5e('0x4'));var fs=require('fs');var Redis=require(_0x0e5e('0x5'));var db=require(_0x0e5e('0x6'))['db'];var utils=require(_0x0e5e('0x7'));var logger=require(_0x0e5e('0x8'))(_0x0e5e('0x9'));var config=require('../../config/environment');var jayson=require(_0x0e5e('0xa'));var client=jayson[_0x0e5e('0xb')]['http']({'port':0x232a});config[_0x0e5e('0xc')]=_['defaults'](config[_0x0e5e('0xc')],{'host':_0x0e5e('0xd'),'port':0x18eb});var socket=require(_0x0e5e('0xe'))(new Redis(config['redis']));require(_0x0e5e('0xf'))[_0x0e5e('0x10')](socket);function respondWithRpcPromise(_0x148700,_0x3c8beb,_0x1e0782){return new BPromise(function(_0x3ad3c1,_0x194a58){return client[_0x0e5e('0x11')](_0x148700,_0x1e0782)[_0x0e5e('0x12')](function(_0x5779a1){logger[_0x0e5e('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x3c8beb,_0x0e5e('0x14'));logger['debug'](_0x0e5e('0x15'),_0x3c8beb,_0x0e5e('0x14'),JSON[_0x0e5e('0x16')](_0x5779a1));if(_0x5779a1[_0x0e5e('0x17')]){if(_0x5779a1[_0x0e5e('0x17')][_0x0e5e('0x18')]===0x1f4){logger[_0x0e5e('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x3c8beb,_0x5779a1[_0x0e5e('0x17')][_0x0e5e('0x19')]);return _0x194a58(_0x5779a1['error'][_0x0e5e('0x19')]);}logger[_0x0e5e('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x3c8beb,_0x5779a1[_0x0e5e('0x17')][_0x0e5e('0x19')]);return _0x3ad3c1(_0x5779a1['error']['message']);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x3c8beb,_0x0e5e('0x14'));_0x3ad3c1(_0x5779a1[_0x0e5e('0x1a')][_0x0e5e('0x19')]);}})[_0x0e5e('0x1b')](function(_0x299c05){logger['error'](_0x0e5e('0x1c'),_0x3c8beb,_0x299c05);_0x194a58(_0x299c05);});});}exports[_0x0e5e('0x1d')]=function(_0x2f158f){var _0x5b40dc=this;return new Promise(function(_0x49b73e,_0x1237de){return db[_0x0e5e('0x1e')]['findAll']({'raw':_0x2f158f[_0x0e5e('0x1f')]?_0x2f158f['options'][_0x0e5e('0x20')]===undefined?!![]:![]:!![],'where':_0x2f158f[_0x0e5e('0x1f')]?_0x2f158f[_0x0e5e('0x1f')][_0x0e5e('0x21')]||null:null,'attributes':_0x2f158f[_0x0e5e('0x1f')]?_0x2f158f['options'][_0x0e5e('0x22')]||null:null,'limit':_0x2f158f[_0x0e5e('0x1f')]?_0x2f158f[_0x0e5e('0x1f')]['limit']||null:null,'include':_0x2f158f[_0x0e5e('0x1f')]?_0x2f158f[_0x0e5e('0x1f')][_0x0e5e('0x23')]?_['map'](_0x2f158f[_0x0e5e('0x1f')][_0x0e5e('0x23')],function(_0x2b3afc){return{'model':db[_0x2b3afc['model']],'as':_0x2b3afc['as'],'attributes':_0x2b3afc[_0x0e5e('0x22')],'include':_0x2b3afc[_0x0e5e('0x23')]?_['map'](_0x2b3afc[_0x0e5e('0x23')],function(_0x2b4b98){return{'model':db[_0x2b4b98[_0x0e5e('0x24')]],'as':_0x2b4b98['as'],'attributes':_0x2b4b98['attributes'],'include':_0x2b4b98[_0x0e5e('0x23')]?_[_0x0e5e('0x25')](_0x2b4b98[_0x0e5e('0x23')],function(_0x106dc3){return{'model':db[_0x106dc3['model']],'as':_0x106dc3['as'],'attributes':_0x106dc3['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e5e('0x12')](function(_0x5b5f53){logger[_0x0e5e('0x13')](_0x0e5e('0x1d'),_0x2f158f);logger['debug'](_0x0e5e('0x1d'),_0x2f158f,JSON[_0x0e5e('0x16')](_0x5b5f53));_0x49b73e(_0x5b5f53);})['catch'](function(_0x402430){logger['error'](_0x0e5e('0x1d'),_0x402430[_0x0e5e('0x19')],_0x2f158f);_0x1237de(_0x5b40dc[_0x0e5e('0x17')](0x1f4,_0x402430[_0x0e5e('0x19')]));});});}; \ No newline at end of file +var _0xa1f6=['ioredis','jayson/promise','client','http','redis','defaults','localhost','./voiceExtension.socket','register','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','model','include','map','lodash','util','moment','bluebird','randomstring'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0xa1f6[_0x3712e2];return _0x1faff4;};'use strict';var _=require(_0x6a1f('0x0'));var util=require(_0x6a1f('0x1'));var moment=require(_0x6a1f('0x2'));var BPromise=require(_0x6a1f('0x3'));var rs=require(_0x6a1f('0x4'));var fs=require('fs');var Redis=require(_0x6a1f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6a1f('0x6'));var client=jayson[_0x6a1f('0x7')][_0x6a1f('0x8')]({'port':0x232a});config[_0x6a1f('0x9')]=_[_0x6a1f('0xa')](config[_0x6a1f('0x9')],{'host':_0x6a1f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6a1f('0x9')]));require(_0x6a1f('0xc'))[_0x6a1f('0xd')](socket);function respondWithRpcPromise(_0x287e54,_0x1617b7,_0x5aafd2){return new BPromise(function(_0x30fd4e,_0x17f866){return client[_0x6a1f('0xe')](_0x287e54,_0x5aafd2)[_0x6a1f('0xf')](function(_0x59fc17){logger[_0x6a1f('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x1617b7,_0x6a1f('0x11'));logger[_0x6a1f('0x12')](_0x6a1f('0x13'),_0x1617b7,_0x6a1f('0x11'),JSON[_0x6a1f('0x14')](_0x59fc17));if(_0x59fc17[_0x6a1f('0x15')]){if(_0x59fc17[_0x6a1f('0x15')][_0x6a1f('0x16')]===0x1f4){logger[_0x6a1f('0x15')](_0x6a1f('0x17'),_0x1617b7,_0x59fc17[_0x6a1f('0x15')][_0x6a1f('0x18')]);return _0x17f866(_0x59fc17[_0x6a1f('0x15')][_0x6a1f('0x18')]);}logger[_0x6a1f('0x15')](_0x6a1f('0x17'),_0x1617b7,_0x59fc17[_0x6a1f('0x15')][_0x6a1f('0x18')]);return _0x30fd4e(_0x59fc17[_0x6a1f('0x15')]['message']);}else{logger[_0x6a1f('0x10')](_0x6a1f('0x17'),_0x1617b7,_0x6a1f('0x11'));_0x30fd4e(_0x59fc17[_0x6a1f('0x19')][_0x6a1f('0x18')]);}})[_0x6a1f('0x1a')](function(_0x19562a){logger[_0x6a1f('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x1617b7,_0x19562a);_0x17f866(_0x19562a);});});}exports[_0x6a1f('0x1b')]=function(_0x5100f2){var _0x203f99=this;return new Promise(function(_0x2dfd4e,_0x3c7ed0){return db[_0x6a1f('0x1c')][_0x6a1f('0x1d')]({'raw':_0x5100f2['options']?_0x5100f2[_0x6a1f('0x1e')][_0x6a1f('0x1f')]===undefined?!![]:![]:!![],'where':_0x5100f2[_0x6a1f('0x1e')]?_0x5100f2[_0x6a1f('0x1e')][_0x6a1f('0x20')]||null:null,'attributes':_0x5100f2[_0x6a1f('0x1e')]?_0x5100f2[_0x6a1f('0x1e')][_0x6a1f('0x21')]||null:null,'limit':_0x5100f2['options']?_0x5100f2[_0x6a1f('0x1e')][_0x6a1f('0x22')]||null:null,'include':_0x5100f2['options']?_0x5100f2['options']['include']?_['map'](_0x5100f2[_0x6a1f('0x1e')]['include'],function(_0x5abe40){return{'model':db[_0x5abe40[_0x6a1f('0x23')]],'as':_0x5abe40['as'],'attributes':_0x5abe40[_0x6a1f('0x21')],'include':_0x5abe40[_0x6a1f('0x24')]?_[_0x6a1f('0x25')](_0x5abe40[_0x6a1f('0x24')],function(_0x3bf7f4){return{'model':db[_0x3bf7f4[_0x6a1f('0x23')]],'as':_0x3bf7f4['as'],'attributes':_0x3bf7f4[_0x6a1f('0x21')],'include':_0x3bf7f4['include']?_[_0x6a1f('0x25')](_0x3bf7f4[_0x6a1f('0x24')],function(_0x3f0730){return{'model':db[_0x3f0730['model']],'as':_0x3f0730['as'],'attributes':_0x3f0730[_0x6a1f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6a1f('0xf')](function(_0x257cee){logger[_0x6a1f('0x10')](_0x6a1f('0x1b'),_0x5100f2);logger[_0x6a1f('0x12')](_0x6a1f('0x1b'),_0x5100f2,JSON['stringify'](_0x257cee));_0x2dfd4e(_0x257cee);})['catch'](function(_0x3aa41a){logger[_0x6a1f('0x15')](_0x6a1f('0x1b'),_0x3aa41a[_0x6a1f('0x18')],_0x5100f2);_0x3c7ed0(_0x203f99[_0x6a1f('0x15')](0x1f4,_0x3aa41a[_0x6a1f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 82ba215..a9f715f 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 _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x3e07e5,_0x3de4d4){var _0xc44fe9=function(_0x5c86cd){while(--_0x5c86cd){_0x3e07e5['push'](_0x3e07e5['shift']());}};_0xc44fe9(++_0x3de4d4);}(_0x326f,0xd1));var _0xf326=function(_0x55d8a9,_0x1c66c5){_0x55d8a9=_0x55d8a9-0x0;var _0x431d0e=_0x326f[_0x55d8a9];return _0x431d0e;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file +var _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x39beed,_0x537a7f){var _0x29dcfd=function(_0x57863f){while(--_0x57863f){_0x39beed['push'](_0x39beed['shift']());}};_0x29dcfd(++_0x537a7f);}(_0x7a54,0x106));var _0x47a5=function(_0x5a612c,_0x19169b){_0x5a612c=_0x5a612c-0x0;var _0x4b88f0=_0x7a54[_0x5a612c];return _0x4b88f0;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 539110e..5e70353 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 _0x5496=['fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','index','get','isAuthenticated','show','getMessages','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express'];(function(_0x3aaf6e,_0x28c7ff){var _0x8cf2a4=function(_0x34066a){while(--_0x34066a){_0x3aaf6e['push'](_0x3aaf6e['shift']());}};_0x8cf2a4(++_0x28c7ff);}(_0x5496,0x175));var _0x6549=function(_0x5992b4,_0x2c28dd){_0x5992b4=_0x5992b4-0x0;var _0x2d68a0=_0x5496[_0x5992b4];return _0x2d68a0;};'use strict';var multer=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var path=require(_0x6549('0x2'));var timeout=require(_0x6549('0x3'));var express=require(_0x6549('0x4'));var router=express['Router']();var fs_extra=require(_0x6549('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var controller=require(_0x6549('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6549('0x9')]);router[_0x6549('0xa')]('/:id',auth[_0x6549('0xb')](),controller[_0x6549('0xc')]);router[_0x6549('0xa')]('/:id/messages',auth[_0x6549('0xb')](),controller[_0x6549('0xd')]);router[_0x6549('0xe')]('/',auth[_0x6549('0xb')](),controller[_0x6549('0xf')]);router[_0x6549('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6549('0x11')]);router[_0x6549('0x12')](_0x6549('0x13'),auth[_0x6549('0xb')](),controller[_0x6549('0x14')]);module['exports']=router; \ No newline at end of file +var _0x33af=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','index','/:id','isAuthenticated','show','getMessages','post','create','put','update','delete','destroy','util','connect-timeout','express','Router'];(function(_0x100310,_0x1d25c8){var _0x13d5a4=function(_0xcd08e5){while(--_0xcd08e5){_0x100310['push'](_0x100310['shift']());}};_0x13d5a4(++_0x1d25c8);}(_0x33af,0xec));var _0xf33a=function(_0x32e94b,_0x38c7a7){_0x32e94b=_0x32e94b-0x0;var _0x3b1567=_0x33af[_0x32e94b];return _0x3b1567;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id/messages',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0xe')]('/',auth[_0xf33a('0xb')](),controller[_0xf33a('0xf')]);router[_0xf33a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xf33a('0x11')]);router[_0xf33a('0x12')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index b465b3a..cdb5fbc 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 _0x2ef5=['INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP'];(function(_0x4dc16f,_0x17fd42){var _0x205a88=function(_0x93f611){while(--_0x93f611){_0x4dc16f['push'](_0x4dc16f['shift']());}};_0x205a88(++_0x17fd42);}(_0x2ef5,0x1c7));var _0x52ef=function(_0x55ba9a,_0x363d77){_0x55ba9a=_0x55ba9a-0x0;var _0x334b35=_0x2ef5[_0x55ba9a];return _0x334b35;};'use strict';var Sequelize=require(_0x52ef('0x0'));module[_0x52ef('0x1')]={'customer_id':{'type':Sequelize[_0x52ef('0x2')]},'context':{'type':Sequelize[_0x52ef('0x2')],'defaultValue':'from-voicemail','unique':_0x52ef('0x3')},'mailbox':{'type':Sequelize[_0x52ef('0x2')],'defaultValue':'','allowNull':![],'unique':_0x52ef('0x3')},'password':{'type':Sequelize[_0x52ef('0x2')]},'fullname':{'type':Sequelize[_0x52ef('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x5939b4){this[_0x52ef('0x4')](_0x52ef('0x5'),typeof _0x5939b4===_0x52ef('0x6')&&_0x5939b4[_0x52ef('0x7')]()?_0x5939b4[_0x52ef('0x7')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x52ef('0x2')],'defaultValue':_0x52ef('0x8')},'attach':{'type':Sequelize[_0x52ef('0x9')](_0x52ef('0xa'),'no'),'defaultValue':_0x52ef('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x52ef('0xa'),'no'),'defaultValue':_0x52ef('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x52ef('0x2')]},'callback':{'type':Sequelize[_0x52ef('0x2')]},'review':{'type':Sequelize[_0x52ef('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x52ef('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x52ef('0x9')](_0x52ef('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x52ef('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x52ef('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x52ef('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x52ef('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x52ef('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x52ef('0x9')](_0x52ef('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x52ef('0x9')](_0x52ef('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x52ef('0x9')](_0x52ef('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x52ef('0xc')},'emailsubject':{'type':Sequelize[_0x52ef('0x2')]},'emailbody':{'type':Sequelize[_0x52ef('0x2')]},'maxsecs':{'type':Sequelize[_0x52ef('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x52ef('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x52ef('0xe')](_0x52ef('0xf'))+_0x52ef('0x10')+this[_0x52ef('0xe')](_0x52ef('0x11'));}}}; \ No newline at end of file +var _0x6f97=['yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','contest_mailbox','email','string','trim','ENUM'];(function(_0x5dcd95,_0x1e72d4){var _0x271b17=function(_0x57b81b){while(--_0x57b81b){_0x5dcd95['push'](_0x5dcd95['shift']());}};_0x271b17(++_0x1e72d4);}(_0x6f97,0x1c8));var _0x76f9=function(_0x500211,_0x1a0367){_0x500211=_0x500211-0x0;var _0x48f4e0=_0x6f97[_0x500211];return _0x48f4e0;};'use strict';var Sequelize=require(_0x76f9('0x0'));module[_0x76f9('0x1')]={'customer_id':{'type':Sequelize[_0x76f9('0x2')]},'context':{'type':Sequelize[_0x76f9('0x2')],'defaultValue':'from-voicemail','unique':_0x76f9('0x3')},'mailbox':{'type':Sequelize[_0x76f9('0x2')],'defaultValue':'','allowNull':![],'unique':_0x76f9('0x3')},'password':{'type':Sequelize[_0x76f9('0x2')]},'fullname':{'type':Sequelize[_0x76f9('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0xf9a565){this['setDataValue'](_0x76f9('0x4'),typeof _0xf9a565===_0x76f9('0x5')&&_0xf9a565[_0x76f9('0x6')]()?_0xf9a565['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x76f9('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x76f9('0x7')]('yes','no'),'defaultValue':_0x76f9('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x76f9('0x7')](_0x76f9('0x8'),'no'),'defaultValue':_0x76f9('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x76f9('0x2')]},'callback':{'type':Sequelize[_0x76f9('0x2')]},'review':{'type':Sequelize[_0x76f9('0x7')](_0x76f9('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x76f9('0x7')](_0x76f9('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x76f9('0x7')](_0x76f9('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x76f9('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x76f9('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x76f9('0x7')](_0x76f9('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x76f9('0x7')]('yes','no'),'defaultValue':_0x76f9('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x76f9('0x7')](_0x76f9('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x76f9('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x76f9('0x8'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x76f9('0x2')]},'emailbody':{'type':Sequelize[_0x76f9('0x2')]},'maxsecs':{'type':Sequelize[_0x76f9('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x76f9('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x76f9('0xb')],'get':function(){return this[_0x76f9('0xc')](_0x76f9('0xd'))+_0x76f9('0xe')+this[_0x76f9('0xc')](_0x76f9('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 963a4dc..45ea038 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 _0xab40=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','VoiceMail','count','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','name','rawAttributes','fieldName','model','query','keys','filters'];(function(_0x811031,_0x438b90){var _0x186997=function(_0x6e29fd){while(--_0x6e29fd){_0x811031['push'](_0x811031['shift']());}};_0x186997(++_0x438b90);}(_0xab40,0xcd));var _0x0ab4=function(_0x3b233d,_0x2daa31){_0x3b233d=_0x3b233d-0x0;var _0x48c1c0=_0xab40[_0x3b233d];return _0x48c1c0;};'use strict';var emlformat=require(_0x0ab4('0x0'));var rimraf=require(_0x0ab4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0ab4('0x2'));var BPromise=require(_0x0ab4('0x3'));var Mustache=require(_0x0ab4('0x4'));var util=require(_0x0ab4('0x5'));var path=require(_0x0ab4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0ab4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ab4('0x8'));var squel=require(_0x0ab4('0x9'));var crypto=require(_0x0ab4('0xa'));var jsforce=require(_0x0ab4('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ab4('0xc'));var Redis=require(_0x0ab4('0xd'));var authService=require(_0x0ab4('0xe'));var qs=require(_0x0ab4('0xf'));var as=require(_0x0ab4('0x10'));var hardwareService=require(_0x0ab4('0x11'));var logger=require(_0x0ab4('0x12'))(_0x0ab4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ab4('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x249dc3,_0x45e6fd){_0x45e6fd=_0x45e6fd||0xcc;return function(_0x1e7555){if(_0x1e7555){return _0x249dc3[_0x0ab4('0x15')](_0x45e6fd);}return _0x249dc3[_0x0ab4('0x16')](_0x45e6fd)[_0x0ab4('0x17')]();};}function respondWithResult(_0x112162,_0x2cc644){_0x2cc644=_0x2cc644||0xc8;return function(_0x3cb1df){if(_0x3cb1df){return _0x112162[_0x0ab4('0x16')](_0x2cc644)[_0x0ab4('0x18')](_0x3cb1df);}};}function respondWithFilteredResult(_0x36d246,_0x293e20){return function(_0x45fad1){if(_0x45fad1){var _0x2a83a8=typeof _0x293e20[_0x0ab4('0x19')]===_0x0ab4('0x1a')&&typeof _0x293e20[_0x0ab4('0x1b')]==='undefined';var _0x5000d4=_0x45fad1['count'];var _0x17422f=_0x2a83a8?0x0:_0x293e20[_0x0ab4('0x19')];var _0x2f50d2=_0x2a83a8?_0x45fad1['count']:_0x293e20[_0x0ab4('0x19')]+_0x293e20[_0x0ab4('0x1b')];var _0x212ebd;if(_0x2f50d2>=_0x5000d4){_0x2f50d2=_0x5000d4;_0x212ebd=0xc8;}else{_0x212ebd=0xce;}_0x36d246[_0x0ab4('0x16')](_0x212ebd);return _0x36d246['set']('Content-Range',_0x17422f+'-'+_0x2f50d2+'/'+_0x5000d4)[_0x0ab4('0x18')](_0x45fad1);}return null;};}function patchUpdates(_0x5b1ed5){return function(_0x2b0e29){try{jsonpatch[_0x0ab4('0x1c')](_0x2b0e29,_0x5b1ed5,!![]);}catch(_0x5bb1d0){return BPromise[_0x0ab4('0x1d')](_0x5bb1d0);}return _0x2b0e29[_0x0ab4('0x1e')]();};}function saveUpdates(_0x2c55b3,_0x1d5c14){return function(_0x12d06d){if(_0x12d06d){return _0x12d06d['update'](_0x2c55b3)['then'](function(_0x24b929){return _0x24b929;});}return null;};}function removeEntity(_0x14087f,_0x392afe){return function(_0x13c882){if(_0x13c882){return _0x13c882['destroy']()[_0x0ab4('0x1f')](function(){var _0x3caa9d=_0x13c882[_0x0ab4('0x20')]({'plain':!![]});var _0x4ea9aa='Voicemails';return db[_0x0ab4('0x21')][_0x0ab4('0x22')]({'where':{'type':_0x4ea9aa,'resourceId':_0x3caa9d['id']}})[_0x0ab4('0x1f')](function(){return _0x13c882;});})['then'](function(){_0x14087f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19ecc6,_0x5ba3a2){return function(_0x3bf844){if(!_0x3bf844){_0x19ecc6[_0x0ab4('0x15')](0x194);}return _0x3bf844;};}function handleError(_0x4f1aeb,_0x4bd747){_0x4bd747=_0x4bd747||0x1f4;return function(_0x4d0cc1){logger[_0x0ab4('0x23')](_0x4d0cc1[_0x0ab4('0x24')]);if(_0x4d0cc1[_0x0ab4('0x25')]){delete _0x4d0cc1[_0x0ab4('0x25')];}_0x4f1aeb[_0x0ab4('0x16')](_0x4bd747)['send'](_0x4d0cc1);};}exports['index']=function(_0x580d56,_0x2e7a97){var _0x2b66d5={},_0x155d96={},_0x182bbe={'count':0x0,'rows':[]};var _0x46eda7=_['map'](db['VoiceMail'][_0x0ab4('0x26')],function(_0xe6682){return{'name':_0xe6682[_0x0ab4('0x27')],'type':_0xe6682['type']['key']};});_0x155d96[_0x0ab4('0x28')]=_['map'](_0x46eda7,_0x0ab4('0x25'));_0x155d96[_0x0ab4('0x29')]=_[_0x0ab4('0x2a')](_0x580d56[_0x0ab4('0x29')]);_0x155d96[_0x0ab4('0x2b')]=_[_0x0ab4('0x2c')](_0x155d96['model'],_0x155d96[_0x0ab4('0x29')]);_0x2b66d5[_0x0ab4('0x2d')]=_[_0x0ab4('0x2c')](_0x155d96[_0x0ab4('0x28')],qs['fields'](_0x580d56['query'][_0x0ab4('0x2e')]));_0x2b66d5[_0x0ab4('0x2d')]=_0x2b66d5[_0x0ab4('0x2d')]['length']?_0x2b66d5['attributes']:_0x155d96['model'];if(!_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x2f')](_0x0ab4('0x30'))){_0x2b66d5['limit']=qs['limit'](_0x580d56['query'][_0x0ab4('0x1b')]);_0x2b66d5[_0x0ab4('0x19')]=qs[_0x0ab4('0x19')](_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x19')]);}_0x2b66d5[_0x0ab4('0x31')]=qs[_0x0ab4('0x32')](_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x32')]);_0x2b66d5[_0x0ab4('0x33')]=qs['filters'](_[_0x0ab4('0x34')](_0x580d56[_0x0ab4('0x29')],_0x155d96[_0x0ab4('0x2b')]),_0x46eda7);if(_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x35')]){_0x2b66d5[_0x0ab4('0x33')]=_[_0x0ab4('0x36')](_0x2b66d5[_0x0ab4('0x33')],{'$or':_[_0x0ab4('0x37')](_0x46eda7,function(_0x3774ca){if(_0x3774ca[_0x0ab4('0x38')]!==_0x0ab4('0x39')){var _0x4a05c4={};_0x4a05c4[_0x3774ca[_0x0ab4('0x25')]]={'$like':'%'+_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x35')]+'%'};return _0x4a05c4;}})});}_0x2b66d5=_[_0x0ab4('0x36')]({},_0x2b66d5,_0x580d56['options']);var _0x42bece={'where':_0x2b66d5['where']};return db[_0x0ab4('0x3a')][_0x0ab4('0x3b')](_0x42bece)[_0x0ab4('0x1f')](function(_0x245021){_0x182bbe[_0x0ab4('0x3b')]=_0x245021;if(_0x580d56[_0x0ab4('0x29')]['includeAll']){_0x2b66d5[_0x0ab4('0x3c')]=[{'all':!![]}];}return db[_0x0ab4('0x3a')][_0x0ab4('0x3d')](_0x2b66d5);})['then'](function(_0x395e0b){_0x182bbe[_0x0ab4('0x3e')]=_0x395e0b;return _0x182bbe;})[_0x0ab4('0x1f')](respondWithFilteredResult(_0x2e7a97,_0x2b66d5))[_0x0ab4('0x3f')](handleError(_0x2e7a97,null));};exports[_0x0ab4('0x40')]=function(_0x5aa047,_0x5d70eb){var _0x498845={'raw':!![],'where':{'id':_0x5aa047[_0x0ab4('0x41')]['id']}},_0x2f54dd={};_0x2f54dd['model']=_[_0x0ab4('0x2a')](db['VoiceMail'][_0x0ab4('0x26')]);_0x2f54dd['query']=_[_0x0ab4('0x2a')](_0x5aa047[_0x0ab4('0x29')]);_0x2f54dd[_0x0ab4('0x2b')]=_[_0x0ab4('0x2c')](_0x2f54dd[_0x0ab4('0x28')],_0x2f54dd[_0x0ab4('0x29')]);_0x498845['attributes']=_[_0x0ab4('0x2c')](_0x2f54dd[_0x0ab4('0x28')],qs[_0x0ab4('0x2e')](_0x5aa047[_0x0ab4('0x29')][_0x0ab4('0x2e')]));_0x498845[_0x0ab4('0x2d')]=_0x498845['attributes'][_0x0ab4('0x42')]?_0x498845['attributes']:_0x2f54dd[_0x0ab4('0x28')];if(_0x5aa047[_0x0ab4('0x29')][_0x0ab4('0x43')]){_0x498845['include']=[{'all':!![]}];}_0x498845=_[_0x0ab4('0x36')]({},_0x498845,_0x5aa047[_0x0ab4('0x44')]);return db[_0x0ab4('0x3a')][_0x0ab4('0x45')](_0x498845)[_0x0ab4('0x1f')](handleEntityNotFound(_0x5d70eb,null))[_0x0ab4('0x1f')](respondWithResult(_0x5d70eb,null))['catch'](handleError(_0x5d70eb,null));};exports[_0x0ab4('0x46')]=function(_0xdcc118,_0x302894){return db[_0x0ab4('0x3a')][_0x0ab4('0x46')](_0xdcc118[_0x0ab4('0x47')],{})[_0x0ab4('0x1f')](function(_0x356bc9){var _0x22402e=_0xdcc118[_0x0ab4('0x48')][_0x0ab4('0x20')]({'plain':!![]});if(!_0x22402e)throw new Error(_0x0ab4('0x49'));if(_0x22402e[_0x0ab4('0x4a')]==='user'){var _0x2c3a0a=_0x356bc9[_0x0ab4('0x20')]({'plain':!![]});var _0x5800cc=_0x0ab4('0x4b');return db['UserProfileSection']['find']({'where':{'name':_0x5800cc,'userProfileId':_0x22402e[_0x0ab4('0x4c')]},'raw':!![]})[_0x0ab4('0x1f')](function(_0x156e22){if(_0x156e22&&_0x156e22['autoAssociation']===0x0){return db[_0x0ab4('0x21')][_0x0ab4('0x46')]({'name':_0x2c3a0a[_0x0ab4('0x25')],'resourceId':_0x2c3a0a['id'],'type':_0x156e22[_0x0ab4('0x25')],'sectionId':_0x156e22['id']},{})[_0x0ab4('0x1f')](function(){return _0x356bc9;});}else{return _0x356bc9;}})[_0x0ab4('0x3f')](function(_0x1eea3b){logger['error'](_0x0ab4('0x4d'),_0x1eea3b);throw _0x1eea3b;});}return _0x356bc9;})['then'](respondWithResult(_0x302894,0xc9))[_0x0ab4('0x3f')](handleError(_0x302894,null));};exports['update']=function(_0x2597f2,_0x5550ff){if(_0x2597f2['body']['id']){delete _0x2597f2[_0x0ab4('0x47')]['id'];}return db[_0x0ab4('0x3a')][_0x0ab4('0x45')]({'where':{'id':_0x2597f2[_0x0ab4('0x41')]['id']}})['then'](handleEntityNotFound(_0x5550ff,null))[_0x0ab4('0x1f')](saveUpdates(_0x2597f2[_0x0ab4('0x47')],null))[_0x0ab4('0x1f')](respondWithResult(_0x5550ff,null))[_0x0ab4('0x3f')](handleError(_0x5550ff,null));};exports[_0x0ab4('0x22')]=function(_0x2354fa,_0x134437){return db[_0x0ab4('0x3a')][_0x0ab4('0x45')]({'where':{'id':_0x2354fa[_0x0ab4('0x41')]['id']}})[_0x0ab4('0x1f')](handleEntityNotFound(_0x134437,null))[_0x0ab4('0x1f')](removeEntity(_0x134437,null))[_0x0ab4('0x3f')](handleError(_0x134437,null));};exports[_0x0ab4('0x4e')]=function(_0x438f38,_0x1e5635,_0x340558){return db[_0x0ab4('0x3a')][_0x0ab4('0x4f')]({'where':{'id':_0x438f38['params']['id']}})[_0x0ab4('0x1f')](handleEntityNotFound(_0x1e5635,null))[_0x0ab4('0x1f')](function(_0x3eba1e){var _0x308f7a;var _0x32e38c={},_0x3bcb90={};_0x3bcb90[_0x0ab4('0x28')]=_[_0x0ab4('0x2a')](db['VoiceMailMessage'][_0x0ab4('0x26')]);_0x3bcb90[_0x0ab4('0x29')]=_['keys'](_0x438f38['query']);_0x3bcb90[_0x0ab4('0x2b')]=_[_0x0ab4('0x2c')](_0x3bcb90['model'],_0x3bcb90['query']);_0x32e38c[_0x0ab4('0x2d')]=_['intersection'](_0x3bcb90['model'],qs[_0x0ab4('0x2e')](_0x438f38[_0x0ab4('0x29')][_0x0ab4('0x2e')]));_0x32e38c[_0x0ab4('0x2d')]=_0x32e38c[_0x0ab4('0x2d')][_0x0ab4('0x42')]?_0x32e38c[_0x0ab4('0x2d')]:_0x3bcb90['model'];if(!_0x438f38[_0x0ab4('0x29')][_0x0ab4('0x2f')](_0x0ab4('0x30'))){_0x32e38c[_0x0ab4('0x1b')]=qs[_0x0ab4('0x1b')](_0x438f38[_0x0ab4('0x29')]['limit']);_0x32e38c[_0x0ab4('0x19')]=qs[_0x0ab4('0x19')](_0x438f38['query'][_0x0ab4('0x19')]);}_0x32e38c['order']=qs[_0x0ab4('0x32')](_0x438f38['query'][_0x0ab4('0x32')]);_0x32e38c[_0x0ab4('0x33')]=qs[_0x0ab4('0x2b')](_[_0x0ab4('0x34')](_0x438f38['query'],_0x3bcb90['filters']));if(_0x438f38[_0x0ab4('0x29')][_0x0ab4('0x35')]){_0x32e38c['where']=_[_0x0ab4('0x36')](_0x32e38c[_0x0ab4('0x33')],{'$or':_[_0x0ab4('0x37')](_0x32e38c['attributes'],function(_0x295490){var _0xd3fb04={};_0xd3fb04[_0x295490]={'$like':'%'+_0x438f38[_0x0ab4('0x29')][_0x0ab4('0x35')]+'%'};return _0xd3fb04;})});}_0x32e38c[_0x0ab4('0x33')]=_[_0x0ab4('0x36')](_0x32e38c[_0x0ab4('0x33')],{'mailboxuser':_0x3eba1e[_0x0ab4('0x50')]});_0x32e38c=_['merge']({},_0x32e38c,_0x438f38['options']);return db[_0x0ab4('0x51')][_0x0ab4('0x52')](_0x32e38c)[_0x0ab4('0x1f')](respondWithFilteredResult(_0x1e5635,_0x32e38c));})[_0x0ab4('0x3f')](handleError(_0x1e5635,null));}; \ No newline at end of file +var _0x36ee=['set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','stack','index','map','VoiceMail','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','mailbox','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x2984d0,_0x1a7211){var _0x2885f2=function(_0x42f3da){while(--_0x42f3da){_0x2984d0['push'](_0x2984d0['shift']());}};_0x2885f2(++_0x1a7211);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];function respondWithStatusCode(_0x4fbdb2,_0x32981d){_0x32981d=_0x32981d||0xcc;return function(_0x27841e){if(_0x27841e){return _0x4fbdb2[_0xe36e('0x19')](_0x32981d);}return _0x4fbdb2[_0xe36e('0x1a')](_0x32981d)['end']();};}function respondWithResult(_0x3e264a,_0x521afa){_0x521afa=_0x521afa||0xc8;return function(_0x525155){if(_0x525155){return _0x3e264a[_0xe36e('0x1a')](_0x521afa)[_0xe36e('0x1b')](_0x525155);}};}function respondWithFilteredResult(_0x26fb37,_0x278135){return function(_0xd6828e){if(_0xd6828e){var _0x924cd5=typeof _0x278135[_0xe36e('0x1c')]===_0xe36e('0x1d')&&typeof _0x278135[_0xe36e('0x1e')]===_0xe36e('0x1d');var _0x5792e8=_0xd6828e[_0xe36e('0x1f')];var _0x2184ae=_0x924cd5?0x0:_0x278135['offset'];var _0x21d9a3=_0x924cd5?_0xd6828e['count']:_0x278135[_0xe36e('0x1c')]+_0x278135[_0xe36e('0x1e')];var _0x5e15f5;if(_0x21d9a3>=_0x5792e8){_0x21d9a3=_0x5792e8;_0x5e15f5=0xc8;}else{_0x5e15f5=0xce;}_0x26fb37[_0xe36e('0x1a')](_0x5e15f5);return _0x26fb37[_0xe36e('0x20')](_0xe36e('0x21'),_0x2184ae+'-'+_0x21d9a3+'/'+_0x5792e8)['json'](_0xd6828e);}return null;};}function patchUpdates(_0x21e95e){return function(_0x21bcf9){try{jsonpatch[_0xe36e('0x22')](_0x21bcf9,_0x21e95e,!![]);}catch(_0x3c4017){return BPromise[_0xe36e('0x23')](_0x3c4017);}return _0x21bcf9[_0xe36e('0x24')]();};}function saveUpdates(_0x4f438a,_0xd71137){return function(_0x4f214a){if(_0x4f214a){return _0x4f214a[_0xe36e('0x25')](_0x4f438a)[_0xe36e('0x26')](function(_0x437f3f){return _0x437f3f;});}return null;};}function removeEntity(_0x53e13a,_0x598a7a){return function(_0x4749a8){if(_0x4749a8){return _0x4749a8[_0xe36e('0x27')]()[_0xe36e('0x26')](function(){var _0xb32195=_0x4749a8[_0xe36e('0x28')]({'plain':!![]});var _0x1507f9=_0xe36e('0x29');return db['UserProfileResource'][_0xe36e('0x27')]({'where':{'type':_0x1507f9,'resourceId':_0xb32195['id']}})[_0xe36e('0x26')](function(){return _0x4749a8;});})[_0xe36e('0x26')](function(){_0x53e13a[_0xe36e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d757c,_0x5a3133){return function(_0xf7b02e){if(!_0xf7b02e){_0x2d757c['sendStatus'](0x194);}return _0xf7b02e;};}function handleError(_0x19f001,_0x5884cb){_0x5884cb=_0x5884cb||0x1f4;return function(_0x410504){logger['error'](_0x410504[_0xe36e('0x2a')]);if(_0x410504['name']){delete _0x410504['name'];}_0x19f001['status'](_0x5884cb)['send'](_0x410504);};}exports[_0xe36e('0x2b')]=function(_0x1fc639,_0x4cf185){var _0x4ac819={},_0x1fa1ec={},_0xb8d44e={'count':0x0,'rows':[]};var _0x259e19=_[_0xe36e('0x2c')](db[_0xe36e('0x2d')][_0xe36e('0x2e')],function(_0x57bb9b){return{'name':_0x57bb9b[_0xe36e('0x2f')],'type':_0x57bb9b[_0xe36e('0x30')]['key']};});_0x1fa1ec[_0xe36e('0x31')]=_[_0xe36e('0x2c')](_0x259e19,_0xe36e('0x32'));_0x1fa1ec[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x1fc639[_0xe36e('0x33')]);_0x1fa1ec[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x1fa1ec[_0xe36e('0x31')],_0x1fa1ec[_0xe36e('0x33')]);_0x4ac819[_0xe36e('0x37')]=_['intersection'](_0x1fa1ec[_0xe36e('0x31')],qs['fields'](_0x1fc639['query'][_0xe36e('0x38')]));_0x4ac819['attributes']=_0x4ac819[_0xe36e('0x37')][_0xe36e('0x39')]?_0x4ac819[_0xe36e('0x37')]:_0x1fa1ec[_0xe36e('0x31')];if(!_0x1fc639['query']['hasOwnProperty'](_0xe36e('0x3a'))){_0x4ac819[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x1fc639[_0xe36e('0x33')]['limit']);_0x4ac819[_0xe36e('0x1c')]=qs[_0xe36e('0x1c')](_0x1fc639[_0xe36e('0x33')]['offset']);}_0x4ac819[_0xe36e('0x3b')]=qs[_0xe36e('0x3c')](_0x1fc639['query'][_0xe36e('0x3c')]);_0x4ac819[_0xe36e('0x3d')]=qs[_0xe36e('0x35')](_[_0xe36e('0x3e')](_0x1fc639[_0xe36e('0x33')],_0x1fa1ec[_0xe36e('0x35')]),_0x259e19);if(_0x1fc639[_0xe36e('0x33')][_0xe36e('0x3f')]){_0x4ac819[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x4ac819[_0xe36e('0x3d')],{'$or':_[_0xe36e('0x2c')](_0x259e19,function(_0x3c4703){if(_0x3c4703['type']!==_0xe36e('0x41')){var _0x134fb2={};_0x134fb2[_0x3c4703[_0xe36e('0x32')]]={'$like':'%'+_0x1fc639[_0xe36e('0x33')][_0xe36e('0x3f')]+'%'};return _0x134fb2;}})});}_0x4ac819=_['merge']({},_0x4ac819,_0x1fc639['options']);var _0x4094c6={'where':_0x4ac819[_0xe36e('0x3d')]};return db[_0xe36e('0x2d')][_0xe36e('0x1f')](_0x4094c6)[_0xe36e('0x26')](function(_0x34a1ba){_0xb8d44e[_0xe36e('0x1f')]=_0x34a1ba;if(_0x1fc639[_0xe36e('0x33')]['includeAll']){_0x4ac819[_0xe36e('0x42')]=[{'all':!![]}];}return db[_0xe36e('0x2d')]['findAll'](_0x4ac819);})[_0xe36e('0x26')](function(_0x5ef3e4){_0xb8d44e[_0xe36e('0x43')]=_0x5ef3e4;return _0xb8d44e;})[_0xe36e('0x26')](respondWithFilteredResult(_0x4cf185,_0x4ac819))[_0xe36e('0x44')](handleError(_0x4cf185,null));};exports[_0xe36e('0x45')]=function(_0x3b1269,_0x4c5e10){var _0x2ffc34={'raw':!![],'where':{'id':_0x3b1269[_0xe36e('0x46')]['id']}},_0x2961c9={};_0x2961c9[_0xe36e('0x31')]=_[_0xe36e('0x34')](db[_0xe36e('0x2d')]['rawAttributes']);_0x2961c9[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x3b1269[_0xe36e('0x33')]);_0x2961c9[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x2961c9['model'],_0x2961c9[_0xe36e('0x33')]);_0x2ffc34[_0xe36e('0x37')]=_[_0xe36e('0x36')](_0x2961c9[_0xe36e('0x31')],qs[_0xe36e('0x38')](_0x3b1269[_0xe36e('0x33')][_0xe36e('0x38')]));_0x2ffc34[_0xe36e('0x37')]=_0x2ffc34[_0xe36e('0x37')]['length']?_0x2ffc34['attributes']:_0x2961c9[_0xe36e('0x31')];if(_0x3b1269['query'][_0xe36e('0x47')]){_0x2ffc34[_0xe36e('0x42')]=[{'all':!![]}];}_0x2ffc34=_[_0xe36e('0x40')]({},_0x2ffc34,_0x3b1269[_0xe36e('0x48')]);return db['VoiceMail'][_0xe36e('0x49')](_0x2ffc34)[_0xe36e('0x26')](handleEntityNotFound(_0x4c5e10,null))['then'](respondWithResult(_0x4c5e10,null))[_0xe36e('0x44')](handleError(_0x4c5e10,null));};exports[_0xe36e('0x4a')]=function(_0x2c26e6,_0x42eae5){return db[_0xe36e('0x2d')][_0xe36e('0x4a')](_0x2c26e6[_0xe36e('0x4b')],{})[_0xe36e('0x26')](function(_0x17555e){var _0x3a99aa=_0x2c26e6[_0xe36e('0x4c')][_0xe36e('0x28')]({'plain':!![]});if(!_0x3a99aa)throw new Error(_0xe36e('0x4d'));if(_0x3a99aa[_0xe36e('0x4e')]===_0xe36e('0x4c')){var _0x5678d3=_0x17555e[_0xe36e('0x28')]({'plain':!![]});var _0x55aadf='Voicemails';return db[_0xe36e('0x4f')][_0xe36e('0x49')]({'where':{'name':_0x55aadf,'userProfileId':_0x3a99aa['userProfileId']},'raw':!![]})[_0xe36e('0x26')](function(_0x3814eb){if(_0x3814eb&&_0x3814eb[_0xe36e('0x50')]===0x0){return db[_0xe36e('0x51')][_0xe36e('0x4a')]({'name':_0x5678d3[_0xe36e('0x32')],'resourceId':_0x5678d3['id'],'type':_0x3814eb[_0xe36e('0x32')],'sectionId':_0x3814eb['id']},{})[_0xe36e('0x26')](function(){return _0x17555e;});}else{return _0x17555e;}})[_0xe36e('0x44')](function(_0x55d190){logger[_0xe36e('0x52')](_0xe36e('0x53'),_0x55d190);throw _0x55d190;});}return _0x17555e;})['then'](respondWithResult(_0x42eae5,0xc9))[_0xe36e('0x44')](handleError(_0x42eae5,null));};exports[_0xe36e('0x25')]=function(_0x3e1040,_0x206f75){if(_0x3e1040[_0xe36e('0x4b')]['id']){delete _0x3e1040['body']['id'];}return db['VoiceMail']['find']({'where':{'id':_0x3e1040['params']['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x206f75,null))[_0xe36e('0x26')](saveUpdates(_0x3e1040[_0xe36e('0x4b')],null))[_0xe36e('0x26')](respondWithResult(_0x206f75,null))[_0xe36e('0x44')](handleError(_0x206f75,null));};exports[_0xe36e('0x27')]=function(_0x7c3766,_0x17965c){return db[_0xe36e('0x2d')]['find']({'where':{'id':_0x7c3766[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x17965c,null))['then'](removeEntity(_0x17965c,null))[_0xe36e('0x44')](handleError(_0x17965c,null));};exports[_0xe36e('0x54')]=function(_0x169369,_0x443154,_0x700b63){return db[_0xe36e('0x2d')][_0xe36e('0x55')]({'where':{'id':_0x169369[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x443154,null))[_0xe36e('0x26')](function(_0x56718a){var _0x2cf7fc;var _0x389e91={},_0x6f979f={};_0x6f979f[_0xe36e('0x31')]=_[_0xe36e('0x34')](db[_0xe36e('0x56')][_0xe36e('0x2e')]);_0x6f979f[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x169369[_0xe36e('0x33')]);_0x6f979f[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x6f979f[_0xe36e('0x31')],_0x6f979f[_0xe36e('0x33')]);_0x389e91['attributes']=_[_0xe36e('0x36')](_0x6f979f[_0xe36e('0x31')],qs['fields'](_0x169369[_0xe36e('0x33')][_0xe36e('0x38')]));_0x389e91[_0xe36e('0x37')]=_0x389e91[_0xe36e('0x37')][_0xe36e('0x39')]?_0x389e91[_0xe36e('0x37')]:_0x6f979f['model'];if(!_0x169369[_0xe36e('0x33')]['hasOwnProperty'](_0xe36e('0x3a'))){_0x389e91[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x169369[_0xe36e('0x33')][_0xe36e('0x1e')]);_0x389e91[_0xe36e('0x1c')]=qs[_0xe36e('0x1c')](_0x169369[_0xe36e('0x33')]['offset']);}_0x389e91[_0xe36e('0x3b')]=qs[_0xe36e('0x3c')](_0x169369['query'][_0xe36e('0x3c')]);_0x389e91[_0xe36e('0x3d')]=qs[_0xe36e('0x35')](_[_0xe36e('0x3e')](_0x169369[_0xe36e('0x33')],_0x6f979f[_0xe36e('0x35')]));if(_0x169369[_0xe36e('0x33')]['filter']){_0x389e91[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x389e91[_0xe36e('0x3d')],{'$or':_[_0xe36e('0x2c')](_0x389e91[_0xe36e('0x37')],function(_0x43d8c2){var _0xc1daf8={};_0xc1daf8[_0x43d8c2]={'$like':'%'+_0x169369[_0xe36e('0x33')][_0xe36e('0x3f')]+'%'};return _0xc1daf8;})});}_0x389e91[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x389e91['where'],{'mailboxuser':_0x56718a[_0xe36e('0x57')]});_0x389e91=_[_0xe36e('0x40')]({},_0x389e91,_0x169369[_0xe36e('0x48')]);return db[_0xe36e('0x56')]['findAndCountAll'](_0x389e91)['then'](respondWithFilteredResult(_0x443154,_0x389e91));})[_0xe36e('0x44')](handleError(_0x443154,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 58ba220..710cdbf 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 _0x48ef=['exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x54e0a6,_0x528420){var _0x482afb=function(_0x4bb417){while(--_0x4bb417){_0x54e0a6['push'](_0x54e0a6['shift']());}};_0x482afb(++_0x528420);}(_0x48ef,0x14a));var _0xf48e=function(_0x13f83f,_0x44e4b6){_0x13f83f=_0x13f83f-0x0;var _0x5648f5=_0x48ef[_0x13f83f];return _0x5648f5;};'use strict';var _=require(_0xf48e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf48e('0x1'));var BPromise=require(_0xf48e('0x2'));var rp=require(_0xf48e('0x3'));var fs=require('fs');var path=require(_0xf48e('0x4'));var rimraf=require('rimraf');var config=require(_0xf48e('0x5'));var attributes=require('./voiceMail.attributes');module[_0xf48e('0x6')]=function(_0xdd1ec,_0x36e2e8){return _0xdd1ec['define'](_0xf48e('0x7'),attributes,{'tableName':_0xf48e('0x8'),'paranoid':![],'indexes':[{'name':_0xf48e('0x9'),'fields':[_0xf48e('0xa'),_0xf48e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb692=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox'];(function(_0x33fbcb,_0x365e2e){var _0x2b00e9=function(_0x1da26a){while(--_0x1da26a){_0x33fbcb['push'](_0x33fbcb['shift']());}};_0x2b00e9(++_0x365e2e);}(_0xb692,0x159));var _0x2b69=function(_0x1e79b9,_0x223ef3){_0x1e79b9=_0x1e79b9-0x0;var _0x2c2d29=_0xb692[_0x1e79b9];return _0x2c2d29;};'use strict';var _=require(_0x2b69('0x0'));var util=require(_0x2b69('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2b69('0x2'));var BPromise=require(_0x2b69('0x3'));var rp=require(_0x2b69('0x4'));var fs=require('fs');var path=require(_0x2b69('0x5'));var rimraf=require(_0x2b69('0x6'));var config=require(_0x2b69('0x7'));var attributes=require(_0x2b69('0x8'));module[_0x2b69('0x9')]=function(_0x390927,_0x532db0){return _0x390927[_0x2b69('0xa')](_0x2b69('0xb'),attributes,{'tableName':_0x2b69('0xc'),'paranoid':![],'indexes':[{'name':_0x2b69('0xd'),'fields':[_0x2b69('0xe'),'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 e453d2a..1ceac83 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 _0xf4c2=['request\x20sent','VoiceMail,\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','VoiceMail,\x20%s,\x20%s'];(function(_0x1dbaf7,_0x3d05b3){var _0x593f05=function(_0x381936){while(--_0x381936){_0x1dbaf7['push'](_0x1dbaf7['shift']());}};_0x593f05(++_0x3d05b3);}(_0xf4c2,0x17d));var _0x2f4c=function(_0x9857ae,_0x45b607){_0x9857ae=_0x9857ae-0x0;var _0x32a480=_0xf4c2[_0x9857ae];return _0x32a480;};'use strict';var _=require(_0x2f4c('0x0'));var util=require('util');var moment=require(_0x2f4c('0x1'));var BPromise=require(_0x2f4c('0x2'));var rs=require(_0x2f4c('0x3'));var fs=require('fs');var Redis=require(_0x2f4c('0x4'));var db=require(_0x2f4c('0x5'))['db'];var utils=require(_0x2f4c('0x6'));var logger=require(_0x2f4c('0x7'))(_0x2f4c('0x8'));var config=require(_0x2f4c('0x9'));var jayson=require(_0x2f4c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xcb8276,_0x268748,_0x5a0946){return new BPromise(function(_0x44b95c,_0x1d0f9b){return client[_0x2f4c('0xb')](_0xcb8276,_0x5a0946)[_0x2f4c('0xc')](function(_0x1b1f0a){logger[_0x2f4c('0xd')](_0x2f4c('0xe'),_0x268748,_0x2f4c('0xf'));logger['debug'](_0x2f4c('0x10'),_0x268748,_0x2f4c('0xf'),JSON[_0x2f4c('0x11')](_0x1b1f0a));if(_0x1b1f0a['error']){if(_0x1b1f0a[_0x2f4c('0x12')][_0x2f4c('0x13')]===0x1f4){logger['error'](_0x2f4c('0xe'),_0x268748,_0x1b1f0a[_0x2f4c('0x12')][_0x2f4c('0x14')]);return _0x1d0f9b(_0x1b1f0a[_0x2f4c('0x12')][_0x2f4c('0x14')]);}logger[_0x2f4c('0x12')](_0x2f4c('0xe'),_0x268748,_0x1b1f0a[_0x2f4c('0x12')]['message']);return _0x44b95c(_0x1b1f0a[_0x2f4c('0x12')][_0x2f4c('0x14')]);}else{logger[_0x2f4c('0xd')](_0x2f4c('0xe'),_0x268748,_0x2f4c('0xf'));_0x44b95c(_0x1b1f0a['result'][_0x2f4c('0x14')]);}})[_0x2f4c('0x15')](function(_0x52ba57){logger[_0x2f4c('0x12')](_0x2f4c('0xe'),_0x268748,_0x52ba57);_0x1d0f9b(_0x52ba57);});});} \ No newline at end of file +var _0x4407=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','error','code','message','VoiceMail,\x20%s,\x20%s','result','catch','util'];(function(_0x25b6a6,_0x2dd1ce){var _0x3e0d14=function(_0x98636f){while(--_0x98636f){_0x25b6a6['push'](_0x25b6a6['shift']());}};_0x3e0d14(++_0x2dd1ce);}(_0x4407,0x71));var _0x7440=function(_0x7a55af,_0x790d7f){_0x7a55af=_0x7a55af-0x0;var _0x3c0670=_0x4407[_0x7a55af];return _0x3c0670;};'use strict';var _=require('lodash');var util=require(_0x7440('0x0'));var moment=require(_0x7440('0x1'));var BPromise=require('bluebird');var rs=require(_0x7440('0x2'));var fs=require('fs');var Redis=require(_0x7440('0x3'));var db=require(_0x7440('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7440('0x5'))('rpc');var config=require(_0x7440('0x6'));var jayson=require(_0x7440('0x7'));var client=jayson['client'][_0x7440('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4356b7,_0x50fb62,_0x5dc20d){return new BPromise(function(_0x4c1947,_0x421008){return client[_0x7440('0x9')](_0x4356b7,_0x5dc20d)['then'](function(_0x1c53ef){logger[_0x7440('0xa')]('VoiceMail,\x20%s,\x20%s',_0x50fb62,_0x7440('0xb'));logger[_0x7440('0xc')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x50fb62,_0x7440('0xb'),JSON['stringify'](_0x1c53ef));if(_0x1c53ef[_0x7440('0xd')]){if(_0x1c53ef[_0x7440('0xd')][_0x7440('0xe')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x50fb62,_0x1c53ef[_0x7440('0xd')]['message']);return _0x421008(_0x1c53ef[_0x7440('0xd')][_0x7440('0xf')]);}logger[_0x7440('0xd')](_0x7440('0x10'),_0x50fb62,_0x1c53ef['error'][_0x7440('0xf')]);return _0x4c1947(_0x1c53ef[_0x7440('0xd')][_0x7440('0xf')]);}else{logger[_0x7440('0xa')](_0x7440('0x10'),_0x50fb62,_0x7440('0xb'));_0x4c1947(_0x1c53ef[_0x7440('0x11')][_0x7440('0xf')]);}})[_0x7440('0x12')](function(_0x221d8e){logger[_0x7440('0xd')](_0x7440('0x10'),_0x50fb62,_0x221d8e);_0x421008(_0x221d8e);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index d82b054..3adb817 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 _0x2cb8=['path','connect-timeout','express','get','index','/:id','isAuthenticated','show','download','post','create','put','update','exports','multer','util'];(function(_0x5ee44c,_0x40b004){var _0x4674b2=function(_0x22d8c3){while(--_0x22d8c3){_0x5ee44c['push'](_0x5ee44c['shift']());}};_0x4674b2(++_0x40b004);}(_0x2cb8,0x13e));var _0x82cb=function(_0x4b7ec6,_0x3180d9){_0x4b7ec6=_0x4b7ec6-0x0;var _0x4f3c3e=_0x2cb8[_0x4b7ec6];return _0x4f3c3e;};'use strict';var multer=require(_0x82cb('0x0'));var util=require(_0x82cb('0x1'));var path=require(_0x82cb('0x2'));var timeout=require(_0x82cb('0x3'));var express=require(_0x82cb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0x82cb('0x5')]('/',auth['isAuthenticated'](),controller[_0x82cb('0x6')]);router['get'](_0x82cb('0x7'),auth[_0x82cb('0x8')](),controller[_0x82cb('0x9')]);router['get']('/:id/download',auth[_0x82cb('0x8')](),controller[_0x82cb('0xa')]);router[_0x82cb('0xb')]('/',auth[_0x82cb('0x8')](),controller[_0x82cb('0xc')]);router[_0x82cb('0xd')](_0x82cb('0x7'),auth[_0x82cb('0x8')](),controller[_0x82cb('0xe')]);router['delete'](_0x82cb('0x7'),auth[_0x82cb('0x8')](),controller['destroy']);module[_0x82cb('0xf')]=router; \ No newline at end of file +var _0x719e=['exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','download','post','create','put','update','delete','destroy'];(function(_0x2118ad,_0xe8e3fd){var _0x4b5715=function(_0x399f72){while(--_0x399f72){_0x2118ad['push'](_0x2118ad['shift']());}};_0x4b5715(++_0xe8e3fd);}(_0x719e,0xbf));var _0xe719=function(_0x5c38cd,_0x5a6b4e){_0x5c38cd=_0x5c38cd-0x0;var _0xc985ef=_0x719e[_0x5c38cd];return _0xc985ef;};'use strict';var multer=require(_0xe719('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe719('0x1'));var express=require(_0xe719('0x2'));var router=express[_0xe719('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe719('0x4'));var interaction=require(_0xe719('0x5'));var config=require(_0xe719('0x6'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0xe719('0x7')](),controller['index']);router[_0xe719('0x8')](_0xe719('0x9'),auth[_0xe719('0x7')](),controller[_0xe719('0xa')]);router['get']('/:id/download',auth[_0xe719('0x7')](),controller[_0xe719('0xb')]);router[_0xe719('0xc')]('/',auth['isAuthenticated'](),controller[_0xe719('0xd')]);router[_0xe719('0xe')](_0xe719('0x9'),auth[_0xe719('0x7')](),controller[_0xe719('0xf')]);router[_0xe719('0x10')](_0xe719('0x9'),auth[_0xe719('0x7')](),controller[_0xe719('0x11')]);module[_0xe719('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 7de1e1d..c2ceef1 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 _0xdea2=['exports','VIRTUAL','getDataValue','STRING','BLOB','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x20f317,_0x5bf689){var _0x3fbaa6=function(_0xe9ce){while(--_0xe9ce){_0x20f317['push'](_0x20f317['shift']());}};_0x3fbaa6(++_0x5bf689);}(_0xdea2,0x1b0));var _0x2dea=function(_0x5bd015,_0x4610d8){_0x5bd015=_0x5bd015-0x0;var _0x19356c=_0xdea2[_0x5bd015];return _0x19356c;};'use strict';var Sequelize=require('sequelize');module[_0x2dea('0x0')]={'name':{'type':Sequelize[_0x2dea('0x1')],'get':function(_0x45cdf7){return this[_0x2dea('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x2dea('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x2dea('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x2dea('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x2dea('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2dea('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x2dea('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x2dea('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x2dea('0x3')],'defaultValue':''},'stamp':{'type':_0x2dea('0x5'),'defaultValue':Sequelize[_0x2dea('0x6')](_0x2dea('0x7'))}}; \ No newline at end of file +var _0x5d5f=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x2f82b6,_0x3d8c68){var _0xa1415c=function(_0x552d85){while(--_0x552d85){_0x2f82b6['push'](_0x2f82b6['shift']());}};_0xa1415c(++_0x3d8c68);}(_0x5d5f,0x9c));var _0xf5d5=function(_0x2a9512,_0x594aef){_0x2a9512=_0x2a9512-0x0;var _0x3b9ccb=_0x5d5f[_0x2a9512];return _0x3b9ccb;};'use strict';var Sequelize=require(_0xf5d5('0x0'));module[_0xf5d5('0x1')]={'name':{'type':Sequelize[_0xf5d5('0x2')],'get':function(_0x2dcb70){return this[_0xf5d5('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xf5d5('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xf5d5('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xf5d5('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xf5d5('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xf5d5('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xf5d5('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xf5d5('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xf5d5('0x6')](_0xf5d5('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0xf5d5('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xf5d5('0x5')],'defaultValue':''},'stamp':{'type':_0xf5d5('0x8'),'defaultValue':Sequelize[_0xf5d5('0x9')](_0xf5d5('0xa'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index b4f7a46..d857843 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 _0xb56c=['body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','index','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','options','include','rows','catch','params','includeAll','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb56c,0x1b6));var _0xcb56=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0xb56c[_0x4eb6ec];return _0x58881b;};'use strict';var emlformat=require(_0xcb56('0x0'));var rimraf=require(_0xcb56('0x1'));var zipdir=require(_0xcb56('0x2'));var jsonpatch=require(_0xcb56('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcb56('0x4'));var Mustache=require(_0xcb56('0x5'));var util=require(_0xcb56('0x6'));var path=require(_0xcb56('0x7'));var sox=require(_0xcb56('0x8'));var csv=require(_0xcb56('0x9'));var ejs=require(_0xcb56('0xa'));var fs=require('fs');var fs_extra=require(_0xcb56('0xb'));var _=require(_0xcb56('0xc'));var squel=require(_0xcb56('0xd'));var crypto=require(_0xcb56('0xe'));var jsforce=require(_0xcb56('0xf'));var deskjs=require(_0xcb56('0x10'));var toCsv=require(_0xcb56('0x9'));var querystring=require(_0xcb56('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcb56('0x12'));var qs=require(_0xcb56('0x13'));var as=require(_0xcb56('0x14'));var hardwareService=require(_0xcb56('0x15'));var logger=require(_0xcb56('0x16'))('api');var utils=require(_0xcb56('0x17'));var config=require(_0xcb56('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4feb0a,_0x4c908a){_0x4c908a=_0x4c908a||0xcc;return function(_0x1663fd){if(_0x1663fd){return _0x4feb0a[_0xcb56('0x19')](_0x4c908a);}return _0x4feb0a['status'](_0x4c908a)[_0xcb56('0x1a')]();};}function respondWithResult(_0xe7d8d8,_0x149505){_0x149505=_0x149505||0xc8;return function(_0xf61ca9){if(_0xf61ca9){return _0xe7d8d8[_0xcb56('0x1b')](_0x149505)[_0xcb56('0x1c')](_0xf61ca9);}};}function respondWithFilteredResult(_0x34e1c0,_0x288664){return function(_0x4c84ca){if(_0x4c84ca){var _0x48bd90=typeof _0x288664[_0xcb56('0x1d')]===_0xcb56('0x1e')&&typeof _0x288664[_0xcb56('0x1f')]===_0xcb56('0x1e');var _0x358ac6=_0x4c84ca[_0xcb56('0x20')];var _0x2c51ae=_0x48bd90?0x0:_0x288664[_0xcb56('0x1d')];var _0xab4eef=_0x48bd90?_0x4c84ca[_0xcb56('0x20')]:_0x288664[_0xcb56('0x1d')]+_0x288664[_0xcb56('0x1f')];var _0x1a1ecd;if(_0xab4eef>=_0x358ac6){_0xab4eef=_0x358ac6;_0x1a1ecd=0xc8;}else{_0x1a1ecd=0xce;}_0x34e1c0['status'](_0x1a1ecd);return _0x34e1c0[_0xcb56('0x21')](_0xcb56('0x22'),_0x2c51ae+'-'+_0xab4eef+'/'+_0x358ac6)[_0xcb56('0x1c')](_0x4c84ca);}return null;};}function patchUpdates(_0x49d099){return function(_0x170229){try{jsonpatch[_0xcb56('0x23')](_0x170229,_0x49d099,!![]);}catch(_0x1902ba){return BPromise[_0xcb56('0x24')](_0x1902ba);}return _0x170229['save']();};}function saveUpdates(_0xc370fa,_0x29e8fb){return function(_0x5640ed){if(_0x5640ed){return _0x5640ed['update'](_0xc370fa)[_0xcb56('0x25')](function(_0x2f9d0f){return _0x2f9d0f;});}return null;};}function removeEntity(_0x438a39,_0x462e5a){return function(_0x5197af){if(_0x5197af){return _0x5197af[_0xcb56('0x26')]()[_0xcb56('0x25')](function(){_0x438a39['status'](0xcc)[_0xcb56('0x1a')]();});}};}function handleEntityNotFound(_0x55476a,_0x4a324f){return function(_0x2218b6){if(!_0x2218b6){_0x55476a['sendStatus'](0x194);}return _0x2218b6;};}function handleError(_0xe03a0a,_0x435d91){_0x435d91=_0x435d91||0x1f4;return function(_0x63f92d){logger[_0xcb56('0x27')](_0x63f92d['stack']);if(_0x63f92d['name']){delete _0x63f92d[_0xcb56('0x28')];}_0xe03a0a[_0xcb56('0x1b')](_0x435d91)['send'](_0x63f92d);};}exports[_0xcb56('0x29')]=function(_0x4c194d,_0x26eaa7){var _0x14fd1c={},_0x53e4e1={},_0x5e0b31={'count':0x0,'rows':[]};var _0x173c7b=_['map'](db[_0xcb56('0x2a')][_0xcb56('0x2b')],function(_0x30ab44){return{'name':_0x30ab44[_0xcb56('0x2c')],'type':_0x30ab44[_0xcb56('0x2d')][_0xcb56('0x2e')]};});_0x53e4e1[_0xcb56('0x2f')]=_[_0xcb56('0x30')](_['map'](_0x173c7b,'name'),['name']);_0x53e4e1['query']=_[_0xcb56('0x31')](_0x4c194d[_0xcb56('0x32')]);_0x53e4e1[_0xcb56('0x33')]=_['intersection'](_0x53e4e1['model'],_0x53e4e1[_0xcb56('0x32')]);_0x14fd1c[_0xcb56('0x34')]=_[_0xcb56('0x35')](_0x53e4e1['model'],qs[_0xcb56('0x36')](_0x4c194d[_0xcb56('0x32')][_0xcb56('0x36')]));_0x14fd1c[_0xcb56('0x34')]=_0x14fd1c[_0xcb56('0x34')][_0xcb56('0x37')]?_0x14fd1c[_0xcb56('0x34')]:_0x53e4e1[_0xcb56('0x2f')];if(!_0x4c194d[_0xcb56('0x32')][_0xcb56('0x38')](_0xcb56('0x39'))){_0x14fd1c[_0xcb56('0x1f')]=qs[_0xcb56('0x1f')](_0x4c194d[_0xcb56('0x32')][_0xcb56('0x1f')]);_0x14fd1c[_0xcb56('0x1d')]=qs[_0xcb56('0x1d')](_0x4c194d[_0xcb56('0x32')][_0xcb56('0x1d')]);}_0x14fd1c[_0xcb56('0x3a')]=qs[_0xcb56('0x3b')](_0x4c194d[_0xcb56('0x32')][_0xcb56('0x3b')]);_0x14fd1c['where']=qs[_0xcb56('0x33')](_[_0xcb56('0x3c')](_0x4c194d[_0xcb56('0x32')],_0x53e4e1[_0xcb56('0x33')]),_0x173c7b);if(_0x4c194d[_0xcb56('0x32')]['filter']){_0x14fd1c[_0xcb56('0x3d')]=_['merge'](_0x14fd1c[_0xcb56('0x3d')],{'$or':_['map'](_0x173c7b,function(_0x4d47fc){if(_0x4d47fc['type']!==_0xcb56('0x3e')){var _0x1ffeae={};_0x1ffeae[_0x4d47fc['name']]={'$like':'%'+_0x4c194d['query']['filter']+'%'};return _0x1ffeae;}})});}_0x14fd1c=_[_0xcb56('0x3f')]({},_0x14fd1c,_0x4c194d[_0xcb56('0x40')]);var _0x460b0={'where':_0x14fd1c['where']};return db['VoiceMailMessage'][_0xcb56('0x20')](_0x460b0)[_0xcb56('0x25')](function(_0x5c0ff4){_0x5e0b31[_0xcb56('0x20')]=_0x5c0ff4;if(_0x4c194d['query']['includeAll']){_0x14fd1c[_0xcb56('0x41')]=[{'all':!![]}];}return db[_0xcb56('0x2a')]['findAll'](_0x14fd1c);})[_0xcb56('0x25')](function(_0x9eec2){_0x5e0b31[_0xcb56('0x42')]=_0x9eec2;return _0x5e0b31;})['then'](respondWithFilteredResult(_0x26eaa7,_0x14fd1c))[_0xcb56('0x43')](handleError(_0x26eaa7,null));};exports['show']=function(_0x4e7b89,_0x13388e){var _0x44945c={'raw':!![],'where':{'id':_0x4e7b89[_0xcb56('0x44')]['id']}},_0x4e6848={};_0x4e6848['model']=_[_0xcb56('0x31')](db[_0xcb56('0x2a')][_0xcb56('0x2b')]);_0x4e6848[_0xcb56('0x32')]=_[_0xcb56('0x31')](_0x4e7b89[_0xcb56('0x32')]);_0x4e6848[_0xcb56('0x33')]=_[_0xcb56('0x35')](_0x4e6848[_0xcb56('0x2f')],_0x4e6848['query']);_0x44945c['attributes']=_[_0xcb56('0x35')](_0x4e6848[_0xcb56('0x2f')],qs[_0xcb56('0x36')](_0x4e7b89[_0xcb56('0x32')][_0xcb56('0x36')]));_0x44945c[_0xcb56('0x34')]=_0x44945c[_0xcb56('0x34')][_0xcb56('0x37')]?_0x44945c['attributes']:_0x4e6848['model'];if(_0x4e7b89[_0xcb56('0x32')][_0xcb56('0x45')]){_0x44945c[_0xcb56('0x41')]=[{'all':!![]}];}_0x44945c=_[_0xcb56('0x3f')]({},_0x44945c,_0x4e7b89[_0xcb56('0x40')]);return db[_0xcb56('0x2a')][_0xcb56('0x46')](_0x44945c)[_0xcb56('0x25')](handleEntityNotFound(_0x13388e,null))['then'](respondWithResult(_0x13388e,null))[_0xcb56('0x43')](handleError(_0x13388e,null));};exports[_0xcb56('0x47')]=function(_0x4342c4,_0x4ca7e0){return db['VoiceMailMessage'][_0xcb56('0x47')](_0x4342c4[_0xcb56('0x48')],{})[_0xcb56('0x25')](respondWithResult(_0x4ca7e0,0xc9))[_0xcb56('0x43')](handleError(_0x4ca7e0,null));};exports['update']=function(_0x3c68a0,_0x16cbef){if(_0x3c68a0[_0xcb56('0x48')]['id']){delete _0x3c68a0[_0xcb56('0x48')]['id'];}return db['VoiceMailMessage'][_0xcb56('0x46')]({'where':{'id':_0x3c68a0['params']['id']}})[_0xcb56('0x25')](handleEntityNotFound(_0x16cbef,null))[_0xcb56('0x25')](saveUpdates(_0x3c68a0['body'],null))[_0xcb56('0x25')](respondWithResult(_0x16cbef,null))[_0xcb56('0x43')](handleError(_0x16cbef,null));};exports[_0xcb56('0x26')]=function(_0xdee83d,_0x7d8429){return db[_0xcb56('0x2a')]['find']({'where':{'id':_0xdee83d[_0xcb56('0x44')]['id']}})[_0xcb56('0x25')](handleEntityNotFound(_0x7d8429,null))[_0xcb56('0x25')](removeEntity(_0x7d8429,null))['catch'](handleError(_0x7d8429,null));};exports[_0xcb56('0x49')]=function(_0x2bff71,_0x4b47bf,_0x1f87b7){return db[_0xcb56('0x2a')][_0xcb56('0x46')]({'where':{'id':_0x2bff71[_0xcb56('0x44')]['id']},'attributes':['id',_0xcb56('0x4a'),_0xcb56('0x4b')]})['then'](handleEntityNotFound(_0x4b47bf,null))[_0xcb56('0x25')](function(_0x4c2656){if(_0x4c2656){if(!_0x4c2656[_0xcb56('0x4a')]){throw new db[(_0xcb56('0x4c'))][(_0xcb56('0x4d'))](_0xcb56('0x4e'));}var _0x369db7={'Content-Type':_0xcb56('0x4f'),'Content-Disposition':_0xcb56('0x50')};if(_0x4c2656[_0xcb56('0x4b')]){_0x369db7[_0xcb56('0x51')]=_0xcb56('0x52')+_0x4c2656[_0xcb56('0x4b')]+_0xcb56('0x53');}_0x4b47bf[_0xcb56('0x21')](_0x369db7);return _0x4b47bf[_0xcb56('0x54')](new Buffer(_0x4c2656['recording']));}})[_0xcb56('0x43')](handleError(_0x4b47bf,null));}; \ No newline at end of file +var _0xa253=['include','findAll','catch','show','params','rawAttributes','create','body','update','find','msg_id','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','recording','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','save','destroy','sendStatus','error','stack','name','send','map','fieldName','type','key','differenceBy','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','VoiceMailMessage','then','includeAll'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xa253,0x1af));var _0x3a25=function(_0x2b36b0,_0x331282){_0x2b36b0=_0x2b36b0-0x0;var _0x3c0a23=_0xa253[_0x2b36b0];return _0x3c0a23;};'use strict';var emlformat=require(_0x3a25('0x0'));var rimraf=require(_0x3a25('0x1'));var zipdir=require(_0x3a25('0x2'));var jsonpatch=require(_0x3a25('0x3'));var rp=require('request-promise');var moment=require(_0x3a25('0x4'));var BPromise=require(_0x3a25('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3a25('0x6'));var sox=require(_0x3a25('0x7'));var csv=require(_0x3a25('0x8'));var ejs=require(_0x3a25('0x9'));var fs=require('fs');var fs_extra=require(_0x3a25('0xa'));var _=require(_0x3a25('0xb'));var squel=require(_0x3a25('0xc'));var crypto=require(_0x3a25('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3a25('0xe'));var toCsv=require(_0x3a25('0x8'));var querystring=require(_0x3a25('0xf'));var Papa=require(_0x3a25('0x10'));var Redis=require(_0x3a25('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3a25('0x12'));var hardwareService=require(_0x3a25('0x13'));var logger=require(_0x3a25('0x14'))(_0x3a25('0x15'));var utils=require(_0x3a25('0x16'));var config=require(_0x3a25('0x17'));var licenseUtil=require(_0x3a25('0x18'));var db=require(_0x3a25('0x19'))['db'];function respondWithStatusCode(_0x556c6a,_0x12e297){_0x12e297=_0x12e297||0xcc;return function(_0x1ea5fa){if(_0x1ea5fa){return _0x556c6a['sendStatus'](_0x12e297);}return _0x556c6a[_0x3a25('0x1a')](_0x12e297)[_0x3a25('0x1b')]();};}function respondWithResult(_0x15f2dd,_0x479bdf){_0x479bdf=_0x479bdf||0xc8;return function(_0x5573fa){if(_0x5573fa){return _0x15f2dd[_0x3a25('0x1a')](_0x479bdf)['json'](_0x5573fa);}};}function respondWithFilteredResult(_0x5b7fff,_0x4ac039){return function(_0xfa8a5b){if(_0xfa8a5b){var _0x49b0db=typeof _0x4ac039[_0x3a25('0x1c')]===_0x3a25('0x1d')&&typeof _0x4ac039['limit']==='undefined';var _0x3ae113=_0xfa8a5b[_0x3a25('0x1e')];var _0x3c4cb9=_0x49b0db?0x0:_0x4ac039['offset'];var _0x26cb88=_0x49b0db?_0xfa8a5b[_0x3a25('0x1e')]:_0x4ac039[_0x3a25('0x1c')]+_0x4ac039[_0x3a25('0x1f')];var _0x36bf98;if(_0x26cb88>=_0x3ae113){_0x26cb88=_0x3ae113;_0x36bf98=0xc8;}else{_0x36bf98=0xce;}_0x5b7fff[_0x3a25('0x1a')](_0x36bf98);return _0x5b7fff[_0x3a25('0x20')](_0x3a25('0x21'),_0x3c4cb9+'-'+_0x26cb88+'/'+_0x3ae113)[_0x3a25('0x22')](_0xfa8a5b);}return null;};}function patchUpdates(_0x18efd9){return function(_0x562a8b){try{jsonpatch['apply'](_0x562a8b,_0x18efd9,!![]);}catch(_0x17d4f8){return BPromise['reject'](_0x17d4f8);}return _0x562a8b[_0x3a25('0x23')]();};}function saveUpdates(_0x49db13,_0x22e837){return function(_0xd8f3f5){if(_0xd8f3f5){return _0xd8f3f5['update'](_0x49db13)['then'](function(_0x16c717){return _0x16c717;});}return null;};}function removeEntity(_0x11470d,_0x304cc9){return function(_0x296401){if(_0x296401){return _0x296401[_0x3a25('0x24')]()['then'](function(){_0x11470d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4875a8,_0x28d290){return function(_0x478ebd){if(!_0x478ebd){_0x4875a8[_0x3a25('0x25')](0x194);}return _0x478ebd;};}function handleError(_0x2dd7a5,_0x3ab3c2){_0x3ab3c2=_0x3ab3c2||0x1f4;return function(_0x31a9fd){logger[_0x3a25('0x26')](_0x31a9fd[_0x3a25('0x27')]);if(_0x31a9fd[_0x3a25('0x28')]){delete _0x31a9fd[_0x3a25('0x28')];}_0x2dd7a5[_0x3a25('0x1a')](_0x3ab3c2)[_0x3a25('0x29')](_0x31a9fd);};}exports['index']=function(_0x321589,_0x54d044){var _0x36eb62={},_0x16e283={},_0x711223={'count':0x0,'rows':[]};var _0x4b8a9e=_[_0x3a25('0x2a')](db['VoiceMailMessage']['rawAttributes'],function(_0x4b9c84){return{'name':_0x4b9c84[_0x3a25('0x2b')],'type':_0x4b9c84[_0x3a25('0x2c')][_0x3a25('0x2d')]};});_0x16e283['model']=_[_0x3a25('0x2e')](_[_0x3a25('0x2a')](_0x4b8a9e,'name'),['name']);_0x16e283[_0x3a25('0x2f')]=_[_0x3a25('0x30')](_0x321589[_0x3a25('0x2f')]);_0x16e283[_0x3a25('0x31')]=_[_0x3a25('0x32')](_0x16e283['model'],_0x16e283['query']);_0x36eb62[_0x3a25('0x33')]=_['intersection'](_0x16e283[_0x3a25('0x34')],qs[_0x3a25('0x35')](_0x321589[_0x3a25('0x2f')][_0x3a25('0x35')]));_0x36eb62[_0x3a25('0x33')]=_0x36eb62[_0x3a25('0x33')][_0x3a25('0x36')]?_0x36eb62['attributes']:_0x16e283[_0x3a25('0x34')];if(!_0x321589['query'][_0x3a25('0x37')](_0x3a25('0x38'))){_0x36eb62[_0x3a25('0x1f')]=qs[_0x3a25('0x1f')](_0x321589[_0x3a25('0x2f')][_0x3a25('0x1f')]);_0x36eb62['offset']=qs[_0x3a25('0x1c')](_0x321589[_0x3a25('0x2f')]['offset']);}_0x36eb62[_0x3a25('0x39')]=qs[_0x3a25('0x3a')](_0x321589[_0x3a25('0x2f')][_0x3a25('0x3a')]);_0x36eb62[_0x3a25('0x3b')]=qs[_0x3a25('0x31')](_['pick'](_0x321589[_0x3a25('0x2f')],_0x16e283['filters']),_0x4b8a9e);if(_0x321589[_0x3a25('0x2f')][_0x3a25('0x3c')]){_0x36eb62['where']=_['merge'](_0x36eb62[_0x3a25('0x3b')],{'$or':_[_0x3a25('0x2a')](_0x4b8a9e,function(_0x49c7f1){if(_0x49c7f1[_0x3a25('0x2c')]!==_0x3a25('0x3d')){var _0xc4a136={};_0xc4a136[_0x49c7f1[_0x3a25('0x28')]]={'$like':'%'+_0x321589['query'][_0x3a25('0x3c')]+'%'};return _0xc4a136;}})});}_0x36eb62=_[_0x3a25('0x3e')]({},_0x36eb62,_0x321589[_0x3a25('0x3f')]);var _0x200b15={'where':_0x36eb62[_0x3a25('0x3b')]};return db[_0x3a25('0x40')][_0x3a25('0x1e')](_0x200b15)[_0x3a25('0x41')](function(_0xd4aaa8){_0x711223[_0x3a25('0x1e')]=_0xd4aaa8;if(_0x321589[_0x3a25('0x2f')][_0x3a25('0x42')]){_0x36eb62[_0x3a25('0x43')]=[{'all':!![]}];}return db[_0x3a25('0x40')][_0x3a25('0x44')](_0x36eb62);})['then'](function(_0x33b5c4){_0x711223['rows']=_0x33b5c4;return _0x711223;})[_0x3a25('0x41')](respondWithFilteredResult(_0x54d044,_0x36eb62))[_0x3a25('0x45')](handleError(_0x54d044,null));};exports[_0x3a25('0x46')]=function(_0x49cf7c,_0x352697){var _0x4c42c3={'raw':!![],'where':{'id':_0x49cf7c[_0x3a25('0x47')]['id']}},_0x24a2a1={};_0x24a2a1[_0x3a25('0x34')]=_[_0x3a25('0x30')](db['VoiceMailMessage'][_0x3a25('0x48')]);_0x24a2a1[_0x3a25('0x2f')]=_[_0x3a25('0x30')](_0x49cf7c[_0x3a25('0x2f')]);_0x24a2a1['filters']=_[_0x3a25('0x32')](_0x24a2a1['model'],_0x24a2a1[_0x3a25('0x2f')]);_0x4c42c3[_0x3a25('0x33')]=_[_0x3a25('0x32')](_0x24a2a1[_0x3a25('0x34')],qs[_0x3a25('0x35')](_0x49cf7c[_0x3a25('0x2f')][_0x3a25('0x35')]));_0x4c42c3[_0x3a25('0x33')]=_0x4c42c3[_0x3a25('0x33')][_0x3a25('0x36')]?_0x4c42c3['attributes']:_0x24a2a1['model'];if(_0x49cf7c[_0x3a25('0x2f')][_0x3a25('0x42')]){_0x4c42c3['include']=[{'all':!![]}];}_0x4c42c3=_[_0x3a25('0x3e')]({},_0x4c42c3,_0x49cf7c[_0x3a25('0x3f')]);return db[_0x3a25('0x40')]['find'](_0x4c42c3)[_0x3a25('0x41')](handleEntityNotFound(_0x352697,null))['then'](respondWithResult(_0x352697,null))[_0x3a25('0x45')](handleError(_0x352697,null));};exports[_0x3a25('0x49')]=function(_0x4eff47,_0x546340){return db[_0x3a25('0x40')][_0x3a25('0x49')](_0x4eff47[_0x3a25('0x4a')],{})[_0x3a25('0x41')](respondWithResult(_0x546340,0xc9))[_0x3a25('0x45')](handleError(_0x546340,null));};exports[_0x3a25('0x4b')]=function(_0x535447,_0x347dfe){if(_0x535447[_0x3a25('0x4a')]['id']){delete _0x535447['body']['id'];}return db[_0x3a25('0x40')][_0x3a25('0x4c')]({'where':{'id':_0x535447[_0x3a25('0x47')]['id']}})[_0x3a25('0x41')](handleEntityNotFound(_0x347dfe,null))[_0x3a25('0x41')](saveUpdates(_0x535447[_0x3a25('0x4a')],null))[_0x3a25('0x41')](respondWithResult(_0x347dfe,null))[_0x3a25('0x45')](handleError(_0x347dfe,null));};exports['destroy']=function(_0x3e11a8,_0x490bdf){return db[_0x3a25('0x40')][_0x3a25('0x4c')]({'where':{'id':_0x3e11a8[_0x3a25('0x47')]['id']}})[_0x3a25('0x41')](handleEntityNotFound(_0x490bdf,null))[_0x3a25('0x41')](removeEntity(_0x490bdf,null))[_0x3a25('0x45')](handleError(_0x490bdf,null));};exports['download']=function(_0x199315,_0xf1c4db,_0x566c54){return db['VoiceMailMessage'][_0x3a25('0x4c')]({'where':{'id':_0x199315[_0x3a25('0x47')]['id']},'attributes':['id','recording',_0x3a25('0x4d')]})[_0x3a25('0x41')](handleEntityNotFound(_0xf1c4db,null))['then'](function(_0x2ed050){if(_0x2ed050){if(!_0x2ed050['recording']){throw new db['Sequelize']['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x46c6df={'Content-Type':_0x3a25('0x4e'),'Content-Disposition':_0x3a25('0x4f')};if(_0x2ed050[_0x3a25('0x4d')]){_0x46c6df['Content-Disposition']=_0x3a25('0x50')+_0x2ed050['msg_id']+_0x3a25('0x51');}_0xf1c4db['set'](_0x46c6df);return _0xf1c4db[_0x3a25('0x29')](new Buffer(_0x2ed050[_0x3a25('0x52')]));}})[_0x3a25('0x45')](handleError(_0xf1c4db,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 4178204..3f6b106 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 _0x186f=['define','VoiceMailMessage','voice_voicemail_messages','dir','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes'];(function(_0x5b4f3b,_0x24b4b2){var _0x3ae94e=function(_0x260dab){while(--_0x260dab){_0x5b4f3b['push'](_0x5b4f3b['shift']());}};_0x3ae94e(++_0x24b4b2);}(_0x186f,0xa0));var _0xf186=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x186f[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf186('0x0'))(_0xf186('0x1'));var moment=require(_0xf186('0x2'));var BPromise=require(_0xf186('0x3'));var rp=require(_0xf186('0x4'));var fs=require('fs');var path=require(_0xf186('0x5'));var rimraf=require(_0xf186('0x6'));var config=require('../../config/environment');var attributes=require(_0xf186('0x7'));module['exports']=function(_0x4d8144,_0x5698f1){return _0x4d8144[_0xf186('0x8')](_0xf186('0x9'),attributes,{'tableName':_0xf186('0xa'),'paranoid':![],'indexes':[{'name':_0xf186('0xb'),'fields':[_0xf186('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd3ab=['exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','api','path','rimraf','../../config/environment','./voiceMailMessage.attributes'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xd3ab,0x11c));var _0xbd3a=function(_0x1a39d1,_0x410d27){_0x1a39d1=_0x1a39d1-0x0;var _0x3501b8=_0xd3ab[_0x1a39d1];return _0x3501b8;};'use strict';var _=require(_0xbd3a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbd3a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd3a('0x2'));var rimraf=require(_0xbd3a('0x3'));var config=require(_0xbd3a('0x4'));var attributes=require(_0xbd3a('0x5'));module[_0xbd3a('0x6')]=function(_0x354d22,_0x48948f){return _0x354d22['define'](_0xbd3a('0x7'),attributes,{'tableName':_0xbd3a('0x8'),'paranoid':![],'indexes':[{'name':_0xbd3a('0x9'),'fields':[_0xbd3a('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 2c00f85..6bd0eb7 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 _0x93f2=['client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4d79bc,_0x32c905){var _0x4b4760=function(_0x212302){while(--_0x212302){_0x4d79bc['push'](_0x4d79bc['shift']());}};_0x4b4760(++_0x32c905);}(_0x93f2,0x182));var _0x293f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x93f2[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x293f('0x0'));var util=require(_0x293f('0x1'));var moment=require('moment');var BPromise=require(_0x293f('0x2'));var rs=require(_0x293f('0x3'));var fs=require('fs');var Redis=require(_0x293f('0x4'));var db=require(_0x293f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x293f('0x6'))(_0x293f('0x7'));var config=require(_0x293f('0x8'));var jayson=require(_0x293f('0x9'));var client=jayson[_0x293f('0xa')][_0x293f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34e831,_0x529b9f,_0x4f8f42){return new BPromise(function(_0x24d7e7,_0x11f281){return client[_0x293f('0xc')](_0x34e831,_0x4f8f42)[_0x293f('0xd')](function(_0xdf92c0){logger[_0x293f('0xe')](_0x293f('0xf'),_0x529b9f,_0x293f('0x10'));logger[_0x293f('0x11')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x529b9f,_0x293f('0x10'),JSON[_0x293f('0x12')](_0xdf92c0));if(_0xdf92c0[_0x293f('0x13')]){if(_0xdf92c0[_0x293f('0x13')]['code']===0x1f4){logger[_0x293f('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x529b9f,_0xdf92c0[_0x293f('0x13')][_0x293f('0x14')]);return _0x11f281(_0xdf92c0['error'][_0x293f('0x14')]);}logger[_0x293f('0x13')](_0x293f('0xf'),_0x529b9f,_0xdf92c0[_0x293f('0x13')]['message']);return _0x24d7e7(_0xdf92c0[_0x293f('0x13')][_0x293f('0x14')]);}else{logger[_0x293f('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x529b9f,_0x293f('0x10'));_0x24d7e7(_0xdf92c0['result'][_0x293f('0x14')]);}})[_0x293f('0x15')](function(_0x3f5c31){logger[_0x293f('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x529b9f,_0x3f5c31);_0x11f281(_0x3f5c31);});});} \ No newline at end of file +var _0x742f=['debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x742f,0x1eb));var _0xf742=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x742f[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0xf742('0x0'));var util=require('util');var moment=require(_0xf742('0x1'));var BPromise=require('bluebird');var rs=require(_0xf742('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf742('0x3'));var logger=require(_0xf742('0x4'))(_0xf742('0x5'));var config=require(_0xf742('0x6'));var jayson=require(_0xf742('0x7'));var client=jayson[_0xf742('0x8')][_0xf742('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49abb4,_0x555827,_0x1d2e93){return new BPromise(function(_0x5bc29d,_0x8594d5){return client[_0xf742('0xa')](_0x49abb4,_0x1d2e93)[_0xf742('0xb')](function(_0x31b9fb){logger[_0xf742('0xc')](_0xf742('0xd'),_0x555827,_0xf742('0xe'));logger[_0xf742('0xf')](_0xf742('0x10'),_0x555827,_0xf742('0xe'),JSON[_0xf742('0x11')](_0x31b9fb));if(_0x31b9fb['error']){if(_0x31b9fb[_0xf742('0x12')]['code']===0x1f4){logger[_0xf742('0x12')](_0xf742('0xd'),_0x555827,_0x31b9fb['error'][_0xf742('0x13')]);return _0x8594d5(_0x31b9fb[_0xf742('0x12')][_0xf742('0x13')]);}logger[_0xf742('0x12')](_0xf742('0xd'),_0x555827,_0x31b9fb['error'][_0xf742('0x13')]);return _0x5bc29d(_0x31b9fb[_0xf742('0x12')][_0xf742('0x13')]);}else{logger[_0xf742('0xc')](_0xf742('0xd'),_0x555827,'request\x20sent');_0x5bc29d(_0x31b9fb[_0xf742('0x14')][_0xf742('0x13')]);}})[_0xf742('0x15')](function(_0x44bc30){logger[_0xf742('0x12')](_0xf742('0xd'),_0x555827,_0x44bc30);_0x8594d5(_0x44bc30);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 2eb7740..fccadc6 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 _0xe958=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','/:id','isAuthenticated','show','getSounds','create','post','addSound','put','update','destroy','delete','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe958,0x13b));var _0x8e95=function(_0x33536c,_0x488578){_0x33536c=_0x33536c-0x0;var _0x5de091=_0xe958[_0x33536c];return _0x5de091;};'use strict';var multer=require('multer');var util=require(_0x8e95('0x0'));var path=require(_0x8e95('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8e95('0x2')]();var fs_extra=require(_0x8e95('0x3'));var auth=require(_0x8e95('0x4'));var interaction=require(_0x8e95('0x5'));var config=require(_0x8e95('0x6'));var controller=require(_0x8e95('0x7'));router[_0x8e95('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8e95('0x8')](_0x8e95('0x9'),auth[_0x8e95('0xa')](),controller[_0x8e95('0xb')]);router[_0x8e95('0x8')]('/:id/sounds',auth[_0x8e95('0xa')](),controller[_0x8e95('0xc')]);router['post']('/',auth[_0x8e95('0xa')](),controller[_0x8e95('0xd')]);router[_0x8e95('0xe')]('/:id/sounds',auth['isAuthenticated'](),controller[_0x8e95('0xf')]);router[_0x8e95('0x10')](_0x8e95('0x9'),auth[_0x8e95('0xa')](),controller[_0x8e95('0x11')]);router['delete'](_0x8e95('0x9'),auth['isAuthenticated'](),controller[_0x8e95('0x12')]);router[_0x8e95('0x13')]('/:id/sounds/:id2',auth[_0x8e95('0xa')](),controller['removeSound']);module[_0x8e95('0x14')]=router; \ No newline at end of file +var _0xd3d1=['getSounds','post','create','addSound','update','delete','destroy','/:id/sounds/:id2','removeSound','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceMusicOnHold.controller','get','/:id','isAuthenticated'];(function(_0x32bce8,_0x54f965){var _0x38badc=function(_0x1ed1ee){while(--_0x1ed1ee){_0x32bce8['push'](_0x32bce8['shift']());}};_0x38badc(++_0x54f965);}(_0xd3d1,0x1d5));var _0x1d3d=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xd3d1[_0x5f0089];return _0x193892;};'use strict';var multer=require('multer');var util=require(_0x1d3d('0x0'));var path=require(_0x1d3d('0x1'));var timeout=require(_0x1d3d('0x2'));var express=require(_0x1d3d('0x3'));var router=express[_0x1d3d('0x4')]();var fs_extra=require(_0x1d3d('0x5'));var auth=require(_0x1d3d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1d3d('0x7'));router[_0x1d3d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1d3d('0x8')](_0x1d3d('0x9'),auth[_0x1d3d('0xa')](),controller['show']);router[_0x1d3d('0x8')]('/:id/sounds',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xb')]);router[_0x1d3d('0xc')]('/',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xd')]);router['post']('/:id/sounds',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xe')]);router['put']('/:id',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xf')]);router[_0x1d3d('0x10')](_0x1d3d('0x9'),auth['isAuthenticated'](),controller[_0x1d3d('0x11')]);router[_0x1d3d('0x10')](_0x1d3d('0x12'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 41c4336..9865100 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 _0x8cde=['mp3nb','quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files'];(function(_0x5a1fe2,_0x5ecacc){var _0x5eaaaf=function(_0x2c2658){while(--_0x2c2658){_0x5a1fe2['push'](_0x5a1fe2['shift']());}};_0x5eaaaf(++_0x5ecacc);}(_0x8cde,0x13e));var _0xe8cd=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0x8cde[_0x4e11d5];return _0x5e4e4c;};'use strict';var Sequelize=require(_0xe8cd('0x0'));module[_0xe8cd('0x1')]={'name':{'type':Sequelize[_0xe8cd('0x2')],'allowNull':![],'unique':_0xe8cd('0x3')},'mode':{'type':Sequelize[_0xe8cd('0x4')](_0xe8cd('0x5'),_0xe8cd('0x6'),_0xe8cd('0x7'),_0xe8cd('0x8'),_0xe8cd('0x9'),'mp3'),'allowNull':!![],'defaultValue':_0xe8cd('0x6')},'directory':{'type':Sequelize[_0xe8cd('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xe8cd('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xe8cd('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xe8cd('0x2')],'allowNull':!![],'defaultValue':_0xe8cd('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xe8cd('0xb')},'defaultEntry':{'type':Sequelize[_0xe8cd('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4d0a=['alpha','TIMESTAMP','sequelize','exports','STRING','name','custom','files','mp3nb','quietmp3nb','quietmp3','mp3'];(function(_0x767d35,_0x29ba19){var _0x31c4ee=function(_0x183274){while(--_0x183274){_0x767d35['push'](_0x767d35['shift']());}};_0x31c4ee(++_0x29ba19);}(_0x4d0a,0x122));var _0xa4d0=function(_0x30506c,_0x44f7e3){_0x30506c=_0x30506c-0x0;var _0x12ad2d=_0x4d0a[_0x30506c];return _0x12ad2d;};'use strict';var Sequelize=require(_0xa4d0('0x0'));module[_0xa4d0('0x1')]={'name':{'type':Sequelize[_0xa4d0('0x2')],'allowNull':![],'unique':_0xa4d0('0x3')},'mode':{'type':Sequelize['ENUM'](_0xa4d0('0x4'),_0xa4d0('0x5'),_0xa4d0('0x6'),_0xa4d0('0x7'),_0xa4d0('0x8'),_0xa4d0('0x9')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xa4d0('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xa4d0('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xa4d0('0x2')],'allowNull':!![],'defaultValue':_0xa4d0('0xa')},'format':{'type':Sequelize[_0xa4d0('0x2')],'allowNull':!![]},'stamp':{'type':_0xa4d0('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 4fb0c84..158d1ca 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 _0xfd5e=['map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','sequelize','mode','files','directory','join','root','server/files/moh','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','unlinkSync','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','extname','Sequelize','removeSound','id2','format','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','destroy','end','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName','key','model'];(function(_0x446d2e,_0x4bc597){var _0x1739de=function(_0x1c137c){while(--_0x1c137c){_0x446d2e['push'](_0x446d2e['shift']());}};_0x1739de(++_0x4bc597);}(_0xfd5e,0xae));var _0xefd5=function(_0x2d44c3,_0x4ce66a){_0x2d44c3=_0x2d44c3-0x0;var _0x54cf65=_0xfd5e[_0x2d44c3];return _0x54cf65;};'use strict';var emlformat=require(_0xefd5('0x0'));var rimraf=require(_0xefd5('0x1'));var zipdir=require(_0xefd5('0x2'));var jsonpatch=require(_0xefd5('0x3'));var rp=require(_0xefd5('0x4'));var moment=require(_0xefd5('0x5'));var BPromise=require(_0xefd5('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xefd5('0x7'));var sox=require(_0xefd5('0x8'));var csv=require(_0xefd5('0x9'));var ejs=require(_0xefd5('0xa'));var fs=require('fs');var fs_extra=require(_0xefd5('0xb'));var _=require('lodash');var squel=require(_0xefd5('0xc'));var crypto=require(_0xefd5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xefd5('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xefd5('0xf'));var qs=require(_0xefd5('0x10'));var as=require(_0xefd5('0x11'));var hardwareService=require(_0xefd5('0x12'));var logger=require(_0xefd5('0x13'))('api');var utils=require(_0xefd5('0x14'));var config=require(_0xefd5('0x15'));var licenseUtil=require(_0xefd5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40e22e,_0x511079){_0x511079=_0x511079||0xcc;return function(_0x435e2d){if(_0x435e2d){return _0x40e22e[_0xefd5('0x17')](_0x511079);}return _0x40e22e[_0xefd5('0x18')](_0x511079)['end']();};}function respondWithResult(_0x485a4c,_0x1f7238){_0x1f7238=_0x1f7238||0xc8;return function(_0x7c1cfc){if(_0x7c1cfc){return _0x485a4c[_0xefd5('0x18')](_0x1f7238)[_0xefd5('0x19')](_0x7c1cfc);}};}function respondWithFilteredResult(_0x146808,_0x111d52){return function(_0x2b3cbf){if(_0x2b3cbf){var _0x49e167=typeof _0x111d52[_0xefd5('0x1a')]===_0xefd5('0x1b')&&typeof _0x111d52[_0xefd5('0x1c')]==='undefined';var _0xfebd89=_0x2b3cbf[_0xefd5('0x1d')];var _0x1b8398=_0x49e167?0x0:_0x111d52[_0xefd5('0x1a')];var _0x2780be=_0x49e167?_0x2b3cbf[_0xefd5('0x1d')]:_0x111d52[_0xefd5('0x1a')]+_0x111d52[_0xefd5('0x1c')];var _0x1e07cf;if(_0x2780be>=_0xfebd89){_0x2780be=_0xfebd89;_0x1e07cf=0xc8;}else{_0x1e07cf=0xce;}_0x146808[_0xefd5('0x18')](_0x1e07cf);return _0x146808[_0xefd5('0x1e')](_0xefd5('0x1f'),_0x1b8398+'-'+_0x2780be+'/'+_0xfebd89)[_0xefd5('0x19')](_0x2b3cbf);}return null;};}function patchUpdates(_0x5a1281){return function(_0x3fd637){try{jsonpatch[_0xefd5('0x20')](_0x3fd637,_0x5a1281,!![]);}catch(_0x4bc21e){return BPromise[_0xefd5('0x21')](_0x4bc21e);}return _0x3fd637[_0xefd5('0x22')]();};}function saveUpdates(_0x43f298,_0xb505fc){return function(_0x739f4f){if(_0x739f4f){return _0x739f4f[_0xefd5('0x23')](_0x43f298)[_0xefd5('0x24')](function(_0x4f7180){return _0x4f7180;});}return null;};}function removeEntity(_0x4cf38b,_0x37bb17){return function(_0x86bdd8){if(_0x86bdd8){return _0x86bdd8['destroy']()[_0xefd5('0x24')](function(){var _0x4f04af=_0x86bdd8[_0xefd5('0x25')]({'plain':!![]});var _0x4d9b7d='MusicOnHolds';return db['UserProfileResource'][_0xefd5('0x26')]({'where':{'type':_0x4d9b7d,'resourceId':_0x4f04af['id']}})[_0xefd5('0x24')](function(){return _0x86bdd8;});})['then'](function(){_0x4cf38b[_0xefd5('0x18')](0xcc)[_0xefd5('0x27')]();});}};}function handleEntityNotFound(_0x56b098,_0x41dbc3){return function(_0x599341){if(!_0x599341){_0x56b098[_0xefd5('0x17')](0x194);}return _0x599341;};}function handleError(_0x5a1a58,_0x207875){_0x207875=_0x207875||0x1f4;return function(_0x44abe7){logger[_0xefd5('0x28')](_0x44abe7[_0xefd5('0x29')]);if(_0x44abe7[_0xefd5('0x2a')]){delete _0x44abe7[_0xefd5('0x2a')];}_0x5a1a58['status'](_0x207875)[_0xefd5('0x2b')](_0x44abe7);};}exports[_0xefd5('0x2c')]=function(_0x8230ca,_0x531734){var _0x4bf7a6={},_0x4a9b0a={},_0x34624f={'count':0x0,'rows':[]};var _0xe27620=_['map'](db[_0xefd5('0x2d')][_0xefd5('0x2e')],function(_0x53e69f){return{'name':_0x53e69f[_0xefd5('0x2f')],'type':_0x53e69f['type'][_0xefd5('0x30')]};});_0x4a9b0a[_0xefd5('0x31')]=_[_0xefd5('0x32')](_0xe27620,'name');_0x4a9b0a[_0xefd5('0x33')]=_['keys'](_0x8230ca['query']);_0x4a9b0a[_0xefd5('0x34')]=_[_0xefd5('0x35')](_0x4a9b0a['model'],_0x4a9b0a[_0xefd5('0x33')]);_0x4bf7a6['attributes']=_['intersection'](_0x4a9b0a[_0xefd5('0x31')],qs[_0xefd5('0x36')](_0x8230ca[_0xefd5('0x33')][_0xefd5('0x36')]));_0x4bf7a6['attributes']=_0x4bf7a6[_0xefd5('0x37')][_0xefd5('0x38')]?_0x4bf7a6[_0xefd5('0x37')]:_0x4a9b0a[_0xefd5('0x31')];if(!_0x8230ca[_0xefd5('0x33')][_0xefd5('0x39')](_0xefd5('0x3a'))){_0x4bf7a6[_0xefd5('0x1c')]=qs[_0xefd5('0x1c')](_0x8230ca[_0xefd5('0x33')]['limit']);_0x4bf7a6['offset']=qs[_0xefd5('0x1a')](_0x8230ca[_0xefd5('0x33')][_0xefd5('0x1a')]);}_0x4bf7a6[_0xefd5('0x3b')]=qs['sort'](_0x8230ca['query'][_0xefd5('0x3c')]);delete _0x8230ca[_0xefd5('0x33')]['sort'];_0x4bf7a6[_0xefd5('0x3d')]=qs[_0xefd5('0x34')](_[_0xefd5('0x3e')](_0x8230ca[_0xefd5('0x33')],_0x4a9b0a[_0xefd5('0x34')]),_0xe27620);if(_0x8230ca[_0xefd5('0x33')][_0xefd5('0x3f')]){_0x4bf7a6[_0xefd5('0x3d')]=_[_0xefd5('0x40')](_0x4bf7a6['where'],{'$or':_[_0xefd5('0x32')](_0xe27620,function(_0x24e74a){if(_0x24e74a[_0xefd5('0x41')]!=='VIRTUAL'){var _0x303e2a={};_0x303e2a[_0x24e74a[_0xefd5('0x2a')]]={'$like':'%'+_0x8230ca['query']['filter']+'%'};return _0x303e2a;}})});}_0x4bf7a6=_['merge']({},_0x4bf7a6,_0x8230ca[_0xefd5('0x42')]);var _0x4243c0={'where':_0x4bf7a6[_0xefd5('0x3d')]};return db[_0xefd5('0x2d')][_0xefd5('0x1d')](_0x4243c0)[_0xefd5('0x24')](function(_0x30ebc2){_0x34624f[_0xefd5('0x1d')]=_0x30ebc2;if(_0x8230ca[_0xefd5('0x33')][_0xefd5('0x43')]){_0x4bf7a6[_0xefd5('0x44')]=[{'all':!![]}];}return db[_0xefd5('0x2d')][_0xefd5('0x45')](_0x4bf7a6);})['then'](function(_0x28978f){_0x34624f[_0xefd5('0x46')]=_0x28978f;return _0x34624f;})[_0xefd5('0x24')](respondWithFilteredResult(_0x531734,_0x4bf7a6))[_0xefd5('0x47')](handleError(_0x531734,null));};exports[_0xefd5('0x48')]=function(_0x4d108c,_0x818997){var _0x456757={'raw':![],'where':{'id':_0x4d108c[_0xefd5('0x49')]['id']}},_0x5814c2={};_0x5814c2[_0xefd5('0x31')]=_['keys'](db[_0xefd5('0x2d')][_0xefd5('0x2e')]);_0x5814c2[_0xefd5('0x33')]=_[_0xefd5('0x4a')](_0x4d108c[_0xefd5('0x33')]);_0x5814c2['filters']=_[_0xefd5('0x35')](_0x5814c2[_0xefd5('0x31')],_0x5814c2[_0xefd5('0x33')]);_0x456757[_0xefd5('0x37')]=_[_0xefd5('0x35')](_0x5814c2[_0xefd5('0x31')],qs['fields'](_0x4d108c[_0xefd5('0x33')][_0xefd5('0x36')]));_0x456757[_0xefd5('0x37')]=_0x456757[_0xefd5('0x37')][_0xefd5('0x38')]?_0x456757[_0xefd5('0x37')]:_0x5814c2[_0xefd5('0x31')];if(_0x4d108c[_0xefd5('0x33')][_0xefd5('0x43')]){_0x456757['include']=[{'all':!![]}];}_0x456757=_[_0xefd5('0x40')]({},_0x456757,_0x4d108c['options']);return db[_0xefd5('0x2d')][_0xefd5('0x4b')](_0x456757)[_0xefd5('0x24')](handleEntityNotFound(_0x818997,null))[_0xefd5('0x24')](respondWithResult(_0x818997,null))[_0xefd5('0x47')](handleError(_0x818997,null));};exports[_0xefd5('0x23')]=function(_0x4dca4e,_0x485a96){if(_0x4dca4e[_0xefd5('0x4c')]['id']){delete _0x4dca4e[_0xefd5('0x4c')]['id'];}return db[_0xefd5('0x2d')][_0xefd5('0x4b')]({'where':{'id':_0x4dca4e[_0xefd5('0x49')]['id']}})[_0xefd5('0x24')](handleEntityNotFound(_0x485a96,null))[_0xefd5('0x24')](saveUpdates(_0x4dca4e[_0xefd5('0x4c')],null))[_0xefd5('0x24')](respondWithResult(_0x485a96,null))[_0xefd5('0x47')](handleError(_0x485a96,null));};exports[_0xefd5('0x4d')]=function(_0x4cfed9,_0x4c8166,_0x189b30){return db[_0xefd5('0x4e')]['transaction'](function(_0x1e4b5f){if(_0x4cfed9['body'][_0xefd5('0x4f')]===_0xefd5('0x50')){_0x4cfed9[_0xefd5('0x4c')][_0xefd5('0x51')]=path[_0xefd5('0x52')](config[_0xefd5('0x53')],_0xefd5('0x54'),_0x4cfed9[_0xefd5('0x4c')][_0xefd5('0x2a')]);}return db['VoiceMusicOnHold'][_0xefd5('0x4d')](_0x4cfed9[_0xefd5('0x4c')],{'transaction':_0x1e4b5f})['then'](function(_0x17bec8){if(_0x4cfed9['body'][_0xefd5('0x4f')]==='files'){fs[_0xefd5('0x55')](_0x17bec8[_0xefd5('0x51')],parseInt('0777',0x8));}var _0x4afb72=_0x4cfed9[_0xefd5('0x56')]['get']({'plain':!![]});if(!_0x4afb72)throw new Error(_0xefd5('0x57'));if(_0x4afb72[_0xefd5('0x58')]===_0xefd5('0x56')){var _0x69f8d=_0x17bec8[_0xefd5('0x25')]({'plain':!![]});return db[_0xefd5('0x59')]['find']({'where':{'name':_0xefd5('0x5a'),'userProfileId':_0x4afb72['userProfileId']},'raw':!![]})[_0xefd5('0x24')](function(_0x24078c){if(_0x24078c&&_0x24078c[_0xefd5('0x5b')]===0x0){return db['UserProfileResource'][_0xefd5('0x4d')]({'name':_0x69f8d[_0xefd5('0x2a')],'resourceId':_0x69f8d['id'],'type':_0x24078c[_0xefd5('0x2a')],'sectionId':_0x24078c['id']},{})[_0xefd5('0x24')](function(){return _0x17bec8;});}else{return _0x17bec8;}})[_0xefd5('0x47')](function(_0x5daad9){logger[_0xefd5('0x28')](_0xefd5('0x5c'),_0x5daad9);});}return _0x17bec8;});})[_0xefd5('0x24')](respondWithResult(_0x4c8166,0xc9))['catch'](handleError(_0x4c8166,null));};exports[_0xefd5('0x26')]=function(_0x4e3449,_0x507cc9,_0x5359d5){var _0x2050ba;return db[_0xefd5('0x2d')][_0xefd5('0x4b')]({'where':{'id':_0x4e3449[_0xefd5('0x49')]['id']}})['then'](function(_0x564f92){if(_0x564f92){return db['sequelize'][_0xefd5('0x5d')](function(_0x401bfc){return _0x564f92[_0xefd5('0x26')]({'transaction':_0x401bfc,'raw':!![]})[_0xefd5('0x24')](function(_0x49f8ab){if(_0x49f8ab[_0xefd5('0x51')]){fs['readdirSync'](_0x49f8ab['directory'])['forEach'](function(_0x300576){fs[_0xefd5('0x5e')](path[_0xefd5('0x52')](_0x49f8ab[_0xefd5('0x51')],_0x300576));});fs['rmdirSync'](_0x49f8ab['directory']);}return _0x49f8ab;});})['catch'](function(_0x49bd00){throw new db['Sequelize'][(_0xefd5('0x5f'))](_0x49bd00[_0xefd5('0x60')]);});}})[_0xefd5('0x24')](handleEntityNotFound(_0x507cc9,null))[_0xefd5('0x24')](removeEntity(_0x507cc9,null))[_0xefd5('0x47')](handleError(_0x507cc9,null));};exports[_0xefd5('0x61')]=function(_0x2d002c,_0x59aa52,_0xd3cee4){return db[_0xefd5('0x4e')][_0xefd5('0x5d')](function(_0x111aba){var _0xc8286e;return db[_0xefd5('0x2d')]['find']({'where':{'id':_0x2d002c[_0xefd5('0x49')]['id']}})[_0xefd5('0x24')](function(_0x548e07){if(_0x548e07){_0xc8286e=_0x548e07;return _0x548e07[_0xefd5('0x61')](_0x2d002c[_0xefd5('0x4c')]['id'],{'transaction':_0x111aba});}})[_0xefd5('0x24')](function(_0x2fe398){if(_0x2fe398){return db[_0xefd5('0x62')][_0xefd5('0x63')]({'where':{'id':_0x2d002c[_0xefd5('0x4c')]['id']},'attributes':['id',_0xefd5('0x2a'),_0xefd5('0x64'),_0xefd5('0x65'),_0xefd5('0x66')],'raw':!![]});}})[_0xefd5('0x24')](function(_0x28a138){if(_0x28a138){var _0x338345=path[_0xefd5('0x52')](config['root'],_0xefd5('0x67'),util['format'](_0xefd5('0x68'),path[_0xefd5('0x69')](_0x28a138[_0xefd5('0x64')],path[_0xefd5('0x6a')](_0x28a138[_0xefd5('0x64')])),_0x28a138['converted_format']));var _0xd0f592=path[_0xefd5('0x52')](config[_0xefd5('0x53')],_0xefd5('0x54'),_0xc8286e[_0xefd5('0x2a')],util['format'](_0xefd5('0x68'),_0x28a138[_0xefd5('0x2a')],_0x28a138[_0xefd5('0x65')]));fs['symlinkSync'](_0x338345,_0xd0f592);return _0x28a138;}})[_0xefd5('0x47')](function(_0x326753){throw new db[(_0xefd5('0x6b'))][(_0xefd5('0x5f'))](_0x326753[_0xefd5('0x60')]);});})[_0xefd5('0x24')](handleEntityNotFound(_0x59aa52,null))[_0xefd5('0x24')](respondWithResult(_0x59aa52,0xc9))[_0xefd5('0x47')](handleError(_0x59aa52,null));};exports[_0xefd5('0x6c')]=function(_0xbb8c63,_0x5bd269,_0x33813a){return db[_0xefd5('0x4e')]['transaction'](function(_0x653e46){var _0x4aa167;return db['VoiceMusicOnHold'][_0xefd5('0x63')]({'where':{'id':_0xbb8c63['params']['id']}})[_0xefd5('0x24')](handleEntityNotFound(_0x5bd269,null))['then'](function(_0x2d4fc0){if(_0x2d4fc0){_0x4aa167=_0x2d4fc0;return _0x2d4fc0[_0xefd5('0x6c')](_0xbb8c63[_0xefd5('0x49')][_0xefd5('0x6d')]);}})[_0xefd5('0x24')](function(_0x56684f){if(_0x56684f){return db[_0xefd5('0x62')][_0xefd5('0x63')]({'where':{'id':_0xbb8c63[_0xefd5('0x49')][_0xefd5('0x6d')]},'attributes':['id','name','save_name',_0xefd5('0x65'),_0xefd5('0x66')],'raw':!![]});}})[_0xefd5('0x24')](function(_0x5c8f83){if(_0x5c8f83){fs[_0xefd5('0x5e')](path[_0xefd5('0x52')](_0x4aa167[_0xefd5('0x51')],util[_0xefd5('0x6e')](_0xefd5('0x68'),_0x5c8f83[_0xefd5('0x2a')],_0x5c8f83[_0xefd5('0x65')])));return _0x5c8f83;}})['catch'](function(_0x42c9ee){throw new db['Sequelize']['ValidationError'](_0x42c9ee['message']);});})[_0xefd5('0x24')](handleEntityNotFound(_0x5bd269,null))[_0xefd5('0x24')](respondWithStatusCode(_0x5bd269,0xcc))[_0xefd5('0x47')](handleError(_0x5bd269,null));};exports[_0xefd5('0x6f')]=function(_0x4f28e0,_0xf1dff4,_0x55bb6a){var _0x274390={};var _0x403272={};var _0x53cbd4;var _0x2d296a;return db[_0xefd5('0x2d')][_0xefd5('0x63')]({'where':{'id':_0x4f28e0[_0xefd5('0x49')]['id']}})[_0xefd5('0x24')](handleEntityNotFound(_0xf1dff4,null))[_0xefd5('0x24')](function(_0x46c67b){if(_0x46c67b){_0x53cbd4=_0x46c67b;_0x403272[_0xefd5('0x31')]=_[_0xefd5('0x4a')](db[_0xefd5('0x62')][_0xefd5('0x2e')]);_0x403272[_0xefd5('0x33')]=_[_0xefd5('0x4a')](_0x4f28e0['query']);_0x403272[_0xefd5('0x34')]=_[_0xefd5('0x35')](_0x403272[_0xefd5('0x31')],_0x403272[_0xefd5('0x33')]);_0x274390['attributes']=_[_0xefd5('0x35')](_0x403272[_0xefd5('0x31')],qs['fields'](_0x4f28e0[_0xefd5('0x33')][_0xefd5('0x36')]));_0x274390[_0xefd5('0x37')]=_0x274390[_0xefd5('0x37')][_0xefd5('0x38')]?_0x274390[_0xefd5('0x37')]:_0x403272[_0xefd5('0x31')];_0x274390[_0xefd5('0x3b')]=qs[_0xefd5('0x3c')](_0x4f28e0[_0xefd5('0x33')][_0xefd5('0x3c')]);_0x274390[_0xefd5('0x3d')]=qs[_0xefd5('0x34')](_[_0xefd5('0x3e')](_0x4f28e0[_0xefd5('0x33')],_0x403272[_0xefd5('0x34')]));if(_0x4f28e0[_0xefd5('0x33')][_0xefd5('0x3f')]){_0x274390[_0xefd5('0x3d')]=_[_0xefd5('0x40')](_0x274390[_0xefd5('0x3d')],{'$or':_[_0xefd5('0x32')](_0x274390[_0xefd5('0x37')],function(_0x39fe4b){var _0x4b8935={};_0x4b8935[_0x39fe4b]={'$like':'%'+_0x4f28e0[_0xefd5('0x33')][_0xefd5('0x3f')]+'%'};return _0x4b8935;})});}_0x274390=_[_0xefd5('0x40')]({},_0x274390,_0x4f28e0[_0xefd5('0x42')]);return _0x53cbd4[_0xefd5('0x6f')](_0x274390);}})[_0xefd5('0x24')](function(_0xe39211){if(_0xe39211){_0x2d296a=_0xe39211[_0xefd5('0x38')];if(!_0x4f28e0[_0xefd5('0x33')][_0xefd5('0x39')](_0xefd5('0x3a'))){_0x274390[_0xefd5('0x1c')]=qs[_0xefd5('0x1c')](_0x4f28e0[_0xefd5('0x33')][_0xefd5('0x1c')]);_0x274390['offset']=qs['offset'](_0x4f28e0[_0xefd5('0x33')]['offset']);}return _0x53cbd4[_0xefd5('0x6f')](_0x274390);}})[_0xefd5('0x24')](function(_0x3aef73){if(_0x3aef73){return _0x3aef73?{'count':_0x2d296a,'rows':_0x3aef73}:null;}})[_0xefd5('0x24')](respondWithResult(_0xf1dff4,null))[_0xefd5('0x47')](handleError(_0xf1dff4,null));}; \ No newline at end of file +var _0x626f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','sequelize','mode','files','directory','join','root','server/files/moh','create','mkdirSync','0777','user','get','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','rmdirSync','Sequelize','message','addSound','findOne','format','save_name','extname','converted_format','%s.%s','symlinkSync','removeSound','Sound','createdAt','unlinkSync','ValidationError','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x451735,_0x391a76){var _0x41d1e2=function(_0x3566d7){while(--_0x3566d7){_0x451735['push'](_0x451735['shift']());}};_0x41d1e2(++_0x391a76);}(_0x626f,0x116));var _0xf626=function(_0x20545f,_0x2dadb2){_0x20545f=_0x20545f-0x0;var _0x54f142=_0x626f[_0x20545f];return _0x54f142;};'use strict';var emlformat=require(_0xf626('0x0'));var rimraf=require(_0xf626('0x1'));var zipdir=require(_0xf626('0x2'));var jsonpatch=require(_0xf626('0x3'));var rp=require(_0xf626('0x4'));var moment=require(_0xf626('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf626('0x6'));var path=require('path');var sox=require(_0xf626('0x7'));var csv=require(_0xf626('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf626('0x9'));var _=require(_0xf626('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf626('0xb'));var deskjs=require(_0xf626('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf626('0xd'));var Papa=require(_0xf626('0xe'));var Redis=require('ioredis');var authService=require(_0xf626('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf626('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf626('0x11'))('api');var utils=require(_0xf626('0x12'));var config=require(_0xf626('0x13'));var licenseUtil=require(_0xf626('0x14'));var db=require(_0xf626('0x15'))['db'];function respondWithStatusCode(_0x1b339a,_0x24d07f){_0x24d07f=_0x24d07f||0xcc;return function(_0x24dd29){if(_0x24dd29){return _0x1b339a[_0xf626('0x16')](_0x24d07f);}return _0x1b339a[_0xf626('0x17')](_0x24d07f)['end']();};}function respondWithResult(_0x135c47,_0x3b46bb){_0x3b46bb=_0x3b46bb||0xc8;return function(_0xb3f618){if(_0xb3f618){return _0x135c47[_0xf626('0x17')](_0x3b46bb)[_0xf626('0x18')](_0xb3f618);}};}function respondWithFilteredResult(_0x4347c5,_0x1d75d6){return function(_0x1fe3d3){if(_0x1fe3d3){var _0x4a1dd1=typeof _0x1d75d6[_0xf626('0x19')]==='undefined'&&typeof _0x1d75d6[_0xf626('0x1a')]===_0xf626('0x1b');var _0x5c3efd=_0x1fe3d3[_0xf626('0x1c')];var _0x527f88=_0x4a1dd1?0x0:_0x1d75d6[_0xf626('0x19')];var _0x29f5c3=_0x4a1dd1?_0x1fe3d3['count']:_0x1d75d6[_0xf626('0x19')]+_0x1d75d6[_0xf626('0x1a')];var _0x4655cc;if(_0x29f5c3>=_0x5c3efd){_0x29f5c3=_0x5c3efd;_0x4655cc=0xc8;}else{_0x4655cc=0xce;}_0x4347c5['status'](_0x4655cc);return _0x4347c5[_0xf626('0x1d')](_0xf626('0x1e'),_0x527f88+'-'+_0x29f5c3+'/'+_0x5c3efd)[_0xf626('0x18')](_0x1fe3d3);}return null;};}function patchUpdates(_0x350b1c){return function(_0x2003df){try{jsonpatch[_0xf626('0x1f')](_0x2003df,_0x350b1c,!![]);}catch(_0x65db8f){return BPromise[_0xf626('0x20')](_0x65db8f);}return _0x2003df[_0xf626('0x21')]();};}function saveUpdates(_0x2c89a1,_0x10392b){return function(_0x5eb41e){if(_0x5eb41e){return _0x5eb41e[_0xf626('0x22')](_0x2c89a1)[_0xf626('0x23')](function(_0x561074){return _0x561074;});}return null;};}function removeEntity(_0x343f57,_0x31f269){return function(_0x4d38c7){if(_0x4d38c7){return _0x4d38c7[_0xf626('0x24')]()['then'](function(){var _0x11d14d=_0x4d38c7['get']({'plain':!![]});var _0x1a2b39=_0xf626('0x25');return db[_0xf626('0x26')][_0xf626('0x24')]({'where':{'type':_0x1a2b39,'resourceId':_0x11d14d['id']}})[_0xf626('0x23')](function(){return _0x4d38c7;});})[_0xf626('0x23')](function(){_0x343f57[_0xf626('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d1000,_0x4f41a0){return function(_0x2f483c){if(!_0x2f483c){_0x5d1000[_0xf626('0x16')](0x194);}return _0x2f483c;};}function handleError(_0x47b41c,_0x27ffb5){_0x27ffb5=_0x27ffb5||0x1f4;return function(_0x59a956){logger[_0xf626('0x27')](_0x59a956[_0xf626('0x28')]);if(_0x59a956[_0xf626('0x29')]){delete _0x59a956[_0xf626('0x29')];}_0x47b41c[_0xf626('0x17')](_0x27ffb5)[_0xf626('0x2a')](_0x59a956);};}exports[_0xf626('0x2b')]=function(_0x218728,_0x1dbd50){var _0x3b47cb={},_0x418a05={},_0x30f87c={'count':0x0,'rows':[]};var _0x3be1ea=_[_0xf626('0x2c')](db[_0xf626('0x2d')][_0xf626('0x2e')],function(_0x5df7da){return{'name':_0x5df7da[_0xf626('0x2f')],'type':_0x5df7da[_0xf626('0x30')][_0xf626('0x31')]};});_0x418a05[_0xf626('0x32')]=_['map'](_0x3be1ea,_0xf626('0x29'));_0x418a05[_0xf626('0x33')]=_[_0xf626('0x34')](_0x218728[_0xf626('0x33')]);_0x418a05[_0xf626('0x35')]=_[_0xf626('0x36')](_0x418a05[_0xf626('0x32')],_0x418a05[_0xf626('0x33')]);_0x3b47cb[_0xf626('0x37')]=_['intersection'](_0x418a05['model'],qs[_0xf626('0x38')](_0x218728[_0xf626('0x33')][_0xf626('0x38')]));_0x3b47cb[_0xf626('0x37')]=_0x3b47cb[_0xf626('0x37')][_0xf626('0x39')]?_0x3b47cb[_0xf626('0x37')]:_0x418a05[_0xf626('0x32')];if(!_0x218728['query'][_0xf626('0x3a')](_0xf626('0x3b'))){_0x3b47cb[_0xf626('0x1a')]=qs[_0xf626('0x1a')](_0x218728[_0xf626('0x33')][_0xf626('0x1a')]);_0x3b47cb[_0xf626('0x19')]=qs[_0xf626('0x19')](_0x218728[_0xf626('0x33')][_0xf626('0x19')]);}_0x3b47cb[_0xf626('0x3c')]=qs[_0xf626('0x3d')](_0x218728[_0xf626('0x33')]['sort']);delete _0x218728['query']['sort'];_0x3b47cb['where']=qs['filters'](_[_0xf626('0x3e')](_0x218728['query'],_0x418a05['filters']),_0x3be1ea);if(_0x218728[_0xf626('0x33')][_0xf626('0x3f')]){_0x3b47cb[_0xf626('0x40')]=_['merge'](_0x3b47cb[_0xf626('0x40')],{'$or':_[_0xf626('0x2c')](_0x3be1ea,function(_0x3929aa){if(_0x3929aa[_0xf626('0x30')]!==_0xf626('0x41')){var _0x5b49b7={};_0x5b49b7[_0x3929aa[_0xf626('0x29')]]={'$like':'%'+_0x218728[_0xf626('0x33')][_0xf626('0x3f')]+'%'};return _0x5b49b7;}})});}_0x3b47cb=_[_0xf626('0x42')]({},_0x3b47cb,_0x218728[_0xf626('0x43')]);var _0x44323c={'where':_0x3b47cb[_0xf626('0x40')]};return db[_0xf626('0x2d')][_0xf626('0x1c')](_0x44323c)[_0xf626('0x23')](function(_0x279887){_0x30f87c[_0xf626('0x1c')]=_0x279887;if(_0x218728[_0xf626('0x33')][_0xf626('0x44')]){_0x3b47cb[_0xf626('0x45')]=[{'all':!![]}];}return db[_0xf626('0x2d')][_0xf626('0x46')](_0x3b47cb);})[_0xf626('0x23')](function(_0x255a82){_0x30f87c[_0xf626('0x47')]=_0x255a82;return _0x30f87c;})[_0xf626('0x23')](respondWithFilteredResult(_0x1dbd50,_0x3b47cb))[_0xf626('0x48')](handleError(_0x1dbd50,null));};exports[_0xf626('0x49')]=function(_0x2d413e,_0x4abe05){var _0x2f5b11={'raw':![],'where':{'id':_0x2d413e[_0xf626('0x4a')]['id']}},_0x34fd7f={};_0x34fd7f[_0xf626('0x32')]=_[_0xf626('0x34')](db[_0xf626('0x2d')]['rawAttributes']);_0x34fd7f[_0xf626('0x33')]=_[_0xf626('0x34')](_0x2d413e[_0xf626('0x33')]);_0x34fd7f[_0xf626('0x35')]=_['intersection'](_0x34fd7f[_0xf626('0x32')],_0x34fd7f['query']);_0x2f5b11[_0xf626('0x37')]=_[_0xf626('0x36')](_0x34fd7f[_0xf626('0x32')],qs[_0xf626('0x38')](_0x2d413e[_0xf626('0x33')][_0xf626('0x38')]));_0x2f5b11[_0xf626('0x37')]=_0x2f5b11[_0xf626('0x37')]['length']?_0x2f5b11[_0xf626('0x37')]:_0x34fd7f[_0xf626('0x32')];if(_0x2d413e['query'][_0xf626('0x44')]){_0x2f5b11[_0xf626('0x45')]=[{'all':!![]}];}_0x2f5b11=_[_0xf626('0x42')]({},_0x2f5b11,_0x2d413e[_0xf626('0x43')]);return db[_0xf626('0x2d')][_0xf626('0x4b')](_0x2f5b11)[_0xf626('0x23')](handleEntityNotFound(_0x4abe05,null))['then'](respondWithResult(_0x4abe05,null))['catch'](handleError(_0x4abe05,null));};exports[_0xf626('0x22')]=function(_0x79fc35,_0x5201c0){if(_0x79fc35[_0xf626('0x4c')]['id']){delete _0x79fc35[_0xf626('0x4c')]['id'];}return db['VoiceMusicOnHold'][_0xf626('0x4b')]({'where':{'id':_0x79fc35['params']['id']}})[_0xf626('0x23')](handleEntityNotFound(_0x5201c0,null))[_0xf626('0x23')](saveUpdates(_0x79fc35[_0xf626('0x4c')],null))['then'](respondWithResult(_0x5201c0,null))['catch'](handleError(_0x5201c0,null));};exports['create']=function(_0x24b820,_0x24fef2,_0x261301){return db[_0xf626('0x4d')]['transaction'](function(_0xeb9cb3){if(_0x24b820[_0xf626('0x4c')][_0xf626('0x4e')]===_0xf626('0x4f')){_0x24b820['body'][_0xf626('0x50')]=path[_0xf626('0x51')](config[_0xf626('0x52')],_0xf626('0x53'),_0x24b820['body']['name']);}return db[_0xf626('0x2d')][_0xf626('0x54')](_0x24b820[_0xf626('0x4c')],{'transaction':_0xeb9cb3})[_0xf626('0x23')](function(_0x15012c){if(_0x24b820['body'][_0xf626('0x4e')]===_0xf626('0x4f')){fs[_0xf626('0x55')](_0x15012c[_0xf626('0x50')],parseInt(_0xf626('0x56'),0x8));}var _0x2bc35f=_0x24b820[_0xf626('0x57')][_0xf626('0x58')]({'plain':!![]});if(!_0x2bc35f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bc35f[_0xf626('0x59')]===_0xf626('0x57')){var _0x1f9361=_0x15012c[_0xf626('0x58')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xf626('0x25'),'userProfileId':_0x2bc35f['userProfileId']},'raw':!![]})['then'](function(_0x4c7490){if(_0x4c7490&&_0x4c7490[_0xf626('0x5a')]===0x0){return db[_0xf626('0x26')][_0xf626('0x54')]({'name':_0x1f9361[_0xf626('0x29')],'resourceId':_0x1f9361['id'],'type':_0x4c7490[_0xf626('0x29')],'sectionId':_0x4c7490['id']},{})['then'](function(){return _0x15012c;});}else{return _0x15012c;}})[_0xf626('0x48')](function(_0x4b9630){logger[_0xf626('0x27')](_0xf626('0x5b'),_0x4b9630);});}return _0x15012c;});})[_0xf626('0x23')](respondWithResult(_0x24fef2,0xc9))[_0xf626('0x48')](handleError(_0x24fef2,null));};exports[_0xf626('0x24')]=function(_0x183e3f,_0x1098bd,_0x1c4876){var _0x5f164d;return db[_0xf626('0x2d')][_0xf626('0x4b')]({'where':{'id':_0x183e3f[_0xf626('0x4a')]['id']}})[_0xf626('0x23')](function(_0x106202){if(_0x106202){return db[_0xf626('0x4d')][_0xf626('0x5c')](function(_0x374f21){return _0x106202[_0xf626('0x24')]({'transaction':_0x374f21,'raw':!![]})[_0xf626('0x23')](function(_0x3f125e){if(_0x3f125e[_0xf626('0x50')]){fs[_0xf626('0x5d')](_0x3f125e[_0xf626('0x50')])['forEach'](function(_0x12e83f){fs['unlinkSync'](path[_0xf626('0x51')](_0x3f125e['directory'],_0x12e83f));});fs[_0xf626('0x5e')](_0x3f125e[_0xf626('0x50')]);}return _0x3f125e;});})[_0xf626('0x48')](function(_0x3c47bc){throw new db[(_0xf626('0x5f'))]['ValidationError'](_0x3c47bc[_0xf626('0x60')]);});}})[_0xf626('0x23')](handleEntityNotFound(_0x1098bd,null))['then'](removeEntity(_0x1098bd,null))[_0xf626('0x48')](handleError(_0x1098bd,null));};exports[_0xf626('0x61')]=function(_0x52a52b,_0x1a7901,_0x621c59){return db[_0xf626('0x4d')][_0xf626('0x5c')](function(_0x476cfc){var _0x14eab5;return db['VoiceMusicOnHold'][_0xf626('0x4b')]({'where':{'id':_0x52a52b[_0xf626('0x4a')]['id']}})[_0xf626('0x23')](function(_0x82ed16){if(_0x82ed16){_0x14eab5=_0x82ed16;return _0x82ed16[_0xf626('0x61')](_0x52a52b[_0xf626('0x4c')]['id'],{'transaction':_0x476cfc});}})[_0xf626('0x23')](function(_0x58a5a8){if(_0x58a5a8){return db['Sound'][_0xf626('0x62')]({'where':{'id':_0x52a52b[_0xf626('0x4c')]['id']},'attributes':['id',_0xf626('0x29'),'save_name','converted_format','createdAt'],'raw':!![]});}})['then'](function(_0x25ce54){if(_0x25ce54){var _0x405432=path[_0xf626('0x51')](config[_0xf626('0x52')],'server/files/sounds/converted',util[_0xf626('0x63')]('%s.%s',path['basename'](_0x25ce54[_0xf626('0x64')],path[_0xf626('0x65')](_0x25ce54[_0xf626('0x64')])),_0x25ce54[_0xf626('0x66')]));var _0x144d69=path[_0xf626('0x51')](config[_0xf626('0x52')],_0xf626('0x53'),_0x14eab5[_0xf626('0x29')],util[_0xf626('0x63')](_0xf626('0x67'),_0x25ce54[_0xf626('0x29')],_0x25ce54['converted_format']));fs[_0xf626('0x68')](_0x405432,_0x144d69);return _0x25ce54;}})[_0xf626('0x48')](function(_0x1f6db6){throw new db[(_0xf626('0x5f'))]['ValidationError'](_0x1f6db6[_0xf626('0x60')]);});})[_0xf626('0x23')](handleEntityNotFound(_0x1a7901,null))['then'](respondWithResult(_0x1a7901,0xc9))[_0xf626('0x48')](handleError(_0x1a7901,null));};exports[_0xf626('0x69')]=function(_0x50d20b,_0x511355,_0x459f36){return db['sequelize'][_0xf626('0x5c')](function(_0x5a10ca){var _0x412609;return db[_0xf626('0x2d')][_0xf626('0x62')]({'where':{'id':_0x50d20b['params']['id']}})[_0xf626('0x23')](handleEntityNotFound(_0x511355,null))[_0xf626('0x23')](function(_0x173a80){if(_0x173a80){_0x412609=_0x173a80;return _0x173a80[_0xf626('0x69')](_0x50d20b[_0xf626('0x4a')]['id2']);}})[_0xf626('0x23')](function(_0x4a8748){if(_0x4a8748){return db[_0xf626('0x6a')][_0xf626('0x62')]({'where':{'id':_0x50d20b['params']['id2']},'attributes':['id','name',_0xf626('0x64'),'converted_format',_0xf626('0x6b')],'raw':!![]});}})[_0xf626('0x23')](function(_0x43fdd1){if(_0x43fdd1){fs[_0xf626('0x6c')](path[_0xf626('0x51')](_0x412609[_0xf626('0x50')],util[_0xf626('0x63')](_0xf626('0x67'),_0x43fdd1['name'],_0x43fdd1['converted_format'])));return _0x43fdd1;}})[_0xf626('0x48')](function(_0xab581d){throw new db[(_0xf626('0x5f'))][(_0xf626('0x6d'))](_0xab581d[_0xf626('0x60')]);});})[_0xf626('0x23')](handleEntityNotFound(_0x511355,null))[_0xf626('0x23')](respondWithStatusCode(_0x511355,0xcc))[_0xf626('0x48')](handleError(_0x511355,null));};exports['getSounds']=function(_0x57c797,_0x481260,_0x248612){var _0x345310={};var _0x2cc8bd={};var _0x4d6fe8;var _0x83b746;return db[_0xf626('0x2d')][_0xf626('0x62')]({'where':{'id':_0x57c797[_0xf626('0x4a')]['id']}})[_0xf626('0x23')](handleEntityNotFound(_0x481260,null))[_0xf626('0x23')](function(_0x451d12){if(_0x451d12){_0x4d6fe8=_0x451d12;_0x2cc8bd[_0xf626('0x32')]=_[_0xf626('0x34')](db[_0xf626('0x6a')][_0xf626('0x2e')]);_0x2cc8bd[_0xf626('0x33')]=_[_0xf626('0x34')](_0x57c797[_0xf626('0x33')]);_0x2cc8bd[_0xf626('0x35')]=_[_0xf626('0x36')](_0x2cc8bd[_0xf626('0x32')],_0x2cc8bd[_0xf626('0x33')]);_0x345310[_0xf626('0x37')]=_[_0xf626('0x36')](_0x2cc8bd[_0xf626('0x32')],qs['fields'](_0x57c797['query'][_0xf626('0x38')]));_0x345310[_0xf626('0x37')]=_0x345310[_0xf626('0x37')][_0xf626('0x39')]?_0x345310[_0xf626('0x37')]:_0x2cc8bd[_0xf626('0x32')];_0x345310[_0xf626('0x3c')]=qs[_0xf626('0x3d')](_0x57c797[_0xf626('0x33')][_0xf626('0x3d')]);_0x345310[_0xf626('0x40')]=qs[_0xf626('0x35')](_[_0xf626('0x3e')](_0x57c797[_0xf626('0x33')],_0x2cc8bd[_0xf626('0x35')]));if(_0x57c797[_0xf626('0x33')][_0xf626('0x3f')]){_0x345310['where']=_['merge'](_0x345310['where'],{'$or':_[_0xf626('0x2c')](_0x345310['attributes'],function(_0x4f19dd){var _0x526305={};_0x526305[_0x4f19dd]={'$like':'%'+_0x57c797[_0xf626('0x33')]['filter']+'%'};return _0x526305;})});}_0x345310=_[_0xf626('0x42')]({},_0x345310,_0x57c797['options']);return _0x4d6fe8[_0xf626('0x6e')](_0x345310);}})[_0xf626('0x23')](function(_0x139e9a){if(_0x139e9a){_0x83b746=_0x139e9a['length'];if(!_0x57c797['query'][_0xf626('0x3a')](_0xf626('0x3b'))){_0x345310[_0xf626('0x1a')]=qs[_0xf626('0x1a')](_0x57c797[_0xf626('0x33')]['limit']);_0x345310[_0xf626('0x19')]=qs[_0xf626('0x19')](_0x57c797[_0xf626('0x33')][_0xf626('0x19')]);}return _0x4d6fe8[_0xf626('0x6e')](_0x345310);}})['then'](function(_0x59eda3){if(_0x59eda3){return _0x59eda3?{'count':_0x83b746,'rows':_0x59eda3}:null;}})['then'](respondWithResult(_0x481260,null))['catch'](handleError(_0x481260,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 29452b1..46bcbc4 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 _0x5b0f=['request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x44fef1,_0x132cf4){var _0x3c3a04=function(_0x175a90){while(--_0x175a90){_0x44fef1['push'](_0x44fef1['shift']());}};_0x3c3a04(++_0x132cf4);}(_0x5b0f,0x1c8));var _0xf5b0=function(_0x50c7e5,_0x380f0f){_0x50c7e5=_0x50c7e5-0x0;var _0x108f56=_0x5b0f[_0x50c7e5];return _0x108f56;};'use strict';var _=require(_0xf5b0('0x0'));var util=require(_0xf5b0('0x1'));var logger=require(_0xf5b0('0x2'))(_0xf5b0('0x3'));var moment=require(_0xf5b0('0x4'));var BPromise=require(_0xf5b0('0x5'));var rp=require(_0xf5b0('0x6'));var fs=require('fs');var path=require(_0xf5b0('0x7'));var rimraf=require(_0xf5b0('0x8'));var config=require(_0xf5b0('0x9'));var attributes=require(_0xf5b0('0xa'));module[_0xf5b0('0xb')]=function(_0x4278a1,_0x2787c5){return _0x4278a1[_0xf5b0('0xc')]('VoiceMusicOnHold',attributes,{'tableName':_0xf5b0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0937=['request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','bluebird'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0x0937,0x191));var _0x7093=function(_0x416c71,_0x368c7c){_0x416c71=_0x416c71-0x0;var _0x11a486=_0x0937[_0x416c71];return _0x11a486;};'use strict';var _=require('lodash');var util=require(_0x7093('0x0'));var logger=require(_0x7093('0x1'))(_0x7093('0x2'));var moment=require(_0x7093('0x3'));var BPromise=require(_0x7093('0x4'));var rp=require(_0x7093('0x5'));var fs=require('fs');var path=require(_0x7093('0x6'));var rimraf=require(_0x7093('0x7'));var config=require(_0x7093('0x8'));var attributes=require(_0x7093('0x9'));module[_0x7093('0xa')]=function(_0x14965a,_0x9cc544){return _0x14965a[_0x7093('0xb')](_0x7093('0xc'),attributes,{'tableName':_0x7093('0xd'),'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 3ad303d..562a5fd 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x33b17b,_0x25d54d){var _0x8f5ee=function(_0x1d2aa9){while(--_0x1d2aa9){_0x33b17b['push'](_0x33b17b['shift']());}};_0x8f5ee(++_0x25d54d);}(_0xe706,0xa3));var _0x6e70=function(_0x202c99,_0x121caf){_0x202c99=_0x202c99-0x0;var _0x256a0f=_0xe706[_0x202c99];return _0x256a0f;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x131611,_0x36584b){var _0x32925b=function(_0x58a21c){while(--_0x58a21c){_0x131611['push'](_0x131611['shift']());}};_0x32925b(++_0x36584b);}(_0x34e8,0x12c));var _0x834e=function(_0x58cdc1,_0x3dca71){_0x58cdc1=_0x58cdc1-0x0;var _0x53a268=_0x34e8[_0x58cdc1];return _0x53a268;};'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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 02c2b41..f6f15cf 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 _0x0d0b=['../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','describe','show','getAgents','/:id/teams','getTeams','post','create','put','/:id','update','delete','/:id/users','removeAgents','removeTeams','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x0d0b,0x1ef));var _0xb0d0=function(_0x1aa3c9,_0x36e605){_0x1aa3c9=_0x1aa3c9-0x0;var _0x1be779=_0x0d0b[_0x1aa3c9];return _0x1be779;};'use strict';var multer=require('multer');var util=require(_0xb0d0('0x0'));var path=require('path');var timeout=require(_0xb0d0('0x1'));var express=require('express');var router=express[_0xb0d0('0x2')]();var fs_extra=require(_0xb0d0('0x3'));var auth=require(_0xb0d0('0x4'));var interaction=require(_0xb0d0('0x5'));var config=require(_0xb0d0('0x6'));var controller=require(_0xb0d0('0x7'));router[_0xb0d0('0x8')]('/',auth[_0xb0d0('0x9')](),controller['index']);router[_0xb0d0('0x8')](_0xb0d0('0xa'),auth[_0xb0d0('0x9')](),controller[_0xb0d0('0xb')]);router[_0xb0d0('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb0d0('0xc')]);router[_0xb0d0('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0xb0d0('0xd')]);router[_0xb0d0('0x8')](_0xb0d0('0xe'),auth[_0xb0d0('0x9')](),controller[_0xb0d0('0xf')]);router[_0xb0d0('0x10')]('/',auth['isAuthenticated'](),controller[_0xb0d0('0x11')]);router[_0xb0d0('0x10')]('/:id/users',auth[_0xb0d0('0x9')](),controller['addAgents']);router[_0xb0d0('0x10')]('/:id/teams',auth[_0xb0d0('0x9')](),controller['addTeams']);router[_0xb0d0('0x12')](_0xb0d0('0x13'),auth['isAuthenticated'](),controller[_0xb0d0('0x14')]);router[_0xb0d0('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xb0d0('0x15')](_0xb0d0('0x16'),auth['isAuthenticated'](),controller[_0xb0d0('0x17')]);router[_0xb0d0('0x15')](_0xb0d0('0xe'),auth[_0xb0d0('0x9')](),controller[_0xb0d0('0x18')]);module['exports']=router; \ No newline at end of file +var _0xa378=['exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','describe','show','/:id/users','/:id/teams','getTeams','create','post','addAgents','put','/:id','update','delete','destroy'];(function(_0x48e913,_0x5e63f4){var _0x512e3e=function(_0x2e6f35){while(--_0x2e6f35){_0x48e913['push'](_0x48e913['shift']());}};_0x512e3e(++_0x5e63f4);}(_0xa378,0xb9));var _0x8a37=function(_0x35b8b2,_0x18c929){_0x35b8b2=_0x35b8b2-0x0;var _0x54292a=_0xa378[_0x35b8b2];return _0x54292a;};'use strict';var multer=require(_0x8a37('0x0'));var util=require(_0x8a37('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8a37('0x2'));var router=express[_0x8a37('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8a37('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8a37('0x5'));var controller=require(_0x8a37('0x6'));router[_0x8a37('0x7')]('/',auth[_0x8a37('0x8')](),controller['index']);router[_0x8a37('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x8a37('0x9')]);router[_0x8a37('0x7')]('/:id',auth[_0x8a37('0x8')](),controller[_0x8a37('0xa')]);router['get'](_0x8a37('0xb'),auth[_0x8a37('0x8')](),controller['getAgents']);router[_0x8a37('0x7')](_0x8a37('0xc'),auth['isAuthenticated'](),controller[_0x8a37('0xd')]);router['post']('/',auth[_0x8a37('0x8')](),controller[_0x8a37('0xe')]);router[_0x8a37('0xf')]('/:id/users',auth[_0x8a37('0x8')](),controller[_0x8a37('0x10')]);router[_0x8a37('0xf')](_0x8a37('0xc'),auth[_0x8a37('0x8')](),controller['addTeams']);router[_0x8a37('0x11')](_0x8a37('0x12'),auth[_0x8a37('0x8')](),controller[_0x8a37('0x13')]);router[_0x8a37('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x8a37('0x15')]);router[_0x8a37('0x14')](_0x8a37('0xb'),auth[_0x8a37('0x8')](),controller['removeAgents']);router['delete'](_0x8a37('0xc'),auth[_0x8a37('0x8')](),controller['removeTeams']);module[_0x8a37('0x16')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 97913f1..343b771 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 _0x2845=['getDataValue','STRING','INTEGER','sequelize','exports','name','system-'];(function(_0x1b2ff2,_0x1d8749){var _0x22e540=function(_0xd6652f){while(--_0xd6652f){_0x1b2ff2['push'](_0x1b2ff2['shift']());}};_0x22e540(++_0x1d8749);}(_0x2845,0x18b));var _0x5284=function(_0x1ac7fd,_0x39fc4e){_0x1ac7fd=_0x1ac7fd-0x0;var _0x468291=_0x2845[_0x1ac7fd];return _0x468291;};'use strict';var Sequelize=require(_0x5284('0x0'));module[_0x5284('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5284('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x27eb79){return _0x5284('0x3')+this[_0x5284('0x4')](_0x5284('0x2'))+'-';}},'description':{'type':Sequelize[_0x5284('0x5')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x5284('0x6')]}}; \ No newline at end of file +var _0xb9e7=['getDataValue','INTEGER','exports','STRING','name','VIRTUAL','system-'];(function(_0x192359,_0x5518fd){var _0x3dd6d1=function(_0x1a4b25){while(--_0x1a4b25){_0x192359['push'](_0x192359['shift']());}};_0x3dd6d1(++_0x5518fd);}(_0xb9e7,0x121));var _0x7b9e=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0xb9e7[_0x16eb11];return _0x3ae7ef;};'use strict';var Sequelize=require('sequelize');module[_0x7b9e('0x0')]={'name':{'type':Sequelize[_0x7b9e('0x1')],'allowNull':![],'unique':_0x7b9e('0x2')},'prefix':{'type':Sequelize[_0x7b9e('0x3')],'get':function(_0xa2fec4){return _0x7b9e('0x4')+this[_0x7b9e('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0x7b9e('0x1')]},'callerIdAll':{'type':Sequelize[_0x7b9e('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x7b9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 82d3a27..f15a6b8 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 _0x4e2e=['from','team_has_voice_prefixes','join','user_has_teams','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','VoicePrefixes','UserProfileResource','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','findAll','rows','show','params','include','options','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','getTeams','addTeams','Team','online','interface','Agents','each','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId'];(function(_0xb7e04c,_0x5c0d2e){var _0x51d4c5=function(_0x322442){while(--_0x322442){_0xb7e04c['push'](_0xb7e04c['shift']());}};_0x51d4c5(++_0x5c0d2e);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x59eb89,_0x3f928c){_0x59eb89=_0x59eb89-0x0;var _0x3629ef=_0x4e2e[_0x59eb89];return _0x3629ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4e2('0x0'));var zipdir=require(_0xe4e2('0x1'));var jsonpatch=require(_0xe4e2('0x2'));var rp=require(_0xe4e2('0x3'));var moment=require(_0xe4e2('0x4'));var BPromise=require(_0xe4e2('0x5'));var Mustache=require('mustache');var util=require(_0xe4e2('0x6'));var path=require(_0xe4e2('0x7'));var sox=require(_0xe4e2('0x8'));var csv=require(_0xe4e2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe4e2('0xa'));var _=require(_0xe4e2('0xb'));var squel=require(_0xe4e2('0xc'));var crypto=require(_0xe4e2('0xd'));var jsforce=require(_0xe4e2('0xe'));var deskjs=require(_0xe4e2('0xf'));var toCsv=require(_0xe4e2('0x9'));var querystring=require(_0xe4e2('0x10'));var Papa=require('papaparse');var Redis=require(_0xe4e2('0x11'));var authService=require(_0xe4e2('0x12'));var qs=require(_0xe4e2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4e2('0x14'));var logger=require(_0xe4e2('0x15'))(_0xe4e2('0x16'));var utils=require(_0xe4e2('0x17'));var config=require(_0xe4e2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4e2('0x19'))['db'];config[_0xe4e2('0x1a')]=_[_0xe4e2('0x1b')](config[_0xe4e2('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xe4e2('0x1c'))(new Redis(config[_0xe4e2('0x1a')]));require(_0xe4e2('0x1d'))[_0xe4e2('0x1e')](socket);function respondWithStatusCode(_0x202486,_0x50678d){_0x50678d=_0x50678d||0xcc;return function(_0x58e012){if(_0x58e012){return _0x202486[_0xe4e2('0x1f')](_0x50678d);}return _0x202486[_0xe4e2('0x20')](_0x50678d)[_0xe4e2('0x21')]();};}function respondWithResult(_0x28ee12,_0x217ea5){_0x217ea5=_0x217ea5||0xc8;return function(_0x54107a){if(_0x54107a){return _0x28ee12[_0xe4e2('0x20')](_0x217ea5)[_0xe4e2('0x22')](_0x54107a);}};}function respondWithFilteredResult(_0x340935,_0x4fe2f2){return function(_0x196f16){if(_0x196f16){var _0x54c80b=typeof _0x4fe2f2[_0xe4e2('0x23')]===_0xe4e2('0x24')&&typeof _0x4fe2f2[_0xe4e2('0x25')]===_0xe4e2('0x24');var _0x3dfbdf=_0x196f16[_0xe4e2('0x26')];var _0x339d00=_0x54c80b?0x0:_0x4fe2f2[_0xe4e2('0x23')];var _0x4769dd=_0x54c80b?_0x196f16[_0xe4e2('0x26')]:_0x4fe2f2['offset']+_0x4fe2f2[_0xe4e2('0x25')];var _0x2e7ecd;if(_0x4769dd>=_0x3dfbdf){_0x4769dd=_0x3dfbdf;_0x2e7ecd=0xc8;}else{_0x2e7ecd=0xce;}_0x340935[_0xe4e2('0x20')](_0x2e7ecd);return _0x340935[_0xe4e2('0x27')](_0xe4e2('0x28'),_0x339d00+'-'+_0x4769dd+'/'+_0x3dfbdf)[_0xe4e2('0x22')](_0x196f16);}return null;};}function patchUpdates(_0x16f14b){return function(_0x51c67e){try{jsonpatch[_0xe4e2('0x29')](_0x51c67e,_0x16f14b,!![]);}catch(_0x2ab435){return BPromise[_0xe4e2('0x2a')](_0x2ab435);}return _0x51c67e['save']();};}function saveUpdates(_0x353030,_0x12ad33){return function(_0x598fa3){if(_0x598fa3){return _0x598fa3[_0xe4e2('0x2b')](_0x353030)[_0xe4e2('0x2c')](function(_0x29143c){return _0x29143c;});}return null;};}function removeEntity(_0x3f5265,_0x249b7e){return function(_0x5887c9){if(_0x5887c9){return _0x5887c9[_0xe4e2('0x2d')]()[_0xe4e2('0x2c')](function(){var _0x1f6d1f=_0x5887c9['get']({'plain':!![]});var _0x3a31b8=_0xe4e2('0x2e');return db[_0xe4e2('0x2f')]['destroy']({'where':{'type':_0x3a31b8,'resourceId':_0x1f6d1f['id']}})[_0xe4e2('0x2c')](function(){return _0x5887c9;});})['then'](function(){_0x3f5265[_0xe4e2('0x20')](0xcc)[_0xe4e2('0x21')]();});}};}function handleEntityNotFound(_0x52c849,_0x46926a){return function(_0x18e2e5){if(!_0x18e2e5){_0x52c849[_0xe4e2('0x1f')](0x194);}return _0x18e2e5;};}function handleError(_0x41500b,_0x1f7bcc){_0x1f7bcc=_0x1f7bcc||0x1f4;return function(_0x4d33de){logger['error'](_0x4d33de[_0xe4e2('0x30')]);if(_0x4d33de[_0xe4e2('0x31')]){delete _0x4d33de[_0xe4e2('0x31')];}_0x41500b[_0xe4e2('0x20')](_0x1f7bcc)[_0xe4e2('0x32')](_0x4d33de);};}exports[_0xe4e2('0x33')]=function(_0x1c7f9a,_0x40569e){var _0x37dec8={},_0x59eb={},_0x1c87b0={'count':0x0,'rows':[]};var _0x3fb693=_['map'](db[_0xe4e2('0x34')][_0xe4e2('0x35')],function(_0xe0846a){return{'name':_0xe0846a[_0xe4e2('0x36')],'type':_0xe0846a[_0xe4e2('0x37')][_0xe4e2('0x38')]};});_0x59eb['model']=_[_0xe4e2('0x39')](_0x3fb693,_0xe4e2('0x31'));_0x59eb[_0xe4e2('0x3a')]=_[_0xe4e2('0x3b')](_0x1c7f9a[_0xe4e2('0x3a')]);_0x59eb[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x59eb[_0xe4e2('0x3e')],_0x59eb[_0xe4e2('0x3a')]);_0x37dec8[_0xe4e2('0x3f')]=_[_0xe4e2('0x3d')](_0x59eb['model'],qs[_0xe4e2('0x40')](_0x1c7f9a['query'][_0xe4e2('0x40')]));_0x37dec8[_0xe4e2('0x3f')]=_0x37dec8['attributes'][_0xe4e2('0x41')]?_0x37dec8[_0xe4e2('0x3f')]:_0x59eb[_0xe4e2('0x3e')];if(!_0x1c7f9a[_0xe4e2('0x3a')]['hasOwnProperty'](_0xe4e2('0x42'))){_0x37dec8['limit']=qs[_0xe4e2('0x25')](_0x1c7f9a['query'][_0xe4e2('0x25')]);_0x37dec8[_0xe4e2('0x23')]=qs[_0xe4e2('0x23')](_0x1c7f9a['query'][_0xe4e2('0x23')]);}_0x37dec8[_0xe4e2('0x43')]=qs['sort'](_0x1c7f9a[_0xe4e2('0x3a')][_0xe4e2('0x44')]);_0x37dec8[_0xe4e2('0x45')]=qs[_0xe4e2('0x3c')](_[_0xe4e2('0x46')](_0x1c7f9a[_0xe4e2('0x3a')],_0x59eb[_0xe4e2('0x3c')]),_0x3fb693);if(_0x1c7f9a[_0xe4e2('0x3a')][_0xe4e2('0x47')]){_0x37dec8['where']=_['merge'](_0x37dec8[_0xe4e2('0x45')],{'$or':_[_0xe4e2('0x39')](_0x3fb693,function(_0x5d05a4){if(_0x5d05a4[_0xe4e2('0x37')]!=='VIRTUAL'){var _0x4d8a2d={};_0x4d8a2d[_0x5d05a4[_0xe4e2('0x31')]]={'$like':'%'+_0x1c7f9a[_0xe4e2('0x3a')][_0xe4e2('0x47')]+'%'};return _0x4d8a2d;}})});}_0x37dec8=_[_0xe4e2('0x48')]({},_0x37dec8,_0x1c7f9a['options']);var _0x45e88c={'where':_0x37dec8[_0xe4e2('0x45')]};return db[_0xe4e2('0x34')]['count'](_0x45e88c)[_0xe4e2('0x2c')](function(_0x4789cf){_0x1c87b0[_0xe4e2('0x26')]=_0x4789cf;if(_0x1c7f9a[_0xe4e2('0x3a')]['includeAll']){_0x37dec8['include']=[{'all':!![]}];}return db[_0xe4e2('0x34')][_0xe4e2('0x49')](_0x37dec8);})[_0xe4e2('0x2c')](function(_0x5c29c3){_0x1c87b0[_0xe4e2('0x4a')]=_0x5c29c3;return _0x1c87b0;})[_0xe4e2('0x2c')](respondWithFilteredResult(_0x40569e,_0x37dec8))['catch'](handleError(_0x40569e,null));};exports[_0xe4e2('0x4b')]=function(_0x3d55f9,_0x1538bd){var _0x17f30f={'raw':![],'where':{'id':_0x3d55f9[_0xe4e2('0x4c')]['id']}},_0x4ed88f={};_0x4ed88f[_0xe4e2('0x3e')]=_[_0xe4e2('0x3b')](db['VoicePrefix'][_0xe4e2('0x35')]);_0x4ed88f[_0xe4e2('0x3a')]=_['keys'](_0x3d55f9['query']);_0x4ed88f[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x4ed88f[_0xe4e2('0x3e')],_0x4ed88f['query']);_0x17f30f[_0xe4e2('0x3f')]=_[_0xe4e2('0x3d')](_0x4ed88f[_0xe4e2('0x3e')],qs[_0xe4e2('0x40')](_0x3d55f9['query'][_0xe4e2('0x40')]));_0x17f30f[_0xe4e2('0x3f')]=_0x17f30f[_0xe4e2('0x3f')][_0xe4e2('0x41')]?_0x17f30f['attributes']:_0x4ed88f[_0xe4e2('0x3e')];if(_0x3d55f9[_0xe4e2('0x3a')]['includeAll']){_0x17f30f[_0xe4e2('0x4d')]=[{'all':!![]}];}_0x17f30f=_[_0xe4e2('0x48')]({},_0x17f30f,_0x3d55f9[_0xe4e2('0x4e')]);return db['VoicePrefix'][_0xe4e2('0x4f')](_0x17f30f)[_0xe4e2('0x2c')](handleEntityNotFound(_0x1538bd,null))[_0xe4e2('0x2c')](respondWithResult(_0x1538bd,null))['catch'](handleError(_0x1538bd,null));};exports['destroy']=function(_0xccf95e,_0x4c6253){return db[_0xe4e2('0x34')]['find']({'where':{'id':_0xccf95e[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x4c6253,null))[_0xe4e2('0x2c')](removeEntity(_0x4c6253,null))['catch'](handleError(_0x4c6253,null));};exports[_0xe4e2('0x50')]=function(_0x504496,_0x11bd63){return db[_0xe4e2('0x34')]['describe']()[_0xe4e2('0x2c')](respondWithResult(_0x11bd63,null))['catch'](handleError(_0x11bd63,null));};exports[_0xe4e2('0x51')]=function(_0xf0885,_0x53d31d){var _0x297186;return db[_0xe4e2('0x52')][_0xe4e2('0x53')](function(_0x3e540d){return db[_0xe4e2('0x34')][_0xe4e2('0x51')](_0xf0885[_0xe4e2('0x54')],{'transaction':_0x3e540d})[_0xe4e2('0x2c')](function(_0x382d1b){_0x297186=_0x382d1b['get']({'plain':!![]});return db[_0xe4e2('0x55')][_0xe4e2('0x4f')]({'where':{'id':_0x297186[_0xe4e2('0x56')]},'raw':!![]})[_0xe4e2('0x2c')](function(_0x2b0885){return createVoicePrefixExtensions(_0x297186,_0x2b0885,_0x3e540d);});});})[_0xe4e2('0x2c')](function(){var _0x1e2012=_0xf0885[_0xe4e2('0x57')][_0xe4e2('0x58')]({'plain':!![]});if(!_0x1e2012)throw new Error(_0xe4e2('0x59'));if(_0x1e2012[_0xe4e2('0x5a')]==='user'){var _0x17a350=_0x297186;return db[_0xe4e2('0x5b')][_0xe4e2('0x4f')]({'where':{'name':_0xe4e2('0x2e'),'userProfileId':_0x1e2012['userProfileId']},'raw':!![]})[_0xe4e2('0x2c')](function(_0x1250a2){if(_0x1250a2&&_0x1250a2['autoAssociation']===0x0){return db[_0xe4e2('0x2f')][_0xe4e2('0x51')]({'name':_0x17a350[_0xe4e2('0x31')],'resourceId':_0x17a350['id'],'type':_0x1250a2[_0xe4e2('0x31')],'sectionId':_0x1250a2['id']},{})['then'](function(){return _0x297186;});}else{return _0x297186;}})[_0xe4e2('0x5c')](function(_0x5c9d88){logger[_0xe4e2('0x5d')](_0xe4e2('0x5e'),_0x5c9d88);throw _0x5c9d88;});}return _0x297186;})[_0xe4e2('0x2c')](respondWithResult(_0x53d31d,null))[_0xe4e2('0x5c')](handleError(_0x53d31d,null));};function Extension(_0x2cc813,_0x26ab38,_0x467cec,_0x33c5f4){this[_0xe4e2('0x5f')]=_0xe4e2('0x60');this[_0xe4e2('0x61')]=_0x2cc813;this[_0xe4e2('0x62')]=_0x467cec;this['type']=_0xe4e2('0x63');this['description']='Voice\x20Prefix\x20Extension';this[_0xe4e2('0x64')]=_0x26ab38;this[_0xe4e2('0x65')]=_0x33c5f4;}function createVoicePrefixExtensions(_0xa27bd1,_0x5e4e16,_0x477acd){return new BPromise(function(_0x4b6dfc,_0xb9e975){var _0x9ba757=new Extension(formatPrefixName(_0xa27bd1['prefix']),0x1,_0xe4e2('0x66'),_0xe4e2('0x67'));_0x9ba757['VoicePrefixId']=_0xa27bd1['id'];return db[_0xe4e2('0x55')][_0xe4e2('0x51')](_0x9ba757,{'transaction':_0x477acd})['then'](function(_0x476533){var _0x2ad558=_0x476533[_0xe4e2('0x58')]({'plain':!![]});var _0x3f7be9=_['map'](addVoicePrefixExtensions(_0xa27bd1,_0x5e4e16),function(_0x22640a){_0x22640a[_0xe4e2('0x56')]=_0x2ad558['id'];_0x22640a[_0xe4e2('0x68')]=_0xa27bd1['id'];return _0x22640a;});return db[_0xe4e2('0x55')][_0xe4e2('0x69')](_0x3f7be9,{'transaction':_0x477acd})[_0xe4e2('0x2c')](function(_0x1ef7f8){if(!_0x1ef7f8){return _0xb9e975(_0xe4e2('0x6a'));}else{return _0x4b6dfc(_0x1ef7f8);}})[_0xe4e2('0x5c')](function(_0x593635){return _0xb9e975(_0x593635);});});;});};function addVoicePrefixExtensions(_0x59b1c0,_0x5cd517){var _0x39f59c=[];var _0x17d904=formatPrefixName(_0x59b1c0[_0xe4e2('0x6b')]);_0x39f59c[_0xe4e2('0x6c')](new Extension(_0x17d904,0x2,_0xe4e2('0x6d'),_0xe4e2('0x6e')+_0x59b1c0[_0xe4e2('0x31')]));if(_0x59b1c0['callerIdAll']){_0x39f59c[_0xe4e2('0x6c')](new Extension(_0x17d904,0x3,_0xe4e2('0x6d'),_0xe4e2('0x6f')+_0x59b1c0[_0xe4e2('0x70')]));}else{_0x39f59c[_0xe4e2('0x6c')](new Extension(_0x17d904,0x3,_0xe4e2('0x66'),_0xe4e2('0x71')));}_0x39f59c[_0xe4e2('0x6c')](new Extension(_0x17d904,0x4,_0xe4e2('0x72'),_0x5cd517[_0xe4e2('0x5f')]+','+_0xe4e2('0x73')+(0x8+_0x59b1c0[_0xe4e2('0x31')][_0xe4e2('0x41')])+'}'+','+0x1));return _0x39f59c;}function formatPrefixName(_0x2ad8d1){var _0x3dde87='_';for(var _0x51d58d=0x0;_0x51d58d<_0x2ad8d1[_0xe4e2('0x41')];_0x51d58d++){if(_0x2ad8d1[_0xe4e2('0x74')](_0x51d58d)=='-'){_0x3dde87+=_0x2ad8d1[_0xe4e2('0x74')](_0x51d58d);}else{_0x3dde87+='['+_0x2ad8d1[_0xe4e2('0x74')](_0x51d58d)+']';}}_0x3dde87+='.';return _0x3dde87;}exports[_0xe4e2('0x2b')]=function(_0x26f90d,_0x26b31a,_0x3f40f8){var _0x134eec=_0x26f90d[_0xe4e2('0x54')];_0x134eec['prefix']=_0xe4e2('0x75')+_0x134eec[_0xe4e2('0x31')]+'-';return db[_0xe4e2('0x52')][_0xe4e2('0x53')](function(_0x24859b){return db[_0xe4e2('0x34')][_0xe4e2('0x2b')](_0x134eec,{'where':{'id':_0x134eec['id']},'transaction':_0x24859b})[_0xe4e2('0x2c')](function(){return db['VoiceExtension'][_0xe4e2('0x2d')]({'where':{'VoicePrefixId':_0x134eec['id']},'transaction':_0x24859b})[_0xe4e2('0x2c')](function(){return db[_0xe4e2('0x55')][_0xe4e2('0x4f')]({'where':{'id':_0x134eec[_0xe4e2('0x56')]},'raw':!![]})[_0xe4e2('0x2c')](function(_0x22f79e){return createVoicePrefixExtensions(_0x134eec,_0x22f79e,_0x24859b);});});});})[_0xe4e2('0x2c')](function(){return db[_0xe4e2('0x34')][_0xe4e2('0x76')](_0x134eec['id']);})['then'](respondWithResult(_0x26b31a,null))[_0xe4e2('0x5c')](handleError(_0x26b31a,null));};exports[_0xe4e2('0x77')]=function(_0x4da351,_0x2017d,_0x2cada0){return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x4da351[_0xe4e2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2017d,null))[_0xe4e2('0x2c')](function(_0x1447ee){if(_0x1447ee){return _0x1447ee[_0xe4e2('0x77')](_0x4da351[_0xe4e2('0x54')][_0xe4e2('0x78')],_[_0xe4e2('0x79')](_0x4da351[_0xe4e2('0x54')],[_0xe4e2('0x78'),'id'])||{})['spread'](function(_0xbdd6b4){for(var _0x386253=0x0;_0x386253<_0x4da351[_0xe4e2('0x54')][_0xe4e2('0x78')][_0xe4e2('0x41')];_0x386253+=0x1){socket[_0xe4e2('0x7a')](_0xe4e2('0x7b'),{'UserId':Number(_0x4da351[_0xe4e2('0x54')][_0xe4e2('0x78')][_0x386253]),'VoicePrefixId':Number(_0x4da351['params']['id'])});}return _0xbdd6b4;});}})[_0xe4e2('0x2c')](respondWithResult(_0x2017d,null))[_0xe4e2('0x5c')](handleError(_0x2017d,null));};exports[_0xe4e2('0x7c')]=function(_0x40fa3c,_0x420559,_0x28368a){return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x40fa3c[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x420559,null))[_0xe4e2('0x2c')](function(_0x150c1a){if(_0x150c1a){return _0x150c1a[_0xe4e2('0x7c')](_0x40fa3c['query'][_0xe4e2('0x78')])['then'](function(){if(_[_0xe4e2('0x7d')](_0x40fa3c[_0xe4e2('0x3a')]['ids'])){for(var _0x326762=0x0;_0x326762<_0x40fa3c[_0xe4e2('0x3a')][_0xe4e2('0x78')][_0xe4e2('0x41')];_0x326762+=0x1){socket[_0xe4e2('0x7a')](_0xe4e2('0x7e'),{'UserId':Number(_0x40fa3c[_0xe4e2('0x3a')]['ids'][_0x326762]),'VoicePrefixId':Number(_0x40fa3c[_0xe4e2('0x4c')]['id'])});}}else{socket[_0xe4e2('0x7a')]('userVoicePrefix:remove',{'UserId':Number(_0x40fa3c['query'][_0xe4e2('0x78')]),'VoicePrefixId':Number(_0x40fa3c[_0xe4e2('0x4c')]['id'])});}});}})[_0xe4e2('0x2c')](respondWithStatusCode(_0x420559,null))['catch'](handleError(_0x420559,null));};exports[_0xe4e2('0x7f')]=function(_0x5b0948,_0x3b45c3,_0x406c7e){var _0x5dfe42={};var _0x2783f7={};var _0x94e5e1;var _0x45ecb8;return db[_0xe4e2('0x34')][_0xe4e2('0x80')]({'where':{'id':_0x5b0948[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x3b45c3,null))[_0xe4e2('0x2c')](function(_0x3687d5){if(_0x3687d5){_0x94e5e1=_0x3687d5;_0x2783f7[_0xe4e2('0x3e')]=_['keys'](db[_0xe4e2('0x81')][_0xe4e2('0x35')]);_0x2783f7['query']=_[_0xe4e2('0x3b')](_0x5b0948['query']);_0x2783f7[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x2783f7[_0xe4e2('0x3e')],_0x2783f7[_0xe4e2('0x3a')]);_0x5dfe42['attributes']=_[_0xe4e2('0x3d')](_0x2783f7[_0xe4e2('0x3e')],qs[_0xe4e2('0x40')](_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x40')]));_0x5dfe42[_0xe4e2('0x3f')]=_0x5dfe42[_0xe4e2('0x3f')]['length']?_0x5dfe42['attributes']:_0x2783f7[_0xe4e2('0x3e')];_0x5dfe42[_0xe4e2('0x43')]=qs[_0xe4e2('0x44')](_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x44')]);_0x5dfe42[_0xe4e2('0x45')]=qs[_0xe4e2('0x3c')](_[_0xe4e2('0x46')](_0x5b0948[_0xe4e2('0x3a')],_0x2783f7[_0xe4e2('0x3c')]));if(_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x47')]){_0x5dfe42[_0xe4e2('0x45')]=_[_0xe4e2('0x48')](_0x5dfe42[_0xe4e2('0x45')],{'$or':_[_0xe4e2('0x39')](_0x5dfe42[_0xe4e2('0x3f')],function(_0x1b630a){var _0x1930b9={};_0x1930b9[_0x1b630a]={'$like':'%'+_0x5b0948['query'][_0xe4e2('0x47')]+'%'};return _0x1930b9;})});}_0x5dfe42=_[_0xe4e2('0x48')]({},_0x5dfe42,_0x5b0948[_0xe4e2('0x4e')]);return _0x94e5e1['getAgents'](_0x5dfe42);}})['then'](function(_0xf31c76){if(_0xf31c76){_0x45ecb8=_0xf31c76['length'];if(!_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x82')](_0xe4e2('0x42'))){_0x5dfe42[_0xe4e2('0x25')]=qs[_0xe4e2('0x25')](_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x25')]);_0x5dfe42[_0xe4e2('0x23')]=qs[_0xe4e2('0x23')](_0x5b0948['query'][_0xe4e2('0x23')]);}return _0x94e5e1[_0xe4e2('0x7f')](_0x5dfe42);}})['then'](function(_0x4ab01e){if(_0x4ab01e){return _0x4ab01e?{'count':_0x45ecb8,'rows':_0x4ab01e}:null;}})[_0xe4e2('0x2c')](respondWithResult(_0x3b45c3,null))[_0xe4e2('0x5c')](handleError(_0x3b45c3,null));};exports[_0xe4e2('0x83')]=function(_0x10c166,_0x11707e,_0x11a6f4){var _0x38675b={};var _0x39fcac={};var _0x272ebb;var _0x2558c2;return db['VoicePrefix'][_0xe4e2('0x80')]({'where':{'id':_0x10c166[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x11707e,null))[_0xe4e2('0x2c')](function(_0x46d566){if(_0x46d566){_0x272ebb=_0x46d566;_0x39fcac[_0xe4e2('0x3e')]=_[_0xe4e2('0x3b')](db['Team'][_0xe4e2('0x35')]);_0x39fcac[_0xe4e2('0x3a')]=_[_0xe4e2('0x3b')](_0x10c166[_0xe4e2('0x3a')]);_0x39fcac[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x39fcac[_0xe4e2('0x3e')],_0x39fcac[_0xe4e2('0x3a')]);_0x38675b[_0xe4e2('0x3f')]=_['intersection'](_0x39fcac[_0xe4e2('0x3e')],qs[_0xe4e2('0x40')](_0x10c166[_0xe4e2('0x3a')]['fields']));_0x38675b[_0xe4e2('0x3f')]=_0x38675b[_0xe4e2('0x3f')][_0xe4e2('0x41')]?_0x38675b[_0xe4e2('0x3f')]:_0x39fcac[_0xe4e2('0x3e')];_0x38675b[_0xe4e2('0x43')]=qs['sort'](_0x10c166[_0xe4e2('0x3a')][_0xe4e2('0x44')]);_0x38675b[_0xe4e2('0x45')]=qs['filters'](_[_0xe4e2('0x46')](_0x10c166[_0xe4e2('0x3a')],_0x39fcac[_0xe4e2('0x3c')]));if(_0x10c166[_0xe4e2('0x3a')][_0xe4e2('0x47')]){_0x38675b[_0xe4e2('0x45')]=_[_0xe4e2('0x48')](_0x38675b[_0xe4e2('0x45')],{'$or':_[_0xe4e2('0x39')](_0x38675b[_0xe4e2('0x3f')],function(_0x3266a4){var _0x282545={};_0x282545[_0x3266a4]={'$like':'%'+_0x10c166[_0xe4e2('0x3a')][_0xe4e2('0x47')]+'%'};return _0x282545;})});}_0x38675b=_[_0xe4e2('0x48')]({},_0x38675b,_0x10c166['options']);return _0x272ebb['getTeams'](_0x38675b);}})[_0xe4e2('0x2c')](function(_0x4d730e){if(_0x4d730e){_0x2558c2=_0x4d730e['length'];if(!_0x10c166[_0xe4e2('0x3a')][_0xe4e2('0x82')](_0xe4e2('0x42'))){_0x38675b[_0xe4e2('0x25')]=qs['limit'](_0x10c166[_0xe4e2('0x3a')]['limit']);_0x38675b['offset']=qs[_0xe4e2('0x23')](_0x10c166['query'][_0xe4e2('0x23')]);}return _0x272ebb[_0xe4e2('0x83')](_0x38675b);}})[_0xe4e2('0x2c')](function(_0x4e6552){if(_0x4e6552){return _0x4e6552?{'count':_0x2558c2,'rows':_0x4e6552}:null;}})[_0xe4e2('0x2c')](respondWithResult(_0x11707e,null))[_0xe4e2('0x5c')](handleError(_0x11707e,null));};exports[_0xe4e2('0x84')]=function(_0x5e9fc3,_0x240089,_0x1b94e9){var _0x126eeb=_0x5e9fc3[_0xe4e2('0x54')]['ids'];var _0x35c2d4;return db[_0xe4e2('0x85')][_0xe4e2('0x49')]({'where':{'id':_0x126eeb},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe4e2('0x31'),_0xe4e2('0x86'),'voicePause',_0xe4e2('0x87')],'raw':!![]}]})['then'](function(_0x47186a){if(_0x47186a){_0x35c2d4=_0x47186a;var _0x3fa1eb=_['flatMap'](_0x47186a,function(_0x3a8a2f){var _0x4e722d=_0x3a8a2f[_0xe4e2('0x58')]({'plain':!![]});return _0x4e722d[_0xe4e2('0x88')];});return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x5e9fc3[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](function(_0x50b129){return db[_0xe4e2('0x52')][_0xe4e2('0x53')](function(_0x45431c){return _0x50b129['addTeams'](_0x126eeb,{'transaction':_0x45431c})[_0xe4e2('0x2c')](function(){return BPromise[_0xe4e2('0x89')](_0x35c2d4,function(_0x19f368){return db['TeamVoicePrefix'][_0xe4e2('0x8a')]({'TeamId':_0x19f368['id'],'VoicePrefixId':_0x5e9fc3[_0xe4e2('0x4c')]['id']},{'transaction':_0x45431c});});})[_0xe4e2('0x2c')](function(){return BPromise['each'](_0x3fa1eb,function(_0x151d22){return db[_0xe4e2('0x8b')][_0xe4e2('0x8c')]({'where':{'UserId':_0x151d22['id'],'VoicePrefixId':_0x5e9fc3[_0xe4e2('0x4c')]['id']},'transaction':_0x45431c});});})[_0xe4e2('0x2c')](function(){_0x3fa1eb[_0xe4e2('0x8d')](function(_0x19405d){socket[_0xe4e2('0x7a')](_0xe4e2('0x7b'),{'UserId':_0x19405d['id'],'VoicePrefixId':_0x50b129['id']});});});});});}})[_0xe4e2('0x2c')](respondWithStatusCode(_0x240089,null))[_0xe4e2('0x5c')](handleError(_0x240089,null));};exports[_0xe4e2('0x8e')]=function(_0x515f57,_0x28b119,_0x373c88){return db[_0xe4e2('0x85')][_0xe4e2('0x49')]({'where':{'id':_0x515f57[_0xe4e2('0x3a')][_0xe4e2('0x78')]},'attributes':['id'],'include':[{'model':db[_0xe4e2('0x81')],'as':_0xe4e2('0x88'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x28b119,null))[_0xe4e2('0x2c')](function(_0x21fa74){var _0x273236=_[_0xe4e2('0x39')](_0x21fa74,'id');var _0x278ad0=[];var _0x416ebe=[];var _0xfb32dd=squel[_0xe4e2('0x8f')]();_0xfb32dd[_0xe4e2('0x90')](_0xe4e2('0x91'))[_0xe4e2('0x92')](_0xe4e2('0x93'),'tq')[_0xe4e2('0x94')](_0xe4e2('0x95'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('VoicePrefixId\x20=\x20?',_0x515f57[_0xe4e2('0x4c')]['id']);for(var _0x1060d9=0x0;_0x1060d9<_0x21fa74['length'];_0x1060d9+=0x1){let _0x3ca7ef=_0x21fa74[_0x1060d9];for(var _0x49dc91=0x0;_0x49dc91<_0x3ca7ef[_0xe4e2('0x88')][_0xe4e2('0x41')];_0x49dc91+=0x1){let _0x3cea27=_0x3ca7ef[_0xe4e2('0x88')][_0x49dc91];var _0x17b696=_0xfb32dd[_0xe4e2('0x96')]();_0x17b696['where'](_0xe4e2('0x97'),_0x3cea27['id']);_0x416ebe['push'](db[_0xe4e2('0x52')][_0xe4e2('0x3a')](_0x17b696[_0xe4e2('0x98')](),{'type':db[_0xe4e2('0x52')][_0xe4e2('0x99')][_0xe4e2('0x9a')]})[_0xe4e2('0x2c')](function(_0x55182e){if(_0x55182e['length']===0x1){return _0x3cea27['id'];}else{var _0x35d3da=_['every'](_['map'](_0x55182e,_0xe4e2('0x9b')),function(_0x2ab2d8){return _[_0xe4e2('0x9c')](_0x273236,_0x2ab2d8);});if(_0x35d3da){return _0x3cea27['id'];}}}));}}return BPromise[_0xe4e2('0x9d')](_0x416ebe)[_0xe4e2('0x2c')](function(_0x10a6c5){_0x278ad0=_(_0x278ad0)[_0xe4e2('0x9e')](_0x10a6c5)[_0xe4e2('0x9f')]()['value']();return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x515f57[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](function(_0x45ee82){return db[_0xe4e2('0x52')][_0xe4e2('0x53')](function(_0x181f47){return _0x45ee82[_0xe4e2('0x8e')](_0x515f57[_0xe4e2('0x3a')][_0xe4e2('0x78')],{'transaction':_0x181f47})['then'](function(){if(!_[_0xe4e2('0xa0')](_0x278ad0)){return _0x45ee82[_0xe4e2('0x7c')](_0x278ad0,{'transaction':_0x181f47});}})[_0xe4e2('0x2c')](function(){_0x278ad0['forEach'](function(_0x3dabd1){socket[_0xe4e2('0x7a')](_0xe4e2('0x7e'),{'UserId':_0x3dabd1,'VoicePrefixId':_0x45ee82['id']});});});});});});})[_0xe4e2('0x2c')](respondWithStatusCode(_0x28b119,null))[_0xe4e2('0x5c')](handleError(_0x28b119,null));}; \ No newline at end of file +var _0x5f66=['map','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','VoicePrefix','count','includeAll','include','findAll','rows','catch','find','destroy','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','goto','charAt','system-','findById','params','addAgents','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','getAgents','hasOwnProperty','getTeams','Team','online','voicePause','interface','flatMap','Agents','sequelize','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','User','select','from','team_has_voice_prefixes','join','user_has_teams','clone','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','update','get','VoicePrefixes','UserProfileResource','then','error','stack','send'];(function(_0x4233a2,_0x478e28){var _0x1c420e=function(_0x10b59e){while(--_0x10b59e){_0x4233a2['push'](_0x4233a2['shift']());}};_0x1c420e(++_0x478e28);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];config[_0x65f6('0x14')]=_['defaults'](config[_0x65f6('0x14')],{'host':_0x65f6('0x15'),'port':0x18eb});var socket=require(_0x65f6('0x16'))(new Redis(config[_0x65f6('0x14')]));require(_0x65f6('0x17'))[_0x65f6('0x18')](socket);function respondWithStatusCode(_0x44144b,_0xb1d40a){_0xb1d40a=_0xb1d40a||0xcc;return function(_0x46dbc6){if(_0x46dbc6){return _0x44144b[_0x65f6('0x19')](_0xb1d40a);}return _0x44144b['status'](_0xb1d40a)[_0x65f6('0x1a')]();};}function respondWithResult(_0x49a913,_0x5dd324){_0x5dd324=_0x5dd324||0xc8;return function(_0x1693e6){if(_0x1693e6){return _0x49a913[_0x65f6('0x1b')](_0x5dd324)[_0x65f6('0x1c')](_0x1693e6);}};}function respondWithFilteredResult(_0x1c955c,_0x1b1cbb){return function(_0x1f974c){if(_0x1f974c){var _0xc8660c=typeof _0x1b1cbb[_0x65f6('0x1d')]==='undefined'&&typeof _0x1b1cbb['limit']===_0x65f6('0x1e');var _0x5b4055=_0x1f974c['count'];var _0x5c5b91=_0xc8660c?0x0:_0x1b1cbb[_0x65f6('0x1d')];var _0x21ea88=_0xc8660c?_0x1f974c['count']:_0x1b1cbb[_0x65f6('0x1d')]+_0x1b1cbb[_0x65f6('0x1f')];var _0xbee6a4;if(_0x21ea88>=_0x5b4055){_0x21ea88=_0x5b4055;_0xbee6a4=0xc8;}else{_0xbee6a4=0xce;}_0x1c955c[_0x65f6('0x1b')](_0xbee6a4);return _0x1c955c[_0x65f6('0x20')](_0x65f6('0x21'),_0x5c5b91+'-'+_0x21ea88+'/'+_0x5b4055)['json'](_0x1f974c);}return null;};}function patchUpdates(_0x197a49){return function(_0x4bb39e){try{jsonpatch['apply'](_0x4bb39e,_0x197a49,!![]);}catch(_0x212247){return BPromise[_0x65f6('0x22')](_0x212247);}return _0x4bb39e['save']();};}function saveUpdates(_0x1eeaaa,_0x471a33){return function(_0x2317ce){if(_0x2317ce){return _0x2317ce[_0x65f6('0x23')](_0x1eeaaa)['then'](function(_0x9d7bb0){return _0x9d7bb0;});}return null;};}function removeEntity(_0x59ea32,_0x20a161){return function(_0x5963e0){if(_0x5963e0){return _0x5963e0['destroy']()['then'](function(){var _0x29abdb=_0x5963e0[_0x65f6('0x24')]({'plain':!![]});var _0x4b2292=_0x65f6('0x25');return db[_0x65f6('0x26')]['destroy']({'where':{'type':_0x4b2292,'resourceId':_0x29abdb['id']}})[_0x65f6('0x27')](function(){return _0x5963e0;});})[_0x65f6('0x27')](function(){_0x59ea32[_0x65f6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac04b,_0x488d36){return function(_0x266cfe){if(!_0x266cfe){_0x4ac04b[_0x65f6('0x19')](0x194);}return _0x266cfe;};}function handleError(_0x4344b3,_0x408ccc){_0x408ccc=_0x408ccc||0x1f4;return function(_0x518cac){logger[_0x65f6('0x28')](_0x518cac[_0x65f6('0x29')]);if(_0x518cac['name']){delete _0x518cac['name'];}_0x4344b3[_0x65f6('0x1b')](_0x408ccc)[_0x65f6('0x2a')](_0x518cac);};}exports['index']=function(_0x4e50c0,_0x10b368){var _0x1ce43c={},_0x11fe3b={},_0xc53cb7={'count':0x0,'rows':[]};var _0x1217fd=_[_0x65f6('0x2b')](db['VoicePrefix'][_0x65f6('0x2c')],function(_0x38f3c6){return{'name':_0x38f3c6[_0x65f6('0x2d')],'type':_0x38f3c6['type'][_0x65f6('0x2e')]};});_0x11fe3b[_0x65f6('0x2f')]=_[_0x65f6('0x2b')](_0x1217fd,_0x65f6('0x30'));_0x11fe3b[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x4e50c0['query']);_0x11fe3b[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x11fe3b['model'],_0x11fe3b[_0x65f6('0x31')]);_0x1ce43c['attributes']=_[_0x65f6('0x34')](_0x11fe3b['model'],qs[_0x65f6('0x35')](_0x4e50c0[_0x65f6('0x31')]['fields']));_0x1ce43c[_0x65f6('0x36')]=_0x1ce43c[_0x65f6('0x36')][_0x65f6('0x37')]?_0x1ce43c['attributes']:_0x11fe3b['model'];if(!_0x4e50c0[_0x65f6('0x31')]['hasOwnProperty'](_0x65f6('0x38'))){_0x1ce43c['limit']=qs[_0x65f6('0x1f')](_0x4e50c0[_0x65f6('0x31')]['limit']);_0x1ce43c[_0x65f6('0x1d')]=qs['offset'](_0x4e50c0['query'][_0x65f6('0x1d')]);}_0x1ce43c[_0x65f6('0x39')]=qs[_0x65f6('0x3a')](_0x4e50c0[_0x65f6('0x31')][_0x65f6('0x3a')]);_0x1ce43c[_0x65f6('0x3b')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3c')](_0x4e50c0['query'],_0x11fe3b[_0x65f6('0x33')]),_0x1217fd);if(_0x4e50c0['query'][_0x65f6('0x3d')]){_0x1ce43c[_0x65f6('0x3b')]=_[_0x65f6('0x3e')](_0x1ce43c[_0x65f6('0x3b')],{'$or':_['map'](_0x1217fd,function(_0x32148f){if(_0x32148f[_0x65f6('0x3f')]!==_0x65f6('0x40')){var _0x3fb1c6={};_0x3fb1c6[_0x32148f[_0x65f6('0x30')]]={'$like':'%'+_0x4e50c0[_0x65f6('0x31')][_0x65f6('0x3d')]+'%'};return _0x3fb1c6;}})});}_0x1ce43c=_[_0x65f6('0x3e')]({},_0x1ce43c,_0x4e50c0[_0x65f6('0x41')]);var _0x5d8e48={'where':_0x1ce43c[_0x65f6('0x3b')]};return db[_0x65f6('0x42')][_0x65f6('0x43')](_0x5d8e48)[_0x65f6('0x27')](function(_0x83e2d9){_0xc53cb7[_0x65f6('0x43')]=_0x83e2d9;if(_0x4e50c0[_0x65f6('0x31')][_0x65f6('0x44')]){_0x1ce43c[_0x65f6('0x45')]=[{'all':!![]}];}return db[_0x65f6('0x42')][_0x65f6('0x46')](_0x1ce43c);})[_0x65f6('0x27')](function(_0x6c4d94){_0xc53cb7[_0x65f6('0x47')]=_0x6c4d94;return _0xc53cb7;})[_0x65f6('0x27')](respondWithFilteredResult(_0x10b368,_0x1ce43c))[_0x65f6('0x48')](handleError(_0x10b368,null));};exports['show']=function(_0x2dd16c,_0x37cd36){var _0x2d8c45={'raw':![],'where':{'id':_0x2dd16c['params']['id']}},_0x3828c9={};_0x3828c9[_0x65f6('0x2f')]=_[_0x65f6('0x32')](db[_0x65f6('0x42')]['rawAttributes']);_0x3828c9[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x2dd16c[_0x65f6('0x31')]);_0x3828c9[_0x65f6('0x33')]=_['intersection'](_0x3828c9[_0x65f6('0x2f')],_0x3828c9['query']);_0x2d8c45[_0x65f6('0x36')]=_[_0x65f6('0x34')](_0x3828c9['model'],qs[_0x65f6('0x35')](_0x2dd16c['query'][_0x65f6('0x35')]));_0x2d8c45[_0x65f6('0x36')]=_0x2d8c45[_0x65f6('0x36')][_0x65f6('0x37')]?_0x2d8c45[_0x65f6('0x36')]:_0x3828c9[_0x65f6('0x2f')];if(_0x2dd16c['query']['includeAll']){_0x2d8c45[_0x65f6('0x45')]=[{'all':!![]}];}_0x2d8c45=_[_0x65f6('0x3e')]({},_0x2d8c45,_0x2dd16c[_0x65f6('0x41')]);return db[_0x65f6('0x42')][_0x65f6('0x49')](_0x2d8c45)[_0x65f6('0x27')](handleEntityNotFound(_0x37cd36,null))[_0x65f6('0x27')](respondWithResult(_0x37cd36,null))[_0x65f6('0x48')](handleError(_0x37cd36,null));};exports[_0x65f6('0x4a')]=function(_0x517a47,_0x1f16cf){return db[_0x65f6('0x42')][_0x65f6('0x49')]({'where':{'id':_0x517a47['params']['id']}})[_0x65f6('0x27')](handleEntityNotFound(_0x1f16cf,null))[_0x65f6('0x27')](removeEntity(_0x1f16cf,null))['catch'](handleError(_0x1f16cf,null));};exports[_0x65f6('0x4b')]=function(_0x253d52,_0x57eb04){return db[_0x65f6('0x42')]['describe']()[_0x65f6('0x27')](respondWithResult(_0x57eb04,null))[_0x65f6('0x48')](handleError(_0x57eb04,null));};exports[_0x65f6('0x4c')]=function(_0x4b9f0a,_0x1646c5){var _0x43a52e;return db['sequelize'][_0x65f6('0x4d')](function(_0x34312c){return db['VoicePrefix'][_0x65f6('0x4c')](_0x4b9f0a[_0x65f6('0x4e')],{'transaction':_0x34312c})[_0x65f6('0x27')](function(_0x25d504){_0x43a52e=_0x25d504[_0x65f6('0x24')]({'plain':!![]});return db[_0x65f6('0x4f')][_0x65f6('0x49')]({'where':{'id':_0x43a52e[_0x65f6('0x50')]},'raw':!![]})['then'](function(_0x52c5a4){return createVoicePrefixExtensions(_0x43a52e,_0x52c5a4,_0x34312c);});});})['then'](function(){var _0x19f40c=_0x4b9f0a[_0x65f6('0x51')][_0x65f6('0x24')]({'plain':!![]});if(!_0x19f40c)throw new Error(_0x65f6('0x52'));if(_0x19f40c['role']===_0x65f6('0x51')){var _0x2032b9=_0x43a52e;return db[_0x65f6('0x53')]['find']({'where':{'name':_0x65f6('0x25'),'userProfileId':_0x19f40c[_0x65f6('0x54')]},'raw':!![]})[_0x65f6('0x27')](function(_0x4e289e){if(_0x4e289e&&_0x4e289e['autoAssociation']===0x0){return db[_0x65f6('0x26')][_0x65f6('0x4c')]({'name':_0x2032b9[_0x65f6('0x30')],'resourceId':_0x2032b9['id'],'type':_0x4e289e[_0x65f6('0x30')],'sectionId':_0x4e289e['id']},{})[_0x65f6('0x27')](function(){return _0x43a52e;});}else{return _0x43a52e;}})[_0x65f6('0x48')](function(_0x35d77f){logger[_0x65f6('0x28')](_0x65f6('0x55'),_0x35d77f);throw _0x35d77f;});}return _0x43a52e;})[_0x65f6('0x27')](respondWithResult(_0x1646c5,null))[_0x65f6('0x48')](handleError(_0x1646c5,null));};function Extension(_0x141fcc,_0x30adee,_0x3e3143,_0x5ba9c6){this[_0x65f6('0x56')]=_0x65f6('0x57');this[_0x65f6('0x58')]=_0x141fcc;this['app']=_0x3e3143;this[_0x65f6('0x3f')]=_0x65f6('0x59');this[_0x65f6('0x5a')]=_0x65f6('0x5b');this['priority']=_0x30adee;this[_0x65f6('0x5c')]=_0x5ba9c6;}function createVoicePrefixExtensions(_0x4227f5,_0xe5fc65,_0x3e0d8b){return new BPromise(function(_0x553ff0,_0x2923ff){var _0x2fc20f=new Extension(formatPrefixName(_0x4227f5['prefix']),0x1,_0x65f6('0x5d'),_0x65f6('0x5e'));_0x2fc20f[_0x65f6('0x5f')]=_0x4227f5['id'];return db['VoiceExtension'][_0x65f6('0x4c')](_0x2fc20f,{'transaction':_0x3e0d8b})[_0x65f6('0x27')](function(_0x3974ef){var _0x3c23e3=_0x3974ef[_0x65f6('0x24')]({'plain':!![]});var _0x334fa1=_['map'](addVoicePrefixExtensions(_0x4227f5,_0xe5fc65),function(_0x4ee8bd){_0x4ee8bd['VoiceExtensionId']=_0x3c23e3['id'];_0x4ee8bd[_0x65f6('0x5f')]=_0x4227f5['id'];return _0x4ee8bd;});return db[_0x65f6('0x4f')][_0x65f6('0x60')](_0x334fa1,{'transaction':_0x3e0d8b})[_0x65f6('0x27')](function(_0xab6f0){if(!_0xab6f0){return _0x2923ff(_0x65f6('0x61'));}else{return _0x553ff0(_0xab6f0);}})['catch'](function(_0xfbfebc){return _0x2923ff(_0xfbfebc);});});;});};function addVoicePrefixExtensions(_0x1d1532,_0x54b569){var _0x225aeb=[];var _0x39c244=formatPrefixName(_0x1d1532[_0x65f6('0x62')]);_0x225aeb['push'](new Extension(_0x39c244,0x2,_0x65f6('0x63'),_0x65f6('0x64')+_0x1d1532['name']));if(_0x1d1532[_0x65f6('0x65')]){_0x225aeb[_0x65f6('0x66')](new Extension(_0x39c244,0x3,_0x65f6('0x63'),_0x65f6('0x67')+_0x1d1532[_0x65f6('0x65')]));}else{_0x225aeb[_0x65f6('0x66')](new Extension(_0x39c244,0x3,_0x65f6('0x5d'),'No\x20callerid\x20available'));}_0x225aeb['push'](new Extension(_0x39c244,0x4,_0x65f6('0x68'),_0x54b569[_0x65f6('0x56')]+','+'${EXTEN:'+(0x8+_0x1d1532[_0x65f6('0x30')]['length'])+'}'+','+0x1));return _0x225aeb;}function formatPrefixName(_0x3a483b){var _0x4e0450='_';for(var _0x440df1=0x0;_0x440df1<_0x3a483b[_0x65f6('0x37')];_0x440df1++){if(_0x3a483b[_0x65f6('0x69')](_0x440df1)=='-'){_0x4e0450+=_0x3a483b[_0x65f6('0x69')](_0x440df1);}else{_0x4e0450+='['+_0x3a483b[_0x65f6('0x69')](_0x440df1)+']';}}_0x4e0450+='.';return _0x4e0450;}exports[_0x65f6('0x23')]=function(_0x1aaf75,_0x1cc66a,_0x2405a7){var _0x4b7ecd=_0x1aaf75['body'];_0x4b7ecd[_0x65f6('0x62')]=_0x65f6('0x6a')+_0x4b7ecd[_0x65f6('0x30')]+'-';return db['sequelize']['transaction'](function(_0x2dbec2){return db[_0x65f6('0x42')][_0x65f6('0x23')](_0x4b7ecd,{'where':{'id':_0x4b7ecd['id']},'transaction':_0x2dbec2})[_0x65f6('0x27')](function(){return db[_0x65f6('0x4f')][_0x65f6('0x4a')]({'where':{'VoicePrefixId':_0x4b7ecd['id']},'transaction':_0x2dbec2})['then'](function(){return db['VoiceExtension'][_0x65f6('0x49')]({'where':{'id':_0x4b7ecd[_0x65f6('0x50')]},'raw':!![]})['then'](function(_0x219bf8){return createVoicePrefixExtensions(_0x4b7ecd,_0x219bf8,_0x2dbec2);});});});})['then'](function(){return db[_0x65f6('0x42')][_0x65f6('0x6b')](_0x4b7ecd['id']);})[_0x65f6('0x27')](respondWithResult(_0x1cc66a,null))[_0x65f6('0x48')](handleError(_0x1cc66a,null));};exports['addAgents']=function(_0x34ab7b,_0x351d43,_0x11411c){return db['VoicePrefix']['find']({'where':{'id':_0x34ab7b[_0x65f6('0x6c')]['id']}})['then'](handleEntityNotFound(_0x351d43,null))[_0x65f6('0x27')](function(_0xf6de){if(_0xf6de){return _0xf6de[_0x65f6('0x6d')](_0x34ab7b[_0x65f6('0x4e')]['ids'],_['omit'](_0x34ab7b['body'],[_0x65f6('0x6e'),'id'])||{})[_0x65f6('0x6f')](function(_0x161fb2){for(var _0x57464e=0x0;_0x57464e<_0x34ab7b[_0x65f6('0x4e')][_0x65f6('0x6e')][_0x65f6('0x37')];_0x57464e+=0x1){socket['emit'](_0x65f6('0x70'),{'UserId':Number(_0x34ab7b[_0x65f6('0x4e')]['ids'][_0x57464e]),'VoicePrefixId':Number(_0x34ab7b[_0x65f6('0x6c')]['id'])});}return _0x161fb2;});}})[_0x65f6('0x27')](respondWithResult(_0x351d43,null))['catch'](handleError(_0x351d43,null));};exports[_0x65f6('0x71')]=function(_0x5ef825,_0xe8449b,_0x55ea91){return db[_0x65f6('0x42')][_0x65f6('0x49')]({'where':{'id':_0x5ef825['params']['id']}})[_0x65f6('0x27')](handleEntityNotFound(_0xe8449b,null))[_0x65f6('0x27')](function(_0x2a700b){if(_0x2a700b){return _0x2a700b[_0x65f6('0x71')](_0x5ef825[_0x65f6('0x31')][_0x65f6('0x6e')])[_0x65f6('0x27')](function(){if(_[_0x65f6('0x72')](_0x5ef825[_0x65f6('0x31')][_0x65f6('0x6e')])){for(var _0x288eb0=0x0;_0x288eb0<_0x5ef825['query'][_0x65f6('0x6e')][_0x65f6('0x37')];_0x288eb0+=0x1){socket[_0x65f6('0x73')](_0x65f6('0x74'),{'UserId':Number(_0x5ef825['query'][_0x65f6('0x6e')][_0x288eb0]),'VoicePrefixId':Number(_0x5ef825[_0x65f6('0x6c')]['id'])});}}else{socket['emit'](_0x65f6('0x74'),{'UserId':Number(_0x5ef825['query'][_0x65f6('0x6e')]),'VoicePrefixId':Number(_0x5ef825['params']['id'])});}});}})[_0x65f6('0x27')](respondWithStatusCode(_0xe8449b,null))[_0x65f6('0x48')](handleError(_0xe8449b,null));};exports['getAgents']=function(_0x4946c7,_0xa4a742,_0x413c21){var _0x5158c9={};var _0x2d86c8={};var _0x3b3bd5;var _0x73d359;return db['VoicePrefix'][_0x65f6('0x75')]({'where':{'id':_0x4946c7[_0x65f6('0x6c')]['id']}})['then'](handleEntityNotFound(_0xa4a742,null))[_0x65f6('0x27')](function(_0x504b39){if(_0x504b39){_0x3b3bd5=_0x504b39;_0x2d86c8[_0x65f6('0x2f')]=_['keys'](db['User'][_0x65f6('0x2c')]);_0x2d86c8[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x4946c7[_0x65f6('0x31')]);_0x2d86c8[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x2d86c8[_0x65f6('0x2f')],_0x2d86c8[_0x65f6('0x31')]);_0x5158c9['attributes']=_['intersection'](_0x2d86c8[_0x65f6('0x2f')],qs['fields'](_0x4946c7[_0x65f6('0x31')][_0x65f6('0x35')]));_0x5158c9[_0x65f6('0x36')]=_0x5158c9[_0x65f6('0x36')][_0x65f6('0x37')]?_0x5158c9['attributes']:_0x2d86c8[_0x65f6('0x2f')];_0x5158c9[_0x65f6('0x39')]=qs[_0x65f6('0x3a')](_0x4946c7['query'][_0x65f6('0x3a')]);_0x5158c9[_0x65f6('0x3b')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3c')](_0x4946c7[_0x65f6('0x31')],_0x2d86c8[_0x65f6('0x33')]));if(_0x4946c7['query']['filter']){_0x5158c9[_0x65f6('0x3b')]=_[_0x65f6('0x3e')](_0x5158c9[_0x65f6('0x3b')],{'$or':_[_0x65f6('0x2b')](_0x5158c9['attributes'],function(_0x4bda86){var _0x336076={};_0x336076[_0x4bda86]={'$like':'%'+_0x4946c7[_0x65f6('0x31')][_0x65f6('0x3d')]+'%'};return _0x336076;})});}_0x5158c9=_[_0x65f6('0x3e')]({},_0x5158c9,_0x4946c7[_0x65f6('0x41')]);return _0x3b3bd5[_0x65f6('0x76')](_0x5158c9);}})['then'](function(_0x4d607a){if(_0x4d607a){_0x73d359=_0x4d607a['length'];if(!_0x4946c7[_0x65f6('0x31')][_0x65f6('0x77')](_0x65f6('0x38'))){_0x5158c9[_0x65f6('0x1f')]=qs['limit'](_0x4946c7['query'][_0x65f6('0x1f')]);_0x5158c9[_0x65f6('0x1d')]=qs['offset'](_0x4946c7[_0x65f6('0x31')]['offset']);}return _0x3b3bd5[_0x65f6('0x76')](_0x5158c9);}})['then'](function(_0x3a30ed){if(_0x3a30ed){return _0x3a30ed?{'count':_0x73d359,'rows':_0x3a30ed}:null;}})[_0x65f6('0x27')](respondWithResult(_0xa4a742,null))['catch'](handleError(_0xa4a742,null));};exports[_0x65f6('0x78')]=function(_0x330e18,_0x13c03b,_0x9f6e0c){var _0xec6a56={};var _0x144db0={};var _0x584ea4;var _0x45b3e6;return db['VoicePrefix'][_0x65f6('0x75')]({'where':{'id':_0x330e18['params']['id']}})[_0x65f6('0x27')](handleEntityNotFound(_0x13c03b,null))[_0x65f6('0x27')](function(_0xdf396c){if(_0xdf396c){_0x584ea4=_0xdf396c;_0x144db0[_0x65f6('0x2f')]=_['keys'](db[_0x65f6('0x79')][_0x65f6('0x2c')]);_0x144db0[_0x65f6('0x31')]=_['keys'](_0x330e18['query']);_0x144db0[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x144db0['model'],_0x144db0[_0x65f6('0x31')]);_0xec6a56[_0x65f6('0x36')]=_[_0x65f6('0x34')](_0x144db0['model'],qs[_0x65f6('0x35')](_0x330e18[_0x65f6('0x31')]['fields']));_0xec6a56[_0x65f6('0x36')]=_0xec6a56[_0x65f6('0x36')][_0x65f6('0x37')]?_0xec6a56['attributes']:_0x144db0[_0x65f6('0x2f')];_0xec6a56[_0x65f6('0x39')]=qs[_0x65f6('0x3a')](_0x330e18['query'][_0x65f6('0x3a')]);_0xec6a56['where']=qs[_0x65f6('0x33')](_[_0x65f6('0x3c')](_0x330e18[_0x65f6('0x31')],_0x144db0[_0x65f6('0x33')]));if(_0x330e18[_0x65f6('0x31')][_0x65f6('0x3d')]){_0xec6a56['where']=_[_0x65f6('0x3e')](_0xec6a56[_0x65f6('0x3b')],{'$or':_[_0x65f6('0x2b')](_0xec6a56[_0x65f6('0x36')],function(_0x207d15){var _0x59407d={};_0x59407d[_0x207d15]={'$like':'%'+_0x330e18['query']['filter']+'%'};return _0x59407d;})});}_0xec6a56=_[_0x65f6('0x3e')]({},_0xec6a56,_0x330e18[_0x65f6('0x41')]);return _0x584ea4[_0x65f6('0x78')](_0xec6a56);}})['then'](function(_0x151cee){if(_0x151cee){_0x45b3e6=_0x151cee['length'];if(!_0x330e18['query'][_0x65f6('0x77')](_0x65f6('0x38'))){_0xec6a56['limit']=qs[_0x65f6('0x1f')](_0x330e18[_0x65f6('0x31')][_0x65f6('0x1f')]);_0xec6a56[_0x65f6('0x1d')]=qs[_0x65f6('0x1d')](_0x330e18[_0x65f6('0x31')][_0x65f6('0x1d')]);}return _0x584ea4[_0x65f6('0x78')](_0xec6a56);}})[_0x65f6('0x27')](function(_0x350641){if(_0x350641){return _0x350641?{'count':_0x45b3e6,'rows':_0x350641}:null;}})[_0x65f6('0x27')](respondWithResult(_0x13c03b,null))[_0x65f6('0x48')](handleError(_0x13c03b,null));};exports['addTeams']=function(_0x349af7,_0x52dc75,_0x55355f){var _0x24d524=_0x349af7[_0x65f6('0x4e')][_0x65f6('0x6e')];var _0x3727f9;return db['Team'][_0x65f6('0x46')]({'where':{'id':_0x24d524},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x65f6('0x30'),_0x65f6('0x7a'),_0x65f6('0x7b'),_0x65f6('0x7c')],'raw':!![]}]})[_0x65f6('0x27')](function(_0xcdfebe){if(_0xcdfebe){_0x3727f9=_0xcdfebe;var _0x5a33cf=_[_0x65f6('0x7d')](_0xcdfebe,function(_0x56bf49){var _0x1ef2a0=_0x56bf49[_0x65f6('0x24')]({'plain':!![]});return _0x1ef2a0[_0x65f6('0x7e')];});return db['VoicePrefix'][_0x65f6('0x49')]({'where':{'id':_0x349af7['params']['id']}})['then'](function(_0x377d5e){return db[_0x65f6('0x7f')][_0x65f6('0x4d')](function(_0xf364a9){return _0x377d5e[_0x65f6('0x80')](_0x24d524,{'transaction':_0xf364a9})['then'](function(){return BPromise[_0x65f6('0x81')](_0x3727f9,function(_0x400633){return db[_0x65f6('0x82')][_0x65f6('0x83')]({'TeamId':_0x400633['id'],'VoicePrefixId':_0x349af7['params']['id']},{'transaction':_0xf364a9});});})[_0x65f6('0x27')](function(){return BPromise[_0x65f6('0x81')](_0x5a33cf,function(_0x344163){return db[_0x65f6('0x84')][_0x65f6('0x85')]({'where':{'UserId':_0x344163['id'],'VoicePrefixId':_0x349af7[_0x65f6('0x6c')]['id']},'transaction':_0xf364a9});});})[_0x65f6('0x27')](function(){_0x5a33cf[_0x65f6('0x86')](function(_0x558410){socket[_0x65f6('0x73')](_0x65f6('0x70'),{'UserId':_0x558410['id'],'VoicePrefixId':_0x377d5e['id']});});});});});}})[_0x65f6('0x27')](respondWithStatusCode(_0x52dc75,null))[_0x65f6('0x48')](handleError(_0x52dc75,null));};exports[_0x65f6('0x87')]=function(_0x4171a1,_0x57667e,_0x3fd6ee){return db[_0x65f6('0x79')]['findAll']({'where':{'id':_0x4171a1[_0x65f6('0x31')]['ids']},'attributes':['id'],'include':[{'model':db[_0x65f6('0x88')],'as':_0x65f6('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x65f6('0x27')](handleEntityNotFound(_0x57667e,null))[_0x65f6('0x27')](function(_0x2177f1){var _0x55c9bd=_[_0x65f6('0x2b')](_0x2177f1,'id');var _0x395642=[];var _0x2394eb=[];var _0x31870f=squel[_0x65f6('0x89')]();_0x31870f['field']('tq.TeamId')[_0x65f6('0x8a')](_0x65f6('0x8b'),'tq')[_0x65f6('0x8c')](_0x65f6('0x8d'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('VoicePrefixId\x20=\x20?',_0x4171a1[_0x65f6('0x6c')]['id']);for(var _0x3b0a97=0x0;_0x3b0a97<_0x2177f1[_0x65f6('0x37')];_0x3b0a97+=0x1){let _0x50e159=_0x2177f1[_0x3b0a97];for(var _0x12730b=0x0;_0x12730b<_0x50e159[_0x65f6('0x7e')][_0x65f6('0x37')];_0x12730b+=0x1){let _0x18c6a8=_0x50e159[_0x65f6('0x7e')][_0x12730b];var _0x54e258=_0x31870f[_0x65f6('0x8e')]();_0x54e258[_0x65f6('0x3b')]('ut.UserId\x20=\x20?',_0x18c6a8['id']);_0x2394eb['push'](db[_0x65f6('0x7f')][_0x65f6('0x31')](_0x54e258[_0x65f6('0x8f')](),{'type':db[_0x65f6('0x7f')][_0x65f6('0x90')]['SELECT']})[_0x65f6('0x27')](function(_0x4b080a){if(_0x4b080a[_0x65f6('0x37')]===0x1){return _0x18c6a8['id'];}else{var _0x5d181a=_[_0x65f6('0x91')](_['map'](_0x4b080a,_0x65f6('0x92')),function(_0x48a9df){return _[_0x65f6('0x93')](_0x55c9bd,_0x48a9df);});if(_0x5d181a){return _0x18c6a8['id'];}}}));}}return BPromise[_0x65f6('0x94')](_0x2394eb)['then'](function(_0x4f2f43){_0x395642=_(_0x395642)[_0x65f6('0x95')](_0x4f2f43)[_0x65f6('0x96')]()[_0x65f6('0x97')]();return db[_0x65f6('0x42')][_0x65f6('0x49')]({'where':{'id':_0x4171a1[_0x65f6('0x6c')]['id']}})[_0x65f6('0x27')](function(_0x1b5957){return db[_0x65f6('0x7f')][_0x65f6('0x4d')](function(_0x4a90e3){return _0x1b5957[_0x65f6('0x87')](_0x4171a1[_0x65f6('0x31')][_0x65f6('0x6e')],{'transaction':_0x4a90e3})[_0x65f6('0x27')](function(){if(!_[_0x65f6('0x98')](_0x395642)){return _0x1b5957[_0x65f6('0x71')](_0x395642,{'transaction':_0x4a90e3});}})['then'](function(){_0x395642[_0x65f6('0x86')](function(_0x91d7bf){socket[_0x65f6('0x73')](_0x65f6('0x74'),{'UserId':_0x91d7bf,'VoicePrefixId':_0x1b5957['id']});});});});});});})[_0x65f6('0x27')](respondWithStatusCode(_0x57667e,null))[_0x65f6('0x48')](handleError(_0x57667e,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 9a641e5..8982edc 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 _0xee57=['VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x108315,_0x4d1842){var _0x43bcae=function(_0x4e4d6f){while(--_0x4e4d6f){_0x108315['push'](_0x108315['shift']());}};_0x43bcae(++_0x4d1842);}(_0xee57,0x1b8));var _0x7ee5=function(_0x1e49ad,_0x3cdf60){_0x1e49ad=_0x1e49ad-0x0;var _0x342a87=_0xee57[_0x1e49ad];return _0x342a87;};'use strict';var EventEmitter=require(_0x7ee5('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x7ee5('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x7ee5('0x2')](0x0);var events={'afterCreate':_0x7ee5('0x3'),'afterUpdate':_0x7ee5('0x4'),'afterDestroy':_0x7ee5('0x5')};function emitEvent(_0x39f116){return function(_0x559252,_0x21337d,_0x2f6c3e){VoicePrefixEvents['emit'](_0x39f116+':'+_0x559252['id'],_0x559252);VoicePrefixEvents[_0x7ee5('0x6')](_0x39f116,_0x559252);_0x2f6c3e(null);};}for(var e in events){if(events[_0x7ee5('0x7')](e)){var event=events[e];VoicePrefix[_0x7ee5('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x2885=['VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4d8dbf,_0x5bc3d8){var _0x50d8e6=function(_0x5aef53){while(--_0x5aef53){_0x4d8dbf['push'](_0x4d8dbf['shift']());}};_0x50d8e6(++_0x5bc3d8);}(_0x2885,0x1e9));var _0x5288=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x2885[_0xef8146];return _0x5a6cb0;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x5288('0x0'))['db'][_0x5288('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x5288('0x2')](0x0);var events={'afterCreate':_0x5288('0x3'),'afterUpdate':_0x5288('0x4'),'afterDestroy':_0x5288('0x5')};function emitEvent(_0x383a09){return function(_0x534f78,_0x490025,_0x272d94){VoicePrefixEvents[_0x5288('0x6')](_0x383a09+':'+_0x534f78['id'],_0x534f78);VoicePrefixEvents[_0x5288('0x6')](_0x383a09,_0x534f78);_0x272d94(null);};}for(var e in events){if(events[_0x5288('0x7')](e)){var event=events[e];VoicePrefix[_0x5288('0x8')](e,emitEvent(event));}}module[_0x5288('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 150ae5a..3364a0a 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 _0x6388=['api','moment','bluebird','request-promise','path','rimraf','exports','define','VoicePrefix','lodash','util'];(function(_0x1e8003,_0x13db95){var _0x3d48f4=function(_0x53b53e){while(--_0x53b53e){_0x1e8003['push'](_0x1e8003['shift']());}};_0x3d48f4(++_0x13db95);}(_0x6388,0x106));var _0x8638=function(_0x44462e,_0xead5df){_0x44462e=_0x44462e-0x0;var _0x1392ab=_0x6388[_0x44462e];return _0x1392ab;};'use strict';var _=require(_0x8638('0x0'));var util=require(_0x8638('0x1'));var logger=require('../../config/logger')(_0x8638('0x2'));var moment=require(_0x8638('0x3'));var BPromise=require(_0x8638('0x4'));var rp=require(_0x8638('0x5'));var fs=require('fs');var path=require(_0x8638('0x6'));var rimraf=require(_0x8638('0x7'));var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module[_0x8638('0x8')]=function(_0x5ca3ba,_0x2bfe3c){return _0x5ca3ba[_0x8638('0x9')](_0x8638('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd585=['./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x38414b,_0x5b5b26){var _0x4981e1=function(_0x33d4c6){while(--_0x33d4c6){_0x38414b['push'](_0x38414b['shift']());}};_0x4981e1(++_0x5b5b26);}(_0xd585,0x1e5));var _0x5d58=function(_0x16668f,_0x2dd307){_0x16668f=_0x16668f-0x0;var _0x136b4=_0xd585[_0x16668f];return _0x136b4;};'use strict';var _=require(_0x5d58('0x0'));var util=require(_0x5d58('0x1'));var logger=require(_0x5d58('0x2'))(_0x5d58('0x3'));var moment=require('moment');var BPromise=require(_0x5d58('0x4'));var rp=require(_0x5d58('0x5'));var fs=require('fs');var path=require(_0x5d58('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5d58('0x7'));module[_0x5d58('0x8')]=function(_0x19e56a,_0x45a569){return _0x19e56a[_0x5d58('0x9')](_0x5d58('0xa'),attributes,{'tableName':_0x5d58('0xb'),'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 85ab5da..d1fda15 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 _0xac6a=['localhost','socket.io-emitter','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x12f654,_0x2977b4){var _0x45d229=function(_0x152e96){while(--_0x152e96){_0x12f654['push'](_0x12f654['shift']());}};_0x45d229(++_0x2977b4);}(_0xac6a,0xc2));var _0xaac6=function(_0x25c342,_0x4993bb){_0x25c342=_0x25c342-0x0;var _0x567f30=_0xac6a[_0x25c342];return _0x567f30;};'use strict';var _=require(_0xaac6('0x0'));var util=require(_0xaac6('0x1'));var moment=require(_0xaac6('0x2'));var BPromise=require(_0xaac6('0x3'));var rs=require(_0xaac6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaac6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaac6('0x6'))(_0xaac6('0x7'));var config=require(_0xaac6('0x8'));var jayson=require(_0xaac6('0x9'));var client=jayson[_0xaac6('0xa')][_0xaac6('0xb')]({'port':0x232a});config[_0xaac6('0xc')]=_[_0xaac6('0xd')](config[_0xaac6('0xc')],{'host':_0xaac6('0xe'),'port':0x18eb});var socket=require(_0xaac6('0xf'))(new Redis(config[_0xaac6('0xc')]));require('./voicePrefix.socket')[_0xaac6('0x10')](socket);function respondWithRpcPromise(_0x160834,_0x31fa92,_0x37c3ba){return new BPromise(function(_0x19345a,_0x2b9460){return client['request'](_0x160834,_0x37c3ba)[_0xaac6('0x11')](function(_0x1605a3){logger[_0xaac6('0x12')](_0xaac6('0x13'),_0x31fa92,_0xaac6('0x14'));logger['debug'](_0xaac6('0x15'),_0x31fa92,_0xaac6('0x14'),JSON['stringify'](_0x1605a3));if(_0x1605a3['error']){if(_0x1605a3[_0xaac6('0x16')][_0xaac6('0x17')]===0x1f4){logger[_0xaac6('0x16')](_0xaac6('0x13'),_0x31fa92,_0x1605a3[_0xaac6('0x16')][_0xaac6('0x18')]);return _0x2b9460(_0x1605a3[_0xaac6('0x16')][_0xaac6('0x18')]);}logger[_0xaac6('0x16')](_0xaac6('0x13'),_0x31fa92,_0x1605a3[_0xaac6('0x16')][_0xaac6('0x18')]);return _0x19345a(_0x1605a3['error']['message']);}else{logger[_0xaac6('0x12')](_0xaac6('0x13'),_0x31fa92,_0xaac6('0x14'));_0x19345a(_0x1605a3[_0xaac6('0x19')][_0xaac6('0x18')]);}})['catch'](function(_0x22d66e){logger[_0xaac6('0x16')](_0xaac6('0x13'),_0x31fa92,_0x22d66e);_0x2b9460(_0x22d66e);});});} \ No newline at end of file +var _0xa786=['stringify','error','code','message','result','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x57d86d,_0x3003d6){var _0xf3992f=function(_0xe4547a){while(--_0xe4547a){_0x57d86d['push'](_0x57d86d['shift']());}};_0xf3992f(++_0x3003d6);}(_0xa786,0x71));var _0x6a78=function(_0xa2abfc,_0x194e68){_0xa2abfc=_0xa2abfc-0x0;var _0x2af93c=_0xa786[_0xa2abfc];return _0x2af93c;};'use strict';var _=require(_0x6a78('0x0'));var util=require(_0x6a78('0x1'));var moment=require(_0x6a78('0x2'));var BPromise=require('bluebird');var rs=require(_0x6a78('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6a78('0x4'));var logger=require(_0x6a78('0x5'))(_0x6a78('0x6'));var config=require(_0x6a78('0x7'));var jayson=require(_0x6a78('0x8'));var client=jayson[_0x6a78('0x9')][_0x6a78('0xa')]({'port':0x232a});config['redis']=_[_0x6a78('0xb')](config[_0x6a78('0xc')],{'host':_0x6a78('0xd'),'port':0x18eb});var socket=require(_0x6a78('0xe'))(new Redis(config[_0x6a78('0xc')]));require(_0x6a78('0xf'))[_0x6a78('0x10')](socket);function respondWithRpcPromise(_0x2364b5,_0x43e233,_0x5dd2d2){return new BPromise(function(_0x25b436,_0x1fca69){return client[_0x6a78('0x11')](_0x2364b5,_0x5dd2d2)['then'](function(_0x2a433a){logger[_0x6a78('0x12')](_0x6a78('0x13'),_0x43e233,_0x6a78('0x14'));logger[_0x6a78('0x15')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x43e233,_0x6a78('0x14'),JSON[_0x6a78('0x16')](_0x2a433a));if(_0x2a433a[_0x6a78('0x17')]){if(_0x2a433a['error'][_0x6a78('0x18')]===0x1f4){logger[_0x6a78('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x43e233,_0x2a433a[_0x6a78('0x17')][_0x6a78('0x19')]);return _0x1fca69(_0x2a433a[_0x6a78('0x17')][_0x6a78('0x19')]);}logger[_0x6a78('0x17')](_0x6a78('0x13'),_0x43e233,_0x2a433a['error'][_0x6a78('0x19')]);return _0x25b436(_0x2a433a[_0x6a78('0x17')][_0x6a78('0x19')]);}else{logger[_0x6a78('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x43e233,'request\x20sent');_0x25b436(_0x2a433a[_0x6a78('0x1a')]['message']);}})['catch'](function(_0x4efb20){logger[_0x6a78('0x17')](_0x6a78('0x13'),_0x43e233,_0x4efb20);_0x1fca69(_0x4efb20);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index fd396ee..c9a82c7 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 _0xae2b=['save','update','emit','removeListener','./voicePrefix.events'];(function(_0x2bda52,_0x51887a){var _0x533f0f=function(_0x29a5be){while(--_0x29a5be){_0x2bda52['push'](_0x2bda52['shift']());}};_0x533f0f(++_0x51887a);}(_0xae2b,0xb3));var _0xbae2=function(_0x522dde,_0x1e872a){_0x522dde=_0x522dde-0x0;var _0x2bdcd5=_0xae2b[_0x522dde];return _0x2bdcd5;};'use strict';var VoicePrefixEvents=require(_0xbae2('0x0'));var events=[_0xbae2('0x1'),'remove',_0xbae2('0x2')];function createListener(_0x247e63,_0x34de92){return function(_0x214f0e){_0x34de92[_0xbae2('0x3')](_0x247e63,_0x214f0e);};}function removeListener(_0x11edb2,_0x564f86){return function(){VoicePrefixEvents[_0xbae2('0x4')](_0x11edb2,_0x564f86);};}exports['register']=function(_0x365175){for(var _0xbfd83a=0x0,_0x18bc03=events['length'];_0xbfd83a<_0x18bc03;_0xbfd83a++){var _0x4788c4=events[_0xbfd83a];var _0x57f2ca=createListener('voicePrefix:'+_0x4788c4,_0x365175);VoicePrefixEvents['on'](_0x4788c4,_0x57f2ca);}}; \ No newline at end of file +var _0xc423=['length','./voicePrefix.events','save','remove','update','emit','removeListener','register'];(function(_0x317630,_0x5dea38){var _0x431a47=function(_0x1c13aa){while(--_0x1c13aa){_0x317630['push'](_0x317630['shift']());}};_0x431a47(++_0x5dea38);}(_0xc423,0x159));var _0x3c42=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xc423[_0x2be8c2];return _0x97f531;};'use strict';var VoicePrefixEvents=require(_0x3c42('0x0'));var events=[_0x3c42('0x1'),_0x3c42('0x2'),_0x3c42('0x3')];function createListener(_0x206e02,_0x4c94ff){return function(_0x212d37){_0x4c94ff[_0x3c42('0x4')](_0x206e02,_0x212d37);};}function removeListener(_0x2f1f8b,_0x5e8278){return function(){VoicePrefixEvents[_0x3c42('0x5')](_0x2f1f8b,_0x5e8278);};}exports[_0x3c42('0x6')]=function(_0x14e395){for(var _0x1feba8=0x0,_0x3c3ac4=events[_0x3c42('0x7')];_0x1feba8<_0x3c3ac4;_0x1feba8++){var _0x278430=events[_0x1feba8];var _0x23c503=createListener('voicePrefix:'+_0x278430,_0x14e395);VoicePrefixEvents['on'](_0x278430,_0x23c503);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 11589df..2abad16 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(_0x89100d,_0x59c43d){var _0x15974a=function(_0x2fb1ac){while(--_0x2fb1ac){_0x89100d['push'](_0x89100d['shift']());}};_0x15974a(++_0x59c43d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x32e1bd,_0x1096c6){var _0x35cfdd=function(_0x411821){while(--_0x411821){_0x32e1bd['push'](_0x32e1bd['shift']());}};_0x35cfdd(++_0x1096c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 8d89e3f..48cc666 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 _0x3180=['Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\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','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','STRING','name','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','outbound','preview','booked','includes','INTEGER','all','yes','ENUM','once','periodic_announce','join','split','joinempty','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','predictive','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'];(function(_0x2d8f6c,_0x44db4c){var _0x3a00f6=function(_0x1b16ea){while(--_0x1b16ea){_0x2d8f6c['push'](_0x2d8f6c['shift']());}};_0x3a00f6(++_0x44db4c);}(_0x3180,0x158));var _0x0318=function(_0x479201,_0x1e0ea9){_0x479201=_0x479201-0x0;var _0x37ad11=_0x3180[_0x479201];return _0x37ad11;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0318('0x0')],'allowNull':![],'unique':_0x0318('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0318('0x2'),'outbound'),'allowNull':![],'defaultValue':_0x0318('0x2')},'musiconhold':{'type':Sequelize[_0x0318('0x0')],'defaultValue':_0x0318('0x3')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x0318('0x4'),_0x0318('0x5'),_0x0318('0x6'),_0x0318('0x7'),_0x0318('0x8'),_0x0318('0x9'),_0x0318('0xa'),_0x0318('0xb')),'allowNull':![],'defaultValue':_0x0318('0x4'),'set':function(_0x597ca7){this[_0x0318('0xc')](_0x0318('0xd'),_0x597ca7?_0x597ca7:_0x0318('0x8'));},'get':function(){var _0x20c4e5=this[_0x0318('0xe')]('type');var _0x158405=this[_0x0318('0xe')](_0x0318('0xf'));var _0x418198=this[_0x0318('0xe')]('strategy');if(_0x20c4e5===_0x0318('0x10')){if(_0x158405===_0x0318('0x11')){return null;}if(_0x158405===_0x0318('0x12')&&!['rrmemory','roundrobin'][_0x0318('0x13')](_0x418198)){this[_0x0318('0xc')](_0x0318('0xd'),_0x0318('0x8'));}}return _0x418198;}},'servicelevel':{'type':Sequelize[_0x0318('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0318('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0318('0x14')](0xb)},'timeout':{'type':Sequelize[_0x0318('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0318('0x0')]},'weight':{'type':Sequelize[_0x0318('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0318('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x0318('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0318('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x0318('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0318('0x17')](_0x0318('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0318('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0318('0x17')](_0x0318('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0318('0x17')](_0x0318('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0318('0x17')](_0x0318('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0318('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x0318('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0318('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0318('0x17')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x0318('0x17')]('yes','no'),'defaultValue':_0x0318('0x16')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x0318('0x16'),'no',_0x0318('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0318('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0318('0x17')](_0x0318('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x0318('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0318('0x17')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0318('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0318('0x0')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0318('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0318('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x0318('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0318('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0318('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0318('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0318('0x0')]},'queue_quantity1':{'type':Sequelize[_0x0318('0x0')]},'queue_quantity2':{'type':Sequelize[_0x0318('0x0')]},'queue_periodic_announce':{'type':Sequelize[_0x0318('0x0')]},'queue_less_than':{'type':Sequelize[_0x0318('0x0')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x2fbfc5){this[_0x0318('0xc')](_0x0318('0x19'),_0x2fbfc5?_0x2fbfc5[_0x0318('0x1a')](','):[]);},'get':function(){return this[_0x0318('0xe')]('periodic_announce')?this[_0x0318('0xe')]('periodic_announce')[_0x0318('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x0318('0x0')],'defaultValue':_0x0318('0x16'),'set':function(_0x4ac21c){this['setDataValue'](_0x0318('0x1c'),_0x4ac21c?_0x4ac21c[_0x0318('0x1a')](','):undefined);},'get':function(){return this[_0x0318('0xe')](_0x0318('0x1c'))?this[_0x0318('0xe')](_0x0318('0x1c'))[_0x0318('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x54939a){this[_0x0318('0xc')](_0x0318('0x1d'),_0x54939a?_0x54939a[_0x0318('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0x0318('0x1d'))?this[_0x0318('0xe')](_0x0318('0x1d'))[_0x0318('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0318('0x17')](_0x0318('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0318('0x17')](_0x0318('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0318('0x17')](_0x0318('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0318('0x0')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x5c9cac){this[_0x0318('0xc')]('acw',_0x5c9cac);if(_0x5c9cac){if(this[_0x0318('0xe')](_0x0318('0x1e'))<0x2){this[_0x0318('0xc')](_0x0318('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0318('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0318('0x1f')],'defaultValue':0x0,'comment':_0x0318('0x20')},'dialMethod':{'type':Sequelize['ENUM'](_0x0318('0x11'),'progressive','power',_0x0318('0x21'),'booked'),'defaultValue':_0x0318('0x22'),'comment':_0x0318('0x23')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x0318('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0318('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0318('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x0318('0x27'),_0x0318('0x28')),'defaultValue':'dropRate','comment':_0x0318('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x0318('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0318('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x0318('0x14')](0x3)[_0x0318('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0318('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0318('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x0318('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x0318('0x0')],'defaultValue':_0x0318('0x2c'),'comment':_0x0318('0x2d')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x0318('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0318('0x2e')},'dialQueueProject':{'type':Sequelize[_0x0318('0x0')],'comment':_0x0318('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0318('0x14')](0x3)[_0x0318('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0318('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0318('0x14')](0x5)[_0x0318('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0318('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x0318('0x14')](0x3)[_0x0318('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x0318('0x14')](0x5)[_0x0318('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0318('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0318('0x14')](0x3)[_0x0318('0x24')],'defaultValue':0x3,'comment':_0x0318('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0318('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x0318('0x14')](0x3)[_0x0318('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0318('0x34')},'dialTimezone':{'type':Sequelize[_0x0318('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0318('0x0')],'defaultValue':_0x0318('0x35')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0318('0x36'),_0x0318('0x37'),_0x0318('0x38')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0318('0x1f')],'defaultValue':0x0,'comment':_0x0318('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x0318('0x14')](0x9)[_0x0318('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x0318('0x14')](0x9)[_0x0318('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0318('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0318('0x14')](0x9)[_0x0318('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0318('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0318('0x14')](0x9)[_0x0318('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0318('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x0318('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0318('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0318('0x14')](0x9)[_0x0318('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0318('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0318('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0318('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0318('0x14')](0x5)[_0x0318('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0318('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0318('0x14')](0x9)[_0x0318('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0318('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x0318('0x14')](0x5)[_0x0318('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x0318('0x17')]('DESC',_0x0318('0x42')),'defaultValue':_0x0318('0x43')},'dialQueueProject2':{'type':Sequelize[_0x0318('0x0')],'comment':_0x0318('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0318('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0318('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0318('0x14')](0x3)[_0x0318('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0318('0x44')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0318('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0318('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0318('0x14')](0x3)[_0x0318('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0318('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0318('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x0318('0x14')](0x3)[_0x0318('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0318('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0318('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0318('0x14')](0x5)[_0x0318('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0318('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x0318('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0318('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0318('0x14')](0x5)[_0x0318('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0318('0x14')](0x3)[_0x0318('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0318('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0318('0x14')](0x5)[_0x0318('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0318('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0318('0x14')],'allowNull':!![],'comment':_0x0318('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x0318('0x1f')],'defaultValue':![],'comment':_0x0318('0x4d'),'set':function(_0xfe7fdd){if(!_0xfe7fdd)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x0318('0xc')]('mandatoryDisposition',_0xfe7fdd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x0318('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x0318('0x14')](0x3)[_0x0318('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x0318('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x0318('0x14')](0x3)[_0x0318('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x0318('0x1f')],'defaultValue':![]}}; \ No newline at end of file +var _0xa379=['#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','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','name','ENUM','outbound','inbound','STRING','default','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','rrmemory','getDataValue','type','dialMethod','strategy','booked','roundrobin','includes','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','predictive','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x48dde7,_0x187c8e){var _0x247770=function(_0x41b977){while(--_0x41b977){_0x48dde7['push'](_0x48dde7['shift']());}};_0x247770(++_0x187c8e);}(_0xa379,0x6e));var _0x9a37=function(_0x3c5f08,_0x1380bb){_0x3c5f08=_0x3c5f08-0x0;var _0x3e0152=_0xa379[_0x3c5f08];return _0x3e0152;};'use strict';var Sequelize=require(_0x9a37('0x0'));module[_0x9a37('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9a37('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9a37('0x3')]('inbound',_0x9a37('0x4')),'allowNull':![],'defaultValue':_0x9a37('0x5')},'musiconhold':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':_0x9a37('0x7')},'announce':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x9a37('0x8'),_0x9a37('0x9'),_0x9a37('0xa'),_0x9a37('0xb'),'rrmemory',_0x9a37('0xc'),_0x9a37('0xd'),_0x9a37('0xe')),'allowNull':![],'defaultValue':_0x9a37('0x8'),'set':function(_0x1fa66c){this[_0x9a37('0xf')]('strategy',_0x1fa66c?_0x1fa66c:_0x9a37('0x10'));},'get':function(){var _0x10d723=this[_0x9a37('0x11')](_0x9a37('0x12'));var _0x406fa0=this['getDataValue'](_0x9a37('0x13'));var _0x158e93=this[_0x9a37('0x11')](_0x9a37('0x14'));if(_0x10d723===_0x9a37('0x4')){if(_0x406fa0==='preview'){return null;}if(_0x406fa0===_0x9a37('0x15')&&![_0x9a37('0x10'),_0x9a37('0x16')][_0x9a37('0x17')](_0x158e93)){this['setDataValue'](_0x9a37('0x14'),_0x9a37('0x10'));}}return _0x158e93;}},'servicelevel':{'type':Sequelize[_0x9a37('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9a37('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9a37('0x6')]},'weight':{'type':Sequelize[_0x9a37('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9a37('0x18')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x9a37('0x19'),'no'),'defaultValue':_0x9a37('0x19')},'autopause':{'type':Sequelize[_0x9a37('0x3')](_0x9a37('0x19'),'no',_0x9a37('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9a37('0x18')](0xb)},'autopausebusy':{'type':Sequelize[_0x9a37('0x3')](_0x9a37('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x9a37('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x9a37('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9a37('0x3')](_0x9a37('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x9a37('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9a37('0x3')](_0x9a37('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9a37('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x9a37('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9a37('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9a37('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9a37('0x3')](_0x9a37('0x19'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9a37('0x3')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x9a37('0x3')]('yes','no',_0x9a37('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9a37('0x3')](_0x9a37('0x19'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9a37('0x6')]},'queue_youarenext':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9a37('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9a37('0x6')]},'queue_quantity1':{'type':Sequelize[_0x9a37('0x6')]},'queue_quantity2':{'type':Sequelize[_0x9a37('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0x9a37('0x6')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x9a37('0x1c')],'set':function(_0x2645fe){this[_0x9a37('0xf')](_0x9a37('0x1d'),_0x2645fe?_0x2645fe[_0x9a37('0x1e')](','):[]);},'get':function(){return this[_0x9a37('0x11')](_0x9a37('0x1d'))?this['getDataValue']('periodic_announce')[_0x9a37('0x1f')](','):[];}},'joinempty':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':'yes','set':function(_0x19a0e3){this[_0x9a37('0xf')]('joinempty',_0x19a0e3?_0x19a0e3[_0x9a37('0x1e')](','):undefined);},'get':function(){return this[_0x9a37('0x11')]('joinempty')?this[_0x9a37('0x11')](_0x9a37('0x20'))[_0x9a37('0x1f')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':'no','set':function(_0x2070d4){this[_0x9a37('0xf')]('leavewhenempty',_0x2070d4?_0x2070d4['join'](','):undefined);},'get':function(){return this[_0x9a37('0x11')](_0x9a37('0x21'))?this[_0x9a37('0x11')](_0x9a37('0x21'))[_0x9a37('0x1f')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9a37('0x3')](_0x9a37('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9a37('0x3')](_0x9a37('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9a37('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x9a37('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9a37('0x6')]},'description':{'type':Sequelize[_0x9a37('0x6')]},'acw':{'type':Sequelize[_0x9a37('0x22')],'defaultValue':0x0,'set':function(_0x4dfde6){this['setDataValue'](_0x9a37('0x23'),_0x4dfde6);if(_0x4dfde6){if(this[_0x9a37('0x11')](_0x9a37('0x24'))<0x2){this[_0x9a37('0xf')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9a37('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9a37('0x22')],'defaultValue':0x0,'comment':_0x9a37('0x25')},'dialMethod':{'type':Sequelize[_0x9a37('0x3')](_0x9a37('0x26'),'progressive',_0x9a37('0x27'),_0x9a37('0x28'),_0x9a37('0x15')),'defaultValue':_0x9a37('0x29'),'comment':_0x9a37('0x2a')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x9a37('0x2b')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9a37('0x2c')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x9a37('0x2b')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9a37('0x2d')},'dialPowerLevel':{'type':Sequelize[_0x9a37('0x2e')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x9a37('0x3')](_0x9a37('0x2f'),_0x9a37('0x30')),'defaultValue':_0x9a37('0x30'),'comment':_0x9a37('0x31')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9a37('0x2e')](0x2)[_0x9a37('0x2b')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9a37('0x32')},'dialPredictiveInterval':{'type':Sequelize[_0x9a37('0x18')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9a37('0x33')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9a37('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9a37('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0x9a37('0x18')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x9a37('0x2b')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a37('0x34')},'dialQueueProject':{'type':Sequelize[_0x9a37('0x6')],'comment':_0x9a37('0x35')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9a37('0x18')](0x3)[_0x9a37('0x2b')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a37('0x36')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9a37('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a37('0x37')},'dialBusyMaxRetry':{'type':Sequelize[_0x9a37('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a37('0x38')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9a37('0x2b')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a37('0x39')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9a37('0x18')](0x3)[_0x9a37('0x2b')],'defaultValue':0x3,'comment':_0x9a37('0x3a')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9a37('0x18')](0x5)[_0x9a37('0x2b')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a37('0x3b')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9a37('0x18')](0x3)[_0x9a37('0x2b')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9a37('0x3c')},'dialTimezone':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x9a37('0x3d')},'dialPrefix':{'type':Sequelize[_0x9a37('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9a37('0x3')](_0x9a37('0x3e'),_0x9a37('0x3f'),_0x9a37('0x40')),'defaultValue':_0x9a37('0x3e')},'dialAMDActive':{'type':Sequelize[_0x9a37('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9a37('0x41')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x9a37('0x2b')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9a37('0x42')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9a37('0x2b')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9a37('0x43')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9a37('0x18')](0x9)[_0x9a37('0x2b')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x9a37('0x18')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9a37('0x44')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9a37('0x18')](0x9)[_0x9a37('0x2b')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9a37('0x45')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9a37('0x18')](0x9)[_0x9a37('0x2b')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9a37('0x46')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9a37('0x18')](0x5)[_0x9a37('0x2b')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9a37('0x47')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x9a37('0x2b')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9a37('0x48')},'dialRecallMeTimeout':{'type':Sequelize[_0x9a37('0x18')](0x5)[_0x9a37('0x2b')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x9a37('0x49')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9a37('0x4a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9a37('0x3')](_0x9a37('0x4b'),_0x9a37('0x4c')),'defaultValue':_0x9a37('0x4b')},'dialQueueProject2':{'type':Sequelize[_0x9a37('0x6')],'comment':_0x9a37('0x35')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x9a37('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9a37('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9a37('0x18')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9a37('0x4d')},'dialCutDigit':{'type':Sequelize[_0x9a37('0x18')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9a37('0x4e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9a37('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a37('0x4f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9a37('0x18')](0x5)[_0x9a37('0x2b')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a37('0x50')},'dialDropMaxRetry':{'type':Sequelize[_0x9a37('0x18')](0x3)[_0x9a37('0x2b')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a37('0x51')},'dialDropRetryFrequency':{'type':Sequelize[_0x9a37('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9a37('0x18')](0x3)[_0x9a37('0x2b')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a37('0x52')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9a37('0x18')](0x5)[_0x9a37('0x2b')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a37('0x53')},'dialMachineMaxRetry':{'type':Sequelize[_0x9a37('0x18')](0x3)[_0x9a37('0x2b')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a37('0x54')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9a37('0x18')](0x5)[_0x9a37('0x2b')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a37('0x55')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9a37('0x18')](0x3)[_0x9a37('0x2b')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a37('0x56')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9a37('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a37('0x57')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9a37('0x18')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9a37('0x58'),'set':function(_0x35d1ed){if(!_0x35d1ed)this[_0x9a37('0xf')](_0x9a37('0x59'),null);this[_0x9a37('0xf')]('mandatoryDisposition',_0x35d1ed);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9a37('0x18')](0x3)[_0x9a37('0x2b')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9a37('0x18')](0x3)[_0x9a37('0x2b')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x9a37('0x22')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x9a37('0x2b')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x9a37('0x22')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index efa4a5b..dc5204d 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 _0x0309=['./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','clone','params','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getHoppers','findOne','CmHopper','hasOwnProperty','rows','getHopperHistories','CmHopperHistory','VoiceQueueId','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','isNil','format','emit','userVoiceQueue:save','removeTeams','Team','ids','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','SELECT','every','includes','all','compact','isEmpty','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','CmListId','toString','cm_contacts','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','phone','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','CmList','getBlackLists','addBlackLists','NOW()','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter'];(function(_0xf9a3e9,_0x62a6e1){var _0x20473c=function(_0x5e605a){while(--_0x5e605a){_0xf9a3e9['push'](_0xf9a3e9['shift']());}};_0x20473c(++_0x62a6e1);}(_0x0309,0x165));var _0x9030=function(_0x3ebce3,_0x530811){_0x3ebce3=_0x3ebce3-0x0;var _0x66897b=_0x0309[_0x3ebce3];return _0x66897b;};'use strict';var emlformat=require(_0x9030('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9030('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9030('0x2'));var moment=require(_0x9030('0x3'));var BPromise=require(_0x9030('0x4'));var Mustache=require(_0x9030('0x5'));var util=require(_0x9030('0x6'));var path=require(_0x9030('0x7'));var sox=require(_0x9030('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9030('0x9'));var _=require(_0x9030('0xa'));var squel=require('squel');var crypto=require(_0x9030('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9030('0xc'));var toCsv=require(_0x9030('0xd'));var querystring=require(_0x9030('0xe'));var Papa=require('papaparse');var Redis=require(_0x9030('0xf'));var authService=require(_0x9030('0x10'));var qs=require(_0x9030('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9030('0x12'));var logger=require(_0x9030('0x13'))(_0x9030('0x14'));var utils=require(_0x9030('0x15'));var config=require(_0x9030('0x16'));var licenseUtil=require(_0x9030('0x17'));var db=require(_0x9030('0x18'))['db'];config['redis']=_[_0x9030('0x19')](config[_0x9030('0x1a')],{'host':_0x9030('0x1b'),'port':0x18eb});var socket=require(_0x9030('0x1c'))(new Redis(config['redis']));require(_0x9030('0x1d'))[_0x9030('0x1e')](socket);function respondWithStatusCode(_0x4a7465,_0x41e659){_0x41e659=_0x41e659||0xcc;return function(_0x4d697a){if(_0x4d697a){return _0x4a7465[_0x9030('0x1f')](_0x41e659);}return _0x4a7465[_0x9030('0x20')](_0x41e659)[_0x9030('0x21')]();};}function respondWithResult(_0xfc6f46,_0x55ac94){_0x55ac94=_0x55ac94||0xc8;return function(_0x213040){if(_0x213040){return _0xfc6f46[_0x9030('0x20')](_0x55ac94)[_0x9030('0x22')](_0x213040);}};}function respondWithFilteredResult(_0x37afac,_0x319db3){return function(_0x1327ec){if(_0x1327ec){var _0x229dcd=typeof _0x319db3[_0x9030('0x23')]===_0x9030('0x24')&&typeof _0x319db3[_0x9030('0x25')]===_0x9030('0x24');var _0x41d506=_0x1327ec[_0x9030('0x26')];var _0x243e7d=_0x229dcd?0x0:_0x319db3[_0x9030('0x23')];var _0x285d93=_0x229dcd?_0x1327ec[_0x9030('0x26')]:_0x319db3['offset']+_0x319db3['limit'];var _0x364d58;if(_0x285d93>=_0x41d506){_0x285d93=_0x41d506;_0x364d58=0xc8;}else{_0x364d58=0xce;}_0x37afac[_0x9030('0x20')](_0x364d58);return _0x37afac['set'](_0x9030('0x27'),_0x243e7d+'-'+_0x285d93+'/'+_0x41d506)[_0x9030('0x22')](_0x1327ec);}return null;};}function patchUpdates(_0x1f806a){return function(_0x3c14ec){try{jsonpatch['apply'](_0x3c14ec,_0x1f806a,!![]);}catch(_0x4753b2){return BPromise['reject'](_0x4753b2);}return _0x3c14ec['save']();};}function saveUpdates(_0xe65792,_0x2b205c){return function(_0xcea904){if(_0xcea904){return _0xcea904['update'](_0xe65792)[_0x9030('0x28')](function(_0x408ce6){return _0x408ce6;});}return null;};}function removeEntity(_0x35adfe,_0xce2840){return function(_0x43ca87){if(_0x43ca87){return _0x43ca87['destroy']()[_0x9030('0x28')](function(){var _0x455eeb=_0x43ca87[_0x9030('0x29')]({'plain':!![]});var _0x463dda=[{'name':_0x9030('0x2a'),'value':_0x9030('0x2b'),'ignore':![]},{'name':_0x9030('0x2c'),'value':_0x9030('0x2d'),'ignore':![]}];var _0x26a803=_(_0x463dda)[_0x9030('0x2e')](_0x9030('0x2f'))[_0x9030('0x30')](_0x9030('0x31'))[_0x9030('0x31')]();if(_['includes'](_0x26a803,_0x455eeb[_0x9030('0x32')])){return;}var _0x4b042c=_[_0x9030('0x33')](_0x463dda,['value',_0x455eeb[_0x9030('0x32')]])[_0x9030('0x34')];return db[_0x9030('0x35')]['destroy']({'where':{'type':_0x4b042c,'resourceId':_0x455eeb['id']}})[_0x9030('0x28')](function(){return _0x43ca87;});})[_0x9030('0x28')](function(){_0x35adfe[_0x9030('0x20')](0xcc)[_0x9030('0x21')]();});}};}function handleEntityNotFound(_0xe2f7c1,_0x14619b){return function(_0x754e00){if(!_0x754e00){_0xe2f7c1[_0x9030('0x1f')](0x194);}return _0x754e00;};}function handleError(_0x134260,_0x3400db){_0x3400db=_0x3400db||0x1f4;return function(_0x42fbf8){logger[_0x9030('0x36')](_0x42fbf8[_0x9030('0x37')]);if(_0x42fbf8[_0x9030('0x34')]){delete _0x42fbf8[_0x9030('0x34')];}_0x134260[_0x9030('0x20')](_0x3400db)[_0x9030('0x38')](_0x42fbf8);};}exports[_0x9030('0x39')]=function(_0x54ebae,_0x582e57){var _0x3779bc={},_0x29ffda={},_0x56c0c6={'count':0x0,'rows':[]};var _0x58cea7=_[_0x9030('0x30')](db[_0x9030('0x3a')][_0x9030('0x3b')],function(_0x3ffd44){return{'name':_0x3ffd44['fieldName'],'type':_0x3ffd44[_0x9030('0x32')]['key']};});_0x29ffda[_0x9030('0x3c')]=_[_0x9030('0x30')](_0x58cea7,'name');_0x29ffda[_0x9030('0x3d')]=_[_0x9030('0x3e')](_0x54ebae[_0x9030('0x3d')]);_0x29ffda['filters']=_[_0x9030('0x3f')](_0x29ffda['model'],_0x29ffda[_0x9030('0x3d')]);_0x3779bc['attributes']=_[_0x9030('0x3f')](_0x29ffda['model'],qs[_0x9030('0x40')](_0x54ebae[_0x9030('0x3d')][_0x9030('0x40')]));_0x3779bc[_0x9030('0x41')]=_0x3779bc[_0x9030('0x41')][_0x9030('0x42')]?_0x3779bc[_0x9030('0x41')]:_0x29ffda[_0x9030('0x3c')];if(!_0x54ebae[_0x9030('0x3d')]['hasOwnProperty'](_0x9030('0x43'))){_0x3779bc[_0x9030('0x25')]=qs[_0x9030('0x25')](_0x54ebae['query'][_0x9030('0x25')]);_0x3779bc[_0x9030('0x23')]=qs[_0x9030('0x23')](_0x54ebae[_0x9030('0x3d')]['offset']);}_0x3779bc[_0x9030('0x44')]=qs[_0x9030('0x45')](_0x54ebae[_0x9030('0x3d')]['sort']);_0x3779bc[_0x9030('0x46')]=qs[_0x9030('0x47')](_[_0x9030('0x48')](_0x54ebae[_0x9030('0x3d')],_0x29ffda[_0x9030('0x47')]),_0x58cea7);if(_0x54ebae['query'][_0x9030('0x2e')]){_0x3779bc['where']=_[_0x9030('0x49')](_0x3779bc[_0x9030('0x46')],{'$or':_[_0x9030('0x30')](_0x58cea7,function(_0x435eb8){if(_0x435eb8[_0x9030('0x32')]!==_0x9030('0x4a')){var _0x355f82={};_0x355f82[_0x435eb8[_0x9030('0x34')]]={'$like':'%'+_0x54ebae['query'][_0x9030('0x2e')]+'%'};return _0x355f82;}})});}_0x3779bc=_[_0x9030('0x49')]({},_0x3779bc,_0x54ebae[_0x9030('0x4b')]);var _0x2b6270={'where':_0x3779bc[_0x9030('0x46')]};return db[_0x9030('0x3a')][_0x9030('0x26')](_0x2b6270)[_0x9030('0x28')](function(_0x141f97){_0x56c0c6[_0x9030('0x26')]=_0x141f97;if(_0x54ebae[_0x9030('0x3d')][_0x9030('0x4c')]){_0x3779bc[_0x9030('0x4d')]=[{'all':!![]}];}return db[_0x9030('0x3a')]['findAll'](_0x3779bc);})[_0x9030('0x28')](function(_0x2e0283){_0x56c0c6['rows']=_0x2e0283;return _0x56c0c6;})[_0x9030('0x28')](respondWithFilteredResult(_0x582e57,_0x3779bc))[_0x9030('0x4e')](handleError(_0x582e57,null));};exports[_0x9030('0x4f')]=function(_0x4c3e62,_0x53030b){var _0x16154f={'raw':![],'where':{'id':_0x4c3e62['params']['id']}},_0x4d8197={};_0x4d8197[_0x9030('0x3c')]=_[_0x9030('0x3e')](db[_0x9030('0x3a')][_0x9030('0x3b')]);_0x4d8197['query']=_[_0x9030('0x3e')](_0x4c3e62['query']);_0x4d8197[_0x9030('0x47')]=_[_0x9030('0x3f')](_0x4d8197[_0x9030('0x3c')],_0x4d8197['query']);_0x16154f[_0x9030('0x41')]=_[_0x9030('0x3f')](_0x4d8197[_0x9030('0x3c')],qs['fields'](_0x4c3e62[_0x9030('0x3d')][_0x9030('0x40')]));_0x16154f['attributes']=_0x16154f[_0x9030('0x41')]['length']?_0x16154f[_0x9030('0x41')]:_0x4d8197['model'];if(_0x4c3e62[_0x9030('0x3d')][_0x9030('0x4c')]){_0x16154f[_0x9030('0x4d')]=[{'all':!![]}];}_0x16154f=_[_0x9030('0x49')]({},_0x16154f,_0x4c3e62[_0x9030('0x4b')]);return db[_0x9030('0x3a')]['find'](_0x16154f)[_0x9030('0x28')](handleEntityNotFound(_0x53030b,null))[_0x9030('0x28')](respondWithResult(_0x53030b,null))[_0x9030('0x4e')](handleError(_0x53030b,null));};exports[_0x9030('0x50')]=function(_0x127c87,_0x573088){return db['VoiceQueue'][_0x9030('0x50')](_0x127c87[_0x9030('0x51')],{})[_0x9030('0x28')](function(_0x241080){var _0x205d6f=_0x127c87[_0x9030('0x52')][_0x9030('0x29')]({'plain':!![]});if(!_0x205d6f)throw new Error(_0x9030('0x53'));if(_0x205d6f[_0x9030('0x54')]===_0x9030('0x52')){var _0x297a84=_0x241080[_0x9030('0x29')]({'plain':!![]});var _0x3092f8=[{'name':'VoiceQueues','value':_0x9030('0x2b')},{'name':_0x9030('0x2c'),'value':'outbound'}];var _0x5c4218=_[_0x9030('0x33')](_0x3092f8,[_0x9030('0x31'),_0x297a84[_0x9030('0x32')]])[_0x9030('0x34')];return db[_0x9030('0x55')][_0x9030('0x33')]({'where':{'name':_0x5c4218,'userProfileId':_0x205d6f['userProfileId']},'raw':!![]})['then'](function(_0x2051d9){if(_0x2051d9&&_0x2051d9[_0x9030('0x56')]===0x0){return db[_0x9030('0x35')][_0x9030('0x50')]({'name':_0x297a84['name'],'resourceId':_0x297a84['id'],'type':_0x2051d9[_0x9030('0x34')],'sectionId':_0x2051d9['id']},{})[_0x9030('0x28')](function(){return _0x241080;});}else{return _0x241080;}})[_0x9030('0x4e')](function(_0x326782){logger[_0x9030('0x36')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x326782);throw _0x326782;});}return _0x241080;})['then'](respondWithResult(_0x573088,0xc9))[_0x9030('0x4e')](handleError(_0x573088,null));};exports[_0x9030('0x57')]=function(_0x25719b,_0x19f84e){var _0x3f3153={'where':{'id':_0x25719b[_0x9030('0x58')]['id']}},_0x17bf72={};_0x17bf72[_0x9030('0x3c')]=_[_0x9030('0x3e')](db[_0x9030('0x3a')]['rawAttributes']);_0x3f3153[_0x9030('0x41')]=_[_0x9030('0x3f')](_0x17bf72[_0x9030('0x3c')],qs[_0x9030('0x40')](_0x25719b[_0x9030('0x3d')][_0x9030('0x40')]));_0x3f3153[_0x9030('0x41')]=_0x3f3153['attributes']['length']?_0x3f3153[_0x9030('0x41')]:_0x17bf72[_0x9030('0x3c')];if(_0x25719b[_0x9030('0x3d')][_0x9030('0x4c')]){_0x3f3153[_0x9030('0x4d')]=[{'all':!![]}];}_0x3f3153=_[_0x9030('0x49')]({},_0x3f3153,_0x25719b[_0x9030('0x4b')]);return db['VoiceQueue']['find'](_0x3f3153)['then'](handleEntityNotFound(_0x19f84e,null))[_0x9030('0x28')](function(_0x580722){if(_0x580722){var _0x1cd8f5=_0x580722['get']({'plain':!![]});_0x1cd8f5=qs[_0x9030('0x59')](_0x1cd8f5,['id',_0x9030('0x5a'),_0x9030('0x5b')]);_0x25719b[_0x9030('0x51')]=_[_0x9030('0x59')](_0x25719b[_0x9030('0x51')],['id',_0x9030('0x5a'),_0x9030('0x5b')]);return db[_0x9030('0x3a')][_0x9030('0x50')](_[_0x9030('0x49')](_0x1cd8f5,_0x25719b[_0x9030('0x51')]),{'include':_0x25719b[_0x9030('0x3d')][_0x9030('0x4c')]?[{'all':!![]}]:undefined})['then'](function(_0x119835){var _0x3f381e=_0x25719b[_0x9030('0x52')][_0x9030('0x29')]({'plain':!![]});if(!_0x3f381e)throw new Error(_0x9030('0x53'));if(_0x3f381e[_0x9030('0x54')]==='user'){var _0x1f6ed9=_0x119835[_0x9030('0x29')]({'plain':!![]});var _0x299594=[{'name':_0x9030('0x2a'),'value':_0x9030('0x2b')},{'name':'QueueCampaigns','value':_0x9030('0x2d')}];var _0x486786=_[_0x9030('0x33')](_0x299594,['value',_0x1f6ed9[_0x9030('0x32')]])[_0x9030('0x34')];return db['UserProfileSection']['find']({'where':{'name':_0x486786,'userProfileId':_0x3f381e['userProfileId']},'raw':!![]})[_0x9030('0x28')](function(_0x4a397a){if(_0x4a397a&&_0x4a397a[_0x9030('0x56')]===0x0){return db[_0x9030('0x35')][_0x9030('0x50')]({'name':_0x1f6ed9['name'],'resourceId':_0x1f6ed9['id'],'type':_0x4a397a[_0x9030('0x34')],'sectionId':_0x4a397a['id']},{})[_0x9030('0x28')](function(){return _0x119835;});}else{return _0x119835;}})[_0x9030('0x4e')](function(_0x6cb4bd){logger['error'](_0x9030('0x5c'),_0x6cb4bd);throw _0x6cb4bd;});}return _0x119835;});}})[_0x9030('0x28')](respondWithResult(_0x19f84e,0xc9))[_0x9030('0x4e')](handleError(_0x19f84e,null));};exports['update']=function(_0x1b4ca5,_0x24973e){if(_0x1b4ca5['body']['id']){delete _0x1b4ca5[_0x9030('0x51')]['id'];}return db[_0x9030('0x3a')][_0x9030('0x33')]({'where':{'id':_0x1b4ca5['params']['id']}})[_0x9030('0x28')](handleEntityNotFound(_0x24973e,null))['then'](saveUpdates(_0x1b4ca5[_0x9030('0x51')],null))[_0x9030('0x28')](respondWithResult(_0x24973e,null))[_0x9030('0x4e')](handleError(_0x24973e,null));};exports[_0x9030('0x5d')]=function(_0x18dfac,_0x156f46){return db[_0x9030('0x3a')]['find']({'where':{'id':_0x18dfac[_0x9030('0x58')]['id']}})['then'](handleEntityNotFound(_0x156f46,null))[_0x9030('0x28')](removeEntity(_0x156f46,null))[_0x9030('0x4e')](handleError(_0x156f46,null));};exports[_0x9030('0x5e')]=function(_0x2e19e5,_0x338c2b,_0x55ecc6){var _0x53e328={'raw':![],'where':{}};var _0x563ead={};var _0x2148e5={'count':0x0,'rows':[]};return db[_0x9030('0x3a')][_0x9030('0x5f')]({'where':{'id':_0x2e19e5['params']['id']}})[_0x9030('0x28')](handleEntityNotFound(_0x338c2b,null))[_0x9030('0x28')](function(_0x1eb537){if(_0x1eb537){_0x563ead['model']=_[_0x9030('0x3e')](db[_0x9030('0x60')][_0x9030('0x3b')]);_0x563ead[_0x9030('0x3d')]=_[_0x9030('0x3e')](_0x2e19e5['query']);_0x563ead[_0x9030('0x47')]=_[_0x9030('0x3f')](_0x563ead[_0x9030('0x3c')],_0x563ead['query']);_0x53e328[_0x9030('0x41')]=_[_0x9030('0x3f')](_0x563ead[_0x9030('0x3c')],qs[_0x9030('0x40')](_0x2e19e5['query']['fields']));_0x53e328[_0x9030('0x41')]=_0x53e328[_0x9030('0x41')][_0x9030('0x42')]?_0x53e328[_0x9030('0x41')]:_0x563ead[_0x9030('0x3c')];if(!_0x2e19e5['query'][_0x9030('0x61')](_0x9030('0x43'))){_0x53e328[_0x9030('0x25')]=qs[_0x9030('0x25')](_0x2e19e5[_0x9030('0x3d')]['limit']);_0x53e328[_0x9030('0x23')]=qs['offset'](_0x2e19e5[_0x9030('0x3d')][_0x9030('0x23')]);}_0x53e328[_0x9030('0x44')]=qs['sort'](_0x2e19e5['query'][_0x9030('0x45')]);_0x53e328[_0x9030('0x46')]=qs[_0x9030('0x47')](_[_0x9030('0x48')](_0x2e19e5[_0x9030('0x3d')],_0x563ead[_0x9030('0x47')]));_0x53e328[_0x9030('0x46')]['VoiceQueueId']=_0x1eb537['id'];if(_0x2e19e5[_0x9030('0x3d')][_0x9030('0x2e')]){_0x53e328['where']=_[_0x9030('0x49')](_0x53e328[_0x9030('0x46')],{'$or':_[_0x9030('0x30')](_0x53e328[_0x9030('0x41')],function(_0x346368){var _0x286d5d={};_0x286d5d[_0x346368]={'$like':'%'+_0x2e19e5[_0x9030('0x3d')][_0x9030('0x2e')]+'%'};return _0x286d5d;})});}_0x53e328=_[_0x9030('0x49')]({},_0x53e328,_0x2e19e5['options']);return db[_0x9030('0x60')]['count']({'where':_0x53e328['where']})['then'](function(_0x39414f){_0x2148e5[_0x9030('0x26')]=_0x39414f;if(_0x2e19e5[_0x9030('0x3d')][_0x9030('0x4c')]){_0x53e328[_0x9030('0x4d')]=[{'all':!![]}];}return db[_0x9030('0x60')]['findAll'](_0x53e328);})[_0x9030('0x28')](function(_0x78850b){_0x2148e5[_0x9030('0x62')]=_0x78850b;return _0x2148e5;});}})[_0x9030('0x28')](respondWithFilteredResult(_0x338c2b,_0x53e328))[_0x9030('0x4e')](handleError(_0x338c2b,null));};exports[_0x9030('0x63')]=function(_0x228c78,_0x39e215,_0x208a8d){var _0x14528a={'raw':!![],'where':{}};var _0x73b926={};var _0x1fad1b={'count':0x0,'rows':[]};return db[_0x9030('0x3a')]['findOne']({'where':{'id':_0x228c78['params']['id']}})[_0x9030('0x28')](handleEntityNotFound(_0x39e215,null))[_0x9030('0x28')](function(_0x4f1860){if(_0x4f1860){_0x73b926[_0x9030('0x3c')]=_[_0x9030('0x3e')](db[_0x9030('0x64')][_0x9030('0x3b')]);_0x73b926[_0x9030('0x3d')]=_['keys'](_0x228c78[_0x9030('0x3d')]);_0x73b926[_0x9030('0x47')]=_[_0x9030('0x3f')](_0x73b926['model'],_0x73b926['query']);_0x14528a['attributes']=_[_0x9030('0x3f')](_0x73b926[_0x9030('0x3c')],qs['fields'](_0x228c78['query'][_0x9030('0x40')]));_0x14528a[_0x9030('0x41')]=_0x14528a['attributes'][_0x9030('0x42')]?_0x14528a[_0x9030('0x41')]:_0x73b926[_0x9030('0x3c')];if(!_0x228c78[_0x9030('0x3d')][_0x9030('0x61')](_0x9030('0x43'))){_0x14528a[_0x9030('0x25')]=qs['limit'](_0x228c78[_0x9030('0x3d')]['limit']);_0x14528a[_0x9030('0x23')]=qs[_0x9030('0x23')](_0x228c78['query']['offset']);}_0x14528a[_0x9030('0x44')]=qs[_0x9030('0x45')](_0x228c78['query'][_0x9030('0x45')]);_0x14528a['where']=qs[_0x9030('0x47')](_[_0x9030('0x48')](_0x228c78[_0x9030('0x3d')],_0x73b926[_0x9030('0x47')]));_0x14528a[_0x9030('0x46')][_0x9030('0x65')]=_0x4f1860['id'];if(_0x228c78[_0x9030('0x3d')][_0x9030('0x2e')]){_0x14528a['where']=_[_0x9030('0x49')](_0x14528a[_0x9030('0x46')],{'$or':_[_0x9030('0x30')](_0x14528a[_0x9030('0x41')],function(_0x107fd6){var _0x24a51d={};_0x24a51d[_0x107fd6]={'$like':'%'+_0x228c78['query'][_0x9030('0x2e')]+'%'};return _0x24a51d;})});}_0x14528a=_[_0x9030('0x49')]({},_0x14528a,_0x228c78[_0x9030('0x4b')]);return db[_0x9030('0x64')]['count']({'where':_0x14528a[_0x9030('0x46')]})[_0x9030('0x28')](function(_0x473fdc){_0x1fad1b[_0x9030('0x26')]=_0x473fdc;if(_0x228c78[_0x9030('0x3d')][_0x9030('0x4c')]){_0x14528a[_0x9030('0x4d')]=[{'all':!![]}];}return db[_0x9030('0x64')][_0x9030('0x66')](_0x14528a);})['then'](function(_0x3197a6){_0x1fad1b[_0x9030('0x62')]=_0x3197a6;return _0x1fad1b;});}})['then'](respondWithFilteredResult(_0x39e215,_0x14528a))[_0x9030('0x4e')](handleError(_0x39e215,null));};exports[_0x9030('0x67')]=function(_0x331f49,_0x3d439e,_0x22c0a3){var _0x7bf24f={'raw':!![],'where':{}};var _0x3a2f1b={};var _0x3a36b0={'count':0x0,'rows':[]};return db[_0x9030('0x3a')][_0x9030('0x5f')]({'where':{'id':_0x331f49[_0x9030('0x58')]['id']}})[_0x9030('0x28')](handleEntityNotFound(_0x3d439e,null))['then'](function(_0x49614e){if(_0x49614e){_0x3a2f1b[_0x9030('0x3c')]=_[_0x9030('0x3e')](db[_0x9030('0x68')][_0x9030('0x3b')]);_0x3a2f1b[_0x9030('0x3d')]=_[_0x9030('0x3e')](_0x331f49['query']);_0x3a2f1b[_0x9030('0x47')]=_[_0x9030('0x3f')](_0x3a2f1b[_0x9030('0x3c')],_0x3a2f1b[_0x9030('0x3d')]);_0x7bf24f[_0x9030('0x41')]=_[_0x9030('0x3f')](_0x3a2f1b[_0x9030('0x3c')],qs[_0x9030('0x40')](_0x331f49[_0x9030('0x3d')][_0x9030('0x40')]));_0x7bf24f[_0x9030('0x41')]=_0x7bf24f['attributes'][_0x9030('0x42')]?_0x7bf24f[_0x9030('0x41')]:_0x3a2f1b['model'];if(!_0x331f49[_0x9030('0x3d')][_0x9030('0x61')]('nolimit')){_0x7bf24f[_0x9030('0x25')]=qs['limit'](_0x331f49[_0x9030('0x3d')][_0x9030('0x25')]);_0x7bf24f[_0x9030('0x23')]=qs[_0x9030('0x23')](_0x331f49[_0x9030('0x3d')][_0x9030('0x23')]);}_0x7bf24f['order']=qs[_0x9030('0x45')](_0x331f49[_0x9030('0x3d')][_0x9030('0x45')]);_0x7bf24f[_0x9030('0x46')]=qs[_0x9030('0x47')](_[_0x9030('0x48')](_0x331f49[_0x9030('0x3d')],_0x3a2f1b['filters']));_0x7bf24f[_0x9030('0x46')][_0x9030('0x65')]=_0x49614e['id'];if(_0x331f49['query'][_0x9030('0x2e')]){_0x7bf24f[_0x9030('0x46')]=_[_0x9030('0x49')](_0x7bf24f[_0x9030('0x46')],{'$or':_[_0x9030('0x30')](_0x7bf24f[_0x9030('0x41')],function(_0x1f7292){var _0x45d673={};_0x45d673[_0x1f7292]={'$like':'%'+_0x331f49[_0x9030('0x3d')][_0x9030('0x2e')]+'%'};return _0x45d673;})});}_0x7bf24f=_['merge']({},_0x7bf24f,_0x331f49[_0x9030('0x4b')]);return db[_0x9030('0x68')][_0x9030('0x26')]({'where':_0x7bf24f['where']})[_0x9030('0x28')](function(_0x1ea0f8){_0x3a36b0[_0x9030('0x26')]=_0x1ea0f8;if(_0x331f49[_0x9030('0x3d')][_0x9030('0x4c')]){_0x7bf24f['include']=[{'all':!![]}];}return db[_0x9030('0x68')]['findAll'](_0x7bf24f);})[_0x9030('0x28')](function(_0x4cbad6){_0x3a36b0[_0x9030('0x62')]=_0x4cbad6;return _0x3a36b0;});}})['then'](respondWithFilteredResult(_0x3d439e,_0x7bf24f))['catch'](handleError(_0x3d439e,null));};exports[_0x9030('0x69')]=function(_0x1a65e2,_0x1fd310,_0x339a98){var _0x3edfc3={'raw':!![],'where':{}};var _0x3c260a={};var _0x17d78d={'count':0x0,'rows':[]};return db[_0x9030('0x3a')][_0x9030('0x5f')]({'where':{'id':_0x1a65e2[_0x9030('0x58')]['id']}})['then'](handleEntityNotFound(_0x1fd310,null))[_0x9030('0x28')](function(_0x1a908b){if(_0x1a908b){_0x3c260a[_0x9030('0x3c')]=_[_0x9030('0x3e')](db[_0x9030('0x6a')][_0x9030('0x3b')]);_0x3c260a[_0x9030('0x3d')]=_[_0x9030('0x3e')](_0x1a65e2[_0x9030('0x3d')]);_0x3c260a['filters']=_[_0x9030('0x3f')](_0x3c260a[_0x9030('0x3c')],_0x3c260a[_0x9030('0x3d')]);_0x3edfc3[_0x9030('0x41')]=_[_0x9030('0x3f')](_0x3c260a[_0x9030('0x3c')],qs['fields'](_0x1a65e2[_0x9030('0x3d')][_0x9030('0x40')]));_0x3edfc3[_0x9030('0x41')]=_0x3edfc3[_0x9030('0x41')][_0x9030('0x42')]?_0x3edfc3[_0x9030('0x41')]:_0x3c260a[_0x9030('0x3c')];if(!_0x1a65e2[_0x9030('0x3d')][_0x9030('0x61')](_0x9030('0x43'))){_0x3edfc3['limit']=qs[_0x9030('0x25')](_0x1a65e2[_0x9030('0x3d')]['limit']);_0x3edfc3[_0x9030('0x23')]=qs[_0x9030('0x23')](_0x1a65e2['query'][_0x9030('0x23')]);}_0x3edfc3[_0x9030('0x44')]=qs[_0x9030('0x45')](_0x1a65e2[_0x9030('0x3d')][_0x9030('0x45')]);_0x3edfc3['where']=qs[_0x9030('0x47')](_[_0x9030('0x48')](_0x1a65e2[_0x9030('0x3d')],_0x3c260a[_0x9030('0x47')]));_0x3edfc3[_0x9030('0x46')][_0x9030('0x65')]=_0x1a908b['id'];if(_0x1a65e2[_0x9030('0x3d')][_0x9030('0x2e')]){_0x3edfc3['where']=_[_0x9030('0x49')](_0x3edfc3['where'],{'$or':_[_0x9030('0x30')](_0x3edfc3['attributes'],function(_0x265cec){var _0x44592a={};_0x44592a[_0x265cec]={'$like':'%'+_0x1a65e2[_0x9030('0x3d')][_0x9030('0x2e')]+'%'};return _0x44592a;})});}_0x3edfc3=_[_0x9030('0x49')]({},_0x3edfc3,_0x1a65e2[_0x9030('0x4b')]);return db[_0x9030('0x6a')][_0x9030('0x26')]({'where':_0x3edfc3['where']})[_0x9030('0x28')](function(_0x29e0e7){_0x17d78d[_0x9030('0x26')]=_0x29e0e7;if(_0x1a65e2[_0x9030('0x3d')][_0x9030('0x4c')]){_0x3edfc3['include']=[{'all':!![]}];}return db[_0x9030('0x6a')][_0x9030('0x66')](_0x3edfc3);})[_0x9030('0x28')](function(_0x4fa249){_0x17d78d[_0x9030('0x62')]=_0x4fa249;return _0x17d78d;});}})[_0x9030('0x28')](respondWithFilteredResult(_0x1fd310,_0x3edfc3))[_0x9030('0x4e')](handleError(_0x1fd310,null));};exports[_0x9030('0x6b')]=function(_0xdb6a45,_0x165c68,_0x1a4c48){var _0xd80634={};var _0x4541e5={};var _0x229fba;var _0x54baf5;return db[_0x9030('0x3a')][_0x9030('0x5f')]({'where':{'id':_0xdb6a45[_0x9030('0x58')]['id']}})[_0x9030('0x28')](handleEntityNotFound(_0x165c68,null))[_0x9030('0x28')](function(_0x5bbef4){if(_0x5bbef4){_0x229fba=_0x5bbef4;_0x4541e5['model']=_[_0x9030('0x3e')](db['Team'][_0x9030('0x3b')]);_0x4541e5[_0x9030('0x3d')]=_[_0x9030('0x3e')](_0xdb6a45[_0x9030('0x3d')]);_0x4541e5[_0x9030('0x47')]=_[_0x9030('0x3f')](_0x4541e5['model'],_0x4541e5[_0x9030('0x3d')]);_0xd80634[_0x9030('0x41')]=_[_0x9030('0x3f')](_0x4541e5['model'],qs[_0x9030('0x40')](_0xdb6a45[_0x9030('0x3d')][_0x9030('0x40')]));_0xd80634[_0x9030('0x41')]=_0xd80634[_0x9030('0x41')][_0x9030('0x42')]?_0xd80634[_0x9030('0x41')]:_0x4541e5[_0x9030('0x3c')];_0xd80634[_0x9030('0x44')]=qs[_0x9030('0x45')](_0xdb6a45['query']['sort']);_0xd80634['where']=qs[_0x9030('0x47')](_[_0x9030('0x48')](_0xdb6a45[_0x9030('0x3d')],_0x4541e5[_0x9030('0x47')]));if(_0xdb6a45[_0x9030('0x3d')]['filter']){_0xd80634['where']=_['merge'](_0xd80634[_0x9030('0x46')],{'$or':_[_0x9030('0x30')](_0xd80634[_0x9030('0x41')],function(_0x27e764){var _0x2ec460={};_0x2ec460[_0x27e764]={'$like':'%'+_0xdb6a45['query'][_0x9030('0x2e')]+'%'};return _0x2ec460;})});}_0xd80634=_[_0x9030('0x49')]({},_0xd80634,_0xdb6a45[_0x9030('0x4b')]);return _0x229fba['getTeams'](_0xd80634);}})['then'](function(_0x18e841){if(_0x18e841){_0x54baf5=_0x18e841[_0x9030('0x42')];if(!_0xdb6a45[_0x9030('0x3d')][_0x9030('0x61')]('nolimit')){_0xd80634['limit']=qs['limit'](_0xdb6a45[_0x9030('0x3d')][_0x9030('0x25')]);_0xd80634[_0x9030('0x23')]=qs[_0x9030('0x23')](_0xdb6a45[_0x9030('0x3d')][_0x9030('0x23')]);}return _0x229fba['getTeams'](_0xd80634);}})[_0x9030('0x28')](function(_0x4c844e){if(_0x4c844e){return _0x4c844e?{'count':_0x54baf5,'rows':_0x4c844e}:null;}})['then'](respondWithResult(_0x165c68,null))[_0x9030('0x4e')](handleError(_0x165c68,null));};exports[_0x9030('0x6c')]=function(_0x4ee5bc,_0xc5e4a2,_0x4d4b48){var _0x5600de=_0x4ee5bc['body'][_0x9030('0x6d')];var _0x1da6df=_[_0x9030('0x30')](_0x5600de,'id');return db['Team'][_0x9030('0x66')]({'where':{'id':_0x1da6df},'attributes':['id'],'include':[{'model':db[_0x9030('0x6e')],'as':_0x9030('0x6f'),'attributes':['id','name',_0x9030('0x70'),_0x9030('0x71'),_0x9030('0x72')],'raw':!![]}]})[_0x9030('0x28')](function(_0x402593){if(_0x402593){var _0x5bf7b0=_[_0x9030('0x73')](_0x402593,function(_0x429d20){var _0x2db35b=_0x429d20[_0x9030('0x29')]({'plain':!![]});_0x2db35b[_0x9030('0x6f')][_0x9030('0x74')](function(_0x383247){_0x383247[_0x9030('0x75')]=_[_0x9030('0x33')](_0x5600de,{'id':_0x2db35b['id']})[_0x9030('0x75')];});return _0x2db35b[_0x9030('0x6f')];});return db[_0x9030('0x3a')][_0x9030('0x33')]({'where':{'id':_0x4ee5bc[_0x9030('0x58')]['id']}})['then'](function(_0x5e3275){return db[_0x9030('0x76')][_0x9030('0x77')](function(_0x3cac6d){return _0x5e3275[_0x9030('0x6c')](_0x1da6df,{'transaction':_0x3cac6d})[_0x9030('0x28')](function(){return BPromise[_0x9030('0x78')](_0x5600de,function(_0x5800f5){return db[_0x9030('0x79')][_0x9030('0x7a')]({'TeamId':_0x5800f5['id'],'VoiceQueueId':_0x4ee5bc[_0x9030('0x58')]['id'],'penalty':_0x5800f5[_0x9030('0x75')]},{'transaction':_0x3cac6d});});})['then'](function(){return BPromise[_0x9030('0x78')](_0x5bf7b0,function(_0x3f06d2){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x3f06d2['id'],'VoiceQueueId':_0x4ee5bc[_0x9030('0x58')]['id']},'defaults':{'penalty':_0x3f06d2[_0x9030('0x75')]},'transaction':_0x3cac6d});});})['then'](function(){return BPromise[_0x9030('0x78')](_[_0x9030('0x2e')](_0x5bf7b0,{'online':!![]}),function(_0x20318b){return db['UserVoiceQueueRt'][_0x9030('0x7a')]({'membername':_0x20318b[_0x9030('0x34')],'UserId':_0x20318b['id'],'queue_name':_0x5e3275[_0x9030('0x34')],'VoiceQueueId':_0x5e3275['id'],'interface':_[_0x9030('0x7b')](_0x20318b[_0x9030('0x72')])?util[_0x9030('0x7c')]('SIP/%s',_0x20318b[_0x9030('0x34')]):_0x20318b['interface'],'paused':_0x20318b[_0x9030('0x71')]||![],'penalty':_0x20318b[_0x9030('0x75')]},{'transaction':_0x3cac6d});});})[_0x9030('0x28')](function(){_0x5bf7b0[_0x9030('0x74')](function(_0x398525){socket[_0x9030('0x7d')](_0x9030('0x7e'),{'UserId':_0x398525['id'],'VoiceQueueId':_0x5e3275['id']});});});});});}})[_0x9030('0x28')](respondWithStatusCode(_0xc5e4a2,null))[_0x9030('0x4e')](handleError(_0xc5e4a2,null));};exports[_0x9030('0x7f')]=function(_0x252404,_0x4a7a0b,_0x47618e){return db[_0x9030('0x80')][_0x9030('0x66')]({'where':{'id':_0x252404['query'][_0x9030('0x81')]},'attributes':['id'],'include':[{'model':db[_0x9030('0x6e')],'as':_0x9030('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x9030('0x28')](handleEntityNotFound(_0x4a7a0b,null))['then'](function(_0x13a615){var _0x180e4f=_[_0x9030('0x30')](_0x13a615,'id');var _0x59d747=[];var _0x4e0691=[];var _0x2b44e=squel[_0x9030('0x82')]();_0x2b44e[_0x9030('0x83')](_0x9030('0x84'))[_0x9030('0x85')](_0x9030('0x86'),'tq')['join'](_0x9030('0x87'),'ut',_0x9030('0x88'))['where'](_0x9030('0x89'),_0x252404[_0x9030('0x58')]['id']);for(var _0x338a4b=0x0;_0x338a4b<_0x13a615[_0x9030('0x42')];_0x338a4b+=0x1){let _0x47b91f=_0x13a615[_0x338a4b];for(var _0x2c3902=0x0;_0x2c3902<_0x47b91f[_0x9030('0x6f')]['length'];_0x2c3902+=0x1){let _0xc8ded0=_0x47b91f[_0x9030('0x6f')][_0x2c3902];var _0x22b1d2=_0x2b44e[_0x9030('0x57')]();_0x22b1d2[_0x9030('0x46')]('ut.UserId\x20=\x20?',_0xc8ded0['id']);_0x4e0691[_0x9030('0x8a')](db[_0x9030('0x76')][_0x9030('0x3d')](_0x22b1d2['toString'](),{'type':db['sequelize']['QueryTypes'][_0x9030('0x8b')]})[_0x9030('0x28')](function(_0x321c60){if(_0x321c60['length']===0x1){return _0xc8ded0['id'];}else{var _0x283cf2=_[_0x9030('0x8c')](_[_0x9030('0x30')](_0x321c60,'TeamId'),function(_0x525978){return _[_0x9030('0x8d')](_0x180e4f,_0x525978);});if(_0x283cf2){return _0xc8ded0['id'];}}}));}}return BPromise[_0x9030('0x8e')](_0x4e0691)[_0x9030('0x28')](function(_0x3f6a3a){_0x59d747=_(_0x59d747)['union'](_0x3f6a3a)[_0x9030('0x8f')]()[_0x9030('0x31')]();return db[_0x9030('0x3a')][_0x9030('0x33')]({'where':{'id':_0x252404[_0x9030('0x58')]['id']}})[_0x9030('0x28')](function(_0x3e5ab2){return db[_0x9030('0x76')]['transaction'](function(_0x1ec161){return _0x3e5ab2[_0x9030('0x7f')](_0x252404[_0x9030('0x3d')][_0x9030('0x81')],{'transaction':_0x1ec161})['then'](function(){if(!_[_0x9030('0x90')](_0x59d747)){return _0x3e5ab2['removeAgents'](_0x59d747,{'transaction':_0x1ec161})[_0x9030('0x28')](function(){return db[_0x9030('0x91')][_0x9030('0x5d')]({'where':{'VoiceQueueId':_0x252404['params']['id'],'UserId':_0x59d747},'transaction':_0x1ec161});});}})[_0x9030('0x28')](function(){_0x59d747[_0x9030('0x74')](function(_0x2f97e8){socket['emit'](_0x9030('0x92'),{'UserId':_0x2f97e8,'VoiceQueueId':_0x3e5ab2['id']});});});});});});})[_0x9030('0x28')](respondWithStatusCode(_0x4a7a0b,null))['catch'](handleError(_0x4a7a0b,null));};exports[_0x9030('0x93')]=function(_0xb940d1,_0x1675d5,_0x26555c){var _0x1eb2e8,_0x454434;return db[_0x9030('0x3a')][_0x9030('0x33')]({'where':{'id':_0xb940d1['params']['id']}})['then'](handleEntityNotFound(_0x1675d5,null))[_0x9030('0x28')](function(_0x2a74f3){if(_0x2a74f3){_0x454434=_0x2a74f3;return _0x2a74f3[_0x9030('0x93')](_0xb940d1[_0x9030('0x51')][_0x9030('0x81')],_[_0x9030('0x59')](_0xb940d1['body'],['ids','id'])||{})[_0x9030('0x94')](function(_0x139226){for(var _0x264f41=0x0;_0x264f41<_0xb940d1[_0x9030('0x51')][_0x9030('0x81')][_0x9030('0x42')];_0x264f41+=0x1){socket[_0x9030('0x7d')]('userVoiceQueue:save',{'UserId':Number(_0xb940d1[_0x9030('0x51')]['ids'][_0x264f41]),'VoiceQueueId':Number(_0xb940d1['params']['id'])});}return _0x139226;});}})[_0x9030('0x28')](function(_0x5df1d2){_0x1eb2e8=_0x5df1d2||[];if(_0x454434){return db['User'][_0x9030('0x66')]({'where':{'id':_0xb940d1[_0x9030('0x51')][_0x9030('0x81')]},'attributes':['id',_0x9030('0x34'),'online',_0x9030('0x71'),_0x9030('0x72')],'raw':!![]});}})[_0x9030('0x28')](function(_0x38472e){if(!_['isEmpty'](_0x38472e)){var _0x5f2523=[];for(var _0x556698=0x0;_0x556698<_0x38472e['length'];_0x556698++){if(_0x38472e[_0x556698][_0x9030('0x70')]){_0x5f2523['push'](db[_0x9030('0x91')][_0x9030('0x7a')]({'membername':_0x38472e[_0x556698][_0x9030('0x34')],'UserId':_0x38472e[_0x556698]['id'],'queue_name':_0x454434[_0x9030('0x34')],'VoiceQueueId':_0x454434['id'],'interface':_[_0x9030('0x7b')](_0x38472e[_0x556698][_0x9030('0x72')])?util['format']('SIP/%s',_0x38472e[_0x556698]['name']):_0x38472e[_0x556698][_0x9030('0x72')],'paused':_0x38472e[_0x556698][_0x9030('0x71')]||![],'penalty':_0xb940d1[_0x9030('0x51')][_0x9030('0x75')]||0x0}));}}return BPromise[_0x9030('0x8e')](_0x5f2523);}})[_0x9030('0x28')](function(){return _0x1eb2e8;})[_0x9030('0x28')](respondWithResult(_0x1675d5,null))[_0x9030('0x4e')](handleError(_0x1675d5,null));};exports['removeAgents']=function(_0x18ac5b,_0x369fa5,_0x54f85e){return db['VoiceQueue']['find']({'where':{'id':_0x18ac5b[_0x9030('0x58')]['id']}})[_0x9030('0x28')](handleEntityNotFound(_0x369fa5,null))[_0x9030('0x28')](function(_0x308f26){if(_0x308f26){return _0x308f26['removeAgents'](_0x18ac5b[_0x9030('0x3d')]['ids'])['then'](function(){if(_[_0x9030('0x95')](_0x18ac5b[_0x9030('0x3d')]['ids'])){for(var _0x32cf5e=0x0;_0x32cf5e<_0x18ac5b[_0x9030('0x3d')][_0x9030('0x81')][_0x9030('0x42')];_0x32cf5e+=0x1){socket['emit'](_0x9030('0x92'),{'UserId':Number(_0x18ac5b[_0x9030('0x3d')]['ids'][_0x32cf5e]),'VoiceQueueId':Number(_0x18ac5b[_0x9030('0x58')]['id'])});}}else{socket[_0x9030('0x7d')](_0x9030('0x92'),{'UserId':Number(_0x18ac5b[_0x9030('0x3d')][_0x9030('0x81')]),'VoiceQueueId':Number(_0x18ac5b['params']['id'])});}});}})['then'](function(_0x57ee3e){return db[_0x9030('0x91')][_0x9030('0x5d')]({'where':{'VoiceQueueId':_0x18ac5b['params']['id'],'UserId':_0x18ac5b[_0x9030('0x3d')][_0x9030('0x81')]}})[_0x9030('0x28')](function(){return _0x57ee3e;});})['then'](respondWithStatusCode(_0x369fa5,null))[_0x9030('0x4e')](handleError(_0x369fa5,null));};exports[_0x9030('0x96')]=function(_0x2f57f6,_0x16d3f5,_0x47dab9){var _0x4e763b={};var _0x15ecf1={};var _0x4ebc73;var _0x58b8b0;return db[_0x9030('0x3a')][_0x9030('0x5f')]({'where':{'id':_0x2f57f6['params']['id']}})['then'](handleEntityNotFound(_0x16d3f5,null))['then'](function(_0x5c42db){if(_0x5c42db){_0x4ebc73=_0x5c42db;_0x15ecf1[_0x9030('0x3c')]=_[_0x9030('0x3e')](db[_0x9030('0x6e')][_0x9030('0x3b')]);_0x15ecf1[_0x9030('0x3d')]=_[_0x9030('0x3e')](_0x2f57f6[_0x9030('0x3d')]);_0x15ecf1[_0x9030('0x47')]=_[_0x9030('0x3f')](_0x15ecf1['model'],_0x15ecf1[_0x9030('0x3d')]);_0x4e763b[_0x9030('0x41')]=_[_0x9030('0x3f')](_0x15ecf1[_0x9030('0x3c')],qs[_0x9030('0x40')](_0x2f57f6['query'][_0x9030('0x40')]));_0x4e763b[_0x9030('0x41')]=_0x4e763b[_0x9030('0x41')][_0x9030('0x42')]?_0x4e763b['attributes']:_0x15ecf1[_0x9030('0x3c')];_0x4e763b[_0x9030('0x44')]=qs[_0x9030('0x45')](_0x2f57f6[_0x9030('0x3d')][_0x9030('0x45')]);_0x4e763b[_0x9030('0x46')]=qs[_0x9030('0x47')](_[_0x9030('0x48')](_0x2f57f6[_0x9030('0x3d')],_0x15ecf1['filters']));if(_0x2f57f6['query']['filter']){_0x4e763b[_0x9030('0x46')]=_[_0x9030('0x49')](_0x4e763b[_0x9030('0x46')],{'$or':_['map'](_0x4e763b[_0x9030('0x41')],function(_0x16e44b){var _0x491b8d={};_0x491b8d[_0x16e44b]={'$like':'%'+_0x2f57f6[_0x9030('0x3d')][_0x9030('0x2e')]+'%'};return _0x491b8d;})});}_0x4e763b=_['merge']({},_0x4e763b,_0x2f57f6[_0x9030('0x4b')]);return _0x4ebc73[_0x9030('0x96')](_0x4e763b);}})[_0x9030('0x28')](function(_0x2fcce3){if(_0x2fcce3){_0x58b8b0=_0x2fcce3['length'];if(!_0x2f57f6[_0x9030('0x3d')][_0x9030('0x61')](_0x9030('0x43'))){_0x4e763b[_0x9030('0x25')]=qs[_0x9030('0x25')](_0x2f57f6[_0x9030('0x3d')][_0x9030('0x25')]);_0x4e763b[_0x9030('0x23')]=qs[_0x9030('0x23')](_0x2f57f6[_0x9030('0x3d')][_0x9030('0x23')]);}return _0x4ebc73[_0x9030('0x96')](_0x4e763b);}})['then'](function(_0x31453b){if(_0x31453b){return _0x31453b?{'count':_0x58b8b0,'rows':_0x31453b}:null;}})[_0x9030('0x28')](respondWithResult(_0x16d3f5,null))[_0x9030('0x4e')](handleError(_0x16d3f5,null));};exports[_0x9030('0x97')]=function(_0x39d16a,_0x43b3bc,_0x1638ee){var _0x370aa7={};var _0x584881={};var _0xcd08f0;var _0xbb4105;return db['VoiceQueue']['findOne']({'where':{'id':_0x39d16a['params']['id']}})[_0x9030('0x28')](handleEntityNotFound(_0x43b3bc,null))[_0x9030('0x28')](function(_0x494c1a){if(_0x494c1a){_0xcd08f0=_0x494c1a;_0x584881[_0x9030('0x3c')]=_[_0x9030('0x3e')](db['UserVoiceQueueRt'][_0x9030('0x3b')]);_0x584881['query']=_[_0x9030('0x3e')](_0x39d16a[_0x9030('0x3d')]);_0x584881['filters']=_[_0x9030('0x3f')](_0x584881[_0x9030('0x3c')],_0x584881[_0x9030('0x3d')]);_0x370aa7[_0x9030('0x41')]=_[_0x9030('0x3f')](_0x584881[_0x9030('0x3c')],qs[_0x9030('0x40')](_0x39d16a[_0x9030('0x3d')][_0x9030('0x40')]));_0x370aa7[_0x9030('0x41')]=_0x370aa7[_0x9030('0x41')][_0x9030('0x42')]?_0x370aa7[_0x9030('0x41')]:_0x584881[_0x9030('0x3c')];_0x370aa7[_0x9030('0x44')]=qs[_0x9030('0x45')](_0x39d16a[_0x9030('0x3d')][_0x9030('0x45')]);_0x370aa7[_0x9030('0x46')]=qs['filters'](_[_0x9030('0x48')](_0x39d16a[_0x9030('0x3d')],_0x584881[_0x9030('0x47')]));if(_0x39d16a[_0x9030('0x3d')]['filter']){_0x370aa7[_0x9030('0x46')]=_[_0x9030('0x49')](_0x370aa7[_0x9030('0x46')],{'$or':_[_0x9030('0x30')](_0x370aa7['attributes'],function(_0x2b5b71){var _0x210224={};_0x210224[_0x2b5b71]={'$like':'%'+_0x39d16a[_0x9030('0x3d')][_0x9030('0x2e')]+'%'};return _0x210224;})});}_0x370aa7=_[_0x9030('0x49')]({},_0x370aa7,_0x39d16a[_0x9030('0x4b')]);return _0xcd08f0['getMembers'](_0x370aa7);}})[_0x9030('0x28')](function(_0x4f3a40){if(_0x4f3a40){_0xbb4105=_0x4f3a40[_0x9030('0x42')];if(!_0x39d16a[_0x9030('0x3d')][_0x9030('0x61')](_0x9030('0x43'))){_0x370aa7[_0x9030('0x25')]=qs[_0x9030('0x25')](_0x39d16a[_0x9030('0x3d')][_0x9030('0x25')]);_0x370aa7[_0x9030('0x23')]=qs[_0x9030('0x23')](_0x39d16a[_0x9030('0x3d')][_0x9030('0x23')]);}return _0xcd08f0[_0x9030('0x97')](_0x370aa7);}})[_0x9030('0x28')](function(_0x1c79be){return _0x1c79be?{'count':_0xbb4105,'rows':_0x1c79be}:null;})[_0x9030('0x28')](respondWithResult(_0x43b3bc,null))[_0x9030('0x4e')](handleError(_0x43b3bc,null));};exports[_0x9030('0x98')]=function(_0x44c923,_0x3ef8ae,_0x25a588){var _0x98d1a7={};var _0x469ed7={};var _0x5df211;var _0x223f61;return db['VoiceQueue']['findOne']({'where':{'id':_0x44c923[_0x9030('0x58')]['id']}})[_0x9030('0x28')](handleEntityNotFound(_0x3ef8ae,null))[_0x9030('0x28')](function(_0x43fcad){if(_0x43fcad){_0x5df211=_0x43fcad;_0x469ed7['model']=_[_0x9030('0x3e')](db['CmList'][_0x9030('0x3b')]);_0x469ed7['query']=_[_0x9030('0x3e')](_0x44c923[_0x9030('0x3d')]);_0x469ed7[_0x9030('0x47')]=_[_0x9030('0x3f')](_0x469ed7['model'],_0x469ed7['query']);_0x98d1a7[_0x9030('0x41')]=_[_0x9030('0x3f')](_0x469ed7['model'],qs[_0x9030('0x40')](_0x44c923[_0x9030('0x3d')][_0x9030('0x40')]));_0x98d1a7['attributes']=_0x98d1a7['attributes'][_0x9030('0x42')]?_0x98d1a7['attributes']:_0x469ed7[_0x9030('0x3c')];_0x98d1a7[_0x9030('0x44')]=qs[_0x9030('0x45')](_0x44c923[_0x9030('0x3d')][_0x9030('0x45')]);_0x98d1a7[_0x9030('0x46')]=qs[_0x9030('0x47')](_[_0x9030('0x48')](_0x44c923['query'],_0x469ed7['filters']));if(_0x44c923[_0x9030('0x3d')]['filter']){_0x98d1a7[_0x9030('0x46')]=_['merge'](_0x98d1a7[_0x9030('0x46')],{'$or':_[_0x9030('0x30')](_0x98d1a7[_0x9030('0x41')],function(_0x451341){var _0x280122={};_0x280122[_0x451341]={'$like':'%'+_0x44c923[_0x9030('0x3d')][_0x9030('0x2e')]+'%'};return _0x280122;})});}_0x98d1a7=_[_0x9030('0x49')]({},_0x98d1a7,_0x44c923[_0x9030('0x4b')]);return _0x5df211[_0x9030('0x98')](_0x98d1a7);}})['then'](function(_0x112299){if(_0x112299){_0x223f61=_0x112299[_0x9030('0x42')];if(!_0x44c923[_0x9030('0x3d')][_0x9030('0x61')]('nolimit')){_0x98d1a7['limit']=qs[_0x9030('0x25')](_0x44c923[_0x9030('0x3d')][_0x9030('0x25')]);_0x98d1a7['offset']=qs[_0x9030('0x23')](_0x44c923[_0x9030('0x3d')]['offset']);}return _0x5df211['getLists'](_0x98d1a7);}})[_0x9030('0x28')](function(_0x4e1530){if(_0x4e1530){return _0x4e1530?{'count':_0x223f61,'rows':_0x4e1530}:null;}})['then'](respondWithResult(_0x3ef8ae,null))[_0x9030('0x4e')](handleError(_0x3ef8ae,null));};exports[_0x9030('0x99')]=function(_0x3c01c5,_0x16d53b,_0x5c9077){var _0x2477e2=moment()[_0x9030('0x7c')](_0x9030('0x9a'));var _0x5a0901,_0x25bfbe;return db[_0x9030('0x3a')][_0x9030('0x33')]({'where':{'id':_0x3c01c5[_0x9030('0x58')]['id']}})[_0x9030('0x28')](handleEntityNotFound(_0x16d53b,null))[_0x9030('0x28')](function(_0x2a6a9a){if(_0x2a6a9a){_0x25bfbe=_0x2a6a9a;return _0x2a6a9a['addLists'](_0x3c01c5[_0x9030('0x51')][_0x9030('0x81')],_['omit'](_0x3c01c5[_0x9030('0x51')],[_0x9030('0x81'),'id'])||{});}return null;})[_0x9030('0x94')](function(_0x290077){var _0x302b90;_0x5a0901=_0x290077||[];var _0xff062e=[];if(_0x290077){for(var _0x59c951=0x0;_0x59c951<_0x290077[_0x9030('0x42')];_0x59c951+=0x1){var _0x2133f6=_0x290077[_0x59c951][_0x9030('0x29')]({'plain':!![]});_0x25bfbe['dialCheckDuplicateType']=_0x3c01c5['body'][_0x9030('0x9b')]?_0x3c01c5[_0x9030('0x51')][_0x9030('0x9b')]:_0x25bfbe[_0x9030('0x9b')];switch(_0x25bfbe['dialCheckDuplicateType']){case _0x9030('0x9c'):_0x302b90=squel[_0x9030('0x9d')]()[_0x9030('0x9e')](_0x9030('0x9f'))[_0x9030('0xa0')](['phone',_0x9030('0xa1'),_0x9030('0xa2'),_0x9030('0xa3'),_0x9030('0x65'),'createdAt',_0x9030('0x5b')],squel[_0x9030('0x82')]()[_0x9030('0x83')]('phone','phone')[_0x9030('0x83')]('\x27'+_0x2477e2+'\x27',_0x9030('0xa1'))['field']('id',_0x9030('0xa2'))[_0x9030('0x83')](_0x2133f6[_0x9030('0xa4')][_0x9030('0xa5')](),_0x9030('0xa3'))['field'](_0x3c01c5[_0x9030('0x58')]['id'][_0x9030('0xa5')](),'VoiceQueueId')[_0x9030('0x83')]('\x27'+_0x2477e2+'\x27','createdAt')[_0x9030('0x83')]('\x27'+_0x2477e2+'\x27',_0x9030('0x5b'))[_0x9030('0x85')](_0x9030('0xa6'))[_0x9030('0x46')]('deletedAt\x20IS\x20NULL')[_0x9030('0x46')](_0x9030('0xa7'),_0x2133f6['CmListId'][_0x9030('0xa5')]())[_0x9030('0x46')]('phone\x20IS\x20NOT\x20NULL')[_0x9030('0x46')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9030('0x82')]()[_0x9030('0x83')](_0x9030('0xa8'))['from'](_0x9030('0xa9'))[_0x9030('0x46')](_0x9030('0x89'),_0x3c01c5[_0x9030('0x58')]['id'][_0x9030('0xa5')]()))[_0x9030('0x46')](_0x9030('0xaa'),squel[_0x9030('0x82')]()[_0x9030('0x83')](_0x9030('0xab'))[_0x9030('0x85')](_0x9030('0x9f'))[_0x9030('0x46')]('VoiceQueueId\x20=\x20?',_0x3c01c5[_0x9030('0x58')]['id']['toString']())))[_0x9030('0xa5')]();break;case _0x9030('0xac'):_0x302b90=squel[_0x9030('0x9d')]()[_0x9030('0x9e')](_0x9030('0x9f'))['fromQuery']([_0x9030('0xad'),_0x9030('0xa1'),_0x9030('0xa2'),_0x9030('0xa3'),_0x9030('0x65'),_0x9030('0x5a'),_0x9030('0x5b')],squel[_0x9030('0x82')]()[_0x9030('0x83')](_0x9030('0xad'),'phone')['field']('\x27'+_0x2477e2+'\x27',_0x9030('0xa1'))[_0x9030('0x83')]('id',_0x9030('0xa2'))[_0x9030('0x83')](_0x2133f6[_0x9030('0xa4')][_0x9030('0xa5')](),_0x9030('0xa3'))[_0x9030('0x83')](_0x3c01c5[_0x9030('0x58')]['id']['toString'](),'VoiceQueueId')[_0x9030('0x83')]('\x27'+_0x2477e2+'\x27','createdAt')[_0x9030('0x83')]('\x27'+_0x2477e2+'\x27',_0x9030('0x5b'))[_0x9030('0x85')](_0x9030('0xa6'))['where'](_0x9030('0xae'))[_0x9030('0x46')]('ListId\x20=\x20?',_0x2133f6[_0x9030('0xa4')]['toString']())[_0x9030('0x46')](_0x9030('0xaf'))['where'](_0x9030('0xaa'),squel[_0x9030('0x82')]()[_0x9030('0x83')](_0x9030('0xab'))[_0x9030('0x85')](_0x9030('0x9f'))[_0x9030('0x46')](_0x9030('0x89'),_0x3c01c5['params']['id'][_0x9030('0xa5')]())))[_0x9030('0xa5')]();break;default:_0x302b90=squel['insert']()[_0x9030('0x9e')](_0x9030('0x9f'))[_0x9030('0xa0')]([_0x9030('0xad'),_0x9030('0xa1'),'ContactId',_0x9030('0xa3'),_0x9030('0x65'),_0x9030('0x5a'),_0x9030('0x5b')],squel[_0x9030('0x82')]()[_0x9030('0x83')]('phone',_0x9030('0xad'))['field']('\x27'+_0x2477e2+'\x27',_0x9030('0xa1'))[_0x9030('0x83')]('id',_0x9030('0xa2'))[_0x9030('0x83')](_0x2133f6[_0x9030('0xa4')]['toString'](),_0x9030('0xa3'))[_0x9030('0x83')](_0x3c01c5[_0x9030('0x58')]['id'][_0x9030('0xa5')](),_0x9030('0x65'))[_0x9030('0x83')]('\x27'+_0x2477e2+'\x27',_0x9030('0x5a'))[_0x9030('0x83')]('\x27'+_0x2477e2+'\x27',_0x9030('0x5b'))[_0x9030('0x85')](_0x9030('0xa6'))[_0x9030('0x46')](_0x9030('0xae'))[_0x9030('0x46')](_0x9030('0xa7'),_0x2133f6[_0x9030('0xa4')]['toString']())[_0x9030('0x46')](_0x9030('0xaf')))['toString']();}_0xff062e['push'](db[_0x9030('0x76')][_0x9030('0x3d')](_0x302b90));}return BPromise[_0x9030('0x8e')](_0xff062e);}})[_0x9030('0x28')](function(){var _0x4c714b=[];var _0x4d193d=squel['insert']()[_0x9030('0x9e')](_0x9030('0xb0'))[_0x9030('0xa0')]([_0x9030('0xb1'),'phone',_0x9030('0xb2'),_0x9030('0x5a'),_0x9030('0x5b')],squel[_0x9030('0x82')]()[_0x9030('0x83')]('h.id')['field'](_0x9030('0xb3'))[_0x9030('0x83')](_0x9030('0xb4'))[_0x9030('0x83')]('\x27'+_0x2477e2+'\x27','createdAt')['field']('\x27'+_0x2477e2+'\x27',_0x9030('0x5b'))['from'](_0x9030('0xb5'),'ci')[_0x9030('0xb6')](_0x9030('0x9f'),'h',_0x9030('0xb7'))[_0x9030('0x46')](_0x9030('0xb8'),_0x2477e2)[_0x9030('0x46')](_0x9030('0xb9'),_0x9030('0xba')))[_0x9030('0xa5')]();_0x4c714b[_0x9030('0x8a')](db[_0x9030('0x76')][_0x9030('0x3d')](_0x4d193d));return BPromise[_0x9030('0x8e')](_0x4c714b);})['then'](function(){return _0x5a0901;})['then'](respondWithResult(_0x16d53b,null))[_0x9030('0x4e')](handleError(_0x16d53b,null));};exports[_0x9030('0xbb')]=function(_0x2d4cd,_0x1af4bf,_0x213ca6){return db[_0x9030('0x3a')][_0x9030('0x33')]({'where':{'id':_0x2d4cd[_0x9030('0x58')]['id']}})[_0x9030('0x28')](handleEntityNotFound(_0x1af4bf,null))['then'](function(_0x332c0d){if(_0x332c0d){return _0x332c0d[_0x9030('0xbb')](_0x2d4cd['query'][_0x9030('0x81')]);}})[_0x9030('0x28')](function(_0x20ca02){if(_0x20ca02){return db[_0x9030('0x60')][_0x9030('0x5d')]({'where':{'ListId':_0x2d4cd[_0x9030('0x3d')][_0x9030('0x81')],'VoiceQueueId':_0x2d4cd['params']['id']}})[_0x9030('0x28')](function(){return _0x20ca02;});}})[_0x9030('0x28')](respondWithStatusCode(_0x1af4bf,null))[_0x9030('0x4e')](handleError(_0x1af4bf,null));};exports['getBlackLists']=function(_0x283821,_0x28ec18,_0x1de3de){var _0x106abc={};var _0x578f69={};var _0x45fe4e;var _0x50d2e9;return db[_0x9030('0x3a')]['findOne']({'where':{'id':_0x283821[_0x9030('0x58')]['id']}})['then'](handleEntityNotFound(_0x28ec18,null))[_0x9030('0x28')](function(_0x284ee1){if(_0x284ee1){_0x45fe4e=_0x284ee1;_0x578f69['model']=_[_0x9030('0x3e')](db[_0x9030('0xbc')][_0x9030('0x3b')]);_0x578f69[_0x9030('0x3d')]=_[_0x9030('0x3e')](_0x283821[_0x9030('0x3d')]);_0x578f69['filters']=_['intersection'](_0x578f69[_0x9030('0x3c')],_0x578f69[_0x9030('0x3d')]);_0x106abc['attributes']=_['intersection'](_0x578f69[_0x9030('0x3c')],qs[_0x9030('0x40')](_0x283821[_0x9030('0x3d')][_0x9030('0x40')]));_0x106abc['attributes']=_0x106abc['attributes'][_0x9030('0x42')]?_0x106abc[_0x9030('0x41')]:_0x578f69[_0x9030('0x3c')];_0x106abc[_0x9030('0x44')]=qs[_0x9030('0x45')](_0x283821[_0x9030('0x3d')][_0x9030('0x45')]);_0x106abc['where']=qs[_0x9030('0x47')](_[_0x9030('0x48')](_0x283821[_0x9030('0x3d')],_0x578f69[_0x9030('0x47')]));if(_0x283821[_0x9030('0x3d')][_0x9030('0x2e')]){_0x106abc['where']=_['merge'](_0x106abc[_0x9030('0x46')],{'$or':_['map'](_0x106abc[_0x9030('0x41')],function(_0x526373){var _0x3c677a={};_0x3c677a[_0x526373]={'$like':'%'+_0x283821['query'][_0x9030('0x2e')]+'%'};return _0x3c677a;})});}_0x106abc=_[_0x9030('0x49')]({},_0x106abc,_0x283821[_0x9030('0x4b')]);return _0x45fe4e['getBlackLists'](_0x106abc);}})[_0x9030('0x28')](function(_0x495ffb){if(_0x495ffb){_0x50d2e9=_0x495ffb[_0x9030('0x42')];if(!_0x283821[_0x9030('0x3d')]['hasOwnProperty']('nolimit')){_0x106abc['limit']=qs['limit'](_0x283821[_0x9030('0x3d')][_0x9030('0x25')]);_0x106abc[_0x9030('0x23')]=qs[_0x9030('0x23')](_0x283821[_0x9030('0x3d')][_0x9030('0x23')]);}return _0x45fe4e[_0x9030('0xbd')](_0x106abc);}})[_0x9030('0x28')](function(_0x4dc9ea){if(_0x4dc9ea){return _0x4dc9ea?{'count':_0x50d2e9,'rows':_0x4dc9ea}:null;}})[_0x9030('0x28')](respondWithResult(_0x28ec18,null))['catch'](handleError(_0x28ec18,null));};exports[_0x9030('0xbe')]=function(_0xd914d6,_0x5d0a18,_0x592895){var _0x4ccdc3,_0x29e6d5;return db[_0x9030('0x3a')][_0x9030('0x33')]({'where':{'id':_0xd914d6['params']['id']}})[_0x9030('0x28')](handleEntityNotFound(_0x5d0a18,null))[_0x9030('0x28')](function(_0x223c11){if(_0x223c11){_0x29e6d5=_0x223c11;return _0x223c11[_0x9030('0xbe')](_0xd914d6[_0x9030('0x51')][_0x9030('0x81')],_[_0x9030('0x59')](_0xd914d6[_0x9030('0x51')],[_0x9030('0x81'),'id'])||{});}return null;})[_0x9030('0x94')](function(_0x39ba19){var _0x5b9b39;_0x4ccdc3=_0x39ba19||[];var _0x3bba5e=[];if(_0x39ba19){for(var _0x348032=0x0;_0x348032<_0x39ba19[_0x9030('0x42')];_0x348032+=0x1){var _0x46d768=_0x39ba19[_0x348032][_0x9030('0x29')]({'plain':!![]});_0x5b9b39=squel[_0x9030('0x9d')]()['into']('cm_hopper_black')[_0x9030('0xa0')]([_0x9030('0xad'),'ContactId','ListId',_0x9030('0x65'),_0x9030('0x5a'),_0x9030('0x5b')],squel['select']()[_0x9030('0x83')](_0x9030('0xad'),_0x9030('0xad'))[_0x9030('0x83')]('id',_0x9030('0xa2'))[_0x9030('0x83')](_0x46d768['CmListId'][_0x9030('0xa5')](),'ListId')[_0x9030('0x83')](_0xd914d6[_0x9030('0x58')]['id'][_0x9030('0xa5')](),_0x9030('0x65'))['field'](_0x9030('0xbf'),_0x9030('0x5a'))[_0x9030('0x83')](_0x9030('0xbf'),_0x9030('0x5b'))[_0x9030('0x85')](_0x9030('0xa6'))['where'](_0x9030('0xae'))['where'](_0x9030('0xa7'),_0x46d768[_0x9030('0xa4')][_0x9030('0xa5')]())[_0x9030('0x46')]('phone\x20IS\x20NOT\x20NULL'))[_0x9030('0xa5')]();_0x3bba5e[_0x9030('0x8a')](db['sequelize'][_0x9030('0x3d')](_0x5b9b39));}return BPromise[_0x9030('0x8e')](_0x3bba5e);}})[_0x9030('0x28')](function(){return _0x4ccdc3;})[_0x9030('0x28')](respondWithResult(_0x5d0a18,null))[_0x9030('0x4e')](handleError(_0x5d0a18,null));};exports['removeBlackLists']=function(_0x5d50c1,_0x3a248f,_0x457b5b){return db[_0x9030('0x3a')][_0x9030('0x33')]({'where':{'id':_0x5d50c1['params']['id']}})['then'](handleEntityNotFound(_0x3a248f,null))[_0x9030('0x28')](function(_0x39bb01){if(_0x39bb01){return _0x39bb01[_0x9030('0xc0')](_0x5d50c1['query'][_0x9030('0x81')]);}})[_0x9030('0x28')](function(_0x41e229){if(_0x41e229){return db[_0x9030('0x6a')][_0x9030('0x5d')]({'where':{'ListId':_0x5d50c1[_0x9030('0x3d')][_0x9030('0x81')],'VoiceQueueId':_0x5d50c1[_0x9030('0x58')]['id']}})[_0x9030('0x28')](function(){return _0x41e229;});}})[_0x9030('0x28')](respondWithStatusCode(_0x3a248f,null))[_0x9030('0x4e')](handleError(_0x3a248f,null));}; \ No newline at end of file +var _0x77d4=['penalty','sequelize','transaction','each','TeamVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','userVoiceQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','SELECT','every','TeamId','all','union','compact','ids','isEmpty','removeAgents','emit','addAgents','spread','online','push','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','field','CmListId','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','cm_hopper_additional_phones','CmHopperId','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./voiceQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','ignore','value','includes','type','find','name','UserProfileResource','stack','send','index','map','VoiceQueue','fieldName','model','query','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','merge','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','inbound','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','autoAssociation','error','getHoppers','findOne','hasOwnProperty','CmHopper','getHopperHistories','CmHopperHistory','VoiceQueueId','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','voicePause','interface','flatMap'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x77d4,0x108));var _0x477d=function(_0x18fbcc,_0x1ec91a){_0x18fbcc=_0x18fbcc-0x0;var _0x50c414=_0x77d4[_0x18fbcc];return _0x50c414;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x477d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x477d('0x1'));var rp=require('request-promise');var moment=require(_0x477d('0x2'));var BPromise=require(_0x477d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x477d('0x4'));var sox=require(_0x477d('0x5'));var csv=require(_0x477d('0x6'));var ejs=require(_0x477d('0x7'));var fs=require('fs');var fs_extra=require(_0x477d('0x8'));var _=require(_0x477d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x477d('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x477d('0xb'));var Papa=require(_0x477d('0xc'));var Redis=require(_0x477d('0xd'));var authService=require(_0x477d('0xe'));var qs=require(_0x477d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x477d('0x10'));var logger=require('../../config/logger')(_0x477d('0x11'));var utils=require(_0x477d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x477d('0x13'));var db=require(_0x477d('0x14'))['db'];config['redis']=_['defaults'](config[_0x477d('0x15')],{'host':_0x477d('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x477d('0x15')]));require(_0x477d('0x17'))['register'](socket);function respondWithStatusCode(_0x4b2021,_0x38a0a8){_0x38a0a8=_0x38a0a8||0xcc;return function(_0x4bbfef){if(_0x4bbfef){return _0x4b2021[_0x477d('0x18')](_0x38a0a8);}return _0x4b2021[_0x477d('0x19')](_0x38a0a8)[_0x477d('0x1a')]();};}function respondWithResult(_0x5985b5,_0x116aa7){_0x116aa7=_0x116aa7||0xc8;return function(_0x78d1f2){if(_0x78d1f2){return _0x5985b5[_0x477d('0x19')](_0x116aa7)[_0x477d('0x1b')](_0x78d1f2);}};}function respondWithFilteredResult(_0x57b38e,_0x28f17a){return function(_0x5d5553){if(_0x5d5553){var _0x367965=typeof _0x28f17a[_0x477d('0x1c')]===_0x477d('0x1d')&&typeof _0x28f17a[_0x477d('0x1e')]===_0x477d('0x1d');var _0x2145ce=_0x5d5553['count'];var _0x33db7a=_0x367965?0x0:_0x28f17a['offset'];var _0xe934a7=_0x367965?_0x5d5553[_0x477d('0x1f')]:_0x28f17a[_0x477d('0x1c')]+_0x28f17a[_0x477d('0x1e')];var _0x27b3aa;if(_0xe934a7>=_0x2145ce){_0xe934a7=_0x2145ce;_0x27b3aa=0xc8;}else{_0x27b3aa=0xce;}_0x57b38e[_0x477d('0x19')](_0x27b3aa);return _0x57b38e[_0x477d('0x20')](_0x477d('0x21'),_0x33db7a+'-'+_0xe934a7+'/'+_0x2145ce)[_0x477d('0x1b')](_0x5d5553);}return null;};}function patchUpdates(_0x5981a){return function(_0x3d2943){try{jsonpatch[_0x477d('0x22')](_0x3d2943,_0x5981a,!![]);}catch(_0x43c845){return BPromise[_0x477d('0x23')](_0x43c845);}return _0x3d2943['save']();};}function saveUpdates(_0x4481b0,_0x583444){return function(_0x239b56){if(_0x239b56){return _0x239b56[_0x477d('0x24')](_0x4481b0)[_0x477d('0x25')](function(_0x2287b4){return _0x2287b4;});}return null;};}function removeEntity(_0x4bb50e,_0xd6dca5){return function(_0x2dfa90){if(_0x2dfa90){return _0x2dfa90[_0x477d('0x26')]()['then'](function(){var _0x585648=_0x2dfa90[_0x477d('0x27')]({'plain':!![]});var _0x3c6270=[{'name':_0x477d('0x28'),'value':'inbound','ignore':![]},{'name':_0x477d('0x29'),'value':_0x477d('0x2a'),'ignore':![]}];var _0x74ebb4=_(_0x3c6270)[_0x477d('0x2b')](_0x477d('0x2c'))['map'](_0x477d('0x2d'))[_0x477d('0x2d')]();if(_[_0x477d('0x2e')](_0x74ebb4,_0x585648[_0x477d('0x2f')])){return;}var _0x32c5d7=_[_0x477d('0x30')](_0x3c6270,[_0x477d('0x2d'),_0x585648[_0x477d('0x2f')]])[_0x477d('0x31')];return db[_0x477d('0x32')][_0x477d('0x26')]({'where':{'type':_0x32c5d7,'resourceId':_0x585648['id']}})[_0x477d('0x25')](function(){return _0x2dfa90;});})[_0x477d('0x25')](function(){_0x4bb50e[_0x477d('0x19')](0xcc)[_0x477d('0x1a')]();});}};}function handleEntityNotFound(_0x4127c1,_0x9857c2){return function(_0x3a5509){if(!_0x3a5509){_0x4127c1[_0x477d('0x18')](0x194);}return _0x3a5509;};}function handleError(_0x266dbf,_0x49851b){_0x49851b=_0x49851b||0x1f4;return function(_0x304d25){logger['error'](_0x304d25[_0x477d('0x33')]);if(_0x304d25[_0x477d('0x31')]){delete _0x304d25[_0x477d('0x31')];}_0x266dbf['status'](_0x49851b)[_0x477d('0x34')](_0x304d25);};}exports[_0x477d('0x35')]=function(_0x2b2091,_0x3d34e4){var _0x249b82={},_0x463fca={},_0xca8bf={'count':0x0,'rows':[]};var _0xf84c4c=_[_0x477d('0x36')](db[_0x477d('0x37')]['rawAttributes'],function(_0x36a247){return{'name':_0x36a247[_0x477d('0x38')],'type':_0x36a247[_0x477d('0x2f')]['key']};});_0x463fca[_0x477d('0x39')]=_[_0x477d('0x36')](_0xf84c4c,_0x477d('0x31'));_0x463fca['query']=_['keys'](_0x2b2091[_0x477d('0x3a')]);_0x463fca[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0x463fca[_0x477d('0x39')],_0x463fca[_0x477d('0x3a')]);_0x249b82['attributes']=_[_0x477d('0x3c')](_0x463fca['model'],qs[_0x477d('0x3d')](_0x2b2091[_0x477d('0x3a')][_0x477d('0x3d')]));_0x249b82['attributes']=_0x249b82['attributes'][_0x477d('0x3e')]?_0x249b82[_0x477d('0x3f')]:_0x463fca[_0x477d('0x39')];if(!_0x2b2091[_0x477d('0x3a')]['hasOwnProperty'](_0x477d('0x40'))){_0x249b82[_0x477d('0x1e')]=qs[_0x477d('0x1e')](_0x2b2091[_0x477d('0x3a')][_0x477d('0x1e')]);_0x249b82['offset']=qs[_0x477d('0x1c')](_0x2b2091[_0x477d('0x3a')]['offset']);}_0x249b82[_0x477d('0x41')]=qs['sort'](_0x2b2091[_0x477d('0x3a')][_0x477d('0x42')]);_0x249b82[_0x477d('0x43')]=qs[_0x477d('0x3b')](_[_0x477d('0x44')](_0x2b2091[_0x477d('0x3a')],_0x463fca[_0x477d('0x3b')]),_0xf84c4c);if(_0x2b2091[_0x477d('0x3a')][_0x477d('0x2b')]){_0x249b82['where']=_[_0x477d('0x45')](_0x249b82[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0xf84c4c,function(_0x432985){if(_0x432985['type']!=='VIRTUAL'){var _0x41397b={};_0x41397b[_0x432985[_0x477d('0x31')]]={'$like':'%'+_0x2b2091['query'][_0x477d('0x2b')]+'%'};return _0x41397b;}})});}_0x249b82=_['merge']({},_0x249b82,_0x2b2091['options']);var _0x983c91={'where':_0x249b82[_0x477d('0x43')]};return db[_0x477d('0x37')][_0x477d('0x1f')](_0x983c91)[_0x477d('0x25')](function(_0x26c463){_0xca8bf['count']=_0x26c463;if(_0x2b2091[_0x477d('0x3a')][_0x477d('0x46')]){_0x249b82[_0x477d('0x47')]=[{'all':!![]}];}return db[_0x477d('0x37')][_0x477d('0x48')](_0x249b82);})['then'](function(_0x4aad41){_0xca8bf[_0x477d('0x49')]=_0x4aad41;return _0xca8bf;})[_0x477d('0x25')](respondWithFilteredResult(_0x3d34e4,_0x249b82))[_0x477d('0x4a')](handleError(_0x3d34e4,null));};exports['show']=function(_0x45a5da,_0xf4685b){var _0x3154da={'raw':![],'where':{'id':_0x45a5da[_0x477d('0x4b')]['id']}},_0x1ad4d1={};_0x1ad4d1[_0x477d('0x39')]=_[_0x477d('0x4c')](db['VoiceQueue'][_0x477d('0x4d')]);_0x1ad4d1[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0x45a5da[_0x477d('0x3a')]);_0x1ad4d1[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0x1ad4d1[_0x477d('0x39')],_0x1ad4d1[_0x477d('0x3a')]);_0x3154da[_0x477d('0x3f')]=_[_0x477d('0x3c')](_0x1ad4d1[_0x477d('0x39')],qs[_0x477d('0x3d')](_0x45a5da[_0x477d('0x3a')][_0x477d('0x3d')]));_0x3154da[_0x477d('0x3f')]=_0x3154da['attributes'][_0x477d('0x3e')]?_0x3154da[_0x477d('0x3f')]:_0x1ad4d1['model'];if(_0x45a5da['query']['includeAll']){_0x3154da[_0x477d('0x47')]=[{'all':!![]}];}_0x3154da=_[_0x477d('0x45')]({},_0x3154da,_0x45a5da[_0x477d('0x4e')]);return db[_0x477d('0x37')][_0x477d('0x30')](_0x3154da)[_0x477d('0x25')](handleEntityNotFound(_0xf4685b,null))[_0x477d('0x25')](respondWithResult(_0xf4685b,null))[_0x477d('0x4a')](handleError(_0xf4685b,null));};exports['create']=function(_0x15dcaf,_0x470d3e){return db[_0x477d('0x37')][_0x477d('0x4f')](_0x15dcaf[_0x477d('0x50')],{})[_0x477d('0x25')](function(_0x22fc49){var _0x20e6b1=_0x15dcaf['user'][_0x477d('0x27')]({'plain':!![]});if(!_0x20e6b1)throw new Error(_0x477d('0x51'));if(_0x20e6b1[_0x477d('0x52')]===_0x477d('0x53')){var _0x45cf6d=_0x22fc49['get']({'plain':!![]});var _0x1c496a=[{'name':_0x477d('0x28'),'value':_0x477d('0x54')},{'name':_0x477d('0x29'),'value':_0x477d('0x2a')}];var _0x54c044=_['find'](_0x1c496a,[_0x477d('0x2d'),_0x45cf6d[_0x477d('0x2f')]])[_0x477d('0x31')];return db[_0x477d('0x55')][_0x477d('0x30')]({'where':{'name':_0x54c044,'userProfileId':_0x20e6b1[_0x477d('0x56')]},'raw':!![]})[_0x477d('0x25')](function(_0x39b961){if(_0x39b961&&_0x39b961['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x45cf6d['name'],'resourceId':_0x45cf6d['id'],'type':_0x39b961['name'],'sectionId':_0x39b961['id']},{})[_0x477d('0x25')](function(){return _0x22fc49;});}else{return _0x22fc49;}})['catch'](function(_0x43c3e5){logger['error'](_0x477d('0x57'),_0x43c3e5);throw _0x43c3e5;});}return _0x22fc49;})[_0x477d('0x25')](respondWithResult(_0x470d3e,0xc9))['catch'](handleError(_0x470d3e,null));};exports[_0x477d('0x58')]=function(_0x4739ac,_0x3d8a12){var _0x851020={'where':{'id':_0x4739ac['params']['id']}},_0x5e5e09={};_0x5e5e09[_0x477d('0x39')]=_[_0x477d('0x4c')](db['VoiceQueue'][_0x477d('0x4d')]);_0x851020[_0x477d('0x3f')]=_[_0x477d('0x3c')](_0x5e5e09[_0x477d('0x39')],qs[_0x477d('0x3d')](_0x4739ac['query']['fields']));_0x851020[_0x477d('0x3f')]=_0x851020[_0x477d('0x3f')]['length']?_0x851020[_0x477d('0x3f')]:_0x5e5e09['model'];if(_0x4739ac['query'][_0x477d('0x46')]){_0x851020[_0x477d('0x47')]=[{'all':!![]}];}_0x851020=_[_0x477d('0x45')]({},_0x851020,_0x4739ac[_0x477d('0x4e')]);return db[_0x477d('0x37')]['find'](_0x851020)['then'](handleEntityNotFound(_0x3d8a12,null))[_0x477d('0x25')](function(_0x23c435){if(_0x23c435){var _0x3510db=_0x23c435[_0x477d('0x27')]({'plain':!![]});_0x3510db=qs[_0x477d('0x59')](_0x3510db,['id',_0x477d('0x5a'),_0x477d('0x5b')]);_0x4739ac[_0x477d('0x50')]=_[_0x477d('0x59')](_0x4739ac['body'],['id','createdAt',_0x477d('0x5b')]);return db['VoiceQueue'][_0x477d('0x4f')](_[_0x477d('0x45')](_0x3510db,_0x4739ac[_0x477d('0x50')]),{'include':_0x4739ac['query'][_0x477d('0x46')]?[{'all':!![]}]:undefined})[_0x477d('0x25')](function(_0x5ec335){var _0x2d1e6d=_0x4739ac[_0x477d('0x53')][_0x477d('0x27')]({'plain':!![]});if(!_0x2d1e6d)throw new Error(_0x477d('0x51'));if(_0x2d1e6d[_0x477d('0x52')]===_0x477d('0x53')){var _0x55f1a9=_0x5ec335[_0x477d('0x27')]({'plain':!![]});var _0x36bfa3=[{'name':_0x477d('0x28'),'value':_0x477d('0x54')},{'name':'QueueCampaigns','value':_0x477d('0x2a')}];var _0x543673=_[_0x477d('0x30')](_0x36bfa3,[_0x477d('0x2d'),_0x55f1a9['type']])[_0x477d('0x31')];return db[_0x477d('0x55')][_0x477d('0x30')]({'where':{'name':_0x543673,'userProfileId':_0x2d1e6d['userProfileId']},'raw':!![]})['then'](function(_0x10654d){if(_0x10654d&&_0x10654d[_0x477d('0x5c')]===0x0){return db[_0x477d('0x32')][_0x477d('0x4f')]({'name':_0x55f1a9['name'],'resourceId':_0x55f1a9['id'],'type':_0x10654d[_0x477d('0x31')],'sectionId':_0x10654d['id']},{})[_0x477d('0x25')](function(){return _0x5ec335;});}else{return _0x5ec335;}})['catch'](function(_0x38e06f){logger[_0x477d('0x5d')](_0x477d('0x57'),_0x38e06f);throw _0x38e06f;});}return _0x5ec335;});}})['then'](respondWithResult(_0x3d8a12,0xc9))[_0x477d('0x4a')](handleError(_0x3d8a12,null));};exports[_0x477d('0x24')]=function(_0x120e0e,_0x5ef582){if(_0x120e0e[_0x477d('0x50')]['id']){delete _0x120e0e[_0x477d('0x50')]['id'];}return db[_0x477d('0x37')][_0x477d('0x30')]({'where':{'id':_0x120e0e[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x5ef582,null))[_0x477d('0x25')](saveUpdates(_0x120e0e[_0x477d('0x50')],null))[_0x477d('0x25')](respondWithResult(_0x5ef582,null))['catch'](handleError(_0x5ef582,null));};exports['destroy']=function(_0x3d7f61,_0x48cb39){return db[_0x477d('0x37')]['find']({'where':{'id':_0x3d7f61[_0x477d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x48cb39,null))[_0x477d('0x25')](removeEntity(_0x48cb39,null))[_0x477d('0x4a')](handleError(_0x48cb39,null));};exports[_0x477d('0x5e')]=function(_0x239a3d,_0x5c8fd8,_0x5e9459){var _0x5cd5c4={'raw':![],'where':{}};var _0x54924b={};var _0x4928f8={'count':0x0,'rows':[]};return db[_0x477d('0x37')][_0x477d('0x5f')]({'where':{'id':_0x239a3d[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x5c8fd8,null))[_0x477d('0x25')](function(_0x1a09f8){if(_0x1a09f8){_0x54924b['model']=_[_0x477d('0x4c')](db['CmHopper']['rawAttributes']);_0x54924b[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0x239a3d[_0x477d('0x3a')]);_0x54924b[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0x54924b[_0x477d('0x39')],_0x54924b['query']);_0x5cd5c4['attributes']=_[_0x477d('0x3c')](_0x54924b[_0x477d('0x39')],qs[_0x477d('0x3d')](_0x239a3d['query']['fields']));_0x5cd5c4[_0x477d('0x3f')]=_0x5cd5c4[_0x477d('0x3f')][_0x477d('0x3e')]?_0x5cd5c4[_0x477d('0x3f')]:_0x54924b[_0x477d('0x39')];if(!_0x239a3d[_0x477d('0x3a')][_0x477d('0x60')](_0x477d('0x40'))){_0x5cd5c4[_0x477d('0x1e')]=qs['limit'](_0x239a3d[_0x477d('0x3a')][_0x477d('0x1e')]);_0x5cd5c4['offset']=qs[_0x477d('0x1c')](_0x239a3d[_0x477d('0x3a')][_0x477d('0x1c')]);}_0x5cd5c4[_0x477d('0x41')]=qs[_0x477d('0x42')](_0x239a3d['query'][_0x477d('0x42')]);_0x5cd5c4['where']=qs[_0x477d('0x3b')](_[_0x477d('0x44')](_0x239a3d['query'],_0x54924b[_0x477d('0x3b')]));_0x5cd5c4[_0x477d('0x43')]['VoiceQueueId']=_0x1a09f8['id'];if(_0x239a3d[_0x477d('0x3a')][_0x477d('0x2b')]){_0x5cd5c4['where']=_[_0x477d('0x45')](_0x5cd5c4[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x5cd5c4[_0x477d('0x3f')],function(_0x1cc5e1){var _0x231db4={};_0x231db4[_0x1cc5e1]={'$like':'%'+_0x239a3d[_0x477d('0x3a')][_0x477d('0x2b')]+'%'};return _0x231db4;})});}_0x5cd5c4=_[_0x477d('0x45')]({},_0x5cd5c4,_0x239a3d[_0x477d('0x4e')]);return db[_0x477d('0x61')][_0x477d('0x1f')]({'where':_0x5cd5c4[_0x477d('0x43')]})[_0x477d('0x25')](function(_0x1fb4cc){_0x4928f8['count']=_0x1fb4cc;if(_0x239a3d[_0x477d('0x3a')]['includeAll']){_0x5cd5c4['include']=[{'all':!![]}];}return db[_0x477d('0x61')][_0x477d('0x48')](_0x5cd5c4);})['then'](function(_0x210c4d){_0x4928f8[_0x477d('0x49')]=_0x210c4d;return _0x4928f8;});}})[_0x477d('0x25')](respondWithFilteredResult(_0x5c8fd8,_0x5cd5c4))[_0x477d('0x4a')](handleError(_0x5c8fd8,null));};exports[_0x477d('0x62')]=function(_0x1a4d12,_0x1731ff,_0x4b23d9){var _0x19e391={'raw':!![],'where':{}};var _0x3d1808={};var _0x5ae446={'count':0x0,'rows':[]};return db[_0x477d('0x37')][_0x477d('0x5f')]({'where':{'id':_0x1a4d12[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x1731ff,null))[_0x477d('0x25')](function(_0x135a69){if(_0x135a69){_0x3d1808[_0x477d('0x39')]=_[_0x477d('0x4c')](db[_0x477d('0x63')][_0x477d('0x4d')]);_0x3d1808[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0x1a4d12[_0x477d('0x3a')]);_0x3d1808[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0x3d1808[_0x477d('0x39')],_0x3d1808['query']);_0x19e391['attributes']=_[_0x477d('0x3c')](_0x3d1808['model'],qs['fields'](_0x1a4d12['query'][_0x477d('0x3d')]));_0x19e391[_0x477d('0x3f')]=_0x19e391['attributes'][_0x477d('0x3e')]?_0x19e391[_0x477d('0x3f')]:_0x3d1808[_0x477d('0x39')];if(!_0x1a4d12[_0x477d('0x3a')][_0x477d('0x60')]('nolimit')){_0x19e391['limit']=qs[_0x477d('0x1e')](_0x1a4d12[_0x477d('0x3a')][_0x477d('0x1e')]);_0x19e391[_0x477d('0x1c')]=qs[_0x477d('0x1c')](_0x1a4d12['query']['offset']);}_0x19e391['order']=qs[_0x477d('0x42')](_0x1a4d12[_0x477d('0x3a')]['sort']);_0x19e391[_0x477d('0x43')]=qs[_0x477d('0x3b')](_[_0x477d('0x44')](_0x1a4d12[_0x477d('0x3a')],_0x3d1808[_0x477d('0x3b')]));_0x19e391[_0x477d('0x43')][_0x477d('0x64')]=_0x135a69['id'];if(_0x1a4d12['query'][_0x477d('0x2b')]){_0x19e391['where']=_[_0x477d('0x45')](_0x19e391[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x19e391[_0x477d('0x3f')],function(_0x26658d){var _0x266f99={};_0x266f99[_0x26658d]={'$like':'%'+_0x1a4d12[_0x477d('0x3a')]['filter']+'%'};return _0x266f99;})});}_0x19e391=_[_0x477d('0x45')]({},_0x19e391,_0x1a4d12[_0x477d('0x4e')]);return db[_0x477d('0x63')][_0x477d('0x1f')]({'where':_0x19e391['where']})[_0x477d('0x25')](function(_0x56db60){_0x5ae446[_0x477d('0x1f')]=_0x56db60;if(_0x1a4d12[_0x477d('0x3a')][_0x477d('0x46')]){_0x19e391[_0x477d('0x47')]=[{'all':!![]}];}return db[_0x477d('0x63')]['findAll'](_0x19e391);})[_0x477d('0x25')](function(_0x5044c3){_0x5ae446[_0x477d('0x49')]=_0x5044c3;return _0x5ae446;});}})[_0x477d('0x25')](respondWithFilteredResult(_0x1731ff,_0x19e391))[_0x477d('0x4a')](handleError(_0x1731ff,null));};exports['getHopperFinals']=function(_0x40112e,_0x2c7a72,_0x3e70c7){var _0x71cbd5={'raw':!![],'where':{}};var _0x12acd2={};var _0x30ed3a={'count':0x0,'rows':[]};return db[_0x477d('0x37')][_0x477d('0x5f')]({'where':{'id':_0x40112e[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x2c7a72,null))[_0x477d('0x25')](function(_0x104d8b){if(_0x104d8b){_0x12acd2['model']=_['keys'](db[_0x477d('0x65')][_0x477d('0x4d')]);_0x12acd2[_0x477d('0x3a')]=_['keys'](_0x40112e['query']);_0x12acd2['filters']=_['intersection'](_0x12acd2[_0x477d('0x39')],_0x12acd2[_0x477d('0x3a')]);_0x71cbd5[_0x477d('0x3f')]=_[_0x477d('0x3c')](_0x12acd2[_0x477d('0x39')],qs['fields'](_0x40112e[_0x477d('0x3a')][_0x477d('0x3d')]));_0x71cbd5[_0x477d('0x3f')]=_0x71cbd5[_0x477d('0x3f')][_0x477d('0x3e')]?_0x71cbd5[_0x477d('0x3f')]:_0x12acd2['model'];if(!_0x40112e[_0x477d('0x3a')][_0x477d('0x60')](_0x477d('0x40'))){_0x71cbd5['limit']=qs[_0x477d('0x1e')](_0x40112e[_0x477d('0x3a')][_0x477d('0x1e')]);_0x71cbd5[_0x477d('0x1c')]=qs[_0x477d('0x1c')](_0x40112e['query'][_0x477d('0x1c')]);}_0x71cbd5[_0x477d('0x41')]=qs['sort'](_0x40112e[_0x477d('0x3a')][_0x477d('0x42')]);_0x71cbd5[_0x477d('0x43')]=qs[_0x477d('0x3b')](_['pick'](_0x40112e[_0x477d('0x3a')],_0x12acd2['filters']));_0x71cbd5['where'][_0x477d('0x64')]=_0x104d8b['id'];if(_0x40112e[_0x477d('0x3a')]['filter']){_0x71cbd5['where']=_['merge'](_0x71cbd5[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x71cbd5[_0x477d('0x3f')],function(_0x3ebe19){var _0x57a4cd={};_0x57a4cd[_0x3ebe19]={'$like':'%'+_0x40112e['query'][_0x477d('0x2b')]+'%'};return _0x57a4cd;})});}_0x71cbd5=_[_0x477d('0x45')]({},_0x71cbd5,_0x40112e[_0x477d('0x4e')]);return db[_0x477d('0x65')][_0x477d('0x1f')]({'where':_0x71cbd5['where']})[_0x477d('0x25')](function(_0x458fa5){_0x30ed3a['count']=_0x458fa5;if(_0x40112e['query']['includeAll']){_0x71cbd5[_0x477d('0x47')]=[{'all':!![]}];}return db[_0x477d('0x65')][_0x477d('0x48')](_0x71cbd5);})[_0x477d('0x25')](function(_0x44c2fa){_0x30ed3a[_0x477d('0x49')]=_0x44c2fa;return _0x30ed3a;});}})[_0x477d('0x25')](respondWithFilteredResult(_0x2c7a72,_0x71cbd5))[_0x477d('0x4a')](handleError(_0x2c7a72,null));};exports['getHopperBlacks']=function(_0x40495c,_0x137160,_0x59052e){var _0x451e18={'raw':!![],'where':{}};var _0x1e6db7={};var _0x1ac227={'count':0x0,'rows':[]};return db[_0x477d('0x37')][_0x477d('0x5f')]({'where':{'id':_0x40495c[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x137160,null))[_0x477d('0x25')](function(_0x1821b1){if(_0x1821b1){_0x1e6db7[_0x477d('0x39')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x1e6db7[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0x40495c[_0x477d('0x3a')]);_0x1e6db7[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0x1e6db7[_0x477d('0x39')],_0x1e6db7['query']);_0x451e18[_0x477d('0x3f')]=_['intersection'](_0x1e6db7[_0x477d('0x39')],qs[_0x477d('0x3d')](_0x40495c[_0x477d('0x3a')]['fields']));_0x451e18[_0x477d('0x3f')]=_0x451e18['attributes']['length']?_0x451e18['attributes']:_0x1e6db7['model'];if(!_0x40495c['query'][_0x477d('0x60')]('nolimit')){_0x451e18[_0x477d('0x1e')]=qs['limit'](_0x40495c[_0x477d('0x3a')]['limit']);_0x451e18[_0x477d('0x1c')]=qs[_0x477d('0x1c')](_0x40495c['query'][_0x477d('0x1c')]);}_0x451e18[_0x477d('0x41')]=qs[_0x477d('0x42')](_0x40495c[_0x477d('0x3a')]['sort']);_0x451e18[_0x477d('0x43')]=qs[_0x477d('0x3b')](_['pick'](_0x40495c[_0x477d('0x3a')],_0x1e6db7[_0x477d('0x3b')]));_0x451e18[_0x477d('0x43')][_0x477d('0x64')]=_0x1821b1['id'];if(_0x40495c[_0x477d('0x3a')][_0x477d('0x2b')]){_0x451e18[_0x477d('0x43')]=_[_0x477d('0x45')](_0x451e18[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x451e18[_0x477d('0x3f')],function(_0x42271d){var _0x2cbcc5={};_0x2cbcc5[_0x42271d]={'$like':'%'+_0x40495c[_0x477d('0x3a')][_0x477d('0x2b')]+'%'};return _0x2cbcc5;})});}_0x451e18=_[_0x477d('0x45')]({},_0x451e18,_0x40495c[_0x477d('0x4e')]);return db[_0x477d('0x66')][_0x477d('0x1f')]({'where':_0x451e18['where']})['then'](function(_0x45b405){_0x1ac227[_0x477d('0x1f')]=_0x45b405;if(_0x40495c[_0x477d('0x3a')]['includeAll']){_0x451e18['include']=[{'all':!![]}];}return db[_0x477d('0x66')][_0x477d('0x48')](_0x451e18);})['then'](function(_0x561c87){_0x1ac227[_0x477d('0x49')]=_0x561c87;return _0x1ac227;});}})[_0x477d('0x25')](respondWithFilteredResult(_0x137160,_0x451e18))[_0x477d('0x4a')](handleError(_0x137160,null));};exports[_0x477d('0x67')]=function(_0xb2a31,_0x3498ca,_0xa999e0){var _0x13967e={};var _0x3140d1={};var _0x492ac7;var _0x877a51;return db[_0x477d('0x37')][_0x477d('0x5f')]({'where':{'id':_0xb2a31[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x3498ca,null))['then'](function(_0x15e155){if(_0x15e155){_0x492ac7=_0x15e155;_0x3140d1[_0x477d('0x39')]=_[_0x477d('0x4c')](db[_0x477d('0x68')]['rawAttributes']);_0x3140d1[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0xb2a31['query']);_0x3140d1[_0x477d('0x3b')]=_['intersection'](_0x3140d1['model'],_0x3140d1['query']);_0x13967e['attributes']=_['intersection'](_0x3140d1[_0x477d('0x39')],qs['fields'](_0xb2a31[_0x477d('0x3a')][_0x477d('0x3d')]));_0x13967e[_0x477d('0x3f')]=_0x13967e[_0x477d('0x3f')][_0x477d('0x3e')]?_0x13967e['attributes']:_0x3140d1[_0x477d('0x39')];_0x13967e[_0x477d('0x41')]=qs[_0x477d('0x42')](_0xb2a31[_0x477d('0x3a')][_0x477d('0x42')]);_0x13967e[_0x477d('0x43')]=qs[_0x477d('0x3b')](_[_0x477d('0x44')](_0xb2a31[_0x477d('0x3a')],_0x3140d1[_0x477d('0x3b')]));if(_0xb2a31['query'][_0x477d('0x2b')]){_0x13967e[_0x477d('0x43')]=_[_0x477d('0x45')](_0x13967e[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x13967e[_0x477d('0x3f')],function(_0x49e480){var _0x4b3974={};_0x4b3974[_0x49e480]={'$like':'%'+_0xb2a31[_0x477d('0x3a')]['filter']+'%'};return _0x4b3974;})});}_0x13967e=_[_0x477d('0x45')]({},_0x13967e,_0xb2a31[_0x477d('0x4e')]);return _0x492ac7['getTeams'](_0x13967e);}})[_0x477d('0x25')](function(_0xb492a7){if(_0xb492a7){_0x877a51=_0xb492a7[_0x477d('0x3e')];if(!_0xb2a31['query'][_0x477d('0x60')](_0x477d('0x40'))){_0x13967e[_0x477d('0x1e')]=qs[_0x477d('0x1e')](_0xb2a31[_0x477d('0x3a')][_0x477d('0x1e')]);_0x13967e[_0x477d('0x1c')]=qs[_0x477d('0x1c')](_0xb2a31[_0x477d('0x3a')]['offset']);}return _0x492ac7[_0x477d('0x67')](_0x13967e);}})['then'](function(_0x45af5a){if(_0x45af5a){return _0x45af5a?{'count':_0x877a51,'rows':_0x45af5a}:null;}})[_0x477d('0x25')](respondWithResult(_0x3498ca,null))[_0x477d('0x4a')](handleError(_0x3498ca,null));};exports[_0x477d('0x69')]=function(_0x4996e6,_0x2fba34,_0x361807){var _0x513519=_0x4996e6[_0x477d('0x50')][_0x477d('0x6a')];var _0x377b3f=_[_0x477d('0x36')](_0x513519,'id');return db[_0x477d('0x68')][_0x477d('0x48')]({'where':{'id':_0x377b3f},'attributes':['id'],'include':[{'model':db[_0x477d('0x6b')],'as':_0x477d('0x6c'),'attributes':['id',_0x477d('0x31'),'online',_0x477d('0x6d'),_0x477d('0x6e')],'raw':!![]}]})[_0x477d('0x25')](function(_0x20281a){if(_0x20281a){var _0xd9fe10=_[_0x477d('0x6f')](_0x20281a,function(_0x44928b){var _0xe309bd=_0x44928b['get']({'plain':!![]});_0xe309bd[_0x477d('0x6c')]['forEach'](function(_0xc1d4bd){_0xc1d4bd[_0x477d('0x70')]=_[_0x477d('0x30')](_0x513519,{'id':_0xe309bd['id']})['penalty'];});return _0xe309bd['Agents'];});return db['VoiceQueue'][_0x477d('0x30')]({'where':{'id':_0x4996e6[_0x477d('0x4b')]['id']}})['then'](function(_0x320666){return db[_0x477d('0x71')][_0x477d('0x72')](function(_0x374539){return _0x320666['addTeams'](_0x377b3f,{'transaction':_0x374539})[_0x477d('0x25')](function(){return BPromise[_0x477d('0x73')](_0x513519,function(_0x36b530){return db[_0x477d('0x74')]['upsert']({'TeamId':_0x36b530['id'],'VoiceQueueId':_0x4996e6[_0x477d('0x4b')]['id'],'penalty':_0x36b530[_0x477d('0x70')]},{'transaction':_0x374539});});})['then'](function(){return BPromise[_0x477d('0x73')](_0xd9fe10,function(_0x21788f){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x21788f['id'],'VoiceQueueId':_0x4996e6[_0x477d('0x4b')]['id']},'defaults':{'penalty':_0x21788f['penalty']},'transaction':_0x374539});});})['then'](function(){return BPromise['each'](_[_0x477d('0x2b')](_0xd9fe10,{'online':!![]}),function(_0x77d5af){return db[_0x477d('0x75')][_0x477d('0x76')]({'membername':_0x77d5af['name'],'UserId':_0x77d5af['id'],'queue_name':_0x320666[_0x477d('0x31')],'VoiceQueueId':_0x320666['id'],'interface':_[_0x477d('0x77')](_0x77d5af[_0x477d('0x6e')])?util[_0x477d('0x78')](_0x477d('0x79'),_0x77d5af['name']):_0x77d5af[_0x477d('0x6e')],'paused':_0x77d5af[_0x477d('0x6d')]||![],'penalty':_0x77d5af[_0x477d('0x70')]},{'transaction':_0x374539});});})['then'](function(){_0xd9fe10['forEach'](function(_0x50cb27){socket['emit'](_0x477d('0x7a'),{'UserId':_0x50cb27['id'],'VoiceQueueId':_0x320666['id']});});});});});}})[_0x477d('0x25')](respondWithStatusCode(_0x2fba34,null))[_0x477d('0x4a')](handleError(_0x2fba34,null));};exports[_0x477d('0x7b')]=function(_0x28cd00,_0x41bbd3,_0x79ab31){return db[_0x477d('0x68')][_0x477d('0x48')]({'where':{'id':_0x28cd00[_0x477d('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x477d('0x6b')],'as':_0x477d('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x41bbd3,null))['then'](function(_0x1e4f03){var _0x280860=_['map'](_0x1e4f03,'id');var _0xead4a9=[];var _0x4f1512=[];var _0x12487e=squel[_0x477d('0x7c')]();_0x12487e['field'](_0x477d('0x7d'))[_0x477d('0x7e')]('team_has_voice_queues','tq')[_0x477d('0x7f')](_0x477d('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x477d('0x81'),_0x28cd00[_0x477d('0x4b')]['id']);for(var _0x196ef2=0x0;_0x196ef2<_0x1e4f03[_0x477d('0x3e')];_0x196ef2+=0x1){let _0x3b9d27=_0x1e4f03[_0x196ef2];for(var _0x524c15=0x0;_0x524c15<_0x3b9d27[_0x477d('0x6c')]['length'];_0x524c15+=0x1){let _0xb4000c=_0x3b9d27[_0x477d('0x6c')][_0x524c15];var _0xd4aed2=_0x12487e[_0x477d('0x58')]();_0xd4aed2[_0x477d('0x43')](_0x477d('0x82'),_0xb4000c['id']);_0x4f1512['push'](db[_0x477d('0x71')][_0x477d('0x3a')](_0xd4aed2['toString'](),{'type':db['sequelize']['QueryTypes'][_0x477d('0x83')]})['then'](function(_0x770f1e){if(_0x770f1e[_0x477d('0x3e')]===0x1){return _0xb4000c['id'];}else{var _0x17d484=_[_0x477d('0x84')](_[_0x477d('0x36')](_0x770f1e,_0x477d('0x85')),function(_0x3bb6ce){return _[_0x477d('0x2e')](_0x280860,_0x3bb6ce);});if(_0x17d484){return _0xb4000c['id'];}}}));}}return BPromise[_0x477d('0x86')](_0x4f1512)['then'](function(_0x41baa1){_0xead4a9=_(_0xead4a9)[_0x477d('0x87')](_0x41baa1)[_0x477d('0x88')]()[_0x477d('0x2d')]();return db[_0x477d('0x37')]['find']({'where':{'id':_0x28cd00[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](function(_0x119513){return db[_0x477d('0x71')][_0x477d('0x72')](function(_0x24bb45){return _0x119513[_0x477d('0x7b')](_0x28cd00['query'][_0x477d('0x89')],{'transaction':_0x24bb45})[_0x477d('0x25')](function(){if(!_[_0x477d('0x8a')](_0xead4a9)){return _0x119513[_0x477d('0x8b')](_0xead4a9,{'transaction':_0x24bb45})[_0x477d('0x25')](function(){return db[_0x477d('0x75')][_0x477d('0x26')]({'where':{'VoiceQueueId':_0x28cd00['params']['id'],'UserId':_0xead4a9},'transaction':_0x24bb45});});}})[_0x477d('0x25')](function(){_0xead4a9['forEach'](function(_0x2aee43){socket[_0x477d('0x8c')]('userVoiceQueue:remove',{'UserId':_0x2aee43,'VoiceQueueId':_0x119513['id']});});});});});});})[_0x477d('0x25')](respondWithStatusCode(_0x41bbd3,null))[_0x477d('0x4a')](handleError(_0x41bbd3,null));};exports[_0x477d('0x8d')]=function(_0x109a13,_0x2fe95b,_0x2ccd9a){var _0x12d53f,_0x5257ce;return db[_0x477d('0x37')][_0x477d('0x30')]({'where':{'id':_0x109a13[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x2fe95b,null))[_0x477d('0x25')](function(_0x166181){if(_0x166181){_0x5257ce=_0x166181;return _0x166181['addAgents'](_0x109a13[_0x477d('0x50')][_0x477d('0x89')],_[_0x477d('0x59')](_0x109a13['body'],[_0x477d('0x89'),'id'])||{})[_0x477d('0x8e')](function(_0x3474da){for(var _0x4e0c9c=0x0;_0x4e0c9c<_0x109a13['body'][_0x477d('0x89')]['length'];_0x4e0c9c+=0x1){socket['emit'](_0x477d('0x7a'),{'UserId':Number(_0x109a13[_0x477d('0x50')][_0x477d('0x89')][_0x4e0c9c]),'VoiceQueueId':Number(_0x109a13[_0x477d('0x4b')]['id'])});}return _0x3474da;});}})[_0x477d('0x25')](function(_0x3563c6){_0x12d53f=_0x3563c6||[];if(_0x5257ce){return db['User'][_0x477d('0x48')]({'where':{'id':_0x109a13[_0x477d('0x50')][_0x477d('0x89')]},'attributes':['id',_0x477d('0x31'),_0x477d('0x8f'),_0x477d('0x6d'),_0x477d('0x6e')],'raw':!![]});}})['then'](function(_0x1512ae){if(!_[_0x477d('0x8a')](_0x1512ae)){var _0x26402a=[];for(var _0x3edbf8=0x0;_0x3edbf8<_0x1512ae['length'];_0x3edbf8++){if(_0x1512ae[_0x3edbf8][_0x477d('0x8f')]){_0x26402a[_0x477d('0x90')](db[_0x477d('0x75')][_0x477d('0x76')]({'membername':_0x1512ae[_0x3edbf8]['name'],'UserId':_0x1512ae[_0x3edbf8]['id'],'queue_name':_0x5257ce[_0x477d('0x31')],'VoiceQueueId':_0x5257ce['id'],'interface':_[_0x477d('0x77')](_0x1512ae[_0x3edbf8][_0x477d('0x6e')])?util['format'](_0x477d('0x79'),_0x1512ae[_0x3edbf8][_0x477d('0x31')]):_0x1512ae[_0x3edbf8][_0x477d('0x6e')],'paused':_0x1512ae[_0x3edbf8][_0x477d('0x6d')]||![],'penalty':_0x109a13[_0x477d('0x50')][_0x477d('0x70')]||0x0}));}}return BPromise['all'](_0x26402a);}})['then'](function(){return _0x12d53f;})[_0x477d('0x25')](respondWithResult(_0x2fe95b,null))[_0x477d('0x4a')](handleError(_0x2fe95b,null));};exports[_0x477d('0x8b')]=function(_0x3f61f5,_0x478c2d,_0x1f012b){return db['VoiceQueue'][_0x477d('0x30')]({'where':{'id':_0x3f61f5[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x478c2d,null))[_0x477d('0x25')](function(_0x368930){if(_0x368930){return _0x368930['removeAgents'](_0x3f61f5[_0x477d('0x3a')][_0x477d('0x89')])[_0x477d('0x25')](function(){if(_[_0x477d('0x91')](_0x3f61f5[_0x477d('0x3a')]['ids'])){for(var _0xfe8776=0x0;_0xfe8776<_0x3f61f5[_0x477d('0x3a')][_0x477d('0x89')]['length'];_0xfe8776+=0x1){socket[_0x477d('0x8c')](_0x477d('0x92'),{'UserId':Number(_0x3f61f5[_0x477d('0x3a')][_0x477d('0x89')][_0xfe8776]),'VoiceQueueId':Number(_0x3f61f5['params']['id'])});}}else{socket[_0x477d('0x8c')](_0x477d('0x92'),{'UserId':Number(_0x3f61f5[_0x477d('0x3a')][_0x477d('0x89')]),'VoiceQueueId':Number(_0x3f61f5['params']['id'])});}});}})[_0x477d('0x25')](function(_0x4933ae){return db[_0x477d('0x75')]['destroy']({'where':{'VoiceQueueId':_0x3f61f5[_0x477d('0x4b')]['id'],'UserId':_0x3f61f5[_0x477d('0x3a')][_0x477d('0x89')]}})['then'](function(){return _0x4933ae;});})[_0x477d('0x25')](respondWithStatusCode(_0x478c2d,null))[_0x477d('0x4a')](handleError(_0x478c2d,null));};exports[_0x477d('0x93')]=function(_0xa63cba,_0x15f9ff,_0x1b24c6){var _0x542c21={};var _0x1c2b62={};var _0x3f07d3;var _0x438124;return db[_0x477d('0x37')][_0x477d('0x5f')]({'where':{'id':_0xa63cba[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x15f9ff,null))['then'](function(_0x375867){if(_0x375867){_0x3f07d3=_0x375867;_0x1c2b62[_0x477d('0x39')]=_[_0x477d('0x4c')](db[_0x477d('0x6b')][_0x477d('0x4d')]);_0x1c2b62[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0xa63cba[_0x477d('0x3a')]);_0x1c2b62[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0x1c2b62[_0x477d('0x39')],_0x1c2b62[_0x477d('0x3a')]);_0x542c21[_0x477d('0x3f')]=_[_0x477d('0x3c')](_0x1c2b62[_0x477d('0x39')],qs[_0x477d('0x3d')](_0xa63cba[_0x477d('0x3a')]['fields']));_0x542c21['attributes']=_0x542c21[_0x477d('0x3f')]['length']?_0x542c21[_0x477d('0x3f')]:_0x1c2b62['model'];_0x542c21[_0x477d('0x41')]=qs['sort'](_0xa63cba[_0x477d('0x3a')][_0x477d('0x42')]);_0x542c21['where']=qs[_0x477d('0x3b')](_[_0x477d('0x44')](_0xa63cba[_0x477d('0x3a')],_0x1c2b62[_0x477d('0x3b')]));if(_0xa63cba[_0x477d('0x3a')]['filter']){_0x542c21[_0x477d('0x43')]=_[_0x477d('0x45')](_0x542c21['where'],{'$or':_['map'](_0x542c21[_0x477d('0x3f')],function(_0x581bd1){var _0x96b0da={};_0x96b0da[_0x581bd1]={'$like':'%'+_0xa63cba[_0x477d('0x3a')]['filter']+'%'};return _0x96b0da;})});}_0x542c21=_['merge']({},_0x542c21,_0xa63cba['options']);return _0x3f07d3[_0x477d('0x93')](_0x542c21);}})['then'](function(_0x341307){if(_0x341307){_0x438124=_0x341307[_0x477d('0x3e')];if(!_0xa63cba[_0x477d('0x3a')][_0x477d('0x60')](_0x477d('0x40'))){_0x542c21['limit']=qs[_0x477d('0x1e')](_0xa63cba['query'][_0x477d('0x1e')]);_0x542c21[_0x477d('0x1c')]=qs[_0x477d('0x1c')](_0xa63cba['query'][_0x477d('0x1c')]);}return _0x3f07d3[_0x477d('0x93')](_0x542c21);}})[_0x477d('0x25')](function(_0x534aad){if(_0x534aad){return _0x534aad?{'count':_0x438124,'rows':_0x534aad}:null;}})['then'](respondWithResult(_0x15f9ff,null))[_0x477d('0x4a')](handleError(_0x15f9ff,null));};exports['getMembers']=function(_0x3da01d,_0x17b2e2,_0x579e75){var _0x109acb={};var _0x4dc91e={};var _0x1ea699;var _0x517536;return db[_0x477d('0x37')][_0x477d('0x5f')]({'where':{'id':_0x3da01d[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x17b2e2,null))[_0x477d('0x25')](function(_0x4a3632){if(_0x4a3632){_0x1ea699=_0x4a3632;_0x4dc91e[_0x477d('0x39')]=_[_0x477d('0x4c')](db[_0x477d('0x75')][_0x477d('0x4d')]);_0x4dc91e[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0x3da01d['query']);_0x4dc91e[_0x477d('0x3b')]=_['intersection'](_0x4dc91e[_0x477d('0x39')],_0x4dc91e['query']);_0x109acb[_0x477d('0x3f')]=_[_0x477d('0x3c')](_0x4dc91e['model'],qs[_0x477d('0x3d')](_0x3da01d[_0x477d('0x3a')][_0x477d('0x3d')]));_0x109acb[_0x477d('0x3f')]=_0x109acb[_0x477d('0x3f')]['length']?_0x109acb[_0x477d('0x3f')]:_0x4dc91e[_0x477d('0x39')];_0x109acb['order']=qs['sort'](_0x3da01d[_0x477d('0x3a')]['sort']);_0x109acb[_0x477d('0x43')]=qs['filters'](_[_0x477d('0x44')](_0x3da01d[_0x477d('0x3a')],_0x4dc91e['filters']));if(_0x3da01d['query'][_0x477d('0x2b')]){_0x109acb['where']=_[_0x477d('0x45')](_0x109acb[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x109acb['attributes'],function(_0x2ef92a){var _0x487640={};_0x487640[_0x2ef92a]={'$like':'%'+_0x3da01d['query'][_0x477d('0x2b')]+'%'};return _0x487640;})});}_0x109acb=_[_0x477d('0x45')]({},_0x109acb,_0x3da01d[_0x477d('0x4e')]);return _0x1ea699[_0x477d('0x94')](_0x109acb);}})['then'](function(_0x3a699b){if(_0x3a699b){_0x517536=_0x3a699b[_0x477d('0x3e')];if(!_0x3da01d[_0x477d('0x3a')][_0x477d('0x60')](_0x477d('0x40'))){_0x109acb[_0x477d('0x1e')]=qs[_0x477d('0x1e')](_0x3da01d[_0x477d('0x3a')][_0x477d('0x1e')]);_0x109acb['offset']=qs[_0x477d('0x1c')](_0x3da01d[_0x477d('0x3a')][_0x477d('0x1c')]);}return _0x1ea699[_0x477d('0x94')](_0x109acb);}})['then'](function(_0x5c03f5){return _0x5c03f5?{'count':_0x517536,'rows':_0x5c03f5}:null;})[_0x477d('0x25')](respondWithResult(_0x17b2e2,null))['catch'](handleError(_0x17b2e2,null));};exports[_0x477d('0x95')]=function(_0x4ac7a7,_0x33f153,_0x29715b){var _0x4212e4={};var _0x48934d={};var _0x9fef79;var _0x2720cb;return db['VoiceQueue'][_0x477d('0x5f')]({'where':{'id':_0x4ac7a7[_0x477d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x33f153,null))[_0x477d('0x25')](function(_0x583deb){if(_0x583deb){_0x9fef79=_0x583deb;_0x48934d[_0x477d('0x39')]=_['keys'](db['CmList']['rawAttributes']);_0x48934d[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0x4ac7a7['query']);_0x48934d[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0x48934d[_0x477d('0x39')],_0x48934d[_0x477d('0x3a')]);_0x4212e4[_0x477d('0x3f')]=_[_0x477d('0x3c')](_0x48934d[_0x477d('0x39')],qs[_0x477d('0x3d')](_0x4ac7a7[_0x477d('0x3a')]['fields']));_0x4212e4[_0x477d('0x3f')]=_0x4212e4['attributes'][_0x477d('0x3e')]?_0x4212e4[_0x477d('0x3f')]:_0x48934d[_0x477d('0x39')];_0x4212e4[_0x477d('0x41')]=qs['sort'](_0x4ac7a7['query'][_0x477d('0x42')]);_0x4212e4['where']=qs[_0x477d('0x3b')](_[_0x477d('0x44')](_0x4ac7a7['query'],_0x48934d[_0x477d('0x3b')]));if(_0x4ac7a7[_0x477d('0x3a')][_0x477d('0x2b')]){_0x4212e4[_0x477d('0x43')]=_[_0x477d('0x45')](_0x4212e4[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x4212e4[_0x477d('0x3f')],function(_0x3eff80){var _0x1104ba={};_0x1104ba[_0x3eff80]={'$like':'%'+_0x4ac7a7[_0x477d('0x3a')]['filter']+'%'};return _0x1104ba;})});}_0x4212e4=_[_0x477d('0x45')]({},_0x4212e4,_0x4ac7a7[_0x477d('0x4e')]);return _0x9fef79['getLists'](_0x4212e4);}})[_0x477d('0x25')](function(_0x98745){if(_0x98745){_0x2720cb=_0x98745['length'];if(!_0x4ac7a7['query'][_0x477d('0x60')](_0x477d('0x40'))){_0x4212e4[_0x477d('0x1e')]=qs[_0x477d('0x1e')](_0x4ac7a7[_0x477d('0x3a')][_0x477d('0x1e')]);_0x4212e4['offset']=qs['offset'](_0x4ac7a7['query'][_0x477d('0x1c')]);}return _0x9fef79[_0x477d('0x95')](_0x4212e4);}})[_0x477d('0x25')](function(_0x2a14f8){if(_0x2a14f8){return _0x2a14f8?{'count':_0x2720cb,'rows':_0x2a14f8}:null;}})[_0x477d('0x25')](respondWithResult(_0x33f153,null))[_0x477d('0x4a')](handleError(_0x33f153,null));};exports[_0x477d('0x96')]=function(_0x53bae5,_0x12ec9f,_0x2d7844){var _0x493bfa=moment()[_0x477d('0x78')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5e9214,_0x506f4e;return db[_0x477d('0x37')][_0x477d('0x30')]({'where':{'id':_0x53bae5['params']['id']}})['then'](handleEntityNotFound(_0x12ec9f,null))[_0x477d('0x25')](function(_0x5953e4){if(_0x5953e4){_0x506f4e=_0x5953e4;return _0x5953e4['addLists'](_0x53bae5['body']['ids'],_['omit'](_0x53bae5['body'],['ids','id'])||{});}return null;})[_0x477d('0x8e')](function(_0x2b09f2){var _0x547b6d;_0x5e9214=_0x2b09f2||[];var _0x839ef0=[];if(_0x2b09f2){for(var _0x1c46ad=0x0;_0x1c46ad<_0x2b09f2[_0x477d('0x3e')];_0x1c46ad+=0x1){var _0x44b16f=_0x2b09f2[_0x1c46ad]['get']({'plain':!![]});_0x506f4e[_0x477d('0x97')]=_0x53bae5[_0x477d('0x50')][_0x477d('0x97')]?_0x53bae5[_0x477d('0x50')][_0x477d('0x97')]:_0x506f4e[_0x477d('0x97')];switch(_0x506f4e[_0x477d('0x97')]){case _0x477d('0x98'):_0x547b6d=squel[_0x477d('0x99')]()[_0x477d('0x9a')](_0x477d('0x9b'))[_0x477d('0x9c')]([_0x477d('0x9d'),'scheduledAt',_0x477d('0x9e'),'ListId',_0x477d('0x64'),_0x477d('0x5a'),_0x477d('0x5b')],squel[_0x477d('0x7c')]()[_0x477d('0x9f')](_0x477d('0x9d'),_0x477d('0x9d'))['field']('\x27'+_0x493bfa+'\x27','scheduledAt')[_0x477d('0x9f')]('id',_0x477d('0x9e'))[_0x477d('0x9f')](_0x44b16f[_0x477d('0xa0')][_0x477d('0xa1')](),_0x477d('0xa2'))[_0x477d('0x9f')](_0x53bae5[_0x477d('0x4b')]['id'][_0x477d('0xa1')](),_0x477d('0x64'))['field']('\x27'+_0x493bfa+'\x27',_0x477d('0x5a'))[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27',_0x477d('0x5b'))[_0x477d('0x7e')](_0x477d('0xa3'))[_0x477d('0x43')](_0x477d('0xa4'))[_0x477d('0x43')](_0x477d('0xa5'),_0x44b16f[_0x477d('0xa0')]['toString']())[_0x477d('0x43')](_0x477d('0xa6'))[_0x477d('0x43')](_0x477d('0xa7'),squel[_0x477d('0x7c')]()['field'](_0x477d('0xa8'))['from']('cm_hopper_final')[_0x477d('0x43')](_0x477d('0x81'),_0x53bae5['params']['id']['toString']()))[_0x477d('0x43')](_0x477d('0xa7'),squel[_0x477d('0x7c')]()[_0x477d('0x9f')](_0x477d('0xa9'))[_0x477d('0x7e')]('cm_hopper')[_0x477d('0x43')]('VoiceQueueId\x20=\x20?',_0x53bae5[_0x477d('0x4b')]['id'][_0x477d('0xa1')]())))[_0x477d('0xa1')]();break;case _0x477d('0xaa'):_0x547b6d=squel[_0x477d('0x99')]()[_0x477d('0x9a')](_0x477d('0x9b'))[_0x477d('0x9c')]([_0x477d('0x9d'),_0x477d('0xab'),_0x477d('0x9e'),_0x477d('0xa2'),_0x477d('0x64'),_0x477d('0x5a'),_0x477d('0x5b')],squel[_0x477d('0x7c')]()[_0x477d('0x9f')](_0x477d('0x9d'),'phone')[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27',_0x477d('0xab'))['field']('id','ContactId')[_0x477d('0x9f')](_0x44b16f['CmListId'][_0x477d('0xa1')](),_0x477d('0xa2'))['field'](_0x53bae5['params']['id']['toString'](),_0x477d('0x64'))[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27',_0x477d('0x5a'))[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27',_0x477d('0x5b'))['from']('cm_contacts')[_0x477d('0x43')](_0x477d('0xa4'))['where'](_0x477d('0xa5'),_0x44b16f['CmListId']['toString']())[_0x477d('0x43')](_0x477d('0xa6'))[_0x477d('0x43')](_0x477d('0xa7'),squel[_0x477d('0x7c')]()['field'](_0x477d('0xa9'))[_0x477d('0x7e')](_0x477d('0x9b'))[_0x477d('0x43')](_0x477d('0x81'),_0x53bae5[_0x477d('0x4b')]['id'][_0x477d('0xa1')]())))['toString']();break;default:_0x547b6d=squel[_0x477d('0x99')]()[_0x477d('0x9a')](_0x477d('0x9b'))[_0x477d('0x9c')](['phone',_0x477d('0xab'),_0x477d('0x9e'),_0x477d('0xa2'),'VoiceQueueId',_0x477d('0x5a'),_0x477d('0x5b')],squel[_0x477d('0x7c')]()[_0x477d('0x9f')](_0x477d('0x9d'),'phone')[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27','scheduledAt')[_0x477d('0x9f')]('id',_0x477d('0x9e'))[_0x477d('0x9f')](_0x44b16f['CmListId']['toString'](),'ListId')['field'](_0x53bae5['params']['id'][_0x477d('0xa1')](),_0x477d('0x64'))['field']('\x27'+_0x493bfa+'\x27',_0x477d('0x5a'))[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27',_0x477d('0x5b'))[_0x477d('0x7e')](_0x477d('0xa3'))[_0x477d('0x43')](_0x477d('0xa4'))[_0x477d('0x43')](_0x477d('0xa5'),_0x44b16f[_0x477d('0xa0')][_0x477d('0xa1')]())['where'](_0x477d('0xa6')))[_0x477d('0xa1')]();}_0x839ef0[_0x477d('0x90')](db[_0x477d('0x71')]['query'](_0x547b6d));}return BPromise[_0x477d('0x86')](_0x839ef0);}})[_0x477d('0x25')](function(){var _0x1d37d6=[];var _0x256bac=squel['insert']()[_0x477d('0x9a')](_0x477d('0xac'))['fromQuery']([_0x477d('0xad'),_0x477d('0x9d'),'OrderBy',_0x477d('0x5a'),_0x477d('0x5b')],squel[_0x477d('0x7c')]()[_0x477d('0x9f')](_0x477d('0xae'))[_0x477d('0x9f')](_0x477d('0xaf'))[_0x477d('0x9f')](_0x477d('0xb0'))[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27',_0x477d('0x5a'))[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27','updatedAt')['from'](_0x477d('0xb1'),'ci')[_0x477d('0x7f')](_0x477d('0x9b'),'h',_0x477d('0xb2'))[_0x477d('0x43')]('h.scheduledat=?',_0x493bfa)[_0x477d('0x43')](_0x477d('0xb3'),_0x477d('0xb4')))[_0x477d('0xa1')]();_0x1d37d6['push'](db[_0x477d('0x71')][_0x477d('0x3a')](_0x256bac));return BPromise['all'](_0x1d37d6);})[_0x477d('0x25')](function(){return _0x5e9214;})[_0x477d('0x25')](respondWithResult(_0x12ec9f,null))[_0x477d('0x4a')](handleError(_0x12ec9f,null));};exports[_0x477d('0xb5')]=function(_0x585f7e,_0x3faf93,_0x3f085d){return db['VoiceQueue'][_0x477d('0x30')]({'where':{'id':_0x585f7e[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x3faf93,null))[_0x477d('0x25')](function(_0xd68325){if(_0xd68325){return _0xd68325[_0x477d('0xb5')](_0x585f7e[_0x477d('0x3a')][_0x477d('0x89')]);}})[_0x477d('0x25')](function(_0x318107){if(_0x318107){return db[_0x477d('0x61')][_0x477d('0x26')]({'where':{'ListId':_0x585f7e['query']['ids'],'VoiceQueueId':_0x585f7e[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](function(){return _0x318107;});}})['then'](respondWithStatusCode(_0x3faf93,null))[_0x477d('0x4a')](handleError(_0x3faf93,null));};exports[_0x477d('0xb6')]=function(_0xb71be6,_0x294394,_0x5dba15){var _0x1eb546={};var _0xc8a414={};var _0x211f74;var _0xc13868;return db['VoiceQueue'][_0x477d('0x5f')]({'where':{'id':_0xb71be6['params']['id']}})['then'](handleEntityNotFound(_0x294394,null))[_0x477d('0x25')](function(_0x2833c3){if(_0x2833c3){_0x211f74=_0x2833c3;_0xc8a414[_0x477d('0x39')]=_['keys'](db[_0x477d('0xb7')][_0x477d('0x4d')]);_0xc8a414['query']=_[_0x477d('0x4c')](_0xb71be6[_0x477d('0x3a')]);_0xc8a414[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0xc8a414[_0x477d('0x39')],_0xc8a414[_0x477d('0x3a')]);_0x1eb546[_0x477d('0x3f')]=_[_0x477d('0x3c')](_0xc8a414['model'],qs[_0x477d('0x3d')](_0xb71be6[_0x477d('0x3a')][_0x477d('0x3d')]));_0x1eb546[_0x477d('0x3f')]=_0x1eb546[_0x477d('0x3f')][_0x477d('0x3e')]?_0x1eb546['attributes']:_0xc8a414[_0x477d('0x39')];_0x1eb546[_0x477d('0x41')]=qs[_0x477d('0x42')](_0xb71be6[_0x477d('0x3a')][_0x477d('0x42')]);_0x1eb546[_0x477d('0x43')]=qs[_0x477d('0x3b')](_[_0x477d('0x44')](_0xb71be6['query'],_0xc8a414[_0x477d('0x3b')]));if(_0xb71be6[_0x477d('0x3a')][_0x477d('0x2b')]){_0x1eb546[_0x477d('0x43')]=_[_0x477d('0x45')](_0x1eb546[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x1eb546[_0x477d('0x3f')],function(_0x2cdbd2){var _0x101d6f={};_0x101d6f[_0x2cdbd2]={'$like':'%'+_0xb71be6[_0x477d('0x3a')][_0x477d('0x2b')]+'%'};return _0x101d6f;})});}_0x1eb546=_[_0x477d('0x45')]({},_0x1eb546,_0xb71be6[_0x477d('0x4e')]);return _0x211f74[_0x477d('0xb6')](_0x1eb546);}})['then'](function(_0x41cd11){if(_0x41cd11){_0xc13868=_0x41cd11[_0x477d('0x3e')];if(!_0xb71be6['query'][_0x477d('0x60')](_0x477d('0x40'))){_0x1eb546[_0x477d('0x1e')]=qs[_0x477d('0x1e')](_0xb71be6['query']['limit']);_0x1eb546[_0x477d('0x1c')]=qs['offset'](_0xb71be6[_0x477d('0x3a')]['offset']);}return _0x211f74['getBlackLists'](_0x1eb546);}})[_0x477d('0x25')](function(_0x500ac0){if(_0x500ac0){return _0x500ac0?{'count':_0xc13868,'rows':_0x500ac0}:null;}})[_0x477d('0x25')](respondWithResult(_0x294394,null))[_0x477d('0x4a')](handleError(_0x294394,null));};exports[_0x477d('0xb8')]=function(_0x42af76,_0x1ef70f,_0xb4dad0){var _0x2b84b9,_0x281a7a;return db[_0x477d('0x37')][_0x477d('0x30')]({'where':{'id':_0x42af76[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x1ef70f,null))[_0x477d('0x25')](function(_0x2d699f){if(_0x2d699f){_0x281a7a=_0x2d699f;return _0x2d699f[_0x477d('0xb8')](_0x42af76['body'][_0x477d('0x89')],_[_0x477d('0x59')](_0x42af76[_0x477d('0x50')],[_0x477d('0x89'),'id'])||{});}return null;})[_0x477d('0x8e')](function(_0x1e8632){var _0x3848dd;_0x2b84b9=_0x1e8632||[];var _0x1666b1=[];if(_0x1e8632){for(var _0x4d88b5=0x0;_0x4d88b5<_0x1e8632[_0x477d('0x3e')];_0x4d88b5+=0x1){var _0x2c5a62=_0x1e8632[_0x4d88b5][_0x477d('0x27')]({'plain':!![]});_0x3848dd=squel[_0x477d('0x99')]()['into'](_0x477d('0xb9'))[_0x477d('0x9c')]([_0x477d('0x9d'),'ContactId',_0x477d('0xa2'),_0x477d('0x64'),_0x477d('0x5a'),_0x477d('0x5b')],squel[_0x477d('0x7c')]()['field'](_0x477d('0x9d'),_0x477d('0x9d'))[_0x477d('0x9f')]('id',_0x477d('0x9e'))[_0x477d('0x9f')](_0x2c5a62[_0x477d('0xa0')][_0x477d('0xa1')](),'ListId')[_0x477d('0x9f')](_0x42af76['params']['id']['toString'](),'VoiceQueueId')[_0x477d('0x9f')]('NOW()',_0x477d('0x5a'))['field'](_0x477d('0xba'),'updatedAt')[_0x477d('0x7e')](_0x477d('0xa3'))[_0x477d('0x43')](_0x477d('0xa4'))[_0x477d('0x43')](_0x477d('0xa5'),_0x2c5a62[_0x477d('0xa0')]['toString']())[_0x477d('0x43')](_0x477d('0xa6')))[_0x477d('0xa1')]();_0x1666b1[_0x477d('0x90')](db[_0x477d('0x71')][_0x477d('0x3a')](_0x3848dd));}return BPromise[_0x477d('0x86')](_0x1666b1);}})[_0x477d('0x25')](function(){return _0x2b84b9;})[_0x477d('0x25')](respondWithResult(_0x1ef70f,null))[_0x477d('0x4a')](handleError(_0x1ef70f,null));};exports[_0x477d('0xbb')]=function(_0x3a26b9,_0x488cf9,_0x3dd854){return db[_0x477d('0x37')]['find']({'where':{'id':_0x3a26b9['params']['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x488cf9,null))[_0x477d('0x25')](function(_0x4095d0){if(_0x4095d0){return _0x4095d0[_0x477d('0xbb')](_0x3a26b9[_0x477d('0x3a')][_0x477d('0x89')]);}})[_0x477d('0x25')](function(_0x46f63c){if(_0x46f63c){return db['CmHopperBlack'][_0x477d('0x26')]({'where':{'ListId':_0x3a26b9[_0x477d('0x3a')][_0x477d('0x89')],'VoiceQueueId':_0x3a26b9[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](function(){return _0x46f63c;});}})[_0x477d('0x25')](respondWithStatusCode(_0x488cf9,null))[_0x477d('0x4a')](handleError(_0x488cf9,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 99e22cc..9102c8c 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 _0x21c3=['exports','events','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x47dcb4,_0x2c395a){var _0x356abb=function(_0x43ac25){while(--_0x43ac25){_0x47dcb4['push'](_0x47dcb4['shift']());}};_0x356abb(++_0x2c395a);}(_0x21c3,0x71));var _0x321c=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x21c3[_0x2b4411];return _0x8e41ef;};'use strict';var EventEmitter=require(_0x321c('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x321c('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x321c('0x2'),'afterDestroy':_0x321c('0x3')};function emitEvent(_0xc4e401){return function(_0x200844,_0x30085f,_0x42e2aa){VoiceQueueEvents[_0x321c('0x4')](_0xc4e401+':'+_0x200844['id'],_0x200844);VoiceQueueEvents[_0x321c('0x4')](_0xc4e401,_0x200844);_0x42e2aa(null);};}for(var e in events){if(events[_0x321c('0x5')](e)){var event=events[e];VoiceQueue[_0x321c('0x6')](e,emitEvent(event));}}module[_0x321c('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x5c1f=['events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','hasOwnProperty','hook'];(function(_0x166329,_0x369a29){var _0x32e887=function(_0x3e5db1){while(--_0x3e5db1){_0x166329['push'](_0x166329['shift']());}};_0x32e887(++_0x369a29);}(_0x5c1f,0x128));var _0xf5c1=function(_0x48961c,_0x280e9d){_0x48961c=_0x48961c-0x0;var _0x1d895d=_0x5c1f[_0x48961c];return _0x1d895d;};'use strict';var EventEmitter=require(_0xf5c1('0x0'));var VoiceQueue=require(_0xf5c1('0x1'))['db'][_0xf5c1('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf5c1('0x3')](0x0);var events={'afterCreate':_0xf5c1('0x4'),'afterUpdate':_0xf5c1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x44ef87){return function(_0x4edb13,_0x14a4d6,_0x963250){VoiceQueueEvents['emit'](_0x44ef87+':'+_0x4edb13['id'],_0x4edb13);VoiceQueueEvents['emit'](_0x44ef87,_0x4edb13);_0x963250(null);};}for(var e in events){if(events[_0xf5c1('0x6')](e)){var event=events[e];VoiceQueue[_0xf5c1('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index ff05a07..673dab2 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x254ceb,_0x1a0ed0){var _0x1b9023=function(_0x381c6e){while(--_0x381c6e){_0x254ceb['push'](_0x254ceb['shift']());}};_0x1b9023(++_0x1a0ed0);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x4737a0,_0x36520e){var _0x4d558b=function(_0xaa9825){while(--_0xaa9825){_0x4737a0['push'](_0x4737a0['shift']());}};_0x4d558b(++_0x36520e);}(_0x008c,0x188));var _0xc008=function(_0x23b2b4,_0x1af875){_0x23b2b4=_0x23b2b4-0x0;var _0x4918ae=_0x008c[_0x23b2b4];return _0x4918ae;};'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 diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index edcf750..53e6c75 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 _0xbae0=['model','ShowVoiceQueue','where','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','map','include'];(function(_0x3b6797,_0x24854f){var _0x1c8c09=function(_0x37ef56){while(--_0x37ef56){_0x3b6797['push'](_0x3b6797['shift']());}};_0x1c8c09(++_0x24854f);}(_0xbae0,0x1a5));var _0x0bae=function(_0x36f47c,_0x38ef4d){_0x36f47c=_0x36f47c-0x0;var _0x296c55=_0xbae0[_0x36f47c];return _0x296c55;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0bae('0x0'));var rs=require(_0x0bae('0x1'));var fs=require('fs');var Redis=require(_0x0bae('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0bae('0x3'))(_0x0bae('0x4'));var config=require(_0x0bae('0x5'));var jayson=require(_0x0bae('0x6'));var client=jayson[_0x0bae('0x7')][_0x0bae('0x8')]({'port':0x232a});config[_0x0bae('0x9')]=_[_0x0bae('0xa')](config['redis'],{'host':_0x0bae('0xb'),'port':0x18eb});var socket=require(_0x0bae('0xc'))(new Redis(config[_0x0bae('0x9')]));require('./voiceQueue.socket')[_0x0bae('0xd')](socket);function respondWithRpcPromise(_0x5c1580,_0x2e9997,_0x300842){return new BPromise(function(_0x2ca3bf,_0x158024){return client[_0x0bae('0xe')](_0x5c1580,_0x300842)[_0x0bae('0xf')](function(_0x466cf5){logger[_0x0bae('0x10')](_0x0bae('0x11'),_0x2e9997,'request\x20sent');logger[_0x0bae('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x2e9997,'request\x20sent',JSON[_0x0bae('0x13')](_0x466cf5));if(_0x466cf5['error']){if(_0x466cf5['error'][_0x0bae('0x14')]===0x1f4){logger[_0x0bae('0x15')](_0x0bae('0x11'),_0x2e9997,_0x466cf5[_0x0bae('0x15')][_0x0bae('0x16')]);return _0x158024(_0x466cf5[_0x0bae('0x15')]['message']);}logger[_0x0bae('0x15')](_0x0bae('0x11'),_0x2e9997,_0x466cf5['error']['message']);return _0x2ca3bf(_0x466cf5['error'][_0x0bae('0x16')]);}else{logger[_0x0bae('0x10')](_0x0bae('0x11'),_0x2e9997,_0x0bae('0x17'));_0x2ca3bf(_0x466cf5[_0x0bae('0x18')][_0x0bae('0x16')]);}})[_0x0bae('0x19')](function(_0x668104){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x2e9997,_0x668104);_0x158024(_0x668104);});});}exports[_0x0bae('0x1a')]=function(_0x256fa3){var _0x1f17e0=this;return new Promise(function(_0x349c1e,_0x2e18c6){return db[_0x0bae('0x1b')][_0x0bae('0x1c')]({'raw':_0x256fa3[_0x0bae('0x1d')]?_0x256fa3['options'][_0x0bae('0x1e')]===undefined?!![]:![]:!![],'where':_0x256fa3[_0x0bae('0x1d')]?_0x256fa3['options']['where']||null:null,'attributes':_0x256fa3[_0x0bae('0x1d')]?_0x256fa3[_0x0bae('0x1d')][_0x0bae('0x1f')]||null:null,'limit':_0x256fa3[_0x0bae('0x1d')]?_0x256fa3[_0x0bae('0x1d')][_0x0bae('0x20')]||null:null,'include':_0x256fa3[_0x0bae('0x1d')]?_0x256fa3[_0x0bae('0x1d')]['include']?_[_0x0bae('0x21')](_0x256fa3[_0x0bae('0x1d')][_0x0bae('0x22')],function(_0x5ca57e){return{'model':db[_0x5ca57e[_0x0bae('0x23')]],'as':_0x5ca57e['as'],'attributes':_0x5ca57e[_0x0bae('0x1f')],'include':_0x5ca57e['include']?_['map'](_0x5ca57e[_0x0bae('0x22')],function(_0x58d4b3){return{'model':db[_0x58d4b3[_0x0bae('0x23')]],'as':_0x58d4b3['as'],'attributes':_0x58d4b3[_0x0bae('0x1f')],'include':_0x58d4b3[_0x0bae('0x22')]?_['map'](_0x58d4b3[_0x0bae('0x22')],function(_0x32cf83){return{'model':db[_0x32cf83[_0x0bae('0x23')]],'as':_0x32cf83['as'],'attributes':_0x32cf83[_0x0bae('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0bae('0xf')](function(_0x2060d1){logger['info'](_0x0bae('0x1a'),_0x256fa3);logger['debug'](_0x0bae('0x1a'),_0x256fa3,JSON[_0x0bae('0x13')](_0x2060d1));_0x349c1e(_0x2060d1);})[_0x0bae('0x19')](function(_0x5a21f5){logger['error'](_0x0bae('0x1a'),_0x5a21f5[_0x0bae('0x16')],_0x256fa3);_0x2e18c6(_0x1f17e0['error'](0x1f4,_0x5a21f5[_0x0bae('0x16')]));});});};exports[_0x0bae('0x24')]=function(_0x54cca4){var _0x19a891=this;return new Promise(function(_0x29e786,_0x4ded80){return db[_0x0bae('0x1b')]['find']({'raw':_0x54cca4['options']?_0x54cca4[_0x0bae('0x1d')][_0x0bae('0x1e')]===undefined?!![]:![]:!![],'where':_0x54cca4[_0x0bae('0x1d')]?_0x54cca4[_0x0bae('0x1d')][_0x0bae('0x25')]||null:null,'attributes':_0x54cca4[_0x0bae('0x1d')]?_0x54cca4[_0x0bae('0x1d')][_0x0bae('0x1f')]||null:null,'include':_0x54cca4[_0x0bae('0x1d')]?_0x54cca4[_0x0bae('0x1d')]['include']?_[_0x0bae('0x21')](_0x54cca4['options'][_0x0bae('0x22')],function(_0xa7eb7f){return{'model':db[_0xa7eb7f[_0x0bae('0x23')]],'as':_0xa7eb7f['as'],'attributes':_0xa7eb7f['attributes'],'include':_0xa7eb7f[_0x0bae('0x22')]?_['map'](_0xa7eb7f[_0x0bae('0x22')],function(_0x343428){return{'model':db[_0x343428[_0x0bae('0x23')]],'as':_0x343428['as'],'attributes':_0x343428['attributes'],'include':_0x343428[_0x0bae('0x22')]?_[_0x0bae('0x21')](_0x343428[_0x0bae('0x22')],function(_0x27b958){return{'model':db[_0x27b958[_0x0bae('0x23')]],'as':_0x27b958['as'],'attributes':_0x27b958[_0x0bae('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0bae('0xf')](function(_0x4e93d8){logger[_0x0bae('0x10')](_0x0bae('0x24'),_0x54cca4);logger[_0x0bae('0x12')](_0x0bae('0x24'),_0x54cca4,JSON[_0x0bae('0x13')](_0x4e93d8));_0x29e786(_0x4e93d8);})[_0x0bae('0x19')](function(_0xa9f7bf){logger['error'](_0x0bae('0x24'),_0xa9f7bf['message'],_0x54cca4);_0x4ded80(_0x19a891[_0x0bae('0x15')](0x1f4,_0xa9f7bf[_0x0bae('0x16')]));});});}; \ No newline at end of file +var _0xb97c=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','VoiceQueue','findAll','raw','options','attributes','limit','include','map','model','then','ShowVoiceQueue','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb97c,0x141));var _0xcb97=function(_0x53631d,_0x96e52b){_0x53631d=_0x53631d-0x0;var _0x3d7c14=_0xb97c[_0x53631d];return _0x3d7c14;};'use strict';var _=require(_0xcb97('0x0'));var util=require('util');var moment=require(_0xcb97('0x1'));var BPromise=require('bluebird');var rs=require(_0xcb97('0x2'));var fs=require('fs');var Redis=require(_0xcb97('0x3'));var db=require(_0xcb97('0x4'))['db'];var utils=require(_0xcb97('0x5'));var logger=require(_0xcb97('0x6'))(_0xcb97('0x7'));var config=require(_0xcb97('0x8'));var jayson=require(_0xcb97('0x9'));var client=jayson[_0xcb97('0xa')]['http']({'port':0x232a});config[_0xcb97('0xb')]=_[_0xcb97('0xc')](config['redis'],{'host':_0xcb97('0xd'),'port':0x18eb});var socket=require(_0xcb97('0xe'))(new Redis(config[_0xcb97('0xb')]));require('./voiceQueue.socket')[_0xcb97('0xf')](socket);function respondWithRpcPromise(_0x5cc1fa,_0x47ff08,_0x2a3250){return new BPromise(function(_0x56b099,_0x5b101d){return client[_0xcb97('0x10')](_0x5cc1fa,_0x2a3250)['then'](function(_0x526ead){logger['info'](_0xcb97('0x11'),_0x47ff08,_0xcb97('0x12'));logger[_0xcb97('0x13')](_0xcb97('0x14'),_0x47ff08,_0xcb97('0x12'),JSON[_0xcb97('0x15')](_0x526ead));if(_0x526ead[_0xcb97('0x16')]){if(_0x526ead[_0xcb97('0x16')][_0xcb97('0x17')]===0x1f4){logger[_0xcb97('0x16')](_0xcb97('0x11'),_0x47ff08,_0x526ead[_0xcb97('0x16')]['message']);return _0x5b101d(_0x526ead[_0xcb97('0x16')]['message']);}logger[_0xcb97('0x16')](_0xcb97('0x11'),_0x47ff08,_0x526ead[_0xcb97('0x16')][_0xcb97('0x18')]);return _0x56b099(_0x526ead[_0xcb97('0x16')]['message']);}else{logger[_0xcb97('0x19')](_0xcb97('0x11'),_0x47ff08,_0xcb97('0x12'));_0x56b099(_0x526ead[_0xcb97('0x1a')][_0xcb97('0x18')]);}})[_0xcb97('0x1b')](function(_0x452df2){logger[_0xcb97('0x16')](_0xcb97('0x11'),_0x47ff08,_0x452df2);_0x5b101d(_0x452df2);});});}exports[_0xcb97('0x1c')]=function(_0x596fbb){var _0x2124f5=this;return new Promise(function(_0x39e8a8,_0x5d611d){return db[_0xcb97('0x1d')][_0xcb97('0x1e')]({'raw':_0x596fbb['options']?_0x596fbb['options'][_0xcb97('0x1f')]===undefined?!![]:![]:!![],'where':_0x596fbb[_0xcb97('0x20')]?_0x596fbb[_0xcb97('0x20')]['where']||null:null,'attributes':_0x596fbb[_0xcb97('0x20')]?_0x596fbb['options'][_0xcb97('0x21')]||null:null,'limit':_0x596fbb[_0xcb97('0x20')]?_0x596fbb[_0xcb97('0x20')][_0xcb97('0x22')]||null:null,'include':_0x596fbb[_0xcb97('0x20')]?_0x596fbb[_0xcb97('0x20')][_0xcb97('0x23')]?_['map'](_0x596fbb[_0xcb97('0x20')][_0xcb97('0x23')],function(_0x11056e){return{'model':db[_0x11056e['model']],'as':_0x11056e['as'],'attributes':_0x11056e['attributes'],'include':_0x11056e[_0xcb97('0x23')]?_[_0xcb97('0x24')](_0x11056e[_0xcb97('0x23')],function(_0x9b9501){return{'model':db[_0x9b9501[_0xcb97('0x25')]],'as':_0x9b9501['as'],'attributes':_0x9b9501['attributes'],'include':_0x9b9501[_0xcb97('0x23')]?_[_0xcb97('0x24')](_0x9b9501[_0xcb97('0x23')],function(_0x13d6d8){return{'model':db[_0x13d6d8['model']],'as':_0x13d6d8['as'],'attributes':_0x13d6d8['attributes']};}):[]};}):[]};}):[]:[]})[_0xcb97('0x26')](function(_0x2b1a77){logger['info'](_0xcb97('0x1c'),_0x596fbb);logger[_0xcb97('0x13')]('GetVoiceQueue',_0x596fbb,JSON[_0xcb97('0x15')](_0x2b1a77));_0x39e8a8(_0x2b1a77);})[_0xcb97('0x1b')](function(_0x527aec){logger['error'](_0xcb97('0x1c'),_0x527aec[_0xcb97('0x18')],_0x596fbb);_0x5d611d(_0x2124f5[_0xcb97('0x16')](0x1f4,_0x527aec['message']));});});};exports[_0xcb97('0x27')]=function(_0x3ccaad){var _0x2fa851=this;return new Promise(function(_0x52ca9a,_0x3b10ce){return db[_0xcb97('0x1d')]['find']({'raw':_0x3ccaad[_0xcb97('0x20')]?_0x3ccaad['options'][_0xcb97('0x1f')]===undefined?!![]:![]:!![],'where':_0x3ccaad[_0xcb97('0x20')]?_0x3ccaad[_0xcb97('0x20')][_0xcb97('0x28')]||null:null,'attributes':_0x3ccaad[_0xcb97('0x20')]?_0x3ccaad['options'][_0xcb97('0x21')]||null:null,'include':_0x3ccaad[_0xcb97('0x20')]?_0x3ccaad[_0xcb97('0x20')]['include']?_['map'](_0x3ccaad['options'][_0xcb97('0x23')],function(_0x1822e7){return{'model':db[_0x1822e7[_0xcb97('0x25')]],'as':_0x1822e7['as'],'attributes':_0x1822e7[_0xcb97('0x21')],'include':_0x1822e7[_0xcb97('0x23')]?_[_0xcb97('0x24')](_0x1822e7['include'],function(_0xa0dd02){return{'model':db[_0xa0dd02[_0xcb97('0x25')]],'as':_0xa0dd02['as'],'attributes':_0xa0dd02[_0xcb97('0x21')],'include':_0xa0dd02['include']?_['map'](_0xa0dd02[_0xcb97('0x23')],function(_0x9325bf){return{'model':db[_0x9325bf[_0xcb97('0x25')]],'as':_0x9325bf['as'],'attributes':_0x9325bf[_0xcb97('0x21')]};}):[]};}):[]};}):[]:[]})[_0xcb97('0x26')](function(_0x363620){logger[_0xcb97('0x19')](_0xcb97('0x27'),_0x3ccaad);logger['debug'](_0xcb97('0x27'),_0x3ccaad,JSON[_0xcb97('0x15')](_0x363620));_0x52ca9a(_0x363620);})[_0xcb97('0x1b')](function(_0x1f9250){logger[_0xcb97('0x16')](_0xcb97('0x27'),_0x1f9250['message'],_0x3ccaad);_0x3b10ce(_0x2fa851['error'](0x1f4,_0x1f9250[_0xcb97('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 63684c2..33f5efa 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 _0xc44a=['emit','removeListener','remove','update'];(function(_0x57d736,_0x3b7d56){var _0x36f735=function(_0x1dba63){while(--_0x1dba63){_0x57d736['push'](_0x57d736['shift']());}};_0x36f735(++_0x3b7d56);}(_0xc44a,0xbe));var _0xac44=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0xc44a[_0xb1cf84];return _0x4bad2e;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save',_0xac44('0x0'),_0xac44('0x1')];function createListener(_0x3aad43,_0x3b2090){return function(_0x5d8790){_0x3b2090[_0xac44('0x2')](_0x3aad43,_0x5d8790);};}function removeListener(_0x50f13d,_0x2d821d){return function(){VoiceQueueEvents[_0xac44('0x3')](_0x50f13d,_0x2d821d);};}exports['register']=function(_0x42cbfe){for(var _0x1026cf=0x0,_0x5294c7=events['length'];_0x1026cf<_0x5294c7;_0x1026cf++){var _0x2ed24e=events[_0x1026cf];var _0x453fb6=createListener('voiceQueue:'+_0x2ed24e,_0x42cbfe);VoiceQueueEvents['on'](_0x2ed24e,_0x453fb6);}}; \ No newline at end of file +var _0x650e=['removeListener','length','./voiceQueue.events','save','update','emit'];(function(_0xcc760c,_0x9e28aa){var _0x10a897=function(_0x1f3eb4){while(--_0x1f3eb4){_0xcc760c['push'](_0xcc760c['shift']());}};_0x10a897(++_0x9e28aa);}(_0x650e,0x12e));var _0xe650=function(_0x67f4af,_0x22ec05){_0x67f4af=_0x67f4af-0x0;var _0x360e3a=_0x650e[_0x67f4af];return _0x360e3a;};'use strict';var VoiceQueueEvents=require(_0xe650('0x0'));var events=[_0xe650('0x1'),'remove',_0xe650('0x2')];function createListener(_0x13a475,_0x445312){return function(_0xe67d50){_0x445312[_0xe650('0x3')](_0x13a475,_0xe67d50);};}function removeListener(_0x43508b,_0x591479){return function(){VoiceQueueEvents[_0xe650('0x4')](_0x43508b,_0x591479);};}exports['register']=function(_0x826ea6){for(var _0x319db3=0x0,_0x578d07=events[_0xe650('0x5')];_0x319db3<_0x578d07;_0x319db3++){var _0x3a7966=events[_0x319db3];var _0x1a5991=createListener('voiceQueue:'+_0x3a7966,_0x826ea6);VoiceQueueEvents['on'](_0x3a7966,_0x1a5991);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 179ef10..f10d7c8 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 _0x6ad1=['isAuthenticated','index','/describe','/index','getVoiceQueuesReport','show','post','create','/:id','destroy','exports','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get'];(function(_0x5a1617,_0x5599b6){var _0x529880=function(_0x5bde6b){while(--_0x5bde6b){_0x5a1617['push'](_0x5a1617['shift']());}};_0x529880(++_0x5599b6);}(_0x6ad1,0x13d));var _0x16ad=function(_0x2ae094,_0x22204d){_0x2ae094=_0x2ae094-0x0;var _0x3ac26d=_0x6ad1[_0x2ae094];return _0x3ac26d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x16ad('0x0'));var express=require('express');var router=express[_0x16ad('0x1')]();var fs_extra=require(_0x16ad('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x16ad('0x3'));var config=require(_0x16ad('0x4'));var controller=require(_0x16ad('0x5'));router[_0x16ad('0x6')]('/',auth[_0x16ad('0x7')](),controller[_0x16ad('0x8')]);router[_0x16ad('0x6')](_0x16ad('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x16ad('0x6')](_0x16ad('0xa'),auth[_0x16ad('0x7')](),controller[_0x16ad('0xb')]);router[_0x16ad('0x6')]('/:id',auth[_0x16ad('0x7')](),controller[_0x16ad('0xc')]);router[_0x16ad('0xd')]('/',auth[_0x16ad('0x7')](),controller[_0x16ad('0xe')]);router['put'](_0x16ad('0xf'),auth[_0x16ad('0x7')](),controller['update']);router['delete']('/:id',auth[_0x16ad('0x7')](),controller[_0x16ad('0x10')]);module[_0x16ad('0x11')]=router; \ No newline at end of file +var _0x6bc8=['./voiceQueueReport.controller','get','isAuthenticated','describe','/index','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3a0ebd,_0x47f368){var _0x51a660=function(_0x4023e6){while(--_0x4023e6){_0x3a0ebd['push'](_0x3a0ebd['shift']());}};_0x51a660(++_0x47f368);}(_0x6bc8,0x7a));var _0x86bc=function(_0x57dc60,_0x498218){_0x57dc60=_0x57dc60-0x0;var _0x15e325=_0x6bc8[_0x57dc60];return _0x15e325;};'use strict';var multer=require(_0x86bc('0x0'));var util=require(_0x86bc('0x1'));var path=require(_0x86bc('0x2'));var timeout=require(_0x86bc('0x3'));var express=require(_0x86bc('0x4'));var router=express[_0x86bc('0x5')]();var fs_extra=require(_0x86bc('0x6'));var auth=require(_0x86bc('0x7'));var interaction=require(_0x86bc('0x8'));var config=require(_0x86bc('0x9'));var controller=require(_0x86bc('0xa'));router[_0x86bc('0xb')]('/',auth[_0x86bc('0xc')](),controller['index']);router[_0x86bc('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x86bc('0xd')]);router[_0x86bc('0xb')](_0x86bc('0xe'),auth[_0x86bc('0xc')](),controller['getVoiceQueuesReport']);router[_0x86bc('0xb')](_0x86bc('0xf'),auth[_0x86bc('0xc')](),controller[_0x86bc('0x10')]);router[_0x86bc('0x11')]('/',auth[_0x86bc('0xc')](),controller[_0x86bc('0x12')]);router[_0x86bc('0x13')](_0x86bc('0xf'),auth[_0x86bc('0xc')](),controller['update']);router['delete'](_0x86bc('0xf'),auth[_0x86bc('0xc')](),controller[_0x86bc('0x14')]);module[_0x86bc('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 05bf1a3..bab0a92 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 _0x8a6e=['setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt'];(function(_0x26a113,_0x2288ce){var _0x2121c2=function(_0x23a2d0){while(--_0x23a2d0){_0x26a113['push'](_0x26a113['shift']());}};_0x2121c2(++_0x2288ce);}(_0x8a6e,0x95));var _0xe8a6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x8a6e[_0x36eaaa];return _0x461349;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe8a6('0x0'));module[_0xe8a6('0x1')]={'type':{'type':Sequelize[_0xe8a6('0x2')]},'uniqueid':{'type':Sequelize[_0xe8a6('0x2')]},'calleridnum':{'type':Sequelize[_0xe8a6('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xe8a6('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xe8a6('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x11853f){var _0x186799=moment(_0x11853f);var _0x5cdaf1=moment(this[_0xe8a6('0x4')](_0xe8a6('0x5')))[_0xe8a6('0x6')](_0xe8a6('0x7'));var _0x245f14=_0x186799[_0xe8a6('0x8')](_0x5cdaf1,_0xe8a6('0x9'));this['setDataValue'](_0xe8a6('0xa'),_0x11853f);this[_0xe8a6('0xb')](_0xe8a6('0xc'),_0x245f14||null);}},'position':{'type':Sequelize[_0xe8a6('0xd')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xe8a6('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xe8a6('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xe8a6('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xe8a6('0x2')],'comment':_0xe8a6('0xf')},'originalposition':{'type':Sequelize[_0xe8a6('0xd')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xe8a6('0x2')]},'connectedlinename':{'type':Sequelize[_0xe8a6('0x2')]},'accountcode':{'type':Sequelize[_0xe8a6('0x2')]},'context':{'type':Sequelize[_0xe8a6('0x2')]},'exten':{'type':Sequelize[_0xe8a6('0x2')]},'priority':{'type':Sequelize[_0xe8a6('0x2')]},'holdtime':{'type':Sequelize[_0xe8a6('0xd')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe8a6('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xe8a6('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xe8a6('0x2')]},'transferuniqueid':{'type':Sequelize[_0xe8a6('0x2')]},'disposition':{'type':Sequelize[_0xe8a6('0x2')]},'secondDisposition':{'type':Sequelize[_0xe8a6('0x2')]},'thirdDisposition':{'type':Sequelize[_0xe8a6('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xe8a6('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0xe8a6('0x2')]}}; \ No newline at end of file +var _0x3784=['seconds','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x2d0bea,_0x58eaed){var _0x5a18be=function(_0x2a9493){while(--_0x2a9493){_0x2d0bea['push'](_0x2d0bea['shift']());}};_0x5a18be(++_0x58eaed);}(_0x3784,0xba));var _0x4378=function(_0x5babe6,_0x3b7b70){_0x5babe6=_0x5babe6-0x0;var _0x40f6af=_0x3784[_0x5babe6];return _0x40f6af;};'use strict';var Sequelize=require(_0x4378('0x0'));var moment=require('moment');module[_0x4378('0x1')]={'type':{'type':Sequelize[_0x4378('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4378('0x2')]},'calleridname':{'type':Sequelize[_0x4378('0x2')]},'queue':{'type':Sequelize[_0x4378('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x4378('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x4378('0x3')],'set':function(_0x4070c1){var _0x56eb56=moment(_0x4070c1);var _0x56072e=moment(this['getDataValue']('queuecallerjoinAt'))['format'](_0x4378('0x4'));var _0x202064=_0x56eb56[_0x4378('0x5')](_0x56072e,_0x4378('0x6'));this[_0x4378('0x7')]('queuecallerleaveAt',_0x4070c1);this['setDataValue'](_0x4378('0x8'),_0x202064||null);}},'position':{'type':Sequelize[_0x4378('0x9')]},'count':{'type':Sequelize[_0x4378('0x9')]},'queuecallerabandon':{'type':Sequelize[_0x4378('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x4378('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x4378('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x4378('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x4378('0x9')]},'channel':{'type':Sequelize[_0x4378('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4378('0x2')]},'connectedlinename':{'type':Sequelize[_0x4378('0x2')]},'accountcode':{'type':Sequelize[_0x4378('0x2')]},'context':{'type':Sequelize[_0x4378('0x2')]},'exten':{'type':Sequelize[_0x4378('0x2')]},'priority':{'type':Sequelize[_0x4378('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x4378('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x4378('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x4378('0x2')]},'transfer':{'type':Sequelize[_0x4378('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4378('0x2')],'comment':_0x4378('0xb')},'transferexten':{'type':Sequelize[_0x4378('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x4378('0x2')]},'secondDisposition':{'type':Sequelize[_0x4378('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x4378('0x9')],'defaultValue':0x0},'note':{'type':Sequelize[_0x4378('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 2bf9b57..c6c92a6 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 _0xcce0=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','end','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','then','rows','catch','show','params','include','find','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1e5bac,_0x2c5987){var _0x341bef=function(_0x3b08ef){while(--_0x3b08ef){_0x1e5bac['push'](_0x1e5bac['shift']());}};_0x341bef(++_0x2c5987);}(_0xcce0,0x132));var _0x0cce=function(_0x3d9703,_0x5348ad){_0x3d9703=_0x3d9703-0x0;var _0x3512e9=_0xcce0[_0x3d9703];return _0x3512e9;};'use strict';var emlformat=require(_0x0cce('0x0'));var rimraf=require(_0x0cce('0x1'));var zipdir=require(_0x0cce('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0cce('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0cce('0x4'));var util=require(_0x0cce('0x5'));var path=require(_0x0cce('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0cce('0x7'));var fs=require('fs');var fs_extra=require(_0x0cce('0x8'));var _=require(_0x0cce('0x9'));var squel=require('squel');var crypto=require(_0x0cce('0xa'));var jsforce=require(_0x0cce('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0cce('0xc'));var querystring=require('querystring');var Papa=require(_0x0cce('0xd'));var Redis=require(_0x0cce('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0cce('0xf'));var as=require(_0x0cce('0x10'));var hardwareService=require(_0x0cce('0x11'));var logger=require(_0x0cce('0x12'))('api');var utils=require(_0x0cce('0x13'));var config=require(_0x0cce('0x14'));var licenseUtil=require(_0x0cce('0x15'));var db=require(_0x0cce('0x16'))['db'];config[_0x0cce('0x17')]=_[_0x0cce('0x18')](config[_0x0cce('0x17')],{'host':_0x0cce('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0cce('0x17')]));require(_0x0cce('0x1a'))[_0x0cce('0x1b')](socket);function respondWithStatusCode(_0x337f3f,_0x4c9d47){_0x4c9d47=_0x4c9d47||0xcc;return function(_0x4b224c){if(_0x4b224c){return _0x337f3f[_0x0cce('0x1c')](_0x4c9d47);}return _0x337f3f[_0x0cce('0x1d')](_0x4c9d47)['end']();};}function respondWithResult(_0x3ee14f,_0x1f28cd){_0x1f28cd=_0x1f28cd||0xc8;return function(_0x2cf685){if(_0x2cf685){return _0x3ee14f[_0x0cce('0x1d')](_0x1f28cd)[_0x0cce('0x1e')](_0x2cf685);}};}function respondWithFilteredResult(_0x57ad37,_0x133b2c){return function(_0x28792b){if(_0x28792b){var _0x3526bf=typeof _0x133b2c[_0x0cce('0x1f')]===_0x0cce('0x20')&&typeof _0x133b2c[_0x0cce('0x21')]===_0x0cce('0x20');var _0x343dc3=_0x28792b[_0x0cce('0x22')];var _0x26b0d7=_0x3526bf?0x0:_0x133b2c['offset'];var _0xed19c0=_0x3526bf?_0x28792b[_0x0cce('0x22')]:_0x133b2c[_0x0cce('0x1f')]+_0x133b2c[_0x0cce('0x21')];var _0x33deb7;if(_0xed19c0>=_0x343dc3){_0xed19c0=_0x343dc3;_0x33deb7=0xc8;}else{_0x33deb7=0xce;}_0x57ad37[_0x0cce('0x1d')](_0x33deb7);return _0x57ad37[_0x0cce('0x23')](_0x0cce('0x24'),_0x26b0d7+'-'+_0xed19c0+'/'+_0x343dc3)[_0x0cce('0x1e')](_0x28792b);}return null;};}function patchUpdates(_0x3749da){return function(_0x33e911){try{jsonpatch[_0x0cce('0x25')](_0x33e911,_0x3749da,!![]);}catch(_0x1d2c0b){return BPromise[_0x0cce('0x26')](_0x1d2c0b);}return _0x33e911[_0x0cce('0x27')]();};}function saveUpdates(_0x1151f4,_0xe4a3fd){return function(_0x18b8fc){if(_0x18b8fc){return _0x18b8fc[_0x0cce('0x28')](_0x1151f4)['then'](function(_0x48413d){return _0x48413d;});}return null;};}function removeEntity(_0x5326fe,_0x14b618){return function(_0xe8ab9a){if(_0xe8ab9a){return _0xe8ab9a['destroy']()['then'](function(){_0x5326fe[_0x0cce('0x1d')](0xcc)[_0x0cce('0x29')]();});}};}function handleEntityNotFound(_0x10ba0f,_0x3af199){return function(_0x4ae9f4){if(!_0x4ae9f4){_0x10ba0f['sendStatus'](0x194);}return _0x4ae9f4;};}function handleError(_0x2bf6f0,_0x40c389){_0x40c389=_0x40c389||0x1f4;return function(_0x262076){logger['error'](_0x262076['stack']);if(_0x262076[_0x0cce('0x2a')]){delete _0x262076[_0x0cce('0x2a')];}_0x2bf6f0[_0x0cce('0x1d')](_0x40c389)[_0x0cce('0x2b')](_0x262076);};}exports[_0x0cce('0x2c')]=function(_0x38536c,_0x5655fc){var _0x312b99={},_0x3aef09={},_0x45d653={'count':0x0,'rows':[]};var _0x5a7519=_[_0x0cce('0x2d')](db[_0x0cce('0x2e')][_0x0cce('0x2f')],function(_0x497df5){return{'name':_0x497df5['fieldName'],'type':_0x497df5[_0x0cce('0x30')][_0x0cce('0x31')]};});_0x3aef09['model']=_[_0x0cce('0x2d')](_0x5a7519,_0x0cce('0x2a'));_0x3aef09[_0x0cce('0x32')]=_[_0x0cce('0x33')](_0x38536c['query']);_0x3aef09[_0x0cce('0x34')]=_['intersection'](_0x3aef09[_0x0cce('0x35')],_0x3aef09[_0x0cce('0x32')]);_0x312b99[_0x0cce('0x36')]=_[_0x0cce('0x37')](_0x3aef09[_0x0cce('0x35')],qs[_0x0cce('0x38')](_0x38536c['query'][_0x0cce('0x38')]));_0x312b99['attributes']=_0x312b99[_0x0cce('0x36')][_0x0cce('0x39')]?_0x312b99[_0x0cce('0x36')]:_0x3aef09[_0x0cce('0x35')];if(!_0x38536c[_0x0cce('0x32')][_0x0cce('0x3a')](_0x0cce('0x3b'))){_0x312b99[_0x0cce('0x21')]=qs['limit'](_0x38536c['query'][_0x0cce('0x21')]);_0x312b99[_0x0cce('0x1f')]=qs[_0x0cce('0x1f')](_0x38536c[_0x0cce('0x32')][_0x0cce('0x1f')]);}_0x312b99[_0x0cce('0x3c')]=qs[_0x0cce('0x3d')](_0x38536c[_0x0cce('0x32')][_0x0cce('0x3d')]);_0x312b99['where']=qs[_0x0cce('0x34')](_[_0x0cce('0x3e')](_0x38536c[_0x0cce('0x32')],_0x3aef09[_0x0cce('0x34')]),_0x5a7519);if(_0x38536c[_0x0cce('0x32')]['filter']){_0x312b99[_0x0cce('0x3f')]=_[_0x0cce('0x40')](_0x312b99['where'],{'$or':_[_0x0cce('0x2d')](_0x5a7519,function(_0xd8761a){if(_0xd8761a['type']!==_0x0cce('0x41')){var _0x3308df={};_0x3308df[_0xd8761a[_0x0cce('0x2a')]]={'$like':'%'+_0x38536c['query'][_0x0cce('0x42')]+'%'};return _0x3308df;}})});}_0x312b99=_[_0x0cce('0x40')]({},_0x312b99,_0x38536c[_0x0cce('0x43')]);var _0x1b9652={'where':_0x312b99[_0x0cce('0x3f')]};return db[_0x0cce('0x2e')][_0x0cce('0x22')](_0x1b9652)['then'](function(_0x4192f3){_0x45d653[_0x0cce('0x22')]=_0x4192f3;if(_0x38536c[_0x0cce('0x32')][_0x0cce('0x44')]){_0x312b99['include']=[{'all':!![]}];}return db[_0x0cce('0x2e')][_0x0cce('0x45')](_0x312b99);})[_0x0cce('0x46')](function(_0x2d3846){_0x45d653[_0x0cce('0x47')]=_0x2d3846;return _0x45d653;})[_0x0cce('0x46')](respondWithFilteredResult(_0x5655fc,_0x312b99))[_0x0cce('0x48')](handleError(_0x5655fc,null));};exports[_0x0cce('0x49')]=function(_0x2d6cde,_0x190421){var _0xeba29d={'raw':![],'where':{'id':_0x2d6cde[_0x0cce('0x4a')]['id']}},_0x4d4c0a={};_0x4d4c0a[_0x0cce('0x35')]=_[_0x0cce('0x33')](db[_0x0cce('0x2e')][_0x0cce('0x2f')]);_0x4d4c0a[_0x0cce('0x32')]=_[_0x0cce('0x33')](_0x2d6cde[_0x0cce('0x32')]);_0x4d4c0a[_0x0cce('0x34')]=_[_0x0cce('0x37')](_0x4d4c0a['model'],_0x4d4c0a['query']);_0xeba29d[_0x0cce('0x36')]=_[_0x0cce('0x37')](_0x4d4c0a[_0x0cce('0x35')],qs[_0x0cce('0x38')](_0x2d6cde[_0x0cce('0x32')]['fields']));_0xeba29d['attributes']=_0xeba29d[_0x0cce('0x36')][_0x0cce('0x39')]?_0xeba29d[_0x0cce('0x36')]:_0x4d4c0a[_0x0cce('0x35')];if(_0x2d6cde[_0x0cce('0x32')][_0x0cce('0x44')]){_0xeba29d[_0x0cce('0x4b')]=[{'all':!![]}];}_0xeba29d=_['merge']({},_0xeba29d,_0x2d6cde['options']);return db[_0x0cce('0x2e')][_0x0cce('0x4c')](_0xeba29d)['then'](handleEntityNotFound(_0x190421,null))[_0x0cce('0x46')](respondWithResult(_0x190421,null))['catch'](handleError(_0x190421,null));};exports['create']=function(_0x2e4f71,_0xcfbd98){return db['VoiceQueueReport'][_0x0cce('0x4d')](_0x2e4f71['body'],{})[_0x0cce('0x46')](respondWithResult(_0xcfbd98,0xc9))['catch'](handleError(_0xcfbd98,null));};exports[_0x0cce('0x28')]=function(_0x79c5ae,_0x20cdf0){if(_0x79c5ae[_0x0cce('0x4e')]['id']){delete _0x79c5ae[_0x0cce('0x4e')]['id'];}return db['VoiceQueueReport'][_0x0cce('0x4c')]({'where':{'id':_0x79c5ae[_0x0cce('0x4a')]['id']}})[_0x0cce('0x46')](handleEntityNotFound(_0x20cdf0,null))[_0x0cce('0x46')](saveUpdates(_0x79c5ae[_0x0cce('0x4e')],null))[_0x0cce('0x46')](respondWithResult(_0x20cdf0,null))[_0x0cce('0x48')](handleError(_0x20cdf0,null));};exports['destroy']=function(_0x13a40c,_0x27d775){return db[_0x0cce('0x2e')][_0x0cce('0x4c')]({'where':{'id':_0x13a40c[_0x0cce('0x4a')]['id']}})[_0x0cce('0x46')](handleEntityNotFound(_0x27d775,null))['then'](removeEntity(_0x27d775,null))[_0x0cce('0x48')](handleError(_0x27d775,null));};exports[_0x0cce('0x4f')]=function(_0xafe219,_0x4c98f2){return db[_0x0cce('0x2e')]['describe']()[_0x0cce('0x46')](respondWithResult(_0x4c98f2,null))[_0x0cce('0x48')](handleError(_0x4c98f2,null));};exports['getVoiceQueuesReport']=function(_0x132c1e,_0x18bbe8){var _0x16fb84={},_0x2f7219={},_0x4ea483={'count':0x0,'rows':[]};_0x2f7219[_0x0cce('0x35')]=_[_0x0cce('0x33')](db[_0x0cce('0x2e')][_0x0cce('0x2f')]);_0x2f7219[_0x0cce('0x32')]=_[_0x0cce('0x33')](_0x132c1e[_0x0cce('0x32')]);_0x2f7219[_0x0cce('0x34')]=_[_0x0cce('0x37')](_0x2f7219['model'],_0x2f7219[_0x0cce('0x32')]);_0x16fb84['attributes']=_[_0x0cce('0x37')](_0x2f7219[_0x0cce('0x35')],qs[_0x0cce('0x38')](_0x132c1e[_0x0cce('0x32')][_0x0cce('0x38')]));_0x16fb84['attributes']=_0x16fb84[_0x0cce('0x36')][_0x0cce('0x39')]?_0x16fb84[_0x0cce('0x36')]:_0x2f7219['model'];if(!_0x132c1e['query'][_0x0cce('0x3a')](_0x0cce('0x3b'))){_0x16fb84[_0x0cce('0x21')]=qs['limit'](_0x132c1e[_0x0cce('0x32')][_0x0cce('0x21')]);_0x16fb84[_0x0cce('0x1f')]=qs[_0x0cce('0x1f')](_0x132c1e[_0x0cce('0x32')][_0x0cce('0x1f')]);}_0x16fb84[_0x0cce('0x3c')]=qs[_0x0cce('0x3d')](_0x132c1e['query'][_0x0cce('0x3d')]);_0x16fb84[_0x0cce('0x3f')]=qs[_0x0cce('0x34')](_[_0x0cce('0x3e')](_0x132c1e['query'],_0x2f7219[_0x0cce('0x34')]));if(_0x132c1e['query'][_0x0cce('0x42')]){_0x16fb84[_0x0cce('0x3f')]=_['merge'](_0x16fb84[_0x0cce('0x3f')],{'$or':_[_0x0cce('0x2d')](_0x16fb84['attributes'],function(_0x143ce0){var _0x5c29c3={};_0x5c29c3[_0x143ce0]={'$like':'%'+_0x132c1e[_0x0cce('0x32')][_0x0cce('0x42')]+'%'};return _0x5c29c3;})});}_0x16fb84=_[_0x0cce('0x40')]({},_0x16fb84,_0x132c1e[_0x0cce('0x43')]);var _0xe9d17a={'where':_0x16fb84[_0x0cce('0x3f')]};return db[_0x0cce('0x2e')][_0x0cce('0x22')](_0xe9d17a)[_0x0cce('0x46')](function(_0x1a6647){_0x4ea483[_0x0cce('0x22')]=_0x1a6647;if(_0x132c1e[_0x0cce('0x32')]['includeAll']){_0x16fb84['include']=[{'all':!![]}];}return db[_0x0cce('0x2e')][_0x0cce('0x45')](_0x16fb84);})[_0x0cce('0x46')](function(_0x353324){_0x4ea483[_0x0cce('0x47')]=_0x353324;return _0x4ea483;})['then'](respondWithFilteredResult(_0x18bbe8,_0x16fb84,_0x0cce('0x50')))['catch'](handleError(_0x18bbe8,null,_0x0cce('0x50')));}; \ No newline at end of file +var _0x054d=['name','index','map','fieldName','type','key','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','options','VoiceQueueReport','includeAll','include','findAll','rows','show','keys','rawAttributes','filters','find','create','catch','body','params','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./voiceQueueReport.socket','register','status','end','offset','undefined','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x054d,0x1aa));var _0xd054=function(_0x5c72e5,_0xfa04f8){_0x5c72e5=_0x5c72e5-0x0;var _0x4be004=_0x054d[_0x5c72e5];return _0x4be004;};'use strict';var emlformat=require(_0xd054('0x0'));var rimraf=require(_0xd054('0x1'));var zipdir=require(_0xd054('0x2'));var jsonpatch=require(_0xd054('0x3'));var rp=require('request-promise');var moment=require(_0xd054('0x4'));var BPromise=require(_0xd054('0x5'));var Mustache=require(_0xd054('0x6'));var util=require(_0xd054('0x7'));var path=require(_0xd054('0x8'));var sox=require('sox');var csv=require(_0xd054('0x9'));var ejs=require(_0xd054('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd054('0xb'));var crypto=require(_0xd054('0xc'));var jsforce=require(_0xd054('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd054('0x9'));var querystring=require(_0xd054('0xe'));var Papa=require(_0xd054('0xf'));var Redis=require('ioredis');var authService=require(_0xd054('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd054('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd054('0x12'));var licenseUtil=require(_0xd054('0x13'));var db=require(_0xd054('0x14'))['db'];config['redis']=_[_0xd054('0x15')](config[_0xd054('0x16')],{'host':_0xd054('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd054('0x16')]));require(_0xd054('0x18'))[_0xd054('0x19')](socket);function respondWithStatusCode(_0x1cb0ce,_0x3154ef){_0x3154ef=_0x3154ef||0xcc;return function(_0x496b60){if(_0x496b60){return _0x1cb0ce['sendStatus'](_0x3154ef);}return _0x1cb0ce[_0xd054('0x1a')](_0x3154ef)[_0xd054('0x1b')]();};}function respondWithResult(_0x292f81,_0x3759cf){_0x3759cf=_0x3759cf||0xc8;return function(_0x2a609f){if(_0x2a609f){return _0x292f81[_0xd054('0x1a')](_0x3759cf)['json'](_0x2a609f);}};}function respondWithFilteredResult(_0x460de9,_0x48f394){return function(_0x4d051f){if(_0x4d051f){var _0x5660db=typeof _0x48f394[_0xd054('0x1c')]===_0xd054('0x1d')&&typeof _0x48f394['limit']==='undefined';var _0x301e54=_0x4d051f[_0xd054('0x1e')];var _0x2a79b0=_0x5660db?0x0:_0x48f394['offset'];var _0x57f9af=_0x5660db?_0x4d051f['count']:_0x48f394['offset']+_0x48f394['limit'];var _0x5371b4;if(_0x57f9af>=_0x301e54){_0x57f9af=_0x301e54;_0x5371b4=0xc8;}else{_0x5371b4=0xce;}_0x460de9[_0xd054('0x1a')](_0x5371b4);return _0x460de9[_0xd054('0x1f')]('Content-Range',_0x2a79b0+'-'+_0x57f9af+'/'+_0x301e54)[_0xd054('0x20')](_0x4d051f);}return null;};}function patchUpdates(_0x32c6bd){return function(_0xb5bcda){try{jsonpatch[_0xd054('0x21')](_0xb5bcda,_0x32c6bd,!![]);}catch(_0x25799b){return BPromise[_0xd054('0x22')](_0x25799b);}return _0xb5bcda[_0xd054('0x23')]();};}function saveUpdates(_0x427536,_0x48764c){return function(_0x49f93d){if(_0x49f93d){return _0x49f93d[_0xd054('0x24')](_0x427536)[_0xd054('0x25')](function(_0x2e5bf3){return _0x2e5bf3;});}return null;};}function removeEntity(_0x5033f0,_0x2376e4){return function(_0x7f40b1){if(_0x7f40b1){return _0x7f40b1[_0xd054('0x26')]()[_0xd054('0x25')](function(){_0x5033f0['status'](0xcc)[_0xd054('0x1b')]();});}};}function handleEntityNotFound(_0x563236,_0x29f4f8){return function(_0x437726){if(!_0x437726){_0x563236[_0xd054('0x27')](0x194);}return _0x437726;};}function handleError(_0x419278,_0x59fc6e){_0x59fc6e=_0x59fc6e||0x1f4;return function(_0x36d875){logger[_0xd054('0x28')](_0x36d875[_0xd054('0x29')]);if(_0x36d875[_0xd054('0x2a')]){delete _0x36d875['name'];}_0x419278[_0xd054('0x1a')](_0x59fc6e)['send'](_0x36d875);};}exports[_0xd054('0x2b')]=function(_0x400c36,_0x5440a0){var _0x18ebd0={},_0x377684={},_0xdf039={'count':0x0,'rows':[]};var _0x304b7d=_[_0xd054('0x2c')](db['VoiceQueueReport']['rawAttributes'],function(_0x35b428){return{'name':_0x35b428[_0xd054('0x2d')],'type':_0x35b428[_0xd054('0x2e')][_0xd054('0x2f')]};});_0x377684['model']=_[_0xd054('0x2c')](_0x304b7d,'name');_0x377684['query']=_['keys'](_0x400c36[_0xd054('0x30')]);_0x377684['filters']=_[_0xd054('0x31')](_0x377684[_0xd054('0x32')],_0x377684[_0xd054('0x30')]);_0x18ebd0['attributes']=_[_0xd054('0x31')](_0x377684[_0xd054('0x32')],qs[_0xd054('0x33')](_0x400c36['query']['fields']));_0x18ebd0['attributes']=_0x18ebd0[_0xd054('0x34')]['length']?_0x18ebd0[_0xd054('0x34')]:_0x377684['model'];if(!_0x400c36[_0xd054('0x30')][_0xd054('0x35')](_0xd054('0x36'))){_0x18ebd0[_0xd054('0x37')]=qs[_0xd054('0x37')](_0x400c36[_0xd054('0x30')][_0xd054('0x37')]);_0x18ebd0[_0xd054('0x1c')]=qs[_0xd054('0x1c')](_0x400c36['query'][_0xd054('0x1c')]);}_0x18ebd0['order']=qs[_0xd054('0x38')](_0x400c36[_0xd054('0x30')][_0xd054('0x38')]);_0x18ebd0[_0xd054('0x39')]=qs['filters'](_[_0xd054('0x3a')](_0x400c36[_0xd054('0x30')],_0x377684['filters']),_0x304b7d);if(_0x400c36[_0xd054('0x30')]['filter']){_0x18ebd0[_0xd054('0x39')]=_[_0xd054('0x3b')](_0x18ebd0[_0xd054('0x39')],{'$or':_[_0xd054('0x2c')](_0x304b7d,function(_0x2597e1){if(_0x2597e1['type']!==_0xd054('0x3c')){var _0x298aee={};_0x298aee[_0x2597e1[_0xd054('0x2a')]]={'$like':'%'+_0x400c36[_0xd054('0x30')]['filter']+'%'};return _0x298aee;}})});}_0x18ebd0=_[_0xd054('0x3b')]({},_0x18ebd0,_0x400c36[_0xd054('0x3d')]);var _0x3170f3={'where':_0x18ebd0[_0xd054('0x39')]};return db[_0xd054('0x3e')]['count'](_0x3170f3)[_0xd054('0x25')](function(_0x3ecd0b){_0xdf039['count']=_0x3ecd0b;if(_0x400c36['query'][_0xd054('0x3f')]){_0x18ebd0[_0xd054('0x40')]=[{'all':!![]}];}return db[_0xd054('0x3e')][_0xd054('0x41')](_0x18ebd0);})['then'](function(_0x59ca43){_0xdf039[_0xd054('0x42')]=_0x59ca43;return _0xdf039;})['then'](respondWithFilteredResult(_0x5440a0,_0x18ebd0))['catch'](handleError(_0x5440a0,null));};exports[_0xd054('0x43')]=function(_0x47567f,_0x4c7c9d){var _0x1738d0={'raw':![],'where':{'id':_0x47567f['params']['id']}},_0x55048f={};_0x55048f[_0xd054('0x32')]=_[_0xd054('0x44')](db[_0xd054('0x3e')][_0xd054('0x45')]);_0x55048f['query']=_['keys'](_0x47567f['query']);_0x55048f[_0xd054('0x46')]=_[_0xd054('0x31')](_0x55048f['model'],_0x55048f['query']);_0x1738d0[_0xd054('0x34')]=_[_0xd054('0x31')](_0x55048f['model'],qs[_0xd054('0x33')](_0x47567f['query']['fields']));_0x1738d0['attributes']=_0x1738d0[_0xd054('0x34')]['length']?_0x1738d0[_0xd054('0x34')]:_0x55048f[_0xd054('0x32')];if(_0x47567f['query'][_0xd054('0x3f')]){_0x1738d0['include']=[{'all':!![]}];}_0x1738d0=_['merge']({},_0x1738d0,_0x47567f[_0xd054('0x3d')]);return db['VoiceQueueReport'][_0xd054('0x47')](_0x1738d0)[_0xd054('0x25')](handleEntityNotFound(_0x4c7c9d,null))[_0xd054('0x25')](respondWithResult(_0x4c7c9d,null))['catch'](handleError(_0x4c7c9d,null));};exports[_0xd054('0x48')]=function(_0x3d1b90,_0x1daa57){return db[_0xd054('0x3e')]['create'](_0x3d1b90['body'],{})[_0xd054('0x25')](respondWithResult(_0x1daa57,0xc9))[_0xd054('0x49')](handleError(_0x1daa57,null));};exports[_0xd054('0x24')]=function(_0x5242f3,_0x5e648d){if(_0x5242f3[_0xd054('0x4a')]['id']){delete _0x5242f3[_0xd054('0x4a')]['id'];}return db['VoiceQueueReport'][_0xd054('0x47')]({'where':{'id':_0x5242f3[_0xd054('0x4b')]['id']}})[_0xd054('0x25')](handleEntityNotFound(_0x5e648d,null))['then'](saveUpdates(_0x5242f3[_0xd054('0x4a')],null))[_0xd054('0x25')](respondWithResult(_0x5e648d,null))[_0xd054('0x49')](handleError(_0x5e648d,null));};exports['destroy']=function(_0x4a2f0c,_0x10a329){return db[_0xd054('0x3e')][_0xd054('0x47')]({'where':{'id':_0x4a2f0c[_0xd054('0x4b')]['id']}})[_0xd054('0x25')](handleEntityNotFound(_0x10a329,null))['then'](removeEntity(_0x10a329,null))['catch'](handleError(_0x10a329,null));};exports['describe']=function(_0x2c7cb2,_0x2232c9){return db[_0xd054('0x3e')][_0xd054('0x4c')]()[_0xd054('0x25')](respondWithResult(_0x2232c9,null))[_0xd054('0x49')](handleError(_0x2232c9,null));};exports['getVoiceQueuesReport']=function(_0x25c19a,_0x5679cc){var _0x23611e={},_0xe7b871={},_0x2f6964={'count':0x0,'rows':[]};_0xe7b871[_0xd054('0x32')]=_['keys'](db[_0xd054('0x3e')][_0xd054('0x45')]);_0xe7b871[_0xd054('0x30')]=_['keys'](_0x25c19a[_0xd054('0x30')]);_0xe7b871['filters']=_[_0xd054('0x31')](_0xe7b871[_0xd054('0x32')],_0xe7b871[_0xd054('0x30')]);_0x23611e[_0xd054('0x34')]=_[_0xd054('0x31')](_0xe7b871[_0xd054('0x32')],qs[_0xd054('0x33')](_0x25c19a[_0xd054('0x30')][_0xd054('0x33')]));_0x23611e[_0xd054('0x34')]=_0x23611e[_0xd054('0x34')]['length']?_0x23611e['attributes']:_0xe7b871['model'];if(!_0x25c19a[_0xd054('0x30')][_0xd054('0x35')](_0xd054('0x36'))){_0x23611e[_0xd054('0x37')]=qs[_0xd054('0x37')](_0x25c19a[_0xd054('0x30')]['limit']);_0x23611e[_0xd054('0x1c')]=qs[_0xd054('0x1c')](_0x25c19a[_0xd054('0x30')][_0xd054('0x1c')]);}_0x23611e['order']=qs[_0xd054('0x38')](_0x25c19a[_0xd054('0x30')]['sort']);_0x23611e[_0xd054('0x39')]=qs[_0xd054('0x46')](_[_0xd054('0x3a')](_0x25c19a[_0xd054('0x30')],_0xe7b871[_0xd054('0x46')]));if(_0x25c19a[_0xd054('0x30')]['filter']){_0x23611e[_0xd054('0x39')]=_[_0xd054('0x3b')](_0x23611e['where'],{'$or':_[_0xd054('0x2c')](_0x23611e[_0xd054('0x34')],function(_0x1845d9){var _0x5c07c6={};_0x5c07c6[_0x1845d9]={'$like':'%'+_0x25c19a[_0xd054('0x30')]['filter']+'%'};return _0x5c07c6;})});}_0x23611e=_[_0xd054('0x3b')]({},_0x23611e,_0x25c19a[_0xd054('0x3d')]);var _0x393e6e={'where':_0x23611e[_0xd054('0x39')]};return db[_0xd054('0x3e')][_0xd054('0x1e')](_0x393e6e)[_0xd054('0x25')](function(_0x501b1b){_0x2f6964[_0xd054('0x1e')]=_0x501b1b;if(_0x25c19a[_0xd054('0x30')]['includeAll']){_0x23611e[_0xd054('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xd054('0x41')](_0x23611e);})[_0xd054('0x25')](function(_0x465954){_0x2f6964[_0xd054('0x42')]=_0x465954;return _0x2f6964;})['then'](respondWithFilteredResult(_0x5679cc,_0x23611e,_0xd054('0x4d')))[_0xd054('0x49')](handleError(_0x5679cc,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index c4f2e75..9e1b623 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 _0xc14d=['hook','exports','VoiceQueueReport','setMaxListeners','save','update','remove'];(function(_0x34bc94,_0x74f0fd){var _0xee41e7=function(_0x424111){while(--_0x424111){_0x34bc94['push'](_0x34bc94['shift']());}};_0xee41e7(++_0x74f0fd);}(_0xc14d,0x11a));var _0xdc14=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc14d[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0xdc14('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xdc14('0x1')](0x0);var events={'afterCreate':_0xdc14('0x2'),'afterUpdate':_0xdc14('0x3'),'afterDestroy':_0xdc14('0x4')};function emitEvent(_0xfd90e1){return function(_0x2ab4e6,_0x1e40b3,_0x1cb2a8){VoiceQueueReportEvents['emit'](_0xfd90e1+':'+_0x2ab4e6['id'],_0x2ab4e6);VoiceQueueReportEvents['emit'](_0xfd90e1,_0x2ab4e6);_0x1cb2a8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xdc14('0x5')](e,emitEvent(event));}}module[_0xdc14('0x6')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x0686=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0686,0xad));var _0x6068=function(_0x925fd4,_0x1f4e93){_0x925fd4=_0x925fd4-0x0;var _0x1d0def=_0x0686[_0x925fd4];return _0x1d0def;};'use strict';var EventEmitter=require(_0x6068('0x0'));var VoiceQueueReport=require(_0x6068('0x1'))['db'][_0x6068('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x6068('0x3')](0x0);var events={'afterCreate':_0x6068('0x4'),'afterUpdate':_0x6068('0x5'),'afterDestroy':_0x6068('0x6')};function emitEvent(_0x438bb2){return function(_0x4c46b6,_0x880e70,_0x318cf2){VoiceQueueReportEvents[_0x6068('0x7')](_0x438bb2+':'+_0x4c46b6['id'],_0x4c46b6);VoiceQueueReportEvents[_0x6068('0x7')](_0x438bb2,_0x4c46b6);_0x318cf2(null);};}for(var e in events){if(events[_0x6068('0x8')](e)){var event=events[e];VoiceQueueReport[_0x6068('0x9')](e,emitEvent(event));}}module[_0x6068('0xa')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index fe7670a..48bf8c4 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 _0x5110=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','uniqueid','lodash','util'];(function(_0x416586,_0xbdf0b1){var _0x5cbb10=function(_0x274854){while(--_0x274854){_0x416586['push'](_0x416586['shift']());}};_0x5cbb10(++_0xbdf0b1);}(_0x5110,0x19e));var _0x0511=function(_0x33ee40,_0x27f558){_0x33ee40=_0x33ee40-0x0;var _0x5098b5=_0x5110[_0x33ee40];return _0x5098b5;};'use strict';var _=require(_0x0511('0x0'));var util=require(_0x0511('0x1'));var logger=require(_0x0511('0x2'))(_0x0511('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0511('0x4'));var fs=require('fs');var path=require(_0x0511('0x5'));var rimraf=require(_0x0511('0x6'));var config=require(_0x0511('0x7'));var attributes=require(_0x0511('0x8'));module[_0x0511('0x9')]=function(_0x4479a0,_0x3e3e5c){return _0x4479a0[_0x0511('0xa')](_0x0511('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x0511('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3442=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport','uniqueid','calleridnum'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x3442,0x118));var _0x2344=function(_0x1dbae1,_0xeb57ea){_0x1dbae1=_0x1dbae1-0x0;var _0x12b879=_0x3442[_0x1dbae1];return _0x12b879;};'use strict';var _=require(_0x2344('0x0'));var util=require(_0x2344('0x1'));var logger=require('../../config/logger')(_0x2344('0x2'));var moment=require(_0x2344('0x3'));var BPromise=require(_0x2344('0x4'));var rp=require(_0x2344('0x5'));var fs=require('fs');var path=require(_0x2344('0x6'));var rimraf=require(_0x2344('0x7'));var config=require(_0x2344('0x8'));var attributes=require(_0x2344('0x9'));module[_0x2344('0xa')]=function(_0x4f1b1d,_0x3dadde){return _0x4f1b1d['define'](_0x2344('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x2344('0xc')]},{'fields':[_0x2344('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 4d25d88..5775c38 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 _0xeb50=['request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetVoiceQueueReport','findAll','options','where','limit','include','map','model','attributes','CreateVoiceQueueReport','VoiceQueueReport','raw','UpdateVoiceQueueReport','body','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','redis','localhost','register','then','VoiceQueueReport,\x20%s,\x20%s'];(function(_0x4fbdfd,_0x333133){var _0x189e0b=function(_0x3e137e){while(--_0x3e137e){_0x4fbdfd['push'](_0x4fbdfd['shift']());}};_0x189e0b(++_0x333133);}(_0xeb50,0x164));var _0x0eb5=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0xeb50[_0x440917];return _0x5e906b;};'use strict';var _=require(_0x0eb5('0x0'));var util=require(_0x0eb5('0x1'));var moment=require(_0x0eb5('0x2'));var BPromise=require(_0x0eb5('0x3'));var rs=require(_0x0eb5('0x4'));var fs=require('fs');var Redis=require(_0x0eb5('0x5'));var db=require(_0x0eb5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0eb5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0eb5('0x8')]['http']({'port':0x232a});config[_0x0eb5('0x9')]=_['defaults'](config[_0x0eb5('0x9')],{'host':_0x0eb5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0eb5('0x9')]));require('./voiceQueueReport.socket')[_0x0eb5('0xb')](socket);function respondWithRpcPromise(_0x565eeb,_0x1461e4,_0x3cb674){return new BPromise(function(_0x42816d,_0x28edf5){return client['request'](_0x565eeb,_0x3cb674)[_0x0eb5('0xc')](function(_0x1433c5){logger['info'](_0x0eb5('0xd'),_0x1461e4,_0x0eb5('0xe'));logger[_0x0eb5('0xf')](_0x0eb5('0x10'),_0x1461e4,'request\x20sent',JSON[_0x0eb5('0x11')](_0x1433c5));if(_0x1433c5[_0x0eb5('0x12')]){if(_0x1433c5[_0x0eb5('0x12')]['code']===0x1f4){logger['error'](_0x0eb5('0xd'),_0x1461e4,_0x1433c5[_0x0eb5('0x12')][_0x0eb5('0x13')]);return _0x28edf5(_0x1433c5[_0x0eb5('0x12')][_0x0eb5('0x13')]);}logger[_0x0eb5('0x12')](_0x0eb5('0xd'),_0x1461e4,_0x1433c5[_0x0eb5('0x12')][_0x0eb5('0x13')]);return _0x42816d(_0x1433c5[_0x0eb5('0x12')][_0x0eb5('0x13')]);}else{logger[_0x0eb5('0x14')](_0x0eb5('0xd'),_0x1461e4,'request\x20sent');_0x42816d(_0x1433c5[_0x0eb5('0x15')][_0x0eb5('0x13')]);}})[_0x0eb5('0x16')](function(_0x464f62){logger[_0x0eb5('0x12')](_0x0eb5('0xd'),_0x1461e4,_0x464f62);_0x28edf5(_0x464f62);});});}exports[_0x0eb5('0x17')]=function(_0x52a398){var _0x5d4283=this;return new Promise(function(_0x29057c,_0x51d17c){return db['VoiceQueueReport'][_0x0eb5('0x18')]({'raw':_0x52a398[_0x0eb5('0x19')]?_0x52a398[_0x0eb5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x52a398[_0x0eb5('0x19')]?_0x52a398[_0x0eb5('0x19')][_0x0eb5('0x1a')]||null:null,'attributes':_0x52a398['options']?_0x52a398[_0x0eb5('0x19')]['attributes']||null:null,'limit':_0x52a398[_0x0eb5('0x19')]?_0x52a398['options'][_0x0eb5('0x1b')]||null:null,'include':_0x52a398[_0x0eb5('0x19')]?_0x52a398['options'][_0x0eb5('0x1c')]?_[_0x0eb5('0x1d')](_0x52a398[_0x0eb5('0x19')]['include'],function(_0x51a3be){return{'model':db[_0x51a3be[_0x0eb5('0x1e')]],'as':_0x51a3be['as'],'attributes':_0x51a3be['attributes'],'include':_0x51a3be[_0x0eb5('0x1c')]?_['map'](_0x51a3be[_0x0eb5('0x1c')],function(_0x2bcca1){return{'model':db[_0x2bcca1['model']],'as':_0x2bcca1['as'],'attributes':_0x2bcca1[_0x0eb5('0x1f')],'include':_0x2bcca1[_0x0eb5('0x1c')]?_[_0x0eb5('0x1d')](_0x2bcca1['include'],function(_0x5e24b8){return{'model':db[_0x5e24b8[_0x0eb5('0x1e')]],'as':_0x5e24b8['as'],'attributes':_0x5e24b8[_0x0eb5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0eb5('0xc')](function(_0x375f05){logger[_0x0eb5('0x14')](_0x0eb5('0x17'),_0x52a398);logger[_0x0eb5('0xf')](_0x0eb5('0x17'),_0x52a398,JSON[_0x0eb5('0x11')](_0x375f05));_0x29057c(_0x375f05);})[_0x0eb5('0x16')](function(_0xe95e71){logger[_0x0eb5('0x12')](_0x0eb5('0x17'),_0xe95e71[_0x0eb5('0x13')],_0x52a398);_0x51d17c(_0x5d4283['error'](0x1f4,_0xe95e71[_0x0eb5('0x13')]));});});};exports[_0x0eb5('0x20')]=function(_0xca94a0){var _0x1b2951=this;return new Promise(function(_0x57cdb7,_0x458164){return db[_0x0eb5('0x21')]['create'](_0xca94a0['body'],{'raw':_0xca94a0[_0x0eb5('0x19')]?_0xca94a0[_0x0eb5('0x19')][_0x0eb5('0x22')]===undefined?!![]:![]:!![]})[_0x0eb5('0xc')](function(_0xe7a2c1){logger[_0x0eb5('0x14')](_0x0eb5('0x20'),_0xca94a0);logger[_0x0eb5('0xf')](_0x0eb5('0x20'),_0xca94a0,JSON[_0x0eb5('0x11')](_0xe7a2c1));_0x57cdb7(_0xe7a2c1);})[_0x0eb5('0x16')](function(_0x274e12){logger[_0x0eb5('0x12')](_0x0eb5('0x20'),_0x274e12['message'],_0xca94a0);_0x458164(_0x1b2951[_0x0eb5('0x12')](0x1f4,_0x274e12[_0x0eb5('0x13')]));});});};exports[_0x0eb5('0x23')]=function(_0x606c40){var _0x34240a=this;return new Promise(function(_0x4a2315,_0x2b9efe){return db[_0x0eb5('0x21')]['update'](_0x606c40[_0x0eb5('0x24')],{'raw':_0x606c40[_0x0eb5('0x19')]?_0x606c40['options'][_0x0eb5('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x606c40['options']?_0x606c40['options'][_0x0eb5('0x1a')]||null:null,'attributes':_0x606c40[_0x0eb5('0x19')]?_0x606c40[_0x0eb5('0x19')][_0x0eb5('0x1f')]||null:null,'limit':_0x606c40[_0x0eb5('0x19')]?_0x606c40[_0x0eb5('0x19')][_0x0eb5('0x1b')]||null:null})[_0x0eb5('0xc')](function(_0x48a78d){logger[_0x0eb5('0x14')](_0x0eb5('0x23'),_0x606c40);logger[_0x0eb5('0xf')]('UpdateVoiceQueueReport',_0x606c40,JSON[_0x0eb5('0x11')](_0x48a78d));_0x4a2315(_0x48a78d);})[_0x0eb5('0x16')](function(_0x9bb8b0){logger[_0x0eb5('0x12')](_0x0eb5('0x23'),_0x9bb8b0[_0x0eb5('0x13')],_0x606c40);_0x2b9efe(_0x34240a['error'](0x1f4,_0x9bb8b0['message']));});});}; \ No newline at end of file +var _0xeb4a=['stringify','error','code','message','result','VoiceQueueReport','findAll','options','where','attributes','include','map','model','GetVoiceQueueReport','catch','CreateVoiceQueueReport','body','raw','UpdateVoiceQueueReport','update','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb4a,0x198));var _0xaeb4=function(_0x10e6e9,_0x127cff){_0x10e6e9=_0x10e6e9-0x0;var _0x478a54=_0xeb4a[_0x10e6e9];return _0x478a54;};'use strict';var _=require(_0xaeb4('0x0'));var util=require('util');var moment=require(_0xaeb4('0x1'));var BPromise=require(_0xaeb4('0x2'));var rs=require(_0xaeb4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaeb4('0x4'))['db'];var utils=require(_0xaeb4('0x5'));var logger=require(_0xaeb4('0x6'))(_0xaeb4('0x7'));var config=require(_0xaeb4('0x8'));var jayson=require(_0xaeb4('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xaeb4('0xa')]=_[_0xaeb4('0xb')](config['redis'],{'host':_0xaeb4('0xc'),'port':0x18eb});var socket=require(_0xaeb4('0xd'))(new Redis(config[_0xaeb4('0xa')]));require(_0xaeb4('0xe'))['register'](socket);function respondWithRpcPromise(_0x27aab3,_0x5438c3,_0x558fe0){return new BPromise(function(_0x3d7869,_0xbe8cad){return client[_0xaeb4('0xf')](_0x27aab3,_0x558fe0)[_0xaeb4('0x10')](function(_0x50e53d){logger[_0xaeb4('0x11')](_0xaeb4('0x12'),_0x5438c3,_0xaeb4('0x13'));logger[_0xaeb4('0x14')](_0xaeb4('0x15'),_0x5438c3,_0xaeb4('0x13'),JSON[_0xaeb4('0x16')](_0x50e53d));if(_0x50e53d[_0xaeb4('0x17')]){if(_0x50e53d[_0xaeb4('0x17')][_0xaeb4('0x18')]===0x1f4){logger['error'](_0xaeb4('0x12'),_0x5438c3,_0x50e53d[_0xaeb4('0x17')][_0xaeb4('0x19')]);return _0xbe8cad(_0x50e53d[_0xaeb4('0x17')]['message']);}logger['error'](_0xaeb4('0x12'),_0x5438c3,_0x50e53d[_0xaeb4('0x17')]['message']);return _0x3d7869(_0x50e53d[_0xaeb4('0x17')][_0xaeb4('0x19')]);}else{logger[_0xaeb4('0x11')](_0xaeb4('0x12'),_0x5438c3,_0xaeb4('0x13'));_0x3d7869(_0x50e53d[_0xaeb4('0x1a')][_0xaeb4('0x19')]);}})['catch'](function(_0x74af15){logger['error'](_0xaeb4('0x12'),_0x5438c3,_0x74af15);_0xbe8cad(_0x74af15);});});}exports['GetVoiceQueueReport']=function(_0x5bc89c){var _0x479ffa=this;return new Promise(function(_0x243359,_0x42dbe8){return db[_0xaeb4('0x1b')][_0xaeb4('0x1c')]({'raw':_0x5bc89c[_0xaeb4('0x1d')]?_0x5bc89c[_0xaeb4('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5bc89c[_0xaeb4('0x1d')]?_0x5bc89c[_0xaeb4('0x1d')][_0xaeb4('0x1e')]||null:null,'attributes':_0x5bc89c['options']?_0x5bc89c[_0xaeb4('0x1d')][_0xaeb4('0x1f')]||null:null,'limit':_0x5bc89c['options']?_0x5bc89c[_0xaeb4('0x1d')]['limit']||null:null,'include':_0x5bc89c[_0xaeb4('0x1d')]?_0x5bc89c['options'][_0xaeb4('0x20')]?_[_0xaeb4('0x21')](_0x5bc89c[_0xaeb4('0x1d')][_0xaeb4('0x20')],function(_0x1d6b77){return{'model':db[_0x1d6b77[_0xaeb4('0x22')]],'as':_0x1d6b77['as'],'attributes':_0x1d6b77[_0xaeb4('0x1f')],'include':_0x1d6b77[_0xaeb4('0x20')]?_['map'](_0x1d6b77[_0xaeb4('0x20')],function(_0x198a9b){return{'model':db[_0x198a9b[_0xaeb4('0x22')]],'as':_0x198a9b['as'],'attributes':_0x198a9b[_0xaeb4('0x1f')],'include':_0x198a9b[_0xaeb4('0x20')]?_['map'](_0x198a9b['include'],function(_0x2ec5a3){return{'model':db[_0x2ec5a3['model']],'as':_0x2ec5a3['as'],'attributes':_0x2ec5a3[_0xaeb4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaeb4('0x10')](function(_0x279379){logger['info'](_0xaeb4('0x23'),_0x5bc89c);logger[_0xaeb4('0x14')]('GetVoiceQueueReport',_0x5bc89c,JSON['stringify'](_0x279379));_0x243359(_0x279379);})[_0xaeb4('0x24')](function(_0x404135){logger[_0xaeb4('0x17')](_0xaeb4('0x23'),_0x404135[_0xaeb4('0x19')],_0x5bc89c);_0x42dbe8(_0x479ffa[_0xaeb4('0x17')](0x1f4,_0x404135['message']));});});};exports[_0xaeb4('0x25')]=function(_0x5a900f){var _0x2b9a72=this;return new Promise(function(_0x480476,_0x2a2387){return db[_0xaeb4('0x1b')]['create'](_0x5a900f[_0xaeb4('0x26')],{'raw':_0x5a900f[_0xaeb4('0x1d')]?_0x5a900f[_0xaeb4('0x1d')][_0xaeb4('0x27')]===undefined?!![]:![]:!![]})[_0xaeb4('0x10')](function(_0x2c556c){logger[_0xaeb4('0x11')](_0xaeb4('0x25'),_0x5a900f);logger[_0xaeb4('0x14')](_0xaeb4('0x25'),_0x5a900f,JSON['stringify'](_0x2c556c));_0x480476(_0x2c556c);})['catch'](function(_0x15123d){logger[_0xaeb4('0x17')]('CreateVoiceQueueReport',_0x15123d[_0xaeb4('0x19')],_0x5a900f);_0x2a2387(_0x2b9a72[_0xaeb4('0x17')](0x1f4,_0x15123d[_0xaeb4('0x19')]));});});};exports[_0xaeb4('0x28')]=function(_0x483131){var _0x512ea6=this;return new Promise(function(_0x52976d,_0x159c97){return db[_0xaeb4('0x1b')][_0xaeb4('0x29')](_0x483131[_0xaeb4('0x26')],{'raw':_0x483131[_0xaeb4('0x1d')]?_0x483131[_0xaeb4('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x483131['options']?_0x483131['options'][_0xaeb4('0x1e')]||null:null,'attributes':_0x483131[_0xaeb4('0x1d')]?_0x483131[_0xaeb4('0x1d')][_0xaeb4('0x1f')]||null:null,'limit':_0x483131['options']?_0x483131[_0xaeb4('0x1d')][_0xaeb4('0x2a')]||null:null})[_0xaeb4('0x10')](function(_0x254791){logger['info'](_0xaeb4('0x28'),_0x483131);logger[_0xaeb4('0x14')](_0xaeb4('0x28'),_0x483131,JSON[_0xaeb4('0x16')](_0x254791));_0x52976d(_0x254791);})[_0xaeb4('0x24')](function(_0x183221){logger[_0xaeb4('0x17')](_0xaeb4('0x28'),_0x183221[_0xaeb4('0x19')],_0x483131);_0x159c97(_0x512ea6[_0xaeb4('0x17')](0x1f4,_0x183221['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 54d3485..a443f90 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 _0x9fce=['./voiceQueueReport.events','save','remove','update','emit','removeListener','register','length','voiceQueueReport:'];(function(_0x3703a7,_0xb8f06e){var _0x129994=function(_0x1210a4){while(--_0x1210a4){_0x3703a7['push'](_0x3703a7['shift']());}};_0x129994(++_0xb8f06e);}(_0x9fce,0x99));var _0xe9fc=function(_0x55ef8b,_0x5deb5e){_0x55ef8b=_0x55ef8b-0x0;var _0x359c84=_0x9fce[_0x55ef8b];return _0x359c84;};'use strict';var VoiceQueueReportEvents=require(_0xe9fc('0x0'));var events=[_0xe9fc('0x1'),_0xe9fc('0x2'),_0xe9fc('0x3')];function createListener(_0xcd06ec,_0x1fd55f){return function(_0x419108){_0x1fd55f[_0xe9fc('0x4')](_0xcd06ec,_0x419108);};}function removeListener(_0x152208,_0xa6b640){return function(){VoiceQueueReportEvents[_0xe9fc('0x5')](_0x152208,_0xa6b640);};}exports[_0xe9fc('0x6')]=function(_0x3610d6){for(var _0x684c98=0x0,_0x5a4d6b=events[_0xe9fc('0x7')];_0x684c98<_0x5a4d6b;_0x684c98++){var _0x35aa38=events[_0x684c98];var _0x37be81=createListener(_0xe9fc('0x8')+_0x35aa38,_0x3610d6);VoiceQueueReportEvents['on'](_0x35aa38,_0x37be81);}}; \ No newline at end of file +var _0x44f6=['emit','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0x2b0395,_0x1bef0c){var _0x2633fb=function(_0x9e5819){while(--_0x9e5819){_0x2b0395['push'](_0x2b0395['shift']());}};_0x2633fb(++_0x1bef0c);}(_0x44f6,0xa4));var _0x644f=function(_0x4480b9,_0x5c2949){_0x4480b9=_0x4480b9-0x0;var _0x3f0f02=_0x44f6[_0x4480b9];return _0x3f0f02;};'use strict';var VoiceQueueReportEvents=require(_0x644f('0x0'));var events=[_0x644f('0x1'),_0x644f('0x2'),_0x644f('0x3')];function createListener(_0x5f1c92,_0x483e79){return function(_0x3715c3){_0x483e79[_0x644f('0x4')](_0x5f1c92,_0x3715c3);};}function removeListener(_0x1045bd,_0x3e95c7){return function(){VoiceQueueReportEvents['removeListener'](_0x1045bd,_0x3e95c7);};}exports['register']=function(_0x1839b8){for(var _0xb6b9b5=0x0,_0x353dae=events[_0x644f('0x5')];_0xb6b9b5<_0x353dae;_0xb6b9b5++){var _0x1c79ce=events[_0xb6b9b5];var _0x204c12=createListener(_0x644f('0x6')+_0x1c79ce,_0x1839b8);VoiceQueueReportEvents['on'](_0x1c79ce,_0x204c12);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index a0c2b1e..46ebb72 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 _0x9b8c=['get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x2ec317,_0x5c29e5){var _0x50cc3a=function(_0x2dfb30){while(--_0x2dfb30){_0x2ec317['push'](_0x2ec317['shift']());}};_0x50cc3a(++_0x5c29e5);}(_0x9b8c,0x16f));var _0xc9b8=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x9b8c[_0x18a436];return _0x5c2cf8;};'use strict';var multer=require(_0xc9b8('0x0'));var util=require(_0xc9b8('0x1'));var path=require(_0xc9b8('0x2'));var timeout=require('connect-timeout');var express=require(_0xc9b8('0x3'));var router=express[_0xc9b8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc9b8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc9b8('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0xc9b8('0x7')]('/',auth[_0xc9b8('0x8')](),controller['index']);router[_0xc9b8('0x7')](_0xc9b8('0x9'),auth['isAuthenticated'](),controller[_0xc9b8('0xa')]);router[_0xc9b8('0xb')]('/',auth[_0xc9b8('0x8')](),controller['create']);router[_0xc9b8('0xc')](_0xc9b8('0x9'),auth[_0xc9b8('0x8')](),controller[_0xc9b8('0xd')]);router[_0xc9b8('0xe')](_0xc9b8('0x9'),auth[_0xc9b8('0x8')](),controller[_0xc9b8('0xf')]);module[_0xc9b8('0x10')]=router; \ No newline at end of file +var _0xec15=['post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','isAuthenticated','index','get','/:id','show'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0xec15,0x1a8));var _0x5ec1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec15[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x5ec1('0x0'));var path=require(_0x5ec1('0x1'));var timeout=require(_0x5ec1('0x2'));var express=require('express');var router=express[_0x5ec1('0x3')]();var fs_extra=require(_0x5ec1('0x4'));var auth=require(_0x5ec1('0x5'));var interaction=require(_0x5ec1('0x6'));var config=require('../../config/environment');var controller=require(_0x5ec1('0x7'));router['get']('/',auth[_0x5ec1('0x8')](),controller[_0x5ec1('0x9')]);router[_0x5ec1('0xa')](_0x5ec1('0xb'),auth['isAuthenticated'](),controller[_0x5ec1('0xc')]);router[_0x5ec1('0xd')]('/',auth[_0x5ec1('0x8')](),controller[_0x5ec1('0xe')]);router[_0x5ec1('0xf')](_0x5ec1('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x5ec1('0x10')](_0x5ec1('0xb'),auth[_0x5ec1('0x8')](),controller[_0x5ec1('0x11')]);module[_0x5ec1('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 7a65562..4f75022 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 _0x6635=['exports','STRING','DATE','literal','moment'];(function(_0x33146b,_0x5e8fb0){var _0x306aff=function(_0x219f3b){while(--_0x219f3b){_0x33146b['push'](_0x33146b['shift']());}};_0x306aff(++_0x5e8fb0);}(_0x6635,0x13a));var _0x5663=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x6635[_0x369151];return _0x4292d5;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5663('0x0'));module[_0x5663('0x1')]={'time':{'type':Sequelize[_0x5663('0x2')]},'callid':{'type':Sequelize[_0x5663('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5663('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5663('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5663('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x5663('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x5663('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x5663('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x5663('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5663('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x5663('0x4')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xba37=['sequelize','moment','exports','STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0xa78e67,_0x2b9bc5){var _0x26b92f=function(_0x352df8){while(--_0x352df8){_0xa78e67['push'](_0xa78e67['shift']());}};_0x26b92f(++_0x2b9bc5);}(_0xba37,0x1bc));var _0x7ba3=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xba37[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0x7ba3('0x0'));var moment=require(_0x7ba3('0x1'));module[_0x7ba3('0x2')]={'time':{'type':Sequelize[_0x7ba3('0x3')]},'callid':{'type':Sequelize[_0x7ba3('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x7ba3('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7ba3('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x7ba3('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x7ba3('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7ba3('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7ba3('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7ba3('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x7ba3('0x4')](_0x7ba3('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 3ad754e..82525e3 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 _0x8f97=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','fast-json-patch','moment','bluebird'];(function(_0x38b6fc,_0xa4d18d){var _0x175508=function(_0x94712a){while(--_0x94712a){_0x38b6fc['push'](_0x38b6fc['shift']());}};_0x175508(++_0xa4d18d);}(_0x8f97,0xd2));var _0x78f9=function(_0x196655,_0x3664e2){_0x196655=_0x196655-0x0;var _0x51e53f=_0x8f97[_0x196655];return _0x51e53f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x78f9('0x0'));var rp=require('request-promise');var moment=require(_0x78f9('0x1'));var BPromise=require(_0x78f9('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x78f9('0x3'));var sox=require(_0x78f9('0x4'));var csv=require(_0x78f9('0x5'));var ejs=require(_0x78f9('0x6'));var fs=require('fs');var fs_extra=require(_0x78f9('0x7'));var _=require(_0x78f9('0x8'));var squel=require(_0x78f9('0x9'));var crypto=require(_0x78f9('0xa'));var jsforce=require(_0x78f9('0xb'));var deskjs=require(_0x78f9('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x78f9('0xd'));var Redis=require(_0x78f9('0xe'));var authService=require(_0x78f9('0xf'));var qs=require(_0x78f9('0x10'));var as=require(_0x78f9('0x11'));var hardwareService=require(_0x78f9('0x12'));var logger=require(_0x78f9('0x13'))('api');var utils=require(_0x78f9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x78f9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x180690,_0x11ab77){_0x11ab77=_0x11ab77||0xcc;return function(_0x9e1d96){if(_0x9e1d96){return _0x180690[_0x78f9('0x16')](_0x11ab77);}return _0x180690[_0x78f9('0x17')](_0x11ab77)[_0x78f9('0x18')]();};}function respondWithResult(_0x10adb0,_0x11b10d){_0x11b10d=_0x11b10d||0xc8;return function(_0x35f02b){if(_0x35f02b){return _0x10adb0[_0x78f9('0x17')](_0x11b10d)[_0x78f9('0x19')](_0x35f02b);}};}function respondWithFilteredResult(_0x4da81b,_0x386320){return function(_0x439e7b){if(_0x439e7b){var _0x3a45da=typeof _0x386320[_0x78f9('0x1a')]===_0x78f9('0x1b')&&typeof _0x386320[_0x78f9('0x1c')]==='undefined';var _0x1acfac=_0x439e7b[_0x78f9('0x1d')];var _0x4c00b1=_0x3a45da?0x0:_0x386320['offset'];var _0x3745e3=_0x3a45da?_0x439e7b[_0x78f9('0x1d')]:_0x386320[_0x78f9('0x1a')]+_0x386320['limit'];var _0x4be33f;if(_0x3745e3>=_0x1acfac){_0x3745e3=_0x1acfac;_0x4be33f=0xc8;}else{_0x4be33f=0xce;}_0x4da81b[_0x78f9('0x17')](_0x4be33f);return _0x4da81b[_0x78f9('0x1e')](_0x78f9('0x1f'),_0x4c00b1+'-'+_0x3745e3+'/'+_0x1acfac)[_0x78f9('0x19')](_0x439e7b);}return null;};}function patchUpdates(_0x566e96){return function(_0x3720c9){try{jsonpatch[_0x78f9('0x20')](_0x3720c9,_0x566e96,!![]);}catch(_0xc97c70){return BPromise[_0x78f9('0x21')](_0xc97c70);}return _0x3720c9['save']();};}function saveUpdates(_0x5dc4f6,_0x5cff1c){return function(_0x3cd77c){if(_0x3cd77c){return _0x3cd77c[_0x78f9('0x22')](_0x5dc4f6)[_0x78f9('0x23')](function(_0x4d7fca){return _0x4d7fca;});}return null;};}function removeEntity(_0x423069,_0x817caa){return function(_0x5ca0d0){if(_0x5ca0d0){return _0x5ca0d0[_0x78f9('0x24')]()['then'](function(){_0x423069[_0x78f9('0x17')](0xcc)[_0x78f9('0x18')]();});}};}function handleEntityNotFound(_0xb0dc9c,_0x44c3b2){return function(_0x2370c3){if(!_0x2370c3){_0xb0dc9c['sendStatus'](0x194);}return _0x2370c3;};}function handleError(_0x4baf47,_0x38c7cc){_0x38c7cc=_0x38c7cc||0x1f4;return function(_0x10a488){logger['error'](_0x10a488['stack']);if(_0x10a488['name']){delete _0x10a488[_0x78f9('0x25')];}_0x4baf47['status'](_0x38c7cc)['send'](_0x10a488);};}exports['index']=function(_0x4a7603,_0x3d82ba){var _0x4104b6={},_0x5f12df={},_0x44acd1={'count':0x0,'rows':[]};var _0x45e609=_[_0x78f9('0x26')](db[_0x78f9('0x27')][_0x78f9('0x28')],function(_0x17e9ce){return{'name':_0x17e9ce[_0x78f9('0x29')],'type':_0x17e9ce[_0x78f9('0x2a')][_0x78f9('0x2b')]};});_0x5f12df[_0x78f9('0x2c')]=_[_0x78f9('0x26')](_0x45e609,_0x78f9('0x25'));_0x5f12df[_0x78f9('0x2d')]=_[_0x78f9('0x2e')](_0x4a7603[_0x78f9('0x2d')]);_0x5f12df['filters']=_[_0x78f9('0x2f')](_0x5f12df['model'],_0x5f12df[_0x78f9('0x2d')]);_0x4104b6['attributes']=_['intersection'](_0x5f12df[_0x78f9('0x2c')],qs['fields'](_0x4a7603[_0x78f9('0x2d')][_0x78f9('0x30')]));_0x4104b6[_0x78f9('0x31')]=_0x4104b6['attributes'][_0x78f9('0x32')]?_0x4104b6[_0x78f9('0x31')]:_0x5f12df[_0x78f9('0x2c')];if(!_0x4a7603[_0x78f9('0x2d')][_0x78f9('0x33')](_0x78f9('0x34'))){_0x4104b6['limit']=qs[_0x78f9('0x1c')](_0x4a7603[_0x78f9('0x2d')][_0x78f9('0x1c')]);_0x4104b6[_0x78f9('0x1a')]=qs[_0x78f9('0x1a')](_0x4a7603[_0x78f9('0x2d')]['offset']);}_0x4104b6[_0x78f9('0x35')]=qs[_0x78f9('0x36')](_0x4a7603[_0x78f9('0x2d')][_0x78f9('0x36')]);_0x4104b6['where']=qs[_0x78f9('0x37')](_[_0x78f9('0x38')](_0x4a7603['query'],_0x5f12df['filters']),_0x45e609);if(_0x4a7603[_0x78f9('0x2d')][_0x78f9('0x39')]){_0x4104b6[_0x78f9('0x3a')]=_['merge'](_0x4104b6['where'],{'$or':_[_0x78f9('0x26')](_0x45e609,function(_0x231f98){if(_0x231f98[_0x78f9('0x2a')]!==_0x78f9('0x3b')){var _0x8c05e4={};_0x8c05e4[_0x231f98[_0x78f9('0x25')]]={'$like':'%'+_0x4a7603['query'][_0x78f9('0x39')]+'%'};return _0x8c05e4;}})});}_0x4104b6=_[_0x78f9('0x3c')]({},_0x4104b6,_0x4a7603['options']);var _0x5ca487={'where':_0x4104b6[_0x78f9('0x3a')]};return db[_0x78f9('0x27')][_0x78f9('0x1d')](_0x5ca487)[_0x78f9('0x23')](function(_0x119dcb){_0x44acd1['count']=_0x119dcb;if(_0x4a7603[_0x78f9('0x2d')][_0x78f9('0x3d')]){_0x4104b6[_0x78f9('0x3e')]=[{'all':!![]}];}return db[_0x78f9('0x27')][_0x78f9('0x3f')](_0x4104b6);})[_0x78f9('0x23')](function(_0x23de15){_0x44acd1[_0x78f9('0x40')]=_0x23de15;return _0x44acd1;})['then'](respondWithFilteredResult(_0x3d82ba,_0x4104b6))[_0x78f9('0x41')](handleError(_0x3d82ba,null));};exports['show']=function(_0x1bd21a,_0x1eaefe){var _0x43430c={'raw':!![],'where':{'id':_0x1bd21a[_0x78f9('0x42')]['id']}},_0x31876a={};_0x31876a[_0x78f9('0x2c')]=_[_0x78f9('0x2e')](db[_0x78f9('0x27')][_0x78f9('0x28')]);_0x31876a['query']=_[_0x78f9('0x2e')](_0x1bd21a[_0x78f9('0x2d')]);_0x31876a['filters']=_[_0x78f9('0x2f')](_0x31876a[_0x78f9('0x2c')],_0x31876a[_0x78f9('0x2d')]);_0x43430c['attributes']=_[_0x78f9('0x2f')](_0x31876a[_0x78f9('0x2c')],qs[_0x78f9('0x30')](_0x1bd21a[_0x78f9('0x2d')][_0x78f9('0x30')]));_0x43430c[_0x78f9('0x31')]=_0x43430c[_0x78f9('0x31')][_0x78f9('0x32')]?_0x43430c[_0x78f9('0x31')]:_0x31876a[_0x78f9('0x2c')];if(_0x1bd21a[_0x78f9('0x2d')][_0x78f9('0x3d')]){_0x43430c['include']=[{'all':!![]}];}_0x43430c=_['merge']({},_0x43430c,_0x1bd21a[_0x78f9('0x43')]);return db[_0x78f9('0x27')][_0x78f9('0x44')](_0x43430c)[_0x78f9('0x23')](handleEntityNotFound(_0x1eaefe,null))['then'](respondWithResult(_0x1eaefe,null))[_0x78f9('0x41')](handleError(_0x1eaefe,null));};exports[_0x78f9('0x45')]=function(_0x11cb08,_0x426783){return db[_0x78f9('0x27')][_0x78f9('0x45')](_0x11cb08[_0x78f9('0x46')],{})['then'](respondWithResult(_0x426783,0xc9))[_0x78f9('0x41')](handleError(_0x426783,null));};exports[_0x78f9('0x22')]=function(_0x2ba70a,_0x24cdfd){if(_0x2ba70a[_0x78f9('0x46')]['id']){delete _0x2ba70a['body']['id'];}return db[_0x78f9('0x27')][_0x78f9('0x44')]({'where':{'id':_0x2ba70a[_0x78f9('0x42')]['id']}})[_0x78f9('0x23')](handleEntityNotFound(_0x24cdfd,null))[_0x78f9('0x23')](saveUpdates(_0x2ba70a[_0x78f9('0x46')],null))['then'](respondWithResult(_0x24cdfd,null))[_0x78f9('0x41')](handleError(_0x24cdfd,null));};exports[_0x78f9('0x24')]=function(_0x3212cb,_0x391c3a){return db['VoiceQueuesLog'][_0x78f9('0x44')]({'where':{'id':_0x3212cb[_0x78f9('0x42')]['id']}})[_0x78f9('0x23')](handleEntityNotFound(_0x391c3a,null))['then'](removeEntity(_0x391c3a,null))[_0x78f9('0x41')](handleError(_0x391c3a,null));}; \ No newline at end of file +var _0x3d9d=['squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','reject','save','update','destroy','stack','name','send','map','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceQueuesLog','then','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash'];(function(_0x1bf5ba,_0x2371b4){var _0x26fdb5=function(_0x569c04){while(--_0x569c04){_0x1bf5ba['push'](_0x1bf5ba['shift']());}};_0x26fdb5(++_0x2371b4);}(_0x3d9d,0x1ab));var _0xd3d9=function(_0x4c2323,_0x2dce70){_0x4c2323=_0x4c2323-0x0;var _0x15e615=_0x3d9d[_0x4c2323];return _0x15e615;};'use strict';var emlformat=require(_0xd3d9('0x0'));var rimraf=require(_0xd3d9('0x1'));var zipdir=require(_0xd3d9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd3d9('0x3'));var moment=require(_0xd3d9('0x4'));var BPromise=require(_0xd3d9('0x5'));var Mustache=require('mustache');var util=require(_0xd3d9('0x6'));var path=require(_0xd3d9('0x7'));var sox=require('sox');var csv=require(_0xd3d9('0x8'));var ejs=require(_0xd3d9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd3d9('0xa'));var squel=require(_0xd3d9('0xb'));var crypto=require(_0xd3d9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd3d9('0xd'));var toCsv=require(_0xd3d9('0x8'));var querystring=require(_0xd3d9('0xe'));var Papa=require('papaparse');var Redis=require(_0xd3d9('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd3d9('0x10'));var hardwareService=require(_0xd3d9('0x11'));var logger=require('../../config/logger')(_0xd3d9('0x12'));var utils=require(_0xd3d9('0x13'));var config=require(_0xd3d9('0x14'));var licenseUtil=require(_0xd3d9('0x15'));var db=require(_0xd3d9('0x16'))['db'];function respondWithStatusCode(_0x2639c8,_0x40e4f0){_0x40e4f0=_0x40e4f0||0xcc;return function(_0x2d88b7){if(_0x2d88b7){return _0x2639c8[_0xd3d9('0x17')](_0x40e4f0);}return _0x2639c8[_0xd3d9('0x18')](_0x40e4f0)[_0xd3d9('0x19')]();};}function respondWithResult(_0x35075a,_0x4cf642){_0x4cf642=_0x4cf642||0xc8;return function(_0x26b455){if(_0x26b455){return _0x35075a[_0xd3d9('0x18')](_0x4cf642)[_0xd3d9('0x1a')](_0x26b455);}};}function respondWithFilteredResult(_0x26848c,_0x3eab2c){return function(_0x3b78ab){if(_0x3b78ab){var _0x4f0641=typeof _0x3eab2c['offset']==='undefined'&&typeof _0x3eab2c[_0xd3d9('0x1b')]===_0xd3d9('0x1c');var _0x639ae0=_0x3b78ab[_0xd3d9('0x1d')];var _0x5a84fe=_0x4f0641?0x0:_0x3eab2c['offset'];var _0x1c2ada=_0x4f0641?_0x3b78ab['count']:_0x3eab2c['offset']+_0x3eab2c['limit'];var _0x17d827;if(_0x1c2ada>=_0x639ae0){_0x1c2ada=_0x639ae0;_0x17d827=0xc8;}else{_0x17d827=0xce;}_0x26848c[_0xd3d9('0x18')](_0x17d827);return _0x26848c['set']('Content-Range',_0x5a84fe+'-'+_0x1c2ada+'/'+_0x639ae0)['json'](_0x3b78ab);}return null;};}function patchUpdates(_0x331544){return function(_0x4e2104){try{jsonpatch['apply'](_0x4e2104,_0x331544,!![]);}catch(_0x4692fb){return BPromise[_0xd3d9('0x1e')](_0x4692fb);}return _0x4e2104[_0xd3d9('0x1f')]();};}function saveUpdates(_0x29956a,_0x2592ce){return function(_0x13054a){if(_0x13054a){return _0x13054a[_0xd3d9('0x20')](_0x29956a)['then'](function(_0x5129f3){return _0x5129f3;});}return null;};}function removeEntity(_0x2c374a,_0x3481dc){return function(_0x6ed47){if(_0x6ed47){return _0x6ed47[_0xd3d9('0x21')]()['then'](function(){_0x2c374a[_0xd3d9('0x18')](0xcc)[_0xd3d9('0x19')]();});}};}function handleEntityNotFound(_0x5b6a90,_0x3974e4){return function(_0x40074b){if(!_0x40074b){_0x5b6a90[_0xd3d9('0x17')](0x194);}return _0x40074b;};}function handleError(_0x3a94c6,_0x1c69ff){_0x1c69ff=_0x1c69ff||0x1f4;return function(_0x599940){logger['error'](_0x599940[_0xd3d9('0x22')]);if(_0x599940[_0xd3d9('0x23')]){delete _0x599940[_0xd3d9('0x23')];}_0x3a94c6[_0xd3d9('0x18')](_0x1c69ff)[_0xd3d9('0x24')](_0x599940);};}exports['index']=function(_0x1ef3d1,_0x58f2e4){var _0x1a8deb={},_0x538333={},_0x391ee3={'count':0x0,'rows':[]};var _0x4c5938=_[_0xd3d9('0x25')](db['VoiceQueuesLog']['rawAttributes'],function(_0x26d7b8){return{'name':_0x26d7b8[_0xd3d9('0x26')],'type':_0x26d7b8[_0xd3d9('0x27')][_0xd3d9('0x28')]};});_0x538333['model']=_[_0xd3d9('0x25')](_0x4c5938,_0xd3d9('0x23'));_0x538333['query']=_['keys'](_0x1ef3d1[_0xd3d9('0x29')]);_0x538333['filters']=_[_0xd3d9('0x2a')](_0x538333[_0xd3d9('0x2b')],_0x538333['query']);_0x1a8deb['attributes']=_[_0xd3d9('0x2a')](_0x538333['model'],qs['fields'](_0x1ef3d1[_0xd3d9('0x29')][_0xd3d9('0x2c')]));_0x1a8deb[_0xd3d9('0x2d')]=_0x1a8deb[_0xd3d9('0x2d')][_0xd3d9('0x2e')]?_0x1a8deb[_0xd3d9('0x2d')]:_0x538333[_0xd3d9('0x2b')];if(!_0x1ef3d1[_0xd3d9('0x29')][_0xd3d9('0x2f')](_0xd3d9('0x30'))){_0x1a8deb['limit']=qs['limit'](_0x1ef3d1[_0xd3d9('0x29')][_0xd3d9('0x1b')]);_0x1a8deb[_0xd3d9('0x31')]=qs[_0xd3d9('0x31')](_0x1ef3d1[_0xd3d9('0x29')][_0xd3d9('0x31')]);}_0x1a8deb[_0xd3d9('0x32')]=qs[_0xd3d9('0x33')](_0x1ef3d1[_0xd3d9('0x29')][_0xd3d9('0x33')]);_0x1a8deb[_0xd3d9('0x34')]=qs[_0xd3d9('0x35')](_[_0xd3d9('0x36')](_0x1ef3d1['query'],_0x538333[_0xd3d9('0x35')]),_0x4c5938);if(_0x1ef3d1[_0xd3d9('0x29')][_0xd3d9('0x37')]){_0x1a8deb[_0xd3d9('0x34')]=_[_0xd3d9('0x38')](_0x1a8deb['where'],{'$or':_[_0xd3d9('0x25')](_0x4c5938,function(_0x3ac965){if(_0x3ac965[_0xd3d9('0x27')]!==_0xd3d9('0x39')){var _0x47ff96={};_0x47ff96[_0x3ac965[_0xd3d9('0x23')]]={'$like':'%'+_0x1ef3d1[_0xd3d9('0x29')][_0xd3d9('0x37')]+'%'};return _0x47ff96;}})});}_0x1a8deb=_['merge']({},_0x1a8deb,_0x1ef3d1[_0xd3d9('0x3a')]);var _0x134a1e={'where':_0x1a8deb[_0xd3d9('0x34')]};return db[_0xd3d9('0x3b')][_0xd3d9('0x1d')](_0x134a1e)[_0xd3d9('0x3c')](function(_0x57f5b5){_0x391ee3[_0xd3d9('0x1d')]=_0x57f5b5;if(_0x1ef3d1['query']['includeAll']){_0x1a8deb[_0xd3d9('0x3d')]=[{'all':!![]}];}return db[_0xd3d9('0x3b')][_0xd3d9('0x3e')](_0x1a8deb);})['then'](function(_0x33ec5e){_0x391ee3[_0xd3d9('0x3f')]=_0x33ec5e;return _0x391ee3;})[_0xd3d9('0x3c')](respondWithFilteredResult(_0x58f2e4,_0x1a8deb))[_0xd3d9('0x40')](handleError(_0x58f2e4,null));};exports[_0xd3d9('0x41')]=function(_0x1f5802,_0x1c1761){var _0x2bba8e={'raw':!![],'where':{'id':_0x1f5802[_0xd3d9('0x42')]['id']}},_0x4ee6e6={};_0x4ee6e6['model']=_[_0xd3d9('0x43')](db['VoiceQueuesLog'][_0xd3d9('0x44')]);_0x4ee6e6[_0xd3d9('0x29')]=_['keys'](_0x1f5802[_0xd3d9('0x29')]);_0x4ee6e6[_0xd3d9('0x35')]=_['intersection'](_0x4ee6e6[_0xd3d9('0x2b')],_0x4ee6e6['query']);_0x2bba8e['attributes']=_[_0xd3d9('0x2a')](_0x4ee6e6['model'],qs[_0xd3d9('0x2c')](_0x1f5802['query'][_0xd3d9('0x2c')]));_0x2bba8e[_0xd3d9('0x2d')]=_0x2bba8e[_0xd3d9('0x2d')][_0xd3d9('0x2e')]?_0x2bba8e[_0xd3d9('0x2d')]:_0x4ee6e6[_0xd3d9('0x2b')];if(_0x1f5802['query'][_0xd3d9('0x45')]){_0x2bba8e[_0xd3d9('0x3d')]=[{'all':!![]}];}_0x2bba8e=_[_0xd3d9('0x38')]({},_0x2bba8e,_0x1f5802['options']);return db['VoiceQueuesLog'][_0xd3d9('0x46')](_0x2bba8e)[_0xd3d9('0x3c')](handleEntityNotFound(_0x1c1761,null))[_0xd3d9('0x3c')](respondWithResult(_0x1c1761,null))[_0xd3d9('0x40')](handleError(_0x1c1761,null));};exports[_0xd3d9('0x47')]=function(_0xf7023b,_0xd4dff7){return db[_0xd3d9('0x3b')][_0xd3d9('0x47')](_0xf7023b[_0xd3d9('0x48')],{})[_0xd3d9('0x3c')](respondWithResult(_0xd4dff7,0xc9))[_0xd3d9('0x40')](handleError(_0xd4dff7,null));};exports['update']=function(_0x10060d,_0x1c8563){if(_0x10060d[_0xd3d9('0x48')]['id']){delete _0x10060d[_0xd3d9('0x48')]['id'];}return db[_0xd3d9('0x3b')][_0xd3d9('0x46')]({'where':{'id':_0x10060d[_0xd3d9('0x42')]['id']}})[_0xd3d9('0x3c')](handleEntityNotFound(_0x1c8563,null))[_0xd3d9('0x3c')](saveUpdates(_0x10060d[_0xd3d9('0x48')],null))[_0xd3d9('0x3c')](respondWithResult(_0x1c8563,null))[_0xd3d9('0x40')](handleError(_0x1c8563,null));};exports[_0xd3d9('0x21')]=function(_0x1e04a9,_0x1f8c09){return db[_0xd3d9('0x3b')][_0xd3d9('0x46')]({'where':{'id':_0x1e04a9[_0xd3d9('0x42')]['id']}})[_0xd3d9('0x3c')](handleEntityNotFound(_0x1f8c09,null))[_0xd3d9('0x3c')](removeEntity(_0x1f8c09,null))[_0xd3d9('0x40')](handleError(_0x1f8c09,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 96ed1da..9af60f3 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 _0x605e=['lodash','util','api','moment','rimraf','../../config/environment','./voiceQueuesLog.attributes','voice_queues_log','event_dtm','event','dtm'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x605e,0x1b8));var _0xe605=function(_0x50e08b,_0x571779){_0x50e08b=_0x50e08b-0x0;var _0x8fd085=_0x605e[_0x50e08b];return _0x8fd085;};'use strict';var _=require(_0xe605('0x0'));var util=require(_0xe605('0x1'));var logger=require('../../config/logger')(_0xe605('0x2'));var moment=require(_0xe605('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe605('0x4'));var config=require(_0xe605('0x5'));var attributes=require(_0xe605('0x6'));module['exports']=function(_0x2f04fa,_0xf67d37){return _0x2f04fa['define']('VoiceQueuesLog',attributes,{'tableName':_0xe605('0x7'),'paranoid':![],'indexes':[{'name':_0xe605('0x8'),'fields':[_0xe605('0x9'),_0xe605('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6816=['VoiceQueuesLog','voice_queues_log','dtm','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define'];(function(_0x14fc85,_0x347e30){var _0x2aa05a=function(_0x3a4891){while(--_0x3a4891){_0x14fc85['push'](_0x14fc85['shift']());}};_0x2aa05a(++_0x347e30);}(_0x6816,0x16f));var _0x6681=function(_0xba15b9,_0x46f5fa){_0xba15b9=_0xba15b9-0x0;var _0x291702=_0x6816[_0xba15b9];return _0x291702;};'use strict';var _=require(_0x6681('0x0'));var util=require(_0x6681('0x1'));var logger=require(_0x6681('0x2'))('api');var moment=require(_0x6681('0x3'));var BPromise=require('bluebird');var rp=require(_0x6681('0x4'));var fs=require('fs');var path=require(_0x6681('0x5'));var rimraf=require(_0x6681('0x6'));var config=require(_0x6681('0x7'));var attributes=require(_0x6681('0x8'));module[_0x6681('0x9')]=function(_0x2c5e2f,_0x26181e){return _0x2c5e2f[_0x6681('0xa')](_0x6681('0xb'),attributes,{'tableName':_0x6681('0xc'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0x6681('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 7d276fd..6563b5f 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 _0xdb49=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4b9f03,_0x4f1574){var _0x445679=function(_0x424ba1){while(--_0x424ba1){_0x4b9f03['push'](_0x4b9f03['shift']());}};_0x445679(++_0x4f1574);}(_0xdb49,0x1c8));var _0x9db4=function(_0x3d08d6,_0x273734){_0x3d08d6=_0x3d08d6-0x0;var _0x2babf6=_0xdb49[_0x3d08d6];return _0x2babf6;};'use strict';var _=require(_0x9db4('0x0'));var util=require(_0x9db4('0x1'));var moment=require(_0x9db4('0x2'));var BPromise=require(_0x9db4('0x3'));var rs=require(_0x9db4('0x4'));var fs=require('fs');var Redis=require(_0x9db4('0x5'));var db=require(_0x9db4('0x6'))['db'];var utils=require(_0x9db4('0x7'));var logger=require(_0x9db4('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9db4('0x9'));var client=jayson[_0x9db4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x518787,_0x40b5f1,_0x31e9f0){return new BPromise(function(_0x3a3bab,_0x279159){return client[_0x9db4('0xb')](_0x518787,_0x31e9f0)[_0x9db4('0xc')](function(_0x49ba32){logger[_0x9db4('0xd')](_0x9db4('0xe'),_0x40b5f1,'request\x20sent');logger[_0x9db4('0xf')](_0x9db4('0x10'),_0x40b5f1,_0x9db4('0x11'),JSON[_0x9db4('0x12')](_0x49ba32));if(_0x49ba32['error']){if(_0x49ba32[_0x9db4('0x13')][_0x9db4('0x14')]===0x1f4){logger[_0x9db4('0x13')](_0x9db4('0xe'),_0x40b5f1,_0x49ba32['error']['message']);return _0x279159(_0x49ba32[_0x9db4('0x13')]['message']);}logger[_0x9db4('0x13')](_0x9db4('0xe'),_0x40b5f1,_0x49ba32[_0x9db4('0x13')][_0x9db4('0x15')]);return _0x3a3bab(_0x49ba32[_0x9db4('0x13')][_0x9db4('0x15')]);}else{logger[_0x9db4('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x40b5f1,_0x9db4('0x11'));_0x3a3bab(_0x49ba32[_0x9db4('0x16')]['message']);}})[_0x9db4('0x17')](function(_0x25093f){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x40b5f1,_0x25093f);_0x279159(_0x25093f);});});} \ No newline at end of file +var _0x5699=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5699,0xaf));var _0x9569=function(_0x437d70,_0x40db2e){_0x437d70=_0x437d70-0x0;var _0x43a659=_0x5699[_0x437d70];return _0x43a659;};'use strict';var _=require(_0x9569('0x0'));var util=require(_0x9569('0x1'));var moment=require(_0x9569('0x2'));var BPromise=require('bluebird');var rs=require(_0x9569('0x3'));var fs=require('fs');var Redis=require(_0x9569('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9569('0x5'));var logger=require(_0x9569('0x6'))('rpc');var config=require(_0x9569('0x7'));var jayson=require(_0x9569('0x8'));var client=jayson[_0x9569('0x9')][_0x9569('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5014f8,_0xd77df2,_0x587c8b){return new BPromise(function(_0x1a24e2,_0x3bf8f4){return client['request'](_0x5014f8,_0x587c8b)[_0x9569('0xb')](function(_0x752433){logger[_0x9569('0xc')](_0x9569('0xd'),_0xd77df2,_0x9569('0xe'));logger['debug'](_0x9569('0xf'),_0xd77df2,'request\x20sent',JSON['stringify'](_0x752433));if(_0x752433[_0x9569('0x10')]){if(_0x752433['error'][_0x9569('0x11')]===0x1f4){logger[_0x9569('0x10')](_0x9569('0xd'),_0xd77df2,_0x752433['error']['message']);return _0x3bf8f4(_0x752433[_0x9569('0x10')]['message']);}logger['error'](_0x9569('0xd'),_0xd77df2,_0x752433[_0x9569('0x10')]['message']);return _0x1a24e2(_0x752433['error'][_0x9569('0x12')]);}else{logger[_0x9569('0xc')](_0x9569('0xd'),_0xd77df2,_0x9569('0xe'));_0x1a24e2(_0x752433['result']['message']);}})[_0x9569('0x13')](function(_0x589d34){logger[_0x9569('0x10')](_0x9569('0xd'),_0xd77df2,_0x589d34);_0x3bf8f4(_0x589d34);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 9ec80dd..c85e535 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 _0x9cbd=['index','/describe','describe','show','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','/:id','update','delete','destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated'];(function(_0x19a5d8,_0x347207){var _0x30104a=function(_0x292695){while(--_0x292695){_0x19a5d8['push'](_0x19a5d8['shift']());}};_0x30104a(++_0x347207);}(_0x9cbd,0x93));var _0xd9cb=function(_0xed3162,_0x2e6637){_0xed3162=_0xed3162-0x0;var _0x17aa90=_0x9cbd[_0xed3162];return _0x17aa90;};'use strict';var multer=require(_0xd9cb('0x0'));var util=require(_0xd9cb('0x1'));var path=require(_0xd9cb('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9cb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd9cb('0x4'));var config=require(_0xd9cb('0x5'));var controller=require(_0xd9cb('0x6'));router[_0xd9cb('0x7')]('/',auth[_0xd9cb('0x8')](),controller[_0xd9cb('0x9')]);router[_0xd9cb('0x7')](_0xd9cb('0xa'),auth[_0xd9cb('0x8')](),controller[_0xd9cb('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd9cb('0xc')]);router['get'](_0xd9cb('0xd'),auth[_0xd9cb('0x8')](),controller[_0xd9cb('0xe')]);router[_0xd9cb('0x7')]('/:id/downloads',controller[_0xd9cb('0xf')]);router[_0xd9cb('0x7')](_0xd9cb('0x10'),auth['isAuthenticated'](),controller[_0xd9cb('0x11')]);router[_0xd9cb('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd9cb('0x12')](_0xd9cb('0x10'),auth['isAuthenticated'](),controller[_0xd9cb('0x13')]);router[_0xd9cb('0x14')](_0xd9cb('0x15'),auth[_0xd9cb('0x8')](),controller[_0xd9cb('0x16')]);router[_0xd9cb('0x17')](_0xd9cb('0x15'),auth[_0xd9cb('0x8')](),controller[_0xd9cb('0x18')]);module[_0xd9cb('0x19')]=router; \ No newline at end of file +var _0x9684=['/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','runTranscribe','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','index','get','/describe','describe','/:id','isAuthenticated'];(function(_0x4468e2,_0x4362c5){var _0x4961b8=function(_0x109d52){while(--_0x109d52){_0x4468e2['push'](_0x4468e2['shift']());}};_0x4961b8(++_0x4362c5);}(_0x9684,0x98));var _0x4968=function(_0x3fc080,_0x15487b){_0x3fc080=_0x3fc080-0x0;var _0x50622=_0x9684[_0x3fc080];return _0x50622;};'use strict';var multer=require(_0x4968('0x0'));var util=require(_0x4968('0x1'));var path=require(_0x4968('0x2'));var timeout=require(_0x4968('0x3'));var express=require(_0x4968('0x4'));var router=express[_0x4968('0x5')]();var fs_extra=require(_0x4968('0x6'));var auth=require(_0x4968('0x7'));var interaction=require(_0x4968('0x8'));var config=require('../../config/environment');var controller=require(_0x4968('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4968('0xa')]);router[_0x4968('0xb')](_0x4968('0xc'),auth['isAuthenticated'](),controller[_0x4968('0xd')]);router[_0x4968('0xb')](_0x4968('0xe'),auth[_0x4968('0xf')](),controller['show']);router['get'](_0x4968('0x10'),auth['isAuthenticated'](),controller[_0x4968('0x11')]);router[_0x4968('0xb')](_0x4968('0x12'),controller[_0x4968('0x13')]);router['get'](_0x4968('0x14'),auth[_0x4968('0xf')](),controller['downloadTranscribe']);router[_0x4968('0x15')]('/',auth[_0x4968('0xf')](),controller['create']);router[_0x4968('0x15')]('/:id/transcribe',auth[_0x4968('0xf')](),controller[_0x4968('0x16')]);router[_0x4968('0x17')](_0x4968('0xe'),auth[_0x4968('0xf')](),controller[_0x4968('0x18')]);router[_0x4968('0x19')](_0x4968('0xe'),auth[_0x4968('0xf')](),controller[_0x4968('0x1a')]);module[_0x4968('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 69a3bf4..b1abf54 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(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 fedab91..30d0bfa 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 _0xd3b0=['save','update','end','error','stack','name','index','map','VoiceRecording','rawAttributes','fieldName','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','send','downloads','sequelize','MD5','col','$and','push','extname','destroy','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJob','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject'];(function(_0x3da64f,_0x5a77b4){var _0x20ea25=function(_0x5e7eda){while(--_0x5e7eda){_0x3da64f['push'](_0x3da64f['shift']());}};_0x20ea25(++_0x5a77b4);}(_0xd3b0,0x77));var _0x0d3b=function(_0x9a7d12,_0x56c00a){_0x9a7d12=_0x9a7d12-0x0;var _0x4fdb44=_0xd3b0[_0x9a7d12];return _0x4fdb44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0d3b('0x0'));var zipdir=require(_0x0d3b('0x1'));var jsonpatch=require(_0x0d3b('0x2'));var rp=require(_0x0d3b('0x3'));var moment=require(_0x0d3b('0x4'));var BPromise=require(_0x0d3b('0x5'));var Mustache=require('mustache');var util=require(_0x0d3b('0x6'));var path=require(_0x0d3b('0x7'));var sox=require(_0x0d3b('0x8'));var csv=require('to-csv');var ejs=require(_0x0d3b('0x9'));var fs=require('fs');var fs_extra=require(_0x0d3b('0xa'));var _=require(_0x0d3b('0xb'));var squel=require(_0x0d3b('0xc'));var crypto=require(_0x0d3b('0xd'));var jsforce=require(_0x0d3b('0xe'));var deskjs=require(_0x0d3b('0xf'));var toCsv=require(_0x0d3b('0x10'));var querystring=require(_0x0d3b('0x11'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0x0d3b('0x12'));var Redis=require(_0x0d3b('0x13'));var authService=require(_0x0d3b('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x0d3b('0x15'));var hardwareService=require(_0x0d3b('0x16'));var logger=require(_0x0d3b('0x17'))(_0x0d3b('0x18'));var utils=require(_0x0d3b('0x19'));var config=require(_0x0d3b('0x1a'));var licenseUtil=require(_0x0d3b('0x1b'));var db=require(_0x0d3b('0x1c'))['db'];function respondWithStatusCode(_0x16cc5e,_0x1cc615){_0x1cc615=_0x1cc615||0xcc;return function(_0x16a978){if(_0x16a978){return _0x16cc5e[_0x0d3b('0x1d')](_0x1cc615);}return _0x16cc5e[_0x0d3b('0x1e')](_0x1cc615)['end']();};}function respondWithResult(_0x3764e8,_0x471941){_0x471941=_0x471941||0xc8;return function(_0x2b66e1){if(_0x2b66e1){return _0x3764e8['status'](_0x471941)[_0x0d3b('0x1f')](_0x2b66e1);}};}function respondWithFilteredResult(_0xceef0a,_0xd0e013){return function(_0x21eb6d){if(_0x21eb6d){var _0x20770d=typeof _0xd0e013['offset']===_0x0d3b('0x20')&&typeof _0xd0e013[_0x0d3b('0x21')]===_0x0d3b('0x20');var _0x3ab2e2=_0x21eb6d[_0x0d3b('0x22')];var _0x16c04b=_0x20770d?0x0:_0xd0e013[_0x0d3b('0x23')];var _0x4efa11=_0x20770d?_0x21eb6d['count']:_0xd0e013['offset']+_0xd0e013[_0x0d3b('0x21')];var _0x31af35;if(_0x4efa11>=_0x3ab2e2){_0x4efa11=_0x3ab2e2;_0x31af35=0xc8;}else{_0x31af35=0xce;}_0xceef0a['status'](_0x31af35);return _0xceef0a[_0x0d3b('0x24')](_0x0d3b('0x25'),_0x16c04b+'-'+_0x4efa11+'/'+_0x3ab2e2)[_0x0d3b('0x1f')](_0x21eb6d);}return null;};}function patchUpdates(_0x35a0ac){return function(_0xe5da99){try{jsonpatch['apply'](_0xe5da99,_0x35a0ac,!![]);}catch(_0xd96761){return BPromise[_0x0d3b('0x26')](_0xd96761);}return _0xe5da99[_0x0d3b('0x27')]();};}function saveUpdates(_0xb4b950,_0x3c65e6){return function(_0x498f02){if(_0x498f02){return _0x498f02[_0x0d3b('0x28')](_0xb4b950)['then'](function(_0x1129a3){return _0x1129a3;});}return null;};}function removeEntity(_0x9278d6,_0x3aa5ff){return function(_0x254b8c){if(_0x254b8c){return _0x254b8c['destroy']()['then'](function(){_0x9278d6[_0x0d3b('0x1e')](0xcc)[_0x0d3b('0x29')]();});}};}function handleEntityNotFound(_0x222424,_0x1de6a1){return function(_0x4c8ebf){if(!_0x4c8ebf){_0x222424[_0x0d3b('0x1d')](0x194);}return _0x4c8ebf;};}function handleError(_0x4f39f1,_0x164540){_0x164540=_0x164540||0x1f4;return function(_0x28fcc6){logger[_0x0d3b('0x2a')](_0x28fcc6[_0x0d3b('0x2b')]);if(_0x28fcc6[_0x0d3b('0x2c')]){delete _0x28fcc6[_0x0d3b('0x2c')];}_0x4f39f1['status'](_0x164540)['send'](_0x28fcc6);};}exports[_0x0d3b('0x2d')]=function(_0x37c46c,_0xa35bba){var _0x3a24ff={},_0x3e0186={},_0x3d7a6d={'count':0x0,'rows':[]};var _0x7221c9=_[_0x0d3b('0x2e')](db[_0x0d3b('0x2f')][_0x0d3b('0x30')],function(_0x3de28d){return{'name':_0x3de28d[_0x0d3b('0x31')],'type':_0x3de28d['type']['key']};});_0x3e0186[_0x0d3b('0x32')]=_[_0x0d3b('0x33')](_[_0x0d3b('0x2e')](_0x7221c9,'name'),[_0x0d3b('0x34')]);_0x3e0186[_0x0d3b('0x35')]=_[_0x0d3b('0x36')](_0x37c46c['query']);_0x3e0186[_0x0d3b('0x37')]=_[_0x0d3b('0x38')](_0x3e0186[_0x0d3b('0x32')],_0x3e0186['query']);_0x3a24ff[_0x0d3b('0x39')]=_[_0x0d3b('0x38')](_0x3e0186[_0x0d3b('0x32')],qs[_0x0d3b('0x3a')](_0x37c46c[_0x0d3b('0x35')]['fields']));_0x3a24ff[_0x0d3b('0x39')]=_0x3a24ff[_0x0d3b('0x39')][_0x0d3b('0x3b')]?_0x3a24ff['attributes']:_0x3e0186[_0x0d3b('0x32')];if(!_0x37c46c[_0x0d3b('0x35')][_0x0d3b('0x3c')](_0x0d3b('0x3d'))){_0x3a24ff[_0x0d3b('0x21')]=qs['limit'](_0x37c46c['query'][_0x0d3b('0x21')]);_0x3a24ff[_0x0d3b('0x23')]=qs['offset'](_0x37c46c[_0x0d3b('0x35')][_0x0d3b('0x23')]);}_0x3a24ff[_0x0d3b('0x3e')]=qs[_0x0d3b('0x3f')](_0x37c46c[_0x0d3b('0x35')][_0x0d3b('0x3f')]);_0x3a24ff['where']=qs[_0x0d3b('0x37')](_[_0x0d3b('0x40')](_0x37c46c[_0x0d3b('0x35')],_0x3e0186[_0x0d3b('0x37')]),_0x7221c9);if(_0x37c46c[_0x0d3b('0x35')]['filter']){_0x3a24ff[_0x0d3b('0x41')]=_[_0x0d3b('0x42')](_0x3a24ff[_0x0d3b('0x41')],{'$or':_[_0x0d3b('0x2e')](_0x7221c9,function(_0x4b8abb){if(_0x4b8abb[_0x0d3b('0x43')]!==_0x0d3b('0x44')){var _0x59d40a={};_0x59d40a[_0x4b8abb[_0x0d3b('0x2c')]]={'$like':'%'+_0x37c46c[_0x0d3b('0x35')]['filter']+'%'};return _0x59d40a;}})});}_0x3a24ff=_[_0x0d3b('0x42')]({},_0x3a24ff,_0x37c46c[_0x0d3b('0x45')]);var _0x359f3b={'where':_0x3a24ff[_0x0d3b('0x41')]};return db['VoiceRecording'][_0x0d3b('0x22')](_0x359f3b)[_0x0d3b('0x46')](function(_0x30b6f5){_0x3d7a6d[_0x0d3b('0x22')]=_0x30b6f5;if(_0x37c46c['query'][_0x0d3b('0x47')]){_0x3a24ff[_0x0d3b('0x48')]=[{'all':!![]}];}return db['VoiceRecording'][_0x0d3b('0x49')](_0x3a24ff);})[_0x0d3b('0x46')](function(_0x27764c){_0x3d7a6d[_0x0d3b('0x4a')]=_0x27764c;return _0x3d7a6d;})[_0x0d3b('0x46')](respondWithFilteredResult(_0xa35bba,_0x3a24ff))[_0x0d3b('0x4b')](handleError(_0xa35bba,null));};exports['show']=function(_0xb65553,_0x3b1db9){var _0x6dd8e3={'raw':![],'where':{'id':_0xb65553[_0x0d3b('0x4c')]['id']}},_0x1c85b3={};_0x1c85b3[_0x0d3b('0x32')]=_[_0x0d3b('0x36')](db[_0x0d3b('0x2f')][_0x0d3b('0x30')]);_0x1c85b3[_0x0d3b('0x35')]=_['keys'](_0xb65553[_0x0d3b('0x35')]);_0x1c85b3[_0x0d3b('0x37')]=_[_0x0d3b('0x38')](_0x1c85b3[_0x0d3b('0x32')],_0x1c85b3[_0x0d3b('0x35')]);_0x6dd8e3['attributes']=_[_0x0d3b('0x38')](_0x1c85b3[_0x0d3b('0x32')],qs[_0x0d3b('0x3a')](_0xb65553[_0x0d3b('0x35')][_0x0d3b('0x3a')]));_0x6dd8e3['attributes']=_0x6dd8e3[_0x0d3b('0x39')][_0x0d3b('0x3b')]?_0x6dd8e3[_0x0d3b('0x39')]:_0x1c85b3['model'];if(_0xb65553['query'][_0x0d3b('0x47')]){_0x6dd8e3[_0x0d3b('0x48')]=[{'all':!![]}];}_0x6dd8e3=_[_0x0d3b('0x42')]({},_0x6dd8e3,_0xb65553[_0x0d3b('0x45')]);return db[_0x0d3b('0x2f')][_0x0d3b('0x4d')](_0x6dd8e3)[_0x0d3b('0x46')](handleEntityNotFound(_0x3b1db9,null))[_0x0d3b('0x46')](respondWithResult(_0x3b1db9,null))['catch'](handleError(_0x3b1db9,null));};exports[_0x0d3b('0x4e')]=function(_0x2ab4db,_0x182f74){return db[_0x0d3b('0x2f')][_0x0d3b('0x4e')](_0x2ab4db[_0x0d3b('0x4f')],{})[_0x0d3b('0x46')](respondWithResult(_0x182f74,0xc9))[_0x0d3b('0x4b')](handleError(_0x182f74,null));};exports['update']=function(_0x1c445a,_0x59971c){if(_0x1c445a[_0x0d3b('0x4f')]['id']){delete _0x1c445a[_0x0d3b('0x4f')]['id'];}return db[_0x0d3b('0x2f')][_0x0d3b('0x4d')]({'where':{'id':_0x1c445a[_0x0d3b('0x4c')]['id']}})[_0x0d3b('0x46')](handleEntityNotFound(_0x59971c,null))[_0x0d3b('0x46')](saveUpdates(_0x1c445a[_0x0d3b('0x4f')],null))[_0x0d3b('0x46')](respondWithResult(_0x59971c,null))[_0x0d3b('0x4b')](handleError(_0x59971c,null));};exports[_0x0d3b('0x50')]=function(_0x3de855,_0x54ec5b){return db[_0x0d3b('0x2f')][_0x0d3b('0x50')]()[_0x0d3b('0x46')](respondWithResult(_0x54ec5b,null))[_0x0d3b('0x4b')](handleError(_0x54ec5b,null));};exports[_0x0d3b('0x51')]=function(_0x12825a,_0x3d35c8,_0xba74c5){var _0x41f255=require(_0x0d3b('0x52'));var _0x46ce9f=![];var _0x3fc575={};if(_0x12825a[_0x0d3b('0x35')]['type']&&_0x12825a[_0x0d3b('0x35')][_0x0d3b('0x43')]===_0x0d3b('0x53')){_0x3fc575[_0x0d3b('0x53')]=_0x12825a[_0x0d3b('0x4c')]['id'];}else{_0x3fc575['id']=_0x12825a['params']['id'];}return db[_0x0d3b('0x2f')][_0x0d3b('0x4d')]({'where':_0x3fc575,'attributes':['id',_0x0d3b('0x54')],'raw':!![]})[_0x0d3b('0x46')](handleEntityNotFound(_0x3d35c8,null))[_0x0d3b('0x46')](function(_0x452102){if(_0x452102){var _0x365a3f=_0x452102['value'];var _0x56eee0=util[_0x0d3b('0x34')](_0x0d3b('0x55'),_0x365a3f);if(fs[_0x0d3b('0x56')](_0x56eee0)){_0x46ce9f=!![];return _0x41f255[_0x0d3b('0x57')](_0x56eee0,_0x365a3f,config[_0x0d3b('0x58')][_0x0d3b('0x59')])[_0x0d3b('0x46')](function(){return _0x452102;});}return _0x452102;}})['then'](function(_0x57bbf6){if(_0x57bbf6){var _0x2b2997=_0x57bbf6[_0x0d3b('0x54')];if(!fs['existsSync'](_0x2b2997)){throw new db[(_0x0d3b('0x5a'))][(_0x0d3b('0x5b'))](_0x0d3b('0x5c'));}if(_0x57bbf6['filename']){return _0x3d35c8[_0x0d3b('0x51')](_0x2b2997,_0x57bbf6[_0x0d3b('0x5d')]+path['extname'](_0x2b2997),function(){if(_0x46ce9f){fs[_0x0d3b('0x5e')](_0x2b2997);}});}else{return _0x3d35c8[_0x0d3b('0x51')](_0x2b2997,function(_0x572ec6){if(_0x46ce9f){fs[_0x0d3b('0x5e')](_0x2b2997);}});}}})[_0x0d3b('0x4b')](function(_0x867fd){if(_0x867fd[_0x0d3b('0x5f')]==='VoiceRecording\x20not\x20found'){_0x3d35c8[_0x0d3b('0x1e')](0x194)[_0x0d3b('0x60')]('Not\x20found');}else{return handleError(_0x3d35c8,null);}});};exports[_0x0d3b('0x61')]=function(_0x5748c6,_0x56fd76,_0x5d0737){var _0x2736a6=require('../../components/encryptor');var _0x1db2af=![];var _0x3c7b76={'$and':[db[_0x0d3b('0x62')][_0x0d3b('0x41')](db[_0x0d3b('0x62')]['fn'](_0x0d3b('0x63'),db[_0x0d3b('0x62')][_0x0d3b('0x64')](_0x0d3b('0x53'))),_0x5748c6[_0x0d3b('0x35')]['token'])]};if(_0x5748c6[_0x0d3b('0x35')][_0x0d3b('0x43')]&&_0x5748c6[_0x0d3b('0x35')][_0x0d3b('0x43')]==='uniqueid'){_0x3c7b76[_0x0d3b('0x65')][_0x0d3b('0x66')]({'uniqueid':_0x5748c6[_0x0d3b('0x4c')]['id']});}else{_0x3c7b76[_0x0d3b('0x65')][_0x0d3b('0x66')]({'id':_0x5748c6[_0x0d3b('0x4c')]['id']});}return db[_0x0d3b('0x2f')][_0x0d3b('0x4d')]({'where':_0x3c7b76,'attributes':['id',_0x0d3b('0x54')],'raw':!![]})[_0x0d3b('0x46')](handleEntityNotFound(_0x56fd76,null))[_0x0d3b('0x46')](function(_0x25c215){if(_0x25c215){var _0x110d79=util[_0x0d3b('0x34')](_0x0d3b('0x55'),_0x25c215[_0x0d3b('0x54')]);if(fs[_0x0d3b('0x56')](_0x110d79)){_0x1db2af=!![];return _0x2736a6[_0x0d3b('0x57')](_0x110d79,_0x25c215[_0x0d3b('0x54')],config[_0x0d3b('0x58')][_0x0d3b('0x59')])[_0x0d3b('0x46')](function(){return _0x25c215;});}return _0x25c215;}})['then'](function(_0xa6dadf){if(_0xa6dadf){if(!fs[_0x0d3b('0x56')](_0xa6dadf[_0x0d3b('0x54')])){throw new db[(_0x0d3b('0x5a'))][(_0x0d3b('0x5b'))]('VoiceRecording\x20not\x20found');}if(_0xa6dadf[_0x0d3b('0x5d')]){return _0x56fd76[_0x0d3b('0x51')](_0xa6dadf[_0x0d3b('0x54')],_0xa6dadf[_0x0d3b('0x5d')]+path[_0x0d3b('0x67')](_0xa6dadf['value']),function(){if(_0x1db2af){fs['unlink'](_0xa6dadf[_0x0d3b('0x54')]);}});}else{return _0x56fd76[_0x0d3b('0x51')](_0xa6dadf[_0x0d3b('0x54')],function(_0x338051){if(_0x1db2af){fs[_0x0d3b('0x5e')](_0xa6dadf[_0x0d3b('0x54')]);}});}}})['catch'](handleError(_0x56fd76,null));};exports[_0x0d3b('0x68')]=function(_0x2239d3,_0x18caff){return db['VoiceRecording'][_0x0d3b('0x4d')]({'where':{'id':_0x2239d3[_0x0d3b('0x4c')]['id']}})[_0x0d3b('0x46')](function(_0x58ebdf){if(_['isNil'](_0x58ebdf)){throw new ReferenceError('Entity\x20not\x20found');}return _0x58ebdf;})[_0x0d3b('0x46')](function(_0x2f01fa){var _0xb4422b=_0x2f01fa['value'];logger[_0x0d3b('0x69')](_0x0d3b('0x6a'),_0xb4422b);if(!_['isNil'](_0x2f01fa['value'])&&fs[_0x0d3b('0x56')](_0xb4422b)){logger[_0x0d3b('0x69')]('File:\x20\x22'+_0xb4422b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x0d3b('0x6b')](_0xb4422b);}_0xb4422b=_0xb4422b+_0x0d3b('0x6c');if(!_['isNil'](_0x2f01fa['value'])&&fs[_0x0d3b('0x56')](_0xb4422b)){logger[_0x0d3b('0x69')]('File:\x20\x22'+_0xb4422b+_0x0d3b('0x6d'));fs[_0x0d3b('0x6b')](_0xb4422b);}return _0x2f01fa;})[_0x0d3b('0x46')](function(_0x319db7){if(!_0x319db7)throw new InternalError();return _0x319db7[_0x0d3b('0x68')]();})[_0x0d3b('0x46')](function(){_0x18caff[_0x0d3b('0x1e')](0xcc)[_0x0d3b('0x29')]();})[_0x0d3b('0x4b')](handleError(_0x18caff,null));};function getBucketslist(_0xc193b5,_0x6b5b1d,_0x5ac82c){return new Promise(function(_0x5697c0,_0x4f2323){var _0x4bead6=new AWS['S3']({'accessKeyId':_0x6b5b1d,'secretAccessKey':_0xc193b5,'region':_0x5ac82c});_0x4bead6[_0x0d3b('0x6e')]({},function(_0x3042a0,_0x232a61){if(_0x3042a0){return _0x4f2323(_0x3042a0);}else{return _0x5697c0(_0x232a61);}});});}function createBucket(_0x18a564,_0x2846ea,_0x1c4fa9,_0x1ba014){return new Promise(function(_0x4ca2b0,_0x196521){var _0x57c125=new AWS['S3']({'accessKeyId':_0x2846ea,'secretAccessKey':_0x18a564,'region':_0x1c4fa9});_0x57c125[_0x0d3b('0x6f')]({'Bucket':_0x1ba014},function(_0x3c81e2,_0x41fb81){if(_0x3c81e2){return _0x196521(_0x3c81e2);}else{return _0x4ca2b0(_0x41fb81);}});});}function uploadFile(_0x590742,_0x384147,_0x4e1298,_0x4ed308,_0x1032fc,_0x41a130){return new Promise(function(_0x58b1f3,_0x498b5d){var _0x18c0b6=new AWS['S3']({'accessKeyId':_0x384147,'secretAccessKey':_0x590742,'region':_0x4e1298});_0x18c0b6['upload']({'Bucket':_0x4ed308,'Key':_0x1032fc,'Body':_0x41a130},function(_0x36ce65,_0x384d6e){if(_0x36ce65){return _0x498b5d(_0x36ce65);}else{return _0x58b1f3(_0x384d6e);}});});}function startTranscribe(_0x542b1c,_0x233c65,_0x215ef8,_0x39f003,_0x443356,_0x3bb132){return new Promise(function(_0x5f03b5,_0x1f1c54){var _0x44f202=new AWS[(_0x0d3b('0x70'))]({'accessKeyId':_0x233c65,'secretAccessKey':_0x542b1c,'region':_0x215ef8});_0x44f202['startTranscriptionJob']({'TranscriptionJobName':_0x39f003,'LanguageCode':_0x443356,'Media':{'MediaFileUri':_0x3bb132}},function(_0x2d6b31,_0x48d94b){if(_0x2d6b31){return _0x1f1c54(_0x2d6b31);}else{return _0x5f03b5(_0x48d94b);}});});}function transcribe(_0x279a77,_0x11afc5,_0xf17883,_0x3c8447,_0x2e5676,_0x1045ec,_0x4e15f9){return new Promise(function(_0xf60957,_0x4e7a40){var _0x5c5650={};logger[_0x0d3b('0x69')](util[_0x0d3b('0x34')](_0x0d3b('0x71'),_0x279a77,_0x2e5676));return uploadFile(_0x11afc5,_0xf17883,_0x3c8447,_0x2e5676,path[_0x0d3b('0x72')](_0x1045ec),fs[_0x0d3b('0x73')](_0x1045ec))[_0x0d3b('0x46')](function(_0x34fe10){logger[_0x0d3b('0x69')](util[_0x0d3b('0x34')](_0x0d3b('0x74'),_0x279a77,_0x2e5676,_0x34fe10[_0x0d3b('0x75')]));_0x5c5650[_0x0d3b('0x76')]=_0x34fe10[_0x0d3b('0x77')];_0x5c5650['location']=_0x34fe10[_0x0d3b('0x75')];logger[_0x0d3b('0x69')](util[_0x0d3b('0x34')](_0x0d3b('0x78'),_0x279a77));return startTranscribe(_0x11afc5,_0xf17883,_0x3c8447,uuidv4(),_0x4e15f9,_0x34fe10[_0x0d3b('0x75')]);})[_0x0d3b('0x46')](function(_0x4fb340){logger[_0x0d3b('0x69')](util['format'](_0x0d3b('0x79'),_0x279a77,_0x4fb340['TranscriptionJob']['TranscriptionJobName']));_0x5c5650[_0x0d3b('0x7a')]=_0x4fb340['TranscriptionJob'][_0x0d3b('0x7b')];_0x5c5650[_0x0d3b('0x7c')]=_0x4fb340[_0x0d3b('0x7d')]['TranscriptionJobStatus'];return _0xf60957(_0x5c5650);})[_0x0d3b('0x4b')](function(_0x582055){return _0x4e7a40(_0x582055);});});}exports[_0x0d3b('0x7e')]=function(_0xe57338,_0x17a116,_0x41884e){var _0x4fc27e;var _0x1b7ba3;var _0x2c161a;var _0x5f30e7=require(_0x0d3b('0x52'));return db[_0x0d3b('0x2f')][_0x0d3b('0x7f')]({'where':{'id':_0xe57338[_0x0d3b('0x4c')]['id']}})[_0x0d3b('0x46')](function(_0xa59261){if(_0xa59261){var _0x4af9df=util['format'](_0x0d3b('0x55'),_0xa59261[_0x0d3b('0x54')]);if(fs[_0x0d3b('0x56')](_0x4af9df)){cypher=!![];return _0x5f30e7[_0x0d3b('0x57')](_0x4af9df,_0xa59261['value'],config[_0x0d3b('0x58')][_0x0d3b('0x59')])[_0x0d3b('0x46')](function(){return _0xa59261;});}return _0xa59261;}})[_0x0d3b('0x46')](function(_0xa8a849){if(!_0xa8a849){throw new db[(_0x0d3b('0x5a'))]['ValidationError'](_0x0d3b('0x80'));}_0x1b7ba3=_0xa8a849;return db[_0x0d3b('0x81')][_0x0d3b('0x7f')]({'where':{'id':0x1}});})[_0x0d3b('0x46')](handleEntityNotFound(_0x17a116,null))[_0x0d3b('0x46')](function(_0x2981a3){if(_0x2981a3){_0x4fc27e=_0x2981a3;if(!_0x4fc27e[_0x0d3b('0x82')]||!_0x4fc27e[_0x0d3b('0x83')]||!_0x4fc27e['transcribeRegion']||!_0x4fc27e['language']||!_0x4fc27e[_0x0d3b('0x76')]){throw new db['Sequelize'][(_0x0d3b('0x5b'))](_0x0d3b('0x84'));}if(_0xe57338[_0x0d3b('0x4f')][_0x0d3b('0x85')]&&(!_0x4fc27e[_0x0d3b('0x86')]||!_0x4fc27e['sentimentAccountId']||!_0x4fc27e[_0x0d3b('0x87')]||!_0x4fc27e[_0x0d3b('0x88')]||!_0x4fc27e[_0x0d3b('0x76')])){throw new db['Sequelize'][(_0x0d3b('0x5b'))](_0x0d3b('0x89'));}return db[_0x0d3b('0x8a')][_0x0d3b('0x7f')]({'where':{'id':_0x4fc27e['transcribeAccountId']}});}})[_0x0d3b('0x46')](function(_0x79e5fa){if(!_0x79e5fa){throw new db[(_0x0d3b('0x5a'))][(_0x0d3b('0x5b'))](_0x0d3b('0x8b'));}if(!_0x79e5fa[_0x0d3b('0x8c')]||!_0x79e5fa[_0x0d3b('0x8d')]){throw new db['Sequelize'][(_0x0d3b('0x5b'))]('Cloud\x20Provider\x20not\x20configured');}_0x2c161a=_0x79e5fa;return getBucketslist(_0x2c161a[_0x0d3b('0x8c')],_0x2c161a[_0x0d3b('0x8d')],_0x4fc27e[_0x0d3b('0x8e')]);})[_0x0d3b('0x46')](function(_0x472fb9){if(_0x472fb9&&_0x472fb9[_0x0d3b('0x8f')]){var _0x32f91d=_[_0x0d3b('0x4d')](_0x472fb9[_0x0d3b('0x8f')],function(_0x5e5515){return _0x5e5515[_0x0d3b('0x90')]===_0x4fc27e[_0x0d3b('0x76')];});if(!_0x32f91d){logger[_0x0d3b('0x69')](util[_0x0d3b('0x34')](_0x0d3b('0x91'),_0xe57338[_0x0d3b('0x4c')]['id'],_0x4fc27e['bucket']));return createBucket(_0x2c161a['data1'],_0x2c161a[_0x0d3b('0x8d')],_0x4fc27e[_0x0d3b('0x8e')],_0x4fc27e[_0x0d3b('0x76')]);}logger[_0x0d3b('0x69')](util[_0x0d3b('0x34')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0xe57338[_0x0d3b('0x4c')]['id'],_0x4fc27e[_0x0d3b('0x76')]));return;}})['then'](function(_0x5d2d66){if(_0x1b7ba3[_0x0d3b('0x7c')]===_0x0d3b('0x92')){return transcribe(_0xe57338[_0x0d3b('0x4c')]['id'],_0x2c161a[_0x0d3b('0x8c')],_0x2c161a[_0x0d3b('0x8d')],_0x4fc27e['transcribeRegion'],_0x4fc27e[_0x0d3b('0x76')],_0x1b7ba3[_0x0d3b('0x54')],_0x4fc27e[_0x0d3b('0x88')]);}else{logger['info'](util['format'](_0x0d3b('0x93'),_0xe57338['params']['id']));return{'transcribeStatus':_0x0d3b('0x94')};}})[_0x0d3b('0x46')](function(_0x430230){if(_0x430230){_0x430230[_0x0d3b('0x95')]=_0xe57338[_0x0d3b('0x4f')]['runSentiment'];return _0x1b7ba3[_0x0d3b('0x96')](_0x430230);}})[_0x0d3b('0x46')](respondWithResult(_0x17a116,null))[_0x0d3b('0x4b')](handleError(_0x17a116,null));};function writeFile(_0x23fef4,_0x324cc8){return new Promise(function(_0x19d778,_0x304e03){fs[_0x0d3b('0x97')](_0x324cc8,_0x23fef4,function(_0x40ab58,_0x20d732){if(_0x40ab58){return _0x304e03(_0x40ab58);}else{return _0x19d778(_0x20d732);}});});}exports[_0x0d3b('0x98')]=function(_0x25047a,_0x20390c,_0x5b2140){return db[_0x0d3b('0x2f')][_0x0d3b('0x7f')]({'where':{'id':_0x25047a['params']['id']}})[_0x0d3b('0x46')](handleEntityNotFound(_0x20390c))[_0x0d3b('0x46')](function(_0x44e2fd){if(_0x44e2fd&&_0x44e2fd[_0x0d3b('0x99')]){var _0x6cc5ea=_0x44e2fd[_0x0d3b('0x99')];var _0x2a2a95=config[_0x0d3b('0x9a')]+_0x0d3b('0x9b')+_0x44e2fd['id']+_0x0d3b('0x9c');if(fs['existsSync'](_0x2a2a95)){return _0x2a2a95;}return writeFile(_0x6cc5ea,_0x2a2a95)['then'](function(){return _0x2a2a95;});}else{throw new db['Sequelize'][(_0x0d3b('0x5b'))](_0x0d3b('0x9d'));}})[_0x0d3b('0x46')](function(_0x18c6e3){return _0x20390c[_0x0d3b('0x51')](_0x18c6e3);})[_0x0d3b('0x4b')](handleError(_0x20390c));}; \ No newline at end of file +var _0xac47=['key','differenceBy','format','query','attributes','intersection','model','fields','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','includeAll','VoiceRecording','findAll','rows','catch','show','params','keys','length','include','find','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','Sequelize','ValidationError','filename','extname','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','col','token','$and','push','secrets','recording','download','unlink','destroy','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','aws-sdk','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','then','stack','name','send','map','rawAttributes','fieldName'];(function(_0x270848,_0x3f785e){var _0x58bc7f=function(_0x59ccc1){while(--_0x59ccc1){_0x270848['push'](_0x270848['shift']());}};_0x58bc7f(++_0x3f785e);}(_0xac47,0x1a1));var _0x7ac4=function(_0x2d4eba,_0x348848){_0x2d4eba=_0x2d4eba-0x0;var _0x21141d=_0xac47[_0x2d4eba];return _0x21141d;};'use strict';var emlformat=require(_0x7ac4('0x0'));var rimraf=require(_0x7ac4('0x1'));var zipdir=require(_0x7ac4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ac4('0x3'));var moment=require(_0x7ac4('0x4'));var BPromise=require(_0x7ac4('0x5'));var Mustache=require(_0x7ac4('0x6'));var util=require('util');var path=require(_0x7ac4('0x7'));var sox=require('sox');var csv=require(_0x7ac4('0x8'));var ejs=require(_0x7ac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ac4('0xa'));var squel=require('squel');var crypto=require(_0x7ac4('0xb'));var jsforce=require(_0x7ac4('0xc'));var deskjs=require(_0x7ac4('0xd'));var toCsv=require(_0x7ac4('0x8'));var querystring=require(_0x7ac4('0xe'));var Papa=require('papaparse');var AWS=require(_0x7ac4('0xf'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0x7ac4('0x10'));var qs=require(_0x7ac4('0x11'));var as=require(_0x7ac4('0x12'));var hardwareService=require(_0x7ac4('0x13'));var logger=require(_0x7ac4('0x14'))(_0x7ac4('0x15'));var utils=require(_0x7ac4('0x16'));var config=require(_0x7ac4('0x17'));var licenseUtil=require(_0x7ac4('0x18'));var db=require(_0x7ac4('0x19'))['db'];function respondWithStatusCode(_0x4808e5,_0x3aedc){_0x3aedc=_0x3aedc||0xcc;return function(_0x28eb89){if(_0x28eb89){return _0x4808e5[_0x7ac4('0x1a')](_0x3aedc);}return _0x4808e5[_0x7ac4('0x1b')](_0x3aedc)[_0x7ac4('0x1c')]();};}function respondWithResult(_0x1148a7,_0xb65e0d){_0xb65e0d=_0xb65e0d||0xc8;return function(_0x4dba34){if(_0x4dba34){return _0x1148a7[_0x7ac4('0x1b')](_0xb65e0d)['json'](_0x4dba34);}};}function respondWithFilteredResult(_0x3211e5,_0x24cef6){return function(_0x1bd9f8){if(_0x1bd9f8){var _0x4b7fc5=typeof _0x24cef6[_0x7ac4('0x1d')]===_0x7ac4('0x1e')&&typeof _0x24cef6['limit']===_0x7ac4('0x1e');var _0x3d40ff=_0x1bd9f8[_0x7ac4('0x1f')];var _0x4742a2=_0x4b7fc5?0x0:_0x24cef6[_0x7ac4('0x1d')];var _0x164433=_0x4b7fc5?_0x1bd9f8[_0x7ac4('0x1f')]:_0x24cef6['offset']+_0x24cef6[_0x7ac4('0x20')];var _0x3eaacf;if(_0x164433>=_0x3d40ff){_0x164433=_0x3d40ff;_0x3eaacf=0xc8;}else{_0x3eaacf=0xce;}_0x3211e5[_0x7ac4('0x1b')](_0x3eaacf);return _0x3211e5[_0x7ac4('0x21')]('Content-Range',_0x4742a2+'-'+_0x164433+'/'+_0x3d40ff)[_0x7ac4('0x22')](_0x1bd9f8);}return null;};}function patchUpdates(_0x4d250f){return function(_0x43a51d){try{jsonpatch[_0x7ac4('0x23')](_0x43a51d,_0x4d250f,!![]);}catch(_0x5b43be){return BPromise[_0x7ac4('0x24')](_0x5b43be);}return _0x43a51d[_0x7ac4('0x25')]();};}function saveUpdates(_0x12e554,_0x2bb4db){return function(_0x526749){if(_0x526749){return _0x526749['update'](_0x12e554)[_0x7ac4('0x26')](function(_0x3082fd){return _0x3082fd;});}return null;};}function removeEntity(_0x1571cc,_0x50c72a){return function(_0x1071e2){if(_0x1071e2){return _0x1071e2['destroy']()[_0x7ac4('0x26')](function(){_0x1571cc['status'](0xcc)[_0x7ac4('0x1c')]();});}};}function handleEntityNotFound(_0x4ff11e,_0x772620){return function(_0x4f8109){if(!_0x4f8109){_0x4ff11e[_0x7ac4('0x1a')](0x194);}return _0x4f8109;};}function handleError(_0xaaf08,_0x55a0ff){_0x55a0ff=_0x55a0ff||0x1f4;return function(_0x57b3e8){logger['error'](_0x57b3e8[_0x7ac4('0x27')]);if(_0x57b3e8[_0x7ac4('0x28')]){delete _0x57b3e8[_0x7ac4('0x28')];}_0xaaf08[_0x7ac4('0x1b')](_0x55a0ff)[_0x7ac4('0x29')](_0x57b3e8);};}exports['index']=function(_0x491585,_0x43a27f){var _0x1dffb3={},_0x32b592={},_0x59f298={'count':0x0,'rows':[]};var _0x584177=_[_0x7ac4('0x2a')](db['VoiceRecording'][_0x7ac4('0x2b')],function(_0xe5b477){return{'name':_0xe5b477[_0x7ac4('0x2c')],'type':_0xe5b477['type'][_0x7ac4('0x2d')]};});_0x32b592['model']=_[_0x7ac4('0x2e')](_[_0x7ac4('0x2a')](_0x584177,_0x7ac4('0x28')),[_0x7ac4('0x2f')]);_0x32b592[_0x7ac4('0x30')]=_['keys'](_0x491585[_0x7ac4('0x30')]);_0x32b592['filters']=_['intersection'](_0x32b592['model'],_0x32b592[_0x7ac4('0x30')]);_0x1dffb3[_0x7ac4('0x31')]=_[_0x7ac4('0x32')](_0x32b592[_0x7ac4('0x33')],qs[_0x7ac4('0x34')](_0x491585[_0x7ac4('0x30')][_0x7ac4('0x34')]));_0x1dffb3[_0x7ac4('0x31')]=_0x1dffb3[_0x7ac4('0x31')]['length']?_0x1dffb3['attributes']:_0x32b592['model'];if(!_0x491585[_0x7ac4('0x30')]['hasOwnProperty']('nolimit')){_0x1dffb3[_0x7ac4('0x20')]=qs[_0x7ac4('0x20')](_0x491585[_0x7ac4('0x30')][_0x7ac4('0x20')]);_0x1dffb3['offset']=qs[_0x7ac4('0x1d')](_0x491585[_0x7ac4('0x30')][_0x7ac4('0x1d')]);}_0x1dffb3[_0x7ac4('0x35')]=qs[_0x7ac4('0x36')](_0x491585[_0x7ac4('0x30')][_0x7ac4('0x36')]);_0x1dffb3['where']=qs['filters'](_[_0x7ac4('0x37')](_0x491585['query'],_0x32b592[_0x7ac4('0x38')]),_0x584177);if(_0x491585['query'][_0x7ac4('0x39')]){_0x1dffb3[_0x7ac4('0x3a')]=_[_0x7ac4('0x3b')](_0x1dffb3[_0x7ac4('0x3a')],{'$or':_[_0x7ac4('0x2a')](_0x584177,function(_0x425d8a){if(_0x425d8a[_0x7ac4('0x3c')]!==_0x7ac4('0x3d')){var _0xf836a5={};_0xf836a5[_0x425d8a[_0x7ac4('0x28')]]={'$like':'%'+_0x491585[_0x7ac4('0x30')][_0x7ac4('0x39')]+'%'};return _0xf836a5;}})});}_0x1dffb3=_[_0x7ac4('0x3b')]({},_0x1dffb3,_0x491585[_0x7ac4('0x3e')]);var _0x50dd75={'where':_0x1dffb3[_0x7ac4('0x3a')]};return db['VoiceRecording'][_0x7ac4('0x1f')](_0x50dd75)[_0x7ac4('0x26')](function(_0x3e6f70){_0x59f298['count']=_0x3e6f70;if(_0x491585[_0x7ac4('0x30')][_0x7ac4('0x3f')]){_0x1dffb3['include']=[{'all':!![]}];}return db[_0x7ac4('0x40')][_0x7ac4('0x41')](_0x1dffb3);})[_0x7ac4('0x26')](function(_0x2cd8f2){_0x59f298[_0x7ac4('0x42')]=_0x2cd8f2;return _0x59f298;})[_0x7ac4('0x26')](respondWithFilteredResult(_0x43a27f,_0x1dffb3))[_0x7ac4('0x43')](handleError(_0x43a27f,null));};exports[_0x7ac4('0x44')]=function(_0x257a17,_0xfa9e8a){var _0x57dbb7={'raw':![],'where':{'id':_0x257a17[_0x7ac4('0x45')]['id']}},_0x3734b0={};_0x3734b0[_0x7ac4('0x33')]=_[_0x7ac4('0x46')](db[_0x7ac4('0x40')][_0x7ac4('0x2b')]);_0x3734b0[_0x7ac4('0x30')]=_['keys'](_0x257a17['query']);_0x3734b0[_0x7ac4('0x38')]=_['intersection'](_0x3734b0[_0x7ac4('0x33')],_0x3734b0[_0x7ac4('0x30')]);_0x57dbb7[_0x7ac4('0x31')]=_[_0x7ac4('0x32')](_0x3734b0[_0x7ac4('0x33')],qs['fields'](_0x257a17[_0x7ac4('0x30')][_0x7ac4('0x34')]));_0x57dbb7['attributes']=_0x57dbb7[_0x7ac4('0x31')][_0x7ac4('0x47')]?_0x57dbb7[_0x7ac4('0x31')]:_0x3734b0[_0x7ac4('0x33')];if(_0x257a17['query'][_0x7ac4('0x3f')]){_0x57dbb7[_0x7ac4('0x48')]=[{'all':!![]}];}_0x57dbb7=_['merge']({},_0x57dbb7,_0x257a17[_0x7ac4('0x3e')]);return db['VoiceRecording'][_0x7ac4('0x49')](_0x57dbb7)['then'](handleEntityNotFound(_0xfa9e8a,null))[_0x7ac4('0x26')](respondWithResult(_0xfa9e8a,null))[_0x7ac4('0x43')](handleError(_0xfa9e8a,null));};exports[_0x7ac4('0x4a')]=function(_0x12d171,_0x166bf8){return db['VoiceRecording'][_0x7ac4('0x4a')](_0x12d171['body'],{})['then'](respondWithResult(_0x166bf8,0xc9))['catch'](handleError(_0x166bf8,null));};exports['update']=function(_0x39e693,_0x35668c){if(_0x39e693[_0x7ac4('0x4b')]['id']){delete _0x39e693[_0x7ac4('0x4b')]['id'];}return db[_0x7ac4('0x40')][_0x7ac4('0x49')]({'where':{'id':_0x39e693[_0x7ac4('0x45')]['id']}})[_0x7ac4('0x26')](handleEntityNotFound(_0x35668c,null))[_0x7ac4('0x26')](saveUpdates(_0x39e693[_0x7ac4('0x4b')],null))['then'](respondWithResult(_0x35668c,null))[_0x7ac4('0x43')](handleError(_0x35668c,null));};exports['describe']=function(_0xf17260,_0x390714){return db[_0x7ac4('0x40')][_0x7ac4('0x4c')]()[_0x7ac4('0x26')](respondWithResult(_0x390714,null))['catch'](handleError(_0x390714,null));};exports['download']=function(_0xd9c3b8,_0x52872d,_0x5159d6){var _0x4d9e25=require(_0x7ac4('0x4d'));var _0x238771=![];var _0x16c112={};if(_0xd9c3b8[_0x7ac4('0x30')]['type']&&_0xd9c3b8['query'][_0x7ac4('0x3c')]===_0x7ac4('0x4e')){_0x16c112[_0x7ac4('0x4e')]=_0xd9c3b8[_0x7ac4('0x45')]['id'];}else{_0x16c112['id']=_0xd9c3b8[_0x7ac4('0x45')]['id'];}return db[_0x7ac4('0x40')]['find']({'where':_0x16c112,'attributes':['id',_0x7ac4('0x4f')],'raw':!![]})[_0x7ac4('0x26')](handleEntityNotFound(_0x52872d,null))[_0x7ac4('0x26')](function(_0x38408f){if(_0x38408f){var _0x44bf57=_0x38408f[_0x7ac4('0x4f')];var _0x487239=util['format'](_0x7ac4('0x50'),_0x44bf57);if(fs[_0x7ac4('0x51')](_0x487239)){_0x238771=!![];return _0x4d9e25[_0x7ac4('0x52')](_0x487239,_0x44bf57,config['secrets']['recording'])['then'](function(){return _0x38408f;});}return _0x38408f;}})['then'](function(_0x554e0c){if(_0x554e0c){var _0x21de69=_0x554e0c['value'];if(!fs[_0x7ac4('0x51')](_0x21de69)){throw new db[(_0x7ac4('0x53'))][(_0x7ac4('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x554e0c[_0x7ac4('0x55')]){return _0x52872d['download'](_0x21de69,_0x554e0c[_0x7ac4('0x55')]+path[_0x7ac4('0x56')](_0x21de69),function(){if(_0x238771){fs['unlink'](_0x21de69);}});}else{return _0x52872d['download'](_0x21de69,function(_0x4e6bb9){if(_0x238771){fs['unlink'](_0x21de69);}});}}})[_0x7ac4('0x43')](function(_0x203f0c){if(_0x203f0c[_0x7ac4('0x57')]===_0x7ac4('0x58')){_0x52872d['status'](0x194)[_0x7ac4('0x29')](_0x7ac4('0x59'));}else{return handleError(_0x52872d,null);}});};exports[_0x7ac4('0x5a')]=function(_0x27b8e5,_0x219d74,_0x22dfe0){var _0x490ef1=require(_0x7ac4('0x4d'));var _0x2d4449=![];var _0x50dac3={'$and':[db['sequelize'][_0x7ac4('0x3a')](db['sequelize']['fn']('MD5',db[_0x7ac4('0x5b')][_0x7ac4('0x5c')](_0x7ac4('0x4e'))),_0x27b8e5[_0x7ac4('0x30')][_0x7ac4('0x5d')])]};if(_0x27b8e5['query']['type']&&_0x27b8e5['query']['type']===_0x7ac4('0x4e')){_0x50dac3[_0x7ac4('0x5e')][_0x7ac4('0x5f')]({'uniqueid':_0x27b8e5[_0x7ac4('0x45')]['id']});}else{_0x50dac3[_0x7ac4('0x5e')]['push']({'id':_0x27b8e5['params']['id']});}return db[_0x7ac4('0x40')][_0x7ac4('0x49')]({'where':_0x50dac3,'attributes':['id',_0x7ac4('0x4f')],'raw':!![]})[_0x7ac4('0x26')](handleEntityNotFound(_0x219d74,null))[_0x7ac4('0x26')](function(_0x4778b3){if(_0x4778b3){var _0x4e7883=util[_0x7ac4('0x2f')](_0x7ac4('0x50'),_0x4778b3[_0x7ac4('0x4f')]);if(fs[_0x7ac4('0x51')](_0x4e7883)){_0x2d4449=!![];return _0x490ef1['decryptFile'](_0x4e7883,_0x4778b3[_0x7ac4('0x4f')],config[_0x7ac4('0x60')][_0x7ac4('0x61')])[_0x7ac4('0x26')](function(){return _0x4778b3;});}return _0x4778b3;}})[_0x7ac4('0x26')](function(_0x1de32b){if(_0x1de32b){if(!fs[_0x7ac4('0x51')](_0x1de32b[_0x7ac4('0x4f')])){throw new db['Sequelize'][(_0x7ac4('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x1de32b[_0x7ac4('0x55')]){return _0x219d74[_0x7ac4('0x62')](_0x1de32b[_0x7ac4('0x4f')],_0x1de32b[_0x7ac4('0x55')]+path[_0x7ac4('0x56')](_0x1de32b[_0x7ac4('0x4f')]),function(){if(_0x2d4449){fs[_0x7ac4('0x63')](_0x1de32b[_0x7ac4('0x4f')]);}});}else{return _0x219d74[_0x7ac4('0x62')](_0x1de32b[_0x7ac4('0x4f')],function(_0x2245e3){if(_0x2d4449){fs[_0x7ac4('0x63')](_0x1de32b[_0x7ac4('0x4f')]);}});}}})[_0x7ac4('0x43')](handleError(_0x219d74,null));};exports[_0x7ac4('0x64')]=function(_0x30053d,_0x546ce5){return db['VoiceRecording'][_0x7ac4('0x49')]({'where':{'id':_0x30053d[_0x7ac4('0x45')]['id']}})[_0x7ac4('0x26')](function(_0x2c15ce){if(_[_0x7ac4('0x65')](_0x2c15ce)){throw new ReferenceError(_0x7ac4('0x66'));}return _0x2c15ce;})[_0x7ac4('0x26')](function(_0x15e07e){var _0x2eff2d=_0x15e07e[_0x7ac4('0x4f')];logger[_0x7ac4('0x67')]('cancellazione\x20fisica\x20documento\x20%s',_0x2eff2d);if(!_[_0x7ac4('0x65')](_0x15e07e['value'])&&fs[_0x7ac4('0x51')](_0x2eff2d)){logger[_0x7ac4('0x67')](_0x7ac4('0x68')+_0x2eff2d+_0x7ac4('0x69'));fs[_0x7ac4('0x6a')](_0x2eff2d);}_0x2eff2d=_0x2eff2d+_0x7ac4('0x6b');if(!_['isNil'](_0x15e07e['value'])&&fs[_0x7ac4('0x51')](_0x2eff2d)){logger['info'](_0x7ac4('0x68')+_0x2eff2d+_0x7ac4('0x69'));fs[_0x7ac4('0x6a')](_0x2eff2d);}return _0x15e07e;})[_0x7ac4('0x26')](function(_0x568680){if(!_0x568680)throw new InternalError();return _0x568680[_0x7ac4('0x64')]();})['then'](function(){_0x546ce5[_0x7ac4('0x1b')](0xcc)[_0x7ac4('0x1c')]();})[_0x7ac4('0x43')](handleError(_0x546ce5,null));};function getBucketslist(_0x3b5c52,_0x20e7b5,_0x4f692e){return new Promise(function(_0x363735,_0x2f6247){var _0x44e1dd=new AWS['S3']({'accessKeyId':_0x20e7b5,'secretAccessKey':_0x3b5c52,'region':_0x4f692e});_0x44e1dd[_0x7ac4('0x6c')]({},function(_0xb38e67,_0x58a639){if(_0xb38e67){return _0x2f6247(_0xb38e67);}else{return _0x363735(_0x58a639);}});});}function createBucket(_0x2b586d,_0x557649,_0x4675e5,_0x55675f){return new Promise(function(_0x49c94e,_0x2d914d){var _0x1b410e=new AWS['S3']({'accessKeyId':_0x557649,'secretAccessKey':_0x2b586d,'region':_0x4675e5});_0x1b410e[_0x7ac4('0x6d')]({'Bucket':_0x55675f},function(_0xf83917,_0x2dcf77){if(_0xf83917){return _0x2d914d(_0xf83917);}else{return _0x49c94e(_0x2dcf77);}});});}function uploadFile(_0x4c26ba,_0x5bc6d1,_0x587022,_0x43f6a6,_0x1ab96f,_0x37895f){return new Promise(function(_0x1921a6,_0xd2ff55){var _0x1eb10c=new AWS['S3']({'accessKeyId':_0x5bc6d1,'secretAccessKey':_0x4c26ba,'region':_0x587022});_0x1eb10c[_0x7ac4('0x6e')]({'Bucket':_0x43f6a6,'Key':_0x1ab96f,'Body':_0x37895f},function(_0xac10a7,_0x37bb9b){if(_0xac10a7){return _0xd2ff55(_0xac10a7);}else{return _0x1921a6(_0x37bb9b);}});});}function startTranscribe(_0x2c478d,_0x1a13e8,_0x44cd97,_0x544a8a,_0x4fa0e8,_0x1c0789){return new Promise(function(_0x13bc35,_0xeb4fff){var _0xa2894a=new AWS[(_0x7ac4('0x6f'))]({'accessKeyId':_0x1a13e8,'secretAccessKey':_0x2c478d,'region':_0x44cd97});_0xa2894a[_0x7ac4('0x70')]({'TranscriptionJobName':_0x544a8a,'LanguageCode':_0x4fa0e8,'Media':{'MediaFileUri':_0x1c0789}},function(_0x5e350c,_0x2dde0a){if(_0x5e350c){return _0xeb4fff(_0x5e350c);}else{return _0x13bc35(_0x2dde0a);}});});}function transcribe(_0x5cfd59,_0x55d3e7,_0x43c3e3,_0x40c0c2,_0x4cbaf2,_0x82506a,_0x264d98){return new Promise(function(_0x2cd032,_0x5e105c){var _0x295399={};logger[_0x7ac4('0x67')](util[_0x7ac4('0x2f')](_0x7ac4('0x71'),_0x5cfd59,_0x4cbaf2));return uploadFile(_0x55d3e7,_0x43c3e3,_0x40c0c2,_0x4cbaf2,path[_0x7ac4('0x72')](_0x82506a),fs[_0x7ac4('0x73')](_0x82506a))[_0x7ac4('0x26')](function(_0xf36314){logger[_0x7ac4('0x67')](util[_0x7ac4('0x2f')](_0x7ac4('0x74'),_0x5cfd59,_0x4cbaf2,_0xf36314[_0x7ac4('0x75')]));_0x295399[_0x7ac4('0x76')]=_0xf36314[_0x7ac4('0x77')];_0x295399[_0x7ac4('0x78')]=_0xf36314[_0x7ac4('0x75')];logger[_0x7ac4('0x67')](util[_0x7ac4('0x2f')](_0x7ac4('0x79'),_0x5cfd59));return startTranscribe(_0x55d3e7,_0x43c3e3,_0x40c0c2,uuidv4(),_0x264d98,_0xf36314[_0x7ac4('0x75')]);})[_0x7ac4('0x26')](function(_0x423e9a){logger[_0x7ac4('0x67')](util[_0x7ac4('0x2f')](_0x7ac4('0x7a'),_0x5cfd59,_0x423e9a[_0x7ac4('0x7b')][_0x7ac4('0x7c')]));_0x295399[_0x7ac4('0x7d')]=_0x423e9a[_0x7ac4('0x7b')][_0x7ac4('0x7c')];_0x295399[_0x7ac4('0x7e')]=_0x423e9a['TranscriptionJob'][_0x7ac4('0x7f')];return _0x2cd032(_0x295399);})[_0x7ac4('0x43')](function(_0x4e69a2){return _0x5e105c(_0x4e69a2);});});}exports[_0x7ac4('0x80')]=function(_0x56fe0c,_0xa3f163,_0xd0e5ee){var _0x2fa664;var _0x1e36a0;var _0x188047;var _0x161954=require(_0x7ac4('0x4d'));return db[_0x7ac4('0x40')][_0x7ac4('0x81')]({'where':{'id':_0x56fe0c[_0x7ac4('0x45')]['id']}})['then'](function(_0x345742){if(_0x345742){var _0x192a5e=util['format'](_0x7ac4('0x50'),_0x345742[_0x7ac4('0x4f')]);if(fs['existsSync'](_0x192a5e)){cypher=!![];return _0x161954[_0x7ac4('0x52')](_0x192a5e,_0x345742[_0x7ac4('0x4f')],config[_0x7ac4('0x60')][_0x7ac4('0x61')])[_0x7ac4('0x26')](function(){return _0x345742;});}return _0x345742;}})[_0x7ac4('0x26')](function(_0x58323b){if(!_0x58323b){throw new db[(_0x7ac4('0x53'))][(_0x7ac4('0x54'))]('Voice\x20Recording\x20not\x20found');}_0x1e36a0=_0x58323b;return db[_0x7ac4('0x82')][_0x7ac4('0x81')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0xa3f163,null))[_0x7ac4('0x26')](function(_0x189c96){if(_0x189c96){_0x2fa664=_0x189c96;if(!_0x2fa664['transcribe']||!_0x2fa664[_0x7ac4('0x83')]||!_0x2fa664[_0x7ac4('0x84')]||!_0x2fa664[_0x7ac4('0x85')]||!_0x2fa664[_0x7ac4('0x76')]){throw new db[(_0x7ac4('0x53'))][(_0x7ac4('0x54'))](_0x7ac4('0x86'));}if(_0x56fe0c['body'][_0x7ac4('0x87')]&&(!_0x2fa664[_0x7ac4('0x88')]||!_0x2fa664['sentimentAccountId']||!_0x2fa664[_0x7ac4('0x89')]||!_0x2fa664[_0x7ac4('0x85')]||!_0x2fa664[_0x7ac4('0x76')])){throw new db['Sequelize'][(_0x7ac4('0x54'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider']['findOne']({'where':{'id':_0x2fa664[_0x7ac4('0x83')]}});}})[_0x7ac4('0x26')](function(_0x4b5e71){if(!_0x4b5e71){throw new db[(_0x7ac4('0x53'))][(_0x7ac4('0x54'))](_0x7ac4('0x8a'));}if(!_0x4b5e71[_0x7ac4('0x8b')]||!_0x4b5e71[_0x7ac4('0x8c')]){throw new db[(_0x7ac4('0x53'))][(_0x7ac4('0x54'))](_0x7ac4('0x8d'));}_0x188047=_0x4b5e71;return getBucketslist(_0x188047[_0x7ac4('0x8b')],_0x188047['data2'],_0x2fa664[_0x7ac4('0x84')]);})['then'](function(_0x4bbebe){if(_0x4bbebe&&_0x4bbebe[_0x7ac4('0x8e')]){var _0x12504a=_[_0x7ac4('0x49')](_0x4bbebe[_0x7ac4('0x8e')],function(_0xf6d4f7){return _0xf6d4f7[_0x7ac4('0x8f')]===_0x2fa664['bucket'];});if(!_0x12504a){logger[_0x7ac4('0x67')](util['format'](_0x7ac4('0x90'),_0x56fe0c[_0x7ac4('0x45')]['id'],_0x2fa664['bucket']));return createBucket(_0x188047['data1'],_0x188047[_0x7ac4('0x8c')],_0x2fa664[_0x7ac4('0x84')],_0x2fa664[_0x7ac4('0x76')]);}logger[_0x7ac4('0x67')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x56fe0c[_0x7ac4('0x45')]['id'],_0x2fa664[_0x7ac4('0x76')]));return;}})['then'](function(_0x1283fb){if(_0x1e36a0[_0x7ac4('0x7e')]===_0x7ac4('0x91')){return transcribe(_0x56fe0c[_0x7ac4('0x45')]['id'],_0x188047[_0x7ac4('0x8b')],_0x188047[_0x7ac4('0x8c')],_0x2fa664[_0x7ac4('0x84')],_0x2fa664[_0x7ac4('0x76')],_0x1e36a0['value'],_0x2fa664['language']);}else{logger[_0x7ac4('0x67')](util[_0x7ac4('0x2f')](_0x7ac4('0x92'),_0x56fe0c[_0x7ac4('0x45')]['id']));return{'transcribeStatus':_0x7ac4('0x93')};}})[_0x7ac4('0x26')](function(_0x21f55e){if(_0x21f55e){_0x21f55e['tempSentiment']=_0x56fe0c[_0x7ac4('0x4b')][_0x7ac4('0x87')];return _0x1e36a0['updateAttributes'](_0x21f55e);}})[_0x7ac4('0x26')](respondWithResult(_0xa3f163,null))[_0x7ac4('0x43')](handleError(_0xa3f163,null));};function writeFile(_0x589490,_0x1158d1){return new Promise(function(_0x9332e8,_0x4ea38e){fs[_0x7ac4('0x94')](_0x1158d1,_0x589490,function(_0x3c6372,_0xb32078){if(_0x3c6372){return _0x4ea38e(_0x3c6372);}else{return _0x9332e8(_0xb32078);}});});}exports[_0x7ac4('0x95')]=function(_0x433484,_0xdfb92a,_0x3716cf){return db['VoiceRecording'][_0x7ac4('0x81')]({'where':{'id':_0x433484[_0x7ac4('0x45')]['id']}})[_0x7ac4('0x26')](handleEntityNotFound(_0xdfb92a))[_0x7ac4('0x26')](function(_0x5a2887){if(_0x5a2887&&_0x5a2887[_0x7ac4('0x96')]){var _0x4396a1=_0x5a2887['fileText'];var _0x2d037c=config['root']+_0x7ac4('0x97')+_0x5a2887['id']+_0x7ac4('0x98');if(fs[_0x7ac4('0x51')](_0x2d037c)){return _0x2d037c;}return writeFile(_0x4396a1,_0x2d037c)[_0x7ac4('0x26')](function(){return _0x2d037c;});}else{throw new db[(_0x7ac4('0x53'))]['ValidationError'](_0x7ac4('0x99'));}})[_0x7ac4('0x26')](function(_0x7c937e){return _0xdfb92a[_0x7ac4('0x62')](_0x7c937e);})[_0x7ac4('0x43')](handleError(_0xdfb92a));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index d074e94..3c0b890 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 _0xfa7c=['define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0x1e02d0,_0x3a289c){var _0x3a77ab=function(_0x248895){while(--_0x248895){_0x1e02d0['push'](_0x1e02d0['shift']());}};_0x3a77ab(++_0x3a289c);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x2d3035,_0x4fcc7c){_0x2d3035=_0x2d3035-0x0;var _0x1bf2cf=_0xfa7c[_0x2d3035];return _0x1bf2cf;};'use strict';var attributes=require(_0xcfa7('0x0'));module['exports']=function(_0x46e1f9,_0x118a1a){return _0x46e1f9[_0xcfa7('0x1')](_0xcfa7('0x2'),attributes,{'tableName':_0xcfa7('0x3'),'paranoid':![],'indexes':[{'name':_0xcfa7('0x4'),'fields':[_0xcfa7('0x4')]},{'name':_0xcfa7('0x5'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0x66fa=['./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','transcribeStatus'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x66fa,0x168));var _0xa66f=function(_0x5c2eb6,_0x59ccbc){_0x5c2eb6=_0x5c2eb6-0x0;var _0xd372a8=_0x66fa[_0x5c2eb6];return _0xd372a8;};'use strict';var attributes=require(_0xa66f('0x0'));module[_0xa66f('0x1')]=function(_0xab19a,_0x4d9703){return _0xab19a['define'](_0xa66f('0x2'),attributes,{'tableName':_0xa66f('0x3'),'paranoid':![],'indexes':[{'name':_0xa66f('0x4'),'fields':[_0xa66f('0x4')]},{'name':_0xa66f('0x5'),'fields':[_0xa66f('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index dba62a1..069f4c9 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 _0xeb3b=['rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','raw','options','attributes','limit','stringify','../../components/encryptor','findOne','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','debug','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x2ba665,_0x30361e){var _0xc5e4f5=function(_0x416a73){while(--_0x416a73){_0x2ba665['push'](_0x2ba665['shift']());}};_0xc5e4f5(++_0x30361e);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x40bdb3,_0x5a81f2){_0x40bdb3=_0x40bdb3-0x0;var _0xeac086=_0xeb3b[_0x40bdb3];return _0xeac086;};'use strict';var _=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var moment=require(_0xbeb3('0x2'));var BPromise=require(_0xbeb3('0x3'));var rs=require(_0xbeb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeb3('0x5'));var logger=require('../../config/logger')(_0xbeb3('0x6'));var config=require('../../config/environment');var jayson=require(_0xbeb3('0x7'));var client=jayson[_0xbeb3('0x8')][_0xbeb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x294cc9,_0x406927,_0x143255){return new BPromise(function(_0x5a6a06,_0x241dbb){return client[_0xbeb3('0xa')](_0x294cc9,_0x143255)[_0xbeb3('0xb')](function(_0x3b61ac){logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,_0xbeb3('0xe'));logger['debug'](_0xbeb3('0xf'),_0x406927,_0xbeb3('0xe'),JSON['stringify'](_0x3b61ac));if(_0x3b61ac[_0xbeb3('0x10')]){if(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x11')]===0x1f4){logger[_0xbeb3('0x10')](_0xbeb3('0xd'),_0x406927,_0x3b61ac[_0xbeb3('0x10')]['message']);return _0x241dbb(_0x3b61ac['error'][_0xbeb3('0x12')]);}logger[_0xbeb3('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x406927,_0x3b61ac['error'][_0xbeb3('0x12')]);return _0x5a6a06(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x12')]);}else{logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,'request\x20sent');_0x5a6a06(_0x3b61ac[_0xbeb3('0x13')]['message']);}})[_0xbeb3('0x14')](function(_0x4e7d99){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x406927,_0x4e7d99);_0x241dbb(_0x4e7d99);});});}exports[_0xbeb3('0x15')]=function(_0x44a4bb){var _0x32275b=this;return new Promise(function(_0x10b15d,_0x5d0689){return db[_0xbeb3('0x16')][_0xbeb3('0x17')](_0x44a4bb[_0xbeb3('0x18')],{'raw':_0x44a4bb['options']?_0x44a4bb['options'][_0xbeb3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44a4bb['options']?_0x44a4bb[_0xbeb3('0x1a')]['where']||null:null,'attributes':_0x44a4bb['options']?_0x44a4bb[_0xbeb3('0x1a')][_0xbeb3('0x1b')]||null:null,'limit':_0x44a4bb[_0xbeb3('0x1a')]?_0x44a4bb['options'][_0xbeb3('0x1c')]||null:null})[_0xbeb3('0xb')](function(_0x5e047e){logger[_0xbeb3('0xc')](_0xbeb3('0x15'),_0x44a4bb);logger['debug'](_0xbeb3('0x15'),_0x44a4bb,JSON[_0xbeb3('0x1d')](_0x5e047e));_0x10b15d(_0x5e047e);})[_0xbeb3('0x14')](function(_0x42c6c3){logger[_0xbeb3('0x10')](_0xbeb3('0x15'),_0x42c6c3[_0xbeb3('0x12')],_0x44a4bb);_0x5d0689(_0x32275b[_0xbeb3('0x10')](0x1f4,_0x42c6c3[_0xbeb3('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x4e695e){var _0x1f36b9=this;return new Promise(function(_0x520116,_0x3e7f7d){var _0xda808c=require(_0xbeb3('0x1e'));var _0x400f65;return db['Setting'][_0xbeb3('0x1f')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xbeb3('0xb')](function(_0xab301c){_0x400f65=_0xab301c;return db['VoiceRecording']['create'](_0x4e695e[_0xbeb3('0x18')]);})['then'](function(_0x51f7ef){if(_0x400f65['callRecordingEncryption']&&fs['existsSync'](_0x51f7ef[_0xbeb3('0x20')])){var _0x4e9a04=util[_0xbeb3('0x21')](_0xbeb3('0x22'),_0x51f7ef[_0xbeb3('0x20')]);return _0xda808c[_0xbeb3('0x23')](_0x51f7ef[_0xbeb3('0x20')],_0x4e9a04,config[_0xbeb3('0x24')][_0xbeb3('0x25')])[_0xbeb3('0xb')](function(){fs[_0xbeb3('0x26')](_0x51f7ef[_0xbeb3('0x20')]);logger['info'](_0xbeb3('0x27'));return _0x51f7ef;});}return _0x51f7ef;})[_0xbeb3('0xb')](function(_0x5821dd){logger[_0xbeb3('0xc')](_0xbeb3('0x28'),_0x4e695e);logger[_0xbeb3('0x29')](_0xbeb3('0x28'),_0x4e695e,JSON['stringify'](_0x5821dd));_0x520116(_0x5821dd);})[_0xbeb3('0x14')](function(_0x18f2be){logger[_0xbeb3('0x10')](_0xbeb3('0x28'),_0x18f2be[_0xbeb3('0x12')],_0x4e695e);_0x3e7f7d(_0x1f36b9[_0xbeb3('0x10')](0x1f4,_0x18f2be[_0xbeb3('0x12')]));});});}; \ No newline at end of file +var _0x2ef3=['options','raw','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','create','existsSync','value','format','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','VoiceRecording,\x20%s,\x20%s','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateVoiceRecording','VoiceRecording','body'];(function(_0x12d812,_0x496bb7){var _0x3711ab=function(_0x3259da){while(--_0x3259da){_0x12d812['push'](_0x12d812['shift']());}};_0x3711ab(++_0x496bb7);}(_0x2ef3,0xba));var _0x32ef=function(_0xa068f9,_0x5424e7){_0xa068f9=_0xa068f9-0x0;var _0x6f57d7=_0x2ef3[_0xa068f9];return _0x6f57d7;};'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')]('VoiceRecording,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['update'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')]['where']||null:null,'attributes':_0x1a9476[_0x32ef('0x18')]?_0x1a9476['options'][_0x32ef('0x1a')]||null:null,'limit':_0x1a9476[_0x32ef('0x18')]?_0x1a9476['options'][_0x32ef('0x1b')]||null:null})[_0x32ef('0xb')](function(_0x5e8898){logger['info']('UpdateVoiceRecording',_0x1a9476);logger[_0x32ef('0x1c')](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x5e8898));_0x57863c(_0x5e8898);})['catch'](function(_0x59585f){logger[_0x32ef('0x11')]('UpdateVoiceRecording',_0x59585f['message'],_0x1a9476);_0xbe37f6(_0x286bfb[_0x32ef('0x11')](0x1f4,_0x59585f[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1d')]=function(_0x1dbe98){var _0x15ce54=this;return new Promise(function(_0x234175,_0x1874ea){var _0x38aed5=require(_0x32ef('0x1e'));var _0x2f52d7;return db[_0x32ef('0x1f')][_0x32ef('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x32ef('0xb')](function(_0x2f5d06){_0x2f52d7=_0x2f5d06;return db['VoiceRecording'][_0x32ef('0x21')](_0x1dbe98[_0x32ef('0x17')]);})[_0x32ef('0xb')](function(_0x26e207){if(_0x2f52d7['callRecordingEncryption']&&fs[_0x32ef('0x22')](_0x26e207[_0x32ef('0x23')])){var _0x31dbc3=util[_0x32ef('0x24')](_0x32ef('0x25'),_0x26e207[_0x32ef('0x23')]);return _0x38aed5[_0x32ef('0x26')](_0x26e207['value'],_0x31dbc3,config[_0x32ef('0x27')]['recording'])[_0x32ef('0xb')](function(){fs[_0x32ef('0x28')](_0x26e207['value']);logger[_0x32ef('0xc')](_0x32ef('0x29'));return _0x26e207;});}return _0x26e207;})[_0x32ef('0xb')](function(_0x20b467){logger[_0x32ef('0xc')]('CreateVoiceRecording',_0x1dbe98);logger['debug'](_0x32ef('0x1d'),_0x1dbe98,JSON['stringify'](_0x20b467));_0x234175(_0x20b467);})[_0x32ef('0x14')](function(_0x15b873){logger[_0x32ef('0x11')](_0x32ef('0x1d'),_0x15b873[_0x32ef('0x13')],_0x1dbe98);_0x1874ea(_0x15ce54[_0x32ef('0x11')](0x1f4,_0x15b873['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 176a30c..036ec6b 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 _0x19ea=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','show','post','put','update','delete','/:id','destroy','exports'];(function(_0xd1cf76,_0x1e667d){var _0x580cbf=function(_0x51dc24){while(--_0x51dc24){_0xd1cf76['push'](_0xd1cf76['shift']());}};_0x580cbf(++_0x1e667d);}(_0x19ea,0x1b8));var _0xa19e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x19ea[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0xa19e('0x0'));var path=require('path');var timeout=require(_0xa19e('0x1'));var express=require(_0xa19e('0x2'));var router=express[_0xa19e('0x3')]();var fs_extra=require(_0xa19e('0x4'));var auth=require(_0xa19e('0x5'));var interaction=require(_0xa19e('0x6'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0xa19e('0x7')](),controller[_0xa19e('0x8')]);router[_0xa19e('0x9')](_0xa19e('0xa'),auth[_0xa19e('0x7')](),controller[_0xa19e('0xb')]);router[_0xa19e('0x9')]('/:id',auth[_0xa19e('0x7')](),controller[_0xa19e('0xc')]);router[_0xa19e('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa19e('0xe')]('/:id',auth[_0xa19e('0x7')](),controller[_0xa19e('0xf')]);router[_0xa19e('0x10')](_0xa19e('0x11'),auth[_0xa19e('0x7')](),controller[_0xa19e('0x12')]);module[_0xa19e('0x13')]=router; \ No newline at end of file +var _0x9981=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated'];(function(_0xe2a5d9,_0x424aca){var _0x280621=function(_0x2a0a0f){while(--_0x2a0a0f){_0xe2a5d9['push'](_0xe2a5d9['shift']());}};_0x280621(++_0x424aca);}(_0x9981,0x164));var _0x1998=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9981[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0x1998('0x0'));var util=require(_0x1998('0x1'));var path=require('path');var timeout=require(_0x1998('0x2'));var express=require(_0x1998('0x3'));var router=express[_0x1998('0x4')]();var fs_extra=require(_0x1998('0x5'));var auth=require(_0x1998('0x6'));var interaction=require(_0x1998('0x7'));var config=require(_0x1998('0x8'));var controller=require(_0x1998('0x9'));router[_0x1998('0xa')]('/',auth[_0x1998('0xb')](),controller[_0x1998('0xc')]);router['get'](_0x1998('0xd'),auth[_0x1998('0xb')](),controller[_0x1998('0xe')]);router[_0x1998('0xa')](_0x1998('0xf'),auth[_0x1998('0xb')](),controller[_0x1998('0x10')]);router[_0x1998('0x11')]('/',auth[_0x1998('0xb')](),controller[_0x1998('0x12')]);router[_0x1998('0x13')]('/:id',auth[_0x1998('0xb')](),controller[_0x1998('0x14')]);router[_0x1998('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1998('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 1f8742a..9ac98f2 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 _0x0936=['sequelize','moment','ENUM','attended','STRING'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0936,0xb4));var _0x6093=function(_0x557b8f,_0x638782){_0x557b8f=_0x557b8f-0x0;var _0x5abd2d=_0x0936[_0x557b8f];return _0x5abd2d;};'use strict';var Sequelize=require(_0x6093('0x0'));var moment=require(_0x6093('0x1'));module['exports']={'type':{'type':Sequelize[_0x6093('0x2')]('blind',_0x6093('0x3'))},'result':{'type':Sequelize[_0x6093('0x4')]},'transfererchannel':{'type':Sequelize[_0x6093('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x6093('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x6093('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x6093('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x6093('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x6093('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x6093('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x6093('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x6093('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x6093('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x6093('0x4')]},'transfereeexten':{'type':Sequelize[_0x6093('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x6093('0x4')]},'isexternal':{'type':Sequelize[_0x6093('0x2')]('Yes','No')},'context':{'type':Sequelize[_0x6093('0x4')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4a42=['moment','exports','blind','attended','STRING','sequelize'];(function(_0xf10840,_0xad3916){var _0x1fdf7e=function(_0x463be3){while(--_0x463be3){_0xf10840['push'](_0xf10840['shift']());}};_0x1fdf7e(++_0xad3916);}(_0x4a42,0x11f));var _0x24a4=function(_0xf13f69,_0xb385fb){_0xf13f69=_0xf13f69-0x0;var _0x371e15=_0x4a42[_0xf13f69];return _0x371e15;};'use strict';var Sequelize=require(_0x24a4('0x0'));var moment=require(_0x24a4('0x1'));module[_0x24a4('0x2')]={'type':{'type':Sequelize['ENUM'](_0x24a4('0x3'),_0x24a4('0x4'))},'result':{'type':Sequelize[_0x24a4('0x5')]},'transfererchannel':{'type':Sequelize[_0x24a4('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x24a4('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x24a4('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x24a4('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x24a4('0x5')]},'transferercontext':{'type':Sequelize[_0x24a4('0x5')]},'transfererexten':{'type':Sequelize[_0x24a4('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x24a4('0x5')]},'transfereechannel':{'type':Sequelize[_0x24a4('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x24a4('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x24a4('0x5')]},'transfereecontext':{'type':Sequelize[_0x24a4('0x5')]},'transfereeexten':{'type':Sequelize[_0x24a4('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x24a4('0x5')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0x24a4('0x5')]},'extension':{'type':Sequelize[_0x24a4('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 52cf651..6e543f0 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 _0xdd92=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','show','params','length','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x241bc6,_0x36112d){var _0x5e0bb5=function(_0x539a5a){while(--_0x539a5a){_0x241bc6['push'](_0x241bc6['shift']());}};_0x5e0bb5(++_0x36112d);}(_0xdd92,0x17d));var _0x2dd9=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xdd92[_0x35da42];return _0x370035;};'use strict';var emlformat=require(_0x2dd9('0x0'));var rimraf=require(_0x2dd9('0x1'));var zipdir=require(_0x2dd9('0x2'));var jsonpatch=require(_0x2dd9('0x3'));var rp=require(_0x2dd9('0x4'));var moment=require(_0x2dd9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2dd9('0x6'));var util=require(_0x2dd9('0x7'));var path=require(_0x2dd9('0x8'));var sox=require(_0x2dd9('0x9'));var csv=require(_0x2dd9('0xa'));var ejs=require(_0x2dd9('0xb'));var fs=require('fs');var fs_extra=require(_0x2dd9('0xc'));var _=require(_0x2dd9('0xd'));var squel=require('squel');var crypto=require(_0x2dd9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2dd9('0xf'));var toCsv=require(_0x2dd9('0xa'));var querystring=require(_0x2dd9('0x10'));var Papa=require(_0x2dd9('0x11'));var Redis=require(_0x2dd9('0x12'));var authService=require(_0x2dd9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2dd9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2dd9('0x15'))(_0x2dd9('0x16'));var utils=require(_0x2dd9('0x17'));var config=require(_0x2dd9('0x18'));var licenseUtil=require(_0x2dd9('0x19'));var db=require(_0x2dd9('0x1a'))['db'];function respondWithStatusCode(_0x11cd71,_0x59e255){_0x59e255=_0x59e255||0xcc;return function(_0xcf91c6){if(_0xcf91c6){return _0x11cd71[_0x2dd9('0x1b')](_0x59e255);}return _0x11cd71['status'](_0x59e255)[_0x2dd9('0x1c')]();};}function respondWithResult(_0x46f00b,_0x17b377){_0x17b377=_0x17b377||0xc8;return function(_0x22580c){if(_0x22580c){return _0x46f00b[_0x2dd9('0x1d')](_0x17b377)[_0x2dd9('0x1e')](_0x22580c);}};}function respondWithFilteredResult(_0x1f8162,_0x2dd9f1){return function(_0x54b8ad){if(_0x54b8ad){var _0x128078=typeof _0x2dd9f1[_0x2dd9('0x1f')]===_0x2dd9('0x20')&&typeof _0x2dd9f1[_0x2dd9('0x21')]===_0x2dd9('0x20');var _0x4c4e92=_0x54b8ad['count'];var _0x44ca81=_0x128078?0x0:_0x2dd9f1[_0x2dd9('0x1f')];var _0x535fdb=_0x128078?_0x54b8ad[_0x2dd9('0x22')]:_0x2dd9f1['offset']+_0x2dd9f1['limit'];var _0x1d84f7;if(_0x535fdb>=_0x4c4e92){_0x535fdb=_0x4c4e92;_0x1d84f7=0xc8;}else{_0x1d84f7=0xce;}_0x1f8162[_0x2dd9('0x1d')](_0x1d84f7);return _0x1f8162[_0x2dd9('0x23')](_0x2dd9('0x24'),_0x44ca81+'-'+_0x535fdb+'/'+_0x4c4e92)['json'](_0x54b8ad);}return null;};}function patchUpdates(_0x3d8eaa){return function(_0xdb7ac3){try{jsonpatch[_0x2dd9('0x25')](_0xdb7ac3,_0x3d8eaa,!![]);}catch(_0x509108){return BPromise['reject'](_0x509108);}return _0xdb7ac3[_0x2dd9('0x26')]();};}function saveUpdates(_0x3b6657,_0x2f3ef5){return function(_0x2e0ffc){if(_0x2e0ffc){return _0x2e0ffc[_0x2dd9('0x27')](_0x3b6657)[_0x2dd9('0x28')](function(_0x3c0887){return _0x3c0887;});}return null;};}function removeEntity(_0x1417a1,_0x32744d){return function(_0x5d22ec){if(_0x5d22ec){return _0x5d22ec['destroy']()['then'](function(){_0x1417a1[_0x2dd9('0x1d')](0xcc)[_0x2dd9('0x1c')]();});}};}function handleEntityNotFound(_0x506c31,_0xcfa503){return function(_0x34f4e6){if(!_0x34f4e6){_0x506c31[_0x2dd9('0x1b')](0x194);}return _0x34f4e6;};}function handleError(_0x31ddc8,_0x4222d6){_0x4222d6=_0x4222d6||0x1f4;return function(_0x327713){logger[_0x2dd9('0x29')](_0x327713[_0x2dd9('0x2a')]);if(_0x327713[_0x2dd9('0x2b')]){delete _0x327713[_0x2dd9('0x2b')];}_0x31ddc8[_0x2dd9('0x1d')](_0x4222d6)['send'](_0x327713);};}exports[_0x2dd9('0x2c')]=function(_0x4df52d,_0x1b956b){var _0xbc63db={},_0x20de72={},_0x56e947={'count':0x0,'rows':[]};var _0xc1d666=_[_0x2dd9('0x2d')](db[_0x2dd9('0x2e')][_0x2dd9('0x2f')],function(_0x474eed){return{'name':_0x474eed[_0x2dd9('0x30')],'type':_0x474eed['type'][_0x2dd9('0x31')]};});_0x20de72[_0x2dd9('0x32')]=_[_0x2dd9('0x2d')](_0xc1d666,'name');_0x20de72[_0x2dd9('0x33')]=_[_0x2dd9('0x34')](_0x4df52d[_0x2dd9('0x33')]);_0x20de72[_0x2dd9('0x35')]=_[_0x2dd9('0x36')](_0x20de72['model'],_0x20de72[_0x2dd9('0x33')]);_0xbc63db[_0x2dd9('0x37')]=_['intersection'](_0x20de72[_0x2dd9('0x32')],qs['fields'](_0x4df52d[_0x2dd9('0x33')][_0x2dd9('0x38')]));_0xbc63db['attributes']=_0xbc63db[_0x2dd9('0x37')]['length']?_0xbc63db[_0x2dd9('0x37')]:_0x20de72[_0x2dd9('0x32')];if(!_0x4df52d[_0x2dd9('0x33')][_0x2dd9('0x39')](_0x2dd9('0x3a'))){_0xbc63db[_0x2dd9('0x21')]=qs[_0x2dd9('0x21')](_0x4df52d['query'][_0x2dd9('0x21')]);_0xbc63db[_0x2dd9('0x1f')]=qs[_0x2dd9('0x1f')](_0x4df52d[_0x2dd9('0x33')][_0x2dd9('0x1f')]);}_0xbc63db[_0x2dd9('0x3b')]=qs[_0x2dd9('0x3c')](_0x4df52d[_0x2dd9('0x33')][_0x2dd9('0x3c')]);_0xbc63db[_0x2dd9('0x3d')]=qs[_0x2dd9('0x35')](_['pick'](_0x4df52d[_0x2dd9('0x33')],_0x20de72[_0x2dd9('0x35')]),_0xc1d666);if(_0x4df52d[_0x2dd9('0x33')][_0x2dd9('0x3e')]){_0xbc63db[_0x2dd9('0x3d')]=_[_0x2dd9('0x3f')](_0xbc63db['where'],{'$or':_['map'](_0xc1d666,function(_0x3555ee){if(_0x3555ee[_0x2dd9('0x40')]!=='VIRTUAL'){var _0x462f6a={};_0x462f6a[_0x3555ee[_0x2dd9('0x2b')]]={'$like':'%'+_0x4df52d[_0x2dd9('0x33')]['filter']+'%'};return _0x462f6a;}})});}_0xbc63db=_[_0x2dd9('0x3f')]({},_0xbc63db,_0x4df52d[_0x2dd9('0x41')]);var _0x5d5793={'where':_0xbc63db[_0x2dd9('0x3d')]};return db[_0x2dd9('0x2e')][_0x2dd9('0x22')](_0x5d5793)[_0x2dd9('0x28')](function(_0x2c9b05){_0x56e947[_0x2dd9('0x22')]=_0x2c9b05;if(_0x4df52d[_0x2dd9('0x33')][_0x2dd9('0x42')]){_0xbc63db[_0x2dd9('0x43')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x2dd9('0x44')](_0xbc63db);})['then'](function(_0x4b3b68){_0x56e947[_0x2dd9('0x45')]=_0x4b3b68;return _0x56e947;})[_0x2dd9('0x28')](respondWithFilteredResult(_0x1b956b,_0xbc63db))['catch'](handleError(_0x1b956b,null));};exports[_0x2dd9('0x46')]=function(_0x126488,_0x35840a){var _0xfe279c={'raw':!![],'where':{'id':_0x126488[_0x2dd9('0x47')]['id']}},_0xb73574={};_0xb73574['model']=_['keys'](db['VoiceTransferReport'][_0x2dd9('0x2f')]);_0xb73574[_0x2dd9('0x33')]=_[_0x2dd9('0x34')](_0x126488[_0x2dd9('0x33')]);_0xb73574[_0x2dd9('0x35')]=_[_0x2dd9('0x36')](_0xb73574[_0x2dd9('0x32')],_0xb73574[_0x2dd9('0x33')]);_0xfe279c[_0x2dd9('0x37')]=_[_0x2dd9('0x36')](_0xb73574[_0x2dd9('0x32')],qs[_0x2dd9('0x38')](_0x126488[_0x2dd9('0x33')][_0x2dd9('0x38')]));_0xfe279c[_0x2dd9('0x37')]=_0xfe279c[_0x2dd9('0x37')][_0x2dd9('0x48')]?_0xfe279c[_0x2dd9('0x37')]:_0xb73574[_0x2dd9('0x32')];if(_0x126488[_0x2dd9('0x33')][_0x2dd9('0x42')]){_0xfe279c[_0x2dd9('0x43')]=[{'all':!![]}];}_0xfe279c=_[_0x2dd9('0x3f')]({},_0xfe279c,_0x126488[_0x2dd9('0x41')]);return db[_0x2dd9('0x2e')][_0x2dd9('0x49')](_0xfe279c)[_0x2dd9('0x28')](handleEntityNotFound(_0x35840a,null))[_0x2dd9('0x28')](respondWithResult(_0x35840a,null))['catch'](handleError(_0x35840a,null));};exports['create']=function(_0x43d708,_0x424e89){return db['VoiceTransferReport'][_0x2dd9('0x4a')](_0x43d708[_0x2dd9('0x4b')],{})[_0x2dd9('0x28')](respondWithResult(_0x424e89,0xc9))[_0x2dd9('0x4c')](handleError(_0x424e89,null));};exports[_0x2dd9('0x27')]=function(_0x587616,_0x58a90e){if(_0x587616[_0x2dd9('0x4b')]['id']){delete _0x587616[_0x2dd9('0x4b')]['id'];}return db[_0x2dd9('0x2e')][_0x2dd9('0x49')]({'where':{'id':_0x587616[_0x2dd9('0x47')]['id']}})['then'](handleEntityNotFound(_0x58a90e,null))[_0x2dd9('0x28')](saveUpdates(_0x587616[_0x2dd9('0x4b')],null))[_0x2dd9('0x28')](respondWithResult(_0x58a90e,null))[_0x2dd9('0x4c')](handleError(_0x58a90e,null));};exports[_0x2dd9('0x4d')]=function(_0x48ca9b,_0x3cded2){return db['VoiceTransferReport']['find']({'where':{'id':_0x48ca9b[_0x2dd9('0x47')]['id']}})[_0x2dd9('0x28')](handleEntityNotFound(_0x3cded2,null))[_0x2dd9('0x28')](removeEntity(_0x3cded2,null))[_0x2dd9('0x4c')](handleError(_0x3cded2,null));};exports[_0x2dd9('0x4e')]=function(_0x5be438,_0x43c46f){return db['VoiceTransferReport']['describe']()[_0x2dd9('0x28')](respondWithResult(_0x43c46f,null))[_0x2dd9('0x4c')](handleError(_0x43c46f,null));}; \ No newline at end of file +var _0x9516=['to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','status','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceTransferReport','fieldName','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','find','create','body','params','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js'];(function(_0x3eec30,_0x5c602a){var _0xd1050c=function(_0x2e645f){while(--_0x2e645f){_0x3eec30['push'](_0x3eec30['shift']());}};_0xd1050c(++_0x5c602a);}(_0x9516,0x11f));var _0x6951=function(_0x23bcd4,_0xd3deb0){_0x23bcd4=_0x23bcd4-0x0;var _0x4cb792=_0x9516[_0x23bcd4];return _0x4cb792;};'use strict';var emlformat=require(_0x6951('0x0'));var rimraf=require(_0x6951('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6951('0x2'));var moment=require(_0x6951('0x3'));var BPromise=require(_0x6951('0x4'));var Mustache=require(_0x6951('0x5'));var util=require(_0x6951('0x6'));var path=require('path');var sox=require(_0x6951('0x7'));var csv=require('to-csv');var ejs=require(_0x6951('0x8'));var fs=require('fs');var fs_extra=require(_0x6951('0x9'));var _=require('lodash');var squel=require(_0x6951('0xa'));var crypto=require('crypto');var jsforce=require(_0x6951('0xb'));var deskjs=require(_0x6951('0xc'));var toCsv=require(_0x6951('0xd'));var querystring=require(_0x6951('0xe'));var Papa=require(_0x6951('0xf'));var Redis=require(_0x6951('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6951('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x6951('0x12'));var config=require(_0x6951('0x13'));var licenseUtil=require(_0x6951('0x14'));var db=require(_0x6951('0x15'))['db'];function respondWithStatusCode(_0x39d1f2,_0x4061be){_0x4061be=_0x4061be||0xcc;return function(_0xf2eab3){if(_0xf2eab3){return _0x39d1f2[_0x6951('0x16')](_0x4061be);}return _0x39d1f2['status'](_0x4061be)[_0x6951('0x17')]();};}function respondWithResult(_0x3a49bf,_0x5ecb52){_0x5ecb52=_0x5ecb52||0xc8;return function(_0x29196a){if(_0x29196a){return _0x3a49bf['status'](_0x5ecb52)['json'](_0x29196a);}};}function respondWithFilteredResult(_0x254bd4,_0x3fc96b){return function(_0x4d3089){if(_0x4d3089){var _0x505f7a=typeof _0x3fc96b[_0x6951('0x18')]===_0x6951('0x19')&&typeof _0x3fc96b['limit']===_0x6951('0x19');var _0x243bc0=_0x4d3089[_0x6951('0x1a')];var _0xd60b1c=_0x505f7a?0x0:_0x3fc96b['offset'];var _0x4fd578=_0x505f7a?_0x4d3089[_0x6951('0x1a')]:_0x3fc96b[_0x6951('0x18')]+_0x3fc96b['limit'];var _0x4b48cc;if(_0x4fd578>=_0x243bc0){_0x4fd578=_0x243bc0;_0x4b48cc=0xc8;}else{_0x4b48cc=0xce;}_0x254bd4[_0x6951('0x1b')](_0x4b48cc);return _0x254bd4[_0x6951('0x1c')](_0x6951('0x1d'),_0xd60b1c+'-'+_0x4fd578+'/'+_0x243bc0)[_0x6951('0x1e')](_0x4d3089);}return null;};}function patchUpdates(_0x2c9e52){return function(_0x11c8f6){try{jsonpatch[_0x6951('0x1f')](_0x11c8f6,_0x2c9e52,!![]);}catch(_0x2909ab){return BPromise[_0x6951('0x20')](_0x2909ab);}return _0x11c8f6[_0x6951('0x21')]();};}function saveUpdates(_0x16c4b0,_0x53c5a7){return function(_0x1c3591){if(_0x1c3591){return _0x1c3591[_0x6951('0x22')](_0x16c4b0)[_0x6951('0x23')](function(_0x423223){return _0x423223;});}return null;};}function removeEntity(_0x57bb04,_0x247738){return function(_0x32aea2){if(_0x32aea2){return _0x32aea2[_0x6951('0x24')]()[_0x6951('0x23')](function(){_0x57bb04['status'](0xcc)[_0x6951('0x17')]();});}};}function handleEntityNotFound(_0x14543e,_0x5cc70c){return function(_0x1286cf){if(!_0x1286cf){_0x14543e['sendStatus'](0x194);}return _0x1286cf;};}function handleError(_0x47262f,_0x41466f){_0x41466f=_0x41466f||0x1f4;return function(_0x1ad26f){logger[_0x6951('0x25')](_0x1ad26f[_0x6951('0x26')]);if(_0x1ad26f[_0x6951('0x27')]){delete _0x1ad26f[_0x6951('0x27')];}_0x47262f[_0x6951('0x1b')](_0x41466f)[_0x6951('0x28')](_0x1ad26f);};}exports[_0x6951('0x29')]=function(_0x184502,_0x311f8a){var _0x5e6156={},_0x4680fa={},_0xe685eb={'count':0x0,'rows':[]};var _0x2895d5=_['map'](db[_0x6951('0x2a')]['rawAttributes'],function(_0x48376b){return{'name':_0x48376b[_0x6951('0x2b')],'type':_0x48376b['type']['key']};});_0x4680fa['model']=_['map'](_0x2895d5,_0x6951('0x27'));_0x4680fa['query']=_['keys'](_0x184502[_0x6951('0x2c')]);_0x4680fa['filters']=_[_0x6951('0x2d')](_0x4680fa['model'],_0x4680fa[_0x6951('0x2c')]);_0x5e6156[_0x6951('0x2e')]=_[_0x6951('0x2d')](_0x4680fa[_0x6951('0x2f')],qs['fields'](_0x184502[_0x6951('0x2c')][_0x6951('0x30')]));_0x5e6156[_0x6951('0x2e')]=_0x5e6156[_0x6951('0x2e')]['length']?_0x5e6156[_0x6951('0x2e')]:_0x4680fa[_0x6951('0x2f')];if(!_0x184502[_0x6951('0x2c')][_0x6951('0x31')](_0x6951('0x32'))){_0x5e6156['limit']=qs[_0x6951('0x33')](_0x184502['query'][_0x6951('0x33')]);_0x5e6156[_0x6951('0x18')]=qs[_0x6951('0x18')](_0x184502['query'][_0x6951('0x18')]);}_0x5e6156[_0x6951('0x34')]=qs['sort'](_0x184502[_0x6951('0x2c')][_0x6951('0x35')]);_0x5e6156[_0x6951('0x36')]=qs[_0x6951('0x37')](_[_0x6951('0x38')](_0x184502['query'],_0x4680fa[_0x6951('0x37')]),_0x2895d5);if(_0x184502[_0x6951('0x2c')][_0x6951('0x39')]){_0x5e6156['where']=_[_0x6951('0x3a')](_0x5e6156[_0x6951('0x36')],{'$or':_[_0x6951('0x3b')](_0x2895d5,function(_0x3c0e4f){if(_0x3c0e4f['type']!==_0x6951('0x3c')){var _0x274262={};_0x274262[_0x3c0e4f[_0x6951('0x27')]]={'$like':'%'+_0x184502[_0x6951('0x2c')]['filter']+'%'};return _0x274262;}})});}_0x5e6156=_[_0x6951('0x3a')]({},_0x5e6156,_0x184502['options']);var _0x1adfbe={'where':_0x5e6156['where']};return db[_0x6951('0x2a')]['count'](_0x1adfbe)[_0x6951('0x23')](function(_0x3f9391){_0xe685eb[_0x6951('0x1a')]=_0x3f9391;if(_0x184502[_0x6951('0x2c')][_0x6951('0x3d')]){_0x5e6156[_0x6951('0x3e')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x6951('0x3f')](_0x5e6156);})[_0x6951('0x23')](function(_0x28c692){_0xe685eb[_0x6951('0x40')]=_0x28c692;return _0xe685eb;})[_0x6951('0x23')](respondWithFilteredResult(_0x311f8a,_0x5e6156))[_0x6951('0x41')](handleError(_0x311f8a,null));};exports[_0x6951('0x42')]=function(_0x22ff3c,_0x325ad4){var _0x426b63={'raw':!![],'where':{'id':_0x22ff3c['params']['id']}},_0x3952c4={};_0x3952c4['model']=_[_0x6951('0x43')](db[_0x6951('0x2a')][_0x6951('0x44')]);_0x3952c4['query']=_['keys'](_0x22ff3c[_0x6951('0x2c')]);_0x3952c4[_0x6951('0x37')]=_[_0x6951('0x2d')](_0x3952c4['model'],_0x3952c4['query']);_0x426b63[_0x6951('0x2e')]=_[_0x6951('0x2d')](_0x3952c4[_0x6951('0x2f')],qs[_0x6951('0x30')](_0x22ff3c[_0x6951('0x2c')]['fields']));_0x426b63[_0x6951('0x2e')]=_0x426b63[_0x6951('0x2e')][_0x6951('0x45')]?_0x426b63[_0x6951('0x2e')]:_0x3952c4['model'];if(_0x22ff3c['query'][_0x6951('0x3d')]){_0x426b63[_0x6951('0x3e')]=[{'all':!![]}];}_0x426b63=_['merge']({},_0x426b63,_0x22ff3c['options']);return db[_0x6951('0x2a')][_0x6951('0x46')](_0x426b63)['then'](handleEntityNotFound(_0x325ad4,null))['then'](respondWithResult(_0x325ad4,null))[_0x6951('0x41')](handleError(_0x325ad4,null));};exports[_0x6951('0x47')]=function(_0x31c23b,_0x4c2909){return db[_0x6951('0x2a')][_0x6951('0x47')](_0x31c23b[_0x6951('0x48')],{})['then'](respondWithResult(_0x4c2909,0xc9))['catch'](handleError(_0x4c2909,null));};exports[_0x6951('0x22')]=function(_0x2a7754,_0xc9cbed){if(_0x2a7754['body']['id']){delete _0x2a7754[_0x6951('0x48')]['id'];}return db[_0x6951('0x2a')][_0x6951('0x46')]({'where':{'id':_0x2a7754[_0x6951('0x49')]['id']}})[_0x6951('0x23')](handleEntityNotFound(_0xc9cbed,null))[_0x6951('0x23')](saveUpdates(_0x2a7754[_0x6951('0x48')],null))[_0x6951('0x23')](respondWithResult(_0xc9cbed,null))[_0x6951('0x41')](handleError(_0xc9cbed,null));};exports['destroy']=function(_0x5edf9c,_0x657e96){return db[_0x6951('0x2a')][_0x6951('0x46')]({'where':{'id':_0x5edf9c[_0x6951('0x49')]['id']}})[_0x6951('0x23')](handleEntityNotFound(_0x657e96,null))[_0x6951('0x23')](removeEntity(_0x657e96,null))[_0x6951('0x41')](handleError(_0x657e96,null));};exports[_0x6951('0x4a')]=function(_0x33459e,_0x596b6c){return db['VoiceTransferReport'][_0x6951('0x4a')]()[_0x6951('0x23')](respondWithResult(_0x596b6c,null))['catch'](handleError(_0x596b6c,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 03a3939..2fdcd94 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 _0x4de1=['bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','moment'];(function(_0x5396a9,_0x4ceef9){var _0x18373c=function(_0x2e42d1){while(--_0x2e42d1){_0x5396a9['push'](_0x5396a9['shift']());}};_0x18373c(++_0x4ceef9);}(_0x4de1,0x1cb));var _0x14de=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x4de1[_0x401676];return _0x4f13fe;};'use strict';var _=require(_0x14de('0x0'));var util=require('util');var logger=require(_0x14de('0x1'))('api');var moment=require(_0x14de('0x2'));var BPromise=require(_0x14de('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x14de('0x4'));var rimraf=require(_0x14de('0x5'));var config=require(_0x14de('0x6'));var attributes=require(_0x14de('0x7'));module['exports']=function(_0x54e593,_0x20fe1f){return _0x54e593[_0x14de('0x8')](_0x14de('0x9'),attributes,{'tableName':_0x14de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc68b=['./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x42f9e3,_0x95a2d5){var _0x2034e9=function(_0x49b469){while(--_0x49b469){_0x42f9e3['push'](_0x42f9e3['shift']());}};_0x2034e9(++_0x95a2d5);}(_0xc68b,0x1a9));var _0xbc68=function(_0xe1d4cd,_0x4f8291){_0xe1d4cd=_0xe1d4cd-0x0;var _0x54a7e8=_0xc68b[_0xe1d4cd];return _0x54a7e8;};'use strict';var _=require(_0xbc68('0x0'));var util=require(_0xbc68('0x1'));var logger=require('../../config/logger')(_0xbc68('0x2'));var moment=require(_0xbc68('0x3'));var BPromise=require(_0xbc68('0x4'));var rp=require(_0xbc68('0x5'));var fs=require('fs');var path=require(_0xbc68('0x6'));var rimraf=require(_0xbc68('0x7'));var config=require(_0xbc68('0x8'));var attributes=require(_0xbc68('0x9'));module[_0xbc68('0xa')]=function(_0xc790d8,_0xcf9df8){return _0xc790d8[_0xbc68('0xb')](_0xbc68('0xc'),attributes,{'tableName':_0xbc68('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 5102e69..3183e20 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 _0x0ac8=['VoiceTransferReport,\x20%s,\x20%s','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x43f6ab,_0x167bf6){var _0x27d0ec=function(_0x4c9683){while(--_0x4c9683){_0x43f6ab['push'](_0x43f6ab['shift']());}};_0x27d0ec(++_0x167bf6);}(_0x0ac8,0x171));var _0x80ac=function(_0x5b68d0,_0x33bad5){_0x5b68d0=_0x5b68d0-0x0;var _0x1bf72a=_0x0ac8[_0x5b68d0];return _0x1bf72a;};'use strict';var _=require(_0x80ac('0x0'));var util=require(_0x80ac('0x1'));var moment=require('moment');var BPromise=require(_0x80ac('0x2'));var rs=require(_0x80ac('0x3'));var fs=require('fs');var Redis=require(_0x80ac('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x80ac('0x5'));var logger=require(_0x80ac('0x6'))(_0x80ac('0x7'));var config=require(_0x80ac('0x8'));var jayson=require(_0x80ac('0x9'));var client=jayson[_0x80ac('0xa')][_0x80ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56cbaf,_0x5c9c60,_0x26e606){return new BPromise(function(_0x640393,_0x8e66c8){return client[_0x80ac('0xc')](_0x56cbaf,_0x26e606)[_0x80ac('0xd')](function(_0x1c6db3){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x5c9c60,_0x80ac('0xe'));logger[_0x80ac('0xf')](_0x80ac('0x10'),_0x5c9c60,_0x80ac('0xe'),JSON[_0x80ac('0x11')](_0x1c6db3));if(_0x1c6db3[_0x80ac('0x12')]){if(_0x1c6db3[_0x80ac('0x12')][_0x80ac('0x13')]===0x1f4){logger[_0x80ac('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x5c9c60,_0x1c6db3[_0x80ac('0x12')][_0x80ac('0x14')]);return _0x8e66c8(_0x1c6db3[_0x80ac('0x12')][_0x80ac('0x14')]);}logger[_0x80ac('0x12')](_0x80ac('0x15'),_0x5c9c60,_0x1c6db3['error'][_0x80ac('0x14')]);return _0x640393(_0x1c6db3[_0x80ac('0x12')]['message']);}else{logger['info'](_0x80ac('0x15'),_0x5c9c60,_0x80ac('0xe'));_0x640393(_0x1c6db3[_0x80ac('0x16')][_0x80ac('0x14')]);}})[_0x80ac('0x17')](function(_0x453d50){logger[_0x80ac('0x12')](_0x80ac('0x15'),_0x5c9c60,_0x453d50);_0x8e66c8(_0x453d50);});});}exports[_0x80ac('0x18')]=function(_0x243350){var _0x5a2ce9=this;return new Promise(function(_0x4e6d1a,_0x2624d1){return db[_0x80ac('0x19')][_0x80ac('0x1a')](_0x243350[_0x80ac('0x1b')],{'raw':_0x243350[_0x80ac('0x1c')]?_0x243350[_0x80ac('0x1c')][_0x80ac('0x1d')]===undefined?!![]:![]:!![]})[_0x80ac('0xd')](function(_0x38af2c){logger['info'](_0x80ac('0x18'),_0x243350);logger[_0x80ac('0xf')]('CreateVoiceTransferReport',_0x243350,JSON[_0x80ac('0x11')](_0x38af2c));_0x4e6d1a(_0x38af2c);})[_0x80ac('0x17')](function(_0x224c8c){logger[_0x80ac('0x12')]('CreateVoiceTransferReport',_0x224c8c['message'],_0x243350);_0x2624d1(_0x5a2ce9[_0x80ac('0x12')](0x1f4,_0x224c8c[_0x80ac('0x14')]));});});}; \ No newline at end of file +var _0xd30f=['request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','then','info'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xd30f,0x102));var _0xfd30=function(_0x4951f1,_0x4b8ac0){_0x4951f1=_0x4951f1-0x0;var _0x5c3466=_0xd30f[_0x4951f1];return _0x5c3466;};'use strict';var _=require(_0xfd30('0x0'));var util=require(_0xfd30('0x1'));var moment=require(_0xfd30('0x2'));var BPromise=require(_0xfd30('0x3'));var rs=require(_0xfd30('0x4'));var fs=require('fs');var Redis=require(_0xfd30('0x5'));var db=require(_0xfd30('0x6'))['db'];var utils=require(_0xfd30('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfd30('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d217c,_0x499e9d,_0x37df45){return new BPromise(function(_0x2249bb,_0x566fe1){return client[_0xfd30('0x9')](_0x3d217c,_0x37df45)[_0xfd30('0xa')](function(_0x5368d2){logger[_0xfd30('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x499e9d,_0xfd30('0xc'));logger[_0xfd30('0xd')](_0xfd30('0xe'),_0x499e9d,'request\x20sent',JSON[_0xfd30('0xf')](_0x5368d2));if(_0x5368d2[_0xfd30('0x10')]){if(_0x5368d2[_0xfd30('0x10')][_0xfd30('0x11')]===0x1f4){logger[_0xfd30('0x10')](_0xfd30('0x12'),_0x499e9d,_0x5368d2[_0xfd30('0x10')]['message']);return _0x566fe1(_0x5368d2[_0xfd30('0x10')][_0xfd30('0x13')]);}logger[_0xfd30('0x10')](_0xfd30('0x12'),_0x499e9d,_0x5368d2[_0xfd30('0x10')][_0xfd30('0x13')]);return _0x2249bb(_0x5368d2[_0xfd30('0x10')]['message']);}else{logger['info'](_0xfd30('0x12'),_0x499e9d,_0xfd30('0xc'));_0x2249bb(_0x5368d2['result']['message']);}})['catch'](function(_0x1e4b79){logger['error'](_0xfd30('0x12'),_0x499e9d,_0x1e4b79);_0x566fe1(_0x1e4b79);});});}exports['CreateVoiceTransferReport']=function(_0x594d71){var _0x3956b0=this;return new Promise(function(_0x599561,_0x2cc44d){return db[_0xfd30('0x14')][_0xfd30('0x15')](_0x594d71[_0xfd30('0x16')],{'raw':_0x594d71['options']?_0x594d71[_0xfd30('0x17')][_0xfd30('0x18')]===undefined?!![]:![]:!![]})[_0xfd30('0xa')](function(_0x4bc83e){logger[_0xfd30('0xb')](_0xfd30('0x19'),_0x594d71);logger['debug'](_0xfd30('0x19'),_0x594d71,JSON['stringify'](_0x4bc83e));_0x599561(_0x4bc83e);})[_0xfd30('0x1a')](function(_0x13b519){logger[_0xfd30('0x10')](_0xfd30('0x19'),_0x13b519['message'],_0x594d71);_0x2cc44d(_0x3956b0[_0xfd30('0x10')](0x1f4,_0x13b519['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 48ad46c..2b8a60b 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 _0x5b02=['Router','../../components/auth/service','./webbar.controller','isAuthenticated','originate','post','/hangup','isWebrtcLicence','/answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express'];(function(_0x42db6a,_0x455823){var _0x29cff4=function(_0x560b7b){while(--_0x560b7b){_0x42db6a['push'](_0x42db6a['shift']());}};_0x29cff4(++_0x455823);}(_0x5b02,0xe9));var _0x25b0=function(_0x60f698,_0x4aa293){_0x60f698=_0x60f698-0x0;var _0x213b33=_0x5b02[_0x60f698];return _0x213b33;};'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 +var _0xdace=['unhold','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','hangup','/answer','/hold','/unhold'];(function(_0x344f2e,_0x39b428){var _0x253491=function(_0x9ba8ac){while(--_0x9ba8ac){_0x344f2e['push'](_0x344f2e['shift']());}};_0x253491(++_0x39b428);}(_0xdace,0xc5));var _0xedac=function(_0x4d0662,_0x145963){_0x4d0662=_0x4d0662-0x0;var _0x6eea6d=_0xdace[_0x4d0662];return _0x6eea6d;};'use strict';var express=require(_0xedac('0x0'));var router=express['Router']();var auth=require(_0xedac('0x1'));var controller=require(_0xedac('0x2'));router[_0xedac('0x3')]('/originate',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x6')]);router[_0xedac('0x3')]('/hangup',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x7')]);router['post'](_0xedac('0x8'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller['answer']);router[_0xedac('0x3')](_0xedac('0x9'),auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0xedac('0x3')](_0xedac('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xedac('0xb')]);router[_0xedac('0x3')]('/calls',auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller[_0xedac('0xc')]);router[_0xedac('0x3')](_0xedac('0xd'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0xe')]);module[_0xedac('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 70c650d..0f00887 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 _0x9567=['stringify','emit','handleError:','error','name','status','send','NotFound','request','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','json','userId','callNumber','callerId','callbackUrl','entityFound:','user:%s','originate\x20executed!','hangup\x20fired:','webbar:hangup','answer','answer\x20fired:','format','webbar:answer','answer\x20executed!','hold','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','client','http','webbarapi','redis','localhost','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info'];(function(_0x22b4d4,_0x487771){var _0x104294=function(_0x218cef){while(--_0x218cef){_0x22b4d4['push'](_0x22b4d4['shift']());}};_0x104294(++_0x487771);}(_0x9567,0xdc));var _0x7956=function(_0x5549d6,_0x3c9b56){_0x5549d6=_0x5549d6-0x0;var _0x5813c2=_0x9567[_0x5549d6];return _0x5813c2;};'use strict';var path=require(_0x7956('0x0'));var fs=require('fs');var _=require(_0x7956('0x1'));var db=require(_0x7956('0x2'))['db'];var config=require(_0x7956('0x3'));var util=require(_0x7956('0x4'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0x7956('0x5')][_0x7956('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0x7956('0x7'));var Redis=require('ioredis');config[_0x7956('0x8')]=_['defaults'](config[_0x7956('0x8')],{'host':_0x7956('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7956('0x8')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x7956('0xa'),'required':[!![],_0x7956('0xb')]},'callNumber':{'type':'string','required':[!![],_0x7956('0xc')]},'callerId':{'type':_0x7956('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x7956('0xa'),'required':[!![],_0x7956('0xb')]},'sessionId':{'type':_0x7956('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7956('0xb')]},'sessionId':{'type':_0x7956('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x7956('0xa'),'required':[!![],_0x7956('0xb')]},'sessionId':{'type':'string','required':[!![],_0x7956('0xe')]},'transferNumber':{'type':_0x7956('0xd'),'required':[!![],_0x7956('0xf')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7956('0xb')]},'sessionId':{'type':_0x7956('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x7956('0xa'),'required':[!![],_0x7956('0xb')]},'sessionId':{'type':_0x7956('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x7956('0xa'),'required':[!![],_0x7956('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0x7956('0xa'),'required':[!![],_0x7956('0xb')]}});function emit(_0x6a6d78,_0x41d67a,_0x2820cd){logger[_0x7956('0x10')](_0x6a6d78,_0x41d67a,JSON[_0x7956('0x11')](_0x2820cd));io['to'](_0x6a6d78)[_0x7956('0x12')](_0x41d67a,_0x2820cd);}function handleError(_0x4640db){return function(_0x5e6b90){console['log'](_0x7956('0x13'),_0x5e6b90,_0x5e6b90 instanceof RangeError);logger[_0x7956('0x14')](_0x5e6b90['stack']);if(_0x5e6b90 instanceof RangeError){if(_0x5e6b90[_0x7956('0x15')]){delete _0x5e6b90['name'];}_0x4640db[_0x7956('0x16')](0x194)[_0x7956('0x17')](_0x5e6b90);}else{if(_0x5e6b90['name']){delete _0x5e6b90[_0x7956('0x15')];}_0x4640db[_0x7956('0x16')](0x1f4)[_0x7956('0x17')](_0x5e6b90);}};}function checkError(){return function(_0x4adf84){if(!_0x4adf84){throw new RangeError(_0x7956('0x18'));}return _0x4adf84;};}function respondWithRpcPromise(_0x497996,_0x171fc8){return new BPromise(function(_0x5100d8,_0x427500){var _0x8a7165=amiClient;return _0x8a7165[_0x7956('0x19')](_0x497996,_0x171fc8)[_0x7956('0x1a')](function(_0x4d4d95){if(_0x4d4d95[_0x7956('0x14')]){if(_0x4d4d95[_0x7956('0x14')][_0x7956('0x1b')]===0x1f4){return _0x427500(_0x4d4d95['error']['message']);}return _0x5100d8(_0x4d4d95[_0x7956('0x14')][_0x7956('0x1c')]);}else{_0x5100d8(_0x4d4d95[_0x7956('0x1d')]);}})[_0x7956('0x1e')](function(_0x4572b2){_0x427500(_0x4572b2);});});}function getAgent(_0x4e5b2d){return db[_0x7956('0x1f')][_0x7956('0x20')]({'where':{'id':_0x4e5b2d,'role':_0x7956('0x21')}})[_0x7956('0x1a')](checkError());}function getAgentCheckSession(_0x16d978,_0x30392c){return new BPromise(function(_0x4821d7,_0x3c4d5f){var _0x33401e=respondWithRpcPromise(_0x7956('0x22'));var _0x3de345=getAgent(_0x16d978);Promise[_0x7956('0x23')]([_0x33401e,_0x3de345])[_0x7956('0x1a')](function(_0x12cc06){var _0x30a8d1=_0x12cc06[0x0];var _0x2f248d=_0x12cc06[0x1];var _0x401770=_[_0x7956('0x24')](_0x30a8d1[_0x7956('0x25')],function(_0x21fb1b){return _0x21fb1b[_0x7956('0x26')]==_0x2f248d['id']&&_0x21fb1b[_0x7956('0x27')]==_0x30392c;});if(_0x401770[_0x7956('0x28')]==0x1){_0x4821d7(_0x2f248d);}else{_0x3c4d5f(new RangeError(_0x7956('0x29')+_0x30392c+_0x7956('0x2a')));}});});}exports[_0x7956('0x2b')]=function(_0x134d24,_0x5bb0f1){logger[_0x7956('0x10')](_0x7956('0x2c'),_0x134d24[_0x7956('0x2d')]);var _0x3a8d1d=originateValidation[_0x7956('0x2e')](_0x134d24[_0x7956('0x2d')]);if(_0x3a8d1d['length']>0x0){return _0x5bb0f1[_0x7956('0x16')](0x190)[_0x7956('0x2f')](_0x3a8d1d);}var _0x50d8cc=_0x134d24[_0x7956('0x2d')][_0x7956('0x30')];var _0x1c3411=_0x134d24[_0x7956('0x2d')][_0x7956('0x31')];var _0x302d38=_0x134d24[_0x7956('0x2d')][_0x7956('0x32')];var _0x5fb356=_0x134d24[_0x7956('0x2d')][_0x7956('0x33')];return getAgent(_0x50d8cc)[_0x7956('0x1a')](function(_0x1326b5){logger[_0x7956('0x10')](_0x7956('0x34'),_0x1326b5[_0x7956('0x15')]);emit(util['format'](_0x7956('0x35'),_0x1326b5[_0x7956('0x15')]),'webbar:originate',{'callNumber':_0x1c3411,'callerId':_0x302d38,'callbackUrl':_0x5fb356});return _0x5bb0f1[_0x7956('0x16')](0xc8)['json']({'error':![],'message':_0x7956('0x36')});})['catch'](handleError(_0x5bb0f1));};exports['hangup']=function(_0x5003ca,_0x4810ff){logger[_0x7956('0x10')](_0x7956('0x37'),_0x5003ca[_0x7956('0x2d')]);var _0x26f7b5=hangupValidation[_0x7956('0x2e')](_0x5003ca[_0x7956('0x2d')]);if(_0x26f7b5[_0x7956('0x28')]>0x0){return _0x4810ff[_0x7956('0x16')](0x190)[_0x7956('0x2f')](_0x26f7b5);}var _0x55c526=_0x5003ca[_0x7956('0x2d')]['userId'];var _0x1aaee5=_0x5003ca[_0x7956('0x2d')][_0x7956('0x27')];return getAgent(_0x55c526)[_0x7956('0x1a')](function(_0x4fd0fc){logger[_0x7956('0x10')](_0x7956('0x34'),_0x4fd0fc['name']);emit(util['format'](_0x7956('0x35'),_0x4fd0fc['name']),_0x7956('0x38'),{'sessionId':_0x1aaee5});return _0x4810ff[_0x7956('0x16')](0xc8)[_0x7956('0x2f')]({'error':![],'message':'hangup\x20executed!'});})[_0x7956('0x1e')](handleError(_0x4810ff));};exports[_0x7956('0x39')]=function(_0x57865d,_0x2f5d7d){logger['info'](_0x7956('0x3a'),_0x57865d[_0x7956('0x2d')]);var _0x1968ab=answerValidation[_0x7956('0x2e')](_0x57865d[_0x7956('0x2d')]);if(_0x1968ab['length']>0x0){return _0x2f5d7d['status'](0x190)[_0x7956('0x2f')](_0x1968ab);}var _0x475c42=_0x57865d[_0x7956('0x2d')][_0x7956('0x30')];var _0x23472d=_0x57865d[_0x7956('0x2d')]['sessionId'];return getAgent(_0x475c42)[_0x7956('0x1a')](function(_0x17589f){logger[_0x7956('0x10')](_0x7956('0x34'),_0x17589f[_0x7956('0x15')]);emit(util[_0x7956('0x3b')](_0x7956('0x35'),_0x17589f[_0x7956('0x15')]),_0x7956('0x3c'),{'sessionId':_0x23472d});return _0x2f5d7d[_0x7956('0x16')](0xc8)[_0x7956('0x2f')]({'error':![],'message':_0x7956('0x3d')});})[_0x7956('0x1e')](handleError(_0x2f5d7d));};exports[_0x7956('0x3e')]=function(_0x2d2c5e,_0x5c0fce){logger[_0x7956('0x10')]('hold\x20fired:',_0x2d2c5e['body']);var _0x45209c=holdValidation[_0x7956('0x2e')](_0x2d2c5e[_0x7956('0x2d')]);if(_0x45209c[_0x7956('0x28')]>0x0){return _0x5c0fce[_0x7956('0x16')](0x190)[_0x7956('0x2f')](_0x45209c);}var _0x441404=_0x2d2c5e[_0x7956('0x2d')][_0x7956('0x30')];var _0x1c6722=_0x2d2c5e[_0x7956('0x2d')][_0x7956('0x27')];return getAgent(_0x441404)[_0x7956('0x1a')](function(_0x2ba635){logger[_0x7956('0x10')](_0x7956('0x34'),_0x2ba635[_0x7956('0x15')]);emit(util[_0x7956('0x3b')](_0x7956('0x35'),_0x2ba635[_0x7956('0x15')]),_0x7956('0x3f'),{'sessionId':_0x1c6722});return _0x5c0fce[_0x7956('0x16')](0xc8)['json']({'error':![],'message':_0x7956('0x40')});})[_0x7956('0x1e')](handleError(_0x5c0fce));};exports[_0x7956('0x41')]=function(_0x493092,_0x385fb3){logger['info'](_0x7956('0x42'),_0x493092[_0x7956('0x2d')]);var _0x48c757=unholdValidation[_0x7956('0x2e')](_0x493092[_0x7956('0x2d')]);if(_0x48c757['length']>0x0){return _0x385fb3[_0x7956('0x16')](0x190)[_0x7956('0x2f')](_0x48c757);}var _0x52aa90=_0x493092[_0x7956('0x2d')][_0x7956('0x30')];var _0xc070ce=_0x493092[_0x7956('0x2d')][_0x7956('0x27')];return getAgent(_0x52aa90)[_0x7956('0x1a')](function(_0x455d3c){logger['info'](_0x7956('0x34'),_0x455d3c[_0x7956('0x15')]);emit(util[_0x7956('0x3b')](_0x7956('0x35'),_0x455d3c['name']),_0x7956('0x43'),{'sessionId':_0xc070ce});return _0x385fb3[_0x7956('0x16')](0xc8)[_0x7956('0x2f')]({'error':![],'message':_0x7956('0x44')});})[_0x7956('0x1e')](handleError(_0x385fb3));};exports[_0x7956('0x45')]=function(_0x23e7ee,_0x277d78){logger[_0x7956('0x10')](_0x7956('0x46'),_0x277d78[_0x7956('0x2d')]);var _0x1d2af8=callsValidation[_0x7956('0x2e')](_0x23e7ee[_0x7956('0x2d')]);if(_0x1d2af8['length']>0x0){return _0x277d78[_0x7956('0x16')](0x190)[_0x7956('0x2f')](_0x1d2af8);}var _0x40661a=_0x23e7ee[_0x7956('0x2d')]['userId'];var _0x196013=respondWithRpcPromise(_0x7956('0x22'));var _0x2122d3=getAgent(_0x40661a);return Promise[_0x7956('0x23')]([_0x196013,_0x2122d3])[_0x7956('0x1a')](function(_0x373dfa){var _0x3b8f7f=_0x373dfa[0x0];var _0x578a12=_0x373dfa[0x1];var _0x551501=_[_0x7956('0x24')](_0x3b8f7f['rows'],function(_0x1ca924){return _0x1ca924[_0x7956('0x26')]==_0x578a12['id'];});return _0x277d78[_0x7956('0x16')](0xc8)[_0x7956('0x2f')]({'count':_0x551501[_0x7956('0x28')],'rows':_0x551501});})[_0x7956('0x1e')](handleError(_0x277d78));};exports[_0x7956('0x47')]=function(_0x32e7b0,_0xaeda0b){logger['info'](_0x7956('0x48'),_0x32e7b0[_0x7956('0x2d')]);var _0x45cc68=conferenceValidation['validate'](_0x32e7b0[_0x7956('0x2d')]);if(_0x45cc68[_0x7956('0x28')]>0x0){return _0xaeda0b['status'](0x190)[_0x7956('0x2f')](_0x45cc68);}var _0x512088=_0x32e7b0[_0x7956('0x2d')][_0x7956('0x30')];return getAgent(_0x512088)[_0x7956('0x1a')](function(_0x1c440d){logger['info'](_0x7956('0x34'),_0x1c440d[_0x7956('0x15')]);emit(util[_0x7956('0x3b')]('user:%s',_0x1c440d[_0x7956('0x15')]),_0x7956('0x49'));return _0xaeda0b[_0x7956('0x16')](0xc8)[_0x7956('0x2f')]({'error':![],'message':_0x7956('0x4a')});})[_0x7956('0x1e')](handleError(_0xaeda0b));};exports['transfer']=function(_0x4fa4dd,_0x1c67dc){logger['info'](_0x7956('0x4b'),_0x4fa4dd['body']);var _0x28a06a=transferValidation[_0x7956('0x2e')](_0x4fa4dd[_0x7956('0x2d')]);if(_0x28a06a['length']>0x0){return _0x1c67dc['status'](0x190)[_0x7956('0x2f')](_0x28a06a);}var _0x40cbad=_0x4fa4dd[_0x7956('0x2d')][_0x7956('0x30')];var _0x5b0225=_0x4fa4dd[_0x7956('0x2d')][_0x7956('0x27')];var _0x16beac=_0x4fa4dd[_0x7956('0x2d')][_0x7956('0x4c')];return getAgent(_0x40cbad)[_0x7956('0x1a')](function(_0xf35ffd){logger['info'](_0x7956('0x34'),_0xf35ffd[_0x7956('0x15')]);emit(util[_0x7956('0x3b')](_0x7956('0x35'),_0xf35ffd[_0x7956('0x15')]),_0x7956('0x4d'),{'sessionId':_0x5b0225,'transferNumber':_0x16beac});return _0x1c67dc['status'](0xc8)[_0x7956('0x2f')]({'error':![],'message':_0x7956('0x4e')});})[_0x7956('0x1e')](handleError(_0x1c67dc));}; \ No newline at end of file +var _0x6f0d=['log','handleError:','error','stack','name','status','send','NotFound','request','code','message','result','User','findOne','agent','then','VoiceChannels','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','userId','callNumber','callbackUrl','format','json','originate\x20executed!','catch','hangup','entityFound:','user:%s','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','all','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','webbar:transfer','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','http','../../config/logger','webbarapi','redis','localhost','socket.io-emitter','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit'];(function(_0x48c3bd,_0x4ccd82){var _0x18631b=function(_0x4142a6){while(--_0x4142a6){_0x48c3bd['push'](_0x48c3bd['shift']());}};_0x18631b(++_0x4ccd82);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x32060e,_0x97c2aa){_0x32060e=_0x32060e-0x0;var _0x20cbbc=_0x6f0d[_0x32060e];return _0x20cbbc;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xd6f0('0x0'));var db=require(_0xd6f0('0x1'))['db'];var config=require(_0xd6f0('0x2'));var util=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var jayson=require(_0xd6f0('0x4'));var amiClient=jayson[_0xd6f0('0x5')][_0xd6f0('0x6')]({'port':0x232a});var logger=require(_0xd6f0('0x7'))(_0xd6f0('0x8'));var Redis=require('ioredis');config[_0xd6f0('0x9')]=_['defaults'](config[_0xd6f0('0x9')],{'host':_0xd6f0('0xa'),'port':0x18eb});var io=require(_0xd6f0('0xb'))(new Redis(config[_0xd6f0('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xd6f0('0xc')]},'callNumber':{'type':_0xd6f0('0xd'),'required':[!![],_0xd6f0('0xe')]},'callerId':{'type':_0xd6f0('0xd')},'callbackUrl':{'type':_0xd6f0('0xd')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xd6f0('0xc')]},'sessionId':{'type':_0xd6f0('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xd6f0('0xf'),'required':[!![],_0xd6f0('0xc')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xd6f0('0xf'),'required':[!![],_0xd6f0('0xc')]},'sessionId':{'type':_0xd6f0('0xd'),'required':[!![],_0xd6f0('0x10')]},'transferNumber':{'type':_0xd6f0('0xd'),'required':[!![],_0xd6f0('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xd6f0('0xf'),'required':[!![],_0xd6f0('0xc')]},'sessionId':{'type':_0xd6f0('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xd6f0('0xc')]},'sessionId':{'type':_0xd6f0('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xd6f0('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xd6f0('0xc')]}});function emit(_0x154e3e,_0x41bd99,_0x472156){logger[_0xd6f0('0x12')](_0x154e3e,_0x41bd99,JSON[_0xd6f0('0x13')](_0x472156));io['to'](_0x154e3e)[_0xd6f0('0x14')](_0x41bd99,_0x472156);}function handleError(_0x29fbb9){return function(_0x2e71bd){console[_0xd6f0('0x15')](_0xd6f0('0x16'),_0x2e71bd,_0x2e71bd instanceof RangeError);logger[_0xd6f0('0x17')](_0x2e71bd[_0xd6f0('0x18')]);if(_0x2e71bd instanceof RangeError){if(_0x2e71bd[_0xd6f0('0x19')]){delete _0x2e71bd[_0xd6f0('0x19')];}_0x29fbb9[_0xd6f0('0x1a')](0x194)['send'](_0x2e71bd);}else{if(_0x2e71bd['name']){delete _0x2e71bd[_0xd6f0('0x19')];}_0x29fbb9[_0xd6f0('0x1a')](0x1f4)[_0xd6f0('0x1b')](_0x2e71bd);}};}function checkError(){return function(_0x54300d){if(!_0x54300d){throw new RangeError(_0xd6f0('0x1c'));}return _0x54300d;};}function respondWithRpcPromise(_0x19a545,_0x557c9b){return new BPromise(function(_0x86dde0,_0x515687){var _0x1ee584=amiClient;return _0x1ee584[_0xd6f0('0x1d')](_0x19a545,_0x557c9b)['then'](function(_0xb9e820){if(_0xb9e820[_0xd6f0('0x17')]){if(_0xb9e820['error'][_0xd6f0('0x1e')]===0x1f4){return _0x515687(_0xb9e820[_0xd6f0('0x17')][_0xd6f0('0x1f')]);}return _0x86dde0(_0xb9e820['error'][_0xd6f0('0x1f')]);}else{_0x86dde0(_0xb9e820[_0xd6f0('0x20')]);}})['catch'](function(_0xcea0ae){_0x515687(_0xcea0ae);});});}function getAgent(_0x551be8){return db[_0xd6f0('0x21')][_0xd6f0('0x22')]({'where':{'id':_0x551be8,'role':_0xd6f0('0x23')}})[_0xd6f0('0x24')](checkError());}function getAgentCheckSession(_0x4101bd,_0x715aab){return new BPromise(function(_0x12d6ec,_0x26799c){var _0x48975d=respondWithRpcPromise(_0xd6f0('0x25'));var _0x1982d3=getAgent(_0x4101bd);Promise['all']([_0x48975d,_0x1982d3])[_0xd6f0('0x24')](function(_0x385947){var _0x27db5e=_0x385947[0x0];var _0xb61222=_0x385947[0x1];var _0x1a3967=_[_0xd6f0('0x26')](_0x27db5e[_0xd6f0('0x27')],function(_0x3151f8){return _0x3151f8[_0xd6f0('0x28')]==_0xb61222['id']&&_0x3151f8[_0xd6f0('0x29')]==_0x715aab;});if(_0x1a3967[_0xd6f0('0x2a')]==0x1){_0x12d6ec(_0xb61222);}else{_0x26799c(new RangeError(_0xd6f0('0x2b')+_0x715aab+_0xd6f0('0x2c')));}});});}exports[_0xd6f0('0x2d')]=function(_0xbdd223,_0x2d7c90){logger[_0xd6f0('0x12')](_0xd6f0('0x2e'),_0xbdd223[_0xd6f0('0x2f')]);var _0x180e5f=originateValidation[_0xd6f0('0x30')](_0xbdd223[_0xd6f0('0x2f')]);if(_0x180e5f['length']>0x0){return _0x2d7c90[_0xd6f0('0x1a')](0x190)['json'](_0x180e5f);}var _0x58d2c5=_0xbdd223[_0xd6f0('0x2f')][_0xd6f0('0x31')];var _0x12a6fa=_0xbdd223[_0xd6f0('0x2f')][_0xd6f0('0x32')];var _0x5c482f=_0xbdd223[_0xd6f0('0x2f')]['callerId'];var _0x27b5b0=_0xbdd223[_0xd6f0('0x2f')][_0xd6f0('0x33')];return getAgent(_0x58d2c5)[_0xd6f0('0x24')](function(_0x518751){logger['info']('entityFound:',_0x518751[_0xd6f0('0x19')]);emit(util[_0xd6f0('0x34')]('user:%s',_0x518751[_0xd6f0('0x19')]),'webbar:originate',{'callNumber':_0x12a6fa,'callerId':_0x5c482f,'callbackUrl':_0x27b5b0});return _0x2d7c90[_0xd6f0('0x1a')](0xc8)[_0xd6f0('0x35')]({'error':![],'message':_0xd6f0('0x36')});})[_0xd6f0('0x37')](handleError(_0x2d7c90));};exports[_0xd6f0('0x38')]=function(_0x3d1280,_0x6b44fa){logger['info']('hangup\x20fired:',_0x3d1280[_0xd6f0('0x2f')]);var _0xf879a6=hangupValidation[_0xd6f0('0x30')](_0x3d1280['body']);if(_0xf879a6['length']>0x0){return _0x6b44fa[_0xd6f0('0x1a')](0x190)[_0xd6f0('0x35')](_0xf879a6);}var _0x39fd07=_0x3d1280[_0xd6f0('0x2f')][_0xd6f0('0x31')];var _0x2b5df5=_0x3d1280[_0xd6f0('0x2f')][_0xd6f0('0x29')];return getAgent(_0x39fd07)['then'](function(_0x1af620){logger[_0xd6f0('0x12')](_0xd6f0('0x39'),_0x1af620[_0xd6f0('0x19')]);emit(util['format'](_0xd6f0('0x3a'),_0x1af620[_0xd6f0('0x19')]),_0xd6f0('0x3b'),{'sessionId':_0x2b5df5});return _0x6b44fa[_0xd6f0('0x1a')](0xc8)[_0xd6f0('0x35')]({'error':![],'message':'hangup\x20executed!'});})[_0xd6f0('0x37')](handleError(_0x6b44fa));};exports[_0xd6f0('0x3c')]=function(_0x412f55,_0x5848dc){logger[_0xd6f0('0x12')](_0xd6f0('0x3d'),_0x412f55['body']);var _0x516ffd=answerValidation[_0xd6f0('0x30')](_0x412f55[_0xd6f0('0x2f')]);if(_0x516ffd[_0xd6f0('0x2a')]>0x0){return _0x5848dc['status'](0x190)[_0xd6f0('0x35')](_0x516ffd);}var _0x2d32f0=_0x412f55['body'][_0xd6f0('0x31')];var _0x3080eb=_0x412f55[_0xd6f0('0x2f')][_0xd6f0('0x29')];return getAgent(_0x2d32f0)['then'](function(_0x664096){logger[_0xd6f0('0x12')](_0xd6f0('0x39'),_0x664096[_0xd6f0('0x19')]);emit(util[_0xd6f0('0x34')](_0xd6f0('0x3a'),_0x664096[_0xd6f0('0x19')]),_0xd6f0('0x3e'),{'sessionId':_0x3080eb});return _0x5848dc['status'](0xc8)[_0xd6f0('0x35')]({'error':![],'message':_0xd6f0('0x3f')});})['catch'](handleError(_0x5848dc));};exports[_0xd6f0('0x40')]=function(_0x39ca69,_0x1bcb36){logger[_0xd6f0('0x12')]('hold\x20fired:',_0x39ca69[_0xd6f0('0x2f')]);var _0xe5fd11=holdValidation['validate'](_0x39ca69['body']);if(_0xe5fd11[_0xd6f0('0x2a')]>0x0){return _0x1bcb36['status'](0x190)[_0xd6f0('0x35')](_0xe5fd11);}var _0x61b354=_0x39ca69[_0xd6f0('0x2f')]['userId'];var _0x1ddce2=_0x39ca69[_0xd6f0('0x2f')][_0xd6f0('0x29')];return getAgent(_0x61b354)[_0xd6f0('0x24')](function(_0xc4147e){logger['info'](_0xd6f0('0x39'),_0xc4147e['name']);emit(util[_0xd6f0('0x34')](_0xd6f0('0x3a'),_0xc4147e[_0xd6f0('0x19')]),_0xd6f0('0x41'),{'sessionId':_0x1ddce2});return _0x1bcb36['status'](0xc8)['json']({'error':![],'message':_0xd6f0('0x42')});})[_0xd6f0('0x37')](handleError(_0x1bcb36));};exports['unhold']=function(_0xa68b18,_0x56c448){logger[_0xd6f0('0x12')](_0xd6f0('0x43'),_0xa68b18[_0xd6f0('0x2f')]);var _0x41d115=unholdValidation[_0xd6f0('0x30')](_0xa68b18['body']);if(_0x41d115[_0xd6f0('0x2a')]>0x0){return _0x56c448[_0xd6f0('0x1a')](0x190)[_0xd6f0('0x35')](_0x41d115);}var _0x25d0a9=_0xa68b18[_0xd6f0('0x2f')][_0xd6f0('0x31')];var _0x211773=_0xa68b18[_0xd6f0('0x2f')]['sessionId'];return getAgent(_0x25d0a9)[_0xd6f0('0x24')](function(_0x3eb4dc){logger[_0xd6f0('0x12')](_0xd6f0('0x39'),_0x3eb4dc[_0xd6f0('0x19')]);emit(util[_0xd6f0('0x34')](_0xd6f0('0x3a'),_0x3eb4dc[_0xd6f0('0x19')]),_0xd6f0('0x44'),{'sessionId':_0x211773});return _0x56c448['status'](0xc8)[_0xd6f0('0x35')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x56c448));};exports[_0xd6f0('0x45')]=function(_0x55fd25,_0x539ef1){logger[_0xd6f0('0x12')](_0xd6f0('0x46'),_0x539ef1[_0xd6f0('0x2f')]);var _0x47a159=callsValidation[_0xd6f0('0x30')](_0x55fd25[_0xd6f0('0x2f')]);if(_0x47a159[_0xd6f0('0x2a')]>0x0){return _0x539ef1['status'](0x190)[_0xd6f0('0x35')](_0x47a159);}var _0x357193=_0x55fd25['body'][_0xd6f0('0x31')];var _0x328e0a=respondWithRpcPromise('VoiceChannels');var _0x3558ac=getAgent(_0x357193);return Promise[_0xd6f0('0x47')]([_0x328e0a,_0x3558ac])[_0xd6f0('0x24')](function(_0x1d9972){var _0x3e6533=_0x1d9972[0x0];var _0x48bfb3=_0x1d9972[0x1];var _0x291e7b=_[_0xd6f0('0x26')](_0x3e6533['rows'],function(_0x26d728){return _0x26d728[_0xd6f0('0x28')]==_0x48bfb3['id'];});return _0x539ef1[_0xd6f0('0x1a')](0xc8)['json']({'count':_0x291e7b[_0xd6f0('0x2a')],'rows':_0x291e7b});})['catch'](handleError(_0x539ef1));};exports['conference']=function(_0x4bdedd,_0x5c5aa4){logger[_0xd6f0('0x12')](_0xd6f0('0x48'),_0x4bdedd[_0xd6f0('0x2f')]);var _0x1febb7=conferenceValidation['validate'](_0x4bdedd[_0xd6f0('0x2f')]);if(_0x1febb7['length']>0x0){return _0x5c5aa4[_0xd6f0('0x1a')](0x190)[_0xd6f0('0x35')](_0x1febb7);}var _0x2ba889=_0x4bdedd['body'][_0xd6f0('0x31')];return getAgent(_0x2ba889)[_0xd6f0('0x24')](function(_0x269dd7){logger[_0xd6f0('0x12')]('entityFound:',_0x269dd7[_0xd6f0('0x19')]);emit(util[_0xd6f0('0x34')](_0xd6f0('0x3a'),_0x269dd7['name']),_0xd6f0('0x49'));return _0x5c5aa4[_0xd6f0('0x1a')](0xc8)[_0xd6f0('0x35')]({'error':![],'message':_0xd6f0('0x4a')});})['catch'](handleError(_0x5c5aa4));};exports[_0xd6f0('0x4b')]=function(_0x2082b5,_0x1096e0){logger[_0xd6f0('0x12')]('transfer\x20fired:',_0x2082b5['body']);var _0x490bc4=transferValidation['validate'](_0x2082b5[_0xd6f0('0x2f')]);if(_0x490bc4[_0xd6f0('0x2a')]>0x0){return _0x1096e0[_0xd6f0('0x1a')](0x190)[_0xd6f0('0x35')](_0x490bc4);}var _0x318a64=_0x2082b5[_0xd6f0('0x2f')][_0xd6f0('0x31')];var _0x1b298a=_0x2082b5[_0xd6f0('0x2f')]['sessionId'];var _0x55f96e=_0x2082b5[_0xd6f0('0x2f')]['transferNumber'];return getAgent(_0x318a64)[_0xd6f0('0x24')](function(_0x3a85bd){logger[_0xd6f0('0x12')](_0xd6f0('0x39'),_0x3a85bd[_0xd6f0('0x19')]);emit(util[_0xd6f0('0x34')](_0xd6f0('0x3a'),_0x3a85bd['name']),_0xd6f0('0x4c'),{'sessionId':_0x1b298a,'transferNumber':_0x55f96e});return _0x1096e0[_0xd6f0('0x1a')](0xc8)[_0xd6f0('0x35')]({'error':![],'message':'transfer\x20executed!'});})[_0xd6f0('0x37')](handleError(_0x1096e0));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index d3e4024..6e05f4b 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 _0x524e=['index','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','put','update','delete','destroy','removeAnswers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get'];(function(_0x4e0eb9,_0x4e8b98){var _0x1f8c3c=function(_0x37a4b7){while(--_0x37a4b7){_0x4e0eb9['push'](_0x4e0eb9['shift']());}};_0x1f8c3c(++_0x4e8b98);}(_0x524e,0x15e));var _0xe524=function(_0x3f191c,_0x1c13e7){_0x3f191c=_0x3f191c-0x0;var _0x2c3841=_0x524e[_0x3f191c];return _0x2c3841;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x9')](_0xe524('0x10'),auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x9')](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x9')](_0xe524('0x14'),auth[_0xe524('0xe')](),controller['getAgents']);router['get'](_0xe524('0x15'),auth[_0xe524('0xe')](),controller[_0xe524('0x16')]);router[_0xe524('0x17')]('/',auth[_0xe524('0xe')](),controller['create']);router[_0xe524('0x17')]('/:id/dispositions',auth[_0xe524('0xe')](),controller[_0xe524('0x18')]);router['post'](_0xe524('0x12'),auth['isAuthenticated'](),controller[_0xe524('0x19')]);router['post'](_0xe524('0x14'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0xe524('0x15'),auth['isAuthenticated'](),controller[_0xe524('0x1a')]);router[_0xe524('0x17')](_0xe524('0x1b'),controller[_0xe524('0x1c')]);router['post'](_0xe524('0x1d'),auth[_0xe524('0xe')](),controller['send']);router[_0xe524('0x1e')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x1f')]);router[_0xe524('0x20')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x21')]);router[_0xe524('0x20')]('/:id/dispositions',auth[_0xe524('0xe')](),controller['removeDispositions']);router['delete'](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x22')]);router[_0xe524('0x20')]('/:id/users',auth[_0xe524('0xe')](),controller['removeAgents']);module[_0xe524('0x23')]=router; \ No newline at end of file +var _0x8e3f=['addDisposition','addAgents','addApplications','/:id/notify','/:id/send','send','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','create'];(function(_0x32c2b2,_0x395889){var _0x241f1a=function(_0x1fea96){while(--_0x1fea96){_0x32c2b2['push'](_0x32c2b2['shift']());}};_0x241f1a(++_0x395889);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8e3f[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var path=require(_0xf8e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xf8e3('0x3'));var router=express[_0xf8e3('0x4')]();var fs_extra=require(_0xf8e3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf8e3('0x6'));var config=require(_0xf8e3('0x7'));var controller=require('./whatsappAccount.controller');router[_0xf8e3('0x8')]('/',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xa')]);router[_0xf8e3('0x8')]('/describe',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xb')]);router[_0xf8e3('0x8')](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xd')]);router[_0xf8e3('0x8')](_0xf8e3('0xe'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xf')]);router[_0xf8e3('0x8')](_0xf8e3('0x10'),auth['isAuthenticated'](),controller[_0xf8e3('0x11')]);router[_0xf8e3('0x8')](_0xf8e3('0x12'),auth['isAuthenticated'](),controller[_0xf8e3('0x13')]);router[_0xf8e3('0x8')](_0xf8e3('0x14'),auth[_0xf8e3('0x9')](),controller['getApplications']);router[_0xf8e3('0x15')]('/',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x16')]);router['post'](_0xf8e3('0xe'),auth['isAuthenticated'](),controller[_0xf8e3('0x17')]);router[_0xf8e3('0x15')](_0xf8e3('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xf8e3('0x15')](_0xf8e3('0x12'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x18')]);router[_0xf8e3('0x15')](_0xf8e3('0x14'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x19')]);router[_0xf8e3('0x15')](_0xf8e3('0x1a'),controller['notify']);router[_0xf8e3('0x15')](_0xf8e3('0x1b'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1c')]);router[_0xf8e3('0x1d')](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1e')]);router['delete'](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1f')]);router[_0xf8e3('0x20')]('/:id/dispositions',auth[_0xf8e3('0x9')](),controller['removeDispositions']);router[_0xf8e3('0x20')](_0xf8e3('0x10'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x21')]);router[_0xf8e3('0x20')](_0xf8e3('0x12'),auth['isAuthenticated'](),controller[_0xf8e3('0x22')]);module[_0xf8e3('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index d905dd3..9c71bf9 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 _0x3866=['randomstring','exports','STRING','name','generate','twilio','TEXT','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x6c9266,_0x3e39dc){var _0x1f0122=function(_0x563486){while(--_0x563486){_0x6c9266['push'](_0x6c9266['shift']());}};_0x1f0122(++_0x3e39dc);}(_0x3866,0xf0));var _0x6386=function(_0x3341af,_0x1e9ace){_0x3341af=_0x3341af-0x0;var _0x5b7003=_0x3866[_0x3341af];return _0x5b7003;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x6386('0x0'));module[_0x6386('0x1')]={'name':{'type':Sequelize[_0x6386('0x2')],'unique':_0x6386('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x6386('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x6386('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x6386('0x2')],'defaultValue':function(){return rs[_0x6386('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x6386('0x5'),'sinch')},'accountSid':{'type':Sequelize[_0x6386('0x2')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x6386('0x2')]},'notificationTemplate':{'type':Sequelize[_0x6386('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6386('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6386('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6386('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6386('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6386('0x7')],'comment':_0x6386('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x6386('0x8')],'defaultValue':![],'comment':_0x6386('0xa'),'set':function(_0x1f977f){if(!_0x1f977f){this[_0x6386('0xb')]('mandatoryDispositionPauseId',null);}this['setDataValue']('mandatoryDisposition',_0x1f977f);}},'description':{'type':Sequelize[_0x6386('0x2')]}}; \ No newline at end of file +var _0xb105=['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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','name','generate','ENUM','twilio'];(function(_0x1e7b6f,_0x271368){var _0x51552a=function(_0x153a1c){while(--_0x153a1c){_0x1e7b6f['push'](_0x1e7b6f['shift']());}};_0x51552a(++_0x271368);}(_0xb105,0x149));var _0x5b10=function(_0xb0ac19,_0x3fc01d){_0xb0ac19=_0xb0ac19-0x0;var _0x17e80e=_0xb105[_0xb0ac19];return _0x17e80e;};'use strict';var Sequelize=require(_0x5b10('0x0'));var rs=require('randomstring');module[_0x5b10('0x1')]={'name':{'type':Sequelize[_0x5b10('0x2')],'unique':_0x5b10('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x5b10('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x5b10('0x2')],'defaultValue':function(){return rs[_0x5b10('0x4')]();}},'phone':{'type':Sequelize[_0x5b10('0x2')]},'type':{'type':Sequelize[_0x5b10('0x5')](_0x5b10('0x6'),_0x5b10('0x7'))},'accountSid':{'type':Sequelize[_0x5b10('0x2')]},'baseUrl':{'type':Sequelize[_0x5b10('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5b10('0x8')],'defaultValue':function(){return _0x5b10('0x9');}},'notificationSound':{'type':Sequelize[_0x5b10('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5b10('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5b10('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5b10('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5b10('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5b10('0xb')],'comment':_0x5b10('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x5b10('0xa')],'defaultValue':![],'comment':_0x5b10('0xd'),'set':function(_0x32f7bf){if(!_0x32f7bf){this['setDataValue']('mandatoryDispositionPauseId',null);}this[_0x5b10('0xe')](_0x5b10('0xf'),_0x32f7bf);}},'description':{'type':Sequelize[_0x5b10('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index b35a3f7..832a77d 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 _0xf095=['VIRTUAL','includeAll','rows','params','keys','rawAttributes','length','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','WhatsappAccountId','Disposition','findOne','hasOwnProperty','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','ids','spread','emit','userWhatsappAccount:save','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','timestamp','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','replace','Body','MessageSid','sinch','notifications','messageId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','omit','contact','WhatsappInteraction','interaction','autoclose','push','created','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','List','user','out','dataValues','Messages','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0xa388a2,_0x40bde6){var _0x7ce7f6=function(_0x5a242a){while(--_0x5a242a){_0xa388a2['push'](_0xa388a2['shift']());}};_0x7ce7f6(++_0x40bde6);}(_0xf095,0x129));var _0x5f09=function(_0x20f9bc,_0x1057f0){_0x20f9bc=_0x20f9bc-0x0;var _0x2060a4=_0xf095[_0x20f9bc];return _0x2060a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f09('0x0'));var zipdir=require(_0x5f09('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f09('0x2'));var moment=require('moment');var BPromise=require(_0x5f09('0x3'));var Mustache=require('mustache');var util=require(_0x5f09('0x4'));var path=require(_0x5f09('0x5'));var sox=require(_0x5f09('0x6'));var csv=require(_0x5f09('0x7'));var ejs=require(_0x5f09('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5f09('0x7'));var querystring=require(_0x5f09('0x9'));var Papa=require(_0x5f09('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5f09('0xb'));var hardwareService=require(_0x5f09('0xc'));var logger=require(_0x5f09('0xd'))(_0x5f09('0xe'));var utils=require(_0x5f09('0xf'));var config=require(_0x5f09('0x10'));var licenseUtil=require(_0x5f09('0x11'));var db=require(_0x5f09('0x12'))['db'];config[_0x5f09('0x13')]=_[_0x5f09('0x14')](config[_0x5f09('0x13')],{'host':_0x5f09('0x15'),'port':0x18eb});var socket=require(_0x5f09('0x16'))(new Redis(config['redis']));require(_0x5f09('0x17'))[_0x5f09('0x18')](socket);var jayson=require(_0x5f09('0x19'));var client=jayson[_0x5f09('0x1a')][_0x5f09('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x3dca13,_0x40faa6,_0x2be9ac,_0xd9a698){return new BPromise(function(_0x19ffa7,_0x406bd5){var _0x11b96a=_0xd9a698||client;return _0x11b96a[_0x5f09('0x1c')](_0x3dca13,_0x2be9ac)[_0x5f09('0x1d')](function(_0x4b2e43){logger[_0x5f09('0x1e')]('WhatsappAccount,\x20%s,\x20%s',_0x40faa6,_0x5f09('0x1f'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x40faa6,_0x5f09('0x1f'),JSON[_0x5f09('0x20')](_0x4b2e43));if(_0x4b2e43[_0x5f09('0x21')]){if(_0x4b2e43['error'][_0x5f09('0x22')]===0x1f4){logger[_0x5f09('0x21')](_0x5f09('0x23'),_0x40faa6,_0x4b2e43[_0x5f09('0x21')][_0x5f09('0x24')]);return _0x406bd5(_0x4b2e43['error'][_0x5f09('0x24')]);}logger[_0x5f09('0x21')](_0x5f09('0x23'),_0x40faa6,_0x4b2e43[_0x5f09('0x21')][_0x5f09('0x24')]);return _0x19ffa7(_0x4b2e43['error']['message']);}else{logger['info'](_0x5f09('0x23'),_0x40faa6,_0x5f09('0x1f'));_0x19ffa7(_0x4b2e43[_0x5f09('0x25')]['message']);}})[_0x5f09('0x26')](function(_0x510adf){logger[_0x5f09('0x21')](_0x5f09('0x23'),_0x40faa6,_0x510adf);_0x406bd5(_0x510adf);});});}function respondWithStatusCode(_0x5a4912,_0x48b4ea){_0x48b4ea=_0x48b4ea||0xcc;return function(_0x871304){if(_0x871304){return _0x5a4912[_0x5f09('0x27')](_0x48b4ea);}return _0x5a4912[_0x5f09('0x28')](_0x48b4ea)[_0x5f09('0x29')]();};}function respondWithResult(_0x6c96fb,_0x368dad){_0x368dad=_0x368dad||0xc8;return function(_0x434ee6){if(_0x434ee6){return _0x6c96fb[_0x5f09('0x28')](_0x368dad)[_0x5f09('0x2a')](_0x434ee6);}};}function respondWithFilteredResult(_0x5b0b2f,_0x42c1bc){return function(_0x4d6b09){if(_0x4d6b09){var _0x539f40=typeof _0x42c1bc[_0x5f09('0x2b')]===_0x5f09('0x2c')&&typeof _0x42c1bc[_0x5f09('0x2d')]===_0x5f09('0x2c');var _0x5d791f=_0x4d6b09[_0x5f09('0x2e')];var _0x2bd9a4=_0x539f40?0x0:_0x42c1bc['offset'];var _0x4608ab=_0x539f40?_0x4d6b09[_0x5f09('0x2e')]:_0x42c1bc[_0x5f09('0x2b')]+_0x42c1bc[_0x5f09('0x2d')];var _0x4702ae;if(_0x4608ab>=_0x5d791f){_0x4608ab=_0x5d791f;_0x4702ae=0xc8;}else{_0x4702ae=0xce;}_0x5b0b2f[_0x5f09('0x28')](_0x4702ae);return _0x5b0b2f['set']('Content-Range',_0x2bd9a4+'-'+_0x4608ab+'/'+_0x5d791f)['json'](_0x4d6b09);}return null;};}function patchUpdates(_0x1310ee){return function(_0x4514a8){try{jsonpatch[_0x5f09('0x2f')](_0x4514a8,_0x1310ee,!![]);}catch(_0x308cd7){return BPromise[_0x5f09('0x30')](_0x308cd7);}return _0x4514a8[_0x5f09('0x31')]();};}function saveUpdates(_0x1b5fa2,_0x5825f1){return function(_0x3d70a2){if(_0x3d70a2){return _0x3d70a2[_0x5f09('0x32')](_0x1b5fa2)[_0x5f09('0x1d')](function(_0x2d19cc){return _0x2d19cc;});}return null;};}function removeEntity(_0xfc5373,_0xa874f1){return function(_0xd7a298){if(_0xd7a298){return _0xd7a298[_0x5f09('0x33')]()[_0x5f09('0x1d')](function(){var _0x2dccdf=_0xd7a298[_0x5f09('0x34')]({'plain':!![]});var _0x62f7cd=_0x5f09('0x35');return db[_0x5f09('0x36')]['destroy']({'where':{'type':_0x62f7cd,'resourceId':_0x2dccdf['id']}})['then'](function(){return _0xd7a298;});})[_0x5f09('0x1d')](function(){_0xfc5373[_0x5f09('0x28')](0xcc)[_0x5f09('0x29')]();});}};}function handleEntityNotFound(_0x578f86,_0x15ff5d){return function(_0x3cc353){if(!_0x3cc353){_0x578f86[_0x5f09('0x27')](0x194);}return _0x3cc353;};}function handleError(_0x158f51,_0x2bcd2f){_0x2bcd2f=_0x2bcd2f||0x1f4;return function(_0x2c8bce){logger[_0x5f09('0x21')](_0x2c8bce[_0x5f09('0x37')]);if(_0x2c8bce[_0x5f09('0x38')]){delete _0x2c8bce[_0x5f09('0x38')];}_0x158f51[_0x5f09('0x28')](_0x2bcd2f)[_0x5f09('0x39')](_0x2c8bce);};}exports[_0x5f09('0x3a')]=function(_0x20cbdc,_0x38b28c){var _0x8d92e9={'include':[{'model':db[_0x5f09('0x3b')],'as':_0x5f09('0x3c')}]},_0x33f361={},_0x50fe2b={'count':0x0,'rows':[]};var _0x40ec50=_[_0x5f09('0x3d')](db[_0x5f09('0x3e')]['rawAttributes'],function(_0x691583){return{'name':_0x691583[_0x5f09('0x3f')],'type':_0x691583[_0x5f09('0x40')][_0x5f09('0x41')]};});_0x33f361[_0x5f09('0x42')]=_[_0x5f09('0x3d')](_0x40ec50,_0x5f09('0x38'));_0x33f361[_0x5f09('0x43')]=_['keys'](_0x20cbdc[_0x5f09('0x43')]);_0x33f361['filters']=_[_0x5f09('0x44')](_0x33f361[_0x5f09('0x42')],_0x33f361[_0x5f09('0x43')]);_0x8d92e9[_0x5f09('0x45')]=_[_0x5f09('0x44')](_0x33f361['model'],qs[_0x5f09('0x46')](_0x20cbdc[_0x5f09('0x43')]['fields']));_0x8d92e9['attributes']=_0x8d92e9['attributes']['length']?_0x8d92e9[_0x5f09('0x45')]:_0x33f361[_0x5f09('0x42')];if(!_0x20cbdc[_0x5f09('0x43')]['hasOwnProperty'](_0x5f09('0x47'))){_0x8d92e9[_0x5f09('0x2d')]=qs[_0x5f09('0x2d')](_0x20cbdc[_0x5f09('0x43')][_0x5f09('0x2d')]);_0x8d92e9['offset']=qs[_0x5f09('0x2b')](_0x20cbdc[_0x5f09('0x43')][_0x5f09('0x2b')]);}_0x8d92e9[_0x5f09('0x48')]=qs[_0x5f09('0x49')](_0x20cbdc[_0x5f09('0x43')]['sort']);_0x8d92e9[_0x5f09('0x4a')]=qs[_0x5f09('0x4b')](_[_0x5f09('0x4c')](_0x20cbdc[_0x5f09('0x43')],_0x33f361[_0x5f09('0x4b')]),_0x40ec50);if(_0x20cbdc[_0x5f09('0x43')][_0x5f09('0x4d')]){_0x8d92e9['where']=_[_0x5f09('0x4e')](_0x8d92e9[_0x5f09('0x4a')],{'$or':_[_0x5f09('0x3d')](_0x40ec50,function(_0x12649f){if(_0x12649f[_0x5f09('0x40')]!==_0x5f09('0x4f')){var _0x1c5e2b={};_0x1c5e2b[_0x12649f[_0x5f09('0x38')]]={'$like':'%'+_0x20cbdc['query']['filter']+'%'};return _0x1c5e2b;}})});}_0x8d92e9=_[_0x5f09('0x4e')]({},_0x8d92e9,_0x20cbdc['options']);var _0x5122c7={'where':_0x8d92e9[_0x5f09('0x4a')]};return db[_0x5f09('0x3e')][_0x5f09('0x2e')](_0x5122c7)[_0x5f09('0x1d')](function(_0x7eb702){_0x50fe2b['count']=_0x7eb702;if(_0x20cbdc[_0x5f09('0x43')][_0x5f09('0x50')]){_0x8d92e9['include']=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x8d92e9);})[_0x5f09('0x1d')](function(_0x408160){_0x50fe2b[_0x5f09('0x51')]=_0x408160;return _0x50fe2b;})[_0x5f09('0x1d')](respondWithFilteredResult(_0x38b28c,_0x8d92e9))[_0x5f09('0x26')](handleError(_0x38b28c,null));};exports['show']=function(_0x4f9a6f,_0x3918fb){var _0x368289={'raw':![],'where':{'id':_0x4f9a6f[_0x5f09('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0x5f09('0x3c')}]},_0x232f02={};_0x232f02[_0x5f09('0x42')]=_[_0x5f09('0x53')](db[_0x5f09('0x3e')][_0x5f09('0x54')]);_0x232f02['query']=_[_0x5f09('0x53')](_0x4f9a6f[_0x5f09('0x43')]);_0x232f02[_0x5f09('0x4b')]=_[_0x5f09('0x44')](_0x232f02['model'],_0x232f02[_0x5f09('0x43')]);_0x368289[_0x5f09('0x45')]=_[_0x5f09('0x44')](_0x232f02[_0x5f09('0x42')],qs[_0x5f09('0x46')](_0x4f9a6f[_0x5f09('0x43')]['fields']));_0x368289[_0x5f09('0x45')]=_0x368289[_0x5f09('0x45')][_0x5f09('0x55')]?_0x368289[_0x5f09('0x45')]:_0x232f02[_0x5f09('0x42')];if(_0x4f9a6f[_0x5f09('0x43')][_0x5f09('0x50')]){_0x368289[_0x5f09('0x56')]=[{'all':!![]}];}_0x368289=_[_0x5f09('0x4e')]({},_0x368289,_0x4f9a6f[_0x5f09('0x57')]);return db[_0x5f09('0x3e')][_0x5f09('0x58')](_0x368289)['then'](handleEntityNotFound(_0x3918fb,null))[_0x5f09('0x1d')](respondWithResult(_0x3918fb,null))[_0x5f09('0x26')](handleError(_0x3918fb,null));};exports[_0x5f09('0x59')]=function(_0x27e2fa,_0x2b0e52){return db['WhatsappAccount'][_0x5f09('0x59')](_0x27e2fa[_0x5f09('0x5a')],{})[_0x5f09('0x1d')](function(_0x36c32b){var _0x40f2a2=_0x27e2fa['user'][_0x5f09('0x34')]({'plain':!![]});if(!_0x40f2a2)throw new Error(_0x5f09('0x5b'));if(_0x40f2a2['role']==='user'){var _0x2affee=_0x36c32b[_0x5f09('0x34')]({'plain':!![]});var _0x292202=_0x5f09('0x35');return db[_0x5f09('0x5c')]['find']({'where':{'name':_0x292202,'userProfileId':_0x40f2a2[_0x5f09('0x5d')]},'raw':!![]})[_0x5f09('0x1d')](function(_0x911449){if(_0x911449&&_0x911449[_0x5f09('0x5e')]===0x0){return db[_0x5f09('0x36')]['create']({'name':_0x2affee[_0x5f09('0x38')],'resourceId':_0x2affee['id'],'type':_0x911449[_0x5f09('0x38')],'sectionId':_0x911449['id']},{})['then'](function(){return _0x36c32b;});}else{return _0x36c32b;}})[_0x5f09('0x26')](function(_0x22e795){logger[_0x5f09('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22e795);throw _0x22e795;});}return _0x36c32b;})[_0x5f09('0x1d')](respondWithResult(_0x2b0e52,0xc9))['catch'](handleError(_0x2b0e52,null));};exports[_0x5f09('0x32')]=function(_0x507c9c,_0x1a58db){if(_0x507c9c[_0x5f09('0x5a')]['id']){delete _0x507c9c[_0x5f09('0x5a')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x507c9c[_0x5f09('0x52')]['id']},'include':[{'model':db[_0x5f09('0x3b')],'as':_0x5f09('0x3c')}]})['then'](handleEntityNotFound(_0x1a58db,null))[_0x5f09('0x1d')](saveUpdates(_0x507c9c['body'],null))[_0x5f09('0x1d')](respondWithResult(_0x1a58db,null))[_0x5f09('0x26')](handleError(_0x1a58db,null));};exports[_0x5f09('0x33')]=function(_0xb38eb1,_0x8832aa){return db[_0x5f09('0x3e')][_0x5f09('0x58')]({'where':{'id':_0xb38eb1[_0x5f09('0x52')]['id']}})[_0x5f09('0x1d')](handleEntityNotFound(_0x8832aa,null))[_0x5f09('0x1d')](removeEntity(_0x8832aa,null))[_0x5f09('0x26')](handleError(_0x8832aa,null));};exports['describe']=function(_0x120a5a,_0x5408f0){return db['WhatsappAccount'][_0x5f09('0x5f')]()[_0x5f09('0x1d')](respondWithResult(_0x5408f0,null))[_0x5f09('0x26')](handleError(_0x5408f0,null));};exports['addDisposition']=function(_0x687034,_0x59b8ec,_0x445987){if(_0x687034[_0x5f09('0x5a')]['id']){delete _0x687034['body']['id'];}return db[_0x5f09('0x3e')][_0x5f09('0x58')]({'where':{'id':_0x687034[_0x5f09('0x52')]['id']}})[_0x5f09('0x1d')](handleEntityNotFound(_0x59b8ec,null))[_0x5f09('0x1d')](function(_0x240d63){if(_0x240d63){_0x687034[_0x5f09('0x5a')][_0x5f09('0x60')]=_0x240d63['id'];return db[_0x5f09('0x61')][_0x5f09('0x59')](_0x687034[_0x5f09('0x5a')]);}})[_0x5f09('0x1d')](respondWithResult(_0x59b8ec,null))[_0x5f09('0x26')](handleError(_0x59b8ec,null));};exports['getDispositions']=function(_0x2b107d,_0x4ac4b9,_0x1d8fb4){var _0x283ecd={'raw':![],'where':{}};var _0x25dbb0={};var _0x564e48={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x5f09('0x62')]({'where':{'id':_0x2b107d['params']['id']}})['then'](handleEntityNotFound(_0x4ac4b9,null))[_0x5f09('0x1d')](function(_0x2c52ea){if(_0x2c52ea){_0x25dbb0[_0x5f09('0x42')]=_[_0x5f09('0x53')](db[_0x5f09('0x61')][_0x5f09('0x54')]);_0x25dbb0[_0x5f09('0x43')]=_[_0x5f09('0x53')](_0x2b107d[_0x5f09('0x43')]);_0x25dbb0[_0x5f09('0x4b')]=_[_0x5f09('0x44')](_0x25dbb0[_0x5f09('0x42')],_0x25dbb0[_0x5f09('0x43')]);_0x283ecd[_0x5f09('0x45')]=_[_0x5f09('0x44')](_0x25dbb0[_0x5f09('0x42')],qs[_0x5f09('0x46')](_0x2b107d[_0x5f09('0x43')][_0x5f09('0x46')]));_0x283ecd[_0x5f09('0x45')]=_0x283ecd[_0x5f09('0x45')][_0x5f09('0x55')]?_0x283ecd['attributes']:_0x25dbb0[_0x5f09('0x42')];if(!_0x2b107d['query'][_0x5f09('0x63')]('nolimit')){_0x283ecd[_0x5f09('0x2d')]=qs['limit'](_0x2b107d['query'][_0x5f09('0x2d')]);_0x283ecd[_0x5f09('0x2b')]=qs[_0x5f09('0x2b')](_0x2b107d[_0x5f09('0x43')][_0x5f09('0x2b')]);}_0x283ecd[_0x5f09('0x48')]=qs['sort'](_0x2b107d[_0x5f09('0x43')]['sort']);_0x283ecd[_0x5f09('0x4a')]=qs[_0x5f09('0x4b')](_[_0x5f09('0x4c')](_0x2b107d[_0x5f09('0x43')],_0x25dbb0[_0x5f09('0x4b')]));_0x283ecd['where'][_0x5f09('0x60')]=_0x2c52ea['id'];if(_0x2b107d[_0x5f09('0x43')][_0x5f09('0x4d')]){_0x283ecd[_0x5f09('0x4a')]=_[_0x5f09('0x4e')](_0x283ecd[_0x5f09('0x4a')],{'$or':_[_0x5f09('0x3d')](_0x283ecd[_0x5f09('0x45')],function(_0x20fa1d){var _0x8fdb45={};_0x8fdb45[_0x20fa1d]={'$like':'%'+_0x2b107d['query'][_0x5f09('0x4d')]+'%'};return _0x8fdb45;})});}_0x283ecd=_[_0x5f09('0x4e')]({},_0x283ecd,_0x2b107d['options']);return db['Disposition'][_0x5f09('0x2e')]({'where':_0x283ecd[_0x5f09('0x4a')]})['then'](function(_0x50f3b2){_0x564e48['count']=_0x50f3b2;if(_0x2b107d[_0x5f09('0x43')][_0x5f09('0x50')]){_0x283ecd[_0x5f09('0x56')]=[{'all':!![]}];}return db[_0x5f09('0x61')][_0x5f09('0x64')](_0x283ecd);})[_0x5f09('0x1d')](function(_0x144aad){_0x564e48[_0x5f09('0x51')]=_0x144aad;return _0x564e48;});}})['then'](respondWithFilteredResult(_0x4ac4b9,_0x283ecd))[_0x5f09('0x26')](handleError(_0x4ac4b9,null));};exports[_0x5f09('0x65')]=function(_0x3a4db4,_0x150376,_0x153fbc){return db[_0x5f09('0x3e')][_0x5f09('0x58')]({'where':{'id':_0x3a4db4[_0x5f09('0x52')]['id']}})[_0x5f09('0x1d')](handleEntityNotFound(_0x150376,null))[_0x5f09('0x1d')](function(_0x29a31c){if(_0x29a31c){return _0x29a31c['removeDispositions'](_0x3a4db4['query']['ids']);}})[_0x5f09('0x1d')](respondWithStatusCode(_0x150376,null))[_0x5f09('0x26')](handleError(_0x150376,null));};exports[_0x5f09('0x66')]=function(_0x525797,_0x26bb60,_0x18d5e0){if(_0x525797[_0x5f09('0x5a')]['id']){delete _0x525797['body']['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x525797[_0x5f09('0x52')]['id']}})[_0x5f09('0x1d')](handleEntityNotFound(_0x26bb60,null))[_0x5f09('0x1d')](function(_0x2eea64){if(_0x2eea64){_0x525797['body']['WhatsappAccountId']=_0x2eea64['id'];return db[_0x5f09('0x67')][_0x5f09('0x59')](_0x525797[_0x5f09('0x5a')]);}})[_0x5f09('0x1d')](respondWithResult(_0x26bb60,null))[_0x5f09('0x26')](handleError(_0x26bb60,null));};exports[_0x5f09('0x68')]=function(_0x4396e1,_0x23a1a0,_0x20bf32){var _0x25c3ec={'raw':![],'where':{}};var _0x5c9605={};var _0xdf8140={'count':0x0,'rows':[]};return db[_0x5f09('0x3e')][_0x5f09('0x62')]({'where':{'id':_0x4396e1[_0x5f09('0x52')]['id']}})[_0x5f09('0x1d')](handleEntityNotFound(_0x23a1a0,null))[_0x5f09('0x1d')](function(_0x34f120){if(_0x34f120){_0x5c9605[_0x5f09('0x42')]=_[_0x5f09('0x53')](db[_0x5f09('0x67')][_0x5f09('0x54')]);_0x5c9605[_0x5f09('0x43')]=_[_0x5f09('0x53')](_0x4396e1['query']);_0x5c9605['filters']=_[_0x5f09('0x44')](_0x5c9605[_0x5f09('0x42')],_0x5c9605[_0x5f09('0x43')]);_0x25c3ec[_0x5f09('0x45')]=_[_0x5f09('0x44')](_0x5c9605['model'],qs[_0x5f09('0x46')](_0x4396e1[_0x5f09('0x43')]['fields']));_0x25c3ec[_0x5f09('0x45')]=_0x25c3ec[_0x5f09('0x45')][_0x5f09('0x55')]?_0x25c3ec[_0x5f09('0x45')]:_0x5c9605[_0x5f09('0x42')];if(!_0x4396e1['query'][_0x5f09('0x63')](_0x5f09('0x47'))){_0x25c3ec[_0x5f09('0x2d')]=qs[_0x5f09('0x2d')](_0x4396e1['query'][_0x5f09('0x2d')]);_0x25c3ec['offset']=qs['offset'](_0x4396e1['query'][_0x5f09('0x2b')]);}_0x25c3ec[_0x5f09('0x48')]=qs[_0x5f09('0x49')](_0x4396e1[_0x5f09('0x43')][_0x5f09('0x49')]);_0x25c3ec[_0x5f09('0x4a')]=qs[_0x5f09('0x4b')](_[_0x5f09('0x4c')](_0x4396e1[_0x5f09('0x43')],_0x5c9605[_0x5f09('0x4b')]));_0x25c3ec[_0x5f09('0x4a')]['WhatsappAccountId']=_0x34f120['id'];if(_0x4396e1[_0x5f09('0x43')][_0x5f09('0x4d')]){_0x25c3ec['where']=_[_0x5f09('0x4e')](_0x25c3ec[_0x5f09('0x4a')],{'$or':_['map'](_0x25c3ec[_0x5f09('0x45')],function(_0x415104){var _0x109a72={};_0x109a72[_0x415104]={'$like':'%'+_0x4396e1[_0x5f09('0x43')][_0x5f09('0x4d')]+'%'};return _0x109a72;})});}_0x25c3ec=_['merge']({},_0x25c3ec,_0x4396e1[_0x5f09('0x57')]);return db['CannedAnswer'][_0x5f09('0x2e')]({'where':_0x25c3ec[_0x5f09('0x4a')]})[_0x5f09('0x1d')](function(_0x12edb8){_0xdf8140[_0x5f09('0x2e')]=_0x12edb8;if(_0x4396e1['query'][_0x5f09('0x50')]){_0x25c3ec[_0x5f09('0x56')]=[{'all':!![]}];}return db[_0x5f09('0x67')][_0x5f09('0x64')](_0x25c3ec);})[_0x5f09('0x1d')](function(_0x1b286d){_0xdf8140['rows']=_0x1b286d;return _0xdf8140;});}})['then'](respondWithFilteredResult(_0x23a1a0,_0x25c3ec))['catch'](handleError(_0x23a1a0,null));};exports[_0x5f09('0x69')]=function(_0x54d739,_0x40046f,_0x4ec27f){return db[_0x5f09('0x3e')][_0x5f09('0x58')]({'where':{'id':_0x54d739['params']['id']}})[_0x5f09('0x1d')](handleEntityNotFound(_0x40046f,null))[_0x5f09('0x1d')](function(_0x189b92){if(_0x189b92){return _0x189b92[_0x5f09('0x69')](_0x54d739['query']['ids']);}})[_0x5f09('0x1d')](respondWithStatusCode(_0x40046f,null))[_0x5f09('0x26')](handleError(_0x40046f,null));};exports['addAgents']=function(_0x493997,_0x2c9b1e,_0x4a1fe2){return db[_0x5f09('0x3e')][_0x5f09('0x58')]({'where':{'id':_0x493997[_0x5f09('0x52')]['id']}})[_0x5f09('0x1d')](handleEntityNotFound(_0x2c9b1e,null))[_0x5f09('0x1d')](function(_0x3e480f){if(_0x3e480f){return _0x3e480f[_0x5f09('0x6a')](_0x493997[_0x5f09('0x5a')]['ids'],_['omit'](_0x493997[_0x5f09('0x5a')],[_0x5f09('0x6b'),'id'])||{})[_0x5f09('0x6c')](function(_0x47d180){for(var _0x412d02=0x0;_0x412d02<_0x493997[_0x5f09('0x5a')]['ids'][_0x5f09('0x55')];_0x412d02+=0x1){socket[_0x5f09('0x6d')](_0x5f09('0x6e'),{'UserId':Number(_0x493997[_0x5f09('0x5a')][_0x5f09('0x6b')][_0x412d02]),'WhatsappAccountId':Number(_0x493997['params']['id'])});}return _0x47d180;});}})['then'](respondWithResult(_0x2c9b1e,null))[_0x5f09('0x26')](handleError(_0x2c9b1e,null));};exports['removeAgents']=function(_0xdacd7e,_0x2ae4ec,_0x54e8b9){return db[_0x5f09('0x3e')][_0x5f09('0x58')]({'where':{'id':_0xdacd7e['params']['id']}})[_0x5f09('0x1d')](handleEntityNotFound(_0x2ae4ec,null))['then'](function(_0x4b80d8){if(_0x4b80d8){return _0x4b80d8['removeAgents'](_0xdacd7e[_0x5f09('0x43')][_0x5f09('0x6b')])['then'](function(){if(_[_0x5f09('0x6f')](_0xdacd7e[_0x5f09('0x43')]['ids'])){for(var _0xef08e9=0x0;_0xef08e9<_0xdacd7e[_0x5f09('0x43')][_0x5f09('0x6b')][_0x5f09('0x55')];_0xef08e9+=0x1){socket[_0x5f09('0x6d')](_0x5f09('0x70'),{'UserId':Number(_0xdacd7e[_0x5f09('0x43')][_0x5f09('0x6b')][_0xef08e9]),'WhatsappAccountId':Number(_0xdacd7e[_0x5f09('0x52')]['id'])});}}else{socket[_0x5f09('0x6d')](_0x5f09('0x70'),{'UserId':Number(_0xdacd7e[_0x5f09('0x43')][_0x5f09('0x6b')]),'WhatsappAccountId':Number(_0xdacd7e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2ae4ec,null))[_0x5f09('0x26')](handleError(_0x2ae4ec,null));};exports[_0x5f09('0x71')]=function(_0x2556e7,_0x4ffd8d,_0x3a1ab2){var _0x167fda={};var _0x5ee763={};var _0x17e9ed;var _0x492493;return db[_0x5f09('0x3e')][_0x5f09('0x62')]({'where':{'id':_0x2556e7[_0x5f09('0x52')]['id']}})[_0x5f09('0x1d')](handleEntityNotFound(_0x4ffd8d,null))[_0x5f09('0x1d')](function(_0x5512e6){if(_0x5512e6){_0x17e9ed=_0x5512e6;_0x5ee763['model']=_[_0x5f09('0x53')](db[_0x5f09('0x72')][_0x5f09('0x54')]);_0x5ee763[_0x5f09('0x43')]=_[_0x5f09('0x53')](_0x2556e7[_0x5f09('0x43')]);_0x5ee763['filters']=_[_0x5f09('0x44')](_0x5ee763[_0x5f09('0x42')],_0x5ee763[_0x5f09('0x43')]);_0x167fda[_0x5f09('0x45')]=_['intersection'](_0x5ee763['model'],qs['fields'](_0x2556e7[_0x5f09('0x43')][_0x5f09('0x46')]));_0x167fda[_0x5f09('0x45')]=_0x167fda[_0x5f09('0x45')][_0x5f09('0x55')]?_0x167fda[_0x5f09('0x45')]:_0x5ee763[_0x5f09('0x42')];_0x167fda[_0x5f09('0x48')]=qs[_0x5f09('0x49')](_0x2556e7[_0x5f09('0x43')][_0x5f09('0x49')]);_0x167fda['where']=qs['filters'](_['pick'](_0x2556e7[_0x5f09('0x43')],_0x5ee763[_0x5f09('0x4b')]));if(_0x2556e7[_0x5f09('0x43')][_0x5f09('0x4d')]){_0x167fda[_0x5f09('0x4a')]=_[_0x5f09('0x4e')](_0x167fda[_0x5f09('0x4a')],{'$or':_[_0x5f09('0x3d')](_0x167fda[_0x5f09('0x45')],function(_0x1913f6){var _0x176fca={};_0x176fca[_0x1913f6]={'$like':'%'+_0x2556e7[_0x5f09('0x43')][_0x5f09('0x4d')]+'%'};return _0x176fca;})});}_0x167fda=_[_0x5f09('0x4e')]({},_0x167fda,_0x2556e7['options']);return _0x17e9ed[_0x5f09('0x71')](_0x167fda);}})[_0x5f09('0x1d')](function(_0x3839db){if(_0x3839db){_0x492493=_0x3839db[_0x5f09('0x55')];if(!_0x2556e7['query'][_0x5f09('0x63')](_0x5f09('0x47'))){_0x167fda[_0x5f09('0x2d')]=qs[_0x5f09('0x2d')](_0x2556e7[_0x5f09('0x43')][_0x5f09('0x2d')]);_0x167fda['offset']=qs[_0x5f09('0x2b')](_0x2556e7[_0x5f09('0x43')][_0x5f09('0x2b')]);}return _0x17e9ed[_0x5f09('0x71')](_0x167fda);}})[_0x5f09('0x1d')](function(_0x59958e){if(_0x59958e){return _0x59958e?{'count':_0x492493,'rows':_0x59958e}:null;}})[_0x5f09('0x1d')](respondWithResult(_0x4ffd8d,null))[_0x5f09('0x26')](handleError(_0x4ffd8d,null));};exports[_0x5f09('0x73')]=function(_0x132f68,_0x4c2269){var _0x4eb51c=_0x132f68[_0x5f09('0x52')]['id'];var _0x44add5=_0x132f68[_0x5f09('0x5a')];var _0x26d131=0xc8;var _0x237aa5=null;return db[_0x5f09('0x74')][_0x5f09('0x75')]({'isolationLevel':db[_0x5f09('0x74')][_0x5f09('0x76')][_0x5f09('0x77')][_0x5f09('0x78')]},function(_0x4a9d10){return db[_0x5f09('0x3e')][_0x5f09('0x62')]({'where':{'id':_0x4eb51c},'transaction':_0x4a9d10})[_0x5f09('0x1d')](function(_0x3a10b6){if(_0x3a10b6){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x4eb51c},'transaction':_0x4a9d10})[_0x5f09('0x1d')](function(){var _0x212bf7=_[_0x5f09('0x3d')](_0x44add5,function(_0x235e9a){_0x235e9a['WhatsappAccountId']=_0x4eb51c;return _0x235e9a;});return db[_0x5f09('0x79')]['bulkCreate'](_0x212bf7,{'transaction':_0x4a9d10});});}else{_0x26d131=0x194;_0x237aa5=[];}});})[_0x5f09('0x1d')](function(){if(_0x26d131!==0x194){return db[_0x5f09('0x79')][_0x5f09('0x7a')]({'where':{'WhatsappAccountId':_0x4eb51c},'order':_0x5f09('0x7b')})['then'](function(_0x4114f7){_0x237aa5=_0x4114f7;});}})[_0x5f09('0x26')](function(_0x2424f1){_0x26d131=0x1f4;logger[_0x5f09('0x21')](_0x2424f1[_0x5f09('0x37')]);if(_0x2424f1['name']){delete _0x2424f1['name'];}_0x237aa5=_0x2424f1;})[_0x5f09('0x7c')](function(){if(_0x237aa5===null){_0x4c2269[_0x5f09('0x27')](_0x26d131);}else{if(_0x26d131===0x1f4){_0x4c2269[_0x5f09('0x28')](_0x26d131)[_0x5f09('0x39')](_0x237aa5);}else{_0x4c2269[_0x5f09('0x28')](_0x26d131)[_0x5f09('0x2a')](_0x237aa5);}}});};exports[_0x5f09('0x7d')]=function(_0x1079e3,_0x7bc464,_0x42a1b5){var _0x302b23={};var _0x1c0f11={};var _0x4d84a8;var _0x3970c1;return db[_0x5f09('0x3e')]['findOne']({'where':{'id':_0x1079e3[_0x5f09('0x52')]['id']}})[_0x5f09('0x1d')](handleEntityNotFound(_0x7bc464,null))['then'](function(_0x3e331a){if(_0x3e331a){_0x4d84a8=_0x3e331a;_0x1c0f11['model']=_[_0x5f09('0x53')](db[_0x5f09('0x79')][_0x5f09('0x54')]);_0x1c0f11[_0x5f09('0x43')]=_[_0x5f09('0x53')](_0x1079e3[_0x5f09('0x43')]);_0x1c0f11[_0x5f09('0x4b')]=_[_0x5f09('0x44')](_0x1c0f11[_0x5f09('0x42')],_0x1c0f11[_0x5f09('0x43')]);_0x302b23[_0x5f09('0x45')]=_[_0x5f09('0x44')](_0x1c0f11[_0x5f09('0x42')],qs[_0x5f09('0x46')](_0x1079e3[_0x5f09('0x43')][_0x5f09('0x46')]));_0x302b23[_0x5f09('0x45')]=_0x302b23['attributes'][_0x5f09('0x55')]?_0x302b23['attributes']:_0x1c0f11[_0x5f09('0x42')];_0x302b23[_0x5f09('0x48')]=qs[_0x5f09('0x49')](_0x1079e3[_0x5f09('0x43')][_0x5f09('0x49')]);_0x302b23[_0x5f09('0x4a')]=qs['filters'](_[_0x5f09('0x4c')](_0x1079e3[_0x5f09('0x43')],_0x1c0f11[_0x5f09('0x4b')]));if(_0x1079e3[_0x5f09('0x43')]['filter']){_0x302b23['where']=_[_0x5f09('0x4e')](_0x302b23[_0x5f09('0x4a')],{'$or':_[_0x5f09('0x3d')](_0x302b23[_0x5f09('0x45')],function(_0x11b2e4){var _0x4956d3={};_0x4956d3[_0x11b2e4]={'$like':'%'+_0x1079e3['query']['filter']+'%'};return _0x4956d3;})});}_0x302b23=_['merge']({},_0x302b23,_0x1079e3[_0x5f09('0x57')]);return _0x4d84a8[_0x5f09('0x7d')](_0x302b23);}})[_0x5f09('0x1d')](function(_0x4ae457){if(_0x4ae457){_0x3970c1=_0x4ae457[_0x5f09('0x55')];if(!_0x1079e3[_0x5f09('0x43')][_0x5f09('0x63')]('nolimit')){_0x302b23[_0x5f09('0x2d')]=qs['limit'](_0x1079e3['query']['limit']);_0x302b23[_0x5f09('0x2b')]=qs['offset'](_0x1079e3[_0x5f09('0x43')]['offset']);}return _0x4d84a8[_0x5f09('0x7d')](_0x302b23);}})[_0x5f09('0x1d')](function(_0x47b24d){if(_0x47b24d){return _0x47b24d?{'count':_0x3970c1,'rows':_0x47b24d}:null;}})[_0x5f09('0x1d')](respondWithResult(_0x7bc464,null))[_0x5f09('0x26')](handleError(_0x7bc464,null));};exports[_0x5f09('0x7e')]=function(_0x16b904,_0x35a448,_0xdab4f6){var _0xc4f2a={'channel':_0x5f09('0x7f')};var _0x5345bb=[];var _0x49826a=[];var _0x5bc3a1={};return db[_0x5f09('0x3e')][_0x5f09('0x58')]({'where':{'id':_0x16b904[_0x5f09('0x52')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x5f09('0x80')}]})[_0x5f09('0x1d')](handleEntityNotFound(_0x35a448,null))[_0x5f09('0x1d')](function(_0x5eb100){_0xc4f2a[_0x5f09('0x81')]=_0x5eb100;if(_0xc4f2a[_0x5f09('0x81')]&&_0xc4f2a['account'][_0x5f09('0x40')]==='sinch'&&_0x16b904['body']['statuses']){if(_0x16b904[_0x5f09('0x5a')]['statuses'][_0x5f09('0x55')]===0x0)return;if(_0x16b904['body'][_0x5f09('0x82')][0x0][_0x5f09('0x83')]!==_0x5f09('0x84'))return;return db[_0x5f09('0x85')]['update']({'read':!![],'readAt':_0x16b904[_0x5f09('0x5a')][_0x5f09('0x82')][0x0][_0x5f09('0x86')]},{'where':{'messageId':_0x16b904[_0x5f09('0x5a')]['statuses'][0x0]['message_id']},'individualHooks':!![]})[_0x5f09('0x1d')](function(_0x321f64){return _0x35a448[_0x5f09('0x28')](0xc8)[_0x5f09('0x2a')](_0x321f64);});}_0xc4f2a[_0x5f09('0x87')]=_[_0x5f09('0x88')](_0x5eb100['Applications'],['priority'],[_0x5f09('0x89')]);if(_0xc4f2a[_0x5f09('0x81')]['Applications']){delete _0xc4f2a[_0x5f09('0x81')][_0x5f09('0x80')];}return db[_0x5f09('0x8a')]['describe']()[_0x5f09('0x1d')](function(_0x2ea456){if(!_0x2ea456){throw new db[(_0x5f09('0x8b'))][(_0x5f09('0x8c'))](_0x5f09('0x8d'));}_0x5345bb=_[_0x5f09('0x8e')](_[_0x5f09('0x53')](_0x2ea456),[_0x5f09('0x8f'),_0x5f09('0x90')]);_0x49826a=_['difference'](_[_0x5f09('0x53')](_0x2ea456),[_0x5f09('0x8f'),'updatedAt',_0x5f09('0x91'),_0x5f09('0x92')]);_0xc4f2a['body']={'mapKey':_0x5f09('0x93')};if(_0xc4f2a['account']&&_0xc4f2a['account'][_0x5f09('0x40')]===_0x5f09('0x94')){_0xc4f2a[_0x5f09('0x5a')][_0x5f09('0x95')]=_0x16b904[_0x5f09('0x5a')]['From'][_0x5f09('0x96')]('whatsapp:','');_0xc4f2a['body'][_0x5f09('0x5a')]=_0x16b904['body'][_0x5f09('0x97')];_0xc4f2a[_0x5f09('0x5a')]['messageId']=_0x16b904[_0x5f09('0x5a')][_0x5f09('0x98')];}if(_0xc4f2a[_0x5f09('0x81')]&&_0xc4f2a[_0x5f09('0x81')]['type']===_0x5f09('0x99')){_0xc4f2a[_0x5f09('0x5a')][_0x5f09('0x95')]=_0x16b904[_0x5f09('0x5a')][_0x5f09('0x9a')][0x0][_0x5f09('0x95')];_0xc4f2a[_0x5f09('0x5a')]['body']=_0x16b904[_0x5f09('0x5a')][_0x5f09('0x9a')][0x0][_0x5f09('0x24')][_0x5f09('0x5a')];_0xc4f2a[_0x5f09('0x5a')][_0x5f09('0x9b')]=_0x16b904['body'][_0x5f09('0x9a')][0x0]['message_id'];}if(_0xc4f2a['body']['id']){delete _0xc4f2a[_0x5f09('0x5a')]['id'];}if(_[_0x5f09('0x9c')](_0xc4f2a[_0x5f09('0x5a')][_0x5f09('0x95')])){throw new db[(_0x5f09('0x8b'))][(_0x5f09('0x8c'))]('from\x20is\x20mandatory');}if(_['isNil'](_0xc4f2a[_0x5f09('0x5a')][_0x5f09('0x5a')])||_0xc4f2a[_0x5f09('0x5a')][_0x5f09('0x5a')]===''){throw new db[(_0x5f09('0x8b'))][(_0x5f09('0x8c'))](_0x5f09('0x9d'));}if(_['isNil'](_0xc4f2a[_0x5f09('0x5a')]['mapKey'])){throw new db[(_0x5f09('0x8b'))][(_0x5f09('0x8c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x49826a);}if(!_['includes'](_0x49826a,_0xc4f2a[_0x5f09('0x5a')][_0x5f09('0x9e')])){throw new db[(_0x5f09('0x8b'))][(_0x5f09('0x8c'))](_0x5f09('0x9f')+_0x49826a);}_0x5bc3a1[_0xc4f2a['body']['mapKey']]=_0xc4f2a[_0x5f09('0x5a')]['from'];return db[_0x5f09('0xa0')][_0x5f09('0x58')]({'where':{'id':_0xc4f2a[_0x5f09('0x81')][_0x5f09('0x92')]},'include':[{'model':db[_0x5f09('0x8a')],'as':_0x5f09('0xa1'),'where':_0x5bc3a1,'limit':0x1,'order':[['updatedAt',_0x5f09('0xa2')]]}]});})[_0x5f09('0x1d')](handleEntityNotFound(_0x35a448,null))[_0x5f09('0x1d')](function(_0x183707){if(_0x183707){_0xc4f2a['list']=_[_0x5f09('0xa3')](_0x183707,[_0x5f09('0xa1')]);if(_0x183707['Contacts'][_0x5f09('0x55')]){return _0x183707[_0x5f09('0xa1')][0x0];}var _0x389f57=_[_0x5f09('0x14')](_0xc4f2a[_0x5f09('0x5a')],{'firstName':_0xc4f2a[_0x5f09('0x5a')][_0x5f09('0x95')],'ListId':_0x183707['id']});_0x389f57[_0xc4f2a[_0x5f09('0x5a')][_0x5f09('0x9e')]]=_0xc4f2a[_0x5f09('0x5a')][_0x5f09('0x95')];return db[_0x5f09('0x8a')][_0x5f09('0x59')](_0x389f57,{'fields':_0x5345bb,'raw':!![]});}})['then'](handleEntityNotFound(_0x35a448,null))[_0x5f09('0x1d')](function(_0x3e11bc){if(_0x3e11bc){_0xc4f2a[_0x5f09('0xa4')]=_0x3e11bc;var _0x2e4143={'ContactId':_0x3e11bc['id'],'phone':_0xc4f2a[_0x5f09('0x5a')][_0x5f09('0x95')],'WhatsappAccountId':_0x16b904[_0x5f09('0x52')]['id']};var _0xf433ba={'ContactId':_0x3e11bc['id'],'WhatsappAccountId':_0x16b904[_0x5f09('0x52')]['id'],'closed':![]};return db[_0x5f09('0xa5')][_0x5f09('0x58')]({'where':_0xf433ba})[_0x5f09('0x1d')](function(_0x2b8d7d){if(_0x2b8d7d){return[_0x2b8d7d,![]];}return db[_0x5f09('0xa5')]['create'](_0x2e4143)[_0x5f09('0x1d')](function(_0x4b7f7f){return[_0x4b7f7f,!![]];});});}})[_0x5f09('0x6c')](function(_0x59f245,_0x3e0b7c){_0xc4f2a[_0x5f09('0xa6')]=_0x59f245[_0x5f09('0x34')]({'plain':!![]});_0xc4f2a['interaction']['created']=![];if(_0x3e0b7c){if(_0xc4f2a['account'][_0x5f09('0xa7')]){_0xc4f2a[_0x5f09('0x87')][_0x5f09('0xa8')]({'id':0x0,'priority':_0xc4f2a['applications'][_0x5f09('0x55')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0xc4f2a['interaction'][_0x5f09('0xa9')]=!![];}return db[_0x5f09('0x85')][_0x5f09('0x59')]({'phone':_0xc4f2a[_0x5f09('0x5a')][_0x5f09('0x95')],'messageId':_0xc4f2a[_0x5f09('0x5a')][_0x5f09('0x9b')],'body':_0xc4f2a[_0x5f09('0x5a')]['body'],'WhatsappAccountId':_0x16b904[_0x5f09('0x52')]['id'],'WhatsappInteractionId':_0x59f245['id'],'direction':'in','ContactId':_0x59f245[_0x5f09('0xaa')],'AttachmentId':_0xc4f2a[_0x5f09('0x5a')][_0x5f09('0xab')]});})[_0x5f09('0x1d')](function(_0x15b9c0){_0xc4f2a[_0x5f09('0x24')]=_0x15b9c0;if(_0xc4f2a['interaction'][_0x5f09('0xac')]){return db[_0x5f09('0x72')][_0x5f09('0x58')]({'attributes':['id',_0x5f09('0x38')],'where':{'id':_0xc4f2a['interaction'][_0x5f09('0xac')]}})[_0x5f09('0x1d')](function(_0x5d857f){if(_0x5d857f){_0xc4f2a[_0x5f09('0x87')][_0x5f09('0xad')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5d857f[_0x5f09('0x38')]+','+(_0xc4f2a[_0x5f09('0x81')][_0x5f09('0xae')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x5f09('0xaf'),_0x5f09('0xb0'),_0xc4f2a);});}return respondWithRpcPromise(_0x5f09('0xaf'),'startRouting',_0xc4f2a);})['then'](function(_0x2cf5d9){if(_0x2cf5d9){var _0x679a09=0xc8;var _0xd03252=_0x5f09('0xb1');logger[_0x5f09('0x1e')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xd03252,_0x679a09,'entity\x20found');logger[_0x5f09('0xb2')](_0x5f09('0xb3'),_0xd03252,_0x679a09,_0x5f09('0xb4'),JSON['stringify'](_0x2cf5d9));if(_0xc4f2a['account'][_0x5f09('0x40')]==='twilio'){return _0x35a448[_0x5f09('0x28')](_0x679a09)['set'](_0x5f09('0xb5'),_0x5f09('0xb6'))[_0x5f09('0x39')]('\x0a');}else{return _0x35a448['status'](_0x679a09)['json'](_0x2cf5d9);}}});})['catch'](handleError(_0x35a448,null));};exports['send']=function(_0x110379,_0x197b6f,_0x3d496c){var _0x4866c7,_0x2ad347,_0x580417;if(_[_0x5f09('0x9c')](_0x110379[_0x5f09('0x5a')][_0x5f09('0x5a')])||_0x110379[_0x5f09('0x5a')]['body']===''){throw new db[(_0x5f09('0x8b'))][(_0x5f09('0x8c'))](_0x5f09('0x9d'));}if(_['isNil'](_0x110379[_0x5f09('0x5a')]['to'])){throw new db[(_0x5f09('0x8b'))][(_0x5f09('0x8c'))]('to\x20is\x20mandatory');}_0x4866c7=_0x110379['body']['to'];return db[_0x5f09('0x3e')][_0x5f09('0x58')]({'where':{'id':_0x110379[_0x5f09('0x52')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x5f09('0xa1'),'where':{'mobile':_0x4866c7},'limit':0x1,'order':[[_0x5f09('0x90'),_0x5f09('0xa2')]]}]}]})[_0x5f09('0x1d')](handleEntityNotFound(_0x197b6f,null))[_0x5f09('0x1d')](function(_0x3ddb9){if(_0x3ddb9&&_0x3ddb9['List']){_0x2ad347=_0x3ddb9[_0x5f09('0x34')]({'plain':!![]});if(_0x2ad347[_0x5f09('0xb7')]&&_0x2ad347[_0x5f09('0xb7')]['Contacts'][_0x5f09('0x55')]){return _0x2ad347[_0x5f09('0xb7')]['Contacts'][0x0];}return db[_0x5f09('0x8a')][_0x5f09('0x59')](_['defaults'](_0x110379[_0x5f09('0x5a')],{'firstName':_0x4866c7,'mobile':_0x4866c7,'phone':_0x4866c7,'ListId':_0x2ad347[_0x5f09('0x92')]}));}})[_0x5f09('0x1d')](handleEntityNotFound(_0x197b6f,null))[_0x5f09('0x1d')](function(_0xb364c6){if(_0xb364c6){_0x580417=_0xb364c6;return db[_0x5f09('0xa5')]['find']({'where':{'ContactId':_0x580417['id'],'closed':![],'WhatsappAccountId':_0x2ad347['id']}})[_0x5f09('0x1d')](function(_0x5b3685){if(_0x5b3685){return[_0x5b3685,![]];}return db[_0x5f09('0xa5')][_0x5f09('0x59')]({'UserId':_0x110379[_0x5f09('0xb8')]['id'],'ContactId':_0x580417['id'],'WhatsappAccountId':_0x2ad347['id'],'phone':_0x4866c7,'firstMsgDirection':_0x5f09('0xb9'),'Messages':[_[_0x5f09('0x4e')](_0x110379[_0x5f09('0x5a')],{'read':![],'body':_0x110379[_0x5f09('0x5a')][_0x5f09('0x5a')],'phone':_0x4866c7,'WhatsappAccountId':_0x2ad347['id'],'UserId':_0x110379[_0x5f09('0xb8')]['id'],'ContactId':_0x580417['id']})]},{'include':[{'model':db[_0x5f09('0x85')],'as':'Messages'}]})[_0x5f09('0x1d')](function(_0x2e991b){return[_0x2e991b,!![]];});});}})[_0x5f09('0x6c')](function(_0x22a724,_0x4c80af){if(_0x4c80af){return _0x22a724;}return db[_0x5f09('0x85')][_0x5f09('0x59')](_[_0x5f09('0x4e')](_0x110379[_0x5f09('0x5a')],{'read':![],'body':_0x110379['body']['body'],'phone':_0x4866c7,'WhatsappAccountId':_0x2ad347['id'],'WhatsappInteractionId':_0x22a724['id'],'UserId':_0x110379['user']['id'],'ContactId':_0x580417['id']}))[_0x5f09('0x1d')](function(_0x59243e){_0x22a724[_0x5f09('0xba')][_0x5f09('0xbb')]=[];_0x22a724[_0x5f09('0xba')][_0x5f09('0xbb')][_0x5f09('0xa8')](_0x59243e[_0x5f09('0xba')]);return _0x22a724;});})[_0x5f09('0x1d')](respondWithResult(_0x197b6f,null))[_0x5f09('0x26')](handleError(_0x197b6f,null));}; \ No newline at end of file +var _0xcb1f=['ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','notify','Applications','account','sinch','statuses','read','WhatsappMessage','timestamp','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','From','whatsapp:','Body','messageId','MessageSid','message_id','from\x20is\x20mandatory','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','WhatsappInteraction','autoclose','applications','close','unmanaged','*,*,*,*','interaction','created','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','to\x20is\x20mandatory','CmList','List','user','out','Messages','dataValues','push','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./whatsappAccount.socket','register','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','save','update','then','destroy','UserProfileResource','stack','name','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','where','pick','filter','merge','VIRTUAL','options','includeAll','include','params','Pause','WhatsappAccount','find','create','body','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','order','sort','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','sequelize','transaction'];(function(_0x146ef3,_0x1c7bb0){var _0x5d9bae=function(_0x3b70f7){while(--_0x3b70f7){_0x146ef3['push'](_0x146ef3['shift']());}};_0x5d9bae(++_0x1c7bb0);}(_0xcb1f,0x109));var _0xfcb1=function(_0x32324c,_0x157b91){_0x32324c=_0x32324c-0x0;var _0x1debc9=_0xcb1f[_0x32324c];return _0x1debc9;};'use strict';var emlformat=require(_0xfcb1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfcb1('0x1'));var rp=require(_0xfcb1('0x2'));var moment=require(_0xfcb1('0x3'));var BPromise=require(_0xfcb1('0x4'));var Mustache=require(_0xfcb1('0x5'));var util=require(_0xfcb1('0x6'));var path=require(_0xfcb1('0x7'));var sox=require(_0xfcb1('0x8'));var csv=require(_0xfcb1('0x9'));var ejs=require(_0xfcb1('0xa'));var fs=require('fs');var fs_extra=require(_0xfcb1('0xb'));var _=require(_0xfcb1('0xc'));var squel=require(_0xfcb1('0xd'));var crypto=require(_0xfcb1('0xe'));var jsforce=require(_0xfcb1('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfcb1('0x10'));var Redis=require('ioredis');var authService=require(_0xfcb1('0x11'));var qs=require(_0xfcb1('0x12'));var as=require(_0xfcb1('0x13'));var hardwareService=require(_0xfcb1('0x14'));var logger=require('../../config/logger')(_0xfcb1('0x15'));var utils=require(_0xfcb1('0x16'));var config=require(_0xfcb1('0x17'));var licenseUtil=require(_0xfcb1('0x18'));var db=require(_0xfcb1('0x19'))['db'];config[_0xfcb1('0x1a')]=_[_0xfcb1('0x1b')](config[_0xfcb1('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfcb1('0x1a')]));require(_0xfcb1('0x1c'))[_0xfcb1('0x1d')](socket);var jayson=require(_0xfcb1('0x1e'));var client=jayson[_0xfcb1('0x1f')][_0xfcb1('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x2ef017,_0x4cddb0,_0x176973,_0x2e00d7){return new BPromise(function(_0x3bce46,_0xfdc5df){var _0x3099df=_0x2e00d7||client;return _0x3099df[_0xfcb1('0x21')](_0x2ef017,_0x176973)['then'](function(_0x53b7c6){logger[_0xfcb1('0x22')](_0xfcb1('0x23'),_0x4cddb0,'request\x20sent');logger[_0xfcb1('0x24')](_0xfcb1('0x25'),_0x4cddb0,'request\x20sent',JSON[_0xfcb1('0x26')](_0x53b7c6));if(_0x53b7c6[_0xfcb1('0x27')]){if(_0x53b7c6[_0xfcb1('0x27')][_0xfcb1('0x28')]===0x1f4){logger[_0xfcb1('0x27')](_0xfcb1('0x23'),_0x4cddb0,_0x53b7c6[_0xfcb1('0x27')][_0xfcb1('0x29')]);return _0xfdc5df(_0x53b7c6[_0xfcb1('0x27')]['message']);}logger[_0xfcb1('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x4cddb0,_0x53b7c6[_0xfcb1('0x27')][_0xfcb1('0x29')]);return _0x3bce46(_0x53b7c6[_0xfcb1('0x27')]['message']);}else{logger[_0xfcb1('0x22')](_0xfcb1('0x23'),_0x4cddb0,'request\x20sent');_0x3bce46(_0x53b7c6[_0xfcb1('0x2a')][_0xfcb1('0x29')]);}})[_0xfcb1('0x2b')](function(_0x2ed265){logger[_0xfcb1('0x27')](_0xfcb1('0x23'),_0x4cddb0,_0x2ed265);_0xfdc5df(_0x2ed265);});});}function respondWithStatusCode(_0x2f3474,_0x40660c){_0x40660c=_0x40660c||0xcc;return function(_0x22167d){if(_0x22167d){return _0x2f3474[_0xfcb1('0x2c')](_0x40660c);}return _0x2f3474['status'](_0x40660c)['end']();};}function respondWithResult(_0x3b1071,_0x133895){_0x133895=_0x133895||0xc8;return function(_0x1da5f4){if(_0x1da5f4){return _0x3b1071[_0xfcb1('0x2d')](_0x133895)['json'](_0x1da5f4);}};}function respondWithFilteredResult(_0x569875,_0x1fa86d){return function(_0x233b06){if(_0x233b06){var _0x46d90c=typeof _0x1fa86d['offset']===_0xfcb1('0x2e')&&typeof _0x1fa86d['limit']===_0xfcb1('0x2e');var _0x2ceea9=_0x233b06[_0xfcb1('0x2f')];var _0x36dc58=_0x46d90c?0x0:_0x1fa86d[_0xfcb1('0x30')];var _0x44ab02=_0x46d90c?_0x233b06['count']:_0x1fa86d['offset']+_0x1fa86d[_0xfcb1('0x31')];var _0x27911b;if(_0x44ab02>=_0x2ceea9){_0x44ab02=_0x2ceea9;_0x27911b=0xc8;}else{_0x27911b=0xce;}_0x569875[_0xfcb1('0x2d')](_0x27911b);return _0x569875[_0xfcb1('0x32')](_0xfcb1('0x33'),_0x36dc58+'-'+_0x44ab02+'/'+_0x2ceea9)[_0xfcb1('0x34')](_0x233b06);}return null;};}function patchUpdates(_0x47cfe8){return function(_0x44d3c2){try{jsonpatch['apply'](_0x44d3c2,_0x47cfe8,!![]);}catch(_0x1e2e58){return BPromise['reject'](_0x1e2e58);}return _0x44d3c2[_0xfcb1('0x35')]();};}function saveUpdates(_0x4b6f13,_0x2ef3aa){return function(_0x259234){if(_0x259234){return _0x259234[_0xfcb1('0x36')](_0x4b6f13)[_0xfcb1('0x37')](function(_0x1bba08){return _0x1bba08;});}return null;};}function removeEntity(_0x10384b,_0x34f3ec){return function(_0x17793d){if(_0x17793d){return _0x17793d[_0xfcb1('0x38')]()[_0xfcb1('0x37')](function(){var _0x2b7070=_0x17793d['get']({'plain':!![]});var _0x5d4221='WhatsappAccounts';return db[_0xfcb1('0x39')][_0xfcb1('0x38')]({'where':{'type':_0x5d4221,'resourceId':_0x2b7070['id']}})['then'](function(){return _0x17793d;});})[_0xfcb1('0x37')](function(){_0x10384b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30c819,_0x17a459){return function(_0xbabc74){if(!_0xbabc74){_0x30c819['sendStatus'](0x194);}return _0xbabc74;};}function handleError(_0x4b275f,_0x9a307d){_0x9a307d=_0x9a307d||0x1f4;return function(_0x2daef7){logger[_0xfcb1('0x27')](_0x2daef7[_0xfcb1('0x3a')]);if(_0x2daef7[_0xfcb1('0x3b')]){delete _0x2daef7[_0xfcb1('0x3b')];}_0x4b275f[_0xfcb1('0x2d')](_0x9a307d)['send'](_0x2daef7);};}exports['index']=function(_0x2dabf4,_0x1bcd47){var _0xcc4e1b={'include':[{'model':db['Pause'],'as':_0xfcb1('0x3c')}]},_0xde9e1a={},_0x48991e={'count':0x0,'rows':[]};var _0x4d7550=_['map'](db['WhatsappAccount'][_0xfcb1('0x3d')],function(_0x33e6f2){return{'name':_0x33e6f2[_0xfcb1('0x3e')],'type':_0x33e6f2[_0xfcb1('0x3f')][_0xfcb1('0x40')]};});_0xde9e1a[_0xfcb1('0x41')]=_[_0xfcb1('0x42')](_0x4d7550,_0xfcb1('0x3b'));_0xde9e1a[_0xfcb1('0x43')]=_[_0xfcb1('0x44')](_0x2dabf4[_0xfcb1('0x43')]);_0xde9e1a[_0xfcb1('0x45')]=_[_0xfcb1('0x46')](_0xde9e1a[_0xfcb1('0x41')],_0xde9e1a['query']);_0xcc4e1b['attributes']=_['intersection'](_0xde9e1a['model'],qs[_0xfcb1('0x47')](_0x2dabf4['query'][_0xfcb1('0x47')]));_0xcc4e1b[_0xfcb1('0x48')]=_0xcc4e1b['attributes'][_0xfcb1('0x49')]?_0xcc4e1b['attributes']:_0xde9e1a[_0xfcb1('0x41')];if(!_0x2dabf4[_0xfcb1('0x43')]['hasOwnProperty']('nolimit')){_0xcc4e1b[_0xfcb1('0x31')]=qs['limit'](_0x2dabf4[_0xfcb1('0x43')]['limit']);_0xcc4e1b['offset']=qs[_0xfcb1('0x30')](_0x2dabf4[_0xfcb1('0x43')][_0xfcb1('0x30')]);}_0xcc4e1b['order']=qs['sort'](_0x2dabf4[_0xfcb1('0x43')]['sort']);_0xcc4e1b[_0xfcb1('0x4a')]=qs[_0xfcb1('0x45')](_[_0xfcb1('0x4b')](_0x2dabf4[_0xfcb1('0x43')],_0xde9e1a[_0xfcb1('0x45')]),_0x4d7550);if(_0x2dabf4['query'][_0xfcb1('0x4c')]){_0xcc4e1b[_0xfcb1('0x4a')]=_[_0xfcb1('0x4d')](_0xcc4e1b[_0xfcb1('0x4a')],{'$or':_[_0xfcb1('0x42')](_0x4d7550,function(_0x1847ba){if(_0x1847ba[_0xfcb1('0x3f')]!==_0xfcb1('0x4e')){var _0x2ada75={};_0x2ada75[_0x1847ba['name']]={'$like':'%'+_0x2dabf4['query'][_0xfcb1('0x4c')]+'%'};return _0x2ada75;}})});}_0xcc4e1b=_['merge']({},_0xcc4e1b,_0x2dabf4[_0xfcb1('0x4f')]);var _0x795999={'where':_0xcc4e1b[_0xfcb1('0x4a')]};return db['WhatsappAccount'][_0xfcb1('0x2f')](_0x795999)[_0xfcb1('0x37')](function(_0x3efae5){_0x48991e[_0xfcb1('0x2f')]=_0x3efae5;if(_0x2dabf4[_0xfcb1('0x43')][_0xfcb1('0x50')]){_0xcc4e1b[_0xfcb1('0x51')]=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0xcc4e1b);})[_0xfcb1('0x37')](function(_0x2b4626){_0x48991e['rows']=_0x2b4626;return _0x48991e;})[_0xfcb1('0x37')](respondWithFilteredResult(_0x1bcd47,_0xcc4e1b))[_0xfcb1('0x2b')](handleError(_0x1bcd47,null));};exports['show']=function(_0x4f18e9,_0x2f6310){var _0x2703f9={'raw':![],'where':{'id':_0x4f18e9[_0xfcb1('0x52')]['id']},'include':[{'model':db[_0xfcb1('0x53')],'as':_0xfcb1('0x3c')}]},_0x26088c={};_0x26088c[_0xfcb1('0x41')]=_[_0xfcb1('0x44')](db[_0xfcb1('0x54')][_0xfcb1('0x3d')]);_0x26088c['query']=_[_0xfcb1('0x44')](_0x4f18e9[_0xfcb1('0x43')]);_0x26088c['filters']=_[_0xfcb1('0x46')](_0x26088c['model'],_0x26088c['query']);_0x2703f9[_0xfcb1('0x48')]=_['intersection'](_0x26088c['model'],qs[_0xfcb1('0x47')](_0x4f18e9[_0xfcb1('0x43')][_0xfcb1('0x47')]));_0x2703f9[_0xfcb1('0x48')]=_0x2703f9['attributes'][_0xfcb1('0x49')]?_0x2703f9[_0xfcb1('0x48')]:_0x26088c[_0xfcb1('0x41')];if(_0x4f18e9[_0xfcb1('0x43')]['includeAll']){_0x2703f9[_0xfcb1('0x51')]=[{'all':!![]}];}_0x2703f9=_[_0xfcb1('0x4d')]({},_0x2703f9,_0x4f18e9[_0xfcb1('0x4f')]);return db[_0xfcb1('0x54')][_0xfcb1('0x55')](_0x2703f9)[_0xfcb1('0x37')](handleEntityNotFound(_0x2f6310,null))[_0xfcb1('0x37')](respondWithResult(_0x2f6310,null))[_0xfcb1('0x2b')](handleError(_0x2f6310,null));};exports[_0xfcb1('0x56')]=function(_0x4e8c32,_0x22cd25){return db[_0xfcb1('0x54')]['create'](_0x4e8c32[_0xfcb1('0x57')],{})[_0xfcb1('0x37')](function(_0x5f270b){var _0x30e096=_0x4e8c32['user'][_0xfcb1('0x58')]({'plain':!![]});if(!_0x30e096)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30e096['role']==='user'){var _0xe54f83=_0x5f270b[_0xfcb1('0x58')]({'plain':!![]});var _0x2cbcb0='WhatsappAccounts';return db[_0xfcb1('0x59')][_0xfcb1('0x55')]({'where':{'name':_0x2cbcb0,'userProfileId':_0x30e096['userProfileId']},'raw':!![]})['then'](function(_0x2264b8){if(_0x2264b8&&_0x2264b8[_0xfcb1('0x5a')]===0x0){return db['UserProfileResource'][_0xfcb1('0x56')]({'name':_0xe54f83[_0xfcb1('0x3b')],'resourceId':_0xe54f83['id'],'type':_0x2264b8['name'],'sectionId':_0x2264b8['id']},{})['then'](function(){return _0x5f270b;});}else{return _0x5f270b;}})['catch'](function(_0x13f39c){logger[_0xfcb1('0x27')](_0xfcb1('0x5b'),_0x13f39c);throw _0x13f39c;});}return _0x5f270b;})[_0xfcb1('0x37')](respondWithResult(_0x22cd25,0xc9))[_0xfcb1('0x2b')](handleError(_0x22cd25,null));};exports[_0xfcb1('0x36')]=function(_0x57388a,_0xa79a91){if(_0x57388a['body']['id']){delete _0x57388a['body']['id'];}return db[_0xfcb1('0x54')][_0xfcb1('0x55')]({'where':{'id':_0x57388a[_0xfcb1('0x52')]['id']},'include':[{'model':db[_0xfcb1('0x53')],'as':_0xfcb1('0x3c')}]})[_0xfcb1('0x37')](handleEntityNotFound(_0xa79a91,null))[_0xfcb1('0x37')](saveUpdates(_0x57388a[_0xfcb1('0x57')],null))['then'](respondWithResult(_0xa79a91,null))['catch'](handleError(_0xa79a91,null));};exports[_0xfcb1('0x38')]=function(_0x2813e7,_0xa495a5){return db[_0xfcb1('0x54')][_0xfcb1('0x55')]({'where':{'id':_0x2813e7[_0xfcb1('0x52')]['id']}})[_0xfcb1('0x37')](handleEntityNotFound(_0xa495a5,null))[_0xfcb1('0x37')](removeEntity(_0xa495a5,null))[_0xfcb1('0x2b')](handleError(_0xa495a5,null));};exports[_0xfcb1('0x5c')]=function(_0x2149a3,_0x3bff7a){return db['WhatsappAccount'][_0xfcb1('0x5c')]()[_0xfcb1('0x37')](respondWithResult(_0x3bff7a,null))['catch'](handleError(_0x3bff7a,null));};exports['addDisposition']=function(_0xbc155d,_0x56295a,_0x1a319e){if(_0xbc155d[_0xfcb1('0x57')]['id']){delete _0xbc155d[_0xfcb1('0x57')]['id'];}return db['WhatsappAccount'][_0xfcb1('0x55')]({'where':{'id':_0xbc155d[_0xfcb1('0x52')]['id']}})[_0xfcb1('0x37')](handleEntityNotFound(_0x56295a,null))[_0xfcb1('0x37')](function(_0x174931){if(_0x174931){_0xbc155d[_0xfcb1('0x57')][_0xfcb1('0x5d')]=_0x174931['id'];return db[_0xfcb1('0x5e')][_0xfcb1('0x56')](_0xbc155d['body']);}})[_0xfcb1('0x37')](respondWithResult(_0x56295a,null))[_0xfcb1('0x2b')](handleError(_0x56295a,null));};exports[_0xfcb1('0x5f')]=function(_0x3041ed,_0x45c929,_0x3d3c21){var _0x2dcad4={'raw':![],'where':{}};var _0x5ad497={};var _0x4cc4bb={'count':0x0,'rows':[]};return db[_0xfcb1('0x54')][_0xfcb1('0x60')]({'where':{'id':_0x3041ed['params']['id']}})['then'](handleEntityNotFound(_0x45c929,null))['then'](function(_0x3cfe08){if(_0x3cfe08){_0x5ad497[_0xfcb1('0x41')]=_[_0xfcb1('0x44')](db[_0xfcb1('0x5e')][_0xfcb1('0x3d')]);_0x5ad497[_0xfcb1('0x43')]=_[_0xfcb1('0x44')](_0x3041ed['query']);_0x5ad497['filters']=_['intersection'](_0x5ad497['model'],_0x5ad497[_0xfcb1('0x43')]);_0x2dcad4['attributes']=_[_0xfcb1('0x46')](_0x5ad497['model'],qs[_0xfcb1('0x47')](_0x3041ed[_0xfcb1('0x43')][_0xfcb1('0x47')]));_0x2dcad4[_0xfcb1('0x48')]=_0x2dcad4[_0xfcb1('0x48')][_0xfcb1('0x49')]?_0x2dcad4[_0xfcb1('0x48')]:_0x5ad497[_0xfcb1('0x41')];if(!_0x3041ed[_0xfcb1('0x43')][_0xfcb1('0x61')](_0xfcb1('0x62'))){_0x2dcad4['limit']=qs[_0xfcb1('0x31')](_0x3041ed[_0xfcb1('0x43')][_0xfcb1('0x31')]);_0x2dcad4[_0xfcb1('0x30')]=qs[_0xfcb1('0x30')](_0x3041ed['query']['offset']);}_0x2dcad4[_0xfcb1('0x63')]=qs['sort'](_0x3041ed[_0xfcb1('0x43')][_0xfcb1('0x64')]);_0x2dcad4[_0xfcb1('0x4a')]=qs[_0xfcb1('0x45')](_['pick'](_0x3041ed[_0xfcb1('0x43')],_0x5ad497[_0xfcb1('0x45')]));_0x2dcad4[_0xfcb1('0x4a')][_0xfcb1('0x5d')]=_0x3cfe08['id'];if(_0x3041ed[_0xfcb1('0x43')][_0xfcb1('0x4c')]){_0x2dcad4[_0xfcb1('0x4a')]=_[_0xfcb1('0x4d')](_0x2dcad4[_0xfcb1('0x4a')],{'$or':_[_0xfcb1('0x42')](_0x2dcad4[_0xfcb1('0x48')],function(_0x332752){var _0x146244={};_0x146244[_0x332752]={'$like':'%'+_0x3041ed[_0xfcb1('0x43')]['filter']+'%'};return _0x146244;})});}_0x2dcad4=_[_0xfcb1('0x4d')]({},_0x2dcad4,_0x3041ed[_0xfcb1('0x4f')]);return db[_0xfcb1('0x5e')][_0xfcb1('0x2f')]({'where':_0x2dcad4[_0xfcb1('0x4a')]})[_0xfcb1('0x37')](function(_0xfb030c){_0x4cc4bb[_0xfcb1('0x2f')]=_0xfb030c;if(_0x3041ed[_0xfcb1('0x43')][_0xfcb1('0x50')]){_0x2dcad4['include']=[{'all':!![]}];}return db[_0xfcb1('0x5e')][_0xfcb1('0x65')](_0x2dcad4);})[_0xfcb1('0x37')](function(_0x3a5d2d){_0x4cc4bb['rows']=_0x3a5d2d;return _0x4cc4bb;});}})[_0xfcb1('0x37')](respondWithFilteredResult(_0x45c929,_0x2dcad4))[_0xfcb1('0x2b')](handleError(_0x45c929,null));};exports['removeDispositions']=function(_0x440dd8,_0x1cbad3,_0x197c96){return db[_0xfcb1('0x54')]['find']({'where':{'id':_0x440dd8[_0xfcb1('0x52')]['id']}})['then'](handleEntityNotFound(_0x1cbad3,null))[_0xfcb1('0x37')](function(_0x5d36c7){if(_0x5d36c7){return _0x5d36c7[_0xfcb1('0x66')](_0x440dd8['query'][_0xfcb1('0x67')]);}})[_0xfcb1('0x37')](respondWithStatusCode(_0x1cbad3,null))[_0xfcb1('0x2b')](handleError(_0x1cbad3,null));};exports[_0xfcb1('0x68')]=function(_0x18bd2a,_0x18abfb,_0x15abe0){if(_0x18bd2a[_0xfcb1('0x57')]['id']){delete _0x18bd2a[_0xfcb1('0x57')]['id'];}return db[_0xfcb1('0x54')][_0xfcb1('0x55')]({'where':{'id':_0x18bd2a['params']['id']}})[_0xfcb1('0x37')](handleEntityNotFound(_0x18abfb,null))[_0xfcb1('0x37')](function(_0x2a5d13){if(_0x2a5d13){_0x18bd2a[_0xfcb1('0x57')][_0xfcb1('0x5d')]=_0x2a5d13['id'];return db['CannedAnswer'][_0xfcb1('0x56')](_0x18bd2a[_0xfcb1('0x57')]);}})[_0xfcb1('0x37')](respondWithResult(_0x18abfb,null))[_0xfcb1('0x2b')](handleError(_0x18abfb,null));};exports[_0xfcb1('0x69')]=function(_0x29ca16,_0x26adfe,_0x4713a6){var _0x3ff273={'raw':![],'where':{}};var _0xeaecc9={};var _0x39438f={'count':0x0,'rows':[]};return db[_0xfcb1('0x54')][_0xfcb1('0x60')]({'where':{'id':_0x29ca16[_0xfcb1('0x52')]['id']}})['then'](handleEntityNotFound(_0x26adfe,null))[_0xfcb1('0x37')](function(_0x4bf1b2){if(_0x4bf1b2){_0xeaecc9[_0xfcb1('0x41')]=_[_0xfcb1('0x44')](db[_0xfcb1('0x6a')][_0xfcb1('0x3d')]);_0xeaecc9[_0xfcb1('0x43')]=_[_0xfcb1('0x44')](_0x29ca16['query']);_0xeaecc9[_0xfcb1('0x45')]=_[_0xfcb1('0x46')](_0xeaecc9[_0xfcb1('0x41')],_0xeaecc9[_0xfcb1('0x43')]);_0x3ff273[_0xfcb1('0x48')]=_[_0xfcb1('0x46')](_0xeaecc9[_0xfcb1('0x41')],qs[_0xfcb1('0x47')](_0x29ca16[_0xfcb1('0x43')]['fields']));_0x3ff273['attributes']=_0x3ff273[_0xfcb1('0x48')]['length']?_0x3ff273[_0xfcb1('0x48')]:_0xeaecc9['model'];if(!_0x29ca16[_0xfcb1('0x43')][_0xfcb1('0x61')](_0xfcb1('0x62'))){_0x3ff273['limit']=qs['limit'](_0x29ca16[_0xfcb1('0x43')][_0xfcb1('0x31')]);_0x3ff273['offset']=qs[_0xfcb1('0x30')](_0x29ca16[_0xfcb1('0x43')][_0xfcb1('0x30')]);}_0x3ff273[_0xfcb1('0x63')]=qs[_0xfcb1('0x64')](_0x29ca16[_0xfcb1('0x43')]['sort']);_0x3ff273[_0xfcb1('0x4a')]=qs['filters'](_[_0xfcb1('0x4b')](_0x29ca16['query'],_0xeaecc9[_0xfcb1('0x45')]));_0x3ff273[_0xfcb1('0x4a')][_0xfcb1('0x5d')]=_0x4bf1b2['id'];if(_0x29ca16[_0xfcb1('0x43')][_0xfcb1('0x4c')]){_0x3ff273[_0xfcb1('0x4a')]=_['merge'](_0x3ff273[_0xfcb1('0x4a')],{'$or':_[_0xfcb1('0x42')](_0x3ff273[_0xfcb1('0x48')],function(_0x342fc0){var _0x3b0069={};_0x3b0069[_0x342fc0]={'$like':'%'+_0x29ca16[_0xfcb1('0x43')][_0xfcb1('0x4c')]+'%'};return _0x3b0069;})});}_0x3ff273=_[_0xfcb1('0x4d')]({},_0x3ff273,_0x29ca16[_0xfcb1('0x4f')]);return db[_0xfcb1('0x6a')][_0xfcb1('0x2f')]({'where':_0x3ff273[_0xfcb1('0x4a')]})[_0xfcb1('0x37')](function(_0x2be554){_0x39438f[_0xfcb1('0x2f')]=_0x2be554;if(_0x29ca16['query'][_0xfcb1('0x50')]){_0x3ff273['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3ff273);})[_0xfcb1('0x37')](function(_0x569385){_0x39438f['rows']=_0x569385;return _0x39438f;});}})[_0xfcb1('0x37')](respondWithFilteredResult(_0x26adfe,_0x3ff273))[_0xfcb1('0x2b')](handleError(_0x26adfe,null));};exports[_0xfcb1('0x6b')]=function(_0x372b8f,_0x5a3b4f,_0x566197){return db['WhatsappAccount'][_0xfcb1('0x55')]({'where':{'id':_0x372b8f[_0xfcb1('0x52')]['id']}})[_0xfcb1('0x37')](handleEntityNotFound(_0x5a3b4f,null))[_0xfcb1('0x37')](function(_0x3010ea){if(_0x3010ea){return _0x3010ea[_0xfcb1('0x6b')](_0x372b8f[_0xfcb1('0x43')][_0xfcb1('0x67')]);}})[_0xfcb1('0x37')](respondWithStatusCode(_0x5a3b4f,null))[_0xfcb1('0x2b')](handleError(_0x5a3b4f,null));};exports['addAgents']=function(_0x115e81,_0x2bc100,_0x4be01a){return db[_0xfcb1('0x54')]['find']({'where':{'id':_0x115e81['params']['id']}})[_0xfcb1('0x37')](handleEntityNotFound(_0x2bc100,null))[_0xfcb1('0x37')](function(_0x3e01a0){if(_0x3e01a0){return _0x3e01a0[_0xfcb1('0x6c')](_0x115e81[_0xfcb1('0x57')][_0xfcb1('0x67')],_[_0xfcb1('0x6d')](_0x115e81[_0xfcb1('0x57')],[_0xfcb1('0x67'),'id'])||{})[_0xfcb1('0x6e')](function(_0x2006d2){for(var _0x40c375=0x0;_0x40c375<_0x115e81[_0xfcb1('0x57')][_0xfcb1('0x67')][_0xfcb1('0x49')];_0x40c375+=0x1){socket[_0xfcb1('0x6f')](_0xfcb1('0x70'),{'UserId':Number(_0x115e81['body'][_0xfcb1('0x67')][_0x40c375]),'WhatsappAccountId':Number(_0x115e81[_0xfcb1('0x52')]['id'])});}return _0x2006d2;});}})[_0xfcb1('0x37')](respondWithResult(_0x2bc100,null))[_0xfcb1('0x2b')](handleError(_0x2bc100,null));};exports[_0xfcb1('0x71')]=function(_0x4337eb,_0x3b77f7,_0x4ade20){return db['WhatsappAccount'][_0xfcb1('0x55')]({'where':{'id':_0x4337eb[_0xfcb1('0x52')]['id']}})['then'](handleEntityNotFound(_0x3b77f7,null))[_0xfcb1('0x37')](function(_0x1eee60){if(_0x1eee60){return _0x1eee60[_0xfcb1('0x71')](_0x4337eb[_0xfcb1('0x43')][_0xfcb1('0x67')])['then'](function(){if(_[_0xfcb1('0x72')](_0x4337eb['query'][_0xfcb1('0x67')])){for(var _0x54fdfe=0x0;_0x54fdfe<_0x4337eb[_0xfcb1('0x43')][_0xfcb1('0x67')][_0xfcb1('0x49')];_0x54fdfe+=0x1){socket[_0xfcb1('0x6f')](_0xfcb1('0x73'),{'UserId':Number(_0x4337eb['query'][_0xfcb1('0x67')][_0x54fdfe]),'WhatsappAccountId':Number(_0x4337eb[_0xfcb1('0x52')]['id'])});}}else{socket[_0xfcb1('0x6f')]('userWhatsappAccount:remove',{'UserId':Number(_0x4337eb['query'][_0xfcb1('0x67')]),'WhatsappAccountId':Number(_0x4337eb[_0xfcb1('0x52')]['id'])});}});}})[_0xfcb1('0x37')](respondWithStatusCode(_0x3b77f7,null))[_0xfcb1('0x2b')](handleError(_0x3b77f7,null));};exports[_0xfcb1('0x74')]=function(_0x47640f,_0x50e78f,_0x5dd361){var _0x154182={};var _0x275cf6={};var _0x37aac3;var _0x3bde8b;return db[_0xfcb1('0x54')][_0xfcb1('0x60')]({'where':{'id':_0x47640f[_0xfcb1('0x52')]['id']}})[_0xfcb1('0x37')](handleEntityNotFound(_0x50e78f,null))['then'](function(_0x3a12c3){if(_0x3a12c3){_0x37aac3=_0x3a12c3;_0x275cf6[_0xfcb1('0x41')]=_['keys'](db['User'][_0xfcb1('0x3d')]);_0x275cf6['query']=_[_0xfcb1('0x44')](_0x47640f['query']);_0x275cf6[_0xfcb1('0x45')]=_[_0xfcb1('0x46')](_0x275cf6['model'],_0x275cf6['query']);_0x154182[_0xfcb1('0x48')]=_[_0xfcb1('0x46')](_0x275cf6[_0xfcb1('0x41')],qs[_0xfcb1('0x47')](_0x47640f[_0xfcb1('0x43')][_0xfcb1('0x47')]));_0x154182[_0xfcb1('0x48')]=_0x154182[_0xfcb1('0x48')][_0xfcb1('0x49')]?_0x154182['attributes']:_0x275cf6['model'];_0x154182[_0xfcb1('0x63')]=qs[_0xfcb1('0x64')](_0x47640f[_0xfcb1('0x43')][_0xfcb1('0x64')]);_0x154182[_0xfcb1('0x4a')]=qs[_0xfcb1('0x45')](_['pick'](_0x47640f['query'],_0x275cf6[_0xfcb1('0x45')]));if(_0x47640f[_0xfcb1('0x43')]['filter']){_0x154182[_0xfcb1('0x4a')]=_[_0xfcb1('0x4d')](_0x154182[_0xfcb1('0x4a')],{'$or':_['map'](_0x154182[_0xfcb1('0x48')],function(_0x6b051c){var _0x220cc7={};_0x220cc7[_0x6b051c]={'$like':'%'+_0x47640f[_0xfcb1('0x43')][_0xfcb1('0x4c')]+'%'};return _0x220cc7;})});}_0x154182=_[_0xfcb1('0x4d')]({},_0x154182,_0x47640f['options']);return _0x37aac3['getAgents'](_0x154182);}})[_0xfcb1('0x37')](function(_0x160b00){if(_0x160b00){_0x3bde8b=_0x160b00[_0xfcb1('0x49')];if(!_0x47640f[_0xfcb1('0x43')]['hasOwnProperty']('nolimit')){_0x154182[_0xfcb1('0x31')]=qs[_0xfcb1('0x31')](_0x47640f[_0xfcb1('0x43')][_0xfcb1('0x31')]);_0x154182[_0xfcb1('0x30')]=qs[_0xfcb1('0x30')](_0x47640f[_0xfcb1('0x43')][_0xfcb1('0x30')]);}return _0x37aac3[_0xfcb1('0x74')](_0x154182);}})[_0xfcb1('0x37')](function(_0x4b0db7){if(_0x4b0db7){return _0x4b0db7?{'count':_0x3bde8b,'rows':_0x4b0db7}:null;}})['then'](respondWithResult(_0x50e78f,null))[_0xfcb1('0x2b')](handleError(_0x50e78f,null));};exports['addApplications']=function(_0x523cfd,_0x2a22a5){var _0x201a0f=_0x523cfd[_0xfcb1('0x52')]['id'];var _0x4bcc01=_0x523cfd[_0xfcb1('0x57')];var _0x1a4b40=0xc8;var _0x1be71a=null;return db[_0xfcb1('0x75')][_0xfcb1('0x76')]({'isolationLevel':db[_0xfcb1('0x75')]['Transaction'][_0xfcb1('0x77')][_0xfcb1('0x78')]},function(_0x3c4022){return db[_0xfcb1('0x54')]['findOne']({'where':{'id':_0x201a0f},'transaction':_0x3c4022})[_0xfcb1('0x37')](function(_0x42111b){if(_0x42111b){return db[_0xfcb1('0x79')]['destroy']({'where':{'WhatsappAccountId':_0x201a0f},'transaction':_0x3c4022})[_0xfcb1('0x37')](function(){var _0x50e9f7=_['map'](_0x4bcc01,function(_0x51aaac){_0x51aaac['WhatsappAccountId']=_0x201a0f;return _0x51aaac;});return db['WhatsappApplication'][_0xfcb1('0x7a')](_0x50e9f7,{'transaction':_0x3c4022});});}else{_0x1a4b40=0x194;_0x1be71a=[];}});})['then'](function(){if(_0x1a4b40!==0x194){return db['WhatsappApplication'][_0xfcb1('0x7b')]({'where':{'WhatsappAccountId':_0x201a0f},'order':_0xfcb1('0x7c')})[_0xfcb1('0x37')](function(_0x15d70c){_0x1be71a=_0x15d70c;});}})[_0xfcb1('0x2b')](function(_0x51b07d){_0x1a4b40=0x1f4;logger[_0xfcb1('0x27')](_0x51b07d[_0xfcb1('0x3a')]);if(_0x51b07d[_0xfcb1('0x3b')]){delete _0x51b07d[_0xfcb1('0x3b')];}_0x1be71a=_0x51b07d;})[_0xfcb1('0x7d')](function(){if(_0x1be71a===null){_0x2a22a5[_0xfcb1('0x2c')](_0x1a4b40);}else{if(_0x1a4b40===0x1f4){_0x2a22a5[_0xfcb1('0x2d')](_0x1a4b40)[_0xfcb1('0x7e')](_0x1be71a);}else{_0x2a22a5[_0xfcb1('0x2d')](_0x1a4b40)[_0xfcb1('0x34')](_0x1be71a);}}});};exports[_0xfcb1('0x7f')]=function(_0x5e1a2f,_0x3f4b7f,_0x11e7bb){var _0x439f10={};var _0xba7e02={};var _0x514a46;var _0x5acde7;return db[_0xfcb1('0x54')]['findOne']({'where':{'id':_0x5e1a2f[_0xfcb1('0x52')]['id']}})[_0xfcb1('0x37')](handleEntityNotFound(_0x3f4b7f,null))[_0xfcb1('0x37')](function(_0x41be8e){if(_0x41be8e){_0x514a46=_0x41be8e;_0xba7e02[_0xfcb1('0x41')]=_[_0xfcb1('0x44')](db[_0xfcb1('0x79')]['rawAttributes']);_0xba7e02[_0xfcb1('0x43')]=_[_0xfcb1('0x44')](_0x5e1a2f['query']);_0xba7e02[_0xfcb1('0x45')]=_[_0xfcb1('0x46')](_0xba7e02[_0xfcb1('0x41')],_0xba7e02[_0xfcb1('0x43')]);_0x439f10[_0xfcb1('0x48')]=_[_0xfcb1('0x46')](_0xba7e02['model'],qs['fields'](_0x5e1a2f[_0xfcb1('0x43')][_0xfcb1('0x47')]));_0x439f10[_0xfcb1('0x48')]=_0x439f10[_0xfcb1('0x48')]['length']?_0x439f10[_0xfcb1('0x48')]:_0xba7e02[_0xfcb1('0x41')];_0x439f10[_0xfcb1('0x63')]=qs['sort'](_0x5e1a2f[_0xfcb1('0x43')][_0xfcb1('0x64')]);_0x439f10[_0xfcb1('0x4a')]=qs[_0xfcb1('0x45')](_[_0xfcb1('0x4b')](_0x5e1a2f[_0xfcb1('0x43')],_0xba7e02[_0xfcb1('0x45')]));if(_0x5e1a2f[_0xfcb1('0x43')][_0xfcb1('0x4c')]){_0x439f10[_0xfcb1('0x4a')]=_[_0xfcb1('0x4d')](_0x439f10[_0xfcb1('0x4a')],{'$or':_[_0xfcb1('0x42')](_0x439f10['attributes'],function(_0x2058a8){var _0x5002aa={};_0x5002aa[_0x2058a8]={'$like':'%'+_0x5e1a2f[_0xfcb1('0x43')][_0xfcb1('0x4c')]+'%'};return _0x5002aa;})});}_0x439f10=_['merge']({},_0x439f10,_0x5e1a2f[_0xfcb1('0x4f')]);return _0x514a46[_0xfcb1('0x7f')](_0x439f10);}})['then'](function(_0x13875b){if(_0x13875b){_0x5acde7=_0x13875b[_0xfcb1('0x49')];if(!_0x5e1a2f[_0xfcb1('0x43')][_0xfcb1('0x61')](_0xfcb1('0x62'))){_0x439f10[_0xfcb1('0x31')]=qs[_0xfcb1('0x31')](_0x5e1a2f[_0xfcb1('0x43')][_0xfcb1('0x31')]);_0x439f10[_0xfcb1('0x30')]=qs['offset'](_0x5e1a2f[_0xfcb1('0x43')]['offset']);}return _0x514a46[_0xfcb1('0x7f')](_0x439f10);}})[_0xfcb1('0x37')](function(_0x1d0bd9){if(_0x1d0bd9){return _0x1d0bd9?{'count':_0x5acde7,'rows':_0x1d0bd9}:null;}})[_0xfcb1('0x37')](respondWithResult(_0x3f4b7f,null))[_0xfcb1('0x2b')](handleError(_0x3f4b7f,null));};exports[_0xfcb1('0x80')]=function(_0xa4b4c,_0x1edda7,_0x5163bf){var _0x36a86e={'channel':'whatsapp'};var _0x34443a=[];var _0x5e773b=[];var _0x267744={};return db[_0xfcb1('0x54')]['find']({'where':{'id':_0xa4b4c[_0xfcb1('0x52')]['id']},'include':[{'model':db[_0xfcb1('0x79')],'as':_0xfcb1('0x81')}]})[_0xfcb1('0x37')](handleEntityNotFound(_0x1edda7,null))[_0xfcb1('0x37')](function(_0x402aec){_0x36a86e[_0xfcb1('0x82')]=_0x402aec;if(_0x36a86e[_0xfcb1('0x82')]&&_0x36a86e[_0xfcb1('0x82')][_0xfcb1('0x3f')]===_0xfcb1('0x83')&&_0xa4b4c[_0xfcb1('0x57')]['statuses']){if(_0xa4b4c['body'][_0xfcb1('0x84')][_0xfcb1('0x49')]===0x0)return;if(_0xa4b4c['body']['statuses'][0x0]['state']!==_0xfcb1('0x85'))return;return db[_0xfcb1('0x86')]['update']({'read':!![],'readAt':_0xa4b4c[_0xfcb1('0x57')][_0xfcb1('0x84')][0x0][_0xfcb1('0x87')]},{'where':{'messageId':_0xa4b4c[_0xfcb1('0x57')][_0xfcb1('0x84')][0x0]['message_id']},'individualHooks':!![]})[_0xfcb1('0x37')](function(_0x5a75ac){return _0x1edda7[_0xfcb1('0x2d')](0xc8)['json'](_0x5a75ac);});}_0x36a86e['applications']=_['orderBy'](_0x402aec[_0xfcb1('0x81')],[_0xfcb1('0x7c')],[_0xfcb1('0x88')]);if(_0x36a86e[_0xfcb1('0x82')]['Applications']){delete _0x36a86e[_0xfcb1('0x82')][_0xfcb1('0x81')];}return db[_0xfcb1('0x89')]['describe']()['then'](function(_0x3498a8){if(!_0x3498a8){throw new db[(_0xfcb1('0x8a'))]['ValidationError'](_0xfcb1('0x8b'));}_0x34443a=_[_0xfcb1('0x8c')](_['keys'](_0x3498a8),['createdAt',_0xfcb1('0x8d')]);_0x5e773b=_['difference'](_[_0xfcb1('0x44')](_0x3498a8),[_0xfcb1('0x8e'),_0xfcb1('0x8d'),_0xfcb1('0x8f'),_0xfcb1('0x90')]);_0x36a86e[_0xfcb1('0x57')]={'mapKey':_0xfcb1('0x91')};if(_0x36a86e[_0xfcb1('0x82')]&&_0x36a86e[_0xfcb1('0x82')][_0xfcb1('0x3f')]===_0xfcb1('0x92')){_0x36a86e[_0xfcb1('0x57')][_0xfcb1('0x93')]=_0xa4b4c[_0xfcb1('0x57')][_0xfcb1('0x94')]['replace'](_0xfcb1('0x95'),'');_0x36a86e[_0xfcb1('0x57')]['body']=_0xa4b4c['body'][_0xfcb1('0x96')];_0x36a86e[_0xfcb1('0x57')][_0xfcb1('0x97')]=_0xa4b4c[_0xfcb1('0x57')][_0xfcb1('0x98')];}if(_0x36a86e['account']&&_0x36a86e[_0xfcb1('0x82')]['type']===_0xfcb1('0x83')){_0x36a86e[_0xfcb1('0x57')][_0xfcb1('0x93')]=_0xa4b4c[_0xfcb1('0x57')]['notifications'][0x0]['from'];_0x36a86e[_0xfcb1('0x57')][_0xfcb1('0x57')]=_0xa4b4c[_0xfcb1('0x57')]['notifications'][0x0][_0xfcb1('0x29')]['body'];_0x36a86e['body']['messageId']=_0xa4b4c[_0xfcb1('0x57')]['notifications'][0x0][_0xfcb1('0x99')];}if(_0x36a86e[_0xfcb1('0x57')]['id']){delete _0x36a86e[_0xfcb1('0x57')]['id'];}if(_['isNil'](_0x36a86e['body'][_0xfcb1('0x93')])){throw new db[(_0xfcb1('0x8a'))]['ValidationError'](_0xfcb1('0x9a'));}if(_[_0xfcb1('0x9b')](_0x36a86e[_0xfcb1('0x57')][_0xfcb1('0x57')])||_0x36a86e['body'][_0xfcb1('0x57')]===''){throw new db['Sequelize'][(_0xfcb1('0x9c'))](_0xfcb1('0x9d'));}if(_[_0xfcb1('0x9b')](_0x36a86e[_0xfcb1('0x57')][_0xfcb1('0x9e')])){throw new db['Sequelize'][(_0xfcb1('0x9c'))](_0xfcb1('0x9f')+_0x5e773b);}if(!_['includes'](_0x5e773b,_0x36a86e[_0xfcb1('0x57')][_0xfcb1('0x9e')])){throw new db['Sequelize'][(_0xfcb1('0x9c'))](_0xfcb1('0xa0')+_0x5e773b);}_0x267744[_0x36a86e[_0xfcb1('0x57')]['mapKey']]=_0x36a86e[_0xfcb1('0x57')][_0xfcb1('0x93')];return db['CmList'][_0xfcb1('0x55')]({'where':{'id':_0x36a86e[_0xfcb1('0x82')][_0xfcb1('0x90')]},'include':[{'model':db[_0xfcb1('0x89')],'as':_0xfcb1('0xa1'),'where':_0x267744,'limit':0x1,'order':[[_0xfcb1('0x8d'),_0xfcb1('0xa2')]]}]});})[_0xfcb1('0x37')](handleEntityNotFound(_0x1edda7,null))['then'](function(_0x3d2412){if(_0x3d2412){_0x36a86e[_0xfcb1('0xa3')]=_[_0xfcb1('0x6d')](_0x3d2412,[_0xfcb1('0xa1')]);if(_0x3d2412[_0xfcb1('0xa1')][_0xfcb1('0x49')]){return _0x3d2412[_0xfcb1('0xa1')][0x0];}var _0x2f833d=_[_0xfcb1('0x1b')](_0x36a86e[_0xfcb1('0x57')],{'firstName':_0x36a86e[_0xfcb1('0x57')][_0xfcb1('0x93')],'ListId':_0x3d2412['id']});_0x2f833d[_0x36a86e[_0xfcb1('0x57')][_0xfcb1('0x9e')]]=_0x36a86e[_0xfcb1('0x57')][_0xfcb1('0x93')];return db[_0xfcb1('0x89')]['create'](_0x2f833d,{'fields':_0x34443a,'raw':!![]});}})[_0xfcb1('0x37')](handleEntityNotFound(_0x1edda7,null))[_0xfcb1('0x37')](function(_0x173517){if(_0x173517){_0x36a86e['contact']=_0x173517;var _0x361a1a={'ContactId':_0x173517['id'],'phone':_0x36a86e[_0xfcb1('0x57')]['from'],'WhatsappAccountId':_0xa4b4c[_0xfcb1('0x52')]['id']};var _0x3b962a={'ContactId':_0x173517['id'],'WhatsappAccountId':_0xa4b4c['params']['id'],'closed':![]};return db[_0xfcb1('0xa4')][_0xfcb1('0x55')]({'where':_0x3b962a})[_0xfcb1('0x37')](function(_0x5b9ace){if(_0x5b9ace){return[_0x5b9ace,![]];}return db[_0xfcb1('0xa4')][_0xfcb1('0x56')](_0x361a1a)[_0xfcb1('0x37')](function(_0x48c70f){return[_0x48c70f,!![]];});});}})['spread'](function(_0x1820a9,_0x3b9577){_0x36a86e['interaction']=_0x1820a9[_0xfcb1('0x58')]({'plain':!![]});_0x36a86e['interaction']['created']=![];if(_0x3b9577){if(_0x36a86e[_0xfcb1('0x82')][_0xfcb1('0xa5')]){_0x36a86e[_0xfcb1('0xa6')]['push']({'id':0x0,'priority':_0x36a86e[_0xfcb1('0xa6')][_0xfcb1('0x49')]+0x1,'app':_0xfcb1('0xa7'),'appdata':_0xfcb1('0xa8'),'interval':_0xfcb1('0xa9')});}_0x36a86e[_0xfcb1('0xaa')][_0xfcb1('0xab')]=!![];}return db[_0xfcb1('0x86')][_0xfcb1('0x56')]({'phone':_0x36a86e['body'][_0xfcb1('0x93')],'messageId':_0x36a86e[_0xfcb1('0x57')][_0xfcb1('0x97')],'body':_0x36a86e[_0xfcb1('0x57')]['body'],'WhatsappAccountId':_0xa4b4c['params']['id'],'WhatsappInteractionId':_0x1820a9['id'],'direction':'in','ContactId':_0x1820a9['ContactId'],'AttachmentId':_0x36a86e[_0xfcb1('0x57')][_0xfcb1('0xac')]});})[_0xfcb1('0x37')](function(_0x310dc1){_0x36a86e[_0xfcb1('0x29')]=_0x310dc1;if(_0x36a86e[_0xfcb1('0xaa')][_0xfcb1('0xad')]){return db[_0xfcb1('0xae')][_0xfcb1('0x55')]({'attributes':['id','name'],'where':{'id':_0x36a86e[_0xfcb1('0xaa')][_0xfcb1('0xad')]}})[_0xfcb1('0x37')](function(_0x292f59){if(_0x292f59){_0x36a86e['applications'][_0xfcb1('0xaf')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x292f59['name']+','+(_0x36a86e[_0xfcb1('0x82')][_0xfcb1('0xb0')]||0xa),'interval':_0xfcb1('0xa9')});}return respondWithRpcPromise(_0xfcb1('0xb1'),_0xfcb1('0xb2'),_0x36a86e);});}return respondWithRpcPromise(_0xfcb1('0xb1'),_0xfcb1('0xb2'),_0x36a86e);})[_0xfcb1('0x37')](function(_0x11cf1a){if(_0x11cf1a){var _0x60e957=0xc8;var _0x282734=_0xfcb1('0xb3');logger[_0xfcb1('0x22')](_0xfcb1('0x25'),_0x282734,_0x60e957,_0xfcb1('0xb4'));logger[_0xfcb1('0x24')](_0xfcb1('0xb5'),_0x282734,_0x60e957,_0xfcb1('0xb4'),JSON['stringify'](_0x11cf1a));if(_0x36a86e[_0xfcb1('0x82')][_0xfcb1('0x3f')]===_0xfcb1('0x92')){return _0x1edda7[_0xfcb1('0x2d')](_0x60e957)[_0xfcb1('0x32')](_0xfcb1('0xb6'),_0xfcb1('0xb7'))[_0xfcb1('0x7e')]('\x0a');}else{return _0x1edda7[_0xfcb1('0x2d')](_0x60e957)[_0xfcb1('0x34')](_0x11cf1a);}}});})[_0xfcb1('0x2b')](handleError(_0x1edda7,null));};exports['send']=function(_0x45df01,_0x2d23eb,_0x47b32b){var _0x3f8b92,_0x46b123,_0x3ea2f0;if(_[_0xfcb1('0x9b')](_0x45df01['body'][_0xfcb1('0x57')])||_0x45df01['body'][_0xfcb1('0x57')]===''){throw new db[(_0xfcb1('0x8a'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfcb1('0x9b')](_0x45df01[_0xfcb1('0x57')]['to'])){throw new db[(_0xfcb1('0x8a'))][(_0xfcb1('0x9c'))](_0xfcb1('0xb8'));}_0x3f8b92=_0x45df01[_0xfcb1('0x57')]['to'];return db[_0xfcb1('0x54')]['find']({'where':{'id':_0x45df01[_0xfcb1('0x52')]['id']},'include':[{'model':db[_0xfcb1('0xb9')],'as':_0xfcb1('0xba'),'include':[{'model':db[_0xfcb1('0x89')],'as':_0xfcb1('0xa1'),'where':{'mobile':_0x3f8b92},'limit':0x1,'order':[[_0xfcb1('0x8d'),_0xfcb1('0xa2')]]}]}]})[_0xfcb1('0x37')](handleEntityNotFound(_0x2d23eb,null))['then'](function(_0x1efa52){if(_0x1efa52&&_0x1efa52[_0xfcb1('0xba')]){_0x46b123=_0x1efa52['get']({'plain':!![]});if(_0x46b123[_0xfcb1('0xba')]&&_0x46b123[_0xfcb1('0xba')]['Contacts'][_0xfcb1('0x49')]){return _0x46b123[_0xfcb1('0xba')][_0xfcb1('0xa1')][0x0];}return db['CmContact']['create'](_[_0xfcb1('0x1b')](_0x45df01['body'],{'firstName':_0x3f8b92,'mobile':_0x3f8b92,'phone':_0x3f8b92,'ListId':_0x46b123['ListId']}));}})[_0xfcb1('0x37')](handleEntityNotFound(_0x2d23eb,null))[_0xfcb1('0x37')](function(_0x4cc8cf){if(_0x4cc8cf){_0x3ea2f0=_0x4cc8cf;return db[_0xfcb1('0xa4')][_0xfcb1('0x55')]({'where':{'ContactId':_0x3ea2f0['id'],'closed':![],'WhatsappAccountId':_0x46b123['id']}})[_0xfcb1('0x37')](function(_0x3879d8){if(_0x3879d8){return[_0x3879d8,![]];}return db[_0xfcb1('0xa4')][_0xfcb1('0x56')]({'UserId':_0x45df01[_0xfcb1('0xbb')]['id'],'ContactId':_0x3ea2f0['id'],'WhatsappAccountId':_0x46b123['id'],'phone':_0x3f8b92,'firstMsgDirection':_0xfcb1('0xbc'),'Messages':[_[_0xfcb1('0x4d')](_0x45df01[_0xfcb1('0x57')],{'read':![],'body':_0x45df01['body'][_0xfcb1('0x57')],'phone':_0x3f8b92,'WhatsappAccountId':_0x46b123['id'],'UserId':_0x45df01[_0xfcb1('0xbb')]['id'],'ContactId':_0x3ea2f0['id']})]},{'include':[{'model':db[_0xfcb1('0x86')],'as':_0xfcb1('0xbd')}]})[_0xfcb1('0x37')](function(_0x2e5c3a){return[_0x2e5c3a,!![]];});});}})['spread'](function(_0x4b3627,_0x5c1268){if(_0x5c1268){return _0x4b3627;}return db['WhatsappMessage'][_0xfcb1('0x56')](_[_0xfcb1('0x4d')](_0x45df01[_0xfcb1('0x57')],{'read':![],'body':_0x45df01[_0xfcb1('0x57')][_0xfcb1('0x57')],'phone':_0x3f8b92,'WhatsappAccountId':_0x46b123['id'],'WhatsappInteractionId':_0x4b3627['id'],'UserId':_0x45df01[_0xfcb1('0xbb')]['id'],'ContactId':_0x3ea2f0['id']}))[_0xfcb1('0x37')](function(_0x5de6f8){_0x4b3627[_0xfcb1('0xbe')][_0xfcb1('0xbd')]=[];_0x4b3627[_0xfcb1('0xbe')]['Messages'][_0xfcb1('0xbf')](_0x5de6f8[_0xfcb1('0xbe')]);return _0x4b3627;});})[_0xfcb1('0x37')](respondWithResult(_0x2d23eb,null))[_0xfcb1('0x2b')](handleError(_0x2d23eb,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 5ec33ee..a71e1b0 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 _0x750d=['emit','hasOwnProperty','hook','exports','events','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x5a6f19,_0x57e685){var _0x2e0c6e=function(_0x903cf1){while(--_0x903cf1){_0x5a6f19['push'](_0x5a6f19['shift']());}};_0x2e0c6e(++_0x57e685);}(_0x750d,0x112));var _0xd750=function(_0x18b7c6,_0x510bee){_0x18b7c6=_0x18b7c6-0x0;var _0x1d8d79=_0x750d[_0x18b7c6];return _0x1d8d79;};'use strict';var EventEmitter=require(_0xd750('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xd750('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xd750('0x2')](0x0);var events={'afterCreate':_0xd750('0x3'),'afterUpdate':_0xd750('0x4'),'afterDestroy':_0xd750('0x5')};function emitEvent(_0x28ad5d){return function(_0x18cd56,_0x294478,_0xd9cbac){WhatsappAccountEvents[_0xd750('0x6')](_0x28ad5d+':'+_0x18cd56['id'],_0x18cd56);WhatsappAccountEvents['emit'](_0x28ad5d,_0x18cd56);_0xd9cbac(null);};}for(var e in events){if(events[_0xd750('0x7')](e)){var event=events[e];WhatsappAccount[_0xd750('0x8')](e,emitEvent(event));}}module[_0xd750('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x1dfb=['hasOwnProperty','hook','events','../../mysqldb','WhatsappAccount','save','update','emit'];(function(_0xa4928c,_0x16b89c){var _0x27cc29=function(_0x14b819){while(--_0x14b819){_0xa4928c['push'](_0xa4928c['shift']());}};_0x27cc29(++_0x16b89c);}(_0x1dfb,0xb2));var _0xb1df=function(_0x570f7b,_0x2c090d){_0x570f7b=_0x570f7b-0x0;var _0x381766=_0x1dfb[_0x570f7b];return _0x381766;};'use strict';var EventEmitter=require(_0xb1df('0x0'));var WhatsappAccount=require(_0xb1df('0x1'))['db'][_0xb1df('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb1df('0x3'),'afterUpdate':_0xb1df('0x4'),'afterDestroy':'remove'};function emitEvent(_0x324624){return function(_0x42b996,_0x40dd75,_0x438e16){WhatsappAccountEvents[_0xb1df('0x5')](_0x324624+':'+_0x42b996['id'],_0x42b996);WhatsappAccountEvents[_0xb1df('0x5')](_0x324624,_0x42b996);_0x438e16(null);};}for(var e in events){if(events[_0xb1df('0x6')](e)){var event=events[e];WhatsappAccount[_0xb1df('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index bcf7761..880b8e0 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 _0x406c=['util','api','bluebird','path','rimraf','./whatsappAccount.attributes','exports','define','whatsapp_accounts','lodash'];(function(_0x358881,_0x1b748c){var _0x76792d=function(_0x322bb8){while(--_0x322bb8){_0x358881['push'](_0x358881['shift']());}};_0x76792d(++_0x1b748c);}(_0x406c,0xdb));var _0xc406=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x406c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc406('0x0'));var util=require(_0xc406('0x1'));var logger=require('../../config/logger')(_0xc406('0x2'));var moment=require('moment');var BPromise=require(_0xc406('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc406('0x4'));var rimraf=require(_0xc406('0x5'));var config=require('../../config/environment');var attributes=require(_0xc406('0x6'));module[_0xc406('0x7')]=function(_0x196960,_0x17776c){return _0x196960[_0xc406('0x8')]('WhatsappAccount',attributes,{'tableName':_0xc406('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74a4=['define','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports'];(function(_0x28c095,_0x1c2efe){var _0x283f4c=function(_0x20ffdd){while(--_0x20ffdd){_0x28c095['push'](_0x28c095['shift']());}};_0x283f4c(++_0x1c2efe);}(_0x74a4,0x182));var _0x474a=function(_0x4fe652,_0x4a11cd){_0x4fe652=_0x4fe652-0x0;var _0x3fd042=_0x74a4[_0x4fe652];return _0x3fd042;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x474a('0x0'))(_0x474a('0x1'));var moment=require(_0x474a('0x2'));var BPromise=require(_0x474a('0x3'));var rp=require(_0x474a('0x4'));var fs=require('fs');var path=require(_0x474a('0x5'));var rimraf=require(_0x474a('0x6'));var config=require(_0x474a('0x7'));var attributes=require(_0x474a('0x8'));module[_0x474a('0x9')]=function(_0x4be35d,_0x1d90c4){return _0x4be35d[_0x474a('0xa')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 9565225..26d251b 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 _0x992c=['attributes','include','model','map','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x992c,0x163));var _0xc992=function(_0x5bdccd,_0x158276){_0x5bdccd=_0x5bdccd-0x0;var _0x507a81=_0x992c[_0x5bdccd];return _0x507a81;};'use strict';var _=require(_0xc992('0x0'));var util=require(_0xc992('0x1'));var moment=require(_0xc992('0x2'));var BPromise=require(_0xc992('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc992('0x4'))['db'];var utils=require(_0xc992('0x5'));var logger=require(_0xc992('0x6'))(_0xc992('0x7'));var config=require('../../config/environment');var jayson=require(_0xc992('0x8'));var client=jayson[_0xc992('0x9')]['http']({'port':0x232a});config[_0xc992('0xa')]=_[_0xc992('0xb')](config[_0xc992('0xa')],{'host':_0xc992('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')[_0xc992('0xd')](socket);function respondWithRpcPromise(_0x2cff29,_0x3259e2,_0x4b67c1){return new BPromise(function(_0xfe94ee,_0x3817ad){return client[_0xc992('0xe')](_0x2cff29,_0x4b67c1)[_0xc992('0xf')](function(_0x142571){logger[_0xc992('0x10')](_0xc992('0x11'),_0x3259e2,_0xc992('0x12'));logger[_0xc992('0x13')](_0xc992('0x14'),_0x3259e2,'request\x20sent',JSON['stringify'](_0x142571));if(_0x142571[_0xc992('0x15')]){if(_0x142571['error'][_0xc992('0x16')]===0x1f4){logger['error'](_0xc992('0x11'),_0x3259e2,_0x142571[_0xc992('0x15')]['message']);return _0x3817ad(_0x142571[_0xc992('0x15')][_0xc992('0x17')]);}logger[_0xc992('0x15')](_0xc992('0x11'),_0x3259e2,_0x142571['error'][_0xc992('0x17')]);return _0xfe94ee(_0x142571['error'][_0xc992('0x17')]);}else{logger['info'](_0xc992('0x11'),_0x3259e2,'request\x20sent');_0xfe94ee(_0x142571['result'][_0xc992('0x17')]);}})[_0xc992('0x18')](function(_0x4c0523){logger[_0xc992('0x15')](_0xc992('0x11'),_0x3259e2,_0x4c0523);_0x3817ad(_0x4c0523);});});}exports[_0xc992('0x19')]=function(_0xc6fafc){var _0x56cfa6=this;return new Promise(function(_0xeae773,_0x12b081){return db[_0xc992('0x1a')][_0xc992('0x1b')]({'raw':_0xc6fafc[_0xc992('0x1c')]?_0xc6fafc['options']['raw']===undefined?!![]:![]:!![],'where':_0xc6fafc[_0xc992('0x1c')]?_0xc6fafc[_0xc992('0x1c')][_0xc992('0x1d')]||null:null,'attributes':_0xc6fafc[_0xc992('0x1c')]?_0xc6fafc[_0xc992('0x1c')][_0xc992('0x1e')]||null:null,'include':_0xc6fafc['options']?_0xc6fafc[_0xc992('0x1c')][_0xc992('0x1f')]?_['map'](_0xc6fafc[_0xc992('0x1c')][_0xc992('0x1f')],function(_0x5bbee6){return{'model':db[_0x5bbee6[_0xc992('0x20')]],'as':_0x5bbee6['as'],'attributes':_0x5bbee6['attributes'],'include':_0x5bbee6[_0xc992('0x1f')]?_['map'](_0x5bbee6[_0xc992('0x1f')],function(_0x177d27){return{'model':db[_0x177d27[_0xc992('0x20')]],'as':_0x177d27['as'],'attributes':_0x177d27[_0xc992('0x1e')],'include':_0x177d27['include']?_[_0xc992('0x21')](_0x177d27[_0xc992('0x1f')],function(_0x253140){return{'model':db[_0x253140[_0xc992('0x20')]],'as':_0x253140['as'],'attributes':_0x253140['attributes']};}):[]};}):[]};}):[]:[]})[_0xc992('0xf')](function(_0x3891e4){logger[_0xc992('0x10')](_0xc992('0x19'),_0xc6fafc);logger[_0xc992('0x13')](_0xc992('0x19'),_0xc6fafc,JSON[_0xc992('0x22')](_0x3891e4));_0xeae773(_0x3891e4);})[_0xc992('0x18')](function(_0x3a543d){logger['error']('ShowWhatsappAccount',_0x3a543d['message'],_0xc6fafc);_0x12b081(_0x56cfa6[_0xc992('0x15')](0x1f4,_0x3a543d[_0xc992('0x17')]));});});}; \ No newline at end of file +var _0xbdcf=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','WhatsappAccount','find','options','raw','where','include','map','model','attributes','ShowWhatsappAccount','debug'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xbdcf,0x173));var _0xfbdc=function(_0x3e8ab0,_0x5c01d0){_0x3e8ab0=_0x3e8ab0-0x0;var _0x2ab416=_0xbdcf[_0x3e8ab0];return _0x2ab416;};'use strict';var _=require(_0xfbdc('0x0'));var util=require('util');var moment=require(_0xfbdc('0x1'));var BPromise=require(_0xfbdc('0x2'));var rs=require(_0xfbdc('0x3'));var fs=require('fs');var Redis=require(_0xfbdc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbdc('0x5'));var logger=require('../../config/logger')(_0xfbdc('0x6'));var config=require('../../config/environment');var jayson=require(_0xfbdc('0x7'));var client=jayson[_0xfbdc('0x8')]['http']({'port':0x232a});config[_0xfbdc('0x9')]=_['defaults'](config['redis'],{'host':_0xfbdc('0xa'),'port':0x18eb});var socket=require(_0xfbdc('0xb'))(new Redis(config[_0xfbdc('0x9')]));require(_0xfbdc('0xc'))[_0xfbdc('0xd')](socket);function respondWithRpcPromise(_0x412207,_0x339429,_0x585a88){return new BPromise(function(_0x104d7f,_0x119d60){return client[_0xfbdc('0xe')](_0x412207,_0x585a88)[_0xfbdc('0xf')](function(_0x20cabf){logger[_0xfbdc('0x10')](_0xfbdc('0x11'),_0x339429,_0xfbdc('0x12'));logger['debug'](_0xfbdc('0x13'),_0x339429,_0xfbdc('0x12'),JSON[_0xfbdc('0x14')](_0x20cabf));if(_0x20cabf[_0xfbdc('0x15')]){if(_0x20cabf[_0xfbdc('0x15')][_0xfbdc('0x16')]===0x1f4){logger[_0xfbdc('0x15')](_0xfbdc('0x11'),_0x339429,_0x20cabf['error']['message']);return _0x119d60(_0x20cabf[_0xfbdc('0x15')][_0xfbdc('0x17')]);}logger[_0xfbdc('0x15')](_0xfbdc('0x11'),_0x339429,_0x20cabf[_0xfbdc('0x15')][_0xfbdc('0x17')]);return _0x104d7f(_0x20cabf[_0xfbdc('0x15')][_0xfbdc('0x17')]);}else{logger[_0xfbdc('0x10')](_0xfbdc('0x11'),_0x339429,_0xfbdc('0x12'));_0x104d7f(_0x20cabf[_0xfbdc('0x18')]['message']);}})['catch'](function(_0x56e226){logger[_0xfbdc('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x339429,_0x56e226);_0x119d60(_0x56e226);});});}exports['ShowWhatsappAccount']=function(_0x1554d6){var _0x2da50b=this;return new Promise(function(_0x593a30,_0xc26c0a){return db[_0xfbdc('0x19')][_0xfbdc('0x1a')]({'raw':_0x1554d6[_0xfbdc('0x1b')]?_0x1554d6[_0xfbdc('0x1b')][_0xfbdc('0x1c')]===undefined?!![]:![]:!![],'where':_0x1554d6[_0xfbdc('0x1b')]?_0x1554d6[_0xfbdc('0x1b')][_0xfbdc('0x1d')]||null:null,'attributes':_0x1554d6[_0xfbdc('0x1b')]?_0x1554d6[_0xfbdc('0x1b')]['attributes']||null:null,'include':_0x1554d6[_0xfbdc('0x1b')]?_0x1554d6[_0xfbdc('0x1b')][_0xfbdc('0x1e')]?_[_0xfbdc('0x1f')](_0x1554d6[_0xfbdc('0x1b')][_0xfbdc('0x1e')],function(_0x3c5a4f){return{'model':db[_0x3c5a4f[_0xfbdc('0x20')]],'as':_0x3c5a4f['as'],'attributes':_0x3c5a4f[_0xfbdc('0x21')],'include':_0x3c5a4f['include']?_[_0xfbdc('0x1f')](_0x3c5a4f[_0xfbdc('0x1e')],function(_0x1a53d8){return{'model':db[_0x1a53d8[_0xfbdc('0x20')]],'as':_0x1a53d8['as'],'attributes':_0x1a53d8[_0xfbdc('0x21')],'include':_0x1a53d8[_0xfbdc('0x1e')]?_[_0xfbdc('0x1f')](_0x1a53d8['include'],function(_0x4e39fe){return{'model':db[_0x4e39fe[_0xfbdc('0x20')]],'as':_0x4e39fe['as'],'attributes':_0x4e39fe[_0xfbdc('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c30c2){logger[_0xfbdc('0x10')](_0xfbdc('0x22'),_0x1554d6);logger[_0xfbdc('0x23')](_0xfbdc('0x22'),_0x1554d6,JSON[_0xfbdc('0x14')](_0x3c30c2));_0x593a30(_0x3c30c2);})[_0xfbdc('0x24')](function(_0x4dca7c){logger[_0xfbdc('0x15')](_0xfbdc('0x22'),_0x4dca7c[_0xfbdc('0x17')],_0x1554d6);_0xc26c0a(_0x2da50b[_0xfbdc('0x15')](0x1f4,_0x4dca7c[_0xfbdc('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index d08aaa7..0f2f323 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 _0xe890=['length','whatsappAccount:','./whatsappAccount.events','remove','update','emit','register'];(function(_0x3d3980,_0x156a0e){var _0x3ccbca=function(_0x45bfb6){while(--_0x45bfb6){_0x3d3980['push'](_0x3d3980['shift']());}};_0x3ccbca(++_0x156a0e);}(_0xe890,0xa3));var _0x0e89=function(_0x6df818,_0x1ea7d8){_0x6df818=_0x6df818-0x0;var _0x5e20b9=_0xe890[_0x6df818];return _0x5e20b9;};'use strict';var WhatsappAccountEvents=require(_0x0e89('0x0'));var events=['save',_0x0e89('0x1'),_0x0e89('0x2')];function createListener(_0x2852ba,_0x52d959){return function(_0x46974a){_0x52d959[_0x0e89('0x3')](_0x2852ba,_0x46974a);};}function removeListener(_0xb15c2e,_0x346068){return function(){WhatsappAccountEvents['removeListener'](_0xb15c2e,_0x346068);};}exports[_0x0e89('0x4')]=function(_0x496028){for(var _0x5c0873=0x0,_0x44f881=events[_0x0e89('0x5')];_0x5c0873<_0x44f881;_0x5c0873++){var _0x403725=events[_0x5c0873];var _0x3cefff=createListener(_0x0e89('0x6')+_0x403725,_0x496028);WhatsappAccountEvents['on'](_0x403725,_0x3cefff);}}; \ No newline at end of file +var _0x613b=['whatsappAccount:','save','remove','update','emit','register','length'];(function(_0x11cc28,_0x4a44f1){var _0x51b66d=function(_0x5b9365){while(--_0x5b9365){_0x11cc28['push'](_0x11cc28['shift']());}};_0x51b66d(++_0x4a44f1);}(_0x613b,0x14a));var _0xb613=function(_0x140474,_0x3615b4){_0x140474=_0x140474-0x0;var _0xe549ff=_0x613b[_0x140474];return _0xe549ff;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xb613('0x0'),_0xb613('0x1'),_0xb613('0x2')];function createListener(_0x2efdaf,_0x5dbcbd){return function(_0x294fc6){_0x5dbcbd[_0xb613('0x3')](_0x2efdaf,_0x294fc6);};}function removeListener(_0x1fb43e,_0xc0e15a){return function(){WhatsappAccountEvents['removeListener'](_0x1fb43e,_0xc0e15a);};}exports[_0xb613('0x4')]=function(_0x380e8d){for(var _0x23a52e=0x0,_0x2799a4=events[_0xb613('0x5')];_0x23a52e<_0x2799a4;_0x23a52e++){var _0x35e8b3=events[_0x23a52e];var _0x1a245f=createListener(_0xb613('0x6')+_0x35e8b3,_0x380e8d);WhatsappAccountEvents['on'](_0x35e8b3,_0x1a245f);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 670ae5d..f94be71 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 _0xaf5c=['get','index','/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x55969b,_0x1ebe62){var _0x3d7fc1=function(_0x5f2dbe){while(--_0x5f2dbe){_0x55969b['push'](_0x55969b['shift']());}};_0x3d7fc1(++_0x1ebe62);}(_0xaf5c,0x13d));var _0xcaf5=function(_0x475aea,_0x428d3f){_0x475aea=_0x475aea-0x0;var _0x3d428c=_0xaf5c[_0x475aea];return _0x3d428c;};'use strict';var multer=require(_0xcaf5('0x0'));var util=require('util');var path=require(_0xcaf5('0x1'));var timeout=require('connect-timeout');var express=require(_0xcaf5('0x2'));var router=express[_0xcaf5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcaf5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcaf5('0x5'));var controller=require('./whatsappApplication.controller');router[_0xcaf5('0x6')]('/',auth['isAuthenticated'](),controller[_0xcaf5('0x7')]);router['get'](_0xcaf5('0x8'),auth['isAuthenticated'](),controller[_0xcaf5('0x9')]);router[_0xcaf5('0xa')]('/',auth[_0xcaf5('0xb')](),controller[_0xcaf5('0xc')]);router[_0xcaf5('0xd')](_0xcaf5('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xcaf5('0xe')](_0xcaf5('0x8'),auth[_0xcaf5('0xb')](),controller[_0xcaf5('0xf')]);module[_0xcaf5('0x10')]=router; \ No newline at end of file +var _0xfe88=['../../config/environment','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2c7a4d,_0x5d2de8){var _0x296ea9=function(_0x495721){while(--_0x495721){_0x2c7a4d['push'](_0x2c7a4d['shift']());}};_0x296ea9(++_0x5d2de8);}(_0xfe88,0x115));var _0x8fe8=function(_0x9a138c,_0x2607f8){_0x9a138c=_0x9a138c-0x0;var _0x3771a3=_0xfe88[_0x9a138c];return _0x3771a3;};'use strict';var multer=require(_0x8fe8('0x0'));var util=require(_0x8fe8('0x1'));var path=require('path');var timeout=require(_0x8fe8('0x2'));var express=require(_0x8fe8('0x3'));var router=express[_0x8fe8('0x4')]();var fs_extra=require(_0x8fe8('0x5'));var auth=require(_0x8fe8('0x6'));var interaction=require(_0x8fe8('0x7'));var config=require(_0x8fe8('0x8'));var controller=require('./whatsappApplication.controller');router[_0x8fe8('0x9')]('/',auth[_0x8fe8('0xa')](),controller[_0x8fe8('0xb')]);router[_0x8fe8('0x9')]('/:id',auth[_0x8fe8('0xa')](),controller[_0x8fe8('0xc')]);router[_0x8fe8('0xd')]('/',auth[_0x8fe8('0xa')](),controller[_0x8fe8('0xe')]);router['put'](_0x8fe8('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x8fe8('0x10')](_0x8fe8('0xf'),auth[_0x8fe8('0xa')](),controller[_0x8fe8('0x11')]);module[_0x8fe8('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 2ceb2e1..ddf226c 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 _0x253f=['noop','TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1e5a59,_0x22d345){var _0x4ca834=function(_0x2b2968){while(--_0x2b2968){_0x1e5a59['push'](_0x1e5a59['shift']());}};_0x4ca834(++_0x22d345);}(_0x253f,0x1ee));var _0xf253=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x253f[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xf253('0x0'));module[_0xf253('0x1')]={'priority':{'type':Sequelize[_0xf253('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf253('0x3')},'appdata':{'type':Sequelize[_0xf253('0x4')]()},'description':{'type':Sequelize[_0xf253('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf253('0x6')}}; \ No newline at end of file +var _0x9fc0=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x54eb2a,_0x4f0699){var _0x1c691f=function(_0x4a2816){while(--_0x4a2816){_0x54eb2a['push'](_0x54eb2a['shift']());}};_0x1c691f(++_0x4f0699);}(_0x9fc0,0x1cb));var _0x09fc=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x9fc0[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0x09fc('0x0'));module[_0x09fc('0x1')]={'priority':{'type':Sequelize[_0x09fc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x09fc('0x3')],'allowNull':![],'defaultValue':_0x09fc('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x09fc('0x3')],'defaultValue':_0x09fc('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 5380614..77b21a0 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 _0xf970=['order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','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','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x4cd644,_0x12d71a){var _0x497071=function(_0x49f665){while(--_0x49f665){_0x4cd644['push'](_0x4cd644['shift']());}};_0x497071(++_0x12d71a);}(_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'];function respondWithStatusCode(_0x38ae73,_0x4934af){_0x4934af=_0x4934af||0xcc;return function(_0x56d310){if(_0x56d310){return _0x38ae73[_0x0f97('0x1a')](_0x4934af);}return _0x38ae73[_0x0f97('0x1b')](_0x4934af)[_0x0f97('0x1c')]();};}function respondWithResult(_0x2aeeed,_0x300f29){_0x300f29=_0x300f29||0xc8;return function(_0x424c47){if(_0x424c47){return _0x2aeeed['status'](_0x300f29)['json'](_0x424c47);}};}function respondWithFilteredResult(_0x2a1fb8,_0x2392c0){return function(_0x1448f9){if(_0x1448f9){var _0xe92b09=typeof _0x2392c0['offset']==='undefined'&&typeof _0x2392c0[_0x0f97('0x1d')]===_0x0f97('0x1e');var _0x3edaf7=_0x1448f9[_0x0f97('0x1f')];var _0xae246=_0xe92b09?0x0:_0x2392c0[_0x0f97('0x20')];var _0x5059ad=_0xe92b09?_0x1448f9['count']:_0x2392c0[_0x0f97('0x20')]+_0x2392c0[_0x0f97('0x1d')];var _0x3b547f;if(_0x5059ad>=_0x3edaf7){_0x5059ad=_0x3edaf7;_0x3b547f=0xc8;}else{_0x3b547f=0xce;}_0x2a1fb8[_0x0f97('0x1b')](_0x3b547f);return _0x2a1fb8[_0x0f97('0x21')](_0x0f97('0x22'),_0xae246+'-'+_0x5059ad+'/'+_0x3edaf7)['json'](_0x1448f9);}return null;};}function patchUpdates(_0x27b771){return function(_0x15a1ef){try{jsonpatch[_0x0f97('0x23')](_0x15a1ef,_0x27b771,!![]);}catch(_0x15376e){return BPromise[_0x0f97('0x24')](_0x15376e);}return _0x15a1ef[_0x0f97('0x25')]();};}function saveUpdates(_0x21784d,_0x52dde8){return function(_0x2977fa){if(_0x2977fa){return _0x2977fa[_0x0f97('0x26')](_0x21784d)[_0x0f97('0x27')](function(_0x5c2af0){return _0x5c2af0;});}return null;};}function removeEntity(_0x31d384,_0x25d1ef){return function(_0x4ec6d0){if(_0x4ec6d0){return _0x4ec6d0[_0x0f97('0x28')]()[_0x0f97('0x27')](function(){_0x31d384['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51aa82,_0x406e24){return function(_0x22eb53){if(!_0x22eb53){_0x51aa82['sendStatus'](0x194);}return _0x22eb53;};}function handleError(_0x8ef8c4,_0x42b385){_0x42b385=_0x42b385||0x1f4;return function(_0x30a715){logger[_0x0f97('0x29')](_0x30a715[_0x0f97('0x2a')]);if(_0x30a715[_0x0f97('0x2b')]){delete _0x30a715[_0x0f97('0x2b')];}_0x8ef8c4[_0x0f97('0x1b')](_0x42b385)[_0x0f97('0x2c')](_0x30a715);};}exports[_0x0f97('0x2d')]=function(_0x37d7c9,_0x4fe728){var _0x2f17ef={},_0x22cc9e={},_0x590f72={'count':0x0,'rows':[]};var _0x2c7f04=_[_0x0f97('0x2e')](db[_0x0f97('0x2f')][_0x0f97('0x30')],function(_0x28ba36){return{'name':_0x28ba36['fieldName'],'type':_0x28ba36['type'][_0x0f97('0x31')]};});_0x22cc9e[_0x0f97('0x32')]=_[_0x0f97('0x2e')](_0x2c7f04,_0x0f97('0x2b'));_0x22cc9e[_0x0f97('0x33')]=_[_0x0f97('0x34')](_0x37d7c9[_0x0f97('0x33')]);_0x22cc9e[_0x0f97('0x35')]=_[_0x0f97('0x36')](_0x22cc9e[_0x0f97('0x32')],_0x22cc9e[_0x0f97('0x33')]);_0x2f17ef['attributes']=_[_0x0f97('0x36')](_0x22cc9e[_0x0f97('0x32')],qs[_0x0f97('0x37')](_0x37d7c9[_0x0f97('0x33')][_0x0f97('0x37')]));_0x2f17ef['attributes']=_0x2f17ef[_0x0f97('0x38')]['length']?_0x2f17ef[_0x0f97('0x38')]:_0x22cc9e['model'];if(!_0x37d7c9[_0x0f97('0x33')][_0x0f97('0x39')](_0x0f97('0x3a'))){_0x2f17ef[_0x0f97('0x1d')]=qs[_0x0f97('0x1d')](_0x37d7c9['query']['limit']);_0x2f17ef[_0x0f97('0x20')]=qs[_0x0f97('0x20')](_0x37d7c9['query'][_0x0f97('0x20')]);}_0x2f17ef[_0x0f97('0x3b')]=qs[_0x0f97('0x3c')](_0x37d7c9[_0x0f97('0x33')]['sort']);_0x2f17ef[_0x0f97('0x3d')]=qs[_0x0f97('0x35')](_[_0x0f97('0x3e')](_0x37d7c9[_0x0f97('0x33')],_0x22cc9e[_0x0f97('0x35')]),_0x2c7f04);if(_0x37d7c9['query'][_0x0f97('0x3f')]){_0x2f17ef[_0x0f97('0x3d')]=_[_0x0f97('0x40')](_0x2f17ef[_0x0f97('0x3d')],{'$or':_[_0x0f97('0x2e')](_0x2c7f04,function(_0x244a03){if(_0x244a03['type']!=='VIRTUAL'){var _0x230ccf={};_0x230ccf[_0x244a03[_0x0f97('0x2b')]]={'$like':'%'+_0x37d7c9[_0x0f97('0x33')]['filter']+'%'};return _0x230ccf;}})});}_0x2f17ef=_[_0x0f97('0x40')]({},_0x2f17ef,_0x37d7c9[_0x0f97('0x41')]);var _0x1053cb={'where':_0x2f17ef['where']};return db[_0x0f97('0x2f')][_0x0f97('0x1f')](_0x1053cb)[_0x0f97('0x27')](function(_0x679aea){_0x590f72[_0x0f97('0x1f')]=_0x679aea;if(_0x37d7c9[_0x0f97('0x33')][_0x0f97('0x42')]){_0x2f17ef[_0x0f97('0x43')]=[{'all':!![]}];}return db[_0x0f97('0x2f')][_0x0f97('0x44')](_0x2f17ef);})[_0x0f97('0x27')](function(_0x5c1cd1){_0x590f72[_0x0f97('0x45')]=_0x5c1cd1;return _0x590f72;})[_0x0f97('0x27')](respondWithFilteredResult(_0x4fe728,_0x2f17ef))['catch'](handleError(_0x4fe728,null));};exports[_0x0f97('0x46')]=function(_0x57269c,_0x153777){var _0x51f2a={'raw':!![],'where':{'id':_0x57269c['params']['id']}},_0x3e14b1={};_0x3e14b1['model']=_[_0x0f97('0x34')](db[_0x0f97('0x2f')][_0x0f97('0x30')]);_0x3e14b1[_0x0f97('0x33')]=_[_0x0f97('0x34')](_0x57269c['query']);_0x3e14b1['filters']=_[_0x0f97('0x36')](_0x3e14b1[_0x0f97('0x32')],_0x3e14b1[_0x0f97('0x33')]);_0x51f2a[_0x0f97('0x38')]=_[_0x0f97('0x36')](_0x3e14b1[_0x0f97('0x32')],qs[_0x0f97('0x37')](_0x57269c[_0x0f97('0x33')][_0x0f97('0x37')]));_0x51f2a['attributes']=_0x51f2a[_0x0f97('0x38')]['length']?_0x51f2a[_0x0f97('0x38')]:_0x3e14b1[_0x0f97('0x32')];if(_0x57269c[_0x0f97('0x33')]['includeAll']){_0x51f2a['include']=[{'all':!![]}];}_0x51f2a=_[_0x0f97('0x40')]({},_0x51f2a,_0x57269c[_0x0f97('0x41')]);return db[_0x0f97('0x2f')]['find'](_0x51f2a)['then'](handleEntityNotFound(_0x153777,null))['then'](respondWithResult(_0x153777,null))[_0x0f97('0x47')](handleError(_0x153777,null));};exports[_0x0f97('0x48')]=function(_0x1871b6,_0xf95e68){return db[_0x0f97('0x2f')][_0x0f97('0x48')](_0x1871b6[_0x0f97('0x49')],{})[_0x0f97('0x27')](respondWithResult(_0xf95e68,0xc9))[_0x0f97('0x47')](handleError(_0xf95e68,null));};exports[_0x0f97('0x26')]=function(_0x55eba,_0x4c5d53){if(_0x55eba[_0x0f97('0x49')]['id']){delete _0x55eba['body']['id'];}return db['WhatsappApplication'][_0x0f97('0x4a')]({'where':{'id':_0x55eba['params']['id']}})[_0x0f97('0x27')](handleEntityNotFound(_0x4c5d53,null))[_0x0f97('0x27')](saveUpdates(_0x55eba[_0x0f97('0x49')],null))[_0x0f97('0x27')](respondWithResult(_0x4c5d53,null))[_0x0f97('0x47')](handleError(_0x4c5d53,null));};exports['destroy']=function(_0x497042,_0x1e0cc9){return db[_0x0f97('0x2f')]['find']({'where':{'id':_0x497042[_0x0f97('0x4b')]['id']}})[_0x0f97('0x27')](handleEntityNotFound(_0x1e0cc9,null))[_0x0f97('0x27')](removeEntity(_0x1e0cc9,null))[_0x0f97('0x47')](handleError(_0x1e0cc9,null));}; \ No newline at end of file +var _0x160c=['limit','set','apply','save','update','then','error','stack','name','send','index','map','type','key','model','query','filters','intersection','fields','attributes','length','sort','where','filter','merge','options','WhatsappApplication','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count'];(function(_0x2fa2b9,_0x496bca){var _0x574342=function(_0x48280b){while(--_0x48280b){_0x2fa2b9['push'](_0x2fa2b9['shift']());}};_0x574342(++_0x496bca);}(_0x160c,0x181));var _0xc160=function(_0x510f95,_0x1a4e5c){_0x510f95=_0x510f95-0x0;var _0x1df674=_0x160c[_0x510f95];return _0x1df674;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc160('0x0'));var zipdir=require(_0xc160('0x1'));var jsonpatch=require(_0xc160('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc160('0x3'));var util=require('util');var path=require(_0xc160('0x4'));var sox=require(_0xc160('0x5'));var csv=require(_0xc160('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc160('0x7'));var _=require('lodash');var squel=require(_0xc160('0x8'));var crypto=require('crypto');var jsforce=require(_0xc160('0x9'));var deskjs=require(_0xc160('0xa'));var toCsv=require('to-csv');var querystring=require(_0xc160('0xb'));var Papa=require(_0xc160('0xc'));var Redis=require('ioredis');var authService=require(_0xc160('0xd'));var qs=require(_0xc160('0xe'));var as=require(_0xc160('0xf'));var hardwareService=require(_0xc160('0x10'));var logger=require(_0xc160('0x11'))(_0xc160('0x12'));var utils=require(_0xc160('0x13'));var config=require(_0xc160('0x14'));var licenseUtil=require(_0xc160('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58f7be,_0x363817){_0x363817=_0x363817||0xcc;return function(_0x5946ab){if(_0x5946ab){return _0x58f7be[_0xc160('0x16')](_0x363817);}return _0x58f7be[_0xc160('0x17')](_0x363817)[_0xc160('0x18')]();};}function respondWithResult(_0x548660,_0x1c3110){_0x1c3110=_0x1c3110||0xc8;return function(_0x5e1aa7){if(_0x5e1aa7){return _0x548660[_0xc160('0x17')](_0x1c3110)[_0xc160('0x19')](_0x5e1aa7);}};}function respondWithFilteredResult(_0x4c7561,_0x382227){return function(_0x5eb209){if(_0x5eb209){var _0x35f233=typeof _0x382227[_0xc160('0x1a')]===_0xc160('0x1b')&&typeof _0x382227['limit']==='undefined';var _0x1c320d=_0x5eb209[_0xc160('0x1c')];var _0x6120d5=_0x35f233?0x0:_0x382227['offset'];var _0x3b7b55=_0x35f233?_0x5eb209[_0xc160('0x1c')]:_0x382227[_0xc160('0x1a')]+_0x382227[_0xc160('0x1d')];var _0x4cf313;if(_0x3b7b55>=_0x1c320d){_0x3b7b55=_0x1c320d;_0x4cf313=0xc8;}else{_0x4cf313=0xce;}_0x4c7561[_0xc160('0x17')](_0x4cf313);return _0x4c7561[_0xc160('0x1e')]('Content-Range',_0x6120d5+'-'+_0x3b7b55+'/'+_0x1c320d)[_0xc160('0x19')](_0x5eb209);}return null;};}function patchUpdates(_0x3544cb){return function(_0x714d70){try{jsonpatch[_0xc160('0x1f')](_0x714d70,_0x3544cb,!![]);}catch(_0x41bb1e){return BPromise['reject'](_0x41bb1e);}return _0x714d70[_0xc160('0x20')]();};}function saveUpdates(_0x25f5cf,_0x2c99b8){return function(_0x143c18){if(_0x143c18){return _0x143c18[_0xc160('0x21')](_0x25f5cf)[_0xc160('0x22')](function(_0x2804ad){return _0x2804ad;});}return null;};}function removeEntity(_0x11f8c8,_0x417ac1){return function(_0x432a48){if(_0x432a48){return _0x432a48['destroy']()['then'](function(){_0x11f8c8[_0xc160('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7d235e,_0x63d33d){return function(_0x2d5d3f){if(!_0x2d5d3f){_0x7d235e['sendStatus'](0x194);}return _0x2d5d3f;};}function handleError(_0x46e33f,_0xda5e6d){_0xda5e6d=_0xda5e6d||0x1f4;return function(_0x2542f1){logger[_0xc160('0x23')](_0x2542f1[_0xc160('0x24')]);if(_0x2542f1['name']){delete _0x2542f1[_0xc160('0x25')];}_0x46e33f[_0xc160('0x17')](_0xda5e6d)[_0xc160('0x26')](_0x2542f1);};}exports[_0xc160('0x27')]=function(_0xa10de0,_0x33a490){var _0x2e16ad={},_0x56a004={},_0xd1aab9={'count':0x0,'rows':[]};var _0x395857=_[_0xc160('0x28')](db['WhatsappApplication']['rawAttributes'],function(_0x44930d){return{'name':_0x44930d['fieldName'],'type':_0x44930d[_0xc160('0x29')][_0xc160('0x2a')]};});_0x56a004[_0xc160('0x2b')]=_['map'](_0x395857,'name');_0x56a004['query']=_['keys'](_0xa10de0[_0xc160('0x2c')]);_0x56a004[_0xc160('0x2d')]=_[_0xc160('0x2e')](_0x56a004['model'],_0x56a004[_0xc160('0x2c')]);_0x2e16ad['attributes']=_['intersection'](_0x56a004[_0xc160('0x2b')],qs[_0xc160('0x2f')](_0xa10de0['query'][_0xc160('0x2f')]));_0x2e16ad[_0xc160('0x30')]=_0x2e16ad[_0xc160('0x30')][_0xc160('0x31')]?_0x2e16ad[_0xc160('0x30')]:_0x56a004[_0xc160('0x2b')];if(!_0xa10de0[_0xc160('0x2c')]['hasOwnProperty']('nolimit')){_0x2e16ad[_0xc160('0x1d')]=qs['limit'](_0xa10de0[_0xc160('0x2c')][_0xc160('0x1d')]);_0x2e16ad[_0xc160('0x1a')]=qs[_0xc160('0x1a')](_0xa10de0[_0xc160('0x2c')]['offset']);}_0x2e16ad['order']=qs[_0xc160('0x32')](_0xa10de0[_0xc160('0x2c')][_0xc160('0x32')]);_0x2e16ad[_0xc160('0x33')]=qs['filters'](_['pick'](_0xa10de0['query'],_0x56a004[_0xc160('0x2d')]),_0x395857);if(_0xa10de0[_0xc160('0x2c')][_0xc160('0x34')]){_0x2e16ad[_0xc160('0x33')]=_['merge'](_0x2e16ad[_0xc160('0x33')],{'$or':_[_0xc160('0x28')](_0x395857,function(_0x503824){if(_0x503824[_0xc160('0x29')]!=='VIRTUAL'){var _0x1b6371={};_0x1b6371[_0x503824['name']]={'$like':'%'+_0xa10de0[_0xc160('0x2c')][_0xc160('0x34')]+'%'};return _0x1b6371;}})});}_0x2e16ad=_[_0xc160('0x35')]({},_0x2e16ad,_0xa10de0[_0xc160('0x36')]);var _0xa11aab={'where':_0x2e16ad['where']};return db[_0xc160('0x37')][_0xc160('0x1c')](_0xa11aab)[_0xc160('0x22')](function(_0x38fb34){_0xd1aab9[_0xc160('0x1c')]=_0x38fb34;if(_0xa10de0[_0xc160('0x2c')][_0xc160('0x38')]){_0x2e16ad[_0xc160('0x39')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xc160('0x3a')](_0x2e16ad);})[_0xc160('0x22')](function(_0x5c3c26){_0xd1aab9[_0xc160('0x3b')]=_0x5c3c26;return _0xd1aab9;})[_0xc160('0x22')](respondWithFilteredResult(_0x33a490,_0x2e16ad))[_0xc160('0x3c')](handleError(_0x33a490,null));};exports[_0xc160('0x3d')]=function(_0x38387f,_0x22bcbc){var _0x2b8727={'raw':!![],'where':{'id':_0x38387f[_0xc160('0x3e')]['id']}},_0x499d70={};_0x499d70[_0xc160('0x2b')]=_[_0xc160('0x3f')](db[_0xc160('0x37')][_0xc160('0x40')]);_0x499d70['query']=_['keys'](_0x38387f[_0xc160('0x2c')]);_0x499d70[_0xc160('0x2d')]=_['intersection'](_0x499d70['model'],_0x499d70[_0xc160('0x2c')]);_0x2b8727[_0xc160('0x30')]=_['intersection'](_0x499d70[_0xc160('0x2b')],qs[_0xc160('0x2f')](_0x38387f[_0xc160('0x2c')][_0xc160('0x2f')]));_0x2b8727['attributes']=_0x2b8727[_0xc160('0x30')][_0xc160('0x31')]?_0x2b8727[_0xc160('0x30')]:_0x499d70[_0xc160('0x2b')];if(_0x38387f[_0xc160('0x2c')]['includeAll']){_0x2b8727['include']=[{'all':!![]}];}_0x2b8727=_[_0xc160('0x35')]({},_0x2b8727,_0x38387f[_0xc160('0x36')]);return db[_0xc160('0x37')][_0xc160('0x41')](_0x2b8727)[_0xc160('0x22')](handleEntityNotFound(_0x22bcbc,null))['then'](respondWithResult(_0x22bcbc,null))['catch'](handleError(_0x22bcbc,null));};exports[_0xc160('0x42')]=function(_0x38d6d9,_0x188b24){return db[_0xc160('0x37')][_0xc160('0x42')](_0x38d6d9[_0xc160('0x43')],{})[_0xc160('0x22')](respondWithResult(_0x188b24,0xc9))['catch'](handleError(_0x188b24,null));};exports[_0xc160('0x21')]=function(_0x3fa809,_0x254d3b){if(_0x3fa809[_0xc160('0x43')]['id']){delete _0x3fa809[_0xc160('0x43')]['id'];}return db['WhatsappApplication'][_0xc160('0x41')]({'where':{'id':_0x3fa809['params']['id']}})[_0xc160('0x22')](handleEntityNotFound(_0x254d3b,null))[_0xc160('0x22')](saveUpdates(_0x3fa809[_0xc160('0x43')],null))['then'](respondWithResult(_0x254d3b,null))['catch'](handleError(_0x254d3b,null));};exports[_0xc160('0x44')]=function(_0x2b1af5,_0x3be62e){return db[_0xc160('0x37')][_0xc160('0x41')]({'where':{'id':_0x2b1af5[_0xc160('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3be62e,null))[_0xc160('0x22')](removeEntity(_0x3be62e,null))[_0xc160('0x3c')](handleError(_0x3be62e,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 28edcf1..9defe07 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 _0xee24=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications'];(function(_0x35bbbe,_0x7e776b){var _0x632215=function(_0x42984d){while(--_0x42984d){_0x35bbbe['push'](_0x35bbbe['shift']());}};_0x632215(++_0x7e776b);}(_0xee24,0x1a6));var _0x4ee2=function(_0x170674,_0x236cfa){_0x170674=_0x170674-0x0;var _0x401fe8=_0xee24[_0x170674];return _0x401fe8;};'use strict';var _=require('lodash');var util=require(_0x4ee2('0x0'));var logger=require(_0x4ee2('0x1'))('api');var moment=require(_0x4ee2('0x2'));var BPromise=require(_0x4ee2('0x3'));var rp=require(_0x4ee2('0x4'));var fs=require('fs');var path=require(_0x4ee2('0x5'));var rimraf=require('rimraf');var config=require(_0x4ee2('0x6'));var attributes=require(_0x4ee2('0x7'));module[_0x4ee2('0x8')]=function(_0x1993de,_0x5c778f){return _0x1993de[_0x4ee2('0x9')](_0x4ee2('0xa'),attributes,{'tableName':_0x4ee2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4ee2('0xc'),'collate':_0x4ee2('0xd')});}; \ No newline at end of file +var _0xf3cd=['whatsapp_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','WhatsappApplication'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3fcfb6,_0x515024){_0x3fcfb6=_0x3fcfb6-0x0;var _0x3b99a7=_0xf3cd[_0x3fcfb6];return _0x3b99a7;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./whatsappApplication.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xdf3c('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 1bdf748..5b55b50 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 _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s'];(function(_0x3ff893,_0x53e2bd){var _0x246d70=function(_0x78da15){while(--_0x78da15){_0x3ff893['push'](_0x3ff893['shift']());}};_0x246d70(++_0x53e2bd);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x00bb[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file +var _0x9bde=['code','message','WhatsappApplication,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x229194,_0x26a0bd){var _0x3ca16f=function(_0x4587ac){while(--_0x4587ac){_0x229194['push'](_0x229194['shift']());}};_0x3ca16f(++_0x26a0bd);}(_0x9bde,0xe1));var _0xe9bd=function(_0x51cc3b,_0x381ebe){_0x51cc3b=_0x51cc3b-0x0;var _0x172b3e=_0x9bde[_0x51cc3b];return _0x172b3e;};'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')]('WhatsappApplication,\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')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('WhatsappApplication,\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')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 0fdb277..795a92e 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 _0x7409=['/:id','show','/:id/messages','isAuthenticated','download','post','/:id/tags','whatsapp','addTags','put','update','delete','tracked','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','describe'];(function(_0x3b5e78,_0x461dad){var _0x131622=function(_0x18e409){while(--_0x18e409){_0x3b5e78['push'](_0x3b5e78['shift']());}};_0x131622(++_0x461dad);}(_0x7409,0x6e));var _0x9740=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0x7409[_0x2a9f4];return _0x3c39e0;};'use strict';var multer=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var path=require('path');var timeout=require(_0x9740('0x2'));var express=require(_0x9740('0x3'));var router=express[_0x9740('0x4')]();var fs_extra=require(_0x9740('0x5'));var auth=require(_0x9740('0x6'));var interaction=require(_0x9740('0x7'));var config=require(_0x9740('0x8'));var controller=require(_0x9740('0x9'));router[_0x9740('0xa')]('/',auth['isAuthenticated'](),controller[_0x9740('0xb')]);router[_0x9740('0xa')](_0x9740('0xc'),auth['isAuthenticated'](),controller[_0x9740('0xd')]);router[_0x9740('0xa')](_0x9740('0xe'),auth['isAuthenticated'](),controller[_0x9740('0xf')]);router['get'](_0x9740('0x10'),auth[_0x9740('0x11')](),controller['getMessages']);router['get']('/:id/download',auth[_0x9740('0x11')](),controller[_0x9740('0x12')]);router[_0x9740('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x9740('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0x9740('0x15'),'whatsappinteraction:addtags'),controller[_0x9740('0x16')]);router[_0x9740('0x17')](_0x9740('0xe'),auth[_0x9740('0x11')](),interaction['tracked'](_0x9740('0x15'),'whatsappinteraction:update'),controller[_0x9740('0x18')]);router[_0x9740('0x19')](_0x9740('0xe'),auth[_0x9740('0x11')](),interaction[_0x9740('0x1a')](_0x9740('0x15'),_0x9740('0x1b')),controller[_0x9740('0x1c')]);router[_0x9740('0x19')]('/:id/tags',auth[_0x9740('0x11')](),controller[_0x9740('0x1d')]);module[_0x9740('0x1e')]=router; \ No newline at end of file +var _0xa630=['/:id/messages','getMessages','/:id/download','download','post','create','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','/:id/tags','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0xaedff8,_0x1e77bf){var _0xef9b78=function(_0xd3d2d1){while(--_0xd3d2d1){_0xaedff8['push'](_0xaedff8['shift']());}};_0xef9b78(++_0x1e77bf);}(_0xa630,0xbe));var _0x0a63=function(_0x377afc,_0x4d37ae){_0x377afc=_0x377afc-0x0;var _0x566664=_0xa630[_0x377afc];return _0x566664;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')]('/',auth[_0x0a63('0x8')](),controller['index']);router[_0x0a63('0x7')](_0x0a63('0x9'),auth[_0x0a63('0x8')](),controller[_0x0a63('0xa')]);router[_0x0a63('0x7')](_0x0a63('0xb'),auth['isAuthenticated'](),controller[_0x0a63('0xc')]);router[_0x0a63('0x7')](_0x0a63('0xd'),auth[_0x0a63('0x8')](),controller[_0x0a63('0xe')]);router[_0x0a63('0x7')](_0x0a63('0xf'),auth[_0x0a63('0x8')](),controller[_0x0a63('0x10')]);router[_0x0a63('0x11')]('/',auth['isAuthenticated'](),controller[_0x0a63('0x12')]);router[_0x0a63('0x11')](_0x0a63('0xd'),auth[_0x0a63('0x8')](),controller['addMessage']);router[_0x0a63('0x11')]('/:id/tags',auth[_0x0a63('0x8')](),interaction[_0x0a63('0x13')](_0x0a63('0x14'),_0x0a63('0x15')),controller[_0x0a63('0x16')]);router[_0x0a63('0x17')](_0x0a63('0xb'),auth[_0x0a63('0x8')](),interaction['tracked'](_0x0a63('0x14'),'whatsappinteraction:update'),controller[_0x0a63('0x18')]);router[_0x0a63('0x19')](_0x0a63('0xb'),auth[_0x0a63('0x8')](),interaction[_0x0a63('0x13')](_0x0a63('0x14'),_0x0a63('0x1a')),controller[_0x0a63('0x1b')]);router[_0x0a63('0x19')](_0x0a63('0x1c'),auth[_0x0a63('0x8')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index ac3ecb5..d675400 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 _0xd45e=['ENUM','out','moment','exports','DATE','STRING'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xd45e,0x182));var _0xed45=function(_0x395d7e,_0x271817){_0x395d7e=_0x395d7e-0x0;var _0x2a07ae=_0xd45e[_0x395d7e];return _0x2a07ae;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xed45('0x0'));module[_0xed45('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xed45('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xed45('0x3')]},'thirdDisposition':{'type':Sequelize[_0xed45('0x3')]},'note':{'type':Sequelize[_0xed45('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xed45('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xed45('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xed45('0x4')]('in',_0xed45('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x50d0=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x16e2c3,_0x1351b5){var _0x13da7f=function(_0x134f4b){while(--_0x134f4b){_0x16e2c3['push'](_0x16e2c3['shift']());}};_0x13da7f(++_0x1351b5);}(_0x50d0,0x101));var _0x050d=function(_0x5b15ae,_0xff5491){_0x5b15ae=_0x5b15ae-0x0;var _0x431a8a=_0x50d0[_0x5b15ae];return _0x431a8a;};'use strict';var Sequelize=require(_0x050d('0x0'));var moment=require('moment');module[_0x050d('0x1')]={'closed':{'type':Sequelize[_0x050d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x050d('0x3')]},'disposition':{'type':Sequelize[_0x050d('0x4')]},'secondDisposition':{'type':Sequelize[_0x050d('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x050d('0x4')]},'phone':{'type':Sequelize[_0x050d('0x4')]},'read1stAt':{'type':Sequelize[_0x050d('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x050d('0x5')]('in',_0x050d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x050d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x050d('0x5')]('in',_0x050d('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x050d('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 3061595..2079780 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 _0xe66b=['destroy','error','stack','name','send','map','WhatsappInteraction','fieldName','type','key','findAll','whatsapp','query','user','catch','show','params','model','keys','rawAttributes','intersection','attributes','fields','includeAll','include','merge','find','create','body','update','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','filters','pick','WhatsappInteractionId','filter','$gte','split','format','options','rows','addTags','setTags','spread','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','push','CmContact','Contact','firstName','lastName','Attachment','createdAt','secret','WhatsappAccount','Account','Owner','fullname','get','mkdirSync','Whatsapp','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','basename','pipe','createWriteStream','direction','out','System','read','renderFile','views','transcript-','.pdf','log','err','unlinkSync','sendStatus','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','offset','limit','undefined','count','set','Content-Range','then'];(function(_0x2abf59,_0x33a435){var _0x3bc8ce=function(_0x3bd6e8){while(--_0x3bd6e8){_0x2abf59['push'](_0x2abf59['shift']());}};_0x3bc8ce(++_0x33a435);}(_0xe66b,0x65));var _0xbe66=function(_0x25adbd,_0x4f612f){_0x25adbd=_0x25adbd-0x0;var _0x4abc82=_0xe66b[_0x25adbd];return _0x4abc82;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0xbe66('0x0'));var BPromise=require(_0xbe66('0x1'));var util=require(_0xbe66('0x2'));var path=require(_0xbe66('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbe66('0x4'));var Redis=require(_0xbe66('0x5'));var interaction=require(_0xbe66('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0xbe66('0x7'));var logger=require(_0xbe66('0x8'))(_0xbe66('0x9'));var config=require(_0xbe66('0xa'));var db=require(_0xbe66('0xb'))['db'];config[_0xbe66('0xc')]=_['defaults'](config[_0xbe66('0xc')],{'host':_0xbe66('0xd'),'port':0x18eb});var socket=require(_0xbe66('0xe'))(new Redis(config[_0xbe66('0xc')]));require('./whatsappInteraction.socket')[_0xbe66('0xf')](socket);function respondWithStatusCode(_0x5ccf4f,_0x1d971a){_0x1d971a=_0x1d971a||0xcc;return function(_0x53299d){if(_0x53299d){return _0x5ccf4f['sendStatus'](_0x1d971a);}return _0x5ccf4f[_0xbe66('0x10')](_0x1d971a)[_0xbe66('0x11')]();};}function respondWithResult(_0xfad110,_0xc9af3f){_0xc9af3f=_0xc9af3f||0xc8;return function(_0xb8dcd3){if(_0xb8dcd3){return _0xfad110[_0xbe66('0x10')](_0xc9af3f)[_0xbe66('0x12')](_0xb8dcd3);}};}function respondWithFilteredResult(_0x12382c,_0x57a4b7){return function(_0xf5b4d9){if(_0xf5b4d9){var _0x521afc=typeof _0x57a4b7[_0xbe66('0x13')]==='undefined'&&typeof _0x57a4b7[_0xbe66('0x14')]===_0xbe66('0x15');var _0x334ece=_0xf5b4d9[_0xbe66('0x16')];var _0xd35052=_0x521afc?0x0:_0x57a4b7[_0xbe66('0x13')];var _0x5e7f1f=_0x521afc?_0xf5b4d9[_0xbe66('0x16')]:_0x57a4b7[_0xbe66('0x13')]+_0x57a4b7[_0xbe66('0x14')];var _0x4a00e5;if(_0x5e7f1f>=_0x334ece){_0x5e7f1f=_0x334ece;_0x4a00e5=0xc8;}else{_0x4a00e5=0xce;}_0x12382c[_0xbe66('0x10')](_0x4a00e5);return _0x12382c[_0xbe66('0x17')](_0xbe66('0x18'),_0xd35052+'-'+_0x5e7f1f+'/'+_0x334ece)[_0xbe66('0x12')](_0xf5b4d9);}return null;};}function saveUpdates(_0x23bc5a){return function(_0x42f0b1){if(_0x42f0b1){return _0x42f0b1['update'](_0x23bc5a)[_0xbe66('0x19')](function(_0x2f7ffc){return _0x2f7ffc;});}return null;};}function removeEntity(_0x1c407b){return function(_0x97fb0){if(_0x97fb0){return _0x97fb0[_0xbe66('0x1a')]()[_0xbe66('0x19')](function(){_0x1c407b['status'](0xcc)[_0xbe66('0x11')]();});}};}function handleEntityNotFound(_0x57d136){return function(_0x1eae01){if(!_0x1eae01){_0x57d136['sendStatus'](0x194);}return _0x1eae01;};}function handleError(_0x260c9b,_0xc98735){_0xc98735=_0xc98735||0x1f4;return function(_0x16b295){logger[_0xbe66('0x1b')](_0x16b295[_0xbe66('0x1c')]);if(_0x16b295['name']){delete _0x16b295[_0xbe66('0x1d')];}_0x260c9b[_0xbe66('0x10')](_0xc98735)[_0xbe66('0x1e')](_0x16b295);};}exports['index']=function(_0x1a4909,_0x31f039){var _0xbcdeba={};var _0x410ee5=_[_0xbe66('0x1f')](db[_0xbe66('0x20')]['rawAttributes'],function(_0x479e40){return{'name':_0x479e40[_0xbe66('0x21')],'type':_0x479e40[_0xbe66('0x22')][_0xbe66('0x23')]};});_0xbcdeba=qs['getOptions'](_0x410ee5,_0x1a4909);return interaction[_0xbe66('0x24')](_0xbe66('0x25'),_0x1a4909[_0xbe66('0x26')],_0x1a4909[_0xbe66('0x27')],_0xbcdeba,_0x410ee5)[_0xbe66('0x19')](respondWithFilteredResult(_0x31f039,_0xbcdeba))[_0xbe66('0x28')](handleError(_0x31f039,null));};exports[_0xbe66('0x29')]=function(_0x84f39b,_0x35d6db){var _0x3df376={'raw':![],'where':{'id':_0x84f39b[_0xbe66('0x2a')]['id']}},_0x56eac6={};_0x56eac6[_0xbe66('0x2b')]=_[_0xbe66('0x2c')](db[_0xbe66('0x20')][_0xbe66('0x2d')]);_0x56eac6[_0xbe66('0x26')]=_[_0xbe66('0x2c')](_0x84f39b[_0xbe66('0x26')]);_0x56eac6['filters']=_[_0xbe66('0x2e')](_0x56eac6[_0xbe66('0x2b')],_0x56eac6[_0xbe66('0x26')]);_0x3df376[_0xbe66('0x2f')]=_[_0xbe66('0x2e')](_0x56eac6[_0xbe66('0x2b')],qs['fields'](_0x84f39b[_0xbe66('0x26')][_0xbe66('0x30')]));_0x3df376['attributes']=_0x3df376[_0xbe66('0x2f')]['length']?_0x3df376[_0xbe66('0x2f')]:_0x56eac6[_0xbe66('0x2b')];if(_0x84f39b[_0xbe66('0x26')][_0xbe66('0x31')]){_0x3df376[_0xbe66('0x32')]=[{'all':!![]}];}_0x3df376=_[_0xbe66('0x33')]({},_0x3df376,_0x84f39b['options']);return db[_0xbe66('0x20')][_0xbe66('0x34')](_0x3df376)['then'](handleEntityNotFound(_0x35d6db,null))[_0xbe66('0x19')](respondWithResult(_0x35d6db,null))[_0xbe66('0x28')](handleError(_0x35d6db,null));};exports['create']=function(_0x2c0fb0,_0x4e5bb8){return db[_0xbe66('0x20')][_0xbe66('0x35')](_0x2c0fb0[_0xbe66('0x36')],{})[_0xbe66('0x19')](respondWithResult(_0x4e5bb8,0xc9))[_0xbe66('0x28')](handleError(_0x4e5bb8,null));};exports[_0xbe66('0x37')]=function(_0xe0ad70,_0x3504d3){if(_0xe0ad70[_0xbe66('0x36')]['id']){delete _0xe0ad70[_0xbe66('0x36')]['id'];}return db['WhatsappInteraction'][_0xbe66('0x34')]({'where':{'id':_0xe0ad70[_0xbe66('0x2a')]['id']}})['then'](handleEntityNotFound(_0x3504d3,null))['then'](saveUpdates(_0xe0ad70['body'],null))[_0xbe66('0x19')](respondWithResult(_0x3504d3,null))[_0xbe66('0x28')](handleError(_0x3504d3,null));};exports[_0xbe66('0x1a')]=function(_0x5df799,_0x4ebc2d){return db[_0xbe66('0x20')][_0xbe66('0x34')]({'where':{'id':_0x5df799['params']['id']}})['then'](handleEntityNotFound(_0x4ebc2d,null))['then'](removeEntity(_0x4ebc2d,null))[_0xbe66('0x28')](handleError(_0x4ebc2d,null));};exports[_0xbe66('0x38')]=function(_0x22b697,_0x3b4d78){return db[_0xbe66('0x20')][_0xbe66('0x38')]()[_0xbe66('0x19')](respondWithResult(_0x3b4d78,null))['catch'](handleError(_0x3b4d78,null));};exports[_0xbe66('0x39')]=function(_0x345f21,_0x5439a2){return db[_0xbe66('0x3a')][_0xbe66('0x34')]({'where':{'id':_0x345f21['params']['id']}})['then'](handleEntityNotFound(_0x5439a2,null))[_0xbe66('0x19')](function(_0x2d6450){if(_0x2d6450){return _0x2d6450[_0xbe66('0x39')](_0x345f21[_0xbe66('0x36')][_0xbe66('0x3b')],_['omit'](_0x345f21[_0xbe66('0x36')],[_0xbe66('0x3b'),'id'])||{});}})[_0xbe66('0x19')](respondWithResult(_0x5439a2,null))[_0xbe66('0x28')](handleError(_0x5439a2,null));};exports[_0xbe66('0x3c')]=function(_0x105ec2,_0x5497cf){var _0x2e57d9={'raw':![],'where':{}};var _0x3aac4d={};var _0x403db3={'count':0x0,'rows':[]};return db[_0xbe66('0x20')][_0xbe66('0x3d')]({'where':{'id':_0x105ec2['params']['id']}})[_0xbe66('0x19')](handleEntityNotFound(_0x5497cf,null))[_0xbe66('0x19')](function(_0x3df6bb){if(_0x3df6bb){_0x3aac4d['model']=_['keys'](db['WhatsappMessage'][_0xbe66('0x2d')]);_0x3aac4d[_0xbe66('0x26')]=_[_0xbe66('0x2c')](_0x105ec2['query']);_0x3aac4d['filters']=_[_0xbe66('0x2e')](_0x3aac4d[_0xbe66('0x2b')],_0x3aac4d[_0xbe66('0x26')]);_0x2e57d9['attributes']=_[_0xbe66('0x2e')](_0x3aac4d[_0xbe66('0x2b')],qs[_0xbe66('0x30')](_0x105ec2['query']['fields']));_0x2e57d9[_0xbe66('0x2f')]=_0x2e57d9[_0xbe66('0x2f')]['length']?_0x2e57d9[_0xbe66('0x2f')]:_0x3aac4d[_0xbe66('0x2b')];if(!_0x105ec2[_0xbe66('0x26')][_0xbe66('0x3e')](_0xbe66('0x3f'))){_0x2e57d9[_0xbe66('0x14')]=qs[_0xbe66('0x14')](_0x105ec2[_0xbe66('0x26')]['limit']);_0x2e57d9[_0xbe66('0x13')]=qs[_0xbe66('0x13')](_0x105ec2[_0xbe66('0x26')][_0xbe66('0x13')]);}_0x2e57d9[_0xbe66('0x40')]=qs[_0xbe66('0x41')](_0x105ec2[_0xbe66('0x26')][_0xbe66('0x41')]);_0x2e57d9[_0xbe66('0x42')]=qs[_0xbe66('0x43')](_[_0xbe66('0x44')](_0x105ec2[_0xbe66('0x26')],_0x3aac4d[_0xbe66('0x43')]));_0x2e57d9[_0xbe66('0x42')][_0xbe66('0x45')]=_0x3df6bb['id'];if(_0x105ec2[_0xbe66('0x26')]['filter']){_0x2e57d9[_0xbe66('0x42')]=_[_0xbe66('0x33')](_0x2e57d9[_0xbe66('0x42')],{'$or':_['map'](_0x2e57d9[_0xbe66('0x2f')],function(_0x23c0b5){var _0x39ae8e={};_0x39ae8e[_0x23c0b5]={'$like':'%'+_0x105ec2[_0xbe66('0x26')][_0xbe66('0x46')]+'%'};return _0x39ae8e;})});}if(_0x105ec2['query']['$gte']){var _0x2270b0=_0x105ec2[_0xbe66('0x26')][_0xbe66('0x47')][_0xbe66('0x48')](',');var _0x184b3c={};_0x184b3c[_0x2270b0[0x0]]={'$gte':moment(_0x2270b0[0x1])[_0xbe66('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2e57d9[_0xbe66('0x42')]=_[_0xbe66('0x33')](_0x2e57d9['where'],_0x184b3c);}_0x2e57d9=_[_0xbe66('0x33')]({},_0x2e57d9,_0x105ec2[_0xbe66('0x4a')]);return db[_0xbe66('0x3a')]['count']({'where':_0x2e57d9[_0xbe66('0x42')]})[_0xbe66('0x19')](function(_0x693dda){_0x403db3[_0xbe66('0x16')]=_0x693dda;if(_0x105ec2[_0xbe66('0x26')][_0xbe66('0x31')]){_0x2e57d9[_0xbe66('0x32')]=[{'all':!![]}];}return db[_0xbe66('0x3a')][_0xbe66('0x24')](_0x2e57d9);})[_0xbe66('0x19')](function(_0x31106c){_0x403db3[_0xbe66('0x4b')]=_0x31106c;return _0x403db3;});}})[_0xbe66('0x19')](respondWithFilteredResult(_0x5497cf,_0x2e57d9))[_0xbe66('0x28')](handleError(_0x5497cf,null));};exports[_0xbe66('0x4c')]=function(_0x40abcd,_0x3ab420){return db[_0xbe66('0x20')]['find']({'where':{'id':_0x40abcd[_0xbe66('0x2a')]['id']}})[_0xbe66('0x19')](handleEntityNotFound(_0x3ab420,null))[_0xbe66('0x19')](function(_0x1ae6c3){if(_0x1ae6c3){return _0x1ae6c3[_0xbe66('0x4d')](_0x40abcd['body'][_0xbe66('0x3b')],_['omit'](_0x40abcd[_0xbe66('0x36')],[_0xbe66('0x3b'),'id'])||{})[_0xbe66('0x4e')](function(){return db['Tag'][_0xbe66('0x24')]({'attributes':['id','name',_0xbe66('0x4f')],'where':{'id':_0x40abcd['body'][_0xbe66('0x3b')]}});})[_0xbe66('0x19')](function(_0x326599){socket[_0xbe66('0x50')](_0xbe66('0x51'),{'id':Number(_0x40abcd['params']['id']),'tags':_0x326599||[]});return{'id':Number(_0x40abcd[_0xbe66('0x2a')]['id']),'tags':_0x326599||[]};});}})[_0xbe66('0x19')](respondWithResult(_0x3ab420,null))[_0xbe66('0x28')](handleError(_0x3ab420,null));};exports[_0xbe66('0x52')]=function(_0x268269,_0x2eb4c8){return db[_0xbe66('0x20')][_0xbe66('0x34')]({'where':{'id':_0x268269[_0xbe66('0x2a')]['id']}})[_0xbe66('0x19')](handleEntityNotFound(_0x2eb4c8,null))[_0xbe66('0x19')](function(_0x5c6306){if(_0x5c6306){return _0x5c6306['removeTags'](_0x268269[_0xbe66('0x26')]['ids']);}})[_0xbe66('0x19')](respondWithStatusCode(_0x2eb4c8,null))['catch'](handleError(_0x2eb4c8,null));};exports[_0xbe66('0x53')]=function(_0x24e1c3,_0x125529){var _0x1e59be=moment()[_0xbe66('0x54')]()[_0xbe66('0x55')]();var _0x5a19f5=path[_0xbe66('0x56')](config[_0xbe66('0x57')],_0xbe66('0x58'),_0xbe66('0x59'),_0xbe66('0x5a'));var _0x3a2f4f=path['join'](config[_0xbe66('0x57')],'server','files',_0xbe66('0x5b'));var _0x20acd3=path[_0xbe66('0x56')](_0x5a19f5,_0x1e59be);var _0x543f93=util[_0xbe66('0x49')](_0xbe66('0x5c'),_0x24e1c3['params']['id'],_0x1e59be);var _0x2cd4ef=path['join'](_0x5a19f5,_0x543f93);var _0x2cd8d8=[];_0x2cd8d8['push']({'model':db[_0xbe66('0x5d')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x2cd8d8[_0xbe66('0x5e')]({'model':db[_0xbe66('0x5f')],'as':_0xbe66('0x60'),'attributes':['id',_0xbe66('0x61'),_0xbe66('0x62')],'raw':!![]});if(_0x24e1c3['query'][_0xbe66('0x5b')]){_0x2cd8d8['push']({'model':db[_0xbe66('0x63')],'as':_0xbe66('0x63'),'raw':!![]});}var _0x2407e7=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id','body',_0xbe66('0x64'),'direction',_0xbe66('0x65'),'read'],'include':_0x2cd8d8}];_0x2407e7[_0xbe66('0x5e')]({'model':db[_0xbe66('0x66')],'as':_0xbe66('0x67'),'attributes':['id',_0xbe66('0x1d')]});_0x2407e7[_0xbe66('0x5e')]({'model':db['User'],'as':_0xbe66('0x68'),'attributes':['id',_0xbe66('0x69')]});return db[_0xbe66('0x20')]['find']({'where':{'id':_0x24e1c3['params']['id']},'include':_0x2407e7})[_0xbe66('0x19')](handleEntityNotFound(_0x125529,null))[_0xbe66('0x19')](function(_0x25e9a2){if(_0x25e9a2){var _0x33ba2f=_0x25e9a2[_0xbe66('0x6a')]({'plain':!![]});fs[_0xbe66('0x6b')](_0x20acd3);var _0x3796d0={'channel':_0xbe66('0x6c'),'account':_0x33ba2f[_0xbe66('0x67')][_0xbe66('0x1d')],'agent':_0x33ba2f[_0xbe66('0x68')]?_0x33ba2f[_0xbe66('0x68')][_0xbe66('0x69')]:'N.A.','createdAt':moment(_0x33ba2f[_0xbe66('0x64')])[_0xbe66('0x49')](_0xbe66('0x6d'))[_0xbe66('0x55')](),'closedAt':_0x33ba2f[_0xbe66('0x6e')]?moment(_0x33ba2f[_0xbe66('0x6f')])[_0xbe66('0x49')](_0xbe66('0x6d'))[_0xbe66('0x55')]():'','disposition':_0x33ba2f['disposition'],'messages':_(_0x33ba2f['Messages'])[_0xbe66('0x46')]({'secret':![]})['map'](function(_0x4d01a7){if(_0x4d01a7['Attachment']){var _0xffb064=path['join'](_0x3a2f4f,_0x4d01a7['Attachment'][_0xbe66('0x70')]);if(fs['existsSync'](_0xffb064)){fs['createReadStream'](_0xffb064)[_0xbe66('0x71')](fs[_0xbe66('0x72')](path[_0xbe66('0x56')](_0x20acd3,_0x4d01a7[_0xbe66('0x63')][_0xbe66('0x70')])));}}return{'date':moment(_0x4d01a7[_0xbe66('0x64')])[_0xbe66('0x49')](_0xbe66('0x6d'))[_0xbe66('0x55')](),'sender':_0x4d01a7[_0xbe66('0x73')]===_0xbe66('0x74')?_0x4d01a7[_0xbe66('0x5d')]?_0x4d01a7[_0xbe66('0x5d')]['fullname']:_0xbe66('0x75'):_0x4d01a7['Contact'][_0xbe66('0x61')]+(_0x4d01a7[_0xbe66('0x60')]['lastName']?'\x20'+_0x4d01a7[_0xbe66('0x60')][_0xbe66('0x62')]:''),'body':_0x4d01a7[_0xbe66('0x63')]?_0x4d01a7[_0xbe66('0x63')][_0xbe66('0x70')]:_0x4d01a7[_0xbe66('0x36')],'direction':_0x4d01a7[_0xbe66('0x73')]===_0xbe66('0x74')?'A':'C','secret':_0x4d01a7['secret'],'read':_0x4d01a7[_0xbe66('0x76')],'attachment':_0x4d01a7[_0xbe66('0x63')]};})['value']()};return ejs[_0xbe66('0x77')](path[_0xbe66('0x56')](config[_0xbe66('0x57')],_0xbe66('0x58'),_0xbe66('0x78'),'downloadInteraction.ejs'),{'interaction':_0x3796d0})[_0xbe66('0x19')](function(_0x5b8698){var _0x5aa3df=path[_0xbe66('0x56')](_0x20acd3,_0xbe66('0x79')+_0x33ba2f['id']+'-'+_0x1e59be+_0xbe66('0x7a'));var _0x45957c={'path':_0x5aa3df,'channel':_0xbe66('0x6c'),'interactionId':_0x33ba2f['id']};return pdf['createPdfFromHTML'](_0x5b8698,_0x45957c);})[_0xbe66('0x19')](function(){return new BPromise(function(_0x51a6ec,_0x170558){zipdir(_0x20acd3,{'saveTo':_0x2cd4ef},function(_0x5e96bb,_0x485cc9){if(_0x5e96bb)return _0x170558(_0x5e96bb);return _0x51a6ec(_0x485cc9);});})[_0xbe66('0x19')](function(){return new BPromise(function(_0x70e34e,_0x2600ce){rimraf(_0x20acd3,function(_0x11d93e){if(_0x11d93e)_0x2600ce(_0x11d93e);return _0x70e34e();});});})['then'](function(){return _0x125529[_0xbe66('0x53')](_0x2cd4ef,_0x543f93,function(_0x523aad){if(_0x523aad){console[_0xbe66('0x7b')](_0xbe66('0x7c'),_0x523aad);}else{fs[_0xbe66('0x7d')](_0x2cd4ef);}});});});}else{return _0x125529[_0xbe66('0x7e')](0xc8);}})[_0xbe66('0x28')](handleError(_0x125529,null));}; \ No newline at end of file +var _0x992c=['count','set','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','whatsapp','query','user','show','params','model','keys','WhatsappInteraction','filters','attributes','intersection','fields','includeAll','include','options','create','catch','update','body','find','destroy','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','addTags','setTags','omit','spread','Tag','findAll','color','emit','whatsappInteractionTags:save','removeTags','download','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','push','CmContact','firstName','lastName','Attachment','createdAt','secret','WhatsappAccount','Account','Owner','get','Whatsapp','N.A.','closed','closedAt','disposition','Messages','basename','existsSync','direction','out','fullname','System','Contact','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','rimraf','zip-dir','moment','bluebird','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x30494f,_0x3c4a5a){var _0x114fcf=function(_0x5822db){while(--_0x5822db){_0x30494f['push'](_0x30494f['shift']());}};_0x114fcf(++_0x3c4a5a);}(_0x992c,0x163));var _0xc992=function(_0x3f74b6,_0x6351ea){_0x3f74b6=_0x3f74b6-0x0;var _0xe5f66f=_0x992c[_0x3f74b6];return _0xe5f66f;};'use strict';var rimraf=require(_0xc992('0x0'));var zipdir=require(_0xc992('0x1'));var moment=require(_0xc992('0x2'));var BPromise=require(_0xc992('0x3'));var util=require('util');var path=require('path');var ejs=require(_0xc992('0x4'));var fs=require('fs');var _=require(_0xc992('0x5'));var Redis=require(_0xc992('0x6'));var interaction=require(_0xc992('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0xc992('0x8'));var logger=require(_0xc992('0x9'))('api');var config=require(_0xc992('0xa'));var db=require(_0xc992('0xb'))['db'];config[_0xc992('0xc')]=_[_0xc992('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc992('0xc')]));require(_0xc992('0xe'))[_0xc992('0xf')](socket);function respondWithStatusCode(_0x4b67c1,_0xfe94ee){_0xfe94ee=_0xfe94ee||0xcc;return function(_0x3817ad){if(_0x3817ad){return _0x4b67c1[_0xc992('0x10')](_0xfe94ee);}return _0x4b67c1[_0xc992('0x11')](_0xfe94ee)[_0xc992('0x12')]();};}function respondWithResult(_0x3869c5,_0x460e92){_0x460e92=_0x460e92||0xc8;return function(_0x33390d){if(_0x33390d){return _0x3869c5[_0xc992('0x11')](_0x460e92)[_0xc992('0x13')](_0x33390d);}};}function respondWithFilteredResult(_0x5ee78a,_0x53fed6){return function(_0x6db3b0){if(_0x6db3b0){var _0x4ee320=typeof _0x53fed6[_0xc992('0x14')]==='undefined'&&typeof _0x53fed6[_0xc992('0x15')]===_0xc992('0x16');var _0x5f3ad9=_0x6db3b0[_0xc992('0x17')];var _0x1b6dfc=_0x4ee320?0x0:_0x53fed6[_0xc992('0x14')];var _0x79fec0=_0x4ee320?_0x6db3b0['count']:_0x53fed6[_0xc992('0x14')]+_0x53fed6['limit'];var _0x350bc4;if(_0x79fec0>=_0x5f3ad9){_0x79fec0=_0x5f3ad9;_0x350bc4=0xc8;}else{_0x350bc4=0xce;}_0x5ee78a['status'](_0x350bc4);return _0x5ee78a[_0xc992('0x18')]('Content-Range',_0x1b6dfc+'-'+_0x79fec0+'/'+_0x5f3ad9)['json'](_0x6db3b0);}return null;};}function saveUpdates(_0x412c9f){return function(_0x115387){if(_0x115387){return _0x115387['update'](_0x412c9f)[_0xc992('0x19')](function(_0x258738){return _0x258738;});}return null;};}function removeEntity(_0x2266ad){return function(_0xc6fafc){if(_0xc6fafc){return _0xc6fafc['destroy']()[_0xc992('0x19')](function(){_0x2266ad[_0xc992('0x11')](0xcc)[_0xc992('0x12')]();});}};}function handleEntityNotFound(_0x43bcef){return function(_0x3aca2e){if(!_0x3aca2e){_0x43bcef['sendStatus'](0x194);}return _0x3aca2e;};}function handleError(_0x4a7056,_0x303d58){_0x303d58=_0x303d58||0x1f4;return function(_0x3b7b20){logger[_0xc992('0x1a')](_0x3b7b20[_0xc992('0x1b')]);if(_0x3b7b20[_0xc992('0x1c')]){delete _0x3b7b20[_0xc992('0x1c')];}_0x4a7056['status'](_0x303d58)[_0xc992('0x1d')](_0x3b7b20);};}exports[_0xc992('0x1e')]=function(_0x5a72d2,_0x1060fc){var _0x431a1d={};var _0x5bbee6=_[_0xc992('0x1f')](db['WhatsappInteraction'][_0xc992('0x20')],function(_0x5c71e6){return{'name':_0x5c71e6[_0xc992('0x21')],'type':_0x5c71e6[_0xc992('0x22')][_0xc992('0x23')]};});_0x431a1d=qs[_0xc992('0x24')](_0x5bbee6,_0x5a72d2);return interaction['findAll'](_0xc992('0x25'),_0x5a72d2[_0xc992('0x26')],_0x5a72d2[_0xc992('0x27')],_0x431a1d,_0x5bbee6)[_0xc992('0x19')](respondWithFilteredResult(_0x1060fc,_0x431a1d))['catch'](handleError(_0x1060fc,null));};exports[_0xc992('0x28')]=function(_0x3891e4,_0x44578e){var _0x13d7a6={'raw':![],'where':{'id':_0x3891e4[_0xc992('0x29')]['id']}},_0x2c0f9d={};_0x2c0f9d[_0xc992('0x2a')]=_[_0xc992('0x2b')](db[_0xc992('0x2c')]['rawAttributes']);_0x2c0f9d['query']=_['keys'](_0x3891e4[_0xc992('0x26')]);_0x2c0f9d[_0xc992('0x2d')]=_['intersection'](_0x2c0f9d[_0xc992('0x2a')],_0x2c0f9d[_0xc992('0x26')]);_0x13d7a6[_0xc992('0x2e')]=_[_0xc992('0x2f')](_0x2c0f9d[_0xc992('0x2a')],qs[_0xc992('0x30')](_0x3891e4[_0xc992('0x26')]['fields']));_0x13d7a6[_0xc992('0x2e')]=_0x13d7a6[_0xc992('0x2e')]['length']?_0x13d7a6[_0xc992('0x2e')]:_0x2c0f9d[_0xc992('0x2a')];if(_0x3891e4[_0xc992('0x26')][_0xc992('0x31')]){_0x13d7a6[_0xc992('0x32')]=[{'all':!![]}];}_0x13d7a6=_['merge']({},_0x13d7a6,_0x3891e4[_0xc992('0x33')]);return db[_0xc992('0x2c')]['find'](_0x13d7a6)['then'](handleEntityNotFound(_0x44578e,null))[_0xc992('0x19')](respondWithResult(_0x44578e,null))['catch'](handleError(_0x44578e,null));};exports[_0xc992('0x34')]=function(_0x1031e2,_0x6ba67d){return db['WhatsappInteraction'][_0xc992('0x34')](_0x1031e2['body'],{})[_0xc992('0x19')](respondWithResult(_0x6ba67d,0xc9))[_0xc992('0x35')](handleError(_0x6ba67d,null));};exports[_0xc992('0x36')]=function(_0x466042,_0x404c29){if(_0x466042[_0xc992('0x37')]['id']){delete _0x466042[_0xc992('0x37')]['id'];}return db['WhatsappInteraction'][_0xc992('0x38')]({'where':{'id':_0x466042['params']['id']}})[_0xc992('0x19')](handleEntityNotFound(_0x404c29,null))[_0xc992('0x19')](saveUpdates(_0x466042[_0xc992('0x37')],null))['then'](respondWithResult(_0x404c29,null))[_0xc992('0x35')](handleError(_0x404c29,null));};exports[_0xc992('0x39')]=function(_0x5e9d40,_0x1b31f0){return db[_0xc992('0x2c')][_0xc992('0x38')]({'where':{'id':_0x5e9d40[_0xc992('0x29')]['id']}})['then'](handleEntityNotFound(_0x1b31f0,null))[_0xc992('0x19')](removeEntity(_0x1b31f0,null))[_0xc992('0x35')](handleError(_0x1b31f0,null));};exports[_0xc992('0x3a')]=function(_0x9ecd07,_0x4b1393){return db[_0xc992('0x2c')][_0xc992('0x3a')]()[_0xc992('0x19')](respondWithResult(_0x4b1393,null))[_0xc992('0x35')](handleError(_0x4b1393,null));};exports[_0xc992('0x3b')]=function(_0x3667cf,_0x1ecf12){return db[_0xc992('0x3c')][_0xc992('0x38')]({'where':{'id':_0x3667cf['params']['id']}})[_0xc992('0x19')](handleEntityNotFound(_0x1ecf12,null))[_0xc992('0x19')](function(_0x566a06){if(_0x566a06){return _0x566a06[_0xc992('0x3b')](_0x3667cf[_0xc992('0x37')][_0xc992('0x3d')],_['omit'](_0x3667cf['body'],['ids','id'])||{});}})[_0xc992('0x19')](respondWithResult(_0x1ecf12,null))[_0xc992('0x35')](handleError(_0x1ecf12,null));};exports[_0xc992('0x3e')]=function(_0x2bcc98,_0x3d5a2b){var _0x35a0c8={'raw':![],'where':{}};var _0xed15e7={};var _0x29d960={'count':0x0,'rows':[]};return db[_0xc992('0x2c')][_0xc992('0x3f')]({'where':{'id':_0x2bcc98[_0xc992('0x29')]['id']}})[_0xc992('0x19')](handleEntityNotFound(_0x3d5a2b,null))[_0xc992('0x19')](function(_0x46c0ce){if(_0x46c0ce){_0xed15e7[_0xc992('0x2a')]=_[_0xc992('0x2b')](db[_0xc992('0x3c')][_0xc992('0x20')]);_0xed15e7['query']=_[_0xc992('0x2b')](_0x2bcc98[_0xc992('0x26')]);_0xed15e7[_0xc992('0x2d')]=_[_0xc992('0x2f')](_0xed15e7[_0xc992('0x2a')],_0xed15e7['query']);_0x35a0c8['attributes']=_[_0xc992('0x2f')](_0xed15e7[_0xc992('0x2a')],qs[_0xc992('0x30')](_0x2bcc98[_0xc992('0x26')][_0xc992('0x30')]));_0x35a0c8[_0xc992('0x2e')]=_0x35a0c8[_0xc992('0x2e')]['length']?_0x35a0c8[_0xc992('0x2e')]:_0xed15e7['model'];if(!_0x2bcc98['query']['hasOwnProperty'](_0xc992('0x40'))){_0x35a0c8[_0xc992('0x15')]=qs[_0xc992('0x15')](_0x2bcc98[_0xc992('0x26')][_0xc992('0x15')]);_0x35a0c8['offset']=qs['offset'](_0x2bcc98['query'][_0xc992('0x14')]);}_0x35a0c8[_0xc992('0x41')]=qs[_0xc992('0x42')](_0x2bcc98[_0xc992('0x26')][_0xc992('0x42')]);_0x35a0c8[_0xc992('0x43')]=qs[_0xc992('0x2d')](_[_0xc992('0x44')](_0x2bcc98[_0xc992('0x26')],_0xed15e7[_0xc992('0x2d')]));_0x35a0c8[_0xc992('0x43')][_0xc992('0x45')]=_0x46c0ce['id'];if(_0x2bcc98[_0xc992('0x26')][_0xc992('0x46')]){_0x35a0c8[_0xc992('0x43')]=_['merge'](_0x35a0c8['where'],{'$or':_['map'](_0x35a0c8[_0xc992('0x2e')],function(_0x440f16){var _0x2883b8={};_0x2883b8[_0x440f16]={'$like':'%'+_0x2bcc98[_0xc992('0x26')]['filter']+'%'};return _0x2883b8;})});}if(_0x2bcc98[_0xc992('0x26')]['$gte']){var _0x554acb=_0x2bcc98[_0xc992('0x26')]['$gte'][_0xc992('0x47')](',');var _0x32b7c3={};_0x32b7c3[_0x554acb[0x0]]={'$gte':moment(_0x554acb[0x1])[_0xc992('0x48')](_0xc992('0x49'))};_0x35a0c8[_0xc992('0x43')]=_['merge'](_0x35a0c8[_0xc992('0x43')],_0x32b7c3);}_0x35a0c8=_[_0xc992('0x4a')]({},_0x35a0c8,_0x2bcc98['options']);return db[_0xc992('0x3c')][_0xc992('0x17')]({'where':_0x35a0c8[_0xc992('0x43')]})[_0xc992('0x19')](function(_0x36d298){_0x29d960[_0xc992('0x17')]=_0x36d298;if(_0x2bcc98[_0xc992('0x26')][_0xc992('0x31')]){_0x35a0c8[_0xc992('0x32')]=[{'all':!![]}];}return db[_0xc992('0x3c')]['findAll'](_0x35a0c8);})['then'](function(_0x93904b){_0x29d960['rows']=_0x93904b;return _0x29d960;});}})[_0xc992('0x19')](respondWithFilteredResult(_0x3d5a2b,_0x35a0c8))['catch'](handleError(_0x3d5a2b,null));};exports[_0xc992('0x4b')]=function(_0x7bcd4b,_0x414b01){return db[_0xc992('0x2c')]['find']({'where':{'id':_0x7bcd4b[_0xc992('0x29')]['id']}})[_0xc992('0x19')](handleEntityNotFound(_0x414b01,null))[_0xc992('0x19')](function(_0x319437){if(_0x319437){return _0x319437[_0xc992('0x4c')](_0x7bcd4b[_0xc992('0x37')][_0xc992('0x3d')],_[_0xc992('0x4d')](_0x7bcd4b[_0xc992('0x37')],[_0xc992('0x3d'),'id'])||{})[_0xc992('0x4e')](function(){return db[_0xc992('0x4f')][_0xc992('0x50')]({'attributes':['id',_0xc992('0x1c'),_0xc992('0x51')],'where':{'id':_0x7bcd4b[_0xc992('0x37')][_0xc992('0x3d')]}});})[_0xc992('0x19')](function(_0x48e03f){socket[_0xc992('0x52')](_0xc992('0x53'),{'id':Number(_0x7bcd4b['params']['id']),'tags':_0x48e03f||[]});return{'id':Number(_0x7bcd4b[_0xc992('0x29')]['id']),'tags':_0x48e03f||[]};});}})['then'](respondWithResult(_0x414b01,null))[_0xc992('0x35')](handleError(_0x414b01,null));};exports[_0xc992('0x54')]=function(_0xefe5b,_0x383af5){return db[_0xc992('0x2c')][_0xc992('0x38')]({'where':{'id':_0xefe5b[_0xc992('0x29')]['id']}})[_0xc992('0x19')](handleEntityNotFound(_0x383af5,null))['then'](function(_0x8dd157){if(_0x8dd157){return _0x8dd157['removeTags'](_0xefe5b['query']['ids']);}})['then'](respondWithStatusCode(_0x383af5,null))[_0xc992('0x35')](handleError(_0x383af5,null));};exports[_0xc992('0x55')]=function(_0x62cd33,_0x3cb35f){var _0x21d4d7=moment()['unix']()[_0xc992('0x56')]();var _0x248b49=path[_0xc992('0x57')](config[_0xc992('0x58')],_0xc992('0x59'),_0xc992('0x5a'),_0xc992('0x5b'));var _0x1fa60a=path[_0xc992('0x57')](config[_0xc992('0x58')],_0xc992('0x59'),'files',_0xc992('0x5c'));var _0x2694be=path[_0xc992('0x57')](_0x248b49,_0x21d4d7);var _0x4c7a4b=util[_0xc992('0x48')](_0xc992('0x5d'),_0x62cd33['params']['id'],_0x21d4d7);var _0xa602ae=path[_0xc992('0x57')](_0x248b49,_0x4c7a4b);var _0x57b955=[];_0x57b955['push']({'model':db['User'],'as':_0xc992('0x5e'),'attributes':['id','fullname'],'raw':!![]});_0x57b955[_0xc992('0x5f')]({'model':db[_0xc992('0x60')],'as':'Contact','attributes':['id',_0xc992('0x61'),_0xc992('0x62')],'raw':!![]});if(_0x62cd33[_0xc992('0x26')][_0xc992('0x5c')]){_0x57b955[_0xc992('0x5f')]({'model':db[_0xc992('0x63')],'as':_0xc992('0x63'),'raw':!![]});}var _0x34feb7=[{'model':db[_0xc992('0x3c')],'as':'Messages','attributes':['id','body',_0xc992('0x64'),'direction',_0xc992('0x65'),'read'],'include':_0x57b955}];_0x34feb7[_0xc992('0x5f')]({'model':db[_0xc992('0x66')],'as':_0xc992('0x67'),'attributes':['id','name']});_0x34feb7[_0xc992('0x5f')]({'model':db[_0xc992('0x5e')],'as':_0xc992('0x68'),'attributes':['id','fullname']});return db[_0xc992('0x2c')]['find']({'where':{'id':_0x62cd33['params']['id']},'include':_0x34feb7})[_0xc992('0x19')](handleEntityNotFound(_0x3cb35f,null))['then'](function(_0x52eca3){if(_0x52eca3){var _0x5503c3=_0x52eca3[_0xc992('0x69')]({'plain':!![]});fs['mkdirSync'](_0x2694be);var _0x1d6bbc={'channel':_0xc992('0x6a'),'account':_0x5503c3[_0xc992('0x67')][_0xc992('0x1c')],'agent':_0x5503c3[_0xc992('0x68')]?_0x5503c3['Owner']['fullname']:_0xc992('0x6b'),'createdAt':moment(_0x5503c3[_0xc992('0x64')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xc992('0x56')](),'closedAt':_0x5503c3[_0xc992('0x6c')]?moment(_0x5503c3[_0xc992('0x6d')])[_0xc992('0x48')](_0xc992('0x49'))[_0xc992('0x56')]():'','disposition':_0x5503c3[_0xc992('0x6e')],'messages':_(_0x5503c3[_0xc992('0x6f')])[_0xc992('0x46')]({'secret':![]})[_0xc992('0x1f')](function(_0x543dc3){if(_0x543dc3[_0xc992('0x63')]){var _0x271c01=path['join'](_0x1fa60a,_0x543dc3[_0xc992('0x63')][_0xc992('0x70')]);if(fs[_0xc992('0x71')](_0x271c01)){fs['createReadStream'](_0x271c01)['pipe'](fs['createWriteStream'](path[_0xc992('0x57')](_0x2694be,_0x543dc3['Attachment'][_0xc992('0x70')])));}}return{'date':moment(_0x543dc3['createdAt'])[_0xc992('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc992('0x56')](),'sender':_0x543dc3[_0xc992('0x72')]===_0xc992('0x73')?_0x543dc3[_0xc992('0x5e')]?_0x543dc3[_0xc992('0x5e')][_0xc992('0x74')]:_0xc992('0x75'):_0x543dc3[_0xc992('0x76')]['firstName']+(_0x543dc3[_0xc992('0x76')][_0xc992('0x62')]?'\x20'+_0x543dc3[_0xc992('0x76')][_0xc992('0x62')]:''),'body':_0x543dc3[_0xc992('0x63')]?_0x543dc3[_0xc992('0x63')][_0xc992('0x70')]:_0x543dc3['body'],'direction':_0x543dc3['direction']===_0xc992('0x73')?'A':'C','secret':_0x543dc3[_0xc992('0x65')],'read':_0x543dc3['read'],'attachment':_0x543dc3[_0xc992('0x63')]};})[_0xc992('0x77')]()};return ejs[_0xc992('0x78')](path[_0xc992('0x57')](config[_0xc992('0x58')],_0xc992('0x59'),_0xc992('0x79'),_0xc992('0x7a')),{'interaction':_0x1d6bbc})[_0xc992('0x19')](function(_0x256173){var _0x40e3b7=path[_0xc992('0x57')](_0x2694be,'transcript-'+_0x5503c3['id']+'-'+_0x21d4d7+_0xc992('0x7b'));var _0x5e9449={'path':_0x40e3b7,'channel':_0xc992('0x6a'),'interactionId':_0x5503c3['id']};return pdf[_0xc992('0x7c')](_0x256173,_0x5e9449);})['then'](function(){return new BPromise(function(_0x192f2f,_0x34efe3){zipdir(_0x2694be,{'saveTo':_0xa602ae},function(_0xe157da,_0x5de5f6){if(_0xe157da)return _0x34efe3(_0xe157da);return _0x192f2f(_0x5de5f6);});})['then'](function(){return new BPromise(function(_0x1b2bec,_0x395032){rimraf(_0x2694be,function(_0x320891){if(_0x320891)_0x395032(_0x320891);return _0x1b2bec();});});})['then'](function(){return _0x3cb35f[_0xc992('0x55')](_0xa602ae,_0x4c7a4b,function(_0x213197){if(_0x213197){console[_0xc992('0x7d')]('err',_0x213197);}else{fs['unlinkSync'](_0xa602ae);}});});});}else{return _0x3cb35f[_0xc992('0x10')](0xc8);}})[_0xc992('0x35')](handleError(_0x3cb35f,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 284a81c..e997223 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 _0x6e77=['emit','catch','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x3f92bc,_0x482ad4){var _0xa15d20=function(_0x1381be){while(--_0x1381be){_0x3f92bc['push'](_0x3f92bc['shift']());}};_0xa15d20(++_0x482ad4);}(_0x6e77,0xef));var _0x76e7=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x6e77[_0x45e98e];return _0x374dba;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x76e7('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x76e7('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x76e7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x76e7('0x3'),'afterDestroy':_0x76e7('0x4')};function emitEvent(_0xcc6627){return function(_0x5eb27e,_0x498ec3,_0x423b7a){_0x5eb27e[_0x76e7('0x5')]({'attributes':['id'],'raw':!![]})[_0x76e7('0x6')](function(_0x5a5e94){_0x5eb27e[_0x76e7('0x7')](_0x76e7('0x8'),_0x5a5e94[_0x76e7('0x9')](function(_0x5dbea3){return{'id':_0x5dbea3['id']};}));return WhatsappMessage[_0x76e7('0xa')]({'where':{'WhatsappInteractionId':_0x5eb27e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x76e7('0x6')](function(_0x57b048){_0x5eb27e[_0x76e7('0x7')](_0x76e7('0xb'),_0x57b048[_0x76e7('0xc')]);WhatsappInteractionEvents[_0x76e7('0xd')](_0xcc6627+':'+_0x5eb27e['id'],_0x5eb27e);WhatsappInteractionEvents['emit'](_0xcc6627,_0x5eb27e);_0x423b7a(null);})[_0x76e7('0xe')](_0x423b7a(null));};}for(var e in events){if(events[_0x76e7('0xf')](e)){var event=events[e];WhatsappInteraction[_0x76e7('0x10')](e,emitEvent(event));}}module[_0x76e7('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x9d02=['map','then','unreadMessages','length','emit','hook','exports','events','WhatsappInteraction','WhatsappMessage','save','update','setDataValue'];(function(_0x4bc369,_0x4174d4){var _0x1f60c5=function(_0x341c5b){while(--_0x341c5b){_0x4bc369['push'](_0x4bc369['shift']());}};_0x1f60c5(++_0x4174d4);}(_0x9d02,0x118));var _0x29d0=function(_0x2aba99,_0x5f32e9){_0x2aba99=_0x2aba99-0x0;var _0xe7cf7c=_0x9d02[_0x2aba99];return _0xe7cf7c;};'use strict';var EventEmitter=require(_0x29d0('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x29d0('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0x29d0('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x29d0('0x3'),'afterUpdate':_0x29d0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x33c00f){return function(_0x2e9e8a,_0x242299,_0x5a9824){_0x2e9e8a['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x351d26){_0x2e9e8a[_0x29d0('0x5')]('Users',_0x351d26[_0x29d0('0x6')](function(_0xb1327b){return{'id':_0xb1327b['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x2e9e8a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x29d0('0x7')](function(_0x281dab){_0x2e9e8a['setDataValue'](_0x29d0('0x8'),_0x281dab[_0x29d0('0x9')]);WhatsappInteractionEvents[_0x29d0('0xa')](_0x33c00f+':'+_0x2e9e8a['id'],_0x2e9e8a);WhatsappInteractionEvents[_0x29d0('0xa')](_0x33c00f,_0x2e9e8a);_0x5a9824(null);})['catch'](_0x5a9824(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x29d0('0xb')](e,emitEvent(event));}}module[_0x29d0('0xc')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 9a019d9..ed75ddd 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 _0x0f04=['api','moment','bluebird','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger'];(function(_0xc1a5a0,_0x4e0a4c){var _0x49dd42=function(_0x26f9c9){while(--_0x26f9c9){_0xc1a5a0['push'](_0xc1a5a0['shift']());}};_0x49dd42(++_0x4e0a4c);}(_0x0f04,0x1de));var _0x40f0=function(_0x4f91ee,_0x18dc9e){_0x4f91ee=_0x4f91ee-0x0;var _0x5dfbe7=_0x0f04[_0x4f91ee];return _0x5dfbe7;};'use strict';var _=require('lodash');var util=require(_0x40f0('0x0'));var logger=require(_0x40f0('0x1'))(_0x40f0('0x2'));var moment=require(_0x40f0('0x3'));var BPromise=require(_0x40f0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40f0('0x5'));var rimraf=require('rimraf');var config=require(_0x40f0('0x6'));var attributes=require(_0x40f0('0x7'));module[_0x40f0('0x8')]=function(_0x4c695c,_0x5fb4fa){return _0x4c695c[_0x40f0('0x9')](_0x40f0('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x54e2bb,_0x1061ea,_0x1d1579){if(_0x54e2bb['changed'](_0x40f0('0xb'))){_0x54e2bb[_0x40f0('0xc')]=moment()[_0x40f0('0xd')](_0x40f0('0xe'));}_0x1d1579(null,_0x54e2bb);}}});}; \ No newline at end of file +var _0x33a5=['exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x33a5,0x125));var _0x533a=function(_0x11cc1c,_0x5ecd77){_0x11cc1c=_0x11cc1c-0x0;var _0x3985a4=_0x33a5[_0x11cc1c];return _0x3985a4;};'use strict';var _=require(_0x533a('0x0'));var util=require(_0x533a('0x1'));var logger=require(_0x533a('0x2'))(_0x533a('0x3'));var moment=require(_0x533a('0x4'));var BPromise=require(_0x533a('0x5'));var rp=require(_0x533a('0x6'));var fs=require('fs');var path=require(_0x533a('0x7'));var rimraf=require(_0x533a('0x8'));var config=require(_0x533a('0x9'));var attributes=require(_0x533a('0xa'));module[_0x533a('0xb')]=function(_0x1bacf2,_0x4ea14d){return _0x1bacf2[_0x533a('0xc')](_0x533a('0xd'),attributes,{'tableName':_0x533a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d3c5d,_0x545b92,_0x211605){if(_0x4d3c5d[_0x533a('0xf')](_0x533a('0x10'))){_0x4d3c5d['closedAt']=moment()[_0x533a('0x11')](_0x533a('0x12'));}_0x211605(null,_0x4d3c5d);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 4cf3b16..4a7f260 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 _0x84d4=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','WhatsappInteraction','body','options','raw','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x84d4,0xc5));var _0x484d=function(_0xcf8de6,_0x3edd51){_0xcf8de6=_0xcf8de6-0x0;var _0x1bce8f=_0x84d4[_0xcf8de6];return _0x1bce8f;};'use strict';var _=require(_0x484d('0x0'));var util=require('util');var moment=require(_0x484d('0x1'));var BPromise=require(_0x484d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x484d('0x3'));var logger=require(_0x484d('0x4'))(_0x484d('0x5'));var config=require(_0x484d('0x6'));var jayson=require(_0x484d('0x7'));var client=jayson[_0x484d('0x8')]['http']({'port':0x232a});config[_0x484d('0x9')]=_[_0x484d('0xa')](config[_0x484d('0x9')],{'host':_0x484d('0xb'),'port':0x18eb});var socket=require(_0x484d('0xc'))(new Redis(config['redis']));require(_0x484d('0xd'))[_0x484d('0xe')](socket);function respondWithRpcPromise(_0x3a96da,_0x18b1c,_0x5f1d53){return new BPromise(function(_0x2d0735,_0xfe88a9){return client[_0x484d('0xf')](_0x3a96da,_0x5f1d53)[_0x484d('0x10')](function(_0x1dee09){logger[_0x484d('0x11')](_0x484d('0x12'),_0x18b1c,_0x484d('0x13'));logger[_0x484d('0x14')](_0x484d('0x15'),_0x18b1c,_0x484d('0x13'),JSON[_0x484d('0x16')](_0x1dee09));if(_0x1dee09[_0x484d('0x17')]){if(_0x1dee09[_0x484d('0x17')][_0x484d('0x18')]===0x1f4){logger[_0x484d('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x18b1c,_0x1dee09['error'][_0x484d('0x19')]);return _0xfe88a9(_0x1dee09[_0x484d('0x17')]['message']);}logger['error'](_0x484d('0x12'),_0x18b1c,_0x1dee09[_0x484d('0x17')][_0x484d('0x19')]);return _0x2d0735(_0x1dee09[_0x484d('0x17')][_0x484d('0x19')]);}else{logger[_0x484d('0x11')](_0x484d('0x12'),_0x18b1c,_0x484d('0x13'));_0x2d0735(_0x1dee09['result'][_0x484d('0x19')]);}})[_0x484d('0x1a')](function(_0x271380){logger[_0x484d('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x18b1c,_0x271380);_0xfe88a9(_0x271380);});});}exports['UpdateWhatsappInteraction']=function(_0x454786){var _0x509048=this;return new Promise(function(_0x48616a,_0x1cb2b4){return db[_0x484d('0x1b')]['update'](_0x454786[_0x484d('0x1c')],{'raw':_0x454786[_0x484d('0x1d')]?_0x454786[_0x484d('0x1d')][_0x484d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x454786[_0x484d('0x1d')]?_0x454786[_0x484d('0x1d')]['where']||null:null,'attributes':_0x454786[_0x484d('0x1d')]?_0x454786[_0x484d('0x1d')]['attributes']||null:null,'limit':_0x454786['options']?_0x454786[_0x484d('0x1d')][_0x484d('0x1f')]||null:null})['then'](function(_0x15a46c){logger['info'](_0x484d('0x20'),_0x454786);logger[_0x484d('0x14')](_0x484d('0x20'),_0x454786,JSON['stringify'](_0x15a46c));_0x48616a(_0x15a46c);})[_0x484d('0x1a')](function(_0x1357e0){logger[_0x484d('0x17')](_0x484d('0x20'),_0x1357e0['message'],_0x454786);_0x1cb2b4(_0x509048['error'](0x1f4,_0x1357e0[_0x484d('0x19')]));});});};exports[_0x484d('0x21')]=function(_0x58bb60){return new Promise(function(_0x189d9a,_0x243ad0){return db[_0x484d('0x1b')][_0x484d('0x22')]({'where':_0x58bb60[_0x484d('0x1d')]?_0x58bb60[_0x484d('0x1d')]['where']||null:null})[_0x484d('0x10')](function(_0x201c02){if(_0x201c02){return _0x201c02[_0x484d('0x23')](_0x58bb60[_0x484d('0x1c')][_0x484d('0x24')],_[_0x484d('0x25')](_0x58bb60['body'],['ids','id'])||{});}})[_0x484d('0x26')](function(_0x2ff5cf){logger[_0x484d('0x11')](_0x484d('0x27'),_0x58bb60);logger[_0x484d('0x14')](_0x484d('0x27'),_0x58bb60,JSON[_0x484d('0x16')](_0x2ff5cf));_0x189d9a(_0x2ff5cf);})[_0x484d('0x1a')](function(_0xe89d26){logger[_0x484d('0x17')](_0x484d('0x27'),_0xe89d26[_0x484d('0x19')],_0x58bb60);_0x243ad0(_this[_0x484d('0x17')](0x1f4,_0xe89d26['message']));});});}; \ No newline at end of file +var _0xa072=['AddTagsToWhatsappInteraction','body','ids','spread','AddTags','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./whatsappInteraction.socket','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','info','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','limit','then'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xa072,0x1c1));var _0x2a07=function(_0xa90718,_0x2fd952){_0xa90718=_0xa90718-0x0;var _0x56ed79=_0xa072[_0xa90718];return _0x56ed79;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2a07('0x0'));var BPromise=require(_0x2a07('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a07('0x2'));var db=require(_0x2a07('0x3'))['db'];var utils=require(_0x2a07('0x4'));var logger=require(_0x2a07('0x5'))(_0x2a07('0x6'));var config=require(_0x2a07('0x7'));var jayson=require(_0x2a07('0x8'));var client=jayson[_0x2a07('0x9')][_0x2a07('0xa')]({'port':0x232a});config[_0x2a07('0xb')]=_[_0x2a07('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2a07('0xb')]));require(_0x2a07('0xd'))['register'](socket);function respondWithRpcPromise(_0x40c2ae,_0x3f92ff,_0x34e941){return new BPromise(function(_0x3e551c,_0x164f3c){return client['request'](_0x40c2ae,_0x34e941)['then'](function(_0x472e63){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x3f92ff,_0x2a07('0xe'));logger[_0x2a07('0xf')](_0x2a07('0x10'),_0x3f92ff,_0x2a07('0xe'),JSON[_0x2a07('0x11')](_0x472e63));if(_0x472e63[_0x2a07('0x12')]){if(_0x472e63[_0x2a07('0x12')][_0x2a07('0x13')]===0x1f4){logger[_0x2a07('0x12')](_0x2a07('0x14'),_0x3f92ff,_0x472e63[_0x2a07('0x12')]['message']);return _0x164f3c(_0x472e63[_0x2a07('0x12')]['message']);}logger[_0x2a07('0x12')](_0x2a07('0x14'),_0x3f92ff,_0x472e63[_0x2a07('0x12')][_0x2a07('0x15')]);return _0x3e551c(_0x472e63['error']['message']);}else{logger[_0x2a07('0x16')](_0x2a07('0x14'),_0x3f92ff,'request\x20sent');_0x3e551c(_0x472e63['result'][_0x2a07('0x15')]);}})[_0x2a07('0x17')](function(_0x3b9b8a){logger[_0x2a07('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x3f92ff,_0x3b9b8a);_0x164f3c(_0x3b9b8a);});});}exports[_0x2a07('0x18')]=function(_0x4968b2){var _0x37e445=this;return new Promise(function(_0x37a8f1,_0x406d13){return db[_0x2a07('0x19')][_0x2a07('0x1a')](_0x4968b2['body'],{'raw':_0x4968b2[_0x2a07('0x1b')]?_0x4968b2[_0x2a07('0x1b')][_0x2a07('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4968b2[_0x2a07('0x1b')]?_0x4968b2[_0x2a07('0x1b')][_0x2a07('0x1d')]||null:null,'attributes':_0x4968b2[_0x2a07('0x1b')]?_0x4968b2[_0x2a07('0x1b')]['attributes']||null:null,'limit':_0x4968b2[_0x2a07('0x1b')]?_0x4968b2[_0x2a07('0x1b')][_0x2a07('0x1e')]||null:null})[_0x2a07('0x1f')](function(_0x46420f){logger['info'](_0x2a07('0x18'),_0x4968b2);logger[_0x2a07('0xf')]('UpdateWhatsappInteraction',_0x4968b2,JSON[_0x2a07('0x11')](_0x46420f));_0x37a8f1(_0x46420f);})['catch'](function(_0x2df028){logger[_0x2a07('0x12')](_0x2a07('0x18'),_0x2df028[_0x2a07('0x15')],_0x4968b2);_0x406d13(_0x37e445['error'](0x1f4,_0x2df028['message']));});});};exports[_0x2a07('0x20')]=function(_0xf8cd7b){return new Promise(function(_0x299915,_0x33c1bd){return db['WhatsappInteraction']['find']({'where':_0xf8cd7b[_0x2a07('0x1b')]?_0xf8cd7b[_0x2a07('0x1b')][_0x2a07('0x1d')]||null:null})[_0x2a07('0x1f')](function(_0x1cf4c9){if(_0x1cf4c9){return _0x1cf4c9['addTags'](_0xf8cd7b[_0x2a07('0x21')][_0x2a07('0x22')],_['omit'](_0xf8cd7b[_0x2a07('0x21')],[_0x2a07('0x22'),'id'])||{});}})[_0x2a07('0x23')](function(_0x1ad4f2){logger[_0x2a07('0x16')](_0x2a07('0x24'),_0xf8cd7b);logger[_0x2a07('0xf')]('AddTags',_0xf8cd7b,JSON[_0x2a07('0x11')](_0x1ad4f2));_0x299915(_0x1ad4f2);})['catch'](function(_0x3f75cd){logger['error']('AddTags',_0x3f75cd[_0x2a07('0x15')],_0xf8cd7b);_0x33c1bd(_this['error'](0x1f4,_0x3f75cd[_0x2a07('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 6571d40..fb0b960 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 _0x7077=['remove','update','emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x962d72,_0x4c31a5){var _0x779d06=function(_0xf4f070){while(--_0xf4f070){_0x962d72['push'](_0x962d72['shift']());}};_0x779d06(++_0x4c31a5);}(_0x7077,0x1c6));var _0x7707=function(_0x55533f,_0x35cd09){_0x55533f=_0x55533f-0x0;var _0x380079=_0x7077[_0x55533f];return _0x380079;};'use strict';var WhatsappInteractionEvents=require(_0x7707('0x0'));var events=[_0x7707('0x1'),_0x7707('0x2'),_0x7707('0x3')];function createListener(_0x1beb26,_0x51b5fd){return function(_0x130f66){_0x51b5fd[_0x7707('0x4')](_0x1beb26,_0x130f66);};}function removeListener(_0x3ebf60,_0x7503a2){return function(){WhatsappInteractionEvents[_0x7707('0x5')](_0x3ebf60,_0x7503a2);};}exports['register']=function(_0x155d1f){for(var _0x2bbef0=0x0,_0x5b172c=events[_0x7707('0x6')];_0x2bbef0<_0x5b172c;_0x2bbef0++){var _0x25238b=events[_0x2bbef0];var _0x4c5cda=createListener(_0x7707('0x7')+_0x25238b,_0x155d1f);WhatsappInteractionEvents['on'](_0x25238b,_0x4c5cda);}}; \ No newline at end of file +var _0x2018=['register','whatsappInteraction:','./whatsappInteraction.events','remove','update','removeListener'];(function(_0x4a1385,_0x368d60){var _0xf4e8c2=function(_0x358911){while(--_0x358911){_0x4a1385['push'](_0x4a1385['shift']());}};_0xf4e8c2(++_0x368d60);}(_0x2018,0x92));var _0x8201=function(_0x3df042,_0x4ce182){_0x3df042=_0x3df042-0x0;var _0xe0ef6d=_0x2018[_0x3df042];return _0xe0ef6d;};'use strict';var WhatsappInteractionEvents=require(_0x8201('0x0'));var events=['save',_0x8201('0x1'),_0x8201('0x2')];function createListener(_0x45c877,_0x43da65){return function(_0x27ba21){_0x43da65['emit'](_0x45c877,_0x27ba21);};}function removeListener(_0x2e4b82,_0x277f62){return function(){WhatsappInteractionEvents[_0x8201('0x3')](_0x2e4b82,_0x277f62);};}exports[_0x8201('0x4')]=function(_0x2e3bc3){for(var _0xdcf173=0x0,_0x3e8b62=events['length'];_0xdcf173<_0x3e8b62;_0xdcf173++){var _0x1f5916=events[_0xdcf173];var _0x1587d0=createListener(_0x8201('0x5')+_0x1f5916,_0x2e3bc3);WhatsappInteractionEvents['on'](_0x1f5916,_0x1587d0);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index bb4caed..293743e 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 _0xb9d6=['/describe','describe','/:id','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','/:id/accept','accept','/:id/reject','reject','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index'];(function(_0x128ec6,_0x2c605b){var _0x40fae4=function(_0x1126a5){while(--_0x1126a5){_0x128ec6['push'](_0x128ec6['shift']());}};_0x40fae4(++_0x2c605b);}(_0xb9d6,0x86));var _0x6b9d=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0xb9d6[_0x3f88bc];return _0x4df1c4;};'use strict';var multer=require(_0x6b9d('0x0'));var util=require(_0x6b9d('0x1'));var path=require(_0x6b9d('0x2'));var timeout=require(_0x6b9d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6b9d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6b9d('0x5'));var controller=require(_0x6b9d('0x6'));router[_0x6b9d('0x7')]('/',auth[_0x6b9d('0x8')](),controller[_0x6b9d('0x9')]);router[_0x6b9d('0x7')](_0x6b9d('0xa'),auth[_0x6b9d('0x8')](),controller[_0x6b9d('0xb')]);router[_0x6b9d('0x7')](_0x6b9d('0xc'),auth[_0x6b9d('0x8')](),controller['show']);router[_0x6b9d('0xd')]('/',auth[_0x6b9d('0x8')](),interaction[_0x6b9d('0xe')](_0x6b9d('0xf'),_0x6b9d('0x10')),controller['create']);router[_0x6b9d('0xd')](_0x6b9d('0x11'),controller[_0x6b9d('0x12')]);router['put'](_0x6b9d('0xc'),auth[_0x6b9d('0x8')](),controller['update']);router[_0x6b9d('0x13')](_0x6b9d('0x14'),auth['isAuthenticated'](),controller[_0x6b9d('0x15')]);router[_0x6b9d('0x13')](_0x6b9d('0x16'),auth['isAuthenticated'](),controller[_0x6b9d('0x17')]);router['delete']('/:id',auth[_0x6b9d('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0e2d=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','update','/:id/accept','accept','/:id/reject','reject'];(function(_0x26c734,_0x28a87c){var _0x30eec5=function(_0x30c122){while(--_0x30c122){_0x26c734['push'](_0x26c734['shift']());}};_0x30eec5(++_0x28a87c);}(_0x0e2d,0x15f));var _0xd0e2=function(_0x34df1f,_0x548c66){_0x34df1f=_0x34df1f-0x0;var _0x61cbbd=_0x0e2d[_0x34df1f];return _0x61cbbd;};'use strict';var multer=require(_0xd0e2('0x0'));var util=require(_0xd0e2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd0e2('0x2'));var router=express[_0xd0e2('0x3')]();var fs_extra=require(_0xd0e2('0x4'));var auth=require(_0xd0e2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd0e2('0x6'));var controller=require(_0xd0e2('0x7'));router[_0xd0e2('0x8')]('/',auth[_0xd0e2('0x9')](),controller[_0xd0e2('0xa')]);router[_0xd0e2('0x8')]('/describe',auth[_0xd0e2('0x9')](),controller[_0xd0e2('0xb')]);router[_0xd0e2('0x8')](_0xd0e2('0xc'),auth[_0xd0e2('0x9')](),controller[_0xd0e2('0xd')]);router[_0xd0e2('0xe')]('/',auth[_0xd0e2('0x9')](),interaction[_0xd0e2('0xf')](_0xd0e2('0x10'),_0xd0e2('0x11')),controller[_0xd0e2('0x12')]);router[_0xd0e2('0xe')](_0xd0e2('0x13'),controller[_0xd0e2('0x14')]);router['put'](_0xd0e2('0xc'),auth[_0xd0e2('0x9')](),controller[_0xd0e2('0x15')]);router['put'](_0xd0e2('0x16'),auth['isAuthenticated'](),controller[_0xd0e2('0x17')]);router['put'](_0xd0e2('0x18'),auth[_0xd0e2('0x9')](),controller[_0xd0e2('0x19')]);router[_0xd0e2('0x1a')](_0xd0e2('0xc'),auth[_0xd0e2('0x9')](),controller[_0xd0e2('0x1b')]);module[_0xd0e2('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 9734d34..8bf5156 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 _0x7d69=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x467990,_0xdf7bb4){var _0x4599e1=function(_0x315a61){while(--_0x315a61){_0x467990['push'](_0x467990['shift']());}};_0x4599e1(++_0xdf7bb4);}(_0x7d69,0x149));var _0x97d6=function(_0x48ee3b,_0x1eb348){_0x48ee3b=_0x48ee3b-0x0;var _0x17df80=_0x7d69[_0x48ee3b];return _0x17df80;};'use strict';var Sequelize=require(_0x97d6('0x0'));module[_0x97d6('0x1')]={'body':{'type':Sequelize['TEXT'](_0x97d6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x97d6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x97d6('0x4')]('in',_0x97d6('0x5')),'defaultValue':_0x97d6('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x97d6('0x6')](0xbe)},'phone':{'type':Sequelize[_0x97d6('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x97d6('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x97d6('0x6')]},'providerResponse':{'type':Sequelize[_0x97d6('0x7')]}}; \ No newline at end of file +var _0xf37f=['exports','medium','BOOLEAN','out','STRING','TEXT'];(function(_0x5f5940,_0x5b4fcc){var _0x1a9c03=function(_0x5ea9c1){while(--_0x5ea9c1){_0x5f5940['push'](_0x5f5940['shift']());}};_0x1a9c03(++_0x5b4fcc);}(_0xf37f,0x11a));var _0xff37=function(_0x28b9fa,_0x25f40a){_0x28b9fa=_0x28b9fa-0x0;var _0x1beb5d=_0xf37f[_0x28b9fa];return _0x1beb5d;};'use strict';var Sequelize=require('sequelize');module[_0xff37('0x0')]={'body':{'type':Sequelize['TEXT'](_0xff37('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xff37('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xff37('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xff37('0x4')](0xbe)},'phone':{'type':Sequelize[_0xff37('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xff37('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xff37('0x4')]},'providerResponse':{'type':Sequelize[_0xff37('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index f979beb..8965244 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 _0x8863=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','register','jayson/promise','client','http','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','end','name','send','index','WhatsappMessage','rawAttributes','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','options','includeAll','show','length','include','find','create','body','params','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','null','RejectMessage','User','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','type','inspect','twilio','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x3230ab,_0x46eac4){var _0x486975=function(_0x5b9129){while(--_0x5b9129){_0x3230ab['push'](_0x3230ab['shift']());}};_0x486975(++_0x46eac4);}(_0x8863,0x16f));var _0x3886=function(_0x573773,_0x36caa2){_0x573773=_0x573773-0x0;var _0x2b56af=_0x8863[_0x573773];return _0x2b56af;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3886('0x0'));var rp=require(_0x3886('0x1'));var moment=require(_0x3886('0x2'));var BPromise=require(_0x3886('0x3'));var Mustache=require('mustache');var util=require(_0x3886('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x3886('0x5'));var ejs=require(_0x3886('0x6'));var fs=require('fs');var fs_extra=require(_0x3886('0x7'));var _=require(_0x3886('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3886('0x5'));var querystring=require(_0x3886('0x9'));var Papa=require(_0x3886('0xa'));var Redis=require(_0x3886('0xb'));var authService=require(_0x3886('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x3886('0xd'));var hardwareService=require(_0x3886('0xe'));var logger=require(_0x3886('0xf'))('api');var utils=require(_0x3886('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x3886('0x11'));var db=require(_0x3886('0x12'))['db'];config[_0x3886('0x13')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3886('0x13')]));require('./whatsappMessage.socket')[_0x3886('0x14')](socket);var jayson=require(_0x3886('0x15'));var client=jayson[_0x3886('0x16')][_0x3886('0x17')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1912e0,_0x4c650f,_0x415f43,_0x3704ad){return new BPromise(function(_0x144229,_0x2fd364){var _0x4d4015=_0x3704ad||client;return _0x4d4015['request'](_0x1912e0,_0x415f43)['then'](function(_0x10719a){logger[_0x3886('0x18')](_0x3886('0x19'),_0x4c650f,_0x3886('0x1a'));logger['debug'](_0x3886('0x1b'),_0x4c650f,_0x3886('0x1a'),JSON[_0x3886('0x1c')](_0x10719a));if(_0x10719a[_0x3886('0x1d')]){if(_0x10719a[_0x3886('0x1d')][_0x3886('0x1e')]===0x1f4){logger[_0x3886('0x1d')](_0x3886('0x19'),_0x4c650f,_0x10719a[_0x3886('0x1d')]['message']);return _0x2fd364(_0x10719a[_0x3886('0x1d')][_0x3886('0x1f')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x4c650f,_0x10719a[_0x3886('0x1d')][_0x3886('0x1f')]);return _0x144229(_0x10719a[_0x3886('0x1d')][_0x3886('0x1f')]);}else{logger['info'](_0x3886('0x19'),_0x4c650f,_0x3886('0x1a'));_0x144229(_0x10719a[_0x3886('0x20')][_0x3886('0x1f')]);}})[_0x3886('0x21')](function(_0x1033f5){logger[_0x3886('0x1d')](_0x3886('0x19'),_0x4c650f,_0x1033f5);_0x2fd364(_0x1033f5);});});}function respondWithStatusCode(_0x210826,_0xfd3ae){_0xfd3ae=_0xfd3ae||0xcc;return function(_0x58d304){if(_0x58d304){return _0x210826[_0x3886('0x22')](_0xfd3ae);}return _0x210826[_0x3886('0x23')](_0xfd3ae)['end']();};}function respondWithResult(_0xa1eb48,_0x27d1a5){_0x27d1a5=_0x27d1a5||0xc8;return function(_0x6b0054){if(_0x6b0054){return _0xa1eb48['status'](_0x27d1a5)['json'](_0x6b0054);}};}function respondWithFilteredResult(_0x1d1778,_0x484da1){return function(_0x395c9f){if(_0x395c9f){var _0x2449ec=typeof _0x484da1['offset']===_0x3886('0x24')&&typeof _0x484da1[_0x3886('0x25')]==='undefined';var _0x185e63=_0x395c9f[_0x3886('0x26')];var _0x3e5e2f=_0x2449ec?0x0:_0x484da1[_0x3886('0x27')];var _0x1e54ac=_0x2449ec?_0x395c9f[_0x3886('0x26')]:_0x484da1[_0x3886('0x27')]+_0x484da1[_0x3886('0x25')];var _0x1d7fad;if(_0x1e54ac>=_0x185e63){_0x1e54ac=_0x185e63;_0x1d7fad=0xc8;}else{_0x1d7fad=0xce;}_0x1d1778['status'](_0x1d7fad);return _0x1d1778[_0x3886('0x28')](_0x3886('0x29'),_0x3e5e2f+'-'+_0x1e54ac+'/'+_0x185e63)['json'](_0x395c9f);}return null;};}function patchUpdates(_0x8ecff2){return function(_0xf993bd){try{jsonpatch['apply'](_0xf993bd,_0x8ecff2,!![]);}catch(_0x4341d5){return BPromise[_0x3886('0x2a')](_0x4341d5);}return _0xf993bd[_0x3886('0x2b')]();};}function saveUpdates(_0x9dc236,_0x248e70){return function(_0x307774){if(_0x307774){return _0x307774[_0x3886('0x2c')](_0x9dc236)['then'](function(_0x17442d){return _0x17442d;});}return null;};}function removeEntity(_0x5aaf5a,_0x3570fa){return function(_0x3c7fed){if(_0x3c7fed){return _0x3c7fed[_0x3886('0x2d')]()[_0x3886('0x2e')](function(){_0x5aaf5a['status'](0xcc)[_0x3886('0x2f')]();});}};}function handleEntityNotFound(_0x4141d4,_0xe0544a){return function(_0x169a14){if(!_0x169a14){_0x4141d4[_0x3886('0x22')](0x194);}return _0x169a14;};}function handleError(_0x3d2358,_0x42dcbf){_0x42dcbf=_0x42dcbf||0x1f4;return function(_0x5d5f12){logger[_0x3886('0x1d')](_0x5d5f12['stack']);if(_0x5d5f12[_0x3886('0x30')]){delete _0x5d5f12['name'];}_0x3d2358[_0x3886('0x23')](_0x42dcbf)[_0x3886('0x31')](_0x5d5f12);};}exports[_0x3886('0x32')]=function(_0x438c56,_0x432dec){var _0x37905b={},_0x184ae2={},_0x5bdb6e={'count':0x0,'rows':[]};var _0x5c68ce=_['map'](db[_0x3886('0x33')][_0x3886('0x34')],function(_0x220bef){return{'name':_0x220bef['fieldName'],'type':_0x220bef['type'][_0x3886('0x35')]};});_0x184ae2[_0x3886('0x36')]=_[_0x3886('0x37')](_0x5c68ce,'name');_0x184ae2[_0x3886('0x38')]=_[_0x3886('0x39')](_0x438c56[_0x3886('0x38')]);_0x184ae2['filters']=_[_0x3886('0x3a')](_0x184ae2[_0x3886('0x36')],_0x184ae2[_0x3886('0x38')]);_0x37905b[_0x3886('0x3b')]=_[_0x3886('0x3a')](_0x184ae2['model'],qs[_0x3886('0x3c')](_0x438c56['query'][_0x3886('0x3c')]));_0x37905b[_0x3886('0x3b')]=_0x37905b[_0x3886('0x3b')]['length']?_0x37905b['attributes']:_0x184ae2[_0x3886('0x36')];if(!_0x438c56[_0x3886('0x38')][_0x3886('0x3d')](_0x3886('0x3e'))){_0x37905b[_0x3886('0x25')]=qs[_0x3886('0x25')](_0x438c56[_0x3886('0x38')][_0x3886('0x25')]);_0x37905b['offset']=qs[_0x3886('0x27')](_0x438c56[_0x3886('0x38')][_0x3886('0x27')]);}_0x37905b[_0x3886('0x3f')]=qs[_0x3886('0x40')](_0x438c56['query'][_0x3886('0x40')]);_0x37905b[_0x3886('0x41')]=qs['filters'](_[_0x3886('0x42')](_0x438c56[_0x3886('0x38')],_0x184ae2[_0x3886('0x43')]),_0x5c68ce);if(_0x438c56[_0x3886('0x38')]['filter']){_0x37905b['where']=_[_0x3886('0x44')](_0x37905b[_0x3886('0x41')],{'$or':_[_0x3886('0x37')](_0x5c68ce,function(_0x156fe7){if(_0x156fe7['type']!=='VIRTUAL'){var _0x17469c={};_0x17469c[_0x156fe7['name']]={'$like':'%'+_0x438c56[_0x3886('0x38')]['filter']+'%'};return _0x17469c;}})});}_0x37905b=_[_0x3886('0x44')]({},_0x37905b,_0x438c56[_0x3886('0x45')]);var _0x185c0b={'where':_0x37905b[_0x3886('0x41')]};return db[_0x3886('0x33')][_0x3886('0x26')](_0x185c0b)[_0x3886('0x2e')](function(_0xd56df0){_0x5bdb6e['count']=_0xd56df0;if(_0x438c56[_0x3886('0x38')][_0x3886('0x46')]){_0x37905b['include']=[{'all':!![]}];}return db[_0x3886('0x33')]['findAll'](_0x37905b);})[_0x3886('0x2e')](function(_0x5ba108){_0x5bdb6e['rows']=_0x5ba108;return _0x5bdb6e;})[_0x3886('0x2e')](respondWithFilteredResult(_0x432dec,_0x37905b))[_0x3886('0x21')](handleError(_0x432dec,null));};exports[_0x3886('0x47')]=function(_0x185576,_0x50b5f6){var _0x4d5698={'raw':!![],'where':{'id':_0x185576['params']['id']}},_0x522fe9={};_0x522fe9['model']=_[_0x3886('0x39')](db[_0x3886('0x33')]['rawAttributes']);_0x522fe9[_0x3886('0x38')]=_[_0x3886('0x39')](_0x185576[_0x3886('0x38')]);_0x522fe9[_0x3886('0x43')]=_[_0x3886('0x3a')](_0x522fe9['model'],_0x522fe9[_0x3886('0x38')]);_0x4d5698[_0x3886('0x3b')]=_[_0x3886('0x3a')](_0x522fe9[_0x3886('0x36')],qs['fields'](_0x185576[_0x3886('0x38')]['fields']));_0x4d5698[_0x3886('0x3b')]=_0x4d5698[_0x3886('0x3b')][_0x3886('0x48')]?_0x4d5698[_0x3886('0x3b')]:_0x522fe9['model'];if(_0x185576[_0x3886('0x38')][_0x3886('0x46')]){_0x4d5698[_0x3886('0x49')]=[{'all':!![]}];}_0x4d5698=_['merge']({},_0x4d5698,_0x185576['options']);return db[_0x3886('0x33')][_0x3886('0x4a')](_0x4d5698)[_0x3886('0x2e')](handleEntityNotFound(_0x50b5f6,null))[_0x3886('0x2e')](respondWithResult(_0x50b5f6,null))['catch'](handleError(_0x50b5f6,null));};exports[_0x3886('0x4b')]=function(_0xb61b82,_0x46fcca){return db[_0x3886('0x33')][_0x3886('0x4b')](_0xb61b82[_0x3886('0x4c')],{})[_0x3886('0x2e')](respondWithResult(_0x46fcca,0xc9))[_0x3886('0x21')](handleError(_0x46fcca,null));};exports[_0x3886('0x2c')]=function(_0x705b05,_0x1f23be){if(_0x705b05['body']['id']){delete _0x705b05[_0x3886('0x4c')]['id'];}return db[_0x3886('0x33')][_0x3886('0x4a')]({'where':{'id':_0x705b05['params']['id']}})[_0x3886('0x2e')](handleEntityNotFound(_0x1f23be,null))[_0x3886('0x2e')](saveUpdates(_0x705b05[_0x3886('0x4c')],null))[_0x3886('0x2e')](respondWithResult(_0x1f23be,null))[_0x3886('0x21')](handleError(_0x1f23be,null));};exports[_0x3886('0x2d')]=function(_0x5ed258,_0x699d39){return db[_0x3886('0x33')][_0x3886('0x4a')]({'where':{'id':_0x5ed258[_0x3886('0x4d')]['id']}})[_0x3886('0x2e')](handleEntityNotFound(_0x699d39,null))['then'](removeEntity(_0x699d39,null))[_0x3886('0x21')](handleError(_0x699d39,null));};exports[_0x3886('0x4e')]=function(_0x6cedce,_0x3595bc){return db[_0x3886('0x33')]['describe']()['then'](respondWithResult(_0x3595bc,null))['catch'](handleError(_0x3595bc,null));};var interaction_log=require('../../config/logger')(_0x3886('0x4f'));exports[_0x3886('0x50')]=function(_0x21e6da,_0x3cead3,_0x4ad865){var _0x47033e={'agent':{},'channel':_0x3886('0x51')};if(_0x21e6da['body']['id']){delete _0x21e6da[_0x3886('0x4c')]['id'];}_0x21e6da[_0x3886('0x4c')][_0x3886('0x52')]=!![];_0x21e6da['body'][_0x3886('0x53')]=moment()[_0x3886('0x54')](_0x3886('0x55'));_0x21e6da[_0x3886('0x4c')][_0x3886('0x56')]=_0x21e6da[_0x3886('0x4c')][_0x3886('0x56')]||_0x21e6da[_0x3886('0x57')]['id'];_0x47033e['agent']['id']=_0x21e6da['body'][_0x3886('0x56')];return db[_0x3886('0x33')]['find']({'where':{'id':_0x21e6da[_0x3886('0x4d')]['id'],'UserId':null}})[_0x3886('0x2e')](handleEntityNotFound(_0x3cead3,null))[_0x3886('0x2e')](saveUpdates(_0x21e6da[_0x3886('0x4c')],null))[_0x3886('0x2e')](function(_0x2dae5a){if(_0x2dae5a){_0x47033e[_0x3886('0x1f')]=_0x2dae5a['get']({'plain':!![]});return db[_0x3886('0x58')][_0x3886('0x4a')]({'where':{'id':_0x2dae5a[_0x3886('0x59')]}});}return null;})[_0x3886('0x2e')](handleEntityNotFound(_0x3cead3,null))[_0x3886('0x2e')](function(_0x15a1e2){if(_0x15a1e2){return _0x15a1e2[_0x3886('0x2c')]({'UserId':_0x21e6da[_0x3886('0x4c')]['UserId'],'read1stAt':_['isNil'](_0x15a1e2[_0x3886('0x5a')])?moment()[_0x3886('0x54')](_0x3886('0x55')):undefined});}return null;})[_0x3886('0x2e')](function(_0x1487eb){if(_0x1487eb){_0x47033e[_0x3886('0x5b')]=_0x1487eb[_0x3886('0x5c')]({'plain':!![]});interaction_log[_0x3886('0x18')](_0x3886('0x5d'),_0x21e6da['user']['id'],_0x21e6da[_0x3886('0x57')][_0x3886('0x30')],_0x21e6da['user'][_0x3886('0x5e')],_0x47033e[_0x3886('0x5b')]['id'],_0x21e6da[_0x3886('0x4c')]?JSON[_0x3886('0x1c')](_0x21e6da[_0x3886('0x4c')]):'null');return respondWithRpcPromise('AcceptMessage',_0x3886('0x5f'),_0x47033e);}return null;})[_0x3886('0x2e')](function(_0x364ada){var _0x48c4a2=_0x3886('0x60')+_0x364ada[_0x3886('0x1f')][_0x3886('0x61')];return db[_0x3886('0x62')][_0x3886('0x38')](_0x48c4a2,{'type':db[_0x3886('0x63')][_0x3886('0x64')][_0x3886('0x65')],'raw':!![]})['then'](function(_0x427b93){return _0x427b93;});})[_0x3886('0x2e')](function(_0x359896){if(_0x359896){_0x47033e[_0x3886('0x1f')][_0x3886('0x66')]=_0x359896[0x0];if(!_0x21e6da[_0x3886('0x4c')][_0x3886('0x56')])return;return db['User'][_0x3886('0x4a')]({'where':{'id':_0x21e6da[_0x3886('0x4c')]['UserId'],'role':_0x3886('0x67')},'attributes':['id','name',_0x3886('0x68'),_0x3886('0x69'),_0x3886('0x6a')],'raw':!![]});}return null;})[_0x3886('0x2e')](function(_0xdbdabd){if(!_0xdbdabd)return null;_0x47033e['message'][_0x3886('0x67')]=_0xdbdabd;return _0x47033e;})[_0x3886('0x2e')](function(_0x2bc45d){if(_0x2bc45d){if(_0x21e6da[_0x3886('0x4c')]['manual']){_0x47033e['message'][_0x3886('0x6b')]=util[_0x3886('0x54')](_0x3886('0x6c'),_0x21e6da[_0x3886('0x57')][_0x3886('0x30')]);_0x47033e['message'][_0x3886('0x6d')]=_0x47033e['channel'];_0x47033e[_0x3886('0x1f')]['motionChannel']=_0x47033e[_0x3886('0x6d')];_0x47033e[_0x3886('0x1f')][_0x3886('0x6e')]='accept';return respondWithRpcPromise('EventManager',_0x3886('0x6f'),{'event':_0x3886('0x70'),'message':_0x47033e[_0x3886('0x1f')]},client9002)['then'](function(){return _0x47033e;});}return _0x47033e;}return null;})[_0x3886('0x2e')](respondWithResult(_0x3cead3,null))[_0x3886('0x21')](handleError(_0x3cead3,null));};var interaction_log=require(_0x3886('0xf'))(_0x3886('0x4f'));exports[_0x3886('0x2a')]=function(_0x2ed0e3,_0x4f593a,_0x391bf6){var _0x1c04d={'agent':{},'channel':_0x3886('0x51')};if(_0x2ed0e3['body']['id']){delete _0x2ed0e3['body']['id'];}_0x2ed0e3['body']['UserId']=_0x2ed0e3[_0x3886('0x4c')][_0x3886('0x56')]||_0x2ed0e3[_0x3886('0x57')]['id'];_0x1c04d[_0x3886('0x67')]['id']=_0x2ed0e3[_0x3886('0x4c')]['UserId'];return db[_0x3886('0x33')]['find']({'where':{'id':_0x2ed0e3[_0x3886('0x4d')]['id'],'UserId':null}})[_0x3886('0x2e')](handleEntityNotFound(_0x4f593a,null))[_0x3886('0x2e')](function(_0x564e40){if(_0x564e40){_0x1c04d[_0x3886('0x1f')]=_0x564e40[_0x3886('0x5c')]({'plain':!![]});return db[_0x3886('0x58')][_0x3886('0x4a')]({'where':{'id':_0x564e40['WhatsappInteractionId']}});}return null;})[_0x3886('0x2e')](handleEntityNotFound(_0x4f593a,null))[_0x3886('0x2e')](function(_0x5b05b1){if(_0x5b05b1){_0x1c04d[_0x3886('0x5b')]=_0x5b05b1[_0x3886('0x5c')]({'plain':!![]});interaction_log[_0x3886('0x18')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2ed0e3[_0x3886('0x57')]['id'],_0x2ed0e3[_0x3886('0x57')][_0x3886('0x30')],_0x2ed0e3[_0x3886('0x57')]['role'],_0x1c04d[_0x3886('0x5b')]['id'],_0x2ed0e3[_0x3886('0x4c')]?JSON['stringify'](_0x2ed0e3['body']):_0x3886('0x71'));return respondWithRpcPromise(_0x3886('0x72'),'rejectMessage',_0x1c04d);}return null;})['then'](function(_0x936e08){var _0x4a940b=_0x3886('0x60')+_0x936e08['message'][_0x3886('0x61')];return db['sequelize'][_0x3886('0x38')](_0x4a940b,{'type':db[_0x3886('0x63')][_0x3886('0x64')][_0x3886('0x65')],'raw':!![]})['then'](function(_0x420e3b){return _0x420e3b;});})[_0x3886('0x2e')](function(_0x4cc78b){if(_0x4cc78b){_0x1c04d[_0x3886('0x1f')][_0x3886('0x66')]=_0x4cc78b[0x0];if(!_0x2ed0e3[_0x3886('0x4c')][_0x3886('0x56')])return;return db[_0x3886('0x73')]['find']({'where':{'id':_0x2ed0e3[_0x3886('0x4c')][_0x3886('0x56')],'role':_0x3886('0x67')},'attributes':['id','name',_0x3886('0x68'),_0x3886('0x69'),'internal'],'raw':!![]});}return null;})[_0x3886('0x2e')](function(_0x32532a){if(!_0x32532a)return null;_0x1c04d[_0x3886('0x1f')][_0x3886('0x67')]=_0x32532a;return _0x1c04d;})[_0x3886('0x2e')](function(_0x27c849){if(_0x27c849){_0x27c849[_0x3886('0x1f')][_0x3886('0x6b')]=util['format'](_0x3886('0x6c'),_0x2ed0e3[_0x3886('0x57')][_0x3886('0x30')]);_0x27c849['message']['channel']=_0x1c04d['channel'];_0x27c849[_0x3886('0x1f')]['motionChannel']=_0x1c04d[_0x3886('0x6d')];_0x27c849[_0x3886('0x1f')]['event']=_0x3886('0x2a');respondWithRpcPromise(_0x3886('0x6f'),_0x3886('0x6f'),{'event':_0x3886('0x74'),'message':_0x27c849['message']},client9002);return _0x1c04d;}return null;})[_0x3886('0x2e')](respondWithResult(_0x4f593a,null))['catch'](handleError(_0x4f593a,null));};exports[_0x3886('0x23')]=function(_0x5186a2,_0x21d574,_0x51a28f){if(_0x5186a2['body']['id']){delete _0x5186a2[_0x3886('0x4c')]['id'];}var _0x580dc6;return db[_0x3886('0x33')][_0x3886('0x4a')]({'where':{'id':_0x5186a2[_0x3886('0x4d')]['id']}})[_0x3886('0x2e')](handleEntityNotFound(_0x21d574,null))[_0x3886('0x2e')](function(_0x919143){if(_0x919143){_0x580dc6=_0x919143;return db[_0x3886('0x75')]['find']({'where':{'id':_0x919143[_0x3886('0x76')]}});}})[_0x3886('0x2e')](handleEntityNotFound(_0x21d574,null))['then'](function(_0x50c161){if(_0x50c161){logger['debug'](_0x3886('0x77'),_0x3886('0x23'),_0x3886('0x78'),_0x50c161[_0x3886('0x79')],util[_0x3886('0x7a')](_0x5186a2[_0x3886('0x4c')],{'showHidden':![],'depth':null}));switch(_0x50c161[_0x3886('0x79')]){case _0x3886('0x7b'):if(_0x5186a2[_0x3886('0x4c')]['MessageSid']&&_0x5186a2[_0x3886('0x4c')]['MessageSid']===_0x580dc6[_0x3886('0x7c')]&&_0x5186a2[_0x3886('0x4c')]['MessageStatus']&&_0x5186a2[_0x3886('0x4c')][_0x3886('0x7d')]===_0x3886('0x52')){return _0x580dc6[_0x3886('0x2c')]({'read':!![]});}else{logger[_0x3886('0x1d')](_0x3886('0x7e'),_0x3886('0x23'),_0x3886('0x7b'),util[_0x3886('0x7a')](_0x5186a2[_0x3886('0x4c')],{'showHidden':![],'depth':null}));}break;}return _0x580dc6;}})[_0x3886('0x2e')](respondWithResult(_0x21d574,null))[_0x3886('0x21')](handleError(_0x21d574,null));}; \ No newline at end of file +var _0x766d=['sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','save','update','destroy','end','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','findAll','rows','show','params','include','options','create','body','find','describe','whatsapp-interactions','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','accept','EventManager','reject','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','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','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','WhatsappMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x233a7b,_0x560a3d){var _0x47df2b=function(_0x302332){while(--_0x302332){_0x233a7b['push'](_0x233a7b['shift']());}};_0x47df2b(++_0x560a3d);}(_0x766d,0xee));var _0xd766=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x766d[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xd766('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd766('0x1'));var jsonpatch=require(_0xd766('0x2'));var rp=require(_0xd766('0x3'));var moment=require(_0xd766('0x4'));var BPromise=require(_0xd766('0x5'));var Mustache=require(_0xd766('0x6'));var util=require(_0xd766('0x7'));var path=require(_0xd766('0x8'));var sox=require('sox');var csv=require(_0xd766('0x9'));var ejs=require(_0xd766('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd766('0xb'));var squel=require(_0xd766('0xc'));var crypto=require(_0xd766('0xd'));var jsforce=require(_0xd766('0xe'));var deskjs=require(_0xd766('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd766('0x10'));var Papa=require(_0xd766('0x11'));var Redis=require('ioredis');var authService=require(_0xd766('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd766('0x13'));var hardwareService=require(_0xd766('0x14'));var logger=require(_0xd766('0x15'))('api');var utils=require(_0xd766('0x16'));var config=require(_0xd766('0x17'));var licenseUtil=require(_0xd766('0x18'));var db=require(_0xd766('0x19'))['db'];config[_0xd766('0x1a')]=_[_0xd766('0x1b')](config[_0xd766('0x1a')],{'host':_0xd766('0x1c'),'port':0x18eb});var socket=require(_0xd766('0x1d'))(new Redis(config[_0xd766('0x1a')]));require(_0xd766('0x1e'))[_0xd766('0x1f')](socket);var jayson=require(_0xd766('0x20'));var client=jayson[_0xd766('0x21')][_0xd766('0x22')]({'port':0x232c});var client9002=jayson[_0xd766('0x21')][_0xd766('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x11bfec,_0x163742,_0x5cb5d1,_0x182dd1){return new BPromise(function(_0x18549c,_0xf7ca9f){var _0x4658bd=_0x182dd1||client;return _0x4658bd[_0xd766('0x23')](_0x11bfec,_0x5cb5d1)[_0xd766('0x24')](function(_0x59caf7){logger[_0xd766('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x163742,_0xd766('0x26'));logger[_0xd766('0x27')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x163742,_0xd766('0x26'),JSON[_0xd766('0x28')](_0x59caf7));if(_0x59caf7[_0xd766('0x29')]){if(_0x59caf7[_0xd766('0x29')]['code']===0x1f4){logger['error'](_0xd766('0x2a'),_0x163742,_0x59caf7[_0xd766('0x29')][_0xd766('0x2b')]);return _0xf7ca9f(_0x59caf7['error'][_0xd766('0x2b')]);}logger[_0xd766('0x29')](_0xd766('0x2a'),_0x163742,_0x59caf7[_0xd766('0x29')][_0xd766('0x2b')]);return _0x18549c(_0x59caf7[_0xd766('0x29')]['message']);}else{logger[_0xd766('0x25')](_0xd766('0x2a'),_0x163742,_0xd766('0x26'));_0x18549c(_0x59caf7[_0xd766('0x2c')][_0xd766('0x2b')]);}})[_0xd766('0x2d')](function(_0x212bfd){logger['error'](_0xd766('0x2a'),_0x163742,_0x212bfd);_0xf7ca9f(_0x212bfd);});});}function respondWithStatusCode(_0x32fdd4,_0x19f372){_0x19f372=_0x19f372||0xcc;return function(_0x2c3ea6){if(_0x2c3ea6){return _0x32fdd4[_0xd766('0x2e')](_0x19f372);}return _0x32fdd4[_0xd766('0x2f')](_0x19f372)['end']();};}function respondWithResult(_0x2df7fc,_0x226254){_0x226254=_0x226254||0xc8;return function(_0x4163e2){if(_0x4163e2){return _0x2df7fc[_0xd766('0x2f')](_0x226254)[_0xd766('0x30')](_0x4163e2);}};}function respondWithFilteredResult(_0x12d953,_0x111caa){return function(_0x32521b){if(_0x32521b){var _0x5d2f35=typeof _0x111caa[_0xd766('0x31')]==='undefined'&&typeof _0x111caa[_0xd766('0x32')]===_0xd766('0x33');var _0x3fa0bd=_0x32521b[_0xd766('0x34')];var _0x2ec55d=_0x5d2f35?0x0:_0x111caa[_0xd766('0x31')];var _0x4e258c=_0x5d2f35?_0x32521b[_0xd766('0x34')]:_0x111caa[_0xd766('0x31')]+_0x111caa[_0xd766('0x32')];var _0x1aa636;if(_0x4e258c>=_0x3fa0bd){_0x4e258c=_0x3fa0bd;_0x1aa636=0xc8;}else{_0x1aa636=0xce;}_0x12d953['status'](_0x1aa636);return _0x12d953[_0xd766('0x35')](_0xd766('0x36'),_0x2ec55d+'-'+_0x4e258c+'/'+_0x3fa0bd)['json'](_0x32521b);}return null;};}function patchUpdates(_0x5bb4dd){return function(_0x1d73c0){try{jsonpatch['apply'](_0x1d73c0,_0x5bb4dd,!![]);}catch(_0x5d974a){return BPromise['reject'](_0x5d974a);}return _0x1d73c0[_0xd766('0x37')]();};}function saveUpdates(_0x587e2f,_0x3bf21a){return function(_0x5b150b){if(_0x5b150b){return _0x5b150b[_0xd766('0x38')](_0x587e2f)[_0xd766('0x24')](function(_0x5c2daf){return _0x5c2daf;});}return null;};}function removeEntity(_0x5a12e2,_0x211860){return function(_0x442a36){if(_0x442a36){return _0x442a36[_0xd766('0x39')]()['then'](function(){_0x5a12e2[_0xd766('0x2f')](0xcc)[_0xd766('0x3a')]();});}};}function handleEntityNotFound(_0x4318c8,_0x12c0e6){return function(_0x38f63a){if(!_0x38f63a){_0x4318c8[_0xd766('0x2e')](0x194);}return _0x38f63a;};}function handleError(_0x6cfb65,_0x586411){_0x586411=_0x586411||0x1f4;return function(_0xb9a1c0){logger['error'](_0xb9a1c0[_0xd766('0x3b')]);if(_0xb9a1c0['name']){delete _0xb9a1c0[_0xd766('0x3c')];}_0x6cfb65['status'](_0x586411)[_0xd766('0x3d')](_0xb9a1c0);};}exports[_0xd766('0x3e')]=function(_0x259780,_0x682b30){var _0x5a2a9f={},_0x421a0a={},_0x1f8a82={'count':0x0,'rows':[]};var _0x565a06=_['map'](db[_0xd766('0x3f')][_0xd766('0x40')],function(_0x1744df){return{'name':_0x1744df[_0xd766('0x41')],'type':_0x1744df[_0xd766('0x42')][_0xd766('0x43')]};});_0x421a0a[_0xd766('0x44')]=_['map'](_0x565a06,_0xd766('0x3c'));_0x421a0a[_0xd766('0x45')]=_[_0xd766('0x46')](_0x259780[_0xd766('0x45')]);_0x421a0a[_0xd766('0x47')]=_[_0xd766('0x48')](_0x421a0a[_0xd766('0x44')],_0x421a0a[_0xd766('0x45')]);_0x5a2a9f[_0xd766('0x49')]=_[_0xd766('0x48')](_0x421a0a[_0xd766('0x44')],qs[_0xd766('0x4a')](_0x259780[_0xd766('0x45')][_0xd766('0x4a')]));_0x5a2a9f[_0xd766('0x49')]=_0x5a2a9f[_0xd766('0x49')][_0xd766('0x4b')]?_0x5a2a9f[_0xd766('0x49')]:_0x421a0a[_0xd766('0x44')];if(!_0x259780[_0xd766('0x45')][_0xd766('0x4c')]('nolimit')){_0x5a2a9f[_0xd766('0x32')]=qs[_0xd766('0x32')](_0x259780[_0xd766('0x45')][_0xd766('0x32')]);_0x5a2a9f['offset']=qs[_0xd766('0x31')](_0x259780[_0xd766('0x45')][_0xd766('0x31')]);}_0x5a2a9f[_0xd766('0x4d')]=qs[_0xd766('0x4e')](_0x259780[_0xd766('0x45')][_0xd766('0x4e')]);_0x5a2a9f['where']=qs[_0xd766('0x47')](_[_0xd766('0x4f')](_0x259780[_0xd766('0x45')],_0x421a0a[_0xd766('0x47')]),_0x565a06);if(_0x259780[_0xd766('0x45')][_0xd766('0x50')]){_0x5a2a9f[_0xd766('0x51')]=_[_0xd766('0x52')](_0x5a2a9f[_0xd766('0x51')],{'$or':_[_0xd766('0x53')](_0x565a06,function(_0x5a7c55){if(_0x5a7c55[_0xd766('0x42')]!==_0xd766('0x54')){var _0x2b3570={};_0x2b3570[_0x5a7c55[_0xd766('0x3c')]]={'$like':'%'+_0x259780['query'][_0xd766('0x50')]+'%'};return _0x2b3570;}})});}_0x5a2a9f=_['merge']({},_0x5a2a9f,_0x259780['options']);var _0x3fac37={'where':_0x5a2a9f[_0xd766('0x51')]};return db[_0xd766('0x3f')]['count'](_0x3fac37)['then'](function(_0x3c439d){_0x1f8a82[_0xd766('0x34')]=_0x3c439d;if(_0x259780[_0xd766('0x45')]['includeAll']){_0x5a2a9f['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xd766('0x55')](_0x5a2a9f);})[_0xd766('0x24')](function(_0x19cc05){_0x1f8a82[_0xd766('0x56')]=_0x19cc05;return _0x1f8a82;})['then'](respondWithFilteredResult(_0x682b30,_0x5a2a9f))[_0xd766('0x2d')](handleError(_0x682b30,null));};exports[_0xd766('0x57')]=function(_0x38c2cd,_0x4d52b5){var _0x31e4f8={'raw':!![],'where':{'id':_0x38c2cd[_0xd766('0x58')]['id']}},_0x29b8b0={};_0x29b8b0[_0xd766('0x44')]=_[_0xd766('0x46')](db[_0xd766('0x3f')][_0xd766('0x40')]);_0x29b8b0[_0xd766('0x45')]=_[_0xd766('0x46')](_0x38c2cd['query']);_0x29b8b0[_0xd766('0x47')]=_[_0xd766('0x48')](_0x29b8b0[_0xd766('0x44')],_0x29b8b0['query']);_0x31e4f8[_0xd766('0x49')]=_[_0xd766('0x48')](_0x29b8b0[_0xd766('0x44')],qs[_0xd766('0x4a')](_0x38c2cd[_0xd766('0x45')][_0xd766('0x4a')]));_0x31e4f8[_0xd766('0x49')]=_0x31e4f8['attributes'][_0xd766('0x4b')]?_0x31e4f8[_0xd766('0x49')]:_0x29b8b0[_0xd766('0x44')];if(_0x38c2cd[_0xd766('0x45')]['includeAll']){_0x31e4f8[_0xd766('0x59')]=[{'all':!![]}];}_0x31e4f8=_[_0xd766('0x52')]({},_0x31e4f8,_0x38c2cd[_0xd766('0x5a')]);return db[_0xd766('0x3f')]['find'](_0x31e4f8)[_0xd766('0x24')](handleEntityNotFound(_0x4d52b5,null))[_0xd766('0x24')](respondWithResult(_0x4d52b5,null))[_0xd766('0x2d')](handleError(_0x4d52b5,null));};exports['create']=function(_0x37b4c0,_0x3015a4){return db[_0xd766('0x3f')][_0xd766('0x5b')](_0x37b4c0[_0xd766('0x5c')],{})[_0xd766('0x24')](respondWithResult(_0x3015a4,0xc9))[_0xd766('0x2d')](handleError(_0x3015a4,null));};exports[_0xd766('0x38')]=function(_0x37c2d2,_0xde3bfe){if(_0x37c2d2['body']['id']){delete _0x37c2d2[_0xd766('0x5c')]['id'];}return db[_0xd766('0x3f')][_0xd766('0x5d')]({'where':{'id':_0x37c2d2[_0xd766('0x58')]['id']}})[_0xd766('0x24')](handleEntityNotFound(_0xde3bfe,null))['then'](saveUpdates(_0x37c2d2[_0xd766('0x5c')],null))[_0xd766('0x24')](respondWithResult(_0xde3bfe,null))[_0xd766('0x2d')](handleError(_0xde3bfe,null));};exports[_0xd766('0x39')]=function(_0x5cf88c,_0xa9bf72){return db[_0xd766('0x3f')][_0xd766('0x5d')]({'where':{'id':_0x5cf88c[_0xd766('0x58')]['id']}})[_0xd766('0x24')](handleEntityNotFound(_0xa9bf72,null))[_0xd766('0x24')](removeEntity(_0xa9bf72,null))[_0xd766('0x2d')](handleError(_0xa9bf72,null));};exports[_0xd766('0x5e')]=function(_0x28176b,_0x3da907){return db[_0xd766('0x3f')][_0xd766('0x5e')]()[_0xd766('0x24')](respondWithResult(_0x3da907,null))['catch'](handleError(_0x3da907,null));};var interaction_log=require(_0xd766('0x15'))(_0xd766('0x5f'));exports['accept']=function(_0x4dc05d,_0x435d0b,_0x2106a1){var _0x555724={'agent':{},'channel':_0xd766('0x60')};if(_0x4dc05d[_0xd766('0x5c')]['id']){delete _0x4dc05d[_0xd766('0x5c')]['id'];}_0x4dc05d[_0xd766('0x5c')][_0xd766('0x61')]=!![];_0x4dc05d[_0xd766('0x5c')][_0xd766('0x62')]=moment()['format'](_0xd766('0x63'));_0x4dc05d[_0xd766('0x5c')][_0xd766('0x64')]=_0x4dc05d[_0xd766('0x5c')][_0xd766('0x64')]||_0x4dc05d['user']['id'];_0x555724[_0xd766('0x65')]['id']=_0x4dc05d[_0xd766('0x5c')][_0xd766('0x64')];return db['WhatsappMessage']['find']({'where':{'id':_0x4dc05d['params']['id'],'UserId':null}})[_0xd766('0x24')](handleEntityNotFound(_0x435d0b,null))[_0xd766('0x24')](saveUpdates(_0x4dc05d[_0xd766('0x5c')],null))[_0xd766('0x24')](function(_0x24e207){if(_0x24e207){_0x555724[_0xd766('0x2b')]=_0x24e207[_0xd766('0x66')]({'plain':!![]});return db[_0xd766('0x67')][_0xd766('0x5d')]({'where':{'id':_0x24e207[_0xd766('0x68')]}});}return null;})[_0xd766('0x24')](handleEntityNotFound(_0x435d0b,null))[_0xd766('0x24')](function(_0x18f142){if(_0x18f142){return _0x18f142[_0xd766('0x38')]({'UserId':_0x4dc05d[_0xd766('0x5c')]['UserId'],'read1stAt':_['isNil'](_0x18f142[_0xd766('0x69')])?moment()[_0xd766('0x6a')](_0xd766('0x63')):undefined});}return null;})[_0xd766('0x24')](function(_0x4ad4a1){if(_0x4ad4a1){_0x555724[_0xd766('0x6b')]=_0x4ad4a1['get']({'plain':!![]});interaction_log[_0xd766('0x25')](_0xd766('0x6c'),_0x4dc05d['user']['id'],_0x4dc05d[_0xd766('0x6d')][_0xd766('0x3c')],_0x4dc05d[_0xd766('0x6d')][_0xd766('0x6e')],_0x555724[_0xd766('0x6b')]['id'],_0x4dc05d[_0xd766('0x5c')]?JSON['stringify'](_0x4dc05d['body']):_0xd766('0x6f'));return respondWithRpcPromise(_0xd766('0x70'),'acceptMessage',_0x555724);}return null;})[_0xd766('0x24')](function(_0x416a7e){var _0x4a4a2e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x416a7e['message'][_0xd766('0x71')];return db[_0xd766('0x72')][_0xd766('0x45')](_0x4a4a2e,{'type':db[_0xd766('0x73')]['QueryTypes'][_0xd766('0x74')],'raw':!![]})['then'](function(_0x5cbe0e){return _0x5cbe0e;});})[_0xd766('0x24')](function(_0x4db136){if(_0x4db136){_0x555724[_0xd766('0x2b')][_0xd766('0x75')]=_0x4db136[0x0];if(!_0x4dc05d[_0xd766('0x5c')][_0xd766('0x64')])return;return db[_0xd766('0x76')]['find']({'where':{'id':_0x4dc05d[_0xd766('0x5c')][_0xd766('0x64')],'role':_0xd766('0x65')},'attributes':['id',_0xd766('0x3c'),_0xd766('0x77'),_0xd766('0x78'),_0xd766('0x79')],'raw':!![]});}return null;})[_0xd766('0x24')](function(_0x31cfc4){if(!_0x31cfc4)return null;_0x555724[_0xd766('0x2b')]['agent']=_0x31cfc4;return _0x555724;})[_0xd766('0x24')](function(_0x30e941){if(_0x30e941){if(_0x4dc05d[_0xd766('0x5c')][_0xd766('0x7a')]){_0x555724[_0xd766('0x2b')][_0xd766('0x7b')]=util[_0xd766('0x6a')](_0xd766('0x7c'),_0x4dc05d[_0xd766('0x6d')][_0xd766('0x3c')]);_0x555724['message']['channel']=_0x555724['channel'];_0x555724[_0xd766('0x2b')][_0xd766('0x7d')]=_0x555724[_0xd766('0x7e')];_0x555724['message'][_0xd766('0x7f')]=_0xd766('0x80');return respondWithRpcPromise(_0xd766('0x81'),_0xd766('0x81'),{'event':'acceptmessage','message':_0x555724[_0xd766('0x2b')]},client9002)[_0xd766('0x24')](function(){return _0x555724;});}return _0x555724;}return null;})[_0xd766('0x24')](respondWithResult(_0x435d0b,null))[_0xd766('0x2d')](handleError(_0x435d0b,null));};var interaction_log=require('../../config/logger')(_0xd766('0x5f'));exports[_0xd766('0x82')]=function(_0x50bdbb,_0x156934,_0x128a08){var _0x1e876c={'agent':{},'channel':_0xd766('0x60')};if(_0x50bdbb[_0xd766('0x5c')]['id']){delete _0x50bdbb['body']['id'];}_0x50bdbb[_0xd766('0x5c')][_0xd766('0x64')]=_0x50bdbb[_0xd766('0x5c')]['UserId']||_0x50bdbb['user']['id'];_0x1e876c[_0xd766('0x65')]['id']=_0x50bdbb[_0xd766('0x5c')]['UserId'];return db['WhatsappMessage'][_0xd766('0x5d')]({'where':{'id':_0x50bdbb[_0xd766('0x58')]['id'],'UserId':null}})[_0xd766('0x24')](handleEntityNotFound(_0x156934,null))[_0xd766('0x24')](function(_0x16cd46){if(_0x16cd46){_0x1e876c['message']=_0x16cd46[_0xd766('0x66')]({'plain':!![]});return db['WhatsappInteraction'][_0xd766('0x5d')]({'where':{'id':_0x16cd46[_0xd766('0x68')]}});}return null;})[_0xd766('0x24')](handleEntityNotFound(_0x156934,null))[_0xd766('0x24')](function(_0x577699){if(_0x577699){_0x1e876c[_0xd766('0x6b')]=_0x577699[_0xd766('0x66')]({'plain':!![]});interaction_log[_0xd766('0x25')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x50bdbb[_0xd766('0x6d')]['id'],_0x50bdbb[_0xd766('0x6d')][_0xd766('0x3c')],_0x50bdbb[_0xd766('0x6d')][_0xd766('0x6e')],_0x1e876c[_0xd766('0x6b')]['id'],_0x50bdbb['body']?JSON[_0xd766('0x28')](_0x50bdbb['body']):_0xd766('0x6f'));return respondWithRpcPromise(_0xd766('0x83'),'rejectMessage',_0x1e876c);}return null;})[_0xd766('0x24')](function(_0x564a4e){var _0x24bc87=_0xd766('0x84')+_0x564a4e[_0xd766('0x2b')][_0xd766('0x71')];return db[_0xd766('0x72')][_0xd766('0x45')](_0x24bc87,{'type':db['Sequelize'][_0xd766('0x85')][_0xd766('0x74')],'raw':!![]})[_0xd766('0x24')](function(_0x598555){return _0x598555;});})[_0xd766('0x24')](function(_0x4d585d){if(_0x4d585d){_0x1e876c[_0xd766('0x2b')][_0xd766('0x75')]=_0x4d585d[0x0];if(!_0x50bdbb[_0xd766('0x5c')][_0xd766('0x64')])return;return db[_0xd766('0x76')][_0xd766('0x5d')]({'where':{'id':_0x50bdbb['body'][_0xd766('0x64')],'role':_0xd766('0x65')},'attributes':['id',_0xd766('0x3c'),_0xd766('0x77'),_0xd766('0x78'),_0xd766('0x79')],'raw':!![]});}return null;})[_0xd766('0x24')](function(_0x2b6c1a){if(!_0x2b6c1a)return null;_0x1e876c['message'][_0xd766('0x65')]=_0x2b6c1a;return _0x1e876c;})['then'](function(_0xab547f){if(_0xab547f){_0xab547f[_0xd766('0x2b')]['interface']=util['format'](_0xd766('0x7c'),_0x50bdbb[_0xd766('0x6d')][_0xd766('0x3c')]);_0xab547f[_0xd766('0x2b')]['channel']=_0x1e876c[_0xd766('0x7e')];_0xab547f[_0xd766('0x2b')][_0xd766('0x7d')]=_0x1e876c['channel'];_0xab547f[_0xd766('0x2b')][_0xd766('0x7f')]=_0xd766('0x82');respondWithRpcPromise(_0xd766('0x81'),_0xd766('0x81'),{'event':'rejectmessage','message':_0xab547f[_0xd766('0x2b')]},client9002);return _0x1e876c;}return null;})[_0xd766('0x24')](respondWithResult(_0x156934,null))['catch'](handleError(_0x156934,null));};exports[_0xd766('0x2f')]=function(_0x33240f,_0x65e4ca,_0x3fd958){if(_0x33240f[_0xd766('0x5c')]['id']){delete _0x33240f[_0xd766('0x5c')]['id'];}var _0x318296;return db[_0xd766('0x3f')]['find']({'where':{'id':_0x33240f[_0xd766('0x58')]['id']}})['then'](handleEntityNotFound(_0x65e4ca,null))['then'](function(_0x30dbff){if(_0x30dbff){_0x318296=_0x30dbff;return db[_0xd766('0x86')][_0xd766('0x5d')]({'where':{'id':_0x30dbff['WhatsappAccountId']}});}})[_0xd766('0x24')](handleEntityNotFound(_0x65e4ca,null))['then'](function(_0xc0a2ad){if(_0xc0a2ad){logger['debug'](_0xd766('0x87'),_0xd766('0x2f'),'received\x20delivery\x20report\x20from',_0xc0a2ad[_0xd766('0x42')],util['inspect'](_0x33240f['body'],{'showHidden':![],'depth':null}));switch(_0xc0a2ad[_0xd766('0x42')]){case'twilio':if(_0x33240f['body'][_0xd766('0x88')]&&_0x33240f['body'][_0xd766('0x88')]===_0x318296[_0xd766('0x89')]&&_0x33240f[_0xd766('0x5c')]['MessageStatus']&&_0x33240f[_0xd766('0x5c')][_0xd766('0x8a')]===_0xd766('0x61')){return _0x318296[_0xd766('0x38')]({'read':!![]});}else{logger[_0xd766('0x29')](_0xd766('0x8b'),_0xd766('0x2f'),_0xd766('0x8c'),util[_0xd766('0x8d')](_0x33240f[_0xd766('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x318296;}})[_0xd766('0x24')](respondWithResult(_0x65e4ca,null))[_0xd766('0x2d')](handleError(_0x65e4ca,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index c39f883..82e0ad4 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 _0x8d05=['events','../../mysqldb','WhatsappMessage','setMaxListeners','save','emit','hasOwnProperty','exports'];(function(_0x567ad7,_0x4f55e0){var _0x338c0e=function(_0x44fd26){while(--_0x44fd26){_0x567ad7['push'](_0x567ad7['shift']());}};_0x338c0e(++_0x4f55e0);}(_0x8d05,0xe8));var _0x58d0=function(_0x3b9338,_0x42cafd){_0x3b9338=_0x3b9338-0x0;var _0x355fa0=_0x8d05[_0x3b9338];return _0x355fa0;};'use strict';var EventEmitter=require(_0x58d0('0x0'));var WhatsappMessage=require(_0x58d0('0x1'))['db'][_0x58d0('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x58d0('0x3')](0x0);var events={'afterCreate':_0x58d0('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x276e0a){return function(_0x3de956,_0x1a2d82,_0x55f391){WhatsappMessageEvents['emit'](_0x276e0a+':'+_0x3de956['id'],_0x3de956);WhatsappMessageEvents[_0x58d0('0x5')](_0x276e0a,_0x3de956);_0x55f391(null);};}for(var e in events){if(events[_0x58d0('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x58d0('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0xc2da=['emit','hasOwnProperty','hook','exports','events','WhatsappMessage','save','remove'];(function(_0x4148e0,_0x1e9ceb){var _0x26af68=function(_0x13586f){while(--_0x13586f){_0x4148e0['push'](_0x4148e0['shift']());}};_0x26af68(++_0x1e9ceb);}(_0xc2da,0x124));var _0xac2d=function(_0x1aeb39,_0x2e8404){_0x1aeb39=_0x1aeb39-0x0;var _0x439790=_0xc2da[_0x1aeb39];return _0x439790;};'use strict';var EventEmitter=require(_0xac2d('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xac2d('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xac2d('0x2'),'afterUpdate':'update','afterDestroy':_0xac2d('0x3')};function emitEvent(_0xb261fc){return function(_0xff0fff,_0x332f28,_0x120263){WhatsappMessageEvents[_0xac2d('0x4')](_0xb261fc+':'+_0xff0fff['id'],_0xff0fff);WhatsappMessageEvents[_0xac2d('0x4')](_0xb261fc,_0xff0fff);_0x120263(null);};}for(var e in events){if(events[_0xac2d('0x5')](e)){var event=events[e];WhatsappMessage[_0xac2d('0x6')](e,emitEvent(event));}}module[_0xac2d('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 7eda21a..1584f70 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 _0x6881=['get','toLowerCase','direction','out','isNil','UserId','WhatsappInteraction','findOne','then','createdAt','catch','error','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','token','sid','update','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','application/json','statuses','err','finally','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','node-fetch','rimraf','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6881,0x10e));var _0x1688=function(_0x1345be,_0x5e6847){_0x1345be=_0x1345be-0x0;var _0x5736af=_0x6881[_0x1345be];return _0x5736af;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1688('0x0'))(_0x1688('0x1'));var moment=require('moment');var BPromise=require(_0x1688('0x2'));var rp=require(_0x1688('0x3'));var fetch=require(_0x1688('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1688('0x5'));var config=require('../../config/environment');var attributes=require(_0x1688('0x6'));module['exports']=function(_0x323ca9,_0x202ddf){return _0x323ca9[_0x1688('0x7')](_0x1688('0x8'),attributes,{'tableName':_0x1688('0x9'),'paranoid':![],'indexes':[{'name':_0x1688('0xa'),'fields':[_0x1688('0xa')]},{'name':_0x1688('0xb'),'fields':[_0x1688('0xc')],'type':_0x1688('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x208600,_0x158f19,_0x2550f4){var _0x5539af=_0x323ca9[_0x1688('0xe')];var _0x8020f0=_0x208600[_0x1688('0xf')]({'plain':!![]});if(_0x8020f0['direction'][_0x1688('0x10')]()==='in'||_0x8020f0[_0x1688('0x11')][_0x1688('0x10')]()===_0x1688('0x12')&&!_0x8020f0['secret']&&!_[_0x1688('0x13')](_0x8020f0[_0x1688('0x14')])){_0x5539af[_0x1688('0x15')][_0x1688('0x16')]({'where':{'id':_0x8020f0['WhatsappInteractionId']}})[_0x1688('0x17')](function(_0x1c0f8d){if(_0x1c0f8d){_0x1c0f8d['update']({'lastMsgAt':_0x8020f0[_0x1688('0x18')],'lastMsgDirection':_0x8020f0[_0x1688('0x11')][_0x1688('0x10')]()});}})[_0x1688('0x19')](function(_0x3e63af){console[_0x1688('0x1a')](_0x3e63af);});}if(_0x8020f0[_0x1688('0x11')]===_0x1688('0x12')&&!_0x8020f0[_0x1688('0x1b')]){var _0x318abb;_0x5539af[_0x1688('0x1c')][_0x1688('0x1d')]({'where':{'id':_0x8020f0[_0x1688('0x1e')]},'raw':!![]})[_0x1688('0x17')](function(_0x33f38d){_0x318abb=_0x33f38d;if(_0x318abb&&_0x318abb[_0x1688('0x1f')]){switch(_0x318abb['type']){case _0x1688('0x20'):var _0x29286e=require('twilio');if(_0x318abb[_0x1688('0x21')]&&_0x318abb[_0x1688('0x22')]&&_0x318abb[_0x1688('0x23')]){var _0x580564=new _0x29286e(_0x318abb[_0x1688('0x21')],_0x318abb['authToken']);_0x580564[_0x1688('0x24')][_0x1688('0x25')]({'body':_0x8020f0[_0x1688('0xc')],'to':_0x1688('0x26')+_0x8020f0[_0x1688('0x23')],'from':_0x1688('0x26')+_0x318abb['phone'],'statusCallback':_0x318abb[_0x1688('0x27')]+_0x1688('0x28')+_0x8020f0['id']+'/status?token='+_0x318abb[_0x1688('0x29')]})[_0x1688('0x17')](function(_0x3823ce){if(_0x3823ce[_0x1688('0x2a')]){return _0x208600[_0x1688('0x2b')]({'messageId':_0x3823ce[_0x1688('0x2a')]});}})['catch'](function(_0x45c93a){logger[_0x1688('0x1a')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',util['inspect'](_0x45c93a,{'showHidden':![],'depth':null}));});}else{logger[_0x1688('0x1a')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1688('0x2c'),_0x1688('0x20'),_0x1688('0x2d'));}break;case _0x1688('0x2e'):var _0x5171d9=_0x318abb[_0x1688('0x21')];var _0x43bb02=_0x318abb[_0x1688('0x22')];var _0x2731d0=_0x318abb[_0x1688('0x2f')]+_0x1688('0x30')+_0x5171d9+_0x1688('0x31');var _0x3b8075={'to':[_0x8020f0[_0x1688('0x23')]],'message':{'type':_0x1688('0x32'),'text':_0x8020f0[_0x1688('0xc')]}};var _0x12cc75={'method':_0x1688('0x33'),'uri':_0x2731d0,'headers':{'Authorization':'Bearer\x20'+_0x43bb02,'Content-Type':_0x1688('0x34')},'body':_0x3b8075,'json':!![]};rp(_0x12cc75)[_0x1688('0x17')](function(_0x19ee91){if(_0x19ee91[_0x1688('0x35')][0x0]['message_id']){return _0x208600[_0x1688('0x2b')]({'messageId':_0x19ee91['statuses'][0x0]['message_id']});}})[_0x1688('0x19')](function(_0x157ec9){logger[_0x1688('0x36')]('WhatsappMessage,\x20%s',_0x157ec9);});break;}}})[_0x1688('0x37')](function(){_0x2550f4();});}else{_0x2550f4();}}},'charset':'utf8mb4','collate':_0x1688('0x38')});}; \ No newline at end of file +var _0x2cd4=['get','direction','toLowerCase','out','secret','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','catch','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','inspect','error','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','../../config/environment','define','WhatsappMessage','messageId','fti_whatsapp_messages','body'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0x2cd4,0xd2));var _0x42cd=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x2cd4[_0x1d50f2];return _0x3769b8;};'use strict';var _=require(_0x42cd('0x0'));var util=require('util');var logger=require(_0x42cd('0x1'))(_0x42cd('0x2'));var moment=require(_0x42cd('0x3'));var BPromise=require(_0x42cd('0x4'));var rp=require(_0x42cd('0x5'));var fetch=require(_0x42cd('0x6'));var fs=require('fs');var path=require(_0x42cd('0x7'));var rimraf=require('rimraf');var config=require(_0x42cd('0x8'));var attributes=require('./whatsappMessage.attributes');module['exports']=function(_0x6bd5af,_0x127bc6){return _0x6bd5af[_0x42cd('0x9')](_0x42cd('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x42cd('0xb'),'fields':[_0x42cd('0xb')]},{'name':_0x42cd('0xc'),'fields':[_0x42cd('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x443334,_0x5b6c1d,_0x2c5bc5){var _0x18c683=_0x6bd5af['models'];var _0xa4d83b=_0x443334[_0x42cd('0xe')]({'plain':!![]});if(_0xa4d83b[_0x42cd('0xf')][_0x42cd('0x10')]()==='in'||_0xa4d83b[_0x42cd('0xf')][_0x42cd('0x10')]()===_0x42cd('0x11')&&!_0xa4d83b[_0x42cd('0x12')]&&!_['isNil'](_0xa4d83b['UserId'])){_0x18c683[_0x42cd('0x13')][_0x42cd('0x14')]({'where':{'id':_0xa4d83b[_0x42cd('0x15')]}})[_0x42cd('0x16')](function(_0x7eccb3){if(_0x7eccb3){_0x7eccb3[_0x42cd('0x17')]({'lastMsgAt':_0xa4d83b['createdAt'],'lastMsgDirection':_0xa4d83b['direction'][_0x42cd('0x10')]()});}})[_0x42cd('0x18')](function(_0x4d79c2){console['error'](_0x4d79c2);});}if(_0xa4d83b[_0x42cd('0xf')]===_0x42cd('0x11')&&!_0xa4d83b['secret']){var _0xe21521;_0x18c683[_0x42cd('0x19')][_0x42cd('0x1a')]({'where':{'id':_0xa4d83b[_0x42cd('0x1b')]},'raw':!![]})[_0x42cd('0x16')](function(_0x527c89){_0xe21521=_0x527c89;if(_0xe21521&&_0xe21521['type']){switch(_0xe21521[_0x42cd('0x1c')]){case'twilio':var _0x4cca94=require(_0x42cd('0x1d'));if(_0xe21521[_0x42cd('0x1e')]&&_0xe21521[_0x42cd('0x1f')]&&_0xe21521[_0x42cd('0x20')]){var _0x27ecc1=new _0x4cca94(_0xe21521[_0x42cd('0x1e')],_0xe21521[_0x42cd('0x1f')]);_0x27ecc1['messages'][_0x42cd('0x21')]({'body':_0xa4d83b[_0x42cd('0xd')],'to':_0x42cd('0x22')+_0xa4d83b[_0x42cd('0x20')],'from':_0x42cd('0x22')+_0xe21521['phone'],'statusCallback':_0xe21521[_0x42cd('0x23')]+_0x42cd('0x24')+_0xa4d83b['id']+_0x42cd('0x25')+_0xe21521['token']})[_0x42cd('0x16')](function(_0x4eaa65){if(_0x4eaa65[_0x42cd('0x26')]){return _0x443334['update']({'messageId':_0x4eaa65[_0x42cd('0x26')]});}})[_0x42cd('0x18')](function(_0x3a1c7c){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x42cd('0x1d'),util[_0x42cd('0x27')](_0x3a1c7c,{'showHidden':![],'depth':null}));});}else{logger[_0x42cd('0x28')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x42cd('0x29'),'twilio',_0x42cd('0x2a'));}break;case _0x42cd('0x2b'):var _0x29d482=_0xe21521['accountSid'];var _0x279b33=_0xe21521[_0x42cd('0x1f')];var _0x2ed177=_0xe21521[_0x42cd('0x2c')]+_0x42cd('0x2d')+_0x29d482+_0x42cd('0x2e');var _0x39bd9d={'to':[_0xa4d83b[_0x42cd('0x20')]],'message':{'type':_0x42cd('0x2f'),'text':_0xa4d83b[_0x42cd('0xd')]}};var _0x202ff1={'method':_0x42cd('0x30'),'uri':_0x2ed177,'headers':{'Authorization':_0x42cd('0x31')+_0x279b33,'Content-Type':'application/json'},'body':_0x39bd9d,'json':!![]};rp(_0x202ff1)['then'](function(_0x3aa6fa){if(_0x3aa6fa[_0x42cd('0x32')][0x0][_0x42cd('0x33')]){return _0x443334[_0x42cd('0x17')]({'messageId':_0x3aa6fa[_0x42cd('0x32')][0x0][_0x42cd('0x33')]});}})['catch'](function(_0x18687d){logger['err'](_0x42cd('0x34'),_0x18687d);});break;}}})[_0x42cd('0x35')](function(){_0x2c5bc5();});}else{_0x2c5bc5();}}},'charset':_0x42cd('0x36'),'collate':_0x42cd('0x37')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index e34e15b..d2a6c4e 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 _0xafd6=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','create','body','options','raw','CreateWhatsappMessage','debug','catch','lodash'];(function(_0x1e2569,_0x23fcda){var _0x186ec6=function(_0x2ce7db){while(--_0x2ce7db){_0x1e2569['push'](_0x1e2569['shift']());}};_0x186ec6(++_0x23fcda);}(_0xafd6,0xbf));var _0x6afd=function(_0x4a8eae,_0x53865b){_0x4a8eae=_0x4a8eae-0x0;var _0x222f9b=_0xafd6[_0x4a8eae];return _0x222f9b;};'use strict';var _=require(_0x6afd('0x0'));var util=require(_0x6afd('0x1'));var moment=require(_0x6afd('0x2'));var BPromise=require(_0x6afd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6afd('0x4'));var db=require(_0x6afd('0x5'))['db'];var utils=require(_0x6afd('0x6'));var logger=require(_0x6afd('0x7'))('rpc');var config=require(_0x6afd('0x8'));var jayson=require(_0x6afd('0x9'));var client=jayson[_0x6afd('0xa')][_0x6afd('0xb')]({'port':0x232a});config[_0x6afd('0xc')]=_[_0x6afd('0xd')](config[_0x6afd('0xc')],{'host':_0x6afd('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6afd('0xc')]));require(_0x6afd('0xf'))[_0x6afd('0x10')](socket);function respondWithRpcPromise(_0x320f3b,_0x1ab3f1,_0x47f942){return new BPromise(function(_0x1cd5a5,_0x5582f3){return client['request'](_0x320f3b,_0x47f942)[_0x6afd('0x11')](function(_0x18d747){logger[_0x6afd('0x12')](_0x6afd('0x13'),_0x1ab3f1,'request\x20sent');logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1ab3f1,_0x6afd('0x14'),JSON[_0x6afd('0x15')](_0x18d747));if(_0x18d747[_0x6afd('0x16')]){if(_0x18d747[_0x6afd('0x16')][_0x6afd('0x17')]===0x1f4){logger[_0x6afd('0x16')](_0x6afd('0x13'),_0x1ab3f1,_0x18d747[_0x6afd('0x16')]['message']);return _0x5582f3(_0x18d747[_0x6afd('0x16')][_0x6afd('0x18')]);}logger['error'](_0x6afd('0x13'),_0x1ab3f1,_0x18d747[_0x6afd('0x16')][_0x6afd('0x18')]);return _0x1cd5a5(_0x18d747[_0x6afd('0x16')][_0x6afd('0x18')]);}else{logger[_0x6afd('0x12')](_0x6afd('0x13'),_0x1ab3f1,_0x6afd('0x14'));_0x1cd5a5(_0x18d747['result'][_0x6afd('0x18')]);}})['catch'](function(_0x449a61){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1ab3f1,_0x449a61);_0x5582f3(_0x449a61);});});}exports['CreateWhatsappMessage']=function(_0x25f952){var _0x5816f6=this;return new Promise(function(_0x29dcde,_0x332e50){return db['WhatsappMessage'][_0x6afd('0x19')](_0x25f952[_0x6afd('0x1a')],{'raw':_0x25f952[_0x6afd('0x1b')]?_0x25f952[_0x6afd('0x1b')][_0x6afd('0x1c')]===undefined?!![]:![]:!![]})[_0x6afd('0x11')](function(_0x550a6f){logger[_0x6afd('0x12')](_0x6afd('0x1d'),_0x25f952);logger[_0x6afd('0x1e')](_0x6afd('0x1d'),_0x25f952,JSON[_0x6afd('0x15')](_0x550a6f));_0x29dcde(_0x550a6f);})[_0x6afd('0x1f')](function(_0x298e60){logger['error']('CreateWhatsappMessage',_0x298e60[_0x6afd('0x18')],_0x25f952);_0x332e50(_0x5816f6[_0x6afd('0x16')](0x1f4,_0x298e60['message']));});});}; \ No newline at end of file +var _0x096b=['WhatsappMessage,\x20%s,\x20%s','message','result','catch','CreateWhatsappMessage','WhatsappMessage','options','raw','debug','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','./whatsappMessage.socket','register','request','then','info','request\x20sent','stringify','error'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x096b,0xf1));var _0xb096=function(_0x37e0e4,_0x21837f){_0x37e0e4=_0x37e0e4-0x0;var _0x37e1f7=_0x096b[_0x37e0e4];return _0x37e1f7;};'use strict';var _=require(_0xb096('0x0'));var util=require(_0xb096('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb096('0x2'));var fs=require('fs');var Redis=require(_0xb096('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb096('0x4'));var logger=require(_0xb096('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb096('0x6'));var client=jayson[_0xb096('0x7')][_0xb096('0x8')]({'port':0x232a});config['redis']=_[_0xb096('0x9')](config[_0xb096('0xa')],{'host':_0xb096('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb096('0xc'))[_0xb096('0xd')](socket);function respondWithRpcPromise(_0x509225,_0xb1ffeb,_0x144ff7){return new BPromise(function(_0x41499e,_0x972e8f){return client[_0xb096('0xe')](_0x509225,_0x144ff7)[_0xb096('0xf')](function(_0x589f7d){logger[_0xb096('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0xb1ffeb,_0xb096('0x11'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xb1ffeb,_0xb096('0x11'),JSON[_0xb096('0x12')](_0x589f7d));if(_0x589f7d['error']){if(_0x589f7d[_0xb096('0x13')]['code']===0x1f4){logger['error'](_0xb096('0x14'),_0xb1ffeb,_0x589f7d[_0xb096('0x13')][_0xb096('0x15')]);return _0x972e8f(_0x589f7d[_0xb096('0x13')][_0xb096('0x15')]);}logger['error'](_0xb096('0x14'),_0xb1ffeb,_0x589f7d['error'][_0xb096('0x15')]);return _0x41499e(_0x589f7d[_0xb096('0x13')][_0xb096('0x15')]);}else{logger[_0xb096('0x10')](_0xb096('0x14'),_0xb1ffeb,_0xb096('0x11'));_0x41499e(_0x589f7d[_0xb096('0x16')][_0xb096('0x15')]);}})[_0xb096('0x17')](function(_0x27ae6d){logger[_0xb096('0x13')](_0xb096('0x14'),_0xb1ffeb,_0x27ae6d);_0x972e8f(_0x27ae6d);});});}exports[_0xb096('0x18')]=function(_0x5b9fe0){var _0x9d76f9=this;return new Promise(function(_0x3df132,_0x59994f){return db[_0xb096('0x19')]['create'](_0x5b9fe0['body'],{'raw':_0x5b9fe0[_0xb096('0x1a')]?_0x5b9fe0[_0xb096('0x1a')][_0xb096('0x1b')]===undefined?!![]:![]:!![]})[_0xb096('0xf')](function(_0x20e41b){logger['info'](_0xb096('0x18'),_0x5b9fe0);logger[_0xb096('0x1c')]('CreateWhatsappMessage',_0x5b9fe0,JSON[_0xb096('0x12')](_0x20e41b));_0x3df132(_0x20e41b);})[_0xb096('0x17')](function(_0x183655){logger['error'](_0xb096('0x18'),_0x183655[_0xb096('0x15')],_0x5b9fe0);_0x59994f(_0x9d76f9[_0xb096('0x13')](0x1f4,_0x183655[_0xb096('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index ac07094..8fb784b 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 _0x737c=['update','emit','removeListener','register','save','remove'];(function(_0x3a7b04,_0x44e465){var _0x2b3ecb=function(_0x1b6183){while(--_0x1b6183){_0x3a7b04['push'](_0x3a7b04['shift']());}};_0x2b3ecb(++_0x44e465);}(_0x737c,0xb2));var _0xc737=function(_0x53e9b3,_0x10ebad){_0x53e9b3=_0x53e9b3-0x0;var _0x1c394e=_0x737c[_0x53e9b3];return _0x1c394e;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xc737('0x0'),_0xc737('0x1'),_0xc737('0x2')];function createListener(_0x107a84,_0x457fba){return function(_0x2cab04){_0x457fba[_0xc737('0x3')](_0x107a84,_0x2cab04);};}function removeListener(_0x4b5e77,_0x589f71){return function(){WhatsappMessageEvents[_0xc737('0x4')](_0x4b5e77,_0x589f71);};}exports[_0xc737('0x5')]=function(_0x12d588){for(var _0x9a35d9=0x0,_0x1ab632=events['length'];_0x9a35d9<_0x1ab632;_0x9a35d9++){var _0xc9c298=events[_0x9a35d9];var _0x4e322b=createListener('whatsappMessage:'+_0xc9c298,_0x12d588);WhatsappMessageEvents['on'](_0xc9c298,_0x4e322b);}}; \ No newline at end of file +var _0x0acb=['./whatsappMessage.events','remove','update','emit','register','length','whatsappMessage:'];(function(_0x4ac31f,_0x3bf843){var _0x1f1926=function(_0x362de5){while(--_0x362de5){_0x4ac31f['push'](_0x4ac31f['shift']());}};_0x1f1926(++_0x3bf843);}(_0x0acb,0x12d));var _0xb0ac=function(_0x4694f6,_0x316952){_0x4694f6=_0x4694f6-0x0;var _0x1ccad3=_0x0acb[_0x4694f6];return _0x1ccad3;};'use strict';var WhatsappMessageEvents=require(_0xb0ac('0x0'));var events=['save',_0xb0ac('0x1'),_0xb0ac('0x2')];function createListener(_0x3f4833,_0x330b71){return function(_0x3f8985){_0x330b71[_0xb0ac('0x3')](_0x3f4833,_0x3f8985);};}function removeListener(_0x2114cf,_0x2a8a3a){return function(){WhatsappMessageEvents['removeListener'](_0x2114cf,_0x2a8a3a);};}exports[_0xb0ac('0x4')]=function(_0x54b3b8){for(var _0x339a9c=0x0,_0x20fb37=events[_0xb0ac('0x5')];_0x339a9c<_0x20fb37;_0x339a9c++){var _0x4a15a3=events[_0x339a9c];var _0x487460=createListener(_0xb0ac('0x6')+_0x4a15a3,_0x54b3b8);WhatsappMessageEvents['on'](_0x4a15a3,_0x487460);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 83dd924..9314f94 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 _0xc806=['addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0xc806,0x13d));var _0x6c80=function(_0x26d2dd,_0x40966a){_0x26d2dd=_0x26d2dd-0x0;var _0x22bb1a=_0xc806[_0x26d2dd];return _0x22bb1a;};'use strict';var multer=require(_0x6c80('0x0'));var util=require(_0x6c80('0x1'));var path=require(_0x6c80('0x2'));var timeout=require(_0x6c80('0x3'));var express=require(_0x6c80('0x4'));var router=express['Router']();var fs_extra=require(_0x6c80('0x5'));var auth=require(_0x6c80('0x6'));var interaction=require(_0x6c80('0x7'));var config=require('../../config/environment');var controller=require(_0x6c80('0x8'));router[_0x6c80('0x9')]('/',auth[_0x6c80('0xa')](),controller['index']);router[_0x6c80('0x9')](_0x6c80('0xb'),auth['isAuthenticated'](),controller[_0x6c80('0xc')]);router[_0x6c80('0x9')](_0x6c80('0xd'),auth['isAuthenticated'](),controller[_0x6c80('0xe')]);router['get'](_0x6c80('0xf'),auth[_0x6c80('0xa')](),controller[_0x6c80('0x10')]);router[_0x6c80('0x9')](_0x6c80('0x11'),auth[_0x6c80('0xa')](),controller[_0x6c80('0x12')]);router[_0x6c80('0x9')](_0x6c80('0x13'),auth['isAuthenticated'](),controller[_0x6c80('0x14')]);router[_0x6c80('0x15')]('/',auth['isAuthenticated'](),controller[_0x6c80('0x16')]);router[_0x6c80('0x15')]('/:id/teams',auth[_0x6c80('0xa')](),controller[_0x6c80('0x17')]);router[_0x6c80('0x15')](_0x6c80('0x13'),auth[_0x6c80('0xa')](),controller[_0x6c80('0x18')]);router[_0x6c80('0x19')]('/:id',auth[_0x6c80('0xa')](),controller[_0x6c80('0x1a')]);router[_0x6c80('0x1b')](_0x6c80('0xd'),auth[_0x6c80('0xa')](),controller['destroy']);router['delete'](_0x6c80('0x11'),auth['isAuthenticated'](),controller[_0x6c80('0x1c')]);router[_0x6c80('0x1b')](_0x6c80('0x13'),auth['isAuthenticated'](),controller[_0x6c80('0x1d')]);module[_0x6c80('0x1e')]=router; \ No newline at end of file +var _0xb119=['/describe','isAuthenticated','/:id','show','/:id/members','/:id/teams','getTeams','getAgents','create','post','addTeams','addAgents','put','update','removeTeams','delete','/:id/users','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','index'];(function(_0x46a0e7,_0x3a82db){var _0xee5948=function(_0x50bf1f){while(--_0x50bf1f){_0x46a0e7['push'](_0x46a0e7['shift']());}};_0xee5948(++_0x3a82db);}(_0xb119,0xdd));var _0x9b11=function(_0x2bad37,_0x128f63){_0x2bad37=_0x2bad37-0x0;var _0x1fb1f1=_0xb119[_0x2bad37];return _0x1fb1f1;};'use strict';var multer=require(_0x9b11('0x0'));var util=require(_0x9b11('0x1'));var path=require('path');var timeout=require(_0x9b11('0x2'));var express=require(_0x9b11('0x3'));var router=express[_0x9b11('0x4')]();var fs_extra=require(_0x9b11('0x5'));var auth=require(_0x9b11('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9b11('0x7'));var controller=require(_0x9b11('0x8'));router[_0x9b11('0x9')]('/',auth['isAuthenticated'](),controller[_0x9b11('0xa')]);router['get'](_0x9b11('0xb'),auth[_0x9b11('0xc')](),controller['describe']);router[_0x9b11('0x9')](_0x9b11('0xd'),auth[_0x9b11('0xc')](),controller[_0x9b11('0xe')]);router['get'](_0x9b11('0xf'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x9b11('0x10'),auth[_0x9b11('0xc')](),controller[_0x9b11('0x11')]);router[_0x9b11('0x9')]('/:id/users',auth[_0x9b11('0xc')](),controller[_0x9b11('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9b11('0x13')]);router[_0x9b11('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x9b11('0x15')]);router['post']('/:id/users',auth[_0x9b11('0xc')](),controller[_0x9b11('0x16')]);router[_0x9b11('0x17')](_0x9b11('0xd'),auth[_0x9b11('0xc')](),controller[_0x9b11('0x18')]);router['delete']('/:id',auth[_0x9b11('0xc')](),controller['destroy']);router['delete'](_0x9b11('0x10'),auth[_0x9b11('0xc')](),controller[_0x9b11('0x19')]);router[_0x9b11('0x1a')](_0x9b11('0x1b'),auth[_0x9b11('0xc')](),controller[_0x9b11('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 5b90e36..50c4863 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 _0x1094=['beepall','roundrobin','STRING','sequelize','exports','name','ENUM','rrmemory'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x1094,0x143));var _0x4109=function(_0x3d00db,_0x3692b3){_0x3d00db=_0x3d00db-0x0;var _0x41f115=_0x1094[_0x3d00db];return _0x41f115;};'use strict';var Sequelize=require(_0x4109('0x0'));module[_0x4109('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4109('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4109('0x3')](_0x4109('0x4'),_0x4109('0x5'),_0x4109('0x6'))},'description':{'type':Sequelize[_0x4109('0x7')]}}; \ No newline at end of file +var _0x40ca=['ENUM','rrmemory','roundrobin','sequelize','name','INTEGER'];(function(_0x1aafd0,_0x20cbd4){var _0x54ea85=function(_0x408c55){while(--_0x408c55){_0x1aafd0['push'](_0x1aafd0['shift']());}};_0x54ea85(++_0x20cbd4);}(_0x40ca,0x1a1));var _0xa40c=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x40ca[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0xa40c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa40c('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xa40c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa40c('0x3')](_0xa40c('0x4'),'beepall',_0xa40c('0x5'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index e225f69..89fb87f 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 _0xd708=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','status','end','json','offset','undefined','limit','count','set','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','WhatsappQueue','includeAll','include','findAll','catch','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','keys','UserWhatsappQueue','findAndCountAll','UserId','agent','whatsappPause','createdAt','rows','format','%s/%s','SIP','updatedAt','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userWhatsappQueue:save','ids','User','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x8f7825,_0xaa0ca0){var _0x29a7c9=function(_0x43f1eb){while(--_0x43f1eb){_0x8f7825['push'](_0x8f7825['shift']());}};_0x29a7c9(++_0xaa0ca0);}(_0xd708,0x11c));var _0x8d70=function(_0x42d2a3,_0x184d8e){_0x42d2a3=_0x42d2a3-0x0;var _0x843abb=_0xd708[_0x42d2a3];return _0x843abb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d70('0x0'));var zipdir=require(_0x8d70('0x1'));var jsonpatch=require(_0x8d70('0x2'));var rp=require(_0x8d70('0x3'));var moment=require(_0x8d70('0x4'));var BPromise=require(_0x8d70('0x5'));var Mustache=require(_0x8d70('0x6'));var util=require(_0x8d70('0x7'));var path=require(_0x8d70('0x8'));var sox=require(_0x8d70('0x9'));var csv=require(_0x8d70('0xa'));var ejs=require(_0x8d70('0xb'));var fs=require('fs');var fs_extra=require(_0x8d70('0xc'));var _=require(_0x8d70('0xd'));var squel=require(_0x8d70('0xe'));var crypto=require(_0x8d70('0xf'));var jsforce=require(_0x8d70('0x10'));var deskjs=require(_0x8d70('0x11'));var toCsv=require('to-csv');var querystring=require(_0x8d70('0x12'));var Papa=require(_0x8d70('0x13'));var Redis=require(_0x8d70('0x14'));var authService=require(_0x8d70('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8d70('0x16'));var utils=require(_0x8d70('0x17'));var config=require(_0x8d70('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8d70('0x19'))['db'];config[_0x8d70('0x1a')]=_[_0x8d70('0x1b')](config[_0x8d70('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d70('0x1c'))(new Redis(config['redis']));require(_0x8d70('0x1d'))[_0x8d70('0x1e')](socket);function respondWithStatusCode(_0x430e2e,_0x4a7e40){_0x4a7e40=_0x4a7e40||0xcc;return function(_0x456018){if(_0x456018){return _0x430e2e['sendStatus'](_0x4a7e40);}return _0x430e2e[_0x8d70('0x1f')](_0x4a7e40)[_0x8d70('0x20')]();};}function respondWithResult(_0x4cc8ac,_0x2c5be7){_0x2c5be7=_0x2c5be7||0xc8;return function(_0x32ae22){if(_0x32ae22){return _0x4cc8ac[_0x8d70('0x1f')](_0x2c5be7)[_0x8d70('0x21')](_0x32ae22);}};}function respondWithFilteredResult(_0x30dc9e,_0x2fa579){return function(_0x41b4a0){if(_0x41b4a0){var _0x1a26c6=typeof _0x2fa579[_0x8d70('0x22')]===_0x8d70('0x23')&&typeof _0x2fa579[_0x8d70('0x24')]==='undefined';var _0x23eaa9=_0x41b4a0[_0x8d70('0x25')];var _0x2ee13a=_0x1a26c6?0x0:_0x2fa579[_0x8d70('0x22')];var _0x23516c=_0x1a26c6?_0x41b4a0[_0x8d70('0x25')]:_0x2fa579[_0x8d70('0x22')]+_0x2fa579['limit'];var _0x1a4021;if(_0x23516c>=_0x23eaa9){_0x23516c=_0x23eaa9;_0x1a4021=0xc8;}else{_0x1a4021=0xce;}_0x30dc9e[_0x8d70('0x1f')](_0x1a4021);return _0x30dc9e[_0x8d70('0x26')]('Content-Range',_0x2ee13a+'-'+_0x23516c+'/'+_0x23eaa9)[_0x8d70('0x21')](_0x41b4a0);}return null;};}function patchUpdates(_0x435092){return function(_0x4ed43f){try{jsonpatch['apply'](_0x4ed43f,_0x435092,!![]);}catch(_0x41ff70){return BPromise['reject'](_0x41ff70);}return _0x4ed43f[_0x8d70('0x27')]();};}function saveUpdates(_0x118289,_0x4264a8){return function(_0x192d1b){if(_0x192d1b){return _0x192d1b[_0x8d70('0x28')](_0x118289)[_0x8d70('0x29')](function(_0x153136){return _0x153136;});}return null;};}function removeEntity(_0x39b098,_0x44b3e0){return function(_0xbdb1b0){if(_0xbdb1b0){return _0xbdb1b0[_0x8d70('0x2a')]()[_0x8d70('0x29')](function(){var _0x13b9d3=_0xbdb1b0[_0x8d70('0x2b')]({'plain':!![]});var _0x3d8cd8=_0x8d70('0x2c');return db[_0x8d70('0x2d')][_0x8d70('0x2a')]({'where':{'type':_0x3d8cd8,'resourceId':_0x13b9d3['id']}})[_0x8d70('0x29')](function(){return _0xbdb1b0;});})['then'](function(){_0x39b098[_0x8d70('0x1f')](0xcc)[_0x8d70('0x20')]();});}};}function handleEntityNotFound(_0xc75652,_0x14664d){return function(_0x3d9604){if(!_0x3d9604){_0xc75652[_0x8d70('0x2e')](0x194);}return _0x3d9604;};}function handleError(_0x532596,_0x863b0e){_0x863b0e=_0x863b0e||0x1f4;return function(_0x41dec6){logger['error'](_0x41dec6[_0x8d70('0x2f')]);if(_0x41dec6[_0x8d70('0x30')]){delete _0x41dec6[_0x8d70('0x30')];}_0x532596[_0x8d70('0x1f')](_0x863b0e)[_0x8d70('0x31')](_0x41dec6);};}exports[_0x8d70('0x32')]=function(_0x32d250,_0x37c97c){var _0x31b92b={},_0x256c3a={},_0x2d2896={'count':0x0,'rows':[]};var _0x56aa3c=_[_0x8d70('0x33')](db['WhatsappQueue'][_0x8d70('0x34')],function(_0x4fd4da){return{'name':_0x4fd4da[_0x8d70('0x35')],'type':_0x4fd4da[_0x8d70('0x36')][_0x8d70('0x37')]};});_0x256c3a[_0x8d70('0x38')]=_['map'](_0x56aa3c,_0x8d70('0x30'));_0x256c3a['query']=_['keys'](_0x32d250[_0x8d70('0x39')]);_0x256c3a[_0x8d70('0x3a')]=_['intersection'](_0x256c3a[_0x8d70('0x38')],_0x256c3a[_0x8d70('0x39')]);_0x31b92b[_0x8d70('0x3b')]=_[_0x8d70('0x3c')](_0x256c3a['model'],qs[_0x8d70('0x3d')](_0x32d250[_0x8d70('0x39')]['fields']));_0x31b92b['attributes']=_0x31b92b[_0x8d70('0x3b')]['length']?_0x31b92b[_0x8d70('0x3b')]:_0x256c3a['model'];if(!_0x32d250[_0x8d70('0x39')][_0x8d70('0x3e')](_0x8d70('0x3f'))){_0x31b92b[_0x8d70('0x24')]=qs[_0x8d70('0x24')](_0x32d250[_0x8d70('0x39')][_0x8d70('0x24')]);_0x31b92b[_0x8d70('0x22')]=qs['offset'](_0x32d250[_0x8d70('0x39')][_0x8d70('0x22')]);}_0x31b92b[_0x8d70('0x40')]=qs['sort'](_0x32d250['query'][_0x8d70('0x41')]);_0x31b92b['where']=qs[_0x8d70('0x3a')](_['pick'](_0x32d250[_0x8d70('0x39')],_0x256c3a[_0x8d70('0x3a')]),_0x56aa3c);if(_0x32d250[_0x8d70('0x39')][_0x8d70('0x42')]){_0x31b92b[_0x8d70('0x43')]=_['merge'](_0x31b92b['where'],{'$or':_['map'](_0x56aa3c,function(_0x1434f2){if(_0x1434f2[_0x8d70('0x36')]!==_0x8d70('0x44')){var _0x3aec02={};_0x3aec02[_0x1434f2[_0x8d70('0x30')]]={'$like':'%'+_0x32d250['query'][_0x8d70('0x42')]+'%'};return _0x3aec02;}})});}_0x31b92b=_[_0x8d70('0x45')]({},_0x31b92b,_0x32d250[_0x8d70('0x46')]);var _0x4fda06={'where':_0x31b92b[_0x8d70('0x43')]};return db[_0x8d70('0x47')][_0x8d70('0x25')](_0x4fda06)['then'](function(_0x41dc21){_0x2d2896[_0x8d70('0x25')]=_0x41dc21;if(_0x32d250['query'][_0x8d70('0x48')]){_0x31b92b[_0x8d70('0x49')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x8d70('0x4a')](_0x31b92b);})[_0x8d70('0x29')](function(_0xc91786){_0x2d2896['rows']=_0xc91786;return _0x2d2896;})['then'](respondWithFilteredResult(_0x37c97c,_0x31b92b))[_0x8d70('0x4b')](handleError(_0x37c97c,null));};exports['show']=function(_0x409fae,_0x59b793){var _0x35971f={'raw':!![],'where':{'id':_0x409fae['params']['id']}},_0x459f18={};_0x459f18['model']=_['keys'](db[_0x8d70('0x47')][_0x8d70('0x34')]);_0x459f18[_0x8d70('0x39')]=_['keys'](_0x409fae[_0x8d70('0x39')]);_0x459f18[_0x8d70('0x3a')]=_['intersection'](_0x459f18['model'],_0x459f18[_0x8d70('0x39')]);_0x35971f[_0x8d70('0x3b')]=_['intersection'](_0x459f18[_0x8d70('0x38')],qs['fields'](_0x409fae[_0x8d70('0x39')][_0x8d70('0x3d')]));_0x35971f[_0x8d70('0x3b')]=_0x35971f['attributes'][_0x8d70('0x4c')]?_0x35971f[_0x8d70('0x3b')]:_0x459f18[_0x8d70('0x38')];if(_0x409fae[_0x8d70('0x39')]['includeAll']){_0x35971f[_0x8d70('0x49')]=[{'all':!![]}];}_0x35971f=_[_0x8d70('0x45')]({},_0x35971f,_0x409fae['options']);return db[_0x8d70('0x47')][_0x8d70('0x4d')](_0x35971f)[_0x8d70('0x29')](handleEntityNotFound(_0x59b793,null))['then'](respondWithResult(_0x59b793,null))[_0x8d70('0x4b')](handleError(_0x59b793,null));};exports[_0x8d70('0x4e')]=function(_0x36f821,_0x3f10f8){return db['WhatsappQueue'][_0x8d70('0x4e')](_0x36f821[_0x8d70('0x4f')],{})[_0x8d70('0x29')](function(_0xeac05c){var _0x31c282=_0x36f821[_0x8d70('0x50')][_0x8d70('0x2b')]({'plain':!![]});if(!_0x31c282)throw new Error(_0x8d70('0x51'));if(_0x31c282[_0x8d70('0x52')]===_0x8d70('0x50')){var _0x2b868f=_0xeac05c[_0x8d70('0x2b')]({'plain':!![]});var _0xb26b29=_0x8d70('0x2c');return db['UserProfileSection'][_0x8d70('0x4d')]({'where':{'name':_0xb26b29,'userProfileId':_0x31c282[_0x8d70('0x53')]},'raw':!![]})[_0x8d70('0x29')](function(_0x3c88d8){if(_0x3c88d8&&_0x3c88d8[_0x8d70('0x54')]===0x0){return db['UserProfileResource'][_0x8d70('0x4e')]({'name':_0x2b868f[_0x8d70('0x30')],'resourceId':_0x2b868f['id'],'type':_0x3c88d8[_0x8d70('0x30')],'sectionId':_0x3c88d8['id']},{})['then'](function(){return _0xeac05c;});}else{return _0xeac05c;}})['catch'](function(_0x31921c){logger['error'](_0x8d70('0x55'),_0x31921c);throw _0x31921c;});}return _0xeac05c;})['then'](respondWithResult(_0x3f10f8,0xc9))[_0x8d70('0x4b')](handleError(_0x3f10f8,null));};exports[_0x8d70('0x28')]=function(_0x405bc8,_0x15df27){if(_0x405bc8[_0x8d70('0x4f')]['id']){delete _0x405bc8[_0x8d70('0x4f')]['id'];}return db['WhatsappQueue'][_0x8d70('0x4d')]({'where':{'id':_0x405bc8[_0x8d70('0x56')]['id']}})[_0x8d70('0x29')](handleEntityNotFound(_0x15df27,null))[_0x8d70('0x29')](saveUpdates(_0x405bc8[_0x8d70('0x4f')],null))[_0x8d70('0x29')](respondWithResult(_0x15df27,null))['catch'](handleError(_0x15df27,null));};exports['destroy']=function(_0x25e2af,_0x1f38ae){return db['WhatsappQueue'][_0x8d70('0x4d')]({'where':{'id':_0x25e2af[_0x8d70('0x56')]['id']}})[_0x8d70('0x29')](handleEntityNotFound(_0x1f38ae,null))[_0x8d70('0x29')](removeEntity(_0x1f38ae,null))[_0x8d70('0x4b')](handleError(_0x1f38ae,null));};exports[_0x8d70('0x57')]=function(_0x2854c6,_0x45b871){return db[_0x8d70('0x47')][_0x8d70('0x57')]()[_0x8d70('0x29')](respondWithResult(_0x45b871,null))['catch'](handleError(_0x45b871,null));};exports[_0x8d70('0x58')]=function(_0x1b0d91,_0x52104b,_0x34996c){var _0xc7a0cf={'raw':!![],'where':{}},_0x37024f={},_0xf8297e;return db[_0x8d70('0x47')][_0x8d70('0x59')]({'where':{'id':_0x1b0d91[_0x8d70('0x56')]['id']}})[_0x8d70('0x29')](handleEntityNotFound(_0x52104b,null))[_0x8d70('0x29')](function(_0x3bdc23){if(_0x3bdc23){_0xf8297e=_0x3bdc23[_0x8d70('0x2b')]({'plain':!![]});_0x37024f[_0x8d70('0x38')]=_[_0x8d70('0x5a')](db[_0x8d70('0x5b')]['rawAttributes']);_0x37024f[_0x8d70('0x39')]=_[_0x8d70('0x5a')](_0x1b0d91[_0x8d70('0x39')]);_0x37024f['filters']=_['intersection'](_0x37024f[_0x8d70('0x38')],_0x37024f[_0x8d70('0x39')]);_0xc7a0cf[_0x8d70('0x3b')]=_[_0x8d70('0x3c')](_0x37024f[_0x8d70('0x38')],qs[_0x8d70('0x3d')](_0x1b0d91[_0x8d70('0x39')]['fields']));_0xc7a0cf[_0x8d70('0x3b')]=_0xc7a0cf[_0x8d70('0x3b')][_0x8d70('0x4c')]?_0xc7a0cf[_0x8d70('0x3b')]:_0x37024f[_0x8d70('0x38')];if(!_0x1b0d91[_0x8d70('0x39')]['hasOwnProperty'](_0x8d70('0x3f'))){_0xc7a0cf[_0x8d70('0x24')]=qs[_0x8d70('0x24')](_0x1b0d91[_0x8d70('0x39')][_0x8d70('0x24')]);_0xc7a0cf[_0x8d70('0x22')]=qs[_0x8d70('0x22')](_0x1b0d91['query'][_0x8d70('0x22')]);}_0xc7a0cf[_0x8d70('0x40')]=qs[_0x8d70('0x41')](_0x1b0d91['query'][_0x8d70('0x41')]);_0xc7a0cf[_0x8d70('0x43')]=qs[_0x8d70('0x3a')](_['pick'](_0x1b0d91[_0x8d70('0x39')],_0x37024f[_0x8d70('0x3a')]));_0xc7a0cf[_0x8d70('0x43')]['WhatsappQueueId']=_0x3bdc23['id'];if(_0x1b0d91[_0x8d70('0x39')][_0x8d70('0x42')]){_0xc7a0cf['where']=_[_0x8d70('0x45')](_0xc7a0cf[_0x8d70('0x43')],{'$or':_['map'](_0xc7a0cf[_0x8d70('0x3b')],function(_0x319e49){var _0x2f2569={};_0x2f2569[_0x319e49]={'$like':'%'+_0x1b0d91[_0x8d70('0x39')][_0x8d70('0x42')]+'%'};return _0x2f2569;})});}_0xc7a0cf=_[_0x8d70('0x45')]({},_0xc7a0cf,_0x1b0d91[_0x8d70('0x46')]);return db[_0x8d70('0x5b')]['findAll'](_0xc7a0cf);}})['then'](function(_0xcef810){if(_0xcef810){return db['User'][_0x8d70('0x5c')]({'where':{'id':_[_0x8d70('0x33')](_0xcef810,_0x8d70('0x5d')),'role':_0x8d70('0x5e')},'attributes':['id',_0x8d70('0x30'),_0x8d70('0x5f'),'updatedAt',_0x8d70('0x60')]});}})['then'](function(_0x121230){if(_0x121230){return{'count':_0x121230['count'],'rows':_[_0x8d70('0x33')](_0x121230[_0x8d70('0x61')],function(_0x20c7e0){return{'membername':_0x20c7e0['name'],'UserId':_0x20c7e0['id'],'queue_name':_0xf8297e['name'],'WhatsappQueueId':_0xf8297e['id'],'interface':util[_0x8d70('0x62')](_0x8d70('0x63'),_0x8d70('0x64'),_0x20c7e0['name']),'penalty':0x0,'paused':_0x20c7e0['whatsappPause'],'createdAt':_0x20c7e0['createdAt'],'updatedAt':_0x20c7e0[_0x8d70('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8d70('0x29')](respondWithFilteredResult(_0x52104b,_0xc7a0cf))[_0x8d70('0x4b')](handleError(_0x52104b,null));};exports[_0x8d70('0x66')]=function(_0x5162de,_0x1712a5,_0x198608){var _0x468739={};var _0xab8cd9={};var _0x1bea58;var _0x57dfb2;return db['WhatsappQueue']['findOne']({'where':{'id':_0x5162de[_0x8d70('0x56')]['id']}})[_0x8d70('0x29')](handleEntityNotFound(_0x1712a5,null))[_0x8d70('0x29')](function(_0x4795c4){if(_0x4795c4){_0x1bea58=_0x4795c4;_0xab8cd9[_0x8d70('0x38')]=_[_0x8d70('0x5a')](db[_0x8d70('0x67')][_0x8d70('0x34')]);_0xab8cd9[_0x8d70('0x39')]=_['keys'](_0x5162de[_0x8d70('0x39')]);_0xab8cd9[_0x8d70('0x3a')]=_['intersection'](_0xab8cd9[_0x8d70('0x38')],_0xab8cd9[_0x8d70('0x39')]);_0x468739[_0x8d70('0x3b')]=_[_0x8d70('0x3c')](_0xab8cd9[_0x8d70('0x38')],qs['fields'](_0x5162de[_0x8d70('0x39')][_0x8d70('0x3d')]));_0x468739[_0x8d70('0x3b')]=_0x468739['attributes'][_0x8d70('0x4c')]?_0x468739[_0x8d70('0x3b')]:_0xab8cd9[_0x8d70('0x38')];_0x468739[_0x8d70('0x40')]=qs[_0x8d70('0x41')](_0x5162de[_0x8d70('0x39')][_0x8d70('0x41')]);_0x468739['where']=qs[_0x8d70('0x3a')](_['pick'](_0x5162de[_0x8d70('0x39')],_0xab8cd9[_0x8d70('0x3a')]));if(_0x5162de['query'][_0x8d70('0x42')]){_0x468739['where']=_[_0x8d70('0x45')](_0x468739[_0x8d70('0x43')],{'$or':_[_0x8d70('0x33')](_0x468739['attributes'],function(_0x4eb0b5){var _0x3cf5cd={};_0x3cf5cd[_0x4eb0b5]={'$like':'%'+_0x5162de['query'][_0x8d70('0x42')]+'%'};return _0x3cf5cd;})});}_0x468739=_[_0x8d70('0x45')]({},_0x468739,_0x5162de[_0x8d70('0x46')]);return _0x1bea58['getTeams'](_0x468739);}})[_0x8d70('0x29')](function(_0x212bdf){if(_0x212bdf){_0x57dfb2=_0x212bdf[_0x8d70('0x4c')];if(!_0x5162de[_0x8d70('0x39')]['hasOwnProperty'](_0x8d70('0x3f'))){_0x468739['limit']=qs[_0x8d70('0x24')](_0x5162de[_0x8d70('0x39')]['limit']);_0x468739[_0x8d70('0x22')]=qs[_0x8d70('0x22')](_0x5162de['query'][_0x8d70('0x22')]);}return _0x1bea58['getTeams'](_0x468739);}})[_0x8d70('0x29')](function(_0x4c4448){if(_0x4c4448){return _0x4c4448?{'count':_0x57dfb2,'rows':_0x4c4448}:null;}})[_0x8d70('0x29')](respondWithResult(_0x1712a5,null))[_0x8d70('0x4b')](handleError(_0x1712a5,null));};exports['addTeams']=function(_0x5cf5ea,_0x28101c,_0x125d26){var _0x111018=_0x5cf5ea[_0x8d70('0x4f')]['ids'];return db[_0x8d70('0x67')][_0x8d70('0x4a')]({'where':{'id':_0x111018},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8d70('0x68'),'attributes':['id',_0x8d70('0x30'),_0x8d70('0x69'),_0x8d70('0x6a'),_0x8d70('0x6b')],'raw':!![]}]})[_0x8d70('0x29')](function(_0x33e4fa){if(_0x33e4fa){var _0x517836=_[_0x8d70('0x6c')](_0x33e4fa,function(_0x5df052){var _0x22752c=_0x5df052[_0x8d70('0x2b')]({'plain':!![]});return _0x22752c[_0x8d70('0x68')];});return db[_0x8d70('0x47')][_0x8d70('0x4d')]({'where':{'id':_0x5cf5ea[_0x8d70('0x56')]['id']}})[_0x8d70('0x29')](function(_0x4bcad2){return db[_0x8d70('0x6d')][_0x8d70('0x6e')](function(_0x1d9832){return _0x4bcad2[_0x8d70('0x6f')](_0x111018,{'transaction':_0x1d9832})['then'](function(){return BPromise[_0x8d70('0x70')](_0x517836,function(_0x1d2596){return db[_0x8d70('0x5b')][_0x8d70('0x71')]({'where':{'UserId':_0x1d2596['id'],'WhatsappQueueId':_0x5cf5ea[_0x8d70('0x56')]['id']},'transaction':_0x1d9832});});})['then'](function(){_0x517836[_0x8d70('0x72')](function(_0x2321fd){socket[_0x8d70('0x73')](_0x8d70('0x74'),{'UserId':_0x2321fd['id'],'WhatsappQueueId':_0x4bcad2['id']});});});});});}})['then'](respondWithStatusCode(_0x28101c,null))['catch'](handleError(_0x28101c,null));};exports['removeTeams']=function(_0x48a8bf,_0x3cc716,_0x410f89){return db[_0x8d70('0x67')][_0x8d70('0x4a')]({'where':{'id':_0x48a8bf['query'][_0x8d70('0x75')]},'attributes':['id'],'include':[{'model':db[_0x8d70('0x76')],'as':_0x8d70('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3cc716,null))['then'](function(_0x3e82fb){var _0xd2b7ea=_['map'](_0x3e82fb,'id');var _0x442d39=[];var _0x14d389=[];var _0x3df78d=squel['select']();_0x3df78d[_0x8d70('0x77')](_0x8d70('0x78'))[_0x8d70('0x79')](_0x8d70('0x7a'),'tq')['join'](_0x8d70('0x7b'),'ut',_0x8d70('0x7c'))['where'](_0x8d70('0x7d'),_0x48a8bf[_0x8d70('0x56')]['id']);for(var _0x186fa2=0x0;_0x186fa2<_0x3e82fb[_0x8d70('0x4c')];_0x186fa2+=0x1){let _0x10dbef=_0x3e82fb[_0x186fa2];for(var _0x2f38a9=0x0;_0x2f38a9<_0x10dbef[_0x8d70('0x68')][_0x8d70('0x4c')];_0x2f38a9+=0x1){let _0x57e507=_0x10dbef[_0x8d70('0x68')][_0x2f38a9];var _0x3ed763=_0x3df78d[_0x8d70('0x7e')]();_0x3ed763['where']('ut.UserId\x20=\x20?',_0x57e507['id']);_0x14d389[_0x8d70('0x7f')](db[_0x8d70('0x6d')][_0x8d70('0x39')](_0x3ed763[_0x8d70('0x80')](),{'type':db[_0x8d70('0x6d')][_0x8d70('0x81')][_0x8d70('0x82')]})[_0x8d70('0x29')](function(_0x396b5b){if(_0x396b5b[_0x8d70('0x4c')]===0x1){return _0x57e507['id'];}else{var _0x559ac6=_[_0x8d70('0x83')](_['map'](_0x396b5b,_0x8d70('0x84')),function(_0x5e5d73){return _[_0x8d70('0x85')](_0xd2b7ea,_0x5e5d73);});if(_0x559ac6){return _0x57e507['id'];}}}));}}return BPromise[_0x8d70('0x86')](_0x14d389)[_0x8d70('0x29')](function(_0x1758f0){_0x442d39=_(_0x442d39)[_0x8d70('0x87')](_0x1758f0)[_0x8d70('0x88')]()[_0x8d70('0x89')]();return db[_0x8d70('0x47')][_0x8d70('0x4d')]({'where':{'id':_0x48a8bf['params']['id']}})[_0x8d70('0x29')](function(_0x2254e3){return db[_0x8d70('0x6d')]['transaction'](function(_0x508317){return _0x2254e3[_0x8d70('0x8a')](_0x48a8bf[_0x8d70('0x39')][_0x8d70('0x75')],{'transaction':_0x508317})[_0x8d70('0x29')](function(){if(!_['isEmpty'](_0x442d39)){return _0x2254e3['removeAgents'](_0x442d39,{'transaction':_0x508317});}})['then'](function(){_0x442d39[_0x8d70('0x72')](function(_0x348f94){socket[_0x8d70('0x73')](_0x8d70('0x8b'),{'UserId':_0x348f94,'WhatsappQueueId':_0x2254e3['id']});});});});});});})['then'](respondWithStatusCode(_0x3cc716,null))[_0x8d70('0x4b')](handleError(_0x3cc716,null));};exports['addAgents']=function(_0x334548,_0xf5dbe3,_0x4a1e66){return db['WhatsappQueue'][_0x8d70('0x4d')]({'where':{'id':_0x334548[_0x8d70('0x56')]['id']}})['then'](handleEntityNotFound(_0xf5dbe3,null))[_0x8d70('0x29')](function(_0x4f9e6a){if(_0x4f9e6a){return _0x4f9e6a[_0x8d70('0x8c')](_0x334548[_0x8d70('0x4f')][_0x8d70('0x75')],_[_0x8d70('0x8d')](_0x334548[_0x8d70('0x4f')],[_0x8d70('0x75'),'id'])||{})[_0x8d70('0x8e')](function(_0x2b7dff){for(var _0x105143=0x0;_0x105143<_0x334548[_0x8d70('0x4f')]['ids'][_0x8d70('0x4c')];_0x105143+=0x1){socket[_0x8d70('0x73')]('userWhatsappQueue:save',{'UserId':Number(_0x334548[_0x8d70('0x4f')][_0x8d70('0x75')][_0x105143]),'WhatsappQueueId':Number(_0x334548['params']['id'])});}return _0x2b7dff;});}})[_0x8d70('0x29')](respondWithResult(_0xf5dbe3,null))[_0x8d70('0x4b')](handleError(_0xf5dbe3,null));};exports[_0x8d70('0x8f')]=function(_0xe523c9,_0x1ac273,_0x30dfe5){return db[_0x8d70('0x47')][_0x8d70('0x4d')]({'where':{'id':_0xe523c9[_0x8d70('0x56')]['id']}})[_0x8d70('0x29')](handleEntityNotFound(_0x1ac273,null))[_0x8d70('0x29')](function(_0x135c8e){if(_0x135c8e){return _0x135c8e[_0x8d70('0x8f')](_0xe523c9[_0x8d70('0x39')]['ids'])['then'](function(){if(_[_0x8d70('0x90')](_0xe523c9[_0x8d70('0x39')][_0x8d70('0x75')])){for(var _0x2a56e5=0x0;_0x2a56e5<_0xe523c9[_0x8d70('0x39')][_0x8d70('0x75')][_0x8d70('0x4c')];_0x2a56e5+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0xe523c9[_0x8d70('0x39')][_0x8d70('0x75')][_0x2a56e5]),'WhatsappQueueId':Number(_0xe523c9[_0x8d70('0x56')]['id'])});}}else{socket[_0x8d70('0x73')](_0x8d70('0x8b'),{'UserId':Number(_0xe523c9['query']['ids']),'WhatsappQueueId':Number(_0xe523c9['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1ac273,null))[_0x8d70('0x4b')](handleError(_0x1ac273,null));};exports[_0x8d70('0x91')]=function(_0x484aae,_0x2a7da5,_0x436c96){var _0x2bad77={};var _0x3143f4={};var _0x54d8c2;var _0x37f771;return db['WhatsappQueue'][_0x8d70('0x59')]({'where':{'id':_0x484aae[_0x8d70('0x56')]['id']}})[_0x8d70('0x29')](handleEntityNotFound(_0x2a7da5,null))['then'](function(_0x1bf87d){if(_0x1bf87d){_0x54d8c2=_0x1bf87d;_0x3143f4['model']=_[_0x8d70('0x5a')](db[_0x8d70('0x76')][_0x8d70('0x34')]);_0x3143f4[_0x8d70('0x39')]=_[_0x8d70('0x5a')](_0x484aae['query']);_0x3143f4['filters']=_[_0x8d70('0x3c')](_0x3143f4['model'],_0x3143f4[_0x8d70('0x39')]);_0x2bad77[_0x8d70('0x3b')]=_[_0x8d70('0x3c')](_0x3143f4[_0x8d70('0x38')],qs[_0x8d70('0x3d')](_0x484aae[_0x8d70('0x39')][_0x8d70('0x3d')]));_0x2bad77['attributes']=_0x2bad77[_0x8d70('0x3b')][_0x8d70('0x4c')]?_0x2bad77[_0x8d70('0x3b')]:_0x3143f4[_0x8d70('0x38')];_0x2bad77[_0x8d70('0x40')]=qs[_0x8d70('0x41')](_0x484aae[_0x8d70('0x39')][_0x8d70('0x41')]);_0x2bad77[_0x8d70('0x43')]=qs['filters'](_['pick'](_0x484aae[_0x8d70('0x39')],_0x3143f4['filters']));if(_0x484aae['query']['filter']){_0x2bad77[_0x8d70('0x43')]=_[_0x8d70('0x45')](_0x2bad77[_0x8d70('0x43')],{'$or':_[_0x8d70('0x33')](_0x2bad77[_0x8d70('0x3b')],function(_0x521965){var _0x47668c={};_0x47668c[_0x521965]={'$like':'%'+_0x484aae[_0x8d70('0x39')][_0x8d70('0x42')]+'%'};return _0x47668c;})});}_0x2bad77=_[_0x8d70('0x45')]({},_0x2bad77,_0x484aae[_0x8d70('0x46')]);return _0x54d8c2[_0x8d70('0x91')](_0x2bad77);}})[_0x8d70('0x29')](function(_0xb36658){if(_0xb36658){_0x37f771=_0xb36658['length'];if(!_0x484aae[_0x8d70('0x39')]['hasOwnProperty']('nolimit')){_0x2bad77[_0x8d70('0x24')]=qs[_0x8d70('0x24')](_0x484aae[_0x8d70('0x39')][_0x8d70('0x24')]);_0x2bad77[_0x8d70('0x22')]=qs[_0x8d70('0x22')](_0x484aae['query'][_0x8d70('0x22')]);}return _0x54d8c2[_0x8d70('0x91')](_0x2bad77);}})[_0x8d70('0x29')](function(_0x367c2d){if(_0x367c2d){return _0x367c2d?{'count':_0x37f771,'rows':_0x367c2d}:null;}})[_0x8d70('0x29')](respondWithResult(_0x2a7da5,null))[_0x8d70('0x4b')](handleError(_0x2a7da5,null));}; \ No newline at end of file +var _0x5bde=['voicePause','interface','flatMap','sequelize','transaction','addTeams','userWhatsappQueue:save','ids','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','compact','value','removeTeams','isEmpty','removeAgents','forEach','emit','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','end','stack','name','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','User','UserId','agent','whatsappPause','updatedAt','createdAt','%s/%s','getTeams','Team','Agents','online'];(function(_0x438283,_0x4961ae){var _0x62b5ab=function(_0x289958){while(--_0x289958){_0x438283['push'](_0x438283['shift']());}};_0x62b5ab(++_0x4961ae);}(_0x5bde,0x1c6));var _0xe5bd=function(_0x172dc4,_0xef717){_0x172dc4=_0x172dc4-0x0;var _0xb8e080=_0x5bde[_0x172dc4];return _0xb8e080;};'use strict';var emlformat=require(_0xe5bd('0x0'));var rimraf=require(_0xe5bd('0x1'));var zipdir=require(_0xe5bd('0x2'));var jsonpatch=require(_0xe5bd('0x3'));var rp=require('request-promise');var moment=require(_0xe5bd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe5bd('0x5'));var util=require(_0xe5bd('0x6'));var path=require(_0xe5bd('0x7'));var sox=require(_0xe5bd('0x8'));var csv=require(_0xe5bd('0x9'));var ejs=require(_0xe5bd('0xa'));var fs=require('fs');var fs_extra=require(_0xe5bd('0xb'));var _=require(_0xe5bd('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe5bd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe5bd('0x9'));var querystring=require(_0xe5bd('0xe'));var Papa=require('papaparse');var Redis=require(_0xe5bd('0xf'));var authService=require(_0xe5bd('0x10'));var qs=require(_0xe5bd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5bd('0x12'))(_0xe5bd('0x13'));var utils=require('../../config/utils');var config=require(_0xe5bd('0x14'));var licenseUtil=require(_0xe5bd('0x15'));var db=require('../../mysqldb')['db'];config[_0xe5bd('0x16')]=_[_0xe5bd('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe5bd('0x18'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0xe5bd('0x19')](socket);function respondWithStatusCode(_0x226827,_0x57adb1){_0x57adb1=_0x57adb1||0xcc;return function(_0x2cd7bf){if(_0x2cd7bf){return _0x226827[_0xe5bd('0x1a')](_0x57adb1);}return _0x226827[_0xe5bd('0x1b')](_0x57adb1)['end']();};}function respondWithResult(_0x155d4d,_0x2825aa){_0x2825aa=_0x2825aa||0xc8;return function(_0x3662b8){if(_0x3662b8){return _0x155d4d[_0xe5bd('0x1b')](_0x2825aa)[_0xe5bd('0x1c')](_0x3662b8);}};}function respondWithFilteredResult(_0x3179d9,_0x1e7047){return function(_0x25e3a0){if(_0x25e3a0){var _0x4304a2=typeof _0x1e7047[_0xe5bd('0x1d')]==='undefined'&&typeof _0x1e7047[_0xe5bd('0x1e')]===_0xe5bd('0x1f');var _0x5db591=_0x25e3a0[_0xe5bd('0x20')];var _0x40b904=_0x4304a2?0x0:_0x1e7047[_0xe5bd('0x1d')];var _0x12824a=_0x4304a2?_0x25e3a0[_0xe5bd('0x20')]:_0x1e7047[_0xe5bd('0x1d')]+_0x1e7047[_0xe5bd('0x1e')];var _0x20573b;if(_0x12824a>=_0x5db591){_0x12824a=_0x5db591;_0x20573b=0xc8;}else{_0x20573b=0xce;}_0x3179d9[_0xe5bd('0x1b')](_0x20573b);return _0x3179d9[_0xe5bd('0x21')](_0xe5bd('0x22'),_0x40b904+'-'+_0x12824a+'/'+_0x5db591)[_0xe5bd('0x1c')](_0x25e3a0);}return null;};}function patchUpdates(_0x34d885){return function(_0x43932c){try{jsonpatch['apply'](_0x43932c,_0x34d885,!![]);}catch(_0x42609f){return BPromise[_0xe5bd('0x23')](_0x42609f);}return _0x43932c[_0xe5bd('0x24')]();};}function saveUpdates(_0x4fc6c3,_0x548da3){return function(_0x5c50d8){if(_0x5c50d8){return _0x5c50d8[_0xe5bd('0x25')](_0x4fc6c3)[_0xe5bd('0x26')](function(_0x211f8a){return _0x211f8a;});}return null;};}function removeEntity(_0xe9233e,_0x111808){return function(_0x8c0bd1){if(_0x8c0bd1){return _0x8c0bd1[_0xe5bd('0x27')]()['then'](function(){var _0x7f620d=_0x8c0bd1[_0xe5bd('0x28')]({'plain':!![]});var _0x386032=_0xe5bd('0x29');return db[_0xe5bd('0x2a')][_0xe5bd('0x27')]({'where':{'type':_0x386032,'resourceId':_0x7f620d['id']}})[_0xe5bd('0x26')](function(){return _0x8c0bd1;});})[_0xe5bd('0x26')](function(){_0xe9233e[_0xe5bd('0x1b')](0xcc)[_0xe5bd('0x2b')]();});}};}function handleEntityNotFound(_0x45f4e0,_0x51abd3){return function(_0x24602c){if(!_0x24602c){_0x45f4e0[_0xe5bd('0x1a')](0x194);}return _0x24602c;};}function handleError(_0x8a7394,_0x4e7ac8){_0x4e7ac8=_0x4e7ac8||0x1f4;return function(_0x1bef8c){logger['error'](_0x1bef8c[_0xe5bd('0x2c')]);if(_0x1bef8c[_0xe5bd('0x2d')]){delete _0x1bef8c['name'];}_0x8a7394[_0xe5bd('0x1b')](_0x4e7ac8)['send'](_0x1bef8c);};}exports[_0xe5bd('0x2e')]=function(_0x539e54,_0x43f1f7){var _0x2dbbb2={},_0x495739={},_0x496a32={'count':0x0,'rows':[]};var _0x3c60a=_[_0xe5bd('0x2f')](db[_0xe5bd('0x30')][_0xe5bd('0x31')],function(_0x5f040e){return{'name':_0x5f040e[_0xe5bd('0x32')],'type':_0x5f040e[_0xe5bd('0x33')][_0xe5bd('0x34')]};});_0x495739['model']=_[_0xe5bd('0x2f')](_0x3c60a,'name');_0x495739[_0xe5bd('0x35')]=_[_0xe5bd('0x36')](_0x539e54[_0xe5bd('0x35')]);_0x495739[_0xe5bd('0x37')]=_[_0xe5bd('0x38')](_0x495739[_0xe5bd('0x39')],_0x495739['query']);_0x2dbbb2[_0xe5bd('0x3a')]=_['intersection'](_0x495739['model'],qs[_0xe5bd('0x3b')](_0x539e54[_0xe5bd('0x35')][_0xe5bd('0x3b')]));_0x2dbbb2[_0xe5bd('0x3a')]=_0x2dbbb2[_0xe5bd('0x3a')][_0xe5bd('0x3c')]?_0x2dbbb2[_0xe5bd('0x3a')]:_0x495739['model'];if(!_0x539e54['query'][_0xe5bd('0x3d')](_0xe5bd('0x3e'))){_0x2dbbb2[_0xe5bd('0x1e')]=qs[_0xe5bd('0x1e')](_0x539e54[_0xe5bd('0x35')][_0xe5bd('0x1e')]);_0x2dbbb2[_0xe5bd('0x1d')]=qs['offset'](_0x539e54[_0xe5bd('0x35')][_0xe5bd('0x1d')]);}_0x2dbbb2[_0xe5bd('0x3f')]=qs[_0xe5bd('0x40')](_0x539e54[_0xe5bd('0x35')][_0xe5bd('0x40')]);_0x2dbbb2['where']=qs[_0xe5bd('0x37')](_[_0xe5bd('0x41')](_0x539e54['query'],_0x495739[_0xe5bd('0x37')]),_0x3c60a);if(_0x539e54['query']['filter']){_0x2dbbb2[_0xe5bd('0x42')]=_[_0xe5bd('0x43')](_0x2dbbb2[_0xe5bd('0x42')],{'$or':_[_0xe5bd('0x2f')](_0x3c60a,function(_0x2c395a){if(_0x2c395a['type']!==_0xe5bd('0x44')){var _0xf2238c={};_0xf2238c[_0x2c395a['name']]={'$like':'%'+_0x539e54['query'][_0xe5bd('0x45')]+'%'};return _0xf2238c;}})});}_0x2dbbb2=_[_0xe5bd('0x43')]({},_0x2dbbb2,_0x539e54['options']);var _0x2495e4={'where':_0x2dbbb2[_0xe5bd('0x42')]};return db[_0xe5bd('0x30')][_0xe5bd('0x20')](_0x2495e4)['then'](function(_0xa9ada6){_0x496a32[_0xe5bd('0x20')]=_0xa9ada6;if(_0x539e54[_0xe5bd('0x35')][_0xe5bd('0x46')]){_0x2dbbb2[_0xe5bd('0x47')]=[{'all':!![]}];}return db[_0xe5bd('0x30')][_0xe5bd('0x48')](_0x2dbbb2);})['then'](function(_0x1392a3){_0x496a32[_0xe5bd('0x49')]=_0x1392a3;return _0x496a32;})[_0xe5bd('0x26')](respondWithFilteredResult(_0x43f1f7,_0x2dbbb2))[_0xe5bd('0x4a')](handleError(_0x43f1f7,null));};exports[_0xe5bd('0x4b')]=function(_0x3af418,_0x5f5233){var _0x3e0edd={'raw':!![],'where':{'id':_0x3af418[_0xe5bd('0x4c')]['id']}},_0x430264={};_0x430264['model']=_['keys'](db['WhatsappQueue']['rawAttributes']);_0x430264[_0xe5bd('0x35')]=_['keys'](_0x3af418['query']);_0x430264['filters']=_['intersection'](_0x430264['model'],_0x430264[_0xe5bd('0x35')]);_0x3e0edd['attributes']=_['intersection'](_0x430264['model'],qs['fields'](_0x3af418['query']['fields']));_0x3e0edd[_0xe5bd('0x3a')]=_0x3e0edd[_0xe5bd('0x3a')][_0xe5bd('0x3c')]?_0x3e0edd[_0xe5bd('0x3a')]:_0x430264[_0xe5bd('0x39')];if(_0x3af418[_0xe5bd('0x35')][_0xe5bd('0x46')]){_0x3e0edd[_0xe5bd('0x47')]=[{'all':!![]}];}_0x3e0edd=_['merge']({},_0x3e0edd,_0x3af418[_0xe5bd('0x4d')]);return db[_0xe5bd('0x30')][_0xe5bd('0x4e')](_0x3e0edd)[_0xe5bd('0x26')](handleEntityNotFound(_0x5f5233,null))[_0xe5bd('0x26')](respondWithResult(_0x5f5233,null))[_0xe5bd('0x4a')](handleError(_0x5f5233,null));};exports[_0xe5bd('0x4f')]=function(_0xcf0e7c,_0x305f0b){return db[_0xe5bd('0x30')]['create'](_0xcf0e7c['body'],{})['then'](function(_0x4119ec){var _0x449e08=_0xcf0e7c[_0xe5bd('0x50')][_0xe5bd('0x28')]({'plain':!![]});if(!_0x449e08)throw new Error(_0xe5bd('0x51'));if(_0x449e08['role']===_0xe5bd('0x50')){var _0x4f74f7=_0x4119ec[_0xe5bd('0x28')]({'plain':!![]});var _0x24b143=_0xe5bd('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x24b143,'userProfileId':_0x449e08[_0xe5bd('0x52')]},'raw':!![]})[_0xe5bd('0x26')](function(_0x5190c4){if(_0x5190c4&&_0x5190c4[_0xe5bd('0x53')]===0x0){return db[_0xe5bd('0x2a')][_0xe5bd('0x4f')]({'name':_0x4f74f7['name'],'resourceId':_0x4f74f7['id'],'type':_0x5190c4[_0xe5bd('0x2d')],'sectionId':_0x5190c4['id']},{})[_0xe5bd('0x26')](function(){return _0x4119ec;});}else{return _0x4119ec;}})[_0xe5bd('0x4a')](function(_0x3832c5){logger[_0xe5bd('0x54')](_0xe5bd('0x55'),_0x3832c5);throw _0x3832c5;});}return _0x4119ec;})[_0xe5bd('0x26')](respondWithResult(_0x305f0b,0xc9))['catch'](handleError(_0x305f0b,null));};exports['update']=function(_0x368894,_0x38fc12){if(_0x368894['body']['id']){delete _0x368894[_0xe5bd('0x56')]['id'];}return db['WhatsappQueue'][_0xe5bd('0x4e')]({'where':{'id':_0x368894[_0xe5bd('0x4c')]['id']}})[_0xe5bd('0x26')](handleEntityNotFound(_0x38fc12,null))[_0xe5bd('0x26')](saveUpdates(_0x368894['body'],null))[_0xe5bd('0x26')](respondWithResult(_0x38fc12,null))['catch'](handleError(_0x38fc12,null));};exports[_0xe5bd('0x27')]=function(_0x536c6a,_0x2c2c65){return db['WhatsappQueue']['find']({'where':{'id':_0x536c6a[_0xe5bd('0x4c')]['id']}})[_0xe5bd('0x26')](handleEntityNotFound(_0x2c2c65,null))[_0xe5bd('0x26')](removeEntity(_0x2c2c65,null))[_0xe5bd('0x4a')](handleError(_0x2c2c65,null));};exports['describe']=function(_0x1c8b9d,_0x2971f4){return db[_0xe5bd('0x30')][_0xe5bd('0x57')]()['then'](respondWithResult(_0x2971f4,null))[_0xe5bd('0x4a')](handleError(_0x2971f4,null));};exports[_0xe5bd('0x58')]=function(_0x55e7d6,_0x5c4de8,_0x3be123){var _0x4bc99e={'raw':!![],'where':{}},_0x556ca2={},_0x381664;return db[_0xe5bd('0x30')][_0xe5bd('0x59')]({'where':{'id':_0x55e7d6['params']['id']}})['then'](handleEntityNotFound(_0x5c4de8,null))[_0xe5bd('0x26')](function(_0x50d0bf){if(_0x50d0bf){_0x381664=_0x50d0bf[_0xe5bd('0x28')]({'plain':!![]});_0x556ca2[_0xe5bd('0x39')]=_[_0xe5bd('0x36')](db[_0xe5bd('0x5a')]['rawAttributes']);_0x556ca2[_0xe5bd('0x35')]=_[_0xe5bd('0x36')](_0x55e7d6['query']);_0x556ca2[_0xe5bd('0x37')]=_[_0xe5bd('0x38')](_0x556ca2[_0xe5bd('0x39')],_0x556ca2['query']);_0x4bc99e['attributes']=_[_0xe5bd('0x38')](_0x556ca2['model'],qs[_0xe5bd('0x3b')](_0x55e7d6[_0xe5bd('0x35')][_0xe5bd('0x3b')]));_0x4bc99e[_0xe5bd('0x3a')]=_0x4bc99e[_0xe5bd('0x3a')][_0xe5bd('0x3c')]?_0x4bc99e[_0xe5bd('0x3a')]:_0x556ca2[_0xe5bd('0x39')];if(!_0x55e7d6[_0xe5bd('0x35')][_0xe5bd('0x3d')](_0xe5bd('0x3e'))){_0x4bc99e[_0xe5bd('0x1e')]=qs['limit'](_0x55e7d6[_0xe5bd('0x35')][_0xe5bd('0x1e')]);_0x4bc99e[_0xe5bd('0x1d')]=qs[_0xe5bd('0x1d')](_0x55e7d6['query'][_0xe5bd('0x1d')]);}_0x4bc99e[_0xe5bd('0x3f')]=qs[_0xe5bd('0x40')](_0x55e7d6[_0xe5bd('0x35')][_0xe5bd('0x40')]);_0x4bc99e[_0xe5bd('0x42')]=qs[_0xe5bd('0x37')](_[_0xe5bd('0x41')](_0x55e7d6[_0xe5bd('0x35')],_0x556ca2[_0xe5bd('0x37')]));_0x4bc99e[_0xe5bd('0x42')]['WhatsappQueueId']=_0x50d0bf['id'];if(_0x55e7d6['query'][_0xe5bd('0x45')]){_0x4bc99e['where']=_[_0xe5bd('0x43')](_0x4bc99e['where'],{'$or':_[_0xe5bd('0x2f')](_0x4bc99e[_0xe5bd('0x3a')],function(_0x382615){var _0x2ebe73={};_0x2ebe73[_0x382615]={'$like':'%'+_0x55e7d6[_0xe5bd('0x35')]['filter']+'%'};return _0x2ebe73;})});}_0x4bc99e=_[_0xe5bd('0x43')]({},_0x4bc99e,_0x55e7d6[_0xe5bd('0x4d')]);return db[_0xe5bd('0x5a')][_0xe5bd('0x48')](_0x4bc99e);}})['then'](function(_0x367af6){if(_0x367af6){return db[_0xe5bd('0x5b')]['findAndCountAll']({'where':{'id':_[_0xe5bd('0x2f')](_0x367af6,_0xe5bd('0x5c')),'role':_0xe5bd('0x5d')},'attributes':['id','name',_0xe5bd('0x5e'),_0xe5bd('0x5f'),_0xe5bd('0x60')]});}})[_0xe5bd('0x26')](function(_0x1cc0ce){if(_0x1cc0ce){return{'count':_0x1cc0ce[_0xe5bd('0x20')],'rows':_[_0xe5bd('0x2f')](_0x1cc0ce[_0xe5bd('0x49')],function(_0x3107eb){return{'membername':_0x3107eb[_0xe5bd('0x2d')],'UserId':_0x3107eb['id'],'queue_name':_0x381664[_0xe5bd('0x2d')],'WhatsappQueueId':_0x381664['id'],'interface':util['format'](_0xe5bd('0x61'),'SIP',_0x3107eb[_0xe5bd('0x2d')]),'penalty':0x0,'paused':_0x3107eb['whatsappPause'],'createdAt':_0x3107eb[_0xe5bd('0x60')],'updatedAt':_0x3107eb[_0xe5bd('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe5bd('0x26')](respondWithFilteredResult(_0x5c4de8,_0x4bc99e))[_0xe5bd('0x4a')](handleError(_0x5c4de8,null));};exports[_0xe5bd('0x62')]=function(_0x58c0e3,_0x59e2b7,_0x99fdda){var _0x166277={};var _0x4a81bd={};var _0x278b82;var _0x3550ec;return db[_0xe5bd('0x30')][_0xe5bd('0x59')]({'where':{'id':_0x58c0e3['params']['id']}})[_0xe5bd('0x26')](handleEntityNotFound(_0x59e2b7,null))[_0xe5bd('0x26')](function(_0x4358e6){if(_0x4358e6){_0x278b82=_0x4358e6;_0x4a81bd['model']=_[_0xe5bd('0x36')](db[_0xe5bd('0x63')][_0xe5bd('0x31')]);_0x4a81bd[_0xe5bd('0x35')]=_['keys'](_0x58c0e3[_0xe5bd('0x35')]);_0x4a81bd[_0xe5bd('0x37')]=_['intersection'](_0x4a81bd[_0xe5bd('0x39')],_0x4a81bd[_0xe5bd('0x35')]);_0x166277['attributes']=_['intersection'](_0x4a81bd[_0xe5bd('0x39')],qs[_0xe5bd('0x3b')](_0x58c0e3['query']['fields']));_0x166277['attributes']=_0x166277['attributes']['length']?_0x166277[_0xe5bd('0x3a')]:_0x4a81bd[_0xe5bd('0x39')];_0x166277[_0xe5bd('0x3f')]=qs[_0xe5bd('0x40')](_0x58c0e3['query'][_0xe5bd('0x40')]);_0x166277[_0xe5bd('0x42')]=qs[_0xe5bd('0x37')](_['pick'](_0x58c0e3[_0xe5bd('0x35')],_0x4a81bd['filters']));if(_0x58c0e3[_0xe5bd('0x35')][_0xe5bd('0x45')]){_0x166277['where']=_[_0xe5bd('0x43')](_0x166277[_0xe5bd('0x42')],{'$or':_['map'](_0x166277['attributes'],function(_0x4cea05){var _0x17f579={};_0x17f579[_0x4cea05]={'$like':'%'+_0x58c0e3[_0xe5bd('0x35')][_0xe5bd('0x45')]+'%'};return _0x17f579;})});}_0x166277=_[_0xe5bd('0x43')]({},_0x166277,_0x58c0e3[_0xe5bd('0x4d')]);return _0x278b82[_0xe5bd('0x62')](_0x166277);}})['then'](function(_0x53e441){if(_0x53e441){_0x3550ec=_0x53e441[_0xe5bd('0x3c')];if(!_0x58c0e3['query'][_0xe5bd('0x3d')]('nolimit')){_0x166277['limit']=qs[_0xe5bd('0x1e')](_0x58c0e3[_0xe5bd('0x35')][_0xe5bd('0x1e')]);_0x166277[_0xe5bd('0x1d')]=qs[_0xe5bd('0x1d')](_0x58c0e3[_0xe5bd('0x35')]['offset']);}return _0x278b82[_0xe5bd('0x62')](_0x166277);}})[_0xe5bd('0x26')](function(_0x40c676){if(_0x40c676){return _0x40c676?{'count':_0x3550ec,'rows':_0x40c676}:null;}})[_0xe5bd('0x26')](respondWithResult(_0x59e2b7,null))[_0xe5bd('0x4a')](handleError(_0x59e2b7,null));};exports['addTeams']=function(_0x8e7438,_0x2c5173,_0x199afc){var _0x511df1=_0x8e7438['body']['ids'];return db[_0xe5bd('0x63')]['findAll']({'where':{'id':_0x511df1},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe5bd('0x64'),'attributes':['id',_0xe5bd('0x2d'),_0xe5bd('0x65'),_0xe5bd('0x66'),_0xe5bd('0x67')],'raw':!![]}]})[_0xe5bd('0x26')](function(_0x33e90e){if(_0x33e90e){var _0x457f91=_[_0xe5bd('0x68')](_0x33e90e,function(_0x2292f1){var _0x368724=_0x2292f1['get']({'plain':!![]});return _0x368724[_0xe5bd('0x64')];});return db['WhatsappQueue']['find']({'where':{'id':_0x8e7438[_0xe5bd('0x4c')]['id']}})[_0xe5bd('0x26')](function(_0x5243d8){return db[_0xe5bd('0x69')][_0xe5bd('0x6a')](function(_0x2b7a08){return _0x5243d8[_0xe5bd('0x6b')](_0x511df1,{'transaction':_0x2b7a08})['then'](function(){return BPromise['each'](_0x457f91,function(_0x504a7f){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x504a7f['id'],'WhatsappQueueId':_0x8e7438[_0xe5bd('0x4c')]['id']},'transaction':_0x2b7a08});});})['then'](function(){_0x457f91['forEach'](function(_0x56c0cc){socket['emit'](_0xe5bd('0x6c'),{'UserId':_0x56c0cc['id'],'WhatsappQueueId':_0x5243d8['id']});});});});});}})['then'](respondWithStatusCode(_0x2c5173,null))['catch'](handleError(_0x2c5173,null));};exports['removeTeams']=function(_0x25a538,_0x3652c3,_0x51a57e){return db[_0xe5bd('0x63')][_0xe5bd('0x48')]({'where':{'id':_0x25a538[_0xe5bd('0x35')][_0xe5bd('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xe5bd('0x5b')],'as':_0xe5bd('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3652c3,null))[_0xe5bd('0x26')](function(_0x1bee94){var _0x190712=_[_0xe5bd('0x2f')](_0x1bee94,'id');var _0x1a536=[];var _0x1e5192=[];var _0x40c2d5=squel[_0xe5bd('0x6e')]();_0x40c2d5[_0xe5bd('0x6f')](_0xe5bd('0x70'))[_0xe5bd('0x71')](_0xe5bd('0x72'),'tq')[_0xe5bd('0x73')]('user_has_teams','ut',_0xe5bd('0x74'))[_0xe5bd('0x42')](_0xe5bd('0x75'),_0x25a538[_0xe5bd('0x4c')]['id']);for(var _0x1ca0a3=0x0;_0x1ca0a3<_0x1bee94[_0xe5bd('0x3c')];_0x1ca0a3+=0x1){let _0x35a749=_0x1bee94[_0x1ca0a3];for(var _0x46df88=0x0;_0x46df88<_0x35a749[_0xe5bd('0x64')][_0xe5bd('0x3c')];_0x46df88+=0x1){let _0x3dcb44=_0x35a749['Agents'][_0x46df88];var _0x55b561=_0x40c2d5[_0xe5bd('0x76')]();_0x55b561[_0xe5bd('0x42')](_0xe5bd('0x77'),_0x3dcb44['id']);_0x1e5192['push'](db['sequelize'][_0xe5bd('0x35')](_0x55b561[_0xe5bd('0x78')](),{'type':db[_0xe5bd('0x69')][_0xe5bd('0x79')][_0xe5bd('0x7a')]})[_0xe5bd('0x26')](function(_0x456fce){if(_0x456fce[_0xe5bd('0x3c')]===0x1){return _0x3dcb44['id'];}else{var _0x43adf3=_[_0xe5bd('0x7b')](_[_0xe5bd('0x2f')](_0x456fce,_0xe5bd('0x7c')),function(_0x4c62c2){return _['includes'](_0x190712,_0x4c62c2);});if(_0x43adf3){return _0x3dcb44['id'];}}}));}}return BPromise[_0xe5bd('0x7d')](_0x1e5192)[_0xe5bd('0x26')](function(_0x513c01){_0x1a536=_(_0x1a536)['union'](_0x513c01)[_0xe5bd('0x7e')]()[_0xe5bd('0x7f')]();return db[_0xe5bd('0x30')]['find']({'where':{'id':_0x25a538['params']['id']}})['then'](function(_0x1ee92b){return db['sequelize'][_0xe5bd('0x6a')](function(_0x3a3b2e){return _0x1ee92b[_0xe5bd('0x80')](_0x25a538[_0xe5bd('0x35')][_0xe5bd('0x6d')],{'transaction':_0x3a3b2e})[_0xe5bd('0x26')](function(){if(!_[_0xe5bd('0x81')](_0x1a536)){return _0x1ee92b[_0xe5bd('0x82')](_0x1a536,{'transaction':_0x3a3b2e});}})[_0xe5bd('0x26')](function(){_0x1a536[_0xe5bd('0x83')](function(_0x190ecb){socket[_0xe5bd('0x84')](_0xe5bd('0x85'),{'UserId':_0x190ecb,'WhatsappQueueId':_0x1ee92b['id']});});});});});});})[_0xe5bd('0x26')](respondWithStatusCode(_0x3652c3,null))[_0xe5bd('0x4a')](handleError(_0x3652c3,null));};exports['addAgents']=function(_0x1bd31c,_0x5e4a6f,_0x22a188){return db[_0xe5bd('0x30')][_0xe5bd('0x4e')]({'where':{'id':_0x1bd31c[_0xe5bd('0x4c')]['id']}})[_0xe5bd('0x26')](handleEntityNotFound(_0x5e4a6f,null))['then'](function(_0x168695){if(_0x168695){return _0x168695[_0xe5bd('0x86')](_0x1bd31c[_0xe5bd('0x56')][_0xe5bd('0x6d')],_[_0xe5bd('0x87')](_0x1bd31c[_0xe5bd('0x56')],['ids','id'])||{})[_0xe5bd('0x88')](function(_0x34782c){for(var _0x1686c5=0x0;_0x1686c5<_0x1bd31c[_0xe5bd('0x56')]['ids']['length'];_0x1686c5+=0x1){socket[_0xe5bd('0x84')]('userWhatsappQueue:save',{'UserId':Number(_0x1bd31c[_0xe5bd('0x56')]['ids'][_0x1686c5]),'WhatsappQueueId':Number(_0x1bd31c[_0xe5bd('0x4c')]['id'])});}return _0x34782c;});}})[_0xe5bd('0x26')](respondWithResult(_0x5e4a6f,null))[_0xe5bd('0x4a')](handleError(_0x5e4a6f,null));};exports['removeAgents']=function(_0x4c166e,_0x253cd3,_0x4289b9){return db[_0xe5bd('0x30')]['find']({'where':{'id':_0x4c166e['params']['id']}})[_0xe5bd('0x26')](handleEntityNotFound(_0x253cd3,null))[_0xe5bd('0x26')](function(_0x2406d7){if(_0x2406d7){return _0x2406d7['removeAgents'](_0x4c166e[_0xe5bd('0x35')]['ids'])[_0xe5bd('0x26')](function(){if(_[_0xe5bd('0x89')](_0x4c166e[_0xe5bd('0x35')][_0xe5bd('0x6d')])){for(var _0x341e82=0x0;_0x341e82<_0x4c166e[_0xe5bd('0x35')]['ids']['length'];_0x341e82+=0x1){socket[_0xe5bd('0x84')](_0xe5bd('0x85'),{'UserId':Number(_0x4c166e[_0xe5bd('0x35')]['ids'][_0x341e82]),'WhatsappQueueId':Number(_0x4c166e['params']['id'])});}}else{socket[_0xe5bd('0x84')](_0xe5bd('0x85'),{'UserId':Number(_0x4c166e[_0xe5bd('0x35')][_0xe5bd('0x6d')]),'WhatsappQueueId':Number(_0x4c166e[_0xe5bd('0x4c')]['id'])});}});}})[_0xe5bd('0x26')](respondWithStatusCode(_0x253cd3,null))['catch'](handleError(_0x253cd3,null));};exports['getAgents']=function(_0x475435,_0x54b627,_0x5e9100){var _0x40f80c={};var _0x17e3fb={};var _0x5b0e1e;var _0x44dcee;return db[_0xe5bd('0x30')][_0xe5bd('0x59')]({'where':{'id':_0x475435['params']['id']}})[_0xe5bd('0x26')](handleEntityNotFound(_0x54b627,null))['then'](function(_0x1fb3be){if(_0x1fb3be){_0x5b0e1e=_0x1fb3be;_0x17e3fb[_0xe5bd('0x39')]=_['keys'](db['User']['rawAttributes']);_0x17e3fb[_0xe5bd('0x35')]=_[_0xe5bd('0x36')](_0x475435[_0xe5bd('0x35')]);_0x17e3fb[_0xe5bd('0x37')]=_['intersection'](_0x17e3fb['model'],_0x17e3fb[_0xe5bd('0x35')]);_0x40f80c[_0xe5bd('0x3a')]=_[_0xe5bd('0x38')](_0x17e3fb['model'],qs[_0xe5bd('0x3b')](_0x475435[_0xe5bd('0x35')][_0xe5bd('0x3b')]));_0x40f80c[_0xe5bd('0x3a')]=_0x40f80c[_0xe5bd('0x3a')][_0xe5bd('0x3c')]?_0x40f80c[_0xe5bd('0x3a')]:_0x17e3fb[_0xe5bd('0x39')];_0x40f80c['order']=qs[_0xe5bd('0x40')](_0x475435[_0xe5bd('0x35')]['sort']);_0x40f80c[_0xe5bd('0x42')]=qs[_0xe5bd('0x37')](_[_0xe5bd('0x41')](_0x475435[_0xe5bd('0x35')],_0x17e3fb['filters']));if(_0x475435[_0xe5bd('0x35')][_0xe5bd('0x45')]){_0x40f80c[_0xe5bd('0x42')]=_['merge'](_0x40f80c[_0xe5bd('0x42')],{'$or':_[_0xe5bd('0x2f')](_0x40f80c[_0xe5bd('0x3a')],function(_0x2a0300){var _0x548e9d={};_0x548e9d[_0x2a0300]={'$like':'%'+_0x475435[_0xe5bd('0x35')][_0xe5bd('0x45')]+'%'};return _0x548e9d;})});}_0x40f80c=_['merge']({},_0x40f80c,_0x475435[_0xe5bd('0x4d')]);return _0x5b0e1e[_0xe5bd('0x8a')](_0x40f80c);}})[_0xe5bd('0x26')](function(_0x2aad8b){if(_0x2aad8b){_0x44dcee=_0x2aad8b[_0xe5bd('0x3c')];if(!_0x475435[_0xe5bd('0x35')][_0xe5bd('0x3d')](_0xe5bd('0x3e'))){_0x40f80c[_0xe5bd('0x1e')]=qs[_0xe5bd('0x1e')](_0x475435[_0xe5bd('0x35')][_0xe5bd('0x1e')]);_0x40f80c[_0xe5bd('0x1d')]=qs[_0xe5bd('0x1d')](_0x475435['query'][_0xe5bd('0x1d')]);}return _0x5b0e1e[_0xe5bd('0x8a')](_0x40f80c);}})[_0xe5bd('0x26')](function(_0x5aae7a){if(_0x5aae7a){return _0x5aae7a?{'count':_0x44dcee,'rows':_0x5aae7a}:null;}})[_0xe5bd('0x26')](respondWithResult(_0x54b627,null))['catch'](handleError(_0x54b627,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index f39ea38..72985a9 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 _0x4fca=['emit','hasOwnProperty','hook','../../mysqldb','WhatsappQueue','save'];(function(_0x2fa4ee,_0x3e1dea){var _0x11b8aa=function(_0x47d194){while(--_0x47d194){_0x2fa4ee['push'](_0x2fa4ee['shift']());}};_0x11b8aa(++_0x3e1dea);}(_0x4fca,0x93));var _0xa4fc=function(_0x8e78af,_0x11f4cd){_0x8e78af=_0x8e78af-0x0;var _0x314435=_0x4fca[_0x8e78af];return _0x314435;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xa4fc('0x0'))['db'][_0xa4fc('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa4fc('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x24f8cb){return function(_0x223b64,_0x315ded,_0x104596){WhatsappQueueEvents[_0xa4fc('0x3')](_0x24f8cb+':'+_0x223b64['id'],_0x223b64);WhatsappQueueEvents['emit'](_0x24f8cb,_0x223b64);_0x104596(null);};}for(var e in events){if(events[_0xa4fc('0x4')](e)){var event=events[e];WhatsappQueue[_0xa4fc('0x5')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x1da3=['hasOwnProperty','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit'];(function(_0x27608,_0x2fd472){var _0x32eac8=function(_0x5069a7){while(--_0x5069a7){_0x27608['push'](_0x27608['shift']());}};_0x32eac8(++_0x2fd472);}(_0x1da3,0x124));var _0x31da=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1da3[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0x31da('0x0'));var WhatsappQueue=require(_0x31da('0x1'))['db'][_0x31da('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x31da('0x3')](0x0);var events={'afterCreate':_0x31da('0x4'),'afterUpdate':_0x31da('0x5'),'afterDestroy':_0x31da('0x6')};function emitEvent(_0x10b917){return function(_0x3d4097,_0x270f9a,_0x2c59b4){WhatsappQueueEvents[_0x31da('0x7')](_0x10b917+':'+_0x3d4097['id'],_0x3d4097);WhatsappQueueEvents[_0x31da('0x7')](_0x10b917,_0x3d4097);_0x2c59b4(null);};}for(var e in events){if(events[_0x31da('0x8')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x31da('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index d4d2880..efe07ed 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 _0x3729=['./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x237487,_0x21efd0){var _0x39e303=function(_0x5071e2){while(--_0x5071e2){_0x237487['push'](_0x237487['shift']());}};_0x39e303(++_0x21efd0);}(_0x3729,0xd5));var _0x9372=function(_0x1dd8d5,_0x2f2a99){_0x1dd8d5=_0x1dd8d5-0x0;var _0x5f96b0=_0x3729[_0x1dd8d5];return _0x5f96b0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9372('0x0'));var moment=require(_0x9372('0x1'));var BPromise=require(_0x9372('0x2'));var rp=require(_0x9372('0x3'));var fs=require('fs');var path=require(_0x9372('0x4'));var rimraf=require(_0x9372('0x5'));var config=require(_0x9372('0x6'));var attributes=require(_0x9372('0x7'));module[_0x9372('0x8')]=function(_0x3bcb13,_0x443a18){return _0x3bcb13['define'](_0x9372('0x9'),attributes,{'tableName':_0x9372('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44d1=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues'];(function(_0x5b04d7,_0x2bd75a){var _0x4e133a=function(_0x35619a){while(--_0x35619a){_0x5b04d7['push'](_0x5b04d7['shift']());}};_0x4e133a(++_0x2bd75a);}(_0x44d1,0x1a4));var _0x144d=function(_0x1832fc,_0x251e71){_0x1832fc=_0x1832fc-0x0;var _0x5893c1=_0x44d1[_0x1832fc];return _0x5893c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x144d('0x0'))(_0x144d('0x1'));var moment=require(_0x144d('0x2'));var BPromise=require(_0x144d('0x3'));var rp=require(_0x144d('0x4'));var fs=require('fs');var path=require(_0x144d('0x5'));var rimraf=require(_0x144d('0x6'));var config=require('../../config/environment');var attributes=require(_0x144d('0x7'));module[_0x144d('0x8')]=function(_0x288524,_0x17df6c){return _0x288524[_0x144d('0x9')](_0x144d('0xa'),attributes,{'tableName':_0x144d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index b30bc33..b8549da 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 _0x53da=['WhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','include','model','map','find','ShowWhatsappQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info'];(function(_0x3a7549,_0x5a7fe9){var _0x43e2bf=function(_0x21b81b){while(--_0x21b81b){_0x3a7549['push'](_0x3a7549['shift']());}};_0x43e2bf(++_0x5a7fe9);}(_0x53da,0xb0));var _0xa53d=function(_0x55527a,_0x1d4f3f){_0x55527a=_0x55527a-0x0;var _0xea27ae=_0x53da[_0x55527a];return _0xea27ae;};'use strict';var _=require('lodash');var util=require(_0xa53d('0x0'));var moment=require(_0xa53d('0x1'));var BPromise=require(_0xa53d('0x2'));var rs=require(_0xa53d('0x3'));var fs=require('fs');var Redis=require(_0xa53d('0x4'));var db=require(_0xa53d('0x5'))['db'];var utils=require(_0xa53d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa53d('0x7'));var jayson=require(_0xa53d('0x8'));var client=jayson[_0xa53d('0x9')][_0xa53d('0xa')]({'port':0x232a});config[_0xa53d('0xb')]=_[_0xa53d('0xc')](config['redis'],{'host':_0xa53d('0xd'),'port':0x18eb});var socket=require(_0xa53d('0xe'))(new Redis(config[_0xa53d('0xb')]));require('./whatsappQueue.socket')[_0xa53d('0xf')](socket);function respondWithRpcPromise(_0x50e386,_0x271e91,_0x4ad2df){return new BPromise(function(_0x5eaec8,_0x3dd75c){return client[_0xa53d('0x10')](_0x50e386,_0x4ad2df)[_0xa53d('0x11')](function(_0x52a00d){logger[_0xa53d('0x12')](_0xa53d('0x13'),_0x271e91,'request\x20sent');logger[_0xa53d('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x271e91,_0xa53d('0x15'),JSON[_0xa53d('0x16')](_0x52a00d));if(_0x52a00d[_0xa53d('0x17')]){if(_0x52a00d[_0xa53d('0x17')][_0xa53d('0x18')]===0x1f4){logger[_0xa53d('0x17')](_0xa53d('0x13'),_0x271e91,_0x52a00d[_0xa53d('0x17')][_0xa53d('0x19')]);return _0x3dd75c(_0x52a00d['error'][_0xa53d('0x19')]);}logger[_0xa53d('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x271e91,_0x52a00d[_0xa53d('0x17')][_0xa53d('0x19')]);return _0x5eaec8(_0x52a00d['error'][_0xa53d('0x19')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x271e91,_0xa53d('0x15'));_0x5eaec8(_0x52a00d['result']['message']);}})[_0xa53d('0x1a')](function(_0x4ac41a){logger[_0xa53d('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x271e91,_0x4ac41a);_0x3dd75c(_0x4ac41a);});});}exports[_0xa53d('0x1b')]=function(_0x3f53d8){var _0x24bc34=this;return new Promise(function(_0x169552,_0x656f35){return db[_0xa53d('0x1c')][_0xa53d('0x1d')]({'raw':_0x3f53d8[_0xa53d('0x1e')]?_0x3f53d8[_0xa53d('0x1e')][_0xa53d('0x1f')]===undefined?!![]:![]:!![],'where':_0x3f53d8[_0xa53d('0x1e')]?_0x3f53d8[_0xa53d('0x1e')][_0xa53d('0x20')]||null:null,'attributes':_0x3f53d8[_0xa53d('0x1e')]?_0x3f53d8[_0xa53d('0x1e')][_0xa53d('0x21')]||null:null,'limit':_0x3f53d8[_0xa53d('0x1e')]?_0x3f53d8[_0xa53d('0x1e')]['limit']||null:null,'include':_0x3f53d8[_0xa53d('0x1e')]?_0x3f53d8[_0xa53d('0x1e')]['include']?_['map'](_0x3f53d8[_0xa53d('0x1e')][_0xa53d('0x22')],function(_0x3e4cc3){return{'model':db[_0x3e4cc3[_0xa53d('0x23')]],'as':_0x3e4cc3['as'],'attributes':_0x3e4cc3[_0xa53d('0x21')],'include':_0x3e4cc3[_0xa53d('0x22')]?_['map'](_0x3e4cc3[_0xa53d('0x22')],function(_0x4ee9d0){return{'model':db[_0x4ee9d0[_0xa53d('0x23')]],'as':_0x4ee9d0['as'],'attributes':_0x4ee9d0[_0xa53d('0x21')],'include':_0x4ee9d0[_0xa53d('0x22')]?_[_0xa53d('0x24')](_0x4ee9d0[_0xa53d('0x22')],function(_0x19f0cf){return{'model':db[_0x19f0cf[_0xa53d('0x23')]],'as':_0x19f0cf['as'],'attributes':_0x19f0cf[_0xa53d('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa53d('0x11')](function(_0x38c4fa){logger['info'](_0xa53d('0x1b'),_0x3f53d8);logger[_0xa53d('0x14')](_0xa53d('0x1b'),_0x3f53d8,JSON['stringify'](_0x38c4fa));_0x169552(_0x38c4fa);})[_0xa53d('0x1a')](function(_0x3228c5){logger[_0xa53d('0x17')](_0xa53d('0x1b'),_0x3228c5[_0xa53d('0x19')],_0x3f53d8);_0x656f35(_0x24bc34[_0xa53d('0x17')](0x1f4,_0x3228c5[_0xa53d('0x19')]));});});};exports['ShowWhatsappQueue']=function(_0x1a6f89){var _0x3b9b96=this;return new Promise(function(_0x52010d,_0x4f4c96){return db[_0xa53d('0x1c')][_0xa53d('0x25')]({'raw':_0x1a6f89['options']?_0x1a6f89[_0xa53d('0x1e')][_0xa53d('0x1f')]===undefined?!![]:![]:!![],'where':_0x1a6f89[_0xa53d('0x1e')]?_0x1a6f89[_0xa53d('0x1e')][_0xa53d('0x20')]||null:null,'attributes':_0x1a6f89[_0xa53d('0x1e')]?_0x1a6f89[_0xa53d('0x1e')][_0xa53d('0x21')]||null:null,'include':_0x1a6f89['options']?_0x1a6f89[_0xa53d('0x1e')][_0xa53d('0x22')]?_[_0xa53d('0x24')](_0x1a6f89[_0xa53d('0x1e')]['include'],function(_0x167fbe){return{'model':db[_0x167fbe['model']],'as':_0x167fbe['as'],'attributes':_0x167fbe['attributes'],'include':_0x167fbe[_0xa53d('0x22')]?_[_0xa53d('0x24')](_0x167fbe[_0xa53d('0x22')],function(_0x52aded){return{'model':db[_0x52aded[_0xa53d('0x23')]],'as':_0x52aded['as'],'attributes':_0x52aded[_0xa53d('0x21')],'include':_0x52aded[_0xa53d('0x22')]?_[_0xa53d('0x24')](_0x52aded[_0xa53d('0x22')],function(_0x5368e0){return{'model':db[_0x5368e0[_0xa53d('0x23')]],'as':_0x5368e0['as'],'attributes':_0x5368e0[_0xa53d('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa53d('0x11')](function(_0x4f34b5){logger['info'](_0xa53d('0x26'),_0x1a6f89);logger[_0xa53d('0x14')](_0xa53d('0x26'),_0x1a6f89,JSON['stringify'](_0x4f34b5));_0x52010d(_0x4f34b5);})[_0xa53d('0x1a')](function(_0x223612){logger[_0xa53d('0x17')](_0xa53d('0x26'),_0x223612[_0xa53d('0x19')],_0x1a6f89);_0x4f4c96(_0x3b9b96[_0xa53d('0x17')](0x1f4,_0x223612['message']));});});}; \ No newline at end of file +var _0xc1bb=['attributes','info','debug','stringify','ShowWhatsappQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','register','request','then','request\x20sent','error','code','message','WhatsappQueue,\x20%s,\x20%s','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','limit','include','map','model'];(function(_0x12bfe7,_0x4dba97){var _0x566817=function(_0x516aca){while(--_0x516aca){_0x12bfe7['push'](_0x12bfe7['shift']());}};_0x566817(++_0x4dba97);}(_0xc1bb,0xd0));var _0xbc1b=function(_0x427eba,_0x4d1c76){_0x427eba=_0x427eba-0x0;var _0x5ed7b7=_0xc1bb[_0x427eba];return _0x5ed7b7;};'use strict';var _=require(_0xbc1b('0x0'));var util=require(_0xbc1b('0x1'));var moment=require(_0xbc1b('0x2'));var BPromise=require(_0xbc1b('0x3'));var rs=require(_0xbc1b('0x4'));var fs=require('fs');var Redis=require(_0xbc1b('0x5'));var db=require(_0xbc1b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc1b('0x7'))(_0xbc1b('0x8'));var config=require(_0xbc1b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbc1b('0xa')]({'port':0x232a});config['redis']=_[_0xbc1b('0xb')](config[_0xbc1b('0xc')],{'host':_0xbc1b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbc1b('0xc')]));require('./whatsappQueue.socket')[_0xbc1b('0xe')](socket);function respondWithRpcPromise(_0x24dd9b,_0x28ba43,_0x346f05){return new BPromise(function(_0x37cf6e,_0x57eff0){return client[_0xbc1b('0xf')](_0x24dd9b,_0x346f05)[_0xbc1b('0x10')](function(_0x130039){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x28ba43,_0xbc1b('0x11'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x28ba43,_0xbc1b('0x11'),JSON['stringify'](_0x130039));if(_0x130039['error']){if(_0x130039[_0xbc1b('0x12')][_0xbc1b('0x13')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x28ba43,_0x130039['error'][_0xbc1b('0x14')]);return _0x57eff0(_0x130039[_0xbc1b('0x12')]['message']);}logger[_0xbc1b('0x12')](_0xbc1b('0x15'),_0x28ba43,_0x130039[_0xbc1b('0x12')]['message']);return _0x37cf6e(_0x130039['error']['message']);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x28ba43,_0xbc1b('0x11'));_0x37cf6e(_0x130039[_0xbc1b('0x16')][_0xbc1b('0x14')]);}})[_0xbc1b('0x17')](function(_0x45e013){logger[_0xbc1b('0x12')](_0xbc1b('0x15'),_0x28ba43,_0x45e013);_0x57eff0(_0x45e013);});});}exports[_0xbc1b('0x18')]=function(_0xad76a5){var _0x3a1ded=this;return new Promise(function(_0x3171a4,_0x3b0a6d){return db[_0xbc1b('0x19')][_0xbc1b('0x1a')]({'raw':_0xad76a5[_0xbc1b('0x1b')]?_0xad76a5[_0xbc1b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xad76a5['options']?_0xad76a5[_0xbc1b('0x1b')]['where']||null:null,'attributes':_0xad76a5[_0xbc1b('0x1b')]?_0xad76a5['options']['attributes']||null:null,'limit':_0xad76a5[_0xbc1b('0x1b')]?_0xad76a5['options'][_0xbc1b('0x1c')]||null:null,'include':_0xad76a5[_0xbc1b('0x1b')]?_0xad76a5['options'][_0xbc1b('0x1d')]?_[_0xbc1b('0x1e')](_0xad76a5[_0xbc1b('0x1b')][_0xbc1b('0x1d')],function(_0x481d25){return{'model':db[_0x481d25[_0xbc1b('0x1f')]],'as':_0x481d25['as'],'attributes':_0x481d25[_0xbc1b('0x20')],'include':_0x481d25[_0xbc1b('0x1d')]?_[_0xbc1b('0x1e')](_0x481d25[_0xbc1b('0x1d')],function(_0x2ca326){return{'model':db[_0x2ca326['model']],'as':_0x2ca326['as'],'attributes':_0x2ca326[_0xbc1b('0x20')],'include':_0x2ca326[_0xbc1b('0x1d')]?_[_0xbc1b('0x1e')](_0x2ca326[_0xbc1b('0x1d')],function(_0x5585db){return{'model':db[_0x5585db['model']],'as':_0x5585db['as'],'attributes':_0x5585db[_0xbc1b('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x364e02){logger[_0xbc1b('0x21')](_0xbc1b('0x18'),_0xad76a5);logger[_0xbc1b('0x22')](_0xbc1b('0x18'),_0xad76a5,JSON[_0xbc1b('0x23')](_0x364e02));_0x3171a4(_0x364e02);})['catch'](function(_0x469b1d){logger[_0xbc1b('0x12')](_0xbc1b('0x18'),_0x469b1d[_0xbc1b('0x14')],_0xad76a5);_0x3b0a6d(_0x3a1ded[_0xbc1b('0x12')](0x1f4,_0x469b1d[_0xbc1b('0x14')]));});});};exports[_0xbc1b('0x24')]=function(_0x5d3f9a){var _0x294143=this;return new Promise(function(_0x3bb3f8,_0x885ac7){return db[_0xbc1b('0x19')][_0xbc1b('0x25')]({'raw':_0x5d3f9a[_0xbc1b('0x1b')]?_0x5d3f9a[_0xbc1b('0x1b')][_0xbc1b('0x26')]===undefined?!![]:![]:!![],'where':_0x5d3f9a[_0xbc1b('0x1b')]?_0x5d3f9a['options'][_0xbc1b('0x27')]||null:null,'attributes':_0x5d3f9a[_0xbc1b('0x1b')]?_0x5d3f9a['options']['attributes']||null:null,'include':_0x5d3f9a[_0xbc1b('0x1b')]?_0x5d3f9a[_0xbc1b('0x1b')]['include']?_[_0xbc1b('0x1e')](_0x5d3f9a[_0xbc1b('0x1b')][_0xbc1b('0x1d')],function(_0x2298ce){return{'model':db[_0x2298ce[_0xbc1b('0x1f')]],'as':_0x2298ce['as'],'attributes':_0x2298ce[_0xbc1b('0x20')],'include':_0x2298ce[_0xbc1b('0x1d')]?_[_0xbc1b('0x1e')](_0x2298ce[_0xbc1b('0x1d')],function(_0x566bb2){return{'model':db[_0x566bb2[_0xbc1b('0x1f')]],'as':_0x566bb2['as'],'attributes':_0x566bb2[_0xbc1b('0x20')],'include':_0x566bb2['include']?_[_0xbc1b('0x1e')](_0x566bb2[_0xbc1b('0x1d')],function(_0x141174){return{'model':db[_0x141174[_0xbc1b('0x1f')]],'as':_0x141174['as'],'attributes':_0x141174['attributes']};}):[]};}):[]};}):[]:[]})[_0xbc1b('0x10')](function(_0x481396){logger[_0xbc1b('0x21')](_0xbc1b('0x24'),_0x5d3f9a);logger[_0xbc1b('0x22')](_0xbc1b('0x24'),_0x5d3f9a,JSON[_0xbc1b('0x23')](_0x481396));_0x3bb3f8(_0x481396);})[_0xbc1b('0x17')](function(_0x8465fc){logger[_0xbc1b('0x12')]('ShowWhatsappQueue',_0x8465fc[_0xbc1b('0x14')],_0x5d3f9a);_0x885ac7(_0x294143['error'](0x1f4,_0x8465fc[_0xbc1b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 78a3f90..31972eb 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 _0x84d5=['update','register','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0x58d40f,_0x18f78d){var _0x56572c=function(_0x298f77){while(--_0x298f77){_0x58d40f['push'](_0x58d40f['shift']());}};_0x56572c(++_0x18f78d);}(_0x84d5,0xd6));var _0x584d=function(_0x73c4d8,_0x1194d8){_0x73c4d8=_0x73c4d8-0x0;var _0x31e802=_0x84d5[_0x73c4d8];return _0x31e802;};'use strict';var WhatsappQueueEvents=require(_0x584d('0x0'));var events=[_0x584d('0x1'),_0x584d('0x2'),_0x584d('0x3')];function createListener(_0x3cf2d2,_0x4a28ac){return function(_0x58c2af){_0x4a28ac['emit'](_0x3cf2d2,_0x58c2af);};}function removeListener(_0x5f17e1,_0x35f9be){return function(){WhatsappQueueEvents['removeListener'](_0x5f17e1,_0x35f9be);};}exports[_0x584d('0x4')]=function(_0x136b2b){for(var _0x4904ea=0x0,_0x14ea79=events[_0x584d('0x5')];_0x4904ea<_0x14ea79;_0x4904ea++){var _0x1d5257=events[_0x4904ea];var _0x8a0ef9=createListener(_0x584d('0x6')+_0x1d5257,_0x136b2b);WhatsappQueueEvents['on'](_0x1d5257,_0x8a0ef9);}}; \ No newline at end of file +var _0xaae8=['remove','update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save'];(function(_0x3d4e45,_0x114c65){var _0x28120d=function(_0x3465ae){while(--_0x3465ae){_0x3d4e45['push'](_0x3d4e45['shift']());}};_0x28120d(++_0x114c65);}(_0xaae8,0x139));var _0x8aae=function(_0x342528,_0x2c1c40){_0x342528=_0x342528-0x0;var _0x3dbf26=_0xaae8[_0x342528];return _0x3dbf26;};'use strict';var WhatsappQueueEvents=require(_0x8aae('0x0'));var events=[_0x8aae('0x1'),_0x8aae('0x2'),_0x8aae('0x3')];function createListener(_0x215d0c,_0x2e65aa){return function(_0x36f05c){_0x2e65aa[_0x8aae('0x4')](_0x215d0c,_0x36f05c);};}function removeListener(_0x2d8518,_0x373583){return function(){WhatsappQueueEvents[_0x8aae('0x5')](_0x2d8518,_0x373583);};}exports[_0x8aae('0x6')]=function(_0x2d31f1){for(var _0x2f193b=0x0,_0x2ccacf=events[_0x8aae('0x7')];_0x2f193b<_0x2ccacf;_0x2f193b++){var _0xdaae5f=events[_0x2f193b];var _0x5bda24=createListener(_0x8aae('0x8')+_0xdaae5f,_0x2d31f1);WhatsappQueueEvents['on'](_0xdaae5f,_0x5bda24);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index a6e9537..50256fc 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 _0x7208=['get','index','/describe','isAuthenticated','describe','show','post','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller'];(function(_0x4caf20,_0x1eecbe){var _0x4795b5=function(_0x5471fd){while(--_0x5471fd){_0x4caf20['push'](_0x4caf20['shift']());}};_0x4795b5(++_0x1eecbe);}(_0x7208,0x199));var _0x8720=function(_0x453f9c,_0x26815f){_0x453f9c=_0x453f9c-0x0;var _0x161f20=_0x7208[_0x453f9c];return _0x161f20;};'use strict';var multer=require(_0x8720('0x0'));var util=require(_0x8720('0x1'));var path=require(_0x8720('0x2'));var timeout=require(_0x8720('0x3'));var express=require(_0x8720('0x4'));var router=express['Router']();var fs_extra=require(_0x8720('0x5'));var auth=require(_0x8720('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8720('0x7'));var controller=require(_0x8720('0x8'));router[_0x8720('0x9')]('/',auth['isAuthenticated'](),controller[_0x8720('0xa')]);router[_0x8720('0x9')](_0x8720('0xb'),auth[_0x8720('0xc')](),controller[_0x8720('0xd')]);router[_0x8720('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8720('0xe')]);router[_0x8720('0xf')]('/',auth[_0x8720('0xc')](),controller[_0x8720('0x10')]);router[_0x8720('0x11')]('/:id',auth[_0x8720('0xc')](),controller['update']);router[_0x8720('0x12')](_0x8720('0x13'),auth[_0x8720('0xc')](),controller[_0x8720('0x14')]);module[_0x8720('0x15')]=router; \ No newline at end of file +var _0xe008=['/:id','create','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1bb11d,_0x30a206){var _0x3817f6=function(_0x1de6a1){while(--_0x1de6a1){_0x1bb11d['push'](_0x1bb11d['shift']());}};_0x3817f6(++_0x30a206);}(_0xe008,0xcc));var _0x8e00=function(_0x1b959b,_0x52823d){_0x1b959b=_0x1b959b-0x0;var _0x584929=_0xe008[_0x1b959b];return _0x584929;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8e00('0x0'));var timeout=require(_0x8e00('0x1'));var express=require(_0x8e00('0x2'));var router=express[_0x8e00('0x3')]();var fs_extra=require(_0x8e00('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8e00('0x5'));var controller=require(_0x8e00('0x6'));router[_0x8e00('0x7')]('/',auth[_0x8e00('0x8')](),controller[_0x8e00('0x9')]);router[_0x8e00('0x7')](_0x8e00('0xa'),auth[_0x8e00('0x8')](),controller[_0x8e00('0xb')]);router['get'](_0x8e00('0xc'),auth[_0x8e00('0x8')](),controller['show']);router['post']('/',auth[_0x8e00('0x8')](),controller[_0x8e00('0xd')]);router[_0x8e00('0xe')](_0x8e00('0xc'),auth['isAuthenticated'](),controller[_0x8e00('0xf')]);router[_0x8e00('0x10')](_0x8e00('0xc'),auth[_0x8e00('0x8')](),controller[_0x8e00('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index b0da427..dbbb3af 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(_0x32c1e7,_0x3acc95){var _0x1948a1=function(_0x3be659){while(--_0x3be659){_0x32c1e7['push'](_0x32c1e7['shift']());}};_0x1948a1(++_0x3acc95);}(_0x7a54,0x106));var _0x47a5=function(_0x264282,_0x17fa27){_0x264282=_0x264282-0x0;var _0x51f0e4=_0x7a54[_0x264282];return _0x51f0e4;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x388628,_0x30229d){var _0x25bc57=function(_0x26e41d){while(--_0x26e41d){_0x388628['push'](_0x388628['shift']());}};_0x25bc57(++_0x30229d);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 90badf0..383a055 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 _0x4b17=['save','update','then','destroy','end','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','describe','eml-format','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply'];(function(_0x252d4e,_0x432c5f){var _0x78b2c0=function(_0x302f2f){while(--_0x302f2f){_0x252d4e['push'](_0x252d4e['shift']());}};_0x78b2c0(++_0x432c5f);}(_0x4b17,0x10f));var _0x74b1=function(_0x44039a,_0x2ac8a8){_0x44039a=_0x44039a-0x0;var _0x525de5=_0x4b17[_0x44039a];return _0x525de5;};'use strict';var emlformat=require(_0x74b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74b1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b1('0x2'));var moment=require(_0x74b1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74b1('0x4'));var util=require('util');var path=require('path');var sox=require(_0x74b1('0x5'));var csv=require(_0x74b1('0x6'));var ejs=require(_0x74b1('0x7'));var fs=require('fs');var fs_extra=require(_0x74b1('0x8'));var _=require(_0x74b1('0x9'));var squel=require(_0x74b1('0xa'));var crypto=require(_0x74b1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x74b1('0xc'));var toCsv=require(_0x74b1('0x6'));var querystring=require(_0x74b1('0xd'));var Papa=require(_0x74b1('0xe'));var Redis=require(_0x74b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x74b1('0x10'));var as=require(_0x74b1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74b1('0x12'))(_0x74b1('0x13'));var utils=require(_0x74b1('0x14'));var config=require(_0x74b1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x74b1('0x16'))['db'];function respondWithStatusCode(_0x5cfe85,_0x5f2865){_0x5f2865=_0x5f2865||0xcc;return function(_0x239d04){if(_0x239d04){return _0x5cfe85[_0x74b1('0x17')](_0x5f2865);}return _0x5cfe85['status'](_0x5f2865)['end']();};}function respondWithResult(_0x500ce2,_0x86390){_0x86390=_0x86390||0xc8;return function(_0x5c12eb){if(_0x5c12eb){return _0x500ce2['status'](_0x86390)[_0x74b1('0x18')](_0x5c12eb);}};}function respondWithFilteredResult(_0x12a2c0,_0x3779c5){return function(_0x420662){if(_0x420662){var _0x16b147=typeof _0x3779c5[_0x74b1('0x19')]==='undefined'&&typeof _0x3779c5[_0x74b1('0x1a')]===_0x74b1('0x1b');var _0x1a0851=_0x420662[_0x74b1('0x1c')];var _0xde2736=_0x16b147?0x0:_0x3779c5[_0x74b1('0x19')];var _0x1ab838=_0x16b147?_0x420662['count']:_0x3779c5[_0x74b1('0x19')]+_0x3779c5[_0x74b1('0x1a')];var _0x524ece;if(_0x1ab838>=_0x1a0851){_0x1ab838=_0x1a0851;_0x524ece=0xc8;}else{_0x524ece=0xce;}_0x12a2c0[_0x74b1('0x1d')](_0x524ece);return _0x12a2c0[_0x74b1('0x1e')](_0x74b1('0x1f'),_0xde2736+'-'+_0x1ab838+'/'+_0x1a0851)[_0x74b1('0x18')](_0x420662);}return null;};}function patchUpdates(_0x13bb44){return function(_0x33fee9){try{jsonpatch[_0x74b1('0x20')](_0x33fee9,_0x13bb44,!![]);}catch(_0xaac5f7){return BPromise['reject'](_0xaac5f7);}return _0x33fee9[_0x74b1('0x21')]();};}function saveUpdates(_0x4f1ec9,_0x5da0f7){return function(_0x481bf2){if(_0x481bf2){return _0x481bf2[_0x74b1('0x22')](_0x4f1ec9)[_0x74b1('0x23')](function(_0x405a22){return _0x405a22;});}return null;};}function removeEntity(_0x44bf7e,_0x563781){return function(_0x4ee88b){if(_0x4ee88b){return _0x4ee88b[_0x74b1('0x24')]()['then'](function(){_0x44bf7e[_0x74b1('0x1d')](0xcc)[_0x74b1('0x25')]();});}};}function handleEntityNotFound(_0xb5af0,_0x14a651){return function(_0x3239d8){if(!_0x3239d8){_0xb5af0[_0x74b1('0x17')](0x194);}return _0x3239d8;};}function handleError(_0x115918,_0x33fa8e){_0x33fa8e=_0x33fa8e||0x1f4;return function(_0x4c7f05){logger[_0x74b1('0x26')](_0x4c7f05[_0x74b1('0x27')]);if(_0x4c7f05[_0x74b1('0x28')]){delete _0x4c7f05['name'];}_0x115918[_0x74b1('0x1d')](_0x33fa8e)[_0x74b1('0x29')](_0x4c7f05);};}exports[_0x74b1('0x2a')]=function(_0x1b011a,_0x26d9f1){var _0x273ff1={},_0x436eda={},_0x3ce043={'count':0x0,'rows':[]};var _0x4fbe3d=_[_0x74b1('0x2b')](db[_0x74b1('0x2c')]['rawAttributes'],function(_0x543b5){return{'name':_0x543b5[_0x74b1('0x2d')],'type':_0x543b5[_0x74b1('0x2e')]['key']};});_0x436eda[_0x74b1('0x2f')]=_[_0x74b1('0x2b')](_0x4fbe3d,'name');_0x436eda[_0x74b1('0x30')]=_[_0x74b1('0x31')](_0x1b011a[_0x74b1('0x30')]);_0x436eda[_0x74b1('0x32')]=_[_0x74b1('0x33')](_0x436eda[_0x74b1('0x2f')],_0x436eda[_0x74b1('0x30')]);_0x273ff1[_0x74b1('0x34')]=_['intersection'](_0x436eda[_0x74b1('0x2f')],qs['fields'](_0x1b011a['query'][_0x74b1('0x35')]));_0x273ff1['attributes']=_0x273ff1['attributes'][_0x74b1('0x36')]?_0x273ff1[_0x74b1('0x34')]:_0x436eda[_0x74b1('0x2f')];if(!_0x1b011a[_0x74b1('0x30')][_0x74b1('0x37')](_0x74b1('0x38'))){_0x273ff1[_0x74b1('0x1a')]=qs[_0x74b1('0x1a')](_0x1b011a['query']['limit']);_0x273ff1['offset']=qs[_0x74b1('0x19')](_0x1b011a['query']['offset']);}_0x273ff1[_0x74b1('0x39')]=qs[_0x74b1('0x3a')](_0x1b011a[_0x74b1('0x30')]['sort']);_0x273ff1[_0x74b1('0x3b')]=qs['filters'](_[_0x74b1('0x3c')](_0x1b011a[_0x74b1('0x30')],_0x436eda['filters']),_0x4fbe3d);if(_0x1b011a['query'][_0x74b1('0x3d')]){_0x273ff1[_0x74b1('0x3b')]=_['merge'](_0x273ff1['where'],{'$or':_[_0x74b1('0x2b')](_0x4fbe3d,function(_0x5298f6){if(_0x5298f6[_0x74b1('0x2e')]!==_0x74b1('0x3e')){var _0x15e695={};_0x15e695[_0x5298f6[_0x74b1('0x28')]]={'$like':'%'+_0x1b011a[_0x74b1('0x30')]['filter']+'%'};return _0x15e695;}})});}_0x273ff1=_[_0x74b1('0x3f')]({},_0x273ff1,_0x1b011a['options']);var _0x41a78b={'where':_0x273ff1['where']};return db[_0x74b1('0x2c')]['count'](_0x41a78b)['then'](function(_0xcdb873){_0x3ce043[_0x74b1('0x1c')]=_0xcdb873;if(_0x1b011a[_0x74b1('0x30')]['includeAll']){_0x273ff1[_0x74b1('0x40')]=[{'all':!![]}];}return db[_0x74b1('0x2c')][_0x74b1('0x41')](_0x273ff1);})['then'](function(_0xfecdc){_0x3ce043[_0x74b1('0x42')]=_0xfecdc;return _0x3ce043;})['then'](respondWithFilteredResult(_0x26d9f1,_0x273ff1))['catch'](handleError(_0x26d9f1,null));};exports[_0x74b1('0x43')]=function(_0x2dcaf6,_0x416c8d){var _0x444870={'raw':!![],'where':{'id':_0x2dcaf6[_0x74b1('0x44')]['id']}},_0x1d9f5b={};_0x1d9f5b[_0x74b1('0x2f')]=_['keys'](db[_0x74b1('0x2c')][_0x74b1('0x45')]);_0x1d9f5b[_0x74b1('0x30')]=_[_0x74b1('0x31')](_0x2dcaf6[_0x74b1('0x30')]);_0x1d9f5b['filters']=_[_0x74b1('0x33')](_0x1d9f5b[_0x74b1('0x2f')],_0x1d9f5b['query']);_0x444870['attributes']=_[_0x74b1('0x33')](_0x1d9f5b[_0x74b1('0x2f')],qs['fields'](_0x2dcaf6[_0x74b1('0x30')][_0x74b1('0x35')]));_0x444870[_0x74b1('0x34')]=_0x444870[_0x74b1('0x34')][_0x74b1('0x36')]?_0x444870[_0x74b1('0x34')]:_0x1d9f5b[_0x74b1('0x2f')];if(_0x2dcaf6['query']['includeAll']){_0x444870['include']=[{'all':!![]}];}_0x444870=_[_0x74b1('0x3f')]({},_0x444870,_0x2dcaf6[_0x74b1('0x46')]);return db[_0x74b1('0x2c')][_0x74b1('0x47')](_0x444870)[_0x74b1('0x23')](handleEntityNotFound(_0x416c8d,null))['then'](respondWithResult(_0x416c8d,null))[_0x74b1('0x48')](handleError(_0x416c8d,null));};exports[_0x74b1('0x49')]=function(_0x18687c,_0x33c215){return db[_0x74b1('0x2c')][_0x74b1('0x49')](_0x18687c[_0x74b1('0x4a')],{})[_0x74b1('0x23')](respondWithResult(_0x33c215,0xc9))[_0x74b1('0x48')](handleError(_0x33c215,null));};exports[_0x74b1('0x22')]=function(_0x186516,_0x3038f9){if(_0x186516['body']['id']){delete _0x186516[_0x74b1('0x4a')]['id'];}return db[_0x74b1('0x2c')]['find']({'where':{'id':_0x186516[_0x74b1('0x44')]['id']}})['then'](handleEntityNotFound(_0x3038f9,null))[_0x74b1('0x23')](saveUpdates(_0x186516[_0x74b1('0x4a')],null))['then'](respondWithResult(_0x3038f9,null))[_0x74b1('0x48')](handleError(_0x3038f9,null));};exports[_0x74b1('0x24')]=function(_0x326b98,_0x549f03){return db[_0x74b1('0x2c')][_0x74b1('0x47')]({'where':{'id':_0x326b98[_0x74b1('0x44')]['id']}})[_0x74b1('0x23')](handleEntityNotFound(_0x549f03,null))[_0x74b1('0x23')](removeEntity(_0x549f03,null))['catch'](handleError(_0x549f03,null));};exports[_0x74b1('0x4b')]=function(_0x594411,_0x11bfca){return db[_0x74b1('0x2c')]['describe']()[_0x74b1('0x23')](respondWithResult(_0x11bfca,null))[_0x74b1('0x48')](handleError(_0x11bfca,null));}; \ No newline at end of file +var _0xdd4f=['intersection','includeAll','create','body','find','describe','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys'];(function(_0x1291ed,_0x41d977){var _0x33d06d=function(_0x2f4e06){while(--_0x2f4e06){_0x1291ed['push'](_0x1291ed['shift']());}};_0x33d06d(++_0x41d977);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x2c6221,_0x373c15){_0x2c6221=_0x2c6221-0x0;var _0x45ef5d=_0xdd4f[_0x2c6221];return _0x45ef5d;};'use strict';var emlformat=require(_0xfdd4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfdd4('0x3'));var util=require(_0xfdd4('0x4'));var path=require(_0xfdd4('0x5'));var sox=require('sox');var csv=require(_0xfdd4('0x6'));var ejs=require(_0xfdd4('0x7'));var fs=require('fs');var fs_extra=require(_0xfdd4('0x8'));var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x6'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var hardwareService=require(_0xfdd4('0x10'));var logger=require(_0xfdd4('0x11'))(_0xfdd4('0x12'));var utils=require(_0xfdd4('0x13'));var config=require(_0xfdd4('0x14'));var licenseUtil=require(_0xfdd4('0x15'));var db=require(_0xfdd4('0x16'))['db'];function respondWithStatusCode(_0x3f07f1,_0x4565e6){_0x4565e6=_0x4565e6||0xcc;return function(_0x1bf37b){if(_0x1bf37b){return _0x3f07f1['sendStatus'](_0x4565e6);}return _0x3f07f1[_0xfdd4('0x17')](_0x4565e6)[_0xfdd4('0x18')]();};}function respondWithResult(_0x227099,_0x57b21f){_0x57b21f=_0x57b21f||0xc8;return function(_0x1b7da1){if(_0x1b7da1){return _0x227099['status'](_0x57b21f)[_0xfdd4('0x19')](_0x1b7da1);}};}function respondWithFilteredResult(_0x42c3a8,_0x2f34ec){return function(_0x431255){if(_0x431255){var _0x37b05f=typeof _0x2f34ec['offset']==='undefined'&&typeof _0x2f34ec['limit']===_0xfdd4('0x1a');var _0x216c7e=_0x431255[_0xfdd4('0x1b')];var _0x2ccc88=_0x37b05f?0x0:_0x2f34ec[_0xfdd4('0x1c')];var _0x33d752=_0x37b05f?_0x431255[_0xfdd4('0x1b')]:_0x2f34ec[_0xfdd4('0x1c')]+_0x2f34ec[_0xfdd4('0x1d')];var _0x52ce34;if(_0x33d752>=_0x216c7e){_0x33d752=_0x216c7e;_0x52ce34=0xc8;}else{_0x52ce34=0xce;}_0x42c3a8[_0xfdd4('0x17')](_0x52ce34);return _0x42c3a8[_0xfdd4('0x1e')](_0xfdd4('0x1f'),_0x2ccc88+'-'+_0x33d752+'/'+_0x216c7e)[_0xfdd4('0x19')](_0x431255);}return null;};}function patchUpdates(_0x1454f1){return function(_0x29cc8d){try{jsonpatch[_0xfdd4('0x20')](_0x29cc8d,_0x1454f1,!![]);}catch(_0x34dfa8){return BPromise['reject'](_0x34dfa8);}return _0x29cc8d[_0xfdd4('0x21')]();};}function saveUpdates(_0x17302b,_0x2a24e8){return function(_0x16e81b){if(_0x16e81b){return _0x16e81b[_0xfdd4('0x22')](_0x17302b)[_0xfdd4('0x23')](function(_0x451767){return _0x451767;});}return null;};}function removeEntity(_0x277ec1,_0x538b00){return function(_0x1e14da){if(_0x1e14da){return _0x1e14da[_0xfdd4('0x24')]()[_0xfdd4('0x23')](function(){_0x277ec1['status'](0xcc)[_0xfdd4('0x18')]();});}};}function handleEntityNotFound(_0x39b712,_0xf9c346){return function(_0x2f8268){if(!_0x2f8268){_0x39b712[_0xfdd4('0x25')](0x194);}return _0x2f8268;};}function handleError(_0x4a8790,_0x18bafb){_0x18bafb=_0x18bafb||0x1f4;return function(_0x2c88ad){logger[_0xfdd4('0x26')](_0x2c88ad[_0xfdd4('0x27')]);if(_0x2c88ad[_0xfdd4('0x28')]){delete _0x2c88ad[_0xfdd4('0x28')];}_0x4a8790[_0xfdd4('0x17')](_0x18bafb)[_0xfdd4('0x29')](_0x2c88ad);};}exports['index']=function(_0xcbd1fb,_0x39981f){var _0x385a68={},_0xef012e={},_0x2207ae={'count':0x0,'rows':[]};var _0x4a36a2=_[_0xfdd4('0x2a')](db[_0xfdd4('0x2b')][_0xfdd4('0x2c')],function(_0x2bb793){return{'name':_0x2bb793[_0xfdd4('0x2d')],'type':_0x2bb793['type'][_0xfdd4('0x2e')]};});_0xef012e[_0xfdd4('0x2f')]=_[_0xfdd4('0x2a')](_0x4a36a2,'name');_0xef012e[_0xfdd4('0x30')]=_['keys'](_0xcbd1fb[_0xfdd4('0x30')]);_0xef012e[_0xfdd4('0x31')]=_['intersection'](_0xef012e['model'],_0xef012e[_0xfdd4('0x30')]);_0x385a68[_0xfdd4('0x32')]=_['intersection'](_0xef012e['model'],qs[_0xfdd4('0x33')](_0xcbd1fb[_0xfdd4('0x30')][_0xfdd4('0x33')]));_0x385a68[_0xfdd4('0x32')]=_0x385a68[_0xfdd4('0x32')][_0xfdd4('0x34')]?_0x385a68[_0xfdd4('0x32')]:_0xef012e[_0xfdd4('0x2f')];if(!_0xcbd1fb[_0xfdd4('0x30')][_0xfdd4('0x35')](_0xfdd4('0x36'))){_0x385a68[_0xfdd4('0x1d')]=qs[_0xfdd4('0x1d')](_0xcbd1fb[_0xfdd4('0x30')][_0xfdd4('0x1d')]);_0x385a68[_0xfdd4('0x1c')]=qs[_0xfdd4('0x1c')](_0xcbd1fb[_0xfdd4('0x30')][_0xfdd4('0x1c')]);}_0x385a68[_0xfdd4('0x37')]=qs[_0xfdd4('0x38')](_0xcbd1fb[_0xfdd4('0x30')][_0xfdd4('0x38')]);_0x385a68[_0xfdd4('0x39')]=qs[_0xfdd4('0x31')](_[_0xfdd4('0x3a')](_0xcbd1fb['query'],_0xef012e[_0xfdd4('0x31')]),_0x4a36a2);if(_0xcbd1fb[_0xfdd4('0x30')][_0xfdd4('0x3b')]){_0x385a68[_0xfdd4('0x39')]=_[_0xfdd4('0x3c')](_0x385a68[_0xfdd4('0x39')],{'$or':_['map'](_0x4a36a2,function(_0x245ce4){if(_0x245ce4['type']!==_0xfdd4('0x3d')){var _0x2c5199={};_0x2c5199[_0x245ce4[_0xfdd4('0x28')]]={'$like':'%'+_0xcbd1fb[_0xfdd4('0x30')]['filter']+'%'};return _0x2c5199;}})});}_0x385a68=_[_0xfdd4('0x3c')]({},_0x385a68,_0xcbd1fb[_0xfdd4('0x3e')]);var _0x1040e8={'where':_0x385a68[_0xfdd4('0x39')]};return db[_0xfdd4('0x2b')][_0xfdd4('0x1b')](_0x1040e8)[_0xfdd4('0x23')](function(_0x55fcec){_0x2207ae[_0xfdd4('0x1b')]=_0x55fcec;if(_0xcbd1fb[_0xfdd4('0x30')]['includeAll']){_0x385a68[_0xfdd4('0x3f')]=[{'all':!![]}];}return db[_0xfdd4('0x2b')][_0xfdd4('0x40')](_0x385a68);})[_0xfdd4('0x23')](function(_0x5173db){_0x2207ae[_0xfdd4('0x41')]=_0x5173db;return _0x2207ae;})[_0xfdd4('0x23')](respondWithFilteredResult(_0x39981f,_0x385a68))[_0xfdd4('0x42')](handleError(_0x39981f,null));};exports[_0xfdd4('0x43')]=function(_0x362c4f,_0x496747){var _0x1411e0={'raw':!![],'where':{'id':_0x362c4f[_0xfdd4('0x44')]['id']}},_0x23af2a={};_0x23af2a[_0xfdd4('0x2f')]=_[_0xfdd4('0x45')](db[_0xfdd4('0x2b')][_0xfdd4('0x2c')]);_0x23af2a['query']=_[_0xfdd4('0x45')](_0x362c4f['query']);_0x23af2a[_0xfdd4('0x31')]=_[_0xfdd4('0x46')](_0x23af2a[_0xfdd4('0x2f')],_0x23af2a[_0xfdd4('0x30')]);_0x1411e0['attributes']=_[_0xfdd4('0x46')](_0x23af2a[_0xfdd4('0x2f')],qs['fields'](_0x362c4f[_0xfdd4('0x30')][_0xfdd4('0x33')]));_0x1411e0['attributes']=_0x1411e0[_0xfdd4('0x32')]['length']?_0x1411e0['attributes']:_0x23af2a['model'];if(_0x362c4f[_0xfdd4('0x30')][_0xfdd4('0x47')]){_0x1411e0[_0xfdd4('0x3f')]=[{'all':!![]}];}_0x1411e0=_['merge']({},_0x1411e0,_0x362c4f[_0xfdd4('0x3e')]);return db[_0xfdd4('0x2b')]['find'](_0x1411e0)[_0xfdd4('0x23')](handleEntityNotFound(_0x496747,null))[_0xfdd4('0x23')](respondWithResult(_0x496747,null))[_0xfdd4('0x42')](handleError(_0x496747,null));};exports[_0xfdd4('0x48')]=function(_0x746f6a,_0x3817fe){return db[_0xfdd4('0x2b')][_0xfdd4('0x48')](_0x746f6a[_0xfdd4('0x49')],{})[_0xfdd4('0x23')](respondWithResult(_0x3817fe,0xc9))[_0xfdd4('0x42')](handleError(_0x3817fe,null));};exports[_0xfdd4('0x22')]=function(_0x300965,_0x3c0ee1){if(_0x300965['body']['id']){delete _0x300965['body']['id'];}return db[_0xfdd4('0x2b')][_0xfdd4('0x4a')]({'where':{'id':_0x300965[_0xfdd4('0x44')]['id']}})[_0xfdd4('0x23')](handleEntityNotFound(_0x3c0ee1,null))['then'](saveUpdates(_0x300965[_0xfdd4('0x49')],null))[_0xfdd4('0x23')](respondWithResult(_0x3c0ee1,null))['catch'](handleError(_0x3c0ee1,null));};exports['destroy']=function(_0x53c66d,_0x51dd34){return db['WhatsappQueueReport'][_0xfdd4('0x4a')]({'where':{'id':_0x53c66d[_0xfdd4('0x44')]['id']}})[_0xfdd4('0x23')](handleEntityNotFound(_0x51dd34,null))[_0xfdd4('0x23')](removeEntity(_0x51dd34,null))[_0xfdd4('0x42')](handleError(_0x51dd34,null));};exports[_0xfdd4('0x4b')]=function(_0x4d0332,_0x17bbab){return db[_0xfdd4('0x2b')][_0xfdd4('0x4b')]()[_0xfdd4('0x23')](respondWithResult(_0x17bbab,null))['catch'](handleError(_0x17bbab,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 8dd12f2..797d2e9 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 _0xa6e1=['uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue'];(function(_0x7d23cd,_0x10393a){var _0x1fa2ed=function(_0x3a52b4){while(--_0x3a52b4){_0x7d23cd['push'](_0x7d23cd['shift']());}};_0x1fa2ed(++_0x10393a);}(_0xa6e1,0xaa));var _0x1a6e=function(_0x4138af,_0x44bc48){_0x4138af=_0x4138af-0x0;var _0x3be61a=_0xa6e1[_0x4138af];return _0x3be61a;};'use strict';var _=require(_0x1a6e('0x0'));var util=require('util');var logger=require(_0x1a6e('0x1'))(_0x1a6e('0x2'));var moment=require(_0x1a6e('0x3'));var BPromise=require(_0x1a6e('0x4'));var rp=require(_0x1a6e('0x5'));var fs=require('fs');var path=require(_0x1a6e('0x6'));var rimraf=require('rimraf');var config=require(_0x1a6e('0x7'));var attributes=require(_0x1a6e('0x8'));module[_0x1a6e('0x9')]=function(_0x3affdd,_0x39e737){return _0x3affdd[_0x1a6e('0xa')]('WhatsappQueueReport',attributes,{'tableName':_0x1a6e('0xb'),'paranoid':![],'indexes':[{'name':_0x1a6e('0xc'),'fields':[_0x1a6e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8b11=['./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x18269e,_0x4dd8a4){var _0x2ea826=function(_0xecd7a){while(--_0xecd7a){_0x18269e['push'](_0x18269e['shift']());}};_0x2ea826(++_0x4dd8a4);}(_0x8b11,0x1b2));var _0x18b1=function(_0x158f5a,_0xaacc25){_0x158f5a=_0x158f5a-0x0;var _0xb3722e=_0x8b11[_0x158f5a];return _0xb3722e;};'use strict';var _=require(_0x18b1('0x0'));var util=require(_0x18b1('0x1'));var logger=require('../../config/logger')(_0x18b1('0x2'));var moment=require('moment');var BPromise=require(_0x18b1('0x3'));var rp=require(_0x18b1('0x4'));var fs=require('fs');var path=require(_0x18b1('0x5'));var rimraf=require(_0x18b1('0x6'));var config=require(_0x18b1('0x7'));var attributes=require(_0x18b1('0x8'));module[_0x18b1('0x9')]=function(_0x23ed49,_0xb55882){return _0x23ed49['define'](_0x18b1('0xa'),attributes,{'tableName':_0x18b1('0xb'),'paranoid':![],'indexes':[{'name':_0x18b1('0xc'),'fields':[_0x18b1('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 369d7fb..1532b79 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 _0x4158=['WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','catch','UpdateWhatsappQueueReport','update','util','moment','bluebird','../../config/utils','../../config/environment','jayson/promise','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0x4158,0x194));var _0x8415=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x4158[_0x20a558];return _0x53d3f7;};'use strict';var _=require('lodash');var util=require(_0x8415('0x0'));var moment=require(_0x8415('0x1'));var BPromise=require(_0x8415('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8415('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x8415('0x4'));var jayson=require(_0x8415('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6a6e8a,_0x36cca1,_0x56ec12){return new BPromise(function(_0x37d17d,_0x27fcda){return client[_0x8415('0x6')](_0x6a6e8a,_0x56ec12)[_0x8415('0x7')](function(_0x4da88e){logger[_0x8415('0x8')](_0x8415('0x9'),_0x36cca1,_0x8415('0xa'));logger[_0x8415('0xb')](_0x8415('0xc'),_0x36cca1,_0x8415('0xa'),JSON[_0x8415('0xd')](_0x4da88e));if(_0x4da88e[_0x8415('0xe')]){if(_0x4da88e[_0x8415('0xe')][_0x8415('0xf')]===0x1f4){logger[_0x8415('0xe')](_0x8415('0x9'),_0x36cca1,_0x4da88e[_0x8415('0xe')][_0x8415('0x10')]);return _0x27fcda(_0x4da88e['error'][_0x8415('0x10')]);}logger[_0x8415('0xe')](_0x8415('0x9'),_0x36cca1,_0x4da88e[_0x8415('0xe')][_0x8415('0x10')]);return _0x37d17d(_0x4da88e[_0x8415('0xe')][_0x8415('0x10')]);}else{logger[_0x8415('0x8')](_0x8415('0x9'),_0x36cca1,'request\x20sent');_0x37d17d(_0x4da88e['result'][_0x8415('0x10')]);}})['catch'](function(_0x53fe8d){logger[_0x8415('0xe')](_0x8415('0x9'),_0x36cca1,_0x53fe8d);_0x27fcda(_0x53fe8d);});});}exports[_0x8415('0x11')]=function(_0x1a1c1d){var _0x540750=this;return new Promise(function(_0x1255b0,_0x4efca2){return db[_0x8415('0x12')][_0x8415('0x13')](_0x1a1c1d[_0x8415('0x14')],{'raw':_0x1a1c1d['options']?_0x1a1c1d[_0x8415('0x15')][_0x8415('0x16')]===undefined?!![]:![]:!![]})[_0x8415('0x7')](function(_0x5dba2f){logger[_0x8415('0x8')]('CreateWhatsappQueueReport',_0x1a1c1d);logger[_0x8415('0xb')](_0x8415('0x11'),_0x1a1c1d,JSON['stringify'](_0x5dba2f));_0x1255b0(_0x5dba2f);})[_0x8415('0x17')](function(_0x9a0933){logger['error'](_0x8415('0x11'),_0x9a0933[_0x8415('0x10')],_0x1a1c1d);_0x4efca2(_0x540750['error'](0x1f4,_0x9a0933[_0x8415('0x10')]));});});};exports[_0x8415('0x18')]=function(_0x455aee){var _0x1c9bed=this;return new Promise(function(_0x350040,_0x11bc2d){return db['WhatsappQueueReport'][_0x8415('0x19')](_0x455aee[_0x8415('0x14')],{'raw':_0x455aee[_0x8415('0x15')]?_0x455aee[_0x8415('0x15')][_0x8415('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x455aee[_0x8415('0x15')]?_0x455aee['options']['where']||null:null,'attributes':_0x455aee[_0x8415('0x15')]?_0x455aee[_0x8415('0x15')]['attributes']||null:null,'limit':_0x455aee['options']?_0x455aee[_0x8415('0x15')]['limit']||null:null})['then'](function(_0x6ce42c){logger[_0x8415('0x8')]('UpdateWhatsappQueueReport',_0x455aee);logger[_0x8415('0xb')](_0x8415('0x18'),_0x455aee,JSON[_0x8415('0xd')](_0x6ce42c));_0x350040(_0x6ce42c);})['catch'](function(_0x49c2dc){logger[_0x8415('0xe')](_0x8415('0x18'),_0x49c2dc[_0x8415('0x10')],_0x455aee);_0x11bc2d(_0x1c9bed[_0x8415('0xe')](0x1f4,_0x49c2dc[_0x8415('0x10')]));});});}; \ No newline at end of file +var _0x9087=['ioredis','../../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','stringify','error','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','UpdateWhatsappQueueReport','update','attributes','limit','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x567b01,_0xe370f){var _0x3225bf=function(_0x4cacb8){while(--_0x4cacb8){_0x567b01['push'](_0x567b01['shift']());}};_0x3225bf(++_0xe370f);}(_0x9087,0x1ea));var _0x7908=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9087[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7908('0x0'));var util=require(_0x7908('0x1'));var moment=require(_0x7908('0x2'));var BPromise=require(_0x7908('0x3'));var rs=require(_0x7908('0x4'));var fs=require('fs');var Redis=require(_0x7908('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7908('0x6'));var logger=require(_0x7908('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7908('0x8'));var client=jayson[_0x7908('0x9')][_0x7908('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37f770,_0x553986,_0x1ea20a){return new BPromise(function(_0xe217ff,_0x3a4f2c){return client[_0x7908('0xb')](_0x37f770,_0x1ea20a)['then'](function(_0xf743f9){logger[_0x7908('0xc')](_0x7908('0xd'),_0x553986,_0x7908('0xe'));logger[_0x7908('0xf')](_0x7908('0x10'),_0x553986,_0x7908('0xe'),JSON[_0x7908('0x11')](_0xf743f9));if(_0xf743f9[_0x7908('0x12')]){if(_0xf743f9[_0x7908('0x12')]['code']===0x1f4){logger[_0x7908('0x12')](_0x7908('0xd'),_0x553986,_0xf743f9['error'][_0x7908('0x13')]);return _0x3a4f2c(_0xf743f9['error'][_0x7908('0x13')]);}logger['error'](_0x7908('0xd'),_0x553986,_0xf743f9['error'][_0x7908('0x13')]);return _0xe217ff(_0xf743f9[_0x7908('0x12')][_0x7908('0x13')]);}else{logger[_0x7908('0xc')](_0x7908('0xd'),_0x553986,_0x7908('0xe'));_0xe217ff(_0xf743f9[_0x7908('0x14')]['message']);}})['catch'](function(_0x1e64c4){logger[_0x7908('0x12')](_0x7908('0xd'),_0x553986,_0x1e64c4);_0x3a4f2c(_0x1e64c4);});});}exports[_0x7908('0x15')]=function(_0x32e6a3){var _0x5640ef=this;return new Promise(function(_0x7cee13,_0x1371a1){return db[_0x7908('0x16')][_0x7908('0x17')](_0x32e6a3[_0x7908('0x18')],{'raw':_0x32e6a3[_0x7908('0x19')]?_0x32e6a3['options'][_0x7908('0x1a')]===undefined?!![]:![]:!![]})[_0x7908('0x1b')](function(_0x2c6336){logger[_0x7908('0xc')](_0x7908('0x15'),_0x32e6a3);logger[_0x7908('0xf')]('CreateWhatsappQueueReport',_0x32e6a3,JSON[_0x7908('0x11')](_0x2c6336));_0x7cee13(_0x2c6336);})['catch'](function(_0x504a23){logger['error'](_0x7908('0x15'),_0x504a23[_0x7908('0x13')],_0x32e6a3);_0x1371a1(_0x5640ef[_0x7908('0x12')](0x1f4,_0x504a23[_0x7908('0x13')]));});});};exports[_0x7908('0x1c')]=function(_0x4244f2){var _0x56be0a=this;return new Promise(function(_0x254cd8,_0x5b878b){return db[_0x7908('0x16')][_0x7908('0x1d')](_0x4244f2['body'],{'raw':_0x4244f2[_0x7908('0x19')]?_0x4244f2['options'][_0x7908('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4244f2[_0x7908('0x19')]?_0x4244f2[_0x7908('0x19')]['where']||null:null,'attributes':_0x4244f2['options']?_0x4244f2[_0x7908('0x19')][_0x7908('0x1e')]||null:null,'limit':_0x4244f2['options']?_0x4244f2[_0x7908('0x19')][_0x7908('0x1f')]||null:null})[_0x7908('0x1b')](function(_0x342014){logger['info']('UpdateWhatsappQueueReport',_0x4244f2);logger['debug'](_0x7908('0x1c'),_0x4244f2,JSON[_0x7908('0x11')](_0x342014));_0x254cd8(_0x342014);})[_0x7908('0x20')](function(_0x381cef){logger['error']('UpdateWhatsappQueueReport',_0x381cef[_0x7908('0x13')],_0x4244f2);_0x5b878b(_0x56be0a['error'](0x1f4,_0x381cef[_0x7908('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 4863414..94696ff 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 _0x9b72=['exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./whatsappTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put','delete','destroy'];(function(_0x49da81,_0x4fbe77){var _0xdeea45=function(_0x3c01b2){while(--_0x3c01b2){_0x49da81['push'](_0x49da81['shift']());}};_0xdeea45(++_0x4fbe77);}(_0x9b72,0x1e7));var _0x29b7=function(_0x3dda84,_0x3a2710){_0x3dda84=_0x3dda84-0x0;var _0x1e4982=_0x9b72[_0x3dda84];return _0x1e4982;};'use strict';var multer=require(_0x29b7('0x0'));var util=require(_0x29b7('0x1'));var path=require('path');var timeout=require(_0x29b7('0x2'));var express=require(_0x29b7('0x3'));var router=express['Router']();var fs_extra=require(_0x29b7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x29b7('0x5'));var config=require('../../config/environment');var controller=require(_0x29b7('0x6'));router[_0x29b7('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x29b7('0x7')](_0x29b7('0x8'),auth[_0x29b7('0x9')](),controller[_0x29b7('0xa')]);router[_0x29b7('0x7')](_0x29b7('0xb'),auth[_0x29b7('0x9')](),controller['show']);router[_0x29b7('0xc')]('/',auth[_0x29b7('0x9')](),controller[_0x29b7('0xd')]);router[_0x29b7('0xe')](_0x29b7('0xb'),auth[_0x29b7('0x9')](),controller['update']);router[_0x29b7('0xf')](_0x29b7('0xb'),auth[_0x29b7('0x9')](),controller[_0x29b7('0x10')]);module[_0x29b7('0x11')]=router; \ No newline at end of file +var _0x4022=['describe','/:id','post','create','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','get','/describe'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x4022,0x132));var _0x2402=function(_0x300d57,_0x589dc5){_0x300d57=_0x300d57-0x0;var _0x3f270c=_0x4022[_0x300d57];return _0x3f270c;};'use strict';var multer=require(_0x2402('0x0'));var util=require(_0x2402('0x1'));var path=require(_0x2402('0x2'));var timeout=require(_0x2402('0x3'));var express=require('express');var router=express[_0x2402('0x4')]();var fs_extra=require(_0x2402('0x5'));var auth=require(_0x2402('0x6'));var interaction=require(_0x2402('0x7'));var config=require(_0x2402('0x8'));var controller=require(_0x2402('0x9'));router['get']('/',auth[_0x2402('0xa')](),controller[_0x2402('0xb')]);router[_0x2402('0xc')](_0x2402('0xd'),auth['isAuthenticated'](),controller[_0x2402('0xe')]);router[_0x2402('0xc')](_0x2402('0xf'),auth[_0x2402('0xa')](),controller['show']);router[_0x2402('0x10')]('/',auth['isAuthenticated'](),controller[_0x2402('0x11')]);router['put'](_0x2402('0xf'),auth[_0x2402('0xa')](),controller['update']);router[_0x2402('0x12')](_0x2402('0xf'),auth[_0x2402('0xa')](),controller['destroy']);module[_0x2402('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 035eddd..5af826d 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 _0x3070=['agent','queue','DATE','exports','ENUM','account'];(function(_0xcf09d1,_0x1a54d4){var _0x3280e8=function(_0x510043){while(--_0x510043){_0xcf09d1['push'](_0xcf09d1['shift']());}};_0x3280e8(++_0x1a54d4);}(_0x3070,0x75));var _0x0307=function(_0x3767fe,_0x5c6ca6){_0x3767fe=_0x3767fe-0x0;var _0x52b799=_0x3070[_0x3767fe];return _0x52b799;};'use strict';var Sequelize=require('sequelize');module[_0x0307('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x0307('0x1')](_0x0307('0x2'),_0x0307('0x3'),_0x0307('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x0307('0x5')]}}; \ No newline at end of file +var _0xe6e4=['DATE','sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0x1a1554,_0x55e84c){var _0xc5461c=function(_0x24af80){while(--_0x24af80){_0x1a1554['push'](_0x1a1554['shift']());}};_0xc5461c(++_0x55e84c);}(_0xe6e4,0xc1));var _0x4e6e=function(_0x2d7b97,_0x3c00c5){_0x2d7b97=_0x2d7b97-0x0;var _0xd20f92=_0xe6e4[_0x2d7b97];return _0xd20f92;};'use strict';var Sequelize=require(_0x4e6e('0x0'));module[_0x4e6e('0x1')]={'uniqueid':{'type':Sequelize[_0x4e6e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4e6e('0x3')](_0x4e6e('0x4'),_0x4e6e('0x5'),_0x4e6e('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4e6e('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index ac626e9..115b3fc 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 _0x21f8=['keys','include','create','update','body','find','destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','reject','then','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params'];(function(_0x4363d0,_0x52508e){var _0x14d9bb=function(_0x143030){while(--_0x143030){_0x4363d0['push'](_0x4363d0['shift']());}};_0x14d9bb(++_0x52508e);}(_0x21f8,0x170));var _0x821f=function(_0x29d623,_0x1a5c9c){_0x29d623=_0x29d623-0x0;var _0x242e59=_0x21f8[_0x29d623];return _0x242e59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x821f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x821f('0x1'));var rp=require(_0x821f('0x2'));var moment=require(_0x821f('0x3'));var BPromise=require(_0x821f('0x4'));var Mustache=require(_0x821f('0x5'));var util=require(_0x821f('0x6'));var path=require(_0x821f('0x7'));var sox=require(_0x821f('0x8'));var csv=require(_0x821f('0x9'));var ejs=require(_0x821f('0xa'));var fs=require('fs');var fs_extra=require(_0x821f('0xb'));var _=require('lodash');var squel=require(_0x821f('0xc'));var crypto=require(_0x821f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x821f('0x9'));var querystring=require('querystring');var Papa=require(_0x821f('0xe'));var Redis=require(_0x821f('0xf'));var authService=require(_0x821f('0x10'));var qs=require(_0x821f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x821f('0x12'));var logger=require(_0x821f('0x13'))(_0x821f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x821f('0x15'));var db=require(_0x821f('0x16'))['db'];function respondWithStatusCode(_0x81aad9,_0x4f0f83){_0x4f0f83=_0x4f0f83||0xcc;return function(_0x2b9e7f){if(_0x2b9e7f){return _0x81aad9[_0x821f('0x17')](_0x4f0f83);}return _0x81aad9['status'](_0x4f0f83)[_0x821f('0x18')]();};}function respondWithResult(_0x366481,_0x571664){_0x571664=_0x571664||0xc8;return function(_0x336f37){if(_0x336f37){return _0x366481[_0x821f('0x19')](_0x571664)[_0x821f('0x1a')](_0x336f37);}};}function respondWithFilteredResult(_0x5254ca,_0x7677b8){return function(_0x914d84){if(_0x914d84){var _0x3a69d7=typeof _0x7677b8['offset']===_0x821f('0x1b')&&typeof _0x7677b8['limit']===_0x821f('0x1b');var _0x46ccfc=_0x914d84[_0x821f('0x1c')];var _0x4d0402=_0x3a69d7?0x0:_0x7677b8[_0x821f('0x1d')];var _0xb65631=_0x3a69d7?_0x914d84[_0x821f('0x1c')]:_0x7677b8[_0x821f('0x1d')]+_0x7677b8[_0x821f('0x1e')];var _0x246f8f;if(_0xb65631>=_0x46ccfc){_0xb65631=_0x46ccfc;_0x246f8f=0xc8;}else{_0x246f8f=0xce;}_0x5254ca['status'](_0x246f8f);return _0x5254ca[_0x821f('0x1f')]('Content-Range',_0x4d0402+'-'+_0xb65631+'/'+_0x46ccfc)[_0x821f('0x1a')](_0x914d84);}return null;};}function patchUpdates(_0x4e8f85){return function(_0x1f8488){try{jsonpatch['apply'](_0x1f8488,_0x4e8f85,!![]);}catch(_0x193b51){return BPromise[_0x821f('0x20')](_0x193b51);}return _0x1f8488['save']();};}function saveUpdates(_0x1e5ff3,_0x14a6c9){return function(_0x4882e5){if(_0x4882e5){return _0x4882e5['update'](_0x1e5ff3)[_0x821f('0x21')](function(_0x1b3ff4){return _0x1b3ff4;});}return null;};}function removeEntity(_0x18f62b,_0x3b9e5f){return function(_0x3afd21){if(_0x3afd21){return _0x3afd21['destroy']()[_0x821f('0x21')](function(){_0x18f62b[_0x821f('0x19')](0xcc)[_0x821f('0x18')]();});}};}function handleEntityNotFound(_0x3287e1,_0x29fe80){return function(_0x53667a){if(!_0x53667a){_0x3287e1[_0x821f('0x17')](0x194);}return _0x53667a;};}function handleError(_0x5a3524,_0x5d0146){_0x5d0146=_0x5d0146||0x1f4;return function(_0x23fedb){logger[_0x821f('0x22')](_0x23fedb[_0x821f('0x23')]);if(_0x23fedb['name']){delete _0x23fedb[_0x821f('0x24')];}_0x5a3524[_0x821f('0x19')](_0x5d0146)[_0x821f('0x25')](_0x23fedb);};}exports[_0x821f('0x26')]=function(_0x2a4433,_0x403d42){var _0x240447={},_0x31cfdd={},_0x4fa68c={'count':0x0,'rows':[]};var _0x1c3454=_[_0x821f('0x27')](db[_0x821f('0x28')][_0x821f('0x29')],function(_0x29ed92){return{'name':_0x29ed92[_0x821f('0x2a')],'type':_0x29ed92[_0x821f('0x2b')]['key']};});_0x31cfdd[_0x821f('0x2c')]=_[_0x821f('0x27')](_0x1c3454,_0x821f('0x24'));_0x31cfdd[_0x821f('0x2d')]=_['keys'](_0x2a4433[_0x821f('0x2d')]);_0x31cfdd[_0x821f('0x2e')]=_[_0x821f('0x2f')](_0x31cfdd['model'],_0x31cfdd[_0x821f('0x2d')]);_0x240447[_0x821f('0x30')]=_['intersection'](_0x31cfdd[_0x821f('0x2c')],qs[_0x821f('0x31')](_0x2a4433[_0x821f('0x2d')][_0x821f('0x31')]));_0x240447[_0x821f('0x30')]=_0x240447['attributes'][_0x821f('0x32')]?_0x240447['attributes']:_0x31cfdd[_0x821f('0x2c')];if(!_0x2a4433[_0x821f('0x2d')][_0x821f('0x33')]('nolimit')){_0x240447[_0x821f('0x1e')]=qs[_0x821f('0x1e')](_0x2a4433['query'][_0x821f('0x1e')]);_0x240447[_0x821f('0x1d')]=qs[_0x821f('0x1d')](_0x2a4433[_0x821f('0x2d')]['offset']);}_0x240447[_0x821f('0x34')]=qs[_0x821f('0x35')](_0x2a4433[_0x821f('0x2d')][_0x821f('0x35')]);_0x240447[_0x821f('0x36')]=qs['filters'](_[_0x821f('0x37')](_0x2a4433[_0x821f('0x2d')],_0x31cfdd[_0x821f('0x2e')]),_0x1c3454);if(_0x2a4433[_0x821f('0x2d')][_0x821f('0x38')]){_0x240447[_0x821f('0x36')]=_[_0x821f('0x39')](_0x240447[_0x821f('0x36')],{'$or':_[_0x821f('0x27')](_0x1c3454,function(_0x598130){if(_0x598130[_0x821f('0x2b')]!=='VIRTUAL'){var _0x4f92a0={};_0x4f92a0[_0x598130[_0x821f('0x24')]]={'$like':'%'+_0x2a4433['query']['filter']+'%'};return _0x4f92a0;}})});}_0x240447=_[_0x821f('0x39')]({},_0x240447,_0x2a4433[_0x821f('0x3a')]);var _0x4cc2e7={'where':_0x240447['where']};return db[_0x821f('0x28')]['count'](_0x4cc2e7)[_0x821f('0x21')](function(_0x47d920){_0x4fa68c[_0x821f('0x1c')]=_0x47d920;if(_0x2a4433['query'][_0x821f('0x3b')]){_0x240447['include']=[{'all':!![]}];}return db[_0x821f('0x28')][_0x821f('0x3c')](_0x240447);})[_0x821f('0x21')](function(_0x3717e3){_0x4fa68c[_0x821f('0x3d')]=_0x3717e3;return _0x4fa68c;})[_0x821f('0x21')](respondWithFilteredResult(_0x403d42,_0x240447))[_0x821f('0x3e')](handleError(_0x403d42,null));};exports['show']=function(_0x27d74c,_0x529d17){var _0x1f9aa5={'raw':!![],'where':{'id':_0x27d74c[_0x821f('0x3f')]['id']}},_0x139485={};_0x139485[_0x821f('0x2c')]=_[_0x821f('0x40')](db['WhatsappTransferReport'][_0x821f('0x29')]);_0x139485[_0x821f('0x2d')]=_[_0x821f('0x40')](_0x27d74c['query']);_0x139485['filters']=_[_0x821f('0x2f')](_0x139485[_0x821f('0x2c')],_0x139485[_0x821f('0x2d')]);_0x1f9aa5[_0x821f('0x30')]=_[_0x821f('0x2f')](_0x139485[_0x821f('0x2c')],qs[_0x821f('0x31')](_0x27d74c[_0x821f('0x2d')][_0x821f('0x31')]));_0x1f9aa5[_0x821f('0x30')]=_0x1f9aa5[_0x821f('0x30')]['length']?_0x1f9aa5[_0x821f('0x30')]:_0x139485[_0x821f('0x2c')];if(_0x27d74c['query'][_0x821f('0x3b')]){_0x1f9aa5[_0x821f('0x41')]=[{'all':!![]}];}_0x1f9aa5=_[_0x821f('0x39')]({},_0x1f9aa5,_0x27d74c[_0x821f('0x3a')]);return db[_0x821f('0x28')]['find'](_0x1f9aa5)[_0x821f('0x21')](handleEntityNotFound(_0x529d17,null))['then'](respondWithResult(_0x529d17,null))['catch'](handleError(_0x529d17,null));};exports['create']=function(_0x545d4f,_0x561cec){return db[_0x821f('0x28')][_0x821f('0x42')](_0x545d4f['body'],{})[_0x821f('0x21')](respondWithResult(_0x561cec,0xc9))['catch'](handleError(_0x561cec,null));};exports[_0x821f('0x43')]=function(_0x77b87c,_0x53734c){if(_0x77b87c[_0x821f('0x44')]['id']){delete _0x77b87c[_0x821f('0x44')]['id'];}return db[_0x821f('0x28')][_0x821f('0x45')]({'where':{'id':_0x77b87c[_0x821f('0x3f')]['id']}})[_0x821f('0x21')](handleEntityNotFound(_0x53734c,null))['then'](saveUpdates(_0x77b87c[_0x821f('0x44')],null))[_0x821f('0x21')](respondWithResult(_0x53734c,null))[_0x821f('0x3e')](handleError(_0x53734c,null));};exports[_0x821f('0x46')]=function(_0x234f0a,_0x4c9d3){return db[_0x821f('0x28')][_0x821f('0x45')]({'where':{'id':_0x234f0a[_0x821f('0x3f')]['id']}})[_0x821f('0x21')](handleEntityNotFound(_0x4c9d3,null))[_0x821f('0x21')](removeEntity(_0x4c9d3,null))[_0x821f('0x3e')](handleError(_0x4c9d3,null));};exports[_0x821f('0x47')]=function(_0x44cd7f,_0x260347){return db[_0x821f('0x28')][_0x821f('0x47')]()[_0x821f('0x21')](respondWithResult(_0x260347,null))[_0x821f('0x3e')](handleError(_0x260347,null));}; \ No newline at end of file +var _0xcff2=['offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','filters','intersection','find','create','body','catch','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x1da796,_0x4afa84){var _0x6751f5=function(_0x2e5abb){while(--_0x2e5abb){_0x1da796['push'](_0x1da796['shift']());}};_0x6751f5(++_0x4afa84);}(_0xcff2,0x172));var _0x2cff=function(_0x6eb833,_0x2bb5e5){_0x6eb833=_0x6eb833-0x0;var _0xdfc38c=_0xcff2[_0x6eb833];return _0xdfc38c;};'use strict';var emlformat=require(_0x2cff('0x0'));var rimraf=require(_0x2cff('0x1'));var zipdir=require(_0x2cff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cff('0x3'));var moment=require(_0x2cff('0x4'));var BPromise=require(_0x2cff('0x5'));var Mustache=require(_0x2cff('0x6'));var util=require(_0x2cff('0x7'));var path=require(_0x2cff('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2cff('0x9'));var _=require(_0x2cff('0xa'));var squel=require(_0x2cff('0xb'));var crypto=require(_0x2cff('0xc'));var jsforce=require(_0x2cff('0xd'));var deskjs=require(_0x2cff('0xe'));var toCsv=require(_0x2cff('0xf'));var querystring=require(_0x2cff('0x10'));var Papa=require(_0x2cff('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2cff('0x12'));var as=require(_0x2cff('0x13'));var hardwareService=require(_0x2cff('0x14'));var logger=require(_0x2cff('0x15'))('api');var utils=require(_0x2cff('0x16'));var config=require(_0x2cff('0x17'));var licenseUtil=require(_0x2cff('0x18'));var db=require(_0x2cff('0x19'))['db'];function respondWithStatusCode(_0x5c81e4,_0x45df27){_0x45df27=_0x45df27||0xcc;return function(_0x3e6734){if(_0x3e6734){return _0x5c81e4[_0x2cff('0x1a')](_0x45df27);}return _0x5c81e4[_0x2cff('0x1b')](_0x45df27)[_0x2cff('0x1c')]();};}function respondWithResult(_0x3ca6f2,_0x2855c9){_0x2855c9=_0x2855c9||0xc8;return function(_0x32b605){if(_0x32b605){return _0x3ca6f2[_0x2cff('0x1b')](_0x2855c9)[_0x2cff('0x1d')](_0x32b605);}};}function respondWithFilteredResult(_0x1026a4,_0x54be6b){return function(_0x45fd09){if(_0x45fd09){var _0x2e2229=typeof _0x54be6b[_0x2cff('0x1e')]===_0x2cff('0x1f')&&typeof _0x54be6b['limit']==='undefined';var _0x53b53d=_0x45fd09[_0x2cff('0x20')];var _0x4e64cc=_0x2e2229?0x0:_0x54be6b['offset'];var _0x3c1dd3=_0x2e2229?_0x45fd09[_0x2cff('0x20')]:_0x54be6b['offset']+_0x54be6b['limit'];var _0x43ce20;if(_0x3c1dd3>=_0x53b53d){_0x3c1dd3=_0x53b53d;_0x43ce20=0xc8;}else{_0x43ce20=0xce;}_0x1026a4[_0x2cff('0x1b')](_0x43ce20);return _0x1026a4[_0x2cff('0x21')](_0x2cff('0x22'),_0x4e64cc+'-'+_0x3c1dd3+'/'+_0x53b53d)[_0x2cff('0x1d')](_0x45fd09);}return null;};}function patchUpdates(_0xed5c49){return function(_0x32ab56){try{jsonpatch[_0x2cff('0x23')](_0x32ab56,_0xed5c49,!![]);}catch(_0x199830){return BPromise[_0x2cff('0x24')](_0x199830);}return _0x32ab56['save']();};}function saveUpdates(_0xa415a1,_0x21846b){return function(_0x1c97ca){if(_0x1c97ca){return _0x1c97ca[_0x2cff('0x25')](_0xa415a1)[_0x2cff('0x26')](function(_0x10b788){return _0x10b788;});}return null;};}function removeEntity(_0x3245e3,_0x288a26){return function(_0x1622de){if(_0x1622de){return _0x1622de[_0x2cff('0x27')]()['then'](function(){_0x3245e3['status'](0xcc)[_0x2cff('0x1c')]();});}};}function handleEntityNotFound(_0x40aa1d,_0x29e39a){return function(_0x4cc3ca){if(!_0x4cc3ca){_0x40aa1d['sendStatus'](0x194);}return _0x4cc3ca;};}function handleError(_0x246a82,_0x2edc31){_0x2edc31=_0x2edc31||0x1f4;return function(_0x3982c8){logger[_0x2cff('0x28')](_0x3982c8['stack']);if(_0x3982c8['name']){delete _0x3982c8[_0x2cff('0x29')];}_0x246a82[_0x2cff('0x1b')](_0x2edc31)[_0x2cff('0x2a')](_0x3982c8);};}exports[_0x2cff('0x2b')]=function(_0xb43046,_0x23e2fc){var _0x598705={},_0x467c21={},_0x4efdb={'count':0x0,'rows':[]};var _0x50a72b=_[_0x2cff('0x2c')](db[_0x2cff('0x2d')][_0x2cff('0x2e')],function(_0x30f346){return{'name':_0x30f346[_0x2cff('0x2f')],'type':_0x30f346[_0x2cff('0x30')][_0x2cff('0x31')]};});_0x467c21[_0x2cff('0x32')]=_[_0x2cff('0x2c')](_0x50a72b,_0x2cff('0x29'));_0x467c21[_0x2cff('0x33')]=_[_0x2cff('0x34')](_0xb43046[_0x2cff('0x33')]);_0x467c21['filters']=_['intersection'](_0x467c21[_0x2cff('0x32')],_0x467c21[_0x2cff('0x33')]);_0x598705[_0x2cff('0x35')]=_['intersection'](_0x467c21[_0x2cff('0x32')],qs['fields'](_0xb43046[_0x2cff('0x33')][_0x2cff('0x36')]));_0x598705[_0x2cff('0x35')]=_0x598705[_0x2cff('0x35')][_0x2cff('0x37')]?_0x598705[_0x2cff('0x35')]:_0x467c21[_0x2cff('0x32')];if(!_0xb43046['query'][_0x2cff('0x38')](_0x2cff('0x39'))){_0x598705['limit']=qs[_0x2cff('0x3a')](_0xb43046[_0x2cff('0x33')][_0x2cff('0x3a')]);_0x598705['offset']=qs[_0x2cff('0x1e')](_0xb43046[_0x2cff('0x33')][_0x2cff('0x1e')]);}_0x598705[_0x2cff('0x3b')]=qs[_0x2cff('0x3c')](_0xb43046['query'][_0x2cff('0x3c')]);_0x598705[_0x2cff('0x3d')]=qs['filters'](_[_0x2cff('0x3e')](_0xb43046[_0x2cff('0x33')],_0x467c21['filters']),_0x50a72b);if(_0xb43046[_0x2cff('0x33')][_0x2cff('0x3f')]){_0x598705['where']=_[_0x2cff('0x40')](_0x598705[_0x2cff('0x3d')],{'$or':_[_0x2cff('0x2c')](_0x50a72b,function(_0x3d7403){if(_0x3d7403[_0x2cff('0x30')]!==_0x2cff('0x41')){var _0x543b4d={};_0x543b4d[_0x3d7403[_0x2cff('0x29')]]={'$like':'%'+_0xb43046[_0x2cff('0x33')][_0x2cff('0x3f')]+'%'};return _0x543b4d;}})});}_0x598705=_[_0x2cff('0x40')]({},_0x598705,_0xb43046[_0x2cff('0x42')]);var _0x36bb4b={'where':_0x598705[_0x2cff('0x3d')]};return db[_0x2cff('0x2d')]['count'](_0x36bb4b)[_0x2cff('0x26')](function(_0x5c5885){_0x4efdb['count']=_0x5c5885;if(_0xb43046[_0x2cff('0x33')][_0x2cff('0x43')]){_0x598705[_0x2cff('0x44')]=[{'all':!![]}];}return db[_0x2cff('0x2d')][_0x2cff('0x45')](_0x598705);})['then'](function(_0x3bc932){_0x4efdb[_0x2cff('0x46')]=_0x3bc932;return _0x4efdb;})[_0x2cff('0x26')](respondWithFilteredResult(_0x23e2fc,_0x598705))['catch'](handleError(_0x23e2fc,null));};exports[_0x2cff('0x47')]=function(_0x5d4580,_0x29e330){var _0x546c84={'raw':!![],'where':{'id':_0x5d4580['params']['id']}},_0x4da4b5={};_0x4da4b5[_0x2cff('0x32')]=_['keys'](db[_0x2cff('0x2d')][_0x2cff('0x2e')]);_0x4da4b5['query']=_[_0x2cff('0x34')](_0x5d4580[_0x2cff('0x33')]);_0x4da4b5[_0x2cff('0x48')]=_[_0x2cff('0x49')](_0x4da4b5[_0x2cff('0x32')],_0x4da4b5[_0x2cff('0x33')]);_0x546c84[_0x2cff('0x35')]=_['intersection'](_0x4da4b5[_0x2cff('0x32')],qs[_0x2cff('0x36')](_0x5d4580[_0x2cff('0x33')]['fields']));_0x546c84[_0x2cff('0x35')]=_0x546c84[_0x2cff('0x35')][_0x2cff('0x37')]?_0x546c84['attributes']:_0x4da4b5['model'];if(_0x5d4580['query'][_0x2cff('0x43')]){_0x546c84[_0x2cff('0x44')]=[{'all':!![]}];}_0x546c84=_[_0x2cff('0x40')]({},_0x546c84,_0x5d4580[_0x2cff('0x42')]);return db['WhatsappTransferReport'][_0x2cff('0x4a')](_0x546c84)['then'](handleEntityNotFound(_0x29e330,null))['then'](respondWithResult(_0x29e330,null))['catch'](handleError(_0x29e330,null));};exports['create']=function(_0x2b61f5,_0x7084e3){return db[_0x2cff('0x2d')][_0x2cff('0x4b')](_0x2b61f5[_0x2cff('0x4c')],{})[_0x2cff('0x26')](respondWithResult(_0x7084e3,0xc9))[_0x2cff('0x4d')](handleError(_0x7084e3,null));};exports[_0x2cff('0x25')]=function(_0x116943,_0x5d4662){if(_0x116943[_0x2cff('0x4c')]['id']){delete _0x116943[_0x2cff('0x4c')]['id'];}return db[_0x2cff('0x2d')][_0x2cff('0x4a')]({'where':{'id':_0x116943[_0x2cff('0x4e')]['id']}})[_0x2cff('0x26')](handleEntityNotFound(_0x5d4662,null))[_0x2cff('0x26')](saveUpdates(_0x116943[_0x2cff('0x4c')],null))['then'](respondWithResult(_0x5d4662,null))[_0x2cff('0x4d')](handleError(_0x5d4662,null));};exports[_0x2cff('0x27')]=function(_0x54785f,_0x25412d){return db[_0x2cff('0x2d')][_0x2cff('0x4a')]({'where':{'id':_0x54785f[_0x2cff('0x4e')]['id']}})[_0x2cff('0x26')](handleEntityNotFound(_0x25412d,null))[_0x2cff('0x26')](removeEntity(_0x25412d,null))[_0x2cff('0x4d')](handleError(_0x25412d,null));};exports[_0x2cff('0x4f')]=function(_0x351ac6,_0x1057cf){return db['WhatsappTransferReport'][_0x2cff('0x4f')]()[_0x2cff('0x26')](respondWithResult(_0x1057cf,null))['catch'](handleError(_0x1057cf,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index cfe0920..bcf4503 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 _0x5e20=['uniqueid','lodash','util','../../config/logger','moment','bluebird','rimraf','./whatsappTransferReport.attributes','define','report_whatsapp_transfer'];(function(_0x1293fa,_0x446d6b){var _0x1dd054=function(_0x1b2d93){while(--_0x1b2d93){_0x1293fa['push'](_0x1293fa['shift']());}};_0x1dd054(++_0x446d6b);}(_0x5e20,0xd3));var _0x05e2=function(_0x304afd,_0x4ce0e6){_0x304afd=_0x304afd-0x0;var _0x34880c=_0x5e20[_0x304afd];return _0x34880c;};'use strict';var _=require(_0x05e2('0x0'));var util=require(_0x05e2('0x1'));var logger=require(_0x05e2('0x2'))('api');var moment=require(_0x05e2('0x3'));var BPromise=require(_0x05e2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x05e2('0x5'));var config=require('../../config/environment');var attributes=require(_0x05e2('0x6'));module['exports']=function(_0x3a5c1b,_0x183b78){return _0x3a5c1b[_0x05e2('0x7')]('WhatsappTransferReport',attributes,{'tableName':_0x05e2('0x8'),'paranoid':![],'indexes':[{'name':_0x05e2('0x9'),'fields':[_0x05e2('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x558a=['bluebird','request-promise','path','../../config/environment','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','api','moment'];(function(_0x2e2441,_0x50ad4f){var _0x50032e=function(_0x50f53a){while(--_0x50f53a){_0x2e2441['push'](_0x2e2441['shift']());}};_0x50032e(++_0x50ad4f);}(_0x558a,0x13d));var _0xa558=function(_0x297cdc,_0x571982){_0x297cdc=_0x297cdc-0x0;var _0x4604a1=_0x558a[_0x297cdc];return _0x4604a1;};'use strict';var _=require(_0xa558('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa558('0x1'));var moment=require(_0xa558('0x2'));var BPromise=require(_0xa558('0x3'));var rp=require(_0xa558('0x4'));var fs=require('fs');var path=require(_0xa558('0x5'));var rimraf=require('rimraf');var config=require(_0xa558('0x6'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x39114a,_0x2c9d8e){return _0x39114a['define'](_0xa558('0x7'),attributes,{'tableName':_0xa558('0x8'),'paranoid':![],'indexes':[{'name':_0xa558('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index b2650e8..bd17502 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 _0x0528=['request','WhatsappTransferReport,\x20%s,\x20%s','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x52bfc0,_0x22db3c){var _0x3a6b54=function(_0x2fdf25){while(--_0x2fdf25){_0x52bfc0['push'](_0x52bfc0['shift']());}};_0x3a6b54(++_0x22db3c);}(_0x0528,0x172));var _0x8052=function(_0x1d88d2,_0x173738){_0x1d88d2=_0x1d88d2-0x0;var _0x2c3b92=_0x0528[_0x1d88d2];return _0x2c3b92;};'use strict';var _=require('lodash');var util=require(_0x8052('0x0'));var moment=require(_0x8052('0x1'));var BPromise=require(_0x8052('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8052('0x3'))['db'];var utils=require(_0x8052('0x4'));var logger=require('../../config/logger')(_0x8052('0x5'));var config=require(_0x8052('0x6'));var jayson=require(_0x8052('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31f171,_0x50d645,_0x17c0c5){return new BPromise(function(_0x528d04,_0x3dd78e){return client[_0x8052('0x8')](_0x31f171,_0x17c0c5)['then'](function(_0x5efc6b){logger['info'](_0x8052('0x9'),_0x50d645,'request\x20sent');logger['debug'](_0x8052('0xa'),_0x50d645,_0x8052('0xb'),JSON[_0x8052('0xc')](_0x5efc6b));if(_0x5efc6b['error']){if(_0x5efc6b[_0x8052('0xd')][_0x8052('0xe')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x50d645,_0x5efc6b['error'][_0x8052('0xf')]);return _0x3dd78e(_0x5efc6b[_0x8052('0xd')][_0x8052('0xf')]);}logger[_0x8052('0xd')](_0x8052('0x9'),_0x50d645,_0x5efc6b['error']['message']);return _0x528d04(_0x5efc6b[_0x8052('0xd')][_0x8052('0xf')]);}else{logger['info'](_0x8052('0x9'),_0x50d645,_0x8052('0xb'));_0x528d04(_0x5efc6b[_0x8052('0x10')]['message']);}})[_0x8052('0x11')](function(_0xb52aaa){logger[_0x8052('0xd')](_0x8052('0x9'),_0x50d645,_0xb52aaa);_0x3dd78e(_0xb52aaa);});});} \ No newline at end of file +var _0xbebd=['then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x5ad70b,_0x5251c4){var _0x5c36e7=function(_0x4ce545){while(--_0x4ce545){_0x5ad70b['push'](_0x5ad70b['shift']());}};_0x5c36e7(++_0x5251c4);}(_0xbebd,0x1ab));var _0xdbeb=function(_0x90b682,_0x204cdb){_0x90b682=_0x90b682-0x0;var _0x556ba1=_0xbebd[_0x90b682];return _0x556ba1;};'use strict';var _=require(_0xdbeb('0x0'));var util=require(_0xdbeb('0x1'));var moment=require('moment');var BPromise=require(_0xdbeb('0x2'));var rs=require(_0xdbeb('0x3'));var fs=require('fs');var Redis=require(_0xdbeb('0x4'));var db=require(_0xdbeb('0x5'))['db'];var utils=require(_0xdbeb('0x6'));var logger=require(_0xdbeb('0x7'))(_0xdbeb('0x8'));var config=require(_0xdbeb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdbeb('0xa')][_0xdbeb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xab6610,_0x985480,_0x494e71){return new BPromise(function(_0x2980ca,_0x149774){return client[_0xdbeb('0xc')](_0xab6610,_0x494e71)[_0xdbeb('0xd')](function(_0x5bbf4a){logger[_0xdbeb('0xe')](_0xdbeb('0xf'),_0x985480,_0xdbeb('0x10'));logger[_0xdbeb('0x11')](_0xdbeb('0x12'),_0x985480,'request\x20sent',JSON['stringify'](_0x5bbf4a));if(_0x5bbf4a[_0xdbeb('0x13')]){if(_0x5bbf4a[_0xdbeb('0x13')][_0xdbeb('0x14')]===0x1f4){logger['error'](_0xdbeb('0xf'),_0x985480,_0x5bbf4a[_0xdbeb('0x13')][_0xdbeb('0x15')]);return _0x149774(_0x5bbf4a['error'][_0xdbeb('0x15')]);}logger['error'](_0xdbeb('0xf'),_0x985480,_0x5bbf4a[_0xdbeb('0x13')][_0xdbeb('0x15')]);return _0x2980ca(_0x5bbf4a['error'][_0xdbeb('0x15')]);}else{logger['info'](_0xdbeb('0xf'),_0x985480,_0xdbeb('0x10'));_0x2980ca(_0x5bbf4a['result'][_0xdbeb('0x15')]);}})['catch'](function(_0x46b13e){logger[_0xdbeb('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x985480,_0x46b13e);_0x149774(_0x46b13e);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 7e1c316..e3f02de 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdb3=['./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','seedDB','then','default','listen','start','info','filter','exitCode','number','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','Offline\x20apps:','join','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/license','./config/logger'];(function(_0x1aeda2,_0x1217eb){var _0x32dc6d=function(_0x34a460){while(--_0x34a460){_0x1aeda2['push'](_0x1aeda2['shift']());}};_0x32dc6d(++_0x1217eb);}(_0xfdb3,0x10c));var _0x3fdb=function(_0x569e00,_0x4942ee){_0x569e00=_0x569e00-0x0;var _0x3367fb=_0xfdb3[_0x569e00];return _0x3367fb;};'use strict';var _=require(_0x3fdb('0x0'));var db=require(_0x3fdb('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x3fdb('0x2'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require(_0x3fdb('0x3'))('app');var pm2=require(_0x3fdb('0x4'));var pm2Config=require(_0x3fdb('0x5'));var schedule=require(_0x3fdb('0x6'));var chat=require(_0x3fdb('0x7'));var whatsapp=require(_0x3fdb('0x8'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x3fdb('0x9'));function main(){return db[_0x3fdb('0xa')][_0x3fdb('0xb')]()['then'](function(){if(config[_0x3fdb('0xc')]){return seedDb['default']();}})[_0x3fdb('0xd')](function(){return checkLicense[_0x3fdb('0xe')]();})[_0x3fdb('0xd')](function(){return rpc[_0x3fdb('0xf')]();})[_0x3fdb('0xd')](function(_0x5bbb9f){logger['info'](_0x5bbb9f);return chat['start']();})['then'](function(){return whatsapp[_0x3fdb('0x10')]();})[_0x3fdb('0xd')](function(){return schedule[_0x3fdb('0x10')]();})[_0x3fdb('0xd')](function(){return transcribe[_0x3fdb('0x10')]();})[_0x3fdb('0xd')](function(){return provider[_0x3fdb('0x10')]();})[_0x3fdb('0xd')](function(_0x1a6dbc){logger[_0x3fdb('0x11')](_0x1a6dbc);return pm2['start'](pm2Config);})[_0x3fdb('0xd')](function(_0x1a5dd8){var _0x4cbc07=_0x1a5dd8[_0x3fdb('0x12')](function(_0x31cd0e){return typeof _0x31cd0e[_0x3fdb('0x13')]===_0x3fdb('0x14')&&_0x31cd0e['exitCode']>=0x0;});if(_0x4cbc07['length']>0x0){throw new Error(_0x4cbc07['length']+_0x3fdb('0x15')+_[_0x3fdb('0x16')](_0x4cbc07,function(_0x11d57d){return'\x22'+_0x11d57d[_0x3fdb('0x17')][_0x3fdb('0x18')]+'\x22';}));}logger['info'](_0x3fdb('0x19'),_[_0x3fdb('0x16')](_[_0x3fdb('0x12')](_0x1a5dd8,{'status':_0x3fdb('0x1a')}),_0x3fdb('0x18'))['join']());logger[_0x3fdb('0x11')](_0x3fdb('0x1b'),_[_0x3fdb('0x16')](_[_0x3fdb('0x12')](_0x1a5dd8,function(_0x403f48){return _0x403f48['status']!==_0x3fdb('0x1a');}),'name')[_0x3fdb('0x1c')]()||'None');console['log']('App\x20Ready!');})['catch'](function(_0x171837){console[_0x3fdb('0x1d')](_0x3fdb('0x1e'),_0x171837);logger[_0x3fdb('0x1f')](_0x3fdb('0x20'),_0x171837);process[_0x3fdb('0x21')](0x1);});}main(); \ No newline at end of file +var _0x536e=['./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','default','listen','start','info','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','join','Offline\x20apps:','filter','status','online','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x536e,0x155));var _0xe536=function(_0x2656a4,_0x28dd1b){_0x2656a4=_0x2656a4-0x0;var _0x48ce85=_0x536e[_0x2656a4];return _0x48ce85;};'use strict';var _=require(_0xe536('0x0'));var db=require(_0xe536('0x1'))['db'];var seedDb=require(_0xe536('0x2'));var checkLicense=require(_0xe536('0x3'));var rpc=require(_0xe536('0x4'));var config=require(_0xe536('0x5'));var logger=require(_0xe536('0x6'))(_0xe536('0x7'));var pm2=require(_0xe536('0x8'));var pm2Config=require(_0xe536('0x9'));var schedule=require(_0xe536('0xa'));var chat=require(_0xe536('0xb'));var whatsapp=require(_0xe536('0xc'));var transcribe=require(_0xe536('0xd'));var provider=require('./config/schedule/cloud-provider');function main(){return db['sequelize'][_0xe536('0xe')]()[_0xe536('0xf')](function(){if(config['seedDB']){return seedDb[_0xe536('0x10')]();}})[_0xe536('0xf')](function(){return checkLicense[_0xe536('0x10')]();})[_0xe536('0xf')](function(){return rpc[_0xe536('0x11')]();})[_0xe536('0xf')](function(_0xe08ef0){logger['info'](_0xe08ef0);return chat['start']();})[_0xe536('0xf')](function(){return whatsapp[_0xe536('0x12')]();})['then'](function(){return schedule[_0xe536('0x12')]();})[_0xe536('0xf')](function(){return transcribe[_0xe536('0x12')]();})[_0xe536('0xf')](function(){return provider[_0xe536('0x12')]();})[_0xe536('0xf')](function(_0x498591){logger[_0xe536('0x13')](_0x498591);return pm2[_0xe536('0x12')](pm2Config);})[_0xe536('0xf')](function(_0x32e841){var _0x349020=_0x32e841['filter'](function(_0x410583){return typeof _0x410583[_0xe536('0x14')]===_0xe536('0x15')&&_0x410583['exitCode']>=0x0;});if(_0x349020[_0xe536('0x16')]>0x0){throw new Error(_0x349020[_0xe536('0x16')]+_0xe536('0x17')+_[_0xe536('0x18')](_0x349020,function(_0x4cf519){return'\x22'+_0x4cf519['pm2_env'][_0xe536('0x19')]+'\x22';}));}logger[_0xe536('0x13')](_0xe536('0x1a'),_[_0xe536('0x18')](_['filter'](_0x32e841,{'status':'online'}),_0xe536('0x19'))[_0xe536('0x1b')]());logger[_0xe536('0x13')](_0xe536('0x1c'),_[_0xe536('0x18')](_[_0xe536('0x1d')](_0x32e841,function(_0x3c3e82){return _0x3c3e82[_0xe536('0x1e')]!==_0xe536('0x1f');}),_0xe536('0x19'))[_0xe536('0x1b')]()||'None');console['log'](_0xe536('0x20'));})[_0xe536('0x21')](function(_0x5a034d){console['log'](_0xe536('0x22'),_0x5a034d);logger[_0xe536('0x23')](_0xe536('0x24'),_0x5a034d);process[_0xe536('0x25')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index c953563..65ac43d 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 _0xb43b=['headers','then','authenticate','pass','status','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','find','sub','allowedLoginAttempts','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','minutes','User\x20object\x20not\x20found.','getLicense','update','Forbidden','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','apiKeyNonce','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','unshift','encryptString','join','promisify','sign','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','moment','session','role','fullname','name','internal','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','allowmessenger','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarPrefixRequired','phoneBarRemoteControl','interface','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','whatsappAutoanswer','isChatInteractionAuthorized','use','ChatInteraction','findOne','params','closed','disposition','unmanaged','json','Forbidden.','catch','isAuthenticated','authorization','startsWith'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x355208,_0x2e11b3){_0x355208=_0x355208-0x0;var _0x4ea2b8=_0xb43b[_0x355208];return _0x4ea2b8;};'use strict';var db=require(_0xbb43('0x0'))['db'];var config=require(_0xbb43('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xbb43('0x2'));var encryptor=require(_0xbb43('0x3'));var _=require(_0xbb43('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xbb43('0x5'));var compose=require(_0xbb43('0x6'));var basicAuth=require(_0xbb43('0x7'));var crypto=require(_0xbb43('0x8'));var BPromise=require('bluebird');var util=require('util');var moment=require(_0xbb43('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0xbb43('0xa')]});var userAttributes=['id',_0xbb43('0xb'),_0xbb43('0xc'),_0xbb43('0xd'),_0xbb43('0xe'),'email',_0xbb43('0xf'),_0xbb43('0x10'),'md5secret',_0xbb43('0x11'),_0xbb43('0x12'),_0xbb43('0x13'),_0xbb43('0x14'),_0xbb43('0x15'),_0xbb43('0x16'),'pauseType',_0xbb43('0x17'),_0xbb43('0x18'),'lastPauseAt','crudPermissions',_0xbb43('0x19'),'passwordResetAt','alias',_0xbb43('0x1a'),'phoneBarAutoAnswerDelay',_0xbb43('0x1b'),_0xbb43('0x1c'),'phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires',_0xbb43('0x1d'),_0xbb43('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0xbb43('0x1f'),'userProfileId','privacyEnabled',_0xbb43('0x20'),_0xbb43('0x21'),_0xbb43('0x22'),'downloadOmnichannelInteractions',_0xbb43('0x23'),'ignorePauseForPreviewCalls',_0xbb43('0x24'),_0xbb43('0x25'),'chatAutoanswerDelay','emailAutoanswer',_0xbb43('0x26'),_0xbb43('0x27'),_0xbb43('0x28'),_0xbb43('0x29'),'openchannelAutoanswerDelay',_0xbb43('0x2a'),'faxAutoanswerDelay',_0xbb43('0x2b'),'whatsappAutoanswerDelay'];exports[_0xbb43('0x2c')]=function(){return this['isAuthenticated'](!![])[_0xbb43('0x2d')](function(_0x451cbd,_0x577ddd,_0x1d0768){if(_0x451cbd['user']){_0x1d0768();}else{return db[_0xbb43('0x2e')][_0xbb43('0x2f')]({'where':{'id':_0x451cbd[_0xbb43('0x30')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})['then'](function(_0x269ca5){if(_0x269ca5&&_0x269ca5[_0xbb43('0x31')]){return _0x577ddd['status'](_0x269ca5[_0xbb43('0x32')]===_0xbb43('0x33')?0x195:0x193)[_0xbb43('0x34')]({'message':_0x269ca5[_0xbb43('0x32')]==='unmanaged'?'Unmanaged.':_0xbb43('0x35')});}else{_0x1d0768();}})[_0xbb43('0x36')](function(_0xa88db0){_0x1d0768(_0xa88db0);});}});};exports[_0xbb43('0x37')]=function isAuthenticated(_0x510b05){return compose()[_0xbb43('0x2d')](function(_0x21d386,_0x473828,_0x539730){var _0x2ad6da;if(_0x21d386['headers'][_0xbb43('0x38')]){if(_[_0xbb43('0x39')](_0x21d386[_0xbb43('0x3a')][_0xbb43('0x38')],'Basic')){var _0x157d62=basicAuth(_0x21d386);db['User']['find']({'where':{'name':_0x157d62['name']}})[_0xbb43('0x3b')](function(_0x573a05){if(!_0x573a05||!_0x573a05[_0xbb43('0x3c')](_0x157d62[_0xbb43('0x3d')])){return _0x473828[_0xbb43('0x3e')](0x191)['json']({'message':_0xbb43('0x3f')});}_0x21d386[_0xbb43('0x40')]={'id':_0x573a05['id']};_0x539730();})[_0xbb43('0x36')](function(_0xd987fa){_0x539730(_0xd987fa);});}else if(_[_0xbb43('0x39')](_0x21d386[_0xbb43('0x3a')][_0xbb43('0x38')],_0xbb43('0x41'))){validateJwt(_0x21d386,_0x473828,_0x539730);}else{if(_0x510b05){_0x539730();}else{return _0x473828['status'](0x193)[_0xbb43('0x34')]({'message':_0xbb43('0x42')});}}}else if(_0x21d386[_0xbb43('0x43')][_0xbb43('0x44')]){try{var _0x4015ec={'audience':hardwareConf[_0xbb43('0x45')](),'issuer':hardwareConf[_0xbb43('0x45')]()};verifyJwt(_0x21d386[_0xbb43('0x43')][_0xbb43('0x44')],_0x4015ec)[_0xbb43('0x3b')](function(_0x21346a){return db[_0xbb43('0x46')][_0xbb43('0x47')]({'where':{'id':_0x21346a[_0xbb43('0x48')]}})[_0xbb43('0x3b')](function(_0x405f36){_0x2ad6da=_0x405f36;return db['Setting'][_0xbb43('0x2f')]({'where':{'id':0x1},'attributes':[_0xbb43('0x49'),'blockDuration'],'raw':!![]});})[_0xbb43('0x3b')](function(_0x2c9a7c){if(!_0x2ad6da||!_[_0xbb43('0x4a')](_0x2ad6da['apiKeyNonce'],_0x21346a['nonce'])){return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':_0xbb43('0x4b')});}if(_0x2ad6da['disabled']){return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':_0xbb43('0x4c')});}if(_0x2ad6da[_0xbb43('0x4d')]){if(_0x2c9a7c[_0xbb43('0x4e')]>0x0){if(moment(_0x2ad6da[_0xbb43('0x4f')])['add'](_0x2c9a7c[_0xbb43('0x4e')],_0xbb43('0x50'))>moment()){return _0x473828[_0xbb43('0x3e')](0x191)[_0xbb43('0x34')]({'message':_0xbb43('0x4c')});}}else{return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x21d386[_0xbb43('0x40')]={'id':_0x2ad6da['id']};_0x539730();});})[_0xbb43('0x36')](function(){return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1fcf64){_0x539730(_0x1fcf64);}}else if(_0x510b05){_0x539730();}else{return _0x473828[_0xbb43('0x3e')](0x193)[_0xbb43('0x34')]({'message':_0xbb43('0x42')});}})['use'](function(_0x3e0871,_0x136bd4,_0x59750b){if(_0x3e0871[_0xbb43('0x40')]){db['User'][_0xbb43('0x47')]({'where':{'id':_0x3e0871[_0xbb43('0x40')]['id']},'attributes':userAttributes})[_0xbb43('0x3b')](function(_0x14e57e){if(!_0x14e57e){return _0x136bd4[_0xbb43('0x3e')](0x194)[_0xbb43('0x34')]({'message':'User\x20not\x20found.'});}_0x3e0871[_0xbb43('0x40')]=_0x14e57e;_0x59750b();})['catch'](function(_0x307f1e){_0x59750b(_0x307f1e);});}else if(_0x510b05){_0x59750b();}else{return _0x136bd4[_0xbb43('0x3e')](0x194)[_0xbb43('0x34')]({'message':_0xbb43('0x51')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xbb43('0x2d')](function(_0x39f75f,_0x4bc351,_0x24ba15){return licenseUtil[_0xbb43('0x52')]()[_0xbb43('0x3b')](function(_0x40f519){if(_0x40f519[_0xbb43('0x53')]){_0x24ba15();}else{return _0x4bc351['status'](0x193)[_0xbb43('0x34')]({'message':_0xbb43('0x54')});}})['catch'](function(_0x1a66f0){_0x24ba15(_0x1a66f0);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x4d7034,_0x5e2e6d,_0x1c3482){return licenseUtil['getLicense']()[_0xbb43('0x3b')](function(_0x5e5c86){if(_0x5e5c86[_0xbb43('0x55')]){_0x1c3482();}else{return _0x5e2e6d[_0xbb43('0x3e')](0x193)[_0xbb43('0x34')]({'message':'Forbidden'});}})[_0xbb43('0x36')](function(_0x4d9f18){_0x1c3482(_0x4d9f18);});});};exports[_0xbb43('0x56')]=function(_0x2518bf,_0xd43d24,_0x29840e){_0x2518bf[_0xbb43('0x56')]=!![];return _0x29840e();};exports[_0xbb43('0x57')]=function signToken(_0x37d8d3){return signJwt(_0x37d8d3);};exports['setTokenCookie']=function(_0x93f6e7,_0x26ea59){if(!_0x93f6e7[_0xbb43('0x40')]){return _0x26ea59[_0xbb43('0x3e')](0x194)['json']({'message':_0xbb43('0x58')});}var _0x3233b7={'payload':{'id':_0x93f6e7[_0xbb43('0x40')]['id'],'role':_0x93f6e7[_0xbb43('0x40')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3233b7)[_0xbb43('0x3b')](function(_0x3fdb10){_0x26ea59[_0xbb43('0x59')]('motion.token',_0x3fdb10);_0x26ea59[_0xbb43('0x5a')](_0xbb43('0x5b'));})[_0xbb43('0x36')](function(_0x1dc40a){return _0x26ea59[_0xbb43('0x3e')](0x1f4)['send'](_0x1dc40a);});};exports['retrieveApiKey']=function(_0xb44557){if(_['isNil'](_0xb44557[_0xbb43('0x5c')])||_[_0xbb43('0x5d')](_0xb44557['apiKeyIat'])){return null;}else{return createJwt(_0xb44557);}};exports[_0xbb43('0x5e')]=function(_0x3719dc){_0x3719dc[_0xbb43('0x5c')]=generateNonce();_0x3719dc[_0xbb43('0x5f')]=generateIssuedAt();return createJwt(_0x3719dc);};exports[_0xbb43('0x60')]=function(_0x5cb3c6,_0x124f88){var _0x539ffc=_0x5cb3c6['query'][_0xbb43('0x44')];if(_0x539ffc){var _0x1b9307={'nonce':_0x124f88[_0xbb43('0x5c')],'iat':_0x124f88[_0xbb43('0x5f')],'audience':hardwareConf[_0xbb43('0x45')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x539ffc,_0x1b9307)['then'](function(){return generateApiKey(_0x124f88);});}else{throw{'message':_0xbb43('0x61')};}};exports[_0xbb43('0x62')]=function(_0x3a84ad){var _0x308646=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x308646[_0xbb43('0x63')](_0x3a84ad))throw new db[(_0xbb43('0x64'))][(_0xbb43('0x65'))](_0xbb43('0x66'));return;};exports[_0xbb43('0x67')]=function(_0x578b85,_0x1b6f96,_0xb996d7){var _0x432bd8=encryptor[_0xbb43('0x68')](_0x1b6f96)[_0xbb43('0x69')](',');for(var _0x1fae27=0x0;_0x1fae27<_0xb996d7;_0x1fae27++){if(!_0x432bd8[_0x1fae27])break;if(_0x578b85[_0xbb43('0x6a')]()===_0x432bd8[_0x1fae27][_0xbb43('0x6a')]()){var _0x3e01e4=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0xb996d7);if(_0xb996d7===0x1){_0x3e01e4=_0xbb43('0x6b');}throw new db[(_0xbb43('0x64'))][(_0xbb43('0x65'))](_0x3e01e4);}}return;};exports[_0xbb43('0x6c')]=function(_0x38814a,_0x19e27e){var _0x2e01fb=_0x19e27e?encryptor['decryptString'](_0x19e27e)[_0xbb43('0x69')](','):[];if(_0x2e01fb['length']===0x5){_0x2e01fb['splice'](-0x1,0x1);}_0x2e01fb[_0xbb43('0x6d')](_0x38814a);return encryptor[_0xbb43('0x6e')](_0x2e01fb[_0xbb43('0x6f')](','));};function signJwt(_0x22ce17){var _0x24393a=BPromise[_0xbb43('0x70')](jwt[_0xbb43('0x71')],{'context':jwt});var _0x341481=_0x22ce17['secret']||config['secrets'][_0xbb43('0xa')];return new BPromise(function(_0x2b96b8,_0x137e75){_0x24393a(_0x22ce17[_0xbb43('0x72')],_0x341481,_0x22ce17[_0xbb43('0x73')])[_0xbb43('0x3b')](function(_0x12717e){_0x2b96b8(_0x12717e);})[_0xbb43('0x36')](function(_0x3ca6ad){_0x137e75(_0x3ca6ad);});});}function verifyJwt(_0x555426,_0x165936,_0x392d1a){var _0x234bc7=BPromise[_0xbb43('0x70')](jwt[_0xbb43('0x74')],{'context':jwt});var _0x33a4db=_0x392d1a||config['secrets'][_0xbb43('0xa')];return new BPromise(function(_0xb48be2,_0x42e437){_0x234bc7(_0x555426,_0x33a4db,_0x165936)[_0xbb43('0x3b')](function(_0xc34a02){_0xb48be2(_0xc34a02);})['catch'](function(_0x3c260f){_0x42e437(_0x3c260f);});});}function generateNonce(){return crypto[_0xbb43('0x75')](0x10)[_0xbb43('0x76')](_0xbb43('0x77'));}function generateIssuedAt(){return Math[_0xbb43('0x78')](Date[_0xbb43('0x79')]()/0x3e8)[_0xbb43('0x76')]();}function createJwt(_0x2992ea){var _0x10fd8b={'payload':{'iat':_0x2992ea[_0xbb43('0x5f')],'nonce':_0x2992ea['apiKeyNonce']},'options':{'algorithm':_0xbb43('0x7a'),'subject':_0x2992ea['id']['toString'](),'issuer':hardwareConf[_0xbb43('0x45')](),'audience':hardwareConf[_0xbb43('0x45')]()}};return signJwt(_0x10fd8b)[_0xbb43('0x3b')](function(_0x3dbcd9){return{'iat':_0x2992ea[_0xbb43('0x5f')],'nonce':_0x2992ea['apiKeyNonce'],'token':_0x3dbcd9};});} \ No newline at end of file +var _0x9c44=['showWebBar','lastLoginAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','user','ChatInteraction','findOne','params','then','status','disposition','unmanaged','json','Unmanaged.','catch','isAuthenticated','headers','authorization','startsWith','Basic','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','User','find','sub','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','use','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','sign','options','promisify','toString','hex','floor','now','HS512','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','crypto','util','moment','secrets','session','role','name','internal','email','userpic','voicePause','chatPause','faxPause','smsPause'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require(_0x49c4('0x0'));var licenseUtil=require(_0x49c4('0x1'));var encryptor=require(_0x49c4('0x2'));var _=require(_0x49c4('0x3'));var jwt=require(_0x49c4('0x4'));var expressJwt=require(_0x49c4('0x5'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0x49c4('0x6'));var BPromise=require('bluebird');var util=require(_0x49c4('0x7'));var moment=require(_0x49c4('0x8'));var validateJwt=expressJwt({'secret':config[_0x49c4('0x9')][_0x49c4('0xa')]});var userAttributes=['id',_0x49c4('0xb'),'fullname',_0x49c4('0xc'),_0x49c4('0xd'),_0x49c4('0xe'),_0x49c4('0xf'),'permissions','md5secret',_0x49c4('0x10'),_0x49c4('0x11'),'mailPause',_0x49c4('0x12'),_0x49c4('0x13'),'openchannelPause','pauseType',_0x49c4('0x14'),_0x49c4('0x15'),'lastPauseAt',_0x49c4('0x16'),_0x49c4('0x17'),'passwordResetAt',_0x49c4('0x18'),_0x49c4('0x19'),_0x49c4('0x1a'),_0x49c4('0x1b'),_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),'phoneBarPrefixRequired',_0x49c4('0x20'),_0x49c4('0x21'),_0x49c4('0x22'),_0x49c4('0x23'),_0x49c4('0x24'),'privacyEnabled',_0x49c4('0x25'),_0x49c4('0x26'),'downloadVoiceRecordings','downloadOmnichannelInteractions',_0x49c4('0x27'),_0x49c4('0x28'),_0x49c4('0x29'),'chatAutoanswer',_0x49c4('0x2a'),'emailAutoanswer',_0x49c4('0x2b'),_0x49c4('0x2c'),_0x49c4('0x2d'),_0x49c4('0x2e'),_0x49c4('0x2f'),_0x49c4('0x30'),_0x49c4('0x31'),_0x49c4('0x32'),_0x49c4('0x33')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])['use'](function(_0x1c99b1,_0x4f0b62,_0x592bb8){if(_0x1c99b1[_0x49c4('0x34')]){_0x592bb8();}else{return db[_0x49c4('0x35')][_0x49c4('0x36')]({'where':{'id':_0x1c99b1[_0x49c4('0x37')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0x49c4('0x38')](function(_0x9cb797){if(_0x9cb797&&_0x9cb797['closed']){return _0x4f0b62[_0x49c4('0x39')](_0x9cb797[_0x49c4('0x3a')]===_0x49c4('0x3b')?0x195:0x193)[_0x49c4('0x3c')]({'message':_0x9cb797['disposition']==='unmanaged'?_0x49c4('0x3d'):'Forbidden.'});}else{_0x592bb8();}})[_0x49c4('0x3e')](function(_0x3852b2){_0x592bb8(_0x3852b2);});}});};exports[_0x49c4('0x3f')]=function isAuthenticated(_0x372a47){return compose()['use'](function(_0x889909,_0x2b2793,_0x46e04d){var _0x4f28a2;if(_0x889909[_0x49c4('0x40')][_0x49c4('0x41')]){if(_[_0x49c4('0x42')](_0x889909[_0x49c4('0x40')][_0x49c4('0x41')],_0x49c4('0x43'))){var _0x46f7ea=basicAuth(_0x889909);db['User']['find']({'where':{'name':_0x46f7ea['name']}})[_0x49c4('0x38')](function(_0x7ee704){if(!_0x7ee704||!_0x7ee704[_0x49c4('0x44')](_0x46f7ea[_0x49c4('0x45')])){return _0x2b2793[_0x49c4('0x39')](0x191)['json']({'message':_0x49c4('0x46')});}_0x889909[_0x49c4('0x34')]={'id':_0x7ee704['id']};_0x46e04d();})[_0x49c4('0x3e')](function(_0x24bba9){_0x46e04d(_0x24bba9);});}else if(_['startsWith'](_0x889909['headers'][_0x49c4('0x41')],_0x49c4('0x47'))){validateJwt(_0x889909,_0x2b2793,_0x46e04d);}else{if(_0x372a47){_0x46e04d();}else{return _0x2b2793[_0x49c4('0x39')](0x193)[_0x49c4('0x3c')]({'message':_0x49c4('0x48')});}}}else if(_0x889909['query'][_0x49c4('0x49')]){try{var _0x84c621={'audience':hardwareConf[_0x49c4('0x4a')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x889909['query'][_0x49c4('0x49')],_0x84c621)[_0x49c4('0x38')](function(_0x3bec0a){return db[_0x49c4('0x4b')][_0x49c4('0x4c')]({'where':{'id':_0x3bec0a[_0x49c4('0x4d')]}})[_0x49c4('0x38')](function(_0x27ef5f){_0x4f28a2=_0x27ef5f;return db[_0x49c4('0x4e')]['findOne']({'where':{'id':0x1},'attributes':[_0x49c4('0x4f'),'blockDuration'],'raw':!![]});})[_0x49c4('0x38')](function(_0x349791){if(!_0x4f28a2||!_[_0x49c4('0x50')](_0x4f28a2[_0x49c4('0x51')],_0x3bec0a['nonce'])){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x52')});}if(_0x4f28a2['disabled']){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x53')});}if(_0x4f28a2[_0x49c4('0x54')]){if(_0x349791[_0x49c4('0x55')]>0x0){if(moment(_0x4f28a2[_0x49c4('0x56')])[_0x49c4('0x57')](_0x349791[_0x49c4('0x55')],_0x49c4('0x58'))>moment()){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x53')});}}_0x889909[_0x49c4('0x34')]={'id':_0x4f28a2['id']};_0x46e04d();});})[_0x49c4('0x3e')](function(){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x53')});});}catch(_0x248c0a){_0x46e04d(_0x248c0a);}}else if(_0x372a47){_0x46e04d();}else{return _0x2b2793[_0x49c4('0x39')](0x193)[_0x49c4('0x3c')]({'message':_0x49c4('0x48')});}})[_0x49c4('0x59')](function(_0x4e38bc,_0x212366,_0x49829e){if(_0x4e38bc[_0x49c4('0x34')]){db[_0x49c4('0x4b')][_0x49c4('0x4c')]({'where':{'id':_0x4e38bc[_0x49c4('0x34')]['id']},'attributes':userAttributes})[_0x49c4('0x38')](function(_0x281b83){if(!_0x281b83){return _0x212366['status'](0x194)['json']({'message':_0x49c4('0x5a')});}_0x4e38bc[_0x49c4('0x34')]=_0x281b83;_0x49829e();})[_0x49c4('0x3e')](function(_0x117151){_0x49829e(_0x117151);});}else if(_0x372a47){_0x49829e();}else{return _0x212366['status'](0x194)[_0x49c4('0x3c')]({'message':_0x49c4('0x5b')});}});};exports[_0x49c4('0x5c')]=function canUpdate(){return compose()[_0x49c4('0x59')](function(_0x81a674,_0x3bde49,_0x1a9593){return licenseUtil[_0x49c4('0x5d')]()[_0x49c4('0x38')](function(_0x5640d3){if(_0x5640d3[_0x49c4('0x5e')]){_0x1a9593();}else{return _0x3bde49['status'](0x193)[_0x49c4('0x3c')]({'message':_0x49c4('0x5f')});}})[_0x49c4('0x3e')](function(_0x258abe){_0x1a9593(_0x258abe);});});};exports[_0x49c4('0x60')]=function isWebrtcLicence(){return compose()['use'](function(_0x592e8e,_0x15b674,_0x384862){return licenseUtil[_0x49c4('0x5d')]()[_0x49c4('0x38')](function(_0x5d4790){if(_0x5d4790[_0x49c4('0x61')]){_0x384862();}else{return _0x15b674['status'](0x193)[_0x49c4('0x3c')]({'message':'Forbidden'});}})[_0x49c4('0x3e')](function(_0x906d3){_0x384862(_0x906d3);});});};exports[_0x49c4('0x62')]=function(_0x27adfe,_0x2d8087,_0x30bea5){_0x27adfe[_0x49c4('0x62')]=!![];return _0x30bea5();};exports['signToken']=function signToken(_0x3b731f){return signJwt(_0x3b731f);};exports[_0x49c4('0x63')]=function(_0x4a5c34,_0x1e1ac4){if(!_0x4a5c34[_0x49c4('0x34')]){return _0x1e1ac4[_0x49c4('0x39')](0x194)[_0x49c4('0x3c')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x5d8bf0={'payload':{'id':_0x4a5c34[_0x49c4('0x34')]['id'],'role':_0x4a5c34['user'][_0x49c4('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5d8bf0)[_0x49c4('0x38')](function(_0x3811b2){_0x1e1ac4[_0x49c4('0x64')](_0x49c4('0x65'),_0x3811b2);_0x1e1ac4[_0x49c4('0x66')](_0x49c4('0x67'));})['catch'](function(_0x1f26c2){return _0x1e1ac4[_0x49c4('0x39')](0x1f4)[_0x49c4('0x68')](_0x1f26c2);});};exports[_0x49c4('0x69')]=function(_0x17ef75){if(_[_0x49c4('0x6a')](_0x17ef75[_0x49c4('0x51')])||_[_0x49c4('0x6a')](_0x17ef75[_0x49c4('0x6b')])){return null;}else{return createJwt(_0x17ef75);}};exports[_0x49c4('0x6c')]=function(_0x5b822f){_0x5b822f['apiKeyNonce']=generateNonce();_0x5b822f[_0x49c4('0x6b')]=generateIssuedAt();return createJwt(_0x5b822f);};exports[_0x49c4('0x6d')]=function(_0x527e74,_0x59a8bc){var _0x77163d=_0x527e74['query']['apikey'];if(_0x77163d){var _0x3208c2={'nonce':_0x59a8bc[_0x49c4('0x51')],'iat':_0x59a8bc[_0x49c4('0x6b')],'audience':hardwareConf[_0x49c4('0x4a')](),'issuer':hardwareConf[_0x49c4('0x4a')]()};return verifyJwt(_0x77163d,_0x3208c2)[_0x49c4('0x38')](function(){return generateApiKey(_0x59a8bc);});}else{throw{'message':_0x49c4('0x6e')};}};exports['validatePasswordPattern']=function(_0x859dde){var _0xcc6a2b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xcc6a2b[_0x49c4('0x6f')](_0x859dde))throw new db[(_0x49c4('0x70'))][(_0x49c4('0x71'))](_0x49c4('0x72'));return;};exports['validatePasswordHistory']=function(_0x5c7ddd,_0x1ef0c1,_0x155c43){var _0x2a6308=encryptor[_0x49c4('0x73')](_0x1ef0c1)[_0x49c4('0x74')](',');for(var _0x6b2592=0x0;_0x6b2592<_0x155c43;_0x6b2592++){if(!_0x2a6308[_0x6b2592])break;if(_0x5c7ddd[_0x49c4('0x75')]()===_0x2a6308[_0x6b2592]['toLowerCase']()){var _0x45d715=util[_0x49c4('0x76')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x155c43);if(_0x155c43===0x1){_0x45d715=_0x49c4('0x77');}throw new db['Sequelize'][(_0x49c4('0x71'))](_0x45d715);}}return;};exports[_0x49c4('0x78')]=function(_0x9eaa84,_0x2fe89a){var _0x845f7e=_0x2fe89a?encryptor[_0x49c4('0x73')](_0x2fe89a)[_0x49c4('0x74')](','):[];if(_0x845f7e[_0x49c4('0x79')]===0x5){_0x845f7e['splice'](-0x1,0x1);}_0x845f7e[_0x49c4('0x7a')](_0x9eaa84);return encryptor[_0x49c4('0x7b')](_0x845f7e['join'](','));};function signJwt(_0x10dec7){var _0x299e74=BPromise['promisify'](jwt[_0x49c4('0x7c')],{'context':jwt});var _0x42e0e6=_0x10dec7['secret']||config['secrets']['session'];return new BPromise(function(_0x513879,_0xc43386){_0x299e74(_0x10dec7['payload'],_0x42e0e6,_0x10dec7[_0x49c4('0x7d')])[_0x49c4('0x38')](function(_0x515240){_0x513879(_0x515240);})[_0x49c4('0x3e')](function(_0xdb2b33){_0xc43386(_0xdb2b33);});});}function verifyJwt(_0x5ac9f0,_0x34272f,_0x3dcf4c){var _0x167e84=BPromise[_0x49c4('0x7e')](jwt['verify'],{'context':jwt});var _0x431921=_0x3dcf4c||config[_0x49c4('0x9')][_0x49c4('0xa')];return new BPromise(function(_0x20e97d,_0x5d3375){_0x167e84(_0x5ac9f0,_0x431921,_0x34272f)[_0x49c4('0x38')](function(_0x4a93bc){_0x20e97d(_0x4a93bc);})['catch'](function(_0x58259d){_0x5d3375(_0x58259d);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x49c4('0x7f')](_0x49c4('0x80'));}function generateIssuedAt(){return Math[_0x49c4('0x81')](Date[_0x49c4('0x82')]()/0x3e8)['toString']();}function createJwt(_0x4daa6d){var _0x340523={'payload':{'iat':_0x4daa6d[_0x49c4('0x6b')],'nonce':_0x4daa6d[_0x49c4('0x51')]},'options':{'algorithm':_0x49c4('0x83'),'subject':_0x4daa6d['id'][_0x49c4('0x7f')](),'issuer':hardwareConf[_0x49c4('0x4a')](),'audience':hardwareConf[_0x49c4('0x4a')]()}};return signJwt(_0x340523)[_0x49c4('0x38')](function(_0x4d49e0){return{'iat':_0x4daa6d[_0x49c4('0x6b')],'nonce':_0x4daa6d['apiKeyNonce'],'token':_0x4d49e0};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 8200d37..e59267e 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 _0x0b0e=['tags','skip','tag','count','getFilteredContacts','catch','CmContact','keys','cf_','map','findOne','all','length','type','lodash','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause'];(function(_0x82cf43,_0x261e66){var _0x26fc93=function(_0x20ee61){while(--_0x20ee61){_0x82cf43['push'](_0x82cf43['shift']());}};_0x26fc93(++_0x261e66);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5a75e7,_0x3ad506){_0x5a75e7=_0x5a75e7-0x0;var _0x15c695=_0x0b0e[_0x5a75e7];return _0x15c695;};'use strict';var _=require(_0xe0b0('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xe0b0('0x1'))['db'];exports['findAll']=function(_0x7e5a8a,_0xdf715e,_0x3b5e2b,_0x25153a){var _0x28040c={'count':0x0,'rows':[]};var _0x38a058=sqlUtils[_0xe0b0('0x2')](_0xdf715e,_0x7e5a8a);if(_0x38a058){return Promise[_0xe0b0('0x3')](_0x28040c);}var _0x30e20d=sqlUtils[_0xe0b0('0x4')]();var _0x219b1c={};var _0x5cf9cc=![];var _0x50be7f=![];return Promise[_0xe0b0('0x3')]()[_0xe0b0('0x5')](function(){if(_0x7e5a8a[_0xe0b0('0x6')]){return sqlUtils[_0xe0b0('0x7')](_0x7e5a8a['search'],_0x25153a);}else{return sqlUtils[_0xe0b0('0x8')](_0x7e5a8a,_0x25153a);}})[_0xe0b0('0x5')](function(_0x553d4f){_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xa')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xb')]);_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xc')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0xe')]);_0x219b1c=_0x553d4f[_0xe0b0('0xf')];_0x50be7f=_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0x10')];return sqlUtils['checkListsRestrictions'](_0xdf715e,_0x7e5a8a,_0x50be7f);})[_0xe0b0('0x5')](function(_0x154de6){_0x30e20d[_0xe0b0('0x9')](_0x154de6);var _0x24babd=_0x7e5a8a[_0xe0b0('0x6')]?_0x219b1c['ids']:_0x7e5a8a[_0xe0b0('0x11')];_0x5cf9cc=_0x24babd?!![]:![];return sqlUtils['countFilteredContacts'](_0x30e20d,_0x24babd);})[_0xe0b0('0x5')](function(_0xadee6e){_0x28040c['count']=_0xadee6e;if(_0x28040c[_0xe0b0('0x12')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x30e20d,_0x7e5a8a[_0xe0b0('0xb')],_0x3b5e2b,_0x5cf9cc,_0x219b1c[_0xe0b0('0xe')],_0x50be7f);})['then'](function(_0x54a3eb){if(!_0x54a3eb){return[];}return sqlUtils[_0xe0b0('0x13')](_0x54a3eb,_0x7e5a8a,_0x3b5e2b);})['then'](function(_0x4df8da){_0x28040c['rows']=_0x4df8da;return _0x28040c;})[_0xe0b0('0x14')](function(_0x50fa4a){throw _0x50fa4a;});};exports['describe']=function(){var _0x10cde1={};var _0x59dff5=[];return db[_0xe0b0('0x15')]['describe']()[_0xe0b0('0x5')](function(_0x1cd7c4){_0x10cde1=_0x1cd7c4;var _0x3e10b3=Object[_0xe0b0('0x16')](_0x10cde1)[_0xe0b0('0xc')](function(_0x58b804){return _['startsWith'](_0x58b804,_0xe0b0('0x17'))?_0x58b804:undefined;});var _0x5512bb=_0x3e10b3[_0xe0b0('0x18')](function(_0x31b5f8){return db['CmCustomField'][_0xe0b0('0x19')]({'where':{'id':_0x31b5f8['slice'](0x3)},'raw':!![]});});return Promise[_0xe0b0('0x1a')](_0x5512bb);})['then'](function(_0x28586d){for(var _0x576352=0x0;_0x576352<_0x28586d[_0xe0b0('0x1b')];_0x576352++){if(_0x28586d[_0x576352]){var _0x4de537=_0xe0b0('0x17')+_0x28586d[_0x576352]['id'];_0x10cde1[_0x4de537]['fieldType']=_0x28586d[_0x576352][_0xe0b0('0x1c')];}}_0x59dff5=_['map'](Object[_0xe0b0('0x16')](_0x10cde1),function(_0x3c3bc2){return{'name':_0x3c3bc2,'type':_0x10cde1[_0x3c3bc2][_0xe0b0('0x1c')]};});return _0x59dff5;})[_0xe0b0('0x14')](function(_0x3ec2){throw _0x3ec2;});}; \ No newline at end of file +var _0x2032=['map','findOne','slice','all','length','fieldType','type','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','where','user','ids','tag','countFilteredContacts','count','buildContactsQuery','clause','getFilteredContacts','rows','describe','CmContact','filter','startsWith','cf_'];(function(_0x4457c1,_0x3cbfb7){var _0x423928=function(_0x2b1dba){while(--_0x2b1dba){_0x4457c1['push'](_0x4457c1['shift']());}};_0x423928(++_0x3cbfb7);}(_0x2032,0xd9));var _0x2203=function(_0x425785,_0x29983e){_0x425785=_0x425785-0x0;var _0x347ce5=_0x2032[_0x425785];return _0x347ce5;};'use strict';var _=require('lodash');var sqlUtils=require(_0x2203('0x0'));var db=require(_0x2203('0x1'))['db'];exports[_0x2203('0x2')]=function(_0x4c28da,_0x486390,_0x228a29,_0x4b4c7f){var _0x46c49a={'count':0x0,'rows':[]};var _0x880dcd=sqlUtils[_0x2203('0x3')](_0x486390,_0x4c28da);if(_0x880dcd){return Promise[_0x2203('0x4')](_0x46c49a);}var _0x3f7ba1=sqlUtils[_0x2203('0x5')]();var _0x2e0f63={};var _0x2676aa=![];var _0x18c4d6=![];return Promise[_0x2203('0x4')]()[_0x2203('0x6')](function(){if(_0x4c28da['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x4c28da[_0x2203('0x7')],_0x4b4c7f);}else{return sqlUtils['parseQueryParameters'](_0x4c28da,_0x4b4c7f);}})[_0x2203('0x6')](function(_0x2972f3){_0x3f7ba1[_0x2203('0x8')](_0x2972f3['default']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3['fields']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3['filter']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3[_0x2203('0x9')]['clause']);_0x2e0f63=_0x2972f3['tags'];_0x18c4d6=_0x2972f3['user']['skip'];return sqlUtils['checkListsRestrictions'](_0x486390,_0x4c28da,_0x18c4d6);})[_0x2203('0x6')](function(_0x538b30){_0x3f7ba1['where'](_0x538b30);var _0x21a3af=_0x4c28da[_0x2203('0x7')]?_0x2e0f63[_0x2203('0xa')]:_0x4c28da[_0x2203('0xb')];_0x2676aa=_0x21a3af?!![]:![];return sqlUtils[_0x2203('0xc')](_0x3f7ba1,_0x21a3af);})[_0x2203('0x6')](function(_0x2c36e6){_0x46c49a[_0x2203('0xd')]=_0x2c36e6;if(_0x46c49a[_0x2203('0xd')]===0x0){return;}return sqlUtils[_0x2203('0xe')](_0x3f7ba1,_0x4c28da['fields'],_0x228a29,_0x2676aa,_0x2e0f63[_0x2203('0xf')],_0x18c4d6);})[_0x2203('0x6')](function(_0x4893ff){if(!_0x4893ff){return[];}return sqlUtils[_0x2203('0x10')](_0x4893ff,_0x4c28da,_0x228a29);})[_0x2203('0x6')](function(_0x4aeb9f){_0x46c49a[_0x2203('0x11')]=_0x4aeb9f;return _0x46c49a;})['catch'](function(_0x2904ba){throw _0x2904ba;});};exports[_0x2203('0x12')]=function(){var _0x3c8c34={};var _0x3b4034=[];return db[_0x2203('0x13')][_0x2203('0x12')]()['then'](function(_0x13d3f7){_0x3c8c34=_0x13d3f7;var _0x50822b=Object['keys'](_0x3c8c34)[_0x2203('0x14')](function(_0x496d82){return _[_0x2203('0x15')](_0x496d82,_0x2203('0x16'))?_0x496d82:undefined;});var _0x5d4c4e=_0x50822b[_0x2203('0x17')](function(_0x5e29cd){return db['CmCustomField'][_0x2203('0x18')]({'where':{'id':_0x5e29cd[_0x2203('0x19')](0x3)},'raw':!![]});});return Promise[_0x2203('0x1a')](_0x5d4c4e);})[_0x2203('0x6')](function(_0x1244f4){for(var _0x3114ef=0x0;_0x3114ef<_0x1244f4[_0x2203('0x1b')];_0x3114ef++){if(_0x1244f4[_0x3114ef]){var _0x250349='cf_'+_0x1244f4[_0x3114ef]['id'];_0x3c8c34[_0x250349][_0x2203('0x1c')]=_0x1244f4[_0x3114ef][_0x2203('0x1d')];}}_0x3b4034=_[_0x2203('0x17')](Object['keys'](_0x3c8c34),function(_0xb2071b){return{'name':_0xb2071b,'type':_0x3c8c34[_0xb2071b][_0x2203('0x1d')]};});return _0x3b4034;})['catch'](function(_0xd6e109){throw _0xd6e109;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 0fa1fc5..347ae80 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 _0x5287=['sqlOperator','conditions','length','find','dateOfBirth','fieldType','datetime','castTo','buildExpression','type','default','text','value','end','Tag','map','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','some','name','compact','Contact','c.ListId\x20IN\x20?','\x20=\x20?','then','fields','filter','resolve','getLists','c.ListId\x20IS\x20NULL','attributes','c.id','limit','offset','group','having','order','DESC','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','query','toString','Tags','clone','COUNT(*)','getSelectedTags','t.id\x20IN\x20?','sequelize','squel','../parsers/advancedSearch','../../mysqldb','role','agent','search','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','left_join','firstName','lastName','fax','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5287,0x10c));var _0x7528=function(_0x2654d2,_0x431293){_0x2654d2=_0x2654d2-0x0;var _0x3057df=_0x5287[_0x2654d2];return _0x3057df;};'use strict';var _=require('lodash');var squel=require(_0x7528('0x0'));var as=require(_0x7528('0x1'));var qs=require('../parsers/qs');var utils=require('../interaction/utils');var db=require(_0x7528('0x2'))['db'];function skipContactsQuery(_0x324830,_0x6ac564){var _0x13071b=![];if(_0x324830[_0x7528('0x3')]===_0x7528('0x4')&&!_0x6ac564[_0x7528('0x5')]&&!_0x6ac564[_0x7528('0x6')]&&_0x6ac564[_0x7528('0x7')]!==_0x7528('0x8')){_0x13071b=!![];}return _0x13071b;}function getContactsSubquery(){return squel[_0x7528('0x9')]()[_0x7528('0xa')](_0x7528('0xb'),'c')[_0x7528('0xc')](_0x7528('0xd'));}function applyJoinClauses(_0x431d2f,_0x581304){var _0x51538c=_0x581304?'c':_0x7528('0xe');_0x431d2f['left_join'](_0x7528('0xf'),'uc',_0x7528('0x10')+_0x51538c+_0x7528('0x11'))['left_join'](_0x7528('0x12'),'ct','ct.CmContactId\x20=\x20'+_0x51538c+_0x7528('0x11'))[_0x7528('0x13')]('tools_tags','t','t.id\x20=\x20ct.TagId');return _0x431d2f;}function addFieldsToQuery(_0xbf712d,_0x5cd329,_0x53da59,_0x26fc5e,_0x2bd5b6){var _0x42e9c1=_0x2bd5b6?'c':_0x7528('0xe');if(!_0x5cd329){_0x5cd329=['id',_0x7528('0x14'),_0x7528('0x15'),'phone','mobile',_0x7528('0x16'),'email',_0x7528('0x6'),_0x7528('0x17'),_0x7528('0x18'),_0x7528('0x19'),_0x7528('0x1a'),_0x7528('0x1b')];}else if(!_0x5cd329[_0x7528('0x1c')]('id')){_0x5cd329[_0x7528('0x1d')]('id');}var _0x161451=_0x53da59&&_0x2bd5b6||!_0x53da59&&!_0x2bd5b6;if(_0x26fc5e){_0x161451=_0x26fc5e&&_0x2bd5b6||!_0x26fc5e&&!_0x2bd5b6;}_0x5cd329[_0x7528('0x1e')](function(_0x256e1e){if(_0x256e1e==='TagIds'){if(_0x161451){_0xbf712d['field'](_0x7528('0x1f'),_0x256e1e);}else if(_0x53da59||_0x26fc5e){_0xbf712d['field'](_0x42e9c1+'.'+_0x256e1e);}}else{_0xbf712d[_0x7528('0x20')](_0x42e9c1+'.'+_0x256e1e);}});return _0xbf712d;}function getSqlClauses(){var _0xec5a12={'default':squel['expr'](),'fields':squel[_0x7528('0x21')](),'filter':squel[_0x7528('0x21')](),'tags':{'clause':squel[_0x7528('0x21')](),'ids':null},'user':{'clause':squel[_0x7528('0x21')](),'skip':![]}};return _0xec5a12;}function parseTagParameter(_0x2036b9){var _0x57024f=squel[_0x7528('0x21')]();if(_0x2036b9){var _0x3fd3ef=utils['getSelectedTags'](_0x2036b9);_0x3fd3ef[_0x7528('0x1e')](function(_0x334f2f){_0x57024f['or'](_0x7528('0x22'),'%,'+_0x334f2f+',%');});}return _0x57024f;}function parseSearchFilter(_0xb3fc4c){var _0x2f2ffa=squel[_0x7528('0x21')]();if(_0xb3fc4c){var _0x1866bf=_0xb3fc4c[_0x7528('0x23')]('\x5c','\x5c\x5c')[_0x7528('0x23')](/'/g,'\x27\x27');if(_0x1866bf[_0x7528('0x24')]('\x20')['length']>0x1){_0x2f2ffa['or'](_0x7528('0x25'),qs[_0x7528('0x26')](_0x1866bf),null);}else{if(qs[_0x7528('0x27')](_0x1866bf)){_0x2f2ffa['or']('c.id\x20LIKE\x20?',_0x1866bf+'%');_0x2f2ffa['or'](_0x7528('0x28'),_0x1866bf+'%');_0x2f2ffa['or'](_0x7528('0x29'),_0x1866bf+'%');_0x2f2ffa['or'](_0x7528('0x2a'),_0x1866bf+'%');}else if(qs['isEmail'](_0x1866bf)){_0x2f2ffa['or'](_0x7528('0x2b'),_0x1866bf+'%');}else{_0x2f2ffa['or'](_0x7528('0x2c'),'%'+_0x1866bf+'%');_0x2f2ffa['or'](_0x7528('0x2d'),'%'+_0x1866bf+'%');_0x2f2ffa['or'](_0x7528('0x2b'),'%'+_0x1866bf+'%');}}}return _0x2f2ffa;}function parseAdvancedSearchFilter(_0x19e19c,_0x30978f){var _0x3b8630=getSqlClauses();var _0x1c97d1=as[_0x7528('0x2e')](_0x19e19c);var _0x182e3c=_0x1c97d1[_0x7528('0x2f')];for(var _0x3f5765=0x0;_0x3f5765<_0x1c97d1[_0x7528('0x30')][_0x7528('0x31')];_0x3f5765++){var _0x371b48=_0x1c97d1[_0x7528('0x30')][_0x3f5765];var _0x3660fa='c';var _0x56e406=_[_0x7528('0x32')](_0x30978f,['name',_0x371b48[_0x7528('0x20')]]);if(_0x56e406){if(_0x371b48[_0x7528('0x20')]===_0x7528('0x33')||_0x56e406[_0x7528('0x34')]===_0x7528('0x35')){_0x371b48[_0x7528('0x36')]='DATE';}var _0x17db78=as[_0x7528('0x37')](_0x3660fa,_0x56e406[_0x7528('0x38')],_0x371b48);_0x3b8630[_0x7528('0x39')][_0x182e3c](_0x17db78[_0x7528('0x3a')],_0x17db78[_0x7528('0x3b')]['start'],_0x17db78[_0x7528('0x3b')][_0x7528('0x3c')]);}else{if(_0x371b48[_0x7528('0x20')]===_0x7528('0x3d')){var _0x3dadb5=_0x371b48[_0x7528('0x3b')][_0x7528('0x24')](',')[_0x7528('0x3e')](function(_0x427cd6){return Number(_0x427cd6);});var _0x1dfb21=parseTagParameter(_0x3dadb5);_0x3b8630[_0x7528('0x3f')][_0x7528('0x40')][_0x7528('0x41')](_0x1dfb21);_0x3b8630[_0x7528('0x3f')][_0x7528('0x42')]=_0x3dadb5;}else if(_0x371b48[_0x7528('0x20')]===_0x7528('0x43')){_0x3b8630[_0x7528('0x44')]['clause'][_0x7528('0x41')](_0x7528('0x45'),_0x371b48[_0x7528('0x3b')]);_0x3b8630[_0x7528('0x44')][_0x7528('0x46')]=!![];}}}return _0x3b8630;}function parseModelFields(_0x538a38,_0x43b404){var _0x2593e9=squel[_0x7528('0x21')]();var _0x421833=_(_0x538a38)['keys']()[_0x7528('0x3e')](function(_0x55858e){return _[_0x7528('0x47')](_0x43b404,[_0x7528('0x48'),_0x55858e])?_0x55858e:undefined;})[_0x7528('0x49')]()[_0x7528('0x3b')]();if(_0x538a38[_0x7528('0x4a')]){_0x421833[_0x7528('0x1d')](_0x7528('0x4a'));}if(_0x421833[_0x7528('0x31')]>0x0){_0x421833[_0x7528('0x1e')](function(_0x1b02c9){if(_0x1b02c9===_0x7528('0x6')){_0x2593e9[_0x7528('0x41')](_0x7528('0x4b'),[]['concat'](_0x538a38[_0x1b02c9]));}else if(_0x1b02c9===_0x7528('0x4a')){var _0x461680='%'+_0x538a38[_0x1b02c9]+'%';_0x2593e9[_0x7528('0x41')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x461680);}else{_0x2593e9['and']('c.'+_0x1b02c9+_0x7528('0x4c'),_0x538a38[_0x1b02c9]);}});}return _0x2593e9;}function parseQueryParameters(_0x30c27d,_0x55d562){var _0xe33ce4=getSqlClauses();return Promise['resolve']()[_0x7528('0x4d')](function(){return parseModelFields(_0x30c27d,_0x55d562);})[_0x7528('0x4d')](function(_0x18ac01){_0xe33ce4[_0x7528('0x4e')][_0x7528('0x41')](_0x18ac01);return parseTagParameter(_0x30c27d['tag']);})[_0x7528('0x4d')](function(_0x2372d2){_0xe33ce4[_0x7528('0x3f')][_0x7528('0x40')][_0x7528('0x41')](_0x2372d2);return parseSearchFilter(_0x30c27d['filter']);})[_0x7528('0x4d')](function(_0x1b87b3){_0xe33ce4[_0x7528('0x4f')]=_0x1b87b3;return _0xe33ce4;});}function checkListsRestrictions(_0x53c960,_0x3d473b,_0x3b0065){var _0xefb15b=squel['expr']();return Promise[_0x7528('0x50')]()[_0x7528('0x4d')](function(){if(_0x3d473b[_0x7528('0x5')]&&_0x53c960[_0x7528('0x3')]===_0x7528('0x4')&&!_0x3b0065){return _0x53c960[_0x7528('0x51')]({'attributes':['id'],'raw':!![]});}})[_0x7528('0x4d')](function(_0x46ffc7){if(_0x46ffc7){if(_0x46ffc7[_0x7528('0x31')]===0x0){_0xefb15b['and'](_0x7528('0x52'));}else{_0xefb15b[_0x7528('0x41')](_0x7528('0x4b'),_[_0x7528('0x3e')](_0x46ffc7,'id'));}}})[_0x7528('0x4d')](function(){return _0xefb15b;});}function buildContactsQuery(_0x4579df,_0x126c4a,_0x1e23b3,_0x3d9aeb,_0x21559b,_0x58fe12){if(_0x126c4a){_0x126c4a=_0x1e23b3[_0x7528('0x53')];}_0x4579df=addFieldsToQuery(_0x4579df,_0x126c4a,_0x3d9aeb,_0x58fe12,!![]);var _0x2667d6=squel[_0x7528('0x9')]();_0x2667d6=addFieldsToQuery(_0x2667d6,_0x126c4a,_0x3d9aeb,_0x58fe12,![]);if(_0x3d9aeb||_0x58fe12){_0x4579df=applyJoinClauses(_0x4579df,!![]);_0x4579df['group'](_0x7528('0x54'));if(_0x1e23b3['limit']){_0x2667d6[_0x7528('0x55')](_0x1e23b3[_0x7528('0x55')]);}if(_0x1e23b3[_0x7528('0x56')]){_0x2667d6[_0x7528('0x56')](_0x1e23b3[_0x7528('0x56')]);}}else{_0x2667d6=applyJoinClauses(_0x2667d6,![]);_0x2667d6[_0x7528('0x57')]('subqry.id');if(_0x1e23b3[_0x7528('0x55')]){_0x4579df[_0x7528('0x55')](_0x1e23b3[_0x7528('0x55')]);}if(_0x1e23b3['offset']){_0x4579df[_0x7528('0x56')](_0x1e23b3[_0x7528('0x56')]);}}_0x2667d6[_0x7528('0x58')](_0x21559b);if(_0x1e23b3['order']){_0x1e23b3['order'][_0x7528('0x1e')](function(_0x11eeb1){_0x4579df[_0x7528('0x59')]('c.'+_0x11eeb1[0x0],_0x11eeb1[0x1]===_0x7528('0x5a')?![]:!![]);_0x2667d6[_0x7528('0x59')]('subqry.'+_0x11eeb1[0x0],_0x11eeb1[0x1]===_0x7528('0x5a')?![]:!![]);});}_0x2667d6[_0x7528('0xa')](_0x4579df,_0x7528('0xe'));return _0x2667d6;}function getFilteredContacts(_0x1f14e7){var _0x56b250=[];return db['Tag']['findAll']({'attributes':['id',_0x7528('0x48'),_0x7528('0x5b')],'raw':!![]})['then'](function(_0x3528f1){_0x56b250=_[_0x7528('0x5c')](_0x3528f1,'id');var _0x2e3479={'type':db[_0x7528('0x5d')][_0x7528('0x5e')][_0x7528('0x5f')],'model':db[_0x7528('0x60')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x7528('0x61')](_0x1f14e7[_0x7528('0x62')](),_0x2e3479);})[_0x7528('0x4d')](function(_0x49233b){_0x49233b[_0x7528('0x1e')](function(_0x45d0d0){if(_0x45d0d0[_0x7528('0x1b')]){_0x45d0d0[_0x7528('0x63')]=[];_0x45d0d0[_0x7528('0x1b')][_0x7528('0x24')](',')[_0x7528('0x1e')](function(_0x303c1c){_0x45d0d0[_0x7528('0x63')][_0x7528('0x1d')](_0x56b250[_0x303c1c]);});}delete _0x45d0d0[_0x7528('0x1b')];});return _0x49233b;});}function countFilteredContacts(_0x53003a,_0x168533){var _0x1617be=_0x53003a[_0x7528('0x64')]();_0x1617be[_0x7528('0x20')](_0x7528('0x65'));_0x1617be=applyJoinClauses(_0x1617be,!![]);_0x53003a[_0x7528('0x57')](_0x7528('0x54'));var _0x1d041b=utils[_0x7528('0x66')](_0x168533);if(!_['isEmpty'](_0x1d041b)){_0x1617be['where'](_0x7528('0x67'),_0x1d041b);}var _0x298389={'type':db['Sequelize']['QueryTypes'][_0x7528('0x5f')],'raw':!![]};return db[_0x7528('0x68')]['query'](_0x1617be[_0x7528('0x62')](),_0x298389)[_0x7528('0x4d')](function(_0x28cdc9){return _0x28cdc9[0x0][_0x7528('0x65')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x21cf=['map','some','c.ListId\x20IN\x20?','concat','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','fields','filter','then','getLists','c.ListId\x20IS\x20NULL','attributes','select','group','c.id','limit','offset','subqry.id','order','subqry.','DESC','subqry','Tag','findAll','color','keyBy','Sequelize','QueryTypes','CmContact','sequelize','query','Tags','clone','COUNT(*)','where','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../../mysqldb','role','agent','search','autocomplete','true','from','left_join','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','phone','mobile','fax','email','ListId','CompanyId','createdAt','deletedAt','TagIds','includes','push','forEach','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','DATE','buildExpression','type','default','value','start','end','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip'];(function(_0x148427,_0xeb87db){var _0x501c9d=function(_0xf07181){while(--_0xf07181){_0x148427['push'](_0x148427['shift']());}};_0x501c9d(++_0xeb87db);}(_0x21cf,0x16b));var _0xf21c=function(_0x18c192,_0x32b4e6){_0x18c192=_0x18c192-0x0;var _0x3001a8=_0x21cf[_0x18c192];return _0x3001a8;};'use strict';var _=require(_0xf21c('0x0'));var squel=require(_0xf21c('0x1'));var as=require(_0xf21c('0x2'));var qs=require(_0xf21c('0x3'));var utils=require('../interaction/utils');var db=require(_0xf21c('0x4'))['db'];function skipContactsQuery(_0x2a0803,_0x35d3c2){var _0x516a23=![];if(_0x2a0803[_0xf21c('0x5')]===_0xf21c('0x6')&&!_0x35d3c2[_0xf21c('0x7')]&&!_0x35d3c2['ListId']&&_0x35d3c2[_0xf21c('0x8')]!==_0xf21c('0x9')){_0x516a23=!![];}return _0x516a23;}function getContactsSubquery(){return squel['select']()[_0xf21c('0xa')]('cm_contacts','c')['where']('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x39dd5e,_0x2b673a){var _0x5746d5=_0x2b673a?'c':'subqry';_0x39dd5e[_0xf21c('0xb')]('cm_user_has_contacts','uc',_0xf21c('0xc')+_0x5746d5+_0xf21c('0xd'))[_0xf21c('0xb')](_0xf21c('0xe'),'ct',_0xf21c('0xf')+_0x5746d5+_0xf21c('0xd'))[_0xf21c('0xb')](_0xf21c('0x10'),'t',_0xf21c('0x11'));return _0x39dd5e;}function addFieldsToQuery(_0xb01311,_0x15b1f7,_0x4d2bbd,_0x18d40d,_0x4891ef){var _0xe1abeb=_0x4891ef?'c':'subqry';if(!_0x15b1f7){_0x15b1f7=['id',_0xf21c('0x12'),'lastName',_0xf21c('0x13'),_0xf21c('0x14'),_0xf21c('0x15'),_0xf21c('0x16'),_0xf21c('0x17'),_0xf21c('0x18'),_0xf21c('0x19'),'updatedAt',_0xf21c('0x1a'),_0xf21c('0x1b')];}else if(!_0x15b1f7[_0xf21c('0x1c')]('id')){_0x15b1f7[_0xf21c('0x1d')]('id');}var _0xcf25b2=_0x4d2bbd&&_0x4891ef||!_0x4d2bbd&&!_0x4891ef;if(_0x18d40d){_0xcf25b2=_0x18d40d&&_0x4891ef||!_0x18d40d&&!_0x4891ef;}_0x15b1f7[_0xf21c('0x1e')](function(_0x419e3c){if(_0x419e3c===_0xf21c('0x1b')){if(_0xcf25b2){_0xb01311[_0xf21c('0x1f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x419e3c);}else if(_0x4d2bbd||_0x18d40d){_0xb01311[_0xf21c('0x1f')](_0xe1abeb+'.'+_0x419e3c);}}else{_0xb01311[_0xf21c('0x1f')](_0xe1abeb+'.'+_0x419e3c);}});return _0xb01311;}function getSqlClauses(){var _0x257b60={'default':squel[_0xf21c('0x20')](),'fields':squel['expr'](),'filter':squel[_0xf21c('0x20')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0xf21c('0x20')](),'skip':![]}};return _0x257b60;}function parseTagParameter(_0x261d2e){var _0x56fd3f=squel[_0xf21c('0x20')]();if(_0x261d2e){var _0x170c88=utils[_0xf21c('0x21')](_0x261d2e);_0x170c88[_0xf21c('0x1e')](function(_0x39088d){_0x56fd3f['or'](_0xf21c('0x22'),'%,'+_0x39088d+',%');});}return _0x56fd3f;}function parseSearchFilter(_0x3a1cb2){var _0xf4c6b3=squel[_0xf21c('0x20')]();if(_0x3a1cb2){var _0x1af8b7=_0x3a1cb2[_0xf21c('0x23')]('\x5c','\x5c\x5c')[_0xf21c('0x23')](/'/g,'\x27\x27');if(_0x1af8b7[_0xf21c('0x24')]('\x20')[_0xf21c('0x25')]>0x1){_0xf4c6b3['or'](_0xf21c('0x26'),qs[_0xf21c('0x27')](_0x1af8b7),null);}else{if(qs[_0xf21c('0x28')](_0x1af8b7)){_0xf4c6b3['or'](_0xf21c('0x29'),_0x1af8b7+'%');_0xf4c6b3['or'](_0xf21c('0x2a'),_0x1af8b7+'%');_0xf4c6b3['or']('c.mobile\x20LIKE\x20?',_0x1af8b7+'%');_0xf4c6b3['or'](_0xf21c('0x2b'),_0x1af8b7+'%');}else if(qs['isEmail'](_0x1af8b7)){_0xf4c6b3['or'](_0xf21c('0x2c'),_0x1af8b7+'%');}else{_0xf4c6b3['or'](_0xf21c('0x2d'),'%'+_0x1af8b7+'%');_0xf4c6b3['or'](_0xf21c('0x2e'),'%'+_0x1af8b7+'%');_0xf4c6b3['or'](_0xf21c('0x2c'),'%'+_0x1af8b7+'%');}}}return _0xf4c6b3;}function parseAdvancedSearchFilter(_0x453537,_0x5ceda5){var _0x1c5836=getSqlClauses();var _0x30c62f=as['parseSearch'](_0x453537);var _0xc72ab6=_0x30c62f[_0xf21c('0x2f')];for(var _0x3768e6=0x0;_0x3768e6<_0x30c62f[_0xf21c('0x30')][_0xf21c('0x25')];_0x3768e6++){var _0x21c1ba=_0x30c62f[_0xf21c('0x30')][_0x3768e6];var _0xf44ab2='c';var _0x207562=_[_0xf21c('0x31')](_0x5ceda5,[_0xf21c('0x32'),_0x21c1ba[_0xf21c('0x1f')]]);if(_0x207562){if(_0x21c1ba[_0xf21c('0x1f')]===_0xf21c('0x33')||_0x207562[_0xf21c('0x34')]===_0xf21c('0x35')){_0x21c1ba['castTo']=_0xf21c('0x36');}var _0x25cbc2=as[_0xf21c('0x37')](_0xf44ab2,_0x207562[_0xf21c('0x38')],_0x21c1ba);_0x1c5836[_0xf21c('0x39')][_0xc72ab6](_0x25cbc2['text'],_0x25cbc2[_0xf21c('0x3a')][_0xf21c('0x3b')],_0x25cbc2['value'][_0xf21c('0x3c')]);}else{if(_0x21c1ba[_0xf21c('0x1f')]==='Tag'){var _0x3ab658=_0x21c1ba[_0xf21c('0x3a')][_0xf21c('0x24')](',')['map'](function(_0x4bed56){return Number(_0x4bed56);});var _0x4fda78=parseTagParameter(_0x3ab658);_0x1c5836[_0xf21c('0x3d')][_0xf21c('0x3e')][_0xf21c('0x3f')](_0x4fda78);_0x1c5836['tags'][_0xf21c('0x40')]=_0x3ab658;}else if(_0x21c1ba[_0xf21c('0x1f')]===_0xf21c('0x41')){_0x1c5836[_0xf21c('0x42')][_0xf21c('0x3e')][_0xf21c('0x3f')](_0xf21c('0x43'),_0x21c1ba['value']);_0x1c5836['user'][_0xf21c('0x44')]=!![];}}}return _0x1c5836;}function parseModelFields(_0x490ccf,_0x311103){var _0x13ab68=squel['expr']();var _0x55ed37=_(_0x490ccf)['keys']()[_0xf21c('0x45')](function(_0x21e66d){return _[_0xf21c('0x46')](_0x311103,[_0xf21c('0x32'),_0x21e66d])?_0x21e66d:undefined;})['compact']()['value']();if(_0x490ccf['Contact']){_0x55ed37[_0xf21c('0x1d')]('Contact');}if(_0x55ed37[_0xf21c('0x25')]>0x0){_0x55ed37['forEach'](function(_0xf17dec){if(_0xf17dec==='ListId'){_0x13ab68[_0xf21c('0x3f')](_0xf21c('0x47'),[][_0xf21c('0x48')](_0x490ccf[_0xf17dec]));}else if(_0xf17dec===_0xf21c('0x49')){var _0x392559='%'+_0x490ccf[_0xf17dec]+'%';_0x13ab68[_0xf21c('0x3f')](_0xf21c('0x4a'),_0x392559);}else{_0x13ab68[_0xf21c('0x3f')]('c.'+_0xf17dec+_0xf21c('0x4b'),_0x490ccf[_0xf17dec]);}});}return _0x13ab68;}function parseQueryParameters(_0x568905,_0x3bc30e){var _0x4baf76=getSqlClauses();return Promise[_0xf21c('0x4c')]()['then'](function(){return parseModelFields(_0x568905,_0x3bc30e);})['then'](function(_0x98f8ae){_0x4baf76[_0xf21c('0x4d')][_0xf21c('0x3f')](_0x98f8ae);return parseTagParameter(_0x568905['tag']);})['then'](function(_0x1321aa){_0x4baf76['tags'][_0xf21c('0x3e')][_0xf21c('0x3f')](_0x1321aa);return parseSearchFilter(_0x568905[_0xf21c('0x4e')]);})['then'](function(_0x517bad){_0x4baf76[_0xf21c('0x4e')]=_0x517bad;return _0x4baf76;});}function checkListsRestrictions(_0x464658,_0x1b3ff2,_0x3440cf){var _0x436718=squel[_0xf21c('0x20')]();return Promise['resolve']()[_0xf21c('0x4f')](function(){if(_0x1b3ff2[_0xf21c('0x7')]&&_0x464658['role']===_0xf21c('0x6')&&!_0x3440cf){return _0x464658[_0xf21c('0x50')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x56d8be){if(_0x56d8be){if(_0x56d8be['length']===0x0){_0x436718['and'](_0xf21c('0x51'));}else{_0x436718[_0xf21c('0x3f')](_0xf21c('0x47'),_[_0xf21c('0x45')](_0x56d8be,'id'));}}})[_0xf21c('0x4f')](function(){return _0x436718;});}function buildContactsQuery(_0x5596af,_0x3346a9,_0x4e02b8,_0x1df1d8,_0x23b7d3,_0x499b56){if(_0x3346a9){_0x3346a9=_0x4e02b8[_0xf21c('0x52')];}_0x5596af=addFieldsToQuery(_0x5596af,_0x3346a9,_0x1df1d8,_0x499b56,!![]);var _0x2e7336=squel[_0xf21c('0x53')]();_0x2e7336=addFieldsToQuery(_0x2e7336,_0x3346a9,_0x1df1d8,_0x499b56,![]);if(_0x1df1d8||_0x499b56){_0x5596af=applyJoinClauses(_0x5596af,!![]);_0x5596af[_0xf21c('0x54')](_0xf21c('0x55'));if(_0x4e02b8['limit']){_0x2e7336[_0xf21c('0x56')](_0x4e02b8[_0xf21c('0x56')]);}if(_0x4e02b8[_0xf21c('0x57')]){_0x2e7336[_0xf21c('0x57')](_0x4e02b8[_0xf21c('0x57')]);}}else{_0x2e7336=applyJoinClauses(_0x2e7336,![]);_0x2e7336[_0xf21c('0x54')](_0xf21c('0x58'));if(_0x4e02b8['limit']){_0x5596af['limit'](_0x4e02b8[_0xf21c('0x56')]);}if(_0x4e02b8['offset']){_0x5596af[_0xf21c('0x57')](_0x4e02b8['offset']);}}_0x2e7336['having'](_0x23b7d3);if(_0x4e02b8[_0xf21c('0x59')]){_0x4e02b8[_0xf21c('0x59')][_0xf21c('0x1e')](function(_0x23d716){_0x5596af[_0xf21c('0x59')]('c.'+_0x23d716[0x0],_0x23d716[0x1]==='DESC'?![]:!![]);_0x2e7336[_0xf21c('0x59')](_0xf21c('0x5a')+_0x23d716[0x0],_0x23d716[0x1]===_0xf21c('0x5b')?![]:!![]);});}_0x2e7336['from'](_0x5596af,_0xf21c('0x5c'));return _0x2e7336;}function getFilteredContacts(_0x25b9ed){var _0x8d4fae=[];return db[_0xf21c('0x5d')][_0xf21c('0x5e')]({'attributes':['id',_0xf21c('0x32'),_0xf21c('0x5f')],'raw':!![]})[_0xf21c('0x4f')](function(_0x19c75f){_0x8d4fae=_[_0xf21c('0x60')](_0x19c75f,'id');var _0x30474a={'type':db[_0xf21c('0x61')][_0xf21c('0x62')]['SELECT'],'model':db[_0xf21c('0x63')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xf21c('0x64')][_0xf21c('0x65')](_0x25b9ed['toString'](),_0x30474a);})[_0xf21c('0x4f')](function(_0x5ed890){_0x5ed890[_0xf21c('0x1e')](function(_0x2d1f1f){if(_0x2d1f1f[_0xf21c('0x1b')]){_0x2d1f1f[_0xf21c('0x66')]=[];_0x2d1f1f['TagIds'][_0xf21c('0x24')](',')[_0xf21c('0x1e')](function(_0x61feed){_0x2d1f1f['Tags'][_0xf21c('0x1d')](_0x8d4fae[_0x61feed]);});}delete _0x2d1f1f[_0xf21c('0x1b')];});return _0x5ed890;});}function countFilteredContacts(_0x2067f4,_0x353d80){var _0x45c150=_0x2067f4[_0xf21c('0x67')]();_0x45c150[_0xf21c('0x1f')](_0xf21c('0x68'));_0x45c150=applyJoinClauses(_0x45c150,!![]);_0x2067f4['group'](_0xf21c('0x55'));var _0x18b34f=utils['getSelectedTags'](_0x353d80);if(!_['isEmpty'](_0x18b34f)){_0x45c150[_0xf21c('0x69')](_0xf21c('0x6a'),_0x18b34f);}var _0x1ad336={'type':db[_0xf21c('0x61')][_0xf21c('0x62')]['SELECT'],'raw':!![]};return db[_0xf21c('0x64')]['query'](_0x45c150['toString'](),_0x1ad336)[_0xf21c('0x4f')](function(_0x1cdb03){return _0x1cdb03[0x0][_0xf21c('0x68')];});}module[_0xf21c('0x6b')]={'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 06a0d43..a0e8cd4 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 _0xe2ad=['base64','crypto','bluebird','lodash','../../config/environment','app','session','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createWriteStream','createCipher','binary','write','end','final','close','unlink','decryptFile','createReadStream','createDecipher','data','secret','update','utf8'];(function(_0x42a562,_0x1e2b54){var _0x340e5a=function(_0x19990e){while(--_0x19990e){_0x42a562['push'](_0x42a562['shift']());}};_0x340e5a(++_0x1e2b54);}(_0xe2ad,0x12a));var _0xde2a=function(_0x13ba21,_0x190d6e){_0x13ba21=_0x13ba21-0x0;var _0x4307f6=_0xe2ad[_0x13ba21];return _0x4307f6;};'use strict';var crypto=require(_0xde2a('0x0'));var fs=require('fs');var BPromise=require(_0xde2a('0x1'));var _=require(_0xde2a('0x2'));var config=require(_0xde2a('0x3'));var logger=require('../../config/logger')(_0xde2a('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xde2a('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xde2a('0x6')};if(config[_0xde2a('0x7')]&&config[_0xde2a('0x7')][_0xde2a('0x8')]){var isSupported=isAlgorithmSupported(config[_0xde2a('0x7')][_0xde2a('0x8')]);if(isSupported){fileOptions[_0xde2a('0x8')]=config['encrypt'][_0xde2a('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xde2a('0x9')](',\x20');logger[_0xde2a('0xa')](config[_0xde2a('0x7')]['algorithm'],_0xde2a('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x1dff82){return AES_SUPPORTED_RX[_0xde2a('0xc')](_0x1dff82);}function getSupportedCiphers(){return crypto[_0xde2a('0xd')]()[_0xde2a('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x30cc8e){return getSupportedCiphers()[_0xde2a('0xf')](_0x30cc8e)>-0x1;}function combineOptions(_0x29cf57){var _0x302ad6={};for(var _0x5de86a in fileOptions){if(fileOptions['hasOwnProperty'](_0x5de86a)){_0x302ad6[_0x5de86a]=fileOptions[_0x5de86a];}}if(_0x29cf57){for(var _0x2f8e14 in _0x29cf57){if(_0x29cf57[_0xde2a('0x10')](_0x2f8e14)){_0x302ad6[_0x2f8e14]=_0x29cf57[_0x2f8e14];}}}return _0x302ad6;}exports['encryptFile']=function(_0x14a4ae,_0x44dddb,_0x219628,_0x2c66d3){return new BPromise(function(_0x281e86,_0x4632aa){_0x2c66d3=combineOptions(_0x2c66d3);var _0x57465c=new Buffer(_0x219628);var _0x2e1e41=fs['createReadStream'](_0x14a4ae);var _0x4102b=fs[_0xde2a('0x11')](_0x44dddb);var _0x585409=crypto[_0xde2a('0x12')](_0x2c66d3[_0xde2a('0x8')],_0x57465c);_0x2e1e41['on']('data',function(_0x9abcce){var _0x4c3c6b=new Buffer(_0x585409['update'](_0x9abcce),_0xde2a('0x13'));_0x4102b[_0xde2a('0x14')](_0x4c3c6b);});_0x2e1e41['on'](_0xde2a('0x15'),function(){try{var _0x13a701=new Buffer(_0x585409[_0xde2a('0x16')](_0xde2a('0x13')),_0xde2a('0x13'));_0x4102b[_0xde2a('0x14')](_0x13a701);_0x4102b['end']();_0x4102b['on'](_0xde2a('0x17'),function(){return _0x281e86(_0x44dddb);});}catch(_0x2ecd10){fs[_0xde2a('0x18')](_0x44dddb);return _0x4632aa(_0x2ecd10);}});});};exports[_0xde2a('0x19')]=function(_0x2740b0,_0x556bb3,_0x17777e,_0x2d5903){return new BPromise(function(_0x4fc088,_0x396358){_0x2d5903=combineOptions(_0x2d5903);var _0x1035bb=new Buffer(_0x17777e);var _0x497b2d=fs[_0xde2a('0x1a')](_0x2740b0);var _0x16fa1a=fs[_0xde2a('0x11')](_0x556bb3);var _0x10f575=crypto[_0xde2a('0x1b')](_0x2d5903[_0xde2a('0x8')],_0x1035bb);_0x497b2d['on'](_0xde2a('0x1c'),function(_0x41bb39){var _0x373d1f=new Buffer(_0x10f575['update'](_0x41bb39),_0xde2a('0x13'));_0x16fa1a[_0xde2a('0x14')](_0x373d1f);});_0x497b2d['on']('end',function(){try{var _0x348e04=new Buffer(_0x10f575[_0xde2a('0x16')](_0xde2a('0x13')),_0xde2a('0x13'));_0x16fa1a[_0xde2a('0x14')](_0x348e04);_0x16fa1a[_0xde2a('0x15')]();_0x16fa1a['on']('close',function(){return _0x4fc088(_0x556bb3);});}catch(_0x21c512){fs[_0xde2a('0x18')](_0x556bb3);return _0x396358(_0x21c512);}});});};exports['encryptString']=function(_0x515bb4,_0x311c56,_0x104c9c){var _0x3ccfbd=_0x104c9c||stringOptions[_0xde2a('0x8')];var _0xc6ec4b=_0x311c56||stringOptions[_0xde2a('0x1d')];var _0x5dc3e6=crypto[_0xde2a('0x12')](_0x3ccfbd,_0xc6ec4b);var _0x474a86=_0x5dc3e6[_0xde2a('0x1e')](_0x515bb4,_0xde2a('0x1f'),'base64');_0x474a86+=_0x5dc3e6['final'](_0xde2a('0x20'));return _0x474a86;};exports['decryptString']=function(_0x94cf6f,_0x5eca71,_0x1ea076){var _0x3b3bee=_0x1ea076||stringOptions['algorithm'];var _0x53c595=_0x5eca71||stringOptions['secret'];var _0x125086=crypto['createDecipher'](_0x3b3bee,_0x53c595);var _0x57b279=_0x125086[_0xde2a('0x1e')](_0x94cf6f,_0xde2a('0x20'),_0xde2a('0x1f'));_0x57b279+=_0x125086['final'](_0xde2a('0x1f'));return _0x57b279;}; \ No newline at end of file +var _0x74b4=['test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','write','final','binary','end','close','unlink','decryptFile','secret','utf8','base64','createDecipher','bluebird','lodash','../../config/environment','app','session','aes-256-ctr','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:'];(function(_0x7bedcf,_0x4a31f2){var _0x5b4136=function(_0xf7a940){while(--_0xf7a940){_0x7bedcf['push'](_0x7bedcf['shift']());}};_0x5b4136(++_0x4a31f2);}(_0x74b4,0x79));var _0x474b=function(_0x159dd2,_0x5276b0){_0x159dd2=_0x159dd2-0x0;var _0x21787b=_0x74b4[_0x159dd2];return _0x21787b;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x474b('0x0'));var _=require(_0x474b('0x1'));var config=require(_0x474b('0x2'));var logger=require('../../config/logger')(_0x474b('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x474b('0x4')],'algorithm':_0x474b('0x5')};const fileOptions={'algorithm':_0x474b('0x6')};if(config[_0x474b('0x7')]&&config[_0x474b('0x7')][_0x474b('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x474b('0x8')]);if(isSupported){fileOptions[_0x474b('0x8')]=config[_0x474b('0x7')][_0x474b('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x474b('0x9')](config[_0x474b('0x7')][_0x474b('0x8')],_0x474b('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x158f95){return AES_SUPPORTED_RX[_0x474b('0xb')](_0x158f95);}function getSupportedCiphers(){return crypto[_0x474b('0xc')]()[_0x474b('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x48aca9){return getSupportedCiphers()[_0x474b('0xe')](_0x48aca9)>-0x1;}function combineOptions(_0xef6387){var _0x515855={};for(var _0x594b28 in fileOptions){if(fileOptions[_0x474b('0xf')](_0x594b28)){_0x515855[_0x594b28]=fileOptions[_0x594b28];}}if(_0xef6387){for(var _0xe1305c in _0xef6387){if(_0xef6387[_0x474b('0xf')](_0xe1305c)){_0x515855[_0xe1305c]=_0xef6387[_0xe1305c];}}}return _0x515855;}exports[_0x474b('0x10')]=function(_0x210c5d,_0x28f731,_0x5ebdde,_0x312950){return new BPromise(function(_0x7a9586,_0x46b304){_0x312950=combineOptions(_0x312950);var _0x5a7813=new Buffer(_0x5ebdde);var _0x41c096=fs[_0x474b('0x11')](_0x210c5d);var _0xbafcb0=fs[_0x474b('0x12')](_0x28f731);var _0x1ccd47=crypto[_0x474b('0x13')](_0x312950['algorithm'],_0x5a7813);_0x41c096['on'](_0x474b('0x14'),function(_0x12a862){var _0x5642ea=new Buffer(_0x1ccd47[_0x474b('0x15')](_0x12a862),'binary');_0xbafcb0[_0x474b('0x16')](_0x5642ea);});_0x41c096['on']('end',function(){try{var _0x466f77=new Buffer(_0x1ccd47[_0x474b('0x17')](_0x474b('0x18')),_0x474b('0x18'));_0xbafcb0['write'](_0x466f77);_0xbafcb0[_0x474b('0x19')]();_0xbafcb0['on'](_0x474b('0x1a'),function(){return _0x7a9586(_0x28f731);});}catch(_0x1e19b4){fs[_0x474b('0x1b')](_0x28f731);return _0x46b304(_0x1e19b4);}});});};exports[_0x474b('0x1c')]=function(_0xe1b1b9,_0x23643f,_0x5c0d12,_0x418e55){return new BPromise(function(_0x2c02ee,_0x4f5a16){_0x418e55=combineOptions(_0x418e55);var _0x5396d1=new Buffer(_0x5c0d12);var _0x392020=fs['createReadStream'](_0xe1b1b9);var _0x128dce=fs[_0x474b('0x12')](_0x23643f);var _0x4adf80=crypto['createDecipher'](_0x418e55['algorithm'],_0x5396d1);_0x392020['on'](_0x474b('0x14'),function(_0x4f296a){var _0x4378f6=new Buffer(_0x4adf80[_0x474b('0x15')](_0x4f296a),'binary');_0x128dce[_0x474b('0x16')](_0x4378f6);});_0x392020['on']('end',function(){try{var _0x173b45=new Buffer(_0x4adf80['final'](_0x474b('0x18')),_0x474b('0x18'));_0x128dce['write'](_0x173b45);_0x128dce[_0x474b('0x19')]();_0x128dce['on'](_0x474b('0x1a'),function(){return _0x2c02ee(_0x23643f);});}catch(_0x3b5fcb){fs[_0x474b('0x1b')](_0x23643f);return _0x4f5a16(_0x3b5fcb);}});});};exports['encryptString']=function(_0x6339ab,_0x2f9808,_0x5686de){var _0x4a1d7b=_0x5686de||stringOptions['algorithm'];var _0x2cfb5c=_0x2f9808||stringOptions[_0x474b('0x1d')];var _0x56ed2d=crypto[_0x474b('0x13')](_0x4a1d7b,_0x2cfb5c);var _0x41e4fc=_0x56ed2d[_0x474b('0x15')](_0x6339ab,_0x474b('0x1e'),_0x474b('0x1f'));_0x41e4fc+=_0x56ed2d['final'](_0x474b('0x1f'));return _0x41e4fc;};exports['decryptString']=function(_0x3d42bd,_0x254993,_0x3bd92a){var _0x36e258=_0x3bd92a||stringOptions[_0x474b('0x8')];var _0x357dcc=_0x254993||stringOptions['secret'];var _0x4d3549=crypto[_0x474b('0x20')](_0x36e258,_0x357dcc);var _0x40018d=_0x4d3549[_0x474b('0x15')](_0x3d42bd,_0x474b('0x1f'),_0x474b('0x1e'));_0x40018d+=_0x4d3549[_0x474b('0x17')](_0x474b('0x1e'));return _0x40018d;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 38c3bbb..5736ace 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 _0xb6fd=['info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','split','existsSync','join','mkdirSync','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','update'];(function(_0x519006,_0x113827){var _0x165a26=function(_0x4d5047){while(--_0x4d5047){_0x519006['push'](_0x519006['shift']());}};_0x165a26(++_0x113827);}(_0xb6fd,0x12c));var _0xdb6f=function(_0x4ed146,_0x194578){_0x4ed146=_0x4ed146-0x0;var _0x289241=_0xb6fd[_0x4ed146];return _0x289241;};'use strict';var util=require(_0xdb6f('0x0'));var path=require(_0xdb6f('0x1'));var _=require(_0xdb6f('0x2'));var csv=require(_0xdb6f('0x3'));var fs=require('fs');var BPromise=require(_0xdb6f('0x4'));var zipdir=require(_0xdb6f('0x5'));var rimraf=require('rimraf');var db=require(_0xdb6f('0x6'))['db'];var dbH=require(_0xdb6f('0x6'))['dbH'];var logger=require('../../config/logger')(_0xdb6f('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xdb6f('0x8')][0x3];var PATH=process[_0xdb6f('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x91420c,_0x4b1664){var _0x3f0c6b={'status':_0x91420c};var _0x202594={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4b1664){_0x3f0c6b[_0xdb6f('0x9')]=_0x4b1664;}return db[_0xdb6f('0xa')][_0xdb6f('0xb')](_0x3f0c6b,_0x202594);}function main(){var _0x25d365=0x1388;var _0xf90b57;logger[_0xdb6f('0xc')](util[_0xdb6f('0xd')](_0xdb6f('0xe'),EXTRACTED_REPORT_ID,_0xdb6f('0xf')));return db[_0xdb6f('0x10')][_0xdb6f('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xdb6f('0x12')]})[_0xdb6f('0x13')](function(_0x2ccae4){if(_0x2ccae4){_0xf90b57=_0x2ccae4;_0x25d365=_0xf90b57[_0xdb6f('0x12')]||0x1388;}})[_0xdb6f('0x13')](function(){return dbH['sequelize'][_0xdb6f('0x14')](util['format'](_0xdb6f('0x15'),QUERY),{'type':dbH['sequelize'][_0xdb6f('0x16')][_0xdb6f('0x17')]});})['then'](function(_0x38aec4){if(!_0x38aec4[0x0][_0xdb6f('0x18')]){return analyticExtractedReport(_0xdb6f('0x19'));}var _0x213f59=[];var _0x3059b7=0x0;if(_0xf90b57['split']){if(_0x38aec4&&_0x38aec4[_0xdb6f('0x1a')]){var _0x4ba18a=_[_0xdb6f('0x1b')](_0x38aec4[0x0]['num']/_0x25d365);var _0x446e2f=Number[_0xdb6f('0x1c')](_0x38aec4[0x0]['num']/_0x25d365)?_0x38aec4[0x0][_0xdb6f('0x18')]%_0x25d365:0x0;_0x4ba18a[_0xdb6f('0x1d')](function(_0x325668){if(_0x325668>0x0){_0x3059b7+=_0x25d365;}_0x213f59[_0xdb6f('0x1e')](dbH[_0xdb6f('0x1f')][_0xdb6f('0x14')](util[_0xdb6f('0xd')](_0xdb6f('0x20'),QUERY,_0x25d365,_0x3059b7),{'type':dbH[_0xdb6f('0x1f')][_0xdb6f('0x16')][_0xdb6f('0x17')]}));});if(_0x446e2f>0x0){_0x3059b7+=_0x25d365;_0x213f59[_0xdb6f('0x1e')](dbH[_0xdb6f('0x1f')]['query'](util[_0xdb6f('0xd')](_0xdb6f('0x20'),QUERY,_0x446e2f,_0x3059b7),{'type':dbH[_0xdb6f('0x1f')][_0xdb6f('0x16')][_0xdb6f('0x17')]}));}}}else{_0x213f59['push'](dbH[_0xdb6f('0x1f')][_0xdb6f('0x14')](QUERY,{'type':dbH['sequelize'][_0xdb6f('0x16')]['SELECT']}));}var _0x2051ed=path[_0xdb6f('0x21')](PATH);var _0x48b488=path['basename'](PATH,_0xdb6f('0x22'));var _0x564902=_0xf90b57[_0xdb6f('0x23')]&&_0x213f59['length']>0x1;var _0x277a8d=[];if(!fs[_0xdb6f('0x24')](path[_0xdb6f('0x25')](_0x2051ed,_0x48b488))&&_0x564902){fs[_0xdb6f('0x26')](path[_0xdb6f('0x25')](_0x2051ed,_0x48b488));}return BPromise['each'](_0x213f59,function(_0x4e8330){_0x277a8d[_0xdb6f('0x1e')](_0x4e8330);})[_0xdb6f('0x13')](function(){for(var _0x3abcbb=0x0;_0x3abcbb<_0x277a8d['length'];_0x3abcbb+=0x1){var _0x4aa239;var _0xb2494d=_0x277a8d[_0x3abcbb];if(_0x564902){_0x4aa239=path[_0xdb6f('0x25')](_0x2051ed,_0x48b488,util[_0xdb6f('0xd')]('%s%d.%s',_0x48b488,_0x3abcbb,_0xdb6f('0x27')));}else{_0x4aa239=path[_0xdb6f('0x25')](_0x2051ed,util[_0xdb6f('0xd')](_0xdb6f('0x28'),_0x48b488,_0xdb6f('0x27')));}fs[_0xdb6f('0x29')](_0x4aa239,csv(_0xb2494d));}})[_0xdb6f('0x13')](function(){if(_0x564902){return new Promise(function(_0x70c540){zipdir(path[_0xdb6f('0x25')](_0x2051ed,_0x48b488),{'saveTo':path[_0xdb6f('0x25')](_0x2051ed,util[_0xdb6f('0xd')](_0xdb6f('0x28'),_0x48b488,_0xdb6f('0x2a')))},function(_0x2c7cab,_0x389f9e){rimraf(path[_0xdb6f('0x25')](_0x2051ed,_0x48b488),function(){});_0x70c540(_0xdb6f('0x2b'));});});}})[_0xdb6f('0x13')](function(){logger[_0xdb6f('0xc')](util[_0xdb6f('0xd')](_0xdb6f('0x2c'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xdb6f('0x2d'),_0x564902?util[_0xdb6f('0xd')](_0xdb6f('0x28'),_0x48b488,_0x564902?_0xdb6f('0x2a'):'csv'):null);});})[_0xdb6f('0x2e')](function(_0x317a34){logger[_0xdb6f('0xc')](util[_0xdb6f('0xd')](_0xdb6f('0x2f'),EXTRACTED_REPORT_ID,_0xdb6f('0xf')),util[_0xdb6f('0x30')](_0x317a34,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xdb6f('0x31'));})[_0xdb6f('0x32')](function(){process[_0xdb6f('0x33')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xc9ae=['zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','existsSync','mkdirSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip'];(function(_0x2000bc,_0x17b3f8){var _0x42e15c=function(_0x275342){while(--_0x275342){_0x2000bc['push'](_0x2000bc['shift']());}};_0x42e15c(++_0x17b3f8);}(_0xc9ae,0xdc));var _0xec9a=function(_0x2fad45,_0x503131){_0x2fad45=_0x2fad45-0x0;var _0xc0a6bd=_0xc9ae[_0x2fad45];return _0xc0a6bd;};'use strict';var util=require('util');var path=require(_0xec9a('0x0'));var _=require(_0xec9a('0x1'));var csv=require(_0xec9a('0x2'));var fs=require('fs');var BPromise=require(_0xec9a('0x3'));var zipdir=require(_0xec9a('0x4'));var rimraf=require(_0xec9a('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xec9a('0x6'))[_0xec9a('0x7')];var logger=require(_0xec9a('0x8'))(_0xec9a('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xec9a('0xa')][0x3];var PATH=process[_0xec9a('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1492e3,_0x8f9153){var _0x54c3f4={'status':_0x1492e3};var _0x506825={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x8f9153){_0x54c3f4['savename']=_0x8f9153;}return db[_0xec9a('0xb')][_0xec9a('0xc')](_0x54c3f4,_0x506825);}function main(){var _0xdf2096=0x1388;var _0x2e9360;logger['info'](util['format'](_0xec9a('0xd'),EXTRACTED_REPORT_ID,_0xec9a('0xe')));return db[_0xec9a('0xf')][_0xec9a('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xec9a('0x11'),_0xec9a('0x12')]})['then'](function(_0x31786c){if(_0x31786c){_0x2e9360=_0x31786c;_0xdf2096=_0x2e9360[_0xec9a('0x12')]||0x1388;}})[_0xec9a('0x13')](function(){return dbH[_0xec9a('0x14')][_0xec9a('0x15')](util[_0xec9a('0x16')](_0xec9a('0x17'),QUERY),{'type':dbH[_0xec9a('0x14')][_0xec9a('0x18')][_0xec9a('0x19')]});})[_0xec9a('0x13')](function(_0x144349){if(!_0x144349[0x0][_0xec9a('0x1a')]){return analyticExtractedReport(_0xec9a('0x1b'));}var _0x896caa=[];var _0x557ba8=0x0;if(_0x2e9360[_0xec9a('0x11')]){if(_0x144349&&_0x144349[_0xec9a('0x1c')]){var _0x4e3006=_['range'](_0x144349[0x0]['num']/_0xdf2096);var _0xf5dc40=Number[_0xec9a('0x1d')](_0x144349[0x0][_0xec9a('0x1a')]/_0xdf2096)?_0x144349[0x0]['num']%_0xdf2096:0x0;_0x4e3006[_0xec9a('0x1e')](function(_0x101b49){if(_0x101b49>0x0){_0x557ba8+=_0xdf2096;}_0x896caa['push'](dbH[_0xec9a('0x14')][_0xec9a('0x15')](util[_0xec9a('0x16')](_0xec9a('0x1f'),QUERY,_0xdf2096,_0x557ba8),{'type':dbH['sequelize'][_0xec9a('0x18')]['SELECT']}));});if(_0xf5dc40>0x0){_0x557ba8+=_0xdf2096;_0x896caa[_0xec9a('0x20')](dbH[_0xec9a('0x14')][_0xec9a('0x15')](util['format'](_0xec9a('0x1f'),QUERY,_0xf5dc40,_0x557ba8),{'type':dbH[_0xec9a('0x14')][_0xec9a('0x18')][_0xec9a('0x19')]}));}}}else{_0x896caa[_0xec9a('0x20')](dbH['sequelize'][_0xec9a('0x15')](QUERY,{'type':dbH['sequelize'][_0xec9a('0x18')][_0xec9a('0x19')]}));}var _0x4cdcac=path[_0xec9a('0x21')](PATH);var _0x4bc081=path[_0xec9a('0x22')](PATH,_0xec9a('0x23'));var _0x3038ad=_0x2e9360['split']&&_0x896caa[_0xec9a('0x1c')]>0x1;var _0x50f9e4=[];if(!fs[_0xec9a('0x24')](path['join'](_0x4cdcac,_0x4bc081))&&_0x3038ad){fs[_0xec9a('0x25')](path[_0xec9a('0x26')](_0x4cdcac,_0x4bc081));}return BPromise[_0xec9a('0x27')](_0x896caa,function(_0x316a0c){_0x50f9e4['push'](_0x316a0c);})[_0xec9a('0x13')](function(){for(var _0x351496=0x0;_0x351496<_0x50f9e4['length'];_0x351496+=0x1){var _0x1799e3;var _0x709dc3=_0x50f9e4[_0x351496];if(_0x3038ad){_0x1799e3=path[_0xec9a('0x26')](_0x4cdcac,_0x4bc081,util[_0xec9a('0x16')](_0xec9a('0x28'),_0x4bc081,_0x351496,_0xec9a('0x29')));}else{_0x1799e3=path[_0xec9a('0x26')](_0x4cdcac,util['format'](_0xec9a('0x2a'),_0x4bc081,'csv'));}fs[_0xec9a('0x2b')](_0x1799e3,csv(_0x709dc3));}})[_0xec9a('0x13')](function(){if(_0x3038ad){return new Promise(function(_0x5d8fd5){zipdir(path[_0xec9a('0x26')](_0x4cdcac,_0x4bc081),{'saveTo':path[_0xec9a('0x26')](_0x4cdcac,util['format'](_0xec9a('0x2a'),_0x4bc081,_0xec9a('0x2c')))},function(_0x8c1ca3,_0x556d48){rimraf(path['join'](_0x4cdcac,_0x4bc081),function(){});_0x5d8fd5(_0xec9a('0x2d'));});});}})[_0xec9a('0x13')](function(){logger[_0xec9a('0x2e')](util[_0xec9a('0x16')](_0xec9a('0x2f'),EXTRACTED_REPORT_ID,_0xec9a('0xe')));return analyticExtractedReport(_0xec9a('0x30'),_0x3038ad?util[_0xec9a('0x16')](_0xec9a('0x2a'),_0x4bc081,_0x3038ad?_0xec9a('0x2c'):_0xec9a('0x29')):null);});})['catch'](function(_0x481cba){logger['info'](util[_0xec9a('0x16')](_0xec9a('0x31'),EXTRACTED_REPORT_ID,'CSV'),util[_0xec9a('0x32')](_0x481cba,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xec9a('0x33'));})[_0xec9a('0x34')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 46a935f..8c0283e 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 _0x77c3=['join','each','flatten','%s%d.%s','%s.%s','then','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','pdf','findOne','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','center','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','catch','lodash','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','toString','value','body','push','concat','keys','format','startDate','endDate','length','pageBreak','before','margin','\x20/\x20','footer','Arial','black','num','find','splitSizePdf','split','range','forEach','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','query','QueryTypes','dirname','basename','.pdf','existsSync'];(function(_0x28a94c,_0x26435c){var _0x3e657d=function(_0x5de15b){while(--_0x5de15b){_0x28a94c['push'](_0x28a94c['shift']());}};_0x3e657d(++_0x26435c);}(_0x77c3,0x129));var _0x377c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x77c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x377c('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x377c('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0x377c('0x2'));var PdfPrinter=require(_0x377c('0x3'));var zipdir=require(_0x377c('0x4'));var rimraf=require(_0x377c('0x5'));var JSDOM=require('jsdom')[_0x377c('0x6')];var window=new JSDOM('')[_0x377c('0x7')];var BPromise=require(_0x377c('0x8'));var db=require('../../mysqldb')['db'];var dbH=require(_0x377c('0x9'))[_0x377c('0xa')];var logger=require('../../config/logger')(_0x377c('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x377c('0xc')][0x3];var PATH=process[_0x377c('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x377c('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x144769,_0x297e95){var _0x4377b2={'status':_0x144769};var _0x47f7e2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x297e95){_0x4377b2[_0x377c('0xe')]=_0x297e95;}return db[_0x377c('0xf')][_0x377c('0x10')](_0x4377b2,_0x47f7e2);}function getHeaders(_0x35e627){return _['map'](_0x35e627,function(_0x309677){return{'text':_0x309677,'style':'tableHeader'};});}function getRows(_0x34df04,_0x24e7cd){return _[_0x377c('0x11')](_0x24e7cd,function(_0x5c316d){return _(_0x5c316d)[_0x377c('0x12')](_0x34df04)['map'](function(_0x59acfb){return _0x59acfb?_[_0x377c('0x13')](_0x59acfb):'';})[_0x377c('0x14')]();});}function createTable(_0x3f614d,_0x243b40){var _0x3ea00c={'widths':_['fill'](Array(_0x3f614d['length']),0x91),'heights':function(_0x34cb62){return _0x34cb62===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x13ce16=getHeaders(_0x3f614d);_0x3ea00c[_0x377c('0x15')][_0x377c('0x16')](_0x13ce16);var _0x1ea726=getRows(_0x3f614d,_0x243b40);_0x3ea00c[_0x377c('0x15')]=_0x3ea00c['body'][_0x377c('0x17')](_0x1ea726);return _0x3ea00c;}function createTables(_0x27d6e5){var _0xd4afe0=[];var _0x11b962=_['chunk'](Object[_0x377c('0x18')](_0x27d6e5[0x0]),0x5);_0x11b962['forEach'](function(_0x23e504){_0xd4afe0[_0x377c('0x16')](createTable(_0x23e504,_0x27d6e5));});return _0xd4afe0;}function getPDFDocDefinition(_0x2d9664){var _0x416311=util[_0x377c('0x19')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x377c('0x1a')])[_0x377c('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0x377c('0x1b')])['format'](FORMAT));var _0x192149=[];for(var _0x301c27=0x0;_0x301c27<_0x2d9664[_0x377c('0x1c')];_0x301c27++){var _0x472267=[];if(_0x301c27===0x0){_0x472267[_0x377c('0x16')]({'text':_0x416311,'style':'header'});}var _0x756eeb={'table':_0x2d9664[_0x301c27]};if(_0x301c27>0x0){_0x756eeb[_0x377c('0x1d')]=_0x377c('0x1e');_0x756eeb[_0x377c('0x1f')]=[0x0,0x46,0x0,0x0];}_0x472267[_0x377c('0x16')](_0x756eeb);_0x192149[_0x377c('0x16')](_0x472267);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x192149,'footer':function(_0x2c2881,_0x2af26d){return{'text':_0x2c2881['toString']()+_0x377c('0x20')+_0x2af26d,'style':_0x377c('0x21')};},'defaultStyle':{'font':_0x377c('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x377c('0x23')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2576c6){var _0x3e21eb=0x1388;var _0x783ca5;if(!_0x2576c6[0x0][_0x377c('0x24')]){return analyticExtractedReport('Empty');}return db['Setting'][_0x377c('0x25')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x377c('0x26')]})['then'](function(_0x55dbc1){if(_0x55dbc1){_0x783ca5=_0x55dbc1;_0x3e21eb=_0x783ca5[_0x377c('0x26')]||0x3e8;}})['then'](function(){var _0x2dbb1d=[];var _0x266035=0x0;if(_0x783ca5[_0x377c('0x27')]){if(_0x2576c6&&_0x2576c6['length']){var _0x8fc069=_[_0x377c('0x28')](_0x2576c6[0x0][_0x377c('0x24')]/_0x3e21eb);var _0x2100dc=Number['isInteger'](_0x2576c6[0x0][_0x377c('0x24')]/_0x3e21eb)?_0x2576c6[0x0][_0x377c('0x24')]%_0x3e21eb:0x0;_0x8fc069[_0x377c('0x29')](function(_0x2991b6){if(_0x2991b6>0x0){_0x266035+=_0x3e21eb;}_0x2dbb1d[_0x377c('0x16')](dbH[_0x377c('0x2a')]['query'](util[_0x377c('0x19')](_0x377c('0x2b'),QUERY,_0x3e21eb,_0x266035),{'type':dbH[_0x377c('0x2a')]['QueryTypes'][_0x377c('0x2c')]}));});if(_0x2100dc>0x0){_0x266035+=_0x3e21eb;_0x2dbb1d[_0x377c('0x16')](dbH['sequelize'][_0x377c('0x2d')](util[_0x377c('0x19')](_0x377c('0x2b'),QUERY,_0x2100dc,_0x266035),{'type':dbH['sequelize'][_0x377c('0x2e')][_0x377c('0x2c')]}));}}}else{_0x2dbb1d[_0x377c('0x16')](dbH[_0x377c('0x2a')][_0x377c('0x2d')](QUERY,{'type':dbH['sequelize'][_0x377c('0x2e')]['SELECT']}));}var _0x352983=path[_0x377c('0x2f')](PATH);var _0x5514d4=path[_0x377c('0x30')](PATH,_0x377c('0x31'));var _0x3f4796=_0x783ca5[_0x377c('0x27')]&&_0x2dbb1d[_0x377c('0x1c')]>0x1;var _0x3dc4da=[];if(!fs[_0x377c('0x32')](path[_0x377c('0x33')](_0x352983,_0x5514d4))&&_0x3f4796){fs['mkdirSync'](path['join'](_0x352983,_0x5514d4));}return BPromise[_0x377c('0x34')](_0x2dbb1d,function(_0x1bc3fd){_0x3dc4da['push'](_0x1bc3fd);})['then'](function(){var _0x29dd5a=[];for(var _0x5aca50=0x0;_0x5aca50<_0x3dc4da[_0x377c('0x1c')];_0x5aca50+=0x1){var _0x9b8af=_0x3dc4da[_0x5aca50];var _0x1ef6ea=createTables(_[_0x377c('0x35')](_0x9b8af));var _0x30f1d7;var _0xd8e96c=getPDFDocDefinition(_0x1ef6ea);var _0x211db4=getPDFPrinter();var _0x39009a=_0x211db4['createPdfKitDocument'](_0xd8e96c);if(_0x3f4796){_0x30f1d7=path['join'](_0x352983,_0x5514d4,util[_0x377c('0x19')](_0x377c('0x36'),_0x5514d4,_0x5aca50,'pdf'));}else{_0x30f1d7=path[_0x377c('0x33')](_0x352983,util[_0x377c('0x19')](_0x377c('0x37'),_0x5514d4,'pdf'));}_0x29dd5a[_0x377c('0x16')](writePDFDocument(_0x39009a,_0x30f1d7));}return Promise['all'](_0x29dd5a);})[_0x377c('0x38')](function(){if(_0x3f4796){return new Promise(function(_0x446c27){zipdir(path[_0x377c('0x33')](_0x352983,_0x5514d4),{'saveTo':path[_0x377c('0x33')](_0x352983,util[_0x377c('0x19')](_0x377c('0x37'),_0x5514d4,_0x377c('0x39')))},function(){rimraf(path['join'](_0x352983,_0x5514d4),function(){});_0x446c27(_0x377c('0x3a'));});});}})[_0x377c('0x38')](function(){if(!_0x3f4796)return;rimraf(path[_0x377c('0x33')](_0x352983,_0x5514d4),function(){});})[_0x377c('0x38')](function(){logger[_0x377c('0x3b')](util['format'](_0x377c('0x3c'),EXTRACTED_REPORT_ID,_0x377c('0x3d')));return analyticExtractedReport(_0x377c('0x3e'),_0x3f4796?util['format'](_0x377c('0x37'),_0x5514d4,_0x3f4796?'zip':_0x377c('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x377c('0x3b')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0x377c('0xf')][_0x377c('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x377c('0x38')](function(_0x278fc0){EXTRACTED_REPORT=_0x278fc0;return dbH[_0x377c('0x2a')][_0x377c('0x2d')](util[_0x377c('0x19')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x377c('0x2e')][_0x377c('0x2c')]});})[_0x377c('0x38')](extractReport)['catch'](function(_0x5b43e1){logger['info'](util['format'](_0x377c('0x41'),EXTRACTED_REPORT_ID,_0x377c('0x3d')),util[_0x377c('0x42')](_0x5b43e1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x377c('0x43'));})[_0x377c('0x44')](function(){process[_0x377c('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x26a70c=new PdfPrinter({'Arial':{'normal':__dirname+_0x377c('0x46'),'bold':__dirname+_0x377c('0x47'),'italics':__dirname+_0x377c('0x48'),'bolditalics':__dirname+_0x377c('0x49')}});return _0x26a70c;}function getPDFDocDefinitionFromHTML(_0x482a27,_0x37a934){var _0x34bf3d=util['format'](_0x377c('0x4a'),_0x37a934[_0x377c('0x4b')],_0x37a934[_0x377c('0x4c')]);var _0x4c5756=moment()[_0x377c('0x19')]('YYYY-MM-DD')[_0x377c('0x13')]();var _0x17cec4=htmlToPdfmake(_0x482a27,{'window':window,'tableAutoSize':!![]});return{'content':[_0x17cec4],'defaultStyle':{'font':_0x377c('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x377c('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x377c('0x4d'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x377c('0x4d')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x377c('0x4e')}];},'footer':function(_0x40114d,_0x119d99){return[{'text':util[_0x377c('0x19')](_0x377c('0x4f'),_0x34bf3d,_0x40114d,_0x119d99,_0x4c5756),'style':_0x377c('0x21')}];}};}function writePDFDocument(_0x518975,_0x3ea0fe){return new Promise(function(_0x2f6bfc,_0x386f1a){var _0x13172a=_0x518975['pipe'](fs[_0x377c('0x50')](_0x3ea0fe));_0x13172a['on']('finish',function(){_0x2f6bfc(_0x377c('0x51'));});_0x13172a['on'](_0x377c('0x52'),function(_0x29b012){_0x386f1a(_0x29b012);});_0x518975[_0x377c('0x53')]();});}exports[_0x377c('0x54')]=function(_0x2ebe9b,_0x8ed671){var _0x595eb7=getPDFPrinter();var _0x187fc2=getPDFDocDefinitionFromHTML(_0x2ebe9b,_0x8ed671);var _0x4d6300=_0x595eb7[_0x377c('0x55')](_0x187fc2);return writePDFDocument(_0x4d6300,_0x8ed671[_0x377c('0x1')])[_0x377c('0x56')](function(_0xeb76f6){throw _0xeb76f6;});}; \ No newline at end of file +var _0x6567=['range','isInteger','num','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','basename','.pdf','split','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','value','length','auto','body','concat','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','Arial','black','Setting','find','then','splitSizePdf'];(function(_0x508223,_0x3eed30){var _0x279292=function(_0x137f1c){while(--_0x137f1c){_0x508223['push'](_0x508223['shift']());}};_0x279292(++_0x3eed30);}(_0x6567,0x8b));var _0x7656=function(_0x1e89de,_0xf20769){_0x1e89de=_0x1e89de-0x0;var _0x37ab82=_0x6567[_0x1e89de];return _0x37ab82;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0x7656('0x0'));var moment=require(_0x7656('0x1'));var htmlToPdfmake=require(_0x7656('0x2'));var PdfPrinter=require(_0x7656('0x3'));var zipdir=require(_0x7656('0x4'));var rimraf=require(_0x7656('0x5'));var JSDOM=require(_0x7656('0x6'))[_0x7656('0x7')];var window=new JSDOM('')['window'];var BPromise=require(_0x7656('0x8'));var db=require(_0x7656('0x9'))['db'];var dbH=require(_0x7656('0x9'))[_0x7656('0xa')];var logger=require(_0x7656('0xb'))(_0x7656('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0x7656('0xd')][0x2]);var QUERY=process[_0x7656('0xd')][0x3];var PATH=process[_0x7656('0xd')][0x4];var NAME=process[_0x7656('0xd')][0x5];var FORMAT=_0x7656('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x10cddb,_0x51d2cd){var _0x543b1f={'status':_0x10cddb};var _0x10a0eb={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x51d2cd){_0x543b1f[_0x7656('0xf')]=_0x51d2cd;}return db[_0x7656('0x10')][_0x7656('0x11')](_0x543b1f,_0x10a0eb);}function getHeaders(_0x264841){return _[_0x7656('0x12')](_0x264841,function(_0x2c581b){return{'text':_0x2c581b,'style':_0x7656('0x13')};});}function getRows(_0x243de4,_0x283b59){return _[_0x7656('0x12')](_0x283b59,function(_0x26d0f8){return _(_0x26d0f8)[_0x7656('0x14')](_0x243de4)[_0x7656('0x12')](function(_0x53bc56){return _0x53bc56?_['toString'](_0x53bc56):'';})[_0x7656('0x15')]();});}function createTable(_0x13bae0,_0x1164f1){var _0x3a435a={'widths':_['fill'](Array(_0x13bae0[_0x7656('0x16')]),0x91),'heights':function(_0x570a1a){return _0x570a1a===0x0?_0x7656('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4295e4=getHeaders(_0x13bae0);_0x3a435a[_0x7656('0x18')]['push'](_0x4295e4);var _0x3f9fd0=getRows(_0x13bae0,_0x1164f1);_0x3a435a[_0x7656('0x18')]=_0x3a435a[_0x7656('0x18')][_0x7656('0x19')](_0x3f9fd0);return _0x3a435a;}function createTables(_0x5cf181){var _0x331621=[];var _0x12dde1=_[_0x7656('0x1a')](Object[_0x7656('0x1b')](_0x5cf181[0x0]),0x5);_0x12dde1[_0x7656('0x1c')](function(_0x40ba22){_0x331621[_0x7656('0x1d')](createTable(_0x40ba22,_0x5cf181));});return _0x331621;}function getPDFDocDefinition(_0x5eac41){var _0x5c0192=util[_0x7656('0x1e')](_0x7656('0x1f'),NAME,EXTRACTED_REPORT[_0x7656('0x20')],moment(EXTRACTED_REPORT[_0x7656('0x21')])[_0x7656('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0x7656('0x22')])[_0x7656('0x1e')](FORMAT));var _0x1045fe=[];for(var _0x196877=0x0;_0x196877<_0x5eac41[_0x7656('0x16')];_0x196877++){var _0xc87180=[];if(_0x196877===0x0){_0xc87180['push']({'text':_0x5c0192,'style':_0x7656('0x23')});}var _0x23f633={'table':_0x5eac41[_0x196877]};if(_0x196877>0x0){_0x23f633[_0x7656('0x24')]=_0x7656('0x25');_0x23f633[_0x7656('0x26')]=[0x0,0x46,0x0,0x0];}_0xc87180[_0x7656('0x1d')](_0x23f633);_0x1045fe['push'](_0xc87180);}return{'pageSize':'A4','pageOrientation':_0x7656('0x27'),'content':_0x1045fe,'footer':function(_0x280952,_0x247544){return{'text':_0x280952[_0x7656('0x28')]()+_0x7656('0x29')+_0x247544,'style':_0x7656('0x2a')};},'defaultStyle':{'font':_0x7656('0x2b')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x7656('0x2c')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xda848b){var _0x1d42fd=0x1388;var _0x1f3c04;if(!_0xda848b[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0x7656('0x2d')][_0x7656('0x2e')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0x7656('0x2f')](function(_0x23f00a){if(_0x23f00a){_0x1f3c04=_0x23f00a;_0x1d42fd=_0x1f3c04[_0x7656('0x30')]||0x3e8;}})[_0x7656('0x2f')](function(){var _0x5505cb=[];var _0x848ac3=0x0;if(_0x1f3c04['split']){if(_0xda848b&&_0xda848b[_0x7656('0x16')]){var _0x494da3=_[_0x7656('0x31')](_0xda848b[0x0]['num']/_0x1d42fd);var _0x526052=Number[_0x7656('0x32')](_0xda848b[0x0][_0x7656('0x33')]/_0x1d42fd)?_0xda848b[0x0][_0x7656('0x33')]%_0x1d42fd:0x0;_0x494da3[_0x7656('0x1c')](function(_0x4ade68){if(_0x4ade68>0x0){_0x848ac3+=_0x1d42fd;}_0x5505cb[_0x7656('0x1d')](dbH['sequelize'][_0x7656('0x34')](util[_0x7656('0x1e')](_0x7656('0x35'),QUERY,_0x1d42fd,_0x848ac3),{'type':dbH[_0x7656('0x36')][_0x7656('0x37')]['SELECT']}));});if(_0x526052>0x0){_0x848ac3+=_0x1d42fd;_0x5505cb[_0x7656('0x1d')](dbH[_0x7656('0x36')][_0x7656('0x34')](util[_0x7656('0x1e')](_0x7656('0x35'),QUERY,_0x526052,_0x848ac3),{'type':dbH[_0x7656('0x36')][_0x7656('0x37')][_0x7656('0x38')]}));}}}else{_0x5505cb['push'](dbH[_0x7656('0x36')][_0x7656('0x34')](QUERY,{'type':dbH[_0x7656('0x36')][_0x7656('0x37')][_0x7656('0x38')]}));}var _0x5738cb=path[_0x7656('0x39')](PATH);var _0x1a4cae=path[_0x7656('0x3a')](PATH,_0x7656('0x3b'));var _0x5541e2=_0x1f3c04[_0x7656('0x3c')]&&_0x5505cb[_0x7656('0x16')]>0x1;var _0x5e7041=[];if(!fs[_0x7656('0x3d')](path[_0x7656('0x3e')](_0x5738cb,_0x1a4cae))&&_0x5541e2){fs['mkdirSync'](path[_0x7656('0x3e')](_0x5738cb,_0x1a4cae));}return BPromise[_0x7656('0x3f')](_0x5505cb,function(_0x55e07b){_0x5e7041[_0x7656('0x1d')](_0x55e07b);})[_0x7656('0x2f')](function(){var _0x14f46a=[];for(var _0x48484d=0x0;_0x48484d<_0x5e7041['length'];_0x48484d+=0x1){var _0x2f882e=_0x5e7041[_0x48484d];var _0x44a2cc=createTables(_[_0x7656('0x40')](_0x2f882e));var _0x1a9d24;var _0x5aba48=getPDFDocDefinition(_0x44a2cc);var _0x527258=getPDFPrinter();var _0x4cacc0=_0x527258[_0x7656('0x41')](_0x5aba48);if(_0x5541e2){_0x1a9d24=path[_0x7656('0x3e')](_0x5738cb,_0x1a4cae,util[_0x7656('0x1e')](_0x7656('0x42'),_0x1a4cae,_0x48484d,_0x7656('0x43')));}else{_0x1a9d24=path['join'](_0x5738cb,util[_0x7656('0x1e')](_0x7656('0x44'),_0x1a4cae,_0x7656('0x43')));}_0x14f46a[_0x7656('0x1d')](writePDFDocument(_0x4cacc0,_0x1a9d24));}return Promise[_0x7656('0x45')](_0x14f46a);})[_0x7656('0x2f')](function(){if(_0x5541e2){return new Promise(function(_0x452fc6){zipdir(path[_0x7656('0x3e')](_0x5738cb,_0x1a4cae),{'saveTo':path['join'](_0x5738cb,util['format'](_0x7656('0x44'),_0x1a4cae,_0x7656('0x46')))},function(){rimraf(path[_0x7656('0x3e')](_0x5738cb,_0x1a4cae),function(){});_0x452fc6(_0x7656('0x47'));});});}})[_0x7656('0x2f')](function(){if(!_0x5541e2)return;rimraf(path[_0x7656('0x3e')](_0x5738cb,_0x1a4cae),function(){});})[_0x7656('0x2f')](function(){logger[_0x7656('0x48')](util[_0x7656('0x1e')](_0x7656('0x49'),EXTRACTED_REPORT_ID,_0x7656('0x4a')));return analyticExtractedReport('Completed',_0x5541e2?util[_0x7656('0x1e')](_0x7656('0x44'),_0x1a4cae,_0x5541e2?'zip':_0x7656('0x43')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x7656('0x48')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0x7656('0x10')][_0x7656('0x4b')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x7656('0x2f')](function(_0x2575b0){EXTRACTED_REPORT=_0x2575b0;return dbH[_0x7656('0x36')][_0x7656('0x34')](util[_0x7656('0x1e')](_0x7656('0x4c'),QUERY),{'type':dbH[_0x7656('0x36')][_0x7656('0x37')][_0x7656('0x38')]});})[_0x7656('0x2f')](extractReport)[_0x7656('0x4d')](function(_0x38549f){logger[_0x7656('0x48')](util[_0x7656('0x1e')](_0x7656('0x4e'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x38549f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7656('0x4f'));})['finally'](function(){process[_0x7656('0x50')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5097fa=new PdfPrinter({'Arial':{'normal':__dirname+_0x7656('0x51'),'bold':__dirname+_0x7656('0x52'),'italics':__dirname+_0x7656('0x53'),'bolditalics':__dirname+_0x7656('0x54')}});return _0x5097fa;}function getPDFDocDefinitionFromHTML(_0x24fe6b,_0x20570c){var _0x2b2e51=util['format'](_0x7656('0x55'),_0x20570c[_0x7656('0x56')],_0x20570c[_0x7656('0x57')]);var _0x2139a5=moment()[_0x7656('0x1e')](_0x7656('0x58'))[_0x7656('0x28')]();var _0x1e5732=htmlToPdfmake(_0x24fe6b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1e5732],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x7656('0x59'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x7656('0x59'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x7656('0x59')}},'header':function(){return[{'text':_0x7656('0x5a'),'style':_0x7656('0x23')}];},'footer':function(_0x30d6c6,_0x51c04c){return[{'text':util[_0x7656('0x1e')](_0x7656('0x5b'),_0x2b2e51,_0x30d6c6,_0x51c04c,_0x2139a5),'style':'footer'}];}};}function writePDFDocument(_0x494c3a,_0x5bf43f){return new Promise(function(_0x2ec1b9,_0x203f49){var _0x45dc44=_0x494c3a['pipe'](fs[_0x7656('0x5c')](_0x5bf43f));_0x45dc44['on']('finish',function(){_0x2ec1b9(_0x7656('0x5d'));});_0x45dc44['on']('error',function(_0x21a4d2){_0x203f49(_0x21a4d2);});_0x494c3a['end']();});}exports['createPdfFromHTML']=function(_0x492d79,_0x579ea1){var _0x4d41ce=getPDFPrinter();var _0x302a9c=getPDFDocDefinitionFromHTML(_0x492d79,_0x579ea1);var _0x344d32=_0x4d41ce[_0x7656('0x41')](_0x302a9c);return writePDFDocument(_0x344d32,_0x579ea1[_0x7656('0x0')])[_0x7656('0x4d')](function(_0x49287c){throw _0x49287c;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 79d69d8..8393017 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 _0x41f5=['writeFileSync','binary','zip','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','exit','path','lodash','bluebird','rimraf','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','existsSync','join','mkdirSync','%s%d.%s','xlsx','%s.%s'];(function(_0x6b085f,_0x26959c){var _0x40a408=function(_0x17a0d9){while(--_0x17a0d9){_0x6b085f['push'](_0x6b085f['shift']());}};_0x40a408(++_0x26959c);}(_0x41f5,0x96));var _0x541f=function(_0x408a63,_0x4cc182){_0x408a63=_0x408a63-0x0;var _0x27c11a=_0x41f5[_0x408a63];return _0x27c11a;};'use strict';var util=require('util');var path=require(_0x541f('0x0'));var _=require(_0x541f('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x541f('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x541f('0x3'));var db=require(_0x541f('0x4'))['db'];var dbH=require('../../mysqldb')[_0x541f('0x5')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x541f('0x6')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x541f('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x475e29,_0x261880){var _0x2867aa={'status':_0x475e29};var _0x58a6b1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x261880){_0x2867aa[_0x541f('0x7')]=_0x261880;}return db[_0x541f('0x8')][_0x541f('0x9')](_0x2867aa,_0x58a6b1);}function main(){var _0x44ce37=0x1388;var _0x1de133;logger['info'](util[_0x541f('0xa')](_0x541f('0xb'),EXTRACTED_REPORT_ID,_0x541f('0xc')));return db[_0x541f('0xd')][_0x541f('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x541f('0xf'),_0x541f('0x10')]})[_0x541f('0x11')](function(_0x2839d5){if(_0x2839d5){_0x1de133=_0x2839d5;_0x44ce37=_0x1de133[_0x541f('0x10')]||0x1388;}})[_0x541f('0x11')](function(){return dbH[_0x541f('0x12')]['query'](util['format'](_0x541f('0x13'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x541f('0x14')]});})[_0x541f('0x11')](function(_0x3d3645){if(!_0x3d3645[0x0][_0x541f('0x15')]){return analyticExtractedReport(_0x541f('0x16'));}var _0x21bc8b=[];var _0x551a86=0x0;if(_0x1de133[_0x541f('0xf')]){if(_0x3d3645&&_0x3d3645[_0x541f('0x17')]){var _0xcfb88d=_[_0x541f('0x18')](_0x3d3645[0x0]['num']/_0x44ce37);var _0x17877d=Number['isInteger'](_0x3d3645[0x0][_0x541f('0x15')]/_0x44ce37)?_0x3d3645[0x0][_0x541f('0x15')]%_0x44ce37:0x0;_0xcfb88d[_0x541f('0x19')](function(_0x55e25f){if(_0x55e25f>0x0){_0x551a86+=_0x44ce37;}_0x21bc8b[_0x541f('0x1a')](dbH[_0x541f('0x12')][_0x541f('0x1b')](util[_0x541f('0xa')](_0x541f('0x1c'),QUERY,_0x44ce37,_0x551a86),{'type':dbH['sequelize'][_0x541f('0x1d')][_0x541f('0x14')]}));});if(_0x17877d>0x0){_0x551a86+=_0x44ce37;_0x21bc8b[_0x541f('0x1a')](dbH[_0x541f('0x12')][_0x541f('0x1b')](util['format'](_0x541f('0x1c'),QUERY,_0x17877d,_0x551a86),{'type':dbH['sequelize'][_0x541f('0x1d')][_0x541f('0x14')]}));}}}else{_0x21bc8b[_0x541f('0x1a')](dbH[_0x541f('0x12')][_0x541f('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x541f('0x14')]}));}var _0x5111bc=path[_0x541f('0x1e')](PATH);var _0x263ce2=path[_0x541f('0x1f')](PATH,'.xlsx');var _0x5e4253=_0x1de133[_0x541f('0xf')]&&_0x21bc8b[_0x541f('0x17')]>0x1;var _0x48eed5=[];if(!fs[_0x541f('0x20')](path[_0x541f('0x21')](_0x5111bc,_0x263ce2))&&_0x5e4253){fs[_0x541f('0x22')](path[_0x541f('0x21')](_0x5111bc,_0x263ce2));}return BPromise['each'](_0x21bc8b,function(_0x2ec321){_0x48eed5[_0x541f('0x1a')](_0x2ec321);})[_0x541f('0x11')](function(){for(var _0x12ae8a=0x0;_0x12ae8a<_0x48eed5['length'];_0x12ae8a+=0x1){var _0x4d608f;var _0x1b45f4=_0x48eed5[_0x12ae8a];if(_0x5e4253){_0x4d608f=path[_0x541f('0x21')](_0x5111bc,_0x263ce2,util[_0x541f('0xa')](_0x541f('0x23'),_0x263ce2,_0x12ae8a,_0x541f('0x24')));}else{_0x4d608f=path[_0x541f('0x21')](_0x5111bc,util[_0x541f('0xa')](_0x541f('0x25'),_0x263ce2,_0x541f('0x24')));}fs[_0x541f('0x26')](_0x4d608f,json2xls(_0x1b45f4),_0x541f('0x27'));}})[_0x541f('0x11')](function(){if(_0x5e4253){return new Promise(function(_0x250252){zipdir(path[_0x541f('0x21')](_0x5111bc,_0x263ce2),{'saveTo':path[_0x541f('0x21')](_0x5111bc,util[_0x541f('0xa')](_0x541f('0x25'),_0x263ce2,_0x541f('0x28')))},function(_0x222b25,_0x255812){rimraf(path['join'](_0x5111bc,_0x263ce2),function(){});_0x250252('zip\x20finished');});});}})[_0x541f('0x11')](function(){logger[_0x541f('0x29')](util[_0x541f('0xa')](_0x541f('0x2a'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x5e4253?util[_0x541f('0xa')](_0x541f('0x25'),_0x263ce2,_0x5e4253?_0x541f('0x28'):_0x541f('0x24')):null);});})['catch'](function(_0x47d966){logger[_0x541f('0x29')](util[_0x541f('0xa')](_0x541f('0x2b'),EXTRACTED_REPORT_ID,_0x541f('0xc')),util[_0x541f('0x2c')](_0x47d966,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x541f('0x2d'));})['finally'](function(){process[_0x541f('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x1198=['split','then','splitSizeXlsx','sequelize','query','SELECT','num','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','join','mkdirSync','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','lodash','json2xls','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1198,0x1b4));var _0x8119=function(_0xfa3874,_0x119104){_0xfa3874=_0xfa3874-0x0;var _0x27d880=_0x1198[_0xfa3874];return _0x27d880;};'use strict';var util=require(_0x8119('0x0'));var path=require('path');var _=require(_0x8119('0x1'));var fs=require('fs');var json2xls=require(_0x8119('0x2'));var BPromise=require('bluebird');var zipdir=require(_0x8119('0x3'));var rimraf=require(_0x8119('0x4'));var db=require(_0x8119('0x5'))['db'];var dbH=require(_0x8119('0x5'))['dbH'];var logger=require(_0x8119('0x6'))(_0x8119('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x8119('0x8')][0x2]);var QUERY=process[_0x8119('0x8')][0x3];var PATH=process[_0x8119('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x329ea2,_0x3079a4){var _0x3b8581={'status':_0x329ea2};var _0x287475={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3079a4){_0x3b8581['savename']=_0x3079a4;}return db['AnalyticExtractedReport'][_0x8119('0x9')](_0x3b8581,_0x287475);}function main(){var _0x2a2bbd=0x1388;var _0x56c9d8;logger['info'](util[_0x8119('0xa')](_0x8119('0xb'),EXTRACTED_REPORT_ID,_0x8119('0xc')));return db['Setting'][_0x8119('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8119('0xe'),'splitSizeXlsx']})[_0x8119('0xf')](function(_0x4d2101){if(_0x4d2101){_0x56c9d8=_0x4d2101;_0x2a2bbd=_0x56c9d8[_0x8119('0x10')]||0x1388;}})[_0x8119('0xf')](function(){return dbH[_0x8119('0x11')][_0x8119('0x12')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x8119('0x13')]});})[_0x8119('0xf')](function(_0x625a1c){if(!_0x625a1c[0x0][_0x8119('0x14')]){return analyticExtractedReport('Empty');}var _0x2243e2=[];var _0x5174bf=0x0;if(_0x56c9d8[_0x8119('0xe')]){if(_0x625a1c&&_0x625a1c[_0x8119('0x15')]){var _0x248aa3=_['range'](_0x625a1c[0x0][_0x8119('0x14')]/_0x2a2bbd);var _0x8d78f0=Number[_0x8119('0x16')](_0x625a1c[0x0]['num']/_0x2a2bbd)?_0x625a1c[0x0]['num']%_0x2a2bbd:0x0;_0x248aa3[_0x8119('0x17')](function(_0x4306d8){if(_0x4306d8>0x0){_0x5174bf+=_0x2a2bbd;}_0x2243e2[_0x8119('0x18')](dbH[_0x8119('0x11')][_0x8119('0x12')](util[_0x8119('0xa')](_0x8119('0x19'),QUERY,_0x2a2bbd,_0x5174bf),{'type':dbH[_0x8119('0x11')]['QueryTypes'][_0x8119('0x13')]}));});if(_0x8d78f0>0x0){_0x5174bf+=_0x2a2bbd;_0x2243e2[_0x8119('0x18')](dbH['sequelize'][_0x8119('0x12')](util[_0x8119('0xa')](_0x8119('0x19'),QUERY,_0x8d78f0,_0x5174bf),{'type':dbH['sequelize'][_0x8119('0x1a')][_0x8119('0x13')]}));}}}else{_0x2243e2[_0x8119('0x18')](dbH['sequelize'][_0x8119('0x12')](QUERY,{'type':dbH[_0x8119('0x11')]['QueryTypes'][_0x8119('0x13')]}));}var _0x1bc8a7=path[_0x8119('0x1b')](PATH);var _0x43898c=path[_0x8119('0x1c')](PATH,_0x8119('0x1d'));var _0x171cc7=_0x56c9d8[_0x8119('0xe')]&&_0x2243e2[_0x8119('0x15')]>0x1;var _0x1b14ae=[];if(!fs[_0x8119('0x1e')](path[_0x8119('0x1f')](_0x1bc8a7,_0x43898c))&&_0x171cc7){fs[_0x8119('0x20')](path[_0x8119('0x1f')](_0x1bc8a7,_0x43898c));}return BPromise['each'](_0x2243e2,function(_0x38e576){_0x1b14ae['push'](_0x38e576);})['then'](function(){for(var _0x5186b4=0x0;_0x5186b4<_0x1b14ae['length'];_0x5186b4+=0x1){var _0x4c9532;var _0x789a77=_0x1b14ae[_0x5186b4];if(_0x171cc7){_0x4c9532=path['join'](_0x1bc8a7,_0x43898c,util['format'](_0x8119('0x21'),_0x43898c,_0x5186b4,'xlsx'));}else{_0x4c9532=path[_0x8119('0x1f')](_0x1bc8a7,util[_0x8119('0xa')](_0x8119('0x22'),_0x43898c,_0x8119('0x23')));}fs[_0x8119('0x24')](_0x4c9532,json2xls(_0x789a77),_0x8119('0x25'));}})[_0x8119('0xf')](function(){if(_0x171cc7){return new Promise(function(_0x1c8b2b){zipdir(path[_0x8119('0x1f')](_0x1bc8a7,_0x43898c),{'saveTo':path[_0x8119('0x1f')](_0x1bc8a7,util['format'](_0x8119('0x22'),_0x43898c,_0x8119('0x26')))},function(_0x59f80d,_0x2ce45e){rimraf(path['join'](_0x1bc8a7,_0x43898c),function(){});_0x1c8b2b('zip\x20finished');});});}})['then'](function(){logger[_0x8119('0x27')](util[_0x8119('0xa')](_0x8119('0x28'),EXTRACTED_REPORT_ID,_0x8119('0xc')));return analyticExtractedReport('Completed',_0x171cc7?util[_0x8119('0xa')]('%s.%s',_0x43898c,_0x171cc7?_0x8119('0x26'):_0x8119('0x23')):null);});})[_0x8119('0x29')](function(_0x4b6e42){logger['info'](util['format'](_0x8119('0x2a'),EXTRACTED_REPORT_ID,_0x8119('0xc')),util['inspect'](_0x4b6e42,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8119('0x2b'));})[_0x8119('0x2c')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index aa07e2c..47d3adb 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 _0x5b38=['outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','length','createdAt','updatedAt','interval','intervals','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','destroy','bulkCreate','sortBy','catch','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','queue','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','context','inbound','CDR(routeid)=','VoiceExtensionId'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x5b38,0x106));var _0x85b3=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x5b38[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x85b3('0x0'));var util=require(_0x85b3('0x1'));function rewrite(_0x136fec,_0x56d224){var _0x355f4b=this;return _0x136fec[_0x85b3('0x2')][_0x85b3('0x3')][_0x85b3('0x4')]({'raw':!![]})[_0x85b3('0x5')](function(_0x4fc687){_0x355f4b['intervals']=_0x4fc687;return _0x136fec[_0x85b3('0x2')][_0x85b3('0x6')][_0x85b3('0x4')]({'where':{'IntervalId':_0x56d224[_0x85b3('0x7')]},'raw':!![]});})[_0x85b3('0x5')](function(_0x3f923d){return _0x136fec['models']['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0x85b3('0x8')](_[_0x85b3('0x9')](_0x3f923d,_0x85b3('0xa')))}},'order':[{'raw':_0x85b3('0xb')}],'raw':!![]});})[_0x85b3('0x5')](function(_0x1e03cb){var _0x48aeee=_['filter'](_0x1e03cb,{'priority':'1'});var _0x1f9143=_['filter'](_0x1e03cb,{'isApp':0x1});var _0x57d7d3=_['groupBy'](_0x1f9143,'exten');var _0x123d78=[_0x85b3('0xc'),'playback'];var _0x529f00=[];var _0x20d9a5=[];for(var _0x38c244 in _0x57d7d3){if(_0x57d7d3[_0x85b3('0xd')](_0x38c244)){_0x355f4b[_0x85b3('0xe')]=0x2;_0x355f4b[_0x85b3('0xf')]=[];_0x355f4b[_0x85b3('0x10')]=_[_0x85b3('0x11')](_0x48aeee,{'exten':_0x57d7d3[_0x38c244][0x0][_0x85b3('0xa')]});_0x355f4b[_0x85b3('0xf')][_0x85b3('0x12')]({'type':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x13')],'app':_0x85b3('0x14'),'appdata':util[_0x85b3('0x15')]('CDR(type)=%s',_0x57d7d3[_0x38c244][0x0][_0x85b3('0x13')]),'context':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x16')],'exten':_0x57d7d3[_0x38c244][0x0]['exten'],'priority':_0x355f4b['priority']++,'VoiceExtensionId':_0x57d7d3[_0x38c244][0x0]['VoiceExtensionId']});if(_0x57d7d3[_0x38c244][0x0]['type']===_0x85b3('0x17')){_0x355f4b[_0x85b3('0xf')]['push']({'type':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x13')],'app':'Set','appdata':_0x85b3('0x18')+_0x57d7d3[_0x38c244][0x0][_0x85b3('0x19')],'context':_0x57d7d3[_0x38c244][0x0]['context'],'exten':_0x57d7d3[_0x38c244][0x0][_0x85b3('0xa')],'priority':_0x355f4b['priority']++,'VoiceExtensionId':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x19')]});}else if(_0x57d7d3[_0x38c244][0x0][_0x85b3('0x13')]===_0x85b3('0x1a')){if(_0x355f4b['extension']){_0x355f4b[_0x85b3('0xf')][_0x85b3('0x12')]({'type':_0x57d7d3[_0x38c244][0x0]['type'],'app':'Set','appdata':_0x85b3('0x1b')+(_0x355f4b[_0x85b3('0x10')][_0x85b3('0x1c')]?'${EXTEN:'+_0x355f4b[_0x85b3('0x10')][_0x85b3('0x1c')]+'}':_0x85b3('0x1d')),'context':_0x57d7d3[_0x38c244][0x0]['context'],'exten':_0x57d7d3[_0x38c244][0x0]['exten'],'priority':_0x355f4b['priority']++,'VoiceExtensionId':_0x57d7d3[_0x38c244][0x0]['VoiceExtensionId']});}_0x355f4b[_0x85b3('0xf')][_0x85b3('0x12')]({'type':_0x57d7d3[_0x38c244][0x0]['type'],'app':_0x85b3('0x14'),'appdata':_0x85b3('0x18')+_0x57d7d3[_0x38c244][0x0][_0x85b3('0x19')],'context':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x16')],'exten':_0x57d7d3[_0x38c244][0x0]['exten'],'priority':_0x355f4b[_0x85b3('0xe')]++,'VoiceExtensionId':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x19')]});var _0x5c4953=_0x355f4b[_0x85b3('0xe')]++;_0x355f4b['extensions'][_0x85b3('0x12')]({'type':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x13')],'app':_0x85b3('0x1e'),'appdata':_0x85b3('0x1f')+(_0x5c4953+0x2)+_0x85b3('0x20')+(_0x5c4953+0x1)+')','context':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x16')],'exten':_0x57d7d3[_0x38c244][0x0][_0x85b3('0xa')],'priority':_0x5c4953,'VoiceExtensionId':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x19')]});if(_0x355f4b[_0x85b3('0x10')]){_0x355f4b[_0x85b3('0xf')][_0x85b3('0x12')]({'type':_0x57d7d3[_0x38c244][0x0]['type'],'app':_0x85b3('0x14'),'appdata':_0x355f4b[_0x85b3('0x10')][_0x85b3('0x1c')]?_0x85b3('0x21')+_0x355f4b[_0x85b3('0x10')][_0x85b3('0x1c')]+'}':_0x85b3('0x22'),'context':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x16')],'exten':_0x57d7d3[_0x38c244][0x0][_0x85b3('0xa')],'priority':_0x355f4b[_0x85b3('0xe')]++,'VoiceExtensionId':_0x57d7d3[_0x38c244][0x0]['VoiceExtensionId']});}_0x355f4b[_0x85b3('0xf')][_0x85b3('0x12')]({'type':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x13')],'app':_0x85b3('0x14'),'appdata':_0x85b3('0x23')+_0x57d7d3[_0x38c244][0x0][_0x85b3('0x19')],'context':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x16')],'exten':_0x57d7d3[_0x38c244][0x0][_0x85b3('0xa')],'priority':_0x355f4b[_0x85b3('0xe')]++,'VoiceExtensionId':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x19')]});if(_0x355f4b[_0x85b3('0x10')]&&_0x355f4b[_0x85b3('0x10')][_0x85b3('0xd')](_0x85b3('0x24'))&&_0x355f4b[_0x85b3('0x10')]['recordingFormat']!=='none'){_0x355f4b[_0x85b3('0xf')][_0x85b3('0x12')]({'type':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x13')],'app':_0x85b3('0x14'),'appdata':_0x85b3('0x25'),'context':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x16')],'exten':_0x57d7d3[_0x38c244][0x0][_0x85b3('0xa')],'priority':_0x355f4b[_0x85b3('0xe')]++,'VoiceExtensionId':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x19')]});_0x355f4b[_0x85b3('0xf')][_0x85b3('0x12')]({'type':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x13')],'app':_0x85b3('0x14'),'appdata':_0x85b3('0x26')+_0x355f4b[_0x85b3('0x10')][_0x85b3('0x24')]||_0x85b3('0x27'),'context':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x16')],'exten':_0x57d7d3[_0x38c244][0x0][_0x85b3('0xa')],'priority':_0x355f4b['priority']++,'VoiceExtensionId':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x19')]});}}_0x355f4b['extensions'][_0x85b3('0x12')]({'type':_0x57d7d3[_0x38c244][0x0]['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x16')],'exten':_0x57d7d3[_0x38c244][0x0][_0x85b3('0xa')],'priority':_0x355f4b[_0x85b3('0xe')]++,'VoiceExtensionId':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x19')]});_0x355f4b[_0x85b3('0xf')]['push']({'type':_0x57d7d3[_0x38c244][0x0]['type'],'app':_0x85b3('0x14'),'appdata':_0x85b3('0x28'),'context':_0x57d7d3[_0x38c244][0x0]['context'],'exten':_0x57d7d3[_0x38c244][0x0][_0x85b3('0xa')],'priority':_0x355f4b[_0x85b3('0xe')]++,'VoiceExtensionId':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x19')]});_0x355f4b['extensions'][_0x85b3('0x12')]({'type':_0x57d7d3[_0x38c244][0x0]['type'],'app':_0x85b3('0x14'),'appdata':'MONITOR_OPTIONS=ab','context':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x16')],'exten':_0x57d7d3[_0x38c244][0x0][_0x85b3('0xa')],'priority':_0x355f4b[_0x85b3('0xe')]++,'VoiceExtensionId':_0x57d7d3[_0x38c244][0x0]['VoiceExtensionId']});for(var _0x2f5978=0x0,_0x79b693=0x0;_0x2f5978<_0x57d7d3[_0x38c244][_0x85b3('0x29')];_0x2f5978+=0x1,_0x79b693=0x0){var _0x3502e7=_0x57d7d3[_0x38c244][_0x2f5978];if(_0x3502e7[_0x85b3('0x13')]){_0x3502e7[_0x85b3('0x13')]=_0x3502e7[_0x85b3('0x13')]['toLowerCase']();}var _0x4bad5f=[];var _0x52c895=[];delete _0x3502e7['id'];delete _0x3502e7[_0x85b3('0x2a')];delete _0x3502e7[_0x85b3('0x2b')];var _0x390d2f=_0x3502e7[_0x85b3('0x2c')]!=='*,*,*,*'?[_0x3502e7[_0x85b3('0x2c')]]:_0x3502e7[_0x85b3('0x7')]?_[_0x85b3('0x9')](_['filter'](_0x355f4b[_0x85b3('0x2d')],{'IntervalId':_0x3502e7[_0x85b3('0x7')]}),'interval'):[];if(_0x3502e7['hasOwnProperty'](_0x85b3('0x2e'))){if(_0x3502e7[_0x85b3('0x2e')]&&_0x3502e7['tag']!=='--'){_0x4bad5f['push']({'type':_0x3502e7[_0x85b3('0x13')],'app':_0x85b3('0x14'),'appdata':_0x85b3('0x2f')+_0x3502e7['tag'],'context':_0x3502e7['context'],'exten':_0x3502e7[_0x85b3('0xa')],'priority':_0x390d2f['length']+_0x355f4b[_0x85b3('0xe')]+_0x79b693++,'VoiceExtensionId':_0x3502e7[_0x85b3('0x19')]});}}if(_0x3502e7[_0x85b3('0x13')]===_0x85b3('0x1a')&&_0x3502e7['hasOwnProperty']('callerID')){if(_0x3502e7['callerID']){_0x4bad5f['push']({'type':_0x3502e7[_0x85b3('0x13')],'app':_0x85b3('0x1e'),'appdata':_0x85b3('0x30')+_0x3502e7[_0x85b3('0x31')]+')','context':_0x3502e7[_0x85b3('0x16')],'exten':_0x3502e7[_0x85b3('0xa')],'priority':_0x390d2f[_0x85b3('0x29')]+_0x355f4b[_0x85b3('0xe')]+_0x79b693++,'VoiceExtensionId':_0x3502e7['VoiceExtensionId']});}else{_0x4bad5f[_0x85b3('0x12')]({'type':_0x3502e7[_0x85b3('0x13')],'app':'ExecIf','appdata':_0x85b3('0x32'),'context':_0x3502e7[_0x85b3('0x16')],'exten':_0x3502e7[_0x85b3('0xa')],'priority':_0x390d2f[_0x85b3('0x29')]+_0x355f4b[_0x85b3('0xe')]+_0x79b693++,'VoiceExtensionId':_0x3502e7['VoiceExtensionId']});}}if(_0x3502e7['hasOwnProperty'](_0x85b3('0x33'))){if(_0x123d78[_0x85b3('0x34')](_0x3502e7[_0x85b3('0x35')][_0x85b3('0x36')]())>=0x0&&_0x3502e7[_0x85b3('0x37')]!==_0x85b3('0x38')){if(_0x3502e7[_0x85b3('0x33')]){_0x4bad5f[_0x85b3('0x12')]({'type':_0x3502e7[_0x85b3('0x13')],'app':_0x85b3('0x1e'),'appdata':_0x85b3('0x39'),'context':_0x3502e7[_0x85b3('0x16')],'exten':_0x3502e7[_0x85b3('0xa')],'priority':_0x390d2f[_0x85b3('0x29')]+_0x355f4b[_0x85b3('0xe')]+_0x79b693++,'VoiceExtensionId':_0x3502e7[_0x85b3('0x19')]});_0x4bad5f[_0x85b3('0x12')]({'type':_0x3502e7[_0x85b3('0x13')],'app':_0x85b3('0x14'),'appdata':_0x85b3('0x3a'),'context':_0x3502e7['context'],'exten':_0x3502e7[_0x85b3('0xa')],'priority':_0x390d2f[_0x85b3('0x29')]+_0x355f4b['priority']+_0x79b693++,'VoiceExtensionId':_0x3502e7[_0x85b3('0x19')]});}else{_0x4bad5f[_0x85b3('0x12')]({'type':_0x3502e7[_0x85b3('0x13')],'app':_0x85b3('0x1e'),'appdata':_0x85b3('0x3b'),'context':_0x3502e7[_0x85b3('0x16')],'exten':_0x3502e7[_0x85b3('0xa')],'priority':_0x390d2f[_0x85b3('0x29')]+_0x355f4b[_0x85b3('0xe')]+_0x79b693++,'VoiceExtensionId':_0x3502e7[_0x85b3('0x19')]});_0x4bad5f[_0x85b3('0x12')]({'type':_0x3502e7['type'],'app':_0x85b3('0x14'),'appdata':_0x85b3('0x3c'),'context':_0x3502e7[_0x85b3('0x16')],'exten':_0x3502e7[_0x85b3('0xa')],'priority':_0x390d2f[_0x85b3('0x29')]+_0x355f4b[_0x85b3('0xe')]+_0x79b693++,'VoiceExtensionId':_0x3502e7[_0x85b3('0x19')]});}}}for(var _0x4ad8a0=0x0;_0x4ad8a0<_0x390d2f[_0x85b3('0x29')];_0x4ad8a0+=0x1){var _0x58b655=_0x355f4b[_0x85b3('0xe')]+_0x390d2f['length'];var _0x2f5fd9=_0x4ad8a0===_0x390d2f[_0x85b3('0x29')]-0x1?_0x355f4b[_0x85b3('0xe')]+_0x4bad5f[_0x85b3('0x29')]+_0x52c895[_0x85b3('0x29')]+0x2:_0x355f4b[_0x85b3('0xe')]+_0x4ad8a0+0x1;_0x4bad5f['splice'](_0x4ad8a0,0x0,{'type':_0x3502e7['type'],'app':_0x85b3('0x3d'),'appdata':_0x390d2f[_0x4ad8a0]+'?'+_0x3502e7['context']+_0x85b3('0x3e')+_0x58b655+':'+_0x3502e7['context']+',${EXTEN},'+_0x2f5fd9,'exten':_0x3502e7[_0x85b3('0xa')],'context':_0x3502e7[_0x85b3('0x16')],'priority':_0x355f4b['priority']+_0x4ad8a0,'VoiceExtensionId':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x19')]});}_0x3502e7[_0x85b3('0xe')]=_0x4bad5f[_0x85b3('0x29')]?_['last'](_0x4bad5f)[_0x85b3('0xe')]+0x1:_0x355f4b[_0x85b3('0xe')];_0x355f4b[_0x85b3('0xe')]=(_0x52c895[_0x85b3('0x29')]?_[_0x85b3('0x3f')](_0x52c895)[_0x85b3('0xe')]:_0x3502e7[_0x85b3('0xe')])+0x1;_0x355f4b[_0x85b3('0xf')]=_['concat'](_0x355f4b[_0x85b3('0xf')],_0x4bad5f,[_0x3502e7],_0x52c895);}_0x355f4b['extensions']['push']({'type':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x13')],'app':_0x85b3('0x40'),'exten':_0x57d7d3[_0x38c244][0x0][_0x85b3('0xa')],'context':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x16')],'priority':_0x355f4b[_0x85b3('0xe')],'VoiceExtensionId':_0x57d7d3[_0x38c244][0x0][_0x85b3('0x19')]});_0x529f00[_0x85b3('0x12')](_0x57d7d3[_0x38c244][0x0]['VoiceExtensionId']);_0x20d9a5=_[_0x85b3('0x41')](_0x20d9a5,_0x355f4b['extensions']);}}return _0x136fec[_0x85b3('0x42')](function(_0x3919fd){return _0x136fec[_0x85b3('0x2')][_0x85b3('0x6')][_0x85b3('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x529f00}},'transaction':_0x3919fd})[_0x85b3('0x5')](function(_0x41b1b4){return _0x136fec['models']['VoiceExtension'][_0x85b3('0x44')](_[_0x85b3('0x45')](_0x20d9a5,_0x85b3('0xe')),{'transaction':_0x3919fd});});});})[_0x85b3('0x46')](function(_0x563510){console['error'](_0x563510);});}exports[_0x85b3('0x47')]=rewrite; \ No newline at end of file +var _0xd0e8=['CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','${EXTEN:','cutdigits','${EXTEN}','priority','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','models','Interval','VoiceExtension','findAll','IntervalId','then','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','extension','find','extensions','push','type','Set','format'];(function(_0x548249,_0x5e9aff){var _0x576cf0=function(_0x38b3e0){while(--_0x38b3e0){_0x548249['push'](_0x548249['shift']());}};_0x576cf0(++_0x5e9aff);}(_0xd0e8,0x110));var _0x8d0e=function(_0x1652cc,_0x2b2071){_0x1652cc=_0x1652cc-0x0;var _0x633b0c=_0xd0e8[_0x1652cc];return _0x633b0c;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x478d22,_0x3e5a7d){var _0x349834=this;return _0x478d22[_0x8d0e('0x0')][_0x8d0e('0x1')]['findAll']({'raw':!![]})['then'](function(_0x4fc355){_0x349834['intervals']=_0x4fc355;return _0x478d22[_0x8d0e('0x0')][_0x8d0e('0x2')][_0x8d0e('0x3')]({'where':{'IntervalId':_0x3e5a7d[_0x8d0e('0x4')]},'raw':!![]});})[_0x8d0e('0x5')](function(_0x37649c){return _0x478d22[_0x8d0e('0x0')][_0x8d0e('0x2')][_0x8d0e('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0x8d0e('0x6')](_0x37649c,_0x8d0e('0x7')))}},'order':[{'raw':_0x8d0e('0x8')}],'raw':!![]});})[_0x8d0e('0x5')](function(_0x9e6a41){var _0x87a79=_[_0x8d0e('0x9')](_0x9e6a41,{'priority':'1'});var _0x29638a=_[_0x8d0e('0x9')](_0x9e6a41,{'isApp':0x1});var _0x44ef55=_[_0x8d0e('0xa')](_0x29638a,_0x8d0e('0x7'));var _0x4d9b47=[_0x8d0e('0xb'),_0x8d0e('0xc')];var _0x2cbb35=[];var _0x483fd8=[];for(var _0x4847aa in _0x44ef55){if(_0x44ef55['hasOwnProperty'](_0x4847aa)){_0x349834['priority']=0x2;_0x349834['extensions']=[];_0x349834[_0x8d0e('0xd')]=_[_0x8d0e('0xe')](_0x87a79,{'exten':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x7')]});_0x349834[_0x8d0e('0xf')][_0x8d0e('0x10')]({'type':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x11')],'app':_0x8d0e('0x12'),'appdata':util[_0x8d0e('0x13')](_0x8d0e('0x14'),_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x11')]),'context':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x15')],'exten':_0x44ef55[_0x4847aa][0x0]['exten'],'priority':_0x349834['priority']++,'VoiceExtensionId':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x16')]});if(_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x11')]===_0x8d0e('0x17')){_0x349834[_0x8d0e('0xf')]['push']({'type':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x11')],'app':_0x8d0e('0x12'),'appdata':_0x8d0e('0x18')+_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x16')],'context':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x15')],'exten':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x7')],'priority':_0x349834['priority']++,'VoiceExtensionId':_0x44ef55[_0x4847aa][0x0]['VoiceExtensionId']});}else if(_0x44ef55[_0x4847aa][0x0]['type']===_0x8d0e('0x19')){if(_0x349834[_0x8d0e('0xd')]){_0x349834['extensions']['push']({'type':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x11')],'app':_0x8d0e('0x12'),'appdata':'CDR(destination)='+(_0x349834[_0x8d0e('0xd')]['cutdigits']?_0x8d0e('0x1a')+_0x349834['extension'][_0x8d0e('0x1b')]+'}':_0x8d0e('0x1c')),'context':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x15')],'exten':_0x44ef55[_0x4847aa][0x0]['exten'],'priority':_0x349834[_0x8d0e('0x1d')]++,'VoiceExtensionId':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x16')]});}_0x349834[_0x8d0e('0xf')]['push']({'type':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x11')],'app':_0x8d0e('0x12'),'appdata':_0x8d0e('0x18')+_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x16')],'context':_0x44ef55[_0x4847aa][0x0]['context'],'exten':_0x44ef55[_0x4847aa][0x0]['exten'],'priority':_0x349834[_0x8d0e('0x1d')]++,'VoiceExtensionId':_0x44ef55[_0x4847aa][0x0]['VoiceExtensionId']});var _0x104486=_0x349834['priority']++;_0x349834[_0x8d0e('0xf')][_0x8d0e('0x10')]({'type':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x11')],'app':_0x8d0e('0x1e'),'appdata':_0x8d0e('0x1f')+(_0x104486+0x2)+_0x8d0e('0x20')+(_0x104486+0x1)+')','context':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x15')],'exten':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x7')],'priority':_0x104486,'VoiceExtensionId':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x16')]});if(_0x349834[_0x8d0e('0xd')]){_0x349834[_0x8d0e('0xf')][_0x8d0e('0x10')]({'type':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x11')],'app':_0x8d0e('0x12'),'appdata':_0x349834['extension'][_0x8d0e('0x1b')]?_0x8d0e('0x21')+_0x349834[_0x8d0e('0xd')][_0x8d0e('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x15')],'exten':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x7')],'priority':_0x349834[_0x8d0e('0x1d')]++,'VoiceExtensionId':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x16')]});}_0x349834[_0x8d0e('0xf')][_0x8d0e('0x10')]({'type':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x11')],'app':_0x8d0e('0x12'),'appdata':_0x8d0e('0x22')+_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x16')],'context':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x15')],'exten':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x7')],'priority':_0x349834[_0x8d0e('0x1d')]++,'VoiceExtensionId':_0x44ef55[_0x4847aa][0x0]['VoiceExtensionId']});if(_0x349834['extension']&&_0x349834[_0x8d0e('0xd')][_0x8d0e('0x23')](_0x8d0e('0x24'))&&_0x349834['extension'][_0x8d0e('0x24')]!==_0x8d0e('0x25')){_0x349834[_0x8d0e('0xf')]['push']({'type':_0x44ef55[_0x4847aa][0x0]['type'],'app':_0x8d0e('0x12'),'appdata':_0x8d0e('0x26'),'context':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x15')],'exten':_0x44ef55[_0x4847aa][0x0]['exten'],'priority':_0x349834[_0x8d0e('0x1d')]++,'VoiceExtensionId':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x16')]});_0x349834[_0x8d0e('0xf')][_0x8d0e('0x10')]({'type':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x11')],'app':_0x8d0e('0x12'),'appdata':_0x8d0e('0x27')+_0x349834[_0x8d0e('0xd')][_0x8d0e('0x24')]||_0x8d0e('0x28'),'context':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x15')],'exten':_0x44ef55[_0x4847aa][0x0]['exten'],'priority':_0x349834[_0x8d0e('0x1d')]++,'VoiceExtensionId':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x16')]});}}_0x349834['extensions'][_0x8d0e('0x10')]({'type':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x11')],'app':_0x8d0e('0x12'),'appdata':_0x8d0e('0x29'),'context':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x15')],'exten':_0x44ef55[_0x4847aa][0x0]['exten'],'priority':_0x349834[_0x8d0e('0x1d')]++,'VoiceExtensionId':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x16')]});_0x349834[_0x8d0e('0xf')][_0x8d0e('0x10')]({'type':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x11')],'app':_0x8d0e('0x12'),'appdata':_0x8d0e('0x2a'),'context':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x15')],'exten':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x7')],'priority':_0x349834[_0x8d0e('0x1d')]++,'VoiceExtensionId':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x16')]});_0x349834['extensions'][_0x8d0e('0x10')]({'type':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x11')],'app':_0x8d0e('0x12'),'appdata':_0x8d0e('0x2b'),'context':_0x44ef55[_0x4847aa][0x0]['context'],'exten':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x7')],'priority':_0x349834[_0x8d0e('0x1d')]++,'VoiceExtensionId':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x16')]});for(var _0x2a5818=0x0,_0x1e5403=0x0;_0x2a5818<_0x44ef55[_0x4847aa][_0x8d0e('0x2c')];_0x2a5818+=0x1,_0x1e5403=0x0){var _0x597e07=_0x44ef55[_0x4847aa][_0x2a5818];if(_0x597e07[_0x8d0e('0x11')]){_0x597e07[_0x8d0e('0x11')]=_0x597e07[_0x8d0e('0x11')]['toLowerCase']();}var _0x1f730b=[];var _0x1edb33=[];delete _0x597e07['id'];delete _0x597e07[_0x8d0e('0x2d')];delete _0x597e07[_0x8d0e('0x2e')];var _0x5efbbf=_0x597e07[_0x8d0e('0x2f')]!=='*,*,*,*'?[_0x597e07[_0x8d0e('0x2f')]]:_0x597e07[_0x8d0e('0x4')]?_[_0x8d0e('0x6')](_[_0x8d0e('0x9')](_0x349834['intervals'],{'IntervalId':_0x597e07[_0x8d0e('0x4')]}),'interval'):[];if(_0x597e07['hasOwnProperty'](_0x8d0e('0x30'))){if(_0x597e07[_0x8d0e('0x30')]&&_0x597e07['tag']!=='--'){_0x1f730b[_0x8d0e('0x10')]({'type':_0x597e07[_0x8d0e('0x11')],'app':_0x8d0e('0x12'),'appdata':'CDR(tag)='+_0x597e07[_0x8d0e('0x30')],'context':_0x597e07['context'],'exten':_0x597e07[_0x8d0e('0x7')],'priority':_0x5efbbf[_0x8d0e('0x2c')]+_0x349834[_0x8d0e('0x1d')]+_0x1e5403++,'VoiceExtensionId':_0x597e07[_0x8d0e('0x16')]});}}if(_0x597e07['type']===_0x8d0e('0x19')&&_0x597e07[_0x8d0e('0x23')]('callerID')){if(_0x597e07['callerID']){_0x1f730b[_0x8d0e('0x10')]({'type':_0x597e07[_0x8d0e('0x11')],'app':'ExecIf','appdata':_0x8d0e('0x31')+_0x597e07[_0x8d0e('0x32')]+')','context':_0x597e07[_0x8d0e('0x15')],'exten':_0x597e07[_0x8d0e('0x7')],'priority':_0x5efbbf[_0x8d0e('0x2c')]+_0x349834[_0x8d0e('0x1d')]+_0x1e5403++,'VoiceExtensionId':_0x597e07[_0x8d0e('0x16')]});}else{_0x1f730b[_0x8d0e('0x10')]({'type':_0x597e07[_0x8d0e('0x11')],'app':'ExecIf','appdata':_0x8d0e('0x33'),'context':_0x597e07[_0x8d0e('0x15')],'exten':_0x597e07[_0x8d0e('0x7')],'priority':_0x5efbbf['length']+_0x349834[_0x8d0e('0x1d')]+_0x1e5403++,'VoiceExtensionId':_0x597e07[_0x8d0e('0x16')]});}}if(_0x597e07[_0x8d0e('0x23')](_0x8d0e('0x34'))){if(_0x4d9b47[_0x8d0e('0x35')](_0x597e07[_0x8d0e('0x36')]['toLowerCase']())>=0x0&&_0x597e07[_0x8d0e('0x37')]!==_0x8d0e('0x38')){if(_0x597e07['answer']){_0x1f730b[_0x8d0e('0x10')]({'type':_0x597e07['type'],'app':_0x8d0e('0x1e'),'appdata':_0x8d0e('0x39'),'context':_0x597e07[_0x8d0e('0x15')],'exten':_0x597e07[_0x8d0e('0x7')],'priority':_0x5efbbf[_0x8d0e('0x2c')]+_0x349834[_0x8d0e('0x1d')]+_0x1e5403++,'VoiceExtensionId':_0x597e07[_0x8d0e('0x16')]});_0x1f730b[_0x8d0e('0x10')]({'type':_0x597e07[_0x8d0e('0x11')],'app':_0x8d0e('0x12'),'appdata':_0x8d0e('0x3a'),'context':_0x597e07[_0x8d0e('0x15')],'exten':_0x597e07[_0x8d0e('0x7')],'priority':_0x5efbbf[_0x8d0e('0x2c')]+_0x349834[_0x8d0e('0x1d')]+_0x1e5403++,'VoiceExtensionId':_0x597e07['VoiceExtensionId']});}else{_0x1f730b[_0x8d0e('0x10')]({'type':_0x597e07[_0x8d0e('0x11')],'app':_0x8d0e('0x1e'),'appdata':_0x8d0e('0x3b'),'context':_0x597e07[_0x8d0e('0x15')],'exten':_0x597e07[_0x8d0e('0x7')],'priority':_0x5efbbf[_0x8d0e('0x2c')]+_0x349834['priority']+_0x1e5403++,'VoiceExtensionId':_0x597e07['VoiceExtensionId']});_0x1f730b[_0x8d0e('0x10')]({'type':_0x597e07['type'],'app':_0x8d0e('0x12'),'appdata':_0x8d0e('0x3c'),'context':_0x597e07[_0x8d0e('0x15')],'exten':_0x597e07[_0x8d0e('0x7')],'priority':_0x5efbbf[_0x8d0e('0x2c')]+_0x349834[_0x8d0e('0x1d')]+_0x1e5403++,'VoiceExtensionId':_0x597e07['VoiceExtensionId']});}}}for(var _0x3ef472=0x0;_0x3ef472<_0x5efbbf[_0x8d0e('0x2c')];_0x3ef472+=0x1){var _0x2f9a46=_0x349834[_0x8d0e('0x1d')]+_0x5efbbf['length'];var _0x4c20b1=_0x3ef472===_0x5efbbf[_0x8d0e('0x2c')]-0x1?_0x349834[_0x8d0e('0x1d')]+_0x1f730b['length']+_0x1edb33['length']+0x2:_0x349834[_0x8d0e('0x1d')]+_0x3ef472+0x1;_0x1f730b[_0x8d0e('0x3d')](_0x3ef472,0x0,{'type':_0x597e07[_0x8d0e('0x11')],'app':_0x8d0e('0x3e'),'appdata':_0x5efbbf[_0x3ef472]+'?'+_0x597e07[_0x8d0e('0x15')]+',${EXTEN},'+_0x2f9a46+':'+_0x597e07[_0x8d0e('0x15')]+_0x8d0e('0x3f')+_0x4c20b1,'exten':_0x597e07['exten'],'context':_0x597e07[_0x8d0e('0x15')],'priority':_0x349834['priority']+_0x3ef472,'VoiceExtensionId':_0x44ef55[_0x4847aa][0x0]['VoiceExtensionId']});}_0x597e07[_0x8d0e('0x1d')]=_0x1f730b['length']?_[_0x8d0e('0x40')](_0x1f730b)['priority']+0x1:_0x349834['priority'];_0x349834[_0x8d0e('0x1d')]=(_0x1edb33[_0x8d0e('0x2c')]?_[_0x8d0e('0x40')](_0x1edb33)[_0x8d0e('0x1d')]:_0x597e07['priority'])+0x1;_0x349834[_0x8d0e('0xf')]=_['concat'](_0x349834[_0x8d0e('0xf')],_0x1f730b,[_0x597e07],_0x1edb33);}_0x349834[_0x8d0e('0xf')][_0x8d0e('0x10')]({'type':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x11')],'app':_0x8d0e('0x41'),'exten':_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x7')],'context':_0x44ef55[_0x4847aa][0x0]['context'],'priority':_0x349834[_0x8d0e('0x1d')],'VoiceExtensionId':_0x44ef55[_0x4847aa][0x0]['VoiceExtensionId']});_0x2cbb35[_0x8d0e('0x10')](_0x44ef55[_0x4847aa][0x0][_0x8d0e('0x16')]);_0x483fd8=_['concat'](_0x483fd8,_0x349834[_0x8d0e('0xf')]);}}return _0x478d22[_0x8d0e('0x42')](function(_0x474c04){return _0x478d22['models']['VoiceExtension'][_0x8d0e('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x2cbb35}},'transaction':_0x474c04})[_0x8d0e('0x5')](function(_0x14835c){return _0x478d22[_0x8d0e('0x0')][_0x8d0e('0x2')][_0x8d0e('0x44')](_[_0x8d0e('0x45')](_0x483fd8,'priority'),{'transaction':_0x474c04});});});})[_0x8d0e('0x46')](function(_0x2db424){console[_0x8d0e('0x47')](_0x2db424);});}exports[_0x8d0e('0x48')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index aa96ec4..8099802 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 _0x4fc3=['test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','then','pick','catch','stringify','cmContact','checkHopper','inspect','insert','fromQuery','phone','scheduledAt','createdAt','updatedAt','select','field','ContactId','toString','ListId','NOW()','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','into','from','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_contacts','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','sequelize','VoiceQueueId','onlyIfOpen','push','query','all','BlackLists','Campaign','always','CampaignId','generalCheckHopper','message','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index'];(function(_0x5a3b79,_0x2e7582){var _0x23c45e=function(_0x5a94d0){while(--_0x5a94d0){_0x5a3b79['push'](_0x5a3b79['shift']());}};_0x23c45e(++_0x2e7582);}(_0x4fc3,0x1b0));var _0x34fc=function(_0x13e00e,_0x46d33e){_0x13e00e=_0x13e00e-0x0;var _0x2bca87=_0x4fc3[_0x13e00e];return _0x2bca87;};'use strict';var BPromise=require(_0x34fc('0x0'));var util=require(_0x34fc('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x34fc('0x2'));var Redis=require(_0x34fc('0x3'));var db=require(_0x34fc('0x4'))['db'];var config=require(_0x34fc('0x5'));var logger=require(_0x34fc('0x6'))(_0x34fc('0x7'));config[_0x34fc('0x8')]=_[_0x34fc('0x9')](config[_0x34fc('0x8')],{'host':_0x34fc('0xa'),'port':0x18eb});var socket=require(_0x34fc('0xb'))(new Redis(config['redis']));require(_0x34fc('0xc'))['register'](socket);try{if(!process[_0x34fc('0xd')][0x2]||process[_0x34fc('0xd')][0x2]===_0x34fc('0xe')||process[_0x34fc('0xd')][0x2]==='null'){throw new Error(_0x34fc('0xf'));}var FILEPATH=process[_0x34fc('0xd')][0x2];if(!process['argv'][0x3]||process[_0x34fc('0xd')][0x3]===_0x34fc('0xe')||process[_0x34fc('0xd')][0x3]===_0x34fc('0x10')||!process['argv'][0x4]||process[_0x34fc('0xd')][0x4]===_0x34fc('0xe')||process[_0x34fc('0xd')][0x4]===_0x34fc('0x10')){throw new Error(_0x34fc('0x11'));}var FIELDS=_[_0x34fc('0x12')](process['argv'][0x3][_0x34fc('0x13')](','),process[_0x34fc('0xd')][0x4][_0x34fc('0x13')](','));if(!process[_0x34fc('0xd')][0x5]||process[_0x34fc('0xd')][0x5]==='undefined'||process[_0x34fc('0xd')][0x5]===_0x34fc('0x10')){throw new Error(_0x34fc('0x14'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x34fc('0xd')][0x6]&&process['argv'][0x6]!==_0x34fc('0xe')&&process[_0x34fc('0xd')][0x6]!==_0x34fc('0x10')?process[_0x34fc('0xd')][0x6]:null;var DUPLICATES=process[_0x34fc('0xd')][0x7]&&process[_0x34fc('0xd')][0x7]!==_0x34fc('0xe')&&process[_0x34fc('0xd')][0x7]!==_0x34fc('0x10')?process[_0x34fc('0xd')][0x7]:null;if(!process[_0x34fc('0xd')][0x8]||process[_0x34fc('0xd')][0x8]===_0x34fc('0xe')||process[_0x34fc('0xd')][0x8]===_0x34fc('0x10')){throw new Error(_0x34fc('0x15'));}var SOCKET_TIMESTAMP=process[_0x34fc('0xd')][0x8];}catch(_0x3a9ca3){logger[_0x34fc('0x16')](_0x3a9ca3);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(_0x478c2e,_0x453c14,_0x4385f6,_0x598292){var _0x2a9e16={'message':_0x453c14};_0x2a9e16[_0x478c2e]=!![];if(_0x4385f6){_0x2a9e16['contact']=_0x4385f6;}if(_0x598292){_0x2a9e16[_0x34fc('0x17')]=_0x598292;}return _0x2a9e16;}function isEmail(_0x3e02b7){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))*$/[_0x34fc('0x18')](_0x3e02b7);}function checkRow(_0x2255b5,_0x1123c7,_0x4c725f){return new BPromise(function(_0x2e26ea,_0xd9734c){if(_[_0x34fc('0x19')](_0x2255b5)){return _0xd9734c(handleCheckRowError(_0x34fc('0x16'),_0x34fc('0x1a'),null,_0x4c725f));}if(_0x2255b5[_0x34fc('0x1b')]&&_0x2255b5[_0x34fc('0x1b')][_0x34fc('0x1c')]){var _0xc3ba0e=_['map'](_0x2255b5[_0x34fc('0x1b')],'message')[_0x34fc('0x1d')](';');return _0xd9734c(handleCheckRowError('error',_0xc3ba0e,null,_0x4c725f));}var _0x5c7fe0={};for(var _0x357d6f in FIELDS){if(FIELDS[_0x34fc('0x1e')](_0x357d6f)&&FIELDS[_0x357d6f]){_0x5c7fe0[_0x357d6f]=_0x2255b5[_0x34fc('0x1f')][0x0][FIELDS[_0x357d6f]]||_0x2255b5[_0x34fc('0x1f')][0x0]['\ufeff'+FIELDS[_0x357d6f]];}}if(!_0x5c7fe0[_0x34fc('0x20')]){return _0xd9734c(handleCheckRowError(_0x34fc('0x16'),_0x34fc('0x21'),null,_0x4c725f));}if(!_0x5c7fe0['phone']){return _0xd9734c(handleCheckRowError(_0x34fc('0x16'),'phone\x20not\x20specified!',null,_0x4c725f));}if(_0x5c7fe0[_0x34fc('0x22')]){var _0x297751=moment(_0x5c7fe0['birthDate'],_0x34fc('0x23'));if(!_0x297751['isValid']()){return _0xd9734c(handleCheckRowError(_0x34fc('0x16'),_0x34fc('0x24'),null,_0x4c725f));}}if(_0x5c7fe0[_0x34fc('0x25')]){if(!isEmail(_0x5c7fe0[_0x34fc('0x25')])){return _0xd9734c(handleCheckRowError(_0x34fc('0x16'),_0x34fc('0x26'),null,_0x4c725f));}}_0x5c7fe0['ListId']=LISTID;_0x5c7fe0[_0x34fc('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x1123c7){var _0x49ff1c={};for(var _0x409bbe=0x0,_0x37442b=DUPLICATES[_0x34fc('0x1c')];_0x409bbe<_0x37442b;_0x409bbe+=0x1){_0x49ff1c[DUPLICATES[_0x409bbe]]=_0x5c7fe0[DUPLICATES[_0x409bbe]];}var _0x28d6bd=_[_0x34fc('0x28')](_0x1123c7,_0x49ff1c);if(_0x28d6bd){return _0xd9734c(handleCheckRowError(_0x34fc('0x29'),_0x34fc('0x2a'),_0x28d6bd,_0x4c725f));}}return db[_0x34fc('0x2b')][_0x34fc('0x2c')](_0x5c7fe0,{'raw':!![],'hooks':![],'fields':_['keys'](_0x5c7fe0)})[_0x34fc('0x2d')](function(_0x3e2bac){if(DUPLICATES&&DUPLICATES[_0x34fc('0x1c')]&&_0x1123c7){_0x1123c7['push'](_[_0x34fc('0x2e')](_0x5c7fe0,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3e2bac['id'];return _0x2e26ea();})[_0x34fc('0x2f')](function(_0x5486b2){return _0xd9734c(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x5486b2['message']||JSON[_0x34fc('0x30')](_0x5486b2)),null,_0x4c725f));});});}function checkHopper(){function _0x335ebe(){return function(_0x2b56fd){logger[_0x34fc('0x16')](_0x34fc('0x31'),_0x34fc('0x32'),util[_0x34fc('0x33')](_0x2b56fd,{'showHidden':![],'depth':null}));};}var _0x1c8740=function(_0x152a3e,_0x56d19c){var _0x587454=squel[_0x34fc('0x34')]()['into']('cm_hopper')[_0x34fc('0x35')]([_0x34fc('0x36'),_0x34fc('0x37'),'ContactId','ListId',_0x56d19c,_0x34fc('0x38'),_0x34fc('0x39')],squel[_0x34fc('0x3a')]()[_0x34fc('0x3b')](_0x34fc('0x36'),_0x34fc('0x36'))['field']('NOW()',_0x34fc('0x37'))[_0x34fc('0x3b')]('id',_0x34fc('0x3c'))[_0x34fc('0x3b')](LISTID[_0x34fc('0x3d')](),_0x34fc('0x3e'))[_0x34fc('0x3b')](_0x152a3e['id'][_0x34fc('0x3d')](),_0x56d19c)[_0x34fc('0x3b')](_0x34fc('0x3f'),_0x34fc('0x38'))[_0x34fc('0x3b')](_0x34fc('0x3f'),'updatedAt')['from']('cm_contacts')[_0x34fc('0x40')](_0x34fc('0x41'))[_0x34fc('0x40')](_0x34fc('0x42'),LISTID[_0x34fc('0x3d')]())[_0x34fc('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x34fc('0x40')](_0x34fc('0x43'),squel[_0x34fc('0x3a')]()[_0x34fc('0x3b')]('phone')['from'](_0x34fc('0x44'))[_0x34fc('0x40')](_0x56d19c+_0x34fc('0x45'),_0x152a3e['id'][_0x34fc('0x3d')]())))[_0x34fc('0x3d')]();return _0x587454;};var _0x3e4e51=function(_0x15dc30,_0x2e3430){var _0x1ee9ec=squel[_0x34fc('0x34')]()[_0x34fc('0x46')](_0x34fc('0x44'))['fromQuery'](['phone',_0x34fc('0x37'),_0x34fc('0x3c'),_0x34fc('0x3e'),_0x2e3430,_0x34fc('0x38'),_0x34fc('0x39')],squel[_0x34fc('0x3a')]()['field'](_0x34fc('0x36'),_0x34fc('0x36'))[_0x34fc('0x3b')](_0x34fc('0x3f'),_0x34fc('0x37'))[_0x34fc('0x3b')]('id',_0x34fc('0x3c'))[_0x34fc('0x3b')](LISTID['toString'](),_0x34fc('0x3e'))[_0x34fc('0x3b')](_0x15dc30['id']['toString'](),_0x2e3430)[_0x34fc('0x3b')](_0x34fc('0x3f'),_0x34fc('0x38'))[_0x34fc('0x3b')](_0x34fc('0x3f'),'updatedAt')[_0x34fc('0x47')]('cm_contacts')[_0x34fc('0x40')](_0x34fc('0x41'))['where']('ListId\x20=\x20?',LISTID[_0x34fc('0x3d')]())[_0x34fc('0x40')](_0x34fc('0x48'),squel[_0x34fc('0x49')](hopperContacts))[_0x34fc('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x34fc('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x34fc('0x3a')]()['field'](_0x34fc('0x4a'))[_0x34fc('0x47')](_0x34fc('0x4b'))[_0x34fc('0x40')](_0x2e3430+_0x34fc('0x45'),_0x15dc30['id'][_0x34fc('0x3d')]()))[_0x34fc('0x40')](_0x34fc('0x43'),squel[_0x34fc('0x3a')]()[_0x34fc('0x3b')](_0x34fc('0x36'))[_0x34fc('0x47')]('cm_hopper')[_0x34fc('0x40')](_0x2e3430+'\x20=\x20?',_0x15dc30['id']['toString']())))[_0x34fc('0x3d')]();return _0x1ee9ec;};function _0x5e1488(_0x3cb7ca,_0x19f147){var _0x582e5d=squel['insert']()[_0x34fc('0x46')](_0x34fc('0x44'))[_0x34fc('0x35')]([_0x34fc('0x36'),_0x34fc('0x37'),_0x34fc('0x3c'),_0x34fc('0x3e'),_0x19f147,'createdAt','updatedAt'],squel[_0x34fc('0x3a')]()[_0x34fc('0x3b')](_0x34fc('0x36'),_0x34fc('0x36'))[_0x34fc('0x3b')](_0x34fc('0x3f'),_0x34fc('0x37'))[_0x34fc('0x3b')]('id',_0x34fc('0x3c'))[_0x34fc('0x3b')](LISTID[_0x34fc('0x3d')](),_0x34fc('0x3e'))[_0x34fc('0x3b')](_0x3cb7ca['id'][_0x34fc('0x3d')](),_0x19f147)['field'](_0x34fc('0x3f'),_0x34fc('0x38'))['field'](_0x34fc('0x3f'),_0x34fc('0x39'))['from'](_0x34fc('0x4c'))[_0x34fc('0x40')](_0x34fc('0x41'))[_0x34fc('0x40')](_0x34fc('0x42'),LISTID[_0x34fc('0x3d')]())[_0x34fc('0x40')]('id\x20IN\x20?',squel[_0x34fc('0x49')](hopperContacts))[_0x34fc('0x40')](_0x34fc('0x4d')))[_0x34fc('0x3d')]();return _0x582e5d;}function _0x4bca46(_0x498638,_0x37e606){var _0x2bf6c5=squel[_0x34fc('0x34')]()[_0x34fc('0x46')](_0x34fc('0x4e'))[_0x34fc('0x35')]([_0x34fc('0x36'),_0x34fc('0x3c'),_0x34fc('0x3e'),_0x37e606,_0x34fc('0x38'),_0x34fc('0x39')],squel[_0x34fc('0x3a')]()[_0x34fc('0x3b')](_0x34fc('0x36'),'phone')[_0x34fc('0x3b')]('id','ContactId')[_0x34fc('0x3b')](LISTID[_0x34fc('0x3d')](),_0x34fc('0x3e'))[_0x34fc('0x3b')](_0x498638['id'][_0x34fc('0x3d')](),_0x37e606)['field'](_0x34fc('0x3f'),_0x34fc('0x38'))['field']('NOW()',_0x34fc('0x39'))[_0x34fc('0x47')](_0x34fc('0x4c'))[_0x34fc('0x40')](_0x34fc('0x41'))[_0x34fc('0x40')](_0x34fc('0x42'),LISTID[_0x34fc('0x3d')]())['where']('id\x20IN\x20?',squel[_0x34fc('0x49')](hopperContacts))[_0x34fc('0x40')](_0x34fc('0x4d')))['toString']();return _0x2bf6c5;}return db[_0x34fc('0x4f')][_0x34fc('0x50')]({'where':{'type':_0x34fc('0x51')},'attributes':['id',_0x34fc('0x52')],'include':[{'model':db[_0x34fc('0x53')],'as':_0x34fc('0x54'),'where':{'id':LISTID}}]})[_0x34fc('0x2d')](function(_0x4216d4){var _0x4646f3=[];if(_0x4216d4){var _0x2db220;for(var _0x19563f=0x0,_0x5ce8ac;_0x19563f<_0x4216d4[_0x34fc('0x1c')];_0x19563f+=0x1){_0x5ce8ac=_0x4216d4[_0x19563f][_0x34fc('0x55')]({'plain':!![]});switch(_0x5ce8ac[_0x34fc('0x52')]){case'always':_0x4646f3['push'](db[_0x34fc('0x56')]['query'](_0x3e4e51(_0x5ce8ac,_0x34fc('0x57')))[_0x34fc('0x2d')](function(){})[_0x34fc('0x2f')](_0x335ebe()));break;case _0x34fc('0x58'):_0x4646f3[_0x34fc('0x59')](db[_0x34fc('0x56')][_0x34fc('0x5a')](_0x1c8740(_0x5ce8ac,'VoiceQueueId'))[_0x34fc('0x2d')](function(){})[_0x34fc('0x2f')](_0x335ebe()));break;default:_0x4646f3[_0x34fc('0x59')](db[_0x34fc('0x56')][_0x34fc('0x5a')](_0x5e1488(_0x5ce8ac,_0x34fc('0x57')))[_0x34fc('0x2d')](function(){})[_0x34fc('0x2f')](_0x335ebe()));}}}return _0x4646f3;})[_0x34fc('0x5b')]()[_0x34fc('0x2d')](function(){return db[_0x34fc('0x4f')][_0x34fc('0x50')]({'where':{'type':_0x34fc('0x51')},'attributes':['id'],'include':[{'model':db[_0x34fc('0x53')],'as':_0x34fc('0x5c'),'where':{'id':LISTID}}]})[_0x34fc('0x2d')](function(_0x593691){var _0x422b3a=[];if(_0x593691){var _0x5b4160;for(var _0x51110f=0x0,_0x5ad5a0;_0x51110f<_0x593691[_0x34fc('0x1c')];_0x51110f+=0x1){_0x5ad5a0=_0x593691[_0x51110f][_0x34fc('0x55')]({'plain':!![]});_0x422b3a[_0x34fc('0x59')](db[_0x34fc('0x56')][_0x34fc('0x5a')](_0x4bca46(_0x5ad5a0,'VoiceQueueId'))['then'](function(){})[_0x34fc('0x2f')](_0x335ebe()));}}return _0x422b3a;})[_0x34fc('0x5b')]();})['then'](function(){return db[_0x34fc('0x5d')]['findAll']({'attributes':['id',_0x34fc('0x52')],'include':[{'model':db[_0x34fc('0x53')],'as':_0x34fc('0x54'),'where':{'id':LISTID}}]})[_0x34fc('0x2d')](function(_0x2c7176){var _0x551c2f=[];if(_0x2c7176){for(var _0x5bd94b=0x0,_0x5c3f59;_0x5bd94b<_0x2c7176[_0x34fc('0x1c')];_0x5bd94b+=0x1){_0x5c3f59=_0x2c7176[_0x5bd94b][_0x34fc('0x55')]({'plain':!![]});switch(_0x5c3f59['dialCheckDuplicateType']){case _0x34fc('0x5e'):_0x551c2f[_0x34fc('0x59')](db[_0x34fc('0x56')][_0x34fc('0x5a')](_0x3e4e51(_0x5c3f59,_0x34fc('0x5f')))[_0x34fc('0x2d')](function(){})[_0x34fc('0x2f')](_0x335ebe()));break;case'onlyIfOpen':_0x551c2f[_0x34fc('0x59')](db[_0x34fc('0x56')]['query'](_0x1c8740(_0x5c3f59,_0x34fc('0x5f')))['then'](function(){})[_0x34fc('0x2f')](_0x335ebe()));break;default:_0x551c2f['push'](db[_0x34fc('0x56')]['query'](_0x5e1488(_0x5c3f59,_0x34fc('0x5f')))[_0x34fc('0x2d')](function(){})['catch'](_0x335ebe()));}}}return _0x551c2f;})['all']();})[_0x34fc('0x2d')](function(){return db['Campaign'][_0x34fc('0x50')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x34fc('0x5c'),'where':{'id':LISTID}}]})[_0x34fc('0x2d')](function(_0x24c111){var _0x2428e0=[];if(_0x24c111){for(var _0x345943=0x0,_0x249afd;_0x345943<_0x24c111[_0x34fc('0x1c')];_0x345943+=0x1){_0x249afd=_0x24c111[_0x345943]['get']({'plain':!![]});_0x2428e0[_0x34fc('0x59')](db['sequelize'][_0x34fc('0x5a')](_0x4bca46(_0x249afd,'CampaignId'))['then'](function(){})['catch'](_0x335ebe()));}}return _0x2428e0;})[_0x34fc('0x5b')]();})[_0x34fc('0x2f')](function(_0x57d188){logger['error']('cmContact,\x20%s,\x20%s',_0x34fc('0x60'),_0x57d188[_0x34fc('0x61')]);});}var processPromises=function(_0x4b1092){return BPromise[_0x34fc('0x5b')](promises)[_0x34fc('0x2d')](function(_0x3207fa){})[_0x34fc('0x2f')](function(_0xd8fb86){logger[_0x34fc('0x16')](_0x34fc('0x62'),JSON[_0x34fc('0x30')](_0xd8fb86));})[_0x34fc('0x63')](function(){socket[_0x34fc('0x64')](_0x34fc('0x65')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4b1092){return _0x4b1092[_0x34fc('0x66')]();}});};var endCsv=function(){return BPromise[_0x34fc('0x67')]()[_0x34fc('0x2d')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0xbd6f06){logger[_0x34fc('0x16')](_0x34fc('0x68'),JSON[_0x34fc('0x30')](_0xbd6f06));}finally{process[_0x34fc('0x69')](0x0);}});};process['on'](_0x34fc('0x6a'),function(){logger[_0x34fc('0x6b')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0x34fc('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x34fc('0x2b')][_0x34fc('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x34fc('0x2d')](function(_0x591084){var _0x17432b=fs[_0x34fc('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x34fc('0x6d')](_0x17432b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x7a1397,_0x2f2a6c){total+=0x1;var _0x4ffc17=total;promises[_0x34fc('0x59')](checkRow(_0x7a1397,_0x591084,_0x4ffc17)[_0x34fc('0x2d')](function(){success+=0x1;})[_0x34fc('0x2f')](function(_0x545d1a){if(_0x545d1a[_0x34fc('0x16')]){errors+=0x1;delete _0x545d1a['error'];}else if(_0x545d1a['duplicate']){duplicates+=0x1;delete _0x545d1a[_0x34fc('0x29')];}rows[_0x34fc('0x59')](_0x545d1a);}));if(total%0xc8===0x0){_0x2f2a6c[_0x34fc('0x6e')]();return processPromises(_0x2f2a6c);}},'complete':function(){return processPromises()[_0x34fc('0x2d')](function(){logger[_0x34fc('0x6b')](_0x34fc('0x6f'));endCsv();});},'error':function(_0x4696d6,_0x50f3e7){logger[_0x34fc('0x6b')](_0x34fc('0x70'),JSON[_0x34fc('0x30')](_0x4696d6));endCsv();}});})[_0x34fc('0x2f')](function(_0x3147ad){logger[_0x34fc('0x16')](_0x34fc('0x71'),JSON[_0x34fc('0x30')](_0x3147ad));});}main(); \ No newline at end of file +var _0x1cfb=['../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','into','cm_hopper','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','toString','NOW()','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','from','fromQuery','cm_contacts','ListId\x20=\x20?','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','push','sequelize','query','VoiceQueueId','all','get','onlyIfOpen','CampaignId','Campaign','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','resume','resolve','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','split','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost'];(function(_0x515784,_0x4c79a3){var _0x1fb287=function(_0x5f226a){while(--_0x5f226a){_0x515784['push'](_0x515784['shift']());}};_0x1fb287(++_0x4c79a3);}(_0x1cfb,0xd7));var _0xb1cf=function(_0x1b68ff,_0x5e68a2){_0x1b68ff=_0x1b68ff-0x0;var _0x4b3b07=_0x1cfb[_0x1b68ff];return _0x4b3b07;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xb1cf('0x0'));var fs=require('fs');var squel=require(_0xb1cf('0x1'));var Papa=require('papaparse');var Redis=require(_0xb1cf('0x2'));var db=require(_0xb1cf('0x3'))['db'];var config=require(_0xb1cf('0x4'));var logger=require(_0xb1cf('0x5'))('api');config[_0xb1cf('0x6')]=_[_0xb1cf('0x7')](config[_0xb1cf('0x6')],{'host':_0xb1cf('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb1cf('0x9'))[_0xb1cf('0xa')](socket);try{if(!process['argv'][0x2]||process[_0xb1cf('0xb')][0x2]===_0xb1cf('0xc')||process[_0xb1cf('0xb')][0x2]==='null'){throw new Error(_0xb1cf('0xd'));}var FILEPATH=process[_0xb1cf('0xb')][0x2];if(!process['argv'][0x3]||process[_0xb1cf('0xb')][0x3]===_0xb1cf('0xc')||process[_0xb1cf('0xb')][0x3]===_0xb1cf('0xe')||!process['argv'][0x4]||process[_0xb1cf('0xb')][0x4]==='undefined'||process['argv'][0x4]===_0xb1cf('0xe')){throw new Error(_0xb1cf('0xf'));}var FIELDS=_['zipObject'](process[_0xb1cf('0xb')][0x3]['split'](','),process[_0xb1cf('0xb')][0x4]['split'](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0xb1cf('0xc')||process[_0xb1cf('0xb')][0x5]===_0xb1cf('0xe')){throw new Error(_0xb1cf('0x10'));}var LISTID=process[_0xb1cf('0xb')][0x5];var COMPANYID=process[_0xb1cf('0xb')][0x6]&&process['argv'][0x6]!==_0xb1cf('0xc')&&process[_0xb1cf('0xb')][0x6]!==_0xb1cf('0xe')?process[_0xb1cf('0xb')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xb1cf('0xb')][0x7]!==_0xb1cf('0xc')&&process[_0xb1cf('0xb')][0x7]!==_0xb1cf('0xe')?process['argv'][0x7]:null;if(!process[_0xb1cf('0xb')][0x8]||process[_0xb1cf('0xb')][0x8]===_0xb1cf('0xc')||process[_0xb1cf('0xb')][0x8]==='null'){throw new Error(_0xb1cf('0x11'));}var SOCKET_TIMESTAMP=process[_0xb1cf('0xb')][0x8];}catch(_0x7bf429){logger[_0xb1cf('0x12')](_0x7bf429);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(_0x41a8c6,_0x242c27,_0x4b8574,_0x20cc37){var _0x25f3ca={'message':_0x242c27};_0x25f3ca[_0x41a8c6]=!![];if(_0x4b8574){_0x25f3ca[_0xb1cf('0x13')]=_0x4b8574;}if(_0x20cc37){_0x25f3ca[_0xb1cf('0x14')]=_0x20cc37;}return _0x25f3ca;}function isEmail(_0x57fd31){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))*$/[_0xb1cf('0x15')](_0x57fd31);}function checkRow(_0x1b00b5,_0x5dfea9,_0x5191a0){return new BPromise(function(_0x52b5f0,_0x71e33c){if(_[_0xb1cf('0x16')](_0x1b00b5)){return _0x71e33c(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x5191a0));}if(_0x1b00b5[_0xb1cf('0x17')]&&_0x1b00b5[_0xb1cf('0x17')][_0xb1cf('0x18')]){var _0x5252a4=_[_0xb1cf('0x19')](_0x1b00b5[_0xb1cf('0x17')],_0xb1cf('0x1a'))[_0xb1cf('0x1b')](';');return _0x71e33c(handleCheckRowError('error',_0x5252a4,null,_0x5191a0));}var _0x91a4c3={};for(var _0x5107d4 in FIELDS){if(FIELDS[_0xb1cf('0x1c')](_0x5107d4)&&FIELDS[_0x5107d4]){_0x91a4c3[_0x5107d4]=_0x1b00b5[_0xb1cf('0x1d')][0x0][FIELDS[_0x5107d4]]||_0x1b00b5[_0xb1cf('0x1d')][0x0]['\ufeff'+FIELDS[_0x5107d4]];}}if(!_0x91a4c3[_0xb1cf('0x1e')]){return _0x71e33c(handleCheckRowError('error',_0xb1cf('0x1f'),null,_0x5191a0));}if(!_0x91a4c3['phone']){return _0x71e33c(handleCheckRowError(_0xb1cf('0x12'),_0xb1cf('0x20'),null,_0x5191a0));}if(_0x91a4c3[_0xb1cf('0x21')]){var _0x5a32fe=moment(_0x91a4c3[_0xb1cf('0x21')],_0xb1cf('0x22'));if(!_0x5a32fe[_0xb1cf('0x23')]()){return _0x71e33c(handleCheckRowError('error',_0xb1cf('0x24'),null,_0x5191a0));}}if(_0x91a4c3[_0xb1cf('0x25')]){if(!isEmail(_0x91a4c3[_0xb1cf('0x25')])){return _0x71e33c(handleCheckRowError('error',_0xb1cf('0x26'),null,_0x5191a0));}}_0x91a4c3[_0xb1cf('0x27')]=LISTID;_0x91a4c3[_0xb1cf('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb1cf('0x18')]&&_0x5dfea9){var _0x5b5d9={};for(var _0x4f9ec7=0x0,_0x214f7e=DUPLICATES['length'];_0x4f9ec7<_0x214f7e;_0x4f9ec7+=0x1){_0x5b5d9[DUPLICATES[_0x4f9ec7]]=_0x91a4c3[DUPLICATES[_0x4f9ec7]];}var _0x49a7fd=_[_0xb1cf('0x29')](_0x5dfea9,_0x5b5d9);if(_0x49a7fd){return _0x71e33c(handleCheckRowError(_0xb1cf('0x2a'),_0xb1cf('0x2b'),_0x49a7fd,_0x5191a0));}}return db[_0xb1cf('0x2c')][_0xb1cf('0x2d')](_0x91a4c3,{'raw':!![],'hooks':![],'fields':_[_0xb1cf('0x2e')](_0x91a4c3)})[_0xb1cf('0x2f')](function(_0x2a32e2){if(DUPLICATES&&DUPLICATES['length']&&_0x5dfea9){_0x5dfea9['push'](_[_0xb1cf('0x30')](_0x91a4c3,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2a32e2['id'];return _0x52b5f0();})[_0xb1cf('0x31')](function(_0x43aa00){return _0x71e33c(handleCheckRowError(_0xb1cf('0x12'),_0xb1cf('0x32')+(_0x43aa00[_0xb1cf('0x1a')]||JSON[_0xb1cf('0x33')](_0x43aa00)),null,_0x5191a0));});});}function checkHopper(){function _0x3053af(){return function(_0x7015bb){logger['error']('cmContact',_0xb1cf('0x34'),util[_0xb1cf('0x35')](_0x7015bb,{'showHidden':![],'depth':null}));};}var _0x451a22=function(_0x503c56,_0x12ee28){var _0x44b08c=squel[_0xb1cf('0x36')]()[_0xb1cf('0x37')](_0xb1cf('0x38'))['fromQuery']([_0xb1cf('0x39'),_0xb1cf('0x3a'),_0xb1cf('0x3b'),_0xb1cf('0x27'),_0x12ee28,_0xb1cf('0x3c'),_0xb1cf('0x3d')],squel[_0xb1cf('0x3e')]()[_0xb1cf('0x3f')](_0xb1cf('0x39'),_0xb1cf('0x39'))[_0xb1cf('0x3f')]('NOW()',_0xb1cf('0x3a'))['field']('id',_0xb1cf('0x3b'))[_0xb1cf('0x3f')](LISTID[_0xb1cf('0x40')](),_0xb1cf('0x27'))[_0xb1cf('0x3f')](_0x503c56['id'][_0xb1cf('0x40')](),_0x12ee28)[_0xb1cf('0x3f')](_0xb1cf('0x41'),'createdAt')[_0xb1cf('0x3f')](_0xb1cf('0x41'),_0xb1cf('0x3d'))['from']('cm_contacts')[_0xb1cf('0x42')](_0xb1cf('0x43'))[_0xb1cf('0x42')]('ListId\x20=\x20?',LISTID[_0xb1cf('0x40')]())[_0xb1cf('0x42')](_0xb1cf('0x44'))[_0xb1cf('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb1cf('0x3e')]()[_0xb1cf('0x3f')]('phone')[_0xb1cf('0x45')]('cm_hopper')['where'](_0x12ee28+'\x20=\x20?',_0x503c56['id'][_0xb1cf('0x40')]())))[_0xb1cf('0x40')]();return _0x44b08c;};var _0x153108=function(_0x4f77c1,_0x515887){var _0x490684=squel[_0xb1cf('0x36')]()[_0xb1cf('0x37')](_0xb1cf('0x38'))[_0xb1cf('0x46')]([_0xb1cf('0x39'),'scheduledAt',_0xb1cf('0x3b'),_0xb1cf('0x27'),_0x515887,_0xb1cf('0x3c'),_0xb1cf('0x3d')],squel[_0xb1cf('0x3e')]()[_0xb1cf('0x3f')](_0xb1cf('0x39'),_0xb1cf('0x39'))[_0xb1cf('0x3f')](_0xb1cf('0x41'),_0xb1cf('0x3a'))[_0xb1cf('0x3f')]('id',_0xb1cf('0x3b'))[_0xb1cf('0x3f')](LISTID['toString'](),_0xb1cf('0x27'))[_0xb1cf('0x3f')](_0x4f77c1['id'][_0xb1cf('0x40')](),_0x515887)[_0xb1cf('0x3f')](_0xb1cf('0x41'),'createdAt')[_0xb1cf('0x3f')](_0xb1cf('0x41'),_0xb1cf('0x3d'))[_0xb1cf('0x45')](_0xb1cf('0x47'))[_0xb1cf('0x42')](_0xb1cf('0x43'))[_0xb1cf('0x42')](_0xb1cf('0x48'),LISTID[_0xb1cf('0x40')]())[_0xb1cf('0x42')](_0xb1cf('0x49'),squel[_0xb1cf('0x4a')](hopperContacts))[_0xb1cf('0x42')](_0xb1cf('0x44'))[_0xb1cf('0x42')](_0xb1cf('0x4b'),squel['select']()[_0xb1cf('0x3f')](_0xb1cf('0x4c'))['from'](_0xb1cf('0x4d'))[_0xb1cf('0x42')](_0x515887+_0xb1cf('0x4e'),_0x4f77c1['id']['toString']()))[_0xb1cf('0x42')](_0xb1cf('0x4b'),squel['select']()[_0xb1cf('0x3f')](_0xb1cf('0x39'))['from']('cm_hopper')[_0xb1cf('0x42')](_0x515887+_0xb1cf('0x4e'),_0x4f77c1['id'][_0xb1cf('0x40')]())))[_0xb1cf('0x40')]();return _0x490684;};function _0x262b54(_0xe85674,_0x10e526){var _0xdc7d0=squel[_0xb1cf('0x36')]()[_0xb1cf('0x37')](_0xb1cf('0x38'))['fromQuery'](['phone',_0xb1cf('0x3a'),_0xb1cf('0x3b'),'ListId',_0x10e526,'createdAt',_0xb1cf('0x3d')],squel['select']()['field'](_0xb1cf('0x39'),'phone')['field'](_0xb1cf('0x41'),_0xb1cf('0x3a'))[_0xb1cf('0x3f')]('id',_0xb1cf('0x3b'))['field'](LISTID[_0xb1cf('0x40')](),_0xb1cf('0x27'))['field'](_0xe85674['id'][_0xb1cf('0x40')](),_0x10e526)[_0xb1cf('0x3f')](_0xb1cf('0x41'),_0xb1cf('0x3c'))['field'](_0xb1cf('0x41'),_0xb1cf('0x3d'))[_0xb1cf('0x45')](_0xb1cf('0x47'))[_0xb1cf('0x42')](_0xb1cf('0x43'))['where'](_0xb1cf('0x48'),LISTID['toString']())[_0xb1cf('0x42')](_0xb1cf('0x49'),squel[_0xb1cf('0x4a')](hopperContacts))['where'](_0xb1cf('0x44')))[_0xb1cf('0x40')]();return _0xdc7d0;}function _0x2c2362(_0x38351e,_0x59fa5c){var _0x5ed1fc=squel['insert']()[_0xb1cf('0x37')](_0xb1cf('0x4f'))[_0xb1cf('0x46')]([_0xb1cf('0x39'),_0xb1cf('0x3b'),'ListId',_0x59fa5c,_0xb1cf('0x3c'),_0xb1cf('0x3d')],squel['select']()[_0xb1cf('0x3f')](_0xb1cf('0x39'),_0xb1cf('0x39'))[_0xb1cf('0x3f')]('id','ContactId')[_0xb1cf('0x3f')](LISTID[_0xb1cf('0x40')](),_0xb1cf('0x27'))['field'](_0x38351e['id'][_0xb1cf('0x40')](),_0x59fa5c)['field'](_0xb1cf('0x41'),'createdAt')[_0xb1cf('0x3f')]('NOW()',_0xb1cf('0x3d'))[_0xb1cf('0x45')](_0xb1cf('0x47'))[_0xb1cf('0x42')](_0xb1cf('0x43'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0xb1cf('0x42')](_0xb1cf('0x49'),squel[_0xb1cf('0x4a')](hopperContacts))[_0xb1cf('0x42')](_0xb1cf('0x44')))[_0xb1cf('0x40')]();return _0x5ed1fc;}return db[_0xb1cf('0x50')][_0xb1cf('0x51')]({'where':{'type':_0xb1cf('0x52')},'attributes':['id',_0xb1cf('0x53')],'include':[{'model':db[_0xb1cf('0x54')],'as':_0xb1cf('0x55'),'where':{'id':LISTID}}]})[_0xb1cf('0x2f')](function(_0x3af313){var _0x393a47=[];if(_0x3af313){var _0x17a9ee;for(var _0x43a2a=0x0,_0xcdb601;_0x43a2a<_0x3af313[_0xb1cf('0x18')];_0x43a2a+=0x1){_0xcdb601=_0x3af313[_0x43a2a]['get']({'plain':!![]});switch(_0xcdb601[_0xb1cf('0x53')]){case _0xb1cf('0x56'):_0x393a47[_0xb1cf('0x57')](db[_0xb1cf('0x58')][_0xb1cf('0x59')](_0x153108(_0xcdb601,_0xb1cf('0x5a')))[_0xb1cf('0x2f')](function(){})[_0xb1cf('0x31')](_0x3053af()));break;case'onlyIfOpen':_0x393a47[_0xb1cf('0x57')](db[_0xb1cf('0x58')][_0xb1cf('0x59')](_0x451a22(_0xcdb601,'VoiceQueueId'))['then'](function(){})[_0xb1cf('0x31')](_0x3053af()));break;default:_0x393a47[_0xb1cf('0x57')](db[_0xb1cf('0x58')][_0xb1cf('0x59')](_0x262b54(_0xcdb601,_0xb1cf('0x5a')))[_0xb1cf('0x2f')](function(){})[_0xb1cf('0x31')](_0x3053af()));}}}return _0x393a47;})[_0xb1cf('0x5b')]()[_0xb1cf('0x2f')](function(){return db[_0xb1cf('0x50')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xb1cf('0x54')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xb1cf('0x2f')](function(_0x17b3bf){var _0x5a9d69=[];if(_0x17b3bf){var _0x34c49f;for(var _0x43af28=0x0,_0x4bad47;_0x43af28<_0x17b3bf[_0xb1cf('0x18')];_0x43af28+=0x1){_0x4bad47=_0x17b3bf[_0x43af28][_0xb1cf('0x5c')]({'plain':!![]});_0x5a9d69['push'](db[_0xb1cf('0x58')][_0xb1cf('0x59')](_0x2c2362(_0x4bad47,'VoiceQueueId'))[_0xb1cf('0x2f')](function(){})[_0xb1cf('0x31')](_0x3053af()));}}return _0x5a9d69;})[_0xb1cf('0x5b')]();})[_0xb1cf('0x2f')](function(){return db['Campaign'][_0xb1cf('0x51')]({'attributes':['id',_0xb1cf('0x53')],'include':[{'model':db['CmList'],'as':_0xb1cf('0x55'),'where':{'id':LISTID}}]})['then'](function(_0xb5cdf8){var _0x337136=[];if(_0xb5cdf8){for(var _0x366636=0x0,_0x79ff2;_0x366636<_0xb5cdf8[_0xb1cf('0x18')];_0x366636+=0x1){_0x79ff2=_0xb5cdf8[_0x366636]['get']({'plain':!![]});switch(_0x79ff2['dialCheckDuplicateType']){case'always':_0x337136[_0xb1cf('0x57')](db[_0xb1cf('0x58')][_0xb1cf('0x59')](_0x153108(_0x79ff2,'CampaignId'))[_0xb1cf('0x2f')](function(){})['catch'](_0x3053af()));break;case _0xb1cf('0x5d'):_0x337136[_0xb1cf('0x57')](db[_0xb1cf('0x58')][_0xb1cf('0x59')](_0x451a22(_0x79ff2,_0xb1cf('0x5e')))[_0xb1cf('0x2f')](function(){})['catch'](_0x3053af()));break;default:_0x337136[_0xb1cf('0x57')](db[_0xb1cf('0x58')][_0xb1cf('0x59')](_0x262b54(_0x79ff2,_0xb1cf('0x5e')))[_0xb1cf('0x2f')](function(){})[_0xb1cf('0x31')](_0x3053af()));}}}return _0x337136;})[_0xb1cf('0x5b')]();})[_0xb1cf('0x2f')](function(){return db[_0xb1cf('0x5f')][_0xb1cf('0x51')]({'attributes':['id'],'include':[{'model':db[_0xb1cf('0x54')],'as':_0xb1cf('0x60'),'where':{'id':LISTID}}]})[_0xb1cf('0x2f')](function(_0x462877){var _0x2e162d=[];if(_0x462877){for(var _0x1313c9=0x0,_0xe5f9ff;_0x1313c9<_0x462877[_0xb1cf('0x18')];_0x1313c9+=0x1){_0xe5f9ff=_0x462877[_0x1313c9][_0xb1cf('0x5c')]({'plain':!![]});_0x2e162d[_0xb1cf('0x57')](db[_0xb1cf('0x58')][_0xb1cf('0x59')](_0x2c2362(_0xe5f9ff,_0xb1cf('0x5e')))['then'](function(){})[_0xb1cf('0x31')](_0x3053af()));}}return _0x2e162d;})['all']();})[_0xb1cf('0x31')](function(_0x55b04a){logger[_0xb1cf('0x12')](_0xb1cf('0x61'),_0xb1cf('0x62'),_0x55b04a[_0xb1cf('0x1a')]);});}var processPromises=function(_0x4ca966){return BPromise[_0xb1cf('0x5b')](promises)['then'](function(_0x13e332){})[_0xb1cf('0x31')](function(_0x1ec54a){logger['error'](_0xb1cf('0x63'),JSON[_0xb1cf('0x33')](_0x1ec54a));})['finally'](function(){socket[_0xb1cf('0x64')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4ca966){return _0x4ca966[_0xb1cf('0x65')]();}});};var endCsv=function(){return BPromise[_0xb1cf('0x66')]()[_0xb1cf('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb1cf('0x67')](FILEPATH);}catch(_0x30f4ac){logger[_0xb1cf('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xb1cf('0x33')](_0x30f4ac));}finally{process[_0xb1cf('0x68')](0x0);}});};process['on'](_0xb1cf('0x69'),function(){logger[_0xb1cf('0x6a')](_0xb1cf('0x6b'));endCsv();});function main(){return BPromise[_0xb1cf('0x66')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb1cf('0x6c')](',');return db[_0xb1cf('0x2c')][_0xb1cf('0x51')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x2cb3ec){var _0x28ad26=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x28ad26,{'header':!![],'skipEmptyLines':!![],'step':function(_0x532658,_0x254755){total+=0x1;var _0x34621f=total;promises[_0xb1cf('0x57')](checkRow(_0x532658,_0x2cb3ec,_0x34621f)['then'](function(){success+=0x1;})['catch'](function(_0x2b62b4){if(_0x2b62b4[_0xb1cf('0x12')]){errors+=0x1;delete _0x2b62b4[_0xb1cf('0x12')];}else if(_0x2b62b4[_0xb1cf('0x2a')]){duplicates+=0x1;delete _0x2b62b4[_0xb1cf('0x2a')];}rows[_0xb1cf('0x57')](_0x2b62b4);}));if(total%0xc8===0x0){_0x254755[_0xb1cf('0x6d')]();return processPromises(_0x254755);}},'complete':function(){return processPromises()[_0xb1cf('0x2f')](function(){logger[_0xb1cf('0x6a')](_0xb1cf('0x6e'));endCsv();});},'error':function(_0x1a3601,_0x5b2e17){logger[_0xb1cf('0x6a')]('CSV\x20parse\x20error',JSON[_0xb1cf('0x33')](_0x1a3601));endCsv();}});})['catch'](function(_0x25b063){logger[_0xb1cf('0x12')](_0xb1cf('0x6f'),JSON[_0xb1cf('0x33')](_0x25b063));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index d4a3bfd..f825f26 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 _0x1ecd=['replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','description','appendFileSync','rows','emit','Abort\x20parser','abort','SystemError','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','each','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','join','.id\x20=\x20','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','all','split','length','push','isNil','filter','CmContactHasItem','update','create','PHONE','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','where','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','insert','into','cm_hopper_black','ContactId','field','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','recallme','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','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','catch','campaigns.id','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','main','send','start','root','server/files/tmp','.csv','header','name','_description','writeFileSync','parse','data','find','hasOwnProperty','trim'];(function(_0x88467b,_0x3c5135){var _0x2148a6=function(_0x87f2b4){while(--_0x87f2b4){_0x88467b['push'](_0x88467b['shift']());}};_0x2148a6(++_0x3c5135);}(_0x1ecd,0xee));var _0xd1ec=function(_0x4d94db,_0x5a2d71){_0x4d94db=_0x4d94db-0x0;var _0x41d157=_0x1ecd[_0x4d94db];return _0x41d157;};'use strict';var fs=require('fs');var path=require(_0xd1ec('0x0'));var _=require(_0xd1ec('0x1'));var Papa=require(_0xd1ec('0x2'));var util=require(_0xd1ec('0x3'));var BPromise=require(_0xd1ec('0x4'));var moment=require(_0xd1ec('0x5'));var squel=require('squel');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0xd1ec('0x6'));var shared=require('../../../config/environment/shared');var logger=require(_0xd1ec('0x7'))(_0xd1ec('0x8'));config[_0xd1ec('0x9')]=_['defaults'](config[_0xd1ec('0x9')],{'host':_0xd1ec('0xa'),'port':0x18eb});var socket=require(_0xd1ec('0xb'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xd1ec('0xc')](_0xd1ec('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xd1ec('0xc')](_0xd1ec('0xd'));function isEmail(_0x106720){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))*$/[_0xd1ec('0xe')](_0x106720);}function selectNotIn(_0x28d8e0,_0x55378d,_0x5dea10,_0x22db8e,_0x5d5624){return squel[_0xd1ec('0xf')]()['field'](_0xd1ec('0x10'))[_0xd1ec('0x11')](_0x22db8e)[_0xd1ec('0x12')](_0x55378d,null,_0x55378d+_0xd1ec('0x13')+_0x22db8e+'.'+_0x5dea10)['where'](_0x22db8e+'.'+_0x5dea10+_0xd1ec('0x14')+_0x28d8e0+'.'+_0x5dea10)['where'](_0x55378d+_0xd1ec('0x15')+_0x5d5624['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x187ebe,_0x175408){promisesAdditionalPhones=[];return db[_0xd1ec('0x16')][_0xd1ec('0x17')]({'raw':!![],'attributes':['id',_0xd1ec('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xd1ec('0x19')](function(_0x3559a7){if(_0x3559a7!==null){var _0xcf4b35=[];for(var _0x21308f=0x0;_0x21308f<_0x3559a7['length'];_0x21308f++){var _0x2f0582=_0x3559a7[_0x21308f];_0xcf4b35['push'](insertAdditionalPhones(_0x2f0582));}}Promise[_0xd1ec('0x1a')](_0xcf4b35)[_0xd1ec('0x19')](function(){_0x187ebe({'val':0x1});});});});}function insertAdditionalPhones(_0x3cfd20){return new Promise(function(_0x15408a,_0x3307a5){var _0x197f44=_0x3cfd20['AdditionalPhones'];var _0x4fef47=_0x197f44[_0xd1ec('0x1b')](';');var _0x32a058=[];orderBy=0x0;for(var _0xf05296=0x0;_0xf05296<_0x4fef47[_0xd1ec('0x1c')];_0xf05296++){_0x32a058[_0xd1ec('0x1d')](splitAdditionalPhone(_0x3cfd20['id'],_0x4fef47[_0xf05296]));}Promise[_0xd1ec('0x1a')](_0x32a058)[_0xd1ec('0x19')](function(){_0x15408a({'val':_0x4fef47[_0xd1ec('0x1c')]});});});}function splitAdditionalPhone(_0x49011e,_0x4a3ab6){return new Promise(function(_0xcc7ff8,_0x56afd7){var _0x406459=_0x4a3ab6['split'](':');var _0x3034c6=_0x406459[0x0];var _0x34f394=_0x406459[0x1];if(!_[_0xd1ec('0x1e')](_0x34f394)){var _0x4b9e45=_0x34f394['split']('|');var _0x578f5a=[];for(var _0x4ac36e=0x0;_0x4ac36e<_0x4b9e45['length'];_0x4ac36e++){if(_0x4b9e45[_0x4ac36e]!==''){var _0x52579f=_[_0xd1ec('0x1f')](promisesAdditionalPhones,{'contactId':_0x49011e,'phone':_0x4b9e45[_0x4ac36e]});if(_0x52579f[_0xd1ec('0x1c')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x49011e,'contactTypeId':_0x3034c6,'phone':_0x4b9e45[_0x4ac36e],'orderBy':orderBy});}}}_0xcc7ff8({'ok':0x1});}else _0xcc7ff8({'res':0x0});});}function createAdditionalPhone(_0xcec7e6,_0x481612,_0x291b0e,_0x3e0169){var _0x5041f2='';var _0x439157='';var _0x42b1ed=_0x291b0e[_0xd1ec('0x1b')]('§');_0x5041f2=_0x42b1ed[0x0];if(_0x42b1ed['length']==0x2)_0x439157=_0x42b1ed[0x1];return new Promise(function(_0x28bffb,_0x6283c4){return db[_0xd1ec('0x20')]['findOne']({'where':{'CmContactId':_0xcec7e6,'item':_0x5041f2}})[_0xd1ec('0x19')](function(_0x1a5af4){if(_0x1a5af4){return db['CmContactHasItem'][_0xd1ec('0x21')]({'ItemTypeId':_0x481612,'description':_0x439157,'OrderBy':_0x3e0169},{'where':{'CmContactId':_0xcec7e6,'item':_0x5041f2}})[_0xd1ec('0x19')](function(_0x4fc4e0){_0x28bffb({'res':'updated'});});}else{return db[_0xd1ec('0x20')][_0xd1ec('0x22')]({'CmContactId':_0xcec7e6,'item':_0x5041f2,'description':_0x439157,'ItemTypeId':_0x481612,'OrderBy':_0x3e0169,'ItemClass':_0xd1ec('0x23')})[_0xd1ec('0x19')](function(_0x350ce8){_0x28bffb({'res':'inserted'});});}});});}function insertCmHopper(_0x4e0d96,_0x10233c,_0x185e17,_0x12f7f4,_0x394430){var _0x2516ff=[_0xd1ec('0x24'),'cm_contacts.scheduledat',_0xd1ec('0x25'),_0xd1ec('0x26'),_0x10233c+'.'+_0x12f7f4,_0xd1ec('0x27'),_0xd1ec('0x28'),'cm_contacts.priority',_0xd1ec('0x29'),'\x22'+_0x394430+'\x22'];return squel['insert']()['into'](_0xd1ec('0x2a'))[_0xd1ec('0x2b')]([_0xd1ec('0x10'),_0xd1ec('0x2c'),'ContactId',_0xd1ec('0x2d'),_0x12f7f4,_0xd1ec('0x2e'),_0xd1ec('0x2f'),_0xd1ec('0x30'),_0xd1ec('0x31'),'recallme'],squel[_0xd1ec('0xf')]()[_0xd1ec('0x32')](_0x2516ff)[_0xd1ec('0x11')](_0x10233c)[_0xd1ec('0x12')](_0xd1ec('0x33'),null,_0xd1ec('0x34')+_0x10233c+_0xd1ec('0x35'))[_0xd1ec('0x12')](_0x185e17,null,_0x185e17+_0xd1ec('0x13')+_0x10233c+'.'+_0x12f7f4)[_0xd1ec('0x36')](_0x10233c+_0xd1ec('0x37'),_0x4e0d96)[_0xd1ec('0x36')](_0xd1ec('0x38'),NOW)[_0xd1ec('0x36')](_0xd1ec('0x39'),selectNotIn(_0x10233c,_0x185e17,_0x12f7f4,_0xd1ec('0x2a'),[_0xd1ec('0x3a'),_0xd1ec('0x3b')]))[_0xd1ec('0x36')](_0xd1ec('0x39'),selectNotIn(_0x10233c,_0x185e17,_0x12f7f4,_0xd1ec('0x2a'),[_0xd1ec('0x3a')])))[_0xd1ec('0x3c')]();}function insertCmHopperBlack(_0x1515bd,_0x11acaa,_0x94aaed,_0x190b0b){var _0xfa339f=[_0xd1ec('0x24'),_0xd1ec('0x25'),'cm_contacts.ListId',_0x11acaa+'.'+_0x190b0b,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0xd1ec('0x3d')]()[_0xd1ec('0x3e')](_0xd1ec('0x3f'))[_0xd1ec('0x2b')](['phone',_0xd1ec('0x40'),_0xd1ec('0x2d'),_0x190b0b,_0xd1ec('0x2e'),_0xd1ec('0x2f')],squel[_0xd1ec('0xf')]()[_0xd1ec('0x32')](_0xfa339f)[_0xd1ec('0x11')](_0x11acaa)[_0xd1ec('0x12')]('cm_contacts',null,_0xd1ec('0x34')+_0x11acaa+_0xd1ec('0x35'))[_0xd1ec('0x12')](_0x94aaed,null,_0x94aaed+'.id\x20=\x20'+_0x11acaa+'.'+_0x190b0b)[_0xd1ec('0x36')](_0x11acaa+_0xd1ec('0x37'),_0x1515bd)[_0xd1ec('0x36')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xd1ec('0x36')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xd1ec('0xf')]()[_0xd1ec('0x41')](_0xd1ec('0x10'))[_0xd1ec('0x11')](_0xd1ec('0x3f'))[_0xd1ec('0x36')](_0xd1ec('0x42'),_0x1515bd)[_0xd1ec('0x36')](_0x190b0b+_0xd1ec('0x14')+_0x11acaa+'.'+_0x190b0b)))['toString']();}function insertTzCmHopper(_0x3e70e7,_0x11e820,_0x1355dc,_0x2f5e44,_0xd168d2,_0x48e974){var _0x32f117=[_0xd1ec('0x24'),_0xd1ec('0x43')+_0x48e974+_0xd1ec('0x44'),_0xd1ec('0x25'),_0xd1ec('0x26'),_0x11e820+'.'+_0x2f5e44,_0xd1ec('0x27'),_0xd1ec('0x28'),_0xd1ec('0x45'),'cm_contacts.UserId','\x22'+_0xd168d2+'\x22'];var _0x49ec41=squel['insert']()[_0xd1ec('0x3e')]('cm_hopper')[_0xd1ec('0x2b')]([_0xd1ec('0x10'),'scheduledat',_0xd1ec('0x40'),'ListId',_0x2f5e44,_0xd1ec('0x2e'),_0xd1ec('0x2f'),'priority',_0xd1ec('0x31'),_0xd1ec('0x46')],squel['select']()[_0xd1ec('0x32')](_0x32f117)[_0xd1ec('0x11')](_0x11e820)['join'](_0xd1ec('0x33'),null,_0xd1ec('0x34')+_0x11e820+_0xd1ec('0x35'))[_0xd1ec('0x12')](_0x1355dc,null,_0x1355dc+_0xd1ec('0x13')+_0x11e820+'.'+_0x2f5e44)['join'](_0x48e974,null,_0x48e974+_0xd1ec('0x13')+_0x11e820+'.'+_0x2f5e44)['where'](_0x11e820+_0xd1ec('0x37'),_0x3e70e7)[_0xd1ec('0x36')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xd1ec('0x36')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x11e820,_0x1355dc,_0x2f5e44,'cm_hopper',['\x22always\x22',_0xd1ec('0x3b')]))['where'](_0xd1ec('0x39'),selectNotIn(_0x11e820,_0x1355dc,_0x2f5e44,_0xd1ec('0x2a'),[_0xd1ec('0x3a')])))[_0xd1ec('0x3c')]();return _0x49ec41;}function insertTzCmHopperBlack(_0x48d21d,_0x1906db,_0x2393c0,_0x47c9c1){var _0x269728=[_0xd1ec('0x24'),_0xd1ec('0x25'),_0xd1ec('0x26'),_0x1906db+'.'+_0x47c9c1,'cm_contacts.createdAt',_0xd1ec('0x28')];return squel[_0xd1ec('0x3d')]()[_0xd1ec('0x3e')](_0xd1ec('0x3f'))[_0xd1ec('0x2b')](['phone',_0xd1ec('0x40'),_0xd1ec('0x2d'),_0x47c9c1,'createdAt',_0xd1ec('0x2f')],squel[_0xd1ec('0xf')]()['fields'](_0x269728)[_0xd1ec('0x11')](_0x1906db)[_0xd1ec('0x12')](_0xd1ec('0x33'),null,_0xd1ec('0x34')+_0x1906db+'.CmListId')[_0xd1ec('0x12')](_0x2393c0,null,_0x2393c0+_0xd1ec('0x13')+_0x1906db+'.'+_0x47c9c1)[_0xd1ec('0x36')](_0x1906db+_0xd1ec('0x37'),_0x48d21d)[_0xd1ec('0x36')](_0xd1ec('0x38'),NOW)[_0xd1ec('0x36')](_0xd1ec('0x39'),squel[_0xd1ec('0xf')]()[_0xd1ec('0x41')](_0xd1ec('0x10'))[_0xd1ec('0x11')](_0xd1ec('0x3f'))[_0xd1ec('0x36')](_0xd1ec('0x42'),_0x48d21d)['where'](_0x47c9c1+_0xd1ec('0x14')+_0x1906db+'.'+_0x47c9c1)))[_0xd1ec('0x3c')]();}function insertCmHopperAdditionalPhones(_0x2726fc){var _0x4bde7f=[_0xd1ec('0x47'),'cm_contact_has_items.item',_0xd1ec('0x48'),_0xd1ec('0x49'),_0xd1ec('0x4a')];return squel[_0xd1ec('0x3d')]()['into'](_0xd1ec('0x4b'))[_0xd1ec('0x2b')]([_0xd1ec('0x4c'),_0xd1ec('0x10'),_0xd1ec('0x4d'),_0xd1ec('0x2e'),_0xd1ec('0x2f')],squel[_0xd1ec('0xf')]()['fields'](_0x4bde7f)[_0xd1ec('0x11')](_0xd1ec('0x2a'))[_0xd1ec('0x12')]('cm_contacts',null,_0xd1ec('0x4e'))['join']('cm_contact_has_items',null,_0xd1ec('0x4f'))[_0xd1ec('0x36')](_0xd1ec('0x50'),_0x2726fc)[_0xd1ec('0x36')](_0xd1ec('0x38'),NOW))[_0xd1ec('0x3c')]();}function insertCmContact(_0x1187de,_0x3dd07c,_0x4da9b4,_0x2aa975){var _0x35a5ca=_['concat'](_[_0xd1ec('0x51')](_0x2aa975),[_0xd1ec('0x2d'),_0xd1ec('0x52'),_0xd1ec('0x2e'),'updatedAt']);return squel['insert']()[_0xd1ec('0x3e')]('cm_contacts')[_0xd1ec('0x2b')](_0x35a5ca,squel[_0xd1ec('0xf')]()[_0xd1ec('0x32')](_0x35a5ca)[_0xd1ec('0x11')](_0x3dd07c)['where']('('+_0x4da9b4[_0xd1ec('0x12')](',')+_0xd1ec('0x53'),squel[_0xd1ec('0xf')]()['fields'](_0x4da9b4)[_0xd1ec('0x11')](_0xd1ec('0x33'))['where'](_0xd1ec('0x42'),_0x1187de)[_0xd1ec('0x36')](_0xd1ec('0x54')))[_0xd1ec('0x36')](_0xd1ec('0x55'),squel['select']()[_0xd1ec('0x41')](_0xd1ec('0x56'),'min_id')[_0xd1ec('0x11')](_0x3dd07c)[_0xd1ec('0x57')](_0x4da9b4[_0xd1ec('0x12')](','))))[_0xd1ec('0x3c')]();}function handleStop(){logger[_0xd1ec('0x58')](_0xd1ec('0x59'));stopped=!![];}function handleUncaughtException(_0x3d977b){logger[_0xd1ec('0x5a')](_0x3d977b[_0xd1ec('0x5b')]);process[_0xd1ec('0x5c')](0x1);}function handleError(_0x4c3aaf,_0x1a271a){stats[_0xd1ec('0x5d')][_0xd1ec('0x1d')]({'name':_0x1a271a[_0xd1ec('0x5e')],'message':_0x1a271a['message'],'row':_0x4c3aaf});}function handleQuery(_0x3c809f){logger['info'](_0x3c809f);return db[_0xd1ec('0x5f')][_0xd1ec('0x60')](_0x3c809f)[_0xd1ec('0x61')](function(_0x1b5f2c){results[_0xd1ec('0x1d')](_0x1b5f2c);})[_0xd1ec('0x62')](function(_0x43d7c7){logger['error'](_0x43d7c7[_0xd1ec('0x5b')]);});}function updateTzCampaigns(_0x3303cc){return new Promise(function(_0x51615b,_0x15490c){var _0x11921b=squel[_0xd1ec('0xf')]()[_0xd1ec('0x32')]([_0xd1ec('0x63'),'campaigns.dialTimezone'])[_0xd1ec('0x11')]('campaigns')['join']('campaigns_has_cm_lists',null,_0xd1ec('0x64'))[_0xd1ec('0x36')](_0xd1ec('0x65')+_0x3303cc);db[_0xd1ec('0x5f')][_0xd1ec('0x60')](_0x11921b[_0xd1ec('0x3c')]())['spread'](function(_0x24efc1){var _0x1fc621=[];for(var _0x420e36=0x0;_0x420e36<_0x24efc1[_0xd1ec('0x1c')];_0x420e36++){_0x1fc621['push'](getTimezoneData(_0x24efc1[_0x420e36],tmp_campaigns));}BPromise[_0xd1ec('0x1a')](_0x1fc621)['then'](function(){_0x51615b({'val':0x1});});})[_0xd1ec('0x62')](function(_0x2c6e24){logger[_0xd1ec('0x5a')](_0x2c6e24[_0xd1ec('0x5b')]);_0x51615b({'val':0x0});});});}function updateTzVoiceQueues(_0x91c60e){return new Promise(function(_0x409f3c,_0x30e88b){var _0x116b07=squel[_0xd1ec('0xf')]()['fields']([_0xd1ec('0x66'),_0xd1ec('0x67')])[_0xd1ec('0x11')](_0xd1ec('0x68'))[_0xd1ec('0x12')](_0xd1ec('0x69'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xd1ec('0x36')](_0xd1ec('0x6a')+_0x91c60e);db['sequelize'][_0xd1ec('0x60')](_0x116b07['toString']())[_0xd1ec('0x61')](function(_0x402287){var _0x172b50=[];for(var _0x1c6395=0x0;_0x1c6395<_0x402287[_0xd1ec('0x1c')];_0x1c6395++){_0x172b50['push'](getTimezoneData(_0x402287[_0x1c6395],tmp_voice_queues));}BPromise['all'](_0x172b50)[_0xd1ec('0x19')](function(){_0x409f3c({'val':0x1});});})[_0xd1ec('0x62')](function(_0x3d34db){logger[_0xd1ec('0x5a')](_0x3d34db[_0xd1ec('0x5b')]);_0x409f3c({'val':0x0});});});}function getTimezoneData(_0x2a1625,_0x56bd23){return new Promise(function(_0x56ee11,_0x4e44de){var _0x14800c=shared[_0xd1ec('0x6b')];var _0x2ac46f=_0x14800c[_0x2a1625[_0xd1ec('0x6c')]];if(_[_0xd1ec('0x1e')](_0x2ac46f)){_0x56ee11({'ret':0x1});}else{var _0x294b5d=_0x2ac46f[_0xd1ec('0x6d')];var _0x4a8a3a=squel[_0xd1ec('0x3d')]()[_0xd1ec('0x3e')](_0x56bd23)[_0xd1ec('0x6e')]('id',_0x2a1625['id'])[_0xd1ec('0x6e')]('offset',_0x294b5d)[_0xd1ec('0x6e')](_0xd1ec('0x6c'),_0x2a1625[_0xd1ec('0x6c')])[_0xd1ec('0x3c')]();return db[_0xd1ec('0x5f')][_0xd1ec('0x60')](_0x4a8a3a)[_0xd1ec('0x61')](function(_0x1c6dde){_0x56ee11({'ret':0x1});})[_0xd1ec('0x62')](function(_0x4130f3){logger[_0xd1ec('0x5a')](_0x4130f3['message']);_0x4e44de({'ret':0x1});});}});}function handleTZQuery(_0x297279){logger[_0xd1ec('0x58')](_0x297279);return db['sequelize']['query'](_0x297279)[_0xd1ec('0x61')](function(_0x3ace24){})[_0xd1ec('0x62')](function(_0xbafe28){logger[_0xd1ec('0x5a')](_0xbafe28[_0xd1ec('0x5b')]);});}function main(_0x2a5ba2,_0x96a9f2,_0x17d594,_0x1decc8){logger[_0xd1ec('0x58')](_0xd1ec('0x6f'),_0x2a5ba2,JSON['stringify'](_0x96a9f2));process[_0xd1ec('0x70')](_0xd1ec('0x71'));var _0x1e4ad3=_0x96a9f2['binding'];var _0x2ce821=_['clone'](_0x1e4ad3);var _0x1187af=_0x96a9f2['socket_timestamp'];var _0xe8bc70=path[_0xd1ec('0x12')](config[_0xd1ec('0x72')],_0xd1ec('0x73'),_0x1187af+_0xd1ec('0x74'));hasTZ=_[_0xd1ec('0x51')](_0x1e4ad3)['includes'](_0xd1ec('0x6c'));var _0x5b914b=_[_0xd1ec('0x51')](_0x1e4ad3)[_0xd1ec('0x12')]();logger[_0xd1ec('0x58')](_0xd1ec('0x75'),_0x5b914b);db['ContactItemType'][_0xd1ec('0x17')]({'raw':!![],'attributes':['id',_0xd1ec('0x76')]})[_0xd1ec('0x19')](function(_0x407882){for(var _0x4c5e6e=0x0;_0x4c5e6e<_0x407882['length'];_0x4c5e6e++){if(_0x407882[_0x4c5e6e][_0xd1ec('0x76')]in _0x1e4ad3){contactItemTypes[_0xd1ec('0x1d')](_0x407882[_0x4c5e6e]);delete _0x2ce821[_0x407882[_0x4c5e6e][_0xd1ec('0x76')]];hasAdditionalPhones=!![];}for(var _0x1fb364 in _0x1e4ad3){if(_0x407882[_0x4c5e6e][_0xd1ec('0x76')]+_0xd1ec('0x77')===_0x1fb364){phoneDescriptions[_0xd1ec('0x1d')]({'itemTypeId':_0x407882[_0x4c5e6e]['id'],'description':_0x1fb364});delete _0x2ce821[_0x1fb364];}}}if(hasAdditionalPhones)_0x2ce821[_0xd1ec('0x18')]='';var _0xfc690a=_[_0xd1ec('0x51')](_0x2ce821)['join']();logger[_0xd1ec('0x58')](_0xd1ec('0x75'),_0xfc690a);fs[_0xd1ec('0x78')](_0xe8bc70,_0xfc690a+'\x0a');Papa[_0xd1ec('0x79')](fs['createReadStream'](_0x2a5ba2),{'header':!![],'skipEmptyLines':!![],'step':function(_0x436d6e,_0x37b451){try{for(var _0x11b6c0=0x0,_0x1bcd02=[];_0x11b6c0<_0x436d6e[_0xd1ec('0x7a')][_0xd1ec('0x1c')];_0x11b6c0++){stats['rows']+=0x1;if(_0x436d6e[_0xd1ec('0x5d')][_0x11b6c0]){handleError(_0x436d6e[_0xd1ec('0x7a')][_0x11b6c0],_0x436d6e[_0xd1ec('0x5d')][_0x11b6c0]);}else{var _0x5f2c65=[];var _0x152e91=[];var _0x4fa1a9={};for(var _0x41f6ab in _0x1e4ad3){let _0x30cad5=contactItemTypes[_0xd1ec('0x7b')](_0x150b4f=>_0x150b4f[_0xd1ec('0x76')]===_0x41f6ab);let _0x50b3ae=contactItemTypes[_0xd1ec('0x7b')](_0x1da590=>_0x1da590[_0xd1ec('0x76')]+_0xd1ec('0x77')===_0x41f6ab);if(_[_0xd1ec('0x1e')](_0x30cad5)&&_[_0xd1ec('0x1e')](_0x50b3ae)){if(_0x1e4ad3[_0xd1ec('0x7c')](_0x41f6ab)){if(_0x436d6e[_0xd1ec('0x7a')][_0x11b6c0][_0x1e4ad3[_0x41f6ab]]){var _0x373f1a=_[_0xd1ec('0x7d')](_0x436d6e[_0xd1ec('0x7a')][_0x11b6c0][_0x1e4ad3[_0x41f6ab]][_0xd1ec('0x7e')](/"/g,'\x27'));switch(_0x41f6ab){case _0xd1ec('0x2c'):var _0x3bddb8=moment(_0x373f1a,_0xd1ec('0xd'),!![]);if(_0x3bddb8[_0xd1ec('0x7f')]()){_0x1bcd02[_0xd1ec('0x1d')]('\x22'+_0x373f1a+'\x22');}else{_0x5f2c65[_0xd1ec('0x1d')](_0xd1ec('0x80'));}break;case'priority':var _0x26bbd2=parseInt(_0x373f1a);_0x373f1a=_[_0xd1ec('0x81')](_0x26bbd2)||_0x26bbd2<0x0||_0x26bbd2>0x4?_0x1decc8?0x3:0x2:_0x26bbd2;_0x1bcd02[_0xd1ec('0x1d')]('\x22'+_0x373f1a+'\x22');break;case'UserId':var _0x5316b5=parseInt(_0x373f1a);if(_[_0xd1ec('0x82')](_0x5316b5)&&_['includes'](_0x17d594,_0x5316b5)){_0x1bcd02[_0xd1ec('0x1d')]('\x22'+_0x5316b5+'\x22');}else{_0x5f2c65[_0xd1ec('0x1d')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x373f1a)){_0x1bcd02[_0xd1ec('0x1d')]('\x22'+_0x373f1a+'\x22');}else{_0x5f2c65[_0xd1ec('0x1d')](_0xd1ec('0x83'));}break;case _0xd1ec('0x84'):var _0x13fef8=moment(_0x373f1a,_0xd1ec('0x85'),!![]);if(_0x13fef8[_0xd1ec('0x7f')]()){_0x1bcd02[_0xd1ec('0x1d')]('\x22'+_0x373f1a+'\x22');}else{_0x5f2c65['push'](_0xd1ec('0x86'));}break;case _0xd1ec('0x6c'):var _0x580bcf=shared[_0xd1ec('0x6b')];var _0x513244=_0x580bcf[_0x373f1a];if(!_['isNil'](_0x513244)){var _0x4ba0c8=_0x513244[_0xd1ec('0x6d')];_0x1bcd02[_0xd1ec('0x1d')]('\x22'+_0x373f1a+'\x22');_0x1bcd02['push']('\x22'+_0x4ba0c8+'\x22');}break;default:_0x1bcd02[_0xd1ec('0x1d')]('\x22'+_0x373f1a+'\x22');}}else{switch(_0x41f6ab){case _0xd1ec('0x87'):case _0xd1ec('0x10'):_0x5f2c65[_0xd1ec('0x1d')](_0x41f6ab+_0xd1ec('0x88'));break;default:_0x1bcd02[_0xd1ec('0x1d')]('\x22\x22');}}}}else{var _0x400840='';if(!_['isNil'](_0x30cad5)){if(!_0x4fa1a9[_0xd1ec('0x7c')](_0x30cad5['id'])){if(!_[_0xd1ec('0x1e')](_0x436d6e[_0xd1ec('0x7a')][_0x11b6c0][_0x1e4ad3[_0x41f6ab]])){var _0x373f1a=_[_0xd1ec('0x7d')](_0x436d6e[_0xd1ec('0x7a')][_0x11b6c0][_0x1e4ad3[_0x41f6ab]]['replace'](/"/g,'\x27'));var _0x25bf9b=phoneDescriptions['find'](_0x276309=>_0x276309[_0xd1ec('0x89')]===_0x30cad5['id']);if(!_[_0xd1ec('0x1e')](_0x25bf9b)){var _0x4c07a5=_[_0xd1ec('0x7d')](_0x436d6e[_0xd1ec('0x7a')][_0x11b6c0][_0x1e4ad3[_0x25bf9b[_0xd1ec('0x8a')]]][_0xd1ec('0x7e')](/"/g,'\x27'));if(!_[_0xd1ec('0x1e')](_0x4c07a5))_0x373f1a=_0x373f1a+'§'+_0x4c07a5;}if(_0x400840=='')_0x400840=_0x373f1a;else _0x400840+='|'+_0x373f1a;}_0x152e91[_0xd1ec('0x1d')](_0x30cad5['id']+':'+_0x400840);_0x4fa1a9[_0x30cad5['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1bcd02['push']('\x22'+_0x152e91['join'](';')+'\x22');}if(_0x5f2c65[_0xd1ec('0x1c')]){handleError(_0x436d6e['data'][_0x11b6c0],{'code':'SystemRow','message':_0x5f2c65[_0xd1ec('0x12')]()});}else{fs[_0xd1ec('0x8b')](_0xe8bc70,_0x1bcd02[_0xd1ec('0x12')]()+'\x0a');}_0x1bcd02=[];}if(!(stats[_0xd1ec('0x8c')]%0xc8)){socket[_0xd1ec('0x8d')]('contact:import:'+_0x1187af,stats);stats[_0xd1ec('0x5d')]=[];}}if(stopped){logger[_0xd1ec('0x58')](_0xd1ec('0x8e'));_0x37b451[_0xd1ec('0x8f')]();}}catch(_0x3cb2f7){handleError(_0x436d6e[_0xd1ec('0x7a')][_0x11b6c0],{'code':_0xd1ec('0x90'),'message':_0x3cb2f7['message']});logger[_0xd1ec('0x5a')](_0xd1ec('0x91'),_0x3cb2f7['message']);}},'complete':function(){try{var _0x5d732c=[];var _0x118660=[];var _0x5f1367=_0xd1ec('0x33');if(_0x96a9f2[_0xd1ec('0x92')]&&_0x96a9f2[_0xd1ec('0x92')][_0xd1ec('0x1c')]){_0x5f1367='cm_contacts_'+_0x1187af;_0x5d732c[_0xd1ec('0x1d')](_0xd1ec('0x93')+_0x5f1367+_0xd1ec('0x94'));}tmp_campaigns=_0xd1ec('0x95')+_0x1187af;tmp_voice_queues=_0xd1ec('0x96')+_0x1187af;_0x118660['push']('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x118660[_0xd1ec('0x1d')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0xd1ec('0x97'));BPromise['each'](_0x118660,handleTZQuery)[_0xd1ec('0x19')](function(_0x6fcc14){updateTzCampaigns(_0x96a9f2['ListId'])[_0xd1ec('0x19')](function(_0x19acf5){updateTzVoiceQueues(_0x96a9f2[_0xd1ec('0x2d')])[_0xd1ec('0x19')](function(_0x43a082){if(hasTZ)_0xfc690a=_0xfc690a['replace']('dialTimezone',_0xd1ec('0x98'));var _0x221be9=util[_0xd1ec('0xc')]('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',_0xe8bc70,_0x5f1367,_0xfc690a,_0x96a9f2[_0xd1ec('0x2d')],_0x96a9f2['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x1e4ad3[_0xd1ec('0x2c')])){_0x221be9+=',\x20scheduledAt\x20=\x20NOW()';}_0x5d732c[_0xd1ec('0x1d')](_0x221be9);if(_0x96a9f2['duplicates']&&_0x96a9f2[_0xd1ec('0x92')][_0xd1ec('0x1c')]){_0x5d732c[_0xd1ec('0x1d')](insertCmContact(_0x96a9f2[_0xd1ec('0x2d')],_0x5f1367,_0x96a9f2[_0xd1ec('0x92')],_0x1e4ad3));_0x5d732c[_0xd1ec('0x1d')]('DROP\x20TABLE\x20'+_0x5f1367+';');}BPromise['each'](_0x5d732c,handleQuery)[_0xd1ec('0x19')](function(_0x1b7d31){BPromise[_0xd1ec('0x1a')]([handleAdditionalPhones()])[_0xd1ec('0x19')](function(){_0x5d732c=[];for(var _0x391dc9=0x0;_0x391dc9_0x392ee8[_0x1780('0x80')]===_0x395774);let _0x1e914d=contactItemTypes[_0x1780('0x83')](_0xa0a459=>_0xa0a459[_0x1780('0x80')]+_0x1780('0x84')===_0x395774);if(_['isNil'](_0x43a2d3)&&_[_0x1780('0x20')](_0x1e914d)){if(_0x26a89c[_0x1780('0x85')](_0x395774)){if(_0x2731f4[_0x1780('0x86')][_0xeb8611][_0x26a89c[_0x395774]]){var _0x45dd69=_[_0x1780('0x87')](_0x2731f4[_0x1780('0x86')][_0xeb8611][_0x26a89c[_0x395774]][_0x1780('0x88')](/"/g,'\x27'));switch(_0x395774){case'scheduledat':var _0x3f4157=moment(_0x45dd69,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3f4157[_0x1780('0x89')]()){_0x725522[_0x1780('0x1c')]('\x22'+_0x45dd69+'\x22');}else{_0x1e91bf['push'](_0x1780('0x8a'));}break;case'priority':var _0x902cac=parseInt(_0x45dd69);_0x45dd69=_[_0x1780('0x8b')](_0x902cac)||_0x902cac<0x0||_0x902cac>0x4?_0x38a955?0x3:0x2:_0x902cac;_0x725522['push']('\x22'+_0x45dd69+'\x22');break;case _0x1780('0x39'):var _0x5b8a57=parseInt(_0x45dd69);if(_[_0x1780('0x8c')](_0x5b8a57)&&_[_0x1780('0x7d')](_0x1719ec,_0x5b8a57)){_0x725522['push']('\x22'+_0x5b8a57+'\x22');}else{_0x1e91bf['push']('agent\x20not\x20exists');}break;case _0x1780('0x8d'):if(isEmail(_0x45dd69)){_0x725522['push']('\x22'+_0x45dd69+'\x22');}else{_0x1e91bf[_0x1780('0x1c')](_0x1780('0x8e'));}break;case _0x1780('0x8f'):var _0x172b6f=moment(_0x45dd69,_0x1780('0x90'),!![]);if(_0x172b6f[_0x1780('0x89')]()){_0x725522[_0x1780('0x1c')]('\x22'+_0x45dd69+'\x22');}else{_0x1e91bf[_0x1780('0x1c')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x1780('0x75'):var _0x2e9910=shared[_0x1780('0x74')];var _0x3a3ea8=_0x2e9910[_0x45dd69];if(!_[_0x1780('0x20')](_0x3a3ea8)){var _0x3180d0=_0x3a3ea8[_0x1780('0x91')];_0x725522[_0x1780('0x1c')]('\x22'+_0x45dd69+'\x22');_0x725522[_0x1780('0x1c')]('\x22'+_0x3180d0+'\x22');}break;default:_0x725522[_0x1780('0x1c')]('\x22'+_0x45dd69+'\x22');}}else{switch(_0x395774){case _0x1780('0x92'):case'phone':_0x1e91bf['push'](_0x395774+_0x1780('0x93'));break;default:_0x725522[_0x1780('0x1c')]('\x22\x22');}}}}else{var _0x303b0a='';if(!_[_0x1780('0x20')](_0x43a2d3)){if(!_0x4b5bbd['hasOwnProperty'](_0x43a2d3['id'])){if(!_[_0x1780('0x20')](_0x2731f4[_0x1780('0x86')][_0xeb8611][_0x26a89c[_0x395774]])){var _0x45dd69=_[_0x1780('0x87')](_0x2731f4[_0x1780('0x86')][_0xeb8611][_0x26a89c[_0x395774]][_0x1780('0x88')](/"/g,'\x27'));var _0x39c0f3=phoneDescriptions[_0x1780('0x83')](_0x5af5c0=>_0x5af5c0[_0x1780('0x94')]===_0x43a2d3['id']);if(!_[_0x1780('0x20')](_0x39c0f3)){var _0x909c49=_[_0x1780('0x87')](_0x2731f4[_0x1780('0x86')][_0xeb8611][_0x26a89c[_0x39c0f3[_0x1780('0x95')]]]['replace'](/"/g,'\x27'));if(!_[_0x1780('0x20')](_0x909c49))_0x45dd69=_0x45dd69+'§'+_0x909c49;}if(_0x303b0a=='')_0x303b0a=_0x45dd69;else _0x303b0a+='|'+_0x45dd69;}_0x303e20['push'](_0x43a2d3['id']+':'+_0x303b0a);_0x4b5bbd[_0x43a2d3['id']]=0x1;}}}}if(hasAdditionalPhones){_0x725522[_0x1780('0x1c')]('\x22'+_0x303e20['join'](';')+'\x22');}if(_0x1e91bf[_0x1780('0x1f')]){handleError(_0x2731f4[_0x1780('0x86')][_0xeb8611],{'code':_0x1780('0x96'),'message':_0x1e91bf['join']()});}else{fs['appendFileSync'](_0x4856f2,_0x725522[_0x1780('0x18')]()+'\x0a');}_0x725522=[];}if(!(stats[_0x1780('0x82')]%0xc8)){socket[_0x1780('0x97')](_0x1780('0x98')+_0x1c475d,stats);stats[_0x1780('0x64')]=[];}}if(stopped){logger[_0x1780('0x5f')](_0x1780('0x99'));_0x446384['abort']();}}catch(_0x1b403e){handleError(_0x2731f4[_0x1780('0x86')][_0xeb8611],{'code':_0x1780('0x9a'),'message':_0x1b403e['message']});logger[_0x1780('0x61')](_0x1780('0x9b'),_0x1b403e[_0x1780('0x62')]);}},'complete':function(){try{var _0x4806e4=[];var _0x4f3185=[];var _0x59cdb9='cm_contacts';if(_0x34cee0[_0x1780('0x9c')]&&_0x34cee0[_0x1780('0x9c')]['length']){_0x59cdb9=_0x1780('0x9d')+_0x1c475d;_0x4806e4[_0x1780('0x1c')](_0x1780('0x9e')+_0x59cdb9+_0x1780('0x9f'));}tmp_campaigns=_0x1780('0xa0')+_0x1c475d;tmp_voice_queues='voice_queues_'+_0x1c475d;_0x4f3185[_0x1780('0x1c')](_0x1780('0x9e')+tmp_campaigns+_0x1780('0xa1'));_0x4f3185['push'](_0x1780('0x9e')+tmp_voice_queues+_0x1780('0xa1'));BPromise['each'](_0x4f3185,handleTZQuery)['then'](function(_0x2f1b11){updateTzCampaigns(_0x34cee0['ListId'])[_0x1780('0x1b')](function(_0x4b3779){updateTzVoiceQueues(_0x34cee0[_0x1780('0x35')])[_0x1780('0x1b')](function(_0x1b45d1){if(hasTZ)_0x59658b=_0x59658b[_0x1780('0x88')]('dialTimezone','dialTimezone,utcOffset');var _0x1078f2=util[_0x1780('0xf')]('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',_0x4856f2,_0x59cdb9,_0x59658b,_0x34cee0[_0x1780('0x35')],_0x34cee0[_0x1780('0x58')]||null,NOW,NOW);if(_[_0x1780('0x20')](_0x26a89c[_0x1780('0x33')])){_0x1078f2+=_0x1780('0xa2');}_0x4806e4[_0x1780('0x1c')](_0x1078f2);if(_0x34cee0[_0x1780('0x9c')]&&_0x34cee0[_0x1780('0x9c')][_0x1780('0x1f')]){_0x4806e4[_0x1780('0x1c')](insertCmContact(_0x34cee0[_0x1780('0x35')],_0x59cdb9,_0x34cee0[_0x1780('0x9c')],_0x26a89c));_0x4806e4[_0x1780('0x1c')]('DROP\x20TABLE\x20'+_0x59cdb9+';');}BPromise['each'](_0x4806e4,handleQuery)['then'](function(_0x5698cc){BPromise[_0x1780('0x1d')]([handleAdditionalPhones()])['then'](function(){_0x4806e4=[];for(var _0x945b8=0x0;_0x945b8\x20\x20');}var _0x1046a5=path['join'](config[_0x1780('0x7a')],_0x1780('0x7b'),process['argv'][0x2]);if(!fs[_0x1780('0xb0')](_0x1046a5)){throw new Error(_0x1780('0xb1'));}var _0x59f123={};try{_0x59f123=JSON[_0x1780('0xb2')](process[_0x1780('0xaf')][0x3]);if(!_0x59f123[_0x1780('0xb3')]){throw new Error(_0x1780('0xb4'));}if(!_0x59f123[_0x1780('0xb3')]['phone']){throw new Error(_0x1780('0xb5'));}if(!_0x59f123[_0x1780('0xb3')][_0x1780('0x92')]){throw new Error(_0x1780('0xb6'));}var _0x35ce0a=0x0;if(_0x59f123[_0x1780('0xb3')][_0x1780('0x39')]){_0x35ce0a=0x1;}if(!_0x59f123[_0x1780('0x35')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x216c6e){throw new Error(_0x1780('0xb7'));}var _0x22947c=[];try{_0x22947c=_['map'](JSON[_0x1780('0xb2')](process[_0x1780('0xaf')][0x4]),'id');}catch(_0x31fa5d){logger[_0x1780('0x5f')](_0x1780('0xb8'));}main(_0x1046a5,_0x59f123,_0x22947c,_0x35ce0a);}validate();process['on'](_0x1780('0xb9'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index 1686f0f..35fe53d 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27d7=['affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','binding','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','papaparse','util','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','then','catch','error','split','push','all','CmContactHasItem','findOne','update','updated','PHONE','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.priority','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.ListId','insert','\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_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','MIN(id)','min_id','group','toString','info','Received\x20SIGINT','message','exit','errors','main','start','clone','socket_timestamp','root','server/files/tmp','.csv','ContactItemType','name','_description','header','data','rows','find','trim','replace','isValid','isNaN','isNumber','email','email\x20wrong\x20format','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','hasOwnProperty','SystemRow','appendFileSync','emit','Abort\x20parser','abort','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactTypeId','orderBy'];(function(_0x2ba89c,_0x714fd4){var _0x1c7015=function(_0x3514ff){while(--_0x3514ff){_0x2ba89c['push'](_0x2ba89c['shift']());}};_0x1c7015(++_0x714fd4);}(_0x27d7,0xa4));var _0x727d=function(_0x20073b,_0x9c031e){_0x20073b=_0x20073b-0x0;var _0x428d14=_0x27d7[_0x20073b];return _0x428d14;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0x727d('0x0'));var util=require(_0x727d('0x1'));var BPromise=require('bluebird');var moment=require(_0x727d('0x2'));var squel=require('squel');var Redis=require(_0x727d('0x3'));var db=require(_0x727d('0x4'))['db'];var config=require(_0x727d('0x5'));var logger=require(_0x727d('0x6'))('import');config[_0x727d('0x7')]=_['defaults'](config[_0x727d('0x7')],{'host':_0x727d('0x8'),'port':0x18eb});var socket=require(_0x727d('0x9'))(new Redis(config[_0x727d('0x7')]));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()[_0x727d('0xa')](_0x727d('0xb'));var tempTableName=_0x727d('0xc')+moment()[_0x727d('0xa')](_0x727d('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x1e8f01){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))*$/[_0x727d('0xe')](_0x1e8f01);}function selectNotIn(_0x2d2b96,_0x584013,_0x3ba3e3,_0x93e600,_0x17e569){return squel[_0x727d('0xf')]()[_0x727d('0x10')](_0x727d('0x11'))[_0x727d('0x12')](_0x93e600)[_0x727d('0x13')](_0x584013,null,_0x584013+_0x727d('0x14')+_0x93e600+'.'+_0x3ba3e3)[_0x727d('0x15')](_0x93e600+'.'+_0x3ba3e3+_0x727d('0x16')+_0x2d2b96+'.'+_0x3ba3e3)['where'](_0x584013+_0x727d('0x17')+_0x17e569[_0x727d('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x50d715,_0x3e6f41){promisesAdditionalPhones=[];promisesContact=[];return db[_0x727d('0x18')][_0x727d('0x19')](_0x727d('0x1a')+tempTableName)[_0x727d('0x1b')](function(_0xa0ea9){if(_0xa0ea9!==null){var _0x38b18e=[];for(var _0x28aeac=0x0;_0x28aeac<_0xa0ea9[_0x727d('0x1c')];_0x28aeac++){var _0x2e2ab2=_0xa0ea9[_0x28aeac];if(!_[_0x727d('0x1d')](_0x2e2ab2[_0x727d('0x11')])){if(!_['isNil'](_0x2e2ab2[_0x727d('0x1e')]))_0x38b18e['push'](insertAdditionalPhones(_0x2e2ab2));promisesContact['push']({'contact':_0x2e2ab2});}}}Promise['all'](_0x38b18e)[_0x727d('0x1f')](function(){_0x50d715({'val':0x1});});})[_0x727d('0x20')](function(_0x1766b4){logger[_0x727d('0x21')](_0x1766b4['message']);});});}function insertAdditionalPhones(_0x375076){return new Promise(function(_0xaf227f,_0x3da477){var _0x560558=_0x375076[_0x727d('0x1e')];if(_[_0x727d('0x1d')](_0x560558))_0x3da477({'val':0x0});else{var _0x33a2c9=_0x560558[_0x727d('0x22')](';');var _0x2bbc28=[];orderBy=0x0;for(var _0xa7a71c=0x0;_0xa7a71c<_0x33a2c9['length'];_0xa7a71c++){_0x2bbc28[_0x727d('0x23')](splitAdditionalPhone(_0x375076['id'],_0x33a2c9[_0xa7a71c]));}Promise[_0x727d('0x24')](_0x2bbc28)[_0x727d('0x1f')](function(){_0xaf227f({'val':_0x33a2c9['length']});});}});}function splitAdditionalPhone(_0x4db768,_0x102355){return new Promise(function(_0x41e0cc,_0x1fc6fc){var _0x449fee=_0x102355[_0x727d('0x22')](':');var _0x1d1e49=_0x449fee[0x0];var _0xb37f1e=_0x449fee[0x1];if(_0xb37f1e!==''){var _0x4a5404=_0xb37f1e[_0x727d('0x22')]('|');var _0x4c1807=[];for(var _0x5b5707=0x0;_0x5b5707<_0x4a5404['length'];_0x5b5707++){if(_0x4a5404[_0x5b5707]!==''){var _0x2aeaa7=_['filter'](promisesAdditionalPhones,{'contactId':_0x4db768,'phone':_0x4a5404[_0x5b5707]});if(_0x2aeaa7[_0x727d('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0x727d('0x23')]({'contactId':_0x4db768,'contactTypeId':_0x1d1e49,'phone':_0x4a5404[_0x5b5707],'orderBy':orderBy});}}}_0x41e0cc({'ok':0x1});}else _0x41e0cc({'res':0x0});});}function createAdditionalPhone(_0x1013cc,_0x4a8fb1,_0x43e66a,_0x1d3d3f){var _0x2e34ec='';var _0x40d3fd='';var _0x42c8fa=_0x43e66a['split']('§');_0x2e34ec=_0x42c8fa[0x0];if(_0x42c8fa[_0x727d('0x1c')]==0x2)_0x40d3fd=_0x42c8fa[0x1];return new Promise(function(_0x2e49d3,_0x51df23){return db[_0x727d('0x25')][_0x727d('0x26')]({'where':{'CmContactId':_0x1013cc,'item':_0x2e34ec}})[_0x727d('0x1f')](function(_0xf5c855){if(_0xf5c855){return db[_0x727d('0x25')][_0x727d('0x27')]({'ItemTypeId':_0x4a8fb1,'description':_0x40d3fd,'OrderBy':_0x1d3d3f},{'where':{'CmContactId':_0x1013cc,'item':_0x2e34ec}})['then'](function(_0x418abc){_0x2e49d3({'res':_0x727d('0x28')});});}else{return db[_0x727d('0x25')]['create']({'CmContactId':_0x1013cc,'item':_0x2e34ec,'ItemTypeId':_0x4a8fb1,'description':_0x40d3fd,'OrderBy':_0x1d3d3f,'ItemClass':_0x727d('0x29')})[_0x727d('0x1f')](function(_0x1b878f){_0x2e49d3({'res':'inserted'});});}});});}function updateContact(_0x1bab0a){return new Promise(function(_0x4a5f2a,_0x32b1c4){var _0x539dca=_0x1bab0a['id'];delete _0x1bab0a['id'];return db[_0x727d('0x2a')][_0x727d('0x27')](_0x1bab0a,{'where':{'id':_0x539dca}})[_0x727d('0x1f')](function(_0x2f47e3){updatedRows+=0x1;return db[_0x727d('0x2b')][_0x727d('0x27')]({'phone':_0x1bab0a[_0x727d('0x11')]},{'where':{'ContactId':_0x539dca}})[_0x727d('0x1f')](function(_0x5e6f34){_0x4a5f2a({'ret':'OK'});});});});}function insertCmHopper(_0x406f4,_0x3aa70b,_0x3bd494,_0x26801a,_0xa47b6f){var _0x156bcc=[_0x727d('0x2c'),_0x727d('0x2d'),_0x727d('0x2e'),'cm_contacts.ListId',_0x3aa70b+'.'+_0x26801a,'cm_contacts.createdAt',_0x727d('0x2f'),_0x727d('0x30'),'cm_contacts.UserId','\x22'+_0xa47b6f+'\x22'];return squel['insert']()[_0x727d('0x31')](_0x727d('0x32'))[_0x727d('0x33')]([_0x727d('0x11'),'scheduledat',_0x727d('0x34'),_0x727d('0x35'),_0x26801a,_0x727d('0x36'),_0x727d('0x37'),_0x727d('0x38'),'UserId','recallme'],squel[_0x727d('0xf')]()[_0x727d('0x39')](_0x156bcc)['from'](_0x3aa70b)[_0x727d('0x13')](_0x727d('0x3a'),null,_0x727d('0x3b')+_0x3aa70b+'.CmListId')[_0x727d('0x13')](_0x3bd494,null,_0x3bd494+_0x727d('0x14')+_0x3aa70b+'.'+_0x26801a)[_0x727d('0x15')](_0x3aa70b+_0x727d('0x3c'),_0x406f4)[_0x727d('0x15')](_0x727d('0x3d'),NOW)[_0x727d('0x15')](_0x727d('0x3e'),selectNotIn(_0x3aa70b,_0x3bd494,_0x26801a,_0x727d('0x32'),[_0x727d('0x3f'),_0x727d('0x40')]))[_0x727d('0x15')](_0x727d('0x3e'),selectNotIn(_0x3aa70b,_0x3bd494,_0x26801a,_0x727d('0x32'),[_0x727d('0x3f')])))['toString']();}function insertCmHopperBlack(_0x4a20e9,_0x483dd8,_0xf8508e,_0xbe0c32){var _0xfafb8=['cm_contacts.phone','cm_contacts.id',_0x727d('0x41'),_0x483dd8+'.'+_0xbe0c32,'cm_contacts.createdAt',_0x727d('0x2f')];return squel[_0x727d('0x42')]()[_0x727d('0x31')]('cm_hopper_black')[_0x727d('0x33')]([_0x727d('0x11'),'ContactId',_0x727d('0x35'),_0xbe0c32,'createdAt',_0x727d('0x37')],squel[_0x727d('0xf')]()[_0x727d('0x39')](_0xfafb8)[_0x727d('0x12')](_0x483dd8)[_0x727d('0x13')](_0x727d('0x3a'),null,_0x727d('0x3b')+_0x483dd8+'.CmListId')['join'](_0xf8508e,null,_0xf8508e+_0x727d('0x14')+_0x483dd8+'.'+_0xbe0c32)[_0x727d('0x15')](_0x483dd8+_0x727d('0x3c'),_0x4a20e9)[_0x727d('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x727d('0x15')](_0x727d('0x3e'),squel['select']()[_0x727d('0x10')](_0x727d('0x11'))[_0x727d('0x12')]('cm_hopper_black')[_0x727d('0x15')]('ListId\x20=\x20?',_0x4a20e9)[_0x727d('0x15')](_0xbe0c32+_0x727d('0x43'),_0x483dd8+'.'+_0xbe0c32)))['toString']();}function insertCmHopperAdditionalPhones(_0x310b10){var _0x59a535=[_0x727d('0x44'),_0x727d('0x45'),_0x727d('0x46'),_0x727d('0x47'),_0x727d('0x48')];return squel[_0x727d('0x42')]()[_0x727d('0x31')](_0x727d('0x49'))[_0x727d('0x33')]([_0x727d('0x4a'),_0x727d('0x11'),_0x727d('0x4b'),'createdAt','updatedAt'],squel[_0x727d('0xf')]()['fields'](_0x59a535)[_0x727d('0x12')](_0x727d('0x32'))['join']('cm_contacts',null,_0x727d('0x4c'))['join'](_0x727d('0x4d'),null,_0x727d('0x4e'))['where'](_0x727d('0x4f'),_0x310b10)[_0x727d('0x15')](_0x727d('0x3d'),NOW))['toString']();}function insertCmContact(_0x172414,_0x270153,_0x41f199,_0x175a67){var _0x24b3b0=_[_0x727d('0x50')](_[_0x727d('0x51')](_0x175a67),[_0x727d('0x35'),_0x727d('0x52'),_0x727d('0x36'),_0x727d('0x37')]);return squel[_0x727d('0x42')]()[_0x727d('0x31')]('cm_contacts')[_0x727d('0x33')](_0x24b3b0,squel['select']()[_0x727d('0x39')](_0x24b3b0)[_0x727d('0x12')](_0x270153)[_0x727d('0x15')]('('+_0x41f199['join'](',')+_0x727d('0x53'),squel[_0x727d('0xf')]()[_0x727d('0x39')](_0x41f199)[_0x727d('0x12')](_0x727d('0x3a'))[_0x727d('0x15')](_0x727d('0x54'),_0x172414))[_0x727d('0x15')]('id\x20IN\x20?',squel[_0x727d('0xf')]()[_0x727d('0x10')](_0x727d('0x55'),_0x727d('0x56'))[_0x727d('0x12')](_0x270153)[_0x727d('0x57')](_0x41f199['join'](','))))[_0x727d('0x58')]();}function handleStop(){logger[_0x727d('0x59')](_0x727d('0x5a'));stopped=!![];}function handleUncaughtException(_0x4c4456){logger[_0x727d('0x21')](_0x4c4456[_0x727d('0x5b')]);process[_0x727d('0x5c')](0x1);}function handleError(_0x1f2a32,_0x5941b2){stats[_0x727d('0x5d')][_0x727d('0x23')]({'name':_0x5941b2['code'],'message':_0x5941b2[_0x727d('0x5b')],'row':_0x1f2a32});}function handleQuery(_0x570a33){logger[_0x727d('0x59')](_0x570a33);return db[_0x727d('0x18')]['query'](_0x570a33)[_0x727d('0x1b')](function(_0x247362){results['push'](_0x247362);})['catch'](function(_0x1b05d1){logger[_0x727d('0x21')](_0x1b05d1[_0x727d('0x5b')]);});}function main(_0x24c344,_0x31470d,_0x490ecf,_0x433bc4){logger[_0x727d('0x59')](_0x727d('0x5e'),_0x24c344,JSON['stringify'](_0x31470d));process['send'](_0x727d('0x5f'));var _0x212d5d=_0x31470d['binding'];var _0x4c72a7=_[_0x727d('0x60')](_0x212d5d);var _0x448ad0=_0x31470d[_0x727d('0x61')];var _0x3b05c3=path[_0x727d('0x13')](config[_0x727d('0x62')],_0x727d('0x63'),_0x448ad0+_0x727d('0x64'));logger['info']('body',_0x31470d);db[_0x727d('0x65')]['findAll']({'raw':!![],'attributes':['id',_0x727d('0x66')]})[_0x727d('0x1f')](function(_0x517111){for(var _0x7a791f=0x0;_0x7a791f<_0x517111[_0x727d('0x1c')];_0x7a791f++){if(_0x517111[_0x7a791f]['name']in _0x212d5d){contactItemTypes[_0x727d('0x23')](_0x517111[_0x7a791f]);delete _0x4c72a7[_0x517111[_0x7a791f]['name']];hasAdditionalPhones=!![];}for(var _0x52e7d3 in _0x212d5d){if(_0x517111[_0x7a791f]['name']+_0x727d('0x67')===_0x52e7d3){phoneDescriptions['push']({'itemTypeId':_0x517111[_0x7a791f]['id'],'description':_0x52e7d3});delete _0x4c72a7[_0x52e7d3];}}}if(hasAdditionalPhones)_0x4c72a7[_0x727d('0x1e')]='';var _0x22fd3d=_[_0x727d('0x51')](_0x4c72a7)[_0x727d('0x13')]();logger[_0x727d('0x59')](_0x727d('0x68'),_0x22fd3d);fs['writeFileSync'](_0x3b05c3,_0x22fd3d+'\x0a');Papa['parse'](fs['createReadStream'](_0x24c344),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1d3f45,_0x2f1302){try{for(var _0x35253b=0x0,_0x11d86e=[];_0x35253b<_0x1d3f45[_0x727d('0x69')][_0x727d('0x1c')];_0x35253b++){stats[_0x727d('0x6a')]+=0x1;if(_0x1d3f45[_0x727d('0x5d')][_0x35253b]){handleError(_0x1d3f45[_0x727d('0x69')][_0x35253b],_0x1d3f45[_0x727d('0x5d')][_0x35253b]);}else{var _0x598559=[];var _0x5c5271=[];var _0x5367dd={};for(var _0x1e7218 in _0x212d5d){let _0x3cdccd=contactItemTypes['find'](_0x2ac543=>_0x2ac543['name']===_0x1e7218);let _0x44040=contactItemTypes[_0x727d('0x6b')](_0x3b4aca=>_0x3b4aca[_0x727d('0x66')]+_0x727d('0x67')===_0x1e7218);if(_[_0x727d('0x1d')](_0x3cdccd)&&_['isNil'](_0x44040)){if(_0x212d5d['hasOwnProperty'](_0x1e7218)){if(_0x1d3f45[_0x727d('0x69')][_0x35253b][_0x212d5d[_0x1e7218]]){var _0x17b3e1=_[_0x727d('0x6c')](_0x1d3f45[_0x727d('0x69')][_0x35253b][_0x212d5d[_0x1e7218]][_0x727d('0x6d')](/"/g,'\x27'));switch(_0x1e7218){case'scheduledat':var _0x1da08a=moment(_0x17b3e1,_0x727d('0xb'),!![]);if(_0x1da08a[_0x727d('0x6e')]()){_0x11d86e[_0x727d('0x23')]('\x22'+_0x17b3e1+'\x22');}else{_0x598559['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x4b0df0=parseInt(_0x17b3e1);_0x17b3e1=_[_0x727d('0x6f')](_0x4b0df0)||_0x4b0df0<0x0||_0x4b0df0>0x4?_0x433bc4?0x3:0x2:_0x4b0df0;_0x11d86e[_0x727d('0x23')]('\x22'+_0x17b3e1+'\x22');break;case'UserId':var _0x4e7d3e=parseInt(_0x17b3e1);if(_[_0x727d('0x70')](_0x4e7d3e)&&_['includes'](_0x490ecf,_0x4e7d3e)){_0x11d86e[_0x727d('0x23')]('\x22'+_0x4e7d3e+'\x22');}else{_0x598559['push']('agent\x20not\x20exists');}break;case _0x727d('0x71'):if(isEmail(_0x17b3e1)){_0x11d86e[_0x727d('0x23')]('\x22'+_0x17b3e1+'\x22');}else{_0x598559[_0x727d('0x23')](_0x727d('0x72'));}break;case'dateOfBirth':var _0x2f8082=moment(_0x17b3e1,'YYYY-MM-DD',!![]);if(_0x2f8082[_0x727d('0x6e')]()){_0x11d86e['push']('\x22'+_0x17b3e1+'\x22');}else{_0x598559['push'](_0x727d('0x73'));}break;default:_0x11d86e[_0x727d('0x23')]('\x22'+_0x17b3e1+'\x22');}}else{switch(_0x1e7218){case _0x727d('0x74'):case _0x727d('0x11'):_0x598559['push'](_0x1e7218+'\x20not\x20specified');break;default:_0x11d86e[_0x727d('0x23')]('\x22\x22');}}}}else{var _0x8e5f19='';if(!_[_0x727d('0x1d')](_0x3cdccd)){if(!_0x5367dd[_0x727d('0x75')](_0x3cdccd['id'])){for(var _0x179b25=0x0;_0x179b25<_0x212d5d[_0x1e7218][_0x727d('0x1c')];_0x179b25++){var _0x17b3e1=_[_0x727d('0x6c')](_0x1d3f45[_0x727d('0x69')][_0x35253b][_0x212d5d[_0x1e7218][_0x179b25]][_0x727d('0x6d')](/"/g,'\x27'));var _0x41d80e=phoneDescriptions['find'](_0x2f8d85=>_0x2f8d85['itemTypeId']===_0x3cdccd['id']);if(!_[_0x727d('0x1d')](_0x41d80e)){var _0x33985b=_['trim'](_0x1d3f45[_0x727d('0x69')][_0x35253b][_0x212d5d[_0x41d80e['description']][0x0]][_0x727d('0x6d')](/"/g,'\x27'));if(!_[_0x727d('0x1d')](_0x33985b))_0x17b3e1=_0x17b3e1+'§'+_0x33985b;}if(_0x8e5f19=='')_0x8e5f19=_0x17b3e1;else _0x8e5f19+='|'+_0x17b3e1;}_0x5c5271[_0x727d('0x23')](_0x3cdccd['id']+':'+_0x8e5f19);_0x5367dd[_0x3cdccd['id']]=0x1;}}}}if(hasAdditionalPhones){_0x11d86e[_0x727d('0x23')]('\x22'+_0x5c5271[_0x727d('0x13')](';')+'\x22');}if(_0x598559[_0x727d('0x1c')]){handleError(_0x1d3f45[_0x727d('0x69')][_0x35253b],{'code':_0x727d('0x76'),'message':_0x598559[_0x727d('0x13')]()});}else{fs[_0x727d('0x77')](_0x3b05c3,_0x11d86e[_0x727d('0x13')]()+'\x0a');}_0x11d86e=[];}if(!(stats['rows']%0xc8)){socket[_0x727d('0x78')]('contact:import:'+_0x448ad0,stats);stats['errors']=[];}}if(stopped){logger[_0x727d('0x59')](_0x727d('0x79'));_0x2f1302[_0x727d('0x7a')]();}}catch(_0x5e0789){handleError(_0x1d3f45['data'][_0x35253b],{'code':'SystemError','message':_0x5e0789['message']});logger[_0x727d('0x21')]('step',_0x5e0789[_0x727d('0x5b')]);}},'complete':function(){try{var _0x31f050=[];var _0x54572d=tempTableName;_0x31f050['push'](_0x727d('0x7b')+_0x54572d+_0x727d('0x7c'));logger['info'](_0x727d('0x7d'),contactItemTypes['length']);var _0x3d85b1=util[_0x727d('0xa')](_0x727d('0x7e'),_0x3b05c3,_0x54572d,_0x22fd3d,_0x31470d['ListId'],_0x31470d['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x212d5d['scheduledat'])){_0x3d85b1+=_0x727d('0x7f');}_0x31f050['push'](_0x3d85b1);BPromise[_0x727d('0x80')](_0x31f050,handleQuery)[_0x727d('0x1f')](function(_0x480960){BPromise[_0x727d('0x24')]([handleAdditionalPhones()])[_0x727d('0x1f')](function(){_0x31f050=[];for(var _0x5742a1=0x0;_0x5742a1\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis'];(function(_0x22ab40,_0xf1df86){var _0x117e3e=function(_0x5b4746){while(--_0x5b4746){_0x22ab40['push'](_0x22ab40['shift']());}};_0x117e3e(++_0xf1df86);}(_0x8d41,0x12c));var _0x18d4=function(_0x1b6158,_0x1b7c2f){_0x1b6158=_0x1b6158-0x0;var _0x5c6338=_0x8d41[_0x1b6158];return _0x5c6338;};'use strict';var fs=require('fs');var path=require(_0x18d4('0x0'));var _=require(_0x18d4('0x1'));var Papa=require(_0x18d4('0x2'));var util=require(_0x18d4('0x3'));var BPromise=require(_0x18d4('0x4'));var moment=require(_0x18d4('0x5'));var squel=require(_0x18d4('0x6'));var Redis=require(_0x18d4('0x7'));var db=require(_0x18d4('0x8'))['db'];var config=require(_0x18d4('0x9'));var logger=require('../../../config/logger')('import');config[_0x18d4('0xa')]=_[_0x18d4('0xb')](config[_0x18d4('0xa')],{'host':_0x18d4('0xc'),'port':0x18eb});var socket=require(_0x18d4('0xd'))(new Redis(config[_0x18d4('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x18d4('0xe')](_0x18d4('0xf'));var tempTableName='cm_contacts_temp_'+moment()[_0x18d4('0xe')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x36e753){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'](_0x36e753);}function selectNotIn(_0x1a6522,_0x4aabf8,_0x4e1163,_0x501e60,_0x4e2665){return squel[_0x18d4('0x10')]()[_0x18d4('0x11')](_0x18d4('0x12'))[_0x18d4('0x13')](_0x501e60)[_0x18d4('0x14')](_0x4aabf8,null,_0x4aabf8+_0x18d4('0x15')+_0x501e60+'.'+_0x4e1163)['where'](_0x501e60+'.'+_0x4e1163+_0x18d4('0x16')+_0x1a6522+'.'+_0x4e1163)[_0x18d4('0x17')](_0x4aabf8+'.dialCheckDuplicateType\x20IN\x20('+_0x4e2665[_0x18d4('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4ceb75,_0x53fa5d){promisesAdditionalPhones=[];promisesContact=[];return db[_0x18d4('0x18')][_0x18d4('0x19')](_0x18d4('0x1a')+tempTableName)['spread'](function(_0x53dc3c){if(_0x53dc3c!==null){var _0x249c9d=[];for(var _0x50ba5d=0x0;_0x50ba5d<_0x53dc3c['length'];_0x50ba5d++){var _0x5d2e9d=_0x53dc3c[_0x50ba5d];if(!_[_0x18d4('0x1b')](_0x5d2e9d['phone'])){if(!_[_0x18d4('0x1b')](_0x5d2e9d[_0x18d4('0x1c')]))_0x249c9d[_0x18d4('0x1d')](insertAdditionalPhones(_0x5d2e9d));promisesContact[_0x18d4('0x1d')]({'contact':_0x5d2e9d});}}}Promise[_0x18d4('0x1e')](_0x249c9d)[_0x18d4('0x1f')](function(){_0x4ceb75({'val':0x1});});})[_0x18d4('0x20')](function(_0x55372d){logger[_0x18d4('0x21')](_0x55372d[_0x18d4('0x22')]);});});}function insertAdditionalPhones(_0x2d07dd){return new Promise(function(_0x370fd0,_0x367e5a){var _0x2017fe=_0x2d07dd[_0x18d4('0x1c')];if(_[_0x18d4('0x1b')](_0x2017fe))_0x367e5a({'val':0x0});else{var _0x2b03e5=_0x2017fe['split'](';');var _0xaf6236=[];orderBy=0x0;for(var _0x28dba4=0x0;_0x28dba4<_0x2b03e5[_0x18d4('0x23')];_0x28dba4++){_0xaf6236[_0x18d4('0x1d')](splitAdditionalPhone(_0x2d07dd['id'],_0x2b03e5[_0x28dba4]));}Promise['all'](_0xaf6236)[_0x18d4('0x1f')](function(){_0x370fd0({'val':_0x2b03e5[_0x18d4('0x23')]});});}});}function splitAdditionalPhone(_0x5bb4c9,_0x453fae){return new Promise(function(_0x675794,_0x6408df){var _0x3c91cb=_0x453fae[_0x18d4('0x24')](':');var _0x1d22aa=_0x3c91cb[0x0];var _0x4bb22a=_0x3c91cb[0x1];if(_0x4bb22a!==''){var _0x4c6383=_0x4bb22a[_0x18d4('0x24')]('|');var _0x21da01=[];for(var _0x9e1eef=0x0;_0x9e1eef<_0x4c6383[_0x18d4('0x23')];_0x9e1eef++){if(_0x4c6383[_0x9e1eef]!==''){var _0x4de81a=_[_0x18d4('0x25')](promisesAdditionalPhones,{'contactId':_0x5bb4c9,'phone':_0x4c6383[_0x9e1eef]});if(_0x4de81a[_0x18d4('0x23')]==0x0){orderBy++;promisesAdditionalPhones[_0x18d4('0x1d')]({'contactId':_0x5bb4c9,'contactTypeId':_0x1d22aa,'phone':_0x4c6383[_0x9e1eef],'orderBy':orderBy});}}}_0x675794({'ok':0x1});}else _0x675794({'res':0x0});});}function createAdditionalPhone(_0x22fcee,_0x3afcf9,_0x43cf79,_0x1f6954){var _0x18954d='';var _0x28154d='';var _0x3ff051=_0x43cf79[_0x18d4('0x24')]('§');_0x18954d=_0x3ff051[0x0];if(_0x3ff051['length']==0x2)_0x28154d=_0x3ff051[0x1];return new Promise(function(_0x1d8629,_0x502e4f){return db['CmContactHasItem'][_0x18d4('0x26')]({'where':{'CmContactId':_0x22fcee,'item':_0x18954d}})[_0x18d4('0x1f')](function(_0x2d22ce){if(_0x2d22ce){return db['CmContactHasItem'][_0x18d4('0x27')]({'ItemTypeId':_0x3afcf9,'description':_0x28154d,'OrderBy':_0x1f6954},{'where':{'CmContactId':_0x22fcee,'item':_0x18954d}})[_0x18d4('0x1f')](function(_0x7325f6){_0x1d8629({'res':_0x18d4('0x28')});});}else{return db[_0x18d4('0x29')][_0x18d4('0x2a')]({'CmContactId':_0x22fcee,'item':_0x18954d,'ItemTypeId':_0x3afcf9,'description':_0x28154d,'OrderBy':_0x1f6954,'ItemClass':'PHONE'})[_0x18d4('0x1f')](function(_0x11497d){_0x1d8629({'res':_0x18d4('0x2b')});});}});});}function updateContact(_0x51f3a6){return new Promise(function(_0x4e0405,_0x6f5fb8){var _0x3cb715=_0x51f3a6['id'];delete _0x51f3a6['id'];return db[_0x18d4('0x2c')]['update'](_0x51f3a6,{'where':{'id':_0x3cb715}})[_0x18d4('0x1f')](function(_0x3771fa){updatedRows+=0x1;return db[_0x18d4('0x2d')]['update']({'phone':_0x51f3a6[_0x18d4('0x12')]},{'where':{'ContactId':_0x3cb715}})[_0x18d4('0x1f')](function(_0xfe47ef){_0x4e0405({'ret':'OK'});});});});}function insertCmHopper(_0x207a02,_0x3da4b5,_0x4f7444,_0x3f1c32,_0x2e2f4b){var _0x107e89=[_0x18d4('0x2e'),_0x18d4('0x2f'),'cm_contacts.id','cm_contacts.ListId',_0x3da4b5+'.'+_0x3f1c32,'cm_contacts.createdAt',_0x18d4('0x30'),_0x18d4('0x31'),_0x18d4('0x32'),'\x22'+_0x2e2f4b+'\x22'];return squel[_0x18d4('0x33')]()[_0x18d4('0x34')](_0x18d4('0x35'))[_0x18d4('0x36')]([_0x18d4('0x12'),_0x18d4('0x37'),'ContactId','ListId',_0x3f1c32,'createdAt',_0x18d4('0x38'),_0x18d4('0x39'),_0x18d4('0x3a'),_0x18d4('0x3b')],squel[_0x18d4('0x10')]()[_0x18d4('0x3c')](_0x107e89)[_0x18d4('0x13')](_0x3da4b5)['join'](_0x18d4('0x3d'),null,'cm_contacts.ListId\x20=\x20'+_0x3da4b5+_0x18d4('0x3e'))[_0x18d4('0x14')](_0x4f7444,null,_0x4f7444+_0x18d4('0x15')+_0x3da4b5+'.'+_0x3f1c32)[_0x18d4('0x17')](_0x3da4b5+_0x18d4('0x3f'),_0x207a02)['where'](_0x18d4('0x40'),NOW)[_0x18d4('0x17')](_0x18d4('0x41'),selectNotIn(_0x3da4b5,_0x4f7444,_0x3f1c32,_0x18d4('0x35'),[_0x18d4('0x42'),_0x18d4('0x43')]))[_0x18d4('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3da4b5,_0x4f7444,_0x3f1c32,_0x18d4('0x35'),[_0x18d4('0x42')])))[_0x18d4('0x44')]();}function insertCmHopperBlack(_0x382b43,_0x2e015d,_0x2b7303,_0x20402b){var _0x2dd70e=['cm_contacts.phone','cm_contacts.id',_0x18d4('0x45'),_0x2e015d+'.'+_0x20402b,_0x18d4('0x46'),'cm_contacts.updatedAt'];return squel[_0x18d4('0x33')]()[_0x18d4('0x34')](_0x18d4('0x47'))['fromQuery'](['phone',_0x18d4('0x48'),'ListId',_0x20402b,_0x18d4('0x49'),_0x18d4('0x38')],squel[_0x18d4('0x10')]()[_0x18d4('0x3c')](_0x2dd70e)[_0x18d4('0x13')](_0x2e015d)[_0x18d4('0x14')](_0x18d4('0x3d'),null,'cm_contacts.ListId\x20=\x20'+_0x2e015d+_0x18d4('0x3e'))[_0x18d4('0x14')](_0x2b7303,null,_0x2b7303+'.id\x20=\x20'+_0x2e015d+'.'+_0x20402b)['where'](_0x2e015d+'.CmListId\x20=\x20?',_0x382b43)[_0x18d4('0x17')](_0x18d4('0x40'),NOW)[_0x18d4('0x17')](_0x18d4('0x41'),squel[_0x18d4('0x10')]()[_0x18d4('0x11')]('phone')['from'](_0x18d4('0x47'))['where'](_0x18d4('0x4a'),_0x382b43)[_0x18d4('0x17')](_0x20402b+_0x18d4('0x4b'),_0x2e015d+'.'+_0x20402b)))[_0x18d4('0x44')]();}function insertCmHopperAdditionalPhones(_0x378276){var _0x4a264d=[_0x18d4('0x4c'),_0x18d4('0x4d'),_0x18d4('0x4e'),_0x18d4('0x4f'),'cm_contact_has_items.updatedAt'];return squel[_0x18d4('0x33')]()[_0x18d4('0x34')](_0x18d4('0x50'))[_0x18d4('0x36')]([_0x18d4('0x51'),_0x18d4('0x12'),_0x18d4('0x52'),_0x18d4('0x49'),'updatedAt'],squel[_0x18d4('0x10')]()[_0x18d4('0x3c')](_0x4a264d)[_0x18d4('0x13')](_0x18d4('0x35'))[_0x18d4('0x14')]('cm_contacts',null,_0x18d4('0x53'))['join'](_0x18d4('0x54'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x18d4('0x17')](_0x18d4('0x55'),_0x378276)[_0x18d4('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x18d4('0x44')]();}function insertCmContact(_0x3c8fbf,_0x23567c,_0x28aebb,_0x3c2cab){var _0x40b135=_[_0x18d4('0x56')](_[_0x18d4('0x57')](_0x3c2cab),['ListId',_0x18d4('0x58'),_0x18d4('0x49'),'updatedAt']);return squel[_0x18d4('0x33')]()['into']('cm_contacts')[_0x18d4('0x36')](_0x40b135,squel[_0x18d4('0x10')]()[_0x18d4('0x3c')](_0x40b135)[_0x18d4('0x13')](_0x23567c)['where']('('+_0x28aebb[_0x18d4('0x14')](',')+_0x18d4('0x59'),squel[_0x18d4('0x10')]()['fields'](_0x28aebb)[_0x18d4('0x13')]('cm_contacts')[_0x18d4('0x17')](_0x18d4('0x4a'),_0x3c8fbf))['where'](_0x18d4('0x5a'),squel[_0x18d4('0x10')]()[_0x18d4('0x11')]('MIN(id)',_0x18d4('0x5b'))[_0x18d4('0x13')](_0x23567c)[_0x18d4('0x5c')](_0x28aebb[_0x18d4('0x14')](','))))[_0x18d4('0x44')]();}function handleStop(){logger[_0x18d4('0x5d')](_0x18d4('0x5e'));stopped=!![];}function handleUncaughtException(_0x5570e){logger[_0x18d4('0x21')](_0x5570e['message']);process[_0x18d4('0x5f')](0x1);}function handleError(_0x168395,_0x2eca70){stats[_0x18d4('0x60')]['push']({'name':_0x2eca70['code'],'message':_0x2eca70[_0x18d4('0x22')],'row':_0x168395});}function handleQuery(_0xd29440){logger['info'](_0xd29440);return db[_0x18d4('0x18')][_0x18d4('0x19')](_0xd29440)['spread'](function(_0x14d0c5){results[_0x18d4('0x1d')](_0x14d0c5);})[_0x18d4('0x20')](function(_0x4b8bf7){logger[_0x18d4('0x21')](_0x4b8bf7[_0x18d4('0x22')]);});}function main(_0x50cc6b,_0x2a1456,_0x16906b,_0x4e0b88){logger['info'](_0x18d4('0x61'),_0x50cc6b,JSON[_0x18d4('0x62')](_0x2a1456));process[_0x18d4('0x63')](_0x18d4('0x64'));var _0x8f53b4=_0x2a1456[_0x18d4('0x65')];var _0x1ec623=_[_0x18d4('0x66')](_0x8f53b4);var _0x2ebf02=_0x2a1456[_0x18d4('0x67')];var _0x3addcf=path[_0x18d4('0x14')](config[_0x18d4('0x68')],'server/files/tmp',_0x2ebf02+_0x18d4('0x69'));logger[_0x18d4('0x5d')](_0x18d4('0x6a'),_0x2a1456);db[_0x18d4('0x6b')][_0x18d4('0x6c')]({'raw':!![],'attributes':['id',_0x18d4('0x6d')]})[_0x18d4('0x1f')](function(_0x1bdfd3){for(var _0x459045=0x0;_0x459045<_0x1bdfd3['length'];_0x459045++){if(_0x1bdfd3[_0x459045][_0x18d4('0x6d')]in _0x8f53b4){contactItemTypes[_0x18d4('0x1d')](_0x1bdfd3[_0x459045]);delete _0x1ec623[_0x1bdfd3[_0x459045][_0x18d4('0x6d')]];hasAdditionalPhones=!![];}for(var _0x5b2e75 in _0x8f53b4){if(_0x1bdfd3[_0x459045][_0x18d4('0x6d')]+_0x18d4('0x6e')===_0x5b2e75){phoneDescriptions[_0x18d4('0x1d')]({'itemTypeId':_0x1bdfd3[_0x459045]['id'],'description':_0x5b2e75});delete _0x1ec623[_0x5b2e75];}}}if(hasAdditionalPhones)_0x1ec623[_0x18d4('0x1c')]='';var _0x265c69=_['keys'](_0x1ec623)['join']();logger[_0x18d4('0x5d')](_0x18d4('0x6f'),_0x265c69);fs[_0x18d4('0x70')](_0x3addcf,_0x265c69+'\x0a');Papa[_0x18d4('0x71')](fs[_0x18d4('0x72')](_0x50cc6b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x363c3b,_0x4dfcc3){try{for(var _0x16e8ce=0x0,_0x4474c5=[];_0x16e8ce<_0x363c3b['data'][_0x18d4('0x23')];_0x16e8ce++){stats['rows']+=0x1;if(_0x363c3b['errors'][_0x16e8ce]){handleError(_0x363c3b['data'][_0x16e8ce],_0x363c3b[_0x18d4('0x60')][_0x16e8ce]);}else{var _0xeca444=[];var _0x3e2a31=[];var _0x2aad97={};for(var _0x295428 in _0x8f53b4){let _0x469b48=contactItemTypes[_0x18d4('0x73')](_0x2dd988=>_0x2dd988['name']===_0x295428);let _0x428320=contactItemTypes[_0x18d4('0x73')](_0x151312=>_0x151312[_0x18d4('0x6d')]+_0x18d4('0x6e')===_0x295428);if(_['isNil'](_0x469b48)&&_['isNil'](_0x428320)){if(_0x8f53b4['hasOwnProperty'](_0x295428)){if(_0x363c3b[_0x18d4('0x74')][_0x16e8ce][_0x8f53b4[_0x295428]]){var _0x8dc81c=_[_0x18d4('0x75')](_0x363c3b[_0x18d4('0x74')][_0x16e8ce][_0x8f53b4[_0x295428]][_0x18d4('0x76')](/"/g,'\x27'));switch(_0x295428){case'scheduledat':var _0x1a783f=moment(_0x8dc81c,_0x18d4('0xf'),!![]);if(_0x1a783f['isValid']()){_0x4474c5[_0x18d4('0x1d')]('\x22'+_0x8dc81c+'\x22');}else{_0xeca444[_0x18d4('0x1d')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x18d4('0x39'):var _0x50990d=parseInt(_0x8dc81c);_0x8dc81c=_[_0x18d4('0x77')](_0x50990d)||_0x50990d<0x0||_0x50990d>0x4?_0x4e0b88?0x3:0x2:_0x50990d;_0x4474c5['push']('\x22'+_0x8dc81c+'\x22');break;case _0x18d4('0x3a'):var _0x3a716c=parseInt(_0x8dc81c);if(_[_0x18d4('0x78')](_0x3a716c)&&_['includes'](_0x16906b,_0x3a716c)){_0x4474c5[_0x18d4('0x1d')]('\x22'+_0x3a716c+'\x22');}else{_0xeca444['push']('agent\x20not\x20exists');}break;case _0x18d4('0x79'):if(isEmail(_0x8dc81c)){_0x4474c5['push']('\x22'+_0x8dc81c+'\x22');}else{_0xeca444[_0x18d4('0x1d')](_0x18d4('0x7a'));}break;case'dateOfBirth':var _0x62f02=moment(_0x8dc81c,_0x18d4('0x7b'),!![]);if(_0x62f02[_0x18d4('0x7c')]()){_0x4474c5[_0x18d4('0x1d')]('\x22'+_0x8dc81c+'\x22');}else{_0xeca444[_0x18d4('0x1d')](_0x18d4('0x7d'));}break;default:_0x4474c5['push']('\x22'+_0x8dc81c+'\x22');}}else{switch(_0x295428){case _0x18d4('0x7e'):case _0x18d4('0x12'):_0xeca444[_0x18d4('0x1d')](_0x295428+'\x20not\x20specified');break;default:_0x4474c5[_0x18d4('0x1d')]('\x22\x22');}}}}else{var _0x23da91='';if(!_[_0x18d4('0x1b')](_0x469b48)){if(!_0x2aad97[_0x18d4('0x7f')](_0x469b48['id'])){for(var _0x4a9130=0x0;_0x4a9130<_0x8f53b4[_0x295428][_0x18d4('0x23')];_0x4a9130++){var _0x8dc81c=_[_0x18d4('0x75')](_0x363c3b[_0x18d4('0x74')][_0x16e8ce][_0x8f53b4[_0x295428][_0x4a9130]][_0x18d4('0x76')](/"/g,'\x27'));var _0x392c77=phoneDescriptions[_0x18d4('0x73')](_0x44ab46=>_0x44ab46['itemTypeId']===_0x469b48['id']);if(!_['isNil'](_0x392c77)){var _0x4d1cea=_[_0x18d4('0x75')](_0x363c3b[_0x18d4('0x74')][_0x16e8ce][_0x8f53b4[_0x392c77[_0x18d4('0x80')]][0x0]][_0x18d4('0x76')](/"/g,'\x27'));if(!_[_0x18d4('0x1b')](_0x4d1cea))_0x8dc81c=_0x8dc81c+'§'+_0x4d1cea;}if(_0x23da91=='')_0x23da91=_0x8dc81c;else _0x23da91+='|'+_0x8dc81c;}_0x3e2a31[_0x18d4('0x1d')](_0x469b48['id']+':'+_0x23da91);_0x2aad97[_0x469b48['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4474c5[_0x18d4('0x1d')]('\x22'+_0x3e2a31[_0x18d4('0x14')](';')+'\x22');}if(_0xeca444[_0x18d4('0x23')]){handleError(_0x363c3b['data'][_0x16e8ce],{'code':_0x18d4('0x81'),'message':_0xeca444[_0x18d4('0x14')]()});}else{fs[_0x18d4('0x82')](_0x3addcf,_0x4474c5[_0x18d4('0x14')]()+'\x0a');}_0x4474c5=[];}if(!(stats['rows']%0xc8)){socket[_0x18d4('0x83')](_0x18d4('0x84')+_0x2ebf02,stats);stats[_0x18d4('0x60')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x4dfcc3['abort']();}}catch(_0x1707be){handleError(_0x363c3b[_0x18d4('0x74')][_0x16e8ce],{'code':_0x18d4('0x85'),'message':_0x1707be[_0x18d4('0x22')]});logger['error'](_0x18d4('0x86'),_0x1707be['message']);}},'complete':function(){try{var _0x1e7db0=[];var _0x61949b=tempTableName;_0x1e7db0[_0x18d4('0x1d')]('CREATE\x20TABLE\x20'+_0x61949b+_0x18d4('0x87'));logger['info']('CIS\x20len',contactItemTypes['length']);var _0x304d40=util[_0x18d4('0xe')](_0x18d4('0x88'),_0x3addcf,_0x61949b,_0x265c69,_0x2a1456[_0x18d4('0x89')],_0x2a1456[_0x18d4('0x58')]||null,NOW,NOW);if(_[_0x18d4('0x1b')](_0x8f53b4[_0x18d4('0x37')])){_0x304d40+=_0x18d4('0x8a');}_0x1e7db0[_0x18d4('0x1d')](_0x304d40);BPromise[_0x18d4('0x8b')](_0x1e7db0,handleQuery)[_0x18d4('0x1f')](function(_0x55352a){BPromise[_0x18d4('0x1e')]([handleAdditionalPhones()])[_0x18d4('0x1f')](function(){_0x1e7db0=[];for(var _0x17ff7d=0x0;_0x17ff7d\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.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','enableEmailPreview','all','clone','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','updateInteraction','./utils','../../mysqldb','role','agent'];(function(_0x19f275,_0x3c2e41){var _0x4a1c82=function(_0x27c412){while(--_0x27c412){_0x19f275['push'](_0x19f275['shift']());}};_0x4a1c82(++_0x3c2e41);}(_0xac55,0x1c8));var _0x5ac5=function(_0x52eb8d,_0x27c32c){_0x52eb8d=_0x52eb8d-0x0;var _0xfd0237=_0xac55[_0x52eb8d];return _0xfd0237;};'use strict';var _=require(_0x5ac5('0x0'));var squel=require(_0x5ac5('0x1'));var as=require(_0x5ac5('0x2'));var qs=require(_0x5ac5('0x3'));var updateInteraction=require('./update-interaction')[_0x5ac5('0x4')];var utils=require(_0x5ac5('0x5'));var db=require(_0x5ac5('0x6'))['db'];function skipInteractionsQuery(_0x1cdfec,_0x3706ee,_0x245d73){var _0x234650=![];var _0x52e117=utils['getAccountFK'](_0x1cdfec);if(_0x3706ee[_0x5ac5('0x7')]===_0x5ac5('0x8')&&!_0x245d73[_0x5ac5('0x9')]&&!_0x245d73[_0x52e117]){_0x234650=!![];}return _0x234650;}function getTagsQuery(){return squel[_0x5ac5('0xa')]()[_0x5ac5('0xb')]('id')[_0x5ac5('0xb')](_0x5ac5('0xc'))['field']('color')[_0x5ac5('0xd')](_0x5ac5('0xe'));}function getUsersQuery(_0x4ec845,_0x127342){var _0x294425=utils['getInteractionFK'](_0x4ec845);var _0x2b70ed=_0x5ac5('0xf')+_0x4ec845+'_interactions';var _0x3bf4ea=squel[_0x5ac5('0xa')]()[_0x5ac5('0xb')](_0x5ac5('0x10'))[_0x5ac5('0xb')]('u.fullname')[_0x5ac5('0xb')]('ui.'+_0x294425)[_0x5ac5('0xd')](_0x2b70ed,'ui')[_0x5ac5('0x11')]('users','u',_0x5ac5('0x12'));if(_0x127342['length']>0x0){_0x3bf4ea[_0x5ac5('0x13')](_0x5ac5('0x14')+_0x294425+_0x5ac5('0x15'),_[_0x5ac5('0x16')](_0x127342,'id'));}return _0x3bf4ea;}function getInteractionsQuery(_0x34a95e){var _0x3e35e9=utils[_0x5ac5('0x17')](_0x34a95e);var _0x5510ef=utils[_0x5ac5('0x18')](_0x34a95e);var _0x5364a6=utils[_0x5ac5('0x19')](_0x34a95e);return squel[_0x5ac5('0xa')]()['from'](_0x3e35e9[_0x5ac5('0x1a')],'i')['left_join'](_0x5ac5('0x1b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x5ac5('0x1c'),'o','o.id\x20=\x20i.UserId')[_0x5ac5('0x11')](_0x3e35e9[_0x5ac5('0x1d')],'a','a.id\x20=\x20i.'+_0x5510ef)[_0x5ac5('0x11')](_0x3e35e9['messages'],'me',_0x5ac5('0x1e')+_0x5364a6+_0x5ac5('0x1f'))['left_join'](_0x3e35e9['interactionsTags'],'it',_0x5ac5('0x20')+_0x5364a6+_0x5ac5('0x1f'))[_0x5ac5('0x11')](_0x5ac5('0xe'),'t',_0x5ac5('0x21'));}function getSqlClauses(){var _0x4dec2f={'body':squel[_0x5ac5('0x22')](),'contact':squel[_0x5ac5('0x22')](),'default':squel[_0x5ac5('0x22')](),'fields':squel[_0x5ac5('0x22')](),'filter':squel['expr'](),'read':squel[_0x5ac5('0x22')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x5ac5('0x22')]()};return _0x4dec2f;}function parseTagParameter(_0x74f32b){var _0x1d78cf=squel[_0x5ac5('0x22')]();if(_0x74f32b){var _0x3ab796=utils[_0x5ac5('0x23')](_0x74f32b);_0x3ab796['forEach'](function(_0x31f9cc){_0x1d78cf['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x31f9cc+',%');});}return _0x1d78cf;}function parseReadParameter(_0x24e8c7){var _0x3d0e6f='';if(_0x24e8c7){_0x3d0e6f=_0x5ac5('0x24');if(_0x24e8c7==='1'){_0x3d0e6f=_0x3d0e6f['replace'](_0x5ac5('0x25'),'=');}else{_0x3d0e6f=_0x3d0e6f[_0x5ac5('0x26')](_0x5ac5('0x25'),'>');}}return _0x3d0e6f;}function parseSearchFilter(_0x21307c,_0x4eafa1){var _0x16c472=squel['expr']();if(_0x4eafa1){var _0x3414ba=_0x4eafa1[_0x5ac5('0x26')]('\x5c','\x5c\x5c')[_0x5ac5('0x26')](/'/g,'\x27\x27');if(qs[_0x5ac5('0x27')](_0x3414ba)){_0x16c472['or'](_0x5ac5('0x28'),_0x3414ba+'%');if(['sms',_0x5ac5('0x29')][_0x5ac5('0x2a')](_0x21307c)){_0x16c472['or'](_0x5ac5('0x2b'),_0x3414ba+'%');}else if(_0x21307c==='fax'){_0x16c472['or'](_0x5ac5('0x2c'),_0x3414ba+'%');}else if(_0x21307c==='openchannel'){_0x16c472['or'](_0x5ac5('0x2d'),_0x3414ba+'%');}}else if(_0x21307c===_0x5ac5('0x2e')&&qs[_0x5ac5('0x2f')](_0x3414ba)){_0x16c472['or'](_0x5ac5('0x30'),_0x3414ba+'%');}else{if(_0x21307c===_0x5ac5('0x2e')){_0x16c472['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5ac5('0x31')](_0x3414ba))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5ac5('0x31')](_0x3414ba));}else{if(_0x21307c!=='fax'){_0x16c472['or'](_0x5ac5('0x32'),qs[_0x5ac5('0x31')](_0x3414ba));}_0x16c472['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3414ba+'%');}}}return _0x16c472;}function parseAdvancedSearchFilter(_0x2bd707,_0x465a41){var _0x585e4b=getSqlClauses();var _0x4b8dd5=as[_0x5ac5('0x33')](_0x2bd707);var _0x1479e1=_0x4b8dd5[_0x5ac5('0x34')];for(var _0xb78c67=0x0;_0xb78c67<_0x4b8dd5[_0x5ac5('0x35')][_0x5ac5('0x36')];_0xb78c67++){var _0x4c3372=_0x4b8dd5['conditions'][_0xb78c67];var _0x4dc522='i';var _0xb77951=_[_0x5ac5('0x37')](_0x465a41,['name',_0x4c3372[_0x5ac5('0xb')]]);if(_0xb77951){var _0x42a5d6=as[_0x5ac5('0x38')](_0x4dc522,_0xb77951[_0x5ac5('0x39')],_0x4c3372);_0x585e4b[_0x5ac5('0x3a')][_0x1479e1](_0x42a5d6[_0x5ac5('0x3b')],_0x42a5d6[_0x5ac5('0x3c')][_0x5ac5('0x3d')],_0x42a5d6[_0x5ac5('0x3c')]['end']);}else{switch(_0x4c3372[_0x5ac5('0xb')]){case'unreadMessages':var _0x1453c7=parseReadParameter(_0x4c3372[_0x5ac5('0x3c')]);_0x585e4b[_0x5ac5('0x3e')][_0x5ac5('0x3f')](_0x1453c7);break;case _0x5ac5('0x40'):if(_0x4c3372[_0x5ac5('0x41')]===_0x5ac5('0x42')){if(_0x4c3372[_0x5ac5('0x3c')][_0x5ac5('0x43')]('\x20')['length']>0x1){_0x585e4b[_0x5ac5('0x44')][_0x1479e1](_0x5ac5('0x45'),qs['getFullTextValue'](_0x4c3372['value']),null);}else{var _0x3f9054='%'+_0x4c3372['value']+'%';_0x585e4b[_0x5ac5('0x44')][_0x1479e1](_0x5ac5('0x46'),_0x3f9054,_0x3f9054,_0x3f9054);}}else{_0xb77951=_['find'](_0x465a41,['name',_0x5ac5('0x47')]);_0x4c3372[_0x5ac5('0xb')]=_0x5ac5('0x47');_0x42a5d6=as[_0x5ac5('0x38')](_0x4dc522,_0xb77951[_0x5ac5('0x39')],_0x4c3372);_0x585e4b[_0x5ac5('0x44')][_0x1479e1](_0x42a5d6[_0x5ac5('0x3b')],_0x42a5d6['value'][_0x5ac5('0x3d')],_0x42a5d6[_0x5ac5('0x3c')][_0x5ac5('0x48')]);}break;case _0x5ac5('0x49'):var _0x1a0f1c=_0x4c3372[_0x5ac5('0x3c')]['split'](',')[_0x5ac5('0x16')](function(_0x24657d){return Number(_0x24657d);});var _0x483419=parseTagParameter(_0x1a0f1c);_0x585e4b[_0x5ac5('0x4a')]['clause'][_0x5ac5('0x3f')](_0x483419);_0x585e4b[_0x5ac5('0x4a')][_0x5ac5('0x4b')]=_0x1a0f1c;break;case'User':if(_0x4c3372['operator']===_0x5ac5('0x42')){_0x585e4b[_0x5ac5('0x4c')][_0x1479e1](_0x5ac5('0x4d'),'%'+_0x4c3372[_0x5ac5('0x3c')]+'%',null);}else{_0xb77951=_['find'](_0x465a41,[_0x5ac5('0xc'),'UserId']);_0x4c3372[_0x5ac5('0xb')]=_0x5ac5('0x4e');_0x42a5d6=as['buildExpression'](_0x4dc522,_0xb77951[_0x5ac5('0x39')],_0x4c3372);_0x585e4b['user'][_0x1479e1](_0x42a5d6[_0x5ac5('0x3b')],_0x42a5d6[_0x5ac5('0x3c')][_0x5ac5('0x3d')],_0x42a5d6['value']['end']);}break;case _0x5ac5('0x4f'):case _0x5ac5('0x50'):_0x42a5d6=as[_0x5ac5('0x38')]('me',null,_0x4c3372);_0x585e4b[_0x5ac5('0x4f')][_0x1479e1](_0x42a5d6[_0x5ac5('0x3b')],_0x42a5d6[_0x5ac5('0x3c')][_0x5ac5('0x3d')],_0x42a5d6[_0x5ac5('0x3c')][_0x5ac5('0x48')]);break;}}}return _0x585e4b;}function parseModelFields(_0x536765,_0x2d6aa5,_0xe44c3b){var _0x183e83=utils['getAccountFK'](_0x536765);var _0x5c7259=squel[_0x5ac5('0x22')]();var _0x8168fc=_(_0x2d6aa5)[_0x5ac5('0x51')]()['map'](function(_0x3a646b){return _[_0x5ac5('0x52')](_0xe44c3b,[_0x5ac5('0xc'),_0x3a646b])?_0x3a646b:undefined;})[_0x5ac5('0x53')]()[_0x5ac5('0x3c')]();if(_0x8168fc[_0x5ac5('0x36')]>0x0){_0x8168fc[_0x5ac5('0x54')](function(_0x523b11){if(_0x523b11===_0x183e83){_0x5c7259['and']('i.'+_0x183e83+'\x20IN\x20?',[][_0x5ac5('0x55')](_0x2d6aa5[_0x523b11]));}else if(_0x523b11===_0x5ac5('0x56')){var _0xc76fbd=JSON['parse'](_0x2d6aa5[_0x523b11])[_0x5ac5('0x57')];var _0x31345e=JSON[_0x5ac5('0x58')](_0x2d6aa5[_0x523b11])[_0x5ac5('0x59')];_0x5c7259[_0x5ac5('0x3f')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xc76fbd,_0x31345e);}else{if(_0x2d6aa5[_0x523b11]==='null'){_0x5c7259['and']('i.'+_0x523b11+_0x5ac5('0x5a'));}else{_0x5c7259[_0x5ac5('0x3f')]('i.'+_0x523b11+_0x5ac5('0x5b'),_0x2d6aa5[_0x523b11]);}}});}return _0x5c7259;}function parseQueryParameters(_0x3fb4c1,_0x3fc780,_0x2501c3){var _0x149d3d=getSqlClauses();return Promise[_0x5ac5('0x5c')]()[_0x5ac5('0x5d')](function(){return parseModelFields(_0x3fb4c1,_0x3fc780,_0x2501c3);})[_0x5ac5('0x5d')](function(_0x16bfcd){_0x149d3d[_0x5ac5('0x5e')][_0x5ac5('0x3f')](_0x16bfcd);return parseReadParameter(_0x3fc780[_0x5ac5('0x3e')]);})[_0x5ac5('0x5d')](function(_0x49b721){_0x149d3d[_0x5ac5('0x3e')][_0x5ac5('0x3f')](_0x49b721);return parseTagParameter(_0x3fc780['tag']);})[_0x5ac5('0x5d')](function(_0x45bd57){_0x149d3d[_0x5ac5('0x4a')][_0x5ac5('0x5f')][_0x5ac5('0x3f')](_0x45bd57);return parseSearchFilter(_0x3fb4c1,_0x3fc780[_0x5ac5('0x60')]);})['then'](function(_0x2b5329){_0x149d3d[_0x5ac5('0x60')]=_0x2b5329;return _0x149d3d;});}function checkAccountsRestrictions(_0x424bed,_0x4db247,_0x26b9d4){var _0x44e349=utils['getAccountFK'](_0x424bed);var _0x1a6428=_0x5ac5('0x61')+_['capitalize'](_0x424bed)+(_0x424bed==='chat'?'Websites':_0x5ac5('0x62'));var _0x7429bf=squel[_0x5ac5('0x22')]();return Promise[_0x5ac5('0x5c')]()[_0x5ac5('0x5d')](function(){if(_0x26b9d4[_0x5ac5('0x9')]&&_0x4db247['role']===_0x5ac5('0x8')){return _0x4db247[_0x1a6428]({'attributes':['id'],'raw':!![]});}})[_0x5ac5('0x5d')](function(_0x1f6c43){if(_0x1f6c43){if(_0x1f6c43[_0x5ac5('0x36')]===0x0){_0x7429bf[_0x5ac5('0x3f')]('i.'+_0x44e349+'\x20IS\x20NULL');}else{_0x7429bf['and']('i.'+_0x44e349+'\x20IN\x20?',_[_0x5ac5('0x16')](_0x1f6c43,'id'));}}else if(!_0x26b9d4[_0x44e349]){_0x7429bf[_0x5ac5('0x3f')]('i.'+_0x44e349+_0x5ac5('0x63'));}})[_0x5ac5('0x5d')](function(){return _0x7429bf;});}function getClosedOrderClause(_0x53bde1,_0x16aabd){var _0x38b128='';var _0x3a72ea=['i.thirdDisposition','i.secondDisposition','i.disposition'];if(_0x53bde1===_0x5ac5('0x2e')){_0x3a72ea[_0x5ac5('0x64')](_0x5ac5('0x65'));}if(_0x16aabd[_0x5ac5('0x66')]==='0'&&_0x53bde1===_0x5ac5('0x2e')){_0x38b128=_0x5ac5('0x65');}else{if(_0x16aabd['closed']==='1'){_0x3a72ea[_0x5ac5('0x67')]();}_0x38b128='CONCAT_WS(\x27\x27,\x20'+_0x3a72ea['join'](',\x20')+')';}return _0x38b128;}function getFilteredInteractions(_0x3eda7f,_0x30a2b3,_0x2b9438,_0x324ec9){var _0x3a45eb=utils[_0x5ac5('0x19')](_0x3eda7f);var _0xb02e95=_[_0x5ac5('0x68')](_0x3eda7f)+_0x5ac5('0x69');var _0x130c67=[];var _0x13e80b=getTagsQuery();var _0x1f7768={'type':db[_0x5ac5('0x6a')][_0x5ac5('0x6b')][_0x5ac5('0x6c')],'raw':!![]};var _0x46315b=[];var _0x356f1b=[];return db[_0x5ac5('0x6d')][_0x5ac5('0x6e')](_0x13e80b[_0x5ac5('0x6f')](),_0x1f7768)[_0x5ac5('0x5d')](function(_0x4b3896){_0x130c67=_[_0x5ac5('0x70')](_0x4b3896,'id');_0x1f7768=_['merge'](_0x1f7768,{'model':db[_0xb02e95],'mapToModel':!![],'nest':!![]});if(_0x2b9438[_0x5ac5('0x5e')]){_0x324ec9['attributes'][_0x5ac5('0x54')](function(_0x58b9e2){_0x30a2b3['field']('i.'+_0x58b9e2);});}else{_0x30a2b3[_0x5ac5('0xb')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5ac5('0x71'));_0x30a2b3[_0x5ac5('0xb')]('a.key',_0x5ac5('0x72'));_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x73'),_0x5ac5('0x74'));if(_0x3eda7f===_0x5ac5('0x2e')){_0x30a2b3[_0x5ac5('0xb')]('a.email',_0x5ac5('0x75'));_0x30a2b3['field'](_0x5ac5('0x76'),_0x5ac5('0x77'));_0x30a2b3[_0x5ac5('0xb')]('i.id');_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x78'));_0x30a2b3[_0x5ac5('0xb')]('i.updatedAt');_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x79'));_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x7a'));_0x30a2b3[_0x5ac5('0xb')]('i.attach');_0x30a2b3['field'](_0x5ac5('0x7b'));_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x7c'));_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x7d'));_0x30a2b3[_0x5ac5('0xb')]('i.disposition');_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x7e'));_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x7f'));_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x65'));_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x80'));_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x81'));_0x30a2b3['field'](_0x5ac5('0x82'));_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x83'));}else if(_0x3eda7f==='openchannel'){_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x84'),_0x5ac5('0x77'));}else{_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x85'),_0x5ac5('0x77'));}if(_0x3eda7f!==_0x5ac5('0x2e')){_0x30a2b3['field'](_0x5ac5('0x86'));}_0x30a2b3['field'](_0x5ac5('0x87'),_0x5ac5('0x88'));_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x89'),'Contact.lastName');_0x30a2b3[_0x5ac5('0xb')]('c.email',_0x5ac5('0x8a'));_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x8b'),'Contact.phone');_0x30a2b3[_0x5ac5('0xb')]('c.mobile',_0x5ac5('0x8c'));_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x8d'),_0x5ac5('0x8e'));_0x30a2b3['field']('o.fullname',_0x5ac5('0x8f'));_0x30a2b3['field']('o.internal',_0x5ac5('0x90'));_0x30a2b3[_0x5ac5('0xb')](_0x5ac5('0x91'),_0x5ac5('0x92'));}if(_0x324ec9['limit']){_0x30a2b3[_0x5ac5('0x93')](_0x324ec9[_0x5ac5('0x93')]);}if(_0x324ec9[_0x5ac5('0x94')]){_0x30a2b3['offset'](_0x324ec9[_0x5ac5('0x94')]);}return db[_0x5ac5('0x6d')]['query'](_0x30a2b3[_0x5ac5('0x6f')](),_0x1f7768);})['then'](function(_0x3769c3){_0x46315b=_0x3769c3;var _0x4406d8=getUsersQuery(_0x3eda7f,_0x46315b);return db[_0x5ac5('0x6d')][_0x5ac5('0x6e')](_0x4406d8['toString'](),_0x1f7768);})[_0x5ac5('0x5d')](function(_0x517e24){_0x356f1b=_[_0x5ac5('0x95')](_0x517e24,_0x3a45eb);if(_0x3eda7f===_0x5ac5('0x2e')){return db[_0x5ac5('0x96')]['findOne']({'attributes':[_0x5ac5('0x97')],'raw':!![]});}})[_0x5ac5('0x5d')](function(_0x33463e){var _0x3a26fd=_0x33463e?_0x33463e[_0x5ac5('0x97')]:undefined;var _0x18aaa3=_0x46315b['map'](function(_0x457f93){return updateInteraction(_0x457f93,_0x130c67,_0x356f1b,_0x3a26fd);});return Promise[_0x5ac5('0x98')](_0x18aaa3);});}function countFilteredInteractions(_0x4ada39,_0x38a977){var _0x3d4ffa=_0x4ada39[_0x5ac5('0x99')]();_0x3d4ffa['field']('COUNT(*)');_0x3d4ffa['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5ac5('0x71'));var _0x2b280e=utils[_0x5ac5('0x23')](_0x38a977);if(!_['isEmpty'](_0x2b280e)){_0x3d4ffa[_0x5ac5('0x13')]('t.id\x20IN\x20?',_0x2b280e);}var _0x61f022={'type':db['Sequelize'][_0x5ac5('0x6b')]['SELECT'],'raw':!![]};return db[_0x5ac5('0x6d')][_0x5ac5('0x6e')](_0x3d4ffa[_0x5ac5('0x6f')](),_0x61f022);}module[_0x5ac5('0x9a')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xcea2=['Setting','findOne','enableEmailPreview','all','isEmpty','t.id\x20IN\x20?','SELECT','exports','lodash','../parsers/advancedSearch','./update-interaction','updateInteraction','./utils','role','agent','search','select','field','color','from','tools_tags','getInteractionFK','_interactions','u.id','u.fullname','ui.','u.id\x20=\x20ui.UserId','where','\x20IN\x20?','map','getInteractionsTables','interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','parseSearch','conditions','find','default','end','value','read','Contact','operator','$substring','split','length','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','name','ContactId','buildExpression','text','start','Tag','tags','and','ids','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','body','plainBody','getAccountFK','keys','some','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','then','tag','clause','filter','capitalize','chat','Websites','Accounts','resolve','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','sequelize','keyBy','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','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','c.firstName','Contact.firstName','c.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','TagIds','limit','offset','query','toString','groupBy'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xcea2,0x15a));var _0x2cea=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xcea2[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x2cea('0x0'));var squel=require('squel');var as=require(_0x2cea('0x1'));var qs=require('../parsers/qs');var updateInteraction=require(_0x2cea('0x2'))[_0x2cea('0x3')];var utils=require(_0x2cea('0x4'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x3ff73f,_0x46060b,_0x11596e){var _0x496c21=![];var _0x34f0f2=utils['getAccountFK'](_0x3ff73f);if(_0x46060b[_0x2cea('0x5')]===_0x2cea('0x6')&&!_0x11596e[_0x2cea('0x7')]&&!_0x11596e[_0x34f0f2]){_0x496c21=!![];}return _0x496c21;}function getTagsQuery(){return squel[_0x2cea('0x8')]()[_0x2cea('0x9')]('id')[_0x2cea('0x9')]('name')[_0x2cea('0x9')](_0x2cea('0xa'))[_0x2cea('0xb')](_0x2cea('0xc'));}function getUsersQuery(_0x306cf7,_0x439c4d){var _0x4298a4=utils[_0x2cea('0xd')](_0x306cf7);var _0x58a102='user_has_'+_0x306cf7+_0x2cea('0xe');var _0x2db0ff=squel['select']()['field'](_0x2cea('0xf'))['field'](_0x2cea('0x10'))[_0x2cea('0x9')](_0x2cea('0x11')+_0x4298a4)['from'](_0x58a102,'ui')['left_join']('users','u',_0x2cea('0x12'));if(_0x439c4d['length']>0x0){_0x2db0ff[_0x2cea('0x13')](_0x2cea('0x11')+_0x4298a4+_0x2cea('0x14'),_[_0x2cea('0x15')](_0x439c4d,'id'));}return _0x2db0ff;}function getInteractionsQuery(_0x232dad){var _0x1bbfdb=utils[_0x2cea('0x16')](_0x232dad);var _0x1ead4c=utils['getAccountFK'](_0x232dad);var _0x19927a=utils[_0x2cea('0xd')](_0x232dad);return squel[_0x2cea('0x8')]()[_0x2cea('0xb')](_0x1bbfdb[_0x2cea('0x17')],'i')[_0x2cea('0x18')]('cm_contacts','c',_0x2cea('0x19'))['left_join'](_0x2cea('0x1a'),'o',_0x2cea('0x1b'))[_0x2cea('0x18')](_0x1bbfdb['accounts'],'a',_0x2cea('0x1c')+_0x1ead4c)[_0x2cea('0x18')](_0x1bbfdb[_0x2cea('0x1d')],'me',_0x2cea('0x1e')+_0x19927a+_0x2cea('0x1f'))[_0x2cea('0x18')](_0x1bbfdb[_0x2cea('0x20')],'it','it.'+_0x19927a+_0x2cea('0x1f'))['left_join'](_0x2cea('0xc'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x3966d5={'body':squel[_0x2cea('0x21')](),'contact':squel['expr'](),'default':squel[_0x2cea('0x21')](),'fields':squel[_0x2cea('0x21')](),'filter':squel[_0x2cea('0x21')](),'read':squel[_0x2cea('0x21')](),'tags':{'clause':squel[_0x2cea('0x21')](),'ids':null},'user':squel[_0x2cea('0x21')]()};return _0x3966d5;}function parseTagParameter(_0x5d032f){var _0x4ec9b3=squel[_0x2cea('0x21')]();if(_0x5d032f){var _0x2bbe9b=utils[_0x2cea('0x22')](_0x5d032f);_0x2bbe9b[_0x2cea('0x23')](function(_0x3ea40c){_0x4ec9b3['or'](_0x2cea('0x24'),'%,'+_0x3ea40c+',%');});}return _0x4ec9b3;}function parseReadParameter(_0x2741cb){var _0x4e9cab='';if(_0x2741cb){_0x4e9cab=_0x2cea('0x25');if(_0x2741cb==='1'){_0x4e9cab=_0x4e9cab[_0x2cea('0x26')]('{OPERATOR}','=');}else{_0x4e9cab=_0x4e9cab[_0x2cea('0x26')](_0x2cea('0x27'),'>');}}return _0x4e9cab;}function parseSearchFilter(_0x271b2f,_0x16cf9f){var _0x5e0519=squel[_0x2cea('0x21')]();if(_0x16cf9f){var _0x128934=_0x16cf9f['replace']('\x5c','\x5c\x5c')[_0x2cea('0x26')](/'/g,'\x27\x27');if(qs[_0x2cea('0x28')](_0x128934)){_0x5e0519['or'](_0x2cea('0x29'),_0x128934+'%');if([_0x2cea('0x2a'),_0x2cea('0x2b')][_0x2cea('0x2c')](_0x271b2f)){_0x5e0519['or'](_0x2cea('0x2d'),_0x128934+'%');}else if(_0x271b2f===_0x2cea('0x2e')){_0x5e0519['or'](_0x2cea('0x2f'),_0x128934+'%');}else if(_0x271b2f===_0x2cea('0x30')){_0x5e0519['or'](_0x2cea('0x31'),_0x128934+'%');}}else if(_0x271b2f==='mail'&&qs[_0x2cea('0x32')](_0x128934)){_0x5e0519['or'](_0x2cea('0x33'),_0x128934+'%');}else{if(_0x271b2f===_0x2cea('0x34')){_0x5e0519['or'](_0x2cea('0x35'),qs['getFullTextValue'](_0x128934))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2cea('0x36')](_0x128934));}else{if(_0x271b2f!==_0x2cea('0x2e')){_0x5e0519['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2cea('0x36')](_0x128934));}_0x5e0519['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x128934+'%');}}}return _0x5e0519;}function parseAdvancedSearchFilter(_0x3332db,_0x48a5d4){var _0x510d66=getSqlClauses();var _0x5bd36b=as[_0x2cea('0x37')](_0x3332db);var _0x4518eb=_0x5bd36b['sqlOperator'];for(var _0x389a2c=0x0;_0x389a2c<_0x5bd36b[_0x2cea('0x38')]['length'];_0x389a2c++){var _0x24b67d=_0x5bd36b[_0x2cea('0x38')][_0x389a2c];var _0x40c96f='i';var _0x3c9f6e=_[_0x2cea('0x39')](_0x48a5d4,['name',_0x24b67d[_0x2cea('0x9')]]);if(_0x3c9f6e){var _0x69e6e8=as['buildExpression'](_0x40c96f,_0x3c9f6e['type'],_0x24b67d);_0x510d66[_0x2cea('0x3a')][_0x4518eb](_0x69e6e8['text'],_0x69e6e8['value']['start'],_0x69e6e8['value'][_0x2cea('0x3b')]);}else{switch(_0x24b67d[_0x2cea('0x9')]){case'unreadMessages':var _0x219560=parseReadParameter(_0x24b67d[_0x2cea('0x3c')]);_0x510d66[_0x2cea('0x3d')]['and'](_0x219560);break;case _0x2cea('0x3e'):if(_0x24b67d[_0x2cea('0x3f')]===_0x2cea('0x40')){if(_0x24b67d[_0x2cea('0x3c')][_0x2cea('0x41')]('\x20')[_0x2cea('0x42')]>0x1){_0x510d66[_0x2cea('0x43')][_0x4518eb](_0x2cea('0x44'),qs[_0x2cea('0x36')](_0x24b67d[_0x2cea('0x3c')]),null);}else{var _0x3c0b91='%'+_0x24b67d[_0x2cea('0x3c')]+'%';_0x510d66[_0x2cea('0x43')][_0x4518eb](_0x2cea('0x45'),_0x3c0b91,_0x3c0b91,_0x3c0b91);}}else{_0x3c9f6e=_[_0x2cea('0x39')](_0x48a5d4,[_0x2cea('0x46'),_0x2cea('0x47')]);_0x24b67d[_0x2cea('0x9')]='ContactId';_0x69e6e8=as[_0x2cea('0x48')](_0x40c96f,_0x3c9f6e['type'],_0x24b67d);_0x510d66[_0x2cea('0x43')][_0x4518eb](_0x69e6e8[_0x2cea('0x49')],_0x69e6e8[_0x2cea('0x3c')][_0x2cea('0x4a')],_0x69e6e8[_0x2cea('0x3c')][_0x2cea('0x3b')]);}break;case _0x2cea('0x4b'):var _0x352621=_0x24b67d[_0x2cea('0x3c')][_0x2cea('0x41')](',')['map'](function(_0x515494){return Number(_0x515494);});var _0x1be683=parseTagParameter(_0x352621);_0x510d66[_0x2cea('0x4c')]['clause'][_0x2cea('0x4d')](_0x1be683);_0x510d66['tags'][_0x2cea('0x4e')]=_0x352621;break;case'User':if(_0x24b67d[_0x2cea('0x3f')]===_0x2cea('0x40')){_0x510d66[_0x2cea('0x4f')][_0x4518eb](_0x2cea('0x50'),'%'+_0x24b67d[_0x2cea('0x3c')]+'%',null);}else{_0x3c9f6e=_[_0x2cea('0x39')](_0x48a5d4,[_0x2cea('0x46'),_0x2cea('0x51')]);_0x24b67d[_0x2cea('0x9')]=_0x2cea('0x51');_0x69e6e8=as['buildExpression'](_0x40c96f,_0x3c9f6e[_0x2cea('0x52')],_0x24b67d);_0x510d66[_0x2cea('0x4f')][_0x4518eb](_0x69e6e8[_0x2cea('0x49')],_0x69e6e8[_0x2cea('0x3c')]['start'],_0x69e6e8['value'][_0x2cea('0x3b')]);}break;case _0x2cea('0x53'):case _0x2cea('0x54'):_0x69e6e8=as['buildExpression']('me',null,_0x24b67d);_0x510d66[_0x2cea('0x53')][_0x4518eb](_0x69e6e8[_0x2cea('0x49')],_0x69e6e8[_0x2cea('0x3c')][_0x2cea('0x4a')],_0x69e6e8['value'][_0x2cea('0x3b')]);break;}}}return _0x510d66;}function parseModelFields(_0x526e92,_0x4d1b77,_0x42379a){var _0x8a8cae=utils[_0x2cea('0x55')](_0x526e92);var _0x3af41f=squel['expr']();var _0x492fcf=_(_0x4d1b77)[_0x2cea('0x56')]()[_0x2cea('0x15')](function(_0x464b89){return _[_0x2cea('0x57')](_0x42379a,['name',_0x464b89])?_0x464b89:undefined;})['compact']()['value']();if(_0x492fcf[_0x2cea('0x42')]>0x0){_0x492fcf[_0x2cea('0x23')](function(_0x127069){if(_0x127069===_0x8a8cae){_0x3af41f[_0x2cea('0x4d')]('i.'+_0x8a8cae+_0x2cea('0x14'),[][_0x2cea('0x58')](_0x4d1b77[_0x127069]));}else if(_0x127069===_0x2cea('0x59')){var _0x4d31dc=JSON[_0x2cea('0x5a')](_0x4d1b77[_0x127069])[_0x2cea('0x5b')];var _0x3ccb9f=JSON['parse'](_0x4d1b77[_0x127069])[_0x2cea('0x5c')];_0x3af41f['and'](_0x2cea('0x5d'),_0x4d31dc,_0x3ccb9f);}else{if(_0x4d1b77[_0x127069]===_0x2cea('0x5e')){_0x3af41f[_0x2cea('0x4d')]('i.'+_0x127069+_0x2cea('0x5f'));}else{_0x3af41f[_0x2cea('0x4d')]('i.'+_0x127069+_0x2cea('0x60'),_0x4d1b77[_0x127069]);}}});}return _0x3af41f;}function parseQueryParameters(_0x33f411,_0x326fb2,_0x5b6baf){var _0x2a4148=getSqlClauses();return Promise['resolve']()[_0x2cea('0x61')](function(){return parseModelFields(_0x33f411,_0x326fb2,_0x5b6baf);})[_0x2cea('0x61')](function(_0x400a80){_0x2a4148['fields'][_0x2cea('0x4d')](_0x400a80);return parseReadParameter(_0x326fb2['read']);})['then'](function(_0x264aa5){_0x2a4148[_0x2cea('0x3d')][_0x2cea('0x4d')](_0x264aa5);return parseTagParameter(_0x326fb2[_0x2cea('0x62')]);})[_0x2cea('0x61')](function(_0x581b18){_0x2a4148['tags'][_0x2cea('0x63')][_0x2cea('0x4d')](_0x581b18);return parseSearchFilter(_0x33f411,_0x326fb2[_0x2cea('0x64')]);})[_0x2cea('0x61')](function(_0x526269){_0x2a4148[_0x2cea('0x64')]=_0x526269;return _0x2a4148;});}function checkAccountsRestrictions(_0x5ae31b,_0x372921,_0x3a7daf){var _0x35d64b=utils[_0x2cea('0x55')](_0x5ae31b);var _0x221c16='get'+_[_0x2cea('0x65')](_0x5ae31b)+(_0x5ae31b===_0x2cea('0x66')?_0x2cea('0x67'):_0x2cea('0x68'));var _0x43922e=squel['expr']();return Promise[_0x2cea('0x69')]()[_0x2cea('0x61')](function(){if(_0x3a7daf['search']&&_0x372921[_0x2cea('0x5')]===_0x2cea('0x6')){return _0x372921[_0x221c16]({'attributes':['id'],'raw':!![]});}})[_0x2cea('0x61')](function(_0xd51dd5){if(_0xd51dd5){if(_0xd51dd5['length']===0x0){_0x43922e['and']('i.'+_0x35d64b+_0x2cea('0x5f'));}else{_0x43922e[_0x2cea('0x4d')]('i.'+_0x35d64b+'\x20IN\x20?',_[_0x2cea('0x15')](_0xd51dd5,'id'));}}else if(!_0x3a7daf[_0x35d64b]){_0x43922e[_0x2cea('0x4d')]('i.'+_0x35d64b+'\x20IS\x20NOT\x20NULL');}})[_0x2cea('0x61')](function(){return _0x43922e;});}function getClosedOrderClause(_0x34a4e1,_0x82198){var _0x42881c='';var _0x14daae=['i.thirdDisposition',_0x2cea('0x6a'),_0x2cea('0x6b')];if(_0x34a4e1==='mail'){_0x14daae[_0x2cea('0x6c')](_0x2cea('0x6d'));}if(_0x82198[_0x2cea('0x6e')]==='0'&&_0x34a4e1===_0x2cea('0x34')){_0x42881c=_0x2cea('0x6d');}else{if(_0x82198[_0x2cea('0x6e')]==='1'){_0x14daae[_0x2cea('0x6f')]();}_0x42881c=_0x2cea('0x70')+_0x14daae[_0x2cea('0x71')](',\x20')+')';}return _0x42881c;}function getFilteredInteractions(_0x225d1b,_0x45e266,_0x175d9a,_0x400459){var _0x54abde=utils['getInteractionFK'](_0x225d1b);var _0x1364c3=_[_0x2cea('0x65')](_0x225d1b)+_0x2cea('0x72');var _0x104051=[];var _0x3c51e8=getTagsQuery();var _0x3bb026={'type':db[_0x2cea('0x73')]['QueryTypes']['SELECT'],'raw':!![]};var _0x1dfeaf=[];var _0x1875d4=[];return db[_0x2cea('0x74')]['query'](_0x3c51e8['toString'](),_0x3bb026)['then'](function(_0x3e2c5c){_0x104051=_[_0x2cea('0x75')](_0x3e2c5c,'id');_0x3bb026=_['merge'](_0x3bb026,{'model':db[_0x1364c3],'mapToModel':!![],'nest':!![]});if(_0x175d9a['fields']){_0x400459[_0x2cea('0x76')][_0x2cea('0x23')](function(_0x77f341){_0x45e266[_0x2cea('0x9')]('i.'+_0x77f341);});}else{_0x45e266[_0x2cea('0x9')](_0x2cea('0x77'),_0x2cea('0x78'));_0x45e266[_0x2cea('0x9')]('a.key',_0x2cea('0x79'));_0x45e266[_0x2cea('0x9')](_0x2cea('0x7a'),_0x2cea('0x7b'));if(_0x225d1b===_0x2cea('0x34')){_0x45e266['field'](_0x2cea('0x7c'),_0x2cea('0x7d'));_0x45e266['field'](_0x2cea('0x7e'),_0x2cea('0x7f'));_0x45e266[_0x2cea('0x9')](_0x2cea('0x80'));_0x45e266['field'](_0x2cea('0x81'));_0x45e266[_0x2cea('0x9')](_0x2cea('0x82'));_0x45e266['field'](_0x2cea('0x83'));_0x45e266[_0x2cea('0x9')](_0x2cea('0x84'));_0x45e266[_0x2cea('0x9')](_0x2cea('0x85'));_0x45e266[_0x2cea('0x9')](_0x2cea('0x86'));_0x45e266[_0x2cea('0x9')](_0x2cea('0x87'));_0x45e266['field'](_0x2cea('0x88'));_0x45e266[_0x2cea('0x9')](_0x2cea('0x6b'));_0x45e266[_0x2cea('0x9')]('i.secondDisposition');_0x45e266[_0x2cea('0x9')](_0x2cea('0x89'));_0x45e266[_0x2cea('0x9')](_0x2cea('0x6d'));_0x45e266['field'](_0x2cea('0x8a'));_0x45e266[_0x2cea('0x9')](_0x2cea('0x8b'));_0x45e266[_0x2cea('0x9')](_0x2cea('0x8c'));_0x45e266[_0x2cea('0x9')](_0x2cea('0x8d'));}else if(_0x225d1b===_0x2cea('0x30')){_0x45e266[_0x2cea('0x9')](_0x2cea('0x8e'),_0x2cea('0x7f'));}else{_0x45e266[_0x2cea('0x9')](_0x2cea('0x8f'),_0x2cea('0x7f'));}if(_0x225d1b!=='mail'){_0x45e266[_0x2cea('0x9')]('i.*');}_0x45e266[_0x2cea('0x9')](_0x2cea('0x90'),_0x2cea('0x91'));_0x45e266[_0x2cea('0x9')](_0x2cea('0x92'),'Contact.lastName');_0x45e266[_0x2cea('0x9')]('c.email','Contact.email');_0x45e266[_0x2cea('0x9')](_0x2cea('0x93'),_0x2cea('0x94'));_0x45e266['field'](_0x2cea('0x95'),_0x2cea('0x96'));_0x45e266[_0x2cea('0x9')](_0x2cea('0x97'),'Contact.fax');_0x45e266[_0x2cea('0x9')](_0x2cea('0x98'),'Owner.fullname');_0x45e266[_0x2cea('0x9')](_0x2cea('0x99'),_0x2cea('0x9a'));_0x45e266[_0x2cea('0x9')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2cea('0x9b'));}if(_0x400459['limit']){_0x45e266[_0x2cea('0x9c')](_0x400459[_0x2cea('0x9c')]);}if(_0x400459[_0x2cea('0x9d')]){_0x45e266[_0x2cea('0x9d')](_0x400459[_0x2cea('0x9d')]);}return db[_0x2cea('0x74')][_0x2cea('0x9e')](_0x45e266[_0x2cea('0x9f')](),_0x3bb026);})[_0x2cea('0x61')](function(_0x287ebf){_0x1dfeaf=_0x287ebf;var _0x75a462=getUsersQuery(_0x225d1b,_0x1dfeaf);return db[_0x2cea('0x74')][_0x2cea('0x9e')](_0x75a462[_0x2cea('0x9f')](),_0x3bb026);})[_0x2cea('0x61')](function(_0x1a2f79){_0x1875d4=_[_0x2cea('0xa0')](_0x1a2f79,_0x54abde);if(_0x225d1b===_0x2cea('0x34')){return db[_0x2cea('0xa1')][_0x2cea('0xa2')]({'attributes':[_0x2cea('0xa3')],'raw':!![]});}})['then'](function(_0x3d94e2){var _0x270a07=_0x3d94e2?_0x3d94e2[_0x2cea('0xa3')]:undefined;var _0x5aec87=_0x1dfeaf[_0x2cea('0x15')](function(_0x437c21){return updateInteraction(_0x437c21,_0x104051,_0x1875d4,_0x270a07);});return Promise[_0x2cea('0xa4')](_0x5aec87);});}function countFilteredInteractions(_0x89acb6,_0x1e2b88){var _0x52f796=_0x89acb6['clone']();_0x52f796['field']('COUNT(*)');_0x52f796[_0x2cea('0x9')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2cea('0x78'));var _0x52db25=utils[_0x2cea('0x22')](_0x1e2b88);if(!_[_0x2cea('0xa5')](_0x52db25)){_0x52f796[_0x2cea('0x13')](_0x2cea('0xa6'),_0x52db25);}var _0x5e9c7e={'type':db[_0x2cea('0x73')]['QueryTypes'][_0x2cea('0xa7')],'raw':!![]};return db[_0x2cea('0x74')][_0x2cea('0x9e')](_0x52f796[_0x2cea('0x9f')](),_0x5e9c7e);}module[_0x2cea('0xa8')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index c0c30cc..e77b389 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 _0x7727=['waiting','total','closed','abandoned','UserId','talking','disposition','unmanaged','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','Users','Tags','TagIds','catch','lodash','../../mysqldb','map','fullname','split','forEach','push'];(function(_0x45b47b,_0x320f20){var _0x489cb7=function(_0x4f9902){while(--_0x4f9902){_0x45b47b['push'](_0x45b47b['shift']());}};_0x489cb7(++_0x320f20);}(_0x7727,0xc9));var _0x7772=function(_0x252249,_0x51b202){_0x252249=_0x252249-0x0;var _0x1c1548=_0x7727[_0x252249];return _0x1c1548;};'use strict';var _=require(_0x7772('0x0'));var db=require(_0x7772('0x1'))['db'];function getInteractionUsers(_0x2678bf,_0x47642a){return new Promise(function(_0x90f8f9,_0x1b7fcb){try{var _0x3d50d4=[];if(_0x47642a[_0x2678bf]){_0x3d50d4=_0x47642a[_0x2678bf][_0x7772('0x2')](function(_0x479ac4){return{'id':_0x479ac4['id'],'fullname':_0x479ac4[_0x7772('0x3')]};});}return _0x90f8f9(_0x3d50d4);}catch(_0x5b3897){_0x1b7fcb(_0x5b3897);}});}function getInteractionTags(_0x1b7909,_0x5c9e17){var _0x598819=[];if(_0x1b7909){_0x1b7909[_0x7772('0x4')](',')[_0x7772('0x5')](function(_0x3ac229){_0x598819[_0x7772('0x6')](_0x5c9e17[_0x3ac229]);});}return _0x598819;}function updateWaitingCounter(_0x52ee34){if(_0x52ee34[_0x7772('0x7')]){_0x52ee34[_0x7772('0x7')]-=0x1;}}function updateInteractionCounters(_0x9324b2){_0x9324b2[_0x7772('0x7')]=0x0;_0x9324b2['talking']=0x0;_0x9324b2['answered']=0x0;_0x9324b2['unmanaged']=0x0;_0x9324b2['abandoned']=0x0;_0x9324b2[_0x7772('0x8')]=0x0;if(_0x9324b2[_0x7772('0x9')]){if(_0x9324b2['disposition']==='abandoned'){_0x9324b2[_0x7772('0xa')]+=0x1;updateWaitingCounter(_0x9324b2);}if(_0x9324b2[_0x7772('0xb')]){_0x9324b2['answered']+=0x1;if(_0x9324b2['talking']){_0x9324b2[_0x7772('0xc')]-=0x1;}}else{if(_0x9324b2[_0x7772('0xd')]){_0x9324b2[_0x7772('0xe')]+=0x1;updateWaitingCounter(_0x9324b2);}}}else{if(!_0x9324b2[_0x7772('0xb')]){_0x9324b2[_0x7772('0x7')]+=0x1;}if(_0x9324b2[_0x7772('0xb')]){_0x9324b2[_0x7772('0xc')]+=0x1;updateWaitingCounter(_0x9324b2);}}_0x9324b2[_0x7772('0x8')]+=0x1;return _0x9324b2;}function getLastMessageText(_0x222429){return db[_0x7772('0xf')][_0x7772('0x10')]({'where':{'$and':[{'MailInteractionId':_0x222429['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x7772('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x7772('0x12')],'order':_0x7772('0x13'),'raw':!![]})[_0x7772('0x14')](function(_0x38085f){if(_0x38085f&&_0x38085f[_0x7772('0x12')]){_0x222429[_0x7772('0x15')]=_['trimStart'](_0x38085f[_0x7772('0x12')]);}return _0x222429;})['catch'](function(_0x5e3867){throw _0x5e3867;});}exports['updateInteraction']=function(_0x4b7562,_0x242b0b,_0x37d366,_0x453278){return new Promise(function(_0x36612f,_0x14e43b){return getInteractionUsers(_0x4b7562['id'],_0x37d366)[_0x7772('0x14')](function(_0x33bb2a){_0x4b7562[_0x7772('0x16')]=_0x33bb2a;return getInteractionTags(_0x4b7562['TagIds'],_0x242b0b);})[_0x7772('0x14')](function(_0x578e33){_0x4b7562[_0x7772('0x17')]=_0x578e33;delete _0x4b7562[_0x7772('0x18')];return updateInteractionCounters(_0x4b7562);})[_0x7772('0x14')](function(_0x29b346){if(_0x453278){return getLastMessageText(_0x29b346);}else{return _0x29b346;}})[_0x7772('0x14')](function(_0x1e4d16){_0x36612f(_0x1e4d16);})[_0x7772('0x19')](function(_0xf163ad){_0x14e43b(_0xf163ad);});});}; \ No newline at end of file +var _0x60e5=['map','fullname','split','forEach','push','waiting','answered','unmanaged','abandoned','total','closed','UserId','talking','disposition','plainBody','then','lastMsgText','catch','Users','TagIds','Tags','lodash'];(function(_0x450af0,_0x3acbd3){var _0x4e9372=function(_0x4a6abb){while(--_0x4a6abb){_0x450af0['push'](_0x450af0['shift']());}};_0x4e9372(++_0x3acbd3);}(_0x60e5,0x6d));var _0x560e=function(_0x1b8b95,_0x3ea343){_0x1b8b95=_0x1b8b95-0x0;var _0x3657ae=_0x60e5[_0x1b8b95];return _0x3657ae;};'use strict';var _=require(_0x560e('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x47901e,_0x16d72c){return new Promise(function(_0x167717,_0x219a1d){try{var _0xd2aae6=[];if(_0x16d72c[_0x47901e]){_0xd2aae6=_0x16d72c[_0x47901e][_0x560e('0x1')](function(_0x4cf658){return{'id':_0x4cf658['id'],'fullname':_0x4cf658[_0x560e('0x2')]};});}return _0x167717(_0xd2aae6);}catch(_0x30eef1){_0x219a1d(_0x30eef1);}});}function getInteractionTags(_0x175fd1,_0x54eb68){var _0x216a8f=[];if(_0x175fd1){_0x175fd1[_0x560e('0x3')](',')[_0x560e('0x4')](function(_0x5a7f0c){_0x216a8f[_0x560e('0x5')](_0x54eb68[_0x5a7f0c]);});}return _0x216a8f;}function updateWaitingCounter(_0x17339d){if(_0x17339d['waiting']){_0x17339d[_0x560e('0x6')]-=0x1;}}function updateInteractionCounters(_0x211218){_0x211218[_0x560e('0x6')]=0x0;_0x211218['talking']=0x0;_0x211218[_0x560e('0x7')]=0x0;_0x211218[_0x560e('0x8')]=0x0;_0x211218[_0x560e('0x9')]=0x0;_0x211218[_0x560e('0xa')]=0x0;if(_0x211218[_0x560e('0xb')]){if(_0x211218['disposition']===_0x560e('0x9')){_0x211218['abandoned']+=0x1;updateWaitingCounter(_0x211218);}if(_0x211218[_0x560e('0xc')]){_0x211218[_0x560e('0x7')]+=0x1;if(_0x211218['talking']){_0x211218[_0x560e('0xd')]-=0x1;}}else{if(_0x211218[_0x560e('0xe')]){_0x211218['unmanaged']+=0x1;updateWaitingCounter(_0x211218);}}}else{if(!_0x211218[_0x560e('0xc')]){_0x211218['waiting']+=0x1;}if(_0x211218[_0x560e('0xc')]){_0x211218[_0x560e('0xd')]+=0x1;updateWaitingCounter(_0x211218);}}_0x211218[_0x560e('0xa')]+=0x1;return _0x211218;}function getLastMessageText(_0x35c1ef){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x35c1ef['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x560e('0xf')],'order':'-id','raw':!![]})[_0x560e('0x10')](function(_0x21d110){if(_0x21d110&&_0x21d110[_0x560e('0xf')]){_0x35c1ef[_0x560e('0x11')]=_['trimStart'](_0x21d110[_0x560e('0xf')]);}return _0x35c1ef;})[_0x560e('0x12')](function(_0x1e798c){throw _0x1e798c;});}exports['updateInteraction']=function(_0x814848,_0x12a9ed,_0xf9b00f,_0x3d052d){return new Promise(function(_0x21d993,_0x4316ac){return getInteractionUsers(_0x814848['id'],_0xf9b00f)[_0x560e('0x10')](function(_0x5401fa){_0x814848[_0x560e('0x13')]=_0x5401fa;return getInteractionTags(_0x814848[_0x560e('0x14')],_0x12a9ed);})[_0x560e('0x10')](function(_0x149542){_0x814848[_0x560e('0x15')]=_0x149542;delete _0x814848[_0x560e('0x14')];return updateInteractionCounters(_0x814848);})[_0x560e('0x10')](function(_0x3c6f37){if(_0x3d052d){return getLastMessageText(_0x3c6f37);}else{return _0x3c6f37;}})[_0x560e('0x10')](function(_0x12a271){_0x21d993(_0x12a271);})[_0x560e('0x12')](function(_0x463efc){_0x4316ac(_0x463efc);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index a9f7132..6eccaad 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 _0xaf8c=['mail-interactions','fax-interactions','sms-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','null','findOne','then','info','error','exports','../../mysqldb','../../config/logger'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xaf8c,0x72));var _0xcaf8=function(_0x447083,_0x4937bb){_0x447083=_0x447083-0x0;var _0x2480a1=_0xaf8c[_0x447083];return _0x2480a1;};'use strict';var _=require('lodash');var db=require(_0xcaf8('0x0'))['db'];var loggers={'openchannel':require(_0xcaf8('0x1'))('openchannel-interactions'),'mail':require(_0xcaf8('0x1'))(_0xcaf8('0x2')),'fax':require(_0xcaf8('0x1'))(_0xcaf8('0x3')),'sms':require(_0xcaf8('0x1'))(_0xcaf8('0x4')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0xcaf8('0x1'))(_0xcaf8('0x5'))};function getAccountFK(_0x22c0b4){return _[_0xcaf8('0x6')](_0x22c0b4)+(_0x22c0b4===_0xcaf8('0x7')?_0xcaf8('0x8'):_0xcaf8('0x9'))+'Id';}function getInteractionFK(_0x51627c){return _['capitalize'](_0x51627c)+_0xcaf8('0xa');}function getInteractionId(_0x306d78,_0x50b8f8,_0x4aeca8){if(_0x306d78&&_0x306d78[_['upperFirst'](_0x4aeca8)+_0xcaf8('0xa')]){return _0x306d78[_[_0xcaf8('0xb')](_0x4aeca8)+'InteractionId'];}else if(_0x306d78&&_0x306d78['id']){return _0x306d78['id'];}else if(_0x50b8f8&&_0x50b8f8['id']){return _0x50b8f8['id'];}else{return _0xcaf8('0xc');}}function getInteractionsTables(_0x45d12a){return{'accounts':_0x45d12a+'_'+(_0x45d12a==='chat'?_0xcaf8('0xd'):_0xcaf8('0xe')),'interactions':_0x45d12a+_0xcaf8('0xf'),'interactionsTags':_0x45d12a+_0xcaf8('0x10'),'messages':_0x45d12a+_0xcaf8('0x11'),'userInteractions':_0xcaf8('0x12')+_0x45d12a+_0xcaf8('0xf')};}function getSelectedTags(_0x2515f4){var _0x1ec359=[];if(_0x2515f4){_0x1ec359=Array['isArray'](_0x2515f4)?_0x2515f4:[_0x2515f4];}return _0x1ec359;}function log(_0x975b59,_0x450d34,_0x4d3c4a,_0x101ac1,_0x44090e,_0x1a4806){loggers[_0x44090e[_0xcaf8('0x13')]()][_0x975b59](_0xcaf8('0x14'),_0x1a4806[_0xcaf8('0x15')](),_0x450d34?_0x450d34['id']:null,_0x450d34?_0x450d34['name']:null,_0x450d34?_0x450d34[_0xcaf8('0x16')]:null,getInteractionId(_0x4d3c4a,_0x101ac1,_0x44090e),_0x4d3c4a?JSON['stringify'](_0x4d3c4a):_0xcaf8('0x17'));}function updateUser(_0x47a718,_0x54fae4,_0x50a008,_0xd6cc26,_0x34e903){db[_[_0xcaf8('0xb')](_0xd6cc26)+'Interaction'][_0xcaf8('0x18')]({'where':{'id':getInteractionId(_0x54fae4,_0x50a008,_0xd6cc26)}})[_0xcaf8('0x19')](function(_0x2a5c4e){if(_0x2a5c4e){return _0x2a5c4e['update']({'UserId':_0x47a718?_0x47a718['id']:null});}})['then'](function(_0x3b31b4){if(_0x3b31b4){log(_0xcaf8('0x1a'),_0x47a718,_0x54fae4,_0x50a008,_0xd6cc26,_0x34e903);}})['catch'](function(){log(_0xcaf8('0x1b'),_0x47a718,_0x54fae4,_0x50a008,_0xd6cc26,_0x34e903);});}module[_0xcaf8('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x3415=['catch','error','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toUpperCase','role','stringify','null','Interaction','findOne','update','then','info'];(function(_0x53f002,_0x4f1f7b){var _0x490524=function(_0x13d95f){while(--_0x13d95f){_0x53f002['push'](_0x53f002['shift']());}};_0x490524(++_0x4f1f7b);}(_0x3415,0xcd));var _0x5341=function(_0x24ecd0,_0x297246){_0x24ecd0=_0x24ecd0-0x0;var _0x589d05=_0x3415[_0x24ecd0];return _0x589d05;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x5341('0x0'))(_0x5341('0x1')),'mail':require(_0x5341('0x0'))(_0x5341('0x2')),'fax':require('../../config/logger')(_0x5341('0x3')),'sms':require(_0x5341('0x0'))('sms-interactions'),'chat':require('../../config/logger')(_0x5341('0x4')),'whatsapp':require(_0x5341('0x0'))(_0x5341('0x5'))};function getAccountFK(_0x329259){return _[_0x5341('0x6')](_0x329259)+(_0x329259===_0x5341('0x7')?'Website':'Account')+'Id';}function getInteractionFK(_0x5fbc86){return _[_0x5341('0x6')](_0x5fbc86)+_0x5341('0x8');}function getInteractionId(_0xfe599a,_0x1f3af7,_0x2880fd){if(_0xfe599a&&_0xfe599a[_[_0x5341('0x9')](_0x2880fd)+'InteractionId']){return _0xfe599a[_[_0x5341('0x9')](_0x2880fd)+'InteractionId'];}else if(_0xfe599a&&_0xfe599a['id']){return _0xfe599a['id'];}else if(_0x1f3af7&&_0x1f3af7['id']){return _0x1f3af7['id'];}else{return _0x5341('0xa');}}function getInteractionsTables(_0x2c786a){return{'accounts':_0x2c786a+'_'+(_0x2c786a===_0x5341('0x7')?_0x5341('0xb'):_0x5341('0xc')),'interactions':_0x2c786a+_0x5341('0xd'),'interactionsTags':_0x2c786a+_0x5341('0xe'),'messages':_0x2c786a+_0x5341('0xf'),'userInteractions':_0x5341('0x10')+_0x2c786a+_0x5341('0xd')};}function getSelectedTags(_0x34f0f0){var _0xd6234d=[];if(_0x34f0f0){_0xd6234d=Array[_0x5341('0x11')](_0x34f0f0)?_0x34f0f0:[_0x34f0f0];}return _0xd6234d;}function log(_0x470019,_0x1169fb,_0x4870f4,_0x4fd668,_0x5784b2,_0x3cbf19){loggers[_0x5784b2['toLowerCase']()][_0x470019]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3cbf19[_0x5341('0x12')](),_0x1169fb?_0x1169fb['id']:null,_0x1169fb?_0x1169fb['name']:null,_0x1169fb?_0x1169fb[_0x5341('0x13')]:null,getInteractionId(_0x4870f4,_0x4fd668,_0x5784b2),_0x4870f4?JSON[_0x5341('0x14')](_0x4870f4):_0x5341('0x15'));}function updateUser(_0x129a36,_0x39bfb5,_0x1e244b,_0x2ddd26,_0x4cacb7){db[_['upperFirst'](_0x2ddd26)+_0x5341('0x16')][_0x5341('0x17')]({'where':{'id':getInteractionId(_0x39bfb5,_0x1e244b,_0x2ddd26)}})['then'](function(_0x954958){if(_0x954958){return _0x954958[_0x5341('0x18')]({'UserId':_0x129a36?_0x129a36['id']:null});}})[_0x5341('0x19')](function(_0x527b48){if(_0x527b48){log(_0x5341('0x1a'),_0x129a36,_0x39bfb5,_0x1e244b,_0x2ddd26,_0x4cacb7);}})[_0x5341('0x1b')](function(){log(_0x5341('0x1c'),_0x129a36,_0x39bfb5,_0x1e244b,_0x2ddd26,_0x4cacb7);});}module['exports']={'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 88d4a66..be03346 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 _0x9895=['format','%s:%s:%s','update','base64','utf8','final','parse','use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split'];(function(_0x39bcb9,_0x3f03ae){var _0x139ebe=function(_0x5a0876){while(--_0x5a0876){_0x39bcb9['push'](_0x39bcb9['shift']());}};_0x139ebe(++_0x3f03ae);}(_0x9895,0xd0));var _0x5989=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9895[_0x2641f9];return _0x585741;};'use strict';var crypto=require(_0x5989('0x0'));var util=require(_0x5989('0x1'));var compose=require(_0x5989('0x2'));var db=require(_0x5989('0x3'))['db'];var config=require(_0x5989('0x4'));function getValueFromLicense(_0x2dec0a,_0x4be7f0){if(_0x2dec0a&&_0x4be7f0){if(_0x4be7f0['data1']&&_0x4be7f0['license']){var _0x1dbce3=_0x4be7f0[_0x5989('0x5')];var _0x384d1e=_0x4be7f0[_0x5989('0x6')];var _0x3a9388=_0x1dbce3[_0x5989('0x7')]('-')[0x4];var _0xc3a61d=_0x1dbce3[_0x5989('0x7')]('-')[0x0];var _0x51dda9=crypto['createDecipher']('aes-256-ctr',util[_0x5989('0x8')](_0x5989('0x9'),_0x3a9388,_0x1dbce3,_0xc3a61d));var _0x172077=_0x51dda9[_0x5989('0xa')](_0x384d1e,_0x5989('0xb'),_0x5989('0xc'));_0x172077+=_0x51dda9[_0x5989('0xd')](_0x5989('0xc'));var _0x39e4e9=JSON[_0x5989('0xe')](_0x172077);return _0x39e4e9['hasOwnProperty'](_0x2dec0a)?_0x39e4e9[_0x2dec0a]:null;}}return null;}function isLimit(_0x5c78de,_0x6e02e1,_0x1a0103,_0x3bc52c){var _0x25d06d=_0x6e02e1;return compose()[_0x5989('0xf')](function(_0x124ff6,_0x4602ee,_0x45dae2){return db[_0x5989('0x10')][_0x5989('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x5989('0x12')](function(_0x4198cd){var _0x4a96e7=getValueFromLicense(_0x5c78de,_0x4198cd);return _0x4a96e7?_0x4a96e7:_0x25d06d;})[_0x5989('0x12')](function(_0x50eb7c){_0x25d06d=_0x50eb7c;return _0x1a0103['count'](_0x3bc52c);})[_0x5989('0x12')](function(_0x44696d){if(_0x44696d>=_0x25d06d){return _0x4602ee[_0x5989('0x13')](0x193)[_0x5989('0x14')]({'message':util[_0x5989('0x8')](_0x5989('0x15'),_0x5c78de)});}_0x45dae2();})[_0x5989('0x16')](function(_0x3476df){_0x45dae2(_0x3476df);});});}function isUserLimit(){return isLimit(_0x5989('0x17'),0x1,db[_0x5989('0x18')],{'where':{'$or':[{'role':_0x5989('0x19')},{'role':_0x5989('0x1a')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0xb318=['catch','User','admin','util','../../mysqldb','../../config/environment','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','License','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x21f5db,_0x46fc2e){var _0x2eff1b=function(_0x265231){while(--_0x265231){_0x21f5db['push'](_0x21f5db['shift']());}};_0x2eff1b(++_0x46fc2e);}(_0xb318,0x96));var _0x8b31=function(_0x127a7d,_0x4b52e6){_0x127a7d=_0x127a7d-0x0;var _0x346ac2=_0xb318[_0x127a7d];return _0x346ac2;};'use strict';var crypto=require('crypto');var util=require(_0x8b31('0x0'));var compose=require('composable-middleware');var db=require(_0x8b31('0x1'))['db'];var config=require(_0x8b31('0x2'));function getValueFromLicense(_0x9d319f,_0x2133cb){if(_0x9d319f&&_0x2133cb){if(_0x2133cb['data1']&&_0x2133cb['license']){var _0x4feb8e=_0x2133cb['data1'];var _0x31795a=_0x2133cb['license'];var _0x29befd=_0x4feb8e[_0x8b31('0x3')]('-')[0x4];var _0xe81344=_0x4feb8e[_0x8b31('0x3')]('-')[0x0];var _0x179a8f=crypto['createDecipher'](_0x8b31('0x4'),util[_0x8b31('0x5')](_0x8b31('0x6'),_0x29befd,_0x4feb8e,_0xe81344));var _0x5e9ea2=_0x179a8f[_0x8b31('0x7')](_0x31795a,_0x8b31('0x8'),_0x8b31('0x9'));_0x5e9ea2+=_0x179a8f['final'](_0x8b31('0x9'));var _0x447863=JSON[_0x8b31('0xa')](_0x5e9ea2);return _0x447863[_0x8b31('0xb')](_0x9d319f)?_0x447863[_0x9d319f]:null;}}return null;}function isLimit(_0x4cb1be,_0x58ee8e,_0x37d47c,_0x1fb47c){var _0xe447f9=_0x58ee8e;return compose()['use'](function(_0x2c2f88,_0xeaff9a,_0x2672fb){return db[_0x8b31('0xc')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x8b31('0xd')](function(_0x219abf){var _0x21055d=getValueFromLicense(_0x4cb1be,_0x219abf);return _0x21055d?_0x21055d:_0xe447f9;})['then'](function(_0x210d08){_0xe447f9=_0x210d08;return _0x37d47c[_0x8b31('0xe')](_0x1fb47c);})[_0x8b31('0xd')](function(_0x2afe29){if(_0x2afe29>=_0xe447f9){return _0xeaff9a[_0x8b31('0xf')](0x193)[_0x8b31('0x10')]({'message':util[_0x8b31('0x5')](_0x8b31('0x11'),_0x4cb1be)});}_0x2672fb();})[_0x8b31('0x12')](function(_0x229e40){_0x2672fb(_0x229e40);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x8b31('0x13')],{'where':{'$or':[{'role':_0x8b31('0x14')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 8f22e0a..7fa93db 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 _0x4722=['field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','shift','pop','DATE','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','and','replace','[$or]','split','length','slice','forEach','match','filter','indexOf','map','conditions','push','buildExpression','operator','$eq','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4722,0x1ba));var _0x2472=function(_0x4c59c1,_0x4cfb83){_0x4c59c1=_0x4c59c1-0x0;var _0x4dac5c=_0x4722[_0x4c59c1];return _0x4dac5c;};'use strict';var _=require(_0x2472('0x0'));var moment=require(_0x2472('0x1'));exports[_0x2472('0x2')]=function(_0x5bc394){var _0x23d7dc={'conditions':[]};_0x23d7dc[_0x2472('0x3')]=_['startsWith'](_0x5bc394,'[$or]')?'or':_0x2472('0x4');var _0x5609bd=_0x5bc394[_0x2472('0x5')]('[$and]','')[_0x2472('0x5')](_0x2472('0x6'),'')[_0x2472('0x7')]('||');for(var _0x860300=0x0;_0x860300<_0x5609bd[_0x2472('0x8')];_0x860300++){var _0x48dcc8=_0x5609bd[_0x860300][_0x2472('0x7')](':=');var _0x22ee5e=_0x48dcc8[0x0];var _0x1d49d0=_0x48dcc8[_0x2472('0x9')](0x1);_0x1d49d0[_0x2472('0xa')](function(_0x358578){var _0x7f889b=_0x358578['split']('[')['shift']();var _0x1475fa=_0x358578[_0x2472('0xb')](/\[(.*?)\]/g);_0x1475fa['forEach'](function(_0x5dd95d){var _0x2c15e6=_0x5dd95d[_0x2472('0x7')]('[')[_0x2472('0xc')](function(_0x5813e0){return _0x5813e0[_0x2472('0xd')](']')>-0x1;})[_0x2472('0xe')](function(_0x2571e5){return _0x2571e5[_0x2472('0x7')](']')[0x0];})[0x0];_0x23d7dc[_0x2472('0xf')][_0x2472('0x10')]({'field':_0x22ee5e,'operator':_0x7f889b,'value':_0x2c15e6});});});}return _0x23d7dc;};exports[_0x2472('0x11')]=function(_0x2f0668,_0xcdd6ea,_0x35ee66){var _0xd3df={};if(_0xcdd6ea==='DATE'){if(_0x35ee66[_0x2472('0x12')]===_0x2472('0x13')){_0x35ee66[_0x2472('0x12')]='$between';_0x35ee66[_0x2472('0x14')]+=','+_0x35ee66[_0x2472('0x14')];}else if(_[_0x2472('0x15')]([_0x2472('0x16'),_0x2472('0x17')],_0x35ee66[_0x2472('0x12')])){_0x35ee66['value']=moment(_0x35ee66[_0x2472('0x14')])[_0x2472('0x18')](0x1,_0x2472('0x19'))[_0x2472('0x1a')](_0x2472('0x1b'));}}if(_0x35ee66[_0x2472('0x1c')]){_0xcdd6ea=_0x35ee66[_0x2472('0x1c')];_0xd3df[_0x2472('0x1d')]='CAST('+_0x2f0668+'.'+_0x35ee66[_0x2472('0x1e')]+_0x2472('0x1f')+_0x35ee66[_0x2472('0x1c')]+')\x20'+parseOperator(_0x35ee66[_0x2472('0x12')]);}else{_0xd3df['text']=_0x2f0668+'.'+_0x35ee66['field']+'\x20'+parseOperator(_0x35ee66[_0x2472('0x12')]);}if(_[_0x2472('0x15')]([_0x2472('0x20'),_0x2472('0x21')],_0x35ee66[_0x2472('0x12')]))_0xd3df[_0x2472('0x1d')]='('+_0xd3df[_0x2472('0x1d')]+_0x2472('0x22')+_0x2f0668+'.'+_0x35ee66['field']+_0x2472('0x23');_0xd3df[_0x2472('0x14')]=parseValue(_0xcdd6ea,_0x35ee66[_0x2472('0x12')],_0x35ee66['value']);return _0xd3df;};function parseOperator(_0x18dd4f){var _0x979ce8;switch(_0x18dd4f){case _0x2472('0x24'):_0x979ce8=_0x2472('0x25');break;case _0x2472('0x21'):_0x979ce8=_0x2472('0x26');break;case _0x2472('0x13'):_0x979ce8=_0x2472('0x27');break;case _0x2472('0x20'):_0x979ce8='<>\x20?';break;case _0x2472('0x28'):case _0x2472('0x29'):case _0x2472('0x2a'):_0x979ce8=_0x2472('0x2b');break;case _0x2472('0x2c'):_0x979ce8=_0x2472('0x2d');break;case'$gt':_0x979ce8=_0x2472('0x2e');break;case'$lte':_0x979ce8=_0x2472('0x2f');break;case _0x2472('0x30'):_0x979ce8=_0x2472('0x31');break;case _0x2472('0x32'):_0x979ce8=_0x2472('0x33');break;}return _0x979ce8;}function parseValue(_0x5bd648,_0x15c881,_0x427cac){var _0x4f3c79={'start':undefined,'end':undefined};switch(_0x15c881){case _0x2472('0x24'):case _0x2472('0x21'):_0x4f3c79[_0x2472('0x34')]=_0x427cac[_0x2472('0x7')](',');break;case'$substring':_0x4f3c79['start']='%'+_0x427cac+'%';break;case _0x2472('0x29'):_0x4f3c79['start']=_0x427cac+'%';break;case _0x2472('0x2a'):_0x4f3c79['start']='%'+_0x427cac;break;case'$between':var _0x4f2188=_0x427cac[_0x2472('0x7')](',');var _0x427cac=_0x4f2188[_0x2472('0x35')]();var _0x5c8da6=_0x4f2188[_0x2472('0x36')]();if(_0x5bd648===_0x2472('0x37')){_0x427cac=moment(_0x427cac)['utcOffset'](0x0,!![])['format']();_0x5c8da6=moment(_0x5c8da6)['utcOffset'](0x0,!![])[_0x2472('0x18')](0x17,_0x2472('0x38'))[_0x2472('0x18')](0x3b,_0x2472('0x39'))[_0x2472('0x18')](0x3b,_0x2472('0x3a'))['format']();}_0x4f3c79={'start':_0x427cac,'end':_0x5c8da6};break;default:_0x4f3c79[_0x2472('0x34')]=_0x427cac;break;}return _0x4f3c79;} \ No newline at end of file +var _0xd2ad=['lodash','moment','parseSearch','sqlOperator','[$or]','and','[$and]','replace','split','slice','shift','match','forEach','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$notIn','\x20OR\x20','$in','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','start','$startsWith','pop','utcOffset','hours','seconds'];(function(_0x596c43,_0x28647a){var _0x4e1315=function(_0x58e910){while(--_0x58e910){_0x596c43['push'](_0x596c43['shift']());}};_0x4e1315(++_0x28647a);}(_0xd2ad,0x1ef));var _0xdd2a=function(_0x198446,_0x119c8f){_0x198446=_0x198446-0x0;var _0x38d7b7=_0xd2ad[_0x198446];return _0x38d7b7;};'use strict';var _=require(_0xdd2a('0x0'));var moment=require(_0xdd2a('0x1'));exports[_0xdd2a('0x2')]=function(_0x359a4f){var _0x1314bd={'conditions':[]};_0x1314bd[_0xdd2a('0x3')]=_['startsWith'](_0x359a4f,_0xdd2a('0x4'))?'or':_0xdd2a('0x5');var _0x3416e1=_0x359a4f['replace'](_0xdd2a('0x6'),'')[_0xdd2a('0x7')](_0xdd2a('0x4'),'')[_0xdd2a('0x8')]('||');for(var _0x5df24f=0x0;_0x5df24f<_0x3416e1['length'];_0x5df24f++){var _0x5ba890=_0x3416e1[_0x5df24f]['split'](':=');var _0xd66916=_0x5ba890[0x0];var _0x49efa5=_0x5ba890[_0xdd2a('0x9')](0x1);_0x49efa5['forEach'](function(_0x579c6){var _0x4d6a42=_0x579c6['split']('[')[_0xdd2a('0xa')]();var _0x4112c4=_0x579c6[_0xdd2a('0xb')](/\[(.*?)\]/g);_0x4112c4[_0xdd2a('0xc')](function(_0x264274){var _0x29995c=_0x264274[_0xdd2a('0x8')]('[')[_0xdd2a('0xd')](function(_0x4f78b7){return _0x4f78b7[_0xdd2a('0xe')](']')>-0x1;})[_0xdd2a('0xf')](function(_0x138770){return _0x138770[_0xdd2a('0x8')](']')[0x0];})[0x0];_0x1314bd[_0xdd2a('0x10')][_0xdd2a('0x11')]({'field':_0xd66916,'operator':_0x4d6a42,'value':_0x29995c});});});}return _0x1314bd;};exports[_0xdd2a('0x12')]=function(_0x1a11ff,_0x4d56bf,_0x26e72e){var _0x22a4ff={};if(_0x4d56bf===_0xdd2a('0x13')){if(_0x26e72e[_0xdd2a('0x14')]===_0xdd2a('0x15')){_0x26e72e[_0xdd2a('0x14')]=_0xdd2a('0x16');_0x26e72e[_0xdd2a('0x17')]+=','+_0x26e72e[_0xdd2a('0x17')];}else if(_[_0xdd2a('0x18')]([_0xdd2a('0x19'),_0xdd2a('0x1a')],_0x26e72e[_0xdd2a('0x14')])){_0x26e72e[_0xdd2a('0x17')]=moment(_0x26e72e['value'])[_0xdd2a('0x1b')](0x1,_0xdd2a('0x1c'))[_0xdd2a('0x1d')](_0xdd2a('0x1e'));}}if(_0x26e72e[_0xdd2a('0x1f')]){_0x4d56bf=_0x26e72e[_0xdd2a('0x1f')];_0x22a4ff[_0xdd2a('0x20')]=_0xdd2a('0x21')+_0x1a11ff+'.'+_0x26e72e[_0xdd2a('0x22')]+_0xdd2a('0x23')+_0x26e72e[_0xdd2a('0x1f')]+')\x20'+parseOperator(_0x26e72e[_0xdd2a('0x14')]);}else{_0x22a4ff[_0xdd2a('0x20')]=_0x1a11ff+'.'+_0x26e72e[_0xdd2a('0x22')]+'\x20'+parseOperator(_0x26e72e[_0xdd2a('0x14')]);}if(_['includes'](['$ne',_0xdd2a('0x24')],_0x26e72e['operator']))_0x22a4ff[_0xdd2a('0x20')]='('+_0x22a4ff[_0xdd2a('0x20')]+_0xdd2a('0x25')+_0x1a11ff+'.'+_0x26e72e[_0xdd2a('0x22')]+'\x20IS\x20NULL)';_0x22a4ff[_0xdd2a('0x17')]=parseValue(_0x4d56bf,_0x26e72e['operator'],_0x26e72e['value']);return _0x22a4ff;};function parseOperator(_0x2dc2ef){var _0x293df9;switch(_0x2dc2ef){case _0xdd2a('0x26'):_0x293df9='IN\x20?';break;case'$notIn':_0x293df9='NOT\x20IN\x20?';break;case _0xdd2a('0x15'):_0x293df9=_0xdd2a('0x27');break;case'$ne':_0x293df9=_0xdd2a('0x28');break;case _0xdd2a('0x29'):case'$startsWith':case _0xdd2a('0x2a'):_0x293df9=_0xdd2a('0x2b');break;case'$lt':_0x293df9=_0xdd2a('0x2c');break;case _0xdd2a('0x19'):_0x293df9=_0xdd2a('0x2d');break;case _0xdd2a('0x1a'):_0x293df9=_0xdd2a('0x2e');break;case _0xdd2a('0x2f'):_0x293df9=_0xdd2a('0x30');break;case _0xdd2a('0x16'):_0x293df9='BETWEEN\x20?\x20AND\x20?';break;}return _0x293df9;}function parseValue(_0x30c7e0,_0x4a82be,_0x53c5dd){var _0x1cb4ef={'start':undefined,'end':undefined};switch(_0x4a82be){case _0xdd2a('0x26'):case _0xdd2a('0x24'):_0x1cb4ef[_0xdd2a('0x31')]=_0x53c5dd['split'](',');break;case'$substring':_0x1cb4ef[_0xdd2a('0x31')]='%'+_0x53c5dd+'%';break;case _0xdd2a('0x32'):_0x1cb4ef[_0xdd2a('0x31')]=_0x53c5dd+'%';break;case _0xdd2a('0x2a'):_0x1cb4ef[_0xdd2a('0x31')]='%'+_0x53c5dd;break;case'$between':var _0x478dd5=_0x53c5dd['split'](',');var _0x53c5dd=_0x478dd5[_0xdd2a('0xa')]();var _0x27f4eb=_0x478dd5[_0xdd2a('0x33')]();if(_0x30c7e0===_0xdd2a('0x13')){_0x53c5dd=moment(_0x53c5dd)['utcOffset'](0x0,!![])[_0xdd2a('0x1d')]();_0x27f4eb=moment(_0x27f4eb)[_0xdd2a('0x34')](0x0,!![])[_0xdd2a('0x1b')](0x17,_0xdd2a('0x35'))[_0xdd2a('0x1b')](0x3b,'minutes')[_0xdd2a('0x1b')](0x3b,_0xdd2a('0x36'))[_0xdd2a('0x1d')]();}_0x1cb4ef={'start':_0x53c5dd,'end':_0x27f4eb};break;default:_0x1cb4ef['start']=_0x53c5dd;break;}return _0x1cb4ef;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 823f7da..8c5fee9 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 _0x885a=['^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','query','$id','name','intersection','model','attributes','hasOwnProperty','order','where','pick','filter','object','columns','merge','VIRTUAL','lower','options','sequelize','moment','parse','keys','includes','fields','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','subtract','uniqueid','isArray','split','limit','offset','sort','map','priority','cast','col','unsigned','DESC','omit','isObject','isString','length','unset','match'];(function(_0x53f7b5,_0x50049e){var _0x2ae59d=function(_0x28ac58){while(--_0x28ac58){_0x53f7b5['push'](_0x53f7b5['shift']());}};_0x2ae59d(++_0x50049e);}(_0x885a,0x180));var _0xa885=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x885a[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var sequelize=require(_0xa885('0x0'));var moment=require(_0xa885('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x35456c){var _0x2e4bc8=['ne'];try{var _0x573a2b=JSON[_0xa885('0x2')](_0x35456c);var _0x1c41b5=Object[_0xa885('0x3')](_0x573a2b)[0x0];return _0x2e4bc8[_0xa885('0x4')](_0x1c41b5);}catch(_0x108285){return![];}}function getOperatorValue(_0x33f18b){var _0x5dfd7e=JSON[_0xa885('0x2')](_0x33f18b);var _0x1200c7=Object[_0xa885('0x3')](_0x5dfd7e)[0x0];var _0x546175=_0x5dfd7e[_0x1200c7];return{['$'+_0x1200c7]:_0x546175};}exports[_0xa885('0x5')]=function(_0x2b7916){var _0x38df93=null;if(_0x2b7916){_0x38df93=_0x2b7916['split'](',');}return _0x38df93;};exports[_0xa885('0x6')]=function(_0x299f57,_0x42ab89){var _0x745710={};if(!_[_0xa885('0x7')](_0x299f57)){_[_0xa885('0x8')](_0x299f57,function(_0xcf5f96,_0x571c0d){try{if(_0x42ab89){var _0x8a82f5=_[_0xa885('0x9')](_0x42ab89,{'name':_0x571c0d})||{};if(hasSequelizeOperator(_0xcf5f96)){_0x745710[_0x571c0d]=getOperatorValue(_0xcf5f96);}else if(_0x8a82f5[_0xa885('0xa')]===_0xa885('0xb')&&_[_0xa885('0xc')](_0xcf5f96)){var _0x3e9c7a=JSON[_0xa885('0x2')](_0xcf5f96);var _0x574eb8={'$gte':moment(moment(_0x3e9c7a[_0xa885('0xd')])[_0xa885('0xe')](_0xa885('0xf')))[_0xa885('0x10')]()[_0xa885('0xe')](),'$lte':moment(moment(_0x3e9c7a['$lte'])[_0xa885('0xe')](_0xa885('0xf')))['utc']()[_0xa885('0x11')](0x1,'s')[_0xa885('0xe')]()};_0x745710[_0x571c0d]=_0x574eb8;}else if(_0x8a82f5['name']===_0xa885('0x12')){_0x745710[_0x571c0d]=_0xcf5f96;}else{_0x745710[_0x571c0d]=_[_0xa885('0x13')](_0xcf5f96)?_0xcf5f96:JSON['parse'](_0xcf5f96);}}else{_0x745710[_0x571c0d]=_[_0xa885('0x13')](_0xcf5f96)?_0xcf5f96:JSON['parse'](_0xcf5f96);}}catch(_0x2e9290){_0x745710[_0x571c0d]=_0xcf5f96[_0xa885('0x14')](',');}});}return _0x745710;};exports[_0xa885('0x15')]=function(_0x4e4d51){_0x4e4d51=parseInt(_0x4e4d51,0xa);if(!_0x4e4d51||_0x4e4d51<0x0){_0x4e4d51=LIMIT_VALUE;}return _0x4e4d51;};exports[_0xa885('0x16')]=function(_0x56a614){_0x56a614=parseInt(_0x56a614,0xa);if(!_0x56a614||_0x56a614<0x0){_0x56a614=0x0;}return _0x56a614;};exports[_0xa885('0x17')]=function(_0x1d5d0b){var _0x113043,_0x523916=null;if(_0x1d5d0b){_0x113043=_0x1d5d0b[_0xa885('0x14')](',');_0x523916=_[_0xa885('0x18')](_0x113043,function(_0x1530b6){if(_0x1530b6['indexOf']('-')===0x0){return[_0x1530b6===_0xa885('0x19')?sequelize[_0xa885('0x1a')](sequelize[_0xa885('0x1b')]('priority'),_0xa885('0x1c')):_0x1530b6['substr'](0x1),_0xa885('0x1d')];}else{return[_0x1530b6===_0xa885('0x19')?sequelize['cast'](sequelize[_0xa885('0x1b')](_0xa885('0x19')),_0xa885('0x1c')):_0x1530b6,'ASC'];}});}return _0x523916;};exports[_0xa885('0x1e')]=function(_0x14aed1,_0x558098){if(_[_0xa885('0x7')](_0x14aed1)){return _0x14aed1;}if(_['isArray'](_0x14aed1)){for(var _0x15ff4d=0x0;_0x15ff4d<_0x14aed1['length'];_0x15ff4d+=0x1){_0x14aed1[_0x15ff4d]=this[_0xa885('0x1e')](_0x14aed1[_0x15ff4d],_0x558098);}return _0x14aed1;}if(!_[_0xa885('0x1f')](_0x14aed1)){return _0x14aed1;}if(_[_0xa885('0x20')](_0x558098)){_0x558098=[_0x558098];}if(!_[_0xa885('0x13')](_0x558098)){return _0x14aed1;}for(var _0x1e0177=0x0;_0x1e0177<_0x558098[_0xa885('0x21')];_0x1e0177+=0x1){_[_0xa885('0x22')](_0x14aed1,_0x558098[_0x1e0177]);}for(var _0x3f219d in _0x14aed1){if(_0x14aed1['hasOwnProperty'](_0x3f219d)){_0x14aed1[_0x3f219d]=this['omit'](_0x14aed1[_0x3f219d],_0x558098);}}return _0x14aed1;};exports['isNumeric']=function(_0x4fc438){return _0x4fc438[_0xa885('0x23')](RegExp(_0xa885('0x24')))?!![]:![];};exports[_0xa885('0x25')]=function(_0x17c0eb){return _0x17c0eb[_0xa885('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0xa885('0x26')]=function(_0x5ac39f){var _0x40d982=[];_0x5ac39f['split'](/[ ,]+/)[_0xa885('0x27')](function(_0x4a1e54){_0x4a1e54=_0x4a1e54[_0xa885('0x28')](/([^:]")"+/g,'$1');_0x4a1e54='+'+_0x4a1e54+'*';var _0x528a71=/[ `!@#$%^&*()_\-?~]/;if(_0x4a1e54[_0xa885('0x23')](_0x528a71))_0x4a1e54='\x22'+_0x4a1e54+'\x22';_0x40d982[_0xa885('0x29')](_0x4a1e54);});return _0x40d982[_0xa885('0x2a')]('\x20');};exports['getOptions']=function(_0x15f3a,_0x23dea1,_0x5ed672){var _0x30814a={},_0x54dbd8={};if(_0x23dea1[_0xa885('0x2b')][_0xa885('0x2c')]){_0x23dea1[_0xa885('0x2b')]['id']=_0x23dea1['query'][_0xa885('0x2c')];delete _0x23dea1[_0xa885('0x2b')][_0xa885('0x2c')];}_0x30814a['model']=_[_0xa885('0x18')](_0x15f3a,_0xa885('0x2d'));_0x30814a[_0xa885('0x2b')]=_[_0xa885('0x3')](_0x23dea1[_0xa885('0x2b')]);_0x30814a[_0xa885('0x6')]=_[_0xa885('0x2e')](_0x30814a[_0xa885('0x2f')],_0x30814a['query']);_0x54dbd8['attributes']=_[_0xa885('0x2e')](_0x30814a[_0xa885('0x2f')],this[_0xa885('0x5')](_0x23dea1[_0xa885('0x2b')][_0xa885('0x5')]));_0x54dbd8[_0xa885('0x30')]=_0x54dbd8[_0xa885('0x30')][_0xa885('0x21')]?_0x54dbd8[_0xa885('0x30')]:_0x30814a['model'];if(!_0x23dea1['query'][_0xa885('0x31')]('nolimit')){_0x54dbd8['limit']=this[_0xa885('0x15')](_0x23dea1['query'][_0xa885('0x15')]);_0x54dbd8[_0xa885('0x16')]=this[_0xa885('0x16')](_0x23dea1[_0xa885('0x2b')][_0xa885('0x16')]);}_0x54dbd8[_0xa885('0x32')]=this[_0xa885('0x17')](_0x23dea1[_0xa885('0x2b')][_0xa885('0x17')]);_0x54dbd8[_0xa885('0x33')]=this['filters'](_[_0xa885('0x34')](_0x23dea1[_0xa885('0x2b')],_0x30814a[_0xa885('0x6')]),_0x15f3a);if(_0x23dea1[_0xa885('0x2b')][_0xa885('0x35')]){var _0x5e327f=_0x15f3a;var _0x57d912=_0x23dea1[_0xa885('0x2b')][_0xa885('0x35')];if(typeof _0x57d912===_0xa885('0x36')){_0x5e327f=_[_0xa885('0x35')](_0x15f3a,function(_0x1cfe71){return _['includes'](_0x57d912[_0xa885('0x37')],_0x1cfe71[_0xa885('0x2d')]);});_0x57d912=_0x57d912['value'];}_0x54dbd8['where']=_[_0xa885('0x38')](_0x54dbd8[_0xa885('0x33')],{'$or':_['map'](_0x5e327f,function(_0x561bf0){if(_0x561bf0[_0xa885('0xa')]!==_0xa885('0x39')){if(_0x5ed672){return sequelize[_0xa885('0x33')](sequelize['fn'](_0xa885('0x3a'),sequelize[_0xa885('0x1b')](_0x561bf0[_0xa885('0x2d')])),{'$like':sequelize['fn'](_0xa885('0x3a'),'%'+_0x23dea1[_0xa885('0x2b')][_0xa885('0x35')]+'%')});}else{var _0x3dcf63={};_0x3dcf63[_0x561bf0[_0xa885('0x2d')]]={'$like':'%'+_0x23dea1['query'][_0xa885('0x35')]+'%'};return _0x3dcf63;}}})});}_0x54dbd8=_[_0xa885('0x38')]({},_0x54dbd8,_0x23dea1[_0xa885('0x3b')]);return _0x54dbd8;}; \ No newline at end of file +var _0x2bd8=['type','VIRTUAL','lower','options','lodash','moment','parse','keys','fields','forOwn','find','DATE','$gte','format','YYYY-MM-DD','$lte','subtract','name','uniqueid','isArray','split','limit','offset','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','isEmpty','length','omit','isObject','isString','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','filters','intersection','attributes','nolimit','sort','where','pick','filter','includes','value','merge'];(function(_0x10c783,_0x7658a2){var _0x2f0f87=function(_0x10cf4b){while(--_0x10cf4b){_0x10c783['push'](_0x10c783['shift']());}};_0x2f0f87(++_0x7658a2);}(_0x2bd8,0x130));var _0x82bd=function(_0x216fcc,_0x3477ef){_0x216fcc=_0x216fcc-0x0;var _0x4ccefa=_0x2bd8[_0x216fcc];return _0x4ccefa;};'use strict';var _=require(_0x82bd('0x0'));var sequelize=require('sequelize');var moment=require(_0x82bd('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x391673){var _0x208a3d=['ne'];try{var _0x41dbdf=JSON[_0x82bd('0x2')](_0x391673);var _0x197dbc=Object[_0x82bd('0x3')](_0x41dbdf)[0x0];return _0x208a3d['includes'](_0x197dbc);}catch(_0x41584e){return![];}}function getOperatorValue(_0x2e1a98){var _0x3bf810=JSON['parse'](_0x2e1a98);var _0x19dbb1=Object[_0x82bd('0x3')](_0x3bf810)[0x0];var _0x226f60=_0x3bf810[_0x19dbb1];return{['$'+_0x19dbb1]:_0x226f60};}exports[_0x82bd('0x4')]=function(_0x4dc3a6){var _0x1666cf=null;if(_0x4dc3a6){_0x1666cf=_0x4dc3a6['split'](',');}return _0x1666cf;};exports['filters']=function(_0x51c6ea,_0x5bb22c){var _0x5f0434={};if(!_['isEmpty'](_0x51c6ea)){_[_0x82bd('0x5')](_0x51c6ea,function(_0x5f3959,_0x4e50da){try{if(_0x5bb22c){var _0x32821a=_[_0x82bd('0x6')](_0x5bb22c,{'name':_0x4e50da})||{};if(hasSequelizeOperator(_0x5f3959)){_0x5f0434[_0x4e50da]=getOperatorValue(_0x5f3959);}else if(_0x32821a['type']===_0x82bd('0x7')&&_['isPlainObject'](_0x5f3959)){var _0xfaccf7=JSON['parse'](_0x5f3959);var _0x338bb4={'$gte':moment(moment(_0xfaccf7[_0x82bd('0x8')])[_0x82bd('0x9')](_0x82bd('0xa')))['utc']()[_0x82bd('0x9')](),'$lte':moment(moment(_0xfaccf7[_0x82bd('0xb')])['format'](_0x82bd('0xa')))['utc']()[_0x82bd('0xc')](0x1,'s')[_0x82bd('0x9')]()};_0x5f0434[_0x4e50da]=_0x338bb4;}else if(_0x32821a[_0x82bd('0xd')]===_0x82bd('0xe')){_0x5f0434[_0x4e50da]=_0x5f3959;}else{_0x5f0434[_0x4e50da]=_[_0x82bd('0xf')](_0x5f3959)?_0x5f3959:JSON[_0x82bd('0x2')](_0x5f3959);}}else{_0x5f0434[_0x4e50da]=_[_0x82bd('0xf')](_0x5f3959)?_0x5f3959:JSON[_0x82bd('0x2')](_0x5f3959);}}catch(_0x31a350){_0x5f0434[_0x4e50da]=_0x5f3959[_0x82bd('0x10')](',');}});}return _0x5f0434;};exports[_0x82bd('0x11')]=function(_0x29b689){_0x29b689=parseInt(_0x29b689,0xa);if(!_0x29b689||_0x29b689<0x0){_0x29b689=LIMIT_VALUE;}return _0x29b689;};exports[_0x82bd('0x12')]=function(_0x253741){_0x253741=parseInt(_0x253741,0xa);if(!_0x253741||_0x253741<0x0){_0x253741=0x0;}return _0x253741;};exports['sort']=function(_0x5688ed){var _0x283ce7,_0x3eb844=null;if(_0x5688ed){_0x283ce7=_0x5688ed[_0x82bd('0x10')](',');_0x3eb844=_[_0x82bd('0x13')](_0x283ce7,function(_0x34899b){if(_0x34899b[_0x82bd('0x14')]('-')===0x0){return[_0x34899b===_0x82bd('0x15')?sequelize[_0x82bd('0x16')](sequelize[_0x82bd('0x17')](_0x82bd('0x15')),_0x82bd('0x18')):_0x34899b[_0x82bd('0x19')](0x1),_0x82bd('0x1a')];}else{return[_0x34899b===_0x82bd('0x15')?sequelize[_0x82bd('0x16')](sequelize[_0x82bd('0x17')](_0x82bd('0x15')),_0x82bd('0x18')):_0x34899b,_0x82bd('0x1b')];}});}return _0x3eb844;};exports['omit']=function(_0x4b3215,_0x4248be){if(_[_0x82bd('0x1c')](_0x4b3215)){return _0x4b3215;}if(_[_0x82bd('0xf')](_0x4b3215)){for(var _0x3eb6a5=0x0;_0x3eb6a5<_0x4b3215[_0x82bd('0x1d')];_0x3eb6a5+=0x1){_0x4b3215[_0x3eb6a5]=this[_0x82bd('0x1e')](_0x4b3215[_0x3eb6a5],_0x4248be);}return _0x4b3215;}if(!_[_0x82bd('0x1f')](_0x4b3215)){return _0x4b3215;}if(_[_0x82bd('0x20')](_0x4248be)){_0x4248be=[_0x4248be];}if(!_[_0x82bd('0xf')](_0x4248be)){return _0x4b3215;}for(var _0x2add80=0x0;_0x2add80<_0x4248be['length'];_0x2add80+=0x1){_['unset'](_0x4b3215,_0x4248be[_0x2add80]);}for(var _0x5609b7 in _0x4b3215){if(_0x4b3215['hasOwnProperty'](_0x5609b7)){_0x4b3215[_0x5609b7]=this[_0x82bd('0x1e')](_0x4b3215[_0x5609b7],_0x4248be);}}return _0x4b3215;};exports[_0x82bd('0x21')]=function(_0x351d3d){return _0x351d3d[_0x82bd('0x22')](RegExp(_0x82bd('0x23')))?!![]:![];};exports['isEmail']=function(_0x516c6d){return _0x516c6d['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x82bd('0x24')]=function(_0x2a5867){var _0x40884f=[];_0x2a5867['split'](/[ ,]+/)[_0x82bd('0x25')](function(_0x4f209e){_0x4f209e=_0x4f209e[_0x82bd('0x26')](/([^:]")"+/g,'$1');_0x4f209e='+'+_0x4f209e+'*';var _0x1a1e24=/[ `!@#$%^&*()_\-?~]/;if(_0x4f209e[_0x82bd('0x22')](_0x1a1e24))_0x4f209e='\x22'+_0x4f209e+'\x22';_0x40884f[_0x82bd('0x27')](_0x4f209e);});return _0x40884f[_0x82bd('0x28')]('\x20');};exports[_0x82bd('0x29')]=function(_0x5ca7fc,_0x591b38,_0x406c96){var _0x3a7d07={},_0x4a927a={};if(_0x591b38[_0x82bd('0x2a')]['$id']){_0x591b38['query']['id']=_0x591b38[_0x82bd('0x2a')][_0x82bd('0x2b')];delete _0x591b38[_0x82bd('0x2a')][_0x82bd('0x2b')];}_0x3a7d07[_0x82bd('0x2c')]=_[_0x82bd('0x13')](_0x5ca7fc,_0x82bd('0xd'));_0x3a7d07[_0x82bd('0x2a')]=_[_0x82bd('0x3')](_0x591b38[_0x82bd('0x2a')]);_0x3a7d07[_0x82bd('0x2d')]=_[_0x82bd('0x2e')](_0x3a7d07[_0x82bd('0x2c')],_0x3a7d07[_0x82bd('0x2a')]);_0x4a927a[_0x82bd('0x2f')]=_[_0x82bd('0x2e')](_0x3a7d07[_0x82bd('0x2c')],this['fields'](_0x591b38['query']['fields']));_0x4a927a[_0x82bd('0x2f')]=_0x4a927a[_0x82bd('0x2f')]['length']?_0x4a927a[_0x82bd('0x2f')]:_0x3a7d07['model'];if(!_0x591b38['query']['hasOwnProperty'](_0x82bd('0x30'))){_0x4a927a[_0x82bd('0x11')]=this[_0x82bd('0x11')](_0x591b38[_0x82bd('0x2a')][_0x82bd('0x11')]);_0x4a927a['offset']=this['offset'](_0x591b38['query'][_0x82bd('0x12')]);}_0x4a927a['order']=this['sort'](_0x591b38[_0x82bd('0x2a')][_0x82bd('0x31')]);_0x4a927a[_0x82bd('0x32')]=this[_0x82bd('0x2d')](_[_0x82bd('0x33')](_0x591b38[_0x82bd('0x2a')],_0x3a7d07[_0x82bd('0x2d')]),_0x5ca7fc);if(_0x591b38[_0x82bd('0x2a')][_0x82bd('0x34')]){var _0x5512b0=_0x5ca7fc;var _0x5c7661=_0x591b38[_0x82bd('0x2a')][_0x82bd('0x34')];if(typeof _0x5c7661==='object'){_0x5512b0=_['filter'](_0x5ca7fc,function(_0x277b7a){return _[_0x82bd('0x35')](_0x5c7661['columns'],_0x277b7a[_0x82bd('0xd')]);});_0x5c7661=_0x5c7661[_0x82bd('0x36')];}_0x4a927a[_0x82bd('0x32')]=_[_0x82bd('0x37')](_0x4a927a[_0x82bd('0x32')],{'$or':_[_0x82bd('0x13')](_0x5512b0,function(_0x2a18c3){if(_0x2a18c3[_0x82bd('0x38')]!==_0x82bd('0x39')){if(_0x406c96){return sequelize[_0x82bd('0x32')](sequelize['fn'](_0x82bd('0x3a'),sequelize[_0x82bd('0x17')](_0x2a18c3['name'])),{'$like':sequelize['fn'](_0x82bd('0x3a'),'%'+_0x591b38[_0x82bd('0x2a')]['filter']+'%')});}else{var _0x5b736e={};_0x5b736e[_0x2a18c3[_0x82bd('0xd')]]={'$like':'%'+_0x591b38[_0x82bd('0x2a')][_0x82bd('0x34')]+'%'};return _0x5b736e;}}})});}_0x4a927a=_[_0x82bd('0x37')]({},_0x4a927a,_0x591b38[_0x82bd('0x3b')]);return _0x4a927a;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 5a64ee6..ecdb840 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 _0xd0fb=['map','findOne','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','mailPause','pauseType','globalStatus','getSortedAgentsIdsByStatus','fields','order','DESC','ASC','getUpdatedSortOptions','internal','substring','sort','fullname','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','smsPause','chatCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','mailStatusTime','smsStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','openchannelPause','whatsappPause','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','voicePause','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','Queue'];(function(_0x16e63c,_0x562b85){var _0x104a9f=function(_0x36cb31){while(--_0x36cb31){_0x16e63c['push'](_0x16e63c['shift']());}};_0x104a9f(++_0x562b85);}(_0xd0fb,0x8a));var _0xbd0f=function(_0x488a30,_0x182644){_0x488a30=_0x488a30-0x0;var _0x2e0ef5=_0xd0fb[_0x488a30];return _0x2e0ef5;};'use strict';var _=require(_0xbd0f('0x0'));var jayson=require(_0xbd0f('0x1'));var db=require(_0xbd0f('0x2'))['db'];var amiClient=jayson[_0xbd0f('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0xbd0f('0x3')][_0xbd0f('0x4')]({'port':0x232c});function isAgentPaused(_0x51e1fa,_0x3c6034){var _0x27f482=[_0x51e1fa[_0xbd0f('0x5')],_0x51e1fa[_0xbd0f('0x6')],_0x51e1fa['mailPause'],_0x51e1fa[_0xbd0f('0x7')],_0x51e1fa['smsPause'],_0x51e1fa['voicePause'],_0x51e1fa[_0xbd0f('0x8')]];if(!_0x3c6034)return _['every'](_0x27f482);var _0x5472c3=_[_0xbd0f('0x9')](_0x27f482);return _0x5472c3[_0xbd0f('0xa')]>0x0&&_0x5472c3[_0xbd0f('0xa')]<_0x27f482[_0xbd0f('0xa')]?!![]:![];}function isIdle(_0x1b7064){return _0x1b7064===_0xbd0f('0xb')||_0x1b7064===_0xbd0f('0xc')||_0x1b7064===_0xbd0f('0xd')||_0x1b7064===_0xbd0f('0xe')||_[_0xbd0f('0xf')](_0x1b7064);}function isAgentIdle(_0x3eb1c5){if(_0x3eb1c5[_0xbd0f('0x10')]!==_0xbd0f('0xb')&&_0x3eb1c5[_0xbd0f('0x11')]){_0x3eb1c5['voiceStatus']=_0xbd0f('0x12');return![];}return _['every']([_0x3eb1c5[_0xbd0f('0x13')],_0x3eb1c5[_0xbd0f('0x14')],_0x3eb1c5[_0xbd0f('0x15')],_0x3eb1c5[_0xbd0f('0x16')],_0x3eb1c5[_0xbd0f('0x17')],_0x3eb1c5[_0xbd0f('0x10')],_0x3eb1c5[_0xbd0f('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xbd0f('0x19')](_0xbd0f('0x1a'),{})[_0xbd0f('0x1b')](function(_0x2bbf83){if(_0x2bbf83['error']){throw new Error(_0xbd0f('0x1c'));}var _0xb0c318=_0x2bbf83[_0xbd0f('0x1d')];return routingClient[_0xbd0f('0x19')](_0xbd0f('0x1a'),{})[_0xbd0f('0x1b')](function(_0x5a34ca){if(_0x5a34ca[_0xbd0f('0x1e')]){throw new Error(_0xbd0f('0x1f'));}var _0x1c0211=_0x5a34ca[_0xbd0f('0x1d')];return _[_0xbd0f('0x20')]({},_0xb0c318,_0x1c0211);});})[_0xbd0f('0x21')](function(_0xeab4e){throw _0xeab4e;});}exports[_0xbd0f('0x22')]=getRealtimeAgents;function getAgentStatus(_0x5612f3){var _0x50f694=_0xbd0f('0xc');if(isAgentPaused(_0x5612f3))_0x50f694=_0xbd0f('0x12');else if(isAgentPaused(_0x5612f3,!![]))_0x50f694='*pause';else if(isAgentIdle(_0x5612f3))_0x50f694=_0xbd0f('0xb');else _0x50f694=_0xbd0f('0x23');return _0x50f694;}exports[_0xbd0f('0x24')]=getAgentStatus;function getAgentIdsByQueues(_0x162a08,_0x261da0){var _0x2cefcc=_[_0xbd0f('0x25')](_0x162a08)?_0x162a08:[_0x162a08];var _0x135dab=_[_0xbd0f('0x26')](_0x261da0)+_0xbd0f('0x27');var _0x409d68=_[_0xbd0f('0x28')](_0x2cefcc,function(_0x5e0a12){return db[_0x135dab][_0xbd0f('0x29')]({'where':{'id':_0x5e0a12}})[_0xbd0f('0x1b')](function(_0x14af69){if(!_0x14af69)return[];return _0x14af69['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xbd0f('0x2a')](_0x409d68)[_0xbd0f('0x1b')](function(_0x1910c2){var _0x2362cd=_(_0x1910c2)[_0xbd0f('0x2b')]()[_0xbd0f('0x28')]('id')['uniq']()[_0xbd0f('0x2c')]();return _0x2362cd;});}exports[_0xbd0f('0x2d')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x4df061,_0x5d2aeb,_0x5b0e86){try{if(_0x5d2aeb[_0xbd0f('0xa')]>0x0){_0x4df061=_0x4df061[_0xbd0f('0x9')](function(_0x3a9c7a){return _0x5d2aeb[_0xbd0f('0x2e')](_0x3a9c7a['id']);});}var _0x3d4968=_0x4df061[_0xbd0f('0x9')](function(_0x21be0c){var _0x3cf8ab=_0xbd0f('0x23');if(isAgentIdle(_0x21be0c)){_0x3cf8ab=_0xbd0f('0xb');}return _0x3cf8ab===_0x5b0e86;});return _['map'](_0x3d4968,'id');}catch(_0xa20d44){throw _0xa20d44;}}exports[_0xbd0f('0x2f')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x39493e,_0xd77c08,_0x1b546f){return Promise[_0xbd0f('0x30')]()[_0xbd0f('0x1b')](function(){if(_0xd77c08[_0xbd0f('0xa')]>0x0){_0x39493e=_0x39493e[_0xbd0f('0x9')](function(_0x3149a1){return _0xd77c08[_0xbd0f('0x2e')](_0x3149a1['id']);});}return _0x39493e;})['then'](function(){return db[_0xbd0f('0x31')]['findAll']({'attributes':['id','name','fullname',_0xbd0f('0x5'),_0xbd0f('0x6'),_0xbd0f('0x32'),_0xbd0f('0x7'),'smsPause',_0xbd0f('0x11'),_0xbd0f('0x8'),_0xbd0f('0x33')],'where':{'id':{'$in':_['map'](_0x39493e,'id')}},'raw':!![]});})[_0xbd0f('0x1b')](function(_0x3b3f7f){return _0x3b3f7f[_0xbd0f('0x28')](function(_0x1e411a){var _0x16636e=_['find'](_0x39493e,['id',_0x1e411a['id']]);var _0x4b9a17=filterAgentAttributes(_0x16636e);_['merge'](_0x1e411a,_0x4b9a17);_0x1e411a[_0xbd0f('0x34')]=getAgentStatus(_0x1e411a);return _0x1e411a;});})[_0xbd0f('0x1b')](function(_0xac02ca){var _0xcd90cc=sortAgentsByStatus(_0xac02ca,_0x1b546f);return _[_0xbd0f('0x28')](_0xcd90cc,'id');})[_0xbd0f('0x21')](function(_0x3afd2b){throw _0x3afd2b;});}exports[_0xbd0f('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x12f9f3){var _0x4b152f={'fields':[],'order':null};var _0x4ead4c=_0x12f9f3['split'](',');_0x4b152f[_0xbd0f('0x36')]=_['filter'](_0x4ead4c,function(_0x1792cb){if(!_0x1792cb['includes'](_0xbd0f('0x34'))){return!![];}_0x4b152f[_0xbd0f('0x37')]=_['startsWith'](_0x1792cb,'-')?_0xbd0f('0x38'):_0xbd0f('0x39');return![];});return _0x4b152f;}exports[_0xbd0f('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x34bad2){if(_0x34bad2[_0xbd0f('0x2e')]('fullname')&&!_0x34bad2[_0xbd0f('0x2e')](_0xbd0f('0x3b'))){var _0x4b8b85=_0x34bad2[_0xbd0f('0x3c')](0x0,_0x34bad2['indexOf']('fullname'));_0x34bad2+=','+_0x4b8b85+_0xbd0f('0x3b');}return _0x34bad2;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x18e9c6,_0x390f9f){var _0x481002=_0x18e9c6[_0xbd0f('0x3d')](function(_0x385be4,_0x245d27){if(_0x385be4[_0xbd0f('0x34')]===_0x245d27[_0xbd0f('0x34')]){if(_0x385be4['globalStatus']===_0xbd0f('0x12')){if(_0x390f9f===_0xbd0f('0x38')){return(_0x385be4[_0xbd0f('0x33')]||'')<(_0x245d27[_0xbd0f('0x33')]||'')||_0x385be4[_0xbd0f('0x3e')][_0xbd0f('0x3f')]()>_0x245d27['fullname'][_0xbd0f('0x3f')]()?0x1:-0x1;}else{return(_0x385be4['pauseType']||'')<(_0x245d27[_0xbd0f('0x33')]||'')||_0x385be4[_0xbd0f('0x3e')]['toLowerCase']()>_0x245d27[_0xbd0f('0x3e')][_0xbd0f('0x3f')]()?-0x1:0x1;}}else{if(_0x390f9f===_0xbd0f('0x38')){return _0x385be4[_0xbd0f('0x3e')][_0xbd0f('0x3f')]()<_0x245d27['fullname'][_0xbd0f('0x3f')]()?0x1:-0x1;}else{return _0x385be4['fullname'][_0xbd0f('0x3f')]()<_0x245d27[_0xbd0f('0x3e')][_0xbd0f('0x3f')]()?-0x1:0x1;}}}else{if(_0x390f9f===_0xbd0f('0x38')){return _0x385be4['globalStatus']<_0x245d27[_0xbd0f('0x34')]?0x1:-0x1;}else{return _0x385be4[_0xbd0f('0x34')]<_0x245d27[_0xbd0f('0x34')]?-0x1:0x1;}}});return _0x481002;}exports[_0xbd0f('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0x29de86){var _0x329dd8=[_0xbd0f('0x41'),_0xbd0f('0x42'),_0xbd0f('0x43'),_0xbd0f('0x44'),_0xbd0f('0x33'),_0xbd0f('0x44'),'internal',_0xbd0f('0x45'),_0xbd0f('0x5'),_0xbd0f('0x7'),'mailPause',_0xbd0f('0x46'),_0xbd0f('0x8'),_0xbd0f('0x6'),_0xbd0f('0x11'),_0xbd0f('0x47'),'openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity',_0xbd0f('0x48'),_0xbd0f('0x49'),_0xbd0f('0x4a'),_0xbd0f('0x4b'),'smsCurrentCapacity',_0xbd0f('0x4c'),'faxCurrentCapacity','chatStatus',_0xbd0f('0x16'),_0xbd0f('0x15'),_0xbd0f('0x17'),_0xbd0f('0x18'),_0xbd0f('0x14'),_0xbd0f('0x10'),_0xbd0f('0x4d'),'openchannelStatusTime',_0xbd0f('0x4e'),_0xbd0f('0x4f'),'whatsappStatusTime','faxStatusTime',_0xbd0f('0x50'),_0xbd0f('0x51'),_0xbd0f('0x52'),_0xbd0f('0x53'),_0xbd0f('0x54'),_0xbd0f('0x55'),_0xbd0f('0x56')];var _0x2ff120=[_0xbd0f('0x5'),_0xbd0f('0x7'),_0xbd0f('0x32'),'smsPause',_0xbd0f('0x8'),_0xbd0f('0x6'),'voicePause',_0xbd0f('0x42')];var _0x5357b5=_(_0x29de86)[_0xbd0f('0x57')](_0x2ff120)[_0xbd0f('0x58')](_0x329dd8)['value']();return _0x5357b5;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0xbbb8=['filterAgentAttributes','lodash','jayson/promise','http','client','mailPause','openchannelPause','voicePause','whatsappPause','filter','idle','unknown','unavailable','ringing','voiceStatus','every','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','busy','isArray','startCase','Queue','map','getAgents','all','flatten','uniq','value','length','getAgentIdsByStatus','includes','findAll','name','fullname','chatPause','pauseType','find','globalStatus','fields','startsWith','DESC','ASC','internal','substring','indexOf','sort','pause','toLowerCase','sortAgentsByStatus','userpic','online','lastPauseAt','address','smsPause','chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','whatsappStatusTime','voiceStatusTime','destconnectedlinenum','routealias','faxPause','omit','pick'];(function(_0x45db4e,_0x26659e){var _0x2f714c=function(_0x4cabee){while(--_0x4cabee){_0x45db4e['push'](_0x45db4e['shift']());}};_0x2f714c(++_0x26659e);}(_0xbbb8,0x155));var _0x8bbb=function(_0x167a30,_0x5b0089){_0x167a30=_0x167a30-0x0;var _0x3b589a=_0xbbb8[_0x167a30];return _0x3b589a;};'use strict';var _=require(_0x8bbb('0x0'));var jayson=require(_0x8bbb('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0x8bbb('0x2')]({'port':0x232a});var routingClient=jayson[_0x8bbb('0x3')][_0x8bbb('0x2')]({'port':0x232c});function isAgentPaused(_0x107410,_0x1a3e6a){var _0x37275b=[_0x107410['chatPause'],_0x107410['faxPause'],_0x107410[_0x8bbb('0x4')],_0x107410[_0x8bbb('0x5')],_0x107410['smsPause'],_0x107410[_0x8bbb('0x6')],_0x107410[_0x8bbb('0x7')]];if(!_0x1a3e6a)return _['every'](_0x37275b);var _0x48260a=_[_0x8bbb('0x8')](_0x37275b);return _0x48260a['length']>0x0&&_0x48260a['length']<_0x37275b['length']?!![]:![];}function isIdle(_0x34bb7f){return _0x34bb7f===_0x8bbb('0x9')||_0x34bb7f===_0x8bbb('0xa')||_0x34bb7f===_0x8bbb('0xb')||_0x34bb7f===_0x8bbb('0xc')||_['isNil'](_0x34bb7f);}function isAgentIdle(_0x2fdef3){if(_0x2fdef3[_0x8bbb('0xd')]!==_0x8bbb('0x9')&&_0x2fdef3['voicePause']){_0x2fdef3[_0x8bbb('0xd')]='pause';return![];}return _[_0x8bbb('0xe')]([_0x2fdef3[_0x8bbb('0xf')],_0x2fdef3[_0x8bbb('0x10')],_0x2fdef3[_0x8bbb('0x11')],_0x2fdef3[_0x8bbb('0x12')],_0x2fdef3[_0x8bbb('0x13')],_0x2fdef3[_0x8bbb('0xd')],_0x2fdef3[_0x8bbb('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient['request']('Agents',{})[_0x8bbb('0x15')](function(_0x5d3690){if(_0x5d3690[_0x8bbb('0x16')]){throw new Error(_0x8bbb('0x17'));}var _0xec1154=_0x5d3690[_0x8bbb('0x18')];return routingClient[_0x8bbb('0x19')](_0x8bbb('0x1a'),{})[_0x8bbb('0x15')](function(_0x2e993d){if(_0x2e993d[_0x8bbb('0x16')]){throw new Error(_0x8bbb('0x1b'));}var _0xd31cee=_0x2e993d[_0x8bbb('0x18')];return _[_0x8bbb('0x1c')]({},_0xec1154,_0xd31cee);});})[_0x8bbb('0x1d')](function(_0x3cc9b0){throw _0x3cc9b0;});}exports[_0x8bbb('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x4988df){var _0x175f3a='unknown';if(isAgentPaused(_0x4988df))_0x175f3a='pause';else if(isAgentPaused(_0x4988df,!![]))_0x175f3a=_0x8bbb('0x1f');else if(isAgentIdle(_0x4988df))_0x175f3a='idle';else _0x175f3a=_0x8bbb('0x20');return _0x175f3a;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x375275,_0x2b4cdd){var _0x213cef=_[_0x8bbb('0x21')](_0x375275)?_0x375275:[_0x375275];var _0x557333=_[_0x8bbb('0x22')](_0x2b4cdd)+_0x8bbb('0x23');var _0x233792=_[_0x8bbb('0x24')](_0x213cef,function(_0x44a80b){return db[_0x557333]['findOne']({'where':{'id':_0x44a80b}})['then'](function(_0x1b2c80){if(!_0x1b2c80)return[];return _0x1b2c80[_0x8bbb('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x8bbb('0x26')](_0x233792)[_0x8bbb('0x15')](function(_0x4d52b7){var _0x46943e=_(_0x4d52b7)[_0x8bbb('0x27')]()[_0x8bbb('0x24')]('id')[_0x8bbb('0x28')]()[_0x8bbb('0x29')]();return _0x46943e;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1a8cdf,_0x4a29d3,_0x85ba75){try{if(_0x4a29d3[_0x8bbb('0x2a')]>0x0){_0x1a8cdf=_0x1a8cdf[_0x8bbb('0x8')](function(_0x3fc1cc){return _0x4a29d3['includes'](_0x3fc1cc['id']);});}var _0x211126=_0x1a8cdf['filter'](function(_0x45a25f){var _0x1a6e2e=_0x8bbb('0x20');if(isAgentIdle(_0x45a25f)){_0x1a6e2e=_0x8bbb('0x9');}return _0x1a6e2e===_0x85ba75;});return _[_0x8bbb('0x24')](_0x211126,'id');}catch(_0x524cef){throw _0x524cef;}}exports[_0x8bbb('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x2876d0,_0x481d34,_0x511e49){return Promise['resolve']()['then'](function(){if(_0x481d34[_0x8bbb('0x2a')]>0x0){_0x2876d0=_0x2876d0[_0x8bbb('0x8')](function(_0x10017c){return _0x481d34[_0x8bbb('0x2c')](_0x10017c['id']);});}return _0x2876d0;})[_0x8bbb('0x15')](function(){return db['User'][_0x8bbb('0x2d')]({'attributes':['id',_0x8bbb('0x2e'),_0x8bbb('0x2f'),_0x8bbb('0x30'),'faxPause',_0x8bbb('0x4'),_0x8bbb('0x5'),'smsPause','voicePause',_0x8bbb('0x7'),_0x8bbb('0x31')],'where':{'id':{'$in':_[_0x8bbb('0x24')](_0x2876d0,'id')}},'raw':!![]});})[_0x8bbb('0x15')](function(_0x4030a6){return _0x4030a6['map'](function(_0x34508f){var _0x9601c6=_[_0x8bbb('0x32')](_0x2876d0,['id',_0x34508f['id']]);var _0xfbcbe6=filterAgentAttributes(_0x9601c6);_[_0x8bbb('0x1c')](_0x34508f,_0xfbcbe6);_0x34508f[_0x8bbb('0x33')]=getAgentStatus(_0x34508f);return _0x34508f;});})[_0x8bbb('0x15')](function(_0x51dcf0){var _0x3a6e12=sortAgentsByStatus(_0x51dcf0,_0x511e49);return _[_0x8bbb('0x24')](_0x3a6e12,'id');})[_0x8bbb('0x1d')](function(_0x1c3fc6){throw _0x1c3fc6;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0xae1b91){var _0x2e8d2e={'fields':[],'order':null};var _0x512f2b=_0xae1b91['split'](',');_0x2e8d2e[_0x8bbb('0x34')]=_[_0x8bbb('0x8')](_0x512f2b,function(_0x5ca3c5){if(!_0x5ca3c5[_0x8bbb('0x2c')]('globalStatus')){return!![];}_0x2e8d2e['order']=_[_0x8bbb('0x35')](_0x5ca3c5,'-')?_0x8bbb('0x36'):_0x8bbb('0x37');return![];});return _0x2e8d2e;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x296690){if(_0x296690[_0x8bbb('0x2c')]('fullname')&&!_0x296690[_0x8bbb('0x2c')](_0x8bbb('0x38'))){var _0x794a0a=_0x296690[_0x8bbb('0x39')](0x0,_0x296690[_0x8bbb('0x3a')](_0x8bbb('0x2f')));_0x296690+=','+_0x794a0a+_0x8bbb('0x38');}return _0x296690;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x512258,_0x46bf3e){var _0x2c6624=_0x512258[_0x8bbb('0x3b')](function(_0x3f1126,_0x398a40){if(_0x3f1126[_0x8bbb('0x33')]===_0x398a40[_0x8bbb('0x33')]){if(_0x3f1126[_0x8bbb('0x33')]===_0x8bbb('0x3c')){if(_0x46bf3e===_0x8bbb('0x36')){return(_0x3f1126[_0x8bbb('0x31')]||'')<(_0x398a40[_0x8bbb('0x31')]||'')||_0x3f1126['fullname'][_0x8bbb('0x3d')]()>_0x398a40['fullname'][_0x8bbb('0x3d')]()?0x1:-0x1;}else{return(_0x3f1126['pauseType']||'')<(_0x398a40[_0x8bbb('0x31')]||'')||_0x3f1126[_0x8bbb('0x2f')][_0x8bbb('0x3d')]()>_0x398a40[_0x8bbb('0x2f')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x46bf3e===_0x8bbb('0x36')){return _0x3f1126[_0x8bbb('0x2f')][_0x8bbb('0x3d')]()<_0x398a40[_0x8bbb('0x2f')]['toLowerCase']()?0x1:-0x1;}else{return _0x3f1126[_0x8bbb('0x2f')][_0x8bbb('0x3d')]()<_0x398a40[_0x8bbb('0x2f')][_0x8bbb('0x3d')]()?-0x1:0x1;}}}else{if(_0x46bf3e==='DESC'){return _0x3f1126[_0x8bbb('0x33')]<_0x398a40['globalStatus']?0x1:-0x1;}else{return _0x3f1126['globalStatus']<_0x398a40[_0x8bbb('0x33')]?-0x1:0x1;}}});return _0x2c6624;}exports[_0x8bbb('0x3e')]=sortAgentsByStatus;function filterAgentAttributes(_0x2291bc){var _0x445c9b=[_0x8bbb('0x3f'),_0x8bbb('0x40'),'lastLoginAt','lastPauseAt',_0x8bbb('0x31'),_0x8bbb('0x41'),_0x8bbb('0x38'),_0x8bbb('0x42'),_0x8bbb('0x30'),'openchannelPause',_0x8bbb('0x4'),_0x8bbb('0x43'),_0x8bbb('0x7'),'faxPause',_0x8bbb('0x6'),_0x8bbb('0x44'),'openchannelCapacity',_0x8bbb('0x45'),_0x8bbb('0x46'),_0x8bbb('0x47'),'faxCapacity',_0x8bbb('0x48'),'openchannelCurrentCapacity','mailCurrentCapacity',_0x8bbb('0x49'),_0x8bbb('0x4a'),_0x8bbb('0x4b'),_0x8bbb('0xf'),_0x8bbb('0x12'),'mailStatus','smsStatus',_0x8bbb('0x14'),_0x8bbb('0x10'),_0x8bbb('0xd'),'chatStatusTime',_0x8bbb('0x4c'),'mailStatusTime','smsStatusTime',_0x8bbb('0x4d'),'faxStatusTime',_0x8bbb('0x4e'),'queue',_0x8bbb('0x4f'),'screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording',_0x8bbb('0x50')];var _0xabe6ba=[_0x8bbb('0x30'),'openchannelPause','mailPause',_0x8bbb('0x43'),_0x8bbb('0x7'),_0x8bbb('0x51'),_0x8bbb('0x6'),_0x8bbb('0x40')];var _0x2414b5=_(_0x2291bc)[_0x8bbb('0x52')](_0xabe6ba)[_0x8bbb('0x53')](_0x445c9b)[_0x8bbb('0x29')]();return _0x2414b5;}exports[_0x8bbb('0x54')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 2b5890f..c300fda 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3070=['invalid','notInUse','ringing','unavailable','unknown','originated','message','statusMessage','startPredictive','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','concat','outbound','map','loggedInDb','busy','pTalking','merge','pick','initializeQueues','jayson/promise','util','client','http','available','loggedIn','paused','waiting','inUse'];(function(_0x5e068e,_0x28ff2e){var _0x329514=function(_0x1c9815){while(--_0x1c9815){_0x5e068e['push'](_0x5e068e['shift']());}};_0x329514(++_0x28ff2e);}(_0x3070,0x10b));var _0x0307=function(_0x4139b8,_0x59a79a){_0x4139b8=_0x4139b8-0x0;var _0x5179b6=_0x3070[_0x4139b8];return _0x5179b6;};'use strict';var _=require('lodash');var jayson=require(_0x0307('0x0'));var util=require(_0x0307('0x1'));var amiClient=jayson[_0x0307('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0x0307('0x2')][_0x0307('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x0307('0x4'),_0x0307('0x5'),_0x0307('0x6'),_0x0307('0x7')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x0307('0x8'),_0x0307('0x9'),'loggedInDb',_0x0307('0xa'),'onHold',_0x0307('0xb'),'ringInUse','talking',_0x0307('0xc'),_0x0307('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0x0307('0xe'),_0x0307('0xf'),_0x0307('0x10'),'dialActive','dialMethod','Trunk',_0x0307('0x11'),'startProgressive','erlangCalls','erlangCallToSecond',_0x0307('0x12'),_0x0307('0x13'),_0x0307('0x14'),_0x0307('0x15'),_0x0307('0x16'),_0x0307('0x17'),_0x0307('0x18'),_0x0307('0x19'),'predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit',_0x0307('0x1a'),_0x0307('0x1b')];function getRealtimeQueues(_0xf9edc1,_0x10ec3a){var _0x4bbdd5=_0x10ec3a===_0x0307('0x1c')?amiClient:routingClient;return _0x4bbdd5[_0x0307('0x1d')](_[_0x0307('0x1e')](_0x10ec3a)+_0x0307('0x1f'),_0xf9edc1)[_0x0307('0x20')](function(_0x3b48c3){if(_0x3b48c3['error'])throw new Error(util[_0x0307('0x21')](_0x0307('0x22'),_0x10ec3a));return _0x3b48c3[_0x0307('0x23')];})[_0x0307('0x24')](function(_0x4a7fbd){throw _0x4a7fbd;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x2aad8b,_0x21016b,_0x10154e,_0xa411bb){var _0x315e83=DEFAULT_QUEUE_ATTRIBUTES;if(_0x10154e===_0x0307('0x1c')){if(_0xa411bb==='inbound'){_0x315e83=_0x315e83[_0x0307('0x25')](VOICE_QUEUE_ATTRIBUTES);}else if(_0xa411bb===_0x0307('0x26')){_0x315e83=_0x315e83[_0x0307('0x25')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x2aad8b[_0x0307('0x27')](function(_0x31f56f){var _0x24319d=_0x31f56f['get']({'plain':!![]});_0x24319d[_0x0307('0x6')]=0x0;_0x24319d[_0x0307('0x28')]=0x0;_0x24319d[_0x0307('0x5')]=0x0;_0x24319d[_0x0307('0x4')]=0x0;_0x24319d[_0x0307('0x7')]=0x0;if(_0x10154e===_0x0307('0x1c')){_0x24319d['talking']=0x0;_0x24319d[_0x0307('0x29')]=0x0;if(_0xa411bb==='outbound'){_0x24319d[_0x0307('0x2a')]=0x0;_0x24319d['originated']=0x0;}}var _0x1291fc=_['find'](_0x21016b,['id',_0x24319d['id']]);if(_0x1291fc){_[_0x0307('0x2b')](_0x24319d,_[_0x0307('0x2c')](_0x1291fc,_0x315e83));}return _0x24319d;});}exports[_0x0307('0x2d')]=initializeQueues; \ No newline at end of file +var _0x2049=['loggedInDb','notInUse','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','dialActive','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','getRealtimeQueues','voice','inbound','outbound','concat','map','get','paused','waiting','merge','pick','initializeQueues','jayson/promise','client','http','available','loggedIn','busy','inUse','invalid'];(function(_0x4cd80f,_0x3dd6c0){var _0x57b7a4=function(_0x467938){while(--_0x467938){_0x4cd80f['push'](_0x4cd80f['shift']());}};_0x57b7a4(++_0x3dd6c0);}(_0x2049,0x180));var _0x9204=function(_0x30bba0,_0x2f9580){_0x30bba0=_0x30bba0-0x0;var _0x507c27=_0x2049[_0x30bba0];return _0x507c27;};'use strict';var _=require('lodash');var jayson=require(_0x9204('0x0'));var util=require('util');var amiClient=jayson[_0x9204('0x1')]['http']({'port':0x232a});var routingClient=jayson[_0x9204('0x1')][_0x9204('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x9204('0x3'),_0x9204('0x4'),'paused','waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x9204('0x5'),_0x9204('0x6'),_0x9204('0x7'),_0x9204('0x8'),_0x9204('0x9'),'onHold',_0x9204('0xa'),_0x9204('0xb'),_0x9204('0xc'),_0x9204('0xd'),_0x9204('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x9204('0xf'),_0x9204('0x10'),'message','statusMessage',_0x9204('0x11'),'dialMethod','Trunk',_0x9204('0x12'),_0x9204('0x13'),_0x9204('0x14'),_0x9204('0x15'),'erlangAbandonmentRate',_0x9204('0x16'),_0x9204('0x17'),_0x9204('0x18'),_0x9204('0x19'),'predictiveIntervalAvailable',_0x9204('0x1a'),'predictiveIntervalAnsweredCalls',_0x9204('0x1b'),'predictiveIntervalDroppedCallsCallersExit',_0x9204('0x1c'),_0x9204('0x1d')];function getRealtimeQueues(_0x28e73d,_0x57ca5f){var _0x2785cd=_0x57ca5f==='voice'?amiClient:routingClient;return _0x2785cd[_0x9204('0x1e')](_[_0x9204('0x1f')](_0x57ca5f)+_0x9204('0x20'),_0x28e73d)['then'](function(_0x9e7549){if(_0x9e7549[_0x9204('0x21')])throw new Error(util[_0x9204('0x22')](_0x9204('0x23'),_0x57ca5f));return _0x9e7549['result'];})[_0x9204('0x24')](function(_0x2a885f){throw _0x2a885f;});}exports[_0x9204('0x25')]=getRealtimeQueues;function initializeQueues(_0x4a31b8,_0x1b1578,_0x412063,_0x29e389){var _0x3b6995=DEFAULT_QUEUE_ATTRIBUTES;if(_0x412063===_0x9204('0x26')){if(_0x29e389===_0x9204('0x27')){_0x3b6995=_0x3b6995['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x29e389===_0x9204('0x28')){_0x3b6995=_0x3b6995[_0x9204('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x4a31b8[_0x9204('0x2a')](function(_0x100b61){var _0x37f1fc=_0x100b61[_0x9204('0x2b')]({'plain':!![]});_0x37f1fc[_0x9204('0x2c')]=0x0;_0x37f1fc['loggedInDb']=0x0;_0x37f1fc[_0x9204('0x4')]=0x0;_0x37f1fc[_0x9204('0x3')]=0x0;_0x37f1fc[_0x9204('0x2d')]=0x0;if(_0x412063===_0x9204('0x26')){_0x37f1fc[_0x9204('0xc')]=0x0;_0x37f1fc[_0x9204('0x5')]=0x0;if(_0x29e389==='outbound'){_0x37f1fc[_0x9204('0xf')]=0x0;_0x37f1fc[_0x9204('0x10')]=0x0;}}var _0x494411=_['find'](_0x1b1578,['id',_0x37f1fc['id']]);if(_0x494411){_[_0x9204('0x2e')](_0x37f1fc,_[_0x9204('0x2f')](_0x494411,_0x3b6995));}return _0x37f1fc;});}exports[_0x9204('0x30')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 6d87afa..f99fd32 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(_0x5becd6,_0x13e651){var _0x3b7b78=function(_0x2193b3){while(--_0x2193b3){_0x5becd6['push'](_0x5becd6['shift']());}};_0x3b7b78(++_0x13e651);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x40318c,_0x2ac42f){var _0x5783b8=function(_0x2f95f0){while(--_0x2f95f0){_0x40318c['push'](_0x40318c['shift']());}};_0x5783b8(++_0x2ac42f);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index e2d53f8..0ee6add 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 _0x3915=['getFirstInterface','cpus','model','join','createHash','md5','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','update','substring','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','address','127.0.0.1'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3915,0xe0));var _0x5391=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x3915[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x5391('0x0'));var exec=require(_0x5391('0x1'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x1cf434=[];var _0x5c29e6=os[_0x5391('0x2')]();var _0x57954b=_[_0x5391('0x3')](_[_0x5391('0x4')](_0x5c29e6));for(var _0x3d3a54=0x0;_0x3d3a54<_0x57954b[_0x5391('0x5')];_0x3d3a54++){var _0x5600d8=_0x5c29e6[_0x57954b[_0x3d3a54]][_0x5391('0x6')](function(_0x250852){return _0x250852['family']===_0x5391('0x7')&&_0x250852[_0x5391('0x8')]===![];});_0x1cf434=_0x1cf434[_0x5391('0x9')](_0x5600d8);}return _0x1cf434;}function getFirstInterface(){var _0x41a8b6=_[_0x5391('0xa')](getInterfaces());return{'macAddress':_0x41a8b6&&_0x41a8b6[_0x5391('0xb')]?_0x41a8b6[_0x5391('0xb')]:'00:00:00:00:00:00','ipAddress':_0x41a8b6&&_0x41a8b6[_0x5391('0xc')]?_0x41a8b6[_0x5391('0xc')]:_0x5391('0xd')};}exports[_0x5391('0xe')]=getFirstInterface;function getCPUhash(){var _0x567ca1=_[_0x5391('0x3')](os[_0x5391('0xf')]()['map'](function(_0x12fca6){return _0x12fca6[_0x5391('0x10')];}))[_0x5391('0x11')](':');return crypto[_0x5391('0x12')](_0x5391('0x13'))['update'](_0x567ca1)[_0x5391('0x14')](_0x5391('0x15'));}exports[_0x5391('0x16')]=function(){var _0x2086cd=os[_0x5391('0x17')]();var _0x16367d=/[0-9a-f-]{36}/;if(config[_0x5391('0x18')]&&_0x16367d[_0x5391('0x19')](config['licenseToken'])){return config[_0x5391('0x18')];}else if(_0x2086cd===_0x5391('0x1a')){return exec(_0x5391('0x1b'),{'encoding':_0x5391('0x1c')})[_0x5391('0x1d')]('\x0d\x0a','');}else{var _0x20acaa=getFirstInterface();var _0xa3c9be=getCPUhash();var _0x3ea50d=_0xa3c9be+'|'+os[_0x5391('0x1e')]()+'|'+_0x20acaa[_0x5391('0x1f')]+'|'+_0x20acaa['ipAddress'];var _0x44a0cd=crypto[_0x5391('0x12')](_0x5391('0x13'))[_0x5391('0x20')](_0x3ea50d)['digest']('hex');return _0x44a0cd['substring'](0x0,0x8)+'-'+_0x44a0cd[_0x5391('0x21')](0x8,0xc)+'-'+_0x44a0cd[_0x5391('0x21')](0xc,0x10)+'-'+_0x44a0cd['substring'](0x10,0x14)+'-'+_0x44a0cd['substring'](0x14);}}; \ No newline at end of file +var _0xc2e4=['substring','crypto','child_process','execSync','../environment','keys','filter','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','map','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname'];(function(_0xf000a2,_0x2de1d8){var _0x5b7502=function(_0x3256af){while(--_0x3256af){_0xf000a2['push'](_0xf000a2['shift']());}};_0x5b7502(++_0x2de1d8);}(_0xc2e4,0x15d));var _0x4c2e=function(_0x2d3fa5,_0x18fe2b){_0x2d3fa5=_0x2d3fa5-0x0;var _0x2345c0=_0xc2e4[_0x2d3fa5];return _0x2345c0;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x4c2e('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0x4c2e('0x1'))[_0x4c2e('0x2')];var config=require(_0x4c2e('0x3'));function getInterfaces(){var _0x1d0605=[];var _0x38193c=os['networkInterfaces']();var _0x5f26a4=_['orderBy'](_[_0x4c2e('0x4')](_0x38193c));for(var _0x1be4a6=0x0;_0x1be4a6<_0x5f26a4['length'];_0x1be4a6++){var _0x332ff9=_0x38193c[_0x5f26a4[_0x1be4a6]][_0x4c2e('0x5')](function(_0x369f8e){return _0x369f8e['family']==='IPv4'&&_0x369f8e['internal']===![];});_0x1d0605=_0x1d0605['concat'](_0x332ff9);}return _0x1d0605;}function getFirstInterface(){var _0x1b3689=_['head'](getInterfaces());return{'macAddress':_0x1b3689&&_0x1b3689[_0x4c2e('0x6')]?_0x1b3689[_0x4c2e('0x6')]:_0x4c2e('0x7'),'ipAddress':_0x1b3689&&_0x1b3689['address']?_0x1b3689[_0x4c2e('0x8')]:_0x4c2e('0x9')};}exports[_0x4c2e('0xa')]=getFirstInterface;function getCPUhash(){var _0x30ba2e=_[_0x4c2e('0xb')](os['cpus']()[_0x4c2e('0xc')](function(_0x9fed38){return _0x9fed38[_0x4c2e('0xd')];}))[_0x4c2e('0xe')](':');return crypto[_0x4c2e('0xf')](_0x4c2e('0x10'))[_0x4c2e('0x11')](_0x30ba2e)[_0x4c2e('0x12')](_0x4c2e('0x13'));}exports[_0x4c2e('0x14')]=function(){var _0x406cbc=os[_0x4c2e('0x15')]();var _0x20ab75=/[0-9a-f-]{36}/;if(config[_0x4c2e('0x16')]&&_0x20ab75[_0x4c2e('0x17')](config['licenseToken'])){return config[_0x4c2e('0x16')];}else if(_0x406cbc===_0x4c2e('0x18')){return exec(_0x4c2e('0x19'),{'encoding':_0x4c2e('0x1a')})['replace']('\x0d\x0a','');}else{var _0x59bd80=getFirstInterface();var _0x867027=getCPUhash();var _0x143dff=_0x867027+'|'+os[_0x4c2e('0x1b')]()+'|'+_0x59bd80['macAddress']+'|'+_0x59bd80['ipAddress'];var _0x292b6f=crypto[_0x4c2e('0xf')](_0x4c2e('0x10'))['update'](_0x143dff)['digest'](_0x4c2e('0x13'));return _0x292b6f[_0x4c2e('0x1c')](0x0,0x8)+'-'+_0x292b6f[_0x4c2e('0x1c')](0x8,0xc)+'-'+_0x292b6f[_0x4c2e('0x1c')](0xc,0x10)+'-'+_0x292b6f[_0x4c2e('0x1c')](0x10,0x14)+'-'+_0x292b6f[_0x4c2e('0x1c')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0112934..908bd91 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 _0xfe40=['default','util','moment','bluebird','version','../../mysqldb','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','then','catch','get','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','data1','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','error','message','getUuid','License','findOrCreate','spread'];(function(_0x588213,_0x5334c5){var _0x4077c7=function(_0x52b198){while(--_0x52b198){_0x588213['push'](_0x588213['shift']());}};_0x4077c7(++_0x5334c5);}(_0xfe40,0xef));var _0x0fe4=function(_0x41c6ca,_0x7bdcb6){_0x41c6ca=_0x41c6ca-0x0;var _0x5f3e10=_0xfe40[_0x41c6ca];return _0x5f3e10;};'use strict';var util=require(_0x0fe4('0x0'));var moment=require(_0x0fe4('0x1'));var rp=require('request-promise');var BPromise=require(_0x0fe4('0x2'));var pkginfo=require('pkginfo')(module,_0x0fe4('0x3'));var db=require(_0x0fe4('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x0fe4('0x5'));var logger=require('../logger')(_0x0fe4('0x6'));var HOST=_0x0fe4('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x43431d){return new BPromise(function(_0x2a9e0f,_0x253310){var _0x164c0c=util[_0x0fe4('0x8')](_0x0fe4('0x9'),HOST,_0x43431d,module[_0x0fe4('0xa')][_0x0fe4('0x3')]);if(oldToken){_0x164c0c=util[_0x0fe4('0x8')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x43431d,module[_0x0fe4('0xa')][_0x0fe4('0x3')],oldToken);}var _0x3b330c={'uri':_0x164c0c,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x3b330c)[_0x0fe4('0xb')](function(_0x546750){_0x2a9e0f(_0x546750);})[_0x0fe4('0xc')](function(_0x19ef0f){_0x253310(_0x19ef0f);});});}function manageLicense(_0x5ddc56,_0x383e85){var _0x82e459=_0x383e85[_0x0fe4('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x82e459['data1']!==_0x5ddc56&&!_0x82e459[_0x0fe4('0xe')]){oldToken=_0x82e459['data1'];}httpRequest(_0x5ddc56)['then'](function(_0x1595fb){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1595fb[_0x0fe4('0xf')]){isOldTokenSent=![];if(!_0x82e459[_0x0fe4('0x6')]&&_0x82e459['license']!=_0x1595fb[_0x0fe4('0x6')]||_0x82e459['license']&&_0x82e459[_0x0fe4('0xe')]){logger[_0x0fe4('0x10')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x82e459[_0x0fe4('0x6')]&&!_0x82e459[_0x0fe4('0xe')]&&_0x82e459[_0x0fe4('0x6')]!=_0x1595fb[_0x0fe4('0x6')]){logger['info'](_0x0fe4('0x11'));}if(_0x82e459['license']&&!_0x82e459['data2']&&_0x82e459['license']==_0x1595fb[_0x0fe4('0x6')]){return _0x383e85;}return _0x383e85[_0x0fe4('0x12')]({'data1':_0x5ddc56,'data2':null,'license':_0x1595fb[_0x0fe4('0x6')]});}else{if(_0x1595fb[_0x0fe4('0x6')]||_0x82e459['license']){if(!_0x82e459[_0x0fe4('0xe')]){if(_0x82e459[_0x0fe4('0x13')]==_0x5ddc56){GRAY_PERIOD_REASON='Disabled';logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x0fe4('0x14');logger[_0x0fe4('0x10')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x82e459['data1'],_0x5ddc56);}logger[_0x0fe4('0x10')](_0x0fe4('0x15'),GRAY_PERIOD_REASON[_0x0fe4('0x16')](),moment()[_0x0fe4('0x8')](_0x0fe4('0x17')));return _0x383e85[_0x0fe4('0x12')]({'data2':encryptor[_0x0fe4('0x18')](moment()[_0x0fe4('0x8')](_0x0fe4('0x17')))});}else{if(moment()[_0x0fe4('0x19')](encryptor['decryptString'](_0x82e459[_0x0fe4('0xe')]),_0x0fe4('0x1a'))>DAYS){logger[_0x0fe4('0x10')]('DEMO\x20START\x20AT\x20%s',moment()[_0x0fe4('0x8')](_0x0fe4('0x17')));isOldTokenSent=![];return _0x383e85[_0x0fe4('0x12')]({'data1':_0x5ddc56,'data2':null,'license':null});}}}else{if(_0x82e459[_0x0fe4('0x13')]!=_0x5ddc56){logger[_0x0fe4('0x10')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x82e459[_0x0fe4('0x13')],_0x5ddc56);return _0x383e85[_0x0fe4('0x12')]({'data1':_0x5ddc56,'data2':null,'license':null});}}}return _0x383e85;})[_0x0fe4('0xb')](function(_0x4106eb){_0x383e85=_0x4106eb;})[_0x0fe4('0xc')](function(_0x84eff4){logger[_0x0fe4('0x1b')](_0x84eff4[_0x0fe4('0x1c')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x0fe4('0x1d')](),_0x383e85);},TIME);});}function defaultLicense(){var _0x281be5=hardware[_0x0fe4('0x1d')]();if(_0x281be5){return db[_0x0fe4('0x1e')][_0x0fe4('0x1f')]({'where':{'id':0x1},'defaults':{'data1':_0x281be5}})[_0x0fe4('0x20')](function(_0x3e354a,_0x93bbb7){logger[_0x0fe4('0x10')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x281be5);manageLicense(_0x281be5,_0x3e354a);})['catch'](function(_0x12783d){logger[_0x0fe4('0x1b')](_0x12783d['message']);});}}exports[_0x0fe4('0x21')]=defaultLicense; \ No newline at end of file +var _0x9bd6=['info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','data1','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','decryptString','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','bluebird','version','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','catch','active','data2'];(function(_0x19821a,_0x1a562b){var _0x423f38=function(_0xa704dd){while(--_0xa704dd){_0x19821a['push'](_0x19821a['shift']());}};_0x423f38(++_0x1a562b);}(_0x9bd6,0x17f));var _0x69bd=function(_0x311677,_0x2cbb60){_0x311677=_0x311677-0x0;var _0xa6d120=_0x9bd6[_0x311677];return _0xa6d120;};'use strict';var util=require(_0x69bd('0x0'));var moment=require(_0x69bd('0x1'));var rp=require('request-promise');var BPromise=require(_0x69bd('0x2'));var pkginfo=require('pkginfo')(module,_0x69bd('0x3'));var db=require(_0x69bd('0x4'))['db'];var encryptor=require(_0x69bd('0x5'));var hardware=require('./hardware');var logger=require(_0x69bd('0x6'))(_0x69bd('0x7'));var HOST=_0x69bd('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4b3153){return new BPromise(function(_0x2f8b80,_0x23e5b8){var _0x44a8c5=util[_0x69bd('0x9')](_0x69bd('0xa'),HOST,_0x4b3153,module['exports'][_0x69bd('0x3')]);if(oldToken){_0x44a8c5=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x4b3153,module[_0x69bd('0xb')][_0x69bd('0x3')],oldToken);}var _0x4d1466={'uri':_0x44a8c5,'method':_0x69bd('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x4d1466)[_0x69bd('0xd')](function(_0x1bcebe){_0x2f8b80(_0x1bcebe);})[_0x69bd('0xe')](function(_0x1645f7){_0x23e5b8(_0x1645f7);});});}function manageLicense(_0x4afe66,_0x3ecb40){var _0x114de3=_0x3ecb40['get']({'plain':!![]});if(!isOldTokenSent&&_0x114de3['data1']!==_0x4afe66&&!_0x114de3['data2']){oldToken=_0x114de3['data1'];}httpRequest(_0x4afe66)['then'](function(_0x1c3d61){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1c3d61[_0x69bd('0xf')]){isOldTokenSent=![];if(!_0x114de3['license']&&_0x114de3[_0x69bd('0x7')]!=_0x1c3d61[_0x69bd('0x7')]||_0x114de3[_0x69bd('0x7')]&&_0x114de3[_0x69bd('0x10')]){logger[_0x69bd('0x11')](_0x69bd('0x12'));}if(_0x114de3[_0x69bd('0x7')]&&!_0x114de3[_0x69bd('0x10')]&&_0x114de3['license']!=_0x1c3d61['license']){logger[_0x69bd('0x11')](_0x69bd('0x13'));}if(_0x114de3[_0x69bd('0x7')]&&!_0x114de3['data2']&&_0x114de3[_0x69bd('0x7')]==_0x1c3d61[_0x69bd('0x7')]){return _0x3ecb40;}return _0x3ecb40[_0x69bd('0x14')]({'data1':_0x4afe66,'data2':null,'license':_0x1c3d61['license']});}else{if(_0x1c3d61[_0x69bd('0x7')]||_0x114de3[_0x69bd('0x7')]){if(!_0x114de3[_0x69bd('0x10')]){if(_0x114de3['data1']==_0x4afe66){GRAY_PERIOD_REASON='Disabled';logger[_0x69bd('0x11')](_0x69bd('0x15'));}else{GRAY_PERIOD_REASON=_0x69bd('0x16');logger[_0x69bd('0x11')](_0x69bd('0x17'),_0x114de3[_0x69bd('0x18')],_0x4afe66);}logger[_0x69bd('0x11')](_0x69bd('0x19'),GRAY_PERIOD_REASON[_0x69bd('0x1a')](),moment()[_0x69bd('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x3ecb40[_0x69bd('0x14')]({'data2':encryptor[_0x69bd('0x1b')](moment()[_0x69bd('0x9')](_0x69bd('0x1c')))});}else{if(moment()['diff'](encryptor[_0x69bd('0x1d')](_0x114de3['data2']),'days')>DAYS){logger[_0x69bd('0x11')](_0x69bd('0x1e'),moment()[_0x69bd('0x9')](_0x69bd('0x1c')));isOldTokenSent=![];return _0x3ecb40['update']({'data1':_0x4afe66,'data2':null,'license':null});}}}else{if(_0x114de3[_0x69bd('0x18')]!=_0x4afe66){logger[_0x69bd('0x11')](_0x69bd('0x17'),_0x114de3[_0x69bd('0x18')],_0x4afe66);return _0x3ecb40[_0x69bd('0x14')]({'data1':_0x4afe66,'data2':null,'license':null});}}}return _0x3ecb40;})[_0x69bd('0xd')](function(_0x435444){_0x3ecb40=_0x435444;})[_0x69bd('0xe')](function(_0x3f6820){logger['error'](_0x3f6820[_0x69bd('0x1f')]);})[_0x69bd('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0x69bd('0x21')](),_0x3ecb40);},TIME);});}function defaultLicense(){var _0x33d210=hardware[_0x69bd('0x21')]();if(_0x33d210){return db[_0x69bd('0x22')][_0x69bd('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x33d210}})[_0x69bd('0x24')](function(_0x35b651,_0x3b2987){logger[_0x69bd('0x11')](_0x69bd('0x25'),_0x33d210);manageLicense(_0x33d210,_0x35b651);})[_0x69bd('0xe')](function(_0x29135d){logger[_0x69bd('0x26')](_0x29135d[_0x69bd('0x1f')]);});}}exports[_0x69bd('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index a20f33c..ddf1c11 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 _0x7969=['count','admin','user','telephone','telephones','forEach','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','then','data1','license','data2','split','decryptString','format','%s:%s:%s','parse','machineUuid','gray','deadline','days','grayReason','uuid','changed','disabled','message','User','findAll','role','sequelize','COUNT','col'];(function(_0x22ffbf,_0x16f31e){var _0x360c17=function(_0x40807f){while(--_0x40807f){_0x22ffbf['push'](_0x22ffbf['shift']());}};_0x360c17(++_0x16f31e);}(_0x7969,0x154));var _0x9796=function(_0x20d965,_0x1f9c09){_0x20d965=_0x20d965-0x0;var _0x107b9c=_0x7969[_0x20d965];return _0x107b9c;};'use strict';var util=require(_0x9796('0x0'));var _=require(_0x9796('0x1'));var moment=require(_0x9796('0x2'));var BPromise=require(_0x9796('0x3'));var hardware=require(_0x9796('0x4'));var encryptor=require(_0x9796('0x5'));var db=require(_0x9796('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x9796('0x7'),'machineUuid':hardware[_0x9796('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9796('0x9'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9796('0xa'),'machineUuid':hardware[_0x9796('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x29b225){return new BPromise(function(_0x25dda2,_0x2543be){return db[_0x9796('0xb')]['find'](_['defaults'](_0x29b225,{'raw':!![],'where':{'id':0x1}}))[_0x9796('0xc')](function(_0x58715a){return checkLicense(_0x58715a,null);})['then'](function(_0x391d47){_0x25dda2(_0x391d47);return;})['catch'](function(_0x1ec75e){_0x2543be(_0x1ec75e);});});}function checkLicense(_0x46aeca,_0xad7da3){if(!_0x46aeca){demoLicense['uuid']=_0x46aeca[_0x9796('0xd')];return demoLicense;}try{var _0x5f1eb7=_0xad7da3||_0x46aeca[_0x9796('0xe')];if(_['isEmpty'](_0x5f1eb7)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x497442=_0x46aeca[_0x9796('0xd')];var _0xb4085b=_0x46aeca[_0x9796('0xf')];var _0x9e8478=_0x497442[_0x9796('0x10')]('-')[0x4];var _0x150296=_0x497442['split']('-')[0x0];var _0x3083a0=encryptor[_0x9796('0x11')](_0x5f1eb7,util[_0x9796('0x12')](_0x9796('0x13'),_0x9e8478,_0x497442,_0x150296));var _0x47738d=JSON[_0x9796('0x14')](_0x3083a0);_0x47738d['demo']=![];_0x47738d['uuid']=_0x497442;_0x47738d[_0x9796('0x15')]=hardware[_0x9796('0x8')]();if(_0xb4085b){var _0x4409d1=encryptor['decryptString'](_0xb4085b);_0x47738d[_0x9796('0x16')]=_0x4409d1;_0x47738d[_0x9796('0x17')]=moment(_0x4409d1)['add'](0x7,_0x9796('0x18'))['format']();_0x47738d[_0x9796('0x19')]=_0x47738d[_0x9796('0x1a')]!=_0x47738d[_0x9796('0x15')]?_0x9796('0x1b'):_0x9796('0x1c');}return _0x47738d;}catch(_0x5b8a64){breakingLicense[_0x9796('0x1a')]=_0x46aeca[_0x9796('0xd')];breakingLicense[_0x9796('0x1d')]=_0x5b8a64[_0x9796('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x52a22c,_0x2261d1){getLicense()['then'](function(_0x31ddce){return db[_0x9796('0x1e')][_0x9796('0x1f')]({'attributes':[_0x9796('0x20'),[db[_0x9796('0x21')]['fn'](_0x9796('0x22'),db[_0x9796('0x21')][_0x9796('0x23')](_0x9796('0x20'))),_0x9796('0x24')]],'group':_0x9796('0x20'),'where':{'role':{'$or':[_0x9796('0x25'),_0x9796('0x26'),_0x9796('0x27')]}},'raw':!![]})[_0x9796('0xc')](function(_0x1ac7a2){var _0x4f8981={'user':_0x31ddce['users']||0x0,'telephone':_0x31ddce[_0x9796('0x28')]||0x0};_0x1ac7a2[_0x9796('0x29')](function(_0x721a5e){var _0x16263b=_0x721a5e[_0x9796('0x20')]==='admin'?_0x9796('0x26'):_0x721a5e[_0x9796('0x20')];_0x4f8981[_0x16263b]-=_0x721a5e['count'];if(_0x4f8981[_0x16263b]<0x0)_0x4f8981[_0x16263b]=0x0;});_0x52a22c(_0x4f8981);return;});})[_0x9796('0x2a')](function(_0x52eba0){_0x2261d1(_0x52eba0);});});}function checkUserLimits(_0xd72417){return new BPromise(function(_0x58615f,_0x5d3cef){getLimits()[_0x9796('0xc')](function(_0x566085){var _0x216951=_[_0x9796('0x2b')](_[_0x9796('0x2c')](_0xd72417,_0x9796('0x20')),[_0x9796('0x25'),_0x9796('0x26'),_0x9796('0x27')]);var _0x2ddf71=(_0x216951[_0x9796('0x25')]||0x0)+(_0x216951['user']||0x0);var _0x2284e6=_0x216951[_0x9796('0x27')]||0x0;if(_0x2ddf71>_0x566085[_0x9796('0x26')])return _0x5d3cef(_0x9796('0x2d'));if(_0x2284e6>_0x566085[_0x9796('0x27')])return _0x5d3cef(_0x9796('0x2e'));return _0x58615f();})[_0x9796('0x2a')](function(_0xc2e995){_0x5d3cef(_0xc2e995);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xd5f7=['grayReason','changed','disabled','message','User','role','sequelize','col','count','admin','user','telephone','users','telephones','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','License','find','defaults','then','catch','data1','license','isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','demo','uuid','getUuid','gray','deadline','add','days'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0xd5f7,0xd2));var _0x7d5f=function(_0x3d7446,_0x2260f0){_0x3d7446=_0x3d7446-0x0;var _0x5dd683=_0xd5f7[_0x3d7446];return _0x5dd683;};'use strict';var util=require(_0x7d5f('0x0'));var _=require(_0x7d5f('0x1'));var moment=require(_0x7d5f('0x2'));var BPromise=require('bluebird');var hardware=require(_0x7d5f('0x3'));var encryptor=require(_0x7d5f('0x4'));var db=require(_0x7d5f('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7d5f('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x7d5f('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x7d5f('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xc2ad6f){return new BPromise(function(_0x4b02a7,_0x1170ea){return db[_0x7d5f('0x9')][_0x7d5f('0xa')](_[_0x7d5f('0xb')](_0xc2ad6f,{'raw':!![],'where':{'id':0x1}}))[_0x7d5f('0xc')](function(_0x1678bc){return checkLicense(_0x1678bc,null);})[_0x7d5f('0xc')](function(_0x3581d8){_0x4b02a7(_0x3581d8);return;})[_0x7d5f('0xd')](function(_0x30447d){_0x1170ea(_0x30447d);});});}function checkLicense(_0x2ac41a,_0x22e54e){if(!_0x2ac41a){demoLicense['uuid']=_0x2ac41a[_0x7d5f('0xe')];return demoLicense;}try{var _0x3d2508=_0x22e54e||_0x2ac41a[_0x7d5f('0xf')];if(_[_0x7d5f('0x10')](_0x3d2508)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x5decc3=_0x2ac41a['data1'];var _0x4db34b=_0x2ac41a[_0x7d5f('0x11')];var _0x19afda=_0x5decc3[_0x7d5f('0x12')]('-')[0x4];var _0x159ebf=_0x5decc3[_0x7d5f('0x12')]('-')[0x0];var _0x228f8b=encryptor[_0x7d5f('0x13')](_0x3d2508,util[_0x7d5f('0x14')](_0x7d5f('0x15'),_0x19afda,_0x5decc3,_0x159ebf));var _0xbecd8d=JSON[_0x7d5f('0x16')](_0x228f8b);_0xbecd8d[_0x7d5f('0x17')]=![];_0xbecd8d[_0x7d5f('0x18')]=_0x5decc3;_0xbecd8d['machineUuid']=hardware[_0x7d5f('0x19')]();if(_0x4db34b){var _0x517067=encryptor[_0x7d5f('0x13')](_0x4db34b);_0xbecd8d[_0x7d5f('0x1a')]=_0x517067;_0xbecd8d[_0x7d5f('0x1b')]=moment(_0x517067)[_0x7d5f('0x1c')](0x7,_0x7d5f('0x1d'))[_0x7d5f('0x14')]();_0xbecd8d[_0x7d5f('0x1e')]=_0xbecd8d[_0x7d5f('0x18')]!=_0xbecd8d['machineUuid']?_0x7d5f('0x1f'):_0x7d5f('0x20');}return _0xbecd8d;}catch(_0x1e0ab5){breakingLicense[_0x7d5f('0x18')]=_0x2ac41a[_0x7d5f('0xe')];breakingLicense[_0x7d5f('0x21')]=_0x1e0ab5[_0x7d5f('0x21')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4d9012,_0x111702){getLicense()[_0x7d5f('0xc')](function(_0x40220f){return db[_0x7d5f('0x22')]['findAll']({'attributes':[_0x7d5f('0x23'),[db[_0x7d5f('0x24')]['fn']('COUNT',db[_0x7d5f('0x24')][_0x7d5f('0x25')](_0x7d5f('0x23'))),_0x7d5f('0x26')]],'group':_0x7d5f('0x23'),'where':{'role':{'$or':[_0x7d5f('0x27'),_0x7d5f('0x28'),_0x7d5f('0x29')]}},'raw':!![]})[_0x7d5f('0xc')](function(_0x3cec42){var _0x4aec64={'user':_0x40220f[_0x7d5f('0x2a')]||0x0,'telephone':_0x40220f[_0x7d5f('0x2b')]||0x0};_0x3cec42['forEach'](function(_0x59607b){var _0x213460=_0x59607b[_0x7d5f('0x23')]===_0x7d5f('0x27')?_0x7d5f('0x28'):_0x59607b['role'];_0x4aec64[_0x213460]-=_0x59607b['count'];if(_0x4aec64[_0x213460]<0x0)_0x4aec64[_0x213460]=0x0;});_0x4d9012(_0x4aec64);return;});})[_0x7d5f('0xd')](function(_0x5ac79e){_0x111702(_0x5ac79e);});});}function checkUserLimits(_0x525963){return new BPromise(function(_0x97573d,_0x2c3be5){getLimits()[_0x7d5f('0xc')](function(_0x355ddc){var _0x3c0484=_[_0x7d5f('0x2c')](_[_0x7d5f('0x2d')](_0x525963,_0x7d5f('0x23')),[_0x7d5f('0x27'),_0x7d5f('0x28'),_0x7d5f('0x29')]);var _0x5434ac=(_0x3c0484['admin']||0x0)+(_0x3c0484[_0x7d5f('0x28')]||0x0);var _0x53236c=_0x3c0484[_0x7d5f('0x29')]||0x0;if(_0x5434ac>_0x355ddc[_0x7d5f('0x28')])return _0x2c3be5(_0x7d5f('0x2e'));if(_0x53236c>_0x355ddc[_0x7d5f('0x29')])return _0x2c3be5(_0x7d5f('0x2f'));return _0x97573d();})[_0x7d5f('0xd')](function(_0x2a26f7){_0x2c3be5(_0x2a26f7);});});}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 75c6851..8ac7494 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 _0x57ca=['http://localhost:9000','myappanuglar-secret','secret'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x57ca,0x108));var _0xa57c=function(_0xdccced,_0x215180){_0xdccced=_0xdccced-0x0;var _0x3366ec=_0x57ca[_0xdccced];return _0x3366ec;};'use strict';module['exports']={'DOMAIN':_0xa57c('0x0'),'SESSION_SECRET':_0xa57c('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xa57c('0x2'),'DEBUG':''}; \ No newline at end of file +var _0xb44a=['myappanuglar-secret','secret'];(function(_0x67f65f,_0x541c1a){var _0x124a3e=function(_0x4f4e5e){while(--_0x4f4e5e){_0x67f65f['push'](_0x67f65f['shift']());}};_0x124a3e(++_0x541c1a);}(_0xb44a,0x1c2));var _0xab44=function(_0xc36d01,_0x3bf1a6){_0xc36d01=_0xc36d01-0x0;var _0xecb231=_0xb44a[_0xc36d01];return _0xecb231;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xab44('0x0'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xab44('0x1'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 4bb82b0..065365f 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d90=['exports','../utils/loggers','fileLogger'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x0d90,0x1b7));var _0x00d9=function(_0x298f71,_0x492259){_0x298f71=_0x298f71-0x0;var _0x2d6811=_0x0d90[_0x298f71];return _0x2d6811;};'use strict';var fileLogger=require(_0x00d9('0x0'))[_0x00d9('0x1')];module[_0x00d9('0x2')]=fileLogger; \ No newline at end of file +var _0x8951=['../utils/loggers','fileLogger'];(function(_0x6bf151,_0x435b5c){var _0x3aebd5=function(_0x865c27){while(--_0x865c27){_0x6bf151['push'](_0x6bf151['shift']());}};_0x3aebd5(++_0x435b5c);}(_0x8951,0xb4));var _0x1895=function(_0x507453,_0x7949e9){_0x507453=_0x507453-0x0;var _0x5ea69f=_0x8951[_0x507453];return _0x5ea69f;};'use strict';var fileLogger=require(_0x1895('0x0'))[_0x1895('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 33b44bd..e2b9bb8 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 _0x8cc4=['email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','../../config/environment','resolve','join','root','express','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js'];(function(_0x241799,_0x32be9e){var _0x5f3c66=function(_0x2cf55c){while(--_0x2cf55c){_0x241799['push'](_0x241799['shift']());}};_0x5f3c66(++_0x32be9e);}(_0x8cc4,0x1f4));var _0x48cc=function(_0xa72f73,_0x8058d1){_0xa72f73=_0xa72f73-0x0;var _0x190264=_0x8cc4[_0xa72f73];return _0x190264;};'use strict';var path=require(_0x48cc('0x0'));var cfg=require(_0x48cc('0x1'));var env={'NODE_PATH':path[_0x48cc('0x2')](path[_0x48cc('0x3')](cfg[_0x48cc('0x4')],'legacy-libs'))};var pm2config={'apps':[{'name':_0x48cc('0x5'),'script':path['join'](__dirname,_0x48cc('0x6')),'env':env},{'name':_0x48cc('0x7'),'script':path[_0x48cc('0x3')](__dirname,_0x48cc('0x8')),'env':env},{'name':'agi','script':path[_0x48cc('0x3')](__dirname,_0x48cc('0x9')),'env':env},{'name':_0x48cc('0xa'),'script':path['join'](__dirname,_0x48cc('0xb')),'env':env},{'name':_0x48cc('0xc'),'script':path[_0x48cc('0x3')](__dirname,_0x48cc('0xd')),'env':env},{'name':_0x48cc('0xe'),'script':path['join'](__dirname,_0x48cc('0xf')),'env':env}]};module[_0x48cc('0x10')]=pm2config; \ No newline at end of file +var _0x0f5b=['../../services/xdr/index.js','path','join','root','legacy-libs','express','../../services/express/index.js','../../services/ami/index.js','agi','email','../../services/email/index.js','routing'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0f5b,0x18d));var _0xb0f5=function(_0x815de6,_0x2772bc){_0x815de6=_0x815de6-0x0;var _0x5251d5=_0x0f5b[_0x815de6];return _0x5251d5;};'use strict';var path=require(_0xb0f5('0x0'));var cfg=require('../../config/environment');var env={'NODE_PATH':path['resolve'](path[_0xb0f5('0x1')](cfg[_0xb0f5('0x2')],_0xb0f5('0x3')))};var pm2config={'apps':[{'name':_0xb0f5('0x4'),'script':path[_0xb0f5('0x1')](__dirname,_0xb0f5('0x5')),'env':env},{'name':'ami','script':path[_0xb0f5('0x1')](__dirname,_0xb0f5('0x6')),'env':env},{'name':_0xb0f5('0x7'),'script':path[_0xb0f5('0x1')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0xb0f5('0x8'),'script':path[_0xb0f5('0x1')](__dirname,_0xb0f5('0x9')),'env':env},{'name':_0xb0f5('0xa'),'script':path[_0xb0f5('0x1')](__dirname,'../../services/routing/index.js'),'env':env},{'name':'xdr','script':path[_0xb0f5('0x1')](__dirname,_0xb0f5('0xb')),'env':env}]};module['exports']=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index fdbda6b..53153ee 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 _0xc2af=['pm2','bluebird','./config','connect','start','then','stop','disconnect','restart','list','describe','delete','dump','saved'];(function(_0x2a5a5f,_0x56a0e1){var _0x3bdbc9=function(_0x26a9a6){while(--_0x26a9a6){_0x2a5a5f['push'](_0x2a5a5f['shift']());}};_0x3bdbc9(++_0x56a0e1);}(_0xc2af,0x1b2));var _0xfc2a=function(_0x28387c,_0x3e8de4){_0x28387c=_0x28387c-0x0;var _0x21f67b=_0xc2af[_0x28387c];return _0x21f67b;};'use strict';var pm2=require(_0xfc2a('0x0'));var BPromise=require(_0xfc2a('0x1'));var config=require(_0xfc2a('0x2'));function connect(){return new BPromise(function(_0x558125,_0x219723){return pm2[_0xfc2a('0x3')](function(_0x5f122e){if(_0x5f122e){return _0x219723(_0x5f122e);}return _0x558125('connected');});});};exports[_0xfc2a('0x4')]=function(_0x1b6d58){return connect()[_0xfc2a('0x5')](function(){return new BPromise(function(_0x1f068d,_0x49dc23){return pm2[_0xfc2a('0x4')](_0x1b6d58,function(_0x2a8ca6,_0x591698){if(_0x2a8ca6){return _0x49dc23(_0x2a8ca6);}pm2['disconnect']();return _0x1f068d(_0x591698);});});});};exports[_0xfc2a('0x6')]=function(_0x4548e5){return connect()['then'](function(){return new BPromise(function(_0x5ea70c,_0x369a20){return pm2[_0xfc2a('0x6')](_0x4548e5,function(_0x1e833e,_0x5eb3fe){if(_0x1e833e){return _0x369a20(_0x1e833e);}pm2[_0xfc2a('0x7')]();return _0x5ea70c(_0x5eb3fe);});});});};exports[_0xfc2a('0x8')]=function(_0x5c80cd){return connect()[_0xfc2a('0x5')](function(){return new BPromise(function(_0x1d7058,_0x565eb9){return pm2[_0xfc2a('0x8')](_0x5c80cd,function(_0x4fcc43,_0x52e6c0){if(_0x4fcc43){return _0x565eb9(_0x4fcc43);}pm2[_0xfc2a('0x7')]();return _0x1d7058(_0x52e6c0);});});});};exports[_0xfc2a('0x9')]=function(){return connect()[_0xfc2a('0x5')](function(){return new BPromise(function(_0x3c3cb5,_0x3f9190){return pm2[_0xfc2a('0x9')](function(_0x3f6237,_0x125049){if(_0x3f6237){return _0x3f9190(_0x3f6237);}pm2[_0xfc2a('0x7')]();return _0x3c3cb5(_0x125049);});});});};exports['describe']=function(_0xd72548){return connect()[_0xfc2a('0x5')](function(){return new BPromise(function(_0x40a922,_0x24eaec){return pm2[_0xfc2a('0xa')](_0xd72548,function(_0x4bd86a,_0x495d0e){if(_0x4bd86a){return _0x24eaec(_0x4bd86a);}pm2[_0xfc2a('0x7')]();return _0x40a922(_0x495d0e);});});});};exports[_0xfc2a('0xb')]=function(_0x4ba64c){return connect()[_0xfc2a('0x5')](function(){return new BPromise(function(_0x30d8d8,_0x41ebff){return pm2[_0xfc2a('0xb')](_0x4ba64c,function(_0x30cc02,_0x17a104){if(_0x30cc02){return _0x41ebff(_0x30cc02);}pm2[_0xfc2a('0x7')]();return _0x30d8d8(_0x17a104);});});});};exports['dump']=function(){return connect()[_0xfc2a('0x5')](function(){return new BPromise(function(_0x39b5f4,_0x44f1d7){return pm2[_0xfc2a('0xc')](function(_0x2c43ed){if(_0x2c43ed){return _0x44f1d7(_0x2c43ed);}return _0x39b5f4(_0xfc2a('0xd'));});});});}; \ No newline at end of file +var _0xe528=['then','stop','disconnect','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','start'];(function(_0xbae91,_0xadf94b){var _0x28e594=function(_0x2efcec){while(--_0x2efcec){_0xbae91['push'](_0xbae91['shift']());}};_0x28e594(++_0xadf94b);}(_0xe528,0x167));var _0x8e52=function(_0x3b8b61,_0x1034e1){_0x3b8b61=_0x3b8b61-0x0;var _0x307b04=_0xe528[_0x3b8b61];return _0x307b04;};'use strict';var pm2=require(_0x8e52('0x0'));var BPromise=require(_0x8e52('0x1'));var config=require(_0x8e52('0x2'));function connect(){return new BPromise(function(_0x1be989,_0x591a6e){return pm2[_0x8e52('0x3')](function(_0x3de863){if(_0x3de863){return _0x591a6e(_0x3de863);}return _0x1be989('connected');});});};exports[_0x8e52('0x4')]=function(_0x3321b5){return connect()[_0x8e52('0x5')](function(){return new BPromise(function(_0x33cb8c,_0x414005){return pm2[_0x8e52('0x4')](_0x3321b5,function(_0xeb3b2c,_0x3b3f89){if(_0xeb3b2c){return _0x414005(_0xeb3b2c);}pm2['disconnect']();return _0x33cb8c(_0x3b3f89);});});});};exports['stop']=function(_0x36ae3f){return connect()[_0x8e52('0x5')](function(){return new BPromise(function(_0x1c638e,_0x100ebf){return pm2[_0x8e52('0x6')](_0x36ae3f,function(_0x7c15bd,_0x28357e){if(_0x7c15bd){return _0x100ebf(_0x7c15bd);}pm2[_0x8e52('0x7')]();return _0x1c638e(_0x28357e);});});});};exports[_0x8e52('0x8')]=function(_0x3bcfe4){return connect()['then'](function(){return new BPromise(function(_0x3f38ba,_0x3ea43c){return pm2[_0x8e52('0x8')](_0x3bcfe4,function(_0x5c58fa,_0x48c7a7){if(_0x5c58fa){return _0x3ea43c(_0x5c58fa);}pm2[_0x8e52('0x7')]();return _0x3f38ba(_0x48c7a7);});});});};exports['list']=function(){return connect()[_0x8e52('0x5')](function(){return new BPromise(function(_0x99272c,_0x1b0114){return pm2[_0x8e52('0x9')](function(_0x58ed29,_0x33fb5f){if(_0x58ed29){return _0x1b0114(_0x58ed29);}pm2[_0x8e52('0x7')]();return _0x99272c(_0x33fb5f);});});});};exports[_0x8e52('0xa')]=function(_0x1df449){return connect()[_0x8e52('0x5')](function(){return new BPromise(function(_0xc6d275,_0x55e24d){return pm2[_0x8e52('0xa')](_0x1df449,function(_0x13d775,_0x4a3970){if(_0x13d775){return _0x55e24d(_0x13d775);}pm2[_0x8e52('0x7')]();return _0xc6d275(_0x4a3970);});});});};exports[_0x8e52('0xb')]=function(_0x4b06e6){return connect()[_0x8e52('0x5')](function(){return new BPromise(function(_0x1cc984,_0x3358c0){return pm2[_0x8e52('0xb')](_0x4b06e6,function(_0x55c859,_0x2ecabb){if(_0x55c859){return _0x3358c0(_0x55c859);}pm2['disconnect']();return _0x1cc984(_0x2ecabb);});});});};exports[_0x8e52('0xc')]=function(){return connect()[_0x8e52('0x5')](function(){return new BPromise(function(_0x2e321a,_0x429680){return pm2['dump'](function(_0x1e5f4f){if(_0x1e5f4f){return _0x429680(_0x1e5f4f);}return _0x2e321a(_0x8e52('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index c7beb0a..1171526 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 _0xfa0f=['subtract','minutes','join','update','timeout','format','length','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','inspect','start','ioredis','../../mysqldb','../logger','schedule','redis','defaults','localhost','Setting','find','then','chatTimeout','ChatInteraction','findAll','lastMsgAt'];(function(_0x1bfb48,_0x2de37a){var _0x1f432a=function(_0x5d4b71){while(--_0x5d4b71){_0x1bfb48['push'](_0x1bfb48['shift']());}};_0x1f432a(++_0x2de37a);}(_0xfa0f,0x1ea));var _0xffa0=function(_0x49fe6f,_0x95ef71){_0x49fe6f=_0x49fe6f-0x0;var _0x1d120c=_0xfa0f[_0x49fe6f];return _0x1d120c;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0xffa0('0x0'));var util=require('util');var config=require('../../config/environment');var db=require(_0xffa0('0x1'))['db'];var logger=require(_0xffa0('0x2'))(_0xffa0('0x3'));config[_0xffa0('0x4')]=_[_0xffa0('0x5')](config[_0xffa0('0x4')],{'host':_0xffa0('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xffa0('0x4')]));function closeInteractions(){var _0x15fb43=0x0;var _0x8c1e5c=[];return db[_0xffa0('0x7')][_0xffa0('0x8')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xffa0('0x9')](function(_0x3a2f46){_0x15fb43=_0x3a2f46[_0xffa0('0xa')];if(_0x15fb43){return db[_0xffa0('0xb')][_0xffa0('0xc')]({'raw':!![],'attributes':['id',_0xffa0('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xffa0('0xe')](_0x3a2f46[_0xffa0('0xa')],_0xffa0('0xf'))}}});}else{return[];}})[_0xffa0('0x9')](function(_0x94d8e8){if(_0x94d8e8&&_0x94d8e8['length']){_0x8c1e5c=_['map'](_0x94d8e8||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x8c1e5c[_0xffa0('0x10')]());return db[_0xffa0('0xb')][_0xffa0('0x11')]({'closeReason':'system','disposition':_0xffa0('0x12'),'closed':!![],'closedAt':moment()[_0xffa0('0x13')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x8c1e5c}});}})[_0xffa0('0x9')](function(){if(_0x8c1e5c&&_0x8c1e5c[_0xffa0('0x14')]){logger[_0xffa0('0x15')](_0xffa0('0x16'),_0x8c1e5c[_0xffa0('0x10')]());for(var _0x4dd778=0x0;_0x4dd778<_0x8c1e5c[_0xffa0('0x14')];_0x4dd778++){io['emit'](_0xffa0('0x17'),{'id':_0x8c1e5c[_0x4dd778],'closed':!![]});}}})[_0xffa0('0x18')](function(_0x53add9){logger[_0xffa0('0x19')]('[CHAT]\x20Error\x20closing\x20interactions',_0x53add9?util[_0xffa0('0x1a')](_0x53add9,{'showHidden':![],'depth':null}):'');});}exports[_0xffa0('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xdae0=['find','chatTimeout','ChatInteraction','findAll','lastMsgAt','length','map','info','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','Setting'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xdae0,0xa0));var _0x0dae=function(_0x4df1d0,_0x108ebb){_0x4df1d0=_0x4df1d0-0x0;var _0x314da0=_0xdae0[_0x4df1d0];return _0x314da0;};'use strict';var _=require(_0x0dae('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require('util');var config=require(_0x0dae('0x1'));var db=require(_0x0dae('0x2'))['db'];var logger=require(_0x0dae('0x3'))(_0x0dae('0x4'));config[_0x0dae('0x5')]=_['defaults'](config['redis'],{'host':_0x0dae('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0dae('0x5')]));function closeInteractions(){var _0x30722c=0x0;var _0x3b361d=[];return db[_0x0dae('0x7')][_0x0dae('0x8')]({'raw':!![],'attributes':['id',_0x0dae('0x9')],'where':{'id':0x1}})['then'](function(_0x393b21){_0x30722c=_0x393b21[_0x0dae('0x9')];if(_0x30722c){return db[_0x0dae('0xa')][_0x0dae('0xb')]({'raw':!![],'attributes':['id',_0x0dae('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x393b21[_0x0dae('0x9')],'minutes')}}});}else{return[];}})['then'](function(_0x57f486){if(_0x57f486&&_0x57f486[_0x0dae('0xd')]){_0x3b361d=_[_0x0dae('0xe')](_0x57f486||[],'id');logger[_0x0dae('0xf')]('[CHAT]\x20Interactions\x20to\x20close:',_0x3b361d[_0x0dae('0x10')]());return db[_0x0dae('0xa')][_0x0dae('0x11')]({'closeReason':'system','disposition':_0x0dae('0x12'),'closed':!![],'closedAt':moment()[_0x0dae('0x13')](_0x0dae('0x14'))},{'where':{'id':_0x3b361d}});}})[_0x0dae('0x15')](function(){if(_0x3b361d&&_0x3b361d[_0x0dae('0xd')]){logger[_0x0dae('0xf')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x3b361d[_0x0dae('0x10')]());for(var _0x3239a8=0x0;_0x3239a8<_0x3b361d[_0x0dae('0xd')];_0x3239a8++){io[_0x0dae('0x16')](_0x0dae('0x17'),{'id':_0x3b361d[_0x3239a8],'closed':!![]});}}})[_0x0dae('0x18')](function(_0x37f9f5){logger[_0x0dae('0x19')](_0x0dae('0x1a'),_0x37f9f5?util[_0x0dae('0x1b')](_0x37f9f5,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 5bf5340..3c532e5 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 _0xc4ff=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x42d15b,_0xa1e06){var _0x1b3f8f=function(_0x34e4e9){while(--_0x34e4e9){_0x42d15b['push'](_0x42d15b['shift']());}};_0x1b3f8f(++_0xa1e06);}(_0xc4ff,0x70));var _0xfc4f=function(_0x5dde5b,_0x1c2e75){_0x5dde5b=_0x5dde5b-0x0;var _0x255434=_0xc4ff[_0x5dde5b];return _0x255434;};'use strict';function start(){var _0x21dfc3=require(_0xfc4f('0x0'));return _0x21dfc3[_0xfc4f('0x1')]();}module[_0xfc4f('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xc724=['exports','startAllRefreshIntervals'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc724,0x7b));var _0x4c72=function(_0x1a2a57,_0x3b9526){_0x1a2a57=_0x1a2a57-0x0;var _0xa5177a=_0xc724[_0x1a2a57];return _0xa5177a;};'use strict';function start(){var _0x43f40a=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x43f40a[_0x4c72('0x0')]();}module[_0x4c72('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index a9a10cd..4c96b88 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 _0x72a8=['name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','Sent','message','attachments','text','stringify','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','then','error','error\x20mail','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','Schedule','MailServerOut','CloudProvider','keys','map','keyBy','toString','difference','intersection','length','exists','stop','delete\x20cron','index','my\x20id','run\x20job','cron','active','isBetween','endAt','add','start','deleteJob','stop\x20cron','startAt','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>'];(function(_0x51d006,_0xe4e10){var _0x56bd2d=function(_0x4f2af8){while(--_0x4f2af8){_0x51d006['push'](_0x51d006['shift']());}};_0x56bd2d(++_0xe4e10);}(_0x72a8,0x139));var _0x872a=function(_0x257c35,_0x41dd8c){_0x257c35=_0x257c35-0x0;var _0x6de3e8=_0x72a8[_0x257c35];return _0x6de3e8;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x872a('0x0'));var _=require(_0x872a('0x1'));var moment=require(_0x872a('0x2'));var CronJobManager=require(_0x872a('0x3'));var jayson=require(_0x872a('0x4'));var BPromise=require(_0x872a('0x5'));var logger=require(_0x872a('0x6'))(_0x872a('0x7'));var db=require(_0x872a('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x872a('0x9'));var client=jayson[_0x872a('0xa')][_0x872a('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1ecc51,_0x3f746a){return function(){logger[_0x872a('0xc')](_0x872a('0xd'),_0x1ecc51[_0x872a('0xe')]);var _0x391773=!![];var _0x5598c1=_0x1ecc51[_0x872a('0xf')][_0x872a('0x10')]();var _0x19716c={'account':_0x5598c1,'message':{'from':util[_0x872a('0x11')](_0x872a('0x12'),_0x1ecc51[_0x872a('0xf')][_0x872a('0x13')],_0x1ecc51[_0x872a('0xf')]['email']||_0x1ecc51[_0x872a('0xf')][_0x872a('0x14')][_0x872a('0x15')]),'to':_0x1ecc51['email'],'cc':_0x1ecc51['cc'],'bcc':_0x1ecc51[_0x872a('0x16')],'subject':util[_0x872a('0x11')](_0x872a('0x17'),_0x3f746a[_0x872a('0x13')],_0x1ecc51[_0x872a('0x18')],_0x1ecc51[_0x872a('0x19')])}};var _0x392d3a=path[_0x872a('0x1a')](__dirname,_0x872a('0x1b'));var _0x5d6672=_0x3f746a[_0x872a('0x1c')];var _0x13d649=util[_0x872a('0x11')](_0x872a('0x1d'),path[_0x872a('0x1e')](_0x3f746a[_0x872a('0x1c')],path[_0x872a('0x1f')](_0x3f746a[_0x872a('0x1c')])),_0x872a('0x20'));var _0x3221d5=path[_0x872a('0x1a')](_0x392d3a,_0x5d6672);var _0x5f2453=path[_0x872a('0x1a')](_0x392d3a,_0x13d649);if(fs[_0x872a('0x21')](_0x3221d5)){_0x3f746a['status']=_0x872a('0x22');_0x19716c[_0x872a('0x23')][_0x872a('0x24')]=[{'filename':_0x5d6672,'path':_0x3221d5}];_0x19716c[_0x872a('0x23')][_0x872a('0x25')]=util[_0x872a('0x11')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x872a('0x26')](_0x3f746a,null,0x2));}else if(fs[_0x872a('0x21')](_0x5f2453)){_0x3f746a[_0x872a('0x27')]=_0x872a('0x22');_0x19716c[_0x872a('0x23')][_0x872a('0x24')]=[{'filename':_0x13d649,'path':_0x5f2453}];}else{_0x19716c['message']['text']=_0x872a('0x28');if(!_0x1ecc51[_0x872a('0x29')]){_0x391773=![];logger[_0x872a('0xc')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x391773){return client[_0x872a('0x2a')](_0x872a('0x2b'),_0x19716c)[_0x872a('0x2c')](function(_0x473ded){if(_0x473ded['error']){return logger[_0x872a('0x2d')](_0x872a('0x2e'),JSON[_0x872a('0x26')](_0x473ded));}return logger[_0x872a('0xc')]('email\x20sent');})[_0x872a('0x2f')](function(_0x3a9954){return logger[_0x872a('0x2d')](_0x872a('0x2e'),JSON['stringify'](_0x3a9954));});}};}function handleError(){return function(_0x58b528){return logger[_0x872a('0x2d')](JSON['stringify'](_0x58b528));};}function handleResult(_0x52cc3d){return function(_0x5ca7cd){logger[_0x872a('0xc')](_0x872a('0x30'),JSON[_0x872a('0x26')](_0x5ca7cd));if(_0x52cc3d['MailAccount']&&_0x52cc3d[_0x872a('0xf')][_0x872a('0x14')]&&!_[_0x872a('0x31')](_0x52cc3d[_0x872a('0xe')])){setTimeout(handleSendEmail(_0x52cc3d,_0x5ca7cd),0x3c*0x3e8);}};}function handleJob(_0x11d772){return function(){try{if(_[_0x872a('0x31')](_0x11d772['subtractNumber'])){return logger[_0x872a('0xc')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x872a('0x31')](_0x11d772['subtractUnit'])){return logger[_0x872a('0xc')](_0x872a('0x32'));}var _0x43a65a={'startDate':moment()['subtract'](_0x11d772['subtractNumber'],_0x11d772[_0x872a('0x19')])['format'](_0x872a('0x33')),'endDate':moment()[_0x872a('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x872a('0x34'),'output':_0x11d772['output'],'name':_0x11d772[_0x872a('0x13')]};if(!_[_0x872a('0x31')](_0x11d772[_0x872a('0x35')])){logger[_0x872a('0xc')](_0x872a('0x36'),_0x11d772[_0x872a('0x35')]);return analyticDefaultReportController[_0x872a('0x37')]({'id':_0x11d772['DefaultReportId']},_0x43a65a)['then'](handleResult(_0x11d772))[_0x872a('0x2f')](handleError());}if(!_['isNil'](_0x11d772[_0x872a('0x38')])){logger[_0x872a('0xc')]('exec\x20custom\x20report\x20id:%s',_0x11d772[_0x872a('0x38')]);return analyticCustomReportController[_0x872a('0x37')]({'id':_0x11d772['CustomReportId']},_0x43a65a)[_0x872a('0x2c')](handleResult(_0x11d772))[_0x872a('0x2f')](handleError());}}catch(_0x3838d7){logger[_0x872a('0x2d')](JSON[_0x872a('0x26')](_0x3838d7));}return logger[_0x872a('0xc')](_0x872a('0x39'));};}function getJobs(_0x21f6f5){var _0xde62fa={};if(_0x21f6f5){_0xde62fa['id']=_0x21f6f5;}return db[_0x872a('0x3a')]['findAll']({'where':_0xde62fa,'include':[{'model':db['MailAccount'],'attributes':['id',_0x872a('0x13'),_0x872a('0xe')],'include':[{'model':db[_0x872a('0x3b')],'as':'Smtp','include':[{'model':db[_0x872a('0x3c')],'as':_0x872a('0x3c')}]}]}]})[_0x872a('0x2c')](function(_0x16bf9a){var _0x17eb2d=_[_0x872a('0x3d')](manager['jobs']);var _0x5607cc=_[_0x872a('0x3e')](_0x16bf9a,function(_0x122e76){return _0x122e76['id']['toString']();});var _0x5e9325=_[_0x872a('0x3f')](_0x16bf9a,function(_0x287454){return _0x287454['id'][_0x872a('0x40')]();});var _0x354310=_0x21f6f5?_0x5607cc:_[_0x872a('0x41')](_0x5607cc,_0x17eb2d);var _0x18ff6f=_[_0x872a('0x42')](_0x5607cc,_0x17eb2d);var _0x28401b=_['difference'](_0x17eb2d,_0x5607cc);var _0x31c2e6;var _0xde482f;for(_0x31c2e6=0x0;_0x31c2e6<_0x28401b[_0x872a('0x43')]&&!_0x21f6f5;_0x31c2e6+=0x1){_0xde482f=_0x28401b[_0x31c2e6]['toString']();if(manager[_0x872a('0x44')](_0xde482f)){manager[_0x872a('0x45')](_0xde482f);manager['deleteJob'](_0xde482f);logger[_0x872a('0xc')](_0x872a('0x46'),_0xde482f);}}logger['info']('toRun',JSON[_0x872a('0x26')](_0x354310));for(_0x31c2e6=0x0;_0x31c2e6<_0x354310[_0x872a('0x43')];_0x31c2e6+=0x1){_0xde482f=_0x354310[_0x31c2e6][_0x872a('0x40')]();logger[_0x872a('0xc')](_0x872a('0x47'),_0xde482f);if(_0x21f6f5){logger['info'](_0x872a('0x48'),_0x21f6f5);logger[_0x872a('0xc')](JSON[_0x872a('0x26')](_0x5e9325[_0xde482f]));BPromise['resolve']()[_0x872a('0x2c')](handleJob(_0x5e9325[_0xde482f]));logger['info'](_0x872a('0x49'),_0x5e9325[_0xde482f][_0x872a('0x13')],_0x5e9325[_0xde482f][_0x872a('0x4a')]);}else if(_0x5e9325[_0xde482f]['cron']&&_0x5e9325[_0xde482f][_0x872a('0x4b')]&&moment()[_0x872a('0x4c')](_0x5e9325[_0xde482f]['startAt'],_0x5e9325[_0xde482f][_0x872a('0x4d')])){manager[_0x872a('0x4e')](_0xde482f,_0x5e9325[_0xde482f][_0x872a('0x4a')],handleJob(_0x5e9325[_0xde482f]));manager[_0x872a('0x4f')](_0xde482f);logger[_0x872a('0xc')]('add\x20cron',_0x5e9325[_0xde482f]['name'],_0x5e9325[_0xde482f]['cron']);}else if(manager[_0x872a('0x44')](_0xde482f)){manager[_0x872a('0x45')](_0xde482f);manager[_0x872a('0x50')](_0xde482f);logger[_0x872a('0xc')](_0x872a('0x51'),_0x5e9325[_0xde482f][_0x872a('0x13')],_0x5e9325[_0xde482f][_0x872a('0x4a')]);}}for(_0x31c2e6=0x0,_0xde482f;_0x31c2e6<_0x18ff6f[_0x872a('0x43')]&&!_0x21f6f5;_0x31c2e6+=0x1){_0xde482f=_0x18ff6f[_0x31c2e6][_0x872a('0x40')]();if(manager[_0x872a('0x44')](_0xde482f)){if(_0x5e9325[_0xde482f][_0x872a('0x4a')]&&_0x5e9325[_0xde482f]['active']&&moment()[_0x872a('0x4c')](_0x5e9325[_0xde482f][_0x872a('0x52')],_0x5e9325[_0xde482f][_0x872a('0x4d')])){manager['update'](_0xde482f,_0x5e9325[_0xde482f][_0x872a('0x4a')],handleJob(_0x5e9325[_0xde482f]));logger[_0x872a('0xc')]('update\x20cron',_0x5e9325[_0xde482f][_0x872a('0x13')],_0x5e9325[_0xde482f][_0x872a('0x4a')]);}else{manager[_0x872a('0x45')](_0xde482f);manager['deleteJob'](_0xde482f);logger[_0x872a('0xc')](_0x872a('0x51'),_0x5e9325[_0xde482f]['name'],_0x5e9325[_0xde482f]['cron']);}}}})['catch'](function(_0x61688e){logger[_0x872a('0x2d')](JSON[_0x872a('0x26')](_0x61688e));});}exports['run']=function(_0x2cd13d){return getJobs(_0x2cd13d);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x73ce=['getSmtpOptions','\x22%s\x22\x20<%s>','name','Smtp','user','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','savename','format','%s.%s','basename','extname','zip','existsSync','status','Sent','message','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','request','SendMail','error','error\x20mail','stringify','catch','isNil','subtractNumber','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','then','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','jobs','map','toString','keyBy','difference','intersection','length','exists','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','update','run','start','path','lodash','moment','cron-job-manager','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount'];(function(_0x4767fb,_0x3842f7){var _0x3f9248=function(_0xb57694){while(--_0xb57694){_0x4767fb['push'](_0x4767fb['shift']());}};_0x3f9248(++_0x3842f7);}(_0x73ce,0x98));var _0xe73c=function(_0x5f03c9,_0xc0f24d){_0x5f03c9=_0x5f03c9-0x0;var _0x2fd02d=_0x73ce[_0x5f03c9];return _0x2fd02d;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xe73c('0x0'));var _=require(_0xe73c('0x1'));var moment=require(_0xe73c('0x2'));var CronJobManager=require(_0xe73c('0x3'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xe73c('0x4'))(_0xe73c('0x5'));var db=require(_0xe73c('0x6'))['db'];var analyticCustomReportController=require(_0xe73c('0x7'));var analyticDefaultReportController=require(_0xe73c('0x8'));var client=jayson[_0xe73c('0x9')][_0xe73c('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3086fa,_0x2569fc){return function(){logger['info'](_0xe73c('0xb'),_0x3086fa[_0xe73c('0xc')]);var _0x3e393e=!![];var _0x625dfb=_0x3086fa[_0xe73c('0xd')][_0xe73c('0xe')]();var _0x4cbaf2={'account':_0x625dfb,'message':{'from':util['format'](_0xe73c('0xf'),_0x3086fa[_0xe73c('0xd')][_0xe73c('0x10')],_0x3086fa['MailAccount'][_0xe73c('0xc')]||_0x3086fa[_0xe73c('0xd')][_0xe73c('0x11')][_0xe73c('0x12')]),'to':_0x3086fa['email'],'cc':_0x3086fa['cc'],'bcc':_0x3086fa['bcc'],'subject':util['format'](_0xe73c('0x13'),_0x2569fc[_0xe73c('0x10')],_0x3086fa['subtractNumber'],_0x3086fa[_0xe73c('0x14')])}};var _0x3a6853=path[_0xe73c('0x15')](__dirname,'../../files/reports');var _0x3c784e=_0x2569fc[_0xe73c('0x16')];var _0x4c212b=util[_0xe73c('0x17')](_0xe73c('0x18'),path[_0xe73c('0x19')](_0x2569fc[_0xe73c('0x16')],path[_0xe73c('0x1a')](_0x2569fc['savename'])),_0xe73c('0x1b'));var _0x1c4d8e=path[_0xe73c('0x15')](_0x3a6853,_0x3c784e);var _0x5e73e0=path[_0xe73c('0x15')](_0x3a6853,_0x4c212b);if(fs[_0xe73c('0x1c')](_0x1c4d8e)){_0x2569fc[_0xe73c('0x1d')]=_0xe73c('0x1e');_0x4cbaf2[_0xe73c('0x1f')]['attachments']=[{'filename':_0x3c784e,'path':_0x1c4d8e}];_0x4cbaf2[_0xe73c('0x1f')][_0xe73c('0x20')]=util[_0xe73c('0x17')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x2569fc,null,0x2));}else if(fs[_0xe73c('0x1c')](_0x5e73e0)){_0x2569fc[_0xe73c('0x1d')]='Sent';_0x4cbaf2[_0xe73c('0x1f')]['attachments']=[{'filename':_0x4c212b,'path':_0x5e73e0}];}else{_0x4cbaf2['message'][_0xe73c('0x20')]=_0xe73c('0x21');if(!_0x3086fa[_0xe73c('0x22')]){_0x3e393e=![];logger[_0xe73c('0x23')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x3e393e){return client[_0xe73c('0x24')](_0xe73c('0x25'),_0x4cbaf2)['then'](function(_0x3c782f){if(_0x3c782f[_0xe73c('0x26')]){return logger[_0xe73c('0x26')](_0xe73c('0x27'),JSON[_0xe73c('0x28')](_0x3c782f));}return logger[_0xe73c('0x23')]('email\x20sent');})[_0xe73c('0x29')](function(_0x2b9c09){return logger[_0xe73c('0x26')](_0xe73c('0x27'),JSON[_0xe73c('0x28')](_0x2b9c09));});}};}function handleError(){return function(_0x5b8a1e){return logger['error'](JSON[_0xe73c('0x28')](_0x5b8a1e));};}function handleResult(_0x29ae83){return function(_0x4fc7b9){logger[_0xe73c('0x23')]('data',JSON[_0xe73c('0x28')](_0x4fc7b9));if(_0x29ae83[_0xe73c('0xd')]&&_0x29ae83[_0xe73c('0xd')][_0xe73c('0x11')]&&!_[_0xe73c('0x2a')](_0x29ae83['email'])){setTimeout(handleSendEmail(_0x29ae83,_0x4fc7b9),0x3c*0x3e8);}};}function handleJob(_0x2495b1){return function(){try{if(_['isNil'](_0x2495b1[_0xe73c('0x2b')])){return logger[_0xe73c('0x23')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xe73c('0x2a')](_0x2495b1[_0xe73c('0x14')])){return logger[_0xe73c('0x23')](_0xe73c('0x2c'));}var _0x3b22c9={'startDate':moment()[_0xe73c('0x2d')](_0x2495b1[_0xe73c('0x2b')],_0x2495b1['subtractUnit'])[_0xe73c('0x17')](_0xe73c('0x2e')),'endDate':moment()[_0xe73c('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xe73c('0x2f'),'output':_0x2495b1[_0xe73c('0x30')],'name':_0x2495b1[_0xe73c('0x10')]};if(!_[_0xe73c('0x2a')](_0x2495b1[_0xe73c('0x31')])){logger[_0xe73c('0x23')](_0xe73c('0x32'),_0x2495b1[_0xe73c('0x31')]);return analyticDefaultReportController['runReport']({'id':_0x2495b1[_0xe73c('0x31')]},_0x3b22c9)[_0xe73c('0x33')](handleResult(_0x2495b1))['catch'](handleError());}if(!_[_0xe73c('0x2a')](_0x2495b1[_0xe73c('0x34')])){logger[_0xe73c('0x23')](_0xe73c('0x35'),_0x2495b1[_0xe73c('0x34')]);return analyticCustomReportController[_0xe73c('0x36')]({'id':_0x2495b1[_0xe73c('0x34')]},_0x3b22c9)[_0xe73c('0x33')](handleResult(_0x2495b1))[_0xe73c('0x29')](handleError());}}catch(_0x249b37){logger['error'](JSON[_0xe73c('0x28')](_0x249b37));}return logger[_0xe73c('0x23')](_0xe73c('0x37'));};}function getJobs(_0x232326){var _0x2b0ad0={};if(_0x232326){_0x2b0ad0['id']=_0x232326;}return db[_0xe73c('0x38')][_0xe73c('0x39')]({'where':_0x2b0ad0,'include':[{'model':db['MailAccount'],'attributes':['id',_0xe73c('0x10'),_0xe73c('0xc')],'include':[{'model':db[_0xe73c('0x3a')],'as':_0xe73c('0x11'),'include':[{'model':db[_0xe73c('0x3b')],'as':'CloudProvider'}]}]}]})['then'](function(_0x18f67b){var _0x41c40f=_['keys'](manager[_0xe73c('0x3c')]);var _0x318eee=_[_0xe73c('0x3d')](_0x18f67b,function(_0x3c61e2){return _0x3c61e2['id'][_0xe73c('0x3e')]();});var _0x30cab6=_[_0xe73c('0x3f')](_0x18f67b,function(_0x5d8497){return _0x5d8497['id'][_0xe73c('0x3e')]();});var _0x18ad81=_0x232326?_0x318eee:_[_0xe73c('0x40')](_0x318eee,_0x41c40f);var _0x427b55=_[_0xe73c('0x41')](_0x318eee,_0x41c40f);var _0x2fd55c=_['difference'](_0x41c40f,_0x318eee);var _0x486b61;var _0x11463d;for(_0x486b61=0x0;_0x486b61<_0x2fd55c[_0xe73c('0x42')]&&!_0x232326;_0x486b61+=0x1){_0x11463d=_0x2fd55c[_0x486b61][_0xe73c('0x3e')]();if(manager[_0xe73c('0x43')](_0x11463d)){manager['stop'](_0x11463d);manager[_0xe73c('0x44')](_0x11463d);logger[_0xe73c('0x23')](_0xe73c('0x45'),_0x11463d);}}logger[_0xe73c('0x23')](_0xe73c('0x46'),JSON[_0xe73c('0x28')](_0x18ad81));for(_0x486b61=0x0;_0x486b61<_0x18ad81[_0xe73c('0x42')];_0x486b61+=0x1){_0x11463d=_0x18ad81[_0x486b61][_0xe73c('0x3e')]();logger[_0xe73c('0x23')](_0xe73c('0x47'),_0x11463d);if(_0x232326){logger['info'](_0xe73c('0x48'),_0x232326);logger[_0xe73c('0x23')](JSON[_0xe73c('0x28')](_0x30cab6[_0x11463d]));BPromise[_0xe73c('0x49')]()[_0xe73c('0x33')](handleJob(_0x30cab6[_0x11463d]));logger[_0xe73c('0x23')]('run\x20job',_0x30cab6[_0x11463d][_0xe73c('0x10')],_0x30cab6[_0x11463d]['cron']);}else if(_0x30cab6[_0x11463d][_0xe73c('0x4a')]&&_0x30cab6[_0x11463d][_0xe73c('0x4b')]&&moment()[_0xe73c('0x4c')](_0x30cab6[_0x11463d][_0xe73c('0x4d')],_0x30cab6[_0x11463d][_0xe73c('0x4e')])){manager[_0xe73c('0x4f')](_0x11463d,_0x30cab6[_0x11463d][_0xe73c('0x4a')],handleJob(_0x30cab6[_0x11463d]));manager['start'](_0x11463d);logger[_0xe73c('0x23')]('add\x20cron',_0x30cab6[_0x11463d][_0xe73c('0x10')],_0x30cab6[_0x11463d][_0xe73c('0x4a')]);}else if(manager[_0xe73c('0x43')](_0x11463d)){manager['stop'](_0x11463d);manager[_0xe73c('0x44')](_0x11463d);logger[_0xe73c('0x23')]('stop\x20cron',_0x30cab6[_0x11463d][_0xe73c('0x10')],_0x30cab6[_0x11463d][_0xe73c('0x4a')]);}}for(_0x486b61=0x0,_0x11463d;_0x486b61<_0x427b55[_0xe73c('0x42')]&&!_0x232326;_0x486b61+=0x1){_0x11463d=_0x427b55[_0x486b61][_0xe73c('0x3e')]();if(manager[_0xe73c('0x43')](_0x11463d)){if(_0x30cab6[_0x11463d][_0xe73c('0x4a')]&&_0x30cab6[_0x11463d][_0xe73c('0x4b')]&&moment()['isBetween'](_0x30cab6[_0x11463d][_0xe73c('0x4d')],_0x30cab6[_0x11463d][_0xe73c('0x4e')])){manager[_0xe73c('0x50')](_0x11463d,_0x30cab6[_0x11463d]['cron'],handleJob(_0x30cab6[_0x11463d]));logger[_0xe73c('0x23')]('update\x20cron',_0x30cab6[_0x11463d]['name'],_0x30cab6[_0x11463d][_0xe73c('0x4a')]);}else{manager['stop'](_0x11463d);manager[_0xe73c('0x44')](_0x11463d);logger[_0xe73c('0x23')]('stop\x20cron',_0x30cab6[_0x11463d][_0xe73c('0x10')],_0x30cab6[_0x11463d]['cron']);}}}})[_0xe73c('0x29')](function(_0x222c8a){logger[_0xe73c('0x26')](JSON[_0xe73c('0x28')](_0x222c8a));});}exports[_0xe73c('0x51')]=function(_0x47c516){return getJobs(_0x47c516);};exports[_0xe73c('0x52')]=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 15826d5..c961c73 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 _0x9780=['SentimentScore','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Transcribe\x20not\x20configured','forEach','push','all','catch','error','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','Sentiment'];(function(_0x570019,_0x32ce3a){var _0x20d3bf=function(_0x226b15){while(--_0x226b15){_0x570019['push'](_0x570019['shift']());}};_0x20d3bf(++_0x32ce3a);}(_0x9780,0x1d4));var _0x0978=function(_0x2f91a6,_0x4e44ff){_0x2f91a6=_0x2f91a6-0x0;var _0x324cb5=_0x9780[_0x2f91a6];return _0x324cb5;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require(_0x0978('0x0'));var util=require(_0x0978('0x1'));var BPromise=require(_0x0978('0x2'));var db=require(_0x0978('0x3'))['db'];var logger=require(_0x0978('0x4'))(_0x0978('0x5'));function getTranscriptionJob(_0x173398,_0x1e1969,_0x7acd8f,_0x35b86e){return new Promise(function(_0x21b165,_0x5bb746){var _0x422038=new AWS[(_0x0978('0x6'))]({'accessKeyId':_0x1e1969,'secretAccessKey':_0x173398,'region':_0x7acd8f});_0x422038[_0x0978('0x7')]({'TranscriptionJobName':_0x35b86e},function(_0xefd03b,_0x34fe92){if(_0xefd03b){return _0x5bb746(_0xefd03b);}else{return _0x21b165(_0x34fe92);}});});}function sentiment(_0x1883a7,_0x2aa5ff,_0x34081e,_0x3a0754,_0x16b60f){return new Promise(function(_0x235bb1,_0x55e975){var _0x1a94fd=new AWS['Comprehend']({'accessKeyId':_0x2aa5ff,'secretAccessKey':_0x1883a7,'region':_0x34081e});_0x1a94fd[_0x0978('0x8')]({'Text':_0x3a0754,'LanguageCode':_0x16b60f[_0x0978('0x9')](0x0,0x2)},function(_0x2579db,_0x21105f){if(_0x2579db){return _0x55e975(_0x2579db);}else{return _0x235bb1(_0x21105f);}});});}function checkTranscribeJob(_0x50e2d2,_0x3db101,_0x4cb5f5){var _0x3cc5e6;return new BPromise(function(_0x3ec1a8,_0x12dba5){logger[_0x0978('0xa')](util[_0x0978('0xb')](_0x0978('0xc'),_0x50e2d2['id'],_0x50e2d2[_0x0978('0xd')]));return getTranscriptionJob(_0x4cb5f5[_0x0978('0xe')],_0x4cb5f5['data2'],_0x3db101[_0x0978('0xf')],_0x50e2d2[_0x0978('0xd')])[_0x0978('0x10')](function(_0x20e9ab){logger[_0x0978('0xa')](util[_0x0978('0xb')](_0x0978('0x11'),_0x50e2d2['id'],_0x50e2d2[_0x0978('0xd')],_0x20e9ab[_0x0978('0x12')]['TranscriptionJobStatus']));if(!_0x50e2d2[_0x0978('0x13')]){switch(_0x20e9ab[_0x0978('0x12')][_0x0978('0x14')]){case _0x0978('0x15'):var _0x3d7e83={'transcribeStatus':_0x20e9ab[_0x0978('0x12')][_0x0978('0x14')],'fileUri':_0x20e9ab[_0x0978('0x12')][_0x0978('0x16')]['TranscriptFileUri']};logger[_0x0978('0xa')](util[_0x0978('0xb')](_0x0978('0x17'),_0x50e2d2['id']));return rp({'uri':_0x20e9ab['TranscriptionJob'][_0x0978('0x16')][_0x0978('0x18')],'json':!![]})[_0x0978('0x10')](function(_0x5b6558){logger[_0x0978('0xa')](util['format'](_0x0978('0x19'),_0x50e2d2['id']));if(_0x5b6558&&_0x5b6558['results']&&_0x5b6558[_0x0978('0x1a')]['transcripts']&&_0x5b6558[_0x0978('0x1a')]['transcripts'][_0x0978('0x1b')]){_0x3d7e83['fileText']='';for(var _0x584da0=0x0;_0x584da0<_0x5b6558[_0x0978('0x1a')][_0x0978('0x1c')][_0x0978('0x1b')];_0x584da0++){_0x3d7e83[_0x0978('0x13')]+=_0x5b6558[_0x0978('0x1a')][_0x0978('0x1c')][_0x584da0][_0x0978('0x1d')]+'';}}return _0x50e2d2[_0x0978('0x1e')](_0x3d7e83);})[_0x0978('0x10')](function(){logger[_0x0978('0xa')](util[_0x0978('0xb')](_0x0978('0x1f'),_0x50e2d2['id']));if(!_0x50e2d2[_0x0978('0x20')]){throw new db[(_0x0978('0x21'))][(_0x0978('0x22'))](_0x0978('0x23'));}if(!_0x3db101[_0x0978('0x24')]||!_0x3db101[_0x0978('0x25')]||!_0x3db101[_0x0978('0x26')]||!_0x3db101['language']||!_0x3db101[_0x0978('0x27')]){throw new db['Sequelize'][(_0x0978('0x22'))](_0x0978('0x28'));}if(!_0x3d7e83[_0x0978('0x13')]){throw new Error(_0x0978('0x29'));}if(_0x3db101[_0x0978('0x25')]===_0x4cb5f5['id']){return _0x4cb5f5;}else{return db[_0x0978('0x2a')][_0x0978('0x2b')]({'where':{'id':_settings[_0x0978('0x25')]}});}})[_0x0978('0x10')](function(_0x188fd7){if(!_0x188fd7){throw new db[(_0x0978('0x21'))][(_0x0978('0x22'))](_0x0978('0x2c'));}if(!_0x188fd7[_0x0978('0xe')]||!_0x188fd7[_0x0978('0x2d')]){throw new db[(_0x0978('0x21'))][(_0x0978('0x22'))](_0x0978('0x2e'));}_0x3cc5e6=_0x188fd7;logger['info'](util[_0x0978('0xb')](_0x0978('0x2f'),_0x50e2d2['id']));return sentiment(_0x3cc5e6[_0x0978('0xe')],_0x3cc5e6[_0x0978('0x2d')],_0x3db101[_0x0978('0x26')],_0x3d7e83['fileText'],_0x3db101[_0x0978('0x30')]);})[_0x0978('0x10')](function(_0x41d44d){logger[_0x0978('0xa')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x50e2d2['id']));return _0x50e2d2[_0x0978('0x1e')]({'sentiment':_0x41d44d[_0x0978('0x31')],'sPositive':_0x41d44d[_0x0978('0x32')]['Positive'],'sNegative':_0x41d44d[_0x0978('0x32')][_0x0978('0x33')],'sMixed':_0x41d44d[_0x0978('0x32')][_0x0978('0x34')],'sNeutral':_0x41d44d['SentimentScore'][_0x0978('0x35')]});})['then'](function(){logger[_0x0978('0xa')](util[_0x0978('0xb')](_0x0978('0x1f'),_0x50e2d2['id']));_0x3ec1a8();});case _0x0978('0x36'):return _0x50e2d2[_0x0978('0x1e')]({'transcribeStatus':_0x0978('0x36'),'failureReason':_0x20e9ab[_0x0978('0x12')]['FailureReason']})[_0x0978('0x10')](function(){logger[_0x0978('0xa')](util[_0x0978('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x50e2d2['id']));_0x3ec1a8();});default:logger[_0x0978('0xa')](util[_0x0978('0xb')](_0x0978('0x37'),_0x50e2d2['id']));break;}}else{return BPromise[_0x0978('0x38')]()['then'](function(){if(!_0x50e2d2['tempSentiment']){throw new db[(_0x0978('0x21'))]['ValidationError'](_0x0978('0x23'));}if(!_0x3db101[_0x0978('0x24')]||!_0x3db101[_0x0978('0x25')]||!_0x3db101[_0x0978('0x26')]||!_0x3db101[_0x0978('0x30')]||!_0x3db101[_0x0978('0x27')]){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x50e2d2[_0x0978('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0x3db101[_0x0978('0x25')]===_0x4cb5f5['id']){return _0x4cb5f5;}else{return db['CloudProvider'][_0x0978('0x2b')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x0978('0x10')](function(_0x534d07){if(!_0x534d07){throw new db[(_0x0978('0x21'))][(_0x0978('0x22'))](_0x0978('0x2c'));}if(!_0x534d07['data1']||!_0x534d07['data2']){throw new db['Sequelize'][(_0x0978('0x22'))](_0x0978('0x2e'));}_0x3cc5e6=_0x534d07;logger[_0x0978('0xa')](util['format'](_0x0978('0x2f'),_0x50e2d2['id']));return sentiment(_0x3cc5e6[_0x0978('0xe')],_0x3cc5e6[_0x0978('0x2d')],_0x3db101[_0x0978('0x26')],_0x50e2d2[_0x0978('0x13')],_0x3db101[_0x0978('0x30')]);})['then'](function(_0x334034){logger[_0x0978('0xa')](util[_0x0978('0xb')](_0x0978('0x39'),_0x50e2d2['id']));return _0x50e2d2[_0x0978('0x1e')]({'sentiment':_0x334034['Sentiment'],'sPositive':_0x334034[_0x0978('0x32')][_0x0978('0x3a')],'sNegative':_0x334034['SentimentScore'][_0x0978('0x33')],'sMixed':_0x334034[_0x0978('0x32')][_0x0978('0x34')],'sNeutral':_0x334034[_0x0978('0x32')]['Neutral'],'transcribeStatus':_0x0978('0x15')});})[_0x0978('0x10')](function(){logger[_0x0978('0xa')](util['format'](_0x0978('0x1f'),_0x50e2d2['id']));_0x3ec1a8();});}})['catch'](function(_0x2ad97b){if(_0x2ad97b){if(!_0x2ad97b[_0x0978('0x3b')]||_0x2ad97b[_0x0978('0x3b')]!==_0x0978('0x3c')){logger['error'](util['format'](_0x0978('0x3d'),_0x50e2d2['id']),util[_0x0978('0x3e')](_0x2ad97b,{'showHidden':![],'depth':null}));}}_0x3ec1a8();});});}function checkTranscribe(){var _0x466cb6;var _0x8922c6;var _0xaac741;return db[_0x0978('0x3f')][_0x0978('0x40')]({'where':{'transcribeStatus':_0x0978('0x41')}})[_0x0978('0x10')](function(_0x15b5a3){if(!_0x15b5a3||!_0x15b5a3[_0x0978('0x1b')]){throw new db['Sequelize'][(_0x0978('0x22'))](_0x0978('0x42'));}_0x466cb6=_0x15b5a3;return db[_0x0978('0x43')]['findOne']({'where':{'id':0x1}});})[_0x0978('0x10')](function(_0x3c9605){if(!_0x3c9605){throw new db['Sequelize']['ValidationError']('Settings\x20not\x20available');}_0x8922c6=_0x3c9605;if(!_0x8922c6[_0x0978('0x5')]||!_0x8922c6['transcribeAccountId']||!_0x8922c6[_0x0978('0xf')]||!_0x8922c6[_0x0978('0x30')]||!_0x8922c6[_0x0978('0x27')]){throw new db[(_0x0978('0x21'))][(_0x0978('0x22'))](_0x0978('0x44'));}return db['CloudProvider'][_0x0978('0x2b')]({'where':{'id':_0x8922c6['transcribeAccountId']}});})[_0x0978('0x10')](function(_0x38574d){if(!_0x38574d){throw new db['Sequelize'][(_0x0978('0x22'))](_0x0978('0x2c'));}if(!_0x38574d['data1']||!_0x38574d[_0x0978('0x2d')]){throw new db['Sequelize'][(_0x0978('0x22'))](_0x0978('0x2e'));}_0xaac741=_0x38574d;var _0x20f0c2=[];_0x466cb6[_0x0978('0x45')](function(_0x5cb364){_0x20f0c2[_0x0978('0x46')](checkTranscribeJob(_0x5cb364,_0x8922c6,_0xaac741));});return BPromise[_0x0978('0x47')](_0x20f0c2);})[_0x0978('0x48')](function(_0x27bdb5){if(_0x27bdb5){if(!_0x27bdb5[_0x0978('0x3b')]||_0x27bdb5['name']!==_0x0978('0x3c')){logger[_0x0978('0x49')](util[_0x0978('0x3e')](_0x27bdb5,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xc893=['findOne','Negative','Neutral','name','SequelizeValidationError','error','inspect','VoiceRecording','Setting','transcribeAccountId','bucket','Cloud\x20Provider\x20not\x20configured','all','catch','aws-sdk','request-promise','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','fileText','TranscriptionJob','TranscriptionJobStatus','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','resolve','tempSentiment','sentiment'];(function(_0xeaa3bd,_0x166691){var _0x2e1174=function(_0x310580){while(--_0x310580){_0xeaa3bd['push'](_0xeaa3bd['shift']());}};_0x2e1174(++_0x166691);}(_0xc893,0x194));var _0x3c89=function(_0x2fda09,_0x1518d5){_0x2fda09=_0x2fda09-0x0;var _0x371576=_0xc893[_0x2fda09];return _0x371576;};var _=require('lodash');var AWS=require(_0x3c89('0x0'));var rp=require(_0x3c89('0x1'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x3c89('0x2'))['db'];var logger=require(_0x3c89('0x3'))(_0x3c89('0x4'));function getTranscriptionJob(_0xedc679,_0x144af5,_0x120117,_0x1629c8){return new Promise(function(_0x5f2803,_0x2e156d){var _0x1a0ec4=new AWS[(_0x3c89('0x5'))]({'accessKeyId':_0x144af5,'secretAccessKey':_0xedc679,'region':_0x120117});_0x1a0ec4[_0x3c89('0x6')]({'TranscriptionJobName':_0x1629c8},function(_0x524125,_0x251b0c){if(_0x524125){return _0x2e156d(_0x524125);}else{return _0x5f2803(_0x251b0c);}});});}function sentiment(_0x5d09d7,_0x4ffa29,_0x3cfe79,_0x4b8ce9,_0x2c026e){return new Promise(function(_0x161ed1,_0x53ed5c){var _0x182415=new AWS[(_0x3c89('0x7'))]({'accessKeyId':_0x4ffa29,'secretAccessKey':_0x5d09d7,'region':_0x3cfe79});_0x182415[_0x3c89('0x8')]({'Text':_0x4b8ce9,'LanguageCode':_0x2c026e[_0x3c89('0x9')](0x0,0x2)},function(_0xd06b18,_0x3c7c6a){if(_0xd06b18){return _0x53ed5c(_0xd06b18);}else{return _0x161ed1(_0x3c7c6a);}});});}function checkTranscribeJob(_0x3a56df,_0x3bfe2b,_0xda4e85){var _0x13d423;return new BPromise(function(_0x1a9c0b,_0x1e486d){logger[_0x3c89('0xa')](util[_0x3c89('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x3a56df['id'],_0x3a56df[_0x3c89('0xc')]));return getTranscriptionJob(_0xda4e85[_0x3c89('0xd')],_0xda4e85[_0x3c89('0xe')],_0x3bfe2b[_0x3c89('0xf')],_0x3a56df[_0x3c89('0xc')])[_0x3c89('0x10')](function(_0xeffc20){logger[_0x3c89('0xa')](util[_0x3c89('0xb')](_0x3c89('0x11'),_0x3a56df['id'],_0x3a56df[_0x3c89('0xc')],_0xeffc20['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x3a56df[_0x3c89('0x12')]){switch(_0xeffc20[_0x3c89('0x13')]['TranscriptionJobStatus']){case'COMPLETED':var _0x425d5c={'transcribeStatus':_0xeffc20[_0x3c89('0x13')][_0x3c89('0x14')],'fileUri':_0xeffc20[_0x3c89('0x13')]['Transcript'][_0x3c89('0x15')]};logger[_0x3c89('0xa')](util[_0x3c89('0xb')](_0x3c89('0x16'),_0x3a56df['id']));return rp({'uri':_0xeffc20[_0x3c89('0x13')][_0x3c89('0x17')][_0x3c89('0x15')],'json':!![]})[_0x3c89('0x10')](function(_0x247732){logger[_0x3c89('0xa')](util[_0x3c89('0xb')](_0x3c89('0x18'),_0x3a56df['id']));if(_0x247732&&_0x247732[_0x3c89('0x19')]&&_0x247732[_0x3c89('0x19')][_0x3c89('0x1a')]&&_0x247732[_0x3c89('0x19')][_0x3c89('0x1a')][_0x3c89('0x1b')]){_0x425d5c[_0x3c89('0x12')]='';for(var _0x462552=0x0;_0x462552<_0x247732['results'][_0x3c89('0x1a')]['length'];_0x462552++){_0x425d5c['fileText']+=_0x247732['results'][_0x3c89('0x1a')][_0x462552][_0x3c89('0x1c')]+'';}}return _0x3a56df[_0x3c89('0x1d')](_0x425d5c);})['then'](function(){logger[_0x3c89('0xa')](util[_0x3c89('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3a56df['id']));if(!_0x3a56df['tempSentiment']){throw new db[(_0x3c89('0x1e'))][(_0x3c89('0x1f'))](_0x3c89('0x20'));}if(!_0x3bfe2b['sentiment']||!_0x3bfe2b['sentimentAccountId']||!_0x3bfe2b[_0x3c89('0x21')]||!_0x3bfe2b[_0x3c89('0x22')]||!_0x3bfe2b['bucket']){throw new db[(_0x3c89('0x1e'))][(_0x3c89('0x1f'))](_0x3c89('0x23'));}if(!_0x425d5c[_0x3c89('0x12')]){throw new Error(_0x3c89('0x24'));}if(_0x3bfe2b[_0x3c89('0x25')]===_0xda4e85['id']){return _0xda4e85;}else{return db[_0x3c89('0x26')]['findOne']({'where':{'id':_settings[_0x3c89('0x25')]}});}})[_0x3c89('0x10')](function(_0x3fcb76){if(!_0x3fcb76){throw new db[(_0x3c89('0x1e'))]['ValidationError'](_0x3c89('0x27'));}if(!_0x3fcb76['data1']||!_0x3fcb76[_0x3c89('0xe')]){throw new db[(_0x3c89('0x1e'))][(_0x3c89('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x13d423=_0x3fcb76;logger[_0x3c89('0xa')](util['format'](_0x3c89('0x28'),_0x3a56df['id']));return sentiment(_0x13d423[_0x3c89('0xd')],_0x13d423['data2'],_0x3bfe2b[_0x3c89('0x21')],_0x425d5c[_0x3c89('0x12')],_0x3bfe2b[_0x3c89('0x22')]);})[_0x3c89('0x10')](function(_0x151072){logger[_0x3c89('0xa')](util['format'](_0x3c89('0x29'),_0x3a56df['id']));return _0x3a56df[_0x3c89('0x1d')]({'sentiment':_0x151072[_0x3c89('0x2a')],'sPositive':_0x151072[_0x3c89('0x2b')][_0x3c89('0x2c')],'sNegative':_0x151072[_0x3c89('0x2b')]['Negative'],'sMixed':_0x151072[_0x3c89('0x2b')][_0x3c89('0x2d')],'sNeutral':_0x151072[_0x3c89('0x2b')]['Neutral']});})[_0x3c89('0x10')](function(){logger[_0x3c89('0xa')](util[_0x3c89('0xb')](_0x3c89('0x2e'),_0x3a56df['id']));_0x1a9c0b();});case _0x3c89('0x2f'):return _0x3a56df[_0x3c89('0x1d')]({'transcribeStatus':_0x3c89('0x2f'),'failureReason':_0xeffc20[_0x3c89('0x13')]['FailureReason']})['then'](function(){logger[_0x3c89('0xa')](util[_0x3c89('0xb')](_0x3c89('0x2e'),_0x3a56df['id']));_0x1a9c0b();});default:logger['info'](util[_0x3c89('0xb')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x3a56df['id']));break;}}else{return BPromise[_0x3c89('0x30')]()[_0x3c89('0x10')](function(){if(!_0x3a56df[_0x3c89('0x31')]){throw new db[(_0x3c89('0x1e'))]['ValidationError'](_0x3c89('0x20'));}if(!_0x3bfe2b[_0x3c89('0x32')]||!_0x3bfe2b['sentimentAccountId']||!_0x3bfe2b['sentimentRegion']||!_0x3bfe2b['language']||!_0x3bfe2b['bucket']){throw new db['Sequelize'][(_0x3c89('0x1f'))](_0x3c89('0x23'));}if(!_0x3a56df[_0x3c89('0x12')]){throw new Error(_0x3c89('0x24'));}if(_0x3bfe2b[_0x3c89('0x25')]===_0xda4e85['id']){return _0xda4e85;}else{return db[_0x3c89('0x26')][_0x3c89('0x33')]({'where':{'id':_settings[_0x3c89('0x25')]}});}})[_0x3c89('0x10')](function(_0x5ee1da){if(!_0x5ee1da){throw new db[(_0x3c89('0x1e'))][(_0x3c89('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5ee1da[_0x3c89('0xd')]||!_0x5ee1da[_0x3c89('0xe')]){throw new db['Sequelize'][(_0x3c89('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x13d423=_0x5ee1da;logger[_0x3c89('0xa')](util['format'](_0x3c89('0x28'),_0x3a56df['id']));return sentiment(_0x13d423[_0x3c89('0xd')],_0x13d423[_0x3c89('0xe')],_0x3bfe2b[_0x3c89('0x21')],_0x3a56df['fileText'],_0x3bfe2b[_0x3c89('0x22')]);})[_0x3c89('0x10')](function(_0x2f1097){logger['info'](util['format'](_0x3c89('0x29'),_0x3a56df['id']));return _0x3a56df['update']({'sentiment':_0x2f1097['Sentiment'],'sPositive':_0x2f1097[_0x3c89('0x2b')]['Positive'],'sNegative':_0x2f1097[_0x3c89('0x2b')][_0x3c89('0x34')],'sMixed':_0x2f1097[_0x3c89('0x2b')][_0x3c89('0x2d')],'sNeutral':_0x2f1097['SentimentScore'][_0x3c89('0x35')],'transcribeStatus':'COMPLETED'});})[_0x3c89('0x10')](function(){logger[_0x3c89('0xa')](util[_0x3c89('0xb')](_0x3c89('0x2e'),_0x3a56df['id']));_0x1a9c0b();});}})['catch'](function(_0x3c4548){if(_0x3c4548){if(!_0x3c4548[_0x3c89('0x36')]||_0x3c4548[_0x3c89('0x36')]!==_0x3c89('0x37')){logger[_0x3c89('0x38')](util[_0x3c89('0xb')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x3a56df['id']),util[_0x3c89('0x39')](_0x3c4548,{'showHidden':![],'depth':null}));}}_0x1a9c0b();});});}function checkTranscribe(){var _0x54e1a7;var _0x33bd3c;var _0x598817;return db[_0x3c89('0x3a')]['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x3c89('0x10')](function(_0x49d356){if(!_0x49d356||!_0x49d356[_0x3c89('0x1b')]){throw new db[(_0x3c89('0x1e'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x54e1a7=_0x49d356;return db[_0x3c89('0x3b')][_0x3c89('0x33')]({'where':{'id':0x1}});})[_0x3c89('0x10')](function(_0x39cf2b){if(!_0x39cf2b){throw new db[(_0x3c89('0x1e'))][(_0x3c89('0x1f'))]('Settings\x20not\x20available');}_0x33bd3c=_0x39cf2b;if(!_0x33bd3c['transcribe']||!_0x33bd3c[_0x3c89('0x3c')]||!_0x33bd3c[_0x3c89('0xf')]||!_0x33bd3c[_0x3c89('0x22')]||!_0x33bd3c[_0x3c89('0x3d')]){throw new db[(_0x3c89('0x1e'))]['ValidationError']('Transcribe\x20not\x20configured');}return db['CloudProvider'][_0x3c89('0x33')]({'where':{'id':_0x33bd3c[_0x3c89('0x3c')]}});})[_0x3c89('0x10')](function(_0x49ec7e){if(!_0x49ec7e){throw new db[(_0x3c89('0x1e'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x49ec7e[_0x3c89('0xd')]||!_0x49ec7e['data2']){throw new db[(_0x3c89('0x1e'))][(_0x3c89('0x1f'))](_0x3c89('0x3e'));}_0x598817=_0x49ec7e;var _0x46d61b=[];_0x54e1a7['forEach'](function(_0x1c2caa){_0x46d61b['push'](checkTranscribeJob(_0x1c2caa,_0x33bd3c,_0x598817));});return BPromise[_0x3c89('0x3f')](_0x46d61b);})[_0x3c89('0x40')](function(_0x4388ca){if(_0x4388ca){if(!_0x4388ca[_0x3c89('0x36')]||_0x4388ca['name']!==_0x3c89('0x37')){logger['error'](util['inspect'](_0x4388ca,{'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 8fea52f..f97a39b 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 _0x7241=['socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','moment','ioredis','util','../../mysqldb','../logger','redis','defaults','localhost'];(function(_0x25078f,_0x4b839a){var _0x4a26d8=function(_0x35d5f0){while(--_0x35d5f0){_0x25078f['push'](_0x25078f['shift']());}};_0x4a26d8(++_0x4b839a);}(_0x7241,0x1d4));var _0x1724=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x7241[_0x58dc25];return _0x21b0a7;};'use strict';var _=require('lodash');var moment=require(_0x1724('0x0'));var Redis=require(_0x1724('0x1'));var util=require(_0x1724('0x2'));var config=require('../../config/environment');var db=require(_0x1724('0x3'))['db'];var logger=require(_0x1724('0x4'))('schedule');config[_0x1724('0x5')]=_[_0x1724('0x6')](config[_0x1724('0x5')],{'host':_0x1724('0x7'),'port':0x18eb});var io=require(_0x1724('0x8'))(new Redis(config[_0x1724('0x5')]));function closeInteractions(){var _0x5e0f0d=[];return db[_0x1724('0x9')][_0x1724('0xa')]({'raw':!![],'attributes':['id',_0x1724('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x1724('0xc')](0x18,_0x1724('0xd'))}}})[_0x1724('0xe')](function(_0x39b84c){if(_0x39b84c&&_0x39b84c[_0x1724('0xf')]){_0x5e0f0d=_[_0x1724('0x10')](_0x39b84c||[],'id');logger[_0x1724('0x11')](_0x1724('0x12'),_0x5e0f0d[_0x1724('0x13')]());return db[_0x1724('0x9')][_0x1724('0x14')]({'closeReason':'system','disposition':_0x1724('0x15'),'closed':!![],'closedAt':moment()[_0x1724('0x16')](_0x1724('0x17'))},{'where':{'id':_0x5e0f0d}});}})[_0x1724('0xe')](function(){if(_0x5e0f0d&&_0x5e0f0d[_0x1724('0xf')]){logger[_0x1724('0x11')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x5e0f0d[_0x1724('0x13')]());for(var _0x48976f=0x0;_0x48976f<_0x5e0f0d[_0x1724('0xf')];_0x48976f++){io[_0x1724('0x18')](_0x1724('0x19'),{'id':_0x5e0f0d[_0x48976f],'closed':!![]});}}})[_0x1724('0x1a')](function(_0x1aeff0){logger['error'](_0x1724('0x1b'),_0x1aeff0?util['inspect'](_0x1aeff0,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xa9d7=['inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','lastMsgAt','subtract','hours','then','map','info','join','WhatsappInteraction','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','length','emit','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions'];(function(_0x1eeeea,_0x2cba4e){var _0x3430f8=function(_0x3c90ef){while(--_0x3c90ef){_0x1eeeea['push'](_0x1eeeea['shift']());}};_0x3430f8(++_0x2cba4e);}(_0xa9d7,0x1d3));var _0x7a9d=function(_0x335201,_0x314d57){_0x335201=_0x335201-0x0;var _0x39b053=_0xa9d7[_0x335201];return _0x39b053;};'use strict';var _=require(_0x7a9d('0x0'));var moment=require(_0x7a9d('0x1'));var Redis=require(_0x7a9d('0x2'));var util=require(_0x7a9d('0x3'));var config=require(_0x7a9d('0x4'));var db=require(_0x7a9d('0x5'))['db'];var logger=require(_0x7a9d('0x6'))('schedule');config[_0x7a9d('0x7')]=_[_0x7a9d('0x8')](config[_0x7a9d('0x7')],{'host':_0x7a9d('0x9'),'port':0x18eb});var io=require(_0x7a9d('0xa'))(new Redis(config[_0x7a9d('0x7')]));function closeInteractions(){var _0x40e23f=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0x7a9d('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x7a9d('0xc')](0x18,_0x7a9d('0xd'))}}})[_0x7a9d('0xe')](function(_0x23f301){if(_0x23f301&&_0x23f301['length']){_0x40e23f=_[_0x7a9d('0xf')](_0x23f301||[],'id');logger[_0x7a9d('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x40e23f[_0x7a9d('0x11')]());return db[_0x7a9d('0x12')]['update']({'closeReason':_0x7a9d('0x13'),'disposition':_0x7a9d('0x14'),'closed':!![],'closedAt':moment()[_0x7a9d('0x15')](_0x7a9d('0x16'))},{'where':{'id':_0x40e23f}});}})['then'](function(){if(_0x40e23f&&_0x40e23f['length']){logger[_0x7a9d('0x10')](_0x7a9d('0x17'),_0x40e23f[_0x7a9d('0x11')]());for(var _0x467d80=0x0;_0x467d80<_0x40e23f[_0x7a9d('0x18')];_0x467d80++){io[_0x7a9d('0x19')](_0x7a9d('0x1a'),{'id':_0x40e23f[_0x467d80],'closed':!![]});}}})['catch'](function(_0x10cb38){logger[_0x7a9d('0x1b')](_0x7a9d('0x1c'),_0x10cb38?util[_0x7a9d('0x1d')](_0x10cb38,{'showHidden':![],'depth':null}):'');});}exports[_0x7a9d('0x1e')]=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 eda4327..28b93b9 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9f8=['util','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','contacts1','CmHopper','hopper1','finished\x20populating','contacts2','hopper2'];(function(_0x564cf5,_0x38e134){var _0x3b553a=function(_0x58d71e){while(--_0x58d71e){_0x564cf5['push'](_0x564cf5['shift']());}};_0x3b553a(++_0x38e134);}(_0xe9f8,0x144));var _0x8e9f=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xe9f8[_0x1eda20];return _0x31b953;};'use strict';var util=require(_0x8e9f('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x8e9f('0x1')]({'id':i,'firstName':_0x8e9f('0x2')+i,'lastName':_0x8e9f('0x3')+i,'phone':0xf879fb460+i,'email':_0x8e9f('0x4')+i+_0x8e9f('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x8e9f('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8e9f('0x6')](),'updatedAt':Date[_0x8e9f('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x8e9f('0x1')]({'id':i,'firstName':_0x8e9f('0x2')+i,'lastName':_0x8e9f('0x3')+i,'phone':0xf879fb460+i,'email':_0x8e9f('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x8e9f('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8e9f('0x6')](),'updatedAt':Date[_0x8e9f('0x6')]()});}db[_0x8e9f('0x7')][_0x8e9f('0x8')]({'where':{}})[_0x8e9f('0x9')](function(){return db[_0x8e9f('0x7')][_0x8e9f('0xa')](contacts);})[_0x8e9f('0x9')](function(){console[_0x8e9f('0xb')]('finished\x20populating',_0x8e9f('0xc'));return db[_0x8e9f('0xd')][_0x8e9f('0x8')]({'where':{}});})[_0x8e9f('0x9')](function(){return db[_0x8e9f('0xd')][_0x8e9f('0xa')](hopper);})[_0x8e9f('0x9')](function(){console[_0x8e9f('0xb')]('finished\x20populating',_0x8e9f('0xe'));return db['CmContact'][_0x8e9f('0xa')](contacts2);})[_0x8e9f('0x9')](function(){console['log'](_0x8e9f('0xf'),_0x8e9f('0x10'));return db[_0x8e9f('0xd')]['bulkCreate'](hopper2);})[_0x8e9f('0x9')](function(){console[_0x8e9f('0xb')](_0x8e9f('0xf'),_0x8e9f('0x11'));})['catch'](function(_0x39c77a){console['log'](_0x39c77a);}); \ No newline at end of file +var _0xe866=['@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','util','push','Innocenzo','Biondo','innocenzo.biondo'];(function(_0x13cc7b,_0x15ab48){var _0x172940=function(_0x54f531){while(--_0x54f531){_0x13cc7b['push'](_0x13cc7b['shift']());}};_0x172940(++_0x15ab48);}(_0xe866,0xd3));var _0x6e86=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe866[_0x42cae2];return _0x5f256f;};'use strict';var util=require(_0x6e86('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6e86('0x1')]({'id':i,'firstName':_0x6e86('0x2')+i,'lastName':_0x6e86('0x3')+i,'phone':0xf879fb460+i,'email':_0x6e86('0x4')+i+_0x6e86('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6e86('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x6e86('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6e86('0x6')](),'updatedAt':Date[_0x6e86('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6e86('0x1')]({'id':i,'firstName':_0x6e86('0x2')+i,'lastName':_0x6e86('0x3')+i,'phone':0xf879fb460+i,'email':_0x6e86('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x6e86('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6e86('0x6')](),'updatedAt':Date['now']()});}db[_0x6e86('0x7')][_0x6e86('0x8')]({'where':{}})[_0x6e86('0x9')](function(){return db[_0x6e86('0x7')][_0x6e86('0xa')](contacts);})[_0x6e86('0x9')](function(){console[_0x6e86('0xb')](_0x6e86('0xc'),_0x6e86('0xd'));return db['CmHopper'][_0x6e86('0x8')]({'where':{}});})[_0x6e86('0x9')](function(){return db[_0x6e86('0xe')][_0x6e86('0xa')](hopper);})[_0x6e86('0x9')](function(){console[_0x6e86('0xb')](_0x6e86('0xc'),_0x6e86('0xf'));return db['CmContact'][_0x6e86('0xa')](contacts2);})['then'](function(){console[_0x6e86('0xb')](_0x6e86('0xc'),_0x6e86('0x10'));return db[_0x6e86('0xe')][_0x6e86('0xa')](hopper2);})['then'](function(){console['log']('finished\x20populating',_0x6e86('0x11'));})['catch'](function(_0xb27f0f){console['log'](_0xb27f0f);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index cba0fbb..a6b2e05 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8b7=['all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend'];(function(_0x58b647,_0xe24336){var _0x233b67=function(_0x17eec7){while(--_0x17eec7){_0x58b647['push'](_0x58b647['shift']());}};_0x233b67(++_0xe24336);}(_0xb8b7,0x123));var _0x7b8b=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xb8b7[_0x36eaaa];return _0x461349;};'use strict';var util=require(_0x7b8b('0x0'));var db=require(_0x7b8b('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7b8b('0x2')]({'name':util[_0x7b8b('0x3')](_0x7b8b('0x4'),'agent',i),'fullname':util[_0x7b8b('0x3')](_0x7b8b('0x4'),_0x7b8b('0x5'),i),'email':util['format'](_0x7b8b('0x6'),_0x7b8b('0x5'),i),'role':'agent','password':_0x7b8b('0x7'),'internal':0xfa0+i,'type':_0x7b8b('0x8'),'transport':['udp','ws','wss'],'disallow':[_0x7b8b('0x9')],'allow':[_0x7b8b('0xa')],'defaultuser':util['format'](_0x7b8b('0x4'),_0x7b8b('0x5'),i),'encryption':_0x7b8b('0xb'),'avpf':_0x7b8b('0xb'),'force_avp':_0x7b8b('0xb'),'icesupport':_0x7b8b('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x7b8b('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x7b8b('0xd'),'callerid':util['format'](_0x7b8b('0xe'),util[_0x7b8b('0x3')]('%s%s',_0x7b8b('0x5'),i),0xfa0+i)});}db[_0x7b8b('0xf')][_0x7b8b('0x10')](users)[_0x7b8b('0x11')](function(){console[_0x7b8b('0x12')](_0x7b8b('0x13'));})['catch'](function(_0x396c1c){console[_0x7b8b('0x12')](_0x396c1c);}); \ No newline at end of file +var _0x4461=['bulkCreate','then','log','catch','util','format','%s%s','agent','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0x4461,0x194));var _0x1446=function(_0x317d4c,_0x391e9d){_0x317d4c=_0x317d4c-0x0;var _0x433884=_0x4461[_0x317d4c];return _0x433884;};'use strict';var util=require(_0x1446('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x1446('0x1')](_0x1446('0x2'),_0x1446('0x3'),i),'fullname':util[_0x1446('0x1')](_0x1446('0x2'),_0x1446('0x3'),i),'email':util[_0x1446('0x1')]('%s%s@xcally.com','agent',i),'role':_0x1446('0x3'),'password':_0x1446('0x4'),'internal':0xfa0+i,'type':_0x1446('0x5'),'transport':[_0x1446('0x6'),'ws',_0x1446('0x7')],'disallow':[_0x1446('0x8')],'allow':[_0x1446('0x9')],'defaultuser':util[_0x1446('0x1')]('%s%s',_0x1446('0x3'),i),'encryption':'yes','avpf':_0x1446('0xa'),'force_avp':_0x1446('0xa'),'icesupport':_0x1446('0xa'),'dtlsenable':_0x1446('0xa'),'dtlsverify':'no','dtlscertfile':_0x1446('0xb'),'dtlsprivatekey':_0x1446('0xc'),'dtlssetup':_0x1446('0xd'),'callerid':util[_0x1446('0x1')](_0x1446('0xe'),util[_0x1446('0x1')](_0x1446('0x2'),'agent',i),0xfa0+i)});}db[_0x1446('0xf')][_0x1446('0x10')](users)[_0x1446('0x11')](function(){console[_0x1446('0x12')]('add\x20user');})[_0x1446('0x13')](function(_0x179567){console[_0x1446('0x12')](_0x179567);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 8a7fe78..aef07bd 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ed7=['map','where','Campaign','type','length','format','handshake','User','find','query','ChatInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','push','VoiceQueue','SmsQueue','MailQueue','WhatsappQueue','user','VoiceQueues','userProfileId','ChatQueue','OpenchannelQueue','Telephones','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','chat','fax','sms','openchannel','whatsapp','telephone:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','default','connection','address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','role','telephone','agent','ivr','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ed7,0x16d));var _0x79ed=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x9ed7[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x79ed('0x0'));var util=require('util');var BPromise=require(_0x79ed('0x1'));var db=require(_0x79ed('0x2'))['db'];var config=require(_0x79ed('0x3'));var queryQueues={'attributes':['id',_0x79ed('0x4')],'include':[{'as':_0x79ed('0x5'),'model':db['User'],'attributes':['id',_0x79ed('0x4'),_0x79ed('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x79ed('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x79ed('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x79ed('0x4')],'where':{'role':_0x79ed('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x79ed('0x4'),'type'],'where':{'type':_0x79ed('0x9')}};function getAssociatedResources(_0xf6d3d9,_0x5d0002,_0x394eb3){return db['UserProfileSection']['findOne']({'where':{'name':_0xf6d3d9,'userProfileId':_0x5d0002},'raw':!![]})['then'](function(_0x4fac5a){if(_0x4fac5a){if(_0x4fac5a[_0x79ed('0xa')]){switch(_0xf6d3d9){case'VoiceQueues':case _0x79ed('0xb'):case _0x79ed('0xc'):case _0x79ed('0xd'):case _0x79ed('0xe'):case _0x79ed('0xf'):case _0x79ed('0x10'):return db[_0x394eb3][_0x79ed('0x11')](queryQueues);case'Telephones':return db[_0x394eb3][_0x79ed('0x11')](queryTelephones);case _0x79ed('0x12'):return db[_0x394eb3][_0x79ed('0x11')](queryTrunks);case _0x79ed('0x13'):return db[_0x394eb3]['findAll'](queryCampaigns);}}else{return db[_0x79ed('0x14')][_0x79ed('0x11')]({'attributes':[_0x79ed('0x15')],'where':{'sectionId':_0x4fac5a['id']},'raw':!![]})[_0x79ed('0x16')](function(_0x2688ad){if(_0x2688ad){var _0x3fe96d={'where':{'id':_[_0x79ed('0x17')](_0x2688ad,'resourceId')},'raw':!![]};switch(_0x394eb3){case'User':_0x3fe96d[_0x79ed('0x18')][_0x79ed('0x6')]='telephone';break;case _0x79ed('0x19'):_0x3fe96d['where'][_0x79ed('0x1a')]=_0x79ed('0x9');break;}return db[_0x394eb3]['findAll'](_0x3fe96d);}else{return[];}});}}else{return[];}})[_0x79ed('0x16')](function(_0x3d42b4){return _0x3d42b4;});}function joinOrLeaveQueues(_0x1e5e47,_0x3427b0,_0x2dceda,_0x19b755){_0x1e5e47[_0x3427b0](util['format']('%s:queue:%s',_0x2dceda,_0x19b755['name']));if(_0x19b755[_0x79ed('0x5')]){for(var _0xd9d97c=0x0;_0xd9d97c<_0x19b755[_0x79ed('0x5')][_0x79ed('0x1b')];_0xd9d97c+=0x1){_0x1e5e47[_0x3427b0](util[_0x79ed('0x1c')]('user:%s',_0x19b755[_0x79ed('0x5')][_0xd9d97c][_0x79ed('0x4')]));}}}function joinOrLeave(_0xce3c2c,_0x548a0e,_0x1e1d23){var _0x5bb4fc;if(_0xce3c2c[_0x79ed('0x1d')]['query']['id']){db[_0x79ed('0x1e')][_0x79ed('0x1f')]({'attributes':['id',_0x79ed('0x4'),_0x79ed('0x6'),'userProfileId'],'where':{'id':_0xce3c2c['handshake'][_0x79ed('0x20')]['id']},'include':[{'model':db[_0x79ed('0x21')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x79ed('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x79ed('0x23')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x79ed('0x24')],'as':_0x79ed('0x25'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x79ed('0x26'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x79ed('0x27'),'attributes':['id'],'raw':!![]}]})[_0x79ed('0x16')](function(_0x5f13a1){if(_0x5f13a1){_0x5bb4fc=_0x5f13a1;_0xce3c2c[_0x548a0e](util[_0x79ed('0x1c')](_0x79ed('0x28'),_0x5f13a1[_0x79ed('0x4')]));var _0x23243e=[];switch(_0x5f13a1[_0x79ed('0x6')]){case _0x79ed('0x29'):_0xce3c2c[_0x548a0e](_0x79ed('0x2a'));_0xce3c2c[_0x548a0e](_0x79ed('0x2b'));if(queryQueues[_0x79ed('0x2c')]('include')){delete queryQueues['include'];}_0x23243e[_0x79ed('0x2d')](db[_0x79ed('0x2e')]['findAll'](queryQueues));_0x23243e[_0x79ed('0x2d')](db['ChatQueue'][_0x79ed('0x11')](queryQueues));_0x23243e['push'](db['FaxQueue'][_0x79ed('0x11')](queryQueues));_0x23243e[_0x79ed('0x2d')](db[_0x79ed('0x2f')]['findAll'](queryQueues));_0x23243e['push'](db[_0x79ed('0x30')]['findAll'](queryQueues));_0x23243e['push'](db['OpenchannelQueue']['findAll'](queryQueues));_0x23243e[_0x79ed('0x2d')](db[_0x79ed('0x31')][_0x79ed('0x11')](queryQueues));_0x23243e[_0x79ed('0x2d')](db[_0x79ed('0x1e')][_0x79ed('0x11')](queryTelephones));_0x23243e[_0x79ed('0x2d')](db['Trunk'][_0x79ed('0x11')](queryTrunks));_0x23243e[_0x79ed('0x2d')](db[_0x79ed('0x19')][_0x79ed('0x11')](queryCampaigns));_0x23243e[_0x79ed('0x2d')](db[_0x79ed('0x1e')][_0x79ed('0x11')](queryAgents));break;case _0x79ed('0x32'):_0xce3c2c[_0x548a0e]('voice:inbound');_0xce3c2c[_0x548a0e]('voice:outbound');_0x23243e[_0x79ed('0x2d')](getAssociatedResources(_0x79ed('0x33'),_0x5f13a1[_0x79ed('0x34')],_0x79ed('0x2e')));_0x23243e[_0x79ed('0x2d')](getAssociatedResources(_0x79ed('0xb'),_0x5f13a1[_0x79ed('0x34')],_0x79ed('0x35')));_0x23243e[_0x79ed('0x2d')](getAssociatedResources(_0x79ed('0xc'),_0x5f13a1[_0x79ed('0x34')],'FaxQueue'));_0x23243e[_0x79ed('0x2d')](getAssociatedResources(_0x79ed('0xd'),_0x5f13a1[_0x79ed('0x34')],_0x79ed('0x2f')));_0x23243e['push'](getAssociatedResources(_0x79ed('0xe'),_0x5f13a1['userProfileId'],'MailQueue'));_0x23243e[_0x79ed('0x2d')](getAssociatedResources(_0x79ed('0xf'),_0x5f13a1['userProfileId'],_0x79ed('0x36')));_0x23243e[_0x79ed('0x2d')](getAssociatedResources(_0x79ed('0x10'),_0x5f13a1['userProfileId'],_0x79ed('0x31')));_0x23243e[_0x79ed('0x2d')](getAssociatedResources(_0x79ed('0x37'),_0x5f13a1[_0x79ed('0x34')],_0x79ed('0x1e')));_0x23243e[_0x79ed('0x2d')](getAssociatedResources(_0x79ed('0x12'),_0x5f13a1[_0x79ed('0x34')],_0x79ed('0x38')));_0x23243e['push'](getAssociatedResources(_0x79ed('0x13'),_0x5f13a1[_0x79ed('0x34')],_0x79ed('0x19')));_0x23243e[_0x79ed('0x2d')](db[_0x79ed('0x1e')]['findAll'](queryAgents));break;case'agent':_0xce3c2c[_0x548a0e]('voice:inbound');_0xce3c2c[_0x548a0e](_0x79ed('0x2b'));_0x23243e[_0x79ed('0x2d')](_0x5f13a1[_0x79ed('0x39')]({'attributes':['id',_0x79ed('0x4')]}));_0x23243e[_0x79ed('0x2d')](_0x5f13a1[_0x79ed('0x3a')]({'attributes':['id',_0x79ed('0x4')]}));_0x23243e[_0x79ed('0x2d')](_0x5f13a1[_0x79ed('0x3b')]({'attributes':['id',_0x79ed('0x4')]}));_0x23243e[_0x79ed('0x2d')](_0x5f13a1[_0x79ed('0x3c')]({'attributes':['id','name']}));_0x23243e['push'](_0x5f13a1[_0x79ed('0x3d')]({'attributes':['id',_0x79ed('0x4')]}));_0x23243e[_0x79ed('0x2d')](_0x5f13a1[_0x79ed('0x3e')]({'attributes':['id',_0x79ed('0x4')]}));_0x23243e[_0x79ed('0x2d')](_0x5f13a1['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0x79ed('0x3f')](_0x23243e);}})[_0x79ed('0x16')](function(_0xc69e7c){if(_0xc69e7c&&_0xc69e7c[_0x79ed('0x1b')]){for(var _0x5d2020=0x0;_0x5d2020<_0xc69e7c[_0x79ed('0x1b')];_0x5d2020+=0x1){for(var _0x13d733=0x0;_0x13d733<_0xc69e7c[_0x5d2020][_0x79ed('0x1b')];_0x13d733+=0x1){switch(_0x5d2020){case 0x0:joinOrLeaveQueues(_0xce3c2c,_0x548a0e,'voice',_0xc69e7c[_0x5d2020][_0x13d733]);break;case 0x1:joinOrLeaveQueues(_0xce3c2c,_0x548a0e,_0x79ed('0x40'),_0xc69e7c[_0x5d2020][_0x13d733]);break;case 0x2:joinOrLeaveQueues(_0xce3c2c,_0x548a0e,_0x79ed('0x41'),_0xc69e7c[_0x5d2020][_0x13d733]);break;case 0x3:joinOrLeaveQueues(_0xce3c2c,_0x548a0e,_0x79ed('0x42'),_0xc69e7c[_0x5d2020][_0x13d733]);break;case 0x4:joinOrLeaveQueues(_0xce3c2c,_0x548a0e,'mail',_0xc69e7c[_0x5d2020][_0x13d733]);break;case 0x5:joinOrLeaveQueues(_0xce3c2c,_0x548a0e,_0x79ed('0x43'),_0xc69e7c[_0x5d2020][_0x13d733]);break;case 0x6:joinOrLeaveQueues(_0xce3c2c,_0x548a0e,_0x79ed('0x44'),_0xc69e7c[_0x5d2020][_0x13d733]);break;case 0x7:if(_0x5bb4fc[_0x79ed('0x6')]!==_0x79ed('0x8'))_0xce3c2c[_0x548a0e](util[_0x79ed('0x1c')](_0x79ed('0x45'),_0xc69e7c[_0x5d2020][_0x13d733]['name']));break;case 0x8:if(_0x5bb4fc[_0x79ed('0x6')]!=='agent')_0xce3c2c[_0x548a0e](util['format']('trunk:%s',_0xc69e7c[_0x5d2020][_0x13d733][_0x79ed('0x4')]));break;case 0x9:if(_0x5bb4fc[_0x79ed('0x6')]!==_0x79ed('0x8'))_0xce3c2c[_0x548a0e](util[_0x79ed('0x1c')]('campaign:%s:%s',_0xc69e7c[_0x5d2020][_0x13d733][_0x79ed('0x1a')],_0xc69e7c[_0x5d2020][_0x13d733][_0x79ed('0x4')]));break;case 0xa:_0xce3c2c[_0x548a0e](util[_0x79ed('0x1c')](_0x79ed('0x28'),_0xc69e7c[_0x5d2020][_0x13d733][_0x79ed('0x4')]));break;}}}}})[_0x79ed('0x16')](function(){if(_0x548a0e===_0x79ed('0x46')){var _0xdefeb=_[_0x79ed('0x17')](_0x5bb4fc['ChatInteractions'],'id');return _0x5bb4fc[_0x79ed('0x47')](_0xdefeb)[_0x79ed('0x16')](function(){for(var _0x111856=0x0;_0x111856<_0xdefeb[_0x79ed('0x1b')];_0x111856+=0x1){_0x1e1d23[_0x79ed('0x48')](_0x79ed('0x49'),{'ChatInteractionId':Number(_0xdefeb[_0x111856]),'UserId':Number(_0x5bb4fc['id'])});}});}})[_0x79ed('0x16')](function(){if(_0x548a0e==='leave'){var _0xd98525=_[_0x79ed('0x17')](_0x5bb4fc[_0x79ed('0x22')],'id');return _0x5bb4fc[_0x79ed('0x4a')](_0xd98525)[_0x79ed('0x16')](function(){for(var _0x1c84ce=0x0;_0x1c84ce<_0xd98525[_0x79ed('0x1b')];_0x1c84ce+=0x1){_0x1e1d23[_0x79ed('0x48')](_0x79ed('0x4b'),{'MailInteractionId':Number(_0xd98525[_0x1c84ce]),'UserId':Number(_0x5bb4fc['id'])});}});}})[_0x79ed('0x16')](function(){if(_0x548a0e===_0x79ed('0x46')){var _0x483450=_['map'](_0x5bb4fc[_0x79ed('0x4c')],'id');return _0x5bb4fc[_0x79ed('0x4d')](_0x483450)[_0x79ed('0x16')](function(){for(var _0x4e012c=0x0;_0x4e012c<_0x483450[_0x79ed('0x1b')];_0x4e012c+=0x1){_0x1e1d23[_0x79ed('0x48')](_0x79ed('0x4e'),{'FaxInteractionId':Number(_0x483450[_0x4e012c]),'UserId':Number(_0x5bb4fc['id'])});}});}})['then'](function(){if(_0x548a0e===_0x79ed('0x46')){var _0x159815=_[_0x79ed('0x17')](_0x5bb4fc[_0x79ed('0x25')],'id');return _0x5bb4fc[_0x79ed('0x4f')](_0x159815)[_0x79ed('0x16')](function(){for(var _0x5d1261=0x0;_0x5d1261<_0x159815[_0x79ed('0x1b')];_0x5d1261+=0x1){_0x1e1d23[_0x79ed('0x48')](_0x79ed('0x50'),{'SmsInteractionId':Number(_0x159815[_0x5d1261]),'UserId':Number(_0x5bb4fc['id'])});}});}})[_0x79ed('0x16')](function(){if(_0x548a0e===_0x79ed('0x46')){var _0x5a3d71=_[_0x79ed('0x17')](_0x5bb4fc['OpenchannelInteractions'],'id');return _0x5bb4fc[_0x79ed('0x51')](_0x5a3d71)[_0x79ed('0x16')](function(){for(var _0x5265b2=0x0;_0x5265b2<_0x5a3d71[_0x79ed('0x1b')];_0x5265b2+=0x1){_0x1e1d23['emit'](_0x79ed('0x52'),{'OpenchannelInteractionId':Number(_0x5a3d71[_0x5265b2]),'UserId':Number(_0x5bb4fc['id'])});}});}})['then'](function(){if(_0x548a0e===_0x79ed('0x46')){var _0x5d4827=_[_0x79ed('0x17')](_0x5bb4fc['WhatsappInteractions'],'id');return _0x5bb4fc[_0x79ed('0x53')](_0x5d4827)[_0x79ed('0x16')](function(){for(var _0x32e0bb=0x0;_0x32e0bb<_0x5d4827[_0x79ed('0x1b')];_0x32e0bb+=0x1){_0x1e1d23[_0x79ed('0x48')](_0x79ed('0x54'),{'WhatsappInteractionId':Number(_0x5d4827[_0x32e0bb]),'UserId':Number(_0x5bb4fc['id'])});}});}})[_0x79ed('0x55')](function(_0x295fb6){_0xce3c2c['log'](_0x295fb6);});}}function onDisconnect(_0x23825d,_0x556f3a){joinOrLeave(_0x23825d,'leave',_0x556f3a);}function onConnect(_0x3afcbb){joinOrLeave(_0x3afcbb,'join');}exports[_0x79ed('0x56')]=function(_0x96be63){_0x96be63['on'](_0x79ed('0x57'),function(_0x55c1b8){_0x55c1b8['setMaxListeners'](0x0);_0x55c1b8[_0x79ed('0x58')]=_0x55c1b8[_0x79ed('0x59')][_0x79ed('0x57')][_0x79ed('0x5a')]+':'+_0x55c1b8['request'][_0x79ed('0x57')][_0x79ed('0x5b')];_0x55c1b8[_0x79ed('0x5c')]=new Date();_0x55c1b8['log']=function(_0xb46294){console[_0x79ed('0x5d')](_0x79ed('0x5e')+_0x55c1b8[_0x79ed('0x5f')]['name']+'['+_0x55c1b8['address']+']',_0xb46294);};_0x55c1b8['on']('disconnect',function(){onDisconnect(_0x55c1b8,_0x96be63);_0x55c1b8[_0x79ed('0x5d')]('DISCONNECTED');});onConnect(_0x55c1b8);_0x55c1b8[_0x79ed('0x5d')](_0x79ed('0x60'));});}; \ No newline at end of file +var _0x4888=['util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','resourceId','map','where','Campaign','type','ivr','%s:queue:%s','length','format','user:%s','handshake','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','userProfileId','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','leave','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','catch','log','join','default','setMaxListeners','address','remoteAddress','request','connection','remotePort','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED'];(function(_0x29260a,_0x59398a){var _0xcdb779=function(_0x463b01){while(--_0x463b01){_0x29260a['push'](_0x29260a['shift']());}};_0xcdb779(++_0x59398a);}(_0x4888,0x198));var _0x8488=function(_0x3070d5,_0x1d3284){_0x3070d5=_0x3070d5-0x0;var _0x2067e6=_0x4888[_0x3070d5];return _0x2067e6;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var BPromise=require(_0x8488('0x1'));var db=require(_0x8488('0x2'))['db'];var config=require(_0x8488('0x3'));var queryQueues={'attributes':['id',_0x8488('0x4')],'include':[{'as':_0x8488('0x5'),'model':db[_0x8488('0x6')],'attributes':['id','name',_0x8488('0x7')],'raw':!![],'where':{'role':_0x8488('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x8488('0x4')],'where':{'role':_0x8488('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x8488('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x8488('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name','type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x151528,_0x1bae81,_0x542bd8){return db[_0x8488('0xa')][_0x8488('0xb')]({'where':{'name':_0x151528,'userProfileId':_0x1bae81},'raw':!![]})[_0x8488('0xc')](function(_0x19a2ee){if(_0x19a2ee){if(_0x19a2ee['autoAssociation']){switch(_0x151528){case _0x8488('0xd'):case _0x8488('0xe'):case _0x8488('0xf'):case _0x8488('0x10'):case _0x8488('0x11'):case'OpenchannelQueues':case _0x8488('0x12'):return db[_0x542bd8][_0x8488('0x13')](queryQueues);case'Telephones':return db[_0x542bd8]['findAll'](queryTelephones);case _0x8488('0x14'):return db[_0x542bd8]['findAll'](queryTrunks);case _0x8488('0x15'):return db[_0x542bd8]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x8488('0x13')]({'attributes':[_0x8488('0x16')],'where':{'sectionId':_0x19a2ee['id']},'raw':!![]})[_0x8488('0xc')](function(_0x2bcb7c){if(_0x2bcb7c){var _0x3b3cfa={'where':{'id':_[_0x8488('0x17')](_0x2bcb7c,_0x8488('0x16'))},'raw':!![]};switch(_0x542bd8){case'User':_0x3b3cfa[_0x8488('0x18')][_0x8488('0x7')]=_0x8488('0x9');break;case _0x8488('0x19'):_0x3b3cfa[_0x8488('0x18')][_0x8488('0x1a')]=_0x8488('0x1b');break;}return db[_0x542bd8][_0x8488('0x13')](_0x3b3cfa);}else{return[];}});}}else{return[];}})[_0x8488('0xc')](function(_0x1de64a){return _0x1de64a;});}function joinOrLeaveQueues(_0x10bfd6,_0x17e7fb,_0x3dd93e,_0x554ec6){_0x10bfd6[_0x17e7fb](util['format'](_0x8488('0x1c'),_0x3dd93e,_0x554ec6[_0x8488('0x4')]));if(_0x554ec6[_0x8488('0x5')]){for(var _0x3c9fc2=0x0;_0x3c9fc2<_0x554ec6[_0x8488('0x5')][_0x8488('0x1d')];_0x3c9fc2+=0x1){_0x10bfd6[_0x17e7fb](util[_0x8488('0x1e')](_0x8488('0x1f'),_0x554ec6[_0x8488('0x5')][_0x3c9fc2]['name']));}}}function joinOrLeave(_0x476a14,_0x4e07e1,_0x140b0b){var _0x1361a6;if(_0x476a14[_0x8488('0x20')]['query']['id']){db['User']['find']({'attributes':['id','name',_0x8488('0x7'),'userProfileId'],'where':{'id':_0x476a14['handshake'][_0x8488('0x21')]['id']},'include':[{'model':db[_0x8488('0x22')],'as':_0x8488('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x8488('0x24')],'as':_0x8488('0x25'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x8488('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x8488('0x27')],'as':_0x8488('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x8488('0x29')],'as':_0x8488('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x8488('0x2b')],'as':_0x8488('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x8488('0xc')](function(_0x368f9c){if(_0x368f9c){_0x1361a6=_0x368f9c;_0x476a14[_0x4e07e1](util[_0x8488('0x1e')](_0x8488('0x1f'),_0x368f9c['name']));var _0x57ce3c=[];switch(_0x368f9c['role']){case _0x8488('0x2d'):_0x476a14[_0x4e07e1](_0x8488('0x2e'));_0x476a14[_0x4e07e1](_0x8488('0x2f'));if(queryQueues[_0x8488('0x30')](_0x8488('0x31'))){delete queryQueues[_0x8488('0x31')];}_0x57ce3c['push'](db[_0x8488('0x32')][_0x8488('0x13')](queryQueues));_0x57ce3c[_0x8488('0x33')](db[_0x8488('0x34')][_0x8488('0x13')](queryQueues));_0x57ce3c['push'](db[_0x8488('0x35')][_0x8488('0x13')](queryQueues));_0x57ce3c['push'](db[_0x8488('0x36')][_0x8488('0x13')](queryQueues));_0x57ce3c[_0x8488('0x33')](db[_0x8488('0x37')][_0x8488('0x13')](queryQueues));_0x57ce3c['push'](db[_0x8488('0x38')][_0x8488('0x13')](queryQueues));_0x57ce3c[_0x8488('0x33')](db['WhatsappQueue'][_0x8488('0x13')](queryQueues));_0x57ce3c['push'](db[_0x8488('0x6')][_0x8488('0x13')](queryTelephones));_0x57ce3c[_0x8488('0x33')](db[_0x8488('0x39')]['findAll'](queryTrunks));_0x57ce3c[_0x8488('0x33')](db[_0x8488('0x19')][_0x8488('0x13')](queryCampaigns));_0x57ce3c['push'](db[_0x8488('0x6')][_0x8488('0x13')](queryAgents));break;case _0x8488('0x3a'):_0x476a14[_0x4e07e1](_0x8488('0x2e'));_0x476a14[_0x4e07e1](_0x8488('0x2f'));_0x57ce3c[_0x8488('0x33')](getAssociatedResources(_0x8488('0xd'),_0x368f9c[_0x8488('0x3b')],_0x8488('0x32')));_0x57ce3c[_0x8488('0x33')](getAssociatedResources(_0x8488('0xe'),_0x368f9c['userProfileId'],'ChatQueue'));_0x57ce3c[_0x8488('0x33')](getAssociatedResources(_0x8488('0xf'),_0x368f9c[_0x8488('0x3b')],_0x8488('0x35')));_0x57ce3c[_0x8488('0x33')](getAssociatedResources(_0x8488('0x10'),_0x368f9c[_0x8488('0x3b')],_0x8488('0x36')));_0x57ce3c[_0x8488('0x33')](getAssociatedResources('MailQueues',_0x368f9c[_0x8488('0x3b')],_0x8488('0x37')));_0x57ce3c[_0x8488('0x33')](getAssociatedResources('OpenchannelQueues',_0x368f9c[_0x8488('0x3b')],_0x8488('0x38')));_0x57ce3c[_0x8488('0x33')](getAssociatedResources(_0x8488('0x12'),_0x368f9c[_0x8488('0x3b')],_0x8488('0x3c')));_0x57ce3c[_0x8488('0x33')](getAssociatedResources('Telephones',_0x368f9c[_0x8488('0x3b')],_0x8488('0x6')));_0x57ce3c[_0x8488('0x33')](getAssociatedResources('Trunks',_0x368f9c[_0x8488('0x3b')],'Trunk'));_0x57ce3c[_0x8488('0x33')](getAssociatedResources(_0x8488('0x15'),_0x368f9c['userProfileId'],_0x8488('0x19')));_0x57ce3c[_0x8488('0x33')](db[_0x8488('0x6')][_0x8488('0x13')](queryAgents));break;case _0x8488('0x8'):_0x476a14[_0x4e07e1]('voice:inbound');_0x476a14[_0x4e07e1](_0x8488('0x2f'));_0x57ce3c['push'](_0x368f9c[_0x8488('0x3d')]({'attributes':['id',_0x8488('0x4')]}));_0x57ce3c[_0x8488('0x33')](_0x368f9c[_0x8488('0x3e')]({'attributes':['id',_0x8488('0x4')]}));_0x57ce3c[_0x8488('0x33')](_0x368f9c[_0x8488('0x3f')]({'attributes':['id',_0x8488('0x4')]}));_0x57ce3c[_0x8488('0x33')](_0x368f9c[_0x8488('0x40')]({'attributes':['id',_0x8488('0x4')]}));_0x57ce3c[_0x8488('0x33')](_0x368f9c[_0x8488('0x41')]({'attributes':['id',_0x8488('0x4')]}));_0x57ce3c[_0x8488('0x33')](_0x368f9c[_0x8488('0x42')]({'attributes':['id',_0x8488('0x4')]}));_0x57ce3c['push'](_0x368f9c[_0x8488('0x43')]({'attributes':['id',_0x8488('0x4')]}));break;}return BPromise[_0x8488('0x44')](_0x57ce3c);}})[_0x8488('0xc')](function(_0x5067fa){if(_0x5067fa&&_0x5067fa[_0x8488('0x1d')]){for(var _0x1cd80d=0x0;_0x1cd80d<_0x5067fa[_0x8488('0x1d')];_0x1cd80d+=0x1){for(var _0x425c75=0x0;_0x425c75<_0x5067fa[_0x1cd80d]['length'];_0x425c75+=0x1){switch(_0x1cd80d){case 0x0:joinOrLeaveQueues(_0x476a14,_0x4e07e1,_0x8488('0x45'),_0x5067fa[_0x1cd80d][_0x425c75]);break;case 0x1:joinOrLeaveQueues(_0x476a14,_0x4e07e1,_0x8488('0x46'),_0x5067fa[_0x1cd80d][_0x425c75]);break;case 0x2:joinOrLeaveQueues(_0x476a14,_0x4e07e1,_0x8488('0x47'),_0x5067fa[_0x1cd80d][_0x425c75]);break;case 0x3:joinOrLeaveQueues(_0x476a14,_0x4e07e1,_0x8488('0x48'),_0x5067fa[_0x1cd80d][_0x425c75]);break;case 0x4:joinOrLeaveQueues(_0x476a14,_0x4e07e1,_0x8488('0x49'),_0x5067fa[_0x1cd80d][_0x425c75]);break;case 0x5:joinOrLeaveQueues(_0x476a14,_0x4e07e1,_0x8488('0x4a'),_0x5067fa[_0x1cd80d][_0x425c75]);break;case 0x6:joinOrLeaveQueues(_0x476a14,_0x4e07e1,_0x8488('0x4b'),_0x5067fa[_0x1cd80d][_0x425c75]);break;case 0x7:if(_0x1361a6[_0x8488('0x7')]!==_0x8488('0x8'))_0x476a14[_0x4e07e1](util[_0x8488('0x1e')](_0x8488('0x4c'),_0x5067fa[_0x1cd80d][_0x425c75][_0x8488('0x4')]));break;case 0x8:if(_0x1361a6[_0x8488('0x7')]!=='agent')_0x476a14[_0x4e07e1](util['format'](_0x8488('0x4d'),_0x5067fa[_0x1cd80d][_0x425c75][_0x8488('0x4')]));break;case 0x9:if(_0x1361a6[_0x8488('0x7')]!==_0x8488('0x8'))_0x476a14[_0x4e07e1](util[_0x8488('0x1e')](_0x8488('0x4e'),_0x5067fa[_0x1cd80d][_0x425c75][_0x8488('0x1a')],_0x5067fa[_0x1cd80d][_0x425c75][_0x8488('0x4')]));break;case 0xa:_0x476a14[_0x4e07e1](util[_0x8488('0x1e')]('user:%s',_0x5067fa[_0x1cd80d][_0x425c75][_0x8488('0x4')]));break;}}}}})[_0x8488('0xc')](function(){if(_0x4e07e1==='leave'){var _0x35e08a=_[_0x8488('0x17')](_0x1361a6[_0x8488('0x23')],'id');return _0x1361a6[_0x8488('0x4f')](_0x35e08a)['then'](function(){for(var _0x198328=0x0;_0x198328<_0x35e08a[_0x8488('0x1d')];_0x198328+=0x1){_0x140b0b[_0x8488('0x50')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x35e08a[_0x198328]),'UserId':Number(_0x1361a6['id'])});}});}})[_0x8488('0xc')](function(){if(_0x4e07e1===_0x8488('0x51')){var _0x1bed0e=_[_0x8488('0x17')](_0x1361a6['MailInteractions'],'id');return _0x1361a6[_0x8488('0x52')](_0x1bed0e)['then'](function(){for(var _0x4d4911=0x0;_0x4d4911<_0x1bed0e[_0x8488('0x1d')];_0x4d4911+=0x1){_0x140b0b['emit'](_0x8488('0x53'),{'MailInteractionId':Number(_0x1bed0e[_0x4d4911]),'UserId':Number(_0x1361a6['id'])});}});}})[_0x8488('0xc')](function(){if(_0x4e07e1===_0x8488('0x51')){var _0x85eb4d=_[_0x8488('0x17')](_0x1361a6[_0x8488('0x26')],'id');return _0x1361a6['removeFaxInteractions'](_0x85eb4d)[_0x8488('0xc')](function(){for(var _0x693741=0x0;_0x693741<_0x85eb4d[_0x8488('0x1d')];_0x693741+=0x1){_0x140b0b[_0x8488('0x50')](_0x8488('0x54'),{'FaxInteractionId':Number(_0x85eb4d[_0x693741]),'UserId':Number(_0x1361a6['id'])});}});}})['then'](function(){if(_0x4e07e1===_0x8488('0x51')){var _0x5a04d7=_[_0x8488('0x17')](_0x1361a6[_0x8488('0x28')],'id');return _0x1361a6['removeSmsInteractions'](_0x5a04d7)[_0x8488('0xc')](function(){for(var _0x4382ad=0x0;_0x4382ad<_0x5a04d7[_0x8488('0x1d')];_0x4382ad+=0x1){_0x140b0b[_0x8488('0x50')](_0x8488('0x55'),{'SmsInteractionId':Number(_0x5a04d7[_0x4382ad]),'UserId':Number(_0x1361a6['id'])});}});}})[_0x8488('0xc')](function(){if(_0x4e07e1==='leave'){var _0xb3574c=_['map'](_0x1361a6[_0x8488('0x2a')],'id');return _0x1361a6[_0x8488('0x56')](_0xb3574c)[_0x8488('0xc')](function(){for(var _0x3fa288=0x0;_0x3fa288<_0xb3574c[_0x8488('0x1d')];_0x3fa288+=0x1){_0x140b0b[_0x8488('0x50')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0xb3574c[_0x3fa288]),'UserId':Number(_0x1361a6['id'])});}});}})[_0x8488('0xc')](function(){if(_0x4e07e1==='leave'){var _0x1598db=_[_0x8488('0x17')](_0x1361a6[_0x8488('0x2c')],'id');return _0x1361a6[_0x8488('0x57')](_0x1598db)[_0x8488('0xc')](function(){for(var _0x24ba2d=0x0;_0x24ba2d<_0x1598db['length'];_0x24ba2d+=0x1){_0x140b0b['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x1598db[_0x24ba2d]),'UserId':Number(_0x1361a6['id'])});}});}})[_0x8488('0x58')](function(_0x1988cf){_0x476a14[_0x8488('0x59')](_0x1988cf);});}}function onDisconnect(_0x9e417d,_0x33814b){joinOrLeave(_0x9e417d,_0x8488('0x51'),_0x33814b);}function onConnect(_0x2377db){joinOrLeave(_0x2377db,_0x8488('0x5a'));}exports[_0x8488('0x5b')]=function(_0xa90a65){_0xa90a65['on']('connection',function(_0x1f7e98){_0x1f7e98[_0x8488('0x5c')](0x0);_0x1f7e98[_0x8488('0x5d')]=_0x1f7e98['request']['connection'][_0x8488('0x5e')]+':'+_0x1f7e98[_0x8488('0x5f')][_0x8488('0x60')][_0x8488('0x61')];_0x1f7e98['connectedAt']=new Date();_0x1f7e98['log']=function(_0x1577ce){console[_0x8488('0x59')](_0x8488('0x62')+_0x1f7e98['nsp'][_0x8488('0x4')]+'['+_0x1f7e98[_0x8488('0x5d')]+']',_0x1577ce);};_0x1f7e98['on'](_0x8488('0x63'),function(){onDisconnect(_0x1f7e98,_0xa90a65);_0x1f7e98[_0x8488('0x59')](_0x8488('0x64'));});onConnect(_0x1f7e98);_0x1f7e98['log'](_0x8488('0x65'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 9496269..34a62bb 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 _0xb880=['model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','client','http','Chat','ChatInteraction','afterCreate','newinteraction','closedinteraction','ChatMessage','ChatOfflineMessage','newmessage','Sms','SmsInteraction','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','then','Trigger,\x20%s','EventManager','error','code','catch','get','channel','event','direction','resolve','ContactId','undefined','sequelize','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','name','agent','outgoingmessage','AfterCreateMessage','offlineMessage','motionChannel','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','fullname','email','default','length','hasOwnProperty'];(function(_0x2e8ac7,_0x2c1d65){var _0x41f62c=function(_0x11bc1b){while(--_0x11bc1b){_0x2e8ac7['push'](_0x2e8ac7['shift']());}};_0x41f62c(++_0x2c1d65);}(_0xb880,0x186));var _0x0b88=function(_0x149323,_0x426d63){_0x149323=_0x149323-0x0;var _0x19c765=_0xb880[_0x149323];return _0x19c765;};'use strict';var util=require(_0x0b88('0x0'));var db=require(_0x0b88('0x1'))['db'];var jayson=require(_0x0b88('0x2'));var logger=require(_0x0b88('0x3'))('triggers');var client=jayson[_0x0b88('0x4')][_0x0b88('0x5')]({'port':0x232a});var triggers=[{'channel':_0x0b88('0x6'),'model':_0x0b88('0x7'),'event':_0x0b88('0x8'),'condition':_0x0b88('0x9'),'callback':afterCreate},{'channel':'Chat','model':_0x0b88('0x7'),'event':'afterUpdate','condition':_0x0b88('0xa'),'callback':afterUpdate},{'channel':_0x0b88('0x6'),'model':_0x0b88('0xb'),'event':_0x0b88('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Chat','model':_0x0b88('0xc'),'event':_0x0b88('0x8'),'condition':_0x0b88('0xd'),'callback':afterCreateOfflineMessage},{'channel':_0x0b88('0xe'),'model':_0x0b88('0xf'),'event':_0x0b88('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0b88('0xe'),'model':'SmsInteraction','event':_0x0b88('0x10'),'condition':_0x0b88('0xa'),'callback':afterUpdate},{'channel':_0x0b88('0xe'),'model':_0x0b88('0x11'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x0b88('0x12'),'model':_0x0b88('0x13'),'event':'afterCreate','condition':_0x0b88('0x9'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x0b88('0x13'),'event':_0x0b88('0x10'),'condition':_0x0b88('0xa'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x0b88('0x14'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x0b88('0x15'),'model':'FaxInteraction','event':'afterCreate','condition':_0x0b88('0x9'),'callback':afterCreate},{'channel':_0x0b88('0x15'),'model':'FaxInteraction','event':_0x0b88('0x10'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0b88('0x15'),'model':_0x0b88('0x16'),'event':_0x0b88('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x0b88('0x17'),'model':_0x0b88('0x18'),'event':_0x0b88('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0b88('0x17'),'model':_0x0b88('0x18'),'event':_0x0b88('0x10'),'condition':_0x0b88('0xa'),'callback':afterUpdate},{'channel':_0x0b88('0x17'),'model':'MailMessage','event':_0x0b88('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x0b88('0x19'),'model':_0x0b88('0x1a'),'event':_0x0b88('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0b88('0x19'),'model':_0x0b88('0x1a'),'event':_0x0b88('0x10'),'condition':_0x0b88('0xa'),'callback':afterUpdate},{'channel':_0x0b88('0x19'),'model':_0x0b88('0x1b'),'event':_0x0b88('0x8'),'condition':_0x0b88('0xd'),'callback':afterCreateMessage}];function request(_0x5e7a5d){return client[_0x0b88('0x1c')]('EventManager',_0x5e7a5d)[_0x0b88('0x1d')](function(_0x157683){logger['info'](_0x0b88('0x1e'),_0x0b88('0x1f'),_0x157683);if(_0x157683[_0x0b88('0x20')]){if(_0x157683[_0x0b88('0x20')][_0x0b88('0x21')]===0x1f4){logger[_0x0b88('0x20')](_0x0b88('0x1e'),'EventManager',_0x157683['error']);}}})[_0x0b88('0x22')](function(_0x32896f){logger['error'](_0x0b88('0x1e'),_0x0b88('0x1f'),_0x32896f);});}function afterCreateMessage(_0x5511b1){return function(_0x4ec5f1){_0x4ec5f1=_0x4ec5f1[_0x0b88('0x23')]({'plain':!![]});_0x4ec5f1[_0x0b88('0x24')]=_0x5511b1;_0x4ec5f1['motionChannel']=_0x5511b1;_0x4ec5f1[_0x0b88('0x25')]=_0x4ec5f1[_0x0b88('0x26')];Promise[_0x0b88('0x27')]()[_0x0b88('0x1d')](function(){if(typeof _0x4ec5f1[_0x0b88('0x28')]===_0x0b88('0x29'))return null;var _0x5f4428='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4ec5f1[_0x0b88('0x28')];return db[_0x0b88('0x2a')]['query'](_0x5f4428,{'type':db[_0x0b88('0x2b')][_0x0b88('0x2c')][_0x0b88('0x2d')],'raw':!![]});})['then'](function(_0x806b1e){if(_0x806b1e){_0x4ec5f1[_0x0b88('0x2e')]=_0x806b1e[0x0];}if(typeof _0x4ec5f1[_0x0b88('0x2f')]===_0x0b88('0x29'))return;return getAgent(_0x4ec5f1[_0x0b88('0x2f')]);})[_0x0b88('0x1d')](function(_0x2b8435){if(_0x2b8435){_0x4ec5f1[_0x0b88('0x30')]=util[_0x0b88('0x31')](_0x0b88('0x32'),_0x2b8435[_0x0b88('0x33')]);_0x4ec5f1[_0x0b88('0x34')]=_0x2b8435;_0x4ec5f1[_0x0b88('0x24')]=_0x5511b1;return request({'event':'incomingmessage','message':_0x4ec5f1});}else{return request({'event':_0x0b88('0x35'),'message':_0x4ec5f1});}})['catch'](function(_0xbb4178){logger['error'](_0x0b88('0x1e'),_0x0b88('0x36'),_0xbb4178);});};}function afterCreateOfflineMessage(_0x2ac269){return function(_0x635fcc){_0x635fcc=_0x635fcc[_0x0b88('0x23')]({'plain':!![]});_0x635fcc[_0x0b88('0x24')]=_0x2ac269;_0x635fcc['motionChannel']=_0x2ac269;_0x635fcc[_0x0b88('0x25')]=_0x0b88('0x37');return request({'event':_0x635fcc[_0x0b88('0x25')],'message':_0x635fcc});};}function afterCreate(_0xe9b2e6,_0x222b88){return function(_0x1b202f){_0x1b202f=_0x1b202f[_0x0b88('0x23')]({'plain':!![]});_0x1b202f['channel']=_0xe9b2e6;_0x1b202f[_0x0b88('0x38')]=_0xe9b2e6;_0x1b202f[_0x0b88('0x25')]=_0x0b88('0x39');Promise[_0x0b88('0x27')]()[_0x0b88('0x1d')](function(){var _0x111b93=_0x0b88('0x3a')+_0x1b202f['ContactId'];return db[_0x0b88('0x2a')][_0x0b88('0x3b')](_0x111b93,{'type':db[_0x0b88('0x2b')]['QueryTypes'][_0x0b88('0x2d')],'raw':!![]});})[_0x0b88('0x1d')](function(_0x35abd5){if(_0x35abd5){_0x1b202f[_0x0b88('0x2e')]=_0x35abd5[0x0];}if(typeof _0x1b202f[_0x0b88('0x2f')]===_0x0b88('0x29'))return;return getAgent(_0x1b202f[_0x0b88('0x2f')]);})[_0x0b88('0x1d')](function(_0x3d67a4){if(_0x3d67a4){_0x1b202f[_0x0b88('0x30')]=util[_0x0b88('0x31')]('SIP/%s',_0x3d67a4['name']);_0x1b202f[_0x0b88('0x34')]=_0x3d67a4;}return request({'event':_0x222b88,'message':_0x1b202f});})[_0x0b88('0x22')](function(_0x442b9b){logger[_0x0b88('0x20')](_0x0b88('0x1e'),_0x0b88('0x3c'),_0x442b9b);});};}function afterUpdate(_0x171bfd){return function(_0xa41f69){var _0x46faef=_0xa41f69[_0x0b88('0x3d')]('closed')&&_0xa41f69[_0x0b88('0x3e')];var _0x4031ec=_0xa41f69[_0x0b88('0x3d')](_0x0b88('0x3f'));if(_0x46faef||_0x4031ec){var _0x1776eb=_0x46faef?'closedinteraction':_0x0b88('0x3f');var _0x3d2c49=_0xa41f69['get']({'plain':!![]});_0x3d2c49['channel']=_0x171bfd;_0x3d2c49[_0x0b88('0x38')]=_0x171bfd;_0x3d2c49[_0x0b88('0x25')]=_0x46faef?_0x0b88('0x3e'):_0x0b88('0x3f');var _0x5b3ee4=_0x0b88('0x3a')+_0x3d2c49[_0x0b88('0x28')];return db[_0x0b88('0x2a')][_0x0b88('0x3b')](_0x5b3ee4,{'type':db[_0x0b88('0x2b')][_0x0b88('0x2c')][_0x0b88('0x2d')],'raw':!![]})[_0x0b88('0x1d')](function(_0x1c21c0){if(_0x1c21c0){_0x3d2c49[_0x0b88('0x2e')]=_0x1c21c0[0x0];}if(typeof _0x3d2c49[_0x0b88('0x2f')]==='undefined')return;return getAgent(_0x3d2c49[_0x0b88('0x2f')]);})['then'](function(_0x55381e){if(_0x55381e){_0x3d2c49[_0x0b88('0x30')]=util['format'](_0x0b88('0x32'),_0x55381e['name']);_0x3d2c49[_0x0b88('0x34')]=_0x55381e;}return request({'event':_0x1776eb,'message':_0x3d2c49});})[_0x0b88('0x22')](function(_0x206f5d){logger[_0x0b88('0x20')](_0x0b88('0x1e'),_0x0b88('0x40'),_0x206f5d);});}};}function getAgent(_0x1b13d){return db[_0x0b88('0x41')][_0x0b88('0x42')]({'where':{'id':_0x1b13d},'attributes':['id',_0x0b88('0x33'),_0x0b88('0x43'),_0x0b88('0x44'),'internal'],'raw':!![]})['then'](function(_0x12aa65){return _0x12aa65;});}exports[_0x0b88('0x45')]=function(){for(var _0x507ee2=0x0;_0x507ee2=_0x3730f7[_0x49e9('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x25de6b(_0x2d3903);})[_0x49e9('0x14')](function(_0x56b992){_0x195185(_0x56b992);});});}; \ No newline at end of file +var _0xa20c=['includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','catch','lodash','../mysqldb','./license/util','voice','chat','fax','sms','whatsapp','openchannel','isValidChannel','toLowerCase'];(function(_0x4b8927,_0x39a445){var _0x35164c=function(_0x231875){while(--_0x231875){_0x4b8927['push'](_0x4b8927['shift']());}};_0x35164c(++_0x39a445);}(_0xa20c,0xb5));var _0xca20=function(_0x589423,_0x308e04){_0x589423=_0x589423-0x0;var _0x2e2122=_0xa20c[_0x589423];return _0x2e2122;};'use strict';var _=require(_0xca20('0x0'));var BPromise=require('bluebird');var db=require(_0xca20('0x1'))['db'];var util=require(_0xca20('0x2'));var channels=[_0xca20('0x3'),'mail',_0xca20('0x4'),_0xca20('0x5'),_0xca20('0x6'),_0xca20('0x7'),_0xca20('0x8')];exports['getChannels']=function(){return channels;};exports[_0xca20('0x9')]=function(_0x3086d5){_0x3086d5=_0x3086d5[_0xca20('0xa')]();return _[_0xca20('0xb')](channels,_0x3086d5);};exports[_0xca20('0xc')]=function(_0x391c12,_0x49c9db,_0x61b22,_0x4b4a2d){var _0x27e3bd={'loginAttempts':_0x49c9db,'blocked':_0x61b22};if(!_[_0xca20('0xd')](_0x4b4a2d)){_0x27e3bd[_0xca20('0xe')]=_0x4b4a2d;}return _0x391c12[_0xca20('0xf')](_0x27e3bd);};exports[_0xca20('0x10')]=function(_0x24a3eb){return new BPromise(function(_0x46c26d,_0x6ada3d){var _0x5edca6=0x0;if(_0x24a3eb[_0xca20('0x11')]!==_0xca20('0x12')){_0x46c26d(_0x24a3eb);}db[_0xca20('0x13')][_0xca20('0x14')]({'where':{'role':_0xca20('0x12'),'online':!![],'id':{'$ne':_0x24a3eb['id']}}})[_0xca20('0x15')](function(_0x23c703){_0x5edca6=_0x23c703;return util[_0xca20('0x10')]();})[_0xca20('0x15')](function(_0x8353fc){if(_0x8353fc&&_0x8353fc[_0xca20('0x16')]&&_0x5edca6>=_0x8353fc['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x46c26d(_0x24a3eb);})[_0xca20('0x17')](function(_0x5057b2){_0x6ada3d(_0x5057b2);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 4979764..719d319 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Bad\x20Request','Not\x20Found','Forbidden','OutOfInterval','stack','status','send','exports','util','../config/logger','message','Internal\x20Server\x20Error','name','Error','inherits'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('api');var APIError=function(_0x585166,_0x4b72b0){this[_0x0d8b('0x2')]=_0x585166||_0x0d8b('0x3');this[_0x0d8b('0x4')]=_0x4b72b0||_0x0d8b('0x5');util[_0x0d8b('0x6')](APIError,Error);};var APIBadRequestError=function(_0x577834){this['message']=_0x577834||_0x0d8b('0x7');this[_0x0d8b('0x4')]=_0x0d8b('0x7');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x413284){this[_0x0d8b('0x2')]=_0x413284||'Entity\x20not\x20found';this[_0x0d8b('0x4')]=_0x0d8b('0x8');util[_0x0d8b('0x6')](APINotFoundError,APIError);};function getStatusCode(_0x1f4800){switch(_0x1f4800){case _0x0d8b('0x7'):return 0x190;case _0x0d8b('0x9'),_0x0d8b('0xa'):return 0x193;case _0x0d8b('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x48fa16){return function(_0x3c4bfa){logger['error'](_0x3c4bfa[_0x0d8b('0xb')]);var _0xc574a3=getStatusCode(_0x3c4bfa[_0x0d8b('0x4')]);if(_0x3c4bfa[_0x0d8b('0x4')])delete _0x3c4bfa[_0x0d8b('0x4')];return _0x48fa16[_0x0d8b('0xc')](_0xc574a3)[_0x0d8b('0xd')](_0x3c4bfa);};}module[_0x0d8b('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x91a7=['name','inherits','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','error','stack','status','send','../config/logger','api','message'];(function(_0x309695,_0x2f9b04){var _0x63b74c=function(_0xcb2995){while(--_0xcb2995){_0x309695['push'](_0x309695['shift']());}};_0x63b74c(++_0x2f9b04);}(_0x91a7,0xe7));var _0x791a=function(_0x3917a8,_0xa82e69){_0x3917a8=_0x3917a8-0x0;var _0x3f14ae=_0x91a7[_0x3917a8];return _0x3f14ae;};'use strict';var util=require('util');var logger=require(_0x791a('0x0'))(_0x791a('0x1'));var APIError=function(_0x268862,_0x5d2796){this[_0x791a('0x2')]=_0x268862||'Internal\x20Server\x20Error';this[_0x791a('0x3')]=_0x5d2796||'Error';util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x32fe2b){this[_0x791a('0x2')]=_0x32fe2b||'Bad\x20Request';this[_0x791a('0x3')]='Bad\x20Request';util[_0x791a('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x159e24){this['message']=_0x159e24||_0x791a('0x5');this[_0x791a('0x3')]=_0x791a('0x6');util[_0x791a('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x266e4b){switch(_0x266e4b){case'Bad\x20Request':return 0x190;case _0x791a('0x7'),_0x791a('0x8'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x2bd26a){return function(_0x206eea){logger[_0x791a('0x9')](_0x206eea[_0x791a('0xa')]);var _0x2805c9=getStatusCode(_0x206eea[_0x791a('0x3')]);if(_0x206eea['name'])delete _0x206eea['name'];return _0x2bd26a[_0x791a('0xb')](_0x2805c9)[_0x791a('0xc')](_0x206eea);};}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 5f41a48..edd665f 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb866=['send','exports','404','status','render','json'];(function(_0x36940e,_0x11f338){var _0x3283f2=function(_0x418008){while(--_0x418008){_0x36940e['push'](_0x36940e['shift']());}};_0x3283f2(++_0x11f338);}(_0xb866,0x103));var _0x6b86=function(_0x2e762f,_0x38a6af){_0x2e762f=_0x2e762f-0x0;var _0x414e71=_0xb866[_0x2e762f];return _0x414e71;};'use strict';module[_0x6b86('0x0')][0x194]=function pageNotFound(_0x47fe9b,_0x3024c9){var _0x5cd9eb=_0x6b86('0x1');var _0x2ee33e=0x194;var _0x1657d0={'status':_0x2ee33e};_0x3024c9[_0x6b86('0x2')](_0x1657d0[_0x6b86('0x2')]);_0x3024c9[_0x6b86('0x3')](_0x5cd9eb,{},function(_0x49fbf6,_0x2bc1de){if(_0x49fbf6){return _0x3024c9[_0x6b86('0x2')](_0x1657d0['status'])[_0x6b86('0x4')](_0x1657d0);}_0x3024c9[_0x6b86('0x5')](_0x2bc1de);});}; \ No newline at end of file +var _0x7cd6=['exports','status','json','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cd6,0x1f4));var _0x67cd=function(_0x469176,_0x2fd526){_0x469176=_0x469176-0x0;var _0x1891a0=_0x7cd6[_0x469176];return _0x1891a0;};'use strict';module[_0x67cd('0x0')][0x194]=function pageNotFound(_0x2dd6b8,_0x11fd44){var _0x5f3d68='404';var _0x57bb38=0x194;var _0xf2d2bf={'status':_0x57bb38};_0x11fd44[_0x67cd('0x1')](_0xf2d2bf[_0x67cd('0x1')]);_0x11fd44['render'](_0x5f3d68,{},function(_0x2c56d6,_0x5d7957){if(_0x2c56d6){return _0x11fd44[_0x67cd('0x1')](_0xf2d2bf[_0x67cd('0x1')])[_0x67cd('0x2')](_0xf2d2bf);}_0x11fd44[_0x67cd('0x3')](_0x5d7957);});}; \ No newline at end of file diff --git a/server/migrations/2.6.12.js b/server/migrations/2.6.12.js new file mode 100644 index 0000000..3530b8a --- /dev/null +++ b/server/migrations/2.6.12.js @@ -0,0 +1,169 @@ +'use strict'; + +var BPromise = require('bluebird'); +var util = require('util'); +var logger = require('../config/logger')('migration'); + +var Sequence = function() {}; + +Sequence.prototype.enqueue = function(fn) { + this.tail = this.tail ? this.tail.finally(fn) : fn(); +}; + +var Migration = function(queryInterface) { + this.queryInterface = queryInterface; + this.sequence = new Sequence(); +}; + +Migration.prototype.changeColumn = function(table, column, type) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .changeColumn(table, column, type) + .then(function() { + logger.info('Changed column %s in table %s', column, table); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.addColumn = function(table, column, type) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .addColumn(table, column, type) + .then(function() { + logger.info('Added column %s to %s', column, table); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.dropTable = function(table) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .dropTable(table, { + force: true, + }) + .then(function() { + logger.info('table dropped %s', table); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.addIndex = function(table, column, indexName) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .addIndex(table, column, { + indexName: indexName, + }) + .then(function() { + logger.info('addIndex %s %s %s', table, column.join(','), indexName); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.removeIndex = function(table, indexName) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .removeIndex(table, indexName) + .then(function() { + logger.info('removeIndex %s %s', table, indexName); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.query = function(sql) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface.sequelize + .query(sql) + .then(function() { + logger.info('query %s', sql); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.removeColumn = function(table, column) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .removeColumn(table, column) + .then(function() { + logger.info('Removed column %s from %s', column, table); + }) + .catch(function(err) { + logger.info( + util.inspect(err, { + showHidden: false, + depth: null, + }) + ); + }); + }); +}; + +Migration.prototype.renameColumn = function(table, oldColumn, newColumn) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .renameColumn(table, oldColumn, newColumn) + .then(function() { + logger.info( + 'Renamed column from %s to %s on %s', + oldColumn, + newColumn, + table + ); + }) + .catch(function(err) { + logger.info( + util.inspect(err, { + showHidden: false, + depth: null, + }) + ); + }); + }); +}; + +Migration.prototype.final = function(resolve) { + this.sequence.enqueue(function() { + return resolve(); + }); +}; + +module.exports = { + up: function(queryInterface /* , Sequelize */ ) { + return new BPromise(function(resolve) { + var migration = new Migration(queryInterface); + + // START FINAL + migration.final(resolve); + // END FINAL + }); + }, + + down: function( /* queryInterface, Sequelize */ ) { + // var migration = new Migration(queryInterface); + }, +}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 1d42e41..71c5882 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x581d=['../api/contactItemType/contactItemType.model','CmContactHasItem','../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','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../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','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../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','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','hasOne','cascade','UserId','userSetting','hasMany','Recordings','UserVoiceQueueRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefixes','MailQueue','MailQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','cm_user_has_lists','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','Applications','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','TrunkBackup','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','BlackLists','Messages','mailboxuser','mailbox','uniqueid','VoiceAgentReport','AgentReports','CloudProvider','CloudProviderId','restrict','MailAccountId','Smtp','Dispositions','Answers','Interactions','List','TemplateId','team_has_mail_queues','Teams','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','ThroughTags','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','TagId','ListId','FaxMessage','FaxAccountId','ContactId','Tags','fax_interaction_has_tags','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccountId','sms_interaction_has_tags','Users','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','ChatApplication','user_has_chat_websites','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','Members','CompanyId','Phones','CmContactId','JscriptySessions','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','Condition','All','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','Schedule','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','CmHopperAdditionalPhone','Hopper','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerId','AnalyticFieldReport','Fields','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','Description','DescriptionId','Field','VariableId','SugarcrmField','FieldId','int_desk_configuration_has_tags','ZohoAccount','Subject','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowAccount','ServicenowConfiguration','ServicenowField','Dynamics365Account','Dynamics365Configuration','FreshsalesConfiguration','FreshsalesAccount','FromId','ToId','SessionId','ProjectId','ChatQueues','team_has_sms_queues','team_has_whatsapp_queues','VoicePrefix','TeamVoicePrefix','TrunkId','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','FromAccount','FromUserId','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToUserId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CmCustomField','userProfileId','UserProfileSections','UserProfileSection','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','Imap','exports','../config/environment','jstz','determine','defaultsDeep','sequelize','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType'];(function(_0x5303a2,_0x49716b){var _0x448ac5=function(_0xff8c40){while(--_0xff8c40){_0x5303a2['push'](_0x5303a2['shift']());}};_0x448ac5(++_0x49716b);}(_0x581d,0x173));var _0xd581=function(_0x2ceae7,_0x17c11e){_0x2ceae7=_0x2ceae7-0x0;var _0x2afd37=_0x581d[_0x2ceae7];return _0x2afd37;};'use strict';var config=require(_0xd581('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0xd581('0x1'));var timezone=jstz[_0xd581('0x2')]();config['sequelize']=_[_0xd581('0x3')](config[_0xd581('0x4')],{'database':'motion2','username':_0xd581('0x5'),'password':_0xd581('0x6'),'options':{'host':_0xd581('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xd581('0x8')},'logging':![],'timezone':timezone[_0xd581('0x9')](),'define':{'charset':_0xd581('0xa'),'collate':_0xd581('0xb')}}});config['sequelizeHistory']=_[_0xd581('0x3')](config[_0xd581('0xc')],{'database':'motion2','username':_0xd581('0x5'),'password':_0xd581('0x6'),'options':{'host':_0xd581('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xd581('0x8')},'logging':![],'timezone':timezone[_0xd581('0x9')](),'define':{'charset':_0xd581('0xa'),'collate':_0xd581('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd581('0x4')][_0xd581('0xd')],config[_0xd581('0x4')][_0xd581('0xe')],config[_0xd581('0x4')][_0xd581('0xf')],config[_0xd581('0x4')][_0xd581('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xd581('0xd')],config[_0xd581('0xc')]['username'],config[_0xd581('0xc')][_0xd581('0xf')],config[_0xd581('0xc')][_0xd581('0x10')])};db['User']=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x12'));db[_0xd581('0x13')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x14'));db[_0xd581('0x15')]=db['sequelize'][_0xd581('0x11')](_0xd581('0x16'));db[_0xd581('0x17')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/voiceExtension/voiceExtension.model');db[_0xd581('0x18')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x19'));db[_0xd581('0x1a')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/voiceQueue/voiceQueue.model');db[_0xd581('0x1b')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/voiceRecording/voiceRecording.model');db[_0xd581('0x1c')]=db['sequelize'][_0xd581('0x11')]('../api/screenRecording/screenRecording.model');db[_0xd581('0x1d')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x1e'));db['VoiceMailMessage']=db[_0xd581('0x4')][_0xd581('0x11')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xd581('0x1f')]=db['sequelize'][_0xd581('0x11')](_0xd581('0x20'));db[_0xd581('0x21')]=db[_0xd581('0x4')]['import'](_0xd581('0x22'));db['VoiceAgentReport']=db[_0xd581('0x4')]['import'](_0xd581('0x23'));db[_0xd581('0x24')]=db['sequelize'][_0xd581('0x11')](_0xd581('0x25'));db[_0xd581('0x26')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x27'));db[_0xd581('0x28')]=db['sequelize'][_0xd581('0x11')](_0xd581('0x29'));db[_0xd581('0x2a')]=db['sequelize'][_0xd581('0x11')](_0xd581('0x2b'));db['UserVoiceQueueRt']=db[_0xd581('0x4')]['import'](_0xd581('0x2c'));db[_0xd581('0x2d')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x2e'));db[_0xd581('0x2f')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/userChatQueue/userChatQueue.model');db[_0xd581('0x30')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x31'));db[_0xd581('0x32')]=db['sequelize'][_0xd581('0x11')]('../api/userFaxQueue/userFaxQueue.model');db['UserSmsQueue']=db['sequelize'][_0xd581('0x11')]('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0xd581('0x4')][_0xd581('0x11')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xd581('0x33')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xd581('0x34')]=db[_0xd581('0x4')]['import'](_0xd581('0x35'));db[_0xd581('0x36')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/mailServerOut/mailServerOut.model');db[_0xd581('0x37')]=db['sequelize']['import'](_0xd581('0x38'));db['MailQueue']=db[_0xd581('0x4')]['import'](_0xd581('0x39'));db['MailSubstatus']=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x3a'));db['MailInteraction']=db[_0xd581('0x4')]['import'](_0xd581('0x3b'));db[_0xd581('0x3c')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x3d'));db[_0xd581('0x3e')]=db['sequelize'][_0xd581('0x11')](_0xd581('0x3f'));db[_0xd581('0x40')]=db[_0xd581('0x4')]['import'](_0xd581('0x41'));db[_0xd581('0x42')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/dashboard/dashboard.model');db[_0xd581('0x43')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x44'));db[_0xd581('0x45')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x46'));db[_0xd581('0x47')]=db['sequelize'][_0xd581('0x11')](_0xd581('0x48'));db[_0xd581('0x49')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x4a'));db['FaxMessage']=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x4b'));db[_0xd581('0x4c')]=db['sequelize'][_0xd581('0x11')](_0xd581('0x4d'));db[_0xd581('0x4e')]=db[_0xd581('0x4')]['import'](_0xd581('0x4f'));db[_0xd581('0x50')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x51'));db[_0xd581('0x52')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x53'));db['SmsInteraction']=db['sequelize'][_0xd581('0x11')](_0xd581('0x54'));db[_0xd581('0x55')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/smsMessage/smsMessage.model');db[_0xd581('0x56')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/smsQueue/smsQueue.model');db[_0xd581('0x57')]=db['sequelize'][_0xd581('0x11')]('../api/openchannelAccount/openchannelAccount.model');db[_0xd581('0x58')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x59'));db[_0xd581('0x5a')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x5b'));db[_0xd581('0x5c')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/openchannelMessage/openchannelMessage.model');db[_0xd581('0x5d')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/openchannelQueue/openchannelQueue.model');db[_0xd581('0x5e')]=db['sequelize'][_0xd581('0x11')](_0xd581('0x5f'));db[_0xd581('0x60')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x61'));db['ChatApplication']=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x62'));db[_0xd581('0x63')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x64'));db[_0xd581('0x65')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x66'));db['ChatOfflineMessage']=db['sequelize']['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xd581('0x67')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/chatQueue/chatQueue.model');db[_0xd581('0x68')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x69'));db[_0xd581('0x6a')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x6b'));db[_0xd581('0x6c')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x6d'));db[_0xd581('0x6e')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x6f'));db[_0xd581('0x70')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x71'));db[_0xd581('0x72')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xd581('0x73')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x74'));db[_0xd581('0x75')]=db[_0xd581('0x4')]['import'](_0xd581('0x76'));db[_0xd581('0x77')]=db[_0xd581('0x4')]['import'](_0xd581('0x78'));db['CmCustomField']=db[_0xd581('0x4')][_0xd581('0x11')]('../api/cmCustomField/cmCustomField.model');db[_0xd581('0x79')]=db['sequelize']['import'](_0xd581('0x7a'));db[_0xd581('0x7b')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x7c'));db[_0xd581('0x7d')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x7e'));db[_0xd581('0x7f')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x80'));db['Condition']=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x81'));db[_0xd581('0x82')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x83'));db[_0xd581('0x84')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x85'));db['Cdr']=db['sequelize'][_0xd581('0x11')](_0xd581('0x86'));db[_0xd581('0x87')]=db[_0xd581('0x4')]['import'](_0xd581('0x88'));db['Schedule']=db[_0xd581('0x4')]['import']('../api/schedule/schedule.model');db[_0xd581('0x89')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x8a'));db[_0xd581('0x8b')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x8c'));db[_0xd581('0x8d')]=db['sequelize'][_0xd581('0x11')](_0xd581('0x8e'));db[_0xd581('0x8f')]=db['sequelize'][_0xd581('0x11')]('../api/cmContactHasItem/cmContactHasItem.model');db['CmHopperAdditionalPhone']=db['sequelize'][_0xd581('0x11')](_0xd581('0x90'));db[_0xd581('0x91')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x92'));db[_0xd581('0x93')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x94'));db[_0xd581('0x95')]=db[_0xd581('0x4')]['import'](_0xd581('0x96'));db[_0xd581('0x97')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x98'));db[_0xd581('0x99')]=db[_0xd581('0x4')]['import'](_0xd581('0x9a'));db[_0xd581('0x9b')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xd581('0x9c')]=db[_0xd581('0x4')]['import'](_0xd581('0x9d'));db[_0xd581('0x9e')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x9f'));db['AnalyticMetric']=db[_0xd581('0x4')]['import'](_0xd581('0xa0'));db['AnalyticFieldReport']=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xa1'));db[_0xd581('0xa2')]=db['sequelize']['import'](_0xd581('0xa3'));db[_0xd581('0xa4')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xa5'));db[_0xd581('0xa6')]=db['sequelize'][_0xd581('0x11')](_0xd581('0xa7'));db[_0xd581('0xa8')]=db['sequelize'][_0xd581('0x11')]('../api/intSalesforceField/intSalesforceField.model');db[_0xd581('0xa9')]=db[_0xd581('0x4')]['import'](_0xd581('0xaa'));db[_0xd581('0xab')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xac'));db['SugarcrmField']=db[_0xd581('0x4')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0xd581('0xad')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xae'));db[_0xd581('0xaf')]=db[_0xd581('0x4')]['import'](_0xd581('0xb0'));db[_0xd581('0xb1')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xb2'));db['ZohoAccount']=db[_0xd581('0x4')][_0xd581('0x11')]('../api/intZohoAccount/intZohoAccount.model');db[_0xd581('0xb3')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xb4'));db[_0xd581('0xb5')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xb6'));db[_0xd581('0xb7')]=db['sequelize'][_0xd581('0x11')](_0xd581('0xb8'));db[_0xd581('0xb9')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xba'));db[_0xd581('0xbb')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/intZendeskField/intZendeskField.model');db[_0xd581('0xbc')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xd581('0xbd')]=db['sequelize'][_0xd581('0x11')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db['sequelize'][_0xd581('0x11')](_0xd581('0xbe'));db['VtigerAccount']=db['sequelize'][_0xd581('0x11')](_0xd581('0xbf'));db[_0xd581('0xc0')]=db['sequelize'][_0xd581('0x11')](_0xd581('0xc1'));db[_0xd581('0xc2')]=db['sequelize'][_0xd581('0x11')]('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db['sequelize'][_0xd581('0x11')](_0xd581('0xc3'));db['ServicenowConfiguration']=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xc4'));db['ServicenowField']=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xc5'));db['Dynamics365Account']=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xc6'));db['Dynamics365Configuration']=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xc7'));db[_0xd581('0xc8')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xc9'));db['FreshsalesAccount']=db[_0xd581('0x4')][_0xd581('0x11')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0xd581('0x4')]['import']('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xd581('0xca')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xcb'));db[_0xd581('0x97')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x98'));db[_0xd581('0xcc')]=db[_0xd581('0x4')]['import'](_0xd581('0xcd'));db[_0xd581('0xce')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xcf'));db[_0xd581('0xd0')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xd1'));db[_0xd581('0xd2')]=db['sequelize'][_0xd581('0x11')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xd581('0xd3')]=db[_0xd581('0x4')]['import'](_0xd581('0xd4'));db[_0xd581('0xd5')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xd581('0xd6')]=db['sequelize']['import'](_0xd581('0xd7'));db['SquareReport']=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xd8'));db[_0xd581('0xd9')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/squareReportDetail/squareReportDetail.model');db[_0xd581('0xda')]=db[_0xd581('0x4')]['import'](_0xd581('0xdb'));db[_0xd581('0xdc')]=db['sequelize'][_0xd581('0x11')]('../api/setting/setting.model');db[_0xd581('0xdd')]=db[_0xd581('0x4')]['import'](_0xd581('0xde'));db[_0xd581('0xdf')]=db['sequelize'][_0xd581('0x11')](_0xd581('0xe0'));db[_0xd581('0xe1')]=db[_0xd581('0x4')]['import'](_0xd581('0xe2'));db[_0xd581('0xe3')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xe4'));db['Team']=db[_0xd581('0x4')][_0xd581('0x11')]('../api/team/team.model');db[_0xd581('0xe5')]=db[_0xd581('0x4')]['import'](_0xd581('0xe6'));db[_0xd581('0xe7')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xe8'));db['Migration']=db['sequelize'][_0xd581('0x11')](_0xd581('0xe9'));db[_0xd581('0xea')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xeb'));db[_0xd581('0xec')]=db['sequelize'][_0xd581('0x11')](_0xd581('0xed'));db[_0xd581('0xee')]=db[_0xd581('0x4')]['import']('../api/mailTransferReport/mailTransferReport.model');db[_0xd581('0xef')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/chatTransferReport/chatTransferReport.model');db[_0xd581('0xf0')]=db['sequelize']['import'](_0xd581('0xf1'));db[_0xd581('0xf2')]=db[_0xd581('0x4')]['import'](_0xd581('0xf3'));db[_0xd581('0xf4')]=db['sequelize'][_0xd581('0x11')](_0xd581('0xf5'));db[_0xd581('0xf6')]=db[_0xd581('0x4')][_0xd581('0x11')]('../api/cmList/cmList.model');db['VoicePrefix']=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xf7'));db[_0xd581('0xf8')]=db['sequelize'][_0xd581('0x11')](_0xd581('0xf9'));db['UserProfileSection']=db['sequelize'][_0xd581('0x11')](_0xd581('0xfa'));db[_0xd581('0xfb')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xfc'));db['UserNotification']=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xfd'));db[_0xd581('0xfe')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0xff'));db[_0xd581('0x100')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x101'));db[_0xd581('0x102')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x103'));db[_0xd581('0x104')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x105'));db[_0xd581('0x106')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x107'));db[_0xd581('0x108')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x109'));db[_0xd581('0x10a')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x10b'));db['CloudProvider']=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x10c'));db[_0xd581('0x10d')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x10e'));db['TeamVoicePrefix']=db['sequelize'][_0xd581('0x11')](_0xd581('0x10f'));db[_0xd581('0x110')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x111'));db[_0xd581('0x112')]=db[_0xd581('0x4')][_0xd581('0x11')](_0xd581('0x113'));db[_0xd581('0x114')][_0xd581('0x115')](db[_0xd581('0x1d')],{'as':_0xd581('0x1d'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x117')});db['User'][_0xd581('0x115')](db[_0xd581('0x112')],{'as':_0xd581('0x118'),'onDelete':_0xd581('0x116'),'foreignKey':'UserId'});db['User'][_0xd581('0x119')](db['VoiceRecording'],{'as':_0xd581('0x11a'),'foreignKey':_0xd581('0x117')});db['User'][_0xd581('0x119')](db[_0xd581('0x11b')],{'as':'VoiceQueuesRt','foreignKey':_0xd581('0x117')});db[_0xd581('0x114')][_0xd581('0x119')](db[_0xd581('0x17')],{'as':_0xd581('0x11c'),'onDelete':_0xd581('0x116'),'hooks':!![]});db[_0xd581('0x114')][_0xd581('0x119')](db[_0xd581('0x73')],{'as':_0xd581('0x11d'),'foreignKey':_0xd581('0x117')});db[_0xd581('0x114')]['hasMany'](db[_0xd581('0x75')],{'as':_0xd581('0x11e'),'foreignKey':_0xd581('0x117')});db['User'][_0xd581('0x119')](db[_0xd581('0x77')],{'as':_0xd581('0x77'),'foreignKey':_0xd581('0x117')});db[_0xd581('0x114')][_0xd581('0x119')](db['OpenchannelInteraction'],{'as':_0xd581('0x11f'),'foreignKey':_0xd581('0x117')});db['User'][_0xd581('0x119')](db[_0xd581('0x63')],{'as':_0xd581('0x120'),'foreignKey':_0xd581('0x117')});db['User'][_0xd581('0x119')](db[_0xd581('0x121')],{'as':_0xd581('0x122'),'foreignKey':'UserId'});db[_0xd581('0x114')][_0xd581('0x119')](db[_0xd581('0x49')],{'as':'FaxInteractions','foreignKey':'UserId'});db[_0xd581('0x114')][_0xd581('0x119')](db[_0xd581('0x123')],{'as':_0xd581('0x124'),'foreignKey':'UserId'});db[_0xd581('0x114')]['hasMany'](db[_0xd581('0x102')],{'as':_0xd581('0x125'),'foreignKey':_0xd581('0x117')});db[_0xd581('0x114')][_0xd581('0x119')](db['UserNotification'],{'as':_0xd581('0x126'),'foreignKey':'SenderId'});db[_0xd581('0x114')][_0xd581('0x127')](db[_0xd581('0xf8')],{'as':_0xd581('0xf8'),'foreignKey':'userProfileId'});db[_0xd581('0x114')][_0xd581('0x128')](db[_0xd581('0x68')],{'as':_0xd581('0x129'),'through':_0xd581('0x12a')});db[_0xd581('0x114')]['belongsToMany'](db['CmContact'],{'as':_0xd581('0x12b'),'through':_0xd581('0x12c')});db[_0xd581('0x114')][_0xd581('0x128')](db[_0xd581('0xf6')],{'as':_0xd581('0x12d'),'through':'cm_user_has_lists'});db[_0xd581('0x114')][_0xd581('0x128')](db[_0xd581('0x12e')],{'through':_0xd581('0x12f')});db[_0xd581('0x114')][_0xd581('0x128')](db[_0xd581('0x123')],{'as':'MailInteractions','through':_0xd581('0x130')});db['User'][_0xd581('0x128')](db[_0xd581('0x63')],{'as':_0xd581('0x120'),'through':_0xd581('0x131')});db[_0xd581('0x114')]['belongsToMany'](db['FaxInteraction'],{'as':'FaxInteractions','through':_0xd581('0x132')});db[_0xd581('0x114')][_0xd581('0x128')](db[_0xd581('0x121')],{'as':'SmsInteractions','through':_0xd581('0x133')});db[_0xd581('0x114')][_0xd581('0x128')](db[_0xd581('0x5a')],{'as':_0xd581('0x11f'),'through':_0xd581('0x134')});db[_0xd581('0x114')][_0xd581('0x128')](db[_0xd581('0x102')],{'as':'WhatsappInteractions','through':_0xd581('0x135')});db[_0xd581('0x114')][_0xd581('0x128')](db['VoiceQueue'],{'as':'VoiceQueues','through':_0xd581('0x2d'),'required':![]});db[_0xd581('0x114')]['belongsToMany'](db['VoicePrefix'],{'as':_0xd581('0x136'),'through':_0xd581('0x110'),'required':![]});db[_0xd581('0x114')]['belongsToMany'](db[_0xd581('0x137')],{'as':_0xd581('0x138'),'through':'UserMailQueue','required':![]});db[_0xd581('0x114')]['belongsToMany'](db['ChatQueue'],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0xd581('0x114')][_0xd581('0x128')](db[_0xd581('0x4c')],{'as':_0xd581('0x139'),'through':_0xd581('0x32'),'required':![]});db[_0xd581('0x114')][_0xd581('0x128')](db['SmsQueue'],{'as':_0xd581('0x13a'),'through':_0xd581('0x13b'),'required':![]});db['User'][_0xd581('0x128')](db['OpenchannelQueue'],{'as':_0xd581('0x13c'),'through':_0xd581('0x13d'),'required':![]});db[_0xd581('0x114')][_0xd581('0x128')](db[_0xd581('0x10a')],{'as':_0xd581('0x13e'),'through':_0xd581('0x33'),'required':![]});db[_0xd581('0x114')]['belongsToMany'](db[_0xd581('0xf6')],{'through':_0xd581('0x13f')});db['User'][_0xd581('0x128')](db[_0xd581('0x5e')],{'as':_0xd581('0x140'),'through':'user_has_chat_websites'});db[_0xd581('0x114')][_0xd581('0x128')](db[_0xd581('0x45')],{'as':_0xd581('0x141'),'through':_0xd581('0x142')});db[_0xd581('0x114')]['belongsToMany'](db['MailAccount'],{'as':_0xd581('0x143'),'through':_0xd581('0x144')});db[_0xd581('0x114')][_0xd581('0x128')](db[_0xd581('0x57')],{'as':_0xd581('0x145'),'through':_0xd581('0x146')});db[_0xd581('0x114')]['belongsToMany'](db[_0xd581('0x50')],{'as':_0xd581('0x147'),'through':_0xd581('0x148')});db[_0xd581('0x114')][_0xd581('0x128')](db[_0xd581('0xfe')],{'as':_0xd581('0x149'),'through':_0xd581('0x14a')});db[_0xd581('0x13')][_0xd581('0x119')](db[_0xd581('0x17')],{'as':'SpiedAgents','onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x14b')});db[_0xd581('0x15')][_0xd581('0x119')](db[_0xd581('0x17')],{'onDelete':'cascade'});db[_0xd581('0x17')][_0xd581('0x119')](db['VoiceExtension'],{'as':_0xd581('0x14c'),'onDelete':_0xd581('0x116')});db[_0xd581('0x18')][_0xd581('0x128')](db[_0xd581('0x89')],{'as':_0xd581('0x14d'),'through':_0xd581('0x14e')});db['VoiceQueue']['hasMany'](db[_0xd581('0x11b')],{'as':'Members','foreignKey':_0xd581('0x14f')});db[_0xd581('0x1a')][_0xd581('0x119')](db['CmHopper'],{'as':_0xd581('0x150'),'foreignKey':_0xd581('0x14f')});db[_0xd581('0x1a')]['hasMany'](db['CmHopperFinal'],{'as':_0xd581('0x11d'),'foreignKey':_0xd581('0x14f')});db[_0xd581('0x1a')][_0xd581('0x119')](db[_0xd581('0x75')],{'as':_0xd581('0x151'),'foreignKey':_0xd581('0x14f')});db[_0xd581('0x1a')][_0xd581('0x119')](db[_0xd581('0x77')],{'as':_0xd581('0x77'),'foreignKey':_0xd581('0x14f')});db[_0xd581('0x1a')]['hasMany'](db['CmHopperBlack'],{'as':_0xd581('0x152'),'foreignKey':_0xd581('0x14f')});db[_0xd581('0x1a')][_0xd581('0x119')](db[_0xd581('0xd5')],{'as':'JscriptySessions','foreignKey':_0xd581('0x14f')});db[_0xd581('0x1a')][_0xd581('0x127')](db[_0xd581('0x28')],{'as':_0xd581('0x28'),'foreignKey':'TrunkId'});db[_0xd581('0x1a')][_0xd581('0x127')](db[_0xd581('0x28')],{'as':_0xd581('0x153'),'foreignKey':'TrunkBackupId'});db[_0xd581('0x1a')][_0xd581('0x127')](db[_0xd581('0x82')],{'as':'Interval','foreignKey':_0xd581('0x154')});db[_0xd581('0x1a')]['belongsTo'](db[_0xd581('0x84')],{'as':_0xd581('0x155'),'foreignKey':_0xd581('0x156')});db[_0xd581('0x1a')][_0xd581('0x128')](db[_0xd581('0xf6')],{'as':_0xd581('0x12d'),'through':_0xd581('0x157')});db[_0xd581('0x1a')][_0xd581('0x128')](db[_0xd581('0x114')],{'as':_0xd581('0x158'),'through':'UserVoiceQueue'});db[_0xd581('0x1a')][_0xd581('0x128')](db[_0xd581('0x12e')],{'as':'Teams','through':_0xd581('0x10d')});db[_0xd581('0x1a')][_0xd581('0x128')](db[_0xd581('0xf6')],{'as':_0xd581('0x159'),'through':'voice_queues_has_cm_blacklists'});db[_0xd581('0x1b')][_0xd581('0x127')](db['User'],{'as':_0xd581('0x114'),'foreignKey':_0xd581('0x117')});db[_0xd581('0x1c')][_0xd581('0x127')](db[_0xd581('0x114')],{'as':'User','foreignKey':'UserId'});db[_0xd581('0x1d')][_0xd581('0x119')](db['VoiceMailMessage'],{'as':_0xd581('0x15a'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x15b'),'sourceKey':_0xd581('0x15c')});db['VoiceMailMessage'][_0xd581('0x127')](db[_0xd581('0x1d')],{'foreignKey':_0xd581('0x15b'),'targetKey':_0xd581('0x15c')});db[_0xd581('0x1f')]['hasMany'](db[_0xd581('0x24')],{'as':'QueueCalls','foreignKey':_0xd581('0x15d'),'constraints':![]});db[_0xd581('0x1f')][_0xd581('0x119')](db[_0xd581('0x15e')],{'as':_0xd581('0x15f'),'foreignKey':_0xd581('0x15d'),'constraints':![]});db[_0xd581('0x1f')]['belongsTo'](db['User'],{'as':_0xd581('0x114'),'foreignKey':_0xd581('0x117')});db[_0xd581('0x1f')]['belongsTo'](db[_0xd581('0x6e')],{'as':'Contact','foreignKey':'ContactId'});db[_0xd581('0x34')][_0xd581('0x127')](db[_0xd581('0x37')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xd581('0x34')][_0xd581('0x127')](db['CloudProvider'],{'as':_0xd581('0x160'),'foreignKey':_0xd581('0x161'),'onDelete':_0xd581('0x162')});db[_0xd581('0x36')]['belongsTo'](db[_0xd581('0x37')],{'as':'MailAccount','foreignKey':_0xd581('0x163')});db['MailServerOut'][_0xd581('0x127')](db[_0xd581('0x160')],{'as':_0xd581('0x160'),'foreignKey':_0xd581('0x161'),'onDelete':_0xd581('0x162')});db['MailAccount'][_0xd581('0x115')](db[_0xd581('0x34')],{'as':'Imap','onDelete':_0xd581('0x116')});db[_0xd581('0x37')][_0xd581('0x115')](db[_0xd581('0x36')],{'as':_0xd581('0x164'),'onDelete':'cascade'});db[_0xd581('0x37')]['hasMany'](db[_0xd581('0x7f')],{'as':_0xd581('0x165'),'foreignKey':_0xd581('0x163'),'onDelete':_0xd581('0x116')});db[_0xd581('0x37')][_0xd581('0x119')](db[_0xd581('0x7d')],{'as':_0xd581('0x166'),'foreignKey':_0xd581('0x163')});db[_0xd581('0x37')]['hasMany'](db['MailMessage'],{'as':_0xd581('0x15a'),'foreignKey':'MailAccountId'});db[_0xd581('0x37')]['hasMany'](db[_0xd581('0x123')],{'as':_0xd581('0x167')});db[_0xd581('0x37')][_0xd581('0x119')](db[_0xd581('0x3e')],{'as':_0xd581('0x14c')});db[_0xd581('0x37')][_0xd581('0x127')](db[_0xd581('0xf6')],{'as':_0xd581('0x168'),'foreignKey':'ListId'});db[_0xd581('0x37')][_0xd581('0x127')](db[_0xd581('0x91')],{'as':_0xd581('0x91'),'foreignKey':_0xd581('0x169')});db[_0xd581('0x37')][_0xd581('0x127')](db[_0xd581('0x84')],{'as':_0xd581('0x155'),'foreignKey':_0xd581('0x156')});db[_0xd581('0x37')][_0xd581('0x128')](db[_0xd581('0x114')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0xd581('0x137')][_0xd581('0x128')](db[_0xd581('0x114')],{'as':_0xd581('0x158'),'through':'UserMailQueue'});db['MailQueue'][_0xd581('0x128')](db['Team'],{'through':_0xd581('0x16a'),'as':_0xd581('0x16b')});db['MailInteraction'][_0xd581('0x119')](db[_0xd581('0x3c')],{'as':_0xd581('0x15a'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x16c')});db['MailInteraction'][_0xd581('0x127')](db[_0xd581('0x37')],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x163')});db[_0xd581('0x123')][_0xd581('0x127')](db[_0xd581('0x6e')],{'as':_0xd581('0x16e'),'foreignKey':'ContactId'});db['MailInteraction'][_0xd581('0x127')](db[_0xd581('0x114')],{'as':_0xd581('0x16f'),'foreignKey':'UserId'});db[_0xd581('0x123')][_0xd581('0x128')](db[_0xd581('0x8b')],{'through':_0xd581('0x170'),'as':'Tags'});db[_0xd581('0x123')][_0xd581('0x128')](db[_0xd581('0x8b')],{'through':'mail_interaction_has_tags','as':_0xd581('0x171')});db[_0xd581('0x123')]['belongsToMany'](db[_0xd581('0x114')],{'as':'Users','through':_0xd581('0x130'),'foreignKey':_0xd581('0x16c')});db[_0xd581('0x3c')][_0xd581('0x119')](db[_0xd581('0xea')],{'as':_0xd581('0x172'),'onDelete':_0xd581('0x116')});db[_0xd581('0x3c')][_0xd581('0x127')](db[_0xd581('0x114')],{'as':'User'});db[_0xd581('0x3c')][_0xd581('0x127')](db[_0xd581('0x6e')],{'onDelete':_0xd581('0x116'),'as':'Contact'});db['MailMessage']['belongsTo'](db[_0xd581('0x123')],{'as':_0xd581('0x173'),'foreignKey':_0xd581('0x16c')});db[_0xd581('0x3c')][_0xd581('0x127')](db[_0xd581('0x37')],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x163')});db[_0xd581('0x3c')][_0xd581('0x127')](db[_0xd581('0x5e')],{'as':_0xd581('0x5e'),'foreignKey':_0xd581('0x174')});db[_0xd581('0x3c')]['belongsTo'](db[_0xd581('0x175')],{'as':_0xd581('0x175'),'foreignKey':_0xd581('0x176')});db[_0xd581('0x3e')]['belongsTo'](db[_0xd581('0x114')],{'onDelete':_0xd581('0x162')});db[_0xd581('0x3e')][_0xd581('0x127')](db[_0xd581('0x137')],{'onDelete':_0xd581('0x162')});db['MailApplication'][_0xd581('0x127')](db[_0xd581('0x37')],{'onDelete':_0xd581('0x162')});db['MailApplication'][_0xd581('0x127')](db[_0xd581('0x82')],{'onDelete':_0xd581('0x162'),'foreignKey':_0xd581('0x154')});db[_0xd581('0x3e')]['belongsTo'](db['Tag'],{'onDelete':_0xd581('0x162'),'foreignKey':_0xd581('0x177')});db['MailQueueReport'][_0xd581('0x127')](db[_0xd581('0x37')],{});db[_0xd581('0x40')][_0xd581('0x127')](db['CmList'],{'as':_0xd581('0x168'),'foreignKey':_0xd581('0x178')});db[_0xd581('0x40')][_0xd581('0x127')](db['CmContact'],{'as':_0xd581('0x16e'),'foreignKey':'ContactId'});db['MailQueueReport'][_0xd581('0x127')](db[_0xd581('0x123')],{});db[_0xd581('0x40')][_0xd581('0x127')](db['MailMessage'],{});db['MailQueueReport'][_0xd581('0x127')](db[_0xd581('0x114')],{});db['MailQueueReport'][_0xd581('0x127')](db[_0xd581('0x137')],{});db[_0xd581('0x42')][_0xd581('0x119')](db['DashboardItem'],{'as':'Items','onDelete':'cascade'});db[_0xd581('0x45')][_0xd581('0x119')](db['Disposition'],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':'cascade'});db[_0xd581('0x45')][_0xd581('0x119')](db[_0xd581('0x7d')],{'as':'Answers','foreignKey':'FaxAccountId'});db['FaxAccount'][_0xd581('0x119')](db[_0xd581('0x49')],{'as':'Interactions'});db[_0xd581('0x45')]['hasMany'](db['FaxApplication'],{'as':_0xd581('0x14c')});db[_0xd581('0x45')]['hasMany'](db[_0xd581('0x17')],{'as':'Exntensions','onDelete':_0xd581('0x116')});db[_0xd581('0x45')][_0xd581('0x119')](db[_0xd581('0x179')],{'as':_0xd581('0x15a')});db[_0xd581('0x45')][_0xd581('0x127')](db[_0xd581('0x28')],{'as':_0xd581('0x28')});db[_0xd581('0x45')][_0xd581('0x127')](db[_0xd581('0xf6')],{'as':_0xd581('0x168'),'foreignKey':_0xd581('0x178')});db[_0xd581('0x45')][_0xd581('0x127')](db[_0xd581('0x84')],{'as':_0xd581('0x155'),'foreignKey':_0xd581('0x156')});db['FaxAccount'][_0xd581('0x128')](db[_0xd581('0x114')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0xd581('0x47')]['belongsTo'](db['User'],{'onDelete':'restrict'});db['FaxApplication'][_0xd581('0x127')](db[_0xd581('0x4c')],{'onDelete':_0xd581('0x162')});db['FaxApplication'][_0xd581('0x127')](db[_0xd581('0x45')],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db[_0xd581('0x8b')],{'onDelete':_0xd581('0x162'),'foreignKey':_0xd581('0x177')});db[_0xd581('0x49')][_0xd581('0x119')](db['FaxMessage'],{'as':_0xd581('0x15a'),'onDelete':_0xd581('0x116'),'foreignKey':'FaxInteractionId'});db[_0xd581('0x49')]['belongsTo'](db[_0xd581('0x45')],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x17a')});db[_0xd581('0x49')][_0xd581('0x127')](db[_0xd581('0x6e')],{'as':_0xd581('0x16e'),'foreignKey':_0xd581('0x17b')});db[_0xd581('0x49')][_0xd581('0x127')](db[_0xd581('0x114')],{'as':_0xd581('0x16f'),'foreignKey':_0xd581('0x117')});db[_0xd581('0x49')][_0xd581('0x128')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0xd581('0x17c')});db[_0xd581('0x49')][_0xd581('0x128')](db[_0xd581('0x8b')],{'through':_0xd581('0x17d'),'as':_0xd581('0x171')});db['FaxInteraction'][_0xd581('0x128')](db[_0xd581('0x114')],{'as':'Users','through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0xd581('0x179')][_0xd581('0x127')](db[_0xd581('0x114')],{'onDelete':_0xd581('0x116'),'as':_0xd581('0x114')});db[_0xd581('0x179')][_0xd581('0x127')](db[_0xd581('0x49')],{'as':_0xd581('0x173'),'foreignKey':_0xd581('0x17e')});db[_0xd581('0x179')][_0xd581('0x127')](db[_0xd581('0x6e')],{'onDelete':_0xd581('0x116'),'as':'Contact'});db[_0xd581('0x179')][_0xd581('0x127')](db[_0xd581('0xea')],{'as':_0xd581('0xea'),'foreignKey':_0xd581('0x17f')});db[_0xd581('0x179')][_0xd581('0x127')](db[_0xd581('0x45')],{'as':_0xd581('0x16d'),'foreignKey':'FaxAccountId'});db[_0xd581('0x4c')][_0xd581('0x128')](db['User'],{'as':_0xd581('0x158'),'through':_0xd581('0x32')});db[_0xd581('0x4c')][_0xd581('0x128')](db[_0xd581('0x12e')],{'through':_0xd581('0x180'),'as':_0xd581('0x16b')});db[_0xd581('0x4e')]['belongsTo'](db[_0xd581('0x45')],{});db['FaxQueueReport'][_0xd581('0x127')](db[_0xd581('0xf6')],{'as':_0xd581('0x168'),'foreignKey':_0xd581('0x178')});db['FaxQueueReport'][_0xd581('0x127')](db[_0xd581('0x6e')],{'as':_0xd581('0x16e'),'foreignKey':_0xd581('0x17b')});db[_0xd581('0x4e')]['belongsTo'](db['FaxInteraction'],{});db['FaxQueueReport'][_0xd581('0x127')](db[_0xd581('0x179')],{});db[_0xd581('0x4e')][_0xd581('0x127')](db[_0xd581('0x114')],{});db[_0xd581('0x4e')][_0xd581('0x127')](db[_0xd581('0x4c')],{});db[_0xd581('0x50')]['hasMany'](db[_0xd581('0x7f')],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':_0xd581('0x116')});db[_0xd581('0x50')][_0xd581('0x119')](db['CannedAnswer'],{'as':_0xd581('0x166'),'foreignKey':_0xd581('0x181')});db[_0xd581('0x50')][_0xd581('0x119')](db[_0xd581('0x55')],{'as':_0xd581('0x15a'),'foreignKey':_0xd581('0x181')});db['SmsAccount']['hasMany'](db['SmsInteraction'],{'as':'Interactions'});db[_0xd581('0x50')][_0xd581('0x119')](db[_0xd581('0x52')],{'as':'Applications'});db[_0xd581('0x50')][_0xd581('0x127')](db[_0xd581('0xf6')],{'as':'List','foreignKey':_0xd581('0x178')});db['SmsAccount'][_0xd581('0x127')](db[_0xd581('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0xd581('0x156')});db[_0xd581('0x50')]['belongsToMany'](db[_0xd581('0x114')],{'as':'Agents','through':_0xd581('0x148')});db[_0xd581('0x52')][_0xd581('0x127')](db[_0xd581('0x114')],{'onDelete':_0xd581('0x162')});db['SmsApplication']['belongsTo'](db['SmsQueue'],{'onDelete':_0xd581('0x162')});db[_0xd581('0x52')][_0xd581('0x127')](db[_0xd581('0x50')],{'onDelete':'restrict'});db[_0xd581('0x52')][_0xd581('0x127')](db[_0xd581('0x82')],{'onDelete':_0xd581('0x162'),'foreignKey':_0xd581('0x154')});db[_0xd581('0x52')]['belongsTo'](db[_0xd581('0x8b')],{'onDelete':_0xd581('0x162'),'foreignKey':'TagId'});db[_0xd581('0x121')][_0xd581('0x119')](db[_0xd581('0x55')],{'as':_0xd581('0x15a'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0xd581('0x121')][_0xd581('0x127')](db[_0xd581('0x50')],{'as':'Account','foreignKey':_0xd581('0x181')});db['SmsInteraction'][_0xd581('0x127')](db[_0xd581('0x6e')],{'as':'Contact','foreignKey':_0xd581('0x17b')});db[_0xd581('0x121')][_0xd581('0x127')](db['User'],{'as':_0xd581('0x16f'),'foreignKey':_0xd581('0x117')});db[_0xd581('0x121')][_0xd581('0x128')](db[_0xd581('0x8b')],{'through':_0xd581('0x182'),'as':_0xd581('0x17c')});db[_0xd581('0x121')][_0xd581('0x128')](db[_0xd581('0x8b')],{'through':_0xd581('0x182'),'as':_0xd581('0x171')});db['SmsInteraction'][_0xd581('0x128')](db[_0xd581('0x114')],{'as':_0xd581('0x183'),'through':_0xd581('0x133'),'foreignKey':_0xd581('0x184')});db[_0xd581('0x55')][_0xd581('0x127')](db[_0xd581('0x114')],{'as':_0xd581('0x114')});db[_0xd581('0x55')][_0xd581('0x127')](db[_0xd581('0x6e')],{'onDelete':_0xd581('0x116'),'as':_0xd581('0x16e')});db[_0xd581('0x55')]['belongsTo'](db[_0xd581('0x121')],{'onDelete':_0xd581('0x116'),'as':'Interaction','foreignKey':_0xd581('0x184')});db[_0xd581('0x55')][_0xd581('0x127')](db[_0xd581('0x50')],{'as':'Account','foreignKey':_0xd581('0x181')});db[_0xd581('0x56')]['belongsToMany'](db[_0xd581('0x114')],{'as':'Agents','through':_0xd581('0x13b'),'foreignKey':_0xd581('0x185')});db['SmsQueue']['belongsToMany'](db['Team'],{'through':'team_has_sms_queues','as':_0xd581('0x16b')});db[_0xd581('0x57')]['hasMany'](db[_0xd581('0x7f')],{'as':_0xd581('0x165'),'foreignKey':_0xd581('0x186'),'onDelete':'cascade'});db['OpenchannelAccount'][_0xd581('0x119')](db[_0xd581('0x7d')],{'as':'Answers','foreignKey':_0xd581('0x186')});db[_0xd581('0x57')][_0xd581('0x119')](db[_0xd581('0x5a')],{'as':'Interactions','foreignKey':_0xd581('0x186')});db['OpenchannelAccount']['hasMany'](db[_0xd581('0x5c')],{'as':_0xd581('0x15a'),'foreignKey':_0xd581('0x186')});db[_0xd581('0x57')]['hasMany'](db[_0xd581('0x58')],{'as':_0xd581('0x14c'),'foreignKey':_0xd581('0x186')});db[_0xd581('0x57')][_0xd581('0x127')](db[_0xd581('0xf6')],{'as':_0xd581('0x168'),'foreignKey':_0xd581('0x178')});db[_0xd581('0x57')][_0xd581('0x127')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xd581('0x156')});db[_0xd581('0x57')][_0xd581('0x128')](db['User'],{'as':_0xd581('0x158'),'through':_0xd581('0x146')});db[_0xd581('0x58')]['belongsTo'](db[_0xd581('0x114')],{'onDelete':_0xd581('0x162')});db[_0xd581('0x58')][_0xd581('0x127')](db[_0xd581('0x5d')],{'onDelete':_0xd581('0x162'),'foreignKey':_0xd581('0x187')});db[_0xd581('0x58')][_0xd581('0x127')](db[_0xd581('0x57')],{'onDelete':'restrict','foreignKey':_0xd581('0x186')});db[_0xd581('0x58')]['belongsTo'](db['Interval'],{'onDelete':_0xd581('0x162'),'foreignKey':_0xd581('0x154')});db['OpenchannelApplication'][_0xd581('0x127')](db[_0xd581('0x8b')],{'onDelete':_0xd581('0x162'),'foreignKey':_0xd581('0x177')});db[_0xd581('0x5a')]['hasMany'](db[_0xd581('0x5c')],{'as':_0xd581('0x15a'),'onDelete':'cascade','foreignKey':_0xd581('0x188')});db[_0xd581('0x5a')][_0xd581('0x127')](db[_0xd581('0x57')],{'as':_0xd581('0x16d'),'foreignKey':'OpenchannelAccountId'});db[_0xd581('0x5a')][_0xd581('0x127')](db['CmContact'],{'as':_0xd581('0x16e'),'foreignKey':_0xd581('0x17b')});db[_0xd581('0x5a')][_0xd581('0x127')](db[_0xd581('0x114')],{'as':_0xd581('0x16f'),'foreignKey':'UserId'});db[_0xd581('0x5a')][_0xd581('0x128')](db['Tag'],{'through':_0xd581('0x189'),'as':_0xd581('0x17c')});db[_0xd581('0x5a')][_0xd581('0x128')](db['Tag'],{'through':_0xd581('0x189'),'as':_0xd581('0x171')});db[_0xd581('0x5a')][_0xd581('0x128')](db[_0xd581('0x114')],{'as':_0xd581('0x183'),'through':_0xd581('0x134'),'foreignKey':'OpenchannelInteractionId'});db[_0xd581('0x5c')]['belongsTo'](db[_0xd581('0x114')],{'onDelete':_0xd581('0x116'),'as':_0xd581('0x114')});db['OpenchannelMessage'][_0xd581('0x127')](db['CmContact'],{'onDelete':_0xd581('0x116'),'as':'Contact'});db[_0xd581('0x5c')][_0xd581('0x127')](db[_0xd581('0x5a')],{'onDelete':_0xd581('0x116'),'as':_0xd581('0x173'),'foreignKey':_0xd581('0x188')});db[_0xd581('0x5c')][_0xd581('0x127')](db['Attachment'],{'as':_0xd581('0xea'),'foreignKey':_0xd581('0x17f')});db[_0xd581('0x5c')][_0xd581('0x127')](db[_0xd581('0x57')],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x186')});db['OpenchannelQueue'][_0xd581('0x128')](db[_0xd581('0x114')],{'as':_0xd581('0x158'),'through':_0xd581('0x13d'),'foreignKey':_0xd581('0x187')});db['OpenchannelQueue'][_0xd581('0x128')](db[_0xd581('0x12e')],{'through':_0xd581('0x18a'),'as':'Teams'});db[_0xd581('0x5e')][_0xd581('0x119')](db[_0xd581('0x7f')],{'as':_0xd581('0x165'),'foreignKey':_0xd581('0x174'),'onDelete':_0xd581('0x116')});db[_0xd581('0x5e')][_0xd581('0x119')](db[_0xd581('0x7d')],{'as':_0xd581('0x166'),'foreignKey':_0xd581('0x174')});db[_0xd581('0x5e')][_0xd581('0x119')](db[_0xd581('0x6a')],{'as':_0xd581('0x18b')});db[_0xd581('0x5e')][_0xd581('0x119')](db['ChatInteraction'],{'as':_0xd581('0x167')});db[_0xd581('0x5e')][_0xd581('0x119')](db[_0xd581('0x18c')],{'as':_0xd581('0x14c')});db[_0xd581('0x5e')]['hasMany'](db['ChatMessage'],{'as':_0xd581('0x15a')});db[_0xd581('0x5e')][_0xd581('0x127')](db[_0xd581('0xf6')],{'as':_0xd581('0x168'),'foreignKey':_0xd581('0x178')});db[_0xd581('0x5e')][_0xd581('0x127')](db[_0xd581('0x82')],{'as':_0xd581('0x82'),'foreignKey':_0xd581('0x154')});db[_0xd581('0x5e')]['belongsTo'](db[_0xd581('0x37')],{'as':'MailAccount','foreignKey':_0xd581('0x163')});db[_0xd581('0x5e')][_0xd581('0x127')](db['Pause'],{'as':_0xd581('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd581('0x5e')]['belongsToMany'](db['User'],{'as':_0xd581('0x158'),'through':_0xd581('0x18d')});db['OpenchannelQueueReport'][_0xd581('0x127')](db[_0xd581('0x57')],{});db[_0xd581('0x60')][_0xd581('0x127')](db['CmList'],{'as':_0xd581('0x168'),'foreignKey':_0xd581('0x178')});db['OpenchannelQueueReport'][_0xd581('0x127')](db[_0xd581('0x6e')],{'as':_0xd581('0x16e'),'foreignKey':'ContactId'});db[_0xd581('0x60')][_0xd581('0x127')](db[_0xd581('0x5a')],{});db[_0xd581('0x60')][_0xd581('0x127')](db[_0xd581('0x5c')],{});db[_0xd581('0x60')][_0xd581('0x127')](db[_0xd581('0x114')],{});db['OpenchannelQueueReport'][_0xd581('0x127')](db[_0xd581('0x5d')],{});db[_0xd581('0x18c')][_0xd581('0x127')](db[_0xd581('0x114')],{'as':_0xd581('0x18e'),'foreignKey':_0xd581('0x117'),'onDelete':'restrict'});db[_0xd581('0x18c')][_0xd581('0x127')](db[_0xd581('0x67')],{'as':_0xd581('0x18f'),'foreignKey':_0xd581('0x190'),'onDelete':'restrict'});db[_0xd581('0x18c')][_0xd581('0x127')](db[_0xd581('0x5e')],{'as':_0xd581('0x191'),'foreignKey':'ChatWebsiteId','onDelete':_0xd581('0x162')});db[_0xd581('0x18c')][_0xd581('0x127')](db[_0xd581('0x8b')],{'onDelete':_0xd581('0x162'),'foreignKey':_0xd581('0x177')});db[_0xd581('0x63')][_0xd581('0x119')](db[_0xd581('0x65')],{'as':_0xd581('0x15a'),'onDelete':'cascade','foreignKey':_0xd581('0x192')});db[_0xd581('0x63')]['belongsTo'](db['ChatWebsite'],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x174')});db[_0xd581('0x63')][_0xd581('0x127')](db[_0xd581('0x6e')],{'as':'Contact','foreignKey':_0xd581('0x17b')});db[_0xd581('0x63')][_0xd581('0x127')](db[_0xd581('0x114')],{'as':_0xd581('0x16f'),'foreignKey':_0xd581('0x117')});db['ChatInteraction'][_0xd581('0x128')](db['Tag'],{'through':_0xd581('0x193'),'as':'Tags'});db[_0xd581('0x63')][_0xd581('0x128')](db[_0xd581('0x8b')],{'through':'chat_interaction_has_tags','as':_0xd581('0x171')});db['ChatInteraction']['belongsToMany'](db[_0xd581('0x114')],{'as':_0xd581('0x183'),'through':_0xd581('0x131'),'foreignKey':_0xd581('0x192')});db[_0xd581('0x65')][_0xd581('0x127')](db[_0xd581('0x114')],{'onDelete':_0xd581('0x116'),'as':_0xd581('0x114')});db['ChatMessage']['belongsTo'](db[_0xd581('0x6e')],{'onDelete':_0xd581('0x116'),'as':_0xd581('0x16e'),'foreignKey':'ContactId'});db[_0xd581('0x65')]['belongsTo'](db[_0xd581('0x63')],{'onDelete':_0xd581('0x116'),'as':_0xd581('0x173'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xd581('0x127')](db[_0xd581('0xea')],{'as':_0xd581('0xea'),'foreignKey':_0xd581('0x17f')});db[_0xd581('0x65')][_0xd581('0x127')](db['ChatWebsite'],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x174')});db['ChatOfflineMessage'][_0xd581('0x119')](db[_0xd581('0xea')],{'as':_0xd581('0x172'),'foreignKey':_0xd581('0x176'),'onDelete':'cascade','hooks':!![]});db['ChatOfflineMessage'][_0xd581('0x127')](db[_0xd581('0x6e')],{'onDelete':_0xd581('0x116'),'as':_0xd581('0x16e'),'foreignKey':_0xd581('0x17b')});db[_0xd581('0x175')][_0xd581('0x127')](db[_0xd581('0x5e')],{'as':_0xd581('0x16d'),'foreignKey':'ChatWebsiteId'});db[_0xd581('0x67')][_0xd581('0x128')](db[_0xd581('0x114')],{'as':_0xd581('0x158'),'through':'UserChatQueue','hooks':!![]});db[_0xd581('0x67')][_0xd581('0x128')](db[_0xd581('0x12e')],{'through':_0xd581('0x194'),'as':_0xd581('0x16b')});db[_0xd581('0x68')][_0xd581('0x119')](db[_0xd581('0xd0')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0xd581('0x116')});db[_0xd581('0x68')][_0xd581('0x128')](db[_0xd581('0x114')],{'as':_0xd581('0x195'),'through':_0xd581('0x12a')});db[_0xd581('0x6a')]['belongsTo'](db['ChatWebsite'],{'as':_0xd581('0x191'),'foreignKey':_0xd581('0x174')});db[_0xd581('0x6c')][_0xd581('0x119')](db[_0xd581('0x6e')],{'as':_0xd581('0x12b'),'foreignKey':_0xd581('0x196')});db[_0xd581('0x6e')][_0xd581('0x119')](db['CmContactHasItem'],{'as':_0xd581('0x197'),'foreignKey':_0xd581('0x198')});db[_0xd581('0x6e')][_0xd581('0x119')](db[_0xd581('0x70')],{'as':'Hoppers','foreignKey':_0xd581('0x17b')});db[_0xd581('0x6e')][_0xd581('0x119')](db[_0xd581('0x73')],{'as':_0xd581('0x11d'),'foreignKey':_0xd581('0x17b')});db[_0xd581('0x6e')][_0xd581('0x119')](db[_0xd581('0x75')],{'as':_0xd581('0x151'),'foreignKey':_0xd581('0x17b')});db[_0xd581('0x6e')][_0xd581('0x119')](db[_0xd581('0x77')],{'as':_0xd581('0x77'),'foreignKey':_0xd581('0x17b')});db[_0xd581('0x6e')][_0xd581('0x119')](db[_0xd581('0xd5')],{'as':_0xd581('0x199'),'foreignKey':_0xd581('0x17b')});db[_0xd581('0x6e')]['hasMany'](db[_0xd581('0x5a')],{'as':_0xd581('0x11f'),'foreignKey':_0xd581('0x17b'),'onDelete':_0xd581('0x162')});db[_0xd581('0x6e')][_0xd581('0x119')](db['ChatInteraction'],{'as':_0xd581('0x120'),'foreignKey':'ContactId','onDelete':_0xd581('0x162')});db[_0xd581('0x6e')][_0xd581('0x119')](db[_0xd581('0x121')],{'as':_0xd581('0x122'),'foreignKey':'ContactId','onDelete':_0xd581('0x162')});db[_0xd581('0x6e')][_0xd581('0x119')](db[_0xd581('0x49')],{'as':'FaxInteractions','foreignKey':_0xd581('0x17b'),'onDelete':'restrict'});db['CmContact']['hasMany'](db['MailInteraction'],{'as':_0xd581('0x124'),'foreignKey':_0xd581('0x17b'),'onDelete':_0xd581('0x162')});db[_0xd581('0x6e')][_0xd581('0x127')](db[_0xd581('0x6c')],{'as':'Company','foreignKey':_0xd581('0x196')});db[_0xd581('0x6e')][_0xd581('0x127')](db[_0xd581('0xf6')],{'as':_0xd581('0x168'),'foreignKey':_0xd581('0x178'),'onDelete':_0xd581('0x116')});db[_0xd581('0x6e')]['belongsToMany'](db[_0xd581('0x114')],{'as':_0xd581('0x183'),'through':_0xd581('0x12c')});db[_0xd581('0x6e')]['belongsToMany'](db[_0xd581('0x8b')],{'as':_0xd581('0x17c'),'through':_0xd581('0x19a')});db[_0xd581('0x6e')][_0xd581('0x128')](db[_0xd581('0x8b')],{'through':_0xd581('0x19a'),'as':_0xd581('0x171')});db['CmHopper'][_0xd581('0x119')](db['CmHopperAdditionalPhone'],{'as':_0xd581('0x19b'),'foreignKey':_0xd581('0x19c')});db[_0xd581('0x70')][_0xd581('0x127')](db[_0xd581('0x6e')],{'as':_0xd581('0x16e'),'foreignKey':_0xd581('0x17b'),'onDelete':_0xd581('0x116')});db['CmHopper'][_0xd581('0x127')](db['CmList'],{'as':_0xd581('0x168'),'foreignKey':_0xd581('0x178'),'onDelete':_0xd581('0x116')});db[_0xd581('0x70')][_0xd581('0x127')](db['User'],{'as':_0xd581('0x18e'),'foreignKey':_0xd581('0x117')});db[_0xd581('0x70')][_0xd581('0x127')](db[_0xd581('0x1a')],{'as':_0xd581('0x18f'),'foreignKey':_0xd581('0x14f'),'onDelete':_0xd581('0x116')});db['CmHopper'][_0xd581('0x127')](db[_0xd581('0xe7')],{'as':_0xd581('0xe7'),'foreignKey':_0xd581('0x19d'),'onDelete':_0xd581('0x116')});db[_0xd581('0x70')][_0xd581('0x127')](db[_0xd581('0x114')],{'as':_0xd581('0x16f'),'foreignKey':_0xd581('0x19e')});db['CmHopperBlack'][_0xd581('0x127')](db[_0xd581('0x6e')],{'as':_0xd581('0x16e'),'foreignKey':_0xd581('0x17b'),'onDelete':'cascade'});db[_0xd581('0x72')]['belongsTo'](db[_0xd581('0xf6')],{'as':'List','foreignKey':_0xd581('0x178'),'onDelete':'cascade'});db[_0xd581('0x72')][_0xd581('0x127')](db[_0xd581('0x1a')],{'as':_0xd581('0x18f'),'foreignKey':_0xd581('0x14f'),'onDelete':_0xd581('0x116')});db[_0xd581('0x72')][_0xd581('0x127')](db[_0xd581('0xe7')],{'as':_0xd581('0xe7'),'foreignKey':_0xd581('0x19d'),'onDelete':'cascade'});db[_0xd581('0x7b')][_0xd581('0x119')](db[_0xd581('0x19f')],{'as':{'plural':_0xd581('0x1a0'),'singular':'OneAll'},'foreignKey':_0xd581('0x1a1'),'onDelete':_0xd581('0x116'),'hooks':!![]});db['Automation'][_0xd581('0x119')](db[_0xd581('0x19f')],{'as':{'plural':_0xd581('0x1a2'),'singular':_0xd581('0x1a3')},'foreignKey':_0xd581('0x1a4'),'onDelete':_0xd581('0x116'),'hooks':!![]});db[_0xd581('0x7b')][_0xd581('0x119')](db[_0xd581('0x79')],{'as':_0xd581('0x1a5'),'foreignKey':_0xd581('0x1a6'),'onDelete':_0xd581('0x116'),'hooks':!![]});db[_0xd581('0x7f')][_0xd581('0x119')](db[_0xd581('0x7f')],{'as':_0xd581('0x165'),'foreignKey':'ParentId','onDelete':_0xd581('0x116')});db['Interval'][_0xd581('0x119')](db[_0xd581('0x82')],{'as':_0xd581('0x1a7'),'foreignKey':_0xd581('0x154'),'onDelete':_0xd581('0x116'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xd581('0x17')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0xd581('0x162')});db['Interval'][_0xd581('0x119')](db[_0xd581('0x3e')],{'as':_0xd581('0x1a8'),'foreignKey':_0xd581('0x154')});db[_0xd581('0x82')][_0xd581('0x119')](db[_0xd581('0x18c')],{'as':_0xd581('0x1a9'),'foreignKey':_0xd581('0x154')});db[_0xd581('0x82')][_0xd581('0x119')](db[_0xd581('0x47')],{'as':_0xd581('0x1aa'),'foreignKey':_0xd581('0x154')});db[_0xd581('0x82')][_0xd581('0x119')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0xd581('0x154')});db['Schedule']['belongsTo'](db[_0xd581('0x37')],{});db[_0xd581('0x1ab')][_0xd581('0x127')](db['AnalyticDefaultReport'],{'foreignKey':_0xd581('0x1ac')});db[_0xd581('0x1ab')][_0xd581('0x127')](db[_0xd581('0x9b')],{'foreignKey':_0xd581('0x1ad')});db[_0xd581('0x89')][_0xd581('0x128')](db[_0xd581('0x18')],{'as':_0xd581('0x1ae'),'through':_0xd581('0x14e'),'onDelete':_0xd581('0x162')});db[_0xd581('0x8b')][_0xd581('0x128')](db['CmContact'],{'through':_0xd581('0x19a')});db[_0xd581('0x8b')][_0xd581('0x128')](db[_0xd581('0x63')],{'through':_0xd581('0x193')});db[_0xd581('0x8b')][_0xd581('0x128')](db['MailInteraction'],{'through':_0xd581('0x170')});db[_0xd581('0x8b')][_0xd581('0x128')](db[_0xd581('0x121')],{'through':_0xd581('0x182')});db[_0xd581('0x8b')][_0xd581('0x128')](db['FaxInteraction'],{'through':_0xd581('0x17d')});db[_0xd581('0x8b')][_0xd581('0x128')](db[_0xd581('0x5a')],{'through':_0xd581('0x189')});db['Tag']['belongsToMany'](db[_0xd581('0x102')],{'through':_0xd581('0x1af')});db[_0xd581('0x8f')][_0xd581('0x127')](db['ContactItemType'],{'as':_0xd581('0x1b0'),'foreignKey':_0xd581('0x1b1')});db[_0xd581('0x1b2')][_0xd581('0x127')](db[_0xd581('0x70')],{'as':_0xd581('0x1b3'),'foreignKey':_0xd581('0x19c')});db[_0xd581('0x8f')][_0xd581('0x127')](db['CmContact'],{'as':_0xd581('0x16e'),'foreignKey':_0xd581('0x198')});db[_0xd581('0x93')]['hasMany'](db[_0xd581('0x19f')],{'as':{'plural':_0xd581('0x1b4'),'singular':'AllCondition'},'foreignKey':_0xd581('0x1b5'),'onDelete':_0xd581('0x116'),'hooks':!![]});db['Trigger']['hasMany'](db[_0xd581('0x19f')],{'as':{'plural':_0xd581('0x1b6'),'singular':_0xd581('0x1b7')},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0xd581('0x93')]['hasMany'](db[_0xd581('0x79')],{'as':_0xd581('0x1a5'),'foreignKey':_0xd581('0x1b8'),'onDelete':_0xd581('0x116'),'hooks':!![]});db[_0xd581('0x9b')]['hasMany'](db[_0xd581('0x1b9')],{'as':_0xd581('0x1ba'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1ad'),'hooks':!![]});db[_0xd581('0x9c')][_0xd581('0x119')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0xd581('0x1bb')][_0xd581('0x119')](db[_0xd581('0x1b9')],{'as':_0xd581('0x1ba'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1bc')});db['AnalyticFieldReport'][_0xd581('0x127')](db['AnalyticMetric'],{'foreignKey':_0xd581('0x1bc')});db[_0xd581('0xa4')][_0xd581('0x119')](db[_0xd581('0xa6')],{'as':_0xd581('0x1bd'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1be')});db[_0xd581('0xa6')]['hasMany'](db['SalesforceField'],{'as':_0xd581('0x1bf'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1c0')});db['SalesforceConfiguration']['hasMany'](db[_0xd581('0xa8')],{'as':_0xd581('0x1c1'),'onDelete':_0xd581('0x116'),'foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xd581('0x119')](db['SalesforceField'],{'as':_0xd581('0x1ba'),'onDelete':_0xd581('0x116'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0xd581('0x127')](db[_0xd581('0xa4')],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x1be')});db[_0xd581('0xa8')][_0xd581('0x119')](db[_0xd581('0xa8')],{'as':'Subject','foreignKey':_0xd581('0x1c0')});db[_0xd581('0xa8')]['hasMany'](db[_0xd581('0xa8')],{'as':_0xd581('0x1c2'),'foreignKey':_0xd581('0x1c3')});db['SalesforceField'][_0xd581('0x119')](db['SalesforceField'],{'as':_0xd581('0x1c4'),'foreignKey':'FieldId'});db[_0xd581('0xa8')][_0xd581('0x127')](db[_0xd581('0x95')],{'as':'Variable','foreignKey':_0xd581('0x1c5')});db[_0xd581('0xa9')][_0xd581('0x119')](db['SugarcrmConfiguration'],{'as':_0xd581('0x1bd'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1be')});db[_0xd581('0xab')][_0xd581('0x119')](db[_0xd581('0x1c6')],{'as':'Subjects','onDelete':_0xd581('0x116'),'foreignKey':'SubjectId'});db[_0xd581('0xab')][_0xd581('0x119')](db['SugarcrmField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xd581('0x1c3')});db['SugarcrmConfiguration'][_0xd581('0x119')](db[_0xd581('0x1c6')],{'as':_0xd581('0x1ba'),'onDelete':'cascade','foreignKey':_0xd581('0x1c7')});db['SugarcrmConfiguration'][_0xd581('0x127')](db[_0xd581('0xa9')],{'as':_0xd581('0x16d'),'foreignKey':'AccountId'});db[_0xd581('0x1c6')][_0xd581('0x119')](db[_0xd581('0x1c6')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xd581('0x1c6')][_0xd581('0x119')](db[_0xd581('0x1c6')],{'as':_0xd581('0x1c2'),'foreignKey':_0xd581('0x1c3')});db[_0xd581('0x1c6')][_0xd581('0x119')](db[_0xd581('0x1c6')],{'as':_0xd581('0x1c4'),'foreignKey':_0xd581('0x1c7')});db[_0xd581('0x1c6')][_0xd581('0x127')](db[_0xd581('0x95')],{'as':_0xd581('0x95'),'foreignKey':'VariableId'});db[_0xd581('0xad')][_0xd581('0x119')](db[_0xd581('0xaf')],{'as':'Configurations','onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1be')});db[_0xd581('0xaf')]['hasMany'](db['DeskField'],{'as':'Subjects','onDelete':_0xd581('0x116'),'foreignKey':'SubjectId'});db[_0xd581('0xaf')][_0xd581('0x119')](db[_0xd581('0xb1')],{'as':_0xd581('0x1c1'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1c3')});db[_0xd581('0xaf')][_0xd581('0x119')](db[_0xd581('0xb1')],{'as':_0xd581('0x1ba'),'onDelete':'cascade','foreignKey':_0xd581('0x1c7')});db['DeskConfiguration'][_0xd581('0x127')](db[_0xd581('0xad')],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x1be')});db['DeskConfiguration'][_0xd581('0x128')](db['Tag'],{'through':_0xd581('0x1c8')});db[_0xd581('0xb1')][_0xd581('0x119')](db[_0xd581('0xb1')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xd581('0xb1')][_0xd581('0x119')](db[_0xd581('0xb1')],{'as':_0xd581('0x1c2'),'foreignKey':_0xd581('0x1c3')});db['DeskField'][_0xd581('0x119')](db[_0xd581('0xb1')],{'as':_0xd581('0x1c4'),'foreignKey':'FieldId'});db[_0xd581('0xb1')][_0xd581('0x127')](db[_0xd581('0x95')],{'as':_0xd581('0x95'),'foreignKey':_0xd581('0x1c5')});db['ZohoAccount'][_0xd581('0x119')](db[_0xd581('0xb3')],{'as':_0xd581('0x1bd'),'onDelete':'cascade','foreignKey':_0xd581('0x1be')});db[_0xd581('0xb3')][_0xd581('0x119')](db['ZohoField'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0xd581('0xb3')][_0xd581('0x119')](db['ZohoField'],{'as':_0xd581('0x1c1'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1c3')});db[_0xd581('0xb3')]['hasMany'](db['ZohoField'],{'as':_0xd581('0x1ba'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1c7')});db[_0xd581('0xb3')][_0xd581('0x127')](db[_0xd581('0x1c9')],{'as':_0xd581('0x16d'),'foreignKey':'AccountId'});db[_0xd581('0xb5')][_0xd581('0x119')](db[_0xd581('0xb5')],{'as':_0xd581('0x1ca'),'foreignKey':_0xd581('0x1c0')});db[_0xd581('0xb5')][_0xd581('0x119')](db[_0xd581('0xb5')],{'as':_0xd581('0x1c2'),'foreignKey':_0xd581('0x1c3')});db[_0xd581('0xb5')]['hasMany'](db[_0xd581('0xb5')],{'as':'Field','foreignKey':_0xd581('0x1c7')});db[_0xd581('0xb5')][_0xd581('0x127')](db['Variable'],{'as':'Variable','foreignKey':_0xd581('0x1c5')});db[_0xd581('0xb7')]['hasMany'](db[_0xd581('0xb9')],{'as':_0xd581('0x1bd'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1be')});db[_0xd581('0xb9')][_0xd581('0x119')](db[_0xd581('0xbb')],{'as':_0xd581('0x1bf'),'foreignKey':'SubjectId'});db[_0xd581('0xb9')][_0xd581('0x119')](db[_0xd581('0xbb')],{'as':_0xd581('0x1c1'),'foreignKey':_0xd581('0x1c3')});db['ZendeskConfiguration']['hasMany'](db[_0xd581('0xbb')],{'as':_0xd581('0x1ba'),'foreignKey':'FieldId'});db[_0xd581('0xb9')][_0xd581('0x127')](db[_0xd581('0xb7')],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x1be')});db[_0xd581('0xb9')][_0xd581('0x128')](db[_0xd581('0x8b')],{'through':_0xd581('0x1cb')});db[_0xd581('0xbb')][_0xd581('0x119')](db['ZendeskField'],{'as':_0xd581('0x1ca'),'foreignKey':_0xd581('0x1c0')});db[_0xd581('0xbb')]['hasMany'](db[_0xd581('0xbb')],{'as':_0xd581('0x1c2'),'foreignKey':_0xd581('0x1c3')});db[_0xd581('0xbb')][_0xd581('0x119')](db[_0xd581('0xbb')],{'as':_0xd581('0x1c4'),'foreignKey':_0xd581('0x1c7')});db['ZendeskField']['belongsTo'](db[_0xd581('0x95')],{'as':_0xd581('0x95'),'foreignKey':_0xd581('0x1c5')});db[_0xd581('0xbc')][_0xd581('0x119')](db['FreshdeskConfiguration'],{'as':_0xd581('0x1bd'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1be')});db[_0xd581('0xbd')]['hasMany'](db['FreshdeskField'],{'as':_0xd581('0x1bf'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1c0')});db[_0xd581('0xbd')][_0xd581('0x119')](db[_0xd581('0x1cc')],{'as':'Descriptions','onDelete':_0xd581('0x116'),'foreignKey':'DescriptionId'});db[_0xd581('0xbd')][_0xd581('0x119')](db['FreshdeskField'],{'as':'Fields','onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1c7')});db[_0xd581('0xbd')]['belongsTo'](db['FreshdeskAccount'],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x1be')});db[_0xd581('0xbd')][_0xd581('0x128')](db[_0xd581('0x8b')],{'through':_0xd581('0x1cd')});db[_0xd581('0x1cc')][_0xd581('0x119')](db[_0xd581('0x1cc')],{'as':_0xd581('0x1ca'),'foreignKey':_0xd581('0x1c0')});db[_0xd581('0x1cc')][_0xd581('0x119')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0xd581('0x1cc')][_0xd581('0x119')](db[_0xd581('0x1cc')],{'as':_0xd581('0x1c4'),'foreignKey':_0xd581('0x1c7')});db['FreshdeskField'][_0xd581('0x127')](db['Variable'],{'as':'Variable','foreignKey':_0xd581('0x1c5')});db[_0xd581('0x1ce')][_0xd581('0x119')](db[_0xd581('0xc0')],{'as':'Configurations','onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1be')});db['VtigerConfiguration'][_0xd581('0x119')](db['VtigerField'],{'as':_0xd581('0x1bf'),'foreignKey':_0xd581('0x1c0')});db[_0xd581('0xc0')]['hasMany'](db[_0xd581('0xc2')],{'as':_0xd581('0x1c1'),'foreignKey':_0xd581('0x1c3')});db[_0xd581('0xc0')][_0xd581('0x119')](db[_0xd581('0xc2')],{'as':_0xd581('0x1ba'),'foreignKey':_0xd581('0x1c7')});db[_0xd581('0xc0')]['belongsTo'](db['VtigerAccount'],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x1be')});db[_0xd581('0xc2')][_0xd581('0x119')](db['VtigerField'],{'as':_0xd581('0x1ca'),'foreignKey':_0xd581('0x1c0')});db[_0xd581('0xc2')][_0xd581('0x119')](db[_0xd581('0xc2')],{'as':_0xd581('0x1c2'),'foreignKey':_0xd581('0x1c3')});db[_0xd581('0xc2')]['hasMany'](db[_0xd581('0xc2')],{'as':_0xd581('0x1c4'),'foreignKey':_0xd581('0x1c7')});db[_0xd581('0xc2')][_0xd581('0x127')](db[_0xd581('0x95')],{'as':'Variable','foreignKey':_0xd581('0x1c5')});db[_0xd581('0x1cf')][_0xd581('0x119')](db[_0xd581('0x1d0')],{'as':'Configurations','onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1be')});db[_0xd581('0x1d0')]['hasMany'](db['ServicenowField'],{'as':'Subjects','foreignKey':_0xd581('0x1c0')});db[_0xd581('0x1d0')]['hasMany'](db[_0xd581('0x1d1')],{'as':_0xd581('0x1c1'),'foreignKey':_0xd581('0x1c3')});db[_0xd581('0x1d0')][_0xd581('0x119')](db[_0xd581('0x1d1')],{'as':_0xd581('0x1ba'),'foreignKey':'FieldId'});db[_0xd581('0x1d0')][_0xd581('0x127')](db[_0xd581('0x1cf')],{'as':_0xd581('0x16d'),'foreignKey':'AccountId'});db[_0xd581('0x1d1')][_0xd581('0x119')](db[_0xd581('0x1d1')],{'as':'Subject','foreignKey':_0xd581('0x1c0')});db['ServicenowField'][_0xd581('0x119')](db[_0xd581('0x1d1')],{'as':'Description','foreignKey':_0xd581('0x1c3')});db['ServicenowField'][_0xd581('0x119')](db[_0xd581('0x1d1')],{'as':_0xd581('0x1c4'),'foreignKey':'FieldId'});db[_0xd581('0x1d1')][_0xd581('0x127')](db['Variable'],{'as':_0xd581('0x95'),'foreignKey':_0xd581('0x1c5')});db[_0xd581('0x1d2')][_0xd581('0x119')](db[_0xd581('0x1d3')],{'as':_0xd581('0x1bd'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xd581('0x1d2')][_0xd581('0x127')](db[_0xd581('0x160')],{'as':_0xd581('0x160'),'foreignKey':_0xd581('0x161')});db[_0xd581('0x1d3')][_0xd581('0x119')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xd581('0x1c0')});db['Dynamics365Configuration'][_0xd581('0x119')](db[_0xd581('0xc8')],{'as':_0xd581('0x1c1'),'onDelete':'cascade','foreignKey':_0xd581('0x1c3')});db[_0xd581('0x1d3')][_0xd581('0x119')](db[_0xd581('0xc8')],{'as':_0xd581('0x1ba'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1c7')});db['Dynamics365Configuration']['belongsTo'](db['Dynamics365Account'],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x1be')});db[_0xd581('0xc8')][_0xd581('0x119')](db[_0xd581('0xc8')],{'as':_0xd581('0x1ca'),'foreignKey':_0xd581('0x1c0')});db[_0xd581('0xc8')][_0xd581('0x119')](db['Dynamics365Field'],{'as':_0xd581('0x1c2'),'foreignKey':_0xd581('0x1c3')});db[_0xd581('0xc8')][_0xd581('0x119')](db['Dynamics365Field'],{'as':'Field','foreignKey':_0xd581('0x1c7')});db[_0xd581('0xc8')][_0xd581('0x127')](db[_0xd581('0x95')],{'as':_0xd581('0x95'),'foreignKey':_0xd581('0x1c5')});db['FreshsalesAccount'][_0xd581('0x119')](db['FreshsalesConfiguration'],{'as':_0xd581('0x1bd'),'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1be')});db[_0xd581('0x1d4')]['hasMany'](db[_0xd581('0xca')],{'as':_0xd581('0x1bf'),'foreignKey':_0xd581('0x1c0')});db['FreshsalesConfiguration'][_0xd581('0x119')](db[_0xd581('0xca')],{'as':_0xd581('0x1c1'),'foreignKey':_0xd581('0x1c3')});db['FreshsalesConfiguration']['hasMany'](db[_0xd581('0xca')],{'as':'Fields','foreignKey':_0xd581('0x1c7')});db['FreshsalesConfiguration'][_0xd581('0x127')](db[_0xd581('0x1d5')],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x1be')});db[_0xd581('0xca')]['hasMany'](db['FreshsalesField'],{'as':_0xd581('0x1ca'),'foreignKey':_0xd581('0x1c0')});db[_0xd581('0xca')][_0xd581('0x119')](db[_0xd581('0xca')],{'as':'Description','foreignKey':_0xd581('0x1c3')});db[_0xd581('0xca')][_0xd581('0x119')](db[_0xd581('0xca')],{'as':'Field','foreignKey':_0xd581('0x1c7')});db[_0xd581('0xca')][_0xd581('0x127')](db[_0xd581('0x95')],{'as':_0xd581('0x95'),'foreignKey':'VariableId'});db[_0xd581('0xce')][_0xd581('0x127')](db[_0xd581('0x5e')],{});db['ChatQueueReport'][_0xd581('0x127')](db[_0xd581('0xf6')],{'as':_0xd581('0x168'),'foreignKey':_0xd581('0x178')});db[_0xd581('0xce')][_0xd581('0x127')](db['CmContact'],{'as':_0xd581('0x16e'),'foreignKey':'ContactId'});db[_0xd581('0xce')][_0xd581('0x127')](db['ChatInteraction'],{});db[_0xd581('0xce')][_0xd581('0x127')](db['ChatMessage'],{});db['ChatQueueReport'][_0xd581('0x127')](db[_0xd581('0x114')],{});db[_0xd581('0xce')][_0xd581('0x127')](db[_0xd581('0x67')],{});db['ChatInternalMessage'][_0xd581('0x127')](db[_0xd581('0x114')],{'onDelete':'cascade','foreignKey':_0xd581('0x1d6')});db[_0xd581('0xd0')][_0xd581('0x127')](db[_0xd581('0x114')],{'onDelete':_0xd581('0x116'),'foreignKey':_0xd581('0x1d7')});db[_0xd581('0xd5')][_0xd581('0x119')](db[_0xd581('0xd3')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xd581('0xd5')][_0xd581('0x119')](db[_0xd581('0xd2')],{'foreignKey':_0xd581('0x1d8'),'onDelete':_0xd581('0x116')});db[_0xd581('0xd6')][_0xd581('0x127')](db['SmsAccount'],{});db[_0xd581('0xd6')][_0xd581('0x127')](db[_0xd581('0xf6')],{'as':_0xd581('0x168'),'foreignKey':_0xd581('0x178')});db[_0xd581('0xd6')][_0xd581('0x127')](db['CmContact'],{'as':_0xd581('0x16e'),'foreignKey':_0xd581('0x17b')});db[_0xd581('0xd6')][_0xd581('0x127')](db[_0xd581('0x121')],{});db['SmsQueueReport']['belongsTo'](db['SmsMessage'],{});db[_0xd581('0xd6')][_0xd581('0x127')](db[_0xd581('0x114')],{});db['SmsQueueReport'][_0xd581('0x127')](db[_0xd581('0x56')],{});db[_0xd581('0xda')][_0xd581('0x119')](db[_0xd581('0xd5')],{'foreignKey':'ProjectId'});db[_0xd581('0xda')][_0xd581('0x119')](db[_0xd581('0xd3')],{'foreignKey':_0xd581('0x1d9')});db[_0xd581('0xda')][_0xd581('0x119')](db['JscriptyAnswerReport'],{'foreignKey':_0xd581('0x1d9')});db['Team']['belongsToMany'](db['User'],{'as':_0xd581('0x158'),'through':_0xd581('0x12f')});db['Team'][_0xd581('0x128')](db[_0xd581('0x1a')],{'through':_0xd581('0x10d'),'as':'VoiceQueues'});db['Team']['belongsToMany'](db[_0xd581('0x137')],{'through':_0xd581('0x16a'),'as':_0xd581('0x138')});db[_0xd581('0x12e')][_0xd581('0x128')](db[_0xd581('0x67')],{'through':_0xd581('0x194'),'as':_0xd581('0x1da')});db[_0xd581('0x12e')][_0xd581('0x128')](db[_0xd581('0x4c')],{'through':_0xd581('0x180'),'as':_0xd581('0x139')});db[_0xd581('0x12e')][_0xd581('0x128')](db[_0xd581('0x56')],{'through':_0xd581('0x1db'),'as':_0xd581('0x13a')});db[_0xd581('0x12e')][_0xd581('0x128')](db['OpenchannelQueue'],{'through':_0xd581('0x18a'),'as':_0xd581('0x13c')});db[_0xd581('0x12e')][_0xd581('0x128')](db[_0xd581('0x10a')],{'through':_0xd581('0x1dc'),'as':_0xd581('0x13e')});db[_0xd581('0x12e')][_0xd581('0x128')](db[_0xd581('0x1dd')],{'through':_0xd581('0x1de'),'as':_0xd581('0x136')});db['Campaign']['hasMany'](db[_0xd581('0x70')],{'as':_0xd581('0x150'),'foreignKey':'CampaignId'});db[_0xd581('0xe7')][_0xd581('0x119')](db[_0xd581('0x73')],{'as':_0xd581('0x11d'),'foreignKey':_0xd581('0x19d')});db['Campaign'][_0xd581('0x119')](db[_0xd581('0x75')],{'as':_0xd581('0x151'),'foreignKey':_0xd581('0x19d')});db[_0xd581('0xe7')][_0xd581('0x119')](db[_0xd581('0x72')],{'as':_0xd581('0x152'),'foreignKey':'CampaignId'});db[_0xd581('0xe7')][_0xd581('0x127')](db['Trunk'],{'as':_0xd581('0x28'),'foreignKey':_0xd581('0x1df')});db['Campaign']['belongsTo'](db['Trunk'],{'as':_0xd581('0x153'),'foreignKey':_0xd581('0x1e0')});db['Campaign']['belongsTo'](db[_0xd581('0x82')],{'as':_0xd581('0x82'),'foreignKey':_0xd581('0x154')});db[_0xd581('0xe7')][_0xd581('0x127')](db['SquareProject'],{'as':_0xd581('0xdf'),'foreignKey':_0xd581('0x1e1')});db[_0xd581('0xe7')]['belongsToMany'](db[_0xd581('0xf6')],{'as':_0xd581('0x12d'),'through':_0xd581('0x1e2')});db[_0xd581('0xe7')][_0xd581('0x128')](db[_0xd581('0xf6')],{'as':_0xd581('0x159'),'through':'campaigns_has_cm_blacklists'});db[_0xd581('0xea')][_0xd581('0x127')](db[_0xd581('0x175')],{'as':'ChatOfflineMessage','foreignKey':_0xd581('0x176')});db[_0xd581('0xee')][_0xd581('0x127')](db[_0xd581('0x3c')],{});db['MailTransferReport'][_0xd581('0x127')](db[_0xd581('0x123')],{});db[_0xd581('0xee')][_0xd581('0x127')](db[_0xd581('0x37')],{'foreignKey':'FromMailAccountId','as':_0xd581('0x1e3')});db[_0xd581('0xee')]['belongsTo'](db['User'],{'foreignKey':_0xd581('0x1e4'),'as':'FromAgent'});db['MailTransferReport'][_0xd581('0x127')](db[_0xd581('0x114')],{'foreignKey':'ToUserId','as':_0xd581('0x1e5')});db[_0xd581('0xee')]['belongsTo'](db['MailQueue'],{'foreignKey':_0xd581('0x1e6'),'as':'ToQueue'});db[_0xd581('0xee')][_0xd581('0x127')](db['MailAccount'],{'foreignKey':_0xd581('0x1e7'),'as':_0xd581('0x1e8')});db[_0xd581('0xef')][_0xd581('0x127')](db[_0xd581('0x65')],{});db[_0xd581('0xef')][_0xd581('0x127')](db[_0xd581('0x63')],{});db[_0xd581('0xef')][_0xd581('0x127')](db[_0xd581('0x5e')],{'foreignKey':_0xd581('0x1e9'),'as':_0xd581('0x1e3')});db[_0xd581('0xef')][_0xd581('0x127')](db[_0xd581('0x114')],{'foreignKey':_0xd581('0x1e4'),'as':_0xd581('0x1ea')});db['ChatTransferReport']['belongsTo'](db[_0xd581('0x114')],{'foreignKey':'ToUserId','as':_0xd581('0x1e5')});db[_0xd581('0xef')][_0xd581('0x127')](db[_0xd581('0x67')],{'foreignKey':_0xd581('0x1eb'),'as':_0xd581('0x1ec')});db[_0xd581('0xef')][_0xd581('0x127')](db['ChatWebsite'],{'foreignKey':_0xd581('0x1ed'),'as':'ToAccount'});db['FaxTransferReport'][_0xd581('0x127')](db[_0xd581('0x179')],{});db[_0xd581('0xf0')]['belongsTo'](db[_0xd581('0x49')],{});db['FaxTransferReport']['belongsTo'](db[_0xd581('0x45')],{'foreignKey':_0xd581('0x1ee'),'as':'FromAccount'});db[_0xd581('0xf0')][_0xd581('0x127')](db[_0xd581('0x114')],{'foreignKey':_0xd581('0x1e4'),'as':_0xd581('0x1ea')});db['FaxTransferReport'][_0xd581('0x127')](db[_0xd581('0x114')],{'foreignKey':_0xd581('0x1ef'),'as':_0xd581('0x1e5')});db[_0xd581('0xf0')][_0xd581('0x127')](db['FaxQueue'],{'foreignKey':_0xd581('0x1f0'),'as':_0xd581('0x1ec')});db[_0xd581('0xf0')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0xd581('0x1f1'),'as':_0xd581('0x1e8')});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelMessage'],{});db[_0xd581('0xf2')]['belongsTo'](db[_0xd581('0x5a')],{});db[_0xd581('0xf2')][_0xd581('0x127')](db[_0xd581('0x57')],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db[_0xd581('0xf2')][_0xd581('0x127')](db[_0xd581('0x114')],{'foreignKey':_0xd581('0x1e4'),'as':_0xd581('0x1ea')});db[_0xd581('0xf2')][_0xd581('0x127')](db[_0xd581('0x114')],{'foreignKey':'ToUserId','as':'ToAgent'});db['OpenchannelTransferReport'][_0xd581('0x127')](db[_0xd581('0x5d')],{'foreignKey':_0xd581('0x1f2'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0xd581('0x127')](db[_0xd581('0x57')],{'foreignKey':_0xd581('0x1f3'),'as':_0xd581('0x1e8')});db[_0xd581('0xf4')][_0xd581('0x127')](db[_0xd581('0x55')],{});db[_0xd581('0xf4')][_0xd581('0x127')](db[_0xd581('0x121')],{});db[_0xd581('0xf4')][_0xd581('0x127')](db[_0xd581('0x50')],{'foreignKey':_0xd581('0x1f4'),'as':_0xd581('0x1e3')});db[_0xd581('0xf4')][_0xd581('0x127')](db[_0xd581('0x114')],{'foreignKey':_0xd581('0x1e4'),'as':'FromAgent'});db[_0xd581('0xf4')]['belongsTo'](db[_0xd581('0x114')],{'foreignKey':_0xd581('0x1ef'),'as':_0xd581('0x1e5')});db[_0xd581('0xf4')]['belongsTo'](db[_0xd581('0x56')],{'foreignKey':'ToSmsQueueId','as':_0xd581('0x1ec')});db[_0xd581('0xf4')][_0xd581('0x127')](db[_0xd581('0x50')],{'foreignKey':_0xd581('0x1f5'),'as':_0xd581('0x1e8')});db[_0xd581('0xf6')][_0xd581('0x119')](db[_0xd581('0x7f')],{'as':_0xd581('0x165'),'foreignKey':_0xd581('0x178'),'onDelete':_0xd581('0x116')});db[_0xd581('0xf6')][_0xd581('0x119')](db[_0xd581('0x1f6')],{'as':'CustomFields','foreignKey':_0xd581('0x178')});db[_0xd581('0xf6')][_0xd581('0x119')](db[_0xd581('0x6e')],{'as':_0xd581('0x12b'),'onDelete':_0xd581('0x116'),'foreignKey':'ListId'});db[_0xd581('0xf6')]['hasMany'](db[_0xd581('0x73')],{'as':_0xd581('0x11d'),'foreignKey':_0xd581('0x178')});db[_0xd581('0xf6')]['hasMany'](db[_0xd581('0x75')],{'as':_0xd581('0x11e'),'foreignKey':_0xd581('0x178')});db['CmList'][_0xd581('0x119')](db[_0xd581('0x77')],{'as':_0xd581('0x77'),'foreignKey':'ListId'});db[_0xd581('0xf6')]['belongsToMany'](db[_0xd581('0x1a')],{'as':'Queues','through':_0xd581('0x157')});db[_0xd581('0xf6')][_0xd581('0x128')](db[_0xd581('0x114')],{'as':_0xd581('0x158'),'through':_0xd581('0x13f')});db[_0xd581('0x1dd')]['hasMany'](db[_0xd581('0x17')],{'as':_0xd581('0x11c'),'onDelete':_0xd581('0x116')});db[_0xd581('0x1dd')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xd581('0x110')});db[_0xd581('0x1dd')][_0xd581('0x128')](db[_0xd581('0x12e')],{'through':_0xd581('0x1de'),'as':_0xd581('0x16b')});db[_0xd581('0xf8')][_0xd581('0x119')](db[_0xd581('0x114')],{'as':_0xd581('0x183'),'foreignKey':_0xd581('0x1f7')});db[_0xd581('0xf8')][_0xd581('0x119')](db['UserProfileSection'],{'as':_0xd581('0x1f8'),'foreignKey':_0xd581('0x1f7'),'onDelete':_0xd581('0x116')});db[_0xd581('0x1f9')][_0xd581('0x119')](db['UserProfileResource'],{'as':'Resources','foreignKey':'sectionId','onDelete':_0xd581('0x116')});db[_0xd581('0xfe')][_0xd581('0x119')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xd581('0x1fa'),'onDelete':_0xd581('0x116')});db[_0xd581('0xfe')][_0xd581('0x119')](db[_0xd581('0x7d')],{'as':_0xd581('0x166'),'foreignKey':'WhatsappAccountId'});db[_0xd581('0xfe')]['hasMany'](db[_0xd581('0x104')],{'as':_0xd581('0x15a'),'foreignKey':_0xd581('0x1fa')});db['WhatsappAccount'][_0xd581('0x119')](db[_0xd581('0x102')],{'as':_0xd581('0x167')});db['WhatsappAccount']['hasMany'](db[_0xd581('0x100')],{'as':_0xd581('0x14c')});db['WhatsappAccount'][_0xd581('0x127')](db[_0xd581('0xf6')],{'as':_0xd581('0x168'),'foreignKey':'ListId'});db[_0xd581('0xfe')][_0xd581('0x127')](db[_0xd581('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0xd581('0x156')});db['WhatsappAccount'][_0xd581('0x128')](db[_0xd581('0x114')],{'as':_0xd581('0x158'),'through':_0xd581('0x14a')});db['WhatsappApplication'][_0xd581('0x127')](db[_0xd581('0x114')],{'onDelete':_0xd581('0x162')});db['WhatsappApplication'][_0xd581('0x127')](db[_0xd581('0x10a')],{'onDelete':_0xd581('0x162')});db[_0xd581('0x100')][_0xd581('0x127')](db['WhatsappAccount'],{'onDelete':_0xd581('0x162')});db[_0xd581('0x100')][_0xd581('0x127')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xd581('0x154')});db['WhatsappApplication'][_0xd581('0x127')](db[_0xd581('0x8b')],{'onDelete':_0xd581('0x162'),'foreignKey':_0xd581('0x177')});db[_0xd581('0x102')][_0xd581('0x119')](db['WhatsappMessage'],{'as':_0xd581('0x15a'),'onDelete':'cascade','foreignKey':_0xd581('0x1fb')});db['WhatsappInteraction'][_0xd581('0x127')](db[_0xd581('0xfe')],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x1fa')});db[_0xd581('0x102')][_0xd581('0x127')](db[_0xd581('0x6e')],{'as':_0xd581('0x16e'),'foreignKey':'ContactId'});db[_0xd581('0x102')][_0xd581('0x127')](db[_0xd581('0x114')],{'as':_0xd581('0x16f'),'foreignKey':_0xd581('0x117')});db[_0xd581('0x102')][_0xd581('0x128')](db[_0xd581('0x8b')],{'through':_0xd581('0x1af'),'as':_0xd581('0x17c')});db[_0xd581('0x102')][_0xd581('0x128')](db[_0xd581('0x8b')],{'through':_0xd581('0x1af'),'as':_0xd581('0x171')});db[_0xd581('0x102')][_0xd581('0x128')](db[_0xd581('0x114')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0xd581('0x1fb')});db['WhatsappMessage'][_0xd581('0x127')](db[_0xd581('0x114')],{'as':_0xd581('0x114')});db['WhatsappMessage'][_0xd581('0x127')](db[_0xd581('0x6e')],{'onDelete':_0xd581('0x116'),'as':_0xd581('0x16e')});db['WhatsappMessage'][_0xd581('0x127')](db[_0xd581('0x102')],{'onDelete':_0xd581('0x116'),'as':_0xd581('0x173'),'foreignKey':'WhatsappInteractionId'});db[_0xd581('0x104')][_0xd581('0x127')](db[_0xd581('0xfe')],{'as':_0xd581('0x16d'),'foreignKey':_0xd581('0x1fa')});db[_0xd581('0x106')][_0xd581('0x127')](db[_0xd581('0xfe')],{});db['WhatsappQueueReport']['belongsTo'](db['CmList'],{'as':_0xd581('0x168'),'foreignKey':_0xd581('0x178')});db['WhatsappQueueReport']['belongsTo'](db[_0xd581('0x6e')],{'as':_0xd581('0x16e'),'foreignKey':_0xd581('0x17b')});db['WhatsappQueueReport']['belongsTo'](db[_0xd581('0x102')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xd581('0x10a')],{});db[_0xd581('0x106')][_0xd581('0x127')](db['WhatsappMessage'],{});db[_0xd581('0x106')][_0xd581('0x127')](db['User'],{});db['WhatsappTransferReport'][_0xd581('0x127')](db[_0xd581('0x104')],{});db[_0xd581('0x108')][_0xd581('0x127')](db[_0xd581('0x102')],{});db[_0xd581('0x108')][_0xd581('0x127')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0xd581('0x1e3')});db[_0xd581('0x108')][_0xd581('0x127')](db[_0xd581('0xfe')],{'foreignKey':_0xd581('0x1fc'),'as':_0xd581('0x1e8')});db[_0xd581('0x108')][_0xd581('0x127')](db[_0xd581('0x10a')],{'foreignKey':_0xd581('0x1fd'),'as':_0xd581('0x1ec')});db[_0xd581('0x108')]['belongsTo'](db[_0xd581('0x114')],{'foreignKey':_0xd581('0x1e4'),'as':_0xd581('0x1ea')});db[_0xd581('0x108')][_0xd581('0x127')](db[_0xd581('0x114')],{'foreignKey':_0xd581('0x1ef'),'as':_0xd581('0x1e5')});db[_0xd581('0x10a')]['belongsToMany'](db[_0xd581('0x114')],{'as':_0xd581('0x158'),'through':_0xd581('0x33'),'foreignKey':_0xd581('0x1fe')});db[_0xd581('0x10a')][_0xd581('0x128')](db[_0xd581('0x12e')],{'through':_0xd581('0x1dc'),'as':'Teams'});db['UserSetting'][_0xd581('0x127')](db[_0xd581('0x114')],{'as':'user','foreignKey':_0xd581('0x117'),'onDelete':_0xd581('0x116'),'hooks':!![]});db[_0xd581('0x160')][_0xd581('0x115')](db['Dynamics365Account'],{'as':_0xd581('0x1d2'),'onDelete':'restrict'});db['CloudProvider'][_0xd581('0x115')](db['MailServerIn'],{'as':_0xd581('0x1ff'),'onDelete':_0xd581('0x162')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':_0xd581('0x164'),'onDelete':_0xd581('0x162')});module[_0xd581('0x200')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xfa35=['Items','FaxAccountId','Answers','Applications','Exntensions','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','Tags','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelMessage','OpenchannelInteractionId','Owner','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','ChatInteraction','Agent','Queue','Website','ChatMessage','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','ChatGroupId','Members','chat_group_has_users','Phones','CmContactId','Hoppers','Company','CompanyId','cm_contact_has_tags','AdditionalPhones','CmHopperId','Campaign','CampaignId','OneAll','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Sound','Mohs','moh_has_sounds','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','Condition','AnyConditions','TriggerId','Fields','CustomReportId','MetricId','SalesforceAccount','Configurations','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','DescriptionId','VariableId','SugarcrmConfiguration','Field','int_desk_configuration_has_tags','ZohoField','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','ServicenowAccount','Dynamics365Configuration','Dynamics365Account','Dynamics365Field','FreshsalesField','FromId','ToId','SessionId','ProjectId','TeamVoiceQueue','team_has_chat_queues','SmsQueues','team_has_whatsapp_queues','TeamVoicePrefix','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ChatTransferReport','FromChatWebsiteId','FromUserId','ToChatWebsiteId','ToAccount','FromFaxAccountId','FromAccount','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsAccountId','CustomFields','Queues','userProfileId','UserProfileSections','UserProfileSection','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','user_has_whatsapp_interactions','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','Imap','Smtp','../config/environment','sequelize','lodash','jstz','determine','motion2','xcall','xC@LL1234','127.0.0.1','name','utf8','utf8_general_ci','defaultsDeep','sequelizeHistory','mysql','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','Disposition','../api/disposition/disposition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','hasOne','VoiceMail','cascade','UserId','userSetting','hasMany','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_fax_interactions','SmsInteraction','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','VoicePrefixes','MailQueue','MailQueues','ChatQueues','UserChatQueue','FaxQueue','FaxQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','VoiceChanSpy','SpiedAgents','ChanSpyId','Sounds','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Team','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','CloudProviderId','restrict','MailServerOut','Dispositions','Interactions','TemplateId','mandatoryDispositionPauseId','Agents','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','Interaction','ChatWebsiteId','ChatOfflineMessage','TagId','List','ListId','Dashboard'];(function(_0x61b367,_0x34290a){var _0x529a1d=function(_0x231831){while(--_0x231831){_0x61b367['push'](_0x61b367['shift']());}};_0x529a1d(++_0x34290a);}(_0xfa35,0x92));var _0x5fa3=function(_0x6f041d,_0x4029b4){_0x6f041d=_0x6f041d-0x0;var _0x4609b8=_0xfa35[_0x6f041d];return _0x4609b8;};'use strict';var config=require(_0x5fa3('0x0'));var Sequelize=require(_0x5fa3('0x1'));var _=require(_0x5fa3('0x2'));var jstz=require(_0x5fa3('0x3'));var timezone=jstz[_0x5fa3('0x4')]();config['sequelize']=_['defaultsDeep'](config[_0x5fa3('0x1')],{'database':_0x5fa3('0x5'),'username':_0x5fa3('0x6'),'password':_0x5fa3('0x7'),'options':{'host':_0x5fa3('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x5fa3('0x9')](),'define':{'charset':_0x5fa3('0xa'),'collate':_0x5fa3('0xb')}}});config['sequelizeHistory']=_[_0x5fa3('0xc')](config[_0x5fa3('0xd')],{'database':'motion2','username':_0x5fa3('0x6'),'password':_0x5fa3('0x7'),'options':{'host':_0x5fa3('0x8'),'port':0xcea,'dialect':_0x5fa3('0xe'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x5fa3('0x9')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x5fa3('0x1')][_0x5fa3('0xf')],config['sequelize']['username'],config[_0x5fa3('0x1')]['password'],config[_0x5fa3('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x5fa3('0xd')]['database'],config[_0x5fa3('0xd')][_0x5fa3('0x10')],config[_0x5fa3('0xd')][_0x5fa3('0x11')],config[_0x5fa3('0xd')][_0x5fa3('0x12')])};db[_0x5fa3('0x13')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x15'));db['VoiceChanSpy']=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x16'));db[_0x5fa3('0x17')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/voiceContext/voiceContext.model');db[_0x5fa3('0x18')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x19'));db[_0x5fa3('0x1a')]=db['sequelize']['import'](_0x5fa3('0x1b'));db[_0x5fa3('0x1c')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x1d'));db[_0x5fa3('0x1e')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x1f'));db[_0x5fa3('0x20')]=db[_0x5fa3('0x1')]['import']('../api/screenRecording/screenRecording.model');db['VoiceMail']=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0x21'));db['VoiceMailMessage']=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x22'));db[_0x5fa3('0x23')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0x24'));db[_0x5fa3('0x25')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x26'));db[_0x5fa3('0x27')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x28'));db[_0x5fa3('0x29')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x2a'));db[_0x5fa3('0x2b')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/memberReport/memberReport.model');db[_0x5fa3('0x2c')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x2d'));db[_0x5fa3('0x2e')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x2f'));db['UserVoiceQueueRt']=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x5fa3('0x30')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/userVoiceQueue/userVoiceQueue.model');db['UserChatQueue']=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x31'));db[_0x5fa3('0x32')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x33'));db[_0x5fa3('0x34')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x35'));db[_0x5fa3('0x36')]=db[_0x5fa3('0x1')]['import']('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x5fa3('0x37')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x38'));db[_0x5fa3('0x39')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x3a'));db['MailServerOut']=db['sequelize']['import'](_0x5fa3('0x3b'));db[_0x5fa3('0x3c')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x3d'));db['MailQueue']=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x3e'));db[_0x5fa3('0x3f')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x40'));db[_0x5fa3('0x41')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/mailInteraction/mailInteraction.model');db[_0x5fa3('0x42')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x43'));db[_0x5fa3('0x44')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x45'));db[_0x5fa3('0x46')]=db[_0x5fa3('0x1')]['import']('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/dashboard/dashboard.model');db[_0x5fa3('0x47')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0x48'));db[_0x5fa3('0x49')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/faxAccount/faxAccount.model');db[_0x5fa3('0x4a')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0x4b'));db[_0x5fa3('0x4c')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/faxInteraction/faxInteraction.model');db[_0x5fa3('0x4d')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x4e'));db['FaxQueue']=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x4f'));db[_0x5fa3('0x50')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x51'));db[_0x5fa3('0x52')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x53'));db[_0x5fa3('0x54')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0x55'));db['SmsInteraction']=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x56'));db[_0x5fa3('0x57')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x58'));db[_0x5fa3('0x59')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0x5a'));db[_0x5fa3('0x5b')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x5c'));db[_0x5fa3('0x5d')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0x5e'));db[_0x5fa3('0x5f')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x60'));db['OpenchannelMessage']=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x61'));db[_0x5fa3('0x62')]=db['sequelize'][_0x5fa3('0x14')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x63'));db[_0x5fa3('0x64')]=db['sequelize']['import'](_0x5fa3('0x65'));db[_0x5fa3('0x66')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x67'));db['ChatInteraction']=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x68'));db['ChatMessage']=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x69'));db[_0x5fa3('0x6a')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x6b'));db[_0x5fa3('0x6c')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x6d'));db['ChatProactiveAction']=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0x6e'));db[_0x5fa3('0x6f')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x70'));db[_0x5fa3('0x71')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x72'));db[_0x5fa3('0x73')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x74'));db[_0x5fa3('0x75')]=db['sequelize'][_0x5fa3('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x5fa3('0x76')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x77'));db[_0x5fa3('0x78')]=db[_0x5fa3('0x1')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0x5fa3('0x79')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0x7a'));db[_0x5fa3('0x7b')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0x7c'));db[_0x5fa3('0x7d')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x7e'));db[_0x5fa3('0x7f')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/automation/automation.model');db[_0x5fa3('0x80')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/cannedAnswer/cannedAnswer.model');db[_0x5fa3('0x81')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x82'));db['Condition']=db[_0x5fa3('0x1')]['import']('../api/condition/condition.model');db[_0x5fa3('0x83')]=db['sequelize']['import'](_0x5fa3('0x84'));db[_0x5fa3('0x85')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x86'));db['Cdr']=db['sequelize']['import'](_0x5fa3('0x87'));db[_0x5fa3('0x88')]=db[_0x5fa3('0x1')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x5fa3('0x89')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x8a'));db['Sound']=db['sequelize'][_0x5fa3('0x14')]('../api/sound/sound.model');db[_0x5fa3('0x8b')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0x8c'));db[_0x5fa3('0x8d')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x8e'));db['CmContactHasItem']=db['sequelize'][_0x5fa3('0x14')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0x5fa3('0x8f')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x90'));db[_0x5fa3('0x91')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x92'));db[_0x5fa3('0x93')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x94'));db[_0x5fa3('0x95')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x96'));db['Integration']=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x97'));db[_0x5fa3('0x98')]=db['sequelize']['import'](_0x5fa3('0x99'));db[_0x5fa3('0x9a')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0x9b'));db[_0x5fa3('0x9c')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x9d'));db['AnalyticExtractedReport']=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0x9e'));db[_0x5fa3('0x9f')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xa0'));db[_0x5fa3('0xa1')]=db[_0x5fa3('0x1')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db[_0x5fa3('0xa2')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0xa3'));db['SalesforceAccount']=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xa4'));db[_0x5fa3('0xa5')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xa6'));db[_0x5fa3('0xa7')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xa8'));db[_0x5fa3('0xa9')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xaa'));db['SugarcrmConfiguration']=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0xab'));db[_0x5fa3('0xac')]=db[_0x5fa3('0x1')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0x5fa3('0xad')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xae'));db[_0x5fa3('0xaf')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xb0'));db[_0x5fa3('0xb1')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/intDeskField/intDeskField.model');db[_0x5fa3('0xb2')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0xb3'));db[_0x5fa3('0xb4')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xb5'));db['ZohoField']=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/intZohoField/intZohoField.model');db[_0x5fa3('0xb6')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xb7'));db[_0x5fa3('0xb8')]=db['sequelize']['import'](_0x5fa3('0xb9'));db[_0x5fa3('0xba')]=db['sequelize'][_0x5fa3('0x14')]('../api/intZendeskField/intZendeskField.model');db[_0x5fa3('0xbb')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0x5fa3('0x1')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x5fa3('0xbc')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xbd'));db[_0x5fa3('0xbe')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0xbf'));db[_0x5fa3('0xc0')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x5fa3('0xc1')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0xc2'));db[_0x5fa3('0xc3')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xc4'));db[_0x5fa3('0xc5')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xc6'));db['Dynamics365Account']=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db['sequelize']['import'](_0x5fa3('0xc7'));db['Dynamics365Field']=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xc8'));db[_0x5fa3('0xc9')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xca'));db[_0x5fa3('0xcb')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0xcc'));db['FreshsalesField']=db[_0x5fa3('0x1')]['import']('../api/intFreshsalesField/intFreshsalesField.model');db[_0x5fa3('0xcd')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0x97'));db[_0x5fa3('0xce')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0xcf'));db[_0x5fa3('0xd0')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0xd1'));db[_0x5fa3('0xd2')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0xd3'));db[_0x5fa3('0xd4')]=db['sequelize']['import'](_0x5fa3('0xd5'));db[_0x5fa3('0xd6')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x5fa3('0xd7')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0xd8'));db[_0x5fa3('0xd9')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/smsQueueReport/smsQueueReport.model');db[_0x5fa3('0xda')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/squareReport/squareReport.model');db[_0x5fa3('0xdb')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xdc'));db[_0x5fa3('0xdd')]=db['sequelize']['import']('../api/jscriptyProject/jscriptyProject.model');db[_0x5fa3('0xde')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/setting/setting.model');db['SquareOdbc']=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0xdf'));db[_0x5fa3('0xe0')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0xe1'));db[_0x5fa3('0xe2')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xe3'));db['SquareMessage']=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0xe4'));db['Team']=db[_0x5fa3('0x1')]['import'](_0x5fa3('0xe5'));db[_0x5fa3('0xe6')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xe7'));db['Campaign']=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0xe8'));db[_0x5fa3('0xe9')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/migration/migration.model');db[_0x5fa3('0xea')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xeb'));db[_0x5fa3('0xec')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xed'));db[_0x5fa3('0xee')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xef'));db['ChatTransferReport']=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/chatTransferReport/chatTransferReport.model');db[_0x5fa3('0xf0')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0xf1'));db[_0x5fa3('0xf2')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xf3'));db['SmsTransferReport']=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xf4'));db[_0x5fa3('0xf5')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0xf6'));db[_0x5fa3('0xf7')]=db[_0x5fa3('0x1')]['import'](_0x5fa3('0xf8'));db[_0x5fa3('0xf9')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xfa'));db['UserProfileSection']=db['sequelize'][_0x5fa3('0x14')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xfb'));db[_0x5fa3('0xfc')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xfd'));db['WhatsappAccount']=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0xfe'));db[_0x5fa3('0xff')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x100'));db[_0x5fa3('0x101')]=db['sequelize'][_0x5fa3('0x14')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x5fa3('0x102')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x103'));db['WhatsappQueueReport']=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x5fa3('0x104')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x5fa3('0x105')]=db['sequelize'][_0x5fa3('0x14')](_0x5fa3('0x106'));db[_0x5fa3('0x107')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x108'));db['TeamVoiceQueue']=db[_0x5fa3('0x1')][_0x5fa3('0x14')](_0x5fa3('0x109'));db['TeamVoicePrefix']=db['sequelize']['import'](_0x5fa3('0x10a'));db[_0x5fa3('0x10b')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x5fa3('0x10c')]=db[_0x5fa3('0x1')][_0x5fa3('0x14')]('../api/user-setting/user-setting.model');db['User'][_0x5fa3('0x10d')](db[_0x5fa3('0x10e')],{'as':_0x5fa3('0x10e'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x13')][_0x5fa3('0x10d')](db[_0x5fa3('0x10c')],{'as':_0x5fa3('0x111'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x13')][_0x5fa3('0x112')](db[_0x5fa3('0x1e')],{'as':_0x5fa3('0x113'),'foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x13')][_0x5fa3('0x112')](db[_0x5fa3('0x114')],{'as':_0x5fa3('0x115'),'foreignKey':_0x5fa3('0x110')});db['User'][_0x5fa3('0x112')](db[_0x5fa3('0x18')],{'as':_0x5fa3('0x116'),'onDelete':_0x5fa3('0x10f'),'hooks':!![]});db[_0x5fa3('0x13')]['hasMany'](db[_0x5fa3('0x76')],{'as':_0x5fa3('0x117'),'foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x13')][_0x5fa3('0x112')](db[_0x5fa3('0x78')],{'as':_0x5fa3('0x118'),'foreignKey':'UserId'});db[_0x5fa3('0x13')][_0x5fa3('0x112')](db[_0x5fa3('0x79')],{'as':_0x5fa3('0x79'),'foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x13')][_0x5fa3('0x112')](db[_0x5fa3('0x5f')],{'as':_0x5fa3('0x119'),'foreignKey':_0x5fa3('0x110')});db['User'][_0x5fa3('0x112')](db['ChatInteraction'],{'as':_0x5fa3('0x11a'),'foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x13')]['hasMany'](db['SmsInteraction'],{'as':_0x5fa3('0x11b'),'foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x13')][_0x5fa3('0x112')](db['FaxInteraction'],{'as':_0x5fa3('0x11c'),'foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x13')][_0x5fa3('0x112')](db['MailInteraction'],{'as':_0x5fa3('0x11d'),'foreignKey':_0x5fa3('0x110')});db['User'][_0x5fa3('0x112')](db[_0x5fa3('0x101')],{'as':_0x5fa3('0x11e'),'foreignKey':_0x5fa3('0x110')});db['User'][_0x5fa3('0x112')](db[_0x5fa3('0xfc')],{'as':_0x5fa3('0x11f'),'foreignKey':_0x5fa3('0x120')});db[_0x5fa3('0x13')]['belongsTo'](db['UserProfile'],{'as':_0x5fa3('0xf9'),'foreignKey':'userProfileId'});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db['ChatGroup'],{'as':_0x5fa3('0x122'),'through':'chat_group_has_users'});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db['CmContact'],{'as':_0x5fa3('0x123'),'through':_0x5fa3('0x124')});db[_0x5fa3('0x13')]['belongsToMany'](db[_0x5fa3('0xf5')],{'as':_0x5fa3('0x125'),'through':_0x5fa3('0x126')});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db['Team'],{'through':'user_has_teams'});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db[_0x5fa3('0x41')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db['ChatInteraction'],{'as':_0x5fa3('0x11a'),'through':'user_has_chat_interactions'});db['User'][_0x5fa3('0x121')](db[_0x5fa3('0x4c')],{'as':_0x5fa3('0x11c'),'through':_0x5fa3('0x127')});db['User'][_0x5fa3('0x121')](db[_0x5fa3('0x128')],{'as':_0x5fa3('0x11b'),'through':_0x5fa3('0x129')});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db[_0x5fa3('0x5f')],{'as':_0x5fa3('0x119'),'through':_0x5fa3('0x12a')});db['User'][_0x5fa3('0x121')](db[_0x5fa3('0x101')],{'as':_0x5fa3('0x11e'),'through':'user_has_whatsapp_interactions'});db[_0x5fa3('0x13')]['belongsToMany'](db[_0x5fa3('0x1c')],{'as':_0x5fa3('0x12b'),'through':_0x5fa3('0x30'),'required':![]});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db[_0x5fa3('0xf7')],{'as':_0x5fa3('0x12c'),'through':_0x5fa3('0x10b'),'required':![]});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db[_0x5fa3('0x12d')],{'as':_0x5fa3('0x12e'),'through':'UserMailQueue','required':![]});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db[_0x5fa3('0x6a')],{'as':_0x5fa3('0x12f'),'through':_0x5fa3('0x130'),'required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0x5fa3('0x131')],{'as':_0x5fa3('0x132'),'through':_0x5fa3('0x34'),'required':![]});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db[_0x5fa3('0x59')],{'as':'SmsQueues','through':_0x5fa3('0x36'),'required':![]});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db[_0x5fa3('0x62')],{'as':_0x5fa3('0x133'),'through':_0x5fa3('0x134'),'required':![]});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db['WhatsappQueue'],{'as':_0x5fa3('0x135'),'through':_0x5fa3('0x37'),'required':![]});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db[_0x5fa3('0xf5')],{'through':_0x5fa3('0x126')});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db[_0x5fa3('0x136')],{'as':_0x5fa3('0x137'),'through':_0x5fa3('0x138')});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db[_0x5fa3('0x49')],{'as':_0x5fa3('0x139'),'through':_0x5fa3('0x13a')});db[_0x5fa3('0x13')]['belongsToMany'](db['MailAccount'],{'as':_0x5fa3('0x13b'),'through':_0x5fa3('0x13c')});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db[_0x5fa3('0x5b')],{'as':'OpenchannelAccounts','through':_0x5fa3('0x13d')});db[_0x5fa3('0x13')]['belongsToMany'](db[_0x5fa3('0x52')],{'as':_0x5fa3('0x13e'),'through':_0x5fa3('0x13f')});db[_0x5fa3('0x13')][_0x5fa3('0x121')](db[_0x5fa3('0x140')],{'as':_0x5fa3('0x141'),'through':_0x5fa3('0x142')});db[_0x5fa3('0x143')][_0x5fa3('0x112')](db['VoiceExtension'],{'as':_0x5fa3('0x144'),'onDelete':'cascade','foreignKey':_0x5fa3('0x145')});db[_0x5fa3('0x17')][_0x5fa3('0x112')](db[_0x5fa3('0x18')],{'onDelete':'cascade'});db[_0x5fa3('0x18')]['hasMany'](db['VoiceExtension'],{'as':'Applications','onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x1a')][_0x5fa3('0x121')](db['Sound'],{'as':_0x5fa3('0x146'),'through':'moh_has_sounds'});db[_0x5fa3('0x1c')]['hasMany'](db[_0x5fa3('0x114')],{'as':'Members','foreignKey':_0x5fa3('0x147')});db['VoiceQueue'][_0x5fa3('0x112')](db[_0x5fa3('0x73')],{'as':'Hoppers','foreignKey':_0x5fa3('0x147')});db[_0x5fa3('0x1c')][_0x5fa3('0x112')](db[_0x5fa3('0x76')],{'as':_0x5fa3('0x117'),'foreignKey':_0x5fa3('0x147')});db[_0x5fa3('0x1c')][_0x5fa3('0x112')](db['CmHopperHistory'],{'as':_0x5fa3('0x148'),'foreignKey':_0x5fa3('0x147')});db[_0x5fa3('0x1c')][_0x5fa3('0x112')](db[_0x5fa3('0x79')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0x5fa3('0x1c')][_0x5fa3('0x112')](db[_0x5fa3('0x75')],{'as':_0x5fa3('0x149'),'foreignKey':_0x5fa3('0x147')});db[_0x5fa3('0x1c')]['hasMany'](db['JscriptySessionReport'],{'as':_0x5fa3('0x14a'),'foreignKey':_0x5fa3('0x147')});db['VoiceQueue'][_0x5fa3('0x14b')](db[_0x5fa3('0x2c')],{'as':_0x5fa3('0x2c'),'foreignKey':_0x5fa3('0x14c')});db[_0x5fa3('0x1c')][_0x5fa3('0x14b')](db['Trunk'],{'as':_0x5fa3('0x14d'),'foreignKey':_0x5fa3('0x14e')});db[_0x5fa3('0x1c')]['belongsTo'](db[_0x5fa3('0x83')],{'as':_0x5fa3('0x83'),'foreignKey':_0x5fa3('0x14f')});db[_0x5fa3('0x1c')][_0x5fa3('0x14b')](db['Pause'],{'as':_0x5fa3('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x5fa3('0x1c')]['belongsToMany'](db[_0x5fa3('0xf5')],{'as':'Lists','through':_0x5fa3('0x151')});db[_0x5fa3('0x1c')]['belongsToMany'](db[_0x5fa3('0x13')],{'as':'Agents','through':_0x5fa3('0x30')});db[_0x5fa3('0x1c')][_0x5fa3('0x121')](db[_0x5fa3('0x152')],{'as':_0x5fa3('0x153'),'through':'TeamVoiceQueue'});db['VoiceQueue'][_0x5fa3('0x121')](db['CmList'],{'as':_0x5fa3('0x154'),'through':_0x5fa3('0x155')});db[_0x5fa3('0x1e')][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x13'),'foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x20')][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x13'),'foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x10e')]['hasMany'](db['VoiceMailMessage'],{'as':_0x5fa3('0x156'),'onDelete':'cascade','foreignKey':_0x5fa3('0x157'),'sourceKey':_0x5fa3('0x158')});db['VoiceMailMessage'][_0x5fa3('0x14b')](db[_0x5fa3('0x10e')],{'foreignKey':_0x5fa3('0x157'),'targetKey':_0x5fa3('0x158')});db[_0x5fa3('0x23')][_0x5fa3('0x112')](db[_0x5fa3('0x29')],{'as':_0x5fa3('0x159'),'foreignKey':_0x5fa3('0x15a'),'constraints':![]});db['VoiceCallReport'][_0x5fa3('0x112')](db[_0x5fa3('0x27')],{'as':'AgentReports','foreignKey':_0x5fa3('0x15a'),'constraints':![]});db[_0x5fa3('0x23')][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'as':'User','foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x23')][_0x5fa3('0x14b')](db[_0x5fa3('0x71')],{'as':_0x5fa3('0x15b'),'foreignKey':_0x5fa3('0x15c')});db[_0x5fa3('0x39')][_0x5fa3('0x14b')](db[_0x5fa3('0x3c')],{'as':'MailAccount','foreignKey':_0x5fa3('0x15d')});db[_0x5fa3('0x39')][_0x5fa3('0x14b')](db[_0x5fa3('0x107')],{'as':'CloudProvider','foreignKey':_0x5fa3('0x15e'),'onDelete':_0x5fa3('0x15f')});db[_0x5fa3('0x160')]['belongsTo'](db[_0x5fa3('0x3c')],{'as':_0x5fa3('0x3c'),'foreignKey':_0x5fa3('0x15d')});db[_0x5fa3('0x160')][_0x5fa3('0x14b')](db[_0x5fa3('0x107')],{'as':_0x5fa3('0x107'),'foreignKey':_0x5fa3('0x15e'),'onDelete':_0x5fa3('0x15f')});db[_0x5fa3('0x3c')][_0x5fa3('0x10d')](db[_0x5fa3('0x39')],{'as':'Imap','onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x3c')][_0x5fa3('0x10d')](db[_0x5fa3('0x160')],{'as':'Smtp','onDelete':_0x5fa3('0x10f')});db['MailAccount']['hasMany'](db[_0x5fa3('0x81')],{'as':_0x5fa3('0x161'),'foreignKey':_0x5fa3('0x15d'),'onDelete':'cascade'});db[_0x5fa3('0x3c')][_0x5fa3('0x112')](db[_0x5fa3('0x80')],{'as':'Answers','foreignKey':_0x5fa3('0x15d')});db[_0x5fa3('0x3c')][_0x5fa3('0x112')](db[_0x5fa3('0x42')],{'as':_0x5fa3('0x156'),'foreignKey':'MailAccountId'});db[_0x5fa3('0x3c')][_0x5fa3('0x112')](db[_0x5fa3('0x41')],{'as':_0x5fa3('0x162')});db[_0x5fa3('0x3c')][_0x5fa3('0x112')](db[_0x5fa3('0x44')],{'as':'Applications'});db[_0x5fa3('0x3c')][_0x5fa3('0x14b')](db[_0x5fa3('0xf5')],{'as':'List','foreignKey':'ListId'});db[_0x5fa3('0x3c')][_0x5fa3('0x14b')](db['Template'],{'as':_0x5fa3('0x91'),'foreignKey':_0x5fa3('0x163')});db['MailAccount'][_0x5fa3('0x14b')](db[_0x5fa3('0x85')],{'as':'mandatoryDispositionPause','foreignKey':_0x5fa3('0x164')});db['MailAccount'][_0x5fa3('0x121')](db['User'],{'as':_0x5fa3('0x165'),'through':_0x5fa3('0x13c')});db['MailQueue'][_0x5fa3('0x121')](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x165'),'through':_0x5fa3('0x32')});db[_0x5fa3('0x12d')][_0x5fa3('0x121')](db[_0x5fa3('0x152')],{'through':_0x5fa3('0x166'),'as':_0x5fa3('0x153')});db[_0x5fa3('0x41')][_0x5fa3('0x112')](db[_0x5fa3('0x42')],{'as':_0x5fa3('0x156'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x167')});db[_0x5fa3('0x41')][_0x5fa3('0x14b')](db['MailAccount'],{'as':_0x5fa3('0x168'),'foreignKey':_0x5fa3('0x15d')});db['MailInteraction'][_0x5fa3('0x14b')](db[_0x5fa3('0x71')],{'as':'Contact','foreignKey':'ContactId'});db[_0x5fa3('0x41')][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'as':'Owner','foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x41')][_0x5fa3('0x121')](db[_0x5fa3('0x8b')],{'through':_0x5fa3('0x169'),'as':'Tags'});db[_0x5fa3('0x41')][_0x5fa3('0x121')](db['Tag'],{'through':_0x5fa3('0x169'),'as':_0x5fa3('0x16a')});db[_0x5fa3('0x41')]['belongsToMany'](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x16b'),'through':_0x5fa3('0x16c'),'foreignKey':_0x5fa3('0x167')});db[_0x5fa3('0x42')]['hasMany'](db['Attachment'],{'as':'Attachments','onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x42')][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x13')});db['MailMessage'][_0x5fa3('0x14b')](db['CmContact'],{'onDelete':'cascade','as':_0x5fa3('0x15b')});db[_0x5fa3('0x42')]['belongsTo'](db[_0x5fa3('0x41')],{'as':_0x5fa3('0x16d'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x5fa3('0x14b')](db['MailAccount'],{'as':'Account','foreignKey':'MailAccountId'});db[_0x5fa3('0x42')]['belongsTo'](db[_0x5fa3('0x136')],{'as':'ChatWebsite','foreignKey':_0x5fa3('0x16e')});db[_0x5fa3('0x42')]['belongsTo'](db[_0x5fa3('0x16f')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'onDelete':'restrict'});db[_0x5fa3('0x44')]['belongsTo'](db[_0x5fa3('0x12d')],{'onDelete':_0x5fa3('0x15f')});db[_0x5fa3('0x44')][_0x5fa3('0x14b')](db[_0x5fa3('0x3c')],{'onDelete':_0x5fa3('0x15f')});db['MailApplication']['belongsTo'](db['Interval'],{'onDelete':_0x5fa3('0x15f'),'foreignKey':_0x5fa3('0x14f')});db['MailApplication']['belongsTo'](db['Tag'],{'onDelete':_0x5fa3('0x15f'),'foreignKey':_0x5fa3('0x170')});db[_0x5fa3('0x46')][_0x5fa3('0x14b')](db[_0x5fa3('0x3c')],{});db['MailQueueReport'][_0x5fa3('0x14b')](db[_0x5fa3('0xf5')],{'as':_0x5fa3('0x171'),'foreignKey':_0x5fa3('0x172')});db[_0x5fa3('0x46')][_0x5fa3('0x14b')](db[_0x5fa3('0x71')],{'as':'Contact','foreignKey':_0x5fa3('0x15c')});db[_0x5fa3('0x46')][_0x5fa3('0x14b')](db['MailInteraction'],{});db[_0x5fa3('0x46')][_0x5fa3('0x14b')](db[_0x5fa3('0x42')],{});db[_0x5fa3('0x46')]['belongsTo'](db['User'],{});db[_0x5fa3('0x46')][_0x5fa3('0x14b')](db[_0x5fa3('0x12d')],{});db[_0x5fa3('0x173')][_0x5fa3('0x112')](db[_0x5fa3('0x47')],{'as':_0x5fa3('0x174'),'onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x49')][_0x5fa3('0x112')](db[_0x5fa3('0x81')],{'as':_0x5fa3('0x161'),'foreignKey':_0x5fa3('0x175'),'onDelete':_0x5fa3('0x10f')});db['FaxAccount'][_0x5fa3('0x112')](db[_0x5fa3('0x80')],{'as':_0x5fa3('0x176'),'foreignKey':'FaxAccountId'});db[_0x5fa3('0x49')][_0x5fa3('0x112')](db[_0x5fa3('0x4c')],{'as':_0x5fa3('0x162')});db['FaxAccount']['hasMany'](db['FaxApplication'],{'as':_0x5fa3('0x177')});db[_0x5fa3('0x49')][_0x5fa3('0x112')](db['VoiceExtension'],{'as':_0x5fa3('0x178'),'onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x49')]['hasMany'](db[_0x5fa3('0x4d')],{'as':_0x5fa3('0x156')});db[_0x5fa3('0x49')][_0x5fa3('0x14b')](db[_0x5fa3('0x2c')],{'as':_0x5fa3('0x2c')});db[_0x5fa3('0x49')][_0x5fa3('0x14b')](db['CmList'],{'as':'List','foreignKey':_0x5fa3('0x172')});db[_0x5fa3('0x49')][_0x5fa3('0x14b')](db[_0x5fa3('0x85')],{'as':_0x5fa3('0x150'),'foreignKey':_0x5fa3('0x164')});db['FaxAccount'][_0x5fa3('0x121')](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x165'),'through':_0x5fa3('0x13a')});db['FaxApplication'][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'onDelete':_0x5fa3('0x15f')});db[_0x5fa3('0x4a')][_0x5fa3('0x14b')](db[_0x5fa3('0x131')],{'onDelete':_0x5fa3('0x15f')});db['FaxApplication']['belongsTo'](db[_0x5fa3('0x49')],{'onDelete':_0x5fa3('0x15f')});db[_0x5fa3('0x4a')][_0x5fa3('0x14b')](db['Tag'],{'onDelete':_0x5fa3('0x15f'),'foreignKey':_0x5fa3('0x170')});db[_0x5fa3('0x4c')][_0x5fa3('0x112')](db['FaxMessage'],{'as':_0x5fa3('0x156'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x179')});db['FaxInteraction'][_0x5fa3('0x14b')](db[_0x5fa3('0x49')],{'as':'Account','foreignKey':_0x5fa3('0x175')});db[_0x5fa3('0x4c')][_0x5fa3('0x14b')](db[_0x5fa3('0x71')],{'as':'Contact','foreignKey':_0x5fa3('0x15c')});db[_0x5fa3('0x4c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x4c')]['belongsToMany'](db[_0x5fa3('0x8b')],{'through':_0x5fa3('0x17a'),'as':'Tags'});db[_0x5fa3('0x4c')][_0x5fa3('0x121')](db[_0x5fa3('0x8b')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0x5fa3('0x4c')]['belongsToMany'](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x16b'),'through':_0x5fa3('0x127'),'foreignKey':'FaxInteractionId'});db[_0x5fa3('0x4d')][_0x5fa3('0x14b')](db['User'],{'onDelete':_0x5fa3('0x10f'),'as':_0x5fa3('0x13')});db[_0x5fa3('0x4d')][_0x5fa3('0x14b')](db[_0x5fa3('0x4c')],{'as':_0x5fa3('0x16d'),'foreignKey':_0x5fa3('0x179')});db['FaxMessage']['belongsTo'](db[_0x5fa3('0x71')],{'onDelete':_0x5fa3('0x10f'),'as':'Contact'});db[_0x5fa3('0x4d')][_0x5fa3('0x14b')](db[_0x5fa3('0xea')],{'as':_0x5fa3('0xea'),'foreignKey':_0x5fa3('0x17b')});db[_0x5fa3('0x4d')][_0x5fa3('0x14b')](db['FaxAccount'],{'as':'Account','foreignKey':_0x5fa3('0x175')});db[_0x5fa3('0x131')][_0x5fa3('0x121')](db['User'],{'as':_0x5fa3('0x165'),'through':_0x5fa3('0x34')});db[_0x5fa3('0x131')][_0x5fa3('0x121')](db[_0x5fa3('0x152')],{'through':_0x5fa3('0x17c'),'as':_0x5fa3('0x153')});db[_0x5fa3('0x50')][_0x5fa3('0x14b')](db[_0x5fa3('0x49')],{});db[_0x5fa3('0x50')][_0x5fa3('0x14b')](db['CmList'],{'as':_0x5fa3('0x171'),'foreignKey':_0x5fa3('0x172')});db['FaxQueueReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x71')],{'as':_0x5fa3('0x15b'),'foreignKey':_0x5fa3('0x15c')});db['FaxQueueReport']['belongsTo'](db[_0x5fa3('0x4c')],{});db['FaxQueueReport']['belongsTo'](db['FaxMessage'],{});db[_0x5fa3('0x50')][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{});db[_0x5fa3('0x50')][_0x5fa3('0x14b')](db[_0x5fa3('0x131')],{});db['SmsAccount'][_0x5fa3('0x112')](db[_0x5fa3('0x81')],{'as':'Dispositions','foreignKey':_0x5fa3('0x17d'),'onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x52')]['hasMany'](db[_0x5fa3('0x80')],{'as':_0x5fa3('0x176'),'foreignKey':_0x5fa3('0x17d')});db['SmsAccount']['hasMany'](db[_0x5fa3('0x57')],{'as':_0x5fa3('0x156'),'foreignKey':_0x5fa3('0x17d')});db[_0x5fa3('0x52')][_0x5fa3('0x112')](db[_0x5fa3('0x128')],{'as':_0x5fa3('0x162')});db[_0x5fa3('0x52')][_0x5fa3('0x112')](db[_0x5fa3('0x54')],{'as':_0x5fa3('0x177')});db[_0x5fa3('0x52')][_0x5fa3('0x14b')](db['CmList'],{'as':_0x5fa3('0x171'),'foreignKey':_0x5fa3('0x172')});db[_0x5fa3('0x52')][_0x5fa3('0x14b')](db[_0x5fa3('0x85')],{'as':_0x5fa3('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x5fa3('0x52')]['belongsToMany'](db[_0x5fa3('0x13')],{'as':'Agents','through':_0x5fa3('0x13f')});db[_0x5fa3('0x54')][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db[_0x5fa3('0x59')],{'onDelete':_0x5fa3('0x15f')});db[_0x5fa3('0x54')]['belongsTo'](db[_0x5fa3('0x52')],{'onDelete':_0x5fa3('0x15f')});db[_0x5fa3('0x54')][_0x5fa3('0x14b')](db[_0x5fa3('0x83')],{'onDelete':'restrict','foreignKey':_0x5fa3('0x14f')});db[_0x5fa3('0x54')][_0x5fa3('0x14b')](db[_0x5fa3('0x8b')],{'onDelete':_0x5fa3('0x15f'),'foreignKey':'TagId'});db['SmsInteraction'][_0x5fa3('0x112')](db[_0x5fa3('0x57')],{'as':_0x5fa3('0x156'),'onDelete':'cascade','foreignKey':_0x5fa3('0x17e')});db[_0x5fa3('0x128')][_0x5fa3('0x14b')](db['SmsAccount'],{'as':_0x5fa3('0x168'),'foreignKey':_0x5fa3('0x17d')});db[_0x5fa3('0x128')][_0x5fa3('0x14b')](db[_0x5fa3('0x71')],{'as':_0x5fa3('0x15b'),'foreignKey':'ContactId'});db['SmsInteraction']['belongsTo'](db[_0x5fa3('0x13')],{'as':'Owner','foreignKey':'UserId'});db['SmsInteraction'][_0x5fa3('0x121')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x5fa3('0x17f')});db[_0x5fa3('0x128')][_0x5fa3('0x121')](db[_0x5fa3('0x8b')],{'through':_0x5fa3('0x180'),'as':'ThroughTags'});db[_0x5fa3('0x128')][_0x5fa3('0x121')](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x16b'),'through':_0x5fa3('0x129'),'foreignKey':_0x5fa3('0x17e')});db[_0x5fa3('0x57')]['belongsTo'](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x13')});db['SmsMessage'][_0x5fa3('0x14b')](db[_0x5fa3('0x71')],{'onDelete':_0x5fa3('0x10f'),'as':_0x5fa3('0x15b')});db[_0x5fa3('0x57')][_0x5fa3('0x14b')](db['SmsInteraction'],{'onDelete':_0x5fa3('0x10f'),'as':'Interaction','foreignKey':_0x5fa3('0x17e')});db[_0x5fa3('0x57')][_0x5fa3('0x14b')](db[_0x5fa3('0x52')],{'as':_0x5fa3('0x168'),'foreignKey':'SmsAccountId'});db['SmsQueue'][_0x5fa3('0x121')](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x165'),'through':_0x5fa3('0x36'),'foreignKey':_0x5fa3('0x181')});db[_0x5fa3('0x59')][_0x5fa3('0x121')](db[_0x5fa3('0x152')],{'through':_0x5fa3('0x182'),'as':_0x5fa3('0x153')});db['OpenchannelAccount'][_0x5fa3('0x112')](db[_0x5fa3('0x81')],{'as':'Dispositions','foreignKey':_0x5fa3('0x183'),'onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x5b')][_0x5fa3('0x112')](db['CannedAnswer'],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x5fa3('0x112')](db[_0x5fa3('0x5f')],{'as':_0x5fa3('0x162'),'foreignKey':_0x5fa3('0x183')});db['OpenchannelAccount']['hasMany'](db['OpenchannelMessage'],{'as':_0x5fa3('0x156'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x5fa3('0x112')](db[_0x5fa3('0x5d')],{'as':_0x5fa3('0x177'),'foreignKey':_0x5fa3('0x183')});db[_0x5fa3('0x5b')][_0x5fa3('0x14b')](db['CmList'],{'as':_0x5fa3('0x171'),'foreignKey':_0x5fa3('0x172')});db[_0x5fa3('0x5b')][_0x5fa3('0x14b')](db[_0x5fa3('0x85')],{'as':_0x5fa3('0x150'),'foreignKey':_0x5fa3('0x164')});db['OpenchannelAccount'][_0x5fa3('0x121')](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x165'),'through':_0x5fa3('0x13d')});db[_0x5fa3('0x5d')]['belongsTo'](db[_0x5fa3('0x13')],{'onDelete':_0x5fa3('0x15f')});db[_0x5fa3('0x5d')][_0x5fa3('0x14b')](db[_0x5fa3('0x62')],{'onDelete':'restrict','foreignKey':_0x5fa3('0x184')});db['OpenchannelApplication'][_0x5fa3('0x14b')](db[_0x5fa3('0x5b')],{'onDelete':'restrict','foreignKey':_0x5fa3('0x183')});db['OpenchannelApplication'][_0x5fa3('0x14b')](db[_0x5fa3('0x83')],{'onDelete':_0x5fa3('0x15f'),'foreignKey':_0x5fa3('0x14f')});db['OpenchannelApplication'][_0x5fa3('0x14b')](db[_0x5fa3('0x8b')],{'onDelete':_0x5fa3('0x15f'),'foreignKey':'TagId'});db[_0x5fa3('0x5f')][_0x5fa3('0x112')](db[_0x5fa3('0x185')],{'as':_0x5fa3('0x156'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x186')});db[_0x5fa3('0x5f')][_0x5fa3('0x14b')](db[_0x5fa3('0x5b')],{'as':'Account','foreignKey':_0x5fa3('0x183')});db['OpenchannelInteraction'][_0x5fa3('0x14b')](db[_0x5fa3('0x71')],{'as':'Contact','foreignKey':'ContactId'});db[_0x5fa3('0x5f')]['belongsTo'](db['User'],{'as':_0x5fa3('0x187'),'foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x5f')]['belongsToMany'](db['Tag'],{'through':_0x5fa3('0x188'),'as':'Tags'});db[_0x5fa3('0x5f')][_0x5fa3('0x121')](db[_0x5fa3('0x8b')],{'through':_0x5fa3('0x188'),'as':_0x5fa3('0x16a')});db['OpenchannelInteraction'][_0x5fa3('0x121')](db[_0x5fa3('0x13')],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':'OpenchannelInteractionId'});db[_0x5fa3('0x185')][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'onDelete':_0x5fa3('0x10f'),'as':_0x5fa3('0x13')});db[_0x5fa3('0x185')][_0x5fa3('0x14b')](db[_0x5fa3('0x71')],{'onDelete':_0x5fa3('0x10f'),'as':_0x5fa3('0x15b')});db[_0x5fa3('0x185')][_0x5fa3('0x14b')](db[_0x5fa3('0x5f')],{'onDelete':_0x5fa3('0x10f'),'as':'Interaction','foreignKey':'OpenchannelInteractionId'});db[_0x5fa3('0x185')][_0x5fa3('0x14b')](db[_0x5fa3('0xea')],{'as':'Attachment','foreignKey':_0x5fa3('0x17b')});db[_0x5fa3('0x185')][_0x5fa3('0x14b')](db[_0x5fa3('0x5b')],{'as':_0x5fa3('0x168'),'foreignKey':_0x5fa3('0x183')});db[_0x5fa3('0x62')][_0x5fa3('0x121')](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x165'),'through':_0x5fa3('0x134'),'foreignKey':_0x5fa3('0x184')});db['OpenchannelQueue'][_0x5fa3('0x121')](db[_0x5fa3('0x152')],{'through':_0x5fa3('0x189'),'as':_0x5fa3('0x153')});db[_0x5fa3('0x136')]['hasMany'](db[_0x5fa3('0x81')],{'as':'Dispositions','foreignKey':_0x5fa3('0x16e'),'onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x136')]['hasMany'](db[_0x5fa3('0x80')],{'as':_0x5fa3('0x176'),'foreignKey':_0x5fa3('0x16e')});db[_0x5fa3('0x136')][_0x5fa3('0x112')](db[_0x5fa3('0x18a')],{'as':_0x5fa3('0x18b')});db['ChatWebsite']['hasMany'](db[_0x5fa3('0x18c')],{'as':_0x5fa3('0x162')});db[_0x5fa3('0x136')][_0x5fa3('0x112')](db[_0x5fa3('0x66')],{'as':_0x5fa3('0x177')});db[_0x5fa3('0x136')]['hasMany'](db['ChatMessage'],{'as':_0x5fa3('0x156')});db[_0x5fa3('0x136')][_0x5fa3('0x14b')](db[_0x5fa3('0xf5')],{'as':_0x5fa3('0x171'),'foreignKey':_0x5fa3('0x172')});db[_0x5fa3('0x136')][_0x5fa3('0x14b')](db[_0x5fa3('0x83')],{'as':'Interval','foreignKey':_0x5fa3('0x14f')});db[_0x5fa3('0x136')][_0x5fa3('0x14b')](db['MailAccount'],{'as':_0x5fa3('0x3c'),'foreignKey':_0x5fa3('0x15d')});db[_0x5fa3('0x136')][_0x5fa3('0x14b')](db[_0x5fa3('0x85')],{'as':_0x5fa3('0x150'),'foreignKey':_0x5fa3('0x164')});db[_0x5fa3('0x136')][_0x5fa3('0x121')](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x165'),'through':_0x5fa3('0x138')});db['OpenchannelQueueReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x5b')],{});db[_0x5fa3('0x64')]['belongsTo'](db[_0x5fa3('0xf5')],{'as':'List','foreignKey':'ListId'});db[_0x5fa3('0x64')][_0x5fa3('0x14b')](db['CmContact'],{'as':_0x5fa3('0x15b'),'foreignKey':_0x5fa3('0x15c')});db[_0x5fa3('0x64')]['belongsTo'](db[_0x5fa3('0x5f')],{});db['OpenchannelQueueReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x185')],{});db['OpenchannelQueueReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{});db[_0x5fa3('0x64')][_0x5fa3('0x14b')](db[_0x5fa3('0x62')],{});db[_0x5fa3('0x66')][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x18d'),'foreignKey':_0x5fa3('0x110'),'onDelete':_0x5fa3('0x15f')});db['ChatApplication'][_0x5fa3('0x14b')](db['ChatQueue'],{'as':_0x5fa3('0x18e'),'foreignKey':'ChatQueueId','onDelete':_0x5fa3('0x15f')});db[_0x5fa3('0x66')][_0x5fa3('0x14b')](db[_0x5fa3('0x136')],{'as':_0x5fa3('0x18f'),'foreignKey':'ChatWebsiteId','onDelete':_0x5fa3('0x15f')});db[_0x5fa3('0x66')][_0x5fa3('0x14b')](db[_0x5fa3('0x8b')],{'onDelete':'restrict','foreignKey':_0x5fa3('0x170')});db[_0x5fa3('0x18c')][_0x5fa3('0x112')](db[_0x5fa3('0x190')],{'as':'Messages','onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x191')});db[_0x5fa3('0x18c')]['belongsTo'](db['ChatWebsite'],{'as':_0x5fa3('0x168'),'foreignKey':_0x5fa3('0x16e')});db[_0x5fa3('0x18c')][_0x5fa3('0x14b')](db['CmContact'],{'as':_0x5fa3('0x15b'),'foreignKey':_0x5fa3('0x15c')});db[_0x5fa3('0x18c')][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'as':'Owner','foreignKey':'UserId'});db[_0x5fa3('0x18c')]['belongsToMany'](db[_0x5fa3('0x8b')],{'through':_0x5fa3('0x192'),'as':_0x5fa3('0x17f')});db[_0x5fa3('0x18c')]['belongsToMany'](db[_0x5fa3('0x8b')],{'through':_0x5fa3('0x192'),'as':_0x5fa3('0x16a')});db[_0x5fa3('0x18c')]['belongsToMany'](db[_0x5fa3('0x13')],{'as':'Users','through':_0x5fa3('0x193'),'foreignKey':_0x5fa3('0x191')});db[_0x5fa3('0x190')]['belongsTo'](db['User'],{'onDelete':'cascade','as':_0x5fa3('0x13')});db[_0x5fa3('0x190')][_0x5fa3('0x14b')](db[_0x5fa3('0x71')],{'onDelete':_0x5fa3('0x10f'),'as':'Contact','foreignKey':_0x5fa3('0x15c')});db[_0x5fa3('0x190')][_0x5fa3('0x14b')](db[_0x5fa3('0x18c')],{'onDelete':_0x5fa3('0x10f'),'as':'Interaction','foreignKey':_0x5fa3('0x191')});db[_0x5fa3('0x190')][_0x5fa3('0x14b')](db[_0x5fa3('0xea')],{'as':'Attachment','foreignKey':_0x5fa3('0x17b')});db[_0x5fa3('0x190')][_0x5fa3('0x14b')](db[_0x5fa3('0x136')],{'as':_0x5fa3('0x168'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage']['hasMany'](db['Attachment'],{'as':'Attachments','foreignKey':_0x5fa3('0x194'),'onDelete':_0x5fa3('0x10f'),'hooks':!![]});db[_0x5fa3('0x16f')][_0x5fa3('0x14b')](db['CmContact'],{'onDelete':_0x5fa3('0x10f'),'as':_0x5fa3('0x15b'),'foreignKey':'ContactId'});db[_0x5fa3('0x16f')]['belongsTo'](db[_0x5fa3('0x136')],{'as':_0x5fa3('0x168'),'foreignKey':'ChatWebsiteId'});db[_0x5fa3('0x6a')]['belongsToMany'](db[_0x5fa3('0x13')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0x5fa3('0x121')](db['Team'],{'through':'team_has_chat_queues','as':_0x5fa3('0x153')});db[_0x5fa3('0x6c')][_0x5fa3('0x112')](db[_0x5fa3('0xd2')],{'as':_0x5fa3('0x156'),'foreignKey':_0x5fa3('0x195'),'onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x6c')]['belongsToMany'](db['User'],{'as':_0x5fa3('0x196'),'through':_0x5fa3('0x197')});db[_0x5fa3('0x18a')]['belongsTo'](db[_0x5fa3('0x136')],{'as':_0x5fa3('0x18f'),'foreignKey':_0x5fa3('0x16e')});db[_0x5fa3('0x6f')]['hasMany'](db[_0x5fa3('0x71')],{'as':_0x5fa3('0x123'),'foreignKey':'CompanyId'});db[_0x5fa3('0x71')][_0x5fa3('0x112')](db['CmContactHasItem'],{'as':_0x5fa3('0x198'),'foreignKey':_0x5fa3('0x199')});db[_0x5fa3('0x71')][_0x5fa3('0x112')](db[_0x5fa3('0x73')],{'as':_0x5fa3('0x19a'),'foreignKey':_0x5fa3('0x15c')});db['CmContact'][_0x5fa3('0x112')](db[_0x5fa3('0x76')],{'as':_0x5fa3('0x117'),'foreignKey':_0x5fa3('0x15c')});db[_0x5fa3('0x71')][_0x5fa3('0x112')](db[_0x5fa3('0x78')],{'as':_0x5fa3('0x148'),'foreignKey':_0x5fa3('0x15c')});db[_0x5fa3('0x71')][_0x5fa3('0x112')](db[_0x5fa3('0x79')],{'as':'ReportAgentPreview','foreignKey':_0x5fa3('0x15c')});db[_0x5fa3('0x71')][_0x5fa3('0x112')](db['JscriptySessionReport'],{'as':_0x5fa3('0x14a'),'foreignKey':_0x5fa3('0x15c')});db['CmContact'][_0x5fa3('0x112')](db[_0x5fa3('0x5f')],{'as':'OpenchannelInteractions','foreignKey':_0x5fa3('0x15c'),'onDelete':_0x5fa3('0x15f')});db['CmContact'][_0x5fa3('0x112')](db['ChatInteraction'],{'as':_0x5fa3('0x11a'),'foreignKey':_0x5fa3('0x15c'),'onDelete':'restrict'});db['CmContact'][_0x5fa3('0x112')](db[_0x5fa3('0x128')],{'as':_0x5fa3('0x11b'),'foreignKey':_0x5fa3('0x15c'),'onDelete':'restrict'});db[_0x5fa3('0x71')][_0x5fa3('0x112')](db[_0x5fa3('0x4c')],{'as':_0x5fa3('0x11c'),'foreignKey':_0x5fa3('0x15c'),'onDelete':_0x5fa3('0x15f')});db[_0x5fa3('0x71')]['hasMany'](db[_0x5fa3('0x41')],{'as':'MailInteractions','foreignKey':_0x5fa3('0x15c'),'onDelete':_0x5fa3('0x15f')});db[_0x5fa3('0x71')]['belongsTo'](db[_0x5fa3('0x6f')],{'as':_0x5fa3('0x19b'),'foreignKey':_0x5fa3('0x19c')});db[_0x5fa3('0x71')][_0x5fa3('0x14b')](db[_0x5fa3('0xf5')],{'as':'List','foreignKey':_0x5fa3('0x172'),'onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x71')]['belongsToMany'](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x16b'),'through':_0x5fa3('0x124')});db[_0x5fa3('0x71')]['belongsToMany'](db['Tag'],{'as':_0x5fa3('0x17f'),'through':_0x5fa3('0x19d')});db[_0x5fa3('0x71')][_0x5fa3('0x121')](db[_0x5fa3('0x8b')],{'through':_0x5fa3('0x19d'),'as':'ThroughTags'});db['CmHopper'][_0x5fa3('0x112')](db[_0x5fa3('0x8f')],{'as':_0x5fa3('0x19e'),'foreignKey':_0x5fa3('0x19f')});db['CmHopper'][_0x5fa3('0x14b')](db['CmContact'],{'as':_0x5fa3('0x15b'),'foreignKey':'ContactId','onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x73')]['belongsTo'](db[_0x5fa3('0xf5')],{'as':_0x5fa3('0x171'),'foreignKey':'ListId','onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x73')][_0x5fa3('0x14b')](db['User'],{'as':'Agent','foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x73')][_0x5fa3('0x14b')](db[_0x5fa3('0x1c')],{'as':_0x5fa3('0x18e'),'foreignKey':'VoiceQueueId','onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x73')][_0x5fa3('0x14b')](db[_0x5fa3('0x1a0')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db[_0x5fa3('0x73')][_0x5fa3('0x14b')](db['User'],{'as':_0x5fa3('0x187'),'foreignKey':'OwnerId'});db[_0x5fa3('0x75')][_0x5fa3('0x14b')](db['CmContact'],{'as':'Contact','foreignKey':_0x5fa3('0x15c'),'onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x75')][_0x5fa3('0x14b')](db[_0x5fa3('0xf5')],{'as':_0x5fa3('0x171'),'foreignKey':_0x5fa3('0x172'),'onDelete':'cascade'});db[_0x5fa3('0x75')]['belongsTo'](db['VoiceQueue'],{'as':_0x5fa3('0x18e'),'foreignKey':'VoiceQueueId','onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x75')][_0x5fa3('0x14b')](db[_0x5fa3('0x1a0')],{'as':_0x5fa3('0x1a0'),'foreignKey':_0x5fa3('0x1a1'),'onDelete':_0x5fa3('0x10f')});db['Automation'][_0x5fa3('0x112')](db['Condition'],{'as':{'plural':'All','singular':_0x5fa3('0x1a2')},'foreignKey':'AutomationAllId','onDelete':_0x5fa3('0x10f'),'hooks':!![]});db[_0x5fa3('0x7f')][_0x5fa3('0x112')](db['Condition'],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0x5fa3('0x7f')][_0x5fa3('0x112')](db[_0x5fa3('0x7d')],{'as':'Actions','foreignKey':_0x5fa3('0x1a3'),'onDelete':'cascade','hooks':!![]});db[_0x5fa3('0x81')][_0x5fa3('0x112')](db[_0x5fa3('0x81')],{'as':_0x5fa3('0x161'),'foreignKey':_0x5fa3('0x1a4'),'onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x83')][_0x5fa3('0x112')](db[_0x5fa3('0x83')],{'as':_0x5fa3('0x1a5'),'foreignKey':_0x5fa3('0x14f'),'onDelete':_0x5fa3('0x10f'),'hooks':!![],'required':![]});db[_0x5fa3('0x83')][_0x5fa3('0x112')](db[_0x5fa3('0x18')],{'as':_0x5fa3('0x116'),'foreignKey':'IntervalId','onDelete':_0x5fa3('0x15f')});db[_0x5fa3('0x83')][_0x5fa3('0x112')](db['MailApplication'],{'as':_0x5fa3('0x1a6'),'foreignKey':_0x5fa3('0x14f')});db[_0x5fa3('0x83')]['hasMany'](db['ChatApplication'],{'as':_0x5fa3('0x1a7'),'foreignKey':_0x5fa3('0x14f')});db[_0x5fa3('0x83')][_0x5fa3('0x112')](db['FaxApplication'],{'as':_0x5fa3('0x1a8'),'foreignKey':_0x5fa3('0x14f')});db[_0x5fa3('0x83')]['hasMany'](db[_0x5fa3('0x54')],{'as':_0x5fa3('0x1a9'),'foreignKey':_0x5fa3('0x14f')});db[_0x5fa3('0x89')][_0x5fa3('0x14b')](db[_0x5fa3('0x3c')],{});db[_0x5fa3('0x89')]['belongsTo'](db[_0x5fa3('0x9c')],{'foreignKey':_0x5fa3('0x1aa')});db[_0x5fa3('0x89')]['belongsTo'](db[_0x5fa3('0x9a')],{'foreignKey':'CustomReportId'});db[_0x5fa3('0x1ab')][_0x5fa3('0x121')](db[_0x5fa3('0x1a')],{'as':_0x5fa3('0x1ac'),'through':_0x5fa3('0x1ad'),'onDelete':_0x5fa3('0x15f')});db['Tag']['belongsToMany'](db[_0x5fa3('0x71')],{'through':_0x5fa3('0x19d')});db[_0x5fa3('0x8b')]['belongsToMany'](db[_0x5fa3('0x18c')],{'through':'chat_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x5fa3('0x41')],{'through':'mail_interaction_has_tags'});db[_0x5fa3('0x8b')][_0x5fa3('0x121')](db[_0x5fa3('0x128')],{'through':_0x5fa3('0x180')});db['Tag'][_0x5fa3('0x121')](db[_0x5fa3('0x4c')],{'through':_0x5fa3('0x17a')});db['Tag'][_0x5fa3('0x121')](db[_0x5fa3('0x5f')],{'through':_0x5fa3('0x188')});db[_0x5fa3('0x8b')][_0x5fa3('0x121')](db[_0x5fa3('0x101')],{'through':'whatsapp_interaction_has_tags'});db[_0x5fa3('0x1ae')][_0x5fa3('0x14b')](db['ContactItemType'],{'as':_0x5fa3('0x1af'),'foreignKey':_0x5fa3('0x1b0')});db[_0x5fa3('0x8f')][_0x5fa3('0x14b')](db[_0x5fa3('0x73')],{'as':_0x5fa3('0x1b1'),'foreignKey':_0x5fa3('0x19f')});db[_0x5fa3('0x1ae')][_0x5fa3('0x14b')](db[_0x5fa3('0x71')],{'as':_0x5fa3('0x15b'),'foreignKey':_0x5fa3('0x199')});db[_0x5fa3('0x93')][_0x5fa3('0x112')](db['Condition'],{'as':{'plural':_0x5fa3('0x1b2'),'singular':_0x5fa3('0x1b3')},'foreignKey':_0x5fa3('0x1b4'),'onDelete':_0x5fa3('0x10f'),'hooks':!![]});db[_0x5fa3('0x93')][_0x5fa3('0x112')](db[_0x5fa3('0x1b5')],{'as':{'plural':_0x5fa3('0x1b6'),'singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0x5fa3('0x10f'),'hooks':!![]});db[_0x5fa3('0x93')][_0x5fa3('0x112')](db[_0x5fa3('0x7d')],{'as':'Actions','foreignKey':_0x5fa3('0x1b7'),'onDelete':'cascade','hooks':!![]});db[_0x5fa3('0x9a')][_0x5fa3('0x112')](db[_0x5fa3('0xa1')],{'as':_0x5fa3('0x1b8'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1b9'),'hooks':!![]});db[_0x5fa3('0x9c')]['hasMany'](db[_0x5fa3('0xa1')],{'as':'Fields','onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1aa')});db[_0x5fa3('0x9f')][_0x5fa3('0x112')](db['AnalyticFieldReport'],{'as':_0x5fa3('0x1b8'),'onDelete':_0x5fa3('0x10f'),'foreignKey':'MetricId'});db[_0x5fa3('0xa1')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0x5fa3('0x1ba')});db[_0x5fa3('0x1bb')][_0x5fa3('0x112')](db['SalesforceConfiguration'],{'as':_0x5fa3('0x1bc'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1bd')});db[_0x5fa3('0xa5')][_0x5fa3('0x112')](db['SalesforceField'],{'as':_0x5fa3('0x1be'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1bf')});db[_0x5fa3('0xa5')][_0x5fa3('0x112')](db[_0x5fa3('0xa7')],{'as':_0x5fa3('0x1c0'),'onDelete':_0x5fa3('0x10f'),'foreignKey':'DescriptionId'});db[_0x5fa3('0xa5')][_0x5fa3('0x112')](db[_0x5fa3('0xa7')],{'as':_0x5fa3('0x1b8'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1c1')});db[_0x5fa3('0xa5')]['belongsTo'](db[_0x5fa3('0x1bb')],{'as':_0x5fa3('0x168'),'foreignKey':_0x5fa3('0x1bd')});db[_0x5fa3('0xa7')][_0x5fa3('0x112')](db[_0x5fa3('0xa7')],{'as':_0x5fa3('0x1c2'),'foreignKey':_0x5fa3('0x1bf')});db[_0x5fa3('0xa7')][_0x5fa3('0x112')](db[_0x5fa3('0xa7')],{'as':_0x5fa3('0x1c3'),'foreignKey':_0x5fa3('0x1c4')});db['SalesforceField'][_0x5fa3('0x112')](db[_0x5fa3('0xa7')],{'as':'Field','foreignKey':_0x5fa3('0x1c1')});db[_0x5fa3('0xa7')][_0x5fa3('0x14b')](db[_0x5fa3('0x95')],{'as':_0x5fa3('0x95'),'foreignKey':_0x5fa3('0x1c5')});db['SugarcrmAccount'][_0x5fa3('0x112')](db[_0x5fa3('0x1c6')],{'as':_0x5fa3('0x1bc'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1bd')});db['SugarcrmConfiguration'][_0x5fa3('0x112')](db['SugarcrmField'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x5fa3('0x1bf')});db[_0x5fa3('0x1c6')][_0x5fa3('0x112')](db[_0x5fa3('0xac')],{'as':_0x5fa3('0x1c0'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1c4')});db[_0x5fa3('0x1c6')][_0x5fa3('0x112')](db['SugarcrmField'],{'as':_0x5fa3('0x1b8'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1c1')});db[_0x5fa3('0x1c6')]['belongsTo'](db[_0x5fa3('0xa9')],{'as':_0x5fa3('0x168'),'foreignKey':_0x5fa3('0x1bd')});db[_0x5fa3('0xac')][_0x5fa3('0x112')](db[_0x5fa3('0xac')],{'as':_0x5fa3('0x1c2'),'foreignKey':_0x5fa3('0x1bf')});db['SugarcrmField'][_0x5fa3('0x112')](db['SugarcrmField'],{'as':_0x5fa3('0x1c3'),'foreignKey':_0x5fa3('0x1c4')});db[_0x5fa3('0xac')]['hasMany'](db['SugarcrmField'],{'as':_0x5fa3('0x1c7'),'foreignKey':'FieldId'});db[_0x5fa3('0xac')][_0x5fa3('0x14b')](db[_0x5fa3('0x95')],{'as':'Variable','foreignKey':_0x5fa3('0x1c5')});db[_0x5fa3('0xad')][_0x5fa3('0x112')](db[_0x5fa3('0xaf')],{'as':_0x5fa3('0x1bc'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1bd')});db[_0x5fa3('0xaf')][_0x5fa3('0x112')](db[_0x5fa3('0xb1')],{'as':_0x5fa3('0x1be'),'onDelete':'cascade','foreignKey':_0x5fa3('0x1bf')});db[_0x5fa3('0xaf')][_0x5fa3('0x112')](db[_0x5fa3('0xb1')],{'as':_0x5fa3('0x1c0'),'onDelete':'cascade','foreignKey':_0x5fa3('0x1c4')});db[_0x5fa3('0xaf')]['hasMany'](db[_0x5fa3('0xb1')],{'as':_0x5fa3('0x1b8'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1c1')});db[_0x5fa3('0xaf')][_0x5fa3('0x14b')](db[_0x5fa3('0xad')],{'as':_0x5fa3('0x168'),'foreignKey':_0x5fa3('0x1bd')});db[_0x5fa3('0xaf')][_0x5fa3('0x121')](db[_0x5fa3('0x8b')],{'through':_0x5fa3('0x1c8')});db['DeskField']['hasMany'](db[_0x5fa3('0xb1')],{'as':_0x5fa3('0x1c2'),'foreignKey':_0x5fa3('0x1bf')});db[_0x5fa3('0xb1')][_0x5fa3('0x112')](db[_0x5fa3('0xb1')],{'as':_0x5fa3('0x1c3'),'foreignKey':'DescriptionId'});db[_0x5fa3('0xb1')][_0x5fa3('0x112')](db[_0x5fa3('0xb1')],{'as':_0x5fa3('0x1c7'),'foreignKey':'FieldId'});db[_0x5fa3('0xb1')][_0x5fa3('0x14b')](db['Variable'],{'as':_0x5fa3('0x95'),'foreignKey':_0x5fa3('0x1c5')});db[_0x5fa3('0xb2')][_0x5fa3('0x112')](db[_0x5fa3('0xb4')],{'as':_0x5fa3('0x1bc'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1bd')});db[_0x5fa3('0xb4')][_0x5fa3('0x112')](db['ZohoField'],{'as':_0x5fa3('0x1be'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1bf')});db[_0x5fa3('0xb4')][_0x5fa3('0x112')](db[_0x5fa3('0x1c9')],{'as':_0x5fa3('0x1c0'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1c4')});db[_0x5fa3('0xb4')]['hasMany'](db[_0x5fa3('0x1c9')],{'as':_0x5fa3('0x1b8'),'onDelete':_0x5fa3('0x10f'),'foreignKey':'FieldId'});db[_0x5fa3('0xb4')][_0x5fa3('0x14b')](db[_0x5fa3('0xb2')],{'as':_0x5fa3('0x168'),'foreignKey':'AccountId'});db[_0x5fa3('0x1c9')]['hasMany'](db['ZohoField'],{'as':_0x5fa3('0x1c2'),'foreignKey':'SubjectId'});db[_0x5fa3('0x1c9')][_0x5fa3('0x112')](db[_0x5fa3('0x1c9')],{'as':_0x5fa3('0x1c3'),'foreignKey':_0x5fa3('0x1c4')});db[_0x5fa3('0x1c9')][_0x5fa3('0x112')](db[_0x5fa3('0x1c9')],{'as':_0x5fa3('0x1c7'),'foreignKey':_0x5fa3('0x1c1')});db[_0x5fa3('0x1c9')][_0x5fa3('0x14b')](db[_0x5fa3('0x95')],{'as':_0x5fa3('0x95'),'foreignKey':_0x5fa3('0x1c5')});db[_0x5fa3('0xb6')][_0x5fa3('0x112')](db[_0x5fa3('0xb8')],{'as':_0x5fa3('0x1bc'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1bd')});db[_0x5fa3('0xb8')]['hasMany'](db['ZendeskField'],{'as':_0x5fa3('0x1be'),'foreignKey':'SubjectId'});db[_0x5fa3('0xb8')][_0x5fa3('0x112')](db[_0x5fa3('0xba')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':_0x5fa3('0x1b8'),'foreignKey':_0x5fa3('0x1c1')});db[_0x5fa3('0xb8')][_0x5fa3('0x14b')](db[_0x5fa3('0xb6')],{'as':'Account','foreignKey':_0x5fa3('0x1bd')});db['ZendeskConfiguration']['belongsToMany'](db[_0x5fa3('0x8b')],{'through':_0x5fa3('0x1ca')});db[_0x5fa3('0xba')][_0x5fa3('0x112')](db[_0x5fa3('0xba')],{'as':_0x5fa3('0x1c2'),'foreignKey':_0x5fa3('0x1bf')});db[_0x5fa3('0xba')][_0x5fa3('0x112')](db['ZendeskField'],{'as':_0x5fa3('0x1c3'),'foreignKey':_0x5fa3('0x1c4')});db[_0x5fa3('0xba')]['hasMany'](db[_0x5fa3('0xba')],{'as':_0x5fa3('0x1c7'),'foreignKey':'FieldId'});db[_0x5fa3('0xba')][_0x5fa3('0x14b')](db[_0x5fa3('0x95')],{'as':'Variable','foreignKey':_0x5fa3('0x1c5')});db['FreshdeskAccount'][_0x5fa3('0x112')](db['FreshdeskConfiguration'],{'as':_0x5fa3('0x1bc'),'onDelete':'cascade','foreignKey':_0x5fa3('0x1bd')});db[_0x5fa3('0x1cb')]['hasMany'](db[_0x5fa3('0xbc')],{'as':_0x5fa3('0x1be'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1bf')});db[_0x5fa3('0x1cb')]['hasMany'](db[_0x5fa3('0xbc')],{'as':'Descriptions','onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1c4')});db[_0x5fa3('0x1cb')][_0x5fa3('0x112')](db['FreshdeskField'],{'as':_0x5fa3('0x1b8'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1c1')});db[_0x5fa3('0x1cb')]['belongsTo'](db[_0x5fa3('0xbb')],{'as':_0x5fa3('0x168'),'foreignKey':_0x5fa3('0x1bd')});db[_0x5fa3('0x1cb')][_0x5fa3('0x121')](db['Tag'],{'through':_0x5fa3('0x1cc')});db['FreshdeskField'][_0x5fa3('0x112')](db[_0x5fa3('0xbc')],{'as':_0x5fa3('0x1c2'),'foreignKey':'SubjectId'});db[_0x5fa3('0xbc')][_0x5fa3('0x112')](db[_0x5fa3('0xbc')],{'as':_0x5fa3('0x1c3'),'foreignKey':'DescriptionId'});db[_0x5fa3('0xbc')][_0x5fa3('0x112')](db[_0x5fa3('0xbc')],{'as':_0x5fa3('0x1c7'),'foreignKey':_0x5fa3('0x1c1')});db[_0x5fa3('0xbc')][_0x5fa3('0x14b')](db[_0x5fa3('0x95')],{'as':'Variable','foreignKey':'VariableId'});db['VtigerAccount'][_0x5fa3('0x112')](db[_0x5fa3('0xc0')],{'as':_0x5fa3('0x1bc'),'onDelete':'cascade','foreignKey':_0x5fa3('0x1bd')});db['VtigerConfiguration']['hasMany'](db[_0x5fa3('0xc1')],{'as':'Subjects','foreignKey':_0x5fa3('0x1bf')});db[_0x5fa3('0xc0')][_0x5fa3('0x112')](db['VtigerField'],{'as':'Descriptions','foreignKey':_0x5fa3('0x1c4')});db[_0x5fa3('0xc0')]['hasMany'](db[_0x5fa3('0xc1')],{'as':_0x5fa3('0x1b8'),'foreignKey':'FieldId'});db[_0x5fa3('0xc0')][_0x5fa3('0x14b')](db[_0x5fa3('0xbe')],{'as':_0x5fa3('0x168'),'foreignKey':_0x5fa3('0x1bd')});db[_0x5fa3('0xc1')][_0x5fa3('0x112')](db[_0x5fa3('0xc1')],{'as':_0x5fa3('0x1c2'),'foreignKey':'SubjectId'});db[_0x5fa3('0xc1')][_0x5fa3('0x112')](db['VtigerField'],{'as':_0x5fa3('0x1c3'),'foreignKey':'DescriptionId'});db['VtigerField'][_0x5fa3('0x112')](db[_0x5fa3('0xc1')],{'as':'Field','foreignKey':_0x5fa3('0x1c1')});db[_0x5fa3('0xc1')][_0x5fa3('0x14b')](db[_0x5fa3('0x95')],{'as':'Variable','foreignKey':'VariableId'});db[_0x5fa3('0x1cd')][_0x5fa3('0x112')](db[_0x5fa3('0xc3')],{'as':'Configurations','onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1bd')});db[_0x5fa3('0xc3')][_0x5fa3('0x112')](db[_0x5fa3('0xc5')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x5fa3('0xc3')][_0x5fa3('0x112')](db[_0x5fa3('0xc5')],{'as':_0x5fa3('0x1c0'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db['ServicenowField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x5fa3('0xc3')]['belongsTo'](db['ServicenowAccount'],{'as':_0x5fa3('0x168'),'foreignKey':_0x5fa3('0x1bd')});db['ServicenowField']['hasMany'](db[_0x5fa3('0xc5')],{'as':_0x5fa3('0x1c2'),'foreignKey':_0x5fa3('0x1bf')});db[_0x5fa3('0xc5')]['hasMany'](db[_0x5fa3('0xc5')],{'as':_0x5fa3('0x1c3'),'foreignKey':_0x5fa3('0x1c4')});db[_0x5fa3('0xc5')][_0x5fa3('0x112')](db['ServicenowField'],{'as':_0x5fa3('0x1c7'),'foreignKey':_0x5fa3('0x1c1')});db[_0x5fa3('0xc5')]['belongsTo'](db['Variable'],{'as':_0x5fa3('0x95'),'foreignKey':_0x5fa3('0x1c5')});db['Dynamics365Account'][_0x5fa3('0x112')](db[_0x5fa3('0x1ce')],{'as':_0x5fa3('0x1bc'),'onDelete':'cascade','foreignKey':_0x5fa3('0x1bd')});db[_0x5fa3('0x1cf')][_0x5fa3('0x14b')](db[_0x5fa3('0x107')],{'as':_0x5fa3('0x107'),'foreignKey':_0x5fa3('0x15e')});db[_0x5fa3('0x1ce')][_0x5fa3('0x112')](db['Dynamics365Field'],{'as':_0x5fa3('0x1be'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1bf')});db[_0x5fa3('0x1ce')][_0x5fa3('0x112')](db[_0x5fa3('0x1d0')],{'as':_0x5fa3('0x1c0'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1c4')});db[_0x5fa3('0x1ce')][_0x5fa3('0x112')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1c1')});db['Dynamics365Configuration'][_0x5fa3('0x14b')](db['Dynamics365Account'],{'as':_0x5fa3('0x168'),'foreignKey':_0x5fa3('0x1bd')});db[_0x5fa3('0x1d0')]['hasMany'](db[_0x5fa3('0x1d0')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x5fa3('0x1d0')][_0x5fa3('0x112')](db['Dynamics365Field'],{'as':_0x5fa3('0x1c3'),'foreignKey':_0x5fa3('0x1c4')});db[_0x5fa3('0x1d0')][_0x5fa3('0x112')](db[_0x5fa3('0x1d0')],{'as':_0x5fa3('0x1c7'),'foreignKey':'FieldId'});db[_0x5fa3('0x1d0')][_0x5fa3('0x14b')](db[_0x5fa3('0x95')],{'as':_0x5fa3('0x95'),'foreignKey':_0x5fa3('0x1c5')});db[_0x5fa3('0xc9')][_0x5fa3('0x112')](db[_0x5fa3('0xcb')],{'as':_0x5fa3('0x1bc'),'onDelete':_0x5fa3('0x10f'),'foreignKey':'AccountId'});db[_0x5fa3('0xcb')]['hasMany'](db['FreshsalesField'],{'as':_0x5fa3('0x1be'),'foreignKey':_0x5fa3('0x1bf')});db['FreshsalesConfiguration'][_0x5fa3('0x112')](db['FreshsalesField'],{'as':_0x5fa3('0x1c0'),'foreignKey':'DescriptionId'});db[_0x5fa3('0xcb')][_0x5fa3('0x112')](db[_0x5fa3('0x1d1')],{'as':_0x5fa3('0x1b8'),'foreignKey':_0x5fa3('0x1c1')});db['FreshsalesConfiguration'][_0x5fa3('0x14b')](db[_0x5fa3('0xc9')],{'as':'Account','foreignKey':_0x5fa3('0x1bd')});db[_0x5fa3('0x1d1')][_0x5fa3('0x112')](db['FreshsalesField'],{'as':'Subject','foreignKey':_0x5fa3('0x1bf')});db[_0x5fa3('0x1d1')][_0x5fa3('0x112')](db[_0x5fa3('0x1d1')],{'as':_0x5fa3('0x1c3'),'foreignKey':_0x5fa3('0x1c4')});db[_0x5fa3('0x1d1')][_0x5fa3('0x112')](db[_0x5fa3('0x1d1')],{'as':_0x5fa3('0x1c7'),'foreignKey':_0x5fa3('0x1c1')});db[_0x5fa3('0x1d1')][_0x5fa3('0x14b')](db[_0x5fa3('0x95')],{'as':_0x5fa3('0x95'),'foreignKey':_0x5fa3('0x1c5')});db[_0x5fa3('0xd0')]['belongsTo'](db[_0x5fa3('0x136')],{});db[_0x5fa3('0xd0')][_0x5fa3('0x14b')](db[_0x5fa3('0xf5')],{'as':'List','foreignKey':_0x5fa3('0x172')});db['ChatQueueReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x71')],{'as':_0x5fa3('0x15b'),'foreignKey':'ContactId'});db[_0x5fa3('0xd0')][_0x5fa3('0x14b')](db[_0x5fa3('0x18c')],{});db['ChatQueueReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x190')],{});db[_0x5fa3('0xd0')]['belongsTo'](db[_0x5fa3('0x13')],{});db['ChatQueueReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x6a')],{});db[_0x5fa3('0xd2')]['belongsTo'](db[_0x5fa3('0x13')],{'onDelete':'cascade','foreignKey':_0x5fa3('0x1d2')});db[_0x5fa3('0xd2')][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1d3')});db[_0x5fa3('0xd7')][_0x5fa3('0x112')](db[_0x5fa3('0xd6')],{'foreignKey':_0x5fa3('0x1d4'),'onDelete':'cascade'});db[_0x5fa3('0xd7')][_0x5fa3('0x112')](db[_0x5fa3('0xd4')],{'foreignKey':_0x5fa3('0x1d4'),'onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0xd9')][_0x5fa3('0x14b')](db[_0x5fa3('0x52')],{});db['SmsQueueReport']['belongsTo'](db[_0x5fa3('0xf5')],{'as':_0x5fa3('0x171'),'foreignKey':_0x5fa3('0x172')});db[_0x5fa3('0xd9')]['belongsTo'](db[_0x5fa3('0x71')],{'as':_0x5fa3('0x15b'),'foreignKey':_0x5fa3('0x15c')});db['SmsQueueReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x128')],{});db[_0x5fa3('0xd9')][_0x5fa3('0x14b')](db[_0x5fa3('0x57')],{});db[_0x5fa3('0xd9')][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{});db[_0x5fa3('0xd9')][_0x5fa3('0x14b')](db[_0x5fa3('0x59')],{});db[_0x5fa3('0xdd')][_0x5fa3('0x112')](db[_0x5fa3('0xd7')],{'foreignKey':_0x5fa3('0x1d5')});db[_0x5fa3('0xdd')]['hasMany'](db[_0x5fa3('0xd6')],{'foreignKey':_0x5fa3('0x1d5')});db['JscriptyProject']['hasMany'](db[_0x5fa3('0xd4')],{'foreignKey':_0x5fa3('0x1d5')});db[_0x5fa3('0x152')][_0x5fa3('0x121')](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x165'),'through':'user_has_teams'});db[_0x5fa3('0x152')][_0x5fa3('0x121')](db[_0x5fa3('0x1c')],{'through':_0x5fa3('0x1d6'),'as':_0x5fa3('0x12b')});db[_0x5fa3('0x152')][_0x5fa3('0x121')](db[_0x5fa3('0x12d')],{'through':'team_has_mail_queues','as':_0x5fa3('0x12e')});db[_0x5fa3('0x152')][_0x5fa3('0x121')](db[_0x5fa3('0x6a')],{'through':_0x5fa3('0x1d7'),'as':_0x5fa3('0x12f')});db[_0x5fa3('0x152')][_0x5fa3('0x121')](db[_0x5fa3('0x131')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0x5fa3('0x152')][_0x5fa3('0x121')](db[_0x5fa3('0x59')],{'through':_0x5fa3('0x182'),'as':_0x5fa3('0x1d8')});db[_0x5fa3('0x152')][_0x5fa3('0x121')](db[_0x5fa3('0x62')],{'through':_0x5fa3('0x189'),'as':_0x5fa3('0x133')});db[_0x5fa3('0x152')][_0x5fa3('0x121')](db[_0x5fa3('0x105')],{'through':_0x5fa3('0x1d9'),'as':_0x5fa3('0x135')});db[_0x5fa3('0x152')][_0x5fa3('0x121')](db[_0x5fa3('0xf7')],{'through':_0x5fa3('0x1da'),'as':_0x5fa3('0x12c')});db[_0x5fa3('0x1a0')][_0x5fa3('0x112')](db[_0x5fa3('0x73')],{'as':_0x5fa3('0x19a'),'foreignKey':_0x5fa3('0x1a1')});db[_0x5fa3('0x1a0')][_0x5fa3('0x112')](db[_0x5fa3('0x76')],{'as':_0x5fa3('0x117'),'foreignKey':_0x5fa3('0x1a1')});db[_0x5fa3('0x1a0')]['hasMany'](db[_0x5fa3('0x78')],{'as':'HopperHistories','foreignKey':'CampaignId'});db['Campaign'][_0x5fa3('0x112')](db[_0x5fa3('0x75')],{'as':'HopperBlacks','foreignKey':_0x5fa3('0x1a1')});db[_0x5fa3('0x1a0')][_0x5fa3('0x14b')](db[_0x5fa3('0x2c')],{'as':'Trunk','foreignKey':_0x5fa3('0x14c')});db['Campaign']['belongsTo'](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0x5fa3('0x14e')});db[_0x5fa3('0x1a0')][_0x5fa3('0x14b')](db[_0x5fa3('0x83')],{'as':_0x5fa3('0x83'),'foreignKey':'IntervalId'});db[_0x5fa3('0x1a0')]['belongsTo'](db['SquareProject'],{'as':'SquareProject','foreignKey':_0x5fa3('0x1db')});db[_0x5fa3('0x1a0')][_0x5fa3('0x121')](db[_0x5fa3('0xf5')],{'as':_0x5fa3('0x125'),'through':_0x5fa3('0x1dc')});db[_0x5fa3('0x1a0')][_0x5fa3('0x121')](db[_0x5fa3('0xf5')],{'as':_0x5fa3('0x154'),'through':_0x5fa3('0x1dd')});db[_0x5fa3('0xea')][_0x5fa3('0x14b')](db[_0x5fa3('0x16f')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0x5fa3('0xee')][_0x5fa3('0x14b')](db[_0x5fa3('0x42')],{});db['MailTransferReport'][_0x5fa3('0x14b')](db['MailInteraction'],{});db['MailTransferReport'][_0x5fa3('0x14b')](db['MailAccount'],{'foreignKey':_0x5fa3('0x1de'),'as':'FromAccount'});db['MailTransferReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'foreignKey':'FromUserId','as':_0x5fa3('0x1df')});db['MailTransferReport']['belongsTo'](db[_0x5fa3('0x13')],{'foreignKey':_0x5fa3('0x1e0'),'as':_0x5fa3('0x1e1')});db[_0x5fa3('0xee')][_0x5fa3('0x14b')](db[_0x5fa3('0x12d')],{'foreignKey':_0x5fa3('0x1e2'),'as':_0x5fa3('0x1e3')});db[_0x5fa3('0xee')][_0x5fa3('0x14b')](db[_0x5fa3('0x3c')],{'foreignKey':_0x5fa3('0x1e4'),'as':'ToAccount'});db[_0x5fa3('0x1e5')][_0x5fa3('0x14b')](db[_0x5fa3('0x190')],{});db[_0x5fa3('0x1e5')][_0x5fa3('0x14b')](db[_0x5fa3('0x18c')],{});db[_0x5fa3('0x1e5')]['belongsTo'](db[_0x5fa3('0x136')],{'foreignKey':_0x5fa3('0x1e6'),'as':'FromAccount'});db['ChatTransferReport'][_0x5fa3('0x14b')](db['User'],{'foreignKey':_0x5fa3('0x1e7'),'as':'FromAgent'});db['ChatTransferReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'foreignKey':_0x5fa3('0x1e0'),'as':_0x5fa3('0x1e1')});db[_0x5fa3('0x1e5')][_0x5fa3('0x14b')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db[_0x5fa3('0x1e5')][_0x5fa3('0x14b')](db[_0x5fa3('0x136')],{'foreignKey':_0x5fa3('0x1e8'),'as':_0x5fa3('0x1e9')});db['FaxTransferReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x4d')],{});db[_0x5fa3('0xf0')][_0x5fa3('0x14b')](db[_0x5fa3('0x4c')],{});db[_0x5fa3('0xf0')]['belongsTo'](db[_0x5fa3('0x49')],{'foreignKey':_0x5fa3('0x1ea'),'as':_0x5fa3('0x1eb')});db[_0x5fa3('0xf0')][_0x5fa3('0x14b')](db['User'],{'foreignKey':_0x5fa3('0x1e7'),'as':_0x5fa3('0x1df')});db[_0x5fa3('0xf0')][_0x5fa3('0x14b')](db['User'],{'foreignKey':_0x5fa3('0x1e0'),'as':_0x5fa3('0x1e1')});db['FaxTransferReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x131')],{'foreignKey':_0x5fa3('0x1ec'),'as':_0x5fa3('0x1e3')});db['FaxTransferReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x49')],{'foreignKey':_0x5fa3('0x1ed'),'as':_0x5fa3('0x1e9')});db[_0x5fa3('0xf2')]['belongsTo'](db[_0x5fa3('0x185')],{});db[_0x5fa3('0xf2')][_0x5fa3('0x14b')](db[_0x5fa3('0x5f')],{});db[_0x5fa3('0xf2')][_0x5fa3('0x14b')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db[_0x5fa3('0xf2')]['belongsTo'](db[_0x5fa3('0x13')],{'foreignKey':'FromUserId','as':_0x5fa3('0x1df')});db['OpenchannelTransferReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'foreignKey':_0x5fa3('0x1e0'),'as':'ToAgent'});db[_0x5fa3('0xf2')][_0x5fa3('0x14b')](db[_0x5fa3('0x62')],{'foreignKey':_0x5fa3('0x1ee'),'as':'ToQueue'});db[_0x5fa3('0xf2')][_0x5fa3('0x14b')](db[_0x5fa3('0x5b')],{'foreignKey':_0x5fa3('0x1ef'),'as':_0x5fa3('0x1e9')});db[_0x5fa3('0x1f0')][_0x5fa3('0x14b')](db[_0x5fa3('0x57')],{});db[_0x5fa3('0x1f0')][_0x5fa3('0x14b')](db[_0x5fa3('0x128')],{});db[_0x5fa3('0x1f0')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x5fa3('0x1f1'),'as':_0x5fa3('0x1eb')});db['SmsTransferReport']['belongsTo'](db[_0x5fa3('0x13')],{'foreignKey':_0x5fa3('0x1e7'),'as':_0x5fa3('0x1df')});db[_0x5fa3('0x1f0')][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'foreignKey':_0x5fa3('0x1e0'),'as':'ToAgent'});db['SmsTransferReport']['belongsTo'](db[_0x5fa3('0x59')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0x5fa3('0x1f0')][_0x5fa3('0x14b')](db[_0x5fa3('0x52')],{'foreignKey':_0x5fa3('0x1f2'),'as':_0x5fa3('0x1e9')});db['CmList']['hasMany'](db['Disposition'],{'as':_0x5fa3('0x161'),'foreignKey':_0x5fa3('0x172'),'onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0xf5')]['hasMany'](db[_0x5fa3('0x7b')],{'as':_0x5fa3('0x1f3'),'foreignKey':_0x5fa3('0x172')});db[_0x5fa3('0xf5')][_0x5fa3('0x112')](db[_0x5fa3('0x71')],{'as':_0x5fa3('0x123'),'onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x172')});db[_0x5fa3('0xf5')]['hasMany'](db[_0x5fa3('0x76')],{'as':_0x5fa3('0x117'),'foreignKey':'ListId'});db['CmList'][_0x5fa3('0x112')](db[_0x5fa3('0x78')],{'as':_0x5fa3('0x118'),'foreignKey':_0x5fa3('0x172')});db[_0x5fa3('0xf5')][_0x5fa3('0x112')](db[_0x5fa3('0x79')],{'as':_0x5fa3('0x79'),'foreignKey':'ListId'});db[_0x5fa3('0xf5')][_0x5fa3('0x121')](db['VoiceQueue'],{'as':_0x5fa3('0x1f4'),'through':_0x5fa3('0x151')});db[_0x5fa3('0xf5')][_0x5fa3('0x121')](db[_0x5fa3('0x13')],{'as':'Agents','through':_0x5fa3('0x126')});db[_0x5fa3('0xf7')]['hasMany'](db['VoiceExtension'],{'as':_0x5fa3('0x116'),'onDelete':'cascade'});db[_0x5fa3('0xf7')][_0x5fa3('0x121')](db[_0x5fa3('0x13')],{'as':_0x5fa3('0x165'),'through':'UserVoicePrefix'});db[_0x5fa3('0xf7')][_0x5fa3('0x121')](db[_0x5fa3('0x152')],{'through':'TeamVoicePrefix','as':_0x5fa3('0x153')});db[_0x5fa3('0xf9')][_0x5fa3('0x112')](db['User'],{'as':_0x5fa3('0x16b'),'foreignKey':_0x5fa3('0x1f5')});db[_0x5fa3('0xf9')][_0x5fa3('0x112')](db['UserProfileSection'],{'as':_0x5fa3('0x1f6'),'foreignKey':_0x5fa3('0x1f5'),'onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x1f7')][_0x5fa3('0x112')](db[_0x5fa3('0x1f8')],{'as':_0x5fa3('0x1f9'),'foreignKey':_0x5fa3('0x1fa'),'onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x140')][_0x5fa3('0x112')](db[_0x5fa3('0x81')],{'as':'Dispositions','foreignKey':_0x5fa3('0x1fb'),'onDelete':_0x5fa3('0x10f')});db[_0x5fa3('0x140')][_0x5fa3('0x112')](db[_0x5fa3('0x80')],{'as':_0x5fa3('0x176'),'foreignKey':_0x5fa3('0x1fb')});db[_0x5fa3('0x140')]['hasMany'](db[_0x5fa3('0x102')],{'as':_0x5fa3('0x156'),'foreignKey':_0x5fa3('0x1fb')});db['WhatsappAccount'][_0x5fa3('0x112')](db[_0x5fa3('0x101')],{'as':_0x5fa3('0x162')});db[_0x5fa3('0x140')][_0x5fa3('0x112')](db[_0x5fa3('0xff')],{'as':_0x5fa3('0x177')});db[_0x5fa3('0x140')]['belongsTo'](db[_0x5fa3('0xf5')],{'as':_0x5fa3('0x171'),'foreignKey':'ListId'});db['WhatsappAccount'][_0x5fa3('0x14b')](db[_0x5fa3('0x85')],{'as':_0x5fa3('0x150'),'foreignKey':_0x5fa3('0x164')});db[_0x5fa3('0x140')]['belongsToMany'](db['User'],{'as':_0x5fa3('0x165'),'through':_0x5fa3('0x142')});db[_0x5fa3('0xff')][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'onDelete':_0x5fa3('0x15f')});db['WhatsappApplication']['belongsTo'](db[_0x5fa3('0x105')],{'onDelete':'restrict'});db[_0x5fa3('0xff')][_0x5fa3('0x14b')](db[_0x5fa3('0x140')],{'onDelete':_0x5fa3('0x15f')});db[_0x5fa3('0xff')][_0x5fa3('0x14b')](db[_0x5fa3('0x83')],{'onDelete':_0x5fa3('0x15f'),'foreignKey':_0x5fa3('0x14f')});db['WhatsappApplication'][_0x5fa3('0x14b')](db[_0x5fa3('0x8b')],{'onDelete':_0x5fa3('0x15f'),'foreignKey':_0x5fa3('0x170')});db['WhatsappInteraction'][_0x5fa3('0x112')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0x5fa3('0x10f'),'foreignKey':_0x5fa3('0x1fc')});db['WhatsappInteraction'][_0x5fa3('0x14b')](db[_0x5fa3('0x140')],{'as':'Account','foreignKey':_0x5fa3('0x1fb')});db['WhatsappInteraction'][_0x5fa3('0x14b')](db[_0x5fa3('0x71')],{'as':'Contact','foreignKey':_0x5fa3('0x15c')});db['WhatsappInteraction'][_0x5fa3('0x14b')](db['User'],{'as':_0x5fa3('0x187'),'foreignKey':_0x5fa3('0x110')});db[_0x5fa3('0x101')][_0x5fa3('0x121')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0x5fa3('0x101')]['belongsToMany'](db['Tag'],{'through':_0x5fa3('0x1fd'),'as':_0x5fa3('0x16a')});db['WhatsappInteraction']['belongsToMany'](db[_0x5fa3('0x13')],{'as':'Users','through':_0x5fa3('0x1fe'),'foreignKey':_0x5fa3('0x1fc')});db[_0x5fa3('0x102')]['belongsTo'](db['User'],{'as':_0x5fa3('0x13')});db[_0x5fa3('0x102')][_0x5fa3('0x14b')](db['CmContact'],{'onDelete':_0x5fa3('0x10f'),'as':'Contact'});db[_0x5fa3('0x102')][_0x5fa3('0x14b')](db[_0x5fa3('0x101')],{'onDelete':_0x5fa3('0x10f'),'as':_0x5fa3('0x16d'),'foreignKey':_0x5fa3('0x1fc')});db['WhatsappMessage'][_0x5fa3('0x14b')](db[_0x5fa3('0x140')],{'as':_0x5fa3('0x168'),'foreignKey':_0x5fa3('0x1fb')});db[_0x5fa3('0x1ff')][_0x5fa3('0x14b')](db[_0x5fa3('0x140')],{});db[_0x5fa3('0x1ff')][_0x5fa3('0x14b')](db[_0x5fa3('0xf5')],{'as':_0x5fa3('0x171'),'foreignKey':_0x5fa3('0x172')});db[_0x5fa3('0x1ff')][_0x5fa3('0x14b')](db[_0x5fa3('0x71')],{'as':_0x5fa3('0x15b'),'foreignKey':_0x5fa3('0x15c')});db[_0x5fa3('0x1ff')][_0x5fa3('0x14b')](db['WhatsappInteraction'],{});db[_0x5fa3('0x1ff')][_0x5fa3('0x14b')](db[_0x5fa3('0x105')],{});db['WhatsappQueueReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x102')],{});db[_0x5fa3('0x1ff')][_0x5fa3('0x14b')](db['User'],{});db[_0x5fa3('0x104')][_0x5fa3('0x14b')](db[_0x5fa3('0x102')],{});db[_0x5fa3('0x104')][_0x5fa3('0x14b')](db[_0x5fa3('0x101')],{});db[_0x5fa3('0x104')][_0x5fa3('0x14b')](db[_0x5fa3('0x140')],{'foreignKey':_0x5fa3('0x200'),'as':_0x5fa3('0x1eb')});db['WhatsappTransferReport']['belongsTo'](db[_0x5fa3('0x140')],{'foreignKey':_0x5fa3('0x201'),'as':'ToAccount'});db[_0x5fa3('0x104')][_0x5fa3('0x14b')](db[_0x5fa3('0x105')],{'foreignKey':_0x5fa3('0x202'),'as':_0x5fa3('0x1e3')});db[_0x5fa3('0x104')]['belongsTo'](db[_0x5fa3('0x13')],{'foreignKey':'FromUserId','as':_0x5fa3('0x1df')});db['WhatsappTransferReport'][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'foreignKey':_0x5fa3('0x1e0'),'as':'ToAgent'});db['WhatsappQueue'][_0x5fa3('0x121')](db[_0x5fa3('0x13')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0x5fa3('0x203')});db[_0x5fa3('0x105')][_0x5fa3('0x121')](db[_0x5fa3('0x152')],{'through':'team_has_whatsapp_queues','as':_0x5fa3('0x153')});db['UserSetting'][_0x5fa3('0x14b')](db[_0x5fa3('0x13')],{'as':'user','foreignKey':'UserId','onDelete':_0x5fa3('0x10f'),'hooks':!![]});db[_0x5fa3('0x107')][_0x5fa3('0x10d')](db[_0x5fa3('0x1cf')],{'as':_0x5fa3('0x1cf'),'onDelete':'restrict'});db[_0x5fa3('0x107')][_0x5fa3('0x10d')](db['MailServerIn'],{'as':_0x5fa3('0x204'),'onDelete':_0x5fa3('0x15f')});db['CloudProvider'][_0x5fa3('0x10d')](db['MailServerOut'],{'as':_0x5fa3('0x205'),'onDelete':_0x5fa3('0x15f')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index ddd66e0..fb114e4 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c5b=['/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./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/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerField','./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/integrations/freshsales/accounts','/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/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/realtime','/api/user-settings','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','/api/rpc','./api/rpc','./api/version','./api/system','/api/pm2','./api/webbar','/apidoc','static','join','root','/www','snippet','3.1.0','/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','./api/client-side-logs','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','/api/sms/interactions','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue'];(function(_0x4da835,_0x45f0fa){var _0x23ed1c=function(_0x236c36){while(--_0x236c36){_0x4da835['push'](_0x4da835['shift']());}};_0x23ed1c(++_0x45f0fa);}(_0x5c5b,0x1de));var _0xb5c5=function(_0x5e1e25,_0xdc1421){_0x5e1e25=_0x5e1e25-0x0;var _0x548e5f=_0x5c5b[_0x5e1e25];return _0x548e5f;};'use strict';var path=require(_0xb5c5('0x0'));var express=require(_0xb5c5('0x1'));var errors=require(_0xb5c5('0x2'));var config=require(_0xb5c5('0x3'));var setupLoggers=require(_0xb5c5('0x4'))['setupLoggers'];var clientSideLogs=require(_0xb5c5('0x5'));exports['default']=function(_0x5dafe9){return setupLoggers(_0x5dafe9)[_0xb5c5('0x6')](function(){_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x8'),require(_0xb5c5('0x9')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xa'),require(_0xb5c5('0xb')));_0x5dafe9['use'](_0xb5c5('0xc'),require(_0xb5c5('0xd')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xe'),require(_0xb5c5('0xf')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x10'),require(_0xb5c5('0x11')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x12'),require('./api/voiceQueue'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x13'),require(_0xb5c5('0x14')));_0x5dafe9['use'](_0xb5c5('0x15'),require(_0xb5c5('0x16')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x17'),require(_0xb5c5('0x18')));_0x5dafe9[_0xb5c5('0x7')]('/api/voice/mails/messages',require(_0xb5c5('0x19')));_0x5dafe9[_0xb5c5('0x7')]('/api/voice/calls/reports',require(_0xb5c5('0x1a')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x1b'),require(_0xb5c5('0x1c')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x1d'),require(_0xb5c5('0x1e')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x1f'),require('./api/voiceQueueReport'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x20'),require('./api/memberReport'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x21'),require(_0xb5c5('0x22')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x23'),require(_0xb5c5('0x24')));_0x5dafe9['use'](_0xb5c5('0x25'),require(_0xb5c5('0x26')));_0x5dafe9['use'](_0xb5c5('0x27'),require(_0xb5c5('0x28')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x29'),require(_0xb5c5('0x2a')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x2b'),require('./api/mailSubstatus'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x2c'),require(_0xb5c5('0x2d')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x2e'),require('./api/mailMessage'));_0x5dafe9['use']('/api/mail/applications',require(_0xb5c5('0x2f')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x30'),require(_0xb5c5('0x31')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x32'),require('./api/dashboard'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x33'),require(_0xb5c5('0x34')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x35'),require(_0xb5c5('0x36')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x37'),require(_0xb5c5('0x38')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x39'),require(_0xb5c5('0x3a')));_0x5dafe9['use'](_0xb5c5('0x3b'),require(_0xb5c5('0x3c')));_0x5dafe9[_0xb5c5('0x7')]('/api/fax/queues',require(_0xb5c5('0x3d')));_0x5dafe9['use'](_0xb5c5('0x3e'),require(_0xb5c5('0x3f')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x40'),require('./api/smsAccount'));_0x5dafe9['use'](_0xb5c5('0x41'),require('./api/smsApplication'));_0x5dafe9['use'](_0xb5c5('0x42'),require('./api/smsInteraction'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x43'),require(_0xb5c5('0x44')));_0x5dafe9[_0xb5c5('0x7')]('/api/sms/queues',require(_0xb5c5('0x45')));_0x5dafe9['use'](_0xb5c5('0x46'),require(_0xb5c5('0x47')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x48'),require(_0xb5c5('0x49')));_0x5dafe9[_0xb5c5('0x7')]('/api/openchannel/interactions',require(_0xb5c5('0x4a')));_0x5dafe9['use']('/api/openchannel/messages',require(_0xb5c5('0x4b')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x4c'),require(_0xb5c5('0x4d')));_0x5dafe9[_0xb5c5('0x7')]('/api/chat/websites',require(_0xb5c5('0x4e')));_0x5dafe9[_0xb5c5('0x7')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x4f'),require('./api/chatApplication'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x50'),require(_0xb5c5('0x51')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x52'),require(_0xb5c5('0x53')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x54'),require(_0xb5c5('0x55')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x56'),require(_0xb5c5('0x57')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x58'),require(_0xb5c5('0x59')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x5a'),require('./api/chatProactiveAction'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x5b'),require(_0xb5c5('0x5c')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x5d'),require(_0xb5c5('0x5e')));_0x5dafe9[_0xb5c5('0x7')]('/api/cm/hopper',require('./api/cmHopper'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x5f'),require(_0xb5c5('0x60')));_0x5dafe9[_0xb5c5('0x7')]('/api/cm/hopper_final',require(_0xb5c5('0x61')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x62'),require('./api/cmHopperHistory'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x63'),require(_0xb5c5('0x64')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x65'),require(_0xb5c5('0x66')));_0x5dafe9['use'](_0xb5c5('0x67'),require(_0xb5c5('0x68')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x69'),require(_0xb5c5('0x6a')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x6b'),require(_0xb5c5('0x6c')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x6d'),require('./api/condition'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x6e'),require('./api/interval'));_0x5dafe9[_0xb5c5('0x7')]('/api/pauses',require(_0xb5c5('0x6f')));_0x5dafe9[_0xb5c5('0x7')]('/api/cdr',require(_0xb5c5('0x70')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x71'),require(_0xb5c5('0x72')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x73'),require(_0xb5c5('0x74')));_0x5dafe9['use'](_0xb5c5('0x75'),require(_0xb5c5('0x76')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x77'),require(_0xb5c5('0x78')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x79'),require(_0xb5c5('0x7a')));_0x5dafe9[_0xb5c5('0x7')]('/api/cm_contact_has_items',require(_0xb5c5('0x7b')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x7c'),require('./api/cmHopperAdditionalPhone'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x7d'),require(_0xb5c5('0x7e')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x7f'),require(_0xb5c5('0x80')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x81'),require('./api/variable'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x82'),require(_0xb5c5('0x83')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x84'),require(_0xb5c5('0x85')));_0x5dafe9[_0xb5c5('0x7')]('/api/analytics/custom_reports',require(_0xb5c5('0x86')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x87'),require(_0xb5c5('0x88')));_0x5dafe9['use']('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x5dafe9['use'](_0xb5c5('0x89'),require(_0xb5c5('0x8a')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x8b'),require(_0xb5c5('0x8c')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x8d'),require(_0xb5c5('0x8e')));_0x5dafe9[_0xb5c5('0x7')]('/api/integrations/salesforce/accounts',require(_0xb5c5('0x8f')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x90'),require(_0xb5c5('0x91')));_0x5dafe9['use'](_0xb5c5('0x92'),require(_0xb5c5('0x93')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x94'),require(_0xb5c5('0x95')));_0x5dafe9['use'](_0xb5c5('0x96'),require(_0xb5c5('0x97')));_0x5dafe9[_0xb5c5('0x7')]('/api/integrations/sugarcrm/fields',require(_0xb5c5('0x98')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x99'),require(_0xb5c5('0x9a')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x9b'),require(_0xb5c5('0x9c')));_0x5dafe9['use'](_0xb5c5('0x9d'),require('./api/intDeskField'));_0x5dafe9['use'](_0xb5c5('0x9e'),require('./api/intZohoAccount'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x9f'),require(_0xb5c5('0xa0')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xa1'),require('./api/intZohoField'));_0x5dafe9['use'](_0xb5c5('0xa2'),require(_0xb5c5('0xa3')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xa4'),require(_0xb5c5('0xa5')));_0x5dafe9[_0xb5c5('0x7')]('/api/integrations/zendesk/fields',require(_0xb5c5('0xa6')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xa7'),require(_0xb5c5('0xa8')));_0x5dafe9['use'](_0xb5c5('0xa9'),require(_0xb5c5('0xaa')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xab'),require(_0xb5c5('0xac')));_0x5dafe9[_0xb5c5('0x7')]('/api/integrations/vtiger/accounts',require(_0xb5c5('0xad')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xae'),require('./api/intVtigerConfiguration'));_0x5dafe9[_0xb5c5('0x7')]('/api/integrations/vtiger/fields',require(_0xb5c5('0xaf')));_0x5dafe9[_0xb5c5('0x7')]('/api/integrations/servicenow/accounts',require(_0xb5c5('0xb0')));_0x5dafe9[_0xb5c5('0x7')]('/api/integrations/servicenow/configurations',require(_0xb5c5('0xb1')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xb2'),require(_0xb5c5('0xb3')));_0x5dafe9['use'](_0xb5c5('0xb4'),require(_0xb5c5('0xb5')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xb6'),require(_0xb5c5('0xb7')));_0x5dafe9['use'](_0xb5c5('0xb8'),require(_0xb5c5('0xb9')));_0x5dafe9['use'](_0xb5c5('0xba'),require('./api/intFreshsalesAccount'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xbb'),require(_0xb5c5('0xbc')));_0x5dafe9['use'](_0xb5c5('0xbd'),require(_0xb5c5('0xbe')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xbf'),require(_0xb5c5('0xc0')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xc1'),require(_0xb5c5('0xc2')));_0x5dafe9['use'](_0xb5c5('0xc3'),require('./api/chatInternalMessage'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xc4'),require(_0xb5c5('0xc5')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xc6'),require(_0xb5c5('0xc7')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xc8'),require(_0xb5c5('0xc9')));_0x5dafe9[_0xb5c5('0x7')]('/api/sms/reports/queue',require(_0xb5c5('0xca')));_0x5dafe9['use'](_0xb5c5('0xcb'),require(_0xb5c5('0xcc')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xcd'),require(_0xb5c5('0xce')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xcf'),require('./api/jscriptyProject'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xd0'),require(_0xb5c5('0xd1')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xd2'),require(_0xb5c5('0xd3')));_0x5dafe9['use'](_0xb5c5('0xd4'),require(_0xb5c5('0xd5')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xd6'),require(_0xb5c5('0xd7')));_0x5dafe9['use'](_0xb5c5('0xd8'),require(_0xb5c5('0xd9')));_0x5dafe9[_0xb5c5('0x7')]('/api/teams',require(_0xb5c5('0xda')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xdb'),require(_0xb5c5('0xdc')));_0x5dafe9[_0xb5c5('0x7')]('/api/campaigns',require(_0xb5c5('0xdd')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xde'),require('./api/migration'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xdf'),require(_0xb5c5('0xe0')));_0x5dafe9[_0xb5c5('0x7')]('/api/plugins',require(_0xb5c5('0xe1')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xe2'),require(_0xb5c5('0xe3')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xe4'),require('./api/chatTransferReport'));_0x5dafe9[_0xb5c5('0x7')]('/api/fax/reports/transfer',require(_0xb5c5('0xe5')));_0x5dafe9['use'](_0xb5c5('0xe6'),require(_0xb5c5('0xe7')));_0x5dafe9['use'](_0xb5c5('0xe8'),require(_0xb5c5('0xe9')));_0x5dafe9[_0xb5c5('0x7')]('/api/cm/lists',require(_0xb5c5('0xea')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xeb'),require(_0xb5c5('0xec')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xed'),require(_0xb5c5('0xee')));_0x5dafe9['use'](_0xb5c5('0xef'),require(_0xb5c5('0xf0')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xf1'),require('./api/userProfileResource'));_0x5dafe9['use'](_0xb5c5('0xf2'),require(_0xb5c5('0xf3')));_0x5dafe9['use'](_0xb5c5('0xf4'),require(_0xb5c5('0xf5')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xf6'),require('./api/whatsappApplication'));_0x5dafe9[_0xb5c5('0x7')]('/api/whatsapp/interactions',require(_0xb5c5('0xf7')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xf8'),require(_0xb5c5('0xf9')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xfa'),require('./api/whatsappQueueReport'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xfb'),require(_0xb5c5('0xfc')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xfd'),require('./api/whatsappQueue'));_0x5dafe9[_0xb5c5('0x7')]('/api/cloudProviders',require('./api/cloudProvider'));_0x5dafe9[_0xb5c5('0x7')]('/api/realtime',require(_0xb5c5('0xfe')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0xff'),require(_0xb5c5('0x100')));_0x5dafe9[_0xb5c5('0x7')]('/api/auth/local',require(_0xb5c5('0x101')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x102'),require(_0xb5c5('0x103')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x104'),require('./api/authActiveDirectory'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x105'),require('./api/jira'));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x106'),require(_0xb5c5('0x107')));_0x5dafe9[_0xb5c5('0x7')]('/api/version',require(_0xb5c5('0x108')));_0x5dafe9[_0xb5c5('0x7')]('/api/system',require(_0xb5c5('0x109')));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x10a'),require('./api/pm2'));_0x5dafe9[_0xb5c5('0x7')]('/api/webbar',require(_0xb5c5('0x10b')));_0x5dafe9['use']('/api/logs',clientSideLogs);_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x10c'),express[_0xb5c5('0x10d')](path[_0xb5c5('0x10e')](config[_0xb5c5('0x10f')],_0xb5c5('0x10c'))));_0x5dafe9[_0xb5c5('0x7')](_0xb5c5('0x110'),express[_0xb5c5('0x10d')](path[_0xb5c5('0x10e')](config[_0xb5c5('0x10f')],_0xb5c5('0x110'))));_0x5dafe9[_0xb5c5('0x7')]('/demo',express[_0xb5c5('0x10d')](path[_0xb5c5('0x10e')](config['root'],'/demo')));_0x5dafe9['use']('/snippet',express[_0xb5c5('0x10d')](path[_0xb5c5('0x10e')](config[_0xb5c5('0x10f')],_0xb5c5('0x111'),_0xb5c5('0x112'))));_0x5dafe9[_0xb5c5('0x7')]('/plugins',express[_0xb5c5('0x10d')](path[_0xb5c5('0x10e')](config['root'],_0xb5c5('0x113'))));_0x5dafe9[_0xb5c5('0x114')](_0xb5c5('0x115'))['get'](errors[0x194]);_0x5dafe9['route']('/*')[_0xb5c5('0x116')](function(_0x290c55,_0x5476a1){_0x5476a1[_0xb5c5('0x117')](path[_0xb5c5('0x118')](_0x5dafe9[_0xb5c5('0x116')](_0xb5c5('0x119'))+_0xb5c5('0x11a')));});return _0x5dafe9;});}; \ No newline at end of file +var _0xb9ac=['./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/api/logs','join','root','/apidoc','/www','static','/demo','/snippet','snippet','/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','./api/client-side-logs','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceExtension','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages'];(function(_0x26be50,_0x569295){var _0x4754f8=function(_0x5eb1dd){while(--_0x5eb1dd){_0x26be50['push'](_0x26be50['shift']());}};_0x4754f8(++_0x569295);}(_0xb9ac,0xed));var _0xcb9a=function(_0x47f353,_0x53d1b4){_0x47f353=_0x47f353-0x0;var _0x4a7b8e=_0xb9ac[_0x47f353];return _0x4a7b8e;};'use strict';var path=require(_0xcb9a('0x0'));var express=require(_0xcb9a('0x1'));var errors=require(_0xcb9a('0x2'));var config=require(_0xcb9a('0x3'));var setupLoggers=require(_0xcb9a('0x4'))['setupLoggers'];var clientSideLogs=require(_0xcb9a('0x5'));exports['default']=function(_0x1b80eb){return setupLoggers(_0x1b80eb)['then'](function(){_0x1b80eb['use'](_0xcb9a('0x6'),require(_0xcb9a('0x7')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x9'),require(_0xcb9a('0xa')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xb'),require('./api/voiceContext'));_0x1b80eb[_0xcb9a('0x8')]('/api/voice/extensions',require(_0xcb9a('0xc')));_0x1b80eb[_0xcb9a('0x8')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x1b80eb['use'](_0xcb9a('0xd'),require(_0xcb9a('0xe')));_0x1b80eb['use'](_0xcb9a('0xf'),require(_0xcb9a('0x10')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x11'),require('./api/screenRecording'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x12'),require(_0xcb9a('0x13')));_0x1b80eb['use'](_0xcb9a('0x14'),require(_0xcb9a('0x15')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x16'),require('./api/voiceCallReport'));_0x1b80eb[_0xcb9a('0x8')]('/api/voice/dials/reports',require(_0xcb9a('0x17')));_0x1b80eb[_0xcb9a('0x8')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x18'),require(_0xcb9a('0x19')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x1a'),require(_0xcb9a('0x1b')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x1c'),require('./api/trunk'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x1d'),require(_0xcb9a('0x1e')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x1f'),require('./api/mailServerOut'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x20'),require(_0xcb9a('0x21')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x22'),require('./api/mailQueue'));_0x1b80eb[_0xcb9a('0x8')]('/api/mail/substatuses',require(_0xcb9a('0x23')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x24'),require(_0xcb9a('0x25')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x26'),require(_0xcb9a('0x27')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x28'),require('./api/mailApplication'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x29'),require(_0xcb9a('0x2a')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x2b'),require(_0xcb9a('0x2c')));_0x1b80eb['use'](_0xcb9a('0x2d'),require(_0xcb9a('0x2e')));_0x1b80eb['use'](_0xcb9a('0x2f'),require(_0xcb9a('0x30')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x31'),require(_0xcb9a('0x32')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x33'),require('./api/faxInteraction'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x34'),require(_0xcb9a('0x35')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x36'),require(_0xcb9a('0x37')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x38'),require(_0xcb9a('0x39')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x3a'),require(_0xcb9a('0x3b')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x3c'),require(_0xcb9a('0x3d')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x3e'),require(_0xcb9a('0x3f')));_0x1b80eb['use']('/api/sms/messages',require(_0xcb9a('0x40')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x41'),require('./api/smsQueue'));_0x1b80eb['use']('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x1b80eb[_0xcb9a('0x8')]('/api/openchannel/applications',require(_0xcb9a('0x42')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x43'),require('./api/openchannelInteraction'));_0x1b80eb['use'](_0xcb9a('0x44'),require(_0xcb9a('0x45')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x46'),require('./api/openchannelQueue'));_0x1b80eb[_0xcb9a('0x8')]('/api/chat/websites',require(_0xcb9a('0x47')));_0x1b80eb[_0xcb9a('0x8')]('/api/openchannel/reports/queue',require(_0xcb9a('0x48')));_0x1b80eb[_0xcb9a('0x8')]('/api/chat/applications',require('./api/chatApplication'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x49'),require(_0xcb9a('0x4a')));_0x1b80eb[_0xcb9a('0x8')]('/api/chat/messages',require(_0xcb9a('0x4b')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x4c'),require('./api/chatOfflineMessage'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x4d'),require('./api/chatQueue'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x4e'),require(_0xcb9a('0x4f')));_0x1b80eb['use'](_0xcb9a('0x50'),require(_0xcb9a('0x51')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x52'),require(_0xcb9a('0x53')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x54'),require(_0xcb9a('0x55')));_0x1b80eb['use'](_0xcb9a('0x56'),require(_0xcb9a('0x57')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x58'),require('./api/cmHopperBlack'));_0x1b80eb[_0xcb9a('0x8')]('/api/cm/hopper_final',require(_0xcb9a('0x59')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x5a'),require(_0xcb9a('0x5b')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x5c'),require('./api/cmCustomField'));_0x1b80eb['use'](_0xcb9a('0x5d'),require(_0xcb9a('0x5e')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x5f'),require(_0xcb9a('0x60')));_0x1b80eb[_0xcb9a('0x8')]('/api/canned_answers',require(_0xcb9a('0x61')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x62'),require(_0xcb9a('0x63')));_0x1b80eb['use'](_0xcb9a('0x64'),require(_0xcb9a('0x65')));_0x1b80eb[_0xcb9a('0x8')]('/api/intervals',require(_0xcb9a('0x66')));_0x1b80eb[_0xcb9a('0x8')]('/api/pauses',require(_0xcb9a('0x67')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x68'),require(_0xcb9a('0x69')));_0x1b80eb[_0xcb9a('0x8')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x1b80eb[_0xcb9a('0x8')]('/api/schedules',require('./api/schedule'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x6a'),require(_0xcb9a('0x6b')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x6c'),require('./api/tag'));_0x1b80eb['use'](_0xcb9a('0x6d'),require(_0xcb9a('0x6e')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x6f'),require(_0xcb9a('0x70')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x71'),require('./api/cmHopperAdditionalPhone'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x72'),require(_0xcb9a('0x73')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x74'),require(_0xcb9a('0x75')));_0x1b80eb['use'](_0xcb9a('0x76'),require(_0xcb9a('0x77')));_0x1b80eb['use'](_0xcb9a('0x78'),require(_0xcb9a('0x79')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x7a'),require('./api/integrationReport'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x7b'),require(_0xcb9a('0x7c')));_0x1b80eb['use'](_0xcb9a('0x7d'),require(_0xcb9a('0x7e')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x7f'),require(_0xcb9a('0x80')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x81'),require('./api/analyticMetric'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x82'),require(_0xcb9a('0x83')));_0x1b80eb['use']('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x1b80eb['use'](_0xcb9a('0x84'),require(_0xcb9a('0x85')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x86'),require(_0xcb9a('0x87')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x88'),require(_0xcb9a('0x89')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x8a'),require(_0xcb9a('0x8b')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x8c'),require(_0xcb9a('0x8d')));_0x1b80eb['use']('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x1b80eb['use'](_0xcb9a('0x8e'),require(_0xcb9a('0x8f')));_0x1b80eb['use'](_0xcb9a('0x90'),require('./api/intDeskConfiguration'));_0x1b80eb[_0xcb9a('0x8')]('/api/integrations/desk/fields',require('./api/intDeskField'));_0x1b80eb[_0xcb9a('0x8')]('/api/integrations/zoho/accounts',require(_0xcb9a('0x91')));_0x1b80eb[_0xcb9a('0x8')]('/api/integrations/zoho/configurations',require(_0xcb9a('0x92')));_0x1b80eb[_0xcb9a('0x8')]('/api/integrations/zoho/fields',require(_0xcb9a('0x93')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x94'),require(_0xcb9a('0x95')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x96'),require(_0xcb9a('0x97')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x98'),require(_0xcb9a('0x99')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x9a'),require(_0xcb9a('0x9b')));_0x1b80eb['use'](_0xcb9a('0x9c'),require(_0xcb9a('0x9d')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x9e'),require(_0xcb9a('0x9f')));_0x1b80eb['use'](_0xcb9a('0xa0'),require(_0xcb9a('0xa1')));_0x1b80eb[_0xcb9a('0x8')]('/api/integrations/vtiger/configurations',require(_0xcb9a('0xa2')));_0x1b80eb['use'](_0xcb9a('0xa3'),require(_0xcb9a('0xa4')));_0x1b80eb['use'](_0xcb9a('0xa5'),require(_0xcb9a('0xa6')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xa7'),require('./api/intServicenowConfiguration'));_0x1b80eb['use'](_0xcb9a('0xa8'),require(_0xcb9a('0xa9')));_0x1b80eb['use'](_0xcb9a('0xaa'),require(_0xcb9a('0xab')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xac'),require(_0xcb9a('0xad')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xae'),require(_0xcb9a('0xaf')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xb0'),require('./api/intFreshsalesAccount'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xb1'),require(_0xcb9a('0xb2')));_0x1b80eb['use']('/api/integrations/freshsales/fields',require(_0xcb9a('0xb3')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xb4'),require(_0xcb9a('0xb5')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xb6'),require(_0xcb9a('0xb7')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xb8'),require(_0xcb9a('0xb9')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xba'),require('./api/jscriptyAnswerReport'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xbb'),require(_0xcb9a('0xbc')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xbd'),require(_0xcb9a('0xbe')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xbf'),require('./api/smsQueueReport'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xc0'),require(_0xcb9a('0xc1')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xc2'),require(_0xcb9a('0xc3')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xc4'),require(_0xcb9a('0xc5')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xc6'),require(_0xcb9a('0xc7')));_0x1b80eb['use'](_0xcb9a('0xc8'),require(_0xcb9a('0xc9')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xca'),require('./api/squareProject'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xcb'),require(_0xcb9a('0xcc')));_0x1b80eb[_0xcb9a('0x8')]('/api/square/messages',require('./api/squareMessage'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xcd'),require(_0xcb9a('0xce')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xcf'),require('./api/license'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xd0'),require(_0xcb9a('0xd1')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xd2'),require('./api/migration'));_0x1b80eb[_0xcb9a('0x8')]('/api/attachments',require(_0xcb9a('0xd3')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xd4'),require('./api/plugin'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xd5'),require(_0xcb9a('0xd6')));_0x1b80eb['use']('/api/chat/reports/transfer',require(_0xcb9a('0xd7')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xd8'),require(_0xcb9a('0xd9')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xda'),require('./api/openchannelTransferReport'));_0x1b80eb['use'](_0xcb9a('0xdb'),require('./api/smsTransferReport'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xdc'),require(_0xcb9a('0xdd')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xde'),require(_0xcb9a('0xdf')));_0x1b80eb[_0xcb9a('0x8')]('/api/userProfiles',require(_0xcb9a('0xe0')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xe1'),require(_0xcb9a('0xe2')));_0x1b80eb['use']('/api/userProfile/resources',require('./api/userProfileResource'));_0x1b80eb[_0xcb9a('0x8')]('/api/userNotifications',require(_0xcb9a('0xe3')));_0x1b80eb['use'](_0xcb9a('0xe4'),require(_0xcb9a('0xe5')));_0x1b80eb['use'](_0xcb9a('0xe6'),require('./api/whatsappApplication'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xe7'),require(_0xcb9a('0xe8')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xe9'),require(_0xcb9a('0xea')));_0x1b80eb['use'](_0xcb9a('0xeb'),require('./api/whatsappQueueReport'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xec'),require('./api/whatsappTransferReport'));_0x1b80eb['use'](_0xcb9a('0xed'),require(_0xcb9a('0xee')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xef'),require('./api/cloudProvider'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xf0'),require(_0xcb9a('0xf1')));_0x1b80eb['use'](_0xcb9a('0xf2'),require(_0xcb9a('0xf3')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xf4'),require('./api/authLocal'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xf5'),require(_0xcb9a('0xf6')));_0x1b80eb[_0xcb9a('0x8')]('/api/auth/activedirectory',require(_0xcb9a('0xf7')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xf8'),require(_0xcb9a('0xf9')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xfa'),require(_0xcb9a('0xfb')));_0x1b80eb[_0xcb9a('0x8')]('/api/version',require(_0xcb9a('0xfc')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xfd'),require(_0xcb9a('0xfe')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0xff'),require('./api/pm2'));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x100'),require(_0xcb9a('0x101')));_0x1b80eb['use'](_0xcb9a('0x102'),clientSideLogs);_0x1b80eb[_0xcb9a('0x8')]('/apidoc',express['static'](path[_0xcb9a('0x103')](config[_0xcb9a('0x104')],_0xcb9a('0x105'))));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x106'),express[_0xcb9a('0x107')](path[_0xcb9a('0x103')](config['root'],_0xcb9a('0x106'))));_0x1b80eb['use'](_0xcb9a('0x108'),express[_0xcb9a('0x107')](path[_0xcb9a('0x103')](config[_0xcb9a('0x104')],_0xcb9a('0x108'))));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x109'),express[_0xcb9a('0x107')](path[_0xcb9a('0x103')](config[_0xcb9a('0x104')],_0xcb9a('0x10a'),'3.1.0')));_0x1b80eb[_0xcb9a('0x8')](_0xcb9a('0x10b'),express['static'](path[_0xcb9a('0x103')](config[_0xcb9a('0x104')],_0xcb9a('0x10c'))));_0x1b80eb[_0xcb9a('0x10d')](_0xcb9a('0x10e'))[_0xcb9a('0x10f')](errors[0x194]);_0x1b80eb[_0xcb9a('0x10d')]('/*')[_0xcb9a('0x10f')](function(_0x29c06b,_0x393a01){_0x393a01[_0xcb9a('0x110')](path[_0xcb9a('0x111')](_0x1b80eb[_0xcb9a('0x10f')](_0xcb9a('0x112'))+_0xcb9a('0x113')));});return _0x1b80eb;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 276fdb8..cdd8f85 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4070=['../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/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/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc'];(function(_0x5a6961,_0xd41ca6){var _0x4af0a6=function(_0x1201fe){while(--_0x1201fe){_0x5a6961['push'](_0x5a6961['shift']());}};_0x4af0a6(++_0xd41ca6);}(_0x4070,0x18e));var _0x0407=function(_0x372606,_0x58b8bf){_0x372606=_0x372606-0x0;var _0x25aa11=_0x4070[_0x372606];return _0x25aa11;};'use strict';var jayson=require(_0x0407('0x0'));var _=require(_0x0407('0x1'));var config=require(_0x0407('0x2'));exports[_0x0407('0x3')]=function(){return new Promise(function(_0x4dd895,_0x333294){var _0x30e97e={};_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x5')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x6')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x7')));_0x30e97e=_['merge'](_0x30e97e,require('../api/voiceRecording/voiceRecording.rpc'));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x8')));_0x30e97e=_['merge'](_0x30e97e,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x9')));_0x30e97e=_['merge'](_0x30e97e,require(_0x0407('0xa')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require('../api/memberReport/memberReport.rpc'));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require('../api/trunk/trunk.rpc'));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0xb')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0xc')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require('../api/mailAccount/mailAccount.rpc'));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require('../api/mailQueue/mailQueue.rpc'));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0xd')));_0x30e97e=_['merge'](_0x30e97e,require('../api/mailMessage/mailMessage.rpc'));_0x30e97e=_['merge'](_0x30e97e,require(_0x0407('0xe')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require('../api/faxAccount/faxAccount.rpc'));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0xf')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require('../api/faxInteraction/faxInteraction.rpc'));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require('../api/faxMessage/faxMessage.rpc'));_0x30e97e=_['merge'](_0x30e97e,require('../api/faxQueue/faxQueue.rpc'));_0x30e97e=_['merge'](_0x30e97e,require(_0x0407('0x10')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x11')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x12')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x13')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x14')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x15')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x16')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x17')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x18')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x19')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x1a')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x1b')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x1c')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x1d')));_0x30e97e=_['merge'](_0x30e97e,require(_0x0407('0x1e')));_0x30e97e=_['merge'](_0x30e97e,require(_0x0407('0x1f')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x20')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x21')));_0x30e97e=_['merge'](_0x30e97e,require(_0x0407('0x22')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x23')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x24')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x25')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x26')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require('../api/template/template.rpc'));_0x30e97e=_['merge'](_0x30e97e,require(_0x0407('0x27')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x28')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x29')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x2a')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x2b')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x2c')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x2d')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x2e')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x2f')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x30')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x31')));_0x30e97e=_['merge'](_0x30e97e,require(_0x0407('0x32')));_0x30e97e=_['merge'](_0x30e97e,require(_0x0407('0x33')));_0x30e97e=_['merge'](_0x30e97e,require('../api/squareReport/squareReport.rpc'));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x34')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x35')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x36')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x37')));_0x30e97e=_['merge'](_0x30e97e,require(_0x0407('0x38')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x39')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x3a')));_0x30e97e=_['merge'](_0x30e97e,require(_0x0407('0x3b')));_0x30e97e=_['merge'](_0x30e97e,require(_0x0407('0x3c')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x30e97e=_['merge'](_0x30e97e,require(_0x0407('0x3d')));_0x30e97e=_[_0x0407('0x4')](_0x30e97e,require(_0x0407('0x3e')));var _0x1bf043=jayson[_0x0407('0x3f')](_0x30e97e)[_0x0407('0x40')]();var _0x156e53=config[_0x0407('0x41')][_0x0407('0x42')]||config[_0x0407('0x42')]+0x1;var _0x3fd439=config['rpc']['ip']||_0x0407('0x43');_0x1bf043['on']('error',function(_0x4d9696){return _0x333294(_0x4d9696);});_0x1bf043['listen'](_0x156e53,_0x3fd439,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x3fd439,_0x156e53);require(_0x0407('0x44'))[_0x0407('0x45')]();return _0x4dd895(_0x0407('0x46')+_0x3fd439+':'+_0x156e53);});});}; \ No newline at end of file +var _0x2061=['jayson/promise','lodash','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueue/faxQueue.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','localhost','error','log','../config/triggers','default','RPC\x20listening\x20on\x20'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2061,0x80));var _0x1206=function(_0x1e0438,_0x3497b2){_0x1e0438=_0x1e0438-0x0;var _0x1bf737=_0x2061[_0x1e0438];return _0x1bf737;};'use strict';var jayson=require(_0x1206('0x0'));var _=require(_0x1206('0x1'));var config=require('../config/environment');exports[_0x1206('0x2')]=function(){return new Promise(function(_0x10c521,_0x19a9f7){var _0x3d0146={};_0x3d0146=_['merge'](_0x3d0146,require('../api/user/user.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x4')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x5')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/voiceRecording/voiceRecording.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x6')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x7')));_0x3d0146=_['merge'](_0x3d0146,require(_0x1206('0x8')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x9')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0xa')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/trunk/trunk.rpc'));_0x3d0146=_['merge'](_0x3d0146,require(_0x1206('0xb')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0xc')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0xd')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0xe')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0xf')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x10')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x11')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/mailApplication/mailApplication.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x12')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x13')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x14')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/faxInteraction/faxInteraction.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/faxMessage/faxMessage.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x15')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x3d0146=_['merge'](_0x3d0146,require('../api/smsAccount/smsAccount.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x16')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/smsMessage/smsMessage.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x17')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x18')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x19')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x1a')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x1b')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/chatInteraction/chatInteraction.rpc'));_0x3d0146=_['merge'](_0x3d0146,require(_0x1206('0x1c')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/chatQueue/chatQueue.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x1d')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x1e')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x3d0146=_['merge'](_0x3d0146,require(_0x1206('0x1f')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/interval/interval.rpc'));_0x3d0146=_['merge'](_0x3d0146,require('../api/pause/pause.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x20')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x21')));_0x3d0146=_['merge'](_0x3d0146,require('../api/template/template.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x22')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x23')));_0x3d0146=_['merge'](_0x3d0146,require(_0x1206('0x24')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x25')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x26')));_0x3d0146=_['merge'](_0x3d0146,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x27')));_0x3d0146=_['merge'](_0x3d0146,require(_0x1206('0x28')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x29')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x2a')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x2b')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x2c')));_0x3d0146=_['merge'](_0x3d0146,require('../api/squareReport/squareReport.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x2d')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x2e')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x2f')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/squareProject/squareProject.rpc'));_0x3d0146=_['merge'](_0x3d0146,require(_0x1206('0x30')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x31')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/campaign/campaign.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x32')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require('../api/plugin/plugin.rpc'));_0x3d0146=_['merge'](_0x3d0146,require(_0x1206('0x33')));_0x3d0146=_['merge'](_0x3d0146,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x34')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x35')));_0x3d0146=_[_0x1206('0x3')](_0x3d0146,require(_0x1206('0x36')));var _0x110d85=jayson[_0x1206('0x37')](_0x3d0146)[_0x1206('0x38')]();var _0x6ed89=config[_0x1206('0x39')]['port']||config['port']+0x1;var _0x3cb210=config[_0x1206('0x39')]['ip']||_0x1206('0x3a');_0x110d85['on'](_0x1206('0x3b'),function(_0x169669){return _0x19a9f7(_0x169669);});_0x110d85[_0x1206('0x2')](_0x6ed89,_0x3cb210,function(){console[_0x1206('0x3c')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x3cb210,_0x6ed89);require(_0x1206('0x3d'))[_0x1206('0x3e')]();return _0x10c521(_0x1206('0x3f')+_0x3cb210+':'+_0x6ed89);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 4b5316e..316612b 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 _0x4cc7=['exec','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','inherits','prototype','sync','answer','ANSWER','beep','sendRequest','format','noop','VERBOSE\x20\x22%s\x22'];(function(_0x3b9419,_0x32a3a9){var _0x544334=function(_0x594fc2){while(--_0x594fc2){_0x3b9419['push'](_0x3b9419['shift']());}};_0x544334(++_0x32a3a9);}(_0x4cc7,0x1b6));var _0x74cc=function(_0x35b747,_0x3fc3d4){_0x35b747=_0x35b747-0x0;var _0x5286d8=_0x4cc7[_0x35b747];return _0x5286d8;};'use strict';var util=require(_0x74cc('0x0'));var _=require(_0x74cc('0x1'));var EventEmitter=require(_0x74cc('0x2'))[_0x74cc('0x3')];var AGIReply=require(_0x74cc('0x4'));var AGIError=require(_0x74cc('0x5'));function AGIChannel(_0x432efa){var _0x245059=this,_0x4b3d99=new AGIReply(),_0x14af2c=![],_0x325bda={};EventEmitter[_0x74cc('0x6')](_0x245059);_0x432efa[_0x74cc('0x7')](_0x74cc('0x8'));_0x432efa[_0x74cc('0x9')](0x8*0x3c*0x3c*0x3e8);_0x4b3d99[_0x74cc('0x7')](_0x74cc('0x8'));_0x4b3d99['on'](_0x74cc('0xa'),function(_0x3d13eb){for(var _0x3f3ea0 in _0x3d13eb){_0x245059[_0x3f3ea0]=_0x3d13eb[_0x3f3ea0];}_0x245059[_0x74cc('0xb')](_0x74cc('0xc'));});_0x4b3d99['on']('line',function(_0x2b10f5){if(_0x2b10f5[_0x74cc('0xd')]()==_0x74cc('0xe')){_0x245059[_0x74cc('0xb')](_0x74cc('0xe'));return;}if(_0x2b10f5[_0x74cc('0xf')](0x0,0xb)==_0x74cc('0x10')){_0x14af2c=!![];}if(_0x14af2c){_0x325bda['rx']+=_0x2b10f5+'\x0a';if(_0x2b10f5[_0x74cc('0x11')](_0x74cc('0x12'))!=-0x1){_0x14af2c=![];}}else{_0x325bda['rx']=_0x2b10f5;}if(_0x14af2c){return;}if(typeof _0x325bda['cb']==_0x74cc('0x13')){var _0x34939c=_0x325bda['rx'][_0x74cc('0xf')](0x0,0x3),_0x31c6bd=null,_0x5397a7=null;_0x34939c=parseInt(_0x34939c);if(isNaN(_0x34939c)){_0x325bda['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x74cc('0x14')});return;}if(_0x34939c!=0xc8){_0x325bda['cb'](null,{'code':_0x34939c,'result':-0x1,'extra':'KO'});return;}_0x31c6bd=_0x325bda['rx'][_0x74cc('0xf')](0x4)['replace'](_0x74cc('0x15'),'');if(_0x31c6bd[_0x74cc('0x16')]('\x20')!=-0x1){_0x31c6bd=_0x31c6bd[_0x74cc('0x17')](0x0,_0x31c6bd[_0x74cc('0x16')]('\x20'));}if(_[_0x74cc('0x18')](_0x31c6bd,'-1')){_0x31c6bd=parseInt(_0x31c6bd);}_0x5397a7=_0x325bda['rx'][_0x74cc('0x19')]('\x20');if(_0x5397a7[_0x74cc('0x1a')]==0x3){_0x5397a7=_0x5397a7[0x2][_0x74cc('0xf')](0x1,_0x5397a7[0x2][_0x74cc('0x1a')]-0x1);}else if(_0x5397a7['length']>0x3){var _0x5c6ae3=/\((.+)\)/;var _0x314729=_0x325bda['rx'][_0x74cc('0x1b')](_0x5c6ae3);if(_0x314729){_0x5397a7=_0x314729[0x1];}else{_0x5397a7=null;}}else{_0x5397a7=null;}_0x325bda['cb'](null,{'code':_0x34939c,'result':_0x31c6bd,'extra':_0x5397a7});}});_0x432efa['on'](_0x74cc('0x1c'),function(_0x1fb365){_0x245059[_0x74cc('0xb')]('error',new AGIError(_0x74cc('0x1d'),_0x1fb365[_0x74cc('0x1e')]));});_0x432efa['on'](_0x74cc('0x1f'),function(){_0x245059[_0x74cc('0xb')](_0x74cc('0x1f'),new AGIError(_0x74cc('0x20')));});_0x432efa['on'](_0x74cc('0x21'),function(){_0x245059[_0x74cc('0xb')](_0x74cc('0x21'),new AGIError(_0x74cc('0x22')));_0x432efa['destroy']();});_0x432efa[_0x74cc('0x23')](_0x4b3d99);this[_0x74cc('0x24')]=function(_0x3b0e23,_0x36a77a){var _0x3b0e23=_0x3b0e23||'',_0x36a77a=typeof _0x36a77a==_0x74cc('0x13')?_0x36a77a:new Function();_0x325bda={'tx':_0x3b0e23,'rx':'','cb':_0x36a77a};_0x432efa[_0x74cc('0x25')](_0x3b0e23+'\x0a');},this[_0x74cc('0x1f')]=function(){_0x432efa['destroy']();};}util[_0x74cc('0x26')](AGIChannel,EventEmitter);AGIChannel[_0x74cc('0x27')]['sendRequest']=function(_0x44c079){return this[_0x74cc('0x24')][_0x74cc('0x28')](this,_0x44c079);};AGIChannel[_0x74cc('0x27')][_0x74cc('0x29')]=function(){return this['sendRequest'](_0x74cc('0x2a'));};AGIChannel[_0x74cc('0x27')]['getData']=function(_0x1456d3,_0x34147f,_0x2843f6){_0x1456d3=_0x1456d3===undefined?_0x74cc('0x2b'):_0x1456d3;_0x34147f=_0x34147f===undefined?'5':_0x34147f;_0x2843f6=_0x2843f6===undefined?'1':_0x2843f6;return this[_0x74cc('0x2c')](util[_0x74cc('0x2d')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x1456d3,_0x34147f*0x3e8,_0x2843f6));};AGIChannel[_0x74cc('0x27')][_0x74cc('0x2e')]=function(_0x5d013a){_0x5d013a=_0x5d013a||'NO\x20MESSAGE';return this[_0x74cc('0x2c')](util[_0x74cc('0x2d')](_0x74cc('0x2f'),_0x5d013a));};AGIChannel[_0x74cc('0x27')][_0x74cc('0x30')]=function(_0x312053,_0x28923e){if(_['isArray'](_0x28923e)){return this[_0x74cc('0x2c')](util[_0x74cc('0x2d')](_0x74cc('0x31'),_0x312053,_0x28923e['join'](',')));}return this[_0x74cc('0x2c')](util[_0x74cc('0x2d')](_0x74cc('0x31'),_0x312053,_0x28923e));};AGIChannel[_0x74cc('0x27')][_0x74cc('0x32')]=function(_0x23ba39){return this[_0x74cc('0x2c')](util[_0x74cc('0x2d')](_0x74cc('0x33'),_0x23ba39));};AGIChannel[_0x74cc('0x27')][_0x74cc('0x34')]=function(_0xebed42){return this[_0x74cc('0x2c')](util[_0x74cc('0x2d')](_0x74cc('0x35'),_0xebed42));};AGIChannel[_0x74cc('0x27')][_0x74cc('0x36')]=function(_0x587a8b){return this['sendRequest'](util[_0x74cc('0x2d')](_0x74cc('0x37'),_0x587a8b));};AGIChannel[_0x74cc('0x27')][_0x74cc('0xe')]=function(){return this[_0x74cc('0x2c')](_0x74cc('0x38'));};AGIChannel[_0x74cc('0x27')][_0x74cc('0x39')]=function(_0x11df08,_0x2c18b9){var _0x140eb2=_[_0x74cc('0x3a')](_0x2c18b9)||_['isNumber'](_0x2c18b9)?_0x2c18b9['toString']():_0x2c18b9;return this[_0x74cc('0x2c')](util[_0x74cc('0x2d')](_0x74cc('0x3b'),_0x11df08,_0x140eb2?_0x140eb2[_0x74cc('0x3c')]()[_0x74cc('0x3d')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x74cc('0x27')][_0x74cc('0x3e')]=function(_0x3b75f9,_0x3b2fc3){return this[_0x74cc('0x2c')](util[_0x74cc('0x2d')](_0x74cc('0x3f'),_0x3b75f9,_0x3b2fc3));};AGIChannel[_0x74cc('0x27')][_0x74cc('0x40')]=function(_0x2e4a6a,_0x4ca3f2){return this[_0x74cc('0x2c')](util[_0x74cc('0x2d')](_0x74cc('0x41'),_0x2e4a6a,_0x4ca3f2));};AGIChannel[_0x74cc('0x27')]['sayPhonetic']=function(_0x398236,_0x10e262){return this[_0x74cc('0x2c')](util[_0x74cc('0x2d')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x398236,_0x10e262));};AGIChannel[_0x74cc('0x27')][_0x74cc('0x42')]=function(_0x41a6e5,_0x286f4f,_0x551082){_0x286f4f=_0x286f4f||this[_0x74cc('0x43')];_0x551082=_0x551082||0x1;this['setContext'](_0x41a6e5);this['setExtension'](_0x286f4f);this['setPriority'](_0x551082);return this[_0x74cc('0x2e')](util[_0x74cc('0x2d')](_0x74cc('0x44'),_0x41a6e5,_0x286f4f,_0x551082));};AGIChannel[_0x74cc('0x27')][_0x74cc('0x45')]=function(_0x4945f1){return this['sendRequest'](util[_0x74cc('0x2d')](_0x74cc('0x46'),_0x4945f1));};AGIChannel['prototype'][_0x74cc('0x47')]=function(_0x2a8786,_0x4b776b,_0x40fa2a,_0x534826,_0x5ca183,_0x4e14d4){_0x4b776b=_0x4b776b||'wav';_0x40fa2a=_0x40fa2a||'';_0x534826=_0x534826===undefined?-0x1:_0x534826==='-1'?-0x1:_0x534826*0x3e8;_0x5ca183=_0x5ca183===undefined?'':'s='+_0x5ca183;_0x4e14d4=_0x4e14d4?_0x74cc('0x48'):'';return this[_0x74cc('0x2c')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x2a8786,_0x4b776b,_0x40fa2a,_0x534826,_0x4e14d4,_0x5ca183));};AGIChannel['prototype'][_0x74cc('0x49')]=function(_0x492026,_0x50e766){_0x50e766=_0x50e766||'';return this[_0x74cc('0x2c')](util['format'](_0x74cc('0x4a'),_0x492026,_0x50e766));};AGIChannel[_0x74cc('0x27')][_0x74cc('0x4b')]=function(_0x458381){return this[_0x74cc('0x30')](_0x74cc('0x4c'),_0x458381);};AGIChannel[_0x74cc('0x27')][_0x74cc('0x4d')]=function(_0x4957f3){return this['exec'](_0x74cc('0x4e'),_0x4957f3);};AGIChannel[_0x74cc('0x27')]['error']=function(_0x1725f7,_0x39b010){this[_0x74cc('0x2e')](util[_0x74cc('0x2d')](_0x74cc('0x4f'),_0x1725f7['id'],_0x1725f7[_0x74cc('0x50')],_0x39b010));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x14c5=['EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','isBoolean','isNumber','toString','replace','sayNumber','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','util','lodash','events','./reply','./error','call','setEncoding','setTimeout','utf8','headers','emit','ready','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','result=','indexOf','substr','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','inherits','prototype','sync','answer','sendRequest','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec'];(function(_0x3486e9,_0xbcce8f){var _0x2f337f=function(_0x13d375){while(--_0x13d375){_0x3486e9['push'](_0x3486e9['shift']());}};_0x2f337f(++_0xbcce8f);}(_0x14c5,0x1de));var _0x514c=function(_0x3a4088,_0x43831f){_0x3a4088=_0x3a4088-0x0;var _0x3fe3fe=_0x14c5[_0x3a4088];return _0x3fe3fe;};'use strict';var util=require(_0x514c('0x0'));var _=require(_0x514c('0x1'));var EventEmitter=require(_0x514c('0x2'))['EventEmitter'];var AGIReply=require(_0x514c('0x3'));var AGIError=require(_0x514c('0x4'));function AGIChannel(_0x1606d4){var _0x46d3ec=this,_0x3ef672=new AGIReply(),_0x32e427=![],_0x3ff9b3={};EventEmitter[_0x514c('0x5')](_0x46d3ec);_0x1606d4[_0x514c('0x6')]('utf8');_0x1606d4[_0x514c('0x7')](0x8*0x3c*0x3c*0x3e8);_0x3ef672[_0x514c('0x6')](_0x514c('0x8'));_0x3ef672['on'](_0x514c('0x9'),function(_0x232143){for(var _0xfe0593 in _0x232143){_0x46d3ec[_0xfe0593]=_0x232143[_0xfe0593];}_0x46d3ec[_0x514c('0xa')](_0x514c('0xb'));});_0x3ef672['on']('line',function(_0x27ffde){if(_0x27ffde[_0x514c('0xc')]()==_0x514c('0xd')){_0x46d3ec[_0x514c('0xa')](_0x514c('0xd'));return;}if(_0x27ffde[_0x514c('0xe')](0x0,0xb)==_0x514c('0xf')){_0x32e427=!![];}if(_0x32e427){_0x3ff9b3['rx']+=_0x27ffde+'\x0a';if(_0x27ffde[_0x514c('0x10')](_0x514c('0x11'))!=-0x1){_0x32e427=![];}}else{_0x3ff9b3['rx']=_0x27ffde;}if(_0x32e427){return;}if(typeof _0x3ff9b3['cb']==_0x514c('0x12')){var _0x5ee1b6=_0x3ff9b3['rx'][_0x514c('0xe')](0x0,0x3),_0x168a84=null,_0x4c9af9=null;_0x5ee1b6=parseInt(_0x5ee1b6);if(isNaN(_0x5ee1b6)){_0x3ff9b3['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x514c('0x13')});return;}if(_0x5ee1b6!=0xc8){_0x3ff9b3['cb'](null,{'code':_0x5ee1b6,'result':-0x1,'extra':'KO'});return;}_0x168a84=_0x3ff9b3['rx'][_0x514c('0xe')](0x4)['replace'](_0x514c('0x14'),'');if(_0x168a84[_0x514c('0x15')]('\x20')!=-0x1){_0x168a84=_0x168a84[_0x514c('0x16')](0x0,_0x168a84[_0x514c('0x15')]('\x20'));}if(_['startsWith'](_0x168a84,'-1')){_0x168a84=parseInt(_0x168a84);}_0x4c9af9=_0x3ff9b3['rx'][_0x514c('0x17')]('\x20');if(_0x4c9af9[_0x514c('0x18')]==0x3){_0x4c9af9=_0x4c9af9[0x2][_0x514c('0xe')](0x1,_0x4c9af9[0x2][_0x514c('0x18')]-0x1);}else if(_0x4c9af9[_0x514c('0x18')]>0x3){var _0x3b246d=/\((.+)\)/;var _0x3f942d=_0x3ff9b3['rx']['match'](_0x3b246d);if(_0x3f942d){_0x4c9af9=_0x3f942d[0x1];}else{_0x4c9af9=null;}}else{_0x4c9af9=null;}_0x3ff9b3['cb'](null,{'code':_0x5ee1b6,'result':_0x168a84,'extra':_0x4c9af9});}});_0x1606d4['on'](_0x514c('0x19'),function(_0x23f6b7){_0x46d3ec[_0x514c('0xa')]('error',new AGIError(_0x514c('0x1a'),_0x23f6b7[_0x514c('0x1b')]));});_0x1606d4['on']('close',function(){_0x46d3ec['emit'](_0x514c('0x1c'),new AGIError(_0x514c('0x1d')));});_0x1606d4['on'](_0x514c('0x1e'),function(){_0x46d3ec[_0x514c('0xa')](_0x514c('0x1e'),new AGIError(_0x514c('0x1f')));_0x1606d4[_0x514c('0x20')]();});_0x1606d4['pipe'](_0x3ef672);this[_0x514c('0x21')]=function(_0x4cbb6f,_0x501772){var _0x4cbb6f=_0x4cbb6f||'',_0x501772=typeof _0x501772==_0x514c('0x12')?_0x501772:new Function();_0x3ff9b3={'tx':_0x4cbb6f,'rx':'','cb':_0x501772};_0x1606d4[_0x514c('0x22')](_0x4cbb6f+'\x0a');},this[_0x514c('0x1c')]=function(){_0x1606d4[_0x514c('0x20')]();};}util[_0x514c('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x514c('0x24')]['sendRequest']=function(_0x4344f2){return this['command'][_0x514c('0x25')](this,_0x4344f2);};AGIChannel[_0x514c('0x24')][_0x514c('0x26')]=function(){return this[_0x514c('0x27')](_0x514c('0x28'));};AGIChannel[_0x514c('0x24')][_0x514c('0x29')]=function(_0x49d6b4,_0x2d0f95,_0x3a5204){_0x49d6b4=_0x49d6b4===undefined?'beep':_0x49d6b4;_0x2d0f95=_0x2d0f95===undefined?'5':_0x2d0f95;_0x3a5204=_0x3a5204===undefined?'1':_0x3a5204;return this[_0x514c('0x27')](util[_0x514c('0x2a')](_0x514c('0x2b'),_0x49d6b4,_0x2d0f95*0x3e8,_0x3a5204));};AGIChannel[_0x514c('0x24')]['noop']=function(_0x35fcec){_0x35fcec=_0x35fcec||_0x514c('0x2c');return this[_0x514c('0x27')](util[_0x514c('0x2a')](_0x514c('0x2d'),_0x35fcec));};AGIChannel['prototype'][_0x514c('0x2e')]=function(_0x10eb02,_0x19bc78){if(_['isArray'](_0x19bc78)){return this['sendRequest'](util[_0x514c('0x2a')](_0x514c('0x2f'),_0x10eb02,_0x19bc78[_0x514c('0x30')](',')));}return this[_0x514c('0x27')](util[_0x514c('0x2a')]('EXEC\x20%s\x20%s',_0x10eb02,_0x19bc78));};AGIChannel[_0x514c('0x24')][_0x514c('0x31')]=function(_0x5189ac){return this['sendRequest'](util['format'](_0x514c('0x32'),_0x5189ac));};AGIChannel[_0x514c('0x24')][_0x514c('0x33')]=function(_0xc095d9){return this[_0x514c('0x27')](util[_0x514c('0x2a')]('SET\x20EXTENSION\x20%s',_0xc095d9));};AGIChannel[_0x514c('0x24')][_0x514c('0x34')]=function(_0x173def){return this[_0x514c('0x27')](util[_0x514c('0x2a')](_0x514c('0x35'),_0x173def));};AGIChannel['prototype'][_0x514c('0xd')]=function(){return this[_0x514c('0x27')]('HANGUP');};AGIChannel[_0x514c('0x24')]['setVariable']=function(_0x3698d7,_0x30968c){var _0x2b4afc=_[_0x514c('0x36')](_0x30968c)||_[_0x514c('0x37')](_0x30968c)?_0x30968c[_0x514c('0x38')]():_0x30968c;return this[_0x514c('0x27')](util[_0x514c('0x2a')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3698d7,_0x2b4afc?_0x2b4afc['toString']()[_0x514c('0x39')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x514c('0x24')][_0x514c('0x3a')]=function(_0x4c145b,_0x5bbb15){return this[_0x514c('0x27')](util[_0x514c('0x2a')]('SAY\x20NUMBER\x20%s\x20%s',_0x4c145b,_0x5bbb15));};AGIChannel[_0x514c('0x24')][_0x514c('0x3b')]=function(_0x11cd93,_0x3272bc){return this[_0x514c('0x27')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x11cd93,_0x3272bc));};AGIChannel['prototype'][_0x514c('0x3c')]=function(_0x5a2664,_0x1d33d5){return this[_0x514c('0x27')](util[_0x514c('0x2a')](_0x514c('0x3d'),_0x5a2664,_0x1d33d5));};AGIChannel['prototype'][_0x514c('0x3e')]=function(_0x42c0e8,_0x59fe86,_0x478eae){_0x59fe86=_0x59fe86||this[_0x514c('0x3f')];_0x478eae=_0x478eae||0x1;this['setContext'](_0x42c0e8);this[_0x514c('0x33')](_0x59fe86);this[_0x514c('0x34')](_0x478eae);return this[_0x514c('0x40')](util[_0x514c('0x2a')]('GOTO\x20%s\x20%s\x20%s',_0x42c0e8,_0x59fe86,_0x478eae));};AGIChannel[_0x514c('0x24')][_0x514c('0x41')]=function(_0x3a11a2){return this[_0x514c('0x27')](util[_0x514c('0x2a')](_0x514c('0x42'),_0x3a11a2));};AGIChannel['prototype'][_0x514c('0x43')]=function(_0xd98648,_0x3907bf,_0x14fc26,_0x3ca8c5,_0xfc78d7,_0x4c70af){_0x3907bf=_0x3907bf||_0x514c('0x44');_0x14fc26=_0x14fc26||'';_0x3ca8c5=_0x3ca8c5===undefined?-0x1:_0x3ca8c5==='-1'?-0x1:_0x3ca8c5*0x3e8;_0xfc78d7=_0xfc78d7===undefined?'':'s='+_0xfc78d7;_0x4c70af=_0x4c70af?_0x514c('0x45'):'';return this['sendRequest'](util[_0x514c('0x2a')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0xd98648,_0x3907bf,_0x14fc26,_0x3ca8c5,_0x4c70af,_0xfc78d7));};AGIChannel['prototype']['streamFile']=function(_0x2f0128,_0x5bbfd5){_0x5bbfd5=_0x5bbfd5||'';return this['sendRequest'](util[_0x514c('0x2a')](_0x514c('0x46'),_0x2f0128,_0x5bbfd5));};AGIChannel[_0x514c('0x24')][_0x514c('0x47')]=function(_0x1dddb6){return this[_0x514c('0x2e')](_0x514c('0x48'),_0x1dddb6);};AGIChannel['prototype'][_0x514c('0x49')]=function(_0x6f1ba7){return this[_0x514c('0x2e')](_0x514c('0x4a'),_0x6f1ba7);};AGIChannel['prototype'][_0x514c('0x19')]=function(_0x39fe9b,_0x137dc6){this['noop'](util[_0x514c('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x39fe9b['id'],_0x39fe9b['label'],_0x137dc6));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 146b266..e080116 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 _0xe21e=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','format','apply','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x13eec2,_0xe78b42){var _0x46c367=function(_0x3f399a){while(--_0x3f399a){_0x13eec2['push'](_0x13eec2['shift']());}};_0x46c367(++_0xe78b42);}(_0xe21e,0xab));var _0xee21=function(_0x3628f5,_0x294e00){_0x3628f5=_0x3628f5-0x0;var _0x40cef6=_0xe21e[_0x3628f5];return _0x40cef6;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xee21('0x0'),'E_AGI_ARGUMENT_PORT':_0xee21('0x1'),'E_AGI_SERVER_ERROR':_0xee21('0x2'),'E_AGI_SERVER_CLOSE':_0xee21('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xee21('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xee21('0x5'),'E_AGI_SOCKET_ERROR':_0xee21('0x6'),'E_AGI_SOCKET_CLOSE':_0xee21('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xee21('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xee21('0x9'),'E_AGI_IVR_ENTRY':_0xee21('0xa')};function AGIError(_0x116e58){var _0x116e58=_0x116e58||null,_0x324140=_0x324140||[],_0xce298e=0x1,_0x2896c2='';if(!error[_0x116e58]){_0x116e58=_0xee21('0xb');}_0x324140['push'](error[_0x116e58]);while(arguments[_0xce298e]){_0x324140['push'](arguments[_0xce298e]);_0xce298e++;}_0x2896c2=util[_0xee21('0xc')][_0xee21('0xd')](util,_0x324140);this['message']=_0x2896c2;this[_0xee21('0xe')]=_0x116e58;}module[_0xee21('0xf')]=AGIError; \ No newline at end of file +var _0x8fad=['format','message','name','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8fad,0x124));var _0xd8fa=function(_0x2cd667,_0x11788b){_0x2cd667=_0x2cd667-0x0;var _0x3a5729=_0x8fad[_0x2cd667];return _0x3a5729;};'use strict';var util=require(_0xd8fa('0x0'));var error={'E_AGI_UNDEFINED':_0xd8fa('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xd8fa('0x2'),'E_AGI_SERVER_CLOSE':_0xd8fa('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xd8fa('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xd8fa('0x5'),'E_AGI_SOCKET_ERROR':_0xd8fa('0x6'),'E_AGI_SOCKET_CLOSE':_0xd8fa('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xd8fa('0x8'),'E_AGI_COMMAND_EMPTY':_0xd8fa('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xd8fa('0xa'),'E_AGI_IVR_ENTRY':_0xd8fa('0xb')};function AGIError(_0x50bd2e){var _0x50bd2e=_0x50bd2e||null,_0x3f64b4=_0x3f64b4||[],_0x81cad3=0x1,_0x58ff4f='';if(!error[_0x50bd2e]){_0x50bd2e=_0xd8fa('0xc');}_0x3f64b4[_0xd8fa('0xd')](error[_0x50bd2e]);while(arguments[_0x81cad3]){_0x3f64b4['push'](arguments[_0x81cad3]);_0x81cad3++;}_0x58ff4f=util[_0xd8fa('0xe')]['apply'](util,_0x3f64b4);this[_0xd8fa('0xf')]=_0x58ff4f;this[_0xd8fa('0x10')]=_0x50bd2e;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 28a29de..eb98c08 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 _0x07a2=['defaults','localhost','subscribe','agi','error','E_AGI_SERVER_ERROR','projectUpdate','exports','lodash','events','ioredis','./error','../../config/environment','redis'];(function(_0x14fda1,_0x5e8ab1){var _0x3bade2=function(_0x55b821){while(--_0x55b821){_0x14fda1['push'](_0x14fda1['shift']());}};_0x3bade2(++_0x5e8ab1);}(_0x07a2,0x166));var _0x207a=function(_0x218994,_0x2cf487){_0x218994=_0x218994-0x0;var _0x3f350b=_0x07a2[_0x218994];return _0x3f350b;};'use strict';var _=require(_0x207a('0x0'));var EventEmitter=require(_0x207a('0x1'))['EventEmitter'];var Redis=require(_0x207a('0x2'));var AGIError=require(_0x207a('0x3'));var config=require(_0x207a('0x4'));config[_0x207a('0x5')]=_[_0x207a('0x6')](config[_0x207a('0x5')],{'host':_0x207a('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x207a('0x8')](_0x207a('0x9'),function(_0x5eb658){if(_0x5eb658)return eventEmitter['emit'](_0x207a('0xa'),new AGIError(_0x207a('0xb'),_0x5eb658));});sub['on']('message',function(_0x3bd6b3,_0x440137){if(_0x3bd6b3!==_0x207a('0x9'))return;try{var _0x52b764=JSON['parse'](_0x440137);eventEmitter['emit'](_0x207a('0xc'),_0x52b764);}catch(_0x27f8ba){eventEmitter['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0x27f8ba));}});module[_0x207a('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x1695=['agi','parse','projectUpdate','error','lodash','events','EventEmitter','ioredis','../../config/environment','redis','defaults','subscribe','emit','E_AGI_SERVER_ERROR'];(function(_0x1ed0ba,_0x550820){var _0x1ff333=function(_0x5e0345){while(--_0x5e0345){_0x1ed0ba['push'](_0x1ed0ba['shift']());}};_0x1ff333(++_0x550820);}(_0x1695,0x1b6));var _0x5169=function(_0x5058e8,_0x2a97b3){_0x5058e8=_0x5058e8-0x0;var _0x4b25a0=_0x1695[_0x5058e8];return _0x4b25a0;};'use strict';var _=require(_0x5169('0x0'));var EventEmitter=require(_0x5169('0x1'))[_0x5169('0x2')];var Redis=require(_0x5169('0x3'));var AGIError=require('./error');var config=require(_0x5169('0x4'));config[_0x5169('0x5')]=_[_0x5169('0x6')](config[_0x5169('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x5169('0x7')]('agi',function(_0x59d842){if(_0x59d842)return eventEmitter[_0x5169('0x8')]('error',new AGIError(_0x5169('0x9'),_0x59d842));});sub['on']('message',function(_0x5d6e18,_0x5f07e3){if(_0x5d6e18!==_0x5169('0xa'))return;try{var _0x19dc78=JSON[_0x5169('0xb')](_0x5f07e3);eventEmitter[_0x5169('0x8')](_0x5169('0xc'),_0x19dc78);}catch(_0x4d944b){eventEmitter['emit'](_0x5169('0xd'),new AGIError(_0x5169('0x9'),_0x4d944b));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index f3f883d..e4932fe 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 _0x7ed3=['relations','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size'];(function(_0x5e2e1b,_0x546d72){var _0x503b2f=function(_0x307a96){while(--_0x307a96){_0x5e2e1b['push'](_0x5e2e1b['shift']());}};_0x503b2f(++_0x546d72);}(_0x7ed3,0x129));var _0x37ed=function(_0xda6603,_0x4500d0){_0xda6603=_0xda6603-0x0;var _0x3b0ffe=_0x7ed3[_0xda6603];return _0x3b0ffe;};'use strict';var _=require('lodash');var logger=require(_0x37ed('0x0'))(_0x37ed('0x1'));var verticesWithRetry=[_0x37ed('0x2'),_0x37ed('0x3'),_0x37ed('0x4')];var Graph=function(){this[_0x37ed('0x5')]={};this[_0x37ed('0x6')]={};this[_0x37ed('0x7')]=0x0;};Graph[_0x37ed('0x8')][_0x37ed('0x9')]=function(_0x4493ad){this['vertices'][_0x4493ad['id']]=_0x4493ad;this['edges'][_0x4493ad['id']]=[];};Graph[_0x37ed('0x8')][_0x37ed('0xa')]=function(_0x1b5470,_0x2f8070,_0x5172ef){this[_0x37ed('0x6')][_0x1b5470][_0x37ed('0xb')]({'target':_0x2f8070,'condition':_0x5172ef});this[_0x37ed('0x7')]+=0x1;};Graph['prototype'][_0x37ed('0xc')]=function(){return _[_0x37ed('0xc')](this[_0x37ed('0x5')]);};Graph[_0x37ed('0x8')][_0x37ed('0xd')]=function(){return this[_0x37ed('0x7')];};Graph[_0x37ed('0x8')]['getVertex']=function(_0x4292bf){return this[_0x37ed('0x5')][_0x4292bf];};Graph['prototype'][_0x37ed('0xe')]=function(_0x2c9aac,_0x90ef13){if(!this[_0x37ed('0x5')][_0x2c9aac]){return logger['info'](_0x37ed('0xf'));}var _0x57cd81=_0x90ef13(this[_0x37ed('0x5')][_0x2c9aac]);if(!_0x57cd81){return logger[_0x37ed('0x10')](_0x37ed('0x11'));}if(this[_0x37ed('0x6')][_0x2c9aac][_0x37ed('0x12')]===0x0){return logger['info'](_0x37ed('0x13'));}for(var _0x48910d=0x0,_0x232a0e=[],_0x207951=![];_0x48910d\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','info','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','hasOwnProperty','agi_','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','find','production','handleUnpublished','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','catch','finally','./server','connection','lodash','syncho','util','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','defaults','projectUpdate','nextTick','stack','findIndex','deleted','splice','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','name','message'];(function(_0x1b814e,_0x21f608){var _0x3d49af=function(_0x1e6d38){while(--_0x1e6d38){_0x1b814e['push'](_0x1b814e['shift']());}};_0x3d49af(++_0x21f608);}(_0xb076,0xfc));var _0x6b07=function(_0x596e98,_0xc326c9){_0x596e98=_0x596e98-0x0;var _0x1c09ac=_0xb076[_0x596e98];return _0x1c09ac;};'use strict';var _=require(_0x6b07('0x0'));var syncho=require(_0x6b07('0x1'));var util=require(_0x6b07('0x2'));var config=require('../../config/environment');var logger=require(_0x6b07('0x3'))(_0x6b07('0x4'));var utilLicense=require(_0x6b07('0x5'));var rpc=require(_0x6b07('0x6'));var Project=require(_0x6b07('0x7'));var AGIEmitter=require(_0x6b07('0x8'))['EventEmitter'];var projects=[];config['agi']=_[_0x6b07('0x9')](config[_0x6b07('0x4')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x6b07('0xa'),projectUpdateHandler);function connectionHandler(_0x1be194){process[_0x6b07('0xb')](function(){syncho(function(){try{setChannelVariables(_0x1be194);agiHandler(_0x1be194);}catch(_0x56fced){logger['error'](_0x56fced[_0x6b07('0xc')]);}});});}function projectUpdateHandler(_0x11392a){try{var _0x1b28cb=_[_0x6b07('0xd')](projects,['id',_0x11392a['id']]);if(_0x1b28cb>-0x1){if(_0x11392a[_0x6b07('0xe')]===!![]){projects[_0x6b07('0xf')](_0x1b28cb,0x1);}else{projects[_0x1b28cb]=_0x11392a;}}else{projects['push'](_0x11392a);}}catch(_0x190631){logger[_0x6b07('0x10')](_0x190631['stack']);}}function listeningHandler(){console[_0x6b07('0x11')](_0x6b07('0x12'),config[_0x6b07('0x4')][_0x6b07('0x13')]);logger['info'](util[_0x6b07('0x14')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config[_0x6b07('0x4')][_0x6b07('0x13')]));}function errorHandler(_0x51db80){if(_0x51db80&&_0x51db80[_0x6b07('0x15')]&&_0x51db80[_0x6b07('0x16')]){logger['error'](util[_0x6b07('0x14')]('[%s]\x20%s',_0x51db80[_0x6b07('0x15')],_0x51db80['message']));}else{logger[_0x6b07('0x10')](util[_0x6b07('0x14')](_0x6b07('0x17'),_0x51db80[_0x6b07('0xc')]));}}function closeHandler(){logger['info'](util[_0x6b07('0x14')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x6b07('0x18')],this[_0x6b07('0x19')],this[_0x6b07('0x1a')],this['dnid'],this[_0x6b07('0x1b')]));try{createSquareReport(this);}catch(_0x319dc6){logger['error'](_0x319dc6[_0x6b07('0xc')]);}}function timeoutHandler(){logger['info'](util[_0x6b07('0x14')](_0x6b07('0x1c'),this[_0x6b07('0x18')],this[_0x6b07('0x19')],this[_0x6b07('0x1a')],this[_0x6b07('0x1d')],this[_0x6b07('0x1b')]));}function hangupHandler(){logger[_0x6b07('0x1e')](util[_0x6b07('0x14')](_0x6b07('0x1f'),this[_0x6b07('0x18')],this[_0x6b07('0x19')],this[_0x6b07('0x1a')],this['dnid'],this['uniqueid']));this[_0x6b07('0x20')]=!![];}function createSquareReport(_0x42dcc7,_0x4dc4fe){rpc[_0x6b07('0x21')](_0x42dcc7)['then'](function(_0xfbe0bf){if(_0x4dc4fe){_0x4dc4fe(null,_0xfbe0bf);}})['catch'](function(_0x5da880){if(_0x4dc4fe){_0x4dc4fe(null,_0x5da880);}});}function setChannelVariables(_0x3b6856){for(var _0x1d76ac in _0x3b6856){if(_0x3b6856[_0x6b07('0x22')](_0x1d76ac)){if(_0x1d76ac['indexOf'](_0x6b07('0x23'))===0x0){_0x3b6856[_0x1d76ac['substring'](0x4)]=_0x3b6856[_0x1d76ac];delete _0x3b6856[_0x1d76ac];}}}}function agiHandler(_0x370120){logger[_0x6b07('0x24')](_0x6b07('0x25'),JSON[_0x6b07('0x26')](_0x370120,null,0x2));logger[_0x6b07('0x1e')](util[_0x6b07('0x14')](_0x6b07('0x27'),_0x370120[_0x6b07('0x18')],_0x370120['calleridname'],_0x370120[_0x6b07('0x1a')],_0x370120[_0x6b07('0x1d')],_0x370120['uniqueid']));_0x370120['on'](_0x6b07('0x10'),errorHandler);_0x370120['on'](_0x6b07('0x28'),closeHandler);_0x370120['on'](_0x6b07('0x29'),timeoutHandler);_0x370120[_0x6b07('0x20')]=![];_0x370120['on']('hangup',hangupHandler);var _0x3d837c=_[_0x6b07('0x2a')](projects,['name',_0x370120['arg_1']]);if(!_0x3d837c)return Project['handleNotFound'](_0x370120);if(!_0x3d837c[_0x6b07('0x2b')])return Project[_0x6b07('0x2c')](_0x370120);return Project['initialize'](_0x3d837c,_0x370120);}function main(){var _0x1b738b;return utilLicense[_0x6b07('0x2d')]()[_0x6b07('0x2e')](function(_0x35dc31){if(!_0x35dc31)return;if(_0x35dc31[_0x6b07('0x2f')]){if(_0x35dc31[_0x6b07('0x30')]&&_0x35dc31[_0x6b07('0x30')]>0x0){logger[_0x6b07('0x1e')](util[_0x6b07('0x14')]('[LICENSE]\x20CHANNELS:\x20%s',_0x35dc31[_0x6b07('0x30')]));_0x1b738b=_0x35dc31[_0x6b07('0x30')];}else{logger[_0x6b07('0x1e')](_0x6b07('0x31'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x1b738b=-0x1;}})['then'](function(){return Project[_0x6b07('0x32')]();})[_0x6b07('0x2e')](function(_0x32f4b0){projects=_0x32f4b0;return;})[_0x6b07('0x33')](function(_0x329935){logger[_0x6b07('0x10')]('[LICENSE]',_0x329935['stack']);})[_0x6b07('0x34')](function(){var _0x166834=require(_0x6b07('0x35'))(config[_0x6b07('0x4')][_0x6b07('0x13')],config['agi']['ip'],_0x1b738b);_0x166834['on'](_0x6b07('0x10'),errorHandler);_0x166834['on']('listening',listeningHandler);_0x166834['on'](_0x6b07('0x36'),connectionHandler);_0x166834['on'](_0x6b07('0x28'),closeHandler);});}main(); \ No newline at end of file +var _0x65f2=['../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./events','defaults','127.0.0.1','nextTick','error','stack','findIndex','deleted','splice','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','hasOwnProperty','indexOf','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','close','hangup','find','handleNotFound','production','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','lodash','syncho'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0x65f2,0x111));var _0x265f=function(_0x2257bc,_0x492dc1){_0x2257bc=_0x2257bc-0x0;var _0xb814a0=_0x65f2[_0x2257bc];return _0xb814a0;};'use strict';var _=require(_0x265f('0x0'));var syncho=require(_0x265f('0x1'));var util=require('util');var config=require(_0x265f('0x2'));var logger=require(_0x265f('0x3'))(_0x265f('0x4'));var utilLicense=require(_0x265f('0x5'));var rpc=require(_0x265f('0x6'));var Project=require('./project');var AGIEmitter=require(_0x265f('0x7'))['EventEmitter'];var projects=[];config[_0x265f('0x4')]=_[_0x265f('0x8')](config[_0x265f('0x4')],{'ip':_0x265f('0x9'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x274635){process[_0x265f('0xa')](function(){syncho(function(){try{setChannelVariables(_0x274635);agiHandler(_0x274635);}catch(_0x3a6216){logger[_0x265f('0xb')](_0x3a6216[_0x265f('0xc')]);}});});}function projectUpdateHandler(_0x1ad07a){try{var _0x33fcac=_[_0x265f('0xd')](projects,['id',_0x1ad07a['id']]);if(_0x33fcac>-0x1){if(_0x1ad07a[_0x265f('0xe')]===!![]){projects[_0x265f('0xf')](_0x33fcac,0x1);}else{projects[_0x33fcac]=_0x1ad07a;}}else{projects['push'](_0x1ad07a);}}catch(_0x4b34a5){logger[_0x265f('0xb')](_0x4b34a5['stack']);}}function listeningHandler(){console[_0x265f('0x10')](_0x265f('0x11'),config[_0x265f('0x4')][_0x265f('0x12')]);logger[_0x265f('0x13')](util[_0x265f('0x14')](_0x265f('0x15'),config[_0x265f('0x4')]['ip'],config[_0x265f('0x4')][_0x265f('0x12')]));}function errorHandler(_0x169b83){if(_0x169b83&&_0x169b83[_0x265f('0x16')]&&_0x169b83[_0x265f('0x17')]){logger['error'](util[_0x265f('0x14')]('[%s]\x20%s',_0x169b83[_0x265f('0x16')],_0x169b83['message']));}else{logger[_0x265f('0xb')](util[_0x265f('0x14')]('[ERROR]\x20%s',_0x169b83[_0x265f('0xc')]));}}function closeHandler(){logger[_0x265f('0x13')](util['format'](_0x265f('0x18'),this['arg_1'],this['calleridname'],this[_0x265f('0x19')],this['dnid'],this[_0x265f('0x1a')]));try{createSquareReport(this);}catch(_0x4baade){logger[_0x265f('0xb')](_0x4baade[_0x265f('0xc')]);}}function timeoutHandler(){logger[_0x265f('0x13')](util['format'](_0x265f('0x1b'),this[_0x265f('0x1c')],this[_0x265f('0x1d')],this[_0x265f('0x19')],this['dnid'],this[_0x265f('0x1a')]));}function hangupHandler(){logger['info'](util[_0x265f('0x14')](_0x265f('0x1e'),this[_0x265f('0x1c')],this[_0x265f('0x1d')],this['callerid'],this['dnid'],this[_0x265f('0x1a')]));this[_0x265f('0x1f')]=!![];}function createSquareReport(_0x213d0a,_0x101af0){rpc[_0x265f('0x20')](_0x213d0a)[_0x265f('0x21')](function(_0x2d29a6){if(_0x101af0){_0x101af0(null,_0x2d29a6);}})['catch'](function(_0x1bb8ec){if(_0x101af0){_0x101af0(null,_0x1bb8ec);}});}function setChannelVariables(_0x4101d8){for(var _0x12c636 in _0x4101d8){if(_0x4101d8[_0x265f('0x22')](_0x12c636)){if(_0x12c636[_0x265f('0x23')]('agi_')===0x0){_0x4101d8[_0x12c636[_0x265f('0x24')](0x4)]=_0x4101d8[_0x12c636];delete _0x4101d8[_0x12c636];}}}}function agiHandler(_0x40fe38){logger[_0x265f('0x25')](_0x265f('0x26'),JSON[_0x265f('0x27')](_0x40fe38,null,0x2));logger[_0x265f('0x13')](util[_0x265f('0x14')](_0x265f('0x28'),_0x40fe38[_0x265f('0x1c')],_0x40fe38[_0x265f('0x1d')],_0x40fe38[_0x265f('0x19')],_0x40fe38[_0x265f('0x29')],_0x40fe38[_0x265f('0x1a')]));_0x40fe38['on']('error',errorHandler);_0x40fe38['on'](_0x265f('0x2a'),closeHandler);_0x40fe38['on']('timeout',timeoutHandler);_0x40fe38[_0x265f('0x1f')]=![];_0x40fe38['on'](_0x265f('0x2b'),hangupHandler);var _0x29fc30=_[_0x265f('0x2c')](projects,['name',_0x40fe38[_0x265f('0x1c')]]);if(!_0x29fc30)return Project[_0x265f('0x2d')](_0x40fe38);if(!_0x29fc30[_0x265f('0x2e')])return Project['handleUnpublished'](_0x40fe38);return Project[_0x265f('0x2f')](_0x29fc30,_0x40fe38);}function main(){var _0x45dafb;return utilLicense[_0x265f('0x30')]()[_0x265f('0x21')](function(_0x336156){if(!_0x336156)return;if(_0x336156['voice']){if(_0x336156[_0x265f('0x31')]&&_0x336156[_0x265f('0x31')]>0x0){logger['info'](util[_0x265f('0x14')](_0x265f('0x32'),_0x336156['callysquare']));_0x45dafb=_0x336156[_0x265f('0x31')];}else{logger[_0x265f('0x13')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x265f('0x13')](_0x265f('0x33'));_0x45dafb=-0x1;}})[_0x265f('0x21')](function(){return Project['getAll']();})[_0x265f('0x21')](function(_0x240002){projects=_0x240002;return;})['catch'](function(_0xbdbc57){logger['error'](_0x265f('0x34'),_0xbdbc57['stack']);})['finally'](function(){var _0x14abbb=require(_0x265f('0x35'))(config[_0x265f('0x4')]['port'],config[_0x265f('0x4')]['ip'],_0x45dafb);_0x14abbb['on'](_0x265f('0xb'),errorHandler);_0x14abbb['on']('listening',listeningHandler);_0x14abbb['on'](_0x265f('0x36'),connectionHandler);_0x14abbb['on']('close',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 e66555d..e7e5294 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 _0xc3b5=['message','result','catch','SendMail','bluebird','client','request','then','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3b5,0x16c));var _0x5c3b=function(_0x25be44,_0x3a85e6){_0x25be44=_0x25be44-0x0;var _0x4c4fc6=_0xc3b5[_0x25be44];return _0x4c4fc6;};'use strict';var BPromise=require(_0x5c3b('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x5c3b('0x1')]['http']({'port':0x232b});function request(_0x3b8e14,_0x57680e){return new BPromise(function(_0x484d68,_0x1df93b){return client[_0x5c3b('0x2')](_0x3b8e14,_0x57680e)[_0x5c3b('0x3')](function(_0x57c98b){if(_0x57c98b[_0x5c3b('0x4')]){return _0x1df93b(_0x57c98b[_0x5c3b('0x4')][_0x5c3b('0x5')]);}else{return _0x484d68(_0x57c98b[_0x5c3b('0x6')]);}})[_0x5c3b('0x7')](function(_0x5df78e){return _0x1df93b(_0x5df78e);});});}exports['sendMailMessage']=function(_0x53e91,_0x82ef9a){return request(_0x5c3b('0x8'),{'account':_0x53e91,'message':_0x82ef9a});}; \ No newline at end of file +var _0x3899=['sendMailMessage','jayson/promise','http','then','error','result','catch'];(function(_0x3dd97a,_0x1aacd1){var _0x2e0a44=function(_0x3070c1){while(--_0x3070c1){_0x3dd97a['push'](_0x3dd97a['shift']());}};_0x2e0a44(++_0x1aacd1);}(_0x3899,0x1d6));var _0x9389=function(_0xf8d7e0,_0x46a8ca){_0xf8d7e0=_0xf8d7e0-0x0;var _0x45998f=_0x3899[_0xf8d7e0];return _0x45998f;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x9389('0x0'));var client=jayson['client'][_0x9389('0x1')]({'port':0x232b});function request(_0x52f7dc,_0x34b986){return new BPromise(function(_0x287059,_0x20171f){return client['request'](_0x52f7dc,_0x34b986)[_0x9389('0x2')](function(_0x4612a5){if(_0x4612a5[_0x9389('0x3')]){return _0x20171f(_0x4612a5[_0x9389('0x3')]['message']);}else{return _0x287059(_0x4612a5[_0x9389('0x4')]);}})[_0x9389('0x5')](function(_0x379128){return _0x20171f(_0x379128);});});}exports[_0x9389('0x6')]=function(_0xd982f6,_0x3889e1){return request('SendMail',{'account':_0xd982f6,'message':_0x3889e1});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index a32e63e..b9bb236 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 _0xf800=['start','debug','root','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','arg_1','calleridname','dnid','clear','vertex','stringify','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','extension','priority','response','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','uniqueid','context','close','Project\x20%s\x20not\x20found','continueAt','exports','moment','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./graph','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','addVertex','omit','mxCell','length','source','target','addEdge','value','mxGraphModel','inspect','production'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf800,0x176));var _0x0f80=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf800[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0x0f80('0x0'));var parser=require(_0x0f80('0x1'));var util=require(_0x0f80('0x2'));var logger=require(_0x0f80('0x3'))(_0x0f80('0x4'));var rpc=require(_0x0f80('0x5'));var mailRpc=require(_0x0f80('0x6'));var Graph=require(_0x0f80('0x7'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x0f80('0x8')]()[_0x0f80('0x9')](function(_0x5818b2){logger[_0x0f80('0xa')](_0x0f80('0xb'),_0x5818b2[_0x0f80('0xc')]);return[];});}function addVertex(_0x24523d,_0x1a9c53,_0x2d7095){_0x1a9c53['agicommand']=_0x2d7095;if(_0x1a9c53[_0x0f80('0xd')]('retry')){_0x1a9c53['maxRetry']=parseInt(_0x1a9c53['retry'],0xa);}_0x24523d[_0x0f80('0xe')](_[_0x0f80('0xf')](_0x1a9c53,_0x0f80('0x10')));}function initGraph(_0x58fdb7,_0x151205){var _0x2dde2b=new Graph();for(var _0x10ad98 in _0x58fdb7){if(_0x58fdb7[_0x0f80('0xd')](_0x10ad98)){if(_['isArray'](_0x58fdb7[_0x10ad98])){for(var _0x3704bc=0x0;_0x3704bc<_0x58fdb7[_0x10ad98][_0x0f80('0x11')];_0x3704bc+=0x1){addVertex(_0x2dde2b,_0x58fdb7[_0x10ad98][_0x3704bc],_0x10ad98);}}else{addVertex(_0x2dde2b,_0x58fdb7[_0x10ad98],_0x10ad98);}}}for(var _0x530643=0x0;_0x530643<_0x151205[_0x0f80('0x11')];_0x530643+=0x1){if(_0x151205[_0x530643][_0x0f80('0x12')]&&_0x151205[_0x530643][_0x0f80('0x13')]){_0x2dde2b[_0x0f80('0x14')](_0x151205[_0x530643][_0x0f80('0x12')],_0x151205[_0x530643][_0x0f80('0x13')],_0x151205[_0x530643][_0x0f80('0x15')]);}}return _0x2dde2b;}function getRoot(_0x4b063a){return parser['toJson'](_0x4b063a,{'object':!![]})[_0x0f80('0x16')]['root'];}function inspect(_0x19c5e3){return util[_0x0f80('0x17')](_0x19c5e3,{'showHidden':![],'depth':null});}function initialize(_0x40b2ed,_0x3978fa){var _0x38969d=getRoot(_0x40b2ed[_0x0f80('0x18')]);if(!_0x38969d||!_0x38969d[_0x0f80('0x19')])return;var _0x1c34ca,_0x22a713,_0x3a0add;logger[_0x0f80('0x1a')](_0x0f80('0x1b'),JSON['stringify'](_0x38969d,null,0x2));_0x3978fa[_0x0f80('0x1c')]=moment()[_0x0f80('0x1d')](_0x0f80('0x1e'));_0x1c34ca=initGraph(_[_0x0f80('0xf')](_0x38969d,_0x0f80('0x10')),_0x38969d['mxCell']);_0x22a713=new Vertices(_0x3978fa,rpc,mailRpc);logger[_0x0f80('0x1f')](util[_0x0f80('0x1d')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3978fa[_0x0f80('0x20')],_0x3978fa[_0x0f80('0x21')],_0x3978fa['callerid'],_0x3978fa[_0x0f80('0x22')],_0x3978fa['uniqueid']));_0x1c34ca['traverseBFS'](_0x38969d[_0x0f80('0x19')]['id'],function(_0x2526a0){try{_0x2526a0=_0x22a713[_0x0f80('0x23')](_0x2526a0);logger[_0x0f80('0x1a')](_0x0f80('0x24'),JSON[_0x0f80('0x25')](_0x2526a0,null,0x2));if(_0x2526a0[_0x0f80('0x26')]===_0x0f80('0x27')){logger[_0x0f80('0x1f')](_0x0f80('0x28'));_0x3978fa['context']=_0x2526a0['context']||_0x3978fa['context'];_0x3978fa['extension']=_0x2526a0[_0x0f80('0x29')];_0x3978fa[_0x0f80('0x2a')]=_0x2526a0[_0x0f80('0x2a')]?_0x2526a0[_0x0f80('0x2a')]-0x1:0x1;return null;}else if(_0x2526a0&&_0x22a713[_0x2526a0[_0x0f80('0x26')]]){_0x3a0add=_0x22a713[_0x2526a0[_0x0f80('0x26')]](_0x2526a0);logger['info'](_0x0f80('0x2b'),JSON[_0x0f80('0x25')](_0x3a0add,null,0x2));if(_0x3a0add&&_0x3a0add['code']===AGI_CODE_SUCCESS&&_0x3a0add[_0x0f80('0x2c')]!==AGI_RESULT_ERROR&&!_0x3978fa['evtHangup']){logger[_0x0f80('0x1a')](_0x0f80('0x2b'),inspect(_0x3a0add));return _[_0x0f80('0x2d')](_0x3a0add[_0x0f80('0x2c')])?null:_0x3a0add[_0x0f80('0x2c')][_0x0f80('0x2e')]();}else{logger['error']('response',inspect(_0x3a0add));return null;}}else{logger[_0x0f80('0xa')](_0x0f80('0x2f'));return null;}}catch(_0xf7655c){logger[_0x0f80('0xa')](_0xf7655c['stack']);return null;}});if(_0x38969d[_0x0f80('0x30')]){logger[_0x0f80('0x1f')](util['format'](_0x0f80('0x31'),_0x3978fa['arg_1'],_0x3978fa[_0x0f80('0x21')],_0x3978fa['callerid'],_0x3978fa['dnid'],_0x3978fa['uniqueid']));_0x1c34ca['traverseBFS'](_0x38969d[_0x0f80('0x30')]['id'],function(_0x83717b){try{_0x83717b=_0x22a713['clear'](_0x83717b);logger[_0x0f80('0x1a')]('vertex',JSON[_0x0f80('0x25')](_0x83717b,null,0x2));if(_0x83717b&&_0x22a713[_0x83717b['agicommand']]){_0x3a0add=_0x22a713[_0x83717b['agicommand']](_0x83717b);if(_0x3a0add){logger[_0x0f80('0x1a')](_0x0f80('0x2b'),inspect(_0x3a0add));return _['isUndefined'](_0x3a0add['result'])?null:_0x3a0add[_0x0f80('0x2c')]['toString']();}else{logger['error'](_0x0f80('0x2b'),inspect(_0x3a0add));return null;}}else{logger[_0x0f80('0xa')](_0x0f80('0x2f'));return null;}}catch(_0x57bc7c){logger[_0x0f80('0xa')](_0x57bc7c[_0x0f80('0xc')]);return null;}});}logger[_0x0f80('0x1f')](util[_0x0f80('0x1d')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3978fa[_0x0f80('0x20')],_0x3978fa[_0x0f80('0x21')],_0x3978fa[_0x0f80('0x32')],_0x3978fa[_0x0f80('0x22')],_0x3978fa[_0x0f80('0x33')]));logger[_0x0f80('0x1f')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x3978fa[_0x0f80('0x34')],_0x3978fa[_0x0f80('0x29')],parseInt(_0x3978fa[_0x0f80('0x2a')],0xa)+0x1));_0x3978fa['continueAt'](_0x3978fa[_0x0f80('0x34')],_0x3978fa[_0x0f80('0x29')],parseInt(_0x3978fa['priority'],0xa)+0x1);_0x3978fa[_0x0f80('0x35')]();}function handleNotFound(_0x1a10e1){logger[_0x0f80('0xa')](util[_0x0f80('0x1d')](_0x0f80('0x36'),_0x1a10e1[_0x0f80('0x20')]));_0x1a10e1[_0x0f80('0x37')](_0x1a10e1[_0x0f80('0x34')],_0x1a10e1[_0x0f80('0x29')],parseInt(_0x1a10e1[_0x0f80('0x2a')],0xa)+0x1);_0x1a10e1[_0x0f80('0x35')]();}function handleUnpublished(_0x1c4916){logger['error'](util[_0x0f80('0x1d')]('Project\x20%s\x20not\x20published',_0x1c4916['arg_1']));_0x1c4916[_0x0f80('0x37')](_0x1c4916[_0x0f80('0x34')],_0x1c4916[_0x0f80('0x29')],parseInt(_0x1c4916['priority'],0xa)+0x1);_0x1c4916[_0x0f80('0x35')]();}module[_0x0f80('0x38')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xfd37=['info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','traverseBFS','start','clear','vertex','context','extension','priority','response','code','isUndefined','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','xml2json','util','agi','./rpc','./mailRpc','./graph','getSquareProjects','catch','error','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','length','source','target','toJson','root','production','debug','stringify','format','YYYY-MM-DD\x20HH:mm:ss','omit','mxCell'];(function(_0x46f06a,_0x1a2fe6){var _0x3ce9c1=function(_0x302a09){while(--_0x302a09){_0x46f06a['push'](_0x46f06a['shift']());}};_0x3ce9c1(++_0x1a2fe6);}(_0xfd37,0x134));var _0x7fd3=function(_0x4f9de5,_0x36a67e){_0x4f9de5=_0x4f9de5-0x0;var _0x2538fa=_0xfd37[_0x4f9de5];return _0x2538fa;};'use strict';var _=require(_0x7fd3('0x0'));var moment=require('moment');var parser=require(_0x7fd3('0x1'));var util=require(_0x7fd3('0x2'));var logger=require('../../config/logger')(_0x7fd3('0x3'));var rpc=require(_0x7fd3('0x4'));var mailRpc=require(_0x7fd3('0x5'));var Graph=require(_0x7fd3('0x6'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x7fd3('0x7')]()[_0x7fd3('0x8')](function(_0x18768c){logger[_0x7fd3('0x9')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x18768c[_0x7fd3('0xa')]);return[];});}function addVertex(_0x236bea,_0x38ca94,_0x27d982){_0x38ca94[_0x7fd3('0xb')]=_0x27d982;if(_0x38ca94[_0x7fd3('0xc')](_0x7fd3('0xd'))){_0x38ca94[_0x7fd3('0xe')]=parseInt(_0x38ca94['retry'],0xa);}_0x236bea[_0x7fd3('0xf')](_['omit'](_0x38ca94,'mxCell'));}function initGraph(_0x462882,_0x1bd82d){var _0x26f188=new Graph();for(var _0x5807b7 in _0x462882){if(_0x462882[_0x7fd3('0xc')](_0x5807b7)){if(_['isArray'](_0x462882[_0x5807b7])){for(var _0x31badf=0x0;_0x31badf<_0x462882[_0x5807b7]['length'];_0x31badf+=0x1){addVertex(_0x26f188,_0x462882[_0x5807b7][_0x31badf],_0x5807b7);}}else{addVertex(_0x26f188,_0x462882[_0x5807b7],_0x5807b7);}}}for(var _0x33ffe5=0x0;_0x33ffe5<_0x1bd82d[_0x7fd3('0x10')];_0x33ffe5+=0x1){if(_0x1bd82d[_0x33ffe5][_0x7fd3('0x11')]&&_0x1bd82d[_0x33ffe5]['target']){_0x26f188['addEdge'](_0x1bd82d[_0x33ffe5][_0x7fd3('0x11')],_0x1bd82d[_0x33ffe5][_0x7fd3('0x12')],_0x1bd82d[_0x33ffe5]['value']);}}return _0x26f188;}function getRoot(_0x4cfb5e){return parser[_0x7fd3('0x13')](_0x4cfb5e,{'object':!![]})['mxGraphModel'][_0x7fd3('0x14')];}function inspect(_0x289056){return util['inspect'](_0x289056,{'showHidden':![],'depth':null});}function initialize(_0xfdc6c,_0xddfb6d){var _0x1c0a53=getRoot(_0xfdc6c[_0x7fd3('0x15')]);if(!_0x1c0a53||!_0x1c0a53['start'])return;var _0xff19a,_0x3d0cea,_0x46441a;logger[_0x7fd3('0x16')]('root',JSON[_0x7fd3('0x17')](_0x1c0a53,null,0x2));_0xddfb6d['joinAt']=moment()[_0x7fd3('0x18')](_0x7fd3('0x19'));_0xff19a=initGraph(_[_0x7fd3('0x1a')](_0x1c0a53,_0x7fd3('0x1b')),_0x1c0a53[_0x7fd3('0x1b')]);_0x3d0cea=new Vertices(_0xddfb6d,rpc,mailRpc);logger[_0x7fd3('0x1c')](util[_0x7fd3('0x18')](_0x7fd3('0x1d'),_0xddfb6d[_0x7fd3('0x1e')],_0xddfb6d[_0x7fd3('0x1f')],_0xddfb6d[_0x7fd3('0x20')],_0xddfb6d['dnid'],_0xddfb6d['uniqueid']));_0xff19a[_0x7fd3('0x21')](_0x1c0a53[_0x7fd3('0x22')]['id'],function(_0x356a23){try{_0x356a23=_0x3d0cea[_0x7fd3('0x23')](_0x356a23);logger['debug'](_0x7fd3('0x24'),JSON[_0x7fd3('0x17')](_0x356a23,null,0x2));if(_0x356a23['agicommand']==='gotoc'){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0xddfb6d[_0x7fd3('0x25')]=_0x356a23[_0x7fd3('0x25')]||_0xddfb6d[_0x7fd3('0x25')];_0xddfb6d['extension']=_0x356a23[_0x7fd3('0x26')];_0xddfb6d[_0x7fd3('0x27')]=_0x356a23[_0x7fd3('0x27')]?_0x356a23[_0x7fd3('0x27')]-0x1:0x1;return null;}else if(_0x356a23&&_0x3d0cea[_0x356a23[_0x7fd3('0xb')]]){_0x46441a=_0x3d0cea[_0x356a23[_0x7fd3('0xb')]](_0x356a23);logger[_0x7fd3('0x1c')](_0x7fd3('0x28'),JSON[_0x7fd3('0x17')](_0x46441a,null,0x2));if(_0x46441a&&_0x46441a[_0x7fd3('0x29')]===AGI_CODE_SUCCESS&&_0x46441a['result']!==AGI_RESULT_ERROR&&!_0xddfb6d['evtHangup']){logger[_0x7fd3('0x16')](_0x7fd3('0x28'),inspect(_0x46441a));return _[_0x7fd3('0x2a')](_0x46441a[_0x7fd3('0x2b')])?null:_0x46441a['result'][_0x7fd3('0x2c')]();}else{logger['error'](_0x7fd3('0x28'),inspect(_0x46441a));return null;}}else{logger['error'](_0x7fd3('0x2d'));return null;}}catch(_0x3d4769){logger[_0x7fd3('0x9')](_0x3d4769[_0x7fd3('0xa')]);return null;}});if(_0x1c0a53[_0x7fd3('0x2e')]){logger[_0x7fd3('0x1c')](util[_0x7fd3('0x18')](_0x7fd3('0x2f'),_0xddfb6d['arg_1'],_0xddfb6d[_0x7fd3('0x1f')],_0xddfb6d[_0x7fd3('0x20')],_0xddfb6d['dnid'],_0xddfb6d['uniqueid']));_0xff19a[_0x7fd3('0x21')](_0x1c0a53[_0x7fd3('0x2e')]['id'],function(_0x23cccd){try{_0x23cccd=_0x3d0cea['clear'](_0x23cccd);logger[_0x7fd3('0x16')]('vertex',JSON[_0x7fd3('0x17')](_0x23cccd,null,0x2));if(_0x23cccd&&_0x3d0cea[_0x23cccd[_0x7fd3('0xb')]]){_0x46441a=_0x3d0cea[_0x23cccd['agicommand']](_0x23cccd);if(_0x46441a){logger['debug'](_0x7fd3('0x28'),inspect(_0x46441a));return _[_0x7fd3('0x2a')](_0x46441a[_0x7fd3('0x2b')])?null:_0x46441a[_0x7fd3('0x2b')][_0x7fd3('0x2c')]();}else{logger[_0x7fd3('0x9')](_0x7fd3('0x28'),inspect(_0x46441a));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x274615){logger['error'](_0x274615['stack']);return null;}});}logger[_0x7fd3('0x1c')](util[_0x7fd3('0x18')](_0x7fd3('0x30'),_0xddfb6d[_0x7fd3('0x1e')],_0xddfb6d[_0x7fd3('0x1f')],_0xddfb6d['callerid'],_0xddfb6d[_0x7fd3('0x31')],_0xddfb6d['uniqueid']));logger[_0x7fd3('0x1c')](util[_0x7fd3('0x18')](_0x7fd3('0x32'),_0xddfb6d[_0x7fd3('0x25')],_0xddfb6d[_0x7fd3('0x26')],parseInt(_0xddfb6d[_0x7fd3('0x27')],0xa)+0x1));_0xddfb6d[_0x7fd3('0x33')](_0xddfb6d[_0x7fd3('0x25')],_0xddfb6d[_0x7fd3('0x26')],parseInt(_0xddfb6d[_0x7fd3('0x27')],0xa)+0x1);_0xddfb6d[_0x7fd3('0x34')]();}function handleNotFound(_0x194b3d){logger[_0x7fd3('0x9')](util[_0x7fd3('0x18')](_0x7fd3('0x35'),_0x194b3d['arg_1']));_0x194b3d[_0x7fd3('0x33')](_0x194b3d[_0x7fd3('0x25')],_0x194b3d[_0x7fd3('0x26')],parseInt(_0x194b3d['priority'],0xa)+0x1);_0x194b3d[_0x7fd3('0x34')]();}function handleUnpublished(_0xbb15b8){logger[_0x7fd3('0x9')](util['format'](_0x7fd3('0x36'),_0xbb15b8['arg_1']));_0xbb15b8[_0x7fd3('0x33')](_0xbb15b8['context'],_0xbb15b8['extension'],parseInt(_0xbb15b8[_0x7fd3('0x27')],0xa)+0x1);_0xbb15b8[_0x7fd3('0x34')]();}module[_0x7fd3('0x37')]={'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 4aaed7e..f7ba37d 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 _0x615e=['exports','stream','Transform','call','_inBody','prototype','_transform','_localBuffer','toString','substring','indexOf','trim','slice','headers','emit','line'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x615e,0x111));var _0xe615=function(_0x1d037c,_0x30b12e){_0x1d037c=_0x1d037c-0x0;var _0x53cfde=_0x615e[_0x1d037c];return _0x53cfde;};'use strict';var util=require('util');var Transform=require(_0xe615('0x0'))[_0xe615('0x1')];function AGIReply(_0x2ca440){Transform[_0xe615('0x2')](this,_0x2ca440);this['_localBuffer']='';this[_0xe615('0x3')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xe615('0x4')][_0xe615('0x5')]=function(_0xa4ca5b,_0x1b721e,_0x387a33){var _0x22bd87='\x0a',_0x3fad83=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x54de12=-0x1,_0x67e67b=-0x1,_0x34524d='',_0x1d0e1c=0x0,_0x9e3db9='',_0x17fac5='';this[_0xe615('0x6')]+=_0xa4ca5b[_0xe615('0x7')]();_0x9e3db9=this[_0xe615('0x6')];if(!this['_inBody']){_0x1d0e1c=0x0;while(_0x3fad83[_0x1d0e1c]){while((_0x67e67b=_0x9e3db9['indexOf'](_0x3fad83[_0x1d0e1c]))!=-0x1){_0x34524d=_0x3fad83[_0x1d0e1c];_0x17fac5=_0x9e3db9[_0xe615('0x8')](0x0,_0x67e67b);_0x9e3db9=_0x9e3db9['substring'](_0x67e67b+_0x34524d['length']);var _0x440e8c=_0x17fac5['split'](_0x22bd87),_0x328d5d=0x0,_0x32411={},_0x49277e='',_0x58067e='',_0x4670f9=-0x1;while(_0x440e8c[_0x328d5d]){_0x4670f9=_0x440e8c[_0x328d5d][_0xe615('0x9')](':');if(_0x4670f9!=-0x1){_0x49277e=_0x440e8c[_0x328d5d]['slice'](0x0,_0x4670f9)[_0xe615('0xa')]();_0x58067e=_0x440e8c[_0x328d5d][_0xe615('0xb')](_0x4670f9+0x1)[_0xe615('0xa')]();if(_0x49277e['length']>0x0){_0x32411[_0x49277e]=_0x58067e;}}else{}_0x328d5d++;}this['emit'](_0xe615('0xc'),_0x32411);this['_inBody']=!![];}_0x1d0e1c++;}this[_0xe615('0x6')]=_0x9e3db9;}else{while((_0x54de12=_0x9e3db9['indexOf'](_0x22bd87))!=-0x1){_0x17fac5=_0x9e3db9[_0xe615('0x8')](0x0,_0x54de12);this[_0xe615('0xd')](_0xe615('0xe'),_0x17fac5);_0x9e3db9=_0x9e3db9[_0xe615('0x8')](_0x54de12+_0x22bd87['length']);}this['_localBuffer']=_0x9e3db9;}_0x387a33();};module[_0xe615('0xf')]=AGIReply; \ No newline at end of file +var _0x2143=['slice','trim','length','emit','line','exports','util','stream','Transform','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring'];(function(_0x4ce39b,_0x30dca9){var _0x25957c=function(_0x398953){while(--_0x398953){_0x4ce39b['push'](_0x4ce39b['shift']());}};_0x25957c(++_0x30dca9);}(_0x2143,0x114));var _0x3214=function(_0x308ca1,_0xf8eb57){_0x308ca1=_0x308ca1-0x0;var _0x1c589e=_0x2143[_0x308ca1];return _0x1c589e;};'use strict';var util=require(_0x3214('0x0'));var Transform=require(_0x3214('0x1'))[_0x3214('0x2')];function AGIReply(_0x537f9a){Transform['call'](this,_0x537f9a);this[_0x3214('0x3')]='';this[_0x3214('0x4')]=![];}util[_0x3214('0x5')](AGIReply,Transform);AGIReply[_0x3214('0x6')][_0x3214('0x7')]=function(_0x438728,_0x24a495,_0x7f7687){var _0x84bc1e='\x0a',_0x22f4b2=['\x0a\x0a',_0x3214('0x8')],_0x1a6160=-0x1,_0x2224d3=-0x1,_0x1287b8='',_0x38b2ea=0x0,_0x4a16f1='',_0x529f01='';this[_0x3214('0x3')]+=_0x438728[_0x3214('0x9')]();_0x4a16f1=this[_0x3214('0x3')];if(!this[_0x3214('0x4')]){_0x38b2ea=0x0;while(_0x22f4b2[_0x38b2ea]){while((_0x2224d3=_0x4a16f1[_0x3214('0xa')](_0x22f4b2[_0x38b2ea]))!=-0x1){_0x1287b8=_0x22f4b2[_0x38b2ea];_0x529f01=_0x4a16f1['substring'](0x0,_0x2224d3);_0x4a16f1=_0x4a16f1[_0x3214('0xb')](_0x2224d3+_0x1287b8['length']);var _0x2b436f=_0x529f01['split'](_0x84bc1e),_0x1b705b=0x0,_0x378d3e={},_0x597c99='',_0x352cc0='',_0x1eefa4=-0x1;while(_0x2b436f[_0x1b705b]){_0x1eefa4=_0x2b436f[_0x1b705b]['indexOf'](':');if(_0x1eefa4!=-0x1){_0x597c99=_0x2b436f[_0x1b705b][_0x3214('0xc')](0x0,_0x1eefa4)['trim']();_0x352cc0=_0x2b436f[_0x1b705b][_0x3214('0xc')](_0x1eefa4+0x1)[_0x3214('0xd')]();if(_0x597c99[_0x3214('0xe')]>0x0){_0x378d3e[_0x597c99]=_0x352cc0;}}else{}_0x1b705b++;}this[_0x3214('0xf')]('headers',_0x378d3e);this[_0x3214('0x4')]=!![];}_0x38b2ea++;}this['_localBuffer']=_0x4a16f1;}else{while((_0x1a6160=_0x4a16f1['indexOf'](_0x84bc1e))!=-0x1){_0x529f01=_0x4a16f1[_0x3214('0xb')](0x0,_0x1a6160);this['emit'](_0x3214('0x10'),_0x529f01);_0x4a16f1=_0x4a16f1[_0x3214('0xb')](_0x1a6160+_0x84bc1e[_0x3214('0xe')]);}this[_0x3214('0x3')]=_0x4a16f1;}_0x7f7687();};module[_0x3214('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index a8fd6a2..b584755 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 _0x4ab0=['getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Intervals','getSmsAccountById','createSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','ShowCmHopper','ListId','then','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','LogoutUser','moment','jayson/promise','client','http','request','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','getSquareProjectById','getVoiceQueueById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser'];(function(_0x41d9e7,_0x33ef4a){var _0x282c36=function(_0x2bb2a5){while(--_0x2bb2a5){_0x41d9e7['push'](_0x41d9e7['shift']());}};_0x282c36(++_0x33ef4a);}(_0x4ab0,0xd5));var _0x04ab=function(_0x52563a,_0x1970cc){_0x52563a=_0x52563a-0x0;var _0x6e06d1=_0x4ab0[_0x52563a];return _0x6e06d1;};'use strict';var _=require('lodash');var moment=require(_0x04ab('0x0'));var jayson=require(_0x04ab('0x1'));var client=jayson[_0x04ab('0x2')][_0x04ab('0x3')]({'port':0x2329});function request(_0x3a7b9f,_0x51135e){return new Promise(function(_0x4c3a53,_0x45dfee){return client[_0x04ab('0x4')](_0x3a7b9f,_0x51135e)['then'](function(_0xfe58ca){if(_0xfe58ca[_0x04ab('0x5')]){return _0x45dfee(_0xfe58ca['error'][_0x04ab('0x6')]);}else{return _0x4c3a53(_0xfe58ca[_0x04ab('0x7')]);}})[_0x04ab('0x8')](function(_0x4bc05e){return _0x45dfee(_0x4bc05e);});});}exports[_0x04ab('0x9')]=function(){return request(_0x04ab('0xa'),{'options':{'raw':![],'attributes':['id',_0x04ab('0xb'),_0x04ab('0xc')]}});};exports['getSquareProject']=function(_0x252d00){return request(_0x04ab('0xd'),{'options':{'raw':![],'where':{'name':_0x252d00},'attributes':[_0x04ab('0xc')]}});};exports[_0x04ab('0xe')]=function(_0x5c079e){return request(_0x04ab('0xf'),{'options':{'raw':![],'where':{'id':_0x5c079e},'include':[{'model':_0x04ab('0x10'),'as':_0x04ab('0x11'),'include':[{'model':_0x04ab('0x12'),'as':_0x04ab('0x12')}]}],'attributes':['id',_0x04ab('0xb'),'email'],'smtp':!![]}});};exports[_0x04ab('0x13')]=function(_0x491b3f){return request(_0x04ab('0xd'),{'options':{'where':{'id':_0x491b3f},'attributes':[_0x04ab('0xb')]}});};exports[_0x04ab('0x14')]=function(_0x428798){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x428798},'attributes':['name']}});};exports['getVariableById']=function(_0x103ca8){return request(_0x04ab('0x15'),{'options':{'where':{'id':_0x103ca8},'attributes':[_0x04ab('0xb')]}});};exports[_0x04ab('0x16')]=function(_0x16d633){return request(_0x04ab('0x17'),{'options':{'where':{'id':_0x16d633},'attributes':[_0x04ab('0x18')]}});};exports[_0x04ab('0x19')]=function(_0x1f3251){return request(_0x04ab('0x1a'),{'options':{'where':{'id':_0x1f3251},'attributes':['name']}});};exports[_0x04ab('0x1b')]=function(_0x83ab27){return request(_0x04ab('0x1c'),{'options':{'where':{'phone':_0x83ab27[_0x04ab('0x1d')]},'attributes':['id']}});};exports[_0x04ab('0x1e')]=function(_0x10669a){return request(_0x04ab('0x1f'),{'options':{'where':{'id':_0x10669a},'attributes':[_0x04ab('0xb')]}});};exports[_0x04ab('0x20')]=function(_0x4c1e50){return request(_0x04ab('0x21'),{'options':{'where':{'id':_0x4c1e50},'attributes':['save_name']}});};exports[_0x04ab('0x22')]=function(_0x1d04c2){return request(_0x04ab('0x23'),{'options':{'raw':![],'where':{'id':_0x1d04c2},'include':[{'model':'Interval','as':_0x04ab('0x24')}]}});};exports[_0x04ab('0x25')]=function(_0xf6275e){return request('ShowSmsAccount',{'options':{'where':{'id':_0xf6275e},'attributes':['id','name']}});};exports[_0x04ab('0x26')]=function(_0x2f614a){return request('CreateSmsMessage',{'body':_0x2f614a});};exports['createSquareDetailsReport']=function(_0x2ac1b3){return request(_0x04ab('0x27'),{'body':_0x2ac1b3});};exports[_0x04ab('0x28')]=function(_0x55be60){return request(_0x04ab('0x29'),{'body':_[_0x04ab('0x2a')](_0x55be60,{'project_name':_0x55be60[_0x04ab('0x2b')],'prev_project_name':_0x55be60[_0x04ab('0x2c')]||'','is_subproject':_0x55be60[_0x04ab('0x2c')]?!![]:![],'leaveAt':moment()['format'](_0x04ab('0x2d'))})});};exports[_0x04ab('0x2e')]=function(_0x115fa6){return request(_0x04ab('0x2f'),{'body':_0x115fa6});};exports['createSquareMessage']=function(_0x530a1c){return request(_0x04ab('0x30'),{'body':_0x530a1c});};exports['createCmContact']=function(_0x404eae){return request(_0x04ab('0x31'),{'options':{'raw':![],'where':{'phone':_0x404eae[_0x04ab('0x1d')],'ListId':_0x404eae[_0x04ab('0x32')]}}})[_0x04ab('0x33')](function(_0x5596fc){if(_0x5596fc){return _0x5596fc;}return request('CreateCmContact',{'body':_0x404eae});});};exports[_0x04ab('0x34')]=function(_0x5cdbdb){return request(_0x04ab('0x35'),{'options':{'where':{'id':_0x5cdbdb},'attributes':[_0x04ab('0xb')]}});};exports[_0x04ab('0x36')]=function(_0x459e8c,_0x1c3dca){return request(_0x04ab('0x37'),{'body':{'interface':_0x1c3dca},'options':{'where':_0x459e8c}});};exports[_0x04ab('0x38')]=function(_0x766754,_0x1d2e50,_0x28bfca){return request(_0x04ab('0x39'),{'body':{'type':_0x1d2e50,'uniqueid':_0x28bfca},'options':{'where':_0x766754}});};exports['agentUnpause']=function(_0x38c7f3){return request(_0x04ab('0x3a'),{'body':{},'options':{'where':_0x38c7f3}});};exports['agentLogout']=function(_0x2dafe8){return request(_0x04ab('0x3b'),{'body':{},'options':{'where':_0x2dafe8}});}; \ No newline at end of file +var _0xe14f=['message','result','catch','getSquareProjects','GetSquareProjects','name','production','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','CloudProvider','email','getSquareProjectById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','lodash','moment','jayson/promise','client','http','error'];(function(_0x9e6c52,_0x40d853){var _0x44b194=function(_0x29102b){while(--_0x29102b){_0x9e6c52['push'](_0x9e6c52['shift']());}};_0x44b194(++_0x40d853);}(_0xe14f,0xea));var _0xfe14=function(_0x217265,_0x441234){_0x217265=_0x217265-0x0;var _0x2aa792=_0xe14f[_0x217265];return _0x2aa792;};'use strict';var _=require(_0xfe14('0x0'));var moment=require(_0xfe14('0x1'));var jayson=require(_0xfe14('0x2'));var client=jayson[_0xfe14('0x3')][_0xfe14('0x4')]({'port':0x2329});function request(_0x23b297,_0x211173){return new Promise(function(_0x3afd97,_0x2b7784){return client['request'](_0x23b297,_0x211173)['then'](function(_0x1fa5b6){if(_0x1fa5b6['error']){return _0x2b7784(_0x1fa5b6[_0xfe14('0x5')][_0xfe14('0x6')]);}else{return _0x3afd97(_0x1fa5b6[_0xfe14('0x7')]);}})[_0xfe14('0x8')](function(_0x4232cd){return _0x2b7784(_0x4232cd);});});}exports[_0xfe14('0x9')]=function(){return request(_0xfe14('0xa'),{'options':{'raw':![],'attributes':['id',_0xfe14('0xb'),_0xfe14('0xc')]}});};exports['getSquareProject']=function(_0x2a85b0){return request(_0xfe14('0xd'),{'options':{'raw':![],'where':{'name':_0x2a85b0},'attributes':[_0xfe14('0xc')]}});};exports[_0xfe14('0xe')]=function(_0x32f55d){return request(_0xfe14('0xf'),{'options':{'raw':![],'where':{'id':_0x32f55d},'include':[{'model':'MailServerOut','as':_0xfe14('0x10'),'include':[{'model':'CloudProvider','as':_0xfe14('0x11')}]}],'attributes':['id',_0xfe14('0xb'),_0xfe14('0x12')],'smtp':!![]}});};exports[_0xfe14('0x13')]=function(_0x174ed0){return request(_0xfe14('0xd'),{'options':{'where':{'id':_0x174ed0},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x39799a){return request(_0xfe14('0x14'),{'options':{'where':{'id':_0x39799a},'attributes':[_0xfe14('0xb')]}});};exports['getVariableById']=function(_0x3c2d52){return request('ShowVariable',{'options':{'where':{'id':_0x3c2d52},'attributes':[_0xfe14('0xb')]}});};exports[_0xfe14('0x15')]=function(_0x9e74b){return request(_0xfe14('0x16'),{'options':{'where':{'id':_0x9e74b},'attributes':[_0xfe14('0x17')]}});};exports[_0xfe14('0x18')]=function(_0x2ac71b){return request(_0xfe14('0x19'),{'options':{'where':{'id':_0x2ac71b},'attributes':[_0xfe14('0xb')]}});};exports['getContactByPhone']=function(_0x56522f){return request(_0xfe14('0x1a'),{'options':{'where':{'phone':_0x56522f[_0xfe14('0x1b')]},'attributes':['id']}});};exports[_0xfe14('0x1c')]=function(_0x23c86d){return request(_0xfe14('0x1d'),{'options':{'where':{'id':_0x23c86d},'attributes':[_0xfe14('0xb')]}});};exports[_0xfe14('0x1e')]=function(_0x16734e){return request('ShowSound',{'options':{'where':{'id':_0x16734e},'attributes':[_0xfe14('0x1f')]}});};exports[_0xfe14('0x20')]=function(_0x285c68){return request(_0xfe14('0x21'),{'options':{'raw':![],'where':{'id':_0x285c68},'include':[{'model':_0xfe14('0x22'),'as':'Intervals'}]}});};exports[_0xfe14('0x23')]=function(_0x16e935){return request(_0xfe14('0x24'),{'options':{'where':{'id':_0x16e935},'attributes':['id',_0xfe14('0xb')]}});};exports[_0xfe14('0x25')]=function(_0x48299e){return request(_0xfe14('0x26'),{'body':_0x48299e});};exports[_0xfe14('0x27')]=function(_0x158385){return request(_0xfe14('0x28'),{'body':_0x158385});};exports['createSquareReport']=function(_0x4f4750){return request(_0xfe14('0x29'),{'body':_[_0xfe14('0x2a')](_0x4f4750,{'project_name':_0x4f4750[_0xfe14('0x2b')],'prev_project_name':_0x4f4750[_0xfe14('0x2c')]||'','is_subproject':_0x4f4750[_0xfe14('0x2c')]?!![]:![],'leaveAt':moment()[_0xfe14('0x2d')](_0xfe14('0x2e'))})});};exports[_0xfe14('0x2f')]=function(_0x59f2ad){return request(_0xfe14('0x30'),{'body':_0x59f2ad});};exports[_0xfe14('0x31')]=function(_0x3895fe){return request(_0xfe14('0x32'),{'body':_0x3895fe});};exports[_0xfe14('0x33')]=function(_0xce2ec6){return request(_0xfe14('0x34'),{'options':{'raw':![],'where':{'phone':_0xce2ec6[_0xfe14('0x1b')],'ListId':_0xce2ec6[_0xfe14('0x35')]}}})['then'](function(_0x174319){if(_0x174319){return _0x174319;}return request(_0xfe14('0x36'),{'body':_0xce2ec6});});};exports['getPauseById']=function(_0x24cd85){return request(_0xfe14('0x37'),{'options':{'where':{'id':_0x24cd85},'attributes':[_0xfe14('0xb')]}});};exports[_0xfe14('0x38')]=function(_0x353f9d,_0x18d469){return request(_0xfe14('0x39'),{'body':{'interface':_0x18d469},'options':{'where':_0x353f9d}});};exports['agentPause']=function(_0x3dfa1b,_0x10317c,_0x109a94){return request(_0xfe14('0x3a'),{'body':{'type':_0x10317c,'uniqueid':_0x109a94},'options':{'where':_0x3dfa1b}});};exports[_0xfe14('0x3b')]=function(_0x32a09a){return request('UnpauseUser',{'body':{},'options':{'where':_0x32a09a}});};exports['agentLogout']=function(_0x142747){return request('LogoutUser',{'body':{},'options':{'where':_0x142747}});}; \ 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 616f9c9..4be0e34 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 _0xdb2a=['exports','./polly','./lex'];(function(_0x17a2c4,_0x783b7d){var _0x2885d7=function(_0x40bc1f){while(--_0x40bc1f){_0x17a2c4['push'](_0x17a2c4['shift']());}};_0x2885d7(++_0x783b7d);}(_0xdb2a,0x16f));var _0xadb2=function(_0x45d1ef,_0x497f27){_0x45d1ef=_0x45d1ef-0x0;var _0x570ae8=_0xdb2a[_0x45d1ef];return _0x570ae8;};var polly=require(_0xadb2('0x0'));var lex=require(_0xadb2('0x1'));module[_0xadb2('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xfdb3=['./polly','./lex'];(function(_0x41268d,_0x3906b3){var _0x3e99f5=function(_0x1c1181){while(--_0x1c1181){_0x41268d['push'](_0x41268d['shift']());}};_0x3e99f5(++_0x3906b3);}(_0xfdb3,0x10c));var _0x3fdb=function(_0x192de7,_0xce9a78){_0x192de7=_0x192de7-0x0;var _0x35c139=_0xfdb3[_0x192de7];return _0x35c139;};var polly=require(_0x3fdb('0x0'));var lex=require(_0x3fdb('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index aad2699..e003a26 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 _0x6c76=['./lib/api','exports'];(function(_0x83fea1,_0x59afbe){var _0x3f616f=function(_0x5da8d0){while(--_0x5da8d0){_0x83fea1['push'](_0x83fea1['shift']());}};_0x3f616f(++_0x59afbe);}(_0x6c76,0x184));var _0x66c7=function(_0x27e679,_0x2cb5ce){_0x27e679=_0x27e679-0x0;var _0x527655=_0x6c76[_0x27e679];return _0x527655;};'use strict';var lex=require(_0x66c7('0x0'));module[_0x66c7('0x1')]=function(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b){return lex(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b);}; \ No newline at end of file +var _0xac4a=['exports','./lib/api'];(function(_0x1be133,_0x45da5e){var _0x46d549=function(_0xf95c86){while(--_0xf95c86){_0x1be133['push'](_0x1be133['shift']());}};_0x46d549(++_0x45da5e);}(_0xac4a,0x13f));var _0xaac4=function(_0x534855,_0x502f4b){_0x534855=_0x534855-0x0;var _0x4ac691=_0xac4a[_0x534855];return _0x4ac691;};'use strict';var lex=require(_0xaac4('0x0'));module[_0xaac4('0x1')]=function(_0x2e2ad0,_0x132fc3,_0x38f4f4,_0x1dc251,_0x5aeb7d,_0x58626e){return lex(_0x2e2ad0,_0x132fc3,_0x38f4f4,_0x1dc251,_0x5aeb7d,_0x58626e);}; \ 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 b038b3f..ce5faaa 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(_0x4f2107,_0x114d53){var _0x422a13=function(_0x49a60e){while(--_0x49a60e){_0x4f2107['push'](_0x4f2107['shift']());}};_0x422a13(++_0x114d53);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x10a469,_0x799498){var _0x5ca9cd=function(_0x1962fe){while(--_0x1962fe){_0x10a469['push'](_0x10a469['shift']());}};_0x5ca9cd(++_0x799498);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 5ec315e..cde0b4a 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 _0x2fca=['./lib/api','exports'];(function(_0x4ccc43,_0x4b6847){var _0x1de941=function(_0x59acb0){while(--_0x59acb0){_0x4ccc43['push'](_0x4ccc43['shift']());}};_0x1de941(++_0x4b6847);}(_0x2fca,0x142));var _0xa2fc=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2fca[_0x42cae2];return _0x5f256f;};'use strict';var polly=require(_0xa2fc('0x0'));module[_0xa2fc('0x1')]=function(_0x33b66e,_0x29a26c,_0x4c55a8,_0x432739,_0x56751b,_0x535043,_0x5748f2){return polly(_0x33b66e,_0x29a26c,_0x4c55a8,_0x432739,_0x56751b,_0x535043,_0x5748f2);}; \ No newline at end of file +var _0xc6e8=['exports','./lib/api'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc6e8,0x71));var _0x8c6e=function(_0x57070d,_0x5c613c){_0x57070d=_0x57070d-0x0;var _0x408f09=_0xc6e8[_0x57070d];return _0x408f09;};'use strict';var polly=require(_0x8c6e('0x0'));module[_0x8c6e('0x1')]=function(_0x5301fc,_0x41245b,_0x2a9243,_0x293cdb,_0x352014,_0x17117a,_0x157d8a){return polly(_0x5301fc,_0x41245b,_0x2a9243,_0x293cdb,_0x352014,_0x17117a,_0x157d8a);}; \ 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 b0edc61..4c869d5 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 _0x107a=['Polly','path','bluebird','aws-sdk','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x3758e7,_0x38764f){var _0x38ac65=function(_0x41a910){while(--_0x41a910){_0x3758e7['push'](_0x3758e7['shift']());}};_0x38ac65(++_0x38764f);}(_0x107a,0x1dd));var _0xa107=function(_0x5a2c3e,_0x582a95){_0x5a2c3e=_0x5a2c3e-0x0;var _0x1fe4a3=_0x107a[_0x5a2c3e];return _0x1fe4a3;};'use strict';var fs=require('fs');var path=require(_0xa107('0x0'));var BPromise=require(_0xa107('0x1'));var rs=require('randomstring');var AWS=require(_0xa107('0x2'));function pollyResult(_0x3250fa,_0xf1078,_0xcbc727){return new BPromise(function(_0x28b9fe,_0x3841ff){_0x3250fa['synthesizeSpeech'](_0xf1078,function(_0x281af6,_0x4f7c1f){if(_0x281af6){_0x3841ff(_0x281af6);}else if(_0x4f7c1f){if(_0x4f7c1f[_0xa107('0x3')]instanceof Buffer){fs['writeFile'](_0xcbc727,_0x4f7c1f['AudioStream'],function(_0xcfc46e){if(_0xcfc46e){_0x3841ff(_0xcfc46e);}else{_0x28b9fe();}});}else{_0x3841ff(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x3841ff(new Error(_0xa107('0x4')));}});});}module[_0xa107('0x5')]=function(_0x328295,_0x5932e3,_0xf529d4,_0x17aa3b,_0x40d855,_0x3c76cc,_0x349464){var _0x4aea8c=new AWS[(_0xa107('0x6'))]({'accessKeyId':_0x328295,'secretAccessKey':_0x5932e3,'region':_0xf529d4});var _0x4f747c={'Text':_0x40d855,'TextType':_0x3c76cc||'text','OutputFormat':'mp3','VoiceId':_0x17aa3b};return pollyResult(_0x4aea8c,_0x4f747c,_0x349464);}; \ No newline at end of file +var _0x746a=['aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x746a,0xa9));var _0xa746=function(_0x18851c,_0x10bc83){_0x18851c=_0x18851c-0x0;var _0x3537a9=_0x746a[_0x18851c];return _0x3537a9;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xa746('0x0'));var rs=require('randomstring');var AWS=require(_0xa746('0x1'));function pollyResult(_0x429834,_0x26c4d5,_0x62175e){return new BPromise(function(_0x1b300a,_0x596568){_0x429834[_0xa746('0x2')](_0x26c4d5,function(_0x352ba7,_0xe0aa5d){if(_0x352ba7){_0x596568(_0x352ba7);}else if(_0xe0aa5d){if(_0xe0aa5d[_0xa746('0x3')]instanceof Buffer){fs[_0xa746('0x4')](_0x62175e,_0xe0aa5d['AudioStream'],function(_0x1a21e5){if(_0x1a21e5){_0x596568(_0x1a21e5);}else{_0x1b300a();}});}else{_0x596568(new Error(_0xa746('0x5')));}}else{_0x596568(new Error(_0xa746('0x6')));}});});}module[_0xa746('0x7')]=function(_0x5b06a6,_0x2f412c,_0xf3d603,_0xf20e55,_0x3123e8,_0x31d723,_0x53495e){var _0x25e235=new AWS['Polly']({'accessKeyId':_0x5b06a6,'secretAccessKey':_0x2f412c,'region':_0xf3d603});var _0x47bad9={'Text':_0x3123e8,'TextType':_0x31d723||_0xa746('0x8'),'OutputFormat':_0xa746('0x9'),'VoiceId':_0xf20e55};return pollyResult(_0x25e235,_0x47bad9,_0x53495e);}; \ 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 6c0d197..10db443 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 _0x41ac=['exports'];(function(_0x4a1c2a,_0x44c54b){var _0x345f4b=function(_0x72fdb){while(--_0x72fdb){_0x4a1c2a['push'](_0x4a1c2a['shift']());}};_0x345f4b(++_0x44c54b);}(_0x41ac,0x1d1));var _0xc41a=function(_0x29ab7f,_0x2b8c72){_0x29ab7f=_0x29ab7f-0x0;var _0x3f3ff6=_0x41ac[_0x29ab7f];return _0x3f3ff6;};'use strict';var asr=require('./lib/api');module[_0xc41a('0x0')]=function(_0x128c07,_0x1790c6,_0x522047,_0x218ec2){return asr(_0x128c07,_0x1790c6,_0x522047);}; \ No newline at end of file +var _0x71a9=['./lib/api','exports'];(function(_0x306aa3,_0x44eb30){var _0x3cff1d=function(_0x2ead39){while(--_0x2ead39){_0x306aa3['push'](_0x306aa3['shift']());}};_0x3cff1d(++_0x44eb30);}(_0x71a9,0x82));var _0x971a=function(_0x2cc5d9,_0x7c9476){_0x2cc5d9=_0x2cc5d9-0x0;var _0x217431=_0x71a9[_0x2cc5d9];return _0x217431;};'use strict';var asr=require(_0x971a('0x0'));module[_0x971a('0x1')]=function(_0x14a73a,_0x6eb47e,_0x1a6384,_0x39facf){return asr(_0x14a73a,_0x6eb47e,_0x1a6384);}; \ 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 ea110c7..f784bc4 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 _0x91a7=['lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','8000','bluebird','https://speech.googleapis.com','exports','string','length','key\x20should\x20be\x20a\x20string','undefined'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x91a7,0xe7));var _0x791a=function(_0x1b4820,_0x4c592a){_0x1b4820=_0x1b4820-0x0;var _0x50bc6d=_0x91a7[_0x1b4820];return _0x50bc6d;};'use strict';var url=require('url');var BPromise=require(_0x791a('0x0'));var fs=require('fs');var host=_0x791a('0x1');module[_0x791a('0x2')]=function(_0x5d2796,_0x415994,_0x5b6f78){return new BPromise(function(_0x2f6392,_0x535640){var _0x50ab29;if(typeof _0x5d2796!==_0x791a('0x3')||_0x5d2796[_0x791a('0x4')]===0x0){return _0x535640('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x415994!==_0x791a('0x3')||_0x415994['length']===0x0){return _0x535640(_0x791a('0x5'));}if(typeof _0x5b6f78!==_0x791a('0x6')&&(typeof _0x5b6f78!=='string'||_0x5b6f78[_0x791a('0x4')]===0x0)){return _0x535640(_0x791a('0x7'));}try{_0x50ab29=fs[_0x791a('0x8')](_0x5d2796)[_0x791a('0x9')](_0x791a('0xa'));}catch(_0x5249d5){return _0x535640(_0x5249d5);}return _0x2f6392({'method':_0x791a('0xb'),'uri':host+_0x791a('0xc')+_0x415994,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x791a('0xd'),'languageCode':_0x5b6f78},'audio':{'content':_0x50ab29}},'json':!![]});});}; \ No newline at end of file +var _0x3eec=['key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','filepath\x20should\x20be\x20a\x20string','length'];(function(_0x9d47b,_0x364986){var _0x301442=function(_0x2f080f){while(--_0x2f080f){_0x9d47b['push'](_0x9d47b['shift']());}};_0x301442(++_0x364986);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x121709,_0x20b139){_0x121709=_0x121709-0x0;var _0x492267=_0x3eec[_0x121709];return _0x492267;};'use strict';var url=require(_0xc3ee('0x0'));var BPromise=require(_0xc3ee('0x1'));var fs=require('fs');var host=_0xc3ee('0x2');module[_0xc3ee('0x3')]=function(_0x484ade,_0x223d08,_0x280209){return new BPromise(function(_0x12db6b,_0x35b2fb){var _0x25074b;if(typeof _0x484ade!==_0xc3ee('0x4')||_0x484ade['length']===0x0){return _0x35b2fb(_0xc3ee('0x5'));}if(typeof _0x223d08!==_0xc3ee('0x4')||_0x223d08[_0xc3ee('0x6')]===0x0){return _0x35b2fb(_0xc3ee('0x7'));}if(typeof _0x280209!==_0xc3ee('0x8')&&(typeof _0x280209!==_0xc3ee('0x4')||_0x280209[_0xc3ee('0x6')]===0x0)){return _0x35b2fb(_0xc3ee('0x9'));}try{_0x25074b=fs[_0xc3ee('0xa')](_0x484ade)[_0xc3ee('0xb')]('base64');}catch(_0x523511){return _0x35b2fb(_0x523511);}return _0x12db6b({'method':_0xc3ee('0xc'),'uri':host+_0xc3ee('0xd')+_0x223d08,'body':{'config':{'encoding':_0xc3ee('0xe'),'sampleRateHertz':_0xc3ee('0xf'),'languageCode':_0x280209},'audio':{'content':_0x25074b}},'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 10cb4be..a6350ec 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x942e=['exports'];(function(_0xaf6b4d,_0x21ba4c){var _0x3552ab=function(_0x1013ce){while(--_0x1013ce){_0xaf6b4d['push'](_0xaf6b4d['shift']());}};_0x3552ab(++_0x21ba4c);}(_0x942e,0x181));var _0xe942=function(_0x3693f1,_0x3e21e6){_0x3693f1=_0x3693f1-0x0;var _0x47d2e9=_0x942e[_0x3693f1];return _0x47d2e9;};var asr=require('./asr');module[_0xe942('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 740a1d6..12fbfe6 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 _0x876c=['bluebird','dialogflow','http','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','pipe','end','get','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','then','googleCloudTTS\x20path','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','transcript','alternatives','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','message','googleDialogflow','textRequest','source','result','resolvedQuery','action','fulfillment','speech','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','intent','name','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','ispeechTTS','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','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x876c,0x1bf));var _0xc876=function(_0x1b357f,_0x1cc10d){_0x1b357f=_0x1b357f-0x0;var _0x5adbb4=_0x876c[_0x1b357f];return _0x5adbb4;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xc876('0x0'));var dialogflow=require(_0xc876('0x1'));var fs=require('fs');var http=require(_0xc876('0x2'));var https=require('https');var md5=require(_0xc876('0x3'));var path=require(_0xc876('0x4'));var querystring=require(_0xc876('0x5'));var rp=require(_0xc876('0x6'));var rs=require(_0xc876('0x7'));var sox=require(_0xc876('0x8'));var tts=require(_0xc876('0x9'));var urlParse=require(_0xc876('0xa'))[_0xc876('0xb')];var util=require(_0xc876('0xc'));var aws=require(_0xc876('0xd'));var google=require(_0xc876('0xe'));var sestek=require(_0xc876('0xf'));var tilde=require(_0xc876('0x10'));var logger=require(_0xc876('0x11'))(_0xc876('0x12'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x2ff46e,_0x2cc95c){return new BPromise(function(_0x513b24,_0x4f31ba){var _0x1090d9=urlParse(_0x2ff46e);var _0x3d65de=_0x1090d9[_0xc876('0x13')]===_0xc876('0x14')?https:http;var _0x26cccd={'host':_0x1090d9[_0xc876('0x15')],'path':_0x1090d9[_0xc876('0x4')],'headers':{'user-agent':_0xc876('0x16')}};_0x3d65de['get'](_0x26cccd,function(_0x1df9f2){if(_0x1df9f2[_0xc876('0x17')]!==0xc8){logger[_0xc876('0x18')](_0xc876('0x19')+_0x2ff46e+_0xc876('0x1a')+_0x1df9f2[_0xc876('0x17')]+'\x20('+_0x1df9f2[_0xc876('0x1b')]+')');_0x4f31ba(new Error('request\x20to\x20'+_0x2ff46e+_0xc876('0x1a')+_0x1df9f2[_0xc876('0x17')]+'\x20('+_0x1df9f2['statusMessage']+')'));return;}var _0xeba937=fs[_0xc876('0x1c')](_0x2cc95c);_0xeba937['on'](_0xc876('0x1d'),function(){logger[_0xc876('0x1e')](_0xc876('0x1f'));_0xeba937[_0xc876('0x20')](_0x513b24);});_0xeba937['on']('error',function(_0x3b1b37){fs[_0xc876('0x21')](_0x2cc95c);logger[_0xc876('0x18')]('download\x20error',_0x3b1b37);_0x4f31ba(_0x3b1b37);});_0x1df9f2[_0xc876('0x22')](_0xeba937);})['on'](_0xc876('0x18'),function(_0x155098){logger['error'](_0x155098);_0x4f31ba(_0x155098);})[_0xc876('0x23')]();});}function uploadFile(_0x4b50aa){return new BPromise(function(_0x8f8094,_0x93ddd6){var _0x2be9c5=urlParse(_0x4b50aa);var _0x449efd=_0x2be9c5['protocol']===_0xc876('0x14')?https:http;var _0x146748={'host':_0x2be9c5['host'],'path':_0x2be9c5[_0xc876('0x4')],'headers':{'user-agent':_0xc876('0x16')}};_0x449efd[_0xc876('0x24')](_0x146748,function(_0xe85caa){if(_0xe85caa[_0xc876('0x17')]!==0xc8){_0x93ddd6(new Error(_0xc876('0x19')+_0x4b50aa+_0xc876('0x1a')+_0xe85caa[_0xc876('0x17')]+'\x20('+_0xe85caa[_0xc876('0x1b')]+')'));return;}var _0x38e69c='';_0xe85caa['on'](_0xc876('0x25'),function(_0x65c748){_0x38e69c+=_0x65c748;});_0xe85caa['on']('end',function(){_0x8f8094(_0x38e69c);});})['on'](_0xc876('0x18'),function(_0x2dffe3){_0x93ddd6(_0x2dffe3);})['end']();});}function convertFile(_0x3d51f9,_0x30df3d){return new BPromise(function(_0x52101b,_0x4a7b49){var _0x2f4961=sox[_0xc876('0x26')](_0x3d51f9,_0x30df3d,{'sampleRate':0x1f40,'format':_0xc876('0x27'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2f4961['on'](_0xc876('0x18'),function(_0x307bcf){logger['error'](_0xc876('0x28'),_0x307bcf);_0x4a7b49(_0x307bcf);});_0x2f4961['on'](_0xc876('0x23'),function(){logger['info'](_0xc876('0x29'));_0x52101b();});_0x2f4961[_0xc876('0x2a')]();});}function base64Decode(_0x2bee40,_0xceb561){var _0x1ac08d=path[_0xc876('0x2b')](__dirname,_0xc876('0x2c'),rs[_0xc876('0x2d')](0x4)+_0xc876('0x2e'));fs[_0xc876('0x2f')](_0x1ac08d,_0x2bee40,_0xc876('0x30'));return convertFile(_0x1ac08d,_0xceb561)['then'](function(){try{fs[_0xc876('0x21')](_0x1ac08d);fs[_0xc876('0x31')](_0xceb561,_0xc876('0x32'));}catch(_0xe07531){logger['error'](_0xe07531);}return _0xceb561[_0xc876('0x33')]('.')[0x0];});}function base64Encode(_0x2a5d6d){var _0x4828dc=fs[_0xc876('0x34')](_0x2a5d6d);return new Buffer(_0x4828dc)[_0xc876('0x35')](_0xc876('0x30'));}exports[_0xc876('0x36')]=function(_0x585636,_0x261950,_0x562ca4,_0x367c2d,_0x42e053,_0x56d255){var _0xece6ee,_0x947036;var _0x362ff7=_0xc876('0x37');var _0x54883a=_0xc876('0x38')+_0x585636;var _0x4ac987={};if(_0x261950===_0xc876('0x39')){_0x4ac987[_0xc876('0x3a')]={'ssml':_0x562ca4};}else{_0x4ac987['input']={'text':_0x562ca4};};_0x4ac987['voice']={'languageCode':_0x367c2d,'ssmlGender':_0x42e053};_0x4ac987[_0xc876('0x3b')]={'audioEncoding':_0xc876('0x3c'),'sampleRateHertz':0x1f40};var _0x555409={'url':_0x362ff7+_0xc876('0x3d')+_0x54883a,'method':_0xc876('0x3e'),'json':!![],'body':_0x4ac987};return rp(_0x555409)['then'](function(_0x456f20){return new BPromise(function(_0x3b50de,_0x5c68a9){_0xece6ee=path[_0xc876('0x2b')](__dirname,_0xc876('0x2c'),rs[_0xc876('0x2d')](0x4)+_0xc876('0x3f'));var _0x274d90=Buffer[_0xc876('0x40')](_0x456f20[_0xc876('0x41')],_0xc876('0x30'));return fs[_0xc876('0x42')](_0xece6ee,_0x274d90,function(_0x1598c9){_0x5c68a9(_0x1598c9);},function(_0x451bb9){fs['chmodSync'](_0xece6ee,_0xc876('0x32'));_0x3b50de(_0x451bb9);});});})[_0xc876('0x43')](function(_0x57eb5d){_0x947036=path[_0xc876('0x2b')](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0xece6ee,_0x947036);})[_0xc876('0x43')](function(){try{fs['unlink'](_0xece6ee);fs[_0xc876('0x31')](_0x947036,_0xc876('0x32'));}catch(_0x12a066){logger[_0xc876('0x18')](_0x12a066);}logger[_0xc876('0x1e')](_0xc876('0x44'),_0x947036[_0xc876('0x33')]('.')[0x0]);return _0x947036[_0xc876('0x33')]('.')[0x0];});};exports[_0xc876('0x45')]=function(_0x3057f6,_0x1ef9be){var _0x4e5a4d='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x37bea7,_0x480a8c;var _0x258321;var _0x41b5fd={'encoding':_0xc876('0x46'),'method':'POST','timeout':0x2710,'url':_0x4e5a4d,'headers':{'Content-Type':_0xc876('0x47')},'body':_0xc876('0x48')+encodeURIComponent(JSON['stringify']([[[_0xc876('0x49'),JSON[_0xc876('0x4a')]([_0x3057f6,_0x1ef9be||'en',![],_0xc876('0x4b')]),null,_0xc876('0x4c')]]]))};return rp(_0x41b5fd)[_0xc876('0x43')](function(_0x431618){try{_0x258321=eval(_0x431618['slice'](0x5))[0x0][0x2];}catch(_0x370c43){throw new Error(_0xc876('0x4d')+_0x431618[_0xc876('0x25')]);}if(!_0x258321){if(_0x3057f6[_0xc876('0x4e')]>0xc8){throw new Error(_0xc876('0x4f'));}else{throw new Error(_0xc876('0x50')+_0x1ef9be+_0xc876('0x51'));}}try{_0x258321=eval(_0x258321)[0x0];}catch(_0x3e9551){throw new Error(_0xc876('0x4d')+res[_0xc876('0x25')]);}const _0x558d9b=_0x258321;_0x37bea7=path[_0xc876('0x2b')](__dirname,'tmp',rs[_0xc876('0x2d')](0x4)+'.mp3');fs[_0xc876('0x2f')](_0x37bea7,_0x258321,{'encoding':_0xc876('0x30')});_0x480a8c=path[_0xc876('0x2b')](__dirname,_0xc876('0x2c'),rs[_0xc876('0x2d')](0x4)+_0xc876('0x2e'));return convertFile(_0x37bea7,_0x480a8c);})[_0xc876('0x43')](function(){try{fs[_0xc876('0x21')](_0x37bea7);fs['chmodSync'](_0x480a8c,_0xc876('0x32'));}catch(_0x176d61){logger['error'](_0x176d61);}logger[_0xc876('0x1e')](_0xc876('0x52'),_0x480a8c[_0xc876('0x33')]('.')[0x0]);return _0x480a8c[_0xc876('0x33')]('.')[0x0];});};exports[_0xc876('0x53')]=function(_0x1b92c9,_0x49bddc,_0xdc0fef){return google[_0xc876('0x54')](_0x1b92c9,_0x49bddc,_0xdc0fef)[_0xc876('0x43')](function(_0x359070){logger['info'](_0x359070[_0xc876('0x55')]);return rp(_0x359070);})[_0xc876('0x43')](function(_0x478eef){var _0x4f99a2='';var _0x2f2707=0x0;try{fs[_0xc876('0x21')](_0x1b92c9);}catch(_0x2fbf55){logger['error'](_0x2fbf55);}if(_0x478eef&&_0x478eef[_0xc876('0x56')]){_0x4f99a2=_0x478eef[_0xc876('0x56')][_0xc876('0x57')](function(_0x385fcb){return _0x385fcb&&_0x385fcb['alternatives'][0x0]&&_0x385fcb['alternatives'][0x0][_0xc876('0x58')]?_0x385fcb[_0xc876('0x59')][0x0][_0xc876('0x58')]:'';})['join']('\x0a');_0x2f2707=_0x478eef['results']['map'](function(_0x19d30b){return _0x19d30b&&_0x19d30b[_0xc876('0x59')][0x0]&&_0x19d30b['alternatives'][0x0]['confidence']?_0x19d30b[_0xc876('0x59')][0x0][_0xc876('0x5a')]:0x0;})[_0xc876('0x5b')]('\x0a');}logger['info'](_0xc876('0x5c'),_0x4f99a2);logger['info'](_0xc876('0x5d'),_0x2f2707);return{'transcript':_0x4f99a2,'confidence':_0x2f2707};})[_0xc876('0x5e')](function(_0x1a146a){logger['error']('[%s]\x20%s:%s',_0x1a146a[_0xc876('0x17')],_0x1a146a['name'],_0x1a146a[_0xc876('0x5f')]);});};exports[_0xc876('0x60')]=function(_0x1fa709,_0x5871e2,_0x535c0a,_0x47e54e){var _0x59ff1b=apiai(_0x5871e2,{'language':_0x47e54e||'en'});return _0x59ff1b[_0xc876('0x61')](_0x535c0a,{'sessionId':md5(_0x1fa709)})[_0xc876('0x43')](function(_0x43963c){logger[_0xc876('0x1e')](JSON[_0xc876('0x4a')](_0x43963c));return{'source':_0x43963c['result'][_0xc876('0x62')],'resolvedQuery':_0x43963c[_0xc876('0x63')][_0xc876('0x64')],'action':_0x43963c['result'][_0xc876('0x65')],'actionIncomplete':_0x43963c[_0xc876('0x63')]['actionIncomplete'],'speech':_0x43963c[_0xc876('0x63')][_0xc876('0x66')][_0xc876('0x67')],'score':_0x43963c['result'][_0xc876('0x68')],'statusCode':_0x43963c[_0xc876('0x69')][_0xc876('0x6a')],'endConversation':_0x43963c['result'][_0xc876('0x6b')]['endConversation']||![],'isFallbackIntent':_0x43963c[_0xc876('0x63')]['metadata'][_0xc876('0x6c')]};});};exports[_0xc876('0x6d')]=function(_0x31cc95,_0x3ce0c8,_0x5bc39a,_0x10d888,_0x15b7d0,_0x55a55f){var _0xc8953=_0x10d888[_0xc876('0x6e')](/\\n/g,'\x0a');var _0x27cd90={'credentials':{'private_key':_0xc8953,'client_email':_0x5bc39a}};var _0x1c8159=new dialogflow['SessionsClient'](_0x27cd90);var _0x384063=_0x1c8159[_0xc876('0x6f')](_0x3ce0c8,md5(_0x31cc95));var _0x2ad0a1={'session':_0x384063,'queryInput':{'text':{'text':_0x15b7d0,'languageCode':_0x55a55f}}};return _0x1c8159[_0xc876('0x70')](_0x2ad0a1)[_0xc876('0x43')](function(_0x7ca158){if(_0x7ca158&&_0x7ca158[_0xc876('0x4e')]){logger[_0xc876('0x1e')](_0xc876('0x71'),JSON[_0xc876('0x4a')](_0x7ca158));var _0x405f2b=_0x7ca158[0x0];if(_0x405f2b){var _0x430532={'action':_0x405f2b[_0xc876('0x72')][_0xc876('0x65')],'allRequiredParamsPresent':_0x405f2b[_0xc876('0x72')][_0xc876('0x73')],'endConversation':_0x405f2b['queryResult'][_0xc876('0x74')]&&_0x405f2b['queryResult'][_0xc876('0x74')]['fields']?_0x405f2b['queryResult'][_0xc876('0x74')][_0xc876('0x75')]['end_conversation'][_0xc876('0x76')]:![],'fulfillmentText':_0x405f2b[_0xc876('0x72')]['fulfillmentText'],'intentName':_0x405f2b['queryResult'][_0xc876('0x77')][_0xc876('0x78')],'intentDisplayName':_0x405f2b['queryResult'][_0xc876('0x77')][_0xc876('0x79')],'isFallbackIntent':_0x405f2b[_0xc876('0x72')]['intent'][_0xc876('0x7a')],'languageCode':_0x405f2b[_0xc876('0x72')][_0xc876('0x7b')],'queryText':_0x405f2b['queryResult'][_0xc876('0x7c')],'responseId':_0x405f2b[_0xc876('0x7d')],'score':_0x405f2b[_0xc876('0x72')][_0xc876('0x7e')],'speech':_0x405f2b['queryResult'][_0xc876('0x7f')],'providerResponse':JSON[_0xc876('0x4a')](_0x7ca158)};return _0x430532;}}});};exports[_0xc876('0x80')]=function(_0xbc5a54,_0x1d2dba,_0x550af7,_0x4ccb2b){return tilde['asr'](_0xbc5a54,_0x1d2dba,_0x550af7,_0x4ccb2b)[_0xc876('0x43')](function(_0x3dce20){try{fs[_0xc876('0x21')](_0xbc5a54);}catch(_0x4e27d3){logger['error'](_0x4e27d3);}logger[_0xc876('0x1e')](_0xc876('0x81'),_0x3dce20[_0xc876('0x58')]);logger['info'](_0xc876('0x82'),_0x3dce20['confidence']);return _0x3dce20;});};exports[_0xc876('0x83')]=function(_0x2c8a66,_0x167e6f,_0x29b00b,_0x55a5d4,_0xfbe306,_0x1a5488){var _0x3d4cc7=path[_0xc876('0x2b')](__dirname,_0xc876('0x2c'),rs[_0xc876('0x2d')](0x4)+'.mp3');var _0x3c5be5;return aws[_0xc876('0x84')](_0x2c8a66,_0x167e6f,_0x29b00b,_0x55a5d4,_0xfbe306,_0x1a5488,_0x3d4cc7)[_0xc876('0x43')](function(){_0x3c5be5=path[_0xc876('0x2b')](__dirname,'tmp',rs[_0xc876('0x2d')](0x4)+_0xc876('0x2e'));return convertFile(_0x3d4cc7,_0x3c5be5);})[_0xc876('0x43')](function(){try{fs[_0xc876('0x21')](_0x3d4cc7);fs[_0xc876('0x31')](_0x3c5be5,_0xc876('0x32'));}catch(_0x4656d2){logger[_0xc876('0x18')](_0x4656d2);}return _0x3c5be5[_0xc876('0x33')]('.')[0x0];});};exports['awsLex']=function(_0x379a57,_0x242704,_0x4807aa,_0x32a0e5,_0xc5de47,_0x3bf447){return aws['lex'](_0x379a57,_0x242704,_0x4807aa,_0x32a0e5,_0xc5de47,_0x3bf447)[_0xc876('0x43')](function(_0x2d67d0){logger[_0xc876('0x1e')](JSON[_0xc876('0x4a')](_0x2d67d0));return _0x2d67d0;});};exports[_0xc876('0x85')]=function(_0x184d0a,_0x4fcd35,_0x294b18,_0x56d057){var _0x240b7a=util[_0xc876('0x86')](_0xc876('0x87'),ISPEECH_API,_0x184d0a,encodeURIComponent(_0x4fcd35),_0x294b18,_0x56d057);var _0x1ac39f=path['resolve'](__dirname,_0xc876('0x2c'),rs[_0xc876('0x2d')](0x4)+'.mp3');var _0x30f7e3;return downloadFile(_0x240b7a,_0x1ac39f)[_0xc876('0x43')](function(){_0x30f7e3=path['resolve'](__dirname,_0xc876('0x2c'),rs[_0xc876('0x2d')](0x4)+'.wav');return convertFile(_0x1ac39f,_0x30f7e3);})[_0xc876('0x43')](function(){try{fs[_0xc876('0x21')](_0x1ac39f);fs[_0xc876('0x31')](_0x30f7e3,_0xc876('0x32'));}catch(_0x23f2d5){logger['error'](_0x23f2d5);}return _0x30f7e3[_0xc876('0x33')]('.')[0x0];});};exports[_0xc876('0x88')]=function(_0x30c032,_0x204d9a,_0x459812,_0x56763c){var _0x36674e=util[_0xc876('0x86')](_0xc876('0x89'),ISPEECH_API,_0x204d9a,_0x459812,base64Encode(_0x30c032),_0x56763c?util[_0xc876('0x86')](_0xc876('0x8a'),encodeURIComponent(_0x56763c)):_0xc876('0x8b'));return uploadFile(_0x36674e)['then'](function(_0x223988){return querystring[_0xc876('0xb')](_0x223988);});};exports[_0xc876('0x8c')]=function(_0x4d9c4c,_0x5915bd){return sestek[_0xc876('0x8d')](_0x4d9c4c,_0x5915bd)[_0xc876('0x43')](function(_0x373567){logger['info'](JSON['stringify'](_0x373567));var _0x58054d={'speech':_0x373567[_0xc876('0x8e')],'action':_0x373567[_0xc876('0x8f')]?_0x373567['channelData'][_0xc876('0x90')]:undefined,'actiondata':_0x373567['channelData']?_0x373567[_0xc876('0x8f')][_0xc876('0x91')]:undefined};if(_0x373567[_0xc876('0x8f')]&&_0x373567[_0xc876('0x8f')][_0xc876('0x92')]){return base64Decode(_0x373567['channelData'][_0xc876('0x92')][_0xc876('0x93')],path['resolve'](__dirname,_0xc876('0x2c'),rs[_0xc876('0x2d')](0x4)+_0xc876('0x2e')))[_0xc876('0x43')](function(_0x3e085c){_0x58054d[_0xc876('0x94')]=_0x3e085c;return _0x58054d;});}return _0x58054d;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x25e1=['format','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','https','md5','path','querystring','request-promise','randomstring','sox','url','parse','util','./aws','./sestek','./tilde','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','finish','info','close','unlink','download\x20error','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','777','split','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','text:synthesize','POST','then','.mp3','writeFile','chmodSync','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','generic','slice','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','source','action','fulfillment','speech','score','status','code','endConversation','metadata','googleDialogflowV2','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex'];(function(_0x132399,_0x1c4b0f){var _0x2a27e9=function(_0x4eac3b){while(--_0x4eac3b){_0x132399['push'](_0x132399['shift']());}};_0x2a27e9(++_0x1c4b0f);}(_0x25e1,0x11c));var _0x125e=function(_0x2a7db7,_0x22e14a){_0x2a7db7=_0x2a7db7-0x0;var _0x1dabb4=_0x25e1[_0x2a7db7];return _0x1dabb4;};'use strict';var apiai=require(_0x125e('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x125e('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x125e('0x2'));var md5=require(_0x125e('0x3'));var path=require(_0x125e('0x4'));var querystring=require(_0x125e('0x5'));var rp=require(_0x125e('0x6'));var rs=require(_0x125e('0x7'));var sox=require(_0x125e('0x8'));var tts=require('google-tts-api');var urlParse=require(_0x125e('0x9'))[_0x125e('0xa')];var util=require(_0x125e('0xb'));var aws=require(_0x125e('0xc'));var google=require('./google');var sestek=require(_0x125e('0xd'));var tilde=require(_0x125e('0xe'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x125e('0xf');function downloadFile(_0xb6cba3,_0xcee319){return new BPromise(function(_0x24183e,_0x3967ad){var _0x28214f=urlParse(_0xb6cba3);var _0x471cb6=_0x28214f[_0x125e('0x10')]===_0x125e('0x11')?https:http;var _0x4f012c={'host':_0x28214f[_0x125e('0x12')],'path':_0x28214f[_0x125e('0x4')],'headers':{'user-agent':_0x125e('0x13')}};_0x471cb6['get'](_0x4f012c,function(_0x286275){if(_0x286275['statusCode']!==0xc8){logger[_0x125e('0x14')](_0x125e('0x15')+_0xb6cba3+_0x125e('0x16')+_0x286275[_0x125e('0x17')]+'\x20('+_0x286275[_0x125e('0x18')]+')');_0x3967ad(new Error(_0x125e('0x15')+_0xb6cba3+_0x125e('0x16')+_0x286275['statusCode']+'\x20('+_0x286275[_0x125e('0x18')]+')'));return;}var _0x527a7f=fs['createWriteStream'](_0xcee319);_0x527a7f['on'](_0x125e('0x19'),function(){logger[_0x125e('0x1a')]('finish\x20download\x20file');_0x527a7f[_0x125e('0x1b')](_0x24183e);});_0x527a7f['on'](_0x125e('0x14'),function(_0x5be779){fs[_0x125e('0x1c')](_0xcee319);logger[_0x125e('0x14')](_0x125e('0x1d'),_0x5be779);_0x3967ad(_0x5be779);});_0x286275[_0x125e('0x1e')](_0x527a7f);})['on'](_0x125e('0x14'),function(_0x4af9f3){logger[_0x125e('0x14')](_0x4af9f3);_0x3967ad(_0x4af9f3);})[_0x125e('0x1f')]();});}function uploadFile(_0x151da3){return new BPromise(function(_0x453aba,_0x2ed2d6){var _0x305adf=urlParse(_0x151da3);var _0x122ef4=_0x305adf[_0x125e('0x10')]==='https:'?https:http;var _0x3d56b3={'host':_0x305adf['host'],'path':_0x305adf[_0x125e('0x4')],'headers':{'user-agent':_0x125e('0x13')}};_0x122ef4['get'](_0x3d56b3,function(_0x34d90f){if(_0x34d90f[_0x125e('0x17')]!==0xc8){_0x2ed2d6(new Error(_0x125e('0x15')+_0x151da3+_0x125e('0x16')+_0x34d90f['statusCode']+'\x20('+_0x34d90f[_0x125e('0x18')]+')'));return;}var _0x3ba91f='';_0x34d90f['on'](_0x125e('0x20'),function(_0x40b947){_0x3ba91f+=_0x40b947;});_0x34d90f['on']('end',function(){_0x453aba(_0x3ba91f);});})['on'](_0x125e('0x14'),function(_0x15d181){_0x2ed2d6(_0x15d181);})[_0x125e('0x1f')]();});}function convertFile(_0x291124,_0x36525c){return new BPromise(function(_0x4baaeb,_0x5db49d){var _0x4eb694=sox[_0x125e('0x21')](_0x291124,_0x36525c,{'sampleRate':0x1f40,'format':_0x125e('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4eb694['on']('error',function(_0x59b302){logger['error'](_0x125e('0x23'),_0x59b302);_0x5db49d(_0x59b302);});_0x4eb694['on']('end',function(){logger['info'](_0x125e('0x24'));_0x4baaeb();});_0x4eb694[_0x125e('0x25')]();});}function base64Decode(_0xb154c4,_0x31517f){var _0x3fa88e=path[_0x125e('0x26')](__dirname,_0x125e('0x27'),rs[_0x125e('0x28')](0x4)+_0x125e('0x29'));fs[_0x125e('0x2a')](_0x3fa88e,_0xb154c4,'base64');return convertFile(_0x3fa88e,_0x31517f)['then'](function(){try{fs[_0x125e('0x1c')](_0x3fa88e);fs['chmodSync'](_0x31517f,_0x125e('0x2b'));}catch(_0x7c5e51){logger['error'](_0x7c5e51);}return _0x31517f[_0x125e('0x2c')]('.')[0x0];});}function base64Encode(_0x3db4c9){var _0x5cfb9b=fs[_0x125e('0x2d')](_0x3db4c9);return new Buffer(_0x5cfb9b)[_0x125e('0x2e')](_0x125e('0x2f'));}exports[_0x125e('0x30')]=function(_0x5ed8af,_0x594cf4,_0xd45786,_0x1997a2,_0x372171,_0xd310e5){var _0x320eda,_0x56a58e;var _0x58a219=_0x125e('0x31');var _0x32e462=_0x125e('0x32')+_0x5ed8af;var _0x36dd40={};if(_0x594cf4==='ssml'){_0x36dd40[_0x125e('0x33')]={'ssml':_0xd45786};}else{_0x36dd40[_0x125e('0x33')]={'text':_0xd45786};};_0x36dd40[_0x125e('0x34')]={'languageCode':_0x1997a2,'ssmlGender':_0x372171};_0x36dd40[_0x125e('0x35')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x27370b={'url':_0x58a219+_0x125e('0x36')+_0x32e462,'method':_0x125e('0x37'),'json':!![],'body':_0x36dd40};return rp(_0x27370b)[_0x125e('0x38')](function(_0x30695b){return new BPromise(function(_0x25be48,_0x30d6cc){_0x320eda=path[_0x125e('0x26')](__dirname,_0x125e('0x27'),rs[_0x125e('0x28')](0x4)+_0x125e('0x39'));var _0x239502=Buffer['from'](_0x30695b['audioContent'],_0x125e('0x2f'));return fs[_0x125e('0x3a')](_0x320eda,_0x239502,function(_0x34ef85){_0x30d6cc(_0x34ef85);},function(_0x122f09){fs[_0x125e('0x3b')](_0x320eda,_0x125e('0x2b'));_0x25be48(_0x122f09);});});})['then'](function(_0x13a0cc){_0x56a58e=path['resolve'](__dirname,_0x125e('0x27'),rs[_0x125e('0x28')](0x4)+_0x125e('0x29'));return convertFile(_0x320eda,_0x56a58e);})[_0x125e('0x38')](function(){try{fs['unlink'](_0x320eda);fs[_0x125e('0x3b')](_0x56a58e,_0x125e('0x2b'));}catch(_0x39f0ba){logger['error'](_0x39f0ba);}logger[_0x125e('0x1a')](_0x125e('0x3c'),_0x56a58e['split']('.')[0x0]);return _0x56a58e[_0x125e('0x2c')]('.')[0x0];});};exports[_0x125e('0x3d')]=function(_0x282d50,_0x173696){var _0x4b7a3b=_0x125e('0x3e');var _0x3c06c4,_0x30bb7e;var _0x34013a;var _0x3cbab7={'encoding':_0x125e('0x3f'),'method':'POST','timeout':0x2710,'url':_0x4b7a3b,'headers':{'Content-Type':_0x125e('0x40')},'body':_0x125e('0x41')+encodeURIComponent(JSON[_0x125e('0x42')]([[[_0x125e('0x43'),JSON[_0x125e('0x42')]([_0x282d50,_0x173696||'en',![],'null']),null,_0x125e('0x44')]]]))};return rp(_0x3cbab7)[_0x125e('0x38')](function(_0x1cee18){try{_0x34013a=eval(_0x1cee18[_0x125e('0x45')](0x5))[0x0][0x2];}catch(_0x346f05){throw new Error('parse\x20response\x20failed:\x0a'+_0x1cee18[_0x125e('0x20')]);}if(!_0x34013a){if(_0x282d50['length']>0xc8){throw new Error(_0x125e('0x46'));}else{throw new Error('lang\x20\x22'+_0x173696+_0x125e('0x47'));}}try{_0x34013a=eval(_0x34013a)[0x0];}catch(_0x37d2a3){throw new Error(_0x125e('0x48')+res['data']);}const _0xfaf0b1=_0x34013a;_0x3c06c4=path['resolve'](__dirname,_0x125e('0x27'),rs['generate'](0x4)+'.mp3');fs[_0x125e('0x2a')](_0x3c06c4,_0x34013a,{'encoding':_0x125e('0x2f')});_0x30bb7e=path[_0x125e('0x26')](__dirname,_0x125e('0x27'),rs[_0x125e('0x28')](0x4)+_0x125e('0x29'));return convertFile(_0x3c06c4,_0x30bb7e);})[_0x125e('0x38')](function(){try{fs['unlink'](_0x3c06c4);fs[_0x125e('0x3b')](_0x30bb7e,_0x125e('0x2b'));}catch(_0x161d6a){logger[_0x125e('0x14')](_0x161d6a);}logger['info'](_0x125e('0x49'),_0x30bb7e[_0x125e('0x2c')]('.')[0x0]);return _0x30bb7e[_0x125e('0x2c')]('.')[0x0];});};exports[_0x125e('0x4a')]=function(_0xc18c14,_0x32374a,_0x1f94a9){return google[_0x125e('0x4b')](_0xc18c14,_0x32374a,_0x1f94a9)['then'](function(_0x451147){logger['info'](_0x451147['uri']);return rp(_0x451147);})[_0x125e('0x38')](function(_0x5f3c43){var _0x163def='';var _0x441d06=0x0;try{fs[_0x125e('0x1c')](_0xc18c14);}catch(_0x3d982a){logger['error'](_0x3d982a);}if(_0x5f3c43&&_0x5f3c43[_0x125e('0x4c')]){_0x163def=_0x5f3c43['results'][_0x125e('0x4d')](function(_0x4d4205){return _0x4d4205&&_0x4d4205['alternatives'][0x0]&&_0x4d4205[_0x125e('0x4e')][0x0]['transcript']?_0x4d4205[_0x125e('0x4e')][0x0][_0x125e('0x4f')]:'';})[_0x125e('0x50')]('\x0a');_0x441d06=_0x5f3c43[_0x125e('0x4c')][_0x125e('0x4d')](function(_0xd6a292){return _0xd6a292&&_0xd6a292['alternatives'][0x0]&&_0xd6a292[_0x125e('0x4e')][0x0]['confidence']?_0xd6a292[_0x125e('0x4e')][0x0][_0x125e('0x51')]:0x0;})[_0x125e('0x50')]('\x0a');}logger[_0x125e('0x1a')](_0x125e('0x52'),_0x163def);logger[_0x125e('0x1a')](_0x125e('0x53'),_0x441d06);return{'transcript':_0x163def,'confidence':_0x441d06};})[_0x125e('0x54')](function(_0x5daaf4){logger[_0x125e('0x14')](_0x125e('0x55'),_0x5daaf4[_0x125e('0x17')],_0x5daaf4['name'],_0x5daaf4[_0x125e('0x56')]);});};exports[_0x125e('0x57')]=function(_0x2c4495,_0x3d14c8,_0x5c7a68,_0x3fba31){var _0x3bc738=apiai(_0x3d14c8,{'language':_0x3fba31||'en'});return _0x3bc738[_0x125e('0x58')](_0x5c7a68,{'sessionId':md5(_0x2c4495)})[_0x125e('0x38')](function(_0x254ce4){logger[_0x125e('0x1a')](JSON[_0x125e('0x42')](_0x254ce4));return{'source':_0x254ce4[_0x125e('0x59')][_0x125e('0x5a')],'resolvedQuery':_0x254ce4[_0x125e('0x59')]['resolvedQuery'],'action':_0x254ce4['result'][_0x125e('0x5b')],'actionIncomplete':_0x254ce4['result']['actionIncomplete'],'speech':_0x254ce4['result'][_0x125e('0x5c')][_0x125e('0x5d')],'score':_0x254ce4['result'][_0x125e('0x5e')],'statusCode':_0x254ce4[_0x125e('0x5f')][_0x125e('0x60')],'endConversation':_0x254ce4[_0x125e('0x59')]['metadata'][_0x125e('0x61')]||![],'isFallbackIntent':_0x254ce4[_0x125e('0x59')][_0x125e('0x62')]['isFallbackIntent']};});};exports[_0x125e('0x63')]=function(_0x3b07ea,_0x832da,_0x3bb5f8,_0x562842,_0x43b9f3,_0x3624c6){var _0x433a2e=_0x562842['replace'](/\\n/g,'\x0a');var _0x4a848a={'credentials':{'private_key':_0x433a2e,'client_email':_0x3bb5f8}};var _0x5ec938=new dialogflow['SessionsClient'](_0x4a848a);var _0x2fc35d=_0x5ec938['sessionPath'](_0x832da,md5(_0x3b07ea));var _0xbdce29={'session':_0x2fc35d,'queryInput':{'text':{'text':_0x43b9f3,'languageCode':_0x3624c6}}};return _0x5ec938[_0x125e('0x64')](_0xbdce29)[_0x125e('0x38')](function(_0x30388d){if(_0x30388d&&_0x30388d[_0x125e('0x65')]){logger['info'](_0x125e('0x66'),JSON['stringify'](_0x30388d));var _0xd63259=_0x30388d[0x0];if(_0xd63259){var _0x271d1b={'action':_0xd63259[_0x125e('0x67')][_0x125e('0x5b')],'allRequiredParamsPresent':_0xd63259[_0x125e('0x67')][_0x125e('0x68')],'endConversation':_0xd63259['queryResult']['diagnosticInfo']&&_0xd63259[_0x125e('0x67')]['diagnosticInfo']['fields']?_0xd63259[_0x125e('0x67')][_0x125e('0x69')][_0x125e('0x6a')][_0x125e('0x6b')][_0x125e('0x6c')]:![],'fulfillmentText':_0xd63259[_0x125e('0x67')][_0x125e('0x6d')],'intentName':_0xd63259['queryResult'][_0x125e('0x6e')][_0x125e('0x6f')],'intentDisplayName':_0xd63259[_0x125e('0x67')][_0x125e('0x6e')][_0x125e('0x70')],'isFallbackIntent':_0xd63259[_0x125e('0x67')][_0x125e('0x6e')]['isFallback'],'languageCode':_0xd63259[_0x125e('0x67')][_0x125e('0x71')],'queryText':_0xd63259['queryResult'][_0x125e('0x72')],'responseId':_0xd63259[_0x125e('0x73')],'score':_0xd63259['queryResult'][_0x125e('0x74')],'speech':_0xd63259[_0x125e('0x67')][_0x125e('0x6d')],'providerResponse':JSON[_0x125e('0x42')](_0x30388d)};return _0x271d1b;}}});};exports[_0x125e('0x75')]=function(_0x35e706,_0xe2a765,_0xa8132e,_0x42906a){return tilde[_0x125e('0x4b')](_0x35e706,_0xe2a765,_0xa8132e,_0x42906a)[_0x125e('0x38')](function(_0x34f945){try{fs[_0x125e('0x1c')](_0x35e706);}catch(_0x57cf28){logger[_0x125e('0x14')](_0x57cf28);}logger[_0x125e('0x1a')](_0x125e('0x76'),_0x34f945[_0x125e('0x4f')]);logger[_0x125e('0x1a')](_0x125e('0x77'),_0x34f945[_0x125e('0x51')]);return _0x34f945;});};exports[_0x125e('0x78')]=function(_0x2c5027,_0x31d49c,_0x2cb68e,_0x282261,_0x254cd8,_0x48bf29){var _0x4ae475=path[_0x125e('0x26')](__dirname,_0x125e('0x27'),rs['generate'](0x4)+_0x125e('0x39'));var _0x5189b9;return aws[_0x125e('0x79')](_0x2c5027,_0x31d49c,_0x2cb68e,_0x282261,_0x254cd8,_0x48bf29,_0x4ae475)[_0x125e('0x38')](function(){_0x5189b9=path[_0x125e('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0x125e('0x29'));return convertFile(_0x4ae475,_0x5189b9);})[_0x125e('0x38')](function(){try{fs['unlink'](_0x4ae475);fs[_0x125e('0x3b')](_0x5189b9,_0x125e('0x2b'));}catch(_0x30ee4e){logger[_0x125e('0x14')](_0x30ee4e);}return _0x5189b9['split']('.')[0x0];});};exports[_0x125e('0x7a')]=function(_0x109109,_0x204e2c,_0x44610e,_0x3a5499,_0x4da2e4,_0x2d3076){return aws[_0x125e('0x7b')](_0x109109,_0x204e2c,_0x44610e,_0x3a5499,_0x4da2e4,_0x2d3076)[_0x125e('0x38')](function(_0x3e68dd){logger[_0x125e('0x1a')](JSON[_0x125e('0x42')](_0x3e68dd));return _0x3e68dd;});};exports['ispeechTTS']=function(_0xc5bd94,_0x2ec89c,_0x5d414a,_0x27ba50){var _0xcca123=util[_0x125e('0x7c')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0xc5bd94,encodeURIComponent(_0x2ec89c),_0x5d414a,_0x27ba50);var _0x332d7b=path[_0x125e('0x26')](__dirname,'tmp',rs[_0x125e('0x28')](0x4)+_0x125e('0x39'));var _0x304acb;return downloadFile(_0xcca123,_0x332d7b)[_0x125e('0x38')](function(){_0x304acb=path['resolve'](__dirname,'tmp',rs[_0x125e('0x28')](0x4)+'.wav');return convertFile(_0x332d7b,_0x304acb);})[_0x125e('0x38')](function(){try{fs['unlink'](_0x332d7b);fs['chmodSync'](_0x304acb,_0x125e('0x2b'));}catch(_0x3d737d){logger['error'](_0x3d737d);}return _0x304acb[_0x125e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0xe0e4e7,_0x17cda8,_0xa123e7,_0x2415b9){var _0x17b0ce=util[_0x125e('0x7c')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x17cda8,_0xa123e7,base64Encode(_0xe0e4e7),_0x2415b9?util[_0x125e('0x7c')](_0x125e('0x7d'),encodeURIComponent(_0x2415b9)):_0x125e('0x7e'));return uploadFile(_0x17b0ce)[_0x125e('0x38')](function(_0x39db9c){return querystring['parse'](_0x39db9c);});};exports[_0x125e('0x7f')]=function(_0x31663b,_0x29cbdb){return sestek[_0x125e('0x80')](_0x31663b,_0x29cbdb)[_0x125e('0x38')](function(_0x29815d){logger[_0x125e('0x1a')](JSON[_0x125e('0x42')](_0x29815d));var _0x3b1a7b={'speech':_0x29815d[_0x125e('0x81')],'action':_0x29815d[_0x125e('0x82')]?_0x29815d['channelData']['CustomAction']:undefined,'actiondata':_0x29815d[_0x125e('0x82')]?_0x29815d['channelData'][_0x125e('0x83')]:undefined};if(_0x29815d['channelData']&&_0x29815d[_0x125e('0x82')][_0x125e('0x84')]){return base64Decode(_0x29815d[_0x125e('0x82')][_0x125e('0x84')][_0x125e('0x85')],path[_0x125e('0x26')](__dirname,_0x125e('0x27'),rs[_0x125e('0x28')](0x4)+_0x125e('0x29')))[_0x125e('0x38')](function(_0x4f4820){_0x3b1a7b[_0x125e('0x86')]=_0x4f4820;return _0x3b1a7b;});}return _0x3b1a7b;});};exports[_0x125e('0x87')]=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 8f34e03..c0fee09 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 nda=require('./nda');module['exports']={'nda':nda}; \ No newline at end of file +var _0x0da5=['./nda','exports'];(function(_0x2ac0a6,_0x2150c3){var _0x19db5c=function(_0x579b5f){while(--_0x579b5f){_0x2ac0a6['push'](_0x2ac0a6['shift']());}};_0x19db5c(++_0x2150c3);}(_0x0da5,0x1d4));var _0x50da=function(_0x5539c2,_0x28511d){_0x5539c2=_0x5539c2-0x0;var _0x2e8ae8=_0x0da5[_0x5539c2];return _0x2e8ae8;};var nda=require(_0x50da('0x0'));module[_0x50da('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 5e197ab..d0c6804 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 _0xbfcc=['custom_action_data','request-promise','agi','exports','/token','password','POST','resolve','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','CustomActionData'];(function(_0x2a3b3a,_0x97a664){var _0xaab42b=function(_0x57ef61){while(--_0x57ef61){_0x2a3b3a['push'](_0x2a3b3a['shift']());}};_0xaab42b(++_0x97a664);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x485abd,_0x32c7c1){_0x485abd=_0x485abd-0x0;var _0x3379f1=_0xbfcc[_0x485abd];return _0x3379f1;};'use strict';var rp=require(_0xcbfc('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0xcbfc('0x1'));module[_0xcbfc('0x2')]=function(_0x72a76d,_0x1a82e5){var _0x57f2e3={'method':'POST','uri':url['resolve'](_0x1a82e5['ndauth_url'],_0xcbfc('0x3')),'form':{'grant_type':_0xcbfc('0x4'),'username':_0x1a82e5['username'],'password':_0x1a82e5[_0xcbfc('0x4')]},'json':!![]};return rp(_0x57f2e3)['then'](function(_0x2ea130){var _0x1f8b71={'method':_0xcbfc('0x5'),'uri':url[_0xcbfc('0x6')](_0x1a82e5['ndassistant_url'],_0xcbfc('0x7')),'body':{'type':_0x1a82e5[_0xcbfc('0x8')]||_0xcbfc('0x9'),'channelId':_0xcbfc('0xa'),'conversation':{'id':_0x72a76d[_0xcbfc('0xb')]},'from':{'id':_0x72a76d[_0xcbfc('0xc')],'name':_0x72a76d['calleridname']},'recipient':{'id':_0x72a76d[_0xcbfc('0xd')],'name':_0x72a76d[_0xcbfc('0xe')]},'text':_0x1a82e5[_0xcbfc('0xf')],'channelData':{}},'headers':{'Authorization':_0xcbfc('0x10')+_0x2ea130[_0xcbfc('0x11')]},'json':!![]};if(_0x1a82e5['project']){_0x1f8b71[_0xcbfc('0x12')][_0xcbfc('0x13')][_0xcbfc('0x14')]=_0x1a82e5['project'];}if(_0x1a82e5[_0xcbfc('0x15')]=='1'){_0x1f8b71[_0xcbfc('0x12')][_0xcbfc('0x13')][_0xcbfc('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xcbfc('0x17')};}if(_0x1a82e5['custom_action']){_0x1f8b71[_0xcbfc('0x12')][_0xcbfc('0x13')][_0xcbfc('0x18')]=_0x1a82e5[_0xcbfc('0x19')];if(_0x1a82e5['custom_action_data']){_0x1f8b71['body'][_0xcbfc('0x13')][_0xcbfc('0x1a')]=_0x1a82e5[_0xcbfc('0x1b')];}}logger['info'](JSON['stringify'](_0x1f8b71));return rp(_0x1f8b71);});}; \ No newline at end of file +var _0xaa1b=['access_token','project','body','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','exports','/token','password','POST','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var rp=require(_0xbaa1('0x0'));var url=require(_0xbaa1('0x1'));var logger=require(_0xbaa1('0x2'))('agi');module[_0xbaa1('0x3')]=function(_0x51926c,_0x2593cc){var _0x2b8de1={'method':'POST','uri':url['resolve'](_0x2593cc['ndauth_url'],_0xbaa1('0x4')),'form':{'grant_type':_0xbaa1('0x5'),'username':_0x2593cc['username'],'password':_0x2593cc[_0xbaa1('0x5')]},'json':!![]};return rp(_0x2b8de1)['then'](function(_0x364ce9){var _0x15b968={'method':_0xbaa1('0x6'),'uri':url[_0xbaa1('0x7')](_0x2593cc[_0xbaa1('0x8')],_0xbaa1('0x9')),'body':{'type':_0x2593cc['ndaactivity_type']||_0xbaa1('0xa'),'channelId':_0xbaa1('0xb'),'conversation':{'id':_0x51926c[_0xbaa1('0xc')]},'from':{'id':_0x51926c[_0xbaa1('0xd')],'name':_0x51926c[_0xbaa1('0xe')]},'recipient':{'id':_0x51926c[_0xbaa1('0xf')],'name':_0x51926c[_0xbaa1('0x10')]},'text':_0x2593cc[_0xbaa1('0x11')],'channelData':{}},'headers':{'Authorization':_0xbaa1('0x12')+_0x364ce9[_0xbaa1('0x13')]},'json':!![]};if(_0x2593cc[_0xbaa1('0x14')]){_0x15b968[_0xbaa1('0x15')]['channelData']['ProjectName']=_0x2593cc['project'];}if(_0x2593cc['ndagenerate_audio']=='1'){_0x15b968[_0xbaa1('0x15')][_0xbaa1('0x16')][_0xbaa1('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xbaa1('0x18')};}if(_0x2593cc[_0xbaa1('0x19')]){_0x15b968[_0xbaa1('0x15')][_0xbaa1('0x16')][_0xbaa1('0x1a')]=_0x2593cc[_0xbaa1('0x19')];if(_0x2593cc[_0xbaa1('0x1b')]){_0x15b968[_0xbaa1('0x15')][_0xbaa1('0x16')][_0xbaa1('0x1c')]=_0x2593cc[_0xbaa1('0x1b')];}}logger[_0xbaa1('0x1d')](JSON[_0xbaa1('0x1e')](_0x15b968));return rp(_0x15b968);});}; \ 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 4b71119..dafa5a7 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 _0xb093=['exports'];(function(_0x2428eb,_0x543a61){var _0x32dc5f=function(_0x48b9a3){while(--_0x48b9a3){_0x2428eb['push'](_0x2428eb['shift']());}};_0x32dc5f(++_0x543a61);}(_0xb093,0x109));var _0x3b09=function(_0x5d7ff8,_0x519e4d){_0x5d7ff8=_0x5d7ff8-0x0;var _0x483c85=_0xb093[_0x5d7ff8];return _0x483c85;};'use strict';var asr=require('./lib/api');module[_0x3b09('0x0')]=function(_0x610608,_0x247f05,_0x2f88cc,_0x5cb11e){return asr(_0x610608,_0x247f05,_0x2f88cc,_0x5cb11e);}; \ No newline at end of file +var _0xd24e=['./lib/api'];(function(_0x5958a6,_0x548997){var _0x2c94d9=function(_0x3cb876){while(--_0x3cb876){_0x5958a6['push'](_0x5958a6['shift']());}};_0x2c94d9(++_0x548997);}(_0xd24e,0x19b));var _0xed24=function(_0x2d286e,_0x11717f){_0x2d286e=_0x2d286e-0x0;var _0x2f2f58=_0xd24e[_0x2d286e];return _0x2f2f58;};'use strict';var asr=require(_0xed24('0x0'));module['exports']=function(_0x345bfb,_0x107016,_0x550ab2,_0x38688a){return asr(_0x345bfb,_0x107016,_0x550ab2,_0x38688a);}; \ 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 7a4dcc0..db170e5 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 _0xee4e=['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','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','data','send','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','result','final','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','info'];(function(_0x3f17be,_0x194451){var _0x500be6=function(_0x1b35d7){while(--_0x1b35d7){_0x3f17be['push'](_0x3f17be['shift']());}};_0x500be6(++_0x194451);}(_0xee4e,0x8d));var _0xeee4=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xee4e[_0x580576];return _0x3f55a0;};'use strict';var BPromise=require(_0xeee4('0x0'));var _=require(_0xeee4('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xeee4('0x2'));var logger=require(_0xeee4('0x3'))(_0xeee4('0x4'));module[_0xeee4('0x5')]=function(_0x51d34c,_0x2f1ff2,_0xaecb79,_0x2e70ba){return new BPromise(function(_0x385863,_0x3bac21){logger[_0xeee4('0x6')](_0xeee4('0x7'),_0x2e70ba||_0xeee4('0x8'));var _0x3cfc11=new WebSocket(_0x2e70ba||_0xeee4('0x8'),{'perMessageDeflate':![]});var _0x8036ff='';var _0x4e4697='0';var _0x32d785='1';var _0x1e3627=_0xeee4('0x9');function _0x5d2938(_0x3e7c34){var _0x52a519=crypto[_0xeee4('0xa')](_0xeee4('0xb'));_0x52a519[_0xeee4('0xc')](_0x3e7c34);return _0x52a519['digest'](_0xeee4('0xd'));}function _0x42f71e(){try{logger[_0xeee4('0x6')](_0xeee4('0xe'));var _0x25489a=moment()[_0xeee4('0xf')]();var _0x52ee1a=_0x5d2938(_0x25489a+_0x2f1ff2+_0xaecb79);_0x3cfc11['send'](JSON[_0xeee4('0x10')]({'appID':_0x2f1ff2,'timestamp':_0x25489a,'appKey':_0x52ee1a}));var _0x3fb2c8=fs['createReadStream'](_0x51d34c);_0x3fb2c8['on'](_0xeee4('0x11'),function(_0x2bfc1d){_0x3cfc11[_0xeee4('0x12')](_0x2bfc1d);});_0x3fb2c8['on'](_0xeee4('0x13'),function(){_0x3cfc11[_0xeee4('0x12')](_0xeee4('0x14'));});}catch(_0x629481){logger['error'](_0xeee4('0x15'),JSON[_0xeee4('0x10')](_0x629481));_0x3cfc11[_0xeee4('0x16')]();}}function _0x347c7e(_0x503583){try{if(_0x503583){var _0xe376ff=JSON['parse'](_0x503583);switch(_0xe376ff['status']){case 0x0:if(_0xe376ff['result']){if(_0xe376ff[_0xeee4('0x17')][_0xeee4('0x18')]){logger[_0xeee4('0x6')]('Tilde\x20ASR\x20hypoteses',JSON[_0xeee4('0x10')](_0xe376ff[_0xeee4('0x17')]['hypotheses']));_0x8036ff=_0xe376ff[_0xeee4('0x17')][_0xeee4('0x19')][0x0][_0xeee4('0x1a')];_0x4e4697=_0xe376ff['result']['hypotheses'][0x0][_0xeee4('0x1b')];_0x32d785='0';_0x1e3627=_0xeee4('0x1c');_0x3cfc11[_0xeee4('0x16')]();}}break;case 0x1:logger[_0xeee4('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x32d785='1';_0x1e3627=_0xeee4('0x9');break;case 0x2:logger[_0xeee4('0x6')](_0xeee4('0x1d'));_0x32d785='2';_0x1e3627='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xeee4('0x6')](_0xeee4('0x1e'));_0x32d785='9';_0x1e3627='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xeee4('0x6')](_0xeee4('0x1f'));_0x32d785='10';_0x1e3627=_0xeee4('0x1f');break;case 0xb:logger['info'](_0xeee4('0x20'));_0x32d785='11';_0x1e3627=_0xeee4('0x20');}}}catch(_0x5c7a7f){logger[_0xeee4('0x21')](_0xeee4('0x22'),JSON[_0xeee4('0x10')](_0x5c7a7f));_0x3cfc11[_0xeee4('0x16')]();}}function _0x1d8b39(){logger[_0xeee4('0x6')]('Close\x20Tilde\x20ASR\x20socket');_0x385863({'transcript':_0x8036ff,'confidence':_0x4e4697,'status':_0x32d785,'status_message':_0x1e3627});}function _0x476f59(_0x4dd040){logger[_0xeee4('0x21')](_0xeee4('0x23'));if(!_[_0xeee4('0x24')](_0x4dd040)){logger[_0xeee4('0x21')](_['isObject'](_0x4dd040)?JSON[_0xeee4('0x10')](_0x4dd040):_0x4dd040);}}_0x3cfc11['on']('open',_0x42f71e);_0x3cfc11['on']('message',_0x347c7e);_0x3cfc11['on'](_0xeee4('0x13'),_0x1d8b39);_0x3cfc11['on']('error',_0x476f59);});}; \ No newline at end of file +var _0x4ba9=['send','stringify','createReadStream','close','EOS','error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','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','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix'];(function(_0x16abbb,_0x5230da){var _0x19c145=function(_0x52e5c4){while(--_0x52e5c4){_0x16abbb['push'](_0x16abbb['shift']());}};_0x19c145(++_0x5230da);}(_0x4ba9,0x1d2));var _0x94ba=function(_0x1428d9,_0xded63c){_0x1428d9=_0x1428d9-0x0;var _0x438019=_0x4ba9[_0x1428d9];return _0x438019;};'use strict';var BPromise=require(_0x94ba('0x0'));var _=require(_0x94ba('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x94ba('0x2'));var crypto=require(_0x94ba('0x3'));var logger=require(_0x94ba('0x4'))(_0x94ba('0x5'));module[_0x94ba('0x6')]=function(_0x5a91e3,_0x23f4d9,_0x177ce2,_0x40dc7d){return new BPromise(function(_0x28ccdd,_0x6bcc85){logger['info']('Tilde\x20URI',_0x40dc7d||_0x94ba('0x7'));var _0x532472=new WebSocket(_0x40dc7d||_0x94ba('0x7'),{'perMessageDeflate':![]});var _0x2cd44e='';var _0x2bd5e1='0';var _0x386a2f='1';var _0x1a8e3e=_0x94ba('0x8');function _0x1e3e55(_0x5e9d0f){var _0x1eb124=crypto[_0x94ba('0x9')]('sha1');_0x1eb124['update'](_0x5e9d0f);return _0x1eb124[_0x94ba('0xa')](_0x94ba('0xb'));}function _0x20c9dc(){try{logger[_0x94ba('0xc')](_0x94ba('0xd'));var _0x20cabe=moment()[_0x94ba('0xe')]();var _0x7e97cd=_0x1e3e55(_0x20cabe+_0x23f4d9+_0x177ce2);_0x532472[_0x94ba('0xf')](JSON[_0x94ba('0x10')]({'appID':_0x23f4d9,'timestamp':_0x20cabe,'appKey':_0x7e97cd}));var _0x1790ff=fs[_0x94ba('0x11')](_0x5a91e3);_0x1790ff['on']('data',function(_0x18b599){_0x532472[_0x94ba('0xf')](_0x18b599);});_0x1790ff['on'](_0x94ba('0x12'),function(){_0x532472['send'](_0x94ba('0x13'));});}catch(_0x1a5054){logger[_0x94ba('0x14')]('Tilde\x20ASR\x20send\x20error',JSON[_0x94ba('0x10')](_0x1a5054));_0x532472[_0x94ba('0x15')]();}}function _0x38e461(_0x22084b){try{if(_0x22084b){var _0x4fc72b=JSON[_0x94ba('0x16')](_0x22084b);switch(_0x4fc72b['status']){case 0x0:if(_0x4fc72b[_0x94ba('0x17')]){if(_0x4fc72b[_0x94ba('0x17')][_0x94ba('0x18')]){logger[_0x94ba('0xc')](_0x94ba('0x19'),JSON[_0x94ba('0x10')](_0x4fc72b[_0x94ba('0x17')][_0x94ba('0x1a')]));_0x2cd44e=_0x4fc72b[_0x94ba('0x17')][_0x94ba('0x1a')][0x0][_0x94ba('0x1b')];_0x2bd5e1=_0x4fc72b['result'][_0x94ba('0x1a')][0x0]['likelihood'];_0x386a2f='0';_0x1a8e3e=_0x94ba('0x1c');_0x532472['terminate']();}}break;case 0x1:logger[_0x94ba('0xc')](_0x94ba('0x8'));_0x386a2f='1';_0x1a8e3e=_0x94ba('0x8');break;case 0x2:logger[_0x94ba('0xc')](_0x94ba('0x1d'));_0x386a2f='2';_0x1a8e3e='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x94ba('0xc')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x386a2f='9';_0x1a8e3e='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info']('Authentication\x20failed.');_0x386a2f='10';_0x1a8e3e='Authentication\x20failed.';break;case 0xb:logger['info'](_0x94ba('0x1e'));_0x386a2f='11';_0x1a8e3e=_0x94ba('0x1e');}}}catch(_0x6cf990){logger[_0x94ba('0x14')](_0x94ba('0x1f'),JSON[_0x94ba('0x10')](_0x6cf990));_0x532472[_0x94ba('0x15')]();}}function _0x4109f5(){logger[_0x94ba('0xc')](_0x94ba('0x20'));_0x28ccdd({'transcript':_0x2cd44e,'confidence':_0x2bd5e1,'status':_0x386a2f,'status_message':_0x1a8e3e});}function _0x405268(_0x59641c){logger[_0x94ba('0x14')](_0x94ba('0x21'));if(!_[_0x94ba('0x22')](_0x59641c)){logger[_0x94ba('0x14')](_[_0x94ba('0x23')](_0x59641c)?JSON['stringify'](_0x59641c):_0x59641c);}}_0x532472['on'](_0x94ba('0x24'),_0x20c9dc);_0x532472['on']('message',_0x38e461);_0x532472['on'](_0x94ba('0x12'),_0x4109f5);_0x532472['on']('error',_0x405268);});}; \ 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 0dbb398..10cb4be 100644 --- a/server/services/agi/scripts/tilde/index.js +++ b/server/services/agi/scripts/tilde/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f5e=['exports','./asr'];(function(_0x4c67b8,_0x571e13){var _0xbc26e=function(_0x16e9ac){while(--_0x16e9ac){_0x4c67b8['push'](_0x4c67b8['shift']());}};_0xbc26e(++_0x571e13);}(_0x4f5e,0xad));var _0xe4f5=function(_0x517482,_0x44340c){_0x517482=_0x517482-0x0;var _0x48338c=_0x4f5e[_0x517482];return _0x48338c;};var asr=require(_0xe4f5('0x0'));module[_0xe4f5('0x1')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 3ab105d..087f68f 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x5e465a,_0x3e0f32){var _0x52c7db=function(_0x2c9dea){while(--_0x2c9dea){_0x5e465a['push'](_0x5e465a['shift']());}};_0x52c7db(++_0x3e0f32);}(_0x34e8,0x12c));var _0x834e=function(_0x3506f4,_0x30fb68){_0x3506f4=_0x3506f4-0x0;var _0x9218ab=_0x34e8[_0x3506f4];return _0x9218ab;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index e11633e..c829b53 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 _0xa866=['no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','opts','Executed\x20command\x20%s\x20%s','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','escape_digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20found','debug','sendSMS\x20message','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','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','system','sh\x20command:\x20%s\x20result\x20no\x20stored','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\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','../../config/environment','../../config/environment/shared','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','interval','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','label','callerid','createSquareRecording','uniqueid','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','appid','appsecret','clear','agicommand','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','length','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','info','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','list_id','delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','no\x20text\x20configured','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','sip_id','no\x20user\x20selected','getUser','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2_project_id','private_key','no\x20anguage\x20configured','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','variable_id','getData','response','mindigit','maxdigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','goal','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','condition','no\x20interval\x20configured','getIntervals','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','false','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechASR','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','.wav','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','failure','math','operation'];(function(_0x149dfc,_0x3c53df){var _0x4246ce=function(_0x159e35){while(--_0x159e35){_0x149dfc['push'](_0x149dfc['shift']());}};_0x4246ce(++_0x3c53df);}(_0xa866,0x6a));var _0x6a86=function(_0x2918ae,_0x1ef2e4){_0x2918ae=_0x2918ae-0x0;var _0x19f09d=_0xa866[_0x2918ae];return _0x19f09d;};'use strict';var fs=require('fs');var util=require(_0x6a86('0x0'));var _=require(_0x6a86('0x1'));var sh=require(_0x6a86('0x2'));var odbc=require(_0x6a86('0x3'))();var rs=require(_0x6a86('0x4'));var moment=require('moment');var Mustache=require(_0x6a86('0x5'));var rp=require(_0x6a86('0x6'));var logger=require(_0x6a86('0x7'))('agi');var config=require(_0x6a86('0x8'));var shared=require(_0x6a86('0x9'));var scripts=require(_0x6a86('0xa'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x6a86('0xb'),_0x6a86('0xc')];var verticesWithRetry=[_0x6a86('0xd'),_0x6a86('0xe'),_0x6a86('0xf')];var AGIVertices=function(_0x146a11,_0xdc33fa,_0x4a83c9){this[_0x6a86('0x10')]=_0x146a11;this['rpc']=_0xdc33fa;this[_0x6a86('0x11')]=_0x4a83c9;};AGIVertices[_0x6a86('0x12')][_0x6a86('0x13')]=function(_0x5d6e7c,_0x238c92){this[_0x6a86('0x14')]['getVariableById'](_0x5d6e7c)['then'](function(_0x39e195){_0x238c92(null,_0x39e195?_0x39e195[_0x6a86('0x15')]:![]);})[_0x6a86('0x16')](function(_0x3961f6){_0x238c92(_0x3961f6);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x17')]=function(_0x2e1dce,_0xa6b07a){this['rpc'][_0x6a86('0x18')](_0x2e1dce)[_0x6a86('0x19')](function(_0x47afa6){_0xa6b07a(null,_0x47afa6?_0x47afa6[_0x6a86('0x15')]:![]);})[_0x6a86('0x16')](function(_0x3fe00a){_0xa6b07a(_0x3fe00a);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x1a')]=function(_0x20bf4b,_0x500b59){this[_0x6a86('0x14')][_0x6a86('0x1b')](_0x20bf4b)['then'](function(_0x50024d){_0x500b59(null,_0x50024d?_0x50024d[_0x6a86('0x15')]:![]);})['catch'](function(_0x588a2f){_0x500b59(_0x588a2f);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x1c')]=function(_0x3cbb30,_0x4cd3ae){this[_0x6a86('0x14')][_0x6a86('0x1d')](_0x3cbb30)[_0x6a86('0x19')](function(_0x262bf5){_0x4cd3ae(null,_0x262bf5?_0x262bf5[_0x6a86('0x1e')]:![]);})[_0x6a86('0x16')](function(_0x53e2b6){_0x4cd3ae(_0x53e2b6);});};AGIVertices['prototype']['getUser']=function(_0x1ae50f,_0x2007c7){this[_0x6a86('0x14')][_0x6a86('0x1f')](_0x1ae50f)['then'](function(_0x27a003){_0x2007c7(null,_0x27a003?_0x27a003[_0x6a86('0x15')]:![]);})[_0x6a86('0x16')](function(_0x3f2b70){_0x2007c7(_0x3f2b70);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x20')]=function(_0x46f6c7,_0xe50635){this[_0x6a86('0x14')]['getTrunkById'](_0x46f6c7)['then'](function(_0x42dd0a){_0xe50635(null,_0x42dd0a?_0x42dd0a['name']:![]);})[_0x6a86('0x16')](function(_0x1ff9c8){_0xe50635(_0x1ff9c8);});};AGIVertices['prototype'][_0x6a86('0x21')]=function(_0x1e9e14,_0x2da9f8){var _0x47e8b7=this;this[_0x6a86('0x14')]['getSoundById'](_0x1e9e14)['then'](function(_0x4d8bf0){_0x2da9f8(null,_0x4d8bf0?_0x47e8b7[_0x6a86('0x22')](_0x4d8bf0[_0x6a86('0x23')]):![]);})[_0x6a86('0x16')](function(_0x50c746){_0x2da9f8(_0x50c746);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x24')]=function(_0x1bb745,_0x372512){this['rpc'][_0x6a86('0x25')](_0x1bb745)['then'](function(_0x276300){_0x372512(null,_0x276300?_0x276300:![]);})[_0x6a86('0x16')](function(_0x184087){_0x372512(_0x184087);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x26')]=function(_0x5a2925,_0x155054,_0x350524){this['mailRpc'][_0x6a86('0x26')](_0x5a2925,_0x155054)[_0x6a86('0x19')](function(){_0x350524(null);})['catch'](function(_0x45e8fc){_0x350524(_0x45e8fc);});};AGIVertices[_0x6a86('0x12')]['getIntervals']=function(_0x4db3e2,_0x26d559){this[_0x6a86('0x14')]['getIntervalById'](_0x4db3e2)['then'](function(_0x384816){if(_0x384816){if(_0x384816['IntervalId']){_0x26d559(null,[_0x384816[_0x6a86('0x27')]]);}else{_0x26d559(null,_['map'](_0x384816[_0x6a86('0x28')],'interval'));}}else{_0x26d559(null,![]);}})[_0x6a86('0x16')](function(_0x5e6a0d){_0x26d559(_0x5e6a0d);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x22')]=function(_0x347a91){return util[_0x6a86('0x29')]('%s/sounds/converted/%s',FILES_PATH,_0x347a91);};AGIVertices[_0x6a86('0x12')][_0x6a86('0x2a')]=function(_0x1e1a7c,_0x4fb4cc,_0x40a0cf){odbc[_0x6a86('0x2b')](_0x1e1a7c,function(_0x591fdf){if(_0x591fdf){logger[_0x6a86('0x2c')](_0x6a86('0x2d'),_0x591fdf);_0x40a0cf(_0x591fdf);}else{logger['info'](_0x6a86('0x2e'));odbc['query'](_0x4fb4cc,function(_0x5806de,_0x21939c){if(_0x5806de){logger['info']('Error\x20executing\x20query\x20%s',_0x4fb4cc);_0x40a0cf(_0x5806de);}else{logger['info'](_0x6a86('0x2f'),_0x4fb4cc);odbc[_0x6a86('0x30')](function(_0x5ee7bd){if(_0x5ee7bd){logger['error'](_0x6a86('0x31'),_0x5ee7bd);}_0x40a0cf(null,_0x21939c);});}});}});};AGIVertices['prototype'][_0x6a86('0x32')]=function(_0x568504,_0x311f61){this[_0x6a86('0x14')]['getSmsAccountById'](_0x568504)['then'](function(_0x5aadb7){_0x311f61(null,_0x5aadb7?_0x5aadb7:![]);})[_0x6a86('0x16')](function(_0x4b9e98){_0x311f61(_0x4b9e98);});};AGIVertices[_0x6a86('0x12')]['createSmsMessage']=function(_0x600781,_0x60da57){this[_0x6a86('0x14')][_0x6a86('0x33')](_0x600781)['then'](function(_0x485832){_0x60da57(null,_0x485832);})[_0x6a86('0x16')](function(_0x4bc4f5){_0x60da57(_0x4bc4f5);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x34')]=function(_0x219b10,_0x1778f6,_0x261e49){this['rpc']['createSquareDetailsReport']({'uniqueid':this['channel']['uniqueid'],'node':_0x219b10[_0x6a86('0x35')],'application':_0x219b10['agicommand'],'data':_0x1778f6||null,'project_name':this[_0x6a86('0x10')]['arg_1'],'callerid':this[_0x6a86('0x10')][_0x6a86('0x36')]})[_0x6a86('0x19')](function(_0x37a83d){if(_0x261e49){_0x261e49(null,_0x37a83d);}})[_0x6a86('0x16')](function(_0x55f5be){if(_0x261e49){_0x261e49(_0x55f5be);}});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x37')]=function(_0x53bf2d,_0x5f10fb,_0x25d4f4,_0x18a531){this[_0x6a86('0x14')][_0x6a86('0x37')]({'uniqueid':this[_0x6a86('0x10')][_0x6a86('0x38')],'callerid':this[_0x6a86('0x10')][_0x6a86('0x36')],'calleridname':this['channel']['calleridname'],'context':this['channel'][_0x6a86('0x39')],'extension':this[_0x6a86('0x10')][_0x6a86('0x3a')],'priority':this[_0x6a86('0x10')][_0x6a86('0x3b')],'accountcode':this[_0x6a86('0x10')][_0x6a86('0x3c')],'dnid':this[_0x6a86('0x10')][_0x6a86('0x3d')],'projectName':this[_0x6a86('0x10')][_0x6a86('0x3e')],'saveName':_0x5f10fb,'filename':_0x53bf2d[_0x6a86('0x3f')]||_0x5f10fb,'savePath':_0x25d4f4})['then'](function(_0x28ff1e){_0x18a531(null,_0x28ff1e);})[_0x6a86('0x16')](function(_0x2e53b9){_0x18a531(_0x2e53b9);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x40')]=function(_0x25b13b,_0x78130d,_0x37182a,_0x44ada8,_0x447fa9){this['rpc'][_0x6a86('0x40')]({'uniqueid':this['channel'][_0x6a86('0x38')],'body':_0x25b13b,'direction':_0x78130d,'providerName':_0x37182a,'providerResponse':_0x44ada8})[_0x6a86('0x19')](function(_0x22d22a){if(_0x447fa9){_0x447fa9(null,_0x22d22a);}})[_0x6a86('0x16')](function(_0x91eb0c){if(_0x447fa9){_0x447fa9(_0x91eb0c);}});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x41')]=function(_0x435322,_0x154420){this[_0x6a86('0x14')][_0x6a86('0x41')]({'firstName':_[_0x6a86('0x42')](_0x435322['name'])||_[_0x6a86('0x43')](_0x435322['name'])?'callback_'+Math[_0x6a86('0x44')]():_0x435322[_0x6a86('0x15')],'lastName':_[_0x6a86('0x42')](_0x435322['lastName'])||_[_0x6a86('0x43')](_0x435322[_0x6a86('0x45')])?null:_0x435322[_0x6a86('0x45')],'phone':_0x435322[_0x6a86('0x46')],'ListId':_0x435322['list_id'],'scheduledat':_0x435322[_0x6a86('0x47')],'callbackUniqueid':this[_0x6a86('0x10')][_0x6a86('0x38')],'tags':'callback','description':_0x6a86('0x48')+_0x435322['scheduledAt'][_0x6a86('0x49')](),'priority':_0x435322[_0x6a86('0x4a')]})['then'](function(_0x26bac2){_0x154420(null,_0x26bac2);})[_0x6a86('0x16')](function(_0x5d4198){_0x154420(_0x5d4198);});};AGIVertices['prototype'][_0x6a86('0x4b')]=function(_0x131ba7,_0x11b163){this[_0x6a86('0x14')][_0x6a86('0x4c')](_0x131ba7)[_0x6a86('0x19')](function(_0x2a1718){_0x11b163(null,_0x2a1718?_0x2a1718[_0x6a86('0x15')]:![]);})[_0x6a86('0x16')](function(_0x984cfb){_0x11b163(_0x984cfb);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x4d')]=function(_0xb26165,_0x59faa1,_0xadb993){var _0x32a730={'role':'agent'};_0x32a730[_0xb26165]=this[_0x6a86('0x10')][_0x6a86('0x36')];this[_0x6a86('0x14')][_0x6a86('0x4d')](_0x32a730,_0x59faa1,this[_0x6a86('0x10')][_0x6a86('0x38')])[_0x6a86('0x19')](function(_0x2d0d6e){_0xadb993(null,_['isNil'](_0x2d0d6e)?![]:!![]);})[_0x6a86('0x16')](function(_0x467246){logger[_0x6a86('0x2c')](_0x467246);_0xadb993(null,![]);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x4e')]=function(_0x54a397,_0x11bebd){var _0x15ee19={'role':_0x6a86('0x4f')};_0x15ee19[_0x54a397]=this[_0x6a86('0x10')][_0x6a86('0x36')];this[_0x6a86('0x14')][_0x6a86('0x4e')](_0x15ee19)[_0x6a86('0x19')](function(_0x29bb72){_0x11bebd(null,_[_0x6a86('0x43')](_0x29bb72)?![]:!![]);})['catch'](function(_0x45a0d6){logger[_0x6a86('0x2c')](_0x45a0d6);_0x11bebd(null,![]);});};AGIVertices['prototype'][_0x6a86('0x50')]=function(_0x232356,_0x5bb82c){var _0x88dedc={'role':_0x6a86('0x4f')};_0x88dedc[_0x232356]=this[_0x6a86('0x10')][_0x6a86('0x36')];this['rpc'][_0x6a86('0x50')](_0x88dedc)['then'](function(_0x5204b1){_0x5bb82c(null,_[_0x6a86('0x43')](_0x5204b1)?![]:!![]);})[_0x6a86('0x16')](function(_0x3729ae){logger[_0x6a86('0x2c')](_0x3729ae);_0x5bb82c(null,![]);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x51')]=function(_0xb07a5c,_0x12af51){var _0x5688c7={'role':_0x6a86('0x4f')};_0x5688c7[_0xb07a5c]=this[_0x6a86('0x10')][_0x6a86('0x36')];var _0x3d137b=_0xb07a5c!=_0x6a86('0x52')?util[_0x6a86('0x29')](_0x6a86('0x53'),_0x6a86('0x54'),this[_0x6a86('0x10')][_0x6a86('0x36')]):undefined;this[_0x6a86('0x14')]['agentLogin'](_0x5688c7,_0x3d137b)[_0x6a86('0x19')](function(_0x147de9){_0x12af51(null,_[_0x6a86('0x43')](_0x147de9)?![]:!![]);})[_0x6a86('0x16')](function(_0x441fe9){logger[_0x6a86('0x2c')](_0x441fe9);_0x12af51(null,![]);});};AGIVertices['prototype'][_0x6a86('0x55')]=function(_0xc50bf2,_0x18b267){sh[_0x6a86('0x56')](_[_0x6a86('0x57')](_0xc50bf2),function(_0x13273c,_0x2102ed){var _0x308960=_0x2102ed[_0x6a86('0x58')](/(\r\n|\n|\r)/gm,'');_0x18b267(null,_0x308960);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x59')]=function(_0x1ce361,_0x5ad013){scripts['googleCloudTTS'](_0x1ce361['apiKey'],_0x1ce361['google_cloud_tts_text_type']||_0x6a86('0x5a'),_0x1ce361[_0x6a86('0x5a')],_0x1ce361[_0x6a86('0x5b')]||'en-US',_0x1ce361[_0x6a86('0x5c')]||_0x6a86('0x5d'),_0x1ce361[_0x6a86('0x5e')]||_0x6a86('0x5f'))[_0x6a86('0x19')](function(_0x3326b){_0x5ad013(null,_0x3326b);})[_0x6a86('0x16')](function(_0x447cdc){_0x5ad013(_0x447cdc);});};AGIVertices['prototype'][_0x6a86('0x60')]=function(_0x4ea003,_0x5c54f6){scripts[_0x6a86('0x60')](_0x4ea003[_0x6a86('0x5a')],_0x4ea003['google_tts_language']||'en',0x1)[_0x6a86('0x19')](function(_0x56eb27){_0x5c54f6(null,_0x56eb27);})[_0x6a86('0x16')](function(_0x139856){_0x5c54f6(_0x139856);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x61')]=function(_0x2b8fbe,_0x26943e){var _0x2ce04f={'uri':_0x2b8fbe[_0x6a86('0x62')],'method':_0x2b8fbe[_0x6a86('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2b8fbe[_0x6a86('0x64')])===_0x6a86('0x65')&&parseInt(_0x2b8fbe['timeout'])>=0x1?parseInt(_0x2b8fbe['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x6a86('0x66')]([_0x6a86('0x67'),_0x6a86('0x68')],_0x2ce04f['method'][_0x6a86('0x69')]())){try{_0x2ce04f[_0x6a86('0x6a')]=_0x2b8fbe[_0x6a86('0xc')]?JSON[_0x6a86('0x6b')](_0x2b8fbe[_0x6a86('0xc')]):{};}catch(_0x271d00){logger[_0x6a86('0x2c')](_0x6a86('0x6c'),_0x271d00);}}try{_0x2ce04f[_0x6a86('0x6d')]=_0x2b8fbe[_0x6a86('0xb')]?JSON[_0x6a86('0x6b')](_0x2b8fbe[_0x6a86('0xb')]):{};}catch(_0x3bd5cc){logger['error'](_0x6a86('0x6e'),_0x3bd5cc);}if(_0x2b8fbe[_0x6a86('0x6f')]){try{var _0x460452=require(_0x2b8fbe[_0x6a86('0x6f')])[_0x6a86('0x70')](this,_0x2ce04f);_0x2ce04f[_0x6a86('0x71')]=Mustache[_0x6a86('0x72')](_0x2b8fbe[_0x6a86('0x62')],_0x460452,{},['$$','$$']);if(_0x2ce04f[_0x6a86('0x6d')]){_0x2ce04f[_0x6a86('0x6d')]=JSON['parse'](Mustache[_0x6a86('0x72')](JSON['stringify'](_0x2ce04f[_0x6a86('0x6d')]),_0x460452,{},['$$','$$']));}if(_0x2ce04f['body']){_0x2ce04f[_0x6a86('0x6a')]=JSON[_0x6a86('0x6b')](Mustache['render'](JSON[_0x6a86('0x73')](_0x2ce04f[_0x6a86('0x6a')]),_0x460452,{},['$$','$$']));}}catch(_0x5b54a6){logger[_0x6a86('0x2c')](_0x6a86('0x74'),_0x5b54a6);}}rp(_0x2ce04f)['then'](function(_0x4e9861){var _0x515f5c={'statusCode':_0x4e9861[_0x6a86('0x75')]||0xc8,'statusMessage':_0x4e9861[_0x6a86('0x76')]||'OK','headers':_0x4e9861[_0x6a86('0x6d')]||{},'body':_0x4e9861[_0x6a86('0x6a')]||{}};_0x26943e(null,_0x515f5c);})[_0x6a86('0x16')](function(_0x168f0c){var _0x4e640c={'statusCode':_0x168f0c[_0x6a86('0x75')]||0x1f4,'statusMessage':_0x168f0c[_0x6a86('0x77')]||_0x6a86('0x78'),'headers':_0x168f0c[_0x6a86('0x79')][_0x6a86('0x6d')]||{},'body':_0x168f0c[_0x6a86('0x79')][_0x6a86('0x6a')]||{}};_0x26943e(null,_0x4e640c);});};AGIVertices[_0x6a86('0x12')]['googleDialogflow']=function(_0xfe273b,_0x305959){scripts[_0x6a86('0x7a')](this['channel'][_0x6a86('0x38')],_0xfe273b[_0x6a86('0x7b')],_0xfe273b[_0x6a86('0x5a')],_0xfe273b[_0x6a86('0x7c')]||'en')[_0x6a86('0x19')](function(_0x255780){_0x305959(null,_0x255780);})[_0x6a86('0x16')](function(_0xb047ca){_0x305959(_0xb047ca);});};AGIVertices[_0x6a86('0x12')]['googleDialogflowV2']=function(_0x444f4a,_0x56fb18){scripts[_0x6a86('0x7d')](this['channel'][_0x6a86('0x38')],_0x444f4a['dialogflowV2_project_id'],_0x444f4a[_0x6a86('0x7e')],_0x444f4a['private_key'],_0x444f4a[_0x6a86('0x5a')],_0x444f4a[_0x6a86('0x7f')]||'en')[_0x6a86('0x19')](function(_0x43551c){_0x56fb18(null,_0x43551c);})['catch'](function(_0x3192f0){_0x56fb18(_0x3192f0);});};AGIVertices[_0x6a86('0x12')]['sestekNDA']=function(_0x4b647c,_0x500d17){scripts[_0x6a86('0x80')](this['channel'],_0x4b647c)[_0x6a86('0x19')](function(_0x59c1fb){_0x500d17(null,_0x59c1fb);})['catch'](function(_0x502b4d){_0x500d17(_0x502b4d);});};AGIVertices[_0x6a86('0x12')]['ispeechTTS']=function(_0x24c1aa,_0x3bff9c){scripts[_0x6a86('0x81')](_0x24c1aa[_0x6a86('0x7b')],_0x24c1aa['text'],_0x24c1aa[_0x6a86('0x82')]||_0x6a86('0x83'),_0x24c1aa[_0x6a86('0x84')])[_0x6a86('0x19')](function(_0x484a80){_0x3bff9c(null,_0x484a80);})[_0x6a86('0x16')](function(_0x1f328d){_0x3bff9c(_0x1f328d);});};AGIVertices[_0x6a86('0x12')]['ispeechASR']=function(_0x4bf60b,_0x388be9,_0x16d9c1){scripts['ispeechASR'](_0x388be9,_0x4bf60b[_0x6a86('0x7b')],_0x4bf60b[_0x6a86('0x85')]||_0x6a86('0x83'),this[_0x6a86('0x86')](_0x4bf60b['model'])?_0x4bf60b[_0x6a86('0x87')]:undefined)['then'](function(_0x46f1a9){_0x16d9c1(null,_0x46f1a9);})[_0x6a86('0x16')](function(_0x382cf0){_0x16d9c1(_0x382cf0);});};AGIVertices['prototype'][_0x6a86('0x88')]=function(_0x5cf2c3,_0x10ca8a){scripts[_0x6a86('0x88')](_0x5cf2c3[_0x6a86('0x89')],_0x5cf2c3[_0x6a86('0x8a')],_0x5cf2c3[_0x6a86('0x8b')],_0x5cf2c3[_0x6a86('0x8c')]||_0x6a86('0x8d'),_0x5cf2c3[_0x6a86('0x5a')],_0x5cf2c3[_0x6a86('0x8e')]||'text')[_0x6a86('0x19')](function(_0x214d68){_0x10ca8a(null,_0x214d68);})[_0x6a86('0x16')](function(_0x2140b0){_0x10ca8a(_0x2140b0);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x8f')]=function(_0x1871b6,_0x486a2d){scripts['awsLex'](this[_0x6a86('0x10')]['uniqueid'],_0x1871b6[_0x6a86('0x89')],_0x1871b6[_0x6a86('0x8a')],_0x1871b6[_0x6a86('0x90')],_0x1871b6['text'],_0x1871b6[_0x6a86('0x91')])[_0x6a86('0x19')](function(_0x47827d){_0x486a2d(null,_0x47827d);})[_0x6a86('0x16')](function(_0x44afcc){_0x486a2d(_0x44afcc);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x92')]=function(_0x50a134,_0x2ea387,_0x1acb20){scripts[_0x6a86('0x92')](_0x2ea387,_0x50a134[_0x6a86('0x7b')],_0x50a134[_0x6a86('0x93')]||_0x6a86('0x83'))[_0x6a86('0x19')](function(_0x11244c){_0x1acb20(null,_0x11244c);})['catch'](function(_0x215f44){_0x1acb20(_0x215f44);});};AGIVertices['prototype']['tildeASR']=function(_0x4d9997,_0x8fceaa,_0xa9c461){scripts['tildeASR'](_0x8fceaa,_0x4d9997[_0x6a86('0x94')],_0x4d9997[_0x6a86('0x95')],_0x4d9997[_0x6a86('0x71')])[_0x6a86('0x19')](function(_0xaad014){_0xa9c461(null,_0xaad014);})['catch'](function(_0x22f963){_0xa9c461(_0x22f963);});};AGIVertices[_0x6a86('0x12')][_0x6a86('0x96')]=function(_0x558c62){var _0x4416ac=_[_0x6a86('0x66')](verticesWithRetry,_0x558c62[_0x6a86('0x97')])?_0x558c62:_[_0x6a86('0x98')](_0x558c62);for(var _0x5c8f34 in _0x4416ac){if(_0x4416ac[_0x6a86('0x99')](_0x5c8f34)){if(_0x4416ac[_0x5c8f34]&&_[_0x6a86('0x9a')](_0x4416ac[_0x5c8f34])){if(_[_0x6a86('0x66')](recursiveMapAttributes,_0x5c8f34)){_0x4416ac[_0x5c8f34]=this['replaceObjectAllVariables'](_0x4416ac[_0x5c8f34]);}else{_0x4416ac[_0x5c8f34]=this[_0x6a86('0x9b')](_0x4416ac[_0x5c8f34]);}}}}return _0x4416ac;};AGIVertices[_0x6a86('0x12')][_0x6a86('0x9c')]=function(_0x3f6c66){for(var _0xddcdec in _0x3f6c66){if(_0x3f6c66[_0x6a86('0x99')](_0xddcdec)){if(_[_0x6a86('0x9d')](_0x3f6c66[_0xddcdec])){this[_0x6a86('0x9c')](_0x3f6c66[_0xddcdec]);}else if(_[_0x6a86('0x9e')](_0x3f6c66[_0xddcdec])){for(var _0x22bab5=0x0;_0x22bab5<_0x3f6c66[_0xddcdec]['length'];_0x22bab5++){this[_0x6a86('0x9c')](_0x3f6c66[_0xddcdec][_0x22bab5]);}}else if(_[_0x6a86('0x9a')](_0x3f6c66[_0xddcdec])){_0x3f6c66[_0xddcdec]=this[_0x6a86('0x9b')](_0x3f6c66[_0xddcdec]);}}}};AGIVertices[_0x6a86('0x12')][_0x6a86('0x9f')]=function(_0x17764b,_0x212163){for(var _0x2e5b37 in _0x17764b){if(_0x17764b['hasOwnProperty'](_0x2e5b37)){if(_[_0x6a86('0x9d')](_0x17764b[_0x2e5b37])){if(!_[_0x6a86('0x42')](_0x17764b[_0x2e5b37])){this[_0x6a86('0x9f')](_0x17764b[_0x2e5b37],util[_0x6a86('0x29')](_0x6a86('0xa0'),_0x212163,_0x2e5b37));}}else if(_[_0x6a86('0x9e')](_0x17764b[_0x2e5b37])){for(var _0x360403=0x0;_0x360403<_0x17764b[_0x2e5b37]['length'];_0x360403++){this[_0x6a86('0x9f')](_0x17764b[_0x2e5b37][_0x360403],util[_0x6a86('0x29')](_0x6a86('0xa0'),_0x212163,_0x2e5b37+'['+_0x360403+']'));}}else{if(!_[_0x6a86('0x43')](_0x17764b[_0x2e5b37])){this[_0x6a86('0x10')][_0x6a86('0xa1')](util[_0x6a86('0x29')](_0x6a86('0xa0'),_0x212163,_0x2e5b37),_0x17764b[_0x2e5b37]);}}}}};AGIVertices[_0x6a86('0x12')][_0x6a86('0xa2')]=function(_0x469a1b){try{var _0x10710f=JSON[_0x6a86('0x6b')](_0x469a1b);this[_0x6a86('0x9c')](_0x10710f);return JSON['stringify'](_0x10710f);}catch(_0x15e969){return this[_0x6a86('0x9b')](_0x469a1b);}};AGIVertices['prototype'][_0x6a86('0x9b')]=function(_0x12125f){var _0x397333=_0x12125f[_0x6a86('0xa3')]('{');for(var _0x346592=0x1;_0x346592<_0x397333[_0x6a86('0xa4')];_0x346592+=0x1){var _0x3c64e7=_0x397333[_0x346592][_0x6a86('0xa3')]('}');if(_0x3c64e7[_0x6a86('0xa4')]>0x1){_0x12125f=_0x12125f[_0x6a86('0xa5')]('{'+_0x3c64e7[0x0]+'}',this['channel'][_0x6a86('0x13')](_0x3c64e7[0x0])[_0x6a86('0xa6')]||_0x3c64e7[0x0]);}}if(_0x397333[_0x6a86('0xa4')]===0x1){return _0x12125f[_0x6a86('0x49')]();}return this[_0x6a86('0x9b')](_0x12125f);};AGIVertices[_0x6a86('0x12')][_0x6a86('0xa7')]=function(_0x284862,_0x59e105){var _0x316bdf=this[_0x6a86('0x10')][_0x6a86('0x13')](_0x284862);if(_0x316bdf[_0x6a86('0xa8')]===-0x1){return _0x316bdf;}logger['info'](util[_0x6a86('0x29')](_0x6a86('0xa9'),_0x59e105,_0x316bdf[_0x6a86('0xa6')]));return this[_0x6a86('0x10')][_0x6a86('0xa1')](_0x59e105,_0x316bdf[_0x6a86('0xa6')]);};AGIVertices[_0x6a86('0x12')]['isConfigured']=function(_0x240494){return _0x240494&&_0x240494!=='0'&&_0x240494!=='-1'&&_0x240494!=='';};AGIVertices[_0x6a86('0x12')][_0x6a86('0xaa')]=function(_0x1c613d){this[_0x6a86('0x34')][_0x6a86('0x70')](this,_0x1c613d,'-');_0x1c613d[_0x6a86('0xab')]=_0x1c613d[_0x6a86('0xaa')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x6a86('0xac')]=function(_0x1877fd){logger['info'](util['format'](_0x6a86('0xad'),_0x1877fd[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x1877fd[_0x6a86('0x5a')])){return this[_0x6a86('0x10')]['noop']('no\x20text\x20configured');}var _0x544baa='\x22'+_0x1877fd['text']+'\x22';if(this[_0x6a86('0x86')](_0x1877fd[_0x6a86('0x79')])){_0x544baa+=','+_0x1877fd[_0x6a86('0x79')];}var _0x14f1b1=this['channel']['exec']('MRCPSynth',_0x544baa);if(_0x14f1b1['result']===-0x1){return _0x14f1b1;}return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0xaf'),_0x544baa));};AGIVertices['prototype'][_0x6a86('0xb0')]=function(_0x49d3e2){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x49d3e2[_0x6a86('0x35')]));if(!this['isConfigured'](_0x49d3e2[_0x6a86('0xb2')])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0xb3'));}var _0xcca499=_0x49d3e2['grammar'];if(this[_0x6a86('0x86')](_0x49d3e2[_0x6a86('0x79')])){_0xcca499+=','+_0x49d3e2[_0x6a86('0x79')];}var _0x2ba2ff=this['channel']['exec'](_0x6a86('0xb4'),_0xcca499);if(_0x2ba2ff['result']===-0x1){return _0x2ba2ff;}var _0x2edc77=this[_0x6a86('0xa7')]('RECOG_CONFIDENCE()',_0x6a86('0xb5'));if(_0x2edc77['result']===-0x1){return _0x2edc77;}var _0x4b3f24=this[_0x6a86('0xa7')](_0x6a86('0xb6'),'MRCP_RECOG_TRANSCRIPT');if(_0x4b3f24[_0x6a86('0xa8')]===-0x1){return _0x4b3f24;}var _0x2ab41e=this['getAndSetVariable'](_0x6a86('0xb7'),_0x6a86('0xb8'));if(_0x2ab41e['result']===-0x1){return _0x2ab41e;}return this[_0x6a86('0x10')]['noop'](util['format'](_0x6a86('0xb9'),_0xcca499));};AGIVertices[_0x6a86('0x12')][_0x6a86('0xba')]=function(_0xbb2fe2){logger['info'](util[_0x6a86('0x29')](_0x6a86('0xbb'),_0xbb2fe2[_0x6a86('0x35')]));return this[_0x6a86('0x10')][_0x6a86('0xba')]([_0xbb2fe2[_0x6a86('0xbc')],_0xbb2fe2[_0x6a86('0xbd')]]);};AGIVertices['prototype'][_0x6a86('0xbe')]=function(_0x11f737){logger[_0x6a86('0xb1')](util['format'](_0x6a86('0xbf'),_0x11f737[_0x6a86('0x35')]));if(this['isConfigured'](_0x11f737['timeout'])){logger['info'](util[_0x6a86('0x29')](_0x6a86('0xc0'),_0x11f737[_0x6a86('0x64')]));var _0x5f0cdd=this[_0x6a86('0x10')][_0x6a86('0xc1')](_0x11f737[_0x6a86('0x64')]);if(_0x5f0cdd[_0x6a86('0xa8')]===-0x1){return _0x5f0cdd;}}return this[_0x6a86('0x10')][_0x6a86('0xbe')]();};AGIVertices[_0x6a86('0x12')][_0x6a86('0xc2')]=function(_0x52f3f4){logger['info'](util[_0x6a86('0x29')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x52f3f4[_0x6a86('0x35')]));if(!this['isConfigured'](_0x52f3f4[_0x6a86('0xc3')])){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x52f3f4,'no\x20list\x20selected');}_0x52f3f4[_0x6a86('0x47')]=moment();if(this[_0x6a86('0x86')](_0x52f3f4[_0x6a86('0xc4')])){_0x52f3f4[_0x6a86('0x47')]=moment()['add'](_0x52f3f4[_0x6a86('0xc4')],_0x6a86('0xc5'));}if(!this[_0x6a86('0x86')](_0x52f3f4[_0x6a86('0x4a')])){_0x52f3f4[_0x6a86('0x4a')]=0x2;}this[_0x6a86('0x41')][_0x6a86('0x70')](this,_0x52f3f4);return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x52f3f4['phone'],_0x52f3f4[_0x6a86('0xc3')],_0x52f3f4[_0x6a86('0x47')]));};AGIVertices['prototype'][_0x6a86('0xc6')]=function(_0x1be358){logger[_0x6a86('0xb1')](util['format'](_0x6a86('0xc7'),_0x1be358['label']));var _0x389c0d=this[_0x6a86('0x10')]['exec'](_0x1be358[_0x6a86('0xc8')],_0x1be358[_0x6a86('0x79')]);if(_0x389c0d['result']===-0x1){return _0x389c0d;}return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')]('Executed\x20command\x20%s\x20%s',_0x1be358[_0x6a86('0xc8')],_0x1be358[_0x6a86('0x79')]));};AGIVertices[_0x6a86('0x12')][_0x6a86('0xc9')]=function(_0x4754b1){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x4754b1[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x4754b1[_0x6a86('0x5a')])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0xca'));}var _0xecf38f='\x22'+_0x4754b1[_0x6a86('0x5a')]+'\x22';if(this[_0x6a86('0x86')](_0x4754b1[_0x6a86('0x79')])){_0xecf38f+=','+_0x4754b1[_0x6a86('0x79')];}var _0x41c390=this[_0x6a86('0x10')][_0x6a86('0x56')](_0x6a86('0xcb'),_0xecf38f);if(_0x41c390[_0x6a86('0xa8')]===-0x1){return _0x41c390;}return this[_0x6a86('0x10')]['noop'](util['format'](_0x6a86('0xaf'),_0xecf38f));};AGIVertices['prototype'][_0x6a86('0xcc')]=function(_0x20a7d9){logger['info'](util[_0x6a86('0x29')](_0x6a86('0xcd'),_0x20a7d9[_0x6a86('0x35')]));if(!this['isConfigured'](_0x20a7d9[_0x6a86('0x5a')])){return this[_0x6a86('0x10')][_0x6a86('0xae')]('no\x20text\x20configured');}var _0x32e543='\x22'+_0x20a7d9[_0x6a86('0x5a')]+'\x22';if(this['isConfigured'](_0x20a7d9[_0x6a86('0x79')])){_0x32e543+=','+_0x20a7d9[_0x6a86('0x79')];}var _0x16a66d=this[_0x6a86('0x10')][_0x6a86('0x56')](_0x6a86('0xcb'),_0x32e543);if(_0x16a66d[_0x6a86('0xa8')]===-0x1){return _0x16a66d;}return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0xaf'),_0x32e543));};AGIVertices[_0x6a86('0x12')][_0x6a86('0xce')]=function(_0xc9b21d){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0xcf'),_0xc9b21d[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0xc9b21d[_0x6a86('0xb2')])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0xb3'));}var _0x32264e=_0xc9b21d[_0x6a86('0xb2')];if(this[_0x6a86('0x86')](_0xc9b21d[_0x6a86('0x79')])){_0x32264e+=','+_0xc9b21d[_0x6a86('0x79')];}var _0x261d91=this[_0x6a86('0x10')]['exec'](_0x6a86('0xb4'),_0x32264e);if(_0x261d91[_0x6a86('0xa8')]===-0x1){return _0x261d91;}var _0x19859c=this[_0x6a86('0xa7')]('RECOG_CONFIDENCE()',_0x6a86('0xd0'));if(_0x19859c[_0x6a86('0xa8')]===-0x1){return _0x19859c;}var _0x1a4770=this[_0x6a86('0xa7')](_0x6a86('0xb6'),_0x6a86('0xd1'));if(_0x1a4770['result']===-0x1){return _0x1a4770;}var _0x38e369=this[_0x6a86('0xa7')](_0x6a86('0xb7'),_0x6a86('0xd2'));if(_0x38e369[_0x6a86('0xa8')]===-0x1){return _0x38e369;}return this['channel'][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0xb9'),_0x32264e));};AGIVertices[_0x6a86('0x12')][_0x6a86('0xd3')]=function(_0x150da3){logger['info'](util[_0x6a86('0x29')](_0x6a86('0xd4'),_0x150da3[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x150da3[_0x6a86('0xb2')])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0xb3'));}var _0xb80f74=_0x150da3[_0x6a86('0xb2')];if(this[_0x6a86('0x86')](_0x150da3[_0x6a86('0x79')])){_0xb80f74+=','+_0x150da3[_0x6a86('0x79')];}var _0x237527=this[_0x6a86('0x10')][_0x6a86('0x56')](_0x6a86('0xb4'),_0xb80f74);if(_0x237527[_0x6a86('0xa8')]===-0x1){return _0x237527;}var _0x3ab194=this[_0x6a86('0xa7')]('RECOG_CONFIDENCE()',_0x6a86('0xd5'));if(_0x3ab194[_0x6a86('0xa8')]===-0x1){return _0x3ab194;}var _0x17dce1=this[_0x6a86('0xa7')](_0x6a86('0xb6'),_0x6a86('0xd6'));if(_0x17dce1[_0x6a86('0xa8')]===-0x1){return _0x17dce1;}var _0x5b245f=this[_0x6a86('0xa7')](_0x6a86('0xb7'),'SESTEK_ASR_INSTANCE');if(_0x5b245f['result']===-0x1){return _0x5b245f;}return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0xb9'),_0xb80f74));};AGIVertices[_0x6a86('0x12')][_0x6a86('0xd7')]=function(_0x1eadf4){logger[_0x6a86('0xb1')](util['format'](_0x6a86('0xd8'),_0x1eadf4[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x1eadf4[_0x6a86('0xd9')])){return this['channel'][_0x6a86('0x2c')](_0x1eadf4,_0x6a86('0xda'));}var _0x4708de=this['getSquareOdbc'][_0x6a86('0x70')](this,_0x1eadf4[_0x6a86('0xd9')]);if(!_0x4708de){return this[_0x6a86('0x10')]['error'](_0x1eadf4,_0x6a86('0xdb'));}if(!this[_0x6a86('0x86')](_0x1eadf4['query'])){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x1eadf4,_0x6a86('0xdc'));}var _0x3e67f8=_0x1eadf4['query'][_0x6a86('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0x6a86('0x10')][_0x6a86('0xae')](util['format'](_0x6a86('0xdd'),_0x3e67f8));var _0xc78f92=this[_0x6a86('0x2a')][_0x6a86('0x70')](this,_0x4708de,_0x3e67f8);this[_0x6a86('0x34')][_0x6a86('0x70')](this,_0x1eadf4,_0x3e67f8);if(!this[_0x6a86('0x86')](_0x1eadf4['variable_id'])){return this['channel'][_0x6a86('0xae')](_0x6a86('0xde'));}var _0x40ec46=this['getVariable'][_0x6a86('0x70')](this,_0x1eadf4['variable_id']);if(!_0x40ec46){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x1eadf4,'no\x20variable\x20found');}var _0x186aa0=this;_0xc78f92[_0x6a86('0xdf')](function(_0x222692,_0x1ce291){Object['keys'](_0x222692)[_0x6a86('0xdf')](function(_0x4cbe5c){_0x186aa0[_0x6a86('0x10')]['setVariable'](util[_0x6a86('0x29')](_0x6a86('0xe0'),_0x40ec46,_0x1ce291,_0x4cbe5c),_0x222692[_0x4cbe5c]);});});this[_0x6a86('0x10')]['setVariable'](util['format'](_0x6a86('0xe1'),_0x40ec46),_0xc78f92['length']);return this['channel']['noop'](util[_0x6a86('0x29')](_0x6a86('0xe2'),_0x40ec46));};AGIVertices[_0x6a86('0x12')]['dial']=function(_0x3dd483){logger['debug'](util[_0x6a86('0x29')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x3dd483[_0x6a86('0x35')]));if(!this['isConfigured'](_0x3dd483[_0x6a86('0xe3')])){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x3dd483,_0x6a86('0xe4'));}var _0x34e908=this[_0x6a86('0xe5')][_0x6a86('0x70')](this,_0x3dd483['sip_id']);if(!_0x34e908){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x3dd483,'no\x20user\x20found');}var _0x5b8cfd=this[_0x6a86('0x10')][_0x6a86('0x56')](_0x6a86('0xe6'),[util[_0x6a86('0x29')](_0x6a86('0xe7'),_0x34e908),_0x3dd483[_0x6a86('0x64')],_0x3dd483['opts'],_0x3dd483[_0x6a86('0x62')]]);if(_0x5b8cfd[_0x6a86('0xa8')]===-0x1){return _0x5b8cfd;}return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0xe8'),_0x6a86('0xe6')));};AGIVertices['prototype'][_0x6a86('0xe9')]=function(_0x1a7c74){logger['info'](util[_0x6a86('0x29')](_0x6a86('0xea'),_0x1a7c74[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x1a7c74[_0x6a86('0x7b')])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0xeb'));}if(!this[_0x6a86('0x86')](_0x1a7c74['text'])){return this[_0x6a86('0x10')][_0x6a86('0xae')]('no\x20text\x20configured');}this[_0x6a86('0x10')][_0x6a86('0xec')]=!![];this[_0x6a86('0x34')](_0x1a7c74);this['createSquareMessage'](_0x1a7c74[_0x6a86('0x5a')],'in','','');this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0xed'),_0x1a7c74['text']));var _0x331cfe=this[_0x6a86('0x7a')]['sync'](this,_0x1a7c74);if(_0x331cfe){for(var _0x4bbe97 in _0x331cfe){if(_0x331cfe[_0x6a86('0x99')](_0x4bbe97)){this[_0x6a86('0x10')][_0x6a86('0xa1')](util['format'](_0x6a86('0xee'),_0x4bbe97[_0x6a86('0x69')]()),_0x331cfe[_0x4bbe97]);}}this[_0x6a86('0x40')](_0x331cfe[_0x6a86('0xef')],_0x6a86('0xf0'),_0x6a86('0xe9'),'');return this[_0x6a86('0x10')]['noop'](util[_0x6a86('0x29')](_0x6a86('0xf1'),_0x331cfe[_0x6a86('0xef')]));}return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x1a7c74,_0x6a86('0xf2'));};AGIVertices[_0x6a86('0x12')]['dialogflowV2']=function(_0x3978c2){logger[_0x6a86('0xb1')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3978c2[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x3978c2[_0x6a86('0xf3')])){return this['channel']['noop']('no\x20project_id\x20configured');}if(!this[_0x6a86('0x86')](_0x3978c2['client_email'])){return this[_0x6a86('0x10')][_0x6a86('0xae')]('no\x20client_email\x20configured');}if(!this[_0x6a86('0x86')](_0x3978c2[_0x6a86('0xf4')])){return this[_0x6a86('0x10')]['noop']('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x3978c2[_0x6a86('0x7f')])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0xf5'));}if(!this[_0x6a86('0x86')](_0x3978c2[_0x6a86('0x5a')])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0xca'));}this['channel']['bot']=!![];this[_0x6a86('0x34')](_0x3978c2);this[_0x6a86('0x40')](_0x3978c2[_0x6a86('0x5a')],'in','','');this[_0x6a86('0x10')][_0x6a86('0xae')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x3978c2[_0x6a86('0x5a')]));var _0x529134=this['googleDialogflowV2'][_0x6a86('0x70')](this,_0x3978c2);if(_0x529134){for(var _0x86085b in _0x529134){if(_0x529134['hasOwnProperty'](_0x86085b)){if(_0x86085b!==_0x6a86('0xf6')){this[_0x6a86('0x10')][_0x6a86('0xa1')](util[_0x6a86('0x29')](_0x6a86('0xee'),_0x86085b[_0x6a86('0x69')]()),_0x529134[_0x86085b]);}}}this[_0x6a86('0x40')](_0x529134['speech'],'out',_0x6a86('0xf7'),_0x529134['providerResponse']);return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0xf8'),_0x529134[_0x6a86('0xef')]));}return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x3978c2,_0x6a86('0xf9'));};AGIVertices['prototype'][_0x6a86('0xfa')]=function(_0x4d4de0){logger['info'](util['format'](_0x6a86('0xfb'),_0x4d4de0[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x4d4de0[_0x6a86('0xfc')])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0xfd'));}if(!this['isConfigured'](_0x4d4de0['username'])){return this['channel'][_0x6a86('0xae')](_0x6a86('0xfe'));}if(!this[_0x6a86('0x86')](_0x4d4de0[_0x6a86('0xff')])){return this['channel'][_0x6a86('0xae')]('no\x20password\x20configured');}if(!this[_0x6a86('0x86')](_0x4d4de0[_0x6a86('0x100')])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0xca'));}this['channel'][_0x6a86('0xec')]=!![];this['createSquareDetailsReport'](_0x4d4de0);this[_0x6a86('0x40')](_0x4d4de0['text'],'in','','');this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x101'),_0x4d4de0[_0x6a86('0x5a')]));var _0x3b2175=this[_0x6a86('0x80')][_0x6a86('0x70')](this,_0x4d4de0);if(_0x3b2175){for(var _0xfebc07 in _0x3b2175){if(_0x3b2175[_0x6a86('0x99')](_0xfebc07)){this['channel'][_0x6a86('0xa1')](util['format']('SESTEK_NDA_%s',_0xfebc07[_0x6a86('0x69')]()),_0x3b2175[_0xfebc07]);}}this['createSquareMessage'](_0x3b2175[_0x6a86('0xef')],_0x6a86('0xf0'),_0x6a86('0xfa'),'');if(_0x3b2175[_0x6a86('0x102')]){this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x103'),_0x3b2175[_0x6a86('0x102')]));var _0x5c9422=this['channel'][_0x6a86('0x104')](_0x3b2175['audiofile']);try{fs['unlink'](_0x3b2175['audiofile']+'.wav');}catch(_0x31c359){logger['error'](_0x31c359);}return _0x5c9422;}else{return this[_0x6a86('0x10')]['noop'](util[_0x6a86('0x29')](_0x6a86('0x105'),_0x3b2175[_0x6a86('0xef')]));}}return this[_0x6a86('0x10')]['error'](_0x4d4de0,_0x6a86('0x106'));};AGIVertices['prototype'][_0x6a86('0x107')]=function(_0x4d9c78){logger['info'](util[_0x6a86('0x29')]('Enter\x20in\x20END\x20(%s)\x20block',_0x4d9c78[_0x6a86('0x35')]));return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0x107'));};AGIVertices['prototype'][_0x6a86('0x108')]=function(_0x13c6b6){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x109'),_0x13c6b6[_0x6a86('0x35')]));var _0x2e4c45='';if(_0x13c6b6[_0x6a86('0x10a')]){if(!this[_0x6a86('0x86')](_0x13c6b6[_0x6a86('0x10a')])){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x13c6b6,_0x6a86('0x10b'));}else{var _0xbe6553=parseInt(_0x13c6b6[_0x6a86('0x10a')],0xa);if(isNaN(_0xbe6553)){_0x2e4c45=_0x13c6b6[_0x6a86('0x10a')];}else{_0x2e4c45=this[_0x6a86('0x20')][_0x6a86('0x70')](this,_0x13c6b6[_0x6a86('0x10a')]);if(!_0x2e4c45){return this['channel']['error'](_0x13c6b6,'no\x20trunk\x20found');}}}}else if(_0x13c6b6[_0x6a86('0x10c')]){_0x2e4c45=_0x13c6b6[_0x6a86('0x10c')];}else{return this['channel'][_0x6a86('0x2c')](_0x13c6b6,_0x6a86('0x10b'));}var _0x29320b=this[_0x6a86('0x10')][_0x6a86('0x56')](_0x6a86('0xe6'),[util[_0x6a86('0x29')]('SIP/%s/%s',_0x2e4c45,_0x13c6b6[_0x6a86('0x46')]),_0x13c6b6[_0x6a86('0x64')],_0x13c6b6['opts'],_0x13c6b6[_0x6a86('0x62')]]);if(_0x29320b['result']===-0x1){return _0x29320b;}return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')]('Executed\x20command\x20%s',_0x6a86('0xe6')));};AGIVertices[_0x6a86('0x12')][_0x6a86('0x10d')]=function(_0x1fb5ad){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x10e'),_0x1fb5ad[_0x6a86('0x35')]));return this[_0x6a86('0x10')]['noop']('finally');};AGIVertices['prototype'][_0x6a86('0xe')]=function(_0x1f7987){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x10f'),_0x1f7987[_0x6a86('0x35')]));if(_0x1f7987[_0x6a86('0xab')]===0x0){return this[_0x6a86('0xaa')](_0x1f7987);}_0x1f7987[_0x6a86('0xab')]-=0x1;if(!this[_0x6a86('0x86')](_0x1f7987[_0x6a86('0x110')])){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x1f7987,'no\x20file\x20audio\x20selected');}var _0x404955=this[_0x6a86('0x21')][_0x6a86('0x70')](this,_0x1f7987[_0x6a86('0x110')]);if(!_0x404955){return this[_0x6a86('0x10')]['error'](_0x1f7987,_0x6a86('0x111'));}if(!this['isConfigured'](_0x1f7987[_0x6a86('0x112')])){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x6a86('0xde'));}var _0x1b52b3=this[_0x6a86('0x10')][_0x6a86('0x113')](_0x404955,_0x1f7987[_0x6a86('0x114')],_0x1f7987['maxdigit']);var _0x29b94a=_0x1b52b3['result']?_0x1b52b3[_0x6a86('0xa8')]['toString']():'';logger[_0x6a86('0xb1')]('test',JSON['stringify'](_0x1b52b3));if(_0x1b52b3[_0x6a86('0xa8')]===-0x1){this['createSquareDetailsReport'][_0x6a86('0x70')](this,_0x1f7987,_0x29b94a);return _0x1b52b3;}else if(_0x1b52b3[_0x6a86('0xa6')]==='timeout'){_0x1b52b3['result']=_0x29b94a[_0x6a86('0xa4')]>=parseInt(_0x1f7987[_0x6a86('0x115')])?'x':'i';}else{_0x1b52b3[_0x6a86('0xa8')]=_0x29b94a[_0x6a86('0xa4')]>=parseInt(_0x1f7987[_0x6a86('0x115')])&&_0x29b94a[_0x6a86('0xa4')]<=parseInt(_0x1f7987[_0x6a86('0x116')])?'x':'i';}var _0x23cb28=this[_0x6a86('0x13')][_0x6a86('0x70')](this,_0x1f7987['variable_id']);if(!_0x23cb28){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x1f7987,_0x6a86('0x117'));}this['channel'][_0x6a86('0xa1')](_0x23cb28,_0x29b94a);if(this[_0x6a86('0x86')](_0x1f7987[_0x6a86('0x118')])){var _0x465d4f=parseInt(_0x1f7987[_0x6a86('0x118')],0xa);var _0x4dc405=rs[_0x6a86('0x119')]({'charset':'*','length':_0x465d4f});var _0x2fa330=_0x29b94a[_0x6a86('0xa4')];if(_0x2fa330>0x0){if(_0x2fa330>_0x465d4f){this['createSquareDetailsReport'][_0x6a86('0x70')](this,_0x1f7987,_0x1f7987[_0x6a86('0x11a')]==='first'?_0x4dc405+_0x29b94a[_0x6a86('0x11b')](_0x465d4f):_0x29b94a[_0x6a86('0x11b')](0x0,_0x2fa330-_0x465d4f)+_0x4dc405);}else{this[_0x6a86('0x34')]['sync'](this,_0x1f7987,rs[_0x6a86('0x119')]({'charset':'*','length':_0x2fa330}));}}else{this[_0x6a86('0x34')][_0x6a86('0x70')](this,_0x1f7987,'');}}else{this[_0x6a86('0x34')][_0x6a86('0x70')](this,_0x1f7987,_0x29b94a);}return _0x1b52b3;};AGIVertices[_0x6a86('0x12')]['getsecretdigits']=function(_0x546569){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x546569[_0x6a86('0x35')]));return this[_0x6a86('0xe')](_0x546569);};AGIVertices[_0x6a86('0x12')][_0x6a86('0x11c')]=function(_0x37f389){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x37f389[_0x6a86('0x35')]));this[_0x6a86('0x34')][_0x6a86('0x70')](this,_0x37f389,_0x37f389['goalname']);return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x11d'),_0x37f389[_0x6a86('0x11e')]));};AGIVertices[_0x6a86('0x12')][_0x6a86('0x11f')]=function(_0x2bfad3){logger[_0x6a86('0xb1')](util['format'](_0x6a86('0x120'),_0x2bfad3[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x2bfad3[_0x6a86('0x89')])||!this[_0x6a86('0x86')](_0x2bfad3[_0x6a86('0x8a')])){return this['channel'][_0x6a86('0xae')](_0x6a86('0x121'));}if(!this[_0x6a86('0x86')](_0x2bfad3[_0x6a86('0x5a')])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0xca'));}this['channel'][_0x6a86('0xae')](util[_0x6a86('0x29')]('Trying\x20aws\x20Polly\x20%s',_0x2bfad3[_0x6a86('0x5a')]));var _0x544c72=this[_0x6a86('0x88')][_0x6a86('0x70')](this,_0x2bfad3);if(_0x544c72){this[_0x6a86('0x10')][_0x6a86('0xae')](util['format'](_0x6a86('0x122'),_0x544c72));var _0x308d99=this[_0x6a86('0x10')][_0x6a86('0x104')](_0x544c72);try{fs[_0x6a86('0x123')](_0x544c72+'.wav');}catch(_0x28d4bd){logger[_0x6a86('0x2c')](_0x28d4bd);}return _0x308d99;}return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x2bfad3,_0x6a86('0x124'));};AGIVertices['prototype'][_0x6a86('0x125')]=function(_0x302cc8){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x126'),_0x302cc8[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x302cc8[_0x6a86('0x89')])||!this[_0x6a86('0x86')](_0x302cc8['aws_secret_access_key'])){return this['channel'][_0x6a86('0xae')](_0x6a86('0x121'));}if(!this[_0x6a86('0x86')](_0x302cc8['aws_bot_name'])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0x127'));}if(!this[_0x6a86('0x86')](_0x302cc8['text'])){return this[_0x6a86('0x10')][_0x6a86('0xae')]('no\x20text\x20configured');}this[_0x6a86('0x10')][_0x6a86('0xec')]=!![];this['createSquareDetailsReport'](_0x302cc8);this[_0x6a86('0x40')](_0x302cc8[_0x6a86('0x5a')],'in','','');this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x128'),_0x302cc8[_0x6a86('0x5a')]));var _0x41b619=this[_0x6a86('0x8f')]['sync'](this,_0x302cc8);if(_0x41b619){for(var _0x4fc178 in _0x41b619){if(_0x41b619['hasOwnProperty'](_0x4fc178)&&_[_0x6a86('0x9a')](_0x41b619[_0x4fc178])){this[_0x6a86('0x10')][_0x6a86('0xa1')](util[_0x6a86('0x29')](_0x6a86('0x129'),_0x4fc178[_0x6a86('0x69')]()),_0x41b619[_0x4fc178]);}}if(_['isNil'](_0x41b619[_0x6a86('0x77')])){return this['channel'][_0x6a86('0xae')](_0x6a86('0x12a'));}else{this[_0x6a86('0x40')](_0x41b619['message'],_0x6a86('0xf0'),_0x6a86('0x12b'),'');return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')]('Amazon\x20Lex\x20Result\x20%s',_0x41b619[_0x6a86('0x77')]));}}return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x302cc8,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0x6a86('0x12c')]=function(_0x5e7c11){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x12d'),_0x5e7c11['label'],_0x5e7c11[_0x6a86('0x64')]));if(!this[_0x6a86('0x86')](_0x5e7c11[_0x6a86('0x7b')])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0xeb'));}var _0x5bd58e=_0x6a86('0x12e');var _0x3ea8b1=util[_0x6a86('0x29')](_0x6a86('0x12f'),FILES_PATH,rs['generate'](0x4));var _0x5c5c0b=util[_0x6a86('0x29')](_0x6a86('0xa0'),_0x3ea8b1,_0x5bd58e);var _0x33c5b6=!![];if(_0x5e7c11[_0x6a86('0x130')]===_0x6a86('0x131')){_0x33c5b6=![];}var _0x4a5ff9=this[_0x6a86('0x10')][_0x6a86('0x132')](_0x3ea8b1,_0x5bd58e,_0x5e7c11['intKey'],_0x5e7c11['timeout'],undefined,_0x33c5b6);if(_0x4a5ff9[_0x6a86('0xa8')]!==-0x1){this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x133'),_0x5c5c0b));var _0x42f34c=this[_0x6a86('0x92')]['sync'](this,_0x5e7c11,_0x5c5c0b);if(_0x42f34c){for(var _0x17b2ae in _0x42f34c){if(_0x42f34c[_0x6a86('0x99')](_0x17b2ae)){this[_0x6a86('0x10')]['setVariable'](util[_0x6a86('0x29')]('GOOGLE_ASR_%s',_0x17b2ae[_0x6a86('0x69')]()),_0x42f34c[_0x17b2ae]);}}return this['channel'][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x134'),JSON[_0x6a86('0x73')](_0x42f34c)));}}return _0x4a5ff9;};AGIVertices['prototype'][_0x6a86('0x135')]=function(_0x51ef48){logger['info'](util[_0x6a86('0x29')](_0x6a86('0x136'),_0x51ef48[_0x6a86('0x35')]));if(!this['isConfigured'](_0x51ef48['appid'])){return this[_0x6a86('0x10')]['noop'](_0x6a86('0x137'));}if(!this['isConfigured'](_0x51ef48[_0x6a86('0x95')])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0x138'));}var _0x162b1a=_0x6a86('0x12e');var _0x3b7238=util[_0x6a86('0x29')](_0x6a86('0x12f'),FILES_PATH,rs[_0x6a86('0x119')](0x4));var _0x271933=util['format'](_0x6a86('0xa0'),_0x3b7238,_0x162b1a);var _0x2856fa=!![];if(_0x51ef48[_0x6a86('0x130')]==='NOBEEP'){_0x2856fa=![];}var _0x4c28a7=this[_0x6a86('0x10')][_0x6a86('0x132')](_0x3b7238,_0x162b1a,_0x51ef48[_0x6a86('0x139')],_0x51ef48[_0x6a86('0x64')],undefined,_0x2856fa);if(_0x4c28a7[_0x6a86('0xa8')]!==-0x1){this[_0x6a86('0x10')][_0x6a86('0xae')](util['format'](_0x6a86('0x13a'),_0x271933));var _0x18e919=this[_0x6a86('0x13b')][_0x6a86('0x70')](this,_0x51ef48,_0x271933);if(_0x18e919){for(var _0x85dff8 in _0x18e919){if(_0x18e919[_0x6a86('0x99')](_0x85dff8)){this[_0x6a86('0x10')][_0x6a86('0xa1')](util[_0x6a86('0x29')](_0x6a86('0x13c'),_0x85dff8[_0x6a86('0x69')]()),_0x18e919[_0x85dff8]);}}return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')]('TildeASR\x20Result\x20%s',JSON[_0x6a86('0x73')](_0x18e919)));}}return _0x4c28a7;};AGIVertices[_0x6a86('0x12')][_0x6a86('0x13d')]=function(_0x52b6f7){logger[_0x6a86('0xb1')](util['format'](_0x6a86('0x13e'),_0x52b6f7[_0x6a86('0x35')]));return this['channel'][_0x6a86('0x13f')](_0x52b6f7['context'],_0x52b6f7[_0x6a86('0x3a')],_0x52b6f7[_0x6a86('0x3b')]);};AGIVertices[_0x6a86('0x12')][_0x6a86('0x140')]=function(_0x28ab77){logger['info'](util[_0x6a86('0x29')](_0x6a86('0x141'),_0x28ab77[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x28ab77['condition'])){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x28ab77,_0x6a86('0x142'));}try{var _0x341c43=eval(_0x28ab77['condition'])?_0x6a86('0x143'):'false';this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x144'),_0x28ab77[_0x6a86('0x145')],_0x341c43));return{'code':0xc8,'result':_0x341c43};}catch(_0x2488a0){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype']['gotoiftime']=function(_0x5f3b11){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x5f3b11['label']));if(!this['isConfigured'](_0x5f3b11['interval_id'])){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x5f3b11,_0x6a86('0x146'));}var _0x27137d=this[_0x6a86('0x147')][_0x6a86('0x70')](this,_0x5f3b11[_0x6a86('0x148')]);if(!_0x27137d){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x5f3b11,_0x6a86('0x149'));}for(var _0x1512c2=0x0;_0x1512c2<_0x27137d['length'];_0x1512c2+=0x1){var _0x56fcd2=this['channel'][_0x6a86('0x13')](util[_0x6a86('0x29')]('IFTIME(%s?true:false)',_0x27137d[_0x1512c2]));if(_0x56fcd2['result']===-0x1){return _0x56fcd2;}logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x14a'),_0x27137d[_0x1512c2],_0x56fcd2[_0x6a86('0xa6')]));if(_0x56fcd2[_0x6a86('0xa6')]===_0x6a86('0x143')){logger['info'](util[_0x6a86('0x29')]('IFTIME\x20%s\x20%s',_0x27137d[_0x1512c2],_0x6a86('0x143')));this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x14a'),_0x27137d[_0x1512c2],_0x6a86('0x143')));return{'code':0xc8,'result':_0x6a86('0x143')};}else{logger[_0x6a86('0xb1')](util['format'](_0x6a86('0x14a'),_0x27137d[_0x1512c2],_0x6a86('0x14b')));this[_0x6a86('0x10')]['noop'](util['format'](_0x6a86('0x14a'),_0x27137d[_0x1512c2],_0x6a86('0x14b')));}}return{'code':0xc8,'result':_0x6a86('0x14b')};};AGIVertices[_0x6a86('0x12')][_0x6a86('0x14c')]=function(_0x2d155e){logger['info'](util[_0x6a86('0x29')](_0x6a86('0x14d'),_0x2d155e[_0x6a86('0x35')]));return this[_0x6a86('0x10')][_0x6a86('0x14c')]();};AGIVertices[_0x6a86('0x12')]['ispeechasr']=function(_0x41b8fe){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x14e'),_0x41b8fe[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x41b8fe[_0x6a86('0x7b')])){return this[_0x6a86('0x10')][_0x6a86('0xae')]('no\x20key\x20configured');}var _0x52eb34=_0x6a86('0x12e');var _0x57a689=util[_0x6a86('0x29')](_0x6a86('0x12f'),FILES_PATH,rs[_0x6a86('0x119')](0x4));var _0x19d7d0=util[_0x6a86('0x29')](_0x6a86('0xa0'),_0x57a689,_0x52eb34);var _0x15e48b=!![];if(_0x41b8fe[_0x6a86('0x130')]===_0x6a86('0x131')){_0x15e48b=![];}var _0x5620ca=this[_0x6a86('0x10')][_0x6a86('0x132')](_0x57a689,_0x52eb34,_0x41b8fe['intKey'],_0x41b8fe['timeout'],undefined,_0x15e48b);if(_0x5620ca[_0x6a86('0xa8')]!==-0x1){this['channel']['noop'](util[_0x6a86('0x29')](_0x6a86('0x14f'),_0x19d7d0));var _0x4cc7a7=this[_0x6a86('0x150')][_0x6a86('0x70')](this,_0x41b8fe,_0x19d7d0);if(_0x4cc7a7){for(var _0x51a529 in _0x4cc7a7){if(_0x4cc7a7[_0x6a86('0x99')](_0x51a529)){this[_0x6a86('0x10')][_0x6a86('0xa1')](util[_0x6a86('0x29')]('ISPEECH_ASR_%s',_0x51a529[_0x6a86('0x69')]()),_0x4cc7a7[_0x51a529]);}}return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')]('IspeechASR\x20Result\x20%s',JSON[_0x6a86('0x73')](_0x4cc7a7)));}}return _0x5620ca;};AGIVertices['prototype'][_0x6a86('0x151')]=function(_0x5435d7){logger['info'](util['format'](_0x6a86('0x152'),_0x5435d7['label']));if(!this[_0x6a86('0x86')](_0x5435d7[_0x6a86('0x7b')])){return this[_0x6a86('0x10')]['noop'](_0x6a86('0xeb'));}if(!this['isConfigured'](_0x5435d7[_0x6a86('0x5a')])){return this[_0x6a86('0x10')][_0x6a86('0xae')]('no\x20text\x20configured');}this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x153'),_0x5435d7[_0x6a86('0x5a')]));var _0x45d295=this[_0x6a86('0x81')][_0x6a86('0x70')](this,_0x5435d7);if(_0x45d295){this[_0x6a86('0x10')]['noop'](util[_0x6a86('0x29')](_0x6a86('0x14f'),_0x45d295));var _0x3c7cb8=this['channel'][_0x6a86('0x104')](_0x45d295,_0x5435d7['intKey']);try{fs[_0x6a86('0x123')](_0x45d295+_0x6a86('0x154'));}catch(_0x4b3399){logger['error'](_0x4b3399);}return _0x3c7cb8;}return this['channel'][_0x6a86('0x2c')](_0x5435d7,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x6a86('0x12')][_0x6a86('0x155')]=function(_0x17076a){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x156'),_0x17076a[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x17076a[_0x6a86('0x157')])){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x17076a,_0x6a86('0x158'));}logger[_0x6a86('0xb1')](util['format'](_0x6a86('0x159'),this['channel'][_0x6a86('0x36')],_0x17076a[_0x6a86('0x157')]));var _0x1d9c19=this[_0x6a86('0x51')][_0x6a86('0x70')](this,_0x17076a['findBy']);if(_0x1d9c19){logger[_0x6a86('0xb1')](util['format'](_0x6a86('0x15a'),this['channel'][_0x6a86('0x36')],_0x17076a[_0x6a86('0x157')]));this[_0x6a86('0x10')][_0x6a86('0xae')](util['format'](_0x6a86('0x15a'),this[_0x6a86('0x10')][_0x6a86('0x36')],_0x17076a[_0x6a86('0x157')]));return{'code':0xc8,'result':_0x6a86('0x15b')};}else{logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x15c'),this[_0x6a86('0x10')][_0x6a86('0x36')],_0x17076a[_0x6a86('0x157')]));this['channel'][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x15c'),this['channel']['callerid'],_0x17076a[_0x6a86('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x6a86('0x15d')]=function(_0x2f2d76){logger[_0x6a86('0xb1')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x2f2d76[_0x6a86('0x35')]));if(!this['isConfigured'](_0x2f2d76[_0x6a86('0x157')])){return this[_0x6a86('0x10')]['error'](_0x2f2d76,_0x6a86('0x158'));}logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x159'),this[_0x6a86('0x10')][_0x6a86('0x36')],_0x2f2d76[_0x6a86('0x157')]));var _0x3ceab3=this['agentLogout'][_0x6a86('0x70')](this,_0x2f2d76[_0x6a86('0x157')]);if(_0x3ceab3){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x15a'),this[_0x6a86('0x10')][_0x6a86('0x36')],_0x2f2d76[_0x6a86('0x157')]));this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x15a'),this[_0x6a86('0x10')]['callerid'],_0x2f2d76[_0x6a86('0x157')]));return{'code':0xc8,'result':_0x6a86('0x15b')};}else{logger['info'](util[_0x6a86('0x29')](_0x6a86('0x15c'),this[_0x6a86('0x10')][_0x6a86('0x36')],_0x2f2d76[_0x6a86('0x157')]));this[_0x6a86('0x10')]['noop'](util['format'](_0x6a86('0x15c'),this[_0x6a86('0x10')][_0x6a86('0x36')],_0x2f2d76[_0x6a86('0x157')]));return{'code':0xc8,'result':_0x6a86('0x15e')};}};AGIVertices['prototype'][_0x6a86('0x15f')]=function(_0xb9cc18){logger['info'](util[_0x6a86('0x29')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0xb9cc18['label']));if(!this['isConfigured'](_0xb9cc18[_0x6a86('0x160')])){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0xb9cc18,_0x6a86('0x161'));}this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x162'),_0xb9cc18[_0x6a86('0x160')]));var _0x51b774=eval(_0xb9cc18['operation']);if(!this[_0x6a86('0x86')](_0xb9cc18['variable_id'])){return this['channel'][_0x6a86('0xae')](_0x6a86('0xde'));}var _0x142777=this[_0x6a86('0x13')]['sync'](this,_0xb9cc18[_0x6a86('0x112')]);if(!_0x142777){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0xb9cc18,_0x6a86('0x117'));}if(_[_0x6a86('0x9e')](_0x51b774)){var _0x19ce06=this;_0x51b774[_0x6a86('0xdf')](function(_0x446a88,_0x3efe96){_0x19ce06['channel'][_0x6a86('0xa1')](util['format'](_0x6a86('0x163'),_0x142777,_0x3efe96),_0x446a88);});return this['channel'][_0x6a86('0xae')](util[_0x6a86('0x29')]('variable\x20%s[key]\x20set',_0x142777));}else{return this[_0x6a86('0x10')][_0x6a86('0xa1')](_0x142777,_0x51b774);}};AGIVertices['prototype'][_0x6a86('0xd')]=function(_0x5cff32){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x164'),_0x5cff32[_0x6a86('0x35')]));if(_0x5cff32[_0x6a86('0xab')]===0x0){return this[_0x6a86('0xaa')](_0x5cff32);}_0x5cff32[_0x6a86('0xab')]-=0x1;if(!this[_0x6a86('0x86')](_0x5cff32['file_id'])){return this['channel'][_0x6a86('0x2c')](_0x5cff32,'no\x20file\x20audio\x20selected');}var _0x4f7409=this[_0x6a86('0x21')][_0x6a86('0x70')](this,_0x5cff32[_0x6a86('0x110')]);if(!_0x4f7409){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x5cff32,_0x6a86('0x111'));}var _0x160c1a=this[_0x6a86('0x10')][_0x6a86('0x113')](_0x4f7409,_0x5cff32['response'],_0x5cff32[_0x6a86('0x165')]);var _0x465a56=_0x160c1a['result'];if(_0x160c1a['result']===-0x1){this['createSquareDetailsReport'][_0x6a86('0x70')](this,_0x5cff32,'-1');return _0x160c1a;}else if(_0x160c1a[_0x6a86('0xa6')]===_0x6a86('0x64')){_0x160c1a['result']=_0x160c1a['result'][_0x6a86('0xa4')]>0x0?_0x160c1a[_0x6a86('0xa8')]:'t';}else if(_[_0x6a86('0x42')](_0x160c1a[_0x6a86('0xa8')])){_0x160c1a[_0x6a86('0xa8')]='#';_0x465a56='#';}if(!this['isConfigured'](_0x5cff32[_0x6a86('0x112')])){this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0xde'));}else{var _0x1aa8d9=this[_0x6a86('0x13')][_0x6a86('0x70')](this,_0x5cff32[_0x6a86('0x112')]);if(!_0x1aa8d9){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x5cff32,'no\x20variable\x20found');}this['channel'][_0x6a86('0xa1')](_0x1aa8d9,_0x465a56);}this[_0x6a86('0x34')][_0x6a86('0x70')](this,_0x5cff32,_0x465a56);return _0x160c1a;};AGIVertices[_0x6a86('0x12')][_0x6a86('0xae')]=function(_0x50f88f){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x166'),_0x50f88f[_0x6a86('0x35')]));return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x50f88f[_0x6a86('0x167')]||_0x50f88f[_0x6a86('0x35')]);};AGIVertices[_0x6a86('0x12')][_0x6a86('0x168')]=function(_0x223222){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x169'),_0x223222[_0x6a86('0x35')]));if(!this['isConfigured'](_0x223222[_0x6a86('0x157')])){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x223222,_0x6a86('0x158'));}logger['info'](util[_0x6a86('0x29')](_0x6a86('0x159'),this[_0x6a86('0x10')][_0x6a86('0x36')],_0x223222[_0x6a86('0x157')]));var _0x2e3316=this['getPause'][_0x6a86('0x70')](this,_0x223222[_0x6a86('0x16a')]);var _0x258502=this[_0x6a86('0x4d')][_0x6a86('0x70')](this,_0x223222[_0x6a86('0x157')],_0x2e3316);if(_0x258502){logger[_0x6a86('0xb1')](util['format'](_0x6a86('0x15a'),this[_0x6a86('0x10')][_0x6a86('0x36')],_0x223222[_0x6a86('0x157')]));this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x15a'),this['channel'][_0x6a86('0x36')],_0x223222[_0x6a86('0x157')]));return{'code':0xc8,'result':_0x6a86('0x15b')};}else{logger['info'](util[_0x6a86('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x6a86('0x10')]['callerid'],_0x223222[_0x6a86('0x157')]));this['channel'][_0x6a86('0xae')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x6a86('0x10')][_0x6a86('0x36')],_0x223222[_0x6a86('0x157')]));return{'code':0xc8,'result':_0x6a86('0x15e')};}};AGIVertices[_0x6a86('0x12')][_0x6a86('0x16b')]=function(_0x16fa6c){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x16fa6c[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x16fa6c[_0x6a86('0x110')])){return this['channel']['error'](_0x16fa6c,'no\x20file\x20audio\x20selected');}var _0x554d22=this['getSound'][_0x6a86('0x70')](this,_0x16fa6c[_0x6a86('0x110')]);if(!_0x554d22){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x16fa6c,'no\x20file\x20audio\x20found');}var _0x22062d=this[_0x6a86('0x10')][_0x6a86('0x56')]('PLAYBACK',[_0x554d22,_0x16fa6c[_0x6a86('0x16c')]]);if(_0x22062d[_0x6a86('0xa8')]===-0x1){return _0x22062d;}return this['channel']['noop'](util[_0x6a86('0x29')](_0x6a86('0x16d'),_0x6a86('0x16e'),_0x554d22));};AGIVertices[_0x6a86('0x12')][_0x6a86('0x16f')]=function(_0x57b29c){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x170'),_0x57b29c[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x57b29c[_0x6a86('0x171')])){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x57b29c,'no\x20queue\x20selected');}var _0x238b41='';var _0x228c50=parseInt(_0x57b29c[_0x6a86('0x171')],0xa);if(isNaN(_0x228c50)){_0x238b41=_0x57b29c[_0x6a86('0x171')];}else{_0x238b41=this['getVoiceQueue'][_0x6a86('0x70')](this,_0x57b29c[_0x6a86('0x171')]);if(!_0x238b41){return this[_0x6a86('0x10')]['error'](_0x57b29c,_0x6a86('0x172'));}}var _0xfd0df4='';if(this[_0x6a86('0x86')](_0x57b29c[_0x6a86('0x110')])){var _0x57a3ea=this[_0x6a86('0x21')]['sync'](this,_0x57b29c[_0x6a86('0x110')]);if(_0x57a3ea){_0xfd0df4=_0x57a3ea;}}this[_0x6a86('0x34')][_0x6a86('0x70')](this,_0x57b29c,_0x238b41);if(_0x57b29c[_0x6a86('0x16c')]['indexOf']('x')<0x0){_0x57b29c['opts']+='x';}if(_0x57b29c[_0x6a86('0x16c')][_0x6a86('0x173')]('X')<0x0){_0x57b29c[_0x6a86('0x16c')]+='X';}this['channel']['setVariable'](_0x6a86('0x174'),_0x238b41?_0x238b41[_0x6a86('0x175')]():'');var _0x37544b=this[_0x6a86('0x10')][_0x6a86('0x56')](_0x6a86('0x176'),[_0x238b41,_0x57b29c[_0x6a86('0x16c')],_0x57b29c[_0x6a86('0x62')],_0xfd0df4,_0x57b29c[_0x6a86('0x64')],_0x57b29c[_0x6a86('0xba')],_0x57b29c[_0x6a86('0x177')],_0x57b29c['gosub'],'',_0x57b29c[_0x6a86('0x178')]]);if(_0x37544b[_0x6a86('0xa8')]===-0x1){return _0x37544b;}return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x16d'),_0x6a86('0x176'),_0x238b41));};AGIVertices[_0x6a86('0x12')][_0x6a86('0x179')]=function(_0x2f3113){logger['info'](util[_0x6a86('0x29')](_0x6a86('0x17a'),_0x2f3113[_0x6a86('0x35')]));var _0x3e82a4=_0x2f3113['recordingFormat']||_0x6a86('0x12e');var _0x43b59d=util[_0x6a86('0x29')]('%s_%s',this[_0x6a86('0x10')][_0x6a86('0x38')],rs['generate'](0x5));var _0x34cba7=util[_0x6a86('0x29')](_0x6a86('0x17b'),FILES_PATH,_0x43b59d,_0x3e82a4);var _0x25150a=util[_0x6a86('0x29')]('%s/recordings/%s',FILES_PATH,_0x43b59d);this[_0x6a86('0x37')][_0x6a86('0x70')](this,_0x2f3113,_0x43b59d,_0x34cba7);this[_0x6a86('0x10')][_0x6a86('0xa1')](_0x6a86('0x17c'),_0x43b59d);logger['info'](_0x6a86('0x17d'),_0x25150a,_0x3e82a4,_0x2f3113['escape_digits'],_0x2f3113[_0x6a86('0x64')]);return this[_0x6a86('0x10')]['recordFile'](_0x25150a,_0x3e82a4,_0x2f3113['escape_digits'],_0x2f3113[_0x6a86('0x64')],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x38fbf2){logger['info'](util[_0x6a86('0x29')](_0x6a86('0x17e'),_0x38fbf2[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x38fbf2[_0x6a86('0x62')])){return this['channel'][_0x6a86('0xae')](_0x6a86('0x17f'));}var _0x3b269e=this['restAPI'][_0x6a86('0x70')](this,_0x38fbf2);logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x180'),util[_0x6a86('0x181')](_0x3b269e,{'showHidden':![],'depth':null})));if(!this[_0x6a86('0x86')](_0x38fbf2[_0x6a86('0x112')])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0x182'));}var _0x195e94=this[_0x6a86('0x13')]['sync'](this,_0x38fbf2[_0x6a86('0x112')]);if(!_0x195e94){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x38fbf2,_0x6a86('0x117'));}this[_0x6a86('0x10')]['setVariable'](util['format'](_0x6a86('0x183'),_0x195e94),_0x3b269e[_0x6a86('0x75')]?_0x3b269e[_0x6a86('0x75')]:'200');this[_0x6a86('0x10')][_0x6a86('0xa1')](util[_0x6a86('0x29')](_0x6a86('0x184'),_0x195e94),_0x3b269e[_0x6a86('0x76')]?_0x3b269e['statusMessage']:'OK');if(_0x3b269e[_0x6a86('0x6a')]){try{this[_0x6a86('0x9f')](_0x3b269e[_0x6a86('0x6a')],_0x195e94);}catch(_0x122c54){logger['error'](util[_0x6a86('0x29')](_0x6a86('0x185'),_0x195e94));}}return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0xe2'),_0x195e94));};AGIVertices[_0x6a86('0x12')][_0x6a86('0x186')]=function(_0x342464){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x187'),_0x342464[_0x6a86('0x35')]));return this['channel'][_0x6a86('0x188')](_0x342464['digits'][_0x6a86('0x58')](/\s+/g,''),_0x342464[_0x6a86('0x189')]);};AGIVertices[_0x6a86('0x12')][_0x6a86('0x18a')]=function(_0x21c3d6){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x18b'),_0x21c3d6[_0x6a86('0x35')]));return this['channel'][_0x6a86('0x18c')](_0x21c3d6[_0x6a86('0x65')][_0x6a86('0x58')](/\s+/g,''),_0x21c3d6['escape_digits']);};AGIVertices['prototype']['sayphonetic']=function(_0x4820f8){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x18d'),_0x4820f8[_0x6a86('0x35')]));return this[_0x6a86('0x10')][_0x6a86('0x18e')](_0x4820f8['text'],_0x4820f8[_0x6a86('0x189')]);};AGIVertices[_0x6a86('0x12')][_0x6a86('0x18f')]=function(_0x309fc5){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x190'),_0x309fc5[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x309fc5[_0x6a86('0x191')])){return this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0x192'));}var _0x37cb21=this[_0x6a86('0x24')][_0x6a86('0x70')](this,_0x309fc5[_0x6a86('0x191')]);if(!_0x37cb21||!_0x37cb21[_0x6a86('0x193')]){return this[_0x6a86('0x10')]['error'](_0x309fc5,_0x6a86('0x194'));}var _0x75287f={'from':util[_0x6a86('0x29')](_0x6a86('0x195'),_0x37cb21['name'],_0x37cb21[_0x6a86('0x196')]||_0x37cb21[_0x6a86('0x193')][_0x6a86('0x197')]),'to':_0x309fc5['to']||'','cc':_0x309fc5['cc']||'','bcc':_0x309fc5['bcc']||'','subject':_0x309fc5['subject'],'html':_0x309fc5[_0x6a86('0x5a')],'text':_0x309fc5[_0x6a86('0x5a')]};if(this[_0x6a86('0x86')](_0x309fc5[_0x6a86('0x198')])){}logger['debug']('sendMail\x20message',JSON[_0x6a86('0x73')](_0x75287f));this['createSquareDetailsReport'][_0x6a86('0x70')](this,_0x309fc5,_0x309fc5['account_id']);this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x199'),_0x37cb21['name']));this[_0x6a86('0x26')][_0x6a86('0x70')](this,_0x37cb21[_0x6a86('0x19a')],_0x75287f);return this[_0x6a86('0x10')]['noop'](_0x6a86('0x19b'));};AGIVertices[_0x6a86('0x12')][_0x6a86('0x19c')]=function(_0x3c6207){logger[_0x6a86('0xb1')](util['format'](_0x6a86('0x19d'),_0x3c6207['label']));return this[_0x6a86('0x10')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x6a86('0x19e')]=function(_0x2a8e7c){logger['info'](util[_0x6a86('0x29')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x2a8e7c[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x2a8e7c[_0x6a86('0x19f')])){return this[_0x6a86('0x10')][_0x6a86('0xae')]('no\x20sms\x20account\x20configured');}var _0x2386e6=this['getSmsAccount'][_0x6a86('0x70')](this,_0x2a8e7c['sms_account_id']);if(!_0x2386e6){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x2a8e7c,_0x6a86('0x1a0'));}var _0x5d145d={'body':_0x2a8e7c['sms_text'],'phone':_0x2a8e7c['to']||'','SmsAccountId':_0x2386e6['id']};logger[_0x6a86('0x1a1')](_0x6a86('0x1a2'),JSON[_0x6a86('0x73')](_0x5d145d));this[_0x6a86('0x34')][_0x6a86('0x70')](this,_0x2a8e7c,_0x2a8e7c[_0x6a86('0x19f')]);this[_0x6a86('0x10')][_0x6a86('0xae')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x2386e6[_0x6a86('0x15')]));this[_0x6a86('0x33')][_0x6a86('0x70')](this,_0x5d145d);return this[_0x6a86('0x10')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x6a86('0x12')][_0x6a86('0x1a3')]=function(_0x449876){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x1a4'),_0x449876[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x449876[_0x6a86('0x112')])){return this['channel']['error'](_0x449876,'no\x20variable\x20selected');}var _0x1c13e6=this[_0x6a86('0x13')][_0x6a86('0x70')](this,_0x449876[_0x6a86('0x112')]);if(!_0x1c13e6){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x449876,'no\x20variable\x20found');}return this[_0x6a86('0x10')][_0x6a86('0xa1')](_0x1c13e6,_0x449876[_0x6a86('0x1a5')]);};AGIVertices[_0x6a86('0x12')][_0x6a86('0x1a6')]=function(_0x2ed393){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x1a7'),_0x2ed393[_0x6a86('0x35')]));this[_0x6a86('0x10')][_0x6a86('0xae')](_0x6a86('0x1a8'));if(_0x2ed393[_0x6a86('0xbe')]===_0x6a86('0x1a9')){this['channel'][_0x6a86('0xae')](_0x6a86('0x1aa'));return this[_0x6a86('0x10')][_0x6a86('0xbe')]();}return this['channel'][_0x6a86('0xae')]('Skipped\x20Answer');};AGIVertices[_0x6a86('0x12')]['subproject']=function(_0x25ee0a){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x1ab'),_0x25ee0a[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x25ee0a['project_id'])){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x25ee0a,_0x6a86('0x1ac'));}var _0x21c590=this[_0x6a86('0x1a')][_0x6a86('0x70')](this,_0x25ee0a[_0x6a86('0x1ad')]);if(!this[_0x6a86('0x86')](_0x21c590)){return this['channel'][_0x6a86('0x2c')](_0x25ee0a,util[_0x6a86('0x29')](_0x6a86('0x1ae'),_0x25ee0a['project_id']));}if(_0x21c590===this[_0x6a86('0x10')][_0x6a86('0x3e')]){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x25ee0a,_0x6a86('0x1af'));}this[_0x6a86('0x34')][_0x6a86('0x70')](this,_0x25ee0a,_0x21c590);var _0x190253=this[_0x6a86('0x10')][_0x6a86('0x56')]('AGI',util[_0x6a86('0x29')](_0x6a86('0x1b0'),config[_0x6a86('0xba')][_0x6a86('0x1b1')]||_0x6a86('0x1b2'),_0x21c590,this[_0x6a86('0x10')][_0x6a86('0x3e')]));if(_0x190253[_0x6a86('0xa8')]===-0x1){return _0x190253;}return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x16d'),_0x6a86('0x1b3'),_0x21c590));};AGIVertices[_0x6a86('0x12')][_0x6a86('0x1b4')]=function(_0x34226b){logger['info'](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x34226b[_0x6a86('0x35')]));var _0x72f334=this[_0x6a86('0x55')]['sync'](this,_0x34226b[_0x6a86('0xbc')]);this['createSquareDetailsReport'][_0x6a86('0x70')](this,_0x34226b,_0x34226b['command']);if(this[_0x6a86('0x86')](_0x34226b[_0x6a86('0x112')])){var _0x887d11=this[_0x6a86('0x13')][_0x6a86('0x70')](this,_0x34226b[_0x6a86('0x112')]);if(_0x887d11){this['channel'][_0x6a86('0xa1')](_0x887d11,_0x72f334);return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x34226b['command'],_0x887d11));}}return this['channel'][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x1b5'),_0x34226b[_0x6a86('0xbc')]));};AGIVertices[_0x6a86('0x12')]['google_cloud_tts']=function(_0x4e94c4){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x1b6'),_0x4e94c4['label']));_0x4e94c4['text']=_0x4e94c4[_0x6a86('0x5a')][_0x6a86('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6a86('0x86')](_0x4e94c4[_0x6a86('0x1b7')])){return this[_0x6a86('0x10')]['noop'](_0x6a86('0x1b8'));}if(!this['isConfigured'](_0x4e94c4[_0x6a86('0x5a')])){return this[_0x6a86('0x10')][_0x6a86('0xae')]('no\x20text\x20configured');}this[_0x6a86('0x10')]['noop'](util[_0x6a86('0x29')](_0x6a86('0x1b9'),_0x4e94c4[_0x6a86('0x5a')]));var _0x13539f=this[_0x6a86('0x59')][_0x6a86('0x70')](this,_0x4e94c4);if(_0x13539f){this['channel'][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x1ba'),_0x13539f));var _0x9fcf45=this[_0x6a86('0x10')][_0x6a86('0x104')](_0x13539f);try{fs['unlink'](_0x13539f+_0x6a86('0x154'));}catch(_0x1a9598){logger[_0x6a86('0x2c')](_0x1a9598);}return _0x9fcf45;}return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x4e94c4,_0x6a86('0x1bb'));};AGIVertices['prototype'][_0x6a86('0x1bc')]=function(_0x44b55a){logger[_0x6a86('0xb1')](util['format'](_0x6a86('0x1bd'),_0x44b55a[_0x6a86('0x35')]));_0x44b55a[_0x6a86('0x5a')]=_0x44b55a[_0x6a86('0x5a')][_0x6a86('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x44b55a[_0x6a86('0x5a')])){return this[_0x6a86('0x10')]['noop']('no\x20text\x20configured');}this[_0x6a86('0x10')]['noop'](util[_0x6a86('0x29')](_0x6a86('0x1be'),_0x44b55a[_0x6a86('0x5a')]));var _0x481e53=this['googleTTS'][_0x6a86('0x70')](this,_0x44b55a);if(_0x481e53){this[_0x6a86('0x10')][_0x6a86('0xae')](util['format'](_0x6a86('0x1bf'),_0x481e53));var _0x34b4fc=this['channel'][_0x6a86('0x104')](_0x481e53);try{fs[_0x6a86('0x123')](_0x481e53+_0x6a86('0x154'));}catch(_0x2a12a7){logger[_0x6a86('0x2c')](_0x2a12a7);}return _0x34b4fc;}return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x44b55a,_0x6a86('0x1c0'));};AGIVertices[_0x6a86('0x12')][_0x6a86('0x1c1')]=function(_0x153ce6){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x1c2'),_0x153ce6[_0x6a86('0x35')]));if(!this[_0x6a86('0x86')](_0x153ce6['findBy'])){return this[_0x6a86('0x10')][_0x6a86('0x2c')](_0x153ce6,_0x6a86('0x158'));}logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x159'),this['channel'][_0x6a86('0x36')],_0x153ce6[_0x6a86('0x157')]));var _0xa672a4=this['agentUnpause'][_0x6a86('0x70')](this,_0x153ce6[_0x6a86('0x157')]);if(_0xa672a4){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x6a86('0x10')][_0x6a86('0x36')],_0x153ce6[_0x6a86('0x157')]));this[_0x6a86('0x10')][_0x6a86('0xae')](util['format'](_0x6a86('0x15a'),this[_0x6a86('0x10')][_0x6a86('0x36')],_0x153ce6[_0x6a86('0x157')]));return{'code':0xc8,'result':_0x6a86('0x15b')};}else{logger[_0x6a86('0xb1')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x153ce6[_0x6a86('0x157')]));this[_0x6a86('0x10')][_0x6a86('0xae')](util['format'](_0x6a86('0x15c'),this['channel'][_0x6a86('0x36')],_0x153ce6[_0x6a86('0x157')]));return{'code':0xc8,'result':_0x6a86('0x15e')};}};AGIVertices['prototype'][_0x6a86('0x1c3')]=function(_0x4c3191){logger[_0x6a86('0xb1')](util[_0x6a86('0x29')](_0x6a86('0x1c4'),_0x4c3191['label']));var _0x1e905d=this['channel'][_0x6a86('0x56')]('VOICEMAIL',[_0x4c3191[_0x6a86('0x1c5')],_0x4c3191[_0x6a86('0x79')]]);if(_0x1e905d['result']===-0x1){return _0x1e905d;}return this[_0x6a86('0x10')][_0x6a86('0xae')](util[_0x6a86('0x29')](_0x6a86('0x16d'),_0x6a86('0x1c6'),_0x4c3191[_0x6a86('0x1c5')]));};AGIVertices['prototype']['vswitch']=function(_0x1527b8){logger[_0x6a86('0xb1')](util['format'](_0x6a86('0x1c7'),_0x1527b8['label']));if(!this[_0x6a86('0x86')](_0x1527b8[_0x6a86('0x112')])){return this[_0x6a86('0x10')]['error'](_0x1527b8,_0x6a86('0x1c8'));}var _0x2f07e3=this['getVariable'][_0x6a86('0x70')](this,_0x1527b8['variable_id']);if(!_0x2f07e3){return this['channel'][_0x6a86('0x2c')](_0x1527b8,'no\x20variable\x20found');}var _0x521e8b=this[_0x6a86('0x10')][_0x6a86('0x13')](_0x2f07e3);return{'code':0xc8,'result':_0x521e8b[_0x6a86('0xa6')]?_0x521e8b[_0x6a86('0xa6')]:'-'};};String[_0x6a86('0x12')][_0x6a86('0xa5')]=function(_0x40a506,_0x24af0d){return this['split'](_0x40a506)[_0x6a86('0x1c9')](_0x24af0d);};module[_0x6a86('0x1ca')]=AGIVertices; \ No newline at end of file +var _0x10b8=['agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','MALE','audioEncoding','googleTTS','restAPI','url','method','number','timeout','includes','POST','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','google_asr_language','tildeASR','uri','clear','hasOwnProperty','replaceAllVariables','isPlainObject','recursiveNodeIndex','isString','saveRestApiResult','%s.%s','length','setVariable','replaceObjectAllVariables','split','replaceAll','getVariable','extra','result','isConfigured','retry','maxRetry','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','MRCPRecog','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','getUser','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','variable_id','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','googleASR','GoogleASR\x20Result\x20%s','tildeasr','appid','no\x20appid\x20configured','TILDE_ASR_%s','gotoc','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','XMCS-QUEUE','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','inspect','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','START\x20CALLY\x20SQUARE','yes','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','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','then','getSquareOdbc','getSquareOdbcById','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agent','agentPause','agentUnpause','agentLogout'];(function(_0x2c30a3,_0x29ed5c){var _0x43e700=function(_0x150d64){while(--_0x150d64){_0x2c30a3['push'](_0x2c30a3['shift']());}};_0x43e700(++_0x29ed5c);}(_0x10b8,0x166));var _0x810b=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x10b8[_0x58e469];return _0x4c01c5;};'use strict';var fs=require('fs');var util=require(_0x810b('0x0'));var _=require(_0x810b('0x1'));var sh=require(_0x810b('0x2'));var odbc=require(_0x810b('0x3'))();var rs=require(_0x810b('0x4'));var moment=require(_0x810b('0x5'));var Mustache=require('mustache');var rp=require(_0x810b('0x6'));var logger=require(_0x810b('0x7'))(_0x810b('0x8'));var config=require('../../config/environment');var shared=require(_0x810b('0x9'));var scripts=require(_0x810b('0xa'));var FILES_PATH=_0x810b('0xb');var recursiveMapAttributes=[_0x810b('0xc'),_0x810b('0xd')];var verticesWithRetry=[_0x810b('0xe'),_0x810b('0xf'),'getsecretdigits'];var AGIVertices=function(_0x27e616,_0x5143bb,_0x2afe3e){this[_0x810b('0x10')]=_0x27e616;this[_0x810b('0x11')]=_0x5143bb;this[_0x810b('0x12')]=_0x2afe3e;};AGIVertices[_0x810b('0x13')]['getVariable']=function(_0x369da4,_0x316b17){this[_0x810b('0x11')][_0x810b('0x14')](_0x369da4)['then'](function(_0x37d408){_0x316b17(null,_0x37d408?_0x37d408[_0x810b('0x15')]:![]);})[_0x810b('0x16')](function(_0x2069a9){_0x316b17(_0x2069a9);});};AGIVertices[_0x810b('0x13')][_0x810b('0x17')]=function(_0x6c7789,_0xcdb5c2){this[_0x810b('0x11')][_0x810b('0x18')](_0x6c7789)['then'](function(_0x5cce48){_0xcdb5c2(null,_0x5cce48?_0x5cce48[_0x810b('0x15')]:![]);})[_0x810b('0x16')](function(_0x1f2d52){_0xcdb5c2(_0x1f2d52);});};AGIVertices[_0x810b('0x13')][_0x810b('0x19')]=function(_0x31bd51,_0x6370c){this[_0x810b('0x11')][_0x810b('0x1a')](_0x31bd51)[_0x810b('0x1b')](function(_0x4a31a6){_0x6370c(null,_0x4a31a6?_0x4a31a6[_0x810b('0x15')]:![]);})['catch'](function(_0x10753a){_0x6370c(_0x10753a);});};AGIVertices[_0x810b('0x13')][_0x810b('0x1c')]=function(_0x55ea1c,_0x350e1f){this['rpc'][_0x810b('0x1d')](_0x55ea1c)['then'](function(_0x2906df){_0x350e1f(null,_0x2906df?_0x2906df['dsn']:![]);})[_0x810b('0x16')](function(_0x24e74c){_0x350e1f(_0x24e74c);});};AGIVertices[_0x810b('0x13')]['getUser']=function(_0x1e3642,_0x483284){this[_0x810b('0x11')][_0x810b('0x1e')](_0x1e3642)[_0x810b('0x1b')](function(_0x4578a5){_0x483284(null,_0x4578a5?_0x4578a5['name']:![]);})[_0x810b('0x16')](function(_0x525277){_0x483284(_0x525277);});};AGIVertices[_0x810b('0x13')][_0x810b('0x1f')]=function(_0x37bed2,_0x41f542){this['rpc'][_0x810b('0x20')](_0x37bed2)['then'](function(_0x8fa638){_0x41f542(null,_0x8fa638?_0x8fa638[_0x810b('0x15')]:![]);})[_0x810b('0x16')](function(_0x550ab8){_0x41f542(_0x550ab8);});};AGIVertices[_0x810b('0x13')][_0x810b('0x21')]=function(_0x430a8e,_0x2e03a1){var _0x1e6ebf=this;this[_0x810b('0x11')]['getSoundById'](_0x430a8e)['then'](function(_0x190f9d){_0x2e03a1(null,_0x190f9d?_0x1e6ebf[_0x810b('0x22')](_0x190f9d[_0x810b('0x23')]):![]);})['catch'](function(_0x30ad99){_0x2e03a1(_0x30ad99);});};AGIVertices['prototype'][_0x810b('0x24')]=function(_0xa52aa8,_0x387221){this[_0x810b('0x11')][_0x810b('0x25')](_0xa52aa8)[_0x810b('0x1b')](function(_0x57d0bc){_0x387221(null,_0x57d0bc?_0x57d0bc:![]);})[_0x810b('0x16')](function(_0x57c7da){_0x387221(_0x57c7da);});};AGIVertices[_0x810b('0x13')][_0x810b('0x26')]=function(_0x450925,_0x551209,_0x41264c){this[_0x810b('0x12')]['sendMailMessage'](_0x450925,_0x551209)[_0x810b('0x1b')](function(){_0x41264c(null);})[_0x810b('0x16')](function(_0x1d2f45){_0x41264c(_0x1d2f45);});};AGIVertices['prototype'][_0x810b('0x27')]=function(_0x1009f7,_0x280089){this['rpc'][_0x810b('0x28')](_0x1009f7)['then'](function(_0xd35d3){if(_0xd35d3){if(_0xd35d3['IntervalId']){_0x280089(null,[_0xd35d3[_0x810b('0x29')]]);}else{_0x280089(null,_[_0x810b('0x2a')](_0xd35d3[_0x810b('0x2b')],'interval'));}}else{_0x280089(null,![]);}})[_0x810b('0x16')](function(_0x34494c){_0x280089(_0x34494c);});};AGIVertices[_0x810b('0x13')][_0x810b('0x22')]=function(_0x22a7c2){return util[_0x810b('0x2c')](_0x810b('0x2d'),FILES_PATH,_0x22a7c2);};AGIVertices[_0x810b('0x13')]['getQueryOdbc']=function(_0x4550f3,_0x3cdfa3,_0x3f06ab){odbc[_0x810b('0x2e')](_0x4550f3,function(_0x4cb58c){if(_0x4cb58c){logger[_0x810b('0x2f')](_0x810b('0x30'),_0x4cb58c);_0x3f06ab(_0x4cb58c);}else{logger[_0x810b('0x31')](_0x810b('0x32'));odbc[_0x810b('0x33')](_0x3cdfa3,function(_0x3759b3,_0x4dda6b){if(_0x3759b3){logger[_0x810b('0x31')](_0x810b('0x34'),_0x3cdfa3);_0x3f06ab(_0x3759b3);}else{logger[_0x810b('0x31')](_0x810b('0x35'),_0x3cdfa3);odbc[_0x810b('0x36')](function(_0x57876a){if(_0x57876a){logger['error'](_0x810b('0x37'),_0x57876a);}_0x3f06ab(null,_0x4dda6b);});}});}});};AGIVertices['prototype'][_0x810b('0x38')]=function(_0x1a2093,_0x39fa08){this[_0x810b('0x11')]['getSmsAccountById'](_0x1a2093)[_0x810b('0x1b')](function(_0x59bed3){_0x39fa08(null,_0x59bed3?_0x59bed3:![]);})[_0x810b('0x16')](function(_0x3cb4db){_0x39fa08(_0x3cb4db);});};AGIVertices[_0x810b('0x13')][_0x810b('0x39')]=function(_0x2537c9,_0x211534){this[_0x810b('0x11')][_0x810b('0x39')](_0x2537c9)['then'](function(_0x4c6e4d){_0x211534(null,_0x4c6e4d);})[_0x810b('0x16')](function(_0x2ece29){_0x211534(_0x2ece29);});};AGIVertices['prototype'][_0x810b('0x3a')]=function(_0x284260,_0x548d61,_0x2c1431){this['rpc'][_0x810b('0x3a')]({'uniqueid':this[_0x810b('0x10')][_0x810b('0x3b')],'node':_0x284260[_0x810b('0x3c')],'application':_0x284260[_0x810b('0x3d')],'data':_0x548d61||null,'project_name':this[_0x810b('0x10')][_0x810b('0x3e')],'callerid':this[_0x810b('0x10')][_0x810b('0x3f')]})[_0x810b('0x1b')](function(_0x3e0ba4){if(_0x2c1431){_0x2c1431(null,_0x3e0ba4);}})[_0x810b('0x16')](function(_0x15b3bc){if(_0x2c1431){_0x2c1431(_0x15b3bc);}});};AGIVertices['prototype'][_0x810b('0x40')]=function(_0x4b92ec,_0x1adc13,_0x40f397,_0x48e984){this[_0x810b('0x11')][_0x810b('0x40')]({'uniqueid':this[_0x810b('0x10')][_0x810b('0x3b')],'callerid':this[_0x810b('0x10')][_0x810b('0x3f')],'calleridname':this[_0x810b('0x10')][_0x810b('0x41')],'context':this[_0x810b('0x10')]['context'],'extension':this[_0x810b('0x10')][_0x810b('0x42')],'priority':this['channel'][_0x810b('0x43')],'accountcode':this[_0x810b('0x10')][_0x810b('0x44')],'dnid':this[_0x810b('0x10')][_0x810b('0x45')],'projectName':this[_0x810b('0x10')][_0x810b('0x3e')],'saveName':_0x1adc13,'filename':_0x4b92ec[_0x810b('0x46')]||_0x1adc13,'savePath':_0x40f397})[_0x810b('0x1b')](function(_0x1f9b67){_0x48e984(null,_0x1f9b67);})[_0x810b('0x16')](function(_0x5435af){_0x48e984(_0x5435af);});};AGIVertices['prototype'][_0x810b('0x47')]=function(_0x5521d2,_0x5bd0d6,_0x532a2a,_0x221a52,_0x2a7d43){this[_0x810b('0x11')][_0x810b('0x47')]({'uniqueid':this[_0x810b('0x10')][_0x810b('0x3b')],'body':_0x5521d2,'direction':_0x5bd0d6,'providerName':_0x532a2a,'providerResponse':_0x221a52})['then'](function(_0x190db4){if(_0x2a7d43){_0x2a7d43(null,_0x190db4);}})[_0x810b('0x16')](function(_0x7fb528){if(_0x2a7d43){_0x2a7d43(_0x7fb528);}});};AGIVertices[_0x810b('0x13')][_0x810b('0x48')]=function(_0x4eab6f,_0x1f1374){this['rpc'][_0x810b('0x48')]({'firstName':_[_0x810b('0x49')](_0x4eab6f[_0x810b('0x15')])||_[_0x810b('0x4a')](_0x4eab6f['name'])?'callback_'+Math[_0x810b('0x4b')]():_0x4eab6f['name'],'lastName':_[_0x810b('0x49')](_0x4eab6f[_0x810b('0x4c')])||_[_0x810b('0x4a')](_0x4eab6f[_0x810b('0x4c')])?null:_0x4eab6f[_0x810b('0x4c')],'phone':_0x4eab6f[_0x810b('0x4d')],'ListId':_0x4eab6f[_0x810b('0x4e')],'scheduledat':_0x4eab6f[_0x810b('0x4f')],'callbackUniqueid':this[_0x810b('0x10')][_0x810b('0x3b')],'tags':_0x810b('0x50'),'description':_0x810b('0x51')+_0x4eab6f[_0x810b('0x4f')][_0x810b('0x52')](),'priority':_0x4eab6f[_0x810b('0x53')]})[_0x810b('0x1b')](function(_0x41df97){_0x1f1374(null,_0x41df97);})['catch'](function(_0x4578ce){_0x1f1374(_0x4578ce);});};AGIVertices[_0x810b('0x13')]['getPause']=function(_0x338bf7,_0x47f186){this['rpc'][_0x810b('0x54')](_0x338bf7)[_0x810b('0x1b')](function(_0x464398){_0x47f186(null,_0x464398?_0x464398['name']:![]);})[_0x810b('0x16')](function(_0xd40678){_0x47f186(_0xd40678);});};AGIVertices[_0x810b('0x13')]['agentPause']=function(_0x4d5d62,_0x4a2022,_0x3209d7){var _0x335a2e={'role':_0x810b('0x55')};_0x335a2e[_0x4d5d62]=this['channel'][_0x810b('0x3f')];this[_0x810b('0x11')][_0x810b('0x56')](_0x335a2e,_0x4a2022,this[_0x810b('0x10')][_0x810b('0x3b')])['then'](function(_0x436d06){_0x3209d7(null,_['isNil'](_0x436d06)?![]:!![]);})[_0x810b('0x16')](function(_0x152068){logger[_0x810b('0x2f')](_0x152068);_0x3209d7(null,![]);});};AGIVertices[_0x810b('0x13')][_0x810b('0x57')]=function(_0x38b21f,_0x2def05){var _0x4c52c4={'role':'agent'};_0x4c52c4[_0x38b21f]=this[_0x810b('0x10')][_0x810b('0x3f')];this[_0x810b('0x11')][_0x810b('0x57')](_0x4c52c4)['then'](function(_0x248ae0){_0x2def05(null,_[_0x810b('0x4a')](_0x248ae0)?![]:!![]);})[_0x810b('0x16')](function(_0x4971fa){logger['error'](_0x4971fa);_0x2def05(null,![]);});};AGIVertices[_0x810b('0x13')][_0x810b('0x58')]=function(_0x9b5e85,_0x5f1aa0){var _0x1fbcf7={'role':'agent'};_0x1fbcf7[_0x9b5e85]=this[_0x810b('0x10')][_0x810b('0x3f')];this[_0x810b('0x11')][_0x810b('0x58')](_0x1fbcf7)[_0x810b('0x1b')](function(_0xbea50f){_0x5f1aa0(null,_['isNil'](_0xbea50f)?![]:!![]);})[_0x810b('0x16')](function(_0x27963e){logger[_0x810b('0x2f')](_0x27963e);_0x5f1aa0(null,![]);});};AGIVertices[_0x810b('0x13')][_0x810b('0x59')]=function(_0x3466d2,_0x3d4bf9){var _0x30ecb1={'role':_0x810b('0x55')};_0x30ecb1[_0x3466d2]=this[_0x810b('0x10')]['callerid'];var _0x3b2448=_0x3466d2!=_0x810b('0x5a')?util[_0x810b('0x2c')](_0x810b('0x5b'),_0x810b('0x5c'),this[_0x810b('0x10')]['callerid']):undefined;this[_0x810b('0x11')][_0x810b('0x59')](_0x30ecb1,_0x3b2448)[_0x810b('0x1b')](function(_0x44e575){_0x3d4bf9(null,_[_0x810b('0x4a')](_0x44e575)?![]:!![]);})['catch'](function(_0x1fccf1){logger['error'](_0x1fccf1);_0x3d4bf9(null,![]);});};AGIVertices[_0x810b('0x13')][_0x810b('0x5d')]=function(_0x5f4fc4,_0x2570cc){sh[_0x810b('0x5e')](_[_0x810b('0x5f')](_0x5f4fc4),function(_0x45a7b1,_0xae4433){var _0x28c79d=_0xae4433[_0x810b('0x60')](/(\r\n|\n|\r)/gm,'');_0x2570cc(null,_0x28c79d);});};AGIVertices['prototype'][_0x810b('0x61')]=function(_0x3d9d38,_0x62d3cd){scripts[_0x810b('0x61')](_0x3d9d38[_0x810b('0x62')],_0x3d9d38[_0x810b('0x63')]||'text',_0x3d9d38[_0x810b('0x64')],_0x3d9d38[_0x810b('0x65')]||'en-US',_0x3d9d38['ssmlGender']||_0x810b('0x66'),_0x3d9d38[_0x810b('0x67')]||'MP3')[_0x810b('0x1b')](function(_0x21ec90){_0x62d3cd(null,_0x21ec90);})[_0x810b('0x16')](function(_0x5178b1){_0x62d3cd(_0x5178b1);});};AGIVertices['prototype'][_0x810b('0x68')]=function(_0x459b4e,_0x1db8a6){scripts[_0x810b('0x68')](_0x459b4e[_0x810b('0x64')],_0x459b4e['google_tts_language']||'en',0x1)['then'](function(_0x5c8b33){_0x1db8a6(null,_0x5c8b33);})[_0x810b('0x16')](function(_0x1f91a0){_0x1db8a6(_0x1f91a0);});};AGIVertices[_0x810b('0x13')][_0x810b('0x69')]=function(_0x16a76f,_0x1bd0eb){var _0xcb2dc0={'uri':_0x16a76f[_0x810b('0x6a')],'method':_0x16a76f[_0x810b('0x6b')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x16a76f['timeout'])===_0x810b('0x6c')&&parseInt(_0x16a76f[_0x810b('0x6d')])>=0x1?parseInt(_0x16a76f['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x810b('0x6e')]([_0x810b('0x6f'),_0x810b('0x70')],_0xcb2dc0['method'][_0x810b('0x71')]())){try{_0xcb2dc0['body']=_0x16a76f['rawBody']?JSON[_0x810b('0x72')](_0x16a76f[_0x810b('0xd')]):{};}catch(_0x3b4ca7){logger['error'](_0x810b('0x73'),_0x3b4ca7);}}try{_0xcb2dc0[_0x810b('0x74')]=_0x16a76f[_0x810b('0xc')]?JSON[_0x810b('0x72')](_0x16a76f[_0x810b('0xc')]):{};}catch(_0xd98843){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0xd98843);}if(_0x16a76f[_0x810b('0x75')]){try{var _0x2de7ef=require(_0x16a76f[_0x810b('0x75')])[_0x810b('0x76')](this,_0xcb2dc0);_0xcb2dc0['uri']=Mustache[_0x810b('0x77')](_0x16a76f[_0x810b('0x6a')],_0x2de7ef,{},['$$','$$']);if(_0xcb2dc0[_0x810b('0x74')]){_0xcb2dc0[_0x810b('0x74')]=JSON[_0x810b('0x72')](Mustache[_0x810b('0x77')](JSON[_0x810b('0x78')](_0xcb2dc0[_0x810b('0x74')]),_0x2de7ef,{},['$$','$$']));}if(_0xcb2dc0['body']){_0xcb2dc0[_0x810b('0x79')]=JSON[_0x810b('0x72')](Mustache['render'](JSON[_0x810b('0x78')](_0xcb2dc0[_0x810b('0x79')]),_0x2de7ef,{},['$$','$$']));}}catch(_0x3dacce){logger['error'](_0x810b('0x7a'),_0x3dacce);}}rp(_0xcb2dc0)[_0x810b('0x1b')](function(_0x889321){var _0x46cc7a={'statusCode':_0x889321[_0x810b('0x7b')]||0xc8,'statusMessage':_0x889321[_0x810b('0x7c')]||'OK','headers':_0x889321[_0x810b('0x74')]||{},'body':_0x889321[_0x810b('0x79')]||{}};_0x1bd0eb(null,_0x46cc7a);})[_0x810b('0x16')](function(_0x20dedd){var _0x4c82d2={'statusCode':_0x20dedd[_0x810b('0x7b')]||0x1f4,'statusMessage':_0x20dedd[_0x810b('0x7d')]||_0x810b('0x7e'),'headers':_0x20dedd['options'][_0x810b('0x74')]||{},'body':_0x20dedd[_0x810b('0x7f')]['body']||{}};_0x1bd0eb(null,_0x4c82d2);});};AGIVertices[_0x810b('0x13')][_0x810b('0x80')]=function(_0x1385e7,_0x477fd8){scripts['googleDialogflow'](this['channel'][_0x810b('0x3b')],_0x1385e7[_0x810b('0x81')],_0x1385e7[_0x810b('0x64')],_0x1385e7[_0x810b('0x82')]||'en')[_0x810b('0x1b')](function(_0x3aea9b){_0x477fd8(null,_0x3aea9b);})[_0x810b('0x16')](function(_0x23551e){_0x477fd8(_0x23551e);});};AGIVertices[_0x810b('0x13')][_0x810b('0x83')]=function(_0x174316,_0x1356bb){scripts[_0x810b('0x83')](this[_0x810b('0x10')][_0x810b('0x3b')],_0x174316[_0x810b('0x84')],_0x174316['client_email'],_0x174316[_0x810b('0x85')],_0x174316[_0x810b('0x64')],_0x174316[_0x810b('0x86')]||'en')[_0x810b('0x1b')](function(_0x4a9581){_0x1356bb(null,_0x4a9581);})[_0x810b('0x16')](function(_0x593179){_0x1356bb(_0x593179);});};AGIVertices['prototype'][_0x810b('0x87')]=function(_0x3aa120,_0x543dc9){scripts[_0x810b('0x87')](this['channel'],_0x3aa120)[_0x810b('0x1b')](function(_0x54d74b){_0x543dc9(null,_0x54d74b);})[_0x810b('0x16')](function(_0x355899){_0x543dc9(_0x355899);});};AGIVertices['prototype'][_0x810b('0x88')]=function(_0x254d68,_0xf3850c){scripts[_0x810b('0x88')](_0x254d68['key'],_0x254d68[_0x810b('0x64')],_0x254d68[_0x810b('0x89')]||_0x810b('0x8a'),_0x254d68['speed'])[_0x810b('0x1b')](function(_0x2af984){_0xf3850c(null,_0x2af984);})['catch'](function(_0x1ff5c0){_0xf3850c(_0x1ff5c0);});};AGIVertices[_0x810b('0x13')][_0x810b('0x8b')]=function(_0x30982c,_0x4c6250,_0x2fbfff){scripts[_0x810b('0x8b')](_0x4c6250,_0x30982c[_0x810b('0x81')],_0x30982c[_0x810b('0x8c')]||_0x810b('0x8a'),this['isConfigured'](_0x30982c[_0x810b('0x8d')])?_0x30982c[_0x810b('0x8d')]:undefined)['then'](function(_0x3cdc44){_0x2fbfff(null,_0x3cdc44);})[_0x810b('0x16')](function(_0x59719d){_0x2fbfff(_0x59719d);});};AGIVertices['prototype'][_0x810b('0x8e')]=function(_0x3acb69,_0x2fc331){scripts['awsPolly'](_0x3acb69[_0x810b('0x8f')],_0x3acb69['aws_secret_access_key'],_0x3acb69[_0x810b('0x90')],_0x3acb69[_0x810b('0x91')]||'Amy',_0x3acb69[_0x810b('0x64')],_0x3acb69[_0x810b('0x92')]||'text')['then'](function(_0x2b824b){_0x2fc331(null,_0x2b824b);})[_0x810b('0x16')](function(_0x3ae52){_0x2fc331(_0x3ae52);});};AGIVertices['prototype'][_0x810b('0x93')]=function(_0x265312,_0x357c50){scripts[_0x810b('0x93')](this[_0x810b('0x10')][_0x810b('0x3b')],_0x265312[_0x810b('0x8f')],_0x265312[_0x810b('0x94')],_0x265312[_0x810b('0x95')],_0x265312[_0x810b('0x64')],_0x265312[_0x810b('0x96')])[_0x810b('0x1b')](function(_0x24228a){_0x357c50(null,_0x24228a);})[_0x810b('0x16')](function(_0xecbeab){_0x357c50(_0xecbeab);});};AGIVertices['prototype']['googleASR']=function(_0x27f28b,_0x516ad8,_0x4935b9){scripts['googleASR'](_0x516ad8,_0x27f28b['key'],_0x27f28b[_0x810b('0x97')]||_0x810b('0x8a'))[_0x810b('0x1b')](function(_0x1fe723){_0x4935b9(null,_0x1fe723);})[_0x810b('0x16')](function(_0x4dd346){_0x4935b9(_0x4dd346);});};AGIVertices[_0x810b('0x13')][_0x810b('0x98')]=function(_0x64717a,_0x2bdf9e,_0x4827e3){scripts[_0x810b('0x98')](_0x2bdf9e,_0x64717a['appid'],_0x64717a['appsecret'],_0x64717a[_0x810b('0x99')])[_0x810b('0x1b')](function(_0x55289a){_0x4827e3(null,_0x55289a);})[_0x810b('0x16')](function(_0x16db9b){_0x4827e3(_0x16db9b);});};AGIVertices[_0x810b('0x13')][_0x810b('0x9a')]=function(_0x211a3c){var _0x20c567=_[_0x810b('0x6e')](verticesWithRetry,_0x211a3c[_0x810b('0x3d')])?_0x211a3c:_['clone'](_0x211a3c);for(var _0x4926f8 in _0x20c567){if(_0x20c567[_0x810b('0x9b')](_0x4926f8)){if(_0x20c567[_0x4926f8]&&_['isString'](_0x20c567[_0x4926f8])){if(_[_0x810b('0x6e')](recursiveMapAttributes,_0x4926f8)){_0x20c567[_0x4926f8]=this['replaceObjectAllVariables'](_0x20c567[_0x4926f8]);}else{_0x20c567[_0x4926f8]=this[_0x810b('0x9c')](_0x20c567[_0x4926f8]);}}}}return _0x20c567;};AGIVertices[_0x810b('0x13')]['recursiveNodeIndex']=function(_0x210847){for(var _0x1fe365 in _0x210847){if(_0x210847['hasOwnProperty'](_0x1fe365)){if(_[_0x810b('0x9d')](_0x210847[_0x1fe365])){this[_0x810b('0x9e')](_0x210847[_0x1fe365]);}else if(_['isArray'](_0x210847[_0x1fe365])){for(var _0x552b6c=0x0;_0x552b6c<_0x210847[_0x1fe365]['length'];_0x552b6c++){this[_0x810b('0x9e')](_0x210847[_0x1fe365][_0x552b6c]);}}else if(_[_0x810b('0x9f')](_0x210847[_0x1fe365])){_0x210847[_0x1fe365]=this[_0x810b('0x9c')](_0x210847[_0x1fe365]);}}}};AGIVertices[_0x810b('0x13')][_0x810b('0xa0')]=function(_0x20019f,_0x169575){for(var _0x3dc0d0 in _0x20019f){if(_0x20019f[_0x810b('0x9b')](_0x3dc0d0)){if(_[_0x810b('0x9d')](_0x20019f[_0x3dc0d0])){if(!_[_0x810b('0x49')](_0x20019f[_0x3dc0d0])){this[_0x810b('0xa0')](_0x20019f[_0x3dc0d0],util[_0x810b('0x2c')](_0x810b('0xa1'),_0x169575,_0x3dc0d0));}}else if(_['isArray'](_0x20019f[_0x3dc0d0])){for(var _0x158b09=0x0;_0x158b09<_0x20019f[_0x3dc0d0][_0x810b('0xa2')];_0x158b09++){this[_0x810b('0xa0')](_0x20019f[_0x3dc0d0][_0x158b09],util[_0x810b('0x2c')](_0x810b('0xa1'),_0x169575,_0x3dc0d0+'['+_0x158b09+']'));}}else{if(!_[_0x810b('0x4a')](_0x20019f[_0x3dc0d0])){this[_0x810b('0x10')][_0x810b('0xa3')](util[_0x810b('0x2c')](_0x810b('0xa1'),_0x169575,_0x3dc0d0),_0x20019f[_0x3dc0d0]);}}}}};AGIVertices[_0x810b('0x13')][_0x810b('0xa4')]=function(_0x3e2153){try{var _0xbe78ac=JSON[_0x810b('0x72')](_0x3e2153);this['recursiveNodeIndex'](_0xbe78ac);return JSON['stringify'](_0xbe78ac);}catch(_0x46e875){return this[_0x810b('0x9c')](_0x3e2153);}};AGIVertices[_0x810b('0x13')]['replaceAllVariables']=function(_0x1d4537){var _0x3263bd=_0x1d4537[_0x810b('0xa5')]('{');for(var _0x110c0a=0x1;_0x110c0a<_0x3263bd[_0x810b('0xa2')];_0x110c0a+=0x1){var _0x589aae=_0x3263bd[_0x110c0a][_0x810b('0xa5')]('}');if(_0x589aae['length']>0x1){_0x1d4537=_0x1d4537[_0x810b('0xa6')]('{'+_0x589aae[0x0]+'}',this[_0x810b('0x10')][_0x810b('0xa7')](_0x589aae[0x0])[_0x810b('0xa8')]||_0x589aae[0x0]);}}if(_0x3263bd[_0x810b('0xa2')]===0x1){return _0x1d4537[_0x810b('0x52')]();}return this[_0x810b('0x9c')](_0x1d4537);};AGIVertices[_0x810b('0x13')]['getAndSetVariable']=function(_0x247183,_0x19cceb){var _0x3077ba=this['channel'][_0x810b('0xa7')](_0x247183);if(_0x3077ba[_0x810b('0xa9')]===-0x1){return _0x3077ba;}logger[_0x810b('0x31')](util[_0x810b('0x2c')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x19cceb,_0x3077ba[_0x810b('0xa8')]));return this[_0x810b('0x10')][_0x810b('0xa3')](_0x19cceb,_0x3077ba[_0x810b('0xa8')]);};AGIVertices[_0x810b('0x13')][_0x810b('0xaa')]=function(_0x815562){return _0x815562&&_0x815562!=='0'&&_0x815562!=='-1'&&_0x815562!=='';};AGIVertices[_0x810b('0x13')]['maxRetry']=function(_0x5a7170){this[_0x810b('0x3a')]['sync'](this,_0x5a7170,'-');_0x5a7170[_0x810b('0xab')]=_0x5a7170[_0x810b('0xac')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x810b('0x13')]['mrcpsynth']=function(_0x50a34c){logger[_0x810b('0x31')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x50a34c[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x50a34c[_0x810b('0x64')])){return this['channel'][_0x810b('0xad')](_0x810b('0xae'));}var _0x286953='\x22'+_0x50a34c[_0x810b('0x64')]+'\x22';if(this[_0x810b('0xaa')](_0x50a34c['options'])){_0x286953+=','+_0x50a34c[_0x810b('0x7f')];}var _0x422ef3=this[_0x810b('0x10')][_0x810b('0x5e')](_0x810b('0xaf'),_0x286953);if(_0x422ef3['result']===-0x1){return _0x422ef3;}return this[_0x810b('0x10')]['noop'](util[_0x810b('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x286953));};AGIVertices[_0x810b('0x13')][_0x810b('0xb0')]=function(_0x5d7800){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0xb1'),_0x5d7800['label']));if(!this[_0x810b('0xaa')](_0x5d7800[_0x810b('0xb2')])){return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0xb3'));}var _0x3e415a=_0x5d7800['grammar'];if(this[_0x810b('0xaa')](_0x5d7800[_0x810b('0x7f')])){_0x3e415a+=','+_0x5d7800[_0x810b('0x7f')];}var _0x2d06e6=this[_0x810b('0x10')][_0x810b('0x5e')]('MRCPRecog',_0x3e415a);if(_0x2d06e6[_0x810b('0xa9')]===-0x1){return _0x2d06e6;}var _0x2f73cc=this['getAndSetVariable'](_0x810b('0xb4'),_0x810b('0xb5'));if(_0x2f73cc[_0x810b('0xa9')]===-0x1){return _0x2f73cc;}var _0x23dce1=this[_0x810b('0xb6')](_0x810b('0xb7'),_0x810b('0xb8'));if(_0x23dce1[_0x810b('0xa9')]===-0x1){return _0x23dce1;}var _0x2f6db9=this[_0x810b('0xb6')](_0x810b('0xb9'),_0x810b('0xba'));if(_0x2f6db9[_0x810b('0xa9')]===-0x1){return _0x2f6db9;}return this[_0x810b('0x10')][_0x810b('0xad')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x3e415a));};AGIVertices['prototype'][_0x810b('0x8')]=function(_0x76c490){logger['info'](util[_0x810b('0x2c')](_0x810b('0xbb'),_0x76c490['label']));return this[_0x810b('0x10')][_0x810b('0x8')]([_0x76c490[_0x810b('0xbc')],_0x76c490[_0x810b('0xbd')]]);};AGIVertices[_0x810b('0x13')][_0x810b('0xbe')]=function(_0x2737ef){logger['info'](util[_0x810b('0x2c')](_0x810b('0xbf'),_0x2737ef[_0x810b('0x3c')]));if(this[_0x810b('0xaa')](_0x2737ef[_0x810b('0x6d')])){logger[_0x810b('0x31')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x2737ef[_0x810b('0x6d')]));var _0x2d84f4=this[_0x810b('0x10')][_0x810b('0xc0')](_0x2737ef[_0x810b('0x6d')]);if(_0x2d84f4[_0x810b('0xa9')]===-0x1){return _0x2d84f4;}}return this[_0x810b('0x10')][_0x810b('0xbe')]();};AGIVertices[_0x810b('0x13')]['callback']=function(_0x388465){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0xc1'),_0x388465[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x388465[_0x810b('0x4e')])){return this['channel'][_0x810b('0x2f')](_0x388465,_0x810b('0xc2'));}_0x388465[_0x810b('0x4f')]=moment();if(this[_0x810b('0xaa')](_0x388465[_0x810b('0xc3')])){_0x388465[_0x810b('0x4f')]=moment()['add'](_0x388465[_0x810b('0xc3')],_0x810b('0xc4'));}if(!this[_0x810b('0xaa')](_0x388465[_0x810b('0x53')])){_0x388465[_0x810b('0x53')]=0x2;}this[_0x810b('0x48')]['sync'](this,_0x388465);return this['channel']['noop'](util[_0x810b('0x2c')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x388465['phone'],_0x388465['list_id'],_0x388465['scheduledAt']));};AGIVertices[_0x810b('0x13')][_0x810b('0xc5')]=function(_0x1b5e3c){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0xc6'),_0x1b5e3c[_0x810b('0x3c')]));var _0x268857=this[_0x810b('0x10')][_0x810b('0x5e')](_0x1b5e3c[_0x810b('0xc7')],_0x1b5e3c['options']);if(_0x268857['result']===-0x1){return _0x268857;}return this[_0x810b('0x10')]['noop'](util[_0x810b('0x2c')](_0x810b('0xc8'),_0x1b5e3c[_0x810b('0xc7')],_0x1b5e3c[_0x810b('0x7f')]));};AGIVertices[_0x810b('0x13')]['lumenvoxtts']=function(_0x5a25ec){logger[_0x810b('0x31')](util['format'](_0x810b('0xc9'),_0x5a25ec[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x5a25ec[_0x810b('0x64')])){return this[_0x810b('0x10')][_0x810b('0xad')]('no\x20text\x20configured');}var _0x41a459='\x22'+_0x5a25ec[_0x810b('0x64')]+'\x22';if(this['isConfigured'](_0x5a25ec['options'])){_0x41a459+=','+_0x5a25ec['options'];}var _0x3eb324=this[_0x810b('0x10')][_0x810b('0x5e')](_0x810b('0xaf'),_0x41a459);if(_0x3eb324[_0x810b('0xa9')]===-0x1){return _0x3eb324;}return this[_0x810b('0x10')]['noop'](util[_0x810b('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x41a459));};AGIVertices[_0x810b('0x13')]['sestektts']=function(_0x374669){logger['info'](util[_0x810b('0x2c')](_0x810b('0xca'),_0x374669[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x374669[_0x810b('0x64')])){return this['channel'][_0x810b('0xad')](_0x810b('0xae'));}var _0x17c759='\x22'+_0x374669['text']+'\x22';if(this[_0x810b('0xaa')](_0x374669[_0x810b('0x7f')])){_0x17c759+=','+_0x374669[_0x810b('0x7f')];}var _0x416eb9=this['channel'][_0x810b('0x5e')](_0x810b('0xaf'),_0x17c759);if(_0x416eb9[_0x810b('0xa9')]===-0x1){return _0x416eb9;}return this['channel'][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0xcb'),_0x17c759));};AGIVertices[_0x810b('0x13')]['lumenvoxasr']=function(_0x26504f){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x26504f[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x26504f[_0x810b('0xb2')])){return this['channel'][_0x810b('0xad')](_0x810b('0xb3'));}var _0x189aee=_0x26504f['grammar'];if(this['isConfigured'](_0x26504f[_0x810b('0x7f')])){_0x189aee+=','+_0x26504f[_0x810b('0x7f')];}var _0x354b5b=this[_0x810b('0x10')]['exec'](_0x810b('0xcc'),_0x189aee);if(_0x354b5b[_0x810b('0xa9')]===-0x1){return _0x354b5b;}var _0x3bf0c7=this[_0x810b('0xb6')](_0x810b('0xb4'),'LUMENVOX_ASR_CONFIDENCE');if(_0x3bf0c7['result']===-0x1){return _0x3bf0c7;}var _0x454033=this[_0x810b('0xb6')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x454033['result']===-0x1){return _0x454033;}var _0x4a986d=this[_0x810b('0xb6')](_0x810b('0xb9'),_0x810b('0xcd'));if(_0x4a986d[_0x810b('0xa9')]===-0x1){return _0x4a986d;}return this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')]('Executed\x20command\x20MRCPRecog\x20%s',_0x189aee));};AGIVertices[_0x810b('0x13')][_0x810b('0xce')]=function(_0xf1bc0e){logger[_0x810b('0x31')](util['format'](_0x810b('0xcf'),_0xf1bc0e[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0xf1bc0e[_0x810b('0xb2')])){return this[_0x810b('0x10')]['noop'](_0x810b('0xb3'));}var _0x67e0eb=_0xf1bc0e[_0x810b('0xb2')];if(this[_0x810b('0xaa')](_0xf1bc0e[_0x810b('0x7f')])){_0x67e0eb+=','+_0xf1bc0e[_0x810b('0x7f')];}var _0x2d3ed6=this[_0x810b('0x10')][_0x810b('0x5e')](_0x810b('0xcc'),_0x67e0eb);if(_0x2d3ed6['result']===-0x1){return _0x2d3ed6;}var _0x685832=this[_0x810b('0xb6')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x685832[_0x810b('0xa9')]===-0x1){return _0x685832;}var _0x20a214=this[_0x810b('0xb6')](_0x810b('0xb7'),_0x810b('0xd0'));if(_0x20a214[_0x810b('0xa9')]===-0x1){return _0x20a214;}var _0x158dcc=this[_0x810b('0xb6')]('RECOG_INSTANCE()',_0x810b('0xd1'));if(_0x158dcc['result']===-0x1){return _0x158dcc;}return this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')]('Executed\x20command\x20MRCPRecog\x20%s',_0x67e0eb));};AGIVertices[_0x810b('0x13')][_0x810b('0xd2')]=function(_0x4a2daf){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x4a2daf[_0x810b('0x3c')]));if(!this['isConfigured'](_0x4a2daf[_0x810b('0xd3')])){return this['channel']['error'](_0x4a2daf,'no\x20database\x20selected');}var _0x5b834a=this['getSquareOdbc'][_0x810b('0x76')](this,_0x4a2daf[_0x810b('0xd3')]);if(!_0x5b834a){return this[_0x810b('0x10')]['error'](_0x4a2daf,_0x810b('0xd4'));}if(!this[_0x810b('0xaa')](_0x4a2daf[_0x810b('0x33')])){return this['channel']['error'](_0x4a2daf,_0x810b('0xd5'));}var _0x2146ee=_0x4a2daf['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x810b('0x10')][_0x810b('0xad')](util['format'](_0x810b('0xd6'),_0x2146ee));var _0x2b78f6=this['getQueryOdbc']['sync'](this,_0x5b834a,_0x2146ee);this[_0x810b('0x3a')][_0x810b('0x76')](this,_0x4a2daf,_0x2146ee);if(!this[_0x810b('0xaa')](_0x4a2daf['variable_id'])){return this[_0x810b('0x10')]['noop'](_0x810b('0xd7'));}var _0x4ce4d8=this[_0x810b('0xa7')]['sync'](this,_0x4a2daf['variable_id']);if(!_0x4ce4d8){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x4a2daf,_0x810b('0xd8'));}var _0x9669e1=this;_0x2b78f6[_0x810b('0xd9')](function(_0x4bc7ac,_0x43f8b3){Object[_0x810b('0xda')](_0x4bc7ac)[_0x810b('0xd9')](function(_0x3b4f6c){_0x9669e1[_0x810b('0x10')]['setVariable'](util[_0x810b('0x2c')](_0x810b('0xdb'),_0x4ce4d8,_0x43f8b3,_0x3b4f6c),_0x4bc7ac[_0x3b4f6c]);});});this[_0x810b('0x10')]['setVariable'](util[_0x810b('0x2c')](_0x810b('0xdc'),_0x4ce4d8),_0x2b78f6[_0x810b('0xa2')]);return this[_0x810b('0x10')]['noop'](util[_0x810b('0x2c')](_0x810b('0xdd'),_0x4ce4d8));};AGIVertices[_0x810b('0x13')][_0x810b('0xde')]=function(_0x40e40c){logger[_0x810b('0xdf')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x40e40c[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x40e40c[_0x810b('0xe0')])){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x40e40c,_0x810b('0xe1'));}var _0x2660fa=this[_0x810b('0xe2')][_0x810b('0x76')](this,_0x40e40c[_0x810b('0xe0')]);if(!_0x2660fa){return this['channel']['error'](_0x40e40c,'no\x20user\x20found');}var _0x20cd0c=this[_0x810b('0x10')]['exec'](_0x810b('0xe3'),[util[_0x810b('0x2c')](_0x810b('0xe4'),_0x2660fa),_0x40e40c[_0x810b('0x6d')],_0x40e40c[_0x810b('0xe5')],_0x40e40c[_0x810b('0x6a')]]);if(_0x20cd0c[_0x810b('0xa9')]===-0x1){return _0x20cd0c;}return this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0xe6'),'DIAL'));};AGIVertices['prototype'][_0x810b('0xe7')]=function(_0xa655ed){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0xe8'),_0xa655ed[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0xa655ed[_0x810b('0x81')])){return this[_0x810b('0x10')][_0x810b('0xad')]('no\x20key\x20configured');}if(!this[_0x810b('0xaa')](_0xa655ed[_0x810b('0x64')])){return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0xae'));}this[_0x810b('0x10')]['bot']=!![];this['createSquareDetailsReport'](_0xa655ed);this[_0x810b('0x47')](_0xa655ed['text'],'in','','');this[_0x810b('0x10')]['noop'](util['format'](_0x810b('0xe9'),_0xa655ed[_0x810b('0x64')]));var _0x33cfbd=this[_0x810b('0x80')]['sync'](this,_0xa655ed);if(_0x33cfbd){for(var _0x25149a in _0x33cfbd){if(_0x33cfbd[_0x810b('0x9b')](_0x25149a)){this[_0x810b('0x10')][_0x810b('0xa3')](util[_0x810b('0x2c')](_0x810b('0xea'),_0x25149a['toUpperCase']()),_0x33cfbd[_0x25149a]);}}this[_0x810b('0x47')](_0x33cfbd[_0x810b('0xeb')],_0x810b('0xec'),_0x810b('0xe7'),'');return this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0xed'),_0x33cfbd[_0x810b('0xeb')]));}return this[_0x810b('0x10')]['error'](_0xa655ed,_0x810b('0xee'));};AGIVertices[_0x810b('0x13')][_0x810b('0xef')]=function(_0x5888ba){logger['info'](util[_0x810b('0x2c')](_0x810b('0xf0'),_0x5888ba[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x5888ba['dialogflowV2_project_id'])){return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0xf1'));}if(!this[_0x810b('0xaa')](_0x5888ba[_0x810b('0xf2')])){return this[_0x810b('0x10')]['noop']('no\x20client_email\x20configured');}if(!this[_0x810b('0xaa')](_0x5888ba['private_key'])){return this[_0x810b('0x10')][_0x810b('0xad')]('no\x20private_key\x20configured');}if(!this[_0x810b('0xaa')](_0x5888ba[_0x810b('0x86')])){return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0xf3'));}if(!this['isConfigured'](_0x5888ba[_0x810b('0x64')])){return this[_0x810b('0x10')][_0x810b('0xad')]('no\x20text\x20configured');}this[_0x810b('0x10')][_0x810b('0xf4')]=!![];this[_0x810b('0x3a')](_0x5888ba);this[_0x810b('0x47')](_0x5888ba['text'],'in','','');this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0xf5'),_0x5888ba[_0x810b('0x64')]));var _0x5970ba=this[_0x810b('0x83')][_0x810b('0x76')](this,_0x5888ba);if(_0x5970ba){for(var _0x315cc8 in _0x5970ba){if(_0x5970ba['hasOwnProperty'](_0x315cc8)){if(_0x315cc8!==_0x810b('0xf6')){this['channel']['setVariable'](util['format'](_0x810b('0xea'),_0x315cc8[_0x810b('0x71')]()),_0x5970ba[_0x315cc8]);}}}this[_0x810b('0x47')](_0x5970ba['speech'],_0x810b('0xec'),_0x810b('0xef'),_0x5970ba[_0x810b('0xf6')]);return this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0xf7'),_0x5970ba[_0x810b('0xeb')]));}return this['channel'][_0x810b('0x2f')](_0x5888ba,_0x810b('0xf8'));};AGIVertices[_0x810b('0x13')][_0x810b('0xf9')]=function(_0x1d8fcf){logger[_0x810b('0x31')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x1d8fcf[_0x810b('0x3c')]));if(!this['isConfigured'](_0x1d8fcf[_0x810b('0xfa')])){return this[_0x810b('0x10')]['noop'](_0x810b('0xfb'));}if(!this['isConfigured'](_0x1d8fcf['username'])){return this[_0x810b('0x10')]['noop'](_0x810b('0xfc'));}if(!this['isConfigured'](_0x1d8fcf['password'])){return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0xfd'));}if(!this[_0x810b('0xaa')](_0x1d8fcf[_0x810b('0xfe')])){return this[_0x810b('0x10')]['noop'](_0x810b('0xae'));}this[_0x810b('0x10')][_0x810b('0xf4')]=!![];this[_0x810b('0x3a')](_0x1d8fcf);this[_0x810b('0x47')](_0x1d8fcf[_0x810b('0x64')],'in','','');this[_0x810b('0x10')]['noop'](util[_0x810b('0x2c')]('Trying\x20SestekNDA:\x20%s',_0x1d8fcf['text']));var _0x6674d9=this['sestekNDA'][_0x810b('0x76')](this,_0x1d8fcf);if(_0x6674d9){for(var _0x71bbcd in _0x6674d9){if(_0x6674d9['hasOwnProperty'](_0x71bbcd)){this[_0x810b('0x10')][_0x810b('0xa3')](util['format'](_0x810b('0xff'),_0x71bbcd[_0x810b('0x71')]()),_0x6674d9[_0x71bbcd]);}}this[_0x810b('0x47')](_0x6674d9['speech'],_0x810b('0xec'),_0x810b('0xf9'),'');if(_0x6674d9[_0x810b('0x100')]){this[_0x810b('0x10')]['noop'](util['format'](_0x810b('0x101'),_0x6674d9[_0x810b('0x100')]));var _0x1bb348=this['channel'][_0x810b('0x102')](_0x6674d9[_0x810b('0x100')]);try{fs[_0x810b('0x103')](_0x6674d9[_0x810b('0x100')]+_0x810b('0x104'));}catch(_0x495d0a){logger[_0x810b('0x2f')](_0x495d0a);}return _0x1bb348;}else{return this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x105'),_0x6674d9[_0x810b('0xeb')]));}}return this[_0x810b('0x10')][_0x810b('0x2f')](_0x1d8fcf,_0x810b('0x106'));};AGIVertices[_0x810b('0x13')][_0x810b('0x107')]=function(_0x265980){logger['info'](util[_0x810b('0x2c')](_0x810b('0x108'),_0x265980['label']));return this['channel'][_0x810b('0xad')](_0x810b('0x107'));};AGIVertices['prototype'][_0x810b('0x109')]=function(_0x52ec1b){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x10a'),_0x52ec1b['label']));var _0x25ed4e='';if(_0x52ec1b[_0x810b('0x10b')]){if(!this[_0x810b('0xaa')](_0x52ec1b[_0x810b('0x10b')])){return this[_0x810b('0x10')]['error'](_0x52ec1b,_0x810b('0x10c'));}else{var _0x3052fb=parseInt(_0x52ec1b[_0x810b('0x10b')],0xa);if(isNaN(_0x3052fb)){_0x25ed4e=_0x52ec1b[_0x810b('0x10b')];}else{_0x25ed4e=this[_0x810b('0x1f')][_0x810b('0x76')](this,_0x52ec1b[_0x810b('0x10b')]);if(!_0x25ed4e){return this['channel'][_0x810b('0x2f')](_0x52ec1b,_0x810b('0x10d'));}}}}else if(_0x52ec1b[_0x810b('0x10e')]){_0x25ed4e=_0x52ec1b[_0x810b('0x10e')];}else{return this[_0x810b('0x10')][_0x810b('0x2f')](_0x52ec1b,_0x810b('0x10c'));}var _0x198d60=this[_0x810b('0x10')]['exec'](_0x810b('0xe3'),[util['format']('SIP/%s/%s',_0x25ed4e,_0x52ec1b['phone']),_0x52ec1b[_0x810b('0x6d')],_0x52ec1b[_0x810b('0xe5')],_0x52ec1b[_0x810b('0x6a')]]);if(_0x198d60['result']===-0x1){return _0x198d60;}return this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')]('Executed\x20command\x20%s',_0x810b('0xe3')));};AGIVertices[_0x810b('0x13')][_0x810b('0x10f')]=function(_0x3e4c52){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x3e4c52[_0x810b('0x3c')]));return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0x10f'));};AGIVertices[_0x810b('0x13')]['getdigits']=function(_0x342190){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x342190[_0x810b('0x3c')]));if(_0x342190[_0x810b('0xab')]===0x0){return this['maxRetry'](_0x342190);}_0x342190[_0x810b('0xab')]-=0x1;if(!this[_0x810b('0xaa')](_0x342190[_0x810b('0x110')])){return this[_0x810b('0x10')]['error'](_0x342190,_0x810b('0x111'));}var _0x393214=this[_0x810b('0x21')][_0x810b('0x76')](this,_0x342190[_0x810b('0x110')]);if(!_0x393214){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x342190,_0x810b('0x112'));}if(!this['isConfigured'](_0x342190[_0x810b('0x113')])){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x810b('0xd7'));}var _0xe62313=this[_0x810b('0x10')]['getData'](_0x393214,_0x342190[_0x810b('0x114')],_0x342190[_0x810b('0x115')]);var _0x23c1b4=_0xe62313[_0x810b('0xa9')]?_0xe62313[_0x810b('0xa9')]['toString']():'';logger[_0x810b('0x31')](_0x810b('0x116'),JSON[_0x810b('0x78')](_0xe62313));if(_0xe62313[_0x810b('0xa9')]===-0x1){this[_0x810b('0x3a')][_0x810b('0x76')](this,_0x342190,_0x23c1b4);return _0xe62313;}else if(_0xe62313[_0x810b('0xa8')]===_0x810b('0x6d')){_0xe62313['result']=_0x23c1b4[_0x810b('0xa2')]>=parseInt(_0x342190[_0x810b('0x117')])?'x':'i';}else{_0xe62313[_0x810b('0xa9')]=_0x23c1b4[_0x810b('0xa2')]>=parseInt(_0x342190[_0x810b('0x117')])&&_0x23c1b4['length']<=parseInt(_0x342190[_0x810b('0x115')])?'x':'i';}var _0x5ece8c=this[_0x810b('0xa7')][_0x810b('0x76')](this,_0x342190[_0x810b('0x113')]);if(!_0x5ece8c){return this['channel'][_0x810b('0x2f')](_0x342190,_0x810b('0xd8'));}this['channel']['setVariable'](_0x5ece8c,_0x23c1b4);if(this['isConfigured'](_0x342190[_0x810b('0x118')])){var _0x3d1d22=parseInt(_0x342190[_0x810b('0x118')],0xa);var _0x5d18c7=rs['generate']({'charset':'*','length':_0x3d1d22});var _0x527280=_0x23c1b4[_0x810b('0xa2')];if(_0x527280>0x0){if(_0x527280>_0x3d1d22){this[_0x810b('0x3a')][_0x810b('0x76')](this,_0x342190,_0x342190[_0x810b('0x119')]===_0x810b('0x11a')?_0x5d18c7+_0x23c1b4[_0x810b('0x11b')](_0x3d1d22):_0x23c1b4[_0x810b('0x11b')](0x0,_0x527280-_0x3d1d22)+_0x5d18c7);}else{this[_0x810b('0x3a')][_0x810b('0x76')](this,_0x342190,rs[_0x810b('0x11c')]({'charset':'*','length':_0x527280}));}}else{this[_0x810b('0x3a')][_0x810b('0x76')](this,_0x342190,'');}}else{this[_0x810b('0x3a')][_0x810b('0x76')](this,_0x342190,_0x23c1b4);}return _0xe62313;};AGIVertices[_0x810b('0x13')][_0x810b('0x11d')]=function(_0x35eee3){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x11e'),_0x35eee3[_0x810b('0x3c')]));return this[_0x810b('0xf')](_0x35eee3);};AGIVertices[_0x810b('0x13')]['goal']=function(_0x2cd05b){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x2cd05b[_0x810b('0x3c')]));this[_0x810b('0x3a')][_0x810b('0x76')](this,_0x2cd05b,_0x2cd05b['goalname']);return this['channel'][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x11f'),_0x2cd05b[_0x810b('0x120')]));};AGIVertices[_0x810b('0x13')][_0x810b('0x121')]=function(_0x3af0d1){logger['info'](util[_0x810b('0x2c')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x3af0d1[_0x810b('0x3c')]));if(!this['isConfigured'](_0x3af0d1[_0x810b('0x8f')])||!this[_0x810b('0xaa')](_0x3af0d1[_0x810b('0x94')])){return this['channel'][_0x810b('0xad')](_0x810b('0x122'));}if(!this[_0x810b('0xaa')](_0x3af0d1[_0x810b('0x64')])){return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0xae'));}this[_0x810b('0x10')][_0x810b('0xad')](util['format'](_0x810b('0x123'),_0x3af0d1[_0x810b('0x64')]));var _0x4c1b83=this[_0x810b('0x8e')]['sync'](this,_0x3af0d1);if(_0x4c1b83){this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x124'),_0x4c1b83));var _0x1f2d54=this[_0x810b('0x10')]['streamFile'](_0x4c1b83);try{fs['unlink'](_0x4c1b83+_0x810b('0x104'));}catch(_0x4aea18){logger[_0x810b('0x2f')](_0x4aea18);}return _0x1f2d54;}return this[_0x810b('0x10')]['error'](_0x3af0d1,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x810b('0x125')]=function(_0x4354bf){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x126'),_0x4354bf[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x4354bf['aws_access_key_id'])||!this[_0x810b('0xaa')](_0x4354bf[_0x810b('0x94')])){return this[_0x810b('0x10')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x810b('0xaa')](_0x4354bf[_0x810b('0x96')])){return this[_0x810b('0x10')]['noop']('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x4354bf['text'])){return this[_0x810b('0x10')]['noop']('no\x20text\x20configured');}this[_0x810b('0x10')][_0x810b('0xf4')]=!![];this[_0x810b('0x3a')](_0x4354bf);this[_0x810b('0x47')](_0x4354bf[_0x810b('0x64')],'in','','');this[_0x810b('0x10')][_0x810b('0xad')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x4354bf[_0x810b('0x64')]));var _0x5ee862=this[_0x810b('0x93')]['sync'](this,_0x4354bf);if(_0x5ee862){for(var _0x4778ea in _0x5ee862){if(_0x5ee862[_0x810b('0x9b')](_0x4778ea)&&_['isString'](_0x5ee862[_0x4778ea])){this[_0x810b('0x10')][_0x810b('0xa3')](util[_0x810b('0x2c')](_0x810b('0x127'),_0x4778ea['toUpperCase']()),_0x5ee862[_0x4778ea]);}}if(_[_0x810b('0x4a')](_0x5ee862[_0x810b('0x7d')])){return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0x128'));}else{this[_0x810b('0x47')](_0x5ee862[_0x810b('0x7d')],_0x810b('0xec'),_0x810b('0x129'),'');return this['channel'][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x12a'),_0x5ee862[_0x810b('0x7d')]));}}return this[_0x810b('0x10')][_0x810b('0x2f')](_0x4354bf,_0x810b('0x12b'));};AGIVertices[_0x810b('0x13')]['googleasr']=function(_0x50c55f){logger['info'](util[_0x810b('0x2c')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x50c55f['label'],_0x50c55f[_0x810b('0x6d')]));if(!this[_0x810b('0xaa')](_0x50c55f[_0x810b('0x81')])){return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0x12c'));}var _0x29d71e=_0x810b('0x12d');var _0x3a7c2f=util['format'](_0x810b('0x12e'),FILES_PATH,rs[_0x810b('0x11c')](0x4));var _0x488703=util[_0x810b('0x2c')](_0x810b('0xa1'),_0x3a7c2f,_0x29d71e);var _0x2991d1=!![];if(_0x50c55f[_0x810b('0x12f')]===_0x810b('0x130')){_0x2991d1=![];}var _0x23d35f=this[_0x810b('0x10')][_0x810b('0x131')](_0x3a7c2f,_0x29d71e,_0x50c55f[_0x810b('0x132')],_0x50c55f[_0x810b('0x6d')],undefined,_0x2991d1);if(_0x23d35f[_0x810b('0xa9')]!==-0x1){this['channel'][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x133'),_0x488703));var _0x1b15a5=this[_0x810b('0x134')][_0x810b('0x76')](this,_0x50c55f,_0x488703);if(_0x1b15a5){for(var _0x84cddb in _0x1b15a5){if(_0x1b15a5[_0x810b('0x9b')](_0x84cddb)){this[_0x810b('0x10')][_0x810b('0xa3')](util[_0x810b('0x2c')]('GOOGLE_ASR_%s',_0x84cddb[_0x810b('0x71')]()),_0x1b15a5[_0x84cddb]);}}return this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x135'),JSON[_0x810b('0x78')](_0x1b15a5)));}}return _0x23d35f;};AGIVertices['prototype'][_0x810b('0x136')]=function(_0x24dd27){logger[_0x810b('0x31')](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x24dd27['label']));if(!this['isConfigured'](_0x24dd27[_0x810b('0x137')])){return this[_0x810b('0x10')]['noop'](_0x810b('0x138'));}if(!this['isConfigured'](_0x24dd27['appsecret'])){return this[_0x810b('0x10')][_0x810b('0xad')]('no\x20appsecret\x20configured');}var _0x3a0015=_0x810b('0x12d');var _0xdb8030=util[_0x810b('0x2c')](_0x810b('0x12e'),FILES_PATH,rs['generate'](0x4));var _0x502ac3=util[_0x810b('0x2c')]('%s.%s',_0xdb8030,_0x3a0015);var _0x35ef41=!![];if(_0x24dd27[_0x810b('0x12f')]===_0x810b('0x130')){_0x35ef41=![];}var _0x2ded4a=this[_0x810b('0x10')][_0x810b('0x131')](_0xdb8030,_0x3a0015,_0x24dd27['intKey'],_0x24dd27[_0x810b('0x6d')],undefined,_0x35ef41);if(_0x2ded4a['result']!==-0x1){this[_0x810b('0x10')]['noop'](util[_0x810b('0x2c')]('tilde\x20%s\x20file\x20created',_0x502ac3));var _0x4d0677=this[_0x810b('0x98')][_0x810b('0x76')](this,_0x24dd27,_0x502ac3);if(_0x4d0677){for(var _0x20b49b in _0x4d0677){if(_0x4d0677[_0x810b('0x9b')](_0x20b49b)){this[_0x810b('0x10')]['setVariable'](util['format'](_0x810b('0x139'),_0x20b49b[_0x810b('0x71')]()),_0x4d0677[_0x20b49b]);}}return this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x4d0677)));}}return _0x2ded4a;};AGIVertices[_0x810b('0x13')][_0x810b('0x13a')]=function(_0x3860c4){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x3860c4['label']));return this[_0x810b('0x10')]['continueAt'](_0x3860c4[_0x810b('0x13b')],_0x3860c4[_0x810b('0x42')],_0x3860c4[_0x810b('0x43')]);};AGIVertices[_0x810b('0x13')][_0x810b('0x13c')]=function(_0x48aff4){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x13d'),_0x48aff4[_0x810b('0x3c')]));if(!this['isConfigured'](_0x48aff4[_0x810b('0x13e')])){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x48aff4,_0x810b('0x13f'));}try{var _0x47ae0a=eval(_0x48aff4[_0x810b('0x13e')])?_0x810b('0x140'):_0x810b('0x141');this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x142'),_0x48aff4[_0x810b('0x13e')],_0x47ae0a));return{'code':0xc8,'result':_0x47ae0a};}catch(_0x4a7050){return{'code':0xc8,'result':_0x810b('0x141')};}};AGIVertices[_0x810b('0x13')][_0x810b('0x143')]=function(_0x2365ec){logger['info'](util[_0x810b('0x2c')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x2365ec[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x2365ec[_0x810b('0x144')])){return this['channel'][_0x810b('0x2f')](_0x2365ec,_0x810b('0x145'));}var _0x46e3fb=this['getIntervals'][_0x810b('0x76')](this,_0x2365ec['interval_id']);if(!_0x46e3fb){return this[_0x810b('0x10')]['error'](_0x2365ec,_0x810b('0x146'));}for(var _0x41a32b=0x0;_0x41a32b<_0x46e3fb[_0x810b('0xa2')];_0x41a32b+=0x1){var _0x305408=this[_0x810b('0x10')][_0x810b('0xa7')](util['format'](_0x810b('0x147'),_0x46e3fb[_0x41a32b]));if(_0x305408[_0x810b('0xa9')]===-0x1){return _0x305408;}logger['info'](util[_0x810b('0x2c')]('IFTIME\x20%s\x20%s',_0x46e3fb[_0x41a32b],_0x305408[_0x810b('0xa8')]));if(_0x305408[_0x810b('0xa8')]===_0x810b('0x140')){logger[_0x810b('0x31')](util['format'](_0x810b('0x148'),_0x46e3fb[_0x41a32b],_0x810b('0x140')));this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x148'),_0x46e3fb[_0x41a32b],_0x810b('0x140')));return{'code':0xc8,'result':_0x810b('0x140')};}else{logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x148'),_0x46e3fb[_0x41a32b],_0x810b('0x141')));this[_0x810b('0x10')]['noop'](util[_0x810b('0x2c')](_0x810b('0x148'),_0x46e3fb[_0x41a32b],_0x810b('0x141')));}}return{'code':0xc8,'result':_0x810b('0x141')};};AGIVertices['prototype'][_0x810b('0x149')]=function(_0x37391f){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x37391f[_0x810b('0x3c')]));return this[_0x810b('0x10')]['hangup']();};AGIVertices[_0x810b('0x13')][_0x810b('0x14a')]=function(_0x4dd6b7){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x4dd6b7[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x4dd6b7[_0x810b('0x81')])){return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0x12c'));}var _0x902ba9=_0x810b('0x12d');var _0xe5467a=util[_0x810b('0x2c')](_0x810b('0x12e'),FILES_PATH,rs[_0x810b('0x11c')](0x4));var _0x11124b=util[_0x810b('0x2c')](_0x810b('0xa1'),_0xe5467a,_0x902ba9);var _0x22b5e9=!![];if(_0x4dd6b7[_0x810b('0x12f')]==='NOBEEP'){_0x22b5e9=![];}var _0x5b5939=this[_0x810b('0x10')]['recordFile'](_0xe5467a,_0x902ba9,_0x4dd6b7[_0x810b('0x132')],_0x4dd6b7['timeout'],undefined,_0x22b5e9);if(_0x5b5939[_0x810b('0xa9')]!==-0x1){this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x14b'),_0x11124b));var _0x3528a3=this[_0x810b('0x8b')][_0x810b('0x76')](this,_0x4dd6b7,_0x11124b);if(_0x3528a3){for(var _0x208840 in _0x3528a3){if(_0x3528a3[_0x810b('0x9b')](_0x208840)){this[_0x810b('0x10')][_0x810b('0xa3')](util[_0x810b('0x2c')](_0x810b('0x14c'),_0x208840['toUpperCase']()),_0x3528a3[_0x208840]);}}return this['channel']['noop'](util[_0x810b('0x2c')](_0x810b('0x14d'),JSON[_0x810b('0x78')](_0x3528a3)));}}return _0x5b5939;};AGIVertices['prototype']['ispeechtts']=function(_0xd7e2de){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0xd7e2de[_0x810b('0x3c')]));if(!this['isConfigured'](_0xd7e2de[_0x810b('0x81')])){return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0x12c'));}if(!this[_0x810b('0xaa')](_0xd7e2de['text'])){return this['channel']['noop'](_0x810b('0xae'));}this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x14e'),_0xd7e2de[_0x810b('0x64')]));var _0x1141cb=this[_0x810b('0x88')]['sync'](this,_0xd7e2de);if(_0x1141cb){this['channel'][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x14b'),_0x1141cb));var _0x4d2747=this[_0x810b('0x10')][_0x810b('0x102')](_0x1141cb,_0xd7e2de['intKey']);try{fs[_0x810b('0x103')](_0x1141cb+'.wav');}catch(_0xccd564){logger['error'](_0xccd564);}return _0x4d2747;}return this[_0x810b('0x10')]['error'](_0xd7e2de,_0x810b('0x14f'));};AGIVertices[_0x810b('0x13')][_0x810b('0x150')]=function(_0xc395e6){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x151'),_0xc395e6['label']));if(!this[_0x810b('0xaa')](_0xc395e6[_0x810b('0x152')])){return this['channel'][_0x810b('0x2f')](_0xc395e6,_0x810b('0x153'));}logger['info'](util[_0x810b('0x2c')](_0x810b('0x154'),this[_0x810b('0x10')]['callerid'],_0xc395e6[_0x810b('0x152')]));var _0x2ac8a0=this['agentLogin'][_0x810b('0x76')](this,_0xc395e6[_0x810b('0x152')]);if(_0x2ac8a0){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x155'),this[_0x810b('0x10')][_0x810b('0x3f')],_0xc395e6[_0x810b('0x152')]));this['channel']['noop'](util[_0x810b('0x2c')](_0x810b('0x155'),this[_0x810b('0x10')]['callerid'],_0xc395e6['findBy']));return{'code':0xc8,'result':_0x810b('0x156')};}else{logger['info'](util[_0x810b('0x2c')](_0x810b('0x157'),this[_0x810b('0x10')][_0x810b('0x3f')],_0xc395e6[_0x810b('0x152')]));this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x157'),this[_0x810b('0x10')][_0x810b('0x3f')],_0xc395e6['findBy']));return{'code':0xc8,'result':_0x810b('0x158')};}};AGIVertices['prototype'][_0x810b('0x159')]=function(_0xbbf1e5){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0xbbf1e5[_0x810b('0x3c')]));if(!this['isConfigured'](_0xbbf1e5[_0x810b('0x152')])){return this['channel']['error'](_0xbbf1e5,'no\x20find\x20by\x20configured');}logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x154'),this[_0x810b('0x10')][_0x810b('0x3f')],_0xbbf1e5['findBy']));var _0x15de94=this[_0x810b('0x58')][_0x810b('0x76')](this,_0xbbf1e5[_0x810b('0x152')]);if(_0x15de94){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x810b('0x3f')],_0xbbf1e5[_0x810b('0x152')]));this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x155'),this[_0x810b('0x10')][_0x810b('0x3f')],_0xbbf1e5[_0x810b('0x152')]));return{'code':0xc8,'result':_0x810b('0x156')};}else{logger[_0x810b('0x31')](util[_0x810b('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x810b('0x10')][_0x810b('0x3f')],_0xbbf1e5[_0x810b('0x152')]));this['channel'][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x157'),this[_0x810b('0x10')]['callerid'],_0xbbf1e5[_0x810b('0x152')]));return{'code':0xc8,'result':_0x810b('0x158')};}};AGIVertices[_0x810b('0x13')][_0x810b('0x15a')]=function(_0xed77f){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0xed77f['label']));if(!this[_0x810b('0xaa')](_0xed77f[_0x810b('0x15b')])){return this['channel'][_0x810b('0x2f')](_0xed77f,_0x810b('0x15c'));}this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x15d'),_0xed77f[_0x810b('0x15b')]));var _0x59105c=eval(_0xed77f[_0x810b('0x15b')]);if(!this[_0x810b('0xaa')](_0xed77f['variable_id'])){return this[_0x810b('0x10')][_0x810b('0xad')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5958ee=this[_0x810b('0xa7')][_0x810b('0x76')](this,_0xed77f[_0x810b('0x113')]);if(!_0x5958ee){return this['channel']['error'](_0xed77f,_0x810b('0xd8'));}if(_['isArray'](_0x59105c)){var _0x314e91=this;_0x59105c[_0x810b('0xd9')](function(_0x33343f,_0x4210d1){_0x314e91['channel']['setVariable'](util[_0x810b('0x2c')]('%s[%s]',_0x5958ee,_0x4210d1),_0x33343f);});return this[_0x810b('0x10')][_0x810b('0xad')](util['format'](_0x810b('0x15e'),_0x5958ee));}else{return this[_0x810b('0x10')]['setVariable'](_0x5958ee,_0x59105c);}};AGIVertices[_0x810b('0x13')][_0x810b('0xe')]=function(_0x376777){logger['info'](util[_0x810b('0x2c')](_0x810b('0x15f'),_0x376777[_0x810b('0x3c')]));if(_0x376777[_0x810b('0xab')]===0x0){return this[_0x810b('0xac')](_0x376777);}_0x376777[_0x810b('0xab')]-=0x1;if(!this['isConfigured'](_0x376777[_0x810b('0x110')])){return this['channel'][_0x810b('0x2f')](_0x376777,_0x810b('0x111'));}var _0x3be932=this[_0x810b('0x21')][_0x810b('0x76')](this,_0x376777[_0x810b('0x110')]);if(!_0x3be932){return this[_0x810b('0x10')]['error'](_0x376777,_0x810b('0x112'));}var _0x5c90e1=this[_0x810b('0x10')]['getData'](_0x3be932,_0x376777[_0x810b('0x114')],_0x376777[_0x810b('0x160')]);var _0x37da90=_0x5c90e1[_0x810b('0xa9')];if(_0x5c90e1[_0x810b('0xa9')]===-0x1){this[_0x810b('0x3a')][_0x810b('0x76')](this,_0x376777,'-1');return _0x5c90e1;}else if(_0x5c90e1[_0x810b('0xa8')]==='timeout'){_0x5c90e1[_0x810b('0xa9')]=_0x5c90e1[_0x810b('0xa9')][_0x810b('0xa2')]>0x0?_0x5c90e1[_0x810b('0xa9')]:'t';}else if(_[_0x810b('0x49')](_0x5c90e1['result'])){_0x5c90e1[_0x810b('0xa9')]='#';_0x37da90='#';}if(!this[_0x810b('0xaa')](_0x376777[_0x810b('0x113')])){this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0xd7'));}else{var _0x1dfbf6=this['getVariable']['sync'](this,_0x376777[_0x810b('0x113')]);if(!_0x1dfbf6){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x376777,_0x810b('0xd8'));}this['channel'][_0x810b('0xa3')](_0x1dfbf6,_0x37da90);}this[_0x810b('0x3a')][_0x810b('0x76')](this,_0x376777,_0x37da90);return _0x5c90e1;};AGIVertices[_0x810b('0x13')][_0x810b('0xad')]=function(_0x39c3b7){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x161'),_0x39c3b7['label']));return this[_0x810b('0x10')]['noop'](_0x39c3b7['output']||_0x39c3b7[_0x810b('0x3c')]);};AGIVertices[_0x810b('0x13')][_0x810b('0x162')]=function(_0x4edee9){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x163'),_0x4edee9[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x4edee9[_0x810b('0x152')])){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x4edee9,_0x810b('0x153'));}logger['info'](util[_0x810b('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x810b('0x10')][_0x810b('0x3f')],_0x4edee9['findBy']));var _0x38cb39=this[_0x810b('0x164')][_0x810b('0x76')](this,_0x4edee9[_0x810b('0x165')]);var _0x2589e0=this[_0x810b('0x56')]['sync'](this,_0x4edee9[_0x810b('0x152')],_0x38cb39);if(_0x2589e0){logger[_0x810b('0x31')](util['format'](_0x810b('0x155'),this['channel'][_0x810b('0x3f')],_0x4edee9['findBy']));this[_0x810b('0x10')]['noop'](util['format'](_0x810b('0x155'),this['channel'][_0x810b('0x3f')],_0x4edee9[_0x810b('0x152')]));return{'code':0xc8,'result':_0x810b('0x156')};}else{logger['info'](util[_0x810b('0x2c')](_0x810b('0x157'),this['channel'][_0x810b('0x3f')],_0x4edee9['findBy']));this[_0x810b('0x10')]['noop'](util[_0x810b('0x2c')](_0x810b('0x155'),this[_0x810b('0x10')][_0x810b('0x3f')],_0x4edee9['findBy']));return{'code':0xc8,'result':_0x810b('0x158')};}};AGIVertices[_0x810b('0x13')][_0x810b('0x166')]=function(_0x2d5892){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x167'),_0x2d5892[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x2d5892[_0x810b('0x110')])){return this['channel'][_0x810b('0x2f')](_0x2d5892,'no\x20file\x20audio\x20selected');}var _0x2e4f2f=this[_0x810b('0x21')]['sync'](this,_0x2d5892['file_id']);if(!_0x2e4f2f){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x2d5892,_0x810b('0x112'));}var _0x11d668=this[_0x810b('0x10')][_0x810b('0x5e')]('PLAYBACK',[_0x2e4f2f,_0x2d5892[_0x810b('0xe5')]]);if(_0x11d668[_0x810b('0xa9')]===-0x1){return _0x11d668;}return this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0xc8'),_0x810b('0x168'),_0x2e4f2f));};AGIVertices[_0x810b('0x13')]['queue']=function(_0x51e8e8){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x169'),_0x51e8e8[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x51e8e8['queue_id'])){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x51e8e8,_0x810b('0x16a'));}var _0x215f1e='';var _0xc2878b=parseInt(_0x51e8e8[_0x810b('0x16b')],0xa);if(isNaN(_0xc2878b)){_0x215f1e=_0x51e8e8[_0x810b('0x16b')];}else{_0x215f1e=this[_0x810b('0x17')]['sync'](this,_0x51e8e8[_0x810b('0x16b')]);if(!_0x215f1e){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x51e8e8,'no\x20queue\x20found');}}var _0x558c3d='';if(this['isConfigured'](_0x51e8e8['file_id'])){var _0x3c934f=this[_0x810b('0x21')][_0x810b('0x76')](this,_0x51e8e8[_0x810b('0x110')]);if(_0x3c934f){_0x558c3d=_0x3c934f;}}this[_0x810b('0x3a')][_0x810b('0x76')](this,_0x51e8e8,_0x215f1e);if(_0x51e8e8[_0x810b('0xe5')]['indexOf']('x')<0x0){_0x51e8e8[_0x810b('0xe5')]+='x';}if(_0x51e8e8[_0x810b('0xe5')]['indexOf']('X')<0x0){_0x51e8e8[_0x810b('0xe5')]+='X';}this[_0x810b('0x10')]['setVariable'](_0x810b('0x16c'),_0x215f1e?_0x215f1e['toLowerCase']():'');var _0x429ac0=this[_0x810b('0x10')][_0x810b('0x5e')](_0x810b('0x16d'),[_0x215f1e,_0x51e8e8[_0x810b('0xe5')],_0x51e8e8['url'],_0x558c3d,_0x51e8e8[_0x810b('0x6d')],_0x51e8e8[_0x810b('0x8')],_0x51e8e8[_0x810b('0x16e')],_0x51e8e8['gosub'],'',_0x51e8e8[_0x810b('0x16f')]]);if(_0x429ac0[_0x810b('0xa9')]===-0x1){return _0x429ac0;}return this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0xc8'),_0x810b('0x16d'),_0x215f1e));};AGIVertices[_0x810b('0x13')][_0x810b('0x170')]=function(_0x5d9cd7){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x171'),_0x5d9cd7['label']));var _0x2d3bba=_0x5d9cd7[_0x810b('0x172')]||_0x810b('0x12d');var _0x5d7755=util[_0x810b('0x2c')](_0x810b('0x173'),this[_0x810b('0x10')][_0x810b('0x3b')],rs['generate'](0x5));var _0x408baf=util[_0x810b('0x2c')](_0x810b('0x174'),FILES_PATH,_0x5d7755,_0x2d3bba);var _0x472a4c=util[_0x810b('0x2c')]('%s/recordings/%s',FILES_PATH,_0x5d7755);this[_0x810b('0x40')][_0x810b('0x76')](this,_0x5d9cd7,_0x5d7755,_0x408baf);this[_0x810b('0x10')][_0x810b('0xa3')](_0x810b('0x175'),_0x5d7755);logger[_0x810b('0x31')](_0x810b('0x176'),_0x472a4c,_0x2d3bba,_0x5d9cd7[_0x810b('0x177')],_0x5d9cd7['timeout']);return this[_0x810b('0x10')]['recordFile'](_0x472a4c,_0x2d3bba,_0x5d9cd7['escape_digits'],_0x5d9cd7[_0x810b('0x6d')],undefined,!![]);};AGIVertices['prototype'][_0x810b('0x178')]=function(_0x1893cc){logger['info'](util[_0x810b('0x2c')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x1893cc[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x1893cc[_0x810b('0x6a')])){return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0x179'));}var _0x4d114c=this[_0x810b('0x69')]['sync'](this,_0x1893cc);logger['info'](util['format']('Response:',util[_0x810b('0x17a')](_0x4d114c,{'showHidden':![],'depth':null})));if(!this[_0x810b('0xaa')](_0x1893cc[_0x810b('0x113')])){return this[_0x810b('0x10')][_0x810b('0xad')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x41c489=this[_0x810b('0xa7')]['sync'](this,_0x1893cc[_0x810b('0x113')]);if(!_0x41c489){return this[_0x810b('0x10')]['error'](_0x1893cc,_0x810b('0xd8'));}this['channel'][_0x810b('0xa3')](util['format'](_0x810b('0x17b'),_0x41c489),_0x4d114c[_0x810b('0x7b')]?_0x4d114c[_0x810b('0x7b')]:'200');this[_0x810b('0x10')]['setVariable'](util['format'](_0x810b('0x17c'),_0x41c489),_0x4d114c[_0x810b('0x7c')]?_0x4d114c[_0x810b('0x7c')]:'OK');if(_0x4d114c['body']){try{this[_0x810b('0xa0')](_0x4d114c[_0x810b('0x79')],_0x41c489);}catch(_0x39f07c){logger[_0x810b('0x2f')](util['format'](_0x810b('0x17d'),_0x41c489));}}return this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0xdd'),_0x41c489));};AGIVertices[_0x810b('0x13')][_0x810b('0x17e')]=function(_0x216b86){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x17f'),_0x216b86['label']));return this[_0x810b('0x10')][_0x810b('0x180')](_0x216b86[_0x810b('0x181')][_0x810b('0x60')](/\s+/g,''),_0x216b86[_0x810b('0x177')]);};AGIVertices[_0x810b('0x13')][_0x810b('0x182')]=function(_0x395d22){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x183'),_0x395d22['label']));return this[_0x810b('0x10')][_0x810b('0x184')](_0x395d22['number'][_0x810b('0x60')](/\s+/g,''),_0x395d22['escape_digits']);};AGIVertices[_0x810b('0x13')]['sayphonetic']=function(_0x12c4e2){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x12c4e2['label']));return this['channel'][_0x810b('0x185')](_0x12c4e2['text'],_0x12c4e2[_0x810b('0x177')]);};AGIVertices[_0x810b('0x13')][_0x810b('0x186')]=function(_0x439278){logger['info'](util[_0x810b('0x2c')](_0x810b('0x187'),_0x439278['label']));if(!this[_0x810b('0xaa')](_0x439278[_0x810b('0x188')])){return this[_0x810b('0x10')]['noop'](_0x810b('0x189'));}var _0x23ea8b=this[_0x810b('0x24')][_0x810b('0x76')](this,_0x439278[_0x810b('0x188')]);if(!_0x23ea8b||!_0x23ea8b[_0x810b('0x18a')]){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x439278,_0x810b('0x18b'));}var _0x42c4f9={'from':util['format'](_0x810b('0x18c'),_0x23ea8b['name'],_0x23ea8b['email']||_0x23ea8b['Smtp'][_0x810b('0x18d')]),'to':_0x439278['to']||'','cc':_0x439278['cc']||'','bcc':_0x439278['bcc']||'','subject':_0x439278[_0x810b('0x18e')],'html':_0x439278[_0x810b('0x64')],'text':_0x439278[_0x810b('0x64')]};if(this[_0x810b('0xaa')](_0x439278[_0x810b('0x18f')])){}logger['debug'](_0x810b('0x190'),JSON[_0x810b('0x78')](_0x42c4f9));this[_0x810b('0x3a')][_0x810b('0x76')](this,_0x439278,_0x439278[_0x810b('0x188')]);this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x191'),_0x23ea8b['name']));this['sendMailMessage']['sync'](this,_0x23ea8b[_0x810b('0x192')],_0x42c4f9);return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0x193'));};AGIVertices[_0x810b('0x13')][_0x810b('0x194')]=function(_0x503956){logger[_0x810b('0x31')](util['format'](_0x810b('0x195'),_0x503956[_0x810b('0x3c')]));return this['channel'][_0x810b('0xad')](_0x810b('0x196'));};AGIVertices[_0x810b('0x13')][_0x810b('0x197')]=function(_0x3e090b){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x198'),_0x3e090b[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x3e090b['sms_account_id'])){return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0x199'));}var _0x61b525=this['getSmsAccount'][_0x810b('0x76')](this,_0x3e090b['sms_account_id']);if(!_0x61b525){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x3e090b,_0x810b('0x19a'));}var _0x35c53f={'body':_0x3e090b[_0x810b('0x19b')],'phone':_0x3e090b['to']||'','SmsAccountId':_0x61b525['id']};logger[_0x810b('0xdf')](_0x810b('0x19c'),JSON[_0x810b('0x78')](_0x35c53f));this[_0x810b('0x3a')]['sync'](this,_0x3e090b,_0x3e090b[_0x810b('0x19d')]);this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x19e'),_0x61b525['name']));this[_0x810b('0x39')][_0x810b('0x76')](this,_0x35c53f);return this[_0x810b('0x10')][_0x810b('0xad')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x810b('0x13')][_0x810b('0x19f')]=function(_0x2a2dfb){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x1a0'),_0x2a2dfb['label']));if(!this['isConfigured'](_0x2a2dfb[_0x810b('0x113')])){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x2a2dfb,_0x810b('0x1a1'));}var _0x3bf240=this['getVariable'][_0x810b('0x76')](this,_0x2a2dfb[_0x810b('0x113')]);if(!_0x3bf240){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x2a2dfb,_0x810b('0xd8'));}return this[_0x810b('0x10')][_0x810b('0xa3')](_0x3bf240,_0x2a2dfb['variable_value']);};AGIVertices[_0x810b('0x13')]['start']=function(_0x5a97af){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('Enter\x20in\x20START\x20(%s)\x20block',_0x5a97af[_0x810b('0x3c')]));this[_0x810b('0x10')]['noop'](_0x810b('0x1a2'));if(_0x5a97af[_0x810b('0xbe')]===_0x810b('0x1a3')){this[_0x810b('0x10')]['noop']('Answer');return this[_0x810b('0x10')][_0x810b('0xbe')]();}return this['channel'][_0x810b('0xad')]('Skipped\x20Answer');};AGIVertices[_0x810b('0x13')]['subproject']=function(_0x2fb94e){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x1a4'),_0x2fb94e[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x2fb94e['project_id'])){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x2fb94e,'no\x20subproject\x20selected');}var _0x197ee1=this[_0x810b('0x19')]['sync'](this,_0x2fb94e[_0x810b('0x1a5')]);if(!this[_0x810b('0xaa')](_0x197ee1)){return this[_0x810b('0x10')]['error'](_0x2fb94e,util[_0x810b('0x2c')](_0x810b('0x1a6'),_0x2fb94e[_0x810b('0x1a5')]));}if(_0x197ee1===this['channel'][_0x810b('0x3e')]){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x2fb94e,_0x810b('0x1a7'));}this[_0x810b('0x3a')][_0x810b('0x76')](this,_0x2fb94e,_0x197ee1);var _0x3dbe9b=this[_0x810b('0x10')]['exec']('AGI',util[_0x810b('0x2c')](_0x810b('0x1a8'),config[_0x810b('0x8')][_0x810b('0x1a9')]||'127.0.0.1',_0x197ee1,this[_0x810b('0x10')][_0x810b('0x3e')]));if(_0x3dbe9b['result']===-0x1){return _0x3dbe9b;}return this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0xc8'),_0x810b('0x1aa'),_0x197ee1));};AGIVertices['prototype'][_0x810b('0x1ab')]=function(_0x26e92b){logger[_0x810b('0x31')](util['format'](_0x810b('0x1ac'),_0x26e92b[_0x810b('0x3c')]));var _0x3cd7b3=this[_0x810b('0x5d')][_0x810b('0x76')](this,_0x26e92b[_0x810b('0xbc')]);this[_0x810b('0x3a')]['sync'](this,_0x26e92b,_0x26e92b[_0x810b('0xbc')]);if(this[_0x810b('0xaa')](_0x26e92b['variable_id'])){var _0x4c2931=this[_0x810b('0xa7')][_0x810b('0x76')](this,_0x26e92b[_0x810b('0x113')]);if(_0x4c2931){this[_0x810b('0x10')]['setVariable'](_0x4c2931,_0x3cd7b3);return this['channel'][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x1ad'),_0x26e92b['command'],_0x4c2931));}}return this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x1ae'),_0x26e92b[_0x810b('0xbc')]));};AGIVertices[_0x810b('0x13')][_0x810b('0x1af')]=function(_0x43525a){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x1b0'),_0x43525a[_0x810b('0x3c')]));_0x43525a['text']=_0x43525a[_0x810b('0x64')][_0x810b('0x60')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x43525a[_0x810b('0x62')])){return this['channel'][_0x810b('0xad')](_0x810b('0x1b1'));}if(!this['isConfigured'](_0x43525a['text'])){return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0xae'));}this['channel'][_0x810b('0xad')](util[_0x810b('0x2c')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x43525a[_0x810b('0x64')]));var _0x47afe8=this[_0x810b('0x61')][_0x810b('0x76')](this,_0x43525a);if(_0x47afe8){this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x1b2'),_0x47afe8));var _0x6da8ac=this[_0x810b('0x10')][_0x810b('0x102')](_0x47afe8);try{fs['unlink'](_0x47afe8+_0x810b('0x104'));}catch(_0x35c3ae){logger[_0x810b('0x2f')](_0x35c3ae);}return _0x6da8ac;}return this[_0x810b('0x10')][_0x810b('0x2f')](_0x43525a,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x810b('0x13')]['tts']=function(_0x2c6233){logger[_0x810b('0x31')](util['format'](_0x810b('0x1b3'),_0x2c6233[_0x810b('0x3c')]));_0x2c6233[_0x810b('0x64')]=_0x2c6233[_0x810b('0x64')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x810b('0xaa')](_0x2c6233['text'])){return this[_0x810b('0x10')][_0x810b('0xad')](_0x810b('0xae'));}this['channel'][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x1b4'),_0x2c6233[_0x810b('0x64')]));var _0x42e53c=this[_0x810b('0x68')][_0x810b('0x76')](this,_0x2c6233);if(_0x42e53c){this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x1b5'),_0x42e53c));var _0x20f6a9=this[_0x810b('0x10')][_0x810b('0x102')](_0x42e53c);try{fs[_0x810b('0x103')](_0x42e53c+_0x810b('0x104'));}catch(_0x20b3f7){logger['error'](_0x20b3f7);}return _0x20f6a9;}return this[_0x810b('0x10')][_0x810b('0x2f')](_0x2c6233,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x810b('0x1b6')]=function(_0x2734c9){logger['info'](util[_0x810b('0x2c')](_0x810b('0x1b7'),_0x2734c9[_0x810b('0x3c')]));if(!this['isConfigured'](_0x2734c9[_0x810b('0x152')])){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x2734c9,_0x810b('0x153'));}logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x154'),this['channel']['callerid'],_0x2734c9[_0x810b('0x152')]));var _0x1d4220=this[_0x810b('0x57')][_0x810b('0x76')](this,_0x2734c9[_0x810b('0x152')]);if(_0x1d4220){logger[_0x810b('0x31')](util[_0x810b('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x810b('0x10')][_0x810b('0x3f')],_0x2734c9['findBy']));this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0x155'),this[_0x810b('0x10')][_0x810b('0x3f')],_0x2734c9[_0x810b('0x152')]));return{'code':0xc8,'result':_0x810b('0x156')};}else{logger['info'](util[_0x810b('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x810b('0x10')]['callerid'],_0x2734c9['findBy']));this[_0x810b('0x10')][_0x810b('0xad')](util[_0x810b('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x2734c9[_0x810b('0x152')]));return{'code':0xc8,'result':_0x810b('0x158')};}};AGIVertices[_0x810b('0x13')][_0x810b('0x1b8')]=function(_0xfeeb16){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x1b9'),_0xfeeb16[_0x810b('0x3c')]));var _0x72bf74=this['channel'][_0x810b('0x5e')](_0x810b('0x1ba'),[_0xfeeb16['mailbox'],_0xfeeb16[_0x810b('0x7f')]]);if(_0x72bf74[_0x810b('0xa9')]===-0x1){return _0x72bf74;}return this['channel'][_0x810b('0xad')](util[_0x810b('0x2c')](_0x810b('0xc8'),_0x810b('0x1ba'),_0xfeeb16[_0x810b('0x1bb')]));};AGIVertices['prototype'][_0x810b('0x1bc')]=function(_0x4267ba){logger[_0x810b('0x31')](util[_0x810b('0x2c')](_0x810b('0x1bd'),_0x4267ba[_0x810b('0x3c')]));if(!this[_0x810b('0xaa')](_0x4267ba['variable_id'])){return this['channel'][_0x810b('0x2f')](_0x4267ba,_0x810b('0x1a1'));}var _0x1ce42a=this[_0x810b('0xa7')][_0x810b('0x76')](this,_0x4267ba['variable_id']);if(!_0x1ce42a){return this[_0x810b('0x10')][_0x810b('0x2f')](_0x4267ba,_0x810b('0xd8'));}var _0x186634=this[_0x810b('0x10')][_0x810b('0xa7')](_0x1ce42a);return{'code':0xc8,'result':_0x186634[_0x810b('0xa8')]?_0x186634[_0x810b('0xa8')]:'-'};};String[_0x810b('0x13')][_0x810b('0xa6')]=function(_0x43402d,_0x58c938){return this[_0x810b('0xa5')](_0x43402d)['join'](_0x58c938);};module[_0x810b('0x1be')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 2e0d581..ea73e6b 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 _0x809c=['../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','syncHangupRequest','syncHangup','bind','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','then','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','updateAcw','update','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','acw'];(function(_0x4b0389,_0x58a91e){var _0x384ecd=function(_0x2f31a2){while(--_0x2f31a2){_0x4b0389['push'](_0x4b0389['shift']());}};_0x384ecd(++_0x58a91e);}(_0x809c,0x1f4));var _0xc809=function(_0x3f9933,_0x56f159){_0x3f9933=_0x3f9933-0x0;var _0x49deaf=_0x809c[_0x3f9933];return _0x49deaf;};'use strict';var _=require('lodash');var moment=require(_0xc809('0x0'));var ami=require(_0xc809('0x1'));var logger=require(_0xc809('0x2'))(_0xc809('0x3'));var RpcUser=require(_0xc809('0x4'));var RpcVoiceAgentReport=require(_0xc809('0x5'));function Acw(_0x13e95a){this[_0xc809('0x6')]=_0x13e95a[_0xc809('0x6')];this[_0xc809('0x7')]=_0x13e95a[_0xc809('0x7')];this[_0xc809('0x8')]=_0x13e95a['timers'];this[_0xc809('0x9')]={};ami['on'](_0xc809('0xa'),this[_0xc809('0xb')]['bind'](this));ami['on']('hanguprequest',this[_0xc809('0xc')]['bind'](this));ami['on']('hangup',this[_0xc809('0xd')][_0xc809('0xe')](this));ami['on'](_0xc809('0xf'),this[_0xc809('0x10')]['bind'](this));ami['on'](_0xc809('0x11'),this[_0xc809('0x12')]['bind'](this));ami['on']('blindtransfer',this[_0xc809('0x13')]['bind'](this));ami['on'](_0xc809('0x14'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x258eb9){var _0x2ca2c2=moment()['milliseconds'](0x0);var _0x1ff39c=moment(_0x258eb9)[_0xc809('0x15')](0x0);return _0x2ca2c2[_0xc809('0x16')](_0x1ff39c,_0xc809('0x17'));}Acw[_0xc809('0x18')]['startAcw']=function(_0x24caf3){try{var _0x1f0ef4=this;var _0x37bd95=this['channels'][_0x24caf3][_0xc809('0x19')];var _0x313818=this[_0xc809('0x9')][_0x24caf3][_0xc809('0x1a')];var _0x57acba=this['voiceQueues'][_0x313818];var _0x452e7e=![];var _0x6ff2f='ACW';if(_0x57acba[_0xc809('0x1b')]){if(_0x57acba['mandatoryDispositionPause'][_0xc809('0x1c')]){_0x452e7e=!![];_0x6ff2f=_0x57acba[_0xc809('0x1d')]['name'];}}return ami[_0xc809('0x1e')]({'action':_0xc809('0x1f'),'interface':_0x37bd95,'paused':!![],'reason':_0x6ff2f})['then'](function(){if(_0x1f0ef4[_0xc809('0x7')][_0x37bd95]){return RpcUser[_0xc809('0x20')](_0x1f0ef4[_0xc809('0x7')][_0x37bd95]['id'])['then'](function(_0x53070a){if(_0x53070a&&!_0x53070a[_0xc809('0x21')]){logger[_0xc809('0x22')](_0xc809('0x23'),_0x24caf3,_0x37bd95,_0x313818);var _0x3b4079=_0x1f0ef4['channels'][_0x24caf3][_0xc809('0x24')]&&_0x1f0ef4[_0xc809('0x9')][_0x24caf3]['destlinkedid']?_0x1f0ef4[_0xc809('0x9')][_0x24caf3][_0xc809('0x25')]:_0x24caf3;return RpcUser[_0xc809('0x26')](_0x1f0ef4[_0xc809('0x7')][_0x37bd95],_0x6ff2f,_0x3b4079)[_0xc809('0x27')](function(){if(!_0x452e7e){_0x1f0ef4[_0xc809('0x8')][_0x37bd95]={};logger['info'](_0xc809('0x28'),_0x24caf3,_0x1f0ef4['voiceQueues'][_0x313818][_0xc809('0x29')],_0x37bd95,_0x313818);_0x1f0ef4['timers'][_0x37bd95][_0xc809('0x2a')]=setTimeout(_0x1f0ef4[_0xc809('0x2b')][_0xc809('0xe')](_0x1f0ef4,_0x37bd95),_0x1f0ef4[_0xc809('0x6')][_0x313818]['acwTimeout']*0x3e8);_0x1f0ef4['timers'][_0x37bd95][_0xc809('0x2c')]=moment()[_0xc809('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f0ef4[_0xc809('0x8')][_0x37bd95][_0xc809('0x2e')]=_0x24caf3;_0x1f0ef4[_0xc809('0x8')][_0x37bd95][_0xc809('0x1a')]=_0x313818;_0x1f0ef4[_0xc809('0x8')][_0x37bd95][_0xc809('0x2f')]=function(){var _0x5c9dbd=getDiff(_0x1f0ef4[_0xc809('0x8')][_0x37bd95][_0xc809('0x2c')]);clearTimeout(_0x1f0ef4['timers'][_0x37bd95]['timer']);_0x1f0ef4[_0xc809('0x8')][_0x37bd95][_0xc809('0x2a')]=![];RpcVoiceAgentReport[_0xc809('0x30')]({'acwtime':_0x5c9dbd},_0x1f0ef4[_0xc809('0x8')][_0x37bd95][_0xc809('0x2e')],_0x37bd95)[_0xc809('0x27')](function(_0x4f0970){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x24caf3,_0x5c9dbd,_0x4f0970);})[_0xc809('0x31')](function(_0x30c7fb){logger[_0xc809('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x24caf3,_0x30c7fb);});delete _0x1f0ef4[_0xc809('0x8')][_0x37bd95];};}});}else{logger[_0xc809('0x22')](_0xc809('0x33'),_0x24caf3,_0x37bd95,_0x313818);}});}})[_0xc809('0x31')](function(){logger[_0xc809('0x32')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x24caf3,_0x1f0ef4['voiceQueues'][_0x313818][_0xc809('0x29')],_0x37bd95,_0x313818);})[_0xc809('0x34')](function(){delete _0x1f0ef4[_0xc809('0x9')][_0x24caf3];});}catch(_0x1b1e76){logger['error'](_0xc809('0x35'),_0x1b1e76[_0xc809('0x36')]);}};Acw[_0xc809('0x18')][_0xc809('0x2b')]=function(_0x541374){try{var _0x5a3582=this;if(_0x5a3582[_0xc809('0x8')][_0x541374]){_0x5a3582[_0xc809('0x8')][_0x541374][_0xc809('0x2a')]=![];var _0x159114=_0x5a3582[_0xc809('0x8')][_0x541374]['uniqueid'];var _0x72d1a4=_0x5a3582[_0xc809('0x8')][_0x541374][_0xc809('0x1a')];var _0x5da297=_0x5a3582['voiceQueues'][_0x72d1a4][_0xc809('0x29')];logger['info'](_0xc809('0x37'),_0x159114,_0x541374);RpcUser['saveUnpause'](this['agents'][_0x541374]);RpcVoiceAgentReport['update']({'acwtime':_0x5da297,'agentacw':!![]},_0x159114,_0x541374)[_0xc809('0x27')](function(_0x1761fa){logger['info'](_0xc809('0x38'),_0x159114,_0x5da297,_0x1761fa);})[_0xc809('0x31')](function(_0x4910cc){logger[_0xc809('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x159114,_0x4910cc);});}else{logger[_0xc809('0x32')](_0xc809('0x39'),_0x541374);if(_0x5a3582[_0xc809('0x8')]){logger[_0xc809('0x22')](_0xc809('0x3a'),JSON[_0xc809('0x3b')](_0x5a3582[_0xc809('0x8')]));}}}catch(_0xdcd068){logger['error'](_0xc809('0x3c'),_0xdcd068[_0xc809('0x36')]);}};Acw[_0xc809('0x18')][_0xc809('0xb')]=function(_0x5e6fa1){try{if(this[_0xc809('0x6')][_0x5e6fa1[_0xc809('0x1a')]]&&(this[_0xc809('0x6')][_0x5e6fa1['queue']][_0xc809('0x3')]||this['voiceQueues'][_0x5e6fa1[_0xc809('0x1a')]][_0xc809('0x1b')])){if(this[_0xc809('0x7')][_0x5e6fa1[_0xc809('0x19')]]){this[_0xc809('0x9')][_0x5e6fa1[_0xc809('0x2e')]]={'queue':_0x5e6fa1['queue'],'interface':_0x5e6fa1[_0xc809('0x19')],'destlinkedid':_0x5e6fa1[_0xc809('0x25')]};}}}catch(_0x17ac3e){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x17ac3e[_0xc809('0x36')]);}};Acw[_0xc809('0x18')][_0xc809('0x3d')]=function(_0x1a4626){try{if(this[_0xc809('0x6')][_0x1a4626[_0xc809('0x1a')]]&&(this[_0xc809('0x6')][_0x1a4626[_0xc809('0x1a')]][_0xc809('0x3')]||this[_0xc809('0x6')][_0x1a4626[_0xc809('0x1a')]][_0xc809('0x1b')])){if(this[_0xc809('0x7')][_0x1a4626[_0xc809('0x19')]]){this[_0xc809('0x9')][_0x1a4626[_0xc809('0x2e')]]={'queue':_0x1a4626['queue'],'interface':_0x1a4626[_0xc809('0x19')]};}}}catch(_0x186d63){logger[_0xc809('0x32')](_0xc809('0x3e'),_0x186d63['message']);}};Acw[_0xc809('0x18')][_0xc809('0xc')]=function(_0x1053ce){try{if(this[_0xc809('0x9')][_0x1053ce[_0xc809('0x2e')]]&&_[_0xc809('0x3f')](this['channels'][_0x1053ce[_0xc809('0x2e')]][_0xc809('0x24')])){logger['info'](_0xc809('0x40'),_0x1053ce['uniqueid']);this[_0xc809('0x41')](_0x1053ce[_0xc809('0x2e')]);}else if(this['channels'][_0x1053ce[_0xc809('0x42')]]&&_['isUndefined'](this[_0xc809('0x9')][_0x1053ce[_0xc809('0x42')]]['attended'])){logger['info']('[%s][HANGUP:LINKEDID]',_0x1053ce[_0xc809('0x42')]);this[_0xc809('0x41')](_0x1053ce[_0xc809('0x42')]);}}catch(_0x4671b0){logger[_0xc809('0x32')]('[ACW][syncHangupRequest]\x20%s',_0x4671b0[_0xc809('0x36')]);}};Acw[_0xc809('0x18')]['syncHangup']=function(_0x17fa0d){try{if(this['channels'][_0x17fa0d[_0xc809('0x2e')]]&&this[_0xc809('0x9')][_0x17fa0d[_0xc809('0x2e')]][_0xc809('0x24')]){logger[_0xc809('0x22')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x17fa0d[_0xc809('0x2e')]);this[_0xc809('0x41')](_0x17fa0d[_0xc809('0x2e')]);}else if(this[_0xc809('0x9')][_0x17fa0d[_0xc809('0x42')]]&&this[_0xc809('0x9')][_0x17fa0d[_0xc809('0x42')]][_0xc809('0x24')]){logger[_0xc809('0x22')](_0xc809('0x43'),_0x17fa0d[_0xc809('0x42')]);this[_0xc809('0x41')](_0x17fa0d[_0xc809('0x42')]);}}catch(_0x3d968a){logger[_0xc809('0x32')]('[ACW][syncHangup]\x20%s',_0x3d968a['message']);}};Acw['prototype'][_0xc809('0x12')]=function(_0x33caf0){try{if(!_[_0xc809('0x44')](this[_0xc809('0x9')][_0x33caf0['transfereeuniqueid']])){this[_0xc809('0x41')](_0x33caf0[_0xc809('0x45')]);if(this[_0xc809('0x9')][_0x33caf0[_0xc809('0x46')]]){this['channels'][_0x33caf0[_0xc809('0x46')]][_0xc809('0x24')]=!![];this['channels'][_0x33caf0['transfertargetuniqueid']]=this[_0xc809('0x9')][_0x33caf0[_0xc809('0x46')]];delete this['channels'][_0x33caf0[_0xc809('0x46')]];}}else if(!_[_0xc809('0x44')](this[_0xc809('0x9')][_0x33caf0[_0xc809('0x47')]])){this[_0xc809('0x41')](_0x33caf0['transfertargetuniqueid']);if(this[_0xc809('0x9')][_0x33caf0[_0xc809('0x48')]]){this[_0xc809('0x9')][_0x33caf0[_0xc809('0x48')]][_0xc809('0x24')]=!![];this[_0xc809('0x9')][_0x33caf0['transfereeuniqueid']]=this['channels'][_0x33caf0[_0xc809('0x48')]];delete this['channels'][_0x33caf0['origtransfereruniqueid']];}}}catch(_0x33d18a){logger[_0xc809('0x32')](_0xc809('0x49'),_0x33d18a[_0xc809('0x36')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x2cb8e9){try{if(this['channels'][_0x2cb8e9[_0xc809('0x4a')]]){logger[_0xc809('0x22')](_0xc809('0x4b'),JSON[_0xc809('0x3b')](_0x2cb8e9[_0xc809('0x4a')]));this[_0xc809('0x41')](_0x2cb8e9[_0xc809('0x4a')]);}else if(this[_0xc809('0x9')][_0x2cb8e9[_0xc809('0x4c')]]){logger[_0xc809('0x22')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xc809('0x3b')](_0x2cb8e9[_0xc809('0x4c')]));this[_0xc809('0x41')](_0x2cb8e9[_0xc809('0x4c')]);}}catch(_0x348a19){logger[_0xc809('0x32')](_0xc809('0x4d'),_0x348a19[_0xc809('0x36')]);}};Acw[_0xc809('0x18')][_0xc809('0x10')]=function(_0x3bfc8b){try{if(this['voiceQueues'][_0x3bfc8b[_0xc809('0x1a')]]&&this[_0xc809('0x6')][_0x3bfc8b['queue']][_0xc809('0x4e')]===_0xc809('0x4f')){if(this[_0xc809('0x7')][_0x3bfc8b[_0xc809('0x19')]]){logger['info'](_0xc809('0x50'),_0x3bfc8b[_0xc809('0x2e')],_0x3bfc8b[_0xc809('0x19')],_0x3bfc8b[_0xc809('0x1a')]);return RpcUser['savePause'](this[_0xc809('0x7')][_0x3bfc8b[_0xc809('0x19')]],_0xc809('0x51'),_0x3bfc8b[_0xc809('0x2e')]);}}}catch(_0x3c9902){logger['error'](_0xc809('0x52'),_0x3c9902['message']);}};module[_0xc809('0x53')]=Acw; \ No newline at end of file +var _0x74bd=['agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','error','message','[%s][TIMER][STOP][AGENT:%s]','then','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','syncHangup'];(function(_0x173cea,_0x581723){var _0x3b7c63=function(_0x14ef0f){while(--_0x14ef0f){_0x173cea['push'](_0x173cea['shift']());}};_0x3b7c63(++_0x581723);}(_0x74bd,0x140));var _0xd74b=function(_0x2ddb6d,_0x25d45b){_0x2ddb6d=_0x2ddb6d-0x0;var _0x56c103=_0x74bd[_0x2ddb6d];return _0x56c103;};'use strict';var _=require(_0xd74b('0x0'));var moment=require(_0xd74b('0x1'));var ami=require(_0xd74b('0x2'));var logger=require(_0xd74b('0x3'))(_0xd74b('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xd74b('0x5'));function Acw(_0x190b97){this[_0xd74b('0x6')]=_0x190b97[_0xd74b('0x6')];this[_0xd74b('0x7')]=_0x190b97['agents'];this[_0xd74b('0x8')]=_0x190b97[_0xd74b('0x8')];this[_0xd74b('0x9')]={};ami['on'](_0xd74b('0xa'),this[_0xd74b('0xb')][_0xd74b('0xc')](this));ami['on'](_0xd74b('0xd'),this['syncHangupRequest']['bind'](this));ami['on'](_0xd74b('0xe'),this[_0xd74b('0xf')]['bind'](this));ami['on'](_0xd74b('0x10'),this[_0xd74b('0x11')][_0xd74b('0xc')](this));ami['on']('attendedtransfer',this[_0xd74b('0x12')]['bind'](this));ami['on'](_0xd74b('0x13'),this[_0xd74b('0x14')][_0xd74b('0xc')](this));ami['on'](_0xd74b('0x15'),this[_0xd74b('0x16')]['bind'](this));}function getDiff(_0x39c477){var _0x12dfe1=moment()[_0xd74b('0x17')](0x0);var _0x3e1c0d=moment(_0x39c477)[_0xd74b('0x17')](0x0);return _0x12dfe1['diff'](_0x3e1c0d,_0xd74b('0x18'));}Acw[_0xd74b('0x19')]['startAcw']=function(_0x470016){try{var _0x3f7229=this;var _0x6c0813=this[_0xd74b('0x9')][_0x470016][_0xd74b('0x1a')];var _0x25edea=this['channels'][_0x470016][_0xd74b('0x1b')];var _0x1d901d=this[_0xd74b('0x6')][_0x25edea];var _0x4cd8eb=![];var _0x41f7e8=_0xd74b('0x1c');if(_0x1d901d[_0xd74b('0x1d')]){if(_0x1d901d['mandatoryDispositionPause']['name']){_0x4cd8eb=!![];_0x41f7e8=_0x1d901d[_0xd74b('0x1e')][_0xd74b('0x1f')];}}return ami['Action']({'action':_0xd74b('0x20'),'interface':_0x6c0813,'paused':!![],'reason':_0x41f7e8})['then'](function(){if(_0x3f7229[_0xd74b('0x7')][_0x6c0813]){return RpcUser[_0xd74b('0x21')](_0x3f7229[_0xd74b('0x7')][_0x6c0813]['id'])['then'](function(_0xf60799){if(_0xf60799&&!_0xf60799['voicePause']){logger[_0xd74b('0x22')](_0xd74b('0x23'),_0x470016,_0x6c0813,_0x25edea);var _0x3a6bcc=_0x3f7229['channels'][_0x470016][_0xd74b('0x24')]&&_0x3f7229[_0xd74b('0x9')][_0x470016][_0xd74b('0x25')]?_0x3f7229['channels'][_0x470016][_0xd74b('0x25')]:_0x470016;return RpcUser[_0xd74b('0x26')](_0x3f7229[_0xd74b('0x7')][_0x6c0813],_0x41f7e8,_0x3a6bcc)['then'](function(){if(!_0x4cd8eb){_0x3f7229[_0xd74b('0x8')][_0x6c0813]={};logger[_0xd74b('0x22')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x470016,_0x3f7229['voiceQueues'][_0x25edea][_0xd74b('0x27')],_0x6c0813,_0x25edea);_0x3f7229['timers'][_0x6c0813][_0xd74b('0x28')]=setTimeout(_0x3f7229[_0xd74b('0x29')]['bind'](_0x3f7229,_0x6c0813),_0x3f7229[_0xd74b('0x6')][_0x25edea][_0xd74b('0x27')]*0x3e8);_0x3f7229[_0xd74b('0x8')][_0x6c0813][_0xd74b('0x2a')]=moment()['format'](_0xd74b('0x2b'));_0x3f7229[_0xd74b('0x8')][_0x6c0813][_0xd74b('0x2c')]=_0x470016;_0x3f7229['timers'][_0x6c0813][_0xd74b('0x1b')]=_0x25edea;_0x3f7229['timers'][_0x6c0813][_0xd74b('0x2d')]=function(){var _0x4d1bb1=getDiff(_0x3f7229[_0xd74b('0x8')][_0x6c0813][_0xd74b('0x2a')]);clearTimeout(_0x3f7229['timers'][_0x6c0813][_0xd74b('0x28')]);_0x3f7229[_0xd74b('0x8')][_0x6c0813][_0xd74b('0x28')]=![];RpcVoiceAgentReport[_0xd74b('0x2e')]({'acwtime':_0x4d1bb1},_0x3f7229[_0xd74b('0x8')][_0x6c0813][_0xd74b('0x2c')],_0x6c0813)['then'](function(_0x5361ce){logger[_0xd74b('0x22')](_0xd74b('0x2f'),_0x470016,_0x4d1bb1,_0x5361ce);})[_0xd74b('0x30')](function(_0x11894d){logger['error'](_0xd74b('0x31'),_0x470016,_0x11894d);});delete _0x3f7229['timers'][_0x6c0813];};}});}else{logger[_0xd74b('0x22')](_0xd74b('0x32'),_0x470016,_0x6c0813,_0x25edea);}});}})['catch'](function(){logger['error'](_0xd74b('0x33'),_0x470016,_0x3f7229[_0xd74b('0x6')][_0x25edea][_0xd74b('0x27')],_0x6c0813,_0x25edea);})[_0xd74b('0x34')](function(){delete _0x3f7229[_0xd74b('0x9')][_0x470016];});}catch(_0x33caaa){logger[_0xd74b('0x35')]('[ACW][START]\x20%s',_0x33caaa[_0xd74b('0x36')]);}};Acw['prototype'][_0xd74b('0x29')]=function(_0x50895d){try{var _0x19b19d=this;if(_0x19b19d[_0xd74b('0x8')][_0x50895d]){_0x19b19d[_0xd74b('0x8')][_0x50895d][_0xd74b('0x28')]=![];var _0x28dba9=_0x19b19d['timers'][_0x50895d][_0xd74b('0x2c')];var _0x4b3584=_0x19b19d['timers'][_0x50895d][_0xd74b('0x1b')];var _0x36b4d9=_0x19b19d[_0xd74b('0x6')][_0x4b3584]['acwTimeout'];logger['info'](_0xd74b('0x37'),_0x28dba9,_0x50895d);RpcUser['saveUnpause'](this[_0xd74b('0x7')][_0x50895d]);RpcVoiceAgentReport[_0xd74b('0x2e')]({'acwtime':_0x36b4d9,'agentacw':!![]},_0x28dba9,_0x50895d)[_0xd74b('0x38')](function(_0x6cab9c){logger[_0xd74b('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x28dba9,_0x36b4d9,_0x6cab9c);})[_0xd74b('0x30')](function(_0x4eb291){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x28dba9,_0x4eb291);});}else{logger[_0xd74b('0x35')](_0xd74b('0x39'),_0x50895d);if(_0x19b19d['timers']){logger[_0xd74b('0x22')]('[ACW][TIMERS]',JSON[_0xd74b('0x3a')](_0x19b19d[_0xd74b('0x8')]));}}}catch(_0x44ea09){logger[_0xd74b('0x35')](_0xd74b('0x3b'),_0x44ea09[_0xd74b('0x36')]);}};Acw[_0xd74b('0x19')][_0xd74b('0xb')]=function(_0x44eddb){try{if(this[_0xd74b('0x6')][_0x44eddb[_0xd74b('0x1b')]]&&(this[_0xd74b('0x6')][_0x44eddb[_0xd74b('0x1b')]]['acw']||this['voiceQueues'][_0x44eddb['queue']][_0xd74b('0x1d')])){if(this[_0xd74b('0x7')][_0x44eddb['interface']]){this['channels'][_0x44eddb['uniqueid']]={'queue':_0x44eddb['queue'],'interface':_0x44eddb['interface'],'destlinkedid':_0x44eddb[_0xd74b('0x25')]};}}}catch(_0x3c160d){logger['error'](_0xd74b('0x3c'),_0x3c160d['message']);}};Acw[_0xd74b('0x19')][_0xd74b('0x16')]=function(_0x410647){try{if(this['voiceQueues'][_0x410647[_0xd74b('0x1b')]]&&(this['voiceQueues'][_0x410647[_0xd74b('0x1b')]][_0xd74b('0x4')]||this['voiceQueues'][_0x410647[_0xd74b('0x1b')]][_0xd74b('0x1d')])){if(this[_0xd74b('0x7')][_0x410647[_0xd74b('0x1a')]]){this[_0xd74b('0x9')][_0x410647[_0xd74b('0x2c')]]={'queue':_0x410647['queue'],'interface':_0x410647['interface']};}}}catch(_0x5a467c){logger[_0xd74b('0x35')](_0xd74b('0x3d'),_0x5a467c[_0xd74b('0x36')]);}};Acw[_0xd74b('0x19')]['syncHangupRequest']=function(_0xe84b97){try{if(this['channels'][_0xe84b97[_0xd74b('0x2c')]]&&_[_0xd74b('0x3e')](this['channels'][_0xe84b97[_0xd74b('0x2c')]][_0xd74b('0x24')])){logger[_0xd74b('0x22')](_0xd74b('0x3f'),_0xe84b97[_0xd74b('0x2c')]);this[_0xd74b('0x40')](_0xe84b97[_0xd74b('0x2c')]);}else if(this[_0xd74b('0x9')][_0xe84b97[_0xd74b('0x41')]]&&_[_0xd74b('0x3e')](this[_0xd74b('0x9')][_0xe84b97[_0xd74b('0x41')]][_0xd74b('0x24')])){logger[_0xd74b('0x22')]('[%s][HANGUP:LINKEDID]',_0xe84b97[_0xd74b('0x41')]);this['startAcw'](_0xe84b97[_0xd74b('0x41')]);}}catch(_0x5aaedc){logger[_0xd74b('0x35')](_0xd74b('0x42'),_0x5aaedc[_0xd74b('0x36')]);}};Acw[_0xd74b('0x19')][_0xd74b('0xf')]=function(_0x5d2f6d){try{if(this[_0xd74b('0x9')][_0x5d2f6d[_0xd74b('0x2c')]]&&this[_0xd74b('0x9')][_0x5d2f6d[_0xd74b('0x2c')]]['attended']){logger[_0xd74b('0x22')](_0xd74b('0x43'),_0x5d2f6d['uniqueid']);this['startAcw'](_0x5d2f6d[_0xd74b('0x2c')]);}else if(this['channels'][_0x5d2f6d[_0xd74b('0x41')]]&&this[_0xd74b('0x9')][_0x5d2f6d[_0xd74b('0x41')]][_0xd74b('0x24')]){logger[_0xd74b('0x22')](_0xd74b('0x44'),_0x5d2f6d[_0xd74b('0x41')]);this[_0xd74b('0x40')](_0x5d2f6d['linkedid']);}}catch(_0x5b6cac){logger[_0xd74b('0x35')](_0xd74b('0x45'),_0x5b6cac[_0xd74b('0x36')]);}};Acw[_0xd74b('0x19')][_0xd74b('0x12')]=function(_0x2c02cc){try{if(!_[_0xd74b('0x46')](this[_0xd74b('0x9')][_0x2c02cc[_0xd74b('0x47')]])){this[_0xd74b('0x40')](_0x2c02cc[_0xd74b('0x47')]);if(this[_0xd74b('0x9')][_0x2c02cc[_0xd74b('0x48')]]){this[_0xd74b('0x9')][_0x2c02cc[_0xd74b('0x48')]][_0xd74b('0x24')]=!![];this[_0xd74b('0x9')][_0x2c02cc[_0xd74b('0x49')]]=this[_0xd74b('0x9')][_0x2c02cc[_0xd74b('0x48')]];delete this['channels'][_0x2c02cc[_0xd74b('0x48')]];}}else if(!_[_0xd74b('0x46')](this[_0xd74b('0x9')][_0x2c02cc['transfertargetuniqueid']])){this['startAcw'](_0x2c02cc['transfertargetuniqueid']);if(this[_0xd74b('0x9')][_0x2c02cc[_0xd74b('0x4a')]]){this['channels'][_0x2c02cc[_0xd74b('0x4a')]][_0xd74b('0x24')]=!![];this[_0xd74b('0x9')][_0x2c02cc[_0xd74b('0x47')]]=this[_0xd74b('0x9')][_0x2c02cc[_0xd74b('0x4a')]];delete this['channels'][_0x2c02cc[_0xd74b('0x4a')]];}}}catch(_0x20c7f8){logger[_0xd74b('0x35')]('[ACW][syncAttendedTransfer]\x20%s',_0x20c7f8['message']);}};Acw[_0xd74b('0x19')][_0xd74b('0x14')]=function(_0x54ff45){try{if(this[_0xd74b('0x9')][_0x54ff45['transfereruniqueid']]){logger[_0xd74b('0x22')](_0xd74b('0x4b'),JSON[_0xd74b('0x3a')](_0x54ff45[_0xd74b('0x4c')]));this['startAcw'](_0x54ff45[_0xd74b('0x4c')]);}else if(this['channels'][_0x54ff45['transfererlinkedid']]){logger[_0xd74b('0x22')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xd74b('0x3a')](_0x54ff45[_0xd74b('0x4d')]));this[_0xd74b('0x40')](_0x54ff45[_0xd74b('0x4d')]);}}catch(_0x3bf2e9){logger[_0xd74b('0x35')](_0xd74b('0x4e'),_0x3bf2e9['message']);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x46ed72){try{if(this[_0xd74b('0x6')][_0x46ed72['queue']]&&this[_0xd74b('0x6')][_0x46ed72['queue']][_0xd74b('0x4f')]===_0xd74b('0x50')){if(this[_0xd74b('0x7')][_0x46ed72[_0xd74b('0x1a')]]){logger[_0xd74b('0x22')](_0xd74b('0x51'),_0x46ed72[_0xd74b('0x2c')],_0x46ed72['interface'],_0x46ed72[_0xd74b('0x1b')]);return RpcUser[_0xd74b('0x26')](this[_0xd74b('0x7')][_0x46ed72[_0xd74b('0x1a')]],_0xd74b('0x52'),_0x46ed72['uniqueid']);}}}catch(_0x503450){logger[_0xd74b('0x35')](_0xd74b('0x53'),_0x503450[_0xd74b('0x36')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index bbe6f94..e619b66 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 _0xc6ef=['keepConnected','Action','promisify','action','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','error','close','shutdown','fullybooted','actionSipShowRegistry','then','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','asterisk','port','username','password'];(function(_0x49a087,_0x2edbdc){var _0x3d5df8=function(_0x559930){while(--_0x559930){_0x49a087['push'](_0x49a087['shift']());}};_0x3d5df8(++_0x2edbdc);}(_0xc6ef,0x7d));var _0xfc6e=function(_0x2a1f68,_0x543b54){_0x2a1f68=_0x2a1f68-0x0;var _0x503388=_0xc6ef[_0x2a1f68];return _0x503388;};'use strict';var Manager=require(_0xfc6e('0x0'));var BPromise=require(_0xfc6e('0x1'));var util=require(_0xfc6e('0x2'));var logger=require('../../config/logger')('ami');var config=require('../../config/environment');var ami=new Manager(config[_0xfc6e('0x3')][_0xfc6e('0x4')],config[_0xfc6e('0x3')]['ip'],config[_0xfc6e('0x3')][_0xfc6e('0x5')],config['asterisk'][_0xfc6e('0x6')],!![]);ami[_0xfc6e('0x7')]();ami[_0xfc6e('0x8')]=BPromise[_0xfc6e('0x9')](ami[_0xfc6e('0xa')]);function error(_0x5b1c75){logger['error'](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xfc6e('0x5')],config[_0xfc6e('0x3')]['ip'],config[_0xfc6e('0x3')][_0xfc6e('0x4')],util[_0xfc6e('0xb')](_0x5b1c75,![],null)));}function close(){logger['error'](util[_0xfc6e('0xc')](_0xfc6e('0xd'),config[_0xfc6e('0x3')][_0xfc6e('0x5')],config[_0xfc6e('0x3')]['ip'],config[_0xfc6e('0x3')][_0xfc6e('0x4')]));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0xfc6e('0xe')});};};ami[_0xfc6e('0xf')]=function(){return function(){return ami[_0xfc6e('0x8')]({'action':'devicestatelist'});};};ami[_0xfc6e('0x10')]=function(){return function(){return ami['Action']({'action':_0xfc6e('0x11')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xfc6e('0x8')]({'action':_0xfc6e('0x12')});};};ami[_0xfc6e('0x13')]=function(){return function(){return ami[_0xfc6e('0x8')]({'action':_0xfc6e('0x14')});};};function connect(){logger[_0xfc6e('0x15')](util['format'](_0xfc6e('0x16'),config[_0xfc6e('0x3')][_0xfc6e('0x5')],config['asterisk']['ip'],config[_0xfc6e('0x3')][_0xfc6e('0x4')]));ami[_0xfc6e('0x17')](_0xfc6e('0x18'),error);ami[_0xfc6e('0x17')](_0xfc6e('0x19'),close);}ami['on']('connect',connect);ami['on'](_0xfc6e('0x1a'),function(_0x1470f8){logger[_0xfc6e('0x15')](util[_0xfc6e('0xc')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xfc6e('0x5')],config['asterisk']['ip'],config[_0xfc6e('0x3')][_0xfc6e('0x4')],util[_0xfc6e('0xb')](_0x1470f8,![],null)));});ami['on'](_0xfc6e('0x1b'),function(){logger['info'](util[_0xfc6e('0xc')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xfc6e('0x3')][_0xfc6e('0x5')],config[_0xfc6e('0x3')]['ip'],config[_0xfc6e('0x3')][_0xfc6e('0x4')]));return Promise['resolve']()['then'](ami[_0xfc6e('0x1c')]())[_0xfc6e('0x1d')](ami[_0xfc6e('0xf')]())[_0xfc6e('0x1d')](ami[_0xfc6e('0x10')]())[_0xfc6e('0x1d')](ami['actionQueueSummary']())[_0xfc6e('0x1d')](ami[_0xfc6e('0x13')]())[_0xfc6e('0x1e')](function(_0x136746){logger[_0xfc6e('0x18')](_0xfc6e('0x1f'),util[_0xfc6e('0xb')](_0x136746,{'showHidden':![],'depth':null}));});});ami[_0xfc6e('0x17')](_0xfc6e('0x18'),error);ami[_0xfc6e('0x17')](_0xfc6e('0x19'),close);module[_0xfc6e('0x20')]=ami; \ No newline at end of file +var _0x87d2=['port','username','password','keepConnected','promisify','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','format','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','util','asterisk'];(function(_0x2e6a69,_0x1ba014){var _0x583b2a=function(_0x1e8d49){while(--_0x1e8d49){_0x2e6a69['push'](_0x2e6a69['shift']());}};_0x583b2a(++_0x1ba014);}(_0x87d2,0x189));var _0x287d=function(_0x262e6f,_0x2b29aa){_0x262e6f=_0x262e6f-0x0;var _0x44b895=_0x87d2[_0x262e6f];return _0x44b895;};'use strict';var Manager=require(_0x287d('0x0'));var BPromise=require('bluebird');var util=require(_0x287d('0x1'));var logger=require('../../config/logger')('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x287d('0x2')][_0x287d('0x3')],config[_0x287d('0x2')]['ip'],config[_0x287d('0x2')][_0x287d('0x4')],config[_0x287d('0x2')][_0x287d('0x5')],!![]);ami[_0x287d('0x6')]();ami['Action']=BPromise[_0x287d('0x7')](ami['action']);function error(_0x471c87){logger[_0x287d('0x8')](util['format'](_0x287d('0x9'),config['asterisk'][_0x287d('0x4')],config[_0x287d('0x2')]['ip'],config[_0x287d('0x2')][_0x287d('0x3')],util[_0x287d('0xa')](_0x471c87,![],null)));}function close(){logger['error'](util['format'](_0x287d('0xb'),config['asterisk'][_0x287d('0x4')],config[_0x287d('0x2')]['ip'],config['asterisk'][_0x287d('0x3')]));}ami[_0x287d('0xc')]=function(){return function(){return ami[_0x287d('0xd')]({'action':_0x287d('0xe')});};};ami[_0x287d('0xf')]=function(){return function(){return ami['Action']({'action':_0x287d('0x10')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x287d('0xd')]({'action':_0x287d('0x11')});};};ami[_0x287d('0x12')]=function(){return function(){return ami[_0x287d('0xd')]({'action':'queuesummary'});};};ami[_0x287d('0x13')]=function(){return function(){return ami[_0x287d('0xd')]({'action':_0x287d('0x14')});};};function connect(){logger[_0x287d('0x15')](util[_0x287d('0x16')](_0x287d('0x17'),config[_0x287d('0x2')][_0x287d('0x4')],config[_0x287d('0x2')]['ip'],config[_0x287d('0x2')][_0x287d('0x3')]));ami[_0x287d('0x18')](_0x287d('0x8'),error);ami[_0x287d('0x18')](_0x287d('0x19'),close);}ami['on'](_0x287d('0x1a'),connect);ami['on'](_0x287d('0x1b'),function(_0x1d1673){logger[_0x287d('0x15')](util[_0x287d('0x16')](_0x287d('0x1c'),config['asterisk']['username'],config[_0x287d('0x2')]['ip'],config[_0x287d('0x2')][_0x287d('0x3')],util[_0x287d('0xa')](_0x1d1673,![],null)));});ami['on']('fullybooted',function(){logger[_0x287d('0x15')](util[_0x287d('0x16')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x287d('0x2')][_0x287d('0x4')],config[_0x287d('0x2')]['ip'],config[_0x287d('0x2')][_0x287d('0x3')]));return Promise[_0x287d('0x1d')]()['then'](ami[_0x287d('0xc')]())['then'](ami[_0x287d('0xf')]())[_0x287d('0x1e')](ami['actionSipPeerStatus']())[_0x287d('0x1e')](ami[_0x287d('0x12')]())[_0x287d('0x1e')](ami[_0x287d('0x13')]())['catch'](function(_0x2b61db){logger[_0x287d('0x8')](_0x287d('0x1f'),util[_0x287d('0xa')](_0x2b61db,{'showHidden':![],'depth':null}));});});ami[_0x287d('0x18')](_0x287d('0x8'),error);ami[_0x287d('0x18')]('close',close);module[_0x287d('0x20')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 94b1dde..a4b815d 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 _0xf4eb=['rpc','error','message','result','exports','jayson/promise','http','request','then','debug','memberReport'];(function(_0x509f97,_0x442414){var _0x18bbef=function(_0x4787c5){while(--_0x4787c5){_0x509f97['push'](_0x509f97['shift']());}};_0x18bbef(++_0x442414);}(_0xf4eb,0xec));var _0xbf4e=function(_0x52fa0b,_0x777a9a){_0x52fa0b=_0x52fa0b-0x0;var _0x322152=_0xf4eb[_0x52fa0b];return _0x322152;};'use strict';var jayson=require(_0xbf4e('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('ami');var client=jayson['client'][_0xbf4e('0x1')]({'port':0x2329});client['Request']=function(_0x4e7fa7,_0x2e3070){return new BPromise(function(_0x1c7606,_0x32d1d7){return client[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070)[_0xbf4e('0x3')](function(_0x2fcfed){logger[_0xbf4e('0x4')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x2e3070,_0x2fcfed);if(_0x2fcfed['error']){logger['error'](_0xbf4e('0x6'),_0xbf4e('0x5'),_0x4e7fa7,_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')],_0x2e3070);return _0x32d1d7(_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')]);}else{return _0x1c7606(_0x2fcfed[_0xbf4e('0x9')]);}})['catch'](function(_0x4d9a07){logger[_0xbf4e('0x7')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x4d9a07,_0x2e3070);return _0x32d1d7(_0x4d9a07);});});};module[_0xbf4e('0xa')]=client; \ No newline at end of file +var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0xdfcf22,_0x322509){var _0x59b62f=function(_0x3a745f){while(--_0x3a745f){_0xdfcf22['push'](_0xdfcf22['shift']());}};_0x59b62f(++_0x322509);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 14f56e4..a3c02c7 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 _0x9a61=['object','originate','voiceQueue\x20is\x20undefine','phone','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','avgHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','predictiveIntervalTotalCalls','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','countReScheduled','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','uuid','moment','ioredis','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/final','./models/agentComplete','./models/hangup','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBookedRR','queuesSummary','bind','queuecallerabandon','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','syncNewExten','varset','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','emit','type','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','-----\x20Stats\x20Predictive\x20---','info','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','startProgressive','debug','name','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','isEmpty','isIVRCampaignActive','INACTIVE','campaign:ivr:%s','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','[ifTime][Action]','prototype','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','Intervals','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','interval','content','indexOf','true','catch','iftime\x20%s,%s','all','some','OVERTIME_GLOBAL_INTERVAL','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','booked','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Global:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','Error','syncAgentConnect','queue','uniqueid','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','reason','agent','agiafterat','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop','dropreason','TIMEOUT','callAdditionalPhoneAfterMin','voiceQueue','additional','queueCallerAbandonCreateState','rescheduleContact','countdropretry','dialDropRetryFrequency','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','starttime','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','verifyAdditionalPhones','dialAbandonedMaxRetry','add','channel','actionid','strategy','rrmemory','roundrobin','isNil','stateinterface','locked','queueBooked','pick','paused','syncQueueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','responsetime','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','AMD','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','Machine','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','membername','countagentrejectretry','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','[syncHangupIvr]','outboundUnknownCallsDay','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','dialPreviewRecallmeReminder','filter','online','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20is\x20null\x20or\x20undefined','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','user:%s','handleIvr','actionOriginate'];(function(_0x137eef,_0x83dd71){var _0x454be4=function(_0xd2e319){while(--_0xd2e319){_0x137eef['push'](_0x137eef['shift']());}};_0x454be4(++_0x83dd71);}(_0x9a61,0xc5));var _0x19a6=function(_0x390f16,_0x58ca29){_0x390f16=_0x390f16-0x0;var _0x212532=_0x9a61[_0x390f16];return _0x212532;};'use strict';var util=require(_0x19a6('0x0'));var _=require(_0x19a6('0x1'));var uuid=require(_0x19a6('0x2'));var moment=require(_0x19a6('0x3'));var rr=require('rr');var Redis=require(_0x19a6('0x4'));var utils=require('./utils');var hopperUtils=require(_0x19a6('0x5'));var ut=require(_0x19a6('0x6'));var config=require(_0x19a6('0x7'));var logger=require(_0x19a6('0x8'))(_0x19a6('0x9'));var loggerBooked=require(_0x19a6('0x8'))('booked');var loggerPredictive=require(_0x19a6('0x8'))(_0x19a6('0xa'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x19a6('0x8'))(_0x19a6('0xb'));var ami=require('../ami');config[_0x19a6('0xc')]=_[_0x19a6('0xd')](config['redis'],{'host':_0x19a6('0xe'),'port':0x18eb});var io=require(_0x19a6('0xf'))(new Redis(config[_0x19a6('0xc')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x19a6('0x10'));var RpcSetting=require(_0x19a6('0x11'));var Interval=require(_0x19a6('0x12'));var Action=require(_0x19a6('0x13'));var History=require('./models/history');var Final=require(_0x19a6('0x14'));var AgentComplete=require(_0x19a6('0x15'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x19a6('0x16'));var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0x19a6('0x17')]=function(_0x3ab990){this[_0x19a6('0x18')]=this['tail']?this[_0x19a6('0x18')][_0x19a6('0x19')](_0x3ab990):_0x3ab990();};function Dialer(_0x1023a1,_0x38ca5c){this[_0x19a6('0x1a')]=new Sequence();this[_0x19a6('0x1b')]=_0x38ca5c;this[_0x19a6('0x1c')]=_0x1023a1[_0x19a6('0x1c')];this['campaigns']=_0x1023a1[_0x19a6('0x1d')];this[_0x19a6('0x1e')]=_0x1023a1['agents'];this[_0x19a6('0x1f')]=_0x1023a1[_0x19a6('0x1f')];this[_0x19a6('0x20')]=config[_0x19a6('0x20')]||0x2;this[_0x19a6('0x21')]={};this[_0x19a6('0x22')]={};this[_0x19a6('0x23')]={};this[_0x19a6('0x24')]={};this[_0x19a6('0x25')]={};this[_0x19a6('0x26')]={};this['startProgressive']={};this[_0x19a6('0x27')]={};this['queueBooked']={};this[_0x19a6('0x28')]={};this[_0x19a6('0x29')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x19a6('0x2a')](this));ami['on'](_0x19a6('0x2b'),this['syncQueueCallerAbandon'][_0x19a6('0x2a')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x19a6('0x2a')](this));ami['on'](_0x19a6('0x2c'),this[_0x19a6('0x2d')]['bind'](this));ami['on'](_0x19a6('0x2e'),this[_0x19a6('0xb')][_0x19a6('0x2a')](this));ami['on'](_0x19a6('0x2f'),this[_0x19a6('0x30')][_0x19a6('0x2a')](this));ami['on']('hangup',this[_0x19a6('0x31')][_0x19a6('0x2a')](this));ami['on']('newexten',this[_0x19a6('0x32')][_0x19a6('0x2a')](this));ami['on'](_0x19a6('0x33'),this['syncVarSet']['bind'](this));ami['on']('queuemember',this[_0x19a6('0x34')][_0x19a6('0x2a')](this));ami['on'](_0x19a6('0x35'),this['syncQueueStatusComplete']['bind'](this));this[_0x19a6('0x36')]();this[_0x19a6('0x37')]();RpcSetting[_0x19a6('0x38')]()[_0x19a6('0x39')](function(_0x48887b){previewRecallmeReminderInterval=_0x48887b[_0x19a6('0x3a')];});}function isNotNull(_0x2a141d){return _0x2a141d!==null&&!_['isUndefined'](_0x2a141d);}function msgResponse(_0x404ebf,_0x46f54c,_0x2f04bb){return{'action':_0x404ebf,'response':_0x46f54c,'message':_0x2f04bb,'stack':_0x2f04bb};}function emit(_0x5a4a0a,_0x468caa,_0x213b45){io['to'](_0x5a4a0a)[_0x19a6('0x3b')](_0x468caa,_0x213b45);}function emitOutboundVoiceQueueSummary(_0x4e5ec6){if(_0x4e5ec6[_0x19a6('0x3c')]===_0x19a6('0x3d')){logger['debug'](_0x19a6('0x3e'),util[_0x19a6('0x3f')](_0x4e5ec6,{'showHidden':![],'depth':null}));emit(util[_0x19a6('0x40')](_0x19a6('0x41'),_0x4e5ec6['name']),'voice_queue:save',_0x4e5ec6);}}function checkGetDataPredictive(_0x14e83a){if(isNotNull(_0x14e83a)&&!_['isEmpty'](_0x14e83a)){loggerPredictive['info'](_0x19a6('0x42'));loggerPredictive[_0x19a6('0x43')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14e83a['predictiveIntervalTotalCalls']);loggerPredictive[_0x19a6('0x43')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14e83a['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x19a6('0x44'),_0x14e83a[_0x19a6('0x45')]);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x46'),_0x14e83a[_0x19a6('0x47')]);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x48'),_0x14e83a[_0x19a6('0x49')]);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x4a'),_0x14e83a['predictiveIntervalAvgTalktime']);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x4b'));if(_0x14e83a['predictiveIntervalTotalCalls']>0x0){if(!_[_0x19a6('0x4c')](_0x14e83a[_0x19a6('0x4d')])&&_0x14e83a[_0x19a6('0x4d')]>0x0){return!![];}loggerPredictive['info'](_0x19a6('0x4e'));if(!_[_0x19a6('0x4c')](_0x14e83a[_0x19a6('0x49')])&&_0x14e83a[_0x19a6('0x49')]>0x0){return!![];}loggerPredictive[_0x19a6('0x43')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x19a6('0x43')](_0x19a6('0x4f'));}}else{loggerPredictive[_0x19a6('0x43')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x444d06){return function(_0x7218d){loggerPredictive[_0x19a6('0x43')](_0x19a6('0x50'));loggerPredictive[_0x19a6('0x43')](_0x19a6('0x51'),_0x7218d[_0x19a6('0x52')]);loggerPredictive[_0x19a6('0x43')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x7218d[_0x19a6('0x53')]);loggerPredictive[_0x19a6('0x43')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x7218d[_0x19a6('0x54')]);loggerPredictive['info'](_0x19a6('0x55'),_0x7218d[_0x19a6('0x56')]);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x57'),_0x7218d['erlangAbandonmentRate']);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x4b'));_[_0x19a6('0x58')](_0x444d06,_0x7218d);};}function ifInterval(_0x4137b4,_0x3afe43){if(_[_0x19a6('0x4c')](_0x3afe43)){return![];}return utils[_0x19a6('0x59')](undefined,_0x3afe43)<_0x4137b4*0x3c;}function clearPredictiveAttributes(_0xc1fda){if(_0xc1fda[_0x19a6('0x5a')]){_0xc1fda[_0x19a6('0x5a')]=undefined;loggerPredictive[_0x19a6('0x5b')](_0xc1fda[_0x19a6('0x5c')],_0x19a6('0x5d'));}if(_0xc1fda[_0x19a6('0x26')]){_0xc1fda['startPredictive']=undefined;loggerPredictive['debug'](_0xc1fda[_0x19a6('0x5c')],'startPredictive\x20value\x20cleared');}if(_0xc1fda[_0x19a6('0x5e')]){clearInterval(_0xc1fda['handlePredictive']);_0xc1fda[_0x19a6('0x5e')]=undefined;loggerPredictive[_0x19a6('0x5b')](_0xc1fda[_0x19a6('0x5c')],_0x19a6('0x5f'));}}function loggerCatchPredictive(_0x4ca2a9,_0x1f40e7){return function(_0x4ad996){loggerPredictive['error'](_0x1f40e7['name'],_0x4ca2a9);loggerPredictive[_0x19a6('0x60')](_0x4ad996[_0x19a6('0x61')]);clearPredictiveAttributes(_0x1f40e7);};}function loggerCatch(_0x2c6636){return function(_0x1d8427){logger['error'](_0x2c6636,util[_0x19a6('0x3f')](_0x1d8427,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x35a50b,_0x2f03ff,_0x134125){return function(_0x37b7e5){utils[_0x19a6('0x62')](_0x2f03ff,_0x134125,0x0);logger[_0x19a6('0x60')](_0x35a50b,util[_0x19a6('0x3f')](_0x37b7e5,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xcc8352){return function(_0x298be4){if(isNotNull(_0x298be4)&&isNotNull(_0x298be4[0x0])){if(_0x298be4[0x0][_0x19a6('0x63')]>0x0){_0xcc8352[_0x19a6('0x64')]=utils[_0x19a6('0x65')][_0x19a6('0x66')];logger[_0x19a6('0x43')](_0x19a6('0x67')+_0xcc8352['name'],_0x298be4[0x0]['contactsRescheduled'],'contacts');}else{_0xcc8352[_0x19a6('0x64')]=utils[_0x19a6('0x65')][_0x19a6('0x68')];logger[_0x19a6('0x43')](_0x19a6('0x69')+_0xcc8352[_0x19a6('0x5c')]);}}};}function createObjHistory(_0x53e97e,_0x151377,_0x240dd1,_0x2c92f0,_0x10fd01){_0x53e97e[_0x19a6('0x64')]=_0x240dd1;var _0x322bb5=new Action(_0x53e97e,_0x151377);var _0x2f2602=new History(_0x322bb5);_0x2f2602[_0x19a6('0x6a')]=_0x2c92f0;_0x2f2602['statedesc']=_0x10fd01;_0x2f2602['endtime']=_0x322bb5['starttime'];return _0x2f2602;}function unlockQueueStatus(_0x124138,_0xb55294){setTimeout(function(){if(_['isUndefined'](_0x124138[_0x19a6('0x6b')])){loggerBooked[_0x19a6('0x60')](_0x19a6('0x6c'),_0xb55294);}_0x124138[_0x19a6('0x6b')]=!![];loggerBooked[_0x19a6('0x43')](_0x19a6('0x6d'),_0xb55294,JSON[_0x19a6('0x6e')](_['pick'](_0x124138,[_0x19a6('0x5c'),_0x19a6('0x6b')])));},0x1f3);}function checkInterval(_0xa9336a){return function(){if(!isNotNull(_0xa9336a[_0x19a6('0x6f')])){_0xa9336a[_0x19a6('0x64')]=utils[_0x19a6('0x65')][_0x19a6('0x70')];throw _0xa9336a['name']+_0x19a6('0x71');}if(!isNotNull(_0xa9336a['Interval']['Intervals'])){_0xa9336a[_0x19a6('0x64')]=utils[_0x19a6('0x65')][_0x19a6('0x70')];throw _0xa9336a[_0x19a6('0x5c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x19a6('0x72')](_0xa9336a['Interval']['Intervals']))){_0xa9336a['message']=utils[_0x19a6('0x65')][_0x19a6('0x70')];throw _0xa9336a[_0x19a6('0x5c')]+_0x19a6('0x71');}};}function checkIsIVRCampaignActive(_0x1bc8ce){return function(){if(!utils[_0x19a6('0x73')](_0x1bc8ce)){_0x1bc8ce['message']=utils[_0x19a6('0x65')][_0x19a6('0x74')];throw _0x1bc8ce['name']+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x307983){if(utils['isIVRCampaign'](_0x307983)){emit(util[_0x19a6('0x40')](_0x19a6('0x75'),_0x307983['name']),'campaign:save',_0x307983);}}function loggerCatchQueueSummary(_0x34e59c,_0x158f5a){return function(_0x16cefe){clearPredictiveAttributes(_0x158f5a);emitCampaignSummary(_0x158f5a);loggerSyncQueueSummary['debug'](_0x34e59c,util[_0x19a6('0x3f')](_0x16cefe,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x45480a){if(_0x45480a[_0x19a6('0x76')]){if(_0x45480a[_0x19a6('0x77')]===0x0){_0x45480a[_0x19a6('0x76')]=![];_0x45480a[_0x19a6('0x64')]=utils[_0x19a6('0x65')]['INACTIVE'];loggerSyncQueueSummary[_0x19a6('0x5b')](_0x19a6('0x78'),_0x45480a[_0x19a6('0x5c')],'is\x20not\x20active');}else{_0x45480a[_0x19a6('0x64')]=utils[_0x19a6('0x65')][_0x19a6('0x79')];loggerSyncQueueSummary[_0x19a6('0x5b')](_0x19a6('0x78'),_0x45480a['name'],_0x19a6('0x7a'));}emitCampaignSummary(_0x45480a);}}function myreject(_0x27152d){return function(_0x2b3d1e){return _0x27152d(msgResponse(_0x19a6('0x7b'),'Error',JSON['stringify'](_0x2b3d1e)));};}Dialer[_0x19a6('0x7c')][_0x19a6('0x7d')]=function(_0x36d958){return!_[_0x19a6('0x4c')](_0x36d958)&&_0x36d958&&!_['isUndefined'](_0x36d958[_0x19a6('0x5c')])&&!_[_0x19a6('0x4c')](_0x36d958[_0x19a6('0x7e')])&&_0x36d958[_0x19a6('0x7e')]&&(this[_0x19a6('0x1f')][util['format'](_0x19a6('0x7f'),_0x36d958[_0x19a6('0x5c')])][_0x19a6('0x80')]===_0x19a6('0x81')||this[_0x19a6('0x1f')][util['format']('SIP/%s',_0x36d958[_0x19a6('0x5c')])][_0x19a6('0x80')]===_0x19a6('0x82'));};Dialer['prototype'][_0x19a6('0x83')]=function(_0x5c26c4){var _0xdf59f1=this;return function(){if(!_0xdf59f1[_0x19a6('0x7d')](_0x5c26c4[_0x19a6('0x84')])){if(!_0xdf59f1[_0x19a6('0x7d')](_0x5c26c4[_0x19a6('0x85')])){_0x5c26c4['message']=utils[_0x19a6('0x65')][_0x19a6('0x86')];throw _0x5c26c4[_0x19a6('0x5c')]+_0x19a6('0x87');}}};};Dialer['prototype']['checkIfTime']=function(_0x133593,_0xd2fdf5,_0x18f1bc,_0x14e574){var _0x1f55e4=this;return function(){var _0x5d8993=!![];return _0x1f55e4[_0x19a6('0x88')](_0x133593,_0xd2fdf5,_0x18f1bc,_0x14e574,_0x5d8993);};};Dialer[_0x19a6('0x7c')][_0x19a6('0x89')]=function(_0x44b86f,_0x21bb3b,_0x2d8ccb,_0x2e6f95){var _0x4f0319=this;return function(){var _0x47ecde=![];return _0x4f0319[_0x19a6('0x88')](_0x44b86f[_0x19a6('0x8a')],_0x21bb3b,_0x2d8ccb,_0x2e6f95,_0x47ecde);};};Dialer['prototype'][_0x19a6('0x88')]=function(_0x3e8706,_0x340dc1,_0x43326d,_0x26a802,_0x1ef95b){var _0x3ac2ea=[];return new Promise(function(_0x4ee307,_0x33586c){if(!isNotNull(_0x3e8706)){_0x26a802[_0x19a6('0x64')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x33586c(msgResponse(_0x19a6('0x8b'),_0x19a6('0x8c'),_0x43326d+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x19a6('0x72')](_0x3e8706)){_0x26a802[_0x19a6('0x64')]=utils[_0x19a6('0x65')]['EMPTY_INTERVAL'];return _0x33586c(msgResponse('ifTime',_0x19a6('0x8c'),_0x43326d+_0x19a6('0x8d')));}if(_0x340dc1&&_['isUndefined'](config[_0x19a6('0x8e')][_0x340dc1])){_0x26a802['message']=utils[_0x19a6('0x65')][_0x19a6('0x8f')];return _0x33586c(msgResponse(_0x19a6('0x8b'),_0x19a6('0x8c'),_0x43326d+_0x19a6('0x90')+_0x340dc1));}if(_[_0x19a6('0x91')](_0x3e8706)){for(var _0x5b3bac=0x0;_0x5b3bac<_0x3e8706[_0x19a6('0x92')];_0x5b3bac+=0x1){_0x3ac2ea[_0x19a6('0x93')](ami[_0x19a6('0x94')]({'action':_0x19a6('0x95'),'command':util['format']('iftime\x20%s,%s',_0x3e8706[_0x5b3bac][_0x19a6('0x96')],!_[_0x19a6('0x4c')](config[_0x19a6('0x8e')][_0x340dc1])?_0x340dc1:'')})[_0x19a6('0x39')](function(_0x9286dd){return _0x9286dd[_0x19a6('0x97')][_0x19a6('0x98')](_0x19a6('0x99'))>=0x0;})[_0x19a6('0x9a')](myreject(_0x33586c)));}}else{_0x3ac2ea[_0x19a6('0x93')](ami[_0x19a6('0x94')]({'action':_0x19a6('0x95'),'command':util[_0x19a6('0x40')](_0x19a6('0x9b'),_0x3e8706,!_[_0x19a6('0x4c')](config[_0x19a6('0x8e')][_0x340dc1])?_0x340dc1:'')})['then'](function(_0x50f232){return _0x50f232[_0x19a6('0x97')][_0x19a6('0x98')]('true')>=0x0;})['catch'](myreject(_0x33586c)));}Promise[_0x19a6('0x9c')](_0x3ac2ea)[_0x19a6('0x39')](function(_0x430a5b){var _0xe1d8d5=_[_0x19a6('0x9d')](_0x430a5b);if(_0xe1d8d5){return _0x4ee307(_0xe1d8d5);}else{_0x26a802[_0x19a6('0x64')]=_0x1ef95b?utils[_0x19a6('0x65')][_0x19a6('0x9e')]:utils[_0x19a6('0x65')]['OVERTIME_INTERVAL'];return _0x33586c(msgResponse('[ifTime][promiseAll]',_0x19a6('0x8c'),'Global:\x20'+_0x1ef95b+'\x20'+_0x43326d+_0x19a6('0x9f')+util[_0x19a6('0x3f')](_0x3e8706,{'showHidden':![],'depth':null})+_0x19a6('0xa0')+_0x340dc1));}})[_0x19a6('0x9a')](function(_0x347e64){return _0x33586c(msgResponse(_0x19a6('0x8b'),_0x19a6('0x8c'),JSON[_0x19a6('0x6e')](_0x347e64)));});});};Dialer[_0x19a6('0x7c')][_0x19a6('0x36')]=function(){var _0xe15d7=this;return cmHopper[_0x19a6('0xa1')]({'active':![]},{'where':{'active':!![]}})[_0x19a6('0x39')](function(){setInterval(function(){_0xe15d7[_0x19a6('0xa2')]();},0x3e8);});};Dialer[_0x19a6('0x7c')][_0x19a6('0xa2')]=function(){var _0x395777=this;var _0x3eb55b;for(var _0x4fc16d in this['campaigns']){if(typeof this[_0x19a6('0x1d')][_0x4fc16d]!==_0x19a6('0xa3')){_0x3eb55b=this['campaigns'][_0x4fc16d];if(utils[_0x19a6('0xa4')](_0x3eb55b)&&utils['isIVRCampaignActive'](_0x3eb55b)){_0x3eb55b[_0x19a6('0x76')]=!![];Promise['resolve']()[_0x19a6('0x39')](checkIsIVRCampaignActive(_0x3eb55b))['then'](checkInterval(_0x3eb55b))['then'](_0x395777[_0x19a6('0x83')](_0x3eb55b))[_0x19a6('0x39')](_0x395777['checkIfTime'](_0x3eb55b[_0x19a6('0xa5')],_0x3eb55b['dialTimezone'],_0x3eb55b[_0x19a6('0x5c')],_0x3eb55b))[_0x19a6('0x39')](_0x395777['checkIfTimeIntervals'](_0x3eb55b[_0x19a6('0x6f')],_0x3eb55b[_0x19a6('0xa6')],_0x3eb55b[_0x19a6('0x5c')],_0x3eb55b))[_0x19a6('0x39')](_0x395777[_0x19a6('0xa7')](_0x3eb55b))['catch'](loggerCatchQueueSummary(_0x19a6('0xa8'),_0x3eb55b));}else{notSendMessagesCampaign(_0x3eb55b);}}}};Dialer[_0x19a6('0x7c')][_0x19a6('0xa9')]=function(_0x2adba4){if(_0x2adba4[_0x19a6('0xaa')]!==_0x19a6('0xa')){clearPredictiveAttributes(_0x2adba4);}switch(_0x2adba4[_0x19a6('0xaa')]){case _0x19a6('0xab'):this[_0x19a6('0xac')](_0x2adba4,0x1);break;case'power':this[_0x19a6('0xac')](_0x2adba4,_0x2adba4[_0x19a6('0xad')]);break;case'predictive':this[_0x19a6('0xa')](_0x2adba4);break;case _0x19a6('0xae'):this[_0x19a6('0xac')](_0x2adba4,0x1);break;default:logger['error']('Queue',_0x2adba4[_0x19a6('0x5c')],_0x19a6('0xaf'));}};Dialer[_0x19a6('0x7c')][_0x19a6('0x8b')]=function(_0x1282f1,_0x36bb47){var _0x1ccaf8=_0x1282f1[_0x19a6('0xa6')];var _0x4b00c1=_0x36bb47?_0x1282f1['dialGlobalInterval']:_0x1282f1[_0x19a6('0x6f')]['Intervals'];logger[_0x19a6('0xb0')](_0x19a6('0xb1'),_0x4b00c1,_0x1ccaf8,_0x1282f1['name'],util[_0x19a6('0x40')](_0x19a6('0xb2'),_0x1282f1[_0x19a6('0x5c')],_0x1282f1['id']));var _0x2ce3fa=null;return Interval[_0x19a6('0xb3')](_0x4b00c1,_0x1ccaf8)[_0x19a6('0x39')](function(_0x454a88){if(_0x454a88===!![]){return _0x454a88;}else{_0x1282f1[_0x19a6('0x64')]=_0x36bb47?utils[_0x19a6('0x65')][_0x19a6('0x9e')]:utils[_0x19a6('0x65')]['OVERTIME_INTERVAL'];_0x2ce3fa=msgResponse('[ifTime][promiseAll]',_0x19a6('0x8c'),_0x19a6('0xb4')+_0x36bb47+'\x20'+_0x1282f1[_0x19a6('0x5c')]+_0x19a6('0x9f')+util['inspect'](_0x4b00c1,{'showHidden':![],'depth':null})+_0x19a6('0xa0')+_0x1ccaf8);}if(_0x2ce3fa!==null){logger[_0x19a6('0xb0')](_0x19a6('0xb5'),_0x2ce3fa);_0x2ce3fa[_0x19a6('0xb6')]=_0x36bb47;throw _0x2ce3fa;}})[_0x19a6('0x9a')](function(_0x31d376){logger[_0x19a6('0x60')](_0x19a6('0xb7'),_0x31d376);throw msgResponse(_0x19a6('0x7b'),_0x19a6('0xb8'),util[_0x19a6('0x3f')](_0x31d376,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x19a6('0xb9')]=function(_0x36c6db){if(this['voiceQueues'][_0x36c6db[_0x19a6('0xba')]]){if(this[_0x19a6('0x24')][_0x36c6db[_0x19a6('0xbb')]]&&this[_0x19a6('0x24')][_0x36c6db['uniqueid']][_0x19a6('0x3c')]!==_0x19a6('0xbc')){this[_0x19a6('0xbd')](this[_0x19a6('0x1c')][_0x36c6db[_0x19a6('0xba')]]);this[_0x19a6('0x24')][_0x36c6db[_0x19a6('0xbb')]]['answertime']=moment()[_0x19a6('0x40')](_0x19a6('0xbe'));}}};Dialer['prototype'][_0x19a6('0x2d')]=function(_0x242bad){var _0x52a687=this[_0x19a6('0x24')][_0x242bad[_0x19a6('0xbb')]];if(this[_0x19a6('0x1c')][_0x242bad['queue']]){if(_0x52a687&&_0x52a687[_0x19a6('0x3c')]!==_0x19a6('0xbc')){delete this[_0x19a6('0x24')][_0x242bad[_0x19a6('0xbb')]];this['voiceQueues'][_0x242bad[_0x19a6('0xba')]]['outboundAnswerCallsDay']+=0x1;var _0x4082a5=new AgentComplete(_0x52a687,_0x242bad);if(_0x242bad[_0x19a6('0xbf')]===_0x19a6('0xc0')){_0x4082a5[_0x19a6('0xc1')]=this['voiceQueues'][_0x242bad[_0x19a6('0xba')]]['dialQueueProject2']&&this[_0x19a6('0x1c')][_0x242bad[_0x19a6('0xba')]][_0x19a6('0xc2')]?moment()[_0x19a6('0x40')](_0x19a6('0xbe')):undefined;}hopperUtils[_0x19a6('0xc3')](_0x4082a5)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0xc4')));hopperUtils[_0x19a6('0xc5')](_0x4082a5)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0xc6')));}}};Dialer[_0x19a6('0x7c')]['syncQueueCallerAbandon']=function(_0x2e6638){var _0x277c97=this[_0x19a6('0x24')][_0x2e6638[_0x19a6('0xbb')]];var _0x3e5b3a=this;var _0x8e4b20=![];var _0x543eda;var _0x285919;if(this[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]]){if(_0x277c97&&_0x277c97[_0x19a6('0x3c')]!=='ivr'){delete this[_0x19a6('0x24')][_0x2e6638[_0x19a6('0xbb')]];this[_0x19a6('0xbd')](this[_0x19a6('0x1c')][_0x2e6638['queue']]);_0x277c97[_0x19a6('0xc7')]=moment()[_0x19a6('0x40')](_0x19a6('0xbe'));var _0x4864b4=new QueueCallerAbandon(_0x277c97,_0x2e6638);if(utils[_0x19a6('0x59')](_0x277c97['droptime'],_0x277c97['responsetime'])>=_0x277c97['dialQueueTimeout']){this[_0x19a6('0x1c')][_0x2e6638['queue']][_0x19a6('0x45')]+=0x1;this['voiceQueues'][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xc8')]+=0x1;this[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xc9')]+=0x1;_0x4864b4[_0x19a6('0x6a')]=0xa;_0x4864b4[_0x19a6('0xca')]=_0x19a6('0xcb');_0x4864b4[_0x19a6('0xcc')]=_0x19a6('0xcd');_0x4864b4['agiafterat']=this['voiceQueues'][_0x2e6638['queue']]['dialQueueProject2']?moment()['format'](_0x19a6('0xbe')):undefined;_0x4864b4['countdropretry']+=0x1;_0x4864b4['countglobal']+=0x1;_0x543eda=this[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]]['dialDropRetryFrequency'];_0x285919=this['voiceQueues'][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xce')];hopperUtils['verifyAdditionalPhones'](_0x4864b4,_0x4864b4['state'],_0x277c97[_0x19a6('0xcf')])[_0x19a6('0x39')](function(_0x1f9ca1){_0x8e4b20=_0x1f9ca1[_0x19a6('0xd0')]==0x1;if(_0x4864b4['countdropretry']>=_0x3e5b3a[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]]['dialDropMaxRetry']){_0x3e5b3a[_0x19a6('0xd1')](_0x4864b4,_0x1f9ca1['additional']);}else{hopperUtils[_0x19a6('0xd2')]({'active':![],'countdropretry':_0x4864b4[_0x19a6('0xd3')],'scheduledat':moment()['add'](_0x3e5b3a[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xd4')],_0x19a6('0xd5'))['format'](_0x19a6('0xbe')),'ContactId':_0x277c97[_0x19a6('0xd6')],'ListId':_0x277c97[_0x19a6('0xd7')],'VoiceQueueId':_0x277c97[_0x19a6('0xd8')]||undefined,'CampaignId':_0x277c97[_0x19a6('0xd9')]||undefined})['catch'](loggerCatch(_0x19a6('0xda')));var _0x1298fc=new History(_0x4864b4);_0x1298fc[_0x19a6('0x6a')]=0xa;_0x1298fc[_0x19a6('0xca')]=_0x19a6('0xcb');_0x1298fc[_0x19a6('0xdb')]=moment()[_0x19a6('0x40')](_0x19a6('0xbe'));_0x1298fc[_0x19a6('0xdc')]=_0x1298fc[_0x19a6('0xdb')];_0x1298fc[_0x19a6('0xdd')]=_0x4864b4[_0x19a6('0xdd')];_0x1298fc[_0x19a6('0xde')]=_0x4864b4[_0x19a6('0xde')];hopperUtils[_0x19a6('0xc3')](_0x1298fc)['catch'](loggerCatch(_0x19a6('0xdf')));}})['then'](function(){if(_0x8e4b20)hopperUtils[_0x19a6('0xe0')](_0x4864b4,_0x543eda,_0x285919)[_0x19a6('0x39')](function(){return 0x1;});});}else{this[_0x19a6('0x1c')][_0x2e6638['queue']][_0x19a6('0x47')]+=0x1;this['voiceQueues'][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xe1')]+=0x1;_0x4864b4[_0x19a6('0x6a')]=0xb;_0x4864b4[_0x19a6('0xca')]=_0x19a6('0xe2');_0x4864b4[_0x19a6('0xcc')]=_0x19a6('0xe3');_0x4864b4[_0x19a6('0xe4')]+=0x1;_0x4864b4['countglobal']+=0x1;_0x543eda=this[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xe5')];_0x285919=this[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xce')];hopperUtils[_0x19a6('0xe6')](_0x4864b4,_0x4864b4[_0x19a6('0x6a')],_0x277c97['voiceQueue'])[_0x19a6('0x39')](function(_0xf2acbf){if(_0x4864b4[_0x19a6('0xe4')]>=_0x3e5b3a[_0x19a6('0x1c')][_0x2e6638[_0x19a6('0xba')]][_0x19a6('0xe7')]){_0x3e5b3a[_0x19a6('0xd1')](_0x4864b4,_0xf2acbf[_0x19a6('0xd0')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x4864b4[_0x19a6('0xe4')],'scheduledat':moment()[_0x19a6('0xe8')](_0x3e5b3a[_0x19a6('0x1c')][_0x2e6638['queue']]['dialAbandonedRetryFrequency'],_0x19a6('0xd5'))[_0x19a6('0x40')](_0x19a6('0xbe')),'ContactId':_0x277c97[_0x19a6('0xd6')],'ListId':_0x277c97[_0x19a6('0xd7')],'VoiceQueueId':_0x277c97['VoiceQueueId']||undefined,'CampaignId':_0x277c97[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x2f0e9e=new History(_0x4864b4);_0x2f0e9e[_0x19a6('0x6a')]=0xb;_0x2f0e9e[_0x19a6('0xca')]=_0x19a6('0xe2');_0x2f0e9e[_0x19a6('0xdb')]=moment()['format'](_0x19a6('0xbe'));_0x2f0e9e['endtime']=_0x2f0e9e[_0x19a6('0xdb')];_0x2f0e9e[_0x19a6('0xdd')]=_0x4864b4[_0x19a6('0xdd')];_0x2f0e9e['calleridnum']=_0x4864b4[_0x19a6('0xde')];hopperUtils[_0x19a6('0xc3')](_0x2f0e9e)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x19a6('0x39')](function(){if(_0x8e4b20)hopperUtils['swapAdditionalPhones'](_0x4864b4,_0x543eda,_0x285919)[_0x19a6('0x39')](function(){return 0x1;});});}}}};Dialer[_0x19a6('0x7c')][_0x19a6('0x32')]=function(_0x350f7e){if(this[_0x19a6('0x22')][_0x350f7e['uniqueid']]){this[_0x19a6('0x22')][_0x350f7e[_0x19a6('0xbb')]][_0x19a6('0xe9')]=_0x350f7e['channel'];}if(this[_0x19a6('0x24')][_0x350f7e['uniqueid']]){this[_0x19a6('0x24')][_0x350f7e[_0x19a6('0xbb')]][_0x19a6('0xe9')]=_0x350f7e['channel'];}};Dialer['prototype'][_0x19a6('0x34')]=function(_0x583353){if(!this[_0x19a6('0x22')][_0x583353[_0x19a6('0xea')]]){return;}var _0xdca4d9=this[_0x19a6('0x1c')][this['actions'][_0x583353['actionid']]['queue']][_0x19a6('0xeb')]||_0x19a6('0xec');if(_0xdca4d9===_0x19a6('0xed')){if(this[_0x19a6('0x22')][_0x583353[_0x19a6('0xea')]]&&_[_0x19a6('0xee')](this[_0x19a6('0x22')][_0x583353[_0x19a6('0xea')]]['locked'])&&_0x583353[_0x19a6('0x80')]==='1'&&_0x583353['paused']==='0'){if(this[_0x19a6('0x1e')][_0x583353[_0x19a6('0xef')]]){if(!this[_0x19a6('0x1e')][_0x583353[_0x19a6('0xef')]]['locked']){this[_0x19a6('0x1e')][_0x583353[_0x19a6('0xef')]][_0x19a6('0xf0')]=!![];this['actions'][_0x583353[_0x19a6('0xea')]][_0x19a6('0xf0')]=!![];this[_0x19a6('0x22')][_0x583353[_0x19a6('0xea')]][_0x19a6('0xef')]=_0x583353[_0x19a6('0xef')];}}}}else if(_0xdca4d9==='rrmemory'){if(this[_0x19a6('0x22')][_0x583353['actionid']]){if(this['agents'][_0x583353[_0x19a6('0xef')]]){this[_0x19a6('0x22')][_0x583353[_0x19a6('0xea')]][_0x19a6('0xef')]=_0x583353[_0x19a6('0xef')];if(_[_0x19a6('0xee')](this[_0x19a6('0xf1')][this[_0x19a6('0x22')][_0x583353['actionid']][_0x19a6('0xba')]])){this['queueBooked'][this[_0x19a6('0x22')][_0x583353[_0x19a6('0xea')]][_0x19a6('0xba')]]=[];}this[_0x19a6('0xf1')][this[_0x19a6('0x22')][_0x583353[_0x19a6('0xea')]][_0x19a6('0xba')]]['push'](_[_0x19a6('0x58')](_[_0x19a6('0xf2')](this['actions'][_0x583353[_0x19a6('0xea')]],['idHopper',_0x19a6('0xef')]),{'status':_0x583353[_0x19a6('0x80')],'paused':_0x583353[_0x19a6('0xf3')]}));}}}};Dialer[_0x19a6('0x7c')][_0x19a6('0xf4')]=function(_0x14228a){if(!this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]){return;}var _0x52fa81=this;var _0x881141=this[_0x19a6('0x1c')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]];var _0x440596=_0x881141[_0x19a6('0xeb')]||_0x19a6('0xec');if(_0x440596==='roundrobin'){if(this['actions'][_0x14228a[_0x19a6('0xea')]]&&this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['stateinterface']){this[_0x19a6('0x1b')][_0x19a6('0xf5')](this[_0x19a6('0x22')][_0x14228a['actionid']][_0x19a6('0xf6')],this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['stateinterface'])[_0x19a6('0x9a')](function(_0x131671){logger['error'](_0x19a6('0xf7'),util[_0x19a6('0x3f')](_0x131671,{'showHidden':![],'depth':null}));})[_0x19a6('0x19')](function(){_0x52fa81[_0x19a6('0xbd')](_0x52fa81[_0x19a6('0x1c')][_0x52fa81[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['queue']]);_0x52fa81[_0x19a6('0x1e')][_0x52fa81[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xef')]][_0x19a6('0xf0')]=![];delete _0x52fa81['actions'][_0x14228a[_0x19a6('0xea')]];unlockQueueStatus(_0x881141);});}else{this[_0x19a6('0xbd')](this['voiceQueues'][this[_0x19a6('0x22')][_0x14228a['actionid']][_0x19a6('0xba')]]);hopperUtils[_0x19a6('0xd2')]({'active':![],'ContactId':this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xd6')],'ListId':this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['ListId'],'VoiceQueueId':this[_0x19a6('0x22')][_0x14228a['actionid']][_0x19a6('0xd8')]||undefined,'CampaignId':this['actions'][_0x14228a[_0x19a6('0xea')]]['CampaignId']||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0xf8')));delete this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]];unlockQueueStatus(_0x881141);}}else if(_0x440596===_0x19a6('0xec')){var _0x2f6431;if(this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]&&!_[_0x19a6('0x72')](this[_0x19a6('0xf1')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]])){if(this[_0x19a6('0x28')][_0x52fa81[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]]){this[_0x19a6('0x28')][_0x52fa81[_0x19a6('0x22')][_0x14228a['actionid']][_0x19a6('0xba')]]=this[_0x19a6('0x28')][this['actions'][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]]?this[_0x19a6('0x28')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]]:this['queueBooked'][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]]?this[_0x19a6('0xf1')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]][_0x19a6('0xf9')]||0x0:0x0;}this['queueBooked'][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]][_0x19a6('0xba')]]['_rr']=this[_0x19a6('0x28')][this[_0x19a6('0x22')][_0x14228a[_0x19a6('0xea')]]['queue']];for(var _0x9c6c9b=0x0;_0x9c6c9b=_0x140fcb[_0x19a6('0x11d')]){_0x3bfd2b[_0x19a6('0x11e')](_0x19d3b2,_0x42a18b,_0x464488,'reason19\x20machine....');}else{if(_0x19d3b2[_0x19a6('0x115')]>=_0x140fcb[_0x19a6('0x11f')]){_0x3bfd2b['createStateFinal'](_0x19d3b2,_0x42a18b,_0x464488,'reason\x2019\x20machine....');}else{hopperUtils[_0x19a6('0xd2')]({'active':![],'countmachineretry':_0x19d3b2[_0x19a6('0x115')],'scheduledat':moment()[_0x19a6('0xe8')](_0x140fcb[_0x19a6('0x120')],'minutes')[_0x19a6('0x40')](_0x19a6('0xbe')),'ContactId':_0x19d3b2['ContactId'],'ListId':_0x19d3b2[_0x19a6('0xd7')],'VoiceQueueId':_0x19d3b2[_0x19a6('0xd8')]||undefined,'CampaignId':_0x19d3b2[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x121')));_0x42a18b({'reschedule':0x1});}}});}if(_0x46def0[_0x19a6('0x3c')]===_0x19a6('0xbc')&&this[_0x19a6('0x1d')][_0x46def0[_0x19a6('0xba')]][_0x19a6('0x10b')]&&_0x3289bc[_0x19a6('0x10c')]==='HANGUP'){delete this[_0x19a6('0x24')][_0x3289bc['uniqueid']];this['updateOriginated'](this[_0x19a6('0x1d')][_0x46def0['queue']]);_0x23bcee=new Hangup(_0x46def0,_0x3289bc);_0x23bcee['state']=0x12;_0x23bcee[_0x19a6('0xca')]=_0x19a6('0x122');_0x23bcee['membername']='AMD';ami[_0x19a6('0x3b')]('custom:amd',ut['buildObj'](_0x23bcee,_0x19a6('0x117')));this[_0x19a6('0x112')](_0x23bcee,_0x19a6('0x123'),_0x19a6('0x124'));}if(_0x46def0['type']===_0x19a6('0xbc')&&this[_0x19a6('0x1d')][_0x46def0[_0x19a6('0xba')]][_0x19a6('0x10b')]&&_0x3289bc[_0x19a6('0x10c')]===_0x19a6('0x125')){return new Promise(function(_0x3a4fdc,_0x249187){delete _0x3bfd2b[_0x19a6('0x24')][_0x3289bc[_0x19a6('0xbb')]];_0x3bfd2b['updateOriginated'](_0x3bfd2b['campaigns'][_0x46def0['queue']]);_0x3bfd2b[_0x19a6('0x1d')][_0x46def0[_0x19a6('0xba')]][_0x19a6('0x10d')]+=0x1;_0x3bfd2b[_0x19a6('0x1d')][_0x46def0[_0x19a6('0xba')]][_0x19a6('0x10e')]+=0x1;var _0x2c299b=_0x3bfd2b[_0x19a6('0x1d')][_0x46def0[_0x19a6('0xba')]];var _0x44c3e7=new Hangup(_0x46def0,_0x3289bc);_0x44c3e7[_0x19a6('0x6a')]=0x13;_0x44c3e7['statedesc']=_0x19a6('0x114');_0x44c3e7[_0x19a6('0x126')]=_0x19a6('0x10f');_0x44c3e7[_0x19a6('0x115')]+=0x1;_0x44c3e7['countglobal']+=0x1;_0x44c3e7[_0x19a6('0x117')]=!![];ami[_0x19a6('0x3b')](_0x19a6('0x110'),ut[_0x19a6('0x111')](_0x44c3e7,_0x19a6('0x117')));hopperUtils['createHistory'](_0x44c3e7)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x118')));if(_0x44c3e7[_0x19a6('0x119')]+_0x44c3e7[_0x19a6('0x11a')]+_0x44c3e7['countnoanswerretry']+_0x44c3e7[_0x19a6('0x11c')]+_0x44c3e7[_0x19a6('0xd3')]+_0x44c3e7[_0x19a6('0xe4')]+_0x44c3e7['countmachineretry']+_0x44c3e7[_0x19a6('0x127')]>=_0x2c299b['dialGlobalMaxRetry']){_0x3bfd2b[_0x19a6('0x11e')](_0x44c3e7,_0x3a4fdc,_0x249187,_0x19a6('0x128'));}else{if(_0x44c3e7[_0x19a6('0x115')]>=_0x2c299b[_0x19a6('0x11f')]){_0x3bfd2b[_0x19a6('0x129')](_0x44c3e7,_0x3a4fdc,_0x249187,_0x19a6('0x12a'));}else{hopperUtils[_0x19a6('0xd2')]({'active':![],'countmachineretry':_0x44c3e7[_0x19a6('0x115')],'scheduledat':moment()[_0x19a6('0xe8')](_0x2c299b[_0x19a6('0x120')],_0x19a6('0xd5'))['format'](_0x19a6('0xbe')),'ContactId':_0x44c3e7['ContactId'],'ListId':_0x44c3e7['ListId'],'VoiceQueueId':_0x44c3e7['VoiceQueueId']||undefined,'CampaignId':_0x44c3e7['CampaignId']||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x121')));_0x3a4fdc({'reschedule':0x1});}}});}}};Dialer[_0x19a6('0x7c')][_0x19a6('0x31')]=function(_0x45255f){var _0x24d895=this['uniqueId'][_0x45255f['uniqueid']];var _0x5af359;if(_0x24d895&&_0x24d895['type']===_0x19a6('0xbc')){delete this[_0x19a6('0x24')][_0x45255f['uniqueid']];this['updateOriginated'](this[_0x19a6('0x1d')][_0x24d895[_0x19a6('0xba')]]);this['campaigns'][_0x24d895[_0x19a6('0xba')]][_0x19a6('0x12b')]+=0x1;_0x5af359=new Hangup(_0x24d895,_0x45255f);hopperUtils[_0x19a6('0xc3')](_0x5af359)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x12c')));hopperUtils[_0x19a6('0xc5')](_0x5af359)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x24d895&&_0x24d895[_0x19a6('0x3c')]!=='ivr'&&isNotNull(this[_0x19a6('0x1c')][_0x24d895[_0x19a6('0xba')]][_0x19a6('0x12d')])){delete this['uniqueId'][_0x45255f['uniqueid']];this[_0x19a6('0xbd')](this[_0x19a6('0x1c')][_0x24d895['queue']]);this[_0x19a6('0x1c')][_0x24d895[_0x19a6('0xba')]][_0x19a6('0x10d')]+=0x1;this[_0x19a6('0x1c')][_0x24d895[_0x19a6('0xba')]][_0x19a6('0x10e')]+=0x1;_0x5af359=new Hangup(_0x24d895,_0x45255f);_0x5af359[_0x19a6('0x6a')]=0x10;_0x5af359[_0x19a6('0xca')]=_0x19a6('0x12e');_0x5af359[_0x19a6('0x126')]='AGI';hopperUtils['createHistory'](_0x5af359)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x12c')));hopperUtils[_0x19a6('0xc5')](_0x5af359)['catch'](loggerCatch(_0x19a6('0x12f')));}if(_0x24d895&&_0x24d895[_0x19a6('0x3c')]!==_0x19a6('0xbc')&&!isNotNull(this['voiceQueues'][_0x24d895[_0x19a6('0xba')]][_0x19a6('0x12d')])){delete this[_0x19a6('0x24')][_0x45255f['uniqueid']];this['updateOriginated'](this[_0x19a6('0x1c')][_0x24d895[_0x19a6('0xba')]]);this[_0x19a6('0x1c')][_0x24d895[_0x19a6('0xba')]][_0x19a6('0x130')]+=0x1;_0x5af359=new Hangup(_0x24d895,_0x45255f);_0x5af359['state']=0xc;_0x5af359[_0x19a6('0xca')]=_0x45255f['cause-txt'];_0x5af359['membername']=_0x19a6('0x131');hopperUtils[_0x19a6('0xc3')](_0x5af359)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x12c')));hopperUtils['moveContactManagedDialer'](_0x5af359)[_0x19a6('0x9a')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x19a6('0x7c')][_0x19a6('0xb')]=function(_0xd754b5){var _0x842384=this;if(!_0x842384[_0x19a6('0x29')][_0xd754b5[_0x19a6('0x5c')]]){_0x842384[_0x19a6('0x29')][_0xd754b5[_0x19a6('0x5c')]]={'running':![]};}else if(_0x842384[_0x19a6('0x29')][_0xd754b5['name']]['running']===!![]){return;}else if(_0x842384['queuesSummary'][_0xd754b5[_0x19a6('0x5c')]][_0x19a6('0x132')]===![]){_0x842384[_0x19a6('0x29')][_0xd754b5['name']][_0x19a6('0x132')]=!![];}var _0x3e31d5=_0x842384[_0x19a6('0x1c')][_0xd754b5[_0x19a6('0x5c')]];var _0x2848a4=_0x3e31d5[_0x19a6('0x64')]!==utils[_0x19a6('0x65')]['INACTIVE'];var _0x120e5a=utils[_0x19a6('0x133')](_0x3e31d5);_0x3e31d5[_0x19a6('0x134')]=utils[_0x19a6('0x135')](_0x3e31d5,_0x842384[_0x19a6('0x1f')]);Promise[_0x19a6('0x136')]()[_0x19a6('0x39')](function(){if(_0x3e31d5['statusMessage']===utils['CAMPAIGN_STATUS'][_0x19a6('0x74')]){if(_0x2848a4){clearPredictiveAttributes(_0x3e31d5);_0xd754b5['startPredictive']=undefined;_0xd754b5[_0x19a6('0x5a')]=undefined;}if(_0x3e31d5[_0x19a6('0x134')]===utils[_0x19a6('0x65')][_0x19a6('0x74')]){_0xd754b5[_0x19a6('0x137')]=0x0;_0xd754b5[_0x19a6('0xf3')]=0x0;_0xd754b5[_0x19a6('0x138')]=0x0;_0xd754b5[_0x19a6('0x139')]=0x0;_0xd754b5[_0x19a6('0x13a')]=0x0;}}else if(_0x3e31d5[_0x19a6('0x134')]===utils[_0x19a6('0x65')][_0x19a6('0x13b')]&&!_0x120e5a){return _0x842384[_0x19a6('0x8b')](_0x3e31d5,!![])[_0x19a6('0x39')](function(){return _0x842384[_0x19a6('0x8b')](_0x3e31d5,![]);})['then'](function(){return _0x842384[_0x19a6('0xa9')](_0x3e31d5);})[_0x19a6('0x9a')](function(_0x4f5db0){loggerSyncQueueSummary['debug'](_0x19a6('0x13c'),util[_0x19a6('0x3f')](_0x4f5db0,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3e31d5);});}else{clearPredictiveAttributes(_0x3e31d5);}})[_0x19a6('0x39')](function(){var _0x79b124=_0xd754b5[_0x19a6('0x13d')](_0x3e31d5);if(_0x79b124||_0x3e31d5[_0x19a6('0x13e')]){_0x3e31d5[_0x19a6('0x13e')]=![];_0xd754b5[_0x19a6('0x13f')](_0x3e31d5);Object[_0x19a6('0x140')](_0x3e31d5,_0xd754b5);emitOutboundVoiceQueueSummary(_0xd754b5);}_0x842384[_0x19a6('0x29')][_0x3e31d5[_0x19a6('0x5c')]][_0x19a6('0x132')]=![];})[_0x19a6('0x9a')](function(_0x20f7ad){logger[_0x19a6('0x60')]('[syncQueueSummary]',util[_0x19a6('0x3f')](_0x20f7ad,{'showHidden':![],'depth':null}));_0x842384['queuesSummary'][_0x3e31d5['name']][_0x19a6('0x132')]=![];});};Dialer[_0x19a6('0x7c')][_0x19a6('0x30')]=_[_0x19a6('0x141')](function(){var _0x562a29=_['filter'](this[_0x19a6('0x1c')],function(_0x34b3dc){return _0x34b3dc[_0x19a6('0x142')];});var _0x419fa0=_[_0x19a6('0x143')](this['agents'],function(_0x2f05f9){return _0x2f05f9[_0x19a6('0x144')]&&_0x2f05f9['status']===_0x19a6('0x81');});if(_0x562a29[_0x19a6('0x92')]>0x0&&_0x419fa0[_0x19a6('0x92')]>0x0){return Promise[_0x19a6('0x136')]()[_0x19a6('0x39')](cmHopper[_0x19a6('0x145')](_[_0x19a6('0x146')](_0x562a29,'id'),previewRecallmeReminderInterval,_[_0x19a6('0x146')](_0x419fa0,'id')))[_0x19a6('0x39')](function(_0x40eae9){for(var _0x3eb013=0x0;_0x3eb013<_0x40eae9['length'];_0x3eb013++){var _0xd61502=_0x40eae9[_0x3eb013][_0x19a6('0x147')]['name'];if(_0xd61502)io['to'](util[_0x19a6('0x40')]('user:%s',_0xd61502))[_0x19a6('0x3b')](_0x19a6('0x148'),{'hopper':_0x40eae9[_0x3eb013]});}})[_0x19a6('0x9a')](function(_0x23a90e){logger[_0x19a6('0x60')](_0x19a6('0x149'),_0x23a90e);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x19a6('0x37')]=function(){var _0x3d79c2=this;setInterval(function(){_0x3d79c2[_0x19a6('0x14a')](_0x3d79c2['uniqueId'],_0x19a6('0x14b'));_0x3d79c2[_0x19a6('0x14a')](_0x3d79c2[_0x19a6('0x22')],'[actions]');},0x32c8);};Dialer[_0x19a6('0x7c')]['clearZombieChannels']=function(_0x1c9f3d,_0xb52245){var _0x3e86a5=this;for(var _0x8742a1 in _0x1c9f3d){if(typeof _0x1c9f3d[_0x8742a1]!==_0x19a6('0xa3')){this[_0x19a6('0x1a')][_0x19a6('0x17')](function(){if(!_[_0x19a6('0xee')](_0x1c9f3d[_0x8742a1])){return ami[_0x19a6('0x94')]({'action':_0x19a6('0x80'),'channel':_0x1c9f3d[_0x8742a1]['channel']})['catch'](function(_0x23f3b7){if(_0x23f3b7['message']===_0x19a6('0x14c')){setTimeout(function(){if(_0x1c9f3d[_0x8742a1]&&_0x1c9f3d[_0x8742a1][_0x19a6('0x3c')]!==_0x19a6('0xbc')){_0x3e86a5['updateOriginated'](_0x3e86a5[_0x19a6('0x1c')][_0x1c9f3d[_0x8742a1]['queue']]);logger[_0x19a6('0x60')](_0x19a6('0x14d'),_0xb52245,_0x8742a1,_0x1c9f3d[_0x8742a1][_0x19a6('0xba')]);delete _0x1c9f3d[_0x8742a1];}if(_0x1c9f3d[_0x8742a1]&&_0x1c9f3d[_0x8742a1]['type']===_0x19a6('0xbc')){_0x3e86a5[_0x19a6('0xbd')](_0x3e86a5[_0x19a6('0x1d')][_0x1c9f3d[_0x8742a1][_0x19a6('0xba')]]);logger[_0x19a6('0x60')](_0x19a6('0x14e'),_0xb52245,_0x8742a1,_0x1c9f3d[_0x8742a1]['queue']);delete _0x1c9f3d[_0x8742a1];}},0x2328);}});}});}}};Dialer[_0x19a6('0x7c')][_0x19a6('0x14f')]=function(_0x410e1d){return Promise[_0x19a6('0x136')]()[_0x19a6('0x39')](voiceQueueRt[_0x19a6('0x14f')](_0x410e1d))[_0x19a6('0x9a')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x19a6('0x7c')][_0x19a6('0xbd')]=function(_0x59bebd){if(!_[_0x19a6('0x4c')](_0x59bebd)&&_0x59bebd!==null){if(typeof _0x59bebd[_0x19a6('0x77')]!=='undefined'){if(_0x59bebd[_0x19a6('0x77')]>0x0){_0x59bebd[_0x19a6('0x77')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x19a6('0x60')](_0x19a6('0x150'));}};Dialer[_0x19a6('0x7c')]['loggerHandler']=function(_0x4eb40d,_0x3ffd25){var _0x1fe722=this;return function(_0x30ec3b){_0x1fe722[_0x19a6('0xbd')](_0x3ffd25);logger[_0x19a6('0x60')](_0x4eb40d,util[_0x19a6('0x3f')](_0x30ec3b,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0xa548e4,_0x1af51d,_0x3feca0){var _0xd2022e={'state':0x19,'statedesc':_0x19a6('0x151')};this[_0x19a6('0xbd')](_0x1af51d);this[_0x19a6('0x112')](_[_0x19a6('0x58')](_0xd2022e,_[_0x19a6('0xf2')](_0x3feca0,[_0x19a6('0xd6'),'ListId',_0x19a6('0x152'),'VoiceQueueId','CampaignId'])),_0x19a6('0x153'),_0x19a6('0x154'));logger[_0x19a6('0x60')](_0xa548e4);};Dialer[_0x19a6('0x7c')]['saveInDb']=function(_0x11ee90,_0x3f60fc,_0x575249){hopperUtils['createHistory'](_0x11ee90)[_0x19a6('0x9a')](loggerCatch(_0x3f60fc));hopperUtils[_0x19a6('0xc5')](_0x11ee90)[_0x19a6('0x9a')](loggerCatch(_0x575249));};Dialer[_0x19a6('0x7c')]['queueCallerAbandonCreateState']=function(_0x3aff2a,_0x3813f7){hopperUtils[_0x19a6('0xc3')](_0x3aff2a)['catch'](loggerCatch(_0x19a6('0xc4')));if(_0x3813f7==0x0){hopperUtils[_0x19a6('0xc5')](_0x3aff2a)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x155')));}};Dialer[_0x19a6('0x7c')]['checkPreviewRecallReminder']=function(_0x229fac){return Promise[_0x19a6('0x136')]()[_0x19a6('0x39')](cmHopper[_0x19a6('0x145')](_0x229fac['id'],previewRecallmeReminderInterval))[_0x19a6('0x39')](function(_0x2424fb){for(var _0x56ecd2=0x0;_0x56ecd2<_0x2424fb['length'];_0x56ecd2++){var _0x416d30=_0x2424fb[_0x56ecd2][_0x19a6('0x147')][_0x19a6('0x5c')];if(_0x416d30)io['to'](util[_0x19a6('0x40')](_0x19a6('0x156'),_0x416d30))[_0x19a6('0x3b')](_0x19a6('0x148'),{'hopper':_0x2424fb[_0x56ecd2]});}})['catch'](function(){});};Dialer[_0x19a6('0x7c')][_0x19a6('0xa7')]=function(_0x4fb553){var _0x273ac4=this;return function(){_0x273ac4[_0x19a6('0x157')](_0x4fb553);};};Dialer[_0x19a6('0x7c')][_0x19a6('0x158')]=function(_0x5be7a6,_0x2bcca1){var _0x570643=this;var _0xcb5b3f=uuid['v4']();this[_0x19a6('0x22')][_0xcb5b3f]=new Action(_0x5be7a6,_0x2bcca1,_0xcb5b3f);return new Promise(function(_0x2db49d,_0x415649){if(_[_0x19a6('0x4c')](_0x5be7a6)&&typeof _0x5be7a6!==_0x19a6('0x159')){return _0x415649(msgResponse(_0x19a6('0x15a'),_0x19a6('0x8c'),_0x19a6('0x15b')));}if(_[_0x19a6('0x4c')](_0x2bcca1[_0x19a6('0x15c')])||_0x2bcca1['phone']===null){return _0x415649(msgResponse(_0x19a6('0x15a'),'Failure','contact\x20is\x20undefine'));}var _0x8f9e98={'XMD-CALLERID':_0x570643[_0x19a6('0x22')][_0xcb5b3f]['getCaller'](),'XMD-AGI':_0x5be7a6['dialQueueProject']?util[_0x19a6('0x40')](_0x19a6('0x15d'),ipAgi,_0x5be7a6[_0x19a6('0x12d')]):_0x19a6('0x15e'),'XMD-AGIAFTER':_0x5be7a6[_0x19a6('0x15f')]?util[_0x19a6('0x40')](_0x19a6('0x15d'),ipAgi,_0x5be7a6[_0x19a6('0x15f')]):_0x19a6('0x15e'),'XMD-QUEUE':utils['isOutboundQueue'](_0x5be7a6)?util[_0x19a6('0x40')](_0x19a6('0x160'),_0x5be7a6[_0x19a6('0x5c')],_0x5be7a6[_0x19a6('0x161')]||'',_0x5be7a6['dialAgiAfterHangupAgent']?'c':'',_0x5be7a6[_0x19a6('0x162')]||0x3):_0x19a6('0x15e'),'XMD-CONTACTID':_0x2bcca1[_0x19a6('0xd6')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x570643[_0x19a6('0x22')][_0xcb5b3f]['getCaller'](),'XMD-AMD':_0x5be7a6[_0x19a6('0x10b')]?_0x19a6('0x13b'):'NONE','XMD-DESTINATION':_0x19a6('0x10a')};if(_0x5be7a6[_0x19a6('0x10b')]){_0x8f9e98['XMD-AMDINITIALSILENCE']=_0x5be7a6['dialAMDInitialSilence']||0x9c4;_0x8f9e98[_0x19a6('0x163')]=_0x5be7a6['dialAMDGreeting']||0x5dc;_0x8f9e98[_0x19a6('0x164')]=_0x5be7a6[_0x19a6('0x165')]||0x320;_0x8f9e98['XMD-AMDTOTALANALYSISTIME']=_0x5be7a6[_0x19a6('0x166')]||0x1388;_0x8f9e98[_0x19a6('0x167')]=_0x5be7a6[_0x19a6('0x168')]||0x64;_0x8f9e98['XMD-AMDBETWEENWORDSSILENCE']=_0x5be7a6['dialAMDBetweenWordsSilence']||0x32;_0x8f9e98[_0x19a6('0x169')]=_0x5be7a6[_0x19a6('0x16a')]||0x3;_0x8f9e98['XMD-AMDSILENCETHRESHOLD']=_0x5be7a6[_0x19a6('0x16b')]||0x100;_0x8f9e98[_0x19a6('0x16c')]=_0x5be7a6[_0x19a6('0x16d')]||0x1388;}if(utils[_0x19a6('0x16e')](_0x5be7a6)){_0x8f9e98[_0x19a6('0x16f')]=_0x2bcca1[_0x19a6('0xd8')];}else{_0x8f9e98[_0x19a6('0x170')]=_0x2bcca1[_0x19a6('0xd9')];}for(var _0x115ee9 in _0x2bcca1[_0x19a6('0x171')]){if(typeof _0x2bcca1['Contact'][_0x115ee9]!==_0x19a6('0xa3')){if(isNotNull(_0x2bcca1[_0x19a6('0x171')][_0x115ee9])&&_0x115ee9!=='id'&&_0x115ee9!==_0x19a6('0x172')&&_0x115ee9!==_0x19a6('0x173')&&_0x115ee9!==_0x19a6('0x174')){_0x8f9e98[util[_0x19a6('0x40')](_0x19a6('0x175'),_0x19a6('0x176'),_[_0x19a6('0x177')](_0x115ee9))]=_0x2bcca1['Contact'][_0x115ee9];}}}var _0x6306ba=_0x570643[_0x19a6('0x7d')](_0x5be7a6[_0x19a6('0x84')])?utils['getCallerId'](_0x5be7a6['Trunk'][_0x19a6('0x178')],_0x5be7a6[_0x19a6('0x179')],_0x5be7a6[_0x19a6('0x17a')]>0x0?utils[_0x19a6('0x17b')](_0x5be7a6[_0x19a6('0x17c')],_0x5be7a6[_0x19a6('0x17a')]):_0x5be7a6[_0x19a6('0x17c')]):utils[_0x19a6('0x17d')](_[_0x19a6('0xee')](_0x5be7a6[_0x19a6('0x85')])?_0x5be7a6[_0x19a6('0x84')][_0x19a6('0x178')]:_0x5be7a6[_0x19a6('0x85')][_0x19a6('0x178')],_0x5be7a6[_0x19a6('0x179')],_0x5be7a6[_0x19a6('0x17a')]>0x0?utils['getCallerIdRandom'](_0x5be7a6['dialOriginateCallerIdNumber'],_0x5be7a6[_0x19a6('0x17a')]):_0x5be7a6[_0x19a6('0x17c')]);if(_0x6306ba){_0x8f9e98[_0x19a6('0x17e')]=_0x570643[_0x19a6('0x22')][_0xcb5b3f][_0x19a6('0x17f')]=utils[_0x19a6('0x180')](_0x6306ba);_0x8f9e98[_0x19a6('0x181')]=_0x2bcca1[_0x19a6('0x15c')];}_0x5be7a6['variables']=_0x8f9e98;return ami['Action']({'actionid':_0xcb5b3f,'action':_0x19a6('0x15a'),'channel':_0x570643['isTrunkReachable'](_0x5be7a6[_0x19a6('0x84')])?util[_0x19a6('0x40')](_0x19a6('0x182'),_0x5be7a6[_0x19a6('0x84')][_0x19a6('0x5c')],isNotNull(_0x5be7a6[_0x19a6('0x183')])?_0x5be7a6['dialPrefix'][_0x19a6('0x184')]()||'':'',_0x5be7a6[_0x19a6('0x185')]>0x0?_0x2bcca1[_0x19a6('0x15c')]['substring'](_0x5be7a6['dialCutDigit']):_0x2bcca1[_0x19a6('0x15c')]):util[_0x19a6('0x40')](_0x19a6('0x182'),_[_0x19a6('0xee')](_0x5be7a6[_0x19a6('0x85')])?_0x5be7a6[_0x19a6('0x84')][_0x19a6('0x5c')]:_0x5be7a6[_0x19a6('0x85')][_0x19a6('0x5c')],isNotNull(_0x5be7a6['dialPrefix'])?_0x5be7a6[_0x19a6('0x183')]['trim']()||'':'',_0x5be7a6['dialCutDigit']>0x0?_0x2bcca1[_0x19a6('0x15c')]['substring'](_0x5be7a6[_0x19a6('0x185')]):_0x2bcca1['phone']),'callerid':_0x6306ba,'Exten':_0x19a6('0x10a'),'Context':_0x19a6('0x186'),'Priority':'1','variable':_0x8f9e98,'timeout':(_0x5be7a6[_0x19a6('0x187')]||0x1e)*0x3e8,'async':!![],'channelid':_0xcb5b3f})[_0x19a6('0x39')](function(_0x11fb4f){return _0x2db49d(_0x11fb4f);})[_0x19a6('0x9a')](function(_0x233e16){_0x5be7a6[_0x19a6('0x188')]+=0x1;var _0xa33748=new History(_0x570643['actions'][_0xcb5b3f]);logger['error'](util['format'](_0x19a6('0x189'),JSON[_0x19a6('0x6e')](_0x233e16)));_0xa33748[_0x19a6('0x6a')]=0xe;_0xa33748['statedesc']=_0x19a6('0x18a');_0xa33748[_0x19a6('0xdb')]=moment()[_0x19a6('0x40')]('YYYY-MM-DD\x20HH:mm:ss');_0xa33748[_0x19a6('0xdc')]=_0xa33748[_0x19a6('0xdb')];hopperUtils[_0x19a6('0xc3')](_0xa33748)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x18b')));_0x570643[_0x19a6('0xc5')](_0xa33748)['catch'](loggerCatch(_0x19a6('0x18b')))['finally'](function(){delete _0x570643[_0x19a6('0x22')][_0xcb5b3f];return _0x415649(msgResponse(_0x19a6('0x15a'),'Error',_0x19a6('0x18c')));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x5675d6,_0x7f9d52,_0x10da11){var _0x4e6d68=new History(_0x7f9d52);if(_0x4e6d68[_0x19a6('0x119')]+_0x4e6d68[_0x19a6('0x11a')]+_0x4e6d68['countnoanswerretry']+_0x4e6d68[_0x19a6('0x11c')]+_0x4e6d68[_0x19a6('0xd3')]+_0x4e6d68['countabandonedretry']+_0x4e6d68[_0x19a6('0x115')]+_0x4e6d68[_0x19a6('0x127')]>=_0x10da11[_0x19a6('0x11d')]-0x1){return!![];}switch(_0x5675d6){case 0x3:if(_0x4e6d68[_0x19a6('0x11b')]>=_0x10da11[_0x19a6('0x18d')]-0x1){return!![];}hopperUtils[_0x19a6('0xd2')]({'active':![],'countnoanswerretry':_0x4e6d68[_0x19a6('0x11b')]+=0x1,'scheduledat':moment()['add'](_0x10da11[_0x19a6('0x18e')],_0x19a6('0xd5'))[_0x19a6('0x40')](_0x19a6('0xbe')),'ContactId':_0x4e6d68['ContactId'],'ListId':_0x4e6d68[_0x19a6('0xd7')],'VoiceQueueId':_0x4e6d68[_0x19a6('0xd8')]||undefined,'CampaignId':_0x4e6d68[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x18f')));break;case 0x5:if(_0x4e6d68['countbusyretry']>=_0x10da11[_0x19a6('0x190')]-0x1){return!![];}hopperUtils[_0x19a6('0xd2')]({'active':![],'countbusyretry':_0x4e6d68[_0x19a6('0x119')]+=0x1,'scheduledat':moment()[_0x19a6('0xe8')](_0x10da11[_0x19a6('0x191')],_0x19a6('0xd5'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e6d68[_0x19a6('0xd6')],'ListId':_0x4e6d68['ListId'],'VoiceQueueId':_0x4e6d68[_0x19a6('0xd8')]||undefined,'CampaignId':_0x4e6d68[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x4e6d68[_0x19a6('0x11a')]>=_0x10da11[_0x19a6('0x192')]-0x1){return!![];}hopperUtils[_0x19a6('0xd2')]({'active':![],'countcongestionretry':_0x4e6d68['countcongestionretry']+=0x1,'scheduledat':moment()[_0x19a6('0xe8')](_0x10da11[_0x19a6('0x193')],_0x19a6('0xd5'))['format'](_0x19a6('0xbe')),'ContactId':_0x4e6d68[_0x19a6('0xd6')],'ListId':_0x4e6d68['ListId'],'VoiceQueueId':_0x4e6d68[_0x19a6('0xd8')]||undefined,'CampaignId':_0x4e6d68['CampaignId']||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x194')));break;case 0x0:if(_0x4e6d68[_0x19a6('0x11c')]>=_0x10da11['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x19a6('0xd2')]({'active':![],'countnosuchnumberretry':_0x4e6d68[_0x19a6('0x11c')]+=0x1,'scheduledat':moment()[_0x19a6('0xe8')](_0x10da11[_0x19a6('0x195')],_0x19a6('0xd5'))[_0x19a6('0x40')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e6d68[_0x19a6('0xd6')],'ListId':_0x4e6d68['ListId'],'VoiceQueueId':_0x4e6d68[_0x19a6('0xd8')]||undefined,'CampaignId':_0x4e6d68[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x196')));}break;case 0xa:if(_0x4e6d68[_0x19a6('0xd3')]>=_0x10da11[_0x19a6('0x197')]-0x1){return!![];}hopperUtils[_0x19a6('0xd2')]({'active':![],'countdropretry':_0x4e6d68['countdropretry']+=0x1,'scheduledat':moment()[_0x19a6('0xe8')](_0x10da11[_0x19a6('0xd4')],_0x19a6('0xd5'))[_0x19a6('0x40')](_0x19a6('0xbe')),'ContactId':_0x4e6d68[_0x19a6('0xd6')],'ListId':_0x4e6d68[_0x19a6('0xd7')],'VoiceQueueId':_0x4e6d68[_0x19a6('0xd8')]||undefined,'CampaignId':_0x4e6d68[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0xda')));break;case 0xb:if(_0x4e6d68[_0x19a6('0xe4')]>=_0x10da11['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x4e6d68[_0x19a6('0xe4')]+=0x1,'scheduledat':moment()[_0x19a6('0xe8')](_0x10da11['dialAbandonedRetryFrequency'],'minutes')[_0x19a6('0x40')](_0x19a6('0xbe')),'ContactId':_0x4e6d68[_0x19a6('0xd6')],'ListId':_0x4e6d68[_0x19a6('0xd7')],'VoiceQueueId':_0x4e6d68['VoiceQueueId']||undefined,'CampaignId':_0x4e6d68[_0x19a6('0xd9')]||undefined})['catch'](loggerCatch(_0x19a6('0x198')));break;case 0x13:if(_0x4e6d68[_0x19a6('0x115')]>=_0x10da11[_0x19a6('0x11f')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x4e6d68[_0x19a6('0x115')]+=0x1,'scheduledat':moment()[_0x19a6('0xe8')](_0x10da11[_0x19a6('0x120')],_0x19a6('0xd5'))['format'](_0x19a6('0xbe')),'ContactId':_0x4e6d68[_0x19a6('0xd6')],'ListId':_0x4e6d68['ListId'],'VoiceQueueId':_0x4e6d68[_0x19a6('0xd8')]||undefined,'CampaignId':_0x4e6d68[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x121')));break;case 0x14:if(_0x4e6d68[_0x19a6('0x127')]>=_0x10da11[_0x19a6('0x199')]-0x1){return!![];}hopperUtils[_0x19a6('0xd2')]({'active':![],'countagentrejectretry':_0x4e6d68[_0x19a6('0x127')]+=0x1,'scheduledat':moment()[_0x19a6('0xe8')](_0x10da11[_0x19a6('0x19a')],_0x19a6('0xd5'))[_0x19a6('0x40')](_0x19a6('0xbe')),'ContactId':_0x4e6d68['ContactId'],'ListId':_0x4e6d68[_0x19a6('0xd7')],'VoiceQueueId':_0x4e6d68[_0x19a6('0xd8')]||undefined,'CampaignId':_0x4e6d68[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x19b')));break;default:return!![];}};Dialer['prototype'][_0x19a6('0x105')]=function(_0x5c948f,_0x2c004d,_0xdac8f8){var _0x3057a0=this;var _0x32d236=new History(_0x5c948f);var _0x15a625=![];var _0x31b25e;var _0x51b8e1;return new Promise(function(_0x5f0b68,_0x20e296){if(_[_0x19a6('0x4c')](_0x2c004d)&&typeof _0x2c004d!==_0x19a6('0x159')){return _0x20e296(msgResponse(_0x19a6('0x19c'),_0x19a6('0x8c'),'entity\x20is\x20undefine'));}if(_[_0x19a6('0x4c')](_0xdac8f8)&&typeof _0xdac8f8!=='object'){return _0x20e296(msgResponse('[callProgressDetecting]',_0x19a6('0x8c'),_0x19a6('0x19d')));}hopperUtils['verifyAdditionalPhones'](_0x32d236,_0xdac8f8[_0x19a6('0xbf')],_0x2c004d)[_0x19a6('0x39')](function(_0x2b8aef){if(_0x2b8aef[_0x19a6('0xd0')]==0x1)_0x15a625=!![];switch(_0xdac8f8[_0x19a6('0xbf')]){case'0':_0x2c004d[_0x19a6('0x19e')]+=0x1;_0x32d236[_0x19a6('0x6a')]=0x0;_0x32d236[_0x19a6('0xca')]=_0x19a6('0x19f');_0x32d236[_0x19a6('0x11c')]+=0x1;_0x32d236[_0x19a6('0x116')]+=0x1;ami[_0x19a6('0x3b')](_0x19a6('0x1a0'),ut[_0x19a6('0x111')](_0x5c948f,_0x19a6('0x1a1')));_0x31b25e=_0x2c004d[_0x19a6('0x195')];_0x51b8e1=_0x2c004d[_0x19a6('0xce')];hopperUtils[_0x19a6('0xc3')](_0x32d236)['catch'](loggerCatch(_0x19a6('0x118')));if(_0x3057a0[_0x19a6('0x1a2')](0x0,_0x5c948f,_0x2c004d)&&!_0x15a625){if(_0x32d236[_0x19a6('0x11c')]>=_0x2c004d[_0x19a6('0x1a3')]){_0x3057a0[_0x19a6('0x129')](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1a4'));}else{_0x3057a0[_0x19a6('0x11e')](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1a4'));}}break;case'3':_0x2c004d[_0x19a6('0x1a5')]+=0x1;_0x32d236['state']=0x3;_0x32d236[_0x19a6('0xca')]='NoAnswer';_0x32d236[_0x19a6('0x11b')]+=0x1;_0x32d236[_0x19a6('0x116')]+=0x1;var _0x169570=ut[_0x19a6('0x1a6')](_0x5c948f,_0x2c004d);ami['emit']('custom:agentnoanswer',_0x169570);_0x31b25e=_0x2c004d[_0x19a6('0x18e')];_0x51b8e1=_0x2c004d['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x32d236)['catch'](loggerCatch(_0x19a6('0x1a7')));if(_0x3057a0[_0x19a6('0x1a2')](0x3,_0x5c948f,_0x2c004d)&&!_0x15a625){if(_0x32d236[_0x19a6('0x11b')]>=_0x2c004d[_0x19a6('0x18d')]){_0x3057a0['createStateFinal'](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1a8'));}else{_0x3057a0['stateGlobal'](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1a8'));}}break;case'5':_0x2c004d[_0x19a6('0x1a9')]+=0x1;_0x32d236[_0x19a6('0x6a')]=0x5;_0x32d236['statedesc']='Busy';_0x32d236[_0x19a6('0x119')]+=0x1;_0x32d236['countglobal']+=0x1;ami[_0x19a6('0x3b')](_0x19a6('0x1aa'),ut['buildObj'](_0x5c948f,_0x19a6('0x1ab')));_0x31b25e=_0x2c004d['dialBusyRetryFrequency'];_0x51b8e1=_0x2c004d['callAdditionalPhoneAfterMin'];hopperUtils[_0x19a6('0xc3')](_0x32d236)[_0x19a6('0x9a')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x3057a0[_0x19a6('0x1a2')](0x5,_0x5c948f,_0x2c004d)&&!_0x15a625){if(_0x32d236[_0x19a6('0x119')]>=_0x2c004d['dialBusyMaxRetry']){_0x3057a0['createStateFinal'](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1ac'));}else{_0x3057a0['stateGlobal'](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1ac'));}}break;case'8':_0x2c004d['outboundCongestionCallsDay']+=0x1;_0x32d236[_0x19a6('0x6a')]=0x8;_0x32d236[_0x19a6('0xca')]=_0x19a6('0x1ad');_0x32d236[_0x19a6('0x11a')]+=0x1;_0x32d236[_0x19a6('0x116')]+=0x1;_0x31b25e=_0x2c004d['dialCongestionRetryFrequency'];_0x51b8e1=_0x2c004d[_0x19a6('0xce')];ami[_0x19a6('0x3b')](_0x19a6('0x1ae'),ut['buildObj'](_0x5c948f,_0x19a6('0x1af')));hopperUtils[_0x19a6('0xc3')](_0x32d236)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x1b0')));if(_0x3057a0[_0x19a6('0x1a2')](0x8,_0x5c948f,_0x2c004d)&&!_0x15a625){if(_0x32d236[_0x19a6('0x11a')]>=_0x2c004d[_0x19a6('0x192')]){_0x3057a0[_0x19a6('0x129')](_0x32d236,_0x5f0b68,_0x20e296,'reason\x208\x20congestion');}else{_0x3057a0['stateGlobal'](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1b1'));}}break;case'11':_0x2c004d[_0x19a6('0x1b2')]+=0x1;_0x32d236[_0x19a6('0x6a')]=0xb;_0x32d236['statedesc']=_0x19a6('0xe2');_0x32d236[_0x19a6('0xe4')]+=0x1;_0x32d236[_0x19a6('0x116')]+=0x1;_0x31b25e=_0x2c004d[_0x19a6('0xe5')];_0x51b8e1=_0x2c004d[_0x19a6('0xce')];hopperUtils[_0x19a6('0xc3')](_0x32d236)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x1b3')));if(_0x3057a0[_0x19a6('0x1a2')](0xb,_0x5c948f,_0x2c004d)&&!_0x15a625){if(_0x32d236['countabandonedretry']>=_0x2c004d[_0x19a6('0xe7')]){_0x3057a0[_0x19a6('0x129')](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1b4'));}else{_0x3057a0[_0x19a6('0x11e')](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1b4'));}}break;case'20':_0x2c004d[_0x19a6('0x1b5')]+=0x1;_0x32d236[_0x19a6('0x6a')]=0x14;_0x32d236[_0x19a6('0xca')]=_0x19a6('0x1b6');_0x32d236[_0x19a6('0x127')]+=0x1;_0x32d236[_0x19a6('0x116')]+=0x1;_0x31b25e=_0x2c004d[_0x19a6('0x19a')];_0x51b8e1=_0x2c004d['callAdditionalPhoneAfterMin'];ami[_0x19a6('0x3b')]('custom:agentreject',ut[_0x19a6('0x111')](_0x5c948f,_0x19a6('0x1b7')));hopperUtils[_0x19a6('0xc3')](_0x32d236)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x1b8')));if(_0x3057a0[_0x19a6('0x1a2')](0x14,_0x5c948f,_0x2c004d)&&!_0x15a625){if(_0x32d236[_0x19a6('0x127')]>=_0x2c004d[_0x19a6('0x199')]){_0x3057a0[_0x19a6('0x129')](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1b9'));}else{_0x3057a0['stateGlobal'](_0x32d236,_0x5f0b68,_0x20e296,_0x19a6('0x1b9'));}}break;default:_0x2c004d['outboundUnknownCallsDay']+=0x1;_0x32d236[_0x19a6('0x6a')]=0xc;_0x32d236['statedesc']=_0xdac8f8[_0x19a6('0xbf')];_0x31b25e=_0x2c004d[_0x19a6('0x19a')];_0x51b8e1=_0x2c004d[_0x19a6('0xce')];hopperUtils[_0x19a6('0xc3')](_0x32d236)[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x1ba')));if(_0x3057a0[_0x19a6('0x1a2')](_0xdac8f8['reason'],_0x5c948f,_0x2c004d)&&!_0x15a625){if(_0x32d236[_0x19a6('0x119')]+_0x32d236[_0x19a6('0x11a')]+_0x32d236[_0x19a6('0x11b')]+_0x32d236['countnosuchnumberretry']+_0x32d236[_0x19a6('0xd3')]+_0x32d236[_0x19a6('0xe4')]+_0x32d236['countmachineretry']+_0x32d236[_0x19a6('0x127')]>=_0x2c004d[_0x19a6('0x11d')]){_0x3057a0[_0x19a6('0x11e')](_0x32d236,_0x5f0b68,_0x20e296,_0xdac8f8['reason']);}else{_0x3057a0[_0x19a6('0x129')](_0x32d236,_0x5f0b68,_0x20e296,_0xdac8f8[_0x19a6('0xbf')]);}}}})['then'](function(){if(_0x15a625){hopperUtils[_0x19a6('0xe0')](_0x32d236,_0x31b25e,_0x51b8e1)[_0x19a6('0x39')](function(){return _0x5f0b68(0x1);});}});});};Dialer['prototype'][_0x19a6('0x11e')]=function(_0x27817a,_0x28b9e9,_0x475f55,_0x5a2777){var _0x5ef07a=new Final(_0x27817a);_0x5ef07a['state']=0xf;_0x5ef07a[_0x19a6('0xca')]=_0x19a6('0x1bb');this[_0x19a6('0x129')](_0x5ef07a,_0x28b9e9,_0x475f55,_0x5a2777);};Dialer[_0x19a6('0x7c')][_0x19a6('0x129')]=function(_0x3eef37,_0x15e0ca,_0x49b025,_0x3177f9){hopperUtils[_0x19a6('0xc5')](_0x3eef37)[_0x19a6('0x39')](function(){return _0x15e0ca(msgResponse(_0x19a6('0x19c'),_0x19a6('0x1bc'),_0x3177f9));})['catch'](function(){return _0x49b025(msgResponse(_0x19a6('0x1bd'),'Failure','contact\x20not\x20moved'));});};Dialer[_0x19a6('0x7c')][_0x19a6('0xa')]=function(_0x2b9801){var _0x20a6d3=_0x2b9801[_0x19a6('0x1be')]/0x64;var _0x16526b=_0x2b9801[_0x19a6('0xc8')]/(_0x2b9801[_0x19a6('0xc8')]+_0x2b9801[_0x19a6('0x10d')]);var _0x377990=Math['round'](_0x2b9801[_0x19a6('0x1bf')]*(_0x2b9801[_0x19a6('0x1c0')]/0x64));var _0x53e544=Math['round'](_0x2b9801[_0x19a6('0x1bf')]*(_0x2b9801[_0x19a6('0x1c1')]/0x64));var _0x246e40=_0x2b9801[_0x19a6('0x137')]+_0x2b9801[_0x19a6('0x139')];var _0x4853a2=Math[_0x19a6('0x1c2')](_0x2b9801[_0x19a6('0x52')]*_0x2b9801['erlangAbandonmentRate']*_0x2b9801[_0x19a6('0x1c3')]*_0x2b9801['predictiveIntervalMultiplicativeFactor']);if(_[_0x19a6('0x4c')](_0x2b9801[_0x19a6('0x5a')])){if(!_[_0x19a6('0x4c')](_0x2b9801[_0x19a6('0x26')])){_0x2b9801[_0x19a6('0x26')]=undefined;loggerPredictive[_0x19a6('0x60')](_0x19a6('0x1c4'),_0x19a6('0x1c5'));}if(!_[_0x19a6('0x4c')](_0x2b9801[_0x19a6('0x5e')])){loggerPredictive[_0x19a6('0x60')](_0x19a6('0x1c4'),_0x19a6('0x1c6'));clearInterval(_0x2b9801[_0x19a6('0x5e')]);_0x2b9801[_0x19a6('0x5e')]=undefined;}_0x2b9801[_0x19a6('0x5a')]=moment()[_0x19a6('0x40')](_0x19a6('0xbe'));loggerPredictive[_0x19a6('0x43')](_0x2b9801[_0x19a6('0x5c')],_0x19a6('0x1c7'),_0x2b9801[_0x19a6('0x5a')]);this['handlePower'](_0x2b9801,0x1);}else if(ifInterval(_0x2b9801[_0x19a6('0x1c8')],_0x2b9801[_0x19a6('0x5a')])){this[_0x19a6('0xac')](_0x2b9801,0x1);loggerPredictiveCalls[_0x19a6('0x43')]('[startMethodPredictive][StartProgressive][Loop]',_0x2b9801[_0x19a6('0x5a')],_0x2b9801['name']);_0x2b9801[_0x19a6('0x52')]=0x0;_0x2b9801[_0x19a6('0xc9')]=0x0;}else if(_0x20a6d3<_0x16526b&&_0x2b9801[_0x19a6('0x1c9')]===_0x19a6('0x1ca')){clearPredictiveAttributes(_0x2b9801);loggerPredictive['info'](_0x19a6('0x1cb'),_0x19a6('0x1cc'),_0x16526b,'startProgressive',_0x2b9801[_0x19a6('0x5c')]);}else if(_0x4853a2<_0x2b9801[_0x19a6('0xc9')]&&_0x2b9801['dialPredictiveOptimization']===_0x19a6('0x1ca')){clearPredictiveAttributes(_0x2b9801);loggerPredictive[_0x19a6('0x43')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x19a6('0x1cd'),_0x4853a2,_0x19a6('0x1ce'),_0x2b9801['predictiveIntervalErlangCallsDroppedCalls'],_0x19a6('0x5a'),_0x2b9801['name']);}else if(!ifInterval(_0x2b9801[_0x19a6('0x1c8')],_0x2b9801['startProgressive'])&&_[_0x19a6('0x4c')](_0x2b9801[_0x19a6('0x26')])&&!_[_0x19a6('0x4c')](_0x2b9801['startProgressive'])){_0x2b9801['startPredictive']=moment()['format'](_0x19a6('0xbe'));loggerPredictive[_0x19a6('0x43')](_0x2b9801['name'],_0x19a6('0x1cf'),_0x2b9801[_0x19a6('0x26')]);hopperUtils['avgHandleTime'](_0x2b9801[_0x19a6('0x1c8')])[_0x19a6('0x39')](this[_0x19a6('0x1d0')](_0x2b9801))[_0x19a6('0x39')](mergeDataErlangB(_0x2b9801))[_0x19a6('0x39')](this[_0x19a6('0x1d1')](_0x2b9801))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2b9801));}else if(!ifInterval(_0x2b9801[_0x19a6('0x1c8')],_0x2b9801[_0x19a6('0x26')])){_0x2b9801[_0x19a6('0xc9')]=0x0;_0x2b9801[_0x19a6('0x26')]=moment()['format'](_0x19a6('0xbe'));loggerPredictive[_0x19a6('0x43')](_0x2b9801[_0x19a6('0x5c')],_0x19a6('0x1d2'),_0x2b9801[_0x19a6('0x26')]);clearInterval(_0x2b9801[_0x19a6('0x5e')]);_0x2b9801[_0x19a6('0x5e')]=undefined;hopperUtils[_0x19a6('0x1d3')](_0x2b9801[_0x19a6('0x1c8')])[_0x19a6('0x39')](this[_0x19a6('0x1d0')](_0x2b9801))['then'](mergeDataErlangB(_0x2b9801))[_0x19a6('0x39')](this[_0x19a6('0x1d1')](_0x2b9801))[_0x19a6('0x9a')](loggerCatchPredictive(_0x19a6('0x1d4'),_0x2b9801));}else if(_0x2b9801[_0x19a6('0x1bf')]&&_0x246e40<_0x2b9801[_0x19a6('0x1bf')]-_0x53e544){clearPredictiveAttributes(_0x2b9801);loggerPredictive[_0x19a6('0x43')](_0x2b9801['name'],_0x19a6('0x1d5'),_0x246e40,')\x20are\x20less\x20than\x20threshold\x20(',_0x2b9801[_0x19a6('0x1bf')],'-',_0x53e544,'=',_0x2b9801[_0x19a6('0x1bf')]-_0x53e544,')');}else if(_0x2b9801[_0x19a6('0x1bf')]&&_0x246e40>_0x2b9801[_0x19a6('0x1bf')]+_0x377990){clearPredictiveAttributes(_0x2b9801);loggerPredictive[_0x19a6('0x43')](_0x2b9801[_0x19a6('0x5c')],_0x19a6('0x1d5'),_0x246e40,_0x19a6('0x1d6'),_0x2b9801[_0x19a6('0x1bf')],'+',_0x377990,'=',_0x2b9801[_0x19a6('0x1bf')]+_0x377990,')');}};Dialer[_0x19a6('0x7c')]['getDataPredictive']=function(_0x11d68d){var _0x48efd9=this;return function(_0x643ae6){return new Promise(function(_0x2b845a,_0x80f44e){_['merge'](_0x11d68d,_0x643ae6[0x0]);if(checkGetDataPredictive(_0x643ae6[0x0])){var _0x18ad52=_0x11d68d[_0x19a6('0x1bf')]=_0x11d68d[_0x19a6('0x139')]+_0x11d68d['available'];var _0x153385=_0x11d68d[_0x19a6('0x1c8')]*0x3c;var _0xc40dbf=_0x643ae6[0x0]['predictiveIntervalAvgTalktime']+_0x643ae6[0x0][_0x19a6('0x49')];var _0x6b5211=(_0x643ae6[0x0][_0x19a6('0x1d7')]+_0x643ae6[0x0][_0x19a6('0x45')]+_0x643ae6[0x0][_0x19a6('0x47')])/_0x643ae6[0x0][_0x19a6('0x1d8')];_0x11d68d['predictiveIntervalHitRate']=_0x6b5211>0x0?_0x6b5211:0x1;switch(_0x11d68d[_0x19a6('0x1c9')]){case _0x19a6('0x1ca'):var _0x1089bb=_0x11d68d[_0x19a6('0x1be')]/0x64;return _0x48efd9[_0x19a6('0x1d9')](_0x18ad52,_0x153385,_0xc40dbf,_0x6b5211,_0x1089bb)[_0x19a6('0x39')](function(_0x4ffa2b){return _0x2b845a(_0x4ffa2b);});case _0x19a6('0x1da'):var _0x3cbab7=_0x11d68d[_0x19a6('0x1be')]/0x64;return _0x48efd9[_0x19a6('0x1db')](_0x18ad52,_0x153385,_0xc40dbf,_0x6b5211,_0x3cbab7)['then'](function(_0x4a464c){return _0x2b845a(_0x4a464c);});default:return _0x80f44e(msgResponse('[getDataPredictive]','Failure',_0x19a6('0x1dc')));}}else{return _0x80f44e(msgResponse(_0x19a6('0x1dd'),_0x19a6('0x8c'),_0x19a6('0x1de')));}});};};Dialer[_0x19a6('0x7c')]['getDataPredictiveOld']=function(_0x29109e){var _0x223993=this;return function(_0x4f86a3){return new Promise(function(_0x5c5e3e,_0x37992a){_[_0x19a6('0x58')](_0x29109e,_0x4f86a3[0x0]);if(checkGetDataPredictive(_0x4f86a3[0x0])){loggerPredictive[_0x19a6('0x43')](JSON[_0x19a6('0x6e')](_0x4f86a3[0x0]));if(_0x29109e[_0x19a6('0x1c9')]===_0x19a6('0x1ca')){return _0x223993['getVoiceQueueRtPauses'](_0x29109e['id'])[_0x19a6('0x39')](function(_0x244aea){var _0x530c74=_0x29109e[_0x19a6('0x1df')]-_0x244aea[0x0][_0x19a6('0x1e0')];var _0x300fd7=_0x29109e[_0x19a6('0x1c8')]*0x3c;var _0x1cc382=_0x4f86a3[0x0][_0x19a6('0x4d')]+_0x4f86a3[0x0][_0x19a6('0x49')];var _0x352a60=(_0x4f86a3[0x0][_0x19a6('0x1d7')]+_0x4f86a3[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4f86a3[0x0][_0x19a6('0x47')])/_0x4f86a3[0x0][_0x19a6('0x1d8')];var _0x1551ca=_0x29109e[_0x19a6('0x1be')]/0x64;_0x29109e[_0x19a6('0x1e1')]=_0x244aea[0x0]['outboundQueuePauses']||0x0;_0x29109e['predictiveIntervalHitRate']=_0x352a60>0x0?_0x352a60:0x1;return _0x223993['abandonmentRate'](_0x530c74,_0x300fd7,_0x1cc382,_0x352a60,_0x1551ca);})[_0x19a6('0x39')](function(_0x5ac5b6){return _0x5c5e3e(_0x5ac5b6);})[_0x19a6('0x9a')](function(_0x2abc2f){return _0x37992a(msgResponse('[CatchErlangB]',_0x19a6('0x8c'),JSON[_0x19a6('0x6e')](_0x2abc2f)));});}if(_0x29109e[_0x19a6('0x1c9')]===_0x19a6('0x1da')){return _0x223993['getVoiceQueueRtPauses'](_0x29109e['id'])[_0x19a6('0x39')](function(_0xee85ee){var _0x1f79dc=_0x29109e[_0x19a6('0x1df')]-_0xee85ee[0x0]['outboundQueuePauses'];var _0x778c5b=_0x29109e[_0x19a6('0x1c8')]*0x3c;var _0x277941=_0x4f86a3[0x0][_0x19a6('0x4d')]+_0x4f86a3[0x0][_0x19a6('0x49')];var _0x592e2a=(_0x4f86a3[0x0]['predictiveIntervalAnsweredCalls']+_0x4f86a3[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4f86a3[0x0][_0x19a6('0x47')])/_0x4f86a3[0x0][_0x19a6('0x1d8')];var _0x5c08a1=_0x29109e[_0x19a6('0x1be')]/0x64;_0x29109e['predictiveIntervalPauses']=_0xee85ee[0x0][_0x19a6('0x1e0')]||0x0;_0x29109e[_0x19a6('0x1c3')]=_0x592e2a>0x0?_0x592e2a:0x1;return _0x223993[_0x19a6('0x1db')](_0x1f79dc,_0x778c5b,_0x277941,_0x592e2a,_0x5c08a1);})[_0x19a6('0x39')](function(_0xa42a20){return _0x5c5e3e(_0xa42a20);})['catch'](function(_0x4d9198){return _0x37992a(msgResponse(_0x19a6('0x1e2'),'Failure',JSON['stringify'](_0x4d9198)));});}}else{return _0x37992a(msgResponse(_0x19a6('0x1dd'),_0x19a6('0x8c'),_0x19a6('0x1de')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x47b5ed){var _0x434de7=this;return function(){var _0x442248=0x0;var _0x57b8cf=Math[_0x19a6('0x1c2')](_0x47b5ed[_0x19a6('0x53')]*0x3e8);if(_0x57b8cf>0x0){_0x57b8cf=_0x57b8cf<0x64?0x64:_0x57b8cf;loggerPredictive['info'](_0x47b5ed['name'],_0x19a6('0x1e3'),_0x57b8cf,_0x19a6('0x1e4'));_0x47b5ed['handlePredictive']=setInterval(function(){_0x434de7[_0x19a6('0x5e')](_0x47b5ed);loggerPredictiveCalls[_0x19a6('0x43')](_0x19a6('0x1e5'),_0x442248+=0x1);},_0x57b8cf);}else{loggerPredictive[_0x19a6('0x43')](_0x47b5ed[_0x19a6('0x5c')],_0x19a6('0x1e6'));}};};Dialer[_0x19a6('0x7c')][_0x19a6('0x1e7')]=function(_0x58d0cd,_0x3bfe75){var _0x3f134e=this;return function(_0x2e1d06){if(_['isEmpty'](_0x2e1d06)){if(_['isNil'](_0x3bfe75[_0x19a6('0x152')])||!_0x3bfe75[_0x19a6('0x1e8')]){if(_0x58d0cd[_0x19a6('0xaa')]===_0x19a6('0xae')){_0x58d0cd[_0x19a6('0x6b')]=_['isUndefined'](_0x58d0cd['queueStatusComplete'])?!![]:_0x58d0cd[_0x19a6('0x6b')];var _0x2c15cc=uuid['v4']();_0x3f134e[_0x19a6('0x22')][_0x2c15cc]=new Action(_0x58d0cd,_0x3bfe75,_0x2c15cc);loggerBooked['info'](_0x19a6('0x1e9'),_0x2c15cc,'queueStatusComplete:\x20',JSON[_0x19a6('0x6e')](_0x58d0cd[_0x19a6('0x6b')]),_0x19a6('0x1ea'),_0x58d0cd['name']);if(_0x58d0cd[_0x19a6('0x6b')]){_0x58d0cd[_0x19a6('0x6b')]=![];_0x3f134e[_0x19a6('0xf1')][_0x3f134e[_0x19a6('0x22')][_0x2c15cc][_0x19a6('0xba')]]=[];ami[_0x19a6('0x94')]({'actionid':_0x2c15cc,'action':_0x19a6('0x1eb'),'queue':_0x58d0cd[_0x19a6('0x5c')]})[_0x19a6('0x9a')](function(){_0x3f134e[_0x19a6('0xbd')](_0x58d0cd);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x3f134e['actions'][_0x2c15cc][_0x19a6('0xd6')],'ListId':_0x3f134e[_0x19a6('0x22')][_0x2c15cc][_0x19a6('0xd7')],'VoiceQueueId':_0x3f134e[_0x19a6('0x22')][_0x2c15cc][_0x19a6('0xd8')]||undefined,'CampaignId':_0x3f134e[_0x19a6('0x22')][_0x2c15cc]['CampaignId']||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x1ec')));delete _0x3f134e[_0x19a6('0x22')][_0x2c15cc];});}else{loggerBooked['info'](_0x19a6('0x1ed'),JSON[_0x19a6('0x6e')](_0x58d0cd[_0x19a6('0x6b')]),_0x19a6('0x1ea'),_0x58d0cd[_0x19a6('0x5c')]);_0x3f134e['updateOriginated'](_0x58d0cd);hopperUtils[_0x19a6('0xd2')]({'active':![],'ContactId':_0x3f134e['actions'][_0x2c15cc][_0x19a6('0xd6')],'ListId':_0x3f134e['actions'][_0x2c15cc]['ListId'],'VoiceQueueId':_0x3f134e[_0x19a6('0x22')][_0x2c15cc][_0x19a6('0xd8')]||undefined,'CampaignId':_0x3f134e[_0x19a6('0x22')][_0x2c15cc][_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x1ec')));delete _0x3f134e[_0x19a6('0x22')][_0x2c15cc];}}else{return _0x3f134e[_0x19a6('0x158')](_0x58d0cd,_0x3bfe75);}}else{if(utils[_0x19a6('0x59')](undefined,_0x3bfe75[_0x19a6('0x1ee')])<_0x58d0cd[_0x19a6('0x1ef')]*0x3c){if(_0x3bfe75[_0x19a6('0x147')]&&!_0x3bfe75['Agent'][_0x19a6('0x1f0')]){_0x3f134e[_0x19a6('0x1b')][_0x19a6('0xf5')](_0x3bfe75['id'])[_0x19a6('0x19')](function(){_0x3f134e['updateOriginated'](_0x58d0cd);});}else{hopperUtils[_0x19a6('0x1f1')]({'active':![]},_0x3bfe75['id'],0x1)[_0x19a6('0x19')](function(){_0x3f134e[_0x19a6('0xbd')](_0x58d0cd);});}}else{_0x58d0cd[_0x19a6('0x1f2')]+=0x1;_0x3f134e[_0x19a6('0xbd')](_0x58d0cd);if(_0x58d0cd['dialRecallInQueue']){hopperUtils[_0x19a6('0xd2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3bfe75[_0x19a6('0xd6')],'ListId':_0x3bfe75[_0x19a6('0xd7')],'VoiceQueueId':_0x3bfe75[_0x19a6('0xd8')]||undefined,'CampaignId':_0x3bfe75[_0x19a6('0xd9')]||undefined})[_0x19a6('0x9a')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x19a6('0xc3')](createObjHistory(_0x58d0cd,_0x3bfe75,utils[_0x19a6('0x65')]['QUEUE_RECALL'],0x17,'RecallInQueue'))['catch'](loggerCatch(_0x19a6('0x1f3')));}else{_0x3f134e['saveInDb'](createObjHistory(_0x58d0cd,_0x3bfe75,utils[_0x19a6('0x65')][_0x19a6('0x1f4')],0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0x19a6('0x1f5'));}}}}else{_0x58d0cd[_0x19a6('0x1f6')]+=0x1;_0x3f134e[_0x19a6('0x112')](createObjHistory(_0x58d0cd,_0x3bfe75,utils[_0x19a6('0x65')]['BLACKLIST'],0xd,_0x19a6('0x1f7')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x19a6('0x7c')][_0x19a6('0x157')]=function(_0x2de136){var _0x128c5d=this;var _0x13cd3f=_0x2de136[_0x19a6('0x1f8')]-_0x2de136['originated']-_0x2de136[_0x19a6('0x1f9')];emitCampaignSummary(_0x2de136);if(_0x13cd3f>0x0){if(_0x13cd3f>this['maxNumberOriginate']){_0x13cd3f=this[_0x19a6('0x20')];}_0x2de136[_0x19a6('0x1f9')]+=_0x13cd3f;hopperUtils[_0x19a6('0x1fa')](_0x2de136['id'],_0x13cd3f,_0x2de136[_0x19a6('0x1fb')],_0x2de136)[_0x19a6('0x39')](function(_0x4f65f7){_0x2de136[_0x19a6('0x1f9')]-=_0x13cd3f;_0x2de136['temp']=_0x2de136[_0x19a6('0x1f9')]>0x0?_0x2de136['temp']:0x0;if(!utils[_0x19a6('0x1fc')](_0x4f65f7)){_0x2de136[_0x19a6('0x64')]=utils[_0x19a6('0x65')][_0x19a6('0x68')];logger['info'](_0x19a6('0x1fd')+_0x2de136[_0x19a6('0x5c')]);}else{_0x2de136[_0x19a6('0x77')]+=_0x4f65f7[_0x19a6('0x92')];_0x2de136[_0x19a6('0x64')]=utils['CAMPAIGN_STATUS'][_0x19a6('0x1fe')];for(var _0x55ac19=0x0;_0x55ac19<_0x4f65f7[_0x19a6('0x92')];_0x55ac19+=0x1){_0x2de136[_0x19a6('0x1ff')]+=0x1;if(_[_0x19a6('0xee')](_0x4f65f7[_0x55ac19])||_[_0x19a6('0xee')](_0x4f65f7[_0x55ac19][_0x19a6('0x171')])||_[_0x19a6('0xee')](_0x4f65f7[_0x55ac19][_0x19a6('0x15c')])){_0x128c5d[_0x19a6('0x200')](_0x19a6('0x201'),_0x2de136,_0x4f65f7[_0x55ac19]);}else{hopperUtils[_0x19a6('0x202')](_[_0x19a6('0xf2')](_0x4f65f7[_0x55ac19],[_0x19a6('0xd9'),'phone']))[_0x19a6('0x39')](_0x128c5d[_0x19a6('0x1e7')](_0x2de136,_0x4f65f7[_0x55ac19]))[_0x19a6('0x9a')](_0x128c5d[_0x19a6('0x203')](_0x19a6('0x204'),_0x2de136));}}}})[_0x19a6('0x9a')](loggerGetContactDialer('[getContactCampaign2]',_0x2de136,_0x13cd3f));}};Dialer['prototype'][_0x19a6('0xac')]=function(_0x15166e,_0x144e73){var _0x46ea73=this;var _0x3acd2f=[];if(_0x144e73<0x1||_0x15166e['dialMethod']===_0x19a6('0xae')){_0x144e73=0x1;}var _0x517231=Math['floor'](_0x15166e['available']*_0x144e73)-_0x15166e['originated']-_0x15166e[_0x19a6('0x1f9')];if(_0x15166e[_0x19a6('0x205')]>0x0){var _0x3b1d8d=_0x15166e[_0x19a6('0x205')]-_0x15166e['originated']-_0x15166e[_0x19a6('0x139')]-_0x15166e['temp']-_0x15166e[_0x19a6('0x13a')];if(_0x517231>_0x3b1d8d){_0x517231=_0x3b1d8d;}}if(_0x517231>0x0){if(_0x15166e[_0x19a6('0xaa')]===_0x19a6('0xae')){_0x517231=0x1;}if(_0x517231>this[_0x19a6('0x20')]){_0x517231=this[_0x19a6('0x20')];}_0x15166e[_0x19a6('0x1f9')]+=_0x517231;for(var _0x449871 in this[_0x19a6('0x1e')]){if(typeof this[_0x19a6('0x1e')][_0x449871]!==_0x19a6('0xa3')){if(this[_0x19a6('0x1e')][_0x449871][_0x19a6('0x6a')]===_0x19a6('0x206')&&this[_0x19a6('0x1e')][_0x449871][_0x19a6('0x80')]===_0x19a6('0x81')){_0x3acd2f[_0x19a6('0x93')](this[_0x19a6('0x1e')][_0x449871]['id']);}}}hopperUtils['getContactDialer'](_0x15166e,_0x3acd2f,_0x517231)['then'](function(_0x262950){_0x15166e[_0x19a6('0x1f9')]-=_0x517231;_0x15166e['temp']=_0x15166e['temp']>0x0?_0x15166e[_0x19a6('0x1f9')]:0x0;if(!utils[_0x19a6('0x1fc')](_0x262950)){hopperUtils['countReScheduled'](_0x15166e)['then'](sendMessageReschedule(_0x15166e))[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x207')));}else{_0x15166e['originated']+=_0x262950[_0x19a6('0x92')];_0x15166e[_0x19a6('0x64')]=_0x15166e[_0x19a6('0xaa')]===_0x19a6('0xae')?utils[_0x19a6('0x65')][_0x19a6('0x13b')]:utils['CAMPAIGN_STATUS']['RUNNING'];for(var _0x424341=0x0;_0x424341<_0x262950['length'];_0x424341+=0x1){if(_[_0x19a6('0xee')](_0x262950[_0x424341])||_['isNil'](_0x262950[_0x424341][_0x19a6('0x171')])||_[_0x19a6('0xee')](_0x262950[_0x424341]['phone'])){_0x46ea73[_0x19a6('0x200')](_0x19a6('0x201'),_0x15166e,_0x262950[_0x424341]);}else{hopperUtils[_0x19a6('0x208')](_[_0x19a6('0xf2')](_0x262950[_0x424341],['VoiceQueueId','phone']))[_0x19a6('0x39')](_0x46ea73['checkContactBlack'](_0x15166e,_0x262950[_0x424341]))[_0x19a6('0x9a')](_0x46ea73[_0x19a6('0x203')](_0x19a6('0x201'),_0x15166e));}}}})[_0x19a6('0x9a')](loggerGetContactDialer(_0x19a6('0x209'),_0x15166e,_0x517231));}};Dialer[_0x19a6('0x7c')][_0x19a6('0x5e')]=function(_0x311702){if(_0x311702[_0x19a6('0x205')]>0x0){var _0x54613d=_0x311702['dialLimitQueue']-_0x311702[_0x19a6('0x77')]-_0x311702[_0x19a6('0x139')];if(_0x54613d>0x0){this['tryOriginatePredictive'](_0x311702);}else{loggerPredictiveCalls[_0x19a6('0x43')](_0x19a6('0x20a'));}}else{this[_0x19a6('0x20b')](_0x311702);}};Dialer['prototype'][_0x19a6('0x20b')]=function(_0x363d77){var _0x5ae405=this;var _0x15d3c3=[];_0x363d77[_0x19a6('0x77')]+=0x1;for(var _0x2cb294 in this[_0x19a6('0x1e')]){if(typeof this[_0x19a6('0x1e')][_0x2cb294]!==_0x19a6('0xa3')){if(this[_0x19a6('0x1e')][_0x2cb294]['state']===_0x19a6('0x206')&&this[_0x19a6('0x1e')][_0x2cb294][_0x19a6('0x80')]===_0x19a6('0x81')){_0x15d3c3[_0x19a6('0x93')](this[_0x19a6('0x1e')][_0x2cb294]['id']);}}}return this['getContactDialer'](_0x363d77['id'],_0x15d3c3,0x1,_0x363d77[_0x19a6('0x1fb')],_0x363d77)[_0x19a6('0x39')](function(_0x2fd150){if(!utils['checkContactEmpty'](_0x2fd150)){utils[_0x19a6('0x62')](_0x363d77,0x1,0x0);return hopperUtils[_0x19a6('0x20c')](_0x363d77)[_0x19a6('0x39')](sendMessageReschedule(_0x363d77))[_0x19a6('0x9a')](loggerCatch(_0x19a6('0x207')));}else{_0x363d77['message']=utils['CAMPAIGN_STATUS'][_0x19a6('0x1fe')];if(_['isNil'](_0x2fd150[0x0])||_['isNil'](_0x2fd150[0x0][_0x19a6('0x171')])||_[_0x19a6('0xee')](_0x2fd150[0x0][_0x19a6('0x15c')])){_0x5ae405[_0x19a6('0x200')](_0x19a6('0x201'),_0x363d77,_0x2fd150[0x0]);}else{return hopperUtils[_0x19a6('0x208')](_[_0x19a6('0xf2')](_0x2fd150[0x0],['VoiceQueueId',_0x19a6('0x15c')]))[_0x19a6('0x39')](_0x5ae405['checkContactBlack'](_0x363d77,_0x2fd150[0x0]))[_0x19a6('0x9a')](_0x5ae405[_0x19a6('0x203')]('[actionOriginatePredictive]\x20',_0x363d77));}}})[_0x19a6('0x9a')](loggerGetContactDialer(_0x19a6('0x20d'),_0x363d77,0x1));};Dialer[_0x19a6('0x7c')][_0x19a6('0x1d9')]=function(_0x27bc11,_0x2c2b9e,_0x3e8331,_0x1be03,_0x4118ec,_0x40384a){loggerPredictive[_0x19a6('0x43')](_0x19a6('0x20e'));loggerPredictive[_0x19a6('0x43')](_0x19a6('0x20f'),_0x27bc11);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x210'),_0x2c2b9e);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x211'),_0x3e8331);loggerPredictive[_0x19a6('0x43')]('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',_0x1be03);loggerPredictive[_0x19a6('0x43')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4118ec);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x4b'));return new Promise(function(_0x3509db,_0x2dd0c8){if(_0x27bc11<=0x0||isNaN(_0x27bc11)){return _0x2dd0c8(msgResponse('[abandonmentRate]',_0x19a6('0xb8'),_0x19a6('0x212')+_0x27bc11));}if(_0x3e8331<=0x0||isNaN(_0x3e8331)){return _0x2dd0c8(msgResponse(_0x19a6('0x213'),'Error',_0x19a6('0x214')+_0x3e8331));}if(_0x1be03<=0x0||isNaN(_0x1be03)){return _0x2dd0c8(msgResponse('[abandonmentRate]',_0x19a6('0xb8'),_0x19a6('0x215')+_0x1be03));}if(_0x2c2b9e<=0x0||isNaN(_0x2c2b9e)){return _0x2dd0c8(msgResponse(_0x19a6('0x213'),_0x19a6('0xb8'),_0x19a6('0x216')+_0x2c2b9e));}if(_0x4118ec<=0x0||isNaN(_0x4118ec)){return _0x2dd0c8(msgResponse(_0x19a6('0x213'),_0x19a6('0xb8'),_0x19a6('0x217')+_0x4118ec));}_0x40384a=_0x40384a||0x0;var _0x499c83=0x1/_0x3e8331;var _0x4ffff6=0x0;var _0x2e62cb=0x0;var _0x3f8bcc=0x0;var _0x2fde3b=0x0;for(var _0xf59f4b=0x0;_0x3f8bcc<_0x4118ec;_0xf59f4b+=0x1){_0x2e62cb=_0xf59f4b/_0x2c2b9e;_0x4ffff6=(_0x1be03*_0x2e62cb+_0x40384a)/_0x499c83;_0x3f8bcc=utils[_0x19a6('0x218')](_0x4ffff6,_0x27bc11);_0x2fde3b=_0x4ffff6/_0x27bc11*(0x1-utils[_0x19a6('0x218')](_0x4ffff6,_0x27bc11));}return _0x3509db({'erlangCalls':_0xf59f4b,'erlangCallToSecond':_0x2c2b9e/_0xf59f4b,'erlangAbandonmentRate':_0x3f8bcc,'erlangBusyFactor':_0x2fde3b});});};Dialer['prototype']['busyFactor']=function(_0x38d9ba,_0x2223e3,_0x54d18b,_0x3f64cb,_0x54293e,_0x19121f){loggerPredictive[_0x19a6('0x43')](_0x19a6('0x219'));loggerPredictive[_0x19a6('0x43')](_0x19a6('0x20f'),_0x38d9ba);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x210'),_0x2223e3);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x211'),_0x54d18b);loggerPredictive[_0x19a6('0x43')](_0x19a6('0x21a'),_0x3f64cb);loggerPredictive['info'](_0x19a6('0x21b'),_0x54293e);loggerPredictive['info'](_0x19a6('0x4b'));return new Promise(function(_0x274bee,_0x3aa9d4){if(_0x38d9ba<=0x0||isNaN(_0x38d9ba)){return _0x3aa9d4(msgResponse(_0x19a6('0x21c'),_0x19a6('0xb8'),_0x19a6('0x212')+_0x38d9ba));}if(_0x54d18b<=0x0||isNaN(_0x54d18b)){return _0x3aa9d4(msgResponse(_0x19a6('0x21c'),_0x19a6('0xb8'),_0x19a6('0x214')+_0x54d18b));}if(_0x3f64cb<=0x0||isNaN(_0x3f64cb)){return _0x3aa9d4(msgResponse(_0x19a6('0x21c'),_0x19a6('0xb8'),_0x19a6('0x215')+_0x3f64cb));}if(_0x2223e3<=0x0||isNaN(_0x2223e3)){return _0x3aa9d4(msgResponse(_0x19a6('0x21c'),_0x19a6('0xb8'),_0x19a6('0x216')+_0x2223e3));}if(_0x54293e<=0x0||isNaN(_0x54293e)){return _0x3aa9d4(msgResponse(_0x19a6('0x21c'),'Error','Umin\x20=\x20'+_0x54293e));}_0x19121f=_0x19121f||0x0;var _0x5cb004=0x1/_0x54d18b;var _0x3a78e8=0x0;var _0x335e31=0x0;var _0x54348c=0x0;var _0x1585b2=0x0;for(var _0xc4692=0x0;_0x1585b2<_0x54293e;_0xc4692+=0x1){_0x335e31=_0xc4692/_0x2223e3;_0x3a78e8=(_0x3f64cb*_0x335e31+_0x19121f)/_0x5cb004;_0x54348c=utils[_0x19a6('0x218')](_0x3a78e8,_0x38d9ba);_0x1585b2=_0x3a78e8/_0x38d9ba*(0x1-utils[_0x19a6('0x218')](_0x3a78e8,_0x38d9ba));}return _0x274bee({'erlangCalls':_0xc4692,'erlangCallToSecond':_0x2223e3/_0xc4692,'erlangAbandonmentRate':_0x54348c,'erlangBusyFactor':_0x1585b2});});};module[_0x19a6('0x21d')]=Dialer; \ No newline at end of file +var _0x83ea=['dialDropMaxRetry','queueCallerAbandonCreateState','minutes','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','rescheduleContact','add','[rescheduleContact][Abandoned]','Abandoned','channel','syncQueueMember','actionid','rrmemory','roundrobin','isNil','stateinterface','locked','queueBooked','pick','idHopper','status','run','[Catch][Preview][syncQueueStatusComplete]','ContactId','[unlock][syncQueueStatusComplete]','_rr','paused','unlockRR','[booked][RR]','Agent:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','getQueue','response','callProgressDetecting','syncVarSet','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','membername','AMD','emit','custom:amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','amd','buildObj','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','saveInDb','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','dialAMDActive','[syncAgentComplete][createHistory][0]','reason19\x20machine....','createStateFinal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','AnswerAGI','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','inUse','ACTIVE','checkDialMethod','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','dialPreviewRecallmeReminder','filter','online','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','getCallerId','callerid','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','evt\x20is\x20undefine','additional','outboundNoSuchCallsDay','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','stateGlobal','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalMinThreshold','erlangCalls','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','getDataPredictive','talking','available','predictiveIntervalAnsweredCalls','predictiveIntervalHitRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','check\x20failure','floor','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','getContactDialerIvr','checkContactEmpty','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','[getContactCampaign2]','dialLimitQueue','countReScheduled','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','not_inuse','getContactDialer','dialOrderByScheduledAt','[countReScheduled]\x20','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','erlangb','exports','util','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/setting','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','syncQueueSummaryComplete','hangup','syncHangup','syncNewExten','varset','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','name','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','Interval','NULL_INTERVAL','Intervals','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','Error','isTrunkReachable','active','SIP/%s','reachable','unmonitored','Trunk','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','iftime\x20%s,%s','interval','timezones','indexOf','catch','content','true','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','undefined','resolve','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','launchHandleIvr','dialMethod','progressive','power','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','intervalIftime','Global:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','[ifTime][Action]','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','type','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','state','voiceQueue'];(function(_0x33d20b,_0x2013f0){var _0x2b3d65=function(_0x3179a2){while(--_0x3179a2){_0x33d20b['push'](_0x33d20b['shift']());}};_0x2b3d65(++_0x2013f0);}(_0x83ea,0x14f));var _0xa83e=function(_0x1c4a3a,_0xe9d931){_0x1c4a3a=_0x1c4a3a-0x0;var _0x321e73=_0x83ea[_0x1c4a3a];return _0x321e73;};'use strict';var util=require(_0xa83e('0x0'));var _=require('lodash');var uuid=require(_0xa83e('0x1'));var moment=require(_0xa83e('0x2'));var rr=require('rr');var Redis=require(_0xa83e('0x3'));var utils=require(_0xa83e('0x4'));var hopperUtils=require(_0xa83e('0x5'));var ut=require(_0xa83e('0x6'));var config=require('../../../config/environment/');var logger=require(_0xa83e('0x7'))(_0xa83e('0x8'));var loggerBooked=require(_0xa83e('0x7'))(_0xa83e('0x9'));var loggerPredictive=require(_0xa83e('0x7'))(_0xa83e('0xa'));var loggerPredictiveCalls=require(_0xa83e('0x7'))(_0xa83e('0xb'));var loggerSyncQueueSummary=require(_0xa83e('0x7'))('syncQueueSummary');var ami=require(_0xa83e('0xc'));config[_0xa83e('0xd')]=_[_0xa83e('0xe')](config[_0xa83e('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0xa83e('0xf'))(new Redis(config[_0xa83e('0xd')]));var cmHopper=require(_0xa83e('0x10'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xa83e('0x11'));var Interval=require('../rpc/interval');var Action=require(_0xa83e('0x12'));var History=require(_0xa83e('0x13'));var Final=require(_0xa83e('0x14'));var AgentComplete=require(_0xa83e('0x15'));var QueueCallerAbandon=require(_0xa83e('0x16'));var Hangup=require(_0xa83e('0x17'));var ipAgi=process[_0xa83e('0x18')][_0xa83e('0x19')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xa83e('0x1a')][_0xa83e('0x1b')]=function(_0x3ce35f){this[_0xa83e('0x1c')]=this[_0xa83e('0x1c')]?this['tail'][_0xa83e('0x1d')](_0x3ce35f):_0x3ce35f();};function Dialer(_0x402105,_0x329848){this[_0xa83e('0x1e')]=new Sequence();this[_0xa83e('0x1f')]=_0x329848;this[_0xa83e('0x20')]=_0x402105[_0xa83e('0x20')];this['campaigns']=_0x402105[_0xa83e('0x21')];this[_0xa83e('0x22')]=_0x402105['agents'];this['trunks']=_0x402105[_0xa83e('0x23')];this[_0xa83e('0x24')]=config[_0xa83e('0x24')]||0x2;this[_0xa83e('0x25')]={};this[_0xa83e('0x26')]={};this[_0xa83e('0x27')]={};this[_0xa83e('0x28')]={};this[_0xa83e('0x29')]={};this[_0xa83e('0x2a')]={};this[_0xa83e('0x2b')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0xa83e('0x2c')]={};this[_0xa83e('0x2d')]={};ami['on'](_0xa83e('0x2e'),this[_0xa83e('0x2f')]['bind'](this));ami['on'](_0xa83e('0x30'),this[_0xa83e('0x31')][_0xa83e('0x32')](this));ami['on'](_0xa83e('0x33'),this[_0xa83e('0x34')][_0xa83e('0x32')](this));ami['on'](_0xa83e('0x35'),this[_0xa83e('0x36')][_0xa83e('0x32')](this));ami['on'](_0xa83e('0x37'),this[_0xa83e('0x38')][_0xa83e('0x32')](this));ami['on']('custom:queuesummarycomplete',this[_0xa83e('0x39')][_0xa83e('0x32')](this));ami['on'](_0xa83e('0x3a'),this[_0xa83e('0x3b')][_0xa83e('0x32')](this));ami['on']('newexten',this[_0xa83e('0x3c')][_0xa83e('0x32')](this));ami['on'](_0xa83e('0x3d'),this['syncVarSet'][_0xa83e('0x32')](this));ami['on'](_0xa83e('0x3e'),this['syncQueueMember'][_0xa83e('0x32')](this));ami['on'](_0xa83e('0x3f'),this[_0xa83e('0x40')]['bind'](this));this['loopCampaigns']();this[_0xa83e('0x41')]();RpcSetting[_0xa83e('0x42')]()[_0xa83e('0x43')](function(_0x41e350){previewRecallmeReminderInterval=_0x41e350[_0xa83e('0x44')];});}function isNotNull(_0x40839c){return _0x40839c!==null&&!_['isUndefined'](_0x40839c);}function msgResponse(_0xabece8,_0x5d2997,_0x5b75e3){return{'action':_0xabece8,'response':_0x5d2997,'message':_0x5b75e3,'stack':_0x5b75e3};}function emit(_0x2158d4,_0x45f532,_0x4d1d18){io['to'](_0x2158d4)['emit'](_0x45f532,_0x4d1d18);}function emitOutboundVoiceQueueSummary(_0x3f3d74){if(_0x3f3d74['type']==='outbound'){logger[_0xa83e('0x45')](_0xa83e('0x46'),util[_0xa83e('0x47')](_0x3f3d74,{'showHidden':![],'depth':null}));emit(util[_0xa83e('0x48')](_0xa83e('0x49'),_0x3f3d74['name']),'voice_queue:save',_0x3f3d74);}}function checkGetDataPredictive(_0x31f2d5){if(isNotNull(_0x31f2d5)&&!_[_0xa83e('0x4a')](_0x31f2d5)){loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x4c'));loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x4d'),_0x31f2d5[_0xa83e('0x4e')]);loggerPredictive['info'](_0xa83e('0x4f'),_0x31f2d5['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x50'),_0x31f2d5[_0xa83e('0x51')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x31f2d5[_0xa83e('0x52')]);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x53'),_0x31f2d5[_0xa83e('0x54')]);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x55'),_0x31f2d5[_0xa83e('0x56')]);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x57'));if(_0x31f2d5[_0xa83e('0x4e')]>0x0){if(!_[_0xa83e('0x58')](_0x31f2d5[_0xa83e('0x56')])&&_0x31f2d5[_0xa83e('0x56')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xa83e('0x58')](_0x31f2d5[_0xa83e('0x54')])&&_0x31f2d5['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info'](_0xa83e('0x59'));}else{loggerPredictive[_0xa83e('0x4b')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x5a'));}return![];}function mergeDataErlangB(_0x17a755){return function(_0x24bfad){loggerPredictive['info'](_0xa83e('0x5b'));loggerPredictive['info'](_0xa83e('0x5c'),_0x24bfad['erlangCalls']);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x5d'),_0x24bfad[_0xa83e('0x5e')]);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x5f'),_0x24bfad[_0xa83e('0x60')]);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x61'),_0x24bfad['erlangBusyFactor']);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x5f'),_0x24bfad[_0xa83e('0x60')]);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x57'));_[_0xa83e('0x62')](_0x17a755,_0x24bfad);};}function ifInterval(_0x16fb5c,_0x463138){if(_[_0xa83e('0x58')](_0x463138)){return![];}return utils[_0xa83e('0x63')](undefined,_0x463138)<_0x16fb5c*0x3c;}function clearPredictiveAttributes(_0x5e060f){if(_0x5e060f[_0xa83e('0x2b')]){_0x5e060f[_0xa83e('0x2b')]=undefined;loggerPredictive['debug'](_0x5e060f[_0xa83e('0x64')],_0xa83e('0x65'));}if(_0x5e060f[_0xa83e('0x2a')]){_0x5e060f[_0xa83e('0x2a')]=undefined;loggerPredictive['debug'](_0x5e060f['name'],'startPredictive\x20value\x20cleared');}if(_0x5e060f[_0xa83e('0x66')]){clearInterval(_0x5e060f[_0xa83e('0x66')]);_0x5e060f[_0xa83e('0x66')]=undefined;loggerPredictive['debug'](_0x5e060f[_0xa83e('0x64')],_0xa83e('0x67'));}}function loggerCatchPredictive(_0x2d218f,_0x5ee59f){return function(_0x289a2b){loggerPredictive[_0xa83e('0x68')](_0x5ee59f[_0xa83e('0x64')],_0x2d218f);loggerPredictive['error'](_0x289a2b[_0xa83e('0x69')]);clearPredictiveAttributes(_0x5ee59f);};}function loggerCatch(_0x107d16){return function(_0x43802c){logger[_0xa83e('0x68')](_0x107d16,util[_0xa83e('0x47')](_0x43802c,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x382c53,_0x5cca97,_0x475ec5){return function(_0x15de1c){utils[_0xa83e('0x6a')](_0x5cca97,_0x475ec5,0x0);logger[_0xa83e('0x68')](_0x382c53,util[_0xa83e('0x47')](_0x15de1c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x579641){return function(_0x23f49d){if(isNotNull(_0x23f49d)&&isNotNull(_0x23f49d[0x0])){if(_0x23f49d[0x0][_0xa83e('0x6b')]>0x0){_0x579641[_0xa83e('0x6c')]=utils[_0xa83e('0x6d')][_0xa83e('0x6e')];logger[_0xa83e('0x4b')]('[getContactDialer2][ReScheduled]'+_0x579641[_0xa83e('0x64')],_0x23f49d[0x0][_0xa83e('0x6b')],_0xa83e('0x6f'));}else{_0x579641[_0xa83e('0x6c')]=utils[_0xa83e('0x6d')][_0xa83e('0x70')];logger[_0xa83e('0x4b')](_0xa83e('0x71')+_0x579641[_0xa83e('0x64')]);}}};}function createObjHistory(_0x49000a,_0x106395,_0x39bb59,_0x510904,_0x503b5c){_0x49000a[_0xa83e('0x6c')]=_0x39bb59;var _0x26d084=new Action(_0x49000a,_0x106395);var _0x495115=new History(_0x26d084);_0x495115['state']=_0x510904;_0x495115['statedesc']=_0x503b5c;_0x495115['endtime']=_0x26d084[_0xa83e('0x72')];return _0x495115;}function unlockQueueStatus(_0x47a635,_0x11b780){setTimeout(function(){if(_[_0xa83e('0x58')](_0x47a635[_0xa83e('0x73')])){loggerBooked[_0xa83e('0x68')](_0xa83e('0x74'),_0x11b780);}_0x47a635[_0xa83e('0x73')]=!![];loggerBooked[_0xa83e('0x4b')](_0xa83e('0x75'),_0x11b780,JSON[_0xa83e('0x76')](_['pick'](_0x47a635,[_0xa83e('0x64'),_0xa83e('0x73')])));},0x1f3);}function checkInterval(_0x4a152e){return function(){if(!isNotNull(_0x4a152e[_0xa83e('0x77')])){_0x4a152e[_0xa83e('0x6c')]=utils[_0xa83e('0x6d')][_0xa83e('0x78')];throw _0x4a152e[_0xa83e('0x64')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x4a152e[_0xa83e('0x77')][_0xa83e('0x79')])){_0x4a152e['message']=utils[_0xa83e('0x6d')][_0xa83e('0x78')];throw _0x4a152e[_0xa83e('0x64')]+_0xa83e('0x7a');}if(!isNotNull(_[_0xa83e('0x4a')](_0x4a152e[_0xa83e('0x77')][_0xa83e('0x79')]))){_0x4a152e[_0xa83e('0x6c')]=utils['CAMPAIGN_STATUS'][_0xa83e('0x78')];throw _0x4a152e['name']+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x1e5860){return function(){if(!utils[_0xa83e('0x7b')](_0x1e5860)){_0x1e5860[_0xa83e('0x6c')]=utils[_0xa83e('0x6d')][_0xa83e('0x7c')];throw _0x1e5860[_0xa83e('0x64')]+_0xa83e('0x7d');}};}function emitCampaignSummary(_0x2b501){if(utils[_0xa83e('0x7e')](_0x2b501)){emit(util[_0xa83e('0x48')](_0xa83e('0x7f'),_0x2b501[_0xa83e('0x64')]),_0xa83e('0x80'),_0x2b501);}}function loggerCatchQueueSummary(_0x3123bb,_0x24aef5){return function(_0x3db751){clearPredictiveAttributes(_0x24aef5);emitCampaignSummary(_0x24aef5);loggerSyncQueueSummary[_0xa83e('0x45')](_0x3123bb,util[_0xa83e('0x47')](_0x3db751,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x146a22){if(_0x146a22[_0xa83e('0x81')]){if(_0x146a22[_0xa83e('0x82')]===0x0){_0x146a22[_0xa83e('0x81')]=![];_0x146a22[_0xa83e('0x6c')]=utils[_0xa83e('0x6d')][_0xa83e('0x7c')];loggerSyncQueueSummary[_0xa83e('0x45')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x146a22[_0xa83e('0x64')],_0xa83e('0x83'));}else{_0x146a22[_0xa83e('0x6c')]=utils[_0xa83e('0x6d')][_0xa83e('0x84')];loggerSyncQueueSummary[_0xa83e('0x45')](_0xa83e('0x85'),_0x146a22[_0xa83e('0x64')],_0xa83e('0x86'));}emitCampaignSummary(_0x146a22);}}function myreject(_0x18cf62){return function(_0x47d195){return _0x18cf62(msgResponse('[ifTime][Action]',_0xa83e('0x87'),JSON[_0xa83e('0x76')](_0x47d195)));};}Dialer[_0xa83e('0x1a')][_0xa83e('0x88')]=function(_0x2c2c5a){return!_[_0xa83e('0x58')](_0x2c2c5a)&&_0x2c2c5a&&!_[_0xa83e('0x58')](_0x2c2c5a[_0xa83e('0x64')])&&!_[_0xa83e('0x58')](_0x2c2c5a[_0xa83e('0x89')])&&_0x2c2c5a[_0xa83e('0x89')]&&(this[_0xa83e('0x23')][util[_0xa83e('0x48')](_0xa83e('0x8a'),_0x2c2c5a[_0xa83e('0x64')])]['status']===_0xa83e('0x8b')||this[_0xa83e('0x23')][util[_0xa83e('0x48')](_0xa83e('0x8a'),_0x2c2c5a[_0xa83e('0x64')])]['status']===_0xa83e('0x8c'));};Dialer[_0xa83e('0x1a')]['checkIsTrunkReachable']=function(_0xb7617d){var _0x26362f=this;return function(){if(!_0x26362f[_0xa83e('0x88')](_0xb7617d[_0xa83e('0x8d')])){if(!_0x26362f[_0xa83e('0x88')](_0xb7617d[_0xa83e('0x8e')])){_0xb7617d['message']=utils[_0xa83e('0x6d')]['TRUNK_NOT_REACHABLE'];throw _0xb7617d[_0xa83e('0x64')]+_0xa83e('0x8f');}}};};Dialer[_0xa83e('0x1a')][_0xa83e('0x90')]=function(_0x4434f7,_0x200719,_0x1cb09a,_0x4e9295){var _0x33e5f1=this;return function(){var _0x27efce=!![];return _0x33e5f1[_0xa83e('0x91')](_0x4434f7,_0x200719,_0x1cb09a,_0x4e9295,_0x27efce);};};Dialer[_0xa83e('0x1a')][_0xa83e('0x92')]=function(_0x4c4d6d,_0x1825b3,_0x1897e6,_0x2a26bf){var _0x4763ed=this;return function(){var _0x357945=![];return _0x4763ed[_0xa83e('0x91')](_0x4c4d6d[_0xa83e('0x79')],_0x1825b3,_0x1897e6,_0x2a26bf,_0x357945);};};Dialer[_0xa83e('0x1a')][_0xa83e('0x91')]=function(_0x5ec314,_0x3df4c9,_0x393dd7,_0x52136c,_0x34dc0c){var _0x5ec068=[];return new Promise(function(_0x7aa778,_0x46a44e){if(!isNotNull(_0x5ec314)){_0x52136c[_0xa83e('0x6c')]=utils[_0xa83e('0x6d')][_0xa83e('0x78')];return _0x46a44e(msgResponse(_0xa83e('0x93'),_0xa83e('0x94'),_0x393dd7+'\x20Intervals\x20is\x20null\x20'));}if(_[_0xa83e('0x4a')](_0x5ec314)){_0x52136c[_0xa83e('0x6c')]=utils[_0xa83e('0x6d')][_0xa83e('0x95')];return _0x46a44e(msgResponse(_0xa83e('0x93'),_0xa83e('0x94'),_0x393dd7+_0xa83e('0x96')));}if(_0x3df4c9&&_[_0xa83e('0x58')](config['timezones'][_0x3df4c9])){_0x52136c[_0xa83e('0x6c')]=utils[_0xa83e('0x6d')]['UNKNOWN_TIMEZONE'];return _0x46a44e(msgResponse(_0xa83e('0x93'),_0xa83e('0x94'),_0x393dd7+_0xa83e('0x97')+_0x3df4c9));}if(_[_0xa83e('0x98')](_0x5ec314)){for(var _0x46d8d2=0x0;_0x46d8d2<_0x5ec314[_0xa83e('0x99')];_0x46d8d2+=0x1){_0x5ec068[_0xa83e('0x9a')](ami[_0xa83e('0x9b')]({'action':_0xa83e('0x9c'),'command':util[_0xa83e('0x48')](_0xa83e('0x9d'),_0x5ec314[_0x46d8d2][_0xa83e('0x9e')],!_[_0xa83e('0x58')](config[_0xa83e('0x9f')][_0x3df4c9])?_0x3df4c9:'')})[_0xa83e('0x43')](function(_0x29aee5){return _0x29aee5['content'][_0xa83e('0xa0')]('true')>=0x0;})[_0xa83e('0xa1')](myreject(_0x46a44e)));}}else{_0x5ec068['push'](ami[_0xa83e('0x9b')]({'action':_0xa83e('0x9c'),'command':util['format'](_0xa83e('0x9d'),_0x5ec314,!_['isUndefined'](config[_0xa83e('0x9f')][_0x3df4c9])?_0x3df4c9:'')})[_0xa83e('0x43')](function(_0xc5d66c){return _0xc5d66c[_0xa83e('0xa2')][_0xa83e('0xa0')](_0xa83e('0xa3'))>=0x0;})[_0xa83e('0xa1')](myreject(_0x46a44e)));}Promise[_0xa83e('0xa4')](_0x5ec068)['then'](function(_0x5064fb){var _0x8a8347=_['some'](_0x5064fb);if(_0x8a8347){return _0x7aa778(_0x8a8347);}else{_0x52136c[_0xa83e('0x6c')]=_0x34dc0c?utils[_0xa83e('0x6d')][_0xa83e('0xa5')]:utils['CAMPAIGN_STATUS'][_0xa83e('0xa6')];return _0x46a44e(msgResponse(_0xa83e('0xa7'),_0xa83e('0x94'),'Global:\x20'+_0x34dc0c+'\x20'+_0x393dd7+_0xa83e('0xa8')+util[_0xa83e('0x47')](_0x5ec314,{'showHidden':![],'depth':null})+_0xa83e('0xa9')+_0x3df4c9));}})[_0xa83e('0xa1')](function(_0x2f6086){return _0x46a44e(msgResponse('ifTime',_0xa83e('0x94'),JSON[_0xa83e('0x76')](_0x2f6086)));});});};Dialer[_0xa83e('0x1a')][_0xa83e('0xaa')]=function(){var _0x4596e3=this;return cmHopper[_0xa83e('0xab')]({'active':![]},{'where':{'active':!![]}})[_0xa83e('0x43')](function(){setInterval(function(){_0x4596e3['syncCampaigns']();},0x3e8);});};Dialer[_0xa83e('0x1a')]['syncCampaigns']=function(){var _0x54bf63=this;var _0x239f10;for(var _0x27e91a in this[_0xa83e('0x21')]){if(typeof this[_0xa83e('0x21')][_0x27e91a]!==_0xa83e('0xac')){_0x239f10=this['campaigns'][_0x27e91a];if(utils[_0xa83e('0x7e')](_0x239f10)&&utils[_0xa83e('0x7b')](_0x239f10)){_0x239f10[_0xa83e('0x81')]=!![];Promise[_0xa83e('0xad')]()['then'](checkIsIVRCampaignActive(_0x239f10))['then'](checkInterval(_0x239f10))[_0xa83e('0x43')](_0x54bf63[_0xa83e('0xae')](_0x239f10))['then'](_0x54bf63[_0xa83e('0x90')](_0x239f10[_0xa83e('0xaf')],_0x239f10[_0xa83e('0xb0')],_0x239f10['name'],_0x239f10))['then'](_0x54bf63['checkIfTimeIntervals'](_0x239f10['Interval'],_0x239f10[_0xa83e('0xb0')],_0x239f10[_0xa83e('0x64')],_0x239f10))[_0xa83e('0x43')](_0x54bf63[_0xa83e('0xb1')](_0x239f10))[_0xa83e('0xa1')](loggerCatchQueueSummary('[syncCampaigns]',_0x239f10));}else{notSendMessagesCampaign(_0x239f10);}}}};Dialer[_0xa83e('0x1a')]['checkDialMethod']=function(_0x50d066){if(_0x50d066[_0xa83e('0xb2')]!=='predictive'){clearPredictiveAttributes(_0x50d066);}switch(_0x50d066[_0xa83e('0xb2')]){case _0xa83e('0xb3'):this['handlePower'](_0x50d066,0x1);break;case _0xa83e('0xb4'):this[_0xa83e('0xb5')](_0x50d066,_0x50d066[_0xa83e('0xb6')]);break;case _0xa83e('0xa'):this['predictive'](_0x50d066);break;case'booked':this[_0xa83e('0xb5')](_0x50d066,0x1);break;default:logger[_0xa83e('0x68')](_0xa83e('0xb7'),_0x50d066['name'],_0xa83e('0xb8'));}};Dialer['prototype'][_0xa83e('0x93')]=function(_0x56490e,_0x213e73){var _0x4ca284=_0x56490e['dialTimezone'];var _0x1f0c3f=_0x213e73?_0x56490e['dialGlobalInterval']:_0x56490e['Interval'][_0xa83e('0x79')];logger[_0xa83e('0xb9')](_0xa83e('0xba'),_0x1f0c3f,_0x4ca284,_0x56490e[_0xa83e('0x64')],util[_0xa83e('0x48')]('Voice\x20Queue\x20%s\x20$s',_0x56490e['name'],_0x56490e['id']));var _0x33d330=null;return Interval[_0xa83e('0xbb')](_0x1f0c3f,_0x4ca284)[_0xa83e('0x43')](function(_0x131f90){if(_0x131f90===!![]){return _0x131f90;}else{_0x56490e[_0xa83e('0x6c')]=_0x213e73?utils[_0xa83e('0x6d')][_0xa83e('0xa5')]:utils[_0xa83e('0x6d')][_0xa83e('0xa6')];_0x33d330=msgResponse(_0xa83e('0xa7'),'Failure',_0xa83e('0xbc')+_0x213e73+'\x20'+_0x56490e['name']+_0xa83e('0xa8')+util[_0xa83e('0x47')](_0x1f0c3f,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4ca284);}if(_0x33d330!==null){logger[_0xa83e('0xb9')](_0xa83e('0xbd'),_0x33d330);_0x33d330[_0xa83e('0xbe')]=_0x213e73;throw _0x33d330;}})[_0xa83e('0xa1')](function(_0x2a4152){logger[_0xa83e('0x68')]('AMI\x20IfTime',_0x2a4152);throw msgResponse(_0xa83e('0xbf'),_0xa83e('0x87'),util['inspect'](_0x2a4152,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0xa83e('0x2f')]=function(_0x5596ab){if(this[_0xa83e('0x20')][_0x5596ab[_0xa83e('0xc0')]]){if(this[_0xa83e('0x28')][_0x5596ab['uniqueid']]&&this[_0xa83e('0x28')][_0x5596ab[_0xa83e('0xc1')]]['type']!==_0xa83e('0xc2')){this[_0xa83e('0xc3')](this['voiceQueues'][_0x5596ab[_0xa83e('0xc0')]]);this[_0xa83e('0x28')][_0x5596ab[_0xa83e('0xc1')]][_0xa83e('0xc4')]=moment()['format'](_0xa83e('0xc5'));}}};Dialer[_0xa83e('0x1a')][_0xa83e('0x36')]=function(_0x5e3eb3){var _0x53fbd4=this[_0xa83e('0x28')][_0x5e3eb3[_0xa83e('0xc1')]];if(this[_0xa83e('0x20')][_0x5e3eb3['queue']]){if(_0x53fbd4&&_0x53fbd4[_0xa83e('0xc6')]!==_0xa83e('0xc2')){delete this['uniqueId'][_0x5e3eb3[_0xa83e('0xc1')]];this['voiceQueues'][_0x5e3eb3[_0xa83e('0xc0')]][_0xa83e('0xc7')]+=0x1;var _0x316018=new AgentComplete(_0x53fbd4,_0x5e3eb3);if(_0x5e3eb3[_0xa83e('0xc8')]===_0xa83e('0xc9')){_0x316018[_0xa83e('0xca')]=this[_0xa83e('0x20')][_0x5e3eb3[_0xa83e('0xc0')]][_0xa83e('0xcb')]&&this[_0xa83e('0x20')][_0x5e3eb3['queue']][_0xa83e('0xcc')]?moment()[_0xa83e('0x48')](_0xa83e('0xc5')):undefined;}hopperUtils[_0xa83e('0xcd')](_0x316018)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0xce')));hopperUtils['moveContactManagedDialer'](_0x316018)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0xcf')));}}};Dialer[_0xa83e('0x1a')][_0xa83e('0x31')]=function(_0x205527){var _0x2b3c33=this[_0xa83e('0x28')][_0x205527[_0xa83e('0xc1')]];var _0x5b1d1c=this;var _0xaa3f0f=![];var _0x2c2a79;var _0x680ad8;if(this[_0xa83e('0x20')][_0x205527[_0xa83e('0xc0')]]){if(_0x2b3c33&&_0x2b3c33[_0xa83e('0xc6')]!==_0xa83e('0xc2')){delete this['uniqueId'][_0x205527[_0xa83e('0xc1')]];this[_0xa83e('0xc3')](this[_0xa83e('0x20')][_0x205527[_0xa83e('0xc0')]]);_0x2b3c33[_0xa83e('0xd0')]=moment()[_0xa83e('0x48')](_0xa83e('0xc5'));var _0x24733a=new QueueCallerAbandon(_0x2b3c33,_0x205527);if(utils[_0xa83e('0x63')](_0x2b3c33[_0xa83e('0xd0')],_0x2b3c33['responsetime'])>=_0x2b3c33[_0xa83e('0xd1')]){this[_0xa83e('0x20')][_0x205527[_0xa83e('0xc0')]][_0xa83e('0x51')]+=0x1;this[_0xa83e('0x20')][_0x205527[_0xa83e('0xc0')]][_0xa83e('0xd2')]+=0x1;this[_0xa83e('0x20')][_0x205527[_0xa83e('0xc0')]][_0xa83e('0xd3')]+=0x1;_0x24733a['state']=0xa;_0x24733a[_0xa83e('0xd4')]=_0xa83e('0xd5');_0x24733a[_0xa83e('0xd6')]=_0xa83e('0xd7');_0x24733a['agiafterat']=this[_0xa83e('0x20')][_0x205527[_0xa83e('0xc0')]][_0xa83e('0xcb')]?moment()[_0xa83e('0x48')](_0xa83e('0xc5')):undefined;_0x24733a[_0xa83e('0xd8')]+=0x1;_0x24733a[_0xa83e('0xd9')]+=0x1;_0x2c2a79=this['voiceQueues'][_0x205527[_0xa83e('0xc0')]][_0xa83e('0xda')];_0x680ad8=this[_0xa83e('0x20')][_0x205527[_0xa83e('0xc0')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xa83e('0xdb')](_0x24733a,_0x24733a[_0xa83e('0xdc')],_0x2b3c33[_0xa83e('0xdd')])[_0xa83e('0x43')](function(_0x8e37f1){_0xaa3f0f=_0x8e37f1['additional']==0x1;if(_0x24733a['countdropretry']>=_0x5b1d1c[_0xa83e('0x20')][_0x205527[_0xa83e('0xc0')]][_0xa83e('0xde')]){_0x5b1d1c[_0xa83e('0xdf')](_0x24733a,_0x8e37f1['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x24733a[_0xa83e('0xd8')],'scheduledat':moment()['add'](_0x5b1d1c[_0xa83e('0x20')][_0x205527[_0xa83e('0xc0')]][_0xa83e('0xda')],_0xa83e('0xe0'))[_0xa83e('0x48')](_0xa83e('0xc5')),'ContactId':_0x2b3c33['ContactId'],'ListId':_0x2b3c33[_0xa83e('0xe1')],'VoiceQueueId':_0x2b3c33[_0xa83e('0xe2')]||undefined,'CampaignId':_0x2b3c33[_0xa83e('0xe3')]||undefined})[_0xa83e('0xa1')](loggerCatch(_0xa83e('0xe4')));var _0xbfb250=new History(_0x24733a);_0xbfb250['state']=0xa;_0xbfb250[_0xa83e('0xd4')]='Drop';_0xbfb250[_0xa83e('0x72')]=moment()[_0xa83e('0x48')](_0xa83e('0xc5'));_0xbfb250[_0xa83e('0xe5')]=_0xbfb250[_0xa83e('0x72')];_0xbfb250[_0xa83e('0xe6')]=_0x24733a[_0xa83e('0xe6')];_0xbfb250[_0xa83e('0xe7')]=_0x24733a[_0xa83e('0xe7')];hopperUtils['createHistory'](_0xbfb250)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0xe8')));}})[_0xa83e('0x43')](function(){if(_0xaa3f0f)hopperUtils[_0xa83e('0xe9')](_0x24733a,_0x2c2a79,_0x680ad8)[_0xa83e('0x43')](function(){return 0x1;});});}else{this[_0xa83e('0x20')][_0x205527['queue']][_0xa83e('0x52')]+=0x1;this['voiceQueues'][_0x205527[_0xa83e('0xc0')]]['outboundDropCallsDayCallersExit']+=0x1;_0x24733a[_0xa83e('0xdc')]=0xb;_0x24733a[_0xa83e('0xd4')]='Abandoned';_0x24733a[_0xa83e('0xd6')]='CALLEREXIT';_0x24733a[_0xa83e('0xea')]+=0x1;_0x24733a[_0xa83e('0xd9')]+=0x1;_0x2c2a79=this[_0xa83e('0x20')][_0x205527[_0xa83e('0xc0')]][_0xa83e('0xeb')];_0x680ad8=this[_0xa83e('0x20')][_0x205527[_0xa83e('0xc0')]][_0xa83e('0xec')];hopperUtils[_0xa83e('0xdb')](_0x24733a,_0x24733a['state'],_0x2b3c33['voiceQueue'])[_0xa83e('0x43')](function(_0x253137){if(_0x24733a[_0xa83e('0xea')]>=_0x5b1d1c['voiceQueues'][_0x205527['queue']][_0xa83e('0xed')]){_0x5b1d1c[_0xa83e('0xdf')](_0x24733a,_0x253137['additional']);}else{hopperUtils[_0xa83e('0xee')]({'active':![],'countabandonedretry':_0x24733a['countabandonedretry'],'scheduledat':moment()[_0xa83e('0xef')](_0x5b1d1c[_0xa83e('0x20')][_0x205527[_0xa83e('0xc0')]][_0xa83e('0xeb')],_0xa83e('0xe0'))[_0xa83e('0x48')](_0xa83e('0xc5')),'ContactId':_0x2b3c33['ContactId'],'ListId':_0x2b3c33[_0xa83e('0xe1')],'VoiceQueueId':_0x2b3c33[_0xa83e('0xe2')]||undefined,'CampaignId':_0x2b3c33[_0xa83e('0xe3')]||undefined})[_0xa83e('0xa1')](loggerCatch(_0xa83e('0xf0')));var _0x3e9f1e=new History(_0x24733a);_0x3e9f1e['state']=0xb;_0x3e9f1e[_0xa83e('0xd4')]=_0xa83e('0xf1');_0x3e9f1e['starttime']=moment()[_0xa83e('0x48')](_0xa83e('0xc5'));_0x3e9f1e[_0xa83e('0xe5')]=_0x3e9f1e[_0xa83e('0x72')];_0x3e9f1e[_0xa83e('0xe6')]=_0x24733a['calleridname'];_0x3e9f1e[_0xa83e('0xe7')]=_0x24733a['calleridnum'];hopperUtils[_0xa83e('0xcd')](_0x3e9f1e)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0xa83e('0x43')](function(){if(_0xaa3f0f)hopperUtils[_0xa83e('0xe9')](_0x24733a,_0x2c2a79,_0x680ad8)['then'](function(){return 0x1;});});}}}};Dialer[_0xa83e('0x1a')][_0xa83e('0x3c')]=function(_0x204c0b){if(this[_0xa83e('0x26')][_0x204c0b[_0xa83e('0xc1')]]){this[_0xa83e('0x26')][_0x204c0b[_0xa83e('0xc1')]][_0xa83e('0xf2')]=_0x204c0b[_0xa83e('0xf2')];}if(this['uniqueId'][_0x204c0b[_0xa83e('0xc1')]]){this[_0xa83e('0x28')][_0x204c0b[_0xa83e('0xc1')]][_0xa83e('0xf2')]=_0x204c0b[_0xa83e('0xf2')];}};Dialer[_0xa83e('0x1a')][_0xa83e('0xf3')]=function(_0x330a88){if(!this[_0xa83e('0x26')][_0x330a88[_0xa83e('0xf4')]]){return;}var _0x25f87e=this[_0xa83e('0x20')][this[_0xa83e('0x26')][_0x330a88[_0xa83e('0xf4')]][_0xa83e('0xc0')]]['strategy']||_0xa83e('0xf5');if(_0x25f87e===_0xa83e('0xf6')){if(this[_0xa83e('0x26')][_0x330a88[_0xa83e('0xf4')]]&&_[_0xa83e('0xf7')](this[_0xa83e('0x26')][_0x330a88['actionid']]['locked'])&&_0x330a88['status']==='1'&&_0x330a88['paused']==='0'){if(this[_0xa83e('0x22')][_0x330a88[_0xa83e('0xf8')]]){if(!this[_0xa83e('0x22')][_0x330a88[_0xa83e('0xf8')]]['locked']){this[_0xa83e('0x22')][_0x330a88[_0xa83e('0xf8')]]['locked']=!![];this[_0xa83e('0x26')][_0x330a88[_0xa83e('0xf4')]][_0xa83e('0xf9')]=!![];this[_0xa83e('0x26')][_0x330a88[_0xa83e('0xf4')]][_0xa83e('0xf8')]=_0x330a88[_0xa83e('0xf8')];}}}}else if(_0x25f87e==='rrmemory'){if(this[_0xa83e('0x26')][_0x330a88['actionid']]){if(this[_0xa83e('0x22')][_0x330a88[_0xa83e('0xf8')]]){this['actions'][_0x330a88[_0xa83e('0xf4')]][_0xa83e('0xf8')]=_0x330a88[_0xa83e('0xf8')];if(_[_0xa83e('0xf7')](this[_0xa83e('0xfa')][this['actions'][_0x330a88[_0xa83e('0xf4')]][_0xa83e('0xc0')]])){this[_0xa83e('0xfa')][this[_0xa83e('0x26')][_0x330a88[_0xa83e('0xf4')]][_0xa83e('0xc0')]]=[];}this[_0xa83e('0xfa')][this[_0xa83e('0x26')][_0x330a88[_0xa83e('0xf4')]]['queue']]['push'](_[_0xa83e('0x62')](_[_0xa83e('0xfb')](this[_0xa83e('0x26')][_0x330a88['actionid']],[_0xa83e('0xfc'),_0xa83e('0xf8')]),{'status':_0x330a88[_0xa83e('0xfd')],'paused':_0x330a88['paused']}));}}}};Dialer[_0xa83e('0x1a')][_0xa83e('0x40')]=function(_0x226652){if(!this[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]]){return;}var _0x30b042=this;var _0x3faa15=this[_0xa83e('0x20')][this[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]]['queue']];var _0x3e2151=_0x3faa15['strategy']||'rrmemory';if(_0x3e2151===_0xa83e('0xf6')){if(this[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]]&&this[_0xa83e('0x26')][_0x226652['actionid']][_0xa83e('0xf8')]){this[_0xa83e('0x1f')][_0xa83e('0xfe')](this[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]][_0xa83e('0xfc')],this[_0xa83e('0x26')][_0x226652['actionid']][_0xa83e('0xf8')])[_0xa83e('0xa1')](function(_0x1f3287){logger[_0xa83e('0x68')](_0xa83e('0xff'),util[_0xa83e('0x47')](_0x1f3287,{'showHidden':![],'depth':null}));})['finally'](function(){_0x30b042[_0xa83e('0xc3')](_0x30b042[_0xa83e('0x20')][_0x30b042[_0xa83e('0x26')][_0x226652['actionid']]['queue']]);_0x30b042[_0xa83e('0x22')][_0x30b042['actions'][_0x226652[_0xa83e('0xf4')]][_0xa83e('0xf8')]][_0xa83e('0xf9')]=![];delete _0x30b042[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]];unlockQueueStatus(_0x3faa15);});}else{this[_0xa83e('0xc3')](this['voiceQueues'][this['actions'][_0x226652[_0xa83e('0xf4')]][_0xa83e('0xc0')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x226652[_0xa83e('0xf4')]][_0xa83e('0x100')],'ListId':this[_0xa83e('0x26')][_0x226652['actionid']][_0xa83e('0xe1')],'VoiceQueueId':this[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]][_0xa83e('0xe2')]||undefined,'CampaignId':this[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]][_0xa83e('0xe3')]||undefined})[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x101')));delete this[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]];unlockQueueStatus(_0x3faa15);}}else if(_0x3e2151===_0xa83e('0xf5')){var _0x1dad6c;if(this[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]]&&!_[_0xa83e('0x4a')](this['queueBooked'][this[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]]['queue']])){if(this[_0xa83e('0x2c')][_0x30b042[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]]['queue']]){this[_0xa83e('0x2c')][_0x30b042[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]][_0xa83e('0xc0')]]=this[_0xa83e('0x2c')][this[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]][_0xa83e('0xc0')]]?this['queueBookedRR'][this['actions'][_0x226652[_0xa83e('0xf4')]][_0xa83e('0xc0')]]:this[_0xa83e('0xfa')][this[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]]['queue']]?this[_0xa83e('0xfa')][this[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]][_0xa83e('0xc0')]]['_rr']||0x0:0x0;}this[_0xa83e('0xfa')][this['actions'][_0x226652[_0xa83e('0xf4')]][_0xa83e('0xc0')]][_0xa83e('0x102')]=this[_0xa83e('0x2c')][this[_0xa83e('0x26')][_0x226652[_0xa83e('0xf4')]][_0xa83e('0xc0')]];for(var _0x57bd31=0x0;_0x57bd31=_0x231116[_0xa83e('0x125')]){_0x489c75['stateGlobal'](_0x4a499d,_0x123de3,_0x17c5d6,'reason19\x20machine....');}else{if(_0x4a499d['countmachineretry']>=_0x231116[_0xa83e('0x126')]){_0x489c75['createStateFinal'](_0x4a499d,_0x123de3,_0x17c5d6,_0xa83e('0x127'));}else{hopperUtils[_0xa83e('0xee')]({'active':![],'countmachineretry':_0x4a499d[_0xa83e('0x11d')],'scheduledat':moment()[_0xa83e('0xef')](_0x231116[_0xa83e('0x128')],_0xa83e('0xe0'))[_0xa83e('0x48')](_0xa83e('0xc5')),'ContactId':_0x4a499d[_0xa83e('0x100')],'ListId':_0x4a499d[_0xa83e('0xe1')],'VoiceQueueId':_0x4a499d[_0xa83e('0xe2')]||undefined,'CampaignId':_0x4a499d[_0xa83e('0xe3')]||undefined})['catch'](loggerCatch(_0xa83e('0x129')));_0x123de3({'reschedule':0x1});}}});}if(_0x2a856c['type']===_0xa83e('0xc2')&&this[_0xa83e('0x21')][_0x2a856c[_0xa83e('0xc0')]]['dialAMDActive']&&_0x31116e[_0xa83e('0x112')]===_0xa83e('0x113')){delete this[_0xa83e('0x28')][_0x31116e[_0xa83e('0xc1')]];this[_0xa83e('0xc3')](this[_0xa83e('0x21')][_0x2a856c[_0xa83e('0xc0')]]);_0x282c12=new Hangup(_0x2a856c,_0x31116e);_0x282c12[_0xa83e('0xdc')]=0x12;_0x282c12[_0xa83e('0xd4')]='HangupInAMD';_0x282c12[_0xa83e('0x115')]=_0xa83e('0x116');ami['emit']('custom:amd',ut[_0xa83e('0x11f')](_0x282c12,_0xa83e('0x11e')));this[_0xa83e('0x12a')](_0x282c12,_0xa83e('0x12b'),_0xa83e('0x12c'));}if(_0x2a856c[_0xa83e('0xc6')]===_0xa83e('0xc2')&&this[_0xa83e('0x21')][_0x2a856c[_0xa83e('0xc0')]][_0xa83e('0x12d')]&&_0x31116e[_0xa83e('0x112')]===_0xa83e('0x11b')){return new Promise(function(_0x2846f0,_0x2c4714){delete _0x489c75[_0xa83e('0x28')][_0x31116e[_0xa83e('0xc1')]];_0x489c75['updateOriginated'](_0x489c75['campaigns'][_0x2a856c[_0xa83e('0xc0')]]);_0x489c75[_0xa83e('0x21')][_0x2a856c[_0xa83e('0xc0')]][_0xa83e('0xc7')]+=0x1;_0x489c75[_0xa83e('0x21')][_0x2a856c[_0xa83e('0xc0')]][_0xa83e('0x114')]+=0x1;var _0x21de68=_0x489c75[_0xa83e('0x21')][_0x2a856c[_0xa83e('0xc0')]];var _0x38d171=new Hangup(_0x2a856c,_0x31116e);_0x38d171['state']=0x13;_0x38d171[_0xa83e('0xd4')]='Machine';_0x38d171[_0xa83e('0x115')]=_0xa83e('0x116');_0x38d171[_0xa83e('0x11d')]+=0x1;_0x38d171[_0xa83e('0xd9')]+=0x1;_0x38d171['amd']=!![];ami['emit']('custom:amd',ut['buildObj'](_0x38d171,_0xa83e('0x11e')));hopperUtils[_0xa83e('0xcd')](_0x38d171)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x12e')));if(_0x38d171[_0xa83e('0x120')]+_0x38d171[_0xa83e('0x121')]+_0x38d171['countnoanswerretry']+_0x38d171[_0xa83e('0x123')]+_0x38d171[_0xa83e('0xd8')]+_0x38d171['countabandonedretry']+_0x38d171[_0xa83e('0x11d')]+_0x38d171['countagentrejectretry']>=_0x21de68[_0xa83e('0x125')]){_0x489c75['stateGlobal'](_0x38d171,_0x2846f0,_0x2c4714,_0xa83e('0x12f'));}else{if(_0x38d171[_0xa83e('0x11d')]>=_0x21de68[_0xa83e('0x126')]){_0x489c75[_0xa83e('0x130')](_0x38d171,_0x2846f0,_0x2c4714,_0xa83e('0x127'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x38d171[_0xa83e('0x11d')],'scheduledat':moment()[_0xa83e('0xef')](_0x21de68[_0xa83e('0x128')],_0xa83e('0xe0'))[_0xa83e('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38d171[_0xa83e('0x100')],'ListId':_0x38d171[_0xa83e('0xe1')],'VoiceQueueId':_0x38d171[_0xa83e('0xe2')]||undefined,'CampaignId':_0x38d171[_0xa83e('0xe3')]||undefined})['catch'](loggerCatch(_0xa83e('0x129')));_0x2846f0({'reschedule':0x1});}}});}}};Dialer[_0xa83e('0x1a')][_0xa83e('0x3b')]=function(_0x121302){var _0x1fc8c0=this[_0xa83e('0x28')][_0x121302[_0xa83e('0xc1')]];var _0x3ad8db;if(_0x1fc8c0&&_0x1fc8c0[_0xa83e('0xc6')]===_0xa83e('0xc2')){delete this[_0xa83e('0x28')][_0x121302[_0xa83e('0xc1')]];this[_0xa83e('0xc3')](this[_0xa83e('0x21')][_0x1fc8c0[_0xa83e('0xc0')]]);this[_0xa83e('0x21')][_0x1fc8c0[_0xa83e('0xc0')]][_0xa83e('0x131')]+=0x1;_0x3ad8db=new Hangup(_0x1fc8c0,_0x121302);hopperUtils[_0xa83e('0xcd')](_0x3ad8db)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x132')));hopperUtils[_0xa83e('0x133')](_0x3ad8db)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x134')));}if(_0x1fc8c0&&_0x1fc8c0[_0xa83e('0xc6')]!=='ivr'&&isNotNull(this[_0xa83e('0x20')][_0x1fc8c0['queue']][_0xa83e('0x135')])){delete this[_0xa83e('0x28')][_0x121302[_0xa83e('0xc1')]];this[_0xa83e('0xc3')](this[_0xa83e('0x20')][_0x1fc8c0[_0xa83e('0xc0')]]);this[_0xa83e('0x20')][_0x1fc8c0[_0xa83e('0xc0')]][_0xa83e('0xc7')]+=0x1;this[_0xa83e('0x20')][_0x1fc8c0['queue']][_0xa83e('0x114')]+=0x1;_0x3ad8db=new Hangup(_0x1fc8c0,_0x121302);_0x3ad8db[_0xa83e('0xdc')]=0x10;_0x3ad8db['statedesc']=_0xa83e('0x136');_0x3ad8db['membername']='AGI';hopperUtils['createHistory'](_0x3ad8db)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x132')));hopperUtils[_0xa83e('0x133')](_0x3ad8db)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x134')));}if(_0x1fc8c0&&_0x1fc8c0[_0xa83e('0xc6')]!=='ivr'&&!isNotNull(this[_0xa83e('0x20')][_0x1fc8c0[_0xa83e('0xc0')]][_0xa83e('0x135')])){delete this[_0xa83e('0x28')][_0x121302[_0xa83e('0xc1')]];this[_0xa83e('0xc3')](this['voiceQueues'][_0x1fc8c0[_0xa83e('0xc0')]]);this[_0xa83e('0x20')][_0x1fc8c0[_0xa83e('0xc0')]][_0xa83e('0x137')]+=0x1;_0x3ad8db=new Hangup(_0x1fc8c0,_0x121302);_0x3ad8db[_0xa83e('0xdc')]=0xc;_0x3ad8db[_0xa83e('0xd4')]=_0x121302[_0xa83e('0x138')];_0x3ad8db[_0xa83e('0x115')]=_0xa83e('0x139');hopperUtils['createHistory'](_0x3ad8db)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x132')));hopperUtils['moveContactManagedDialer'](_0x3ad8db)['catch'](loggerCatch(_0xa83e('0x134')));}};Dialer[_0xa83e('0x1a')][_0xa83e('0x38')]=function(_0x498d0b){var _0x188103=this;if(!_0x188103[_0xa83e('0x2d')][_0x498d0b[_0xa83e('0x64')]]){_0x188103['queuesSummary'][_0x498d0b[_0xa83e('0x64')]]={'running':![]};}else if(_0x188103[_0xa83e('0x2d')][_0x498d0b[_0xa83e('0x64')]][_0xa83e('0x13a')]===!![]){return;}else if(_0x188103['queuesSummary'][_0x498d0b['name']]['running']===![]){_0x188103[_0xa83e('0x2d')][_0x498d0b['name']]['running']=!![];}var _0x12ffcb=_0x188103['voiceQueues'][_0x498d0b[_0xa83e('0x64')]];var _0x11166c=_0x12ffcb[_0xa83e('0x6c')]!==utils[_0xa83e('0x6d')]['INACTIVE'];var _0x3185d1=utils[_0xa83e('0x13b')](_0x12ffcb);_0x12ffcb['statusMessage']=utils['getQueueCampaignStatusMessage'](_0x12ffcb,_0x188103[_0xa83e('0x23')]);Promise[_0xa83e('0xad')]()['then'](function(){if(_0x12ffcb[_0xa83e('0x13c')]===utils['CAMPAIGN_STATUS'][_0xa83e('0x7c')]){if(_0x11166c){clearPredictiveAttributes(_0x12ffcb);_0x498d0b[_0xa83e('0x2a')]=undefined;_0x498d0b[_0xa83e('0x2b')]=undefined;}if(_0x12ffcb[_0xa83e('0x13c')]===utils['CAMPAIGN_STATUS'][_0xa83e('0x7c')]){_0x498d0b['available']=0x0;_0x498d0b[_0xa83e('0x103')]=0x0;_0x498d0b[_0xa83e('0x13d')]=0x0;_0x498d0b['talking']=0x0;_0x498d0b['pTalking']=0x0;}}else if(_0x12ffcb[_0xa83e('0x13c')]===utils[_0xa83e('0x6d')][_0xa83e('0x13e')]&&!_0x3185d1){return _0x188103['ifTime'](_0x12ffcb,!![])[_0xa83e('0x43')](function(){return _0x188103[_0xa83e('0x93')](_0x12ffcb,![]);})[_0xa83e('0x43')](function(){return _0x188103[_0xa83e('0x13f')](_0x12ffcb);})['catch'](function(_0xdbe50d){loggerSyncQueueSummary[_0xa83e('0x45')](_0xa83e('0x140'),util['inspect'](_0xdbe50d,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x12ffcb);});}else{clearPredictiveAttributes(_0x12ffcb);}})['then'](function(){var _0x5e4f1d=_0x498d0b['compareToOutboundQueue'](_0x12ffcb);if(_0x5e4f1d||_0x12ffcb['queueSummaryCountersUpdated']){_0x12ffcb[_0xa83e('0x141')]=![];_0x498d0b[_0xa83e('0x142')](_0x12ffcb);Object[_0xa83e('0x143')](_0x12ffcb,_0x498d0b);emitOutboundVoiceQueueSummary(_0x498d0b);}_0x188103[_0xa83e('0x2d')][_0x12ffcb[_0xa83e('0x64')]][_0xa83e('0x13a')]=![];})['catch'](function(_0x488406){logger[_0xa83e('0x68')]('[syncQueueSummary]',util[_0xa83e('0x47')](_0x488406,{'showHidden':![],'depth':null}));_0x188103[_0xa83e('0x2d')][_0x12ffcb[_0xa83e('0x64')]][_0xa83e('0x13a')]=![];});};Dialer[_0xa83e('0x1a')][_0xa83e('0x39')]=_[_0xa83e('0x144')](function(){var _0x1a541d=_['filter'](this[_0xa83e('0x20')],function(_0x4566d3){return _0x4566d3[_0xa83e('0x145')];});var _0x4adc9a=_[_0xa83e('0x146')](this['agents'],function(_0x36841f){return _0x36841f[_0xa83e('0x147')]&&_0x36841f[_0xa83e('0xfd')]==='reachable';});if(_0x1a541d[_0xa83e('0x99')]>0x0&&_0x4adc9a[_0xa83e('0x99')]>0x0){return Promise[_0xa83e('0xad')]()[_0xa83e('0x43')](cmHopper[_0xa83e('0x148')](_[_0xa83e('0x149')](_0x1a541d,'id'),previewRecallmeReminderInterval,_[_0xa83e('0x149')](_0x4adc9a,'id')))['then'](function(_0x4895db){for(var _0x323616=0x0;_0x323616<_0x4895db['length'];_0x323616++){var _0x1c17d0=_0x4895db[_0x323616][_0xa83e('0x14a')][_0xa83e('0x64')];if(_0x1c17d0)io['to'](util[_0xa83e('0x48')](_0xa83e('0x14b'),_0x1c17d0))[_0xa83e('0x117')](_0xa83e('0x14c'),{'hopper':_0x4895db[_0x323616]});}})[_0xa83e('0xa1')](function(_0x553b03){logger[_0xa83e('0x68')](_0xa83e('0x14d'),_0x553b03);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xa83e('0x1a')][_0xa83e('0x41')]=function(){var _0x1b8ff1=this;setInterval(function(){_0x1b8ff1[_0xa83e('0x14e')](_0x1b8ff1[_0xa83e('0x28')],'[uniqueid]');_0x1b8ff1[_0xa83e('0x14e')](_0x1b8ff1[_0xa83e('0x26')],_0xa83e('0x14f'));},0x32c8);};Dialer[_0xa83e('0x1a')][_0xa83e('0x14e')]=function(_0x3ee80e,_0x3747cd){var _0x58aed9=this;for(var _0x47271d in _0x3ee80e){if(typeof _0x3ee80e[_0x47271d]!==_0xa83e('0xac')){this[_0xa83e('0x1e')][_0xa83e('0x1b')](function(){if(!_[_0xa83e('0xf7')](_0x3ee80e[_0x47271d])){return ami[_0xa83e('0x9b')]({'action':_0xa83e('0xfd'),'channel':_0x3ee80e[_0x47271d]['channel']})[_0xa83e('0xa1')](function(_0x3f09f8){if(_0x3f09f8[_0xa83e('0x6c')]===_0xa83e('0x150')){setTimeout(function(){if(_0x3ee80e[_0x47271d]&&_0x3ee80e[_0x47271d][_0xa83e('0xc6')]!==_0xa83e('0xc2')){_0x58aed9[_0xa83e('0xc3')](_0x58aed9['voiceQueues'][_0x3ee80e[_0x47271d][_0xa83e('0xc0')]]);logger[_0xa83e('0x68')](_0xa83e('0x151'),_0x3747cd,_0x47271d,_0x3ee80e[_0x47271d][_0xa83e('0xc0')]);delete _0x3ee80e[_0x47271d];}if(_0x3ee80e[_0x47271d]&&_0x3ee80e[_0x47271d][_0xa83e('0xc6')]===_0xa83e('0xc2')){_0x58aed9[_0xa83e('0xc3')](_0x58aed9[_0xa83e('0x21')][_0x3ee80e[_0x47271d]['queue']]);logger[_0xa83e('0x68')](_0xa83e('0x152'),_0x3747cd,_0x47271d,_0x3ee80e[_0x47271d]['queue']);delete _0x3ee80e[_0x47271d];}},0x2328);}});}});}}};Dialer[_0xa83e('0x1a')][_0xa83e('0x153')]=function(_0x548dcb){return Promise[_0xa83e('0xad')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x548dcb))[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x154')));};Dialer[_0xa83e('0x1a')][_0xa83e('0xc3')]=function(_0xaaeb6f){if(!_[_0xa83e('0x58')](_0xaaeb6f)&&_0xaaeb6f!==null){if(typeof _0xaaeb6f[_0xa83e('0x82')]!==_0xa83e('0xac')){if(_0xaaeb6f['originated']>0x0){_0xaaeb6f[_0xa83e('0x82')]-=0x1;}else{logger[_0xa83e('0x68')](_0xa83e('0x155'));}}}else{logger['error'](_0xa83e('0x156'));}};Dialer['prototype'][_0xa83e('0x157')]=function(_0x39c280,_0xcd7477){var _0x5d4c5b=this;return function(_0x552b83){_0x5d4c5b[_0xa83e('0xc3')](_0xcd7477);logger[_0xa83e('0x68')](_0x39c280,util[_0xa83e('0x47')](_0x552b83,{'showHidden':![],'depth':null}));};};Dialer[_0xa83e('0x1a')][_0xa83e('0x158')]=function(_0x1d3625,_0x13dd62,_0x2df094){var _0x525d77={'state':0x19,'statedesc':_0xa83e('0x159')};this[_0xa83e('0xc3')](_0x13dd62);this['saveInDb'](_[_0xa83e('0x62')](_0x525d77,_[_0xa83e('0xfb')](_0x2df094,[_0xa83e('0x100'),_0xa83e('0xe1'),_0xa83e('0x15a'),_0xa83e('0xe2'),'CampaignId'])),_0xa83e('0x15b'),_0xa83e('0x15c'));logger[_0xa83e('0x68')](_0x1d3625);};Dialer[_0xa83e('0x1a')][_0xa83e('0x12a')]=function(_0xf02798,_0x8b15f4,_0x2186b5){hopperUtils[_0xa83e('0xcd')](_0xf02798)[_0xa83e('0xa1')](loggerCatch(_0x8b15f4));hopperUtils[_0xa83e('0x133')](_0xf02798)['catch'](loggerCatch(_0x2186b5));};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x6c3472,_0x30302f){hopperUtils['createHistory'](_0x6c3472)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0xce')));if(_0x30302f==0x0){hopperUtils[_0xa83e('0x133')](_0x6c3472)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x15d')));}};Dialer['prototype'][_0xa83e('0x14d')]=function(_0x4e6739){return Promise[_0xa83e('0xad')]()[_0xa83e('0x43')](cmHopper['handlePreviewRecallNotifications'](_0x4e6739['id'],previewRecallmeReminderInterval))[_0xa83e('0x43')](function(_0x59bbbe){for(var _0x260415=0x0;_0x260415<_0x59bbbe[_0xa83e('0x99')];_0x260415++){var _0x32b96a=_0x59bbbe[_0x260415][_0xa83e('0x14a')][_0xa83e('0x64')];if(_0x32b96a)io['to'](util[_0xa83e('0x48')](_0xa83e('0x14b'),_0x32b96a))[_0xa83e('0x117')]('user:dialPreviewRecallReminder',{'hopper':_0x59bbbe[_0x260415]});}})[_0xa83e('0xa1')](function(){});};Dialer[_0xa83e('0x1a')][_0xa83e('0xb1')]=function(_0x3d99b6){var _0x2d9aa2=this;return function(){_0x2d9aa2['handleIvr'](_0x3d99b6);};};Dialer[_0xa83e('0x1a')][_0xa83e('0x15e')]=function(_0x2147bf,_0x4d7b96){var _0x152a90=this;var _0x12f69b=uuid['v4']();this['actions'][_0x12f69b]=new Action(_0x2147bf,_0x4d7b96,_0x12f69b);return new Promise(function(_0x156f0d,_0x5ced86){if(_[_0xa83e('0x58')](_0x2147bf)&&typeof _0x2147bf!=='object'){return _0x5ced86(msgResponse(_0xa83e('0x15f'),'Failure',_0xa83e('0x160')));}if(_['isUndefined'](_0x4d7b96[_0xa83e('0x161')])||_0x4d7b96['phone']===null){return _0x5ced86(msgResponse('originate',_0xa83e('0x94'),_0xa83e('0x162')));}var _0x214cd1={'XMD-CALLERID':_0x152a90[_0xa83e('0x26')][_0x12f69b][_0xa83e('0x163')](),'XMD-AGI':_0x2147bf[_0xa83e('0x135')]?util[_0xa83e('0x48')](_0xa83e('0x164'),ipAgi,_0x2147bf[_0xa83e('0x135')]):'NONE','XMD-AGIAFTER':_0x2147bf[_0xa83e('0xcb')]?util[_0xa83e('0x48')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2147bf[_0xa83e('0xcb')]):_0xa83e('0x165'),'XMD-QUEUE':utils['isOutboundQueue'](_0x2147bf)?util[_0xa83e('0x48')](_0xa83e('0x166'),_0x2147bf[_0xa83e('0x64')],_0x2147bf[_0xa83e('0x167')]||'',_0x2147bf[_0xa83e('0xcc')]?'c':'',_0x2147bf[_0xa83e('0xd1')]||0x3):'NONE','XMD-CONTACTID':_0x4d7b96[_0xa83e('0x100')],'XMD-CDRTYPE':_0xa83e('0x8'),'CALLERID(all)':_0x152a90[_0xa83e('0x26')][_0x12f69b][_0xa83e('0x163')](),'XMD-AMD':_0x2147bf[_0xa83e('0x12d')]?_0xa83e('0x13e'):_0xa83e('0x165'),'XMD-DESTINATION':_0xa83e('0x111')};if(_0x2147bf[_0xa83e('0x12d')]){_0x214cd1['XMD-AMDINITIALSILENCE']=_0x2147bf[_0xa83e('0x168')]||0x9c4;_0x214cd1[_0xa83e('0x169')]=_0x2147bf[_0xa83e('0x16a')]||0x5dc;_0x214cd1['XMD-AMDAFTERGREETINGSILENCE']=_0x2147bf[_0xa83e('0x16b')]||0x320;_0x214cd1[_0xa83e('0x16c')]=_0x2147bf[_0xa83e('0x16d')]||0x1388;_0x214cd1[_0xa83e('0x16e')]=_0x2147bf[_0xa83e('0x16f')]||0x64;_0x214cd1[_0xa83e('0x170')]=_0x2147bf[_0xa83e('0x171')]||0x32;_0x214cd1['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x2147bf['dialAMDMaximumNumberOfWords']||0x3;_0x214cd1['XMD-AMDSILENCETHRESHOLD']=_0x2147bf[_0xa83e('0x172')]||0x100;_0x214cd1[_0xa83e('0x173')]=_0x2147bf[_0xa83e('0x174')]||0x1388;}if(utils[_0xa83e('0x175')](_0x2147bf)){_0x214cd1['XMD-VOICEQUEUEID']=_0x4d7b96['VoiceQueueId'];}else{_0x214cd1[_0xa83e('0x176')]=_0x4d7b96[_0xa83e('0xe3')];}for(var _0x315346 in _0x4d7b96['Contact']){if(typeof _0x4d7b96[_0xa83e('0x177')][_0x315346]!==_0xa83e('0xac')){if(isNotNull(_0x4d7b96[_0xa83e('0x177')][_0x315346])&&_0x315346!=='id'&&_0x315346!==_0xa83e('0x178')&&_0x315346!==_0xa83e('0x179')&&_0x315346!==_0xa83e('0x17a')){_0x214cd1[util['format'](_0xa83e('0x17b'),_0xa83e('0x17c'),_[_0xa83e('0x17d')](_0x315346))]=_0x4d7b96[_0xa83e('0x177')][_0x315346];}}}var _0xf1a055=_0x152a90[_0xa83e('0x88')](_0x2147bf[_0xa83e('0x8d')])?utils[_0xa83e('0x17e')](_0x2147bf[_0xa83e('0x8d')][_0xa83e('0x17f')],_0x2147bf['dialOriginateCallerIdName'],_0x2147bf['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xa83e('0x180')](_0x2147bf['dialOriginateCallerIdNumber'],_0x2147bf[_0xa83e('0x181')]):_0x2147bf[_0xa83e('0x182')]):utils['getCallerId'](_['isNil'](_0x2147bf[_0xa83e('0x8e')])?_0x2147bf[_0xa83e('0x8d')][_0xa83e('0x17f')]:_0x2147bf[_0xa83e('0x8e')][_0xa83e('0x17f')],_0x2147bf[_0xa83e('0x183')],_0x2147bf['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xa83e('0x180')](_0x2147bf[_0xa83e('0x182')],_0x2147bf['dialRandomLastDigitCallerIdNumber']):_0x2147bf[_0xa83e('0x182')]);if(_0xf1a055){_0x214cd1[_0xa83e('0x184')]=_0x152a90[_0xa83e('0x26')][_0x12f69b][_0xa83e('0x185')]=utils[_0xa83e('0x186')](_0xf1a055);_0x214cd1[_0xa83e('0x187')]=_0x4d7b96['phone'];}_0x2147bf[_0xa83e('0x188')]=_0x214cd1;return ami[_0xa83e('0x9b')]({'actionid':_0x12f69b,'action':_0xa83e('0x15f'),'channel':_0x152a90[_0xa83e('0x88')](_0x2147bf['Trunk'])?util[_0xa83e('0x48')](_0xa83e('0x189'),_0x2147bf['Trunk']['name'],isNotNull(_0x2147bf[_0xa83e('0x18a')])?_0x2147bf[_0xa83e('0x18a')]['trim']()||'':'',_0x2147bf[_0xa83e('0x18b')]>0x0?_0x4d7b96[_0xa83e('0x161')][_0xa83e('0x18c')](_0x2147bf[_0xa83e('0x18b')]):_0x4d7b96['phone']):util[_0xa83e('0x48')](_0xa83e('0x189'),_[_0xa83e('0xf7')](_0x2147bf['TrunkBackup'])?_0x2147bf[_0xa83e('0x8d')][_0xa83e('0x64')]:_0x2147bf[_0xa83e('0x8e')]['name'],isNotNull(_0x2147bf[_0xa83e('0x18a')])?_0x2147bf[_0xa83e('0x18a')][_0xa83e('0x18d')]()||'':'',_0x2147bf[_0xa83e('0x18b')]>0x0?_0x4d7b96['phone'][_0xa83e('0x18c')](_0x2147bf[_0xa83e('0x18b')]):_0x4d7b96[_0xa83e('0x161')]),'callerid':_0xf1a055,'Exten':_0xa83e('0x111'),'Context':_0xa83e('0x18e'),'Priority':'1','variable':_0x214cd1,'timeout':(_0x2147bf['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x12f69b})[_0xa83e('0x43')](function(_0x15449a){return _0x156f0d(_0x15449a);})[_0xa83e('0xa1')](function(_0x570d76){_0x2147bf[_0xa83e('0x18f')]+=0x1;var _0x3d010a=new History(_0x152a90[_0xa83e('0x26')][_0x12f69b]);logger[_0xa83e('0x68')](util[_0xa83e('0x48')](_0xa83e('0x190'),JSON[_0xa83e('0x76')](_0x570d76)));_0x3d010a[_0xa83e('0xdc')]=0xe;_0x3d010a[_0xa83e('0xd4')]=_0xa83e('0x191');_0x3d010a[_0xa83e('0x72')]=moment()[_0xa83e('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d010a[_0xa83e('0xe5')]=_0x3d010a[_0xa83e('0x72')];hopperUtils['createHistory'](_0x3d010a)[_0xa83e('0xa1')](loggerCatch('[originate][error]'));_0x152a90['moveContactManagedDialer'](_0x3d010a)['catch'](loggerCatch(_0xa83e('0x192')))[_0xa83e('0x1d')](function(){delete _0x152a90[_0xa83e('0x26')][_0x12f69b];return _0x5ced86(msgResponse('originate','Error',_0xa83e('0x193')));});});});};Dialer[_0xa83e('0x1a')][_0xa83e('0x194')]=function(_0xb2a1e4,_0x27dcb0,_0x57b450){var _0x5b8bed=new History(_0x27dcb0);if(_0x5b8bed[_0xa83e('0x120')]+_0x5b8bed[_0xa83e('0x121')]+_0x5b8bed['countnoanswerretry']+_0x5b8bed['countnosuchnumberretry']+_0x5b8bed['countdropretry']+_0x5b8bed[_0xa83e('0xea')]+_0x5b8bed[_0xa83e('0x11d')]+_0x5b8bed[_0xa83e('0x124')]>=_0x57b450[_0xa83e('0x125')]-0x1){return!![];}switch(_0xb2a1e4){case 0x3:if(_0x5b8bed[_0xa83e('0x122')]>=_0x57b450[_0xa83e('0x195')]-0x1){return!![];}hopperUtils[_0xa83e('0xee')]({'active':![],'countnoanswerretry':_0x5b8bed[_0xa83e('0x122')]+=0x1,'scheduledat':moment()[_0xa83e('0xef')](_0x57b450[_0xa83e('0x196')],_0xa83e('0xe0'))[_0xa83e('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5b8bed[_0xa83e('0x100')],'ListId':_0x5b8bed[_0xa83e('0xe1')],'VoiceQueueId':_0x5b8bed[_0xa83e('0xe2')]||undefined,'CampaignId':_0x5b8bed[_0xa83e('0xe3')]||undefined})[_0xa83e('0xa1')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x5b8bed[_0xa83e('0x120')]>=_0x57b450['dialBusyMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x5b8bed[_0xa83e('0x120')]+=0x1,'scheduledat':moment()[_0xa83e('0xef')](_0x57b450[_0xa83e('0x197')],_0xa83e('0xe0'))['format'](_0xa83e('0xc5')),'ContactId':_0x5b8bed[_0xa83e('0x100')],'ListId':_0x5b8bed['ListId'],'VoiceQueueId':_0x5b8bed[_0xa83e('0xe2')]||undefined,'CampaignId':_0x5b8bed[_0xa83e('0xe3')]||undefined})[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x198')));break;case 0x8:if(_0x5b8bed['countcongestionretry']>=_0x57b450[_0xa83e('0x199')]-0x1){return!![];}hopperUtils[_0xa83e('0xee')]({'active':![],'countcongestionretry':_0x5b8bed[_0xa83e('0x121')]+=0x1,'scheduledat':moment()['add'](_0x57b450[_0xa83e('0x19a')],'minutes')[_0xa83e('0x48')](_0xa83e('0xc5')),'ContactId':_0x5b8bed[_0xa83e('0x100')],'ListId':_0x5b8bed[_0xa83e('0xe1')],'VoiceQueueId':_0x5b8bed[_0xa83e('0xe2')]||undefined,'CampaignId':_0x5b8bed['CampaignId']||undefined})[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x19b')));break;case 0x0:if(_0x5b8bed[_0xa83e('0x123')]>=_0x57b450[_0xa83e('0x19c')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x5b8bed['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xa83e('0xef')](_0x57b450[_0xa83e('0x19d')],_0xa83e('0xe0'))[_0xa83e('0x48')](_0xa83e('0xc5')),'ContactId':_0x5b8bed[_0xa83e('0x100')],'ListId':_0x5b8bed[_0xa83e('0xe1')],'VoiceQueueId':_0x5b8bed[_0xa83e('0xe2')]||undefined,'CampaignId':_0x5b8bed[_0xa83e('0xe3')]||undefined})[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x19e')));}break;case 0xa:if(_0x5b8bed[_0xa83e('0xd8')]>=_0x57b450[_0xa83e('0xde')]-0x1){return!![];}hopperUtils[_0xa83e('0xee')]({'active':![],'countdropretry':_0x5b8bed[_0xa83e('0xd8')]+=0x1,'scheduledat':moment()['add'](_0x57b450['dialDropRetryFrequency'],_0xa83e('0xe0'))[_0xa83e('0x48')](_0xa83e('0xc5')),'ContactId':_0x5b8bed['ContactId'],'ListId':_0x5b8bed[_0xa83e('0xe1')],'VoiceQueueId':_0x5b8bed['VoiceQueueId']||undefined,'CampaignId':_0x5b8bed[_0xa83e('0xe3')]||undefined})['catch'](loggerCatch(_0xa83e('0xe4')));break;case 0xb:if(_0x5b8bed[_0xa83e('0xea')]>=_0x57b450[_0xa83e('0xed')]-0x1){return!![];}hopperUtils[_0xa83e('0xee')]({'active':![],'countabandonedretry':_0x5b8bed[_0xa83e('0xea')]+=0x1,'scheduledat':moment()['add'](_0x57b450['dialAbandonedRetryFrequency'],_0xa83e('0xe0'))[_0xa83e('0x48')](_0xa83e('0xc5')),'ContactId':_0x5b8bed[_0xa83e('0x100')],'ListId':_0x5b8bed['ListId'],'VoiceQueueId':_0x5b8bed[_0xa83e('0xe2')]||undefined,'CampaignId':_0x5b8bed[_0xa83e('0xe3')]||undefined})['catch'](loggerCatch(_0xa83e('0xf0')));break;case 0x13:if(_0x5b8bed['countmachineretry']>=_0x57b450[_0xa83e('0x126')]-0x1){return!![];}hopperUtils[_0xa83e('0xee')]({'active':![],'countmachineretry':_0x5b8bed[_0xa83e('0x11d')]+=0x1,'scheduledat':moment()['add'](_0x57b450[_0xa83e('0x128')],_0xa83e('0xe0'))[_0xa83e('0x48')](_0xa83e('0xc5')),'ContactId':_0x5b8bed['ContactId'],'ListId':_0x5b8bed['ListId'],'VoiceQueueId':_0x5b8bed[_0xa83e('0xe2')]||undefined,'CampaignId':_0x5b8bed['CampaignId']||undefined})[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x129')));break;case 0x14:if(_0x5b8bed[_0xa83e('0x124')]>=_0x57b450[_0xa83e('0x19f')]-0x1){return!![];}hopperUtils[_0xa83e('0xee')]({'active':![],'countagentrejectretry':_0x5b8bed['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xa83e('0xef')](_0x57b450['dialAgentRejectRetryFrequency'],_0xa83e('0xe0'))[_0xa83e('0x48')](_0xa83e('0xc5')),'ContactId':_0x5b8bed[_0xa83e('0x100')],'ListId':_0x5b8bed[_0xa83e('0xe1')],'VoiceQueueId':_0x5b8bed[_0xa83e('0xe2')]||undefined,'CampaignId':_0x5b8bed[_0xa83e('0xe3')]||undefined})[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x1a0')));break;default:return!![];}};Dialer[_0xa83e('0x1a')][_0xa83e('0x10e')]=function(_0x1fecb8,_0x2efe5a,_0x49d98c){var _0x233f0e=this;var _0x9cfa77=new History(_0x1fecb8);var _0x4ee100=![];var _0x45195f;var _0x26ae8a;return new Promise(function(_0x1c379a,_0x25b639){if(_[_0xa83e('0x58')](_0x2efe5a)&&typeof _0x2efe5a!==_0xa83e('0x1a1')){return _0x25b639(msgResponse('[callProgressDetecting]','Failure','entity\x20is\x20undefine'));}if(_[_0xa83e('0x58')](_0x49d98c)&&typeof _0x49d98c!==_0xa83e('0x1a1')){return _0x25b639(msgResponse(_0xa83e('0x1a2'),'Failure',_0xa83e('0x1a3')));}hopperUtils[_0xa83e('0xdb')](_0x9cfa77,_0x49d98c['reason'],_0x2efe5a)[_0xa83e('0x43')](function(_0x2ef139){if(_0x2ef139[_0xa83e('0x1a4')]==0x1)_0x4ee100=!![];switch(_0x49d98c[_0xa83e('0xc8')]){case'0':_0x2efe5a[_0xa83e('0x1a5')]+=0x1;_0x9cfa77[_0xa83e('0xdc')]=0x0;_0x9cfa77['statedesc']='NoSuchNumber';_0x9cfa77[_0xa83e('0x123')]+=0x1;_0x9cfa77[_0xa83e('0xd9')]+=0x1;ami[_0xa83e('0x117')](_0xa83e('0x1a6'),ut['buildObj'](_0x1fecb8,_0xa83e('0x1a7')));_0x45195f=_0x2efe5a[_0xa83e('0x19d')];_0x26ae8a=_0x2efe5a['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x9cfa77)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x12e')));if(_0x233f0e[_0xa83e('0x194')](0x0,_0x1fecb8,_0x2efe5a)&&!_0x4ee100){if(_0x9cfa77['countnosuchnumberretry']>=_0x2efe5a[_0xa83e('0x19c')]){_0x233f0e[_0xa83e('0x130')](_0x9cfa77,_0x1c379a,_0x25b639,_0xa83e('0x1a8'));}else{_0x233f0e[_0xa83e('0x1a9')](_0x9cfa77,_0x1c379a,_0x25b639,_0xa83e('0x1a8'));}}break;case'3':_0x2efe5a['outboundNoAnswerCallsDay']+=0x1;_0x9cfa77[_0xa83e('0xdc')]=0x3;_0x9cfa77[_0xa83e('0xd4')]=_0xa83e('0x1aa');_0x9cfa77[_0xa83e('0x122')]+=0x1;_0x9cfa77[_0xa83e('0xd9')]+=0x1;var _0x355b57=ut['buildNoAnswerEventPayload'](_0x1fecb8,_0x2efe5a);ami[_0xa83e('0x117')](_0xa83e('0x1ab'),_0x355b57);_0x45195f=_0x2efe5a[_0xa83e('0x196')];_0x26ae8a=_0x2efe5a[_0xa83e('0xec')];hopperUtils[_0xa83e('0xcd')](_0x9cfa77)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x1ac')));if(_0x233f0e[_0xa83e('0x194')](0x3,_0x1fecb8,_0x2efe5a)&&!_0x4ee100){if(_0x9cfa77[_0xa83e('0x122')]>=_0x2efe5a['dialNoAnswerMaxRetry']){_0x233f0e[_0xa83e('0x130')](_0x9cfa77,_0x1c379a,_0x25b639,_0xa83e('0x1ad'));}else{_0x233f0e[_0xa83e('0x1a9')](_0x9cfa77,_0x1c379a,_0x25b639,_0xa83e('0x1ad'));}}break;case'5':_0x2efe5a[_0xa83e('0x1ae')]+=0x1;_0x9cfa77[_0xa83e('0xdc')]=0x5;_0x9cfa77[_0xa83e('0xd4')]='Busy';_0x9cfa77[_0xa83e('0x120')]+=0x1;_0x9cfa77[_0xa83e('0xd9')]+=0x1;ami[_0xa83e('0x117')](_0xa83e('0x1af'),ut[_0xa83e('0x11f')](_0x1fecb8,_0xa83e('0x1b0')));_0x45195f=_0x2efe5a[_0xa83e('0x197')];_0x26ae8a=_0x2efe5a[_0xa83e('0xec')];hopperUtils[_0xa83e('0xcd')](_0x9cfa77)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x1b1')));if(_0x233f0e[_0xa83e('0x194')](0x5,_0x1fecb8,_0x2efe5a)&&!_0x4ee100){if(_0x9cfa77['countbusyretry']>=_0x2efe5a[_0xa83e('0x1b2')]){_0x233f0e[_0xa83e('0x130')](_0x9cfa77,_0x1c379a,_0x25b639,'reason\x205\x20busy');}else{_0x233f0e[_0xa83e('0x1a9')](_0x9cfa77,_0x1c379a,_0x25b639,'reason\x205\x20busy');}}break;case'8':_0x2efe5a['outboundCongestionCallsDay']+=0x1;_0x9cfa77[_0xa83e('0xdc')]=0x8;_0x9cfa77[_0xa83e('0xd4')]='Congestion';_0x9cfa77['countcongestionretry']+=0x1;_0x9cfa77['countglobal']+=0x1;_0x45195f=_0x2efe5a[_0xa83e('0x19a')];_0x26ae8a=_0x2efe5a[_0xa83e('0xec')];ami[_0xa83e('0x117')](_0xa83e('0x1b3'),ut[_0xa83e('0x11f')](_0x1fecb8,_0xa83e('0x1b4')));hopperUtils[_0xa83e('0xcd')](_0x9cfa77)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x1b5')));if(_0x233f0e[_0xa83e('0x194')](0x8,_0x1fecb8,_0x2efe5a)&&!_0x4ee100){if(_0x9cfa77[_0xa83e('0x121')]>=_0x2efe5a[_0xa83e('0x199')]){_0x233f0e[_0xa83e('0x130')](_0x9cfa77,_0x1c379a,_0x25b639,_0xa83e('0x1b6'));}else{_0x233f0e[_0xa83e('0x1a9')](_0x9cfa77,_0x1c379a,_0x25b639,_0xa83e('0x1b6'));}}break;case'11':_0x2efe5a['outboundAbandonedCallsDay']+=0x1;_0x9cfa77['state']=0xb;_0x9cfa77[_0xa83e('0xd4')]=_0xa83e('0xf1');_0x9cfa77[_0xa83e('0xea')]+=0x1;_0x9cfa77[_0xa83e('0xd9')]+=0x1;_0x45195f=_0x2efe5a[_0xa83e('0xeb')];_0x26ae8a=_0x2efe5a['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x9cfa77)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x1b7')));if(_0x233f0e[_0xa83e('0x194')](0xb,_0x1fecb8,_0x2efe5a)&&!_0x4ee100){if(_0x9cfa77[_0xa83e('0xea')]>=_0x2efe5a[_0xa83e('0xed')]){_0x233f0e[_0xa83e('0x130')](_0x9cfa77,_0x1c379a,_0x25b639,_0xa83e('0x1b8'));}else{_0x233f0e[_0xa83e('0x1a9')](_0x9cfa77,_0x1c379a,_0x25b639,_0xa83e('0x1b8'));}}break;case'20':_0x2efe5a[_0xa83e('0x1b9')]+=0x1;_0x9cfa77[_0xa83e('0xdc')]=0x14;_0x9cfa77[_0xa83e('0xd4')]=_0xa83e('0x1ba');_0x9cfa77[_0xa83e('0x124')]+=0x1;_0x9cfa77[_0xa83e('0xd9')]+=0x1;_0x45195f=_0x2efe5a[_0xa83e('0x1bb')];_0x26ae8a=_0x2efe5a[_0xa83e('0xec')];ami[_0xa83e('0x117')](_0xa83e('0x1bc'),ut['buildObj'](_0x1fecb8,_0xa83e('0x1bd')));hopperUtils[_0xa83e('0xcd')](_0x9cfa77)['catch'](loggerCatch(_0xa83e('0x1be')));if(_0x233f0e[_0xa83e('0x194')](0x14,_0x1fecb8,_0x2efe5a)&&!_0x4ee100){if(_0x9cfa77['countagentrejectretry']>=_0x2efe5a['dialAgentRejectMaxRetry']){_0x233f0e[_0xa83e('0x130')](_0x9cfa77,_0x1c379a,_0x25b639,_0xa83e('0x1bf'));}else{_0x233f0e[_0xa83e('0x1a9')](_0x9cfa77,_0x1c379a,_0x25b639,_0xa83e('0x1bf'));}}break;default:_0x2efe5a[_0xa83e('0x137')]+=0x1;_0x9cfa77['state']=0xc;_0x9cfa77[_0xa83e('0xd4')]=_0x49d98c[_0xa83e('0xc8')];_0x45195f=_0x2efe5a['dialAgentRejectRetryFrequency'];_0x26ae8a=_0x2efe5a[_0xa83e('0xec')];hopperUtils[_0xa83e('0xcd')](_0x9cfa77)[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x1c0')));if(_0x233f0e[_0xa83e('0x194')](_0x49d98c['reason'],_0x1fecb8,_0x2efe5a)&&!_0x4ee100){if(_0x9cfa77['countbusyretry']+_0x9cfa77['countcongestionretry']+_0x9cfa77['countnoanswerretry']+_0x9cfa77['countnosuchnumberretry']+_0x9cfa77[_0xa83e('0xd8')]+_0x9cfa77[_0xa83e('0xea')]+_0x9cfa77[_0xa83e('0x11d')]+_0x9cfa77['countagentrejectretry']>=_0x2efe5a[_0xa83e('0x125')]){_0x233f0e[_0xa83e('0x1a9')](_0x9cfa77,_0x1c379a,_0x25b639,_0x49d98c[_0xa83e('0xc8')]);}else{_0x233f0e[_0xa83e('0x130')](_0x9cfa77,_0x1c379a,_0x25b639,_0x49d98c[_0xa83e('0xc8')]);}}}})[_0xa83e('0x43')](function(){if(_0x4ee100){hopperUtils['swapAdditionalPhones'](_0x9cfa77,_0x45195f,_0x26ae8a)['then'](function(){return _0x1c379a(0x1);});}});});};Dialer['prototype'][_0xa83e('0x1a9')]=function(_0x36d064,_0x33f6df,_0x299238,_0x49a15d){var _0x4d7e6f=new Final(_0x36d064);_0x4d7e6f[_0xa83e('0xdc')]=0xf;_0x4d7e6f[_0xa83e('0xd4')]=_0xa83e('0x1c1');this[_0xa83e('0x130')](_0x4d7e6f,_0x33f6df,_0x299238,_0x49a15d);};Dialer[_0xa83e('0x1a')]['createStateFinal']=function(_0x133b2a,_0xfefe36,_0x16bb27,_0x2196f1){hopperUtils[_0xa83e('0x133')](_0x133b2a)[_0xa83e('0x43')](function(){return _0xfefe36(msgResponse(_0xa83e('0x1a2'),_0xa83e('0x1c2'),_0x2196f1));})[_0xa83e('0xa1')](function(){return _0x16bb27(msgResponse(_0xa83e('0x1c3'),_0xa83e('0x94'),_0xa83e('0x1c4')));});};Dialer[_0xa83e('0x1a')][_0xa83e('0xa')]=function(_0x273692){var _0x374f96=_0x273692[_0xa83e('0x1c5')]/0x64;var _0x5ad0ba=_0x273692[_0xa83e('0xd2')]/(_0x273692[_0xa83e('0xd2')]+_0x273692['outboundAnswerCallsDay']);var _0x4f7ebf=Math[_0xa83e('0x1c6')](_0x273692['predictiveIntervalAvailable']*(_0x273692[_0xa83e('0x1c7')]/0x64));var _0x1931ca=Math['round'](_0x273692[_0xa83e('0x1c8')]*(_0x273692[_0xa83e('0x1c9')]/0x64));var _0x5e44e0=_0x273692['available']+_0x273692['talking'];var _0x556edd=Math['floor'](_0x273692[_0xa83e('0x1ca')]*_0x273692['erlangAbandonmentRate']*_0x273692['predictiveIntervalHitRate']*_0x273692[_0xa83e('0x1cb')]);if(_[_0xa83e('0x58')](_0x273692[_0xa83e('0x2b')])){if(!_[_0xa83e('0x58')](_0x273692[_0xa83e('0x2a')])){_0x273692['startPredictive']=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x273692[_0xa83e('0x66')])){loggerPredictive[_0xa83e('0x68')](_0xa83e('0x1cc'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x273692[_0xa83e('0x66')]);_0x273692[_0xa83e('0x66')]=undefined;}_0x273692[_0xa83e('0x2b')]=moment()['format'](_0xa83e('0xc5'));loggerPredictive[_0xa83e('0x4b')](_0x273692[_0xa83e('0x64')],_0xa83e('0x1cd'),_0x273692['startProgressive']);this[_0xa83e('0xb5')](_0x273692,0x1);}else if(ifInterval(_0x273692[_0xa83e('0x1ce')],_0x273692['startProgressive'])){this[_0xa83e('0xb5')](_0x273692,0x1);loggerPredictiveCalls[_0xa83e('0x4b')](_0xa83e('0x1cf'),_0x273692[_0xa83e('0x2b')],_0x273692[_0xa83e('0x64')]);_0x273692['erlangCalls']=0x0;_0x273692[_0xa83e('0xd3')]=0x0;}else if(_0x374f96<_0x5ad0ba&&_0x273692[_0xa83e('0x1d0')]===_0xa83e('0x1d1')){clearPredictiveAttributes(_0x273692);loggerPredictive['info'](_0xa83e('0x1d2'),'Dropped\x20calls\x20day',_0x5ad0ba,'startProgressive',_0x273692['name']);}else if(_0x556edd<_0x273692[_0xa83e('0xd3')]&&_0x273692[_0xa83e('0x1d0')]===_0xa83e('0x1d1')){clearPredictiveAttributes(_0x273692);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x1d3'),'Max\x20Drop\x20',_0x556edd,_0xa83e('0x1d4'),_0x273692[_0xa83e('0xd3')],_0xa83e('0x2b'),_0x273692[_0xa83e('0x64')]);}else if(!ifInterval(_0x273692[_0xa83e('0x1ce')],_0x273692[_0xa83e('0x2b')])&&_[_0xa83e('0x58')](_0x273692[_0xa83e('0x2a')])&&!_[_0xa83e('0x58')](_0x273692[_0xa83e('0x2b')])){_0x273692['startPredictive']=moment()[_0xa83e('0x48')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x273692[_0xa83e('0x64')],_0xa83e('0x1d5'),_0x273692[_0xa83e('0x2a')]);hopperUtils[_0xa83e('0x1d6')](_0x273692[_0xa83e('0x1ce')])[_0xa83e('0x43')](this['getDataPredictive'](_0x273692))[_0xa83e('0x43')](mergeDataErlangB(_0x273692))[_0xa83e('0x43')](this[_0xa83e('0x1d7')](_0x273692))[_0xa83e('0xa1')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x273692));}else if(!ifInterval(_0x273692['dialPredictiveInterval'],_0x273692[_0xa83e('0x2a')])){_0x273692['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x273692['startPredictive']=moment()[_0xa83e('0x48')](_0xa83e('0xc5'));loggerPredictive['info'](_0x273692[_0xa83e('0x64')],_0xa83e('0x1d8'),_0x273692[_0xa83e('0x2a')]);clearInterval(_0x273692[_0xa83e('0x66')]);_0x273692['handlePredictive']=undefined;hopperUtils[_0xa83e('0x1d6')](_0x273692[_0xa83e('0x1ce')])['then'](this['getDataPredictive'](_0x273692))[_0xa83e('0x43')](mergeDataErlangB(_0x273692))[_0xa83e('0x43')](this[_0xa83e('0x1d7')](_0x273692))[_0xa83e('0xa1')](loggerCatchPredictive(_0xa83e('0x1d9'),_0x273692));}else if(_0x273692[_0xa83e('0x1c8')]&&_0x5e44e0<_0x273692[_0xa83e('0x1c8')]-_0x1931ca){clearPredictiveAttributes(_0x273692);loggerPredictive['info'](_0x273692['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5e44e0,')\x20are\x20less\x20than\x20threshold\x20(',_0x273692[_0xa83e('0x1c8')],'-',_0x1931ca,'=',_0x273692[_0xa83e('0x1c8')]-_0x1931ca,')');}else if(_0x273692[_0xa83e('0x1c8')]&&_0x5e44e0>_0x273692[_0xa83e('0x1c8')]+_0x4f7ebf){clearPredictiveAttributes(_0x273692);loggerPredictive[_0xa83e('0x4b')](_0x273692[_0xa83e('0x64')],_0xa83e('0x1da'),_0x5e44e0,_0xa83e('0x1db'),_0x273692[_0xa83e('0x1c8')],'+',_0x4f7ebf,'=',_0x273692[_0xa83e('0x1c8')]+_0x4f7ebf,')');}};Dialer['prototype'][_0xa83e('0x1dc')]=function(_0x7b0bef){var _0xef2b0=this;return function(_0xd001f8){return new Promise(function(_0x295d07,_0x79272e){_[_0xa83e('0x62')](_0x7b0bef,_0xd001f8[0x0]);if(checkGetDataPredictive(_0xd001f8[0x0])){var _0x29b010=_0x7b0bef[_0xa83e('0x1c8')]=_0x7b0bef[_0xa83e('0x1dd')]+_0x7b0bef[_0xa83e('0x1de')];var _0x302c45=_0x7b0bef[_0xa83e('0x1ce')]*0x3c;var _0x979b0e=_0xd001f8[0x0][_0xa83e('0x56')]+_0xd001f8[0x0]['predictiveIntervalAvgHoldtime'];var _0x11c416=(_0xd001f8[0x0][_0xa83e('0x1df')]+_0xd001f8[0x0][_0xa83e('0x51')]+_0xd001f8[0x0][_0xa83e('0x52')])/_0xd001f8[0x0][_0xa83e('0x4e')];_0x7b0bef[_0xa83e('0x1e0')]=_0x11c416>0x0?_0x11c416:0x1;switch(_0x7b0bef[_0xa83e('0x1d0')]){case _0xa83e('0x1d1'):var _0x52894e=_0x7b0bef[_0xa83e('0x1c5')]/0x64;return _0xef2b0['abandonmentRate'](_0x29b010,_0x302c45,_0x979b0e,_0x11c416,_0x52894e)[_0xa83e('0x43')](function(_0xe4d15d){return _0x295d07(_0xe4d15d);});case _0xa83e('0x1e1'):var _0x264acd=_0x7b0bef[_0xa83e('0x1c5')]/0x64;return _0xef2b0[_0xa83e('0x1e2')](_0x29b010,_0x302c45,_0x979b0e,_0x11c416,_0x264acd)[_0xa83e('0x43')](function(_0x412835){return _0x295d07(_0x412835);});default:return _0x79272e(msgResponse(_0xa83e('0x1e3'),_0xa83e('0x94'),_0xa83e('0x1e4')));}}else{return _0x79272e(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0xa83e('0x1a')][_0xa83e('0x1e5')]=function(_0x30b13e){var _0x29410b=this;return function(_0x52d114){return new Promise(function(_0x7c1e8a,_0x50707f){_[_0xa83e('0x62')](_0x30b13e,_0x52d114[0x0]);if(checkGetDataPredictive(_0x52d114[0x0])){loggerPredictive[_0xa83e('0x4b')](JSON[_0xa83e('0x76')](_0x52d114[0x0]));if(_0x30b13e[_0xa83e('0x1d0')]===_0xa83e('0x1d1')){return _0x29410b['getVoiceQueueRtPauses'](_0x30b13e['id'])[_0xa83e('0x43')](function(_0x34e653){var _0x10877c=_0x30b13e[_0xa83e('0x1e6')]-_0x34e653[0x0][_0xa83e('0x1e7')];var _0x3365b6=_0x30b13e[_0xa83e('0x1ce')]*0x3c;var _0x180152=_0x52d114[0x0]['predictiveIntervalAvgTalktime']+_0x52d114[0x0][_0xa83e('0x54')];var _0x558c35=(_0x52d114[0x0][_0xa83e('0x1df')]+_0x52d114[0x0][_0xa83e('0x51')]+_0x52d114[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x52d114[0x0]['predictiveIntervalTotalCalls'];var _0x3ffdbf=_0x30b13e[_0xa83e('0x1c5')]/0x64;_0x30b13e[_0xa83e('0x1e8')]=_0x34e653[0x0][_0xa83e('0x1e7')]||0x0;_0x30b13e[_0xa83e('0x1e0')]=_0x558c35>0x0?_0x558c35:0x1;return _0x29410b[_0xa83e('0x1e9')](_0x10877c,_0x3365b6,_0x180152,_0x558c35,_0x3ffdbf);})['then'](function(_0x12730){return _0x7c1e8a(_0x12730);})[_0xa83e('0xa1')](function(_0x57a566){return _0x50707f(msgResponse('[CatchErlangB]','Failure',JSON[_0xa83e('0x76')](_0x57a566)));});}if(_0x30b13e['dialPredictiveOptimization']==='agentBusyFactor'){return _0x29410b[_0xa83e('0x153')](_0x30b13e['id'])[_0xa83e('0x43')](function(_0x430e06){var _0x7a9d70=_0x30b13e[_0xa83e('0x1e6')]-_0x430e06[0x0][_0xa83e('0x1e7')];var _0x150648=_0x30b13e[_0xa83e('0x1ce')]*0x3c;var _0x14a887=_0x52d114[0x0][_0xa83e('0x56')]+_0x52d114[0x0][_0xa83e('0x54')];var _0x537677=(_0x52d114[0x0]['predictiveIntervalAnsweredCalls']+_0x52d114[0x0][_0xa83e('0x51')]+_0x52d114[0x0][_0xa83e('0x52')])/_0x52d114[0x0][_0xa83e('0x4e')];var _0x4e668b=_0x30b13e['dialPredictiveOptimizationPercentage']/0x64;_0x30b13e[_0xa83e('0x1e8')]=_0x430e06[0x0]['outboundQueuePauses']||0x0;_0x30b13e[_0xa83e('0x1e0')]=_0x537677>0x0?_0x537677:0x1;return _0x29410b['busyFactor'](_0x7a9d70,_0x150648,_0x14a887,_0x537677,_0x4e668b);})['then'](function(_0x4c3d83){return _0x7c1e8a(_0x4c3d83);})['catch'](function(_0x2a3850){return _0x50707f(msgResponse(_0xa83e('0x1ea'),_0xa83e('0x94'),JSON[_0xa83e('0x76')](_0x2a3850)));});}}else{return _0x50707f(msgResponse(_0xa83e('0x1e3'),_0xa83e('0x94'),_0xa83e('0x1eb')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x4a2de4){var _0x4f2a86=this;return function(){var _0x5c47c7=0x0;var _0x5671dd=Math[_0xa83e('0x1ec')](_0x4a2de4[_0xa83e('0x5e')]*0x3e8);if(_0x5671dd>0x0){_0x5671dd=_0x5671dd<0x64?0x64:_0x5671dd;loggerPredictive[_0xa83e('0x4b')](_0x4a2de4[_0xa83e('0x64')],_0xa83e('0x1ed'),_0x5671dd,_0xa83e('0x1ee'));_0x4a2de4[_0xa83e('0x66')]=setInterval(function(){_0x4f2a86[_0xa83e('0x66')](_0x4a2de4);loggerPredictiveCalls[_0xa83e('0x4b')](_0xa83e('0x1ef'),_0x5c47c7+=0x1);},_0x5671dd);}else{loggerPredictive['info'](_0x4a2de4[_0xa83e('0x64')],_0xa83e('0x1f0'));}};};Dialer[_0xa83e('0x1a')][_0xa83e('0x1f1')]=function(_0x3ec632,_0x4fdf48){var _0x201984=this;return function(_0x3a7b99){if(_[_0xa83e('0x4a')](_0x3a7b99)){if(_[_0xa83e('0xf7')](_0x4fdf48['UserId'])||!_0x4fdf48[_0xa83e('0x1f2')]){if(_0x3ec632[_0xa83e('0xb2')]==='booked'){_0x3ec632[_0xa83e('0x73')]=_['isUndefined'](_0x3ec632[_0xa83e('0x73')])?!![]:_0x3ec632['queueStatusComplete'];var _0x2eb012=uuid['v4']();_0x201984[_0xa83e('0x26')][_0x2eb012]=new Action(_0x3ec632,_0x4fdf48,_0x2eb012);loggerBooked[_0xa83e('0x4b')](_0xa83e('0x1f3'),_0x2eb012,'queueStatusComplete:\x20',JSON[_0xa83e('0x76')](_0x3ec632[_0xa83e('0x73')]),_0xa83e('0x1f4'),_0x3ec632['name']);if(_0x3ec632['queueStatusComplete']){_0x3ec632[_0xa83e('0x73')]=![];_0x201984[_0xa83e('0xfa')][_0x201984['actions'][_0x2eb012]['queue']]=[];ami[_0xa83e('0x9b')]({'actionid':_0x2eb012,'action':_0xa83e('0x1f5'),'queue':_0x3ec632['name']})[_0xa83e('0xa1')](function(){_0x201984[_0xa83e('0xc3')](_0x3ec632);hopperUtils[_0xa83e('0xee')]({'active':![],'ContactId':_0x201984[_0xa83e('0x26')][_0x2eb012][_0xa83e('0x100')],'ListId':_0x201984['actions'][_0x2eb012][_0xa83e('0xe1')],'VoiceQueueId':_0x201984[_0xa83e('0x26')][_0x2eb012]['VoiceQueueId']||undefined,'CampaignId':_0x201984[_0xa83e('0x26')][_0x2eb012]['CampaignId']||undefined})[_0xa83e('0xa1')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x201984[_0xa83e('0x26')][_0x2eb012];});}else{loggerBooked['info'](_0xa83e('0x1f6'),JSON['stringify'](_0x3ec632[_0xa83e('0x73')]),_0xa83e('0x1f4'),_0x3ec632['name']);_0x201984[_0xa83e('0xc3')](_0x3ec632);hopperUtils[_0xa83e('0xee')]({'active':![],'ContactId':_0x201984[_0xa83e('0x26')][_0x2eb012]['ContactId'],'ListId':_0x201984['actions'][_0x2eb012]['ListId'],'VoiceQueueId':_0x201984['actions'][_0x2eb012][_0xa83e('0xe2')]||undefined,'CampaignId':_0x201984[_0xa83e('0x26')][_0x2eb012][_0xa83e('0xe3')]||undefined})[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x1f7')));delete _0x201984['actions'][_0x2eb012];}}else{return _0x201984[_0xa83e('0x15e')](_0x3ec632,_0x4fdf48);}}else{if(utils['getSeconds'](undefined,_0x4fdf48[_0xa83e('0x1f8')])<_0x3ec632[_0xa83e('0x1f9')]*0x3c){if(_0x4fdf48[_0xa83e('0x14a')]&&!_0x4fdf48[_0xa83e('0x14a')]['voicePause']){_0x201984[_0xa83e('0x1f')]['run'](_0x4fdf48['id'])[_0xa83e('0x1d')](function(){_0x201984[_0xa83e('0xc3')](_0x3ec632);});}else{hopperUtils[_0xa83e('0x1fa')]({'active':![]},_0x4fdf48['id'],0x1)[_0xa83e('0x1d')](function(){_0x201984[_0xa83e('0xc3')](_0x3ec632);});}}else{_0x3ec632[_0xa83e('0x1fb')]+=0x1;_0x201984[_0xa83e('0xc3')](_0x3ec632);if(_0x3ec632[_0xa83e('0x1fc')]){hopperUtils[_0xa83e('0xee')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4fdf48[_0xa83e('0x100')],'ListId':_0x4fdf48['ListId'],'VoiceQueueId':_0x4fdf48[_0xa83e('0xe2')]||undefined,'CampaignId':_0x4fdf48[_0xa83e('0xe3')]||undefined})['catch'](loggerCatch(_0xa83e('0x1fd')));hopperUtils['createHistory'](createObjHistory(_0x3ec632,_0x4fdf48,utils[_0xa83e('0x6d')]['QUEUE_RECALL'],0x17,_0xa83e('0x1fe')))[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x1ff')));}else{_0x201984['saveInDb'](createObjHistory(_0x3ec632,_0x4fdf48,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,_0xa83e('0x200')),_0xa83e('0x201'),_0xa83e('0x202'));}}}}else{_0x3ec632[_0xa83e('0x203')]+=0x1;_0x201984['saveInDb'](createObjHistory(_0x3ec632,_0x4fdf48,utils['CAMPAIGN_STATUS'][_0xa83e('0x204')],0xd,'Blacklist'),_0xa83e('0x205'),_0xa83e('0x206'));throw _0xa83e('0x207');}};};Dialer['prototype'][_0xa83e('0x208')]=function(_0x340804){var _0xa2a1ef=this;var _0xe8c898=_0x340804[_0xa83e('0x209')]-_0x340804[_0xa83e('0x82')]-_0x340804[_0xa83e('0x20a')];emitCampaignSummary(_0x340804);if(_0xe8c898>0x0){if(_0xe8c898>this[_0xa83e('0x24')]){_0xe8c898=this['maxNumberOriginate'];}_0x340804[_0xa83e('0x20a')]+=_0xe8c898;hopperUtils[_0xa83e('0x20b')](_0x340804,_0xe8c898)[_0xa83e('0x43')](function(_0x50b0b8){_0x340804['temp']-=_0xe8c898;_0x340804[_0xa83e('0x20a')]=_0x340804[_0xa83e('0x20a')]>0x0?_0x340804[_0xa83e('0x20a')]:0x0;if(!utils[_0xa83e('0x20c')](_0x50b0b8)){_0x340804[_0xa83e('0x6c')]=utils[_0xa83e('0x6d')]['NO_AVAILABLE_CONTACTS'];logger[_0xa83e('0x4b')]('[getContactCampaign2][Empty]'+_0x340804[_0xa83e('0x64')]);}else{_0x340804[_0xa83e('0x82')]+=_0x50b0b8[_0xa83e('0x99')];_0x340804[_0xa83e('0x6c')]=utils[_0xa83e('0x6d')][_0xa83e('0x20d')];for(var _0x74dbc6=0x0;_0x74dbc6<_0x50b0b8[_0xa83e('0x99')];_0x74dbc6+=0x1){_0x340804['ivrTotalCallsDays']+=0x1;if(_[_0xa83e('0xf7')](_0x50b0b8[_0x74dbc6])||_[_0xa83e('0xf7')](_0x50b0b8[_0x74dbc6][_0xa83e('0x177')])||_['isNil'](_0x50b0b8[_0x74dbc6][_0xa83e('0x161')])){_0xa2a1ef[_0xa83e('0x158')](_0xa83e('0x20e'),_0x340804,_0x50b0b8[_0x74dbc6]);}else{hopperUtils[_0xa83e('0x20f')](_[_0xa83e('0xfb')](_0x50b0b8[_0x74dbc6],[_0xa83e('0xe3'),_0xa83e('0x161')]))[_0xa83e('0x43')](_0xa2a1ef[_0xa83e('0x1f1')](_0x340804,_0x50b0b8[_0x74dbc6]))[_0xa83e('0xa1')](_0xa2a1ef[_0xa83e('0x157')]('[actionOriginateIvr]\x20',_0x340804));}}}})['catch'](loggerGetContactDialer(_0xa83e('0x210'),_0x340804,_0xe8c898));}};Dialer[_0xa83e('0x1a')]['handlePower']=function(_0x41faa1,_0x3c1e01){var _0x30b2d6=this;var _0x14b39c=[];if(_0x3c1e01<0x1||_0x41faa1[_0xa83e('0xb2')]===_0xa83e('0x9')){_0x3c1e01=0x1;}var _0x2431de=Math['floor'](_0x41faa1[_0xa83e('0x1de')]*_0x3c1e01)-_0x41faa1[_0xa83e('0x82')]-_0x41faa1[_0xa83e('0x20a')];if(_0x41faa1['dialLimitQueue']>0x0){var _0x253fc5=_0x41faa1[_0xa83e('0x211')]-_0x41faa1[_0xa83e('0x82')]-_0x41faa1[_0xa83e('0x1dd')]-_0x41faa1['temp']-_0x41faa1['pTalking'];if(_0x2431de>_0x253fc5){_0x2431de=_0x253fc5;}}if(_0x2431de>0x0){if(_0x41faa1['dialMethod']===_0xa83e('0x9')){_0x2431de=0x1;}if(_0x2431de>this['maxNumberOriginate']){_0x2431de=this[_0xa83e('0x24')];}_0x41faa1['temp']+=_0x2431de;for(var _0x54ad52 in this['agents']){if(typeof this['agents'][_0x54ad52]!=='undefined'){if(this[_0xa83e('0x22')][_0x54ad52][_0xa83e('0xdc')]==='not_inuse'&&this[_0xa83e('0x22')][_0x54ad52][_0xa83e('0xfd')]===_0xa83e('0x8b')){_0x14b39c[_0xa83e('0x9a')](this['agents'][_0x54ad52]['id']);}}}hopperUtils['getContactDialer'](_0x41faa1,_0x14b39c,_0x2431de)[_0xa83e('0x43')](function(_0x3aa1f8){_0x41faa1[_0xa83e('0x20a')]-=_0x2431de;_0x41faa1[_0xa83e('0x20a')]=_0x41faa1[_0xa83e('0x20a')]>0x0?_0x41faa1['temp']:0x0;if(!utils[_0xa83e('0x20c')](_0x3aa1f8)){hopperUtils[_0xa83e('0x212')](_0x41faa1)['then'](sendMessageReschedule(_0x41faa1))[_0xa83e('0xa1')](loggerCatch('[countReScheduled]\x20'));}else{_0x41faa1[_0xa83e('0x82')]+=_0x3aa1f8[_0xa83e('0x99')];_0x41faa1[_0xa83e('0x6c')]=_0x41faa1[_0xa83e('0xb2')]==='booked'?utils[_0xa83e('0x6d')]['ACTIVE']:utils[_0xa83e('0x6d')]['RUNNING'];for(var _0x37e2d4=0x0;_0x37e2d4<_0x3aa1f8[_0xa83e('0x99')];_0x37e2d4+=0x1){if(_[_0xa83e('0xf7')](_0x3aa1f8[_0x37e2d4])||_['isNil'](_0x3aa1f8[_0x37e2d4][_0xa83e('0x177')])||_[_0xa83e('0xf7')](_0x3aa1f8[_0x37e2d4][_0xa83e('0x161')])){_0x30b2d6[_0xa83e('0x158')](_0xa83e('0x20e'),_0x41faa1,_0x3aa1f8[_0x37e2d4]);}else{hopperUtils[_0xa83e('0x213')](_[_0xa83e('0xfb')](_0x3aa1f8[_0x37e2d4],[_0xa83e('0xe2'),'phone']))[_0xa83e('0x43')](_0x30b2d6[_0xa83e('0x1f1')](_0x41faa1,_0x3aa1f8[_0x37e2d4]))['catch'](_0x30b2d6['loggerHandler'](_0xa83e('0x20e'),_0x41faa1));}}}})['catch'](loggerGetContactDialer(_0xa83e('0x214'),_0x41faa1,_0x2431de));}};Dialer[_0xa83e('0x1a')][_0xa83e('0x66')]=function(_0x288918){if(_0x288918['dialLimitQueue']>0x0){var _0x44da92=_0x288918[_0xa83e('0x211')]-_0x288918[_0xa83e('0x82')]-_0x288918[_0xa83e('0x1dd')];if(_0x44da92>0x0){this[_0xa83e('0x215')](_0x288918);}else{loggerPredictiveCalls[_0xa83e('0x4b')]('[handlePredictive][limitChannel]');}}else{this[_0xa83e('0x215')](_0x288918);}};Dialer['prototype'][_0xa83e('0x215')]=function(_0x3d1ebd){var _0x4dd2b4=this;var _0x56a99d=[];_0x3d1ebd[_0xa83e('0x82')]+=0x1;for(var _0x4b30f7 in this[_0xa83e('0x22')]){if(typeof this[_0xa83e('0x22')][_0x4b30f7]!==_0xa83e('0xac')){if(this[_0xa83e('0x22')][_0x4b30f7][_0xa83e('0xdc')]===_0xa83e('0x216')&&this[_0xa83e('0x22')][_0x4b30f7]['status']===_0xa83e('0x8b')){_0x56a99d[_0xa83e('0x9a')](this['agents'][_0x4b30f7]['id']);}}}return this[_0xa83e('0x217')](_0x3d1ebd['id'],_0x56a99d,0x1,_0x3d1ebd[_0xa83e('0x218')],_0x3d1ebd)[_0xa83e('0x43')](function(_0x3dd002){if(!utils[_0xa83e('0x20c')](_0x3dd002)){utils[_0xa83e('0x6a')](_0x3d1ebd,0x1,0x0);return hopperUtils[_0xa83e('0x212')](_0x3d1ebd)[_0xa83e('0x43')](sendMessageReschedule(_0x3d1ebd))[_0xa83e('0xa1')](loggerCatch(_0xa83e('0x219')));}else{_0x3d1ebd[_0xa83e('0x6c')]=utils['CAMPAIGN_STATUS']['RUNNING'];if(_[_0xa83e('0xf7')](_0x3dd002[0x0])||_[_0xa83e('0xf7')](_0x3dd002[0x0][_0xa83e('0x177')])||_[_0xa83e('0xf7')](_0x3dd002[0x0][_0xa83e('0x161')])){_0x4dd2b4[_0xa83e('0x158')](_0xa83e('0x20e'),_0x3d1ebd,_0x3dd002[0x0]);}else{return hopperUtils[_0xa83e('0x213')](_[_0xa83e('0xfb')](_0x3dd002[0x0],[_0xa83e('0xe2'),_0xa83e('0x161')]))['then'](_0x4dd2b4[_0xa83e('0x1f1')](_0x3d1ebd,_0x3dd002[0x0]))[_0xa83e('0xa1')](_0x4dd2b4[_0xa83e('0x157')](_0xa83e('0x21a'),_0x3d1ebd));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x3d1ebd,0x1));};Dialer['prototype'][_0xa83e('0x1e9')]=function(_0x11fae8,_0x24659e,_0x23881a,_0x4ecdcb,_0xd14a43,_0x3cc2f5){loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x21b'));loggerPredictive[_0xa83e('0x4b')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x11fae8);loggerPredictive['info'](_0xa83e('0x21c'),_0x24659e);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x21d'),_0x23881a);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x21e'),_0x4ecdcb);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x21f'),_0xd14a43);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x57'));return new Promise(function(_0xc118ae,_0x6a7508){if(_0x11fae8<=0x0||isNaN(_0x11fae8)){return _0x6a7508(msgResponse('[abandonmentRate]',_0xa83e('0x87'),_0xa83e('0x220')+_0x11fae8));}if(_0x23881a<=0x0||isNaN(_0x23881a)){return _0x6a7508(msgResponse(_0xa83e('0x221'),_0xa83e('0x87'),_0xa83e('0x222')+_0x23881a));}if(_0x4ecdcb<=0x0||isNaN(_0x4ecdcb)){return _0x6a7508(msgResponse(_0xa83e('0x221'),_0xa83e('0x87'),_0xa83e('0x223')+_0x4ecdcb));}if(_0x24659e<=0x0||isNaN(_0x24659e)){return _0x6a7508(msgResponse('[abandonmentRate]',_0xa83e('0x87'),_0xa83e('0x224')+_0x24659e));}if(_0xd14a43<=0x0||isNaN(_0xd14a43)){return _0x6a7508(msgResponse(_0xa83e('0x221'),_0xa83e('0x87'),_0xa83e('0x225')+_0xd14a43));}_0x3cc2f5=_0x3cc2f5||0x0;var _0x1e83be=0x1/_0x23881a;var _0x586362=0x0;var _0xb06748=0x0;var _0x4e65df=0x0;var _0x2d25b5=0x0;for(var _0x2093ff=0x0;_0x4e65df<_0xd14a43;_0x2093ff+=0x1){_0xb06748=_0x2093ff/_0x24659e;_0x586362=(_0x4ecdcb*_0xb06748+_0x3cc2f5)/_0x1e83be;_0x4e65df=utils['erlangb'](_0x586362,_0x11fae8);_0x2d25b5=_0x586362/_0x11fae8*(0x1-utils['erlangb'](_0x586362,_0x11fae8));}return _0xc118ae({'erlangCalls':_0x2093ff,'erlangCallToSecond':_0x24659e/_0x2093ff,'erlangAbandonmentRate':_0x4e65df,'erlangBusyFactor':_0x2d25b5});});};Dialer[_0xa83e('0x1a')]['busyFactor']=function(_0xc95a72,_0x1e4d1a,_0x8e0b02,_0x53342c,_0x2a1bac,_0x3f0463){loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x226'));loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x227'),_0xc95a72);loggerPredictive[_0xa83e('0x4b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e4d1a);loggerPredictive['info'](_0xa83e('0x21d'),_0x8e0b02);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x21e'),_0x53342c);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x228'),_0x2a1bac);loggerPredictive[_0xa83e('0x4b')](_0xa83e('0x57'));return new Promise(function(_0x1e8a34,_0x156f69){if(_0xc95a72<=0x0||isNaN(_0xc95a72)){return _0x156f69(msgResponse('[busyFactor]',_0xa83e('0x87'),_0xa83e('0x220')+_0xc95a72));}if(_0x8e0b02<=0x0||isNaN(_0x8e0b02)){return _0x156f69(msgResponse(_0xa83e('0x229'),_0xa83e('0x87'),_0xa83e('0x222')+_0x8e0b02));}if(_0x53342c<=0x0||isNaN(_0x53342c)){return _0x156f69(msgResponse(_0xa83e('0x229'),'Error','p\x20=\x20'+_0x53342c));}if(_0x1e4d1a<=0x0||isNaN(_0x1e4d1a)){return _0x156f69(msgResponse('[busyFactor]',_0xa83e('0x87'),_0xa83e('0x224')+_0x1e4d1a));}if(_0x2a1bac<=0x0||isNaN(_0x2a1bac)){return _0x156f69(msgResponse('[busyFactor]',_0xa83e('0x87'),_0xa83e('0x22a')+_0x2a1bac));}_0x3f0463=_0x3f0463||0x0;var _0x179a8b=0x1/_0x8e0b02;var _0x33d579=0x0;var _0x47adb6=0x0;var _0x5bad1c=0x0;var _0x495706=0x0;for(var _0x1409c9=0x0;_0x495706<_0x2a1bac;_0x1409c9+=0x1){_0x47adb6=_0x1409c9/_0x1e4d1a;_0x33d579=(_0x53342c*_0x47adb6+_0x3f0463)/_0x179a8b;_0x5bad1c=utils[_0xa83e('0x22b')](_0x33d579,_0xc95a72);_0x495706=_0x33d579/_0xc95a72*(0x1-utils[_0xa83e('0x22b')](_0x33d579,_0xc95a72));}return _0x1e8a34({'erlangCalls':_0x1409c9,'erlangCallToSecond':_0x1e4d1a/_0x1409c9,'erlangAbandonmentRate':_0x5bad1c,'erlangBusyFactor':_0x495706});});};module[_0xa83e('0x22c')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index c55f132..712b765 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38bb=['voiceQueue','uniqueid','name','Contact','number','phone','active','type','dialQueueTimeout','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','queue','exports','util','lodash','moment','isNil','string'];(function(_0x355a25,_0x9a3942){var _0x13f8df=function(_0x144aaa){while(--_0x144aaa){_0x355a25['push'](_0x355a25['shift']());}};_0x13f8df(++_0x9a3942);}(_0x38bb,0x1df));var _0xb38b=function(_0x58b639,_0x37941a){_0x58b639=_0x58b639-0x0;var _0x845316=_0x38bb[_0x58b639];return _0x845316;};'use strict';var util=require(_0xb38b('0x0'));var _=require(_0xb38b('0x1'));var moment=require(_0xb38b('0x2'));function checkNameSurname(_0x3d6c25,_0x49eee6,_0x55564e){var _0xf39afd='';if(!_[_0xb38b('0x3')](_0x49eee6)&&_0xb38b('0x4')===typeof _0x49eee6){_0xf39afd+=_0x49eee6;}if(!_['isNil'](_0x55564e)&&_0xb38b('0x4')===typeof _0x55564e){_0xf39afd+='\x20'+_0x55564e;}if(_0xf39afd!==''){return _0xf39afd;}return _0x3d6c25;}function Action(_0x2ad0b3,_0x283932,_0x4bb18f){this[_0xb38b('0x5')]=_0x2ad0b3;this[_0xb38b('0x6')]=_0x4bb18f||undefined;this[_0xb38b('0x7')]=checkNameSurname(_0x283932[_0xb38b('0x8')]['phone'],_0x283932[_0xb38b('0x8')]['firstName'],_0x283932[_0xb38b('0x8')]['lastName']);this[_0xb38b('0x9')]=_0x283932[_0xb38b('0xa')];this['queue']=_0x2ad0b3[_0xb38b('0x7')];this[_0xb38b('0xb')]=_0x283932[_0xb38b('0xb')]||![];this[_0xb38b('0xc')]=_0x2ad0b3[_0xb38b('0xc')];this[_0xb38b('0xd')]=_0x2ad0b3[_0xb38b('0xd')]||0x3;this['scheduledat']=_0x283932['scheduledat'];this['countbusyretry']=_0x283932['countbusyretry'];this[_0xb38b('0xe')]=_0x283932[_0xb38b('0xe')];this[_0xb38b('0xf')]=_0x283932[_0xb38b('0xf')];this[_0xb38b('0x10')]=_0x283932['countnosuchnumberretry'];this['countdropretry']=_0x283932[_0xb38b('0x11')];this[_0xb38b('0x12')]=_0x283932[_0xb38b('0x12')];this[_0xb38b('0x13')]=_0x283932[_0xb38b('0x13')];this[_0xb38b('0x14')]=_0x283932['countagentrejectretry'];this[_0xb38b('0x15')]=_0x283932['ContactId'];this[_0xb38b('0x16')]=_0x283932[_0xb38b('0x16')];this[_0xb38b('0x17')]=_0x283932['UserId'];this[_0xb38b('0x18')]=_0x283932[_0xb38b('0x18')];this[_0xb38b('0x19')]=_0x283932[_0xb38b('0x19')];this['idHopper']=_0x283932['id'];this[_0xb38b('0x1a')]=_0x283932[_0xb38b('0x8')][_0xb38b('0x1b')]||'';this[_0xb38b('0x1c')]=moment()[_0xb38b('0x1d')](_0xb38b('0x1e'));this[_0xb38b('0x1f')]=_0x283932[_0xb38b('0x1f')];this[_0xb38b('0x20')]=_0x283932[_0xb38b('0x20')];this['callbackat']=_0x283932[_0xb38b('0x21')];this[_0xb38b('0x22')]=_0x283932[_0xb38b('0x22')];this['originatecalleridnum']='';this[_0xb38b('0x23')]='';}Action[_0xb38b('0x24')][_0xb38b('0x25')]=function(){return util[_0xb38b('0x1d')](_0xb38b('0x26'),this[_0xb38b('0x7')],this[_0xb38b('0x5')][_0xb38b('0x27')]>0x0?this[_0xb38b('0x9')][_0xb38b('0x28')](this[_0xb38b('0x5')]['dialCutDigit']):this[_0xb38b('0x9')]);};Action[_0xb38b('0x24')][_0xb38b('0x29')]=function(){return this[_0xb38b('0x2a')];};module[_0xb38b('0x2b')]=Action; \ No newline at end of file +var _0xfde1=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','number','getQueue','moment','isNil','string','voiceQueue','uniqueid','Contact','phone','lastName','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x4a4505,_0x338e67){var _0x1a5c8c=function(_0x1e7acb){while(--_0x1e7acb){_0x4a4505['push'](_0x4a4505['shift']());}};_0x1a5c8c(++_0x338e67);}(_0xfde1,0x76));var _0x1fde=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfde1[_0x122ef9];return _0x42fba0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x1fde('0x0'));function checkNameSurname(_0x1762a8,_0x4bd4b7,_0x93c003){var _0x359774='';if(!_[_0x1fde('0x1')](_0x4bd4b7)&&_0x1fde('0x2')===typeof _0x4bd4b7){_0x359774+=_0x4bd4b7;}if(!_[_0x1fde('0x1')](_0x93c003)&&_0x1fde('0x2')===typeof _0x93c003){_0x359774+='\x20'+_0x93c003;}if(_0x359774!==''){return _0x359774;}return _0x1762a8;}function Action(_0x168458,_0x4da2a6,_0x58a302){this[_0x1fde('0x3')]=_0x168458;this[_0x1fde('0x4')]=_0x58a302||undefined;this['name']=checkNameSurname(_0x4da2a6[_0x1fde('0x5')][_0x1fde('0x6')],_0x4da2a6[_0x1fde('0x5')]['firstName'],_0x4da2a6[_0x1fde('0x5')][_0x1fde('0x7')]);this['number']=_0x4da2a6[_0x1fde('0x6')];this[_0x1fde('0x8')]=_0x168458[_0x1fde('0x9')];this[_0x1fde('0xa')]=_0x4da2a6['active']||![];this[_0x1fde('0xb')]=_0x168458[_0x1fde('0xb')];this[_0x1fde('0xc')]=_0x168458[_0x1fde('0xc')]||0x3;this[_0x1fde('0xd')]=_0x4da2a6[_0x1fde('0xd')];this[_0x1fde('0xe')]=_0x4da2a6[_0x1fde('0xe')];this[_0x1fde('0xf')]=_0x4da2a6[_0x1fde('0xf')];this[_0x1fde('0x10')]=_0x4da2a6[_0x1fde('0x10')];this['countnosuchnumberretry']=_0x4da2a6['countnosuchnumberretry'];this[_0x1fde('0x11')]=_0x4da2a6[_0x1fde('0x11')];this[_0x1fde('0x12')]=_0x4da2a6['countabandonedretry'];this[_0x1fde('0x13')]=_0x4da2a6['countmachineretry'];this[_0x1fde('0x14')]=_0x4da2a6['countagentrejectretry'];this['ContactId']=_0x4da2a6[_0x1fde('0x15')];this[_0x1fde('0x16')]=_0x4da2a6[_0x1fde('0x16')];this[_0x1fde('0x17')]=_0x4da2a6[_0x1fde('0x17')];this['VoiceQueueId']=_0x4da2a6[_0x1fde('0x18')];this[_0x1fde('0x19')]=_0x4da2a6[_0x1fde('0x19')];this[_0x1fde('0x1a')]=_0x4da2a6['id'];this[_0x1fde('0x1b')]=_0x4da2a6[_0x1fde('0x5')][_0x1fde('0x1c')]||'';this[_0x1fde('0x1d')]=moment()[_0x1fde('0x1e')](_0x1fde('0x1f'));this[_0x1fde('0x20')]=_0x4da2a6['callback'];this[_0x1fde('0x21')]=_0x4da2a6['callbackuniqueid'];this[_0x1fde('0x22')]=_0x4da2a6['callbackat'];this[_0x1fde('0x23')]=_0x4da2a6[_0x1fde('0x23')];this[_0x1fde('0x24')]='';this[_0x1fde('0x25')]='';}Action[_0x1fde('0x26')][_0x1fde('0x27')]=function(){return util['format'](_0x1fde('0x28'),this[_0x1fde('0x9')],this[_0x1fde('0x3')]['dialCutDigit']>0x0?this['number'][_0x1fde('0x29')](this[_0x1fde('0x3')][_0x1fde('0x2a')]):this[_0x1fde('0x2b')]);};Action[_0x1fde('0x26')][_0x1fde('0x2c')]=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 5714b6e..c7cd183 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8ab=['countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0xac3328,_0x23745a){var _0x33aec4=function(_0x476d1a){while(--_0x476d1a){_0xac3328['push'](_0xac3328['shift']());}};_0x33aec4(++_0x23745a);}(_0xd8ab,0x195));var _0xbd8a=function(_0x178c5e,_0x20c484){_0x178c5e=_0x178c5e-0x0;var _0x285e36=_0xd8ab[_0x178c5e];return _0x285e36;};'use strict';var moment=require(_0xbd8a('0x0'));var utils=require(_0xbd8a('0x1'));function AgentComplete(_0x1b660e,_0x36b2d0){this[_0xbd8a('0x2')]=0x4;this[_0xbd8a('0x3')]=_0xbd8a('0x4');this[_0xbd8a('0x5')]=_0x1b660e['scheduledat'];this['type']=_0x1b660e[_0xbd8a('0x6')];this[_0xbd8a('0x7')]=_0x1b660e[_0xbd8a('0x6')]===_0xbd8a('0x8')?_0xbd8a('0x9'):_0x1b660e[_0xbd8a('0x6')];this[_0xbd8a('0xa')]=_0x1b660e['countbusyretry'];this[_0xbd8a('0xb')]=_0x1b660e[_0xbd8a('0xb')];this['countnoanswerretry']=_0x1b660e['countnoanswerretry'];this[_0xbd8a('0xc')]=_0x1b660e[_0xbd8a('0xa')]+_0x1b660e[_0xbd8a('0xb')]+_0x1b660e[_0xbd8a('0xd')]+_0x1b660e[_0xbd8a('0xe')]+_0x1b660e[_0xbd8a('0xf')]+_0x1b660e[_0xbd8a('0x10')]+_0x1b660e[_0xbd8a('0x11')]+_0x1b660e[_0xbd8a('0x12')];this[_0xbd8a('0xe')]=_0x1b660e[_0xbd8a('0xe')];this[_0xbd8a('0xf')]=_0x1b660e[_0xbd8a('0xf')];this[_0xbd8a('0x10')]=_0x1b660e[_0xbd8a('0x10')];this[_0xbd8a('0x11')]=_0x1b660e[_0xbd8a('0x11')];this[_0xbd8a('0x12')]=_0x1b660e['countagentrejectretry'];this['uniqueid']=_0x36b2d0[_0xbd8a('0x13')];this[_0xbd8a('0x14')]=_0x1b660e[_0xbd8a('0x15')];this[_0xbd8a('0x16')]=_0x1b660e['number'];this[_0xbd8a('0x17')]=_0x1b660e[_0xbd8a('0x17')];this[_0xbd8a('0x18')]=_0x1b660e[_0xbd8a('0x18')];this[_0xbd8a('0x19')]=_0x1b660e[_0xbd8a('0x19')];this['endtime']=moment()['format'](_0xbd8a('0x1a'));this[_0xbd8a('0x1b')]=utils[_0xbd8a('0x1c')](_0x1b660e[_0xbd8a('0x18')],_0x1b660e['starttime']);this[_0xbd8a('0x1d')]=utils[_0xbd8a('0x1c')](_0x1b660e['answertime'],_0x1b660e[_0xbd8a('0x18')]);this[_0xbd8a('0x1e')]=utils[_0xbd8a('0x1c')](this[_0xbd8a('0x1f')],_0x1b660e['answertime']);this[_0xbd8a('0x9')]=_0x36b2d0['queue'];this['membername']=_0x36b2d0[_0xbd8a('0x20')];this[_0xbd8a('0x21')]=_0x36b2d0[_0xbd8a('0x21')];this['callback']=_0x1b660e[_0xbd8a('0x22')];this[_0xbd8a('0x23')]=_0x1b660e[_0xbd8a('0x23')];this[_0xbd8a('0x24')]=_0x1b660e[_0xbd8a('0x24')];this[_0xbd8a('0x25')]=_0x1b660e[_0xbd8a('0x25')];this['ContactId']=_0x1b660e[_0xbd8a('0x26')];this[_0xbd8a('0x27')]=_0x1b660e[_0xbd8a('0x27')];this[_0xbd8a('0x28')]=_0x1b660e[_0xbd8a('0x28')];this[_0xbd8a('0x29')]=_0x1b660e['VoiceQueueId'];this['CampaignId']=_0x1b660e[_0xbd8a('0x2a')];this[_0xbd8a('0x2b')]=_0x1b660e['originatecalleridnum']||'';this[_0xbd8a('0x2c')]=_0x1b660e[_0xbd8a('0x2c')]||'';this[_0xbd8a('0x2d')]=_0x1b660e[_0xbd8a('0x2d')];}module[_0xbd8a('0x2e')]=AgentComplete; \ No newline at end of file +var _0x6cff=['calleridnum','starttime','responsetime','answertime','endtime','format','ringtime','getSeconds','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','state','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name'];(function(_0x5e71ad,_0x1c7bc7){var _0x2e46d5=function(_0x2c15fd){while(--_0x2c15fd){_0x5e71ad['push'](_0x5e71ad['shift']());}};_0x2e46d5(++_0x1c7bc7);}(_0x6cff,0x1db));var _0xf6cf=function(_0x19c7a8,_0x10508d){_0x19c7a8=_0x19c7a8-0x0;var _0x1462ce=_0x6cff[_0x19c7a8];return _0x1462ce;};'use strict';var moment=require('moment');var utils=require('../utils');function AgentComplete(_0x48f6a2,_0x40e29a){this[_0xf6cf('0x0')]=0x4;this['statedesc']=_0xf6cf('0x1');this[_0xf6cf('0x2')]=_0x48f6a2[_0xf6cf('0x2')];this[_0xf6cf('0x3')]=_0x48f6a2[_0xf6cf('0x3')];this['campaigntype']=_0x48f6a2[_0xf6cf('0x3')]===_0xf6cf('0x4')?_0xf6cf('0x5'):_0x48f6a2['type'];this[_0xf6cf('0x6')]=_0x48f6a2[_0xf6cf('0x6')];this[_0xf6cf('0x7')]=_0x48f6a2[_0xf6cf('0x7')];this[_0xf6cf('0x8')]=_0x48f6a2[_0xf6cf('0x8')];this['countglobal']=_0x48f6a2[_0xf6cf('0x6')]+_0x48f6a2[_0xf6cf('0x7')]+_0x48f6a2[_0xf6cf('0x8')]+_0x48f6a2[_0xf6cf('0x9')]+_0x48f6a2[_0xf6cf('0xa')]+_0x48f6a2[_0xf6cf('0xb')]+_0x48f6a2['countmachineretry']+_0x48f6a2[_0xf6cf('0xc')];this[_0xf6cf('0x9')]=_0x48f6a2[_0xf6cf('0x9')];this[_0xf6cf('0xa')]=_0x48f6a2[_0xf6cf('0xa')];this[_0xf6cf('0xb')]=_0x48f6a2[_0xf6cf('0xb')];this[_0xf6cf('0xd')]=_0x48f6a2[_0xf6cf('0xd')];this['countagentrejectretry']=_0x48f6a2[_0xf6cf('0xc')];this[_0xf6cf('0xe')]=_0x40e29a[_0xf6cf('0xe')];this[_0xf6cf('0xf')]=_0x48f6a2[_0xf6cf('0x10')];this[_0xf6cf('0x11')]=_0x48f6a2['number'];this[_0xf6cf('0x12')]=_0x48f6a2[_0xf6cf('0x12')];this[_0xf6cf('0x13')]=_0x48f6a2['responsetime'];this[_0xf6cf('0x14')]=_0x48f6a2['answertime'];this[_0xf6cf('0x15')]=moment()[_0xf6cf('0x16')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf6cf('0x17')]=utils[_0xf6cf('0x18')](_0x48f6a2[_0xf6cf('0x13')],_0x48f6a2[_0xf6cf('0x12')]);this[_0xf6cf('0x19')]=utils[_0xf6cf('0x18')](_0x48f6a2['answertime'],_0x48f6a2['responsetime']);this['talktime']=utils[_0xf6cf('0x18')](this[_0xf6cf('0x15')],_0x48f6a2[_0xf6cf('0x14')]);this[_0xf6cf('0x5')]=_0x40e29a[_0xf6cf('0x5')];this[_0xf6cf('0x1a')]=_0x40e29a[_0xf6cf('0x1a')];this[_0xf6cf('0x1b')]=_0x40e29a[_0xf6cf('0x1b')];this[_0xf6cf('0x1c')]=_0x48f6a2[_0xf6cf('0x1c')];this[_0xf6cf('0x1d')]=_0x48f6a2[_0xf6cf('0x1d')];this[_0xf6cf('0x1e')]=_0x48f6a2[_0xf6cf('0x1e')];this['recallme']=_0x48f6a2[_0xf6cf('0x1f')];this[_0xf6cf('0x20')]=_0x48f6a2[_0xf6cf('0x20')];this[_0xf6cf('0x21')]=_0x48f6a2[_0xf6cf('0x21')];this[_0xf6cf('0x22')]=_0x48f6a2['UserId'];this[_0xf6cf('0x23')]=_0x48f6a2['VoiceQueueId'];this[_0xf6cf('0x24')]=_0x48f6a2[_0xf6cf('0x24')];this['originatecalleridnum']=_0x48f6a2[_0xf6cf('0x25')]||'';this[_0xf6cf('0x26')]=_0x48f6a2[_0xf6cf('0x26')]||'';this[_0xf6cf('0x27')]=_0x48f6a2[_0xf6cf('0x27')];}module[_0xf6cf('0x28')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 251dd1c..2064477 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x440d=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid'];(function(_0x6a1440,_0x2caba5){var _0x4b70a3=function(_0xf14e6b){while(--_0xf14e6b){_0x6a1440['push'](_0x6a1440['shift']());}};_0x4b70a3(++_0x2caba5);}(_0x440d,0x11b));var _0xd440=function(_0x4f1713,_0x4abfb7){_0x4f1713=_0x4f1713-0x0;var _0x4726f6=_0x440d[_0x4f1713];return _0x4726f6;};'use strict';function Final(_0x27068c){this['uniqueid']=_0x27068c[_0xd440('0x0')];this['scheduledat']=_0x27068c[_0xd440('0x1')];this[_0xd440('0x2')]=_0x27068c[_0xd440('0x2')];this[_0xd440('0x3')]=_0x27068c['type']===_0xd440('0x4')?'queue':_0x27068c['type'];this['countbusyretry']=_0x27068c[_0xd440('0x5')];this[_0xd440('0x6')]=_0x27068c['countcongestionretry'];this[_0xd440('0x7')]=_0x27068c[_0xd440('0x7')];this['countglobal']=_0x27068c[_0xd440('0x5')]+_0x27068c[_0xd440('0x6')]+_0x27068c[_0xd440('0x7')]+_0x27068c[_0xd440('0x8')]+_0x27068c['countdropretry']+_0x27068c['countabandonedretry']+_0x27068c[_0xd440('0x9')]+_0x27068c[_0xd440('0xa')];this[_0xd440('0x8')]=_0x27068c['countnosuchnumberretry'];this[_0xd440('0xb')]=_0x27068c[_0xd440('0xb')];this[_0xd440('0xc')]=_0x27068c[_0xd440('0xc')];this[_0xd440('0x9')]=_0x27068c['countmachineretry'];this['countagentrejectretry']=_0x27068c[_0xd440('0xa')];this['queue']=_0x27068c[_0xd440('0xd')];this['calleridname']=_0x27068c[_0xd440('0xe')];this[_0xd440('0xf')]=_0x27068c['calleridnum'];this[_0xd440('0x10')]=_0x27068c['starttime'];this[_0xd440('0x11')]=_0x27068c['responsetime'];this[_0xd440('0x12')]=_0x27068c[_0xd440('0x11')];this[_0xd440('0x13')]=_0x27068c[_0xd440('0x13')]||0x0;this['holdtime']=_0x27068c['holdtime']||0x0;this[_0xd440('0x14')]=_0x27068c[_0xd440('0x14')]||0x0;this[_0xd440('0x15')]=_0x27068c[_0xd440('0x15')];this[_0xd440('0x16')]=_0x27068c[_0xd440('0x16')];this[_0xd440('0x17')]=_0x27068c[_0xd440('0x17')];this[_0xd440('0x18')]=_0x27068c[_0xd440('0x18')];this[_0xd440('0x19')]=_0x27068c[_0xd440('0x19')];this['ListId']=_0x27068c[_0xd440('0x1a')];this[_0xd440('0x1b')]=_0x27068c['UserId'];this[_0xd440('0x1c')]=_0x27068c[_0xd440('0x1c')];this['CampaignId']=_0x27068c[_0xd440('0x1d')];this['originatecalleridnum']=_0x27068c[_0xd440('0x1e')]||'';this['originatecalleridname']=_0x27068c[_0xd440('0x1f')]||'';this[_0xd440('0x20')]=_0x27068c[_0xd440('0x20')];this[_0xd440('0x21')]=_0x27068c[_0xd440('0x21')];}module['exports']=Final; \ No newline at end of file +var _0x4051=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry'];(function(_0x3ce301,_0x858468){var _0x323499=function(_0x789e5b){while(--_0x789e5b){_0x3ce301['push'](_0x3ce301['shift']());}};_0x323499(++_0x858468);}(_0x4051,0x82));var _0x1405=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x4051[_0x565c49];return _0x20ca34;};'use strict';function Final(_0x2efd34){this[_0x1405('0x0')]=_0x2efd34[_0x1405('0x0')];this[_0x1405('0x1')]=_0x2efd34[_0x1405('0x1')];this[_0x1405('0x2')]=_0x2efd34[_0x1405('0x2')];this[_0x1405('0x3')]=_0x2efd34[_0x1405('0x2')]==='outbound'?'queue':_0x2efd34[_0x1405('0x2')];this[_0x1405('0x4')]=_0x2efd34[_0x1405('0x4')];this[_0x1405('0x5')]=_0x2efd34[_0x1405('0x5')];this[_0x1405('0x6')]=_0x2efd34[_0x1405('0x6')];this[_0x1405('0x7')]=_0x2efd34['countbusyretry']+_0x2efd34[_0x1405('0x5')]+_0x2efd34[_0x1405('0x6')]+_0x2efd34[_0x1405('0x8')]+_0x2efd34[_0x1405('0x9')]+_0x2efd34[_0x1405('0xa')]+_0x2efd34['countmachineretry']+_0x2efd34[_0x1405('0xb')];this[_0x1405('0x8')]=_0x2efd34[_0x1405('0x8')];this['countdropretry']=_0x2efd34['countdropretry'];this['countabandonedretry']=_0x2efd34['countabandonedretry'];this[_0x1405('0xc')]=_0x2efd34[_0x1405('0xc')];this[_0x1405('0xb')]=_0x2efd34[_0x1405('0xb')];this[_0x1405('0xd')]=_0x2efd34['queue'];this[_0x1405('0xe')]=_0x2efd34[_0x1405('0xe')];this['calleridnum']=_0x2efd34[_0x1405('0xf')];this[_0x1405('0x10')]=_0x2efd34[_0x1405('0x10')];this[_0x1405('0x11')]=_0x2efd34['responsetime'];this[_0x1405('0x12')]=_0x2efd34[_0x1405('0x11')];this[_0x1405('0x13')]=_0x2efd34['ringtime']||0x0;this['holdtime']=_0x2efd34[_0x1405('0x14')]||0x0;this[_0x1405('0x15')]=_0x2efd34[_0x1405('0x15')]||0x0;this[_0x1405('0x16')]=_0x2efd34[_0x1405('0x16')];this['callbackuniqueid']=_0x2efd34['callbackuniqueid'];this[_0x1405('0x17')]=_0x2efd34[_0x1405('0x17')];this[_0x1405('0x18')]=_0x2efd34['recallme'];this[_0x1405('0x19')]=_0x2efd34[_0x1405('0x19')];this['ListId']=_0x2efd34[_0x1405('0x1a')];this['UserId']=_0x2efd34[_0x1405('0x1b')];this[_0x1405('0x1c')]=_0x2efd34[_0x1405('0x1c')];this['CampaignId']=_0x2efd34[_0x1405('0x1d')];this[_0x1405('0x1e')]=_0x2efd34[_0x1405('0x1e')]||'';this[_0x1405('0x1f')]=_0x2efd34[_0x1405('0x1f')]||'';this[_0x1405('0x20')]=_0x2efd34[_0x1405('0x20')];this[_0x1405('0x21')]=_0x2efd34['statedesc'];}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index e115271..964883b 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3b6=['getSeconds','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','format','ringtime'];(function(_0x3262de,_0x1186a8){var _0x44ef4d=function(_0x58a9f4){while(--_0x58a9f4){_0x3262de['push'](_0x3262de['shift']());}};_0x44ef4d(++_0x1186a8);}(_0xf3b6,0x156));var _0x6f3b=function(_0x403aa1,_0x335004){_0x403aa1=_0x403aa1-0x0;var _0x12d5ac=_0xf3b6[_0x403aa1];return _0x12d5ac;};'use strict';var moment=require(_0x6f3b('0x0'));var utils=require('../utils');function Hangup(_0x21188e,_0x15c3da){this[_0x6f3b('0x1')]=0x4;this[_0x6f3b('0x2')]=_0x6f3b('0x3');this['scheduledat']=_0x21188e[_0x6f3b('0x4')];this[_0x6f3b('0x5')]=_0x21188e[_0x6f3b('0x5')];this[_0x6f3b('0x6')]=_0x21188e[_0x6f3b('0x5')]===_0x6f3b('0x7')?_0x6f3b('0x8'):_0x21188e[_0x6f3b('0x5')];this[_0x6f3b('0x9')]=_0x21188e['amd']||![];this['countbusyretry']=_0x21188e['countbusyretry'];this[_0x6f3b('0xa')]=_0x21188e['countcongestionretry'];this['countnoanswerretry']=_0x21188e[_0x6f3b('0xb')];this[_0x6f3b('0xc')]=_0x21188e['countbusyretry']+_0x21188e[_0x6f3b('0xa')]+_0x21188e['countnoanswerretry']+_0x21188e[_0x6f3b('0xd')]+_0x21188e[_0x6f3b('0xe')]+_0x21188e[_0x6f3b('0xf')]+_0x21188e['countmachineretry']+_0x21188e[_0x6f3b('0x10')];this['countnosuchnumberretry']=_0x21188e[_0x6f3b('0xd')];this['countdropretry']=_0x21188e[_0x6f3b('0xe')];this[_0x6f3b('0xf')]=_0x21188e[_0x6f3b('0xf')];this[_0x6f3b('0x11')]=_0x21188e['countmachineretry'];this[_0x6f3b('0x10')]=_0x21188e['countagentrejectretry'];this['uniqueid']=_0x15c3da[_0x6f3b('0x12')];this[_0x6f3b('0x13')]=_0x21188e[_0x6f3b('0x14')];this['calleridnum']=_0x21188e[_0x6f3b('0x15')];this[_0x6f3b('0x16')]=_0x21188e[_0x6f3b('0x16')];this[_0x6f3b('0x17')]=_0x21188e[_0x6f3b('0x17')];this[_0x6f3b('0x18')]=moment()[_0x6f3b('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6f3b('0x1a')]=utils[_0x6f3b('0x1b')](_0x21188e[_0x6f3b('0x17')],_0x21188e[_0x6f3b('0x16')]);this['holdtime']=0x0;this['talktime']=utils[_0x6f3b('0x1b')](this['endtime'],_0x21188e[_0x6f3b('0x17')]);this['queue']=_0x21188e[_0x6f3b('0x8')];this[_0x6f3b('0x1c')]=_0x6f3b('0x1d');this['reason']=_0x15c3da[_0x6f3b('0x1e')];this['callback']=_0x21188e[_0x6f3b('0x1f')];this[_0x6f3b('0x20')]=_0x21188e['callbackuniqueid'];this[_0x6f3b('0x21')]=_0x21188e['callbackat'];this[_0x6f3b('0x22')]=_0x21188e[_0x6f3b('0x22')];this[_0x6f3b('0x23')]=_0x21188e[_0x6f3b('0x23')];this[_0x6f3b('0x24')]=_0x21188e[_0x6f3b('0x24')];this['UserId']=_0x21188e[_0x6f3b('0x25')];this[_0x6f3b('0x26')]=_0x21188e[_0x6f3b('0x26')];this[_0x6f3b('0x27')]=_0x21188e[_0x6f3b('0x27')];}module[_0x6f3b('0x28')]=Hangup; \ No newline at end of file +var _0xa049=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','number','starttime','responsetime','format','getSeconds','holdtime','talktime','endtime','membername','IVR','callback','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd'];(function(_0x2ff4bd,_0x4780a6){var _0x28edc6=function(_0x792380){while(--_0x792380){_0x2ff4bd['push'](_0x2ff4bd['shift']());}};_0x28edc6(++_0x4780a6);}(_0xa049,0x136));var _0x9a04=function(_0x153da6,_0xc9bfde){_0x153da6=_0x153da6-0x0;var _0xf01a0d=_0xa049[_0x153da6];return _0xf01a0d;};'use strict';var moment=require('moment');var utils=require(_0x9a04('0x0'));function Hangup(_0x3edd16,_0x371981){this[_0x9a04('0x1')]=0x4;this[_0x9a04('0x2')]=_0x9a04('0x3');this['scheduledat']=_0x3edd16[_0x9a04('0x4')];this[_0x9a04('0x5')]=_0x3edd16[_0x9a04('0x5')];this[_0x9a04('0x6')]=_0x3edd16[_0x9a04('0x5')]===_0x9a04('0x7')?_0x9a04('0x8'):_0x3edd16[_0x9a04('0x5')];this[_0x9a04('0x9')]=_0x3edd16[_0x9a04('0x9')]||![];this['countbusyretry']=_0x3edd16[_0x9a04('0xa')];this[_0x9a04('0xb')]=_0x3edd16[_0x9a04('0xb')];this[_0x9a04('0xc')]=_0x3edd16[_0x9a04('0xc')];this[_0x9a04('0xd')]=_0x3edd16[_0x9a04('0xa')]+_0x3edd16[_0x9a04('0xb')]+_0x3edd16[_0x9a04('0xc')]+_0x3edd16[_0x9a04('0xe')]+_0x3edd16[_0x9a04('0xf')]+_0x3edd16[_0x9a04('0x10')]+_0x3edd16['countmachineretry']+_0x3edd16[_0x9a04('0x11')];this[_0x9a04('0xe')]=_0x3edd16[_0x9a04('0xe')];this['countdropretry']=_0x3edd16[_0x9a04('0xf')];this[_0x9a04('0x10')]=_0x3edd16[_0x9a04('0x10')];this[_0x9a04('0x12')]=_0x3edd16[_0x9a04('0x12')];this['countagentrejectretry']=_0x3edd16[_0x9a04('0x11')];this[_0x9a04('0x13')]=_0x371981[_0x9a04('0x13')];this[_0x9a04('0x14')]=_0x3edd16[_0x9a04('0x15')];this['calleridnum']=_0x3edd16[_0x9a04('0x16')];this['starttime']=_0x3edd16[_0x9a04('0x17')];this['responsetime']=_0x3edd16[_0x9a04('0x18')];this['endtime']=moment()[_0x9a04('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=utils[_0x9a04('0x1a')](_0x3edd16[_0x9a04('0x18')],_0x3edd16[_0x9a04('0x17')]);this[_0x9a04('0x1b')]=0x0;this[_0x9a04('0x1c')]=utils['getSeconds'](this[_0x9a04('0x1d')],_0x3edd16[_0x9a04('0x18')]);this[_0x9a04('0x8')]=_0x3edd16[_0x9a04('0x8')];this[_0x9a04('0x1e')]=_0x9a04('0x1f');this['reason']=_0x371981['cause-txt'];this[_0x9a04('0x20')]=_0x3edd16[_0x9a04('0x20')];this['callbackuniqueid']=_0x3edd16['callbackuniqueid'];this['callbackat']=_0x3edd16['callbackat'];this['recallme']=_0x3edd16[_0x9a04('0x21')];this[_0x9a04('0x22')]=_0x3edd16['ContactId'];this[_0x9a04('0x23')]=_0x3edd16[_0x9a04('0x23')];this['UserId']=_0x3edd16[_0x9a04('0x24')];this[_0x9a04('0x25')]=_0x3edd16[_0x9a04('0x25')];this[_0x9a04('0x26')]=_0x3edd16[_0x9a04('0x26')];}module[_0x9a04('0x27')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 4cdfe09..40a37a2 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6079=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','talktime','callback'];(function(_0x13b93d,_0x424dcf){var _0x3aef3c=function(_0x5b1cf9){while(--_0x5b1cf9){_0x13b93d['push'](_0x13b93d['shift']());}};_0x3aef3c(++_0x424dcf);}(_0x6079,0x117));var _0x9607=function(_0x4d337e,_0x2f7eed){_0x4d337e=_0x4d337e-0x0;var _0x247963=_0x6079[_0x4d337e];return _0x247963;};'use strict';var utils=require(_0x9607('0x0'));function History(_0x19dac6){this[_0x9607('0x1')]=_0x19dac6[_0x9607('0x1')];this[_0x9607('0x2')]=_0x19dac6[_0x9607('0x2')]||undefined;this[_0x9607('0x3')]=_0x19dac6[_0x9607('0x3')];this['campaigntype']=_0x19dac6[_0x9607('0x3')]===_0x9607('0x4')?_0x9607('0x5'):_0x19dac6[_0x9607('0x3')];this[_0x9607('0x6')]=_0x19dac6[_0x9607('0x6')];this[_0x9607('0x7')]=_0x19dac6[_0x9607('0x7')];this[_0x9607('0x8')]=_0x19dac6[_0x9607('0x8')];this[_0x9607('0x9')]=_0x19dac6[_0x9607('0x6')]+_0x19dac6[_0x9607('0x7')]+_0x19dac6['countnoanswerretry']+_0x19dac6[_0x9607('0xa')]+_0x19dac6[_0x9607('0xb')]+_0x19dac6[_0x9607('0xc')]+_0x19dac6[_0x9607('0xd')]+_0x19dac6[_0x9607('0xe')];this[_0x9607('0xa')]=_0x19dac6['countnosuchnumberretry'];this[_0x9607('0xb')]=_0x19dac6[_0x9607('0xb')];this[_0x9607('0xc')]=_0x19dac6['countabandonedretry'];this[_0x9607('0xd')]=_0x19dac6[_0x9607('0xd')];this[_0x9607('0xe')]=_0x19dac6[_0x9607('0xe')];this[_0x9607('0x5')]=_0x19dac6[_0x9607('0x5')];this['calleridname']=_0x19dac6[_0x9607('0xf')];this[_0x9607('0x10')]=_0x19dac6[_0x9607('0x11')];this[_0x9607('0x12')]=_0x19dac6['starttime'];this['responsetime']=_0x19dac6[_0x9607('0x13')];this[_0x9607('0x14')]=_0x19dac6[_0x9607('0x13')];this[_0x9607('0x15')]=utils[_0x9607('0x16')](_0x19dac6['responsetime'],_0x19dac6['starttime']);this['holdtime']=0x0;this[_0x9607('0x17')]=0x0;this[_0x9607('0x18')]=_0x19dac6[_0x9607('0x18')];this[_0x9607('0x19')]=_0x19dac6[_0x9607('0x19')];this['callbackat']=_0x19dac6[_0x9607('0x1a')];this[_0x9607('0x1b')]=_0x19dac6[_0x9607('0x1b')];this[_0x9607('0x1c')]=_0x19dac6[_0x9607('0x1c')];this[_0x9607('0x1d')]=_0x19dac6[_0x9607('0x1d')];this[_0x9607('0x1e')]=_0x19dac6[_0x9607('0x1e')];this[_0x9607('0x1f')]=_0x19dac6[_0x9607('0x1f')];this['CampaignId']=_0x19dac6[_0x9607('0x20')];this[_0x9607('0x21')]=_0x19dac6[_0x9607('0x21')]||'';this['originatecalleridname']=_0x19dac6[_0x9607('0x22')]||'';this['state']=_0x19dac6[_0x9607('0x23')];this[_0x9607('0x24')]=_0x19dac6[_0x9607('0x24')];}module[_0x9607('0x25')]=History; \ No newline at end of file +var _0xbaa7=['name','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue'];(function(_0x1cb5db,_0x50064c){var _0x5a16c6=function(_0x2b843e){while(--_0x2b843e){_0x1cb5db['push'](_0x1cb5db['shift']());}};_0x5a16c6(++_0x50064c);}(_0xbaa7,0x16d));var _0x7baa=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xbaa7[_0x28947d];return _0x12d2ee;};'use strict';var utils=require(_0x7baa('0x0'));function History(_0x365b13){this[_0x7baa('0x1')]=_0x365b13[_0x7baa('0x1')];this[_0x7baa('0x2')]=_0x365b13[_0x7baa('0x2')]||undefined;this['type']=_0x365b13[_0x7baa('0x3')];this[_0x7baa('0x4')]=_0x365b13['type']==='outbound'?'queue':_0x365b13[_0x7baa('0x3')];this[_0x7baa('0x5')]=_0x365b13['countbusyretry'];this[_0x7baa('0x6')]=_0x365b13[_0x7baa('0x6')];this[_0x7baa('0x7')]=_0x365b13[_0x7baa('0x7')];this[_0x7baa('0x8')]=_0x365b13[_0x7baa('0x5')]+_0x365b13[_0x7baa('0x6')]+_0x365b13[_0x7baa('0x7')]+_0x365b13[_0x7baa('0x9')]+_0x365b13[_0x7baa('0xa')]+_0x365b13[_0x7baa('0xb')]+_0x365b13[_0x7baa('0xc')]+_0x365b13[_0x7baa('0xd')];this[_0x7baa('0x9')]=_0x365b13['countnosuchnumberretry'];this[_0x7baa('0xa')]=_0x365b13[_0x7baa('0xa')];this['countabandonedretry']=_0x365b13[_0x7baa('0xb')];this[_0x7baa('0xc')]=_0x365b13[_0x7baa('0xc')];this[_0x7baa('0xd')]=_0x365b13['countagentrejectretry'];this[_0x7baa('0xe')]=_0x365b13['queue'];this['calleridname']=_0x365b13[_0x7baa('0xf')];this[_0x7baa('0x10')]=_0x365b13[_0x7baa('0x11')];this[_0x7baa('0x12')]=_0x365b13[_0x7baa('0x12')];this[_0x7baa('0x13')]=_0x365b13[_0x7baa('0x13')];this[_0x7baa('0x14')]=_0x365b13[_0x7baa('0x13')];this[_0x7baa('0x15')]=utils[_0x7baa('0x16')](_0x365b13[_0x7baa('0x13')],_0x365b13[_0x7baa('0x12')]);this[_0x7baa('0x17')]=0x0;this['talktime']=0x0;this['callback']=_0x365b13[_0x7baa('0x18')];this[_0x7baa('0x19')]=_0x365b13[_0x7baa('0x19')];this[_0x7baa('0x1a')]=_0x365b13[_0x7baa('0x1a')];this[_0x7baa('0x1b')]=_0x365b13[_0x7baa('0x1b')];this[_0x7baa('0x1c')]=_0x365b13['ContactId'];this[_0x7baa('0x1d')]=_0x365b13[_0x7baa('0x1d')];this[_0x7baa('0x1e')]=_0x365b13[_0x7baa('0x1e')];this['VoiceQueueId']=_0x365b13[_0x7baa('0x1f')];this[_0x7baa('0x20')]=_0x365b13[_0x7baa('0x20')];this['originatecalleridnum']=_0x365b13[_0x7baa('0x21')]||'';this['originatecalleridname']=_0x365b13[_0x7baa('0x22')]||'';this[_0x7baa('0x23')]=_0x365b13[_0x7baa('0x23')];this[_0x7baa('0x24')]=_0x365b13['statedesc'];}module[_0x7baa('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 0266f9e..d0594dc 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea0d=['dropreason','endtime','ringtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime'];(function(_0x23301f,_0x1f5761){var _0x5b1eb1=function(_0x38764f){while(--_0x38764f){_0x23301f['push'](_0x23301f['shift']());}};_0x5b1eb1(++_0x1f5761);}(_0xea0d,0x166));var _0xdea0=function(_0x3cdcbe,_0x450f7b){_0x3cdcbe=_0x3cdcbe-0x0;var _0x5846a1=_0xea0d[_0x3cdcbe];return _0x5846a1;};'use strict';var utils=require(_0xdea0('0x0'));function QueueCallerAbandon(_0x5bc5c1,_0x4d71bd){this[_0xdea0('0x1')]=_0x5bc5c1['scheduledat'];this[_0xdea0('0x2')]=_0x5bc5c1[_0xdea0('0x2')];this['campaigntype']=_0x5bc5c1[_0xdea0('0x2')]===_0xdea0('0x3')?_0xdea0('0x4'):_0x5bc5c1['type'];this[_0xdea0('0x5')]=_0x5bc5c1[_0xdea0('0x5')];this['countcongestionretry']=_0x5bc5c1['countcongestionretry'];this[_0xdea0('0x6')]=_0x5bc5c1['countnoanswerretry'];this[_0xdea0('0x7')]=_0x5bc5c1[_0xdea0('0x5')]+_0x5bc5c1['countcongestionretry']+_0x5bc5c1[_0xdea0('0x6')]+_0x5bc5c1[_0xdea0('0x8')]+_0x5bc5c1[_0xdea0('0x9')]+_0x5bc5c1[_0xdea0('0xa')]+_0x5bc5c1['countmachineretry']+_0x5bc5c1[_0xdea0('0xb')];this[_0xdea0('0x8')]=_0x5bc5c1[_0xdea0('0x8')];this['countdropretry']=_0x5bc5c1[_0xdea0('0x9')];this['countabandonedretry']=_0x5bc5c1['countabandonedretry'];this[_0xdea0('0xc')]=_0x5bc5c1[_0xdea0('0xc')];this[_0xdea0('0xb')]=_0x5bc5c1[_0xdea0('0xb')];this['uniqueid']=_0x4d71bd[_0xdea0('0xd')];this[_0xdea0('0xe')]=_0x5bc5c1[_0xdea0('0xf')];this['calleridnum']=_0x5bc5c1[_0xdea0('0x10')];this['starttime']=_0x5bc5c1[_0xdea0('0x11')];this[_0xdea0('0x12')]=_0x5bc5c1['responsetime'];this[_0xdea0('0x13')]=_0x5bc5c1['droptime'];this[_0xdea0('0x14')]=_0x5bc5c1[_0xdea0('0x14')];this[_0xdea0('0x15')]=this['droptime'];this[_0xdea0('0x16')]=utils['getSeconds'](_0x5bc5c1[_0xdea0('0x12')],_0x5bc5c1[_0xdea0('0x11')]);this['holdtime']=utils['getSeconds'](this[_0xdea0('0x13')],_0x5bc5c1[_0xdea0('0x12')]);this[_0xdea0('0x17')]=0x0;this['queue']=_0x4d71bd[_0xdea0('0x4')];this[_0xdea0('0x18')]=_0x4d71bd[_0xdea0('0x19')];this[_0xdea0('0x1a')]=_0x4d71bd['reason'];this['callback']=_0x5bc5c1[_0xdea0('0x1b')];this[_0xdea0('0x1c')]=_0x5bc5c1[_0xdea0('0x1c')];this['callbackat']=_0x5bc5c1[_0xdea0('0x1d')];this[_0xdea0('0x1e')]=_0x5bc5c1[_0xdea0('0x1e')];this[_0xdea0('0x1f')]=_0x5bc5c1[_0xdea0('0x1f')];this[_0xdea0('0x20')]=_0x5bc5c1[_0xdea0('0x20')];this[_0xdea0('0x21')]=_0x5bc5c1[_0xdea0('0x21')];this[_0xdea0('0x22')]=_0x5bc5c1[_0xdea0('0x22')];this[_0xdea0('0x23')]=_0x5bc5c1['CampaignId'];this[_0xdea0('0x24')]=_0x5bc5c1[_0xdea0('0x24')]||'';this[_0xdea0('0x25')]=_0x5bc5c1[_0xdea0('0x25')]||'';this[_0xdea0('0x26')]=_0x5bc5c1[_0xdea0('0x26')];this[_0xdea0('0x27')]=_0x5bc5c1[_0xdea0('0x27')];this[_0xdea0('0x28')]=_0x5bc5c1[_0xdea0('0x28')];}module[_0xdea0('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0xec09=['countagentrejectretry','countdropretry','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry'];(function(_0x32ae06,_0xfca4f6){var _0x4a6898=function(_0x3a952a){while(--_0x3a952a){_0x32ae06['push'](_0x32ae06['shift']());}};_0x4a6898(++_0xfca4f6);}(_0xec09,0x1cf));var _0x9ec0=function(_0x2f33ed,_0x5c9be8){_0x2f33ed=_0x2f33ed-0x0;var _0x594bf2=_0xec09[_0x2f33ed];return _0x594bf2;};'use strict';var utils=require(_0x9ec0('0x0'));function QueueCallerAbandon(_0x184965,_0x1c844a){this[_0x9ec0('0x1')]=_0x184965['scheduledat'];this[_0x9ec0('0x2')]=_0x184965[_0x9ec0('0x2')];this['campaigntype']=_0x184965[_0x9ec0('0x2')]==='outbound'?'queue':_0x184965[_0x9ec0('0x2')];this[_0x9ec0('0x3')]=_0x184965['countbusyretry'];this['countcongestionretry']=_0x184965[_0x9ec0('0x4')];this[_0x9ec0('0x5')]=_0x184965[_0x9ec0('0x5')];this[_0x9ec0('0x6')]=_0x184965[_0x9ec0('0x3')]+_0x184965['countcongestionretry']+_0x184965[_0x9ec0('0x5')]+_0x184965[_0x9ec0('0x7')]+_0x184965['countdropretry']+_0x184965[_0x9ec0('0x8')]+_0x184965[_0x9ec0('0x9')]+_0x184965[_0x9ec0('0xa')];this['countnosuchnumberretry']=_0x184965['countnosuchnumberretry'];this[_0x9ec0('0xb')]=_0x184965[_0x9ec0('0xb')];this['countabandonedretry']=_0x184965['countabandonedretry'];this['countmachineretry']=_0x184965[_0x9ec0('0x9')];this[_0x9ec0('0xa')]=_0x184965[_0x9ec0('0xa')];this['uniqueid']=_0x1c844a['uniqueid'];this[_0x9ec0('0xc')]=_0x184965[_0x9ec0('0xd')];this[_0x9ec0('0xe')]=_0x184965[_0x9ec0('0xf')];this[_0x9ec0('0x10')]=_0x184965['starttime'];this[_0x9ec0('0x11')]=_0x184965['responsetime'];this[_0x9ec0('0x12')]=_0x184965[_0x9ec0('0x12')];this['dropreason']=_0x184965[_0x9ec0('0x13')];this[_0x9ec0('0x14')]=this[_0x9ec0('0x12')];this[_0x9ec0('0x15')]=utils[_0x9ec0('0x16')](_0x184965[_0x9ec0('0x11')],_0x184965[_0x9ec0('0x10')]);this[_0x9ec0('0x17')]=utils[_0x9ec0('0x16')](this[_0x9ec0('0x12')],_0x184965[_0x9ec0('0x11')]);this[_0x9ec0('0x18')]=0x0;this['queue']=_0x1c844a[_0x9ec0('0x19')];this[_0x9ec0('0x1a')]=_0x1c844a['connectedlinename'];this[_0x9ec0('0x1b')]=_0x1c844a[_0x9ec0('0x1b')];this[_0x9ec0('0x1c')]=_0x184965[_0x9ec0('0x1c')];this[_0x9ec0('0x1d')]=_0x184965[_0x9ec0('0x1d')];this[_0x9ec0('0x1e')]=_0x184965['callbackat'];this['recallme']=_0x184965[_0x9ec0('0x1f')];this[_0x9ec0('0x20')]=_0x184965[_0x9ec0('0x20')];this[_0x9ec0('0x21')]=_0x184965[_0x9ec0('0x21')];this[_0x9ec0('0x22')]=_0x184965[_0x9ec0('0x22')];this[_0x9ec0('0x23')]=_0x184965[_0x9ec0('0x23')];this[_0x9ec0('0x24')]=_0x184965[_0x9ec0('0x24')];this[_0x9ec0('0x25')]=_0x184965[_0x9ec0('0x25')]||'';this[_0x9ec0('0x26')]=_0x184965['originatecalleridname']||'';this[_0x9ec0('0x27')]=_0x184965[_0x9ec0('0x27')];this[_0x9ec0('0x28')]=_0x184965['state'];this[_0x9ec0('0x29')]=_0x184965['statedesc'];}module[_0x9ec0('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 3b00dd3..18b55b3 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','temp','getContactDialer','getContactDialerIvr','error','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopperBlack','inspect','dialOrderByScheduledAt'];(function(_0x35ecef,_0x399343){var _0x3061c9=function(_0x2825ef){while(--_0x2825ef){_0x35ecef['push'](_0x35ecef['shift']());}};_0x3061c9(++_0x399343);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var util=require(_0x0a9e('0x0'));var logger=require(_0x0a9e('0x1'))(_0x0a9e('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0a9e('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x333808){return util[_0x0a9e('0x4')](_0x333808,{'showHidden':![],'depth':null});}function getContactDialer(_0x2ab90b,_0x991246,_0x981158){return cmHopper['getContactDialer'](_0x2ab90b['id'],_0x991246,_0x981158,_0x2ab90b[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x2cc193){_0x2ab90b['temp']-=_0x981158;if(_0x2ab90b['temp']<0x0){_0x2ab90b[_0x0a9e('0x7')]=0x0;}logger['error']('[getContactDialer]',inspectError(_0x2cc193));});}exports[_0x0a9e('0x8')]=getContactDialer;function getContactDialerIvr(_0xf81284,_0x307b3e){return cmHopper[_0x0a9e('0x9')](_0xf81284['id'],_0x307b3e,_0xf81284[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x4a4c56){_0xf81284['temp']-=_0x307b3e;if(_0xf81284['temp']<0x0){_0xf81284['temp']=0x0;}logger[_0x0a9e('0xa')](_0x0a9e('0xb'),inspectError(_0x4a4c56));});}exports[_0x0a9e('0x9')]=getContactDialerIvr;function countReScheduled(_0x26d672){return cmHopper[_0x0a9e('0xc')](_0x26d672)[_0x0a9e('0x6')](function(_0x5db4b0){logger[_0x0a9e('0xa')](_0x0a9e('0xd'),inspectError(_0x5db4b0));});}exports[_0x0a9e('0xc')]=countReScheduled;function rescheduleContact(_0x281129){return cmHopper[_0x0a9e('0xe')](_0x281129)[_0x0a9e('0x6')](function(_0x52a03d){logger[_0x0a9e('0xa')]('[rescheduleContact]',inspectError(_0x52a03d));});}exports[_0x0a9e('0xe')]=rescheduleContact;function unlockContact(_0x519dfd,_0x16033c,_0x12066b){return cmHopper['unlockContact'](_0x519dfd,_0x16033c,_0x12066b)[_0x0a9e('0x6')](function(_0x5a0a06){logger[_0x0a9e('0xa')](_0x0a9e('0xf'),inspectError(_0x5a0a06));});}exports[_0x0a9e('0x10')]=unlockContact;function moveContactManagedDialer(_0x205fd6){return cmHopper[_0x0a9e('0x11')](_0x205fd6)[_0x0a9e('0x6')](function(_0x530eb7){logger[_0x0a9e('0xa')](_0x0a9e('0x12'),inspectError(_0x530eb7));});}exports[_0x0a9e('0x11')]=moveContactManagedDialer;function checkIsBlackList(_0x1c696a){return cmHopperBlack[_0x0a9e('0x13')](_0x1c696a)['catch'](function(_0x2c3407){logger[_0x0a9e('0xa')]('[checkIsBlackList]',inspectError(_0x2c3407));});}exports[_0x0a9e('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x5a09ef){return cmHopperBlack['checkIsBlackListIvr'](_0x5a09ef)[_0x0a9e('0x6')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x14'),inspectError(_0x432e56));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return cmHopperAdditionalPhone[_0x0a9e('0x15')](_0xfb6e48,_0x2fb0e4,_0x3b45bc)[_0x0a9e('0x6')](function(_0x42ac8f){logger[_0x0a9e('0xa')]('[verifyAdditionalPhone]',inspectError(_0x42ac8f));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x197ec0,_0x3a8e58,_0x40c424){return cmHopperAdditionalPhone[_0x0a9e('0x16')](_0x197ec0,_0x3a8e58,_0x40c424)['catch'](function(_0x384319){logger['error'](_0x0a9e('0x17'),inspectError(_0x384319));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x1dc186){return cmHopperHistory[_0x0a9e('0x18')](_0x1dc186)[_0x0a9e('0x6')](function(_0x14433c){logger[_0x0a9e('0xa')](_0x0a9e('0x19'),inspectError(_0x14433c));});}exports[_0x0a9e('0x18')]=avgHandleTime;function createHistory(_0x14de77){return cmHopperHistory['createHistory'](_0x14de77)[_0x0a9e('0x6')](function(_0x468813){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),inspectError(_0x468813));});}exports['createHistory']=createHistory; \ No newline at end of file +var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x4500af,_0x1f6997){var _0x335517=function(_0x27b76b){while(--_0x27b76b){_0x4500af['push'](_0x4500af['shift']());}};_0x335517(++_0x1f6997);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 2468883..1725a2d 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b23=['NULL_INTERVAL','isEmpty','UNKNOWN_TIMEZONE','SIP/','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName','string','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','length','checkContactEmpty','moment','util','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','RECALLINQUEUE','RECALLFAILEDTIMEOUT','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','isPreviewCampaign','type','ivr','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','diff','seconds','getSeconds','dialMethod','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals'];(function(_0x12b40a,_0x2a06ae){var _0x4e549c=function(_0x1efd71){while(--_0x1efd71){_0x12b40a['push'](_0x12b40a['shift']());}};_0x4e549c(++_0x2a06ae);}(_0x3b23,0x14d));var _0x33b2=function(_0x4066c7,_0x3f1e0a){_0x4066c7=_0x4066c7-0x0;var _0x1c1a4c=_0x3b23[_0x4066c7];return _0x1c1a4c;};'use strict';var _=require('lodash');var moment=require(_0x33b2('0x0'));var util=require(_0x33b2('0x1'));var logger=require('../../../../config/logger')(_0x33b2('0x2'));var timezones=require(_0x33b2('0x3'))[_0x33b2('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0x33b2('0x5'),'BLACKLIST':_0x33b2('0x6'),'CONTACTS_RESCHEDULED':_0x33b2('0x7'),'DEACTIVATED':_0x33b2('0x8'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x33b2('0x9'),'NO_AVAILABLE_CONTACTS':_0x33b2('0xa'),'NULL_INTERVAL':_0x33b2('0xb'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x33b2('0xc'),'RECALL_TIMEOUT':_0x33b2('0xd'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0x33b2('0xe')};exports[_0x33b2('0xf')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x9c1398){return _0x9c1398['dialMethod']==='preview';}exports[_0x33b2('0x10')]=isPreviewCampaign;function isIVRCampaign(_0xcc687f){return _0xcc687f[_0x33b2('0x11')]===_0x33b2('0x12');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x12a333){return _0x12a333[_0x33b2('0x11')]===_0x33b2('0x13');}exports[_0x33b2('0x14')]=isOutboundQueue;function isQueueCampaignActive(_0x1e93d0){return _0x1e93d0[_0x33b2('0x15')];}exports[_0x33b2('0x16')]=isQueueCampaignActive;function isIVRCampaignActive(_0x15fe5b){return _0x15fe5b[_0x33b2('0x17')];}exports[_0x33b2('0x18')]=isIVRCampaignActive;function getSeconds(_0x1e6405,_0x36c3a8){var _0x445e50=moment(_0x1e6405)['milliseconds'](0x0);var _0x26006d=moment(_0x36c3a8)['milliseconds'](0x0);return _0x445e50[_0x33b2('0x19')](_0x26006d,_0x33b2('0x1a'));}exports[_0x33b2('0x1b')]=getSeconds;function hasQueueCampaignDataChanged(_0x21f121,_0x1fb1b5){var _0x5e1a6f=![];var _0xe34dbf=_0x21f121[_0x33b2('0x1c')]!==_0x1fb1b5[_0x33b2('0x1c')]||_0x21f121[_0x33b2('0x15')]!==_0x1fb1b5[_0x33b2('0x15')]||_0x21f121['message']!==_0x1fb1b5[_0x33b2('0x1d')];var _0xd84424=_0x21f121[_0x33b2('0x1e')]!==_0x1fb1b5[_0x33b2('0x1e')]||_0x21f121[_0x33b2('0x1f')]!==_0x1fb1b5['loggedIn']||_0x21f121[_0x33b2('0x20')]!==_0x1fb1b5['loggedInDb']||_0x21f121[_0x33b2('0x21')]!==_0x1fb1b5['paused']||_0x21f121[_0x33b2('0x22')]!==_0x1fb1b5['talking']||_0x21f121[_0x33b2('0x23')]!==_0x1fb1b5['pTalking']||_0x21f121[_0x33b2('0x24')]!==_0x1fb1b5[_0x33b2('0x24')]||_0x21f121[_0x33b2('0x25')]!==_0x1fb1b5[_0x33b2('0x25')]||_0x21f121[_0x33b2('0x26')]!==_0x1fb1b5[_0x33b2('0x26')];if(_0x21f121[_0x33b2('0x27')]&&_0x1fb1b5[_0x33b2('0x27')]){_0x5e1a6f=_0x21f121[_0x33b2('0x27')][_0x33b2('0x28')]!==_0x1fb1b5[_0x33b2('0x27')]['name']||_0x21f121[_0x33b2('0x27')][_0x33b2('0x17')]!==_0x1fb1b5[_0x33b2('0x27')]['active'];}return _0xe34dbf||_0xd84424||_0x5e1a6f;}exports[_0x33b2('0x29')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x16b74e){var _0x3c9ee8=null;var _0x5f2998=_0x16b74e[_0x33b2('0x2a')];if(_[_0x33b2('0x2b')](_0x16b74e[_0x33b2('0x2c')])||_['isNil'](_0x16b74e['Interval'])||_[_0x33b2('0x2b')](_0x16b74e[_0x33b2('0x2d')][_0x33b2('0x2e')])){_0x3c9ee8=CAMPAIGN_STATUS[_0x33b2('0x2f')];}else if(_[_0x33b2('0x30')](_0x16b74e[_0x33b2('0x2c')])||_[_0x33b2('0x30')](_0x16b74e[_0x33b2('0x2d')][_0x33b2('0x2e')])){_0x3c9ee8=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x5f2998&&!timezones[_0x5f2998]){_0x3c9ee8=CAMPAIGN_STATUS[_0x33b2('0x31')];}return _0x3c9ee8;}function checkAnyValidTrunk(_0xb7a1f9,_0x5711b9){var _0x2788f5=null;var _0x107a21=_0x33b2('0x32');var _0x23eac2=['reachable',_0x33b2('0x33')];var _0x530ece=!![];if(_0xb7a1f9[_0x33b2('0x27')]&&_0xb7a1f9[_0x33b2('0x27')][_0x33b2('0x17')]){_0x107a21+=_0xb7a1f9[_0x33b2('0x27')][_0x33b2('0x28')];_0x2788f5=_0x5711b9[_0x107a21];_0x530ece=_0x23eac2[_0x33b2('0x34')](_0x2788f5[_0x33b2('0x35')]);}else if(_0xb7a1f9['TrunkBackup']&&_0xb7a1f9[_0x33b2('0x36')]['active']){_0x107a21+=_0xb7a1f9['TrunkBackup'][_0x33b2('0x28')];_0x2788f5=_0x5711b9[_0x107a21];_0x530ece=_0x23eac2[_0x33b2('0x34')](_0x2788f5['status']);}return _0x530ece;}function getQueueCampaignStatusMessage(_0x367b0c,_0x5c4f3d){var _0x29bae2=CAMPAIGN_STATUS[_0x33b2('0x5')];var _0x5b7a4c=isPreviewCampaign(_0x367b0c);if(!isQueueCampaignActive(_0x367b0c)){if(_0x5b7a4c){_0x29bae2=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x367b0c['originated']===0x0&&_0x367b0c[_0x33b2('0x22')]===0x0&&_0x367b0c[_0x33b2('0x24')]===0x0&&(_0x367b0c[_0x33b2('0x23')]||0x0)===0x0){_0x29bae2=CAMPAIGN_STATUS[_0x33b2('0x37')];}else{_0x29bae2=CAMPAIGN_STATUS[_0x33b2('0x38')];}}}else if(_0x367b0c[_0x33b2('0x1f')]===0x0){_0x29bae2=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x367b0c,_0x5c4f3d)){_0x29bae2=CAMPAIGN_STATUS[_0x33b2('0x39')];}else if(!isPreviewCampaign(_0x367b0c)){var _0x209460=checkAnyValidQueueCampaignInterval(_0x367b0c);if(_0x209460){_0x29bae2=_0x209460;}}return _0x29bae2;}exports[_0x33b2('0x3a')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x2f1017){var _0x32924c=CAMPAIGN_STATUS[_0x33b2('0x38')];if(_0x2f1017[_0x33b2('0x26')]===0x0&&_0x2f1017[_0x33b2('0x22')]===0x0&&_0x2f1017['waiting']===0x0&&(_0x2f1017[_0x33b2('0x23')]||0x0)===0x0){_0x32924c=CAMPAIGN_STATUS[_0x33b2('0x37')];}return _0x32924c;}exports[_0x33b2('0x3b')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x54c6c6){var _0x55f746=_0x54c6c6['match'](/"(.*?)"/);return _0x55f746?_0x55f746[0x1]:_0x54c6c6;}exports[_0x33b2('0x3c')]=extractCalleridName;function getCallerId(_0x5866cd,_0x341caa,_0x11fa14){if(!_['isUndefined'](_0x11fa14)&&typeof _0x11fa14===_0x33b2('0x3d')&&!_[_0x33b2('0x30')](_0x11fa14)){if(!_['isUndefined'](_0x341caa)&&typeof _0x341caa===_0x33b2('0x3d')&&!_[_0x33b2('0x30')](_0x341caa)){return util[_0x33b2('0x3e')](_0x33b2('0x3f'),_0x341caa,_0x11fa14);}return util['format'](_0x33b2('0x3f'),_0x11fa14,_0x11fa14);}if(!_[_0x33b2('0x40')](_0x5866cd)&&typeof _0x5866cd===_0x33b2('0x3d')&&!_[_0x33b2('0x30')](_0x5866cd)){return _0x5866cd;}return _0x33b2('0x41');}exports[_0x33b2('0x42')]=getCallerId;function getCallerIdRandom(_0x11c74c,_0x262723){var _0xa62fec;var _0x43cfe4;var _0x59084b;if(_0x262723<=0x0){_0x262723=0x1;}_0xa62fec=new RegExp(_0x33b2('0x43')+_0x262723+'}$');_0x43cfe4=Math[_0x33b2('0x44')](0xa,_0x262723-0x1);_0x59084b=Math[_0x33b2('0x44')](0xa,_0x262723)-0x1;return util[_0x33b2('0x3e')]('%s',_[_0x33b2('0x45')](_0x11c74c,_0xa62fec,_[_0x33b2('0x46')](_0x43cfe4,_0x59084b)['toString']()));}exports[_0x33b2('0x47')]=getCallerIdRandom;function decrementOriginate(_0x136cbf){if(_0x136cbf[_0x33b2('0x26')]&&_0x136cbf[_0x33b2('0x26')]>0x0){_0x136cbf['originated']-=0x1;}else{logger[_0x33b2('0x48')](_0x33b2('0x49'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x4b97d2){return _0x4b97d2&&_0x4b97d2[_0x33b2('0x4a')]>0x0;}exports[_0x33b2('0x4b')]=checkContactEmpty;function erlangb(_0x3f98af,_0x734d1e){if(_0x734d1e===0x0){return 0x0;}var _0xad0c5a=0x1;for(var _0x47f48b=0x1;_0x47f48b<=_0x734d1e;_0x47f48b+=0x1){_0xad0c5a=0x1+_0xad0c5a*_0x47f48b/_0x3f98af;}return 0x1/_0xad0c5a;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x19e388,_0x478b8c,_0x1b3956){if(_0x478b8c>_0x1b3956){for(var _0x2a83d6=0x0;_0x2a83d6<_0x478b8c-_0x1b3956;_0x2a83d6+=0x1){decrementOriginate(_0x19e388);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate; \ No newline at end of file +var _0x5175=['\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','random','getCallerIdRandom','error','decrementOriginate','length','checkContactEmpty','lodash','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','talking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','Interval','NULL_INTERVAL','isEmpty','dialGlobalInterval','Intervals','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','DISACTIVED','pTalking','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','format','\x22%s\x22\x20<%s>','string'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x5175,0x1a4));var _0x5517=function(_0x294ee4,_0x3773a9){_0x294ee4=_0x294ee4-0x0;var _0x1a3f59=_0x5175[_0x294ee4];return _0x1a3f59;};'use strict';var _=require(_0x5517('0x0'));var moment=require('moment');var util=require('util');var logger=require(_0x5517('0x1'))(_0x5517('0x2'));var timezones=require(_0x5517('0x3'))[_0x5517('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0x5517('0x5'),'BLACKLIST':_0x5517('0x6'),'CONTACTS_RESCHEDULED':_0x5517('0x7'),'DEACTIVATED':_0x5517('0x8'),'DISACTIVED':_0x5517('0x9'),'EMPTY_INTERVAL':_0x5517('0xa'),'INACTIVE':_0x5517('0xb'),'NO_AGENTS_LOGGED':_0x5517('0xc'),'NO_AVAILABLE_CONTACTS':_0x5517('0xd'),'NULL_INTERVAL':_0x5517('0xe'),'OVERTIME_INTERVAL':_0x5517('0xf'),'OVERTIME_GLOBAL_INTERVAL':_0x5517('0x10'),'QUEUE_RECALL':_0x5517('0x11'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0x5517('0x12'),'UNKNOWN_TIMEZONE':_0x5517('0x13'),'UNREACHABLE_TRUNK':_0x5517('0x14')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x4dce46){return _0x4dce46[_0x5517('0x15')]===_0x5517('0x16');}exports[_0x5517('0x17')]=isPreviewCampaign;function isIVRCampaign(_0x3d2f58){return _0x3d2f58[_0x5517('0x18')]===_0x5517('0x19');}exports[_0x5517('0x1a')]=isIVRCampaign;function isOutboundQueue(_0x58ab13){return _0x58ab13[_0x5517('0x18')]===_0x5517('0x1b');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x1b091b){return _0x1b091b[_0x5517('0x1c')];}exports[_0x5517('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0xe9eb8e){return _0xe9eb8e[_0x5517('0x1e')];}exports[_0x5517('0x1f')]=isIVRCampaignActive;function getSeconds(_0x35ca2b,_0x483cfb){var _0x508811=moment(_0x35ca2b)[_0x5517('0x20')](0x0);var _0x51b68b=moment(_0x483cfb)['milliseconds'](0x0);return _0x508811[_0x5517('0x21')](_0x51b68b,_0x5517('0x22'));}exports[_0x5517('0x23')]=getSeconds;function hasQueueCampaignDataChanged(_0x3aebce,_0x244b31){var _0x4666e5=![];var _0x1e9a15=_0x3aebce[_0x5517('0x15')]!==_0x244b31[_0x5517('0x15')]||_0x3aebce[_0x5517('0x1c')]!==_0x244b31[_0x5517('0x1c')]||_0x3aebce[_0x5517('0x24')]!==_0x244b31[_0x5517('0x24')];var _0x589a50=_0x3aebce[_0x5517('0x25')]!==_0x244b31[_0x5517('0x25')]||_0x3aebce[_0x5517('0x26')]!==_0x244b31[_0x5517('0x26')]||_0x3aebce[_0x5517('0x27')]!==_0x244b31[_0x5517('0x27')]||_0x3aebce['paused']!==_0x244b31['paused']||_0x3aebce[_0x5517('0x28')]!==_0x244b31[_0x5517('0x28')]||_0x3aebce['pTalking']!==_0x244b31['pTalking']||_0x3aebce['waiting']!==_0x244b31[_0x5517('0x29')]||_0x3aebce[_0x5517('0x2a')]!==_0x244b31[_0x5517('0x2a')]||_0x3aebce['originated']!==_0x244b31[_0x5517('0x2b')];if(_0x3aebce['Trunk']&&_0x244b31[_0x5517('0x2c')]){_0x4666e5=_0x3aebce[_0x5517('0x2c')]['name']!==_0x244b31[_0x5517('0x2c')][_0x5517('0x2d')]||_0x3aebce[_0x5517('0x2c')]['active']!==_0x244b31[_0x5517('0x2c')][_0x5517('0x1e')];}return _0x1e9a15||_0x589a50||_0x4666e5;}exports[_0x5517('0x2e')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1bebc6){var _0x239934=null;var _0x5a71e8=_0x1bebc6[_0x5517('0x2f')];if(_['isNil'](_0x1bebc6['dialGlobalInterval'])||_[_0x5517('0x30')](_0x1bebc6[_0x5517('0x31')])||_[_0x5517('0x30')](_0x1bebc6[_0x5517('0x31')]['Intervals'])){_0x239934=CAMPAIGN_STATUS[_0x5517('0x32')];}else if(_[_0x5517('0x33')](_0x1bebc6[_0x5517('0x34')])||_[_0x5517('0x33')](_0x1bebc6['Interval'][_0x5517('0x35')])){_0x239934=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x5a71e8&&!timezones[_0x5a71e8]){_0x239934=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x239934;}function checkAnyValidTrunk(_0x53b916,_0x404512){var _0x3f377c=null;var _0x476a62=_0x5517('0x36');var _0x3f7cae=[_0x5517('0x37'),_0x5517('0x38')];var _0x405909=!![];if(_0x53b916[_0x5517('0x2c')]&&_0x53b916[_0x5517('0x2c')][_0x5517('0x1e')]){_0x476a62+=_0x53b916[_0x5517('0x2c')][_0x5517('0x2d')];_0x3f377c=_0x404512[_0x476a62];_0x405909=_0x3f7cae[_0x5517('0x39')](_0x3f377c[_0x5517('0x3a')]);}else if(_0x53b916[_0x5517('0x3b')]&&_0x53b916[_0x5517('0x3b')]['active']){_0x476a62+=_0x53b916[_0x5517('0x3b')][_0x5517('0x2d')];_0x3f377c=_0x404512[_0x476a62];_0x405909=_0x3f7cae[_0x5517('0x39')](_0x3f377c[_0x5517('0x3a')]);}return _0x405909;}function getQueueCampaignStatusMessage(_0x574df6,_0x120f47){var _0x2ded39=CAMPAIGN_STATUS[_0x5517('0x5')];var _0x4f461a=isPreviewCampaign(_0x574df6);if(!isQueueCampaignActive(_0x574df6)){if(_0x4f461a){_0x2ded39=CAMPAIGN_STATUS[_0x5517('0x3c')];}else{if(_0x574df6[_0x5517('0x2b')]===0x0&&_0x574df6['talking']===0x0&&_0x574df6[_0x5517('0x29')]===0x0&&(_0x574df6['pTalking']||0x0)===0x0){_0x2ded39=CAMPAIGN_STATUS[_0x5517('0x3c')];}else{_0x2ded39=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x574df6['loggedIn']===0x0){_0x2ded39=CAMPAIGN_STATUS[_0x5517('0x3d')];}else if(!checkAnyValidTrunk(_0x574df6,_0x120f47)){_0x2ded39=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x574df6)){var _0x120c97=checkAnyValidQueueCampaignInterval(_0x574df6);if(_0x120c97){_0x2ded39=_0x120c97;}}return _0x2ded39;}exports[_0x5517('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x281774){var _0x3f7118=CAMPAIGN_STATUS[_0x5517('0x3f')];if(_0x281774[_0x5517('0x2b')]===0x0&&_0x281774['talking']===0x0&&_0x281774[_0x5517('0x29')]===0x0&&(_0x281774[_0x5517('0x40')]||0x0)===0x0){_0x3f7118=CAMPAIGN_STATUS['INACTIVE'];}return _0x3f7118;}exports[_0x5517('0x41')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0xafcac){var _0x2bf0ec=_0xafcac[_0x5517('0x42')](/"(.*?)"/);return _0x2bf0ec?_0x2bf0ec[0x1]:_0xafcac;}exports[_0x5517('0x43')]=extractCalleridName;function getCallerId(_0x4091d1,_0x35df6b,_0x2b4cc6){if(!_[_0x5517('0x44')](_0x2b4cc6)&&typeof _0x2b4cc6==='string'&&!_[_0x5517('0x33')](_0x2b4cc6)){if(!_[_0x5517('0x44')](_0x35df6b)&&typeof _0x35df6b==='string'&&!_[_0x5517('0x33')](_0x35df6b)){return util[_0x5517('0x45')]('\x22%s\x22\x20<%s>',_0x35df6b,_0x2b4cc6);}return util[_0x5517('0x45')](_0x5517('0x46'),_0x2b4cc6,_0x2b4cc6);}if(!_[_0x5517('0x44')](_0x4091d1)&&typeof _0x4091d1===_0x5517('0x47')&&!_[_0x5517('0x33')](_0x4091d1)){return _0x4091d1;}return _0x5517('0x48');}exports[_0x5517('0x49')]=getCallerId;function getCallerIdRandom(_0x5c4c88,_0x3ce59a){var _0x4b38e3;var _0x4b96e0;var _0x590eaf;if(_0x3ce59a<=0x0){_0x3ce59a=0x1;}_0x4b38e3=new RegExp(_0x5517('0x4a')+_0x3ce59a+'}$');_0x4b96e0=Math[_0x5517('0x4b')](0xa,_0x3ce59a-0x1);_0x590eaf=Math[_0x5517('0x4b')](0xa,_0x3ce59a)-0x1;return util['format']('%s',_['replace'](_0x5c4c88,_0x4b38e3,_[_0x5517('0x4c')](_0x4b96e0,_0x590eaf)['toString']()));}exports[_0x5517('0x4d')]=getCallerIdRandom;function decrementOriginate(_0x174d8c){if(_0x174d8c[_0x5517('0x2b')]&&_0x174d8c[_0x5517('0x2b')]>0x0){_0x174d8c[_0x5517('0x2b')]-=0x1;}else{logger[_0x5517('0x4e')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0x5517('0x4f')]=decrementOriginate;function checkContactEmpty(_0x2d1c0c){return _0x2d1c0c&&_0x2d1c0c[_0x5517('0x50')]>0x0;}exports[_0x5517('0x51')]=checkContactEmpty;function erlangb(_0x3ab279,_0xda0eac){if(_0xda0eac===0x0){return 0x0;}var _0x932aaa=0x1;for(var _0x3aec23=0x1;_0x3aec23<=_0xda0eac;_0x3aec23+=0x1){_0x932aaa=0x1+_0x932aaa*_0x3aec23/_0x3ab279;}return 0x1/_0x932aaa;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x202707,_0x1bedc7,_0x5ef30b){if(_0x1bedc7>_0x5ef30b){for(var _0x4462aa=0x0;_0x4462aa<_0x1bedc7-_0x5ef30b;_0x4462aa+=0x1){decrementOriginate(_0x202707);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index b7d7fe6..990a7b1 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(_0x2e4797,_0x29e4be){var _0x1efe7e=function(_0x1aab9c){while(--_0x1aab9c){_0x2e4797['push'](_0x2e4797['shift']());}};_0x1efe7e(++_0x29e4be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x3cf713,_0x3901a9){var _0x174d42=function(_0x3bff25){while(--_0x3bff25){_0x3cf713['push'](_0x3cf713['shift']());}};_0x174d42(++_0x3901a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 c5b3fd7..99e401d 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 _0x0593=['./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','channelstate','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','\x20hangup\x20faxRiceive\x20','faxpages','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','fax','../ami','./rpcDb'];(function(_0x32723e,_0x5c8a2f){var _0x384270=function(_0x3540ce){while(--_0x3540ce){_0x32723e['push'](_0x32723e['shift']());}};_0x384270(++_0x5c8a2f);}(_0x0593,0x1d1));var _0x3059=function(_0x256bec,_0x140e96){_0x256bec=_0x256bec-0x0;var _0x2c661c=_0x0593[_0x256bec];return _0x2c661c;};'use strict';var util=require(_0x3059('0x0'));var _=require(_0x3059('0x1'));var BPromise=require(_0x3059('0x2'));var uuid=require(_0x3059('0x3'));var moment=require(_0x3059('0x4'));var path=require(_0x3059('0x5'));var tiff2pdf=require(_0x3059('0x6'));var gs=require(_0x3059('0x7'));var logger=require('../../../config/logger')(_0x3059('0x8'));var ami=require(_0x3059('0x9'));var rpcDb=require(_0x3059('0xa'));var Channel=require(_0x3059('0xb'));var ut=require(_0x3059('0xc'));var Action=require(_0x3059('0xd'));var faxAccount=require(_0x3059('0xe'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x3059('0xf'));function Fax(_0x46fcfd){this[_0x3059('0x10')]={};this[_0x3059('0x11')]=_0x46fcfd[_0x3059('0x11')];this[_0x3059('0x12')]=_0x46fcfd[_0x3059('0x12')];this[_0x3059('0x13')]={};ami['on'](_0x3059('0x14'),this['syncNewchannel'][_0x3059('0x15')](this));ami['on'](_0x3059('0x16'),this[_0x3059('0x17')]['bind'](this));ami['on'](_0x3059('0x18'),this[_0x3059('0x19')][_0x3059('0x15')](this));ami['on'](_0x3059('0x1a'),this[_0x3059('0x1b')][_0x3059('0x15')](this));ami['on'](_0x3059('0x1c'),this[_0x3059('0x1d')]['bind'](this));ami['on']('receivefax',this[_0x3059('0x1e')][_0x3059('0x15')](this));ami['on'](_0x3059('0x1f'),this[_0x3059('0x20')][_0x3059('0x15')](this));ami['on'](_0x3059('0x21'),this[_0x3059('0x22')][_0x3059('0x15')](this));}Fax[_0x3059('0x23')][_0x3059('0x24')]=function(_0x42c970){if(_0x42c970[_0x3059('0x25')]===_0x3059('0x26')){for(var _0x1a533e in this[_0x3059('0x11')]){if(this[_0x3059('0x11')][_0x3059('0x27')](_0x1a533e)){if(_0x42c970['exten']===this[_0x3059('0x11')][_0x1a533e][_0x3059('0x28')]){this[_0x3059('0x10')][_0x42c970[_0x3059('0x29')]]={};this['channels'][_0x42c970[_0x3059('0x29')]][_0x3059('0x2a')]=_0x42c970[_0x3059('0x2a')];this[_0x3059('0x10')][_0x42c970[_0x3059('0x29')]]['id']=this['faxAccounts'][_0x1a533e]['id'];this[_0x3059('0x10')][_0x42c970['uniqueid']][_0x3059('0x2b')]=this[_0x3059('0x11')][_0x1a533e][_0x3059('0x2b')];logger[_0x3059('0x2c')](_0x42c970[_0x3059('0x29')],'\x20syncNewchannel\x20');}}}}if(this[_0x3059('0x13')][_0x42c970[_0x3059('0x29')]]){this[_0x3059('0x10')][_0x42c970[_0x3059('0x29')]]={};this[_0x3059('0x10')][_0x42c970[_0x3059('0x29')]][_0x3059('0x2a')]=_0x42c970['channel'];logger['info'](_0x42c970[_0x3059('0x29')],_0x3059('0x2d'));}};Fax['prototype']['syncVarSet']=function(_0x3aa1c8){if(this[_0x3059('0x10')][_0x3aa1c8[_0x3059('0x29')]]){for(var _0x588616 in _0x3aa1c8[_0x3059('0x2e')]){if(_0x3aa1c8[_0x3059('0x2e')][_0x3059('0x27')](_0x588616)){this['channels'][_0x3aa1c8[_0x3059('0x29')]][_0x588616]=_0x3aa1c8['value'];}}}};Fax[_0x3059('0x23')][_0x3059('0x19')]=function(_0x391a6d){if(this[_0x3059('0x10')][_0x391a6d[_0x3059('0x29')]]){this[_0x3059('0x10')][_0x391a6d['uniqueid']][_0x3059('0x2f')]=_0x391a6d[_0x3059('0x2f')];this[_0x3059('0x10')][_0x391a6d['uniqueid']]['channelstatedesc']=_0x391a6d['channelstatedesc'];}};Fax[_0x3059('0x23')]['syncNewExten']=function(_0x4985b0){if(this[_0x3059('0x10')][_0x4985b0[_0x3059('0x29')]]){for(var _0x2a0e69 in _0x4985b0['variable']){if(_0x4985b0[_0x3059('0x2e')][_0x3059('0x27')](_0x2a0e69)){this['channels'][_0x4985b0[_0x3059('0x29')]][_0x2a0e69]=_0x4985b0[_0x3059('0x30')];}}}};Fax[_0x3059('0x23')][_0x3059('0x1d')]=function(_0x156043){if(this[_0x3059('0x10')][_0x156043[_0x3059('0x29')]]){this[_0x3059('0x10')][_0x156043[_0x3059('0x29')]][_0x3059('0x31')]=_0x156043[_0x3059('0x31')];this[_0x3059('0x10')][_0x156043[_0x3059('0x29')]][_0x3059('0x32')]=_0x156043[_0x3059('0x32')];this['channels'][_0x156043[_0x3059('0x29')]][_0x3059('0x28')]=_0x156043[_0x3059('0x28')];this[_0x3059('0x10')][_0x156043[_0x3059('0x29')]][_0x3059('0x33')]=_0x156043[_0x3059('0x33')];logger[_0x3059('0x2c')](_0x156043[_0x3059('0x29')],_0x3059('0x34'));}};Fax[_0x3059('0x23')][_0x3059('0x1e')]=function(_0x3296da){var _0x1ae274=this;if(this[_0x3059('0x10')][_0x3296da[_0x3059('0x29')]]){var _0x389924=this[_0x3059('0x10')][_0x3296da[_0x3059('0x29')]]['id'];this['channels'][_0x3296da[_0x3059('0x29')]]['remotestationid']=_0x3296da[_0x3059('0x35')];this[_0x3059('0x10')][_0x3296da['uniqueid']][_0x3059('0x36')]=_0x3296da[_0x3059('0x36')];this[_0x3059('0x10')][_0x3296da[_0x3059('0x29')]][_0x3059('0x28')]=_0x3296da[_0x3059('0x28')];this['channels'][_0x3296da[_0x3059('0x29')]][_0x3059('0x37')]=_0x3296da[_0x3059('0x37')];this[_0x3059('0x10')][_0x3296da[_0x3059('0x29')]][_0x3059('0x38')]=_0x3296da['transferrate'];this[_0x3059('0x10')][_0x3296da[_0x3059('0x29')]]['filename']=_0x3296da[_0x3059('0x33')];this[_0x3059('0x10')][_0x3296da[_0x3059('0x29')]][_0x3059('0x39')]=_0x3296da[_0x3059('0x39')];if(this[_0x3059('0x10')][_0x3296da[_0x3059('0x29')]][_0x3059('0x36')]>0x0){tiff2pdf(_0x3296da['filename'],_0x3059('0x3a'),function(_0x4c2348){logger[_0x3059('0x2c')](_0x3296da[_0x3059('0x29')],_0x3059('0x3b'),_0x4c2348[_0x3059('0x3c')]);attachment[_0x3059('0x3d')]({'name':path[_0x3059('0x3e')](_0x3296da['filename'])[_0x3059('0x2b')],'basename':path[_0x3059('0x3e')](_0x3296da[_0x3059('0x33')])[_0x3059('0x2b')]+_0x3059('0x3f'),'type':_0x3059('0x40')})[_0x3059('0x41')](function(_0x1663df){faxAccount['notify'](_0x389924,{'from':_0x3296da[_0x3059('0x39')],'mapKey':_0x3059('0x8'),'body':path[_0x3059('0x3e')](_0x3296da[_0x3059('0x33')])[_0x3059('0x2b')]+'.pdf','AttachmentId':_0x1663df['id']})[_0x3059('0x42')](function(_0x3b96b0){logger['error'](_0x3296da[_0x3059('0x29')],_0x3059('0x43'),JSON[_0x3059('0x44')](_0x3b96b0));});})[_0x3059('0x42')](function(_0x25ddf8){logger[_0x3059('0x45')](_0x3296da[_0x3059('0x29')],_0x3059('0x46'),JSON['stringify'](_0x25ddf8));});});}logger['info'](_0x3296da[_0x3059('0x29')],_0x3059('0x46'));}};Fax[_0x3059('0x23')][_0x3059('0x22')]=function(_0x553906){if(this['actions'][_0x553906[_0x3059('0x29')]]){_[_0x3059('0x47')](this[_0x3059('0x10')][_0x553906[_0x3059('0x29')]],_['pick'](_0x553906,[_0x3059('0x48'),_0x3059('0x49')]));}};function updateStatus(_0x2f5db2){if(_0x2f5db2[_0x3059('0x4a')]){faxMessage[_0x3059('0x4b')](_0x2f5db2[_0x3059('0x4a')],{'failMessage':_0x3059('0x4c')})['then'](function(_0xb46683){ut[_0x3059('0x4d')](_0x3059('0x4e'),_0xb46683);})[_0x3059('0x42')](function(_0x25259b){ut[_0x3059('0x4d')](_0x3059('0x4f'),_0x25259b);});}else{ut[_0x3059('0x4d')](_0x3059('0x50'));}}Fax[_0x3059('0x23')]['updateStatus']=function(_0x4b802f,_0x3bac16,_0x3900a9){var _0x5c9c76=this;var _0x5707f2={};if(_0x3bac16){_0x5707f2={'read':_0x3bac16};}else{_0x5707f2={'failMessage':_0x3900a9};}if(this[_0x3059('0x13')][_0x4b802f][_0x3059('0x4a')]){faxMessage[_0x3059('0x4b')](this[_0x3059('0x13')][_0x4b802f][_0x3059('0x4a')],_0x5707f2)[_0x3059('0x41')](function(_0x17cb02){ut[_0x3059('0x4d')](_0x3059('0x51'),_0x17cb02);})['catch'](function(_0x218b57){ut['logger'](_0x3059('0x52'),_0x218b57);})['finally'](function(){delete _0x5c9c76['channels'][_0x4b802f];delete _0x5c9c76[_0x3059('0x13')][_0x4b802f];});}else{ut[_0x3059('0x4d')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x4b802f];delete this[_0x3059('0x13')][_0x4b802f];}};Fax[_0x3059('0x23')]['syncHangup']=function(_0x23fe9c){var _0x435d0e=this;if(this[_0x3059('0x10')][_0x23fe9c[_0x3059('0x29')]]){if(this[_0x3059('0x13')][_0x23fe9c[_0x3059('0x29')]]){this[_0x3059('0x10')][_0x23fe9c[_0x3059('0x29')]]['id']=this[_0x3059('0x13')][_0x23fe9c[_0x3059('0x29')]]['id'];this['channels'][_0x23fe9c[_0x3059('0x29')]][_0x3059('0x2b')]=this[_0x3059('0x13')][_0x23fe9c[_0x3059('0x29')]][_0x3059('0x2b')];}logger[_0x3059('0x2c')](_0x23fe9c[_0x3059('0x29')],this[_0x3059('0x13')][_0x23fe9c[_0x3059('0x29')]]?'\x20hangup\x20sendFile\x20':_0x3059('0x53'),JSON[_0x3059('0x44')](this[_0x3059('0x10')][_0x23fe9c[_0x3059('0x29')]]));if(this[_0x3059('0x13')][_0x23fe9c[_0x3059('0x29')]]){if(this[_0x3059('0x10')][_0x23fe9c[_0x3059('0x29')]][_0x3059('0x54')]>0x0&&this['channels'][_0x23fe9c[_0x3059('0x29')]][_0x3059('0x1c')]==='SUCCESS'){this[_0x3059('0x55')](_0x23fe9c[_0x3059('0x29')],!![]);}else{this[_0x3059('0x55')](_0x23fe9c['uniqueid'],![],this[_0x3059('0x10')][_0x23fe9c['uniqueid']][_0x3059('0x56')]?_0x3059('0x57')+this[_0x3059('0x10')][_0x23fe9c[_0x3059('0x29')]]['faxstatusstring']:_0x3059('0x58'));}}}};Fax[_0x3059('0x23')][_0x3059('0x59')]=function(_0x17fcaa){var _0x517720=this;return new BPromise(function(_0x44c70d,_0x59eac8){_0x517720[_0x3059('0x5a')](_0x17fcaa,_0x517720[_0x3059('0x11')][_0x17fcaa[_0x3059('0x5b')]])['then'](function(_0xea93ac){ut[_0x3059('0x4d')](_0x3059('0x5c'),_0xea93ac);_0x44c70d(ut['message'](_0x3059('0x5d')));})[_0x3059('0x42')](function(_0x4840ed){ut[_0x3059('0x4d')](_0x3059('0x5e'),_0x4840ed);updateStatus(_0x17fcaa);_0x59eac8(ut[_0x3059('0x3c')](_0x3059('0x5f')));});});};Fax[_0x3059('0x23')][_0x3059('0x60')]=function(_0x4a3da6){var _0x16728e=this;return new BPromise(function(_0x440c68,_0x2f8d61){var _0x2b4653=_0x16728e[_0x3059('0x61')](_0x16728e[_0x3059('0x11')][_0x4a3da6['FaxAccountId']]['Trunk'],_0x4a3da6);if(_0x2b4653[_0x3059('0x62')]){_0x440c68(ut[_0x3059('0x3c')]('Trunk\x20Reachable'));}else{_0x2f8d61(ut[_0x3059('0x3c')](_0x2b4653[_0x3059('0x3c')]));}});};function originate(_0x5897df,_0x184ee2,_0x1e424e){return new BPromise(function(_0x51caf2,_0x25fc09){if(_0x1e424e){var _0xb86b0=util[_0x3059('0x63')](_0x3059('0x64'),path[_0x3059('0x3e')](_0x5897df[_0x3059('0x5')])[_0x3059('0x2b')],_0x5897df[_0x3059('0x5')]);gs['execute'](_0xb86b0)[_0x3059('0x41')](function(){_0x5897df[_0x3059('0x5')]=util[_0x3059('0x63')](_0x3059('0x65'),path['parse'](_0x5897df[_0x3059('0x5')])[_0x3059('0x66')],path[_0x3059('0x3e')](_0x5897df[_0x3059('0x5')])['name']);_0x184ee2[_0x3059('0x67')]=_0x5897df['path'];ut[_0x3059('0x4d')](_0x3059('0x68'),'');ami[_0x3059('0x69')](ut['variablesAction'](_0x5897df,_0x184ee2))[_0x3059('0x41')](function(_0x3723da){_0x51caf2(_0x3723da);})[_0x3059('0x42')](function(_0x33d4cd){_0x25fc09(_0x33d4cd);});})[_0x3059('0x42')](function(_0x47a51d){_0x25fc09(_0x47a51d);});}else{ami[_0x3059('0x69')](ut[_0x3059('0x6a')](_0x5897df,_0x184ee2))['then'](function(_0x388c84){_0x51caf2(_0x388c84);})[_0x3059('0x42')](function(_0x42d9da){_0x25fc09(_0x42d9da);});}});}Fax[_0x3059('0x23')][_0x3059('0x5a')]=function(_0x35c007,_0xa40c2d){var _0x54ecf4=this;return new BPromise(function(_0x5b27f9,_0x219a10){var _0x6e902a=uuid['v4']();var _0x24e42d=ut[_0x3059('0x6b')](_0x35c007,_0xa40c2d);_0x54ecf4['actions'][_0x6e902a]=new Action(_0x6e902a,_0xa40c2d,_0x35c007);var _0x58ea71=_0x54ecf4[_0x3059('0x13')][_0x6e902a];if(path[_0x3059('0x3e')](_0x35c007[_0x3059('0x5')])[_0x3059('0x6c')]==='.pdf'){originate(_0x58ea71,_0x24e42d,!![])[_0x3059('0x41')](function(_0x4fc466){_0x5b27f9(_0x4fc466);})['catch'](function(_0xd339c7){_0x219a10(_0xd339c7);});}else{originate(_0x58ea71,_0x24e42d,![])['then'](function(_0x178db3){_0x5b27f9(_0x178db3);})[_0x3059('0x42')](function(_0x286f0e){_0x219a10(_0x286f0e);});}});};Fax[_0x3059('0x23')][_0x3059('0x6d')]=function(_0x40c0e2){return!_[_0x3059('0x6e')](_0x40c0e2)&&!_[_0x3059('0x6e')](_0x40c0e2['name'])&&!_[_0x3059('0x6e')](_0x40c0e2[_0x3059('0x6f')])&&_0x40c0e2[_0x3059('0x6f')]&&!_[_0x3059('0x6e')](this[_0x3059('0x12')][util['format'](_0x3059('0x70'),_0x40c0e2[_0x3059('0x2b')])])&&!_[_0x3059('0x6e')](this[_0x3059('0x12')][util[_0x3059('0x63')](_0x3059('0x70'),_0x40c0e2[_0x3059('0x2b')])][_0x3059('0x32')])&&(this[_0x3059('0x12')][util[_0x3059('0x63')](_0x3059('0x70'),_0x40c0e2[_0x3059('0x2b')])][_0x3059('0x32')]==='reachable'||this[_0x3059('0x12')][util[_0x3059('0x63')](_0x3059('0x70'),_0x40c0e2['name'])]['status']==='unmonitored');};Fax['prototype']['checkTrunk']=function(_0xfc0066,_0x228230){if(!this[_0x3059('0x6d')](_0xfc0066)){ut[_0x3059('0x4d')](_0x3059('0x71'),_['isNil'](_0xfc0066)?'':_0xfc0066[_0x3059('0x2b')]+_0x3059('0x72'));return{'isValid':![],'message':_0x3059('0x73')};}if(_[_0x3059('0x6e')](_0x228230[_0x3059('0x8')])){ut['logger'](_0x3059('0x74'),JSON[_0x3059('0x44')](_0x228230));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x3059('0x6e')](_0x228230[_0x3059('0x5')])){ut[_0x3059('0x4d')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x3059('0x44')](_0x228230));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x3059('0x75')};};module[_0x3059('0x76')]=Fax; \ No newline at end of file +var _0x0ab5=['stringify','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','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','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','moment','path','tiff2pdf','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewState','syncNewExten','faxstatus','receivefax','syncReceiveFax','hangup','originateresponse','prototype','syncNewchannel','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','catch','\x20notify\x20','error','\x20receiveFax\x20','syncOriginateResponse','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20'];(function(_0xb511c4,_0x5532ba){var _0x5b539d=function(_0xbc61d8){while(--_0xbc61d8){_0xb511c4['push'](_0xb511c4['shift']());}};_0x5b539d(++_0x5532ba);}(_0x0ab5,0x97));var _0x50ab=function(_0x446186,_0x116e31){_0x446186=_0x446186-0x0;var _0x63b564=_0x0ab5[_0x446186];return _0x63b564;};'use strict';var util=require(_0x50ab('0x0'));var _=require(_0x50ab('0x1'));var BPromise=require(_0x50ab('0x2'));var uuid=require('uuid');var moment=require(_0x50ab('0x3'));var path=require(_0x50ab('0x4'));var tiff2pdf=require(_0x50ab('0x5'));var gs=require('./util/gs');var logger=require('../../../config/logger')(_0x50ab('0x6'));var ami=require(_0x50ab('0x7'));var rpcDb=require(_0x50ab('0x8'));var Channel=require('./channel');var ut=require(_0x50ab('0x9'));var Action=require(_0x50ab('0xa'));var faxAccount=require(_0x50ab('0xb'));var attachment=require(_0x50ab('0xc'));var faxMessage=require(_0x50ab('0xd'));function Fax(_0x4f4353){this[_0x50ab('0xe')]={};this[_0x50ab('0xf')]=_0x4f4353['faxAccounts'];this[_0x50ab('0x10')]=_0x4f4353['trunks'];this[_0x50ab('0x11')]={};ami['on'](_0x50ab('0x12'),this['syncNewchannel'][_0x50ab('0x13')](this));ami['on'](_0x50ab('0x14'),this[_0x50ab('0x15')][_0x50ab('0x13')](this));ami['on'](_0x50ab('0x16'),this[_0x50ab('0x17')]['bind'](this));ami['on']('newexten',this[_0x50ab('0x18')]['bind'](this));ami['on'](_0x50ab('0x19'),this['syncFaxStatus'][_0x50ab('0x13')](this));ami['on'](_0x50ab('0x1a'),this[_0x50ab('0x1b')][_0x50ab('0x13')](this));ami['on'](_0x50ab('0x1c'),this['syncHangup']['bind'](this));ami['on'](_0x50ab('0x1d'),this['syncOriginateResponse']['bind'](this));}Fax[_0x50ab('0x1e')][_0x50ab('0x1f')]=function(_0x597e7d){if(_0x597e7d['context']===_0x50ab('0x20')){for(var _0x4f2051 in this[_0x50ab('0xf')]){if(this[_0x50ab('0xf')][_0x50ab('0x21')](_0x4f2051)){if(_0x597e7d['exten']===this[_0x50ab('0xf')][_0x4f2051][_0x50ab('0x22')]){this[_0x50ab('0xe')][_0x597e7d[_0x50ab('0x23')]]={};this[_0x50ab('0xe')][_0x597e7d['uniqueid']][_0x50ab('0x24')]=_0x597e7d[_0x50ab('0x24')];this[_0x50ab('0xe')][_0x597e7d['uniqueid']]['id']=this[_0x50ab('0xf')][_0x4f2051]['id'];this['channels'][_0x597e7d[_0x50ab('0x23')]][_0x50ab('0x25')]=this['faxAccounts'][_0x4f2051]['name'];logger[_0x50ab('0x26')](_0x597e7d['uniqueid'],_0x50ab('0x27'));}}}}if(this[_0x50ab('0x11')][_0x597e7d[_0x50ab('0x23')]]){this[_0x50ab('0xe')][_0x597e7d[_0x50ab('0x23')]]={};this[_0x50ab('0xe')][_0x597e7d[_0x50ab('0x23')]][_0x50ab('0x24')]=_0x597e7d[_0x50ab('0x24')];logger[_0x50ab('0x26')](_0x597e7d[_0x50ab('0x23')],_0x50ab('0x27'));}};Fax['prototype'][_0x50ab('0x15')]=function(_0xd81226){if(this[_0x50ab('0xe')][_0xd81226[_0x50ab('0x23')]]){for(var _0x48656a in _0xd81226[_0x50ab('0x28')]){if(_0xd81226[_0x50ab('0x28')][_0x50ab('0x21')](_0x48656a)){this['channels'][_0xd81226[_0x50ab('0x23')]][_0x48656a]=_0xd81226[_0x50ab('0x29')];}}}};Fax[_0x50ab('0x1e')][_0x50ab('0x17')]=function(_0x4006b1){if(this['channels'][_0x4006b1['uniqueid']]){this[_0x50ab('0xe')][_0x4006b1[_0x50ab('0x23')]][_0x50ab('0x2a')]=_0x4006b1[_0x50ab('0x2a')];this[_0x50ab('0xe')][_0x4006b1[_0x50ab('0x23')]][_0x50ab('0x2b')]=_0x4006b1[_0x50ab('0x2b')];}};Fax[_0x50ab('0x1e')][_0x50ab('0x18')]=function(_0x1fe77b){if(this['channels'][_0x1fe77b['uniqueid']]){for(var _0x2b581b in _0x1fe77b['variable']){if(_0x1fe77b[_0x50ab('0x28')]['hasOwnProperty'](_0x2b581b)){this['channels'][_0x1fe77b['uniqueid']][_0x2b581b]=_0x1fe77b['value'];}}}};Fax[_0x50ab('0x1e')][_0x50ab('0x2c')]=function(_0x1b4155){if(this[_0x50ab('0xe')][_0x1b4155[_0x50ab('0x23')]]){this[_0x50ab('0xe')][_0x1b4155[_0x50ab('0x23')]]['operation']=_0x1b4155[_0x50ab('0x2d')];this['channels'][_0x1b4155['uniqueid']]['status']=_0x1b4155[_0x50ab('0x2e')];this[_0x50ab('0xe')][_0x1b4155[_0x50ab('0x23')]][_0x50ab('0x22')]=_0x1b4155[_0x50ab('0x22')];this[_0x50ab('0xe')][_0x1b4155['uniqueid']][_0x50ab('0x2f')]=_0x1b4155[_0x50ab('0x2f')];logger[_0x50ab('0x26')](_0x1b4155['uniqueid'],_0x50ab('0x30'));}};Fax[_0x50ab('0x1e')][_0x50ab('0x1b')]=function(_0x260a34){var _0x589959=this;if(this[_0x50ab('0xe')][_0x260a34[_0x50ab('0x23')]]){var _0x4c9f6d=this[_0x50ab('0xe')][_0x260a34[_0x50ab('0x23')]]['id'];this['channels'][_0x260a34[_0x50ab('0x23')]]['remotestationid']=_0x260a34[_0x50ab('0x31')];this[_0x50ab('0xe')][_0x260a34['uniqueid']][_0x50ab('0x32')]=_0x260a34[_0x50ab('0x32')];this[_0x50ab('0xe')][_0x260a34[_0x50ab('0x23')]]['localstationid']=_0x260a34[_0x50ab('0x22')];this[_0x50ab('0xe')][_0x260a34[_0x50ab('0x23')]][_0x50ab('0x33')]=_0x260a34[_0x50ab('0x33')];this['channels'][_0x260a34[_0x50ab('0x23')]][_0x50ab('0x34')]=_0x260a34[_0x50ab('0x34')];this['channels'][_0x260a34['uniqueid']][_0x50ab('0x2f')]=_0x260a34[_0x50ab('0x2f')];this[_0x50ab('0xe')][_0x260a34[_0x50ab('0x23')]][_0x50ab('0x35')]=_0x260a34[_0x50ab('0x35')];if(this['channels'][_0x260a34['uniqueid']][_0x50ab('0x32')]>0x0){tiff2pdf(_0x260a34['filename'],_0x50ab('0x36'),function(_0x156fa3){logger['info'](_0x260a34['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x156fa3[_0x50ab('0x37')]);attachment[_0x50ab('0x38')]({'name':path[_0x50ab('0x39')](_0x260a34[_0x50ab('0x2f')])[_0x50ab('0x25')],'basename':path[_0x50ab('0x39')](_0x260a34['filename'])[_0x50ab('0x25')]+_0x50ab('0x3a'),'type':_0x50ab('0x3b')})[_0x50ab('0x3c')](function(_0x3f8446){faxAccount['notify'](_0x4c9f6d,{'from':_0x260a34[_0x50ab('0x35')],'mapKey':_0x50ab('0x6'),'body':path['parse'](_0x260a34['filename'])[_0x50ab('0x25')]+_0x50ab('0x3a'),'AttachmentId':_0x3f8446['id']})[_0x50ab('0x3d')](function(_0x432f8d){logger['error'](_0x260a34[_0x50ab('0x23')],_0x50ab('0x3e'),JSON['stringify'](_0x432f8d));});})[_0x50ab('0x3d')](function(_0x37c9e1){logger[_0x50ab('0x3f')](_0x260a34[_0x50ab('0x23')],_0x50ab('0x40'),JSON['stringify'](_0x37c9e1));});});}logger[_0x50ab('0x26')](_0x260a34[_0x50ab('0x23')],_0x50ab('0x40'));}};Fax['prototype'][_0x50ab('0x41')]=function(_0x5afcbb){if(this[_0x50ab('0x11')][_0x5afcbb[_0x50ab('0x23')]]){_['merge'](this[_0x50ab('0xe')][_0x5afcbb[_0x50ab('0x23')]],_[_0x50ab('0x42')](_0x5afcbb,[_0x50ab('0x43'),_0x50ab('0x44')]));}};function updateStatus(_0x57c8a0){if(_0x57c8a0[_0x50ab('0x45')]){faxMessage[_0x50ab('0x46')](_0x57c8a0['AttachmentId'],{'failMessage':_0x50ab('0x47')})[_0x50ab('0x3c')](function(_0x140054){ut[_0x50ab('0x48')]('[Fax][Message][Error][Updated]',_0x140054);})[_0x50ab('0x3d')](function(_0x4d158c){ut['logger'](_0x50ab('0x49'),_0x4d158c);});}else{ut[_0x50ab('0x48')](_0x50ab('0x4a'));}}Fax[_0x50ab('0x1e')][_0x50ab('0x4b')]=function(_0x212a9b,_0x52062d,_0x57ffa2){var _0x59bb9e=this;var _0x1523d7={};if(_0x52062d){_0x1523d7={'read':_0x52062d};}else{_0x1523d7={'failMessage':_0x57ffa2};}if(this[_0x50ab('0x11')][_0x212a9b]['AttachmentId']){faxMessage[_0x50ab('0x46')](this[_0x50ab('0x11')][_0x212a9b][_0x50ab('0x45')],_0x1523d7)[_0x50ab('0x3c')](function(_0x23c5b8){ut['logger']('[Fax][Message][Updated]',_0x23c5b8);})[_0x50ab('0x3d')](function(_0x5107dd){ut['logger']('[Fax][Message][NoUpdate1]',_0x5107dd);})[_0x50ab('0x4c')](function(){delete _0x59bb9e[_0x50ab('0xe')][_0x212a9b];delete _0x59bb9e['actions'][_0x212a9b];});}else{ut['logger'](_0x50ab('0x4d'));delete this['channels'][_0x212a9b];delete this[_0x50ab('0x11')][_0x212a9b];}};Fax[_0x50ab('0x1e')][_0x50ab('0x4e')]=function(_0x7e00d7){var _0x24b63f=this;if(this['channels'][_0x7e00d7['uniqueid']]){if(this[_0x50ab('0x11')][_0x7e00d7[_0x50ab('0x23')]]){this[_0x50ab('0xe')][_0x7e00d7[_0x50ab('0x23')]]['id']=this[_0x50ab('0x11')][_0x7e00d7[_0x50ab('0x23')]]['id'];this[_0x50ab('0xe')][_0x7e00d7[_0x50ab('0x23')]]['name']=this['actions'][_0x7e00d7[_0x50ab('0x23')]][_0x50ab('0x25')];}logger['info'](_0x7e00d7[_0x50ab('0x23')],this[_0x50ab('0x11')][_0x7e00d7[_0x50ab('0x23')]]?_0x50ab('0x4f'):_0x50ab('0x50'),JSON[_0x50ab('0x51')](this[_0x50ab('0xe')][_0x7e00d7[_0x50ab('0x23')]]));if(this['actions'][_0x7e00d7[_0x50ab('0x23')]]){if(this[_0x50ab('0xe')][_0x7e00d7[_0x50ab('0x23')]]['faxpages']>0x0&&this[_0x50ab('0xe')][_0x7e00d7[_0x50ab('0x23')]][_0x50ab('0x19')]==='SUCCESS'){this[_0x50ab('0x4b')](_0x7e00d7['uniqueid'],!![]);}else{this[_0x50ab('0x4b')](_0x7e00d7['uniqueid'],![],this[_0x50ab('0xe')][_0x7e00d7[_0x50ab('0x23')]][_0x50ab('0x52')]?'SENDING\x20FAILED:\x20'+this[_0x50ab('0xe')][_0x7e00d7['uniqueid']][_0x50ab('0x52')]:_0x50ab('0x53'));}}}};Fax[_0x50ab('0x1e')][_0x50ab('0x54')]=function(_0x5c415a){var _0x3ff679=this;return new BPromise(function(_0x31f6d0,_0x166600){_0x3ff679[_0x50ab('0x55')](_0x5c415a,_0x3ff679[_0x50ab('0xf')][_0x5c415a['FaxAccountId']])[_0x50ab('0x3c')](function(_0x16de40){ut['logger'](_0x50ab('0x56'),_0x16de40);_0x31f6d0(ut[_0x50ab('0x37')]('Fax\x20received'));})[_0x50ab('0x3d')](function(_0x35c79b){ut[_0x50ab('0x48')](_0x50ab('0x57'),_0x35c79b);updateStatus(_0x5c415a);_0x166600(ut[_0x50ab('0x37')](_0x50ab('0x58')));});});};Fax[_0x50ab('0x1e')][_0x50ab('0x59')]=function(_0x4735d9){var _0x7e0ad=this;return new BPromise(function(_0x1d9669,_0x211a81){var _0x5a2b2=_0x7e0ad[_0x50ab('0x5a')](_0x7e0ad[_0x50ab('0xf')][_0x4735d9['FaxAccountId']]['Trunk'],_0x4735d9);if(_0x5a2b2[_0x50ab('0x5b')]){_0x1d9669(ut[_0x50ab('0x37')](_0x50ab('0x5c')));}else{_0x211a81(ut[_0x50ab('0x37')](_0x5a2b2[_0x50ab('0x37')]));}});};function originate(_0x26334d,_0x1a9bef,_0x11ab7e){return new BPromise(function(_0x1058a0,_0x1cd670){if(_0x11ab7e){var _0x2a92e1=util[_0x50ab('0x5d')](_0x50ab('0x5e'),path[_0x50ab('0x39')](_0x26334d['path'])[_0x50ab('0x25')],_0x26334d[_0x50ab('0x4')]);gs[_0x50ab('0x5f')](_0x2a92e1)['then'](function(){_0x26334d['path']=util[_0x50ab('0x5d')]('%s/%s.tif',path[_0x50ab('0x39')](_0x26334d['path'])[_0x50ab('0x60')],path[_0x50ab('0x39')](_0x26334d[_0x50ab('0x4')])[_0x50ab('0x25')]);_0x1a9bef[_0x50ab('0x61')]=_0x26334d[_0x50ab('0x4')];ut[_0x50ab('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0x50ab('0x62')](ut[_0x50ab('0x63')](_0x26334d,_0x1a9bef))[_0x50ab('0x3c')](function(_0x4892e8){_0x1058a0(_0x4892e8);})[_0x50ab('0x3d')](function(_0x2c8abc){_0x1cd670(_0x2c8abc);});})['catch'](function(_0x4a409c){_0x1cd670(_0x4a409c);});}else{ami['Action'](ut[_0x50ab('0x63')](_0x26334d,_0x1a9bef))[_0x50ab('0x3c')](function(_0x5e3b2c){_0x1058a0(_0x5e3b2c);})[_0x50ab('0x3d')](function(_0x170082){_0x1cd670(_0x170082);});}});}Fax[_0x50ab('0x1e')]['execOriginate']=function(_0x52a1e4,_0x374722){var _0x14594d=this;return new BPromise(function(_0x14a2a6,_0x189788){var _0x5bf411=uuid['v4']();var _0x3f974c=ut[_0x50ab('0x64')](_0x52a1e4,_0x374722);_0x14594d[_0x50ab('0x11')][_0x5bf411]=new Action(_0x5bf411,_0x374722,_0x52a1e4);var _0x2d6810=_0x14594d[_0x50ab('0x11')][_0x5bf411];if(path[_0x50ab('0x39')](_0x52a1e4['path'])[_0x50ab('0x65')]===_0x50ab('0x3a')){originate(_0x2d6810,_0x3f974c,!![])[_0x50ab('0x3c')](function(_0x29aa24){_0x14a2a6(_0x29aa24);})['catch'](function(_0x1db27c){_0x189788(_0x1db27c);});}else{originate(_0x2d6810,_0x3f974c,![])[_0x50ab('0x3c')](function(_0x40da41){_0x14a2a6(_0x40da41);})[_0x50ab('0x3d')](function(_0x55ef99){_0x189788(_0x55ef99);});}});};Fax[_0x50ab('0x1e')][_0x50ab('0x66')]=function(_0x1ee59d){return!_[_0x50ab('0x67')](_0x1ee59d)&&!_[_0x50ab('0x67')](_0x1ee59d['name'])&&!_[_0x50ab('0x67')](_0x1ee59d[_0x50ab('0x68')])&&_0x1ee59d[_0x50ab('0x68')]&&!_[_0x50ab('0x67')](this[_0x50ab('0x10')][util[_0x50ab('0x5d')](_0x50ab('0x69'),_0x1ee59d[_0x50ab('0x25')])])&&!_[_0x50ab('0x67')](this[_0x50ab('0x10')][util['format'](_0x50ab('0x69'),_0x1ee59d['name'])]['status'])&&(this[_0x50ab('0x10')][util['format']('SIP/%s',_0x1ee59d[_0x50ab('0x25')])][_0x50ab('0x2e')]===_0x50ab('0x6a')||this['trunks'][util[_0x50ab('0x5d')](_0x50ab('0x69'),_0x1ee59d[_0x50ab('0x25')])][_0x50ab('0x2e')]===_0x50ab('0x6b'));};Fax[_0x50ab('0x1e')][_0x50ab('0x5a')]=function(_0x5a2712,_0x3c94aa){if(!this['isTrunkReachable'](_0x5a2712)){ut['logger'](_0x50ab('0x6c'),_['isNil'](_0x5a2712)?'':_0x5a2712[_0x50ab('0x25')]+_0x50ab('0x6d'));return{'isValid':![],'message':_0x50ab('0x6e')};}if(_[_0x50ab('0x67')](_0x3c94aa[_0x50ab('0x6')])){ut[_0x50ab('0x48')](_0x50ab('0x6f'),JSON['stringify'](_0x3c94aa));return{'isValid':![],'message':_0x50ab('0x70')};}if(_[_0x50ab('0x67')](_0x3c94aa[_0x50ab('0x4')])){ut[_0x50ab('0x48')](_0x50ab('0x71'),JSON['stringify'](_0x3c94aa));return{'isValid':![],'message':_0x50ab('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x50ab('0x73')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index e9cbce3..7bfc5af 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 _0x4599=['preview','error','inspect','notify','resolve','then','catch','util','../../../config/logger'];(function(_0x207758,_0x28b3ca){var _0x4936ce=function(_0x2d270d){while(--_0x2d270d){_0x207758['push'](_0x207758['shift']());}};_0x4936ce(++_0x28b3ca);}(_0x4599,0x73));var _0x9459=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4599[_0x2641f9];return _0x585741;};'use strict';var util=require(_0x9459('0x0'));var BPromise=require('bluebird');var logger=require(_0x9459('0x1'))(_0x9459('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x56d458){return function(_0x6190b8){logger[_0x9459('0x3')](_0x56d458,util[_0x9459('0x4')](_0x6190b8,{'showHidden':![],'depth':null}));};}exports[_0x9459('0x5')]=function(_0x22060a,_0x33eaac){return BPromise[_0x9459('0x6')]()[_0x9459('0x7')](faxAccount[_0x9459('0x5')](_0x22060a,_0x33eaac))[_0x9459('0x8')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x4748=['catch','[Notify]\x20','util','lodash','error','notify','then'];(function(_0x811254,_0x977440){var _0x215443=function(_0xb5babb){while(--_0xb5babb){_0x811254['push'](_0x811254['shift']());}};_0x215443(++_0x977440);}(_0x4748,0x14b));var _0x8474=function(_0x4bce55,_0x2e92e6){_0x4bce55=_0x4bce55-0x0;var _0x2b0f84=_0x4748[_0x4bce55];return _0x2b0f84;};'use strict';var util=require(_0x8474('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var _=require(_0x8474('0x1'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x6a43de){return function(_0x2f27f5){logger[_0x8474('0x2')](_0x6a43de,util['inspect'](_0x2f27f5,{'showHidden':![],'depth':null}));};}exports[_0x8474('0x3')]=function(_0x2fed72,_0x1fa168){return BPromise['resolve']()[_0x8474('0x4')](faxAccount[_0x8474('0x3')](_0x2fed72,_0x1fa168))[_0x8474('0x5')](loggerCatch(_0x8474('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 b713944..731ef59 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 _0x9a9a=['\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs'];(function(_0x52cbe0,_0x332b2e){var _0x4bb9da=function(_0x4f8008){while(--_0x4f8008){_0x52cbe0['push'](_0x52cbe0['shift']());}};_0x4bb9da(++_0x332b2e);}(_0x9a9a,0x14c));var _0xa9a9=function(_0x23da2e,_0xbef673){_0x23da2e=_0x23da2e-0x0;var _0x75b205=_0x9a9a[_0x23da2e];return _0x75b205;};'use strict';var util=require(_0xa9a9('0x0'));var logger=require(_0xa9a9('0x1'))(_0xa9a9('0x2'));var BPromise=require(_0xa9a9('0x3'));var exec=require(_0xa9a9('0x4'))[_0xa9a9('0x5')];exports[_0xa9a9('0x6')]=function(_0xb2bde1){return new BPromise(function(_0x5b43a1,_0x443aba){exec(_0xb2bde1,function(_0x446ce0,_0x573016,_0x5b75ef){logger[_0xa9a9('0x7')]('Exec\x20gs',_0x573016);if(_0x446ce0){logger['info'](_0xa9a9('0x8'),_0xa9a9('0x9'),util[_0xa9a9('0xa')](_0x446ce0,{'showHidden':![],'depth':null}),_0x573016,_0x5b75ef);_0x443aba(_0x446ce0);}_0x5b43a1(_0x573016);});});}; \ No newline at end of file +var _0x984c=['Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','bluebird','child_process','exec','execute','info'];(function(_0x2afb95,_0x544984){var _0x1c44ba=function(_0x36d4fe){while(--_0x36d4fe){_0x2afb95['push'](_0x2afb95['shift']());}};_0x1c44ba(++_0x544984);}(_0x984c,0x1e0));var _0xc984=function(_0x3dbf83,_0x2a7210){_0x3dbf83=_0x3dbf83-0x0;var _0x3b6b9e=_0x984c[_0x3dbf83];return _0x3b6b9e;};'use strict';var util=require('util');var logger=require(_0xc984('0x0'))('fax');var BPromise=require(_0xc984('0x1'));var exec=require(_0xc984('0x2'))[_0xc984('0x3')];exports[_0xc984('0x4')]=function(_0xe8b741){return new BPromise(function(_0x5d3bb3,_0xb5c759){exec(_0xe8b741,function(_0x10827f,_0x40777d,_0x26d19a){logger[_0xc984('0x5')](_0xc984('0x6'),_0x40777d);if(_0x10827f){logger[_0xc984('0x5')](_0xc984('0x6'),_0xc984('0x7'),util[_0xc984('0x8')](_0x10827f,{'showHidden':![],'depth':null}),_0x40777d,_0x26d19a);_0xb5c759(_0x10827f);}_0x5d3bb3(_0x40777d);});});}; \ 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 1dbee4c..c7cd361 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 _0xd1e3=['ecm','headerinfo','minrate','maxrate','modem','gateway','faxdetect','t38timeout','localstationid','uniqueid','channel','format','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger','inspect'];(function(_0x1ec857,_0x302c86){var _0x31017a=function(_0xac565e){while(--_0xac565e){_0x1ec857['push'](_0x1ec857['shift']());}};_0x31017a(++_0x302c86);}(_0xd1e3,0xf4));var _0x3d1e=function(_0x233d00,_0x41a7bb){_0x233d00=_0x233d00-0x0;var _0x4296f7=_0xd1e3[_0x233d00];return _0x4296f7;};'use strict';var util=require(_0x3d1e('0x0'));var _=require(_0x3d1e('0x1'));var moment=require(_0x3d1e('0x2'));var logger=require(_0x3d1e('0x3'))(_0x3d1e('0x4'));exports[_0x3d1e('0x5')]=function(_0x1a96b2){return{'message':_0x1a96b2};};exports[_0x3d1e('0x6')]=function(_0x13a814,_0x23a5f4){logger['info'](_0x13a814,util[_0x3d1e('0x7')](_0x23a5f4,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x5b296c,_0x156254){var _0x1aa332={'XMF-ECM':_0x156254[_0x3d1e('0x8')],'XMF-HEADERINFO':_0x156254[_0x3d1e('0x9')],'XMF-MINRATE':_0x156254[_0x3d1e('0xa')],'XMF-MAXRATE':_0x156254[_0x3d1e('0xb')],'XMF-MODEM':util['format']('\x22%s\x22',_0x156254[_0x3d1e('0xc')]),'XMF-GATEWAY':_0x156254[_0x3d1e('0xd')],'XMF-FAXDETECT':_0x156254[_0x3d1e('0xe')],'XMF-T38TIMEOUT':_0x156254[_0x3d1e('0xf')],'XMF-LOCALSTATIONID':_0x156254[_0x3d1e('0x10')],'XMF-PATH':_0x5b296c['path']};return _0x1aa332;};exports['variablesAction']=function(_0x5138ea,_0x43e9be){return{'actionid':_0x5138ea[_0x3d1e('0x11')],'action':'originate','channel':_0x5138ea[_0x3d1e('0x12')],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0x3d1e('0x13')](_0x3d1e('0x14'),_0x5138ea[_0x3d1e('0x9')]?_0x5138ea[_0x3d1e('0x9')]:'',_0x5138ea[_0x3d1e('0x10')]),'variable':_0x43e9be,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5138ea[_0x3d1e('0x11')]};}; \ No newline at end of file +var _0x98ea=['variablesAction','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','../../../../config/logger','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','format','modem','gateway','faxdetect','t38timeout','localstationid','path'];(function(_0x1c8631,_0x2b2119){var _0x473f95=function(_0x3b367b){while(--_0x3b367b){_0x1c8631['push'](_0x1c8631['shift']());}};_0x473f95(++_0x2b2119);}(_0x98ea,0x164));var _0xa98e=function(_0x22b68f,_0x3fe302){_0x22b68f=_0x22b68f-0x0;var _0x4999fe=_0x98ea[_0x22b68f];return _0x4999fe;};'use strict';var util=require(_0xa98e('0x0'));var _=require(_0xa98e('0x1'));var moment=require(_0xa98e('0x2'));var logger=require(_0xa98e('0x3'))('fax');exports[_0xa98e('0x4')]=function(_0xeef5e2){return{'message':_0xeef5e2};};exports[_0xa98e('0x5')]=function(_0x23bee5,_0x3fb5a0){logger[_0xa98e('0x6')](_0x23bee5,util[_0xa98e('0x7')](_0x3fb5a0,{'showHidden':![],'depth':null}));};exports[_0xa98e('0x8')]=function(_0x3c3893,_0x4d8ff0){var _0xe25b2b={'XMF-ECM':_0x4d8ff0[_0xa98e('0x9')],'XMF-HEADERINFO':_0x4d8ff0[_0xa98e('0xa')],'XMF-MINRATE':_0x4d8ff0[_0xa98e('0xb')],'XMF-MAXRATE':_0x4d8ff0['maxrate'],'XMF-MODEM':util[_0xa98e('0xc')]('\x22%s\x22',_0x4d8ff0[_0xa98e('0xd')]),'XMF-GATEWAY':_0x4d8ff0[_0xa98e('0xe')],'XMF-FAXDETECT':_0x4d8ff0[_0xa98e('0xf')],'XMF-T38TIMEOUT':_0x4d8ff0[_0xa98e('0x10')],'XMF-LOCALSTATIONID':_0x4d8ff0[_0xa98e('0x11')],'XMF-PATH':_0x3c3893[_0xa98e('0x12')]};return _0xe25b2b;};exports[_0xa98e('0x13')]=function(_0x1fd92d,_0x592e45){return{'actionid':_0x1fd92d['uniqueid'],'action':_0xa98e('0x14'),'channel':_0x1fd92d['channel'],'Exten':_0xa98e('0x15'),'Context':_0xa98e('0x16'),'Priority':'1','callerid':util['format'](_0xa98e('0x17'),_0x1fd92d[_0xa98e('0xa')]?_0x1fd92d['headerinfo']:'',_0x1fd92d[_0xa98e('0x11')]),'variable':_0x592e45,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1fd92d[_0xa98e('0x18')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 372017f..8bc3f02 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 _0xc554=['ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','util','moment','./report','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xc554,0x10c));var _0x4c55=function(_0x130719,_0x2a7018){_0x130719=_0x130719-0x0;var _0x159865=_0xc554[_0x130719];return _0x159865;};'use strict';var util=require(_0x4c55('0x0'));var moment=require(_0x4c55('0x1'));var server=require('./server');var Realtime=require('./realtime');var Report=require(_0x4c55('0x2'));var Acw=require('./acw');var Trigger=require(_0x4c55('0x3'));var Dialer=require(_0x4c55('0x4'));var Preview=require('./preview');var Fax=require(_0x4c55('0x5'));var user=require(_0x4c55('0x6'));var voiceQueue=require(_0x4c55('0x7'));var voiceQueueReport=require(_0x4c55('0x8'));var voiceCallReport=require(_0x4c55('0x9'));var trunk=require(_0x4c55('0xa'));var trigger=require(_0x4c55('0xb'));var template=require(_0x4c55('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x4c55('0xd'));var faxAccount=require(_0x4c55('0xe'));var zendesk=require(_0x4c55('0xf'));var salesforce=require(_0x4c55('0x10'));var sugarcrm=require(_0x4c55('0x11'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x4c55('0x12'));var zoho=require(_0x4c55('0x13'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x4c55('0x14'));var servicenow=require(_0x4c55('0x15'));var dynamics365=require(_0x4c55('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(_0x4c55('0x17'))(_0x4c55('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x4c55('0x19')](_0x4c55('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x4c55('0x19')](_0x4c55('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x4c55('0x1b')]()[_0x4c55('0x1c')](user[_0x4c55('0x1d')]())[_0x4c55('0x1c')](realtime[_0x4c55('0x1e')]())[_0x4c55('0x1c')](user[_0x4c55('0x1f')]())[_0x4c55('0x1c')](realtime[_0x4c55('0x20')]())['then'](trunk[_0x4c55('0x21')]())[_0x4c55('0x1c')](realtime[_0x4c55('0x22')]())[_0x4c55('0x1c')](voiceQueue[_0x4c55('0x23')]())[_0x4c55('0x1c')](realtime[_0x4c55('0x24')]())[_0x4c55('0x1c')](trigger[_0x4c55('0x25')]())[_0x4c55('0x1c')](realtime[_0x4c55('0x26')]())[_0x4c55('0x1c')](template[_0x4c55('0x27')]())['then'](realtime[_0x4c55('0x28')]())[_0x4c55('0x1c')](zendesk[_0x4c55('0x29')]())[_0x4c55('0x1c')](realtime[_0x4c55('0x2a')]())[_0x4c55('0x1c')](salesforce[_0x4c55('0x2b')]())[_0x4c55('0x1c')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x4c55('0x2c')]())[_0x4c55('0x1c')](realtime[_0x4c55('0x2d')]())[_0x4c55('0x1c')](freshdesk['getFreshdeskAccounts']())[_0x4c55('0x1c')](realtime[_0x4c55('0x2e')]())['then'](desk[_0x4c55('0x2f')]())[_0x4c55('0x1c')](realtime[_0x4c55('0x30')]())[_0x4c55('0x1c')](zoho[_0x4c55('0x31')]())[_0x4c55('0x1c')](realtime[_0x4c55('0x32')]())[_0x4c55('0x1c')](vtiger[_0x4c55('0x33')]())['then'](realtime['initVtigerAccounts']())[_0x4c55('0x1c')](freshsales[_0x4c55('0x34')]())[_0x4c55('0x1c')](realtime['initFreshsalesAccounts']())[_0x4c55('0x1c')](servicenow[_0x4c55('0x35')]())[_0x4c55('0x1c')](realtime[_0x4c55('0x36')]())[_0x4c55('0x1c')](dynamics365[_0x4c55('0x37')]())['then'](realtime[_0x4c55('0x38')]())['then'](campaign[_0x4c55('0x39')]())[_0x4c55('0x1c')](realtime[_0x4c55('0x3a')]())[_0x4c55('0x1c')](voiceExtension[_0x4c55('0x3b')]())[_0x4c55('0x1c')](realtime[_0x4c55('0x3c')]())['then'](faxAccount[_0x4c55('0x3d')]())['then'](realtime[_0x4c55('0x3e')]())[_0x4c55('0x1c')](function(){return realtime;});}function initParams(){return Promise[_0x4c55('0x1b')]()['then'](voiceQueueReport[_0x4c55('0x3f')]())[_0x4c55('0x1c')](realtime[_0x4c55('0x40')]())[_0x4c55('0x1c')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime['initVoiceQueueHopperHistory']())[_0x4c55('0x1c')](cmHopperHistory['getCampaignHopperHistory']())[_0x4c55('0x1c')](realtime[_0x4c55('0x41')]())[_0x4c55('0x1c')](voiceCallReport[_0x4c55('0x42')]())[_0x4c55('0x1c')](realtime[_0x4c55('0x43')]())[_0x4c55('0x44')](function(_0x1d85c0){logger[_0x4c55('0x45')](_0x4c55('0x46'),util[_0x4c55('0x47')](_0x1d85c0,{'showHidden':![],'depth':null}));});}function main(){return server[_0x4c55('0x48')](realtime,preview,fax)[_0x4c55('0x1c')](function(){return initRealtime();})[_0x4c55('0x1c')](function(){return initParams();})[_0x4c55('0x1c')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x4c55('0x44')](function(_0x14a508){logger['error']('[index.js][main]',util[_0x4c55('0x47')](_0x14a508,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xb836=['initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','inspect','listen','sync','catch','util','moment','./server','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','../../config/logger','ami','hour','get','resolve','then','getAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb836,0xe9));var _0x6b83=function(_0x3581a0,_0x2b43df){_0x3581a0=_0x3581a0-0x0;var _0x2c1b4b=_0xb836[_0x3581a0];return _0x2c1b4b;};'use strict';var util=require(_0x6b83('0x0'));var moment=require(_0x6b83('0x1'));var server=require(_0x6b83('0x2'));var Realtime=require(_0x6b83('0x3'));var Report=require(_0x6b83('0x4'));var Acw=require(_0x6b83('0x5'));var Trigger=require(_0x6b83('0x6'));var Dialer=require('./dialer');var Preview=require(_0x6b83('0x7'));var Fax=require(_0x6b83('0x8'));var user=require(_0x6b83('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x6b83('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x6b83('0xb'));var trigger=require(_0x6b83('0xc'));var template=require(_0x6b83('0xd'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x6b83('0xe'));var faxAccount=require(_0x6b83('0xf'));var zendesk=require(_0x6b83('0x10'));var salesforce=require(_0x6b83('0x11'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x6b83('0x12'));var desk=require(_0x6b83('0x13'));var zoho=require(_0x6b83('0x14'));var vtiger=require(_0x6b83('0x15'));var freshsales=require(_0x6b83('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x6b83('0x17'))(_0x6b83('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x6b83('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6b83('0x1a')](_0x6b83('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x6b83('0x1b')]()[_0x6b83('0x1c')](user[_0x6b83('0x1d')]())[_0x6b83('0x1c')](realtime['initAgents']())[_0x6b83('0x1c')](user[_0x6b83('0x1e')]())['then'](realtime[_0x6b83('0x1f')]())[_0x6b83('0x1c')](trunk[_0x6b83('0x20')]())[_0x6b83('0x1c')](realtime[_0x6b83('0x21')]())[_0x6b83('0x1c')](voiceQueue[_0x6b83('0x22')]())[_0x6b83('0x1c')](realtime[_0x6b83('0x23')]())['then'](trigger[_0x6b83('0x24')]())[_0x6b83('0x1c')](realtime['initTriggers']())[_0x6b83('0x1c')](template[_0x6b83('0x25')]())[_0x6b83('0x1c')](realtime[_0x6b83('0x26')]())['then'](zendesk['getZendeskAccounts']())[_0x6b83('0x1c')](realtime[_0x6b83('0x27')]())['then'](salesforce[_0x6b83('0x28')]())[_0x6b83('0x1c')](realtime[_0x6b83('0x29')]())[_0x6b83('0x1c')](sugarcrm[_0x6b83('0x2a')]())['then'](realtime[_0x6b83('0x2b')]())[_0x6b83('0x1c')](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x6b83('0x2c')]())[_0x6b83('0x1c')](desk[_0x6b83('0x2d')]())[_0x6b83('0x1c')](realtime[_0x6b83('0x2e')]())[_0x6b83('0x1c')](zoho[_0x6b83('0x2f')]())[_0x6b83('0x1c')](realtime[_0x6b83('0x30')]())[_0x6b83('0x1c')](vtiger[_0x6b83('0x31')]())[_0x6b83('0x1c')](realtime[_0x6b83('0x32')]())[_0x6b83('0x1c')](freshsales[_0x6b83('0x33')]())[_0x6b83('0x1c')](realtime[_0x6b83('0x34')]())['then'](servicenow[_0x6b83('0x35')]())[_0x6b83('0x1c')](realtime[_0x6b83('0x36')]())[_0x6b83('0x1c')](dynamics365['getDynamics365Accounts']())['then'](realtime['initDynamics365Accounts']())[_0x6b83('0x1c')](campaign[_0x6b83('0x37')]())[_0x6b83('0x1c')](realtime[_0x6b83('0x38')]())[_0x6b83('0x1c')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0x6b83('0x39')]())[_0x6b83('0x1c')](faxAccount[_0x6b83('0x3a')]())[_0x6b83('0x1c')](realtime[_0x6b83('0x3b')]())[_0x6b83('0x1c')](function(){return realtime;});}function initParams(){return Promise[_0x6b83('0x1b')]()[_0x6b83('0x1c')](voiceQueueReport[_0x6b83('0x3c')]())['then'](realtime[_0x6b83('0x3d')]())[_0x6b83('0x1c')](cmHopperHistory[_0x6b83('0x3e')]())['then'](realtime[_0x6b83('0x3f')]())[_0x6b83('0x1c')](cmHopperHistory[_0x6b83('0x40')]())[_0x6b83('0x1c')](realtime[_0x6b83('0x41')]())['then'](voiceCallReport[_0x6b83('0x42')]())[_0x6b83('0x1c')](realtime[_0x6b83('0x43')]())['catch'](function(_0x481b52){logger[_0x6b83('0x44')](_0x6b83('0x45'),util[_0x6b83('0x46')](_0x481b52,{'showHidden':![],'depth':null}));});}function main(){return server[_0x6b83('0x47')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x6b83('0x1c')](function(){return initParams();})[_0x6b83('0x1c')](function(){report[_0x6b83('0x48')]();setInterval(initRealtime,0x1388);})[_0x6b83('0x49')](function(_0x5c8792){logger[_0x6b83('0x44')]('[index.js][main]',util[_0x6b83('0x46')](_0x5c8792,{'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 57f5039..3c8f584 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 _0xf218=['statePause','format','voiceStatusQueue','onhold','stringify','md5','user:%s','emit','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','prototype','updateStatusRealtime','toLowerCase','idle','inuse','talking'];(function(_0x3f86bd,_0x571513){var _0xa1bcc3=function(_0x214a4e){while(--_0x214a4e){_0x3f86bd['push'](_0x3f86bd['shift']());}};_0xa1bcc3(++_0x571513);}(_0xf218,0xa9));var _0x8f21=function(_0x2b0267,_0x59cab1){_0x2b0267=_0x2b0267-0x0;var _0x289a4a=_0xf218[_0x2b0267];return _0x289a4a;};'use strict';var _=require(_0x8f21('0x0'));var util=require(_0x8f21('0x1'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x8f21('0x2'));var config=require(_0x8f21('0x3'));config[_0x8f21('0x4')]=_[_0x8f21('0x5')](config[_0x8f21('0x4')],{'host':_0x8f21('0x6'),'port':0x18eb});var io=require(_0x8f21('0x7'))(new Redis(config[_0x8f21('0x4')]));function Agent(_0x1ad78e){this['id']=_0x1ad78e['id']||0x0;this[_0x8f21('0x8')]=_0x1ad78e[_0x8f21('0x8')]||'';this['email']=_0x1ad78e[_0x8f21('0x9')]||'';this['accountcode']=_0x1ad78e[_0x8f21('0xa')]||'';this[_0x8f21('0xb')]=_0x1ad78e['fullname']||'';this[_0x8f21('0xc')]=_0x8f21('0xd');this[_0x8f21('0xe')]=0x0;this[_0x8f21('0xf')]=_0x8f21('0xd');this[_0x8f21('0x10')]='';this[_0x8f21('0x11')]='';this[_0x8f21('0x12')]='';this[_0x8f21('0x13')]='';this[_0x8f21('0x14')]=_0x1ad78e[_0x8f21('0x14')]||![];this[_0x8f21('0x15')]=_0x8f21('0xd');this[_0x8f21('0x16')]=0x0;this[_0x8f21('0x17')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x8f21('0x18')]=![];this['md5']='';}Agent[_0x8f21('0x19')][_0x8f21('0x1a')]=function(_0x4d16f0){var _0x539602;if(_0x4d16f0&&_0x4d16f0[_0x8f21('0xc')]){_0x539602=_0x4d16f0[_0x8f21('0xc')][_0x8f21('0x1b')]();switch(_0x539602){case'not_inuse':_0x539602=_0x8f21('0x1c');break;case _0x8f21('0x1d'):_0x539602=_0x8f21('0x1e');break;}}if(_0x539602&&this[_0x8f21('0x15')]!==_0x539602||_0x4d16f0[_0x8f21('0x1f')]){this[_0x8f21('0x16')]=_['toNumber'](moment()[_0x8f21('0x20')]('x'));}if(_0x539602){this['voiceStatus']=_0x539602;}var _0x3a9226={'id':this['id'],'name':this[_0x8f21('0x8')],'email':this[_0x8f21('0x9')],'accountcode':this[_0x8f21('0xa')],'fullname':this['fullname'],'state':this['state'],'stateTime':this[_0x8f21('0xe')],'status':this['status'],'address':this[_0x8f21('0x10')],'online':this[_0x8f21('0x14')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x8f21('0x21')],'interface':this['interface'],'onhold':this[_0x8f21('0x22')]};var _0x2ce2fb=md5(JSON[_0x8f21('0x23')](_0x3a9226));if(this[_0x8f21('0x24')]!==_0x2ce2fb){this['md5']=_0x2ce2fb;io['to'](util['format'](_0x8f21('0x25'),_0x3a9226[_0x8f21('0x8')]))[_0x8f21('0x26')]('user:save',_0x3a9226);io[_0x8f21('0x26')]('user:presence',_0x3a9226);}};module[_0x8f21('0x27')]=Agent; \ No newline at end of file +var _0x73df=['onhold','prototype','updateStatusRealtime','not_inuse','idle','inuse','talking','toNumber','format','voiceStatus','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','accountcode','fullname','state','unknown','stateTime','status','address','phone','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue'];(function(_0x56a957,_0x2d392f){var _0x183739=function(_0x4e8dd0){while(--_0x4e8dd0){_0x56a957['push'](_0x56a957['shift']());}};_0x183739(++_0x2d392f);}(_0x73df,0x1bd));var _0xf73d=function(_0x147474,_0x569446){_0x147474=_0x147474-0x0;var _0x11bead=_0x73df[_0x147474];return _0x11bead;};'use strict';var _=require(_0xf73d('0x0'));var util=require(_0xf73d('0x1'));var moment=require('moment');var md5=require(_0xf73d('0x2'));var Redis=require(_0xf73d('0x3'));var config=require(_0xf73d('0x4'));config[_0xf73d('0x5')]=_[_0xf73d('0x6')](config[_0xf73d('0x5')],{'host':_0xf73d('0x7'),'port':0x18eb});var io=require(_0xf73d('0x8'))(new Redis(config[_0xf73d('0x5')]));function Agent(_0x4467ad){this['id']=_0x4467ad['id']||0x0;this[_0xf73d('0x9')]=_0x4467ad[_0xf73d('0x9')]||'';this['email']=_0x4467ad['email']||'';this['accountcode']=_0x4467ad[_0xf73d('0xa')]||'';this[_0xf73d('0xb')]=_0x4467ad[_0xf73d('0xb')]||'';this[_0xf73d('0xc')]=_0xf73d('0xd');this[_0xf73d('0xe')]=0x0;this[_0xf73d('0xf')]=_0xf73d('0xd');this[_0xf73d('0x10')]='';this[_0xf73d('0x11')]='';this['mobile']='';this[_0xf73d('0x12')]='';this[_0xf73d('0x13')]=_0x4467ad[_0xf73d('0x13')]||![];this['voiceStatus']=_0xf73d('0xd');this[_0xf73d('0x14')]=0x0;this[_0xf73d('0x15')]='';this[_0xf73d('0x16')]='';this[_0xf73d('0x17')]=![];this['local']=![];this[_0xf73d('0x2')]='';}Agent[_0xf73d('0x18')][_0xf73d('0x19')]=function(_0x3f0da5){var _0x5003ab;if(_0x3f0da5&&_0x3f0da5[_0xf73d('0xc')]){_0x5003ab=_0x3f0da5[_0xf73d('0xc')]['toLowerCase']();switch(_0x5003ab){case _0xf73d('0x1a'):_0x5003ab=_0xf73d('0x1b');break;case _0xf73d('0x1c'):_0x5003ab=_0xf73d('0x1d');break;}}if(_0x5003ab&&this['voiceStatus']!==_0x5003ab||_0x3f0da5['statePause']){this[_0xf73d('0x14')]=_[_0xf73d('0x1e')](moment()[_0xf73d('0x1f')]('x'));}if(_0x5003ab){this[_0xf73d('0x20')]=_0x5003ab;}var _0x1566ae={'id':this['id'],'name':this[_0xf73d('0x9')],'email':this['email'],'accountcode':this['accountcode'],'fullname':this[_0xf73d('0xb')],'state':this[_0xf73d('0xc')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0xf73d('0x13')],'voiceStatus':this[_0xf73d('0x20')],'voiceStatusTime':this[_0xf73d('0x14')],'voiceStatusCallerIdNumber':this[_0xf73d('0x15')],'voiceStatusQueue':this[_0xf73d('0x16')],'interface':this[_0xf73d('0x12')],'onhold':this['onhold']};var _0x345b16=md5(JSON[_0xf73d('0x21')](_0x1566ae));if(this['md5']!==_0x345b16){this['md5']=_0x345b16;io['to'](util[_0xf73d('0x1f')](_0xf73d('0x22'),_0x1566ae[_0xf73d('0x9')]))[_0xf73d('0x23')](_0xf73d('0x24'),_0x1566ae);io[_0xf73d('0x23')](_0xf73d('0x25'),_0x1566ae);}};module[_0xf73d('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index b132f6e..f190c38 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 _0x0956=['dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','exports','name','type','campaign','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject'];(function(_0x15c5bd,_0x22a19f){var _0x25ad6b=function(_0x10f15d){while(--_0x10f15d){_0x15c5bd['push'](_0x15c5bd['shift']());}};_0x25ad6b(++_0x22a19f);}(_0x0956,0x180));var _0x6095=function(_0x29aa0b,_0x5bc8d8){_0x29aa0b=_0x29aa0b-0x0;var _0x5d69ca=_0x0956[_0x29aa0b];return _0x5d69ca;};'use strict';function Campaign(_0x5088de){this['id']=_0x5088de['id']||0x0;this[_0x6095('0x0')]=_0x5088de[_0x6095('0x0')]||'';this[_0x6095('0x1')]=_0x5088de[_0x6095('0x1')]||_0x6095('0x2');this['originated']=0x0;this['temp']=0x0;this[_0x6095('0x3')]=0x0;this[_0x6095('0x4')]=0x0;this[_0x6095('0x5')]='';this[_0x6095('0x6')]=!![];this[_0x6095('0x7')]=_0x5088de[_0x6095('0x7')];this['limitCalls']=_0x5088de[_0x6095('0x8')];this[_0x6095('0x9')]=_0x5088de[_0x6095('0x9')]||null;this[_0x6095('0xa')]=_0x5088de[_0x6095('0xa')]?_0x5088de[_0x6095('0xa')]:null;this['dialOriginateCallerIdName']=_0x5088de[_0x6095('0xb')];this['dialOriginateCallerIdNumber']=_0x5088de[_0x6095('0xc')];this['dialOriginateTimeout']=_0x5088de[_0x6095('0xd')]||0x1e;this[_0x6095('0xe')]=_0x5088de['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x5088de[_0x6095('0xf')];this[_0x6095('0x10')]=_0x5088de[_0x6095('0x10')];this['dialBusyRetryFrequency']=_0x5088de['dialBusyRetryFrequency'];this[_0x6095('0x11')]=_0x5088de[_0x6095('0x11')];this[_0x6095('0x12')]=_0x5088de[_0x6095('0x12')];this['dialGlobalMaxRetry']=_0x5088de[_0x6095('0x13')];this['dialNoSuchNumberMaxRetry']=_0x5088de[_0x6095('0x14')]||0x3;this[_0x6095('0x15')]=_0x5088de[_0x6095('0x15')]||0x96;this[_0x6095('0x16')]=_0x5088de['dialDropMaxRetry']||0x3;this[_0x6095('0x17')]=_0x5088de[_0x6095('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x5088de[_0x6095('0x18')]||0x3;this[_0x6095('0x19')]=_0x5088de[_0x6095('0x19')]||0x96;this['dialMachineMaxRetry']=_0x5088de[_0x6095('0x1a')]||0x3;this[_0x6095('0x1b')]=_0x5088de[_0x6095('0x1b')]||0x96;this[_0x6095('0x1c')]=_0x5088de['dialAgentRejectMaxRetry']||0x3;this[_0x6095('0x1d')]=_0x5088de[_0x6095('0x1d')]||0x96;this[_0x6095('0x1e')]=_0x5088de['dialOrderByScheduledAt']||_0x6095('0x1f');this['dialPrefix']=_0x5088de[_0x6095('0x20')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x5088de[_0x6095('0x21')]||undefined;this[_0x6095('0x22')]=_0x5088de[_0x6095('0x22')]||undefined;this[_0x6095('0x23')]=_0x5088de[_0x6095('0x23')]?_0x5088de[_0x6095('0x23')]:undefined;this['Trunk']=_0x5088de[_0x6095('0x24')]?_0x5088de['Trunk']:undefined;this[_0x6095('0x25')]=_0x5088de[_0x6095('0x25')]?_0x5088de[_0x6095('0x25')]:undefined;this[_0x6095('0x26')]=_0x5088de[_0x6095('0x26')]?_0x5088de[_0x6095('0x26')]:undefined;this['dialQueueProject']=_0x5088de[_0x6095('0x26')]?_0x5088de[_0x6095('0x26')]['name']:undefined;this['dialAMDActive']=_0x5088de[_0x6095('0x27')]||![];this['dialAMDInitialSilence']=_0x5088de['dialAMDInitialSilence'];this[_0x6095('0x28')]=_0x5088de[_0x6095('0x28')];this[_0x6095('0x29')]=_0x5088de['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x5088de['dialAMDTotalAnalysisTime'];this[_0x6095('0x2a')]=_0x5088de[_0x6095('0x2a')];this['dialAMDBetweenWordsSilence']=_0x5088de[_0x6095('0x2b')];this['dialAMDMaximumNumberOfWords']=_0x5088de[_0x6095('0x2c')];this['dialAMDSilenceThreshold']=_0x5088de['dialAMDSilenceThreshold'];this[_0x6095('0x2d')]=_0x5088de[_0x6095('0x2d')];}module[_0x6095('0x2e')]=Campaign; \ No newline at end of file +var _0x092a=['limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','exports','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive'];(function(_0xf043de,_0x4cd754){var _0xc0c765=function(_0x4229cb){while(--_0x4229cb){_0xf043de['push'](_0xf043de['shift']());}};_0xc0c765(++_0x4cd754);}(_0x092a,0xb4));var _0xa092=function(_0x5814ca,_0x3b6713){_0x5814ca=_0x5814ca-0x0;var _0xeb1833=_0x092a[_0x5814ca];return _0xeb1833;};'use strict';function Campaign(_0x1cf319){this['id']=_0x1cf319['id']||0x0;this['name']=_0x1cf319['name']||'';this[_0xa092('0x0')]=_0x1cf319[_0xa092('0x0')]||_0xa092('0x1');this[_0xa092('0x2')]=0x0;this[_0xa092('0x3')]=0x0;this[_0xa092('0x4')]=0x0;this[_0xa092('0x5')]=0x0;this[_0xa092('0x6')]='';this[_0xa092('0x7')]=!![];this['active']=_0x1cf319['active'];this[_0xa092('0x8')]=_0x1cf319[_0xa092('0x8')];this[_0xa092('0x9')]=_0x1cf319['dialTimezone']||null;this[_0xa092('0xa')]=_0x1cf319[_0xa092('0xa')]?_0x1cf319['dialGlobalInterval']:null;this[_0xa092('0xb')]=_0x1cf319['dialOriginateCallerIdName'];this[_0xa092('0xc')]=_0x1cf319['dialOriginateCallerIdNumber'];this[_0xa092('0xd')]=_0x1cf319[_0xa092('0xd')]||0x1e;this[_0xa092('0xe')]=_0x1cf319[_0xa092('0xe')];this['dialCongestionRetryFrequency']=_0x1cf319['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x1cf319['dialBusyMaxRetry'];this[_0xa092('0xf')]=_0x1cf319['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x1cf319[_0xa092('0x10')];this[_0xa092('0x11')]=_0x1cf319['dialNoAnswerRetryFrequency'];this[_0xa092('0x12')]=_0x1cf319['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x1cf319[_0xa092('0x13')]||0x3;this[_0xa092('0x14')]=_0x1cf319[_0xa092('0x14')]||0x96;this['dialDropMaxRetry']=_0x1cf319[_0xa092('0x15')]||0x3;this['dialDropRetryFrequency']=_0x1cf319[_0xa092('0x16')]||0x96;this[_0xa092('0x17')]=_0x1cf319[_0xa092('0x17')]||0x3;this['dialAbandonedRetryFrequency']=_0x1cf319[_0xa092('0x18')]||0x96;this[_0xa092('0x19')]=_0x1cf319[_0xa092('0x19')]||0x3;this[_0xa092('0x1a')]=_0x1cf319[_0xa092('0x1a')]||0x96;this[_0xa092('0x1b')]=_0x1cf319[_0xa092('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x1cf319['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x1cf319[_0xa092('0x1c')]||_0xa092('0x1d');this['dialPrefix']=_0x1cf319[_0xa092('0x1e')]||undefined;this[_0xa092('0x1f')]=_0x1cf319[_0xa092('0x1f')]||undefined;this['dialCutDigit']=_0x1cf319['dialCutDigit']||undefined;this[_0xa092('0x20')]=_0x1cf319[_0xa092('0x20')]?_0x1cf319[_0xa092('0x20')]:undefined;this[_0xa092('0x21')]=_0x1cf319[_0xa092('0x21')]?_0x1cf319[_0xa092('0x21')]:undefined;this['Interval']=_0x1cf319[_0xa092('0x22')]?_0x1cf319[_0xa092('0x22')]:undefined;this[_0xa092('0x23')]=_0x1cf319[_0xa092('0x23')]?_0x1cf319[_0xa092('0x23')]:undefined;this[_0xa092('0x24')]=_0x1cf319[_0xa092('0x23')]?_0x1cf319['SquareProject'][_0xa092('0x25')]:undefined;this['dialAMDActive']=_0x1cf319[_0xa092('0x26')]||![];this[_0xa092('0x27')]=_0x1cf319[_0xa092('0x27')];this[_0xa092('0x28')]=_0x1cf319[_0xa092('0x28')];this[_0xa092('0x29')]=_0x1cf319[_0xa092('0x29')];this[_0xa092('0x2a')]=_0x1cf319[_0xa092('0x2a')];this[_0xa092('0x2b')]=_0x1cf319[_0xa092('0x2b')];this['dialAMDBetweenWordsSilence']=_0x1cf319['dialAMDBetweenWordsSilence'];this[_0xa092('0x2c')]=_0x1cf319['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x1cf319['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x1cf319[_0xa092('0x2d')];}module[_0xa092('0x2e')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 0b5907e..b63f088 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 _0x2b4a=['holdtime','type','monitor','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','linkedid','exten','answered','endtime','unmanaged','lastapplication','lastdata','duration','billableseconds'];(function(_0x35ef37,_0x3652b4){var _0x829e5d=function(_0x2f04d1){while(--_0x2f04d1){_0x35ef37['push'](_0x35ef37['shift']());}};_0x829e5d(++_0x3652b4);}(_0x2b4a,0x13e));var _0xa2b4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2b4a[_0x20a584];return _0x4b41a8;};'use strict';function Channel(){this[_0xa2b4('0x0')]=null;this[_0xa2b4('0x1')]='';this[_0xa2b4('0x2')]='';this[_0xa2b4('0x3')]=0x0;this[_0xa2b4('0x4')]='';this[_0xa2b4('0x5')]=undefined;this[_0xa2b4('0x6')]=undefined;this[_0xa2b4('0x7')]=0x0;this['context']='';this[_0xa2b4('0x8')]=0x0;this[_0xa2b4('0x9')]=0x0;this[_0xa2b4('0xa')]=0x0;this[_0xa2b4('0xb')]=![];this['answertime']=null;this[_0xa2b4('0xc')]=null;this[_0xa2b4('0xd')]=![];this['abandoned']=![];this[_0xa2b4('0xe')]='';this[_0xa2b4('0xf')]='';this[_0xa2b4('0x10')]=0x0;this[_0xa2b4('0x11')]=0x0;this[_0xa2b4('0x12')]=0x0;this[_0xa2b4('0x13')]=null;this['tag']=null;this['disposition']=null;this[_0xa2b4('0x14')]=![];this['monitorFilename']=null;this[_0xa2b4('0x15')]=null;this[_0xa2b4('0x16')]=[];this[_0xa2b4('0x17')]=undefined;this[_0xa2b4('0x18')]=undefined;this[_0xa2b4('0x19')]=undefined;this[_0xa2b4('0x1a')]=0x0;}module[_0xa2b4('0x1b')]=Channel; \ No newline at end of file +var _0x6e90=['linkedid','exten','answered','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridname','accountcode','context','uniqueid'];(function(_0xb64c56,_0x4d5bcb){var _0x1b61b4=function(_0x19fe3e){while(--_0x19fe3e){_0xb64c56['push'](_0xb64c56['shift']());}};_0x1b61b4(++_0x4d5bcb);}(_0x6e90,0xf5));var _0x06e9=function(_0x38a977,_0x4f73ac){_0x38a977=_0x38a977-0x0;var _0x2704e1=_0x6e90[_0x38a977];return _0x2704e1;};'use strict';function Channel(){this[_0x06e9('0x0')]=null;this[_0x06e9('0x1')]='';this[_0x06e9('0x2')]='';this['calleridnum']=0x0;this[_0x06e9('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0x06e9('0x4')]=0x0;this[_0x06e9('0x5')]='';this[_0x06e9('0x6')]=0x0;this[_0x06e9('0x7')]=0x0;this[_0x06e9('0x8')]=0x0;this[_0x06e9('0x9')]=![];this['answertime']=null;this[_0x06e9('0xa')]=null;this[_0x06e9('0xb')]=![];this[_0x06e9('0xc')]=![];this[_0x06e9('0xd')]='';this[_0x06e9('0xe')]='';this[_0x06e9('0xf')]=0x0;this[_0x06e9('0x10')]=0x0;this[_0x06e9('0x11')]=0x0;this[_0x06e9('0x12')]=null;this[_0x06e9('0x13')]=null;this[_0x06e9('0x14')]=null;this[_0x06e9('0x15')]=![];this[_0x06e9('0x16')]=null;this[_0x06e9('0x17')]=null;this[_0x06e9('0x18')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0x06e9('0x19')]=undefined;this[_0x06e9('0x1a')]=0x0;}module[_0x06e9('0x1b')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index af4f146..e0d5abd 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 _0x9ede=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x26aafc,_0x11e67d){var _0x5d4451=function(_0x40965e){while(--_0x40965e){_0x26aafc['push'](_0x26aafc['shift']());}};_0x5d4451(++_0x11e67d);}(_0x9ede,0x119));var _0xe9ed=function(_0x5d27b5,_0xe7d767){_0x5d27b5=_0x5d27b5-0x0;var _0x14bb9f=_0x9ede[_0x5d27b5];return _0x14bb9f;};'use strict';function DeskAccount(_0x1c0f10){this['id']=_0x1c0f10['id']||0x0;this['name']=_0x1c0f10[_0xe9ed('0x0')]||'';this[_0xe9ed('0x1')]=_0x1c0f10['username']||'';this[_0xe9ed('0x2')]=_0x1c0f10[_0xe9ed('0x2')]||'';this[_0xe9ed('0x3')]=_0x1c0f10[_0xe9ed('0x3')]||'';this[_0xe9ed('0x4')]=_0x1c0f10['password']||'';this[_0xe9ed('0x5')]=_0x1c0f10[_0xe9ed('0x5')]||'';this[_0xe9ed('0x6')]=_0x1c0f10['consumerSecret']||'';this[_0xe9ed('0x7')]=_0x1c0f10[_0xe9ed('0x7')]||'';this[_0xe9ed('0x8')]=_0x1c0f10[_0xe9ed('0x8')]||'';this[_0xe9ed('0x9')]=_0x1c0f10[_0xe9ed('0x9')]||'';this['serverUrl']=_0x1c0f10[_0xe9ed('0xa')]||'';this[_0xe9ed('0xb')]=_0x1c0f10['Configurations']||{};}module[_0xe9ed('0xc')]=DeskAccount; \ No newline at end of file +var _0xffc7=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x41ba7c,_0x21b2bb){var _0xb1bf6a=function(_0x879cc7){while(--_0x879cc7){_0x41ba7c['push'](_0x41ba7c['shift']());}};_0xb1bf6a(++_0x21b2bb);}(_0xffc7,0x1e1));var _0x7ffc=function(_0x58c55e,_0x1dd270){_0x58c55e=_0x58c55e-0x0;var _0xfa7df3=_0xffc7[_0x58c55e];return _0xfa7df3;};'use strict';function DeskAccount(_0x358e44){this['id']=_0x358e44['id']||0x0;this[_0x7ffc('0x0')]=_0x358e44[_0x7ffc('0x0')]||'';this['username']=_0x358e44[_0x7ffc('0x1')]||'';this[_0x7ffc('0x2')]=_0x358e44[_0x7ffc('0x2')]||'';this[_0x7ffc('0x3')]=_0x358e44[_0x7ffc('0x3')]||'';this[_0x7ffc('0x4')]=_0x358e44[_0x7ffc('0x4')]||'';this[_0x7ffc('0x5')]=_0x358e44[_0x7ffc('0x5')]||'';this[_0x7ffc('0x6')]=_0x358e44['consumerSecret']||'';this['token']=_0x358e44[_0x7ffc('0x7')]||'';this[_0x7ffc('0x8')]=_0x358e44[_0x7ffc('0x8')]||'';this['type']=_0x358e44[_0x7ffc('0x9')]||'';this[_0x7ffc('0xa')]=_0x358e44['serverUrl']||'';this['Configurations']=_0x358e44[_0x7ffc('0xb')]||{};}module[_0x7ffc('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 9885042..0703457 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 _0x3b00=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password'];(function(_0xb4ce7a,_0x597faf){var _0x4df2a5=function(_0x2bb979){while(--_0x2bb979){_0xb4ce7a['push'](_0xb4ce7a['shift']());}};_0x4df2a5(++_0x597faf);}(_0x3b00,0x159));var _0x03b0=function(_0x136973,_0x479346){_0x136973=_0x136973-0x0;var _0x5459aa=_0x3b00[_0x136973];return _0x5459aa;};'use strict';function Dynamics365Account(_0x584609){this['id']=_0x584609['id']||0x0;this['name']=_0x584609[_0x03b0('0x0')]||'';this[_0x03b0('0x1')]=_0x584609[_0x03b0('0x1')]||'';this[_0x03b0('0x2')]=_0x584609[_0x03b0('0x2')]||'';this[_0x03b0('0x3')]=_0x584609['remoteUri']||'';this[_0x03b0('0x4')]=_0x584609[_0x03b0('0x4')]||'';this[_0x03b0('0x5')]=_0x584609[_0x03b0('0x5')]||'';this[_0x03b0('0x6')]=_0x584609[_0x03b0('0x6')]||{};this[_0x03b0('0x7')]=_0x584609[_0x03b0('0x7')]||'';this[_0x03b0('0x8')]=_0x584609[_0x03b0('0x8')]||![];this[_0x03b0('0x9')]=_0x584609['Configurations']||{};this[_0x03b0('0xa')]=_0x584609[_0x03b0('0xa')]||{};}module[_0x03b0('0xb')]=Dynamics365Account; \ No newline at end of file +var _0xa16d=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username','password'];(function(_0x1e0bf4,_0x371d2d){var _0x4b9b66=function(_0x1c7f85){while(--_0x1c7f85){_0x1e0bf4['push'](_0x1e0bf4['shift']());}};_0x4b9b66(++_0x371d2d);}(_0xa16d,0x6b));var _0xda16=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xa16d[_0x609988];return _0x159984;};'use strict';function Dynamics365Account(_0x44bb74){this['id']=_0x44bb74['id']||0x0;this[_0xda16('0x0')]=_0x44bb74[_0xda16('0x0')]||'';this[_0xda16('0x1')]=_0x44bb74[_0xda16('0x1')]||'';this['password']=_0x44bb74[_0xda16('0x2')]||'';this[_0xda16('0x3')]=_0x44bb74[_0xda16('0x3')]||'';this[_0xda16('0x4')]=_0x44bb74[_0xda16('0x4')]||'';this[_0xda16('0x5')]=_0x44bb74[_0xda16('0x5')]||'';this[_0xda16('0x6')]=_0x44bb74[_0xda16('0x6')]||{};this[_0xda16('0x7')]=_0x44bb74['serverUrl']||'';this['modernAuthentication']=_0x44bb74[_0xda16('0x8')]||![];this['Configurations']=_0x44bb74[_0xda16('0x9')]||{};this[_0xda16('0xa')]=_0x44bb74['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 26da9fd..4b76acb 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 _0x14a0=['maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','description','ecm','headerinfo','localstationid','minrate'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x14a0,0xcb));var _0x014a=function(_0x449fae,_0x14a608){_0x449fae=_0x449fae-0x0;var _0x33672b=_0x14a0[_0x449fae];return _0x33672b;};'use strict';function FaxAccount(_0x403523){this['id']=_0x403523['id']||0x0;this['name']=_0x403523['name']||'';this[_0x014a('0x0')]=_0x403523[_0x014a('0x0')];this[_0x014a('0x1')]=_0x403523['ecm'];this[_0x014a('0x2')]=_0x403523[_0x014a('0x2')];this['localstationid']=_0x403523[_0x014a('0x3')];this[_0x014a('0x4')]=_0x403523[_0x014a('0x4')]||0x960;this[_0x014a('0x5')]=_0x403523[_0x014a('0x5')]||0x3840;this['modem']=_0x403523[_0x014a('0x6')]||_0x014a('0x7');this[_0x014a('0x8')]=_0x403523[_0x014a('0x8')]||'no';this[_0x014a('0x9')]=_0x403523['faxdetect']||'no';this[_0x014a('0xa')]=_0x403523[_0x014a('0xa')]||0x1388;this[_0x014a('0xb')]=_0x403523[_0x014a('0xb')]||'SIP';this[_0x014a('0xc')]=_0x403523[_0x014a('0xc')]?_0x403523[_0x014a('0xc')]:undefined;this[_0x014a('0xd')]=_0x403523[_0x014a('0xd')];this['key']=_0x403523[_0x014a('0xe')];}module[_0x014a('0xf')]=FaxAccount; \ No newline at end of file +var _0xbf48=['maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x44a156,_0x27dea0){var _0x507648=function(_0x346e17){while(--_0x346e17){_0x44a156['push'](_0x44a156['shift']());}};_0x507648(++_0x27dea0);}(_0xbf48,0x78));var _0x8bf4=function(_0x14ccd3,_0x1a36e4){_0x14ccd3=_0x14ccd3-0x0;var _0x503cae=_0xbf48[_0x14ccd3];return _0x503cae;};'use strict';function FaxAccount(_0x55dd47){this['id']=_0x55dd47['id']||0x0;this[_0x8bf4('0x0')]=_0x55dd47[_0x8bf4('0x0')]||'';this['description']=_0x55dd47[_0x8bf4('0x1')];this[_0x8bf4('0x2')]=_0x55dd47['ecm'];this[_0x8bf4('0x3')]=_0x55dd47[_0x8bf4('0x3')];this[_0x8bf4('0x4')]=_0x55dd47[_0x8bf4('0x4')];this[_0x8bf4('0x5')]=_0x55dd47[_0x8bf4('0x5')]||0x960;this[_0x8bf4('0x6')]=_0x55dd47['maxrate']||0x3840;this[_0x8bf4('0x7')]=_0x55dd47['modem']||_0x8bf4('0x8');this[_0x8bf4('0x9')]=_0x55dd47[_0x8bf4('0x9')]||'no';this['faxdetect']=_0x55dd47[_0x8bf4('0xa')]||'no';this['t38timeout']=_0x55dd47[_0x8bf4('0xb')]||0x1388;this[_0x8bf4('0xc')]=_0x55dd47[_0x8bf4('0xc')]||_0x8bf4('0xd');this[_0x8bf4('0xe')]=_0x55dd47[_0x8bf4('0xe')]?_0x55dd47[_0x8bf4('0xe')]:undefined;this[_0x8bf4('0xf')]=_0x55dd47[_0x8bf4('0xf')];this[_0x8bf4('0x10')]=_0x55dd47['key'];}module[_0x8bf4('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 6c4b6ad..b4c63be 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 _0xba8d=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x241c5d,_0x3ed23f){var _0x77650b=function(_0x4d212a){while(--_0x4d212a){_0x241c5d['push'](_0x241c5d['shift']());}};_0x77650b(++_0x3ed23f);}(_0xba8d,0x9b));var _0xdba8=function(_0x2529a8,_0x116eca){_0x2529a8=_0x2529a8-0x0;var _0x200b44=_0xba8d[_0x2529a8];return _0x200b44;};'use strict';function FreshdeskAccount(_0x5584fa){this['id']=_0x5584fa['id']||0x0;this['name']=_0x5584fa[_0xdba8('0x0')]||'';this['username']=_0x5584fa[_0xdba8('0x1')]||'';this[_0xdba8('0x2')]=_0x5584fa[_0xdba8('0x3')]||'';this[_0xdba8('0x4')]=_0x5584fa[_0xdba8('0x4')]||'';this[_0xdba8('0x5')]=_0x5584fa['serverUrl']||'';this[_0xdba8('0x6')]=_0x5584fa[_0xdba8('0x6')]||{};}module[_0xdba8('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xb698=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb698,0x81));var _0x8b69=function(_0x91b5d6,_0x141063){_0x91b5d6=_0x91b5d6-0x0;var _0xac68cf=_0xb698[_0x91b5d6];return _0xac68cf;};'use strict';function FreshdeskAccount(_0x35d22d){this['id']=_0x35d22d['id']||0x0;this['name']=_0x35d22d[_0x8b69('0x0')]||'';this[_0x8b69('0x1')]=_0x35d22d[_0x8b69('0x1')]||'';this[_0x8b69('0x2')]=_0x35d22d[_0x8b69('0x3')]||'';this[_0x8b69('0x4')]=_0x35d22d['remoteUri']||'';this[_0x8b69('0x5')]=_0x35d22d[_0x8b69('0x5')]||'';this[_0x8b69('0x6')]=_0x35d22d[_0x8b69('0x6')]||{};}module[_0x8b69('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 10cc825..d051d0e 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 _0x98a8=['username','apiKey','token','remoteUri','serverUrl','Configurations','name'];(function(_0x565014,_0x48cef2){var _0x5860ce=function(_0x1bab9b){while(--_0x1bab9b){_0x565014['push'](_0x565014['shift']());}};_0x5860ce(++_0x48cef2);}(_0x98a8,0x12c));var _0x898a=function(_0x44f021,_0xe4ba1e){_0x44f021=_0x44f021-0x0;var _0x524212=_0x98a8[_0x44f021];return _0x524212;};'use strict';function FreshsalesAccount(_0x53f67d){this['id']=_0x53f67d['id']||0x0;this[_0x898a('0x0')]=_0x53f67d[_0x898a('0x0')]||'';this[_0x898a('0x1')]=_0x53f67d[_0x898a('0x1')]||'';this[_0x898a('0x2')]=_0x53f67d[_0x898a('0x3')]||'';this['remoteUri']=_0x53f67d[_0x898a('0x4')]||'';this[_0x898a('0x5')]=_0x53f67d[_0x898a('0x5')]||'';this[_0x898a('0x6')]=_0x53f67d[_0x898a('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xa93e=['serverUrl','Configurations','exports','name','username','apiKey','remoteUri'];(function(_0x3d56dd,_0x3aa33e){var _0x2c529e=function(_0x540499){while(--_0x540499){_0x3d56dd['push'](_0x3d56dd['shift']());}};_0x2c529e(++_0x3aa33e);}(_0xa93e,0x1df));var _0xea93=function(_0x3c8bb4,_0x3a11ae){_0x3c8bb4=_0x3c8bb4-0x0;var _0x38ccc8=_0xa93e[_0x3c8bb4];return _0x38ccc8;};'use strict';function FreshsalesAccount(_0x234a3a){this['id']=_0x234a3a['id']||0x0;this['name']=_0x234a3a[_0xea93('0x0')]||'';this[_0xea93('0x1')]=_0x234a3a['username']||'';this[_0xea93('0x2')]=_0x234a3a['token']||'';this[_0xea93('0x3')]=_0x234a3a['remoteUri']||'';this['serverUrl']=_0x234a3a[_0xea93('0x4')]||'';this[_0xea93('0x5')]=_0x234a3a[_0xea93('0x5')]||{};}module[_0xea93('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 9d08fdf..3ad0516 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 _0x06b7=['channel','connectedlinename','accountcode','context','priority','holdtime','assigned','lastAssignedTo','motionChannel','routealias','variables','exports','type','inbound','uniqueid','calleridnum','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x06b7,0x84));var _0x706b=function(_0x4e8f1a,_0x27ec21){_0x4e8f1a=_0x4e8f1a-0x0;var _0x1113b6=_0x06b7[_0x4e8f1a];return _0x1113b6;};'use strict';function QueueReport(){this[_0x706b('0x0')]=_0x706b('0x1');this[_0x706b('0x2')]='';this[_0x706b('0x3')]='';this['calleridname']='';this['queue']='';this[_0x706b('0x4')]=null;this['queuecallerleaveAt']=null;this[_0x706b('0x5')]=0x1;this[_0x706b('0x6')]=0x1;this[_0x706b('0x7')]=![];this[_0x706b('0x8')]=null;this[_0x706b('0x9')]=![];this['queuecallercompleteAt']=null;this[_0x706b('0xa')]=![];this[_0x706b('0xb')]=null;this['originalposition']=0x1;this[_0x706b('0xc')]='';this['connectedlinenum']='';this[_0x706b('0xd')]='';this[_0x706b('0xe')]='';this[_0x706b('0xf')]='';this['exten']='';this[_0x706b('0x10')]='';this[_0x706b('0x11')]=0x0;this[_0x706b('0x12')]=![];this[_0x706b('0x13')]='';this[_0x706b('0x14')]='voice';this[_0x706b('0x15')]=null;this['mohtime']=0x0;this[_0x706b('0x16')]={};}module[_0x706b('0x17')]=QueueReport; \ No newline at end of file +var _0x4d95=['accountcode','exten','priority','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','exports','inbound','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum'];(function(_0x2b3788,_0x1d0cf6){var _0x1c9f5a=function(_0x49f415){while(--_0x49f415){_0x2b3788['push'](_0x2b3788['shift']());}};_0x1c9f5a(++_0x1d0cf6);}(_0x4d95,0xeb));var _0x54d9=function(_0x12ad5d,_0x2e63ed){_0x12ad5d=_0x12ad5d-0x0;var _0x45a98b=_0x4d95[_0x12ad5d];return _0x45a98b;};'use strict';function QueueReport(){this['type']=_0x54d9('0x0');this['uniqueid']='';this['calleridnum']='';this[_0x54d9('0x1')]='';this[_0x54d9('0x2')]='';this[_0x54d9('0x3')]=null;this[_0x54d9('0x4')]=null;this[_0x54d9('0x5')]=0x1;this[_0x54d9('0x6')]=0x1;this[_0x54d9('0x7')]=![];this[_0x54d9('0x8')]=null;this['queuecallercomplete']=![];this[_0x54d9('0x9')]=null;this[_0x54d9('0xa')]=![];this[_0x54d9('0xb')]=null;this[_0x54d9('0xc')]=0x1;this[_0x54d9('0xd')]='';this[_0x54d9('0xe')]='';this['connectedlinename']='';this[_0x54d9('0xf')]='';this['context']='';this[_0x54d9('0x10')]='';this[_0x54d9('0x11')]='';this['holdtime']=0x0;this['assigned']=![];this[_0x54d9('0x12')]='';this[_0x54d9('0x13')]=_0x54d9('0x14');this[_0x54d9('0x15')]=null;this[_0x54d9('0x16')]=0x0;this[_0x54d9('0x17')]={};}module[_0x54d9('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index d47f615..9b4203c 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 _0xc274=['clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x58b498,_0x3b410e){var _0xfb746=function(_0x150338){while(--_0x150338){_0x58b498['push'](_0x58b498['shift']());}};_0xfb746(++_0x3b410e);}(_0xc274,0x151));var _0x4c27=function(_0x4dee24,_0x41d00a){_0x4dee24=_0x4dee24-0x0;var _0x175ab3=_0xc274[_0x4dee24];return _0x175ab3;};'use strict';function SalesforceAccount(_0x4d1ac0){this['id']=_0x4d1ac0['id']||0x0;this[_0x4c27('0x0')]=_0x4d1ac0['name']||'';this['username']=_0x4d1ac0[_0x4c27('0x1')]||'';this[_0x4c27('0x2')]=_0x4d1ac0[_0x4c27('0x2')]||'';this[_0x4c27('0x3')]=_0x4d1ac0[_0x4c27('0x3')]||'';this[_0x4c27('0x4')]=_0x4d1ac0['clientId']||'';this[_0x4c27('0x5')]=_0x4d1ac0['clientSecret']||'';this[_0x4c27('0x6')]=_0x4d1ac0[_0x4c27('0x6')]||'';this[_0x4c27('0x7')]=_0x4d1ac0['type']||'integrationTab';this[_0x4c27('0x8')]=_0x4d1ac0['serverUrl']||'';this[_0x4c27('0x9')]=_0x4d1ac0[_0x4c27('0x9')]||{};}module[_0x4c27('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x8cc2=['integrationTab','Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x59be41,_0x3741fb){var _0x25edd1=function(_0x1b803a){while(--_0x1b803a){_0x59be41['push'](_0x59be41['shift']());}};_0x25edd1(++_0x3741fb);}(_0x8cc2,0x1d8));var _0x28cc=function(_0xfa05ed,_0x488b68){_0xfa05ed=_0xfa05ed-0x0;var _0x1cf76d=_0x8cc2[_0xfa05ed];return _0x1cf76d;};'use strict';function SalesforceAccount(_0x19f753){this['id']=_0x19f753['id']||0x0;this[_0x28cc('0x0')]=_0x19f753[_0x28cc('0x0')]||'';this[_0x28cc('0x1')]=_0x19f753[_0x28cc('0x1')]||'';this[_0x28cc('0x2')]=_0x19f753[_0x28cc('0x2')]||'';this[_0x28cc('0x3')]=_0x19f753['password']||'';this[_0x28cc('0x4')]=_0x19f753['clientId']||'';this[_0x28cc('0x5')]=_0x19f753[_0x28cc('0x5')]||'';this[_0x28cc('0x6')]=_0x19f753[_0x28cc('0x6')]||'';this[_0x28cc('0x7')]=_0x19f753[_0x28cc('0x7')]||_0x28cc('0x8');this['serverUrl']=_0x19f753['serverUrl']||'';this['Configurations']=_0x19f753[_0x28cc('0x9')]||{};}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 e7735be..bc41099 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 _0xa367=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x10d894,_0x1dd037){var _0x40e279=function(_0x4c3308){while(--_0x4c3308){_0x10d894['push'](_0x10d894['shift']());}};_0x40e279(++_0x1dd037);}(_0xa367,0x1ee));var _0x7a36=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0xa367[_0x408e38];return _0x426b0e;};'use strict';function ServicenowAccount(_0x2fe0c7){this['id']=_0x2fe0c7['id']||0x0;this[_0x7a36('0x0')]=_0x2fe0c7['name']||'';this[_0x7a36('0x1')]=_0x2fe0c7[_0x7a36('0x1')]||'';this[_0x7a36('0x2')]=_0x2fe0c7[_0x7a36('0x2')]||'';this[_0x7a36('0x3')]=_0x2fe0c7['remoteUri']||'';this[_0x7a36('0x4')]=_0x2fe0c7['serverUrl']||'';this[_0x7a36('0x5')]=_0x2fe0c7[_0x7a36('0x5')]||{};}module[_0x7a36('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xe5c2=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x3b5b30,_0x2c358b){var _0x150a38=function(_0x84c8c3){while(--_0x84c8c3){_0x3b5b30['push'](_0x3b5b30['shift']());}};_0x150a38(++_0x2c358b);}(_0xe5c2,0x16e));var _0x2e5c=function(_0x522bb2,_0x59b84b){_0x522bb2=_0x522bb2-0x0;var _0x1efa51=_0xe5c2[_0x522bb2];return _0x1efa51;};'use strict';function ServicenowAccount(_0x5ee49a){this['id']=_0x5ee49a['id']||0x0;this[_0x2e5c('0x0')]=_0x5ee49a[_0x2e5c('0x0')]||'';this[_0x2e5c('0x1')]=_0x5ee49a['username']||'';this[_0x2e5c('0x2')]=_0x5ee49a[_0x2e5c('0x2')]||'';this[_0x2e5c('0x3')]=_0x5ee49a[_0x2e5c('0x3')]||'';this[_0x2e5c('0x4')]=_0x5ee49a[_0x2e5c('0x4')]||'';this[_0x2e5c('0x5')]=_0x5ee49a[_0x2e5c('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index cb0f7e7..d941c6c 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 _0xba0b=['serverUrl','Configurations','username','password','remoteUri'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xba0b,0x110));var _0xbba0=function(_0x374019,_0x49b8dc){_0x374019=_0x374019-0x0;var _0x30d7ab=_0xba0b[_0x374019];return _0x30d7ab;};'use strict';function SugarcrmAccount(_0x42c9ad){this['id']=_0x42c9ad['id']||0x0;this['name']=_0x42c9ad['name']||'';this[_0xbba0('0x0')]=_0x42c9ad[_0xbba0('0x0')]||'';this[_0xbba0('0x1')]=_0x42c9ad[_0xbba0('0x1')]||'';this['remoteUri']=_0x42c9ad[_0xbba0('0x2')]||'';this[_0xbba0('0x3')]=_0x42c9ad[_0xbba0('0x3')]||'';this[_0xbba0('0x4')]=_0x42c9ad[_0xbba0('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x1f80=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x490f8c,_0x38bc35){var _0xa44f94=function(_0x1eaf33){while(--_0x1eaf33){_0x490f8c['push'](_0x490f8c['shift']());}};_0xa44f94(++_0x38bc35);}(_0x1f80,0x158));var _0x01f8=function(_0x454c3c,_0x5b3f53){_0x454c3c=_0x454c3c-0x0;var _0x17eeef=_0x1f80[_0x454c3c];return _0x17eeef;};'use strict';function SugarcrmAccount(_0x3a6875){this['id']=_0x3a6875['id']||0x0;this[_0x01f8('0x0')]=_0x3a6875[_0x01f8('0x0')]||'';this[_0x01f8('0x1')]=_0x3a6875[_0x01f8('0x1')]||'';this[_0x01f8('0x2')]=_0x3a6875[_0x01f8('0x2')]||'';this[_0x01f8('0x3')]=_0x3a6875[_0x01f8('0x3')]||'';this[_0x01f8('0x4')]=_0x3a6875[_0x01f8('0x4')]||'';this['Configurations']=_0x3a6875[_0x01f8('0x5')]||{};}module[_0x01f8('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 276310f..0a7b19d 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 _0x728e=['status','unknown','address','name','accountcode','stateTime'];(function(_0x48381d,_0x4ee067){var _0x1431d3=function(_0x492d96){while(--_0x492d96){_0x48381d['push'](_0x48381d['shift']());}};_0x1431d3(++_0x4ee067);}(_0x728e,0x153));var _0xe728=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x728e[_0x20a584];return _0x4b41a8;};'use strict';function Telephone(_0x137cf){this['id']=_0x137cf['id']||0x0;this[_0xe728('0x0')]=_0x137cf[_0xe728('0x0')]||'';this[_0xe728('0x1')]=_0x137cf[_0xe728('0x1')]||'';this['state']='unknown';this[_0xe728('0x2')]=0x0;this[_0xe728('0x3')]=_0xe728('0x4');this[_0xe728('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0xc222=['unknown','address','exports','name','accountcode','state'];(function(_0x457bfb,_0x34e589){var _0x8910d=function(_0x1ef6af){while(--_0x1ef6af){_0x457bfb['push'](_0x457bfb['shift']());}};_0x8910d(++_0x34e589);}(_0xc222,0x75));var _0x2c22=function(_0x25f6bb,_0x5cefc4){_0x25f6bb=_0x25f6bb-0x0;var _0x5135fc=_0xc222[_0x25f6bb];return _0x5135fc;};'use strict';function Telephone(_0x5d69a4){this['id']=_0x5d69a4['id']||0x0;this[_0x2c22('0x0')]=_0x5d69a4['name']||'';this[_0x2c22('0x1')]=_0x5d69a4['accountcode']||'';this[_0x2c22('0x2')]='unknown';this['stateTime']=0x0;this['status']=_0x2c22('0x3');this[_0x2c22('0x4')]='';}module[_0x2c22('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 548c75d..bd790e0 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(_0x4ad20b,_0x3f0754){var _0x3f80fb=function(_0x4632c3){while(--_0x4632c3){_0x4ad20b['push'](_0x4ad20b['shift']());}};_0x3f80fb(++_0x3f0754);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 _0xa9e0=['exports','name'];(function(_0x289399,_0x35bed2){var _0x2262cc=function(_0x382a0f){while(--_0x382a0f){_0x289399['push'](_0x289399['shift']());}};_0x2262cc(++_0x35bed2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 90e450d..35598f8 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 _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x17523c,_0x1bd0e1){var _0x43b2b6=function(_0x42148f){while(--_0x42148f){_0x17523c['push'](_0x17523c['shift']());}};_0x43b2b6(++_0x1bd0e1);}(_0x2032,0xd9));var _0x2203=function(_0x25a979,_0x25748d){_0x25a979=_0x25a979-0x0;var _0x23542f=_0x2032[_0x25a979];return _0x23542f;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file +var _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}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 fae89dd..1e2a195 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 _0xa9b8=['stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','status','registry','indexOf','split','port','domain','domainport','refresh'];(function(_0x11ca9b,_0x21cf96){var _0x22bc61=function(_0x1a9ec6){while(--_0x1a9ec6){_0x11ca9b['push'](_0x11ca9b['shift']());}};_0x22bc61(++_0x21cf96);}(_0xa9b8,0x1d0));var _0x8a9b=function(_0xe48cfc,_0x45767a){_0xe48cfc=_0xe48cfc-0x0;var _0x4769b3=_0xa9b8[_0xe48cfc];return _0x4769b3;};'use strict';function Trunk(_0x4e558e){this['id']=_0x4e558e['id']||0x0;this[_0x8a9b('0x0')]=_0x4e558e['active']||![];this[_0x8a9b('0x1')]=_0x4e558e[_0x8a9b('0x1')]||'';this[_0x8a9b('0x2')]=_0x8a9b('0x3');this['stateTime']=0x0;this[_0x8a9b('0x4')]=_0x8a9b('0x3');this[_0x8a9b('0x5')]=_0x4e558e[_0x8a9b('0x5')]&&_0x4e558e[_0x8a9b('0x5')][_0x8a9b('0x6')](':')?_0x4e558e[_0x8a9b('0x5')][_0x8a9b('0x7')](':')[0x0]:'';this['host']='';this[_0x8a9b('0x8')]='';this[_0x8a9b('0x9')]='';this[_0x8a9b('0xa')]='';this[_0x8a9b('0xb')]='';this[_0x8a9b('0xc')]='unknown';this[_0x8a9b('0xd')]='';this[_0x8a9b('0xe')]='';this['defaultuser']=_0x4e558e[_0x8a9b('0xf')]||'';}module[_0x8a9b('0x10')]=Trunk; \ No newline at end of file +var _0x1e66=['refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','status','registry','split','host','port','domain','domainport'];(function(_0x5ca6f3,_0x125ba4){var _0x416675=function(_0x3339cc){while(--_0x3339cc){_0x5ca6f3['push'](_0x5ca6f3['shift']());}};_0x416675(++_0x125ba4);}(_0x1e66,0x19e));var _0x61e6=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x1e66[_0x39096d];return _0x13da4f;};'use strict';function Trunk(_0x554ac3){this['id']=_0x554ac3['id']||0x0;this[_0x61e6('0x0')]=_0x554ac3['active']||![];this[_0x61e6('0x1')]=_0x554ac3[_0x61e6('0x1')]||'';this[_0x61e6('0x2')]=_0x61e6('0x3');this['stateTime']=0x0;this[_0x61e6('0x4')]=_0x61e6('0x3');this[_0x61e6('0x5')]=_0x554ac3[_0x61e6('0x5')]&&_0x554ac3[_0x61e6('0x5')]['indexOf'](':')?_0x554ac3[_0x61e6('0x5')][_0x61e6('0x6')](':')[0x0]:'';this[_0x61e6('0x7')]='';this[_0x61e6('0x8')]='';this[_0x61e6('0x9')]='';this[_0x61e6('0xa')]='';this[_0x61e6('0xb')]='';this[_0x61e6('0xc')]='unknown';this[_0x61e6('0xd')]='';this[_0x61e6('0xe')]='';this[_0x61e6('0xf')]=_0x554ac3[_0x61e6('0xf')]||'';}module[_0x61e6('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 527ddb8..8d33ef4 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 _0xc8ff=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc8ff,0xf3));var _0xfc8f=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xc8ff[_0x23e7c1];return _0x1add43;};'use strict';function voiceExtension(_0x379dd6){this['id']=_0x379dd6['id']||0x0;this[_0xfc8f('0x0')]=_0x379dd6[_0xfc8f('0x0')]||'';this[_0xfc8f('0x1')]=_0x379dd6[_0xfc8f('0x1')]||'none';this[_0xfc8f('0x2')]=_0x379dd6['mandatoryDisposition']||![];}module[_0xfc8f('0x3')]=voiceExtension; \ No newline at end of file +var _0x5d75=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0x275c68,_0x4552d0){var _0x5e9489=function(_0x346303){while(--_0x346303){_0x275c68['push'](_0x275c68['shift']());}};_0x5e9489(++_0x4552d0);}(_0x5d75,0x1d8));var _0x55d7=function(_0x24bda7,_0x1391d9){_0x24bda7=_0x24bda7-0x0;var _0xa2fb07=_0x5d75[_0x24bda7];return _0xa2fb07;};'use strict';function voiceExtension(_0x13be71){this['id']=_0x13be71['id']||0x0;this[_0x55d7('0x0')]=_0x13be71[_0x55d7('0x0')]||'';this[_0x55d7('0x1')]=_0x13be71[_0x55d7('0x1')]||_0x55d7('0x2');this['mandatoryDisposition']=_0x13be71[_0x55d7('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 1a027b9..6609116 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 _0x8782=['predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','fewestcalls','leastrecent','linear','random','ringall','roundrobin','rrordered','wrandom','name','monitor_format','type','total','answered','sumDuration','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','onHold','paused','talking','unavailable','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses'];(function(_0x4adc15,_0x13ad92){var _0x450813=function(_0x3bc9fc){while(--_0x3bc9fc){_0x4adc15['push'](_0x4adc15['shift']());}};_0x450813(++_0x13ad92);}(_0x8782,0x94));var _0x2878=function(_0x3f4f44,_0x59b2fd){_0x3f4f44=_0x3f4f44-0x0;var _0x3e2e14=_0x8782[_0x3f4f44];return _0x3e2e14;};'use strict';var monitorFormat={'wav':_0x2878('0x0'),'wav49':_0x2878('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0x2878('0x2'),'leastrecent':_0x2878('0x3'),'linear':_0x2878('0x4'),'random':_0x2878('0x5'),'ringall':_0x2878('0x6'),'rr':_0x2878('0x7'),'rrmemory':'rrmemory','rrordered':_0x2878('0x8'),'wrandom':_0x2878('0x9')};function VoiceQueue(_0x181e36){this['id']=_0x181e36['id']||0x0;this['name']=_0x181e36[_0x2878('0xa')]||'';this[_0x2878('0xb')]=_0x181e36[_0x2878('0xb')]||'';this[_0x2878('0xc')]=_0x181e36[_0x2878('0xc')]||'inbound';this['waiting']=0x0;this[_0x2878('0xd')]=0x0;this[_0x2878('0xe')]=0x0;this[_0x2878('0xf')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0x2878('0x10')]=0x0;this[_0x2878('0x11')]=0x0;this[_0x2878('0x12')]=0x0;this[_0x2878('0x13')]=0x0;this[_0x2878('0x14')]=0x0;this[_0x2878('0x15')]=0x0;this[_0x2878('0x16')]=0x0;this['notInUse']=0x0;this[_0x2878('0x17')]=0x0;this[_0x2878('0x18')]=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this[_0x2878('0x19')]=0x0;this[_0x2878('0x1a')]=0x0;this['unknown']=0x0;this[_0x2878('0x1b')]=_0x181e36[_0x2878('0x1b')]||![];this[_0x2878('0x1c')]=_0x181e36[_0x2878('0x1c')]||0xa;this[_0x2878('0x1d')]=_0x181e36[_0x2878('0x1d')]||'no';this[_0x2878('0x1e')]=!![];this[_0x2878('0x1f')]='';this[_0x2878('0x20')]='';this[_0x2878('0x21')]=0x0;this[_0x2878('0x22')]=0x0;this[_0x2878('0x23')]=_0x181e36[_0x2878('0x23')]||null;this[_0x2878('0x24')]=_0x181e36[_0x2878('0x24')]?_0x181e36['dialGlobalInterval']:null;this[_0x2878('0x25')]=_0x181e36[_0x2878('0x25')];this['dialMethod']=_0x181e36[_0x2878('0x26')]||_0x2878('0x27');this[_0x2878('0x28')]=_0x181e36[_0x2878('0x28')]||0x0;this[_0x2878('0x29')]=_0x181e36['dialLimitQueue']||0x0;this[_0x2878('0x2a')]=_0x181e36[_0x2878('0x2a')]||0x1;this[_0x2878('0x2b')]=_0x181e36[_0x2878('0x2b')]||'dropRate';this[_0x2878('0x2c')]=_0x181e36[_0x2878('0x2c')]||0.03;this[_0x2878('0x2d')]=_0x181e36[_0x2878('0x2d')]||0x258;this['dialOriginateCallerIdName']=_0x181e36[_0x2878('0x2e')]||_0x2878('0x2f');this['dialOriginateCallerIdNumber']=_0x181e36['dialOriginateCallerIdNumber']||_0x2878('0x2f');this[_0x2878('0x30')]=_0x181e36[_0x2878('0x30')]||0x1e;this[_0x2878('0x31')]=_0x181e36[_0x2878('0x31')]||_0x2878('0x32');this['dialQueueTimeout']=_0x181e36[_0x2878('0x33')]||0x3;this[_0x2878('0x34')]=_0x181e36[_0x2878('0x34')]||undefined;this[_0x2878('0x35')]=_0x181e36['dialCongestionMaxRetry']||0x3;this[_0x2878('0x36')]=_0x181e36['dialCongestionRetryFrequency']||0x96;this[_0x2878('0x37')]=_0x181e36[_0x2878('0x37')]||0x3;this[_0x2878('0x38')]=_0x181e36[_0x2878('0x38')]||0x96;this[_0x2878('0x39')]=_0x181e36[_0x2878('0x39')]||0x3;this[_0x2878('0x3a')]=_0x181e36[_0x2878('0x3a')]||0x96;this[_0x2878('0x3b')]=_0x181e36[_0x2878('0x3b')]||0x3;this[_0x2878('0x3c')]=_0x181e36[_0x2878('0x3c')]||0x96;this[_0x2878('0x3d')]=_0x181e36[_0x2878('0x3d')]||0x3;this[_0x2878('0x3e')]=_0x181e36[_0x2878('0x3e')]||0x96;this[_0x2878('0x3f')]=_0x181e36[_0x2878('0x3f')]||0x3;this[_0x2878('0x40')]=_0x181e36[_0x2878('0x40')]||0x96;this['dialMachineMaxRetry']=_0x181e36[_0x2878('0x41')]||0x3;this[_0x2878('0x42')]=_0x181e36[_0x2878('0x42')]||0x96;this[_0x2878('0x43')]=_0x181e36[_0x2878('0x43')]||0x3;this['dialAgentRejectRetryFrequency']=_0x181e36['dialAgentRejectRetryFrequency']||0x96;this[_0x2878('0x44')]=_0x181e36[_0x2878('0x44')]||0x3;this[_0x2878('0x45')]=_0x181e36[_0x2878('0x45')]||0x4;this['Trunk']=_0x181e36[_0x2878('0x46')]?_0x181e36[_0x2878('0x46')]:undefined;this[_0x2878('0x47')]=_0x181e36[_0x2878('0x47')]?_0x181e36[_0x2878('0x47')]:undefined;this['dialPrefix']=_0x181e36[_0x2878('0x48')]||undefined;this[_0x2878('0x49')]=_0x181e36[_0x2878('0x49')]?_0x181e36[_0x2878('0x49')]:undefined;this[_0x2878('0x4a')]=_0x181e36[_0x2878('0x4a')]||'DESC';this[_0x2878('0x4b')]=_0x181e36[_0x2878('0x4b')]||undefined;this[_0x2878('0x4c')]=_0x181e36[_0x2878('0x4c')]||undefined;this[_0x2878('0x4d')]=strategy[_0x181e36[_0x2878('0x4d')]];this[_0x2878('0x4e')]=!![];this[_0x2878('0x4f')]=_0x181e36[_0x2878('0x4f')]||![];this[_0x2878('0x50')]=_0x181e36[_0x2878('0x50')];this['dialAMDGreeting']=_0x181e36[_0x2878('0x51')];this['dialAMDAfterGreetingSilence']=_0x181e36['dialAMDAfterGreetingSilence'];this[_0x2878('0x52')]=_0x181e36[_0x2878('0x52')];this['dialAMDMinWordLength']=_0x181e36[_0x2878('0x53')];this[_0x2878('0x54')]=_0x181e36[_0x2878('0x54')];this[_0x2878('0x55')]=_0x181e36[_0x2878('0x55')];this[_0x2878('0x56')]=_0x181e36['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x181e36[_0x2878('0x57')];this[_0x2878('0x58')]=0x0;this[_0x2878('0x59')]=0x0;this[_0x2878('0x5a')]=_0x181e36[_0x2878('0x5a')];this[_0x2878('0x5b')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x2878('0x5c')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x2878('0x5d')]=0x0;this[_0x2878('0x5e')]=0x0;this[_0x2878('0x5f')]=0x0;this[_0x2878('0x60')]=0x0;this[_0x2878('0x61')]=0x0;this[_0x2878('0x62')]=0x0;this[_0x2878('0x63')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0x2878('0x64')]=undefined;this[_0x2878('0x65')]=1.05;this[_0x2878('0x66')]=0x0;this[_0x2878('0x67')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x2878('0x68')]=0x0;this[_0x2878('0x69')]=0x0;this[_0x2878('0x6a')]=0x0;this[_0x2878('0x6b')]=0x0;this[_0x2878('0x6c')]=0x0;this[_0x2878('0x6d')]=_0x181e36[_0x2878('0x6e')]||0x14;this['predictiveIntervalMinThreshold']=_0x181e36[_0x2878('0x6e')]||0xa;this[_0x2878('0x6f')]=0x0;this[_0x2878('0x70')]=0x0;this[_0x2878('0x71')]=0x1;this[_0x2878('0x72')]=0x0;this[_0x2878('0x73')]=0x0;this[_0x2878('0x74')]=0x0;this['erlangBusyFactor']=0x0;this[_0x2878('0x75')]=_0x181e36[_0x2878('0x75')]||0x1e;this[_0x2878('0x76')]=_0x181e36[_0x2878('0x76')]||![];this[_0x2878('0x77')]=!!_0x181e36[_0x2878('0x77')]||![];this[_0x2878('0x78')]=!!_0x181e36['dialPreviewRecallmeReminder']||![];this[_0x2878('0x79')]=_0x181e36[_0x2878('0x79')]||undefined;this[_0x2878('0x7a')]=_0x181e36['dialAgiAfterHangupClient']||![];this[_0x2878('0x7b')]=_0x181e36[_0x2878('0x7b')]||![];this['monitor_format']=monitorFormat[_0x181e36[_0x2878('0xb')]]?monitorFormat[_0x181e36[_0x2878('0xb')]]:undefined;this['mandatoryDisposition']=_0x181e36[_0x2878('0x7c')]||![];this[_0x2878('0x7d')]=_0x181e36[_0x2878('0x7d')]?_0x181e36[_0x2878('0x7d')]:undefined;this[_0x2878('0x7e')]=![];}module[_0x2878('0x7f')]=VoiceQueue; \ No newline at end of file +var _0x5164=['dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','wav','wav49','gsm','linear','random','ringall','roundrobin','wrandom','name','monitor_format','type','inbound','total','answered','sumDuration','sumHoldTime','unmanaged','abandoned','busy','inUse','loggedIn','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient'];(function(_0xebd98e,_0x43b39d){var _0x5f4f75=function(_0x41019d){while(--_0x41019d){_0xebd98e['push'](_0xebd98e['shift']());}};_0x5f4f75(++_0x43b39d);}(_0x5164,0x18a));var _0x4516=function(_0x17e713,_0x23e2b1){_0x17e713=_0x17e713-0x0;var _0x5abc46=_0x5164[_0x17e713];return _0x5abc46;};'use strict';var monitorFormat={'wav':_0x4516('0x0'),'wav49':_0x4516('0x1'),'gsm':_0x4516('0x2')};var strategy={'fewestcalls':'fewestcalls','leastrecent':'leastrecent','linear':_0x4516('0x3'),'random':_0x4516('0x4'),'ringall':_0x4516('0x5'),'rr':_0x4516('0x6'),'rrmemory':'rrmemory','rrordered':'rrordered','wrandom':_0x4516('0x7')};function VoiceQueue(_0x223b07){this['id']=_0x223b07['id']||0x0;this[_0x4516('0x8')]=_0x223b07[_0x4516('0x8')]||'';this['monitor_format']=_0x223b07[_0x4516('0x9')]||'';this[_0x4516('0xa')]=_0x223b07[_0x4516('0xa')]||_0x4516('0xb');this['waiting']=0x0;this[_0x4516('0xc')]=0x0;this[_0x4516('0xd')]=0x0;this[_0x4516('0xe')]=0x0;this[_0x4516('0xf')]=0x0;this['sumBillable']=0x0;this[_0x4516('0x10')]=0x0;this[_0x4516('0x11')]=0x0;this['available']=0x0;this[_0x4516('0x12')]=0x0;this[_0x4516('0x13')]=0x0;this['invalid']=0x0;this[_0x4516('0x14')]=0x0;this['notInUse']=0x0;this[_0x4516('0x15')]=0x0;this[_0x4516('0x16')]=0x0;this[_0x4516('0x17')]=0x0;this[_0x4516('0x18')]=0x0;this[_0x4516('0x19')]=0x0;this[_0x4516('0x1a')]=0x0;this[_0x4516('0x1b')]=0x0;this[_0x4516('0x1c')]=_0x223b07[_0x4516('0x1c')]||![];this[_0x4516('0x1d')]=_0x223b07[_0x4516('0x1d')]||0xa;this[_0x4516('0x1e')]=_0x223b07[_0x4516('0x1e')]||'no';this['sendMessageOneNotActive']=!![];this[_0x4516('0x1f')]='';this[_0x4516('0x20')]='';this[_0x4516('0x21')]=0x0;this[_0x4516('0x22')]=0x0;this[_0x4516('0x23')]=_0x223b07[_0x4516('0x23')]||null;this[_0x4516('0x24')]=_0x223b07[_0x4516('0x24')]?_0x223b07[_0x4516('0x24')]:null;this[_0x4516('0x25')]=_0x223b07[_0x4516('0x25')];this['dialMethod']=_0x223b07[_0x4516('0x26')]||_0x4516('0x27');this[_0x4516('0x28')]=_0x223b07[_0x4516('0x28')]||0x0;this['dialLimitQueue']=_0x223b07[_0x4516('0x29')]||0x0;this[_0x4516('0x2a')]=_0x223b07[_0x4516('0x2a')]||0x1;this[_0x4516('0x2b')]=_0x223b07[_0x4516('0x2b')]||_0x4516('0x2c');this[_0x4516('0x2d')]=_0x223b07[_0x4516('0x2d')]||0.03;this[_0x4516('0x2e')]=_0x223b07['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x223b07[_0x4516('0x2f')]||_0x4516('0x30');this[_0x4516('0x31')]=_0x223b07[_0x4516('0x31')]||'anonymous';this['dialOriginateTimeout']=_0x223b07[_0x4516('0x32')]||0x1e;this[_0x4516('0x33')]=_0x223b07[_0x4516('0x33')]||_0x4516('0x34');this[_0x4516('0x35')]=_0x223b07['dialQueueTimeout']||0x3;this[_0x4516('0x36')]=_0x223b07[_0x4516('0x36')]||undefined;this[_0x4516('0x37')]=_0x223b07[_0x4516('0x37')]||0x3;this['dialCongestionRetryFrequency']=_0x223b07['dialCongestionRetryFrequency']||0x96;this[_0x4516('0x38')]=_0x223b07[_0x4516('0x38')]||0x3;this[_0x4516('0x39')]=_0x223b07[_0x4516('0x39')]||0x96;this[_0x4516('0x3a')]=_0x223b07['dialNoAnswerMaxRetry']||0x3;this[_0x4516('0x3b')]=_0x223b07[_0x4516('0x3b')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x223b07[_0x4516('0x3c')]||0x3;this[_0x4516('0x3d')]=_0x223b07[_0x4516('0x3d')]||0x96;this[_0x4516('0x3e')]=_0x223b07['dialDropMaxRetry']||0x3;this[_0x4516('0x3f')]=_0x223b07['dialDropRetryFrequency']||0x96;this[_0x4516('0x40')]=_0x223b07[_0x4516('0x40')]||0x3;this[_0x4516('0x41')]=_0x223b07['dialAbandonedRetryFrequency']||0x96;this[_0x4516('0x42')]=_0x223b07[_0x4516('0x42')]||0x3;this[_0x4516('0x43')]=_0x223b07[_0x4516('0x43')]||0x96;this['dialAgentRejectMaxRetry']=_0x223b07[_0x4516('0x44')]||0x3;this[_0x4516('0x45')]=_0x223b07['dialAgentRejectRetryFrequency']||0x96;this[_0x4516('0x46')]=_0x223b07[_0x4516('0x46')]||0x3;this[_0x4516('0x47')]=_0x223b07['dialGlobalMaxRetry']||0x4;this[_0x4516('0x48')]=_0x223b07[_0x4516('0x48')]?_0x223b07[_0x4516('0x48')]:undefined;this[_0x4516('0x49')]=_0x223b07[_0x4516('0x49')]?_0x223b07['TrunkBackup']:undefined;this['dialPrefix']=_0x223b07[_0x4516('0x4a')]||undefined;this[_0x4516('0x4b')]=_0x223b07[_0x4516('0x4b')]?_0x223b07[_0x4516('0x4b')]:undefined;this[_0x4516('0x4c')]=_0x223b07[_0x4516('0x4c')]||_0x4516('0x4d');this[_0x4516('0x4e')]=_0x223b07[_0x4516('0x4e')]||undefined;this['dialCutDigit']=_0x223b07[_0x4516('0x4f')]||undefined;this['strategy']=strategy[_0x223b07['strategy']];this['queueStatusComplete']=!![];this[_0x4516('0x50')]=_0x223b07['dialAMDActive']||![];this[_0x4516('0x51')]=_0x223b07[_0x4516('0x51')];this[_0x4516('0x52')]=_0x223b07[_0x4516('0x52')];this['dialAMDAfterGreetingSilence']=_0x223b07[_0x4516('0x53')];this['dialAMDTotalAnalysisTime']=_0x223b07[_0x4516('0x54')];this['dialAMDMinWordLength']=_0x223b07['dialAMDMinWordLength'];this[_0x4516('0x55')]=_0x223b07[_0x4516('0x55')];this[_0x4516('0x56')]=_0x223b07[_0x4516('0x56')];this[_0x4516('0x57')]=_0x223b07[_0x4516('0x57')];this['dialAMDMaximumWordLength']=_0x223b07[_0x4516('0x58')];this[_0x4516('0x59')]=0x0;this['pTalking']=0x0;this['timeout']=_0x223b07[_0x4516('0x5a')];this['outboundAnswerCallsDay']=0x0;this[_0x4516('0x5b')]=0x0;this[_0x4516('0x5c')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x4516('0x5d')]=0x0;this[_0x4516('0x5e')]=0x0;this[_0x4516('0x5f')]=0x0;this[_0x4516('0x60')]=0x0;this[_0x4516('0x61')]=0x0;this[_0x4516('0x62')]=0x0;this[_0x4516('0x63')]=0x0;this[_0x4516('0x64')]=0x0;this[_0x4516('0x65')]=0x0;this[_0x4516('0x66')]=0x0;this[_0x4516('0x67')]=undefined;this[_0x4516('0x68')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x4516('0x69')]=0x0;this[_0x4516('0x6a')]=0x0;this[_0x4516('0x6b')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x4516('0x6c')]=0x0;this[_0x4516('0x6d')]=0x0;this[_0x4516('0x6e')]=0x0;this[_0x4516('0x6f')]=0x0;this[_0x4516('0x70')]=_0x223b07[_0x4516('0x71')]||0x14;this[_0x4516('0x72')]=_0x223b07[_0x4516('0x71')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x4516('0x73')]=0x0;this[_0x4516('0x74')]=0x1;this['erlangCalls']=0x0;this[_0x4516('0x75')]=0x0;this[_0x4516('0x76')]=0x0;this[_0x4516('0x77')]=0x0;this['dialRecallMeTimeout']=_0x223b07[_0x4516('0x78')]||0x1e;this[_0x4516('0x79')]=_0x223b07[_0x4516('0x79')]||![];this[_0x4516('0x7a')]=!!_0x223b07[_0x4516('0x7a')]||![];this['dialPreviewRecallmeReminder']=!!_0x223b07[_0x4516('0x7b')]||![];this[_0x4516('0x7c')]=_0x223b07[_0x4516('0x7c')]||undefined;this[_0x4516('0x7d')]=_0x223b07[_0x4516('0x7d')]||![];this[_0x4516('0x7e')]=_0x223b07[_0x4516('0x7e')]||![];this['monitor_format']=monitorFormat[_0x223b07[_0x4516('0x9')]]?monitorFormat[_0x223b07[_0x4516('0x9')]]:undefined;this[_0x4516('0x7f')]=_0x223b07['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x223b07[_0x4516('0x80')]?_0x223b07[_0x4516('0x80')]:undefined;this[_0x4516('0x81')]=![];}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 5229d22..451c367 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8832=['invalid','onHold','notInUse','ringInUse','sumBillable','sumHoldTime','total','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','prototype','createReport','loggedin','callers','SIP/','incall','status','booked','keys','queue','dialer','exten','xcally-motion-preview','compareToOutboundQueue','some','outboundAbandonedCallsDay','available','loggedIn','ringing','talking','waiting','answered','loggedInDb','originated','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','paused','pTalking','sumDuration','name','strategy','abandoned','busy','inUse'];(function(_0x212e7,_0x472ed6){var _0x184f79=function(_0x22c2ae){while(--_0x22c2ae){_0x212e7['push'](_0x212e7['shift']());}};_0x184f79(++_0x472ed6);}(_0x8832,0x1f4));var _0x2883=function(_0x459ef3,_0x558157){_0x459ef3=_0x459ef3-0x0;var _0x1fe520=_0x8832[_0x459ef3];return _0x1fe520;};'use strict';var INBOUND_COUNTERS=[_0x2883('0x0'),_0x2883('0x1'),'loggedInDb','paused',_0x2883('0x2'),_0x2883('0x3'),_0x2883('0x4')];var OUTBOUND_COUNTERS=['available',_0x2883('0x5'),'inUse',_0x2883('0x1'),_0x2883('0x6'),_0x2883('0x7'),'outboundAbandonedCallsDay',_0x2883('0x8'),'outboundBlacklistCallsDay',_0x2883('0x9'),_0x2883('0xa'),'outboundNoAnswerCallsDay','outboundNoSuchCallsDay',_0x2883('0xb'),_0x2883('0xc'),_0x2883('0xd'),_0x2883('0xe'),_0x2883('0xf'),'talking','sumBillable',_0x2883('0x10'),'total','waiting'];function VoiceQueueSummary(_0x5a7e86){this['id']=_0x5a7e86['id'];this[_0x2883('0x11')]=_0x5a7e86['name'];this[_0x2883('0x12')]=_0x5a7e86[_0x2883('0x12')];this[_0x2883('0x13')]=_0x5a7e86[_0x2883('0x13')]||0x0;this[_0x2883('0x5')]=_0x5a7e86[_0x2883('0x5')]||0x0;this['available']=_0x5a7e86['available']||0x0;this[_0x2883('0x14')]=_0x5a7e86[_0x2883('0x14')]||0x0;this['inUse']=_0x5a7e86[_0x2883('0x15')]||0x0;this[_0x2883('0x16')]=_0x5a7e86[_0x2883('0x16')]||0x0;this[_0x2883('0x1')]=_0x5a7e86[_0x2883('0x1')]||0x0;this[_0x2883('0x6')]=_0x5a7e86[_0x2883('0x6')]||0x0;this[_0x2883('0x17')]=_0x5a7e86['onHold']||0x0;this[_0x2883('0x18')]=_0x5a7e86[_0x2883('0x18')]||0x0;this[_0x2883('0xe')]=_0x5a7e86[_0x2883('0xe')]||0x0;this[_0x2883('0x2')]=_0x5a7e86[_0x2883('0x2')]||0x0;this[_0x2883('0x19')]=_0x5a7e86[_0x2883('0x19')];this[_0x2883('0x1a')]=_0x5a7e86['sumBillable'];this[_0x2883('0x10')]=_0x5a7e86[_0x2883('0x10')];this[_0x2883('0x1b')]=_0x5a7e86['sumHoldTime']||0x0;this[_0x2883('0x3')]=_0x5a7e86['talking']||0x0;this[_0x2883('0x1c')]=_0x5a7e86[_0x2883('0x1c')]||0x0;this[_0x2883('0x1d')]=_0x5a7e86['type'];this[_0x2883('0x1e')]=_0x5a7e86[_0x2883('0x1e')]||0x0;this['unknown']=_0x5a7e86[_0x2883('0x1f')]||0x0;this['unmanaged']=_0x5a7e86[_0x2883('0x20')]||0x0;this['waiting']=_0x5a7e86['waiting']||0x0;if(_0x5a7e86['type']===_0x2883('0x21')){this['pTalking']=_0x5a7e86['pTalking']||0x0;this[_0x2883('0x22')]=_0x5a7e86['dialActive'];this[_0x2883('0x23')]=_0x5a7e86[_0x2883('0x23')];this[_0x2883('0x24')]=_0x5a7e86[_0x2883('0x24')];this[_0x2883('0x25')]=_0x5a7e86[_0x2883('0x25')];this['dialOriginateTimeout']=_0x5a7e86[_0x2883('0x26')];this[_0x2883('0x27')]=_0x5a7e86['dialPrefix'];this[_0x2883('0x28')]=_0x5a7e86[_0x2883('0x28')];this[_0x2883('0x29')]=_0x5a7e86[_0x2883('0x29')];this['outboundAnswerCallsDay']=_0x5a7e86['outboundAnswerCallsDay'];this[_0x2883('0x2a')]=_0x5a7e86['outboundBlacklistCallsDay'];this[_0x2883('0x9')]=_0x5a7e86[_0x2883('0x9')];this[_0x2883('0xa')]=_0x5a7e86['outboundCongestionCallsDay'];this[_0x2883('0x2b')]=_0x5a7e86[_0x2883('0x2b')];this[_0x2883('0x2c')]=_0x5a7e86['outboundDropCallsDayCallersExit'];this[_0x2883('0x2d')]=_0x5a7e86[_0x2883('0x2d')];this[_0x2883('0x2e')]=_0x5a7e86['outboundNoAnswerCallsDay'];this[_0x2883('0x2f')]=_0x5a7e86['outboundNoSuchCallsDay'];this[_0x2883('0x30')]=_0x5a7e86[_0x2883('0x30')];this[_0x2883('0xb')]=_0x5a7e86[_0x2883('0xb')];this[_0x2883('0xc')]=_0x5a7e86['outboundRejectCallsDay'];this[_0x2883('0xd')]=_0x5a7e86[_0x2883('0xd')];this[_0x2883('0x31')]=_0x5a7e86['predictiveIntervalAnsweredCalls'];this[_0x2883('0x32')]=_0x5a7e86['predictiveIntervalAvgHoldtime'];this[_0x2883('0x33')]=_0x5a7e86[_0x2883('0x33')];this[_0x2883('0x34')]=_0x5a7e86[_0x2883('0x34')];this['predictiveIntervalDroppedCallsTimeout']=_0x5a7e86[_0x2883('0x35')];this[_0x2883('0x36')]=_0x5a7e86[_0x2883('0x36')];this[_0x2883('0x37')]=_0x5a7e86[_0x2883('0x37')];this['predictiveIntervalHitRate']=_0x5a7e86[_0x2883('0x38')];this[_0x2883('0x39')]=_0x5a7e86[_0x2883('0x39')];this[_0x2883('0x3a')]=_0x5a7e86[_0x2883('0x3a')];this[_0x2883('0x3b')]=_0x5a7e86[_0x2883('0x3b')];this['predictiveIntervalTotalCalls']=_0x5a7e86[_0x2883('0x3c')];this[_0x2883('0x7')]=_0x5a7e86[_0x2883('0x7')];this['erlangCalls']=_0x5a7e86[_0x2883('0x3d')];this[_0x2883('0x3e')]=_0x5a7e86[_0x2883('0x3e')];this[_0x2883('0x3f')]=_0x5a7e86[_0x2883('0x3f')];this[_0x2883('0x40')]=_0x5a7e86[_0x2883('0x40')];this[_0x2883('0x41')]=_0x5a7e86['startPredictive'];this['startProgressive']=_0x5a7e86[_0x2883('0x42')];this[_0x2883('0x43')]=_0x5a7e86['message'];this[_0x2883('0x44')]=_0x5a7e86['statusMessage'];}if(_0x5a7e86['Trunk']){this[_0x2883('0x45')]={'id':_0x5a7e86[_0x2883('0x45')]['id'],'name':_0x5a7e86[_0x2883('0x45')][_0x2883('0x11')],'active':_0x5a7e86[_0x2883('0x45')][_0x2883('0x46')],'callerid':_0x5a7e86['Trunk']['callerid']};}}VoiceQueueSummary[_0x2883('0x47')][_0x2883('0x48')]=function(_0x300969,_0x1aa54f,_0x53c581,_0x18e690){this['loggedInDb']=0x0;this['talking']=0x0;this[_0x2883('0xe')]=0x0;this[_0x2883('0x1f')]=0x0;this['notInUse']=0x0;this[_0x2883('0x15')]=0x0;this[_0x2883('0x14')]=0x0;this[_0x2883('0x16')]=0x0;this[_0x2883('0x1e')]=0x0;this[_0x2883('0x2')]=0x0;this['ringInUse']=0x0;this[_0x2883('0x17')]=0x0;if(_0x53c581){if(_0x53c581['available']){this[_0x2883('0x0')]=Number(_0x53c581['available']);}if(_0x53c581[_0x2883('0x49')]){this['loggedIn']=Number(_0x53c581[_0x2883('0x49')]);}if(_0x53c581[_0x2883('0x4a')]){this['waiting']=Number(_0x53c581[_0x2883('0x4a')]);}}for(var _0x4937dc=0x0;_0x4937dc<_0x300969['length'];_0x4937dc++){var _0x270d5a=_0x1aa54f[_0x2883('0x4b')+_0x300969[_0x4937dc]['name']];if(_0x270d5a&&_0x270d5a['online']){this['loggedInDb']+=0x1;}if(_0x300969[_0x4937dc][_0x2883('0x4c')]==='1'){this['talking']+=0x1;}if(_0x300969[_0x4937dc][_0x2883('0xe')]==='1'&&!['2','7','8']['includes'](_0x300969[_0x4937dc][_0x2883('0x4d')])){this[_0x2883('0xe')]+=0x1;}switch(_0x300969[_0x4937dc][_0x2883('0x4d')]){case'0':this[_0x2883('0x1f')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x2883('0x16')]+=0x1;break;case'5':this[_0x2883('0x1e')]+=0x1;break;case'6':this[_0x2883('0x2')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0x2883('0x17')]+=0x1;break;}}if(this[_0x2883('0x23')]===_0x2883('0x4e')){var _0x2e64c1=Object[_0x2883('0x4f')](_0x18e690);for(var _0xc2a4af=0x0;_0xc2a4af<_0x2e64c1['length'];_0xc2a4af++){var _0x35f388=_0x2e64c1[_0xc2a4af];var _0x578a1c=_0x18e690[_0x35f388];if(_0x578a1c[_0x2883('0x50')]===this[_0x2883('0x11')]&&_0x578a1c[_0x2883('0x1d')]===_0x2883('0x51')&&_0x578a1c[_0x2883('0x52')]===_0x2883('0x53')){this[_0x2883('0x3')]+=0x1;}}if(this[_0x2883('0x3')]>this['inUse']){this['talking']=this[_0x2883('0x15')];}this[_0x2883('0xf')]=0x0;}return this;};VoiceQueueSummary['prototype']['compareToInboundQueue']=function(_0x52d0ab){var _0x2321c0=![];if(_0x52d0ab){_0x2321c0=INBOUND_COUNTERS['some'](function(_0x4d18e3){return this[_0x4d18e3]!==_0x52d0ab[_0x4d18e3];},this);}return _0x2321c0;};VoiceQueueSummary[_0x2883('0x47')][_0x2883('0x54')]=function(_0x4f7161){var _0x54da49=![];var _0x18c6e1=![];var _0x527360=![];if(_0x4f7161){_0x54da49=this[_0x2883('0x23')]!==_0x4f7161[_0x2883('0x23')]||this[_0x2883('0x22')]!==_0x4f7161[_0x2883('0x22')]||this['message']!==_0x4f7161['message']||this[_0x2883('0x44')]!==_0x4f7161['statusMessage'];_0x18c6e1=OUTBOUND_COUNTERS[_0x2883('0x55')](function(_0x3923bb){return this[_0x3923bb]!==_0x4f7161[_0x3923bb];},this);if(this[_0x2883('0x45')]&&_0x4f7161[_0x2883('0x45')]){_0x527360=this[_0x2883('0x45')]['name']!==_0x4f7161[_0x2883('0x45')][_0x2883('0x11')]||this[_0x2883('0x45')][_0x2883('0x46')]!==_0x4f7161[_0x2883('0x45')][_0x2883('0x46')];}}return _0x54da49||_0x18c6e1||_0x527360;};VoiceQueueSummary[_0x2883('0x47')]['updateReportFromOutboundQueue']=function(_0x4eb8ce){this['answered']=_0x4eb8ce[_0x2883('0x5')];this['message']=_0x4eb8ce['message'];this[_0x2883('0x44')]=_0x4eb8ce[_0x2883('0x44')];this[_0x2883('0x7')]=_0x4eb8ce[_0x2883('0x7')];this[_0x2883('0x56')]=_0x4eb8ce[_0x2883('0x56')];this[_0x2883('0x8')]=_0x4eb8ce[_0x2883('0x8')];this[_0x2883('0x2a')]=_0x4eb8ce[_0x2883('0x2a')];this[_0x2883('0x9')]=_0x4eb8ce[_0x2883('0x9')];this[_0x2883('0xa')]=_0x4eb8ce['outboundCongestionCallsDay'];this[_0x2883('0x2e')]=_0x4eb8ce[_0x2883('0x2e')];this[_0x2883('0x2f')]=_0x4eb8ce[_0x2883('0x2f')];this[_0x2883('0xb')]=_0x4eb8ce[_0x2883('0xb')];this['outboundRejectCallsDay']=_0x4eb8ce[_0x2883('0xc')];this[_0x2883('0xd')]=_0x4eb8ce[_0x2883('0xd')];this[_0x2883('0x1a')]=_0x4eb8ce[_0x2883('0x1a')];this['sumDuration']=_0x4eb8ce[_0x2883('0x10')];this['total']=_0x4eb8ce['total'];if(this[_0x2883('0x23')]==='preview'){this[_0x2883('0xf')]=_0x4eb8ce[_0x2883('0xf')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0xf23b=['unavailable','unknown','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','notInUse','loggedin','callers','length','SIP/','online','incall','includes','status','booked','queue','dialer','prototype','compareToInboundQueue','some','compareToOutboundQueue','outboundBlacklistCallsDay','preview','available','loggedIn','loggedInDb','paused','ringing','waiting','answered','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','talking','sumBillable','sumDuration','total','name','strategy','abandoned','busy','inUse','invalid','onHold','ringInUse','sumHoldTime','type'];(function(_0xeeb6af,_0x1d8e07){var _0x1b6858=function(_0x452807){while(--_0x452807){_0xeeb6af['push'](_0xeeb6af['shift']());}};_0x1b6858(++_0x1d8e07);}(_0xf23b,0x133));var _0xbf23=function(_0x209b05,_0x4f9fe9){_0x209b05=_0x209b05-0x0;var _0x30c7d8=_0xf23b[_0x209b05];return _0x30c7d8;};'use strict';var INBOUND_COUNTERS=[_0xbf23('0x0'),_0xbf23('0x1'),_0xbf23('0x2'),_0xbf23('0x3'),_0xbf23('0x4'),'talking',_0xbf23('0x5')];var OUTBOUND_COUNTERS=[_0xbf23('0x0'),_0xbf23('0x6'),'inUse',_0xbf23('0x1'),_0xbf23('0x2'),_0xbf23('0x7'),_0xbf23('0x8'),_0xbf23('0x9'),'outboundBlacklistCallsDay','outboundBusyCallsDay',_0xbf23('0xa'),'outboundNoAnswerCallsDay',_0xbf23('0xb'),_0xbf23('0xc'),_0xbf23('0xd'),_0xbf23('0xe'),_0xbf23('0x3'),'pTalking',_0xbf23('0xf'),_0xbf23('0x10'),_0xbf23('0x11'),_0xbf23('0x12'),_0xbf23('0x5')];function VoiceQueueSummary(_0x41b016){this['id']=_0x41b016['id'];this['name']=_0x41b016[_0xbf23('0x13')];this['strategy']=_0x41b016[_0xbf23('0x14')];this['abandoned']=_0x41b016[_0xbf23('0x15')]||0x0;this[_0xbf23('0x6')]=_0x41b016['answered']||0x0;this[_0xbf23('0x0')]=_0x41b016['available']||0x0;this['busy']=_0x41b016[_0xbf23('0x16')]||0x0;this[_0xbf23('0x17')]=_0x41b016['inUse']||0x0;this['invalid']=_0x41b016[_0xbf23('0x18')]||0x0;this['loggedIn']=_0x41b016[_0xbf23('0x1')]||0x0;this[_0xbf23('0x2')]=_0x41b016[_0xbf23('0x2')]||0x0;this[_0xbf23('0x19')]=_0x41b016['onHold']||0x0;this['notInUse']=_0x41b016['notInUse']||0x0;this[_0xbf23('0x3')]=_0x41b016[_0xbf23('0x3')]||0x0;this[_0xbf23('0x4')]=_0x41b016[_0xbf23('0x4')]||0x0;this['ringInUse']=_0x41b016[_0xbf23('0x1a')];this[_0xbf23('0x10')]=_0x41b016[_0xbf23('0x10')];this['sumDuration']=_0x41b016[_0xbf23('0x11')];this[_0xbf23('0x1b')]=_0x41b016[_0xbf23('0x1b')]||0x0;this[_0xbf23('0xf')]=_0x41b016['talking']||0x0;this[_0xbf23('0x12')]=_0x41b016['total']||0x0;this[_0xbf23('0x1c')]=_0x41b016['type'];this[_0xbf23('0x1d')]=_0x41b016[_0xbf23('0x1d')]||0x0;this[_0xbf23('0x1e')]=_0x41b016[_0xbf23('0x1e')]||0x0;this['unmanaged']=_0x41b016['unmanaged']||0x0;this['waiting']=_0x41b016[_0xbf23('0x5')]||0x0;if(_0x41b016[_0xbf23('0x1c')]==='outbound'){this['pTalking']=_0x41b016[_0xbf23('0x1f')]||0x0;this[_0xbf23('0x20')]=_0x41b016[_0xbf23('0x20')];this[_0xbf23('0x21')]=_0x41b016[_0xbf23('0x21')];this[_0xbf23('0x22')]=_0x41b016[_0xbf23('0x22')];this[_0xbf23('0x23')]=_0x41b016[_0xbf23('0x23')];this[_0xbf23('0x24')]=_0x41b016[_0xbf23('0x24')];this['dialPrefix']=_0x41b016['dialPrefix'];this[_0xbf23('0x25')]=_0x41b016['temp'];this[_0xbf23('0x26')]=_0x41b016[_0xbf23('0x26')];this['outboundAnswerCallsDay']=_0x41b016[_0xbf23('0x9')];this['outboundBlacklistCallsDay']=_0x41b016['outboundBlacklistCallsDay'];this[_0xbf23('0x27')]=_0x41b016['outboundBusyCallsDay'];this[_0xbf23('0xa')]=_0x41b016[_0xbf23('0xa')];this[_0xbf23('0x28')]=_0x41b016[_0xbf23('0x28')];this[_0xbf23('0x29')]=_0x41b016[_0xbf23('0x29')];this[_0xbf23('0x2a')]=_0x41b016[_0xbf23('0x2a')];this['outboundNoAnswerCallsDay']=_0x41b016[_0xbf23('0x2b')];this[_0xbf23('0xb')]=_0x41b016['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0x41b016[_0xbf23('0x2c')];this['outboundReCallsDay']=_0x41b016[_0xbf23('0xc')];this[_0xbf23('0xd')]=_0x41b016[_0xbf23('0xd')];this[_0xbf23('0xe')]=_0x41b016[_0xbf23('0xe')];this[_0xbf23('0x2d')]=_0x41b016['predictiveIntervalAnsweredCalls'];this['predictiveIntervalAvgHoldtime']=_0x41b016[_0xbf23('0x2e')];this[_0xbf23('0x2f')]=_0x41b016['predictiveIntervalAvgTalktime'];this[_0xbf23('0x30')]=_0x41b016['predictiveIntervalDroppedCallsCallersExit'];this['predictiveIntervalDroppedCallsTimeout']=_0x41b016[_0xbf23('0x31')];this[_0xbf23('0x32')]=_0x41b016[_0xbf23('0x32')];this[_0xbf23('0x33')]=_0x41b016['predictiveIntervalErlangCallsDroppedCalls'];this[_0xbf23('0x34')]=_0x41b016[_0xbf23('0x34')];this[_0xbf23('0x35')]=_0x41b016[_0xbf23('0x35')];this[_0xbf23('0x36')]=_0x41b016['predictiveIntervalPauses'];this['predictiveIntervalAvailable']=_0x41b016['predictiveIntervalAvailable'];this[_0xbf23('0x37')]=_0x41b016[_0xbf23('0x37')];this['originated']=_0x41b016['originated'];this[_0xbf23('0x38')]=_0x41b016[_0xbf23('0x38')];this['erlangCallToSecond']=_0x41b016[_0xbf23('0x39')];this[_0xbf23('0x3a')]=_0x41b016['erlangAbandonmentRate'];this[_0xbf23('0x3b')]=_0x41b016[_0xbf23('0x3b')];this[_0xbf23('0x3c')]=_0x41b016['startPredictive'];this['startProgressive']=_0x41b016[_0xbf23('0x3d')];this[_0xbf23('0x3e')]=_0x41b016[_0xbf23('0x3e')];this[_0xbf23('0x3f')]=_0x41b016[_0xbf23('0x3f')];}if(_0x41b016[_0xbf23('0x40')]){this['Trunk']={'id':_0x41b016[_0xbf23('0x40')]['id'],'name':_0x41b016['Trunk'][_0xbf23('0x13')],'active':_0x41b016[_0xbf23('0x40')][_0xbf23('0x41')],'callerid':_0x41b016[_0xbf23('0x40')]['callerid']};}}VoiceQueueSummary['prototype']['createReport']=function(_0x5614b3,_0x416c17,_0x59ff19,_0xcb5dc5){this[_0xbf23('0x2')]=0x0;this['talking']=0x0;this[_0xbf23('0x3')]=0x0;this[_0xbf23('0x1e')]=0x0;this[_0xbf23('0x42')]=0x0;this[_0xbf23('0x17')]=0x0;this[_0xbf23('0x16')]=0x0;this[_0xbf23('0x18')]=0x0;this['unavailable']=0x0;this['ringing']=0x0;this[_0xbf23('0x1a')]=0x0;this[_0xbf23('0x19')]=0x0;if(_0x59ff19){if(_0x59ff19[_0xbf23('0x0')]){this[_0xbf23('0x0')]=Number(_0x59ff19['available']);}if(_0x59ff19['loggedin']){this['loggedIn']=Number(_0x59ff19[_0xbf23('0x43')]);}if(_0x59ff19[_0xbf23('0x44')]){this[_0xbf23('0x5')]=Number(_0x59ff19[_0xbf23('0x44')]);}}for(var _0x40e3af=0x0;_0x40e3af<_0x5614b3[_0xbf23('0x45')];_0x40e3af++){var _0x508a39=_0x416c17[_0xbf23('0x46')+_0x5614b3[_0x40e3af]['name']];if(_0x508a39&&_0x508a39[_0xbf23('0x47')]){this[_0xbf23('0x2')]+=0x1;}if(_0x5614b3[_0x40e3af][_0xbf23('0x48')]==='1'){this[_0xbf23('0xf')]+=0x1;}if(_0x5614b3[_0x40e3af][_0xbf23('0x3')]==='1'&&!['2','7','8'][_0xbf23('0x49')](_0x5614b3[_0x40e3af][_0xbf23('0x4a')])){this[_0xbf23('0x3')]+=0x1;}switch(_0x5614b3[_0x40e3af]['status']){case'0':this[_0xbf23('0x1e')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0xbf23('0x17')]+=0x1;break;case'3':this[_0xbf23('0x16')]+=0x1;break;case'4':this[_0xbf23('0x18')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0xbf23('0x4')]+=0x1;break;case'7':this[_0xbf23('0x1a')]+=0x1;break;case'8':this[_0xbf23('0x19')]+=0x1;break;}}if(this['dialMethod']===_0xbf23('0x4b')){var _0x425122=Object['keys'](_0xcb5dc5);for(var _0x4c7254=0x0;_0x4c7254<_0x425122[_0xbf23('0x45')];_0x4c7254++){var _0x376272=_0x425122[_0x4c7254];var _0x38f9f1=_0xcb5dc5[_0x376272];if(_0x38f9f1[_0xbf23('0x4c')]===this[_0xbf23('0x13')]&&_0x38f9f1['type']===_0xbf23('0x4d')&&_0x38f9f1['exten']==='xcally-motion-preview'){this[_0xbf23('0xf')]+=0x1;}}if(this[_0xbf23('0xf')]>this[_0xbf23('0x17')]){this[_0xbf23('0xf')]=this[_0xbf23('0x17')];}this[_0xbf23('0x1f')]=0x0;}return this;};VoiceQueueSummary[_0xbf23('0x4e')][_0xbf23('0x4f')]=function(_0x777a67){var _0x18cc14=![];if(_0x777a67){_0x18cc14=INBOUND_COUNTERS[_0xbf23('0x50')](function(_0x49f8be){return this[_0x49f8be]!==_0x777a67[_0x49f8be];},this);}return _0x18cc14;};VoiceQueueSummary[_0xbf23('0x4e')][_0xbf23('0x51')]=function(_0x23775c){var _0x42f9a5=![];var _0x35eff9=![];var _0x4de377=![];if(_0x23775c){_0x42f9a5=this[_0xbf23('0x21')]!==_0x23775c['dialMethod']||this['dialActive']!==_0x23775c[_0xbf23('0x20')]||this[_0xbf23('0x3e')]!==_0x23775c[_0xbf23('0x3e')]||this[_0xbf23('0x3f')]!==_0x23775c['statusMessage'];_0x35eff9=OUTBOUND_COUNTERS[_0xbf23('0x50')](function(_0x103825){return this[_0x103825]!==_0x23775c[_0x103825];},this);if(this['Trunk']&&_0x23775c[_0xbf23('0x40')]){_0x4de377=this[_0xbf23('0x40')][_0xbf23('0x13')]!==_0x23775c[_0xbf23('0x40')][_0xbf23('0x13')]||this[_0xbf23('0x40')][_0xbf23('0x41')]!==_0x23775c['Trunk']['active'];}}return _0x42f9a5||_0x35eff9||_0x4de377;};VoiceQueueSummary['prototype']['updateReportFromOutboundQueue']=function(_0x294679){this[_0xbf23('0x6')]=_0x294679[_0xbf23('0x6')];this['message']=_0x294679['message'];this[_0xbf23('0x3f')]=_0x294679['statusMessage'];this[_0xbf23('0x7')]=_0x294679[_0xbf23('0x7')];this[_0xbf23('0x8')]=_0x294679[_0xbf23('0x8')];this[_0xbf23('0x9')]=_0x294679['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x294679[_0xbf23('0x52')];this['outboundBusyCallsDay']=_0x294679[_0xbf23('0x27')];this[_0xbf23('0xa')]=_0x294679['outboundCongestionCallsDay'];this[_0xbf23('0x2b')]=_0x294679[_0xbf23('0x2b')];this[_0xbf23('0xb')]=_0x294679[_0xbf23('0xb')];this[_0xbf23('0xc')]=_0x294679[_0xbf23('0xc')];this[_0xbf23('0xd')]=_0x294679[_0xbf23('0xd')];this[_0xbf23('0xe')]=_0x294679[_0xbf23('0xe')];this[_0xbf23('0x10')]=_0x294679[_0xbf23('0x10')];this[_0xbf23('0x11')]=_0x294679[_0xbf23('0x11')];this[_0xbf23('0x12')]=_0x294679[_0xbf23('0x12')];if(this['dialMethod']===_0xbf23('0x53')){this[_0xbf23('0x1f')]=_0x294679['pTalking'];}};module['exports']=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 259554e..022af03 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 _0xaaea=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x2210b3,_0x2b0fdb){var _0x54aa01=function(_0x4f6b6e){while(--_0x4f6b6e){_0x2210b3['push'](_0x2210b3['shift']());}};_0x54aa01(++_0x2b0fdb);}(_0xaaea,0xc1));var _0xaaae=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xaaea[_0x17d9e3];return _0x14192d;};'use strict';function VtigerAccount(_0x532104){this['id']=_0x532104['id']||0x0;this[_0xaaae('0x0')]=_0x532104[_0xaaae('0x0')]||'';this['username']=_0x532104[_0xaaae('0x1')]||'';this[_0xaaae('0x2')]=_0x532104['accessKey']||'';this[_0xaaae('0x3')]=_0x532104[_0xaaae('0x3')]||'';this[_0xaaae('0x4')]=_0x532104['serverUrl']||'';this[_0xaaae('0x5')]=_0x532104[_0xaaae('0x5')]||{};}module[_0xaaae('0x6')]=VtigerAccount; \ No newline at end of file +var _0x96d6=['serverUrl','name','username','accessKey','remoteUri'];(function(_0x23b727,_0x143870){var _0x127e4b=function(_0x5ee1a7){while(--_0x5ee1a7){_0x23b727['push'](_0x23b727['shift']());}};_0x127e4b(++_0x143870);}(_0x96d6,0x123));var _0x696d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x96d6[_0xa464c9];return _0x3d73c4;};'use strict';function VtigerAccount(_0x2cd1d8){this['id']=_0x2cd1d8['id']||0x0;this[_0x696d('0x0')]=_0x2cd1d8[_0x696d('0x0')]||'';this[_0x696d('0x1')]=_0x2cd1d8['username']||'';this[_0x696d('0x2')]=_0x2cd1d8[_0x696d('0x2')]||'';this[_0x696d('0x3')]=_0x2cd1d8[_0x696d('0x3')]||'';this[_0x696d('0x4')]=_0x2cd1d8['serverUrl']||'';this['Configurations']=_0x2cd1d8['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 8eeb73d..f27eb16 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 _0x7622=['type','integrationTab','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x59f0ff,_0x2b9d67){var _0x28e782=function(_0x437e09){while(--_0x437e09){_0x59f0ff['push'](_0x59f0ff['shift']());}};_0x28e782(++_0x2b9d67);}(_0x7622,0x72));var _0x2762=function(_0x1fd833,_0x4c0d80){_0x1fd833=_0x1fd833-0x0;var _0x514637=_0x7622[_0x1fd833];return _0x514637;};'use strict';function ZendeskAccount(_0x348523){this['id']=_0x348523['id']||0x0;this[_0x2762('0x0')]=_0x348523[_0x2762('0x0')]||'';this[_0x2762('0x1')]=_0x348523['username']||'';this[_0x2762('0x2')]=_0x348523[_0x2762('0x2')]||'';this['token']=_0x348523[_0x2762('0x3')]||'';this['remoteUri']=_0x348523[_0x2762('0x4')]||'';this['authType']=_0x348523[_0x2762('0x5')]||'';this[_0x2762('0x6')]=_0x348523[_0x2762('0x6')]||_0x2762('0x7');this['serverUrl']=_0x348523['serverUrl']||'';this[_0x2762('0x8')]=_0x348523[_0x2762('0x8')]||{};}module[_0x2762('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xf346=['authType','type','serverUrl','Configurations','name','username','password','token','remoteUri'];(function(_0x55555f,_0x505b88){var _0x208602=function(_0x1cbc63){while(--_0x1cbc63){_0x55555f['push'](_0x55555f['shift']());}};_0x208602(++_0x505b88);}(_0xf346,0x1ab));var _0x6f34=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xf346[_0x4d613c];return _0x301fe3;};'use strict';function ZendeskAccount(_0x463adc){this['id']=_0x463adc['id']||0x0;this[_0x6f34('0x0')]=_0x463adc['name']||'';this[_0x6f34('0x1')]=_0x463adc[_0x6f34('0x1')]||'';this[_0x6f34('0x2')]=_0x463adc[_0x6f34('0x2')]||'';this[_0x6f34('0x3')]=_0x463adc['token']||'';this[_0x6f34('0x4')]=_0x463adc[_0x6f34('0x4')]||'';this[_0x6f34('0x5')]=_0x463adc['authType']||'';this[_0x6f34('0x6')]=_0x463adc[_0x6f34('0x6')]||'integrationTab';this['serverUrl']=_0x463adc[_0x6f34('0x7')]||'';this[_0x6f34('0x8')]=_0x463adc[_0x6f34('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 5a5f661..c52eba9 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 _0xe4cc=['zone','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x28d1cd,_0x192371){var _0xdcb892=function(_0x145f6e){while(--_0x145f6e){_0x28d1cd['push'](_0x28d1cd['shift']());}};_0xdcb892(++_0x192371);}(_0xe4cc,0xd9));var _0xce4c=function(_0x1228ae,_0x8040f3){_0x1228ae=_0x1228ae-0x0;var _0x15694a=_0xe4cc[_0x1228ae];return _0x15694a;};'use strict';function ZohoAccount(_0xb946e8){this['id']=_0xb946e8['id']||0x0;this[_0xce4c('0x0')]=_0xb946e8[_0xce4c('0x0')]||'';this[_0xce4c('0x1')]=_0xb946e8[_0xce4c('0x1')]||'';this['host']=_0xb946e8[_0xce4c('0x2')]||'';this[_0xce4c('0x3')]=_0xb946e8[_0xce4c('0x3')]||'';this['clientId']=_0xb946e8['clientId']||'';this[_0xce4c('0x4')]=_0xb946e8[_0xce4c('0x4')]||'';this[_0xce4c('0x5')]=_0xb946e8[_0xce4c('0x5')]||'';this[_0xce4c('0x6')]=_0xb946e8[_0xce4c('0x6')]||'';this[_0xce4c('0x7')]=_0xb946e8['refreshToken']||'';this[_0xce4c('0x8')]=_0xb946e8[_0xce4c('0x8')]||{};}module[_0xce4c('0x9')]=ZohoAccount; \ No newline at end of file +var _0xf908=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x147003,_0x36e2e3){var _0x5167b2=function(_0x5b54da){while(--_0x5b54da){_0x147003['push'](_0x147003['shift']());}};_0x5167b2(++_0x36e2e3);}(_0xf908,0x100));var _0x8f90=function(_0x59659a,_0x1f93f4){_0x59659a=_0x59659a-0x0;var _0x56e8f1=_0xf908[_0x59659a];return _0x56e8f1;};'use strict';function ZohoAccount(_0x1a8b4e){this['id']=_0x1a8b4e['id']||0x0;this[_0x8f90('0x0')]=_0x1a8b4e[_0x8f90('0x0')]||'';this['description']=_0x1a8b4e[_0x8f90('0x1')]||'';this[_0x8f90('0x2')]=_0x1a8b4e[_0x8f90('0x2')]||'';this[_0x8f90('0x3')]=_0x1a8b4e[_0x8f90('0x3')]||'';this['clientId']=_0x1a8b4e[_0x8f90('0x4')]||'';this[_0x8f90('0x5')]=_0x1a8b4e[_0x8f90('0x5')]||'';this[_0x8f90('0x6')]=_0x1a8b4e[_0x8f90('0x6')]||'';this[_0x8f90('0x7')]=_0x1a8b4e[_0x8f90('0x7')]||'';this[_0x8f90('0x8')]=_0x1a8b4e[_0x8f90('0x8')]||'';this[_0x8f90('0x9')]=_0x1a8b4e[_0x8f90('0x9')]||{};}module[_0x8f90('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index f763d8c..fe3df91 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 _0x4213=['name','type','dialAnswer','isNil','Agent','channelAgent','membername','format','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','number','util','lodash','moment','string','uniqueid','idContact','queue'];(function(_0x597ba0,_0x396a50){var _0x7b7195=function(_0x59fd82){while(--_0x59fd82){_0x597ba0['push'](_0x597ba0['shift']());}};_0x7b7195(++_0x396a50);}(_0x4213,0x77));var _0x3421=function(_0x2c60b7,_0x2fe13d){_0x2c60b7=_0x2c60b7-0x0;var _0x3ed083=_0x4213[_0x2c60b7];return _0x3ed083;};'use strict';var util=require(_0x3421('0x0'));var _=require(_0x3421('0x1'));var moment=require(_0x3421('0x2'));function checkNameSurname(_0x7870a4,_0x2613b6,_0x153f3a){var _0x1bab18='';if(!_['isNil'](_0x2613b6)&&_0x3421('0x3')===typeof _0x2613b6){_0x1bab18+=_0x2613b6;}if(!_['isNil'](_0x153f3a)&&_0x3421('0x3')===typeof _0x153f3a){_0x1bab18+='\x20'+_0x153f3a;}if(_0x1bab18!==''){return _0x1bab18;}return _0x7870a4;}function Action(_0xfe969c,_0x2155f8,_0x2a04e0,_0x5469d8,_0x50e464){this[_0x3421('0x4')]=_0x2a04e0||undefined;this[_0x3421('0x5')]=_0xfe969c['id'];this[_0x3421('0x6')]=_0x2155f8[_0x3421('0x7')];this['type']=_0x2155f8[_0x3421('0x8')];this['campaigntype']='queue';this[_0x3421('0x9')]=![];this['membername']=_[_0x3421('0xa')](_0xfe969c[_0x3421('0xb')])?undefined:_0xfe969c[_0x3421('0xb')][_0x3421('0x7')];this[_0x3421('0xc')]=this[_0x3421('0xd')]?util[_0x3421('0xe')]('SIP/%s',this[_0x3421('0xd')]):_0x5469d8||undefined;this[_0x3421('0xf')]=checkNameSurname(_0xfe969c[_0x3421('0x10')][_0x3421('0x11')],_0xfe969c[_0x3421('0x10')][_0x3421('0x12')],_0xfe969c[_0x3421('0x10')]['lastName']);this[_0x3421('0x13')]=_0xfe969c['active']||![];this[_0x3421('0x14')]=_0xfe969c[_0x3421('0x11')];this['scheduledat']=_0xfe969c[_0x3421('0x15')];this['countbusyretry']=_0xfe969c[_0x3421('0x16')]||0x0;this[_0x3421('0x17')]=_0xfe969c['countcongestionretry']||0x0;this[_0x3421('0x18')]=_0xfe969c[_0x3421('0x18')]||0x0;this[_0x3421('0x19')]=(_0xfe969c[_0x3421('0x16')]||0x0)+(_0xfe969c[_0x3421('0x17')]||0x0)+(_0xfe969c[_0x3421('0x18')]||0x0)+(_0xfe969c[_0x3421('0x1a')]||0x0)+(_0xfe969c[_0x3421('0x1b')]||0x0)+(_0xfe969c[_0x3421('0x1c')]||0x0)+(_0xfe969c[_0x3421('0x1d')]||0x0)+(_0xfe969c[_0x3421('0x1e')]||0x0);this['countnosuchnumberretry']=_0xfe969c[_0x3421('0x1a')]||0x0;this['countdropretry']=_0xfe969c['countdropretry']||0x0;this['countabandonedretry']=_0xfe969c[_0x3421('0x1c')]||0x0;this[_0x3421('0x1d')]=_0xfe969c[_0x3421('0x1d')]||0x0;this[_0x3421('0x1e')]=_0xfe969c[_0x3421('0x1e')]||0x0;this[_0x3421('0x1f')]=_0xfe969c[_0x3421('0x1f')];this[_0x3421('0x20')]=_0xfe969c[_0x3421('0x20')];this[_0x3421('0x21')]=_0xfe969c['callbackat'];this['recallme']=_0xfe969c['recallme'];this[_0x3421('0x22')]=_0xfe969c[_0x3421('0x22')];this[_0x3421('0x23')]=_0xfe969c['ListId'];this['UserId']=_[_0x3421('0xa')](_0xfe969c['Agent'])?_0xfe969c[_0x3421('0x24')]:_0xfe969c['Agent']['id'];this[_0x3421('0x25')]=_0xfe969c[_0x3421('0x25')];this[_0x3421('0x26')]='';this[_0x3421('0x27')]='';}Action[_0x3421('0x28')]['getCaller']=function(){return util[_0x3421('0xe')]('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x3421('0x29')]);};module['exports']=Action; \ No newline at end of file +var _0x32b6=['membername','Agent','channelAgent','format','SIP/%s','calleridname','phone','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','isNil','string','uniqueid','queue','name','type'];(function(_0x482529,_0x55e934){var _0x48f41a=function(_0x5a00f2){while(--_0x5a00f2){_0x482529['push'](_0x482529['shift']());}};_0x48f41a(++_0x55e934);}(_0x32b6,0x1d1));var _0x632b=function(_0x299eb0,_0xff65d2){_0x299eb0=_0x299eb0-0x0;var _0x40b015=_0x32b6[_0x299eb0];return _0x40b015;};'use strict';var util=require(_0x632b('0x0'));var _=require(_0x632b('0x1'));var moment=require('moment');function checkNameSurname(_0x1f0635,_0x1d100a,_0x51c210){var _0x5ad871='';if(!_[_0x632b('0x2')](_0x1d100a)&&_0x632b('0x3')===typeof _0x1d100a){_0x5ad871+=_0x1d100a;}if(!_[_0x632b('0x2')](_0x51c210)&&_0x632b('0x3')===typeof _0x51c210){_0x5ad871+='\x20'+_0x51c210;}if(_0x5ad871!==''){return _0x5ad871;}return _0x1f0635;}function Action(_0x1adfe6,_0x122768,_0x24ceab,_0x10458a,_0x3bbf43){this[_0x632b('0x4')]=_0x24ceab||undefined;this['idContact']=_0x1adfe6['id'];this[_0x632b('0x5')]=_0x122768[_0x632b('0x6')];this[_0x632b('0x7')]=_0x122768[_0x632b('0x7')];this['campaigntype']='queue';this['dialAnswer']=![];this[_0x632b('0x8')]=_['isNil'](_0x1adfe6[_0x632b('0x9')])?undefined:_0x1adfe6[_0x632b('0x9')][_0x632b('0x6')];this[_0x632b('0xa')]=this[_0x632b('0x8')]?util[_0x632b('0xb')](_0x632b('0xc'),this[_0x632b('0x8')]):_0x10458a||undefined;this[_0x632b('0xd')]=checkNameSurname(_0x1adfe6['Contact'][_0x632b('0xe')],_0x1adfe6[_0x632b('0xf')][_0x632b('0x10')],_0x1adfe6['Contact'][_0x632b('0x11')]);this[_0x632b('0x12')]=_0x1adfe6[_0x632b('0x12')]||![];this[_0x632b('0x13')]=_0x1adfe6[_0x632b('0xe')];this[_0x632b('0x14')]=_0x1adfe6['scheduledat'];this[_0x632b('0x15')]=_0x1adfe6['countbusyretry']||0x0;this['countcongestionretry']=_0x1adfe6[_0x632b('0x16')]||0x0;this['countnoanswerretry']=_0x1adfe6[_0x632b('0x17')]||0x0;this[_0x632b('0x18')]=(_0x1adfe6[_0x632b('0x15')]||0x0)+(_0x1adfe6['countcongestionretry']||0x0)+(_0x1adfe6[_0x632b('0x17')]||0x0)+(_0x1adfe6[_0x632b('0x19')]||0x0)+(_0x1adfe6[_0x632b('0x1a')]||0x0)+(_0x1adfe6[_0x632b('0x1b')]||0x0)+(_0x1adfe6['countmachineretry']||0x0)+(_0x1adfe6[_0x632b('0x1c')]||0x0);this[_0x632b('0x19')]=_0x1adfe6['countnosuchnumberretry']||0x0;this[_0x632b('0x1a')]=_0x1adfe6['countdropretry']||0x0;this['countabandonedretry']=_0x1adfe6[_0x632b('0x1b')]||0x0;this['countmachineretry']=_0x1adfe6[_0x632b('0x1d')]||0x0;this[_0x632b('0x1c')]=_0x1adfe6[_0x632b('0x1c')]||0x0;this['callback']=_0x1adfe6[_0x632b('0x1e')];this[_0x632b('0x1f')]=_0x1adfe6['callbackuniqueid'];this[_0x632b('0x20')]=_0x1adfe6[_0x632b('0x20')];this[_0x632b('0x21')]=_0x1adfe6[_0x632b('0x21')];this[_0x632b('0x22')]=_0x1adfe6[_0x632b('0x22')];this['ListId']=_0x1adfe6['ListId'];this[_0x632b('0x23')]=_['isNil'](_0x1adfe6[_0x632b('0x9')])?_0x1adfe6[_0x632b('0x23')]:_0x1adfe6['Agent']['id'];this[_0x632b('0x24')]=_0x1adfe6[_0x632b('0x24')];this[_0x632b('0x25')]='';this[_0x632b('0x26')]='';}Action[_0x632b('0x27')][_0x632b('0x28')]=function(){return util[_0x632b('0xb')](_0x632b('0x29'),this[_0x632b('0xd')],this['number']);};module[_0x632b('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 973e09c..f14540f 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 _0x55ca=['syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','originated','sendMessageOneNotActive','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','prototype','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','preview','booked','type','outbound','clockClearZombieChannels','clearZombieChannels','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','originated:\x20','queue','pTalking:\x20','pick','UserId','ListId','Action','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','getContactRecallMe','agents','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','catch','starttime','outboundReCallsDay','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','dialActive','Trunk','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','cloneAction','countnosuchnumberretry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','pTalking','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','uniqueid','outboundBusyCallsDay','countbusyretry','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','Congestion','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','VoiceQueueId','Queue','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','Calling','[Preview][execCall][failure]','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','trunks','SIP/%s','status','reachable','unmonitored','run','unlock','disableContact','getContactPreview','recallme','validateContact','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','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','clone','unlockContact','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','actions','originateresponse','syncOriginateResponse','bind','hangup','syncHangup'];(function(_0x5bc3ef,_0x4d3f6e){var _0x1ce43f=function(_0x47af1f){while(--_0x47af1f){_0x5bc3ef['push'](_0x5bc3ef['shift']());}};_0x1ce43f(++_0x4d3f6e);}(_0x55ca,0x126));var _0xa55c=function(_0x4e0964,_0x4c179b){_0x4e0964=_0x4e0964-0x0;var _0x34eadf=_0x55ca[_0x4e0964];return _0x34eadf;};'use strict';var util=require(_0xa55c('0x0'));var _=require(_0xa55c('0x1'));var uuid=require('uuid');var moment=require('moment');var Redis=require('ioredis');var config=require(_0xa55c('0x2'));var logger=require(_0xa55c('0x3'))('preview');var loggerAction=require(_0xa55c('0x3'))(_0xa55c('0x4'));var ami=require(_0xa55c('0x5'));var rpcDb=require(_0xa55c('0x6'));var cmHopperAdditionalPhone=require(_0xa55c('0x7'));var Action=require(_0xa55c('0x8'));var ut=require(_0xa55c('0x9'));var utils=require('../dialer/utils');config[_0xa55c('0xa')]=_[_0xa55c('0xb')](config['redis'],{'host':_0xa55c('0xc'),'port':0x18eb});var io=require(_0xa55c('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0xa55c('0xe')]=function(_0x20c76a){this[_0xa55c('0xf')]=this[_0xa55c('0xf')]?this[_0xa55c('0xf')][_0xa55c('0x10')](_0x20c76a):_0x20c76a();};function Preview(_0x508342){this[_0xa55c('0x11')]=new Sequence();this[_0xa55c('0x12')]=_0x508342[_0xa55c('0x13')];this['trunks']=_0x508342['trunks'];this[_0xa55c('0x14')]={};this['agents']=_0x508342['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0xa55c('0x15'),this[_0xa55c('0x16')][_0xa55c('0x17')](this));ami['on'](_0xa55c('0x18'),this[_0xa55c('0x19')][_0xa55c('0x17')](this));ami['on']('hanguprequest',this[_0xa55c('0x1a')][_0xa55c('0x17')](this));ami['on'](_0xa55c('0x1b'),this[_0xa55c('0x1c')][_0xa55c('0x17')](this));ami['on'](_0xa55c('0x1d'),this[_0xa55c('0x1e')][_0xa55c('0x17')](this));ami['on'](_0xa55c('0x1f'),this['syncVarSet'][_0xa55c('0x17')](this));ami['on'](_0xa55c('0x20'),this[_0xa55c('0x21')][_0xa55c('0x17')](this));ami['on'](_0xa55c('0x22'),this[_0xa55c('0x23')]['bind'](this));this['loopCampaigns'](this[_0xa55c('0x12')]);}function emit(_0x3776ac,_0xade4c4,_0x4cfe10){io['to'](_0x3776ac)[_0xa55c('0x24')](_0xade4c4,_0x4cfe10);}function emitVoiceQueueChannelRemove(_0x2fcb90){logger['info'](_0xa55c('0x25'),JSON[_0xa55c('0x26')](_0x2fcb90));emit(util[_0xa55c('0x27')](_0xa55c('0x28'),_0x2fcb90[_0xa55c('0x29')]),'voice_queue_channel:remove',_0x2fcb90);io[_0xa55c('0x24')]('voice_queue_presence:remove',_0x2fcb90);}function notSendMessagesQueue(_0x5ba836){if(_0x5ba836['sendMessageOneNotActive']){if(_0x5ba836[_0xa55c('0x2a')]===0x0&&_0x5ba836['pTalking']===0x0){_0x5ba836[_0xa55c('0x2b')]=![];_0x5ba836[_0xa55c('0x2c')]=0x0;_0x5ba836[_0xa55c('0x2d')]=0x0;_0x5ba836[_0xa55c('0x2e')]=utils[_0xa55c('0x2f')][_0xa55c('0x30')];ut[_0xa55c('0x31')](_0xa55c('0x32'),_0x5ba836[_0xa55c('0x29')]+_0xa55c('0x33'));}else{_0x5ba836[_0xa55c('0x2e')]=utils['CAMPAIGN_STATUS'][_0xa55c('0x34')];ut[_0xa55c('0x31')](_0xa55c('0x32'),_0x5ba836[_0xa55c('0x29')]+'\x20is\x20deactivated');}}}Preview[_0xa55c('0x35')][_0xa55c('0x36')]=function(){var _0x1b8388=this;setInterval(function(){_0x1b8388[_0xa55c('0x37')]();},0x7cf);};Preview[_0xa55c('0x35')][_0xa55c('0x37')]=function(){var _0x52d37f=this[_0xa55c('0x12')];this['clockClearZombieChannels']+=0x1;for(var _0x35c9c2 in _0x52d37f){if(_0x52d37f[_0xa55c('0x38')](_0x35c9c2)&&(_0x52d37f[_0x35c9c2][_0xa55c('0x39')]===_0xa55c('0x3a')||_0x52d37f[_0x35c9c2]['dialMethod']===_0xa55c('0x3b'))&&_0x52d37f[_0x35c9c2][_0xa55c('0x3c')]===_0xa55c('0x3d')){if(this[_0xa55c('0x3e')]>0x7){this[_0xa55c('0x3e')]=0x0;this[_0xa55c('0x3f')]();}}if(_0x52d37f[_0xa55c('0x38')](_0x35c9c2)&&_0x52d37f[_0x35c9c2][_0xa55c('0x39')]===_0xa55c('0x3a')&&_0x52d37f[_0x35c9c2][_0xa55c('0x3c')]===_0xa55c('0x3d')){if(_0x52d37f[_0x35c9c2]['dialActive']){this['setMessage'](_0x52d37f[_0x35c9c2]);if(_0x52d37f[_0x35c9c2][_0xa55c('0x40')])this[_0xa55c('0x41')](_0x52d37f[_0x35c9c2]);}else{notSendMessagesQueue(_0x52d37f[_0x35c9c2]);}}}};Preview['prototype'][_0xa55c('0x42')]=function(_0x2f0110){var _0x2e9623=this;this[_0xa55c('0x11')][_0xa55c('0xe')](function(){if(!_[_0xa55c('0x43')](_0x2e9623[_0xa55c('0x14')][_0x2f0110])){loggerAction[_0xa55c('0x44')](_0xa55c('0x45'),_0x2f0110,'Queue',_0x2e9623['actions'][_0x2f0110]['queue'],_0xa55c('0x46'),JSON[_0xa55c('0x26')](_0x2e9623[_0xa55c('0x12')][_0x2e9623['actions'][_0x2f0110][_0xa55c('0x47')]]['originated']),_0xa55c('0x48'),JSON['stringify'](_0x2e9623[_0xa55c('0x12')][_0x2e9623[_0xa55c('0x14')][_0x2f0110][_0xa55c('0x47')]]['pTalking']),JSON[_0xa55c('0x26')](_0x2e9623[_0xa55c('0x14')][_0x2f0110]['dialAnswer']),JSON[_0xa55c('0x26')](_[_0xa55c('0x49')](_0x2e9623['actions'][_0x2f0110],['contactId',_0xa55c('0x4a'),'VoiceQueueId',_0xa55c('0x4b')])));return ami[_0xa55c('0x4c')]({'action':'status','channel':_0x2e9623['actions'][_0x2f0110]['channel']})['catch'](function(_0x3b3308){if(_0x3b3308[_0xa55c('0x2e')]===_0xa55c('0x4d')){setTimeout(function(){if(_0x2e9623[_0xa55c('0x14')][_0x2f0110]){ut[_0xa55c('0x4e')](_0x2e9623['campaignsPreview'][_0x2e9623[_0xa55c('0x14')][_0x2f0110][_0xa55c('0x47')]],_0xa55c('0x4f'));if(_0x2e9623[_0xa55c('0x14')][_0x2f0110][_0xa55c('0x50')]===!![]){ut[_0xa55c('0x51')](_0x2e9623['campaignsPreview'][_0x2e9623[_0xa55c('0x14')][_0x2f0110]['queue']],'[clearZombieChannel]');ut[_0xa55c('0x52')](_0xa55c('0x53')+_0x2f0110,_0x2e9623['actions'][_0x2f0110][_0xa55c('0x47')]);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x2f0110,_0x2e9623[_0xa55c('0x14')][_0x2f0110][_0xa55c('0x47')]);delete _0x2e9623[_0xa55c('0x14')][_0x2f0110];}},0x2328);}});}});};Preview['prototype'][_0xa55c('0x3f')]=function(){var _0xd5a006=this;loggerAction['info'](_0xa55c('0x54'),_['size'](this[_0xa55c('0x14')]));for(var _0x43a42d in this['actions']){if(_0xd5a006[_0xa55c('0x14')][_0xa55c('0x38')](_0x43a42d)){_0xd5a006['clearZombieChannel'](_0x43a42d);}}};Preview[_0xa55c('0x35')][_0xa55c('0x41')]=function(_0x204767){var _0x59a6c8=this;rpcDb[_0xa55c('0x55')](_0x204767['id'],ut['agentReadyId'](this[_0xa55c('0x56')]))[_0xa55c('0x57')](function(_0x451269){if(!_['isNil'](_0x451269)){for(var _0x41eab1=0x0;_0x41eab1<_0x451269[_0xa55c('0x58')];_0x41eab1+=0x1){if(ut['getDiff'](_0x451269[_0x41eab1][_0xa55c('0x59')])<_0x204767[_0xa55c('0x5a')]*0x3c){if(_0x451269[_0x41eab1]['Agent']&&!_0x451269[_0x41eab1][_0xa55c('0x5b')][_0xa55c('0x5c')]){_0x59a6c8['run'](_0x451269[_0x41eab1]['id'])[_0xa55c('0x57')](ut[_0xa55c('0x5d')](_0xa55c('0x5e')))[_0xa55c('0x5f')](ut['logger2'](_0xa55c('0x5e')));}else{rpcDb['disableContact'](_0x451269[_0x41eab1]['id']);}}else{var _0x2157d6=new Action(_0x451269[_0x41eab1],_0x204767);_0x2157d6[_0xa55c('0x60')]=moment()[_0xa55c('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0x204767[_0xa55c('0x61')]+=0x1;ut[_0xa55c('0x62')](_0x2157d6,0x17,'RecallInQueue');if(_0x204767[_0xa55c('0x63')]){rpcDb[_0xa55c('0x64')](ut[_0xa55c('0x65')](_0x451269[_0x41eab1]));rpcDb[_0xa55c('0x66')](_0x2157d6,_0xa55c('0x67'));}else{ut[_0xa55c('0x62')](_0x2157d6,0x16,_0xa55c('0x68'));rpcDb[_0xa55c('0x66')](_0x2157d6,_0xa55c('0x69'));rpcDb[_0xa55c('0x6a')](_0x2157d6,'[HistoryRecallClose]');}}}}})[_0xa55c('0x5f')](ut[_0xa55c('0x5d')](_0xa55c('0x6b')));};Preview['prototype'][_0xa55c('0x6c')]=function(_0x35bf0a){_0x35bf0a['sendMessageOneNotActive']=!![];if(ut[_0xa55c('0x6d')](_0x35bf0a['loggedIn'])){_0x35bf0a[_0xa55c('0x2e')]=utils[_0xa55c('0x2f')][_0xa55c('0x6e')];}else if(!ut[_0xa55c('0x6f')](_0x35bf0a[_0xa55c('0x70')])){_0x35bf0a['message']=utils[_0xa55c('0x2f')][_0xa55c('0x30')];}else if(!this['isTrunkReachable'](_0x35bf0a[_0xa55c('0x71')])){if(!this[_0xa55c('0x72')](_0x35bf0a[_0xa55c('0x73')])){_0x35bf0a[_0xa55c('0x2e')]=utils['CAMPAIGN_STATUS']['UNREACHABLE_TRUNK'];}else{_0x35bf0a[_0xa55c('0x2e')]=utils[_0xa55c('0x2f')][_0xa55c('0x74')];}}else{_0x35bf0a[_0xa55c('0x2e')]=utils['CAMPAIGN_STATUS'][_0xa55c('0x74')];}};Preview['prototype'][_0xa55c('0x75')]=function(_0x437ced,_0x20593d,_0x2ccfb1){var _0xec640=this;var _0x53b2f7=this[_0xa55c('0x14')][_0x20593d];var _0x54f776=this[_0xa55c('0x12')][_0x53b2f7[_0xa55c('0x47')]];var _0x2cfe08;var _0x1e1c5b=![];var _0x19aaf5=0x2;var _0x138c9e=0x3;if(_0x54f776){switch(_0x2ccfb1){case'1':_0x54f776[_0xa55c('0x76')]+=0x1;_0x53b2f7['countnosuchnumberretry']+=0x1;_0x53b2f7[_0xa55c('0x77')]=ut[_0xa55c('0x78')](_0x53b2f7);ut[_0xa55c('0x62')](_0x53b2f7,0x0,_0xa55c('0x79'));ami[_0xa55c('0x24')]('custom:agentnosuchnumber',ut[_0xa55c('0x7a')](_0x53b2f7,_0xa55c('0x7b')));rpcDb[_0xa55c('0x66')](_0x53b2f7,_0xa55c('0x7c'));_0xec640[_0xa55c('0x7d')](_0x53b2f7,'0',_0x54f776)['then'](function(_0xdd92c1){_0x1e1c5b=_0xdd92c1[_0xa55c('0x7e')]==0x1;_0x19aaf5=_0x54f776[_0xa55c('0x7f')];_0x138c9e=_0x54f776[_0xa55c('0x80')];if(!_0x1e1c5b){if(ut[_0xa55c('0x78')](_0x53b2f7)>=_0x54f776['dialGlobalMaxRetry']){_0x2cfe08=ut[_0xa55c('0x81')](_0x53b2f7,0xf,'Global');rpcDb[_0xa55c('0x6a')](_0x2cfe08,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x53b2f7[_0xa55c('0x82')]>=_0x54f776['dialNoSuchNumberMaxRetry']){rpcDb[_0xa55c('0x6a')](_0x53b2f7,_0xa55c('0x83'));}else{rpcDb[_0xa55c('0x84')](ut[_0xa55c('0x85')](_0x53b2f7,_0xa55c('0x82'),_0x54f776[_0xa55c('0x7f')]),_0x53b2f7[_0xa55c('0x86')],_0x53b2f7[_0xa55c('0x87')]);}}delete this[_0xa55c('0x14')][_0x437ced[_0xa55c('0x88')]];}else{_0x53b2f7['countnosuchnumberretry']++;logger[_0xa55c('0x44')](_0xa55c('0x89'),_0x53b2f7['countnosuchnumberretry']);logger[_0xa55c('0x44')]('id',_0x53b2f7[_0xa55c('0x8a')]);_0xec640[_0xa55c('0x8b')]({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countnosuchnumberretry':_0x53b2f7[_0xa55c('0x82')]}})[_0xa55c('0x57')](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)[_0xa55c('0x57')](function(){});});}});break;case'ANSWER':var _0x1dfaf7=moment()[_0xa55c('0x27')](_0xa55c('0x8d'));_0x53b2f7[_0xa55c('0x8e')]=_0x1dfaf7;_0x53b2f7[_0xa55c('0x8f')]=_0x1dfaf7;_0x53b2f7[_0xa55c('0x50')]=!![];_0x54f776[_0xa55c('0x90')]+=0x1;logger[_0xa55c('0x44')](_0xa55c('0x91'),_0x53b2f7['uniqueid'],_0xa55c('0x92'),_0x54f776[_0xa55c('0x29')],_0xa55c('0x48'),_0x54f776[_0xa55c('0x90')]);ami[_0xa55c('0x24')](_0xa55c('0x93'),ut[_0xa55c('0x7a')](_0x53b2f7,_0xa55c('0x94'),this[_0xa55c('0x12')][_0x53b2f7[_0xa55c('0x47')]]));if(_0x54f776[_0xa55c('0x95')]){ami['emit'](_0xa55c('0x96'),ut['buildAcw'](_0x53b2f7));}break;case'16':ami[_0xa55c('0x24')](_0xa55c('0x97'),ut[_0xa55c('0x7a')](_0x53b2f7,'complete',this['campaignsPreview'][_0x53b2f7[_0xa55c('0x47')]]));emitVoiceQueueChannelRemove(ut[_0xa55c('0x7a')](_0x53b2f7,_0xa55c('0x98')));_0x54f776[_0xa55c('0x99')]+=0x1;_0x54f776['total']+=0x1;_0x54f776[_0xa55c('0x9a')]+=0x1;ut[_0xa55c('0x51')](_0x54f776,_0xa55c('0x9b'));_0x53b2f7[_0xa55c('0x77')]=ut[_0xa55c('0x78')](_0x53b2f7);ut['logCustomer'](_0x53b2f7,0x4,'Answer');rpcDb[_0xa55c('0x66')](_0x53b2f7,_0xa55c('0x9c'));rpcDb[_0xa55c('0x6a')](_0x53b2f7,_0xa55c('0x9d'));rpcDb[_0xa55c('0x9e')](_0x53b2f7);_0x54f776['sumDuration']+=_0x53b2f7[_0xa55c('0x9f')];_0x54f776[_0xa55c('0xa0')]+=_0x53b2f7['talktime'];logger[_0xa55c('0x44')](_0xa55c('0xa1'),_0x53b2f7[_0xa55c('0xa2')],'\x20Queue',_0x54f776[_0xa55c('0x29')],_0xa55c('0x48'),_0x54f776[_0xa55c('0x90')]);delete this[_0xa55c('0x14')][_0x437ced[_0xa55c('0x88')]];break;case'BUSY':_0x54f776[_0xa55c('0xa3')]+=0x1;_0x53b2f7[_0xa55c('0xa4')]+=0x1;_0x53b2f7['countglobal']=ut['totalGlobal'](_0x53b2f7);ut[_0xa55c('0x62')](_0x53b2f7,0x5,'Busy');_0x19aaf5=_0x54f776[_0xa55c('0xa5')];_0x138c9e=_0x54f776[_0xa55c('0x80')];ami[_0xa55c('0x24')](_0xa55c('0xa6'),ut[_0xa55c('0x7a')](_0x53b2f7,_0xa55c('0xa7')));rpcDb[_0xa55c('0x66')](_0x53b2f7,_0xa55c('0xa8'));_0xec640[_0xa55c('0x7d')](_0x53b2f7,'5',_0x54f776)['then'](function(_0x463195){_0x1e1c5b=_0x463195[_0xa55c('0x7e')]==0x1;if(!_0x1e1c5b){if(ut[_0xa55c('0x78')](_0x53b2f7)>=_0x54f776[_0xa55c('0xa9')]){_0x2cfe08=ut['cloneAction'](_0x53b2f7,0xf,_0xa55c('0xaa'));rpcDb[_0xa55c('0x6a')](_0x2cfe08,_0xa55c('0xab'));}else{if(_0x53b2f7[_0xa55c('0xa4')]>=_0x54f776['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x53b2f7,_0xa55c('0xa8'));}else{rpcDb[_0xa55c('0x84')](ut[_0xa55c('0x85')](_0x53b2f7,_0xa55c('0xa4'),_0x54f776['dialBusyRetryFrequency']),_0x53b2f7['unlockAgent'],_0x53b2f7[_0xa55c('0x87')]);}}}else{_0x53b2f7[_0xa55c('0xa4')]++;_0xec640[_0xa55c('0x8b')]({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countbusyretry':_0x53b2f7[_0xa55c('0xa4')]}})[_0xa55c('0x57')](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)['then'](function(){});});}});break;case _0xa55c('0xac'):_0x54f776['outboundNoAnswerCallsDay']+=0x1;_0x53b2f7[_0xa55c('0xad')]+=0x1;_0x53b2f7['countglobal']=ut[_0xa55c('0x78')](_0x53b2f7);ut[_0xa55c('0x62')](_0x53b2f7,0x3,_0xa55c('0xae'));_0x19aaf5=_0x54f776[_0xa55c('0xaf')];_0x138c9e=_0x54f776[_0xa55c('0x80')];var _0x402f02=ut[_0xa55c('0xb0')](_0x53b2f7,_0x54f776);ami[_0xa55c('0x24')]('custom:agentnoanswer',_0x402f02);rpcDb['createCustomerHistory'](_0x53b2f7,_0xa55c('0xb1'));_0xec640[_0xa55c('0x7d')](_0x53b2f7,'3',_0x54f776)[_0xa55c('0x57')](function(_0x256db0){_0x1e1c5b=_0x256db0[_0xa55c('0x7e')]==0x1;if(!_0x1e1c5b){if(ut[_0xa55c('0x78')](_0x53b2f7)>=_0x54f776['dialGlobalMaxRetry']){_0x2cfe08=ut[_0xa55c('0x81')](_0x53b2f7,0xf,_0xa55c('0xaa'));rpcDb[_0xa55c('0x6a')](_0x2cfe08,_0xa55c('0xb2'));}else{if(_0x53b2f7[_0xa55c('0xad')]>=_0x54f776[_0xa55c('0xb3')]){rpcDb[_0xa55c('0x6a')](_0x53b2f7,_0xa55c('0xb1'));}else{rpcDb['rescheduleContact'](ut[_0xa55c('0x85')](_0x53b2f7,_0xa55c('0xad'),_0x54f776[_0xa55c('0xaf')]),_0x53b2f7[_0xa55c('0x86')],_0x53b2f7[_0xa55c('0x87')]);}}}else{_0x53b2f7['countnoanswerretry']++;_0xec640[_0xa55c('0x8b')]({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countnoanswerretry':_0x53b2f7['countnoanswerretry']}})['then'](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)[_0xa55c('0x57')](function(){});});}});break;case'CONGESTION':_0x54f776['outboundCongestionCallsDay']+=0x1;_0x53b2f7['countcongestionretry']+=0x1;_0x53b2f7['countglobal']=ut[_0xa55c('0x78')](_0x53b2f7);ut[_0xa55c('0x62')](_0x53b2f7,0x8,_0xa55c('0xb4'));_0x19aaf5=_0x54f776[_0xa55c('0xb5')];_0x138c9e=_0x54f776[_0xa55c('0x80')];ami[_0xa55c('0x24')]('custom:agentcongestion',ut[_0xa55c('0x7a')](_0x53b2f7,_0xa55c('0xb6')));rpcDb[_0xa55c('0x66')](_0x53b2f7,_0xa55c('0xb7'));_0xec640['verifyAdditionalPhones'](_0x53b2f7,'8',_0x54f776)[_0xa55c('0x57')](function(_0x25e4e0){_0x1e1c5b=_0x25e4e0[_0xa55c('0x7e')]==0x1;if(!_0x1e1c5b){if(ut['totalGlobal'](_0x53b2f7)>=_0x54f776[_0xa55c('0xa9')]){_0x2cfe08=ut['cloneAction'](_0x53b2f7,0xf,'Global');rpcDb[_0xa55c('0x6a')](_0x2cfe08,_0xa55c('0xb8'));}else{if(_0x53b2f7[_0xa55c('0xb9')]>=_0x54f776[_0xa55c('0xba')]){rpcDb[_0xa55c('0x6a')](_0x53b2f7,_0xa55c('0xb7'));}else{rpcDb[_0xa55c('0x84')](ut['scheduledAt'](_0x53b2f7,'countcongestionretry',_0x54f776[_0xa55c('0xa5')]),_0x53b2f7[_0xa55c('0x86')],_0x53b2f7[_0xa55c('0x87')]);}}}else{_0x53b2f7[_0xa55c('0xb9')]++;_0xec640[_0xa55c('0x8b')]({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countcongestionretry':_0x53b2f7[_0xa55c('0xb9')]}})[_0xa55c('0x57')](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)[_0xa55c('0x57')](function(){});});}});break;case'CANCEL':_0x54f776[_0xa55c('0xbb')]+=0x1;_0x53b2f7[_0xa55c('0xbc')]+=0x1;_0x53b2f7['countglobal']=ut[_0xa55c('0x78')](_0x53b2f7);ut['logCustomer'](_0x53b2f7,0x14,_0xa55c('0xbd'));_0x19aaf5=_0x54f776[_0xa55c('0xbe')];_0x138c9e=_0x54f776[_0xa55c('0x80')];ami[_0xa55c('0x24')](_0xa55c('0xbf'),ut['buildObj'](_0x53b2f7,_0xa55c('0xc0')));rpcDb[_0xa55c('0x66')](_0x53b2f7,_0xa55c('0xc1'));_0xec640[_0xa55c('0x7d')](_0x53b2f7,'20',_0x54f776)[_0xa55c('0x57')](function(_0x31287c){_0x1e1c5b=_0x31287c[_0xa55c('0x7e')]==0x1;if(!_0x1e1c5b){if(ut['totalGlobal'](_0x53b2f7)>=_0x54f776['dialGlobalMaxRetry']){_0x2cfe08=ut['cloneAction'](_0x53b2f7,0x14,_0xa55c('0xbd'));rpcDb['createCustomerFinal'](_0x2cfe08,_0xa55c('0xc2'));}else{if(_0x53b2f7[_0xa55c('0xbc')]>=_0x54f776[_0xa55c('0xc3')]){rpcDb[_0xa55c('0x6a')](_0x53b2f7,_0xa55c('0xc2'));}else{rpcDb['rescheduleContact'](ut[_0xa55c('0x85')](_0x53b2f7,'countagentrejectretry',_0x54f776[_0xa55c('0xbe')]),_0x53b2f7[_0xa55c('0x86')],_0x53b2f7[_0xa55c('0x87')]);}}}else{_0x53b2f7[_0xa55c('0xad')]++;_0xec640['incrementPreviewCounters']({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countnoanswerretry':_0x53b2f7[_0xa55c('0xad')]}})[_0xa55c('0x57')](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)[_0xa55c('0x57')](function(){});});}});break;case _0xa55c('0xc4'):_0x54f776[_0xa55c('0xc5')]+=0x1;_0x53b2f7[_0xa55c('0xc6')]+=0x1;_0x53b2f7['countglobal']=ut[_0xa55c('0x78')](_0x53b2f7);ut[_0xa55c('0x62')](_0x53b2f7,0xb,_0xa55c('0xc7'));rpcDb[_0xa55c('0x66')](_0x53b2f7,_0xa55c('0xc8'));_0xec640[_0xa55c('0x7d')](_0x53b2f7,'11',_0x54f776)['then'](function(_0x46124b){_0x1e1c5b=_0x46124b['additional']==0x1;if(!_0x1e1c5b){if(ut[_0xa55c('0x78')](_0x53b2f7)>=_0x54f776['dialGlobalMaxRetry']){_0x2cfe08=ut[_0xa55c('0x81')](_0x53b2f7,0xf,_0xa55c('0xaa'));rpcDb[_0xa55c('0x6a')](_0x2cfe08,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x53b2f7[_0xa55c('0xc9')]>=_0x54f776[_0xa55c('0xca')]){rpcDb[_0xa55c('0x6a')](_0x53b2f7,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xa55c('0x84')](ut['scheduledAt'](_0x53b2f7,_0xa55c('0xc6'),_0x54f776[_0xa55c('0xcb')]),_0x53b2f7['unlockAgent'],_0x53b2f7[_0xa55c('0x87')]);}}}else{_0x53b2f7['countnoanswerretry']++;_0xec640[_0xa55c('0x8b')]({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countnoanswerretry':_0x53b2f7['countnoanswerretry']}})[_0xa55c('0x57')](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)['then'](function(){});});}});break;case'18':_0x54f776[_0xa55c('0xcc')]+=0x1;_0x53b2f7[_0xa55c('0xcd')]+=0x1;_0x53b2f7['countglobal']=ut[_0xa55c('0x78')](_0x53b2f7);ut['logCustomer'](_0x53b2f7,0x12,_0x437ced['cause-txt']||_0x437ced[_0xa55c('0xce')]);ami[_0xa55c('0x24')](_0xa55c('0xcf'),ut[_0xa55c('0x7a')](_0x53b2f7,'amd'));rpcDb[_0xa55c('0x66')](_0x53b2f7,'[callProgressDetectingCustomer][hangupInAMD]');_0xec640[_0xa55c('0x7d')](_0x53b2f7,'18',_0x54f776)['then'](function(_0x4ab9f1){_0x1e1c5b=_0x4ab9f1['additional']==0x1;if(!_0x1e1c5b){if(ut[_0xa55c('0x78')](_0x53b2f7)>=_0x54f776['dialGlobalMaxRetry']){_0x2cfe08=ut['cloneAction'](_0x53b2f7,0x12,_0xa55c('0xaa'));rpcDb[_0xa55c('0x6a')](_0x2cfe08,_0xa55c('0xd0'));}else{rpcDb[_0xa55c('0x6a')](_0x53b2f7,_0xa55c('0xd0'));}}else{_0x53b2f7[_0xa55c('0xad')]++;_0xec640[_0xa55c('0x8b')]({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countnoanswerretry':_0x53b2f7[_0xa55c('0xad')]}})[_0xa55c('0x57')](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)[_0xa55c('0x57')](function(){});});}});delete this[_0xa55c('0x14')][_0x437ced['linkedid']];break;case'19':_0x54f776[_0xa55c('0xcc')]+=0x1;_0x53b2f7['countglobal']=ut['totalGlobal'](_0x53b2f7);ut['logCustomer'](_0x53b2f7,0x13,_0x437ced[_0xa55c('0xd1')]||_0x437ced['dialstatus']);ami[_0xa55c('0x24')]('custom:amd',ut[_0xa55c('0x7a')](_0x53b2f7,'amd'));rpcDb['createCustomerHistory'](_0x53b2f7,_0xa55c('0xd2'));_0xec640['verifyAdditionalPhones'](_0x53b2f7,'18',_0x54f776)['then'](function(_0x2961b6){_0x1e1c5b=_0x2961b6[_0xa55c('0x7e')]==0x1;if(!_0x1e1c5b){if(ut['totalGlobal'](_0x53b2f7)>=_0x54f776[_0xa55c('0xa9')]){_0x2cfe08=ut['cloneAction'](_0x53b2f7,0xf,_0xa55c('0xaa'));rpcDb[_0xa55c('0x6a')](_0x2cfe08,_0xa55c('0xd2'));}else{rpcDb['createCustomerFinal'](_0x53b2f7,'[callProgressDetectingCustomer][machine]');}}else{_0x53b2f7[_0xa55c('0xad')]++;_0xec640[_0xa55c('0x8b')]({'id':_0x53b2f7[_0xa55c('0x8a')],'field':{'countnoanswerretry':_0x53b2f7[_0xa55c('0xad')]}})[_0xa55c('0x57')](function(){_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)[_0xa55c('0x57')](function(){});});}});delete this[_0xa55c('0x14')][_0x437ced['linkedid']];break;default:if(_0x53b2f7[_0xa55c('0x50')]){ut[_0xa55c('0x51')](_0x54f776,_0xa55c('0xd3'));ut[_0xa55c('0x52')](_0xa55c('0xd4')+_0x54f776[_0xa55c('0x29')],_0x437ced);}_0x54f776[_0xa55c('0xcc')]+=0x1;_0x53b2f7[_0xa55c('0x77')]=ut[_0xa55c('0x78')](_0x53b2f7);ut['logCustomer'](_0x53b2f7,0xc,_0x437ced[_0xa55c('0xd1')]||_0x437ced[_0xa55c('0xce')]);_0x19aaf5=_0x54f776[_0xa55c('0xbe')];_0x138c9e=_0x54f776['callAdditionalPhoneAfterMin'];rpcDb['createCustomerHistory'](_0x53b2f7,'[callProgressDetectingCustomer][logUnknown]');_0xec640[_0xa55c('0x7d')](_0x53b2f7,'20',_0x54f776)['then'](function(_0x1ba04f){_0x1e1c5b=_0x1ba04f[_0xa55c('0x7e')]==0x1;if(!_0x1e1c5b){if(ut[_0xa55c('0x78')](_0x53b2f7)>=_0x54f776[_0xa55c('0xa9')]){_0x2cfe08=ut[_0xa55c('0x81')](_0x53b2f7,0xf,_0xa55c('0xaa'));rpcDb[_0xa55c('0x6a')](_0x2cfe08,_0xa55c('0xd5'));}else{rpcDb[_0xa55c('0x6a')](_0x53b2f7,_0xa55c('0xd5'));}delete this[_0xa55c('0x14')][_0x437ced[_0xa55c('0x88')]];}else{_0xec640[_0xa55c('0x8c')](_0x53b2f7,_0x19aaf5,_0x138c9e)[_0xa55c('0x57')](function(){});}});}if(!(_0x53b2f7[_0xa55c('0x50')]&&_0x2ccfb1==='16')){ut[_0xa55c('0x4e')](_0x54f776,_0xa55c('0xd6'));logger[_0xa55c('0x44')](_0xa55c('0xd7'),_0x53b2f7[_0xa55c('0xa2')],_0xa55c('0x92'),_0x54f776[_0xa55c('0x29')],_0xa55c('0x46'),_0x54f776[_0xa55c('0x2a')]);}if(_0x2ccfb1!=='ANSWER'){delete this[_0xa55c('0x14')][_0x437ced[_0xa55c('0x88')]];delete this['actions'][_0x437ced[_0xa55c('0xd8')]];}_0x54f776[_0xa55c('0xd9')]=!![];}};Preview[_0xa55c('0x35')][_0xa55c('0xda')]=function(_0x31767b,_0x4d9b66,_0x456dd4){if(_['isUndefined'](_0x4d9b66)&&'object'!==typeof _0x4d9b66){return;}if(_[_0xa55c('0xdb')](_0x456dd4)&&_0xa55c('0xdc')!==typeof _0x456dd4){return;}switch(_0x456dd4[_0xa55c('0xdd')]){case'0':ut[_0xa55c('0xde')](_0x31767b,0x0,_0xa55c('0x79'));rpcDb[_0xa55c('0xdf')](_0x31767b,_0xa55c('0xe0'));break;case'3':ut[_0xa55c('0xde')](_0x31767b,0x3,_0xa55c('0xae'));rpcDb[_0xa55c('0xdf')](_0x31767b,_0xa55c('0xe1'));break;case'5':ut[_0xa55c('0xde')](_0x31767b,0x5,_0xa55c('0xe2'));rpcDb[_0xa55c('0xdf')](_0x31767b,_0xa55c('0xe3'));break;case'8':ut[_0xa55c('0xde')](_0x31767b,0x8,_0xa55c('0xb4'));rpcDb[_0xa55c('0xdf')](_0x31767b,_0xa55c('0xe4'));break;case'22':ut['logAgent'](_0x31767b,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x31767b,_0xa55c('0xe5'));break;default:ut[_0xa55c('0xde')](_0x31767b,0xc,_0x456dd4['reason']);rpcDb[_0xa55c('0xdf')](_0x31767b,'[callProgressDetectingAgent][logCongestion]');}ut[_0xa55c('0x4e')](_0x4d9b66,'[callProgressDetectingAgent]');logger[_0xa55c('0x44')](_0xa55c('0xe6'),_0x31767b[_0xa55c('0xa2')],_0xa55c('0x92'),_0x4d9b66[_0xa55c('0x29')],_0xa55c('0x46'),_0x4d9b66[_0xa55c('0x2a')]);delete this[_0xa55c('0x14')][_0x31767b[_0xa55c('0xa2')]];};Preview[_0xa55c('0x35')][_0xa55c('0x7d')]=function(_0x53f209,_0x59f3a4,_0xde7bd){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x53f209,_0x59f3a4,_0xde7bd)[_0xa55c('0x5f')](logger['info'](_0xa55c('0xe7')));};Preview[_0xa55c('0x35')][_0xa55c('0x8c')]=function(_0x5b20c5,_0x3b8f15,_0x18584c){return cmHopperAdditionalPhone[_0xa55c('0x8c')](_0x5b20c5,_0x3b8f15,_0x18584c)['catch'](logger[_0xa55c('0x44')]('[swapAdditionalPhone]\x20'));};Preview[_0xa55c('0x35')]['incrementPreviewCounters']=function(_0x4e8433){return Promise[_0xa55c('0xe8')]()[_0xa55c('0x57')](cmHopperAdditionalPhone[_0xa55c('0x8b')](_0x4e8433))['catch'](logger[_0xa55c('0x44')](_0xa55c('0xe9')));};Preview[_0xa55c('0x35')][_0xa55c('0xea')]=function(_0x4399bd,_0x3e9384,_0x2e76ad,_0x24db74,_0x4b1762){var _0x402298=this;return new Promise(function(_0x1b8b05,_0x80befe){if(_[_0xa55c('0x43')](_0x3e9384)||_[_0xa55c('0x43')](_0x3e9384[_0xa55c('0xeb')])||_[_0xa55c('0x43')](_0x3e9384[_0xa55c('0xec')])||_[_0xa55c('0x43')](_0x3e9384[_0xa55c('0xed')])){_0x80befe(ut[_0xa55c('0x2e')]('Contact\x20is\x20undefined',_0x24db74,_0x4b1762));return;}var _0x263d16=uuid['v4']();var _0x48127c=_0x402298['campaignsPreview'][_0x3e9384[_0xa55c('0xee')]['name']];var _0x427e3b=_0x2e76ad?_0x402298['agents'][_0x2e76ad]['id']:undefined;_0x402298[_0xa55c('0x14')][_0x263d16]=new Action(_0x3e9384,_0x48127c,_0x263d16,_0x2e76ad,_0x427e3b);var _0x231499=_0x402298[_0xa55c('0x14')][_0x263d16];_0x231499[_0xa55c('0x86')]=_0x24db74;_0x231499[_0xa55c('0x87')]=_0x4b1762;_0x231499[_0xa55c('0xef')]=_0x2e76ad;if(_[_0xa55c('0xf0')](_0x4399bd)){_0x402298['execCall'](_0x231499,_0x48127c,_0x3e9384,_0x2e76ad)[_0xa55c('0x57')](function(_0x590c0c){logger['info'](_0xa55c('0xf1'),_0xa55c('0xf2')+_0x231499['queue']+_0xa55c('0xf3')+_0x231499[_0xa55c('0x8a')],JSON[_0xa55c('0x26')](_0x590c0c));ami['emit']('custom:agentcalled',ut['buildObj'](_0x231499,'called',_0x402298[_0xa55c('0x12')][_0x231499[_0xa55c('0x47')]]));_0x1b8b05(ut['message'](_0xa55c('0xf4')));})[_0xa55c('0x5f')](function(_0x3b3be0){ut['logger'](_0xa55c('0xf5'),_0x3b3be0);_0x80befe(ut['message']('Call\x20failed',_0x24db74,_0x4b1762));});}else{_0x48127c['outboundBlacklistCallsDay']+=0x1;ut[_0xa55c('0xf6')](_0x231499);rpcDb['createHistory'](_0x231499,_0xa55c('0xf7'));delete _0x402298['actions'][_0x263d16];_0x80befe(ut[_0xa55c('0x2e')](_0xa55c('0xf8'),_0x24db74,_0x4b1762));}});};Preview[_0xa55c('0x35')]['isTrunkReachable']=function(_0x1c016d){return!_[_0xa55c('0x43')](_0x1c016d)&&!_[_0xa55c('0x43')](_0x1c016d[_0xa55c('0x29')])&&!_[_0xa55c('0x43')](_0x1c016d[_0xa55c('0xf9')])&&_0x1c016d[_0xa55c('0xf9')]&&!_[_0xa55c('0x43')](this[_0xa55c('0xfa')][util['format'](_0xa55c('0xfb'),_0x1c016d[_0xa55c('0x29')])])&&!_[_0xa55c('0x43')](this[_0xa55c('0xfa')][util[_0xa55c('0x27')](_0xa55c('0xfb'),_0x1c016d['name'])][_0xa55c('0xfc')])&&(this['trunks'][util[_0xa55c('0x27')](_0xa55c('0xfb'),_0x1c016d['name'])][_0xa55c('0xfc')]===_0xa55c('0xfd')||this['trunks'][util['format'](_0xa55c('0xfb'),_0x1c016d[_0xa55c('0x29')])][_0xa55c('0xfc')]===_0xa55c('0xfe'));};Preview[_0xa55c('0x35')][_0xa55c('0xff')]=function(_0x31b866,_0x37ed47){return this['execRun'](_0x31b866,_0x37ed47)[_0xa55c('0x57')](function(_0x331595){return _[_0xa55c('0x49')](_0x331595,[_0xa55c('0x2e')]);})[_0xa55c('0x5f')](function(_0x59a69d){if(_0x59a69d[_0xa55c('0x100')]){rpcDb['unlockContact'](_0x31b866);}if(_0x59a69d['active']){rpcDb[_0xa55c('0x101')](_0x31b866);}throw _[_0xa55c('0x49')](_0x59a69d,[_0xa55c('0x2e')]);});};Preview[_0xa55c('0x35')]['execRun']=function(_0x125812,_0x155c6e){var _0xa22273=this;var _0x1c7506,_0x3b76df;return rpcDb[_0xa55c('0x102')](_0x125812)[_0xa55c('0x57')](function(_0x239b2e){if(!_['isNil'](_0x239b2e[0x0])){_0x3b76df=_0x239b2e[0x0][_0xa55c('0x103')]?![]:!![];_0x1c7506=_0x239b2e[0x0][_0xa55c('0x103')]?!![]:![];_0x1c7506=_0x155c6e?!![]:_0x1c7506;}var _0x2639cc=_0xa22273[_0xa55c('0x104')](_0x239b2e);if(_0x2639cc['isValid']){rpcDb[_0xa55c('0x105')](_[_0xa55c('0x49')](_0x239b2e[0x0],[_0xa55c('0xed'),'phone']))[_0xa55c('0x57')](function(_0x3a67fb){_0xa22273[_0xa55c('0xea')](_0x3a67fb,_0x239b2e[0x0],_0x155c6e,_0x3b76df,_0x1c7506)[_0xa55c('0x57')](function(_0x19e506){return _0x19e506;})[_0xa55c('0x5f')](function(_0x127c2f){throw _0x127c2f;});})['catch'](function(_0xcd4f3a){ut[_0xa55c('0x31')]('[Preview][checkIsBlackList]',_0xcd4f3a);throw ut[_0xa55c('0x2e')](_0xa55c('0x106'),_0x3b76df,_0x1c7506);});}else{throw ut[_0xa55c('0x2e')](_0x2639cc['message'],_0x3b76df,_0x1c7506);}})['catch'](function(_0x4dba17){ut[_0xa55c('0x31')](_0xa55c('0x107'),_0x4dba17);throw ut['message']('Call\x20unsuccessful',![],!![]);});};Preview[_0xa55c('0x35')][_0xa55c('0x104')]=function(_0x591ee3){if(_['isNil'](_0x591ee3)||_[_0xa55c('0xf0')](_0x591ee3)||!_[_0xa55c('0x43')](_0x591ee3[0x0][_0xa55c('0x5b')])&&_['isNil'](_0x591ee3[0x0]['Agent'][_0xa55c('0x29')])){ut['logger'](_0xa55c('0x108'),_0x591ee3);return{'isValid':![],'message':_0xa55c('0x109')};}var _0x5a4e69=this[_0xa55c('0x12')][_0x591ee3[0x0]['Queue']['name']];_0x5a4e69['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0xa55c('0x43')](_0x5a4e69)){ut['logger'](_0xa55c('0x10a'),_0x5a4e69);return{'isValid':![],'message':_0xa55c('0x10b')};}if(!this[_0xa55c('0x72')](_0x5a4e69['Trunk'])){ut[_0xa55c('0x31')](_0xa55c('0x10c'),_0xa55c('0x10d')+_0x5a4e69[_0xa55c('0x29')]+_0xa55c('0x10e'));if(!this[_0xa55c('0x72')](_0x5a4e69[_0xa55c('0x73')])){ut[_0xa55c('0x31')](_0xa55c('0x10c'),_0x5a4e69[_0xa55c('0x29')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xa55c('0x10f')};}}if(!ut[_0xa55c('0x6f')](_0x5a4e69['dialActive'])){ut[_0xa55c('0x31')](_0xa55c('0x110'),_0x5a4e69[_0xa55c('0x29')]+_0xa55c('0x111'));return{'isValid':![],'message':_0xa55c('0x10d')+_0x5a4e69[_0xa55c('0x29')]+_0xa55c('0x111')};}return{'isValid':!![],'message':_0xa55c('0x112')};};Preview[_0xa55c('0x35')][_0xa55c('0x113')]=function(_0x131288,_0x197953,_0x262d72,_0x228d12){var _0x16e229=this;return new Promise(function(_0x5c8713,_0x2d03b2){var _0x4b2e75=_0x131288[_0xa55c('0xa2')];var _0x3d0c6d=_0x16e229[_0xa55c('0x72')](_0x197953[_0xa55c('0x71')])?util['format'](_0xa55c('0x114'),_0x197953[_0xa55c('0x71')][_0xa55c('0x29')],_['isNil'](_0x197953[_0xa55c('0x115')])?'':_0x197953[_0xa55c('0x115')][_0xa55c('0x116')]()||'',_0x197953['dialCutDigit']>0x0?_0x262d72[_0xa55c('0xec')][_0xa55c('0x117')](_0x197953[_0xa55c('0x118')]):_0x262d72['phone']):util[_0xa55c('0x27')]('SIP/%s/%s%s',_[_0xa55c('0x43')](_0x197953[_0xa55c('0x73')])?_0x197953[_0xa55c('0x71')][_0xa55c('0x29')]:_0x197953[_0xa55c('0x73')]['name'],_[_0xa55c('0x43')](_0x197953[_0xa55c('0x115')])?'':_0x197953[_0xa55c('0x115')]['trim']()||'',_0x197953[_0xa55c('0x118')]>0x0?_0x262d72[_0xa55c('0xec')][_0xa55c('0x117')](_0x197953['dialCutDigit']):_0x262d72[_0xa55c('0xec')]);var _0x2becbd=_0x16e229[_0xa55c('0x72')](_0x197953[_0xa55c('0x71')])?ut[_0xa55c('0x119')](_0x197953[_0xa55c('0x71')][_0xa55c('0x11a')],_0x197953['dialOriginateCallerIdName'],_0x197953[_0xa55c('0x11b')]>0x0?ut[_0xa55c('0x11c')](_0x197953[_0xa55c('0x11d')],_0x197953[_0xa55c('0x11b')]):_0x197953['dialOriginateCallerIdNumber']):ut[_0xa55c('0x119')](_[_0xa55c('0x43')](_0x197953[_0xa55c('0x73')])?_0x197953[_0xa55c('0x71')][_0xa55c('0x11a')]:_0x197953[_0xa55c('0x73')][_0xa55c('0x11a')],_0x197953['dialOriginateCallerIdName'],_0x197953[_0xa55c('0x11b')]>0x0?ut[_0xa55c('0x11c')](_0x197953[_0xa55c('0x11d')],_0x197953[_0xa55c('0x11b')]):_0x197953[_0xa55c('0x11d')]);if(_0x2becbd){_0x131288['originatecalleridname']=ut['extractCalleridName'](_0x2becbd);_0x131288['originatecalleridnum']=ut[_0xa55c('0x11e')](_0x2becbd);}var _0x124873=ut[_0xa55c('0x11f')](_0x197953,_0x262d72,_0x3d0c6d,_0x2becbd,_0x4b2e75,_0x131288);_[_0xa55c('0x120')](_0x131288,ut[_0xa55c('0x121')](_0x124873));_0x131288[_0xa55c('0x60')]=moment()[_0xa55c('0x27')](_0xa55c('0x8d'));_0x197953['variables']=_0x124873;var _0x35c42c=ut[_0xa55c('0x122')](_0x131288,_0x197953,_0x124873,_0x131288[_0xa55c('0x87')],_0x228d12);return ami[_0xa55c('0x4c')](_0x35c42c)[_0xa55c('0x57')](function(_0xd511c0){_0x197953['originated']+=0x1;logger[_0xa55c('0x44')]('[originated][increment]',_0x4b2e75,'\x20Queue',_0x197953['name'],'originated:\x20',_0x197953[_0xa55c('0x2a')]);_0x5c8713(_0xd511c0);})[_0xa55c('0x5f')](function(_0x4732b4){ut[_0xa55c('0xde')](_0x131288,0xe,_0xa55c('0x123'));rpcDb[_0xa55c('0xdf')](_0x131288,_0xa55c('0x124'));_0x2d03b2(_0x4732b4);});});};Preview[_0xa55c('0x35')][_0xa55c('0x1e')]=function(_0x9c98af){if(this[_0xa55c('0x14')][_0x9c98af['linkedid']]){this['actions'][_0x9c98af[_0xa55c('0x88')]]['channel']=_0x9c98af[_0xa55c('0x125')];}};Preview[_0xa55c('0x35')][_0xa55c('0x16')]=function(_0x340570){var _0x2ef96f=this;var _0x582b22=this[_0xa55c('0x14')][_0x340570[_0xa55c('0x126')]];if(_0x582b22){if(_0x582b22[_0xa55c('0xef')]&&this['agents'][_0x582b22[_0xa55c('0xef')]]){ut[_0xa55c('0x127')](_0x582b22,this['agents'][_0x582b22['lookAgent']][_0xa55c('0x29')],this[_0xa55c('0x56')][_0x582b22[_0xa55c('0xef')]]['id']);}var _0x4f2883=_[_0xa55c('0x128')](_0x582b22);_0x4f2883[_0xa55c('0x8e')]=moment()[_0xa55c('0x27')](_0xa55c('0x8d'));var _0x5a37d6=_0x2ef96f['campaignsPreview'][_0x582b22[_0xa55c('0x47')]];if(ut['isFailure'](_0x340570['response'])){if(_0x582b22[_0xa55c('0x86')]){rpcDb[_0xa55c('0x129')](_0x582b22[_0xa55c('0x8a')]);}if(_0x582b22[_0xa55c('0x87')]){rpcDb['disableContact'](_0x582b22[_0xa55c('0x8a')]);}ami[_0xa55c('0x24')](_0xa55c('0x12a'),ut[_0xa55c('0x7a')](_0x582b22,_0xa55c('0x12b'),this['campaignsPreview'][_0x582b22[_0xa55c('0x47')]]));this[_0xa55c('0xda')](_0x4f2883,_0x5a37d6,_0x340570);}else{_0x582b22[_0xa55c('0x60')]=moment()[_0xa55c('0x27')](_0xa55c('0x8d'));ut[_0xa55c('0xde')](_0x4f2883,0x4,_0xa55c('0x12c'));rpcDb['createAgentHistory'](_0x4f2883,_0xa55c('0x12d'));}}};Preview['prototype'][_0xa55c('0x19')]=function(_0x26946f){var _0x3755a7=this['actions'][_0x26946f['linkedid']];var _0x307b39;if(_0x3755a7){_0x307b39=this[_0xa55c('0x12')][_0x3755a7['queue']];logger['info'](_0xa55c('0x12e'),_0x26946f[_0xa55c('0x88')],'\x20Queue',_0x307b39[_0xa55c('0x29')],'pTalking:\x20',_0x307b39[_0xa55c('0x90')]);}if(this[_0xa55c('0x14')][_0x26946f[_0xa55c('0x88')]]&&_0x26946f[_0xa55c('0x88')]!==_0x26946f['uniqueid']){if(_0x26946f[_0xa55c('0x12f')]==='16'&&this[_0xa55c('0x14')][_0x26946f[_0xa55c('0x88')]]['dialAnswer']){this['callProgressDetectingCustomer'](_0x26946f,_0x26946f[_0xa55c('0x88')],_0x26946f['cause']);}else if(this['actions'][_0x26946f[_0xa55c('0x88')]][_0xa55c('0x50')]){logger[_0xa55c('0x44')](_0xa55c('0x130'),_0x26946f[_0xa55c('0x88')],_0x26946f[_0xa55c('0x12f')],_0xa55c('0x92'),_0x307b39[_0xa55c('0x29')],_0xa55c('0x48'),_0x307b39[_0xa55c('0x90')]);this['callProgressDetectingCustomer'](_0x26946f,_0x26946f['linkedid'],_0x26946f[_0xa55c('0x12f')]);}}else if(_0x3755a7&&_[_0xa55c('0x43')](_0x3755a7[_0xa55c('0x131')])&&_0x307b39[_0xa55c('0x132')]&&_0x26946f['linkedid']===_0x26946f[_0xa55c('0xa2')]&&_[_0xa55c('0x43')](_0x26946f[_0xa55c('0xdd')])&&_0x26946f[_0xa55c('0x12f')]==='16'&&_0x26946f['channelstate']==='6'&&_[_0xa55c('0xdb')](_0x3755a7['transfer'])){if(_0x3755a7['unlockAgent']){rpcDb['unlockContact'](_0x3755a7['idContact']);}if(_0x3755a7[_0xa55c('0x87')]){rpcDb[_0xa55c('0x101')](_0x3755a7['idContact']);}_0x26946f[_0xa55c('0xdd')]='22';this[_0xa55c('0xda')](_0x3755a7,_0x307b39,_0x26946f);}else if(_0x3755a7&&_0x3755a7[_0xa55c('0x133')]){if(_0x26946f[_0xa55c('0x12f')]==='16'&&this[_0xa55c('0x14')][_0x26946f[_0xa55c('0x88')]]['dialAnswer']){logger[_0xa55c('0x44')](_0xa55c('0x134'),_0x26946f[_0xa55c('0x88')],_0x26946f[_0xa55c('0x12f')],'\x20Queue',_0x307b39['name'],'pTalking:\x20',_0x307b39[_0xa55c('0x90')]);this[_0xa55c('0x75')](_0x26946f,_0x26946f[_0xa55c('0x88')],_0x26946f[_0xa55c('0x12f')]);}else if(this[_0xa55c('0x14')][_0x26946f[_0xa55c('0x88')]][_0xa55c('0x50')]){logger[_0xa55c('0x44')]('[syncHangup][talking][cause]',_0x26946f['linkedid'],_0x26946f[_0xa55c('0x12f')],_0xa55c('0x92'),_0x307b39['name'],_0xa55c('0x48'),_0x307b39[_0xa55c('0x90')]);this['callProgressDetectingCustomer'](_0x26946f,_0x26946f['linkedid'],_0x26946f[_0xa55c('0x12f')]);}}};Preview[_0xa55c('0x35')][_0xa55c('0x1c')]=function(_0x236015){if(this['actions'][_0x236015['destlinkedid']]&&_0x236015[_0xa55c('0xd8')]!==_0x236015[_0xa55c('0x135')]){this[_0xa55c('0x75')](_0x236015,_0x236015[_0xa55c('0xd8')],_0x236015[_0xa55c('0xce')]);}};Preview[_0xa55c('0x35')][_0xa55c('0x1a')]=function(_0x2511fe){if(this[_0xa55c('0x14')][_0x2511fe[_0xa55c('0x88')]]&&_0x2511fe['linkedid']!==_0x2511fe[_0xa55c('0xa2')]&&!this['actions'][_0x2511fe[_0xa55c('0x88')]][_0xa55c('0x50')]){if(_0x2511fe[_0xa55c('0x12f')]==='1'){this[_0xa55c('0x75')](_0x2511fe,_0x2511fe[_0xa55c('0x88')],_0x2511fe[_0xa55c('0x12f')]);}}};Preview[_0xa55c('0x35')][_0xa55c('0x136')]=function(_0x1e8760,_0x329808,_0x35ad66){if(this[_0xa55c('0x14')][_0x1e8760]){if(_[_0xa55c('0x43')](this['actions'][_0x1e8760][_0xa55c('0x137')])){this[_0xa55c('0x14')][_0x1e8760]['variables']={};}this[_0xa55c('0x14')][_0x1e8760][_0xa55c('0x137')][_0x329808]=_0x35ad66;}};Preview[_0xa55c('0x35')]['syncVarSet']=function(_0x238a43){try{if(!_[_0xa55c('0x43')](_0x238a43)){if(ut['filterKey'](_[_0xa55c('0x138')](_0x238a43[_0xa55c('0x139')])[0x0])){this['addVariable'](_0x238a43[_0xa55c('0xa2')],_['keys'](_0x238a43[_0xa55c('0x139')])[0x0],_0x238a43[_0xa55c('0x13a')]);}}}catch(_0x2a6c2d){logger[_0xa55c('0x13b')](_0xa55c('0x13c'),util[_0xa55c('0x13d')](_0x2a6c2d,{'showHidden':![],'depth':null}));}};Preview[_0xa55c('0x35')][_0xa55c('0x21')]=function(_0x9b5e3a){if(_0x9b5e3a){if(this[_0xa55c('0x14')][_0x9b5e3a[_0xa55c('0x13e')]]){this[_0xa55c('0x14')][_0x9b5e3a[_0xa55c('0x13e')]][_0xa55c('0x133')]=!![];}}};Preview[_0xa55c('0x35')][_0xa55c('0x23')]=function(_0x5ac4fa){if(_0x5ac4fa){if(this[_0xa55c('0x14')][_0x5ac4fa['transfererlinkedid']]){this[_0xa55c('0x14')][_0x5ac4fa[_0xa55c('0x13f')]][_0xa55c('0x133')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x34e8=['localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','name','emit','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','INACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','message','CAMPAIGN_STATUS','DEACTIVATED','syncCampaigns','hasOwnProperty','dialMethod','booked','outbound','clearZombieChannels','type','dialActive','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','actions','queue','originated:\x20','stringify','dialAnswer','VoiceQueueId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','agentReadyId','isNil','length','getDiff','scheduledat','Agent','voicePause','run','then','logger2','[RecallMe]','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','setMessage','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','[syncHangup][talking][increment]','uniqueid','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','linkedid','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','outboundNoAnswerCallsDay','countnoanswerretry','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','outboundRejectCallsDay','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','Calling','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','isTrunkReachable','active','SIP/%s','reachable','unmonitored','unlock','unlockContact','pick','execRun','recallme','isValid','checkIsBlackList','logger','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variables','[originated][increment]','OriginateError','syncNewExten','syncOriginateResponse','lookAgent','logLookAgent','responsetime','isFailure','custom:agentringnoanswer','rejected','syncHangup','[syncHangup][talking]','cause','statedesc','isUndefined','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','filterKey','keys','addVariable','variable','value','error','inspect','transfertargetlinkedid','transfer','transfererlinkedid','exports','util','lodash','uuid','moment','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','../dialer/utils','redis','defaults'];(function(_0x3a4f18,_0x1af741){var _0x4c20fc=function(_0x27115f){while(--_0x27115f){_0x3a4f18['push'](_0x3a4f18['shift']());}};_0x4c20fc(++_0x1af741);}(_0x34e8,0x12c));var _0x834e=function(_0x4a3d9c,_0x1182e1){_0x4a3d9c=_0x4a3d9c-0x0;var _0x10a89b=_0x34e8[_0x4a3d9c];return _0x10a89b;};'use strict';var util=require(_0x834e('0x0'));var _=require(_0x834e('0x1'));var uuid=require(_0x834e('0x2'));var moment=require(_0x834e('0x3'));var Redis=require('ioredis');var config=require(_0x834e('0x4'));var logger=require(_0x834e('0x5'))(_0x834e('0x6'));var loggerAction=require(_0x834e('0x5'))(_0x834e('0x7'));var ami=require(_0x834e('0x8'));var rpcDb=require(_0x834e('0x9'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x834e('0xa'));var ut=require('./util/util');var utils=require(_0x834e('0xb'));config[_0x834e('0xc')]=_[_0x834e('0xd')](config[_0x834e('0xc')],{'host':_0x834e('0xe'),'port':0x18eb});var io=require(_0x834e('0xf'))(new Redis(config[_0x834e('0xc')]));var Sequence=function(){};Sequence[_0x834e('0x10')][_0x834e('0x11')]=function(_0x186b3b){this[_0x834e('0x12')]=this[_0x834e('0x12')]?this[_0x834e('0x12')][_0x834e('0x13')](_0x186b3b):_0x186b3b();};function Preview(_0x293514){this[_0x834e('0x14')]=new Sequence();this[_0x834e('0x15')]=_0x293514['voiceQueues'];this[_0x834e('0x16')]=_0x293514[_0x834e('0x16')];this['actions']={};this[_0x834e('0x17')]=_0x293514[_0x834e('0x17')];this[_0x834e('0x18')]=0x0;ami['on'](_0x834e('0x19'),this['syncOriginateResponse'][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1b'),this['syncHangup'][_0x834e('0x1a')](this));ami['on']('hanguprequest',this[_0x834e('0x1c')][_0x834e('0x1a')](this));ami['on']('dialend',this[_0x834e('0x1d')][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1e'),this['syncNewExten'][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1f'),this[_0x834e('0x20')][_0x834e('0x1a')](this));ami['on'](_0x834e('0x21'),this[_0x834e('0x22')][_0x834e('0x1a')](this));ami['on']('blindtransfer',this[_0x834e('0x23')][_0x834e('0x1a')](this));this[_0x834e('0x24')](this[_0x834e('0x15')]);}function emit(_0x4ab05d,_0x45a630,_0x62f8f1){io['to'](_0x4ab05d)['emit'](_0x45a630,_0x62f8f1);}function emitVoiceQueueChannelRemove(_0x1b4bdf){logger[_0x834e('0x25')](_0x834e('0x26'),JSON['stringify'](_0x1b4bdf));emit(util['format'](_0x834e('0x27'),_0x1b4bdf[_0x834e('0x28')]),'voice_queue_channel:remove',_0x1b4bdf);io[_0x834e('0x29')](_0x834e('0x2a'),_0x1b4bdf);}function notSendMessagesQueue(_0x58f4fd){if(_0x58f4fd[_0x834e('0x2b')]){if(_0x58f4fd[_0x834e('0x2c')]===0x0&&_0x58f4fd[_0x834e('0x2d')]===0x0){_0x58f4fd['sendMessageOneNotActive']=![];_0x58f4fd[_0x834e('0x2e')]=0x0;_0x58f4fd[_0x834e('0x2f')]=0x0;_0x58f4fd['message']=utils['CAMPAIGN_STATUS'][_0x834e('0x30')];ut['logger'](_0x834e('0x31'),_0x58f4fd[_0x834e('0x28')]+_0x834e('0x32'));}else{_0x58f4fd[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x35')];ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x58f4fd['name']+'\x20is\x20deactivated');}}}Preview[_0x834e('0x10')][_0x834e('0x24')]=function(){var _0x106d6a=this;setInterval(function(){_0x106d6a['syncCampaigns']();},0x7cf);};Preview[_0x834e('0x10')][_0x834e('0x36')]=function(){var _0x1f3671=this[_0x834e('0x15')];this[_0x834e('0x18')]+=0x1;for(var _0x390119 in _0x1f3671){if(_0x1f3671[_0x834e('0x37')](_0x390119)&&(_0x1f3671[_0x390119][_0x834e('0x38')]===_0x834e('0x6')||_0x1f3671[_0x390119]['dialMethod']===_0x834e('0x39'))&&_0x1f3671[_0x390119]['type']===_0x834e('0x3a')){if(this[_0x834e('0x18')]>0x7){this[_0x834e('0x18')]=0x0;this[_0x834e('0x3b')]();}}if(_0x1f3671[_0x834e('0x37')](_0x390119)&&_0x1f3671[_0x390119][_0x834e('0x38')]===_0x834e('0x6')&&_0x1f3671[_0x390119][_0x834e('0x3c')]===_0x834e('0x3a')){if(_0x1f3671[_0x390119][_0x834e('0x3d')]){this['setMessage'](_0x1f3671[_0x390119]);if(_0x1f3671[_0x390119][_0x834e('0x3e')])this[_0x834e('0x3f')](_0x1f3671[_0x390119]);}else{notSendMessagesQueue(_0x1f3671[_0x390119]);}}}};Preview[_0x834e('0x10')][_0x834e('0x40')]=function(_0x595cc0){var _0x3f88ad=this;this[_0x834e('0x14')]['enqueue'](function(){if(!_['isNil'](_0x3f88ad['actions'][_0x595cc0])){loggerAction[_0x834e('0x25')](_0x834e('0x41'),_0x595cc0,_0x834e('0x42'),_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x44')],_0x834e('0x45'),JSON['stringify'](_0x3f88ad[_0x834e('0x15')][_0x3f88ad['actions'][_0x595cc0][_0x834e('0x44')]][_0x834e('0x2c')]),'pTalking:\x20',JSON[_0x834e('0x46')](_0x3f88ad[_0x834e('0x15')][_0x3f88ad['actions'][_0x595cc0]['queue']][_0x834e('0x2d')]),JSON[_0x834e('0x46')](_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x47')]),JSON[_0x834e('0x46')](_['pick'](_0x3f88ad[_0x834e('0x43')][_0x595cc0],['contactId','UserId',_0x834e('0x48'),'ListId'])));return ami[_0x834e('0x49')]({'action':_0x834e('0x4a'),'channel':_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x4b')]})[_0x834e('0x4c')](function(_0x574ea8){if(_0x574ea8[_0x834e('0x33')]===_0x834e('0x4d')){setTimeout(function(){if(_0x3f88ad[_0x834e('0x43')][_0x595cc0]){ut['updateOriginated'](_0x3f88ad[_0x834e('0x15')][_0x3f88ad[_0x834e('0x43')][_0x595cc0]['queue']],_0x834e('0x4e'));if(_0x3f88ad['actions'][_0x595cc0][_0x834e('0x47')]===!![]){ut[_0x834e('0x4f')](_0x3f88ad['campaignsPreview'][_0x3f88ad['actions'][_0x595cc0][_0x834e('0x44')]],_0x834e('0x4e'));ut[_0x834e('0x50')](_0x834e('0x51')+_0x595cc0,_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x44')]);}ut[_0x834e('0x50')]('[Dialer][checkChannel][Preview]'+_0x595cc0,_0x3f88ad[_0x834e('0x43')][_0x595cc0]['queue']);delete _0x3f88ad[_0x834e('0x43')][_0x595cc0];}},0x2328);}});}});};Preview['prototype'][_0x834e('0x3b')]=function(){var _0x5a5807=this;loggerAction[_0x834e('0x25')](_0x834e('0x52'),_['size'](this[_0x834e('0x43')]));for(var _0x3f2321 in this[_0x834e('0x43')]){if(_0x5a5807[_0x834e('0x43')][_0x834e('0x37')](_0x3f2321)){_0x5a5807[_0x834e('0x40')](_0x3f2321);}}};Preview[_0x834e('0x10')][_0x834e('0x3f')]=function(_0x5dc63b){var _0x279ea1=this;rpcDb['getContactRecallMe'](_0x5dc63b['id'],ut[_0x834e('0x53')](this[_0x834e('0x17')]))['then'](function(_0x112306){if(!_[_0x834e('0x54')](_0x112306)){for(var _0x25b035=0x0;_0x25b035<_0x112306[_0x834e('0x55')];_0x25b035+=0x1){if(ut[_0x834e('0x56')](_0x112306[_0x25b035][_0x834e('0x57')])<_0x5dc63b['dialRecallMeTimeout']*0x3c){if(_0x112306[_0x25b035]['Agent']&&!_0x112306[_0x25b035][_0x834e('0x58')][_0x834e('0x59')]){_0x279ea1[_0x834e('0x5a')](_0x112306[_0x25b035]['id'])[_0x834e('0x5b')](ut[_0x834e('0x5c')](_0x834e('0x5d')))[_0x834e('0x4c')](ut[_0x834e('0x5c')](_0x834e('0x5d')));}else{rpcDb[_0x834e('0x5e')](_0x112306[_0x25b035]['id']);}}else{var _0xf02f0d=new Action(_0x112306[_0x25b035],_0x5dc63b);_0xf02f0d[_0x834e('0x5f')]=moment()[_0x834e('0x60')](_0x834e('0x61'));_0x5dc63b[_0x834e('0x62')]+=0x1;ut[_0x834e('0x63')](_0xf02f0d,0x17,_0x834e('0x64'));if(_0x5dc63b[_0x834e('0x65')]){rpcDb[_0x834e('0x66')](ut[_0x834e('0x67')](_0x112306[_0x25b035]));rpcDb['createCustomerHistory'](_0xf02f0d,_0x834e('0x68'));}else{ut[_0x834e('0x63')](_0xf02f0d,0x16,'RecallFailedTimeout');rpcDb[_0x834e('0x69')](_0xf02f0d,_0x834e('0x6a'));rpcDb['createCustomerFinal'](_0xf02f0d,_0x834e('0x6a'));}}}}})[_0x834e('0x4c')](ut[_0x834e('0x5c')](_0x834e('0x6b')));};Preview[_0x834e('0x10')][_0x834e('0x6c')]=function(_0x4549ba){_0x4549ba['sendMessageOneNotActive']=!![];if(ut[_0x834e('0x6d')](_0x4549ba[_0x834e('0x6e')])){_0x4549ba[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x6f')];}else if(!ut[_0x834e('0x70')](_0x4549ba[_0x834e('0x3d')])){_0x4549ba[_0x834e('0x33')]=utils['CAMPAIGN_STATUS'][_0x834e('0x30')];}else if(!this['isTrunkReachable'](_0x4549ba[_0x834e('0x71')])){if(!this['isTrunkReachable'](_0x4549ba[_0x834e('0x72')])){_0x4549ba['message']=utils['CAMPAIGN_STATUS'][_0x834e('0x73')];}else{_0x4549ba[_0x834e('0x33')]=utils['CAMPAIGN_STATUS']['ACTIVE'];}}else{_0x4549ba[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x74')];}};Preview[_0x834e('0x10')][_0x834e('0x75')]=function(_0x315858,_0x3d3f2b,_0x4273f1){var _0x528e66=this;var _0x142334=this[_0x834e('0x43')][_0x3d3f2b];var _0x5d5ac2=this[_0x834e('0x15')][_0x142334['queue']];var _0x3e58ef;var _0x45eceb=![];var _0x5160c4=0x2;var _0x41ef86=0x3;if(_0x5d5ac2){switch(_0x4273f1){case'1':_0x5d5ac2[_0x834e('0x76')]+=0x1;_0x142334[_0x834e('0x77')]+=0x1;_0x142334[_0x834e('0x78')]=ut['totalGlobal'](_0x142334);ut[_0x834e('0x63')](_0x142334,0x0,_0x834e('0x79'));ami[_0x834e('0x29')]('custom:agentnosuchnumber',ut[_0x834e('0x7a')](_0x142334,_0x834e('0x7b')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0x7c'));_0x528e66[_0x834e('0x7d')](_0x142334,'0',_0x5d5ac2)[_0x834e('0x5b')](function(_0x3a1426){_0x45eceb=_0x3a1426[_0x834e('0x7e')]==0x1;_0x5160c4=_0x5d5ac2[_0x834e('0x7f')];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0x86'));}else{if(_0x142334[_0x834e('0x77')]>=_0x5d5ac2[_0x834e('0x87')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0x86'));}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,'countnosuchnumberretry',_0x5d5ac2[_0x834e('0x7f')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}delete this[_0x834e('0x43')][_0x315858['linkedid']];}else{_0x142334[_0x834e('0x77')]++;logger['info']('actioncountonusuch',_0x142334[_0x834e('0x77')]);logger[_0x834e('0x25')]('id',_0x142334[_0x834e('0x8c')]);_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnosuchnumberretry':_0x142334[_0x834e('0x77')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case _0x834e('0x8f'):var _0x5a99e6=moment()[_0x834e('0x60')](_0x834e('0x61'));_0x142334['responsetime']=_0x5a99e6;_0x142334['answertime']=_0x5a99e6;_0x142334[_0x834e('0x47')]=!![];_0x5d5ac2[_0x834e('0x2d')]+=0x1;logger[_0x834e('0x25')](_0x834e('0x90'),_0x142334[_0x834e('0x91')],'\x20Queue',_0x5d5ac2[_0x834e('0x28')],_0x834e('0x92'),_0x5d5ac2[_0x834e('0x2d')]);ami[_0x834e('0x29')](_0x834e('0x93'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0x94'),this[_0x834e('0x15')][_0x142334[_0x834e('0x44')]]));if(_0x5d5ac2[_0x834e('0x95')]){ami['emit'](_0x834e('0x96'),ut[_0x834e('0x97')](_0x142334));}break;case'16':ami[_0x834e('0x29')](_0x834e('0x98'),ut['buildObj'](_0x142334,_0x834e('0x99'),this['campaignsPreview'][_0x142334['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x142334,_0x834e('0x99')));_0x5d5ac2[_0x834e('0x9a')]+=0x1;_0x5d5ac2['total']+=0x1;_0x5d5ac2[_0x834e('0x9b')]+=0x1;ut[_0x834e('0x4f')](_0x5d5ac2,'[16]');_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0x4,'Answer');rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0x9c'));rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0x9d'));rpcDb[_0x834e('0x9e')](_0x142334);_0x5d5ac2['sumDuration']+=_0x142334[_0x834e('0x9f')];_0x5d5ac2['sumBillable']+=_0x142334[_0x834e('0x9f')];logger[_0x834e('0x25')](_0x834e('0xa0'),_0x142334['uniqueid'],_0x834e('0xa1'),_0x5d5ac2[_0x834e('0x28')],'pTalking:\x20',_0x5d5ac2[_0x834e('0x2d')]);delete this[_0x834e('0x43')][_0x315858[_0x834e('0xa2')]];break;case'BUSY':_0x5d5ac2[_0x834e('0xa3')]+=0x1;_0x142334[_0x834e('0xa4')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x5,_0x834e('0xa5'));_0x5160c4=_0x5d5ac2[_0x834e('0xa6')];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];ami[_0x834e('0x29')](_0x834e('0xa7'),ut['buildObj'](_0x142334,'busy'));rpcDb['createCustomerHistory'](_0x142334,_0x834e('0xa8'));_0x528e66[_0x834e('0x7d')](_0x142334,'5',_0x5d5ac2)[_0x834e('0x5b')](function(_0x37fa2c){_0x45eceb=_0x37fa2c[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xa9'));}else{if(_0x142334[_0x834e('0xa4')]>=_0x5d5ac2['dialBusyMaxRetry']){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xa8'));}else{rpcDb[_0x834e('0x88')](ut['scheduledAt'](_0x142334,_0x834e('0xa4'),_0x5d5ac2[_0x834e('0xa6')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xa4')]++;_0x528e66['incrementPreviewCounters']({'id':_0x142334['idContact'],'field':{'countbusyretry':_0x142334[_0x834e('0xa4')]}})[_0x834e('0x5b')](function(){_0x528e66['swapAdditionalPhones'](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case'NOANSWER':_0x5d5ac2[_0x834e('0xaa')]+=0x1;_0x142334[_0x834e('0xab')]+=0x1;_0x142334[_0x834e('0x78')]=ut['totalGlobal'](_0x142334);ut[_0x834e('0x63')](_0x142334,0x3,'NoAnswer');_0x5160c4=_0x5d5ac2['dialNoAnswerRetryFrequency'];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];var _0x6735e6=ut[_0x834e('0xac')](_0x142334,_0x5d5ac2);ami[_0x834e('0x29')](_0x834e('0xad'),_0x6735e6);rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xae'));_0x528e66[_0x834e('0x7d')](_0x142334,'3',_0x5d5ac2)[_0x834e('0x5b')](function(_0x17e61a){_0x45eceb=_0x17e61a['additional']==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xaf'));}else{if(_0x142334[_0x834e('0xab')]>=_0x5d5ac2[_0x834e('0xb0')]){rpcDb['createCustomerFinal'](_0x142334,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,'countnoanswerretry',_0x5d5ac2[_0x834e('0xb1')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})[_0x834e('0x5b')](function(){_0x528e66['swapAdditionalPhones'](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case'CONGESTION':_0x5d5ac2[_0x834e('0xb2')]+=0x1;_0x142334[_0x834e('0xb3')]+=0x1;_0x142334['countglobal']=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x8,'Congestion');_0x5160c4=_0x5d5ac2[_0x834e('0xb4')];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];ami['emit'](_0x834e('0xb5'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xb6')));rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logCongestion]');_0x528e66[_0x834e('0x7d')](_0x142334,'8',_0x5d5ac2)[_0x834e('0x5b')](function(_0x260934){_0x45eceb=_0x260934[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xb7'));}else{if(_0x142334[_0x834e('0xb3')]>=_0x5d5ac2[_0x834e('0xb8')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xb9'));}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,_0x834e('0xb3'),_0x5d5ac2[_0x834e('0xa6')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xb3')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countcongestionretry':_0x142334[_0x834e('0xb3')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case _0x834e('0xba'):_0x5d5ac2[_0x834e('0xbb')]+=0x1;_0x142334[_0x834e('0xbc')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0x14,'AgentReject');_0x5160c4=_0x5d5ac2['dialAgentRejectRetryFrequency'];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];ami['emit'](_0x834e('0xbd'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xbe')));rpcDb['createCustomerHistory'](_0x142334,_0x834e('0xbf'));_0x528e66[_0x834e('0x7d')](_0x142334,'20',_0x5d5ac2)[_0x834e('0x5b')](function(_0x1594ef){_0x45eceb=_0x1594ef[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0x14,_0x834e('0xc0'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xc1'));}else{if(_0x142334[_0x834e('0xbc')]>=_0x5d5ac2['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x142334,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0x834e('0x89')](_0x142334,_0x834e('0xbc'),_0x5d5ac2['dialAgentRejectRetryFrequency']),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334['countnoanswerretry']++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case'ABANDONED':_0x5d5ac2['outboundAbandonedCallsDay']+=0x1;_0x142334[_0x834e('0xc2')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0xb,_0x834e('0xc3'));rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logAbandoned]');_0x528e66[_0x834e('0x7d')](_0x142334,'11',_0x5d5ac2)[_0x834e('0x5b')](function(_0x216d1f){_0x45eceb=_0x216d1f[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut['cloneAction'](_0x142334,0xf,'Global');rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xc4'));}else{if(_0x142334[_0x834e('0xc5')]>=_0x5d5ac2[_0x834e('0xc6')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xc4'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x142334,_0x834e('0xc2'),_0x5d5ac2[_0x834e('0xc7')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334['countnoanswerretry']}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case'18':_0x5d5ac2[_0x834e('0xc8')]+=0x1;_0x142334[_0x834e('0xc9')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x12,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);ami[_0x834e('0x29')](_0x834e('0xcc'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xcd')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xce'));_0x528e66[_0x834e('0x7d')](_0x142334,'18',_0x5d5ac2)['then'](function(_0x5f1e3b){_0x45eceb=_0x5f1e3b[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut['cloneAction'](_0x142334,0x12,_0x834e('0x84'));rpcDb['createCustomerFinal'](_0x3e58ef,_0x834e('0xce'));}else{rpcDb['createCustomerFinal'](_0x142334,_0x834e('0xce'));}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334['countnoanswerretry']}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});delete this[_0x834e('0x43')][_0x315858[_0x834e('0xa2')]];break;case'19':_0x5d5ac2[_0x834e('0xc8')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x13,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);ami[_0x834e('0x29')](_0x834e('0xcc'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xcd')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xcf'));_0x528e66['verifyAdditionalPhones'](_0x142334,'18',_0x5d5ac2)['then'](function(_0x2df814){_0x45eceb=_0x2df814[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xcf'));}else{rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xcf'));}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})['then'](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});delete this[_0x834e('0x43')][_0x315858['linkedid']];break;default:if(_0x142334[_0x834e('0x47')]){ut[_0x834e('0x4f')](_0x5d5ac2,'[default]');ut['loggerError'](_0x834e('0xd0')+_0x5d5ac2[_0x834e('0x28')],_0x315858);}_0x5d5ac2['outboundUnknownCallsDay']+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0xc,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);_0x5160c4=_0x5d5ac2['dialAgentRejectRetryFrequency'];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logUnknown]');_0x528e66['verifyAdditionalPhones'](_0x142334,'20',_0x5d5ac2)['then'](function(_0xac9d00){_0x45eceb=_0xac9d00[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xd1'));}delete this[_0x834e('0x43')][_0x315858['linkedid']];}else{_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});}});}if(!(_0x142334[_0x834e('0x47')]&&_0x4273f1==='16')){ut['updateOriginated'](_0x5d5ac2,_0x834e('0xd2'));logger[_0x834e('0x25')]('[originated][decrement][callProgressDetectingCustomer]',_0x142334[_0x834e('0x91')],_0x834e('0xa1'),_0x5d5ac2[_0x834e('0x28')],_0x834e('0x45'),_0x5d5ac2[_0x834e('0x2c')]);}if(_0x4273f1!==_0x834e('0x8f')){delete this['actions'][_0x315858[_0x834e('0xa2')]];delete this[_0x834e('0x43')][_0x315858[_0x834e('0xd3')]];}_0x5d5ac2[_0x834e('0xd4')]=!![];}};Preview[_0x834e('0x10')][_0x834e('0xd5')]=function(_0x5d3c6d,_0x448420,_0x490a57){if(_['isUndefined'](_0x448420)&&_0x834e('0xd6')!==typeof _0x448420){return;}if(_['isUndefined'](_0x490a57)&&'object'!==typeof _0x490a57){return;}switch(_0x490a57[_0x834e('0xd7')]){case'0':ut[_0x834e('0xd8')](_0x5d3c6d,0x0,_0x834e('0x79'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xda'));break;case'3':ut[_0x834e('0xd8')](_0x5d3c6d,0x3,_0x834e('0xdb'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdc'));break;case'5':ut[_0x834e('0xd8')](_0x5d3c6d,0x5,_0x834e('0xa5'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdd'));break;case'8':ut[_0x834e('0xd8')](_0x5d3c6d,0x8,'Congestion');rpcDb[_0x834e('0xd9')](_0x5d3c6d,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x834e('0xd8')](_0x5d3c6d,0x16,_0x834e('0xde'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdf'));break;default:ut['logAgent'](_0x5d3c6d,0xc,_0x490a57['reason']);rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xe0'));}ut['updateOriginated'](_0x448420,_0x834e('0xe1'));logger[_0x834e('0x25')]('[originated][decrement][callProgressDetectingAgent]',_0x5d3c6d[_0x834e('0x91')],_0x834e('0xa1'),_0x448420[_0x834e('0x28')],_0x834e('0x45'),_0x448420['originated']);delete this['actions'][_0x5d3c6d['uniqueid']];};Preview['prototype'][_0x834e('0x7d')]=function(_0x3c4847,_0x47891e,_0x41ba0c){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x3c4847,_0x47891e,_0x41ba0c)[_0x834e('0x4c')](logger[_0x834e('0x25')](_0x834e('0xe2')));};Preview[_0x834e('0x10')][_0x834e('0x8e')]=function(_0xfa6cdb,_0x3c775f,_0x4fc61d){return cmHopperAdditionalPhone[_0x834e('0x8e')](_0xfa6cdb,_0x3c775f,_0x4fc61d)[_0x834e('0x4c')](logger['info'](_0x834e('0xe3')));};Preview[_0x834e('0x10')]['incrementPreviewCounters']=function(_0x486c18){return Promise['resolve']()[_0x834e('0x5b')](cmHopperAdditionalPhone[_0x834e('0x8d')](_0x486c18))[_0x834e('0x4c')](logger['info'](_0x834e('0xe4')));};Preview[_0x834e('0x10')][_0x834e('0xe5')]=function(_0x17e729,_0x4b4f7c,_0xad7b72,_0x19cb0b,_0x13af70){var _0x8804a8=this;return new Promise(function(_0x102640,_0x48b6c4){if(_['isNil'](_0x4b4f7c)||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0xe6')])||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0xe7')])||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0x48')])){_0x48b6c4(ut[_0x834e('0x33')](_0x834e('0xe8'),_0x19cb0b,_0x13af70));return;}var _0x38151c=uuid['v4']();var _0x97a4b2=_0x8804a8[_0x834e('0x15')][_0x4b4f7c[_0x834e('0x42')][_0x834e('0x28')]];var _0x4b12cd=_0xad7b72?_0x8804a8[_0x834e('0x17')][_0xad7b72]['id']:undefined;_0x8804a8[_0x834e('0x43')][_0x38151c]=new Action(_0x4b4f7c,_0x97a4b2,_0x38151c,_0xad7b72,_0x4b12cd);var _0x3f5b2e=_0x8804a8[_0x834e('0x43')][_0x38151c];_0x3f5b2e['unlockAgent']=_0x19cb0b;_0x3f5b2e['activeContact']=_0x13af70;_0x3f5b2e['lookAgent']=_0xad7b72;if(_[_0x834e('0xe9')](_0x17e729)){_0x8804a8[_0x834e('0xea')](_0x3f5b2e,_0x97a4b2,_0x4b4f7c,_0xad7b72)[_0x834e('0x5b')](function(_0x23d7e6){logger[_0x834e('0x25')](_0x834e('0xeb'),_0x834e('0xec')+_0x3f5b2e[_0x834e('0x44')]+'\x20IdHopper:\x20'+_0x3f5b2e['idContact'],JSON['stringify'](_0x23d7e6));ami['emit'](_0x834e('0xed'),ut[_0x834e('0x7a')](_0x3f5b2e,_0x834e('0xee'),_0x8804a8[_0x834e('0x15')][_0x3f5b2e[_0x834e('0x44')]]));_0x102640(ut[_0x834e('0x33')](_0x834e('0xef')));})[_0x834e('0x4c')](function(_0x33757d){ut['logger']('[Preview][execCall][failure]',_0x33757d);_0x48b6c4(ut['message']('Call\x20failed',_0x19cb0b,_0x13af70));});}else{_0x97a4b2[_0x834e('0xf0')]+=0x1;ut[_0x834e('0xf1')](_0x3f5b2e);rpcDb[_0x834e('0xf2')](_0x3f5b2e,_0x834e('0xf3'));delete _0x8804a8[_0x834e('0x43')][_0x38151c];_0x48b6c4(ut[_0x834e('0x33')](_0x834e('0xf4'),_0x19cb0b,_0x13af70));}});};Preview[_0x834e('0x10')][_0x834e('0xf5')]=function(_0xcd64c2){return!_[_0x834e('0x54')](_0xcd64c2)&&!_[_0x834e('0x54')](_0xcd64c2[_0x834e('0x28')])&&!_[_0x834e('0x54')](_0xcd64c2[_0x834e('0xf6')])&&_0xcd64c2[_0x834e('0xf6')]&&!_['isNil'](this[_0x834e('0x16')][util['format'](_0x834e('0xf7'),_0xcd64c2[_0x834e('0x28')])])&&!_[_0x834e('0x54')](this['trunks'][util[_0x834e('0x60')](_0x834e('0xf7'),_0xcd64c2['name'])]['status'])&&(this[_0x834e('0x16')][util[_0x834e('0x60')](_0x834e('0xf7'),_0xcd64c2[_0x834e('0x28')])][_0x834e('0x4a')]===_0x834e('0xf8')||this[_0x834e('0x16')][util[_0x834e('0x60')]('SIP/%s',_0xcd64c2[_0x834e('0x28')])][_0x834e('0x4a')]===_0x834e('0xf9'));};Preview[_0x834e('0x10')][_0x834e('0x5a')]=function(_0x614e15,_0x17aaae){return this['execRun'](_0x614e15,_0x17aaae)[_0x834e('0x5b')](function(_0x59e298){return _['pick'](_0x59e298,[_0x834e('0x33')]);})[_0x834e('0x4c')](function(_0x4b16fa){if(_0x4b16fa[_0x834e('0xfa')]){rpcDb[_0x834e('0xfb')](_0x614e15);}if(_0x4b16fa['active']){rpcDb[_0x834e('0x5e')](_0x614e15);}throw _[_0x834e('0xfc')](_0x4b16fa,['message']);});};Preview['prototype'][_0x834e('0xfd')]=function(_0x2ec9f1,_0x4e6525){var _0x58a935=this;var _0x269ff6,_0xa496aa;return rpcDb['getContactPreview'](_0x2ec9f1)['then'](function(_0x495352){if(!_['isNil'](_0x495352[0x0])){_0xa496aa=_0x495352[0x0][_0x834e('0xfe')]?![]:!![];_0x269ff6=_0x495352[0x0]['recallme']?!![]:![];_0x269ff6=_0x4e6525?!![]:_0x269ff6;}var _0x3be4c3=_0x58a935['validateContact'](_0x495352);if(_0x3be4c3[_0x834e('0xff')]){rpcDb[_0x834e('0x100')](_[_0x834e('0xfc')](_0x495352[0x0],[_0x834e('0x48'),'phone']))[_0x834e('0x5b')](function(_0x446d89){_0x58a935[_0x834e('0xe5')](_0x446d89,_0x495352[0x0],_0x4e6525,_0xa496aa,_0x269ff6)[_0x834e('0x5b')](function(_0x3a3a6c){return _0x3a3a6c;})[_0x834e('0x4c')](function(_0x3d8abb){throw _0x3d8abb;});})[_0x834e('0x4c')](function(_0x464ae6){ut[_0x834e('0x101')]('[Preview][checkIsBlackList]',_0x464ae6);throw ut[_0x834e('0x33')]('Call\x20unsuccessful',_0xa496aa,_0x269ff6);});}else{throw ut[_0x834e('0x33')](_0x3be4c3[_0x834e('0x33')],_0xa496aa,_0x269ff6);}})[_0x834e('0x4c')](function(_0x31a7ae){ut[_0x834e('0x101')]('[Preview][getContactPreview]',_0x31a7ae);throw ut[_0x834e('0x33')]('Call\x20unsuccessful',![],!![]);});};Preview['prototype'][_0x834e('0x102')]=function(_0x30ecb9){if(_[_0x834e('0x54')](_0x30ecb9)||_['isEmpty'](_0x30ecb9)||!_[_0x834e('0x54')](_0x30ecb9[0x0][_0x834e('0x58')])&&_[_0x834e('0x54')](_0x30ecb9[0x0][_0x834e('0x58')][_0x834e('0x28')])){ut[_0x834e('0x101')](_0x834e('0x103'),_0x30ecb9);return{'isValid':![],'message':_0x834e('0x104')};}var _0x125787=this[_0x834e('0x15')][_0x30ecb9[0x0][_0x834e('0x42')]['name']];_0x125787[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x74')];if(_[_0x834e('0x54')](_0x125787)){ut[_0x834e('0x101')](_0x834e('0x105'),_0x125787);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x834e('0xf5')](_0x125787[_0x834e('0x71')])){ut[_0x834e('0x101')](_0x834e('0x106'),_0x834e('0x107')+_0x125787[_0x834e('0x28')]+_0x834e('0x108'));if(!this[_0x834e('0xf5')](_0x125787[_0x834e('0x72')])){ut[_0x834e('0x101')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x125787['name']+_0x834e('0x109'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x834e('0x70')](_0x125787[_0x834e('0x3d')])){ut[_0x834e('0x101')](_0x834e('0x10a'),_0x125787[_0x834e('0x28')]+_0x834e('0x10b'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x125787[_0x834e('0x28')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0x834e('0xea')]=function(_0x3b9429,_0x52cdd5,_0x5cb379,_0x494e08){var _0x2515f6=this;return new Promise(function(_0x45c8e6,_0x3512d8){var _0x5e0bfe=_0x3b9429[_0x834e('0x91')];var _0x21cb1d=_0x2515f6[_0x834e('0xf5')](_0x52cdd5[_0x834e('0x71')])?util[_0x834e('0x60')](_0x834e('0x10c'),_0x52cdd5['Trunk']['name'],_['isNil'](_0x52cdd5['dialPrefix'])?'':_0x52cdd5[_0x834e('0x10d')][_0x834e('0x10e')]()||'',_0x52cdd5[_0x834e('0x10f')]>0x0?_0x5cb379[_0x834e('0xe7')][_0x834e('0x110')](_0x52cdd5[_0x834e('0x10f')]):_0x5cb379[_0x834e('0xe7')]):util[_0x834e('0x60')](_0x834e('0x10c'),_[_0x834e('0x54')](_0x52cdd5[_0x834e('0x72')])?_0x52cdd5[_0x834e('0x71')][_0x834e('0x28')]:_0x52cdd5[_0x834e('0x72')][_0x834e('0x28')],_['isNil'](_0x52cdd5['dialPrefix'])?'':_0x52cdd5[_0x834e('0x10d')][_0x834e('0x10e')]()||'',_0x52cdd5[_0x834e('0x10f')]>0x0?_0x5cb379['phone'][_0x834e('0x110')](_0x52cdd5[_0x834e('0x10f')]):_0x5cb379[_0x834e('0xe7')]);var _0x431f18=_0x2515f6[_0x834e('0xf5')](_0x52cdd5[_0x834e('0x71')])?ut[_0x834e('0x111')](_0x52cdd5[_0x834e('0x71')][_0x834e('0x112')],_0x52cdd5['dialOriginateCallerIdName'],_0x52cdd5[_0x834e('0x113')]>0x0?ut[_0x834e('0x114')](_0x52cdd5[_0x834e('0x115')],_0x52cdd5[_0x834e('0x113')]):_0x52cdd5['dialOriginateCallerIdNumber']):ut[_0x834e('0x111')](_[_0x834e('0x54')](_0x52cdd5[_0x834e('0x72')])?_0x52cdd5[_0x834e('0x71')][_0x834e('0x112')]:_0x52cdd5[_0x834e('0x72')][_0x834e('0x112')],_0x52cdd5[_0x834e('0x116')],_0x52cdd5[_0x834e('0x113')]>0x0?ut['getCallerIdRandom'](_0x52cdd5[_0x834e('0x115')],_0x52cdd5['dialRandomLastDigitCallerIdNumber']):_0x52cdd5[_0x834e('0x115')]);if(_0x431f18){_0x3b9429['originatecalleridname']=ut[_0x834e('0x117')](_0x431f18);_0x3b9429[_0x834e('0x118')]=ut[_0x834e('0x119')](_0x431f18);}var _0x2d2268=ut[_0x834e('0x11a')](_0x52cdd5,_0x5cb379,_0x21cb1d,_0x431f18,_0x5e0bfe,_0x3b9429);_['merge'](_0x3b9429,ut[_0x834e('0x11b')](_0x2d2268));_0x3b9429[_0x834e('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x52cdd5[_0x834e('0x11c')]=_0x2d2268;var _0x4db3c5=ut['variablesAction'](_0x3b9429,_0x52cdd5,_0x2d2268,_0x3b9429['activeContact'],_0x494e08);return ami[_0x834e('0x49')](_0x4db3c5)[_0x834e('0x5b')](function(_0xbd9400){_0x52cdd5[_0x834e('0x2c')]+=0x1;logger[_0x834e('0x25')](_0x834e('0x11d'),_0x5e0bfe,_0x834e('0xa1'),_0x52cdd5['name'],_0x834e('0x45'),_0x52cdd5[_0x834e('0x2c')]);_0x45c8e6(_0xbd9400);})['catch'](function(_0x5df60f){ut[_0x834e('0xd8')](_0x3b9429,0xe,_0x834e('0x11e'));rpcDb['createAgentHistory'](_0x3b9429,'[originateFailure][logOriginateFailure]');_0x3512d8(_0x5df60f);});});};Preview[_0x834e('0x10')][_0x834e('0x11f')]=function(_0x42305c){if(this['actions'][_0x42305c[_0x834e('0xa2')]]){this[_0x834e('0x43')][_0x42305c[_0x834e('0xa2')]]['channel']=_0x42305c[_0x834e('0x4b')];}};Preview['prototype'][_0x834e('0x120')]=function(_0x1debf7){var _0x3a1328=this;var _0x10971d=this[_0x834e('0x43')][_0x1debf7['actionid']];if(_0x10971d){if(_0x10971d[_0x834e('0x121')]&&this[_0x834e('0x17')][_0x10971d[_0x834e('0x121')]]){ut[_0x834e('0x122')](_0x10971d,this[_0x834e('0x17')][_0x10971d['lookAgent']]['name'],this[_0x834e('0x17')][_0x10971d[_0x834e('0x121')]]['id']);}var _0x13d670=_['clone'](_0x10971d);_0x13d670[_0x834e('0x123')]=moment()[_0x834e('0x60')](_0x834e('0x61'));var _0x386b73=_0x3a1328['campaignsPreview'][_0x10971d[_0x834e('0x44')]];if(ut[_0x834e('0x124')](_0x1debf7['response'])){if(_0x10971d[_0x834e('0x8a')]){rpcDb[_0x834e('0xfb')](_0x10971d[_0x834e('0x8c')]);}if(_0x10971d[_0x834e('0x8b')]){rpcDb['disableContact'](_0x10971d[_0x834e('0x8c')]);}ami['emit'](_0x834e('0x125'),ut[_0x834e('0x7a')](_0x10971d,_0x834e('0x126'),this[_0x834e('0x15')][_0x10971d[_0x834e('0x44')]]));this[_0x834e('0xd5')](_0x13d670,_0x386b73,_0x1debf7);}else{_0x10971d['starttime']=moment()['format'](_0x834e('0x61'));ut[_0x834e('0xd8')](_0x13d670,0x4,'Answer');rpcDb[_0x834e('0xd9')](_0x13d670,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x834e('0x10')][_0x834e('0x127')]=function(_0x319d6c){var _0x151b58=this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]];var _0x36836f;if(_0x151b58){_0x36836f=this['campaignsPreview'][_0x151b58[_0x834e('0x44')]];logger[_0x834e('0x25')](_0x834e('0x128'),_0x319d6c[_0x834e('0xa2')],_0x834e('0xa1'),_0x36836f['name'],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);}if(this[_0x834e('0x43')][_0x319d6c['linkedid']]&&_0x319d6c['linkedid']!==_0x319d6c['uniqueid']){if(_0x319d6c[_0x834e('0x129')]==='16'&&this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){this[_0x834e('0x75')](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}else if(this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')]('[syncHangup][talking][cause]',_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f[_0x834e('0x28')],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this[_0x834e('0x75')](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c['cause']);}}else if(_0x151b58&&_[_0x834e('0x54')](_0x151b58[_0x834e('0x12a')])&&_0x36836f['dialQueueProject']&&_0x319d6c[_0x834e('0xa2')]===_0x319d6c[_0x834e('0x91')]&&_[_0x834e('0x54')](_0x319d6c[_0x834e('0xd7')])&&_0x319d6c['cause']==='16'&&_0x319d6c['channelstate']==='6'&&_[_0x834e('0x12b')](_0x151b58['transfer'])){if(_0x151b58[_0x834e('0x8a')]){rpcDb[_0x834e('0xfb')](_0x151b58[_0x834e('0x8c')]);}if(_0x151b58[_0x834e('0x8b')]){rpcDb[_0x834e('0x5e')](_0x151b58['idContact']);}_0x319d6c[_0x834e('0xd7')]='22';this['callProgressDetectingAgent'](_0x151b58,_0x36836f,_0x319d6c);}else if(_0x151b58&&_0x151b58['transfer']){if(_0x319d6c[_0x834e('0x129')]==='16'&&this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')](_0x834e('0x12c'),_0x319d6c['linkedid'],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f['name'],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this['callProgressDetectingCustomer'](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}else if(this['actions'][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')](_0x834e('0x12d'),_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f[_0x834e('0x28')],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this['callProgressDetectingCustomer'](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}}};Preview[_0x834e('0x10')][_0x834e('0x1d')]=function(_0x371767){if(this[_0x834e('0x43')][_0x371767[_0x834e('0xd3')]]&&_0x371767[_0x834e('0xd3')]!==_0x371767[_0x834e('0x12e')]){this[_0x834e('0x75')](_0x371767,_0x371767[_0x834e('0xd3')],_0x371767[_0x834e('0xcb')]);}};Preview['prototype'][_0x834e('0x1c')]=function(_0x1cd122){if(this['actions'][_0x1cd122['linkedid']]&&_0x1cd122['linkedid']!==_0x1cd122[_0x834e('0x91')]&&!this[_0x834e('0x43')][_0x1cd122[_0x834e('0xa2')]][_0x834e('0x47')]){if(_0x1cd122[_0x834e('0x129')]==='1'){this[_0x834e('0x75')](_0x1cd122,_0x1cd122[_0x834e('0xa2')],_0x1cd122['cause']);}}};Preview['prototype']['addVariable']=function(_0x47947b,_0x684a97,_0x3c8fc2){if(this[_0x834e('0x43')][_0x47947b]){if(_['isNil'](this['actions'][_0x47947b]['variables'])){this[_0x834e('0x43')][_0x47947b]['variables']={};}this['actions'][_0x47947b][_0x834e('0x11c')][_0x684a97]=_0x3c8fc2;}};Preview[_0x834e('0x10')][_0x834e('0x20')]=function(_0x1acdbd){try{if(!_[_0x834e('0x54')](_0x1acdbd)){if(ut[_0x834e('0x12f')](_[_0x834e('0x130')](_0x1acdbd['variable'])[0x0])){this[_0x834e('0x131')](_0x1acdbd[_0x834e('0x91')],_[_0x834e('0x130')](_0x1acdbd[_0x834e('0x132')])[0x0],_0x1acdbd[_0x834e('0x133')]);}}}catch(_0x488f82){logger[_0x834e('0x134')]('[syncVarSet][Preview]',util[_0x834e('0x135')](_0x488f82,{'showHidden':![],'depth':null}));}};Preview[_0x834e('0x10')][_0x834e('0x22')]=function(_0x57714a){if(_0x57714a){if(this['actions'][_0x57714a['transfertargetlinkedid']]){this['actions'][_0x57714a[_0x834e('0x136')]][_0x834e('0x137')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x20d61c){if(_0x20d61c){if(this[_0x834e('0x43')][_0x20d61c[_0x834e('0x138')]]){this['actions'][_0x20d61c[_0x834e('0x138')]][_0x834e('0x137')]=!![];}}};module[_0x834e('0x139')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 65acaea..055ee5c 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 _0x2142=['endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','resolve','then','[getContactPreview]\x20','createCustomerFinal','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x2142,0x154));var _0x2214=function(_0x1e55c1,_0x5a6030){_0x1e55c1=_0x1e55c1-0x0;var _0x2549e4=_0x2142[_0x1e55c1];return _0x2549e4;};'use strict';var util=require(_0x2214('0x0'));var BPromise=require('bluebird');var logger=require(_0x2214('0x1'))(_0x2214('0x2'));var cmHopper=require(_0x2214('0x3'));var cmHopperHistory=require(_0x2214('0x4'));var cmHopperBlack=require(_0x2214('0x5'));var agentReportPreview=require(_0x2214('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x113d70){return function(_0x2f2633){logger[_0x2214('0x7')](_0x113d70,util[_0x2214('0x8')](_0x2f2633,{'showHidden':![],'depth':null}));};}function create(_0x31811b){return cmHopperHistory[_0x2214('0x9')](_0x31811b)[_0x2214('0xa')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x5c5bbb){return BPromise['resolve']()['then'](agentReportPreview[_0x2214('0x9')](_0x5c5bbb))[_0x2214('0xa')](loggerCatch(_0x2214('0xb')));}function moveContact(_0xde1c1a){return cmHopper[_0x2214('0xc')](_0xde1c1a,!![])[_0x2214('0xa')](loggerCatch(_0x2214('0xd')));}exports[_0x2214('0xe')]=function(_0x14a729){return cmHopperBlack[_0x2214('0xe')](_0x14a729)[_0x2214('0xa')](loggerCatch(_0x2214('0xf')));};exports[_0x2214('0x10')]=function(_0x3ed154){return BPromise[_0x2214('0x11')]()[_0x2214('0x12')](cmHopper[_0x2214('0x10')](_0x3ed154))[_0x2214('0xa')](loggerCatch(_0x2214('0x13')));};exports[_0x2214('0x9')]=function(_0x2bcc7c,_0x107f78){create(_0x2bcc7c)[_0x2214('0xa')](loggerCatch(_0x107f78));moveContact(_0x2bcc7c)[_0x2214('0xa')](loggerCatch(_0x107f78));};exports['createAgentHistory']=function(_0x274105,_0x18f7d2){createAgent(_0x274105)[_0x2214('0xa')](loggerCatch(_0x18f7d2));};exports['createCustomerHistory']=function(_0x34e099,_0x508c8a){create(_0x34e099)['catch'](loggerCatch(_0x508c8a));};exports[_0x2214('0x14')]=function(_0x4d9399,_0x45c807){moveContact(_0x4d9399)[_0x2214('0xa')](loggerCatch(_0x45c807));};exports['rescheduleContact']=function(_0x4f7727,_0x559d64,_0x2bccf9){if(_0x559d64){_0x4f7727['UserId']=null;}if(_0x2bccf9){_0x4f7727[_0x2214('0x15')]=![];}return cmHopper[_0x2214('0x16')](_0x4f7727)['catch'](loggerCatch(_0x2214('0x17')));};exports[_0x2214('0x18')]=function(_0x1db02b){return cmHopper['countReScheduled'](_0x1db02b)[_0x2214('0xa')](loggerCatch('[countReScheduled]\x20'));};exports[_0x2214('0x19')]=function(_0x10a208){return cmHopper['unlockContact']({'UserId':null},_0x10a208,0x1)[_0x2214('0xa')](loggerCatch('[unlockContact]\x20'));};exports[_0x2214('0x1a')]=function(_0x5181d7){return cmHopper['unlockContact']({'active':![]},_0x5181d7,0x1)['catch'](loggerCatch(_0x2214('0x1b')));};exports[_0x2214('0x1c')]=function(_0x34f943){var _0x22f977={};_0x22f977['type']=_0x34f943[_0x2214('0x1d')];_0x22f977[_0x2214('0x1e')]=_0x34f943['uniqueid'];_0x22f977[_0x2214('0x1f')]=_0x34f943[_0x2214('0x1f')];_0x22f977[_0x2214('0x20')]=_0x34f943[_0x2214('0x20')];_0x22f977[_0x2214('0x21')]=_0x34f943[_0x2214('0x21')];_0x22f977[_0x2214('0x22')]=_0x34f943[_0x2214('0x23')];_0x22f977[_0x2214('0x24')]=_0x34f943[_0x2214('0x23')];_0x22f977['queuecallercomplete']=0x1;_0x22f977[_0x2214('0x25')]=_0x34f943[_0x2214('0x26')];_0x22f977[_0x2214('0x27')]=_0x34f943[_0x2214('0x28')];_0x22f977[_0x2214('0x29')]=_0x2214('0x2a');_0x22f977[_0x2214('0x2b')]=_0x2214('0x2c');_0x22f977[_0x2214('0x2d')]=0x0;_0x22f977[_0x2214('0x2e')]=0x1;_0x22f977[_0x2214('0x2f')]=_0x34f943[_0x2214('0x28')];_0x22f977[_0x2214('0x30')]=_0x2214('0x31');return BPromise[_0x2214('0x11')]()[_0x2214('0x12')](voiceQueueReport[_0x2214('0x32')](_0x22f977))['catch'](loggerCatch(_0x2214('0x33')));};exports[_0x2214('0x34')]=function(_0x2da8c3,_0x65168f){return BPromise['resolve']()[_0x2214('0x12')](cmHopper[_0x2214('0x34')](_0x2da8c3,_0x65168f))[_0x2214('0xa')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x5d6427){return cmHopper[_0x2214('0x16')](_0x5d6427,!![],!![])['catch'](loggerCatch(_0x2214('0x35')));}; \ No newline at end of file +var _0x2ac7=['uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','context','exten','xcally-motion-preview','lastAssignedTo','membername','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','resolve','createAgentHistory','rescheduleContact','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type'];(function(_0xfc2edb,_0x27d74f){var _0x42814a=function(_0x84afa0){while(--_0x84afa0){_0xfc2edb['push'](_0xfc2edb['shift']());}};_0x42814a(++_0x27d74f);}(_0x2ac7,0xd8));var _0x72ac=function(_0x1982c5,_0xdf080c){_0x1982c5=_0x1982c5-0x0;var _0xdadbeb=_0x2ac7[_0x1982c5];return _0xdadbeb;};'use strict';var util=require(_0x72ac('0x0'));var BPromise=require('bluebird');var logger=require(_0x72ac('0x1'))(_0x72ac('0x2'));var cmHopper=require(_0x72ac('0x3'));var cmHopperHistory=require(_0x72ac('0x4'));var cmHopperBlack=require(_0x72ac('0x5'));var agentReportPreview=require(_0x72ac('0x6'));var voiceQueueReport=require(_0x72ac('0x7'));function loggerCatch(_0x2bb9be){return function(_0x2160c1){logger[_0x72ac('0x8')](_0x2bb9be,util[_0x72ac('0x9')](_0x2160c1,{'showHidden':![],'depth':null}));};}function create(_0x519fb0){return cmHopperHistory[_0x72ac('0xa')](_0x519fb0)[_0x72ac('0xb')](loggerCatch(_0x72ac('0xc')));}function createAgent(_0x335f8b){return BPromise['resolve']()[_0x72ac('0xd')](agentReportPreview[_0x72ac('0xa')](_0x335f8b))[_0x72ac('0xb')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x5f1cc4){return cmHopper[_0x72ac('0xe')](_0x5f1cc4,!![])[_0x72ac('0xb')](loggerCatch(_0x72ac('0xf')));}exports[_0x72ac('0x10')]=function(_0x4e5ea3){return cmHopperBlack[_0x72ac('0x10')](_0x4e5ea3)[_0x72ac('0xb')](loggerCatch(_0x72ac('0x11')));};exports[_0x72ac('0x12')]=function(_0x5da87b){return BPromise[_0x72ac('0x13')]()[_0x72ac('0xd')](cmHopper[_0x72ac('0x12')](_0x5da87b))[_0x72ac('0xb')](loggerCatch('[getContactPreview]\x20'));};exports[_0x72ac('0xa')]=function(_0x5c8d8b,_0x182fa7){create(_0x5c8d8b)[_0x72ac('0xb')](loggerCatch(_0x182fa7));moveContact(_0x5c8d8b)[_0x72ac('0xb')](loggerCatch(_0x182fa7));};exports[_0x72ac('0x14')]=function(_0x2878c6,_0x1b631d){createAgent(_0x2878c6)[_0x72ac('0xb')](loggerCatch(_0x1b631d));};exports['createCustomerHistory']=function(_0x3f479a,_0x3458f9){create(_0x3f479a)['catch'](loggerCatch(_0x3458f9));};exports['createCustomerFinal']=function(_0x18d818,_0x461f48){moveContact(_0x18d818)['catch'](loggerCatch(_0x461f48));};exports[_0x72ac('0x15')]=function(_0x426918,_0x4f9af2,_0x53fbda){if(_0x4f9af2){_0x426918['UserId']=null;}if(_0x53fbda){_0x426918['active']=![];}return cmHopper[_0x72ac('0x15')](_0x426918)[_0x72ac('0xb')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x72ac('0x16')]=function(_0x1a4374){return cmHopper[_0x72ac('0x16')](_0x1a4374)[_0x72ac('0xb')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x56e318){return cmHopper[_0x72ac('0x17')]({'UserId':null},_0x56e318,0x1)[_0x72ac('0xb')](loggerCatch(_0x72ac('0x18')));};exports[_0x72ac('0x19')]=function(_0x4e9a0d){return cmHopper[_0x72ac('0x17')]({'active':![]},_0x4e9a0d,0x1)[_0x72ac('0xb')](loggerCatch(_0x72ac('0x1a')));};exports[_0x72ac('0x1b')]=function(_0x24c7d7){var _0x416103={};_0x416103[_0x72ac('0x1c')]=_0x24c7d7[_0x72ac('0x1c')];_0x416103['uniqueid']=_0x24c7d7[_0x72ac('0x1d')];_0x416103[_0x72ac('0x1e')]=_0x24c7d7[_0x72ac('0x1e')];_0x416103[_0x72ac('0x1f')]=_0x24c7d7[_0x72ac('0x1f')];_0x416103[_0x72ac('0x20')]=_0x24c7d7[_0x72ac('0x20')];_0x416103[_0x72ac('0x21')]=_0x24c7d7['answertime'];_0x416103[_0x72ac('0x22')]=_0x24c7d7[_0x72ac('0x23')];_0x416103[_0x72ac('0x24')]=0x1;_0x416103[_0x72ac('0x25')]=_0x24c7d7['endtime'];_0x416103[_0x72ac('0x26')]=_0x24c7d7['membername'];_0x416103[_0x72ac('0x27')]='from-sip';_0x416103[_0x72ac('0x28')]=_0x72ac('0x29');_0x416103['holdtime']=0x0;_0x416103['assigned']=0x1;_0x416103[_0x72ac('0x2a')]=_0x24c7d7[_0x72ac('0x2b')];_0x416103['queuecallerexitreason']=_0x72ac('0x2c');return BPromise[_0x72ac('0x13')]()[_0x72ac('0xd')](voiceQueueReport['create'](_0x416103))[_0x72ac('0xb')](loggerCatch(_0x72ac('0x2d')));};exports['getContactRecallMe']=function(_0xf83b9f,_0x58a557){return BPromise['resolve']()[_0x72ac('0xd')](cmHopper[_0x72ac('0x2e')](_0xf83b9f,_0x58a557))[_0x72ac('0xb')](loggerCatch(_0x72ac('0x2f')));};exports[_0x72ac('0x30')]=function(_0x29e09a){return cmHopper['rescheduleContact'](_0x29e09a,!![],!![])[_0x72ac('0xb')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ 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 4449fc9..38e5708 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 _0x76f5=['moment','../../../../config/logger','env','loggerCatch','inspect','info','loggerError','error','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','isActive','Queue','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','endtime','logAgent','state','responsetime','ringtime','logLookAgent','membername','logCustomer','getSeconds','talktime','answertime','isFailure','Failure','RECALL','calleridname','BOOKED','uniqueid','originate','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','channelAgent','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','scheduledat','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','noanswer','keys','variables','forEach','toLowerCase','util','lodash'];(function(_0x2c112a,_0x5815d4){var _0x5d22db=function(_0x3a2ea2){while(--_0x3a2ea2){_0x2c112a['push'](_0x2c112a['shift']());}};_0x5d22db(++_0x5815d4);}(_0x76f5,0x97));var _0x576f=function(_0x192f16,_0x454664){_0x192f16=_0x192f16-0x0;var _0x5b6b0b=_0x76f5[_0x192f16];return _0x5b6b0b;};'use strict';var util=require(_0x576f('0x0'));var _=require(_0x576f('0x1'));var moment=require(_0x576f('0x2'));var logger=require(_0x576f('0x3'))('preview');var ipAgi=process[_0x576f('0x4')]['XCALLY_IP_AGI']||'127.0.0.1';var utils=require('../../dialer/utils');exports[_0x576f('0x5')]=function(_0x281f2a){return function(_0x5547ad){logger['error'](_0x281f2a,util[_0x576f('0x6')](_0x5547ad,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x489ef7,_0x32cf7a){logger[_0x576f('0x7')](_0x489ef7,util['inspect'](_0x32cf7a,{'showHidden':![],'depth':null}));};exports[_0x576f('0x8')]=function(_0x556856,_0x1ba685){logger[_0x576f('0x9')](_0x556856,util[_0x576f('0x6')](_0x1ba685,{'showHidden':![],'depth':null}));};exports[_0x576f('0xa')]=function(_0x5e17df){return function(_0x1371ad){logger[_0x576f('0x7')](_0x5e17df,util[_0x576f('0x6')](_0x1371ad,{'showHidden':![],'depth':null}));};};exports[_0x576f('0xb')]=function(_0x1e01a4,_0x4ed9f,_0xbc2516){return{'message':_0x1e01a4,'unlock':_0x4ed9f,'active':_0xbc2516};};exports[_0x576f('0xc')]=function(_0xd9398b,_0x41c475,_0x1f7f02){if(!_[_0x576f('0xd')](_0x1f7f02)&&_0x576f('0xe')===typeof _0x1f7f02&&!_['isEmpty'](_0x1f7f02)){if(!_[_0x576f('0xd')](_0x41c475)&&_0x576f('0xe')===typeof _0x41c475&&!_[_0x576f('0xf')](_0x41c475)){return util['format'](_0x576f('0x10'),_0x41c475,_0x1f7f02);}return util[_0x576f('0x11')](_0x576f('0x10'),_0x1f7f02,_0x1f7f02);}if(!_['isUndefined'](_0xd9398b)&&_0x576f('0xe')===typeof _0xd9398b&&!_[_0x576f('0xf')](_0xd9398b)){return _0xd9398b;}return'\x22\x22\x20<>';};exports[_0x576f('0x12')]=function(_0xe51263){if(_['isNil'](_0xe51263)){return![];}return _0xe51263;};exports['addVariables']=function(_0x1c59d6,_0x431549,_0x44f551,_0x25ec24,_0x1effe7,_0x2ba79e){var _0x2ce909={'XMD-QUEUE':_0x431549[_0x576f('0x13')]?_0x431549['Queue']['name']:'','XMD-CALLERID':_0x25ec24,'XMD-CALLERID-PREVIEW':_0x2ba79e?util['format'](_0x576f('0x10'),_0x2ba79e['calleridname'],_0x2ba79e[_0x576f('0x14')]):_0x25ec24,'XMD-DIALID':_0x1effe7,'XMD-CONTACTID':_0x431549[_0x576f('0x15')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x25ec24,'XMD-VOICEQUEUEID':_0x431549[_0x576f('0x16')],'XMD-DIALCHANNEL':_0x44f551,'XMD-DIALTIMEOUT':_0x1c59d6[_0x576f('0x17')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x1c59d6[_0x576f('0x18')]?'g':'',_[_0x576f('0xf')](_0x1c59d6[_0x576f('0x19')])?'':_0x576f('0x1a')),'XMD-DIALURL':_0x1c59d6['dialPreviewUrl']||'','XMD-AGI':_0x1c59d6[_0x576f('0x1b')]?util['format'](_0x576f('0x1c'),ipAgi,_0x1c59d6[_0x576f('0x1b')]):_0x576f('0x1d'),'XMD-AGIAFTER':_0x1c59d6['dialQueueProject2']?util[_0x576f('0x11')](_0x576f('0x1c'),ipAgi,_0x1c59d6['dialQueueProject2']):_0x576f('0x1d'),'XMD-ORIGINATECALLERIDNUM':_0x2ba79e?_0x2ba79e[_0x576f('0x1e')]:'','XMD-ORIGINATECALLERIDNAME':_0x2ba79e?_0x2ba79e[_0x576f('0x1f')]:'','XMD-DESTINATION':_0x576f('0x20'),'SIPADDHEADER':_0x576f('0x21')};if(!_[_0x576f('0xf')](_0x1c59d6['monitor_format'])){_0x2ce909[util['format']('%s',_0x576f('0x22'))]=_0x1c59d6[_0x576f('0x19')];_0x2ce909[util[_0x576f('0x11')]('%s',_0x576f('0x23'))]=_0x1effe7;}if(_0x431549&&_0x431549['Contact']){for(var _0x5371e8 in _0x431549['Contact']){if(_0x431549[_0x576f('0x24')][_0x576f('0x25')](_0x5371e8)){if(!_['isNil'](_0x431549[_0x576f('0x24')][_0x5371e8])&&_0x5371e8!=='id'&&_0x5371e8!=='tags'&&_0x5371e8!==_0x576f('0x26')&&_0x5371e8!==_0x576f('0x27')){_0x2ce909[util[_0x576f('0x11')](_0x576f('0x28'),_0x576f('0x29'),_[_0x576f('0x2a')](_0x5371e8))]=_0x431549[_0x576f('0x24')][_0x5371e8];}}}}return _0x2ce909;};exports['toLowerVariables']=function(_0x4b822f){var _0x2dce58={};for(var _0x56f04f in _0x4b822f){if(_0x4b822f['hasOwnProperty'](_0x56f04f)){_0x2dce58[util[_0x576f('0x11')]('%s',_[_0x576f('0x2b')](_0x56f04f))]=_0x4b822f[_0x56f04f];}}return{'variables':_0x2dce58};};exports[_0x576f('0x2c')]=function(_0x583186,_0x5d42c3){if(!_[_0x576f('0x2d')](_0x583186)){if(_0x583186[_0x576f('0x25')](_0x576f('0x2e'))){if(_0x583186['originated']>0x0){_0x583186['originated']-=0x1;}else{logger[_0x576f('0x9')](_0x576f('0x2f'),_0x5d42c3);}}}else{logger[_0x576f('0x9')](_0x576f('0x30'),_0x5d42c3);}};exports[_0x576f('0x31')]=function(_0x27769f){var _0xaabaa5=moment()[_0x576f('0x11')](_0x576f('0x32'));_0x27769f['state']=0xd;_0x27769f[_0x576f('0x33')]=_0x576f('0x34');_0x27769f[_0x576f('0x35')]=_0xaabaa5;_0x27769f['responsetime']=_0xaabaa5;_0x27769f[_0x576f('0x36')]=_0xaabaa5;};exports[_0x576f('0x37')]=function(_0x141323,_0x455806,_0x40b44c){var _0x18000e=moment()['format'](_0x576f('0x32'));_0x141323[_0x576f('0x38')]=_0x455806;_0x141323[_0x576f('0x33')]=_0x40b44c;_0x141323[_0x576f('0x39')]=_0x18000e;_0x141323[_0x576f('0x3a')]=utils['getSeconds'](_0x141323[_0x576f('0x39')],_0x141323['starttime']);};exports[_0x576f('0x3b')]=function(_0x293e7c,_0x85d6f5,_0x1f13c1){_0x293e7c[_0x576f('0x3c')]=_0x85d6f5;_0x293e7c['UserId']=_0x1f13c1;};exports[_0x576f('0x3d')]=function(_0x14c381,_0x18e792,_0x3faab8){var _0x18616d=moment()[_0x576f('0x11')](_0x576f('0x32'));_0x14c381['state']=_0x18e792;_0x14c381['statedesc']=_0x3faab8;_0x14c381[_0x576f('0x39')]=_0x14c381[_0x576f('0x39')]?_0x14c381['responsetime']:_0x18616d;_0x14c381[_0x576f('0x36')]=_0x14c381[_0x576f('0x36')]?_0x14c381['endtime']:_0x18616d;_0x14c381[_0x576f('0x3a')]=utils[_0x576f('0x3e')](_0x14c381['responsetime']||0x0,_0x14c381['starttime']||0x0);_0x14c381[_0x576f('0x3f')]=_0x14c381[_0x576f('0x40')]?utils['getSeconds'](_0x14c381[_0x576f('0x36')],_0x14c381[_0x576f('0x40')]):0x0;};exports[_0x576f('0x41')]=function(_0x46f5c4){return _0x46f5c4===_0x576f('0x42');};exports['variablesAction']=function(_0x361377,_0x44cc77,_0x2a959c,_0x422d1f,_0x327397){var _0x3ad0ff=_0x422d1f?_0x576f('0x43'):_0x361377[_0x576f('0x44')];_0x3ad0ff=_0x327397?_0x576f('0x45'):_0x3ad0ff;return{'actionid':_0x361377[_0x576f('0x46')],'action':_0x576f('0x47'),'channel':_0x361377['channelAgent'],'callerid':util[_0x576f('0x11')]('\x22%s\x22\x20<%s>',_0x3ad0ff,_0x361377[_0x576f('0x14')]),'Exten':'xcally-motion-preview','Context':_0x576f('0x48'),'Priority':'1','variable':_0x2a959c,'timeout':(_0x44cc77[_0x576f('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x361377[_0x576f('0x46')]};};exports['totalGlobal']=function(_0x3e4bcd){return _0x3e4bcd[_0x576f('0x4a')]+_0x3e4bcd[_0x576f('0x4b')]+_0x3e4bcd[_0x576f('0x4c')]+_0x3e4bcd[_0x576f('0x4d')]+_0x3e4bcd['countnosuchnumberretry'];};exports[_0x576f('0x4e')]=function(_0x195baf){var _0x427e4d=_[_0x576f('0x4f')](_0x195baf);_0x427e4d['state']=0xf;_0x427e4d[_0x576f('0x33')]='Global';return _0x427e4d;};exports[_0x576f('0x50')]=function(_0x2f2453,_0x370725,_0x4ee663){var _0x493c62={};_0x493c62[_0x370725]=_0x2f2453[_0x370725];_0x493c62[_0x576f('0x51')]=![];_0x493c62['scheduledat']=moment()[_0x576f('0x52')](_0x4ee663,_0x576f('0x53'))[_0x576f('0x11')](_0x576f('0x32'));_0x493c62[_0x576f('0x15')]=_0x2f2453['ContactId'];_0x493c62[_0x576f('0x54')]=_0x2f2453[_0x576f('0x54')];_0x493c62[_0x576f('0x16')]=_0x2f2453[_0x576f('0x16')]||undefined;return _0x493c62;};exports[_0x576f('0x55')]=function(_0x3d655f,_0x3fafdf){if(!_[_0x576f('0x2d')](_0x3d655f)){if(_0x3d655f['pTalking']>0x0){_0x3d655f[_0x576f('0x56')]-=0x1;}else{logger[_0x576f('0x9')](_0x3fafdf,_0x576f('0x57'));}}else{logger[_0x576f('0x9')](_0x3fafdf,_0x576f('0x58'));}};exports['IsNotLoggedIn']=function(_0x535a74){if(_0x535a74<=0x0){return!![];}return![];};function buildObj(_0x2a182d,_0x241c23,_0x17ae0b){_0x2a182d[_0x576f('0x59')]=_0x241c23;_0x2a182d['name']=_0x2a182d[_0x576f('0x5a')];_0x2a182d[_0x576f('0x5b')]=_0x2a182d[_0x576f('0x5c')];_0x2a182d[_0x576f('0x5d')]=_0x576f('0x5e');if(_0x17ae0b){_0x2a182d[_0x576f('0x5f')]=_0x17ae0b[_0x576f('0x5f')];}return _0x2a182d;}exports[_0x576f('0x60')]=buildObj;exports[_0x576f('0x61')]=function(_0x2a87f3){var _0x1999f4={};_0x1999f4[_0x576f('0x5a')]=_0x2a87f3['queue'];_0x1999f4['interface']=_0x2a87f3[_0x576f('0x5c')];_0x1999f4[_0x576f('0x46')]=_0x2a87f3['uniqueid'];return _0x1999f4;};exports[_0x576f('0x62')]=function(_0x574f5f){var _0x3d400c=[];for(var _0x2ab938 in _0x574f5f){if(_0x574f5f[_0x576f('0x25')](_0x2ab938)){if(!_[_0x576f('0x2d')](_0x574f5f[_0x2ab938])&&_0x574f5f[_0x2ab938][_0x576f('0x38')]===_0x576f('0x63')&&_0x574f5f[_0x2ab938][_0x576f('0x64')]===_0x576f('0x65')){_0x3d400c[_0x576f('0x66')](_0x574f5f[_0x2ab938]['id']);}}}return _0x3d400c;};exports[_0x576f('0x67')]=function(_0x3ed11d){var _0x15ab67=moment()[_0x576f('0x68')](0x0);var _0xcdb906=moment(_0x3ed11d)[_0x576f('0x68')](0x0);return _0x15ab67[_0x576f('0x69')](_0xcdb906,_0x576f('0x6a'));};exports[_0x576f('0x6b')]=function(_0x459471){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x459471[_0x576f('0x15')],'ListId':_0x459471['ListId'],'VoiceQueueId':_0x459471[_0x576f('0x16')]||undefined,'CampaignId':_0x459471[_0x576f('0x6c')]||undefined};};exports[_0x576f('0x6d')]=function(_0x15ae2e){if(_0x15ae2e===_0x576f('0x46')||_0x15ae2e===_0x576f('0x6e')||_0x15ae2e===_0x576f('0x5a')||_0x15ae2e===_0x576f('0x6f')||_0x15ae2e===_0x576f('0x70')||_0x15ae2e===_0x576f('0x71')||_0x15ae2e===_0x576f('0x3c')||_0x15ae2e==='channelAgent'||_0x15ae2e==='calleridname'||_0x15ae2e===_0x576f('0x51')||_0x15ae2e==='calleridnum'||_0x15ae2e===_0x576f('0x72')||_0x15ae2e==='countbusyretry'||_0x15ae2e==='countcongestionretry'||_0x15ae2e==='countnoanswerretry'||_0x15ae2e===_0x576f('0x73')||_0x15ae2e===_0x576f('0x74')||_0x15ae2e===_0x576f('0x75')||_0x15ae2e===_0x576f('0x76')||_0x15ae2e===_0x576f('0x77')||_0x15ae2e===_0x576f('0x15')||_0x15ae2e===_0x576f('0x54')||_0x15ae2e===_0x576f('0x78')||_0x15ae2e===_0x576f('0x16')||_0x15ae2e===_0x576f('0x79')||_0x15ae2e===_0x576f('0x7a')||_0x15ae2e==='xmd-queue'||_0x15ae2e===_0x576f('0x7b')||_0x15ae2e===_0x576f('0x7c')||_0x15ae2e===_0x576f('0x7d')||_0x15ae2e==='xmd-dialtimeout'||_0x15ae2e===_0x576f('0x7e')||_0x15ae2e==='xmd-dialid'||_0x15ae2e===_0x576f('0x7f')||_0x15ae2e===_0x576f('0x80')||_0x15ae2e==='xmd-cdrtype'||_0x15ae2e===_0x576f('0x81')||_0x15ae2e===_0x576f('0x82')||_0x15ae2e===_0x576f('0x83')||_0x15ae2e==='rtpaudioqos'||_0x15ae2e===_0x576f('0x84')||_0x15ae2e===_0x576f('0x85')||_0x15ae2e===_0x576f('0x86')||_0x15ae2e===_0x576f('0x87')||_0x15ae2e===_0x576f('0x88')||_0x15ae2e===_0x576f('0x89')||_0x15ae2e===_0x576f('0x8a')||_0x15ae2e===_0x576f('0x8b')||_0x15ae2e==='rtpaudioqosbridged'||_0x15ae2e===_0x576f('0x85')||_0x15ae2e===_0x576f('0x86')||_0x15ae2e===_0x576f('0x87')||_0x15ae2e===_0x576f('0x88')||_0x15ae2e==='rtpaudioqosrtt'||_0x15ae2e===_0x576f('0x8a')||_0x15ae2e==='bridgepeer'||_0x15ae2e===_0x576f('0x8c')||_0x15ae2e===_0x576f('0x38')||_0x15ae2e===_0x576f('0x33')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x1a58a1,_0x32d334){var _0x3b142b,_0x52877a,_0x2ddbba;if(_0x32d334<=0x0){_0x32d334=0x1;}_0x3b142b=new RegExp(_0x576f('0x8d')+_0x32d334+'}$');_0x52877a=Math[_0x576f('0x8e')](0xa,_0x32d334-0x1);_0x2ddbba=Math['pow'](0xa,_0x32d334)-0x1;return util['format']('%s',_[_0x576f('0x8f')](_0x1a58a1,_0x3b142b,_[_0x576f('0x90')](_0x52877a,_0x2ddbba)));};exports[_0x576f('0x91')]=function(_0x332d32){var _0x3ea5c2=_0x332d32['match'](/"(.*?)"/);return _0x3ea5c2?_0x3ea5c2[0x1]:_0x332d32;};exports[_0x576f('0x92')]=function(_0x3f73d1){var _0x430d2d=_0x3f73d1[_0x576f('0x93')](/<(.*?)>/);return _0x430d2d?_0x430d2d[0x1]:_0x3f73d1;};function buildNoAnswerEventPayload(_0x37035f,_0x47cf97){var _0x338e37=buildObj(_0x37035f,_0x576f('0x94'));if(!_[_0x576f('0xf')](_0x47cf97['variables'])){Object[_0x576f('0x95')](_0x47cf97[_0x576f('0x96')])[_0x576f('0x97')](function(_0x30f903){_0x338e37[_0x30f903[_0x576f('0x98')]()]=_0x47cf97[_0x576f('0x96')][_0x30f903];});}return _0x338e37;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0x4c09=['decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','name','interface','voice','mandatoryDisposition','buildObj','buildAcw','queue','agentReadyId','not_inuse','push','getDiff','milliseconds','seconds','idContact','type','active','countnoanswerretry','callback','callbackuniqueid','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosloss','rtpaudioqosrtt','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','match','extractCalleridNumber','noanswer','variables','keys','buildNoAnswerEventPayload','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','logger','info','loggerError','logger2','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','endtime','responsetime','ringtime','getSeconds','membername','UserId','logCustomer','statedesc','talktime','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','minutes','ListId'];(function(_0x5ab81f,_0x3a511d){var _0x2b1765=function(_0x19992b){while(--_0x19992b){_0x5ab81f['push'](_0x5ab81f['shift']());}};_0x2b1765(++_0x3a511d);}(_0x4c09,0xc3));var _0x94c0=function(_0x1040c8,_0x1baa50){_0x1040c8=_0x1040c8-0x0;var _0x5d0df0=_0x4c09[_0x1040c8];return _0x5d0df0;};'use strict';var util=require('util');var _=require(_0x94c0('0x0'));var moment=require(_0x94c0('0x1'));var logger=require(_0x94c0('0x2'))(_0x94c0('0x3'));var ipAgi=process['env'][_0x94c0('0x4')]||_0x94c0('0x5');var utils=require(_0x94c0('0x6'));exports[_0x94c0('0x7')]=function(_0x5ce996){return function(_0x5e16a5){logger[_0x94c0('0x8')](_0x5ce996,util['inspect'](_0x5e16a5,{'showHidden':![],'depth':null}));};};exports[_0x94c0('0x9')]=function(_0x25da3e,_0x3ee4a1){logger[_0x94c0('0xa')](_0x25da3e,util['inspect'](_0x3ee4a1,{'showHidden':![],'depth':null}));};exports[_0x94c0('0xb')]=function(_0x2e3f6f,_0x298694){logger[_0x94c0('0x8')](_0x2e3f6f,util['inspect'](_0x298694,{'showHidden':![],'depth':null}));};exports[_0x94c0('0xc')]=function(_0x14555f){return function(_0x49ef00){logger[_0x94c0('0xa')](_0x14555f,util['inspect'](_0x49ef00,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x11394a,_0x146b2e,_0x14990f){return{'message':_0x11394a,'unlock':_0x146b2e,'active':_0x14990f};};exports['getCallerId']=function(_0x256952,_0x1315c5,_0x325d0c){if(!_['isUndefined'](_0x325d0c)&&'string'===typeof _0x325d0c&&!_[_0x94c0('0xd')](_0x325d0c)){if(!_[_0x94c0('0xe')](_0x1315c5)&&'string'===typeof _0x1315c5&&!_[_0x94c0('0xd')](_0x1315c5)){return util[_0x94c0('0xf')]('\x22%s\x22\x20<%s>',_0x1315c5,_0x325d0c);}return util[_0x94c0('0xf')](_0x94c0('0x10'),_0x325d0c,_0x325d0c);}if(!_[_0x94c0('0xe')](_0x256952)&&_0x94c0('0x11')===typeof _0x256952&&!_[_0x94c0('0xd')](_0x256952)){return _0x256952;}return _0x94c0('0x12');};exports[_0x94c0('0x13')]=function(_0x4c389c){if(_[_0x94c0('0x14')](_0x4c389c)){return![];}return _0x4c389c;};exports[_0x94c0('0x15')]=function(_0x114a20,_0x3d2454,_0x16f846,_0x294663,_0x5057d8,_0x3b5c45){var _0x1d55fb={'XMD-QUEUE':_0x3d2454[_0x94c0('0x16')]?_0x3d2454[_0x94c0('0x16')]['name']:'','XMD-CALLERID':_0x294663,'XMD-CALLERID-PREVIEW':_0x3b5c45?util[_0x94c0('0xf')](_0x94c0('0x10'),_0x3b5c45[_0x94c0('0x17')],_0x3b5c45[_0x94c0('0x18')]):_0x294663,'XMD-DIALID':_0x5057d8,'XMD-CONTACTID':_0x3d2454[_0x94c0('0x19')],'XMD-CDRTYPE':_0x94c0('0x1a'),'CALLERID(all)':_0x294663,'XMD-VOICEQUEUEID':_0x3d2454[_0x94c0('0x1b')],'XMD-DIALCHANNEL':_0x16f846,'XMD-DIALTIMEOUT':_0x114a20[_0x94c0('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x94c0('0xf')](_0x94c0('0x1d'),_0x114a20[_0x94c0('0x1e')]?'g':'',_['isEmpty'](_0x114a20[_0x94c0('0x1f')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x114a20[_0x94c0('0x20')]||'','XMD-AGI':_0x114a20[_0x94c0('0x21')]?util[_0x94c0('0xf')](_0x94c0('0x22'),ipAgi,_0x114a20[_0x94c0('0x21')]):_0x94c0('0x23'),'XMD-AGIAFTER':_0x114a20[_0x94c0('0x1e')]?util[_0x94c0('0xf')]('\x22agi://%s/square,%s\x22',ipAgi,_0x114a20[_0x94c0('0x1e')]):_0x94c0('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x3b5c45?_0x3b5c45['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x3b5c45?_0x3b5c45[_0x94c0('0x24')]:'','XMD-DESTINATION':_0x94c0('0x25'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x114a20['monitor_format'])){_0x1d55fb[util['format']('%s',_0x94c0('0x26'))]=_0x114a20[_0x94c0('0x1f')];_0x1d55fb[util[_0x94c0('0xf')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x5057d8;}if(_0x3d2454&&_0x3d2454['Contact']){for(var _0x1e51df in _0x3d2454[_0x94c0('0x27')]){if(_0x3d2454['Contact'][_0x94c0('0x28')](_0x1e51df)){if(!_['isNil'](_0x3d2454['Contact'][_0x1e51df])&&_0x1e51df!=='id'&&_0x1e51df!==_0x94c0('0x29')&&_0x1e51df!=='createdAt'&&_0x1e51df!==_0x94c0('0x2a')){_0x1d55fb[util['format'](_0x94c0('0x2b'),_0x94c0('0x2c'),_[_0x94c0('0x2d')](_0x1e51df))]=_0x3d2454[_0x94c0('0x27')][_0x1e51df];}}}}return _0x1d55fb;};exports['toLowerVariables']=function(_0x25881a){var _0x588d12={};for(var _0x4a71a2 in _0x25881a){if(_0x25881a[_0x94c0('0x28')](_0x4a71a2)){_0x588d12[util[_0x94c0('0xf')]('%s',_[_0x94c0('0x2e')](_0x4a71a2))]=_0x25881a[_0x4a71a2];}}return{'variables':_0x588d12};};exports['updateOriginated']=function(_0x4ca07c,_0xf05df){if(!_[_0x94c0('0x14')](_0x4ca07c)){if(_0x4ca07c[_0x94c0('0x28')]('originated')){if(_0x4ca07c[_0x94c0('0x2f')]>0x0){_0x4ca07c[_0x94c0('0x2f')]-=0x1;}else{logger[_0x94c0('0x8')](_0x94c0('0x30'),_0xf05df);}}}else{logger['error'](_0x94c0('0x31'),_0xf05df);}};exports[_0x94c0('0x32')]=function(_0x598936){var _0x448b7e=moment()[_0x94c0('0xf')](_0x94c0('0x33'));_0x598936[_0x94c0('0x34')]=0xd;_0x598936['statedesc']=_0x94c0('0x35');_0x598936[_0x94c0('0x36')]=_0x448b7e;_0x598936['responsetime']=_0x448b7e;_0x598936[_0x94c0('0x37')]=_0x448b7e;};exports['logAgent']=function(_0x24c651,_0x3ccf10,_0x4260df){var _0x35b6d0=moment()[_0x94c0('0xf')](_0x94c0('0x33'));_0x24c651[_0x94c0('0x34')]=_0x3ccf10;_0x24c651['statedesc']=_0x4260df;_0x24c651[_0x94c0('0x38')]=_0x35b6d0;_0x24c651[_0x94c0('0x39')]=utils[_0x94c0('0x3a')](_0x24c651[_0x94c0('0x38')],_0x24c651[_0x94c0('0x36')]);};exports['logLookAgent']=function(_0x234287,_0x239168,_0x488872){_0x234287[_0x94c0('0x3b')]=_0x239168;_0x234287[_0x94c0('0x3c')]=_0x488872;};exports[_0x94c0('0x3d')]=function(_0x28ed3a,_0x4c3e23,_0x54935f){var _0xf07751=moment()[_0x94c0('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x28ed3a[_0x94c0('0x34')]=_0x4c3e23;_0x28ed3a[_0x94c0('0x3e')]=_0x54935f;_0x28ed3a[_0x94c0('0x38')]=_0x28ed3a[_0x94c0('0x38')]?_0x28ed3a[_0x94c0('0x38')]:_0xf07751;_0x28ed3a['endtime']=_0x28ed3a['endtime']?_0x28ed3a[_0x94c0('0x37')]:_0xf07751;_0x28ed3a[_0x94c0('0x39')]=utils[_0x94c0('0x3a')](_0x28ed3a[_0x94c0('0x38')]||0x0,_0x28ed3a['starttime']||0x0);_0x28ed3a[_0x94c0('0x3f')]=_0x28ed3a['answertime']?utils['getSeconds'](_0x28ed3a[_0x94c0('0x37')],_0x28ed3a[_0x94c0('0x40')]):0x0;};exports[_0x94c0('0x41')]=function(_0x3e6547){return _0x3e6547==='Failure';};exports[_0x94c0('0x42')]=function(_0xaabcbb,_0xf91759,_0x9b42f8,_0x4ac977,_0x32ad8e){var _0x251d53=_0x4ac977?_0x94c0('0x43'):_0xaabcbb['calleridname'];_0x251d53=_0x32ad8e?_0x94c0('0x44'):_0x251d53;return{'actionid':_0xaabcbb[_0x94c0('0x45')],'action':_0x94c0('0x46'),'channel':_0xaabcbb[_0x94c0('0x47')],'callerid':util['format'](_0x94c0('0x10'),_0x251d53,_0xaabcbb['calleridnum']),'Exten':_0x94c0('0x25'),'Context':_0x94c0('0x48'),'Priority':'1','variable':_0x9b42f8,'timeout':(_0xf91759[_0x94c0('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0xaabcbb[_0x94c0('0x45')]};};exports[_0x94c0('0x4a')]=function(_0x474c5b){return _0x474c5b[_0x94c0('0x4b')]+_0x474c5b['countcongestionretry']+_0x474c5b['countnoanswerretry']+_0x474c5b['countagentrejectretry']+_0x474c5b[_0x94c0('0x4c')];};exports[_0x94c0('0x4d')]=function(_0xbe48cd){var _0x31df1c=_[_0x94c0('0x4e')](_0xbe48cd);_0x31df1c['state']=0xf;_0x31df1c[_0x94c0('0x3e')]=_0x94c0('0x4f');return _0x31df1c;};exports[_0x94c0('0x50')]=function(_0xd5712f,_0xd182a8,_0x3397de){var _0x28d56f={};_0x28d56f[_0xd182a8]=_0xd5712f[_0xd182a8];_0x28d56f['active']=![];_0x28d56f[_0x94c0('0x51')]=moment()[_0x94c0('0x52')](_0x3397de,_0x94c0('0x53'))[_0x94c0('0xf')](_0x94c0('0x33'));_0x28d56f[_0x94c0('0x19')]=_0xd5712f[_0x94c0('0x19')];_0x28d56f[_0x94c0('0x54')]=_0xd5712f[_0x94c0('0x54')];_0x28d56f[_0x94c0('0x1b')]=_0xd5712f[_0x94c0('0x1b')]||undefined;return _0x28d56f;};exports[_0x94c0('0x55')]=function(_0x4b6c39,_0x4640e4){if(!_[_0x94c0('0x14')](_0x4b6c39)){if(_0x4b6c39[_0x94c0('0x56')]>0x0){_0x4b6c39[_0x94c0('0x56')]-=0x1;}else{logger[_0x94c0('0x8')](_0x4640e4,_0x94c0('0x57'));}}else{logger[_0x94c0('0x8')](_0x4640e4,_0x94c0('0x58'));}};exports[_0x94c0('0x59')]=function(_0x3900a8){if(_0x3900a8<=0x0){return!![];}return![];};function buildObj(_0x249526,_0x1c9793,_0x4a57bd){_0x249526['lastevent']=_0x1c9793;_0x249526[_0x94c0('0x5a')]=_0x249526['queue'];_0x249526[_0x94c0('0x5b')]=_0x249526[_0x94c0('0x47')];_0x249526['motionChannel']=_0x94c0('0x5c');if(_0x4a57bd){_0x249526[_0x94c0('0x5d')]=_0x4a57bd['mandatoryDisposition'];}return _0x249526;}exports[_0x94c0('0x5e')]=buildObj;exports[_0x94c0('0x5f')]=function(_0x3827de){var _0x3994e8={};_0x3994e8[_0x94c0('0x60')]=_0x3827de[_0x94c0('0x60')];_0x3994e8['interface']=_0x3827de[_0x94c0('0x47')];_0x3994e8['uniqueid']=_0x3827de[_0x94c0('0x45')];return _0x3994e8;};exports[_0x94c0('0x61')]=function(_0x12ad3d){var _0x5f4377=[];for(var _0x81c595 in _0x12ad3d){if(_0x12ad3d[_0x94c0('0x28')](_0x81c595)){if(!_['isNil'](_0x12ad3d[_0x81c595])&&_0x12ad3d[_0x81c595][_0x94c0('0x34')]===_0x94c0('0x62')&&_0x12ad3d[_0x81c595]['status']==='reachable'){_0x5f4377[_0x94c0('0x63')](_0x12ad3d[_0x81c595]['id']);}}}return _0x5f4377;};exports[_0x94c0('0x64')]=function(_0x49d86e){var _0x154d63=moment()[_0x94c0('0x65')](0x0);var _0x3c025c=moment(_0x49d86e)['milliseconds'](0x0);return _0x154d63['diff'](_0x3c025c,_0x94c0('0x66'));};exports['createBody']=function(_0x4fa2fb){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4fa2fb[_0x94c0('0x19')],'ListId':_0x4fa2fb[_0x94c0('0x54')],'VoiceQueueId':_0x4fa2fb[_0x94c0('0x1b')]||undefined,'CampaignId':_0x4fa2fb['CampaignId']||undefined};};exports['filterKey']=function(_0x4895bc){if(_0x4895bc===_0x94c0('0x45')||_0x4895bc===_0x94c0('0x67')||_0x4895bc===_0x94c0('0x60')||_0x4895bc===_0x94c0('0x68')||_0x4895bc==='campaigntype'||_0x4895bc==='dialAnswer'||_0x4895bc===_0x94c0('0x3b')||_0x4895bc===_0x94c0('0x47')||_0x4895bc===_0x94c0('0x17')||_0x4895bc===_0x94c0('0x69')||_0x4895bc==='calleridnum'||_0x4895bc===_0x94c0('0x51')||_0x4895bc===_0x94c0('0x4b')||_0x4895bc==='countcongestionretry'||_0x4895bc===_0x94c0('0x6a')||_0x4895bc==='countglobal'||_0x4895bc===_0x94c0('0x6b')||_0x4895bc===_0x94c0('0x6c')||_0x4895bc==='callbackat'||_0x4895bc===_0x94c0('0x6d')||_0x4895bc==='ContactId'||_0x4895bc==='ListId'||_0x4895bc===_0x94c0('0x3c')||_0x4895bc===_0x94c0('0x1b')||_0x4895bc==='sipcallid'||_0x4895bc===_0x94c0('0x6e')||_0x4895bc===_0x94c0('0x6f')||_0x4895bc===_0x94c0('0x70')||_0x4895bc===_0x94c0('0x71')||_0x4895bc===_0x94c0('0x72')||_0x4895bc===_0x94c0('0x73')||_0x4895bc===_0x94c0('0x74')||_0x4895bc==='xmd-dialid'||_0x4895bc===_0x94c0('0x75')||_0x4895bc===_0x94c0('0x76')||_0x4895bc===_0x94c0('0x77')||_0x4895bc===_0x94c0('0x78')||_0x4895bc==='xmd-agiafter'||_0x4895bc==='xmd-agi'||_0x4895bc===_0x94c0('0x79')||_0x4895bc===_0x94c0('0x7a')||_0x4895bc===_0x94c0('0x7b')||_0x4895bc===_0x94c0('0x7c')||_0x4895bc==='rtpaudioqosloss'||_0x4895bc===_0x94c0('0x7d')||_0x4895bc==='rtpaudioqosrtt'||_0x4895bc===_0x94c0('0x7e')||_0x4895bc===_0x94c0('0x79')||_0x4895bc===_0x94c0('0x7a')||_0x4895bc===_0x94c0('0x7b')||_0x4895bc===_0x94c0('0x7c')||_0x4895bc===_0x94c0('0x7f')||_0x4895bc===_0x94c0('0x7d')||_0x4895bc===_0x94c0('0x80')||_0x4895bc===_0x94c0('0x7e')||_0x4895bc==='bridgepeer'||_0x4895bc===_0x94c0('0x81')||_0x4895bc===_0x94c0('0x34')||_0x4895bc==='statedesc'){return![];}return!![];};exports[_0x94c0('0x82')]=function(_0x3a03be,_0x472f48){var _0x318254,_0x35a7fe,_0x254654;if(_0x472f48<=0x0){_0x472f48=0x1;}_0x318254=new RegExp(_0x94c0('0x83')+_0x472f48+'}$');_0x35a7fe=Math[_0x94c0('0x84')](0xa,_0x472f48-0x1);_0x254654=Math[_0x94c0('0x84')](0xa,_0x472f48)-0x1;return util[_0x94c0('0xf')]('%s',_[_0x94c0('0x85')](_0x3a03be,_0x318254,_['random'](_0x35a7fe,_0x254654)));};exports['extractCalleridName']=function(_0x2dc786){var _0xf9d60e=_0x2dc786[_0x94c0('0x86')](/"(.*?)"/);return _0xf9d60e?_0xf9d60e[0x1]:_0x2dc786;};exports[_0x94c0('0x87')]=function(_0x1fae7d){var _0x78a17d=_0x1fae7d[_0x94c0('0x86')](/<(.*?)>/);return _0x78a17d?_0x78a17d[0x1]:_0x1fae7d;};function buildNoAnswerEventPayload(_0x42f2a4,_0x548435){var _0x1ba36e=buildObj(_0x42f2a4,_0x94c0('0x88'));if(!_[_0x94c0('0xd')](_0x548435[_0x94c0('0x89')])){Object[_0x94c0('0x8a')](_0x548435['variables'])['forEach'](function(_0x429b80){_0x1ba36e[_0x429b80['toLowerCase']()]=_0x548435[_0x94c0('0x89')][_0x429b80];});}return _0x1ba36e;}exports[_0x94c0('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index f45af40..de6d8c5 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 _0xe656=['voicechannel','voicequeuechannelredirect','string','boolean','queueremove','reload','voicequeuechannel'];(function(_0x22feba,_0x589d94){var _0x40261f=function(_0x14be77){while(--_0x14be77){_0x22feba['push'](_0x22feba['shift']());}};_0x40261f(++_0x589d94);}(_0xe656,0xf0));var _0x6e65=function(_0x3d2364,_0x4eb6de){_0x3d2364=_0x3d2364-0x0;var _0x282314=_0xe656[_0x3d2364];return _0x282314;};'use strict';exports['queueadd']={'queue':{'type':_0x6e65('0x0'),'required':!![]},'interface':{'type':_0x6e65('0x0'),'required':!![]},'membername':{'type':_0x6e65('0x0'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x6e65('0x1'),'required':![]}};exports[_0x6e65('0x2')]={'queue':{'type':_0x6e65('0x0'),'required':!![]},'interface':{'type':_0x6e65('0x0'),'required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x6e65('0x0'),'required':![]}};exports[_0x6e65('0x3')]={'module':{'type':_0x6e65('0x0'),'required':![]}};exports[_0x6e65('0x4')]={'uniqueid':{'type':_0x6e65('0x0'),'required':!![]}};exports[_0x6e65('0x5')]={'uniqueid':{'type':_0x6e65('0x0'),'required':!![]},'filename':{'type':_0x6e65('0x0')},'format':{'type':_0x6e65('0x0')},'mixmonitorid':{'type':_0x6e65('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x6e65('0x0'),'required':!![]}};exports[_0x6e65('0x6')]={'uniqueid':{'type':_0x6e65('0x0'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x6e65('0x0')}}; \ No newline at end of file +var _0x8bc4=['voicequeuechannelredirect','queueadd','string','number','queueremove','queuepause','voicequeuechannel','voicequeuechannelhangup'];(function(_0x438997,_0x3c047d){var _0x42db64=function(_0x343e87){while(--_0x343e87){_0x438997['push'](_0x438997['shift']());}};_0x42db64(++_0x3c047d);}(_0x8bc4,0xe9));var _0x48bc=function(_0x22f891,_0x3b8c25){_0x22f891=_0x22f891-0x0;var _0x15c36e=_0x8bc4[_0x22f891];return _0x15c36e;};'use strict';exports[_0x48bc('0x0')]={'queue':{'type':_0x48bc('0x1'),'required':!![]},'interface':{'type':_0x48bc('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x48bc('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x48bc('0x3')]={'queue':{'type':_0x48bc('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x48bc('0x4')]={'interface':{'type':_0x48bc('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0x48bc('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x48bc('0x1'),'required':!![]},'filename':{'type':_0x48bc('0x1')},'format':{'type':_0x48bc('0x1')},'mixmonitorid':{'type':_0x48bc('0x1')}};exports[_0x48bc('0x6')]={'uniqueid':{'type':_0x48bc('0x1'),'required':!![]}};exports[_0x48bc('0x7')]={'uniqueid':{'type':_0x48bc('0x1'),'required':!![]},'exten':{'type':_0x48bc('0x1'),'required':!![]},'context':{'type':_0x48bc('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 6a36faa..712fa98 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x2c80c3,_0x5c89ff){var _0x4a2129=function(_0x1dea98){while(--_0x1dea98){_0x2c80c3['push'](_0x2c80c3['shift']());}};_0x4a2129(++_0x5c89ff);}(_0xb10b,0x12a));var _0xbb10=function(_0x5ae7ae,_0x534c34){_0x5ae7ae=_0x5ae7ae-0x0;var _0x5929f7=_0xb10b[_0x5ae7ae];return _0x5929f7;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file +var _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2032,0xd9));var _0x2203=function(_0x45222e,_0x2c3831){_0x45222e=_0x45222e-0x0;var _0xc32564=_0x2032[_0x45222e];return _0xc32564;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 67dfc13..3a92c20 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18bb=['hasOwnProperty','assign'];(function(_0x255a35,_0x288ca8){var _0x212d6a=function(_0x273924){while(--_0x273924){_0x255a35['push'](_0x255a35['shift']());}};_0x212d6a(++_0x288ca8);}(_0x18bb,0xc1));var _0xb18b=function(_0x412c8f,_0x11ec94){_0x412c8f=_0x412c8f-0x0;var _0x27c005=_0x18bb[_0x412c8f];return _0x27c005;};'use strict';function mergeDBDataToRealtime(_0x41b250,_0xa77bf0){var _0x1cfd5b=Object[_0xb18b('0x0')]({},_0x41b250);for(var _0x4418e8 in _0xa77bf0){if(_0x1cfd5b[_0xb18b('0x1')](_0x4418e8)){_0x1cfd5b[_0x4418e8]=_0xa77bf0[_0x4418e8];}}return _0x1cfd5b;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file +var _0x5b21=['assign','hasOwnProperty'];(function(_0x230afe,_0x1d25ff){var _0x2308fe=function(_0x357178){while(--_0x357178){_0x230afe['push'](_0x230afe['shift']());}};_0x2308fe(++_0x1d25ff);}(_0x5b21,0x13a));var _0x15b2=function(_0x18c3cf,_0x3afe0e){_0x18c3cf=_0x18c3cf-0x0;var _0x195d27=_0x5b21[_0x18c3cf];return _0x195d27;};'use strict';function mergeDBDataToRealtime(_0xeee756,_0x4d0a3e){var _0x15d016=Object[_0x15b2('0x0')]({},_0xeee756);for(var _0x1d733a in _0x4d0a3e){if(_0x15d016[_0x15b2('0x1')](_0x1d733a)){_0x15d016[_0x1d733a]=_0x4d0a3e[_0x1d733a];}}return _0x15d016;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index e9eb564..72a346f 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 _0xf4a5=['context','callerid','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','create','monitors','monitorFilename','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','isArray','startsWith','Local','substring','indexOf','transfererlinkedid','attendedTransfer','exports','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','find','name','isNil','format','SIP/%s','length','findAgent','accountcode','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','getAgentByInternal','keys','getCallType','channel','calleridnum','outbound','destination','type','dialer','queue','lastdata'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xf4a5,0xd4));var _0x5f4a=function(_0xf8886b,_0x504891){_0xf8886b=_0xf8886b-0x0;var _0x321bd5=_0xf4a5[_0xf8886b];return _0x321bd5;};'use strict';var _=require(_0x5f4a('0x0'));var moment=require(_0x5f4a('0x1'));var util=require('util');var config=require(_0x5f4a('0x2'));var ami=require(_0x5f4a('0x3'));var RpcVoiceAgentReport=require(_0x5f4a('0x4'));var RpcVoiceCallReport=require(_0x5f4a('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x5f4a('0x6'));var RpcVoiceQueueReport=require(_0x5f4a('0x7'));var RpcVoiceRecording=require(_0x5f4a('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x5f4a('0x9'));var VoiceCallReport=require(_0x5f4a('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x5f4a('0xb'));var UserReport=require(_0x5f4a('0xc'));function Report(_0x4e7511){this[_0x5f4a('0xd')]=_0x4e7511;this[_0x5f4a('0xe')]=_0x4e7511['agents'];this[_0x5f4a('0xf')]=_0x4e7511['telephones'];}Report[_0x5f4a('0x10')][_0x5f4a('0x11')]=function(_0x18f3fc){var _0x2c072f=new VoiceQueueReport(this[_0x5f4a('0xd')]);var _0x394c05=new VoiceAgentReport(this[_0x5f4a('0xd')]);var _0x35ecd9=new VoiceDialReport(this[_0x5f4a('0xd')]);var _0xa164fc=new VoiceCallReport(this['realtime']);var _0x56418c=new UserReport(this['realtime']);if(config[_0x5f4a('0x12')]&&config[_0x5f4a('0x12')][_0x5f4a('0x13')]){ami['on'](_0x5f4a('0x14'),this[_0x5f4a('0x15')][_0x5f4a('0x16')](this));ami['on'](_0x5f4a('0x17'),this[_0x5f4a('0x18')]['bind'](this));ami['on']('custom:voiceAgentReport',this[_0x5f4a('0x19')][_0x5f4a('0x16')](this));ami['on'](_0x5f4a('0x1a'),this[_0x5f4a('0x1b')][_0x5f4a('0x16')](this));ami['on'](_0x5f4a('0x1c'),this['blindTransfer'][_0x5f4a('0x16')](this));ami['on'](_0x5f4a('0x1d'),this['attendedTransfer'][_0x5f4a('0x16')](this));}};Report['prototype']['findAgent']=function(_0x481a47){var _0x3a60b6;_0x3a60b6=_[_0x5f4a('0x1e')](this[_0x5f4a('0xe')],function(_0x1ddb44){return _0x1ddb44['accountcode']==_0x481a47||_0x1ddb44[_0x5f4a('0x1f')]==_0x481a47;});if(_[_0x5f4a('0x20')](_0x3a60b6)){var _0x40b323=_[_0x5f4a('0x1e')](this[_0x5f4a('0xf')],function(_0x308ccd){return _0x308ccd['accountcode']==_0x481a47||_0x308ccd[_0x5f4a('0x1f')]==_0x481a47;});if(_0x40b323){_0x3a60b6=_[_0x5f4a('0x1e')](this['agents'],function(_0x150718){return _0x150718['interface']==util[_0x5f4a('0x21')](_0x5f4a('0x22'),_0x40b323[_0x5f4a('0x1f')]);});}}return _0x3a60b6;};Report['prototype'][_0x5f4a('0x15')]=function(_0x391411){for(var _0x5be01a=0x0;_0x5be01a<_0x391411[_0x5f4a('0x23')];_0x5be01a+=0x1){var _0x1123c1=this[_0x5f4a('0x24')](_0x391411[_0x5be01a]['connectedlinenum']);if(_0x1123c1){_0x391411[_0x5be01a][_0x5f4a('0x25')]=_0x1123c1[_0x5f4a('0x25')];_0x391411[_0x5be01a][_0x5f4a('0x26')]=!![];_0x391411[_0x5be01a][_0x5f4a('0x27')]=_0x1123c1['name'];_0x391411[_0x5be01a][_0x5f4a('0x28')]=_[_0x5f4a('0x20')](_0x1123c1[_0x5f4a('0x28')])?util[_0x5f4a('0x21')](_0x5f4a('0x22'),_0x1123c1[_0x5f4a('0x1f')]):_0x1123c1[_0x5f4a('0x28')];if(_0x391411[_0x5be01a][_0x5f4a('0x29')]){_0x391411[_0x5be01a][_0x5f4a('0x2a')]=moment()['format'](_0x5f4a('0x2b'));}if(_0x391411[_0x5be01a][_0x5f4a('0x2c')]){_0x391411[_0x5be01a][_0x5f4a('0x2d')]=moment()['format'](_0x5f4a('0x2b'));}RpcMemberReport[_0x5f4a('0x15')](_0x391411[_0x5be01a]);}RpcVoiceQueueReport['create'](_0x391411[_0x5be01a]);}};function extractCalleridNumber(_0x21e5fb){var _0xd95d21=_0x21e5fb[_0x5f4a('0x2e')](/<(.*?)>/);return _0xd95d21?_0xd95d21[0x1]:_0x21e5fb;}Report[_0x5f4a('0x10')][_0x5f4a('0x2f')]=function(_0x4c29c0){for(var _0x5c4049=0x0;_0x5c4049','transfers','linkedid','uniqueid','getCallType','split','UserId','membername','monitor','monitorFilename','filename','monitors','exten','calleridname','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','isNil','transfererlinkedid','moment','util','../ami','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync'];(function(_0x34b4ee,_0x29fb04){var _0x42d5d3=function(_0x115557){while(--_0x115557){_0x34b4ee['push'](_0x34b4ee['shift']());}};_0x42d5d3(++_0x29fb04);}(_0xad91,0x1bb));var _0x1ad9=function(_0x12d812,_0x496bb7){_0x12d812=_0x12d812-0x0;var _0x3711ab=_0xad91[_0x12d812];return _0x3711ab;};'use strict';var _=require('lodash');var moment=require(_0x1ad9('0x0'));var util=require(_0x1ad9('0x1'));var config=require('../../../config/environment');var ami=require(_0x1ad9('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x1ad9('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x1ad9('0x4'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x1ad9('0x5'));var RpcVoiceTransferReport=require(_0x1ad9('0x6'));var VoiceQueueReport=require(_0x1ad9('0x7'));var VoiceCallReport=require(_0x1ad9('0x8'));var VoiceAgentReport=require(_0x1ad9('0x9'));var VoiceDialReport=require(_0x1ad9('0xa'));var UserReport=require(_0x1ad9('0xb'));function Report(_0x14b29b){this[_0x1ad9('0xc')]=_0x14b29b;this[_0x1ad9('0xd')]=_0x14b29b['agents'];this[_0x1ad9('0xe')]=_0x14b29b['telephones'];}Report[_0x1ad9('0xf')][_0x1ad9('0x10')]=function(_0x121ca1){var _0xad238=new VoiceQueueReport(this[_0x1ad9('0xc')]);var _0x37a357=new VoiceAgentReport(this['realtime']);var _0x40f163=new VoiceDialReport(this[_0x1ad9('0xc')]);var _0x85f95b=new VoiceCallReport(this[_0x1ad9('0xc')]);var _0x1d288e=new UserReport(this['realtime']);if(config[_0x1ad9('0x11')]&&config['xdr'][_0x1ad9('0x12')]){ami['on'](_0x1ad9('0x13'),this[_0x1ad9('0x14')][_0x1ad9('0x15')](this));ami['on'](_0x1ad9('0x16'),this['voiceCallReport'][_0x1ad9('0x15')](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport']['bind'](this));ami['on'](_0x1ad9('0x17'),this[_0x1ad9('0x18')][_0x1ad9('0x15')](this));ami['on'](_0x1ad9('0x19'),this[_0x1ad9('0x1a')][_0x1ad9('0x15')](this));ami['on'](_0x1ad9('0x1b'),this[_0x1ad9('0x1c')]['bind'](this));}};Report[_0x1ad9('0xf')][_0x1ad9('0x1d')]=function(_0x518659){var _0x5df100;_0x5df100=_['find'](this[_0x1ad9('0xd')],function(_0x1b11d7){return _0x1b11d7['accountcode']==_0x518659||_0x1b11d7['name']==_0x518659;});if(_['isNil'](_0x5df100)){var _0x1436cf=_[_0x1ad9('0x1e')](this[_0x1ad9('0xe')],function(_0x723b4){return _0x723b4['accountcode']==_0x518659||_0x723b4[_0x1ad9('0x1f')]==_0x518659;});if(_0x1436cf){_0x5df100=_[_0x1ad9('0x1e')](this['agents'],function(_0x38f85f){return _0x38f85f[_0x1ad9('0x20')]==util[_0x1ad9('0x21')](_0x1ad9('0x22'),_0x1436cf['name']);});}}return _0x5df100;};Report['prototype'][_0x1ad9('0x14')]=function(_0x1bfc34){for(var _0x4e0c3c=0x0;_0x4e0c3c<_0x1bfc34['length'];_0x4e0c3c+=0x1){var _0x877f23=this[_0x1ad9('0x1d')](_0x1bfc34[_0x4e0c3c][_0x1ad9('0x23')]);if(_0x877f23){_0x1bfc34[_0x4e0c3c]['accountcode']=_0x877f23[_0x1ad9('0x24')];_0x1bfc34[_0x4e0c3c][_0x1ad9('0x25')]=!![];_0x1bfc34[_0x4e0c3c][_0x1ad9('0x26')]=_0x877f23[_0x1ad9('0x1f')];_0x1bfc34[_0x4e0c3c]['interface']=_['isNil'](_0x877f23[_0x1ad9('0x20')])?util[_0x1ad9('0x21')]('SIP/%s',_0x877f23[_0x1ad9('0x1f')]):_0x877f23[_0x1ad9('0x20')];if(_0x1bfc34[_0x4e0c3c][_0x1ad9('0x27')]){_0x1bfc34[_0x4e0c3c][_0x1ad9('0x28')]=moment()[_0x1ad9('0x21')](_0x1ad9('0x29'));}if(_0x1bfc34[_0x4e0c3c][_0x1ad9('0x2a')]){_0x1bfc34[_0x4e0c3c][_0x1ad9('0x2b')]=moment()['format'](_0x1ad9('0x29'));}RpcMemberReport[_0x1ad9('0x14')](_0x1bfc34[_0x4e0c3c]);}RpcVoiceQueueReport[_0x1ad9('0x2c')](_0x1bfc34[_0x4e0c3c]);}};function extractCalleridNumber(_0x318412){var _0x133ae1=_0x318412[_0x1ad9('0x2d')](/<(.*?)>/);return _0x133ae1?_0x133ae1[0x1]:_0x318412;}Report[_0x1ad9('0xf')]['getAgentByInternal']=function(_0x1ec894){for(var _0x418f86=0x0;_0x418f860x0?!![]:![];if(!_0x108301){return this[_0xe9e6('0x19')](this[_0xe9e6('0x13')]['completeEvent']);}};VoiceQueueReport[_0xe9e6('0x36')][_0xe9e6('0x6e')]=function(_0x56fbb3){var _0xca0d63=this['summary']['id'];if(this[_0xe9e6('0x13')]['queuestatus'][_0xca0d63]&&this[_0xe9e6('0x13')][_0xe9e6('0x62')][_0xca0d63][_0x56fbb3['actionid']]){this['summary'][_0xe9e6('0x62')][_0xca0d63][_0x56fbb3[_0xe9e6('0x61')]][_0xe9e6('0xe')][_0xe9e6('0x6f')](_0x56fbb3);}};VoiceQueueReport[_0xe9e6('0x36')][_0xe9e6('0x16')]=function(_0x1c80aa){var _0x26cd16=this;try{if(this[_0xe9e6('0x5b')](_0x1c80aa)&&this[_0xe9e6('0x5b')](_0x1c80aa[_0xe9e6('0x4f')])){logger[_0xe9e6('0x58')](_0xe9e6('0x70'),util[_0xe9e6('0x42')](_0x1c80aa,{'showHidden':![],'depth':null}));var _0x31458e=this[_0xe9e6('0x11')][_0x1c80aa[_0xe9e6('0x4f')]];if(_0x31458e){logger[_0xe9e6('0x71')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x31458e['name']);this['summary']['queues'][_0x31458e[_0xe9e6('0x64')]]={'summaryEvent':_0x1c80aa};this[_0xe9e6('0x13')][_0xe9e6('0x6d')]+=0x1;return ami[_0xe9e6('0x3b')]({'action':_0xe9e6('0x62'),'queue':_0x31458e['name']})[_0xe9e6('0x60')](function(_0x41746a){if(!_0x26cd16[_0xe9e6('0x13')][_0xe9e6('0x62')][_0x1c80aa[_0xe9e6('0x61')]]){_0x26cd16['summary']['queuestatus'][_0x1c80aa[_0xe9e6('0x61')]]={};}_0x26cd16[_0xe9e6('0x13')][_0xe9e6('0x62')][_0x1c80aa[_0xe9e6('0x61')]][_0x41746a[_0xe9e6('0x61')]]={'queue':_0x31458e['name'],'agents':[]};})[_0xe9e6('0x3e')](function(_0x21c6bb){throw _0x21c6bb;});}}}catch(_0x4e5427){logger['error'](_0xe9e6('0x63'),util[_0xe9e6('0x42')](_0x4e5427,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe9e6('0x36')][_0xe9e6('0x19')]=function(_0x2e1a86){if(this[_0xe9e6('0x13')]['statusRequests']>0x0){this[_0xe9e6('0x13')][_0xe9e6('0x72')]=_0x2e1a86;return;}logger[_0xe9e6('0x58')](_0xe9e6('0x73'),util['inspect'](_0x2e1a86,{'showHidden':![],'depth':null}));this[_0xe9e6('0x13')]=initializeSummary();ami[_0xe9e6('0x49')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0xe9e6('0x36')][_0xe9e6('0x1e')]=function(_0x3244a9){try{if(this[_0xe9e6('0x5b')](_0x3244a9)){logger['debug'](_0xe9e6('0x74'),_0x3244a9['uniqueid'],util[_0xe9e6('0x42')](_0x3244a9,{'showHidden':![],'depth':null}));if(_[_0xe9e6('0x5c')](this[_0xe9e6('0x43')][_0x3244a9['uniqueid']])){this['queueReports'][_0x3244a9[_0xe9e6('0x4c')]]=[];}if(_[_0xe9e6('0x5c')](this[_0xe9e6('0xf')][_0x3244a9['uniqueid']])){this[_0xe9e6('0xf')][_0x3244a9[_0xe9e6('0x4c')]]={};}var _0x591598=new QueueReport();_0x591598[_0xe9e6('0x4f')]=_0x3244a9['queue'];_0x591598[_0xe9e6('0x57')]=this[_0xe9e6('0x11')][_0x591598[_0xe9e6('0x4f')]]&&this['voiceQueues'][_0x591598[_0xe9e6('0x4f')]][_0xe9e6('0x57')]?this[_0xe9e6('0x11')][_0x591598[_0xe9e6('0x4f')]][_0xe9e6('0x57')]||_0xe9e6('0x6b'):_0xe9e6('0x6b');_0x591598[_0xe9e6('0x75')]=moment()['format'](_0xe9e6('0x76'));_0x591598[_0xe9e6('0x77')]=_0x3244a9[_0xe9e6('0x77')];_0x591598[_0xe9e6('0x78')]=_0x3244a9['count'];_0x591598[_0xe9e6('0x4c')]=_0x3244a9['uniqueid'];_0x591598[_0xe9e6('0x79')]=this[_0xe9e6('0xf')][_0x3244a9['uniqueid']]['routealias'];logger[_0xe9e6('0x71')](_0xe9e6('0x7a'),_0x591598['queue'],_0x591598[_0xe9e6('0x57')]);_['merge'](_0x591598,_[_0xe9e6('0x7b')](_0x3244a9,_['keys'](_0x591598)));this[_0xe9e6('0x43')][_0x3244a9[_0xe9e6('0x4c')]][_0xe9e6('0x6f')](_0x591598);this['channels'][_0x3244a9['uniqueid']]=_0x591598;this['emitVoiceQueueChannelSave'](_0x591598,_0xe9e6('0x1d'));}}catch(_0x576544){logger[_0xe9e6('0x41')](_0xe9e6('0x74'),_0x3244a9[_0xe9e6('0x4c')],util['inspect'](_0x576544,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe9e6('0x36')]['syncQueueCallerAbandon']=function(_0x402566){try{if(this[_0xe9e6('0x5b')](_0x402566)){logger['debug'](_0xe9e6('0x7c'),_0x402566['uniqueid'],util[_0xe9e6('0x42')](_0x402566,{'showHidden':![],'depth':null}));if(this[_0xe9e6('0x43')][_0x402566[_0xe9e6('0x4c')]]){var _0x2211f3=_[_0xe9e6('0x7d')](this[_0xe9e6('0x43')][_0x402566[_0xe9e6('0x4c')]]);_0x2211f3[_0xe9e6('0x7e')]=![];_0x2211f3[_0xe9e6('0x7f')]=null;_0x2211f3[_0xe9e6('0x80')]=_0x402566[_0xe9e6('0x80')];_0x2211f3[_0xe9e6('0x81')]=_0x402566[_0xe9e6('0x81')];_0x2211f3['queuecallerabandon']=!![];_0x2211f3[_0xe9e6('0x82')]=moment()[_0xe9e6('0x4d')](_0xe9e6('0x76'));_0x2211f3[_0xe9e6('0x83')]=_0xe9e6('0x84');_0x2211f3[_0xe9e6('0x85')]=null;logger[_0xe9e6('0x71')](_0xe9e6('0x86'),_0x2211f3[_0xe9e6('0x4f')],_0x2211f3[_0xe9e6('0x57')]);this['channels'][_0x402566[_0xe9e6('0x4c')]]=_0x2211f3;this[_0xe9e6('0x48')](_0x2211f3,'queuecallerabandon');}}}catch(_0x1baa49){logger['error'](_0xe9e6('0x7c'),_0x402566[_0xe9e6('0x4c')],util[_0xe9e6('0x42')](_0x1baa49,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe9e6('0x36')][_0xe9e6('0x87')]=function(_0x74c8bd){try{if(this['isNotNull'](_0x74c8bd)){logger[_0xe9e6('0x58')](_0xe9e6('0x88'),_0x74c8bd[_0xe9e6('0x4c')],util[_0xe9e6('0x42')](_0x74c8bd,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x74c8bd[_0xe9e6('0x4c')]]){var _0xaa0b13=_[_0xe9e6('0x7d')](this[_0xe9e6('0x43')][_0x74c8bd['uniqueid']]);_0xaa0b13[_0xe9e6('0x89')]=moment()[_0xe9e6('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0xaa0b13['connectedlinenum']=_0x74c8bd['connectedlinenum'];_0xaa0b13[_0xe9e6('0x8a')]=_0x74c8bd[_0xe9e6('0x8a')];logger[_0xe9e6('0x71')](_0xe9e6('0x8b'),_0xaa0b13[_0xe9e6('0x4f')],_0xaa0b13[_0xe9e6('0x57')],_0x74c8bd[_0xe9e6('0x8c')],_0x74c8bd[_0xe9e6('0x8a')]);this[_0xe9e6('0xf')][_0x74c8bd[_0xe9e6('0x4c')]]=_0xaa0b13;this['emitVoiceQueueChannelSave'](_0xaa0b13,'queuecallerleave');}}}catch(_0x196c3e){logger[_0xe9e6('0x41')](_0xe9e6('0x88'),_0x74c8bd[_0xe9e6('0x4c')],util[_0xe9e6('0x42')](_0x196c3e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe9e6('0x23')]=function(_0x2ba58e){try{if(this[_0xe9e6('0x5b')](_0x2ba58e)){logger['debug'](_0xe9e6('0x8d'),_0x2ba58e[_0xe9e6('0x4c')],util[_0xe9e6('0x42')](_0x2ba58e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2ba58e[_0xe9e6('0x4c')]]){var _0x3eef65=_[_0xe9e6('0x7d')](this[_0xe9e6('0x43')][_0x2ba58e[_0xe9e6('0x4c')]]);_0x3eef65['queuecallercomplete']=!![];_0x3eef65[_0xe9e6('0x83')]=_0xe9e6('0x8e');logger['info'](_0xe9e6('0x8f'),_0x3eef65[_0xe9e6('0x4f')],_0x3eef65[_0xe9e6('0x57')]);}}}catch(_0x46b09e){logger[_0xe9e6('0x41')](_0xe9e6('0x8d'),_0x2ba58e['uniqueid'],util['inspect'](_0x46b09e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe9e6('0x36')][_0xe9e6('0x90')]=function(_0xc11604){try{if(this[_0xe9e6('0x5b')](_0xc11604)){logger[_0xe9e6('0x58')](_0xe9e6('0x91'),_0xc11604[_0xe9e6('0x4c')],util[_0xe9e6('0x42')](_0xc11604,{'showHidden':![],'depth':null}));if(this[_0xe9e6('0x43')][_0xc11604[_0xe9e6('0x4c')]]){var _0xdae0e9=_['last'](this[_0xe9e6('0x43')][_0xc11604[_0xe9e6('0x4c')]]);_0xdae0e9[_0xe9e6('0x1f')]=![];_0xdae0e9['queuecallerabandonAt']=null;_0xdae0e9[_0xe9e6('0x92')]=!![];_0xdae0e9['lastAssignedTo']=_0xc11604[_0xe9e6('0x93')];_0xdae0e9[_0xe9e6('0x80')]=_0xc11604[_0xe9e6('0x80')];_0xdae0e9[_0xe9e6('0x7e')]=!![];_0xdae0e9[_0xe9e6('0x94')]=![];_0xdae0e9[_0xe9e6('0x95')]=null;if(!_0xdae0e9[_0xe9e6('0x96')]){if(_0xc11604['reason']==_0xe9e6('0x96')){_0xdae0e9['queuecallerexitreason']=_0xe9e6('0x97');logger['info'](_0xe9e6('0x98'),_0xdae0e9[_0xe9e6('0x4f')],_0xdae0e9[_0xe9e6('0x57')]);}else{if(_[_0xe9e6('0x99')](_0xc11604[_0xe9e6('0x3d')]['toLowerCase'](),_0xe9e6('0x9a'))){if(this[_0xe9e6('0x43')][_0xc11604[_0xe9e6('0x9b')]]){var _0x32af24=_[_0xe9e6('0x7d')](this[_0xe9e6('0x43')][_0xc11604['linkedid']]);_0x32af24[_0xe9e6('0x7e')]=![];_0x32af24['queuecallerexit']=!![];_0x32af24[_0xe9e6('0x95')]=moment(_0xdae0e9[_0xe9e6('0x75')])['add'](_0xc11604[_0xe9e6('0x80')],_0xe9e6('0x9c'))[_0xe9e6('0x4d')](_0xe9e6('0x76'));_0x32af24['queuecallerexitreason']=_0xe9e6('0x9d');_0x32af24[_0xe9e6('0x96')]=!![];_0x32af24[_0xe9e6('0x9e')]=_0xe9e6('0x9f');_0x32af24[_0xe9e6('0xa0')]=_0xc11604['destexten'];_0x32af24[_0xe9e6('0xa1')]=_0xc11604[_0xe9e6('0x4c')];logger[_0xe9e6('0x71')](_0xe9e6('0xa2'),_0x32af24[_0xe9e6('0x4f')],_0x32af24[_0xe9e6('0x57')]);var _0x329367=this[_0xe9e6('0x43')][_0xc11604['linkedid']];this[_0xe9e6('0x43')][_0xc11604['linkedid']]=this['queueReports'][_0xc11604[_0xe9e6('0x4c')]];this['queueReports'][_0xc11604[_0xe9e6('0x4c')]]=_0x329367;}}else{_0xdae0e9['queuecallerexitreason']='COMPLETEDBY'+_0xc11604[_0xe9e6('0xa3')][_0xe9e6('0xa4')]();logger['info'](_0xe9e6('0xa5'),_0xdae0e9[_0xe9e6('0x4f')],_0xdae0e9[_0xe9e6('0x57')],_0xdae0e9['queuecallerexitreason']);}}}this[_0xe9e6('0xf')][_0xc11604[_0xe9e6('0x4c')]]=_0xdae0e9;this[_0xe9e6('0x48')](_0xdae0e9,_0xe9e6('0xa6'));}}}catch(_0x4b9522){logger[_0xe9e6('0x41')](_0xe9e6('0x91'),_0xc11604[_0xe9e6('0x4c')],util[_0xe9e6('0x42')](_0x4b9522,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe9e6('0x36')][_0xe9e6('0xa7')]=function(_0x5151ac){try{if(this['isNotNull'](_0x5151ac)){logger['debug'](_0xe9e6('0xa8'),_0x5151ac[_0xe9e6('0x4c')],util['inspect'](_0x5151ac,{'showHidden':![],'depth':null}));this[_0xe9e6('0xa9')](_0x5151ac[_0xe9e6('0x4c')],_[_0xe9e6('0xaa')](_0x5151ac[_0xe9e6('0xab')])[0x0],_0x5151ac[_0xe9e6('0xac')]);if(this['queueReports'][_0x5151ac[_0xe9e6('0x4c')]]){var _0x116cc0=_[_0xe9e6('0x7d')](this[_0xe9e6('0x43')][_0x5151ac['uniqueid']]);if(_0x116cc0){if(this[_0xe9e6('0x5b')](_0x5151ac[_0xe9e6('0xab')])&&this['isNotNull'](_0x5151ac['variable'][_0xe9e6('0x62')])){switch(_0x5151ac[_0xe9e6('0xac')]){case _0xe9e6('0xad'):_0x116cc0[_0xe9e6('0x94')]=![];_0x116cc0['queuecallerexitAt']=null;break;case _0xe9e6('0xae'):_0x116cc0[_0xe9e6('0xaf')]=_0xe9e6('0xb0');_0x116cc0[_0xe9e6('0x94')]=!![];_0x116cc0[_0xe9e6('0x95')]=moment()[_0xe9e6('0x4d')](_0xe9e6('0x76'));_0x116cc0['queuecallerleaveAt']=moment()[_0xe9e6('0x4d')](_0xe9e6('0x76'));logger[_0xe9e6('0x58')](_0xe9e6('0xb1'),_0x5151ac['uniqueid'],util['inspect'](_0x116cc0,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x116cc0);break;default:_0x116cc0[_0xe9e6('0x94')]=!![];_0x116cc0[_0xe9e6('0x95')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x116cc0[_0xe9e6('0x89')]=moment()[_0xe9e6('0x4d')](_0xe9e6('0x76'));}_0x116cc0[_0xe9e6('0x1f')]=![];_0x116cc0['queuecallerabandonAt']=null;_0x116cc0[_0xe9e6('0x83')]=_0x5151ac[_0xe9e6('0xac')];this[_0xe9e6('0xf')][_0x5151ac['uniqueid']]=_0x116cc0;this['emitVoiceQueueChannelRemove'](_0x116cc0,_0xe9e6('0x24'));}else if(this[_0xe9e6('0x5b')](_0x5151ac[_0xe9e6('0xab')])&&this[_0xe9e6('0x5b')](_0x5151ac[_0xe9e6('0xab')][_0xe9e6('0xb2')])){if(!_0x116cc0[_0xe9e6('0x1f')]){_0x116cc0[_0xe9e6('0x94')]=!![];_0x116cc0[_0xe9e6('0x95')]=moment()[_0xe9e6('0x4d')](_0xe9e6('0x76'));_0x116cc0['queuecallerexitreason']=_0xe9e6('0xb3');_0x116cc0[_0xe9e6('0x89')]=moment()[_0xe9e6('0x4d')](_0xe9e6('0x76'));this['channels'][_0x5151ac['uniqueid']]=_0x116cc0;}}logger[_0xe9e6('0x71')](_0xe9e6('0xb4'),_0x5151ac[_0xe9e6('0x4c')],_0x116cc0[_0xe9e6('0x4f')],_0x116cc0[_0xe9e6('0x57')],_[_0xe9e6('0xaa')](_0x5151ac[_0xe9e6('0xab')])[0x0],_0x5151ac['value']);_0x116cc0['variables']=this[_0xe9e6('0x14')][_0x5151ac[_0xe9e6('0x4c')]];}}}}catch(_0x227070){logger[_0xe9e6('0x41')](_0xe9e6('0xa8'),_0x5151ac[_0xe9e6('0x4c')],util['inspect'](_0x227070,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe9e6('0x36')]['addVariable']=function(_0x27fc87,_0x61a7d7,_0x156da7){var _0x358b04=[_0xe9e6('0xb5'),_0xe9e6('0xb6'),_0xe9e6('0xb7'),_0xe9e6('0xb8'),_0xe9e6('0xb9'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0xe9e6('0xba'),_0xe9e6('0xbb'),_0xe9e6('0xbc'),_0xe9e6('0xbd'),_0xe9e6('0xbe'),_0xe9e6('0xbf'),'memberdynamic','memberinterface',_0xe9e6('0xc0'),'membername',_0xe9e6('0xc1'),'memberrealtime'];if(!_[_0xe9e6('0x3a')](_0x61a7d7)&&!_[_0xe9e6('0xc2')](_0x358b04,_0x61a7d7)){if(_['isUndefined'](this['variables'][_0x27fc87])){this[_0xe9e6('0x14')][_0x27fc87]={};}this['variables'][_0x27fc87][_0x61a7d7]=_0x156da7;}};VoiceQueueReport['prototype']['handleHangup']=function(_0x60558c,_0x3f444b,_0x880a89){var _0x37ec52={};for(var _0x576a0b=0x0;_0x576a0b0x0?!![]:![];if(!_0xfd2104){return this[_0xc745('0x6d')](this['summary'][_0xc745('0x6e')]);}};VoiceQueueReport['prototype']['syncQueueMember']=function(_0x58ad7d){var _0x4e7a6f=this[_0xc745('0x18')]['id'];if(this[_0xc745('0x18')][_0xc745('0x62')][_0x4e7a6f]&&this[_0xc745('0x18')]['queuestatus'][_0x4e7a6f][_0x58ad7d[_0xc745('0x69')]]){this[_0xc745('0x18')]['queuestatus'][_0x4e7a6f][_0x58ad7d[_0xc745('0x69')]]['agents'][_0xc745('0x6f')](_0x58ad7d);}};VoiceQueueReport['prototype']['syncQueueSummary']=function(_0x238853){var _0x15483d=this;try{if(this[_0xc745('0x5d')](_0x238853)&&this[_0xc745('0x5d')](_0x238853[_0xc745('0x6a')])){logger[_0xc745('0x4d')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xc745('0x45')](_0x238853,{'showHidden':![],'depth':null}));var _0x8407d4=this[_0xc745('0x16')][_0x238853[_0xc745('0x6a')]];if(_0x8407d4){logger['info'](_0xc745('0x70'),_0x8407d4[_0xc745('0x5c')]);this[_0xc745('0x18')][_0xc745('0x60')][_0x8407d4[_0xc745('0x5c')]]={'summaryEvent':_0x238853};this[_0xc745('0x18')][_0xc745('0x6c')]+=0x1;return ami[_0xc745('0x5f')]({'action':_0xc745('0x62'),'queue':_0x8407d4['name']})[_0xc745('0x71')](function(_0x31de67){if(!_0x15483d['summary'][_0xc745('0x62')][_0x238853['actionid']]){_0x15483d[_0xc745('0x18')][_0xc745('0x62')][_0x238853[_0xc745('0x69')]]={};}_0x15483d['summary'][_0xc745('0x62')][_0x238853[_0xc745('0x69')]][_0x31de67['actionid']]={'queue':_0x8407d4[_0xc745('0x5c')],'agents':[]};})[_0xc745('0x63')](function(_0x4ad818){throw _0x4ad818;});}}}catch(_0x1da397){logger['error'](_0xc745('0x64'),util[_0xc745('0x45')](_0x1da397,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')]['syncQueueSummaryComplete']=function(_0x4d5fb2){if(this[_0xc745('0x18')][_0xc745('0x6c')]>0x0){this['summary']['completeEvent']=_0x4d5fb2;return;}logger[_0xc745('0x4d')](_0xc745('0x72'),util['inspect'](_0x4d5fb2,{'showHidden':![],'depth':null}));this[_0xc745('0x18')]=initializeSummary();ami[_0xc745('0x4b')](_0xc745('0x73'),{});};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x20')]=function(_0x22d692){try{if(this[_0xc745('0x5d')](_0x22d692)){logger[_0xc745('0x4d')]('[%s][voiceQueueReport][queuecallerjoin]',_0x22d692[_0xc745('0x4f')],util[_0xc745('0x45')](_0x22d692,{'showHidden':![],'depth':null}));if(_[_0xc745('0x74')](this[_0xc745('0x11')][_0x22d692['uniqueid']])){this[_0xc745('0x11')][_0x22d692[_0xc745('0x4f')]]=[];}if(_['isUndefined'](this[_0xc745('0x14')][_0x22d692[_0xc745('0x4f')]])){this[_0xc745('0x14')][_0x22d692['uniqueid']]={};}var _0x62a68f=new QueueReport();_0x62a68f['queue']=_0x22d692[_0xc745('0x6a')];_0x62a68f['type']=this[_0xc745('0x16')][_0x62a68f[_0xc745('0x6a')]]&&this[_0xc745('0x16')][_0x62a68f[_0xc745('0x6a')]][_0xc745('0x5a')]?this[_0xc745('0x16')][_0x62a68f[_0xc745('0x6a')]][_0xc745('0x5a')]||_0xc745('0x5b'):'inbound';_0x62a68f[_0xc745('0x75')]=moment()[_0xc745('0x55')](_0xc745('0x76'));_0x62a68f[_0xc745('0x77')]=_0x22d692['position'];_0x62a68f[_0xc745('0x78')]=_0x22d692[_0xc745('0x78')];_0x62a68f[_0xc745('0x4f')]=_0x22d692[_0xc745('0x4f')];_0x62a68f['routealias']=this[_0xc745('0x14')][_0x22d692['uniqueid']][_0xc745('0x79')];logger[_0xc745('0x7a')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x62a68f[_0xc745('0x6a')],_0x62a68f[_0xc745('0x5a')]);_[_0xc745('0x7b')](_0x62a68f,_['pick'](_0x22d692,_[_0xc745('0x7c')](_0x62a68f)));this[_0xc745('0x11')][_0x22d692['uniqueid']]['push'](_0x62a68f);this[_0xc745('0x14')][_0x22d692[_0xc745('0x4f')]]=_0x62a68f;this['emitVoiceQueueChannelSave'](_0x62a68f,_0xc745('0x1f'));}}catch(_0x5e15b7){logger['error'](_0xc745('0x7d'),_0x22d692[_0xc745('0x4f')],util[_0xc745('0x45')](_0x5e15b7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x22')]=function(_0x18cf89){try{if(this[_0xc745('0x5d')](_0x18cf89)){logger['debug'](_0xc745('0x7e'),_0x18cf89[_0xc745('0x4f')],util[_0xc745('0x45')](_0x18cf89,{'showHidden':![],'depth':null}));if(this[_0xc745('0x11')][_0x18cf89[_0xc745('0x4f')]]){var _0x47f137=_[_0xc745('0x7f')](this[_0xc745('0x11')][_0x18cf89['uniqueid']]);_0x47f137[_0xc745('0x80')]=![];_0x47f137[_0xc745('0x81')]=null;_0x47f137[_0xc745('0x82')]=_0x18cf89[_0xc745('0x82')];_0x47f137['originalposition']=_0x18cf89['originalposition'];_0x47f137['queuecallerabandon']=!![];_0x47f137[_0xc745('0x83')]=moment()[_0xc745('0x55')](_0xc745('0x76'));_0x47f137['queuecallerexitreason']=_0xc745('0x84');_0x47f137[_0xc745('0x85')]=null;logger[_0xc745('0x7a')](_0xc745('0x86'),_0x47f137[_0xc745('0x6a')],_0x47f137['type']);this[_0xc745('0x14')][_0x18cf89['uniqueid']]=_0x47f137;this[_0xc745('0x4a')](_0x47f137,_0xc745('0x21'));}}}catch(_0x3e1845){logger[_0xc745('0x43')](_0xc745('0x7e'),_0x18cf89[_0xc745('0x4f')],util['inspect'](_0x3e1845,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc745('0x24')]=function(_0x295980){try{if(this[_0xc745('0x5d')](_0x295980)){logger[_0xc745('0x4d')](_0xc745('0x87'),_0x295980['uniqueid'],util[_0xc745('0x45')](_0x295980,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x295980['uniqueid']]){var _0x319a52=_[_0xc745('0x7f')](this['queueReports'][_0x295980['uniqueid']]);_0x319a52[_0xc745('0x88')]=moment()[_0xc745('0x55')](_0xc745('0x76'));_0x319a52[_0xc745('0x89')]=_0x295980['connectedlinenum'];_0x319a52[_0xc745('0x8a')]=_0x295980['connectedlinename'];logger[_0xc745('0x7a')](_0xc745('0x8b'),_0x319a52[_0xc745('0x6a')],_0x319a52[_0xc745('0x5a')],_0x295980['connectedlinenum'],_0x295980[_0xc745('0x8a')]);this[_0xc745('0x14')][_0x295980[_0xc745('0x4f')]]=_0x319a52;this[_0xc745('0x4c')](_0x319a52,'queuecallerleave');}}}catch(_0x3ccc3e){logger[_0xc745('0x43')](_0xc745('0x87'),_0x295980[_0xc745('0x4f')],util['inspect'](_0x3ccc3e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')]['syncAgentConnect']=function(_0x25976e){try{if(this[_0xc745('0x5d')](_0x25976e)){logger[_0xc745('0x4d')]('[%s][voiceQueueReport][agentconnect]',_0x25976e[_0xc745('0x4f')],util[_0xc745('0x45')](_0x25976e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x25976e['uniqueid']]){var _0x3fec3b=_['last'](this[_0xc745('0x11')][_0x25976e['uniqueid']]);_0x3fec3b[_0xc745('0x80')]=!![];_0x3fec3b[_0xc745('0x54')]='COMPLETEDBYAGENT';logger[_0xc745('0x7a')](_0xc745('0x8c'),_0x3fec3b[_0xc745('0x6a')],_0x3fec3b['type']);}}}catch(_0x5ae0da){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x25976e[_0xc745('0x4f')],util[_0xc745('0x45')](_0x5ae0da,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x25')]=function(_0x57c1c1){try{if(this[_0xc745('0x5d')](_0x57c1c1)){logger[_0xc745('0x4d')](_0xc745('0x8d'),_0x57c1c1['uniqueid'],util[_0xc745('0x45')](_0x57c1c1,{'showHidden':![],'depth':null}));if(this[_0xc745('0x11')][_0x57c1c1[_0xc745('0x4f')]]){var _0x3b50a7=_[_0xc745('0x7f')](this[_0xc745('0x11')][_0x57c1c1['uniqueid']]);_0x3b50a7[_0xc745('0x21')]=![];_0x3b50a7[_0xc745('0x83')]=null;_0x3b50a7[_0xc745('0x8e')]=!![];_0x3b50a7[_0xc745('0x85')]=_0x57c1c1[_0xc745('0x8f')];_0x3b50a7[_0xc745('0x82')]=_0x57c1c1['holdtime'];_0x3b50a7['queuecallercomplete']=!![];_0x3b50a7[_0xc745('0x90')]=![];_0x3b50a7[_0xc745('0x91')]=null;if(!_0x3b50a7['transfer']){if(_0x57c1c1[_0xc745('0x92')]==_0xc745('0x93')){_0x3b50a7['queuecallerexitreason']=_0xc745('0x94');logger[_0xc745('0x7a')](_0xc745('0x95'),_0x3b50a7[_0xc745('0x6a')],_0x3b50a7[_0xc745('0x5a')]);}else{if(_[_0xc745('0x96')](_0x57c1c1[_0xc745('0x40')]['toLowerCase'](),_0xc745('0x97'))){if(this[_0xc745('0x11')][_0x57c1c1[_0xc745('0x98')]]){var _0x5b19f3=_['last'](this['queueReports'][_0x57c1c1[_0xc745('0x98')]]);_0x5b19f3[_0xc745('0x80')]=![];_0x5b19f3[_0xc745('0x90')]=!![];_0x5b19f3[_0xc745('0x91')]=moment(_0x3b50a7[_0xc745('0x75')])[_0xc745('0x99')](_0x57c1c1[_0xc745('0x82')],_0xc745('0x9a'))[_0xc745('0x55')](_0xc745('0x76'));_0x5b19f3[_0xc745('0x54')]=_0xc745('0x9b');_0x5b19f3['transfer']=!![];_0x5b19f3[_0xc745('0x9c')]=_0xc745('0x9d');_0x5b19f3[_0xc745('0x9e')]=_0x57c1c1[_0xc745('0x9f')];_0x5b19f3[_0xc745('0xa0')]=_0x57c1c1[_0xc745('0x4f')];logger[_0xc745('0x7a')](_0xc745('0xa1'),_0x5b19f3[_0xc745('0x6a')],_0x5b19f3['type']);var _0x4b1116=this[_0xc745('0x11')][_0x57c1c1[_0xc745('0x98')]];this[_0xc745('0x11')][_0x57c1c1[_0xc745('0x98')]]=this[_0xc745('0x11')][_0x57c1c1[_0xc745('0x4f')]];this[_0xc745('0x11')][_0x57c1c1[_0xc745('0x4f')]]=_0x4b1116;}}else{_0x3b50a7[_0xc745('0x54')]=_0xc745('0xa2')+_0x57c1c1[_0xc745('0x92')][_0xc745('0xa3')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x3b50a7[_0xc745('0x6a')],_0x3b50a7[_0xc745('0x5a')],_0x3b50a7[_0xc745('0x54')]);}}}this[_0xc745('0x14')][_0x57c1c1[_0xc745('0x4f')]]=_0x3b50a7;this['emitVoiceQueueChannelRemove'](_0x3b50a7,'agentcomplete');}}}catch(_0x1165bc){logger['error'](_0xc745('0x8d'),_0x57c1c1['uniqueid'],util[_0xc745('0x45')](_0x1165bc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x29')]=function(_0x22c8e4){try{if(this['isNotNull'](_0x22c8e4)){logger['debug'](_0xc745('0xa4'),_0x22c8e4['uniqueid'],util[_0xc745('0x45')](_0x22c8e4,{'showHidden':![],'depth':null}));this['addVariable'](_0x22c8e4[_0xc745('0x4f')],_[_0xc745('0x7c')](_0x22c8e4[_0xc745('0xa5')])[0x0],_0x22c8e4['value']);if(this['queueReports'][_0x22c8e4[_0xc745('0x4f')]]){var _0x44a07f=_[_0xc745('0x7f')](this[_0xc745('0x11')][_0x22c8e4['uniqueid']]);if(_0x44a07f){if(this[_0xc745('0x5d')](_0x22c8e4[_0xc745('0xa5')])&&this[_0xc745('0x5d')](_0x22c8e4[_0xc745('0xa5')]['queuestatus'])){switch(_0x22c8e4['value']){case _0xc745('0xa6'):_0x44a07f[_0xc745('0x90')]=![];_0x44a07f[_0xc745('0x91')]=null;break;case _0xc745('0xa7'):_0x44a07f[_0xc745('0xa8')]=_0xc745('0xa9');_0x44a07f[_0xc745('0x90')]=!![];_0x44a07f[_0xc745('0x91')]=moment()[_0xc745('0x55')](_0xc745('0x76'));_0x44a07f['queuecallerleaveAt']=moment()[_0xc745('0x55')](_0xc745('0x76'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x22c8e4[_0xc745('0x4f')],util[_0xc745('0x45')](_0x44a07f,{'showHidden':![],'depth':null}));ami[_0xc745('0x4b')](_0xc745('0xaa'),_0x44a07f);break;default:_0x44a07f[_0xc745('0x90')]=!![];_0x44a07f[_0xc745('0x91')]=moment()[_0xc745('0x55')](_0xc745('0x76'));_0x44a07f[_0xc745('0x88')]=moment()[_0xc745('0x55')](_0xc745('0x76'));}_0x44a07f[_0xc745('0x21')]=![];_0x44a07f[_0xc745('0x83')]=null;_0x44a07f[_0xc745('0x54')]=_0x22c8e4[_0xc745('0xab')];this['channels'][_0x22c8e4['uniqueid']]=_0x44a07f;this[_0xc745('0x4a')](_0x44a07f,_0xc745('0x28'));}else if(this[_0xc745('0x5d')](_0x22c8e4[_0xc745('0xa5')])&&this[_0xc745('0x5d')](_0x22c8e4[_0xc745('0xa5')][_0xc745('0xac')])){if(!_0x44a07f[_0xc745('0x21')]){_0x44a07f[_0xc745('0x90')]=!![];_0x44a07f[_0xc745('0x91')]=moment()['format'](_0xc745('0x76'));_0x44a07f[_0xc745('0x54')]='EXITWITHKEY';_0x44a07f[_0xc745('0x88')]=moment()[_0xc745('0x55')](_0xc745('0x76'));this[_0xc745('0x14')][_0x22c8e4[_0xc745('0x4f')]]=_0x44a07f;}}logger[_0xc745('0x7a')](_0xc745('0xad'),_0x22c8e4[_0xc745('0x4f')],_0x44a07f['queue'],_0x44a07f[_0xc745('0x5a')],_['keys'](_0x22c8e4[_0xc745('0xa5')])[0x0],_0x22c8e4[_0xc745('0xab')]);_0x44a07f[_0xc745('0x46')]=this['variables'][_0x22c8e4[_0xc745('0x4f')]];}}}}catch(_0x1d4d7e){logger[_0xc745('0x43')](_0xc745('0xa4'),_0x22c8e4[_0xc745('0x4f')],util[_0xc745('0x45')](_0x1d4d7e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc745('0xae')]=function(_0x38e7be,_0x516b8b,_0x21e1eb){var _0x3cd8f7=[_0xc745('0xaf'),_0xc745('0xb0'),'rtpaudioqosjitter',_0xc745('0xb1'),_0xc745('0xb2'),_0xc745('0xb3'),_0xc745('0xb4'),'rtpaudioqosrttbridged',_0xc745('0xb5'),'sipuri',_0xc745('0xb6'),_0xc745('0xb7'),_0xc745('0xb8'),_0xc745('0xb9'),_0xc745('0xba'),'memberlastcall',_0xc745('0x8f'),_0xc745('0xbb'),_0xc745('0xbc')];if(!_[_0xc745('0xbd')](_0x516b8b)&&!_[_0xc745('0xbe')](_0x3cd8f7,_0x516b8b)){if(_[_0xc745('0x74')](this[_0xc745('0x46')][_0x38e7be])){this[_0xc745('0x46')][_0x38e7be]={};}this[_0xc745('0x46')][_0x38e7be][_0x516b8b]=_0x21e1eb;}};VoiceQueueReport[_0xc745('0xd')][_0xc745('0xbf')]=function(_0x2f45ee,_0x4942d9,_0x102816){var _0x56c555={};for(var _0x492b2a=0x0;_0x492b2a=0x0?moment(_0x39cd86['endtime'])[_0xbe1a('0x1a')](_0x39cd86[_0xbe1a('0x19')],_0xbe1a('0xd')):null,'data1':_0xbe1a('0x1b'),'data2':_0x39cd86['accountcode'],'data3':_0x39cd86[_0xbe1a('0x10')],'data4':_0x39cd86[_0xbe1a('0x1c')]||null,'role':_0xbe1a('0x12'),'internal':_0x39cd86['accountcode']?_['toNumber'](_0x39cd86[_0xbe1a('0x13')]):undefined,'uniqueid':_0x39cd86['uniqueid']},'log':_0xbe1a('0x16')});}; \ No newline at end of file +var _0x08b5=['lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','voice','lastAssignedTo','isNil','interface','TALKING','diff','queuecallerleaveAt','seconds','exten','queue','accountcode','CreateMemberReport','voiceDialReport','Request','endtime','starttime','dialstring','agent','toNumber','moment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x08b5,0x1b9));var _0x508b=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x08b5[_0x55e08b];return _0xd1a7ff;};'use strict';var moment=require(_0x508b('0x0'));var _=require(_0x508b('0x1'));var util=require(_0x508b('0x2'));var client=require(_0x508b('0x3'));exports[_0x508b('0x4')]=function(_0x24c483){var _0xa4e7bd=_0x24c483[_0x508b('0x5')]||_0x24c483[_0x508b('0x6')];return client['Request']('CreateMemberReport',{'body':{'channel':_0x508b('0x7'),'membername':_0x24c483[_0x508b('0x8')],'interface':_[_0x508b('0x9')](_0x24c483[_0x508b('0xa')])?util['format']('SIP/%s',_0x24c483[_0x508b('0x8')]):_0x24c483[_0x508b('0xa')],'type':_0x508b('0xb'),'enterAt':_0x24c483['queuecallerleaveAt'],'exitAt':_0xa4e7bd,'duration':moment(_0xa4e7bd)[_0x508b('0xc')](_0x24c483[_0x508b('0xd')],_0x508b('0xe')),'data1':'inbound','data2':_0x24c483['calleridnum'],'data3':_0x24c483[_0x508b('0xf')],'data4':null,'data5':_0x24c483[_0x508b('0x10')],'role':'agent','internal':_0x24c483[_0x508b('0x11')]?_['toNumber'](_0x24c483[_0x508b('0x11')]):undefined,'uniqueid':_0x24c483['uniqueid']},'log':_0x508b('0x12')});};exports[_0x508b('0x13')]=function(_0x33f946){return client[_0x508b('0x14')](_0x508b('0x12'),{'body':{'channel':_0x508b('0x7'),'membername':_0x33f946['membername'],'interface':_0x33f946[_0x508b('0xa')],'type':_0x508b('0xb'),'enterAt':_0x33f946['starttime'],'exitAt':_0x33f946['endtime'],'duration':moment(_0x33f946[_0x508b('0x15')])[_0x508b('0xc')](_0x33f946['starttime'],_0x508b('0xe'))>=0x0?moment(_0x33f946[_0x508b('0x15')])[_0x508b('0xc')](_0x33f946[_0x508b('0x16')],'seconds'):null,'data1':'outbound','data2':_0x33f946['accountcode'],'data3':_0x33f946[_0x508b('0xf')],'data4':_0x33f946[_0x508b('0x17')]||null,'role':_0x508b('0x18'),'internal':_0x33f946[_0x508b('0x11')]?_[_0x508b('0x19')](_0x33f946[_0x508b('0x11')]):undefined,'uniqueid':_0x33f946['uniqueid']},'log':_0x508b('0x12')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 086ba2b..ebfa66d 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33e5=['getSettings','Request','stopRecordingOnTransfer','GetSettings','../client'];(function(_0x5007c9,_0x4d369d){var _0x205b29=function(_0x17ef84){while(--_0x17ef84){_0x5007c9['push'](_0x5007c9['shift']());}};_0x205b29(++_0x4d369d);}(_0x33e5,0x13a));var _0x533e=function(_0x1312bb,_0x3d8d4f){_0x1312bb=_0x1312bb-0x0;var _0x1e801a=_0x33e5[_0x1312bb];return _0x1e801a;};'use strict';var client=require(_0x533e('0x0'));exports[_0x533e('0x1')]=function(){return client[_0x533e('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x533e('0x3'),'previewRecallmeReminderInterval']},'log':_0x533e('0x4')});}; \ No newline at end of file +var _0x41dd=['Request','ShowSetting','previewRecallmeReminderInterval','GetSettings','../client'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0x41dd,0x121));var _0xd41d=function(_0x511e12,_0x57d469){_0x511e12=_0x511e12-0x0;var _0x403ae2=_0x41dd[_0x511e12];return _0x403ae2;};'use strict';var client=require(_0xd41d('0x0'));exports['getSettings']=function(){return client[_0xd41d('0x1')](_0xd41d('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0xd41d('0x3')]},'log':_0xd41d('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index b61dda2..bac9c96 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 _0x0f6d=['../client','getTemplates','Request','GetTemplate'];(function(_0x2f3ecd,_0x57976b){var _0xffdc44=function(_0xf21bc6){while(--_0xf21bc6){_0x2f3ecd['push'](_0x2f3ecd['shift']());}};_0xffdc44(++_0x57976b);}(_0x0f6d,0x180));var _0xd0f6=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0x0f6d[_0x3474ac];return _0x5345ec;};'use strict';var client=require(_0xd0f6('0x0'));exports[_0xd0f6('0x1')]=function(_0xe28cc1){return function(_0x158328){return client[_0xd0f6('0x2')](_0xd0f6('0x3'),{'options':{'raw':!![],'attributes':['id','name','html']},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xedc7=['../client','getTemplates','Request','GetTemplate'];(function(_0x2fb6ed,_0x4c15ae){var _0x33d70c=function(_0x84d461){while(--_0x84d461){_0x2fb6ed['push'](_0x2fb6ed['shift']());}};_0x33d70c(++_0x4c15ae);}(_0xedc7,0x1f4));var _0x7edc=function(_0x1e6851,_0x30b56b){_0x1e6851=_0x1e6851-0x0;var _0x2112a2=_0xedc7[_0x1e6851];return _0x2112a2;};'use strict';var client=require(_0x7edc('0x0'));exports[_0x7edc('0x1')]=function(_0x22fb92){return function(_0x154ef2){return client[_0x7edc('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id','name','html']},'log':_0x7edc('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index ee5ae7f..ba184ec 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 _0xdd22=['data4','data5','data6','GetTrigger','../client','getTriggers','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data2','data3'];(function(_0x2851a6,_0x4f01ab){var _0x497c2b=function(_0x5334fb){while(--_0x5334fb){_0x2851a6['push'](_0x2851a6['shift']());}};_0x497c2b(++_0x4f01ab);}(_0xdd22,0x144));var _0x2dd2=function(_0x545412,_0x2084e0){_0x545412=_0x545412-0x0;var _0x21a9dc=_0xdd22[_0x545412];return _0x21a9dc;};'use strict';var client=require(_0x2dd2('0x0'));exports[_0x2dd2('0x1')]=function(_0x3edce2){return function(_0x497814){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x2dd2('0x2'),_0x2dd2('0x3'),_0x2dd2('0x4')],'include':[{'model':_0x2dd2('0x5'),'as':_0x2dd2('0x6'),'attributes':['id',_0x2dd2('0x7'),_0x2dd2('0x8'),_0x2dd2('0x9')]},{'model':_0x2dd2('0x5'),'as':_0x2dd2('0xa'),'attributes':['id','field',_0x2dd2('0x8'),'value']},{'model':_0x2dd2('0xb'),'as':_0x2dd2('0xc'),'attributes':['id',_0x2dd2('0xd'),'data1',_0x2dd2('0xe'),_0x2dd2('0xf'),_0x2dd2('0x10'),_0x2dd2('0x11'),_0x2dd2('0x12'),'data7']}]},'log':_0x2dd2('0x13')});};}; \ No newline at end of file +var _0xed4e=['data7','GetTrigger','name','channel','status','field','Condition','operator','value','Action','Actions','action','data2','data3','data5','data6'];(function(_0x1ea19c,_0x499bb5){var _0x387142=function(_0x1c69b6){while(--_0x1c69b6){_0x1ea19c['push'](_0x1ea19c['shift']());}};_0x387142(++_0x499bb5);}(_0xed4e,0x111));var _0xeed4=function(_0x4fe693,_0x4cf2ba){_0x4fe693=_0x4fe693-0x0;var _0x4dde2a=_0xed4e[_0x4fe693];return _0x4dde2a;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x12694a){return function(_0x1125c0){return client['Request'](_0xeed4('0x0'),{'options':{'raw':![],'attributes':['id',_0xeed4('0x1'),_0xeed4('0x2'),_0xeed4('0x3')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0xeed4('0x4'),'operator','value']},{'model':_0xeed4('0x5'),'as':'AnyConditions','attributes':['id',_0xeed4('0x4'),_0xeed4('0x6'),_0xeed4('0x7')]},{'model':_0xeed4('0x8'),'as':_0xeed4('0x9'),'attributes':['id',_0xeed4('0xa'),'data1',_0xeed4('0xb'),_0xeed4('0xc'),'data4',_0xeed4('0xd'),_0xeed4('0xe'),_0xeed4('0xf')]}]},'log':_0xeed4('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index a56fa2a..c0e73dd 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 _0x640c=['GetTrunk','getTrunks','Request','name','registry','defaultuser'];(function(_0x17149f,_0x3ed207){var _0x1cef36=function(_0x2d3320){while(--_0x2d3320){_0x17149f['push'](_0x17149f['shift']());}};_0x1cef36(++_0x3ed207);}(_0x640c,0x16f));var _0xc640=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0x640c[_0x3718b7];return _0xf8c91e;};'use strict';var client=require('../client');exports[_0xc640('0x0')]=function(_0x3acd67){return function(_0x5df696){return client[_0xc640('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xc640('0x2'),_0xc640('0x3'),_0xc640('0x4')]},'log':_0xc640('0x5')});};}; \ No newline at end of file +var _0xa02e=['defaultuser','getTrunks','Request','GetTrunk','name','registry'];(function(_0xb8f98c,_0x21e9b8){var _0x1f8481=function(_0x2e1bcf){while(--_0x2e1bcf){_0xb8f98c['push'](_0xb8f98c['shift']());}};_0x1f8481(++_0x21e9b8);}(_0xa02e,0xa3));var _0xea02=function(_0x161c4c,_0x13b0de){_0x161c4c=_0x161c4c-0x0;var _0x439c85=_0xa02e[_0x161c4c];return _0x439c85;};'use strict';var client=require('../client');exports[_0xea02('0x0')]=function(_0x494f1a){return function(_0x25ba0c){return client[_0xea02('0x1')](_0xea02('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xea02('0x3'),_0xea02('0x4'),_0xea02('0x5')]},'log':_0xea02('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 52b97af..aa2f1cb 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 _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe706,0xa3));var _0x6e70=function(_0x21dd50,_0x921f70){_0x21dd50=_0x21dd50-0x0;var _0x1b7d5e=_0xe706[_0x21dd50];return _0x1b7d5e;};'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 +var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 2b5c9cb..d9a70f3 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 _0x7f06=['update','UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0x7f06,0x1dd));var _0x67f0=function(_0x46f2a5,_0x598e7f){_0x46f2a5=_0x46f2a5-0x0;var _0x42af39=_0x7f06[_0x46f2a5];return _0x42af39;};'use strict';var client=require(_0x67f0('0x0'));exports['create']=function(_0x6aa451){return client[_0x67f0('0x1')](_0x67f0('0x2'),{'body':_0x6aa451,'log':'CreateVoiceAgentReport'});};exports[_0x67f0('0x3')]=function(_0x39997f,_0x35a301,_0x537613){return client[_0x67f0('0x1')](_0x67f0('0x4'),{'body':_0x39997f,'options':{'where':{'uniqueid':_0x35a301,'interface':_0x537613,'agentcomplete':!![]}},'log':_0x67f0('0x4')});}; \ No newline at end of file +var _0xab39=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x93942f,_0xb48547){var _0x23fcd8=function(_0x4728be){while(--_0x4728be){_0x93942f['push'](_0x93942f['shift']());}};_0x23fcd8(++_0xb48547);}(_0xab39,0xab));var _0x9ab3=function(_0x24ae83,_0x5eb46b){_0x24ae83=_0x24ae83-0x0;var _0x246714=_0xab39[_0x24ae83];return _0x246714;};'use strict';var client=require(_0x9ab3('0x0'));exports[_0x9ab3('0x1')]=function(_0x14337a){return client[_0x9ab3('0x2')](_0x9ab3('0x3'),{'body':_0x14337a,'log':_0x9ab3('0x3')});};exports[_0x9ab3('0x4')]=function(_0x43ac4c,_0x225c6e,_0x52cf89){return client[_0x9ab3('0x2')](_0x9ab3('0x5'),{'body':_0x43ac4c,'options':{'where':{'uniqueid':_0x225c6e,'interface':_0x52cf89,'agentcomplete':!![]}},'log':_0x9ab3('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index dd9ba38..79f2915 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 _0xa244=['merge','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','GetVoiceCallReports','lodash','create','Request'];(function(_0x433f47,_0x421906){var _0x5621b9=function(_0x2ce4a5){while(--_0x2ce4a5){_0x433f47['push'](_0x433f47['shift']());}};_0x5621b9(++_0x421906);}(_0xa244,0xcf));var _0x4a24=function(_0x1064b8,_0x32e8ac){_0x1064b8=_0x1064b8-0x0;var _0x4a53bd=_0xa244[_0x1064b8];return _0x4a53bd;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0x4a24('0x0'));var client=require('../client');exports[_0x4a24('0x1')]=function(_0x5cfd1d){return client[_0x4a24('0x2')]('CreateVoiceCallReport',{'body':_[_0x4a24('0x3')](_0x5cfd1d,{'source':_0x5cfd1d[_0x4a24('0x4')],'destinationcontext':_0x5cfd1d[_0x4a24('0x5')],'callerid':_0x5cfd1d[_0x4a24('0x6')],'amaflags':_0x4a24('0x7')}),'log':_0x4a24('0x8')});};exports[_0x4a24('0x9')]=function(){return function(){return client['Request'](_0x4a24('0xa'),{'options':{'where':{'type':[_0x4a24('0xb')],'createdAt':{'$between':[moment()[_0x4a24('0xc')](_0x4a24('0xd'))[_0x4a24('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x4a24('0xf')](_0x4a24('0xd'))[_0x4a24('0xe')](_0x4a24('0x10'))]}},'attributes':['type',_0x4a24('0x11'),_0x4a24('0x12'),_0x4a24('0x13')]},'log':_0x4a24('0x14')});};}; \ No newline at end of file +var _0xcae5=['billableseconds','GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type'];(function(_0x5a3788,_0x152638){var _0x346b8b=function(_0x5dc4cf){while(--_0x5dc4cf){_0x5a3788['push'](_0x5a3788['shift']());}};_0x346b8b(++_0x152638);}(_0xcae5,0x14c));var _0x5cae=function(_0x13f068,_0x3c080f){_0x13f068=_0x13f068-0x0;var _0x343a81=_0xcae5[_0x13f068];return _0x343a81;};'use strict';var moment=require(_0x5cae('0x0'));var util=require('util');var _=require(_0x5cae('0x1'));var client=require(_0x5cae('0x2'));exports[_0x5cae('0x3')]=function(_0x42a971){return client[_0x5cae('0x4')](_0x5cae('0x5'),{'body':_[_0x5cae('0x6')](_0x42a971,{'source':_0x42a971[_0x5cae('0x7')],'destinationcontext':_0x42a971[_0x5cae('0x8')],'callerid':_0x42a971[_0x5cae('0x9')],'amaflags':_0x5cae('0xa')}),'log':_0x5cae('0x5')});};exports[_0x5cae('0xb')]=function(){return function(){return client['Request'](_0x5cae('0xc'),{'options':{'where':{'type':[_0x5cae('0xd')],'createdAt':{'$between':[moment()[_0x5cae('0xe')](_0x5cae('0xf'))[_0x5cae('0x10')](_0x5cae('0x11')),moment()[_0x5cae('0x12')](_0x5cae('0xf'))[_0x5cae('0x10')](_0x5cae('0x11'))]}},'attributes':[_0x5cae('0x13'),'disposition','duration',_0x5cae('0x14')]},'log':_0x5cae('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index a611c77..1853250 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 _0x43eb=['CreateVoiceDialReport','../client','create'];(function(_0x36c967,_0x4c6016){var _0x3427ad=function(_0x535aab){while(--_0x535aab){_0x36c967['push'](_0x36c967['shift']());}};_0x3427ad(++_0x4c6016);}(_0x43eb,0x97));var _0xb43e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x43eb[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xb43e('0x0'));exports[_0xb43e('0x1')]=function(_0x3348b6){return client['Request'](_0xb43e('0x2'),{'body':_0x3348b6,'log':_0xb43e('0x2')});}; \ No newline at end of file +var _0x38e6=['CreateVoiceDialReport','../client','Request'];(function(_0x3e6682,_0x119501){var _0x3eacaf=function(_0x203ab0){while(--_0x203ab0){_0x3e6682['push'](_0x3e6682['shift']());}};_0x3eacaf(++_0x119501);}(_0x38e6,0x1de));var _0x638e=function(_0x4acb9d,_0x28894b){_0x4acb9d=_0x4acb9d-0x0;var _0x252ccb=_0x38e6[_0x4acb9d];return _0x252ccb;};'use strict';var client=require(_0x638e('0x0'));exports['create']=function(_0x1621d0){return client[_0x638e('0x1')](_0x638e('0x2'),{'body':_0x1621d0,'log':_0x638e('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 6f82452..3500370 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 _0x94d2=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x3ea850,_0x2bc845){var _0x12fb9c=function(_0x4aca15){while(--_0x4aca15){_0x3ea850['push'](_0x3ea850['shift']());}};_0x12fb9c(++_0x2bc845);}(_0x94d2,0x1cd));var _0x294d=function(_0x1c5142,_0x30ea72){_0x1c5142=_0x1c5142-0x0;var _0x1268cb=_0x94d2[_0x1c5142];return _0x1268cb;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x294d('0x0')](_0x294d('0x1'),{'options':{'raw':!![],'attributes':['id',_0x294d('0x2'),_0x294d('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x294d('0x4')});};}; \ No newline at end of file +var _0xd4b6=['getVoiceExtensions','GetVoiceExtension','exten','../client'];(function(_0x1bd9cf,_0x467047){var _0x558530=function(_0x23d9c3){while(--_0x23d9c3){_0x1bd9cf['push'](_0x1bd9cf['shift']());}};_0x558530(++_0x467047);}(_0xd4b6,0x13f));var _0x6d4b=function(_0xca740b,_0x115836){_0xca740b=_0xca740b-0x0;var _0x505a48=_0xd4b6[_0xca740b];return _0x505a48;};'use strict';var client=require(_0x6d4b('0x0'));exports[_0x6d4b('0x1')]=function(){return function(){return client['Request'](_0x6d4b('0x2'),{'options':{'raw':!![],'attributes':['id',_0x6d4b('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x6d4b('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 1b2ed33..931e9a1 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 _0x27b9=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','active','Pause','mandatoryDispositionPause','name','callerid','Interval','interval','getVoiceQueues','../client','Request','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry'];(function(_0x9fc7e9,_0x5288d8){var _0x3f82f7=function(_0x3d253b){while(--_0x3d253b){_0x9fc7e9['push'](_0x9fc7e9['shift']());}};_0x3f82f7(++_0x5288d8);}(_0x27b9,0x119));var _0x927b=function(_0x224ee1,_0x3361bc){_0x224ee1=_0x224ee1-0x0;var _0xa84cef=_0x27b9[_0x224ee1];return _0xa84cef;};'use strict';var client=require(_0x927b('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x927b('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name',_0x927b('0x2'),'acwTimeout',_0x927b('0x3'),_0x927b('0x4'),_0x927b('0x5'),_0x927b('0x6'),_0x927b('0x7'),_0x927b('0x8'),'dialLimitQueue',_0x927b('0x9'),_0x927b('0xa'),_0x927b('0xb'),_0x927b('0xc'),_0x927b('0xd'),'dialOriginateCallerIdNumber',_0x927b('0xe'),'dialQueueOptions','dialQueueTimeout',_0x927b('0xf'),_0x927b('0x10'),_0x927b('0x11'),_0x927b('0x12'),'dialBusyRetryFrequency',_0x927b('0x13'),_0x927b('0x14'),_0x927b('0x15'),_0x927b('0x16'),'dialGlobalInterval',_0x927b('0x17'),'dialCheckDuplicateType',_0x927b('0x18'),_0x927b('0x19'),_0x927b('0x1a'),_0x927b('0x1b'),_0x927b('0x1c'),_0x927b('0x1d'),_0x927b('0x1e'),_0x927b('0x1f'),_0x927b('0x20'),_0x927b('0x21'),_0x927b('0x22'),'dialRecallMeTimeout',_0x927b('0x23'),_0x927b('0x24'),_0x927b('0x25'),_0x927b('0x26'),_0x927b('0x27'),_0x927b('0x4'),_0x927b('0x28'),'dialRandomLastDigitCallerIdNumber',_0x927b('0x29'),'dialNoSuchNumberMaxRetry',_0x927b('0x2a'),_0x927b('0x2b'),'dialDropRetryFrequency',_0x927b('0x2c'),'dialAbandonedRetryFrequency',_0x927b('0x2d'),_0x927b('0x2e'),'dialAgentRejectMaxRetry',_0x927b('0x2f'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0x927b('0x30'),_0x927b('0x31'),_0x927b('0x32')],'include':[{'model':_0x927b('0x33'),'as':_0x927b('0x33'),'attributes':['id','name','callerid',_0x927b('0x34')]},{'model':_0x927b('0x35'),'as':_0x927b('0x36'),'attributes':['id',_0x927b('0x37')]},{'model':_0x927b('0x33'),'as':'TrunkBackup','attributes':['id',_0x927b('0x37'),_0x927b('0x38'),_0x927b('0x34')]},{'model':_0x927b('0x39'),'as':'Interval','attributes':['id',_0x927b('0x37')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x927b('0x37'),_0x927b('0x3a')]}]}]},'log':_0x927b('0x3b')});};}; \ No newline at end of file +var _0x4c95=['dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency'];(function(_0x3bbde7,_0x344127){var _0x117992=function(_0x1d0170){while(--_0x1d0170){_0x3bbde7['push'](_0x3bbde7['shift']());}};_0x117992(++_0x344127);}(_0x4c95,0x180));var _0x54c9=function(_0x10056c,_0x45dcef){_0x10056c=_0x10056c-0x0;var _0x2eacd5=_0x4c95[_0x10056c];return _0x2eacd5;};'use strict';var client=require(_0x54c9('0x0'));exports[_0x54c9('0x1')]=function(){return function(){return client[_0x54c9('0x2')](_0x54c9('0x3'),{'options':{'raw':![],'attributes':['id',_0x54c9('0x4'),_0x54c9('0x5'),_0x54c9('0x6'),_0x54c9('0x7'),_0x54c9('0x8'),_0x54c9('0x9'),'dialActive',_0x54c9('0xa'),'dialLimitChannel','dialLimitQueue',_0x54c9('0xb'),_0x54c9('0xc'),_0x54c9('0xd'),_0x54c9('0xe'),_0x54c9('0xf'),_0x54c9('0x10'),_0x54c9('0x11'),'dialQueueOptions','dialQueueTimeout',_0x54c9('0x12'),_0x54c9('0x13'),_0x54c9('0x14'),_0x54c9('0x15'),_0x54c9('0x16'),'dialNoAnswerMaxRetry',_0x54c9('0x17'),_0x54c9('0x18'),_0x54c9('0x19'),_0x54c9('0x1a'),_0x54c9('0x1b'),_0x54c9('0x1c'),_0x54c9('0x1d'),'dialAMDInitialSilence',_0x54c9('0x1e'),_0x54c9('0x1f'),_0x54c9('0x20'),_0x54c9('0x21'),_0x54c9('0x22'),_0x54c9('0x23'),_0x54c9('0x24'),_0x54c9('0x25'),_0x54c9('0x26'),_0x54c9('0x27'),'dialRecallInQueue',_0x54c9('0x28'),_0x54c9('0x29'),_0x54c9('0x2a'),_0x54c9('0x2b'),'monitor_format',_0x54c9('0x2c'),_0x54c9('0x2d'),_0x54c9('0x2e'),'dialNoSuchNumberMaxRetry',_0x54c9('0x2f'),_0x54c9('0x30'),_0x54c9('0x31'),_0x54c9('0x32'),_0x54c9('0x33'),'dialMachineMaxRetry',_0x54c9('0x34'),_0x54c9('0x35'),_0x54c9('0x36'),_0x54c9('0x37'),_0x54c9('0x38'),_0x54c9('0x39'),_0x54c9('0x3a'),_0x54c9('0x3b')],'include':[{'model':_0x54c9('0x3c'),'as':_0x54c9('0x3c'),'attributes':['id',_0x54c9('0x4'),'callerid',_0x54c9('0x3d')]},{'model':_0x54c9('0x3e'),'as':_0x54c9('0x3f'),'attributes':['id',_0x54c9('0x4')]},{'model':_0x54c9('0x3c'),'as':_0x54c9('0x40'),'attributes':['id',_0x54c9('0x4'),'callerid','active']},{'model':'Interval','as':'Interval','attributes':['id',_0x54c9('0x4')],'include':[{'model':_0x54c9('0x41'),'as':_0x54c9('0x42'),'attributes':['id',_0x54c9('0x4'),_0x54c9('0x43')]}]}]},'log':_0x54c9('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 9f1113a..3c44af8 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(_0x529a88,_0x61025d){var _0x1815a3=function(_0x2515b1){while(--_0x2515b1){_0x529a88['push'](_0x529a88['shift']());}};_0x1815a3(++_0x61025d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x5ac32a,_0x355e52){var _0x2a4d98=function(_0x271524){while(--_0x271524){_0x5ac32a['push'](_0x5ac32a['shift']());}};_0x2a4d98(++_0x355e52);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 50d8d30..b9e36a6 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 _0xa535=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x535deb,_0x2eafba){var _0x23eb96=function(_0x2c0027){while(--_0x2c0027){_0x535deb['push'](_0x535deb['shift']());}};_0x23eb96(++_0x2eafba);}(_0xa535,0xde));var _0x5a53=function(_0x15ed50,_0x3422e6){_0x15ed50=_0x15ed50-0x0;var _0x55956b=_0xa535[_0x15ed50];return _0x55956b;};'use strict';var client=require(_0x5a53('0x0'));exports[_0x5a53('0x1')]=function(_0x22a7e2){return function(){return client[_0x5a53('0x2')](_0x5a53('0x3'),{'options':{'where':{'VoiceQueueId':_0x22a7e2,'paused':!![]},'raw':!![]},'log':_0x5a53('0x1')});};}; \ No newline at end of file +var _0x47e5=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client'];(function(_0x7424a7,_0x4f60b1){var _0x329b3d=function(_0x5687ce){while(--_0x5687ce){_0x7424a7['push'](_0x7424a7['shift']());}};_0x329b3d(++_0x4f60b1);}(_0x47e5,0x1cb));var _0x547e=function(_0x1017c3,_0x7127ba){_0x1017c3=_0x1017c3-0x0;var _0x335335=_0x47e5[_0x1017c3];return _0x335335;};'use strict';var client=require(_0x547e('0x0'));exports['getVoiceQueueRtPauses']=function(_0x574735){return function(){return client[_0x547e('0x1')](_0x547e('0x2'),{'options':{'where':{'VoiceQueueId':_0x574735,'paused':!![]},'raw':!![]},'log':_0x547e('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 8201451..898d2dc 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x1313f0,_0xc42e1f){var _0x129a4e=function(_0x22a4d0){while(--_0x22a4d0){_0x1313f0['push'](_0x1313f0['shift']());}};_0x129a4e(++_0xc42e1f);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x528a25,_0x2cc5ed){var _0x439591=function(_0x4cdfc7){while(--_0x4cdfc7){_0x528a25['push'](_0x528a25['shift']());}};_0x439591(++_0x2cc5ed);}(_0x7a54,0x106));var _0x47a5=function(_0x31359c,_0x56ab5d){_0x31359c=_0x31359c-0x0;var _0x815d22=_0x7a54[_0x31359c];return _0x815d22;};'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 de12f4a..a8e3c4e 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 _0x21bd=['transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereecontext','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridname','transfertargetcontext','origtransferercontext','attended','transfers','result','transfererconnectedlinenum'];(function(_0x1fa26c,_0x58f406){var _0x2e72f9=function(_0x3ec8bc){while(--_0x3ec8bc){_0x1fa26c['push'](_0x1fa26c['shift']());}};_0x2e72f9(++_0x58f406);}(_0x21bd,0x142));var _0xd21b=function(_0x57a75e,_0xae02cf){_0x57a75e=_0x57a75e-0x0;var _0x16e670=_0x21bd[_0x57a75e];return _0x16e670;};'use strict';var client=require('../client');exports[_0xd21b('0x0')]={};exports['blindTransfer']=function(_0x21b39a){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x21b39a[_0xd21b('0x1')],'transfererchannel':_0x21b39a['transfererchannel'],'transferercalleridnum':_0x21b39a['transferercalleridnum'],'transferercalleridname':_0x21b39a['transferercalleridname'],'transfererconnectedlinenum':_0x21b39a[_0xd21b('0x2')],'transfererconnectedlinename':_0x21b39a['transfererconnectedlinename'],'transfereraccountcode':_0x21b39a['transfereraccountcode'],'transferercontext':_0x21b39a['transferercontext'],'transfererexten':_0x21b39a['transfererexten'],'transfererlinkedid':_0x21b39a[_0xd21b('0x3')],'transfereechannel':_0x21b39a['transfereechannel'],'transfereecalleridnum':_0x21b39a[_0xd21b('0x4')],'transfereecalleridname':_0x21b39a[_0xd21b('0x5')],'transfereeconnectedlinenum':_0x21b39a[_0xd21b('0x6')],'transfereeconnectedlinename':_0x21b39a['transfereeconnectedlinename'],'transfereeaccountcode':_0x21b39a['transfereeaccountcode'],'transfereecontext':_0x21b39a[_0xd21b('0x7')],'transfereeexten':_0x21b39a['transfereeexten'],'transfereelinkedid':_0x21b39a[_0xd21b('0x8')],'isexternal':_0x21b39a[_0xd21b('0x9')],'context':_0x21b39a[_0xd21b('0xa')],'extension':_0x21b39a[_0xd21b('0xb')],'type':_0xd21b('0xc')},'log':_0xd21b('0xd')});};exports[_0xd21b('0xe')]=function(_0x187c96){return client['Request'](_0xd21b('0xd'),{'body':{'result':_0x187c96['result'],'transfererchannel':_0x187c96[_0xd21b('0xf')],'transferercalleridnum':_0x187c96['origtransferercalleridnum'],'transferercalleridname':_0x187c96[_0xd21b('0x10')],'transfererconnectedlinenum':_0x187c96[_0xd21b('0x11')],'transfererconnectedlinename':_0x187c96['secondtransfererconnectedlinename'],'transfereraccountcode':_0x187c96[_0xd21b('0x12')],'transferercontext':_0x187c96['secondtransferercontext'],'transfererexten':_0x187c96[_0xd21b('0x13')],'transfererlinkedid':_0x187c96[_0xd21b('0x14')],'transfereechannel':_0x187c96['transfertargetchannel'],'transfereecalleridnum':_0x187c96['transfertargetcalleridnum'],'transfereecalleridname':_0x187c96[_0xd21b('0x15')],'transfereeconnectedlinenum':_0x187c96['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x187c96['transfertargetconnectedlinename'],'transfereeaccountcode':_0x187c96['transfertargetaccountcode'],'transfereecontext':_0x187c96[_0xd21b('0x16')],'transfereeexten':_0x187c96['transfertargetexten'],'transfereelinkedid':_0x187c96['transfertargetlinkedid'],'isexternal':_0x187c96['isexternal'],'context':_0x187c96[_0xd21b('0x17')],'extension':_0x187c96['origtransfererexten'],'type':_0xd21b('0x18')},'log':_0xd21b('0xd')});}; \ No newline at end of file +var _0x39a0=['transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','CreateVoiceTransferReport','transfererchannel','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','Request','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum'];(function(_0x8c3008,_0x34e0b4){var _0x387b5d=function(_0x5c7116){while(--_0x5c7116){_0x8c3008['push'](_0x8c3008['shift']());}};_0x387b5d(++_0x34e0b4);}(_0x39a0,0x14f));var _0x039a=function(_0x461d7d,_0x2068c6){_0x461d7d=_0x461d7d-0x0;var _0x3f77c6=_0x39a0[_0x461d7d];return _0x3f77c6;};'use strict';var client=require(_0x039a('0x0'));exports['transfers']={};exports['blindTransfer']=function(_0x29f4e2){return client['Request'](_0x039a('0x1'),{'body':{'result':_0x29f4e2['result'],'transfererchannel':_0x29f4e2[_0x039a('0x2')],'transferercalleridnum':_0x29f4e2['transferercalleridnum'],'transferercalleridname':_0x29f4e2['transferercalleridname'],'transfererconnectedlinenum':_0x29f4e2[_0x039a('0x3')],'transfererconnectedlinename':_0x29f4e2['transfererconnectedlinename'],'transfereraccountcode':_0x29f4e2[_0x039a('0x4')],'transferercontext':_0x29f4e2[_0x039a('0x5')],'transfererexten':_0x29f4e2[_0x039a('0x6')],'transfererlinkedid':_0x29f4e2[_0x039a('0x7')],'transfereechannel':_0x29f4e2['transfereechannel'],'transfereecalleridnum':_0x29f4e2[_0x039a('0x8')],'transfereecalleridname':_0x29f4e2[_0x039a('0x9')],'transfereeconnectedlinenum':_0x29f4e2[_0x039a('0xa')],'transfereeconnectedlinename':_0x29f4e2[_0x039a('0xb')],'transfereeaccountcode':_0x29f4e2[_0x039a('0xc')],'transfereecontext':_0x29f4e2[_0x039a('0xd')],'transfereeexten':_0x29f4e2[_0x039a('0xe')],'transfereelinkedid':_0x29f4e2[_0x039a('0xf')],'isexternal':_0x29f4e2[_0x039a('0x10')],'context':_0x29f4e2[_0x039a('0x11')],'extension':_0x29f4e2[_0x039a('0x12')],'type':_0x039a('0x13')},'log':_0x039a('0x1')});};exports[_0x039a('0x14')]=function(_0x14d00a){return client[_0x039a('0x15')](_0x039a('0x1'),{'body':{'result':_0x14d00a[_0x039a('0x16')],'transfererchannel':_0x14d00a[_0x039a('0x17')],'transferercalleridnum':_0x14d00a[_0x039a('0x18')],'transferercalleridname':_0x14d00a[_0x039a('0x19')],'transfererconnectedlinenum':_0x14d00a[_0x039a('0x1a')],'transfererconnectedlinename':_0x14d00a['secondtransfererconnectedlinename'],'transfereraccountcode':_0x14d00a['origtransfereraccountcode'],'transferercontext':_0x14d00a[_0x039a('0x1b')],'transfererexten':_0x14d00a[_0x039a('0x1c')],'transfererlinkedid':_0x14d00a[_0x039a('0x1d')],'transfereechannel':_0x14d00a[_0x039a('0x1e')],'transfereecalleridnum':_0x14d00a[_0x039a('0x1f')],'transfereecalleridname':_0x14d00a[_0x039a('0x20')],'transfereeconnectedlinenum':_0x14d00a[_0x039a('0x21')],'transfereeconnectedlinename':_0x14d00a[_0x039a('0x22')],'transfereeaccountcode':_0x14d00a['transfertargetaccountcode'],'transfereecontext':_0x14d00a[_0x039a('0x23')],'transfereeexten':_0x14d00a[_0x039a('0x24')],'transfereelinkedid':_0x14d00a[_0x039a('0x25')],'isexternal':_0x14d00a[_0x039a('0x10')],'context':_0x14d00a[_0x039a('0x26')],'extension':_0x14d00a[_0x039a('0x27')],'type':_0x039a('0x28')},'log':_0x039a('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 80abd95..8e856d6 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 _0x56e7=['type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','Channel\x20doesn\x27t\x20exist','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','jayson/promise','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','agents','QueuePause','isConnected','error','username','ami\x20disconnected','join','reload','module','action','Reload','Action','then','message','catch','asterisk','pick','command','Command','content','voiceQueues','length','find','omit','undefined','values','channels','voicechannel','validate','map','uniqueid','channel','%s.%s','filename','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','resolve','StopMixMonitor','destinationchannel','wav','stop','queueChannels'];(function(_0x26391d,_0x4cb9e0){var _0x320049=function(_0x578da8){while(--_0x578da8){_0x26391d['push'](_0x26391d['shift']());}};_0x320049(++_0x4cb9e0);}(_0x56e7,0x7b));var _0x756e=function(_0x230b8d,_0x54958c){_0x230b8d=_0x230b8d-0x0;var _0x4d30bd=_0x56e7[_0x230b8d];return _0x4d30bd;};'use strict';var _=require('lodash');var util=require(_0x756e('0x0'));var jayson=require(_0x756e('0x1'));var schema=require('validate');var moment=require(_0x756e('0x2'));var config=require(_0x756e('0x3'));var properties=require(_0x756e('0x4'));var ami=require(_0x756e('0x5'));var VoiceQueueSummary=require(_0x756e('0x6'));exports[_0x756e('0x7')]=function(_0x446fff,_0x538050,_0x3b3b8f){return new Promise(function(_0x404189,_0x26519d){var _0xcf58ec={'QueuePause':function(_0x5c8589){return new Promise(function(_0x1c6a22){var _0x5c2db4=util[_0x756e('0x8')](_0x756e('0x9'),_0x756e('0xa'),_0x5c8589[_0x756e('0xb')]);if(_0x446fff['timers']&&_0x446fff['timers'][_0x5c2db4]&&_0x446fff[_0x756e('0xc')][_0x5c2db4][_0x756e('0xd')]){_0x446fff[_0x756e('0xc')][_0x5c2db4]['updateAcw']();}if(_0x446fff[_0x756e('0xe')][_0x5c2db4]){_0x446fff[_0x756e('0xe')][_0x5c2db4]['updateStatusRealtime']({'statePause':_0x5c8589['pause']?!![]:![]});}_0x1c6a22({'code':0xc8,'message':_0x756e('0xf')});});},'Reload':function(_0x569e8f){var _0x459237=this;return new Promise(function(_0x21701a,_0x38d5e9){if(ami[_0x756e('0x10')]()==![]){return _0x38d5e9(_0x459237[_0x756e('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x756e('0x12')],_0x756e('0x13')][_0x756e('0x14')]('\x20')));}_0x569e8f=_['pick'](_0x569e8f,_['keys'](properties[_0x756e('0x15')][_0x756e('0x16')]));_0x569e8f[_0x756e('0x17')]=_0x756e('0x18');return ami[_0x756e('0x19')](_0x569e8f)[_0x756e('0x1a')](function(_0x124ac0){_0x21701a({'code':0xc8,'message':_0x124ac0[_0x756e('0x1b')]});})[_0x756e('0x1c')](function(_0x4da91f){_0x38d5e9(_0x459237[_0x756e('0x11')](0x1f5,_0x4da91f['message']));});});},'Command':function(_0x4d7581){var _0x157be3=this;return new Promise(function(_0x28872e,_0x30bc11){if(ami[_0x756e('0x10')]()==![]){return _0x30bc11(_0x157be3[_0x756e('0x11')](0x1f4,[config[_0x756e('0x1d')]['ip'],config[_0x756e('0x1d')][_0x756e('0x12')],_0x756e('0x13')][_0x756e('0x14')]('\x20')));}_0x4d7581=_[_0x756e('0x1e')](_0x4d7581,_0x756e('0x1f'));_0x4d7581[_0x756e('0x17')]=_0x756e('0x20');return ami[_0x756e('0x19')](_0x4d7581)[_0x756e('0x1a')](function(_0x4b3230){_0x28872e({'code':0xc8,'message':_0x4b3230[_0x756e('0x21')]});})['catch'](function(_0x256dc1){_0x30bc11(_0x157be3[_0x756e('0x11')](0x1f5,_0x256dc1[_0x756e('0x1b')]));});});},'VoiceQueues':function(){return new Promise(function(_0x2722eb){var _0x506986=[];for(var _0x3ef5ef in _0x446fff[_0x756e('0x22')]){if(_0x446fff[_0x756e('0x22')]['hasOwnProperty'](_0x3ef5ef)){var _0x32815d=_0x446fff[_0x756e('0x22')][_0x3ef5ef];var _0x29dffb=new VoiceQueueSummary(_0x32815d);_0x506986['push'](_0x29dffb);}}_0x2722eb({'count':_0x506986[_0x756e('0x23')],'rows':_0x506986});});},'UpdateVoiceQueue':function(_0x9db13b){return new Promise(function(_0x5b4bf0,_0x39befb){var _0x43df79=_[_0x756e('0x24')](_0x446fff['voiceQueues'],{'id':parseInt(_0x9db13b['id'])});var _0x3c332e=_[_0x756e('0x25')](_0x9db13b,['id']);if(_0x43df79){for(var _0x5c6949 in _0x3c332e){if(typeof _0x3c332e[_0x5c6949]!==_0x756e('0x26')&&typeof _0x43df79[_0x5c6949]!==_0x756e('0x26')){_0x43df79[_0x5c6949]=_0x3c332e[_0x5c6949];}}_0x5b4bf0(_0x43df79);}else{_0x39befb();}});},'VoiceChannels':function(){return new Promise(function(_0x5be7b5){var _0x23daea=_[_0x756e('0x27')](_0x446fff[_0x756e('0x28')]);_0x5be7b5({'count':_0x23daea[_0x756e('0x23')],'rows':_0x23daea});});},'VoiceChannelMixMonitor':function(_0x3fb38d){var _0x4fdb97=this;return new Promise(function(_0x2e2558,_0x5c7947){if(ami['isConnected']()==![]){return _0x5c7947(_0x4fdb97[_0x756e('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x756e('0x1d')][_0x756e('0x12')],_0x756e('0x13')][_0x756e('0x14')]('\x20')));}var _0x4529aa=schema(properties[_0x756e('0x29')])[_0x756e('0x2a')](_0x3fb38d);if(_0x4529aa[_0x756e('0x23')]>0x0){return _0x5c7947(_0x4fdb97[_0x756e('0x11')](0x1f4,_[_0x756e('0x2b')](_0x4529aa,_0x756e('0x1b'))[_0x756e('0x14')](',\x20')));}var _0x5355a7=_['find'](_0x446fff[_0x756e('0x28')],{'uniqueid':_0x3fb38d[_0x756e('0x2c')]});if(_0x5355a7&&_0x5355a7[_0x756e('0x2d')]){var _0x8c29ea=util[_0x756e('0x8')](_0x756e('0x2e'),_0x3fb38d[_0x756e('0x2f')]||_0x3fb38d['uniqueid'],_0x3fb38d['format']||'wav');return ami[_0x756e('0x19')]({'action':_0x756e('0x30'),'channel':_0x5355a7[_0x756e('0x2d')],'file':_0x8c29ea,'options':'ai(mixmonitorid)'})[_0x756e('0x1a')](function(_0x2d8a29){var _0x5d1575=_[_0x756e('0x24')](_0x5355a7[_0x756e('0x31')],{'filename':_0x756e('0x32')+_0x8c29ea[_0x756e('0x33')]()});if(_[_0x756e('0x34')](_0x5d1575)){_0x5355a7[_0x756e('0x31')][_0x756e('0x35')]({'filename':_0x756e('0x32')+_0x8c29ea['toLowerCase'](),'createdAt':moment()[_0x756e('0x8')](_0x756e('0x36')),'mixmonitorid':_0x2d8a29[_0x756e('0x37')],'status':_0x756e('0x38')});}else{_0x5d1575[_0x756e('0x37')]=_0x2d8a29[_0x756e('0x37')];_0x5d1575[_0x756e('0x39')]=_0x756e('0x38');}_0x2e2558({'code':0xc8,'message':[_0x3fb38d[_0x756e('0x2c')],_0x756e('0x3a'),_0x2d8a29['mixmonitorid']][_0x756e('0x14')]('\x20'),'mixmonitorid':_0x2d8a29[_0x756e('0x37')]});})['catch'](function(_0x23e03f){_0x5c7947(_0x4fdb97[_0x756e('0x11')](0x1f5,[_0x3fb38d[_0x756e('0x2c')],_0x23e03f['message'][_0x756e('0x33')]()][_0x756e('0x14')]('\x20')));});}else{return _0x5c7947(_0x4fdb97[_0x756e('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x5a8dfb){var _0x3c326d=this;return new Promise(function(_0x5856f,_0x1fc45c){if(ami[_0x756e('0x10')]()==![]){return _0x1fc45c(_0x3c326d[_0x756e('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x756e('0x1d')][_0x756e('0x12')],'ami\x20disconnected'][_0x756e('0x14')]('\x20')));}var _0x4291b5=schema(properties[_0x756e('0x29')])[_0x756e('0x2a')](_0x5a8dfb);if(_0x4291b5[_0x756e('0x23')]>0x0){return _0x1fc45c(_0x3c326d[_0x756e('0x11')](0x1f4,_[_0x756e('0x2b')](_0x4291b5,_0x756e('0x1b'))[_0x756e('0x14')](',\x20')));}var _0x52d21e=_[_0x756e('0x24')](_0x446fff['channels'],{'uniqueid':_0x5a8dfb[_0x756e('0x2c')]});if(_0x52d21e){return Promise[_0x756e('0x3b')]()[_0x756e('0x1a')](function(){if(_0x52d21e['channel']){return ami[_0x756e('0x19')]({'action':_0x756e('0x3c'),'channel':_0x52d21e[_0x756e('0x2d')],'mixmonitorid':_0x5a8dfb['mixmonitorid']})['catch'](function(){});}})[_0x756e('0x1a')](function(){if(_0x52d21e[_0x756e('0x3d')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x52d21e[_0x756e('0x3d')],'mixmonitorid':_0x5a8dfb[_0x756e('0x37')]})[_0x756e('0x1c')](function(){});}})['then'](function(){var _0x3c70a1=_['find'](_0x52d21e[_0x756e('0x31')],{'mixmonitorid':_0x5a8dfb[_0x756e('0x37')]});if(_0x3c70a1){_0x3c70a1[_0x756e('0x39')]='stop';}})[_0x756e('0x1a')](function(){var _0x5224f2=util['format'](_0x756e('0x2e'),_0x5a8dfb['filename']||_0x5a8dfb[_0x756e('0x2c')],_0x5a8dfb[_0x756e('0x8')]||_0x756e('0x3e'));var _0x2512d3=_[_0x756e('0x24')](_0x52d21e[_0x756e('0x31')],{'filename':'/var/spool/asterisk/monitor/'+_0x5224f2[_0x756e('0x33')]()});if(_0x2512d3){_0x2512d3['status']=_0x756e('0x3f');}})['then'](function(){_0x5856f({'code':0xc8,'message':[_0x5a8dfb[_0x756e('0x2c')],'StopMixMonitor\x20Success'][_0x756e('0x14')]('\x20')});})['catch'](function(_0x58bda3){_0x1fc45c(_0x3c326d[_0x756e('0x11')](0x1f5,[_0x5a8dfb[_0x756e('0x2c')],_0x58bda3['message'][_0x756e('0x33')]()][_0x756e('0x14')]('\x20')));});}else{return _0x1fc45c(_0x3c326d['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x149a22){var _0x22b756=this;return new Promise(function(_0x34a556){var _0x2ef29e=_[_0x756e('0x27')](_0x446fff[_0x756e('0x40')]);var _0x435729={'count':_0x2ef29e[_0x756e('0x23')],'rows':_0x2ef29e};if(_0x149a22&&_0x149a22[_0x756e('0x41')]){if(!['inbound',_0x756e('0x42')][_0x756e('0x43')](_0x149a22[_0x756e('0x41')])){return _0x26519d(_0x22b756[_0x756e('0x11')](0x190,_0x756e('0x44')));}var _0x36eb30=_[_0x756e('0x45')](_0x2ef29e,function(_0x15c159){return _0x15c159['type']===_0x149a22[_0x756e('0x41')];});_0x435729[_0x756e('0x46')]=_0x36eb30['length'];_0x435729[_0x756e('0x47')]=_0x36eb30;}_0x34a556(_0x435729);});},'VoiceQueuesChannel':function(_0x49ac9f){var _0x14005d=this;return new Promise(function(_0xa5d6a3,_0x1d0b60){var _0x5c7006=schema(properties[_0x756e('0x48')])[_0x756e('0x2a')](_0x49ac9f);if(_0x5c7006[_0x756e('0x23')]>0x0){return _0x1d0b60(_0x14005d['error'](0x1f4,_[_0x756e('0x2b')](_0x5c7006,'message')[_0x756e('0x14')](',\x20')));}var _0x17a980=_[_0x756e('0x24')](_0x446fff[_0x756e('0x40')],{'uniqueid':_0x49ac9f[_0x756e('0x2c')]});if(_0x17a980){_0xa5d6a3(_0x17a980);}else{return _0x1d0b60(_0x14005d[_0x756e('0x11')](0x1f5,_0x756e('0x49')));}});},'VoiceQueuesChannelHangup':function(_0x150ba1){var _0x4f30b6=this;return new Promise(function(_0x10c8da,_0x3db2a7){if(ami[_0x756e('0x10')]()==![]){return _0x3db2a7(_0x4f30b6[_0x756e('0x11')](0x1f4,[config[_0x756e('0x1d')]['ip'],config[_0x756e('0x1d')][_0x756e('0x12')],_0x756e('0x13')][_0x756e('0x14')]('\x20')));}var _0xa78775=schema(properties[_0x756e('0x4a')])[_0x756e('0x2a')](_0x150ba1);if(_0xa78775[_0x756e('0x23')]>0x0){return _0x3db2a7(_0x4f30b6[_0x756e('0x11')](0x1f4,_['map'](_0xa78775,_0x756e('0x1b'))[_0x756e('0x14')](',\x20')));}var _0x1b4f22=_[_0x756e('0x24')](_0x446fff[_0x756e('0x40')],{'uniqueid':_0x150ba1[_0x756e('0x2c')]});if(_0x1b4f22&&_0x1b4f22['channel']){return ami[_0x756e('0x19')]({'action':_0x756e('0x4b'),'channel':_0x1b4f22[_0x756e('0x2d')]})[_0x756e('0x1a')](function(_0x4dc111){_0x10c8da({'code':0xc8,'message':[_0x150ba1['uniqueid'],_0x4dc111[_0x756e('0x1b')][_0x756e('0x33')]()][_0x756e('0x14')]('\x20')});})[_0x756e('0x1c')](function(_0x519e55){_0x3db2a7(_0x4f30b6[_0x756e('0x11')](0x1f5,[_0x150ba1[_0x756e('0x2c')],_0x519e55[_0x756e('0x1b')][_0x756e('0x33')]()]['join']('\x20')));});}else{return _0x3db2a7(_0x4f30b6['error'](0x1f5,_0x756e('0x49')));}});},'VoiceQueuesChannelRedirect':function(_0x2eefd8){var _0x3feff8=this;return new Promise(function(_0xdbd179,_0x21863a){if(ami[_0x756e('0x10')]()==![]){return _0x21863a(_0x3feff8[_0x756e('0x11')](0x1f4,[config[_0x756e('0x1d')]['ip'],config['asterisk']['username'],_0x756e('0x13')][_0x756e('0x14')]('\x20')));}var _0x4740ae=schema(properties[_0x756e('0x4c')])[_0x756e('0x2a')](_0x2eefd8);if(_0x4740ae[_0x756e('0x23')]>0x0){return _0x21863a(_0x3feff8[_0x756e('0x11')](0x1f4,_['map'](_0x4740ae,_0x756e('0x1b'))['join'](',\x20')));}var _0x255467=_['find'](_0x446fff[_0x756e('0x40')],{'uniqueid':_0x2eefd8[_0x756e('0x2c')]});if(_0x255467&&_0x255467[_0x756e('0x2d')]){return ami['Action']({'action':_0x756e('0x4d'),'channel':_0x255467[_0x756e('0x2d')],'exten':_0x2eefd8[_0x756e('0x4e')],'context':_0x2eefd8[_0x756e('0x4f')]||_0x255467[_0x756e('0x4f')],'priority':0x1})[_0x756e('0x1a')](function(_0xf65f5b){_0xdbd179({'code':0xc8,'message':[_0x2eefd8['uniqueid'],_0xf65f5b['message'][_0x756e('0x33')]()][_0x756e('0x14')]('\x20')});})[_0x756e('0x1c')](function(_0x463397){_0x21863a(_0x3feff8[_0x756e('0x11')](0x1f5,[_0x2eefd8[_0x756e('0x2c')],_0x463397['message'][_0x756e('0x33')]()][_0x756e('0x14')]('\x20')));});}else{return _0x21863a(_0x3feff8[_0x756e('0x11')](0x1f5,_0x756e('0x49')));}});},'Agents':function(_0x338f50){return new Promise(function(_0x2b564a){var _0x4c20c4=_[_0x756e('0x27')](_0x446fff['agents']);if(_0x338f50&&_0x338f50['id']){var _0x1d7776=_[_0x756e('0x24')](_0x4c20c4,function(_0x33ac35){return _0x33ac35['id']===_0x338f50['id'];});_0x2b564a(_0x1d7776);}else{_0x2b564a({'count':_0x4c20c4[_0x756e('0x23')],'rows':_0x4c20c4});}});},'Telephones':function(){return new Promise(function(_0x975c7b){var _0x582721=_['values'](_0x446fff[_0x756e('0x50')]);_0x975c7b({'count':_0x582721['length'],'rows':_0x582721});});},'Trunks':function(){return new Promise(function(_0x1e246a){var _0x59e2fe=_[_0x756e('0x27')](_0x446fff['trunks']);_0x1e246a({'count':_0x59e2fe[_0x756e('0x23')],'rows':_0x59e2fe});});},'OutboundChannels':function(){return new Promise(function(_0xa1273b){var _0x108e14=_['values'](_0x446fff[_0x756e('0x51')]);_0xa1273b({'count':_0x108e14['length'],'rows':_0x108e14});});},'Outbound':function(){return new Promise(function(_0x26784e){_0x26784e(_0x446fff[_0x756e('0x42')]);});},'Campaigns':function(){return new Promise(function(_0x23a872){var _0x3cdcf2=_[_0x756e('0x27')](_0x446fff[_0x756e('0x52')]);_0x23a872({'count':_0x3cdcf2[_0x756e('0x23')],'rows':_0x3cdcf2});});},'VoiceQueuesPreview':function(_0x5b087a){var _0xe3e3b6=this;return new Promise(function(_0x1a07c6,_0x5d690a){_0x538050[_0x756e('0x53')](_0x5b087a['id'])['then'](function(_0x57ffe2){_0x1a07c6({'code':0xc8,'message':_0x57ffe2[_0x756e('0x1b')]});})['catch'](function(_0x34a884){_0x5d690a(_0xe3e3b6['error'](0x1f4,_0x34a884[_0x756e('0x1b')]));});});},'EventManager':function(_0x51a2ec){var _0x4456c0=this;return new Promise(function(_0xf5b9e1,_0x45f980){if(!_0x51a2ec[_0x756e('0x54')]){return _0x45f980(_0x4456c0[_0x756e('0x11')](0x1f4,_0x756e('0x55')));}ami[_0x756e('0x56')](_0x756e('0x57')+_0x51a2ec[_0x756e('0x54')],_0x51a2ec[_0x756e('0x1b')]);_0xf5b9e1({'code':0xc8,'message':_0x51a2ec});});},'FaxAccounts':function(){return new Promise(function(_0x3e0f63){var _0x3647a7=_[_0x756e('0x27')](_0x446fff['faxAccounts']);_0x3e0f63({'count':_0x3647a7['length'],'rows':_0x3647a7});});},'SendFax':function(_0x45d212){var _0x15358a=this;return new Promise(function(_0x33f258,_0xdb48b){_0x3b3b8f[_0x756e('0x58')](_0x45d212)[_0x756e('0x1a')](function(_0x461c10){_0x33f258({'code':0xc8,'message':_0x461c10['message']});})[_0x756e('0x1c')](function(_0x3bfd56){_0xdb48b(_0x15358a[_0x756e('0x11')](0x1f4,_0x3bfd56[_0x756e('0x1b')]));});});},'CheckAfterSend':function(_0xcfaaba){var _0x4e0e5b=this;return new Promise(function(_0x194455,_0x5a911e){_0x3b3b8f['checkAfterSend'](_0xcfaaba)[_0x756e('0x1a')](function(_0x48b8e8){_0x194455({'code':0xc8,'message':_0x48b8e8[_0x756e('0x1b')]});})[_0x756e('0x1c')](function(_0x502719){_0x5a911e(_0x4e0e5b[_0x756e('0x11')](0x1f4,_0x502719[_0x756e('0x1b')]));});});}};var _0x3e4955=jayson[_0x756e('0x59')](_0xcf58ec)[_0x756e('0x5a')]();_0x3e4955['on']('error',function(_0x3498dd){return _0x26519d(_0x3498dd);});_0x3e4955[_0x756e('0x7')](0x232a,_0x756e('0x5b'),function(){console[_0x756e('0x5c')](_0x756e('0x5d'),0x232a);return _0x404189('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x7da7=['AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','../../../config/environment','../properties','../model/voiceQueueSummary','listen','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','join','keys','reload','module','action','message','catch','ami\x20disconnected','Action','then','content','voiceQueues','push','length','find','undefined','channels','voicechannel','map','uniqueid','channel','%s.%s','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','isConnected','validate','resolve','StopMixMonitor','destinationchannel','status','stop','filename','StopMixMonitor\x20Success','queueChannels','type','inbound','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','voicequeuechannelhangup','Hangup','exten','context','values','telephones','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','faxAccounts','send','server','http','127.0.0.1','log'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x7da7,0x10d));var _0x77da=function(_0x28b7ab,_0x16a764){_0x28b7ab=_0x28b7ab-0x0;var _0x56791b=_0x7da7[_0x28b7ab];return _0x56791b;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var jayson=require(_0x77da('0x2'));var schema=require('validate');var moment=require('moment');var config=require(_0x77da('0x3'));var properties=require(_0x77da('0x4'));var ami=require('../ami');var VoiceQueueSummary=require(_0x77da('0x5'));exports[_0x77da('0x6')]=function(_0x56458c,_0x19331c,_0xc54a12){return new Promise(function(_0x47da81,_0x30afe0){var _0x47cf1d={'QueuePause':function(_0x1191de){return new Promise(function(_0x13992e){var _0x37c5ab=util[_0x77da('0x7')](_0x77da('0x8'),'SIP',_0x1191de[_0x77da('0x9')]);if(_0x56458c[_0x77da('0xa')]&&_0x56458c[_0x77da('0xa')][_0x37c5ab]&&_0x56458c['timers'][_0x37c5ab][_0x77da('0xb')]){_0x56458c[_0x77da('0xa')][_0x37c5ab][_0x77da('0xc')]();}if(_0x56458c[_0x77da('0xd')][_0x37c5ab]){_0x56458c['agents'][_0x37c5ab][_0x77da('0xe')]({'statePause':_0x1191de[_0x77da('0xf')]?!![]:![]});}_0x13992e({'code':0xc8,'message':_0x77da('0x10')});});},'Reload':function(_0x5d6e2f){var _0x4a7748=this;return new Promise(function(_0x26e3ff,_0x4263d9){if(ami['isConnected']()==![]){return _0x4263d9(_0x4a7748[_0x77da('0x11')](0x1f4,[config[_0x77da('0x12')]['ip'],config[_0x77da('0x12')][_0x77da('0x13')],'ami\x20disconnected'][_0x77da('0x14')]('\x20')));}_0x5d6e2f=_['pick'](_0x5d6e2f,_[_0x77da('0x15')](properties[_0x77da('0x16')][_0x77da('0x17')]));_0x5d6e2f[_0x77da('0x18')]='Reload';return ami['Action'](_0x5d6e2f)['then'](function(_0x482b87){_0x26e3ff({'code':0xc8,'message':_0x482b87[_0x77da('0x19')]});})[_0x77da('0x1a')](function(_0x289887){_0x4263d9(_0x4a7748[_0x77da('0x11')](0x1f5,_0x289887[_0x77da('0x19')]));});});},'Command':function(_0x12d2b1){var _0x1d325c=this;return new Promise(function(_0x3b6dde,_0x544104){if(ami['isConnected']()==![]){return _0x544104(_0x1d325c[_0x77da('0x11')](0x1f4,[config[_0x77da('0x12')]['ip'],config['asterisk'][_0x77da('0x13')],_0x77da('0x1b')][_0x77da('0x14')]('\x20')));}_0x12d2b1=_['pick'](_0x12d2b1,'command');_0x12d2b1[_0x77da('0x18')]='Command';return ami[_0x77da('0x1c')](_0x12d2b1)[_0x77da('0x1d')](function(_0xc52f0e){_0x3b6dde({'code':0xc8,'message':_0xc52f0e[_0x77da('0x1e')]});})[_0x77da('0x1a')](function(_0x270318){_0x544104(_0x1d325c[_0x77da('0x11')](0x1f5,_0x270318['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x4885ec){var _0xfd160=[];for(var _0x2d009f in _0x56458c[_0x77da('0x1f')]){if(_0x56458c[_0x77da('0x1f')]['hasOwnProperty'](_0x2d009f)){var _0x42240b=_0x56458c[_0x77da('0x1f')][_0x2d009f];var _0x470c9f=new VoiceQueueSummary(_0x42240b);_0xfd160[_0x77da('0x20')](_0x470c9f);}}_0x4885ec({'count':_0xfd160[_0x77da('0x21')],'rows':_0xfd160});});},'UpdateVoiceQueue':function(_0x5997b6){return new Promise(function(_0xce24b8,_0x3e090d){var _0x1f2279=_[_0x77da('0x22')](_0x56458c['voiceQueues'],{'id':parseInt(_0x5997b6['id'])});var _0x5b4638=_['omit'](_0x5997b6,['id']);if(_0x1f2279){for(var _0x2258e9 in _0x5b4638){if(typeof _0x5b4638[_0x2258e9]!==_0x77da('0x23')&&typeof _0x1f2279[_0x2258e9]!==_0x77da('0x23')){_0x1f2279[_0x2258e9]=_0x5b4638[_0x2258e9];}}_0xce24b8(_0x1f2279);}else{_0x3e090d();}});},'VoiceChannels':function(){return new Promise(function(_0x3394d6){var _0x34228f=_['values'](_0x56458c[_0x77da('0x24')]);_0x3394d6({'count':_0x34228f[_0x77da('0x21')],'rows':_0x34228f});});},'VoiceChannelMixMonitor':function(_0x356bfb){var _0x1d381b=this;return new Promise(function(_0x1e7853,_0x46e6b4){if(ami['isConnected']()==![]){return _0x46e6b4(_0x1d381b[_0x77da('0x11')](0x1f4,[config[_0x77da('0x12')]['ip'],config[_0x77da('0x12')][_0x77da('0x13')],_0x77da('0x1b')][_0x77da('0x14')]('\x20')));}var _0x3343b4=schema(properties[_0x77da('0x25')])['validate'](_0x356bfb);if(_0x3343b4['length']>0x0){return _0x46e6b4(_0x1d381b[_0x77da('0x11')](0x1f4,_[_0x77da('0x26')](_0x3343b4,'message')[_0x77da('0x14')](',\x20')));}var _0x390399=_[_0x77da('0x22')](_0x56458c[_0x77da('0x24')],{'uniqueid':_0x356bfb[_0x77da('0x27')]});if(_0x390399&&_0x390399[_0x77da('0x28')]){var _0x20d1cc=util['format'](_0x77da('0x29'),_0x356bfb['filename']||_0x356bfb['uniqueid'],_0x356bfb['format']||_0x77da('0x2a'));return ami['Action']({'action':_0x77da('0x2b'),'channel':_0x390399[_0x77da('0x28')],'file':_0x20d1cc,'options':_0x77da('0x2c')})[_0x77da('0x1d')](function(_0x3c46d2){var _0x3f0593=_[_0x77da('0x22')](_0x390399['monitors'],{'filename':_0x77da('0x2d')+_0x20d1cc[_0x77da('0x2e')]()});if(_[_0x77da('0x2f')](_0x3f0593)){_0x390399[_0x77da('0x30')][_0x77da('0x20')]({'filename':_0x77da('0x2d')+_0x20d1cc['toLowerCase'](),'createdAt':moment()[_0x77da('0x7')](_0x77da('0x31')),'mixmonitorid':_0x3c46d2[_0x77da('0x32')],'status':'rec'});}else{_0x3f0593[_0x77da('0x32')]=_0x3c46d2['mixmonitorid'];_0x3f0593['status']='rec';}_0x1e7853({'code':0xc8,'message':[_0x356bfb['uniqueid'],_0x77da('0x33'),_0x3c46d2[_0x77da('0x32')]][_0x77da('0x14')]('\x20'),'mixmonitorid':_0x3c46d2['mixmonitorid']});})[_0x77da('0x1a')](function(_0x5b7e63){_0x46e6b4(_0x1d381b[_0x77da('0x11')](0x1f5,[_0x356bfb['uniqueid'],_0x5b7e63[_0x77da('0x19')][_0x77da('0x2e')]()][_0x77da('0x14')]('\x20')));});}else{return _0x46e6b4(_0x1d381b[_0x77da('0x11')](0x1f5,_0x77da('0x34')));}});},'VoiceChannelStopMixMonitor':function(_0x5ecf12){var _0x759b86=this;return new Promise(function(_0x1f48bd,_0x44717a){if(ami[_0x77da('0x35')]()==![]){return _0x44717a(_0x759b86[_0x77da('0x11')](0x1f4,[config[_0x77da('0x12')]['ip'],config['asterisk'][_0x77da('0x13')],_0x77da('0x1b')][_0x77da('0x14')]('\x20')));}var _0x2dfeca=schema(properties[_0x77da('0x25')])[_0x77da('0x36')](_0x5ecf12);if(_0x2dfeca['length']>0x0){return _0x44717a(_0x759b86[_0x77da('0x11')](0x1f4,_['map'](_0x2dfeca,_0x77da('0x19'))[_0x77da('0x14')](',\x20')));}var _0x40a492=_['find'](_0x56458c[_0x77da('0x24')],{'uniqueid':_0x5ecf12[_0x77da('0x27')]});if(_0x40a492){return Promise[_0x77da('0x37')]()[_0x77da('0x1d')](function(){if(_0x40a492[_0x77da('0x28')]){return ami[_0x77da('0x1c')]({'action':_0x77da('0x38'),'channel':_0x40a492[_0x77da('0x28')],'mixmonitorid':_0x5ecf12[_0x77da('0x32')]})['catch'](function(){});}})[_0x77da('0x1d')](function(){if(_0x40a492[_0x77da('0x39')]){return ami[_0x77da('0x1c')]({'action':_0x77da('0x38'),'channel':_0x40a492[_0x77da('0x39')],'mixmonitorid':_0x5ecf12[_0x77da('0x32')]})['catch'](function(){});}})['then'](function(){var _0x240d7b=_[_0x77da('0x22')](_0x40a492[_0x77da('0x30')],{'mixmonitorid':_0x5ecf12[_0x77da('0x32')]});if(_0x240d7b){_0x240d7b[_0x77da('0x3a')]=_0x77da('0x3b');}})['then'](function(){var _0x6ccb8f=util[_0x77da('0x7')](_0x77da('0x29'),_0x5ecf12[_0x77da('0x3c')]||_0x5ecf12['uniqueid'],_0x5ecf12[_0x77da('0x7')]||'wav');var _0x518fd5=_[_0x77da('0x22')](_0x40a492[_0x77da('0x30')],{'filename':_0x77da('0x2d')+_0x6ccb8f[_0x77da('0x2e')]()});if(_0x518fd5){_0x518fd5['status']=_0x77da('0x3b');}})[_0x77da('0x1d')](function(){_0x1f48bd({'code':0xc8,'message':[_0x5ecf12['uniqueid'],_0x77da('0x3d')][_0x77da('0x14')]('\x20')});})['catch'](function(_0x6c0b00){_0x44717a(_0x759b86[_0x77da('0x11')](0x1f5,[_0x5ecf12[_0x77da('0x27')],_0x6c0b00[_0x77da('0x19')][_0x77da('0x2e')]()][_0x77da('0x14')]('\x20')));});}else{return _0x44717a(_0x759b86[_0x77da('0x11')](0x1f5,_0x77da('0x34')));}});},'VoiceQueuesChannels':function(_0x128ce3){var _0x3a34a8=this;return new Promise(function(_0x52aa0a){var _0x3d04a3=_['values'](_0x56458c[_0x77da('0x3e')]);var _0x14cd3c={'count':_0x3d04a3[_0x77da('0x21')],'rows':_0x3d04a3};if(_0x128ce3&&_0x128ce3[_0x77da('0x3f')]){if(![_0x77da('0x40'),_0x77da('0x41')][_0x77da('0x42')](_0x128ce3['type'])){return _0x30afe0(_0x3a34a8[_0x77da('0x11')](0x190,_0x77da('0x43')));}var _0x1a7115=_[_0x77da('0x44')](_0x3d04a3,function(_0x4f30a1){return _0x4f30a1[_0x77da('0x3f')]===_0x128ce3[_0x77da('0x3f')];});_0x14cd3c[_0x77da('0x45')]=_0x1a7115['length'];_0x14cd3c['rows']=_0x1a7115;}_0x52aa0a(_0x14cd3c);});},'VoiceQueuesChannel':function(_0x332763){var _0x3a0396=this;return new Promise(function(_0x42ea9e,_0x1d1ea2){var _0x451897=schema(properties['voicequeuechannel'])['validate'](_0x332763);if(_0x451897[_0x77da('0x21')]>0x0){return _0x1d1ea2(_0x3a0396[_0x77da('0x11')](0x1f4,_['map'](_0x451897,_0x77da('0x19'))[_0x77da('0x14')](',\x20')));}var _0x1e0146=_['find'](_0x56458c[_0x77da('0x3e')],{'uniqueid':_0x332763[_0x77da('0x27')]});if(_0x1e0146){_0x42ea9e(_0x1e0146);}else{return _0x1d1ea2(_0x3a0396['error'](0x1f5,_0x77da('0x34')));}});},'VoiceQueuesChannelHangup':function(_0x27aa8c){var _0xfb06b5=this;return new Promise(function(_0x1a4bab,_0x20cce1){if(ami[_0x77da('0x35')]()==![]){return _0x20cce1(_0xfb06b5[_0x77da('0x11')](0x1f4,[config[_0x77da('0x12')]['ip'],config[_0x77da('0x12')]['username'],_0x77da('0x1b')][_0x77da('0x14')]('\x20')));}var _0x1f6141=schema(properties[_0x77da('0x46')])[_0x77da('0x36')](_0x27aa8c);if(_0x1f6141[_0x77da('0x21')]>0x0){return _0x20cce1(_0xfb06b5['error'](0x1f4,_[_0x77da('0x26')](_0x1f6141,_0x77da('0x19'))[_0x77da('0x14')](',\x20')));}var _0x5b9cf2=_[_0x77da('0x22')](_0x56458c[_0x77da('0x3e')],{'uniqueid':_0x27aa8c[_0x77da('0x27')]});if(_0x5b9cf2&&_0x5b9cf2[_0x77da('0x28')]){return ami[_0x77da('0x1c')]({'action':_0x77da('0x47'),'channel':_0x5b9cf2[_0x77da('0x28')]})['then'](function(_0x100094){_0x1a4bab({'code':0xc8,'message':[_0x27aa8c['uniqueid'],_0x100094[_0x77da('0x19')][_0x77da('0x2e')]()][_0x77da('0x14')]('\x20')});})['catch'](function(_0x30c746){_0x20cce1(_0xfb06b5[_0x77da('0x11')](0x1f5,[_0x27aa8c[_0x77da('0x27')],_0x30c746[_0x77da('0x19')]['toLowerCase']()]['join']('\x20')));});}else{return _0x20cce1(_0xfb06b5['error'](0x1f5,_0x77da('0x34')));}});},'VoiceQueuesChannelRedirect':function(_0x1bca78){var _0x2c4d7c=this;return new Promise(function(_0x2c7c8e,_0x458da6){if(ami[_0x77da('0x35')]()==![]){return _0x458da6(_0x2c4d7c[_0x77da('0x11')](0x1f4,[config[_0x77da('0x12')]['ip'],config[_0x77da('0x12')][_0x77da('0x13')],'ami\x20disconnected'][_0x77da('0x14')]('\x20')));}var _0x6dd79f=schema(properties['voicequeuechannelredirect'])['validate'](_0x1bca78);if(_0x6dd79f[_0x77da('0x21')]>0x0){return _0x458da6(_0x2c4d7c['error'](0x1f4,_[_0x77da('0x26')](_0x6dd79f,_0x77da('0x19'))[_0x77da('0x14')](',\x20')));}var _0x4b9115=_[_0x77da('0x22')](_0x56458c[_0x77da('0x3e')],{'uniqueid':_0x1bca78[_0x77da('0x27')]});if(_0x4b9115&&_0x4b9115[_0x77da('0x28')]){return ami[_0x77da('0x1c')]({'action':'Redirect','channel':_0x4b9115[_0x77da('0x28')],'exten':_0x1bca78[_0x77da('0x48')],'context':_0x1bca78['context']||_0x4b9115[_0x77da('0x49')],'priority':0x1})[_0x77da('0x1d')](function(_0xd14296){_0x2c7c8e({'code':0xc8,'message':[_0x1bca78[_0x77da('0x27')],_0xd14296[_0x77da('0x19')][_0x77da('0x2e')]()][_0x77da('0x14')]('\x20')});})['catch'](function(_0x3f5766){_0x458da6(_0x2c4d7c['error'](0x1f5,[_0x1bca78[_0x77da('0x27')],_0x3f5766[_0x77da('0x19')][_0x77da('0x2e')]()][_0x77da('0x14')]('\x20')));});}else{return _0x458da6(_0x2c4d7c[_0x77da('0x11')](0x1f5,_0x77da('0x34')));}});},'Agents':function(_0xf75c3c){return new Promise(function(_0x103e1b){var _0x195a34=_[_0x77da('0x4a')](_0x56458c[_0x77da('0xd')]);if(_0xf75c3c&&_0xf75c3c['id']){var _0x19065e=_['find'](_0x195a34,function(_0x39d569){return _0x39d569['id']===_0xf75c3c['id'];});_0x103e1b(_0x19065e);}else{_0x103e1b({'count':_0x195a34[_0x77da('0x21')],'rows':_0x195a34});}});},'Telephones':function(){return new Promise(function(_0xeb5121){var _0x16d8cd=_['values'](_0x56458c[_0x77da('0x4b')]);_0xeb5121({'count':_0x16d8cd[_0x77da('0x21')],'rows':_0x16d8cd});});},'Trunks':function(){return new Promise(function(_0x16c7b7){var _0x4f3479=_[_0x77da('0x4a')](_0x56458c['trunks']);_0x16c7b7({'count':_0x4f3479['length'],'rows':_0x4f3479});});},'OutboundChannels':function(){return new Promise(function(_0x2a4f85){var _0x4015f0=_[_0x77da('0x4a')](_0x56458c[_0x77da('0x4c')]);_0x2a4f85({'count':_0x4015f0[_0x77da('0x21')],'rows':_0x4015f0});});},'Outbound':function(){return new Promise(function(_0x337621){_0x337621(_0x56458c[_0x77da('0x41')]);});},'Campaigns':function(){return new Promise(function(_0xf95d48){var _0x470840=_['values'](_0x56458c[_0x77da('0x4d')]);_0xf95d48({'count':_0x470840[_0x77da('0x21')],'rows':_0x470840});});},'VoiceQueuesPreview':function(_0x2d3ab4){var _0x1206c7=this;return new Promise(function(_0x17175,_0x502249){_0x19331c[_0x77da('0x4e')](_0x2d3ab4['id'])[_0x77da('0x1d')](function(_0x27c0a2){_0x17175({'code':0xc8,'message':_0x27c0a2[_0x77da('0x19')]});})[_0x77da('0x1a')](function(_0x94f1e1){_0x502249(_0x1206c7[_0x77da('0x11')](0x1f4,_0x94f1e1[_0x77da('0x19')]));});});},'EventManager':function(_0x352a4e){var _0x37d94a=this;return new Promise(function(_0x4df868,_0x519e38){if(!_0x352a4e['event']){return _0x519e38(_0x37d94a[_0x77da('0x11')](0x1f4,_0x77da('0x4f')));}ami[_0x77da('0x50')]('custom:'+_0x352a4e['event'],_0x352a4e[_0x77da('0x19')]);_0x4df868({'code':0xc8,'message':_0x352a4e});});},'FaxAccounts':function(){return new Promise(function(_0xdbd9d5){var _0x17a2e6=_[_0x77da('0x4a')](_0x56458c[_0x77da('0x51')]);_0xdbd9d5({'count':_0x17a2e6[_0x77da('0x21')],'rows':_0x17a2e6});});},'SendFax':function(_0x3fca4b){var _0x276805=this;return new Promise(function(_0x1523a8,_0x11152b){_0xc54a12[_0x77da('0x52')](_0x3fca4b)[_0x77da('0x1d')](function(_0x1d2944){_0x1523a8({'code':0xc8,'message':_0x1d2944['message']});})['catch'](function(_0x1cdd40){_0x11152b(_0x276805['error'](0x1f4,_0x1cdd40['message']));});});},'CheckAfterSend':function(_0x22de60){var _0x1e37da=this;return new Promise(function(_0x2ae66f,_0x583a7a){_0xc54a12['checkAfterSend'](_0x22de60)[_0x77da('0x1d')](function(_0x4f1ae0){_0x2ae66f({'code':0xc8,'message':_0x4f1ae0[_0x77da('0x19')]});})[_0x77da('0x1a')](function(_0x554c44){_0x583a7a(_0x1e37da[_0x77da('0x11')](0x1f4,_0x554c44['message']));});});}};var _0x15cec0=jayson[_0x77da('0x53')](_0x47cf1d)[_0x77da('0x54')]();_0x15cec0['on'](_0x77da('0x11'),function(_0x4e3014){return _0x30afe0(_0x4e3014);});_0x15cec0[_0x77da('0x6')](0x232a,_0x77da('0x55'),function(){console[_0x77da('0x56')](_0x77da('0x57'),0x232a);return _0x47da81(_0x77da('0x58')+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 84ee16a..7fb6aef 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 _0x3944=['$or','map','routeId','destcalleridnum','calleridnum','firstName','mobile','fax','createdAt','scheduledAt','union','resolve','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','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','action','toLowerCase','merge','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','socket.io-emitter','redis','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','xmd-contactid','ListId','data3','split','phone'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x3944,0x17b));var _0x4394=function(_0x462cc6,_0x1b2f28){_0x462cc6=_0x462cc6-0x0;var _0x2409d6=_0x3944[_0x462cc6];return _0x2409d6;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require('ioredis');var util=require(_0x4394('0x0'));var config=require(_0x4394('0x1'));var logger=require(_0x4394('0x2'))(_0x4394('0x3'));var cmContactRpc=require(_0x4394('0x4'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x4394('0x5'))(new Redis(config[_0x4394('0x6')]));function emit(_0x1d5bdc,_0x2b01ba,_0x56d32f,_0x5b0ed0,_0x1335fc){logger[_0x4394('0x7')](_0x4394('0x8'),_0x1d5bdc,_0x2b01ba['id'],_0x56d32f,_0x5b0ed0,JSON[_0x4394('0x9')](_0x1335fc));io['to'](_0x56d32f)[_0x4394('0xa')](_0x5b0ed0,_0x1335fc);}exports[_0x4394('0xb')]=function(_0x3847c0,_0x315865,_0x17d8a4,_0x3c0f1c){var _0x1a867f,_0x282bbc;var _0x56771a={};var _0x160e55;var _0x379879=Number(_0x17d8a4[_0x4394('0xc')]);var _0xd8e33e=_0x17d8a4[_0x4394('0xd')]?Boolean(Number(_0x17d8a4[_0x4394('0xd')])):![];var _0x4c86c6;var _0x310052=![];if(!_[_0x4394('0xe')](_0x17d8a4['data5'])){if(_0x17d8a4['data5']=='1')_0x310052=!![];}if(!_0x310052){if(_0x3c0f1c[_0x4394('0xf')]){_0x56771a['id']=_0x3c0f1c['xmd-contactid'];}}if(!_0x56771a['id']){_0x56771a[_0x4394('0x10')]=_0x379879;_0x4c86c6=_0x17d8a4[_0x4394('0x11')]&&_0x17d8a4[_0x4394('0x11')]!=='0'?_0x17d8a4[_0x4394('0x11')][_0x4394('0x12')](','):[_0x4394('0x13')];_0x56771a[_0x4394('0x14')]=_[_0x4394('0x15')](_0x4c86c6,function(_0x129042){var _0x5e760a={};_0x5e760a[_0x129042]=_0x3c0f1c[_0x4394('0x16')]?_0x3c0f1c[_0x4394('0x17')]:_0x3c0f1c['calleridnum'];return _0x5e760a;});_0x160e55=_0x3c0f1c['routeId']?_0x3c0f1c[_0x4394('0x17')]:_0x3c0f1c[_0x4394('0x18')];}var _0x30a949=['id',_0x4394('0x19'),'lastName',_0x4394('0x13'),_0x4394('0x1a'),_0x4394('0x1b'),_0x4394('0x10'),_0x4394('0x1c'),_0x4394('0x1d'),'updatedAt'];var _0x2d76af=_[_0x4394('0x1e')](_0x30a949,_0x4c86c6);BPromise[_0x4394('0x1f')]()[_0x4394('0x20')](cmContactRpc[_0x4394('0x21')]({'attributes':_0x2d76af,'where':_0x56771a,'phone':_0x160e55}))['then'](function(_0x12332c){_0x282bbc=_0x12332c;if(!_[_0x4394('0x22')](_0x282bbc)){if(_0x282bbc[_0x4394('0x23')]===0x1){_0x1a867f=_0x282bbc[0x0];logger['info'](_0x4394('0x24'),_0x3c0f1c[_0x4394('0x25')],_0x315865['id'],_0x1a867f['id']);}else{logger[_0x4394('0x7')](_0x4394('0x26'),_0x3c0f1c[_0x4394('0x25')],_0x315865['id'],_[_0x4394('0x15')](_0x282bbc,'id')[_0x4394('0x27')](','));}return;}else{logger[_0x4394('0x7')](_0x4394('0x28'),_0x3c0f1c[_0x4394('0x25')],_0x315865['id']);var _0x399fdd={'ListId':_0x379879};var _0x8e1fb9=_0x17d8a4[_0x4394('0x29')]&&_0x17d8a4[_0x4394('0x29')]!=='0'?_0x17d8a4[_0x4394('0x29')]:_0x4394('0x13');if(_0xd8e33e){logger['info'](_0x4394('0x2a'),_0x3c0f1c[_0x4394('0x25')],_0x315865['id']);_0x399fdd[_0x8e1fb9]=_['isNil'](_0x3c0f1c[_0x4394('0x16')])?_0x3c0f1c[_0x4394('0x18')]:_0x3c0f1c['destcalleridnum'];if(_[_0x4394('0xe')](_0x3c0f1c[_0x4394('0x16')])){_0x399fdd['firstName']=_0x3c0f1c[_0x4394('0x2b')]&&_0x3c0f1c['calleridname']!==_0x4394('0x2c')?_0x3c0f1c[_0x4394('0x2b')]:'Unknown';}else{_0x399fdd[_0x4394('0x19')]=_0x3c0f1c['destcalleridname']&&_0x3c0f1c[_0x4394('0x2d')]!==_0x4394('0x2c')?_0x3c0f1c[_0x4394('0x2d')]:_0x4394('0x2e');}return BPromise[_0x4394('0x1f')]()['then'](cmContactRpc[_0x4394('0x2f')](_0x399fdd))['then'](function(_0x2a414d){_0x1a867f=_0x2a414d;_0x282bbc[_0x4394('0x30')](_0x2a414d);if(_0x1a867f){logger[_0x4394('0x7')](_0x4394('0x31'),_0x3c0f1c[_0x4394('0x25')],_0x315865['id'],_0x1a867f['id']);}return;});}else{logger[_0x4394('0x7')](_0x4394('0x32'),_0x3c0f1c[_0x4394('0x25')],_0x315865['id']);_0x399fdd[_0x8e1fb9]=_[_0x4394('0xe')](_0x3c0f1c[_0x4394('0x16')])?_0x3c0f1c['calleridnum']:_0x3c0f1c['destcalleridnum'];if(_['isNil'](_0x3c0f1c[_0x4394('0x16')])){_0x399fdd[_0x4394('0x19')]=_0x3c0f1c[_0x4394('0x2b')]&&_0x3c0f1c[_0x4394('0x2b')]!==_0x4394('0x2c')?_0x3c0f1c['calleridname']:_0x4394('0x2e');}else{_0x399fdd[_0x4394('0x19')]=_0x3c0f1c['destcalleridname']&&_0x3c0f1c['destcalleridname']!==_0x4394('0x2c')?_0x3c0f1c[_0x4394('0x2d')]:_0x4394('0x2e');}_0x1a867f=_0x399fdd;_0x282bbc[_0x4394('0x30')](_0x399fdd);return;}}})['then'](function(){if(_0x3847c0){emit(_0x3c0f1c[_0x4394('0x25')],_0x315865,util[_0x4394('0x33')](_0x4394('0x34'),_0x3847c0['name']),util[_0x4394('0x33')](_0x4394('0x35'),_0x17d8a4[_0x4394('0x36')][_0x4394('0x37')]()),{'evt':_[_0x4394('0x38')](_0x3c0f1c,{'autoCreate':_0xd8e33e}),'contact':_0x1a867f===undefined?{}:_0x1a867f,'contacts':_0x282bbc[_0x4394('0x23')]===0x0?undefined:_0x282bbc});}});}; \ No newline at end of file +var _0x74ae=['resolve','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','localhost','info','[CM][%s][%s]','emit','data2','isNil','xmd-contactid','data3','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','ListId','createdAt','scheduledAt','updatedAt','union'];(function(_0x168c60,_0x539d96){var _0x29bea4=function(_0x1f7f4e){while(--_0x1f7f4e){_0x168c60['push'](_0x168c60['shift']());}};_0x29bea4(++_0x539d96);}(_0x74ae,0xc5));var _0xe74a=function(_0x46f659,_0x3c2c9d){_0x46f659=_0x46f659-0x0;var _0xbf5e5c=_0x74ae[_0x46f659];return _0xbf5e5c;};'use strict';var _=require(_0xe74a('0x0'));var BPromise=require(_0xe74a('0x1'));var Redis=require('ioredis');var util=require(_0xe74a('0x2'));var config=require(_0xe74a('0x3'));var logger=require('../../../../config/logger')(_0xe74a('0x4'));var cmContactRpc=require(_0xe74a('0x5'));config[_0xe74a('0x6')]=_[_0xe74a('0x7')](config[_0xe74a('0x6')],{'host':_0xe74a('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe74a('0x6')]));function emit(_0xb3749f,_0x37eaa9,_0xd02dd8,_0x370f05,_0x4ba7c8){logger[_0xe74a('0x9')](_0xe74a('0xa'),_0xb3749f,_0x37eaa9['id'],_0xd02dd8,_0x370f05,JSON['stringify'](_0x4ba7c8));io['to'](_0xd02dd8)[_0xe74a('0xb')](_0x370f05,_0x4ba7c8);}exports['exec']=function(_0x2e9af7,_0x5c12b7,_0x3f46f6,_0x5e112f){var _0x18eff8,_0x5941c7;var _0x2b686d={};var _0x1d1627;var _0x435bfe=Number(_0x3f46f6['data1']);var _0x4dac3f=_0x3f46f6[_0xe74a('0xc')]?Boolean(Number(_0x3f46f6[_0xe74a('0xc')])):![];var _0x4badfe;var _0x49ea3c=![];if(!_[_0xe74a('0xd')](_0x3f46f6['data5'])){if(_0x3f46f6['data5']=='1')_0x49ea3c=!![];}if(!_0x49ea3c){if(_0x5e112f[_0xe74a('0xe')]){_0x2b686d['id']=_0x5e112f['xmd-contactid'];}}if(!_0x2b686d['id']){_0x2b686d['ListId']=_0x435bfe;_0x4badfe=_0x3f46f6[_0xe74a('0xf')]&&_0x3f46f6['data3']!=='0'?_0x3f46f6[_0xe74a('0xf')]['split'](','):[_0xe74a('0x10')];_0x2b686d[_0xe74a('0x11')]=_[_0xe74a('0x12')](_0x4badfe,function(_0x257281){var _0x279326={};_0x279326[_0x257281]=_0x5e112f[_0xe74a('0x13')]?_0x5e112f[_0xe74a('0x14')]:_0x5e112f[_0xe74a('0x15')];return _0x279326;});_0x1d1627=_0x5e112f[_0xe74a('0x13')]?_0x5e112f[_0xe74a('0x14')]:_0x5e112f[_0xe74a('0x15')];}var _0x200c33=['id',_0xe74a('0x16'),_0xe74a('0x17'),_0xe74a('0x10'),_0xe74a('0x18'),_0xe74a('0x19'),_0xe74a('0x1a'),_0xe74a('0x1b'),_0xe74a('0x1c'),_0xe74a('0x1d')];var _0x824be2=_[_0xe74a('0x1e')](_0x200c33,_0x4badfe);BPromise[_0xe74a('0x1f')]()['then'](cmContactRpc[_0xe74a('0x20')]({'attributes':_0x824be2,'where':_0x2b686d,'phone':_0x1d1627}))[_0xe74a('0x21')](function(_0x4be78a){_0x5941c7=_0x4be78a;if(!_[_0xe74a('0x22')](_0x5941c7)){if(_0x5941c7[_0xe74a('0x23')]===0x1){_0x18eff8=_0x5941c7[0x0];logger[_0xe74a('0x9')](_0xe74a('0x24'),_0x5e112f['uniqueid'],_0x5c12b7['id'],_0x18eff8['id']);}else{logger[_0xe74a('0x9')](_0xe74a('0x25'),_0x5e112f[_0xe74a('0x26')],_0x5c12b7['id'],_[_0xe74a('0x12')](_0x5941c7,'id')[_0xe74a('0x27')](','));}return;}else{logger[_0xe74a('0x9')](_0xe74a('0x28'),_0x5e112f[_0xe74a('0x26')],_0x5c12b7['id']);var _0x3124b9={'ListId':_0x435bfe};var _0x1133a8=_0x3f46f6['data4']&&_0x3f46f6[_0xe74a('0x29')]!=='0'?_0x3f46f6[_0xe74a('0x29')]:_0xe74a('0x10');if(_0x4dac3f){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x5e112f[_0xe74a('0x26')],_0x5c12b7['id']);_0x3124b9[_0x1133a8]=_[_0xe74a('0xd')](_0x5e112f[_0xe74a('0x13')])?_0x5e112f['calleridnum']:_0x5e112f[_0xe74a('0x14')];if(_[_0xe74a('0xd')](_0x5e112f[_0xe74a('0x13')])){_0x3124b9['firstName']=_0x5e112f[_0xe74a('0x2a')]&&_0x5e112f[_0xe74a('0x2a')]!==_0xe74a('0x2b')?_0x5e112f[_0xe74a('0x2a')]:'Unknown';}else{_0x3124b9['firstName']=_0x5e112f[_0xe74a('0x2c')]&&_0x5e112f['destcalleridname']!==_0xe74a('0x2b')?_0x5e112f[_0xe74a('0x2c')]:_0xe74a('0x2d');}return BPromise['resolve']()[_0xe74a('0x21')](cmContactRpc[_0xe74a('0x2e')](_0x3124b9))[_0xe74a('0x21')](function(_0x5c934a){_0x18eff8=_0x5c934a;_0x5941c7[_0xe74a('0x2f')](_0x5c934a);if(_0x18eff8){logger[_0xe74a('0x9')](_0xe74a('0x30'),_0x5e112f[_0xe74a('0x26')],_0x5c12b7['id'],_0x18eff8['id']);}return;});}else{logger[_0xe74a('0x9')](_0xe74a('0x31'),_0x5e112f[_0xe74a('0x26')],_0x5c12b7['id']);_0x3124b9[_0x1133a8]=_[_0xe74a('0xd')](_0x5e112f[_0xe74a('0x13')])?_0x5e112f[_0xe74a('0x15')]:_0x5e112f[_0xe74a('0x14')];if(_[_0xe74a('0xd')](_0x5e112f[_0xe74a('0x13')])){_0x3124b9[_0xe74a('0x16')]=_0x5e112f['calleridname']&&_0x5e112f[_0xe74a('0x2a')]!==_0xe74a('0x2b')?_0x5e112f['calleridname']:_0xe74a('0x2d');}else{_0x3124b9[_0xe74a('0x16')]=_0x5e112f['destcalleridname']&&_0x5e112f[_0xe74a('0x2c')]!==''?_0x5e112f[_0xe74a('0x2c')]:_0xe74a('0x2d');}_0x18eff8=_0x3124b9;_0x5941c7[_0xe74a('0x2f')](_0x3124b9);return;}}})[_0xe74a('0x21')](function(){if(_0x2e9af7){emit(_0x5e112f['uniqueid'],_0x5c12b7,util[_0xe74a('0x32')](_0xe74a('0x33'),_0x2e9af7[_0xe74a('0x34')]),util[_0xe74a('0x32')](_0xe74a('0x35'),_0x3f46f6[_0xe74a('0x36')][_0xe74a('0x37')]()),{'evt':_[_0xe74a('0x38')](_0x5e112f,{'autoCreate':_0x4dac3f}),'contact':_0x18eff8===undefined?{}:_0x18eff8,'contacts':_0x5941c7[_0xe74a('0x23')]===0x0?undefined:_0x5941c7});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 99cbc1f..e310734 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 _0xd0da=['checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','isNil','data3','data4','windowHeight','600','data6','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','integration','exec','routeId','script','buildUri','parse','query','search','channel','AllConditions','every','some','checkConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','event','queue','agent','lastevent','mailSubstatus','null','undefined','substatus','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./integration','./cmContact','./script','trigger','defaults','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','bind','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:acceptmessage','custom:offlineMessage','prototype','stringify','emit','clone','motionChannel','voice','checkTriggers','interface','hasOwnProperty','status'];(function(_0x4df97c,_0xc7d2f){var _0x1fd0c7=function(_0x2bbfd4){while(--_0x2bbfd4){_0x4df97c['push'](_0x4df97c['shift']());}};_0x1fd0c7(++_0xc7d2f);}(_0xd0da,0x1b1));var _0xad0d=function(_0xf7a9cf,_0x2cfa33){_0xf7a9cf=_0xf7a9cf-0x0;var _0x7fdc45=_0xd0da[_0xf7a9cf];return _0x7fdc45;};'use strict';var util=require(_0xad0d('0x0'));var _=require(_0xad0d('0x1'));var url=require(_0xad0d('0x2'));var Mustache=require(_0xad0d('0x3'));var Redis=require(_0xad0d('0x4'));var urlforward=require('./urlforward');var integration=require(_0xad0d('0x5'));var cmContact=require(_0xad0d('0x6'));var script=require(_0xad0d('0x7'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xad0d('0x8'));var ami=require('../ami');config['redis']=_[_0xad0d('0x9')](config[_0xad0d('0xa')],{'host':_0xad0d('0xb'),'port':0x18eb});var io=require(_0xad0d('0xc'))(new Redis(config['redis']));var operators={'equals':function(_0x3ef616,_0x162095){return _0x3ef616==_0x162095;},'not_equals':function(_0x40e717,_0x2a7875){return _0x40e717!=_0x2a7875;}};var barAndWebActions=[_0xad0d('0xd'),_0xad0d('0x2'),_0xad0d('0xe')];function Trigger(_0x2b898f){this[_0xad0d('0xf')]=_0x2b898f[_0xad0d('0xf')];this[_0xad0d('0x10')]=_0x2b898f[_0xad0d('0x10')];this[_0xad0d('0x11')]=_0x2b898f['voiceQueues'];this[_0xad0d('0x12')]=_0x2b898f[_0xad0d('0x12')];this['voiceExtensions']=_0x2b898f[_0xad0d('0x13')];this[_0xad0d('0x14')]=_0x2b898f['zendeskAccounts'];this[_0xad0d('0x15')]=_0x2b898f[_0xad0d('0x15')];this['salesforceAccounts']=_0x2b898f[_0xad0d('0x16')];this[_0xad0d('0x17')]=_0x2b898f['sugarcrmAccounts'];this[_0xad0d('0x18')]=_0x2b898f['zohoAccounts'];this['deskAccounts']=_0x2b898f[_0xad0d('0x19')];this[_0xad0d('0x1a')]=_0x2b898f[_0xad0d('0x1a')];this['servicenowAccounts']=_0x2b898f[_0xad0d('0x1b')];this[_0xad0d('0x1c')]=_0x2b898f['dynamics365Accounts'];this[_0xad0d('0x1d')]=_0x2b898f['freshsalesAccounts'];this['accounts']={'zendesk':this[_0xad0d('0x14')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xad0d('0x15')],'sugarcrm':this[_0xad0d('0x17')],'zoho':this[_0xad0d('0x18')],'desk':this['deskAccounts'],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xad0d('0x1c')],'freshsales':this[_0xad0d('0x1d')],'servicenow':this[_0xad0d('0x1b')]};ami['on']('custom:agentcalled',this['syncCustomEvent'][_0xad0d('0x1e')](this));ami['on']('custom:agentconnect',this[_0xad0d('0x1f')][_0xad0d('0x1e')](this));ami['on'](_0xad0d('0x20'),this[_0xad0d('0x1f')][_0xad0d('0x1e')](this));ami['on'](_0xad0d('0x21'),this['syncCustomEvent'][_0xad0d('0x1e')](this));ami['on'](_0xad0d('0x22'),this['syncCustomEvent']['bind'](this));ami['on'](_0xad0d('0x23'),this[_0xad0d('0x1f')][_0xad0d('0x1e')](this));ami['on']('custom:agentbusy',this[_0xad0d('0x1f')]['bind'](this));ami['on'](_0xad0d('0x24'),this[_0xad0d('0x1f')]['bind'](this));ami['on']('custom:agentreject',this[_0xad0d('0x1f')][_0xad0d('0x1e')](this));ami['on'](_0xad0d('0x25'),this['syncCustomEvent'][_0xad0d('0x1e')](this));ami['on'](_0xad0d('0x26'),this[_0xad0d('0x1f')]['bind'](this));ami['on'](_0xad0d('0x27'),this[_0xad0d('0x1f')]['bind'](this));ami['on'](_0xad0d('0x28'),this[_0xad0d('0x29')][_0xad0d('0x1e')](this));ami['on'](_0xad0d('0x2a'),this[_0xad0d('0x29')][_0xad0d('0x1e')](this));ami['on'](_0xad0d('0x2b'),this[_0xad0d('0x29')][_0xad0d('0x1e')](this));ami['on'](_0xad0d('0x2c'),this[_0xad0d('0x1f')]['bind'](this));ami['on'](_0xad0d('0x2d'),this['syncCustomEvent'][_0xad0d('0x1e')](this));ami['on'](_0xad0d('0x2e'),this[_0xad0d('0x1f')][_0xad0d('0x1e')](this));ami['on']('custom:incomingmessage',this[_0xad0d('0x1f')][_0xad0d('0x1e')](this));ami['on']('custom:outgoingmessage',this[_0xad0d('0x1f')][_0xad0d('0x1e')](this));ami['on'](_0xad0d('0x2f'),this[_0xad0d('0x1f')][_0xad0d('0x1e')](this));ami['on']('custom:rejectmessage',this[_0xad0d('0x1f')][_0xad0d('0x1e')](this));ami['on'](_0xad0d('0x30'),this[_0xad0d('0x1f')]['bind'](this));}Trigger[_0xad0d('0x31')]['emit']=function(_0xb52898,_0xf2b22d,_0xf762ac){logger['info'](_0xb52898,_0xf2b22d,JSON[_0xad0d('0x32')](_0xf762ac));io['to'](_0xb52898)[_0xad0d('0x33')](_0xf2b22d,_0xf762ac);};Trigger[_0xad0d('0x31')][_0xad0d('0x1f')]=function(_0x356aad){var _0x92391a=_[_0xad0d('0x34')](_0x356aad);if(typeof _0x92391a[_0xad0d('0x35')]==='undefined'){_0x92391a[_0xad0d('0x35')]=_0xad0d('0x36');}this[_0xad0d('0x37')](_0x92391a);};Trigger[_0xad0d('0x31')]['syncAgentDial']=function(_0x397294){if(this[_0xad0d('0x10')][_0x397294[_0xad0d('0x38')]]){this[_0xad0d('0x1f')](_0x397294);}};Trigger[_0xad0d('0x31')]['checkTriggers']=function(_0x51f042){var _0x1cefb0;for(var _0x4a19e1 in this[_0xad0d('0xf')]){if(this[_0xad0d('0xf')][_0xad0d('0x39')](_0x4a19e1)){if(this[_0xad0d('0xf')][_0x4a19e1][_0xad0d('0x3a')]){_0x1cefb0=this[_0xad0d('0x3b')](this[_0xad0d('0xf')][_0x4a19e1],_0x51f042);if(_0x1cefb0){_[_0xad0d('0x3c')](_0x51f042,_0x51f042[_0xad0d('0x3d')]);for(var _0x539d55=0x0,_0x469c13,_0x32e937,_0x13b83b;_0x539d550x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x437a96,_0x4a7e7e){var _0x1a3199=function(_0x2d261d){while(--_0x2d261d){_0x437a96['push'](_0x437a96['shift']());}};_0x1a3199(++_0x4a7e7e);}(_0x55ca,0x126));var _0xa55c=function(_0x131fe7,_0x21fcdb){_0x131fe7=_0x131fe7-0x0;var _0x2eddf3=_0x55ca[_0x131fe7];return _0x2eddf3;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index f8c7255..7fe9279 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 _0xaef7=['contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','telephone1','GET','contacts?$select=','replace','nothing','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','incident','incidents','assign','getString','Subjects','Descriptions','Fields','ticketType','phonecall','callDirection','queue','/contacts(','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','../../../../config/logger','redis','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','data2','resolve','POST','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','Bearer\x20','4.0','validateEmail','email','userEmail','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','outbound','destcalleridnum','calleridnum'];(function(_0x330ee7,_0x1730e4){var _0x1c27cc=function(_0x4a6f09){while(--_0x4a6f09){_0x330ee7['push'](_0x330ee7['shift']());}};_0x1c27cc(++_0x1730e4);}(_0xaef7,0x1e4));var _0x7aef=function(_0xf1f2e0,_0x37c415){_0xf1f2e0=_0xf1f2e0-0x0;var _0x991373=_0xaef7[_0xf1f2e0];return _0x991373;};'use strict';var _=require('lodash');var rp=require(_0x7aef('0x0'));var util=require(_0x7aef('0x1'));var intUtil=require(_0x7aef('0x2'));var md5=require(_0x7aef('0x3'));var Redis=require(_0x7aef('0x4'));var logger=require(_0x7aef('0x5'))('dynamics365');var config=require('../../../../config/environment');config[_0x7aef('0x6')]=_['defaults'](config[_0x7aef('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x7aef('0x7'))(new Redis(config[_0x7aef('0x6')]));function getAuthToken(_0x43b72a,_0x4a4a8d,_0x12a1cb){if(_0x43b72a['modernAuthentication']){_0x43b72a[_0x7aef('0x8')]=_0x43b72a[_0x7aef('0x9')][_0x7aef('0xa')];_0x43b72a[_0x7aef('0xb')]=_0x43b72a[_0x7aef('0x9')][_0x7aef('0xc')];return Promise[_0x7aef('0xd')](_0x43b72a['CloudProvider']['data5']);}var _0x12f342={'method':_0x7aef('0xe'),'uri':_0x4a4a8d,'form':{'client_id':_0x43b72a['clientId'],'resource':_0x43b72a[_0x7aef('0x8')],'username':_0x43b72a[_0x7aef('0xf')],'password':_0x43b72a[_0x7aef('0x10')],'grant_type':_0x7aef('0x10'),'client_secret':_0x43b72a[_0x7aef('0x11')]},'json':!![]};return rp(_0x12f342)[_0x7aef('0x12')](function(_0x581030){return _0x581030[_0x7aef('0x13')];})[_0x7aef('0x14')](function(_0x46b4db){logger[_0x7aef('0x15')]('['+[_0x12a1cb[_0x7aef('0x16')]()]+_0x7aef('0x17'));return _0x46b4db[_0x7aef('0x18')];});}function getUser(_0x33e940,_0x1c40ce,_0x19b2eb,_0x3d78ed,_0x32a768,_0x5759cd){return new Promise(function(_0x2adaef,_0x2451f6){return getAuthToken(_0x1c40ce,_0x3d78ed,_0x5759cd)[_0x7aef('0x12')](function(_0x3ac382){var _0x54e204={'method':'GET','uri':_0x32a768+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x7aef('0x19')+_0x3ac382,'OData-Version':_0x7aef('0x1a')},'json':!![]};return rp(_0x54e204);})[_0x7aef('0x12')](function(_0x461089){var _0x4a54f0=_0x461089['value'];var _0x24ecdf=![];var _0x2e778b=null;if(!_['isNil'](_0x19b2eb)){if(intUtil[_0x7aef('0x1b')](_0x19b2eb[_0x7aef('0x1c')])){_0x33e940[_0x7aef('0x1d')]=_0x19b2eb[_0x7aef('0x1c')];for(_0x2e778b=0x0;_0x2e778b<_0x4a54f0[_0x7aef('0x1e')];_0x2e778b++){if(_0x4a54f0[_0x2e778b][_0x7aef('0x1f')]===_0x19b2eb[_0x7aef('0x1c')]&&!_0x4a54f0[_0x2e778b][_0x7aef('0x20')]){_0x24ecdf=!![];logger['info']('['+[_0x5759cd[_0x7aef('0x16')]()]+_0x7aef('0x21')+_0x4a54f0[_0x2e778b][_0x7aef('0x22')]+'!');_0x33e940[_0x7aef('0x23')]=_0x4a54f0[_0x2e778b][_0x7aef('0x22')];}}}}if(!_0x24ecdf){logger[_0x7aef('0x24')]('['+[_0x5759cd[_0x7aef('0x16')]()]+_0x7aef('0x25'));_0x33e940[_0x7aef('0x1d')]=_0x1c40ce['username'];for(_0x2e778b=0x0;_0x2e778b<_0x4a54f0[_0x7aef('0x1e')];_0x2e778b++){if(_0x4a54f0[_0x2e778b][_0x7aef('0x1f')]===_0x1c40ce[_0x7aef('0xf')]){_0x33e940['userId']=_0x4a54f0[_0x2e778b][_0x7aef('0x22')];}}}_0x2adaef(_0x33e940);})[_0x7aef('0x14')](function(_0x3866cc){_0x2451f6(_0x3866cc[_0x7aef('0x18')]);});});}function createEndUser(_0x4660ad,_0x413555,_0x46f993,_0xea7944,_0x19d6b7,_0x79da92,_0x4bafcc){return new Promise(function(_0x3adf0e,_0x175925){return getAuthToken(_0x413555,_0x46f993,_0x79da92)['then'](function(_0x25af2d){var _0x41c67a=_0x79da92['toLowerCase']()===_0x7aef('0x26')?_0x19d6b7[_0x7aef('0x27')]:_0x19d6b7[_0x7aef('0x28')];var _0x3e80b5={'method':_0x7aef('0xe'),'uri':_0xea7944+_0x7aef('0x29'),'body':{'fullname':_0x41c67a,'firstname':_0x41c67a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x7aef('0x2a')+_0x4660ad[_0x7aef('0x23')]+')'},'headers':{'Authorization':_0x7aef('0x19')+_0x25af2d,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x3e80b5[_0x7aef('0x2b')][_0x4bafcc]=_0x41c67a;return rp(_0x3e80b5);})[_0x7aef('0x12')](function(_0x51fa05){var _0x2aaa3c=_0x51fa05[_0x7aef('0x2c')][_0x7aef('0x2d')];var _0x72a23a=_0x2aaa3c[_0x7aef('0x2e')](_0x2aaa3c[_0x7aef('0x2f')]('(')+0x1,_0x2aaa3c[_0x7aef('0x2f')](')'));_0x4660ad[_0x7aef('0x30')]=_0x72a23a;_0x3adf0e(_0x4660ad);})[_0x7aef('0x14')](function(_0xd692de){_0x175925(_0xd692de[_0x7aef('0x18')]);});});}function getEndUser(_0x44b5f1,_0x361436,_0x5f4658,_0xb53d3b,_0x3da508,_0x4cd8a7,_0x2d3e70,_0x12a34f){var _0x104e8e=_0x4cd8a7[_0x7aef('0x31')]()==='outbound'?_0x3da508[_0x7aef('0x27')]:_0x3da508['calleridnum'];return getAuthToken(_0x361436,_0x5f4658,_0x4cd8a7)[_0x7aef('0x12')](function(_0x44150d){_0x12a34f=_0x12a34f?_0x12a34f:_0x7aef('0x32');var _0x111e49={'method':_0x7aef('0x33'),'uri':_0xb53d3b+_0x7aef('0x34')+_0x12a34f+'&$filter='+_0x12a34f+'\x20eq\x20\x27'+_0x104e8e[_0x7aef('0x35')]('+','%2b')+'\x27','headers':{'Authorization':_0x7aef('0x19')+_0x44150d,'If-None-Match':null,'OData-Version':_0x7aef('0x1a')},'json':!![]};return rp(_0x111e49);})['then'](function(_0x192049){var _0x3dab97=![];if(!_0x192049)return _0x3dab97;var _0x195e3c=_0x192049['value'];for(var _0x5e518e=0x0;_0x5e518e<_0x195e3c['length'];_0x5e518e++){if(_0x195e3c[_0x5e518e][_0x12a34f]===_0x104e8e){_0x3dab97=!![];_0x44b5f1['enduserId']=_0x195e3c[_0x5e518e]['contactid'];}}return _0x3dab97;})[_0x7aef('0x12')](function(_0x29017f){if(_0x29017f)return _0x44b5f1;if(_0x2d3e70===_0x7aef('0x36')){logger['info']('['+[_0x4cd8a7['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x44b5f1;}return createEndUser(_0x44b5f1,_0x361436,_0x5f4658,_0xb53d3b,_0x3da508,_0x4cd8a7,_0x12a34f)['then'](function(_0x51e4ef){logger['info']('['+[_0x4cd8a7[_0x7aef('0x16')]()]+']\x20Enduser\x20created!',_0x51e4ef[_0x7aef('0x30')]);return _0x51e4ef;});});}function getCustomFields(_0x28b0ca,_0x1941f2,_0x32e316){var _0x1e5bdf={};if(_0x28b0ca[_0x7aef('0x1e')]>0x0){_[_0x7aef('0x37')](_0x28b0ca,function(_0x496e94){if(_[_0x7aef('0x38')]([_0x7aef('0x39'),_0x7aef('0x3a')],_0x496e94[_0x7aef('0x3b')])&&_0x496e94[_0x7aef('0x3c')]&&!_0x496e94[_0x7aef('0x3d')]){var _0x38a933=_0x496e94[_0x7aef('0x3e')][_0x7aef('0x31')]();var _0x60860b=_0x38a933[_0x7aef('0x2e')](0x0,_0x38a933[_0x7aef('0x3f')]('_'));var _0x3a1ae9=_0x38a933[_0x7aef('0x2e')](_0x38a933[_0x7aef('0x3f')]('_')+0x1);if(_0x60860b===_0x32e316){_0x1e5bdf[_0x3a1ae9]=_0x496e94[_0x7aef('0x40')];}}});}return _0x1e5bdf;}function getTicket(_0x3f5475,_0x4cef71,_0x41846e,_0x368f74,_0x85b5db,_0x170521,_0x45149a){return new Promise(function(_0x5b456c,_0x3fba8e){var _0x39ab61;return getAuthToken(_0x4cef71,_0x41846e,_0x45149a)[_0x7aef('0x12')](function(_0x109ad8){if(_0x170521['ticketType']===_0x7aef('0x41')){_0x39ab61={'method':_0x7aef('0xe'),'uri':_0x368f74+_0x7aef('0x42'),'body':Object[_0x7aef('0x43')]({},{'title':intUtil[_0x7aef('0x44')](_0x170521[_0x7aef('0x45')],_0x85b5db,'\x20'),'description':intUtil[_0x7aef('0x44')](_0x170521[_0x7aef('0x46')],_0x85b5db,'\x0a'),'customerid_contact@odata.bind':_0x3f5475[_0x7aef('0x30')]?'/contacts('+_0x3f5475[_0x7aef('0x30')]+')':undefined,'ownerid@odata.bind':_0x7aef('0x2a')+_0x3f5475[_0x7aef('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x170521[_0x7aef('0x47')],_0x85b5db,_0x170521['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x109ad8,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x170521[_0x7aef('0x48')]===_0x7aef('0x49')){var _0x14bbbf=_0x3f5475[_0x7aef('0x30')]?[{'partyid_systemuser@odata.bind':_0x7aef('0x2a')+_0x3f5475[_0x7aef('0x23')]+')','participationtypemask':_0x3f5475[_0x7aef('0x4a')]===_0x7aef('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':_0x7aef('0x4c')+_0x3f5475['enduserId']+')','participationtypemask':_0x3f5475[_0x7aef('0x4a')]===_0x7aef('0x4b')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x7aef('0x2a')+_0x3f5475['userId']+')','participationtypemask':_0x3f5475[_0x7aef('0x4a')]===_0x7aef('0x4b')?0x2:0x1}];_0x39ab61={'method':_0x7aef('0xe'),'uri':_0x368f74+'phonecalls','body':Object['assign']({},{'subject':intUtil['getString'](_0x170521[_0x7aef('0x45')],_0x85b5db,'\x20'),'phonenumber':String(_0x85b5db[_0x7aef('0x28')]),'description':intUtil[_0x7aef('0x44')](_0x170521[_0x7aef('0x46')],_0x85b5db,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3f5475[_0x7aef('0x30')]?_0x7aef('0x4c')+_0x3f5475[_0x7aef('0x30')]+')':undefined,'ownerid@odata.bind':_0x7aef('0x2a')+_0x3f5475[_0x7aef('0x23')]+')','directioncode':_0x3f5475[_0x7aef('0x4a')]===_0x7aef('0x4b')?![]:!![],'phonecall_activity_parties':_0x14bbbf},getCustomFields(_0x170521[_0x7aef('0x47')],_0x85b5db,_0x170521['ticketType'])),'headers':{'Authorization':_0x7aef('0x19')+_0x109ad8,'OData-Version':_0x7aef('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x39ab61);})[_0x7aef('0x12')](function(_0x4dd41b){var _0x5a8957=_0x4dd41b[_0x7aef('0x2c')][_0x7aef('0x2d')];var _0x3e443c=_0x5a8957[_0x7aef('0x2e')](_0x5a8957[_0x7aef('0x2f')]('(')+0x1,_0x5a8957[_0x7aef('0x2f')](')'));_0x3f5475[_0x7aef('0x4d')]=_0x3e443c;_0x5b456c(_0x3f5475);})[_0x7aef('0x14')](function(_0x461d12){_0x3fba8e(_0x461d12[_0x7aef('0x18')]);});});}function emit(_0x38a22d,_0x11db4b,_0x40e709,_0x4b7803){var _0x514edd={'uri':util['format'](_0x7aef('0x4e'),_0x38a22d,_0x40e709,_0x4b7803)};io['to'](util[_0x7aef('0x4f')](_0x7aef('0x50'),_0x11db4b))[_0x7aef('0x51')](_0x7aef('0x52'),_0x514edd);}exports['cs']=function(_0xf06434,_0x12cda7,_0x524903,_0x1515e1,_0x1a7252,_0x95298e,_0x53cd24,_0x4a569c){var _0x4c2668={};_0x95298e[_0x7aef('0x8')]=_0x95298e[_0x7aef('0x53')]?intUtil[_0x7aef('0x54')](_0x95298e[_0x7aef('0x9')][_0x7aef('0xa')]):intUtil[_0x7aef('0x54')](_0x95298e[_0x7aef('0x8')]);_0x95298e[_0x7aef('0x55')]=intUtil[_0x7aef('0x54')](_0x95298e[_0x7aef('0x55')]);_0x4c2668['callDirection']=_0x4a569c===_0x7aef('0x4b')||_0x4a569c===_0x7aef('0x56')?'queue':_0x7aef('0x26');var _0x5ac2ec=_0x95298e[_0x7aef('0x53')]?util[_0x7aef('0x4f')]('%s/api/data/v9.0/',_0x95298e[_0x7aef('0x9')][_0x7aef('0xa')]):util[_0x7aef('0x4f')](_0x7aef('0x57'),_0x95298e['remoteUri']);var _0x488d13=util[_0x7aef('0x4f')]('https://login.microsoftonline.com/%s/oauth2/token',_0x95298e[_0x7aef('0xb')]);var _0x38c2a5=util[_0x7aef('0x4f')](_0x7aef('0x58'),_0x95298e[_0x7aef('0x55')],_0x12cda7[_0x7aef('0x59')],md5(_0x12cda7[_0x7aef('0x59')]));if(_0x1a7252&&_0x1a7252[_0x7aef('0x5a')]){logger['info'](_0x7aef('0x5b'),_0x7aef('0x5c'));_0x12cda7[_0x7aef('0x5d')]=_0x38c2a5;}else if(_0x53cd24&&_0x53cd24[_0x7aef('0x5e')]&&_0x53cd24['recordingFormat']!=='none'){logger[_0x7aef('0x24')]('[OUTBOUND]',_0x7aef('0x5c'));_0x12cda7[_0x7aef('0x5d')]=_0x38c2a5;}else{_0x12cda7[_0x7aef('0x5d')]='';}return getUser(_0x4c2668,_0x95298e,_0x1515e1,_0x488d13,_0x5ac2ec,_0x4a569c)[_0x7aef('0x12')](function(_0x149bb3){logger[_0x7aef('0x24')]('['+_0x4a569c['toUpperCase']()+_0x7aef('0x5f'),_0x149bb3[_0x7aef('0x23')]);logger[_0x7aef('0x24')]('['+_0x4a569c[_0x7aef('0x16')]()+_0x7aef('0x60'),_0x149bb3[_0x7aef('0x1d')]);return getEndUser(_0x149bb3,_0x95298e,_0x488d13,_0x5ac2ec,_0x12cda7,_0x4a569c,_0x524903[_0x7aef('0x61')],_0x524903['additionalSearchContact']);})[_0x7aef('0x12')](function(_0x4e435e){logger[_0x7aef('0x24')]('['+_0x4a569c['toUpperCase']()+_0x7aef('0x62'),_0x4e435e['enduserId']);logger[_0x7aef('0x24')]('['+_0x4a569c[_0x7aef('0x16')]()+_0x7aef('0x63'),_0x12cda7[_0x7aef('0x28')]);return getTicket(_0x4e435e,_0x95298e,_0x488d13,_0x5ac2ec,_0x12cda7,_0x524903,_0x4a569c);})[_0x7aef('0x12')](function(_0xb96880){logger[_0x7aef('0x24')](util['format']('['+_0x4a569c[_0x7aef('0x16')]()+_0x7aef('0x64'),_0x524903[_0x7aef('0x48')],_0xb96880[_0x7aef('0x4d')]));logger[_0x7aef('0x24')](util[_0x7aef('0x4f')]('['+_0x4a569c[_0x7aef('0x16')]()+']\x20Call\x20direction:\x20%s',_0x4a569c));if(_0x4a569c!==_0x7aef('0x56')&&_0x524903[_0x7aef('0x65')]){logger['info']('['+_0x4a569c[_0x7aef('0x16')]()+']',_0x7aef('0x66'));emit(_0x95298e[_0x7aef('0x8')],_0x1515e1[_0x7aef('0x67')],_0x524903[_0x7aef('0x48')],_0xb96880[_0x7aef('0x4d')]);}})[_0x7aef('0x14')](function(_0x46ba51){logger['error']('['+_0x4a569c['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x46ba51['message']);console[_0x7aef('0x15')](_0x7aef('0x68'),_0x46ba51);});}; \ No newline at end of file +var _0x2d51=['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!','recordingFormat','[OUTBOUND]','recordingURL',']\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','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error','Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data7','tenantId','data2','POST','clientId','remoteUri','password','clientSecret','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','internalemailaddress','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','length','toLowerCase','outbound','calleridnum','headers','odata-entityid','substring','enduserId','destcalleridnum','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','string','picklist','type','nameField','content','incident','assign','getString','Descriptions','/contacts(','Fields','ticketType','phonecall','queue','callDirection','/systemusers(','Subjects','lastIndexOf','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl'];(function(_0x4dc5ec,_0x254f19){var _0x585bee=function(_0x20079b){while(--_0x20079b){_0x4dc5ec['push'](_0x4dc5ec['shift']());}};_0x585bee(++_0x254f19);}(_0x2d51,0x1c8));var _0x12d5=function(_0x54cb59,_0x451548){_0x54cb59=_0x54cb59-0x0;var _0x4c9cdc=_0x2d51[_0x54cb59];return _0x4c9cdc;};'use strict';var _=require('lodash');var rp=require(_0x12d5('0x0'));var util=require(_0x12d5('0x1'));var intUtil=require(_0x12d5('0x2'));var md5=require(_0x12d5('0x3'));var Redis=require(_0x12d5('0x4'));var logger=require(_0x12d5('0x5'))('dynamics365');var config=require(_0x12d5('0x6'));config[_0x12d5('0x7')]=_['defaults'](config['redis'],{'host':_0x12d5('0x8'),'port':0x18eb});var io=require(_0x12d5('0x9'))(new Redis(config['redis']));function getAuthToken(_0x37e10e,_0x5b26ae,_0x4c9a57){if(_0x37e10e[_0x12d5('0xa')]){_0x37e10e['remoteUri']=_0x37e10e[_0x12d5('0xb')][_0x12d5('0xc')];_0x37e10e[_0x12d5('0xd')]=_0x37e10e[_0x12d5('0xb')][_0x12d5('0xe')];return Promise['resolve'](_0x37e10e[_0x12d5('0xb')]['data5']);}var _0x37d670={'method':_0x12d5('0xf'),'uri':_0x5b26ae,'form':{'client_id':_0x37e10e[_0x12d5('0x10')],'resource':_0x37e10e[_0x12d5('0x11')],'username':_0x37e10e['username'],'password':_0x37e10e['password'],'grant_type':_0x12d5('0x12'),'client_secret':_0x37e10e[_0x12d5('0x13')]},'json':!![]};return rp(_0x37d670)['then'](function(_0x188cdd){return _0x188cdd[_0x12d5('0x14')];})[_0x12d5('0x15')](function(_0x5446e1){logger['error']('['+[_0x4c9a57[_0x12d5('0x16')]()]+_0x12d5('0x17'));return _0x5446e1[_0x12d5('0x18')];});}function getUser(_0x4ef9af,_0x31a93b,_0x529113,_0x5e1601,_0x4259cc,_0xf29010){return new Promise(function(_0xbac7,_0x2effab){return getAuthToken(_0x31a93b,_0x5e1601,_0xf29010)[_0x12d5('0x19')](function(_0x12b73f){var _0x4211fe={'method':_0x12d5('0x1a'),'uri':_0x4259cc+_0x12d5('0x1b'),'headers':{'Authorization':_0x12d5('0x1c')+_0x12b73f,'OData-Version':_0x12d5('0x1d')},'json':!![]};return rp(_0x4211fe);})[_0x12d5('0x19')](function(_0x550519){var _0x3a7cfc=_0x550519[_0x12d5('0x1e')];var _0x377285=![];var _0x29e849=null;if(!_['isNil'](_0x529113)){if(intUtil[_0x12d5('0x1f')](_0x529113[_0x12d5('0x20')])){_0x4ef9af[_0x12d5('0x21')]=_0x529113[_0x12d5('0x20')];for(_0x29e849=0x0;_0x29e849<_0x3a7cfc['length'];_0x29e849++){if(_0x3a7cfc[_0x29e849][_0x12d5('0x22')]===_0x529113['email']&&!_0x3a7cfc[_0x29e849]['isdisabled']){_0x377285=!![];logger[_0x12d5('0x23')]('['+[_0xf29010['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x3a7cfc[_0x29e849][_0x12d5('0x24')]+'!');_0x4ef9af[_0x12d5('0x25')]=_0x3a7cfc[_0x29e849][_0x12d5('0x24')];}}}}if(!_0x377285){logger[_0x12d5('0x23')]('['+[_0xf29010[_0x12d5('0x16')]()]+_0x12d5('0x26'));_0x4ef9af[_0x12d5('0x21')]=_0x31a93b[_0x12d5('0x27')];for(_0x29e849=0x0;_0x29e849<_0x3a7cfc[_0x12d5('0x28')];_0x29e849++){if(_0x3a7cfc[_0x29e849][_0x12d5('0x22')]===_0x31a93b[_0x12d5('0x27')]){_0x4ef9af[_0x12d5('0x25')]=_0x3a7cfc[_0x29e849][_0x12d5('0x24')];}}}_0xbac7(_0x4ef9af);})[_0x12d5('0x15')](function(_0x427cd0){_0x2effab(_0x427cd0[_0x12d5('0x18')]);});});}function createEndUser(_0x52f7cb,_0x1d9b60,_0x5d5541,_0x36915d,_0x572f33,_0x489b14,_0xf4649c){return new Promise(function(_0x230435,_0x355d57){return getAuthToken(_0x1d9b60,_0x5d5541,_0x489b14)[_0x12d5('0x19')](function(_0x575324){var _0x28cfa1=_0x489b14[_0x12d5('0x29')]()===_0x12d5('0x2a')?_0x572f33['destcalleridnum']:_0x572f33[_0x12d5('0x2b')];var _0x7fe1dd={'method':_0x12d5('0xf'),'uri':_0x36915d+'contacts','body':{'fullname':_0x28cfa1,'firstname':_0x28cfa1,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x52f7cb[_0x12d5('0x25')]+')'},'headers':{'Authorization':_0x12d5('0x1c')+_0x575324,'OData-Version':_0x12d5('0x1d')},'json':!![],'resolveWithFullResponse':!![]};_0x7fe1dd['body'][_0xf4649c]=_0x28cfa1;return rp(_0x7fe1dd);})[_0x12d5('0x19')](function(_0x48b7da){var _0xaad909=_0x48b7da[_0x12d5('0x2c')][_0x12d5('0x2d')];var _0x48d206=_0xaad909[_0x12d5('0x2e')](_0xaad909['lastIndexOf']('(')+0x1,_0xaad909['lastIndexOf'](')'));_0x52f7cb[_0x12d5('0x2f')]=_0x48d206;_0x230435(_0x52f7cb);})['catch'](function(_0x3f0fa2){_0x355d57(_0x3f0fa2[_0x12d5('0x18')]);});});}function getEndUser(_0x2c069e,_0x5e1340,_0x26bcde,_0x4ded13,_0x16034,_0x3098e1,_0x1b0af6,_0x235644){var _0x970b7b=_0x3098e1['toLowerCase']()==='outbound'?_0x16034[_0x12d5('0x30')]:_0x16034[_0x12d5('0x2b')];return getAuthToken(_0x5e1340,_0x26bcde,_0x3098e1)[_0x12d5('0x19')](function(_0x2d9dcc){_0x235644=_0x235644?_0x235644:'telephone1';var _0x4fb1e0={'method':'GET','uri':_0x4ded13+_0x12d5('0x31')+_0x235644+_0x12d5('0x32')+_0x235644+_0x12d5('0x33')+_0x970b7b[_0x12d5('0x34')]('+',_0x12d5('0x35'))+'\x27','headers':{'Authorization':_0x12d5('0x1c')+_0x2d9dcc,'If-None-Match':null,'OData-Version':_0x12d5('0x1d')},'json':!![]};return rp(_0x4fb1e0);})[_0x12d5('0x19')](function(_0xa7d18){var _0x55782f=![];if(!_0xa7d18)return _0x55782f;var _0x443634=_0xa7d18['value'];for(var _0x37081e=0x0;_0x37081e<_0x443634[_0x12d5('0x28')];_0x37081e++){if(_0x443634[_0x37081e][_0x235644]===_0x970b7b){_0x55782f=!![];_0x2c069e['enduserId']=_0x443634[_0x37081e][_0x12d5('0x36')];}}return _0x55782f;})[_0x12d5('0x19')](function(_0x23d58c){if(_0x23d58c)return _0x2c069e;if(_0x1b0af6==='nothing'){logger[_0x12d5('0x23')]('['+[_0x3098e1[_0x12d5('0x16')]()]+_0x12d5('0x37'));return _0x2c069e;}return createEndUser(_0x2c069e,_0x5e1340,_0x26bcde,_0x4ded13,_0x16034,_0x3098e1,_0x235644)[_0x12d5('0x19')](function(_0x429230){logger['info']('['+[_0x3098e1['toUpperCase']()]+_0x12d5('0x38'),_0x429230[_0x12d5('0x2f')]);return _0x429230;});});}function getCustomFields(_0x41e3fb,_0x595839,_0x366f16){var _0x151db0={};if(_0x41e3fb[_0x12d5('0x28')]>0x0){_['forEach'](_0x41e3fb,function(_0x298cd9){if(_[_0x12d5('0x39')]([_0x12d5('0x3a'),_0x12d5('0x3b')],_0x298cd9[_0x12d5('0x3c')])&&_0x298cd9[_0x12d5('0x3d')]&&!_0x298cd9['customField']){var _0x162923=_0x298cd9['idField'][_0x12d5('0x29')]();var _0x5ef6e3=_0x162923['substring'](0x0,_0x162923['indexOf']('_'));var _0x2950ef=_0x162923[_0x12d5('0x2e')](_0x162923['indexOf']('_')+0x1);if(_0x5ef6e3===_0x366f16){_0x151db0[_0x2950ef]=_0x298cd9[_0x12d5('0x3e')];}}});}return _0x151db0;}function getTicket(_0x54b8fc,_0x23d744,_0x1a5dc9,_0x12dd1a,_0x45ad9f,_0x5c4fc2,_0x514048){return new Promise(function(_0x80d47c,_0x561fc5){var _0x5c81a7;return getAuthToken(_0x23d744,_0x1a5dc9,_0x514048)[_0x12d5('0x19')](function(_0x37575d){if(_0x5c4fc2['ticketType']===_0x12d5('0x3f')){_0x5c81a7={'method':_0x12d5('0xf'),'uri':_0x12dd1a+'incidents','body':Object[_0x12d5('0x40')]({},{'title':intUtil[_0x12d5('0x41')](_0x5c4fc2['Subjects'],_0x45ad9f,'\x20'),'description':intUtil['getString'](_0x5c4fc2[_0x12d5('0x42')],_0x45ad9f,'\x0a'),'customerid_contact@odata.bind':_0x54b8fc[_0x12d5('0x2f')]?_0x12d5('0x43')+_0x54b8fc['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x54b8fc[_0x12d5('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x5c4fc2[_0x12d5('0x44')],_0x45ad9f,_0x5c4fc2[_0x12d5('0x45')])),'headers':{'Authorization':_0x12d5('0x1c')+_0x37575d,'OData-Version':_0x12d5('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5c4fc2[_0x12d5('0x45')]===_0x12d5('0x46')){var _0x5b8fda=_0x54b8fc[_0x12d5('0x2f')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x54b8fc[_0x12d5('0x25')]+')','participationtypemask':_0x54b8fc['callDirection']===_0x12d5('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0x12d5('0x43')+_0x54b8fc[_0x12d5('0x2f')]+')','participationtypemask':_0x54b8fc[_0x12d5('0x48')]===_0x12d5('0x47')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x12d5('0x49')+_0x54b8fc[_0x12d5('0x25')]+')','participationtypemask':_0x54b8fc[_0x12d5('0x48')]==='queue'?0x2:0x1}];_0x5c81a7={'method':'POST','uri':_0x12dd1a+'phonecalls','body':Object[_0x12d5('0x40')]({},{'subject':intUtil['getString'](_0x5c4fc2[_0x12d5('0x4a')],_0x45ad9f,'\x20'),'phonenumber':String(_0x45ad9f[_0x12d5('0x2b')]),'description':intUtil[_0x12d5('0x41')](_0x5c4fc2[_0x12d5('0x42')],_0x45ad9f,'\x0a'),'regardingobjectid_contact@odata.bind':_0x54b8fc[_0x12d5('0x2f')]?_0x12d5('0x43')+_0x54b8fc[_0x12d5('0x2f')]+')':undefined,'ownerid@odata.bind':_0x12d5('0x49')+_0x54b8fc[_0x12d5('0x25')]+')','directioncode':_0x54b8fc[_0x12d5('0x48')]===_0x12d5('0x47')?![]:!![],'phonecall_activity_parties':_0x5b8fda},getCustomFields(_0x5c4fc2['Fields'],_0x45ad9f,_0x5c4fc2['ticketType'])),'headers':{'Authorization':_0x12d5('0x1c')+_0x37575d,'OData-Version':_0x12d5('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5c81a7);})['then'](function(_0x50c092){var _0x2a5231=_0x50c092['headers']['odata-entityid'];var _0x302189=_0x2a5231[_0x12d5('0x2e')](_0x2a5231[_0x12d5('0x4b')]('(')+0x1,_0x2a5231[_0x12d5('0x4b')](')'));_0x54b8fc[_0x12d5('0x4c')]=_0x302189;_0x80d47c(_0x54b8fc);})['catch'](function(_0x41342b){_0x561fc5(_0x41342b['message']);});});}function emit(_0x330029,_0xa07d24,_0x3cb75e,_0x179eb4){var _0x40e188={'uri':util[_0x12d5('0x4d')](_0x12d5('0x4e'),_0x330029,_0x3cb75e,_0x179eb4)};io['to'](util['format'](_0x12d5('0x4f'),_0xa07d24))[_0x12d5('0x50')](_0x12d5('0x51'),_0x40e188);}exports['cs']=function(_0x35342,_0x2b7162,_0x5434ff,_0x15653f,_0x22f558,_0x593ff8,_0x16c4db,_0x2587e9){var _0x44482f={};_0x593ff8[_0x12d5('0x11')]=_0x593ff8[_0x12d5('0xa')]?intUtil[_0x12d5('0x52')](_0x593ff8[_0x12d5('0xb')]['data7']):intUtil[_0x12d5('0x52')](_0x593ff8[_0x12d5('0x11')]);_0x593ff8[_0x12d5('0x53')]=intUtil[_0x12d5('0x52')](_0x593ff8['serverUrl']);_0x44482f[_0x12d5('0x48')]=_0x2587e9==='queue'||_0x2587e9===_0x12d5('0x54')?_0x12d5('0x47'):_0x12d5('0x2a');var _0x1b9f40=_0x593ff8[_0x12d5('0xa')]?util[_0x12d5('0x4d')](_0x12d5('0x55'),_0x593ff8[_0x12d5('0xb')][_0x12d5('0xc')]):util[_0x12d5('0x4d')](_0x12d5('0x55'),_0x593ff8[_0x12d5('0x11')]);var _0xc34b56=util['format'](_0x12d5('0x56'),_0x593ff8[_0x12d5('0xd')]);var _0x14b338=util[_0x12d5('0x4d')](_0x12d5('0x57'),_0x593ff8[_0x12d5('0x53')],_0x2b7162[_0x12d5('0x58')],md5(_0x2b7162[_0x12d5('0x58')]));if(_0x22f558&&_0x22f558[_0x12d5('0x59')]){logger['info'](_0x12d5('0x5a'),_0x12d5('0x5b'));_0x2b7162['recordingURL']=_0x14b338;}else if(_0x16c4db&&_0x16c4db[_0x12d5('0x5c')]&&_0x16c4db[_0x12d5('0x5c')]!=='none'){logger['info'](_0x12d5('0x5d'),_0x12d5('0x5b'));_0x2b7162[_0x12d5('0x5e')]=_0x14b338;}else{_0x2b7162[_0x12d5('0x5e')]='';}return getUser(_0x44482f,_0x593ff8,_0x15653f,_0xc34b56,_0x1b9f40,_0x2587e9)[_0x12d5('0x19')](function(_0x5b52c9){logger[_0x12d5('0x23')]('['+_0x2587e9['toUpperCase']()+_0x12d5('0x5f'),_0x5b52c9[_0x12d5('0x25')]);logger[_0x12d5('0x23')]('['+_0x2587e9[_0x12d5('0x16')]()+_0x12d5('0x60'),_0x5b52c9['userEmail']);return getEndUser(_0x5b52c9,_0x593ff8,_0xc34b56,_0x1b9f40,_0x2b7162,_0x2587e9,_0x5434ff[_0x12d5('0x61')],_0x5434ff[_0x12d5('0x62')]);})[_0x12d5('0x19')](function(_0x53bede){logger[_0x12d5('0x23')]('['+_0x2587e9[_0x12d5('0x16')]()+_0x12d5('0x63'),_0x53bede[_0x12d5('0x2f')]);logger[_0x12d5('0x23')]('['+_0x2587e9[_0x12d5('0x16')]()+_0x12d5('0x64'),_0x2b7162[_0x12d5('0x2b')]);return getTicket(_0x53bede,_0x593ff8,_0xc34b56,_0x1b9f40,_0x2b7162,_0x5434ff,_0x2587e9);})[_0x12d5('0x19')](function(_0x4c16a9){logger[_0x12d5('0x23')](util[_0x12d5('0x4d')]('['+_0x2587e9[_0x12d5('0x16')]()+_0x12d5('0x65'),_0x5434ff['ticketType'],_0x4c16a9[_0x12d5('0x4c')]));logger[_0x12d5('0x23')](util[_0x12d5('0x4d')]('['+_0x2587e9[_0x12d5('0x16')]()+_0x12d5('0x66'),_0x2587e9));if(_0x2587e9!==_0x12d5('0x54')&&_0x5434ff[_0x12d5('0x67')]){logger['info']('['+_0x2587e9[_0x12d5('0x16')]()+']',_0x12d5('0x68'));emit(_0x593ff8[_0x12d5('0x11')],_0x15653f[_0x12d5('0x69')],_0x5434ff[_0x12d5('0x45')],_0x4c16a9[_0x12d5('0x4c')]);}})[_0x12d5('0x15')](function(_0x2e003f){logger[_0x12d5('0x6a')]('['+_0x2587e9[_0x12d5('0x16')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x2e003f[_0x12d5('0x18')]);console[_0x12d5('0x6a')](_0x12d5('0x6b'),_0x2e003f);});}; \ 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 2f3d310..ea36356 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 _0x7e75=['custom_fields','keyBy','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','stringify','map','forEach','string','picklist','type','customField','nameField','toLowerCase','content','toString','includes','idField','push','variable','variableName','Variable','name','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','monitor_format','lastevent','toUpperCase','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','Fields'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7e75,0x14f));var _0x57e7=function(_0x451918,_0x528158){_0x451918=_0x451918-0x0;var _0xc9c86=_0x7e75[_0x451918];return _0xc9c86;};'use strict';var _=require('lodash');var rp=require(_0x57e7('0x0'));var md5=require(_0x57e7('0x1'));var util=require(_0x57e7('0x2'));var Redis=require('ioredis');var intUtil=require(_0x57e7('0x3'));var config=require(_0x57e7('0x4'));var logger=require(_0x57e7('0x5'))(_0x57e7('0x6'));config[_0x57e7('0x7')]=_[_0x57e7('0x8')](config[_0x57e7('0x7')],{'host':_0x57e7('0x9'),'port':0x18eb});var io=require(_0x57e7('0xa'))(new Redis(config[_0x57e7('0x7')]));var headers={'Content-Type':_0x57e7('0xb'),'Accept':'application/json'};function emit(_0x1ad686,_0x449a1a,_0x5a2214){io['to'](_0x1ad686)['emit'](_0x449a1a,_0x5a2214);}function getTicket(_0x29b5c5,_0x53a9a6,_0x96e1c5,_0x4b5e90,_0x3f45ef){logger[_0x57e7('0xc')](_0x57e7('0xd'));var _0x197bcb=_[_0x57e7('0xe')]({'responder_id':_0x53a9a6['id'],'requester_id':_0x96e1c5['id'],'name':util[_0x57e7('0xf')](_0x57e7('0x10'),_0x3f45ef[_0x57e7('0x11')]),'phone':_0x3f45ef[_0x57e7('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x57e7('0x13')](_0x4b5e90[_0x57e7('0x14')],_0x3f45ef,'\x20'),'description':intUtil[_0x57e7('0x13')](_0x4b5e90[_0x57e7('0x15')],_0x3f45ef,_0x57e7('0x16')),'tags':getTags(_0x4b5e90[_0x57e7('0x17')],'name')},getCustomFields(_0x4b5e90[_0x57e7('0x18')],_0x3f45ef));_0x197bcb[_0x57e7('0x19')]=_['mapValues'](_[_0x57e7('0x1a')](_0x197bcb[_0x57e7('0x19')],'id'),'value');return request({'uri':util[_0x57e7('0xf')](_0x57e7('0x1b'),_0x29b5c5['remoteUri']),'method':_0x57e7('0x1c'),'body':_0x197bcb})[_0x57e7('0x1d')](function(_0x546a48){logger[_0x57e7('0xc')](_0x57e7('0x1e'));return _0x546a48;});}function getUser(_0x4ffc64,_0x18c3da){if(intUtil[_0x57e7('0x1f')](_0x18c3da)){return request({'uri':util[_0x57e7('0xf')](_0x57e7('0x20'),_0x4ffc64[_0x57e7('0x21')]),'qs':{'email':_0x18c3da}})[_0x57e7('0x1d')](function(_0x435cd3){if(_0x435cd3[_0x57e7('0x22')]){logger['info'](_0x57e7('0x23'));return _['find'](_0x435cd3,function(_0x19d009){return _0x19d009[_0x57e7('0x24')][_0x57e7('0x25')]===_0x18c3da;});}else{logger['info'](_0x57e7('0x26'));return request({'uri':util[_0x57e7('0xf')](_0x57e7('0x27'),_0x4ffc64[_0x57e7('0x21')])})[_0x57e7('0x1d')](function(_0x137a89){logger[_0x57e7('0xc')](_0x57e7('0x28'));return _0x137a89;});}});}else{logger[_0x57e7('0xc')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x57e7('0xf')](_0x57e7('0x27'),_0x4ffc64[_0x57e7('0x21')])})[_0x57e7('0x1d')](function(_0x19f807){logger[_0x57e7('0xc')](_0x57e7('0x28'));return _0x19f807;});}}function getEndUser(_0x25c58f,_0x391c52,_0x260b24){logger[_0x57e7('0xc')](_0x57e7('0x29'),_0x260b24);return request({'uri':util[_0x57e7('0xf')](_0x57e7('0x2a'),_0x25c58f[_0x57e7('0x21')]),'qs':{'phone':_0x260b24}})[_0x57e7('0x1d')](function(_0x8a7061){if(_0x8a7061[_0x57e7('0x22')]){logger[_0x57e7('0xc')]('Enduser\x20found!');return _[_0x57e7('0x2b')](_0x8a7061,{'phone':_0x260b24});}else{logger[_0x57e7('0xc')](_0x57e7('0x2c'));return request({'uri':util['format'](_0x57e7('0x2a'),_0x25c58f[_0x57e7('0x21')]),'method':_0x57e7('0x1c'),'body':{'name':_0x391c52,'phone':_0x260b24}})['then'](function(_0xa0750){logger['info'](_0x57e7('0x2d'));return _0xa0750;});}});}function getAuth(_0x25560c){return util[_0x57e7('0xf')](_0x57e7('0x2e'),new Buffer(_0x25560c['apiKey']+':X')['toString']('base64'));}function request(_0x249bcd){logger['debug']('[HTTP]',JSON[_0x57e7('0x2f')](_0x249bcd));return rp(_[_0x57e7('0x8')](_0x249bcd,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x18531f,_0x1efa5c){var _0x17aba4=[];if(_0x18531f&&_0x18531f[_0x57e7('0x22')]>0x0){_0x17aba4=_[_0x57e7('0x30')](_0x18531f,_0x1efa5c);}return _0x17aba4;}function getCustomFields(_0x152fe3,_0x114f10){var _0x167a08=[];var _0x2704f8={'custom_fields':[]};if(_0x152fe3[_0x57e7('0x22')]>0x0){_[_0x57e7('0x31')](_0x152fe3,function(_0x59e5a3){if(_['includes']([_0x57e7('0x32'),_0x57e7('0x33')],_0x59e5a3[_0x57e7('0x34')])&&_0x59e5a3['nameField']&&!_0x59e5a3[_0x57e7('0x35')]){_0x2704f8[_0x59e5a3[_0x57e7('0x36')][_0x57e7('0x37')]()]=_0x59e5a3[_0x57e7('0x38')][_0x57e7('0x39')]();}else if(_[_0x57e7('0x3a')]([_0x57e7('0x32'),'picklist'],_0x59e5a3['type'])&&_0x59e5a3[_0x57e7('0x3b')]&&_0x59e5a3[_0x57e7('0x35')]){_0x2704f8[_0x57e7('0x19')][_0x57e7('0x3c')]({'id':_0x59e5a3[_0x57e7('0x3b')],'value':_0x59e5a3[_0x57e7('0x38')][_0x57e7('0x39')]()});}else if(_0x59e5a3['type']===_0x57e7('0x3d')&&_0x59e5a3['variableName']&&_0x59e5a3[_0x57e7('0x3b')]&&_0x59e5a3['customField']){_0x114f10[_0x59e5a3[_0x57e7('0x3e')]]&&_0x2704f8['custom_fields'][_0x57e7('0x3c')]({'id':_0x59e5a3[_0x57e7('0x3b')],'value':_0x114f10[_0x59e5a3[_0x57e7('0x3e')]][_0x57e7('0x39')]()});}else if(_0x59e5a3[_0x57e7('0x34')]==='customVariable'&&_0x59e5a3[_0x57e7('0x3f')]&&_0x59e5a3['Variable']['name']&&_0x59e5a3[_0x57e7('0x3b')]&&_0x59e5a3[_0x57e7('0x35')]){_0x114f10[_0x59e5a3['Variable'][_0x57e7('0x40')][_0x57e7('0x37')]()]&&_0x2704f8[_0x57e7('0x19')][_0x57e7('0x3c')]({'id':_0x59e5a3['idField'],'value':_0x114f10[_0x59e5a3[_0x57e7('0x3f')][_0x57e7('0x40')][_0x57e7('0x37')]()][_0x57e7('0x39')]()});}});}return _0x2704f8;}exports[_0x57e7('0x41')]=function(_0x55f610,_0x38b80b,_0x2f4bc6,_0x86f266,_0x131e86,_0x4ce77e){var _0x54d0d1,_0x1ea2f5;_0x4ce77e[_0x57e7('0x21')]=intUtil[_0x57e7('0x42')](_0x4ce77e[_0x57e7('0x21')]);_0x4ce77e[_0x57e7('0x43')]=intUtil[_0x57e7('0x42')](_0x4ce77e[_0x57e7('0x43')]);if(_0x131e86&&_0x131e86['monitor_format']){logger[_0x57e7('0xc')]('[QUEUE]',_0x57e7('0x44'));_0x38b80b[_0x57e7('0x45')]=util[_0x57e7('0xf')](_0x57e7('0x46'),_0x4ce77e['serverUrl'],_0x38b80b[_0x57e7('0x47')],md5(_0x38b80b['uniqueid']));}else{_0x38b80b[_0x57e7('0x45')]='';}headers['Authorization']=getAuth(_0x4ce77e);return getUser(_0x4ce77e,_0x86f266[_0x57e7('0x25')])['then'](function(_0x10656c){_0x54d0d1=_0x10656c;logger['info']('The\x20User\x20ID\x20is:',_0x54d0d1['id']);return getEndUser(_0x4ce77e,_0x38b80b[_0x57e7('0x11')],_0x38b80b[_0x57e7('0x12')]);})[_0x57e7('0x1d')](function(_0x36a1a6){_0x1ea2f5=_0x36a1a6;logger[_0x57e7('0xc')]('The\x20Enduser\x20ID\x20is:',_0x1ea2f5['id']);return getTicket(_0x4ce77e,_0x54d0d1,_0x1ea2f5,_0x2f4bc6,_0x38b80b);})[_0x57e7('0x1d')](function(_0x205781){if(_0x205781&&_0x205781['id']){logger[_0x57e7('0xc')](_0x57e7('0x1e'));logger[_0x57e7('0xc')]('The\x20Ticket\x20ID\x20is:',_0x205781['id']);logger[_0x57e7('0xc')](_0x57e7('0x48'),_0x57e7('0x49'));emit(util[_0x57e7('0xf')]('user:%s',_0x86f266[_0x57e7('0x40')]),'trigger:browser:url',{'uri':util[_0x57e7('0xf')](_0x57e7('0x4a'),_0x4ce77e[_0x57e7('0x21')],_0x205781['id'])});}})[_0x57e7('0x4b')](function(_0x4677b8){logger[_0x57e7('0x4c')](_0x57e7('0x48'),JSON[_0x57e7('0x2f')](_0x4677b8));});};exports[_0x57e7('0x4d')]=function(_0x1102c2,_0x206fbf,_0x22ee79,_0x104079,_0x108ed9,_0x1b4383,_0x18231e){var _0x58086e,_0x3e3c2c;_0x1b4383['remoteUri']=intUtil[_0x57e7('0x42')](_0x1b4383[_0x57e7('0x21')]);_0x1b4383[_0x57e7('0x43')]=intUtil[_0x57e7('0x42')](_0x1b4383[_0x57e7('0x43')]);if(_0x18231e&&_0x18231e[_0x57e7('0x4e')]&&_0x18231e[_0x57e7('0x4e')]!=='none'){logger[_0x57e7('0xc')](_0x57e7('0x4f'),'Recording\x20is\x20enabled!');_0x206fbf[_0x57e7('0x45')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1b4383['serverUrl'],_0x206fbf[_0x57e7('0x47')],md5(_0x206fbf[_0x57e7('0x47')]));}headers[_0x57e7('0x50')]=getAuth(_0x1b4383);return getUser(_0x1b4383,_0x104079[_0x57e7('0x25')])[_0x57e7('0x1d')](function(_0x37dce2){_0x58086e=_0x37dce2;logger['info']('The\x20User\x20ID\x20is:',_0x58086e['id']);return getEndUser(_0x1b4383,_0x206fbf[_0x57e7('0x51')],_0x206fbf[_0x57e7('0x52')]);})[_0x57e7('0x1d')](function(_0xf7354){_0x3e3c2c=_0xf7354;logger[_0x57e7('0xc')](_0x57e7('0x53'),_0x3e3c2c['id']);return getTicket(_0x1b4383,_0x58086e,_0x3e3c2c,_0x22ee79,_0x206fbf);})[_0x57e7('0x1d')](function(_0x78a801){if(_0x78a801&&_0x78a801['id']){logger[_0x57e7('0xc')](_0x57e7('0x1e'));logger[_0x57e7('0xc')](_0x57e7('0x54'),_0x78a801['id']);logger['info'](_0x57e7('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x57e7('0x55'),_0x104079[_0x57e7('0x40')]),_0x57e7('0x56'),{'uri':util['format'](_0x57e7('0x4a'),_0x1b4383[_0x57e7('0x21')],_0x78a801['id'])});}})[_0x57e7('0x4b')](function(_0x2dfe5e){logger[_0x57e7('0x4c')](_0x57e7('0x4f'),JSON[_0x57e7('0x2f')](_0x2dfe5e));});};exports['unmanaged']=function(_0x3e8ca5,_0xbbd521,_0x28f565,_0x1824e2,_0x2b54ae,_0xb4c14a){var _0x10894f,_0x4283da;_0xb4c14a['remoteUri']=intUtil[_0x57e7('0x42')](_0xb4c14a[_0x57e7('0x21')]);_0xb4c14a['serverUrl']=intUtil['stripTrailingSlash'](_0xb4c14a[_0x57e7('0x43')]);if(_0x2b54ae&&_0x2b54ae[_0x57e7('0x57')]){logger[_0x57e7('0xc')]('['+_0xbbd521[_0x57e7('0x58')]['toUpperCase']()+']',_0x57e7('0x44'));_0xbbd521[_0x57e7('0x45')]=util['format'](_0x57e7('0x46'),_0xb4c14a['serverUrl'],_0xbbd521[_0x57e7('0x47')],md5(_0xbbd521[_0x57e7('0x47')]));}else{_0xbbd521['recordingURL']='';}headers[_0x57e7('0x50')]=getAuth(_0xb4c14a);return getUser(_0xb4c14a,'')['then'](function(_0x1d9f79){_0x10894f=_0x1d9f79;logger[_0x57e7('0xc')]('The\x20User\x20ID\x20is:',_0x10894f['id']);return getEndUser(_0xb4c14a,_0xbbd521['calleridname'],_0xbbd521[_0x57e7('0x12')]);})[_0x57e7('0x1d')](function(_0x38d00b){_0x4283da=_0x38d00b;logger[_0x57e7('0xc')]('The\x20Enduser\x20ID\x20is:',_0x4283da['id']);return getTicket(_0xb4c14a,_0x10894f,_0x4283da,_0x28f565,_0xbbd521);})[_0x57e7('0x1d')](function(_0x3eb8e6){if(_0x3eb8e6){logger[_0x57e7('0xc')](_0x57e7('0x1e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3eb8e6['id']);}})[_0x57e7('0x4b')](function(_0x57a80d){logger[_0x57e7('0x4c')]('['+_0xbbd521[_0x57e7('0x58')][_0x57e7('0x59')]()+']',JSON[_0x57e7('0x2f')](_0x57a80d));});}; \ No newline at end of file +var _0xd21a=['info','Creating\x20new\x20ticket...','merge','format','calleridnum','getString','Subjects','Descriptions','
','Tags','Fields','custom_fields','keyBy','value','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','then','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','debug','GET','map','forEach','includes','string','customField','nameField','toLowerCase','picklist','type','push','content','variable','variableName','idField','Variable','name','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','catch','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','error','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit'];(function(_0xf1a927,_0x273b40){var _0x1128fc=function(_0x455edd){while(--_0x455edd){_0xf1a927['push'](_0xf1a927['shift']());}};_0x1128fc(++_0x273b40);}(_0xd21a,0xac));var _0xad21=function(_0x8c0711,_0x588bba){_0x8c0711=_0x8c0711-0x0;var _0x51ae03=_0xd21a[_0x8c0711];return _0x51ae03;};'use strict';var _=require(_0xad21('0x0'));var rp=require(_0xad21('0x1'));var md5=require(_0xad21('0x2'));var util=require('util');var Redis=require(_0xad21('0x3'));var intUtil=require(_0xad21('0x4'));var config=require(_0xad21('0x5'));var logger=require(_0xad21('0x6'))(_0xad21('0x7'));config[_0xad21('0x8')]=_[_0xad21('0x9')](config[_0xad21('0x8')],{'host':_0xad21('0xa'),'port':0x18eb});var io=require(_0xad21('0xb'))(new Redis(config[_0xad21('0x8')]));var headers={'Content-Type':_0xad21('0xc'),'Accept':_0xad21('0xc')};function emit(_0x455243,_0x51777c,_0x2a2ef4){io['to'](_0x455243)[_0xad21('0xd')](_0x51777c,_0x2a2ef4);}function getTicket(_0x120dd2,_0x29b5c8,_0x4284d5,_0x2cf582,_0x5a2eba){logger[_0xad21('0xe')](_0xad21('0xf'));var _0x360c97=_[_0xad21('0x10')]({'responder_id':_0x29b5c8['id'],'requester_id':_0x4284d5['id'],'name':util[_0xad21('0x11')]('Caller\x20-\x20%s',_0x5a2eba['calleridname']),'phone':_0x5a2eba[_0xad21('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xad21('0x13')](_0x2cf582[_0xad21('0x14')],_0x5a2eba,'\x20'),'description':intUtil[_0xad21('0x13')](_0x2cf582[_0xad21('0x15')],_0x5a2eba,_0xad21('0x16')),'tags':getTags(_0x2cf582[_0xad21('0x17')],'name')},getCustomFields(_0x2cf582[_0xad21('0x18')],_0x5a2eba));_0x360c97[_0xad21('0x19')]=_['mapValues'](_[_0xad21('0x1a')](_0x360c97[_0xad21('0x19')],'id'),_0xad21('0x1b'));return request({'uri':util['format'](_0xad21('0x1c'),_0x120dd2[_0xad21('0x1d')]),'method':_0xad21('0x1e'),'body':_0x360c97})['then'](function(_0x833b78){logger['info'](_0xad21('0x1f'));return _0x833b78;});}function getUser(_0x40f023,_0x23c3f6){if(intUtil[_0xad21('0x20')](_0x23c3f6)){return request({'uri':util[_0xad21('0x11')](_0xad21('0x21'),_0x40f023[_0xad21('0x1d')]),'qs':{'email':_0x23c3f6}})['then'](function(_0x3e8e38){if(_0x3e8e38[_0xad21('0x22')]){logger[_0xad21('0xe')](_0xad21('0x23'));return _['find'](_0x3e8e38,function(_0x151e4b){return _0x151e4b[_0xad21('0x24')][_0xad21('0x25')]===_0x23c3f6;});}else{logger[_0xad21('0xe')](_0xad21('0x26'));return request({'uri':util[_0xad21('0x11')](_0xad21('0x27'),_0x40f023[_0xad21('0x1d')])})['then'](function(_0x4907c7){logger[_0xad21('0xe')]('Admin\x20account\x20selected.');return _0x4907c7;});}});}else{logger[_0xad21('0xe')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xad21('0x11')]('%s/api/v2/agents/me',_0x40f023['remoteUri'])})[_0xad21('0x28')](function(_0x3cdf82){logger[_0xad21('0xe')]('Admin\x20account\x20selected.');return _0x3cdf82;});}}function getEndUser(_0x1e6e50,_0x1c1917,_0x363d5f){logger[_0xad21('0xe')](_0xad21('0x29'),_0x363d5f);return request({'uri':util[_0xad21('0x11')](_0xad21('0x2a'),_0x1e6e50[_0xad21('0x1d')]),'qs':{'phone':_0x363d5f}})['then'](function(_0x55c6bb){if(_0x55c6bb[_0xad21('0x22')]){logger[_0xad21('0xe')]('Enduser\x20found!');return _['find'](_0x55c6bb,{'phone':_0x363d5f});}else{logger['info'](_0xad21('0x2b'));return request({'uri':util['format'](_0xad21('0x2a'),_0x1e6e50[_0xad21('0x1d')]),'method':'POST','body':{'name':_0x1c1917,'phone':_0x363d5f}})['then'](function(_0x11da09){logger[_0xad21('0xe')](_0xad21('0x2c'));return _0x11da09;});}});}function getAuth(_0x2245f4){return util[_0xad21('0x11')](_0xad21('0x2d'),new Buffer(_0x2245f4['apiKey']+':X')[_0xad21('0x2e')](_0xad21('0x2f')));}function request(_0x599af8){logger[_0xad21('0x30')]('[HTTP]',JSON['stringify'](_0x599af8));return rp(_[_0xad21('0x9')](_0x599af8,{'method':_0xad21('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x252c9c,_0x5a0e35){var _0x3d380e=[];if(_0x252c9c&&_0x252c9c['length']>0x0){_0x3d380e=_[_0xad21('0x32')](_0x252c9c,_0x5a0e35);}return _0x3d380e;}function getCustomFields(_0x4dc566,_0x35366d){var _0x2162df=[];var _0x24c51a={'custom_fields':[]};if(_0x4dc566[_0xad21('0x22')]>0x0){_[_0xad21('0x33')](_0x4dc566,function(_0x57af0d){if(_[_0xad21('0x34')]([_0xad21('0x35'),'picklist'],_0x57af0d['type'])&&_0x57af0d['nameField']&&!_0x57af0d[_0xad21('0x36')]){_0x24c51a[_0x57af0d[_0xad21('0x37')][_0xad21('0x38')]()]=_0x57af0d['content'][_0xad21('0x2e')]();}else if(_[_0xad21('0x34')]([_0xad21('0x35'),_0xad21('0x39')],_0x57af0d[_0xad21('0x3a')])&&_0x57af0d['idField']&&_0x57af0d[_0xad21('0x36')]){_0x24c51a['custom_fields'][_0xad21('0x3b')]({'id':_0x57af0d['idField'],'value':_0x57af0d[_0xad21('0x3c')][_0xad21('0x2e')]()});}else if(_0x57af0d['type']===_0xad21('0x3d')&&_0x57af0d[_0xad21('0x3e')]&&_0x57af0d[_0xad21('0x3f')]&&_0x57af0d[_0xad21('0x36')]){_0x35366d[_0x57af0d[_0xad21('0x3e')]]&&_0x24c51a[_0xad21('0x19')][_0xad21('0x3b')]({'id':_0x57af0d[_0xad21('0x3f')],'value':_0x35366d[_0x57af0d[_0xad21('0x3e')]][_0xad21('0x2e')]()});}else if(_0x57af0d['type']==='customVariable'&&_0x57af0d[_0xad21('0x40')]&&_0x57af0d['Variable'][_0xad21('0x41')]&&_0x57af0d['idField']&&_0x57af0d[_0xad21('0x36')]){_0x35366d[_0x57af0d[_0xad21('0x40')][_0xad21('0x41')]['toLowerCase']()]&&_0x24c51a[_0xad21('0x19')][_0xad21('0x3b')]({'id':_0x57af0d[_0xad21('0x3f')],'value':_0x35366d[_0x57af0d[_0xad21('0x40')][_0xad21('0x41')][_0xad21('0x38')]()]['toString']()});}});}return _0x24c51a;}exports[_0xad21('0x42')]=function(_0x5ba599,_0x452d49,_0x4a176b,_0x422f87,_0x3be0f8,_0x4a2f59){var _0x7d02a9,_0x28bafa;_0x4a2f59[_0xad21('0x1d')]=intUtil[_0xad21('0x43')](_0x4a2f59[_0xad21('0x1d')]);_0x4a2f59[_0xad21('0x44')]=intUtil[_0xad21('0x43')](_0x4a2f59[_0xad21('0x44')]);if(_0x3be0f8&&_0x3be0f8['monitor_format']){logger[_0xad21('0xe')](_0xad21('0x45'),_0xad21('0x46'));_0x452d49[_0xad21('0x47')]=util[_0xad21('0x11')](_0xad21('0x48'),_0x4a2f59[_0xad21('0x44')],_0x452d49[_0xad21('0x49')],md5(_0x452d49['uniqueid']));}else{_0x452d49['recordingURL']='';}headers[_0xad21('0x4a')]=getAuth(_0x4a2f59);return getUser(_0x4a2f59,_0x422f87[_0xad21('0x25')])['then'](function(_0x152928){_0x7d02a9=_0x152928;logger[_0xad21('0xe')](_0xad21('0x4b'),_0x7d02a9['id']);return getEndUser(_0x4a2f59,_0x452d49[_0xad21('0x4c')],_0x452d49['calleridnum']);})[_0xad21('0x28')](function(_0x3d2281){_0x28bafa=_0x3d2281;logger['info']('The\x20Enduser\x20ID\x20is:',_0x28bafa['id']);return getTicket(_0x4a2f59,_0x7d02a9,_0x28bafa,_0x4a176b,_0x452d49);})[_0xad21('0x28')](function(_0x403645){if(_0x403645&&_0x403645['id']){logger[_0xad21('0xe')](_0xad21('0x1f'));logger['info'](_0xad21('0x4d'),_0x403645['id']);logger[_0xad21('0xe')](_0xad21('0x45'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xad21('0x11')](_0xad21('0x4e'),_0x422f87['name']),_0xad21('0x4f'),{'uri':util[_0xad21('0x11')]('%s/helpdesk/tickets/%d',_0x4a2f59[_0xad21('0x1d')],_0x403645['id'])});}})[_0xad21('0x50')](function(_0x5da5cf){logger['error'](_0xad21('0x45'),JSON[_0xad21('0x51')](_0x5da5cf));});};exports[_0xad21('0x52')]=function(_0x25916f,_0x493d86,_0x2b4f25,_0x4b650a,_0x3b1678,_0x3d57a2,_0x5092ef){var _0x1837a4,_0xb4d6ac;_0x3d57a2[_0xad21('0x1d')]=intUtil[_0xad21('0x43')](_0x3d57a2['remoteUri']);_0x3d57a2['serverUrl']=intUtil['stripTrailingSlash'](_0x3d57a2[_0xad21('0x44')]);if(_0x5092ef&&_0x5092ef[_0xad21('0x53')]&&_0x5092ef['recordingFormat']!==_0xad21('0x54')){logger[_0xad21('0xe')](_0xad21('0x55'),_0xad21('0x46'));_0x493d86[_0xad21('0x47')]=util[_0xad21('0x11')](_0xad21('0x48'),_0x3d57a2[_0xad21('0x44')],_0x493d86[_0xad21('0x49')],md5(_0x493d86[_0xad21('0x49')]));}headers[_0xad21('0x4a')]=getAuth(_0x3d57a2);return getUser(_0x3d57a2,_0x4b650a[_0xad21('0x25')])[_0xad21('0x28')](function(_0x1d884c){_0x1837a4=_0x1d884c;logger[_0xad21('0xe')](_0xad21('0x4b'),_0x1837a4['id']);return getEndUser(_0x3d57a2,_0x493d86[_0xad21('0x56')],_0x493d86['destcalleridnum']);})['then'](function(_0x588f42){_0xb4d6ac=_0x588f42;logger[_0xad21('0xe')]('The\x20Enduser\x20ID\x20is:',_0xb4d6ac['id']);return getTicket(_0x3d57a2,_0x1837a4,_0xb4d6ac,_0x2b4f25,_0x493d86);})[_0xad21('0x28')](function(_0x76228a){if(_0x76228a&&_0x76228a['id']){logger['info'](_0xad21('0x1f'));logger['info'](_0xad21('0x4d'),_0x76228a['id']);logger['info'](_0xad21('0x55'),_0xad21('0x57'));emit(util['format'](_0xad21('0x4e'),_0x4b650a['name']),_0xad21('0x4f'),{'uri':util['format'](_0xad21('0x58'),_0x3d57a2[_0xad21('0x1d')],_0x76228a['id'])});}})[_0xad21('0x50')](function(_0x104f97){logger[_0xad21('0x59')]('[OUTBOUND]',JSON[_0xad21('0x51')](_0x104f97));});};exports[_0xad21('0x5a')]=function(_0x5596ed,_0x4e99af,_0x1fc2df,_0x2e915f,_0x40f8a2,_0x327e46){var _0x3b661f,_0x4a2f97;_0x327e46[_0xad21('0x1d')]=intUtil[_0xad21('0x43')](_0x327e46[_0xad21('0x1d')]);_0x327e46[_0xad21('0x44')]=intUtil[_0xad21('0x43')](_0x327e46['serverUrl']);if(_0x40f8a2&&_0x40f8a2['monitor_format']){logger[_0xad21('0xe')]('['+_0x4e99af[_0xad21('0x5b')]['toUpperCase']()+']',_0xad21('0x46'));_0x4e99af[_0xad21('0x47')]=util['format'](_0xad21('0x48'),_0x327e46[_0xad21('0x44')],_0x4e99af[_0xad21('0x49')],md5(_0x4e99af[_0xad21('0x49')]));}else{_0x4e99af[_0xad21('0x47')]='';}headers[_0xad21('0x4a')]=getAuth(_0x327e46);return getUser(_0x327e46,'')[_0xad21('0x28')](function(_0xc4987e){_0x3b661f=_0xc4987e;logger[_0xad21('0xe')](_0xad21('0x4b'),_0x3b661f['id']);return getEndUser(_0x327e46,_0x4e99af[_0xad21('0x4c')],_0x4e99af[_0xad21('0x12')]);})[_0xad21('0x28')](function(_0x1111ae){_0x4a2f97=_0x1111ae;logger[_0xad21('0xe')]('The\x20Enduser\x20ID\x20is:',_0x4a2f97['id']);return getTicket(_0x327e46,_0x3b661f,_0x4a2f97,_0x1fc2df,_0x4e99af);})[_0xad21('0x28')](function(_0x455e2e){if(_0x455e2e){logger[_0xad21('0xe')](_0xad21('0x1f'));logger[_0xad21('0xe')](_0xad21('0x4d'),_0x455e2e['id']);}})['catch'](function(_0x102416){logger[_0xad21('0x59')]('['+_0x4e99af['lastevent'][_0xad21('0x5c')]()+']',JSON[_0xad21('0x51')](_0x102416));});}; \ 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 917b3e1..36201aa 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 _0xc2e9=['users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','GET','headers','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','endUserId','Contact\x20found\x20mobile_number:','work_number','contactNumber','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','toUpperCase','Creating\x20new\x20task','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','calleridnum','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','/api/selector/owners','info','Getting\x20admin\x20information','then'];(function(_0x24cfd0,_0x2a965e){var _0x57bb01=function(_0x4d71b2){while(--_0x4d71b2){_0x24cfd0['push'](_0x24cfd0['shift']());}};_0x57bb01(++_0x2a965e);}(_0xc2e9,0xa0));var _0x9c2e=function(_0x246e1a,_0x30ee98){_0x246e1a=_0x246e1a-0x0;var _0x19a13c=_0xc2e9[_0x246e1a];return _0x19a13c;};'use strict';var _=require('lodash');var rp=require(_0x9c2e('0x0'));var md5=require('md5');var util=require(_0x9c2e('0x1'));var moment=require(_0x9c2e('0x2'));var Promise=require('bluebird');var Redis=require(_0x9c2e('0x3'));var intUtil=require('./util');var config=require(_0x9c2e('0x4'));var logger=require(_0x9c2e('0x5'))('freshsales');config[_0x9c2e('0x6')]=_['defaults'](config[_0x9c2e('0x6')],{'host':_0x9c2e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9c2e('0x6')]));function getAdminId(_0x3a36be,_0x1c5072,_0x329907,_0x30354d){return new Promise(function(_0x862e23,_0x37c423){var _0xe2a2e7=![];var _0xae649e={'method':'GET','uri':_0x30354d+_0x9c2e('0x8'),'json':!![]};_0xae649e['headers']=_0x329907;logger[_0x9c2e('0x9')](_0x9c2e('0xa'));return rp(_0xae649e)[_0x9c2e('0xb')](function(_0xd885a0){if(_0xd885a0){var _0x40cac7=_0xd885a0[_0x9c2e('0xc')];var _0x4a1062=null;for(_0x4a1062=0x0;_0x4a1062<_0x40cac7['length'];_0x4a1062++){if(_0x40cac7[_0x4a1062][_0x9c2e('0xd')]===_0x3a36be[_0x9c2e('0xe')]){_0x3a36be[_0x9c2e('0xf')]=_0x40cac7[_0x4a1062]['id'];_0xe2a2e7=!![];}}if(_0xe2a2e7){logger[_0x9c2e('0x9')](_0x9c2e('0x10'),_0x3a36be[_0x9c2e('0xf')]);_0x862e23(_0x3a36be);}else{_0x37c423({'statusCode':0x194,'message':_0x9c2e('0x11')});}}else{_0x37c423({'statusCode':0x194,'message':_0x9c2e('0x11')});}})[_0x9c2e('0x12')](function(_0x12aa39){logger[_0x9c2e('0x13')]('['+[_0x1c5072['toUpperCase']()]+']',_0x12aa39[_0x9c2e('0x14')]);_0x37c423(_0x12aa39);});});}function getUser(_0x1da1b8,_0x2ddeaf,_0x5ed24c){return function(_0x3a7087){return new Promise(function(_0x13922f,_0x592830){var _0x1ffd6d={'method':_0x9c2e('0x15'),'uri':_0x5ed24c+_0x9c2e('0x8'),'json':!![]};_0x1ffd6d[_0x9c2e('0x16')]=_0x2ddeaf;logger[_0x9c2e('0x9')](_0x9c2e('0x17'));return rp(_0x1ffd6d)['then'](function(_0x13f0ef){if(_0x13f0ef){var _0xa31f18=_0x13f0ef[_0x9c2e('0xc')];var _0x1a6d8c=![];var _0x4f5924=null;if(_0x3a7087['agentEmail']!==null){logger['info'](_0x9c2e('0x18'),_0x3a7087[_0x9c2e('0x19')]);_0x3a7087[_0x9c2e('0x1a')]=_0x3a7087[_0x9c2e('0x19')];for(_0x4f5924=0x0;_0x4f5924<_0xa31f18['length'];_0x4f5924++){if(_0xa31f18[_0x4f5924][_0x9c2e('0xd')]===_0x3a7087[_0x9c2e('0x19')]){_0x1a6d8c=!![];_0x3a7087[_0x9c2e('0x1b')]=_0xa31f18[_0x4f5924]['id'];logger[_0x9c2e('0x9')](_0x9c2e('0x1c'),_0x3a7087[_0x9c2e('0x1b')]);}}}if(!_0x1a6d8c){logger[_0x9c2e('0x9')](_0x9c2e('0x1d'));_0x3a7087[_0x9c2e('0x1a')]=_0x3a7087['adminEmail'];_0x3a7087[_0x9c2e('0x1b')]=_0x3a7087[_0x9c2e('0xf')];_0x1a6d8c=!![];}if(_0x1a6d8c){_0x13922f(_0x3a7087);}else{_0x592830({'statusCode':0x194,'message':_0x9c2e('0x11')});}}else{_0x592830({'statusCode':0x194,'message':_0x9c2e('0x11')});}})['catch'](function(_0x4b422d){logger[_0x9c2e('0x13')]('['+[_0x1da1b8['toUpperCase']()]+']',_0x4b422d[_0x9c2e('0x14')]);_0x592830(_0x4b422d);});});};}function searchContact(_0x54381b,_0x903aa5,_0x2a7a99,_0x11aec9){return new Promise(function(_0x12875a,_0x1896ca){var _0x3ab923={'method':_0x9c2e('0x15'),'headers':_0x903aa5,'uri':_0x54381b+_0x9c2e('0x1e')+_0x11aec9+_0x9c2e('0x1f')+_0x2a7a99+_0x9c2e('0x20'),'json':!![]};rp(_0x3ab923)[_0x9c2e('0xb')](function(_0x4962bd){var _0xe620dd=_[_0x9c2e('0x21')](_0x4962bd[_0x9c2e('0x22')]['contacts'],[_0x2a7a99,_0x11aec9]);_0x12875a(_0xe620dd);})[_0x9c2e('0x12')](function(_0x3c3aaf){_0x1896ca(_0x3c3aaf);});});}function getEndUser(_0x2fc567,_0x525d73,_0x2e1f8a){return function(_0x2fd6ef){return new Promise(function(_0x2e662e,_0x1f9370){logger[_0x9c2e('0x9')](util[_0x9c2e('0x23')](_0x9c2e('0x24'),_0x2fd6ef['contactNumber']));searchContact(_0x2e1f8a,_0x525d73,'mobile_number',_0x2fd6ef['contactNumber'])['then'](function(_0x2ada67){if(_0x2ada67){_0x2fd6ef[_0x9c2e('0x25')]=_0x2ada67['id'];logger[_0x9c2e('0x9')](_0x9c2e('0x26'),_0x2fd6ef[_0x9c2e('0x25')]);return _0x2e662e(_0x2fd6ef);}searchContact(_0x2e1f8a,_0x525d73,_0x9c2e('0x27'),_0x2fd6ef[_0x9c2e('0x28')])[_0x9c2e('0xb')](function(_0x33eaed){if(_0x33eaed){_0x2fd6ef[_0x9c2e('0x25')]=_0x33eaed['id'];logger[_0x9c2e('0x9')]('Contact\x20found\x20work_number:',_0x2fd6ef[_0x9c2e('0x25')]);return _0x2e662e(_0x2fd6ef);}createEndUser(_0x2fd6ef,_0x2fc567,_0x525d73,_0x2e1f8a)['then'](function(_0x59d785){logger[_0x9c2e('0x9')](_0x9c2e('0x29'),_0x59d785[_0x9c2e('0x25')]);return _0x2e662e(_0x59d785);});});})['catch'](function(_0xbf53c9){_0x1f9370(_0xbf53c9);});});};}function createEndUser(_0x5e0029,_0x733bb7,_0x1930ad,_0x2cc6d0){return new Promise(function(_0x1b6433,_0x1d53a5){var _0x492c64=moment();var _0x451903={'method':_0x9c2e('0x2a'),'uri':_0x2cc6d0+_0x9c2e('0x2b'),'body':{'contact':{'last_name':_0x5e0029[_0x9c2e('0x28')],'work_number':_0x5e0029[_0x9c2e('0x28')],'mobile_number':_0x5e0029[_0x9c2e('0x28')],'owner_id':_0x5e0029['userId'],'created_at':_0x492c64['format'](_0x9c2e('0x2c'))}},'json':!![]};_0x451903[_0x9c2e('0x16')]=_0x1930ad;logger[_0x9c2e('0x9')](_0x9c2e('0x2d'));return rp(_0x451903)[_0x9c2e('0xb')](function(_0x374d35){_0x5e0029[_0x9c2e('0x25')]=_0x374d35[_0x9c2e('0x2e')]['id'];_0x1b6433(_0x5e0029);})['catch'](function(_0x3c2af0){logger['error']('['+[_0x733bb7[_0x9c2e('0x2f')]()]+']',_0x3c2af0[_0x9c2e('0x14')]);_0x1d53a5(_0x3c2af0[_0x9c2e('0x14')]);});});}function getTicket(_0x3576e3,_0x81ba1b,_0x36bbd7,_0x4fd017,_0x4b40e8){return function(_0x57d093){logger[_0x9c2e('0x9')](_0x9c2e('0x30'));return new Promise(function(_0x3974a1,_0x518772){var _0x27721e=moment();var _0x102138={'method':'POST','uri':_0x36bbd7+'/api/tasks','body':{'title':intUtil[_0x9c2e('0x31')](_0x4fd017[_0x9c2e('0x32')],_0x4b40e8,'\x20'),'description':intUtil[_0x9c2e('0x31')](_0x4fd017[_0x9c2e('0x33')],_0x4b40e8,'\x0a'),'owner_id':_0x57d093['userId'],'creater_id':_0x57d093[_0x9c2e('0xf')],'targetable_id':_0x57d093[_0x9c2e('0x25')],'targetable_type':_0x9c2e('0x34'),'created_at':_0x27721e[_0x9c2e('0x23')](_0x9c2e('0x2c')),'due_date':_0x27721e[_0x9c2e('0x35')](0x1e,'m')[_0x9c2e('0x23')](_0x9c2e('0x2c'))},'json':!![]};_0x102138['headers']=_0x81ba1b;return rp(_0x102138)[_0x9c2e('0xb')](function(_0x34e7d4){_0x57d093[_0x9c2e('0x36')]=_0x34e7d4[_0x9c2e('0x37')]['id'];logger['info'](_0x9c2e('0x38'),_0x57d093[_0x9c2e('0x36')]);_0x3974a1(_0x57d093);})[_0x9c2e('0x12')](function(_0x3e1716){logger['error']('['+[_0x3576e3['toUpperCase']()]+']',_0x3e1716[_0x9c2e('0x14')]);_0x518772(_0x3e1716[_0x9c2e('0x14')]);});});};}function emit(_0x1be15c,_0x1d9852,_0x177688){var _0x53a511={'uri':_0x1be15c+_0x9c2e('0x39')+_0x177688};io['to'](util['format'](_0x9c2e('0x3a'),_0x1d9852))[_0x9c2e('0x3b')](_0x9c2e('0x3c'),_0x53a511);}exports['cs']=function(_0x337eda,_0x23a42d,_0x394a7c,_0x46b2b9,_0x3fe88b,_0x303716,_0x12ec44,_0x1c9473){var _0x485b21={};var _0x19206a={'Authorization':_0x9c2e('0x3d')+_0x303716[_0x9c2e('0x3e')]};_0x303716[_0x9c2e('0x3f')]=intUtil[_0x9c2e('0x40')](_0x303716['remoteUri']);_0x303716[_0x9c2e('0x41')]=intUtil[_0x9c2e('0x40')](_0x303716[_0x9c2e('0x41')]);var _0x3d6916=_0x303716[_0x9c2e('0x3f')];_0x485b21[_0x9c2e('0xe')]=_0x303716[_0x9c2e('0x42')];_0x485b21[_0x9c2e('0x28')]=_0x1c9473[_0x9c2e('0x43')]()==='outbound'?_0x23a42d['destcalleridnum']:_0x23a42d[_0x9c2e('0x44')];_0x485b21['callDirection']=_0x1c9473===_0x9c2e('0x45')||_0x1c9473==='unmanaged'?_0x9c2e('0x45'):_0x9c2e('0x46');if(_0x46b2b9){_0x485b21[_0x9c2e('0x19')]=_0x46b2b9[_0x9c2e('0xd')];}var _0xb3a09c=util[_0x9c2e('0x23')](_0x9c2e('0x47'),_0x303716['serverUrl'],_0x23a42d['uniqueid'],md5(_0x23a42d[_0x9c2e('0x48')]));if(_0x3fe88b&&_0x3fe88b[_0x9c2e('0x49')]){logger[_0x9c2e('0x9')](_0x9c2e('0x4a'),_0x9c2e('0x4b'));_0x23a42d[_0x9c2e('0x4c')]=_0xb3a09c;}else if(_0x12ec44&&_0x12ec44['recordingFormat']&&_0x12ec44[_0x9c2e('0x4d')]!==_0x9c2e('0x4e')){logger[_0x9c2e('0x9')](_0x9c2e('0x4f'),_0x9c2e('0x4b'));_0x23a42d[_0x9c2e('0x4c')]=_0xb3a09c;}else{_0x23a42d[_0x9c2e('0x4c')]='';}return getAdminId(_0x485b21,_0x1c9473,_0x19206a,_0x3d6916)['then'](getUser(_0x1c9473,_0x19206a,_0x3d6916))['then'](getEndUser(_0x1c9473,_0x19206a,_0x3d6916))[_0x9c2e('0xb')](getTicket(_0x1c9473,_0x19206a,_0x3d6916,_0x394a7c,_0x23a42d))[_0x9c2e('0xb')](function(_0x585bff){logger[_0x9c2e('0x9')](util[_0x9c2e('0x23')](_0x9c2e('0x50'),_0x585bff[_0x9c2e('0x36')]));if(_0x1c9473!==_0x9c2e('0x51')){logger[_0x9c2e('0x9')]('['+[_0x1c9473[_0x9c2e('0x2f')]()]+']',_0x9c2e('0x52'));emit(_0x3d6916,_0x46b2b9[_0x9c2e('0x53')],_0x585bff[_0x9c2e('0x25')]);}})[_0x9c2e('0x12')](function(_0x56e180){logger['error']('['+[_0x1c9473[_0x9c2e('0x2f')]()]+_0x9c2e('0x54'),util[_0x9c2e('0x55')](_0x56e180,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2dc6=['redis','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','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','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','/api/tasks','getString','Subjects','Descriptions','ticketId','task','Task\x20created:','/contacts/','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','unmanaged','queue','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','name','inspect','lodash','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','defaults','socket.io-emitter'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x2dc6,0x136));var _0x62dc=function(_0x2e18b6,_0x29f428){_0x2e18b6=_0x2e18b6-0x0;var _0x5d5501=_0x2dc6[_0x2e18b6];return _0x5d5501;};'use strict';var _=require(_0x62dc('0x0'));var rp=require(_0x62dc('0x1'));var md5=require(_0x62dc('0x2'));var util=require(_0x62dc('0x3'));var moment=require('moment');var Promise=require(_0x62dc('0x4'));var Redis=require(_0x62dc('0x5'));var intUtil=require(_0x62dc('0x6'));var config=require(_0x62dc('0x7'));var logger=require('../../../../config/logger')('freshsales');config['redis']=_[_0x62dc('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x62dc('0x9'))(new Redis(config[_0x62dc('0xa')]));function getAdminId(_0x12eba1,_0xbdbda0,_0x30f541,_0x103e1f){return new Promise(function(_0x111cb4,_0x1c6d39){var _0x2873a1=![];var _0x288085={'method':_0x62dc('0xb'),'uri':_0x103e1f+_0x62dc('0xc'),'json':!![]};_0x288085[_0x62dc('0xd')]=_0x30f541;logger[_0x62dc('0xe')](_0x62dc('0xf'));return rp(_0x288085)[_0x62dc('0x10')](function(_0x57e834){if(_0x57e834){var _0x8bec1b=_0x57e834[_0x62dc('0x11')];var _0x5f5688=null;for(_0x5f5688=0x0;_0x5f5688<_0x8bec1b['length'];_0x5f5688++){if(_0x8bec1b[_0x5f5688][_0x62dc('0x12')]===_0x12eba1[_0x62dc('0x13')]){_0x12eba1[_0x62dc('0x14')]=_0x8bec1b[_0x5f5688]['id'];_0x2873a1=!![];}}if(_0x2873a1){logger['info']('Admin\x20found:',_0x12eba1[_0x62dc('0x14')]);_0x111cb4(_0x12eba1);}else{_0x1c6d39({'statusCode':0x194,'message':_0x62dc('0x15')});}}else{_0x1c6d39({'statusCode':0x194,'message':_0x62dc('0x15')});}})[_0x62dc('0x16')](function(_0x19c9ea){logger[_0x62dc('0x17')]('['+[_0xbdbda0[_0x62dc('0x18')]()]+']',_0x19c9ea[_0x62dc('0x19')]);_0x1c6d39(_0x19c9ea);});});}function getUser(_0x37615f,_0x328cd5,_0x2a4840){return function(_0x44fe0a){return new Promise(function(_0x726bcf,_0x4c2520){var _0x4ddae7={'method':_0x62dc('0xb'),'uri':_0x2a4840+'/api/selector/owners','json':!![]};_0x4ddae7[_0x62dc('0xd')]=_0x328cd5;logger[_0x62dc('0xe')]('Getting\x20user\x20list');return rp(_0x4ddae7)['then'](function(_0x59f382){if(_0x59f382){var _0x35a0e2=_0x59f382[_0x62dc('0x11')];var _0x1a6839=![];var _0x2bd6f9=null;if(_0x44fe0a[_0x62dc('0x1a')]!==null){logger[_0x62dc('0xe')](_0x62dc('0x1b'),_0x44fe0a['agentEmail']);_0x44fe0a[_0x62dc('0x1c')]=_0x44fe0a[_0x62dc('0x1a')];for(_0x2bd6f9=0x0;_0x2bd6f9<_0x35a0e2[_0x62dc('0x1d')];_0x2bd6f9++){if(_0x35a0e2[_0x2bd6f9]['email']===_0x44fe0a[_0x62dc('0x1a')]){_0x1a6839=!![];_0x44fe0a[_0x62dc('0x1e')]=_0x35a0e2[_0x2bd6f9]['id'];logger[_0x62dc('0xe')](_0x62dc('0x1f'),_0x44fe0a[_0x62dc('0x1e')]);}}}if(!_0x1a6839){logger[_0x62dc('0xe')](_0x62dc('0x20'));_0x44fe0a['userEmail']=_0x44fe0a['adminEmail'];_0x44fe0a['userId']=_0x44fe0a[_0x62dc('0x14')];_0x1a6839=!![];}if(_0x1a6839){_0x726bcf(_0x44fe0a);}else{_0x4c2520({'statusCode':0x194,'message':_0x62dc('0x15')});}}else{_0x4c2520({'statusCode':0x194,'message':_0x62dc('0x15')});}})[_0x62dc('0x16')](function(_0x9d1b02){logger[_0x62dc('0x17')]('['+[_0x37615f[_0x62dc('0x18')]()]+']',_0x9d1b02[_0x62dc('0x19')]);_0x4c2520(_0x9d1b02);});});};}function searchContact(_0x17c085,_0x4e89fd,_0x25cf90,_0x3df6b3){return new Promise(function(_0x537d81,_0x3a46b4){var _0xddba17={'method':_0x62dc('0xb'),'headers':_0x4e89fd,'uri':_0x17c085+_0x62dc('0x21')+_0x3df6b3+_0x62dc('0x22')+_0x25cf90+_0x62dc('0x23'),'json':!![]};rp(_0xddba17)['then'](function(_0x3f0d45){var _0x29c36a=_[_0x62dc('0x24')](_0x3f0d45[_0x62dc('0x25')]['contacts'],[_0x25cf90,_0x3df6b3]);_0x537d81(_0x29c36a);})['catch'](function(_0x4dce8c){_0x3a46b4(_0x4dce8c);});});}function getEndUser(_0x355276,_0x36be99,_0x5c6b72){return function(_0x22a08a){return new Promise(function(_0x559134,_0x147a9e){logger[_0x62dc('0xe')](util[_0x62dc('0x26')](_0x62dc('0x27'),_0x22a08a[_0x62dc('0x28')]));searchContact(_0x5c6b72,_0x36be99,_0x62dc('0x29'),_0x22a08a[_0x62dc('0x28')])['then'](function(_0x3a3895){if(_0x3a3895){_0x22a08a['endUserId']=_0x3a3895['id'];logger['info'](_0x62dc('0x2a'),_0x22a08a[_0x62dc('0x2b')]);return _0x559134(_0x22a08a);}searchContact(_0x5c6b72,_0x36be99,_0x62dc('0x2c'),_0x22a08a[_0x62dc('0x28')])[_0x62dc('0x10')](function(_0x44e5ed){if(_0x44e5ed){_0x22a08a[_0x62dc('0x2b')]=_0x44e5ed['id'];logger['info'](_0x62dc('0x2d'),_0x22a08a[_0x62dc('0x2b')]);return _0x559134(_0x22a08a);}createEndUser(_0x22a08a,_0x355276,_0x36be99,_0x5c6b72)[_0x62dc('0x10')](function(_0x2f0bb6){logger[_0x62dc('0xe')]('Contact\x20created:',_0x2f0bb6[_0x62dc('0x2b')]);return _0x559134(_0x2f0bb6);});});})[_0x62dc('0x16')](function(_0x344468){_0x147a9e(_0x344468);});});};}function createEndUser(_0x30d429,_0x39885f,_0x34d4c6,_0x41a5be){return new Promise(function(_0x1b0739,_0x10ab05){var _0xc9b46e=moment();var _0x1f277a={'method':_0x62dc('0x2e'),'uri':_0x41a5be+_0x62dc('0x2f'),'body':{'contact':{'last_name':_0x30d429['contactNumber'],'work_number':_0x30d429[_0x62dc('0x28')],'mobile_number':_0x30d429['contactNumber'],'owner_id':_0x30d429[_0x62dc('0x1e')],'created_at':_0xc9b46e['format'](_0x62dc('0x30'))}},'json':!![]};_0x1f277a[_0x62dc('0xd')]=_0x34d4c6;logger['info'](_0x62dc('0x31'));return rp(_0x1f277a)[_0x62dc('0x10')](function(_0x40b6e0){_0x30d429[_0x62dc('0x2b')]=_0x40b6e0['contact']['id'];_0x1b0739(_0x30d429);})[_0x62dc('0x16')](function(_0x1b414c){logger[_0x62dc('0x17')]('['+[_0x39885f['toUpperCase']()]+']',_0x1b414c[_0x62dc('0x19')]);_0x10ab05(_0x1b414c[_0x62dc('0x19')]);});});}function getTicket(_0x182c37,_0x420fa5,_0x567bc4,_0xf81f85,_0x13e13a){return function(_0x40e605){logger[_0x62dc('0xe')]('Creating\x20new\x20task');return new Promise(function(_0x1fbb79,_0x1ab704){var _0x467625=moment();var _0x534d51={'method':_0x62dc('0x2e'),'uri':_0x567bc4+_0x62dc('0x32'),'body':{'title':intUtil[_0x62dc('0x33')](_0xf81f85[_0x62dc('0x34')],_0x13e13a,'\x20'),'description':intUtil[_0x62dc('0x33')](_0xf81f85[_0x62dc('0x35')],_0x13e13a,'\x0a'),'owner_id':_0x40e605[_0x62dc('0x1e')],'creater_id':_0x40e605['adminId'],'targetable_id':_0x40e605[_0x62dc('0x2b')],'targetable_type':'Contact','created_at':_0x467625[_0x62dc('0x26')](_0x62dc('0x30')),'due_date':_0x467625['add'](0x1e,'m')['format'](_0x62dc('0x30'))},'json':!![]};_0x534d51[_0x62dc('0xd')]=_0x420fa5;return rp(_0x534d51)[_0x62dc('0x10')](function(_0xc6d5ac){_0x40e605[_0x62dc('0x36')]=_0xc6d5ac[_0x62dc('0x37')]['id'];logger['info'](_0x62dc('0x38'),_0x40e605[_0x62dc('0x36')]);_0x1fbb79(_0x40e605);})[_0x62dc('0x16')](function(_0x2d2ed0){logger['error']('['+[_0x182c37['toUpperCase']()]+']',_0x2d2ed0[_0x62dc('0x19')]);_0x1ab704(_0x2d2ed0['message']);});});};}function emit(_0x440917,_0x17653f,_0x39ba1a){var _0xe66a8f={'uri':_0x440917+_0x62dc('0x39')+_0x39ba1a};io['to'](util['format']('user:%s',_0x17653f))['emit']('trigger:browser:url',_0xe66a8f);}exports['cs']=function(_0x242c8b,_0x145208,_0x3a4260,_0x4cc2e1,_0x5678b3,_0x4bc4f3,_0x11eb4e,_0x3e13da){var _0xb7971f={};var _0x17e56d={'Authorization':_0x62dc('0x3a')+_0x4bc4f3[_0x62dc('0x3b')]};_0x4bc4f3[_0x62dc('0x3c')]=intUtil[_0x62dc('0x3d')](_0x4bc4f3[_0x62dc('0x3c')]);_0x4bc4f3[_0x62dc('0x3e')]=intUtil['stripTrailingSlash'](_0x4bc4f3[_0x62dc('0x3e')]);var _0x507ca4=_0x4bc4f3['remoteUri'];_0xb7971f[_0x62dc('0x13')]=_0x4bc4f3[_0x62dc('0x3f')];_0xb7971f['contactNumber']=_0x3e13da[_0x62dc('0x40')]()===_0x62dc('0x41')?_0x145208[_0x62dc('0x42')]:_0x145208[_0x62dc('0x43')];_0xb7971f['callDirection']=_0x3e13da==='queue'||_0x3e13da===_0x62dc('0x44')?_0x62dc('0x45'):_0x62dc('0x41');if(_0x4cc2e1){_0xb7971f[_0x62dc('0x1a')]=_0x4cc2e1[_0x62dc('0x12')];}var _0x138bfe=util[_0x62dc('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bc4f3[_0x62dc('0x3e')],_0x145208['uniqueid'],md5(_0x145208[_0x62dc('0x46')]));if(_0x5678b3&&_0x5678b3[_0x62dc('0x47')]){logger[_0x62dc('0xe')]('[QUEUE]',_0x62dc('0x48'));_0x145208[_0x62dc('0x49')]=_0x138bfe;}else if(_0x11eb4e&&_0x11eb4e[_0x62dc('0x4a')]&&_0x11eb4e[_0x62dc('0x4a')]!==_0x62dc('0x4b')){logger[_0x62dc('0xe')](_0x62dc('0x4c'),_0x62dc('0x48'));_0x145208['recordingURL']=_0x138bfe;}else{_0x145208['recordingURL']='';}return getAdminId(_0xb7971f,_0x3e13da,_0x17e56d,_0x507ca4)[_0x62dc('0x10')](getUser(_0x3e13da,_0x17e56d,_0x507ca4))[_0x62dc('0x10')](getEndUser(_0x3e13da,_0x17e56d,_0x507ca4))['then'](getTicket(_0x3e13da,_0x17e56d,_0x507ca4,_0x3a4260,_0x145208))[_0x62dc('0x10')](function(_0x4c9731){logger[_0x62dc('0xe')](util['format'](_0x62dc('0x4d'),_0x4c9731['ticketId']));if(_0x3e13da!==_0x62dc('0x44')){logger[_0x62dc('0xe')]('['+[_0x3e13da[_0x62dc('0x18')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x507ca4,_0x4cc2e1[_0x62dc('0x4e')],_0x4c9731[_0x62dc('0x2b')]);}})[_0x62dc('0x16')](function(_0x1f1c68){logger['error']('['+[_0x3e13da['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x62dc('0x4f')](_0x1f1c68,{'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 ae9c5a8..cccdda3 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 _0x6d58=['./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','zoho','desk','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','EVENT\x20UNKNOWN','unmanaged','freshdesk','log','unknown\x20integration','../../../../config/logger','error','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger'];(function(_0xfb74c5,_0x1af2ae){var _0x511037=function(_0x4ffbc4){while(--_0x4ffbc4){_0xfb74c5['push'](_0xfb74c5['shift']());}};_0x511037(++_0x1af2ae);}(_0x6d58,0x185));var _0x86d5=function(_0x48bfb2,_0x585c14){_0x48bfb2=_0x48bfb2-0x0;var _0x43d1b0=_0x6d58[_0x48bfb2];return _0x43d1b0;};'use strict';var _=require(_0x86d5('0x0'));var util=require(_0x86d5('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x86d5('0x2'));var sugarcrm=require(_0x86d5('0x3'));var freshdesk=require(_0x86d5('0x4'));var zoho=require(_0x86d5('0x5'));var desk=require('./desk');var vtiger=require(_0x86d5('0x6'));var servicenow=require(_0x86d5('0x7'));var dynamics365=require(_0x86d5('0x8'));var freshsales=require(_0x86d5('0x9'));var integrations=[_0x86d5('0xa'),_0x86d5('0xb'),_0x86d5('0xc'),'freshdesk',_0x86d5('0xd'),_0x86d5('0xe'),'vtiger',_0x86d5('0xf'),_0x86d5('0x10'),_0x86d5('0x11')];exports[_0x86d5('0x12')]=function(_0x51c585,_0x181b9e,_0x3d7efa,_0x4226d4,_0x1e37f1,_0xacf567){if(_0x3d7efa){if(_[_0x86d5('0x13')](integrations,_0x51c585[_0x86d5('0x14')][_0x86d5('0x15')]())){try{var _0x5aa3be=null;var _0xeacbcc='';var _0x38aa74=_0x3d7efa[_0x51c585[_0x86d5('0x14')][_0x86d5('0x15')]()];if(_0x38aa74){var _0xd688e=_0x38aa74[_0x51c585[_0x86d5('0x16')]];if(_0xd688e){var _0x340319=_[_0x86d5('0x17')](_0xd688e[_0x86d5('0x18')],{'id':parseInt(_0x51c585[_0x86d5('0x19')],0xa)});if(_0x340319){if(_0x4226d4){if(_0x1e37f1&&_0x181b9e[_0x86d5('0x1a')]){_0xeacbcc=_0x86d5('0x1a');}else if(_0x181b9e['routeId']){_0xeacbcc='outbound';}else{console['log'](_0x86d5('0x1b'),_0x181b9e);}}else{_0xeacbcc=_0x86d5('0x1c');}switch(_0x51c585[_0x86d5('0x14')][_0x86d5('0x15')]()){case _0x86d5('0xa'):zendesk[_0xeacbcc](_0x51c585,_0x181b9e,_0x340319,_0x4226d4,_0x1e37f1,_0xd688e,_0xacf567);break;case'salesforce':salesforce[_0xeacbcc](_0x51c585,_0x181b9e,_0x340319,_0x4226d4,_0x1e37f1,_0xd688e,_0xacf567);break;case _0x86d5('0xc'):sugarcrm[_0xeacbcc](_0x51c585,_0x181b9e,_0x340319,_0x4226d4,_0x1e37f1,_0xd688e,_0xacf567);break;case _0x86d5('0x1d'):freshdesk[_0xeacbcc](_0x51c585,_0x181b9e,_0x340319,_0x4226d4,_0x1e37f1,_0xd688e,_0xacf567);break;case _0x86d5('0xd'):zoho[_0xeacbcc](_0x51c585,_0x181b9e,_0x340319,_0x4226d4,_0x1e37f1,_0xd688e,_0xacf567);break;case _0x86d5('0xe'):desk[_0xeacbcc](_0x51c585,_0x181b9e,_0x340319,_0x4226d4,_0x1e37f1,_0xd688e,_0xacf567);break;case'vtiger':vtiger[_0xeacbcc](_0x51c585,_0x181b9e,_0x340319,_0x4226d4,_0x1e37f1,_0xd688e,_0xacf567);break;case _0x86d5('0x10'):freshsales['cs'](_0x51c585,_0x181b9e,_0x340319,_0x4226d4,_0x1e37f1,_0xd688e,_0xacf567,_0xeacbcc);break;case _0x86d5('0x11'):servicenow['cs'](_0x51c585,_0x181b9e,_0x340319,_0x4226d4,_0x1e37f1,_0xd688e,_0xacf567,_0xeacbcc);break;case _0x86d5('0xf'):dynamics365['cs'](_0x51c585,_0x181b9e,_0x340319,_0x4226d4,_0x1e37f1,_0xd688e,_0xacf567,_0xeacbcc);break;default:console[_0x86d5('0x1e')](_0x86d5('0x1f'));}}else{_0x5aa3be=require(_0x86d5('0x20'))(_0x51c585['data1']['toLowerCase']());_0x5aa3be[_0x86d5('0x21')]('[EXEC]',util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x51c585['data1']['toLowerCase'](),_0x51c585[_0x86d5('0x19')]));}}else{_0x5aa3be=require('../../../../config/logger')(_0x51c585['data1']['toLowerCase']());_0x5aa3be['error']('[EXEC]',util[_0x86d5('0x22')](_0x86d5('0x23'),_0x51c585[_0x86d5('0x14')][_0x86d5('0x15')](),_0x51c585[_0x86d5('0x16')]));}}else{}}catch(_0xaa9200){console[_0x86d5('0x21')](_0xaa9200);}}}}; \ No newline at end of file +var _0xace3=['salesforce','sugarcrm','vtiger','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','./freshsales','zendesk','freshdesk','zoho','desk','dynamics365','freshsales','servicenow','exec','includes','toLowerCase','data1','data2','find','queue','routeId','EVENT\x20UNKNOWN','unmanaged'];(function(_0x177d06,_0x16308d){var _0x4f7e1d=function(_0xa8419c){while(--_0xa8419c){_0x177d06['push'](_0x177d06['shift']());}};_0x4f7e1d(++_0x16308d);}(_0xace3,0xe2));var _0x3ace=function(_0x4338da,_0x6f749b){_0x4338da=_0x4338da-0x0;var _0x183414=_0xace3[_0x4338da];return _0x183414;};'use strict';var _=require(_0x3ace('0x0'));var util=require('util');var zendesk=require(_0x3ace('0x1'));var salesforce=require(_0x3ace('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x3ace('0x3'));var zoho=require(_0x3ace('0x4'));var desk=require(_0x3ace('0x5'));var vtiger=require(_0x3ace('0x6'));var servicenow=require('./servicenow');var dynamics365=require(_0x3ace('0x7'));var freshsales=require(_0x3ace('0x8'));var integrations=[_0x3ace('0x9'),'salesforce','sugarcrm',_0x3ace('0xa'),_0x3ace('0xb'),_0x3ace('0xc'),'vtiger',_0x3ace('0xd'),_0x3ace('0xe'),_0x3ace('0xf')];exports[_0x3ace('0x10')]=function(_0xa9ec3c,_0xd5971a,_0x495fb9,_0x28d440,_0x21ca3a,_0x507716){if(_0x495fb9){if(_[_0x3ace('0x11')](integrations,_0xa9ec3c['data1'][_0x3ace('0x12')]())){try{var _0x2b3f7b=null;var _0x3559de='';var _0x9fcc73=_0x495fb9[_0xa9ec3c[_0x3ace('0x13')][_0x3ace('0x12')]()];if(_0x9fcc73){var _0x5b2e3c=_0x9fcc73[_0xa9ec3c[_0x3ace('0x14')]];if(_0x5b2e3c){var _0x13f324=_[_0x3ace('0x15')](_0x5b2e3c['Configurations'],{'id':parseInt(_0xa9ec3c['data3'],0xa)});if(_0x13f324){if(_0x28d440){if(_0x21ca3a&&_0xd5971a['queue']){_0x3559de=_0x3ace('0x16');}else if(_0xd5971a[_0x3ace('0x17')]){_0x3559de='outbound';}else{console['log'](_0x3ace('0x18'),_0xd5971a);}}else{_0x3559de=_0x3ace('0x19');}switch(_0xa9ec3c[_0x3ace('0x13')][_0x3ace('0x12')]()){case'zendesk':zendesk[_0x3559de](_0xa9ec3c,_0xd5971a,_0x13f324,_0x28d440,_0x21ca3a,_0x5b2e3c,_0x507716);break;case _0x3ace('0x1a'):salesforce[_0x3559de](_0xa9ec3c,_0xd5971a,_0x13f324,_0x28d440,_0x21ca3a,_0x5b2e3c,_0x507716);break;case _0x3ace('0x1b'):sugarcrm[_0x3559de](_0xa9ec3c,_0xd5971a,_0x13f324,_0x28d440,_0x21ca3a,_0x5b2e3c,_0x507716);break;case _0x3ace('0xa'):freshdesk[_0x3559de](_0xa9ec3c,_0xd5971a,_0x13f324,_0x28d440,_0x21ca3a,_0x5b2e3c,_0x507716);break;case _0x3ace('0xb'):zoho[_0x3559de](_0xa9ec3c,_0xd5971a,_0x13f324,_0x28d440,_0x21ca3a,_0x5b2e3c,_0x507716);break;case _0x3ace('0xc'):desk[_0x3559de](_0xa9ec3c,_0xd5971a,_0x13f324,_0x28d440,_0x21ca3a,_0x5b2e3c,_0x507716);break;case _0x3ace('0x1c'):vtiger[_0x3559de](_0xa9ec3c,_0xd5971a,_0x13f324,_0x28d440,_0x21ca3a,_0x5b2e3c,_0x507716);break;case'freshsales':freshsales['cs'](_0xa9ec3c,_0xd5971a,_0x13f324,_0x28d440,_0x21ca3a,_0x5b2e3c,_0x507716,_0x3559de);break;case _0x3ace('0xf'):servicenow['cs'](_0xa9ec3c,_0xd5971a,_0x13f324,_0x28d440,_0x21ca3a,_0x5b2e3c,_0x507716,_0x3559de);break;case _0x3ace('0xd'):dynamics365['cs'](_0xa9ec3c,_0xd5971a,_0x13f324,_0x28d440,_0x21ca3a,_0x5b2e3c,_0x507716,_0x3559de);break;default:console['log'](_0x3ace('0x1d'));}}else{_0x2b3f7b=require('../../../../config/logger')(_0xa9ec3c[_0x3ace('0x13')]['toLowerCase']());_0x2b3f7b[_0x3ace('0x1e')](_0x3ace('0x1f'),util[_0x3ace('0x20')](_0x3ace('0x21'),_0xa9ec3c['data1'][_0x3ace('0x12')](),_0xa9ec3c['data3']));}}else{_0x2b3f7b=require(_0x3ace('0x22'))(_0xa9ec3c[_0x3ace('0x13')]['toLowerCase']());_0x2b3f7b[_0x3ace('0x1e')](_0x3ace('0x1f'),util[_0x3ace('0x20')](_0x3ace('0x23'),_0xa9ec3c[_0x3ace('0x13')][_0x3ace('0x12')](),_0xa9ec3c['data2']));}}else{}}catch(_0x1261f9){console['error'](_0x1261f9);}}}}; \ 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 dfb92c7..7dc6311 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 _0x73a6=['catch','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','toUpperCase','calleridname','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','WhatId','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','find','then','length','Email','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','execute','account','Account','first','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Caller\x20-\x20%s','LastName','','format','No\x20Company','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.'];(function(_0x57a73b,_0x4767c8){var _0x4445cc=function(_0x63e8a0){while(--_0x63e8a0){_0x57a73b['push'](_0x57a73b['shift']());}};_0x4445cc(++_0x4767c8);}(_0x73a6,0x19a));var _0x673a=function(_0x2f8be6,_0x1ae991){_0x2f8be6=_0x2f8be6-0x0;var _0x32f241=_0x73a6[_0x2f8be6];return _0x32f241;};'use strict';var _=require(_0x673a('0x0'));var rp=require(_0x673a('0x1'));var moment=require(_0x673a('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x673a('0x3'));var util=require(_0x673a('0x4'));var Redis=require(_0x673a('0x5'));var intUtil=require(_0x673a('0x6'));var config=require(_0x673a('0x7'));var logger=require(_0x673a('0x8'))(_0x673a('0x9'));config[_0x673a('0xa')]=_[_0x673a('0xb')](config[_0x673a('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x673a('0xc'))(new Redis(config[_0x673a('0xa')]));function emit(_0x4966ed,_0x2e9a66,_0x296079){io['to'](_0x4966ed)[_0x673a('0xd')](_0x2e9a66,_0x296079);}function getTicket(_0x29d0ff,_0x1610fa,_0x18171e,_0x4b5cd1,_0x175f89,_0x320f1c,_0x5ba452,_0xfe0ce2){var _0x28caa9=Object[_0x673a('0xe')]({},{'OwnerId':_0x1610fa['id'],'Subject':intUtil[_0x673a('0xf')](_0x4b5cd1[_0x673a('0x10')],_0x175f89,'\x20'),'Description':intUtil[_0x673a('0xf')](_0x4b5cd1[_0x673a('0x11')],_0x175f89,'\x0a')},getCustomFields(_0x320f1c,_0x175f89));if(_0x18171e){if(_0x4b5cd1[_0x673a('0x12')]===_0x673a('0x13')){_0x28caa9[_0x673a('0x14')]=moment[_0x673a('0x15')]();_0x28caa9[_0x673a('0x16')]=![];_0x28caa9[_0x673a('0x17')]=![];if(_0x18171e[_0x673a('0x18')]===_0x673a('0x19')||_0x18171e[_0x673a('0x18')]===_0x673a('0x1a')){_0x28caa9[_0x673a('0x1b')]=_0x18171e['id'];}else if(_0x18171e[_0x673a('0x18')]==='account'){_0x28caa9[_0x673a('0x1c')]=_0x18171e['id'];}}else if(_0x4b5cd1[_0x673a('0x12')]==='Case'){if(_0x18171e[_0x673a('0x18')]===_0x673a('0x19')){_0x28caa9[_0x673a('0x1d')]=_0x18171e['id'];}else if(_0x18171e[_0x673a('0x18')]==='account'){_0x28caa9[_0x673a('0x1e')]=_0x18171e['id'];}else if(_0x18171e[_0x673a('0x18')]===_0x673a('0x1a')&&_0x4b5cd1[_0x673a('0x1f')]){_0x28caa9[_0x4b5cd1[_0x673a('0x1f')]]=_0x18171e['id'];}else{logger['info'](_0x673a('0x20'));}}}return _0x5ba452[_0x673a('0x21')](_0x4b5cd1[_0x673a('0x12')])[_0x673a('0x22')](_0x28caa9);}function getUser(_0x1aed98,_0x3aef50,_0x1faa43){if(!_[_0x673a('0x23')](_0x3aef50)&&intUtil['validateEmail'](_0x3aef50)){var _0x199f79={'Email':_0x3aef50};var _0x455ccc={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1faa43[_0x673a('0x21')]('User')[_0x673a('0x24')](_0x199f79,_0x455ccc)['execute']()[_0x673a('0x25')](function(_0xba4dea){if(_0xba4dea[_0x673a('0x26')]){var _0x23c95c=_[_0x673a('0x24')](_0xba4dea,function(_0x17991f){return _0x17991f[_0x673a('0x27')]===_0x3aef50;});if(_0x23c95c){logger['info']('Agent\x20%s\x20found.',_0x3aef50);return BPromise[_0x673a('0x28')]({'id':_0x23c95c['Id'],'name':_0x23c95c[_0x673a('0x29')]});}}else{logger[_0x673a('0x2a')](_0x673a('0x2b'),_0x3aef50);return _0x1faa43[_0x673a('0x2c')]()[_0x673a('0x25')](function(_0x486883){return BPromise[_0x673a('0x28')]({'id':_0x486883[_0x673a('0x2d')],'name':_0x486883['display_name']});});}});}else{logger[_0x673a('0x2a')](_0x673a('0x2b'),_0x3aef50);return _0x1faa43['identity']()['then'](function(_0x20e36d){return BPromise['resolve']({'id':_0x20e36d['user_id'],'name':_0x20e36d['display_name']});});}}function getEndUser(_0x54e659,_0x3c006f,_0x281274,_0x410a7f,_0x4d1941){var _0x28079b={'$or':{'Phone':_0x410a7f}};var _0x2c5f78={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x673a('0x28')]()['then'](function(){logger[_0x673a('0x2a')](_0x673a('0x2e'),_0x410a7f,_0x3c006f[_0x673a('0x2f')]);switch(_0x3c006f[_0x673a('0x2f')]){case'contact_lead':var _0x55bbf8=_[_0x673a('0x30')](_0x28079b);if(_0x3c006f['additionalSearchContact']){var _0x540ef6={};_0x540ef6[_0x3c006f[_0x673a('0x31')]]=_0x410a7f;_[_0x673a('0x32')](_0x55bbf8[_0x673a('0x33')],_0x540ef6);}return _0x4d1941['sobject'](_0x673a('0x34'))['find'](_0x55bbf8,_0x2c5f78)['execute']()[_0x673a('0x25')](function(_0x2627cb){if(_0x2627cb&&_0x2627cb[_0x673a('0x26')]){return _0x2627cb;}else{var _0x43b37e=_['cloneDeep'](_0x28079b);if(_0x3c006f[_0x673a('0x35')]){var _0x180775={};_0x180775[_0x3c006f[_0x673a('0x35')]]=_0x410a7f;_['merge'](_0x43b37e[_0x673a('0x33')],_0x180775);}return _0x4d1941[_0x673a('0x21')](_0x673a('0x36'))[_0x673a('0x24')](_0x43b37e,_0x2c5f78);}});case _0x673a('0x37'):var _0x5590ad=_['cloneDeep'](_0x28079b);if(_0x3c006f[_0x673a('0x38')]){var _0x540ef6={};_0x540ef6[_0x3c006f[_0x673a('0x38')]]=_0x410a7f;_[_0x673a('0x32')](_0x5590ad[_0x673a('0x33')],_0x540ef6);}return _0x4d1941[_0x673a('0x21')]('Account')[_0x673a('0x24')](_0x5590ad,_0x2c5f78)[_0x673a('0x39')]()[_0x673a('0x25')](function(_0x5a05c3){if(_0x5a05c3&&_0x5a05c3['length']){return _0x5a05c3;}else{var _0x7f7eca=_[_0x673a('0x30')](_0x28079b);if(_0x3c006f['additionalSearchContact']){var _0x49c986={};_0x49c986[_0x3c006f['additionalSearchContact']]=_0x410a7f;_[_0x673a('0x32')](_0x7f7eca[_0x673a('0x33')],_0x49c986);}return _0x4d1941[_0x673a('0x21')]('Contact')[_0x673a('0x24')](_0x7f7eca,_0x2c5f78)[_0x673a('0x25')](function(_0x1771a7){if(_0x1771a7&&_0x1771a7['length']){return _0x1771a7;}else{var _0x351b9f=_[_0x673a('0x30')](_0x28079b);if(_0x3c006f[_0x673a('0x35')]){var _0x5b3881={};_0x5b3881[_0x3c006f[_0x673a('0x35')]]=_0x410a7f;_[_0x673a('0x32')](_0x351b9f[_0x673a('0x33')],_0x5b3881);}return _0x4d1941[_0x673a('0x21')]('Lead')['find'](_0x351b9f,_0x2c5f78);}});}});case _0x673a('0x19'):var _0x55bbf8=_[_0x673a('0x30')](_0x28079b);if(_0x3c006f[_0x673a('0x31')]){var _0x540ef6={};_0x540ef6[_0x3c006f[_0x673a('0x31')]]=_0x410a7f;_['merge'](_0x55bbf8[_0x673a('0x33')],_0x540ef6);}return _0x4d1941['sobject']('Contact')['find'](_0x55bbf8,_0x2c5f78)[_0x673a('0x39')]();case'lead':var _0x15a3b7=_[_0x673a('0x30')](_0x28079b);if(_0x3c006f['additionalSearchLead']){var _0x540ef6={};_0x540ef6[_0x3c006f[_0x673a('0x35')]]=_0x410a7f;_[_0x673a('0x32')](_0x15a3b7[_0x673a('0x33')],_0x540ef6);}return _0x4d1941[_0x673a('0x21')](_0x673a('0x36'))[_0x673a('0x24')](_0x15a3b7,_0x2c5f78);case _0x673a('0x3a'):var _0x5590ad=_[_0x673a('0x30')](_0x28079b);if(_0x3c006f[_0x673a('0x38')]){var _0x540ef6={};_0x540ef6[_0x3c006f['additionalSearchAccount']]=_0x410a7f;_[_0x673a('0x32')](_0x5590ad[_0x673a('0x33')],_0x540ef6);}return _0x4d1941[_0x673a('0x21')](_0x673a('0x3b'))['find'](_0x5590ad,_0x2c5f78);default:return null;}})['then'](function(_0x26bd57){if(_0x26bd57&&_0x26bd57[_0x673a('0x26')]){var _0x5981b3=_[_0x673a('0x3c')](_0x26bd57);if(_0x5981b3){return BPromise['resolve']({'id':_0x5981b3['Id'],'name':_0x5981b3[_0x673a('0x29')],'phone':_0x5981b3['Phone'],'endUserType':_0x5981b3[_0x673a('0x3d')][_0x673a('0x3e')][_0x673a('0x3f')]()});}}})[_0x673a('0x25')](function(_0x4821a1){if(_0x4821a1){logger[_0x673a('0x2a')](_0x673a('0x40'),_0x4821a1[_0x673a('0x18')],_0x410a7f);return BPromise[_0x673a('0x28')](_0x4821a1);}else{logger[_0x673a('0x2a')](_0x673a('0x41'),_0x410a7f);var _0x51bc29={'Phone':_0x410a7f};if(_0x3c006f[_0x673a('0x42')]){if(_0x3c006f['moduleCreate']===_0x673a('0x19')){logger[_0x673a('0x2a')](_0x673a('0x43'),_0x410a7f,_0x3c006f['moduleCreate']);_0x51bc29['LastName']=_0x281274!==''?_0x281274:util['format'](_0x673a('0x44'),_0x410a7f);}else if(_0x3c006f['moduleCreate']===_0x673a('0x1a')){logger[_0x673a('0x2a')](_0x673a('0x43'),_0x410a7f,_0x3c006f[_0x673a('0x42')]);_0x51bc29[_0x673a('0x45')]=_0x281274!==_0x673a('0x46')?_0x281274:util[_0x673a('0x47')](_0x673a('0x44'),_0x410a7f);_0x51bc29['Company']=_0x673a('0x48');}else if(_0x3c006f[_0x673a('0x42')]==='account'){logger[_0x673a('0x2a')](_0x673a('0x43'),_0x410a7f,_0x3c006f[_0x673a('0x42')]);_0x51bc29['Name']=_0x281274!==_0x673a('0x46')?_0x281274:util['format'](_0x673a('0x44'),_0x410a7f);}else{return null;}}return _0x4d1941[_0x673a('0x21')](_['upperFirst'](_0x3c006f[_0x673a('0x42')]))[_0x673a('0x22')](_0x51bc29)['then'](function(_0x2fc1d9){return BPromise[_0x673a('0x28')]({'id':_0x2fc1d9['id'],'endUserType':_0x3c006f['moduleCreate']});});}});}function getCustomFields(_0xfe6a0a,_0x15b50f){var _0x253981={};if(_0xfe6a0a[_0x673a('0x26')]>0x0){_[_0x673a('0x49')](_0xfe6a0a,function(_0x27b305){if(_[_0x673a('0x4a')]([_0x673a('0x4b'),_0x673a('0x4c')],_0x27b305[_0x673a('0x3e')])&&_0x27b305[_0x673a('0x4d')]){_0x253981[_0x27b305['idField']]=_0x27b305[_0x673a('0x4e')][_0x673a('0x4f')]();}else if(_0x27b305[_0x673a('0x3e')]===_0x673a('0x50')&&_0x27b305[_0x673a('0x51')]&&_0x27b305[_0x673a('0x4d')]){_0x15b50f[_0x27b305['variableName']]&&(_0x253981[_0x27b305[_0x673a('0x4d')]]=_0x15b50f[_0x27b305[_0x673a('0x51')]][_0x673a('0x4f')]());}else if(_0x27b305[_0x673a('0x3e')]===_0x673a('0x52')&&_0x27b305[_0x673a('0x53')]&&_0x27b305[_0x673a('0x53')][_0x673a('0x54')]&&_0x27b305['idField']){_0x15b50f[_0x27b305[_0x673a('0x53')][_0x673a('0x54')][_0x673a('0x3f')]()]&&(_0x253981[_0x27b305[_0x673a('0x4d')]]=_0x15b50f[_0x27b305[_0x673a('0x53')][_0x673a('0x54')][_0x673a('0x3f')]()][_0x673a('0x4f')]());}});}return _0x253981;}function getConnection(_0x5cd8cf){var _0x1d3903=_0x5cd8cf['password'][_0x673a('0x55')](_0x5cd8cf[_0x673a('0x56')]);var _0x522852=new jsforce[(_0x673a('0x57'))]({'oauth2':{'loginUrl':_0x5cd8cf[_0x673a('0x58')]||_0x673a('0x59'),'clientId':_0x5cd8cf[_0x673a('0x5a')],'clientSecret':_0x5cd8cf['clientSecret']}});return _0x522852[_0x673a('0x5b')](_0x5cd8cf[_0x673a('0x5c')],_0x1d3903)[_0x673a('0x25')](function(){logger[_0x673a('0x2a')](_0x673a('0x5d'));return _0x522852;});}exports[_0x673a('0x5e')]=function(_0x4c0fb6,_0x347024,_0x585c97,_0x1c8fde,_0x397964,_0x1aa4cf){var _0x4598ec,_0xc710d9,_0x3353e2,_0x499951;_0x1aa4cf[_0x673a('0x5f')]=intUtil[_0x673a('0x60')](_0x1aa4cf['serverUrl']);_0x1aa4cf[_0x673a('0x58')]=intUtil[_0x673a('0x60')](_0x1aa4cf[_0x673a('0x58')]);if(_0x397964&&_0x397964['monitor_format']){logger[_0x673a('0x2a')](_0x673a('0x61'),_0x673a('0x62'));_0x347024['recordingURL']=util[_0x673a('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1aa4cf['serverUrl'],_0x347024[_0x673a('0x63')],md5(_0x347024[_0x673a('0x63')]));}else{_0x347024[_0x673a('0x64')]='';}return getConnection(_0x1aa4cf)[_0x673a('0x25')](function(_0x57d4e6){_0x499951=_0x57d4e6;return getUser(_0x1aa4cf,_0x1c8fde['email'],_0x499951);})[_0x673a('0x25')](function(_0x17df6b){_0x4598ec=_0x17df6b;return getEndUser(_0x1aa4cf,_0x585c97,_0x347024['calleridname'],_0x347024[_0x673a('0x65')],_0x499951);})['then'](function(_0x317baa){_0xc710d9=_0x317baa;return getTicket(_0x1aa4cf,_0x4598ec,_0xc710d9,_0x585c97,_0x347024,_0x585c97[_0x673a('0x66')],_0x499951,_0x673a('0x5e'));})[_0x673a('0x25')](function(_0x1e4f05){_0x3353e2=_0x1e4f05;logger[_0x673a('0x2a')](_0x673a('0x67'),_0x3353e2['id']);logger[_0x673a('0x2a')](_0x673a('0x68'),_0x3353e2['id'],_0x1c8fde['name'],_0x1aa4cf['type']);switch(_0x1aa4cf[_0x673a('0x3e')]){case _0x673a('0x69'):emit(util[_0x673a('0x47')](_0x673a('0x6a'),_0x1c8fde[_0x673a('0x54')]),_0x673a('0x6b'),{'recordId':_0x3353e2['id']});break;case _0x673a('0x6c'):emit(util[_0x673a('0x47')](_0x673a('0x6a'),_0x1c8fde[_0x673a('0x54')]),_0x673a('0x6d'),{'uri':util[_0x673a('0x47')](_0x673a('0x6e'),_0x499951[_0x673a('0x6f')],_0x3353e2['id'])});break;default:logger[_0x673a('0x70')](_0x673a('0x71'));}})[_0x673a('0x72')](function(_0x22b5ee){logger[_0x673a('0x70')](_0x673a('0x61'),_0x22b5ee);});};exports[_0x673a('0x73')]=function(_0x366352,_0x59d145,_0x2fa033,_0x5a0bd3,_0x4e4b80,_0x5c39d6,_0x4d3dae){var _0x4bcef2,_0x1d0ddc,_0x3a82d7,_0x3f0efc;_0x5c39d6[_0x673a('0x5f')]=intUtil[_0x673a('0x60')](_0x5c39d6[_0x673a('0x5f')]);_0x5c39d6[_0x673a('0x58')]=intUtil['stripTrailingSlash'](_0x5c39d6[_0x673a('0x58')]);if(_0x4d3dae&&_0x4d3dae[_0x673a('0x74')]&&_0x4d3dae[_0x673a('0x74')]!=='none'){logger[_0x673a('0x2a')](_0x673a('0x75'),'Recording\x20is\x20enabled!');_0x59d145[_0x673a('0x64')]=util[_0x673a('0x47')](_0x673a('0x76'),_0x5c39d6['serverUrl'],_0x59d145[_0x673a('0x63')],md5(_0x59d145[_0x673a('0x63')]));}return getConnection(_0x5c39d6)[_0x673a('0x25')](function(_0x313ac5){_0x3f0efc=_0x313ac5;return getUser(_0x5c39d6,_0x5a0bd3[_0x673a('0x77')],_0x3f0efc);})[_0x673a('0x25')](function(_0x1be3b1){_0x4bcef2=_0x1be3b1;return getEndUser(_0x5c39d6,_0x2fa033,_0x59d145[_0x673a('0x78')],_0x59d145['destcalleridnum'],_0x3f0efc);})[_0x673a('0x25')](function(_0x57b650){_0x1d0ddc=_0x57b650;return getTicket(_0x5c39d6,_0x4bcef2,_0x1d0ddc,_0x2fa033,_0x59d145,_0x2fa033[_0x673a('0x66')],_0x3f0efc,_0x673a('0x73'));})[_0x673a('0x25')](function(_0x210643){_0x3a82d7=_0x210643;logger['info'](_0x673a('0x79'),_0x3a82d7['id']);logger[_0x673a('0x2a')](_0x673a('0x7a'),_0x3a82d7['id'],_0x5a0bd3[_0x673a('0x54')],_0x5c39d6[_0x673a('0x3e')]);switch(_0x5c39d6[_0x673a('0x3e')]){case _0x673a('0x69'):emit(util[_0x673a('0x47')]('user:%s',_0x5a0bd3['name']),_0x673a('0x6b'),{'recordId':_0x3a82d7['id']});break;case _0x673a('0x6c'):emit(util[_0x673a('0x47')](_0x673a('0x6a'),_0x5a0bd3[_0x673a('0x54')]),'trigger:browser:url',{'uri':util[_0x673a('0x47')]('%s/%s/e',_0x3f0efc[_0x673a('0x6f')],_0x3a82d7['id'])});break;default:logger[_0x673a('0x70')](_0x673a('0x75'),_0x673a('0x7b'));}})['catch'](function(_0x15ed86){logger[_0x673a('0x70')](_0x673a('0x75'),_0x15ed86);});};exports[_0x673a('0x7c')]=function(_0x3db658,_0x96d4eb,_0x54f55e,_0x336f19,_0x564167,_0x317a4a){var _0x51aae1,_0x7dff89,_0x5234e4,_0x2d46ba;_0x317a4a[_0x673a('0x5f')]=intUtil['stripTrailingSlash'](_0x317a4a[_0x673a('0x5f')]);_0x317a4a[_0x673a('0x58')]=intUtil[_0x673a('0x60')](_0x317a4a['remoteUri']);if(_0x564167&&_0x564167[_0x673a('0x7d')]){logger[_0x673a('0x2a')]('['+_0x96d4eb['lastevent'][_0x673a('0x7e')]()+']','Recording\x20is\x20enabled!');_0x96d4eb['recordingURL']=util['format'](_0x673a('0x76'),_0x317a4a[_0x673a('0x5f')],_0x96d4eb[_0x673a('0x63')],md5(_0x96d4eb[_0x673a('0x63')]));}else{_0x96d4eb['recordingURL']='';}return getConnection(_0x317a4a)[_0x673a('0x25')](function(_0x4776dd){_0x2d46ba=_0x4776dd;if(!_[_0x673a('0x23')](_0x336f19)){return getUser(_0x317a4a,_0x336f19[_0x673a('0x54')],_0x2d46ba);}else{return getUser(_0x317a4a,null,_0x2d46ba);}})['then'](function(_0x199000){_0x51aae1=_0x199000;return getEndUser(_0x317a4a,_0x54f55e,_0x96d4eb[_0x673a('0x7f')],_0x96d4eb[_0x673a('0x65')],_0x2d46ba);})[_0x673a('0x25')](function(_0x306704){_0x7dff89=_0x306704;return getTicket(_0x317a4a,_0x51aae1,_0x7dff89,_0x54f55e,_0x96d4eb,_0x54f55e[_0x673a('0x66')],_0x2d46ba);})[_0x673a('0x25')](function(_0x4ae665){_0x5234e4=_0x4ae665;logger[_0x673a('0x2a')]('['+_0x96d4eb[_0x673a('0x80')][_0x673a('0x7e')]()+_0x673a('0x81'),_0x5234e4['id']);logger[_0x673a('0x2a')]('['+_0x96d4eb[_0x673a('0x80')][_0x673a('0x7e')]()+_0x673a('0x82'),_0x317a4a[_0x673a('0x3e')]);})[_0x673a('0x72')](function(_0xd043ed){logger[_0x673a('0x70')]('['+_0x96d4eb[_0x673a('0x80')][_0x673a('0x7e')]()+']',_0xd043ed);});}; \ No newline at end of file +var _0x7b34=['upperFirst','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','name','Variable','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','create','isNil','validateEmail','sobject','User','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','cloneDeep','additionalSearchContact','Contact','merge','$or','Lead','account_contact_lead','additionalSearchAccount','additionalSearchLead','Account','first','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company'];(function(_0x3d5df9,_0x5b3623){var _0x50ba39=function(_0x3c0de0){while(--_0x3c0de0){_0x3d5df9['push'](_0x3d5df9['shift']());}};_0x50ba39(++_0x5b3623);}(_0x7b34,0xbf));var _0x47b3=function(_0x55b2e8,_0x1fd6dd){_0x55b2e8=_0x55b2e8-0x0;var _0x5b585a=_0x7b34[_0x55b2e8];return _0x5b585a;};'use strict';var _=require(_0x47b3('0x0'));var rp=require(_0x47b3('0x1'));var moment=require(_0x47b3('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x47b3('0x3'));var util=require('util');var Redis=require(_0x47b3('0x4'));var intUtil=require(_0x47b3('0x5'));var config=require(_0x47b3('0x6'));var logger=require(_0x47b3('0x7'))(_0x47b3('0x8'));config[_0x47b3('0x9')]=_[_0x47b3('0xa')](config['redis'],{'host':_0x47b3('0xb'),'port':0x18eb});var io=require(_0x47b3('0xc'))(new Redis(config['redis']));function emit(_0x2fb58d,_0x4848ce,_0x473038){io['to'](_0x2fb58d)[_0x47b3('0xd')](_0x4848ce,_0x473038);}function getTicket(_0x4eeb20,_0x54f12e,_0x269cc0,_0x39f107,_0x587386,_0x5eb9f8,_0x4e9263,_0x4b7518){var _0x4d08ae=Object[_0x47b3('0xe')]({},{'OwnerId':_0x54f12e['id'],'Subject':intUtil['getString'](_0x39f107[_0x47b3('0xf')],_0x587386,'\x20'),'Description':intUtil['getString'](_0x39f107[_0x47b3('0x10')],_0x587386,'\x0a')},getCustomFields(_0x5eb9f8,_0x587386));if(_0x269cc0){if(_0x39f107[_0x47b3('0x11')]===_0x47b3('0x12')){_0x4d08ae['ActivityDate']=moment[_0x47b3('0x13')]();_0x4d08ae[_0x47b3('0x14')]=![];_0x4d08ae['IsRecurrence']=![];if(_0x269cc0[_0x47b3('0x15')]===_0x47b3('0x16')||_0x269cc0[_0x47b3('0x15')]===_0x47b3('0x17')){_0x4d08ae[_0x47b3('0x18')]=_0x269cc0['id'];}else if(_0x269cc0[_0x47b3('0x15')]===_0x47b3('0x19')){_0x4d08ae[_0x47b3('0x1a')]=_0x269cc0['id'];}}else if(_0x39f107['ticketType']===_0x47b3('0x1b')){if(_0x269cc0[_0x47b3('0x15')]===_0x47b3('0x16')){_0x4d08ae[_0x47b3('0x1c')]=_0x269cc0['id'];}else if(_0x269cc0[_0x47b3('0x15')]===_0x47b3('0x19')){_0x4d08ae[_0x47b3('0x1d')]=_0x269cc0['id'];}else if(_0x269cc0[_0x47b3('0x15')]===_0x47b3('0x17')&&_0x39f107[_0x47b3('0x1e')]){_0x4d08ae[_0x39f107[_0x47b3('0x1e')]]=_0x269cc0['id'];}else{logger[_0x47b3('0x1f')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x4e9263['sobject'](_0x39f107[_0x47b3('0x11')])[_0x47b3('0x20')](_0x4d08ae);}function getUser(_0x2e974d,_0x4feedf,_0x2b6b2f){if(!_[_0x47b3('0x21')](_0x4feedf)&&intUtil[_0x47b3('0x22')](_0x4feedf)){var _0x427a76={'Email':_0x4feedf};var _0x189c91={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2b6b2f[_0x47b3('0x23')](_0x47b3('0x24'))[_0x47b3('0x25')](_0x427a76,_0x189c91)[_0x47b3('0x26')]()[_0x47b3('0x27')](function(_0x2cefea){if(_0x2cefea[_0x47b3('0x28')]){var _0x17ce8d=_['find'](_0x2cefea,function(_0x5a2579){return _0x5a2579['Email']===_0x4feedf;});if(_0x17ce8d){logger[_0x47b3('0x1f')](_0x47b3('0x29'),_0x4feedf);return BPromise[_0x47b3('0x2a')]({'id':_0x17ce8d['Id'],'name':_0x17ce8d[_0x47b3('0x2b')]});}}else{logger[_0x47b3('0x1f')](_0x47b3('0x2c'),_0x4feedf);return _0x2b6b2f[_0x47b3('0x2d')]()['then'](function(_0x23fb39){return BPromise[_0x47b3('0x2a')]({'id':_0x23fb39['user_id'],'name':_0x23fb39['display_name']});});}});}else{logger[_0x47b3('0x1f')](_0x47b3('0x2c'),_0x4feedf);return _0x2b6b2f['identity']()[_0x47b3('0x27')](function(_0x536356){return BPromise[_0x47b3('0x2a')]({'id':_0x536356[_0x47b3('0x2e')],'name':_0x536356[_0x47b3('0x2f')]});});}}function getEndUser(_0x4d56c9,_0x2eacda,_0x28ca09,_0x54ecb6,_0x50e525){var _0x49d50e={'$or':{'Phone':_0x54ecb6}};var _0x4c94f5={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x47b3('0x27')](function(){logger[_0x47b3('0x1f')](_0x47b3('0x30'),_0x54ecb6,_0x2eacda['moduleSearch']);switch(_0x2eacda['moduleSearch']){case _0x47b3('0x31'):var _0x67990a=_[_0x47b3('0x32')](_0x49d50e);if(_0x2eacda[_0x47b3('0x33')]){var _0x503ea7={};_0x503ea7[_0x2eacda[_0x47b3('0x33')]]=_0x54ecb6;_['merge'](_0x67990a['$or'],_0x503ea7);}return _0x50e525['sobject'](_0x47b3('0x34'))['find'](_0x67990a,_0x4c94f5)[_0x47b3('0x26')]()[_0x47b3('0x27')](function(_0x33f08a){if(_0x33f08a&&_0x33f08a['length']){return _0x33f08a;}else{var _0x295b01=_[_0x47b3('0x32')](_0x49d50e);if(_0x2eacda['additionalSearchLead']){var _0x316692={};_0x316692[_0x2eacda['additionalSearchLead']]=_0x54ecb6;_[_0x47b3('0x35')](_0x295b01[_0x47b3('0x36')],_0x316692);}return _0x50e525[_0x47b3('0x23')](_0x47b3('0x37'))[_0x47b3('0x25')](_0x295b01,_0x4c94f5);}});case _0x47b3('0x38'):var _0x2f4c1e=_[_0x47b3('0x32')](_0x49d50e);if(_0x2eacda['additionalSearchAccount']){var _0x503ea7={};_0x503ea7[_0x2eacda[_0x47b3('0x39')]]=_0x54ecb6;_[_0x47b3('0x35')](_0x2f4c1e[_0x47b3('0x36')],_0x503ea7);}return _0x50e525[_0x47b3('0x23')]('Account')[_0x47b3('0x25')](_0x2f4c1e,_0x4c94f5)[_0x47b3('0x26')]()[_0x47b3('0x27')](function(_0x5eb556){if(_0x5eb556&&_0x5eb556[_0x47b3('0x28')]){return _0x5eb556;}else{var _0x4fb8a0=_['cloneDeep'](_0x49d50e);if(_0x2eacda['additionalSearchContact']){var _0x47cb94={};_0x47cb94[_0x2eacda['additionalSearchContact']]=_0x54ecb6;_[_0x47b3('0x35')](_0x4fb8a0[_0x47b3('0x36')],_0x47cb94);}return _0x50e525['sobject'](_0x47b3('0x34'))[_0x47b3('0x25')](_0x4fb8a0,_0x4c94f5)[_0x47b3('0x27')](function(_0xd2e09){if(_0xd2e09&&_0xd2e09['length']){return _0xd2e09;}else{var _0x3b771c=_[_0x47b3('0x32')](_0x49d50e);if(_0x2eacda[_0x47b3('0x3a')]){var _0x315ab5={};_0x315ab5[_0x2eacda[_0x47b3('0x3a')]]=_0x54ecb6;_['merge'](_0x3b771c[_0x47b3('0x36')],_0x315ab5);}return _0x50e525[_0x47b3('0x23')](_0x47b3('0x37'))[_0x47b3('0x25')](_0x3b771c,_0x4c94f5);}});}});case _0x47b3('0x16'):var _0x67990a=_[_0x47b3('0x32')](_0x49d50e);if(_0x2eacda[_0x47b3('0x33')]){var _0x503ea7={};_0x503ea7[_0x2eacda[_0x47b3('0x33')]]=_0x54ecb6;_['merge'](_0x67990a['$or'],_0x503ea7);}return _0x50e525['sobject']('Contact')[_0x47b3('0x25')](_0x67990a,_0x4c94f5)[_0x47b3('0x26')]();case _0x47b3('0x17'):var _0x2bd02e=_['cloneDeep'](_0x49d50e);if(_0x2eacda[_0x47b3('0x3a')]){var _0x503ea7={};_0x503ea7[_0x2eacda[_0x47b3('0x3a')]]=_0x54ecb6;_[_0x47b3('0x35')](_0x2bd02e['$or'],_0x503ea7);}return _0x50e525['sobject']('Lead')[_0x47b3('0x25')](_0x2bd02e,_0x4c94f5);case _0x47b3('0x19'):var _0x2f4c1e=_[_0x47b3('0x32')](_0x49d50e);if(_0x2eacda[_0x47b3('0x39')]){var _0x503ea7={};_0x503ea7[_0x2eacda[_0x47b3('0x39')]]=_0x54ecb6;_[_0x47b3('0x35')](_0x2f4c1e[_0x47b3('0x36')],_0x503ea7);}return _0x50e525[_0x47b3('0x23')](_0x47b3('0x3b'))['find'](_0x2f4c1e,_0x4c94f5);default:return null;}})[_0x47b3('0x27')](function(_0x4819df){if(_0x4819df&&_0x4819df['length']){var _0x40cfb2=_[_0x47b3('0x3c')](_0x4819df);if(_0x40cfb2){return BPromise[_0x47b3('0x2a')]({'id':_0x40cfb2['Id'],'name':_0x40cfb2[_0x47b3('0x2b')],'phone':_0x40cfb2[_0x47b3('0x3d')],'endUserType':_0x40cfb2[_0x47b3('0x3e')]['type'][_0x47b3('0x3f')]()});}}})[_0x47b3('0x27')](function(_0x191083){if(_0x191083){logger[_0x47b3('0x1f')](_0x47b3('0x40'),_0x191083['endUserType'],_0x54ecb6);return BPromise[_0x47b3('0x2a')](_0x191083);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x54ecb6);var _0x5b5f60={'Phone':_0x54ecb6};if(_0x2eacda[_0x47b3('0x41')]){if(_0x2eacda[_0x47b3('0x41')]===_0x47b3('0x16')){logger[_0x47b3('0x1f')](_0x47b3('0x42'),_0x54ecb6,_0x2eacda[_0x47b3('0x41')]);_0x5b5f60[_0x47b3('0x43')]=_0x28ca09!==_0x47b3('0x44')?_0x28ca09:util['format']('Caller\x20-\x20%s',_0x54ecb6);}else if(_0x2eacda[_0x47b3('0x41')]===_0x47b3('0x17')){logger[_0x47b3('0x1f')](_0x47b3('0x42'),_0x54ecb6,_0x2eacda['moduleCreate']);_0x5b5f60[_0x47b3('0x43')]=_0x28ca09!==_0x47b3('0x44')?_0x28ca09:util[_0x47b3('0x45')](_0x47b3('0x46'),_0x54ecb6);_0x5b5f60[_0x47b3('0x47')]=_0x47b3('0x48');}else if(_0x2eacda[_0x47b3('0x41')]==='account'){logger['info'](_0x47b3('0x42'),_0x54ecb6,_0x2eacda[_0x47b3('0x41')]);_0x5b5f60['Name']=_0x28ca09!==_0x47b3('0x44')?_0x28ca09:util[_0x47b3('0x45')](_0x47b3('0x46'),_0x54ecb6);}else{return null;}}return _0x50e525['sobject'](_[_0x47b3('0x49')](_0x2eacda[_0x47b3('0x41')]))[_0x47b3('0x20')](_0x5b5f60)[_0x47b3('0x27')](function(_0x5b1a56){return BPromise[_0x47b3('0x2a')]({'id':_0x5b1a56['id'],'endUserType':_0x2eacda[_0x47b3('0x41')]});});}});}function getCustomFields(_0x5ad40d,_0x46e2c9){var _0x4ad9d5={};if(_0x5ad40d[_0x47b3('0x28')]>0x0){_['forEach'](_0x5ad40d,function(_0x4746c8){if(_[_0x47b3('0x4a')]([_0x47b3('0x4b'),_0x47b3('0x4c')],_0x4746c8[_0x47b3('0x4d')])&&_0x4746c8[_0x47b3('0x4e')]){_0x4ad9d5[_0x4746c8[_0x47b3('0x4e')]]=_0x4746c8[_0x47b3('0x4f')][_0x47b3('0x50')]();}else if(_0x4746c8[_0x47b3('0x4d')]===_0x47b3('0x51')&&_0x4746c8['variableName']&&_0x4746c8['idField']){_0x46e2c9[_0x4746c8['variableName']]&&(_0x4ad9d5[_0x4746c8[_0x47b3('0x4e')]]=_0x46e2c9[_0x4746c8[_0x47b3('0x52')]]['toString']());}else if(_0x4746c8[_0x47b3('0x4d')]===_0x47b3('0x53')&&_0x4746c8['Variable']&&_0x4746c8['Variable'][_0x47b3('0x54')]&&_0x4746c8[_0x47b3('0x4e')]){_0x46e2c9[_0x4746c8[_0x47b3('0x55')]['name'][_0x47b3('0x3f')]()]&&(_0x4ad9d5[_0x4746c8[_0x47b3('0x4e')]]=_0x46e2c9[_0x4746c8[_0x47b3('0x55')][_0x47b3('0x54')][_0x47b3('0x3f')]()][_0x47b3('0x50')]());}});}return _0x4ad9d5;}function getConnection(_0x747cf2){var _0x2de38c=_0x747cf2[_0x47b3('0x56')][_0x47b3('0x57')](_0x747cf2['securityToken']);var _0x50cb39=new jsforce[(_0x47b3('0x58'))]({'oauth2':{'loginUrl':_0x747cf2[_0x47b3('0x59')]||_0x47b3('0x5a'),'clientId':_0x747cf2[_0x47b3('0x5b')],'clientSecret':_0x747cf2[_0x47b3('0x5c')]}});return _0x50cb39[_0x47b3('0x5d')](_0x747cf2[_0x47b3('0x5e')],_0x2de38c)[_0x47b3('0x27')](function(){logger[_0x47b3('0x1f')](_0x47b3('0x5f'));return _0x50cb39;});}exports[_0x47b3('0x60')]=function(_0x10d455,_0x5e820d,_0x570694,_0x21bde5,_0x333839,_0x17db56){var _0xbbb226,_0xdbfc29,_0x12194b,_0x5f2a13;_0x17db56[_0x47b3('0x61')]=intUtil[_0x47b3('0x62')](_0x17db56['serverUrl']);_0x17db56[_0x47b3('0x59')]=intUtil[_0x47b3('0x62')](_0x17db56['remoteUri']);if(_0x333839&&_0x333839['monitor_format']){logger[_0x47b3('0x1f')](_0x47b3('0x63'),_0x47b3('0x64'));_0x5e820d[_0x47b3('0x65')]=util['format'](_0x47b3('0x66'),_0x17db56[_0x47b3('0x61')],_0x5e820d[_0x47b3('0x67')],md5(_0x5e820d[_0x47b3('0x67')]));}else{_0x5e820d[_0x47b3('0x65')]='';}return getConnection(_0x17db56)[_0x47b3('0x27')](function(_0x1f5e62){_0x5f2a13=_0x1f5e62;return getUser(_0x17db56,_0x21bde5[_0x47b3('0x68')],_0x5f2a13);})[_0x47b3('0x27')](function(_0x36f4e5){_0xbbb226=_0x36f4e5;return getEndUser(_0x17db56,_0x570694,_0x5e820d[_0x47b3('0x69')],_0x5e820d['calleridnum'],_0x5f2a13);})[_0x47b3('0x27')](function(_0x450f18){_0xdbfc29=_0x450f18;return getTicket(_0x17db56,_0xbbb226,_0xdbfc29,_0x570694,_0x5e820d,_0x570694[_0x47b3('0x6a')],_0x5f2a13,_0x47b3('0x60'));})[_0x47b3('0x27')](function(_0x4e46a4){_0x12194b=_0x4e46a4;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x12194b['id']);logger[_0x47b3('0x1f')](_0x47b3('0x6b'),_0x12194b['id'],_0x21bde5[_0x47b3('0x54')],_0x17db56[_0x47b3('0x4d')]);switch(_0x17db56[_0x47b3('0x4d')]){case _0x47b3('0x6c'):emit(util[_0x47b3('0x45')](_0x47b3('0x6d'),_0x21bde5['name']),_0x47b3('0x6e'),{'recordId':_0x12194b['id']});break;case'newTab':emit(util[_0x47b3('0x45')]('user:%s',_0x21bde5[_0x47b3('0x54')]),_0x47b3('0x6f'),{'uri':util['format'](_0x47b3('0x70'),_0x5f2a13[_0x47b3('0x71')],_0x12194b['id'])});break;default:logger[_0x47b3('0x72')](_0x47b3('0x73'));}})[_0x47b3('0x74')](function(_0x385846){logger[_0x47b3('0x72')](_0x47b3('0x63'),_0x385846);});};exports[_0x47b3('0x75')]=function(_0x394ead,_0x240152,_0x3991f3,_0x2c8c8e,_0x39660f,_0x426f94,_0x226305){var _0x5d8bcb,_0xb8ff0a,_0x33d016,_0x5dc7d3;_0x426f94[_0x47b3('0x61')]=intUtil[_0x47b3('0x62')](_0x426f94[_0x47b3('0x61')]);_0x426f94[_0x47b3('0x59')]=intUtil[_0x47b3('0x62')](_0x426f94['remoteUri']);if(_0x226305&&_0x226305[_0x47b3('0x76')]&&_0x226305[_0x47b3('0x76')]!=='none'){logger['info'](_0x47b3('0x77'),'Recording\x20is\x20enabled!');_0x240152[_0x47b3('0x65')]=util['format'](_0x47b3('0x66'),_0x426f94[_0x47b3('0x61')],_0x240152[_0x47b3('0x67')],md5(_0x240152[_0x47b3('0x67')]));}return getConnection(_0x426f94)['then'](function(_0x1d7e34){_0x5dc7d3=_0x1d7e34;return getUser(_0x426f94,_0x2c8c8e[_0x47b3('0x68')],_0x5dc7d3);})['then'](function(_0x4288b2){_0x5d8bcb=_0x4288b2;return getEndUser(_0x426f94,_0x3991f3,_0x240152[_0x47b3('0x78')],_0x240152[_0x47b3('0x79')],_0x5dc7d3);})[_0x47b3('0x27')](function(_0x57cdae){_0xb8ff0a=_0x57cdae;return getTicket(_0x426f94,_0x5d8bcb,_0xb8ff0a,_0x3991f3,_0x240152,_0x3991f3[_0x47b3('0x6a')],_0x5dc7d3,'outbound');})[_0x47b3('0x27')](function(_0x4015c8){_0x33d016=_0x4015c8;logger[_0x47b3('0x1f')](_0x47b3('0x7a'),_0x33d016['id']);logger[_0x47b3('0x1f')](_0x47b3('0x7b'),_0x33d016['id'],_0x2c8c8e[_0x47b3('0x54')],_0x426f94[_0x47b3('0x4d')]);switch(_0x426f94[_0x47b3('0x4d')]){case'integrationTab':emit(util['format'](_0x47b3('0x6d'),_0x2c8c8e[_0x47b3('0x54')]),_0x47b3('0x6e'),{'recordId':_0x33d016['id']});break;case _0x47b3('0x7c'):emit(util[_0x47b3('0x45')](_0x47b3('0x6d'),_0x2c8c8e[_0x47b3('0x54')]),_0x47b3('0x6f'),{'uri':util[_0x47b3('0x45')](_0x47b3('0x70'),_0x5dc7d3[_0x47b3('0x71')],_0x33d016['id'])});break;default:logger['error'](_0x47b3('0x77'),_0x47b3('0x7d'));}})[_0x47b3('0x74')](function(_0x5f4895){logger[_0x47b3('0x72')](_0x47b3('0x77'),_0x5f4895);});};exports[_0x47b3('0x7e')]=function(_0x121c37,_0x5343f7,_0x3aba31,_0x195c18,_0x22e958,_0x5967c2){var _0x481863,_0x1bfabf,_0x22ddd3,_0x1d7b9e;_0x5967c2[_0x47b3('0x61')]=intUtil[_0x47b3('0x62')](_0x5967c2[_0x47b3('0x61')]);_0x5967c2[_0x47b3('0x59')]=intUtil[_0x47b3('0x62')](_0x5967c2[_0x47b3('0x59')]);if(_0x22e958&&_0x22e958[_0x47b3('0x7f')]){logger[_0x47b3('0x1f')]('['+_0x5343f7[_0x47b3('0x80')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x5343f7[_0x47b3('0x65')]=util['format'](_0x47b3('0x66'),_0x5967c2[_0x47b3('0x61')],_0x5343f7[_0x47b3('0x67')],md5(_0x5343f7[_0x47b3('0x67')]));}else{_0x5343f7[_0x47b3('0x65')]='';}return getConnection(_0x5967c2)[_0x47b3('0x27')](function(_0x2ea982){_0x1d7b9e=_0x2ea982;if(!_[_0x47b3('0x21')](_0x195c18)){return getUser(_0x5967c2,_0x195c18[_0x47b3('0x54')],_0x1d7b9e);}else{return getUser(_0x5967c2,null,_0x1d7b9e);}})[_0x47b3('0x27')](function(_0x172386){_0x481863=_0x172386;return getEndUser(_0x5967c2,_0x3aba31,_0x5343f7[_0x47b3('0x69')],_0x5343f7[_0x47b3('0x81')],_0x1d7b9e);})['then'](function(_0x204ba1){_0x1bfabf=_0x204ba1;return getTicket(_0x5967c2,_0x481863,_0x1bfabf,_0x3aba31,_0x5343f7,_0x3aba31[_0x47b3('0x6a')],_0x1d7b9e);})[_0x47b3('0x27')](function(_0x814cd){_0x22ddd3=_0x814cd;logger[_0x47b3('0x1f')]('['+_0x5343f7[_0x47b3('0x80')]['toUpperCase']()+_0x47b3('0x82'),_0x22ddd3['id']);logger[_0x47b3('0x1f')]('['+_0x5343f7[_0x47b3('0x80')]['toUpperCase']()+_0x47b3('0x83'),_0x5967c2['type']);})['catch'](function(_0x3e60e2){logger[_0x47b3('0x72')]('['+_0x5343f7[_0x47b3('0x80')]['toUpperCase']()+']',_0x3e60e2);});}; \ 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 b49195d..44f12b9 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 _0x13d5=['message','info','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','includes','picklist','nameField','customField','toLowerCase','content','toString','string','type','idField','variableName','customVariable','Variable','name','incident','assign','getString','Subjects',']\x20POST\x20incident\x20entity\x20schema','number','POST','label','?sysparm_query=name%3D','label_entry','ticketId','Incident\x20-\x20','ticketNumber','all','push','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','trigger:browser:url','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','isNil','email','outbound','destcalleridnum','calleridnum','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','md5','./util','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','then','result','sys_id','toUpperCase','],\x20getAdminUser\x20crm','error'];(function(_0x4e067f,_0x6efea8){var _0x3827b1=function(_0x87de54){while(--_0x87de54){_0x4e067f['push'](_0x4e067f['shift']());}};_0x3827b1(++_0x6efea8);}(_0x13d5,0x123));var _0x513d=function(_0x5eacf4,_0x5eea32){_0x5eacf4=_0x5eacf4-0x0;var _0x93ff8b=_0x13d5[_0x5eacf4];return _0x93ff8b;};'use strict';var _=require(_0x513d('0x0'));var Promise=require(_0x513d('0x1'));var rp=require(_0x513d('0x2'));var util=require(_0x513d('0x3'));var md5=require(_0x513d('0x4'));var Redis=require('ioredis');var intUtil=require(_0x513d('0x5'));var config=require('../../../../config/environment');var logger=require(_0x513d('0x6'))(_0x513d('0x7'));config[_0x513d('0x8')]=_[_0x513d('0x9')](config[_0x513d('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x513d('0xa'))(new Redis(config[_0x513d('0x8')]));function getAdminUser(_0x2f8775,_0x21ba0d,_0x162000,_0x4e0dde,_0x5d649,_0x19dace){return new Promise(function(_0x1b2875,_0xc1b35b){var _0x1a7c8c={'method':_0x513d('0xb'),'uri':_0x4e0dde+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x5d649+'&'+_0x19dace,'auth':_0x21ba0d,'json':!![]};return rp(_0x1a7c8c)[_0x513d('0xc')](function(_0x441650){if(_0x441650[_0x513d('0xd')]['length']>0x0){_0x162000['adminId']=_0x441650[_0x513d('0xd')][0x0][_0x513d('0xe')];}logger['info']('['+[_0x2f8775[_0x513d('0xf')]()]+_0x513d('0x10'),_0x162000);_0x1b2875(_0x162000);})['catch'](function(_0x8b6a34){logger[_0x513d('0x11')]('['+[_0x2f8775[_0x513d('0xf')]()]+']',_0x8b6a34[_0x513d('0x12')]);_0xc1b35b(_0x8b6a34[_0x513d('0x12')]);});});}function getUser(_0xff54e7,_0x5c9fcf,_0xec7b1,_0x24defe,_0x317687){return function(_0x39e99a){logger[_0x513d('0x13')]('['+[_0xff54e7[_0x513d('0xf')]()]+'],\x20getUser\x20input\x20crm',_0x39e99a);return new Promise(function(_0x282414,_0x5efdbb){if(intUtil[_0x513d('0x14')](_0x39e99a[_0x513d('0x15')])){var _0x44e5c0={'method':'GET','uri':_0xec7b1+_0x513d('0x16')+_0x39e99a[_0x513d('0x15')]+'&'+_0x24defe+'&'+_0x317687,'auth':_0x5c9fcf,'json':!![]};logger[_0x513d('0x13')]('['+[_0xff54e7[_0x513d('0xf')]()]+'],\x20getUser\x20rp\x20obj',_0x44e5c0);return rp(_0x44e5c0)['then'](function(_0x2a3666){logger[_0x513d('0x13')]('['+[_0xff54e7[_0x513d('0xf')]()]+_0x513d('0x17'),_0x2a3666);if(_0x2a3666[_0x513d('0xd')]['length']>0x0&&String(_0x2a3666[_0x513d('0xd')][0x0][_0x513d('0x18')])===_0x513d('0x19')){_0x39e99a['userId']=_0x2a3666[_0x513d('0xd')][0x0][_0x513d('0xe')];}else{_0x39e99a[_0x513d('0x1a')]=_0x39e99a['adminId'];_0x39e99a[_0x513d('0x15')]=_0x39e99a[_0x513d('0x1b')];}logger[_0x513d('0x13')]('['+[_0xff54e7['toUpperCase']()]+_0x513d('0x1c'),_0x39e99a);_0x282414(_0x39e99a);})[_0x513d('0x1d')](function(_0x4eb92d){logger['error']('['+[_0xff54e7[_0x513d('0xf')]()]+']',_0x4eb92d[_0x513d('0x12')]);_0x5efdbb(_0x4eb92d[_0x513d('0x12')]);});}else{logger['info']('['+[_0xff54e7[_0x513d('0xf')]()]+_0x513d('0x1e'));_0x39e99a['userId']=_0x39e99a['adminId'];_0x39e99a[_0x513d('0x15')]=_0x39e99a[_0x513d('0x1b')];_0x282414(_0x39e99a);}});};}function createEndUser(_0x1a24b4,_0x3c5ded,_0x727b0,_0x4d5f86,_0x1d731e){logger[_0x513d('0x13')]('['+[_0x1a24b4[_0x513d('0xf')]()]+_0x513d('0x1f'),_0x727b0);return new Promise(function(_0xfbc36e,_0x394690){var _0xee7f20={'method':'POST','uri':_0x4d5f86+'sys_user?'+_0x1d731e,'body':{'user_name':_0x727b0[_0x513d('0x20')],'roles':_0x513d('0x21'),'first_name':_0x727b0['endUserNumber'],'active':_0x513d('0x19'),'date_format':_0x513d('0x22'),'phone':_0x727b0[_0x513d('0x20')]},'auth':_0x3c5ded,'json':!![]};return rp(_0xee7f20)[_0x513d('0xc')](function(_0x2d2917){logger[_0x513d('0x13')]('['+[_0x1a24b4[_0x513d('0xf')]()]+_0x513d('0x23'),_0x2d2917[_0x513d('0xd')]);_0x727b0[_0x513d('0x24')]=_0x2d2917[_0x513d('0xd')][_0x513d('0xe')];_0xfbc36e(_0x727b0);})[_0x513d('0x1d')](function(_0x38ad9e){logger[_0x513d('0x11')]('['+[_0x1a24b4[_0x513d('0xf')]()]+']',_0x38ad9e['message']);_0x394690(_0x38ad9e[_0x513d('0x12')]);});});}function getEndUser(_0x179b67,_0x2b185a,_0x152e74,_0x340981,_0x34e116){return function(_0x19dfc1){logger['info']('['+[_0x179b67['toUpperCase']()]+_0x513d('0x25'),_0x19dfc1);return new Promise(function(_0xf68952,_0x3538f8){var _0x29f351={'method':_0x513d('0xb'),'uri':_0x152e74+_0x513d('0x26')+_0x19dfc1[_0x513d('0x20')]+'&'+_0x340981+'&'+_0x34e116,'auth':_0x2b185a,'json':!![]};return rp(_0x29f351)['then'](function(_0x4316b7){if(_0x4316b7[_0x513d('0xd')]['length']>0x0){_0x19dfc1[_0x513d('0x24')]=_0x4316b7['result'][0x0]['sys_id'];logger[_0x513d('0x13')]('['+[_0x179b67[_0x513d('0xf')]()]+_0x513d('0x27'),_0x19dfc1);_0xf68952(_0x19dfc1);}else{return createEndUser(_0x179b67,_0x2b185a,_0x19dfc1,_0x152e74,_0x340981)['then'](function(_0x3c1a1){logger['info']('['+[_0x179b67[_0x513d('0xf')]()]+_0x513d('0x28'),_0x3c1a1);_0xf68952(_0x3c1a1);});}})[_0x513d('0x1d')](function(_0x37a19a){logger[_0x513d('0x11')]('['+[_0x179b67['toUpperCase']()]+']',_0x37a19a[_0x513d('0x12')]);_0x3538f8(_0x37a19a[_0x513d('0x12')]);});});};}function getCustomFields(_0x2d0299,_0x1f98bb){var _0x147c3c={};if(_0x2d0299[_0x513d('0x29')]>0x0){_[_0x513d('0x2a')](_0x2d0299,function(_0x75c094){if(_[_0x513d('0x2b')](['string',_0x513d('0x2c')],_0x75c094['type'])&&_0x75c094[_0x513d('0x2d')]&&!_0x75c094[_0x513d('0x2e')]){_0x147c3c[_0x75c094[_0x513d('0x2d')][_0x513d('0x2f')]()]=_0x75c094[_0x513d('0x30')][_0x513d('0x31')]();}else if(_[_0x513d('0x2b')]([_0x513d('0x32'),_0x513d('0x2c')],_0x75c094[_0x513d('0x33')])&&_0x75c094[_0x513d('0x34')]&&_0x75c094[_0x513d('0x2e')]){_0x147c3c[_0x75c094[_0x513d('0x34')][_0x513d('0x2f')]()]=_0x75c094[_0x513d('0x30')][_0x513d('0x31')]();}else if(_0x75c094['type']==='variable'&&_0x75c094[_0x513d('0x35')]&&_0x75c094['idField']&&_0x75c094[_0x513d('0x2e')]){_0x147c3c[_0x75c094['idField'][_0x513d('0x2f')]()]=_0x1f98bb[_0x75c094[_0x513d('0x35')]]['toString']();}else if(_0x75c094[_0x513d('0x33')]===_0x513d('0x36')&&_0x75c094['Variable']&&_0x75c094[_0x513d('0x37')]['name']&&_0x75c094[_0x513d('0x34')]&&_0x75c094[_0x513d('0x2e')]){_0x147c3c[_0x75c094['idField'][_0x513d('0x2f')]()]=_0x1f98bb[_0x75c094['Variable'][_0x513d('0x38')][_0x513d('0x2f')]()][_0x513d('0x31')]();}});}return _0x147c3c;}function getTicket(_0x1cd2f8,_0x464a60,_0x58ca81,_0x2f2e72,_0x738bf0,_0x62be0d){return function(_0x62ac2e){logger[_0x513d('0x13')]('['+[_0x1cd2f8[_0x513d('0xf')]()]+']\x20getTicket\x20input\x20crm',_0x62ac2e);return new Promise(function(_0x5e0723,_0x187c92){var _0x1be12e=_0x1cd2f8[_0x513d('0x2f')]()==='outbound'?_0x62ac2e[_0x513d('0x1a')]:_0x62ac2e['endUserId'];var _0x14a238={'method':'POST','uri':_0x58ca81+_0x513d('0x39')+'?'+_0x62be0d,'body':Object[_0x513d('0x3a')]({},{'active':'true','caller_id':_0x1be12e,'assigned_to':_0x62ac2e[_0x513d('0x1a')],'short_description':intUtil[_0x513d('0x3b')](_0x2f2e72[_0x513d('0x3c')],_0x738bf0,'\x20'),'description':intUtil[_0x513d('0x3b')](_0x2f2e72['Descriptions'],_0x738bf0,'\x0a')},getCustomFields(_0x2f2e72['Fields'],_0x738bf0)),'auth':_0x464a60,'json':!![]};return rp(_0x14a238)[_0x513d('0xc')](function(_0x215abc){logger[_0x513d('0x13')]('['+[_0x1cd2f8['toUpperCase']()]+_0x513d('0x3d'),_0x215abc['result']);_0x62ac2e['ticketId']=_0x215abc[_0x513d('0xd')][_0x513d('0xe')];_0x62ac2e['ticketNumber']=_0x215abc['result'][_0x513d('0x3e')];logger['info']('['+[_0x1cd2f8[_0x513d('0xf')]()]+']\x20getTicket\x20crm',_0x62ac2e);_0x5e0723(_0x62ac2e);})[_0x513d('0x1d')](function(_0x1db176){logger[_0x513d('0x11')]('['+[_0x1cd2f8[_0x513d('0xf')]()]+']',_0x1db176['message']);_0x187c92(_0x1db176[_0x513d('0x12')]);});});};}function createRemoteTag(_0x3e9737,_0x2a1092,_0x8f43bf,_0x3432f2){return new Promise(function(_0xcbdeb6,_0x4a012b){var _0x2fbe57={'method':_0x513d('0x3f'),'uri':_0x8f43bf+_0x513d('0x40')+'?'+_0x3432f2,'body':{'short_description':_0x3e9737,'global':!![],'active':!![],'name':_0x3e9737},'auth':_0x2a1092,'json':!![]};return rp(_0x2fbe57)['then'](function(_0x33e868){var _0x24d1c7=_0x33e868[_0x513d('0xd')][_0x513d('0xe')];_0xcbdeb6(_0x24d1c7);});});}function getRemoteTag(_0x24961c,_0x1b1831,_0x11bc53,_0x358d68,_0x47b374){return new Promise(function(_0x2e7dd8,_0x9680bf){var _0x6e122d={'method':_0x513d('0xb'),'uri':_0x11bc53+_0x513d('0x40')+_0x513d('0x41')+_0x24961c+'&'+_0x358d68,'auth':_0x1b1831,'json':!![]};return rp(_0x6e122d)['then'](function(_0x296fe1){if(_0x296fe1[_0x513d('0xd')][_0x513d('0x29')]>0x0){var _0x794b5f=_0x296fe1[_0x513d('0xd')][0x0][_0x513d('0xe')];_0x2e7dd8(_0x794b5f);}else{return createRemoteTag(_0x24961c,_0x1b1831,_0x11bc53,_0x358d68)[_0x513d('0xc')](function(_0x330dcb){_0x2e7dd8(_0x330dcb);});}});});}function assignTagToIncident(_0x5505da,_0x5d4dff,_0x59c687,_0x49b660,_0x5927f4){return new Promise(function(_0x48d90f,_0x27f8ab){var _0x1ce667={'method':_0x513d('0x3f'),'uri':_0x59c687+_0x513d('0x42')+'?'+_0x5927f4,'body':{'label':_0x5505da,'table':'incident','id_type':'Incident','table_key':_0x49b660[_0x513d('0x43')],'title':_0x513d('0x44')+_0x49b660[_0x513d('0x45')],'id_display':_0x49b660[_0x513d('0x45')]},'auth':_0x5d4dff,'json':!![]};return rp(_0x1ce667)[_0x513d('0xc')](function(_0x51a60b){_0x48d90f();})[_0x513d('0x1d')](function(){_0x48d90f();});});}function manageTags(_0x729ee4,_0x19cf60,_0x265d08,_0x3b7371,_0x847afe,_0x3270f4,_0x23f3c6){return new Promise(function(_0x77cfc6,_0x13c64d){var _0x508329=[];_0x19cf60[_0x513d('0x2a')](function(_0x3cfac9){_0x508329['push'](getRemoteTag(_0x3cfac9,_0x265d08,_0x3b7371,_0x3270f4,_0x23f3c6));});return Promise[_0x513d('0x46')](_0x508329)[_0x513d('0xc')](function(_0x8a0928){if(_0x8a0928['length']){logger[_0x513d('0x13')]('['+[_0x729ee4[_0x513d('0xf')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x8a0928);var _0x28e159=[];_0x8a0928[_0x513d('0x2a')](function(_0x2e1ec1){_0x28e159[_0x513d('0x47')](assignTagToIncident(_0x2e1ec1,_0x265d08,_0x3b7371,_0x847afe,_0x3270f4));});return Promise['all'](_0x28e159)[_0x513d('0xc')](function(){_0x77cfc6();})[_0x513d('0x1d')](function(){_0x77cfc6();});}else{_0x77cfc6();}});});}function getTags(_0x28d8a3,_0x42a288,_0x4b2c4f,_0x5e83f1,_0x18c60d,_0x48bd4d){return function(_0x2f3002){return new Promise(function(_0x2e1c28,_0x3ffd05){var _0x3a826a=[];var _0x3394fd=_0x5e83f1[_0x513d('0x48')];if(_0x3394fd&&_0x3394fd[_0x513d('0x29')]>0x0){_0x3a826a=_[_0x513d('0x49')](_0x3394fd,_0x513d('0x38'));}if(_0x3a826a['length']>0x0){return manageTags(_0x28d8a3,_0x3a826a,_0x42a288,_0x4b2c4f,_0x2f3002,_0x18c60d,_0x48bd4d)['then'](function(){_0x2e1c28(_0x2f3002);});}else{_0x2e1c28(_0x2f3002);}});};}function emit(_0x5bfcee,_0xb9d5ac,_0x6db763){var _0x379a0f=_0x513d('0x4a')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x513d('0x4b')+_0x513d('0x4c');var _0x386547={'uri':_0x5bfcee+_0x513d('0x4d')+_0x6db763+_0x379a0f};io['to'](util[_0x513d('0x4e')]('user:%s',_0xb9d5ac))['emit'](_0x513d('0x4f'),_0x386547);}exports['cs']=function(_0x301f0c,_0xd5eaba,_0x1927d1,_0x38c219,_0x8bc379,_0x270e43,_0x35380a,_0x5ce44e){var _0xc46ac7={};var _0x22386b={'user':_0x270e43['username'],'pass':_0x270e43[_0x513d('0x50')]};var _0x32dc67=_0x513d('0x51');var _0xd2d934='sysparm_display_value=true';_0x270e43[_0x513d('0x52')]=intUtil[_0x513d('0x53')](_0x270e43['remoteUri']);_0x270e43['serverUrl']=intUtil[_0x513d('0x53')](_0x270e43[_0x513d('0x54')]);var _0x24e007=util[_0x513d('0x4e')]('%s/api/now/table/',_0x270e43['remoteUri']);_0xc46ac7[_0x513d('0x15')]=!_[_0x513d('0x55')](_0x38c219)?_0x38c219[_0x513d('0x56')]:null;_0xc46ac7[_0x513d('0x1b')]=_0x270e43[_0x513d('0x56')];_0xc46ac7['endUserNumber']=_0x5ce44e[_0x513d('0x2f')]()===_0x513d('0x57')?_0xd5eaba[_0x513d('0x58')]:_0xd5eaba[_0x513d('0x59')];_0xc46ac7['callDirection']=_0x5ce44e==='queue'||_0x5ce44e===_0x513d('0x5a')?'queue':_0x513d('0x57');var _0x50a3a8=util['format'](_0x513d('0x5b'),_0x270e43[_0x513d('0x54')],_0xd5eaba[_0x513d('0x5c')],md5(_0xd5eaba[_0x513d('0x5c')]));if(_0x8bc379&&_0x8bc379[_0x513d('0x5d')]){logger['info']('[QUEUE]',_0x513d('0x5e'));_0xd5eaba[_0x513d('0x5f')]=_0x50a3a8;}else if(_0x35380a&&_0x35380a[_0x513d('0x60')]&&_0x35380a[_0x513d('0x60')]!==_0x513d('0x61')){logger['info'](_0x513d('0x62'),_0x513d('0x5e'));_0xd5eaba[_0x513d('0x5f')]=_0x50a3a8;}else{_0xd5eaba['recordingURL']='';}return getAdminUser(_0x5ce44e,_0x22386b,_0xc46ac7,_0x24e007,_0xd2d934,_0x32dc67)[_0x513d('0xc')](getUser(_0x5ce44e,_0x22386b,_0x24e007,_0xd2d934,_0x32dc67))[_0x513d('0xc')](getEndUser(_0x5ce44e,_0x22386b,_0x24e007,_0xd2d934,_0x32dc67))[_0x513d('0xc')](getTicket(_0x5ce44e,_0x22386b,_0x24e007,_0x1927d1,_0xd5eaba,_0xd2d934))[_0x513d('0xc')](function(_0x433551){logger[_0x513d('0x13')](util[_0x513d('0x4e')](_0x513d('0x63'),_0x433551[_0x513d('0x43')]));logger[_0x513d('0x13')](util['format'](_0x513d('0x64'),_0x5ce44e));if(_0x5ce44e!=='unmanaged'){logger['info']('['+[_0x5ce44e[_0x513d('0xf')]()]+']',_0x513d('0x65'));emit(_0x270e43[_0x513d('0x52')],_0x38c219['name'],_0x433551[_0x513d('0x43')]);}})[_0x513d('0x1d')](function(_0x3b1011){logger[_0x513d('0x11')]('['+[_0x5ce44e[_0x513d('0xf')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x513d('0x66')](_0x3b1011,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6e1e=['call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','toUpperCase','catch','message','info','],\x20getUser\x20input\x20crm','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','userId','adminId','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','adminEmail','POST','sys_user?','user','endUserNumber','System','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','customField','nameField','toLowerCase','toString','includes','idField','customVariable','Variable','name','outbound','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s'];(function(_0xf85fb3,_0x280fe6){var _0x4a9d43=function(_0x1d17d4){while(--_0x1d17d4){_0xf85fb3['push'](_0xf85fb3['shift']());}};_0x4a9d43(++_0x280fe6);}(_0x6e1e,0x142));var _0xe6e1=function(_0x488608,_0x597220){_0x488608=_0x488608-0x0;var _0xba3d8=_0x6e1e[_0x488608];return _0xba3d8;};'use strict';var _=require(_0xe6e1('0x0'));var Promise=require(_0xe6e1('0x1'));var rp=require(_0xe6e1('0x2'));var util=require(_0xe6e1('0x3'));var md5=require(_0xe6e1('0x4'));var Redis=require(_0xe6e1('0x5'));var intUtil=require(_0xe6e1('0x6'));var config=require(_0xe6e1('0x7'));var logger=require('../../../../config/logger')('servicenow');config['redis']=_[_0xe6e1('0x8')](config[_0xe6e1('0x9')],{'host':_0xe6e1('0xa'),'port':0x18eb});var io=require(_0xe6e1('0xb'))(new Redis(config[_0xe6e1('0x9')]));function getAdminUser(_0x1edc48,_0x3084b3,_0x1b1e54,_0xc1d10b,_0x2eedbb,_0x1269de){return new Promise(function(_0x1319ae,_0x100a35){var _0x107f98={'method':_0xe6e1('0xc'),'uri':_0xc1d10b+_0xe6e1('0xd')+'&'+_0x2eedbb+'&'+_0x1269de,'auth':_0x3084b3,'json':!![]};return rp(_0x107f98)[_0xe6e1('0xe')](function(_0x3b62c4){if(_0x3b62c4[_0xe6e1('0xf')]['length']>0x0){_0x1b1e54['adminId']=_0x3b62c4['result'][0x0][_0xe6e1('0x10')];}logger['info']('['+[_0x1edc48[_0xe6e1('0x11')]()]+'],\x20getAdminUser\x20crm',_0x1b1e54);_0x1319ae(_0x1b1e54);})[_0xe6e1('0x12')](function(_0x3d338d){logger['error']('['+[_0x1edc48['toUpperCase']()]+']',_0x3d338d['message']);_0x100a35(_0x3d338d[_0xe6e1('0x13')]);});});}function getUser(_0x862804,_0x41c528,_0xa8e36,_0x3fac60,_0x2ede78){return function(_0xbee614){logger[_0xe6e1('0x14')]('['+[_0x862804['toUpperCase']()]+_0xe6e1('0x15'),_0xbee614);return new Promise(function(_0xc4b871,_0x443745){if(intUtil['validateEmail'](_0xbee614['userEmail'])){var _0x5761f7={'method':_0xe6e1('0xc'),'uri':_0xa8e36+'sys_user?sysparm_query=email%3D'+_0xbee614[_0xe6e1('0x16')]+'&'+_0x3fac60+'&'+_0x2ede78,'auth':_0x41c528,'json':!![]};logger[_0xe6e1('0x14')]('['+[_0x862804[_0xe6e1('0x11')]()]+_0xe6e1('0x17'),_0x5761f7);return rp(_0x5761f7)[_0xe6e1('0xe')](function(_0x455e22){logger[_0xe6e1('0x14')]('['+[_0x862804[_0xe6e1('0x11')]()]+_0xe6e1('0x18'),_0x455e22);if(_0x455e22['result'][_0xe6e1('0x19')]>0x0&&String(_0x455e22[_0xe6e1('0xf')][0x0][_0xe6e1('0x1a')])===_0xe6e1('0x1b')){_0xbee614['userId']=_0x455e22[_0xe6e1('0xf')][0x0]['sys_id'];}else{_0xbee614[_0xe6e1('0x1c')]=_0xbee614[_0xe6e1('0x1d')];_0xbee614[_0xe6e1('0x16')]=_0xbee614['adminEmail'];}logger['info']('['+[_0x862804[_0xe6e1('0x11')]()]+_0xe6e1('0x1e'),_0xbee614);_0xc4b871(_0xbee614);})[_0xe6e1('0x12')](function(_0x2825e1){logger[_0xe6e1('0x1f')]('['+[_0x862804[_0xe6e1('0x11')]()]+']',_0x2825e1['message']);_0x443745(_0x2825e1[_0xe6e1('0x13')]);});}else{logger[_0xe6e1('0x14')]('['+[_0x862804[_0xe6e1('0x11')]()]+_0xe6e1('0x20'));_0xbee614[_0xe6e1('0x1c')]=_0xbee614[_0xe6e1('0x1d')];_0xbee614[_0xe6e1('0x16')]=_0xbee614[_0xe6e1('0x21')];_0xc4b871(_0xbee614);}});};}function createEndUser(_0x3447b2,_0x5acd73,_0x1ca7ee,_0x5cf557,_0x3901ac){logger[_0xe6e1('0x14')]('['+[_0x3447b2[_0xe6e1('0x11')]()]+'],\x20createEndUser\x20input\x20crm',_0x1ca7ee);return new Promise(function(_0x10a573,_0x421099){var _0x503d30={'method':_0xe6e1('0x22'),'uri':_0x5cf557+_0xe6e1('0x23')+_0x3901ac,'body':{'user_name':_0x1ca7ee['endUserNumber'],'roles':_0xe6e1('0x24'),'first_name':_0x1ca7ee[_0xe6e1('0x25')],'active':_0xe6e1('0x1b'),'date_format':_0xe6e1('0x26'),'phone':_0x1ca7ee[_0xe6e1('0x25')]},'auth':_0x5acd73,'json':!![]};return rp(_0x503d30)[_0xe6e1('0xe')](function(_0x3359e4){logger['info']('['+[_0x3447b2[_0xe6e1('0x11')]()]+'],\x20EndUser\x20schema',_0x3359e4[_0xe6e1('0xf')]);_0x1ca7ee[_0xe6e1('0x27')]=_0x3359e4[_0xe6e1('0xf')][_0xe6e1('0x10')];_0x10a573(_0x1ca7ee);})[_0xe6e1('0x12')](function(_0x4099ec){logger[_0xe6e1('0x1f')]('['+[_0x3447b2[_0xe6e1('0x11')]()]+']',_0x4099ec['message']);_0x421099(_0x4099ec[_0xe6e1('0x13')]);});});}function getEndUser(_0x19a6e8,_0x42517b,_0x4a5484,_0x45c90d,_0x1c7143){return function(_0x412c56){logger[_0xe6e1('0x14')]('['+[_0x19a6e8[_0xe6e1('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x412c56);return new Promise(function(_0x169e28,_0x2d1777){var _0xfb869b={'method':_0xe6e1('0xc'),'uri':_0x4a5484+_0xe6e1('0x28')+_0x412c56[_0xe6e1('0x25')]+'&'+_0x45c90d+'&'+_0x1c7143,'auth':_0x42517b,'json':!![]};return rp(_0xfb869b)[_0xe6e1('0xe')](function(_0x26115b){if(_0x26115b['result'][_0xe6e1('0x19')]>0x0){_0x412c56[_0xe6e1('0x27')]=_0x26115b[_0xe6e1('0xf')][0x0][_0xe6e1('0x10')];logger[_0xe6e1('0x14')]('['+[_0x19a6e8[_0xe6e1('0x11')]()]+_0xe6e1('0x29'),_0x412c56);_0x169e28(_0x412c56);}else{return createEndUser(_0x19a6e8,_0x42517b,_0x412c56,_0x4a5484,_0x45c90d)[_0xe6e1('0xe')](function(_0x57f636){logger[_0xe6e1('0x14')]('['+[_0x19a6e8[_0xe6e1('0x11')]()]+_0xe6e1('0x2a'),_0x57f636);_0x169e28(_0x57f636);});}})[_0xe6e1('0x12')](function(_0x3ff136){logger['error']('['+[_0x19a6e8[_0xe6e1('0x11')]()]+']',_0x3ff136[_0xe6e1('0x13')]);_0x2d1777(_0x3ff136[_0xe6e1('0x13')]);});});};}function getCustomFields(_0x51419b,_0x2765b2){var _0x1e7449={};if(_0x51419b['length']>0x0){_[_0xe6e1('0x2b')](_0x51419b,function(_0x5f2950){if(_['includes']([_0xe6e1('0x2c'),_0xe6e1('0x2d')],_0x5f2950[_0xe6e1('0x2e')])&&_0x5f2950['nameField']&&!_0x5f2950[_0xe6e1('0x2f')]){_0x1e7449[_0x5f2950[_0xe6e1('0x30')][_0xe6e1('0x31')]()]=_0x5f2950['content'][_0xe6e1('0x32')]();}else if(_[_0xe6e1('0x33')]([_0xe6e1('0x2c'),'picklist'],_0x5f2950[_0xe6e1('0x2e')])&&_0x5f2950[_0xe6e1('0x34')]&&_0x5f2950[_0xe6e1('0x2f')]){_0x1e7449[_0x5f2950[_0xe6e1('0x34')][_0xe6e1('0x31')]()]=_0x5f2950['content'][_0xe6e1('0x32')]();}else if(_0x5f2950[_0xe6e1('0x2e')]==='variable'&&_0x5f2950['variableName']&&_0x5f2950[_0xe6e1('0x34')]&&_0x5f2950[_0xe6e1('0x2f')]){_0x1e7449[_0x5f2950[_0xe6e1('0x34')]['toLowerCase']()]=_0x2765b2[_0x5f2950['variableName']]['toString']();}else if(_0x5f2950[_0xe6e1('0x2e')]===_0xe6e1('0x35')&&_0x5f2950[_0xe6e1('0x36')]&&_0x5f2950[_0xe6e1('0x36')]['name']&&_0x5f2950[_0xe6e1('0x34')]&&_0x5f2950[_0xe6e1('0x2f')]){_0x1e7449[_0x5f2950[_0xe6e1('0x34')][_0xe6e1('0x31')]()]=_0x2765b2[_0x5f2950[_0xe6e1('0x36')][_0xe6e1('0x37')][_0xe6e1('0x31')]()][_0xe6e1('0x32')]();}});}return _0x1e7449;}function getTicket(_0x2783cc,_0x2e99cc,_0x4f87c2,_0x3c1b6f,_0x1782d5,_0x272b80){return function(_0x21c3f0){logger[_0xe6e1('0x14')]('['+[_0x2783cc[_0xe6e1('0x11')]()]+']\x20getTicket\x20input\x20crm',_0x21c3f0);return new Promise(function(_0x2dfa69,_0x2c4640){var _0x44fb5a=_0x2783cc[_0xe6e1('0x31')]()===_0xe6e1('0x38')?_0x21c3f0[_0xe6e1('0x1c')]:_0x21c3f0[_0xe6e1('0x27')];var _0xd72181={'method':_0xe6e1('0x22'),'uri':_0x4f87c2+'incident'+'?'+_0x272b80,'body':Object[_0xe6e1('0x39')]({},{'active':_0xe6e1('0x1b'),'caller_id':_0x44fb5a,'assigned_to':_0x21c3f0[_0xe6e1('0x1c')],'short_description':intUtil[_0xe6e1('0x3a')](_0x3c1b6f[_0xe6e1('0x3b')],_0x1782d5,'\x20'),'description':intUtil[_0xe6e1('0x3a')](_0x3c1b6f[_0xe6e1('0x3c')],_0x1782d5,'\x0a')},getCustomFields(_0x3c1b6f[_0xe6e1('0x3d')],_0x1782d5)),'auth':_0x2e99cc,'json':!![]};return rp(_0xd72181)[_0xe6e1('0xe')](function(_0x4390a2){logger['info']('['+[_0x2783cc[_0xe6e1('0x11')]()]+_0xe6e1('0x3e'),_0x4390a2['result']);_0x21c3f0[_0xe6e1('0x3f')]=_0x4390a2['result'][_0xe6e1('0x10')];_0x21c3f0[_0xe6e1('0x40')]=_0x4390a2[_0xe6e1('0xf')]['number'];logger[_0xe6e1('0x14')]('['+[_0x2783cc[_0xe6e1('0x11')]()]+_0xe6e1('0x41'),_0x21c3f0);_0x2dfa69(_0x21c3f0);})['catch'](function(_0x5946d6){logger['error']('['+[_0x2783cc[_0xe6e1('0x11')]()]+']',_0x5946d6[_0xe6e1('0x13')]);_0x2c4640(_0x5946d6[_0xe6e1('0x13')]);});});};}function createRemoteTag(_0x154a5c,_0xde8ed4,_0x59cdeb,_0x5ab30d){return new Promise(function(_0x19d041,_0x59b5de){var _0x23005b={'method':'POST','uri':_0x59cdeb+_0xe6e1('0x42')+'?'+_0x5ab30d,'body':{'short_description':_0x154a5c,'global':!![],'active':!![],'name':_0x154a5c},'auth':_0xde8ed4,'json':!![]};return rp(_0x23005b)[_0xe6e1('0xe')](function(_0xc53891){var _0x48cfd0=_0xc53891[_0xe6e1('0xf')][_0xe6e1('0x10')];_0x19d041(_0x48cfd0);});});}function getRemoteTag(_0x10dcc3,_0x2cfce8,_0x11b792,_0x1df4dd,_0x29e62a){return new Promise(function(_0x4a43de,_0x377a51){var _0x4607dc={'method':'GET','uri':_0x11b792+_0xe6e1('0x42')+_0xe6e1('0x43')+_0x10dcc3+'&'+_0x1df4dd,'auth':_0x2cfce8,'json':!![]};return rp(_0x4607dc)[_0xe6e1('0xe')](function(_0x3860c7){if(_0x3860c7[_0xe6e1('0xf')][_0xe6e1('0x19')]>0x0){var _0x21a030=_0x3860c7[_0xe6e1('0xf')][0x0][_0xe6e1('0x10')];_0x4a43de(_0x21a030);}else{return createRemoteTag(_0x10dcc3,_0x2cfce8,_0x11b792,_0x1df4dd)[_0xe6e1('0xe')](function(_0x1c60fa){_0x4a43de(_0x1c60fa);});}});});}function assignTagToIncident(_0xe17e4b,_0x44c38b,_0x369ffb,_0xa7f80e,_0x25cedc){return new Promise(function(_0x17b5ee,_0x1de59b){var _0x9b3346={'method':_0xe6e1('0x22'),'uri':_0x369ffb+_0xe6e1('0x44')+'?'+_0x25cedc,'body':{'label':_0xe17e4b,'table':_0xe6e1('0x45'),'id_type':_0xe6e1('0x46'),'table_key':_0xa7f80e['ticketId'],'title':_0xe6e1('0x47')+_0xa7f80e[_0xe6e1('0x40')],'id_display':_0xa7f80e['ticketNumber']},'auth':_0x44c38b,'json':!![]};return rp(_0x9b3346)['then'](function(_0x2e4165){_0x17b5ee();})[_0xe6e1('0x12')](function(){_0x17b5ee();});});}function manageTags(_0x41f7d0,_0x13264c,_0x216dc3,_0x2ef2e8,_0x3729ca,_0x1ece67,_0x21583a){return new Promise(function(_0x1f3dd8,_0x101884){var _0x3acd3d=[];_0x13264c[_0xe6e1('0x2b')](function(_0x35303a){_0x3acd3d[_0xe6e1('0x48')](getRemoteTag(_0x35303a,_0x216dc3,_0x2ef2e8,_0x1ece67,_0x21583a));});return Promise[_0xe6e1('0x49')](_0x3acd3d)[_0xe6e1('0xe')](function(_0x35e2ea){if(_0x35e2ea[_0xe6e1('0x19')]){logger['info']('['+[_0x41f7d0[_0xe6e1('0x11')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x35e2ea);var _0x4a0807=[];_0x35e2ea['forEach'](function(_0x540364){_0x4a0807[_0xe6e1('0x48')](assignTagToIncident(_0x540364,_0x216dc3,_0x2ef2e8,_0x3729ca,_0x1ece67));});return Promise[_0xe6e1('0x49')](_0x4a0807)['then'](function(){_0x1f3dd8();})[_0xe6e1('0x12')](function(){_0x1f3dd8();});}else{_0x1f3dd8();}});});}function getTags(_0x3faff2,_0x16ff9c,_0x2f3c64,_0x22f153,_0x15d157,_0x36fa8b){return function(_0x571f8f){return new Promise(function(_0x213c94,_0x4860d0){var _0x5d7692=[];var _0x17a133=_0x22f153[_0xe6e1('0x4a')];if(_0x17a133&&_0x17a133[_0xe6e1('0x19')]>0x0){_0x5d7692=_[_0xe6e1('0x4b')](_0x17a133,'name');}if(_0x5d7692['length']>0x0){return manageTags(_0x3faff2,_0x5d7692,_0x16ff9c,_0x2f3c64,_0x571f8f,_0x15d157,_0x36fa8b)[_0xe6e1('0xe')](function(){_0x213c94(_0x571f8f);});}else{_0x213c94(_0x571f8f);}});};}function emit(_0x43ecfb,_0x4dbc64,_0x182230){var _0x5ec29f='%26sysparm_record_target%3Dincident'+_0xe6e1('0x4c')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x24c84a={'uri':_0x43ecfb+_0xe6e1('0x4d')+_0x182230+_0x5ec29f};io['to'](util[_0xe6e1('0x4e')]('user:%s',_0x4dbc64))[_0xe6e1('0x4f')]('trigger:browser:url',_0x24c84a);}exports['cs']=function(_0x20b982,_0x3504af,_0x404971,_0xeaea72,_0x2f53b6,_0x174c68,_0x5b2a83,_0x392ac2){var _0x422c93={};var _0x3d9e06={'user':_0x174c68[_0xe6e1('0x50')],'pass':_0x174c68['password']};var _0x568d61=_0xe6e1('0x51');var _0xf160de=_0xe6e1('0x52');_0x174c68[_0xe6e1('0x53')]=intUtil[_0xe6e1('0x54')](_0x174c68[_0xe6e1('0x53')]);_0x174c68[_0xe6e1('0x55')]=intUtil[_0xe6e1('0x54')](_0x174c68[_0xe6e1('0x55')]);var _0x48d03a=util[_0xe6e1('0x4e')]('%s/api/now/table/',_0x174c68[_0xe6e1('0x53')]);_0x422c93[_0xe6e1('0x16')]=!_[_0xe6e1('0x56')](_0xeaea72)?_0xeaea72[_0xe6e1('0x57')]:null;_0x422c93['adminEmail']=_0x174c68['email'];_0x422c93[_0xe6e1('0x25')]=_0x392ac2[_0xe6e1('0x31')]()===_0xe6e1('0x38')?_0x3504af['destcalleridnum']:_0x3504af[_0xe6e1('0x58')];_0x422c93[_0xe6e1('0x59')]=_0x392ac2===_0xe6e1('0x5a')||_0x392ac2===_0xe6e1('0x5b')?_0xe6e1('0x5a'):_0xe6e1('0x38');var _0x3c6fe4=util[_0xe6e1('0x4e')](_0xe6e1('0x5c'),_0x174c68[_0xe6e1('0x55')],_0x3504af[_0xe6e1('0x5d')],md5(_0x3504af['uniqueid']));if(_0x2f53b6&&_0x2f53b6[_0xe6e1('0x5e')]){logger[_0xe6e1('0x14')](_0xe6e1('0x5f'),_0xe6e1('0x60'));_0x3504af['recordingURL']=_0x3c6fe4;}else if(_0x5b2a83&&_0x5b2a83[_0xe6e1('0x61')]&&_0x5b2a83[_0xe6e1('0x61')]!==_0xe6e1('0x62')){logger[_0xe6e1('0x14')](_0xe6e1('0x63'),_0xe6e1('0x60'));_0x3504af[_0xe6e1('0x64')]=_0x3c6fe4;}else{_0x3504af[_0xe6e1('0x64')]='';}return getAdminUser(_0x392ac2,_0x3d9e06,_0x422c93,_0x48d03a,_0xf160de,_0x568d61)[_0xe6e1('0xe')](getUser(_0x392ac2,_0x3d9e06,_0x48d03a,_0xf160de,_0x568d61))[_0xe6e1('0xe')](getEndUser(_0x392ac2,_0x3d9e06,_0x48d03a,_0xf160de,_0x568d61))[_0xe6e1('0xe')](getTicket(_0x392ac2,_0x3d9e06,_0x48d03a,_0x404971,_0x3504af,_0xf160de))[_0xe6e1('0xe')](function(_0x134949){logger[_0xe6e1('0x14')](util[_0xe6e1('0x4e')](_0xe6e1('0x65'),_0x134949[_0xe6e1('0x3f')]));logger[_0xe6e1('0x14')](util[_0xe6e1('0x4e')](_0xe6e1('0x66'),_0x392ac2));if(_0x392ac2!==_0xe6e1('0x5b')){logger['info']('['+[_0x392ac2[_0xe6e1('0x11')]()]+']',_0xe6e1('0x67'));emit(_0x174c68[_0xe6e1('0x53')],_0xeaea72[_0xe6e1('0x37')],_0x134949['ticketId']);}})[_0xe6e1('0x12')](function(_0xd64ebc){logger[_0xe6e1('0x1f')]('['+[_0x392ac2[_0xe6e1('0x11')]()]+_0xe6e1('0x68'),util[_0xe6e1('0x69')](_0xd64ebc,{'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 6e9e97f..323465c 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 _0x9ef3=['users','[OUTBOUND]','trigger:browser:url','unmanaged','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_name','direction','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','length','find','name_value_list','Agent\x20found!','resolve','value','user_id','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','Enduser\x20found!','first_name','','Caller\x20-\x20%s','[HTTP]','merge','map','type','string','nameField','customField','content','variable','custom_fields','customVariable','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','uri','recordingFormat','none','destcalleridname','destcalleridnum','Outbound'];(function(_0x305486,_0x24acd4){var _0xa04940=function(_0x29e866){while(--_0x29e866){_0x305486['push'](_0x305486['shift']());}};_0xa04940(++_0x24acd4);}(_0x9ef3,0x1e7));var _0x39ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ef3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x39ef('0x0'));var util=require(_0x39ef('0x1'));var Redis=require(_0x39ef('0x2'));var intUtil=require(_0x39ef('0x3'));var config=require(_0x39ef('0x4'));var logger=require('../../../../config/logger')(_0x39ef('0x5'));config[_0x39ef('0x6')]=_[_0x39ef('0x7')](config[_0x39ef('0x6')],{'host':_0x39ef('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':_0x39ef('0x9'),'json':!![]};function emit(_0x27303c,_0xa1cb74,_0x258715){io['to'](_0x27303c)['emit'](_0xa1cb74,_0x258715);}function getTicket(_0x2aec9d,_0x19aa45,_0x5b659d,_0x56a3cf,_0x44f677,_0x47da0d,_0x413e72,_0x14f70f){logger[_0x39ef('0xa')](_0x39ef('0xb'));var _0x39ce38=new Date();var _0x4fa11c=[{'name':_0x39ef('0xc'),'value':intUtil[_0x39ef('0xd')](_0x56a3cf[_0x39ef('0xe')],_0x44f677,'\x20')},{'name':'assigned_user_id','value':_0x19aa45['id']},{'name':_0x39ef('0xf'),'value':_0x19aa45['id']},{'name':_0x39ef('0x10'),'value':intUtil[_0x39ef('0xd')](_0x56a3cf[_0x39ef('0x11')],_0x44f677,'\x0a')},{'name':'date_start','value':_0x39ce38[_0x39ef('0x12')]()[_0x39ef('0x13')](0x0,0x13)['replace']('T','\x20')},{'name':_0x39ef('0x14'),'value':'0'},{'name':_0x39ef('0x15'),'value':'15'},{'name':_0x39ef('0x16'),'value':_0x5b659d['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x39ef('0x17'),'value':_0x5b659d['name']},{'name':_0x39ef('0x18'),'value':_0x14f70f}];if(_0x47da0d['length']){_[_0x39ef('0x19')](_0x47da0d,function(_0x1de24e){if(_0x44f677[_0x1de24e[_0x39ef('0x1a')]]){_0x4fa11c[_0x39ef('0x1b')]({'name':_0x1de24e[_0x39ef('0x1c')],'value':_0x44f677[_0x1de24e[_0x39ef('0x1a')]]});}});}return request({'form':{'method':_0x39ef('0x1d'),'input_type':_0x39ef('0x1e'),'response_type':_0x39ef('0x1e'),'rest_data':JSON[_0x39ef('0x1f')]({'session':_0x413e72['id'],'module_name':_0x39ef('0x20'),'name_value_list':_0x4fa11c})}});}function getAuth(_0x6d7a58){return util[_0x39ef('0x21')](_0x39ef('0x22'),new Buffer(_0x6d7a58[_0x39ef('0x23')]+':X')[_0x39ef('0x24')](_0x39ef('0x25')));}function getServerInfo(_0xce1c06){return request({'form':{'method':_0x39ef('0x26'),'input_type':_0x39ef('0x1e'),'response_type':_0x39ef('0x1e'),'rest_data':JSON[_0x39ef('0x1f')]({'session':_0xce1c06['id']})}});}function getUser(_0x4416e1,_0x50f4c6,_0x2a8c17){if(!_[_0x39ef('0x27')](_0x50f4c6)){logger[_0x39ef('0xa')](_0x39ef('0x28'),_0x50f4c6);return request({'form':{'method':_0x39ef('0x29'),'input_type':_0x39ef('0x1e'),'response_type':_0x39ef('0x1e'),'rest_data':JSON[_0x39ef('0x1f')]({'session':_0x2a8c17['id'],'module_name':_0x39ef('0x2a'),'query':util[_0x39ef('0x21')](_0x39ef('0x2b'),_0x50f4c6),'order_by':'','offset':'0','select_fields':['id',_0x39ef('0xc'),_0x39ef('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x39ef('0x2d')](function(_0x3f34ad){if(_0x3f34ad[_0x39ef('0x2e')][_0x39ef('0x2f')]){var _0x107aaf=_[_0x39ef('0x30')](_0x3f34ad[_0x39ef('0x2e')],function(_0xfc309f){return _0xfc309f[_0x39ef('0x31')][_0x39ef('0x2c')]['value']===_0x50f4c6;});if(_0x107aaf){logger[_0x39ef('0xa')](_0x39ef('0x32'));return BPromise[_0x39ef('0x33')]({'id':_0x107aaf[_0x39ef('0x31')]['id'][_0x39ef('0x34')],'name':_0x107aaf[_0x39ef('0x31')]['name'][_0x39ef('0x34')]});}}logger[_0x39ef('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x39ef('0x33')]({'id':_0x2a8c17[_0x39ef('0x31')][_0x39ef('0x35')][_0x39ef('0x34')],'name':_0x2a8c17[_0x39ef('0x31')][_0x39ef('0x2c')][_0x39ef('0x34')]});});}else{logger[_0x39ef('0xa')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x39ef('0x33')]({'id':_0x2a8c17['name_value_list'][_0x39ef('0x35')][_0x39ef('0x34')],'name':_0x2a8c17[_0x39ef('0x31')][_0x39ef('0x2c')][_0x39ef('0x34')]});}}function getEndUser(_0x21e55c,_0x165fc8,_0x24837f,_0x27a25d){logger['info'](_0x39ef('0x36'),_0x24837f);return request({'form':{'method':_0x39ef('0x29'),'input_type':_0x39ef('0x1e'),'response_type':'JSON','rest_data':JSON[_0x39ef('0x1f')]({'session':_0x27a25d['id'],'module_name':_0x39ef('0x37'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x24837f),'order_by':'','offset':'0','select_fields':['id',_0x39ef('0xc'),_0x39ef('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x39ef('0x2d')](function(_0x22ce50){if(_0x22ce50[_0x39ef('0x2e')][_0x39ef('0x2f')]){var _0x2d9b08=_[_0x39ef('0x30')](_0x22ce50[_0x39ef('0x2e')],function(_0x35fc27){return _0x35fc27[_0x39ef('0x31')][_0x39ef('0x38')]['value']===_0x24837f;});if(_0x2d9b08){logger[_0x39ef('0xa')](_0x39ef('0x39'));return BPromise[_0x39ef('0x33')]({'id':_0x2d9b08[_0x39ef('0x31')]['id'][_0x39ef('0x34')],'name':_0x2d9b08['name_value_list'][_0x39ef('0xc')][_0x39ef('0x34')],'phone':_0x2d9b08[_0x39ef('0x31')][_0x39ef('0x38')][_0x39ef('0x34')]});}}else{logger[_0x39ef('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x39ef('0x1d'),'input_type':_0x39ef('0x1e'),'response_type':_0x39ef('0x1e'),'rest_data':JSON['stringify']({'session':_0x27a25d['id'],'module_name':'Contacts','name_value_list':[{'name':_0x39ef('0x3a'),'value':_0x165fc8!==_0x39ef('0x3b')?_0x165fc8:util[_0x39ef('0x21')](_0x39ef('0x3c'),_0x24837f)},{'name':_0x39ef('0x38'),'value':_0x24837f}]})}})[_0x39ef('0x2d')](function(_0x425309){logger[_0x39ef('0xa')]('Enduser\x20created.');return BPromise['resolve']({'id':_0x425309['id'],'name':_0x425309[_0x39ef('0x2e')]['first_name'][_0x39ef('0x34')],'phone':_0x425309[_0x39ef('0x2e')][_0x39ef('0x38')]['value']});});}});}function request(_0x57888b){logger['debug'](_0x39ef('0x3d'),JSON[_0x39ef('0x1f')](_0x57888b));return rp(_[_0x39ef('0x3e')](def,_0x57888b));}function getTags(_0x2189c1,_0x1a0d46){var _0x2a33e7=[];if(_0x2189c1&&_0x2189c1[_0x39ef('0x2f')]>0x0){_0x2a33e7=_[_0x39ef('0x3f')](_0x2189c1,_0x1a0d46);}return _0x2a33e7;}function getCustomFields(_0x2c8e93,_0x1c829f){var _0x152cd2=[];var _0x354e32={'custom_fields':[]};if(_0x2c8e93[_0x39ef('0x2f')]>0x0){_[_0x39ef('0x19')](_0x2c8e93,function(_0x583f5b){if(_0x583f5b[_0x39ef('0x40')]===_0x39ef('0x41')&&_0x583f5b[_0x39ef('0x42')]&&!_0x583f5b[_0x39ef('0x43')]){_0x354e32[_0x583f5b[_0x39ef('0x42')]['toLowerCase']()]=_0x583f5b[_0x39ef('0x44')][_0x39ef('0x24')]();}else if(_0x583f5b[_0x39ef('0x40')]===_0x39ef('0x41')&&_0x583f5b[_0x39ef('0x1c')]&&_0x583f5b[_0x39ef('0x43')]){_0x354e32['custom_fields'][_0x39ef('0x1b')]({'id':_0x583f5b[_0x39ef('0x1c')],'value':_0x583f5b[_0x39ef('0x44')][_0x39ef('0x24')]()});}else if(_0x583f5b[_0x39ef('0x40')]===_0x39ef('0x45')&&_0x583f5b[_0x39ef('0x1a')]&&_0x583f5b[_0x39ef('0x1c')]&&_0x583f5b[_0x39ef('0x43')]){_0x1c829f[_0x583f5b['variableName']]&&_0x354e32[_0x39ef('0x46')]['push']({'id':_0x583f5b[_0x39ef('0x1c')],'value':_0x1c829f[_0x583f5b[_0x39ef('0x1a')]][_0x39ef('0x24')]()});}else if(_0x583f5b['type']===_0x39ef('0x47')&&_0x583f5b[_0x39ef('0x48')]&&_0x583f5b['Variable'][_0x39ef('0xc')]&&_0x583f5b[_0x39ef('0x1c')]&&_0x583f5b[_0x39ef('0x43')]){_0x1c829f[_0x583f5b[_0x39ef('0x48')][_0x39ef('0xc')][_0x39ef('0x49')]()]&&_0x354e32['custom_fields'][_0x39ef('0x1b')]({'id':_0x583f5b[_0x39ef('0x1c')],'value':_0x1c829f[_0x583f5b[_0x39ef('0x48')]['name'][_0x39ef('0x49')]()][_0x39ef('0x24')]()});}});}return _0x354e32;}function getConnection(_0x20b20a){return request({'method':_0x39ef('0x9'),'form':{'method':_0x39ef('0x4a'),'input_type':_0x39ef('0x1e'),'response_type':'JSON','rest_data':JSON[_0x39ef('0x1f')]({'user_auth':{'user_name':_0x20b20a[_0x39ef('0x4b')],'password':_0x20b20a[_0x39ef('0x4c')],'encryption':_0x39ef('0x4d')},'application':_0x39ef('0x4e')})}})[_0x39ef('0x2d')](function(_0x593f84){var _0x475cc3=_0x593f84;if(_0x475cc3['id']){def[_0x39ef('0x4f')]=_0x475cc3['id'];return BPromise[_0x39ef('0x33')](_0x475cc3);}else{throw new Error(util[_0x39ef('0x21')]('Account\x20%d\x20is\x20not\x20valid',_0x20b20a['id']));}});}function setRelationship(_0x271d3a,_0x200ce7,_0x46f8dc,_0x49c95e){return request({'form':{'method':_0x39ef('0x50'),'input_type':'JSON','response_type':_0x39ef('0x1e'),'rest_data':JSON[_0x39ef('0x1f')]({'session':_0x271d3a['id'],'module_name':_0x39ef('0x20'),'module_id':_0x46f8dc['id'],'link_field_name':_0x49c95e,'related_ids':[_0x200ce7['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x39ef('0x51')]=function(_0x4e7dcf,_0xe7f063,_0x2ac09c,_0x2c4559,_0x43f56d,_0x2156b1){var _0x3466e2,_0x4e970a,_0x532a88,_0x343b0d;_0x2156b1[_0x39ef('0x52')]=intUtil[_0x39ef('0x53')](_0x2156b1[_0x39ef('0x52')]);_0x2156b1[_0x39ef('0x54')]=intUtil[_0x39ef('0x53')](_0x2156b1[_0x39ef('0x54')]);def['uri']=util[_0x39ef('0x21')](_0x39ef('0x55'),_0x2156b1['remoteUri']);if(_0x43f56d&&_0x43f56d[_0x39ef('0x56')]){logger[_0x39ef('0xa')](_0x39ef('0x57'),_0x39ef('0x58'));_0xe7f063['recordingURL']=util[_0x39ef('0x21')](_0x39ef('0x59'),_0x2156b1[_0x39ef('0x54')],_0xe7f063[_0x39ef('0x5a')],md5(_0xe7f063[_0x39ef('0x5a')]));}else{_0xe7f063[_0x39ef('0x5b')]='';}return getConnection(_0x2156b1)[_0x39ef('0x2d')](function(_0x1f1a36){_0x343b0d=_0x1f1a36;return getUser(_0x2156b1,_0x2c4559[_0x39ef('0xc')],_0x343b0d);})[_0x39ef('0x2d')](function(_0x17707c){_0x3466e2=_0x17707c;logger['info'](_0x39ef('0x5c'),_0x3466e2['id']);return getEndUser(_0x2156b1,_0xe7f063[_0x39ef('0x5d')],_0xe7f063['calleridnum'],_0x343b0d);})[_0x39ef('0x2d')](function(_0x5c7118){_0x4e970a=_0x5c7118;logger[_0x39ef('0xa')]('The\x20Enduser\x20ID\x20is:',_0x4e970a['id']);return getTicket(_0x2156b1,_0x3466e2,_0x4e970a,_0x2ac09c,_0xe7f063,_0x2ac09c[_0x39ef('0x5e')],_0x343b0d,'Inbound');})[_0x39ef('0x2d')](function(_0x54890d){_0x532a88=_0x54890d;logger[_0x39ef('0xa')](_0x39ef('0x5f'));logger[_0x39ef('0xa')](_0x39ef('0x60'),_0x532a88['id']);return setRelationship(_0x343b0d,_0x3466e2,_0x532a88,'users');})['then'](function(){return setRelationship(_0x343b0d,_0x4e970a,_0x532a88,_0x39ef('0x61'));})['then'](function(){return getServerInfo(_0x343b0d);})[_0x39ef('0x2d')](function(_0x1df428){var _0x24c896=parseInt(_0x1df428[_0x39ef('0x62')][_0x39ef('0x63')](0x0));var _0x532bf4=util[_0x39ef('0x21')](_0x39ef('0x64'),_0x2156b1[_0x39ef('0x52')],_0x532a88['id']);if(_0x24c896>0x6){_0x532bf4=util[_0x39ef('0x21')](_0x39ef('0x65'),_0x2156b1[_0x39ef('0x52')],_0x532a88['id']);}logger['info']('[QUEUE]',_0x39ef('0x66'));emit(util['format'](_0x39ef('0x67'),_0x2c4559[_0x39ef('0xc')]),'trigger:browser:url',{'uri':_0x532bf4});})[_0x39ef('0x68')](function(_0x72dff9){logger[_0x39ef('0x69')](_0x39ef('0x57'),JSON['stringify'](_0x72dff9));});};exports[_0x39ef('0x6a')]=function(_0x1cf20e,_0x36a937,_0xd7428b,_0x509dfb,_0x3f74d8,_0x407755,_0x3542e0){var _0x47306e,_0xc758bd,_0x5ea2a2,_0x2bdf4e;_0x407755[_0x39ef('0x52')]=intUtil[_0x39ef('0x53')](_0x407755[_0x39ef('0x52')]);_0x407755['serverUrl']=intUtil[_0x39ef('0x53')](_0x407755[_0x39ef('0x54')]);def[_0x39ef('0x6b')]=util['format'](_0x39ef('0x55'),_0x407755[_0x39ef('0x52')]);if(_0x3542e0&&_0x3542e0[_0x39ef('0x6c')]&&_0x3542e0[_0x39ef('0x6c')]!==_0x39ef('0x6d')){logger['info']('[OUTBOUND]',_0x39ef('0x58'));_0x36a937[_0x39ef('0x5b')]=util[_0x39ef('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x407755[_0x39ef('0x54')],_0x36a937[_0x39ef('0x5a')],md5(_0x36a937['uniqueid']));}return getConnection(_0x407755)[_0x39ef('0x2d')](function(_0x5ed3dc){_0x2bdf4e=_0x5ed3dc;return getUser(_0x407755,_0x509dfb[_0x39ef('0xc')],_0x2bdf4e);})[_0x39ef('0x2d')](function(_0x2bf2cc){_0x47306e=_0x2bf2cc;logger[_0x39ef('0xa')](_0x39ef('0x5c'),_0x47306e['id']);return getEndUser(_0x407755,_0x36a937[_0x39ef('0x6e')],_0x36a937[_0x39ef('0x6f')],_0x2bdf4e);})[_0x39ef('0x2d')](function(_0xc7db51){_0xc758bd=_0xc7db51;logger['info']('The\x20Enduser\x20ID\x20is:',_0xc758bd['id']);return getTicket(_0x407755,_0x47306e,_0xc758bd,_0xd7428b,_0x36a937,_0xd7428b[_0x39ef('0x5e')],_0x2bdf4e,_0x39ef('0x70'));})[_0x39ef('0x2d')](function(_0x444267){_0x5ea2a2=_0x444267;logger[_0x39ef('0xa')]('Ticket\x20created!');logger[_0x39ef('0xa')]('The\x20Ticket\x20ID\x20is:',_0x5ea2a2['id']);return setRelationship(_0x2bdf4e,_0x47306e,_0x5ea2a2,_0x39ef('0x71'));})[_0x39ef('0x2d')](function(){return setRelationship(_0x2bdf4e,_0xc758bd,_0x5ea2a2,_0x39ef('0x61'));})[_0x39ef('0x2d')](function(){return getServerInfo(_0x2bdf4e);})[_0x39ef('0x2d')](function(_0x473582){var _0x450555=parseInt(_0x473582[_0x39ef('0x62')]['charAt'](0x0));var _0x2d42f6=util[_0x39ef('0x21')](_0x39ef('0x64'),_0x407755['remoteUri'],_0x5ea2a2['id']);if(_0x450555>0x6){_0x2d42f6=util['format'](_0x39ef('0x65'),_0x407755['remoteUri'],_0x5ea2a2['id']);}logger[_0x39ef('0xa')](_0x39ef('0x72'),_0x39ef('0x66'));emit(util[_0x39ef('0x21')](_0x39ef('0x67'),_0x509dfb[_0x39ef('0xc')]),_0x39ef('0x73'),{'uri':_0x2d42f6});})[_0x39ef('0x68')](function(_0xeeab80){logger[_0x39ef('0x69')](_0x39ef('0x72'),JSON['stringify'](_0xeeab80));});};exports[_0x39ef('0x74')]=function(_0x54e694,_0x3f7d6a,_0x134ad7,_0x110bc0,_0x383627,_0x5006a2){var _0x4c261c,_0x5ed6ad,_0x26fb02,_0x56846f;_0x5006a2['remoteUri']=intUtil[_0x39ef('0x53')](_0x5006a2[_0x39ef('0x52')]);_0x5006a2[_0x39ef('0x54')]=intUtil[_0x39ef('0x53')](_0x5006a2['serverUrl']);def[_0x39ef('0x6b')]=util[_0x39ef('0x21')]('%s/service/v4_1/rest.php',_0x5006a2[_0x39ef('0x52')]);if(_0x383627&&_0x383627['monitor_format']){logger[_0x39ef('0xa')]('['+_0x3f7d6a[_0x39ef('0x75')][_0x39ef('0x76')]()+']',_0x39ef('0x58'));_0x3f7d6a['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5006a2[_0x39ef('0x54')],_0x3f7d6a[_0x39ef('0x5a')],md5(_0x3f7d6a[_0x39ef('0x5a')]));}else{_0x3f7d6a[_0x39ef('0x5b')]='';}return getConnection(_0x5006a2)[_0x39ef('0x2d')](function(_0x30519c){_0x56846f=_0x30519c;if(!_['isNil'](_0x110bc0)){return getUser(_0x5006a2,_0x110bc0['name'],_0x56846f);}else{return getUser(_0x5006a2,null,_0x56846f);}})[_0x39ef('0x2d')](function(_0x386b98){_0x4c261c=_0x386b98;logger[_0x39ef('0xa')]('The\x20User\x20ID\x20is:',_0x4c261c['id']);return getEndUser(_0x5006a2,_0x3f7d6a['calleridname'],_0x3f7d6a['calleridnum'],_0x56846f);})[_0x39ef('0x2d')](function(_0x515b5a){_0x5ed6ad=_0x515b5a;logger[_0x39ef('0xa')](_0x39ef('0x77'),_0x5ed6ad['id']);return getTicket(_0x5006a2,_0x4c261c,_0x5ed6ad,_0x134ad7,_0x3f7d6a,_0x134ad7['Fields'],_0x56846f,'Inbound');})[_0x39ef('0x2d')](function(_0x27c5cb){_0x26fb02=_0x27c5cb;logger['info']('Ticket\x20created!');logger[_0x39ef('0xa')](_0x39ef('0x60'),_0x26fb02['id']);return setRelationship(_0x56846f,_0x4c261c,_0x26fb02,_0x39ef('0x71'));})[_0x39ef('0x2d')](function(){return setRelationship(_0x56846f,_0x5ed6ad,_0x26fb02,_0x39ef('0x61'));})[_0x39ef('0x2d')](function(){return getServerInfo(_0x56846f);})[_0x39ef('0x68')](function(_0x1a0f4d){logger['error']('['+_0x3f7d6a[_0x39ef('0x75')][_0x39ef('0x76')]()+']',JSON[_0x39ef('0x1f')](_0x1a0f4d));});}; \ No newline at end of file +var _0x8eee=['users','version','charAt','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','trigger:browser:url','unmanaged','toUpperCase','Inbound','lastevent','request-promise','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','variableName','push','idField','JSON','Calls','format','Basic\x20%s','toString','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','Employees','user_name','then','find','entry_list','value','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','type','string','nameField','customField','toLowerCase','custom_fields','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:'];(function(_0x46438f,_0xdceaad){var _0x35bee7=function(_0x1f2f71){while(--_0x1f2f71){_0x46438f['push'](_0x46438f['shift']());}};_0x35bee7(++_0xdceaad);}(_0x8eee,0x106));var _0xe8ee=function(_0x55a440,_0x5dacbc){_0x55a440=_0x55a440-0x0;var _0x1561b9=_0x8eee[_0x55a440];return _0x1561b9;};'use strict';var _=require('lodash');var rp=require(_0xe8ee('0x0'));var BPromise=require(_0xe8ee('0x1'));var md5=require(_0xe8ee('0x2'));var util=require(_0xe8ee('0x3'));var Redis=require(_0xe8ee('0x4'));var intUtil=require('./util');var config=require(_0xe8ee('0x5'));var logger=require(_0xe8ee('0x6'))(_0xe8ee('0x7'));config[_0xe8ee('0x8')]=_[_0xe8ee('0x9')](config['redis'],{'host':_0xe8ee('0xa'),'port':0x18eb});var io=require(_0xe8ee('0xb'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x2ff5d9,_0x534852,_0x3320db){io['to'](_0x2ff5d9)[_0xe8ee('0xc')](_0x534852,_0x3320db);}function getTicket(_0x175076,_0x3ba58f,_0x44fec0,_0x316554,_0x26a22d,_0x121514,_0x514f94,_0x47c562){logger[_0xe8ee('0xd')](_0xe8ee('0xe'));var _0x3d44d5=new Date();var _0x159621=[{'name':_0xe8ee('0xf'),'value':intUtil[_0xe8ee('0x10')](_0x316554['Subjects'],_0x26a22d,'\x20')},{'name':_0xe8ee('0x11'),'value':_0x3ba58f['id']},{'name':_0xe8ee('0x12'),'value':_0x3ba58f['id']},{'name':_0xe8ee('0x13'),'value':intUtil[_0xe8ee('0x10')](_0x316554[_0xe8ee('0x14')],_0x26a22d,'\x0a')},{'name':_0xe8ee('0x15'),'value':_0x3d44d5[_0xe8ee('0x16')]()['slice'](0x0,0x13)[_0xe8ee('0x17')]('T','\x20')},{'name':_0xe8ee('0x18'),'value':'0'},{'name':_0xe8ee('0x19'),'value':'15'},{'name':_0xe8ee('0x1a'),'value':_0x44fec0['id']},{'name':_0xe8ee('0x1b'),'value':'Contacts'},{'name':_0xe8ee('0x1c'),'value':_0x44fec0[_0xe8ee('0xf')]},{'name':_0xe8ee('0x1d'),'value':_0x47c562}];if(_0x121514[_0xe8ee('0x1e')]){_['forEach'](_0x121514,function(_0x54cf2b){if(_0x26a22d[_0x54cf2b[_0xe8ee('0x1f')]]){_0x159621[_0xe8ee('0x20')]({'name':_0x54cf2b[_0xe8ee('0x21')],'value':_0x26a22d[_0x54cf2b['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':_0xe8ee('0x22'),'response_type':_0xe8ee('0x22'),'rest_data':JSON['stringify']({'session':_0x514f94['id'],'module_name':_0xe8ee('0x23'),'name_value_list':_0x159621})}});}function getAuth(_0x4263d7){return util[_0xe8ee('0x24')](_0xe8ee('0x25'),new Buffer(_0x4263d7['apiKey']+':X')[_0xe8ee('0x26')](_0xe8ee('0x27')));}function getServerInfo(_0x5d0594){return request({'form':{'method':_0xe8ee('0x28'),'input_type':_0xe8ee('0x22'),'response_type':'JSON','rest_data':JSON[_0xe8ee('0x29')]({'session':_0x5d0594['id']})}});}function getUser(_0x49334e,_0x495a74,_0x4e59d5){if(!_[_0xe8ee('0x2a')](_0x495a74)){logger[_0xe8ee('0xd')](_0xe8ee('0x2b'),_0x495a74);return request({'form':{'method':'get_entry_list','input_type':_0xe8ee('0x22'),'response_type':_0xe8ee('0x22'),'rest_data':JSON[_0xe8ee('0x29')]({'session':_0x4e59d5['id'],'module_name':_0xe8ee('0x2c'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x495a74),'order_by':'','offset':'0','select_fields':['id','name',_0xe8ee('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe8ee('0x2e')](function(_0xe98009){if(_0xe98009['entry_list'][_0xe8ee('0x1e')]){var _0x4694ff=_[_0xe8ee('0x2f')](_0xe98009[_0xe8ee('0x30')],function(_0x66f182){return _0x66f182['name_value_list'][_0xe8ee('0x2d')][_0xe8ee('0x31')]===_0x495a74;});if(_0x4694ff){logger[_0xe8ee('0xd')]('Agent\x20found!');return BPromise['resolve']({'id':_0x4694ff[_0xe8ee('0x32')]['id']['value'],'name':_0x4694ff[_0xe8ee('0x32')][_0xe8ee('0xf')][_0xe8ee('0x31')]});}}logger[_0xe8ee('0xd')](_0xe8ee('0x33'));return BPromise[_0xe8ee('0x34')]({'id':_0x4e59d5[_0xe8ee('0x32')][_0xe8ee('0x35')][_0xe8ee('0x31')],'name':_0x4e59d5[_0xe8ee('0x32')][_0xe8ee('0x2d')]['value']});});}else{logger[_0xe8ee('0xd')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xe8ee('0x34')]({'id':_0x4e59d5[_0xe8ee('0x32')][_0xe8ee('0x35')][_0xe8ee('0x31')],'name':_0x4e59d5[_0xe8ee('0x32')][_0xe8ee('0x2d')][_0xe8ee('0x31')]});}}function getEndUser(_0x4b75a8,_0x52b017,_0x557ded,_0x4e1b59){logger[_0xe8ee('0xd')]('Searching\x20enduser\x20with\x20phone',_0x557ded);return request({'form':{'method':_0xe8ee('0x36'),'input_type':_0xe8ee('0x22'),'response_type':_0xe8ee('0x22'),'rest_data':JSON[_0xe8ee('0x29')]({'session':_0x4e1b59['id'],'module_name':_0xe8ee('0x37'),'query':util[_0xe8ee('0x24')](_0xe8ee('0x38'),_0x557ded),'order_by':'','offset':'0','select_fields':['id',_0xe8ee('0xf'),_0xe8ee('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe8ee('0x2e')](function(_0x321092){if(_0x321092[_0xe8ee('0x30')][_0xe8ee('0x1e')]){var _0x57d9e0=_[_0xe8ee('0x2f')](_0x321092[_0xe8ee('0x30')],function(_0x2c2681){return _0x2c2681[_0xe8ee('0x32')][_0xe8ee('0x39')][_0xe8ee('0x31')]===_0x557ded;});if(_0x57d9e0){logger[_0xe8ee('0xd')](_0xe8ee('0x3a'));return BPromise[_0xe8ee('0x34')]({'id':_0x57d9e0[_0xe8ee('0x32')]['id'][_0xe8ee('0x31')],'name':_0x57d9e0[_0xe8ee('0x32')][_0xe8ee('0xf')][_0xe8ee('0x31')],'phone':_0x57d9e0[_0xe8ee('0x32')]['phone_home'][_0xe8ee('0x31')]});}}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xe8ee('0x3b'),'input_type':_0xe8ee('0x22'),'response_type':'JSON','rest_data':JSON[_0xe8ee('0x29')]({'session':_0x4e1b59['id'],'module_name':_0xe8ee('0x37'),'name_value_list':[{'name':_0xe8ee('0x3c'),'value':_0x52b017!==_0xe8ee('0x3d')?_0x52b017:util[_0xe8ee('0x24')](_0xe8ee('0x3e'),_0x557ded)},{'name':_0xe8ee('0x39'),'value':_0x557ded}]})}})[_0xe8ee('0x2e')](function(_0x3d5832){logger[_0xe8ee('0xd')](_0xe8ee('0x3f'));return BPromise[_0xe8ee('0x34')]({'id':_0x3d5832['id'],'name':_0x3d5832[_0xe8ee('0x30')][_0xe8ee('0x3c')][_0xe8ee('0x31')],'phone':_0x3d5832[_0xe8ee('0x30')][_0xe8ee('0x39')][_0xe8ee('0x31')]});});}});}function request(_0x143302){logger[_0xe8ee('0x40')]('[HTTP]',JSON[_0xe8ee('0x29')](_0x143302));return rp(_[_0xe8ee('0x41')](def,_0x143302));}function getTags(_0x69f49c,_0x78cd1d){var _0x3033bf=[];if(_0x69f49c&&_0x69f49c['length']>0x0){_0x3033bf=_['map'](_0x69f49c,_0x78cd1d);}return _0x3033bf;}function getCustomFields(_0x5c14cc,_0x5137d2){var _0xf7fbb5=[];var _0xd9701f={'custom_fields':[]};if(_0x5c14cc['length']>0x0){_['forEach'](_0x5c14cc,function(_0x50eff0){if(_0x50eff0[_0xe8ee('0x42')]===_0xe8ee('0x43')&&_0x50eff0[_0xe8ee('0x44')]&&!_0x50eff0[_0xe8ee('0x45')]){_0xd9701f[_0x50eff0['nameField'][_0xe8ee('0x46')]()]=_0x50eff0['content'][_0xe8ee('0x26')]();}else if(_0x50eff0[_0xe8ee('0x42')]===_0xe8ee('0x43')&&_0x50eff0[_0xe8ee('0x21')]&&_0x50eff0[_0xe8ee('0x45')]){_0xd9701f[_0xe8ee('0x47')]['push']({'id':_0x50eff0[_0xe8ee('0x21')],'value':_0x50eff0['content'][_0xe8ee('0x26')]()});}else if(_0x50eff0[_0xe8ee('0x42')]===_0xe8ee('0x48')&&_0x50eff0[_0xe8ee('0x1f')]&&_0x50eff0[_0xe8ee('0x21')]&&_0x50eff0['customField']){_0x5137d2[_0x50eff0[_0xe8ee('0x1f')]]&&_0xd9701f[_0xe8ee('0x47')][_0xe8ee('0x20')]({'id':_0x50eff0['idField'],'value':_0x5137d2[_0x50eff0[_0xe8ee('0x1f')]][_0xe8ee('0x26')]()});}else if(_0x50eff0[_0xe8ee('0x42')]==='customVariable'&&_0x50eff0[_0xe8ee('0x49')]&&_0x50eff0[_0xe8ee('0x49')]['name']&&_0x50eff0[_0xe8ee('0x21')]&&_0x50eff0[_0xe8ee('0x45')]){_0x5137d2[_0x50eff0[_0xe8ee('0x49')][_0xe8ee('0xf')][_0xe8ee('0x46')]()]&&_0xd9701f[_0xe8ee('0x47')][_0xe8ee('0x20')]({'id':_0x50eff0[_0xe8ee('0x21')],'value':_0x5137d2[_0x50eff0[_0xe8ee('0x49')][_0xe8ee('0xf')][_0xe8ee('0x46')]()][_0xe8ee('0x26')]()});}});}return _0xd9701f;}function getConnection(_0x14d55f){return request({'method':'POST','form':{'method':_0xe8ee('0x4a'),'input_type':_0xe8ee('0x22'),'response_type':'JSON','rest_data':JSON[_0xe8ee('0x29')]({'user_auth':{'user_name':_0x14d55f[_0xe8ee('0x4b')],'password':_0x14d55f[_0xe8ee('0x4c')],'encryption':_0xe8ee('0x4d')},'application':_0xe8ee('0x4e')})}})[_0xe8ee('0x2e')](function(_0xd5cdfb){var _0x3daea8=_0xd5cdfb;if(_0x3daea8['id']){def[_0xe8ee('0x4f')]=_0x3daea8['id'];return BPromise[_0xe8ee('0x34')](_0x3daea8);}else{throw new Error(util[_0xe8ee('0x24')](_0xe8ee('0x50'),_0x14d55f['id']));}});}function setRelationship(_0x8e01eb,_0x156da6,_0x319aae,_0x330bca){return request({'form':{'method':_0xe8ee('0x51'),'input_type':_0xe8ee('0x22'),'response_type':_0xe8ee('0x22'),'rest_data':JSON[_0xe8ee('0x29')]({'session':_0x8e01eb['id'],'module_name':_0xe8ee('0x23'),'module_id':_0x319aae['id'],'link_field_name':_0x330bca,'related_ids':[_0x156da6['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xe8ee('0x52')]=function(_0x5e937b,_0x499f2a,_0x374c16,_0x46dd80,_0x464fb7,_0x2d8b8b){var _0x414950,_0x4934b8,_0xc4bdd8,_0x52579b;_0x2d8b8b['remoteUri']=intUtil[_0xe8ee('0x53')](_0x2d8b8b['remoteUri']);_0x2d8b8b[_0xe8ee('0x54')]=intUtil[_0xe8ee('0x53')](_0x2d8b8b[_0xe8ee('0x54')]);def[_0xe8ee('0x55')]=util[_0xe8ee('0x24')](_0xe8ee('0x56'),_0x2d8b8b[_0xe8ee('0x57')]);if(_0x464fb7&&_0x464fb7[_0xe8ee('0x58')]){logger[_0xe8ee('0xd')](_0xe8ee('0x59'),_0xe8ee('0x5a'));_0x499f2a[_0xe8ee('0x5b')]=util[_0xe8ee('0x24')](_0xe8ee('0x5c'),_0x2d8b8b['serverUrl'],_0x499f2a[_0xe8ee('0x5d')],md5(_0x499f2a[_0xe8ee('0x5d')]));}else{_0x499f2a['recordingURL']='';}return getConnection(_0x2d8b8b)['then'](function(_0x10c4fa){_0x52579b=_0x10c4fa;return getUser(_0x2d8b8b,_0x46dd80['name'],_0x52579b);})[_0xe8ee('0x2e')](function(_0x1a7c91){_0x414950=_0x1a7c91;logger[_0xe8ee('0xd')](_0xe8ee('0x5e'),_0x414950['id']);return getEndUser(_0x2d8b8b,_0x499f2a[_0xe8ee('0x5f')],_0x499f2a[_0xe8ee('0x60')],_0x52579b);})[_0xe8ee('0x2e')](function(_0x7bccde){_0x4934b8=_0x7bccde;logger[_0xe8ee('0xd')](_0xe8ee('0x61'),_0x4934b8['id']);return getTicket(_0x2d8b8b,_0x414950,_0x4934b8,_0x374c16,_0x499f2a,_0x374c16[_0xe8ee('0x62')],_0x52579b,'Inbound');})[_0xe8ee('0x2e')](function(_0x243b61){_0xc4bdd8=_0x243b61;logger[_0xe8ee('0xd')](_0xe8ee('0x63'));logger[_0xe8ee('0xd')](_0xe8ee('0x64'),_0xc4bdd8['id']);return setRelationship(_0x52579b,_0x414950,_0xc4bdd8,_0xe8ee('0x65'));})[_0xe8ee('0x2e')](function(){return setRelationship(_0x52579b,_0x4934b8,_0xc4bdd8,'contacts');})[_0xe8ee('0x2e')](function(){return getServerInfo(_0x52579b);})[_0xe8ee('0x2e')](function(_0x40e992){var _0x2429d9=parseInt(_0x40e992[_0xe8ee('0x66')][_0xe8ee('0x67')](0x0));var _0x2e4398=util[_0xe8ee('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2d8b8b[_0xe8ee('0x57')],_0xc4bdd8['id']);if(_0x2429d9>0x6){_0x2e4398=util[_0xe8ee('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x2d8b8b['remoteUri'],_0xc4bdd8['id']);}logger['info']('[QUEUE]',_0xe8ee('0x68'));emit(util[_0xe8ee('0x24')]('user:%s',_0x46dd80[_0xe8ee('0xf')]),'trigger:browser:url',{'uri':_0x2e4398});})[_0xe8ee('0x69')](function(_0x23bf55){logger[_0xe8ee('0x6a')](_0xe8ee('0x59'),JSON['stringify'](_0x23bf55));});};exports[_0xe8ee('0x6b')]=function(_0x13a4cc,_0x3ca714,_0x18dac4,_0x369626,_0x5cdb13,_0x53c7f4,_0x10e101){var _0x3abfdf,_0x501855,_0x12f63b,_0x5ce186;_0x53c7f4[_0xe8ee('0x57')]=intUtil[_0xe8ee('0x53')](_0x53c7f4[_0xe8ee('0x57')]);_0x53c7f4[_0xe8ee('0x54')]=intUtil[_0xe8ee('0x53')](_0x53c7f4[_0xe8ee('0x54')]);def[_0xe8ee('0x55')]=util[_0xe8ee('0x24')](_0xe8ee('0x56'),_0x53c7f4[_0xe8ee('0x57')]);if(_0x10e101&&_0x10e101[_0xe8ee('0x6c')]&&_0x10e101[_0xe8ee('0x6c')]!==_0xe8ee('0x6d')){logger[_0xe8ee('0xd')](_0xe8ee('0x6e'),_0xe8ee('0x5a'));_0x3ca714[_0xe8ee('0x5b')]=util[_0xe8ee('0x24')](_0xe8ee('0x5c'),_0x53c7f4[_0xe8ee('0x54')],_0x3ca714[_0xe8ee('0x5d')],md5(_0x3ca714[_0xe8ee('0x5d')]));}return getConnection(_0x53c7f4)[_0xe8ee('0x2e')](function(_0xa78e42){_0x5ce186=_0xa78e42;return getUser(_0x53c7f4,_0x369626['name'],_0x5ce186);})['then'](function(_0x131402){_0x3abfdf=_0x131402;logger[_0xe8ee('0xd')](_0xe8ee('0x5e'),_0x3abfdf['id']);return getEndUser(_0x53c7f4,_0x3ca714['destcalleridname'],_0x3ca714[_0xe8ee('0x6f')],_0x5ce186);})['then'](function(_0x3362c3){_0x501855=_0x3362c3;logger[_0xe8ee('0xd')](_0xe8ee('0x61'),_0x501855['id']);return getTicket(_0x53c7f4,_0x3abfdf,_0x501855,_0x18dac4,_0x3ca714,_0x18dac4['Fields'],_0x5ce186,_0xe8ee('0x70'));})[_0xe8ee('0x2e')](function(_0x156158){_0x12f63b=_0x156158;logger[_0xe8ee('0xd')](_0xe8ee('0x63'));logger['info'](_0xe8ee('0x64'),_0x12f63b['id']);return setRelationship(_0x5ce186,_0x3abfdf,_0x12f63b,_0xe8ee('0x65'));})['then'](function(){return setRelationship(_0x5ce186,_0x501855,_0x12f63b,_0xe8ee('0x71'));})['then'](function(){return getServerInfo(_0x5ce186);})['then'](function(_0x47d9a0){var _0x4e6352=parseInt(_0x47d9a0[_0xe8ee('0x66')][_0xe8ee('0x67')](0x0));var _0x38b9cd=util[_0xe8ee('0x24')](_0xe8ee('0x72'),_0x53c7f4[_0xe8ee('0x57')],_0x12f63b['id']);if(_0x4e6352>0x6){_0x38b9cd=util[_0xe8ee('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x53c7f4[_0xe8ee('0x57')],_0x12f63b['id']);}logger[_0xe8ee('0xd')](_0xe8ee('0x6e'),_0xe8ee('0x68'));emit(util[_0xe8ee('0x24')](_0xe8ee('0x73'),_0x369626[_0xe8ee('0xf')]),_0xe8ee('0x74'),{'uri':_0x38b9cd});})[_0xe8ee('0x69')](function(_0x24b43f){logger[_0xe8ee('0x6a')](_0xe8ee('0x6e'),JSON['stringify'](_0x24b43f));});};exports[_0xe8ee('0x75')]=function(_0x9b027b,_0x515e6d,_0x64297b,_0x1df876,_0x318c9a,_0x46814f){var _0x53071a,_0x4bb397,_0xef03ba,_0x68f07b;_0x46814f[_0xe8ee('0x57')]=intUtil['stripTrailingSlash'](_0x46814f[_0xe8ee('0x57')]);_0x46814f[_0xe8ee('0x54')]=intUtil[_0xe8ee('0x53')](_0x46814f['serverUrl']);def[_0xe8ee('0x55')]=util[_0xe8ee('0x24')]('%s/service/v4_1/rest.php',_0x46814f['remoteUri']);if(_0x318c9a&&_0x318c9a[_0xe8ee('0x58')]){logger[_0xe8ee('0xd')]('['+_0x515e6d['lastevent'][_0xe8ee('0x76')]()+']',_0xe8ee('0x5a'));_0x515e6d[_0xe8ee('0x5b')]=util[_0xe8ee('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x46814f[_0xe8ee('0x54')],_0x515e6d[_0xe8ee('0x5d')],md5(_0x515e6d[_0xe8ee('0x5d')]));}else{_0x515e6d[_0xe8ee('0x5b')]='';}return getConnection(_0x46814f)['then'](function(_0xb33246){_0x68f07b=_0xb33246;if(!_[_0xe8ee('0x2a')](_0x1df876)){return getUser(_0x46814f,_0x1df876[_0xe8ee('0xf')],_0x68f07b);}else{return getUser(_0x46814f,null,_0x68f07b);}})[_0xe8ee('0x2e')](function(_0x13c393){_0x53071a=_0x13c393;logger[_0xe8ee('0xd')]('The\x20User\x20ID\x20is:',_0x53071a['id']);return getEndUser(_0x46814f,_0x515e6d[_0xe8ee('0x5f')],_0x515e6d['calleridnum'],_0x68f07b);})[_0xe8ee('0x2e')](function(_0x21e93f){_0x4bb397=_0x21e93f;logger[_0xe8ee('0xd')](_0xe8ee('0x61'),_0x4bb397['id']);return getTicket(_0x46814f,_0x53071a,_0x4bb397,_0x64297b,_0x515e6d,_0x64297b[_0xe8ee('0x62')],_0x68f07b,_0xe8ee('0x77'));})[_0xe8ee('0x2e')](function(_0x23f8ff){_0xef03ba=_0x23f8ff;logger['info'](_0xe8ee('0x63'));logger[_0xe8ee('0xd')](_0xe8ee('0x64'),_0xef03ba['id']);return setRelationship(_0x68f07b,_0x53071a,_0xef03ba,'users');})[_0xe8ee('0x2e')](function(){return setRelationship(_0x68f07b,_0x4bb397,_0xef03ba,'contacts');})['then'](function(){return getServerInfo(_0x68f07b);})['catch'](function(_0x3ebbc4){logger[_0xe8ee('0x6a')]('['+_0x515e6d[_0xe8ee('0x78')]['toUpperCase']()+']',JSON[_0xe8ee('0x29')](_0x3ebbc4));});}; \ 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 e6e4855..f7a4633 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 _0xd467=['format','keyContent','key','%s:\x20%s','join','slice','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','sortBy','length','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xd467,0x1e6));var _0x7d46=function(_0x51d73e,_0x5e8b60){_0x51d73e=_0x51d73e-0x0;var _0x2f08bc=_0xd467[_0x51d73e];return _0x2f08bc;};'use strict';var _=require(_0x7d46('0x0'));var util=require(_0x7d46('0x1'));exports[_0x7d46('0x2')]=function(_0x4391b5,_0x26599a,_0x90a080){var _0x173f3e=[];if(_0x4391b5['length']>0x0){var _0x233504=_[_0x7d46('0x3')](_0x4391b5,['id']);for(var _0x18f0ec=0x0;_0x18f0ec<_0x233504[_0x7d46('0x4')];_0x18f0ec++){var _0x3f8f36=_0x233504[_0x18f0ec];if(_0x3f8f36[_0x7d46('0x5')]===_0x7d46('0x6')){_0x173f3e[_0x7d46('0x7')](_0x3f8f36[_0x7d46('0x8')]);}else if(_0x3f8f36[_0x7d46('0x5')]===_0x7d46('0x9')&&_0x3f8f36[_0x7d46('0xa')]){_0x26599a[_0x3f8f36[_0x7d46('0xa')]]&&_0x173f3e[_0x7d46('0x7')](_0x26599a[_0x3f8f36['variableName']][_0x7d46('0xb')]());}else if(_0x3f8f36[_0x7d46('0x5')]===_0x7d46('0xc')&&_0x3f8f36[_0x7d46('0xd')]&&_0x3f8f36['Variable'][_0x7d46('0xe')]){_0x26599a[_0x3f8f36[_0x7d46('0xd')]['name'][_0x7d46('0xf')]()]&&_0x173f3e[_0x7d46('0x7')](_0x26599a[_0x3f8f36[_0x7d46('0xd')][_0x7d46('0xe')][_0x7d46('0xf')]()]['toString']());}else if(_0x3f8f36[_0x7d46('0x5')]===_0x7d46('0x10')){if(_0x3f8f36[_0x7d46('0x11')]===_0x7d46('0x6')&&_0x3f8f36['key']){_0x173f3e[_0x7d46('0x7')](util[_0x7d46('0x12')]('%s:\x20%s',_0x3f8f36['key'],_0x3f8f36[_0x7d46('0x13')]));}else if(_0x3f8f36[_0x7d46('0x11')]===_0x7d46('0x9')&&_0x3f8f36[_0x7d46('0xa')]&&_0x3f8f36[_0x7d46('0x14')]){_0x26599a[_0x3f8f36[_0x7d46('0xa')]]&&_0x173f3e[_0x7d46('0x7')](util['format']('%s:\x20%s',_0x3f8f36[_0x7d46('0x14')],_0x26599a[_0x3f8f36[_0x7d46('0xa')]]));}else if(_0x3f8f36[_0x7d46('0x11')]===_0x7d46('0xc')&&_0x3f8f36[_0x7d46('0xd')]&&_0x3f8f36[_0x7d46('0xd')][_0x7d46('0xe')]&&_0x3f8f36[_0x7d46('0x14')]){_0x26599a[_0x3f8f36[_0x7d46('0xd')]['name'][_0x7d46('0xf')]()]&&_0x173f3e[_0x7d46('0x7')](util[_0x7d46('0x12')](_0x7d46('0x15'),_0x3f8f36[_0x7d46('0x14')],_0x26599a[_0x3f8f36[_0x7d46('0xd')][_0x7d46('0xe')]['toLowerCase']()]));}}}}return _0x173f3e[_0x7d46('0x16')](_0x90a080);};exports['stripTrailingSlash']=function(_0x1fbe31){var _0x44c347=_0x1fbe31[_0x7d46('0x17')](-0x1);if(_0x44c347==='/'){_0x1fbe31=_0x1fbe31['substring'](0x0,_0x1fbe31[_0x7d46('0x18')](_0x44c347));}return _0x1fbe31;};exports[_0x7d46('0x19')]=function(_0x49542d){if(!_[_0x7d46('0x1a')](_0x49542d)&&_0x49542d!==''){var _0x588b0a=/^(([^<>()\[\]\\.,;:\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 _0x588b0a[_0x7d46('0x1b')](String(_0x49542d)[_0x7d46('0xf')]());}else{return![];}}; \ No newline at end of file +var _0x0276=['test','lodash','util','getString','length','type','string','push','content','variableName','customVariable','Variable','name','toLowerCase','key','%s:\x20%s','keyContent','keyType','variable','format','join','stripTrailingSlash','substring','validateEmail','isNil'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x0276,0x1dc));var _0x6027=function(_0x6f24f9,_0x14049c){_0x6f24f9=_0x6f24f9-0x0;var _0x3d36d7=_0x0276[_0x6f24f9];return _0x3d36d7;};'use strict';var _=require(_0x6027('0x0'));var util=require(_0x6027('0x1'));exports[_0x6027('0x2')]=function(_0x1caecc,_0x31964c,_0x4571d2){var _0x932c28=[];if(_0x1caecc[_0x6027('0x3')]>0x0){var _0x59c52a=_['sortBy'](_0x1caecc,['id']);for(var _0x5bd948=0x0;_0x5bd948<_0x59c52a[_0x6027('0x3')];_0x5bd948++){var _0x7ff979=_0x59c52a[_0x5bd948];if(_0x7ff979[_0x6027('0x4')]===_0x6027('0x5')){_0x932c28[_0x6027('0x6')](_0x7ff979[_0x6027('0x7')]);}else if(_0x7ff979['type']==='variable'&&_0x7ff979['variableName']){_0x31964c[_0x7ff979[_0x6027('0x8')]]&&_0x932c28['push'](_0x31964c[_0x7ff979[_0x6027('0x8')]]['toString']());}else if(_0x7ff979[_0x6027('0x4')]===_0x6027('0x9')&&_0x7ff979[_0x6027('0xa')]&&_0x7ff979[_0x6027('0xa')][_0x6027('0xb')]){_0x31964c[_0x7ff979[_0x6027('0xa')][_0x6027('0xb')][_0x6027('0xc')]()]&&_0x932c28[_0x6027('0x6')](_0x31964c[_0x7ff979[_0x6027('0xa')][_0x6027('0xb')][_0x6027('0xc')]()]['toString']());}else if(_0x7ff979['type']==='keyValue'){if(_0x7ff979['keyType']==='string'&&_0x7ff979[_0x6027('0xd')]){_0x932c28[_0x6027('0x6')](util['format'](_0x6027('0xe'),_0x7ff979[_0x6027('0xd')],_0x7ff979[_0x6027('0xf')]));}else if(_0x7ff979[_0x6027('0x10')]===_0x6027('0x11')&&_0x7ff979[_0x6027('0x8')]&&_0x7ff979[_0x6027('0xd')]){_0x31964c[_0x7ff979[_0x6027('0x8')]]&&_0x932c28['push'](util[_0x6027('0x12')](_0x6027('0xe'),_0x7ff979[_0x6027('0xd')],_0x31964c[_0x7ff979['variableName']]));}else if(_0x7ff979[_0x6027('0x10')]===_0x6027('0x9')&&_0x7ff979[_0x6027('0xa')]&&_0x7ff979[_0x6027('0xa')][_0x6027('0xb')]&&_0x7ff979[_0x6027('0xd')]){_0x31964c[_0x7ff979[_0x6027('0xa')][_0x6027('0xb')][_0x6027('0xc')]()]&&_0x932c28[_0x6027('0x6')](util[_0x6027('0x12')]('%s:\x20%s',_0x7ff979[_0x6027('0xd')],_0x31964c[_0x7ff979['Variable'][_0x6027('0xb')][_0x6027('0xc')]()]));}}}}return _0x932c28[_0x6027('0x13')](_0x4571d2);};exports[_0x6027('0x14')]=function(_0x2afc20){var _0x5ba790=_0x2afc20['slice'](-0x1);if(_0x5ba790==='/'){_0x2afc20=_0x2afc20[_0x6027('0x15')](0x0,_0x2afc20['lastIndexOf'](_0x5ba790));}return _0x2afc20;};exports[_0x6027('0x16')]=function(_0x1f7a81){if(!_[_0x6027('0x17')](_0x1f7a81)&&_0x1f7a81!==''){var _0x5791c4=/^(([^<>()\[\]\\.,;:\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 _0x5791c4[_0x6027('0x18')](String(_0x1f7a81)[_0x6027('0xc')]());}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 1b247b2..f30cb22 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 _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index eede922..b889391 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 _0x1dca=['type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','end-user','length','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','password','token','%s/token:%s','Basic\x20%s','base64','debug','[HTTP]','GET','map','forEach','includes','string','picklist','type','nameField','customField','toString','idField','push','variableName','custom_fields','customVariable','Variable','name','toLowerCase','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','/api/v2','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','application/json','info','%s/tickets.json','remoteUri','POST','Tags','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json'];(function(_0x233712,_0x242257){var _0x3eb42b=function(_0x262cb9){while(--_0x262cb9){_0x233712['push'](_0x233712['shift']());}};_0x3eb42b(++_0x242257);}(_0x1dca,0x120));var _0xa1dc=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0x1dca[_0x402c8f];return _0x11e809;};'use strict';var _=require('lodash');var rp=require(_0xa1dc('0x0'));var md5=require(_0xa1dc('0x1'));var util=require(_0xa1dc('0x2'));var Redis=require(_0xa1dc('0x3'));var intUtil=require(_0xa1dc('0x4'));var config=require(_0xa1dc('0x5'));var logger=require(_0xa1dc('0x6'))(_0xa1dc('0x7'));config[_0xa1dc('0x8')]=_[_0xa1dc('0x9')](config[_0xa1dc('0x8')],{'host':_0xa1dc('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x52da8e,_0x108d1c,_0xd02864){io['to'](_0x52da8e)['emit'](_0x108d1c,_0xd02864);}var headers={'Content-Type':_0xa1dc('0xb'),'Accept':'application/json'};function getTicket(_0x47c5d4,_0x466f22,_0x51f139,_0x104bb0,_0xaac800){logger[_0xa1dc('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0xa1dc('0xd'),_0x47c5d4[_0xa1dc('0xe')]),'method':_0xa1dc('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x51f139['id'],'submitter_id':_0x466f22?_0x466f22['id']:undefined,'assignee_id':_0x466f22?_0x466f22['id']:undefined,'tags':getTags(_0x104bb0[_0xa1dc('0x10')],'name'),'subject':intUtil[_0xa1dc('0x11')](_0x104bb0['Subjects'],_0xaac800,'\x20'),'description':intUtil[_0xa1dc('0x11')](_0x104bb0[_0xa1dc('0x12')],_0xaac800,'\x0a'),'comment':{'public':![],'body':intUtil[_0xa1dc('0x11')](_0x104bb0[_0xa1dc('0x12')],_0xaac800,'\x0a')}},getCustomFields(_0x104bb0[_0xa1dc('0x13')],_0xaac800))}})[_0xa1dc('0x14')](function(_0x428914){logger['info'](_0xa1dc('0x15'));return _0x428914[_0xa1dc('0x16')];});}function getUser(_0x20e5b0,_0x6eb387){if(intUtil[_0xa1dc('0x17')](_0x6eb387)){logger['info'](_0xa1dc('0x18'),_0x6eb387);return request({'uri':util[_0xa1dc('0x19')](_0xa1dc('0x1a'),_0x20e5b0[_0xa1dc('0xe')]),'qs':{'query':util[_0xa1dc('0x19')](_0xa1dc('0x1b'),_0x6eb387)}})[_0xa1dc('0x14')](function(_0x182027){if(_0x182027['count']){logger[_0xa1dc('0xc')](_0xa1dc('0x1c'));return _[_0xa1dc('0x1d')](_0x182027[_0xa1dc('0x1e')],{'email':_0x6eb387,'role':'agent'});}else{logger['info'](_0xa1dc('0x1f'));return request({'uri':util[_0xa1dc('0x19')](_0xa1dc('0x20'),_0x20e5b0[_0xa1dc('0xe')])})[_0xa1dc('0x14')](function(_0x42ca2a){logger[_0xa1dc('0xc')](_0xa1dc('0x21'));return _0x42ca2a[_0xa1dc('0x22')];});}});}else{logger[_0xa1dc('0xc')](_0xa1dc('0x1f'));return request({'uri':util[_0xa1dc('0x19')](_0xa1dc('0x20'),_0x20e5b0['remoteUri'])})[_0xa1dc('0x14')](function(_0xf3ee4f){logger[_0xa1dc('0xc')](_0xa1dc('0x21'));return _0xf3ee4f['user'];});}}function getEndUser(_0x4b1962,_0x40585c,_0x1e4072){logger[_0xa1dc('0xc')](_0xa1dc('0x23'),_0x1e4072);return request({'uri':util[_0xa1dc('0x19')](_0xa1dc('0x1a'),_0x4b1962[_0xa1dc('0xe')]),'qs':{'query':util[_0xa1dc('0x19')](_0xa1dc('0x24'),_0x1e4072)}})[_0xa1dc('0x14')](function(_0x5abfc6){var _0x1e4d1c;if(_0x5abfc6['results']['length']){_0x5abfc6[_0xa1dc('0x1e')]=_['filter'](_0x5abfc6[_0xa1dc('0x1e')],{'suspended':![],'role':_0xa1dc('0x25')});if(_0x5abfc6[_0xa1dc('0x1e')][_0xa1dc('0x26')]){_0x1e4d1c=_[_0xa1dc('0x27')](_0x5abfc6[_0xa1dc('0x1e')]);}}if(_0x1e4d1c){logger[_0xa1dc('0xc')]('Enduser\x20found!');return _0x1e4d1c;}else{logger[_0xa1dc('0xc')](_0xa1dc('0x28'));return request({'uri':util[_0xa1dc('0x19')](_0xa1dc('0x29'),_0x4b1962[_0xa1dc('0xe')]),'method':'POST','body':{'user':{'role':_0xa1dc('0x25'),'name':util['format'](_0xa1dc('0x2a'),_0x40585c||_0x1e4072),'phone':_0x1e4072}}})['then'](function(_0x3a2943){logger[_0xa1dc('0xc')]('Enduser\x20created.');return _0x3a2943[_0xa1dc('0x22')];});}});}function getAuth(_0x1bfb73){var _0x210754;if(_0x1bfb73[_0xa1dc('0x2b')]===_0xa1dc('0x2c')){_0x210754=util['format']('%s:%s',_0x1bfb73['username'],_0x1bfb73[_0xa1dc('0x2c')]);}else if(_0x1bfb73[_0xa1dc('0x2b')]===_0xa1dc('0x2d')){_0x210754=util[_0xa1dc('0x19')](_0xa1dc('0x2e'),_0x1bfb73['username'],_0x1bfb73[_0xa1dc('0x2d')]);}return util[_0xa1dc('0x19')](_0xa1dc('0x2f'),new Buffer(_0x210754)['toString'](_0xa1dc('0x30')));}function request(_0x30cd00){logger[_0xa1dc('0x31')](_0xa1dc('0x32'),JSON['stringify'](_0x30cd00));return rp(_[_0xa1dc('0x9')](_0x30cd00,{'method':_0xa1dc('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x2784b0,_0x1e6794){var _0x4544e0=[];if(_0x2784b0&&_0x2784b0['length']>0x0){_0x4544e0=_[_0xa1dc('0x34')](_0x2784b0,_0x1e6794);}return _0x4544e0;}function getCustomFields(_0x1b79d0,_0x597034){var _0x3fa60a=[];var _0x4f48bf={'custom_fields':[]};if(_0x1b79d0[_0xa1dc('0x26')]>0x0){_[_0xa1dc('0x35')](_0x1b79d0,function(_0x37605a){if(_[_0xa1dc('0x36')]([_0xa1dc('0x37'),_0xa1dc('0x38')],_0x37605a[_0xa1dc('0x39')])&&_0x37605a[_0xa1dc('0x3a')]&&!_0x37605a[_0xa1dc('0x3b')]){_0x4f48bf[_0x37605a[_0xa1dc('0x3a')]['toLowerCase']()]=_0x37605a['content'][_0xa1dc('0x3c')]();}else if(_['includes'](['string','picklist'],_0x37605a['type'])&&_0x37605a[_0xa1dc('0x3d')]&&_0x37605a[_0xa1dc('0x3b')]){_0x4f48bf['custom_fields'][_0xa1dc('0x3e')]({'id':_0x37605a[_0xa1dc('0x3d')],'value':_0x37605a['content']['toString']()});}else if(_0x37605a[_0xa1dc('0x39')]==='variable'&&_0x37605a[_0xa1dc('0x3f')]&&_0x37605a[_0xa1dc('0x3d')]&&_0x37605a['customField']){_0x597034[_0x37605a[_0xa1dc('0x3f')]]&&_0x4f48bf[_0xa1dc('0x40')]['push']({'id':_0x37605a[_0xa1dc('0x3d')],'value':_0x597034[_0x37605a['variableName']][_0xa1dc('0x3c')]()});}else if(_0x37605a[_0xa1dc('0x39')]===_0xa1dc('0x41')&&_0x37605a[_0xa1dc('0x42')]&&_0x37605a[_0xa1dc('0x42')]['name']&&_0x37605a[_0xa1dc('0x3d')]&&_0x37605a[_0xa1dc('0x3b')]){_0x597034[_0x37605a['Variable'][_0xa1dc('0x43')][_0xa1dc('0x44')]()]&&_0x4f48bf[_0xa1dc('0x40')][_0xa1dc('0x3e')]({'id':_0x37605a[_0xa1dc('0x3d')],'value':_0x597034[_0x37605a['Variable'][_0xa1dc('0x43')][_0xa1dc('0x44')]()]['toString']()});}});}return _0x4f48bf;}exports['queue']=function(_0x4739e3,_0x170a77,_0x4eeeac,_0x3f0f12,_0x4f94da,_0x42ce30){var _0x49958b,_0x39afa7;_0x42ce30[_0xa1dc('0xe')]=intUtil[_0xa1dc('0x45')](_0x42ce30[_0xa1dc('0xe')]);_0x42ce30['serverUrl']=intUtil[_0xa1dc('0x45')](_0x42ce30['serverUrl']);if(_0x4f94da&&_0x4f94da[_0xa1dc('0x46')]){logger[_0xa1dc('0xc')](_0xa1dc('0x47'),_0xa1dc('0x48'));_0x170a77[_0xa1dc('0x49')]=util['format'](_0xa1dc('0x4a'),_0x42ce30[_0xa1dc('0x4b')],_0x170a77[_0xa1dc('0x4c')],md5(_0x170a77[_0xa1dc('0x4c')]));}else{_0x170a77[_0xa1dc('0x49')]='';}headers[_0xa1dc('0x4d')]=getAuth(_0x42ce30);return getUser(_0x42ce30,_0x3f0f12[_0xa1dc('0x4e')])['then'](function(_0x4bd054){_0x49958b=_0x4bd054;logger[_0xa1dc('0xc')](_0xa1dc('0x4f'),_0x49958b['id']);return getEndUser(_0x42ce30,_0x170a77['calleridname'],_0x170a77['calleridnum']);})[_0xa1dc('0x14')](function(_0x5a94fd){_0x39afa7=_0x5a94fd;logger['info'](_0xa1dc('0x50'),_0x39afa7['id']);return getTicket(_0x42ce30,_0x49958b,_0x39afa7,_0x4eeeac,_0x170a77);})[_0xa1dc('0x14')](function(_0x542b92){if(_0x542b92){logger[_0xa1dc('0xc')](_0xa1dc('0x51'),_0x542b92['id']);switch(_0x42ce30[_0xa1dc('0x39')]){case _0xa1dc('0x52'):logger[_0xa1dc('0xc')](_0xa1dc('0x47'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xa1dc('0x53'),_0x42ce30['remoteUri'],_0x49958b['id'],_0x542b92['id']),'method':'POST'});case _0xa1dc('0x54'):logger[_0xa1dc('0xc')](_0xa1dc('0x47'),_0xa1dc('0x55'));emit(util[_0xa1dc('0x19')](_0xa1dc('0x56'),_0x3f0f12[_0xa1dc('0x43')]),_0xa1dc('0x57'),{'uri':util[_0xa1dc('0x19')](_0xa1dc('0x58'),_0x42ce30[_0xa1dc('0xe')][_0xa1dc('0x59')]('/api/v2',''),_0x542b92['id'])});break;default:logger[_0xa1dc('0x5a')](_0xa1dc('0x47'),_0xa1dc('0x5b'));}}})['catch'](function(_0x25e9a9){logger[_0xa1dc('0x5a')](_0xa1dc('0x5c'),util[_0xa1dc('0x5d')](_0x25e9a9,{'showHidden':!![],'depth':null}));});};exports[_0xa1dc('0x5e')]=function(_0x56862c,_0x5759ad,_0x50da9e,_0xf9af64,_0xe6a5c5,_0x4b5264,_0x377264){var _0x5474a2,_0x4854fe;_0x4b5264[_0xa1dc('0xe')]=intUtil['stripTrailingSlash'](_0x4b5264[_0xa1dc('0xe')]);_0x4b5264[_0xa1dc('0x4b')]=intUtil['stripTrailingSlash'](_0x4b5264[_0xa1dc('0x4b')]);if(_0x377264&&_0x377264['recordingFormat']&&_0x377264[_0xa1dc('0x5f')]!==_0xa1dc('0x60')){logger[_0xa1dc('0xc')](_0xa1dc('0x61'),_0xa1dc('0x48'));_0x5759ad['recordingURL']=util[_0xa1dc('0x19')](_0xa1dc('0x4a'),_0x4b5264[_0xa1dc('0x4b')],_0x5759ad[_0xa1dc('0x4c')],md5(_0x5759ad[_0xa1dc('0x4c')]));}headers[_0xa1dc('0x4d')]=getAuth(_0x4b5264);return getUser(_0x4b5264,_0xf9af64['email'])['then'](function(_0x31b6e4){_0x5474a2=_0x31b6e4;logger[_0xa1dc('0xc')](_0xa1dc('0x4f'),_0x5474a2['id']);return getEndUser(_0x4b5264,_0x5759ad['destcalleridname'],_0x5759ad[_0xa1dc('0x62')]);})[_0xa1dc('0x14')](function(_0x3bfd8c){_0x4854fe=_0x3bfd8c;logger[_0xa1dc('0xc')](_0xa1dc('0x50'),_0x4854fe['id']);return getTicket(_0x4b5264,_0x5474a2,_0x4854fe,_0x50da9e,_0x5759ad);})[_0xa1dc('0x14')](function(_0x471f44){if(_0x471f44){logger['info'](_0xa1dc('0x51'),_0x471f44['id']);switch(_0x4b5264[_0xa1dc('0x39')]){case _0xa1dc('0x52'):logger[_0xa1dc('0xc')](_0xa1dc('0x61'),_0xa1dc('0x63'));return request({'uri':util[_0xa1dc('0x19')](_0xa1dc('0x53'),_0x4b5264[_0xa1dc('0xe')],_0x5474a2['id'],_0x471f44['id']),'method':_0xa1dc('0xf')});case'newTab':logger[_0xa1dc('0xc')]('[OUTBOUND]',_0xa1dc('0x55'));emit(util[_0xa1dc('0x19')](_0xa1dc('0x56'),_0xf9af64['name']),'trigger:browser:url',{'uri':util[_0xa1dc('0x19')](_0xa1dc('0x58'),_0x4b5264['remoteUri'][_0xa1dc('0x59')](_0xa1dc('0x64'),''),_0x471f44['id'])});break;default:logger[_0xa1dc('0x5a')]('[OUTBOUND]',_0xa1dc('0x5b'));}}})[_0xa1dc('0x65')](function(_0x7a5910){logger[_0xa1dc('0x5a')](_0xa1dc('0x66'),util['inspect'](_0x7a5910,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x2eb8ef,_0x2144d1,_0x5c5284,_0x168dc8,_0x1d0796,_0x5e1656){var _0x302733,_0x1e37b2;_0x5e1656[_0xa1dc('0xe')]=intUtil[_0xa1dc('0x45')](_0x5e1656['remoteUri']);_0x5e1656[_0xa1dc('0x4b')]=intUtil[_0xa1dc('0x45')](_0x5e1656['serverUrl']);if(_0x1d0796&&_0x1d0796[_0xa1dc('0x46')]){logger['info']('['+_0x2144d1[_0xa1dc('0x67')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x2144d1[_0xa1dc('0x49')]=util[_0xa1dc('0x19')](_0xa1dc('0x4a'),_0x5e1656[_0xa1dc('0x4b')],_0x2144d1[_0xa1dc('0x4c')],md5(_0x2144d1['uniqueid']));}else{_0x2144d1[_0xa1dc('0x49')]='';}headers['Authorization']=getAuth(_0x5e1656);return getUser(_0x5e1656)[_0xa1dc('0x14')](function(_0x508955){_0x302733=_0x508955;logger[_0xa1dc('0xc')](_0xa1dc('0x4f'),_0x302733['id']);return getEndUser(_0x5e1656,_0x2144d1['calleridname'],_0x2144d1['calleridnum']);})[_0xa1dc('0x14')](function(_0x449154){_0x1e37b2=_0x449154;logger[_0xa1dc('0xc')](_0xa1dc('0x50'),_0x1e37b2['id']);return getTicket(_0x5e1656,_0x302733,_0x1e37b2,_0x5c5284,_0x2144d1);})[_0xa1dc('0x14')](function(_0x5f2fff){if(_0x5f2fff){logger[_0xa1dc('0xc')]('The\x20Ticket\x20ID\x20is:',_0x5f2fff['id']);}})[_0xa1dc('0x65')](function(_0x34f86f){logger[_0xa1dc('0x5a')]('['+_0x2144d1[_0xa1dc('0x67')][_0xa1dc('0x68')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xa1dc('0x5d')](_0x34f86f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xfe7a=['toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','merge','Subjects','getString','Descriptions','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','type:user\x20role:end-user\x20phone:%s','length','filter','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridnum','newTab','trigger:browser:url','unmanaged','lastevent'];(function(_0x449853,_0x2f6bc6){var _0x4ec99e=function(_0x2d0206){while(--_0x2d0206){_0x449853['push'](_0x449853['shift']());}};_0x4ec99e(++_0x2f6bc6);}(_0xfe7a,0x6d));var _0xafe7=function(_0x5525a7,_0x3437c2){_0x5525a7=_0x5525a7-0x0;var _0x3503dc=_0xfe7a[_0x5525a7];return _0x3503dc;};'use strict';var _=require(_0xafe7('0x0'));var rp=require(_0xafe7('0x1'));var md5=require(_0xafe7('0x2'));var util=require(_0xafe7('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xafe7('0x4'));var logger=require(_0xafe7('0x5'))(_0xafe7('0x6'));config['redis']=_[_0xafe7('0x7')](config[_0xafe7('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xafe7('0x9'))(new Redis(config['redis']));function emit(_0x1830ee,_0x2c4501,_0x315521){io['to'](_0x1830ee)['emit'](_0x2c4501,_0x315521);}var headers={'Content-Type':'application/json','Accept':_0xafe7('0xa')};function getTicket(_0x1c24cb,_0x4a3471,_0x3939d0,_0x459f28,_0x2b5c1a){logger[_0xafe7('0xb')](_0xafe7('0xc'));return request({'uri':util[_0xafe7('0xd')](_0xafe7('0xe'),_0x1c24cb['remoteUri']),'method':'POST','body':{'ticket':_[_0xafe7('0xf')]({'requester_id':_0x3939d0['id'],'submitter_id':_0x4a3471?_0x4a3471['id']:undefined,'assignee_id':_0x4a3471?_0x4a3471['id']:undefined,'tags':getTags(_0x459f28['Tags'],'name'),'subject':intUtil['getString'](_0x459f28[_0xafe7('0x10')],_0x2b5c1a,'\x20'),'description':intUtil[_0xafe7('0x11')](_0x459f28[_0xafe7('0x12')],_0x2b5c1a,'\x0a'),'comment':{'public':![],'body':intUtil[_0xafe7('0x11')](_0x459f28['Descriptions'],_0x2b5c1a,'\x0a')}},getCustomFields(_0x459f28['Fields'],_0x2b5c1a))}})[_0xafe7('0x13')](function(_0x771799){logger['info'](_0xafe7('0x14'));return _0x771799[_0xafe7('0x15')];});}function getUser(_0x11e2eb,_0x489549){if(intUtil['validateEmail'](_0x489549)){logger[_0xafe7('0xb')](_0xafe7('0x16'),_0x489549);return request({'uri':util['format'](_0xafe7('0x17'),_0x11e2eb[_0xafe7('0x18')]),'qs':{'query':util[_0xafe7('0xd')]('type:user\x20role:agent\x20email:%s',_0x489549)}})[_0xafe7('0x13')](function(_0x5e5619){if(_0x5e5619[_0xafe7('0x19')]){logger['info'](_0xafe7('0x1a'));return _[_0xafe7('0x1b')](_0x5e5619[_0xafe7('0x1c')],{'email':_0x489549,'role':_0xafe7('0x1d')});}else{logger[_0xafe7('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xafe7('0xd')](_0xafe7('0x1e'),_0x11e2eb[_0xafe7('0x18')])})[_0xafe7('0x13')](function(_0x1e4186){logger[_0xafe7('0xb')](_0xafe7('0x1f'));return _0x1e4186[_0xafe7('0x20')];});}});}else{logger[_0xafe7('0xb')](_0xafe7('0x21'));return request({'uri':util[_0xafe7('0xd')](_0xafe7('0x1e'),_0x11e2eb[_0xafe7('0x18')])})[_0xafe7('0x13')](function(_0x2fc60d){logger[_0xafe7('0xb')](_0xafe7('0x1f'));return _0x2fc60d[_0xafe7('0x20')];});}}function getEndUser(_0x16510f,_0x617ad4,_0x1b0962){logger['info']('Searching\x20enduser\x20with\x20phone',_0x1b0962);return request({'uri':util[_0xafe7('0xd')](_0xafe7('0x17'),_0x16510f[_0xafe7('0x18')]),'qs':{'query':util['format'](_0xafe7('0x22'),_0x1b0962)}})[_0xafe7('0x13')](function(_0x427c67){var _0x80c179;if(_0x427c67[_0xafe7('0x1c')][_0xafe7('0x23')]){_0x427c67[_0xafe7('0x1c')]=_[_0xafe7('0x24')](_0x427c67[_0xafe7('0x1c')],{'suspended':![],'role':'end-user'});if(_0x427c67[_0xafe7('0x1c')][_0xafe7('0x23')]){_0x80c179=_['first'](_0x427c67['results']);}}if(_0x80c179){logger[_0xafe7('0xb')](_0xafe7('0x25'));return _0x80c179;}else{logger[_0xafe7('0xb')](_0xafe7('0x26'));return request({'uri':util[_0xafe7('0xd')](_0xafe7('0x27'),_0x16510f[_0xafe7('0x18')]),'method':_0xafe7('0x28'),'body':{'user':{'role':'end-user','name':util[_0xafe7('0xd')](_0xafe7('0x29'),_0x617ad4||_0x1b0962),'phone':_0x1b0962}}})[_0xafe7('0x13')](function(_0x4081e7){logger[_0xafe7('0xb')](_0xafe7('0x2a'));return _0x4081e7[_0xafe7('0x20')];});}});}function getAuth(_0x242380){var _0x24e1a9;if(_0x242380[_0xafe7('0x2b')]===_0xafe7('0x2c')){_0x24e1a9=util[_0xafe7('0xd')](_0xafe7('0x2d'),_0x242380[_0xafe7('0x2e')],_0x242380[_0xafe7('0x2c')]);}else if(_0x242380[_0xafe7('0x2b')]===_0xafe7('0x2f')){_0x24e1a9=util['format'](_0xafe7('0x30'),_0x242380[_0xafe7('0x2e')],_0x242380[_0xafe7('0x2f')]);}return util[_0xafe7('0xd')](_0xafe7('0x31'),new Buffer(_0x24e1a9)[_0xafe7('0x32')](_0xafe7('0x33')));}function request(_0x304747){logger['debug']('[HTTP]',JSON['stringify'](_0x304747));return rp(_[_0xafe7('0x7')](_0x304747,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3c90e2,_0x1b4929){var _0x398ce8=[];if(_0x3c90e2&&_0x3c90e2['length']>0x0){_0x398ce8=_['map'](_0x3c90e2,_0x1b4929);}return _0x398ce8;}function getCustomFields(_0x3eb37b,_0x35fccc){var _0x19e837=[];var _0x4b8f21={'custom_fields':[]};if(_0x3eb37b['length']>0x0){_[_0xafe7('0x34')](_0x3eb37b,function(_0xeb05da){if(_[_0xafe7('0x35')]([_0xafe7('0x36'),_0xafe7('0x37')],_0xeb05da[_0xafe7('0x38')])&&_0xeb05da['nameField']&&!_0xeb05da[_0xafe7('0x39')]){_0x4b8f21[_0xeb05da[_0xafe7('0x3a')][_0xafe7('0x3b')]()]=_0xeb05da['content'][_0xafe7('0x32')]();}else if(_['includes'](['string','picklist'],_0xeb05da[_0xafe7('0x38')])&&_0xeb05da[_0xafe7('0x3c')]&&_0xeb05da[_0xafe7('0x39')]){_0x4b8f21[_0xafe7('0x3d')][_0xafe7('0x3e')]({'id':_0xeb05da[_0xafe7('0x3c')],'value':_0xeb05da['content'][_0xafe7('0x32')]()});}else if(_0xeb05da['type']===_0xafe7('0x3f')&&_0xeb05da[_0xafe7('0x40')]&&_0xeb05da[_0xafe7('0x3c')]&&_0xeb05da[_0xafe7('0x39')]){_0x35fccc[_0xeb05da[_0xafe7('0x40')]]&&_0x4b8f21['custom_fields'][_0xafe7('0x3e')]({'id':_0xeb05da[_0xafe7('0x3c')],'value':_0x35fccc[_0xeb05da[_0xafe7('0x40')]][_0xafe7('0x32')]()});}else if(_0xeb05da['type']===_0xafe7('0x41')&&_0xeb05da[_0xafe7('0x42')]&&_0xeb05da[_0xafe7('0x42')]['name']&&_0xeb05da[_0xafe7('0x3c')]&&_0xeb05da[_0xafe7('0x39')]){_0x35fccc[_0xeb05da[_0xafe7('0x42')][_0xafe7('0x43')][_0xafe7('0x3b')]()]&&_0x4b8f21['custom_fields'][_0xafe7('0x3e')]({'id':_0xeb05da['idField'],'value':_0x35fccc[_0xeb05da[_0xafe7('0x42')][_0xafe7('0x43')]['toLowerCase']()][_0xafe7('0x32')]()});}});}return _0x4b8f21;}exports[_0xafe7('0x44')]=function(_0x30d273,_0x9c224b,_0x5ecbde,_0x5e29aa,_0x23a03d,_0x462c37){var _0x71c44f,_0x487bc9;_0x462c37[_0xafe7('0x18')]=intUtil[_0xafe7('0x45')](_0x462c37['remoteUri']);_0x462c37[_0xafe7('0x46')]=intUtil['stripTrailingSlash'](_0x462c37['serverUrl']);if(_0x23a03d&&_0x23a03d[_0xafe7('0x47')]){logger[_0xafe7('0xb')](_0xafe7('0x48'),_0xafe7('0x49'));_0x9c224b[_0xafe7('0x4a')]=util[_0xafe7('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x462c37[_0xafe7('0x46')],_0x9c224b[_0xafe7('0x4b')],md5(_0x9c224b['uniqueid']));}else{_0x9c224b[_0xafe7('0x4a')]='';}headers[_0xafe7('0x4c')]=getAuth(_0x462c37);return getUser(_0x462c37,_0x5e29aa['email'])[_0xafe7('0x13')](function(_0x3c2f95){_0x71c44f=_0x3c2f95;logger[_0xafe7('0xb')](_0xafe7('0x4d'),_0x71c44f['id']);return getEndUser(_0x462c37,_0x9c224b[_0xafe7('0x4e')],_0x9c224b[_0xafe7('0x4f')]);})[_0xafe7('0x13')](function(_0x904d36){_0x487bc9=_0x904d36;logger[_0xafe7('0xb')](_0xafe7('0x50'),_0x487bc9['id']);return getTicket(_0x462c37,_0x71c44f,_0x487bc9,_0x5ecbde,_0x9c224b);})[_0xafe7('0x13')](function(_0x178b4b){if(_0x178b4b){logger[_0xafe7('0xb')](_0xafe7('0x51'),_0x178b4b['id']);switch(_0x462c37[_0xafe7('0x38')]){case _0xafe7('0x52'):logger['info'](_0xafe7('0x48'),_0xafe7('0x53'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x462c37[_0xafe7('0x18')],_0x71c44f['id'],_0x178b4b['id']),'method':'POST'});case'newTab':logger['info'](_0xafe7('0x48'),_0xafe7('0x54'));emit(util[_0xafe7('0xd')](_0xafe7('0x55'),_0x5e29aa[_0xafe7('0x43')]),'trigger:browser:url',{'uri':util[_0xafe7('0xd')](_0xafe7('0x56'),_0x462c37[_0xafe7('0x18')][_0xafe7('0x57')](_0xafe7('0x58'),''),_0x178b4b['id'])});break;default:logger[_0xafe7('0x59')]('[QUEUE]',_0xafe7('0x5a'));}}})[_0xafe7('0x5b')](function(_0x252ecf){logger['error'](_0xafe7('0x5c'),util[_0xafe7('0x5d')](_0x252ecf,{'showHidden':!![],'depth':null}));});};exports[_0xafe7('0x5e')]=function(_0x6049fd,_0x5c5604,_0x5ce5b2,_0x326d79,_0x2aa54f,_0x1c10fa,_0x1d66ca){var _0x23a7ec,_0x4dfd6e;_0x1c10fa[_0xafe7('0x18')]=intUtil[_0xafe7('0x45')](_0x1c10fa[_0xafe7('0x18')]);_0x1c10fa['serverUrl']=intUtil[_0xafe7('0x45')](_0x1c10fa['serverUrl']);if(_0x1d66ca&&_0x1d66ca[_0xafe7('0x5f')]&&_0x1d66ca[_0xafe7('0x5f')]!==_0xafe7('0x60')){logger[_0xafe7('0xb')](_0xafe7('0x61'),_0xafe7('0x49'));_0x5c5604['recordingURL']=util['format'](_0xafe7('0x62'),_0x1c10fa[_0xafe7('0x46')],_0x5c5604['uniqueid'],md5(_0x5c5604[_0xafe7('0x4b')]));}headers['Authorization']=getAuth(_0x1c10fa);return getUser(_0x1c10fa,_0x326d79[_0xafe7('0x63')])[_0xafe7('0x13')](function(_0x3e6618){_0x23a7ec=_0x3e6618;logger[_0xafe7('0xb')](_0xafe7('0x4d'),_0x23a7ec['id']);return getEndUser(_0x1c10fa,_0x5c5604['destcalleridname'],_0x5c5604[_0xafe7('0x64')]);})[_0xafe7('0x13')](function(_0x18130f){_0x4dfd6e=_0x18130f;logger[_0xafe7('0xb')](_0xafe7('0x50'),_0x4dfd6e['id']);return getTicket(_0x1c10fa,_0x23a7ec,_0x4dfd6e,_0x5ce5b2,_0x5c5604);})[_0xafe7('0x13')](function(_0x2d1bd2){if(_0x2d1bd2){logger['info']('The\x20Ticket\x20ID\x20is:',_0x2d1bd2['id']);switch(_0x1c10fa[_0xafe7('0x38')]){case'integrationTab':logger[_0xafe7('0xb')](_0xafe7('0x61'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xafe7('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1c10fa[_0xafe7('0x18')],_0x23a7ec['id'],_0x2d1bd2['id']),'method':_0xafe7('0x28')});case _0xafe7('0x65'):logger[_0xafe7('0xb')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xafe7('0x55'),_0x326d79[_0xafe7('0x43')]),_0xafe7('0x66'),{'uri':util[_0xafe7('0xd')](_0xafe7('0x56'),_0x1c10fa[_0xafe7('0x18')][_0xafe7('0x57')](_0xafe7('0x58'),''),_0x2d1bd2['id'])});break;default:logger['error'](_0xafe7('0x61'),_0xafe7('0x5a'));}}})[_0xafe7('0x5b')](function(_0x13e0e1){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xafe7('0x5d')](_0x13e0e1,{'showHidden':!![],'depth':null}));});};exports[_0xafe7('0x67')]=function(_0x2dd6a3,_0x43b631,_0x1edcc5,_0x346171,_0x1dd287,_0x44f38c){var _0x3f5e9a,_0x1d7a64;_0x44f38c[_0xafe7('0x18')]=intUtil[_0xafe7('0x45')](_0x44f38c[_0xafe7('0x18')]);_0x44f38c[_0xafe7('0x46')]=intUtil[_0xafe7('0x45')](_0x44f38c['serverUrl']);if(_0x1dd287&&_0x1dd287[_0xafe7('0x47')]){logger[_0xafe7('0xb')]('['+_0x43b631['lastevent']['toUpperCase']()+']',_0xafe7('0x49'));_0x43b631[_0xafe7('0x4a')]=util['format'](_0xafe7('0x62'),_0x44f38c['serverUrl'],_0x43b631[_0xafe7('0x4b')],md5(_0x43b631['uniqueid']));}else{_0x43b631[_0xafe7('0x4a')]='';}headers['Authorization']=getAuth(_0x44f38c);return getUser(_0x44f38c)[_0xafe7('0x13')](function(_0x1e105e){_0x3f5e9a=_0x1e105e;logger[_0xafe7('0xb')](_0xafe7('0x4d'),_0x3f5e9a['id']);return getEndUser(_0x44f38c,_0x43b631[_0xafe7('0x4e')],_0x43b631[_0xafe7('0x4f')]);})[_0xafe7('0x13')](function(_0x187a1d){_0x1d7a64=_0x187a1d;logger[_0xafe7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1d7a64['id']);return getTicket(_0x44f38c,_0x3f5e9a,_0x1d7a64,_0x1edcc5,_0x43b631);})[_0xafe7('0x13')](function(_0x5ee886){if(_0x5ee886){logger[_0xafe7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x5ee886['id']);}})[_0xafe7('0x5b')](function(_0x27c6ff){logger['error']('['+_0x43b631[_0xafe7('0x68')][_0xafe7('0x69')]()+']'+_0xafe7('0x6a'),util[_0xafe7('0x5d')](_0x27c6ff,{'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 b56aaea..54cc68c 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 _0x628a=['defaults','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','refreshToken','clientId','clientSecret','refresh_token','then','add','expires_in','catch','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','startCase','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','Contacts','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Creating\x20new\x20call...','Owner','profile','administrator','Subject','getString','Subjects','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','rejected','Rejected','timeout','Timeout','outbound','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','email','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','https://crm.','/crm/EntityInfo.do?module=Calls&id=','toUpperCase','lodash','request-promise','util','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x628a,0x1bb));var _0xa628=function(_0x5c2f8b,_0x44d93e){_0x5c2f8b=_0x5c2f8b-0x0;var _0xc143a4=_0x628a[_0x5c2f8b];return _0xc143a4;};'use strict';var _=require(_0xa628('0x0'));var rp=require(_0xa628('0x1'));var md5=require('md5');var util=require(_0xa628('0x2'));var intUtil=require(_0xa628('0x3'));var moment=require(_0xa628('0x4'));var Redis=require(_0xa628('0x5'));var BPromise=require(_0xa628('0x6'));var config=require(_0xa628('0x7'));var logger=require('../../../../config/logger')(_0xa628('0x8'));config[_0xa628('0x9')]=_[_0xa628('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa628('0xb'))(new Redis(config[_0xa628('0x9')]));function emit(_0x1024eb,_0x21d8a8,_0x40f0ad){io['to'](_0x1024eb)[_0xa628('0xc')](_0x21d8a8,_0x40f0ad);}function request(_0x2ec8b3){logger['debug'](_0xa628('0xd'),JSON[_0xa628('0xe')](_0x2ec8b3));return rp(_0x2ec8b3);}function getCustomFields(_0x1577d6,_0x58f628){var _0x2c4c69={};if(_0x1577d6[_0xa628('0xf')]>0x0){_[_0xa628('0x10')](_0x1577d6,function(_0x538816){if(_['includes']([_0xa628('0x11'),_0xa628('0x12')],_0x538816[_0xa628('0x13')])&&_0x538816['idField']){_0x2c4c69[_0x538816[_0xa628('0x14')]]=_0x538816['content'][_0xa628('0x15')]();}else if(_0x538816['type']===_0xa628('0x16')&&_0x538816[_0xa628('0x17')]&&_0x538816['idField']&&_0x58f628[_0x538816[_0xa628('0x17')]]){_0x2c4c69[_0x538816[_0xa628('0x14')]]=_0x58f628[_0x538816[_0xa628('0x17')]][_0xa628('0x15')]();}else if(_0x538816[_0xa628('0x13')]===_0xa628('0x18')&&_0x538816[_0xa628('0x19')]&&_0x538816['Variable'][_0xa628('0x1a')]&&_0x538816[_0xa628('0x14')]&&_0x58f628[_0x538816[_0xa628('0x19')][_0xa628('0x1a')][_0xa628('0x1b')]()]){_0x2c4c69[_0x538816[_0xa628('0x14')]]=_0x58f628[_0x538816[_0xa628('0x19')][_0xa628('0x1a')][_0xa628('0x1b')]()][_0xa628('0x15')]();}});}return _0x2c4c69;}function getName(_0x39d617){if(_0x39d617['indexOf']('\x20')>0x0){var _0x147aae=_0x39d617[_0xa628('0x1c')](/ (.+)/);if(_0x147aae[0x1]){return _0x147aae;}}return[_0x39d617,_0x39d617];}var accountsTokens={};function getAccessToken(_0x540a22){return new Promise(function(_0x5c4e94,_0x207d08){if(!_[_0xa628('0x1d')](accountsTokens[_0x540a22['id']])&&!_[_0xa628('0x1d')](accountsTokens[_0x540a22['id']][_0xa628('0x1e')])){if(moment()[_0xa628('0x1f')](accountsTokens[_0x540a22['id']]['expires_in'])){_0x5c4e94(accountsTokens[_0x540a22['id']][_0xa628('0x1e')]);}}var _0x879b2;switch(_0x540a22[_0xa628('0x20')]){case'US':_0x879b2=_0xa628('0x21');break;case'AU':_0x879b2=_0xa628('0x22');break;case'EU':_0x879b2='https://accounts.zoho.eu';break;case'IN':_0x879b2=_0xa628('0x23');break;case'CN':_0x879b2=_0xa628('0x24');break;default:_0x879b2=_0xa628('0x25');break;}var _0x36dfca={'method':_0xa628('0x26'),'uri':_0x879b2+'/oauth/v2/token','qs':{'refresh_token':_0x540a22[_0xa628('0x27')],'client_id':_0x540a22[_0xa628('0x28')],'client_secret':_0x540a22[_0xa628('0x29')],'grant_type':_0xa628('0x2a')},'json':!![]};return rp(_0x36dfca)[_0xa628('0x2b')](function(_0x5364f6){accountsTokens[_0x540a22['id']]={'access_token':_0x5364f6[_0xa628('0x1e')],'expires_in':moment()[_0xa628('0x2c')](_0x5364f6[_0xa628('0x2d')],'seconds')};_0x5c4e94(_0x5364f6['access_token']);})[_0xa628('0x2e')](function(_0x25bae0){logger[_0xa628('0x2f')]('Failing\x20creating\x20the\x20access_token',_0x25bae0[_0xa628('0x30')]);_0x207d08(_0x25bae0);});});}function getUser(_0x158fef,_0x1eb962,_0x309ba0,_0x1a5c16){logger[_0xa628('0x31')](_0xa628('0x32'));return request({'method':_0xa628('0x33'),'uri':util[_0xa628('0x34')](_0xa628('0x35'),_0x1eb962),'qs':{'type':_0xa628('0x36')},'headers':{'Authorization':_0xa628('0x37')+_0x158fef},'json':!![]})[_0xa628('0x2b')](function(_0x496b1e){if(_0x496b1e[_0xa628('0x38')]){var _0x12c1bb=-0x1;if(_['isArrayLikeObject'](_0x496b1e[_0xa628('0x38')])){if(!_['isNil'](_0x1a5c16)){_0x12c1bb=_[_0xa628('0x39')](_0x496b1e['users'],function(_0x56c7ef){return _0x56c7ef['email']===_0x1a5c16;});}if(_0x12c1bb>=0x0){logger[_0xa628('0x31')](_0xa628('0x3a'));}else{logger[_0xa628('0x31')](_0xa628('0x3b'));_0x12c1bb=_['findIndex'](_0x496b1e['users'],function(_0x112391){return _0x112391['profile']['name']==='Administrator';});}return _0x496b1e['users'][_0x12c1bb];}else{if(_0x496b1e[_0xa628('0x3c')]['profile']['name']===_0xa628('0x3d')){logger[_0xa628('0x31')](_0xa628('0x3b'));user=_0x496b1e[_0xa628('0x3c')];return user;}else{logger[_0xa628('0x2f')](_0xa628('0x3e'),JSON[_0xa628('0xe')](_0x496b1e));throw new Error(_0xa628('0x3f')+JSON[_0xa628('0xe')](_0x496b1e));}}}else{logger[_0xa628('0x2f')]('The\x20failing\x20result\x20is',JSON[_0xa628('0xe')](_0x496b1e));throw new Error(_0xa628('0x3f')+JSON[_0xa628('0xe')](_0x496b1e));}})[_0xa628('0x2e')](function(_0x1bc192){console[_0xa628('0x2f')](_0x1bc192);});}function getZohoUser(_0x2234bc,_0x2d2b92){return new BPromise(function(_0x44b056,_0x2ff66d){request(_0x2234bc)[_0xa628('0x2b')](function(_0x215dbe){var _0x1330cb=null;if(_0x215dbe){_0x1330cb=_0x215dbe[_0xa628('0x40')][0x0];_0x1330cb[_0xa628('0x41')]=_0x2d2b92;}_0x44b056(_0x1330cb);})[_0xa628('0x2e')](function(_0x2ac458){_0x2ff66d(_0x2ac458);});});}function createEndUser(_0x562ac7,_0x275540,_0x5b05ec,_0x5b8a0c,_0x2f5554,_0x7edd20){var _0x5b05ec=getName(_0x5b05ec);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x275540+_0xa628('0x42')+_['startCase'](_0x7edd20[_0xa628('0x43')])+'s','body':{'data':[{'Last_Name':_0x5b05ec[0x1],'First_Name':_0x5b05ec[0x0],'Phone':_0x5b8a0c,'Owner':{'name':!_[_0xa628('0x1d')](_0x2f5554[_0xa628('0x44')]['name'])?_0x2f5554[_0xa628('0x44')][_0xa628('0x1a')]:!_[_0xa628('0x1d')](_0x2f5554[_0xa628('0x45')])?_0x2f5554[_0xa628('0x45')]+'\x20'+_0x2f5554['last_name']:_0x2f5554[_0xa628('0x46')],'id':_0x2f5554['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x562ac7},'json':!![]})[_0xa628('0x2b')](function(_0x307349){if(_0x307349&&_0x307349['data'][0x0][_0xa628('0x47')]===_0xa628('0x48')){var _0x413362=_0x307349[_0xa628('0x40')][0x0][_0xa628('0x49')];_0x413362[_0xa628('0x41')]=_[_0xa628('0x4a')](_0x7edd20['moduleCreate'])+'s';return _0x413362;}logger[_0xa628('0x2f')](_0xa628('0x3e'),JSON[_0xa628('0xe')](data));throw new Error(_0xa628('0x4b')+JSON[_0xa628('0xe')](data));})[_0xa628('0x2e')](function(_0x4c4e74){console[_0xa628('0x4c')](_0xa628('0x4d'),_0x4c4e74);});}function getEndUser(_0xdcbb9a,_0x331fdc,_0x1e16b7,_0x518031,_0x5da970,_0x2d4f8a,_0x6c5a1c){var _0x4917c7={'method':_0xa628('0x33'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xdcbb9a},'json':!![]};switch(_0x6c5a1c[_0xa628('0x4e')]){case _0xa628('0x4f'):_0x4917c7[_0xa628('0x50')]='https://www.zohoapis.'+_0x331fdc+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x5da970+'))';return getZohoUser(_0x4917c7,_0xa628('0x51'))['then'](function(_0x2894db){if(_0x2894db)return _0x2894db;_0x4917c7['uri']=_0xa628('0x52')+_0x331fdc+_0xa628('0x53')+_0x5da970+'))';return getZohoUser(_0x4917c7,_0xa628('0x54'))[_0xa628('0x2b')](function(_0x4753ea){if(_0x4753ea)return _0x4753ea;if(_0x6c5a1c['moduleCreate']!=_0xa628('0x55')){return createEndUser(_0xdcbb9a,_0x331fdc,_0x518031,_0x5da970,_0x2d4f8a,_0x6c5a1c);}else{return{};}});});break;case _0xa628('0x56'):_0x4917c7[_0xa628('0x50')]=_0xa628('0x52')+_0x331fdc+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x5da970+'))';return getZohoUser(_0x4917c7,'Contacts')['then'](function(_0x5708d9){if(_0x5708d9)return _0x5708d9;if(_0x6c5a1c['moduleCreate']!=_0xa628('0x55')){return createEndUser(_0xdcbb9a,_0x331fdc,_0x518031,_0x5da970,_0x2d4f8a,_0x6c5a1c);}else{return{};}});break;case'lead':_0x4917c7[_0xa628('0x50')]=_0xa628('0x52')+_0x331fdc+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x5da970+'))';return getZohoUser(_0x4917c7,_0xa628('0x54'))[_0xa628('0x2b')](function(_0x5257f6){if(_0x5257f6)return _0x5257f6;if(_0x6c5a1c[_0xa628('0x43')]!=_0xa628('0x55')){return createEndUser(_0xdcbb9a,_0x331fdc,_0x518031,_0x5da970,_0x2d4f8a,_0x6c5a1c);}else{return{};}});break;}}function getCall(_0x5e71ed,_0x19124e,_0x383fa3,_0x325c2,_0x5a22a3,_0x331a24,_0x4f6c80,_0x24ae21){logger[_0xa628('0x31')](_0xa628('0x57'));var _0x4298a5={};_0x4298a5[_0xa628('0x58')]={'name':!_[_0xa628('0x1d')](_0x325c2[_0xa628('0x44')][_0xa628('0x1a')])&&!_['isNil'](_0x325c2['profile'][_0xa628('0x1a')])&&_0x325c2[_0xa628('0x59')][_0xa628('0x1a')]===_0xa628('0x5a')?_0x325c2[_0xa628('0x44')][_0xa628('0x1a')]:!_['isNil'](_0x325c2['first_name'])?_0x325c2[_0xa628('0x45')]+'\x20'+_0x325c2[_0xa628('0x46')]:_0x325c2['last_name'],'id':_0x325c2['id']};_0x4298a5[_0xa628('0x5b')]=intUtil[_0xa628('0x5c')](_0x331a24[_0xa628('0x5d')],_0x4f6c80,'\x20');_0x4298a5['Description']=intUtil[_0xa628('0x5c')](_0x331a24['Descriptions'],_0x4f6c80,'\x0a');if(_0x5a22a3[_0xa628('0x41')]==='Contacts'){_0x4298a5[_0xa628('0x5e')]={'name':!_[_0xa628('0x1d')](_0x5a22a3[_0xa628('0x5f')])?_0x5a22a3[_0xa628('0x5f')]:!_['isNil'](_0x5a22a3[_0xa628('0x60')])?_0x5a22a3[_0xa628('0x60')]+'\x20'+_0x5a22a3[_0xa628('0x61')]:_0x5a22a3['Last_Name'],'id':_0x5a22a3['id']};}if(_0x5a22a3[_0xa628('0x41')]===_0xa628('0x54')){_0x4298a5[_0xa628('0x62')]={'name':!_[_0xa628('0x1d')](_0x5a22a3[_0xa628('0x5f')])?_0x5a22a3[_0xa628('0x5f')]:!_[_0xa628('0x1d')](_0x5a22a3[_0xa628('0x60')])?_0x5a22a3[_0xa628('0x60')]+'\x20'+_0x5a22a3[_0xa628('0x61')]:_0x5a22a3['Last_Name'],'id':_0x5a22a3['id']};_0x4298a5['$se_module']=_['startCase'](_0x5a22a3[_0xa628('0x41')]);}if(_0x4f6c80[_0xa628('0x63')]){_0x4298a5[_0xa628('0x64')]=moment[_0xa628('0x65')](parseInt(_0x4f6c80['talktime'])*0x3e8)[_0xa628('0x34')](_0xa628('0x66'));}else if(_0x4f6c80['answertime']&&_0x4f6c80[_0xa628('0x67')]){_0x4298a5[_0xa628('0x64')]=moment[_0xa628('0x65')](moment(_0x4f6c80[_0xa628('0x67')],_0xa628('0x68'))[_0xa628('0x69')](moment(_0x4f6c80[_0xa628('0x6a')],_0xa628('0x68'))))['format'](_0xa628('0x66'));}switch(_0x4f6c80[_0xa628('0x6b')]){case _0xa628('0x6c'):_0x4298a5[_0xa628('0x6d')]=_0xa628('0x6e');break;case _0xa628('0x6f'):case _0xa628('0x70'):_0x4298a5[_0xa628('0x6d')]='Answered';break;case _0xa628('0x71'):_0x4298a5['Call_Result']=_0xa628('0x72');break;case'abandoned':_0x4298a5[_0xa628('0x6d')]='Abandoned';break;case _0xa628('0x73'):_0x4298a5[_0xa628('0x6d')]=_0xa628('0x74');default:}_0x4298a5['Call_Start_Time']=(_0x24ae21===_0xa628('0x75')?moment(_0x4f6c80[_0xa628('0x6a')])['format'](_0xa628('0x68')):moment(_0x4f6c80['agentcalledAt'])[_0xa628('0x34')](_0xa628('0x68')))||moment()[_0xa628('0x34')]('YYYY-MM-DDTHH:mm:ss');_0x4298a5[_0xa628('0x76')]=_0x24ae21||_0xa628('0x77');_0x4298a5=_[_0xa628('0x78')](_0x4298a5,getCustomFields(_0x331a24[_0xa628('0x79')],_0x4f6c80));return request({'method':_0xa628('0x26'),'uri':_0xa628('0x52')+_0x19124e+_0xa628('0x7a'),'headers':{'Authorization':_0xa628('0x37')+_0x5e71ed},'body':{'data':[_0x4298a5]},'json':!![]})[_0xa628('0x2b')](function(_0x43cb93){if(_0x43cb93&&_0x43cb93['data'][0x0][_0xa628('0x47')]===_0xa628('0x48')){logger[_0xa628('0x31')](_0xa628('0x7b'));return{'id':_0x43cb93[_0xa628('0x40')][0x0][_0xa628('0x49')]['id']};}})[_0xa628('0x2e')](function(_0x3b236a){logger['info'](_0xa628('0x7c'),_0x3b236a[_0xa628('0x30')]);console[_0xa628('0x4c')](_0xa628('0x7c'),_0x3b236a);});}exports[_0xa628('0x7d')]=function(_0x504946,_0x175632,_0x136c4b,_0x3fdfbd,_0xc90ce9,_0x5372d4){var _0x5845dc,_0x2bf7a5,_0x4507a1;_0x5372d4[_0xa628('0x7e')]=intUtil[_0xa628('0x7f')](_0x5372d4[_0xa628('0x7e')]);_0x5372d4[_0xa628('0x80')]=intUtil[_0xa628('0x7f')](_0x5372d4[_0xa628('0x80')]);if(_0xc90ce9&&_0xc90ce9[_0xa628('0x81')]){logger[_0xa628('0x31')](_0xa628('0x82'),'Recording\x20is\x20enabled!');_0x175632[_0xa628('0x83')]=_0x5372d4[_0xa628('0x80')]+_0xa628('0x84')+_0x175632['uniqueid']+_0xa628('0x85')+md5(_0x175632[_0xa628('0x86')]);}else{_0x175632[_0xa628('0x83')]='';}var _0x7b17bc=_0x5372d4[_0xa628('0x7e')]===_0xa628('0x87')?'eu':_0xa628('0x88');return getAccessToken(_0x5372d4)[_0xa628('0x2b')](function(_0x5823be){_0x4507a1=_0x5823be;return getUser(_0x4507a1,_0x7b17bc,_0x5372d4,_0x3fdfbd[_0xa628('0x89')]);})[_0xa628('0x2b')](function(_0x1612f8){_0x5845dc=_0x1612f8;logger['info']('The\x20User\x20ID\x20is:',_0x5845dc['id']);return getEndUser(_0x4507a1,_0x7b17bc,_0x5372d4,_0x175632[_0xa628('0x8a')],_0x175632[_0xa628('0x8b')],_0x5845dc,_0x136c4b);})[_0xa628('0x2b')](function(_0x1138b2){_0x2bf7a5=_0x1138b2;return getCall(_0x4507a1,_0x7b17bc,_0x5372d4,_0x5845dc,_0x2bf7a5,_0x136c4b,_0x175632,_0xa628('0x77'));})[_0xa628('0x2b')](function(_0x2ed1a3){if(_0x2ed1a3){logger[_0xa628('0x31')](_0xa628('0x8c'),_0x2ed1a3['id']);logger[_0xa628('0x31')](_0xa628('0x82'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xa628('0x8d'),_0x3fdfbd['name']),'trigger:browser:url',{'uri':'https://crm.'+_0x5372d4['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x2ed1a3['id']});}})[_0xa628('0x2e')](function(_0x2c7bac){logger[_0xa628('0x2f')]('[QUEUE]',JSON['stringify'](_0x2c7bac));});};exports['outbound']=function(_0x526f28,_0x10646a,_0x275813,_0x928cf8,_0x5da35d,_0x23ff82,_0x4502e3){var _0x175515,_0xb2f36e,_0x552eb2;_0x23ff82[_0xa628('0x7e')]=intUtil[_0xa628('0x7f')](_0x23ff82['host']);_0x23ff82['serverUrl']=intUtil['stripTrailingSlash'](_0x23ff82[_0xa628('0x80')]);if(_0x4502e3&&_0x4502e3[_0xa628('0x8e')]&&_0x4502e3[_0xa628('0x8e')]!=='none'){logger[_0xa628('0x31')](_0xa628('0x8f'),_0xa628('0x90'));_0x10646a[_0xa628('0x83')]=_0x23ff82[_0xa628('0x80')]+'/api/voice/recordings/'+_0x10646a[_0xa628('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x10646a[_0xa628('0x86')]);}var _0x3a4c0f=_0x23ff82[_0xa628('0x7e')]===_0xa628('0x87')?'eu':_0xa628('0x88');return getAccessToken(_0x23ff82)[_0xa628('0x2b')](function(_0x3ead53){_0x552eb2=_0x3ead53;return getUser(_0x552eb2,_0x3a4c0f,_0x23ff82,_0x928cf8[_0xa628('0x89')]);})[_0xa628('0x2b')](function(_0x131995){_0x175515=_0x131995;logger['info'](_0xa628('0x91'),_0x175515['id']);return getEndUser(_0x552eb2,_0x3a4c0f,_0x23ff82,_0x10646a[_0xa628('0x92')],_0x10646a[_0xa628('0x93')],_0x175515,_0x275813);})[_0xa628('0x2b')](function(_0x19965a){_0xb2f36e=_0x19965a;return getCall(_0x552eb2,_0x3a4c0f,_0x23ff82,_0x175515,_0xb2f36e,_0x275813,_0x10646a,'Outbound');})['then'](function(_0x206672){if(_0x206672){logger[_0xa628('0x31')]('The\x20Call\x20ID\x20is:',_0x206672['id']);logger[_0xa628('0x31')](_0xa628('0x8f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xa628('0x8d'),_0x928cf8[_0xa628('0x1a')]),'trigger:browser:url',{'uri':_0xa628('0x94')+_0x23ff82[_0xa628('0x7e')]+_0xa628('0x95')+_0x206672['id']});}})['catch'](function(_0x4bdeca){logger[_0xa628('0x2f')](_0xa628('0x8f'),JSON[_0xa628('0xe')](_0x4bdeca));});};exports['unmanaged']=function(_0x18b1f7,_0x2ea1cb,_0x2653d3,_0x55ee27,_0x3fbcc8,_0x4b1a78){var _0x167ee8,_0x5131eb,_0xcdffce;_0x4b1a78['host']=intUtil[_0xa628('0x7f')](_0x4b1a78[_0xa628('0x7e')]);_0x4b1a78[_0xa628('0x80')]=intUtil['stripTrailingSlash'](_0x4b1a78[_0xa628('0x80')]);if(_0x3fbcc8&&_0x3fbcc8[_0xa628('0x81')]){logger[_0xa628('0x31')]('['+_0x2ea1cb[_0xa628('0x6b')][_0xa628('0x96')]()+']','Recording\x20is\x20enabled!');_0x2ea1cb[_0xa628('0x83')]=_0x4b1a78['serverUrl']+_0xa628('0x84')+_0x2ea1cb['uniqueid']+_0xa628('0x85')+md5(_0x2ea1cb[_0xa628('0x86')]);}else{_0x2ea1cb[_0xa628('0x83')]='';}var _0x1335c5=_0x4b1a78[_0xa628('0x7e')]===_0xa628('0x87')?'eu':_0xa628('0x88');return getAccessToken(_0x4b1a78)['then'](function(_0xa4b7c5){_0xcdffce=_0xa4b7c5;return getUser(_0xcdffce,_0x1335c5,_0x4b1a78);})[_0xa628('0x2b')](function(_0x522e89){_0x167ee8=_0x522e89;logger[_0xa628('0x31')](_0xa628('0x91'),_0x167ee8['id']);return getEndUser(_0xcdffce,_0x1335c5,_0x4b1a78,_0x2ea1cb[_0xa628('0x8a')],_0x2ea1cb[_0xa628('0x8b')],_0x167ee8,_0x2653d3);})['then'](function(_0x2dd6eb){_0x5131eb=_0x2dd6eb;return getCall(_0xcdffce,_0x1335c5,_0x4b1a78,_0x167ee8,_0x5131eb,_0x2653d3,_0x2ea1cb,_0xa628('0x77'));})[_0xa628('0x2b')](function(_0x347362){if(_0x347362){logger[_0xa628('0x31')]('The\x20Call\x20ID\x20is:',_0x347362['id']);}})['catch'](function(_0x4fffce){logger[_0xa628('0x2f')]('['+_0x2ea1cb[_0xa628('0x6b')][_0xa628('0x96')]()+']',JSON[_0xa628('0xe')](_0x4fffce));});}; \ No newline at end of file +var _0x9179=['monitor_format','[QUEUE]','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','calleridname','calleridnum','user:%s','trigger:browser:url','host','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','zoho.eu','The\x20User\x20ID\x20is:','destcalleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','unmanaged','toUpperCase','Recording\x20is\x20enabled!','recordingURL','lodash','request-promise','md5','util','moment','ioredis','redis','defaults','localhost','emit','stringify','includes','string','idField','content','toString','variable','variableName','type','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','refreshToken','clientId','refresh_token','add','seconds','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','Administrator','user','profile','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','catch','POST','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','enduserType','startCase','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','administrator','Subject','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','diff','YYYY-MM-DDTHH:mm:ss','lastevent','Call_Result','complete','connect','Answered','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','log','err','stripTrailingSlash','serverUrl'];(function(_0x499270,_0x8ab14f){var _0x38f12e=function(_0x162086){while(--_0x162086){_0x499270['push'](_0x499270['shift']());}};_0x38f12e(++_0x8ab14f);}(_0x9179,0x1d2));var _0x9917=function(_0x5d5ea3,_0x3d2c62){_0x5d5ea3=_0x5d5ea3-0x0;var _0x564782=_0x9179[_0x5d5ea3];return _0x564782;};'use strict';var _=require(_0x9917('0x0'));var rp=require(_0x9917('0x1'));var md5=require(_0x9917('0x2'));var util=require(_0x9917('0x3'));var intUtil=require('./util');var moment=require(_0x9917('0x4'));var Redis=require(_0x9917('0x5'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('zoho');config[_0x9917('0x6')]=_[_0x9917('0x7')](config['redis'],{'host':_0x9917('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5b4575,_0x55cbfd,_0x490bfd){io['to'](_0x5b4575)[_0x9917('0x9')](_0x55cbfd,_0x490bfd);}function request(_0x7b5970){logger['debug']('[HTTP]',JSON[_0x9917('0xa')](_0x7b5970));return rp(_0x7b5970);}function getCustomFields(_0x491017,_0x489d91){var _0x184e9e={};if(_0x491017['length']>0x0){_['forEach'](_0x491017,function(_0x2292ad){if(_[_0x9917('0xb')]([_0x9917('0xc'),'picklist'],_0x2292ad['type'])&&_0x2292ad[_0x9917('0xd')]){_0x184e9e[_0x2292ad[_0x9917('0xd')]]=_0x2292ad[_0x9917('0xe')][_0x9917('0xf')]();}else if(_0x2292ad['type']===_0x9917('0x10')&&_0x2292ad[_0x9917('0x11')]&&_0x2292ad[_0x9917('0xd')]&&_0x489d91[_0x2292ad[_0x9917('0x11')]]){_0x184e9e[_0x2292ad[_0x9917('0xd')]]=_0x489d91[_0x2292ad[_0x9917('0x11')]][_0x9917('0xf')]();}else if(_0x2292ad[_0x9917('0x12')]==='customVariable'&&_0x2292ad[_0x9917('0x13')]&&_0x2292ad[_0x9917('0x13')][_0x9917('0x14')]&&_0x2292ad[_0x9917('0xd')]&&_0x489d91[_0x2292ad[_0x9917('0x13')][_0x9917('0x14')]['toLowerCase']()]){_0x184e9e[_0x2292ad[_0x9917('0xd')]]=_0x489d91[_0x2292ad[_0x9917('0x13')][_0x9917('0x14')][_0x9917('0x15')]()][_0x9917('0xf')]();}});}return _0x184e9e;}function getName(_0x55e7bc){if(_0x55e7bc[_0x9917('0x16')]('\x20')>0x0){var _0x2496cf=_0x55e7bc['split'](/ (.+)/);if(_0x2496cf[0x1]){return _0x2496cf;}}return[_0x55e7bc,_0x55e7bc];}var accountsTokens={};function getAccessToken(_0x461201){return new Promise(function(_0x210ceb,_0x48cf95){if(!_[_0x9917('0x17')](accountsTokens[_0x461201['id']])&&!_[_0x9917('0x17')](accountsTokens[_0x461201['id']][_0x9917('0x18')])){if(moment()[_0x9917('0x19')](accountsTokens[_0x461201['id']][_0x9917('0x1a')])){_0x210ceb(accountsTokens[_0x461201['id']]['access_token']);}}var _0x25f0e7;switch(_0x461201[_0x9917('0x1b')]){case'US':_0x25f0e7=_0x9917('0x1c');break;case'AU':_0x25f0e7='https://accounts.zoho.com.au';break;case'EU':_0x25f0e7=_0x9917('0x1d');break;case'IN':_0x25f0e7=_0x9917('0x1e');break;case'CN':_0x25f0e7='https://accounts.zoho.com.cn';break;default:_0x25f0e7='https://accounts.zoho.eu';break;}var _0x26cb7e={'method':'POST','uri':_0x25f0e7+'/oauth/v2/token','qs':{'refresh_token':_0x461201[_0x9917('0x1f')],'client_id':_0x461201[_0x9917('0x20')],'client_secret':_0x461201['clientSecret'],'grant_type':_0x9917('0x21')},'json':!![]};return rp(_0x26cb7e)['then'](function(_0x3c2023){accountsTokens[_0x461201['id']]={'access_token':_0x3c2023['access_token'],'expires_in':moment()[_0x9917('0x22')](_0x3c2023[_0x9917('0x1a')],_0x9917('0x23'))};_0x210ceb(_0x3c2023[_0x9917('0x18')]);})['catch'](function(_0xca6ba){logger['error'](_0x9917('0x24'),_0xca6ba[_0x9917('0x25')]);_0x48cf95(_0xca6ba);});});}function getUser(_0x22467c,_0x2bfbf5,_0x224b99,_0x2d6d33){logger[_0x9917('0x26')](_0x9917('0x27'));return request({'method':_0x9917('0x28'),'uri':util[_0x9917('0x29')](_0x9917('0x2a'),_0x2bfbf5),'qs':{'type':_0x9917('0x2b')},'headers':{'Authorization':_0x9917('0x2c')+_0x22467c},'json':!![]})[_0x9917('0x2d')](function(_0xaec7e0){if(_0xaec7e0[_0x9917('0x2e')]){var _0x15ed78=-0x1;if(_['isArrayLikeObject'](_0xaec7e0[_0x9917('0x2e')])){if(!_[_0x9917('0x17')](_0x2d6d33)){_0x15ed78=_['findIndex'](_0xaec7e0[_0x9917('0x2e')],function(_0x229e2f){return _0x229e2f[_0x9917('0x2f')]===_0x2d6d33;});}if(_0x15ed78>=0x0){logger[_0x9917('0x26')](_0x9917('0x30'));}else{logger['info'](_0x9917('0x31'));_0x15ed78=_[_0x9917('0x32')](_0xaec7e0[_0x9917('0x2e')],function(_0x4e7289){return _0x4e7289['profile'][_0x9917('0x14')]===_0x9917('0x33');});}return _0xaec7e0['users'][_0x15ed78];}else{if(_0xaec7e0[_0x9917('0x34')][_0x9917('0x35')]['name']===_0x9917('0x33')){logger['info'](_0x9917('0x31'));user=_0xaec7e0[_0x9917('0x34')];return user;}else{logger[_0x9917('0x36')](_0x9917('0x37'),JSON[_0x9917('0xa')](_0xaec7e0));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x9917('0xa')](_0xaec7e0));}}}else{logger[_0x9917('0x36')]('The\x20failing\x20result\x20is',JSON[_0x9917('0xa')](_0xaec7e0));throw new Error(_0x9917('0x38')+JSON[_0x9917('0xa')](_0xaec7e0));}})['catch'](function(_0x5dc6d2){console['error'](_0x5dc6d2);});}function getZohoUser(_0x4f2959,_0x306df7){return new BPromise(function(_0x1ab192,_0x2d7f54){request(_0x4f2959)['then'](function(_0x230e61){var _0x79b5d7=null;if(_0x230e61){_0x79b5d7=_0x230e61[_0x9917('0x39')][0x0];_0x79b5d7['enduserType']=_0x306df7;}_0x1ab192(_0x79b5d7);})[_0x9917('0x3a')](function(_0xa33159){_0x2d7f54(_0xa33159);});});}function createEndUser(_0x5c3691,_0x269e10,_0x59eee6,_0x500c6e,_0xda5cd1,_0x12a5d5){var _0x59eee6=getName(_0x59eee6);return request({'method':_0x9917('0x3b'),'uri':_0x9917('0x3c')+_0x269e10+_0x9917('0x3d')+_['startCase'](_0x12a5d5[_0x9917('0x3e')])+'s','body':{'data':[{'Last_Name':_0x59eee6[0x1],'First_Name':_0x59eee6[0x0],'Phone':_0x500c6e,'Owner':{'name':!_[_0x9917('0x17')](_0xda5cd1[_0x9917('0x3f')][_0x9917('0x14')])?_0xda5cd1['role'][_0x9917('0x14')]:!_[_0x9917('0x17')](_0xda5cd1[_0x9917('0x40')])?_0xda5cd1['first_name']+'\x20'+_0xda5cd1[_0x9917('0x41')]:_0xda5cd1[_0x9917('0x41')],'id':_0xda5cd1['id']}}]},'headers':{'Authorization':_0x9917('0x2c')+_0x5c3691},'json':!![]})[_0x9917('0x2d')](function(_0x283742){if(_0x283742&&_0x283742[_0x9917('0x39')][0x0][_0x9917('0x42')]===_0x9917('0x43')){var _0x23e364=_0x283742[_0x9917('0x39')][0x0][_0x9917('0x44')];_0x23e364[_0x9917('0x45')]=_[_0x9917('0x46')](_0x12a5d5[_0x9917('0x3e')])+'s';return _0x23e364;}logger[_0x9917('0x36')]('The\x20failing\x20result\x20is',JSON[_0x9917('0xa')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0x9917('0x3a')](function(_0x4089eb){console['log'](_0x9917('0x47'),_0x4089eb);});}function getEndUser(_0xdf0066,_0x1c0ce1,_0x5e4567,_0x2cc391,_0x2888bc,_0x16f69a,_0xcbe9da){var _0x446d96={'method':_0x9917('0x28'),'uri':'','headers':{'Authorization':_0x9917('0x2c')+_0xdf0066},'json':!![]};switch(_0xcbe9da['moduleSearch']){case _0x9917('0x48'):_0x446d96[_0x9917('0x49')]=_0x9917('0x3c')+_0x1c0ce1+_0x9917('0x4a')+_0x2888bc+'))';return getZohoUser(_0x446d96,_0x9917('0x4b'))['then'](function(_0x314063){if(_0x314063)return _0x314063;_0x446d96[_0x9917('0x49')]=_0x9917('0x3c')+_0x1c0ce1+_0x9917('0x4c')+_0x2888bc+'))';return getZohoUser(_0x446d96,_0x9917('0x4d'))[_0x9917('0x2d')](function(_0x15e443){if(_0x15e443)return _0x15e443;if(_0xcbe9da['moduleCreate']!=_0x9917('0x4e')){return createEndUser(_0xdf0066,_0x1c0ce1,_0x2cc391,_0x2888bc,_0x16f69a,_0xcbe9da);}else{return{};}});});break;case _0x9917('0x4f'):_0x446d96[_0x9917('0x49')]=_0x9917('0x3c')+_0x1c0ce1+_0x9917('0x4a')+_0x2888bc+'))';return getZohoUser(_0x446d96,_0x9917('0x4b'))[_0x9917('0x2d')](function(_0x571bef){if(_0x571bef)return _0x571bef;if(_0xcbe9da[_0x9917('0x3e')]!='nothing'){return createEndUser(_0xdf0066,_0x1c0ce1,_0x2cc391,_0x2888bc,_0x16f69a,_0xcbe9da);}else{return{};}});break;case _0x9917('0x50'):_0x446d96[_0x9917('0x49')]='https://www.zohoapis.'+_0x1c0ce1+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2888bc+'))';return getZohoUser(_0x446d96,'Leads')[_0x9917('0x2d')](function(_0x13e95f){if(_0x13e95f)return _0x13e95f;if(_0xcbe9da[_0x9917('0x3e')]!=_0x9917('0x4e')){return createEndUser(_0xdf0066,_0x1c0ce1,_0x2cc391,_0x2888bc,_0x16f69a,_0xcbe9da);}else{return{};}});break;}}function getCall(_0x1c9b52,_0x57ec60,_0xe44de8,_0x3e9d97,_0x2f4e8e,_0x17a3e3,_0x19231d,_0x22beaa){logger['info']('Creating\x20new\x20call...');var _0x2433a3={};_0x2433a3['Owner']={'name':!_[_0x9917('0x17')](_0x3e9d97['role'][_0x9917('0x14')])&&!_[_0x9917('0x17')](_0x3e9d97[_0x9917('0x35')][_0x9917('0x14')])&&_0x3e9d97[_0x9917('0x35')][_0x9917('0x14')]===_0x9917('0x51')?_0x3e9d97[_0x9917('0x3f')][_0x9917('0x14')]:!_[_0x9917('0x17')](_0x3e9d97[_0x9917('0x40')])?_0x3e9d97[_0x9917('0x40')]+'\x20'+_0x3e9d97[_0x9917('0x41')]:_0x3e9d97[_0x9917('0x41')],'id':_0x3e9d97['id']};_0x2433a3[_0x9917('0x52')]=intUtil[_0x9917('0x53')](_0x17a3e3[_0x9917('0x54')],_0x19231d,'\x20');_0x2433a3[_0x9917('0x55')]=intUtil[_0x9917('0x53')](_0x17a3e3[_0x9917('0x56')],_0x19231d,'\x0a');if(_0x2f4e8e[_0x9917('0x45')]==='Contacts'){_0x2433a3['Who_Id']={'name':!_[_0x9917('0x17')](_0x2f4e8e[_0x9917('0x57')])?_0x2f4e8e[_0x9917('0x57')]:!_['isNil'](_0x2f4e8e['First_Name'])?_0x2f4e8e[_0x9917('0x58')]+'\x20'+_0x2f4e8e[_0x9917('0x59')]:_0x2f4e8e[_0x9917('0x59')],'id':_0x2f4e8e['id']};}if(_0x2f4e8e[_0x9917('0x45')]===_0x9917('0x4d')){_0x2433a3['What_Id']={'name':!_['isNil'](_0x2f4e8e['Full_Name'])?_0x2f4e8e['Full_Name']:!_[_0x9917('0x17')](_0x2f4e8e[_0x9917('0x58')])?_0x2f4e8e[_0x9917('0x58')]+'\x20'+_0x2f4e8e[_0x9917('0x59')]:_0x2f4e8e[_0x9917('0x59')],'id':_0x2f4e8e['id']};_0x2433a3[_0x9917('0x5a')]=_[_0x9917('0x46')](_0x2f4e8e[_0x9917('0x45')]);}if(_0x19231d[_0x9917('0x5b')]){_0x2433a3[_0x9917('0x5c')]=moment[_0x9917('0x5d')](parseInt(_0x19231d[_0x9917('0x5b')])*0x3e8)[_0x9917('0x29')](_0x9917('0x5e'));}else if(_0x19231d[_0x9917('0x5f')]&&_0x19231d[_0x9917('0x60')]){_0x2433a3[_0x9917('0x5c')]=moment['utc'](moment(_0x19231d[_0x9917('0x60')],'YYYY-MM-DDTHH:mm:ss')[_0x9917('0x61')](moment(_0x19231d['starttime'],_0x9917('0x62'))))['format'](_0x9917('0x5e'));}switch(_0x19231d[_0x9917('0x63')]){case'called':_0x2433a3[_0x9917('0x64')]='Called';break;case _0x9917('0x65'):case _0x9917('0x66'):_0x2433a3[_0x9917('0x64')]=_0x9917('0x67');break;case'rejected':_0x2433a3[_0x9917('0x64')]=_0x9917('0x68');break;case _0x9917('0x69'):_0x2433a3['Call_Result']=_0x9917('0x6a');break;case _0x9917('0x6b'):_0x2433a3['Call_Result']=_0x9917('0x6c');default:}_0x2433a3[_0x9917('0x6d')]=(_0x22beaa===_0x9917('0x6e')?moment(_0x19231d[_0x9917('0x6f')])[_0x9917('0x29')](_0x9917('0x62')):moment(_0x19231d[_0x9917('0x70')])[_0x9917('0x29')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x9917('0x29')]('YYYY-MM-DDTHH:mm:ss');_0x2433a3[_0x9917('0x71')]=_0x22beaa||_0x9917('0x72');_0x2433a3=_[_0x9917('0x73')](_0x2433a3,getCustomFields(_0x17a3e3[_0x9917('0x74')],_0x19231d));return request({'method':_0x9917('0x3b'),'uri':_0x9917('0x3c')+_0x57ec60+'/crm/v2/Calls','headers':{'Authorization':_0x9917('0x2c')+_0x1c9b52},'body':{'data':[_0x2433a3]},'json':!![]})[_0x9917('0x2d')](function(_0x5c0a73){if(_0x5c0a73&&_0x5c0a73[_0x9917('0x39')][0x0][_0x9917('0x42')]===_0x9917('0x43')){logger['info'](_0x9917('0x75'));return{'id':_0x5c0a73[_0x9917('0x39')][0x0][_0x9917('0x44')]['id']};}})['catch'](function(_0x2e2080){logger[_0x9917('0x26')]('err',_0x2e2080[_0x9917('0x25')]);console[_0x9917('0x76')](_0x9917('0x77'),_0x2e2080);});}exports['queue']=function(_0x573e84,_0x36e444,_0x39ec1e,_0xdcb9c6,_0x43031d,_0x58e4d7){var _0xa0489b,_0x4bb735,_0x2fa8e7;_0x58e4d7['host']=intUtil[_0x9917('0x78')](_0x58e4d7['host']);_0x58e4d7[_0x9917('0x79')]=intUtil['stripTrailingSlash'](_0x58e4d7[_0x9917('0x79')]);if(_0x43031d&&_0x43031d[_0x9917('0x7a')]){logger[_0x9917('0x26')](_0x9917('0x7b'),'Recording\x20is\x20enabled!');_0x36e444['recordingURL']=_0x58e4d7[_0x9917('0x79')]+_0x9917('0x7c')+_0x36e444[_0x9917('0x7d')]+_0x9917('0x7e')+md5(_0x36e444[_0x9917('0x7d')]);}else{_0x36e444['recordingURL']='';}var _0x349dbd=_0x58e4d7['host']==='zoho.eu'?'eu':_0x9917('0x7f');return getAccessToken(_0x58e4d7)[_0x9917('0x2d')](function(_0x5000f3){_0x2fa8e7=_0x5000f3;return getUser(_0x2fa8e7,_0x349dbd,_0x58e4d7,_0xdcb9c6['email']);})[_0x9917('0x2d')](function(_0x12c389){_0xa0489b=_0x12c389;logger['info']('The\x20User\x20ID\x20is:',_0xa0489b['id']);return getEndUser(_0x2fa8e7,_0x349dbd,_0x58e4d7,_0x36e444[_0x9917('0x80')],_0x36e444[_0x9917('0x81')],_0xa0489b,_0x39ec1e);})['then'](function(_0x15d67a){_0x4bb735=_0x15d67a;return getCall(_0x2fa8e7,_0x349dbd,_0x58e4d7,_0xa0489b,_0x4bb735,_0x39ec1e,_0x36e444,_0x9917('0x72'));})[_0x9917('0x2d')](function(_0xd316fd){if(_0xd316fd){logger['info']('The\x20Call\x20ID\x20is:',_0xd316fd['id']);logger['info'](_0x9917('0x7b'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9917('0x29')](_0x9917('0x82'),_0xdcb9c6[_0x9917('0x14')]),_0x9917('0x83'),{'uri':'https://crm.'+_0x58e4d7[_0x9917('0x84')]+_0x9917('0x85')+_0xd316fd['id']});}})[_0x9917('0x3a')](function(_0x202fe9){logger[_0x9917('0x36')](_0x9917('0x7b'),JSON[_0x9917('0xa')](_0x202fe9));});};exports[_0x9917('0x6e')]=function(_0xf07c74,_0x3947ca,_0x459716,_0x4566ea,_0x143865,_0x52e17b,_0x3db267){var _0x6b0433,_0x240baa,_0x210f51;_0x52e17b[_0x9917('0x84')]=intUtil[_0x9917('0x78')](_0x52e17b[_0x9917('0x84')]);_0x52e17b[_0x9917('0x79')]=intUtil[_0x9917('0x78')](_0x52e17b['serverUrl']);if(_0x3db267&&_0x3db267[_0x9917('0x86')]&&_0x3db267[_0x9917('0x86')]!==_0x9917('0x87')){logger['info'](_0x9917('0x88'),'Recording\x20is\x20enabled!');_0x3947ca['recordingURL']=_0x52e17b[_0x9917('0x79')]+'/api/voice/recordings/'+_0x3947ca[_0x9917('0x7d')]+'/downloads?type=uniqueid&token='+md5(_0x3947ca[_0x9917('0x7d')]);}var _0x4dd87d=_0x52e17b['host']===_0x9917('0x89')?'eu':'com';return getAccessToken(_0x52e17b)[_0x9917('0x2d')](function(_0x1602d3){_0x210f51=_0x1602d3;return getUser(_0x210f51,_0x4dd87d,_0x52e17b,_0x4566ea['email']);})[_0x9917('0x2d')](function(_0x4ddcc5){_0x6b0433=_0x4ddcc5;logger[_0x9917('0x26')](_0x9917('0x8a'),_0x6b0433['id']);return getEndUser(_0x210f51,_0x4dd87d,_0x52e17b,_0x3947ca[_0x9917('0x8b')],_0x3947ca['destcalleridnum'],_0x6b0433,_0x459716);})[_0x9917('0x2d')](function(_0x3a71e0){_0x240baa=_0x3a71e0;return getCall(_0x210f51,_0x4dd87d,_0x52e17b,_0x6b0433,_0x240baa,_0x459716,_0x3947ca,'Outbound');})[_0x9917('0x2d')](function(_0x5af353){if(_0x5af353){logger['info'](_0x9917('0x8c'),_0x5af353['id']);logger[_0x9917('0x26')](_0x9917('0x88'),_0x9917('0x8d'));emit(util[_0x9917('0x29')]('user:%s',_0x4566ea[_0x9917('0x14')]),_0x9917('0x83'),{'uri':_0x9917('0x8e')+_0x52e17b[_0x9917('0x84')]+'/crm/EntityInfo.do?module=Calls&id='+_0x5af353['id']});}})['catch'](function(_0x5cefc9){logger[_0x9917('0x36')](_0x9917('0x88'),JSON[_0x9917('0xa')](_0x5cefc9));});};exports[_0x9917('0x8f')]=function(_0x3632a9,_0x4fcf0d,_0x394fbd,_0x3518ff,_0xba12e4,_0x2769c4){var _0x32869c,_0x4b1951,_0x6488de;_0x2769c4[_0x9917('0x84')]=intUtil[_0x9917('0x78')](_0x2769c4[_0x9917('0x84')]);_0x2769c4[_0x9917('0x79')]=intUtil[_0x9917('0x78')](_0x2769c4[_0x9917('0x79')]);if(_0xba12e4&&_0xba12e4[_0x9917('0x7a')]){logger[_0x9917('0x26')]('['+_0x4fcf0d[_0x9917('0x63')][_0x9917('0x90')]()+']',_0x9917('0x91'));_0x4fcf0d[_0x9917('0x92')]=_0x2769c4['serverUrl']+_0x9917('0x7c')+_0x4fcf0d[_0x9917('0x7d')]+'/downloads?type=uniqueid&token='+md5(_0x4fcf0d[_0x9917('0x7d')]);}else{_0x4fcf0d[_0x9917('0x92')]='';}var _0x1601af=_0x2769c4['host']===_0x9917('0x89')?'eu':_0x9917('0x7f');return getAccessToken(_0x2769c4)[_0x9917('0x2d')](function(_0x53be1a){_0x6488de=_0x53be1a;return getUser(_0x6488de,_0x1601af,_0x2769c4);})[_0x9917('0x2d')](function(_0x586187){_0x32869c=_0x586187;logger['info']('The\x20User\x20ID\x20is:',_0x32869c['id']);return getEndUser(_0x6488de,_0x1601af,_0x2769c4,_0x4fcf0d['calleridname'],_0x4fcf0d[_0x9917('0x81')],_0x32869c,_0x394fbd);})['then'](function(_0x2e31a1){_0x4b1951=_0x2e31a1;return getCall(_0x6488de,_0x1601af,_0x2769c4,_0x32869c,_0x4b1951,_0x394fbd,_0x4fcf0d,'Inbound');})[_0x9917('0x2d')](function(_0x349fc2){if(_0x349fc2){logger[_0x9917('0x26')]('The\x20Call\x20ID\x20is:',_0x349fc2['id']);}})[_0x9917('0x3a')](function(_0x541c1e){logger[_0x9917('0x36')]('['+_0x4fcf0d[_0x9917('0x63')]['toUpperCase']()+']',JSON[_0x9917('0xa')](_0x541c1e));});}; \ 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 7ce2f48..db0c917 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 _0x2f37=['error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','trigger','exec','data2','data3','render'];(function(_0x29ced0,_0x152d0b){var _0x1b068e=function(_0x2ff695){while(--_0x2ff695){_0x29ced0['push'](_0x29ced0['shift']());}};_0x1b068e(++_0x152d0b);}(_0x2f37,0x1cc));var _0x72f3=function(_0x154c98,_0x584464){_0x154c98=_0x154c98-0x0;var _0x18aff6=_0x2f37[_0x154c98];return _0x18aff6;};'use strict';var util=require(_0x72f3('0x0'));var sh=require(_0x72f3('0x1'));var Mustache=require(_0x72f3('0x2'));var logger=require('../../../../config/logger')(_0x72f3('0x3'));exports[_0x72f3('0x4')]=function(_0x11b9b5,_0x3c5deb){var _0x31fa51=_0x11b9b5[_0x72f3('0x5')]?_0x11b9b5['data2']:'Script';var _0x59c0bb=_0x11b9b5[_0x72f3('0x6')]?Mustache[_0x72f3('0x7')](_0x11b9b5[_0x72f3('0x6')],_0x3c5deb):_0x3c5deb;sh[_0x72f3('0x4')](_0x59c0bb,function(_0xcd55bb,_0x1758f6,_0x32e89f){if(_0xcd55bb!==0x0){logger[_0x72f3('0x8')](util['format'](_0x72f3('0x9'),_0x31fa51,_0x59c0bb,_0xcd55bb,_0x32e89f));}else{logger[_0x72f3('0xa')](util[_0x72f3('0xb')](_0x72f3('0xc'),_0x31fa51,_0x59c0bb,_0x1758f6));}});}; \ No newline at end of file +var _0x2f48=['data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2'];(function(_0x30eebc,_0x2595cb){var _0x3e1a94=function(_0x41694f){while(--_0x41694f){_0x30eebc['push'](_0x30eebc['shift']());}};_0x3e1a94(++_0x2595cb);}(_0x2f48,0x1e8));var _0x82f4=function(_0x49120a,_0x3eb62f){_0x49120a=_0x49120a-0x0;var _0x44034a=_0x2f48[_0x49120a];return _0x44034a;};'use strict';var util=require(_0x82f4('0x0'));var sh=require(_0x82f4('0x1'));var Mustache=require(_0x82f4('0x2'));var logger=require(_0x82f4('0x3'))(_0x82f4('0x4'));exports[_0x82f4('0x5')]=function(_0x208417,_0x500188){var _0xe9ad71=_0x208417[_0x82f4('0x6')]?_0x208417[_0x82f4('0x6')]:'Script';var _0x4babff=_0x208417[_0x82f4('0x7')]?Mustache['render'](_0x208417[_0x82f4('0x7')],_0x500188):_0x500188;sh['exec'](_0x4babff,function(_0x40038d,_0x3ae995,_0x28c63e){if(_0x40038d!==0x0){logger[_0x82f4('0x8')](util['format'](_0x82f4('0x9'),_0xe9ad71,_0x4babff,_0x40038d,_0x28c63e));}else{logger[_0x82f4('0xa')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0xe9ad71,_0x4babff,_0x3ae995));}});}; \ 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 b45b8c5..ae79632 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 _0x687e=['number','data5','headers','parse','render','stack','data1','GET','DELETE','POST','PUT','data7','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','message','util','lodash','mustache','toUpperCase','data2'];(function(_0x2f48cd,_0x46a75a){var _0x193ae2=function(_0x253c01){while(--_0x253c01){_0x2f48cd['push'](_0x2f48cd['shift']());}};_0x193ae2(++_0x46a75a);}(_0x687e,0x18e));var _0xe687=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x687e[_0x4b369d];return _0x571a98;};'use strict';var rp=require('request-promise');var util=require(_0xe687('0x0'));var _=require(_0xe687('0x1'));var Mustache=require(_0xe687('0x2'));var logger=require('../../../../config/logger')('trigger');exports['exec']=function(_0x411e4e,_0x54cc9d){var _0x49b877,_0x3e589e;var _0x1a701e={'method':_0x411e4e['data1'][_0xe687('0x3')](),'uri':Mustache['render'](_0x411e4e[_0xe687('0x4')],_0x54cc9d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x411e4e['data5'])===_0xe687('0x5')&&parseInt(_0x411e4e['data5'])>=0x1&&parseInt(_0x411e4e[_0xe687('0x6')])<=0xa?parseInt(_0x411e4e[_0xe687('0x6')])*0x3e8:0x5*0x3e8};try{_0x1a701e[_0xe687('0x7')]=_0x411e4e['data6']?JSON[_0xe687('0x8')](Mustache[_0xe687('0x9')](_0x411e4e['data6'],_0x54cc9d)):{};}catch(_0x424675){logger['error'](_0x424675[_0xe687('0xa')]);}switch(_0x411e4e[_0xe687('0xb')][_0xe687('0x3')]()){case _0xe687('0xc'):case _0xe687('0xd'):_0x49b877=null;_0x1a701e['qs']=_0x54cc9d;break;case _0xe687('0xe'):case _0xe687('0xf'):if(_0x411e4e[_0xe687('0x10')]){try{_0x49b877=JSON[_0xe687('0x8')](Mustache[_0xe687('0x9')](_0x411e4e[_0xe687('0x10')],_0x54cc9d));_0x1a701e['body']=_0x49b877;}catch(_0x44cead){logger[_0xe687('0x11')](_0x44cead['stack']);logger[_0xe687('0x11')](_0xe687('0x12'));}}else{_0x49b877=_0x54cc9d;_0x1a701e[_0xe687('0x13')]=_0x49b877;}break;}logger[_0xe687('0x14')](util[_0xe687('0x15')](_0xe687('0x16'),_0x411e4e['data1'],_0x411e4e[_0xe687('0x4')],JSON[_0xe687('0x17')](_0x1a701e)));rp(_0x1a701e)[_0xe687('0x18')](function(_0x17d924){_0x49b877=!_[_0xe687('0x19')](_0x49b877)?_0xe687('0x1a')+_0x49b877:'';_0x3e589e=typeof _0x17d924[_0xe687('0x13')]===_0xe687('0x1b')?JSON[_0xe687('0x17')](_0x17d924[_0xe687('0x13')]):_0x17d924[_0xe687('0x13')];logger['info'](util[_0xe687('0x15')](_0xe687('0x1c'),_0x411e4e[_0xe687('0xb')],_0x411e4e['data2'],_0x17d924[_0xe687('0x1d')],_0x3e589e));})['catch'](function(_0x49b642){logger[_0xe687('0x11')](util[_0xe687('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x411e4e[_0xe687('0xb')],_0x411e4e[_0xe687('0x4')],_0x49b642[_0xe687('0x1d')],_0x49b642['name'],_0x49b642[_0xe687('0x1e')]));});}; \ No newline at end of file +var _0x759b=['PUT','data7','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','util','trigger','data1','toUpperCase','render','data5','number','headers','data6','parse','error','stack','GET','DELETE','POST'];(function(_0xef2a14,_0x4c359a){var _0x242a4d=function(_0x3227c9){while(--_0x3227c9){_0xef2a14['push'](_0xef2a14['shift']());}};_0x242a4d(++_0x4c359a);}(_0x759b,0x130));var _0xb759=function(_0x93d86c,_0x54e7ee){_0x93d86c=_0x93d86c-0x0;var _0x58e497=_0x759b[_0x93d86c];return _0x58e497;};'use strict';var rp=require(_0xb759('0x0'));var util=require(_0xb759('0x1'));var _=require('lodash');var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0xb759('0x2'));exports['exec']=function(_0xed549d,_0x3a34eb){var _0x502b5a,_0x2264dc;var _0x3f682f={'method':_0xed549d[_0xb759('0x3')][_0xb759('0x4')](),'uri':Mustache[_0xb759('0x5')](_0xed549d['data2'],_0x3a34eb),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xed549d[_0xb759('0x6')])===_0xb759('0x7')&&parseInt(_0xed549d[_0xb759('0x6')])>=0x1&&parseInt(_0xed549d[_0xb759('0x6')])<=0xa?parseInt(_0xed549d[_0xb759('0x6')])*0x3e8:0x5*0x3e8};try{_0x3f682f[_0xb759('0x8')]=_0xed549d[_0xb759('0x9')]?JSON[_0xb759('0xa')](Mustache['render'](_0xed549d[_0xb759('0x9')],_0x3a34eb)):{};}catch(_0x2e358b){logger[_0xb759('0xb')](_0x2e358b[_0xb759('0xc')]);}switch(_0xed549d[_0xb759('0x3')]['toUpperCase']()){case _0xb759('0xd'):case _0xb759('0xe'):_0x502b5a=null;_0x3f682f['qs']=_0x3a34eb;break;case _0xb759('0xf'):case _0xb759('0x10'):if(_0xed549d[_0xb759('0x11')]){try{_0x502b5a=JSON[_0xb759('0xa')](Mustache[_0xb759('0x5')](_0xed549d['data7'],_0x3a34eb));_0x3f682f[_0xb759('0x12')]=_0x502b5a;}catch(_0x4b9811){logger[_0xb759('0xb')](_0x4b9811[_0xb759('0xc')]);logger[_0xb759('0xb')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x502b5a=_0x3a34eb;_0x3f682f['body']=_0x502b5a;}break;}logger[_0xb759('0x13')](util[_0xb759('0x14')](_0xb759('0x15'),_0xed549d[_0xb759('0x3')],_0xed549d[_0xb759('0x16')],JSON[_0xb759('0x17')](_0x3f682f)));rp(_0x3f682f)[_0xb759('0x18')](function(_0x1aef28){_0x502b5a=!_[_0xb759('0x19')](_0x502b5a)?_0xb759('0x1a')+_0x502b5a:'';_0x2264dc=typeof _0x1aef28[_0xb759('0x12')]===_0xb759('0x1b')?JSON[_0xb759('0x17')](_0x1aef28[_0xb759('0x12')]):_0x1aef28[_0xb759('0x12')];logger[_0xb759('0x13')](util[_0xb759('0x14')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0xed549d[_0xb759('0x3')],_0xed549d[_0xb759('0x16')],_0x1aef28[_0xb759('0x1c')],_0x2264dc));})[_0xb759('0x1d')](function(_0x2c2cf5){logger['error'](util[_0xb759('0x14')](_0xb759('0x1e'),_0xed549d[_0xb759('0x3')],_0xed549d[_0xb759('0x16')],_0x2c2cf5[_0xb759('0x1c')],_0x2c2cf5['name'],_0x2c2cf5[_0xb759('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 7174b6c..a839c82 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 _0x8bd4=['request','then','debug','rpc','routing','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request'];(function(_0x7a113d,_0x9947f7){var _0x3517e4=function(_0x2631a1){while(--_0x2631a1){_0x7a113d['push'](_0x7a113d['shift']());}};_0x3517e4(++_0x9947f7);}(_0x8bd4,0x14a));var _0x48bd=function(_0x362c81,_0x14e74b){_0x362c81=_0x362c81-0x0;var _0x18b729=_0x8bd4[_0x362c81];return _0x18b729;};'use strict';var jayson=require(_0x48bd('0x0'));var BPromise=require(_0x48bd('0x1'));var logger=require(_0x48bd('0x2'))('routing');var client=jayson[_0x48bd('0x3')][_0x48bd('0x4')]({'port':0x2329});client[_0x48bd('0x5')]=function(_0x4c98da,_0x64c449){return new BPromise(function(_0x2b8b1e,_0x59d7d9){return client[_0x48bd('0x6')](_0x4c98da,_0x64c449)[_0x48bd('0x7')](function(_0x421e5c){logger[_0x48bd('0x8')](_0x48bd('0x9'),_0x48bd('0xa'),_0x4c98da,_0x64c449,_0x421e5c);if(_0x421e5c[_0x48bd('0xb')]){logger[_0x48bd('0xb')]('rpc','routing',_0x4c98da,_0x421e5c[_0x48bd('0xb')][_0x48bd('0xc')],_0x64c449);return _0x59d7d9(_0x421e5c[_0x48bd('0xb')][_0x48bd('0xc')]);}else{return _0x2b8b1e(_0x421e5c[_0x48bd('0xd')]);}})[_0x48bd('0xe')](function(_0x1f054a){logger[_0x48bd('0xb')]('rpc',_0x48bd('0xa'),_0x4c98da,_0x1f054a,_0x64c449);return _0x59d7d9(_0x1f054a);});});};module[_0x48bd('0xf')]=client; \ No newline at end of file +var _0xdfd4=['then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','request'];(function(_0x34c467,_0x5725e3){var _0x54c59e=function(_0x5f1a30){while(--_0x5f1a30){_0x34c467['push'](_0x34c467['shift']());}};_0x54c59e(++_0x5725e3);}(_0xdfd4,0x9e));var _0x4dfd=function(_0x110766,_0x3e5efb){_0x110766=_0x110766-0x0;var _0x2faf53=_0xdfd4[_0x110766];return _0x2faf53;};'use strict';var jayson=require(_0x4dfd('0x0'));var BPromise=require(_0x4dfd('0x1'));var logger=require(_0x4dfd('0x2'))(_0x4dfd('0x3'));var client=jayson[_0x4dfd('0x4')][_0x4dfd('0x5')]({'port':0x2329});client['Request']=function(_0x3a468f,_0x2179eb){return new BPromise(function(_0x4742c1,_0x33e161){return client[_0x4dfd('0x6')](_0x3a468f,_0x2179eb)[_0x4dfd('0x7')](function(_0x5838e1){logger[_0x4dfd('0x8')](_0x4dfd('0x9'),_0x4dfd('0x3'),_0x3a468f,_0x2179eb,_0x5838e1);if(_0x5838e1['error']){logger['error']('rpc','routing',_0x3a468f,_0x5838e1[_0x4dfd('0xa')][_0x4dfd('0xb')],_0x2179eb);return _0x33e161(_0x5838e1[_0x4dfd('0xa')][_0x4dfd('0xb')]);}else{return _0x4742c1(_0x5838e1[_0x4dfd('0xc')]);}})[_0x4dfd('0xd')](function(_0x6136d9){logger[_0x4dfd('0xa')](_0x4dfd('0x9'),_0x4dfd('0x3'),_0x3a468f,_0x6136d9,_0x2179eb);return _0x33e161(_0x6136d9);});});};module[_0x4dfd('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index b5da0d3..440ad61 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 _0x98c5=['email','resolve','then','getMailAccounts','initMailAccounts','refresh','listen','getSettings','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x98c5,0xfb));var _0x598c=function(_0x5a1b4,_0x293ba3){_0x5a1b4=_0x5a1b4-0x0;var _0x41a7f7=_0x98c5[_0x5a1b4];return _0x41a7f7;};'use strict';var server=require(_0x598c('0x0'));var Realtime=require(_0x598c('0x1'));var EmailChannel=require(_0x598c('0x2'));var mailAccount=require(_0x598c('0x3'));var setting=require(_0x598c('0x4'));var logger=require('../../config/logger')(_0x598c('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x598c('0x6')]()[_0x598c('0x7')](mailAccount[_0x598c('0x8')]())['then'](realtime[_0x598c('0x9')]())[_0x598c('0x7')](function(){email[_0x598c('0xa')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x598c('0xb')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x598c('0xc')]();})[_0x598c('0x7')](function(_0x57b3de){return setInterval(initRealtime,_0x57b3de['loginMailFrequency']*0x3e8);})[_0x598c('0xd')](function(_0x5dc4d5){logger[_0x598c('0xe')](_0x598c('0xf'),_0x5dc4d5);});}main(); \ No newline at end of file +var _0x4a4a=['./rpc/setting','../../config/logger','email','resolve','then','refresh','mailAccounts','listen','getSettings','error','Email\x20service\x20initialization','./server','./realtime','./rpc/mailAccount'];(function(_0x56c37d,_0x486618){var _0x120476=function(_0x125e54){while(--_0x125e54){_0x56c37d['push'](_0x56c37d['shift']());}};_0x120476(++_0x486618);}(_0x4a4a,0x115));var _0xa4a4=function(_0x3e55e1,_0x3504be){_0x3e55e1=_0x3e55e1-0x0;var _0x6a2f42=_0x4a4a[_0x3e55e1];return _0x6a2f42;};'use strict';var server=require(_0xa4a4('0x0'));var Realtime=require(_0xa4a4('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xa4a4('0x2'));var setting=require(_0xa4a4('0x3'));var logger=require(_0xa4a4('0x4'))(_0xa4a4('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xa4a4('0x6')]()[_0xa4a4('0x7')](mailAccount['getMailAccounts']())[_0xa4a4('0x7')](realtime['initMailAccounts']())[_0xa4a4('0x7')](function(){email[_0xa4a4('0x8')](realtime[_0xa4a4('0x9')]);return realtime;});}function main(){return server[_0xa4a4('0xa')](realtime,email)[_0xa4a4('0x7')](function(){return initRealtime();})[_0xa4a4('0x7')](function(){return setting[_0xa4a4('0xb')]();})[_0xa4a4('0x7')](function(_0x229efe){return setInterval(initRealtime,_0x229efe['loginMailFrequency']*0x3e8);})['catch'](function(_0x368f47){logger[_0xa4a4('0xc')](_0xa4a4('0xd'),_0x368f47);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index a734a73..c673a75 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 _0x9ea6=['disabled','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','error','sendMail','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','key','Imap','messageStatus','total','isNil','stringify','refresh','service','provider','custom','imapAccounts','hasOwnProperty','handleImapBox','bind','handleImapEmail','end','handleImapEnd','handleImapError','status'];(function(_0x500fef,_0xd6b32f){var _0x339f38=function(_0x12548c){while(--_0x12548c){_0x500fef['push'](_0x500fef['shift']());}};_0x339f38(++_0xd6b32f);}(_0x9ea6,0x83));var _0x69ea=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9ea6[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x69ea('0x0'));var moment=require(_0x69ea('0x1'));var BPromise=require(_0x69ea('0x2'));var md5=require(_0x69ea('0x3'));var Redis=require(_0x69ea('0x4'));var config=require('../../../config/environment');var logger=require(_0x69ea('0x5'))(_0x69ea('0x6'));config[_0x69ea('0x7')]=_[_0x69ea('0x8')](config[_0x69ea('0x7')],{'host':_0x69ea('0x9'),'port':0x18eb});var io=require(_0x69ea('0xa'))(new Redis(config[_0x69ea('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x69ea('0xb'));var mailAccount=require(_0x69ea('0xc'));var md5Accounts={};function EmailChannel(_0x466ce3){logger['info'](_0x69ea('0xd'));this[_0x69ea('0xe')]=_0x466ce3[_0x69ea('0xe')];this['imapAccounts']={};this[_0x69ea('0xf')]=new EmailSmtp();}EmailChannel[_0x69ea('0x10')][_0x69ea('0x11')]=function(_0x46ec42){var _0xe9d42a=this[_0x69ea('0xe')][_0x46ec42];var _0x53552d={'id':_0xe9d42a['id'],'name':_0xe9d42a['name'],'key':_0xe9d42a[_0x69ea('0x12')],'active':_0xe9d42a['active'],'Imap':{'status':_0xe9d42a['Imap']['status'],'messageStatus':_0xe9d42a[_0x69ea('0x13')][_0x69ea('0x14')],'total':_0xe9d42a[_0x69ea('0x13')][_0x69ea('0x15')]}};if(_[_0x69ea('0x16')](md5Accounts[_0x46ec42])){md5Accounts[_0x46ec42]={};}var _0x5acb43=md5(JSON[_0x69ea('0x17')](_0x53552d));if(md5Accounts[_0x46ec42][_0x69ea('0x3')]!==_0x5acb43){md5Accounts[_0x46ec42]['md5']=_0x5acb43;io[_0x69ea('0x11')]('mailAccount:update',_0x53552d);}};EmailChannel[_0x69ea('0x10')][_0x69ea('0x18')]=function(_0x48f0d6){for(var _0x57a65e in _0x48f0d6){if(_0x48f0d6['hasOwnProperty'](_0x57a65e)){if(_0x48f0d6[_0x57a65e]['Imap']&&_0x48f0d6[_0x57a65e]['active']){var _0x26ecd4=_0x48f0d6[_0x57a65e][_0x69ea('0x13')];if(!_0x26ecd4[_0x69ea('0x19')]&&_0x48f0d6[_0x57a65e][_0x69ea('0x1a')]!==_0x69ea('0x1b'))_0x26ecd4[_0x69ea('0x19')]=_0x48f0d6[_0x57a65e][_0x69ea('0x1a')];if(!this[_0x69ea('0x1c')][_0x69ea('0x1d')](_0x26ecd4['id'])){this[_0x69ea('0x1c')][_0x26ecd4['id']]=new EmailImap(_0x26ecd4,_0x48f0d6[_0x57a65e][_0x69ea('0x6')]);this[_0x69ea('0x1c')][_0x26ecd4['id']]['on']('box',this[_0x69ea('0x1e')][_0x69ea('0x1f')](this,_0x57a65e));this[_0x69ea('0x1c')][_0x26ecd4['id']]['on'](_0x69ea('0x6'),this[_0x69ea('0x20')][_0x69ea('0x1f')](this,_0x57a65e));this[_0x69ea('0x1c')][_0x26ecd4['id']]['on'](_0x69ea('0x21'),this[_0x69ea('0x22')][_0x69ea('0x1f')](this,_0x57a65e));this[_0x69ea('0x1c')][_0x26ecd4['id']]['on']('error',this[_0x69ea('0x23')][_0x69ea('0x1f')](this,_0x57a65e));}}else{if(_['isNil'](this[_0x69ea('0xe')][_0x57a65e][_0x69ea('0x13')])){this[_0x69ea('0xe')][_0x57a65e][_0x69ea('0x13')]={};}this['mailAccounts'][_0x57a65e][_0x69ea('0x13')][_0x69ea('0x24')]=_0x69ea('0x25');this['mailAccounts'][_0x57a65e][_0x69ea('0x13')][_0x69ea('0x14')]='';this[_0x69ea('0x11')](_0x57a65e);}}}};EmailChannel[_0x69ea('0x10')][_0x69ea('0x1e')]=function(_0x152b6b,_0x3209c9){if(this[_0x69ea('0xe')][_0x152b6b]){this[_0x69ea('0xe')][_0x152b6b][_0x69ea('0x13')][_0x69ea('0x24')]='connected';this[_0x69ea('0xe')][_0x152b6b][_0x69ea('0x13')][_0x69ea('0x14')]=_0x3209c9['name'];if(_0x3209c9['messages']){this['mailAccounts'][_0x152b6b][_0x69ea('0x13')][_0x69ea('0x15')]=_0x3209c9[_0x69ea('0x26')][_0x69ea('0x15')];}return this[_0x69ea('0x11')](_0x152b6b);}};EmailChannel[_0x69ea('0x10')][_0x69ea('0x20')]=function(_0x5db391,_0x182bce){logger[_0x69ea('0x27')](_0x69ea('0x28'),_0x182bce[_0x69ea('0x29')],_0x182bce[_0x69ea('0x2a')],_0x182bce[_0x69ea('0x2b')],_0x5db391);if(this['mailAccounts'][_0x5db391]){return mailAccount[_0x69ea('0x2c')](_0x5db391,_0x182bce)[_0x69ea('0x2d')](function(_0x3eb56b){if(_0x3eb56b){logger[_0x69ea('0x27')](_0x69ea('0x2e'));}})[_0x69ea('0x2f')](function(_0x50288a){logger['error'](_0x69ea('0x30'),JSON[_0x69ea('0x17')](_0x50288a));});}};EmailChannel[_0x69ea('0x10')]['handleImapEnd']=function(_0x368c17){if(this[_0x69ea('0xe')][_0x368c17]&&this[_0x69ea('0xe')][_0x368c17][_0x69ea('0x13')]){if(this[_0x69ea('0x1c')][this[_0x69ea('0xe')][_0x368c17][_0x69ea('0x13')]['id']]){delete this[_0x69ea('0x1c')][this[_0x69ea('0xe')][_0x368c17]['Imap']['id']];}this[_0x69ea('0xe')][_0x368c17][_0x69ea('0x13')][_0x69ea('0x31')]=moment();this[_0x69ea('0x11')](_0x368c17);}};EmailChannel[_0x69ea('0x10')]['handleImapError']=function(_0x4d5890,_0x43a3bf){if(this[_0x69ea('0xe')][_0x4d5890]){this[_0x69ea('0xe')][_0x4d5890][_0x69ea('0x13')][_0x69ea('0x24')]=_0x69ea('0x32');this['mailAccounts'][_0x4d5890][_0x69ea('0x13')][_0x69ea('0x14')]=_0x43a3bf;return this[_0x69ea('0x11')](_0x4d5890);}};EmailChannel[_0x69ea('0x10')][_0x69ea('0x33')]=function(_0x5eed4b,_0x45e080){return this['smtp']['send'](_0x5eed4b,_0x45e080);};EmailChannel['prototype']['verifySmtp']=function(_0x29d862){var _0x3e1b8d=this;if(this[_0x69ea('0xe')][_0x29d862['id']]){if(_[_0x69ea('0x16')](this['mailAccounts'][_0x29d862['id']]['Smtp'])){this[_0x69ea('0xe')][_0x29d862['id']][_0x69ea('0x34')]={};}this[_0x69ea('0xe')][_0x29d862['id']][_0x69ea('0x34')][_0x69ea('0x31')]=moment();return new BPromise(function(_0x375859,_0x3db0db){return _0x3e1b8d[_0x69ea('0xf')][_0x69ea('0x35')](_0x29d862)[_0x69ea('0x2d')](function(_0x15e4cc){_0x3e1b8d[_0x69ea('0xe')][_0x29d862['id']][_0x69ea('0x34')][_0x69ea('0x24')]=_0x69ea('0x36');_0x3e1b8d[_0x69ea('0xe')][_0x29d862['id']][_0x69ea('0x34')][_0x69ea('0x14')]='';_0x3e1b8d[_0x69ea('0x11')](_0x29d862['id']);_0x375859(_0x15e4cc);})[_0x69ea('0x2f')](function(_0x42b3f8){_0x3e1b8d[_0x69ea('0xe')][_0x29d862['id']][_0x69ea('0x34')]['status']=_0x69ea('0x32');_0x3e1b8d['mailAccounts'][_0x29d862['id']][_0x69ea('0x34')][_0x69ea('0x14')]=_0x42b3f8;_0x3e1b8d[_0x69ea('0x11')](_0x29d862['id']);_0x3db0db(_0x42b3f8);});});}return this[_0x69ea('0xf')][_0x69ea('0x35')](_0x29d862);};module[_0x69ea('0x37')]=EmailChannel; \ No newline at end of file +var _0x4159=['send','verifySmtp','Smtp','lastSync','verified','verify','exports','lodash','moment','bluebird','../../../config/environment','../../../config/logger','defaults','localhost','socket.io-emitter','redis','./imap','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','key','active','Imap','status','messageStatus','total','isNil','md5','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','email','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','handleImapError','disabled','prototype','connected','name','messages','info','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','sendMail'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0x4159,0xf3));var _0x9415=function(_0x42da4d,_0x2a26b3){_0x42da4d=_0x42da4d-0x0;var _0x206cc0=_0x4159[_0x42da4d];return _0x206cc0;};'use strict';var _=require(_0x9415('0x0'));var moment=require(_0x9415('0x1'));var BPromise=require(_0x9415('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x9415('0x3'));var logger=require(_0x9415('0x4'))('email');config['redis']=_[_0x9415('0x5')](config['redis'],{'host':_0x9415('0x6'),'port':0x18eb});var io=require(_0x9415('0x7'))(new Redis(config[_0x9415('0x8')]));var EmailImap=require(_0x9415('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x1eeaaf){logger['info'](_0x9415('0xa'));this[_0x9415('0xb')]=_0x1eeaaf[_0x9415('0xb')];this[_0x9415('0xc')]={};this[_0x9415('0xd')]=new EmailSmtp();}EmailChannel['prototype'][_0x9415('0xe')]=function(_0x4e0826){var _0x573661=this[_0x9415('0xb')][_0x4e0826];var _0x4fdd5d={'id':_0x573661['id'],'name':_0x573661['name'],'key':_0x573661[_0x9415('0xf')],'active':_0x573661[_0x9415('0x10')],'Imap':{'status':_0x573661[_0x9415('0x11')][_0x9415('0x12')],'messageStatus':_0x573661['Imap'][_0x9415('0x13')],'total':_0x573661[_0x9415('0x11')][_0x9415('0x14')]}};if(_[_0x9415('0x15')](md5Accounts[_0x4e0826])){md5Accounts[_0x4e0826]={};}var _0x490422=md5(JSON['stringify'](_0x4fdd5d));if(md5Accounts[_0x4e0826][_0x9415('0x16')]!==_0x490422){md5Accounts[_0x4e0826][_0x9415('0x16')]=_0x490422;io[_0x9415('0xe')](_0x9415('0x17'),_0x4fdd5d);}};EmailChannel['prototype'][_0x9415('0x18')]=function(_0x34ab03){for(var _0x54226d in _0x34ab03){if(_0x34ab03[_0x9415('0x19')](_0x54226d)){if(_0x34ab03[_0x54226d][_0x9415('0x11')]&&_0x34ab03[_0x54226d][_0x9415('0x10')]){var _0x4a0f7f=_0x34ab03[_0x54226d][_0x9415('0x11')];if(!_0x4a0f7f[_0x9415('0x1a')]&&_0x34ab03[_0x54226d][_0x9415('0x1b')]!==_0x9415('0x1c'))_0x4a0f7f['service']=_0x34ab03[_0x54226d]['provider'];if(!this['imapAccounts'][_0x9415('0x19')](_0x4a0f7f['id'])){this[_0x9415('0xc')][_0x4a0f7f['id']]=new EmailImap(_0x4a0f7f,_0x34ab03[_0x54226d][_0x9415('0x1d')]);this[_0x9415('0xc')][_0x4a0f7f['id']]['on'](_0x9415('0x1e'),this[_0x9415('0x1f')][_0x9415('0x20')](this,_0x54226d));this[_0x9415('0xc')][_0x4a0f7f['id']]['on'](_0x9415('0x1d'),this[_0x9415('0x21')][_0x9415('0x20')](this,_0x54226d));this[_0x9415('0xc')][_0x4a0f7f['id']]['on']('end',this[_0x9415('0x22')]['bind'](this,_0x54226d));this[_0x9415('0xc')][_0x4a0f7f['id']]['on'](_0x9415('0x23'),this[_0x9415('0x24')]['bind'](this,_0x54226d));}}else{if(_[_0x9415('0x15')](this[_0x9415('0xb')][_0x54226d][_0x9415('0x11')])){this[_0x9415('0xb')][_0x54226d][_0x9415('0x11')]={};}this[_0x9415('0xb')][_0x54226d][_0x9415('0x11')][_0x9415('0x12')]=_0x9415('0x25');this[_0x9415('0xb')][_0x54226d][_0x9415('0x11')][_0x9415('0x13')]='';this[_0x9415('0xe')](_0x54226d);}}}};EmailChannel[_0x9415('0x26')]['handleImapBox']=function(_0x395928,_0x567891){if(this[_0x9415('0xb')][_0x395928]){this['mailAccounts'][_0x395928][_0x9415('0x11')]['status']=_0x9415('0x27');this['mailAccounts'][_0x395928][_0x9415('0x11')]['messageStatus']=_0x567891[_0x9415('0x28')];if(_0x567891[_0x9415('0x29')]){this[_0x9415('0xb')][_0x395928]['Imap'][_0x9415('0x14')]=_0x567891['messages'][_0x9415('0x14')];}return this[_0x9415('0xe')](_0x395928);}};EmailChannel[_0x9415('0x26')][_0x9415('0x21')]=function(_0x446ca2,_0x2a4170){logger[_0x9415('0x2a')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x2a4170['firstName'],_0x2a4170[_0x9415('0x2b')],_0x2a4170[_0x9415('0x2c')],_0x446ca2);if(this['mailAccounts'][_0x446ca2]){return mailAccount[_0x9415('0x2d')](_0x446ca2,_0x2a4170)[_0x9415('0x2e')](function(_0x55012d){if(_0x55012d){logger[_0x9415('0x2a')](_0x9415('0x2f'));}})[_0x9415('0x30')](function(_0x38239c){logger['error'](_0x9415('0x31'),JSON[_0x9415('0x32')](_0x38239c));});}};EmailChannel['prototype'][_0x9415('0x22')]=function(_0x8af61d){if(this['mailAccounts'][_0x8af61d]&&this[_0x9415('0xb')][_0x8af61d][_0x9415('0x11')]){if(this[_0x9415('0xc')][this[_0x9415('0xb')][_0x8af61d][_0x9415('0x11')]['id']]){delete this[_0x9415('0xc')][this[_0x9415('0xb')][_0x8af61d][_0x9415('0x11')]['id']];}this[_0x9415('0xb')][_0x8af61d][_0x9415('0x11')]['lastSync']=moment();this[_0x9415('0xe')](_0x8af61d);}};EmailChannel[_0x9415('0x26')][_0x9415('0x24')]=function(_0x2362ae,_0x5f5471){if(this[_0x9415('0xb')][_0x2362ae]){this[_0x9415('0xb')][_0x2362ae][_0x9415('0x11')][_0x9415('0x12')]=_0x9415('0x23');this[_0x9415('0xb')][_0x2362ae]['Imap']['messageStatus']=_0x5f5471;return this[_0x9415('0xe')](_0x2362ae);}};EmailChannel[_0x9415('0x26')][_0x9415('0x33')]=function(_0x1ceac7,_0x4a421e){return this[_0x9415('0xd')][_0x9415('0x34')](_0x1ceac7,_0x4a421e);};EmailChannel[_0x9415('0x26')][_0x9415('0x35')]=function(_0x271165){var _0x11c963=this;if(this[_0x9415('0xb')][_0x271165['id']]){if(_[_0x9415('0x15')](this[_0x9415('0xb')][_0x271165['id']][_0x9415('0x36')])){this['mailAccounts'][_0x271165['id']][_0x9415('0x36')]={};}this[_0x9415('0xb')][_0x271165['id']][_0x9415('0x36')][_0x9415('0x37')]=moment();return new BPromise(function(_0x5e146f,_0x518230){return _0x11c963[_0x9415('0xd')]['verify'](_0x271165)[_0x9415('0x2e')](function(_0x5d8a5c){_0x11c963['mailAccounts'][_0x271165['id']][_0x9415('0x36')][_0x9415('0x12')]=_0x9415('0x38');_0x11c963[_0x9415('0xb')][_0x271165['id']]['Smtp'][_0x9415('0x13')]='';_0x11c963[_0x9415('0xe')](_0x271165['id']);_0x5e146f(_0x5d8a5c);})[_0x9415('0x30')](function(_0x28a6db){_0x11c963['mailAccounts'][_0x271165['id']][_0x9415('0x36')][_0x9415('0x12')]=_0x9415('0x23');_0x11c963[_0x9415('0xb')][_0x271165['id']]['Smtp']['messageStatus']=_0x28a6db;_0x11c963[_0x9415('0xe')](_0x271165['id']);_0x518230(_0x28a6db);});});}return this['smtp'][_0x9415('0x39')](_0x271165);};module[_0x9415('0x3a')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 8ba8b0f..1225e4d 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 _0x13b0=['anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','handleReadUnseen','bind','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleEnd','textCode','upperFirst','exports','lodash','util','mailparser','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','imap','once','ready','handleReady','end','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password'];(function(_0xc7eda3,_0x1e0872){var _0x14def2=function(_0x25752a){while(--_0x25752a){_0xc7eda3['push'](_0xc7eda3['shift']());}};_0x14def2(++_0x1e0872);}(_0x13b0,0x11a));var _0x013b=function(_0x3b3de1,_0x4c0436){_0x3b3de1=_0x3b3de1-0x0;var _0x16e843=_0x13b0[_0x3b3de1];return _0x16e843;};'use strict';var _=require(_0x013b('0x0'));var util=require(_0x013b('0x1'));var Imap=require('imap');var simpleParser=require(_0x013b('0x2'))[_0x013b('0x3')];var Iconv=require(_0x013b('0x4'))['Iconv'];var EventEmitter=require(_0x013b('0x5'))[_0x013b('0x6')];var utils=require(_0x013b('0x7'));var logger=require(_0x013b('0x8'))(_0x013b('0x9'));function EmailImap(_0x4890f3,_0x3e4f32){this['mailbox']=_0x4890f3[_0x013b('0xa')];this[_0x013b('0xb')]=this[_0x013b('0xc')](_0x4890f3,_0x3e4f32);this['imap']=new Imap(this['account']);this[_0x013b('0xd')][_0x013b('0xe')](_0x013b('0xf'),this[_0x013b('0x10')]['bind'](this));this[_0x013b('0xd')][_0x013b('0xe')](_0x013b('0x11'),this['handleEnd']['bind'](this));this[_0x013b('0xd')]['on'](_0x013b('0x12'),this[_0x013b('0x13')]['bind'](this));this[_0x013b('0xd')][_0x013b('0x14')]();}util[_0x013b('0x15')](EmailImap,EventEmitter);EmailImap[_0x013b('0x16')][_0x013b('0xc')]=function(_0x5f51b9,_0x1f9d2c){var _0x1004e0={'connTimeout':_0x5f51b9['connTimeout']?_0x5f51b9[_0x013b('0x17')]*0x3e8:0x2710,'authTimeout':_0x5f51b9[_0x013b('0x18')]?_0x5f51b9[_0x013b('0x18')]*0x3e8:0x1388};if(_0x5f51b9[_0x013b('0x19')]){_0x1004e0[_0x013b('0x1a')]=_0x5f51b9[_0x013b('0x1a')];if(_0x5f51b9[_0x013b('0x1b')]){_0x1004e0[_0x013b('0x1c')]=utils[_0x013b('0x1d')](_0x5f51b9[_0x013b('0x1e')][_0x013b('0x1f')],_0x5f51b9[_0x013b('0x1a')]);}else{_0x1004e0[_0x013b('0x20')]=_0x5f51b9['password'];}}else{if(_0x5f51b9['authentication']){_0x1004e0[_0x013b('0x1a')]=_0x5f51b9[_0x013b('0x1a')];_0x1004e0['password']=_0x5f51b9['password'];}}_0x1004e0[_0x013b('0x9')]=_0x1f9d2c||_0x5f51b9[_0x013b('0x1a')]||_0x013b('0x21');_0x1004e0[_0x013b('0x22')]=_0x5f51b9[_0x013b('0x22')];_0x1004e0['port']=_0x5f51b9[_0x013b('0x23')]||0x3e1;if(_0x5f51b9[_0x013b('0x24')]){_0x1004e0['tls']=!![];}else{_0x1004e0['tls']=![];_0x1004e0[_0x013b('0x25')]=_0x013b('0x26');}return _0x1004e0;};EmailImap[_0x013b('0x16')]['handleReady']=function(){this[_0x013b('0xd')][_0x013b('0x27')](this[_0x013b('0xa')],![],this[_0x013b('0x28')]['bind'](this));};EmailImap['prototype'][_0x013b('0x28')]=function(_0x1af921,_0x4c0992){if(_0x1af921){this[_0x013b('0x13')](_0x1af921,!![]);}else{this[_0x013b('0x29')]('box',_0x4c0992);this[_0x013b('0x2a')]();}};EmailImap[_0x013b('0x16')][_0x013b('0x2b')]=function(_0x39b731){if(_0x39b731){this['handleError'](_0x39b731,!![]);}else{this[_0x013b('0xd')][_0x013b('0x11')]();}};EmailImap[_0x013b('0x16')][_0x013b('0x2a')]=function(){this['imap']['search'](['UNSEEN'],this[_0x013b('0x2c')][_0x013b('0x2d')](this));};EmailImap['prototype'][_0x013b('0x2c')]=function(_0x49eccf,_0x54bbbd){if(_0x49eccf){this[_0x013b('0x13')](_0x49eccf,!![]);}else{if(_0x54bbbd[_0x013b('0x2e')]){try{var _0xe0bb56=this[_0x013b('0xd')][_0x013b('0x2f')](_0x54bbbd,{'bodies':'','markSeen':!![]});_0xe0bb56['on'](_0x013b('0x30'),this[_0x013b('0x31')]['bind'](this));_0xe0bb56[_0x013b('0xe')](_0x013b('0x12'),this[_0x013b('0x32')][_0x013b('0x2d')](this));_0xe0bb56[_0x013b('0xe')](_0x013b('0x11'),this[_0x013b('0x33')]['bind'](this));}catch(_0x152dca){logger[_0x013b('0x12')](_0x152dca);}}else{this[_0x013b('0xd')]['closeBox'](!![],this[_0x013b('0x2b')]['bind'](this));}}};EmailImap[_0x013b('0x16')][_0x013b('0x31')]=function(_0x275400){_0x275400['on'](_0x013b('0x34'),this[_0x013b('0x35')]['bind'](this));_0x275400[_0x013b('0xe')](_0x013b('0x36'),this[_0x013b('0x37')]['bind'](this));_0x275400[_0x013b('0xe')](_0x013b('0x11'),this[_0x013b('0x38')][_0x013b('0x2d')](this));};EmailImap[_0x013b('0x16')]['handleMessageBody']=function(_0x111051){simpleParser(_0x111051,{'Iconv':Iconv},this[_0x013b('0x39')][_0x013b('0x2d')](this));};EmailImap[_0x013b('0x16')][_0x013b('0x37')]=function(){};EmailImap['prototype'][_0x013b('0x38')]=function(){};EmailImap[_0x013b('0x16')]['handleSimpleParser']=function(_0xd59023,_0x240df4){if(_0xd59023){logger[_0x013b('0x12')](_0xd59023);}else{var _0x1d057d=this;utils[_0x013b('0x3a')](this['account'],_0x240df4,function(_0x1741ca){_0x1d057d['emit']('email',_0x1741ca);});}};EmailImap[_0x013b('0x16')]['handleFetchEnd']=function(){this[_0x013b('0xd')]['closeBox'](!![],this['handleCloseBox'][_0x013b('0x2d')](this));};EmailImap[_0x013b('0x16')][_0x013b('0x32')]=function(_0x5f2e83){this[_0x013b('0x13')](_0x5f2e83);this['imap']['closeBox'](!![],this[_0x013b('0x2b')][_0x013b('0x2d')](this));};EmailImap['prototype'][_0x013b('0x3b')]=function(){this[_0x013b('0x29')]('end');};EmailImap[_0x013b('0x16')]['handleError']=function(_0x11b14d,_0x4656c6){logger[_0x013b('0x12')](_0x013b('0x13'),this[_0x013b('0xb')][_0x013b('0x9')],JSON['stringify'](_0x11b14d));var _0x44d48a='';if(_0x11b14d){if(_0x11b14d[_0x013b('0x3c')]){_0x44d48a=_0x11b14d[_0x013b('0x3c')];}else{for(var _0x4ccf4e in _0x11b14d){if(_0x11b14d['hasOwnProperty'](_0x4ccf4e)){_0x44d48a+=_[_0x013b('0x3d')](_0x4ccf4e)+':\x20'+_0x11b14d[_0x4ccf4e]+'\x0a';}}}}if(_0x4656c6){this['imap'][_0x013b('0x11')]();}else{this[_0x013b('0x29')](_0x013b('0x12'),_0x44d48a);this['emit'](_0x013b('0x11'));}};module[_0x013b('0x3e')]=EmailImap; \ No newline at end of file +var _0x6614=['handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','error','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','mailparser','simpleParser','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','once','handleReady','bind','end','handleEnd','handleError','connect','prototype','connTimeout','authTimeout','user','xoauth2','generateXOAuth2Token','CloudProvider','password','host','port','tls','autotls','required','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message'];(function(_0x1b603b,_0x5ae181){var _0x24f28a=function(_0x44ebe3){while(--_0x44ebe3){_0x1b603b['push'](_0x1b603b['shift']());}};_0x24f28a(++_0x5ae181);}(_0x6614,0x179));var _0x4661=function(_0x5b1370,_0x5beac4){_0x5b1370=_0x5b1370-0x0;var _0xf5075d=_0x6614[_0x5b1370];return _0xf5075d;};'use strict';var _=require(_0x4661('0x0'));var util=require('util');var Imap=require(_0x4661('0x1'));var simpleParser=require(_0x4661('0x2'))[_0x4661('0x3')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0x4661('0x4'))[_0x4661('0x5')];var utils=require(_0x4661('0x6'));var logger=require(_0x4661('0x7'))(_0x4661('0x8'));function EmailImap(_0x31259e,_0x24bc56){this[_0x4661('0x9')]=_0x31259e[_0x4661('0x9')];this[_0x4661('0xa')]=this[_0x4661('0xb')](_0x31259e,_0x24bc56);this[_0x4661('0x1')]=new Imap(this[_0x4661('0xa')]);this['imap'][_0x4661('0xc')]('ready',this[_0x4661('0xd')][_0x4661('0xe')](this));this['imap'][_0x4661('0xc')](_0x4661('0xf'),this[_0x4661('0x10')][_0x4661('0xe')](this));this[_0x4661('0x1')]['on']('error',this[_0x4661('0x11')][_0x4661('0xe')](this));this[_0x4661('0x1')][_0x4661('0x12')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x4661('0x13')]['getAccount']=function(_0x433c56,_0x5d6597){var _0xd5b1bf={'connTimeout':_0x433c56[_0x4661('0x14')]?_0x433c56['connTimeout']*0x3e8:0x2710,'authTimeout':_0x433c56[_0x4661('0x15')]?_0x433c56[_0x4661('0x15')]*0x3e8:0x1388};if(_0x433c56['service']){_0xd5b1bf[_0x4661('0x16')]=_0x433c56['user'];if(_0x433c56['modernAuthentication']){_0xd5b1bf[_0x4661('0x17')]=utils[_0x4661('0x18')](_0x433c56[_0x4661('0x19')]['data5'],_0x433c56[_0x4661('0x16')]);}else{_0xd5b1bf[_0x4661('0x1a')]=_0x433c56[_0x4661('0x1a')];}}else{if(_0x433c56['authentication']){_0xd5b1bf['user']=_0x433c56[_0x4661('0x16')];_0xd5b1bf['password']=_0x433c56[_0x4661('0x1a')];}}_0xd5b1bf[_0x4661('0x8')]=_0x5d6597||_0x433c56[_0x4661('0x16')]||'anonymous@xcally.com';_0xd5b1bf[_0x4661('0x1b')]=_0x433c56[_0x4661('0x1b')];_0xd5b1bf[_0x4661('0x1c')]=_0x433c56[_0x4661('0x1c')]||0x3e1;if(_0x433c56[_0x4661('0x1d')]){_0xd5b1bf[_0x4661('0x1d')]=!![];}else{_0xd5b1bf[_0x4661('0x1d')]=![];_0xd5b1bf[_0x4661('0x1e')]=_0x4661('0x1f');}return _0xd5b1bf;};EmailImap['prototype']['handleReady']=function(){this[_0x4661('0x1')][_0x4661('0x20')](this[_0x4661('0x9')],![],this[_0x4661('0x21')][_0x4661('0xe')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x5b211a,_0x455ac3){if(_0x5b211a){this['handleError'](_0x5b211a,!![]);}else{this[_0x4661('0x22')]('box',_0x455ac3);this[_0x4661('0x23')]();}};EmailImap[_0x4661('0x13')][_0x4661('0x24')]=function(_0x182f04){if(_0x182f04){this[_0x4661('0x11')](_0x182f04,!![]);}else{this[_0x4661('0x1')][_0x4661('0xf')]();}};EmailImap[_0x4661('0x13')][_0x4661('0x23')]=function(){this['imap'][_0x4661('0x25')]([_0x4661('0x26')],this[_0x4661('0x27')][_0x4661('0xe')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x496f4b,_0x44a5d2){if(_0x496f4b){this[_0x4661('0x11')](_0x496f4b,!![]);}else{if(_0x44a5d2[_0x4661('0x28')]){try{var _0x3e669c=this['imap'][_0x4661('0x29')](_0x44a5d2,{'bodies':'','markSeen':!![]});_0x3e669c['on'](_0x4661('0x2a'),this[_0x4661('0x2b')][_0x4661('0xe')](this));_0x3e669c[_0x4661('0xc')]('error',this[_0x4661('0x2c')][_0x4661('0xe')](this));_0x3e669c['once'](_0x4661('0xf'),this[_0x4661('0x2d')][_0x4661('0xe')](this));}catch(_0x3ae895){logger['error'](_0x3ae895);}}else{this[_0x4661('0x1')][_0x4661('0x2e')](!![],this['handleCloseBox'][_0x4661('0xe')](this));}}};EmailImap[_0x4661('0x13')]['handleFetchMessage']=function(_0x4badf2){_0x4badf2['on'](_0x4661('0x2f'),this[_0x4661('0x30')]['bind'](this));_0x4badf2[_0x4661('0xc')](_0x4661('0x31'),this[_0x4661('0x32')][_0x4661('0xe')](this));_0x4badf2[_0x4661('0xc')](_0x4661('0xf'),this[_0x4661('0x33')]['bind'](this));};EmailImap['prototype']['handleMessageBody']=function(_0x1ef0dc){simpleParser(_0x1ef0dc,{'Iconv':Iconv},this[_0x4661('0x34')][_0x4661('0xe')](this));};EmailImap[_0x4661('0x13')]['handleMessageAttributes']=function(){};EmailImap[_0x4661('0x13')][_0x4661('0x33')]=function(){};EmailImap[_0x4661('0x13')][_0x4661('0x34')]=function(_0x4bf023,_0x534a37){if(_0x4bf023){logger[_0x4661('0x35')](_0x4bf023);}else{var _0x12c092=this;utils[_0x4661('0x36')](this[_0x4661('0xa')],_0x534a37,function(_0x1bc790){_0x12c092[_0x4661('0x22')](_0x4661('0x8'),_0x1bc790);});}};EmailImap['prototype'][_0x4661('0x2d')]=function(){this['imap'][_0x4661('0x2e')](!![],this[_0x4661('0x24')]['bind'](this));};EmailImap[_0x4661('0x13')]['handleFetchError']=function(_0x32a838){this['handleError'](_0x32a838);this[_0x4661('0x1')][_0x4661('0x2e')](!![],this['handleCloseBox'][_0x4661('0xe')](this));};EmailImap[_0x4661('0x13')][_0x4661('0x10')]=function(){this[_0x4661('0x22')](_0x4661('0xf'));};EmailImap['prototype'][_0x4661('0x11')]=function(_0x296a30,_0x38c8c5){logger[_0x4661('0x35')](_0x4661('0x11'),this[_0x4661('0xa')][_0x4661('0x8')],JSON[_0x4661('0x37')](_0x296a30));var _0x22dd0c='';if(_0x296a30){if(_0x296a30['textCode']){_0x22dd0c=_0x296a30[_0x4661('0x38')];}else{for(var _0x52b0ee in _0x296a30){if(_0x296a30[_0x4661('0x39')](_0x52b0ee)){_0x22dd0c+=_[_0x4661('0x3a')](_0x52b0ee)+':\x20'+_0x296a30[_0x52b0ee]+'\x0a';}}}}if(_0x38c8c5){this['imap']['end']();}else{this['emit'](_0x4661('0x35'),_0x22dd0c);this[_0x4661('0x22')]('end');}};module[_0x4661('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 1829641..3776d61 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 _0x3740=['exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired'];(function(_0x4e0159,_0x528421){var _0x2e0d6d=function(_0x495e9e){while(--_0x495e9e){_0x4e0159['push'](_0x4e0159['shift']());}};_0x2e0d6d(++_0x528421);}(_0x3740,0x181));var _0x0374=function(_0x317497,_0x2d6cf7){_0x317497=_0x317497-0x0;var _0x3445b0=_0x3740[_0x317497];return _0x3445b0;};'use strict';var nodemailer=require(_0x0374('0x0'));var inlineBase64=require(_0x0374('0x1'));function EmailSmtp(){}EmailSmtp[_0x0374('0x2')][_0x0374('0x3')]=function(_0x327c3a,_0x1e8252){return new Promise(function(_0x3c89a7,_0x294f12){var _0x3614f8=nodemailer[_0x0374('0x4')](_0x327c3a);_0x3614f8[_0x0374('0x5')](_0x0374('0x6'),inlineBase64());_0x3614f8[_0x0374('0x7')](_0x1e8252,function(_0x520cf7,_0x3ee9f7){if(_0x520cf7){_0x294f12(_0x520cf7[_0x0374('0x8')]());}else{_0x3c89a7(_0x3ee9f7);}});});};EmailSmtp[_0x0374('0x2')]['verify']=function(_0x214541){return new Promise(function(_0xe0f475,_0x5032a2){var _0x30c42c=nodemailer['createTransport'](_0x214541);_0x30c42c[_0x0374('0x9')](function(_0x1a9952,_0x42a0c8){if(_0x1a9952){_0x5032a2(_0x1a9952[_0x0374('0x8')]());}else{if(_0x42a0c8){_0xe0f475(_0x42a0c8);}else{_0x5032a2(_0x0374('0xa'));}}});});};module[_0x0374('0xb')]=EmailSmtp; \ No newline at end of file +var _0xbb4e=['toString','verify','nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport','compile'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbb4e,0xc6));var _0xebb4=function(_0x53e3de,_0x13da7b){_0x53e3de=_0x53e3de-0x0;var _0x7b905b=_0xbb4e[_0x53e3de];return _0x7b905b;};'use strict';var nodemailer=require(_0xebb4('0x0'));var inlineBase64=require(_0xebb4('0x1'));function EmailSmtp(){}EmailSmtp[_0xebb4('0x2')]['send']=function(_0x4bfcab,_0xc42c0d){return new Promise(function(_0x3aeb8c,_0x4f9b9a){var _0x44b28b=nodemailer[_0xebb4('0x3')](_0x4bfcab);_0x44b28b['use'](_0xebb4('0x4'),inlineBase64());_0x44b28b['sendMail'](_0xc42c0d,function(_0x40ead6,_0xced7fa){if(_0x40ead6){_0x4f9b9a(_0x40ead6[_0xebb4('0x5')]());}else{_0x3aeb8c(_0xced7fa);}});});};EmailSmtp[_0xebb4('0x2')][_0xebb4('0x6')]=function(_0x249640){return new Promise(function(_0x10c0f1,_0x235bb9){var _0x20c741=nodemailer['createTransport'](_0x249640);_0x20c741[_0xebb4('0x6')](function(_0xb25082,_0x50ed38){if(_0xb25082){_0x235bb9(_0xb25082['toString']());}else{if(_0x50ed38){_0x10c0f1(_0x50ed38);}else{_0x235bb9('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 e2f6885..488ba80 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 _0x2490=['split','length','slice','join','Anonymous','pop','isEmpty','@xcally.com','test','html','replace','includes','forEach','push','filename','_SRC','_IMG','\x20[Attachment:\x20','body','textAsHtml','originTo','message','originCc','bcc','attachments','attach','type','attachment','attachment-','format','now','root','server/files/attachments/','writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','isAutoreply','from','subject','messageId','inReplyTo','date','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','path','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','name','substring','indexOf'];(function(_0x6c2cd2,_0x4d6050){var _0x49bbad=function(_0x2f8881){while(--_0x2f8881){_0x6c2cd2['push'](_0x6c2cd2['shift']());}};_0x49bbad(++_0x4d6050);}(_0x2490,0x7e));var _0x0249=function(_0x4e3cbd,_0x1e40c6){_0x4e3cbd=_0x4e3cbd-0x0;var _0x38fd98=_0x2490[_0x4e3cbd];return _0x38fd98;};'use strict';var _=require('lodash');var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0x0249('0x0'));var util=require('util');var tnef=require(_0x0249('0x1'));var logger=require(_0x0249('0x2'))(_0x0249('0x3'));var config=require('../../../config/environment');function getAddress(_0x2fde52){var _0x3dfb08=_[_0x0249('0x4')](_0x2fde52[_0x0249('0x5')]);return _0x3dfb08&&_0x3dfb08[_0x0249('0x6')]?_0x3dfb08[_0x0249('0x6')]:_0x0249('0x7')+random[_0x0249('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x398e0a){var _0x4deca3=_[_0x0249('0x4')](_0x398e0a['value']);if(_0x4deca3&&_0x4deca3[_0x0249('0x9')]){if(_0x4deca3[_0x0249('0x9')]==_0x4deca3['address']){return _0x4deca3[_0x0249('0x9')][_0x0249('0xa')](0x0,_0x4deca3['name'][_0x0249('0xb')]('@'));}var _0x776d=_0x4deca3[_0x0249('0x9')][_0x0249('0xc')](/\s+/);return _0x776d[_0x0249('0xd')]>0x1?_0x776d[_0x0249('0xe')](0x0,-0x1)[_0x0249('0xf')]('\x20'):_0x4deca3[_0x0249('0x9')];}return _0x0249('0x10');}function getLastName(_0x554a59){var _0x21d107=_[_0x0249('0x4')](_0x554a59[_0x0249('0x5')]);if(_0x21d107&&_0x21d107['name']){var _0x11b40d=_0x21d107[_0x0249('0x9')][_0x0249('0xc')](/\s+/);return _0x11b40d['length']>0x1?_0x11b40d[_0x0249('0x11')]():'';}return'';}function getMails(_0x520165,_0x1439b2){var _0x4f8692='';for(var _0x1d394b=0x0;_0x1d394b<_0x1439b2[_0x0249('0x5')][_0x0249('0xd')];_0x1d394b+=0x1){if(_0x1439b2[_0x0249('0x5')][_0x1d394b][_0x0249('0x6')]!==_0x520165){if(!_[_0x0249('0x12')](_0x4f8692)){_0x4f8692+=',';}_0x4f8692+=_0x1439b2[_0x0249('0x5')][_0x1d394b][_0x0249('0x9')]||_0x1439b2['value'][_0x1d394b][_0x0249('0x6')]||'';_0x4f8692+='\x20<';_0x4f8692+=_0x1439b2[_0x0249('0x5')][_0x1d394b]['address']?_0x1439b2[_0x0249('0x5')][_0x1d394b][_0x0249('0x6')]:_0x0249('0x7')+random['generate'](0x6)+_0x0249('0x13');_0x4f8692+='>';}}return _0x4f8692;}function parseEmail(_0x5bb444,_0x4ff7d4,_0x565769){if(_0x4ff7d4['html']){var _0x503813=/)<[^<]*)*<\/script>/gi;while(_0x503813[_0x0249('0x14')](_0x4ff7d4[_0x0249('0x15')])){_0x4ff7d4[_0x0249('0x15')]=_0x4ff7d4['html'][_0x0249('0x16')](_0x503813,'');}if(_0x4ff7d4[_0x0249('0x15')][_0x0249('0x17')]('{_0x3c59a6[_0x0249('0x19')](_0x23268e[_0x0249('0x1a')]);});var _0x110aba=/]+>/g;var _0x28fc8e=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x43c1d2=_0x4ff7d4[_0x0249('0x15')][_0x0249('0x16')](_0x28fc8e,_0x0249('0x1b'));var _0x3b271a=_0x43c1d2['replace'](_0x110aba,_0x0249('0x1c'));for(let _0xcf316b=0x0;_0xcf316b<_0x3c59a6[_0x0249('0xd')];_0xcf316b++){var _0x585baa=_0x3b271a['replace'](_0x0249('0x1c'),_0x0249('0x1d')+_0x3c59a6[_0xcf316b]+'\x20]');_0x3b271a=_0x585baa;}_0x4ff7d4['html']=_0x3b271a;}_0x565769[_0x0249('0x1e')]=_0x4ff7d4[_0x0249('0x15')];}else{_0x565769[_0x0249('0x1e')]=_0x4ff7d4[_0x0249('0x1f')];}if(_0x565769[_0x0249('0x1e')]){_0x565769[_0x0249('0x1e')]=_0x565769[_0x0249('0x1e')][_0x0249('0x16')](/0x0){var _0x6f8449=[_0x0249('0x30'),_0x0249('0x31'),_0x0249('0x32')];for(var _0x537dd9=0x0;_0x537dd9<_0x4ff7d4[_0x0249('0x2f')][_0x0249('0xd')];_0x537dd9++){var _0x31726f=_['indexOf'](_0x6f8449,_0x4ff7d4[_0x0249('0x2f')][_0x537dd9]['line']);if(_0x31726f>=0x0){_0x565769[_0x0249('0x33')]=!![];}}}return _0x565769;}exports['parser']=function(_0x5772cb,_0x366d3a,_0x16f77e){var _0x16ac88={'from':getAddress(_0x366d3a['from']),'firstName':getFirstName(_0x366d3a[_0x0249('0x34')]),'lastName':getLastName(_0x366d3a[_0x0249('0x34')]),'mapKey':_0x0249('0x3'),'message':{'from':getMails(_0x5772cb[_0x0249('0x3')],_0x366d3a[_0x0249('0x34')]),'to':_0x5772cb['email'],'cc':'','subject':_0x366d3a[_0x0249('0x35')]||'','messageId':_0x366d3a[_0x0249('0x36')],'inReplyTo':_0x366d3a[_0x0249('0x37')],'sentAt':moment(_0x366d3a[_0x0249('0x38')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x366d3a[_0x0249('0x15')]&&!_0x366d3a[_0x0249('0x1f')]){var _0x524586=_['filter'](_0x366d3a[_0x0249('0x24')],{'contentType':'application/ms-tnef'});if(_0x524586['length']){logger['info'](util[_0x0249('0x29')](_0x0249('0x39'),_0x366d3a[_0x0249('0x36')]));tnef[_0x0249('0x3a')](_[_0x0249('0x3b')](_0x524586)[_0x0249('0x2e')],function(_0x1280a0,_0x1191ce){if(_0x1191ce){_0x366d3a[_0x0249('0x15')]=_0x1191ce[_0x0249('0x3c')]||_0x0249('0x3d');if(_0x1191ce[_0x0249('0x3e')]){for(var _0x556c92=0x0;_0x556c92<_0x1191ce[_0x0249('0x3e')][_0x0249('0xd')];_0x556c92++){var _0x59ba48=_0x1191ce['Attachments'][_0x556c92];_0x16ac88[_0x0249('0x21')]['attachments'][_0x0249('0x19')]({'filename':_0x59ba48['Title'],'content':Buffer[_0x0249('0x34')](_0x59ba48[_0x0249('0x3f')])});}}}_0x16f77e(parseEmail(_0x5772cb,_0x366d3a,_0x16ac88));});}else{_0x366d3a[_0x0249('0x15')]=_0x0249('0x3d');_0x16f77e(parseEmail(_0x5772cb,_0x366d3a,_0x16ac88));}}else{_0x16f77e(parseEmail(_0x5772cb,_0x366d3a,_0x16ac88));}};exports[_0x0249('0x40')]=function(_0x33cdba,_0x364a1a){var _0x3f16e5=[_0x0249('0x41')+(_0x364a1a||''),_0x0249('0x42')+_0x33cdba,'',''];return Buffer[_0x0249('0x34')](_0x3f16e5[_0x0249('0xf')](''),_0x0249('0x43'))[_0x0249('0x44')]('base64');}; \ No newline at end of file +var _0x9c28=['path','util','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','split','length','slice','Anonymous','pop','isEmpty','html','replace','includes','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','join','utf-8','toString','base64','moment','randomstring'];(function(_0x265e15,_0x14ad15){var _0x1517cc=function(_0x15d186){while(--_0x15d186){_0x265e15['push'](_0x265e15['shift']());}};_0x1517cc(++_0x14ad15);}(_0x9c28,0x96));var _0x89c2=function(_0x3b7fdd,_0x22a807){_0x3b7fdd=_0x3b7fdd-0x0;var _0x1c7c60=_0x9c28[_0x3b7fdd];return _0x1c7c60;};'use strict';var _=require('lodash');var moment=require(_0x89c2('0x0'));var random=require(_0x89c2('0x1'));var fs=require('fs');var path=require(_0x89c2('0x2'));var util=require(_0x89c2('0x3'));var tnef=require('node-tnef');var logger=require(_0x89c2('0x4'))(_0x89c2('0x5'));var config=require(_0x89c2('0x6'));function getAddress(_0x367557){var _0x4c35cf=_[_0x89c2('0x7')](_0x367557[_0x89c2('0x8')]);return _0x4c35cf&&_0x4c35cf[_0x89c2('0x9')]?_0x4c35cf[_0x89c2('0x9')]:_0x89c2('0xa')+random[_0x89c2('0xb')](0x6)+_0x89c2('0xc');}function getFirstName(_0x2c5824){var _0x122281=_['head'](_0x2c5824[_0x89c2('0x8')]);if(_0x122281&&_0x122281[_0x89c2('0xd')]){if(_0x122281[_0x89c2('0xd')]==_0x122281[_0x89c2('0x9')]){return _0x122281[_0x89c2('0xd')][_0x89c2('0xe')](0x0,_0x122281[_0x89c2('0xd')]['indexOf']('@'));}var _0x4a73d2=_0x122281[_0x89c2('0xd')][_0x89c2('0xf')](/\s+/);return _0x4a73d2[_0x89c2('0x10')]>0x1?_0x4a73d2[_0x89c2('0x11')](0x0,-0x1)['join']('\x20'):_0x122281[_0x89c2('0xd')];}return _0x89c2('0x12');}function getLastName(_0x8f646){var _0x430caa=_[_0x89c2('0x7')](_0x8f646[_0x89c2('0x8')]);if(_0x430caa&&_0x430caa[_0x89c2('0xd')]){var _0x1c349c=_0x430caa[_0x89c2('0xd')][_0x89c2('0xf')](/\s+/);return _0x1c349c[_0x89c2('0x10')]>0x1?_0x1c349c[_0x89c2('0x13')]():'';}return'';}function getMails(_0x1aca8a,_0x2d79c){var _0x1e5166='';for(var _0x4d7d8f=0x0;_0x4d7d8f<_0x2d79c['value'][_0x89c2('0x10')];_0x4d7d8f+=0x1){if(_0x2d79c[_0x89c2('0x8')][_0x4d7d8f][_0x89c2('0x9')]!==_0x1aca8a){if(!_[_0x89c2('0x14')](_0x1e5166)){_0x1e5166+=',';}_0x1e5166+=_0x2d79c[_0x89c2('0x8')][_0x4d7d8f][_0x89c2('0xd')]||_0x2d79c[_0x89c2('0x8')][_0x4d7d8f][_0x89c2('0x9')]||'';_0x1e5166+='\x20<';_0x1e5166+=_0x2d79c[_0x89c2('0x8')][_0x4d7d8f]['address']?_0x2d79c[_0x89c2('0x8')][_0x4d7d8f]['address']:_0x89c2('0xa')+random['generate'](0x6)+'@xcally.com';_0x1e5166+='>';}}return _0x1e5166;}function parseEmail(_0x660988,_0x16ff00,_0x1b2399){if(_0x16ff00[_0x89c2('0x15')]){var _0x717a9f=/)<[^<]*)*<\/script>/gi;while(_0x717a9f['test'](_0x16ff00[_0x89c2('0x15')])){_0x16ff00['html']=_0x16ff00[_0x89c2('0x15')][_0x89c2('0x16')](_0x717a9f,'');}if(_0x16ff00[_0x89c2('0x15')][_0x89c2('0x17')](_0x89c2('0x18'))){var _0x1d9ece=[];_0x16ff00['attachments'][_0x89c2('0x19')](_0x42aede=>{_0x1d9ece[_0x89c2('0x1a')](_0x42aede[_0x89c2('0x1b')]);});var _0x174f1e=/]+>/g;var _0x401a1c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x570514=_0x16ff00[_0x89c2('0x15')][_0x89c2('0x16')](_0x401a1c,_0x89c2('0x1c'));var _0x2a0baf=_0x570514[_0x89c2('0x16')](_0x174f1e,_0x89c2('0x1d'));for(let _0x23cde6=0x0;_0x23cde6<_0x1d9ece[_0x89c2('0x10')];_0x23cde6++){var _0x1bab28=_0x2a0baf[_0x89c2('0x16')](_0x89c2('0x1d'),_0x89c2('0x1e')+_0x1d9ece[_0x23cde6]+_0x89c2('0x1f'));_0x2a0baf=_0x1bab28;}_0x16ff00[_0x89c2('0x15')]=_0x2a0baf;}_0x1b2399[_0x89c2('0x20')]=_0x16ff00[_0x89c2('0x15')];}else{_0x1b2399[_0x89c2('0x20')]=_0x16ff00['textAsHtml'];}if(_0x1b2399['body']){_0x1b2399[_0x89c2('0x20')]=_0x1b2399[_0x89c2('0x20')][_0x89c2('0x16')](/0x0){var _0xe4f7f8=[_0x89c2('0x30'),_0x89c2('0x31'),'Precedence:\x20auto_reply'];for(var _0x249315=0x0;_0x249315<_0x16ff00[_0x89c2('0x32')][_0x89c2('0x10')];_0x249315++){var _0x38952f=_[_0x89c2('0x33')](_0xe4f7f8,_0x16ff00['headerLines'][_0x249315]['line']);if(_0x38952f>=0x0){_0x1b2399[_0x89c2('0x34')]=!![];}}}return _0x1b2399;}exports[_0x89c2('0x35')]=function(_0x2338de,_0x5bbcd0,_0x4a0efb){var _0x18924e={'from':getAddress(_0x5bbcd0[_0x89c2('0x36')]),'firstName':getFirstName(_0x5bbcd0[_0x89c2('0x36')]),'lastName':getLastName(_0x5bbcd0['from']),'mapKey':_0x89c2('0x5'),'message':{'from':getMails(_0x2338de[_0x89c2('0x5')],_0x5bbcd0[_0x89c2('0x36')]),'to':_0x2338de[_0x89c2('0x5')],'cc':'','subject':_0x5bbcd0[_0x89c2('0x37')]||'','messageId':_0x5bbcd0[_0x89c2('0x38')],'inReplyTo':_0x5bbcd0[_0x89c2('0x39')],'sentAt':moment(_0x5bbcd0[_0x89c2('0x3a')])[_0x89c2('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x5bbcd0[_0x89c2('0x15')]&&!_0x5bbcd0[_0x89c2('0x3b')]){var _0x1c15bb=_[_0x89c2('0x3c')](_0x5bbcd0['attachments'],{'contentType':_0x89c2('0x3d')});if(_0x1c15bb['length']){logger['info'](util[_0x89c2('0x2a')](_0x89c2('0x3e'),_0x5bbcd0[_0x89c2('0x38')]));tnef[_0x89c2('0x3f')](_[_0x89c2('0x40')](_0x1c15bb)['content'],function(_0x3137e6,_0x2ddfce){if(_0x2ddfce){_0x5bbcd0[_0x89c2('0x15')]=_0x2ddfce['BodyHTML']||_0x89c2('0x41');if(_0x2ddfce['Attachments']){for(var _0x4e0777=0x0;_0x4e0777<_0x2ddfce[_0x89c2('0x42')]['length'];_0x4e0777++){var _0x3f3a81=_0x2ddfce[_0x89c2('0x42')][_0x4e0777];_0x18924e[_0x89c2('0x22')][_0x89c2('0x26')][_0x89c2('0x1a')]({'filename':_0x3f3a81[_0x89c2('0x43')],'content':Buffer[_0x89c2('0x36')](_0x3f3a81[_0x89c2('0x44')])});}}}_0x4a0efb(parseEmail(_0x2338de,_0x5bbcd0,_0x18924e));});}else{_0x5bbcd0[_0x89c2('0x15')]='

Empty\x20message

';_0x4a0efb(parseEmail(_0x2338de,_0x5bbcd0,_0x18924e));}}else{_0x4a0efb(parseEmail(_0x2338de,_0x5bbcd0,_0x18924e));}};exports[_0x89c2('0x45')]=function(_0x8610db,_0x25705f){var _0x595034=[_0x89c2('0x46')+(_0x25705f||''),_0x89c2('0x47')+_0x8610db,'',''];return Buffer[_0x89c2('0x36')](_0x595034[_0x89c2('0x48')](''),_0x89c2('0x49'))[_0x89c2('0x4a')](_0x89c2('0x4b'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index e8f22f0..b1dd439 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 _0x88a8=['SERV','active','Imap','Smtp','lodash','name','Service','key'];(function(_0x4a038b,_0x45363d){var _0x3ef9f6=function(_0x44e9d2){while(--_0x44e9d2){_0x4a038b['push'](_0x4a038b['shift']());}};_0x3ef9f6(++_0x45363d);}(_0x88a8,0x64));var _0x888a=function(_0x362765,_0xde1a2e){_0x362765=_0x362765-0x0;var _0xabcb20=_0x88a8[_0x362765];return _0xabcb20;};'use strict';var _=require(_0x888a('0x0'));function MailAccount(_0x50f516){this['id']=_0x50f516['id']||0x0;this[_0x888a('0x1')]=_0x50f516[_0x888a('0x1')]||_0x888a('0x2');this[_0x888a('0x3')]=_0x50f516[_0x888a('0x3')]||_0x888a('0x4');this[_0x888a('0x5')]=_0x50f516[_0x888a('0x5')]||![];this[_0x888a('0x6')]=_0x50f516['Imap']||[];this[_0x888a('0x7')]=_0x50f516[_0x888a('0x7')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xad36=['name','Service','key','SERV','active','Imap','lodash'];(function(_0x59ffc9,_0x238864){var _0xe946c5=function(_0x5e1ba8){while(--_0x5e1ba8){_0x59ffc9['push'](_0x59ffc9['shift']());}};_0xe946c5(++_0x238864);}(_0xad36,0x84));var _0x6ad3=function(_0x55260a,_0x4a1efa){_0x55260a=_0x55260a-0x0;var _0x584374=_0xad36[_0x55260a];return _0x584374;};'use strict';var _=require(_0x6ad3('0x0'));function MailAccount(_0x3e0fbf){this['id']=_0x3e0fbf['id']||0x0;this['name']=_0x3e0fbf[_0x6ad3('0x1')]||_0x6ad3('0x2');this[_0x6ad3('0x3')]=_0x3e0fbf[_0x6ad3('0x3')]||_0x6ad3('0x4');this[_0x6ad3('0x5')]=_0x3e0fbf[_0x6ad3('0x5')]||![];this[_0x6ad3('0x6')]=_0x3e0fbf[_0x6ad3('0x6')]||[];this['Smtp']=_0x3e0fbf['Smtp']||[];}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 04c19e2..5269ba2 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 _0x8ab4=['merge','lodash','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x8ab4,0x1c3));var _0x48ab=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x8ab4[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x48ab('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x48ab('0x1')]={};};function freeIsNotKey(_0x2f5058,_0x3577a6,_0x31400f){var _0x219a11=_[_0x48ab('0x2')](_0x2f5058,function(_0x4c79a7,_0xd51d89){return _0x4c79a7[_0x31400f];});for(var _0x43c2ca in _0x3577a6){if(_0x3577a6[_0x48ab('0x3')](_0x43c2ca)){if(!_0x219a11[_0x43c2ca]){delete _0x3577a6[_0x43c2ca];}}}}Realtime[_0x48ab('0x4')][_0x48ab('0x5')]=function(_0x1e78cf,_0x216df7){for(var _0x223624 in _0x216df7){if(_0x1e78cf[_0x48ab('0x3')](_0x223624)){_0x1e78cf[_0x223624]=_0x216df7[_0x223624];}}};Realtime['prototype'][_0x48ab('0x6')]=function(){var _0x348991=this;return function(_0x1687d8){if(_0x1687d8){freeIsNotKey(_0x1687d8,_0x348991['mailAccounts'],'id');for(var _0x5a67e8=0x0,_0x3be5b1={},_0x317c04={};_0x5a67e8<_0x1687d8[_0x48ab('0x7')];_0x5a67e8+=0x1){_0x3be5b1=_0x1687d8[_0x5a67e8];if(_[_0x48ab('0x8')](_0x348991[_0x48ab('0x1')][_0x3be5b1['id']])){_0x348991[_0x48ab('0x1')][_0x3be5b1['id']]=new MailAccount(_0x3be5b1);}else{_[_0x48ab('0x9')](_0x348991[_0x48ab('0x1')][_0x3be5b1['id']],_0x3be5b1);}}}return _0x348991[_0x48ab('0x1')];};};module['exports']=Realtime; \ No newline at end of file +var _0x166f=['lodash','../model/mailAccount','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','merge','exports'];(function(_0x47d6b2,_0x374239){var _0x3367af=function(_0x480d15){while(--_0x480d15){_0x47d6b2['push'](_0x47d6b2['shift']());}};_0x3367af(++_0x374239);}(_0x166f,0x186));var _0xf166=function(_0x24e842,_0x29a1bc){_0x24e842=_0x24e842-0x0;var _0x1d370f=_0x166f[_0x24e842];return _0x1d370f;};'use strict';var _=require(_0xf166('0x0'));var MailAccount=require(_0xf166('0x1'));var Realtime=function(){this[_0xf166('0x2')]={};};function freeIsNotKey(_0x2ffbbc,_0x42e9df,_0xfc5f67){var _0x5d2bce=_['mapKeys'](_0x2ffbbc,function(_0x19abf0,_0x513c98){return _0x19abf0[_0xfc5f67];});for(var _0x4c219e in _0x42e9df){if(_0x42e9df[_0xf166('0x3')](_0x4c219e)){if(!_0x5d2bce[_0x4c219e]){delete _0x42e9df[_0x4c219e];}}}}Realtime[_0xf166('0x4')][_0xf166('0x5')]=function(_0x352f3e,_0x415903){for(var _0x2c8031 in _0x415903){if(_0x352f3e[_0xf166('0x3')](_0x2c8031)){_0x352f3e[_0x2c8031]=_0x415903[_0x2c8031];}}};Realtime[_0xf166('0x4')][_0xf166('0x6')]=function(){var _0x48be8a=this;return function(_0x5950d2){if(_0x5950d2){freeIsNotKey(_0x5950d2,_0x48be8a[_0xf166('0x2')],'id');for(var _0x1e9e95=0x0,_0xba190a={},_0x1eb76f={};_0x1e9e95<_0x5950d2[_0xf166('0x7')];_0x1e9e95+=0x1){_0xba190a=_0x5950d2[_0x1e9e95];if(_['isUndefined'](_0x48be8a['mailAccounts'][_0xba190a['id']])){_0x48be8a[_0xf166('0x2')][_0xba190a['id']]=new MailAccount(_0xba190a);}else{_[_0xf166('0x8')](_0x48be8a['mailAccounts'][_0xba190a['id']],_0xba190a);}}}return _0x48be8a[_0xf166('0x2')];};};module[_0xf166('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 3f1425a..53f59a7 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 _0xfdcd=['type','MailServerOut','data5','getMailAccount','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','provider','service','email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','name'];(function(_0x2d0a8a,_0x2e2305){var _0x4de8ba=function(_0x9f08bb){while(--_0x9f08bb){_0x2d0a8a['push'](_0x2d0a8a['shift']());}};_0x4de8ba(++_0x2e2305);}(_0xfdcd,0xe9));var _0xdfdc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfdcd[_0x2dafbe];return _0x58a45a;};'use strict';var client=require('../client');exports[_0xdfdc('0x0')]=function(){return function(){return client[_0xdfdc('0x1')](_0xdfdc('0x2'),{'options':{'attributes':['id','name',_0xdfdc('0x3'),_0xdfdc('0x4'),_0xdfdc('0x5'),_0xdfdc('0x6'),_0xdfdc('0x7'),_0xdfdc('0x8'),_0xdfdc('0x9')],'raw':![],'include':[{'model':_0xdfdc('0xa'),'as':_0xdfdc('0xb'),'include':[{'model':_0xdfdc('0xc'),'attributes':['id',_0xdfdc('0xd'),_0xdfdc('0x4'),_0xdfdc('0xe'),'data5'],'as':_0xdfdc('0xc')}]},{'model':_0xdfdc('0xf'),'as':'Smtp','include':[{'model':_0xdfdc('0xc'),'attributes':['id',_0xdfdc('0xd'),_0xdfdc('0x4'),_0xdfdc('0xe'),_0xdfdc('0x10')],'as':'CloudProvider'}]}]},'log':_0xdfdc('0x11')});};};exports['notify']=function(_0x4a9418,_0x29d282){return client[_0xdfdc('0x1')](_0xdfdc('0x12'),{'account':{'id':_0x4a9418},'body':_0x29d282,'log':_0xdfdc('0x12')});}; \ No newline at end of file +var _0x3c03=['Imap','CloudProvider','type','data5','MailServerOut','Smtp','notify','NotifyMailAccount','../client','name','provider','service','email','key','ListId','TemplateId','MailServerIn'];(function(_0x3cfb73,_0x5f0bc9){var _0x50419a=function(_0x5ab716){while(--_0x5ab716){_0x3cfb73['push'](_0x3cfb73['shift']());}};_0x50419a(++_0x5f0bc9);}(_0x3c03,0x16d));var _0x33c0=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x3c03[_0x39c734];return _0xb2a2f9;};'use strict';var client=require(_0x33c0('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x33c0('0x1'),_0x33c0('0x2'),_0x33c0('0x3'),_0x33c0('0x4'),'active',_0x33c0('0x5'),_0x33c0('0x6'),_0x33c0('0x7')],'raw':![],'include':[{'model':_0x33c0('0x8'),'as':_0x33c0('0x9'),'include':[{'model':_0x33c0('0xa'),'attributes':['id',_0x33c0('0x1'),'service',_0x33c0('0xb'),_0x33c0('0xc')],'as':'CloudProvider'}]},{'model':_0x33c0('0xd'),'as':_0x33c0('0xe'),'include':[{'model':'CloudProvider','attributes':['id',_0x33c0('0x1'),_0x33c0('0x3'),_0x33c0('0xb'),_0x33c0('0xc')],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports[_0x33c0('0xf')]=function(_0x71eac3,_0x5f37ac){return client['Request']('NotifyMailAccount',{'account':{'id':_0x71eac3},'body':_0x5f37ac,'log':_0x33c0('0x10')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 8a0d969..9f055ae 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 _0x6ef1=['getSettings','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0x6ef1,0x1d1));var _0x16ef=function(_0x50bb9a,_0x4b4a77){_0x50bb9a=_0x50bb9a-0x0;var _0x2530c9=_0x6ef1[_0x50bb9a];return _0x2530c9;};'use strict';var client=require('../client');exports[_0x16ef('0x0')]=function(){return client[_0x16ef('0x1')](_0x16ef('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x16ef('0x3')]},'log':_0x16ef('0x4')});}; \ No newline at end of file +var _0xa97d=['ShowSetting','loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0x24e0c9,_0x284109){var _0x4448f0=function(_0x576980){while(--_0x576980){_0x24e0c9['push'](_0x24e0c9['shift']());}};_0x4448f0(++_0x284109);}(_0xa97d,0x195));var _0xda97=function(_0x2a371a,_0x2f5ad0){_0x2a371a=_0x2a371a-0x0;var _0x40ef68=_0xa97d[_0x2a371a];return _0x40ef68;};'use strict';var client=require(_0xda97('0x0'));exports[_0xda97('0x1')]=function(){return client[_0xda97('0x2')](_0xda97('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xda97('0x4')]},'log':_0xda97('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index d1d1f7c..d34f499 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 f47eed7..f74f759 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 _0x31d6=['createServer','listen','port','socket.io','websocket','redis','defaults','localhost','adapter','socket.io-redis','default','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','ioredis'];(function(_0x47b89c,_0x5d2c41){var _0x7174c=function(_0x1ba8f2){while(--_0x1ba8f2){_0x47b89c['push'](_0x47b89c['shift']());}};_0x7174c(++_0x5d2c41);}(_0x31d6,0x1a0));var _0x631d=function(_0x4e1b3a,_0x433b59){_0x4e1b3a=_0x4e1b3a-0x0;var _0x3d7ffc=_0x31d6[_0x4e1b3a];return _0x3d7ffc;};'use strict';var _=require(_0x631d('0x0'));var http=require(_0x631d('0x1'));var express=require(_0x631d('0x2'));var sticky=require('sticky-session');var Redis=require(_0x631d('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x631d('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0x631d('0x5')](server,config[_0x631d('0x6')])){var socketio=require(_0x631d('0x7'))(server,{'transports':[_0x631d('0x8'),'polling']});config[_0x631d('0x9')]=_[_0x631d('0xa')](config[_0x631d('0x9')],{'host':_0x631d('0xb'),'port':0x18eb});socketio[_0x631d('0xc')](require(_0x631d('0xd'))({'pubClient':new Redis(config[_0x631d('0x9')]),'subClient':new Redis(config[_0x631d('0x9')])}));require('../../config/triggers')[_0x631d('0xe')]();require('../../config/socketio')['default'](socketio);require(_0x631d('0xf'))[_0x631d('0xe')](app);require(_0x631d('0x10'))[_0x631d('0xe')](app);}else{server[_0x631d('0x11')]('listening',function(){console[_0x631d('0x12')](_0x631d('0x13'),config[_0x631d('0x6')]);});}exports=module[_0x631d('0x14')]=app; \ No newline at end of file +var _0x98d4=['listen','port','socket.io','websocket','polling','localhost','adapter','socket.io-redis','redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer'];(function(_0x105896,_0x2b1b8e){var _0x397ad0=function(_0xa176ec){while(--_0xa176ec){_0x105896['push'](_0x105896['shift']());}};_0x397ad0(++_0x2b1b8e);}(_0x98d4,0x125));var _0x498d=function(_0x27c9a7,_0x246652){_0x27c9a7=_0x27c9a7-0x0;var _0x529313=_0x98d4[_0x27c9a7];return _0x529313;};'use strict';var _=require(_0x498d('0x0'));var http=require(_0x498d('0x1'));var express=require(_0x498d('0x2'));var sticky=require(_0x498d('0x3'));var Redis=require(_0x498d('0x4'));var config=require(_0x498d('0x5'));var app=express();var server=http[_0x498d('0x6')](app);server['timeout']=0xdbba0;if(sticky[_0x498d('0x7')](server,config[_0x498d('0x8')])){var socketio=require(_0x498d('0x9'))(server,{'transports':[_0x498d('0xa'),_0x498d('0xb')]});config['redis']=_['defaults'](config['redis'],{'host':_0x498d('0xc'),'port':0x18eb});socketio[_0x498d('0xd')](require(_0x498d('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x498d('0xf')])}));require(_0x498d('0x10'))[_0x498d('0x11')]();require(_0x498d('0x12'))[_0x498d('0x11')](socketio);require(_0x498d('0x13'))['default'](app);require(_0x498d('0x14'))['default'](app);}else{server[_0x498d('0x15')](_0x498d('0x16'),function(){console[_0x498d('0x17')](_0x498d('0x18'),config[_0x498d('0x8')]);});}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 9eb75e7..c2c1254 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 _0xb98f=['rpc','error','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','request','then'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0xb98f,0x13d));var _0xfb98=function(_0x4a3d65,_0x3edbe5){_0x4a3d65=_0x4a3d65-0x0;var _0x242b89=_0xb98f[_0x4a3d65];return _0x242b89;};'use strict';var jayson=require(_0xfb98('0x0'));var BPromise=require(_0xfb98('0x1'));var logger=require(_0xfb98('0x2'))(_0xfb98('0x3'));var client=jayson[_0xfb98('0x4')]['http']({'port':0x2329});client[_0xfb98('0x5')]=function(_0x202d4b,_0x3da676){return new BPromise(function(_0x32db63,_0x3f4042){return client[_0xfb98('0x6')](_0x202d4b,_0x3da676)[_0xfb98('0x7')](function(_0x3fa54b){logger['debug'](_0xfb98('0x8'),_0xfb98('0x3'),_0x202d4b,_0x3da676,_0x3fa54b);if(_0x3fa54b[_0xfb98('0x9')]){logger['error'](_0xfb98('0x8'),_0xfb98('0x3'),_0x202d4b,_0x3fa54b[_0xfb98('0x9')][_0xfb98('0xa')],_0x3da676);return _0x3f4042(_0x3fa54b['error'][_0xfb98('0xa')]);}else{return _0x32db63(_0x3fa54b['result']);}})[_0xfb98('0xb')](function(_0x292824){logger[_0xfb98('0x9')](_0xfb98('0x8'),_0xfb98('0x3'),_0x202d4b,_0x292824,_0x3da676);return _0x3f4042(_0x292824);});});};module[_0xfb98('0xc')]=client; \ No newline at end of file +var _0xe67a=['client','http','Request','request','then','rpc','error','message','result','bluebird','routing'];(function(_0x207cf1,_0x512ef4){var _0x3b0b10=function(_0x5d2bca){while(--_0x5d2bca){_0x207cf1['push'](_0x207cf1['shift']());}};_0x3b0b10(++_0x512ef4);}(_0xe67a,0x82));var _0xae67=function(_0x4f52bb,_0x3bd31b){_0x4f52bb=_0x4f52bb-0x0;var _0xfd36c=_0xe67a[_0x4f52bb];return _0xfd36c;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xae67('0x0'));var logger=require('../../config/logger')(_0xae67('0x1'));var client=jayson[_0xae67('0x2')][_0xae67('0x3')]({'port':0x2329});client[_0xae67('0x4')]=function(_0xe9ee30,_0x5e1968){return new BPromise(function(_0x41c58e,_0x38f8d1){return client[_0xae67('0x5')](_0xe9ee30,_0x5e1968)[_0xae67('0x6')](function(_0x3240db){logger['debug'](_0xae67('0x7'),'routing',_0xe9ee30,_0x5e1968,_0x3240db);if(_0x3240db[_0xae67('0x8')]){logger[_0xae67('0x8')](_0xae67('0x7'),_0xae67('0x1'),_0xe9ee30,_0x3240db[_0xae67('0x8')][_0xae67('0x9')],_0x5e1968);return _0x38f8d1(_0x3240db[_0xae67('0x8')][_0xae67('0x9')]);}else{return _0x41c58e(_0x3240db[_0xae67('0xa')]);}})['catch'](function(_0xf48f81){logger[_0xae67('0x8')](_0xae67('0x7'),_0xae67('0x1'),_0xe9ee30,_0xf48f81,_0x5e1968);return _0x38f8d1(_0xf48f81);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 4a218f3..cb2060b 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 _0x63ef=['initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','./server','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues'];(function(_0x1951a6,_0x58f81c){var _0x65c3c6=function(_0x277fa6){while(--_0x277fa6){_0x1951a6['push'](_0x1951a6['shift']());}};_0x65c3c6(++_0x58f81c);}(_0x63ef,0x17c));var _0xf63e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x63ef[_0xbb091];return _0x467a04;};'use strict';var BPromise=require('bluebird');var server=require(_0xf63e('0x0'));var Realtime=require('./realtime');var user=require(_0xf63e('0x1'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xf63e('0x2'));var chatQueue=require(_0xf63e('0x3'));var smsQueue=require(_0xf63e('0x4'));var mailQueue=require(_0xf63e('0x5'));var faxQueue=require(_0xf63e('0x6'));var whatsappQueue=require(_0xf63e('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xf63e('0x8')]()['then'](user[_0xf63e('0x9')]())[_0xf63e('0xa')](realtime['initAgents']())[_0xf63e('0xa')](interval['getIntervals']())[_0xf63e('0xa')](realtime[_0xf63e('0xb')]())[_0xf63e('0xa')](openchannelQueue[_0xf63e('0xc')]())[_0xf63e('0xa')](realtime[_0xf63e('0xd')]())[_0xf63e('0xa')](chatQueue[_0xf63e('0xe')]())[_0xf63e('0xa')](realtime[_0xf63e('0xf')]())[_0xf63e('0xa')](smsQueue[_0xf63e('0x10')]())[_0xf63e('0xa')](realtime['initSmsQueues']())[_0xf63e('0xa')](mailQueue[_0xf63e('0x11')]())[_0xf63e('0xa')](realtime[_0xf63e('0x12')]())[_0xf63e('0xa')](faxQueue[_0xf63e('0x13')]())[_0xf63e('0xa')](realtime[_0xf63e('0x14')]())[_0xf63e('0xa')](whatsappQueue[_0xf63e('0x15')]())[_0xf63e('0xa')](realtime[_0xf63e('0x16')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x2d1d65){return initRealtime();})['then'](function(_0x460d81){return setInterval(initRealtime,0x1388);})[_0xf63e('0x17')](function(_0x123b6d){console[_0xf63e('0x18')](_0x123b6d);});}main(); \ No newline at end of file +var _0xe1a3=['./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','initAgents','then','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','bluebird'];(function(_0x423b10,_0x36cad4){var _0x1338d9=function(_0xeb09ac){while(--_0xeb09ac){_0x423b10['push'](_0x423b10['shift']());}};_0x1338d9(++_0x36cad4);}(_0xe1a3,0x86));var _0x3e1a=function(_0x2a47ab,_0x1a5721){_0x2a47ab=_0x2a47ab-0x0;var _0x27d1ff=_0xe1a3[_0x2a47ab];return _0x27d1ff;};'use strict';var BPromise=require(_0x3e1a('0x0'));var server=require(_0x3e1a('0x1'));var Realtime=require(_0x3e1a('0x2'));var user=require('./rpc/user');var interval=require(_0x3e1a('0x3'));var openchannelQueue=require(_0x3e1a('0x4'));var chatQueue=require(_0x3e1a('0x5'));var smsQueue=require(_0x3e1a('0x6'));var mailQueue=require(_0x3e1a('0x7'));var faxQueue=require(_0x3e1a('0x8'));var whatsappQueue=require(_0x3e1a('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x3e1a('0xa')]()['then'](user[_0x3e1a('0xb')]())['then'](realtime[_0x3e1a('0xc')]())[_0x3e1a('0xd')](interval[_0x3e1a('0xe')]())[_0x3e1a('0xd')](realtime[_0x3e1a('0xf')]())[_0x3e1a('0xd')](openchannelQueue[_0x3e1a('0x10')]())['then'](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x3e1a('0x11')]())[_0x3e1a('0xd')](realtime['initChatQueues']())[_0x3e1a('0xd')](smsQueue[_0x3e1a('0x12')]())[_0x3e1a('0xd')](realtime[_0x3e1a('0x13')]())['then'](mailQueue[_0x3e1a('0x14')]())[_0x3e1a('0xd')](realtime['initMailQueues']())[_0x3e1a('0xd')](faxQueue[_0x3e1a('0x15')]())[_0x3e1a('0xd')](realtime[_0x3e1a('0x16')]())[_0x3e1a('0xd')](whatsappQueue[_0x3e1a('0x17')]())[_0x3e1a('0xd')](realtime[_0x3e1a('0x18')]())[_0x3e1a('0xd')](function(){return realtime;});}function main(){return server[_0x3e1a('0x19')](realtime)[_0x3e1a('0xd')](function(_0x256193){return initRealtime();})[_0x3e1a('0xd')](function(_0x1e3bb9){return setInterval(initRealtime,0x1388);})[_0x3e1a('0x1a')](function(_0x26e610){console['log'](_0x26e610);});}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 be7f4aa..af5851c 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x55462b,_0x2aecf5){var _0x5ad389=function(_0x2039c2){while(--_0x2039c2){_0x55462b['push'](_0x55462b['shift']());}};_0x5ad389(++_0x2aecf5);}(_0xe14b,0x93));var _0xbe14=function(_0x4403ed,_0x39ec04){_0x4403ed=_0x4403ed-0x0;var _0xf3b2eb=_0xe14b[_0x4403ed];return _0xf3b2eb;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x3407ee,_0xb2e716){var _0x1b0b35=function(_0x457262){while(--_0x457262){_0x3407ee['push'](_0x3407ee['shift']());}};_0x1b0b35(++_0xb2e716);}(_0x326f,0xd1));var _0xf326=function(_0x470beb,_0x5cd223){_0x470beb=_0x470beb-0x0;var _0x97ce75=_0x326f[_0x470beb];return _0x97ce75;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 976fd07..3ac0862 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 _0x9307=['message','catch','SendMail','bluebird','jayson/promise','client','http','then','error'];(function(_0x491796,_0x57848c){var _0x20429c=function(_0x4f097f){while(--_0x4f097f){_0x491796['push'](_0x491796['shift']());}};_0x20429c(++_0x57848c);}(_0x9307,0x18f));var _0x7930=function(_0x165d90,_0x1f922e){_0x165d90=_0x165d90-0x0;var _0x5022be=_0x9307[_0x165d90];return _0x5022be;};'use strict';var BPromise=require(_0x7930('0x0'));var jayson=require(_0x7930('0x1'));var client=jayson[_0x7930('0x2')][_0x7930('0x3')]({'port':0x232b});function request(_0x425873,_0x1e82b1){return new BPromise(function(_0xf429bb,_0x360a12){return client['request'](_0x425873,_0x1e82b1)[_0x7930('0x4')](function(_0x1b0f65){if(_0x1b0f65[_0x7930('0x5')]){return _0x360a12(_0x1b0f65[_0x7930('0x5')][_0x7930('0x6')]);}else{return _0xf429bb(_0x1b0f65['result']);}})[_0x7930('0x7')](function(_0x3dec51){return _0x360a12(_0x3dec51);});});}exports['sendMailMessage']=function(_0x2f324e,_0x29b9e1){return request(_0x7930('0x8'),{'account':_0x2f324e,'message':_0x29b9e1});}; \ No newline at end of file +var _0x7c6b=['SendMail','jayson/promise','client','http','request','then','error','result','catch'];(function(_0xf34b0a,_0x11e116){var _0x5021e1=function(_0x4eff67){while(--_0x4eff67){_0xf34b0a['push'](_0xf34b0a['shift']());}};_0x5021e1(++_0x11e116);}(_0x7c6b,0xa3));var _0xb7c6=function(_0x53f18c,_0x3b9846){_0x53f18c=_0x53f18c-0x0;var _0x31c996=_0x7c6b[_0x53f18c];return _0x31c996;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xb7c6('0x0'));var client=jayson[_0xb7c6('0x1')][_0xb7c6('0x2')]({'port':0x232b});function request(_0x369911,_0x384661){return new BPromise(function(_0xcc9299,_0x8e5b99){return client[_0xb7c6('0x3')](_0x369911,_0x384661)[_0xb7c6('0x4')](function(_0x648e50){if(_0x648e50[_0xb7c6('0x5')]){return _0x8e5b99(_0x648e50[_0xb7c6('0x5')]['message']);}else{return _0xcc9299(_0x648e50[_0xb7c6('0x6')]);}})[_0xb7c6('0x7')](function(_0x10f079){return _0x8e5b99(_0x10f079);});});}exports['sendMailMessage']=function(_0x2ab832,_0x18633a){return request(_0xb7c6('0x8'),{'account':_0x2ab832,'message':_0x18633a});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index b24cdf9..b107ca3 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 _0x2416=['whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','idle','chat','openchannel','fax','sms','whatsapp','format','chatCapacity','chatCurrentCapacity','mailStatusTime','smsStatus','smsCurrentCapacity','openchannelStatusTime','openchannelCapacity','busyQueue','smsWaitingInteractions','emit','user:save','exports','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','mailStatus','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelCurrentCapacity','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2416,0x1b6));var _0x6241=function(_0x55b833,_0x5df36f){_0x55b833=_0x55b833-0x0;var _0x50a75e=_0x2416[_0x55b833];return _0x50a75e;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0x6241('0x0'));var Redis=require('ioredis');var config=require(_0x6241('0x1'));config[_0x6241('0x2')]=_[_0x6241('0x3')](config['redis'],{'host':_0x6241('0x4'),'port':0x18eb});var io=require(_0x6241('0x5'))(new Redis(config[_0x6241('0x2')]));function Agent(_0x3c70f5){this['id']=_0x3c70f5['id']||0x0;this[_0x6241('0x6')]=_0x3c70f5[_0x6241('0x6')]||'';this['online']=_0x3c70f5[_0x6241('0x7')]||!![];this['voicePause']=_0x3c70f5[_0x6241('0x8')]||![];this['chatPause']=_0x3c70f5[_0x6241('0x9')]||![];this['mailPause']=_0x3c70f5[_0x6241('0xa')]||![];this[_0x6241('0xb')]=_0x3c70f5[_0x6241('0xb')]||![];this[_0x6241('0xc')]=_0x3c70f5['smsPause']||![];this[_0x6241('0xd')]=_0x3c70f5['openchannelPause']||![];this[_0x6241('0xe')]=_0x6241('0xf');this[_0x6241('0x10')]=0x0;this['chatCapacity']=_0x3c70f5['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this[_0x6241('0x11')]=_0x6241('0xf');this['mailStatusTime']=0x0;this[_0x6241('0x12')]=_0x3c70f5[_0x6241('0x12')]||0x0;this[_0x6241('0x13')]=0x0;this['faxStatus']=_0x6241('0xf');this[_0x6241('0x14')]=0x0;this['faxCapacity']=_0x3c70f5[_0x6241('0x15')]||0x0;this[_0x6241('0x16')]=0x0;this['smsStatus']=_0x6241('0xf');this[_0x6241('0x17')]=0x0;this[_0x6241('0x18')]=_0x3c70f5['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0x6241('0x19')]='unknown';this[_0x6241('0x1a')]=0x0;this['whatsappCapacity']=_0x3c70f5[_0x6241('0x1b')]||0x0;this[_0x6241('0x1c')]=0x0;this['openchannelStatus']=_0x6241('0xf');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x3c70f5['openchannelCapacity']||0x0;this[_0x6241('0x1d')]=0x0;this['busy']=![];this['busyQueue']=undefined;this['md5']='';this[_0x6241('0x1e')]={};this[_0x6241('0x1f')]={};this[_0x6241('0x20')]={};this[_0x6241('0x21')]={};this['smsWaitingInteractions']={};this[_0x6241('0x22')]={};this[_0x6241('0x23')]();}Agent[_0x6241('0x24')][_0x6241('0x25')]=function(_0x38bdcd){if(this[_0x38bdcd+_0x6241('0x26')]>0x0){if(this[_0x38bdcd+_0x6241('0x27')]>0x0&&this[_0x38bdcd+_0x6241('0x26')]>=this[_0x38bdcd+_0x6241('0x27')]){return'maxcapacity';}else{return'working';}}else{return _0x6241('0x28');}};Agent[_0x6241('0x24')]['updateRealtime']=function(){var _0x27d4db=['mail',_0x6241('0x29'),_0x6241('0x2a'),_0x6241('0x2b'),_0x6241('0x2c'),_0x6241('0x2d')];for(var _0x57bc43=0x0;_0x57bc43<_0x27d4db['length'];_0x57bc43+=0x1){var _0x1414e9=this[_0x6241('0x25')](_0x27d4db[_0x57bc43]);if(this[_0x27d4db[_0x57bc43]+'Status']!==_0x1414e9){this[_0x27d4db[_0x57bc43]+'StatusTime']=_['toNumber'](moment()[_0x6241('0x2e')]('x'));}this[_0x27d4db[_0x57bc43]+'Status']=_0x1414e9;}var _0x1be61a={'id':this['id'],'name':this[_0x6241('0x6')],'online':this[_0x6241('0x7')],'voicePause':this['voicePause'],'chatPause':this[_0x6241('0x9')],'mailPause':this[_0x6241('0xa')],'smsPause':this[_0x6241('0xc')],'faxPause':this['faxPause'],'openchannelPause':this[_0x6241('0xd')],'chatStatus':this[_0x6241('0xe')],'chatStatusTime':this[_0x6241('0x10')],'chatCapacity':this[_0x6241('0x2f')],'chatCurrentCapacity':this[_0x6241('0x30')],'mailStatus':this[_0x6241('0x11')],'mailStatusTime':this[_0x6241('0x31')],'mailCapacity':this[_0x6241('0x12')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x6241('0x14')],'faxCapacity':this[_0x6241('0x15')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x6241('0x32')],'smsStatusTime':this[_0x6241('0x17')],'smsCapacity':this[_0x6241('0x18')],'smsCurrentCapacity':this[_0x6241('0x33')],'whatsappStatus':this[_0x6241('0x19')],'whatsappStatusTime':this[_0x6241('0x1a')],'whatsappCapacity':this[_0x6241('0x1b')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x6241('0x34')],'openchannelCapacity':this[_0x6241('0x35')],'openchannelCurrentCapacity':this[_0x6241('0x1d')],'busy':this['busy'],'busyQueue':this[_0x6241('0x36')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x6241('0x1f')],'mailWaitingInteractions':this[_0x6241('0x20')],'openchannelWaitingInteractions':this[_0x6241('0x21')],'smsWaitingInteractions':this[_0x6241('0x37')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x5cc892=md5(JSON['stringify'](_0x1be61a));if(this[_0x6241('0x0')]!==_0x5cc892){this[_0x6241('0x0')]=_0x5cc892;io[_0x6241('0x38')](_0x6241('0x39'),_0x1be61a);}};module[_0x6241('0x3a')]=Agent; \ No newline at end of file +var _0x77d1=['chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','whatsappWaitingInteractions','updateRealtime','getChannelStatus','CurrentCapacity','maxcapacity','working','idle','chat','openchannel','fax','sms','whatsapp','length','toNumber','Status','mailStatus','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','busyQueue','mailWaitingInteractions','openchannelWaitingInteractions','stringify','emit','user:save','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause'];(function(_0x136e17,_0x4cc300){var _0x5099c9=function(_0xbbbb80){while(--_0xbbbb80){_0x136e17['push'](_0x136e17['shift']());}};_0x5099c9(++_0x4cc300);}(_0x77d1,0x139));var _0x177d=function(_0x503cd5,_0x57774a){_0x503cd5=_0x503cd5-0x0;var _0x1fdf1e=_0x77d1[_0x503cd5];return _0x1fdf1e;};'use strict';var _=require(_0x177d('0x0'));var moment=require(_0x177d('0x1'));var md5=require(_0x177d('0x2'));var Redis=require(_0x177d('0x3'));var config=require(_0x177d('0x4'));config[_0x177d('0x5')]=_[_0x177d('0x6')](config[_0x177d('0x5')],{'host':_0x177d('0x7'),'port':0x18eb});var io=require(_0x177d('0x8'))(new Redis(config['redis']));function Agent(_0x2f286a){this['id']=_0x2f286a['id']||0x0;this['name']=_0x2f286a[_0x177d('0x9')]||'';this[_0x177d('0xa')]=_0x2f286a[_0x177d('0xa')]||!![];this['voicePause']=_0x2f286a[_0x177d('0xb')]||![];this[_0x177d('0xc')]=_0x2f286a['chatPause']||![];this[_0x177d('0xd')]=_0x2f286a[_0x177d('0xd')]||![];this[_0x177d('0xe')]=_0x2f286a[_0x177d('0xe')]||![];this[_0x177d('0xf')]=_0x2f286a[_0x177d('0xf')]||![];this['openchannelPause']=_0x2f286a[_0x177d('0x10')]||![];this[_0x177d('0x11')]=_0x177d('0x12');this[_0x177d('0x13')]=0x0;this['chatCapacity']=_0x2f286a[_0x177d('0x14')]||0x0;this[_0x177d('0x15')]=0x0;this['mailStatus']=_0x177d('0x12');this[_0x177d('0x16')]=0x0;this[_0x177d('0x17')]=_0x2f286a[_0x177d('0x17')]||0x0;this[_0x177d('0x18')]=0x0;this[_0x177d('0x19')]=_0x177d('0x12');this[_0x177d('0x1a')]=0x0;this[_0x177d('0x1b')]=_0x2f286a[_0x177d('0x1b')]||0x0;this[_0x177d('0x1c')]=0x0;this[_0x177d('0x1d')]=_0x177d('0x12');this[_0x177d('0x1e')]=0x0;this[_0x177d('0x1f')]=_0x2f286a[_0x177d('0x1f')]||0x0;this[_0x177d('0x20')]=0x0;this['whatsappStatus']=_0x177d('0x12');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x2f286a['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x177d('0x21')]=_0x177d('0x12');this[_0x177d('0x22')]=0x0;this['openchannelCapacity']=_0x2f286a[_0x177d('0x23')]||0x0;this[_0x177d('0x24')]=0x0;this[_0x177d('0x25')]=![];this['busyQueue']=undefined;this['md5']='';this[_0x177d('0x26')]={};this[_0x177d('0x27')]={};this['mailWaitingInteractions']={};this['openchannelWaitingInteractions']={};this['smsWaitingInteractions']={};this[_0x177d('0x28')]={};this[_0x177d('0x29')]();}Agent['prototype'][_0x177d('0x2a')]=function(_0x220ca1){if(this[_0x220ca1+_0x177d('0x2b')]>0x0){if(this[_0x220ca1+'Capacity']>0x0&&this[_0x220ca1+'CurrentCapacity']>=this[_0x220ca1+'Capacity']){return _0x177d('0x2c');}else{return _0x177d('0x2d');}}else{return _0x177d('0x2e');}};Agent['prototype']['updateRealtime']=function(){var _0x193977=['mail',_0x177d('0x2f'),_0x177d('0x30'),_0x177d('0x31'),_0x177d('0x32'),_0x177d('0x33')];for(var _0x5b8125=0x0;_0x5b8125<_0x193977[_0x177d('0x34')];_0x5b8125+=0x1){var _0x3c3149=this[_0x177d('0x2a')](_0x193977[_0x5b8125]);if(this[_0x193977[_0x5b8125]+'Status']!==_0x3c3149){this[_0x193977[_0x5b8125]+'StatusTime']=_[_0x177d('0x35')](moment()['format']('x'));}this[_0x193977[_0x5b8125]+_0x177d('0x36')]=_0x3c3149;}var _0x27b6df={'id':this['id'],'name':this[_0x177d('0x9')],'online':this[_0x177d('0xa')],'voicePause':this[_0x177d('0xb')],'chatPause':this[_0x177d('0xc')],'mailPause':this[_0x177d('0xd')],'smsPause':this['smsPause'],'faxPause':this[_0x177d('0xe')],'openchannelPause':this[_0x177d('0x10')],'chatStatus':this[_0x177d('0x11')],'chatStatusTime':this[_0x177d('0x13')],'chatCapacity':this[_0x177d('0x14')],'chatCurrentCapacity':this[_0x177d('0x15')],'mailStatus':this[_0x177d('0x37')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x177d('0x17')],'mailCurrentCapacity':this[_0x177d('0x18')],'faxStatus':this[_0x177d('0x19')],'faxStatusTime':this[_0x177d('0x1a')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x177d('0x1c')],'smsStatus':this[_0x177d('0x1d')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x177d('0x1f')],'smsCurrentCapacity':this[_0x177d('0x20')],'whatsappStatus':this[_0x177d('0x38')],'whatsappStatusTime':this[_0x177d('0x39')],'whatsappCapacity':this[_0x177d('0x3a')],'whatsappCurrentCapacity':this[_0x177d('0x3b')],'openchannelStatus':this[_0x177d('0x21')],'openchannelStatusTime':this[_0x177d('0x22')],'openchannelCapacity':this[_0x177d('0x23')],'openchannelCurrentCapacity':this[_0x177d('0x24')],'busy':this[_0x177d('0x25')],'busyQueue':this[_0x177d('0x3c')],'chatWaitingInteractions':this[_0x177d('0x26')],'faxWaitingInteractions':this[_0x177d('0x27')],'mailWaitingInteractions':this[_0x177d('0x3d')],'openchannelWaitingInteractions':this[_0x177d('0x3e')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0x177d('0x28')]};var _0x360e92=md5(JSON[_0x177d('0x3f')](_0x27b6df));if(this[_0x177d('0x2')]!==_0x360e92){this[_0x177d('0x2')]=_0x360e92;io[_0x177d('0x40')](_0x177d('0x41'),_0x27b6df);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index b161a1a..0818657 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 _0x423b=['prototype','updateRouting','_rr','online','chatPause','paused','available','loggedIn','stringify','format','chat:queue:%s','chat_queue:save','exports','lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRealtime'];(function(_0xdecf39,_0x462cf1){var _0x5acc93=function(_0x22fe8e){while(--_0x22fe8e){_0xdecf39['push'](_0xdecf39['shift']());}};_0x5acc93(++_0x462cf1);}(_0x423b,0x195));var _0xb423=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x423b[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xb423('0x0'));var md5=require('md5');var util=require(_0xb423('0x1'));var Redis=require(_0xb423('0x2'));var config=require('../../../config/environment');config[_0xb423('0x3')]=_[_0xb423('0x4')](config['redis'],{'host':_0xb423('0x5'),'port':0x18eb});var io=require(_0xb423('0x6'))(new Redis(config['redis']));function ChatQueue(_0x39b8e8){this['id']=_0x39b8e8['id']||0x0;this['name']=_0x39b8e8[_0xb423('0x7')]||'';this[_0xb423('0x8')]=_0x39b8e8['timeout']||0xa;this[_0xb423('0x9')]=_0x39b8e8[_0xb423('0x9')]||'beepall';this[_0xb423('0xa')]=_0x39b8e8[_0xb423('0xa')];this[_0xb423('0xb')]={};this[_0xb423('0xc')]=0x0;this[_0xb423('0xd')]='';this['updateRouting']();this[_0xb423('0xe')]();}ChatQueue[_0xb423('0xf')][_0xb423('0x10')]=function(){var _0x205c6f=this[_0xb423('0xb')][_0xb423('0x11')];this[_0xb423('0xb')]=_['map'](this['Agents'],'id');this[_0xb423('0xb')][_0xb423('0x11')]=_0x205c6f;};ChatQueue[_0xb423('0xf')][_0xb423('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x5c0474=0x0;_0x5c0474=0x0?this['available']:0x0;var _0x50a4af={'id':this['id'],'available':this[_0xb423('0x15')],'loggedIn':this[_0xb423('0x16')],'name':this[_0xb423('0x7')],'paused':this['paused'],'waiting':this[_0xb423('0xc')]};var _0x3f2d66=md5(JSON[_0xb423('0x17')](_0x50a4af));if(this['md5']!==_0x3f2d66){this[_0xb423('0xd')]=_0x3f2d66;io['to'](util[_0xb423('0x18')](_0xb423('0x19'),_0x50a4af['name']))['emit'](_0xb423('0x1a'),_0x50a4af);}};module[_0xb423('0x1b')]=ChatQueue; \ No newline at end of file +var _0x5797=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','chatPause','paused','available','stringify','format','chat:queue:%s','chat_queue:save','lodash','md5','redis','socket.io-emitter'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5797,0xf9));var _0x7579=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x5797[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0x7579('0x0'));var md5=require(_0x7579('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x7579('0x2')]=_['defaults'](config[_0x7579('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x7579('0x3'))(new Redis(config[_0x7579('0x2')]));function ChatQueue(_0x1766dd){this['id']=_0x1766dd['id']||0x0;this[_0x7579('0x4')]=_0x1766dd[_0x7579('0x4')]||'';this[_0x7579('0x5')]=_0x1766dd[_0x7579('0x5')]||0xa;this['strategy']=_0x1766dd[_0x7579('0x6')]||_0x7579('0x7');this[_0x7579('0x8')]=_0x1766dd['Agents'];this[_0x7579('0x9')]={};this[_0x7579('0xa')]=0x0;this[_0x7579('0x1')]='';this[_0x7579('0xb')]();this['updateRealtime']();}ChatQueue[_0x7579('0xc')]['updateRouting']=function(){var _0x533319=this[_0x7579('0x9')][_0x7579('0xd')];this[_0x7579('0x9')]=_['map'](this['Agents'],'id');this[_0x7579('0x9')]['_rr']=_0x533319;};ChatQueue['prototype'][_0x7579('0xe')]=function(){this[_0x7579('0xf')]=0x0;this['paused']=0x0;for(var _0x2c09c2=0x0;_0x2c09c2=0x0?this[_0x7579('0x12')]:0x0;var _0x3e3ccc={'id':this['id'],'available':this[_0x7579('0x12')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x7579('0x11')],'waiting':this[_0x7579('0xa')]};var _0x1c903e=md5(JSON[_0x7579('0x13')](_0x3e3ccc));if(this[_0x7579('0x1')]!==_0x1c903e){this[_0x7579('0x1')]=_0x1c903e;io['to'](util[_0x7579('0x14')](_0x7579('0x15'),_0x3e3ccc['name']))['emit'](_0x7579('0x16'),_0x3e3ccc);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 56322f8..a21d4e3 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 _0x11aa=['updateRealtime','_rr','prototype','loggedIn','paused','faxPause','available','waiting','stringify','format','emit','fax_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x11aa,0x1f2));var _0xa11a=function(_0x4df388,_0x12b687){_0x4df388=_0x4df388-0x0;var _0x179308=_0x11aa[_0x4df388];return _0x179308;};'use strict';var _=require('lodash');var md5=require(_0xa11a('0x0'));var util=require(_0xa11a('0x1'));var Redis=require(_0xa11a('0x2'));var config=require(_0xa11a('0x3'));config[_0xa11a('0x4')]=_[_0xa11a('0x5')](config[_0xa11a('0x4')],{'host':_0xa11a('0x6'),'port':0x18eb});var io=require(_0xa11a('0x7'))(new Redis(config[_0xa11a('0x4')]));function FaxQueue(_0x3a2dad){this['id']=_0x3a2dad['id']||0x0;this['name']=_0x3a2dad[_0xa11a('0x8')]||'';this[_0xa11a('0x9')]=_0x3a2dad[_0xa11a('0x9')]||0xa;this['strategy']=_0x3a2dad[_0xa11a('0xa')]||_0xa11a('0xb');this[_0xa11a('0xc')]=_0x3a2dad[_0xa11a('0xc')];this[_0xa11a('0xd')]={};this['waiting']=0x0;this['md5']='';this[_0xa11a('0xe')]();this[_0xa11a('0xf')]();}FaxQueue['prototype'][_0xa11a('0xe')]=function(){var _0x3ec489=this[_0xa11a('0xd')][_0xa11a('0x10')];this[_0xa11a('0xd')]=_['map'](this[_0xa11a('0xc')],'id');this['mapAgentsId'][_0xa11a('0x10')]=_0x3ec489;};FaxQueue[_0xa11a('0x11')]['updateRealtime']=function(){this[_0xa11a('0x12')]=0x0;this[_0xa11a('0x13')]=0x0;for(var _0x1a2d06=0x0;_0x1a2d06=0x0?this[_0xa11a('0x15')]:0x0;var _0x5c81ec={'id':this['id'],'available':this[_0xa11a('0x15')],'loggedIn':this['loggedIn'],'name':this[_0xa11a('0x8')],'paused':this[_0xa11a('0x13')],'waiting':this[_0xa11a('0x16')]};var _0x308488=md5(JSON[_0xa11a('0x17')](_0x5c81ec));if(this[_0xa11a('0x0')]!==_0x308488){this[_0xa11a('0x0')]=_0x308488;io['to'](util[_0xa11a('0x18')]('fax:queue:%s',_0x5c81ec[_0xa11a('0x8')]))[_0xa11a('0x19')](_0xa11a('0x1a'),_0x5c81ec);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x256d=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults'];(function(_0x22b70f,_0x4c853f){var _0x100985=function(_0x18628e){while(--_0x18628e){_0x22b70f['push'](_0x22b70f['shift']());}};_0x100985(++_0x4c853f);}(_0x256d,0xd2));var _0xd256=function(_0x246227,_0x12bfcb){_0x246227=_0x246227-0x0;var _0x37bd4a=_0x256d[_0x246227];return _0x37bd4a;};'use strict';var _=require(_0xd256('0x0'));var md5=require(_0xd256('0x1'));var util=require(_0xd256('0x2'));var Redis=require(_0xd256('0x3'));var config=require(_0xd256('0x4'));config[_0xd256('0x5')]=_[_0xd256('0x6')](config['redis'],{'host':_0xd256('0x7'),'port':0x18eb});var io=require(_0xd256('0x8'))(new Redis(config['redis']));function FaxQueue(_0x4ea66a){this['id']=_0x4ea66a['id']||0x0;this[_0xd256('0x9')]=_0x4ea66a[_0xd256('0x9')]||'';this[_0xd256('0xa')]=_0x4ea66a['timeout']||0xa;this[_0xd256('0xb')]=_0x4ea66a[_0xd256('0xb')]||_0xd256('0xc');this[_0xd256('0xd')]=_0x4ea66a[_0xd256('0xd')];this[_0xd256('0xe')]={};this[_0xd256('0xf')]=0x0;this[_0xd256('0x1')]='';this[_0xd256('0x10')]();this[_0xd256('0x11')]();}FaxQueue[_0xd256('0x12')]['updateRouting']=function(){var _0x3e08ae=this[_0xd256('0xe')]['_rr'];this[_0xd256('0xe')]=_['map'](this['Agents'],'id');this[_0xd256('0xe')][_0xd256('0x13')]=_0x3e08ae;};FaxQueue[_0xd256('0x12')]['updateRealtime']=function(){this[_0xd256('0x14')]=0x0;this[_0xd256('0x15')]=0x0;for(var _0x50301c=0x0;_0x50301c=0x0?this['available']:0x0;var _0x2f26f3={'id':this['id'],'available':this[_0xd256('0x19')],'loggedIn':this[_0xd256('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xd256('0xf')]};var _0x27ec0f=md5(JSON[_0xd256('0x1a')](_0x2f26f3));if(this[_0xd256('0x1')]!==_0x27ec0f){this['md5']=_0x27ec0f;io['to'](util['format'](_0xd256('0x1b'),_0x2f26f3[_0xd256('0x9')]))[_0xd256('0x1c')](_0xd256('0x1d'),_0x2f26f3);}};module[_0xd256('0x1e')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 7d7d9a7..e8270c4 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 _0x9596=['Intervals','name'];(function(_0x202506,_0x5b9c15){var _0x4c3e29=function(_0x4b5698){while(--_0x4b5698){_0x202506['push'](_0x202506['shift']());}};_0x4c3e29(++_0x5b9c15);}(_0x9596,0x14d));var _0x6959=function(_0x1761f0,_0x27fe8b){_0x1761f0=_0x1761f0-0x0;var _0x371d9f=_0x9596[_0x1761f0];return _0x371d9f;};'use strict';function Interval(_0x4730d7){this['id']=_0x4730d7['id']||0x0;this['name']=_0x4730d7[_0x6959('0x0')]||'';this[_0x6959('0x1')]=_0x4730d7['Intervals']||{};}module['exports']=Interval; \ No newline at end of file +var _0xad25=['Intervals','exports','name'];(function(_0x5b6d2a,_0x2a4e3b){var _0x536640=function(_0x38f760){while(--_0x38f760){_0x5b6d2a['push'](_0x5b6d2a['shift']());}};_0x536640(++_0x2a4e3b);}(_0xad25,0x1c4));var _0x5ad2=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xad25[_0xbd08b4];return _0x314f1e;};'use strict';function Interval(_0x412cf4){this['id']=_0x412cf4['id']||0x0;this[_0x5ad2('0x0')]=_0x412cf4['name']||'';this[_0x5ad2('0x1')]=_0x412cf4['Intervals']||{};}module[_0x5ad2('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 52efcda..6b89e47 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 _0x6079=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','map','paused','length','online','loggedIn','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x6079,0x92));var _0x9607=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0x6079[_0x24875d];return _0x181471;};'use strict';var _=require(_0x9607('0x0'));var md5=require('md5');var util=require(_0x9607('0x1'));var Redis=require(_0x9607('0x2'));var config=require(_0x9607('0x3'));config[_0x9607('0x4')]=_[_0x9607('0x5')](config[_0x9607('0x4')],{'host':_0x9607('0x6'),'port':0x18eb});var io=require(_0x9607('0x7'))(new Redis(config[_0x9607('0x4')]));function MailQueue(_0x599ff6){this['id']=_0x599ff6['id']||0x0;this[_0x9607('0x8')]=_0x599ff6['name']||'';this['timeout']=_0x599ff6[_0x9607('0x9')]||0xa;this[_0x9607('0xa')]=_0x599ff6[_0x9607('0xa')]||'beepall';this[_0x9607('0xb')]=_0x599ff6[_0x9607('0xb')];this[_0x9607('0xc')]={};this[_0x9607('0xd')]=0x0;this[_0x9607('0xe')]='';this[_0x9607('0xf')]();this['updateRealtime']();}MailQueue[_0x9607('0x10')][_0x9607('0xf')]=function(){var _0xd91193=this[_0x9607('0xc')][_0x9607('0x11')];this['mapAgentsId']=_[_0x9607('0x12')](this[_0x9607('0xb')],'id');this['mapAgentsId']['_rr']=_0xd91193;};MailQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x9607('0x13')]=0x0;for(var _0x501059=0x0;_0x501059=0x0?this['available']:0x0;var _0x36f392={'id':this['id'],'available':this[_0x9607('0x17')],'loggedIn':this[_0x9607('0x16')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x9607('0xd')]};var _0x4fb907=md5(JSON[_0x9607('0x18')](_0x36f392));if(this['md5']!==_0x4fb907){this['md5']=_0x4fb907;io['to'](util[_0x9607('0x19')](_0x9607('0x1a'),_0x36f392[_0x9607('0x8')]))[_0x9607('0x1b')](_0x9607('0x1c'),_0x36f392);}};module[_0x9607('0x1d')]=MailQueue; \ No newline at end of file +var _0xa711=['loggedIn','paused','Agents','online','available','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map'];(function(_0x1bc228,_0x32deb2){var _0x4e489a=function(_0x5aaa74){while(--_0x5aaa74){_0x1bc228['push'](_0x1bc228['shift']());}};_0x4e489a(++_0x32deb2);}(_0xa711,0xfd));var _0x1a71=function(_0x3b76a2,_0x2d37b3){_0x3b76a2=_0x3b76a2-0x0;var _0x327e21=_0xa711[_0x3b76a2];return _0x327e21;};'use strict';var _=require(_0x1a71('0x0'));var md5=require(_0x1a71('0x1'));var util=require(_0x1a71('0x2'));var Redis=require(_0x1a71('0x3'));var config=require(_0x1a71('0x4'));config[_0x1a71('0x5')]=_['defaults'](config[_0x1a71('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1a71('0x6'))(new Redis(config[_0x1a71('0x5')]));function MailQueue(_0x52f9be){this['id']=_0x52f9be['id']||0x0;this[_0x1a71('0x7')]=_0x52f9be[_0x1a71('0x7')]||'';this[_0x1a71('0x8')]=_0x52f9be[_0x1a71('0x8')]||0xa;this[_0x1a71('0x9')]=_0x52f9be[_0x1a71('0x9')]||_0x1a71('0xa');this['Agents']=_0x52f9be['Agents'];this[_0x1a71('0xb')]={};this[_0x1a71('0xc')]=0x0;this[_0x1a71('0x1')]='';this['updateRouting']();this[_0x1a71('0xd')]();}MailQueue[_0x1a71('0xe')][_0x1a71('0xf')]=function(){var _0x3312f3=this[_0x1a71('0xb')]['_rr'];this[_0x1a71('0xb')]=_[_0x1a71('0x10')](this['Agents'],'id');this[_0x1a71('0xb')]['_rr']=_0x3312f3;};MailQueue['prototype'][_0x1a71('0xd')]=function(){this[_0x1a71('0x11')]=0x0;this[_0x1a71('0x12')]=0x0;for(var _0x75fa87=0x0;_0x75fa87=0x0?this[_0x1a71('0x15')]:0x0;var _0x12def2={'id':this['id'],'available':this[_0x1a71('0x15')],'loggedIn':this[_0x1a71('0x11')],'name':this[_0x1a71('0x7')],'paused':this['paused'],'waiting':this[_0x1a71('0xc')]};var _0x2d595a=md5(JSON['stringify'](_0x12def2));if(this['md5']!==_0x2d595a){this['md5']=_0x2d595a;io['to'](util[_0x1a71('0x16')](_0x1a71('0x17'),_0x12def2[_0x1a71('0x7')]))[_0x1a71('0x18')](_0x1a71('0x19'),_0x12def2);}};module[_0x1a71('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 97197ee..212ed68 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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x18ae8a,_0x247fb8){var _0x43886e=function(_0xe2ce6d){while(--_0xe2ce6d){_0x18ae8a['push'](_0x18ae8a['shift']());}};_0x43886e(++_0x247fb8);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2fdf82,_0x322e7c){_0x2fdf82=_0x2fdf82-0x0;var _0x2382f5=_0x5fc3[_0x2fdf82];return _0x2382f5;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x2dedd8,_0x3fe19f){var _0x530a6b=function(_0x1a2865){while(--_0x1a2865){_0x2dedd8['push'](_0x2dedd8['shift']());}};_0x530a6b(++_0x3fe19f);}(_0x814b,0x1a2));var _0xb814=function(_0x423e15,_0x12b2b2){_0x423e15=_0x423e15-0x0;var _0x184279=_0x814b[_0x423e15];return _0x184279;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index e7381a4..436e049 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 _0x5ad3=['sms_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','prototype','_rr','mapAgentsId','updateRealtime','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit'];(function(_0x594bdb,_0x5b42a9){var _0x7f732a=function(_0x125461){while(--_0x125461){_0x594bdb['push'](_0x594bdb['shift']());}};_0x7f732a(++_0x5b42a9);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x14a4d0,_0x4c7068){_0x14a4d0=_0x14a4d0-0x0;var _0x18c8ab=_0x5ad3[_0x14a4d0];return _0x18c8ab;};'use strict';var _=require(_0x35ad('0x0'));var md5=require(_0x35ad('0x1'));var util=require(_0x35ad('0x2'));var Redis=require(_0x35ad('0x3'));var config=require('../../../config/environment');config[_0x35ad('0x4')]=_[_0x35ad('0x5')](config[_0x35ad('0x4')],{'host':_0x35ad('0x6'),'port':0x18eb});var io=require(_0x35ad('0x7'))(new Redis(config[_0x35ad('0x4')]));function SmsQueue(_0x729a01){this['id']=_0x729a01['id']||0x0;this[_0x35ad('0x8')]=_0x729a01[_0x35ad('0x8')]||'';this[_0x35ad('0x9')]=_0x729a01['timeout']||0xa;this[_0x35ad('0xa')]=_0x729a01[_0x35ad('0xa')]||_0x35ad('0xb');this['Agents']=_0x729a01[_0x35ad('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x35ad('0x1')]='';this[_0x35ad('0xd')]();this['updateRealtime']();}SmsQueue[_0x35ad('0xe')][_0x35ad('0xd')]=function(){var _0x4ad760=this['mapAgentsId'][_0x35ad('0xf')];this[_0x35ad('0x10')]=_['map'](this[_0x35ad('0xc')],'id');this[_0x35ad('0x10')]['_rr']=_0x4ad760;};SmsQueue['prototype'][_0x35ad('0x11')]=function(){this[_0x35ad('0x12')]=0x0;this[_0x35ad('0x13')]=0x0;for(var _0x4b7ad9=0x0;_0x4b7ad9=0x0?this[_0x35ad('0x17')]:0x0;var _0x3a73c8={'id':this['id'],'available':this[_0x35ad('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x35ad('0x8')],'paused':this[_0x35ad('0x13')],'waiting':this['waiting']};var _0x53b8e3=md5(JSON[_0x35ad('0x18')](_0x3a73c8));if(this[_0x35ad('0x1')]!==_0x53b8e3){this['md5']=_0x53b8e3;io['to'](util[_0x35ad('0x19')](_0x35ad('0x1a'),_0x3a73c8['name']))[_0x35ad('0x1b')](_0x35ad('0x1c'),_0x3a73c8);}};module[_0x35ad('0x1d')]=SmsQueue; \ No newline at end of file +var _0x37dc=['paused','length','available','stringify','sms:queue:%s','sms_queue:save','lodash','md5','util','ioredis','redis','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn'];(function(_0x38d499,_0x1cbb6b){var _0x274b18=function(_0x488d64){while(--_0x488d64){_0x38d499['push'](_0x38d499['shift']());}};_0x274b18(++_0x1cbb6b);}(_0x37dc,0x1e9));var _0xc37d=function(_0x15994b,_0x9e5cca){_0x15994b=_0x15994b-0x0;var _0x479bdf=_0x37dc[_0x15994b];return _0x479bdf;};'use strict';var _=require(_0xc37d('0x0'));var md5=require(_0xc37d('0x1'));var util=require(_0xc37d('0x2'));var Redis=require(_0xc37d('0x3'));var config=require('../../../config/environment');config[_0xc37d('0x4')]=_['defaults'](config[_0xc37d('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0x4eabf9){this['id']=_0x4eabf9['id']||0x0;this[_0xc37d('0x5')]=_0x4eabf9[_0xc37d('0x5')]||'';this[_0xc37d('0x6')]=_0x4eabf9[_0xc37d('0x6')]||0xa;this[_0xc37d('0x7')]=_0x4eabf9[_0xc37d('0x7')]||_0xc37d('0x8');this[_0xc37d('0x9')]=_0x4eabf9[_0xc37d('0x9')];this['mapAgentsId']={};this[_0xc37d('0xa')]=0x0;this[_0xc37d('0x1')]='';this['updateRouting']();this[_0xc37d('0xb')]();}SmsQueue[_0xc37d('0xc')]['updateRouting']=function(){var _0x11f35f=this[_0xc37d('0xd')]['_rr'];this[_0xc37d('0xd')]=_[_0xc37d('0xe')](this[_0xc37d('0x9')],'id');this[_0xc37d('0xd')][_0xc37d('0xf')]=_0x11f35f;};SmsQueue[_0xc37d('0xc')][_0xc37d('0xb')]=function(){this[_0xc37d('0x10')]=0x0;this[_0xc37d('0x11')]=0x0;for(var _0x39aab8=0x0;_0x39aab8=0x0?this[_0xc37d('0x13')]:0x0;var _0x1816f4={'id':this['id'],'available':this[_0xc37d('0x13')],'loggedIn':this[_0xc37d('0x10')],'name':this[_0xc37d('0x5')],'paused':this[_0xc37d('0x11')],'waiting':this['waiting']};var _0x5dbbb1=md5(JSON[_0xc37d('0x14')](_0x1816f4));if(this[_0xc37d('0x1')]!==_0x5dbbb1){this[_0xc37d('0x1')]=_0x5dbbb1;io['to'](util['format'](_0xc37d('0x15'),_0x1816f4[_0xc37d('0x5')]))['emit'](_0xc37d('0x16'),_0x1816f4);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index a469e71..f6151a7 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 _0xd039=['format','whatsapp:queue:%s','exports','lodash','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','mapAgentsId','md5','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','length','whatsappPause','paused','available','waiting','stringify'];(function(_0x53ee03,_0x2e8f28){var _0x568df4=function(_0xa0d920){while(--_0xa0d920){_0x53ee03['push'](_0x53ee03['shift']());}};_0x568df4(++_0x2e8f28);}(_0xd039,0x6f));var _0x9d03=function(_0x3e10a6,_0x2250b7){_0x3e10a6=_0x3e10a6-0x0;var _0x2b5474=_0xd039[_0x3e10a6];return _0x2b5474;};'use strict';var _=require(_0x9d03('0x0'));var md5=require('md5');var util=require(_0x9d03('0x1'));var Redis=require(_0x9d03('0x2'));var config=require(_0x9d03('0x3'));config[_0x9d03('0x4')]=_['defaults'](config[_0x9d03('0x4')],{'host':_0x9d03('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x37ea5e){this['id']=_0x37ea5e['id']||0x0;this[_0x9d03('0x6')]=_0x37ea5e['name']||'';this[_0x9d03('0x7')]=_0x37ea5e[_0x9d03('0x7')]||0xa;this[_0x9d03('0x8')]=_0x37ea5e['strategy']||'beepall';this[_0x9d03('0x9')]=_0x37ea5e[_0x9d03('0x9')];this[_0x9d03('0xa')]={};this['waiting']=0x0;this[_0x9d03('0xb')]='';this['updateRouting']();this[_0x9d03('0xc')]();}WhatsappQueue[_0x9d03('0xd')][_0x9d03('0xe')]=function(){var _0x9f0c92=this['mapAgentsId'][_0x9d03('0xf')];this[_0x9d03('0xa')]=_[_0x9d03('0x10')](this[_0x9d03('0x9')],'id');this['mapAgentsId'][_0x9d03('0xf')]=_0x9f0c92;};WhatsappQueue[_0x9d03('0xd')][_0x9d03('0xc')]=function(){this[_0x9d03('0x11')]=0x0;this['paused']=0x0;for(var _0x11eb03=0x0;_0x11eb03=0x0?this[_0x9d03('0x15')]:0x0;var _0x4486a6={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9d03('0x11')],'name':this[_0x9d03('0x6')],'paused':this['paused'],'waiting':this[_0x9d03('0x16')]};var _0x5cdcbb=md5(JSON[_0x9d03('0x17')](_0x4486a6));if(this['md5']!==_0x5cdcbb){this[_0x9d03('0xb')]=_0x5cdcbb;io['to'](util[_0x9d03('0x18')](_0x9d03('0x19'),_0x4486a6[_0x9d03('0x6')]))['emit']('whatsapp_queue:save',_0x4486a6);}};module[_0x9d03('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0xe0f0=['emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','whatsappPause','available','name','stringify','whatsapp:queue:%s'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe0f0,0xf3));var _0x0e0f=function(_0x1a4950,_0x53b0f7){_0x1a4950=_0x1a4950-0x0;var _0x4787d5=_0xe0f0[_0x1a4950];return _0x4787d5;};'use strict';var _=require(_0x0e0f('0x0'));var md5=require(_0x0e0f('0x1'));var util=require(_0x0e0f('0x2'));var Redis=require(_0x0e0f('0x3'));var config=require(_0x0e0f('0x4'));config['redis']=_['defaults'](config[_0x0e0f('0x5')],{'host':_0x0e0f('0x6'),'port':0x18eb});var io=require(_0x0e0f('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x410d08){this['id']=_0x410d08['id']||0x0;this['name']=_0x410d08['name']||'';this[_0x0e0f('0x8')]=_0x410d08['timeout']||0xa;this[_0x0e0f('0x9')]=_0x410d08[_0x0e0f('0x9')]||'beepall';this['Agents']=_0x410d08[_0x0e0f('0xa')];this[_0x0e0f('0xb')]={};this[_0x0e0f('0xc')]=0x0;this[_0x0e0f('0x1')]='';this[_0x0e0f('0xd')]();this[_0x0e0f('0xe')]();}WhatsappQueue[_0x0e0f('0xf')][_0x0e0f('0xd')]=function(){var _0x759505=this['mapAgentsId']['_rr'];this[_0x0e0f('0xb')]=_[_0x0e0f('0x10')](this[_0x0e0f('0xa')],'id');this[_0x0e0f('0xb')][_0x0e0f('0x11')]=_0x759505;};WhatsappQueue[_0x0e0f('0xf')][_0x0e0f('0xe')]=function(){this[_0x0e0f('0x12')]=0x0;this[_0x0e0f('0x13')]=0x0;for(var _0x2b24a4=0x0;_0x2b24a4=0x0?this[_0x0e0f('0x17')]:0x0;var _0x165b80={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x0e0f('0x18')],'paused':this[_0x0e0f('0x13')],'waiting':this[_0x0e0f('0xc')]};var _0x540df1=md5(JSON[_0x0e0f('0x19')](_0x165b80));if(this[_0x0e0f('0x1')]!==_0x540df1){this[_0x0e0f('0x1')]=_0x540df1;io['to'](util['format'](_0x0e0f('0x1a'),_0x165b80[_0x0e0f('0x18')]))[_0x0e0f('0x1b')](_0x0e0f('0x1c'),_0x165b80);}};module[_0x0e0f('0x1d')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 53df630..8831958 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(_0x40248a,_0x52775d){var _0x16b5a5=function(_0x247513){while(--_0x247513){_0x40248a['push'](_0x40248a['shift']());}};_0x16b5a5(++_0x52775d);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b4517,_0x5dbf6a){_0x4b4517=_0x4b4517-0x0;var _0x48278b=_0xb10b[_0x4b4517];return _0x48278b;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index a37fee9..710f118 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 _0x8d80=['../client','update','UpdateChatInteraction','updateChatInteraction','Request','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0x8d80,0xa1));var _0x08d8=function(_0xf970ae,_0x3f974f){_0xf970ae=_0xf970ae-0x0;var _0x351fc2=_0x8d80[_0xf970ae];return _0x351fc2;};'use strict';var client=require(_0x08d8('0x0'));exports[_0x08d8('0x1')]=function(_0x5d185c,_0x576c8a){return client['Request'](_0x08d8('0x2'),{'body':_0x576c8a,'options':{'where':{'id':_0x5d185c}},'log':_0x08d8('0x3')});};exports['addTags']=function(_0x34414d,_0x102df9){return client[_0x08d8('0x4')](_0x08d8('0x5'),{'body':_0x102df9,'options':{'where':{'id':_0x34414d}},'log':_0x08d8('0x6')});}; \ No newline at end of file +var _0xbe64=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x4dc8ab,_0x337c7b){var _0x131754=function(_0x47201c){while(--_0x47201c){_0x4dc8ab['push'](_0x4dc8ab['shift']());}};_0x131754(++_0x337c7b);}(_0xbe64,0x18d));var _0x4be6=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xbe64[_0x363ef8];return _0x148822;};'use strict';var client=require(_0x4be6('0x0'));exports[_0x4be6('0x1')]=function(_0x6f6eb6,_0x3b3d4d){return client[_0x4be6('0x2')](_0x4be6('0x3'),{'body':_0x3b3d4d,'options':{'where':{'id':_0x6f6eb6}},'log':_0x4be6('0x4')});};exports[_0x4be6('0x5')]=function(_0x1001e9,_0x36d080){return client['Request'](_0x4be6('0x6'),{'body':_0x36d080,'options':{'where':{'id':_0x1001e9}},'log':_0x4be6('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 770c5f5..777bc62 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 _0xb8eb=['CreateChatMessage','../client','create'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xb8eb,0x1d8));var _0xbb8e=function(_0x4bb6d7,_0x40b9a7){_0x4bb6d7=_0x4bb6d7-0x0;var _0x5f4b7e=_0xb8eb[_0x4bb6d7];return _0x5f4b7e;};'use strict';var client=require(_0xbb8e('0x0'));exports[_0xbb8e('0x1')]=function(_0x3cc9f9){return client['Request'](_0xbb8e('0x2'),{'body':_0x3cc9f9,'log':'createChatMessage'});}; \ No newline at end of file +var _0xcdc0=['../client','Request','CreateChatMessage'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xcdc0,0x102));var _0x0cdc=function(_0x2ee452,_0x3276b4){_0x2ee452=_0x2ee452-0x0;var _0x395382=_0xcdc0[_0x2ee452];return _0x395382;};'use strict';var client=require(_0x0cdc('0x0'));exports['create']=function(_0x466f0b){return client[_0x0cdc('0x1')](_0x0cdc('0x2'),{'body':_0x466f0b,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index b575c40..98c794d 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 _0x08d9=['chatPause','getChatQueues','../client','Request','name','timeout','strategy','online'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x08d9,0xc2));var _0x908d=function(_0x3e34a3,_0x53fbfe){_0x3e34a3=_0x3e34a3-0x0;var _0x22f0e6=_0x08d9[_0x3e34a3];return _0x22f0e6;};'use strict';var client=require(_0x908d('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x908d('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x908d('0x2'),_0x908d('0x3'),_0x908d('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x908d('0x2'),_0x908d('0x5'),_0x908d('0x6')]}]},'log':_0x908d('0x7')});};}; \ No newline at end of file +var _0xfcbe=['Request','GetChatQueue','name','timeout','strategy','Agents','getChatQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x1960a0,_0x2c742d){_0x1960a0=_0x1960a0-0x0;var _0x5e85e3=_0xfcbe[_0x1960a0];return _0x5e85e3;};'use strict';var client=require('../client');exports[_0xefcb('0x0')]=function(){return function(){return client[_0xefcb('0x1')](_0xefcb('0x2'),{'options':{'raw':![],'attributes':['id',_0xefcb('0x3'),_0xefcb('0x4'),_0xefcb('0x5')],'include':[{'model':'User','as':_0xefcb('0x6'),'attributes':['id',_0xefcb('0x3'),'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 8ddfd70..5d6c8e3 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 _0x01fe=['update','DESC','../client','Request'];(function(_0x5ae733,_0xbd346a){var _0x4f5ce8=function(_0x103415){while(--_0x103415){_0x5ae733['push'](_0x5ae733['shift']());}};_0x4f5ce8(++_0xbd346a);}(_0x01fe,0x102));var _0xe01f=function(_0x21f49e,_0x469c0a){_0x21f49e=_0x21f49e-0x0;var _0x1df81e=_0x01fe[_0x21f49e];return _0x1df81e;};'use strict';var client=require(_0xe01f('0x0'));exports['create']=function(_0x3ba50c){return client[_0xe01f('0x1')]('CreateChatQueueReport',{'body':_0x3ba50c,'log':'CreateChatQueueReport'});};exports[_0xe01f('0x2')]=function(_0x1212f6,_0x9505fa){return client[_0xe01f('0x1')]('UpdateChatQueueReport',{'body':_0x9505fa,'options':{'where':{'uniqueid':_0x1212f6},'order':[['id',_0xe01f('0x3')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x28a2=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x228a('0x0'));exports[_0x228a('0x1')]=function(_0x1fa4cd){return client[_0x228a('0x2')](_0x228a('0x3'),{'body':_0x1fa4cd,'log':_0x228a('0x3')});};exports[_0x228a('0x4')]=function(_0x5ce39e,_0x6efce7){return client['Request'](_0x228a('0x5'),{'body':_0x6efce7,'options':{'where':{'uniqueid':_0x5ce39e},'order':[['id',_0x228a('0x6')]],'limit':0x1},'log':_0x228a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index ef7c00c..bd9cacd 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x7a54,0x106));var _0x47a5=function(_0x5a7236,_0x4a6dc0){_0x5a7236=_0x5a7236-0x0;var _0x1e5594=_0x7a54[_0x5a7236];return _0x1e5594;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0x7a54,0x106));var _0x47a5=function(_0x13c862,_0x24f026){_0x13c862=_0x13c862-0x0;var _0x2e8491=_0x7a54[_0x13c862];return _0x2e8491;};'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 a2e2404..1e0777e 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 _0xe586=['createFaxMessage','../client','Request','CreateFaxMessage'];(function(_0x492221,_0x9e2521){var _0x398bf9=function(_0x303c5b){while(--_0x303c5b){_0x492221['push'](_0x492221['shift']());}};_0x398bf9(++_0x9e2521);}(_0xe586,0x95));var _0x6e58=function(_0x3c2654,_0x133511){_0x3c2654=_0x3c2654-0x0;var _0x39ad61=_0xe586[_0x3c2654];return _0x39ad61;};'use strict';var client=require(_0x6e58('0x0'));exports['create']=function(_0x326bdb){return client[_0x6e58('0x1')](_0x6e58('0x2'),{'body':_0x326bdb,'log':_0x6e58('0x3')});}; \ No newline at end of file +var _0x2ef7=['../client','create','Request'];(function(_0x4e4921,_0xf8a1f1){var _0x41b458=function(_0x552578){while(--_0x552578){_0x4e4921['push'](_0x4e4921['shift']());}};_0x41b458(++_0xf8a1f1);}(_0x2ef7,0xde));var _0x72ef=function(_0x75a833,_0x51475f){_0x75a833=_0x75a833-0x0;var _0x281791=_0x2ef7[_0x75a833];return _0x281791;};'use strict';var client=require(_0x72ef('0x0'));exports[_0x72ef('0x1')]=function(_0x1ddd13){return client[_0x72ef('0x2')]('CreateFaxMessage',{'body':_0x1ddd13,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 3c615e6..ae91d53 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 _0x2001=['timeout','Agents','online','../client','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x1c5efb,_0x4cc64c){var _0x140486=function(_0x5ce0f7){while(--_0x5ce0f7){_0x1c5efb['push'](_0x1c5efb['shift']());}};_0x140486(++_0x4cc64c);}(_0x2001,0x13b));var _0x1200=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x2001[_0x4fbfd9];return _0x31dc94;};'use strict';var client=require(_0x1200('0x0'));exports[_0x1200('0x1')]=function(){return function(){return client[_0x1200('0x2')](_0x1200('0x3'),{'options':{'raw':![],'attributes':['id',_0x1200('0x4'),_0x1200('0x5'),'strategy'],'include':[{'model':'User','as':_0x1200('0x6'),'attributes':['id',_0x1200('0x4'),_0x1200('0x7'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x0302=['online','faxPause','getFaxQueues','Request','GetFaxQueue','name','timeout'];(function(_0x59dbce,_0x37bdd4){var _0x2fa34b=function(_0x243c65){while(--_0x243c65){_0x59dbce['push'](_0x59dbce['shift']());}};_0x2fa34b(++_0x37bdd4);}(_0x0302,0xb1));var _0x2030=function(_0x2ca784,_0x329093){_0x2ca784=_0x2ca784-0x0;var _0x21d1fe=_0x0302[_0x2ca784];return _0x21d1fe;};'use strict';var client=require('../client');exports[_0x2030('0x0')]=function(){return function(){return client[_0x2030('0x1')](_0x2030('0x2'),{'options':{'raw':![],'attributes':['id',_0x2030('0x3'),_0x2030('0x4'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x2030('0x3'),_0x2030('0x5'),_0x2030('0x6')]}]},'log':_0x2030('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 91e9029..d46b68b 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 _0xa4f0=['CreateFaxQueueReport','update','UpdateFaxQueueReport','../client','Request'];(function(_0x43444b,_0x8cf95b){var _0x392fe5=function(_0x7a1a82){while(--_0x7a1a82){_0x43444b['push'](_0x43444b['shift']());}};_0x392fe5(++_0x8cf95b);}(_0xa4f0,0x1c5));var _0x0a4f=function(_0x7430b4,_0x3526ec){_0x7430b4=_0x7430b4-0x0;var _0x44bbd5=_0xa4f0[_0x7430b4];return _0x44bbd5;};'use strict';var client=require(_0x0a4f('0x0'));exports['create']=function(_0x57def2){return client[_0x0a4f('0x1')]('CreateFaxQueueReport',{'body':_0x57def2,'log':_0x0a4f('0x2')});};exports[_0x0a4f('0x3')]=function(_0x8f026e,_0x2f3ca7){return client[_0x0a4f('0x1')](_0x0a4f('0x4'),{'body':_0x2f3ca7,'options':{'where':{'uniqueid':_0x8f026e},'order':[['id','DESC']],'limit':0x1},'log':_0x0a4f('0x4')});}; \ No newline at end of file +var _0xdc77=['update','UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport'];(function(_0x545e41,_0x55830d){var _0x20ee17=function(_0xac9b17){while(--_0xac9b17){_0x545e41['push'](_0x545e41['shift']());}};_0x20ee17(++_0x55830d);}(_0xdc77,0x96));var _0x7dc7=function(_0x14a005,_0x46b76b){_0x14a005=_0x14a005-0x0;var _0x4383ae=_0xdc77[_0x14a005];return _0x4383ae;};'use strict';var client=require(_0x7dc7('0x0'));exports[_0x7dc7('0x1')]=function(_0x2ed5b0){return client[_0x7dc7('0x2')](_0x7dc7('0x3'),{'body':_0x2ed5b0,'log':'CreateFaxQueueReport'});};exports[_0x7dc7('0x4')]=function(_0x15acc4,_0x551696){return client['Request'](_0x7dc7('0x5'),{'body':_0x551696,'options':{'where':{'uniqueid':_0x15acc4},'order':[['id',_0x7dc7('0x6')]],'limit':0x1},'log':_0x7dc7('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 1368210..e1ae562 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 _0x39a7=['interval','../client','getIntervals','GetInterval','name','Interval','Intervals'];(function(_0x53b133,_0x176261){var _0x5647e0=function(_0x4c62b0){while(--_0x4c62b0){_0x53b133['push'](_0x53b133['shift']());}};_0x5647e0(++_0x176261);}(_0x39a7,0x119));var _0x739a=function(_0x29f014,_0x508522){_0x29f014=_0x29f014-0x0;var _0x316be5=_0x39a7[_0x29f014];return _0x316be5;};'use strict';var client=require(_0x739a('0x0'));exports[_0x739a('0x1')]=function(){return function(){return client['Request'](_0x739a('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x739a('0x3')],'include':[{'model':_0x739a('0x4'),'as':_0x739a('0x5'),'attributes':['id',_0x739a('0x3'),_0x739a('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xb0b2=['GetInterval','name','Interval','Intervals','interval','../client','getIntervals','Request'];(function(_0x224f25,_0xaaa874){var _0x27818f=function(_0x4e33b0){while(--_0x4e33b0){_0x224f25['push'](_0x224f25['shift']());}};_0x27818f(++_0xaaa874);}(_0xb0b2,0x18d));var _0x2b0b=function(_0x486b9c,_0x4f992e){_0x486b9c=_0x486b9c-0x0;var _0x4d0e86=_0xb0b2[_0x486b9c];return _0x4d0e86;};'use strict';var client=require(_0x2b0b('0x0'));exports[_0x2b0b('0x1')]=function(){return function(){return client[_0x2b0b('0x2')](_0x2b0b('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2b0b('0x4')],'include':[{'model':_0x2b0b('0x5'),'as':_0x2b0b('0x6'),'attributes':['id','name',_0x2b0b('0x7')]}]},'log':_0x2b0b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 57fa131..acdb626 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 _0x2542=['AddTagsToMailInteraction','../client','update','UpdateMailInteraction','addTags','Request'];(function(_0x1a3fdc,_0x2ce5a7){var _0x5dbe5f=function(_0x1ae876){while(--_0x1ae876){_0x1a3fdc['push'](_0x1a3fdc['shift']());}};_0x5dbe5f(++_0x2ce5a7);}(_0x2542,0x169));var _0x2254=function(_0x1e37e8,_0x18a60c){_0x1e37e8=_0x1e37e8-0x0;var _0x494689=_0x2542[_0x1e37e8];return _0x494689;};'use strict';var client=require(_0x2254('0x0'));exports[_0x2254('0x1')]=function(_0x2f3bcd,_0x20dfee){return client['Request'](_0x2254('0x2'),{'body':_0x20dfee,'options':{'where':{'id':_0x2f3bcd}},'log':'updateMailInteraction'});};exports[_0x2254('0x3')]=function(_0x3b3dcb,_0x27f5c9){return client[_0x2254('0x4')](_0x2254('0x5'),{'body':_0x27f5c9,'options':{'where':{'id':_0x3b3dcb}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x0598=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','updateMailInteraction','addTags'];(function(_0x3bfc1c,_0x5cdd1e){var _0x23fe8a=function(_0x5847c8){while(--_0x5847c8){_0x3bfc1c['push'](_0x3bfc1c['shift']());}};_0x23fe8a(++_0x5cdd1e);}(_0x0598,0x92));var _0x8059=function(_0x2c351e,_0x4c4ba0){_0x2c351e=_0x2c351e-0x0;var _0x54e5c7=_0x0598[_0x2c351e];return _0x54e5c7;};'use strict';var client=require(_0x8059('0x0'));exports[_0x8059('0x1')]=function(_0x5c8253,_0x3386f0){return client['Request']('UpdateMailInteraction',{'body':_0x3386f0,'options':{'where':{'id':_0x5c8253}},'log':_0x8059('0x2')});};exports[_0x8059('0x3')]=function(_0x54b9a2,_0x54f42f){return client['Request'](_0x8059('0x4'),{'body':_0x54f42f,'options':{'where':{'id':_0x54b9a2}},'log':_0x8059('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 365f718..07a3e84 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 _0x931f=['Request','CreateMailMessage','createMailMessage','create'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x931f,0x67));var _0xf931=function(_0x31aa0d,_0x217049){_0x31aa0d=_0x31aa0d-0x0;var _0x53e7e0=_0x931f[_0x31aa0d];return _0x53e7e0;};'use strict';var client=require('../client');exports[_0xf931('0x0')]=function(_0x55183c){return client[_0xf931('0x1')](_0xf931('0x2'),{'body':_0x55183c,'log':_0xf931('0x3')});}; \ No newline at end of file +var _0xf27d=['CreateMailMessage','createMailMessage','create','Request'];(function(_0x51308b,_0xa423a9){var _0x3f23c2=function(_0x580b97){while(--_0x580b97){_0x51308b['push'](_0x51308b['shift']());}};_0x3f23c2(++_0xa423a9);}(_0xf27d,0x1c6));var _0xdf27=function(_0x57d1e0,_0x233efd){_0x57d1e0=_0x57d1e0-0x0;var _0x100f2a=_0xf27d[_0x57d1e0];return _0x100f2a;};'use strict';var client=require('../client');exports[_0xdf27('0x0')]=function(_0x3d51e2){return client[_0xdf27('0x1')](_0xdf27('0x2'),{'body':_0x3d51e2,'log':_0xdf27('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 4c26a94..b75032a 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 _0xd517=['User','name','../client','getMailQueues','GetMailQueue','timeout','strategy'];(function(_0x14f57f,_0x31e743){var _0x1dc939=function(_0x1a7078){while(--_0x1a7078){_0x14f57f['push'](_0x14f57f['shift']());}};_0x1dc939(++_0x31e743);}(_0xd517,0xe2));var _0x7d51=function(_0x1b8f5a,_0x57c154){_0x1b8f5a=_0x1b8f5a-0x0;var _0x594189=_0xd517[_0x1b8f5a];return _0x594189;};'use strict';var client=require(_0x7d51('0x0'));exports[_0x7d51('0x1')]=function(){return function(){return client['Request'](_0x7d51('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x7d51('0x3'),_0x7d51('0x4')],'include':[{'model':_0x7d51('0x5'),'as':'Agents','attributes':['id',_0x7d51('0x6'),'online','mailPause']}]},'log':_0x7d51('0x1')});};}; \ No newline at end of file +var _0xc923=['getMailQueues','Request','name','timeout','strategy','User','Agents','../client'];(function(_0x3a794d,_0x3896cb){var _0x5e46ab=function(_0x8fef14){while(--_0x8fef14){_0x3a794d['push'](_0x3a794d['shift']());}};_0x5e46ab(++_0x3896cb);}(_0xc923,0x87));var _0x3c92=function(_0x20f86e,_0x1deee0){_0x20f86e=_0x20f86e-0x0;var _0x5dec36=_0xc923[_0x20f86e];return _0x5dec36;};'use strict';var client=require(_0x3c92('0x0'));exports[_0x3c92('0x1')]=function(){return function(){return client[_0x3c92('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x3c92('0x3'),_0x3c92('0x4'),_0x3c92('0x5')],'include':[{'model':_0x3c92('0x6'),'as':_0x3c92('0x7'),'attributes':['id',_0x3c92('0x3'),'online','mailPause']}]},'log':_0x3c92('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 6d98466..496fb64 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 _0xf245=['Request','update','UpdateMailQueueReport','DESC','../client','create'];(function(_0x2a2f15,_0x483226){var _0x269f5b=function(_0xddf64b){while(--_0xddf64b){_0x2a2f15['push'](_0x2a2f15['shift']());}};_0x269f5b(++_0x483226);}(_0xf245,0x10c));var _0x5f24=function(_0xb8cfbe,_0x2e81b6){_0xb8cfbe=_0xb8cfbe-0x0;var _0x227d51=_0xf245[_0xb8cfbe];return _0x227d51;};'use strict';var client=require(_0x5f24('0x0'));exports[_0x5f24('0x1')]=function(_0x49d0f0){return client[_0x5f24('0x2')]('CreateMailQueueReport',{'body':_0x49d0f0,'log':'CreateMailQueueReport'});};exports[_0x5f24('0x3')]=function(_0x1c460f,_0x55af1b){return client['Request'](_0x5f24('0x4'),{'body':_0x55af1b,'options':{'where':{'uniqueid':_0x1c460f},'order':[['id',_0x5f24('0x5')]],'limit':0x1},'log':_0x5f24('0x4')});}; \ No newline at end of file +var _0x53d4=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x15ca1f,_0x244cb4){var _0x3a173f=function(_0x1dc29b){while(--_0x1dc29b){_0x15ca1f['push'](_0x15ca1f['shift']());}};_0x3a173f(++_0x244cb4);}(_0x53d4,0x172));var _0x453d=function(_0x1031d1,_0x516935){_0x1031d1=_0x1031d1-0x0;var _0x541a00=_0x53d4[_0x1031d1];return _0x541a00;};'use strict';var client=require(_0x453d('0x0'));exports[_0x453d('0x1')]=function(_0x190eb2){return client[_0x453d('0x2')](_0x453d('0x3'),{'body':_0x190eb2,'log':_0x453d('0x3')});};exports[_0x453d('0x4')]=function(_0x3c3cfc,_0x3c058a){return client[_0x453d('0x2')](_0x453d('0x5'),{'body':_0x3c058a,'options':{'where':{'uniqueid':_0x3c3cfc},'order':[['id',_0x453d('0x6')]],'limit':0x1},'log':_0x453d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 09eba40..245a507 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 _0x424a=['../client','update','Request','addTagsToChatInteraction'];(function(_0xa04daf,_0x25e602){var _0x3f7fa6=function(_0x41b149){while(--_0x41b149){_0xa04daf['push'](_0xa04daf['shift']());}};_0x3f7fa6(++_0x25e602);}(_0x424a,0x1c0));var _0xa424=function(_0x2317ae,_0x150322){_0x2317ae=_0x2317ae-0x0;var _0x27624b=_0x424a[_0x2317ae];return _0x27624b;};'use strict';var client=require(_0xa424('0x0'));exports[_0xa424('0x1')]=function(_0x34d7d3,_0x2793dd){return client[_0xa424('0x2')]('UpdateOpenchannelInteraction',{'body':_0x2793dd,'options':{'where':{'id':_0x34d7d3}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x3a80ff,_0x155897){return client[_0xa424('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x155897,'options':{'where':{'id':_0x3a80ff}},'log':_0xa424('0x3')});}; \ No newline at end of file +var _0x742d=['addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x742d,0x189));var _0xd742=function(_0x19af9f,_0x203baa){_0x19af9f=_0x19af9f-0x0;var _0x16e000=_0x742d[_0x19af9f];return _0x16e000;};'use strict';var client=require(_0xd742('0x0'));exports[_0xd742('0x1')]=function(_0x266910,_0x3f87a4){return client[_0xd742('0x2')]('UpdateOpenchannelInteraction',{'body':_0x3f87a4,'options':{'where':{'id':_0x266910}},'log':_0xd742('0x3')});};exports[_0xd742('0x4')]=function(_0x5e5510,_0x2549e5){return client['Request'](_0xd742('0x5'),{'body':_0x2549e5,'options':{'where':{'id':_0x5e5510}},'log':_0xd742('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index fbbe8c5..01755a7 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 _0xc736=['../client','create','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x23be51,_0xc02a1b){var _0x47a26d=function(_0xa92395){while(--_0xa92395){_0x23be51['push'](_0x23be51['shift']());}};_0x47a26d(++_0xc02a1b);}(_0xc736,0x17c));var _0x6c73=function(_0x6a0054,_0x49261d){_0x6a0054=_0x6a0054-0x0;var _0x32ee2b=_0xc736[_0x6a0054];return _0x32ee2b;};'use strict';var client=require(_0x6c73('0x0'));exports[_0x6c73('0x1')]=function(_0x3bc44a){return client['Request'](_0x6c73('0x2'),{'body':_0x3bc44a,'log':_0x6c73('0x3')});}; \ No newline at end of file +var _0x2323=['../client','create','createOpenchannelMessage'];(function(_0xfebd15,_0x3e28fb){var _0x6bdf76=function(_0x2dd308){while(--_0x2dd308){_0xfebd15['push'](_0xfebd15['shift']());}};_0x6bdf76(++_0x3e28fb);}(_0x2323,0x189));var _0x3232=function(_0x26c2c7,_0x40255a){_0x26c2c7=_0x26c2c7-0x0;var _0x21a717=_0x2323[_0x26c2c7];return _0x21a717;};'use strict';var client=require(_0x3232('0x0'));exports[_0x3232('0x1')]=function(_0x12856b){return client['Request']('CreateOpenchannelMessage',{'body':_0x12856b,'log':_0x3232('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 1f386aa..f9a4dd0 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 _0xdec1=['Agents','online','openchannelPause','getOpenchannelQueues','../client','GetOpenchannelQueue','name','timeout','strategy'];(function(_0x5dca82,_0x136a46){var _0x403d5e=function(_0x111b29){while(--_0x111b29){_0x5dca82['push'](_0x5dca82['shift']());}};_0x403d5e(++_0x136a46);}(_0xdec1,0x17e));var _0x1dec=function(_0x844693,_0x541176){_0x844693=_0x844693-0x0;var _0x1fef44=_0xdec1[_0x844693];return _0x1fef44;};'use strict';var client=require(_0x1dec('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0x1dec('0x1'),{'options':{'raw':![],'attributes':['id',_0x1dec('0x2'),_0x1dec('0x3'),_0x1dec('0x4')],'include':[{'model':'User','as':_0x1dec('0x5'),'attributes':['id','name',_0x1dec('0x6'),_0x1dec('0x7')]}]},'log':_0x1dec('0x8')});};}; \ No newline at end of file +var _0x3b5b=['timeout','strategy','User','online','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue','name'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x3b5b,0xc2));var _0xb3b5=function(_0x315d54,_0x333bec){_0x315d54=_0x315d54-0x0;var _0x21c13e=_0x3b5b[_0x315d54];return _0x21c13e;};'use strict';var client=require(_0xb3b5('0x0'));exports[_0xb3b5('0x1')]=function(){return function(){return client['Request'](_0xb3b5('0x2'),{'options':{'raw':![],'attributes':['id',_0xb3b5('0x3'),_0xb3b5('0x4'),_0xb3b5('0x5')],'include':[{'model':_0xb3b5('0x6'),'as':'Agents','attributes':['id',_0xb3b5('0x3'),_0xb3b5('0x7'),_0xb3b5('0x8')]}]},'log':_0xb3b5('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index a00057c..e5008ea 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 _0x9f08=['create','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x2d47fa,_0x206bd6){var _0x3bb8bd=function(_0x3d9742){while(--_0x3d9742){_0x2d47fa['push'](_0x2d47fa['shift']());}};_0x3bb8bd(++_0x206bd6);}(_0x9f08,0x8f));var _0x89f0=function(_0x588f68,_0x7a4d57){_0x588f68=_0x588f68-0x0;var _0x14c6c1=_0x9f08[_0x588f68];return _0x14c6c1;};'use strict';var client=require(_0x89f0('0x0'));exports[_0x89f0('0x1')]=function(_0xcb1cd6){return client[_0x89f0('0x2')](_0x89f0('0x3'),{'body':_0xcb1cd6,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x5a0eb6,_0x54f6b1){return client[_0x89f0('0x2')](_0x89f0('0x4'),{'body':_0x54f6b1,'options':{'where':{'uniqueid':_0x5a0eb6},'order':[['id',_0x89f0('0x5')]],'limit':0x1},'log':_0x89f0('0x4')});}; \ No newline at end of file +var _0x8583=['UpdateOpenchannelQueueReport','DESC','../client','create','CreateOpenchannelQueueReport','update','Request'];(function(_0xed251b,_0x508b5f){var _0x4a9864=function(_0x2445b7){while(--_0x2445b7){_0xed251b['push'](_0xed251b['shift']());}};_0x4a9864(++_0x508b5f);}(_0x8583,0x183));var _0x3858=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8583[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x3858('0x0'));exports[_0x3858('0x1')]=function(_0x2c0afb){return client['Request'](_0x3858('0x2'),{'body':_0x2c0afb,'log':_0x3858('0x2')});};exports[_0x3858('0x3')]=function(_0x27131f,_0x3f5e2){return client[_0x3858('0x4')](_0x3858('0x5'),{'body':_0x3f5e2,'options':{'where':{'uniqueid':_0x27131f},'order':[['id',_0x3858('0x6')]],'limit':0x1},'log':_0x3858('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 2fdfd34..6e03c23 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 _0x6921=['Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x37cba1,_0x5b6cc7){var _0x4ea4c9=function(_0x15564e){while(--_0x15564e){_0x37cba1['push'](_0x37cba1['shift']());}};_0x4ea4c9(++_0x5b6cc7);}(_0x6921,0x1d1));var _0x1692=function(_0x458d59,_0x201d8d){_0x458d59=_0x458d59-0x0;var _0x213c63=_0x6921[_0x458d59];return _0x213c63;};'use strict';var client=require('../client');exports[_0x1692('0x0')]=function(_0x566deb,_0x30ea90){return client['Request'](_0x1692('0x1'),{'body':_0x30ea90,'options':{'where':{'id':_0x566deb}},'log':_0x1692('0x2')});};exports['addTags']=function(_0x3995b3,_0x577497){return client[_0x1692('0x3')](_0x1692('0x4'),{'body':_0x577497,'options':{'where':{'id':_0x3995b3}},'log':_0x1692('0x5')});}; \ No newline at end of file +var _0x0b78=['updateSmsInteraction','../client','update','Request'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x0b78,0x1ad));var _0x80b7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0b78[_0x57b54c];return _0x59cc19;};'use strict';var client=require(_0x80b7('0x0'));exports[_0x80b7('0x1')]=function(_0x5d450f,_0x10e644){return client[_0x80b7('0x2')]('UpdateSmsInteraction',{'body':_0x10e644,'options':{'where':{'id':_0x5d450f}},'log':_0x80b7('0x3')});};exports['addTags']=function(_0x6a187e,_0x89d4d7){return client[_0x80b7('0x2')]('AddTagsToSmsInteraction',{'body':_0x89d4d7,'options':{'where':{'id':_0x6a187e}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 10b3de0..345d2ae 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. * // * * // ************************************************************************* -'use strict';var client=require('../client');exports['create']=function(_0x4f8adc){return client['Request']('CreateSmsMessage',{'body':_0x4f8adc,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x92f5=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x42c6f1,_0x338d7b){var _0x3c7398=function(_0x151494){while(--_0x151494){_0x42c6f1['push'](_0x42c6f1['shift']());}};_0x3c7398(++_0x338d7b);}(_0x92f5,0x7d));var _0x592f=function(_0x2ade6c,_0x2d42f2){_0x2ade6c=_0x2ade6c-0x0;var _0x2cb372=_0x92f5[_0x2ade6c];return _0x2cb372;};'use strict';var client=require(_0x592f('0x0'));exports[_0x592f('0x1')]=function(_0xa39332){return client[_0x592f('0x2')](_0x592f('0x3'),{'body':_0xa39332,'log':_0x592f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 0d3d953..d0f6b20 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 _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x4b01e0,_0x5ef558){var _0x57b177=function(_0x746261){while(--_0x746261){_0x4b01e0['push'](_0x4b01e0['shift']());}};_0x57b177(++_0x5ef558);}(_0x70e0,0x17b));var _0x070e=function(_0x2aaa74,_0x5dae0f){_0x2aaa74=_0x2aaa74-0x0;var _0x25bc98=_0x70e0[_0x2aaa74];return _0x25bc98;};'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 +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x4f0d4c,_0x2f7c3c){var _0x258afe=function(_0x415a96){while(--_0x415a96){_0x4f0d4c['push'](_0x4f0d4c['shift']());}};_0x258afe(++_0x2f7c3c);}(_0xe706,0xa3));var _0x6e70=function(_0x42b3aa,_0x223f53){_0x42b3aa=_0x42b3aa-0x0;var _0x319157=_0xe706[_0x42b3aa];return _0x319157;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index e2f5cc5..b2b7f37 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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x257cc7,_0x2c057e){var _0x4b00fe=function(_0x2d8373){while(--_0x2d8373){_0x257cc7['push'](_0x257cc7['shift']());}};_0x4b00fe(++_0x2c057e);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x5034c5,_0x41be19){var _0x127812=function(_0x23a8b4){while(--_0x23a8b4){_0x5034c5['push'](_0x5034c5['shift']());}};_0x127812(++_0x41be19);}(_0x3e74,0x175));var _0x43e7=function(_0x1ef835,_0x5879e3){_0x1ef835=_0x1ef835-0x0;var _0x5c018b=_0x3e74[_0x1ef835];return _0x5c018b;};'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 diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index d4751aa..cfbf0d2 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(_0x412f76,_0x535151){var _0x5b514a=function(_0x31275d){while(--_0x31275d){_0x412f76['push'](_0x412f76['shift']());}};_0x5b514a(++_0x535151);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x2f376b,_0x3a9efb){var _0x341c98=function(_0x2c9f0f){while(--_0x2c9f0f){_0x2f376b['push'](_0x2f376b['shift']());}};_0x341c98(++_0x3a9efb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 90f928e..46b226f 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 _0xfb67=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0xfb67,0xdd));var _0x7fb6=function(_0x5ef144,_0x34db1f){_0x5ef144=_0x5ef144-0x0;var _0x2933d3=_0xfb67[_0x5ef144];return _0x2933d3;};'use strict';var client=require(_0x7fb6('0x0'));exports[_0x7fb6('0x1')]=function(_0x1c5b8d,_0x3fc29d){return client[_0x7fb6('0x2')](_0x7fb6('0x3'),{'body':_0x3fc29d,'options':{'where':{'id':_0x1c5b8d}},'log':_0x7fb6('0x4')});};exports['addTags']=function(_0x40c3ce,_0x29dadc){return client[_0x7fb6('0x2')](_0x7fb6('0x5'),{'body':_0x29dadc,'options':{'where':{'id':_0x40c3ce}},'log':_0x7fb6('0x6')});}; \ No newline at end of file +var _0x8375=['../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x8375,0xa8));var _0x5837=function(_0x1fa6cc,_0x30f55b){_0x1fa6cc=_0x1fa6cc-0x0;var _0xdcc28a=_0x8375[_0x1fa6cc];return _0xdcc28a;};'use strict';var client=require(_0x5837('0x0'));exports[_0x5837('0x1')]=function(_0xe2a8d5,_0x50482c){return client[_0x5837('0x2')](_0x5837('0x3'),{'body':_0x50482c,'options':{'where':{'id':_0xe2a8d5}},'log':_0x5837('0x4')});};exports[_0x5837('0x5')]=function(_0x317452,_0x1edfc5){return client['Request'](_0x5837('0x6'),{'body':_0x1edfc5,'options':{'where':{'id':_0x317452}},'log':_0x5837('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 6e9feea..025fa7d 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 _0x5428=['Request','createWhatsappMessage','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5428,0xb0));var _0x8542=function(_0x39428e,_0x442cc5){_0x39428e=_0x39428e-0x0;var _0x47ba01=_0x5428[_0x39428e];return _0x47ba01;};'use strict';var client=require('../client');exports[_0x8542('0x0')]=function(_0x3739f4){return client[_0x8542('0x1')]('CreateWhatsappMessage',{'body':_0x3739f4,'log':_0x8542('0x2')});}; \ No newline at end of file +var _0x53aa=['createWhatsappMessage','create','Request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x53aa,0x1a8));var _0xa53a=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x53aa[_0x486f4a];return _0x135d99;};'use strict';var client=require('../client');exports[_0xa53a('0x0')]=function(_0x4af684){return client[_0xa53a('0x1')]('CreateWhatsappMessage',{'body':_0x4af684,'log':_0xa53a('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index b920e02..faf99b4 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 _0x2b17=['whatsappPause','getWhatsappQueues','../client','Request','GetWhatsappQueue','name','strategy','User','Agents'];(function(_0x2365a4,_0x55d750){var _0x1d645d=function(_0x557a2f){while(--_0x557a2f){_0x2365a4['push'](_0x2365a4['shift']());}};_0x1d645d(++_0x55d750);}(_0x2b17,0x110));var _0x72b1=function(_0x500794,_0x3f324a){_0x500794=_0x500794-0x0;var _0x551abc=_0x2b17[_0x500794];return _0x551abc;};'use strict';var client=require(_0x72b1('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x72b1('0x1')](_0x72b1('0x2'),{'options':{'raw':![],'attributes':['id',_0x72b1('0x3'),'timeout',_0x72b1('0x4')],'include':[{'model':_0x72b1('0x5'),'as':_0x72b1('0x6'),'attributes':['id',_0x72b1('0x3'),'online',_0x72b1('0x7')]}]},'log':_0x72b1('0x8')});};}; \ No newline at end of file +var _0xab02=['Request','GetWhatsappQueue','name','timeout','strategy','User','online','getWhatsappQueues'];(function(_0x3774a8,_0x1127c1){var _0x4a5185=function(_0x4523c2){while(--_0x4523c2){_0x3774a8['push'](_0x3774a8['shift']());}};_0x4a5185(++_0x1127c1);}(_0xab02,0x1d7));var _0x2ab0=function(_0x45c193,_0x14b2aa){_0x45c193=_0x45c193-0x0;var _0x3f495c=_0xab02[_0x45c193];return _0x3f495c;};'use strict';var client=require('../client');exports[_0x2ab0('0x0')]=function(){return function(){return client[_0x2ab0('0x1')](_0x2ab0('0x2'),{'options':{'raw':![],'attributes':['id',_0x2ab0('0x3'),_0x2ab0('0x4'),_0x2ab0('0x5')],'include':[{'model':_0x2ab0('0x6'),'as':'Agents','attributes':['id','name',_0x2ab0('0x7'),'whatsappPause']}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 7f55a12..60a7a49 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 _0x70c9=['create','CreateWhatsappQueueReport','Request','UpdateWhatsappQueueReport','../client'];(function(_0x8225c9,_0x2e72ff){var _0x2f4210=function(_0x19603a){while(--_0x19603a){_0x8225c9['push'](_0x8225c9['shift']());}};_0x2f4210(++_0x2e72ff);}(_0x70c9,0x126));var _0x970c=function(_0x36c748,_0x22da20){_0x36c748=_0x36c748-0x0;var _0x41cf2e=_0x70c9[_0x36c748];return _0x41cf2e;};'use strict';var client=require(_0x970c('0x0'));exports[_0x970c('0x1')]=function(_0x2066d2){return client['Request'](_0x970c('0x2'),{'body':_0x2066d2,'log':_0x970c('0x2')});};exports['update']=function(_0x4c8888,_0x1005fa){return client[_0x970c('0x3')]('UpdateWhatsappQueueReport',{'body':_0x1005fa,'options':{'where':{'uniqueid':_0x4c8888},'order':[['id','DESC']],'limit':0x1},'log':_0x970c('0x4')});}; \ No newline at end of file +var _0x9589=['DESC','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x37d23a,_0x19d26e){var _0x389547=function(_0x157143){while(--_0x157143){_0x37d23a['push'](_0x37d23a['shift']());}};_0x389547(++_0x19d26e);}(_0x9589,0xf6));var _0x9958=function(_0x327a72,_0x561e7e){_0x327a72=_0x327a72-0x0;var _0x44a4b7=_0x9589[_0x327a72];return _0x44a4b7;};'use strict';var client=require('../client');exports['create']=function(_0x40c542){return client[_0x9958('0x0')](_0x9958('0x1'),{'body':_0x40c542,'log':_0x9958('0x1')});};exports[_0x9958('0x2')]=function(_0x1828fb,_0x17e7a7){return client[_0x9958('0x0')](_0x9958('0x3'),{'body':_0x17e7a7,'options':{'where':{'uniqueid':_0x1828fb},'order':[['id',_0x9958('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ 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 df04bc2..1627b2a 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 _0xf243=['channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','close','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','createQueue'];(function(_0xc75c31,_0x160f4d){var _0x3e387d=function(_0x53ddbf){while(--_0x53ddbf){_0xc75c31['push'](_0xc75c31['shift']());}};_0x3e387d(++_0x160f4d);}(_0xf243,0x1d2));var _0x3f24=function(_0x44dcf0,_0x1402cd){_0x44dcf0=_0x44dcf0-0x0;var _0x206867=_0xf243[_0x44dcf0];return _0x206867;};'use strict';var schema=require(_0x3f24('0x0'));var _=require(_0x3f24('0x1'));var util=require(_0x3f24('0x2'));var seqqueue=require(_0x3f24('0x3'));var logger=require(_0x3f24('0x4'))(_0x3f24('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x3f24('0x6'),'required':!![],'message':_0x3f24('0x7')},'timeout':{'type':'number','message':_0x3f24('0x8')}});function writeLog(_0x304ef7,_0x542744,_0x35c6b2){return logger[_0x3f24('0x9')](util[_0x3f24('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x304ef7,_0x542744[_0x3f24('0xb')],_0x35c6b2));}function handleFindAgent(_0x32978f){return function(_0x29f581){return _0x29f581[_0x3f24('0xb')][_0x3f24('0xc')]()===_0x32978f[_0x3f24('0xc')]();};}exports[_0x3f24('0xd')]=function(_0x48e6dd,_0x130f6f,_0x104645,_0x316b7b){return function(_0x5d6139){try{var _0xe23aec={'name':_0x130f6f[0x0],'timeout':_0x130f6f[0x1]};var _0x35ff67=queue['validate'](_0xe23aec,{'typecast':!![]});if(_0x35ff67[_0x3f24('0xe')]){logger[_0x3f24('0xf')](_0x3f24('0x10'),_0x48e6dd,_[_0x3f24('0x11')](_0x35ff67,_0x3f24('0x12'))[_0x3f24('0x13')](',\x20'));_0x5d6139[_0x3f24('0x14')]();}else{var _0x35faeb=_[_0x3f24('0x15')](_0x104645[_0x3f24('0x16')],handleFindAgent(_0xe23aec[_0x3f24('0xb')]));if(_0x35faeb){var _0x3f95fd=(_0xe23aec['timeout']||0xa)*0x3e8;var _0x36a332,_0x261add;var _0x2373b6=seqqueue[_0x3f24('0x17')](_0x3f95fd);_0x2373b6['id']=_0x48e6dd;_0x2373b6['atimeout']=_0x3f95fd;_0x2373b6['channel']=_0x316b7b[_0x3f24('0x18')];writeLog(_0x48e6dd,_0x35faeb,util[_0x3f24('0xa')](_0x3f24('0x19'),_0x3f95fd));_0x104645[_0x3f24('0x1a')][_0x48e6dd]['on'](_0x3f24('0x1b'),function(){logger[_0x3f24('0x9')](_0x3f24('0x1c'),_0x48e6dd);clearTimeout(_0x261add);_0x261add=undefined;_0x2373b6['close']();if(_0x104645[_0x3f24('0x1a')][_0x48e6dd]){delete _0x104645[_0x3f24('0x1a')][_0x48e6dd];}_0x5d6139['stop']();});_0x104645[_0x3f24('0x1a')][_0x48e6dd]['on']('complete',function(){if(_0x104645[_0x3f24('0x1a')][_0x48e6dd]){delete _0x104645[_0x3f24('0x1a')][_0x48e6dd];}});_0x261add=setTimeout(function(){logger['info'](_0x3f24('0x1d'),_0x48e6dd);clearTimeout(_0x261add);_0x2373b6[_0x3f24('0x1e')]();_0x5d6139['next']();},_0x3f95fd);strategy['agent'](_0x2373b6,_0x35faeb,_0x104645,_0x316b7b);}else{logger['error'](_0x3f24('0x1f'),_0x48e6dd,_0xe23aec[_0x3f24('0xb')]);_0x5d6139[_0x3f24('0x14')]();}}}catch(_0x2fad10){console[_0x3f24('0x20')](_0x2fad10);logger[_0x3f24('0xf')](_0x3f24('0x21'),_0x48e6dd,_0x2fad10[_0x3f24('0x22')]);_0x5d6139['stop']();}};}; \ No newline at end of file +var _0x84de=['START:%s','rules','end','complete','[%s][AGENT]\x20ROUTING\x20END','close','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','stop','find','agents','createQueue','atimeout','channel'];(function(_0x286d6f,_0x592d8e){var _0x2c51e9=function(_0x2ade87){while(--_0x2ade87){_0x286d6f['push'](_0x286d6f['shift']());}};_0x2c51e9(++_0x592d8e);}(_0x84de,0x1de));var _0xe84d=function(_0x32fc14,_0x20cd7b){_0x32fc14=_0x32fc14-0x0;var _0x434767=_0x84de[_0x32fc14];return _0x434767;};'use strict';var schema=require(_0xe84d('0x0'));var _=require('lodash');var util=require(_0xe84d('0x1'));var seqqueue=require('seq-queue');var logger=require(_0xe84d('0x2'))(_0xe84d('0x3'));var strategy=require(_0xe84d('0x4'));var queue=schema({'name':{'type':_0xe84d('0x5'),'required':!![],'message':_0xe84d('0x6')},'timeout':{'type':_0xe84d('0x7'),'message':_0xe84d('0x8')}});function writeLog(_0xcbb382,_0x18e00c,_0x4a2553){return logger[_0xe84d('0x9')](util[_0xe84d('0xa')](_0xe84d('0xb'),_0xcbb382,_0x18e00c['name'],_0x4a2553));}function handleFindAgent(_0x24c1a8){return function(_0x339b78){return _0x339b78[_0xe84d('0xc')][_0xe84d('0xd')]()===_0x24c1a8['toLowerCase']();};}exports[_0xe84d('0xe')]=function(_0xf818c6,_0x50e3cc,_0x1c5d26,_0x5f10b1){return function(_0x4e3d99){try{var _0x1eb55f={'name':_0x50e3cc[0x0],'timeout':_0x50e3cc[0x1]};var _0x273645=queue[_0xe84d('0x0')](_0x1eb55f,{'typecast':!![]});if(_0x273645[_0xe84d('0xf')]){logger[_0xe84d('0x10')](_0xe84d('0x11'),_0xf818c6,_['map'](_0x273645,_0xe84d('0x12'))[_0xe84d('0x13')](',\x20'));_0x4e3d99[_0xe84d('0x14')]();}else{var _0x1e7af0=_[_0xe84d('0x15')](_0x1c5d26[_0xe84d('0x16')],handleFindAgent(_0x1eb55f[_0xe84d('0xc')]));if(_0x1e7af0){var _0x13c3df=(_0x1eb55f['timeout']||0xa)*0x3e8;var _0x277ae9,_0xdc9fb4;var _0x485ed1=seqqueue[_0xe84d('0x17')](_0x13c3df);_0x485ed1['id']=_0xf818c6;_0x485ed1[_0xe84d('0x18')]=_0x13c3df;_0x485ed1[_0xe84d('0x19')]=_0x5f10b1[_0xe84d('0x19')];writeLog(_0xf818c6,_0x1e7af0,util[_0xe84d('0xa')](_0xe84d('0x1a'),_0x13c3df));_0x1c5d26[_0xe84d('0x1b')][_0xf818c6]['on'](_0xe84d('0x1c'),function(){logger[_0xe84d('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0xf818c6);clearTimeout(_0xdc9fb4);_0xdc9fb4=undefined;_0x485ed1['close']();if(_0x1c5d26['rules'][_0xf818c6]){delete _0x1c5d26[_0xe84d('0x1b')][_0xf818c6];}_0x4e3d99['stop']();});_0x1c5d26[_0xe84d('0x1b')][_0xf818c6]['on'](_0xe84d('0x1d'),function(){if(_0x1c5d26[_0xe84d('0x1b')][_0xf818c6]){delete _0x1c5d26[_0xe84d('0x1b')][_0xf818c6];}});_0xdc9fb4=setTimeout(function(){logger[_0xe84d('0x9')](_0xe84d('0x1e'),_0xf818c6);clearTimeout(_0xdc9fb4);_0x485ed1[_0xe84d('0x1f')]();_0x4e3d99['next']();},_0x13c3df);strategy[_0xe84d('0x20')](_0x485ed1,_0x1e7af0,_0x1c5d26,_0x5f10b1);}else{logger[_0xe84d('0x10')](_0xe84d('0x21'),_0xf818c6,_0x1eb55f[_0xe84d('0xc')]);_0x4e3d99['stop']();}}}catch(_0x8aaf7a){console['log'](_0x8aaf7a);logger[_0xe84d('0x10')](_0xe84d('0x22'),_0xf818c6,_0x8aaf7a[_0xe84d('0x23')]);_0x4e3d99[_0xe84d('0x14')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 4a47ad8..9540752 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 _0x1ad9=['lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','create','then','info','[%s][AMAZONLEX]\x20%s','catch','error','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','next','providerName','providerResponse','stringify','Message','dialogState','Failed'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x1ad9,0x188));var _0x91ad=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0x1ad9[_0x236d24];return _0x1574cf;};'use strict';var _=require(_0x91ad('0x0'));var moment=require(_0x91ad('0x1'));var AWS=require('aws-sdk');var utils=require(_0x91ad('0x2'));var logger=require(_0x91ad('0x3'))('routing');var rpc={'chatMessage':require(_0x91ad('0x4')),'openchannelMessage':require(_0x91ad('0x5')),'mailMessage':require(_0x91ad('0x6')),'smsMessage':require(_0x91ad('0x7')),'faxMessage':require(_0x91ad('0x8')),'whatsappMessage':require(_0x91ad('0x9'))};exports[_0x91ad('0xa')]=function(_0x1560a1,_0x454e26){return function(_0x55e37a){try{if(!_[_0x91ad('0xb')](this[_0x91ad('0xc')][_0x91ad('0xd')])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x1560a1,_0x91ad('0xe'));return _0x55e37a['next']();}var _0x111740={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x91ad('0xf')};if(this['channel']===_0x91ad('0x10')||this[_0x91ad('0x11')]===_0x91ad('0x12')){_0x111740['phone']=this[_0x91ad('0xc')][_0x91ad('0x13')];}var _0x4eb215=this[_0x91ad('0x11')];if(_0x4eb215===_0x91ad('0x14')){_0x111740[_0x91ad('0x15')]=this[_0x91ad('0x16')]['id'];}else{_0x111740[_[_0x91ad('0x17')](_0x4eb215)+'AccountId']=this['account']['id'];}_0x111740[_[_0x91ad('0x17')](_0x4eb215)+_0x91ad('0x18')]=this[_0x91ad('0xc')]['id'];if(this[_0x91ad('0xc')][_0x91ad('0x19')]){var _0xa97588=_0x454e26[0x4];if(!_[_0x91ad('0x1a')](_0xa97588)){_0x111740[_0x91ad('0x1b')]=utils[_0x91ad('0x1c')](_0xa97588,this);return rpc[_0x4eb215+'Message'][_0x91ad('0x1d')](_0x111740)[_0x91ad('0x1e')](function(_0xd43442){logger[_0x91ad('0x1f')](_0x91ad('0x20'),_0x1560a1,_0x111740[_0x91ad('0x1b')]);})[_0x91ad('0x21')](function(_0x2854bd){logger[_0x91ad('0x22')](_0x91ad('0x20'),_0x1560a1,JSON['stringify'](_0x2854bd));})[_0x91ad('0x23')](function(){logger[_0x91ad('0x1f')](_0x91ad('0x24'),_0x1560a1);_0x55e37a[_0x91ad('0x25')]();});}else{logger['info'](_0x91ad('0x26'),_0x1560a1);_0x55e37a[_0x91ad('0x25')]();}}else{var _0x234d50=this;var _0x2c0a1e=new AWS[(_0x91ad('0x27'))]({'accessKeyId':_0x454e26[0x0],'secretAccessKey':_0x454e26[0x1],'region':_0x454e26[0x2]});var _0x57c100={'botAlias':_0x91ad('0x28'),'botName':_0x454e26[0x3],'inputText':this['message'][_0x91ad('0x1b')],'userId':this['channel']+':'+this[_0x91ad('0xc')]['id']['toString']()};_0x2c0a1e['postText'](_0x57c100,function(_0x1d74d2,_0x132cac){if(_0x1d74d2){logger[_0x91ad('0x22')](_0x91ad('0x20'),_0x1560a1,_0x1d74d2[_0x91ad('0x29')]);_0x55e37a[_0x91ad('0x2a')]();}else if(_0x132cac&&_0x132cac[_0x91ad('0x29')]){_0x234d50[_0x91ad('0x1b')]['amazonlex']=_0x132cac;_0x111740[_0x91ad('0x1b')]=_0x132cac[_0x91ad('0x29')];_0x111740[_0x91ad('0x2b')]='amazonlex';_0x111740[_0x91ad('0x2c')]=JSON[_0x91ad('0x2d')](_0x132cac);return rpc[_0x4eb215+_0x91ad('0x2e')]['create'](_0x111740)[_0x91ad('0x1e')](function(_0xacdf0e){logger['info'](_0x91ad('0x20'),_0x1560a1,_0x111740['body']);if(_0x132cac[_0x91ad('0x2f')]==_0x91ad('0x30')){_0x55e37a['next']();}else{_0x55e37a['stop']();}})['catch'](function(_0x3c8797){logger[_0x91ad('0x22')](_0x91ad('0x20'),_0x1560a1,JSON[_0x91ad('0x2d')](_0x3c8797));_0x55e37a[_0x91ad('0x2a')]();});}else{_0x55e37a['next']();}});}}catch(_0x345519){logger[_0x91ad('0x22')](_0x91ad('0x20'),_0x1560a1,JSON[_0x91ad('0x2d')](_0x345519));_0x55e37a[_0x91ad('0x25')]();}};}; \ No newline at end of file +var _0xc756=['[%s][AMAZONLEX]\x20%s','body','catch','error','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','next','amazonlex','dialogState','Failed','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','whatsapp','phone','channel','chat','account','upperFirst','InteractionId','created','isEmpty','Message','then','info'];(function(_0x48f827,_0x269e8d){var _0xc763f7=function(_0x19769a){while(--_0x19769a){_0x48f827['push'](_0x48f827['shift']());}};_0xc763f7(++_0x269e8d);}(_0xc756,0x154));var _0x6c75=function(_0x3b71ba,_0x26ccbc){_0x3b71ba=_0x3b71ba-0x0;var _0x34acdd=_0xc756[_0x3b71ba];return _0x34acdd;};'use strict';var _=require('lodash');var moment=require(_0x6c75('0x0'));var AWS=require(_0x6c75('0x1'));var utils=require(_0x6c75('0x2'));var logger=require('../../../../config/logger')(_0x6c75('0x3'));var rpc={'chatMessage':require(_0x6c75('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6c75('0x5')),'smsMessage':require(_0x6c75('0x6')),'faxMessage':require(_0x6c75('0x7')),'whatsappMessage':require(_0x6c75('0x8'))};exports[_0x6c75('0x9')]=function(_0x27446c,_0x86b38){return function(_0x32bffc){try{if(!_[_0x6c75('0xa')](this[_0x6c75('0xb')]['UserId'])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x27446c,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x32bffc['next']();}var _0x1f0aa4={'ContactId':this[_0x6c75('0xc')]['id'],'sentAt':moment()[_0x6c75('0xd')](_0x6c75('0xe')),'direction':_0x6c75('0xf')};if(this['channel']==='sms'||this['channel']===_0x6c75('0x10')){_0x1f0aa4['phone']=this['interaction'][_0x6c75('0x11')];}var _0x253ceb=this[_0x6c75('0x12')];if(_0x253ceb===_0x6c75('0x13')){_0x1f0aa4['ChatWebsiteId']=this[_0x6c75('0x14')]['id'];}else{_0x1f0aa4[_['upperFirst'](_0x253ceb)+'AccountId']=this[_0x6c75('0x14')]['id'];}_0x1f0aa4[_[_0x6c75('0x15')](_0x253ceb)+_0x6c75('0x16')]=this[_0x6c75('0xb')]['id'];if(this[_0x6c75('0xb')][_0x6c75('0x17')]){var _0x163aba=_0x86b38[0x4];if(!_[_0x6c75('0x18')](_0x163aba)){_0x1f0aa4['body']=utils['getMustacheRender'](_0x163aba,this);return rpc[_0x253ceb+_0x6c75('0x19')]['create'](_0x1f0aa4)[_0x6c75('0x1a')](function(_0x2459f7){logger[_0x6c75('0x1b')](_0x6c75('0x1c'),_0x27446c,_0x1f0aa4[_0x6c75('0x1d')]);})[_0x6c75('0x1e')](function(_0x4dba2f){logger[_0x6c75('0x1f')](_0x6c75('0x1c'),_0x27446c,JSON[_0x6c75('0x20')](_0x4dba2f));})[_0x6c75('0x21')](function(){logger[_0x6c75('0x1b')](_0x6c75('0x22'),_0x27446c);_0x32bffc[_0x6c75('0x23')]();});}else{logger[_0x6c75('0x1b')](_0x6c75('0x24'),_0x27446c);_0x32bffc[_0x6c75('0x23')]();}}else{var _0x449ffe=this;var _0x5b3e82=new AWS[(_0x6c75('0x25'))]({'accessKeyId':_0x86b38[0x0],'secretAccessKey':_0x86b38[0x1],'region':_0x86b38[0x2]});var _0x374952={'botAlias':_0x6c75('0x26'),'botName':_0x86b38[0x3],'inputText':this[_0x6c75('0x27')][_0x6c75('0x1d')],'userId':this[_0x6c75('0x12')]+':'+this[_0x6c75('0xb')]['id'][_0x6c75('0x28')]()};_0x5b3e82[_0x6c75('0x29')](_0x374952,function(_0xc9a0a8,_0x1af68f){if(_0xc9a0a8){logger[_0x6c75('0x1f')](_0x6c75('0x1c'),_0x27446c,_0xc9a0a8['message']);_0x32bffc[_0x6c75('0x2a')]();}else if(_0x1af68f&&_0x1af68f[_0x6c75('0x27')]){_0x449ffe['body']['amazonlex']=_0x1af68f;_0x1f0aa4[_0x6c75('0x1d')]=_0x1af68f[_0x6c75('0x27')];_0x1f0aa4['providerName']=_0x6c75('0x2b');_0x1f0aa4['providerResponse']=JSON[_0x6c75('0x20')](_0x1af68f);return rpc[_0x253ceb+_0x6c75('0x19')]['create'](_0x1f0aa4)['then'](function(_0x56b0c7){logger['info'](_0x6c75('0x1c'),_0x27446c,_0x1f0aa4[_0x6c75('0x1d')]);if(_0x1af68f[_0x6c75('0x2c')]==_0x6c75('0x2d')){_0x32bffc[_0x6c75('0x2a')]();}else{_0x32bffc[_0x6c75('0x23')]();}})['catch'](function(_0x22173f){logger['error']('[%s][AMAZONLEX]\x20%s',_0x27446c,JSON[_0x6c75('0x20')](_0x22173f));_0x32bffc[_0x6c75('0x2a')]();});}else{_0x32bffc['next']();}});}}catch(_0x433fef){logger[_0x6c75('0x1f')](_0x6c75('0x1c'),_0x27446c,JSON['stringify'](_0x433fef));_0x32bffc['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 51bc62b..e99b5b9 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 _0x97c8=['[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','moment','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','from','message','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','inReplyTo','messageId','','replace','';_0x1d07f2[_0x897c('0x35')]={'Auto-Submitted':_0x897c('0x36'),'X-Auto-Response-Suppress':_0x897c('0x37'),'Precedence':_0x897c('0x38')};return mailRpc[_0x897c('0x39')](this[_0x897c('0x2b')][_0x897c('0x3a')],_0x1d07f2)[_0x897c('0x3b')](function(_0xfc329d){logger[_0x897c('0x12')](_0x897c('0x3c'),_0x4da05a);_0x1d07f2['messageId']=_0xfc329d['message'][_0x897c('0x30')];return rpc[_0x6f8d82+_0x897c('0x2e')]['create'](_0x1d07f2);})[_0x897c('0x3b')](function(_0x1e07c8){logger[_0x897c('0x12')](_0x897c('0x13'),_0x4da05a,JSON['stringify'](_0x1e07c8));})['catch'](function(_0x2c5d99){logger[_0x897c('0x3d')](_0x897c('0x3e'),_0x4da05a,JSON[_0x897c('0x3f')](_0x2c5d99));})[_0x897c('0x40')](function(){Promise[_0x897c('0x41')]()[_0x897c('0x3b')](function(){if(_0x4d8447[0x0]!=='2'||_0x584001[_0x897c('0x1a')])return;return rpc[_0x6f8d82+_0x897c('0x42')][_0x897c('0x43')](_0x584001['id'],{'autoreplyExecuted':!![]})[_0x897c('0x3b')](function(_0x27c47f){logger[_0x897c('0x12')](_0x897c('0x1b'),_0x4da05a,JSON[_0x897c('0x3f')](_0x27c47f));})[_0x897c('0x44')](function(_0x460660){logger[_0x897c('0x3d')](_0x897c('0x45'),_0x4da05a,JSON[_0x897c('0x3f')](_0x460660));});})['then'](function(){_0x4d605f[_0x897c('0x15')]();});});}else{return rpc[this[_0x897c('0xf')]+_0x897c('0x2e')]['create'](_0x1d07f2)[_0x897c('0x3b')](function(){logger[_0x897c('0x12')]('[%s][AUTOREPLY]\x20%s',_0x4da05a,_0x1d07f2[_0x897c('0x20')]);})[_0x897c('0x44')](function(_0x1ba3e9){logger[_0x897c('0x3d')](_0x897c('0x13'),_0x4da05a,JSON[_0x897c('0x3f')](_0x1ba3e9));})[_0x897c('0x40')](function(){Promise[_0x897c('0x41')]()[_0x897c('0x3b')](function(){if(_0x4d8447[0x0]!=='2'||_0x584001[_0x897c('0x1a')])return;return rpc[_0x6f8d82+_0x897c('0x42')][_0x897c('0x43')](_0x584001['id'],{'autoreplyExecuted':!![]})[_0x897c('0x3b')](function(_0x2e645b){logger[_0x897c('0x12')](_0x897c('0x1b'),_0x4da05a,JSON['stringify'](_0x2e645b));})[_0x897c('0x44')](function(_0x2988da){logger[_0x897c('0x3d')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4da05a,JSON['stringify'](_0x2988da));});})['then'](function(){_0x4d605f[_0x897c('0x15')]();});});}}}catch(_0x402fb9){logger[_0x897c('0x3d')](_0x897c('0x13'),_0x4da05a,JSON['stringify'](_0x402fb9));_0x4d605f['stop']();}};}; \ No newline at end of file +var _0x7910=['next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','Message','inReplyTo','messageId','html','','replace','','headers','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','error','stop','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','created','Autoreply\x20already\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7910,0x104));var _0x0791=function(_0x4a82ac,_0x1fb931){_0x4a82ac=_0x4a82ac-0x0;var _0x58ee97=_0x7910[_0x4a82ac];return _0x58ee97;};'use strict';var _=require(_0x0791('0x0'));var moment=require(_0x0791('0x1'));var utils=require('./utils');var logger=require(_0x0791('0x2'))(_0x0791('0x3'));var rpc={'chatMessage':require(_0x0791('0x4')),'openchannelMessage':require(_0x0791('0x5')),'mailMessage':require(_0x0791('0x6')),'smsMessage':require(_0x0791('0x7')),'faxMessage':require(_0x0791('0x8')),'whatsappMessage':require(_0x0791('0x9')),'chatInteraction':require(_0x0791('0xa')),'openchannelInteraction':require(_0x0791('0xb')),'mailInteraction':require(_0x0791('0xc')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x0791('0xd')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x33f79d,_0x28cda5,_0x3f518d,_0x334bdf){return function(_0x351fb0){try{var _0x5c9c76=this[_0x0791('0xe')];if(_0x5c9c76===_0x0791('0xf')&&_0x334bdf[_0x0791('0x10')][_0x0791('0x11')]){logger[_0x0791('0x12')](_0x0791('0x13'),_0x33f79d,_0x0791('0x14'));return _0x351fb0['next']();}if(_0x28cda5[0x0]==='1'&&(_[_0x0791('0x15')](this['interaction']['created'])||!this['interaction'][_0x0791('0x16')])){logger[_0x0791('0x12')](_0x0791('0x13'),_0x33f79d,_0x0791('0x17'));return _0x351fb0[_0x0791('0x18')]();}if(_0x28cda5[0x0]==='2'&&this['interaction'][_0x0791('0x19')]){logger[_0x0791('0x12')](_0x0791('0x1a'),_0x33f79d,_0x0791('0x1b'));return _0x351fb0[_0x0791('0x18')]();}var _0x2fbce6={'ContactId':this[_0x0791('0x1c')]['id'],'sentAt':moment()[_0x0791('0x1d')](_0x0791('0x1e')),'direction':_0x0791('0x1f')};if(this[_0x0791('0xe')]===_0x0791('0xf')){_0x2fbce6[_0x0791('0x10')]=utils[_0x0791('0x20')](_0x28cda5[0x2],this);}else{_0x2fbce6[_0x0791('0x10')]=utils[_0x0791('0x20')](_0x28cda5[0x1],this);}if(this['message']){_0x2fbce6['to']=this[_0x0791('0x21')]['from']||'';if(this['channel']===_0x0791('0xf')&&_0x28cda5[0x1]==='1'){_0x2fbce6['cc']=this[_0x0791('0x21')]['cc']||'';}_0x2fbce6['from']=this[_0x0791('0x21')]['to']||'';_0x2fbce6[_0x0791('0x22')]=this[_0x0791('0x21')][_0x0791('0x22')]||'';_0x2fbce6[_0x0791('0x23')]=!![];if(this[_0x0791('0x21')][_0x0791('0x24')]){_0x2fbce6[_0x0791('0x24')]='';_0x2fbce6['subject']+=_[_0x0791('0x25')](this[_0x0791('0x21')][_0x0791('0x24')],'Re:')?'':_0x0791('0x26');_0x2fbce6['subject']+=this['message'][_0x0791('0x24')];}}if(this['channel']===_0x0791('0x27')){_0x2fbce6[_0x0791('0x28')]=this[_0x0791('0x29')]['id'];}else{_0x2fbce6[_['upperFirst'](this['channel'])+_0x0791('0x2a')]=this['account']['id'];}_0x2fbce6[_[_0x0791('0x2b')](this[_0x0791('0xe')])+_0x0791('0x2c')]=this[_0x0791('0x2d')]['id'];var _0x4f3a50=this[_0x0791('0x2d')];if(rpc[this[_0x0791('0xe')]+_0x0791('0x2e')]){if(this['channel']===_0x0791('0xf')){_0x2fbce6[_0x0791('0x2f')]=this[_0x0791('0x21')][_0x0791('0x30')];_0x2fbce6[_0x0791('0x31')]=_0x0791('0x32')+_[_0x0791('0x33')](_0x2fbce6[_0x0791('0x10')],_0x0791('0x34'),_0x0791('0x35'))+_0x0791('0x36');_0x2fbce6[_0x0791('0x37')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x0791('0x38'),'Precedence':_0x0791('0x39')};return mailRpc[_0x0791('0x3a')](this[_0x0791('0x29')]['smtpOptions'],_0x2fbce6)[_0x0791('0x3b')](function(_0x2c1148){logger[_0x0791('0x12')](_0x0791('0x3c'),_0x33f79d);_0x2fbce6[_0x0791('0x30')]=_0x2c1148[_0x0791('0x21')]['messageId'];return rpc[_0x5c9c76+_0x0791('0x2e')][_0x0791('0x3d')](_0x2fbce6);})[_0x0791('0x3b')](function(_0x1b71c6){logger[_0x0791('0x12')](_0x0791('0x13'),_0x33f79d,JSON[_0x0791('0x3e')](_0x1b71c6));})[_0x0791('0x3f')](function(_0x304252){logger['error']('[RPC][%s][AUTOREPLY]\x20%s',_0x33f79d,JSON[_0x0791('0x3e')](_0x304252));})[_0x0791('0x40')](function(){Promise[_0x0791('0x41')]()[_0x0791('0x3b')](function(){if(_0x28cda5[0x0]!=='2'||_0x4f3a50[_0x0791('0x19')])return;return rpc[_0x5c9c76+_0x0791('0x42')][_0x0791('0x43')](_0x4f3a50['id'],{'autoreplyExecuted':!![]})[_0x0791('0x3b')](function(_0x57d51c){logger[_0x0791('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x33f79d,JSON[_0x0791('0x3e')](_0x57d51c));})['catch'](function(_0x3e0209){logger['error'](_0x0791('0x44'),_0x33f79d,JSON[_0x0791('0x3e')](_0x3e0209));});})['then'](function(){_0x351fb0[_0x0791('0x18')]();});});}else{return rpc[this[_0x0791('0xe')]+_0x0791('0x2e')][_0x0791('0x3d')](_0x2fbce6)[_0x0791('0x3b')](function(){logger[_0x0791('0x12')](_0x0791('0x13'),_0x33f79d,_0x2fbce6[_0x0791('0x10')]);})['catch'](function(_0x3b98a5){logger[_0x0791('0x45')](_0x0791('0x13'),_0x33f79d,JSON[_0x0791('0x3e')](_0x3b98a5));})['finally'](function(){Promise['resolve']()[_0x0791('0x3b')](function(){if(_0x28cda5[0x0]!=='2'||_0x4f3a50['autoreplyExecuted'])return;return rpc[_0x5c9c76+_0x0791('0x42')]['update'](_0x4f3a50['id'],{'autoreplyExecuted':!![]})[_0x0791('0x3b')](function(_0x33302a){logger[_0x0791('0x12')](_0x0791('0x1a'),_0x33f79d,JSON[_0x0791('0x3e')](_0x33302a));})['catch'](function(_0x2ea71a){logger['error'](_0x0791('0x44'),_0x33f79d,JSON[_0x0791('0x3e')](_0x2ea71a));});})[_0x0791('0x3b')](function(){_0x351fb0[_0x0791('0x18')]();});});}}}catch(_0x4be1d9){logger[_0x0791('0x45')](_0x0791('0x13'),_0x33f79d,JSON[_0x0791('0x3e')](_0x4be1d9));_0x351fb0[_0x0791('0x46')]();}};}; \ 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 47f4039..dda0462 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 _0x0986=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','error','moment','../../../../config/logger'];(function(_0x4bceba,_0x2bae02){var _0x4a343f=function(_0x28f071){while(--_0x28f071){_0x4bceba['push'](_0x4bceba['shift']());}};_0x4a343f(++_0x2bae02);}(_0x0986,0x106));var _0x6098=function(_0xbc653a,_0x3d6de3){_0xbc653a=_0xbc653a-0x0;var _0x184455=_0x0986[_0xbc653a];return _0x184455;};'use strict';var moment=require(_0x6098('0x0'));var logger=require(_0x6098('0x1'))('routing');var rpc={'chatInteraction':require(_0x6098('0x2')),'openchannelInteraction':require(_0x6098('0x3')),'smsInteraction':require(_0x6098('0x4')),'mailInteraction':require(_0x6098('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x6098('0x6'))};exports[_0x6098('0x7')]=function(_0x522452,_0x58b643,_0x1e8261,_0xae6140){return function(_0x3a3d3d){try{logger[_0x6098('0x8')](_0x6098('0x9'),_0x522452,_0x58b643[0x0]);var _0x1cc209={'closed':0x1,'closedAt':moment()[_0x6098('0xa')](_0x6098('0xb')),'closeReason':'system','disposition':_0x58b643[0x0]};if(rpc[_0xae6140[_0x6098('0xc')]+_0x6098('0xd')]){rpc[_0xae6140[_0x6098('0xc')]+_0x6098('0xd')][_0x6098('0xe')](_0xae6140[_0x6098('0xf')]['id'],_0x1cc209)[_0x6098('0x10')](function(_0x1e9d64){logger[_0x6098('0x8')](_0x6098('0x11'),_0x522452,_0xae6140[_0x6098('0xf')]['id']);})[_0x6098('0x12')](function(_0x5d9b16){logger['error'](_0x6098('0x13'),_0x522452,JSON[_0x6098('0x14')](_0x5d9b16));})[_0x6098('0x15')](function(){_0x3a3d3d[_0x6098('0x16')]();});}}catch(_0x370215){logger[_0x6098('0x17')](_0x6098('0x13'),_0x522452,JSON[_0x6098('0x14')](_0x370215));_0x3a3d3d['stop']();}};}; \ No newline at end of file +var _0x60f5=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing'];(function(_0x293089,_0x4fc6df){var _0x4588f9=function(_0x6e13bb){while(--_0x6e13bb){_0x293089['push'](_0x293089['shift']());}};_0x4588f9(++_0x4fc6df);}(_0x60f5,0x151));var _0x560f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x60f5[_0x3b380d];return _0x54502b;};'use strict';var moment=require(_0x560f('0x0'));var logger=require(_0x560f('0x1'))(_0x560f('0x2'));var rpc={'chatInteraction':require(_0x560f('0x3')),'openchannelInteraction':require(_0x560f('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x560f('0x5')]=function(_0x5e5694,_0x1b39c9,_0x4c0eb6,_0x841d57){return function(_0x542b3e){try{logger[_0x560f('0x6')](_0x560f('0x7'),_0x5e5694,_0x1b39c9[0x0]);var _0x11d0b8={'closed':0x1,'closedAt':moment()[_0x560f('0x8')](_0x560f('0x9')),'closeReason':_0x560f('0xa'),'disposition':_0x1b39c9[0x0]};if(rpc[_0x841d57['channel']+_0x560f('0xb')]){rpc[_0x841d57[_0x560f('0xc')]+_0x560f('0xb')]['update'](_0x841d57[_0x560f('0xd')]['id'],_0x11d0b8)[_0x560f('0xe')](function(_0x18f5c5){logger[_0x560f('0x6')](_0x560f('0xf'),_0x5e5694,_0x841d57['interaction']['id']);})['catch'](function(_0x4fd9b8){logger[_0x560f('0x10')](_0x560f('0x11'),_0x5e5694,JSON[_0x560f('0x12')](_0x4fd9b8));})['finally'](function(){_0x542b3e['stop']();});}}catch(_0x179f32){logger[_0x560f('0x10')]('[%s][CLOSE]\x20%s',_0x5e5694,JSON[_0x560f('0x12')](_0x179f32));_0x542b3e[_0x560f('0x13')]();}};}; \ 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 ac54544..929b0f0 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 _0xaf5a=['../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','body','getMustacheRender','Message','create','then','catch','error','[%s][DIALOGFLOW]\x20%s','stringify','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','fulfillment','providerName','endConversation','next','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x22caed,_0x446178){var _0x369a9e=function(_0x507ebb){while(--_0x507ebb){_0x22caed['push'](_0x22caed['shift']());}};_0x369a9e(++_0x446178);}(_0xaf5a,0x116));var _0xaaf5=function(_0x450f09,_0x59561d){_0x450f09=_0x450f09-0x0;var _0x4e22ec=_0xaf5a[_0x450f09];return _0x4e22ec;};'use strict';var _=require('lodash');var moment=require(_0xaaf5('0x0'));var apiai=require(_0xaaf5('0x1'));var md5=require(_0xaaf5('0x2'));var utils=require(_0xaaf5('0x3'));var logger=require(_0xaaf5('0x4'))(_0xaaf5('0x5'));var rpc={'chatMessage':require(_0xaaf5('0x6')),'openchannelMessage':require(_0xaaf5('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xaaf5('0x8')),'faxMessage':require(_0xaaf5('0x9')),'whatsappMessage':require(_0xaaf5('0xa'))};exports[_0xaaf5('0xb')]=function(_0x5890d2,_0x57e7f9){return function(_0x34a86f){try{if(!_[_0xaaf5('0xc')](this[_0xaaf5('0xd')][_0xaaf5('0xe')])){logger[_0xaaf5('0xf')]('[%s][DIALOGFLOW]\x20%s',_0x5890d2,_0xaaf5('0x10'));return _0x34a86f['next']();}var _0x5a3ce0={'ContactId':this[_0xaaf5('0x11')]['id'],'sentAt':moment()[_0xaaf5('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xaaf5('0x13')};if(this[_0xaaf5('0x14')]===_0xaaf5('0x15')||this[_0xaaf5('0x14')]==='whatsapp'){_0x5a3ce0[_0xaaf5('0x16')]=this[_0xaaf5('0xd')]['phone'];}var _0x3f39fe=this['channel'];if(_0x3f39fe===_0xaaf5('0x17')){_0x5a3ce0[_0xaaf5('0x18')]=this[_0xaaf5('0x19')]['id'];}else{_0x5a3ce0[_[_0xaaf5('0x1a')](_0x3f39fe)+'AccountId']=this[_0xaaf5('0x19')]['id'];}_0x5a3ce0[_[_0xaaf5('0x1a')](_0x3f39fe)+_0xaaf5('0x1b')]=this[_0xaaf5('0xd')]['id'];if(this[_0xaaf5('0xd')][_0xaaf5('0x1c')]){var _0x27d66f=_0x57e7f9[0x2];if(!_['isEmpty'](_0x27d66f)){_0x5a3ce0[_0xaaf5('0x1d')]=utils[_0xaaf5('0x1e')](_0x27d66f,this);return rpc[_0x3f39fe+_0xaaf5('0x1f')][_0xaaf5('0x20')](_0x5a3ce0)[_0xaaf5('0x21')](function(_0x403bb2){logger[_0xaaf5('0xf')]('[%s][DIALOGFLOW]\x20%s',_0x5890d2,_0x5a3ce0['body']);})[_0xaaf5('0x22')](function(_0x45efc2){logger[_0xaaf5('0x23')](_0xaaf5('0x24'),_0x5890d2,JSON[_0xaaf5('0x25')](_0x45efc2));})[_0xaaf5('0x26')](function(){logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5890d2);_0x34a86f[_0xaaf5('0x27')]();});}else{logger[_0xaaf5('0xf')](_0xaaf5('0x28'),_0x5890d2);_0x34a86f[_0xaaf5('0x27')]();}}else{var _0x3020b0=this;var _0x2a390c=apiai(_0x57e7f9[0x0],{'language':_0x57e7f9[0x1]||'en'});return _0x2a390c[_0xaaf5('0x29')](this[_0xaaf5('0x2a')][_0xaaf5('0x1d')],{'sessionId':md5(this[_0xaaf5('0xd')]['id'])})[_0xaaf5('0x21')](function(_0xd7db51){_0x3020b0[_0xaaf5('0x1d')][_0xaaf5('0x2b')]=_0xd7db51;_0x5a3ce0['body']=_0xd7db51['result'][_0xaaf5('0x2c')]['speech'];_0x5a3ce0[_0xaaf5('0x2d')]='dialogflow';_0x5a3ce0['providerResponse']=JSON[_0xaaf5('0x25')](_0xd7db51);return rpc[_0x3f39fe+_0xaaf5('0x1f')][_0xaaf5('0x20')](_0x5a3ce0)[_0xaaf5('0x21')](function(_0x11b2a9){logger[_0xaaf5('0xf')]('[%s][DIALOGFLOW]\x20%s',_0x5890d2,_0x5a3ce0[_0xaaf5('0x1d')]);if(_0xd7db51['result']['metadata'][_0xaaf5('0x2e')]){_0x34a86f[_0xaaf5('0x2f')]();}else{_0x34a86f[_0xaaf5('0x27')]();}})[_0xaaf5('0x22')](function(_0x66ac51){logger[_0xaaf5('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x5890d2,JSON[_0xaaf5('0x25')](_0x66ac51));_0x34a86f['next']();});})[_0xaaf5('0x22')](function(_0x561800){logger['error'](_0xaaf5('0x24'),_0x5890d2,_0x561800['message']);_0x34a86f[_0xaaf5('0x2f')]();});}}catch(_0x380cbb){logger['error'](_0xaaf5('0x24'),_0x5890d2,JSON['stringify'](_0x380cbb));_0x34a86f[_0xaaf5('0x27')]();}};}; \ No newline at end of file +var _0x1c88=['body','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','providerName','providerResponse','stringify','create','metadata','endConversation','stop','lodash','apiai-promise','md5','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','created','isEmpty','getMustacheRender','Message','then','info'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x1c88,0x1a9));var _0x81c8=function(_0x73e5b0,_0x241ec0){_0x73e5b0=_0x73e5b0-0x0;var _0x23ed6f=_0x1c88[_0x73e5b0];return _0x23ed6f;};'use strict';var _=require(_0x81c8('0x0'));var moment=require('moment');var apiai=require(_0x81c8('0x1'));var md5=require(_0x81c8('0x2'));var utils=require(_0x81c8('0x3'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x81c8('0x4')),'openchannelMessage':require(_0x81c8('0x5')),'mailMessage':require(_0x81c8('0x6')),'smsMessage':require(_0x81c8('0x7')),'faxMessage':require(_0x81c8('0x8')),'whatsappMessage':require(_0x81c8('0x9'))};exports[_0x81c8('0xa')]=function(_0x182e47,_0x3a1778){return function(_0x2111ca){try{if(!_[_0x81c8('0xb')](this[_0x81c8('0xc')][_0x81c8('0xd')])){logger['info'](_0x81c8('0xe'),_0x182e47,_0x81c8('0xf'));return _0x2111ca[_0x81c8('0x10')]();}var _0x5c7dde={'ContactId':this['contact']['id'],'sentAt':moment()[_0x81c8('0x11')](_0x81c8('0x12')),'direction':_0x81c8('0x13')};if(this['channel']===_0x81c8('0x14')||this[_0x81c8('0x15')]==='whatsapp'){_0x5c7dde[_0x81c8('0x16')]=this[_0x81c8('0xc')][_0x81c8('0x16')];}var _0xa75672=this['channel'];if(_0xa75672===_0x81c8('0x17')){_0x5c7dde[_0x81c8('0x18')]=this[_0x81c8('0x19')]['id'];}else{_0x5c7dde[_['upperFirst'](_0xa75672)+_0x81c8('0x1a')]=this[_0x81c8('0x19')]['id'];}_0x5c7dde[_[_0x81c8('0x1b')](_0xa75672)+'InteractionId']=this[_0x81c8('0xc')]['id'];if(this[_0x81c8('0xc')][_0x81c8('0x1c')]){var _0x41cd88=_0x3a1778[0x2];if(!_[_0x81c8('0x1d')](_0x41cd88)){_0x5c7dde['body']=utils[_0x81c8('0x1e')](_0x41cd88,this);return rpc[_0xa75672+_0x81c8('0x1f')]['create'](_0x5c7dde)[_0x81c8('0x20')](function(_0x1b74d1){logger[_0x81c8('0x21')](_0x81c8('0xe'),_0x182e47,_0x5c7dde[_0x81c8('0x22')]);})[_0x81c8('0x23')](function(_0x2041bf){logger[_0x81c8('0x24')](_0x81c8('0xe'),_0x182e47,JSON['stringify'](_0x2041bf));})[_0x81c8('0x25')](function(){logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x182e47);_0x2111ca['stop']();});}else{logger['info'](_0x81c8('0x26'),_0x182e47);_0x2111ca['stop']();}}else{var _0x147382=this;var _0x42fb26=apiai(_0x3a1778[0x0],{'language':_0x3a1778[0x1]||'en'});return _0x42fb26[_0x81c8('0x27')](this[_0x81c8('0x28')][_0x81c8('0x22')],{'sessionId':md5(this[_0x81c8('0xc')]['id'])})[_0x81c8('0x20')](function(_0x24674b){_0x147382[_0x81c8('0x22')][_0x81c8('0x29')]=_0x24674b;_0x5c7dde[_0x81c8('0x22')]=_0x24674b[_0x81c8('0x2a')][_0x81c8('0x2b')]['speech'];_0x5c7dde[_0x81c8('0x2c')]=_0x81c8('0x29');_0x5c7dde[_0x81c8('0x2d')]=JSON[_0x81c8('0x2e')](_0x24674b);return rpc[_0xa75672+'Message'][_0x81c8('0x2f')](_0x5c7dde)['then'](function(_0x224039){logger[_0x81c8('0x21')](_0x81c8('0xe'),_0x182e47,_0x5c7dde[_0x81c8('0x22')]);if(_0x24674b[_0x81c8('0x2a')][_0x81c8('0x30')][_0x81c8('0x31')]){_0x2111ca[_0x81c8('0x10')]();}else{_0x2111ca['stop']();}})[_0x81c8('0x23')](function(_0x55d113){logger[_0x81c8('0x24')](_0x81c8('0xe'),_0x182e47,JSON[_0x81c8('0x2e')](_0x55d113));_0x2111ca[_0x81c8('0x10')]();});})[_0x81c8('0x23')](function(_0x1d580f){logger[_0x81c8('0x24')]('[%s][DIALOGFLOW]\x20%s',_0x182e47,_0x1d580f[_0x81c8('0x28')]);_0x2111ca['next']();});}}catch(_0x35b19d){logger[_0x81c8('0x24')](_0x81c8('0xe'),_0x182e47,JSON['stringify'](_0x35b19d));_0x2111ca[_0x81c8('0x32')]();}};}; \ 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 9cf766e..65844ab 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 _0xec3a=['interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','channel','whatsapp','phone','chat','ChatWebsiteId','AccountId','created','isEmpty','getMustacheRender','Message','stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','all','stack','lodash','dialogflow','md5','moment','bluebird','routing','../../rpc/chatMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','consequence','isNil'];(function(_0x49b21f,_0x268706){var _0x272905=function(_0xd9c991){while(--_0xd9c991){_0x49b21f['push'](_0x49b21f['shift']());}};_0x272905(++_0x268706);}(_0xec3a,0x105));var _0xaec3=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xec3a[_0x1762b4];return _0x29beda;};'use strict';var _=require(_0xaec3('0x0'));var dialogflow=require(_0xaec3('0x1'));var md5=require(_0xaec3('0x2'));var moment=require(_0xaec3('0x3'));var Promise=require(_0xaec3('0x4'));var logger=require('../../../../config/logger')(_0xaec3('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0xaec3('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xaec3('0x7')),'whatsappMessage':require(_0xaec3('0x8'))};function createMessage(_0xdcaf88,_0x173316,_0x4526ec,_0x2c4af1){return new Promise(function(_0x4ffd6a,_0x40e861){var _0x1ca388=_[_0xaec3('0x9')](_0x4526ec);_0x1ca388['body']=_0x2c4af1;return rpc[_0x173316+'Message'][_0xaec3('0xa')](_0x1ca388)[_0xaec3('0xb')](function(){logger[_0xaec3('0xc')](_0xaec3('0xd'),_0xdcaf88,_0x1ca388[_0xaec3('0xe')]);_0x4ffd6a();})[_0xaec3('0xf')](function(_0x227ee8){logger[_0xaec3('0x10')](_0xaec3('0xd'),_0xdcaf88,JSON['stringify'](_0x227ee8));_0x40e861(_0x227ee8);});});}exports[_0xaec3('0x11')]=function(_0x1ad150,_0x5a1a67){return function(_0x30f8ac){try{if(!_[_0xaec3('0x12')](this[_0xaec3('0x13')][_0xaec3('0x14')])){logger[_0xaec3('0xc')]('[%s][DIALOGFLOWV2]\x20%s',_0x1ad150,_0xaec3('0x15'));return _0x30f8ac[_0xaec3('0x16')]();}var _0x599a20={'ContactId':this['contact']['id'],'sentAt':moment()[_0xaec3('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']==='sms'||this[_0xaec3('0x18')]===_0xaec3('0x19')){_0x599a20[_0xaec3('0x1a')]=this[_0xaec3('0x13')][_0xaec3('0x1a')];}var _0x3da5d6=this[_0xaec3('0x18')];if(_0x3da5d6===_0xaec3('0x1b')){_0x599a20[_0xaec3('0x1c')]=this['account']['id'];}else{_0x599a20[_['upperFirst'](_0x3da5d6)+_0xaec3('0x1d')]=this['account']['id'];}_0x599a20[_['upperFirst'](_0x3da5d6)+'InteractionId']=this[_0xaec3('0x13')]['id'];if(this[_0xaec3('0x13')][_0xaec3('0x1e')]){var _0x4d9fb9=_0x5a1a67[0x4];if(!_[_0xaec3('0x1f')](_0x4d9fb9)){_0x599a20[_0xaec3('0xe')]=utils[_0xaec3('0x20')](_0x4d9fb9,this);return rpc[_0x3da5d6+_0xaec3('0x21')]['create'](_0x599a20)[_0xaec3('0xb')](function(_0x13bea1){logger[_0xaec3('0xc')](_0xaec3('0xd'),_0x1ad150,_0x599a20[_0xaec3('0xe')]);})['catch'](function(_0x5c6d03){logger[_0xaec3('0x10')](_0xaec3('0xd'),_0x1ad150,JSON[_0xaec3('0x22')](_0x5c6d03));})[_0xaec3('0x23')](function(){logger[_0xaec3('0xc')](_0xaec3('0x24'),_0x1ad150);_0x30f8ac[_0xaec3('0x25')]();});}else{logger['info'](_0xaec3('0x26'),_0x1ad150);_0x30f8ac[_0xaec3('0x25')]();}}else{var _0x5d5a0a=this;var _0xf69fbd=_0x5a1a67[0x2][_0xaec3('0x27')](/\\n/g,'\x0a');var _0x40514c={'credentials':{'private_key':_0xf69fbd,'client_email':_0x5a1a67[0x1]}};var _0x6b5a08=new dialogflow[(_0xaec3('0x28'))](_0x40514c);var _0xec5be6=_0x6b5a08[_0xaec3('0x29')](_0x5a1a67[0x0],md5(_0x5d5a0a[_0xaec3('0x13')]['id']));var _0x2c1aeb={'session':_0xec5be6,'queryInput':{'text':{'text':_0x5d5a0a[_0xaec3('0x2a')]['body'],'languageCode':_0x5a1a67[0x3]||'en'}}};return _0x6b5a08[_0xaec3('0x2b')](_0x2c1aeb)[_0xaec3('0xb')](function(_0x51a44c){if(_0x51a44c&&_0x51a44c[_0xaec3('0x2c')]){_0x5d5a0a['body'][_0xaec3('0x2d')]=_0x51a44c;var _0x4e19d7=_0x51a44c[0x0];var _0xa51fa7=_0x4e19d7[_0xaec3('0x2e')][_0xaec3('0x2f')]&&_0x4e19d7[_0xaec3('0x2e')][_0xaec3('0x2f')]['fields']?_0x4e19d7['queryResult'][_0xaec3('0x2f')][_0xaec3('0x30')]['end_conversation']['boolValue']:![];_0x5d5a0a[_0xaec3('0xe')][_0xaec3('0x31')]=_0x4e19d7[_0xaec3('0x2e')][_0xaec3('0x32')];_0x5d5a0a['body'][_0xaec3('0x33')]=_0x4e19d7['queryResult']['allRequiredParamsPresent'];_0x5d5a0a['body'][_0xaec3('0x34')]=_0x4e19d7['queryResult'][_0xaec3('0x2f')]&&_0x4e19d7[_0xaec3('0x2e')]['diagnosticInfo'][_0xaec3('0x30')]?_0x4e19d7[_0xaec3('0x2e')][_0xaec3('0x2f')]['fields'][_0xaec3('0x35')]['boolValue']:![];_0x5d5a0a[_0xaec3('0xe')][_0xaec3('0x36')]=_0x4e19d7['queryResult'][_0xaec3('0x37')][_0xaec3('0x38')];_0x5d5a0a[_0xaec3('0xe')][_0xaec3('0x39')]=_0x4e19d7[_0xaec3('0x2e')][_0xaec3('0x37')][_0xaec3('0x3a')];_0x5d5a0a[_0xaec3('0xe')][_0xaec3('0x3b')]=_0x4e19d7['queryResult'][_0xaec3('0x37')][_0xaec3('0x3c')];_0x5d5a0a[_0xaec3('0xe')][_0xaec3('0x3d')]=_0x4e19d7[_0xaec3('0x2e')]['languageCode'];_0x5d5a0a[_0xaec3('0xe')][_0xaec3('0x3e')]=_0x4e19d7[_0xaec3('0x2e')][_0xaec3('0x3f')];_0x5d5a0a[_0xaec3('0xe')][_0xaec3('0x40')]=_0x4e19d7[_0xaec3('0x2e')]['intentDetectionConfidence'];_0x599a20[_0xaec3('0x41')]=_0xaec3('0x2d');_0x599a20[_0xaec3('0x42')]=JSON['stringify'](_0x51a44c);var _0x255944=[];for(var _0xa0e480=0x0;_0xa0e480<_0x51a44c[_0xaec3('0x2c')];_0xa0e480++){var _0x5dc964=_0x51a44c[_0xa0e480];if(_0x5dc964&&_0x5dc964[_0xaec3('0x2e')]&&_0x5dc964[_0xaec3('0x2e')][_0xaec3('0x43')]){_0x255944['push'](createMessage(_0x1ad150,_0x3da5d6,_0x599a20,_0x5dc964[_0xaec3('0x2e')][_0xaec3('0x43')]));}}return Promise[_0xaec3('0x44')](_0x255944)[_0xaec3('0xb')](function(){if(_0xa51fa7){_0x30f8ac[_0xaec3('0x16')]();}else{_0x30f8ac[_0xaec3('0x25')]();}})[_0xaec3('0xf')](function(_0x103cf0){logger['error'](_0xaec3('0xd'),_0x1ad150,JSON['stringify'](_0x103cf0));_0x30f8ac[_0xaec3('0x16')]();});}})[_0xaec3('0xf')](function(_0x1bd53f){logger[_0xaec3('0x10')](_0xaec3('0xd'),_0x1ad150,_0x1bd53f[_0xaec3('0x2a')],_0x1bd53f[_0xaec3('0x45')]);_0x30f8ac['next']();});}}catch(_0x3190ad){logger[_0xaec3('0x10')](_0xaec3('0xd'),_0x1ad150,JSON[_0xaec3('0x22')](_0x3190ad));_0x30f8ac['stop']();}};}; \ No newline at end of file +var _0x5a40=['fulfillmentText','push','all','next','stack','lodash','dialogflow','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','body','Message','[%s][DIALOGFLOWV2]\x20%s','catch','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','interaction','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','getMustacheRender','create','info','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','then','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','boolValue','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','providerName','providerResponse','stringify','length'];(function(_0x597227,_0x5b2405){var _0x472bca=function(_0x33529d){while(--_0x33529d){_0x597227['push'](_0x597227['shift']());}};_0x472bca(++_0x5b2405);}(_0x5a40,0x95));var _0x05a4=function(_0x31e10,_0x376a33){_0x31e10=_0x31e10-0x0;var _0x59c757=_0x5a40[_0x31e10];return _0x59c757;};'use strict';var _=require(_0x05a4('0x0'));var dialogflow=require(_0x05a4('0x1'));var md5=require('md5');var moment=require('moment');var Promise=require('bluebird');var logger=require('../../../../config/logger')(_0x05a4('0x2'));var utils=require('./utils');var rpc={'chatMessage':require(_0x05a4('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x05a4('0x4')),'smsMessage':require(_0x05a4('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x05a4('0x6'))};function createMessage(_0x5eeffd,_0xbf572d,_0x413890,_0x4c9ca0){return new Promise(function(_0x1b69f8,_0x545256){var _0x5129d5=_[_0x05a4('0x7')](_0x413890);_0x5129d5[_0x05a4('0x8')]=_0x4c9ca0;return rpc[_0xbf572d+_0x05a4('0x9')]['create'](_0x5129d5)['then'](function(){logger['info'](_0x05a4('0xa'),_0x5eeffd,_0x5129d5[_0x05a4('0x8')]);_0x1b69f8();})[_0x05a4('0xb')](function(_0x3b2689){logger['error'](_0x05a4('0xa'),_0x5eeffd,JSON['stringify'](_0x3b2689));_0x545256(_0x3b2689);});});}exports['consequence']=function(_0x48d7ac,_0xa58f07){return function(_0x4c8aa0){try{if(!_[_0x05a4('0xc')](this['interaction'][_0x05a4('0xd')])){logger['info'](_0x05a4('0xa'),_0x48d7ac,_0x05a4('0xe'));return _0x4c8aa0['next']();}var _0x3b9b71={'ContactId':this[_0x05a4('0xf')]['id'],'sentAt':moment()['format'](_0x05a4('0x10')),'direction':_0x05a4('0x11')};if(this[_0x05a4('0x12')]===_0x05a4('0x13')||this['channel']===_0x05a4('0x14')){_0x3b9b71['phone']=this[_0x05a4('0x15')][_0x05a4('0x16')];}var _0x1e59b4=this[_0x05a4('0x12')];if(_0x1e59b4===_0x05a4('0x17')){_0x3b9b71[_0x05a4('0x18')]=this['account']['id'];}else{_0x3b9b71[_[_0x05a4('0x19')](_0x1e59b4)+_0x05a4('0x1a')]=this[_0x05a4('0x1b')]['id'];}_0x3b9b71[_[_0x05a4('0x19')](_0x1e59b4)+_0x05a4('0x1c')]=this[_0x05a4('0x15')]['id'];if(this[_0x05a4('0x15')][_0x05a4('0x1d')]){var _0x2a74df=_0xa58f07[0x4];if(!_['isEmpty'](_0x2a74df)){_0x3b9b71[_0x05a4('0x8')]=utils[_0x05a4('0x1e')](_0x2a74df,this);return rpc[_0x1e59b4+_0x05a4('0x9')][_0x05a4('0x1f')](_0x3b9b71)['then'](function(_0x5e6e2e){logger[_0x05a4('0x20')]('[%s][DIALOGFLOWV2]\x20%s',_0x48d7ac,_0x3b9b71[_0x05a4('0x8')]);})['catch'](function(_0x47f18d){logger[_0x05a4('0x21')](_0x05a4('0xa'),_0x48d7ac,JSON['stringify'](_0x47f18d));})[_0x05a4('0x22')](function(){logger['info'](_0x05a4('0x23'),_0x48d7ac);_0x4c8aa0[_0x05a4('0x24')]();});}else{logger[_0x05a4('0x20')](_0x05a4('0x25'),_0x48d7ac);_0x4c8aa0[_0x05a4('0x24')]();}}else{var _0x245fbf=this;var _0x1b5208=_0xa58f07[0x2][_0x05a4('0x26')](/\\n/g,'\x0a');var _0xcda891={'credentials':{'private_key':_0x1b5208,'client_email':_0xa58f07[0x1]}};var _0x4e10b5=new dialogflow[(_0x05a4('0x27'))](_0xcda891);var _0x11d81c=_0x4e10b5[_0x05a4('0x28')](_0xa58f07[0x0],md5(_0x245fbf[_0x05a4('0x15')]['id']));var _0x43182d={'session':_0x11d81c,'queryInput':{'text':{'text':_0x245fbf[_0x05a4('0x29')]['body'],'languageCode':_0xa58f07[0x3]||'en'}}};return _0x4e10b5[_0x05a4('0x2a')](_0x43182d)[_0x05a4('0x2b')](function(_0x3c1bb4){if(_0x3c1bb4&&_0x3c1bb4['length']){_0x245fbf[_0x05a4('0x8')][_0x05a4('0x2c')]=_0x3c1bb4;var _0x1eafb1=_0x3c1bb4[0x0];var _0x4f239b=_0x1eafb1[_0x05a4('0x2d')]['diagnosticInfo']&&_0x1eafb1['queryResult'][_0x05a4('0x2e')][_0x05a4('0x2f')]?_0x1eafb1['queryResult']['diagnosticInfo']['fields'][_0x05a4('0x30')]['boolValue']:![];_0x245fbf[_0x05a4('0x8')][_0x05a4('0x31')]=_0x1eafb1[_0x05a4('0x2d')][_0x05a4('0x32')];_0x245fbf[_0x05a4('0x8')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x1eafb1[_0x05a4('0x2d')][_0x05a4('0x33')];_0x245fbf['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x1eafb1[_0x05a4('0x2d')][_0x05a4('0x2e')]&&_0x1eafb1[_0x05a4('0x2d')][_0x05a4('0x2e')][_0x05a4('0x2f')]?_0x1eafb1[_0x05a4('0x2d')]['diagnosticInfo']['fields'][_0x05a4('0x30')][_0x05a4('0x34')]:![];_0x245fbf['body'][_0x05a4('0x35')]=_0x1eafb1[_0x05a4('0x2d')][_0x05a4('0x36')][_0x05a4('0x37')];_0x245fbf[_0x05a4('0x8')][_0x05a4('0x38')]=_0x1eafb1['queryResult'][_0x05a4('0x36')][_0x05a4('0x39')];_0x245fbf['body'][_0x05a4('0x3a')]=_0x1eafb1['queryResult']['intent'][_0x05a4('0x3b')];_0x245fbf[_0x05a4('0x8')]['DIALOGFLOWV2_LANGUAGECODE']=_0x1eafb1[_0x05a4('0x2d')][_0x05a4('0x3c')];_0x245fbf[_0x05a4('0x8')][_0x05a4('0x3d')]=_0x1eafb1[_0x05a4('0x2d')][_0x05a4('0x3e')];_0x245fbf[_0x05a4('0x8')]['DIALOGFLOWV2_SCORE']=_0x1eafb1[_0x05a4('0x2d')]['intentDetectionConfidence'];_0x3b9b71[_0x05a4('0x3f')]=_0x05a4('0x2c');_0x3b9b71[_0x05a4('0x40')]=JSON[_0x05a4('0x41')](_0x3c1bb4);var _0x19f414=[];for(var _0xd46033=0x0;_0xd46033<_0x3c1bb4[_0x05a4('0x42')];_0xd46033++){var _0x1027b0=_0x3c1bb4[_0xd46033];if(_0x1027b0&&_0x1027b0[_0x05a4('0x2d')]&&_0x1027b0[_0x05a4('0x2d')][_0x05a4('0x43')]){_0x19f414[_0x05a4('0x44')](createMessage(_0x48d7ac,_0x1e59b4,_0x3b9b71,_0x1027b0[_0x05a4('0x2d')][_0x05a4('0x43')]));}}return Promise[_0x05a4('0x45')](_0x19f414)['then'](function(){if(_0x4f239b){_0x4c8aa0['next']();}else{_0x4c8aa0[_0x05a4('0x24')]();}})[_0x05a4('0xb')](function(_0x16bf3b){logger[_0x05a4('0x21')](_0x05a4('0xa'),_0x48d7ac,JSON[_0x05a4('0x41')](_0x16bf3b));_0x4c8aa0[_0x05a4('0x46')]();});}})[_0x05a4('0xb')](function(_0x303502){logger['error'](_0x05a4('0xa'),_0x48d7ac,_0x303502[_0x05a4('0x29')],_0x303502[_0x05a4('0x47')]);_0x4c8aa0[_0x05a4('0x46')]();});}}catch(_0x27bb1d){logger['error'](_0x05a4('0xa'),_0x48d7ac,JSON[_0x05a4('0x41')](_0x27bb1d));_0x4c8aa0['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 0f88019..7446d76 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 _0x9568=['priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','map','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','[%s][GOTOIF]\x20%s','stringify','validate','lodash','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x9568,0xa3));var _0x8956=function(_0x1e0499,_0x2222ed){_0x1e0499=_0x1e0499-0x0;var _0x527766=_0x9568[_0x1e0499];return _0x527766;};'use strict';var schema=require(_0x8956('0x0'));var _=require(_0x8956('0x1'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':_0x8956('0x2'),'required':!![],'message':_0x8956('0x3')},'priorityTrue':{'type':_0x8956('0x4'),'message':_0x8956('0x5')},'priorityFalse':{'type':_0x8956('0x4'),'message':_0x8956('0x6')}});exports[_0x8956('0x7')]=function(_0x6dec1b,_0x2b7605){return function(_0x3bdf52){try{var _0x3b7c25={'condition':htmlToText['fromString'](utils[_0x8956('0x8')](_0x2b7605[0x0],this),{'wordwrap':![]})[_0x8956('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2b7605[0x1],'priorityFalse':_0x2b7605[0x2]};var _0x52c200=gotoif[_0x8956('0x0')](_0x3b7c25,{'typecast':!![]});if(_0x52c200[_0x8956('0xa')]){logger[_0x8956('0xb')]('[%s][GOTOIF]\x20%s',_0x6dec1b,_[_0x8956('0xc')](_0x52c200,'message')[_0x8956('0xd')](',\x20'));_0x3bdf52[_0x8956('0xe')]();}else{try{var _0x1657f8=eval('('+_0x3b7c25[_0x8956('0xf')]+')');var _0x2f06d6=_0x1657f8?_0x3b7c25[_0x8956('0x10')]:_0x3b7c25[_0x8956('0x11')];logger[_0x8956('0x12')](_0x8956('0x13'),_0x6dec1b,_0x3b7c25[_0x8956('0xf')],_0x1657f8,_0x2f06d6||_0x8956('0x14'));if(_0x2f06d6){var _0x380fbf=_[_0x8956('0x15')](_0x3bdf52['rules'](),{'p':_0x2f06d6});if(_0x380fbf>=0x0){logger[_0x8956('0x12')](_0x8956('0x16'),_0x6dec1b,_0x2f06d6||_0x8956('0x14'),_0x380fbf);_0x3bdf52[_0x8956('0x14')](_0x380fbf);}else{logger[_0x8956('0x12')](_0x8956('0x17'),_0x6dec1b,_0x2f06d6||'next');_0x3bdf52['stop']();}}else{_0x3bdf52[_0x8956('0x14')]();}}catch(_0x178449){logger[_0x8956('0xb')](_0x8956('0x18'),_0x6dec1b,_0x178449[_0x8956('0x19')]);_0x3bdf52[_0x8956('0xe')]();}}}catch(_0x2553cf){logger[_0x8956('0xb')](_0x8956('0x1a'),_0x6dec1b,JSON[_0x8956('0x1b')](_0x2553cf));_0x3bdf52['stop']();}};}; \ No newline at end of file +var _0xb5d7=['priorityTrue','priorityFalse','info','next','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition'];(function(_0x17876c,_0x17c9e3){var _0x26844b=function(_0x497029){while(--_0x497029){_0x17876c['push'](_0x17876c['shift']());}};_0x26844b(++_0x17c9e3);}(_0xb5d7,0x1a7));var _0x7b5d=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xb5d7[_0x465a0c];return _0x1e202e;};'use strict';var schema=require(_0x7b5d('0x0'));var _=require(_0x7b5d('0x1'));var htmlToText=require(_0x7b5d('0x2'));var utils=require('./utils');var logger=require(_0x7b5d('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x7b5d('0x4'),'required':!![],'message':_0x7b5d('0x5')},'priorityTrue':{'type':'number','message':_0x7b5d('0x6')},'priorityFalse':{'type':_0x7b5d('0x7'),'message':_0x7b5d('0x8')}});exports['consequence']=function(_0x2a1d1a,_0x29471a){return function(_0x4ee808){try{var _0x69cb33={'condition':htmlToText[_0x7b5d('0x9')](utils['getMustacheRender'](_0x29471a[0x0],this),{'wordwrap':![]})[_0x7b5d('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x29471a[0x1],'priorityFalse':_0x29471a[0x2]};var _0x2f3002=gotoif[_0x7b5d('0x0')](_0x69cb33,{'typecast':!![]});if(_0x2f3002[_0x7b5d('0xb')]){logger[_0x7b5d('0xc')](_0x7b5d('0xd'),_0x2a1d1a,_[_0x7b5d('0xe')](_0x2f3002,_0x7b5d('0xf'))[_0x7b5d('0x10')](',\x20'));_0x4ee808[_0x7b5d('0x11')]();}else{try{var _0x3237d8=eval('('+_0x69cb33[_0x7b5d('0x12')]+')');var _0x14d9e3=_0x3237d8?_0x69cb33[_0x7b5d('0x13')]:_0x69cb33[_0x7b5d('0x14')];logger[_0x7b5d('0x15')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2a1d1a,_0x69cb33[_0x7b5d('0x12')],_0x3237d8,_0x14d9e3||_0x7b5d('0x16'));if(_0x14d9e3){var _0x18e6a6=_['findIndex'](_0x4ee808['rules'](),{'p':_0x14d9e3});if(_0x18e6a6>=0x0){logger[_0x7b5d('0x15')](_0x7b5d('0x17'),_0x2a1d1a,_0x14d9e3||_0x7b5d('0x16'),_0x18e6a6);_0x4ee808[_0x7b5d('0x16')](_0x18e6a6);}else{logger['info'](_0x7b5d('0x18'),_0x2a1d1a,_0x14d9e3||_0x7b5d('0x16'));_0x4ee808['stop']();}}else{_0x4ee808['next']();}}catch(_0x1c96b9){logger[_0x7b5d('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x2a1d1a,_0x1c96b9[_0x7b5d('0xf')]);_0x4ee808['stop']();}}}catch(_0x1d173d){logger[_0x7b5d('0xc')](_0x7b5d('0xd'),_0x2a1d1a,JSON[_0x7b5d('0x19')](_0x1d173d));_0x4ee808['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 1ede62e..901e1d3 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 _0xd160=['[%s][GOTOP]\x20priority\x20%s','findIndex','rules','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info'];(function(_0x329239,_0x3a5d3c){var _0x16ae55=function(_0x233a0b){while(--_0x233a0b){_0x329239['push'](_0x329239['shift']());}};_0x16ae55(++_0x3a5d3c);}(_0xd160,0x1ea));var _0x0d16=function(_0x533528,_0x409d05){_0x533528=_0x533528-0x0;var _0x3189f1=_0xd160[_0x533528];return _0x3189f1;};'use strict';var schema=require(_0x0d16('0x0'));var _=require(_0x0d16('0x1'));var logger=require(_0x0d16('0x2'))(_0x0d16('0x3'));var gotop=schema({'priority':{'type':_0x0d16('0x4'),'required':!![],'message':_0x0d16('0x5')}});exports['consequence']=function(_0x54eff1,_0x4a9d25){return function(_0x1c1286){try{var _0x216101={'priority':_0x4a9d25[0x0]};var _0x59ea0b=gotop[_0x0d16('0x0')](_0x216101,{'typecast':!![]});if(_0x59ea0b[_0x0d16('0x6')]){logger[_0x0d16('0x7')](_0x0d16('0x8'),_0x54eff1,_[_0x0d16('0x9')](_0x59ea0b,_0x0d16('0xa'))[_0x0d16('0xb')](',\x20'));_0x1c1286[_0x0d16('0xc')]();}else{logger[_0x0d16('0xd')](_0x0d16('0xe'),_0x54eff1,_0x216101['priority']);if(_0x216101['priority']){var _0x44a12c=_[_0x0d16('0xf')](_0x1c1286[_0x0d16('0x10')](),{'p':_0x216101[_0x0d16('0x11')]});if(_0x44a12c>=0x0){logger[_0x0d16('0xd')](_0x0d16('0x12'),_0x54eff1,_0x216101[_0x0d16('0x11')]||'next',_0x44a12c);_0x1c1286[_0x0d16('0x13')](_0x44a12c);}else{logger[_0x0d16('0xd')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x54eff1,_0x216101[_0x0d16('0x11')]||'next');_0x1c1286[_0x0d16('0xc')]();}}else{_0x1c1286[_0x0d16('0x13')]();}}}catch(_0x22960e){logger[_0x0d16('0x7')](_0x0d16('0x8'),_0x54eff1,JSON[_0x0d16('0x14')](_0x22960e));_0x1c1286[_0x0d16('0xc')]();}};}; \ No newline at end of file +var _0x7328=['length','[%s][GOTOP]\x20%s','map','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','../../../../config/logger','routing','number','consequence'];(function(_0x4a0941,_0xa46cd5){var _0x411bf1=function(_0x40e159){while(--_0x40e159){_0x4a0941['push'](_0x4a0941['shift']());}};_0x411bf1(++_0xa46cd5);}(_0x7328,0x13a));var _0x8732=function(_0x26410b,_0x425fa7){_0x26410b=_0x26410b-0x0;var _0x11ea1c=_0x7328[_0x26410b];return _0x11ea1c;};'use strict';var schema=require(_0x8732('0x0'));var _=require(_0x8732('0x1'));var logger=require(_0x8732('0x2'))(_0x8732('0x3'));var gotop=schema({'priority':{'type':_0x8732('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x8732('0x5')]=function(_0x31e250,_0x4d5425){return function(_0x364175){try{var _0x2e2c2f={'priority':_0x4d5425[0x0]};var _0x25d46d=gotop[_0x8732('0x0')](_0x2e2c2f,{'typecast':!![]});if(_0x25d46d[_0x8732('0x6')]){logger['error'](_0x8732('0x7'),_0x31e250,_[_0x8732('0x8')](_0x25d46d,'message')[_0x8732('0x9')](',\x20'));_0x364175['stop']();}else{logger[_0x8732('0xa')](_0x8732('0xb'),_0x31e250,_0x2e2c2f[_0x8732('0xc')]);if(_0x2e2c2f[_0x8732('0xc')]){var _0x2ee5c3=_[_0x8732('0xd')](_0x364175[_0x8732('0xe')](),{'p':_0x2e2c2f['priority']});if(_0x2ee5c3>=0x0){logger[_0x8732('0xa')](_0x8732('0xf'),_0x31e250,_0x2e2c2f[_0x8732('0xc')]||_0x8732('0x10'),_0x2ee5c3);_0x364175[_0x8732('0x10')](_0x2ee5c3);}else{logger['info'](_0x8732('0x11'),_0x31e250,_0x2e2c2f[_0x8732('0xc')]||_0x8732('0x10'));_0x364175[_0x8732('0x12')]();}}else{_0x364175['next']();}}}catch(_0x38bcea){logger['error'](_0x8732('0x7'),_0x31e250,JSON[_0x8732('0x13')](_0x38bcea));_0x364175[_0x8732('0x12')]();}};}; \ 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 985415d..87c7f80 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 _0xe85f=['error','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','Message','create','then','[%s][MESSAGE]\x20%s','next'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xe85f,0x116));var _0xfe85=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xe85f[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xfe85('0x0'));var utils=require(_0xfe85('0x1'));var logger=require(_0xfe85('0x2'))(_0xfe85('0x3'));var rpc={'chatMessage':require(_0xfe85('0x4')),'openchannelMessage':require(_0xfe85('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xfe85('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x15552e,_0x2fb8a3){return function(_0x2a90d9){try{var _0x1b3a12={'body':utils[_0xfe85('0x7')](_0x2fb8a3[0x0],this),'ContactId':this[_0xfe85('0x8')]['id']};if(this[_0xfe85('0x9')]===_0xfe85('0xa')){_0x1b3a12[_0xfe85('0xb')]=this['account']['id'];}else{_0x1b3a12[_[_0xfe85('0xc')](this[_0xfe85('0x9')])+_0xfe85('0xd')]=this[_0xfe85('0xe')]['id'];}_0x1b3a12[_['upperFirst'](this[_0xfe85('0x9')])+_0xfe85('0xf')]=this['interaction']['id'];if(rpc[this['channel']+_0xfe85('0x10')]){return rpc[this['channel']+_0xfe85('0x10')][_0xfe85('0x11')](_0x1b3a12)[_0xfe85('0x12')](function(_0xe20fd2){logger['info'](_0xfe85('0x13'),_0x15552e,_0x1b3a12['body']);_0x2a90d9[_0xfe85('0x14')]();})['catch'](function(_0x4b06a8){logger[_0xfe85('0x15')]('[%s][MESSAGE]\x20%s',_0x15552e,JSON['stringify'](_0x4b06a8));_0x2a90d9[_0xfe85('0x16')]();});}}catch(_0x30f9d0){logger[_0xfe85('0x15')](_0xfe85('0x13'),_0x15552e,JSON['stringify'](_0x30f9d0));_0x2a90d9[_0xfe85('0x16')]();}};}; \ No newline at end of file +var _0x105f=['Message','create','[%s][MESSAGE]\x20%s','body','next','stringify','stop','error','./utils','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','interaction'];(function(_0xd9acb4,_0x153a82){var _0x479cc2=function(_0x30fcbe){while(--_0x30fcbe){_0xd9acb4['push'](_0xd9acb4['shift']());}};_0x479cc2(++_0x153a82);}(_0x105f,0x71));var _0xf105=function(_0x1ea185,_0x27e48d){_0x1ea185=_0x1ea185-0x0;var _0x4ac9e3=_0x105f[_0x1ea185];return _0x4ac9e3;};'use strict';var _=require('lodash');var utils=require(_0xf105('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf105('0x1')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xf105('0x2')),'faxMessage':require(_0xf105('0x3')),'whatsappMessage':require(_0xf105('0x4'))};exports[_0xf105('0x5')]=function(_0x58224e,_0x374059){return function(_0x100675){try{var _0x5f4946={'body':utils[_0xf105('0x6')](_0x374059[0x0],this),'ContactId':this['contact']['id']};if(this[_0xf105('0x7')]===_0xf105('0x8')){_0x5f4946[_0xf105('0x9')]=this[_0xf105('0xa')]['id'];}else{_0x5f4946[_['upperFirst'](this['channel'])+'AccountId']=this['account']['id'];}_0x5f4946[_[_0xf105('0xb')](this[_0xf105('0x7')])+'InteractionId']=this[_0xf105('0xc')]['id'];if(rpc[this[_0xf105('0x7')]+_0xf105('0xd')]){return rpc[this[_0xf105('0x7')]+_0xf105('0xd')][_0xf105('0xe')](_0x5f4946)['then'](function(_0x2f2dd5){logger['info'](_0xf105('0xf'),_0x58224e,_0x5f4946[_0xf105('0x10')]);_0x100675[_0xf105('0x11')]();})['catch'](function(_0x26b7b6){logger['error']('[%s][MESSAGE]\x20%s',_0x58224e,JSON[_0xf105('0x12')](_0x26b7b6));_0x100675[_0xf105('0x13')]();});}}catch(_0x24dd40){logger[_0xf105('0x14')](_0xf105('0xf'),_0x58224e,JSON['stringify'](_0x24dd40));_0x100675[_0xf105('0x13')]();}};}; \ 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 fecff35..09a7ea7 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 _0x7aba=['info','[%s][NOOP]\x20%s','next','stringify','./utils','../../../../config/logger','routing'];(function(_0x2bfffa,_0x28d329){var _0x1f6af6=function(_0x1c5524){while(--_0x1c5524){_0x2bfffa['push'](_0x2bfffa['shift']());}};_0x1f6af6(++_0x28d329);}(_0x7aba,0x1e0));var _0xa7ab=function(_0x3a4135,_0x21b062){_0x3a4135=_0x3a4135-0x0;var _0x14826e=_0x7aba[_0x3a4135];return _0x14826e;};'use strict';var utils=require(_0xa7ab('0x0'));var logger=require(_0xa7ab('0x1'))(_0xa7ab('0x2'));exports['consequence']=function(_0x3fe575,_0x12190e){return function(_0x321fdb){try{logger[_0xa7ab('0x3')](_0xa7ab('0x4'),_0x3fe575,utils['getMustacheRender'](_0x12190e[0x0],this));_0x321fdb[_0xa7ab('0x5')]();}catch(_0x4b567){logger['error']('[%s][NOOP]\x20%s',_0x3fe575,JSON[_0xa7ab('0x6')](_0x4b567));_0x321fdb['stop']();}};}; \ No newline at end of file +var _0xe47d=['stringify','stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0xd1fc7a,_0x1f7ccc){var _0x5187a8=function(_0x1f4b8b){while(--_0x1f4b8b){_0xd1fc7a['push'](_0xd1fc7a['shift']());}};_0x5187a8(++_0x1f7ccc);}(_0xe47d,0x1c5));var _0xde47=function(_0x7afb4c,_0x10778f){_0x7afb4c=_0x7afb4c-0x0;var _0x54a1e9=_0xe47d[_0x7afb4c];return _0x54a1e9;};'use strict';var utils=require(_0xde47('0x0'));var logger=require(_0xde47('0x1'))(_0xde47('0x2'));exports[_0xde47('0x3')]=function(_0x511fd,_0x1622be){return function(_0x59ddbf){try{logger[_0xde47('0x4')](_0xde47('0x5'),_0x511fd,utils[_0xde47('0x6')](_0x1622be[0x0],this));_0x59ddbf[_0xde47('0x7')]();}catch(_0x4f5c67){logger[_0xde47('0x8')]('[%s][NOOP]\x20%s',_0x511fd,JSON[_0xde47('0x9')](_0x4f5c67));_0x59ddbf[_0xde47('0xa')]();}};}; \ 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 45b3cde..1c0b4c2 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 _0x01f5=['message','chat','WebsiteId','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','createQueue','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','util','ioredis','../../../../config/environment','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','from','clone','queue','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','channel','QueueId','upperFirst','interaction'];(function(_0x381997,_0x3dad60){var _0x4dadd8=function(_0x3259cd){while(--_0x3259cd){_0x381997['push'](_0x381997['shift']());}};_0x4dadd8(++_0x3dad60);}(_0x01f5,0x19e));var _0x501f=function(_0x18b9fa,_0x4ed98f){_0x18b9fa=_0x18b9fa-0x0;var _0x40eadb=_0x01f5[_0x18b9fa];return _0x40eadb;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x501f('0x0'));var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0x501f('0x1'));var config=require(_0x501f('0x2'));var logger=require('../../../../config/logger')(_0x501f('0x3'));var strategy=require(_0x501f('0x4'));config['redis']=_['defaults'](config[_0x501f('0x5')],{'host':_0x501f('0x6'),'port':0x18eb});var io=require(_0x501f('0x7'))(new Redis(config[_0x501f('0x5')]));var attributes=['id',_0x501f('0x8'),_0x501f('0x9'),'queue',_0x501f('0xa'),'joinAt'];function emit(_0x1b63ef,_0x4f0b3e,_0x4a6cde){io['to'](_0x1b63ef)['emit'](_0x4f0b3e,_0x4a6cde);}function emitChannelQueueInteraction(_0x479bfe,_0x2bb8d2,_0x590c2e,_0x45dcaa,_0x5011eb,_0x2eb644,_0x3f4614,_0x169c6b){var _0x17c159=_[_0x501f('0xb')](_0x590c2e);_0x17c159[_0x501f('0x8')]=_0x169c6b;_0x17c159[_0x501f('0xc')]=_0x2bb8d2;_0x17c159[_0x501f('0x9')]=_0x45dcaa;_0x17c159['id']=_0x5011eb;if(_0x2eb644){attributes[_0x501f('0xd')](_[_0x501f('0xe')](_0x479bfe)+_0x501f('0xf'));_0x3f4614[util[_0x501f('0x10')]('%sQueuesWaitingInteractions',_0x479bfe)][_0x5011eb]=_['pick'](_0x17c159,attributes);}else{delete _0x3f4614[util['format'](_0x501f('0x11'),_0x479bfe)][_0x5011eb];}emit(util['format'](_0x501f('0x12'),_0x479bfe,_0x2bb8d2),util[_0x501f('0x10')](_0x501f('0x13'),_0x479bfe,_0x2eb644?_0x501f('0x14'):_0x501f('0x15')),_[_0x501f('0x16')](_0x17c159,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x501f('0x17')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x501f('0x18')),'whatsappQueueReport':require(_0x501f('0x19'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x501f('0x1a'),'message':_0x501f('0x1b')}});function startRouting(_0x1720c7,_0x58864a,_0x4a0598,_0x1a87bd){if(_0x1720c7&&_0x58864a&&_0x4a0598){_0x58864a[_0x501f('0x1c')]+=0x1;var _0x1ecd03={'uniqueid':_0x1720c7,'from':_0x4a0598[_0x501f('0x1d')]?_0x4a0598['body']['from']:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4a0598[_0x501f('0x1e')]?_0x4a0598[_0x501f('0x1e')]['id']:null,'ListId':_0x4a0598[_0x501f('0x1f')]?_0x4a0598[_0x501f('0x1f')]['id']:null};_0x1ecd03[_['upperFirst'](_0x4a0598[_0x501f('0x20')])+_0x501f('0x21')]=_0x58864a['id']||null;_0x1ecd03[_[_0x501f('0x22')](_0x4a0598['channel'])+_0x501f('0xf')]=_0x4a0598[_0x501f('0x23')]?_0x4a0598[_0x501f('0x23')]['id']:null;_0x1ecd03[_[_0x501f('0x22')](_0x4a0598[_0x501f('0x20')])+'MessageId']=_0x4a0598['message']?_0x4a0598[_0x501f('0x24')]['id']:null;_0x1ecd03[_[_0x501f('0x22')](_0x4a0598[_0x501f('0x20')])+(_0x4a0598[_0x501f('0x20')]!==_0x501f('0x25')?'AccountId':_0x501f('0x26'))]=_0x4a0598[_0x501f('0x9')]?_0x4a0598[_0x501f('0x9')]['id']:null;logger['info'](util[_0x501f('0x10')]('[%s][START:QUEUE][NAME:%s]',_0x1720c7,_0x58864a[_0x501f('0x27')]));emitChannelQueueInteraction(_0x4a0598[_0x501f('0x20')],_0x58864a[_0x501f('0x27')],_0x1ecd03,_0x4a0598[_0x501f('0x9')]['name'],_0x4a0598[_0x501f('0x24')]['id'],!![],_0x1a87bd,_0x58864a['id']);if(rpc[_0x4a0598[_0x501f('0x20')]+_0x501f('0x28')]){return rpc[_0x4a0598[_0x501f('0x20')]+_0x501f('0x28')][_0x501f('0x29')](_0x1ecd03)[_0x501f('0x2a')](function(_0x4f7a76){logger[_0x501f('0x2b')](_0x501f('0x2c'));});}}}function stopRouting(_0x45191a,_0x1cd019,_0x381114,_0x560b6e){if(_0x45191a&&_0x1cd019){_0x1cd019[_0x501f('0x1c')]-=0x1;var _0x3de3d1={'leaveAt':moment()[_0x501f('0x10')](_0x501f('0x2d')),'acceptAt':moment()[_0x501f('0x10')](_0x501f('0x2d')),'reason':_0x501f('0x2e')};logger[_0x501f('0x2f')](util['format'](_0x501f('0x30'),_0x45191a,_0x1cd019['name']));emitChannelQueueInteraction(_0x381114['channel'],_0x1cd019['name'],_0x381114[_0x501f('0x1d')],_0x381114[_0x501f('0x9')]['name'],_0x381114[_0x501f('0x24')]['id'],![],_0x560b6e,_0x1cd019['id']);if(rpc[_0x381114[_0x501f('0x20')]+_0x501f('0x28')]){return rpc[_0x381114[_0x501f('0x20')]+_0x501f('0x28')][_0x501f('0x31')](_0x45191a,_0x3de3d1)[_0x501f('0x2a')](function(_0xbbb6f1){logger[_0x501f('0x2b')](_0x501f('0x32'));});}}}function endRouting(_0x42b1c7,_0x4bc261,_0x109426,_0x1b1e71){if(_0x42b1c7&&_0x4bc261){_0x4bc261[_0x501f('0x1c')]-=0x1;var _0x3afae3={'leaveAt':moment()[_0x501f('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0x501f('0x2d')),'reason':_0x501f('0x33')};logger[_0x501f('0x2f')](util[_0x501f('0x10')](_0x501f('0x34'),_0x42b1c7,_0x4bc261[_0x501f('0x27')]));emitChannelQueueInteraction(_0x109426['channel'],_0x4bc261[_0x501f('0x27')],_0x109426['body'],_0x109426[_0x501f('0x9')]['name'],_0x109426[_0x501f('0x24')]['id'],![],_0x1b1e71);if(rpc[_0x109426['channel']+_0x501f('0x28')]){return rpc[_0x109426['channel']+_0x501f('0x28')][_0x501f('0x31')](_0x42b1c7,_0x3afae3)[_0x501f('0x2a')](function(_0x2538a3){logger[_0x501f('0x2b')](_0x501f('0x32'));});}}}function handleFindQueue(_0x146f01){return function(_0xb34373){return _0xb34373[_0x501f('0x27')][_0x501f('0x35')]()===_0x146f01[_0x501f('0x35')]();};}exports[_0x501f('0x36')]=function(_0x9ece13,_0x514c0a,_0x36ca41,_0x4f8a8b){return function(_0x40135f){try{var _0x468ae2={'name':_0x514c0a[0x0],'timeout':_0x514c0a[0x1]};var _0x3af51b=queue[_0x501f('0x37')](_0x468ae2,{'typecast':!![]});if(_0x3af51b[_0x501f('0x38')]){logger[_0x501f('0x2b')](_0x501f('0x39'),_0x9ece13,_[_0x501f('0x3a')](_0x3af51b,_0x501f('0x24'))[_0x501f('0x3b')](',\x20'));_0x40135f[_0x501f('0x3c')]();}else{var _0x270c7c=_['find'](_0x36ca41[_0x4f8a8b[_0x501f('0x20')]+'Queues'],handleFindQueue(_0x468ae2['name']));if(_0x270c7c){startRouting(_0x9ece13,_0x270c7c,_0x4f8a8b,_0x36ca41);var _0x14f516=(_0x270c7c['timeout']||0xa)*0x3e8;var _0x3d9908=(_0x468ae2[_0x501f('0x33')]||0x14)*0x3e8;var _0x1747bf;if(_0x14f516>_0x3d9908){_0x3d9908=_0x14f516;}var _0x1d7d1b=seqqueue[_0x501f('0x3d')](_0x14f516);_0x1d7d1b['id']=_0x9ece13;_0x1d7d1b['atimeout']=_0x14f516;_0x1d7d1b[_0x501f('0x3e')]=_0x3d9908;_0x1d7d1b[_0x501f('0x20')]=_0x4f8a8b[_0x501f('0x20')];_0x36ca41[_0x501f('0x3f')][_0x9ece13]['on']('end',function(){logger[_0x501f('0x2f')](_0x501f('0x40'),_0x9ece13);stopRouting(_0x9ece13,_0x270c7c,_0x4f8a8b,_0x36ca41);clearTimeout(_0x1747bf);_0x1747bf=undefined;_0x1d7d1b[_0x501f('0x41')](!![]);if(_0x36ca41['rules'][_0x9ece13]){delete _0x36ca41[_0x501f('0x3f')][_0x9ece13];}_0x40135f[_0x501f('0x3c')]();});_0x36ca41[_0x501f('0x3f')][_0x9ece13]['on'](_0x501f('0x42'),function(){if(_0x36ca41[_0x501f('0x3f')][_0x9ece13]){delete _0x36ca41[_0x501f('0x3f')][_0x9ece13];}});_0x1747bf=setTimeout(function(){logger['info'](_0x501f('0x43'),_0x9ece13);endRouting(_0x9ece13,_0x270c7c,_0x4f8a8b,_0x36ca41);clearTimeout(_0x1747bf);_0x1d7d1b[_0x501f('0x41')](!![]);_0x40135f[_0x501f('0x44')]();},_0x3d9908);switch(_0x270c7c[_0x501f('0x45')]){case _0x501f('0x46'):strategy[_0x501f('0x46')](_0x1d7d1b,_0x270c7c,_0x36ca41,_0x4f8a8b);break;default:strategy[_0x501f('0x47')](_0x1d7d1b,_0x270c7c,_0x36ca41,_0x4f8a8b);}}else{logger[_0x501f('0x2b')](_0x501f('0x48'),_0x9ece13,_0x468ae2[_0x501f('0x27')]);_0x40135f[_0x501f('0x3c')]();}}}catch(_0x806f3f){console[_0x501f('0x49')](_0x806f3f);logger[_0x501f('0x2b')](_0x501f('0x39'),_0x9ece13,_0x806f3f[_0x501f('0x4a')]);_0x40135f[_0x501f('0x3c')]();}};}; \ No newline at end of file +var _0xa5ce=['[%s][START:QUEUE][NAME:%s]','name','message','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find','Queues','createQueue','atimeout','qtimeout','rules','end','complete','close','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','stop','validate','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','account','queue','from','joinAt','clone','queue_id','push','capitalize','InteractionId','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','interaction','AccountId','WebsiteId','info'];(function(_0x48547b,_0x5da003){var _0x319045=function(_0x11d585){while(--_0x11d585){_0x48547b['push'](_0x48547b['shift']());}};_0x319045(++_0x5da003);}(_0xa5ce,0x16b));var _0xea5c=function(_0x17b688,_0x2f00f3){_0x17b688=_0x17b688-0x0;var _0xea9f73=_0xa5ce[_0x17b688];return _0xea9f73;};'use strict';var schema=require(_0xea5c('0x0'));var _=require('lodash');var util=require(_0xea5c('0x1'));var seqqueue=require(_0xea5c('0x2'));var moment=require('moment');var Redis=require(_0xea5c('0x3'));var config=require(_0xea5c('0x4'));var logger=require(_0xea5c('0x5'))(_0xea5c('0x6'));var strategy=require(_0xea5c('0x7'));config[_0xea5c('0x8')]=_[_0xea5c('0x9')](config[_0xea5c('0x8')],{'host':_0xea5c('0xa'),'port':0x18eb});var io=require(_0xea5c('0xb'))(new Redis(config[_0xea5c('0x8')]));var attributes=['id','queue_id',_0xea5c('0xc'),_0xea5c('0xd'),_0xea5c('0xe'),_0xea5c('0xf')];function emit(_0x1b2881,_0x6041f0,_0x3507ad){io['to'](_0x1b2881)['emit'](_0x6041f0,_0x3507ad);}function emitChannelQueueInteraction(_0x238f14,_0x5a6e78,_0x21544f,_0x1ac093,_0x1b568d,_0x3b8704,_0x3f0eef,_0x52b290){var _0x414d5d=_[_0xea5c('0x10')](_0x21544f);_0x414d5d[_0xea5c('0x11')]=_0x52b290;_0x414d5d['queue']=_0x5a6e78;_0x414d5d[_0xea5c('0xc')]=_0x1ac093;_0x414d5d['id']=_0x1b568d;if(_0x3b8704){attributes[_0xea5c('0x12')](_[_0xea5c('0x13')](_0x238f14)+_0xea5c('0x14'));_0x3f0eef[util['format'](_0xea5c('0x15'),_0x238f14)][_0x1b568d]=_[_0xea5c('0x16')](_0x414d5d,attributes);}else{delete _0x3f0eef[util['format'](_0xea5c('0x15'),_0x238f14)][_0x1b568d];}emit(util[_0xea5c('0x17')](_0xea5c('0x18'),_0x238f14,_0x5a6e78),util[_0xea5c('0x17')](_0xea5c('0x19'),_0x238f14,_0x3b8704?_0xea5c('0x1a'):_0xea5c('0x1b')),_[_0xea5c('0x16')](_0x414d5d,attributes));}var rpc={'openchannelQueueReport':require(_0xea5c('0x1c')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xea5c('0x1d')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xea5c('0x1e'))};var queue=schema({'name':{'type':_0xea5c('0x1f'),'required':!![],'message':_0xea5c('0x20')},'timeout':{'type':_0xea5c('0x21'),'message':_0xea5c('0x22')}});function startRouting(_0x5dc3a8,_0x26e250,_0x521307,_0x1fa868){if(_0x5dc3a8&&_0x26e250&&_0x521307){_0x26e250[_0xea5c('0x23')]+=0x1;var _0x22e9ba={'uniqueid':_0x5dc3a8,'from':_0x521307['body']?_0x521307[_0xea5c('0x24')][_0xea5c('0xe')]:'','joinAt':moment()['format'](_0xea5c('0x25')),'ContactId':_0x521307[_0xea5c('0x26')]?_0x521307[_0xea5c('0x26')]['id']:null,'ListId':_0x521307[_0xea5c('0x27')]?_0x521307['list']['id']:null};_0x22e9ba[_[_0xea5c('0x28')](_0x521307['channel'])+_0xea5c('0x29')]=_0x26e250['id']||null;_0x22e9ba[_[_0xea5c('0x28')](_0x521307[_0xea5c('0x2a')])+_0xea5c('0x14')]=_0x521307[_0xea5c('0x2b')]?_0x521307[_0xea5c('0x2b')]['id']:null;_0x22e9ba[_[_0xea5c('0x28')](_0x521307[_0xea5c('0x2a')])+'MessageId']=_0x521307['message']?_0x521307['message']['id']:null;_0x22e9ba[_[_0xea5c('0x28')](_0x521307[_0xea5c('0x2a')])+(_0x521307['channel']!=='chat'?_0xea5c('0x2c'):_0xea5c('0x2d'))]=_0x521307['account']?_0x521307[_0xea5c('0xc')]['id']:null;logger[_0xea5c('0x2e')](util[_0xea5c('0x17')](_0xea5c('0x2f'),_0x5dc3a8,_0x26e250[_0xea5c('0x30')]));emitChannelQueueInteraction(_0x521307[_0xea5c('0x2a')],_0x26e250[_0xea5c('0x30')],_0x22e9ba,_0x521307[_0xea5c('0xc')][_0xea5c('0x30')],_0x521307[_0xea5c('0x31')]['id'],!![],_0x1fa868,_0x26e250['id']);if(rpc[_0x521307[_0xea5c('0x2a')]+_0xea5c('0x32')]){return rpc[_0x521307[_0xea5c('0x2a')]+'QueueReport'][_0xea5c('0x33')](_0x22e9ba)[_0xea5c('0x34')](function(_0x5c2391){logger[_0xea5c('0x35')](_0xea5c('0x36'));});}}}function stopRouting(_0x1fe512,_0x471b8e,_0x5ad599,_0x56516a){if(_0x1fe512&&_0x471b8e){_0x471b8e['waiting']-=0x1;var _0x55cb71={'leaveAt':moment()[_0xea5c('0x17')](_0xea5c('0x25')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xea5c('0x37')};logger[_0xea5c('0x2e')](util[_0xea5c('0x17')](_0xea5c('0x38'),_0x1fe512,_0x471b8e[_0xea5c('0x30')]));emitChannelQueueInteraction(_0x5ad599[_0xea5c('0x2a')],_0x471b8e[_0xea5c('0x30')],_0x5ad599[_0xea5c('0x24')],_0x5ad599['account']['name'],_0x5ad599['message']['id'],![],_0x56516a,_0x471b8e['id']);if(rpc[_0x5ad599['channel']+'QueueReport']){return rpc[_0x5ad599[_0xea5c('0x2a')]+_0xea5c('0x32')][_0xea5c('0x39')](_0x1fe512,_0x55cb71)[_0xea5c('0x34')](function(_0xf89d8c){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x3e8f10,_0x139da4,_0x14821d,_0x185258){if(_0x3e8f10&&_0x139da4){_0x139da4[_0xea5c('0x23')]-=0x1;var _0x13cefd={'leaveAt':moment()['format'](_0xea5c('0x25')),'exitAt':moment()[_0xea5c('0x17')](_0xea5c('0x25')),'reason':_0xea5c('0x3a')};logger[_0xea5c('0x2e')](util[_0xea5c('0x17')](_0xea5c('0x3b'),_0x3e8f10,_0x139da4['name']));emitChannelQueueInteraction(_0x14821d['channel'],_0x139da4[_0xea5c('0x30')],_0x14821d[_0xea5c('0x24')],_0x14821d['account'][_0xea5c('0x30')],_0x14821d[_0xea5c('0x31')]['id'],![],_0x185258);if(rpc[_0x14821d[_0xea5c('0x2a')]+'QueueReport']){return rpc[_0x14821d[_0xea5c('0x2a')]+_0xea5c('0x32')][_0xea5c('0x39')](_0x3e8f10,_0x13cefd)['catch'](function(_0x1fb93e){logger['error'](_0xea5c('0x3c'));});}}}function handleFindQueue(_0x19d5ae){return function(_0x5cd83f){return _0x5cd83f['name'][_0xea5c('0x3d')]()===_0x19d5ae[_0xea5c('0x3d')]();};}exports[_0xea5c('0x3e')]=function(_0x34813f,_0x4baf54,_0x35bdb0,_0x508677){return function(_0x2f283e){try{var _0x41cb21={'name':_0x4baf54[0x0],'timeout':_0x4baf54[0x1]};var _0x2d0abc=queue[_0xea5c('0x0')](_0x41cb21,{'typecast':!![]});if(_0x2d0abc[_0xea5c('0x3f')]){logger['error'](_0xea5c('0x40'),_0x34813f,_[_0xea5c('0x41')](_0x2d0abc,_0xea5c('0x31'))[_0xea5c('0x42')](',\x20'));_0x2f283e['stop']();}else{var _0x5a1313=_[_0xea5c('0x43')](_0x35bdb0[_0x508677['channel']+_0xea5c('0x44')],handleFindQueue(_0x41cb21[_0xea5c('0x30')]));if(_0x5a1313){startRouting(_0x34813f,_0x5a1313,_0x508677,_0x35bdb0);var _0x42856d=(_0x5a1313[_0xea5c('0x3a')]||0xa)*0x3e8;var _0x1ea5e0=(_0x41cb21[_0xea5c('0x3a')]||0x14)*0x3e8;var _0x2dca20;if(_0x42856d>_0x1ea5e0){_0x1ea5e0=_0x42856d;}var _0x48ec65=seqqueue[_0xea5c('0x45')](_0x42856d);_0x48ec65['id']=_0x34813f;_0x48ec65[_0xea5c('0x46')]=_0x42856d;_0x48ec65[_0xea5c('0x47')]=_0x1ea5e0;_0x48ec65[_0xea5c('0x2a')]=_0x508677[_0xea5c('0x2a')];_0x35bdb0[_0xea5c('0x48')][_0x34813f]['on'](_0xea5c('0x49'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x34813f);stopRouting(_0x34813f,_0x5a1313,_0x508677,_0x35bdb0);clearTimeout(_0x2dca20);_0x2dca20=undefined;_0x48ec65['close'](!![]);if(_0x35bdb0[_0xea5c('0x48')][_0x34813f]){delete _0x35bdb0[_0xea5c('0x48')][_0x34813f];}_0x2f283e['stop']();});_0x35bdb0['rules'][_0x34813f]['on'](_0xea5c('0x4a'),function(){if(_0x35bdb0[_0xea5c('0x48')][_0x34813f]){delete _0x35bdb0['rules'][_0x34813f];}});_0x2dca20=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x34813f);endRouting(_0x34813f,_0x5a1313,_0x508677,_0x35bdb0);clearTimeout(_0x2dca20);_0x48ec65[_0xea5c('0x4b')](!![]);_0x2f283e['next']();},_0x1ea5e0);switch(_0x5a1313[_0xea5c('0x4c')]){case _0xea5c('0x4d'):strategy['rrmemory'](_0x48ec65,_0x5a1313,_0x35bdb0,_0x508677);break;default:strategy[_0xea5c('0x4e')](_0x48ec65,_0x5a1313,_0x35bdb0,_0x508677);}}else{logger[_0xea5c('0x35')](_0xea5c('0x4f'),_0x34813f,_0x41cb21['name']);_0x2f283e['stop']();}}}catch(_0x38a354){console['log'](_0x38a354);logger[_0xea5c('0x35')]('[%s][QUEUE]\x20%s',_0x34813f,_0x38a354[_0xea5c('0x50')]);_0x2f283e[_0xea5c('0x51')]();}};}; \ 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 f53a9d8..51a650d 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 _0x33c5=['./util','routing','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained','prototype','handleDrained','debug','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','showNotification','notificationId','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','TIMEOUT','exports','uuid'];(function(_0x204ad4,_0x502841){var _0x50675f=function(_0x30ad49){while(--_0x30ad49){_0x204ad4['push'](_0x204ad4['shift']());}};_0x50675f(++_0x502841);}(_0x33c5,0xe6));var _0x533c=function(_0x3ad2e5,_0x94d414){_0x3ad2e5=_0x3ad2e5-0x0;var _0xc4e565=_0x33c5[_0x3ad2e5];return _0xc4e565;};'use strict';var _=require('lodash');var uuid=require(_0x533c('0x0'));var util=require(_0x533c('0x1'));var logger=require('../../../../../config/logger')(_0x533c('0x2'));var Agent=function(_0x26b916,_0x221e43,_0x23a12d,_0x358127){this['notificationId']=uuid['v4']();this[_0x533c('0x3')]=_0x26b916;this[_0x533c('0x4')]=_0x221e43;this[_0x533c('0x5')]=_0x23a12d;this[_0x533c('0x2')]=_0x358127;this[_0x533c('0x3')][_0x533c('0x6')](this[_0x533c('0x7')][_0x533c('0x8')](this),this[_0x533c('0x9')][_0x533c('0x8')](this));this[_0x533c('0x3')]['on'](_0x533c('0xa'),this[_0x533c('0x9')][_0x533c('0x8')](this));this[_0x533c('0x3')]['on'](_0x533c('0xb'),this['handleDrained'][_0x533c('0x8')](this));};Agent[_0x533c('0xc')][_0x533c('0x6')]=function(){this[_0x533c('0x3')][_0x533c('0x6')](this[_0x533c('0x7')]['bind'](this),this[_0x533c('0x9')][_0x533c('0x8')](this));};Agent[_0x533c('0xc')][_0x533c('0xd')]=function(){this[_0x533c('0x9')](!![]);};Agent[_0x533c('0xc')][_0x533c('0x7')]=function(){logger[_0x533c('0xe')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x533c('0x3')]['id'],this[_0x533c('0x4')]['id']);if(_[_0x533c('0xf')](this[_0x533c('0x5')]['agents'][this[_0x533c('0x4')]['id']])){logger[_0x533c('0xe')](_0x533c('0x10'),this[_0x533c('0x3')]['id'],this[_0x533c('0x4')]['id']);setTimeout(this[_0x533c('0x6')][_0x533c('0x8')](this),0x3e8);}else{if(this[_0x533c('0x2')][_0x533c('0x11')]||util[_0x533c('0x12')](this[_0x533c('0x3')]['id'],this[_0x533c('0x5')][_0x533c('0x13')][this[_0x533c('0x4')]['id']],this[_0x533c('0x3')][_0x533c('0x14')],![])){this[_0x533c('0x5')][_0x533c('0x13')][this['agent']['id']][_0x533c('0x15')]=!![];this['realtime']['agents'][this[_0x533c('0x4')]['id']][_0x533c('0x16')]=undefined;util['saveWaitingNotification'](this[_0x533c('0x5')],this[_0x533c('0x2')],this[_0x533c('0x4')],this[_0x533c('0x3')]['channel']);util[_0x533c('0x17')](this[_0x533c('0x18')],this[_0x533c('0x3')]['id'],this[_0x533c('0x5')][_0x533c('0x13')][this[_0x533c('0x4')]['id']],null,this[_0x533c('0x2')]);util[_0x533c('0x19')](this[_0x533c('0x3')]['id'],this[_0x533c('0x5')]['agents'][this[_0x533c('0x4')]['id']],_0x533c('0x1a')+(this['routing'][_0x533c('0x11')]?':FORCED':''));}else{logger[_0x533c('0xe')](_0x533c('0x1b'),this[_0x533c('0x3')]['id'],this[_0x533c('0x4')]['id']);setTimeout(this[_0x533c('0x6')][_0x533c('0x8')](this),0x3e8);}}};Agent[_0x533c('0xc')][_0x533c('0x9')]=function(_0x3c559b){if(_[_0x533c('0xf')](this[_0x533c('0x5')][_0x533c('0x13')][this['agent']['id']])){return logger[_0x533c('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x533c('0x3')]['id'],this[_0x533c('0x4')]['id']);}else{logger[_0x533c('0xe')](_0x533c('0x1c'),this[_0x533c('0x3')]['id'],this[_0x533c('0x4')]['id']);util[_0x533c('0x1d')](this[_0x533c('0x18')],this[_0x533c('0x3')]['id'],this[_0x533c('0x5')][_0x533c('0x13')][this[_0x533c('0x4')]['id']],null,this[_0x533c('0x2')]);this[_0x533c('0x5')][_0x533c('0x13')][this['agent']['id']][_0x533c('0x15')]=![];this[_0x533c('0x5')][_0x533c('0x13')][this[_0x533c('0x4')]['id']]['busyQueue']=undefined;util[_0x533c('0x1e')](this[_0x533c('0x5')],this[_0x533c('0x2')],this[_0x533c('0x4')],this[_0x533c('0x3')]['channel']);util['writeLog'](this['squeue']['id'],this['realtime']['agents'][this[_0x533c('0x4')]['id']],_0x3c559b?'STOP':_0x533c('0x1f'));}if(!_0x3c559b){setTimeout(this['push'][_0x533c('0x8')](this),0x3e8);}};function agent(_0x3cd1e6,_0x14c121,_0x56adcc,_0x44a18d){return new Agent(_0x3cd1e6,_0x14c121,_0x56adcc,_0x44a18d);}module[_0x533c('0x20')]=agent; \ No newline at end of file +var _0x9b9b=['hideNotification','busyQueue','removeWaitingNotification','writeLog','STOP','exports','uuid','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','forcedOwnership','channel','busy','saveWaitingNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s'];(function(_0x1495e9,_0x5a7894){var _0x1f6842=function(_0x4396d8){while(--_0x4396d8){_0x1495e9['push'](_0x1495e9['shift']());}};_0x1f6842(++_0x5a7894);}(_0x9b9b,0x114));var _0xb9b9=function(_0x5b756c,_0x3621b6){_0x5b756c=_0x5b756c-0x0;var _0x2e0952=_0x9b9b[_0x5b756c];return _0x2e0952;};'use strict';var _=require('lodash');var uuid=require(_0xb9b9('0x0'));var util=require('./util');var logger=require('../../../../../config/logger')(_0xb9b9('0x1'));var Agent=function(_0x153734,_0x1adf50,_0x1f6fea,_0x1d6ab6){this[_0xb9b9('0x2')]=uuid['v4']();this[_0xb9b9('0x3')]=_0x153734;this[_0xb9b9('0x4')]=_0x1adf50;this[_0xb9b9('0x5')]=_0x1f6fea;this[_0xb9b9('0x1')]=_0x1d6ab6;this[_0xb9b9('0x3')][_0xb9b9('0x6')](this[_0xb9b9('0x7')][_0xb9b9('0x8')](this),this[_0xb9b9('0x9')][_0xb9b9('0x8')](this));this['squeue']['on']('timeout',this[_0xb9b9('0x9')][_0xb9b9('0x8')](this));this[_0xb9b9('0x3')]['on']('drained',this[_0xb9b9('0xa')][_0xb9b9('0x8')](this));};Agent[_0xb9b9('0xb')]['push']=function(){this[_0xb9b9('0x3')][_0xb9b9('0x6')](this[_0xb9b9('0x7')][_0xb9b9('0x8')](this),this[_0xb9b9('0x9')][_0xb9b9('0x8')](this));};Agent['prototype']['handleDrained']=function(){this[_0xb9b9('0x9')](!![]);};Agent['prototype'][_0xb9b9('0x7')]=function(){logger['debug'](_0xb9b9('0xc'),this[_0xb9b9('0x3')]['id'],this[_0xb9b9('0x4')]['id']);if(_[_0xb9b9('0xd')](this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']])){logger[_0xb9b9('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xb9b9('0x3')]['id'],this['agent']['id']);setTimeout(this[_0xb9b9('0x6')][_0xb9b9('0x8')](this),0x3e8);}else{if(this[_0xb9b9('0x1')][_0xb9b9('0x10')]||util['isAgentAvailable'](this[_0xb9b9('0x3')]['id'],this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']],this[_0xb9b9('0x3')][_0xb9b9('0x11')],![])){this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']][_0xb9b9('0x12')]=!![];this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']]['busyQueue']=undefined;util[_0xb9b9('0x13')](this[_0xb9b9('0x5')],this[_0xb9b9('0x1')],this['agent'],this[_0xb9b9('0x3')][_0xb9b9('0x11')]);util['showNotification'](this[_0xb9b9('0x2')],this[_0xb9b9('0x3')]['id'],this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']],null,this['routing']);util['writeLog'](this[_0xb9b9('0x3')]['id'],this[_0xb9b9('0x5')]['agents'][this[_0xb9b9('0x4')]['id']],_0xb9b9('0x14')+(this[_0xb9b9('0x1')][_0xb9b9('0x10')]?_0xb9b9('0x15'):''));}else{logger['debug'](_0xb9b9('0x16'),this['squeue']['id'],this[_0xb9b9('0x4')]['id']);setTimeout(this[_0xb9b9('0x6')]['bind'](this),0x3e8);}}};Agent[_0xb9b9('0xb')][_0xb9b9('0x9')]=function(_0x17a6f6){if(_['isNil'](this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']])){return logger[_0xb9b9('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xb9b9('0x3')]['id'],this[_0xb9b9('0x4')]['id']);}else{logger['debug'](_0xb9b9('0x17'),this[_0xb9b9('0x3')]['id'],this[_0xb9b9('0x4')]['id']);util[_0xb9b9('0x18')](this['notificationId'],this[_0xb9b9('0x3')]['id'],this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']],null,this['routing']);this[_0xb9b9('0x5')][_0xb9b9('0xe')][this['agent']['id']][_0xb9b9('0x12')]=![];this[_0xb9b9('0x5')][_0xb9b9('0xe')][this[_0xb9b9('0x4')]['id']][_0xb9b9('0x19')]=undefined;util[_0xb9b9('0x1a')](this['realtime'],this[_0xb9b9('0x1')],this[_0xb9b9('0x4')],this['squeue'][_0xb9b9('0x11')]);util[_0xb9b9('0x1b')](this[_0xb9b9('0x3')]['id'],this['realtime'][_0xb9b9('0xe')][this['agent']['id']],_0x17a6f6?_0xb9b9('0x1c'):'TIMEOUT');}if(!_0x17a6f6){setTimeout(this[_0xb9b9('0x6')][_0xb9b9('0x8')](this),0x3e8);}};function agent(_0x22b567,_0x1f1faf,_0x3dd3fe,_0x76f4d4){return new Agent(_0x22b567,_0x1f1faf,_0x3dd3fe,_0x76f4d4);}module[_0xb9b9('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 a597a56..45a0d49 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 _0x5e55=['../../../../../config/logger','routing','notificationId','squeue','queue','realtime','handleRun','handleTimeout','bind','timeout','drained','prototype','push','handleDrained','isNil','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busyQueue','name','saveWaitingNotification','Agents','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','exports','lodash','uuid'];(function(_0x530f66,_0x41bcb7){var _0x23a441=function(_0x24c67f){while(--_0x24c67f){_0x530f66['push'](_0x530f66['shift']());}};_0x23a441(++_0x41bcb7);}(_0x5e55,0xb2));var _0x55e5=function(_0x2f56c9,_0x53c36f){_0x2f56c9=_0x2f56c9-0x0;var _0x5d04f2=_0x5e55[_0x2f56c9];return _0x5d04f2;};'use strict';var _=require(_0x55e5('0x0'));var uuid=require(_0x55e5('0x1'));var util=require('./util');var logger=require(_0x55e5('0x2'))(_0x55e5('0x3'));var Beepall=function(_0x31b717,_0x1a1b0f,_0x2ee74f,_0x6ac861){this[_0x55e5('0x4')]=uuid['v4']();this[_0x55e5('0x5')]=_0x31b717;this[_0x55e5('0x6')]=_0x1a1b0f;this[_0x55e5('0x7')]=_0x2ee74f;this[_0x55e5('0x3')]=_0x6ac861;this['squeue']['push'](this[_0x55e5('0x8')]['bind'](this),this[_0x55e5('0x9')][_0x55e5('0xa')](this));this[_0x55e5('0x5')]['on'](_0x55e5('0xb'),this[_0x55e5('0x9')]['bind'](this));this[_0x55e5('0x5')]['on'](_0x55e5('0xc'),this['handleDrained'][_0x55e5('0xa')](this));};Beepall[_0x55e5('0xd')]['push']=function(){this[_0x55e5('0x5')][_0x55e5('0xe')](this['handleRun'][_0x55e5('0xa')](this),this[_0x55e5('0x9')][_0x55e5('0xa')](this));};Beepall[_0x55e5('0xd')][_0x55e5('0xf')]=function(){this['handleTimeout'](!![]);};Beepall['prototype']['handleRun']=function(){var _0x51440c=!![];if(!_[_0x55e5('0x10')](this['queue'])&&!_['isNil'](this[_0x55e5('0x6')]['Agents'])&&this[_0x55e5('0x6')]['Agents']['length']>0x0){for(var _0x16457c=0x0,_0x23ce35;_0x16457c0x0){for(var _0x599af3=0x0,_0x583805;_0x599af30x0&&_0x348e35[_0x1b277d+_0x73cb('0x28')]>=_0x348e35[_0x1b277d+'Capacity']){writeLog(_0x1575ce,_0x348e35,_0x1b277d[_0x73cb('0x29')]()+_0x73cb('0x2a'));return![];}}return!![];};exports[_0x73cb('0x2b')]=function(_0x44c355,_0x5da842,_0x1e0adb,_0x48bd7b,_0x56d46a){return sendNotification(!![],_0x44c355,_0x5da842,_0x1e0adb,_0x48bd7b,_0x56d46a);};exports[_0x73cb('0x2c')]=function(_0x1c304e,_0x2ce37d,_0x2d6027,_0x5dac21,_0x12ab0f){return sendNotification(![],_0x1c304e,_0x2ce37d,_0x2d6027,_0x5dac21,_0x12ab0f);};exports[_0x73cb('0x2d')]=function(_0x4b73fc,_0x4848ae,_0x1e3581){var _0x2d919d=_0x4848ae['interaction'][_0x73cb('0x2e')];if(!_0x2d919d&&_0x1e3581){_0x2d919d=_0x1e3581['id'];}var _0x425a54=_[_0x73cb('0x2f')](_0x4b73fc[_0x4848ae['channel']+_0x73cb('0x30')],function(_0x4cdc3a){var _0x5efd12=_[_0x73cb('0x31')](_0x4848ae[_0x73cb('0x32')])+'InteractionId';return _0x4cdc3a[_0x5efd12]===_0x4848ae[_0x73cb('0x33')]['id'];});if(!_0x425a54&&_0x2d919d){_0x425a54=_[_0x73cb('0x2f')](_0x4b73fc[_0x73cb('0x34')][_0x2d919d][_0x4848ae[_0x73cb('0x32')]+_0x73cb('0x35')],function(_0x1f39ca){return _0x1f39ca['id']===_0x4848ae[_0x73cb('0x33')]['id'];});}return _0x425a54;};exports['saveWaitingNotification']=function(_0xebbd3c,_0x3566d9,_0x4533f4,_0x2ab38e){_0xebbd3c[_0x73cb('0x34')][_0x4533f4['id']][_0x2ab38e+_0x73cb('0x35')][_0x3566d9['message']['id']]={'id':_0x3566d9[_0x73cb('0x33')]['id']};};exports[_0x73cb('0x36')]=function(_0x1cb164,_0x3eebde,_0x10c7cc,_0x49020a){delete _0x1cb164[_0x73cb('0x34')][_0x10c7cc['id']][_0x49020a+_0x73cb('0x35')][_0x3eebde[_0x73cb('0x37')]['id']];};exports['writeLog']=writeLog; \ No newline at end of file +var _0x8f9a=['capitalize','InteractionId','WaitingInteractions','agents','removeWaitingNotification','writeLog','lodash','util','../utils','../../../../../config/environment','routing','defaults','redis','localhost','socket.io-emitter','format','user:%s','user:save','\x20interaction','name','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','message','emit','notification:%s','save','[%s][QUEUE][AGENT:%s][STATUS:%s]','online','OFFLINE','PAUSE','hasOwnProperty','Capacity','\x20MAXCAPACITY','showNotification','hideNotification','interaction','UserId','some','channel','QueuesWaitingInteractions'];(function(_0x2c1c8,_0x4a52b0){var _0x495de6=function(_0x44c5cc){while(--_0x44c5cc){_0x2c1c8['push'](_0x2c1c8['shift']());}};_0x495de6(++_0x4a52b0);}(_0x8f9a,0x176));var _0xa8f9=function(_0x5207d3,_0x1b67d4){_0x5207d3=_0x5207d3-0x0;var _0x36785c=_0x8f9a[_0x5207d3];return _0x36785c;};'use strict';var _=require(_0xa8f9('0x0'));var util=require(_0xa8f9('0x1'));var utils=require(_0xa8f9('0x2'));var Redis=require('ioredis');var config=require(_0xa8f9('0x3'));var logger=require('../../../../../config/logger')(_0xa8f9('0x4'));config['redis']=_[_0xa8f9('0x5')](config[_0xa8f9('0x6')],{'host':_0xa8f9('0x7'),'port':0x18eb});var io=require(_0xa8f9('0x8'))(new Redis(config['redis']));function sendNotification(_0x4cb21b,_0x4a3039,_0x269b2d,_0x9ecafc,_0x7da7d1,_0x1c0d33){io['to'](util[_0xa8f9('0x9')](_0xa8f9('0xa'),_0x9ecafc['name']))['emit'](_0xa8f9('0xb'),_0x9ecafc);var _0x35d272=_0x1c0d33||{};var _0x1239b9=_0x269b2d['split']('.');var _0x32ce62={'uniqueid':_0x4a3039,'channel':_0x1239b9[0x0],'id':_0x1239b9[0x1],'title':_0x1239b9[0x0]+_0xa8f9('0xc'),'interactionId':_0x1239b9[0x2],'queue':_0x7da7d1?_0x7da7d1[_0xa8f9('0xd')]:null,'sound':_0x35d272[_0xa8f9('0xe')][_0xa8f9('0xf')],'shake':_0x35d272[_0xa8f9('0xe')][_0xa8f9('0x10')]};try{if(!_0x35d272[_0xa8f9('0x11')]){_0x35d272[_0xa8f9('0x11')]={};}if(_0x7da7d1){_0x35d272[_0xa8f9('0x11')][_0xa8f9('0x12')]=_0x7da7d1;}else if(_0x35d272[_0xa8f9('0x11')]['queue']){delete _0x35d272[_0xa8f9('0x11')][_0xa8f9('0x12')];}_0x32ce62['msg']=utils[_0xa8f9('0x13')](_0x35d272[_0xa8f9('0xe')][_0xa8f9('0x14')],_0x35d272);}catch(_0x30c0bd){_0x32ce62['msg']=_0xa8f9('0x15');logger['error'](util[_0xa8f9('0x9')]('[%s][QUEUE]\x20%s',_0x4a3039,_0x30c0bd[_0xa8f9('0x16')]));}io['to'](util['format']('user:%s',_0x9ecafc[_0xa8f9('0xd')]))[_0xa8f9('0x17')](util[_0xa8f9('0x9')](_0xa8f9('0x18'),_0x4cb21b?_0xa8f9('0x19'):'remove'),_0x32ce62);}function writeLog(_0x511d30,_0xeca131,_0x3f3c73){return logger['debug'](util[_0xa8f9('0x9')](_0xa8f9('0x1a'),_0x511d30,_0xeca131['name'],_0x3f3c73));}exports['isAgentAvailable']=function(_0x1222b3,_0x788c33,_0x5f2655,_0x28c670){if(_0x788c33['busy']){writeLog(_0x1222b3,_0x788c33,'BUSY');return![];}if(!_0x788c33[_0xa8f9('0x1b')]){writeLog(_0x1222b3,_0x788c33,_0xa8f9('0x1c'));return![];}if(_0x788c33[_0x5f2655+'Pause']){writeLog(_0x1222b3,_0x788c33,_0xa8f9('0x1d'));return![];}if(_0x28c670&&_0x788c33['hasOwnProperty'](_0x5f2655+'Capacity')&&_0x788c33[_0xa8f9('0x1e')](_0x5f2655+'CurrentCapacity')){if(_0x788c33[_0x5f2655+_0xa8f9('0x1f')]>0x0&&_0x788c33[_0x5f2655+'CurrentCapacity']>=_0x788c33[_0x5f2655+_0xa8f9('0x1f')]){writeLog(_0x1222b3,_0x788c33,_0x5f2655['toUpperCase']()+_0xa8f9('0x20'));return![];}}return!![];};exports[_0xa8f9('0x21')]=function(_0x226cc5,_0xd2f296,_0x18a468,_0x31fc07,_0x303f7e){return sendNotification(!![],_0x226cc5,_0xd2f296,_0x18a468,_0x31fc07,_0x303f7e);};exports[_0xa8f9('0x22')]=function(_0x2cedcb,_0x5be5d8,_0x5790a3,_0x13b504,_0x4831b5){return sendNotification(![],_0x2cedcb,_0x5be5d8,_0x5790a3,_0x13b504,_0x4831b5);};exports['checkWaitingNotifications']=function(_0x1f08d0,_0x58d205,_0x169f49){var _0x1416fa=_0x58d205[_0xa8f9('0x23')][_0xa8f9('0x24')];if(!_0x1416fa&&_0x169f49){_0x1416fa=_0x169f49['id'];}var _0x28df47=_[_0xa8f9('0x25')](_0x1f08d0[_0x58d205[_0xa8f9('0x26')]+_0xa8f9('0x27')],function(_0x381ad1){var _0x49212b=_[_0xa8f9('0x28')](_0x58d205[_0xa8f9('0x26')])+_0xa8f9('0x29');return _0x381ad1[_0x49212b]===_0x58d205['interaction']['id'];});if(!_0x28df47&&_0x1416fa){_0x28df47=_[_0xa8f9('0x25')](_0x1f08d0['agents'][_0x1416fa][_0x58d205['channel']+_0xa8f9('0x2a')],function(_0x1a2c24){return _0x1a2c24['id']===_0x58d205[_0xa8f9('0x23')]['id'];});}return _0x28df47;};exports['saveWaitingNotification']=function(_0x2a3226,_0xd17255,_0x56127a,_0xea195e){_0x2a3226[_0xa8f9('0x2b')][_0x56127a['id']][_0xea195e+_0xa8f9('0x2a')][_0xd17255[_0xa8f9('0x16')]['id']]={'id':_0xd17255['interaction']['id']};};exports[_0xa8f9('0x2c')]=function(_0x2b53ef,_0x558752,_0x48b350,_0x488776){delete _0x2b53ef[_0xa8f9('0x2b')][_0x48b350['id']][_0x488776+'WaitingInteractions'][_0x558752[_0xa8f9('0x16')]['id']];};exports[_0xa8f9('0x2d')]=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 40592fa..a5cef2a 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 _0x4fef=['[%s][SYSTEM]\x20%s','map','message','join','info','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','shelljs','lodash','./utils','../../../../config/logger','routing','string','consequence','validate','length','error'];(function(_0x25521d,_0xa70c12){var _0xc9ec=function(_0x3a01fe){while(--_0x3a01fe){_0x25521d['push'](_0x25521d['shift']());}};_0xc9ec(++_0xa70c12);}(_0x4fef,0x109));var _0xf4fe=function(_0x370453,_0x403f2c){_0x370453=_0x370453-0x0;var _0x218a20=_0x4fef[_0x370453];return _0x218a20;};'use strict';var schema=require('validate');var sh=require(_0xf4fe('0x0'));var _=require(_0xf4fe('0x1'));var utils=require(_0xf4fe('0x2'));var logger=require(_0xf4fe('0x3'))(_0xf4fe('0x4'));var system=schema({'command':{'type':_0xf4fe('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xf4fe('0x6')]=function(_0x1f08c3,_0x43f52a){return function(_0x302560){try{var _0x641f95={'command':_0x43f52a[0x0]};var _0x36e8f2=system[_0xf4fe('0x7')](_0x641f95,{'typecast':!![]});if(_0x36e8f2[_0xf4fe('0x8')]){logger[_0xf4fe('0x9')](_0xf4fe('0xa'),_0x1f08c3,_[_0xf4fe('0xb')](_0x36e8f2,_0xf4fe('0xc'))[_0xf4fe('0xd')](',\x20'));logger[_0xf4fe('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1f08c3);_0x302560['next']();}else{var _0xa249e4=this;var _0x3e922a=utils[_0xf4fe('0xf')](_0x43f52a[0x0],this);logger[_0xf4fe('0xe')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x1f08c3,_0x3e922a);sh[_0xf4fe('0x10')](_[_0xf4fe('0x11')](_0x3e922a),function(_0x312264,_0x593a9a){logger[_0xf4fe('0xe')](_0xf4fe('0x12'),_0x1f08c3,_0x312264);if(_0x312264==0x0){var _0x427c1d=_0x593a9a['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xf4fe('0x13')](_0x43f52a[0x1])||_[_0xf4fe('0x14')](_0x43f52a[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x1f08c3);_0xa249e4[_0xf4fe('0x15')][_0x43f52a[0x1]]=_0x427c1d;}else{logger[_0xf4fe('0xe')](_0xf4fe('0x16'),_0x1f08c3,_0x43f52a[0x1],_0x427c1d);_0xa249e4[_0xf4fe('0x15')][_0x43f52a[0x1]]=_0x427c1d;}}_0x302560[_0xf4fe('0x17')]();});}}catch(_0x20f29e){logger['error']('[%s][SYSTEM]\x20%s',_0x1f08c3,_['isObject'](_0x20f29e)?JSON['stringify'](_0x20f29e):_0x20f29e);logger[_0xf4fe('0xe')](_0xf4fe('0x18'),_0x1f08c3);_0x302560['next']();}};}; \ No newline at end of file +var _0x0a67=['[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','[%s][SYSTEM]\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','info','getMustacheRender','exec','trim'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0a67,0x1c4));var _0x70a6=function(_0x20bb64,_0x1207b7){_0x20bb64=_0x20bb64-0x0;var _0xf9de0a=_0x0a67[_0x20bb64];return _0xf9de0a;};'use strict';var schema=require(_0x70a6('0x0'));var sh=require(_0x70a6('0x1'));var _=require(_0x70a6('0x2'));var utils=require(_0x70a6('0x3'));var logger=require('../../../../config/logger')(_0x70a6('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0x70a6('0x5')}});exports[_0x70a6('0x6')]=function(_0x47c00b,_0x4828e2){return function(_0x2500fd){try{var _0x4581a6={'command':_0x4828e2[0x0]};var _0x590819=system[_0x70a6('0x0')](_0x4581a6,{'typecast':!![]});if(_0x590819[_0x70a6('0x7')]){logger[_0x70a6('0x8')]('[%s][SYSTEM]\x20%s',_0x47c00b,_[_0x70a6('0x9')](_0x590819,_0x70a6('0xa'))[_0x70a6('0xb')](',\x20'));logger[_0x70a6('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x47c00b);_0x2500fd['next']();}else{var _0x365cd6=this;var _0x268fde=utils[_0x70a6('0xd')](_0x4828e2[0x0],this);logger[_0x70a6('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x47c00b,_0x268fde);sh[_0x70a6('0xe')](_[_0x70a6('0xf')](_0x268fde),function(_0x22825e,_0x3f8b96){logger['info'](_0x70a6('0x10'),_0x47c00b,_0x22825e);if(_0x22825e==0x0){var _0x561a7d=_0x3f8b96['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x70a6('0x11')](_0x4828e2[0x1])||_[_0x70a6('0x12')](_0x4828e2[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x47c00b);_0x365cd6[_0x70a6('0x13')][_0x4828e2[0x1]]=_0x561a7d;}else{logger[_0x70a6('0xc')](_0x70a6('0x14'),_0x47c00b,_0x4828e2[0x1],_0x561a7d);_0x365cd6['body'][_0x4828e2[0x1]]=_0x561a7d;}}_0x2500fd[_0x70a6('0x15')]();});}}catch(_0x2a6647){logger[_0x70a6('0x8')](_0x70a6('0x16'),_0x47c00b,_[_0x70a6('0x17')](_0x2a6647)?JSON[_0x70a6('0x18')](_0x2a6647):_0x2a6647);logger[_0x70a6('0xc')](_0x70a6('0x19'),_0x47c00b);_0x2500fd[_0x70a6('0x15')]();}};}; \ 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 dd00239..d681d16 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 _0x47a5=['length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','catch','stringify','finally','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x2332d8,_0x4409a5){var _0x29bc16=function(_0x40eda8){while(--_0x40eda8){_0x2332d8['push'](_0x2332d8['shift']());}};_0x29bc16(++_0x4409a5);}(_0x47a5,0x7d));var _0x547a=function(_0x4b1c95,_0x3ac1ad){_0x4b1c95=_0x4b1c95-0x0;var _0x5d4d3b=_0x47a5[_0x4b1c95];return _0x5d4d3b;};'use strict';var schema=require(_0x547a('0x0'));var _=require(_0x547a('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x547a('0x2')),'smsInteraction':require(_0x547a('0x3')),'mailInteraction':require(_0x547a('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x547a('0x5'))};var logger=require(_0x547a('0x6'))(_0x547a('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x547a('0x8')}});exports[_0x547a('0x9')]=function(_0x39deed,_0xea2a24,_0x46f7eb,_0x2da0f8){return function(_0x3721ed){try{var _0x616c0={'tag':_0xea2a24[0x0]};var _0x230f83=tag['validate'](_0x616c0,{'typecast':!![]});if(_0x230f83[_0x547a('0xa')]){logger[_0x547a('0xb')](_0x547a('0xc'),_0x39deed,_[_0x547a('0xd')](_0x230f83,_0x547a('0xe'))[_0x547a('0xf')](',\x20'));logger[_0x547a('0x10')](_0x547a('0x11'),_0x39deed);_0x3721ed[_0x547a('0x12')]();}else{var _0x498707={'ids':[_0xea2a24[0x0]]};if(rpc[_0x2da0f8[_0x547a('0x13')]+'Interaction']){rpc[_0x2da0f8[_0x547a('0x13')]+_0x547a('0x14')][_0x547a('0x15')](_0x2da0f8['interaction']['id'],_0x498707)['then'](function(_0x266f10){logger[_0x547a('0x10')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x39deed,_0xea2a24[0x1],_0x2da0f8[_0x547a('0x13')],_0x2da0f8[_0x547a('0x16')]['id']);})[_0x547a('0x17')](function(_0x48a8d0){logger[_0x547a('0xb')](_0x547a('0xc'),_0x39deed,JSON[_0x547a('0x18')](_0x48a8d0));logger['info'](_0x547a('0x11'),_0x39deed);})[_0x547a('0x19')](function(){_0x3721ed[_0x547a('0x12')]();});}}}catch(_0x8bf29){logger[_0x547a('0xb')](_0x547a('0xc'),_0x39deed,_[_0x547a('0x1a')](_0x8bf29)?JSON[_0x547a('0x18')](_0x8bf29):_0x8bf29);logger[_0x547a('0x10')](_0x547a('0x11'),_0x39deed);_0x3721ed[_0x547a('0x12')]();}};}; \ No newline at end of file +var _0xa7bb=['error','finally','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','catch'];(function(_0x3104f0,_0x4239da){var _0x4d4c80=function(_0x41552b){while(--_0x41552b){_0x3104f0['push'](_0x3104f0['shift']());}};_0x4d4c80(++_0x4239da);}(_0xa7bb,0x12f));var _0xba7b=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xa7bb[_0x3de8a4];return _0x4635cf;};'use strict';var schema=require(_0xba7b('0x0'));var _=require(_0xba7b('0x1'));var rpc={'chatInteraction':require(_0xba7b('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xba7b('0x3')),'faxInteraction':require(_0xba7b('0x4')),'whatsappInteraction':require(_0xba7b('0x5'))};var logger=require('../../../../config/logger')(_0xba7b('0x6'));var tag=schema({'tag':{'type':_0xba7b('0x7'),'required':!![],'message':_0xba7b('0x8')}});exports[_0xba7b('0x9')]=function(_0x1720cf,_0x34c292,_0x3a77c4,_0x1f63cb){return function(_0x41de59){try{var _0x183c9e={'tag':_0x34c292[0x0]};var _0x3cd32f=tag[_0xba7b('0x0')](_0x183c9e,{'typecast':!![]});if(_0x3cd32f[_0xba7b('0xa')]){logger['error'](_0xba7b('0xb'),_0x1720cf,_[_0xba7b('0xc')](_0x3cd32f,_0xba7b('0xd'))['join'](',\x20'));logger[_0xba7b('0xe')](_0xba7b('0xf'),_0x1720cf);_0x41de59[_0xba7b('0x10')]();}else{var _0x4dfc1e={'ids':[_0x34c292[0x0]]};if(rpc[_0x1f63cb[_0xba7b('0x11')]+_0xba7b('0x12')]){rpc[_0x1f63cb[_0xba7b('0x11')]+_0xba7b('0x12')][_0xba7b('0x13')](_0x1f63cb[_0xba7b('0x14')]['id'],_0x4dfc1e)['then'](function(_0x156fc8){logger[_0xba7b('0xe')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x1720cf,_0x34c292[0x1],_0x1f63cb[_0xba7b('0x11')],_0x1f63cb[_0xba7b('0x14')]['id']);})[_0xba7b('0x15')](function(_0x484aa8){logger[_0xba7b('0x16')]('[%s][TAG]\x20%s',_0x1720cf,JSON['stringify'](_0x484aa8));logger[_0xba7b('0xe')](_0xba7b('0xf'),_0x1720cf);})[_0xba7b('0x17')](function(){_0x41de59[_0xba7b('0x10')]();});}}}catch(_0x53cea9){logger['error'](_0xba7b('0xb'),_0x1720cf,_['isObject'](_0x53cea9)?JSON[_0xba7b('0x18')](_0x53cea9):_0x53cea9);logger[_0xba7b('0xe')](_0xba7b('0xf'),_0x1720cf);_0x41de59['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 2ade494..dc2f62b 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 _0xa697=['info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','consequence','replace','includes','push','?params=','urlOnRing','jsonrpc','2.0','method','login','stringify','utf8','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data='];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xa697,0xa7));var _0x7a69=function(_0x356d68,_0x5a7864){_0x356d68=_0x356d68-0x0;var _0x1faccd=_0xa697[_0x356d68];return _0x1faccd;};'use strict';var rp=require(_0x7a69('0x0'));var logger=require(_0x7a69('0x1'))(_0x7a69('0x2'));var _=require('lodash');var arr=[];exports[_0x7a69('0x3')]=function(_0x2072d3,_0x4afd9f){return function(_0x5a3623){var _0x5582ab=_0x4afd9f[0xa];var _0x2ba5b1=_0x4afd9f[0xb];var _0x42d38a=_0x4afd9f[0xc];var _0x28b4a2=_0x4afd9f[0xd];var _0x3e8509=_0x4afd9f[0xe];var _0x37fcea=_0x4afd9f[0xf][_0x7a69('0x4')](/\n/g,'\x20-\x20');var _0x4b1f21=_0x4afd9f[0x10][_0x7a69('0x4')](/\n/g,'\x20');if(!arr[_0x7a69('0x5')](_0x2ba5b1)){arr[_0x7a69('0x6')](_0x2ba5b1);var _0x3c3c26=_0x4afd9f[0x3];var _0x3e5048=_0x4afd9f[0x4];var _0x556f1d=_0x4afd9f[0x1];var _0x286081=_0x4afd9f[0x0];var _0x45c8d2={};_0x45c8d2['urlOnAnswer']=_0x4afd9f[0x8]+_0x7a69('0x7')+_0x42d38a+'|'+_0x5582ab+'|'+_0x28b4a2+'|'+_0x2ba5b1+'|'+_0x3e8509;_0x45c8d2[_0x7a69('0x8')]=_0x4afd9f[0x7]+_0x7a69('0x7')+_0x42d38a+'|'+_0x5582ab+'|'+_0x28b4a2+'|'+_0x2ba5b1+'|'+_0x3e8509+'|'+_0x37fcea+'|'+_0x4b1f21;_0x45c8d2['title']=_0x4afd9f[0x9];var _0x4f1548={};_0x4f1548[_0x7a69('0x9')]=_0x7a69('0xa');_0x4f1548[_0x7a69('0xb')]=_0x7a69('0xc');var _0xc31736=[];_0xc31736[_0x7a69('0x6')](_0x4afd9f[0x2]);_0xc31736[_0x7a69('0x6')](_0x4afd9f[0x5]);_0xc31736[_0x7a69('0x6')](_0x4afd9f[0x6]);_0x4f1548['params']=_0xc31736;_0x4f1548['id']=0x1;var _0x33acf3=JSON[_0x7a69('0xd')](_0x4f1548);var _0x2314c7={'encoding':_0x7a69('0xe'),'method':'POST','timeout':0x2710,'url':_0x3c3c26,'headers':{'Content-Type':_0x7a69('0xf')},'body':_0x33acf3};return rp(_0x2314c7)[_0x7a69('0x10')](function(_0x100fd2){const _0x8ae0aa=JSON[_0x7a69('0x11')](_0x100fd2);if(!_0x8ae0aa[_0x7a69('0x12')][_0x7a69('0x13')]){throw new Error(_0x7a69('0x14'));}var _0x45d94e=_0x2ba5b1;var _0x46799c=_0x7a69('0x15')+_0x556f1d+_0x7a69('0x16')+_0x286081+_0x7a69('0x17')+_0x45d94e+_0x7a69('0x18')+JSON['stringify'](_0x45c8d2);var _0x5d41c6=_0x3e5048+'?'+_0x46799c;return rp(_0x5d41c6);})[_0x7a69('0x10')](function(_0x573491){logger[_0x7a69('0x19')](_0x7a69('0x1a'),_0x2072d3,_0x573491);_0x5a3623[_0x7a69('0x1b')]();})[_0x7a69('0x1c')](function(_0x4dc32a){logger['error'](_0x7a69('0x1d'),_0x2072d3,_[_0x7a69('0x1e')](_0x4dc32a)?JSON[_0x7a69('0xd')](_0x4dc32a):_0x4dc32a);_0x5a3623[_0x7a69('0x1b')]();});}else{logger[_0x7a69('0x19')](_0x7a69('0x1f'),_0x2072d3);_0x5a3623['next']();}};}; \ No newline at end of file +var _0xb369=['logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','push','?params=','urlOnRing','title','jsonrpc','method','login','stringify','utf8','POST','application/json-rpc','then','parse','result'];(function(_0x3c359c,_0x2d2717){var _0xa31396=function(_0x41ba2a){while(--_0x41ba2a){_0x3c359c['push'](_0x3c359c['shift']());}};_0xa31396(++_0x2d2717);}(_0xb369,0xd2));var _0x9b36=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb369[_0x122ef9];return _0x42fba0;};'use strict';var rp=require(_0x9b36('0x0'));var logger=require(_0x9b36('0x1'))(_0x9b36('0x2'));var _=require(_0x9b36('0x3'));var arr=[];exports[_0x9b36('0x4')]=function(_0x1debe1,_0x14dcb0){return function(_0x39e052){var _0x19beb7=_0x14dcb0[0xa];var _0x24f7b9=_0x14dcb0[0xb];var _0x57cd3d=_0x14dcb0[0xc];var _0x4dea1e=_0x14dcb0[0xd];var _0x47a593=_0x14dcb0[0xe];var _0x5bba77=_0x14dcb0[0xf][_0x9b36('0x5')](/\n/g,_0x9b36('0x6'));var _0x2551d0=_0x14dcb0[0x10][_0x9b36('0x5')](/\n/g,'\x20');if(!arr['includes'](_0x24f7b9)){arr[_0x9b36('0x7')](_0x24f7b9);var _0x3b54cd=_0x14dcb0[0x3];var _0x236f58=_0x14dcb0[0x4];var _0x38879a=_0x14dcb0[0x1];var _0x33408f=_0x14dcb0[0x0];var _0x4ba595={};_0x4ba595['urlOnAnswer']=_0x14dcb0[0x8]+_0x9b36('0x8')+_0x57cd3d+'|'+_0x19beb7+'|'+_0x4dea1e+'|'+_0x24f7b9+'|'+_0x47a593;_0x4ba595[_0x9b36('0x9')]=_0x14dcb0[0x7]+'?params='+_0x57cd3d+'|'+_0x19beb7+'|'+_0x4dea1e+'|'+_0x24f7b9+'|'+_0x47a593+'|'+_0x5bba77+'|'+_0x2551d0;_0x4ba595[_0x9b36('0xa')]=_0x14dcb0[0x9];var _0x14c86a={};_0x14c86a[_0x9b36('0xb')]='2.0';_0x14c86a[_0x9b36('0xc')]=_0x9b36('0xd');var _0x5766f8=[];_0x5766f8[_0x9b36('0x7')](_0x14dcb0[0x2]);_0x5766f8[_0x9b36('0x7')](_0x14dcb0[0x5]);_0x5766f8[_0x9b36('0x7')](_0x14dcb0[0x6]);_0x14c86a['params']=_0x5766f8;_0x14c86a['id']=0x1;var _0x6f8b8e=JSON[_0x9b36('0xe')](_0x14c86a);var _0x1973e7={'encoding':_0x9b36('0xf'),'method':_0x9b36('0x10'),'timeout':0x2710,'url':_0x3b54cd,'headers':{'Content-Type':_0x9b36('0x11')},'body':_0x6f8b8e};return rp(_0x1973e7)[_0x9b36('0x12')](function(_0x11362b){const _0x107cc3=JSON[_0x9b36('0x13')](_0x11362b);if(!_0x107cc3[_0x9b36('0x14')][_0x9b36('0x15')]){throw new Error(_0x9b36('0x16'));}var _0x4d3abc=_0x24f7b9;var _0x149a3e='channelId='+_0x38879a+'&serviceId='+_0x33408f+_0x9b36('0x17')+_0x4d3abc+_0x9b36('0x18')+JSON[_0x9b36('0xe')](_0x4ba595);var _0x7e8c41=_0x236f58+'?'+_0x149a3e;return rp(_0x7e8c41);})[_0x9b36('0x12')](function(_0x16b5d8){logger[_0x9b36('0x19')](_0x9b36('0x1a'),_0x1debe1,_0x16b5d8);_0x39e052[_0x9b36('0x1b')]();})[_0x9b36('0x1c')](function(_0x553b71){logger[_0x9b36('0x1d')](_0x9b36('0x1e'),_0x1debe1,_['isObject'](_0x553b71)?JSON['stringify'](_0x553b71):_0x553b71);_0x39e052[_0x9b36('0x1b')]();});}else{logger[_0x9b36('0x19')](_0x9b36('0x1f'),_0x1debe1);_0x39e052[_0x9b36('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 384d349..044c25d 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0xa62351,_0x4aee9e){var _0x6fa3d0=function(_0x70eae0){while(--_0x70eae0){_0xa62351['push'](_0xa62351['shift']());}};_0x6fa3d0(++_0x4aee9e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x2e7403,_0x2978d4){var _0x564d96=function(_0x227dcf){while(--_0x227dcf){_0x2e7403['push'](_0x2e7403['shift']());}};_0x564d96(++_0x2978d4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 78e9f4d..2e22220 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 _0xa8bb=['update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','stack','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','isArray','applications','existsSync','join','app','.js','autoreply','split','mail','push','length','slice','dialogflow','appdata','dialogflowv2','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','%s:%s:%s','intervals','consequence','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','matchPath','emit','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','end','QueueReport'];(function(_0x331015,_0x22ef37){var _0x40f12e=function(_0xa6390d){while(--_0xa6390d){_0x331015['push'](_0x331015['shift']());}};_0x40f12e(++_0x22ef37);}(_0xa8bb,0x1ce));var _0xba8b=function(_0x55b55f,_0x3a4fac){_0x55b55f=_0x55b55f-0x0;var _0x2f994d=_0xa8bb[_0x55b55f];return _0x2f994d;};'use strict';var _=require(_0xba8b('0x0'));var util=require(_0xba8b('0x1'));var path=require(_0xba8b('0x2'));var fs=require('fs');var jayson=require(_0xba8b('0x3'));var BPromise=require(_0xba8b('0x4'));var utils=require(_0xba8b('0x5'));var sUtils=require(_0xba8b('0x6'));var logger=require(_0xba8b('0x7'))(_0xba8b('0x8'));var rpc={'openchannelQueueReport':require(_0xba8b('0x9')),'mailQueueReport':require(_0xba8b('0xa')),'chatQueueReport':require(_0xba8b('0xb')),'smsQueueReport':require(_0xba8b('0xc')),'faxQueueReport':require(_0xba8b('0xd')),'whatsappQueueReport':require(_0xba8b('0xe'))};var RuleEngine=require(_0xba8b('0xf'));function getId(_0x4bcbf2,_0x37dd2f,_0x4e79aa){return util[_0xba8b('0x10')](_0xba8b('0x11'),_0x4bcbf2,_0x37dd2f||0x0,_0x4e79aa||0x0);}function getIntervals(_0x81b23f,_0xea1423){var _0xe028df=[];if(!_['isNil'](_0xea1423['IntervalId'])&&!_['isNil'](_0x81b23f[_0xea1423[_0xba8b('0x12')]])&&!_[_0xba8b('0x13')](_0x81b23f[_0xea1423['IntervalId']][_0xba8b('0x14')])){_0xe028df=_[_0xba8b('0x15')](_0x81b23f[_0xea1423[_0xba8b('0x12')]][_0xba8b('0x14')],_0xba8b('0x16'));}else if(!_['isNil'](_0xea1423[_0xba8b('0x16')])){_0xe028df=[_0xea1423[_0xba8b('0x16')]];}return _0xe028df;}exports[_0xba8b('0x17')]=function(_0x123545){_0x123545[_0xba8b('0x18')]={};return new BPromise(function(_0x15dabf,_0x20883e){var _0x430866={'Start':function(_0x46fee1){var _0x2a2a3e=this;return new Promise(function(_0x154a17,_0x443258){if(_0x46fee1){try{var _0x412b72=[];var _0x29e389=getId(_0x46fee1[_0xba8b('0x19')],_0x46fee1['message']?_0x46fee1[_0xba8b('0x1a')]['id']:0x0,_0x46fee1[_0xba8b('0x1b')]?_0x46fee1[_0xba8b('0x1b')]['id']:0x0);var _0x552d1e=sUtils[_0xba8b('0x1c')](_0x123545,_0x46fee1);if(!_0x552d1e&&_0x46fee1['applications']&&_[_0xba8b('0x1d')](_0x46fee1['applications'])&&_0x46fee1[_0xba8b('0x1e')]['length']){for(var _0x1e7da1=0x0;_0x1e7da1<_0x46fee1[_0xba8b('0x1e')]['length'];_0x1e7da1+=0x1){var _0x4d2408=_0x46fee1[_0xba8b('0x1e')][_0x1e7da1];if(fs[_0xba8b('0x1f')](path[_0xba8b('0x20')](__dirname,'applications',_0x4d2408[_0xba8b('0x21')]+_0xba8b('0x22')))){var _0xf3b8d8=[];switch(_0x4d2408[_0xba8b('0x21')]['toLowerCase']()){case _0xba8b('0x23'):var _0x3549db=_0x4d2408['appdata'][_0xba8b('0x24')](',');if(_0x46fee1['channel']===_0xba8b('0x25')){_0xf3b8d8[_0xba8b('0x26')](_0x3549db[0x0]);_0xf3b8d8['push'](_0x3549db[0x1]);_0xf3b8d8['push'](_0x3549db['slice'](0x2,_0x3549db[_0xba8b('0x27')])['join'](','));}else{_0xf3b8d8[_0xba8b('0x26')](_0x3549db[0x0]);_0xf3b8d8[_0xba8b('0x26')](_0x3549db[_0xba8b('0x28')](0x1,_0x3549db[_0xba8b('0x27')])['join'](','));}break;case _0xba8b('0x29'):var _0x337af7=_0x4d2408[_0xba8b('0x2a')][_0xba8b('0x24')](',');_0xf3b8d8[_0xba8b('0x26')](_0x337af7[0x0]);_0xf3b8d8['push'](_0x337af7[0x1]);_0xf3b8d8['push'](_0x337af7[_0xba8b('0x28')](0x2,_0x337af7['length'])[_0xba8b('0x20')](','));break;case _0xba8b('0x2b'):var _0x2dbf66=_0x4d2408[_0xba8b('0x2a')][_0xba8b('0x24')](',');_0xf3b8d8[_0xba8b('0x26')](_0x2dbf66[0x0]);_0xf3b8d8[_0xba8b('0x26')](_0x2dbf66[0x1]);_0xf3b8d8['push'](_0x2dbf66[0x2]);_0xf3b8d8[_0xba8b('0x26')](_0x2dbf66[0x3]);_0xf3b8d8[_0xba8b('0x26')](_0x2dbf66[_0xba8b('0x28')](0x4,_0x2dbf66[_0xba8b('0x27')])[_0xba8b('0x20')](','));break;case'amazonlex':var _0x2023dd=_0x4d2408['appdata']['split'](',');_0xf3b8d8[_0xba8b('0x26')](_0x2023dd[0x0]);_0xf3b8d8[_0xba8b('0x26')](_0x2023dd[0x1]);_0xf3b8d8[_0xba8b('0x26')](_0x2023dd[0x2]);_0xf3b8d8[_0xba8b('0x26')](_0x2023dd[0x3]);_0xf3b8d8[_0xba8b('0x26')](_0x2023dd['slice'](0x4,_0x2023dd[_0xba8b('0x27')])[_0xba8b('0x20')](','));break;case _0xba8b('0x1a'):_0xf3b8d8[_0xba8b('0x26')](_0x4d2408['appdata']);break;case _0xba8b('0x2c'):_0xf3b8d8['push'](_0x4d2408[_0xba8b('0x2d')]);_0xf3b8d8[_0xba8b('0x26')](_0x4d2408[_0xba8b('0x2a')]);break;case _0xba8b('0x2e'):var _0x5246f9=utils[_0xba8b('0x2f')](_0x46fee1[_0xba8b('0x30')][_0xba8b('0x31')],_0x46fee1);var _0x3c19dc=_0x4d2408[_0xba8b('0x2a')]['split'](',');_0xf3b8d8['push'](_0x3c19dc[0x0]);_0xf3b8d8['push'](_0x3c19dc[0x1]);_0xf3b8d8[_0xba8b('0x26')](_0x3c19dc[0x2]);_0xf3b8d8[_0xba8b('0x26')](_0x3c19dc[0x3]);_0xf3b8d8['push'](_0x3c19dc[0x4]);_0xf3b8d8['push'](_0x3c19dc[0x5]);_0xf3b8d8[_0xba8b('0x26')](_0x3c19dc[0x6]);_0xf3b8d8[_0xba8b('0x26')](_0x3c19dc[0x7]);_0xf3b8d8[_0xba8b('0x26')](_0x3c19dc[0x8]);_0xf3b8d8['push'](_0x3c19dc[0x9]);_0xf3b8d8[_0xba8b('0x26')](_0x3c19dc[0xa]);_0xf3b8d8[_0xba8b('0x26')](_0x46fee1[_0xba8b('0x1b')]['id']);_0xf3b8d8[_0xba8b('0x26')](_0x46fee1[_0xba8b('0x1a')]['id']);_0xf3b8d8['push'](_0x4d2408[_0xba8b('0x32')]);_0xf3b8d8[_0xba8b('0x26')](_0x46fee1[_0xba8b('0x1b')][_0xba8b('0x33')]);_0xf3b8d8[_0xba8b('0x26')](_0x46fee1['body']['body']);_0xf3b8d8[_0xba8b('0x26')](_0x5246f9);break;default:_0xf3b8d8=_[_0xba8b('0x13')](_0x4d2408[_0xba8b('0x2a')])?[]:_0x4d2408[_0xba8b('0x2a')][_0xba8b('0x24')](',');}var _0x29c7ce={'id':util[_0xba8b('0x10')](_0xba8b('0x34'),_0x29e389,_0x4d2408['id'],_0x4d2408[_0xba8b('0x21')]),'condition':require('./interval')['condition'](_0x29e389,getIntervals(_0x123545[_0xba8b('0x35')],_0x4d2408),_0x123545),'consequence':require('./applications/'+_0x4d2408[_0xba8b('0x21')])[_0xba8b('0x36')](_0x29e389,_0xf3b8d8,_0x123545,_0x46fee1),'p':_0x4d2408[_0xba8b('0x37')]||0x0};logger[_0xba8b('0x38')]('Push\x20new\x20rule',_0x29c7ce['id'],_0xba8b('0x39'),getIntervals(_0x123545[_0xba8b('0x35')],_0x4d2408)['join'](_0xba8b('0x3a')));_0x412b72[_0xba8b('0x26')](_0x29c7ce);}else{logger[_0xba8b('0x3b')](_0xba8b('0x3c'),path[_0xba8b('0x20')](__dirname,_0xba8b('0x1e'),_0x4d2408[_0xba8b('0x21')]+_0xba8b('0x22')));}}_0x123545[_0xba8b('0x18')][_0x29e389]=new RuleEngine(_0x412b72);_0x123545[_0xba8b('0x18')][_0x29e389][_0xba8b('0x3d')](_0x46fee1,function(_0x266e78){logger[_0xba8b('0x38')](_0xba8b('0x3e'),JSON['stringify'](_0x266e78[_0xba8b('0x3f')]));if(_0x123545[_0xba8b('0x18')][_0x29e389]){_0x123545[_0xba8b('0x18')][_0x29e389][_0xba8b('0x40')]('complete');}});return _0x154a17({'code':0xc8,'message':_0x46fee1});}else{if(_0x552d1e){logger[_0xba8b('0x38')](util[_0xba8b('0x10')](_0xba8b('0x41'),_0x29e389));}else{logger[_0xba8b('0x38')](_0xba8b('0x42'));}return _0x154a17({'code':0xc8,'message':_0x46fee1});}}catch(_0x52f9fc){logger[_0xba8b('0x3b')](_0x52f9fc['stack']);return _0x443258(_0x2a2a3e[_0xba8b('0x3b')](0x1f4,_0x52f9fc));}}return _0x443258(_0xba8b('0x43'));});},'AcceptMessage':function(_0x2212d2){var _0x459de9=this;return new Promise(function(_0x143f64,_0x2cdb3f){if(_0x2212d2[_0xba8b('0x44')]&&_0x2212d2[_0xba8b('0x44')]['id']){if(_0x123545[_0xba8b('0x45')][_0x2212d2[_0xba8b('0x44')]['id']]){_0x123545['agents'][_0x2212d2['agent']['id']][_0xba8b('0x46')]=![];_0x123545[_0xba8b('0x45')][_0x2212d2[_0xba8b('0x44')]['id']]['busyQueue']=undefined;}}if(_0x2212d2['message']&&_0x2212d2[_0xba8b('0x1a')]['id']){try{var _0x28369c=getId(_0x2212d2[_0xba8b('0x19')],_0x2212d2[_0xba8b('0x1a')]?_0x2212d2[_0xba8b('0x1a')]['id']:0x0,_0x2212d2[_0xba8b('0x1b')]?_0x2212d2['interaction']['id']:0x0);if(_0x123545['rules'][_0x28369c]){_0x123545['rules'][_0x28369c]['emit'](_0xba8b('0x47'));if(rpc[_0x2212d2['channel']+_0xba8b('0x48')]){rpc[_0x2212d2['channel']+_0xba8b('0x48')][_0xba8b('0x49')](_0x28369c,{'UserId':_0x2212d2[_0xba8b('0x1a')][_0xba8b('0x4a')]})['catch'](function(){logger[_0xba8b('0x3b')](_0xba8b('0x4b'));});}}return _0x143f64({'code':0xc8,'message':_0x2212d2});}catch(_0x119c72){logger['error'](_0x119c72['stack']);return _0x2cdb3f(_0x459de9[_0xba8b('0x3b')](0x1f4,_0x119c72));}}logger[_0xba8b('0x3b')]('message\x20is\x20empty');return _0x2cdb3f(_0x459de9[_0xba8b('0x3b')](0x1f4,_0xba8b('0x4c')));});},'RejectMessage':function(_0x5b1409){var _0x4f2ee3=this;return new Promise(function(_0x12c6b7,_0x11aea9){if(_0x5b1409[_0xba8b('0x44')]&&_0x5b1409[_0xba8b('0x44')]['id']){try{if(_0x123545[_0xba8b('0x45')][_0x5b1409['agent']['id']]){_0x123545[_0xba8b('0x45')][_0x5b1409[_0xba8b('0x44')]['id']][_0xba8b('0x46')]=![];_0x123545[_0xba8b('0x45')][_0x5b1409[_0xba8b('0x44')]['id']][_0xba8b('0x4d')]=undefined;}return _0x12c6b7({'code':0xc8,'message':_0x5b1409});}catch(_0x7a23e){logger[_0xba8b('0x3b')](_0x7a23e[_0xba8b('0x4e')]);return _0x11aea9(_0x4f2ee3[_0xba8b('0x3b')](0x1f4,_0x7a23e));}}logger[_0xba8b('0x3b')](_0xba8b('0x4c'));return _0x11aea9(_0x4f2ee3['error'](0x1f4,_0xba8b('0x4c')));});},'AbandonInteraction':function(_0x47562e){var _0x137df6=this;return new Promise(function(_0xd44f32,_0x23e1c9){if(_0x47562e[_0xba8b('0x19')]&&_0x47562e['interaction']&&_0x47562e[_0xba8b('0x1b')]['id']){try{var _0x354b86=getId(_0x47562e[_0xba8b('0x19')],_0x47562e[_0xba8b('0x1a')]?_0x47562e[_0xba8b('0x1a')]['id']:0x0,_0x47562e[_0xba8b('0x1b')]?_0x47562e[_0xba8b('0x1b')]['id']:0x0);if(_0x123545[_0xba8b('0x18')][_0x354b86]){_0x123545[_0xba8b('0x18')][_0x354b86][_0xba8b('0x40')]('end');}return _0xd44f32({'code':0xc8,'message':_0x47562e});}catch(_0x4affb6){logger[_0xba8b('0x3b')](_0x4affb6['stack']);return _0x23e1c9(_0x137df6['error'](0x1f4,_0x4affb6));}}logger[_0xba8b('0x3b')]('message\x20is\x20empty');return _0x23e1c9(_0x137df6[_0xba8b('0x3b')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x5069d1){var _0x39629e=this;return new Promise(function(_0x6fb35f,_0x31a718){if(_0x123545['agents'][_0xba8b('0x4f')](_0x5069d1['id'])){for(var _0x5897c1 in _0x5069d1[_0xba8b('0x50')]){if(_0x5069d1['capacity']['hasOwnProperty'](_0x5897c1)){if(_0x123545[_0xba8b('0x45')][_0x5069d1['id']][_0xba8b('0x4f')](_0x5897c1+_0xba8b('0x51'))){_0x123545[_0xba8b('0x45')][_0x5069d1['id']][_0x5897c1+_0xba8b('0x51')]=parseInt(_0x5069d1[_0xba8b('0x50')][_0x5897c1],0xa);}}}_0x123545[_0xba8b('0x45')][_0x5069d1['id']][_0xba8b('0x52')]();return _0x6fb35f({'code':0xc8,'message':_0x123545['agents'][_0x5069d1['id']]});}else{return _0x31a718(_0x39629e[_0xba8b('0x3b')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2319d5){return new Promise(function(_0x5aa00a){var _0x1ec52b=_[_0xba8b('0x53')](_0x123545[_0xba8b('0x45')]);if(_0x2319d5&&_0x2319d5['id']){var _0x29a696=_[_0xba8b('0x54')](_0x1ec52b,function(_0x5e7c61){return _0x5e7c61['id']===_0x2319d5['id'];});_0x5aa00a(_0x29a696);}else{_0x5aa00a({'count':_0x1ec52b[_0xba8b('0x27')],'rows':_0x1ec52b});}});},'ChatQueues':function(){return new Promise(function(_0x35244c){var _0x377bbf=[];for(var _0x205901 in _0x123545[_0xba8b('0x55')]){if(_0x123545['chatQueues'][_0xba8b('0x4f')](_0x205901)){var _0xc2c101=_0x123545[_0xba8b('0x55')][_0x205901];var _0x434e01={'id':_0xc2c101['id'],'available':_0xc2c101['available'],'loggedIn':_0xc2c101[_0xba8b('0x56')],'name':_0xc2c101[_0xba8b('0x57')],'paused':_0xc2c101[_0xba8b('0x58')],'waiting':_0xc2c101[_0xba8b('0x59')]};_0x377bbf[_0xba8b('0x26')](_0x434e01);}}_0x35244c({'count':_0x377bbf[_0xba8b('0x27')],'rows':_0x377bbf});});},'MailQueues':function(){return new Promise(function(_0x20911b){var _0x446bcf=[];for(var _0x4d4915 in _0x123545['mailQueues']){if(_0x123545[_0xba8b('0x5a')]['hasOwnProperty'](_0x4d4915)){var _0x331ce4=_0x123545[_0xba8b('0x5a')][_0x4d4915];var _0xd60a1f={'id':_0x331ce4['id'],'available':_0x331ce4[_0xba8b('0x5b')],'loggedIn':_0x331ce4[_0xba8b('0x56')],'name':_0x331ce4[_0xba8b('0x57')],'paused':_0x331ce4['paused'],'waiting':_0x331ce4['waiting']};_0x446bcf[_0xba8b('0x26')](_0xd60a1f);}}_0x20911b({'count':_0x446bcf[_0xba8b('0x27')],'rows':_0x446bcf});});},'OpenchannelQueues':function(){return new Promise(function(_0x36b5ab){var _0x24e89c=[];for(var _0x1729d4 in _0x123545[_0xba8b('0x5c')]){if(_0x123545['openchannelQueues'][_0xba8b('0x4f')](_0x1729d4)){var _0xc6f96b=_0x123545[_0xba8b('0x5c')][_0x1729d4];var _0x4a596b={'id':_0xc6f96b['id'],'available':_0xc6f96b[_0xba8b('0x5b')],'loggedIn':_0xc6f96b[_0xba8b('0x56')],'name':_0xc6f96b[_0xba8b('0x57')],'paused':_0xc6f96b[_0xba8b('0x58')],'waiting':_0xc6f96b[_0xba8b('0x59')]};_0x24e89c[_0xba8b('0x26')](_0x4a596b);}}_0x36b5ab({'count':_0x24e89c[_0xba8b('0x27')],'rows':_0x24e89c});});},'SmsQueues':function(){return new Promise(function(_0x67dd0e){var _0x21bee0=[];for(var _0x4e7eb7 in _0x123545[_0xba8b('0x5d')]){if(_0x123545['smsQueues']['hasOwnProperty'](_0x4e7eb7)){var _0x37efa7=_0x123545['smsQueues'][_0x4e7eb7];var _0x167759={'id':_0x37efa7['id'],'available':_0x37efa7[_0xba8b('0x5b')],'loggedIn':_0x37efa7[_0xba8b('0x56')],'name':_0x37efa7['name'],'paused':_0x37efa7['paused'],'waiting':_0x37efa7[_0xba8b('0x59')]};_0x21bee0[_0xba8b('0x26')](_0x167759);}}_0x67dd0e({'count':_0x21bee0['length'],'rows':_0x21bee0});});},'FaxQueues':function(){return new Promise(function(_0xfa03e0){var _0x1fa58b=[];for(var _0x2474ab in _0x123545['faxQueues']){if(_0x123545[_0xba8b('0x5e')][_0xba8b('0x4f')](_0x2474ab)){var _0x58f56e=_0x123545[_0xba8b('0x5e')][_0x2474ab];var _0x960d9a={'id':_0x58f56e['id'],'available':_0x58f56e[_0xba8b('0x5b')],'loggedIn':_0x58f56e[_0xba8b('0x56')],'name':_0x58f56e['name'],'paused':_0x58f56e[_0xba8b('0x58')],'waiting':_0x58f56e[_0xba8b('0x59')]};_0x1fa58b[_0xba8b('0x26')](_0x960d9a);}}_0xfa03e0({'count':_0x1fa58b[_0xba8b('0x27')],'rows':_0x1fa58b});});},'WhatsappQueues':function(){return new Promise(function(_0x295a6e){var _0x312129=[];for(var _0xb886ec in _0x123545[_0xba8b('0x5f')]){if(_0x123545['whatsappQueues'][_0xba8b('0x4f')](_0xb886ec)){var _0x20c0b9=_0x123545[_0xba8b('0x5f')][_0xb886ec];var _0x3e5775={'id':_0x20c0b9['id'],'available':_0x20c0b9[_0xba8b('0x5b')],'loggedIn':_0x20c0b9['loggedIn'],'name':_0x20c0b9[_0xba8b('0x57')],'paused':_0x20c0b9[_0xba8b('0x58')],'waiting':_0x20c0b9[_0xba8b('0x59')]};_0x312129[_0xba8b('0x26')](_0x3e5775);}}_0x295a6e({'count':_0x312129[_0xba8b('0x27')],'rows':_0x312129});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x4f237b){var _0x4b4a9b=_[_0xba8b('0x53')](_0x123545[_0xba8b('0x60')]);_0x4f237b({'count':_0x4b4a9b[_0xba8b('0x27')],'rows':_0x4b4a9b});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x23efe7){var _0x2af13e=_['values'](_0x123545[_0xba8b('0x61')]);_0x23efe7({'count':_0x2af13e[_0xba8b('0x27')],'rows':_0x2af13e});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x780083){var _0x7349fd=_[_0xba8b('0x53')](_0x123545['openchannelQueuesWaitingInteractions']);_0x780083({'count':_0x7349fd['length'],'rows':_0x7349fd});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x28f505){var _0x44386d=_['values'](_0x123545[_0xba8b('0x62')]);_0x28f505({'count':_0x44386d[_0xba8b('0x27')],'rows':_0x44386d});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x46ffb1){var _0x41f506=_['values'](_0x123545[_0xba8b('0x63')]);_0x46ffb1({'count':_0x41f506[_0xba8b('0x27')],'rows':_0x41f506});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x55373d){var _0x113985=_[_0xba8b('0x53')](_0x123545[_0xba8b('0x64')]);_0x55373d({'count':_0x113985[_0xba8b('0x27')],'rows':_0x113985});});}};var _0x156767=jayson[_0xba8b('0x65')](_0x430866)[_0xba8b('0x66')]();_0x156767['on']('error',function(_0x5b6065){logger[_0xba8b('0x3b')](JSON[_0xba8b('0x67')](_0x5b6065));return _0x20883e(_0x5b6065);});_0x156767[_0xba8b('0x17')](0x232c,_0xba8b('0x68'),function(){console[_0xba8b('0x69')](_0xba8b('0x6a'),0x232c);return _0x15dabf('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x7521=['path','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','.js','app','toLowerCase','autoreply','split','channel','mail','push','slice','appdata','dialogflowv2','amazonlex','TagId','account','notificationTemplate','ChatWebsiteId','body','format','%s:%s:%s','condition','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Applications\x20executed','stringify','routing\x20is\x20empty','agent','agents','busyQueue','emit','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','end','stack','capacity','hasOwnProperty','updateRealtime','agent\x20not\x20found','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util'];(function(_0x5b8b97,_0x6b4dfa){var _0x1fdf84=function(_0x2ced4c){while(--_0x2ced4c){_0x5b8b97['push'](_0x5b8b97['shift']());}};_0x1fdf84(++_0x6b4dfa);}(_0x7521,0x1e4));var _0x1752=function(_0x41a9bc,_0x51c3ae){_0x41a9bc=_0x41a9bc-0x0;var _0x51e435=_0x7521[_0x41a9bc];return _0x51e435;};'use strict';var _=require('lodash');var util=require(_0x1752('0x0'));var path=require(_0x1752('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x1752('0x2'));var utils=require(_0x1752('0x3'));var sUtils=require(_0x1752('0x4'));var logger=require(_0x1752('0x5'))(_0x1752('0x6'));var rpc={'openchannelQueueReport':require(_0x1752('0x7')),'mailQueueReport':require(_0x1752('0x8')),'chatQueueReport':require(_0x1752('0x9')),'smsQueueReport':require(_0x1752('0xa')),'faxQueueReport':require(_0x1752('0xb')),'whatsappQueueReport':require(_0x1752('0xc'))};var RuleEngine=require(_0x1752('0xd'));function getId(_0x2139b5,_0x1d6011,_0xadf43b){return util['format'](_0x1752('0xe'),_0x2139b5,_0x1d6011||0x0,_0xadf43b||0x0);}function getIntervals(_0x3c7cc5,_0x55e09d){var _0x296b8a=[];if(!_[_0x1752('0xf')](_0x55e09d[_0x1752('0x10')])&&!_['isNil'](_0x3c7cc5[_0x55e09d[_0x1752('0x10')]])&&!_[_0x1752('0xf')](_0x3c7cc5[_0x55e09d['IntervalId']][_0x1752('0x11')])){_0x296b8a=_[_0x1752('0x12')](_0x3c7cc5[_0x55e09d[_0x1752('0x10')]]['Intervals'],_0x1752('0x13'));}else if(!_[_0x1752('0xf')](_0x55e09d[_0x1752('0x13')])){_0x296b8a=[_0x55e09d[_0x1752('0x13')]];}return _0x296b8a;}exports[_0x1752('0x14')]=function(_0x4d0784){_0x4d0784[_0x1752('0x15')]={};return new BPromise(function(_0x1c4787,_0x375969){var _0x57e07a={'Start':function(_0x42d560){var _0x2bbb8c=this;return new Promise(function(_0x4d170a,_0x229ad0){if(_0x42d560){try{var _0x13c236=[];var _0x2d0f8e=getId(_0x42d560['channel'],_0x42d560[_0x1752('0x16')]?_0x42d560[_0x1752('0x16')]['id']:0x0,_0x42d560[_0x1752('0x17')]?_0x42d560[_0x1752('0x17')]['id']:0x0);var _0x70cea0=sUtils['checkWaitingNotifications'](_0x4d0784,_0x42d560);if(!_0x70cea0&&_0x42d560[_0x1752('0x18')]&&_[_0x1752('0x19')](_0x42d560[_0x1752('0x18')])&&_0x42d560['applications'][_0x1752('0x1a')]){for(var _0x56c0a5=0x0;_0x56c0a5<_0x42d560[_0x1752('0x18')][_0x1752('0x1a')];_0x56c0a5+=0x1){var _0x564a49=_0x42d560['applications'][_0x56c0a5];if(fs[_0x1752('0x1b')](path[_0x1752('0x1c')](__dirname,_0x1752('0x18'),_0x564a49['app']+_0x1752('0x1d')))){var _0x1ba0a5=[];switch(_0x564a49[_0x1752('0x1e')][_0x1752('0x1f')]()){case _0x1752('0x20'):var _0x165131=_0x564a49['appdata'][_0x1752('0x21')](',');if(_0x42d560[_0x1752('0x22')]===_0x1752('0x23')){_0x1ba0a5[_0x1752('0x24')](_0x165131[0x0]);_0x1ba0a5[_0x1752('0x24')](_0x165131[0x1]);_0x1ba0a5[_0x1752('0x24')](_0x165131[_0x1752('0x25')](0x2,_0x165131['length'])[_0x1752('0x1c')](','));}else{_0x1ba0a5[_0x1752('0x24')](_0x165131[0x0]);_0x1ba0a5[_0x1752('0x24')](_0x165131[_0x1752('0x25')](0x1,_0x165131[_0x1752('0x1a')])[_0x1752('0x1c')](','));}break;case'dialogflow':var _0xefe1dc=_0x564a49[_0x1752('0x26')][_0x1752('0x21')](',');_0x1ba0a5[_0x1752('0x24')](_0xefe1dc[0x0]);_0x1ba0a5[_0x1752('0x24')](_0xefe1dc[0x1]);_0x1ba0a5[_0x1752('0x24')](_0xefe1dc[_0x1752('0x25')](0x2,_0xefe1dc[_0x1752('0x1a')])['join'](','));break;case _0x1752('0x27'):var _0xe081c2=_0x564a49[_0x1752('0x26')]['split'](',');_0x1ba0a5[_0x1752('0x24')](_0xe081c2[0x0]);_0x1ba0a5[_0x1752('0x24')](_0xe081c2[0x1]);_0x1ba0a5[_0x1752('0x24')](_0xe081c2[0x2]);_0x1ba0a5['push'](_0xe081c2[0x3]);_0x1ba0a5['push'](_0xe081c2['slice'](0x4,_0xe081c2[_0x1752('0x1a')])[_0x1752('0x1c')](','));break;case _0x1752('0x28'):var _0x145e73=_0x564a49[_0x1752('0x26')]['split'](',');_0x1ba0a5['push'](_0x145e73[0x0]);_0x1ba0a5['push'](_0x145e73[0x1]);_0x1ba0a5[_0x1752('0x24')](_0x145e73[0x2]);_0x1ba0a5['push'](_0x145e73[0x3]);_0x1ba0a5[_0x1752('0x24')](_0x145e73[_0x1752('0x25')](0x4,_0x145e73[_0x1752('0x1a')])[_0x1752('0x1c')](','));break;case'message':_0x1ba0a5['push'](_0x564a49[_0x1752('0x26')]);break;case'tag':_0x1ba0a5[_0x1752('0x24')](_0x564a49[_0x1752('0x29')]);_0x1ba0a5[_0x1752('0x24')](_0x564a49[_0x1752('0x26')]);break;case'tvox':var _0x15a4a0=utils['getMustacheRender'](_0x42d560[_0x1752('0x2a')][_0x1752('0x2b')],_0x42d560);var _0x36ac7c=_0x564a49[_0x1752('0x26')][_0x1752('0x21')](',');_0x1ba0a5['push'](_0x36ac7c[0x0]);_0x1ba0a5['push'](_0x36ac7c[0x1]);_0x1ba0a5['push'](_0x36ac7c[0x2]);_0x1ba0a5[_0x1752('0x24')](_0x36ac7c[0x3]);_0x1ba0a5[_0x1752('0x24')](_0x36ac7c[0x4]);_0x1ba0a5[_0x1752('0x24')](_0x36ac7c[0x5]);_0x1ba0a5[_0x1752('0x24')](_0x36ac7c[0x6]);_0x1ba0a5[_0x1752('0x24')](_0x36ac7c[0x7]);_0x1ba0a5[_0x1752('0x24')](_0x36ac7c[0x8]);_0x1ba0a5['push'](_0x36ac7c[0x9]);_0x1ba0a5[_0x1752('0x24')](_0x36ac7c[0xa]);_0x1ba0a5[_0x1752('0x24')](_0x42d560['interaction']['id']);_0x1ba0a5[_0x1752('0x24')](_0x42d560[_0x1752('0x16')]['id']);_0x1ba0a5[_0x1752('0x24')](_0x564a49[_0x1752('0x2c')]);_0x1ba0a5[_0x1752('0x24')](_0x42d560[_0x1752('0x17')]['ContactId']);_0x1ba0a5[_0x1752('0x24')](_0x42d560[_0x1752('0x2d')][_0x1752('0x2d')]);_0x1ba0a5[_0x1752('0x24')](_0x15a4a0);break;default:_0x1ba0a5=_[_0x1752('0xf')](_0x564a49['appdata'])?[]:_0x564a49[_0x1752('0x26')]['split'](',');}var _0x21741b={'id':util[_0x1752('0x2e')](_0x1752('0x2f'),_0x2d0f8e,_0x564a49['id'],_0x564a49[_0x1752('0x1e')]),'condition':require('./interval')[_0x1752('0x30')](_0x2d0f8e,getIntervals(_0x4d0784['intervals'],_0x564a49),_0x4d0784),'consequence':require(_0x1752('0x31')+_0x564a49[_0x1752('0x1e')])['consequence'](_0x2d0f8e,_0x1ba0a5,_0x4d0784,_0x42d560),'p':_0x564a49[_0x1752('0x32')]||0x0};logger[_0x1752('0x33')](_0x1752('0x34'),_0x21741b['id'],_0x1752('0x35'),getIntervals(_0x4d0784['intervals'],_0x564a49)['join'](_0x1752('0x36')));_0x13c236[_0x1752('0x24')](_0x21741b);}else{logger[_0x1752('0x37')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x1752('0x1c')](__dirname,_0x1752('0x18'),_0x564a49[_0x1752('0x1e')]+_0x1752('0x1d')));}}_0x4d0784[_0x1752('0x15')][_0x2d0f8e]=new RuleEngine(_0x13c236);_0x4d0784[_0x1752('0x15')][_0x2d0f8e]['execute'](_0x42d560,function(_0x12b1c7){logger[_0x1752('0x33')](_0x1752('0x38'),JSON[_0x1752('0x39')](_0x12b1c7['matchPath']));if(_0x4d0784[_0x1752('0x15')][_0x2d0f8e]){_0x4d0784[_0x1752('0x15')][_0x2d0f8e]['emit']('complete');}});return _0x4d170a({'code':0xc8,'message':_0x42d560});}else{if(_0x70cea0){logger[_0x1752('0x33')](util['format']('Skipped\x20routing\x20for\x20%s',_0x2d0f8e));}else{logger[_0x1752('0x33')]('No\x20applications\x20to\x20execute');}return _0x4d170a({'code':0xc8,'message':_0x42d560});}}catch(_0x2be786){logger['error'](_0x2be786['stack']);return _0x229ad0(_0x2bbb8c[_0x1752('0x37')](0x1f4,_0x2be786));}}return _0x229ad0(_0x1752('0x3a'));});},'AcceptMessage':function(_0x2b24a1){var _0x5e70aa=this;return new Promise(function(_0x5b7ca5,_0x252817){if(_0x2b24a1[_0x1752('0x3b')]&&_0x2b24a1[_0x1752('0x3b')]['id']){if(_0x4d0784[_0x1752('0x3c')][_0x2b24a1[_0x1752('0x3b')]['id']]){_0x4d0784[_0x1752('0x3c')][_0x2b24a1[_0x1752('0x3b')]['id']]['busy']=![];_0x4d0784[_0x1752('0x3c')][_0x2b24a1[_0x1752('0x3b')]['id']][_0x1752('0x3d')]=undefined;}}if(_0x2b24a1['message']&&_0x2b24a1[_0x1752('0x16')]['id']){try{var _0xfba27e=getId(_0x2b24a1[_0x1752('0x22')],_0x2b24a1[_0x1752('0x16')]?_0x2b24a1[_0x1752('0x16')]['id']:0x0,_0x2b24a1[_0x1752('0x17')]?_0x2b24a1[_0x1752('0x17')]['id']:0x0);if(_0x4d0784['rules'][_0xfba27e]){_0x4d0784['rules'][_0xfba27e][_0x1752('0x3e')]('end');if(rpc[_0x2b24a1['channel']+_0x1752('0x3f')]){rpc[_0x2b24a1[_0x1752('0x22')]+_0x1752('0x3f')][_0x1752('0x40')](_0xfba27e,{'UserId':_0x2b24a1[_0x1752('0x16')]['UserId']})[_0x1752('0x41')](function(){logger[_0x1752('0x37')](_0x1752('0x42'));});}}return _0x5b7ca5({'code':0xc8,'message':_0x2b24a1});}catch(_0x4d6c50){logger[_0x1752('0x37')](_0x4d6c50['stack']);return _0x252817(_0x5e70aa[_0x1752('0x37')](0x1f4,_0x4d6c50));}}logger[_0x1752('0x37')](_0x1752('0x43'));return _0x252817(_0x5e70aa[_0x1752('0x37')](0x1f4,_0x1752('0x43')));});},'RejectMessage':function(_0x231b42){var _0x4fdef1=this;return new Promise(function(_0x57b073,_0x1f3740){if(_0x231b42[_0x1752('0x3b')]&&_0x231b42[_0x1752('0x3b')]['id']){try{if(_0x4d0784[_0x1752('0x3c')][_0x231b42[_0x1752('0x3b')]['id']]){_0x4d0784[_0x1752('0x3c')][_0x231b42['agent']['id']]['busy']=![];_0x4d0784['agents'][_0x231b42[_0x1752('0x3b')]['id']][_0x1752('0x3d')]=undefined;}return _0x57b073({'code':0xc8,'message':_0x231b42});}catch(_0x554d28){logger[_0x1752('0x37')](_0x554d28['stack']);return _0x1f3740(_0x4fdef1[_0x1752('0x37')](0x1f4,_0x554d28));}}logger['error'](_0x1752('0x43'));return _0x1f3740(_0x4fdef1['error'](0x1f4,_0x1752('0x43')));});},'AbandonInteraction':function(_0x5e77fb){var _0x5a17e7=this;return new Promise(function(_0x11d000,_0x36a36e){if(_0x5e77fb['channel']&&_0x5e77fb[_0x1752('0x17')]&&_0x5e77fb[_0x1752('0x17')]['id']){try{var _0x17fb2d=getId(_0x5e77fb['channel'],_0x5e77fb[_0x1752('0x16')]?_0x5e77fb[_0x1752('0x16')]['id']:0x0,_0x5e77fb[_0x1752('0x17')]?_0x5e77fb[_0x1752('0x17')]['id']:0x0);if(_0x4d0784[_0x1752('0x15')][_0x17fb2d]){_0x4d0784['rules'][_0x17fb2d][_0x1752('0x3e')](_0x1752('0x44'));}return _0x11d000({'code':0xc8,'message':_0x5e77fb});}catch(_0x5294d7){logger['error'](_0x5294d7[_0x1752('0x45')]);return _0x36a36e(_0x5a17e7[_0x1752('0x37')](0x1f4,_0x5294d7));}}logger[_0x1752('0x37')](_0x1752('0x43'));return _0x36a36e(_0x5a17e7[_0x1752('0x37')](0x1f4,_0x1752('0x43')));});},'AgentCapacity':function(_0x18270f){var _0x5adcee=this;return new Promise(function(_0x1392b8,_0x4890c7){if(_0x4d0784['agents']['hasOwnProperty'](_0x18270f['id'])){for(var _0x662b98 in _0x18270f[_0x1752('0x46')]){if(_0x18270f[_0x1752('0x46')]['hasOwnProperty'](_0x662b98)){if(_0x4d0784[_0x1752('0x3c')][_0x18270f['id']][_0x1752('0x47')](_0x662b98+'CurrentCapacity')){_0x4d0784[_0x1752('0x3c')][_0x18270f['id']][_0x662b98+'CurrentCapacity']=parseInt(_0x18270f['capacity'][_0x662b98],0xa);}}}_0x4d0784[_0x1752('0x3c')][_0x18270f['id']][_0x1752('0x48')]();return _0x1392b8({'code':0xc8,'message':_0x4d0784[_0x1752('0x3c')][_0x18270f['id']]});}else{return _0x4890c7(_0x5adcee[_0x1752('0x37')](0x1f4,_0x1752('0x49')));}});},'Agents':function(_0x5b0657){return new Promise(function(_0x1424b1){var _0x25fe4e=_['values'](_0x4d0784[_0x1752('0x3c')]);if(_0x5b0657&&_0x5b0657['id']){var _0x405780=_['find'](_0x25fe4e,function(_0x3db6b4){return _0x3db6b4['id']===_0x5b0657['id'];});_0x1424b1(_0x405780);}else{_0x1424b1({'count':_0x25fe4e[_0x1752('0x1a')],'rows':_0x25fe4e});}});},'ChatQueues':function(){return new Promise(function(_0x587869){var _0xcaf89c=[];for(var _0x3ee2bb in _0x4d0784['chatQueues']){if(_0x4d0784[_0x1752('0x4a')]['hasOwnProperty'](_0x3ee2bb)){var _0x6ab90b=_0x4d0784[_0x1752('0x4a')][_0x3ee2bb];var _0x5d4dda={'id':_0x6ab90b['id'],'available':_0x6ab90b[_0x1752('0x4b')],'loggedIn':_0x6ab90b['loggedIn'],'name':_0x6ab90b[_0x1752('0x4c')],'paused':_0x6ab90b[_0x1752('0x4d')],'waiting':_0x6ab90b[_0x1752('0x4e')]};_0xcaf89c[_0x1752('0x24')](_0x5d4dda);}}_0x587869({'count':_0xcaf89c[_0x1752('0x1a')],'rows':_0xcaf89c});});},'MailQueues':function(){return new Promise(function(_0x1ab261){var _0xad1e48=[];for(var _0x40d889 in _0x4d0784[_0x1752('0x4f')]){if(_0x4d0784[_0x1752('0x4f')][_0x1752('0x47')](_0x40d889)){var _0x21c828=_0x4d0784[_0x1752('0x4f')][_0x40d889];var _0x59863a={'id':_0x21c828['id'],'available':_0x21c828[_0x1752('0x4b')],'loggedIn':_0x21c828[_0x1752('0x50')],'name':_0x21c828[_0x1752('0x4c')],'paused':_0x21c828[_0x1752('0x4d')],'waiting':_0x21c828['waiting']};_0xad1e48[_0x1752('0x24')](_0x59863a);}}_0x1ab261({'count':_0xad1e48[_0x1752('0x1a')],'rows':_0xad1e48});});},'OpenchannelQueues':function(){return new Promise(function(_0x37d863){var _0x88034b=[];for(var _0x5f41a9 in _0x4d0784[_0x1752('0x51')]){if(_0x4d0784[_0x1752('0x51')][_0x1752('0x47')](_0x5f41a9)){var _0x68b1f7=_0x4d0784[_0x1752('0x51')][_0x5f41a9];var _0x1471e2={'id':_0x68b1f7['id'],'available':_0x68b1f7['available'],'loggedIn':_0x68b1f7['loggedIn'],'name':_0x68b1f7[_0x1752('0x4c')],'paused':_0x68b1f7[_0x1752('0x4d')],'waiting':_0x68b1f7[_0x1752('0x4e')]};_0x88034b['push'](_0x1471e2);}}_0x37d863({'count':_0x88034b[_0x1752('0x1a')],'rows':_0x88034b});});},'SmsQueues':function(){return new Promise(function(_0x17a638){var _0x1df28f=[];for(var _0x5aff28 in _0x4d0784[_0x1752('0x52')]){if(_0x4d0784[_0x1752('0x52')][_0x1752('0x47')](_0x5aff28)){var _0x52d28c=_0x4d0784['smsQueues'][_0x5aff28];var _0x368220={'id':_0x52d28c['id'],'available':_0x52d28c[_0x1752('0x4b')],'loggedIn':_0x52d28c['loggedIn'],'name':_0x52d28c[_0x1752('0x4c')],'paused':_0x52d28c[_0x1752('0x4d')],'waiting':_0x52d28c['waiting']};_0x1df28f[_0x1752('0x24')](_0x368220);}}_0x17a638({'count':_0x1df28f['length'],'rows':_0x1df28f});});},'FaxQueues':function(){return new Promise(function(_0x4def61){var _0x2bac2d=[];for(var _0x32be82 in _0x4d0784[_0x1752('0x53')]){if(_0x4d0784[_0x1752('0x53')]['hasOwnProperty'](_0x32be82)){var _0xdd0cc5=_0x4d0784[_0x1752('0x53')][_0x32be82];var _0x4711f3={'id':_0xdd0cc5['id'],'available':_0xdd0cc5[_0x1752('0x4b')],'loggedIn':_0xdd0cc5[_0x1752('0x50')],'name':_0xdd0cc5[_0x1752('0x4c')],'paused':_0xdd0cc5[_0x1752('0x4d')],'waiting':_0xdd0cc5[_0x1752('0x4e')]};_0x2bac2d[_0x1752('0x24')](_0x4711f3);}}_0x4def61({'count':_0x2bac2d['length'],'rows':_0x2bac2d});});},'WhatsappQueues':function(){return new Promise(function(_0x1fa28b){var _0x60c0bc=[];for(var _0x179d08 in _0x4d0784[_0x1752('0x54')]){if(_0x4d0784[_0x1752('0x54')][_0x1752('0x47')](_0x179d08)){var _0x2da7d3=_0x4d0784[_0x1752('0x54')][_0x179d08];var _0x2995db={'id':_0x2da7d3['id'],'available':_0x2da7d3[_0x1752('0x4b')],'loggedIn':_0x2da7d3[_0x1752('0x50')],'name':_0x2da7d3[_0x1752('0x4c')],'paused':_0x2da7d3['paused'],'waiting':_0x2da7d3[_0x1752('0x4e')]};_0x60c0bc[_0x1752('0x24')](_0x2995db);}}_0x1fa28b({'count':_0x60c0bc[_0x1752('0x1a')],'rows':_0x60c0bc});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x2326c4){var _0x8b36fd=_[_0x1752('0x55')](_0x4d0784[_0x1752('0x56')]);_0x2326c4({'count':_0x8b36fd[_0x1752('0x1a')],'rows':_0x8b36fd});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x27b88e){var _0x98437b=_[_0x1752('0x55')](_0x4d0784[_0x1752('0x57')]);_0x27b88e({'count':_0x98437b['length'],'rows':_0x98437b});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x5ae29d){var _0x32b7ed=_[_0x1752('0x55')](_0x4d0784[_0x1752('0x58')]);_0x5ae29d({'count':_0x32b7ed[_0x1752('0x1a')],'rows':_0x32b7ed});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x14b2fc){var _0x30697e=_[_0x1752('0x55')](_0x4d0784[_0x1752('0x59')]);_0x14b2fc({'count':_0x30697e[_0x1752('0x1a')],'rows':_0x30697e});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4fac2d){var _0x41c6fa=_[_0x1752('0x55')](_0x4d0784[_0x1752('0x5a')]);_0x4fac2d({'count':_0x41c6fa['length'],'rows':_0x41c6fa});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0xe1fb9c){var _0xadc2bc=_['values'](_0x4d0784['whatsappQueuesWaitingInteractions']);_0xe1fb9c({'count':_0xadc2bc['length'],'rows':_0xadc2bc});});}};var _0x40426b=jayson[_0x1752('0x5b')](_0x57e07a)[_0x1752('0x5c')]();_0x40426b['on'](_0x1752('0x37'),function(_0x412d3a){logger['error'](JSON[_0x1752('0x39')](_0x412d3a));return _0x375969(_0x412d3a);});_0x40426b[_0x1752('0x14')](0x232c,_0x1752('0x5d'),function(){console[_0x1752('0x5e')](_0x1752('0x5f'),0x232c);return _0x1c4787(_0x1752('0x60')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 24bde3d..e1a195b 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 _0x3070=['Command','format','iftime\x20%s','indexOf','true','catch','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','stack','stop','util','bluebird','lodash','../../../config/logger','routing','client','http','request','then','error','message','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED'];(function(_0x36cce4,_0x13cb37){var _0x1ccc1c=function(_0x1ca4ae){while(--_0x1ca4ae){_0x36cce4['push'](_0x36cce4['shift']());}};_0x1ccc1c(++_0x13cb37);}(_0x3070,0x1d0));var _0x0307=function(_0x78e60e,_0x233131){_0x78e60e=_0x78e60e-0x0;var _0x532c77=_0x3070[_0x78e60e];return _0x532c77;};'use strict';var util=require(_0x0307('0x0'));var BPromise=require(_0x0307('0x1'));var jayson=require('jayson/promise');var _=require(_0x0307('0x2'));var logger=require(_0x0307('0x3'))(_0x0307('0x4'));var client=jayson[_0x0307('0x5')][_0x0307('0x6')]({'port':0x232a});function request(_0x19dff8,_0x161782){return new BPromise(function(_0x7219f8,_0x4d71b7){return client[_0x0307('0x7')](_0x19dff8,_0x161782)[_0x0307('0x8')](function(_0x2a1027){if(_0x2a1027[_0x0307('0x9')]){return _0x4d71b7(_0x2a1027[_0x0307('0x9')][_0x0307('0xa')]);}else{return _0x7219f8(_0x2a1027[_0x0307('0xb')]);}})['catch'](function(_0x312648){return _0x4d71b7(_0x312648);});});}exports[_0x0307('0xc')]=function(_0x1cf631,_0x137291,_0x2f1c04){return function(_0x18f921){if(_0x2f1c04[_0x0307('0xd')]&&!_0x2f1c04[_0x0307('0xd')][_0x1cf631]){logger[_0x0307('0xe')](_0x0307('0xf'),_0x1cf631);return _0x18f921['stop']();}var _0x23eaed=[];for(var _0x467f0f=0x0;_0x467f0f<_0x137291['length'];_0x467f0f+=0x1){_0x23eaed['push'](request(_0x0307('0x10'),{'command':util[_0x0307('0x11')](_0x0307('0x12'),_0x137291[_0x467f0f])})[_0x0307('0x8')](function(_0x181849){return _0x181849&&_0x181849['message']&&_0x181849[_0x0307('0xa')][_0x0307('0x13')](_0x0307('0x14'))>=0x0?!![]:![];})[_0x0307('0x15')](function(_0x3e4b20){logger['error'](_0x0307('0x16'),_0x1cf631,_0x137291[_0x467f0f]);}));}BPromise['all'](_0x23eaed)[_0x0307('0x8')](function(_0x5cc5e4){var _0x511a19=_[_0x0307('0x17')](_0x5cc5e4);logger[_0x0307('0xe')](_0x0307('0x18'),_0x1cf631,_0x137291['join'](_0x0307('0x19')),_0x511a19);_0x18f921[_0x0307('0x1a')](_0x511a19);})[_0x0307('0x15')](function(_0x3f8420){console[_0x0307('0x1b')](_0x3f8420);logger[_0x0307('0x9')](_0x0307('0x18'),_0x1cf631,_0x137291['join'](_0x0307('0x19')),_0x3f8420[_0x0307('0x1c')]);_0x18f921[_0x0307('0x1d')]();});};}; \ No newline at end of file +var _0x8b97=['then','error','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','push','Command','format','iftime\x20%s','indexOf','true','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stop','util','bluebird','lodash','../../../config/logger','routing','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b97,0x1c5));var _0x78b9=function(_0x398164,_0x12b920){_0x398164=_0x398164-0x0;var _0x4134ae=_0x8b97[_0x398164];return _0x4134ae;};'use strict';var util=require(_0x78b9('0x0'));var BPromise=require(_0x78b9('0x1'));var jayson=require('jayson/promise');var _=require(_0x78b9('0x2'));var logger=require(_0x78b9('0x3'))(_0x78b9('0x4'));var client=jayson['client'][_0x78b9('0x5')]({'port':0x232a});function request(_0x4d7afe,_0x4fdf16){return new BPromise(function(_0x551793,_0x5f25dc){return client['request'](_0x4d7afe,_0x4fdf16)[_0x78b9('0x6')](function(_0x399762){if(_0x399762[_0x78b9('0x7')]){return _0x5f25dc(_0x399762[_0x78b9('0x7')]['message']);}else{return _0x551793(_0x399762['result']);}})[_0x78b9('0x8')](function(_0x50a612){return _0x5f25dc(_0x50a612);});});}exports[_0x78b9('0x9')]=function(_0x188ce0,_0x4fefb8,_0x4e3e20){return function(_0x2f469a){if(_0x4e3e20[_0x78b9('0xa')]&&!_0x4e3e20[_0x78b9('0xa')][_0x188ce0]){logger[_0x78b9('0xb')](_0x78b9('0xc'),_0x188ce0);return _0x2f469a['stop']();}var _0x353777=[];for(var _0x2828b0=0x0;_0x2828b0<_0x4fefb8['length'];_0x2828b0+=0x1){_0x353777[_0x78b9('0xd')](request(_0x78b9('0xe'),{'command':util[_0x78b9('0xf')](_0x78b9('0x10'),_0x4fefb8[_0x2828b0])})[_0x78b9('0x6')](function(_0x1d2d1d){return _0x1d2d1d&&_0x1d2d1d['message']&&_0x1d2d1d['message'][_0x78b9('0x11')](_0x78b9('0x12'))>=0x0?!![]:![];})['catch'](function(_0x16fc9e){logger[_0x78b9('0x7')]('[%s][INTERVAL]\x20%s',_0x188ce0,_0x4fefb8[_0x2828b0]);}));}BPromise[_0x78b9('0x13')](_0x353777)['then'](function(_0xae654c){var _0x1d9a7a=_[_0x78b9('0x14')](_0xae654c);logger[_0x78b9('0xb')](_0x78b9('0x15'),_0x188ce0,_0x4fefb8[_0x78b9('0x16')](_0x78b9('0x17')),_0x1d9a7a);_0x2f469a[_0x78b9('0x18')](_0x1d9a7a);})[_0x78b9('0x8')](function(_0x5d8ee5){console[_0x78b9('0x19')](_0x5d8ee5);logger[_0x78b9('0x7')](_0x78b9('0x15'),_0x188ce0,_0x4fefb8[_0x78b9('0x16')]('\x20|\x20'),_0x5d8ee5['stack']);_0x2f469a[_0x78b9('0x1a')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index b0a2047..464b21b 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 _0xd87e=['getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','format','[%s][agents][agentcalled]','uniqueid','destuniqueid','agentcalledAt','now','called','connectedlinenum','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','[%s][agents][agentringnoanswer]','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','lastevent'];(function(_0x10c600,_0x3c8887){var _0xdd4940=function(_0x2e72a9){while(--_0x2e72a9){_0x10c600['push'](_0x10c600['shift']());}};_0xdd4940(++_0x3c8887);}(_0xd87e,0x1bf));var _0xed87=function(_0x5ed46a,_0x1ed3bd){_0x5ed46a=_0x5ed46a-0x0;var _0x2eebd3=_0xd87e[_0x5ed46a];return _0x2eebd3;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x334485,_0x189fdd){utils[_0xed87('0x2')](util['format'](_0xed87('0x3'),_0x334485['uniqueid'],_0x334485[_0xed87('0x4')],_0x334485[_0xed87('0x5')],_0x334485['membername'],_0x334485[_0xed87('0x6')],_0x334485['calleridnum'],_0x334485['connectedlinenum'],_0x334485[_0xed87('0x7')]));if(_0x334485[_0xed87('0x5')]){utils[_0xed87('0x8')](_0x334485[_0xed87('0x5')])['then'](function(_0x191ca1){if(_0x191ca1){_0x334485[_0xed87('0x9')]=_0x191ca1[_0xed87('0x9')];_0x334485[_0xed87('0xa')]=_0x334485[_0xed87('0xb')]?_0x191ca1[_0xed87('0xc')]:![];_0x334485[_0xed87('0xd')]=_0x334485['agentacw']?_0x191ca1[_0xed87('0xe')]:0x0;}utils[_0xed87('0xf')]('CreateVoiceAgentReport',_0x334485);});}else{utils[_0xed87('0xf')](_0xed87('0x10'),_0x334485);}if(_0x189fdd){delete transfers[_0x334485['uniqueid']];}else{delete agents[_0x334485['destuniqueid']];}}exports[_0xed87('0x11')]=function(_0x32276e){try{utils[_0xed87('0x12')](util[_0xed87('0x13')](_0xed87('0x14'),_0x32276e[_0xed87('0x15')]),_0x32276e);agents[_0x32276e['destuniqueid']]=_0x32276e;agents[_0x32276e[_0xed87('0x16')]][_0xed87('0x17')]=utils[_0xed87('0x18')]();agents[_0x32276e[_0xed87('0x16')]][_0xed87('0x7')]=_0xed87('0x19');agents[_0x32276e[_0xed87('0x16')]][_0xed87('0x1a')]=null;agents[_0x32276e[_0xed87('0x16')]]['connectedlinename']=null;utils[_0xed87('0x2')](util[_0xed87('0x13')](_0xed87('0x1b'),_0x32276e[_0xed87('0x15')],agents[_0x32276e['destuniqueid']][_0xed87('0x1c')],_0x32276e[_0xed87('0x16')]));}catch(_0x8920a1){utils[_0xed87('0x1d')](util[_0xed87('0x13')](_0xed87('0x14'),_0x32276e[_0xed87('0x15')]),_0x8920a1);}};exports[_0xed87('0x1e')]=function(_0x3b7981){try{if(!_['isNil'](agents[_0x3b7981['destuniqueid']])){utils['debug'](util['format'](_0xed87('0x1f'),_0x3b7981['uniqueid']),_0x3b7981);utils[_0xed87('0x2')](util[_0xed87('0x13')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x3b7981[_0xed87('0x15')],agents[_0x3b7981['destuniqueid']][_0xed87('0x1c')],_0x3b7981[_0xed87('0x16')]));agents[_0x3b7981[_0xed87('0x16')]][_0xed87('0x1e')]=!![];agents[_0x3b7981[_0xed87('0x16')]]['agentringnoanswerAt']=utils[_0xed87('0x18')]();agents[_0x3b7981[_0xed87('0x16')]][_0xed87('0x7')]=_0xed87('0x20');agents[_0x3b7981[_0xed87('0x16')]][_0xed87('0x21')]=_0xed87('0x20');agents[_0x3b7981[_0xed87('0x16')]][_0xed87('0x22')]=_0x3b7981[_0xed87('0x23')]?parseInt(_0x3b7981[_0xed87('0x23')])/0x3e8:0x0;agents[_0x3b7981[_0xed87('0x16')]][_0xed87('0x24')]=0x0;unanswered[_0xed87('0x25')](_0x3b7981['destuniqueid']);}}catch(_0xb32b1c){utils[_0xed87('0x1d')](util['format'](_0xed87('0x1f'),_0x3b7981[_0xed87('0x15')]),_0xb32b1c);}};exports[_0xed87('0x26')]=function(_0x4b259e){try{_['forIn'](agents,function(_0xd0efba,_0x428b75){if(_0xd0efba[_0xed87('0x15')]==_0x4b259e['uniqueid']&&!_[_0xed87('0x27')](unanswered,_0xd0efba[_0xed87('0x16')])){utils[_0xed87('0x12')](util[_0xed87('0x13')](_0xed87('0x28'),_0x4b259e[_0xed87('0x15')]),_0x4b259e);utils[_0xed87('0x2')](util[_0xed87('0x13')](_0xed87('0x29'),_0x4b259e['uniqueid'],_0xd0efba[_0xed87('0x1c')],_0xd0efba[_0xed87('0x16')]));_0xd0efba['agentringnoanswer']=!![];_0xd0efba[_0xed87('0x2a')]=utils['now']();_0xd0efba[_0xed87('0x7')]=_0xed87('0x2b');_0xd0efba[_0xed87('0x21')]=_0xed87('0x2b');_0xd0efba[_0xed87('0x22')]=_0x4b259e[_0xed87('0x22')];_0xd0efba[_0xed87('0x24')]=0x0;writeDB(_0xd0efba);}});}catch(_0x37a694){utils[_0xed87('0x1d')](util[_0xed87('0x13')](_0xed87('0x28'),_0x4b259e['uniqueid']),_0x37a694);}};exports[_0xed87('0x2c')]=function(_0x167de8){try{if(agents[_0x167de8['destuniqueid']]){utils[_0xed87('0x12')](util['format'](_0xed87('0x2d'),_0x167de8[_0xed87('0x15')]),_0x167de8);utils['info'](util[_0xed87('0x13')](_0xed87('0x2e'),_0x167de8[_0xed87('0x15')],agents[_0x167de8[_0xed87('0x16')]][_0xed87('0x1c')],_0x167de8['destuniqueid']));agents[_0x167de8[_0xed87('0x16')]]['agentconnectAt']=utils[_0xed87('0x18')]();agents[_0x167de8['destuniqueid']][_0xed87('0x1a')]=_0x167de8[_0xed87('0x1a')];agents[_0x167de8[_0xed87('0x16')]][_0xed87('0x2f')]=_0x167de8[_0xed87('0x2f')];agents[_0x167de8[_0xed87('0x16')]][_0xed87('0x22')]=_0x167de8[_0xed87('0x23')];agents[_0x167de8[_0xed87('0x16')]]['lastevent']='connect';_[_0xed87('0x30')](agents,function(_0x206544,_0x1f16a8){if(_0x206544[_0xed87('0x16')]!=_0x167de8[_0xed87('0x16')]&&_0x206544[_0xed87('0x15')]==_0x167de8['uniqueid']){_0x206544[_0xed87('0x24')]=0x0;_0x206544[_0xed87('0x22')]=_0x167de8[_0xed87('0x23')];_0x206544['agentringnoanswer']=!![];_0x206544[_0xed87('0x2a')]=utils[_0xed87('0x18')]();_0x206544[_0xed87('0x7')]=_0xed87('0x31');_0x206544[_0xed87('0x21')]=_0xed87('0x31');_0x206544[_0xed87('0x32')]=_0x167de8[_0xed87('0x16')];_0x206544[_0xed87('0x33')]=_0x167de8[_0xed87('0x1c')];writeDB(_0x206544);}});}}catch(_0x5c6925){utils[_0xed87('0x1d')](util[_0xed87('0x13')](_0xed87('0x2d'),_0x167de8['uniqueid']),_0x5c6925);}};exports['agentcomplete']=function(_0xa31eec){try{if(!_[_0xed87('0x34')](agents[_0xa31eec[_0xed87('0x16')]])){utils[_0xed87('0x12')](util['format'](_0xed87('0x35'),_0xa31eec[_0xed87('0x15')]),_0xa31eec);utils['info'](util[_0xed87('0x13')](_0xed87('0x36'),_0xa31eec[_0xed87('0x15')],agents[_0xa31eec[_0xed87('0x16')]][_0xed87('0x1c')],_0xa31eec[_0xed87('0x16')]));agents[_0xa31eec[_0xed87('0x16')]][_0xed87('0xb')]=!![];agents[_0xa31eec[_0xed87('0x16')]][_0xed87('0x37')]=utils[_0xed87('0x18')]();agents[_0xa31eec['destuniqueid']][_0xed87('0x24')]=utils[_0xed87('0x38')](agents[_0xa31eec[_0xed87('0x16')]][_0xed87('0x37')],agents[_0xa31eec[_0xed87('0x16')]][_0xed87('0x39')]);agents[_0xa31eec[_0xed87('0x16')]][_0xed87('0x21')]=_0xa31eec[_0xed87('0x21')];agents[_0xa31eec[_0xed87('0x16')]][_0xed87('0x7')]=_0xed87('0x3a');writeDB(agents[_0xa31eec[_0xed87('0x16')]]);}}catch(_0x244e18){utils[_0xed87('0x1d')](util[_0xed87('0x13')](_0xed87('0x35'),_0xa31eec['uniqueid']),_0x244e18);}};exports[_0xed87('0x3b')]=function(_0x1a68a7){try{if(!_[_0xed87('0x34')](agents[_0x1a68a7['transfereruniqueid']])){utils[_0xed87('0x12')](util[_0xed87('0x13')]('[%s][agents][blindtransfer]',_0x1a68a7[_0xed87('0x15')]),_0x1a68a7);utils[_0xed87('0x2')](util[_0xed87('0x13')](_0xed87('0x3c'),_0x1a68a7['uniqueid'],agents[_0x1a68a7[_0xed87('0x3d')]][_0xed87('0x1c')],agents[_0x1a68a7[_0xed87('0x3d')]][_0xed87('0x15')]));agents[_0x1a68a7[_0xed87('0x3d')]][_0xed87('0x3e')]=!![];agents[_0x1a68a7[_0xed87('0x3d')]][_0xed87('0x3f')]=_0xed87('0x40');agents[_0x1a68a7[_0xed87('0x3d')]][_0xed87('0x41')]=_0x1a68a7[_0xed87('0x42')];agents[_0x1a68a7[_0xed87('0x3d')]]['transferuniqueid']=agents[_0x1a68a7[_0xed87('0x3d')]]['uniqueid'];}}catch(_0x17cad7){utils[_0xed87('0x1d')](util[_0xed87('0x13')](_0xed87('0x43'),_0x1a68a7[_0xed87('0x15')]),_0x17cad7);}};exports[_0xed87('0x44')]=function(_0x25f837){try{utils[_0xed87('0x12')](util[_0xed87('0x13')](_0xed87('0x45'),_0x25f837['origtransfereruniqueid']),_0x25f837);if(_0x25f837[_0xed87('0x46')]==_0x25f837[_0xed87('0x47')]){if(!_[_0xed87('0x34')](agents[_0x25f837[_0xed87('0x48')]])){utils[_0xed87('0x2')](util[_0xed87('0x13')](_0xed87('0x49'),_0x25f837[_0xed87('0x46')],agents[_0x25f837[_0xed87('0x48')]][_0xed87('0x1c')]));agents[_0x25f837[_0xed87('0x48')]]['transfer']=!![];agents[_0x25f837['secondtransfereruniqueid']][_0xed87('0x3f')]=_0xed87('0x4a');agents[_0x25f837[_0xed87('0x48')]][_0xed87('0x41')]=_0x25f837[_0xed87('0x4b')];agents[_0x25f837['secondtransfereruniqueid']][_0xed87('0x4c')]=_0x25f837[_0xed87('0x46')];}if(_0x25f837[_0xed87('0x4d')]&&agents[_0x25f837[_0xed87('0x4d')]]){agents[_0x25f837[_0xed87('0x4d')]][_0xed87('0x4e')]=0x1;transfers[_0x25f837[_0xed87('0x4d')]]=_[_0xed87('0x4f')](agents[_0x25f837[_0xed87('0x4d')]]);transfers[_0x25f837[_0xed87('0x4d')]][_0xed87('0x50')]=agents[_0x25f837[_0xed87('0x48')]][_0xed87('0x50')];transfers[_0x25f837[_0xed87('0x4d')]]['calleridname']=agents[_0x25f837[_0xed87('0x48')]][_0xed87('0x51')];transfers[_0x25f837[_0xed87('0x4d')]][_0xed87('0x17')]=utils[_0xed87('0x18')]();transfers[_0x25f837[_0xed87('0x4d')]][_0xed87('0x39')]=utils[_0xed87('0x18')]();transfers[_0x25f837['transfereeuniqueid']][_0xed87('0x22')]=0x0;transfers[_0x25f837[_0xed87('0x4d')]][_0xed87('0x4e')]=0x2;}}else if(_0x25f837[_0xed87('0x48')]==_0x25f837[_0xed87('0x52')]){if(!_[_0xed87('0x34')](agents[_0x25f837['origtransfereruniqueid']])){utils['info'](util[_0xed87('0x13')](_0xed87('0x49'),_0x25f837[_0xed87('0x46')],agents[_0x25f837[_0xed87('0x46')]][_0xed87('0x1c')]));agents[_0x25f837[_0xed87('0x46')]][_0xed87('0x3e')]=!![];agents[_0x25f837[_0xed87('0x46')]]['transfertype']=_0xed87('0x4a');agents[_0x25f837['origtransfereruniqueid']][_0xed87('0x41')]=_0x25f837[_0xed87('0x53')];agents[_0x25f837['origtransfereruniqueid']][_0xed87('0x4c')]=_0x25f837[_0xed87('0x48')];}if(_0x25f837['transfertargetuniqueid']&&agents[_0x25f837[_0xed87('0x54')]]){agents[_0x25f837[_0xed87('0x54')]][_0xed87('0x4e')]=0x1;transfers[_0x25f837[_0xed87('0x54')]]=_[_0xed87('0x4f')](agents[_0x25f837['transfertargetuniqueid']]);transfers[_0x25f837[_0xed87('0x54')]][_0xed87('0x50')]=agents[_0x25f837[_0xed87('0x46')]][_0xed87('0x50')];transfers[_0x25f837['transfertargetuniqueid']]['calleridname']=agents[_0x25f837[_0xed87('0x46')]][_0xed87('0x51')];transfers[_0x25f837['transfertargetuniqueid']][_0xed87('0x17')]=utils[_0xed87('0x18')]();transfers[_0x25f837[_0xed87('0x54')]][_0xed87('0x39')]=utils[_0xed87('0x18')]();transfers[_0x25f837[_0xed87('0x54')]][_0xed87('0x22')]=0x0;transfers[_0x25f837[_0xed87('0x54')]][_0xed87('0x4e')]=0x2;}}}catch(_0x38b588){utils[_0xed87('0x1d')](util[_0xed87('0x13')](_0xed87('0x45'),_0x25f837[_0xed87('0x46')]),_0x38b588);}};exports['hangup']=function(_0xa81cc8){try{utils[_0xed87('0x12')](util['format']('[%s][agents][hangup]',_0xa81cc8[_0xed87('0x15')]),_0xa81cc8);if(agents[_0xa81cc8[_0xed87('0x15')]]&&agents[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x21')]===_0xed87('0x20')){if(_0xa81cc8[_0xed87('0x55')]==='21'){agents[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x21')]='rejected';agents[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x7')]=_0xed87('0x56');}utils[_0xed87('0x2')](util[_0xed87('0x13')](_0xed87('0x57'),_0xa81cc8[_0xed87('0x15')],agents[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x1c')],agents[_0xa81cc8[_0xed87('0x15')]]['reason'],agents[_0xa81cc8['uniqueid']]['lastevent']));writeDB(agents[_0xa81cc8[_0xed87('0x15')]]);var _0x7d3e21=unanswered[_0xed87('0x58')](_0xa81cc8[_0xed87('0x15')]);if(_0x7d3e21>-0x1){unanswered[_0xed87('0x59')](_0x7d3e21,0x1);}}if(transfers[_0xa81cc8['uniqueid']]){transfers[_0xa81cc8[_0xed87('0x15')]][_0xed87('0xb')]=!![];transfers[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x37')]=utils[_0xed87('0x18')]();transfers[_0xa81cc8[_0xed87('0x15')]]['talktime']=utils['diffTime'](transfers[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x37')],transfers[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x39')]);transfers[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x21')]=_0xed87('0x5a');transfers[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x7')]=_0xed87('0x3a');utils[_0xed87('0x2')](util[_0xed87('0x13')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xa81cc8[_0xed87('0x15')],transfers[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x1c')],transfers[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x21')],transfers[_0xa81cc8[_0xed87('0x15')]]['lastevent']));writeDB(transfers[_0xa81cc8[_0xed87('0x15')]],!![]);}if(agents[_0xa81cc8[_0xed87('0x15')]]&&agents[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x39')]){agents[_0xa81cc8['uniqueid']]['agentcomplete']=!![];agents[_0xa81cc8['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x24')]=utils[_0xed87('0x38')](agents[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x37')],agents[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x39')]);agents[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x21')]=agents[_0xa81cc8['uniqueid']]['transfer']?_0xed87('0x3e'):_0xed87('0x5a');agents[_0xa81cc8[_0xed87('0x15')]][_0xed87('0x7')]=_0xed87('0x3a');utils['info'](util['format'](_0xed87('0x57'),_0xa81cc8[_0xed87('0x15')],agents[_0xa81cc8['uniqueid']][_0xed87('0x1c')],agents[_0xa81cc8['uniqueid']][_0xed87('0x21')],agents[_0xa81cc8['uniqueid']][_0xed87('0x7')]));writeDB(agents[_0xa81cc8[_0xed87('0x15')]]);}}catch(_0x3dd107){utils[_0xed87('0x1d')](util[_0xed87('0x13')]('[%s][agents][hangup]',_0xa81cc8[_0xed87('0x15')]),_0x3dd107);}}; \ No newline at end of file +var _0x4ded=['agentcompleteAt','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','hangup','cause','rejected','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','agentcomplete','acw','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','error','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','diffTime'];(function(_0x4edda0,_0x647588){var _0x1d3899=function(_0x1af633){while(--_0x1af633){_0x4edda0['push'](_0x4edda0['shift']());}};_0x1d3899(++_0x647588);}(_0x4ded,0x116));var _0xd4de=function(_0x15c1e5,_0x3a0a92){_0x15c1e5=_0x15c1e5-0x0;var _0x2b78ef=_0x4ded[_0x15c1e5];return _0x2b78ef;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var utils=require(_0xd4de('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1fa334,_0x2349f5){utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x5'),_0x1fa334[_0xd4de('0x6')],_0x1fa334[_0xd4de('0x7')],_0x1fa334[_0xd4de('0x8')],_0x1fa334[_0xd4de('0x9')],_0x1fa334['interface'],_0x1fa334[_0xd4de('0xa')],_0x1fa334[_0xd4de('0xb')],_0x1fa334[_0xd4de('0xc')]));if(_0x1fa334[_0xd4de('0x8')]){utils[_0xd4de('0xd')](_0x1fa334[_0xd4de('0x8')])['then'](function(_0xb7e8cf){if(_0xb7e8cf){_0x1fa334['type']=_0xb7e8cf['type'];_0x1fa334['agentacw']=_0x1fa334[_0xd4de('0xe')]?_0xb7e8cf[_0xd4de('0xf')]:![];_0x1fa334['acwtime']=_0x1fa334['agentacw']?_0xb7e8cf['acwTimeout']:0x0;}utils[_0xd4de('0x10')]('CreateVoiceAgentReport',_0x1fa334);});}else{utils[_0xd4de('0x10')](_0xd4de('0x11'),_0x1fa334);}if(_0x2349f5){delete transfers[_0x1fa334[_0xd4de('0x6')]];}else{delete agents[_0x1fa334[_0xd4de('0x12')]];}}exports[_0xd4de('0x13')]=function(_0x3af6e0){try{utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x15'),_0x3af6e0[_0xd4de('0x6')]),_0x3af6e0);agents[_0x3af6e0[_0xd4de('0x12')]]=_0x3af6e0;agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0x16')]=utils[_0xd4de('0x17')]();agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x18');agents[_0x3af6e0['destuniqueid']]['connectedlinenum']=null;agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0x19')]=null;utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x3af6e0['uniqueid'],agents[_0x3af6e0[_0xd4de('0x12')]]['membername'],_0x3af6e0[_0xd4de('0x12')]));}catch(_0x29c028){utils['error'](util[_0xd4de('0x4')]('[%s][agents][agentcalled]',_0x3af6e0[_0xd4de('0x6')]),_0x29c028);}};exports[_0xd4de('0x1a')]=function(_0x2bad14){try{if(!_[_0xd4de('0x1b')](agents[_0x2bad14['destuniqueid']])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x1c'),_0x2bad14[_0xd4de('0x6')]),_0x2bad14);utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x1d'),_0x2bad14[_0xd4de('0x6')],agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x9')],_0x2bad14['destuniqueid']));agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x1a')]=!![];agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x1e')]=utils[_0xd4de('0x17')]();agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x1f');agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x20')]=_0xd4de('0x1f');agents[_0x2bad14[_0xd4de('0x12')]]['holdtime']=_0x2bad14[_0xd4de('0x21')]?parseInt(_0x2bad14[_0xd4de('0x21')])/0x3e8:0x0;agents[_0x2bad14['destuniqueid']][_0xd4de('0x22')]=0x0;unanswered['push'](_0x2bad14[_0xd4de('0x12')]);}}catch(_0x32e407){utils[_0xd4de('0x23')](util['format'](_0xd4de('0x1c'),_0x2bad14[_0xd4de('0x6')]),_0x32e407);}};exports[_0xd4de('0x24')]=function(_0x50cb73){try{_[_0xd4de('0x25')](agents,function(_0x1804c7,_0x55f9f9){if(_0x1804c7['uniqueid']==_0x50cb73['uniqueid']&&!_[_0xd4de('0x26')](unanswered,_0x1804c7['destuniqueid'])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x27'),_0x50cb73[_0xd4de('0x6')]),_0x50cb73);utils['info'](util[_0xd4de('0x4')](_0xd4de('0x28'),_0x50cb73['uniqueid'],_0x1804c7[_0xd4de('0x9')],_0x1804c7[_0xd4de('0x12')]));_0x1804c7['agentringnoanswer']=!![];_0x1804c7['agentringnoanswerAt']=utils[_0xd4de('0x17')]();_0x1804c7[_0xd4de('0xc')]=_0xd4de('0x29');_0x1804c7[_0xd4de('0x20')]='abandoned';_0x1804c7[_0xd4de('0x2a')]=_0x50cb73[_0xd4de('0x2a')];_0x1804c7['talktime']=0x0;writeDB(_0x1804c7);}});}catch(_0x329d49){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x27'),_0x50cb73[_0xd4de('0x6')]),_0x329d49);}};exports[_0xd4de('0x2b')]=function(_0x53441c){try{if(agents[_0x53441c['destuniqueid']]){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x2c'),_0x53441c['uniqueid']),_0x53441c);utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x53441c[_0xd4de('0x6')],agents[_0x53441c[_0xd4de('0x12')]][_0xd4de('0x9')],_0x53441c[_0xd4de('0x12')]));agents[_0x53441c['destuniqueid']]['agentconnectAt']=utils[_0xd4de('0x17')]();agents[_0x53441c['destuniqueid']][_0xd4de('0xb')]=_0x53441c['connectedlinenum'];agents[_0x53441c[_0xd4de('0x12')]][_0xd4de('0x19')]=_0x53441c[_0xd4de('0x19')];agents[_0x53441c[_0xd4de('0x12')]]['holdtime']=_0x53441c[_0xd4de('0x21')];agents[_0x53441c['destuniqueid']][_0xd4de('0xc')]=_0xd4de('0x2d');_[_0xd4de('0x25')](agents,function(_0x4517a6,_0x349c5f){if(_0x4517a6[_0xd4de('0x12')]!=_0x53441c[_0xd4de('0x12')]&&_0x4517a6['uniqueid']==_0x53441c[_0xd4de('0x6')]){_0x4517a6[_0xd4de('0x22')]=0x0;_0x4517a6[_0xd4de('0x2a')]=_0x53441c[_0xd4de('0x21')];_0x4517a6[_0xd4de('0x1a')]=!![];_0x4517a6['agentringnoanswerAt']=utils[_0xd4de('0x17')]();_0x4517a6[_0xd4de('0xc')]=_0xd4de('0x2e');_0x4517a6['reason']=_0xd4de('0x2e');_0x4517a6[_0xd4de('0x2f')]=_0x53441c[_0xd4de('0x12')];_0x4517a6['answeredelsewheremembername']=_0x53441c[_0xd4de('0x9')];writeDB(_0x4517a6);}});}}catch(_0x10a42c){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x2c'),_0x53441c[_0xd4de('0x6')]),_0x10a42c);}};exports[_0xd4de('0xe')]=function(_0x5ecbbd){try{if(!_[_0xd4de('0x1b')](agents[_0x5ecbbd[_0xd4de('0x12')]])){utils[_0xd4de('0x14')](util['format'](_0xd4de('0x30'),_0x5ecbbd[_0xd4de('0x6')]),_0x5ecbbd);utils[_0xd4de('0x3')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5ecbbd[_0xd4de('0x6')],agents[_0x5ecbbd[_0xd4de('0x12')]]['membername'],_0x5ecbbd[_0xd4de('0x12')]));agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0xe')]=!![];agents[_0x5ecbbd[_0xd4de('0x12')]]['agentcompleteAt']=utils[_0xd4de('0x17')]();agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x22')]=utils[_0xd4de('0x31')](agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x32')],agents[_0x5ecbbd['destuniqueid']][_0xd4de('0x33')]);agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x20')]=_0x5ecbbd[_0xd4de('0x20')];agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x34');writeDB(agents[_0x5ecbbd[_0xd4de('0x12')]]);}}catch(_0xaf442c){utils[_0xd4de('0x23')](util['format'](_0xd4de('0x30'),_0x5ecbbd[_0xd4de('0x6')]),_0xaf442c);}};exports[_0xd4de('0x35')]=function(_0x518bfe){try{if(!_[_0xd4de('0x1b')](agents[_0x518bfe[_0xd4de('0x36')]])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x37'),_0x518bfe[_0xd4de('0x6')]),_0x518bfe);utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x38'),_0x518bfe[_0xd4de('0x6')],agents[_0x518bfe['transfereruniqueid']][_0xd4de('0x9')],agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x6')]));agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x39')]=!![];agents[_0x518bfe['transfereruniqueid']]['transfertype']=_0xd4de('0x3a');agents[_0x518bfe[_0xd4de('0x36')]]['transferexten']=_0x518bfe['extension'];agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x3b')]=agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x6')];}}catch(_0x34d772){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x37'),_0x518bfe[_0xd4de('0x6')]),_0x34d772);}};exports[_0xd4de('0x3c')]=function(_0x3be8c2){try{utils[_0xd4de('0x14')](util['format'](_0xd4de('0x3d'),_0x3be8c2[_0xd4de('0x3e')]),_0x3be8c2);if(_0x3be8c2[_0xd4de('0x3e')]==_0x3be8c2[_0xd4de('0x3f')]){if(!_[_0xd4de('0x1b')](agents[_0x3be8c2[_0xd4de('0x40')]])){utils['info'](util[_0xd4de('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x3be8c2['origtransfereruniqueid'],agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x9')]));agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x39')]=!![];agents[_0x3be8c2['secondtransfereruniqueid']][_0xd4de('0x41')]=_0xd4de('0x42');agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x43')]=_0x3be8c2[_0xd4de('0x44')];agents[_0x3be8c2['secondtransfereruniqueid']]['transferuniqueid']=_0x3be8c2['origtransfereruniqueid'];}if(_0x3be8c2[_0xd4de('0x45')]&&agents[_0x3be8c2[_0xd4de('0x45')]]){agents[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x46')]=0x1;transfers[_0x3be8c2['transfereeuniqueid']]=_[_0xd4de('0x47')](agents[_0x3be8c2[_0xd4de('0x45')]]);transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0xa')]=agents[_0x3be8c2['secondtransfereruniqueid']][_0xd4de('0xa')];transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x48')]=agents[_0x3be8c2[_0xd4de('0x40')]]['calleridname'];transfers[_0x3be8c2['transfereeuniqueid']]['agentcalledAt']=utils[_0xd4de('0x17')]();transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x33')]=utils['now']();transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x2a')]=0x0;transfers[_0x3be8c2[_0xd4de('0x45')]]['agententerreason']=0x2;}}else if(_0x3be8c2[_0xd4de('0x40')]==_0x3be8c2['secondtransfererlinkedid']){if(!_[_0xd4de('0x1b')](agents[_0x3be8c2[_0xd4de('0x3e')]])){utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x49'),_0x3be8c2[_0xd4de('0x3e')],agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x9')]));agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x39')]=!![];agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x41')]=_0xd4de('0x42');agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x43')]=_0x3be8c2[_0xd4de('0x4a')];agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x3b')]=_0x3be8c2[_0xd4de('0x40')];}if(_0x3be8c2[_0xd4de('0x4b')]&&agents[_0x3be8c2[_0xd4de('0x4b')]]){agents[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x46')]=0x1;transfers[_0x3be8c2[_0xd4de('0x4b')]]=_[_0xd4de('0x47')](agents[_0x3be8c2[_0xd4de('0x4b')]]);transfers[_0x3be8c2[_0xd4de('0x4b')]]['calleridnum']=agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0xa')];transfers[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x48')]=agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x48')];transfers[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x16')]=utils['now']();transfers[_0x3be8c2[_0xd4de('0x4b')]]['agentconnectAt']=utils['now']();transfers[_0x3be8c2['transfertargetuniqueid']][_0xd4de('0x2a')]=0x0;transfers[_0x3be8c2[_0xd4de('0x4b')]]['agententerreason']=0x2;}}}catch(_0x4a06b2){utils['error'](util['format'](_0xd4de('0x3d'),_0x3be8c2['origtransfereruniqueid']),_0x4a06b2);}};exports[_0xd4de('0x4c')]=function(_0x5ddba5){try{utils[_0xd4de('0x14')](util[_0xd4de('0x4')]('[%s][agents][hangup]',_0x5ddba5['uniqueid']),_0x5ddba5);if(agents[_0x5ddba5['uniqueid']]&&agents[_0x5ddba5['uniqueid']][_0xd4de('0x20')]===_0xd4de('0x1f')){if(_0x5ddba5[_0xd4de('0x4d')]==='21'){agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]=_0xd4de('0x4e');agents[_0x5ddba5['uniqueid']]['lastevent']='rejected';}utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],agents[_0x5ddba5['uniqueid']][_0xd4de('0x9')],agents[_0x5ddba5['uniqueid']][_0xd4de('0x20')],agents[_0x5ddba5[_0xd4de('0x6')]]['lastevent']));writeDB(agents[_0x5ddba5[_0xd4de('0x6')]]);var _0x5a4882=unanswered[_0xd4de('0x4f')](_0x5ddba5[_0xd4de('0x6')]);if(_0x5a4882>-0x1){unanswered[_0xd4de('0x50')](_0x5a4882,0x1);}}if(transfers[_0x5ddba5[_0xd4de('0x6')]]){transfers[_0x5ddba5['uniqueid']][_0xd4de('0xe')]=!![];transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')]=utils[_0xd4de('0x17')]();transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x22')]=utils[_0xd4de('0x31')](transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x33')]);transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]='agent';transfers[_0x5ddba5[_0xd4de('0x6')]]['lastevent']='complete';utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x9')],transfers[_0x5ddba5[_0xd4de('0x6')]]['reason'],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]));writeDB(transfers[_0x5ddba5[_0xd4de('0x6')]],!![]);}if(agents[_0x5ddba5[_0xd4de('0x6')]]&&agents[_0x5ddba5[_0xd4de('0x6')]]['agentconnectAt']){agents[_0x5ddba5['uniqueid']]['agentcomplete']=!![];agents[_0x5ddba5['uniqueid']][_0xd4de('0x32')]=utils['now']();agents[_0x5ddba5[_0xd4de('0x6')]]['talktime']=utils[_0xd4de('0x31')](agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x33')]);agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]=agents[_0x5ddba5[_0xd4de('0x6')]]['transfer']?_0xd4de('0x39'):_0xd4de('0x51');agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]='complete';utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x9')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]));writeDB(agents[_0x5ddba5[_0xd4de('0x6')]]);}}catch(_0x27fd09){utils[_0xd4de('0x23')](util[_0xd4de('0x4')]('[%s][agents][hangup]',_0x5ddba5[_0xd4de('0x6')]),_0x27fd09);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 113234b..264d9f6 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 _0x79a3=['type','outboundrouteid','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','cdr','split','lastIndexOf','includes','execif','lastapplication','lodash','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','getUserByInternal','accountcode','then','CreateVoiceCallReport','request','recording','newchannel','debug','channel','OutgoingSpoolFailed','exten','context','DOCUMENTATION','error','format','[%s][calls][newchannel]','isNil','channelstate','info','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','disposition','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','duration','starttime','billableseconds','answertime','diffTime','endtime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s'];(function(_0x48491e,_0x21119b){var _0x4da263=function(_0x138551){while(--_0x138551){_0x48491e['push'](_0x48491e['shift']());}};_0x4da263(++_0x21119b);}(_0x79a3,0x80));var _0x379a=function(_0x11e564,_0x6d25d1){_0x11e564=_0x11e564-0x0;var _0x2d13fe=_0x79a3[_0x11e564];return _0x2d13fe;};'use strict';var _=require(_0x379a('0x0'));var util=require('util');var utils=require(_0x379a('0x1'));var transfers=require(_0x379a('0x2'));var dispositions=['NO\x20ANSWER',_0x379a('0x3'),'FAILED','NO\x20ANSWER','NO\x20ANSWER',_0x379a('0x4'),_0x379a('0x5'),_0x379a('0x6'),_0x379a('0x3'),_0x379a('0x3'),'FAILED'];var channels={};function writeDB(_0x4d0435){var _0x484a91;if(transfers[_0x379a('0x7')][_0x4d0435[_0x379a('0x8')]]){_0x484a91=_0x4d0435[_0x379a('0x8')];_0x4d0435[_0x379a('0x8')]=transfers[_0x379a('0x7')][_0x4d0435[_0x379a('0x8')]][_0x379a('0x9')];}utils['info'](util['format'](_0x379a('0xa'),_0x4d0435['uniqueid'],_0x4d0435['channel'],_0x4d0435[_0x379a('0xb')],_0x4d0435[_0x379a('0xc')],_0x4d0435[_0x379a('0xd')],_0x4d0435[_0x379a('0xe')],_0x4d0435['connectedlinenum'],_0x4d0435['lastevent']));if(_0x4d0435['accountcode']){utils[_0x379a('0xf')](_0x4d0435[_0x379a('0x10')])[_0x379a('0x11')](function(_0x17adab){if(_0x17adab){_0x4d0435['UserId']=_0x17adab['id'];}utils['request'](_0x379a('0x12'),_0x4d0435);});}else{utils[_0x379a('0x13')](_0x379a('0x12'),_0x4d0435);}if(channels[_0x4d0435[_0x379a('0x8')]]){delete channels[_0x4d0435['uniqueid']];}else if(_0x484a91&&channels[_0x484a91]){if(!transfers['blinds'][_0x484a91][_0x379a('0x14')])delete transfers['blinds'][_0x484a91];delete channels[_0x484a91];}}exports[_0x379a('0x15')]=function(_0x1e2d90){try{utils[_0x379a('0x16')](util['format']('[%s][calls][newchannel]',_0x1e2d90[_0x379a('0x8')]),_0x1e2d90);if(_0x1e2d90[_0x379a('0x8')]==_0x1e2d90['linkedid']&&_0x1e2d90[_0x379a('0x17')]!=_0x379a('0x18')){utils['info'](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x1e2d90[_0x379a('0x8')],_0x1e2d90['context'],_0x1e2d90[_0x379a('0x19')]));channels[_0x1e2d90[_0x379a('0x8')]]={'uniqueid':_0x1e2d90[_0x379a('0x8')],'accountcode':_0x1e2d90[_0x379a('0x10')],'source':_0x1e2d90[_0x379a('0xe')],'destination':_0x1e2d90[_0x379a('0x19')],'destinationcontext':_0x1e2d90[_0x379a('0x1a')],'channel':_0x1e2d90[_0x379a('0x17')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x379a('0x4'),'amaflags':_0x379a('0x1b')};}}catch(_0x28aedc){utils[_0x379a('0x1c')](util[_0x379a('0x1d')](_0x379a('0x1e'),_0x1e2d90[_0x379a('0x8')]),_0x28aedc);}};exports['newstate']=function(_0x285c34){try{utils[_0x379a('0x16')](util[_0x379a('0x1d')]('[%s][calls][newstate]',_0x285c34['uniqueid']),_0x285c34);if(!_[_0x379a('0x1f')](channels[_0x285c34['uniqueid']])&&_0x285c34[_0x379a('0x20')]==0x6){utils[_0x379a('0x21')](util['format'](_0x379a('0x22'),_0x285c34[_0x379a('0x8')],_0x285c34[_0x379a('0x1a')],_0x285c34['channel']));if(_[_0x379a('0x1f')](channels[_0x285c34['uniqueid']][_0x379a('0x23')])){channels[_0x285c34[_0x379a('0x8')]][_0x379a('0x23')]=utils[_0x379a('0x24')]();}}else if(!_['isNil'](channels[_0x285c34[_0x379a('0x25')]])&&_0x285c34[_0x379a('0x20')]==0x6&&_0x285c34[_0x379a('0x1a')]!=_0x379a('0x26')){utils[_0x379a('0x21')](util['format'](_0x379a('0x27'),_0x285c34[_0x379a('0x8')],_0x285c34[_0x379a('0x25')],_0x285c34[_0x379a('0x1a')],_0x285c34[_0x379a('0x17')]));channels[_0x285c34['linkedid']][_0x379a('0x10')]=_0x285c34[_0x379a('0x10')];channels[_0x285c34[_0x379a('0x25')]][_0x379a('0x28')]=_0x285c34[_0x379a('0x17')];if(_[_0x379a('0x1f')](channels[_0x285c34['linkedid']]['answertime'])){channels[_0x285c34[_0x379a('0x25')]]['answertime']=utils[_0x379a('0x24')]();}channels[_0x285c34[_0x379a('0x25')]][_0x379a('0x29')]=dispositions[_['toNumber'](_0x285c34['channelstate'])]||_0x379a('0x5');}}catch(_0x2e5a46){utils[_0x379a('0x1c')](util[_0x379a('0x1d')]('[%s][calls][newstate]',_0x285c34[_0x379a('0x8')]),_0x2e5a46);}};exports[_0x379a('0x2a')]=function(_0x2016f9){try{if(!_[_0x379a('0x1f')](channels[_0x2016f9['uniqueid']])){utils[_0x379a('0x16')](util[_0x379a('0x1d')](_0x379a('0x2b'),_0x2016f9[_0x379a('0x8')]),_0x2016f9);if(_[_0x379a('0x1f')](channels[_0x2016f9[_0x379a('0x8')]][_0x379a('0x2c')])){channels[_0x2016f9[_0x379a('0x8')]][_0x379a('0x2c')]=_0x2016f9[_0x379a('0x2d')]+'\x20<'+_0x2016f9['calleridnum']+'>';}utils[_0x379a('0x21')](util[_0x379a('0x1d')](_0x379a('0x2e'),_0x2016f9['uniqueid'],channels[_0x2016f9[_0x379a('0x8')]][_0x379a('0x2c')],_0x2016f9['cause-txt']));channels[_0x2016f9['uniqueid']]['endtime']=utils[_0x379a('0x24')]();channels[_0x2016f9[_0x379a('0x8')]][_0x379a('0x2f')]=utils['diffTime'](channels[_0x2016f9['uniqueid']]['endtime'],channels[_0x2016f9[_0x379a('0x8')]][_0x379a('0x30')]);channels[_0x2016f9[_0x379a('0x8')]][_0x379a('0x31')]=channels[_0x2016f9[_0x379a('0x8')]][_0x379a('0x32')]?utils[_0x379a('0x33')](channels[_0x2016f9[_0x379a('0x8')]][_0x379a('0x34')],channels[_0x2016f9[_0x379a('0x8')]]['answertime']):0x0;writeDB(channels[_0x2016f9[_0x379a('0x8')]]);}}catch(_0x3bd1b2){utils[_0x379a('0x1c')](util[_0x379a('0x1d')](_0x379a('0x2b'),_0x2016f9[_0x379a('0x8')]),_0x3bd1b2);}};exports[_0x379a('0x35')]=function(_0x2ce304){try{if(!_[_0x379a('0x1f')](channels[_0x2ce304[_0x379a('0x36')]])){utils[_0x379a('0x16')](util['format'](_0x379a('0x37'),_0x2ce304[_0x379a('0x38')]),_0x2ce304);if(channels[_0x2ce304['localtwolinkedid']][_0x379a('0x17')]==_0x2ce304[_0x379a('0x39')]){utils[_0x379a('0x21')](util['format'](_0x379a('0x3a'),_0x2ce304[_0x379a('0x38')],_0x2ce304['localtwolinkedid'],_0x2ce304[_0x379a('0x3b')]));channels[_0x2ce304[_0x379a('0x36')]][_0x379a('0x28')]=_0x2ce304['secondtransfererchannel'];channels[_0x2ce304[_0x379a('0x36')]][_0x379a('0x3c')]=_0x379a('0x3d');}else if(channels[_0x2ce304['localtwolinkedid']]['channel']=_0x2ce304[_0x379a('0x3e')]){utils[_0x379a('0x21')](util[_0x379a('0x1d')](_0x379a('0x3a'),_0x2ce304['origtransfereruniqueid'],_0x2ce304[_0x379a('0x36')],_0x2ce304[_0x379a('0x3f')]));channels[_0x2ce304['localtwolinkedid']]['destinationchannel']=_0x2ce304[_0x379a('0x3f')];channels[_0x2ce304[_0x379a('0x36')]]['userfield']=_0x379a('0x3d');}}}catch(_0x3c7016){utils[_0x379a('0x1c')](util[_0x379a('0x1d')](_0x379a('0x37'),_0x2ce304[_0x379a('0x38')]),_0x3c7016);}};exports[_0x379a('0x40')]=function(_0x29bcf8){try{if(!_[_0x379a('0x1f')](channels[_0x29bcf8[_0x379a('0x8')]])){utils['debug'](util[_0x379a('0x1d')](_0x379a('0x41'),_0x29bcf8[_0x379a('0x8')]),_0x29bcf8);channels[_0x29bcf8[_0x379a('0x8')]][_0x379a('0x42')]=utils['now']();utils[_0x379a('0x21')](util[_0x379a('0x1d')](_0x379a('0x43'),_0x29bcf8[_0x379a('0x8')],channels[_0x29bcf8[_0x379a('0x8')]]['musiconholdstartAt']));}}catch(_0x42a281){utils[_0x379a('0x1c')](util[_0x379a('0x1d')](_0x379a('0x41'),_0x29bcf8[_0x379a('0x8')]),_0x42a281);}};exports[_0x379a('0x44')]=function(_0x4524d4){try{if(!_[_0x379a('0x1f')](channels[_0x4524d4[_0x379a('0x8')]])){utils[_0x379a('0x16')](util[_0x379a('0x1d')](_0x379a('0x45'),_0x4524d4[_0x379a('0x8')]),_0x4524d4);if(!_[_0x379a('0x1f')](channels[_0x4524d4[_0x379a('0x8')]][_0x379a('0x42')])){channels[_0x4524d4['uniqueid']][_0x379a('0x46')]+=utils[_0x379a('0x33')](utils[_0x379a('0x24')](),channels[_0x4524d4[_0x379a('0x8')]][_0x379a('0x42')]);utils[_0x379a('0x21')](util[_0x379a('0x1d')](_0x379a('0x47'),_0x4524d4[_0x379a('0x8')],channels[_0x4524d4['uniqueid']][_0x379a('0x46')]));delete channels[_0x4524d4[_0x379a('0x8')]][_0x379a('0x42')];}}}catch(_0x594c10){utils[_0x379a('0x1c')](util[_0x379a('0x1d')]('[%s][calls][musiconholdstop]',_0x4524d4['uniqueid']),_0x594c10);}};exports['varset']=function(_0x539133){try{if(!_[_0x379a('0x1f')](channels[_0x539133['uniqueid']])){utils[_0x379a('0x16')](util[_0x379a('0x1d')](_0x379a('0x48'),_0x539133[_0x379a('0x8')]),_0x539133);if(!_[_0x379a('0x1f')](_0x539133[_0x379a('0x49')][_0x379a('0x4a')])){utils[_0x379a('0x21')](util[_0x379a('0x1d')](_0x379a('0x4b'),_0x539133[_0x379a('0x8')],_0x539133[_0x379a('0x4c')]));channels[_0x539133[_0x379a('0x8')]][_0x379a('0x4d')]=_0x539133[_0x379a('0x4c')];}if(!_[_0x379a('0x1f')](_0x539133[_0x379a('0x49')][_0x379a('0x4e')])){utils['info'](util[_0x379a('0x1d')](_0x379a('0x4f'),_0x539133[_0x379a('0x8')],_0x539133[_0x379a('0x4c')]));channels[_0x539133[_0x379a('0x8')]][_0x379a('0x50')]=_0x539133[_0x379a('0x4c')];channels[_0x539133['uniqueid']]['callerid']='\x22'+_0x539133[_0x379a('0x4c')]+_0x379a('0x51')+_0x539133[_0x379a('0x4c')]+'>';}if(!_[_0x379a('0x1f')](_0x539133['variable'][_0x379a('0x52')])||!_[_0x379a('0x1f')](_0x539133[_0x379a('0x49')][_0x379a('0x53')])){utils[_0x379a('0x21')](util[_0x379a('0x1d')](_0x379a('0x54'),_0x539133[_0x379a('0x8')],!_[_0x379a('0x1f')](_0x539133['variable']['xmd-callerid-preview'])?_0x379a('0x52'):_0x379a('0x53'),_0x539133[_0x379a('0x4c')]));channels[_0x539133[_0x379a('0x8')]]['callerid']=_0x539133['value'];}if(!_[_0x379a('0x1f')](_0x539133[_0x379a('0x49')][_0x379a('0x55')])||!_['isNil'](_0x539133['variable'][_0x379a('0x56')])){utils['info'](util[_0x379a('0x1d')](_0x379a('0x54'),_0x539133[_0x379a('0x8')],!_[_0x379a('0x1f')](_0x539133[_0x379a('0x49')][_0x379a('0x55')])?_0x379a('0x55'):_0x379a('0x56'),_0x539133[_0x379a('0x4c')]));channels[_0x539133['uniqueid']]['lastapplication']=_0x379a('0x57');channels[_0x539133[_0x379a('0x8')]][_0x379a('0x58')]=_0x539133['value'];channels[_0x539133['uniqueid']][_0x379a('0xb')]=!![];}if(!_[_0x379a('0x1f')](_0x539133[_0x379a('0x49')][_0x379a('0x59')])){utils[_0x379a('0x21')](util['format'](_0x379a('0x5a'),_0x539133[_0x379a('0x8')],_0x539133[_0x379a('0x4c')]));channels[_0x539133[_0x379a('0x8')]]['ContactId']=_0x539133['value'];}if(!_[_0x379a('0x1f')](_0x539133[_0x379a('0x49')]['xmd-cdrtype'])){utils[_0x379a('0x21')](util[_0x379a('0x1d')](_0x379a('0x5b'),_0x539133[_0x379a('0x8')],_0x539133[_0x379a('0x4c')]));channels[_0x539133[_0x379a('0x8')]][_0x379a('0x5c')]=_0x539133[_0x379a('0x4c')];}if(!_[_0x379a('0x1f')](_0x539133[_0x379a('0x49')][_0x379a('0x5d')])){utils[_0x379a('0x21')](util[_0x379a('0x1d')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x539133[_0x379a('0x8')],_0x539133[_0x379a('0x4c')]));channels[_0x539133[_0x379a('0x8')]][_0x379a('0x5e')]=_0x539133['value'];}if(!_[_0x379a('0x1f')](_0x539133[_0x379a('0x49')][_0x379a('0x5f')])){utils[_0x379a('0x21')](util[_0x379a('0x1d')](_0x379a('0x60'),_0x539133[_0x379a('0x8')],_0x539133[_0x379a('0x4c')]));channels[_0x539133['uniqueid']][_0x379a('0x5f')]=_0x539133['value'];}}}catch(_0x5af74f){utils[_0x379a('0x1c')](util[_0x379a('0x1d')](_0x379a('0x48'),_0x539133[_0x379a('0x8')]),_0x5af74f);}};exports[_0x379a('0x61')]=function(_0x488c4c){try{if(!_[_0x379a('0x1f')](channels[_0x488c4c[_0x379a('0x8')]])){utils[_0x379a('0x16')](util[_0x379a('0x1d')](_0x379a('0x62'),_0x488c4c[_0x379a('0x8')]),_0x488c4c);utils[_0x379a('0x21')](util[_0x379a('0x1d')](_0x379a('0x63'),_0x488c4c['uniqueid'],_0x488c4c['application'],_0x488c4c[_0x379a('0x64')]));if(_0x488c4c[_0x379a('0x65')][_0x379a('0x66')]()==_0x379a('0x67')&&_['startsWith'](_0x488c4c[_0x379a('0x64')][_0x379a('0x66')](),_0x379a('0x68'))){var _0x42c93f=_0x488c4c[_0x379a('0x64')][_0x379a('0x69')]('=');var _0x43b5a6=_0x42c93f[0x0]['substring'](_0x42c93f[0x0][_0x379a('0x6a')]('(')+0x1,_0x42c93f[0x0][_0x379a('0x6a')](')'));var _0x4edbca=_0x42c93f[0x1];channels[_0x488c4c[_0x379a('0x8')]][_0x43b5a6]=_0x4edbca;}if(!_[_0x379a('0x6b')]([_0x379a('0x2a'),'noop',_0x379a('0x6c'),_0x379a('0x67'),'gotoif'],_0x488c4c[_0x379a('0x65')][_0x379a('0x66')]())){channels[_0x488c4c[_0x379a('0x8')]][_0x379a('0x6d')]=_0x488c4c[_0x379a('0x65')];channels[_0x488c4c[_0x379a('0x8')]][_0x379a('0x58')]=_0x488c4c[_0x379a('0x64')];}}}catch(_0x567d01){utils[_0x379a('0x1c')](util['format']('[%s][calls][newexten]',_0x488c4c['uniqueid']),_0x567d01);}}; \ No newline at end of file +var _0x7a3e=['mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','appdata','toLowerCase','cdr','split','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getUserByInternal','accountcode','then','CreateVoiceCallReport','request','recording','newchannel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','systemanswertime','linkedid','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','hangup','debug','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','destinationchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x1aed1,_0x491dec){_0x1aed1=_0x1aed1-0x0;var _0xd0b1a6=_0x7a3e[_0x1aed1];return _0xd0b1a6;};'use strict';var _=require(_0xe7a3('0x0'));var util=require(_0xe7a3('0x1'));var utils=require(_0xe7a3('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0xe7a3('0x3'),_0xe7a3('0x4'),'FAILED','NO\x20ANSWER',_0xe7a3('0x3'),_0xe7a3('0x3'),_0xe7a3('0x5'),'BUSY',_0xe7a3('0x4'),_0xe7a3('0x4'),_0xe7a3('0x4')];var channels={};function writeDB(_0x1b6226){var _0x1a7627;if(transfers['blinds'][_0x1b6226[_0xe7a3('0x6')]]){_0x1a7627=_0x1b6226[_0xe7a3('0x6')];_0x1b6226[_0xe7a3('0x6')]=transfers[_0xe7a3('0x7')][_0x1b6226['uniqueid']][_0xe7a3('0x8')];}utils[_0xe7a3('0x9')](util[_0xe7a3('0xa')](_0xe7a3('0xb'),_0x1b6226[_0xe7a3('0x6')],_0x1b6226[_0xe7a3('0xc')],_0x1b6226[_0xe7a3('0xd')],_0x1b6226[_0xe7a3('0xe')],_0x1b6226[_0xe7a3('0xf')],_0x1b6226[_0xe7a3('0x10')],_0x1b6226[_0xe7a3('0x11')],_0x1b6226[_0xe7a3('0x12')]));if(_0x1b6226['accountcode']){utils[_0xe7a3('0x13')](_0x1b6226[_0xe7a3('0x14')])[_0xe7a3('0x15')](function(_0x12798a){if(_0x12798a){_0x1b6226['UserId']=_0x12798a['id'];}utils['request'](_0xe7a3('0x16'),_0x1b6226);});}else{utils[_0xe7a3('0x17')](_0xe7a3('0x16'),_0x1b6226);}if(channels[_0x1b6226[_0xe7a3('0x6')]]){delete channels[_0x1b6226[_0xe7a3('0x6')]];}else if(_0x1a7627&&channels[_0x1a7627]){if(!transfers[_0xe7a3('0x7')][_0x1a7627][_0xe7a3('0x18')])delete transfers[_0xe7a3('0x7')][_0x1a7627];delete channels[_0x1a7627];}}exports[_0xe7a3('0x19')]=function(_0xd87bab){try{utils['debug'](util[_0xe7a3('0xa')]('[%s][calls][newchannel]',_0xd87bab['uniqueid']),_0xd87bab);if(_0xd87bab[_0xe7a3('0x6')]==_0xd87bab['linkedid']&&_0xd87bab[_0xe7a3('0xc')]!=_0xe7a3('0x1a')){utils['info'](util[_0xe7a3('0xa')](_0xe7a3('0x1b'),_0xd87bab[_0xe7a3('0x6')],_0xd87bab['context'],_0xd87bab[_0xe7a3('0x1c')]));channels[_0xd87bab[_0xe7a3('0x6')]]={'uniqueid':_0xd87bab[_0xe7a3('0x6')],'accountcode':_0xd87bab['accountcode'],'source':_0xd87bab[_0xe7a3('0x10')],'destination':_0xd87bab['exten'],'destinationcontext':_0xd87bab[_0xe7a3('0x1d')],'channel':_0xd87bab[_0xe7a3('0xc')],'starttime':utils[_0xe7a3('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xe7a3('0x3'),'amaflags':_0xe7a3('0x1f')};}}catch(_0x3917a1){utils[_0xe7a3('0x20')](util[_0xe7a3('0xa')]('[%s][calls][newchannel]',_0xd87bab[_0xe7a3('0x6')]),_0x3917a1);}};exports[_0xe7a3('0x21')]=function(_0x12d6ec){try{utils['debug'](util[_0xe7a3('0xa')](_0xe7a3('0x22'),_0x12d6ec[_0xe7a3('0x6')]),_0x12d6ec);if(!_[_0xe7a3('0x23')](channels[_0x12d6ec[_0xe7a3('0x6')]])&&_0x12d6ec['channelstate']==0x6){utils[_0xe7a3('0x9')](util[_0xe7a3('0xa')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x12d6ec[_0xe7a3('0x6')],_0x12d6ec['context'],_0x12d6ec[_0xe7a3('0xc')]));if(_[_0xe7a3('0x23')](channels[_0x12d6ec[_0xe7a3('0x6')]][_0xe7a3('0x24')])){channels[_0x12d6ec['uniqueid']][_0xe7a3('0x24')]=utils[_0xe7a3('0x1e')]();}}else if(!_[_0xe7a3('0x23')](channels[_0x12d6ec[_0xe7a3('0x25')]])&&_0x12d6ec[_0xe7a3('0x26')]==0x6&&_0x12d6ec[_0xe7a3('0x1d')]!=_0xe7a3('0x27')){utils[_0xe7a3('0x9')](util[_0xe7a3('0xa')](_0xe7a3('0x28'),_0x12d6ec[_0xe7a3('0x6')],_0x12d6ec[_0xe7a3('0x25')],_0x12d6ec['context'],_0x12d6ec[_0xe7a3('0xc')]));channels[_0x12d6ec[_0xe7a3('0x25')]]['accountcode']=_0x12d6ec[_0xe7a3('0x14')];channels[_0x12d6ec['linkedid']]['destinationchannel']=_0x12d6ec['channel'];if(_[_0xe7a3('0x23')](channels[_0x12d6ec[_0xe7a3('0x25')]][_0xe7a3('0x29')])){channels[_0x12d6ec[_0xe7a3('0x25')]]['answertime']=utils[_0xe7a3('0x1e')]();}channels[_0x12d6ec[_0xe7a3('0x25')]][_0xe7a3('0x2a')]=dispositions[_[_0xe7a3('0x2b')](_0x12d6ec['channelstate'])]||_0xe7a3('0x5');}}catch(_0x401702){utils[_0xe7a3('0x20')](util[_0xe7a3('0xa')]('[%s][calls][newstate]',_0x12d6ec[_0xe7a3('0x6')]),_0x401702);}};exports[_0xe7a3('0x2c')]=function(_0x511f75){try{if(!_[_0xe7a3('0x23')](channels[_0x511f75[_0xe7a3('0x6')]])){utils[_0xe7a3('0x2d')](util[_0xe7a3('0xa')](_0xe7a3('0x2e'),_0x511f75[_0xe7a3('0x6')]),_0x511f75);if(_[_0xe7a3('0x23')](channels[_0x511f75[_0xe7a3('0x6')]][_0xe7a3('0x2f')])){channels[_0x511f75['uniqueid']][_0xe7a3('0x2f')]=_0x511f75[_0xe7a3('0x30')]+'\x20<'+_0x511f75[_0xe7a3('0x10')]+'>';}utils[_0xe7a3('0x9')](util['format'](_0xe7a3('0x31'),_0x511f75[_0xe7a3('0x6')],channels[_0x511f75[_0xe7a3('0x6')]]['callerid'],_0x511f75['cause-txt']));channels[_0x511f75[_0xe7a3('0x6')]][_0xe7a3('0x32')]=utils[_0xe7a3('0x1e')]();channels[_0x511f75[_0xe7a3('0x6')]][_0xe7a3('0x33')]=utils[_0xe7a3('0x34')](channels[_0x511f75[_0xe7a3('0x6')]][_0xe7a3('0x32')],channels[_0x511f75[_0xe7a3('0x6')]]['starttime']);channels[_0x511f75[_0xe7a3('0x6')]][_0xe7a3('0x35')]=channels[_0x511f75['uniqueid']][_0xe7a3('0x29')]?utils[_0xe7a3('0x34')](channels[_0x511f75[_0xe7a3('0x6')]][_0xe7a3('0x32')],channels[_0x511f75['uniqueid']][_0xe7a3('0x29')]):0x0;writeDB(channels[_0x511f75[_0xe7a3('0x6')]]);}}catch(_0x13b6a6){utils[_0xe7a3('0x20')](util[_0xe7a3('0xa')](_0xe7a3('0x2e'),_0x511f75[_0xe7a3('0x6')]),_0x13b6a6);}};exports['attendedtransfer']=function(_0x236c89){try{if(!_['isNil'](channels[_0x236c89[_0xe7a3('0x36')]])){utils[_0xe7a3('0x2d')](util[_0xe7a3('0xa')](_0xe7a3('0x37'),_0x236c89[_0xe7a3('0x38')]),_0x236c89);if(channels[_0x236c89[_0xe7a3('0x36')]]['channel']==_0x236c89[_0xe7a3('0x39')]){utils['info'](util[_0xe7a3('0xa')](_0xe7a3('0x3a'),_0x236c89[_0xe7a3('0x38')],_0x236c89['localtwolinkedid'],_0x236c89[_0xe7a3('0x3b')]));channels[_0x236c89['localtwolinkedid']]['destinationchannel']=_0x236c89['secondtransfererchannel'];channels[_0x236c89[_0xe7a3('0x36')]][_0xe7a3('0x3c')]=_0xe7a3('0x3d');}else if(channels[_0x236c89[_0xe7a3('0x36')]][_0xe7a3('0xc')]=_0x236c89[_0xe7a3('0x3e')]){utils[_0xe7a3('0x9')](util[_0xe7a3('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x236c89[_0xe7a3('0x38')],_0x236c89[_0xe7a3('0x36')],_0x236c89[_0xe7a3('0x3f')]));channels[_0x236c89['localtwolinkedid']][_0xe7a3('0x40')]=_0x236c89[_0xe7a3('0x3f')];channels[_0x236c89[_0xe7a3('0x36')]][_0xe7a3('0x3c')]=_0xe7a3('0x3d');}}}catch(_0x114705){utils[_0xe7a3('0x20')](util['format']('[%s][calls][attendedtransfer]',_0x236c89[_0xe7a3('0x38')]),_0x114705);}};exports[_0xe7a3('0x41')]=function(_0x165e08){try{if(!_['isNil'](channels[_0x165e08[_0xe7a3('0x6')]])){utils['debug'](util[_0xe7a3('0xa')](_0xe7a3('0x42'),_0x165e08[_0xe7a3('0x6')]),_0x165e08);channels[_0x165e08['uniqueid']][_0xe7a3('0x43')]=utils[_0xe7a3('0x1e')]();utils[_0xe7a3('0x9')](util[_0xe7a3('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x165e08[_0xe7a3('0x6')],channels[_0x165e08[_0xe7a3('0x6')]][_0xe7a3('0x43')]));}}catch(_0x296ab0){utils[_0xe7a3('0x20')](util['format'](_0xe7a3('0x42'),_0x165e08[_0xe7a3('0x6')]),_0x296ab0);}};exports[_0xe7a3('0x44')]=function(_0x2c9edc){try{if(!_[_0xe7a3('0x23')](channels[_0x2c9edc[_0xe7a3('0x6')]])){utils[_0xe7a3('0x2d')](util['format'](_0xe7a3('0x45'),_0x2c9edc[_0xe7a3('0x6')]),_0x2c9edc);if(!_['isNil'](channels[_0x2c9edc[_0xe7a3('0x6')]]['musiconholdstartAt'])){channels[_0x2c9edc[_0xe7a3('0x6')]][_0xe7a3('0x46')]+=utils['diffTime'](utils[_0xe7a3('0x1e')](),channels[_0x2c9edc[_0xe7a3('0x6')]][_0xe7a3('0x43')]);utils[_0xe7a3('0x9')](util[_0xe7a3('0xa')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x2c9edc[_0xe7a3('0x6')],channels[_0x2c9edc[_0xe7a3('0x6')]]['mohtime']));delete channels[_0x2c9edc[_0xe7a3('0x6')]][_0xe7a3('0x43')];}}}catch(_0x34ab3e){utils[_0xe7a3('0x20')](util[_0xe7a3('0xa')](_0xe7a3('0x45'),_0x2c9edc[_0xe7a3('0x6')]),_0x34ab3e);}};exports[_0xe7a3('0x47')]=function(_0x3b621f){try{if(!_['isNil'](channels[_0x3b621f[_0xe7a3('0x6')]])){utils['debug'](util[_0xe7a3('0xa')](_0xe7a3('0x48'),_0x3b621f[_0xe7a3('0x6')]),_0x3b621f);if(!_[_0xe7a3('0x23')](_0x3b621f[_0xe7a3('0x49')][_0xe7a3('0x4a')])){utils[_0xe7a3('0x9')](util[_0xe7a3('0xa')](_0xe7a3('0x4b'),_0x3b621f['uniqueid'],_0x3b621f[_0xe7a3('0x4c')]));channels[_0x3b621f[_0xe7a3('0x6')]][_0xe7a3('0x4d')]=_0x3b621f[_0xe7a3('0x4c')];}if(!_[_0xe7a3('0x23')](_0x3b621f['variable'][_0xe7a3('0x4e')])){utils[_0xe7a3('0x9')](util['format'](_0xe7a3('0x4f'),_0x3b621f['uniqueid'],_0x3b621f[_0xe7a3('0x4c')]));channels[_0x3b621f['uniqueid']][_0xe7a3('0x50')]=_0x3b621f[_0xe7a3('0x4c')];channels[_0x3b621f['uniqueid']][_0xe7a3('0x2f')]='\x22'+_0x3b621f['value']+_0xe7a3('0x51')+_0x3b621f[_0xe7a3('0x4c')]+'>';}if(!_['isNil'](_0x3b621f[_0xe7a3('0x49')][_0xe7a3('0x52')])||!_[_0xe7a3('0x23')](_0x3b621f[_0xe7a3('0x49')][_0xe7a3('0x53')])){utils[_0xe7a3('0x9')](util[_0xe7a3('0xa')](_0xe7a3('0x54'),_0x3b621f[_0xe7a3('0x6')],!_[_0xe7a3('0x23')](_0x3b621f[_0xe7a3('0x49')][_0xe7a3('0x52')])?'xmd-callerid-preview':_0xe7a3('0x53'),_0x3b621f[_0xe7a3('0x4c')]));channels[_0x3b621f[_0xe7a3('0x6')]][_0xe7a3('0x2f')]=_0x3b621f[_0xe7a3('0x4c')];}if(!_[_0xe7a3('0x23')](_0x3b621f['variable'][_0xe7a3('0x55')])||!_[_0xe7a3('0x23')](_0x3b621f[_0xe7a3('0x49')][_0xe7a3('0x56')])){utils['info'](util[_0xe7a3('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x3b621f['uniqueid'],!_[_0xe7a3('0x23')](_0x3b621f['variable']['xmd-queue'])?_0xe7a3('0x55'):_0xe7a3('0x56'),_0x3b621f[_0xe7a3('0x4c')]));channels[_0x3b621f[_0xe7a3('0x6')]][_0xe7a3('0x57')]=_0xe7a3('0x58');channels[_0x3b621f[_0xe7a3('0x6')]][_0xe7a3('0x59')]=_0x3b621f[_0xe7a3('0x4c')];channels[_0x3b621f[_0xe7a3('0x6')]][_0xe7a3('0xd')]=!![];}if(!_[_0xe7a3('0x23')](_0x3b621f[_0xe7a3('0x49')][_0xe7a3('0x5a')])){utils[_0xe7a3('0x9')](util[_0xe7a3('0xa')](_0xe7a3('0x5b'),_0x3b621f['uniqueid'],_0x3b621f[_0xe7a3('0x4c')]));channels[_0x3b621f[_0xe7a3('0x6')]][_0xe7a3('0x5c')]=_0x3b621f[_0xe7a3('0x4c')];}if(!_[_0xe7a3('0x23')](_0x3b621f['variable'][_0xe7a3('0x5d')])){utils[_0xe7a3('0x9')](util[_0xe7a3('0xa')](_0xe7a3('0x5e'),_0x3b621f['uniqueid'],_0x3b621f[_0xe7a3('0x4c')]));channels[_0x3b621f['uniqueid']][_0xe7a3('0x5f')]=_0x3b621f[_0xe7a3('0x4c')];}if(!_[_0xe7a3('0x23')](_0x3b621f[_0xe7a3('0x49')][_0xe7a3('0x60')])){utils[_0xe7a3('0x9')](util[_0xe7a3('0xa')](_0xe7a3('0x61'),_0x3b621f[_0xe7a3('0x6')],_0x3b621f['value']));channels[_0x3b621f[_0xe7a3('0x6')]][_0xe7a3('0x62')]=_0x3b621f['value'];}if(!_['isNil'](_0x3b621f[_0xe7a3('0x49')][_0xe7a3('0x63')])){utils[_0xe7a3('0x9')](util[_0xe7a3('0xa')](_0xe7a3('0x64'),_0x3b621f['uniqueid'],_0x3b621f[_0xe7a3('0x4c')]));channels[_0x3b621f[_0xe7a3('0x6')]][_0xe7a3('0x63')]=_0x3b621f['value'];}}}catch(_0x170b28){utils[_0xe7a3('0x20')](util[_0xe7a3('0xa')](_0xe7a3('0x48'),_0x3b621f[_0xe7a3('0x6')]),_0x170b28);}};exports[_0xe7a3('0x65')]=function(_0x270a44){try{if(!_['isNil'](channels[_0x270a44[_0xe7a3('0x6')]])){utils[_0xe7a3('0x2d')](util[_0xe7a3('0xa')](_0xe7a3('0x66'),_0x270a44[_0xe7a3('0x6')]),_0x270a44);utils[_0xe7a3('0x9')](util[_0xe7a3('0xa')](_0xe7a3('0x67'),_0x270a44[_0xe7a3('0x6')],_0x270a44[_0xe7a3('0x68')],_0x270a44['appdata']));if(_0x270a44[_0xe7a3('0x68')]['toLowerCase']()==_0xe7a3('0x69')&&_[_0xe7a3('0x6a')](_0x270a44[_0xe7a3('0x6b')][_0xe7a3('0x6c')](),_0xe7a3('0x6d'))){var _0xec6b98=_0x270a44['appdata'][_0xe7a3('0x6e')]('=');var _0x5b6439=_0xec6b98[0x0]['substring'](_0xec6b98[0x0][_0xe7a3('0x6f')]('(')+0x1,_0xec6b98[0x0][_0xe7a3('0x6f')](')'));var _0x494665=_0xec6b98[0x1];channels[_0x270a44['uniqueid']][_0x5b6439]=_0x494665;}if(!_[_0xe7a3('0x70')]([_0xe7a3('0x2c'),_0xe7a3('0x71'),_0xe7a3('0x72'),_0xe7a3('0x69'),_0xe7a3('0x73')],_0x270a44[_0xe7a3('0x68')][_0xe7a3('0x6c')]())){channels[_0x270a44[_0xe7a3('0x6')]]['lastapplication']=_0x270a44['application'];channels[_0x270a44[_0xe7a3('0x6')]][_0xe7a3('0x59')]=_0x270a44[_0xe7a3('0x6b')];}}}catch(_0x483ae2){utils[_0xe7a3('0x20')](util[_0xe7a3('0xa')](_0xe7a3('0x66'),_0x270a44[_0xe7a3('0x6')]),_0x483ae2);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index e8b6715..b1da6d4 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 _0x2e9a=['[core]\x20error','close','[core]\x20close','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error'];(function(_0x5a0de5,_0xa0bbf4){var _0x5321c9=function(_0x5d72d1){while(--_0x5d72d1){_0x5a0de5['push'](_0x5a0de5['shift']());}};_0x5321c9(++_0xa0bbf4);}(_0x2e9a,0x18f));var _0xa2e9=function(_0x3b182c,_0x244c87){_0x3b182c=_0x3b182c-0x0;var _0x32c77b=_0x2e9a[_0x3b182c];return _0x32c77b;};'use strict';var utils=require(_0xa2e9('0x0'));exports[_0xa2e9('0x1')]=function(){utils[_0xa2e9('0x2')](_0xa2e9('0x3'));};exports[_0xa2e9('0x4')]=function(){utils[_0xa2e9('0x2')](_0xa2e9('0x5'));};exports[_0xa2e9('0x6')]=function(){utils['info'](_0xa2e9('0x7'));};exports[_0xa2e9('0x8')]=function(_0x8bb71a){utils[_0xa2e9('0x8')](_0xa2e9('0x9'),_0x8bb71a);};exports[_0xa2e9('0xa')]=function(){utils['info'](_0xa2e9('0xb'));};exports['managerevent']=function(_0x55e874){}; \ No newline at end of file +var _0xcd3e=['error','[core]\x20error','close','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','[core]\x20fullybooted'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xcd3e,0x81));var _0xecd3=function(_0x506d2f,_0x5ab76e){_0x506d2f=_0x506d2f-0x0;var _0x101255=_0xcd3e[_0x506d2f];return _0x101255;};'use strict';var utils=require('./utils');exports[_0xecd3('0x0')]=function(){utils[_0xecd3('0x1')](_0xecd3('0x2'));};exports[_0xecd3('0x3')]=function(){utils['info'](_0xecd3('0x4'));};exports['fullybooted']=function(){utils['info'](_0xecd3('0x5'));};exports['error']=function(_0x471f7b){utils[_0xecd3('0x6')](_0xecd3('0x7'),_0x471f7b);};exports[_0xecd3('0x8')]=function(){utils[_0xecd3('0x1')]('[core]\x20close');};exports['managerevent']=function(_0x208272){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index de6c186..ec13fd4 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 _0x6f3c=['now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','error','[%s][dials][dialbegin]','[%s][dials][dialend]','answertime','lastevent','hangup','[%s][dials][hangup]','calleridname','complete','duration','endtime','starttime','holdtime','diffTime','billableseconds','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','split','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign'];(function(_0x1f38c5,_0x735642){var _0x1c58cb=function(_0xca3f94){while(--_0xca3f94){_0x1f38c5['push'](_0x1f38c5['shift']());}};_0x1c58cb(++_0x735642);}(_0x6f3c,0x1ca));var _0xc6f3=function(_0x46e516,_0x46d7ac){_0x46e516=_0x46e516-0x0;var _0x46e734=_0x6f3c[_0x46e516];return _0x46e734;};'use strict';var _=require(_0xc6f3('0x0'));var util=require(_0xc6f3('0x1'));var utils=require(_0xc6f3('0x2'));var dials={};function writeDB(_0xd62b6d){utils['info'](util[_0xc6f3('0x3')](_0xc6f3('0x4'),_0xd62b6d[_0xc6f3('0x5')],_0xd62b6d[_0xc6f3('0x6')],_0xd62b6d['dialstring'],_0xd62b6d[_0xc6f3('0x7')],_0xd62b6d[_0xc6f3('0x8')],_0xd62b6d[_0xc6f3('0x9')]));utils['request'](_0xc6f3('0xa'),_0xd62b6d);delete dials[_0xd62b6d[_0xc6f3('0x5')]];}exports['newexten']=function(_0x1dedb1){try{utils[_0xc6f3('0xb')](util[_0xc6f3('0x3')](_0xc6f3('0xc'),_0x1dedb1[_0xc6f3('0x5')]),_0x1dedb1);utils[_0xc6f3('0xd')](util[_0xc6f3('0x3')](_0xc6f3('0xe'),_0x1dedb1[_0xc6f3('0x5')],_0x1dedb1[_0xc6f3('0xf')],_0x1dedb1['appdata']));if(_0x1dedb1[_0xc6f3('0xf')]['toLowerCase']()=='set'&&_['startsWith'](_0x1dedb1[_0xc6f3('0x10')]['toLowerCase'](),'cdr(routeid)')){var _0x552b89=_0x1dedb1[_0xc6f3('0x10')][_0xc6f3('0x11')]('=');dials[_0x1dedb1['uniqueid']]={'routeId':_0x552b89[0x1]};}}catch(_0x546ce8){utils['error'](util[_0xc6f3('0x3')]('[%s][dials][newexten]',_0x1dedb1[_0xc6f3('0x5')]),_0x546ce8);}};exports[_0xc6f3('0x12')]=function(_0x3176ca){try{utils[_0xc6f3('0xb')](util['format'](_0xc6f3('0x13'),_0x3176ca['uniqueid']),_0x3176ca);if(!_[_0xc6f3('0x14')](_0x3176ca['variable'][_0xc6f3('0x15')])){utils[_0xc6f3('0xd')](util[_0xc6f3('0x3')](_0xc6f3('0x16'),_0x3176ca['uniqueid'],_0x3176ca[_0xc6f3('0x17')]));dials[_0x3176ca['uniqueid']]={'routeId':_0x3176ca[_0xc6f3('0x17')]};}}catch(_0x28ddbe){utils['error'](util['format']('[%s][dials][varset]',_0x3176ca['uniqueid']),_0x28ddbe);}};exports[_0xc6f3('0x18')]=function(_0x25b60b){try{if(!_[_0xc6f3('0x14')](dials[_0x25b60b[_0xc6f3('0x5')]])){utils[_0xc6f3('0xb')](util[_0xc6f3('0x3')]('[%s][dials][dialbegin]',_0x25b60b[_0xc6f3('0x5')]),_0x25b60b);dials[_0x25b60b[_0xc6f3('0x5')]]=_[_0xc6f3('0x19')](dials[_0x25b60b['uniqueid']],_0x25b60b);dials[_0x25b60b[_0xc6f3('0x5')]]['starttime']=utils[_0xc6f3('0x1a')]();dials[_0x25b60b[_0xc6f3('0x5')]]['lastevent']=_0xc6f3('0x1b');utils['info'](util[_0xc6f3('0x3')](_0xc6f3('0x1c'),_0x25b60b['uniqueid'],dials[_0x25b60b[_0xc6f3('0x5')]]['starttime']));}}catch(_0x1bb99f){utils[_0xc6f3('0x1d')](util[_0xc6f3('0x3')](_0xc6f3('0x1e'),_0x25b60b[_0xc6f3('0x5')]),_0x1bb99f);}};exports['dialend']=function(_0x54bb5b){try{if(!_[_0xc6f3('0x14')](dials[_0x54bb5b['uniqueid']])){utils['debug'](util[_0xc6f3('0x3')](_0xc6f3('0x1f'),_0x54bb5b[_0xc6f3('0x5')]),_0x54bb5b);dials[_0x54bb5b[_0xc6f3('0x5')]]['dialstatus']=_0x54bb5b[_0xc6f3('0x9')];if(_0x54bb5b[_0xc6f3('0x9')]=='ANSWER'){dials[_0x54bb5b['uniqueid']]=_[_0xc6f3('0x19')](dials[_0x54bb5b['uniqueid']],_0x54bb5b);dials[_0x54bb5b[_0xc6f3('0x5')]][_0xc6f3('0x20')]=utils[_0xc6f3('0x1a')]();dials[_0x54bb5b[_0xc6f3('0x5')]][_0xc6f3('0x21')]='connect';utils['info'](util[_0xc6f3('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x54bb5b['uniqueid'],_0x54bb5b['dialstatus'],dials[_0x54bb5b[_0xc6f3('0x5')]][_0xc6f3('0x20')]));}else{utils[_0xc6f3('0xd')](util[_0xc6f3('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x54bb5b[_0xc6f3('0x5')],_0x54bb5b[_0xc6f3('0x9')]));}}}catch(_0x23e29d){utils[_0xc6f3('0x1d')](util[_0xc6f3('0x3')](_0xc6f3('0x1f'),_0x54bb5b[_0xc6f3('0x5')]),_0x23e29d);}};exports[_0xc6f3('0x22')]=function(_0x3c3f59){try{if(!_[_0xc6f3('0x14')](dials[_0x3c3f59['uniqueid']])){utils[_0xc6f3('0xb')](util[_0xc6f3('0x3')](_0xc6f3('0x23'),_0x3c3f59[_0xc6f3('0x5')]),_0x3c3f59);utils[_0xc6f3('0xd')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x3c3f59[_0xc6f3('0x5')],_0x3c3f59[_0xc6f3('0x7')],_0x3c3f59[_0xc6f3('0x24')],_0x3c3f59['cause-txt']));dials[_0x3c3f59['uniqueid']]=_[_0xc6f3('0x19')](dials[_0x3c3f59['uniqueid']],{'endtime':utils[_0xc6f3('0x1a')](),'lastevent':_0xc6f3('0x25')});dials[_0x3c3f59[_0xc6f3('0x5')]][_0xc6f3('0x26')]=utils['diffTime'](dials[_0x3c3f59[_0xc6f3('0x5')]][_0xc6f3('0x27')],dials[_0x3c3f59[_0xc6f3('0x5')]][_0xc6f3('0x28')]);dials[_0x3c3f59['uniqueid']][_0xc6f3('0x29')]=utils[_0xc6f3('0x2a')](dials[_0x3c3f59[_0xc6f3('0x5')]]['answertime']||dials[_0x3c3f59['uniqueid']][_0xc6f3('0x27')],dials[_0x3c3f59[_0xc6f3('0x5')]]['starttime']);dials[_0x3c3f59[_0xc6f3('0x5')]][_0xc6f3('0x2b')]=dials[_0x3c3f59['uniqueid']][_0xc6f3('0x20')]?utils[_0xc6f3('0x2a')](dials[_0x3c3f59[_0xc6f3('0x5')]][_0xc6f3('0x27')],dials[_0x3c3f59[_0xc6f3('0x5')]][_0xc6f3('0x20')]):0x0;writeDB(dials[_0x3c3f59[_0xc6f3('0x5')]]);}}catch(_0x3dca00){utils[_0xc6f3('0x1d')](util[_0xc6f3('0x3')](_0xc6f3('0x23'),_0x3c3f59[_0xc6f3('0x5')]),_0x3dca00);}}; \ No newline at end of file +var _0x0b28=['[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','set','appdata','split','error','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','isNil','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','[%s][dials][dialbegin]','[%s][dials][dialend]','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','diffTime','endtime','holdtime','lodash','util','./utils','info','format','uniqueid','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]'];(function(_0x979d28,_0x4811d9){var _0x208b30=function(_0x2e7b8d){while(--_0x2e7b8d){_0x979d28['push'](_0x979d28['shift']());}};_0x208b30(++_0x4811d9);}(_0x0b28,0xb1));var _0x80b2=function(_0x53afe9,_0x2c9f40){_0x53afe9=_0x53afe9-0x0;var _0x396396=_0x0b28[_0x53afe9];return _0x396396;};'use strict';var _=require(_0x80b2('0x0'));var util=require(_0x80b2('0x1'));var utils=require(_0x80b2('0x2'));var dials={};function writeDB(_0x93cff3){utils[_0x80b2('0x3')](util[_0x80b2('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x93cff3[_0x80b2('0x5')],_0x93cff3[_0x80b2('0x6')],_0x93cff3[_0x80b2('0x7')],_0x93cff3['calleridnum'],_0x93cff3[_0x80b2('0x8')],_0x93cff3[_0x80b2('0x9')]));utils[_0x80b2('0xa')](_0x80b2('0xb'),_0x93cff3);delete dials[_0x93cff3[_0x80b2('0x5')]];}exports[_0x80b2('0xc')]=function(_0x25a13c){try{utils[_0x80b2('0xd')](util[_0x80b2('0x4')](_0x80b2('0xe'),_0x25a13c[_0x80b2('0x5')]),_0x25a13c);utils['info'](util[_0x80b2('0x4')](_0x80b2('0xf'),_0x25a13c[_0x80b2('0x5')],_0x25a13c[_0x80b2('0x10')],_0x25a13c['appdata']));if(_0x25a13c[_0x80b2('0x10')]['toLowerCase']()==_0x80b2('0x11')&&_['startsWith'](_0x25a13c[_0x80b2('0x12')]['toLowerCase'](),'cdr(routeid)')){var _0x23929d=_0x25a13c['appdata'][_0x80b2('0x13')]('=');dials[_0x25a13c['uniqueid']]={'routeId':_0x23929d[0x1]};}}catch(_0x57cc1d){utils[_0x80b2('0x14')](util['format']('[%s][dials][newexten]',_0x25a13c[_0x80b2('0x5')]),_0x57cc1d);}};exports[_0x80b2('0x15')]=function(_0x48e6eb){try{utils['debug'](util['format'](_0x80b2('0x16'),_0x48e6eb[_0x80b2('0x5')]),_0x48e6eb);if(!_['isNil'](_0x48e6eb[_0x80b2('0x17')][_0x80b2('0x18')])){utils[_0x80b2('0x3')](util[_0x80b2('0x4')](_0x80b2('0x19'),_0x48e6eb[_0x80b2('0x5')],_0x48e6eb[_0x80b2('0x1a')]));dials[_0x48e6eb[_0x80b2('0x5')]]={'routeId':_0x48e6eb[_0x80b2('0x1a')]};}}catch(_0x59aa50){utils['error'](util[_0x80b2('0x4')](_0x80b2('0x16'),_0x48e6eb[_0x80b2('0x5')]),_0x59aa50);}};exports['dialbegin']=function(_0x26ec6a){try{if(!_[_0x80b2('0x1b')](dials[_0x26ec6a['uniqueid']])){utils[_0x80b2('0xd')](util['format']('[%s][dials][dialbegin]',_0x26ec6a[_0x80b2('0x5')]),_0x26ec6a);dials[_0x26ec6a['uniqueid']]=_[_0x80b2('0x1c')](dials[_0x26ec6a['uniqueid']],_0x26ec6a);dials[_0x26ec6a['uniqueid']]['starttime']=utils[_0x80b2('0x1d')]();dials[_0x26ec6a[_0x80b2('0x5')]][_0x80b2('0x1e')]=_0x80b2('0x1f');utils[_0x80b2('0x3')](util[_0x80b2('0x4')](_0x80b2('0x20'),_0x26ec6a['uniqueid'],dials[_0x26ec6a[_0x80b2('0x5')]][_0x80b2('0x21')]));}}catch(_0x580474){utils[_0x80b2('0x14')](util[_0x80b2('0x4')](_0x80b2('0x22'),_0x26ec6a['uniqueid']),_0x580474);}};exports['dialend']=function(_0x1be024){try{if(!_[_0x80b2('0x1b')](dials[_0x1be024[_0x80b2('0x5')]])){utils[_0x80b2('0xd')](util['format'](_0x80b2('0x23'),_0x1be024[_0x80b2('0x5')]),_0x1be024);dials[_0x1be024[_0x80b2('0x5')]][_0x80b2('0x9')]=_0x1be024[_0x80b2('0x9')];if(_0x1be024[_0x80b2('0x9')]=='ANSWER'){dials[_0x1be024[_0x80b2('0x5')]]=_[_0x80b2('0x1c')](dials[_0x1be024['uniqueid']],_0x1be024);dials[_0x1be024[_0x80b2('0x5')]][_0x80b2('0x24')]=utils['now']();dials[_0x1be024[_0x80b2('0x5')]][_0x80b2('0x1e')]=_0x80b2('0x25');utils[_0x80b2('0x3')](util[_0x80b2('0x4')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x1be024[_0x80b2('0x5')],_0x1be024[_0x80b2('0x9')],dials[_0x1be024[_0x80b2('0x5')]]['answertime']));}else{utils[_0x80b2('0x3')](util[_0x80b2('0x4')](_0x80b2('0x26'),_0x1be024[_0x80b2('0x5')],_0x1be024['dialstatus']));}}}catch(_0x281041){utils[_0x80b2('0x14')](util[_0x80b2('0x4')](_0x80b2('0x23'),_0x1be024['uniqueid']),_0x281041);}};exports[_0x80b2('0x27')]=function(_0x17c291){try{if(!_[_0x80b2('0x1b')](dials[_0x17c291[_0x80b2('0x5')]])){utils['debug'](util[_0x80b2('0x4')](_0x80b2('0x28'),_0x17c291['uniqueid']),_0x17c291);utils[_0x80b2('0x3')](util[_0x80b2('0x4')](_0x80b2('0x29'),_0x17c291[_0x80b2('0x5')],_0x17c291[_0x80b2('0x2a')],_0x17c291[_0x80b2('0x2b')],_0x17c291[_0x80b2('0x2c')]));dials[_0x17c291[_0x80b2('0x5')]]=_[_0x80b2('0x1c')](dials[_0x17c291[_0x80b2('0x5')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x17c291[_0x80b2('0x5')]]['duration']=utils[_0x80b2('0x2d')](dials[_0x17c291[_0x80b2('0x5')]][_0x80b2('0x2e')],dials[_0x17c291[_0x80b2('0x5')]]['starttime']);dials[_0x17c291['uniqueid']][_0x80b2('0x2f')]=utils['diffTime'](dials[_0x17c291[_0x80b2('0x5')]][_0x80b2('0x24')]||dials[_0x17c291[_0x80b2('0x5')]][_0x80b2('0x2e')],dials[_0x17c291[_0x80b2('0x5')]]['starttime']);dials[_0x17c291[_0x80b2('0x5')]]['billableseconds']=dials[_0x17c291[_0x80b2('0x5')]][_0x80b2('0x24')]?utils['diffTime'](dials[_0x17c291[_0x80b2('0x5')]][_0x80b2('0x2e')],dials[_0x17c291[_0x80b2('0x5')]][_0x80b2('0x24')]):0x0;writeDB(dials[_0x17c291['uniqueid']]);}}catch(_0x361f14){utils[_0x80b2('0x14')](util[_0x80b2('0x4')]('[%s][dials][hangup]',_0x17c291[_0x80b2('0x5')]),_0x361f14);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 1e6da00..1a09547 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 _0xa327=['./utils','xdr','env','production','asterisk','password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager'];(function(_0x58661b,_0x5953fd){var _0x472220=function(_0x4c1bdd){while(--_0x4c1bdd){_0x58661b['push'](_0x58661b['shift']());}};_0x472220(++_0x5953fd);}(_0xa327,0x191));var _0x7a32=function(_0x588502,_0x229942){_0x588502=_0x588502-0x0;var _0x40cc85=_0xa327[_0x588502];return _0x40cc85;};var AsteriskManager=require(_0x7a32('0x0'));var config=require('../../config/environment');var utils=require(_0x7a32('0x1'));var util=require('util');var isXDREnabled=config['xdr']&&config['xdr']['disabled']?!config[_0x7a32('0x2')]['disabled']:!![];var isProduction=config[_0x7a32('0x3')]===_0x7a32('0x4')||![];var isLocalAsterisk=config[_0x7a32('0x2')]&&config[_0x7a32('0x2')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x7a32('0x5')]['port'],config['asterisk']['ip'],config[_0x7a32('0x5')]['username'],config[_0x7a32('0x5')][_0x7a32('0x6')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x7a32('0x7')](_0x7a32('0x8'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x7a32('0x7')](_0x7a32('0x9'));}else{var agents=require(_0x7a32('0xa'));var calls=require(_0x7a32('0xb'));var queues=require(_0x7a32('0xc'));var recordings=require('./recordings.controller');var members=require(_0x7a32('0xd'));var dials=require(_0x7a32('0xe'));var transfers=require(_0x7a32('0xf'));var core=require(_0x7a32('0x10'));ami['on'](_0x7a32('0x11'),core['connect']);ami['on'](_0x7a32('0x12'),core[_0x7a32('0x12')]);ami['on']('fullybooted',core[_0x7a32('0x13')]);ami['on'](_0x7a32('0x14'),core[_0x7a32('0x14')]);ami['on'](_0x7a32('0x15'),core[_0x7a32('0x15')]);ami['on'](_0x7a32('0x16'),core[_0x7a32('0x16')]);ami['on'](_0x7a32('0x17'),function(_0x55ac4c){try{utils[_0x7a32('0x18')](util[_0x7a32('0x19')](_0x7a32('0x1a'),_0x55ac4c[_0x7a32('0x1b')]),_0x55ac4c);members[_0x7a32('0x17')](_0x55ac4c);}catch(_0x555197){utils[_0x7a32('0x14')](util[_0x7a32('0x19')](_0x7a32('0x1a'),_0x55ac4c[_0x7a32('0x1b')]),_0x555197);}});ami['on']('agentcalled',function(_0x59896a){try{utils[_0x7a32('0x18')](util[_0x7a32('0x19')](_0x7a32('0x1c'),_0x59896a[_0x7a32('0x1d')]),_0x59896a);agents[_0x7a32('0x1e')](_0x59896a);}catch(_0x126639){utils[_0x7a32('0x14')](util['format'](_0x7a32('0x1c'),_0x59896a['uniqueid']),_0x126639);}});ami['on'](_0x7a32('0x1f'),function(_0x209855){try{utils['debug'](util['format'](_0x7a32('0x20'),_0x209855[_0x7a32('0x1d')]),_0x209855);agents['agentringnoanswer'](_0x209855);}catch(_0x361b44){utils[_0x7a32('0x14')](util[_0x7a32('0x19')]('[%s][index][agentringnoanswer]',_0x209855['uniqueid']),_0x361b44);}});ami['on'](_0x7a32('0x21'),function(_0x103984){try{utils[_0x7a32('0x18')](util[_0x7a32('0x19')](_0x7a32('0x22'),_0x103984[_0x7a32('0x1d')]),_0x103984);agents[_0x7a32('0x21')](_0x103984);queues[_0x7a32('0x21')](_0x103984);}catch(_0x2031b8){utils['error'](util[_0x7a32('0x19')]('[%s][index][agentconnect]',_0x103984[_0x7a32('0x1d')]),_0x2031b8);}});ami['on']('agentcomplete',function(_0x5371b0){try{utils[_0x7a32('0x18')](util[_0x7a32('0x19')](_0x7a32('0x23'),_0x5371b0[_0x7a32('0x1d')]),_0x5371b0);agents[_0x7a32('0x24')](_0x5371b0);queues[_0x7a32('0x24')](_0x5371b0);members[_0x7a32('0x24')](_0x5371b0);}catch(_0x5ed74e){utils['error'](util[_0x7a32('0x19')](_0x7a32('0x23'),_0x5371b0[_0x7a32('0x1d')]),_0x5ed74e);}});ami['on'](_0x7a32('0x25'),function(_0x2ffaa4){try{utils['debug'](util[_0x7a32('0x19')](_0x7a32('0x26'),_0x2ffaa4[_0x7a32('0x1d')]),_0x2ffaa4);agents[_0x7a32('0x25')](_0x2ffaa4);queues[_0x7a32('0x25')](_0x2ffaa4);}catch(_0x4052b5){utils['error'](util[_0x7a32('0x19')](_0x7a32('0x26'),_0x2ffaa4[_0x7a32('0x1d')]),_0x4052b5);}});ami['on']('queuecallerjoin',function(_0x198570){try{utils[_0x7a32('0x18')](util[_0x7a32('0x19')](_0x7a32('0x27'),_0x198570[_0x7a32('0x1d')]),_0x198570);queues[_0x7a32('0x28')](_0x198570);recordings[_0x7a32('0x28')](_0x198570);}catch(_0x18cf2a){utils[_0x7a32('0x14')](util[_0x7a32('0x19')]('[%s][index][queuecallerjoin]',_0x198570[_0x7a32('0x1d')]),_0x18cf2a);}});ami['on'](_0x7a32('0x29'),function(_0x470eb3){try{utils[_0x7a32('0x18')](util[_0x7a32('0x19')]('[%s][index][queuecallerleave]',_0x470eb3[_0x7a32('0x1d')]),_0x470eb3);queues[_0x7a32('0x29')](_0x470eb3);}catch(_0x5ca392){utils[_0x7a32('0x14')](util[_0x7a32('0x19')](_0x7a32('0x2a'),_0x470eb3[_0x7a32('0x1d')]),_0x5ca392);}});ami['on']('musiconholdstart',function(_0x220781){try{utils[_0x7a32('0x18')](util[_0x7a32('0x19')](_0x7a32('0x2b'),_0x220781[_0x7a32('0x1d')]),_0x220781);queues[_0x7a32('0x2c')](_0x220781);calls[_0x7a32('0x2c')](_0x220781);}catch(_0x416948){utils['error'](util[_0x7a32('0x19')](_0x7a32('0x2b'),_0x220781[_0x7a32('0x1d')]),_0x416948);}});ami['on'](_0x7a32('0x2d'),function(_0x3709f4){try{utils[_0x7a32('0x18')](util[_0x7a32('0x19')](_0x7a32('0x2e'),_0x3709f4['uniqueid']),_0x3709f4);queues['musiconholdstop'](_0x3709f4);calls[_0x7a32('0x2d')](_0x3709f4);}catch(_0x4578ba){utils[_0x7a32('0x14')](util[_0x7a32('0x19')](_0x7a32('0x2e'),_0x3709f4[_0x7a32('0x1d')]),_0x4578ba);}});ami['on']('newstate',function(_0x3b6915){try{utils[_0x7a32('0x18')](util[_0x7a32('0x19')]('[%s][index][newstate]',_0x3b6915['uniqueid']),_0x3b6915);calls['newstate'](_0x3b6915);recordings[_0x7a32('0x2f')](_0x3b6915);}catch(_0x3bee61){utils[_0x7a32('0x14')](util[_0x7a32('0x19')](_0x7a32('0x30'),_0x3b6915[_0x7a32('0x1d')]),_0x3bee61);}});ami['on']('hangup',function(_0x1e15c6){try{utils['debug'](util[_0x7a32('0x19')](_0x7a32('0x31'),_0x1e15c6['uniqueid']),_0x1e15c6);calls[_0x7a32('0x32')](_0x1e15c6);recordings[_0x7a32('0x32')](_0x1e15c6);dials[_0x7a32('0x32')](_0x1e15c6);agents['hangup'](_0x1e15c6);queues['hangup'](_0x1e15c6);}catch(_0x13a003){utils['error'](util['format'](_0x7a32('0x31'),_0x1e15c6[_0x7a32('0x1d')]),_0x13a003);}});ami['on']('cdr',function(_0x19511f){try{utils['debug'](util[_0x7a32('0x19')](_0x7a32('0x33'),_0x19511f['uniqueid']),_0x19511f);members['cdr'](_0x19511f);}catch(_0x2f523a){utils['error'](util[_0x7a32('0x19')](_0x7a32('0x33'),_0x19511f[_0x7a32('0x1d')]),_0x2f523a);}});ami['on']('blindtransfer',function(_0x40dffc){try{utils[_0x7a32('0x18')](util[_0x7a32('0x19')]('[%s][index][blindtransfer]',_0x40dffc[_0x7a32('0x1d')]),_0x40dffc);queues[_0x7a32('0x34')](_0x40dffc);agents[_0x7a32('0x34')](_0x40dffc);transfers[_0x7a32('0x34')](_0x40dffc);recordings[_0x7a32('0x34')](_0x40dffc);}catch(_0xe0f5ab){utils[_0x7a32('0x14')](util[_0x7a32('0x19')](_0x7a32('0x35'),_0x40dffc[_0x7a32('0x1d')]),_0xe0f5ab);}});ami['on'](_0x7a32('0x36'),function(_0x3e1792){try{utils[_0x7a32('0x18')](util[_0x7a32('0x19')]('[%s][index][attendedtransfer]',_0x3e1792[_0x7a32('0x37')]),_0x3e1792);queues[_0x7a32('0x36')](_0x3e1792);transfers[_0x7a32('0x36')](_0x3e1792);agents[_0x7a32('0x36')](_0x3e1792);calls[_0x7a32('0x36')](_0x3e1792);}catch(_0x31e812){utils[_0x7a32('0x14')](util[_0x7a32('0x19')]('[%s][index][attendedtransfer]',_0x3e1792[_0x7a32('0x37')]),_0x31e812);}});ami['on'](_0x7a32('0x38'),function(_0x2d74df){try{utils['debug'](util[_0x7a32('0x19')](_0x7a32('0x39'),_0x2d74df[_0x7a32('0x1d')]),_0x2d74df);queues['varset'](_0x2d74df);recordings[_0x7a32('0x38')](_0x2d74df);calls[_0x7a32('0x38')](_0x2d74df);dials['varset'](_0x2d74df);}catch(_0x2cbbf8){utils[_0x7a32('0x14')](util['format'](_0x7a32('0x39'),_0x2d74df[_0x7a32('0x1d')]),_0x2cbbf8);}});ami['on'](_0x7a32('0x3a'),function(_0x186cc5){try{utils['debug'](util[_0x7a32('0x19')](_0x7a32('0x3b'),_0x186cc5[_0x7a32('0x1d')]),_0x186cc5);calls[_0x7a32('0x3a')](_0x186cc5);recordings['newexten'](_0x186cc5);dials[_0x7a32('0x3a')](_0x186cc5);}catch(_0x3bce95){utils['error'](util[_0x7a32('0x19')]('[%s][index][newexten]',_0x186cc5['uniqueid']),_0x3bce95);}});ami['on']('newchannel',function(_0x324f90){try{utils[_0x7a32('0x18')](util[_0x7a32('0x19')](_0x7a32('0x3c'),_0x324f90[_0x7a32('0x1d')]),_0x324f90);calls[_0x7a32('0x3d')](_0x324f90);recordings[_0x7a32('0x3d')](_0x324f90);}catch(_0x5b05a6){utils['error'](util[_0x7a32('0x19')](_0x7a32('0x3c'),_0x324f90[_0x7a32('0x1d')]),_0x5b05a6);}});ami['on']('dialbegin',function(_0x2ca802){try{utils['debug'](util['format'](_0x7a32('0x3e'),_0x2ca802[_0x7a32('0x1d')]),_0x2ca802);dials[_0x7a32('0x3f')](_0x2ca802);}catch(_0x48a225){utils[_0x7a32('0x14')](util['format'](_0x7a32('0x40'),_0x2ca802[_0x7a32('0x1d')]),_0x48a225);}});ami['on'](_0x7a32('0x41'),function(_0x9a934a){try{utils['debug'](util['format']('[%s][index][dialend]',_0x9a934a[_0x7a32('0x1d')]),_0x9a934a);dials['dialend'](_0x9a934a);}catch(_0x11d0d1){utils[_0x7a32('0x14')](util['format'](_0x7a32('0x42'),_0x9a934a[_0x7a32('0x1d')]),_0x11d0d1);}});} \ No newline at end of file +var _0x4481=['[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','disabled','production','local','asterisk','port','password','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','debug','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4481,0xdb));var _0x1448=function(_0xe92df4,_0x3a122f){_0xe92df4=_0xe92df4-0x0;var _0x5927af=_0x4481[_0xe92df4];return _0x5927af;};var AsteriskManager=require(_0x1448('0x0'));var config=require(_0x1448('0x1'));var utils=require(_0x1448('0x2'));var util=require('util');var isXDREnabled=config[_0x1448('0x3')]&&config[_0x1448('0x3')][_0x1448('0x4')]?!config[_0x1448('0x3')][_0x1448('0x4')]:!![];var isProduction=config['env']===_0x1448('0x5')||![];var isLocalAsterisk=config[_0x1448('0x3')]&&config['xdr'][_0x1448('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x1448('0x7')][_0x1448('0x8')],config[_0x1448('0x7')]['ip'],config[_0x1448('0x7')]['username'],config[_0x1448('0x7')][_0x1448('0x9')],!![]);ami['keepConnected']();if(!isXDREnabled){utils['info'](_0x1448('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x1448('0xb')](_0x1448('0xc'));}else{var agents=require(_0x1448('0xd'));var calls=require(_0x1448('0xe'));var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require(_0x1448('0xf'));var dials=require(_0x1448('0x10'));var transfers=require('./transfers.controller');var core=require(_0x1448('0x11'));ami['on'](_0x1448('0x12'),core[_0x1448('0x12')]);ami['on'](_0x1448('0x13'),core['shutdown']);ami['on'](_0x1448('0x14'),core[_0x1448('0x14')]);ami['on'](_0x1448('0x15'),core[_0x1448('0x15')]);ami['on'](_0x1448('0x16'),core[_0x1448('0x16')]);ami['on'](_0x1448('0x17'),core[_0x1448('0x17')]);ami['on'](_0x1448('0x18'),function(_0x1a1fa5){try{utils['debug'](util['format'](_0x1448('0x19'),_0x1a1fa5[_0x1448('0x1a')]),_0x1a1fa5);members[_0x1448('0x18')](_0x1a1fa5);}catch(_0x7faad5){utils[_0x1448('0x15')](util[_0x1448('0x1b')](_0x1448('0x19'),_0x1a1fa5[_0x1448('0x1a')]),_0x7faad5);}});ami['on'](_0x1448('0x1c'),function(_0x2778af){try{utils['debug'](util['format'](_0x1448('0x1d'),_0x2778af[_0x1448('0x1e')]),_0x2778af);agents[_0x1448('0x1c')](_0x2778af);}catch(_0x36a323){utils[_0x1448('0x15')](util['format'](_0x1448('0x1d'),_0x2778af[_0x1448('0x1e')]),_0x36a323);}});ami['on']('agentringnoanswer',function(_0x371f58){try{utils['debug'](util[_0x1448('0x1b')](_0x1448('0x1f'),_0x371f58[_0x1448('0x1e')]),_0x371f58);agents[_0x1448('0x20')](_0x371f58);}catch(_0x3843c0){utils[_0x1448('0x15')](util[_0x1448('0x1b')](_0x1448('0x1f'),_0x371f58['uniqueid']),_0x3843c0);}});ami['on'](_0x1448('0x21'),function(_0xe53c94){try{utils[_0x1448('0x22')](util[_0x1448('0x1b')](_0x1448('0x23'),_0xe53c94[_0x1448('0x1e')]),_0xe53c94);agents[_0x1448('0x21')](_0xe53c94);queues[_0x1448('0x21')](_0xe53c94);}catch(_0x3925b7){utils[_0x1448('0x15')](util[_0x1448('0x1b')]('[%s][index][agentconnect]',_0xe53c94[_0x1448('0x1e')]),_0x3925b7);}});ami['on'](_0x1448('0x24'),function(_0x7067c){try{utils[_0x1448('0x22')](util[_0x1448('0x1b')](_0x1448('0x25'),_0x7067c[_0x1448('0x1e')]),_0x7067c);agents[_0x1448('0x24')](_0x7067c);queues[_0x1448('0x24')](_0x7067c);members[_0x1448('0x24')](_0x7067c);}catch(_0x14a695){utils[_0x1448('0x15')](util['format'](_0x1448('0x25'),_0x7067c[_0x1448('0x1e')]),_0x14a695);}});ami['on'](_0x1448('0x26'),function(_0x5022ed){try{utils[_0x1448('0x22')](util[_0x1448('0x1b')](_0x1448('0x27'),_0x5022ed[_0x1448('0x1e')]),_0x5022ed);agents[_0x1448('0x26')](_0x5022ed);queues['queuecallerabandon'](_0x5022ed);}catch(_0x3aa407){utils[_0x1448('0x15')](util[_0x1448('0x1b')](_0x1448('0x27'),_0x5022ed[_0x1448('0x1e')]),_0x3aa407);}});ami['on']('queuecallerjoin',function(_0x22f831){try{utils[_0x1448('0x22')](util['format'](_0x1448('0x28'),_0x22f831[_0x1448('0x1e')]),_0x22f831);queues['queuecallerjoin'](_0x22f831);recordings[_0x1448('0x29')](_0x22f831);}catch(_0xae82ee){utils[_0x1448('0x15')](util['format'](_0x1448('0x28'),_0x22f831[_0x1448('0x1e')]),_0xae82ee);}});ami['on'](_0x1448('0x2a'),function(_0x3f891a){try{utils[_0x1448('0x22')](util[_0x1448('0x1b')](_0x1448('0x2b'),_0x3f891a[_0x1448('0x1e')]),_0x3f891a);queues[_0x1448('0x2a')](_0x3f891a);}catch(_0x1b2d7c){utils[_0x1448('0x15')](util[_0x1448('0x1b')](_0x1448('0x2b'),_0x3f891a[_0x1448('0x1e')]),_0x1b2d7c);}});ami['on'](_0x1448('0x2c'),function(_0x82e972){try{utils[_0x1448('0x22')](util[_0x1448('0x1b')]('[%s][index][musiconholdstart]',_0x82e972[_0x1448('0x1e')]),_0x82e972);queues[_0x1448('0x2c')](_0x82e972);calls[_0x1448('0x2c')](_0x82e972);}catch(_0x249e14){utils['error'](util[_0x1448('0x1b')]('[%s][index][musiconholdstart]',_0x82e972[_0x1448('0x1e')]),_0x249e14);}});ami['on']('musiconholdstop',function(_0x4d24fe){try{utils[_0x1448('0x22')](util[_0x1448('0x1b')]('[%s][index][musiconholdstop]',_0x4d24fe[_0x1448('0x1e')]),_0x4d24fe);queues[_0x1448('0x2d')](_0x4d24fe);calls[_0x1448('0x2d')](_0x4d24fe);}catch(_0x5487e3){utils['error'](util[_0x1448('0x1b')](_0x1448('0x2e'),_0x4d24fe[_0x1448('0x1e')]),_0x5487e3);}});ami['on'](_0x1448('0x2f'),function(_0x38ae30){try{utils['debug'](util['format'](_0x1448('0x30'),_0x38ae30['uniqueid']),_0x38ae30);calls[_0x1448('0x2f')](_0x38ae30);recordings[_0x1448('0x2f')](_0x38ae30);}catch(_0x5d6154){utils[_0x1448('0x15')](util[_0x1448('0x1b')](_0x1448('0x30'),_0x38ae30[_0x1448('0x1e')]),_0x5d6154);}});ami['on']('hangup',function(_0x21edf8){try{utils['debug'](util['format'](_0x1448('0x31'),_0x21edf8[_0x1448('0x1e')]),_0x21edf8);calls[_0x1448('0x32')](_0x21edf8);recordings[_0x1448('0x32')](_0x21edf8);dials[_0x1448('0x32')](_0x21edf8);agents[_0x1448('0x32')](_0x21edf8);queues[_0x1448('0x32')](_0x21edf8);}catch(_0x502caa){utils['error'](util['format']('[%s][index][hangup]',_0x21edf8[_0x1448('0x1e')]),_0x502caa);}});ami['on'](_0x1448('0x33'),function(_0x3d4c10){try{utils[_0x1448('0x22')](util[_0x1448('0x1b')](_0x1448('0x34'),_0x3d4c10['uniqueid']),_0x3d4c10);members[_0x1448('0x33')](_0x3d4c10);}catch(_0x126eb4){utils['error'](util[_0x1448('0x1b')]('[%s][index][cdr]',_0x3d4c10['uniqueid']),_0x126eb4);}});ami['on']('blindtransfer',function(_0x2d53af){try{utils['debug'](util[_0x1448('0x1b')]('[%s][index][blindtransfer]',_0x2d53af[_0x1448('0x1e')]),_0x2d53af);queues[_0x1448('0x35')](_0x2d53af);agents[_0x1448('0x35')](_0x2d53af);transfers[_0x1448('0x35')](_0x2d53af);recordings[_0x1448('0x35')](_0x2d53af);}catch(_0x4062c9){utils['error'](util[_0x1448('0x1b')](_0x1448('0x36'),_0x2d53af[_0x1448('0x1e')]),_0x4062c9);}});ami['on'](_0x1448('0x37'),function(_0xd9578a){try{utils[_0x1448('0x22')](util[_0x1448('0x1b')](_0x1448('0x38'),_0xd9578a[_0x1448('0x39')]),_0xd9578a);queues[_0x1448('0x37')](_0xd9578a);transfers[_0x1448('0x37')](_0xd9578a);agents[_0x1448('0x37')](_0xd9578a);calls[_0x1448('0x37')](_0xd9578a);}catch(_0x30cf8c){utils[_0x1448('0x15')](util[_0x1448('0x1b')](_0x1448('0x38'),_0xd9578a[_0x1448('0x39')]),_0x30cf8c);}});ami['on'](_0x1448('0x3a'),function(_0xcd4ec2){try{utils[_0x1448('0x22')](util[_0x1448('0x1b')]('[%s][index][varset]',_0xcd4ec2['uniqueid']),_0xcd4ec2);queues[_0x1448('0x3a')](_0xcd4ec2);recordings[_0x1448('0x3a')](_0xcd4ec2);calls[_0x1448('0x3a')](_0xcd4ec2);dials[_0x1448('0x3a')](_0xcd4ec2);}catch(_0x3aa9c8){utils[_0x1448('0x15')](util['format']('[%s][index][varset]',_0xcd4ec2['uniqueid']),_0x3aa9c8);}});ami['on'](_0x1448('0x3b'),function(_0x19dad7){try{utils[_0x1448('0x22')](util[_0x1448('0x1b')](_0x1448('0x3c'),_0x19dad7[_0x1448('0x1e')]),_0x19dad7);calls[_0x1448('0x3b')](_0x19dad7);recordings[_0x1448('0x3b')](_0x19dad7);dials[_0x1448('0x3b')](_0x19dad7);}catch(_0x42cc83){utils['error'](util[_0x1448('0x1b')]('[%s][index][newexten]',_0x19dad7[_0x1448('0x1e')]),_0x42cc83);}});ami['on'](_0x1448('0x3d'),function(_0x780602){try{utils[_0x1448('0x22')](util['format'](_0x1448('0x3e'),_0x780602['uniqueid']),_0x780602);calls[_0x1448('0x3d')](_0x780602);recordings[_0x1448('0x3d')](_0x780602);}catch(_0x2f154c){utils['error'](util[_0x1448('0x1b')](_0x1448('0x3e'),_0x780602[_0x1448('0x1e')]),_0x2f154c);}});ami['on']('dialbegin',function(_0x22dd76){try{utils[_0x1448('0x22')](util[_0x1448('0x1b')](_0x1448('0x3f'),_0x22dd76['uniqueid']),_0x22dd76);dials['dialbegin'](_0x22dd76);}catch(_0x187053){utils[_0x1448('0x15')](util[_0x1448('0x1b')](_0x1448('0x40'),_0x22dd76[_0x1448('0x1e')]),_0x187053);}});ami['on'](_0x1448('0x41'),function(_0x220d83){try{utils[_0x1448('0x22')](util[_0x1448('0x1b')](_0x1448('0x42'),_0x220d83['uniqueid']),_0x220d83);dials[_0x1448('0x41')](_0x220d83);}catch(_0x1c6189){utils['error'](util[_0x1448('0x1b')](_0x1448('0x42'),_0x220d83[_0x1448('0x1e')]),_0x1c6189);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 6291bc4..44d4878 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 _0x3dcd=['data3','lodash','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','channel','data2','membername','type','interface','getUserByInterface','name','internal','request','getUserByName','split','then','CreateMemberReport','catch','error','[%s][members][writeDB]','devicestatechange','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','agent','exitAt','duration','diffTime','agentcomplete','isNil','debug','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3dcd,0xc5));var _0xd3dc=function(_0x576e92,_0x165314){_0x576e92=_0x576e92-0x0;var _0x24c32e=_0x3dcd[_0x576e92];return _0x24c32e;};'use strict';var _=require(_0xd3dc('0x0'));var util=require('util');var utils=require(_0xd3dc('0x1'));var members={};var exclude=[_0xd3dc('0x2'),_0xd3dc('0x3')];function writeDB(_0x19e23b){utils[_0xd3dc('0x4')](util[_0xd3dc('0x5')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x19e23b[_0xd3dc('0x6')],_0x19e23b['interface'],_0x19e23b[_0xd3dc('0x7')],_0x19e23b[_0xd3dc('0x8')],_0x19e23b[_0xd3dc('0x9')],_0x19e23b[_0xd3dc('0xa')]));if(_0x19e23b[_0xd3dc('0xb')]){utils[_0xd3dc('0xc')](_0x19e23b[_0xd3dc('0xb')])['then'](function(_0x20e056){if(_0x20e056){_0x19e23b[_0xd3dc('0x9')]=_0x20e056[_0xd3dc('0xd')];_0x19e23b['internal']=_0x20e056[_0xd3dc('0xe')];utils[_0xd3dc('0xf')]('CreateMemberReport',_0x19e23b);}else{utils[_0xd3dc('0x10')](_0x19e23b['interface'][_0xd3dc('0x11')]('/')[0x1])[_0xd3dc('0x12')](function(_0x52dadd){if(_0x52dadd){_0x19e23b[_0xd3dc('0x9')]=_0x52dadd[_0xd3dc('0xd')];_0x19e23b[_0xd3dc('0xe')]=_0x52dadd['internal'];utils[_0xd3dc('0xf')](_0xd3dc('0x13'),_0x19e23b);}});}})[_0xd3dc('0x14')](function(_0xae82c3){utils[_0xd3dc('0x15')](util['format'](_0xd3dc('0x16'),_0x19e23b[_0xd3dc('0x6')]),_0xae82c3);});}delete members[_0x19e23b[_0xd3dc('0xb')]];}function startsWith(_0x2fdbd7,_0x106adc){return _['some'](_0x2fdbd7,function(_0x2a433a){return _['startsWith'](_0x106adc,_0x2a433a);});}exports[_0xd3dc('0x17')]=function(_0x1ce024){try{utils['debug'](util[_0xd3dc('0x5')](_0xd3dc('0x18'),members[_0x1ce024['device']]?members[_0x1ce024['device']][_0xd3dc('0x6')]:_0x1ce024[_0xd3dc('0x19')]),_0x1ce024);utils[_0xd3dc('0x4')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x1ce024['device']]?members[_0x1ce024[_0xd3dc('0x19')]][_0xd3dc('0x6')]:_0x1ce024['device'],_0x1ce024[_0xd3dc('0x1a')],_0x1ce024['device']));switch(_0x1ce024['state']){case _0xd3dc('0x1b'):case _0xd3dc('0x1c'):if(!startsWith(exclude,_0x1ce024['device'])){members[_0x1ce024[_0xd3dc('0x19')]]={'channel':_0xd3dc('0x1d'),'interface':_0x1ce024['device'],'type':_0xd3dc('0x1e'),'enterAt':utils[_0xd3dc('0x1f')](),'role':_0xd3dc('0x20')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x1ce024['device']])){members[_0x1ce024[_0xd3dc('0x19')]][_0xd3dc('0x21')]=utils[_0xd3dc('0x1f')]();members[_0x1ce024[_0xd3dc('0x19')]][_0xd3dc('0x22')]=utils[_0xd3dc('0x23')](members[_0x1ce024[_0xd3dc('0x19')]]['exitAt'],members[_0x1ce024['device']]['enterAt']);if(members[_0x1ce024['device']][_0xd3dc('0x6')]){writeDB(members[_0x1ce024[_0xd3dc('0x19')]]);}}break;default:break;}}catch(_0xea117f){utils[_0xd3dc('0x15')](util[_0xd3dc('0x5')](_0xd3dc('0x18'),members[_0x1ce024['device']]?members[_0x1ce024[_0xd3dc('0x19')]]['uniqueid']:_0x1ce024[_0xd3dc('0x19')]),_0xea117f);}};exports[_0xd3dc('0x24')]=function(_0x450f46){try{if(!_[_0xd3dc('0x25')](members[_0x450f46[_0xd3dc('0xb')]])){utils[_0xd3dc('0x26')](util['format']('[%s][members][agentcomplete]',_0x450f46['uniqueid']),_0x450f46);utils[_0xd3dc('0x4')](util['format'](_0xd3dc('0x27'),_0x450f46[_0xd3dc('0x6')],_0x450f46[_0xd3dc('0xb')],_0x450f46['queue']));members[_0x450f46[_0xd3dc('0xb')]]=_[_0xd3dc('0x28')](members[_0x450f46[_0xd3dc('0xb')]],{'data4':_0x450f46[_0xd3dc('0x29')],'uniqueid':_0x450f46[_0xd3dc('0x6')]});}}catch(_0x13157a){utils['error'](util['format']('[%s][members][agentcomplete]',_0x450f46['uniqueid']),_0x13157a);}};exports[_0xd3dc('0x2a')]=function(_0x540734){try{utils[_0xd3dc('0x26')](util['format']('[%s][members][cdr]',_0x540734[_0xd3dc('0x6')]),_0x540734);if(_0x540734[_0xd3dc('0x7')]){var _0x58a520=_0x540734['channel'][_0xd3dc('0x11')]('-')[0x0];if(!_[_0xd3dc('0x25')](members[_0x58a520])){members[_0x58a520]=_[_0xd3dc('0x28')](members[_0x58a520],{'data1':members[_0x58a520][_0xd3dc('0x2b')]||_0x540734[_0xd3dc('0xa')],'data2':members[_0x58a520]['data2']||_0x540734[_0xd3dc('0x2c')],'data3':members[_0x58a520]['data3']||_0x540734[_0xd3dc('0x2d')],'uniqueid':members[_0x58a520][_0xd3dc('0x6')]||_0x540734[_0xd3dc('0x6')]});utils[_0xd3dc('0x4')](util[_0xd3dc('0x5')](_0xd3dc('0x2e'),_0x540734[_0xd3dc('0x6')],members[_0x58a520][_0xd3dc('0x2b')],members[_0x58a520][_0xd3dc('0x8')],members[_0x58a520]['data3']));if(members[_0x58a520]['exitAt']){writeDB(members[_0x58a520]);}}}if(_0x540734[_0xd3dc('0x2f')]){var _0x26643a=_0x540734[_0xd3dc('0x2f')][_0xd3dc('0x11')]('-')[0x0];if(!_[_0xd3dc('0x25')](members[_0x26643a])){members[_0x26643a]=_[_0xd3dc('0x28')](members[_0x26643a],{'data1':members[_0x26643a][_0xd3dc('0x2b')]||_0x540734['type'],'data2':members[_0x26643a][_0xd3dc('0x8')]||_0x540734[_0xd3dc('0x2c')],'data3':members[_0x26643a][_0xd3dc('0x30')]||_0x540734[_0xd3dc('0x2d')],'uniqueid':members[_0x26643a][_0xd3dc('0x6')]||_0x540734[_0xd3dc('0x6')]});utils[_0xd3dc('0x4')](util['format'](_0xd3dc('0x2e'),_0x540734['uniqueid'],members[_0x26643a][_0xd3dc('0x2b')],members[_0x26643a][_0xd3dc('0x8')],members[_0x26643a]['data3']));if(members[_0x26643a][_0xd3dc('0x21')]){writeDB(members[_0x26643a]);}}}}catch(_0xa8c703){utils['error'](util[_0xd3dc('0x5')]('[%s][members][cdr]',_0x540734[_0xd3dc('0x6')]),_0xa8c703);}}; \ No newline at end of file +var _0x4cd5=['[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','source','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','data3','destinationchannel','destination','lodash','util','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','getUserByName','split','CreateMemberReport','error','some','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','isNil','exitAt','diffTime','enterAt','agentcomplete'];(function(_0x439bd0,_0x43dd4b){var _0x1465b2=function(_0x44e411){while(--_0x44e411){_0x439bd0['push'](_0x439bd0['shift']());}};_0x1465b2(++_0x43dd4b);}(_0x4cd5,0x72));var _0x54cd=function(_0x1c60ca,_0x31a888){_0x1c60ca=_0x1c60ca-0x0;var _0x4cb5a1=_0x4cd5[_0x1c60ca];return _0x4cb5a1;};'use strict';var _=require(_0x54cd('0x0'));var util=require(_0x54cd('0x1'));var utils=require('./utils');var members={};var exclude=[_0x54cd('0x2'),'Queue:'];function writeDB(_0x133340){utils[_0x54cd('0x3')](util[_0x54cd('0x4')](_0x54cd('0x5'),_0x133340[_0x54cd('0x6')],_0x133340[_0x54cd('0x7')],_0x133340[_0x54cd('0x8')],_0x133340[_0x54cd('0x9')],_0x133340[_0x54cd('0xa')],_0x133340[_0x54cd('0xb')]));if(_0x133340[_0x54cd('0x7')]){utils[_0x54cd('0xc')](_0x133340['interface'])[_0x54cd('0xd')](function(_0x4e7e2e){if(_0x4e7e2e){_0x133340[_0x54cd('0xa')]=_0x4e7e2e[_0x54cd('0xe')];_0x133340[_0x54cd('0xf')]=_0x4e7e2e[_0x54cd('0xf')];utils[_0x54cd('0x10')]('CreateMemberReport',_0x133340);}else{utils[_0x54cd('0x11')](_0x133340['interface'][_0x54cd('0x12')]('/')[0x1])[_0x54cd('0xd')](function(_0x398e5e){if(_0x398e5e){_0x133340[_0x54cd('0xa')]=_0x398e5e[_0x54cd('0xe')];_0x133340['internal']=_0x398e5e[_0x54cd('0xf')];utils[_0x54cd('0x10')](_0x54cd('0x13'),_0x133340);}});}})['catch'](function(_0x365d1c){utils[_0x54cd('0x14')](util[_0x54cd('0x4')]('[%s][members][writeDB]',_0x133340['uniqueid']),_0x365d1c);});}delete members[_0x133340[_0x54cd('0x7')]];}function startsWith(_0x2a29e5,_0x2692fb){return _[_0x54cd('0x15')](_0x2a29e5,function(_0x16f4e5){return _[_0x54cd('0x16')](_0x2692fb,_0x16f4e5);});}exports['devicestatechange']=function(_0x4f799f){try{utils[_0x54cd('0x17')](util[_0x54cd('0x4')](_0x54cd('0x18'),members[_0x4f799f['device']]?members[_0x4f799f[_0x54cd('0x19')]]['uniqueid']:_0x4f799f[_0x54cd('0x19')]),_0x4f799f);utils[_0x54cd('0x3')](util[_0x54cd('0x4')](_0x54cd('0x1a'),members[_0x4f799f[_0x54cd('0x19')]]?members[_0x4f799f[_0x54cd('0x19')]][_0x54cd('0x6')]:_0x4f799f[_0x54cd('0x19')],_0x4f799f[_0x54cd('0x1b')],_0x4f799f[_0x54cd('0x19')]));switch(_0x4f799f[_0x54cd('0x1b')]){case _0x54cd('0x1c'):case _0x54cd('0x1d'):if(!startsWith(exclude,_0x4f799f[_0x54cd('0x19')])){members[_0x4f799f[_0x54cd('0x19')]]={'channel':_0x54cd('0x1e'),'interface':_0x4f799f[_0x54cd('0x19')],'type':_0x54cd('0x1f'),'enterAt':utils[_0x54cd('0x20')](),'role':_0x54cd('0x21')};}break;case'NOT_INUSE':if(!_[_0x54cd('0x22')](members[_0x4f799f[_0x54cd('0x19')]])){members[_0x4f799f[_0x54cd('0x19')]][_0x54cd('0x23')]=utils[_0x54cd('0x20')]();members[_0x4f799f[_0x54cd('0x19')]]['duration']=utils[_0x54cd('0x24')](members[_0x4f799f[_0x54cd('0x19')]][_0x54cd('0x23')],members[_0x4f799f[_0x54cd('0x19')]][_0x54cd('0x25')]);if(members[_0x4f799f[_0x54cd('0x19')]][_0x54cd('0x6')]){writeDB(members[_0x4f799f['device']]);}}break;default:break;}}catch(_0x1f4201){utils['error'](util[_0x54cd('0x4')](_0x54cd('0x18'),members[_0x4f799f[_0x54cd('0x19')]]?members[_0x4f799f[_0x54cd('0x19')]][_0x54cd('0x6')]:_0x4f799f['device']),_0x1f4201);}};exports[_0x54cd('0x26')]=function(_0xc0f017){try{if(!_['isNil'](members[_0xc0f017['interface']])){utils[_0x54cd('0x17')](util[_0x54cd('0x4')](_0x54cd('0x27'),_0xc0f017['uniqueid']),_0xc0f017);utils['info'](util[_0x54cd('0x4')](_0x54cd('0x28'),_0xc0f017[_0x54cd('0x6')],_0xc0f017[_0x54cd('0x7')],_0xc0f017['queue']));members[_0xc0f017[_0x54cd('0x7')]]=_[_0x54cd('0x29')](members[_0xc0f017[_0x54cd('0x7')]],{'data4':_0xc0f017[_0x54cd('0x2a')],'uniqueid':_0xc0f017[_0x54cd('0x6')]});}}catch(_0x1a4d48){utils['error'](util[_0x54cd('0x4')](_0x54cd('0x27'),_0xc0f017[_0x54cd('0x6')]),_0x1a4d48);}};exports[_0x54cd('0x2b')]=function(_0x3e5f91){try{utils['debug'](util[_0x54cd('0x4')](_0x54cd('0x2c'),_0x3e5f91[_0x54cd('0x6')]),_0x3e5f91);if(_0x3e5f91[_0x54cd('0x8')]){var _0x34d632=_0x3e5f91[_0x54cd('0x8')][_0x54cd('0x12')]('-')[0x0];if(!_[_0x54cd('0x22')](members[_0x34d632])){members[_0x34d632]=_[_0x54cd('0x29')](members[_0x34d632],{'data1':members[_0x34d632]['data1']||_0x3e5f91['type'],'data2':members[_0x34d632][_0x54cd('0x9')]||_0x3e5f91[_0x54cd('0x2d')],'data3':members[_0x34d632]['data3']||_0x3e5f91['destination'],'uniqueid':members[_0x34d632][_0x54cd('0x6')]||_0x3e5f91[_0x54cd('0x6')]});utils[_0x54cd('0x3')](util['format'](_0x54cd('0x2e'),_0x3e5f91[_0x54cd('0x6')],members[_0x34d632][_0x54cd('0x2f')],members[_0x34d632][_0x54cd('0x9')],members[_0x34d632][_0x54cd('0x30')]));if(members[_0x34d632][_0x54cd('0x23')]){writeDB(members[_0x34d632]);}}}if(_0x3e5f91[_0x54cd('0x31')]){var _0x4705e3=_0x3e5f91[_0x54cd('0x31')][_0x54cd('0x12')]('-')[0x0];if(!_[_0x54cd('0x22')](members[_0x4705e3])){members[_0x4705e3]=_[_0x54cd('0x29')](members[_0x4705e3],{'data1':members[_0x4705e3][_0x54cd('0x2f')]||_0x3e5f91['type'],'data2':members[_0x4705e3][_0x54cd('0x9')]||_0x3e5f91['source'],'data3':members[_0x4705e3][_0x54cd('0x30')]||_0x3e5f91[_0x54cd('0x32')],'uniqueid':members[_0x4705e3][_0x54cd('0x6')]||_0x3e5f91[_0x54cd('0x6')]});utils['info'](util[_0x54cd('0x4')](_0x54cd('0x2e'),_0x3e5f91[_0x54cd('0x6')],members[_0x4705e3][_0x54cd('0x2f')],members[_0x4705e3][_0x54cd('0x9')],members[_0x4705e3][_0x54cd('0x30')]));if(members[_0x4705e3][_0x54cd('0x23')]){writeDB(members[_0x4705e3]);}}}}catch(_0x125abb){utils[_0x54cd('0x14')](util[_0x54cd('0x4')]('[%s][members][cdr]',_0x3e5f91[_0x54cd('0x6')]),_0x125abb);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 4c60053..1a1a747 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 _0xfb8f=['COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','queuecallerenterreason','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','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','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','assign','now','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][varset]','isNil','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','name','variable','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','error','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER'];(function(_0x299ecf,_0x5e642b){var _0x4813c9=function(_0x4726e7){while(--_0x4726e7){_0x299ecf['push'](_0x299ecf['shift']());}};_0x4813c9(++_0x5e642b);}(_0xfb8f,0x166));var _0xffb8=function(_0x1f4f00,_0x5dc5a7){_0x1f4f00=_0x1f4f00-0x0;var _0x4e3d39=_0xfb8f[_0x1f4f00];return _0x4e3d39;};'use strict';var _=require(_0xffb8('0x0'));var util=require(_0xffb8('0x1'));var utils=require(_0xffb8('0x2'));var queues={};function writeDB(_0x1762ea){utils[_0xffb8('0x3')](util[_0xffb8('0x4')](_0xffb8('0x5'),_0x1762ea['uniqueid'],_0x1762ea['channel'],_0x1762ea[_0xffb8('0x6')],_0x1762ea[_0xffb8('0x7')],_0x1762ea[_0xffb8('0x8')],_0x1762ea[_0xffb8('0x9')],_0x1762ea[_0xffb8('0xa')]));if(_0x1762ea['queue']){utils[_0xffb8('0xb')](_0x1762ea[_0xffb8('0x6')])[_0xffb8('0xc')](function(_0x73401d){if(_0x73401d){_0x1762ea[_0xffb8('0xd')]=_0x73401d[_0xffb8('0xd')];}utils[_0xffb8('0xe')](_0xffb8('0xf'),_0x1762ea);});}else{utils[_0xffb8('0xe')](_0xffb8('0xf'),_0x1762ea);}if(_0x1762ea[_0xffb8('0x10')]){delete queues[_0x1762ea[_0xffb8('0x10')]];}else{delete queues[_0x1762ea[_0xffb8('0x11')]];}}exports[_0xffb8('0x12')]=function(_0x5f1ec8){try{utils[_0xffb8('0x13')](util[_0xffb8('0x4')](_0xffb8('0x14'),_0x5f1ec8[_0xffb8('0x11')]),_0x5f1ec8);utils[_0xffb8('0x3')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x5f1ec8['uniqueid'],_0x5f1ec8['queue'],_0x5f1ec8[_0xffb8('0x15')]));queues[_0x5f1ec8[_0xffb8('0x11')]]=_[_0xffb8('0x16')](_0x5f1ec8,{'originalposition':_0x5f1ec8[_0xffb8('0x15')],'queuecallerjoinAt':utils[_0xffb8('0x17')](),'mohtime':0x0});}catch(_0xf591b8){utils['error'](util[_0xffb8('0x4')](_0xffb8('0x14'),_0x5f1ec8[_0xffb8('0x11')]),_0xf591b8);}};exports[_0xffb8('0x18')]=function(_0x524ae3){try{if(!_['isNil'](queues[_0x524ae3[_0xffb8('0x11')]])){utils[_0xffb8('0x13')](util[_0xffb8('0x4')](_0xffb8('0x19'),_0x524ae3[_0xffb8('0x11')]),_0x524ae3);if(queues[_0x524ae3[_0xffb8('0x11')]][_0xffb8('0x1a')]){if(!queues[_0x524ae3['uniqueid']][_0xffb8('0x1b')]&&!queues[_0x524ae3[_0xffb8('0x11')]]['queuecallerexit']){queues[_0x524ae3[_0xffb8('0x11')]][_0xffb8('0x1c')]=!![];queues[_0x524ae3[_0xffb8('0x11')]][_0xffb8('0x1d')]=utils['now']();queues[_0x524ae3[_0xffb8('0x11')]]['queuecallerexitreason']=_0xffb8('0x1e');}utils[_0xffb8('0x3')](util[_0xffb8('0x4')](_0xffb8('0x1f'),_0x524ae3[_0xffb8('0x11')],queues[_0x524ae3[_0xffb8('0x11')]]['name'],queues[_0x524ae3[_0xffb8('0x11')]][_0xffb8('0xa')]));writeDB(queues[_0x524ae3[_0xffb8('0x11')]]);}else if(queues[_0x524ae3[_0xffb8('0x11')]][_0xffb8('0x10')]){utils['info'](util['format'](_0xffb8('0x20'),_0x524ae3[_0xffb8('0x11')],queues[_0x524ae3[_0xffb8('0x11')]]['name'],queues[_0x524ae3[_0xffb8('0x11')]]['transfereduniqueid']));queues[queues[_0x524ae3[_0xffb8('0x11')]][_0xffb8('0x10')]]=queues[_0x524ae3[_0xffb8('0x11')]];queues[queues[_0x524ae3[_0xffb8('0x11')]][_0xffb8('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0x524ae3[_0xffb8('0x11')]];}}}catch(_0x3b6ea8){utils['error'](util[_0xffb8('0x4')](_0xffb8('0x19'),_0x524ae3['uniqueid']),_0x3b6ea8);}};exports['varset']=function(_0x4ede3c){try{utils[_0xffb8('0x13')](util[_0xffb8('0x4')](_0xffb8('0x21'),_0x4ede3c[_0xffb8('0x11')]),_0x4ede3c);if(!_[_0xffb8('0x22')](_0x4ede3c['variable'][_0xffb8('0x23')])&&_0x4ede3c[_0xffb8('0x24')][_0xffb8('0x25')]()!==_0xffb8('0x26')){if(!_[_0xffb8('0x22')](queues[_0x4ede3c[_0xffb8('0x11')]])){queues[_0x4ede3c[_0xffb8('0x11')]]['queuecallerabandon']=![];queues[_0x4ede3c[_0xffb8('0x11')]][_0xffb8('0x27')]=null;queues[_0x4ede3c[_0xffb8('0x11')]][_0xffb8('0x28')]=!![];queues[_0x4ede3c[_0xffb8('0x11')]][_0xffb8('0x29')]=utils[_0xffb8('0x17')]();queues[_0x4ede3c[_0xffb8('0x11')]][_0xffb8('0xa')]=_0x4ede3c['value'][_0xffb8('0x25')]();utils[_0xffb8('0x3')](util[_0xffb8('0x4')](_0xffb8('0x2a'),_0x4ede3c[_0xffb8('0x11')],queues[_0x4ede3c[_0xffb8('0x11')]][_0xffb8('0x2b')],_0x4ede3c[_0xffb8('0x24')],queues[_0x4ede3c['uniqueid']][_0xffb8('0xa')]));writeDB(queues[_0x4ede3c[_0xffb8('0x11')]]);}}else if(!_[_0xffb8('0x22')](_0x4ede3c[_0xffb8('0x2c')][_0xffb8('0x2d')])){if(!_[_0xffb8('0x22')](queues[_0x4ede3c[_0xffb8('0x11')]])&&!queues[_0x4ede3c[_0xffb8('0x11')]][_0xffb8('0x1b')]){queues[_0x4ede3c['uniqueid']][_0xffb8('0x1b')]=![];queues[_0x4ede3c[_0xffb8('0x11')]][_0xffb8('0x27')]=null;queues[_0x4ede3c[_0xffb8('0x11')]][_0xffb8('0x28')]=!![];queues[_0x4ede3c[_0xffb8('0x11')]][_0xffb8('0x29')]=utils[_0xffb8('0x17')]();queues[_0x4ede3c[_0xffb8('0x11')]][_0xffb8('0xa')]=_0xffb8('0x2e');utils[_0xffb8('0x3')](util[_0xffb8('0x4')](_0xffb8('0x2f'),_0x4ede3c['uniqueid'],queues[_0x4ede3c[_0xffb8('0x11')]][_0xffb8('0x2b')],_0x4ede3c[_0xffb8('0x24')],queues[_0x4ede3c[_0xffb8('0x11')]]['queuecallerexitreason']));}}}catch(_0x17fbf1){utils[_0xffb8('0x30')](util['format'](_0xffb8('0x21'),_0x4ede3c[_0xffb8('0x11')]),_0x17fbf1);}};exports[_0xffb8('0x1b')]=function(_0x1a3e4b){try{if(!_[_0xffb8('0x22')](queues[_0x1a3e4b[_0xffb8('0x11')]])){utils[_0xffb8('0x13')](util['format'](_0xffb8('0x31'),_0x1a3e4b[_0xffb8('0x11')]),_0x1a3e4b);queues[_0x1a3e4b[_0xffb8('0x11')]][_0xffb8('0x28')]=![];queues[_0x1a3e4b[_0xffb8('0x11')]][_0xffb8('0x29')]=null;queues[_0x1a3e4b['uniqueid']]['queuecallerabandon']=!![];queues[_0x1a3e4b[_0xffb8('0x11')]][_0xffb8('0x27')]=utils[_0xffb8('0x17')]();queues[_0x1a3e4b[_0xffb8('0x11')]][_0xffb8('0xa')]=_0xffb8('0x32');utils['info'](util['format'](_0xffb8('0x33'),_0x1a3e4b[_0xffb8('0x11')],queues[_0x1a3e4b['uniqueid']][_0xffb8('0x2b')],queues[_0x1a3e4b[_0xffb8('0x11')]][_0xffb8('0xa')]));}}catch(_0x52e5d8){utils[_0xffb8('0x30')](util[_0xffb8('0x4')](_0xffb8('0x31'),_0x1a3e4b[_0xffb8('0x11')]),_0x52e5d8);}};exports[_0xffb8('0x34')]=function(_0x1dfb5a){try{if(!_['isNil'](queues[_0x1dfb5a[_0xffb8('0x11')]])){utils[_0xffb8('0x13')](util[_0xffb8('0x4')](_0xffb8('0x35'),_0x1dfb5a[_0xffb8('0x11')]),_0x1dfb5a);utils[_0xffb8('0x3')](util[_0xffb8('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1dfb5a[_0xffb8('0x11')],queues[_0x1dfb5a[_0xffb8('0x11')]]['name'],_0x1dfb5a[_0xffb8('0x36')],_0x1dfb5a[_0xffb8('0x37')]));queues[_0x1dfb5a[_0xffb8('0x11')]][_0xffb8('0x34')]=!![];queues[_0x1dfb5a[_0xffb8('0x11')]][_0xffb8('0x1a')]=utils[_0xffb8('0x17')]();queues[_0x1dfb5a[_0xffb8('0x11')]][_0xffb8('0x38')]=utils[_0xffb8('0x39')](queues[_0x1dfb5a[_0xffb8('0x11')]][_0xffb8('0x1a')],queues[_0x1dfb5a['uniqueid']][_0xffb8('0x3a')]);queues[_0x1dfb5a['uniqueid']][_0xffb8('0x15')]=_0x1dfb5a[_0xffb8('0x15')];queues[_0x1dfb5a[_0xffb8('0x11')]]['count']=_0x1dfb5a['count'];queues[_0x1dfb5a['uniqueid']][_0xffb8('0x36')]=_0x1dfb5a['connectedlinenum'];queues[_0x1dfb5a[_0xffb8('0x11')]][_0xffb8('0x37')]=_0x1dfb5a[_0xffb8('0x37')];}}catch(_0x1ad6e9){utils[_0xffb8('0x30')](util['format'](_0xffb8('0x35'),_0x1dfb5a['uniqueid']),_0x1ad6e9);}};exports[_0xffb8('0x3b')]=function(_0x225066){try{if(!_[_0xffb8('0x22')](queues[_0x225066[_0xffb8('0x11')]])){utils[_0xffb8('0x13')](util[_0xffb8('0x4')](_0xffb8('0x3c'),_0x225066['uniqueid']),_0x225066);utils[_0xffb8('0x3')](util[_0xffb8('0x4')](_0xffb8('0x3d'),_0x225066[_0xffb8('0x11')],queues[_0x225066[_0xffb8('0x11')]][_0xffb8('0x2b')],_0x225066[_0xffb8('0x3e')],_0x225066[_0xffb8('0x3f')]));queues[_0x225066[_0xffb8('0x11')]]['queuecallerabandon']=![];queues[_0x225066['uniqueid']][_0xffb8('0x1b')]=![];queues[_0x225066[_0xffb8('0x11')]][_0xffb8('0x27')]=null;queues[_0x225066[_0xffb8('0x11')]][_0xffb8('0x28')]=![];queues[_0x225066[_0xffb8('0x11')]]['queuecallerexitreason']=null;queues[_0x225066[_0xffb8('0x11')]][_0xffb8('0x29')]=null;queues[_0x225066['uniqueid']][_0xffb8('0x40')]=!![];queues[_0x225066['uniqueid']][_0xffb8('0x9')]=_0x225066[_0xffb8('0x3f')];queues[_0x225066['uniqueid']][_0xffb8('0x7')]=_0x225066['membername'];}}catch(_0x2df626){utils['error'](util[_0xffb8('0x4')]('[%s][queues][agentconnect]',_0x225066[_0xffb8('0x11')]),_0x2df626);}};exports[_0xffb8('0x41')]=function(_0x2ddea8){try{if(!_['isNil'](queues[_0x2ddea8[_0xffb8('0x11')]])){if(queues[_0x2ddea8[_0xffb8('0x11')]]['queuecallerleaveAt']){utils[_0xffb8('0x13')](util[_0xffb8('0x4')](_0xffb8('0x42'),_0x2ddea8[_0xffb8('0x11')]),_0x2ddea8);queues[_0x2ddea8[_0xffb8('0x11')]][_0xffb8('0x1b')]=![];queues[_0x2ddea8[_0xffb8('0x11')]][_0xffb8('0x1b')]=![];queues[_0x2ddea8[_0xffb8('0x11')]][_0xffb8('0x27')]=null;queues[_0x2ddea8[_0xffb8('0x11')]][_0xffb8('0x28')]=![];queues[_0x2ddea8[_0xffb8('0x11')]][_0xffb8('0x29')]=null;queues[_0x2ddea8[_0xffb8('0x11')]][_0xffb8('0x40')]=!![];queues[_0x2ddea8[_0xffb8('0x11')]][_0xffb8('0x7')]=_0x2ddea8[_0xffb8('0x3e')];queues[_0x2ddea8['uniqueid']][_0xffb8('0x1c')]=!![];queues[_0x2ddea8[_0xffb8('0x11')]][_0xffb8('0x1d')]=utils['now']();if(_0x2ddea8[_0xffb8('0x43')]==_0xffb8('0x44')){if(!queues[_0x2ddea8[_0xffb8('0x11')]][_0xffb8('0x44')]){queues[_0x2ddea8[_0xffb8('0x11')]]['queuecallerexitreason']=_0xffb8('0x45');}}else{queues[_0x2ddea8[_0xffb8('0x11')]][_0xffb8('0xa')]=_0xffb8('0x46')+_0x2ddea8[_0xffb8('0x43')]['toUpperCase']();}utils['info'](util[_0xffb8('0x4')](_0xffb8('0x47'),_0x2ddea8['uniqueid'],queues[_0x2ddea8[_0xffb8('0x11')]][_0xffb8('0x2b')],_0x2ddea8[_0xffb8('0x3e')],queues[_0x2ddea8[_0xffb8('0x11')]][_0xffb8('0xa')]));writeDB(queues[_0x2ddea8['uniqueid']]);}}}catch(_0xae4ea3){utils[_0xffb8('0x30')](util[_0xffb8('0x4')]('[%s][queues][agentcomplete]',_0x2ddea8[_0xffb8('0x11')]),_0xae4ea3);}};exports[_0xffb8('0x48')]=function(_0x524c72){try{if(!_[_0xffb8('0x22')](queues[_0x524c72[_0xffb8('0x49')]])){utils[_0xffb8('0x13')](util['format'](_0xffb8('0x4a'),_0x524c72['uniqueid']),_0x524c72);queues[_0x524c72[_0xffb8('0x49')]][_0xffb8('0x44')]=!![];queues[_0x524c72['transfereeuniqueid']][_0xffb8('0x4b')]=_0xffb8('0x4c');queues[_0x524c72['transfereeuniqueid']][_0xffb8('0x4d')]=_0x524c72[_0xffb8('0x4e')];queues[_0x524c72[_0xffb8('0x49')]][_0xffb8('0x4f')]=_0x524c72[_0xffb8('0x49')];queues[_0x524c72[_0xffb8('0x49')]]['queuecallerexitreason']=_0xffb8('0x50');utils[_0xffb8('0x3')](util[_0xffb8('0x4')](_0xffb8('0x51'),_0x524c72['uniqueid'],queues[_0x524c72['transfereeuniqueid']]['name'],_0x524c72[_0xffb8('0x49')],_0x524c72[_0xffb8('0x4e')]));}}catch(_0x49cb09){utils[_0xffb8('0x30')](util['format'](_0xffb8('0x4a'),_0x524c72[_0xffb8('0x11')]),_0x49cb09);}};exports[_0xffb8('0x52')]=function(_0x1b2492){try{utils[_0xffb8('0x13')](util[_0xffb8('0x4')]('[%s][queues][attendedtransfer]',_0x1b2492[_0xffb8('0x53')]),_0x1b2492);if(_0x1b2492['origtransfereruniqueid']==_0x1b2492[_0xffb8('0x54')]){if(!_[_0xffb8('0x22')](queues[_0x1b2492[_0xffb8('0x55')]])){utils[_0xffb8('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x1b2492[_0xffb8('0x53')],queues[_0x1b2492[_0xffb8('0x55')]][_0xffb8('0x2b')],_0x1b2492[_0xffb8('0x56')]));queues[_0x1b2492[_0xffb8('0x55')]][_0xffb8('0x44')]=!![];queues[_0x1b2492[_0xffb8('0x55')]][_0xffb8('0x4b')]=_0xffb8('0x57');queues[_0x1b2492[_0xffb8('0x55')]][_0xffb8('0x4d')]=_0x1b2492['origtransfererexten'];queues[_0x1b2492['secondtransfererlinkedid']]['transferuniqueid']=_0x1b2492[_0xffb8('0x53')];queues[_0x1b2492[_0xffb8('0x55')]]['queuecallerexitreason']=_0xffb8('0x58');}if(!_[_0xffb8('0x22')](queues[_0x1b2492['origtransfererlinkedid']])){if(_0x1b2492[_0xffb8('0x59')]&&queues[_0x1b2492[_0xffb8('0x59')]]){queues[_0x1b2492[_0xffb8('0x59')]]['queuecallerenterreason']=0x1;queues[_0x1b2492[_0xffb8('0x49')]]=_['clone'](queues[_0x1b2492['transfereelinkedid']]);queues[_0x1b2492[_0xffb8('0x49')]][_0xffb8('0x10')]=_0x1b2492[_0xffb8('0x5a')];queues[_0x1b2492['transfereeuniqueid']][_0xffb8('0x5b')]=0x2;queues[_0x1b2492[_0xffb8('0x49')]][_0xffb8('0x8')]=queues[_0x1b2492['secondtransfererlinkedid']][_0xffb8('0x8')];queues[_0x1b2492['transfereeuniqueid']][_0xffb8('0x5c')]=queues[_0x1b2492[_0xffb8('0x55')]][_0xffb8('0x5c')];queues[_0x1b2492[_0xffb8('0x49')]]['queuecallerjoinAt']=utils[_0xffb8('0x17')]();queues[_0x1b2492[_0xffb8('0x49')]]['queuecallerleaveAt']=utils[_0xffb8('0x17')]();queues[_0x1b2492['transfereeuniqueid']]['holdtime']=0x0;queues[_0x1b2492[_0xffb8('0x49')]][_0xffb8('0x5d')]=0x0;utils[_0xffb8('0x3')](util[_0xffb8('0x4')](_0xffb8('0x5e'),_0x1b2492[_0xffb8('0x53')],queues[_0x1b2492[_0xffb8('0x49')]]['name'],queues[_0x1b2492[_0xffb8('0x49')]]['calleridnum'],queues[_0x1b2492[_0xffb8('0x49')]][_0xffb8('0x5c')]));}else{utils[_0xffb8('0x3')](util['format'](_0xffb8('0x5f'),_0x1b2492[_0xffb8('0x53')],queues[_0x1b2492['origtransfererlinkedid']][_0xffb8('0x2b')],_0x1b2492[_0xffb8('0x55')]));queues[_0x1b2492[_0xffb8('0x54')]]['transfereduniqueid']=_0x1b2492['secondtransfererlinkedid'];}}}else if(_0x1b2492['secondtransfereruniqueid']==_0x1b2492['secondtransfererlinkedid']){if(!_[_0xffb8('0x22')](queues[_0x1b2492[_0xffb8('0x54')]])){utils[_0xffb8('0x3')](util[_0xffb8('0x4')](_0xffb8('0x60'),_0x1b2492[_0xffb8('0x53')],queues[_0x1b2492['origtransfererlinkedid']][_0xffb8('0x2b')],_0x1b2492[_0xffb8('0x61')],_0x1b2492[_0xffb8('0x62')]));queues[_0x1b2492[_0xffb8('0x54')]]['transfer']=!![];queues[_0x1b2492['origtransfererlinkedid']][_0xffb8('0x4b')]='ATTENDED';queues[_0x1b2492[_0xffb8('0x54')]][_0xffb8('0x4d')]=_0x1b2492[_0xffb8('0x62')];queues[_0x1b2492['origtransfererlinkedid']][_0xffb8('0x4f')]=_0x1b2492[_0xffb8('0x61')];queues[_0x1b2492['origtransfererlinkedid']][_0xffb8('0xa')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x1b2492[_0xffb8('0x55')]])){if(_0x1b2492['transfertargetlinkedid']&&queues[_0x1b2492[_0xffb8('0x63')]]){queues[_0x1b2492[_0xffb8('0x63')]]['queuecallerenterreason']=0x1;queues[_0x1b2492[_0xffb8('0x5a')]]=_[_0xffb8('0x64')](queues[_0x1b2492[_0xffb8('0x63')]]);queues[_0x1b2492[_0xffb8('0x5a')]][_0xffb8('0x10')]=_0x1b2492[_0xffb8('0x5a')];queues[_0x1b2492[_0xffb8('0x5a')]][_0xffb8('0x5b')]=0x2;queues[_0x1b2492[_0xffb8('0x5a')]][_0xffb8('0x8')]=queues[_0x1b2492[_0xffb8('0x54')]][_0xffb8('0x8')];queues[_0x1b2492['transfertargetuniqueid']][_0xffb8('0x5c')]=queues[_0x1b2492['origtransfererlinkedid']]['calleridname'];queues[_0x1b2492[_0xffb8('0x5a')]]['queuecallerjoinAt']=utils[_0xffb8('0x17')]();queues[_0x1b2492[_0xffb8('0x5a')]][_0xffb8('0x1a')]=utils[_0xffb8('0x17')]();queues[_0x1b2492['transfertargetuniqueid']][_0xffb8('0x38')]=0x0;queues[_0x1b2492[_0xffb8('0x5a')]][_0xffb8('0x5d')]=0x0;utils[_0xffb8('0x3')](util[_0xffb8('0x4')](_0xffb8('0x65'),_0x1b2492[_0xffb8('0x53')],queues[_0x1b2492[_0xffb8('0x5a')]][_0xffb8('0x2b')],queues[_0x1b2492['transfertargetuniqueid']][_0xffb8('0x10')],queues[_0x1b2492[_0xffb8('0x5a')]][_0xffb8('0x8')],queues[_0x1b2492['transfertargetuniqueid']]['calleridname']));}else{utils[_0xffb8('0x3')](util['format'](_0xffb8('0x5f'),_0x1b2492['origtransfereruniqueid'],queues[_0x1b2492[_0xffb8('0x55')]]['name'],_0x1b2492[_0xffb8('0x54')]));queues[_0x1b2492[_0xffb8('0x55')]][_0xffb8('0x10')]=_0x1b2492['origtransfererlinkedid'];}}}}catch(_0x1519b8){utils[_0xffb8('0x30')](util[_0xffb8('0x4')]('[%s][queues][attendedtransfer]',_0x1b2492['origtransfereruniqueid']),_0x1519b8);}};exports['musiconholdstart']=function(_0x36dad1){try{if(!_[_0xffb8('0x22')](queues[_0x36dad1[_0xffb8('0x11')]])){utils[_0xffb8('0x13')](util['format'](_0xffb8('0x66'),_0x36dad1[_0xffb8('0x11')]),_0x36dad1);queues[_0x36dad1[_0xffb8('0x11')]][_0xffb8('0x67')]=utils[_0xffb8('0x17')]();utils['info'](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x36dad1['uniqueid'],queues[_0x36dad1['uniqueid']][_0xffb8('0x2b')],queues[_0x36dad1[_0xffb8('0x11')]][_0xffb8('0x67')]));}}catch(_0x3e2837){utils['error'](util[_0xffb8('0x4')](_0xffb8('0x66'),_0x36dad1[_0xffb8('0x11')]),_0x3e2837);}};exports[_0xffb8('0x68')]=function(_0xead28d){try{if(!_[_0xffb8('0x22')](queues[_0xead28d[_0xffb8('0x11')]])){if(!_[_0xffb8('0x22')](queues[_0xead28d['uniqueid']][_0xffb8('0x67')])){utils[_0xffb8('0x13')](util['format'](_0xffb8('0x69'),_0xead28d[_0xffb8('0x11')]),_0xead28d);queues[_0xead28d[_0xffb8('0x11')]][_0xffb8('0x5d')]+=utils[_0xffb8('0x39')](utils['now'](),queues[_0xead28d[_0xffb8('0x11')]][_0xffb8('0x67')]);utils['info'](util[_0xffb8('0x4')](_0xffb8('0x6a'),_0xead28d[_0xffb8('0x11')],queues[_0xead28d[_0xffb8('0x11')]][_0xffb8('0x2b')],queues[_0xead28d[_0xffb8('0x11')]][_0xffb8('0x5d')]));delete queues[_0xead28d[_0xffb8('0x11')]][_0xffb8('0x67')];}}}catch(_0x3d601f){utils[_0xffb8('0x30')](util[_0xffb8('0x4')](_0xffb8('0x69'),_0xead28d[_0xffb8('0x11')]),_0x3d601f);}}; \ No newline at end of file +var _0x87d8=['[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','position','assign','now','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','name','varset','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','queuecallerexitAt','value','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','[%s][queues][agentcomplete]','assigned','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','origtransfereruniqueid','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid'];(function(_0x1b33a3,_0xa85e1b){var _0xe1dc5c=function(_0x56f855){while(--_0x56f855){_0x1b33a3['push'](_0x1b33a3['shift']());}};_0xe1dc5c(++_0xa85e1b);}(_0x87d8,0x131));var _0x887d=function(_0x537c37,_0x536e74){_0x537c37=_0x537c37-0x0;var _0x241f84=_0x87d8[_0x537c37];return _0x241f84;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x887d('0x0'));var queues={};function writeDB(_0xe9f496){utils['info'](util[_0x887d('0x1')](_0x887d('0x2'),_0xe9f496[_0x887d('0x3')],_0xe9f496[_0x887d('0x4')],_0xe9f496['queue'],_0xe9f496[_0x887d('0x5')],_0xe9f496['calleridnum'],_0xe9f496[_0x887d('0x6')],_0xe9f496[_0x887d('0x7')]));if(_0xe9f496[_0x887d('0x8')]){utils[_0x887d('0x9')](_0xe9f496['queue'])[_0x887d('0xa')](function(_0x5d15d1){if(_0x5d15d1){_0xe9f496['type']=_0x5d15d1['type'];}utils[_0x887d('0xb')](_0x887d('0xc'),_0xe9f496);});}else{utils[_0x887d('0xb')]('CreateVoiceQueueReport',_0xe9f496);}if(_0xe9f496[_0x887d('0xd')]){delete queues[_0xe9f496[_0x887d('0xd')]];}else{delete queues[_0xe9f496[_0x887d('0x3')]];}}exports[_0x887d('0xe')]=function(_0x423a7f){try{utils[_0x887d('0xf')](util[_0x887d('0x1')](_0x887d('0x10'),_0x423a7f[_0x887d('0x3')]),_0x423a7f);utils[_0x887d('0x11')](util[_0x887d('0x1')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x423a7f['uniqueid'],_0x423a7f[_0x887d('0x8')],_0x423a7f[_0x887d('0x12')]));queues[_0x423a7f['uniqueid']]=_[_0x887d('0x13')](_0x423a7f,{'originalposition':_0x423a7f[_0x887d('0x12')],'queuecallerjoinAt':utils[_0x887d('0x14')](),'mohtime':0x0});}catch(_0x702a97){utils[_0x887d('0x15')](util[_0x887d('0x1')](_0x887d('0x10'),_0x423a7f[_0x887d('0x3')]),_0x702a97);}};exports['hangup']=function(_0x1cf66c){try{if(!_[_0x887d('0x16')](queues[_0x1cf66c['uniqueid']])){utils[_0x887d('0xf')](util['format'](_0x887d('0x17'),_0x1cf66c['uniqueid']),_0x1cf66c);if(queues[_0x1cf66c[_0x887d('0x3')]][_0x887d('0x18')]){if(!queues[_0x1cf66c[_0x887d('0x3')]][_0x887d('0x19')]&&!queues[_0x1cf66c['uniqueid']][_0x887d('0x1a')]){queues[_0x1cf66c[_0x887d('0x3')]][_0x887d('0x1b')]=!![];queues[_0x1cf66c[_0x887d('0x3')]][_0x887d('0x1c')]=utils['now']();queues[_0x1cf66c[_0x887d('0x3')]][_0x887d('0x7')]='COMPLETEDBYAGENT';}utils['info'](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x1cf66c[_0x887d('0x3')],queues[_0x1cf66c[_0x887d('0x3')]]['name'],queues[_0x1cf66c[_0x887d('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x1cf66c[_0x887d('0x3')]]);}else if(queues[_0x1cf66c[_0x887d('0x3')]][_0x887d('0xd')]){utils[_0x887d('0x11')](util[_0x887d('0x1')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x1cf66c[_0x887d('0x3')],queues[_0x1cf66c[_0x887d('0x3')]][_0x887d('0x1d')],queues[_0x1cf66c[_0x887d('0x3')]]['transfereduniqueid']));queues[queues[_0x1cf66c['uniqueid']][_0x887d('0xd')]]=queues[_0x1cf66c[_0x887d('0x3')]];queues[queues[_0x1cf66c[_0x887d('0x3')]][_0x887d('0xd')]]['queuecallerenterreason']=0x2;delete queues[_0x1cf66c[_0x887d('0x3')]];}}}catch(_0x3c5824){utils[_0x887d('0x15')](util['format'](_0x887d('0x17'),_0x1cf66c[_0x887d('0x3')]),_0x3c5824);}};exports[_0x887d('0x1e')]=function(_0x59415a){try{utils[_0x887d('0xf')](util[_0x887d('0x1')](_0x887d('0x1f'),_0x59415a['uniqueid']),_0x59415a);if(!_[_0x887d('0x16')](_0x59415a[_0x887d('0x20')][_0x887d('0x21')])&&_0x59415a['value'][_0x887d('0x22')]()!==_0x887d('0x23')){if(!_[_0x887d('0x16')](queues[_0x59415a[_0x887d('0x3')]])){queues[_0x59415a[_0x887d('0x3')]]['queuecallerabandon']=![];queues[_0x59415a[_0x887d('0x3')]]['queuecallerabandonAt']=null;queues[_0x59415a['uniqueid']]['queuecallerexit']=!![];queues[_0x59415a[_0x887d('0x3')]][_0x887d('0x24')]=utils[_0x887d('0x14')]();queues[_0x59415a[_0x887d('0x3')]][_0x887d('0x7')]=_0x59415a['value']['toUpperCase']();utils[_0x887d('0x11')](util[_0x887d('0x1')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x59415a[_0x887d('0x3')],queues[_0x59415a[_0x887d('0x3')]][_0x887d('0x1d')],_0x59415a[_0x887d('0x25')],queues[_0x59415a[_0x887d('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x59415a[_0x887d('0x3')]]);}}else if(!_[_0x887d('0x16')](_0x59415a['variable'][_0x887d('0x26')])){if(!_[_0x887d('0x16')](queues[_0x59415a[_0x887d('0x3')]])&&!queues[_0x59415a[_0x887d('0x3')]][_0x887d('0x19')]){queues[_0x59415a[_0x887d('0x3')]]['queuecallerabandon']=![];queues[_0x59415a['uniqueid']][_0x887d('0x27')]=null;queues[_0x59415a[_0x887d('0x3')]][_0x887d('0x1a')]=!![];queues[_0x59415a[_0x887d('0x3')]][_0x887d('0x24')]=utils[_0x887d('0x14')]();queues[_0x59415a['uniqueid']][_0x887d('0x7')]=_0x887d('0x28');utils[_0x887d('0x11')](util[_0x887d('0x1')](_0x887d('0x29'),_0x59415a[_0x887d('0x3')],queues[_0x59415a[_0x887d('0x3')]][_0x887d('0x1d')],_0x59415a['value'],queues[_0x59415a['uniqueid']][_0x887d('0x7')]));}}}catch(_0x1733f1){utils[_0x887d('0x15')](util[_0x887d('0x1')](_0x887d('0x1f'),_0x59415a['uniqueid']),_0x1733f1);}};exports['queuecallerabandon']=function(_0x3756c7){try{if(!_[_0x887d('0x16')](queues[_0x3756c7['uniqueid']])){utils[_0x887d('0xf')](util['format']('[%s][queues][queuecallerabandon]',_0x3756c7['uniqueid']),_0x3756c7);queues[_0x3756c7[_0x887d('0x3')]][_0x887d('0x1a')]=![];queues[_0x3756c7[_0x887d('0x3')]][_0x887d('0x24')]=null;queues[_0x3756c7[_0x887d('0x3')]][_0x887d('0x19')]=!![];queues[_0x3756c7['uniqueid']][_0x887d('0x27')]=utils[_0x887d('0x14')]();queues[_0x3756c7[_0x887d('0x3')]][_0x887d('0x7')]=_0x887d('0x2a');utils['info'](util[_0x887d('0x1')](_0x887d('0x2b'),_0x3756c7['uniqueid'],queues[_0x3756c7[_0x887d('0x3')]][_0x887d('0x1d')],queues[_0x3756c7['uniqueid']][_0x887d('0x7')]));}}catch(_0xe67903){utils[_0x887d('0x15')](util[_0x887d('0x1')](_0x887d('0x2c'),_0x3756c7[_0x887d('0x3')]),_0xe67903);}};exports[_0x887d('0x2d')]=function(_0x4ec547){try{if(!_[_0x887d('0x16')](queues[_0x4ec547[_0x887d('0x3')]])){utils[_0x887d('0xf')](util['format']('[%s][queues][queuecallerleave]',_0x4ec547[_0x887d('0x3')]),_0x4ec547);utils[_0x887d('0x11')](util[_0x887d('0x1')](_0x887d('0x2e'),_0x4ec547[_0x887d('0x3')],queues[_0x4ec547['uniqueid']][_0x887d('0x1d')],_0x4ec547[_0x887d('0x2f')],_0x4ec547[_0x887d('0x30')]));queues[_0x4ec547['uniqueid']]['queuecallerleave']=!![];queues[_0x4ec547[_0x887d('0x3')]]['queuecallerleaveAt']=utils[_0x887d('0x14')]();queues[_0x4ec547['uniqueid']][_0x887d('0x31')]=utils[_0x887d('0x32')](queues[_0x4ec547[_0x887d('0x3')]][_0x887d('0x18')],queues[_0x4ec547['uniqueid']][_0x887d('0x33')]);queues[_0x4ec547['uniqueid']][_0x887d('0x12')]=_0x4ec547[_0x887d('0x12')];queues[_0x4ec547[_0x887d('0x3')]]['count']=_0x4ec547[_0x887d('0x34')];queues[_0x4ec547[_0x887d('0x3')]][_0x887d('0x2f')]=_0x4ec547[_0x887d('0x2f')];queues[_0x4ec547[_0x887d('0x3')]][_0x887d('0x30')]=_0x4ec547[_0x887d('0x30')];}}catch(_0x39e97d){utils['error'](util['format'](_0x887d('0x35'),_0x4ec547['uniqueid']),_0x39e97d);}};exports[_0x887d('0x36')]=function(_0x251ef8){try{if(!_['isNil'](queues[_0x251ef8[_0x887d('0x3')]])){utils[_0x887d('0xf')](util[_0x887d('0x1')]('[%s][queues][agentconnect]',_0x251ef8[_0x887d('0x3')]),_0x251ef8);utils[_0x887d('0x11')](util[_0x887d('0x1')](_0x887d('0x37'),_0x251ef8[_0x887d('0x3')],queues[_0x251ef8[_0x887d('0x3')]][_0x887d('0x1d')],_0x251ef8[_0x887d('0x38')],_0x251ef8[_0x887d('0x39')]));queues[_0x251ef8[_0x887d('0x3')]][_0x887d('0x19')]=![];queues[_0x251ef8[_0x887d('0x3')]][_0x887d('0x19')]=![];queues[_0x251ef8['uniqueid']]['queuecallerabandonAt']=null;queues[_0x251ef8[_0x887d('0x3')]][_0x887d('0x1a')]=![];queues[_0x251ef8['uniqueid']]['queuecallerexitreason']=null;queues[_0x251ef8['uniqueid']][_0x887d('0x24')]=null;queues[_0x251ef8['uniqueid']]['assigned']=!![];queues[_0x251ef8[_0x887d('0x3')]][_0x887d('0x6')]=_0x251ef8[_0x887d('0x39')];queues[_0x251ef8[_0x887d('0x3')]][_0x887d('0x5')]=_0x251ef8[_0x887d('0x38')];}}catch(_0x10d6ff){utils[_0x887d('0x15')](util[_0x887d('0x1')]('[%s][queues][agentconnect]',_0x251ef8[_0x887d('0x3')]),_0x10d6ff);}};exports['agentcomplete']=function(_0x2b0651){try{if(!_[_0x887d('0x16')](queues[_0x2b0651[_0x887d('0x3')]])){if(queues[_0x2b0651[_0x887d('0x3')]][_0x887d('0x18')]){utils['debug'](util[_0x887d('0x1')](_0x887d('0x3a'),_0x2b0651[_0x887d('0x3')]),_0x2b0651);queues[_0x2b0651['uniqueid']][_0x887d('0x19')]=![];queues[_0x2b0651['uniqueid']][_0x887d('0x19')]=![];queues[_0x2b0651[_0x887d('0x3')]][_0x887d('0x27')]=null;queues[_0x2b0651['uniqueid']][_0x887d('0x1a')]=![];queues[_0x2b0651[_0x887d('0x3')]]['queuecallerexitAt']=null;queues[_0x2b0651[_0x887d('0x3')]][_0x887d('0x3b')]=!![];queues[_0x2b0651[_0x887d('0x3')]][_0x887d('0x5')]=_0x2b0651[_0x887d('0x38')];queues[_0x2b0651[_0x887d('0x3')]]['queuecallercomplete']=!![];queues[_0x2b0651[_0x887d('0x3')]]['queuecallercompleteAt']=utils[_0x887d('0x14')]();if(_0x2b0651[_0x887d('0x3c')]==_0x887d('0x3d')){if(!queues[_0x2b0651[_0x887d('0x3')]][_0x887d('0x3d')]){queues[_0x2b0651['uniqueid']]['queuecallerexitreason']=_0x887d('0x3e');}}else{queues[_0x2b0651[_0x887d('0x3')]][_0x887d('0x7')]='COMPLETEDBY'+_0x2b0651['reason'][_0x887d('0x22')]();}utils['info'](util['format'](_0x887d('0x3f'),_0x2b0651['uniqueid'],queues[_0x2b0651[_0x887d('0x3')]][_0x887d('0x1d')],_0x2b0651[_0x887d('0x38')],queues[_0x2b0651[_0x887d('0x3')]][_0x887d('0x7')]));writeDB(queues[_0x2b0651[_0x887d('0x3')]]);}}}catch(_0xf874a8){utils['error'](util[_0x887d('0x1')](_0x887d('0x3a'),_0x2b0651[_0x887d('0x3')]),_0xf874a8);}};exports['blindtransfer']=function(_0x42618){try{if(!_[_0x887d('0x16')](queues[_0x42618['transfereeuniqueid']])){utils[_0x887d('0xf')](util['format'](_0x887d('0x40'),_0x42618['uniqueid']),_0x42618);queues[_0x42618[_0x887d('0x41')]]['transfer']=!![];queues[_0x42618[_0x887d('0x41')]][_0x887d('0x42')]=_0x887d('0x43');queues[_0x42618[_0x887d('0x41')]][_0x887d('0x44')]=_0x42618[_0x887d('0x45')];queues[_0x42618[_0x887d('0x41')]][_0x887d('0x46')]=_0x42618[_0x887d('0x41')];queues[_0x42618[_0x887d('0x41')]][_0x887d('0x7')]=_0x887d('0x47');utils[_0x887d('0x11')](util[_0x887d('0x1')](_0x887d('0x48'),_0x42618[_0x887d('0x3')],queues[_0x42618[_0x887d('0x41')]][_0x887d('0x1d')],_0x42618[_0x887d('0x41')],_0x42618[_0x887d('0x45')]));}}catch(_0x38ef30){utils[_0x887d('0x15')](util[_0x887d('0x1')](_0x887d('0x40'),_0x42618['uniqueid']),_0x38ef30);}};exports['attendedtransfer']=function(_0x11e353){try{utils[_0x887d('0xf')](util[_0x887d('0x1')]('[%s][queues][attendedtransfer]',_0x11e353[_0x887d('0x49')]),_0x11e353);if(_0x11e353['origtransfereruniqueid']==_0x11e353['origtransfererlinkedid']){if(!_[_0x887d('0x16')](queues[_0x11e353['secondtransfererlinkedid']])){utils['info'](util[_0x887d('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x11e353[_0x887d('0x49')],queues[_0x11e353[_0x887d('0x4a')]][_0x887d('0x1d')],_0x11e353[_0x887d('0x4b')]));queues[_0x11e353[_0x887d('0x4a')]]['transfer']=!![];queues[_0x11e353[_0x887d('0x4a')]][_0x887d('0x42')]=_0x887d('0x4c');queues[_0x11e353[_0x887d('0x4a')]][_0x887d('0x44')]=_0x11e353[_0x887d('0x4b')];queues[_0x11e353[_0x887d('0x4a')]]['transferuniqueid']=_0x11e353[_0x887d('0x49')];queues[_0x11e353[_0x887d('0x4a')]][_0x887d('0x7')]=_0x887d('0x4d');}if(!_['isNil'](queues[_0x11e353[_0x887d('0x4e')]])){if(_0x11e353[_0x887d('0x4f')]&&queues[_0x11e353['transfereelinkedid']]){queues[_0x11e353[_0x887d('0x4f')]][_0x887d('0x50')]=0x1;queues[_0x11e353[_0x887d('0x41')]]=_[_0x887d('0x51')](queues[_0x11e353['transfereelinkedid']]);queues[_0x11e353['transfereeuniqueid']]['transfereduniqueid']=_0x11e353[_0x887d('0x52')];queues[_0x11e353[_0x887d('0x41')]][_0x887d('0x50')]=0x2;queues[_0x11e353[_0x887d('0x41')]][_0x887d('0x53')]=queues[_0x11e353[_0x887d('0x4a')]][_0x887d('0x53')];queues[_0x11e353[_0x887d('0x41')]][_0x887d('0x54')]=queues[_0x11e353[_0x887d('0x4a')]]['calleridname'];queues[_0x11e353[_0x887d('0x41')]][_0x887d('0x33')]=utils[_0x887d('0x14')]();queues[_0x11e353[_0x887d('0x41')]][_0x887d('0x18')]=utils[_0x887d('0x14')]();queues[_0x11e353[_0x887d('0x41')]]['holdtime']=0x0;queues[_0x11e353[_0x887d('0x41')]][_0x887d('0x55')]=0x0;utils[_0x887d('0x11')](util[_0x887d('0x1')](_0x887d('0x56'),_0x11e353[_0x887d('0x49')],queues[_0x11e353['transfereeuniqueid']][_0x887d('0x1d')],queues[_0x11e353[_0x887d('0x41')]][_0x887d('0x53')],queues[_0x11e353[_0x887d('0x41')]][_0x887d('0x54')]));}else{utils[_0x887d('0x11')](util[_0x887d('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x11e353[_0x887d('0x49')],queues[_0x11e353[_0x887d('0x4e')]][_0x887d('0x1d')],_0x11e353['secondtransfererlinkedid']));queues[_0x11e353[_0x887d('0x4e')]][_0x887d('0xd')]=_0x11e353[_0x887d('0x4a')];}}}else if(_0x11e353[_0x887d('0x57')]==_0x11e353[_0x887d('0x4a')]){if(!_['isNil'](queues[_0x11e353[_0x887d('0x4e')]])){utils['info'](util['format'](_0x887d('0x58'),_0x11e353[_0x887d('0x49')],queues[_0x11e353[_0x887d('0x4e')]][_0x887d('0x1d')],_0x11e353[_0x887d('0x57')],_0x11e353[_0x887d('0x59')]));queues[_0x11e353[_0x887d('0x4e')]]['transfer']=!![];queues[_0x11e353[_0x887d('0x4e')]][_0x887d('0x42')]='ATTENDED';queues[_0x11e353[_0x887d('0x4e')]][_0x887d('0x44')]=_0x11e353[_0x887d('0x59')];queues[_0x11e353[_0x887d('0x4e')]][_0x887d('0x46')]=_0x11e353[_0x887d('0x57')];queues[_0x11e353['origtransfererlinkedid']][_0x887d('0x7')]=_0x887d('0x4d');}if(!_['isNil'](queues[_0x11e353[_0x887d('0x4a')]])){if(_0x11e353[_0x887d('0x5a')]&&queues[_0x11e353[_0x887d('0x5a')]]){queues[_0x11e353[_0x887d('0x5a')]][_0x887d('0x50')]=0x1;queues[_0x11e353['transfertargetuniqueid']]=_[_0x887d('0x51')](queues[_0x11e353[_0x887d('0x5a')]]);queues[_0x11e353[_0x887d('0x52')]]['transfereduniqueid']=_0x11e353[_0x887d('0x52')];queues[_0x11e353[_0x887d('0x52')]]['queuecallerenterreason']=0x2;queues[_0x11e353[_0x887d('0x52')]][_0x887d('0x53')]=queues[_0x11e353[_0x887d('0x4e')]][_0x887d('0x53')];queues[_0x11e353[_0x887d('0x52')]][_0x887d('0x54')]=queues[_0x11e353['origtransfererlinkedid']][_0x887d('0x54')];queues[_0x11e353[_0x887d('0x52')]][_0x887d('0x33')]=utils[_0x887d('0x14')]();queues[_0x11e353[_0x887d('0x52')]][_0x887d('0x18')]=utils['now']();queues[_0x11e353['transfertargetuniqueid']][_0x887d('0x31')]=0x0;queues[_0x11e353['transfertargetuniqueid']]['mohtime']=0x0;utils[_0x887d('0x11')](util[_0x887d('0x1')](_0x887d('0x5b'),_0x11e353[_0x887d('0x49')],queues[_0x11e353[_0x887d('0x52')]]['name'],queues[_0x11e353[_0x887d('0x52')]][_0x887d('0xd')],queues[_0x11e353[_0x887d('0x52')]]['calleridnum'],queues[_0x11e353[_0x887d('0x52')]][_0x887d('0x54')]));}else{utils[_0x887d('0x11')](util[_0x887d('0x1')](_0x887d('0x5c'),_0x11e353['origtransfereruniqueid'],queues[_0x11e353['secondtransfererlinkedid']][_0x887d('0x1d')],_0x11e353[_0x887d('0x4e')]));queues[_0x11e353[_0x887d('0x4a')]][_0x887d('0xd')]=_0x11e353[_0x887d('0x4e')];}}}}catch(_0x87b922){utils['error'](util['format'](_0x887d('0x5d'),_0x11e353[_0x887d('0x49')]),_0x87b922);}};exports['musiconholdstart']=function(_0xa1f774){try{if(!_[_0x887d('0x16')](queues[_0xa1f774[_0x887d('0x3')]])){utils[_0x887d('0xf')](util['format'](_0x887d('0x5e'),_0xa1f774[_0x887d('0x3')]),_0xa1f774);queues[_0xa1f774['uniqueid']][_0x887d('0x5f')]=utils[_0x887d('0x14')]();utils['info'](util[_0x887d('0x1')](_0x887d('0x60'),_0xa1f774['uniqueid'],queues[_0xa1f774['uniqueid']][_0x887d('0x1d')],queues[_0xa1f774[_0x887d('0x3')]][_0x887d('0x5f')]));}}catch(_0x57fa07){utils[_0x887d('0x15')](util['format'](_0x887d('0x5e'),_0xa1f774['uniqueid']),_0x57fa07);}};exports[_0x887d('0x61')]=function(_0x2f2d40){try{if(!_[_0x887d('0x16')](queues[_0x2f2d40[_0x887d('0x3')]])){if(!_[_0x887d('0x16')](queues[_0x2f2d40[_0x887d('0x3')]]['musiconholdstartAt'])){utils[_0x887d('0xf')](util['format'](_0x887d('0x62'),_0x2f2d40['uniqueid']),_0x2f2d40);queues[_0x2f2d40[_0x887d('0x3')]][_0x887d('0x55')]+=utils[_0x887d('0x32')](utils[_0x887d('0x14')](),queues[_0x2f2d40['uniqueid']]['musiconholdstartAt']);utils[_0x887d('0x11')](util[_0x887d('0x1')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x2f2d40[_0x887d('0x3')],queues[_0x2f2d40[_0x887d('0x3')]][_0x887d('0x1d')],queues[_0x2f2d40['uniqueid']][_0x887d('0x55')]));delete queues[_0x2f2d40[_0x887d('0x3')]][_0x887d('0x5f')];}}}catch(_0x266c59){utils['error'](util[_0x887d('0x1')]('[%s][queues][musiconholdstop]',_0x2f2d40[_0x887d('0x3')]),_0x266c59);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 2f55ca8..3ad4ded 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 _0xbcce=['debug','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','replace','.wav49','.WAV','find','monitors','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./utils','./transfers.controller','info','format','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','UserId','request','CreateVoiceRecording','blinds'];(function(_0x3fcbdf,_0x15ad17){var _0x308135=function(_0x3e637b){while(--_0x3e637b){_0x3fcbdf['push'](_0x3fcbdf['shift']());}};_0x308135(++_0x15ad17);}(_0xbcce,0x162));var _0xebcc=function(_0x357601,_0x36af07){_0x357601=_0x357601-0x0;var _0xa05c17=_0xbcce[_0x357601];return _0xa05c17;};'use strict';var _=require(_0xebcc('0x0'));var util=require(_0xebcc('0x1'));var utils=require(_0xebcc('0x2'));var transfers=require(_0xebcc('0x3'));var recordings={};function writeDB(_0x438133){var _0x323002;utils[_0xebcc('0x4')](util[_0xebcc('0x5')]('[%s][recordings][writeDB]',_0x438133['uniqueid']));if(transfers['blinds'][_0x438133[_0xebcc('0x6')]]){_0x323002=_0x438133[_0xebcc('0x6')];_0x438133[_0xebcc('0x6')]=transfers['blinds'][_0x438133[_0xebcc('0x6')]][_0xebcc('0x7')];}if(_0x438133[_0xebcc('0x8')]){utils[_0xebcc('0x9')](_0x438133[_0xebcc('0x8')])[_0xebcc('0xa')](function(_0x478e27){if(_0x478e27){_0x438133[_0xebcc('0xb')]=_0x478e27['name'];_0x438133[_0xebcc('0xc')]=_0x478e27['id'];}utils[_0xebcc('0xd')](_0xebcc('0xe'),_0x438133);});}else{utils[_0xebcc('0xd')](_0xebcc('0xe'),_0x438133);}if(_0x323002)delete transfers[_0xebcc('0xf')][_0x323002];}exports['newchannel']=function(_0x9d0d63){try{utils[_0xebcc('0x10')](util[_0xebcc('0x5')]('[%s][recordings][newchannel]',_0x9d0d63[_0xebcc('0x6')]),_0x9d0d63);if(_0x9d0d63[_0xebcc('0x6')]==_0x9d0d63['linkedid']){utils['info'](util[_0xebcc('0x5')](_0xebcc('0x11'),_0x9d0d63[_0xebcc('0x6')],_0x9d0d63[_0xebcc('0x12')],_0x9d0d63[_0xebcc('0x13')]));recordings[_0x9d0d63[_0xebcc('0x6')]]={'uniqueid':_0x9d0d63[_0xebcc('0x6')],'accountcode':_0x9d0d63[_0xebcc('0x8')],'exten':_0x9d0d63[_0xebcc('0x13')],'context':_0x9d0d63['context'],'channel':_0x9d0d63[_0xebcc('0x14')],'monitors':[]};}}catch(_0x530550){utils[_0xebcc('0x15')](util[_0xebcc('0x5')](_0xebcc('0x16'),_0x9d0d63[_0xebcc('0x6')]),_0x530550);}};exports[_0xebcc('0x17')]=function(_0x73dd8f){try{utils['debug'](util['format'](_0xebcc('0x18'),_0x73dd8f[_0xebcc('0x6')]),_0x73dd8f);if(!_[_0xebcc('0x19')](recordings[_0x73dd8f[_0xebcc('0x6')]])&&_0x73dd8f[_0xebcc('0x1a')]==0x6){utils['info'](util[_0xebcc('0x5')](_0xebcc('0x1b'),_0x73dd8f['uniqueid'],_0x73dd8f[_0xebcc('0x12')],_0x73dd8f['channel']));}else if(!_[_0xebcc('0x19')](recordings[_0x73dd8f[_0xebcc('0x1c')]])&&_0x73dd8f[_0xebcc('0x1a')]==0x6&&_0x73dd8f['context']!=_0xebcc('0x1d')){utils[_0xebcc('0x4')](util[_0xebcc('0x5')](_0xebcc('0x1e'),_0x73dd8f[_0xebcc('0x6')],_0x73dd8f[_0xebcc('0x1c')],_0x73dd8f[_0xebcc('0x12')],_0x73dd8f[_0xebcc('0x14')]));recordings[_0x73dd8f[_0xebcc('0x1c')]][_0xebcc('0x8')]=_0x73dd8f[_0xebcc('0x8')];}}catch(_0x21e41c){utils['error'](util['format'](_0xebcc('0x18'),_0x73dd8f[_0xebcc('0x6')]),_0x21e41c);}};exports[_0xebcc('0x1f')]=function(_0xeb30f3){try{if(!_[_0xebcc('0x19')](_0xeb30f3[_0xebcc('0x20')])&&!_['isNil'](_0xeb30f3[_0xebcc('0x20')][_0xebcc('0x21')])){utils['debug'](util['format'](_0xebcc('0x22'),_0xeb30f3[_0xebcc('0x6')]),_0xeb30f3);utils[_0xebcc('0x4')](util[_0xebcc('0x5')](_0xebcc('0x23'),_0xeb30f3[_0xebcc('0x6')],_0xeb30f3[_0xebcc('0x20')],_0xeb30f3[_0xebcc('0x24')]));if(_['endsWith'](_0xeb30f3[_0xebcc('0x24')],'.wav49')){_0xeb30f3['value']=_0xeb30f3[_0xebcc('0x24')][_0xebcc('0x25')](_0xebcc('0x26'),_0xebcc('0x27'));}if(recordings[_0xeb30f3[_0xebcc('0x1c')]]){var _0x249479=_[_0xebcc('0x28')](recordings[_0xeb30f3[_0xebcc('0x1c')]][_0xebcc('0x29')],{'value':_0xeb30f3[_0xebcc('0x24')]});if(_[_0xebcc('0x19')](_0x249479)){recordings[_0xeb30f3[_0xebcc('0x1c')]]['monitors']['push']({'value':_0xeb30f3['value']});}}}}catch(_0x1f89bf){utils[_0xebcc('0x15')](util[_0xebcc('0x5')](_0xebcc('0x22'),_0xeb30f3[_0xebcc('0x6')]),_0x1f89bf);}};exports[_0xebcc('0x2a')]=function(_0x323b1d){try{if(!_['isNil'](recordings[_0x323b1d[_0xebcc('0x6')]])){utils[_0xebcc('0x10')](util['format'](_0xebcc('0x2b'),_0x323b1d[_0xebcc('0x6')]),_0x323b1d);utils['info'](util[_0xebcc('0x5')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x323b1d[_0xebcc('0x6')],_0x323b1d[_0xebcc('0x2c')],_0x323b1d[_0xebcc('0x2d')],_0x323b1d[_0xebcc('0x2e')]));recordings[_0x323b1d[_0xebcc('0x6')]][_0xebcc('0x2c')]=_0x323b1d[_0xebcc('0x2c')];recordings[_0x323b1d[_0xebcc('0x6')]]['calleridname']=_0x323b1d[_0xebcc('0x2d')];recordings[_0x323b1d[_0xebcc('0x6')]][_0xebcc('0x2f')]=_0x323b1d['connectedlinenum'];recordings[_0x323b1d[_0xebcc('0x6')]][_0xebcc('0x30')]=_0x323b1d[_0xebcc('0x30')];if(recordings[_0x323b1d['uniqueid']][_0xebcc('0x31')]==_0xebcc('0x32')&&recordings[_0x323b1d['uniqueid']]['accountcode']){recordings[_0x323b1d[_0xebcc('0x6')]]['connectedlinenum']=recordings[_0x323b1d['uniqueid']][_0xebcc('0x8')];recordings[_0x323b1d['uniqueid']][_0xebcc('0x30')]='';}recordings[_0x323b1d['uniqueid']][_0xebcc('0x29')][_0xebcc('0x33')](function(_0x4f5e7e){var _0x38fdd3=_[_0xebcc('0x34')](recordings[_0x323b1d[_0xebcc('0x6')]]);_0x38fdd3[_0xebcc('0x24')]=_0x4f5e7e[_0xebcc('0x24')];writeDB(_0x38fdd3);});delete recordings[_0x323b1d['uniqueid']];}}catch(_0x3c9a56){utils['error'](util[_0xebcc('0x5')](_0xebcc('0x2b'),_0x323b1d[_0xebcc('0x6')]),_0x3c9a56);}};exports[_0xebcc('0x35')]=function(_0x3465e){try{if(!_[_0xebcc('0x19')](recordings[_0x3465e[_0xebcc('0x6')]])){utils[_0xebcc('0x10')](util[_0xebcc('0x5')]('[%s][recordings][newexten]',_0x3465e[_0xebcc('0x6')]),_0x3465e);utils[_0xebcc('0x4')](util[_0xebcc('0x5')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x3465e['uniqueid'],_0x3465e[_0xebcc('0x36')],_0x3465e[_0xebcc('0x37')]));if(_0x3465e['application'][_0xebcc('0x38')]()==_0xebcc('0x39')&&_[_0xebcc('0x3a')](_0x3465e[_0xebcc('0x37')][_0xebcc('0x38')](),'cdr')){var _0x43b854=_0x3465e[_0xebcc('0x37')][_0xebcc('0x3b')]('=');var _0x56951f=_0x43b854[0x0][_0xebcc('0x3c')](_0x43b854[0x0][_0xebcc('0x3d')]('(')+0x1,_0x43b854[0x0][_0xebcc('0x3d')](')'));var _0x3e0a0f=_0x43b854[0x1];recordings[_0x3465e[_0xebcc('0x6')]][_0x56951f]=_0x3e0a0f;}}}catch(_0x40c6af){utils[_0xebcc('0x15')](util[_0xebcc('0x5')](_0xebcc('0x3e'),_0x3465e[_0xebcc('0x6')]),_0x40c6af);}};exports[_0xebcc('0x3f')]=function(_0x2b0959){try{if(!_['isNil'](recordings[_0x2b0959[_0xebcc('0x6')]])){utils[_0xebcc('0x10')](util['format'](_0xebcc('0x40'),_0x2b0959[_0xebcc('0x6')]),_0x2b0959);utils[_0xebcc('0x4')](util[_0xebcc('0x5')](_0xebcc('0x41'),_0x2b0959[_0xebcc('0x6')],_0x2b0959[_0xebcc('0x42')]));recordings[_0x2b0959[_0xebcc('0x6')]][_0xebcc('0x42')]=_0x2b0959[_0xebcc('0x42')];}}catch(_0x26a600){utils[_0xebcc('0x15')](util[_0xebcc('0x5')](_0xebcc('0x40'),_0x2b0959[_0xebcc('0x6')]),_0x26a600);}};exports[_0xebcc('0x43')]=function(_0x474bab){try{utils['debug'](util['format'](_0xebcc('0x44'),_0x474bab[_0xebcc('0x6')]),_0x474bab);utils[_0xebcc('0x4')](util[_0xebcc('0x5')](_0xebcc('0x45'),_0x474bab[_0xebcc('0x6')],_0x474bab['transferercalleridnum'],_0x474bab[_0xebcc('0x46')],_0x474bab[_0xebcc('0x47')],_0x474bab[_0xebcc('0x48')]));if(recordings[_0x474bab['transfereruniqueid']]&&transfers[_0xebcc('0xf')][_0x474bab[_0xebcc('0x49')]]){transfers[_0xebcc('0xf')][_0x474bab[_0xebcc('0x49')]]['recording']=!![];}}catch(_0x1442ce){utils[_0xebcc('0x15')](util['format'](_0xebcc('0x44'),_0x474bab[_0xebcc('0x6')]),_0x1442ce);}}; \ No newline at end of file +var _0x299a=['channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','value','.wav49','replace','find','monitors','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','set','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','./utils','./transfers.controller','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','membername','name','UserId','request','newchannel','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','debug','[%s][recordings][newstate]','isNil'];(function(_0x4ade0b,_0x4acc6d){var _0x23f585=function(_0xbe34f3){while(--_0xbe34f3){_0x4ade0b['push'](_0x4ade0b['shift']());}};_0x23f585(++_0x4acc6d);}(_0x299a,0x1ef));var _0xa299=function(_0xed7a2e,_0x3605b4){_0xed7a2e=_0xed7a2e-0x0;var _0xdde76c=_0x299a[_0xed7a2e];return _0xdde76c;};'use strict';var _=require(_0xa299('0x0'));var util=require('util');var utils=require(_0xa299('0x1'));var transfers=require(_0xa299('0x2'));var recordings={};function writeDB(_0x2cd189){var _0x2b67fd;utils['info'](util[_0xa299('0x3')](_0xa299('0x4'),_0x2cd189['uniqueid']));if(transfers[_0xa299('0x5')][_0x2cd189[_0xa299('0x6')]]){_0x2b67fd=_0x2cd189['uniqueid'];_0x2cd189[_0xa299('0x6')]=transfers[_0xa299('0x5')][_0x2cd189[_0xa299('0x6')]][_0xa299('0x7')];}if(_0x2cd189[_0xa299('0x8')]){utils['getUserByInternal'](_0x2cd189[_0xa299('0x8')])['then'](function(_0x4456ed){if(_0x4456ed){_0x2cd189[_0xa299('0x9')]=_0x4456ed[_0xa299('0xa')];_0x2cd189[_0xa299('0xb')]=_0x4456ed['id'];}utils[_0xa299('0xc')]('CreateVoiceRecording',_0x2cd189);});}else{utils[_0xa299('0xc')]('CreateVoiceRecording',_0x2cd189);}if(_0x2b67fd)delete transfers['blinds'][_0x2b67fd];}exports[_0xa299('0xd')]=function(_0x447d70){try{utils['debug'](util[_0xa299('0x3')](_0xa299('0xe'),_0x447d70[_0xa299('0x6')]),_0x447d70);if(_0x447d70['uniqueid']==_0x447d70[_0xa299('0xf')]){utils[_0xa299('0x10')](util[_0xa299('0x3')](_0xa299('0x11'),_0x447d70[_0xa299('0x6')],_0x447d70[_0xa299('0x12')],_0x447d70['exten']));recordings[_0x447d70[_0xa299('0x6')]]={'uniqueid':_0x447d70[_0xa299('0x6')],'accountcode':_0x447d70[_0xa299('0x8')],'exten':_0x447d70[_0xa299('0x13')],'context':_0x447d70[_0xa299('0x12')],'channel':_0x447d70[_0xa299('0x14')],'monitors':[]};}}catch(_0x4d7658){utils[_0xa299('0x15')](util['format'](_0xa299('0xe'),_0x447d70['uniqueid']),_0x4d7658);}};exports['newstate']=function(_0x1be84c){try{utils[_0xa299('0x16')](util['format'](_0xa299('0x17'),_0x1be84c[_0xa299('0x6')]),_0x1be84c);if(!_[_0xa299('0x18')](recordings[_0x1be84c[_0xa299('0x6')]])&&_0x1be84c[_0xa299('0x19')]==0x6){utils[_0xa299('0x10')](util[_0xa299('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x1be84c[_0xa299('0x6')],_0x1be84c[_0xa299('0x12')],_0x1be84c[_0xa299('0x14')]));}else if(!_[_0xa299('0x18')](recordings[_0x1be84c['linkedid']])&&_0x1be84c['channelstate']==0x6&&_0x1be84c[_0xa299('0x12')]!=_0xa299('0x1a')){utils['info'](util[_0xa299('0x3')](_0xa299('0x1b'),_0x1be84c[_0xa299('0x6')],_0x1be84c[_0xa299('0xf')],_0x1be84c[_0xa299('0x12')],_0x1be84c[_0xa299('0x14')]));recordings[_0x1be84c[_0xa299('0xf')]][_0xa299('0x8')]=_0x1be84c[_0xa299('0x8')];}}catch(_0x2a7426){utils[_0xa299('0x15')](util[_0xa299('0x3')](_0xa299('0x17'),_0x1be84c[_0xa299('0x6')]),_0x2a7426);}};exports[_0xa299('0x1c')]=function(_0x3a4bd0){try{if(!_['isNil'](_0x3a4bd0[_0xa299('0x1d')])&&!_[_0xa299('0x18')](_0x3a4bd0[_0xa299('0x1d')][_0xa299('0x1e')])){utils[_0xa299('0x16')](util['format'](_0xa299('0x1f'),_0x3a4bd0[_0xa299('0x6')]),_0x3a4bd0);utils[_0xa299('0x10')](util[_0xa299('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x3a4bd0[_0xa299('0x6')],_0x3a4bd0[_0xa299('0x1d')],_0x3a4bd0[_0xa299('0x20')]));if(_['endsWith'](_0x3a4bd0[_0xa299('0x20')],_0xa299('0x21'))){_0x3a4bd0[_0xa299('0x20')]=_0x3a4bd0[_0xa299('0x20')][_0xa299('0x22')]('.wav49','.WAV');}if(recordings[_0x3a4bd0[_0xa299('0xf')]]){var _0x224640=_[_0xa299('0x23')](recordings[_0x3a4bd0['linkedid']]['monitors'],{'value':_0x3a4bd0['value']});if(_[_0xa299('0x18')](_0x224640)){recordings[_0x3a4bd0[_0xa299('0xf')]][_0xa299('0x24')]['push']({'value':_0x3a4bd0[_0xa299('0x20')]});}}}}catch(_0x4d3515){utils[_0xa299('0x15')](util[_0xa299('0x3')]('[%s][recordings][varset]',_0x3a4bd0[_0xa299('0x6')]),_0x4d3515);}};exports[_0xa299('0x25')]=function(_0x7f1c30){try{if(!_[_0xa299('0x18')](recordings[_0x7f1c30['uniqueid']])){utils['debug'](util['format']('[%s][recordings][hangup]',_0x7f1c30[_0xa299('0x6')]),_0x7f1c30);utils[_0xa299('0x10')](util['format'](_0xa299('0x26'),_0x7f1c30[_0xa299('0x6')],_0x7f1c30[_0xa299('0x27')],_0x7f1c30[_0xa299('0x28')],_0x7f1c30[_0xa299('0x29')]));recordings[_0x7f1c30['uniqueid']][_0xa299('0x27')]=_0x7f1c30[_0xa299('0x27')];recordings[_0x7f1c30[_0xa299('0x6')]][_0xa299('0x28')]=_0x7f1c30['calleridname'];recordings[_0x7f1c30[_0xa299('0x6')]][_0xa299('0x2a')]=_0x7f1c30[_0xa299('0x2a')];recordings[_0x7f1c30[_0xa299('0x6')]][_0xa299('0x2b')]=_0x7f1c30[_0xa299('0x2b')];if(recordings[_0x7f1c30[_0xa299('0x6')]][_0xa299('0x2c')]=='outbound'&&recordings[_0x7f1c30['uniqueid']][_0xa299('0x8')]){recordings[_0x7f1c30[_0xa299('0x6')]][_0xa299('0x2a')]=recordings[_0x7f1c30[_0xa299('0x6')]][_0xa299('0x8')];recordings[_0x7f1c30[_0xa299('0x6')]][_0xa299('0x2b')]='';}recordings[_0x7f1c30[_0xa299('0x6')]][_0xa299('0x24')][_0xa299('0x2d')](function(_0x22d8e3){var _0x385f56=_[_0xa299('0x2e')](recordings[_0x7f1c30[_0xa299('0x6')]]);_0x385f56['value']=_0x22d8e3[_0xa299('0x20')];writeDB(_0x385f56);});delete recordings[_0x7f1c30['uniqueid']];}}catch(_0x4127fa){utils[_0xa299('0x15')](util[_0xa299('0x3')]('[%s][recordings][hangup]',_0x7f1c30['uniqueid']),_0x4127fa);}};exports[_0xa299('0x2f')]=function(_0x29af5c){try{if(!_[_0xa299('0x18')](recordings[_0x29af5c[_0xa299('0x6')]])){utils['debug'](util[_0xa299('0x3')](_0xa299('0x30'),_0x29af5c[_0xa299('0x6')]),_0x29af5c);utils[_0xa299('0x10')](util[_0xa299('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x29af5c['uniqueid'],_0x29af5c[_0xa299('0x31')],_0x29af5c[_0xa299('0x32')]));if(_0x29af5c[_0xa299('0x31')][_0xa299('0x33')]()==_0xa299('0x34')&&_['startsWith'](_0x29af5c[_0xa299('0x32')]['toLowerCase'](),_0xa299('0x35'))){var _0x9f2f3b=_0x29af5c[_0xa299('0x32')]['split']('=');var _0x45c69d=_0x9f2f3b[0x0][_0xa299('0x36')](_0x9f2f3b[0x0][_0xa299('0x37')]('(')+0x1,_0x9f2f3b[0x0]['lastIndexOf'](')'));var _0xa4d456=_0x9f2f3b[0x1];recordings[_0x29af5c[_0xa299('0x6')]][_0x45c69d]=_0xa4d456;}}}catch(_0x1e9959){utils[_0xa299('0x15')](util[_0xa299('0x3')](_0xa299('0x30'),_0x29af5c[_0xa299('0x6')]),_0x1e9959);}};exports[_0xa299('0x38')]=function(_0x5985ad){try{if(!_['isNil'](recordings[_0x5985ad['uniqueid']])){utils['debug'](util[_0xa299('0x3')](_0xa299('0x39'),_0x5985ad['uniqueid']),_0x5985ad);utils[_0xa299('0x10')](util[_0xa299('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x5985ad[_0xa299('0x6')],_0x5985ad[_0xa299('0x3a')]));recordings[_0x5985ad['uniqueid']]['queue']=_0x5985ad[_0xa299('0x3a')];}}catch(_0x34a342){utils[_0xa299('0x15')](util[_0xa299('0x3')]('[%s][recordings][queuecallerjoin]',_0x5985ad[_0xa299('0x6')]),_0x34a342);}};exports['blindtransfer']=function(_0x410f7d){try{utils[_0xa299('0x16')](util[_0xa299('0x3')](_0xa299('0x3b'),_0x410f7d[_0xa299('0x6')]),_0x410f7d);utils[_0xa299('0x10')](util['format'](_0xa299('0x3c'),_0x410f7d[_0xa299('0x6')],_0x410f7d['transferercalleridnum'],_0x410f7d[_0xa299('0x3d')],_0x410f7d[_0xa299('0x3e')],_0x410f7d[_0xa299('0x3f')]));if(recordings[_0x410f7d[_0xa299('0x40')]]&&transfers['blinds'][_0x410f7d['transfereruniqueid']]){transfers[_0xa299('0x5')][_0x410f7d[_0xa299('0x40')]]['recording']=!![];}}catch(_0x32f144){utils[_0xa299('0x15')](util[_0xa299('0x3')](_0xa299('0x3b'),_0x410f7d[_0xa299('0x6')]),_0x32f144);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 3283490..8139a00 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 _0x815e=['secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','uniqueid','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','origtransferercalleridname','secondtransfererconnectedlinenum'];(function(_0x2a385a,_0x589f8a){var _0x4d34ba=function(_0x35f155){while(--_0x35f155){_0x2a385a['push'](_0x2a385a['shift']());}};_0x4d34ba(++_0x589f8a);}(_0x815e,0x189));var _0xe815=function(_0x175f35,_0x370d37){_0x175f35=_0x175f35-0x0;var _0x1065b1=_0x815e[_0x175f35];return _0x1065b1;};'use strict';var _=require(_0xe815('0x0'));var util=require(_0xe815('0x1'));var utils=require(_0xe815('0x2'));function writeDB(_0x26c65e){utils['info'](util[_0xe815('0x3')](_0xe815('0x4'),_0x26c65e['type']==='attended'?_0x26c65e[_0xe815('0x5')]:_0x26c65e['uniqueid'],_0x26c65e['type']));utils[_0xe815('0x6')](_0xe815('0x7'),_0x26c65e);}exports[_0xe815('0x8')]={};exports[_0xe815('0x9')]=function(_0x19f3c1){try{utils[_0xe815('0xa')](util['format']('[%s][transfers][blindtransfer]',_0x19f3c1[_0xe815('0xb')]),_0x19f3c1);utils[_0xe815('0xc')](util[_0xe815('0x3')](_0xe815('0xd'),_0x19f3c1['uniqueid'],_0x19f3c1['transferercalleridnum'],_0x19f3c1[_0xe815('0xe')],_0x19f3c1[_0xe815('0xf')],_0x19f3c1[_0xe815('0x10')]));_0x19f3c1['type']=_0xe815('0x11');exports['blinds'][_0x19f3c1['transfereruniqueid']]=_0x19f3c1;writeDB(_0x19f3c1);}catch(_0x23db52){utils[_0xe815('0x12')](util[_0xe815('0x3')]('[%s][transfers][blindtransfer]',_0x19f3c1[_0xe815('0xb')]),_0x23db52);}};exports[_0xe815('0x13')]=function(_0x29cfa2){try{utils['debug'](util[_0xe815('0x3')](_0xe815('0x14'),_0x29cfa2['origtransfereruniqueid']),_0x29cfa2);utils[_0xe815('0xc')](util[_0xe815('0x3')](_0xe815('0x15'),_0x29cfa2[_0xe815('0x5')],_0x29cfa2[_0xe815('0x16')],_0x29cfa2['origtransferercalleridname'],_0x29cfa2[_0xe815('0x17')],_0x29cfa2[_0xe815('0x18')]));_0x29cfa2=_['assign'](_0x29cfa2,{'transfererchannel':_0x29cfa2['origtransfererchannel'],'transferercalleridnum':_0x29cfa2[_0xe815('0x16')],'transferercalleridname':_0x29cfa2[_0xe815('0x19')],'transfererconnectedlinenum':_0x29cfa2[_0xe815('0x1a')],'transfererconnectedlinename':_0x29cfa2[_0xe815('0x1b')],'transfereraccountcode':_0x29cfa2[_0xe815('0x1c')],'transferercontext':_0x29cfa2['secondtransferercontext'],'transfererexten':_0x29cfa2[_0xe815('0x1d')],'transfererlinkedid':_0x29cfa2[_0xe815('0x1e')],'context':_0x29cfa2[_0xe815('0x1f')],'extension':_0x29cfa2[_0xe815('0x20')],'type':_0xe815('0x21')});if(_[_0xe815('0x22')](_0x29cfa2[_0xe815('0x23')])){_0x29cfa2=_['assign'](_0x29cfa2,{'transfereechannel':_0x29cfa2[_0xe815('0x24')],'transfereecalleridnum':_0x29cfa2['transfertargetcalleridnum'],'transfereecalleridname':_0x29cfa2[_0xe815('0x18')],'transfereeconnectedlinenum':_0x29cfa2['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x29cfa2[_0xe815('0x25')],'transfereeaccountcode':_0x29cfa2[_0xe815('0x26')],'transfereecontext':_0x29cfa2[_0xe815('0x27')],'transfereeexten':_0x29cfa2[_0xe815('0x28')],'transfereelinkedid':_0x29cfa2[_0xe815('0x29')]});}writeDB(_0x29cfa2);}catch(_0x551b31){utils['error'](util[_0xe815('0x3')](_0xe815('0x14'),_0x29cfa2['origtransfereruniqueid']),_0x551b31);}}; \ No newline at end of file +var _0x8675=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetconnectedlinenum'];(function(_0x28004c,_0x23778d){var _0x48f3c9=function(_0x28b38c){while(--_0x28b38c){_0x28004c['push'](_0x28004c['shift']());}};_0x48f3c9(++_0x23778d);}(_0x8675,0xac));var _0x5867=function(_0x281372,_0x2a5398){_0x281372=_0x281372-0x0;var _0x4957b6=_0x8675[_0x281372];return _0x4957b6;};'use strict';var _=require('lodash');var util=require(_0x5867('0x0'));var utils=require('./utils');function writeDB(_0x3c5033){utils[_0x5867('0x1')](util[_0x5867('0x2')](_0x5867('0x3'),_0x3c5033[_0x5867('0x4')]===_0x5867('0x5')?_0x3c5033['origtransfereruniqueid']:_0x3c5033[_0x5867('0x6')],_0x3c5033[_0x5867('0x4')]));utils['request']('CreateVoiceTransferReport',_0x3c5033);}exports[_0x5867('0x7')]={};exports[_0x5867('0x8')]=function(_0x263b1b){try{utils[_0x5867('0x9')](util['format'](_0x5867('0xa'),_0x263b1b['uniqueid']),_0x263b1b);utils[_0x5867('0x1')](util[_0x5867('0x2')](_0x5867('0xb'),_0x263b1b['uniqueid'],_0x263b1b[_0x5867('0xc')],_0x263b1b[_0x5867('0xd')],_0x263b1b[_0x5867('0xe')],_0x263b1b[_0x5867('0xf')]));_0x263b1b[_0x5867('0x4')]=_0x5867('0x10');exports[_0x5867('0x7')][_0x263b1b[_0x5867('0x11')]]=_0x263b1b;writeDB(_0x263b1b);}catch(_0x15c7f0){utils[_0x5867('0x12')](util[_0x5867('0x2')]('[%s][transfers][blindtransfer]',_0x263b1b[_0x5867('0x6')]),_0x15c7f0);}};exports[_0x5867('0x13')]=function(_0x2b6214){try{utils[_0x5867('0x9')](util[_0x5867('0x2')](_0x5867('0x14'),_0x2b6214[_0x5867('0x15')]),_0x2b6214);utils[_0x5867('0x1')](util[_0x5867('0x2')](_0x5867('0x16'),_0x2b6214[_0x5867('0x15')],_0x2b6214[_0x5867('0x17')],_0x2b6214[_0x5867('0x18')],_0x2b6214[_0x5867('0x19')],_0x2b6214[_0x5867('0x1a')]));_0x2b6214=_[_0x5867('0x1b')](_0x2b6214,{'transfererchannel':_0x2b6214[_0x5867('0x1c')],'transferercalleridnum':_0x2b6214[_0x5867('0x17')],'transferercalleridname':_0x2b6214['origtransferercalleridname'],'transfererconnectedlinenum':_0x2b6214['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2b6214[_0x5867('0x1d')],'transfereraccountcode':_0x2b6214[_0x5867('0x1e')],'transferercontext':_0x2b6214[_0x5867('0x1f')],'transfererexten':_0x2b6214[_0x5867('0x20')],'transfererlinkedid':_0x2b6214['origtransfererlinkedid'],'context':_0x2b6214[_0x5867('0x21')],'extension':_0x2b6214[_0x5867('0x22')],'type':_0x5867('0x5')});if(_[_0x5867('0x23')](_0x2b6214[_0x5867('0x24')])){_0x2b6214=_[_0x5867('0x1b')](_0x2b6214,{'transfereechannel':_0x2b6214['transfertargetchannel'],'transfereecalleridnum':_0x2b6214[_0x5867('0x19')],'transfereecalleridname':_0x2b6214[_0x5867('0x1a')],'transfereeconnectedlinenum':_0x2b6214[_0x5867('0x25')],'transfereeconnectedlinename':_0x2b6214[_0x5867('0x26')],'transfereeaccountcode':_0x2b6214[_0x5867('0x27')],'transfereecontext':_0x2b6214[_0x5867('0x28')],'transfereeexten':_0x2b6214[_0x5867('0x29')],'transfereelinkedid':_0x2b6214['transfertargetlinkedid']});}writeDB(_0x2b6214);}catch(_0x184547){utils['error'](util['format'](_0x5867('0x14'),_0x2b6214[_0x5867('0x15')]),_0x184547);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 3924485..cb4afc6 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 _0xc6df=['subtract','seconds','diffTime','diff','sumTime','now','isAfter','moment','util','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc6df,0x115));var _0xfc6d=function(_0x34af2c,_0x3be462){_0x34af2c=_0x34af2c-0x0;var _0x1bb889=_0xc6df[_0x34af2c];return _0x1bb889;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0xfc6d('0x0'));var util=require(_0xfc6d('0x1'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0xfc6d('0x2'))(_0xfc6d('0x3'));exports[_0xfc6d('0x4')]=function(_0x1e23a6,_0x3f5725){logger[_0xfc6d('0x4')](_0x1e23a6,_0x3f5725?util[_0xfc6d('0x5')](_0x3f5725,{'showHidden':![],'depth':null}):'');};exports[_0xfc6d('0x6')]=function(_0x4c9ead,_0x33714f){logger[_0xfc6d('0x6')](_0x4c9ead,_0x33714f?util[_0xfc6d('0x5')](_0x33714f,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x51ccc3,_0x40b7d8){logger[_0xfc6d('0x7')](_0x51ccc3,_0x40b7d8?util['inspect'](_0x40b7d8,{'showHidden':![],'depth':null}):'');};exports[_0xfc6d('0x8')]=function(_0x4fdff8,_0x43904f){return client['request'](_0x4fdff8,{'body':_0x43904f})[_0xfc6d('0x9')](function(_0x33e307){logger[_0xfc6d('0x6')](_0xfc6d('0xa'),_0x4fdff8,_0x33e307?util[_0xfc6d('0x5')](_0x33e307,{'showHidden':![],'depth':null}):'');})[_0xfc6d('0xb')](function(_0x551be5){logger[_0xfc6d('0x7')](_0xfc6d('0xa'),_0x4fdff8,_0x551be5?util[_0xfc6d('0x5')](_0x551be5,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5b65f5){return client['request'](_0xfc6d('0xc'),{'options':{'raw':!![],'attributes':['id',_0xfc6d('0xd'),_0xfc6d('0xe'),_0xfc6d('0xf')],'where':_0x5b65f5,'limit':0x1}})[_0xfc6d('0x9')](function(_0x3372ef){logger[_0xfc6d('0x6')](_0xfc6d('0x10'),JSON[_0xfc6d('0x11')](_0x5b65f5),_0x3372ef?util[_0xfc6d('0x5')](_0x3372ef,{'showHidden':![],'depth':null}):'');return _0x3372ef[_0xfc6d('0x12')][_0xfc6d('0x13')]?_0x3372ef[_0xfc6d('0x12')][0x0]:null;});}exports[_0xfc6d('0x14')]=function(_0x148fe9){return new BPromise(function(_0x56cc8f,_0x8b8ceb){if(_0x148fe9){return getUser({'internal':_0x148fe9})['then'](function(_0x1f702a){logger[_0xfc6d('0x4')](_0xfc6d('0x15'),_0x148fe9,_0x1f702a?_0xfc6d('0x16'):_0xfc6d('0x17'));return _0x56cc8f(_0x1f702a);})[_0xfc6d('0xb')](function(_0x5dff37){logger[_0xfc6d('0x7')](_0xfc6d('0x18'),_0x5dff37?util['inspect'](_0x5dff37,{'showHidden':![],'depth':null}):'');return _0x56cc8f(null);});}return _0x56cc8f(null);});};exports[_0xfc6d('0x19')]=function(_0x56f774){return new BPromise(function(_0x7abeb4,_0x7204d9){if(_0x56f774){return getUser({'interface':_0x56f774})[_0xfc6d('0x9')](function(_0x4b0792){logger[_0xfc6d('0x4')](_0xfc6d('0x1a'),_0x56f774,_0x4b0792?_0xfc6d('0x16'):_0xfc6d('0x17'));return _0x7abeb4(_0x4b0792);})[_0xfc6d('0xb')](function(_0x105b2e){logger[_0xfc6d('0x7')]('[utils][getUserByInterface]',_0x105b2e?util[_0xfc6d('0x5')](_0x105b2e,{'showHidden':![],'depth':null}):'');return _0x7abeb4(null);});}return _0x7abeb4(null);});};exports['getUserByName']=function(_0x3ea395){return new BPromise(function(_0x494bd9,_0x31fa6f){if(_0x3ea395){return getUser({'name':_0x3ea395})[_0xfc6d('0x9')](function(_0x1196fb){logger[_0xfc6d('0x4')](_0xfc6d('0x1b'),_0x3ea395,_0x1196fb?'found':_0xfc6d('0x17'));return _0x494bd9(_0x1196fb);})[_0xfc6d('0xb')](function(_0x2c2486){logger['error']('[utils][getUserByName]',_0x2c2486?util[_0xfc6d('0x5')](_0x2c2486,{'showHidden':![],'depth':null}):'');return _0x494bd9(null);});}return _0x494bd9(null);});};exports[_0xfc6d('0x1c')]=function(_0x466a1a){return new BPromise(function(_0x17b976,_0x26cda6){if(_0x466a1a){return client[_0xfc6d('0x8')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xfc6d('0xe'),_0xfc6d('0x1d'),_0xfc6d('0x1e'),_0xfc6d('0x1f')],'where':{'name':_0x466a1a},'limit':0x1}})[_0xfc6d('0x9')](function(_0x47c574){logger[_0xfc6d('0x6')]('[utils][getVoiceQueueByName]\x20name:%s',_0x466a1a,_0x47c574?util['inspect'](_0x47c574,{'showHidden':![],'depth':null}):'');logger['info'](_0xfc6d('0x20'),_0x466a1a,_0x47c574?_0xfc6d('0x16'):_0xfc6d('0x17'));return _0x17b976(_0x47c574[_0xfc6d('0x12')]['length']?_0x47c574[_0xfc6d('0x12')][0x0]:null);})[_0xfc6d('0xb')](function(_0x32bc60){logger['error'](_0xfc6d('0x21'),_0x32bc60?util['inspect'](_0x32bc60,{'showHidden':![],'depth':null}):'');return _0x17b976(null);});}return _0x17b976(null);});};exports[_0xfc6d('0x22')]=function(_0x3e1ce3,_0x25f29e){return moment(_0x3e1ce3)[_0xfc6d('0x23')](_0x25f29e,'seconds')[_0xfc6d('0x24')](_0xfc6d('0x25'));};exports['subtractTime']=function(_0xb4e3b5,_0x442efc){return moment(_0xb4e3b5)[_0xfc6d('0x26')](_0x442efc,_0xfc6d('0x27'))[_0xfc6d('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xfc6d('0x28')]=function(_0x45a8e0,_0x418bdc){return moment(_0x45a8e0)[_0xfc6d('0x29')](moment(_0x418bdc),_0xfc6d('0x27'));};exports[_0xfc6d('0x2a')]=function(_0x551745,_0x4238da){return parseInt(_0x551745,0xa)+parseInt(_0x4238da,0xa);};exports[_0xfc6d('0x2b')]=function(){return moment()[_0xfc6d('0x24')](_0xfc6d('0x25'));};exports[_0xfc6d('0x2c')]=function(_0x40c666,_0x2b7912){if(_0x2b7912){return moment(_0x40c666)[_0xfc6d('0x2c')](_0x2b7912);}return!![];};exports['isBefore']=function(_0x430a67,_0x3e83e3){if(_0x3e83e3){return moment(_0x430a67)['isBefore'](_0x3e83e3);}else if(_0x430a67){return!![];}return![];}; \ No newline at end of file +var _0x3759=['debug','inspect','error','request','[utils][request]\x20name:%s','internal','then','stringify','result','length','getUserByInternal','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','catch','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','GetVoiceQueue','name','type','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','xdr','info'];(function(_0x5f049d,_0x31a171){var _0x27b1c5=function(_0x4ee6bc){while(--_0x4ee6bc){_0x5f049d['push'](_0x5f049d['shift']());}};_0x27b1c5(++_0x31a171);}(_0x3759,0x131));var _0x9375=function(_0xfb03e5,_0x25c988){_0xfb03e5=_0xfb03e5-0x0;var _0x2bce94=_0x3759[_0xfb03e5];return _0x2bce94;};'use strict';var BPromise=require(_0x9375('0x0'));var jayson=require(_0x9375('0x1'));var moment=require(_0x9375('0x2'));var util=require(_0x9375('0x3'));var client=jayson[_0x9375('0x4')]['http']({'port':0x2329});var logger=require('../../config/logger')(_0x9375('0x5'));exports[_0x9375('0x6')]=function(_0x593f50,_0x1ec343){logger[_0x9375('0x6')](_0x593f50,_0x1ec343?util['inspect'](_0x1ec343,{'showHidden':![],'depth':null}):'');};exports[_0x9375('0x7')]=function(_0x2e5a30,_0x259bc2){logger[_0x9375('0x7')](_0x2e5a30,_0x259bc2?util[_0x9375('0x8')](_0x259bc2,{'showHidden':![],'depth':null}):'');};exports[_0x9375('0x9')]=function(_0x3d8bc8,_0x44fa56){logger['error'](_0x3d8bc8,_0x44fa56?util['inspect'](_0x44fa56,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x34b7a8,_0x14c75c){return client[_0x9375('0xa')](_0x34b7a8,{'body':_0x14c75c})['then'](function(_0x2be560){logger[_0x9375('0x7')](_0x9375('0xb'),_0x34b7a8,_0x2be560?util[_0x9375('0x8')](_0x2be560,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x21d0c4){logger[_0x9375('0x9')](_0x9375('0xb'),_0x34b7a8,_0x21d0c4?util[_0x9375('0x8')](_0x21d0c4,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4c4ce3){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id',_0x9375('0xc'),'name','interface'],'where':_0x4c4ce3,'limit':0x1}})[_0x9375('0xd')](function(_0x4402a5){logger[_0x9375('0x7')]('[utils][getUser]\x20where:%s',JSON[_0x9375('0xe')](_0x4c4ce3),_0x4402a5?util['inspect'](_0x4402a5,{'showHidden':![],'depth':null}):'');return _0x4402a5[_0x9375('0xf')][_0x9375('0x10')]?_0x4402a5['result'][0x0]:null;});}exports[_0x9375('0x11')]=function(_0x55874c){return new BPromise(function(_0x5e915d,_0x369c37){if(_0x55874c){return getUser({'internal':_0x55874c})[_0x9375('0xd')](function(_0x3f8f03){logger[_0x9375('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x55874c,_0x3f8f03?_0x9375('0x12'):_0x9375('0x13'));return _0x5e915d(_0x3f8f03);})['catch'](function(_0x19146f){logger[_0x9375('0x9')](_0x9375('0x14'),_0x19146f?util[_0x9375('0x8')](_0x19146f,{'showHidden':![],'depth':null}):'');return _0x5e915d(null);});}return _0x5e915d(null);});};exports['getUserByInterface']=function(_0x298a8b){return new BPromise(function(_0x38a4a5,_0x3408f8){if(_0x298a8b){return getUser({'interface':_0x298a8b})[_0x9375('0xd')](function(_0x2b77e4){logger[_0x9375('0x6')](_0x9375('0x15'),_0x298a8b,_0x2b77e4?'found':'notfound');return _0x38a4a5(_0x2b77e4);})[_0x9375('0x16')](function(_0x1c36b0){logger[_0x9375('0x9')](_0x9375('0x17'),_0x1c36b0?util[_0x9375('0x8')](_0x1c36b0,{'showHidden':![],'depth':null}):'');return _0x38a4a5(null);});}return _0x38a4a5(null);});};exports[_0x9375('0x18')]=function(_0x2af28c){return new BPromise(function(_0x4985d2,_0x4f74f8){if(_0x2af28c){return getUser({'name':_0x2af28c})[_0x9375('0xd')](function(_0x395097){logger[_0x9375('0x6')]('[utils][getUserByName]\x20name:%s\x20%s',_0x2af28c,_0x395097?'found':_0x9375('0x13'));return _0x4985d2(_0x395097);})['catch'](function(_0x1925d4){logger[_0x9375('0x9')](_0x9375('0x19'),_0x1925d4?util[_0x9375('0x8')](_0x1925d4,{'showHidden':![],'depth':null}):'');return _0x4985d2(null);});}return _0x4985d2(null);});};exports['getVoiceQueueByName']=function(_0x872be7){return new BPromise(function(_0x4e8233,_0x54013f){if(_0x872be7){return client[_0x9375('0xa')](_0x9375('0x1a'),{'options':{'raw':!![],'attributes':['id',_0x9375('0x1b'),_0x9375('0x1c'),'acw','acwTimeout'],'where':{'name':_0x872be7},'limit':0x1}})[_0x9375('0xd')](function(_0x196499){logger[_0x9375('0x7')]('[utils][getVoiceQueueByName]\x20name:%s',_0x872be7,_0x196499?util[_0x9375('0x8')](_0x196499,{'showHidden':![],'depth':null}):'');logger[_0x9375('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x872be7,_0x196499?'found':_0x9375('0x13'));return _0x4e8233(_0x196499[_0x9375('0xf')][_0x9375('0x10')]?_0x196499[_0x9375('0xf')][0x0]:null);})['catch'](function(_0x1ceb9a){logger[_0x9375('0x9')]('[utils][getVoiceQueueByName]',_0x1ceb9a?util[_0x9375('0x8')](_0x1ceb9a,{'showHidden':![],'depth':null}):'');return _0x4e8233(null);});}return _0x4e8233(null);});};exports['addTime']=function(_0x4e85ab,_0x57790e){return moment(_0x4e85ab)['add'](_0x57790e,_0x9375('0x1d'))[_0x9375('0x1e')](_0x9375('0x1f'));};exports['subtractTime']=function(_0x383884,_0x382d48){return moment(_0x383884)[_0x9375('0x20')](_0x382d48,_0x9375('0x1d'))[_0x9375('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x9375('0x21')]=function(_0x319b1e,_0x3cb68a){return moment(_0x319b1e)[_0x9375('0x22')](moment(_0x3cb68a),'seconds');};exports[_0x9375('0x23')]=function(_0x44b5dd,_0x4dff8d){return parseInt(_0x44b5dd,0xa)+parseInt(_0x4dff8d,0xa);};exports[_0x9375('0x24')]=function(){return moment()[_0x9375('0x1e')](_0x9375('0x1f'));};exports['isAfter']=function(_0x32f62c,_0x3ade88){if(_0x3ade88){return moment(_0x32f62c)[_0x9375('0x25')](_0x3ade88);}return!![];};exports['isBefore']=function(_0x4a9c0d,_0x24b10d){if(_0x24b10d){return moment(_0x4a9c0d)[_0x9375('0x26')](_0x24b10d);}else if(_0x4a9c0d){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 0859b50..af67880 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 _0xe15a=['data','timestamp','error','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','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','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','client','role','name','ensureDir','then','user','no-user'];(function(_0x4efd45,_0x10ac98){var _0x18594e=function(_0x2cf321){while(--_0x2cf321){_0x4efd45['push'](_0x4efd45['shift']());}};_0x18594e(++_0x10ac98);}(_0xe15a,0x80));var _0xae15=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xe15a[_0x36884e];return _0x1cc367;};var fs=require(_0xae15('0x0'));var _=require(_0xae15('0x1'));var ewinston=require(_0xae15('0x2'));var path=require('path');var util=require(_0xae15('0x3'));var fileLogger=require(_0xae15('0x4'))['fileLogger'];var safeTemplate=require(_0xae15('0x5'))[_0xae15('0x6')];var maskSensitiveData=require(_0xae15('0x7'))['maskSensitiveData'];function ClientSideLogger(){function _0x536abd(_0x40745e){var _0x545cca=path[_0xae15('0x8')](_0xae15('0x9'),_0xae15('0xa'),_0xae15('0xb'));var _0xd69f51=path[_0xae15('0x8')](_0xae15('0xc'),_0x40745e[_0xae15('0xd')]+'-'+_0x40745e[_0xae15('0xe')]);return fs[_0xae15('0xf')](path['join'](_0x545cca,_0xd69f51))[_0xae15('0x10')](function(){var _0x34b5e6=fileLogger(_0xae15('0xc'),path[_0xae15('0x8')](_0x545cca,_0xd69f51));return _0x34b5e6;})['catch'](function(_0x5983c9){throw _0x5983c9;});}this[_0xae15('0xa')]=function(_0x5b5a96,_0x3784ef,_0x55c911,_0x292179){return _0x536abd(_0x5b5a96[_0xae15('0x11')])[_0xae15('0x10')](function(_0x3ea41c){var _0x5b0f07=_0x3ea41c[_0x3784ef];return _0x5b0f07;})['then'](function(_0x5ac7dc){var _0x218cbd=_0x5b5a96[_0xae15('0x11')]?_0x5b5a96['user']['id']:_0xae15('0x12');var _0x172a88=_0x292179[_0xae15('0x13')];var _0x8be3f4=_0x292179[_0xae15('0x14')];var _0x500117=new Date(Number(_0x8be3f4));return _0x5ac7dc(_0x218cbd,_0x500117,_0x55c911,_0x172a88);})['catch'](function(_0x742ae4){fileLogger(_0xae15('0xc'))[_0xae15('0x15')](_0x742ae4);});};}function setupLoggers(_0x37025e){return new Promise(function(_0x47501a){var _0x45f05d=new ClientSideLogger();var _0x1f34ba=fileLogger(_0xae15('0x16'));var _0x30943f=fileLogger(_0xae15('0x17'));_0x37025e[_0xae15('0x18')](_0xae15('0x19'),_0x45f05d);_0x37025e[_0xae15('0x1a')](ewinston[_0xae15('0x1b')]({'winstonInstance':_0x1f34ba,'meta':![],'statusLevels':!![],'msg':function(_0x33a245,_0x274a04){var _0x36ea03=_0xae15('0x1c');if(!_[_0xae15('0x1d')](_0x33a245['body'])){_0x36ea03+=_0xae15('0x1e');var _0x430d7e=_0x33a245['body'];maskSensitiveData(_0x430d7e);}return safeTemplate(util[_0xae15('0x1f')](_0x36ea03,_0x33a245[_0xae15('0x20')],_0x33a245[_0xae15('0x21')][_0xae15('0x22')]?_0x33a245[_0xae15('0x21')][_0xae15('0x22')]:_0x33a245[_0xae15('0x23')][_0xae15('0x24')]||_0x33a245['ip'],_0x33a245[_0xae15('0x25')],_0x274a04['statusCode'],_0x274a04[_0xae15('0x26')],_0x33a245['user']?_0x33a245[_0xae15('0x11')]['id']:null,_0x33a245['user']?_0x33a245[_0xae15('0x11')][_0xae15('0xe')]:null,_0x33a245[_0xae15('0x11')]?_0x33a245[_0xae15('0x11')]['role']:null,_0x430d7e?util[_0xae15('0x27')](_0x430d7e,![],null):''));}}));_0x37025e['use'](ewinston[_0xae15('0x1b')]({'winstonInstance':_0x30943f,'meta':![],'statusLevels':!![],'msg':function(_0x1c2885,_0x373543){var _0x5de157=_0xae15('0x28');if(_0x1c2885[_0xae15('0x29')]&&_0x1c2885[_0xae15('0x29')][_0xae15('0x2a')]&&_0x1c2885['body']['agent_id']){_0x5de157=_0xae15('0x2b');}return util[_0xae15('0x1f')](_0x5de157,_0x1c2885[_0xae15('0x20')],_0x1c2885[_0xae15('0x21')][_0xae15('0x22')]?_0x1c2885[_0xae15('0x21')][_0xae15('0x22')]:_0x1c2885[_0xae15('0x23')][_0xae15('0x24')]||_0x1c2885['ip'],_0x1c2885[_0xae15('0x25')],_0x373543['statusCode'],_0x373543[_0xae15('0x26')],_0x1c2885[_0xae15('0x11')]?_0x1c2885[_0xae15('0x11')]['id']:null,_0x1c2885[_0xae15('0x11')]?_0x1c2885[_0xae15('0x11')][_0xae15('0xe')]:null,_0x1c2885['user']?_0x1c2885['user'][_0xae15('0xd')]:null,_0x1c2885[_0xae15('0x29')]&&_0x1c2885[_0xae15('0x29')][_0xae15('0x2a')]?_0x1c2885['body'][_0xae15('0x2a')]:_0xae15('0x2c'),_0x1c2885[_0xae15('0x29')]&&_0x1c2885[_0xae15('0x29')][_0xae15('0x2d')]?_0x1c2885['body'][_0xae15('0x2d')]:'',_0x1c2885[_0xae15('0x29')]&&_0x1c2885[_0xae15('0x29')][_0xae15('0x2e')]?_0x1c2885['body'][_0xae15('0x2e')]:'');},'ignoreRoute':function(_0x2092ba){var _0x581f5a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x581f5a[_0xae15('0x2f')](_0x2092ba['url']);}}));return _0x47501a();});}exports[_0xae15('0x30')]=setupLoggers; \ No newline at end of file +var _0x03ce=['use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','method','url','agent_id','agent_name','setupLoggers','fs-extra','lodash','express-winston','path','./loggers','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','no-user','api','auth','set','client-side-logger'];(function(_0x20e407,_0x3ab861){var _0x11185e=function(_0xac15d6){while(--_0xac15d6){_0x20e407['push'](_0x20e407['shift']());}};_0x11185e(++_0x3ab861);}(_0x03ce,0xef));var _0xe03c=function(_0x541b2c,_0x34972e){_0x541b2c=_0x541b2c-0x0;var _0x42c517=_0x03ce[_0x541b2c];return _0x42c517;};var fs=require(_0xe03c('0x0'));var _=require(_0xe03c('0x1'));var ewinston=require(_0xe03c('0x2'));var path=require(_0xe03c('0x3'));var util=require('util');var fileLogger=require(_0xe03c('0x4'))[_0xe03c('0x5')];var safeTemplate=require('./safe-template')[_0xe03c('0x6')];var maskSensitiveData=require(_0xe03c('0x7'))[_0xe03c('0x8')];function ClientSideLogger(){function _0x1c3e2c(_0x255f59){var _0x3a605b=path[_0xe03c('0x9')](_0xe03c('0xa'),_0xe03c('0xb'),_0xe03c('0xc'));var _0x70d07c=path['join'](_0xe03c('0xd'),_0x255f59[_0xe03c('0xe')]+'-'+_0x255f59[_0xe03c('0xf')]);return fs[_0xe03c('0x10')](path['join'](_0x3a605b,_0x70d07c))[_0xe03c('0x11')](function(){var _0x38cefe=fileLogger('client',path[_0xe03c('0x9')](_0x3a605b,_0x70d07c));return _0x38cefe;})[_0xe03c('0x12')](function(_0x22d783){throw _0x22d783;});}this[_0xe03c('0xb')]=function(_0x16657a,_0x318f93,_0x105545,_0x41ef28){return _0x1c3e2c(_0x16657a['user'])['then'](function(_0x3785d2){var _0x37c6dd=_0x3785d2[_0x318f93];return _0x37c6dd;})[_0xe03c('0x11')](function(_0x3c7e2a){var _0x5f2906=_0x16657a[_0xe03c('0x13')]?_0x16657a[_0xe03c('0x13')]['id']:_0xe03c('0x14');var _0x585e42=_0x41ef28['data'];var _0xd1bcc5=_0x41ef28['timestamp'];var _0x40f2ba=new Date(Number(_0xd1bcc5));return _0x3c7e2a(_0x5f2906,_0x40f2ba,_0x105545,_0x585e42);})[_0xe03c('0x12')](function(_0x1f8e82){fileLogger('client')['error'](_0x1f8e82);});};}function setupLoggers(_0xc34669){return new Promise(function(_0x3078eb){var _0x4d5341=new ClientSideLogger();var _0x5c1ba1=fileLogger(_0xe03c('0x15'));var _0x434b0a=fileLogger(_0xe03c('0x16'));_0xc34669[_0xe03c('0x17')](_0xe03c('0x18'),_0x4d5341);_0xc34669[_0xe03c('0x19')](ewinston['logger']({'winstonInstance':_0x5c1ba1,'meta':![],'statusLevels':!![],'msg':function(_0xc35e5d,_0x35f5ea){var _0x14cfe1=_0xe03c('0x1a');if(!_[_0xe03c('0x1b')](_0xc35e5d[_0xe03c('0x1c')])){_0x14cfe1+='\x20body=%s';var _0x50ec67=_0xc35e5d[_0xe03c('0x1c')];maskSensitiveData(_0x50ec67);}return safeTemplate(util[_0xe03c('0x1d')](_0x14cfe1,_0xc35e5d['method'],_0xc35e5d[_0xe03c('0x1e')]['x-forwarded-for']?_0xc35e5d[_0xe03c('0x1e')][_0xe03c('0x1f')]:_0xc35e5d[_0xe03c('0x20')][_0xe03c('0x21')]||_0xc35e5d['ip'],_0xc35e5d['url'],_0x35f5ea[_0xe03c('0x22')],_0x35f5ea[_0xe03c('0x23')],_0xc35e5d[_0xe03c('0x13')]?_0xc35e5d['user']['id']:null,_0xc35e5d[_0xe03c('0x13')]?_0xc35e5d['user'][_0xe03c('0xf')]:null,_0xc35e5d['user']?_0xc35e5d['user'][_0xe03c('0xe')]:null,_0x50ec67?util[_0xe03c('0x24')](_0x50ec67,![],null):''));}}));_0xc34669[_0xe03c('0x19')](ewinston['logger']({'winstonInstance':_0x434b0a,'meta':![],'statusLevels':!![],'msg':function(_0x29c804,_0x27e6ae){var _0x41e7f5=_0xe03c('0x25');if(_0x29c804[_0xe03c('0x1c')]&&_0x29c804[_0xe03c('0x1c')][_0xe03c('0x26')]&&_0x29c804['body']['agent_id']){_0x41e7f5='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xe03c('0x1d')](_0x41e7f5,_0x29c804[_0xe03c('0x27')],_0x29c804['headers'][_0xe03c('0x1f')]?_0x29c804[_0xe03c('0x1e')][_0xe03c('0x1f')]:_0x29c804[_0xe03c('0x20')][_0xe03c('0x21')]||_0x29c804['ip'],_0x29c804[_0xe03c('0x28')],_0x27e6ae[_0xe03c('0x22')],_0x27e6ae[_0xe03c('0x23')],_0x29c804[_0xe03c('0x13')]?_0x29c804[_0xe03c('0x13')]['id']:null,_0x29c804[_0xe03c('0x13')]?_0x29c804[_0xe03c('0x13')][_0xe03c('0xf')]:null,_0x29c804['user']?_0x29c804[_0xe03c('0x13')][_0xe03c('0xe')]:null,_0x29c804[_0xe03c('0x1c')]&&_0x29c804[_0xe03c('0x1c')][_0xe03c('0x26')]?_0x29c804[_0xe03c('0x1c')]['device']:'other',_0x29c804[_0xe03c('0x1c')]&&_0x29c804[_0xe03c('0x1c')][_0xe03c('0x29')]?_0x29c804[_0xe03c('0x1c')][_0xe03c('0x29')]:'',_0x29c804[_0xe03c('0x1c')]&&_0x29c804['body']['agent_name']?_0x29c804[_0xe03c('0x1c')][_0xe03c('0x2a')]:'');},'ignoreRoute':function(_0x45a256){var _0x4510d7=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4510d7['test'](_0x45a256[_0xe03c('0x28')]);}}));return _0x3078eb();});}exports[_0xe03c('0x2b')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 8b70885..4e83ed2 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b75=['timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','max','min','MMM','monthCompare','test','padStart','length','iftime','lodash','moment-timezone','map','source','join','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','circularDoWInterval','monthsShort','clone','minutes','hours','isBefore','startOf','day','endOf','isBetween'];(function(_0x23407f,_0x12a5da){var _0xc988ec=function(_0x4325ea){while(--_0x4325ea){_0x23407f['push'](_0x23407f['shift']());}};_0xc988ec(++_0x12a5da);}(_0x6b75,0x1e3));var _0x56b7=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0x6b75[_0x158f01];return _0x5ef74e;};var _=require(_0x56b7('0x0'));var moment=require(_0x56b7('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x56b7('0x2')](function(_0x5c9424){return _0x5c9424[_0x56b7('0x3')];})[_0x56b7('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0x56b7('0x5');function throwIfDateNotValid(_0x19c593){if(!_0x19c593[_0x56b7('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x3a63ac){var _0x330127=_0x3a63ac[_0x56b7('0x7')](':')[_0x56b7('0x2')](function(_0x2b73a4){return parseInt(_0x2b73a4,0xa);});var _0x3c9c11=_0x330127[0x0];var _0x26359a=_0x330127[0x1];if(_0x3c9c11<0x0||_0x3c9c11>0x17||_0x26359a<0x0||_0x26359a>0x3b){throw new Error(EINVALID_DATE);}return[_0x3c9c11,_0x26359a];}function circularDoWInterval(_0x4a6edb,_0x5daf77){if(_0x4a6edb===_0x5daf77){return[_0x4a6edb];}else{var _0x116589=moment['locale']();moment[_0x56b7('0x8')]('en');var _0x324134=moment[_0x56b7('0x9')]()[_0x56b7('0x2')](function(_0x2b86e9){return _0x2b86e9[_0x56b7('0xa')]();});moment[_0x56b7('0x8')](_0x116589);var _0x51c3b6=_0x324134['indexOf'](_0x4a6edb);var _0x242721=_0x324134[_0x56b7('0xb')](_0x5daf77);if(_0x242721>_0x51c3b6){return _0x324134[_0x56b7('0xc')](_0x51c3b6,_0x242721+0x1);}else{var _0x4ba020=_0x324134[_0x56b7('0xc')](0x0,_0x242721+0x1);var _0xc3dd45=_0x324134['slice'](_0x51c3b6);return _0xc3dd45['concat'](_0x4ba020);}}}module[_0x56b7('0xd')][_0x56b7('0xe')]=circularDoWInterval;function circularMonthInterval(_0x453763,_0xedd5d1){if(_0x453763===_0xedd5d1){return[_0x453763];}else{var _0xc2200b=moment[_0x56b7('0x8')]();moment[_0x56b7('0x8')]('en');var _0x2a3d98=moment[_0x56b7('0xf')]()[_0x56b7('0x2')](function(_0x5c90a4){return _0x5c90a4['toLowerCase']();});moment[_0x56b7('0x8')](_0xc2200b);var _0x5eab0c=_0x2a3d98[_0x56b7('0xb')](_0x453763);var _0xee5d48=_0x2a3d98[_0x56b7('0xb')](_0xedd5d1);if(_0xee5d48>_0x5eab0c){return _0x2a3d98[_0x56b7('0xc')](_0x5eab0c,_0xee5d48+0x1);}else{var _0x4ac767=_0x2a3d98[_0x56b7('0xc')](0x0,_0xee5d48+0x1);var _0x46b645=_0x2a3d98[_0x56b7('0xc')](_0x5eab0c);return _0x46b645['concat'](_0x4ac767);}}}module[_0x56b7('0xd')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x7d7df5){var _0x264571=parseInt(_0x7d7df5,0xa);if(_0x264571<0x1||_0x264571>0x1f){throw new Error(EINVALID_DATE);}return _0x264571;}function timeCompare(_0xf617b8,_0x55c4cd,_0x57eb41){var _0x26b632=_0xf617b8[_0x56b7('0x10')]();var _0x1de1e6=extractTime(_0x55c4cd);var _0x186f4f=_0x1de1e6[0x0];var _0x40fbcc=_0x1de1e6[0x1];var _0x5e2872=_0xf617b8[_0x56b7('0x10')]()['hours'](_0x186f4f)[_0x56b7('0x11')](_0x40fbcc);throwIfDateNotValid(_0x5e2872);var _0x47e529=extractTime(_0x57eb41);var _0xd386dd=_0x47e529[0x0];var _0x129984=_0x47e529[0x1];var _0xe60fd=_0xf617b8['clone']()[_0x56b7('0x12')](_0xd386dd)[_0x56b7('0x11')](_0x129984);throwIfDateNotValid(_0xe60fd);if(_0xe60fd[_0x56b7('0x13')](_0x5e2872)){var _0x34c38d=_0x26b632[_0x56b7('0x10')]()[_0x56b7('0x14')](_0x56b7('0x15'));var _0xf6742=_0x26b632[_0x56b7('0x10')]()[_0x56b7('0x16')](_0x56b7('0x15'));return _0x26b632['isBetween'](_0x5e2872,_0xf6742,undefined,'[]')||_0x26b632[_0x56b7('0x17')](_0x34c38d,_0xe60fd,undefined,'[]');}else{return _0x26b632[_0x56b7('0x17')](_0x5e2872,_0xe60fd,undefined,'[]');}}module[_0x56b7('0xd')][_0x56b7('0x18')]=timeCompare;function dowCompare(_0x3bc041,_0x38f508,_0x16e39a){var _0x1d1970=_0x3bc041[_0x56b7('0x8')]('en')[_0x56b7('0x19')](_0x56b7('0x1a'))[_0x56b7('0xa')]();return circularDoWInterval(_0x38f508,_0x16e39a)[_0x56b7('0x1b')](_0x1d1970);}module[_0x56b7('0xd')][_0x56b7('0x1c')]=dowCompare;function domCompare(_0x43eeeb,_0x1fa461,_0x11ae31){var _0x5a8284=_0x43eeeb[_0x56b7('0x1d')]();if(_0x1fa461===_0x11ae31){return _0x5a8284===_0x1fa461;}else{var _0x476392=_0x43eeeb[_0x56b7('0x1e')]();var _0x303314=_0x1fa461<_0x11ae31;let _0x30df89=![];var _0x3edfd4=0x0;var _0x33bc7b=0x0;if(_0x303314){_0x3edfd4=Math[_0x56b7('0x1f')](0x1,_0x1fa461);_0x33bc7b=Math[_0x56b7('0x20')](_0x11ae31,_0x476392);_0x30df89=_0x5a8284>=_0x3edfd4&&_0x5a8284<=_0x33bc7b;}else{_0x3edfd4=Math[_0x56b7('0x20')](_0x1fa461,_0x476392);_0x33bc7b=Math['max'](0x1,_0x11ae31);_0x30df89=_0x5a8284>=_0x3edfd4||_0x5a8284<=_0x33bc7b;}return _0x30df89;}}module[_0x56b7('0xd')]['domCompare']=domCompare;function monthCompare(_0x557665,_0x2bfad8,_0x3d04e0){var _0x413037=_0x557665[_0x56b7('0x8')]('en')['format'](_0x56b7('0x21'))[_0x56b7('0xa')]();return circularMonthInterval(_0x2bfad8,_0x3d04e0)[_0x56b7('0x1b')](_0x413037);}module['exports'][_0x56b7('0x22')]=monthCompare;function iftime(_0x484c2f,_0x159bde=moment['tz']['guess'](),_0x397013=moment()){if(!validateRx[_0x56b7('0x23')](_0x484c2f)){throw new Error(EINVALID_STRING);}else{var _0x12d358=(moment['isMoment'](_0x397013)?_0x397013[_0x56b7('0x10')]():moment(_0x397013))['tz'](_0x159bde)[_0x56b7('0x8')]('en');throwIfDateNotValid(_0x12d358);var _0x5c8679=_0x484c2f[_0x56b7('0x7')](',');var _0x4623d7=_0x5c8679[0x0];var _0x146cf5=_0x5c8679[0x1];var _0x52aade=_0x5c8679[0x2];var _0x2396ce=_0x5c8679[0x3];let _0x315f1d=!![];if(_0x4623d7!=='*'){var _0x5f00f8=_0x4623d7['split']('-');var _0x1ed869=_[_0x56b7('0x24')](_0x5f00f8[0x0],0x5,'0');var _0x1f56e9=_0x5f00f8['length']===0x2?_[_0x56b7('0x24')](_0x5f00f8[0x1],0x5,'0'):_0x1ed869;_0x315f1d=timeCompare(_0x12d358,_0x1ed869,_0x1f56e9);}let _0x497be8=!![];if(_0x146cf5!=='*'){var _0x15d84a=_0x146cf5[_0x56b7('0x7')]('-');var _0x11cd76=_0x15d84a[0x0];var _0xe296a0=_0x15d84a['length']===0x2?_0x15d84a[0x1]:_0x11cd76;_0x497be8=dowCompare(_0x12d358,_0x11cd76,_0xe296a0);}let _0x546e4f=!![];if(_0x52aade!=='*'){var _0x180523=_0x52aade[_0x56b7('0x7')]('-');var _0x6fac02=parseDom(_0x180523[0x0]);var _0x3de4bb=_0x180523[_0x56b7('0x25')]===0x2?parseDom(_0x180523[0x1]):_0x6fac02;_0x546e4f=domCompare(_0x12d358,_0x6fac02,_0x3de4bb);}let _0x5df050=!![];if(_0x2396ce!=='*'){var _0x17c37c=_0x2396ce['split']('-');var _0x45618e=_0x17c37c[0x0];var _0xdc22cd=_0x17c37c[_0x56b7('0x25')]===0x2?_0x17c37c[0x1]:_0x17c37c[0x0];_0x5df050=monthCompare(_0x12d358,_0x45618e,_0xdc22cd);}return _0x315f1d&&_0x497be8&&_0x546e4f&&_0x5df050;}}module[_0x56b7('0xd')][_0x56b7('0x26')]=iftime; \ No newline at end of file +var _0x0066=['circularMonthInterval','clone','minutes','hours','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','max','min','domCompare','MMM','guess','test','isMoment','padStart','length','lodash','moment-timezone','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','map','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','circularDoWInterval','monthsShort','concat'];(function(_0x1bfe8a,_0x153e7a){var _0x5931de=function(_0x3bcd03){while(--_0x3bcd03){_0x1bfe8a['push'](_0x1bfe8a['shift']());}};_0x5931de(++_0x153e7a);}(_0x0066,0x1da));var _0x6006=function(_0x41ecee,_0x8ec4d8){_0x41ecee=_0x41ecee-0x0;var _0x2ea815=_0x0066[_0x41ecee];return _0x2ea815;};var _=require(_0x6006('0x0'));var moment=require(_0x6006('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x2e40bc){return _0x2e40bc[_0x6006('0x2')];})[_0x6006('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x6006('0x4');var EINVALID_DATE=_0x6006('0x5');function throwIfDateNotValid(_0x25591d){if(!_0x25591d[_0x6006('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x49ba4d){var _0x7afeb0=_0x49ba4d[_0x6006('0x7')](':')[_0x6006('0x8')](function(_0x25d2b5){return parseInt(_0x25d2b5,0xa);});var _0x253a7b=_0x7afeb0[0x0];var _0x20b1ae=_0x7afeb0[0x1];if(_0x253a7b<0x0||_0x253a7b>0x17||_0x20b1ae<0x0||_0x20b1ae>0x3b){throw new Error(EINVALID_DATE);}return[_0x253a7b,_0x20b1ae];}function circularDoWInterval(_0x338afa,_0x46e08b){if(_0x338afa===_0x46e08b){return[_0x338afa];}else{var _0x316f38=moment[_0x6006('0x9')]();moment[_0x6006('0x9')]('en');var _0x46f8c7=moment[_0x6006('0xa')]()['map'](function(_0x4017c1){return _0x4017c1[_0x6006('0xb')]();});moment[_0x6006('0x9')](_0x316f38);var _0x283ebd=_0x46f8c7[_0x6006('0xc')](_0x338afa);var _0x301bd5=_0x46f8c7[_0x6006('0xc')](_0x46e08b);if(_0x301bd5>_0x283ebd){return _0x46f8c7[_0x6006('0xd')](_0x283ebd,_0x301bd5+0x1);}else{var _0x1ce8bd=_0x46f8c7[_0x6006('0xd')](0x0,_0x301bd5+0x1);var _0x49edf6=_0x46f8c7[_0x6006('0xd')](_0x283ebd);return _0x49edf6['concat'](_0x1ce8bd);}}}module[_0x6006('0xe')][_0x6006('0xf')]=circularDoWInterval;function circularMonthInterval(_0x290cd2,_0x5798b3){if(_0x290cd2===_0x5798b3){return[_0x290cd2];}else{var _0x4e3aac=moment[_0x6006('0x9')]();moment[_0x6006('0x9')]('en');var _0x1cf46d=moment[_0x6006('0x10')]()[_0x6006('0x8')](function(_0x23db73){return _0x23db73[_0x6006('0xb')]();});moment[_0x6006('0x9')](_0x4e3aac);var _0x2302b6=_0x1cf46d[_0x6006('0xc')](_0x290cd2);var _0x14557a=_0x1cf46d['indexOf'](_0x5798b3);if(_0x14557a>_0x2302b6){return _0x1cf46d[_0x6006('0xd')](_0x2302b6,_0x14557a+0x1);}else{var _0x19923e=_0x1cf46d[_0x6006('0xd')](0x0,_0x14557a+0x1);var _0x2d6cb6=_0x1cf46d[_0x6006('0xd')](_0x2302b6);return _0x2d6cb6[_0x6006('0x11')](_0x19923e);}}}module[_0x6006('0xe')][_0x6006('0x12')]=circularMonthInterval;function parseDom(_0x3dfd7f){var _0x3b2f4f=parseInt(_0x3dfd7f,0xa);if(_0x3b2f4f<0x1||_0x3b2f4f>0x1f){throw new Error(EINVALID_DATE);}return _0x3b2f4f;}function timeCompare(_0x17412b,_0x592d8b,_0x469dba){var _0x3794f4=_0x17412b['clone']();var _0x2ca44f=extractTime(_0x592d8b);var _0x36c14c=_0x2ca44f[0x0];var _0x2dc5be=_0x2ca44f[0x1];var _0x119bfd=_0x17412b[_0x6006('0x13')]()['hours'](_0x36c14c)[_0x6006('0x14')](_0x2dc5be);throwIfDateNotValid(_0x119bfd);var _0x2ee67b=extractTime(_0x469dba);var _0x5b2fcd=_0x2ee67b[0x0];var _0xc95c22=_0x2ee67b[0x1];var _0x1c5943=_0x17412b[_0x6006('0x13')]()[_0x6006('0x15')](_0x5b2fcd)[_0x6006('0x14')](_0xc95c22);throwIfDateNotValid(_0x1c5943);if(_0x1c5943['isBefore'](_0x119bfd)){var _0x52ae4c=_0x3794f4[_0x6006('0x13')]()['startOf'](_0x6006('0x16'));var _0x429a7a=_0x3794f4['clone']()[_0x6006('0x17')](_0x6006('0x16'));return _0x3794f4['isBetween'](_0x119bfd,_0x429a7a,undefined,'[]')||_0x3794f4[_0x6006('0x18')](_0x52ae4c,_0x1c5943,undefined,'[]');}else{return _0x3794f4[_0x6006('0x18')](_0x119bfd,_0x1c5943,undefined,'[]');}}module[_0x6006('0xe')][_0x6006('0x19')]=timeCompare;function dowCompare(_0x28caa9,_0x54517d,_0xeac83c){var _0x4f9b73=_0x28caa9[_0x6006('0x9')]('en')[_0x6006('0x1a')](_0x6006('0x1b'))['toLowerCase']();return circularDoWInterval(_0x54517d,_0xeac83c)[_0x6006('0x1c')](_0x4f9b73);}module[_0x6006('0xe')][_0x6006('0x1d')]=dowCompare;function domCompare(_0x1a4fe9,_0x25b6cb,_0x1cb39a){var _0x3c3571=_0x1a4fe9[_0x6006('0x1e')]();if(_0x25b6cb===_0x1cb39a){return _0x3c3571===_0x25b6cb;}else{var _0x10d9f8=_0x1a4fe9[_0x6006('0x1f')]();var _0x3fabf9=_0x25b6cb<_0x1cb39a;let _0x27b255=![];var _0x141010=0x0;var _0x4cd1f4=0x0;if(_0x3fabf9){_0x141010=Math[_0x6006('0x20')](0x1,_0x25b6cb);_0x4cd1f4=Math[_0x6006('0x21')](_0x1cb39a,_0x10d9f8);_0x27b255=_0x3c3571>=_0x141010&&_0x3c3571<=_0x4cd1f4;}else{_0x141010=Math[_0x6006('0x21')](_0x25b6cb,_0x10d9f8);_0x4cd1f4=Math[_0x6006('0x20')](0x1,_0x1cb39a);_0x27b255=_0x3c3571>=_0x141010||_0x3c3571<=_0x4cd1f4;}return _0x27b255;}}module[_0x6006('0xe')][_0x6006('0x22')]=domCompare;function monthCompare(_0x5dc0cd,_0xe70922,_0x5416bc){var _0x1387e6=_0x5dc0cd[_0x6006('0x9')]('en')[_0x6006('0x1a')](_0x6006('0x23'))[_0x6006('0xb')]();return circularMonthInterval(_0xe70922,_0x5416bc)['includes'](_0x1387e6);}module[_0x6006('0xe')]['monthCompare']=monthCompare;function iftime(_0x1c0e73,_0x32a447=moment['tz'][_0x6006('0x24')](),_0x527aca=moment()){if(!validateRx[_0x6006('0x25')](_0x1c0e73)){throw new Error(EINVALID_STRING);}else{var _0x18af6d=(moment[_0x6006('0x26')](_0x527aca)?_0x527aca[_0x6006('0x13')]():moment(_0x527aca))['tz'](_0x32a447)[_0x6006('0x9')]('en');throwIfDateNotValid(_0x18af6d);var _0x5e13b6=_0x1c0e73[_0x6006('0x7')](',');var _0x3de611=_0x5e13b6[0x0];var _0x6cd7ea=_0x5e13b6[0x1];var _0x5c277d=_0x5e13b6[0x2];var _0x52c53b=_0x5e13b6[0x3];let _0x26c5c3=!![];if(_0x3de611!=='*'){var _0x1923ee=_0x3de611['split']('-');var _0x5063f8=_[_0x6006('0x27')](_0x1923ee[0x0],0x5,'0');var _0x366af9=_0x1923ee['length']===0x2?_[_0x6006('0x27')](_0x1923ee[0x1],0x5,'0'):_0x5063f8;_0x26c5c3=timeCompare(_0x18af6d,_0x5063f8,_0x366af9);}let _0x59c285=!![];if(_0x6cd7ea!=='*'){var _0x24b062=_0x6cd7ea[_0x6006('0x7')]('-');var _0xa9767b=_0x24b062[0x0];var _0x1977cf=_0x24b062[_0x6006('0x28')]===0x2?_0x24b062[0x1]:_0xa9767b;_0x59c285=dowCompare(_0x18af6d,_0xa9767b,_0x1977cf);}let _0x40838c=!![];if(_0x5c277d!=='*'){var _0x41d733=_0x5c277d[_0x6006('0x7')]('-');var _0x10011b=parseDom(_0x41d733[0x0]);var _0x5286d2=_0x41d733[_0x6006('0x28')]===0x2?parseDom(_0x41d733[0x1]):_0x10011b;_0x40838c=domCompare(_0x18af6d,_0x10011b,_0x5286d2);}let _0x225acc=!![];if(_0x52c53b!=='*'){var _0x131d2e=_0x52c53b[_0x6006('0x7')]('-');var _0x116911=_0x131d2e[0x0];var _0x49d31a=_0x131d2e['length']===0x2?_0x131d2e[0x1]:_0x131d2e[0x0];_0x225acc=monthCompare(_0x18af6d,_0x116911,_0x49d31a);}return _0x26c5c3&&_0x59c285&&_0x40838c&&_0x225acc;}}module[_0x6006('0xe')]['iftime']=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index cf5bbfa..ea2b128 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90f0=['info','redBG\x20white','red','bold\x20yellow','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','join','format','%s-%s.log','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','message','}}}','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','transports','Console','warn','Logger','File','error','%s-%s','consoleLogger','fileLogger','path','util','moment','winston','debugLevel','toLowerCase'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x90f0,0x180));var _0x090f=function(_0x48cc96,_0x242d75){_0x48cc96=_0x48cc96-0x0;var _0x5cd2d0=_0x90f0[_0x48cc96];return _0x5cd2d0;};'use strict';var path=require(_0x090f('0x0'));var util=require(_0x090f('0x1'));var moment=require(_0x090f('0x2'));var winston=require(_0x090f('0x3'));var config=require('../config/environment');var debugLevel=config[_0x090f('0x4')]?config[_0x090f('0x4')][_0x090f('0x5')]():_0x090f('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x090f('0x7'),'error':_0x090f('0x8'),'warn':_0x090f('0x9'),'info':'white','print':_0x090f('0xa'),'success':_0x090f('0xb'),'http':'gray','verbose':_0x090f('0xc'),'debug':_0x090f('0xd'),'silly':_0x090f('0xe')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x2c7ae5,_0x21a3e5,_0x58990b){var _0x1a46e3=_0x2c7ae5||'/var/log/xcally';return path[_0x090f('0xf')](_0x1a46e3,util[_0x090f('0x10')](_0x090f('0x11'),_0x21a3e5,_0x58990b));}function formatter(_0x1b2e09,_0x39d454){_0x39d454['message']=_0x39d454['message'][_0x090f('0x12')](/@@{/g,_0x090f('0x13'))['replace'](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0x090f('0x12')](/}@/g,'}}');return util[_0x090f('0x10')](_0x090f('0x14'),moment()[_0x090f('0x10')](_0x090f('0x15')),_0x39d454['level']['toUpperCase'](),_0x1b2e09,_0x39d454[_0x090f('0x16')]);}function fileFormat(_0x5922e7,_0x4fbde1){_0x4fbde1[_0x090f('0x16')]=_0x4fbde1[_0x090f('0x16')]['replace'](/@@{/g,_0x090f('0x13'))[_0x090f('0x12')](/}@@/g,_0x090f('0x17'))[_0x090f('0x12')](/@{/g,'{{')[_0x090f('0x12')](/}@/g,'}}');var _0x2601c1=_0x4fbde1[_0x090f('0x18')]&&Object[_0x090f('0x19')](_0x4fbde1[_0x090f('0x18')])[_0x090f('0x1a')]?'\x0a\x09'+JSON[_0x090f('0x1b')](_0x4fbde1[_0x090f('0x18')]):'';return util[_0x090f('0x10')](_0x090f('0x1c'),moment()[_0x090f('0x10')](_0x090f('0x15')),_0x4fbde1[_0x090f('0x1d')]['toUpperCase'](),_0x5922e7,_0x4fbde1[_0x090f('0x16')],_0x2601c1);}function consoleLogger(){var _0x1c20d4=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x090f('0x1e'))][(_0x090f('0x1f'))]({'level':_0x090f('0x20'),'json':![],'formatter':function(_0x333781){return formatter('',_0x333781);}})]});return _0x1c20d4;}function fileLogger(_0x14f41d,_0x1355f6){var _0x2b2071=new winston[(_0x090f('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x090f('0x22'))]({'name':util[_0x090f('0x10')]('%s-%s',_0x14f41d,_0x090f('0x23')),'filename':getLogFileName(_0x1355f6,_0x14f41d,_0x090f('0x23')),'level':_0x090f('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x344391){return fileFormat(_0x14f41d,_0x344391);}}),new winston[(_0x090f('0x1e'))][(_0x090f('0x22'))]({'name':util[_0x090f('0x10')](_0x090f('0x24'),_0x14f41d,debugLevel),'filename':getLogFileName(_0x1355f6,_0x14f41d,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5659f8){return fileFormat(_0x14f41d,_0x5659f8);}}),new winston[(_0x090f('0x1e'))][(_0x090f('0x1f'))]({'level':'warn','json':![],'formatter':function(_0x132451){return fileFormat(_0x14f41d,_0x132451);}})]});return _0x2b2071;}exports[_0x090f('0x25')]=consoleLogger;exports[_0x090f('0x26')]=fileLogger; \ No newline at end of file +var _0xbf5d=['util','moment','winston','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20cyan','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','length','stringify','Logger','Console','warn','transports','File','%s-%s','error','consoleLogger'];(function(_0x38117b,_0x4de96b){var _0x445fe0=function(_0x2f996e){while(--_0x2f996e){_0x38117b['push'](_0x38117b['shift']());}};_0x445fe0(++_0x4de96b);}(_0xbf5d,0x128));var _0xdbf5=function(_0x3b5084,_0x3e5c75){_0x3b5084=_0x3b5084-0x0;var _0x15dbc3=_0xbf5d[_0x3b5084];return _0x15dbc3;};'use strict';var path=require('path');var util=require(_0xdbf5('0x0'));var moment=require(_0xdbf5('0x1'));var winston=require(_0xdbf5('0x2'));var config=require('../config/environment');var debugLevel=config[_0xdbf5('0x3')]?config[_0xdbf5('0x3')][_0xdbf5('0x4')]():_0xdbf5('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':_0xdbf5('0x6'),'error':_0xdbf5('0x7'),'warn':_0xdbf5('0x8'),'info':_0xdbf5('0x9'),'print':_0xdbf5('0xa'),'success':_0xdbf5('0xb'),'http':'gray','verbose':'bold\x20magenta','debug':'bold\x20blue','silly':_0xdbf5('0xc')};winston[_0xdbf5('0xd')](XC_LOG_COLORS);function getLogFileName(_0x2986b2,_0x1d7f39,_0x980468){var _0x503908=_0x2986b2||_0xdbf5('0xe');return path[_0xdbf5('0xf')](_0x503908,util[_0xdbf5('0x10')](_0xdbf5('0x11'),_0x1d7f39,_0x980468));}function formatter(_0x3816bf,_0x76d617){_0x76d617[_0xdbf5('0x12')]=_0x76d617['message']['replace'](/@@{/g,'{{{')[_0xdbf5('0x13')](/}@@/g,_0xdbf5('0x14'))['replace'](/@{/g,'{{')[_0xdbf5('0x13')](/}@/g,'}}');return util[_0xdbf5('0x10')](_0xdbf5('0x15'),moment()[_0xdbf5('0x10')](_0xdbf5('0x16')),_0x76d617[_0xdbf5('0x17')][_0xdbf5('0x18')](),_0x3816bf,_0x76d617['message']);}function fileFormat(_0x45f1d2,_0x4134d9){_0x4134d9['message']=_0x4134d9[_0xdbf5('0x12')][_0xdbf5('0x13')](/@@{/g,_0xdbf5('0x19'))[_0xdbf5('0x13')](/}@@/g,_0xdbf5('0x14'))['replace'](/@{/g,'{{')[_0xdbf5('0x13')](/}@/g,'}}');var _0x3cbae6=_0x4134d9[_0xdbf5('0x1a')]&&Object['keys'](_0x4134d9[_0xdbf5('0x1a')])[_0xdbf5('0x1b')]?'\x0a\x09'+JSON[_0xdbf5('0x1c')](_0x4134d9[_0xdbf5('0x1a')]):'';return util[_0xdbf5('0x10')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0xdbf5('0x10')](_0xdbf5('0x16')),_0x4134d9[_0xdbf5('0x17')]['toUpperCase'](),_0x45f1d2,_0x4134d9['message'],_0x3cbae6);}function consoleLogger(){var _0x43f09a=new winston[(_0xdbf5('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xdbf5('0x1e'))]({'level':_0xdbf5('0x1f'),'json':![],'formatter':function(_0x1e273e){return formatter('',_0x1e273e);}})]});return _0x43f09a;}function fileLogger(_0x26fab2,_0x5914b3){var _0x3d47ad=new winston[(_0xdbf5('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xdbf5('0x20'))][(_0xdbf5('0x21'))]({'name':util[_0xdbf5('0x10')](_0xdbf5('0x22'),_0x26fab2,_0xdbf5('0x23')),'filename':getLogFileName(_0x5914b3,_0x26fab2,_0xdbf5('0x23')),'level':_0xdbf5('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2eb53b){return fileFormat(_0x26fab2,_0x2eb53b);}}),new winston['transports']['File']({'name':util['format']('%s-%s',_0x26fab2,debugLevel),'filename':getLogFileName(_0x5914b3,_0x26fab2,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4af2dc){return fileFormat(_0x26fab2,_0x4af2dc);}}),new winston[(_0xdbf5('0x20'))][(_0xdbf5('0x1e'))]({'level':'warn','json':![],'formatter':function(_0x5d6757){return fileFormat(_0x26fab2,_0x5d6757);}})]});return _0x3d47ad;}exports[_0xdbf5('0x24')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 1dd3040..02a68f8 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 _0x5f2f=['tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','membername','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','lodash','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','clientSecret','securityToken','code'];(function(_0x1924ae,_0x38623a){var _0x1e70ef=function(_0x48f9de){while(--_0x48f9de){_0x1924ae['push'](_0x1924ae['shift']());}};_0x1e70ef(++_0x38623a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x275d85,_0x5a883e){_0x275d85=_0x275d85-0x0;var _0x3cd754=_0x5f2f[_0x275d85];return _0x3cd754;};var _=require(_0xf5f2('0x0'));var sensitiveFields=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3'),_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'phone','mobile',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'accessKey',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'accessToken',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'consumerSecret',_0xf5f2('0x14'),'calleridname','calleridnum',_0xf5f2('0x15'),_0xf5f2('0x16'),'clientEmail',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'accountSid',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21')];function maskSensitiveData(_0x4d97fc){const _0xafe430=/(?!^)[\s\S](?!$)/g;if(_[_0xf5f2('0x22')](_0x4d97fc)){for(const _0x17d656 in _0x4d97fc){if(_[_0xf5f2('0x23')](_0x4d97fc[_0x17d656])){for(let _0x23e23a=0x0;_0x23e23a<_0x4d97fc[_0x17d656][_0xf5f2('0x24')];_0x23e23a++){maskSensitiveData(_0x4d97fc[_0x17d656][_0x23e23a]);}}else if(_[_0xf5f2('0x22')](_0x4d97fc[_0x17d656])){maskSensitiveData(_0x4d97fc[_0x17d656]);}else if(_[_0xf5f2('0x25')](_0x4d97fc[_0x17d656])){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](/{{{/g,_0xf5f2('0x27'))[_0xf5f2('0x26')](/}}}/g,_0xf5f2('0x28'))[_0xf5f2('0x26')](/{{/g,'@{')[_0xf5f2('0x26')](/}}/g,'}@');if(_[_0xf5f2('0x29')](sensitiveFields,_0x17d656)){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](_0xafe430,'*');}}}}}module[_0xf5f2('0x2a')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0xda2d=['@@{','replace','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','key','user','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','isString'];(function(_0x58f5d9,_0x553121){var _0x2c233f=function(_0x497700){while(--_0x497700){_0x58f5d9['push'](_0x58f5d9['shift']());}};_0x2c233f(++_0x553121);}(_0xda2d,0x102));var _0xdda2=function(_0xe72193,_0x4ad5d0){_0xe72193=_0xe72193-0x0;var _0x522965=_0xda2d[_0xe72193];return _0x522965;};var _=require('lodash');var sensitiveFields=[_0xdda2('0x0'),_0xdda2('0x1'),_0xdda2('0x2'),_0xdda2('0x3'),_0xdda2('0x4'),'lastName','street','phone',_0xdda2('0x5'),_0xdda2('0x6'),_0xdda2('0x7'),_0xdda2('0x8'),_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb'),_0xdda2('0xc'),_0xdda2('0xd'),_0xdda2('0xe'),'channelSecret',_0xdda2('0xf'),_0xdda2('0x10'),'authToken',_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0x13'),_0xdda2('0x14'),_0xdda2('0x15'),_0xdda2('0x16'),_0xdda2('0x17'),_0xdda2('0x18'),'privateKey','accesskeyid','secretaccesskey',_0xdda2('0x19'),_0xdda2('0x1a'),_0xdda2('0x1b'),_0xdda2('0x1c'),_0xdda2('0x1d'),_0xdda2('0x1e'),_0xdda2('0x1f'),'registry',_0xdda2('0x20')];function maskSensitiveData(_0x4b0220){const _0xbef148=/(?!^)[\s\S](?!$)/g;if(_[_0xdda2('0x21')](_0x4b0220)){for(const _0x3553d5 in _0x4b0220){if(_[_0xdda2('0x22')](_0x4b0220[_0x3553d5])){for(let _0x1922b1=0x0;_0x1922b1<_0x4b0220[_0x3553d5]['length'];_0x1922b1++){maskSensitiveData(_0x4b0220[_0x3553d5][_0x1922b1]);}}else if(_['isPlainObject'](_0x4b0220[_0x3553d5])){maskSensitiveData(_0x4b0220[_0x3553d5]);}else if(_[_0xdda2('0x23')](_0x4b0220[_0x3553d5])){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5]['replace'](/{{{/g,_0xdda2('0x24'))[_0xdda2('0x25')](/}}}/g,_0xdda2('0x26'))[_0xdda2('0x25')](/{{/g,'@{')[_0xdda2('0x25')](/}}/g,'}@');if(_[_0xdda2('0x27')](sensitiveFields,_0x3553d5)){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5][_0xdda2('0x25')](_0xbef148,'*');}}}}}module[_0xdda2('0x28')][_0xdda2('0x29')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index f3599c4..a3ced00 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x087b=['exports','safeTemplate','lodash','string','replace','isArray','map','isPlainObject','keys','reduce'];(function(_0x3cc634,_0x1fa280){var _0x5530fe=function(_0xf42993){while(--_0xf42993){_0x3cc634['push'](_0x3cc634['shift']());}};_0x5530fe(++_0x1fa280);}(_0x087b,0x11a));var _0xb087=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x087b[_0x2c91e9];return _0x13f0ff;};var _=require(_0xb087('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x35e3d3){return _0x35e3d3==='{{'?'{\x20{\x20':'\x20}\x20}';}function safeTemplate(_0x40e6d6){var _0x5aa7a8=_0x40e6d6;if(typeof _0x40e6d6===_0xb087('0x1')){_0x5aa7a8=_0x40e6d6[_0xb087('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xb087('0x3')](_0x40e6d6)){_0x5aa7a8=_0x40e6d6[_0xb087('0x4')](function(_0x183efd){return safeTemplate(_0x183efd);});}else if(_[_0xb087('0x5')](_0x40e6d6)){_0x5aa7a8=Object[_0xb087('0x6')](_0x40e6d6)[_0xb087('0x7')](function(_0xecf080,_0x36ac30){_0xecf080[_0x36ac30]=safeTemplate(_0x40e6d6[_0x36ac30]);return _0xecf080;},{});}return _0x5aa7a8;}module[_0xb087('0x8')][_0xb087('0x9')]=safeTemplate; \ No newline at end of file +var _0xe511=['\x20}\x20}','string','isArray','map','isPlainObject','reduce','safeTemplate','lodash'];(function(_0x135b61,_0x170347){var _0x4ab680=function(_0x1808d0){while(--_0x1808d0){_0x135b61['push'](_0x135b61['shift']());}};_0x4ab680(++_0x170347);}(_0xe511,0x16f));var _0x1e51=function(_0x424ebd,_0x498c91){_0x424ebd=_0x424ebd-0x0;var _0x586ddf=_0xe511[_0x424ebd];return _0x586ddf;};var _=require(_0x1e51('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x3a7329){return _0x3a7329==='{{'?'{\x20{\x20':_0x1e51('0x1');}function safeTemplate(_0x5b9e45){var _0x253e96=_0x5b9e45;if(typeof _0x5b9e45===_0x1e51('0x2')){_0x253e96=_0x5b9e45['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x1e51('0x3')](_0x5b9e45)){_0x253e96=_0x5b9e45[_0x1e51('0x4')](function(_0x204da7){return safeTemplate(_0x204da7);});}else if(_[_0x1e51('0x5')](_0x5b9e45)){_0x253e96=Object['keys'](_0x5b9e45)[_0x1e51('0x6')](function(_0x21ed6b,_0x5c4590){_0x21ed6b[_0x5c4590]=safeTemplate(_0x5b9e45[_0x5c4590]);return _0x21ed6b;},{});}return _0x253e96;}module['exports'][_0x1e51('0x7')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 57c2091..1befcaf 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a2a=['Updating\x20app.json','exports','fs-extra','../config/environment','root','resolve','server/app.json','legacy-libs','isArray','motion2','apps','NODE_PATH','string','pathExists','then','readJSON','info'];(function(_0x45dea0,_0x4ff5bc){var _0x327046=function(_0x4582a9){while(--_0x4582a9){_0x45dea0['push'](_0x45dea0['shift']());}};_0x327046(++_0x4ff5bc);}(_0x0a2a,0xac));var _0xa0a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a2a[_0x3dd15e];return _0x231fd0;};var fs=require(_0xa0a2('0x0'));var path=require('path');var config=require(_0xa0a2('0x1'));var root=config[_0xa0a2('0x2')];var APP_JSON_PATH=path[_0xa0a2('0x3')](root,_0xa0a2('0x4'));var NODEPATH=path[_0xa0a2('0x3')](root,_0xa0a2('0x5'));function setLegacyLibsNodeEnvPath(_0x3c6032){let _0x44155e=![];if(Array[_0xa0a2('0x6')](_0x3c6032['apps'])){var _0x244774=_0x3c6032['apps']['findIndex'](function(_0x4c65b5){return _0x4c65b5['name']===_0xa0a2('0x7');});if(_0x244774>-0x1){var _0x46c7ea=_0x3c6032[_0xa0a2('0x8')][_0x244774];if(typeof _0x46c7ea['env'][_0xa0a2('0x9')]!==_0xa0a2('0xa')){_0x46c7ea['env']['NODE_PATH']=NODEPATH;_0x44155e=!![];}}return{'appConfig':_0x3c6032,'updated':_0x44155e};}}function updateAppConfig(_0x53a8fd){return fs[_0xa0a2('0xb')](APP_JSON_PATH)[_0xa0a2('0xc')](function(_0x351d40){if(_0x351d40){return fs[_0xa0a2('0xd')](APP_JSON_PATH)[_0xa0a2('0xc')](function(_0x4ffeae){var _0x4a9788=setLegacyLibsNodeEnvPath(_0x4ffeae);if(_0x4a9788['updated']){_0x53a8fd[_0xa0a2('0xe')](_0xa0a2('0xf'));return fs['writeJSON'](APP_JSON_PATH,_0x4ffeae,{'spaces':0x2});}else{return Promise[_0xa0a2('0x3')]();}});}else{return Promise[_0xa0a2('0x3')]();}});}module[_0xa0a2('0x10')]=updateAppConfig; \ No newline at end of file +var _0x5763=['apps','findIndex','env','NODE_PATH','string','pathExists','then','updated','Updating\x20app.json','writeJSON','exports','fs-extra','../config/environment','root','resolve','server/app.json','legacy-libs','isArray'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x5763,0xad));var _0x3576=function(_0x10e2c9,_0x489aab){_0x10e2c9=_0x10e2c9-0x0;var _0x426947=_0x5763[_0x10e2c9];return _0x426947;};var fs=require(_0x3576('0x0'));var path=require('path');var config=require(_0x3576('0x1'));var root=config[_0x3576('0x2')];var APP_JSON_PATH=path[_0x3576('0x3')](root,_0x3576('0x4'));var NODEPATH=path[_0x3576('0x3')](root,_0x3576('0x5'));function setLegacyLibsNodeEnvPath(_0xb865da){let _0x57fdf2=![];if(Array[_0x3576('0x6')](_0xb865da['apps'])){var _0x32fb5d=_0xb865da[_0x3576('0x7')][_0x3576('0x8')](function(_0x1e69e3){return _0x1e69e3['name']==='motion2';});if(_0x32fb5d>-0x1){var _0x512b40=_0xb865da[_0x3576('0x7')][_0x32fb5d];if(typeof _0x512b40[_0x3576('0x9')][_0x3576('0xa')]!==_0x3576('0xb')){_0x512b40['env'][_0x3576('0xa')]=NODEPATH;_0x57fdf2=!![];}}return{'appConfig':_0xb865da,'updated':_0x57fdf2};}}function updateAppConfig(_0x1417b5){return fs[_0x3576('0xc')](APP_JSON_PATH)['then'](function(_0x662c5e){if(_0x662c5e){return fs['readJSON'](APP_JSON_PATH)[_0x3576('0xd')](function(_0x16c891){var _0x15c764=setLegacyLibsNodeEnvPath(_0x16c891);if(_0x15c764[_0x3576('0xe')]){_0x1417b5['info'](_0x3576('0xf'));return fs[_0x3576('0x10')](APP_JSON_PATH,_0x16c891,{'spaces':0x2});}else{return Promise[_0x3576('0x3')]();}});}else{return Promise[_0x3576('0x3')]();}});}module[_0x3576('0x11')]=updateAppConfig; \ No newline at end of file -- 1.7.1